import{a as re}from"./chunk-HR3T5BWN.js";import{a as te}from"./chunk-33S3Y2LM.js";import{a as ee}from"./chunk-RFCZMTXP.js";import{b as Z}from"./chunk-UIGFCYGO.js";import{b as Y}from"./chunk-5RG27LZ2.js";import{a as X}from"./chunk-UB23RF7S.js";import{d as K}from"./chunk-ICTDV7DB.js";import{J}from"./chunk-CWWVHRJU.js";import{a as z}from"./chunk-QMZQK3O6.js";import{a as q}from"./chunk-RU43IR5J.js";import{a as G}from"./chunk-Y7IP5WLG.js";import{a as U}from"./chunk-SU6CJJJO.js";import{r as Q}from"./chunk-MXUIPT66.js";import{Aa as n,Ab as C,Ba as a,Bb as O,Cb as y,Db as g,Dc as B,Fb as I,Gd as H,Kb as T,Kd as N,Lb as o,Og as P,Sb as S,Tb as V,Ua as l,Ub as k,Va as c,Wg as $,Xc as j,Yb as b,_b as v,bd as L,gb as M,ib as A,ic as R,ob as p,rc as f,sc as u,ta as D,yh as W,zb as h}from"./chunk-N6B2OJOY.js";var ie=["templateNameEl"],oe=()=>({cxRoute:"orderTemplate"});function ne(m,s){if(m&1){let r=I();y(0),h(1,"foerch-cart-mobile-body",6),f(2,"async"),T("addEntryToCart",function(t){n(r);let e=o();return a(e.addEntryToCart(t))})("applyCostCenterToEntry",function(t){n(r);let e=o();return a(e.applyCcmToEntry(t))})("markEntry",function(t){n(r);let e=o();return a(e.markCartEntry(t))})("removeEntry",function(t){n(r);let e=o();return a(e.removeEntry(t))})("replaceArticle",function(t){n(r);let e=o();return a(e.replaceArticle(t))})("sortingChange",function(t){n(r);let e=o();return a(e.sortingChange(t))})("sortingReset",function(){n(r);let t=o();return a(t.sortingReset())})("updateComment",function(t){n(r);let e=o();return a(e.updateComment(t))})("vpeChange",function(t){n(r);let e=o();return a(e.vpeChange(t))}),C(),h(3,"foerch-cart-mobile-footer",7),T("applyBulkAction",function(t){n(r);let e=o();return a(e.applyBulkAction(t))})("markToggle",function(){n(r);let t=o();return a(t.toggleAll())}),C(),g()}if(m&2){let r=o();l(),p("cartConfig",r.cartConfig)("checkoutInfo",u(2,11,r.checkoutInfo$))("isLoading$",r.isPending$)("items",r.orderTemplateEntries)("selectionHelper",r.selectionHelper)("sortableColumns",r.sortableColumns)("sortModel",r.sortModel),l(2),p("bulkOptions",r.bulkActionOptions)("footerConfig",r.footerConfig)("hasAnyDeletedArticle",r.hasAnyDeletedArticle)("selectAll",r.selectionHelper.areAllSelected())}}function ae(m,s){m&1&&(y(0),h(1,"div",8),b(2),f(3,"cxTranslate"),C(),g()),m&2&&(l(2),v(" ",u(3,1,"orderTemplateList.noEntries")," "))}var Le=(()=>{let s=class s extends re{constructor(i,t,e,d,_,F,x,E,w){super(i,t,e,d,_,F,x,E,w),this.activeCartService=i,this.watchlistService=t,this.orderTemplateService=e,this.barcodeCatalogItemService=d,this.permissionsService=_,this.modalService=F,this.cd=x,this.activatedRoute=E,this.translationService=w,this.showTemplateNameField=!1,this.canAddArticles$=this.orderTemplateService.isOrderTemplateItemDataLoaded()}updateEntryTemplateName(i){this.showTemplateNameField=!1,i!=this.orderTemplate.name&&this.changeTemplateName(i)}openWatchlistDialog(){let i={scrollable:!0},e=this.modalService.open(Y,i).componentInstance;e.isWatchList=!0,e.addToOrderTemplate=!0,e.orderTemplateCode=this.orderTemplateCode,e.watchlistItems=this.watchlistItems}};s.\u0275fac=function(t){return new(t||s)(c(J),c(U),c(X),c(K),c(q),c(G),c(B),c(H),c(P))},s.\u0275cmp=D({type:s,selectors:[["foerch-order-template-detail-mobile"]],viewQuery:function(t,e){if(t&1&&S(ie,5),t&2){let d;V(d=k())&&(e.templateNameField=d.first)}},features:[M],decls:11,vars:18,consts:[[1,"btn","btn-tertiary","btn-back",3,"routerLink"],[3,"type"],[1,"orderTemplateDetailHead"],[3,"valueChanged","allowModeToggle","showEditButton","value"],[3,"addToCart","applyCCM","isCartRefreshed","isEmptyCart","orderTemplateCode"],[4,"ngIf"],[3,"addEntryToCart","applyCostCenterToEntry","markEntry","removeEntry","replaceArticle","sortingChange","sortingReset","updateComment","vpeChange","cartConfig","checkoutInfo","isLoading$","items","selectionHelper","sortableColumns","sortModel"],[3,"applyBulkAction","markToggle","bulkOptions","footerConfig","hasAnyDeletedArticle","selectAll"],[1,"emptyState-text","my-4"]],template:function(t,e){t&1&&(h(0,"a",0),f(1,"cxUrl"),O(2,"cx-icon",1),b(3),f(4,"cxTranslate"),C(),h(5,"div",2)(6,"foerch-inline-edit",3),T("valueChanged",function(_){return e.updateEntryTemplateName(_)}),C()(),h(7,"foerch-cart-mobile-head",4),f(8,"async"),T("addToCart",function(_){return e.quickAddEntriesToCart(_)})("applyCCM",function(_){return e.applyCostCenterAndObject(_)}),C(),A(9,ne,4,13,"ng-container",5)(10,ae,4,3,"ng-container",5)),t&2&&(p("routerLink",u(1,11,R(17,oe))),l(2),p("type",e.iconTypes.ARROW_LEFT),l(),v(" ",u(4,13,"common.back"),`
`),l(3),p("allowModeToggle",!0)("showEditButton",!0)("value",e.orderTemplate==null?null:e.orderTemplate.name),l(),p("isCartRefreshed",u(8,15,e.canAddArticles$))("isEmptyCart",e.isEmptyOrderTemplate)("orderTemplateCode",e.orderTemplateCode),l(2),p("ngIf",!e.isEmptyOrderTemplate),l(),p("ngIf",e.isEmptyOrderTemplate))},dependencies:[N,te,Z,ee,z,Q,j,W,L,$],encapsulation:2,changeDetection:0});let m=s;return m})();export{Le as a};