import{a as d}from"./chunk-T2ZXHDV7.js";import{a as G,b as V,c as $,e as A}from"./chunk-MHXW6RFZ.js";import{Zc as H,ad as O,bd as j,dd as W,sc as B,uc as L}from"./chunk-CBXQYRPM.js";import{$b as N,Bc as w,Ka as n,Kb as u,La as E,Lb as l,Nb as P,Ob as T,Pb as b,Qb as _,Rc as U,Sc as k,Tc as F,Ub as M,Zb as f,_b as I,ab as c,cb as s,da as g,db as p,eb as C,gb as S,ka as R,la as v,mb as r,nb as i,ob as y,pa as h,tc as D,xb as x}from"./chunk-LVXYIJUI.js";var J=()=>({day:"2-digit",month:"long"});function K(t,q){if(t&1&&(r(0,"div",8)(1,"span"),u(2),i()()),t&2){let e=x();p("background",e.getRouteColor())("color",e.getTextColor()),C("hide-header-text",e.panelExpandedState),n(2),P("",e.getRouteDrivingDayName(),", ",e.getRouteNumber(),"")}}function Q(t,q){if(t&1&&(r(0,"div",9)(1,"div",10)(2,"div",11),u(3),i(),r(4,"div",12),u(5),f(6,"numberToDatePipe"),i()(),r(7,"div",13)(8,"div",11),u(9),i(),r(10,"div",12),u(11),i()()()),t&2){let e=x();n(),p("--route-color",e.getRouteColor()),n(),p("color",e.getTextColor()),n(),l(e.getRouteDrivingDayName()),n(),p("color",e.getTextColor()),n(),l(N(6,10,e.returnRoute.date,M(13,J))),n(4),l(e.getRouteNumber()),n(2),l(e.getRouteDescription())}}var X=(()=>{class t{constructor(e){this.translateService=e,this.class="abs-return-route-expansion-panel"}ngOnChanges(e){if(e.returnRoute){let o=e.returnRoute.currentValue;(!o||o.date<0)&&(this.returnRoute=null)}}getRouteDrivingDayName(){return B.fromNumberToDate(this.returnRoute.date).setLocale(L.getLocale()).toLocaleString({weekday:"long"})}getRouteNumber(){return`${this.translateService.instant("LBL_ROUTE")} ${this.returnRoute.routeNumber}`}getRouteDescription(){return this.returnRoute.routeDescription}getRouteColor(){return`#${d.getNearestHexColor(this.returnRoute?.dayColor).backgroundColor}`}getTextColor(){let e=d.getNearestHexColor(this.returnRoute?.dayColor).backgroundColor;return`#${d.getHighestContrastTextColor(e)}`}static{this.\u0275fac=function(o){return new(o||t)(E(U))}}static{this.\u0275cmp=R({type:t,selectors:[["abs-return-route-expansion-panel"]],hostVars:2,hostBindings:function(o,a){o&2&&S(a.class)},inputs:{returnRoute:"returnRoute",panelExpandedState:"panelExpandedState"},features:[h],decls:10,vars:7,consts:[[1,"abs-expansion-panel",3,"expandedChange","expanded","disabled"],[1,"abs-expansion-panel-header"],[1,"abs-panel-title"],["svgIcon","truck",1,"panel-title-icon"],[1,"panel-title-text"],["class","return-route-header-text",3,"hide-header-text","background","color",4,"ngIf"],[1,"return-route-expanded-row-wrapper"],["class","return-route-expanded-row",4,"ngIf"],[1,"return-route-header-text"],[1,"return-route-expanded-row"],[1,"route-info","route-info--date"],[1,"route-text"],[1,"route-subtext"],[1,"route-info","route-info--description"]],template:function(o,a){o&1&&(r(0,"mat-expansion-panel",0),_("expandedChange",function(m){return b(a.panelExpandedState,m)||(a.panelExpandedState=m),m}),r(1,"mat-expansion-panel-header",1)(2,"mat-panel-title",2),y(3,"mat-icon",3),r(4,"span",4),u(5),f(6,"translate"),i()(),c(7,K,3,8,"div",5),i(),r(8,"div",6),c(9,Q,12,14,"div",7),i()()),o&2&&(T("expanded",a.panelExpandedState),s("disabled",!a.returnRoute),n(5),l(I(6,5,"LBL_RETURN_ROUTE")),n(2),s("ngIf",a.returnRoute),n(2),s("ngIf",a.returnRoute))},dependencies:[D,G,V,$,O,k,H],encapsulation:2})}}return t})();var Y=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=v({type:t})}static{this.\u0275inj=g({imports:[w,A,j,F,W]})}}return t})();export{X as a,Y as b};
