1import{a as g}from"./chunk-BRXRKIEF.js";import{a as J}from"./chunk-K6IZXZEA.js";import{a as z}from"./chunk-VD6MN4IY.js";import{a as V}from"./chunk-D2H4JJ4Z.js";import{a as U}from"./chunk-XQ4SKJJ3.js";import{a as Z}from"./chunk-DTJOID5U.js";import"./chunk-ADQUA22Z.js";import"./chunk-35YKQAUB.js";import"./chunk-4STN7LBZ.js";import"./chunk-KKAKYHI4.js";import{a as q}from"./chunk-KRPTRO56.js";import{a as H}from"./chunk-2HRVE7AW.js";import"./chunk-2UBSZUPD.js";import"./chunk-ATQGOSFM.js";import"./chunk-FU6N7CPH.js";import{a as G,c as k}from"./chunk-NVL76GJ5.js";import"./chunk-VNDRLIBB.js";import"./chunk-TYZRQKT3.js";import{e as j}from"./chunk-QCRDHUQY.js";import"./chunk-SOGVNBP3.js";import"./chunk-UC2AWFT4.js";import"./chunk-JQ4CEWM2.js";import"./chunk-FSQ4YHNP.js";import"./chunk-JYPRB56O.js";import"./chunk-OEKXABLN.js";import"./chunk-EYOSXQOK.js";import"./chunk-KJWHOURV.js";import"./chunk-D2LEUBUN.js";import"./chunk-5MCOM756.js";import"./chunk-EGKLX7YF.js";import{B as D,L as M,P as W,U as R,ba as L,ya as $}from"./chunk-EW3XQOIM.js";import"./chunk-PX7SL6PN.js";import{v as N}from"./chunk-MEFQCLVR.js";import{$b as p,Cb as P,Eb as y,Gb as b,Gc as E,Hc as I,Ic as O,Ja as T,Jb as w,Jc as B,Ub as S,Uc as F,Vb as A,Z as x,Zb as c,ac as h,cc as u,dc as C,ec as _,fc as d,gc as s,hc as f,kb as r,p as v,uc as m,wb as l}from"./chunk-ELJTAMYY.js";import"./chunk-7TWYU5YD.js";import"./chunk-GM3FZBKO.js";var K=(()=>{class i{constructor(e,o){this.elementRef=e,this.broadcastService=o}ngAfterViewInit(){this.subscription=this.broadcastService.on(G.ShortcodeLoaded).subscribe(()=>{let e=this.elementRef.nativeElement.querySelector(".shortcode");if(e&&e.getAttribute("class").indexOf("shortcode-")!==-1){let o=`container-${e.getAttribute("class").split(" ")[1]}`;this.elementRef.nativeElement.classList.add(o)}})}ngOnDestroy(){this.subscription.unsubscribe()}static{this.\u0275fac=function(o){return new(o||i)(l(T),l(k))}}static{this.\u0275dir=y({type:i,selectors:[["","shortcode-class-decorator",""]]})}}return i})();var te=()=>[import("./chunk-23OTG2KH.js").then(i=>i.FeaturedProductsComponent)];function ie(i,t){if(i&1&&(d(0,"h1",0),O(1),s()),i&2){let e=m(2);r(),B(e.category.Name)}}function oe(i,t){if(i&1&&(d(0,"div",2),f(1,"banner",5),s()),i&2){let e=t.$implicit;r(),_("advert",e)}}function ne(i,t){i&1&&(d(0,"div",2),f(1,"featured-products"),s())}function re(i,t){if(i&1&&(d(0,"div",1),w(1,ne,2,0),S(2,1,te),s()),i&2){let e=m(2);r(2),A(e.showFeaturedProducts)}}function ae(i,t){if(i&1&&f(0,"banner",7),i&2){let e=m().$implicit;_("advert",e.model)}}function de(i,t){if(i&1&&f(0,"editorial-container",9),i&2){let e=m().$implicit;E("editorial-padding",!e.model.Payload.hideTitle),_("editorial",e.model)}}function se(i,t){if(i&1&&(d(0,"div"),c(1,ae,1,1,"banner",7),c(2,de,1,3,"editorial-container",8),s()),i&2){let e=t.$implicit;I(F("col col-lg-",e.width," col-flex shadow-box-container")),r(),p(e.isAdvert?1:-1),r(),p(e.isEditorial?2:-1)}}function le(i,t){if(i&1&&(d(0,"div",4),u(1,se,3,5,"div",6,h),s()),i&2){let e=t.$implicit;r(),C(e)}}function ce(i,t){if(i&1&&(d(0,"div"),c(1,ie,2,1,"h1",0),d(2,"div",1),u(3,oe,2,1,"div",2,h),s(),c(5,re,4,1,"div",1),d(6,"div",3),u(7,le,3,0,"div",4,h),s()()),i&2){let e=m();r(),p(e.displayHeadline?1:-1),r(2),C(e.largeAdverts),r(2),p(e.category.Payload.isHome?5:-1),r(2),C(e.rows)}}var Q=class i extends z{static{this.pageLayout=J.TILE_CONTENT_PAGE}constructor(t,e,o,a){super(),this.pageTitleService=t,this.$appConfig=e,this.topBannerService=o,this.navigationService=a,this.largeAdverts=[]}ngOnInit(){this.categorySubscription=this.navigationService.findNavigationItem(this.id).pipe(x(t=>v(t))).subscribe(t=>{this.category=t,this.displayHeadline=!t.Payload.isHome&&t.Payload.showPageHeadline,this.rows=this.getRowsOfBoxes(t),this.largeAdverts=this.getLargeAdverts();let e=t.PageProperties&&t.PageProperties.title;this.pageTitleService.setTitle(t,!e);let o=this.category.Adverts.find(a=>a.AdvertType===g.LARGE_HORIZONTAL&&a.Payload.isTopBanner);this.topBannerService.setBanner(o)},t=>console.error(t)),this.showFeaturedProducts=this.$appConfig.featuredProducts?this.$appConfig.featuredProducts.enabled:void 0}
1ngOnDestroy(){this.categorySubscription&&(this.categorySubscription.unsubscribe(),this.topBannerService.setBanner(null))}getLargeAdverts(){return this.category.Adverts?this.category.Adverts.filter(t=>t.AdvertType===g.LARGE_HORIZONTAL&&!t.Payload.isTopBanner):[]}getRowsOfBoxes(t){let o=0,a=1,n=this.flattenCategoryItems(t),X=D(n,function(Y){return o+=Y.width,a=Math.ceil(o/12),a-1});return R(X)}flattenCategoryItems(t){let e=t.Editorials.map(n=>({isEditorial:!0,model:n,width:this.getTileWidth(n)})),o=t.Adverts.filter(n=>n.AdvertType!==3).map(n=>({isAdvert:!0,model:n,width:this.getTileWidth(n)})),a=e.concat(o);return L(a,n=>n.model.Sequence)}getTileWidth(t){if(!W(t.Payload)&&M(t.Payload.tileWidth)){let o=t.Payload.tileWidth;return o>12||o<1?4:o}return 4}static{this.\u0275fac=function(e){return new(e||i)(l(U),l($),l(q),l(H))}}static{this.\u0275cmp=P({type:i,selectors:[["tile-content-page"]],inputs:{id:"id"},features:[b],decls:1,vars:1,consts:[[1,"h-01"],[1,"row"],[1,"col","col-lg-12"],[1,"home-boxes"],[1,"row","row-flex"],[3,"advert"],[3,"class"],["shortcode-class-decorator","",1,"tile-banner","shadow-box",3,"advert"],["shortcode-class-decorator","",1,"tile-editorial","shadow-box",3,"editorial","editorial-padding"],["shortcode-class-decorator","",1,"tile-editorial","shadow-box",3,"editorial"]],template:function(e,o){e&1&&c(0,ce,9,2,"div"),e&2&&p(o.category&&o.rows?0:-1)},dependencies:[N,j,V,Z,K],styles:[".tile-editorial[_ngcontent-%COMP%]{height:100%;width:100%}.editorial-padding[_ngcontent-%COMP%]{padding:25px 10px 10px} .tile-banner .content{padding:16px}.shadow-box-container[_ngcontent-%COMP%]{padding-bottom:30px}.home-boxes[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .col[_ngcontent-%COMP%]{padding-left:14px;padding-right:14px}.notice[_ngcontent-%COMP%]{padding:10px 25px}"]})}};export{Q as TileContentPageComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.