import{a as be}from"./chunk-2FO2222C.js";import{a as he}from"./chunk-RFCZMTXP.js";import{b as Ce}from"./chunk-UIGFCYGO.js";import{c as Y}from"./chunk-72JDPJS6.js";import{b as G}from"./chunk-5OZTUYJC.js";import{d as $}from"./chunk-ICTDV7DB.js";import{J as W}from"./chunk-CWWVHRJU.js";import{a as me}from"./chunk-7JA7UHZ2.js";import{a as H}from"./chunk-RU43IR5J.js";import{a as L}from"./chunk-Y7IP5WLG.js";import{r as fe,t as ve,u as xe,v as ue}from"./chunk-SLGBXDUF.js";import{a as _e}from"./chunk-LY6HB4BL.js";import{a as N}from"./chunk-SU6CJJJO.js";import{a as ge}from"./chunk-UDT5ZZZ2.js";import{a as U}from"./chunk-HBJ2IG4O.js";import{a as se}from"./chunk-ILYMG6ZI.js";import{r as j,t as pe}from"./chunk-MXUIPT66.js";import{Aa as x,Ab as r,Ba as u,Bb as h,Cb as b,Db as y,Dc as B,Eb as ee,Fb as I,Gd as P,Ka as F,Kb as C,Lb as s,Ob as q,Ua as i,Va as g,Vc as re,Wc as oe,Xb as O,Xc as A,Yb as a,Zb as M,_b as d,ad as ae,bd as le,fh as de,gb as Z,gd as ce,ib as v,kc as te,lc as ie,ob as p,pf as V,rc as m,rg as k,sc as _,ta as w,vc as ne,wc as S,yh as R,zb as o}from"./chunk-N6B2OJOY.js";function Te(t,n){if(t&1&&h(0,"cx-icon",6),t&2){let e=s();p("type",e.icons.ARROW_UP)}}function Fe(t,n){if(t&1&&h(0,"cx-icon",6),t&2){let e=s();p("type",e.icons.ARROW_DOWN)}}function we(t,n){if(t&1){let e=I();o(0,"div",7),C("click",function(){x(e);let c=s();return u(c.triggerPrintConfirmation())}),a(1),m(2,"cxTranslate"),r()}t&2&&(i(),d(" ",_(2,1,"orderDetails.orderConfirmation")," "))}function Me(t,n){if(t&1){let e=I();o(0,"div",7),C("click",function(){x(e);let c=s();return u(c.barcodeCatalog())}),a(1),m(2,"cxTranslate"),r()}t&2&&(i(),d(" ",_(2,1,"orderDetails.createEAN")," "))}function Be(t,n){if(t&1){let e=I();o(0,"div",7),C("click",function(){x(e);let c=s();return u(c.consignmentsPopup())}),a(1),m(2,"cxTranslate"),r()}t&2&&(i(),d(" ",_(2,1,"orderDetails.connectedOrders")," "))}function Ae(t,n){if(t&1){let e=I();o(0,"div",7),C("click",function(){x(e);let c=s();return u(c.modificationsPopup())}),a(1),m(2,"cxTranslate"),r()}t&2&&(i(),d(" ",_(2,1,"orderDetails.showDiff")," "))}var ye=(()=>{let n=class n{constructor(){this.orderHasChanged=!1,this.hasConsignments=!1,this.canCreateBarcodeCatalog=!1,this.isOrderApproved=!1,this.isOrderPrintable=!1,this.createBarcode=new F,this.openConsignmentsPopup=new F,this.openModificationsPopup=new F,this.printConfirmation=new F,this.icons=se,this.isExpanded=!1}barcodeCatalog(){this.createBarcode.emit()}consignmentsPopup(){this.openConsignmentsPopup.emit()}modificationsPopup(){this.openModificationsPopup.emit()}toggleDropdown(){this.isExpanded=!this.isExpanded}triggerPrintConfirmation(){this.printConfirmation.emit()}};n.\u0275fac=function(c){return new(c||n)},n.\u0275cmp=w({type:n,selectors:[["foerch-order-detail-mobile-actions"]],inputs:{orderHasChanged:"orderHasChanged",hasConsignments:"hasConsignments",canCreateBarcodeCatalog:"canCreateBarcodeCatalog",isOrderApproved:"isOrderApproved",isOrderPrintable:"isOrderPrintable"},outputs:{createBarcode:"createBarcode",openConsignmentsPopup:"openConsignmentsPopup",openModificationsPopup:"openModificationsPopup",printConfirmation:"printConfirmation"},decls:12,vars:9,consts:[["ngbDropdown","","placement","bottom-right",3,"openChange"],["ngbDropdownToggle","",1,"btn","btn-block","dropdown-toggle","d-flex","justify-content-between"],[1,"dropdown-text"],[3,"type",4,"ngIf"],["ngbDropdownMenu",""],["class","btn btn-link_secondary","ngbDropdownItem","",3,"click",4,"ngIf"],[3,"type"],["ngbDropdownItem","",1,"btn","btn-link_secondary",3,"click"]],template:function(c,f){c&1&&(o(0,"div",0),C("openChange",function(){return f.toggleDropdown()}),o(1,"button",1)(2,"span",2),a(3),m(4,"cxTranslate"),r(),v(5,Te,1,1,"cx-icon",3)(6,Fe,1,1,"cx-icon",3),r(),o(7,"div",4),v(8,we,3,3,"div",5)(9,Me,3,3,"div",5)(10,Be,3,3,"div",5)(11,Ae,3,3,"div",5),r()()),c&2&&(i(3),M(_(4,7,"common.select")),i(2),p("ngIf",f.isExpanded),i(),p("ngIf",!f.isExpanded),i(2),p("ngIf",f.isOrderPrintable),i(),p("ngIf",f.canCreateBarcodeCatalog),i(),p("ngIf",f.hasConsignments),i(),p("ngIf",f.orderHasChanged))},dependencies:[A,j,ue,xe,ve,fe,R],encapsulation:2,changeDetection:0});let t=n;return t})();var Ve=function(t,n,e,l){var c=arguments.length,f=c<3?n:l===null?l=Object.getOwnPropertyDescriptor(n,e):l,D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(t,n,e,l);else for(var T=t.length-1;T>=0;T--)(D=t[T])&&(f=(c<3?D(f):c>3?D(n,e,f):D(n,e))||f);return c>3&&f&&Object.defineProperty(n,e,f),f},ke=function(t,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,n)},Re=(t,n)=>({currencyCode:t,localeCode:n}),je=(t,n,e)=>[t,n,"symbol","1.2",e];function Ne(t,n){if(t&1&&(b(0),o(1,"span",31),h(2,"cx-icon",9),r(),y()),t&2){let e=s(3);i(2),p("type",e.icons.SUCCESS)}}function He(t,n){if(t&1&&(o(0,"span",32),h(1,"cx-icon",9),r()),t&2){let e=s(3);i(),p("type",e.icons.CLOSE)}}function Le(t,n){if(t&1&&(o(0,"div",30),v(1,Ne,3,1,"ng-container",11)(2,He,2,1,"ng-template",null,4,S),r()),t&2){let e=O(3),l=s(2);i(),p("ngIf",l.isOrderApproved)("ngIfElse",e)}}function Ue(t,n){if(t&1&&(o(0,"div",20)(1,"div",21),a(2),m(3,"cxTranslate"),r(),o(4,"div",23),a(5),r()()),t&2){let e=s(2);i(2),d(" ",_(3,2,"orderDetails.approver")," "),i(3),d(" ",(e.order.approver==null?null:e.order.approver.name)||"-"," ")}}function We(t,n){if(t&1&&(o(0,"div",20)(1,"div",21),a(2),m(3,"cxTranslate"),r(),o(4,"div",23),a(5),r()()),t&2){let e=s(2);i(2),d(" ",_(3,2,"orderDetails.comment")," "),i(3),d(" ",e.order.b2BComment.comment," ")}}function $e(t,n){if(t&1&&(o(0,"div",20)(1,"div",21),a(2),m(3,"cxTranslate"),r(),o(4,"div",23),a(5),r()()),t&2){let e=s(2);i(2),d(" ",_(3,2,"orderDetails.customOrderNumber")," "),i(3),d(" ",e.order.purchaseOrderNumber," ")}}function Ge(t,n){t&1&&ee(0)}function Ye(t,n){if(t&1&&(b(0),h(1,"foerch-address",33),y()),t&2){let e=s(2);i(),p("address",e.deliveryAddress)("showAddressName",!1)}}function qe(t,n){if(t&1&&(b(0),h(1,"foerch-address",33),y()),t&2){let e=s(2);i(),p("address",(e.order.paymentInfo==null?null:e.order.paymentInfo.billingAddress)||(e.order.unit==null?null:e.order.unit.contactAddress))("showAddressName",!1)}}function ze(t,n){if(t&1&&(b(0),o(1,"span",34),a(2),m(3,"cxTranslate"),r(),y()),t&2){let e=s(3);i(),p("ngClass",e.order.orderHasChanged?"text-warning":"text-success"),i(),d(" ",_(3,2,e.order.orderHasChanged?"orderDetails.changed":"orderDetails.approved")," ")}}function Je(t,n){t&1&&(o(0,"span",35),a(1),m(2,"cxTranslate"),r()),t&2&&(i(),M(_(2,1,"orderDetails.rejected")))}function Ke(t,n){if(t&1&&(o(0,"div",27)(1,"div",21),a(2),m(3,"cxTranslate"),r(),o(4,"div",23),v(5,ze,4,4,"ng-container",11),r(),v(6,Je,3,3,"ng-template",null,5,S),r()),t&2){let e=O(7),l=s(2);i(2),d(" ",_(3,3,"orderDetails.approvement")," "),i(3),p("ngIf",l.isOrderApproved)("ngIfElse",e)}}function Qe(t,n){if(t&1){let e=I();b(0),o(1,"div",12)(2,"div",13)(3,"div",14)(4,"div",15),a(5),r(),v(6,Le,4,2,"div",16),r()(),o(7,"div",17)(8,"div",18)(9,"div",19)(10,"div",20)(11,"div",21),a(12),m(13,"cxTranslate"),r(),o(14,"div",22),m(15,"foerchOrderStatusGroupStyleMapper"),a(16),r()(),o(17,"div",20)(18,"div",21),a(19),m(20,"cxTranslate"),r(),o(21,"div",23),a(22),m(23,"cxDate"),r()(),o(24,"div",20)(25,"div",21),a(26),m(27,"cxTranslate"),r(),o(28,"div",23),a(29),r()(),o(30,"div",20)(31,"div",21),a(32),m(33,"cxTranslate"),r(),o(34,"div",24),a(35),r()(),o(36,"div",20)(37,"div",21),a(38),m(39,"cxTranslate"),r(),o(40,"div",24),a(41),r()(),o(42,"div",20)(43,"div",21),a(44),m(45,"cxTranslate"),r(),o(46,"div",23),a(47),m(48,"cxTranslate"),r()(),v(49,Ue,6,4,"div",25)(50,We,6,4,"div",25)(51,$e,6,4,"div",25)(52,Ge,1,0,"ng-container",26),r(),o(53,"div")(54,"div",27)(55,"div",21),a(56),m(57,"cxTranslate"),r(),o(58,"div",23),v(59,Ye,2,2,"ng-container",11),r()(),o(60,"div",27)(61,"div",21),a(62),m(63,"cxTranslate"),r(),o(64,"div",23),v(65,qe,2,2,"ng-container",11),r()(),v(66,Ke,8,5,"div",28),r(),o(67,"foerch-order-detail-mobile-actions",29),m(68,"async"),C("createBarcode",function(){x(e);let c=s();return u(c.createBarcode())})("openConsignmentsPopup",function(){x(e);let c=s();return u(c.openConsignmentsPopup())})("openModificationsPopup",function(){x(e);let c=s();return u(c.openModificationsPopup())})("printConfirmation",function(){x(e);let c=s();return u(c.printConfirmation())}),r()()()(),y()}if(t&2){let e=s(),l=O(12),c=O(14),f=O(16);i(5),d(" ",e.order.code," "),i(),p("ngIf",e.hasApprovalProcess&&!e.isOrderPending),i(6),d(" ",_(13,33,"orderDetails.status")," "),i(2),p("ngClass",_(15,35,e.status)),i(2),d(" ",e.order.statusDisplay||"-"," "),i(3),d(" ",_(20,37,"common.orderedAt")," "),i(3),d(" ",_(23,39,e.order.created)||"-"," "),i(4),d(" ",_(27,41,"orderDetails.channel")," "),i(3),d(" ",e.order.salesApplication||"-"," "),i(3),d(" ",_(33,43,"orderDetails.user")," "),i(2),q("title",(e.order.user==null?null:e.order.user.name)||"-"),i(),d(" ",(e.order.user==null?null:e.order.user.name)||"-"," "),i(3),d(" ",_(39,45,"orderDetails.customerId")," "),i(2),q("title",(e.order.unit==null?null:e.order.unit.name)||"-"),i(),d(" ",(e.order.unit==null?null:e.order.unit.displayUid)||(e.order.unit==null?null:e.order.unit.uid)||"-"," "),i(3),d(" ",_(45,47,"orderDetails.paymentMethod")," "),i(3),d(" ",(e.order.paymentInfo==null?null:e.order.paymentInfo.defaultPayment)||_(48,49,"orderDetails.paymentInvoice")," "),i(2),p("ngIf",e.order.approver),i(),p("ngIf",e.order.b2BComment==null?null:e.order.b2BComment.comment),i(),p("ngIf",e.order.purchaseOrderNumber),i(),p("ngTemplateOutlet",e.order.fees?l:c),i(4),d(" ",_(57,51,"orderDetails.shippedOn")," "),i(3),p("ngIf",e.deliveryAddress)("ngIfElse",f),i(3),d(" ",_(63,53,"orderDetails.billingAddress")," "),i(3),p("ngIf",(e.order.paymentInfo==null?null:e.order.paymentInfo.billingAddress)||(e.order.unit==null?null:e.order.unit.contactAddress))("ngIfElse",f),i(),p("ngIf",e.hasApprovalProcess&&!e.isOrderPending),i(),p("canCreateBarcodeCatalog",_(68,55,e.hasBarcodeCatalogPermission$))("hasConsignments",e.hasConsignments)("isOrderApproved",e.isOrderApproved)("isOrderPrintable",e.isOrderPrintable)("orderHasChanged",e.order.orderHasChanged)}}function Xe(t,n){if(t&1){let e=I();b(0),o(1,"div",36)(2,"foerch-cart-mobile-body",37),C("markEntry",function(c){x(e);let f=s();return u(f.markCartEntry(c))}),r(),o(3,"foerch-cart-mobile-footer",38),C("applyBulkAction",function(c){x(e);let f=s();return u(f.applyBulkAction(c))})("markToggle",function(){x(e);let c=s();return u(c.toggleAll())}),r()(),y()}if(t&2){let e=s();i(2),p("cartConfig",e.cartConfig)("items",e.orderEntries)("selectionHelper",e.selectionHelper),i(),p("bulkOptions",e.bulkActionOptions)("footerConfig",e.footerConfig)("selectAll",e.selectionHelper.areAllSelected())("totalPrice",e.order.totalPrice)}}function Ze(t,n){t&1&&(o(0,"div"),h(1,"cx-spinner"),r())}function et(t,n){t&1&&(o(0,"div",40)(1,"div",41)(2,"div",42),a(3),m(4,"cxTranslate"),r()()()),t&2&&(i(3),d(" ",_(4,1,"orderDetails.emptyTable")," "))}function tt(t,n){if(t&1&&v(0,et,5,3,"div",39),t&2){let e=s();p("ngIf",e.isLoaded)}}function it(t,n){if(t&1&&(o(0,"div",41)(1,"div",21),a(2),m(3,"cxTranslate"),r(),o(4,"div",23),a(5),r()()),t&2){let e=s(2);i(2),d(" ",_(3,2,"orderDetails.value")," "),i(3),d(" ",e.order.subTotal.formattedValue||"-"," ")}}function nt(t,n){if(t&1&&(o(0,"div",41)(1,"div",21),a(2),r(),o(3,"div",23),a(4),m(5,"currency"),r()()),t&2){let e=n.$implicit,l=s().ngIf;i(2),d(" ",e.type.name," "),i(2),d(" ",(e.value==null?null:e.value.formattedValue)||ne(5,2,ie(8,je,e.value==null?null:e.value.value,l.currencyCode,l.localeCode))," ")}}function rt(t,n){if(t&1&&(b(0),v(1,nt,6,12,"div",44),y()),t&2){let e=s(3);i(),p("ngForOf",e.order.fees)("ngForTrackBy",e.trackByIndex)}}function ot(t,n){if(t&1&&(b(0),v(1,rt,2,2,"ng-container",10),m(2,"async"),m(3,"async"),y()),t&2){let e=s(2);i(),p("ngIf",te(5,Re,_(2,1,e.currencyCode$),_(3,3,e.localeCode$)))}}function at(t,n){if(t&1&&(o(0,"div",20)(1,"div",19),v(2,it,6,4,"div",43)(3,ot,4,8,"ng-container",10),o(4,"div",41)(5,"div",21),a(6),m(7,"cxTranslate"),r(),o(8,"div",23),a(9),r()()()()),t&2){let e=s();i(2),p("ngIf",e.order.subTotal),i(),p("ngIf",e.order.fees&&e.order.fees.length>0),i(3),d(" ",_(7,4,"orderDetails.totalValue")," "),i(3),d(" ",(e.totalPrice==null?null:e.totalPrice.formattedValue)||"-"," ")}}function lt(t,n){if(t&1&&(o(0,"div",20)(1,"div",21),a(2),m(3,"cxTranslate"),r(),o(4,"div",23),a(5),r()()),t&2){let e=s();i(2),d(" ",_(3,2,"orderDetails.value")," "),i(3),d(" ",(e.totalPrice==null?null:e.totalPrice.formattedValue)||"-"," ")}}function ct(t,n){t&1&&a(0,"-")}var E,Ie=(E=class extends be{constructor(n,e,l,c,f,D,T,z,J,K,Q,X){super(n,e,l,c,f,D,T,z,J,K,Q,X),this.barcodeCatalogItemService=n,this.activatedRoute=e,this.orderService=l,this.activeCartService=c,this.watchlistService=f,this.modalService=D,this.routingService=T,this.cd=z,this.occEndpointsService=J,this.permissionService=K,this.currencyService=Q,this.currencyLocaleService=X}handleResults(n){n.order&&(this.order=n.order,this.currentConOrderId?this.orderEntries=this.getConsignmentOrderEntries():this.orderEntries=n.order.entries,this.selectionHelper.updateItems(this.orderEntries.map(e=>({id:e.pk,item:e}))),this.updateData()),this.isLoading=n.loading,this.isLoaded=n.loaded,this.isEmptyList=!this.orderEntries||this.orderEntries.length===0,this.cd.detectChanges()}getConsignmentOrderEntries(){let n=[];if(this.order){let e=(this.order.consignments||[]).find(l=>l.code===this.currentConOrderId);n=e?(e.entries||[]).map(l=>l.orderEntry):[]}return n}},E.\u0275fac=function(e){return new(e||E)(g($),g(P),g(Y),g(W),g(N),g(L),g(U),g(B),g(V),g(H),g(k),g(G))},E.\u0275cmp=w({type:E,selectors:[["foerch-order-detail-mobile"]],features:[Z],decls:17,vars:8,consts:[["noArticles",""],["withFees",""],["withoutFees",""],["emptyField",""],["orderRejected",""],["rejected",""],[1,"row","justify-content-between","mb-2","mb-md-4"],[1,"col-md-auto"],[1,"btn","btn-tertiary","btn-back",3,"click"],[3,"type"],[4,"ngIf"],[4,"ngIf","ngIfElse"],[1,"costCenterNode"],[1,"costCenterNode-head"],[1,"d-flex","align-items-center","justify-content-between"],[1,"orderDetail-title"],["class","orderDetail-status",4,"ngIf"],[1,"costCenterNode-body","orderDetail-body"],[1,"costCenterNode-right"],[1,"row"],[1,"col-6"],[1,"orderDetail-key"],[1,"orderDetail-value",3,"ngClass"],[1,"orderDetail-value"],[1,"orderDetail-value",3,"title"],["class","col-6",4,"ngIf"],[4,"ngTemplateOutlet"],[1,"pb-2"],["class","pb-2",4,"ngIf"],[3,"createBarcode","openConsignmentsPopup","openModificationsPopup","printConfirmation","canCreateBarcodeCatalog","hasConsignments","isOrderApproved","isOrderPrintable","orderHasChanged"],[1,"orderDetail-status"],[1,"icon-success"],[1,"icon-secondary"],[3,"address","showAddressName"],[3,"ngClass"],[1,"text-danger"],[1,"orderTemplateItem-wrapper"],[3,"markEntry","cartConfig","items","selectionHelper"],[3,"applyBulkAction","markToggle","bulkOptions","footerConfig","selectAll","totalPrice"],["class","row emptyState",4,"ngIf"],[1,"row","emptyState"],[1,"col-12"],[1,"emptyState-text"],["class","col-12",4,"ngIf"],["class","col-12",4,"ngFor","ngForOf","ngForTrackBy"]],template:function(e,l){if(e&1){let c=I();o(0,"div",6)(1,"div",7)(2,"a",8),C("click",function(){return x(c),u(l.cancel())}),h(3,"cx-icon",9),a(4),m(5,"cxTranslate"),r()()(),v(6,Qe,69,57,"ng-container",10)(7,Xe,4,7,"ng-container",11)(8,Ze,2,0,"div",10)(9,tt,1,1,"ng-template",null,0,S)(11,at,10,6,"ng-template",null,1,S)(13,lt,6,4,"ng-template",null,2,S)(15,ct,1,0,"ng-template",null,3,S)}if(e&2){let c=O(10);i(3),p("type",l.icons.ARROW_LEFT),i(),d(" ",_(5,6,"common.back")," "),i(2),p("ngIf",!l.isLoading&&l.order),i(),p("ngIf",!l.isLoading&&!l.isEmptyList)("ngIfElse",c),i(),p("ngIf",l.isLoading)}},dependencies:[re,oe,A,ae,j,pe,Ce,he,me,ye,le,ce,R,de,ge],encapsulation:2,changeDetection:0}),E);Ie=Ve([_e(),ke("design:paramtypes",[$,P,Y,W,N,L,U,B,V,H,k,G])],Ie);export{Ie as a};