import{a as De}from"./chunk-EDJZKS4R.js";import{a as Pe}from"./chunk-GGDSSJJJ.js";import{c as re}from"./chunk-72JDPJS6.js";import{b as Oe}from"./chunk-AFYHCFWY.js";import{b as ie}from"./chunk-5OZTUYJC.js";import{d as ne}from"./chunk-ICTDV7DB.js";import{J as te}from"./chunk-CWWVHRJU.js";import{a as Te}from"./chunk-7JA7UHZ2.js";import{a as Z}from"./chunk-RU43IR5J.js";import{a as P}from"./chunk-Y7IP5WLG.js";import{a as X}from"./chunk-LY6HB4BL.js";import{a as J}from"./chunk-SU6CJJJO.js";import{g as Fe}from"./chunk-L7CU4UNF.js";import{a as be}from"./chunk-UDT5ZZZ2.js";import{a as ee}from"./chunk-HBJ2IG4O.js";import{a as Se}from"./chunk-VQWPF2OP.js";import{K as A,T as le,i as Ee}from"./chunk-FBI7JGZC.js";import{a as H}from"./chunk-ILYMG6ZI.js";import{c as Ie}from"./chunk-CREVD7YA.js";import{U as Ce,f as ye,r as Q,x as z}from"./chunk-MXUIPT66.js";import{Aa as F,Ab as r,Ba as b,Bb as E,Cb as I,Db as T,Dc as U,Eb as y,Fb as D,Gd as q,Kb as O,Kd as xe,Lb as _,Ob as de,Ua as i,Va as h,Vc as ue,Wc as $,Wg as ve,Xb as x,Xc as V,Yb as a,Zb as L,_b as c,ad as W,bd as G,fh as he,gb as me,gd as ge,ib as u,jc as j,kc as k,lc as _e,ob as d,pf as Y,rc as p,rg as K,sc as s,ta as w,vc as fe,wc as C,yh as N,za as se,zb as o}from"./chunk-N6B2OJOY.js";var Le=["foerch-modified-entry",""],oe=(e,n)=>({code:e,name:n}),ae=e=>({cxRoute:"product",params:e});function Ue(e,n){e&1&&y(0)}function $e(e,n){e&1&&y(0)}function We(e,n){e&1&&y(0)}function Ge(e,n){e&1&&y(0)}function qe(e,n){e&1&&y(0)}function Ye(e,n){e&1&&y(0)}function Ke(e,n){e&1&&y(0)}function Qe(e,n){if(e&1){let t=D();I(0),o(1,"div",10)(2,"div",11)(3,"div",12)(4,"a",13),p(5,"foerchStrip"),p(6,"cxUrl"),O("click",function(){F(t);let m=_(2);return b(m.dismiss())}),E(7,"cx-media",14),r()()(),o(8,"div",15)(9,"div",16)(10,"a",17),p(11,"foerchStrip"),p(12,"cxUrl"),O("click",function(){F(t);let m=_(2);return b(m.modalService.dismissActiveModal())}),a(13),r(),o(14,"div",18),a(15),r(),o(16,"div",19),a(17),r(),u(18,Ue,1,0,"ng-container",20)(19,$e,1,0,"ng-container",20)(20,We,1,0,"ng-container",20)(21,Ge,1,0,"ng-container",20)(22,qe,1,0,"ng-container",20)(23,Ye,1,0,"ng-container",20)(24,Ke,1,0,"ng-container",20),r()()(),T()}if(e&2){_();let t=x(5),l=x(7),m=x(9),g=x(11),v=x(13),S=x(15),R=x(17),f=_();i(4),d("routerLink",s(6,15,j(24,ae,k(21,oe,f.orderEntry.product.baseProduct,s(5,13,f.orderEntry.product.baseProductName))))),i(3),d("container",(f.orderEntry.product==null?null:f.orderEntry.product.images)&&(f.orderEntry.product==null?null:f.orderEntry.product.images.PRIMARY)),i(3),d("routerLink",s(12,19,j(29,ae,k(26,oe,f.orderEntry.product.baseProduct,s(11,17,f.orderEntry.product.baseProductName))))),i(3),c(" ",f.orderEntry.product==null?null:f.orderEntry.product.baseProductName," "),i(2),c(" ",f.orderEntry.product==null?null:f.orderEntry.product.code," "),i(2),c(" ",f.orderEntry.product==null?null:f.orderEntry.product.name," "),i(),d("ngTemplateOutlet",t),i(),d("ngTemplateOutlet",l),i(),d("ngTemplateOutlet",v),i(),d("ngTemplateOutlet",S),i(),d("ngTemplateOutlet",R),i(),d("ngTemplateOutlet",g),i(),d("ngTemplateOutlet",m)}}function ze(e,n){if(e&1&&(I(0),o(1,"span",29),a(2),p(3,"cxTranslate"),r(),a(4),T()),e&2){let t=_(3);i(2),c("",s(3,2,"cartItems.commentLabel"),":"),i(2),c(" ",t.orderEntry.comment," ")}}function Je(e,n){e&1&&y(0)}function Xe(e,n){e&1&&y(0)}function Ze(e,n){e&1&&y(0)}function et(e,n){e&1&&y(0)}function tt(e,n){e&1&&y(0)}function nt(e,n){e&1&&y(0)}function it(e,n){e&1&&y(0)}function rt(e,n){if(e&1){let t=D();o(0,"td",21)(1,"a",22),p(2,"foerchStrip"),p(3,"cxUrl"),O("click",function(){F(t);let m=_(2);return b(m.dismiss())}),E(4,"cx-media",14),o(5,"div",23),a(6),r()()(),o(7,"td")(8,"a",24),p(9,"foerchStrip"),p(10,"cxUrl"),O("click",function(){F(t);let m=_(2);return b(m.modalService.dismissActiveModal())}),a(11),r(),o(12,"div",25),a(13),r(),u(14,ze,5,4,"ng-container",8)(15,Je,1,0,"ng-container",20)(16,Xe,1,0,"ng-container",20)(17,Ze,1,0,"ng-container",20),r(),o(18,"td")(19,"div"),a(20),r(),o(21,"div"),a(22),r(),u(23,et,1,0,"ng-container",20)(24,tt,1,0,"ng-container",20),r(),o(25,"td"),E(26,"foerch-cart-item-vpe",26),p(27,"foerchOrderEntryToVPE"),u(28,nt,1,0,"ng-container",20)(29,it,1,0,"ng-container",20),r(),o(30,"td"),a(31),r(),o(32,"td"),a(33),r(),o(34,"td",27),a(35),r(),o(36,"td",27)(37,"span",28),a(38),r()()}if(e&2){_();let t=x(5),l=x(7),m=x(9),g=x(11),v=x(13),S=x(15),R=x(17),f=_();i(),d("routerLink",s(3,25,j(36,ae,k(33,oe,f.orderEntry.product.baseProduct,s(2,23,f.orderEntry.product.baseProductName))))),i(3),d("container",(f.orderEntry.product==null?null:f.orderEntry.product.images)&&(f.orderEntry.product==null?null:f.orderEntry.product.images.PRIMARY)),i(2),c(" ",f.orderEntry.product==null?null:f.orderEntry.product.code," "),i(2),d("routerLink",s(10,29,j(41,ae,k(38,oe,f.orderEntry.product.baseProduct,s(9,27,f.orderEntry.product.baseProductName))))),i(3),c(" ",f.orderEntry.product==null?null:f.orderEntry.product.baseProductName," "),i(2),c(" ",f.orderEntry.product==null?null:f.orderEntry.product.name," "),i(),d("ngIf",f.orderEntry.comment),i(),d("ngTemplateOutlet",t),i(),d("ngTemplateOutlet",l),i(),d("ngTemplateOutlet",v),i(3),c(" ",f.orderEntry.costCenter==null?null:f.orderEntry.costCenter.name," "),i(2),c(" ",f.orderEntry.orderReason==null?null:f.orderEntry.orderReason.name," "),i(),d("ngTemplateOutlet",S),i(),d("ngTemplateOutlet",R),i(2),d("appendDropdownToBody",!0)("isReadOnly",!0)("item",s(27,31,f.orderEntry)),i(2),d("ngTemplateOutlet",g),i(),d("ngTemplateOutlet",m),i(2),c(" ",f.orderEntry.product.quantityUnit==null?null:f.orderEntry.product.quantityUnit.singular," "),i(2),c(" ",f.orderEntry.priceUnit," "),i(2),c(" ",f.orderEntry.basePrice==null?null:f.orderEntry.basePrice.formattedValue," "),i(3),c(" ",f.orderEntry.totalPrice==null?null:f.orderEntry.totalPrice.formattedValue," ")}}function ot(e,n){e&1&&(o(0,"div",31),a(1),p(2,"cxTranslate"),r()),e&2&&(i(),c(" ",s(2,1,"orderDetails.modifications.entryDeleted")," "))}function at(e,n){if(e&1&&u(0,ot,3,3,"div",30),e&2){let t=_(2);d("ngIf",t.orderHistoryEntry.entryDeleted)}}function ct(e,n){e&1&&(o(0,"div",33),a(1),p(2,"cxTranslate"),r()),e&2&&(i(),c(" ",s(2,1,"orderDetails.modifications.entryAdded")," "))}function dt(e,n){if(e&1&&u(0,ct,3,3,"div",32),e&2){let t=_(2);d("ngIf",t.orderHistoryEntry.entryAdded)}}function lt(e,n){e&1&&(o(0,"div",31),a(1),p(2,"cxTranslate"),r()),e&2&&(i(),c(" ",s(2,1,"orderDetails.modifications.vpeHasChanged")," "))}function pt(e,n){if(e&1&&u(0,lt,3,3,"div",30),e&2){let t=_(2);d("ngIf",t.orderHistoryEntry.vpeHasChanged)}}function st(e,n){e&1&&(o(0,"div",31),a(1),p(2,"cxTranslate"),r()),e&2&&(i(),c(" ",s(2,1,"orderDetails.modifications.qtyHasChanged")," "))}function mt(e,n){if(e&1&&u(0,st,3,3,"div",30),e&2){let t=_(2);d("ngIf",t.orderHistoryEntry.qtyHasChanged)}}function _t(e,n){e&1&&(o(0,"div",31),a(1),p(2,"cxTranslate"),r()),e&2&&(i(),c(" ",s(2,1,"orderDetails.modifications.commentHasChanged")," "))}function ft(e,n){if(e&1&&u(0,_t,3,3,"div",30),e&2){let t=_(2);d("ngIf",t.orderHistoryEntry.commentHasChanged)}}function ut(e,n){e&1&&(o(0,"div",31),a(1),p(2,"cxTranslate"),r()),e&2&&(i(),c(" ",s(2,1,"orderDetails.modifications.costCenterHasChanged")," "))}function gt(e,n){if(e&1&&u(0,ut,3,3,"div",30),e&2){let t=_(2);d("ngIf",t.orderHistoryEntry.costCenterHasChanged)}}function xt(e,n){e&1&&(o(0,"div",31),a(1),p(2,"cxTranslate"),r()),e&2&&(i(),c(" ",s(2,1,"orderDetails.modifications.orderReasonHasChanged")," "))}function vt(e,n){if(e&1&&u(0,xt,3,3,"div",30),e&2){let t=_(2);d("ngIf",t.orderHistoryEntry.orderReasonHasChanged)}}function ht(e,n){if(e&1&&(I(0),u(1,Qe,25,31,"ng-container",9)(2,rt,39,43,"ng-template",null,0,C)(4,at,1,1,"ng-template",null,1,C)(6,dt,1,1,"ng-template",null,2,C)(8,pt,1,1,"ng-template",null,3,C)(10,mt,1,1,"ng-template",null,4,C)(12,ft,1,1,"ng-template",null,5,C)(14,gt,1,1,"ng-template",null,6,C)(16,vt,1,1,"ng-template",null,7,C),T()),e&2){let t=x(3),l=_();i(),d("ngIf",l.isMobile)("ngIfElse",t)}}var we=(()=>{let n=class n{constructor(l){this.modalService=l,this.entries=[],this.isMobile=!1,this.icons=H,this.orderEntry=null}ngOnChanges(l){let m=l.entries?.currentValue,g=l.orderHistoryEntry?.currentValue;m!==void 0&&g!==void 0&&(this.orderEntry=m.find(v=>v.pk===g.entryPK))}dismiss(){this.modalService.dismissActiveModal()}};n.\u0275fac=function(m){return new(m||n)(h(P))},n.\u0275cmp=w({type:n,selectors:[["","foerch-modified-entry",""]],inputs:{orderHistoryEntry:"orderHistoryEntry",entries:"entries",isMobile:"isMobile"},features:[se],attrs:Le,decls:1,vars:1,consts:[["isDesktop",""],["entryDeleted",""],["entryAdded",""],["changedVpe",""],["changedQuantity",""],["changedComment",""],["changedCostCenter",""],["changedOrderReason",""],[4,"ngIf"],[4,"ngIf","ngIfElse"],[1,"row","flex-nowrap"],[1,"col-auto","pe-0"],[1,"cartEntry-img"],[1,"d-block",3,"click","routerLink"],["format","thumbnail",3,"container"],[1,"col","px-0"],[1,"cartEntry-body"],[1,"cartEntry-name",3,"click","routerLink"],[1,"cartEntry-code"],[1,"cartEntry-desc"],[4,"ngTemplateOutlet"],[1,"cartTable-imgColumn","ps-s"],[1,"d-block","text-decoration-none",3,"click","routerLink"],[1,"cartTable-code"],[1,"cartTable-name",3,"click","routerLink"],[1,"cartTable-desc"],[3,"appendDropdownToBody","isReadOnly","item"],[1,"text-end"],[1,"cartTable-total"],[1,"text-body-secondary"],["class","form-helptext form-helptext_danger",4,"ngIf"],[1,"form-helptext","form-helptext_danger"],["class","form-helptext form-helptext_success",4,"ngIf"],[1,"form-helptext","form-helptext_success"]],template:function(m,g){m&1&&u(0,ht,18,2,"ng-container",8),m&2&&d("ngIf",g.orderEntry)},dependencies:[V,W,xe,Ce,Oe,N,ve,Fe,Se],encapsulation:2,changeDetection:0});let e=n;return e})();var Ct=function(e,n,t,l){var m=arguments.length,g=m<3?n:l===null?l=Object.getOwnPropertyDescriptor(n,t):l,v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(e,n,t,l);else for(var S=e.length-1;S>=0;S--)(v=e[S])&&(g=(m<3?v(g):m>3?v(n,t,g):v(n,t))||g);return m>3&&g&&Object.defineProperty(n,t,g),g},Et=function(e,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,n)};function It(e,n){if(e&1&&E(0,"div",7),e&2){let t=n.$implicit,l=_(2);d("entries",l.order.entries)("isMobile",!0)("orderHistoryEntry",t)}}function Tt(e,n){if(e&1&&(I(0),u(1,It,1,3,"div",6),T()),e&2){let t=_();i(),d("ngForOf",t.order.historyEntries)("ngForTrackBy",t.trackByIndex)}}function St(e,n){if(e&1&&E(0,"tr",14),e&2){let t=n.$implicit,l=_(2);d("entries",l.order.entries)("orderHistoryEntry",t)}}function Ft(e,n){if(e&1&&(o(0,"div",8),I(1),o(2,"div",9)(3,"table",10)(4,"thead")(5,"tr"),E(6,"th",11),o(7,"th"),a(8),p(9,"cxTranslate"),r(),o(10,"th"),a(11),p(12,"cxTranslate"),r(),o(13,"th"),a(14),p(15,"cxTranslate"),r(),o(16,"th"),a(17),p(18,"cxTranslate"),r(),o(19,"th"),a(20),p(21,"cxTranslate"),r(),o(22,"th",12),a(23),p(24,"cxTranslate"),r(),o(25,"th",12),a(26),p(27,"cxTranslate"),r()()(),o(28,"tbody"),u(29,St,1,2,"tr",13),r()()(),T(),r()),e&2){let t=_();i(8),c(" ",s(9,9,"cartItems.description")," "),i(3),c(" ",s(12,11,"cartItems.costCenterLabel")," "),i(3),c(" ",s(15,13,"common.vpeFormula")," "),i(3),c(" ",s(18,15,"cartItems.me")," "),i(3),c(" ",s(21,17,"cartItems.me")," "),i(3),c(" ",s(24,19,"cartItems.itemPrice")," "),i(3),c(" ",s(27,21,"cartItems.total")," "),i(3),d("ngForOf",t.order.historyEntries)("ngForTrackBy",t.trackByIndex)}}var B,ce=(B=class{constructor(n,t){this._modalService=n,this._breakPointService=t,this.isMobile$=this._breakPointService.isEqual(ye.xs),this.icons=H}ngOnDestroy(){}trackByIndex(n){return n}dismiss(){this._modalService.dismissActiveModal()}},B.\u0275fac=function(t){return new(t||B)(h(P),h(z))},B.\u0275cmp=w({type:B,selectors:[["foerch-modifications-popup-dialog"]],inputs:{order:"order"},decls:10,vars:8,consts:[["isDesktop",""],[1,"modal-header"],[1,"modal-title"],["type","button",1,"close",3,"click"],[3,"type"],[4,"ngIf","ngIfElse"],["class","orderDetailModifiedEntry","foerch-modified-entry","",3,"entries","isMobile","orderHistoryEntry",4,"ngFor","ngForOf","ngForTrackBy"],["foerch-modified-entry","",1,"orderDetailModifiedEntry",3,"entries","isMobile","orderHistoryEntry"],[1,"modal-body","p-0"],[1,"cart-details-wrapper"],[1,"cartTable","cartTable_popup","border-bottom-0"],[1,"cartTable-imgColumn"],[1,"text-end"],["foerch-modified-entry","",3,"entries","orderHistoryEntry",4,"ngFor","ngForOf","ngForTrackBy"],["foerch-modified-entry","",3,"entries","orderHistoryEntry"]],template:function(t,l){if(t&1){let m=D();o(0,"div",1)(1,"h3",2),a(2),p(3,"cxTranslate"),r(),o(4,"button",3),O("click",function(){return F(m),b(l.dismiss())}),E(5,"cx-icon",4),r()(),u(6,Tt,2,2,"ng-container",5),p(7,"async"),u(8,Ft,30,23,"ng-template",null,0,C)}if(t&2){let m=x(9);i(2),c(" ",s(3,4,"orderDetails.modifications.allChanges")," "),i(3),d("type",l.icons.CLOSE),i(),d("ngIf",s(7,6,l.isMobile$)===!0)("ngIfElse",m)}},dependencies:[$,V,Q,we,G,N],encapsulation:2,changeDetection:0}),B);ce=Ct([X(),Et("design:paramtypes",[P,z])],ce);var bt=function(e,n,t,l){var m=arguments.length,g=m<3?n:l===null?l=Object.getOwnPropertyDescriptor(n,t):l,v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(e,n,t,l);else for(var S=e.length-1;S>=0;S--)(v=e[S])&&(g=(m<3?v(g):m>3?v(n,t,g):v(n,t))||g);return m>3&&g&&Object.defineProperty(n,t,g),g},Ot=function(e,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,n)},Dt=(e,n)=>({currencyCode:e,localeCode:n}),Pt=(e,n,t)=>[e,n,"symbol","1.2",t];function Bt(e,n){if(e&1&&(I(0),o(1,"span",37),E(2,"cx-icon",6),r(),o(3,"span"),a(4),p(5,"cxTranslate"),r(),T()),e&2){let t=_(3);i(2),d("type",t.icons.SUCCESS),i(2),L(s(5,2,"orderDetails.approvedHeadline"))}}function Mt(e,n){if(e&1&&(o(0,"span",38),E(1,"cx-icon",6),r(),o(2,"span"),a(3),p(4,"cxTranslate"),r()),e&2){let t=_(3);i(),d("type",t.icons.CLOSE),i(2),L(s(4,2,"orderDetails.rejectedHeadline"))}}function kt(e,n){if(e&1&&(o(0,"div",36),u(1,Bt,6,4,"ng-container",29)(2,Mt,5,4,"ng-template",null,3,C),r()),e&2){let t=x(3),l=_(2);i(),d("ngIf",l.isOrderApproved)("ngIfElse",t)}}function At(e,n){if(e&1&&(o(0,"div",18)(1,"div",19),a(2),p(3,"cxTranslate"),r(),o(4,"div",21),a(5),r()()),e&2){let t=_(2);i(2),c(" ",s(3,2,"orderDetails.approver")," "),i(3),c(" ",(t.order.approver==null?null:t.order.approver.name)||"-"," ")}}function Rt(e,n){if(e&1&&(o(0,"div",18)(1,"div",19),a(2),p(3,"cxTranslate"),r(),o(4,"div",21),a(5),r()()),e&2){let t=_(2);i(2),c(" ",s(3,2,"orderDetails.customOrderNumber")," "),i(3),c(" ",t.order.purchaseOrderNumber," ")}}function wt(e,n){if(e&1&&(o(0,"div",18)(1,"div",19),a(2),p(3,"cxTranslate"),r(),o(4,"div",21),a(5),r()()),e&2){let t=_(2);i(2),c(" ",s(3,2,"orderDetails.comment")," "),i(3),c(" ",t.order.b2BComment.comment," ")}}function Vt(e,n){e&1&&y(0)}function Nt(e,n){if(e&1&&(I(0),E(1,"foerch-address",39),T()),e&2){let t=_(2);i(),d("address",t.deliveryAddress)("showAddressName",!1)}}function Ht(e,n){if(e&1&&(I(0),E(1,"foerch-address",39),T()),e&2){let t=_(2);i(),d("address",(t.order.paymentInfo==null?null:t.order.paymentInfo.billingAddress)||(t.order.unit==null?null:t.order.unit.contactAddress))("showAddressName",!1)}}function jt(e,n){if(e&1&&(I(0),o(1,"span",40),a(2),p(3,"cxTranslate"),r(),T()),e&2){let t=_(3);i(),d("ngClass",t.order.orderHasChanged?"text-warning":"text-success"),i(),c(" ",s(3,2,t.order.orderHasChanged?"orderDetails.changed":"orderDetails.approved")," ")}}function Lt(e,n){e&1&&(o(0,"span",41),a(1),p(2,"cxTranslate"),r()),e&2&&(i(),L(s(2,1,"orderDetails.rejected")))}function Ut(e,n){if(e&1&&(o(0,"div",28)(1,"div",19),a(2),p(3,"cxTranslate"),r(),o(4,"div",21),u(5,jt,4,4,"ng-container",29),r(),u(6,Lt,3,3,"ng-template",null,4,C),r()),e&2){let t=x(7),l=_(2);i(2),c(" ",s(3,3,"orderDetails.approvement")," "),i(3),d("ngIf",l.isOrderApproved)("ngIfElse",t)}}function $t(e,n){if(e&1){let t=D();o(0,"button",42),O("click",function(){F(t);let m=_(2);return b(m.printConfirmation())}),a(1),p(2,"cxTranslate"),r()}e&2&&(i(),c(" ",s(2,1,"orderDetails.orderConfirmation")," "))}function Wt(e,n){if(e&1){let t=D();o(0,"button",43),O("click",function(){F(t);let m=_(2);return b(m.createBarcode())}),a(1),p(2,"cxTranslate"),r()}e&2&&(i(),c(" ",s(2,1,"orderDetails.createEAN")," "))}function Gt(e,n){if(e&1){let t=D();o(0,"button",44),O("click",function(){F(t);let m=_(2);return b(m.openConsignmentsPopup())}),a(1),p(2,"cxTranslate"),r()}e&2&&(i(),c(" ",s(2,1,"orderDetails.connectedOrders")," "))}function qt(e,n){if(e&1){let t=D();o(0,"button",44),O("click",function(){F(t);let m=_(2);return b(m.openModificationsPopup())}),a(1),p(2,"cxTranslate"),r()}e&2&&(i(),c(" ",s(2,1,"orderDetails.showDiff")," "))}function Yt(e,n){if(e&1&&(I(0),o(1,"div",8)(2,"div",9)(3,"div",10)(4,"div",11),a(5),r(),u(6,kt,4,2,"div",12),r()(),o(7,"div",13)(8,"div",14)(9,"div",15)(10,"div",16)(11,"div",17)(12,"div",18)(13,"div",19),a(14),p(15,"cxTranslate"),r(),o(16,"div",20),p(17,"foerchOrderStatusGroupStyleMapper"),a(18),r()(),o(19,"div",18)(20,"div",19),a(21),p(22,"cxTranslate"),r(),o(23,"div",21),a(24),p(25,"cxDate"),r()(),o(26,"div",18)(27,"div",19),a(28),p(29,"cxTranslate"),r(),o(30,"div",21),a(31),r()(),o(32,"div",18)(33,"div",19),a(34),p(35,"cxTranslate"),r(),o(36,"div",22),a(37),r()(),o(38,"div",18)(39,"div",19),a(40),p(41,"cxTranslate"),r(),o(42,"div",22),a(43),r()(),o(44,"div",18)(45,"div",19),a(46),p(47,"cxTranslate"),r(),o(48,"div",21),a(49),p(50,"cxTranslate"),r()(),u(51,At,6,4,"div",23),p(52,"async"),u(53,Rt,6,4,"div",23)(54,wt,6,4,"div",23),r(),o(55,"div",17),u(56,Vt,1,0,"ng-container",24),r()()(),o(57,"div",25)(58,"div",26)(59,"div",17)(60,"div",27)(61,"div",28)(62,"div",19),a(63),p(64,"cxTranslate"),r(),o(65,"div",21),u(66,Nt,2,2,"ng-container",29),r()(),o(67,"div",28)(68,"div",19),a(69),p(70,"cxTranslate"),r(),o(71,"div",21),u(72,Ht,2,2,"ng-container",29),r()(),u(73,Ut,8,5,"div",30),r(),o(74,"div",31)(75,"div",32),u(76,$t,3,3,"button",33)(77,Wt,3,3,"button",34),p(78,"async"),u(79,Gt,3,3,"button",35)(80,qt,3,3,"button",35),r()()()()()()()(),T()),e&2){let t=_(),l=x(6),m=x(8),g=x(10);i(5),c(" ",t.order.code," "),i(),d("ngIf",t.hasApprovalProcess&&!t.isOrderPending),i(8),c(" ",s(15,32,"orderDetails.status")," "),i(2),d("ngClass",s(17,34,t.status)),i(2),c(" ",t.statusDisplay||"-"," "),i(3),c(" ",s(22,36,"common.orderedAt")," "),i(3),c(" ",s(25,38,t.order.created)||"-"," "),i(4),c(" ",s(29,40,"orderDetails.channel")," "),i(3),c(" ",t.order.salesApplication||"-"," "),i(3),c(" ",s(35,42,"orderDetails.user")," "),i(2),de("title",(t.order.user==null?null:t.order.user.name)||"-"),i(),c(" ",(t.order.user==null?null:t.order.user.name)||"-"," "),i(3),c(" ",s(41,44,"orderDetails.customerId")," "),i(2),de("title",(t.order.unit==null?null:t.order.unit.name)||"-"),i(),c(" ",(t.order.unit==null?null:t.order.unit.displayUid)||(t.order.unit==null?null:t.order.unit.uid)||"-"," "),i(3),c(" ",s(47,46,"orderDetails.paymentMethod")," "),i(3),c(" ",(t.order.paymentInfo==null?null:t.order.paymentInfo.defaultPayment)||s(50,48,"orderDetails.paymentInvoice")," "),i(2),d("ngIf",t.order.approver&&s(52,50,t.approverFlowActive$)),i(2),d("ngIf",t.order.purchaseOrderNumber),i(),d("ngIf",t.order.b2BComment==null?null:t.order.b2BComment.comment),i(2),d("ngTemplateOutlet",t.order.fees&&(t.order.fees==null?null:t.order.fees.length)>0?m:g),i(7),c(" ",s(64,52,"orderDetails.shippedOn")," "),i(3),d("ngIf",t.deliveryAddress)("ngIfElse",l),i(3),c(" ",s(70,54,"orderDetails.billingAddress")," "),i(3),d("ngIf",(t.order.paymentInfo==null?null:t.order.paymentInfo.billingAddress)||(t.order.unit==null?null:t.order.unit.contactAddress))("ngIfElse",l),i(),d("ngIf",t.hasApprovalProcess&&!t.isOrderPending),i(3),d("ngIf",t.isOrderPrintable),i(),d("ngIf",s(78,56,t.hasBarcodeCatalogPermission$)&&t.canCreateBarcodeCatalog),i(2),d("ngIf",t.hasConsignments),i(),d("ngIf",t.order.orderHasChanged)}}function Kt(e,n){e&1&&a(0,"-")}function Qt(e,n){if(e&1&&(o(0,"div",46)(1,"div",19),a(2),p(3,"cxTranslate"),r(),o(4,"div",21),a(5),r()()),e&2){let t=_(2);i(2),c(" ",s(3,2,"orderDetails.value")," "),i(3),c(" ",t.order.subTotal.formattedValue||"-"," ")}}function zt(e,n){if(e&1&&(o(0,"div",46)(1,"div",19),a(2),r(),o(3,"div",21),a(4),p(5,"currency"),r()()),e&2){let t=n.$implicit,l=_().ngIf;i(2),c(" ",t.type.name," "),i(2),c(" ",(t.value==null?null:t.value.formattedValue)||fe(5,2,_e(8,Pt,t.value==null?null:t.value.value,l.currencyCode,l.localeCode))," ")}}function Jt(e,n){if(e&1&&(I(0),u(1,zt,6,12,"div",47),T()),e&2){let t=_(3);i(),d("ngForOf",t.order.fees)("ngForTrackBy",t.trackByIndex)}}function Xt(e,n){if(e&1&&(I(0),u(1,Jt,2,2,"ng-container",7),p(2,"async"),p(3,"async"),T()),e&2){let t=_(2);i(),d("ngIf",k(5,Dt,s(2,1,t.currencyCode$),s(3,3,t.localeCode$)))}}function Zt(e,n){if(e&1&&(o(0,"div",18)(1,"div",17),u(2,Qt,6,4,"div",45)(3,Xt,4,8,"ng-container",7),o(4,"div",46)(5,"div",19),a(6),p(7,"cxTranslate"),r(),o(8,"div",21),a(9),r()()()()),e&2){let t=_();i(2),d("ngIf",t.order.subTotal),i(),d("ngIf",t.order.fees&&t.order.fees.length>0),i(3),c(" ",s(7,4,"orderDetails.totalValue")," "),i(3),c(" ",(t.totalPrice==null?null:t.totalPrice.formattedValue)||"-"," ")}}function en(e,n){if(e&1&&(o(0,"div",18)(1,"div",19),a(2),p(3,"cxTranslate"),r(),o(4,"div",21),a(5),r()()),e&2){let t=_();i(2),c(" ",s(3,2,"orderDetails.value")," "),i(3),c(" ",(t.totalPrice==null?null:t.totalPrice.formattedValue)||"-"," ")}}var M,Ve=(M=class extends Pe{get isOrderPending(){return this.order&&(this.order.status===A.PENDING_APPROVAL||this.order.status===A.OPEN)}get isOrderPrintable(){return this.order&&this.order.status!==void 0&&this.order.status!==A.PENDING_APPROVAL}get relatedConsignmentTrackingId(){let n,t=(this.order.consignments||[]).length===1,l=(this.order.consignments||[]).length>1&&!!this.currentConOrderId;if(t===!0&&(n=this.order.consignments[0].trackingID),l===!0){let m=this.order.consignments.filter(g=>g.code===this.currentConOrderId)[0];n=m?m.trackingID:void 0}return n}get canCreateBarcodeCatalog(){return this.order&&(this.order.entries||[]).some(n=>!n.giveAway)}constructor(n,t,l,m,g,v,S,R,f,pe,Ne,He){super(t,l,m,g,v,pe,S,R),this.barcodeCatalogItemService=n,this.activatedRoute=t,this.orderService=l,this.activeCartService=m,this.watchlistService=g,this.modalService=v,this.routingService=S,this.cd=R,this.occEndpointsService=f,this.permissionService=pe,this.currencyService=Ne,this.currencyLocaleService=He,this.icons=H,this.hasApprovalProcess=!1,this.hasConsignments=!1,this.currencyCode$=this.currencyService.getActive(),this.localeCode$=this.currencyLocaleService.getActiveLocaleForCurrencyPipe(),this.hasBarcodeCatalogPermission$=this.permissionService.getPermissionValueAsBoolean(le.ACTIVATE_WEBSHOP_BARCODE_CATALOG),this.approverFlowActive$=this.permissionService.getPermissionValueAsBoolean(le.ACTIVATE_WEBSHOP_APPROVAL_WORKFLOW)}ngOnInit(){super.ngOnInit(),this.orderService.load(this.currentOrderCode)}ngOnDestroy(){super.ngOnDestroy(),this.orderService.reset()}trackByIndex(n){return n}handleResults(n){n.order&&(this.order=n.order,this.updateData()),this.isLoading=n.loading,this.isLoaded=n.loaded}openConsignmentsPopup(){let n={centered:!0},t=this.modalService.open(De,n);if(t){let l=t.componentInstance;l.orderCode=this.order.code,l.usageForDetails=!0,l.consignments=this.order.consignments.filter(m=>m.code!==this.currentConOrderId)}}openModificationsPopup(){let n={centered:!0,size:"xl"},t=this.modalService.open(ce,n);t&&(t.componentInstance.order=this.order)}createBarcode(){this.barcodeCatalogItemService.presetBarcodeCatalog({entries:this.order.entries.filter(n=>!n.giveAway).map(n=>({name:n.product.name,code:n.product.code,source:[{type:Ee.ORDER,code:this.order.code}]})),name:this.order.code})}cancel(){this.orderService.navigateToOrdersOverview()}printConfirmation(){this.orderService.printOrderConfirmation(this.order.code)}updateData(){this.order&&(this.hasConsignments=this.order.consignments.length>1,this.hasApprovalProcess=!Ie(this.order.approver),this.hasApprovalProcess&&(this.isOrderApproved=this.checkForApproval()),this.deliveryAddress=this.currentConOrderId?this.findConsignments(this.currentConOrderId).shippingAddress:this.order.deliveryAddress,this.totalPrice=this.currentConOrderId?this.findConsignments(this.currentConOrderId).totalPrice:this.order.totalPrice,this.status=this.currentConOrderId?this.findConsignments(this.currentConOrderId).status:this.order.status,this.statusDisplay=this.currentConOrderId?this.findConsignments(this.currentConOrderId).statusDisplay:this.order.statusDisplay)}openTrackingModal(){this.orderService.openTrackingModal(this.relatedConsignmentTrackingId)}checkForApproval(){return this.order&&[A.ORDER_SPLIT,A.APPROVED,A.COMPLETED].indexOf(this.order.status)!==-1}findConsignments(n){return this.order&&this.order.consignments.find(t=>t.code===n)}},M.\u0275fac=function(t){return new(t||M)(h(ne),h(q),h(re),h(te),h(J),h(P),h(ee),h(U),h(Y),h(Z),h(K),h(ie))},M.\u0275cmp=w({type:M,selectors:[["foerch-order-detail"]],features:[me],decls:11,vars:5,consts:[["emptyField",""],["withFees",""],["withoutFees",""],["orderRejected",""],["rejected",""],[1,"btn","btn-tertiary","btn-back","mb-2",3,"click"],[3,"type"],[4,"ngIf"],[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,"row","g-0"],[1,"col-md-4","costCenterNode-body-border"],[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,"col-md-8"],[1,"costCenterNode-left"],[1,"col"],[1,"pb-2"],[4,"ngIf","ngIfElse"],["class","pb-2",4,"ngIf"],[1,"col-md-6","col-lg-5","col-xl-4","text-end"],[1,"orderDetail-btnColumn"],["class","btn btn-block btn-primary mb-s",3,"click",4,"ngIf"],["class","btn btn-sm btn-link_secondary btn-block mt-1",3,"click",4,"ngIf"],["class","btn btn-sm btn-link_secondary btn-block",3,"click",4,"ngIf"],[1,"orderDetail-status"],[1,"icon-success"],[1,"icon-secondary"],[3,"address","showAddressName"],[3,"ngClass"],[1,"text-danger"],[1,"btn","btn-block","btn-primary","mb-s",3,"click"],[1,"btn","btn-sm","btn-link_secondary","btn-block","mt-1",3,"click"],[1,"btn","btn-sm","btn-link_secondary","btn-block",3,"click"],["class","col-12",4,"ngIf"],[1,"col-12"],["class","col-12",4,"ngFor","ngForOf","ngForTrackBy"]],template:function(t,l){if(t&1){let m=D();o(0,"a",5),O("click",function(){return F(m),b(l.cancel())}),E(1,"cx-icon",6),a(2),p(3,"cxTranslate"),r(),u(4,Yt,81,58,"ng-container",7)(5,Kt,1,0,"ng-template",null,0,C)(7,Zt,10,6,"ng-template",null,1,C)(9,en,6,4,"ng-template",null,2,C)}t&2&&(i(),d("type",l.icons.ARROW_LEFT),i(),c(" ",s(3,3,"common.back"),` `),i(2),d("ngIf",l.order))},dependencies:[ue,$,V,W,Q,Te,G,ge,N,he,be],encapsulation:2,changeDetection:0}),M);Ve=bt([X(),Ot("design:paramtypes",[ne,q,re,te,J,P,ee,U,Y,Z,K,ie])],Ve);export{Ve as a};