1import{q as l,B as De,D as q,u as ie,a as o,g as we,j as e,R as fe,F as mt,A as Ce,b as J,r as m,c as Ie,d as _e,S as gt,N as ht,I as $,e as se,f as ft,h as de,i as xt,k as Re,l as Ne,m as St,n as Tt,o as Ct,p as bt,C as yt,P as be,G as At,s as ye,t as Et,v as Lt,w as xe,x as vt,y as jt,z as Oe,E as Pt,H as kt,J as Dt,K as wt,L as Be,M as $e,O as It,Q as he,T as Ue,U as We,V as Fe,W as _t,X as Me,Y as Rt,Z as ee,_ as me,$ as Nt,a0 as Ot,a1 as Bt,a2 as ze,a3 as $t,a4 as Ut,a5 as Ve,a6 as ce,a7 as He,a8 as Ge,a9 as Xe,aa as Wt,ab as Ke,ac as Ft,ad as Mt,ae as zt,af as Vt,ag as Ht,ah as Gt,ai as Xt,aj as Kt,ak as qt,al as Yt,am as Qt,an as Zt,ao as Jt,ap as en,aq as tn,ar as nn,as as on,at as an,au as rn,av as sn,aw as dn,ax as cn,ay as ln,az as un,aA as pn,aB as mn,aC as gn,aD as hn,aE as fn,aF as xn,aG as Sn,aH as Tn,aI as Cn}from"./index-CQaiPqwp.js";import{B as Se,a as qe}from"./Banner.component-BIClPDC8.js";import{P as bn}from"./PromoCartImage.component-UJYIeXRQ.js";import{S as yn}from"./react-select.esm-BTkEaSrm.js";import{u as An}from"./tabs.utils-Dg3q-MAy.js";import{A as En}from"./Alert.component-CNprVkDS.js";import{T as Ye,H as Ln}from"./PrivateContent.component-CA0ub5Pl.js";import{O as Qe}from"./OpenModal.component-DibLuewg.js";import{S as vn}from"./Slideshow.component-DfAubj7z.js";import{P as jn,a as Pn,V as kn,b as Dn,B as wn,c as In,d as Ae}from"./BundleVariants.component-Xp68wLvY.js";import{P as Ze}from"./ProductDetail.component-3VF-j54q.js";import{S as _n,P as Rn}from"./SelectionProductList.component-C6KlpcAg.js";import{C as Te,u as Nn,a as On,F as Bn}from"./index.esm-DGIHq7I6.js";import{A as $n}from"./Alert.style-CMMqopFC.js";import{S as Un}from"./Submit.component-I8eG1lLz.js";import{S as Wn}from"./SingleDatePicker.component-CdaRoQxK.js";import{D as Je}from"./Dropdown.component-BG8PRCFX.js";import{S as Fn}from"./SelectionBundleList.component-DYeUyWCm.js";import{S as Mn}from"./StickyCartLayout.component-CbiMBGLY.js";import"./image-gallery-DEAqChjF.js";/* empty css */import"./SelectedProductDateBlock.component-CfKXs_p9.js";import"./StarRating.component-BQFBN-jS.js";import"./ProductDatePicker.style-B8rnjTTN.js";import"./MessageAlert.component-BOpbPenV.js";import"./VariantList.style-hQCCAfd-.js";import"./productDetail.selector-11isycXC.js";import"./SelectionProduct.style-DzpfFTFo.js";import"./CartDrawer.component-xwg0sdVi.js";import"./CartDeletion.component-B_yTeshh.js";import"./Recaptcha.component-CLuG1NuO.js";import"./index-Dv-0yCFp.js";import"./regex.constant-BicOlS9j.js";import"./input.helper-D1shRJlk.js";const zn=l.div` 2 background-color: ${t=>t.theme.primary}; 3`,Vn=l.div` 4 display: flex; 5 flex-direction: column; 6 gap: 20px; 7`,Hn=l.main` 8 flex-grow: 1; 9 width: 100%; 10 max-width: ${De.MAX}; 11 margin: 0 auto; 12 padding: 20px; 13 14 & > * + * { 15 margin-top: 20px; 16 } 17 18 @media ${q.DESKTOP} { 19 padding: 30px 20px; 20 21 & > * + * { 22 margin-top: 30px; 23 } 24 } 25`,Gn=l.div` 26 font-size: var(--text-lmd); 27 color: ${t=>t.theme.onBackgroundPrimary}; 28 29 @media ${q.TABLET} { 30 width: calc(100% - min(400px, 50%)); 31 } 32`,Xn=()=>{const{category:t}=ie(),n=o(we(t));return e.jsx(fe,{document:n?.description,defaultFontSize:mt.TEXT_LMD})},Kn=()=>{const{category:t}=ie(),n=o(we(t));return n?.informativeMsg?e.jsx(Se,{message:n.informativeMsg,variant:qe.ALERT}):null},qn=l.header.attrs({className:"AddonCategoryNavComponentStyle"})` 33 position: sticky; 34 top: 0; 35 width: 100vw; 36 background-color: ${t=>t.theme.background}; 37 background-image: url(${t=>t.imageUrl}); 38 transition: top 0.3s; 39 z-index: 5; 40 transform: ${t=>t.isHidden?"translate3d(0, -110%, 0)":"translate3d(0, 0, 0)"}; 41 transition: transform 0.3s ease; 42 43 &:hover { 44 .AddonCategoryNavComponentStyle { 45 &__ArrowButton { 46 display: ${t=>t.visibleScrollArrow?"block":"none"}; 47 } 48 } 49 } 50`,Yn=l.div.attrs({className:"AddonCategoryNavContainer"})` 51 position: relative; 52 display: flex; 53 flex-direction: column; 54 max-width: ${De.MAX}; 55 margin: auto; 56 padding: 0 20px; 57 58 @media ${q.DESKTOP} { 59 padding: 0 20px; 60 } 61`,Qn=l.h1` 62 display: none; 63 padding-top: 20px; 64 font-size: var(--text-lg); 65 font-weight: bold; 66 color: ${t=>t.theme.reinsurance!==""?t.theme.reinsurance:t.theme.primary}; 67 transition: max-height 0.3s; 68 69 @media ${q.TABLET} { 70 display: block; 71 overflow: hidden; 72 73 .sticky & { 74 padding-top: 0; 75 max-height: 0; 76 } 77 } 78`,Zn=l.nav.attrs({className:"ScrollArea"})` 79 ${t=>!t.$isLargeViewport&&Ce` 80 display: flex; 81 padding: 20px 0; 82 overflow-x: auto; 83 -ms-overflow-style: none; 84 scrollbar-width: none; 85 86 &::-webkit-scrollbar {
87 display: none; 88 } 89 90 & > * + * { 91 margin-left: 15px; 92 } 93 94 a { 95 color: inherit; 96 text-decoration: none; 97 } 98 `} 99 100 ${t=>t.$isLargeViewport&&Ce` 101 display: flex; 102 padding: 1.25rem 0; 103 overflow: hidden; 104 scroll-behavior: smooth; 105 106 &::-webkit-scrollbar { 107 width: 1rem; 108 height: 0.75rem; 109 } 110 111 & > * + * { 112 margin-left: 0.875rem; 113 } 114 115 a { 116 color: inherit; 117 text-decoration: none; 118 } 119 `} 120`,et=l.button.attrs({className:"AddonCategoryNavComponentStyle__ArrowButton ArrowButton"})` 121 position: absolute; 122 top: 65%; 123 transform: translateY(-50%); 124 background-color: ${t=>t.theme.primary}; 125 color: white; 126 border: none; 127 cursor: pointer; 128 padding: 0.25rem; 129 z-index: 1; 130 border-radius: 50%; 131 height: 2.5rem; 132 width: 2.5rem; 133 transition: opacity 0.3s ease-in-out; 134 135 display: none; 136 137 .ArrowButton { 138 &__Icon { 139 height: 1.5rem; 140 width: 1.5rem; 141 } 142 } 143`,tt=l(et)` 144 left: -3rem; 145`,nt=l(et)` 146 right: -3rem; 147`;l(tt)` 148 background-color: white; 149`;l(nt)` 150 background-color: white; 151`;const Jn=l.div` 152 display: flex; 153 align-items: center; 154 padding: 15px 20px; 155 border: 2px solid ${t=>t.theme.grey2}; 156 border-radius: 10px; 157 white-space: nowrap; 158 background-color: ${t=>t.theme.background}; 159 160 & > * { 161 flex-shrink: 0; 162 } 163 164 & > * + * { 165 margin-left: 8px; 166 } 167 168 a.active & { 169 color: ${t=>t.theme.onPrimary}; 170 background-color: ${t=>t.theme.primary}; 171 border-color: ${t=>t.theme.primary}; 172 173 i.icon { 174 background-color: ${t=>t.theme.surface}; 175 } 176 } 177 178 a:hover & { 179 border-color: ${t=>t.theme.primary}; 180 } 181`,eo=l.span` 182 font-size: var(--text-md); 183 font-weight: bold; 184`,Ee=50,to=(t,n)=>t.offsetLeft+t.clientWidth>n.clientWidth+n.scrollLeft,no=(t,n)=>t.offsetLeft-n.offsetLeft<n.scrollLeft,Le=(t,n)=>{t.scrollTo({left:n,behavior:"smooth"})},oo=J.forwardRef(({category:t,isSelected:n,isFocused:r,tabIndex:i,onKeyUp:s},c)=>{const{id:d,icon:x,name:S}=t,{src:u}=x,v=m.useRef(null),h=Ie(),E=_e(h),b=new URLSearchParams(h.location.search);b.set(gt.ADDON_LOADED,"true"),J.useImperativeHandle(c,()=>v.current);const j=m.useCallback(()=>{const y=v.current;if(!y)return;const C=y.parentElement;if(C){if(to(y,C)){const k=y.offsetLeft-C.offsetLeft+y.clientWidth-C.clientWidth+Ee;Le(C,k)}else if(no(y,C)){const k=y.offsetLeft-C.offsetLeft-Ee;Le(C,k)}}},[]);return m.useEffect(()=>{n&&j()},[n,j]),m.useEffect(()=>{r&&v.current&&j()},[r,j]),e.jsx(ht,{to:`${E}/${d}?${b.toString()}`,"data-cy":"AddonCategoryNavLink",ref:v,onClick:j,tabIndex:i,onKeyUp:s,role:"tab",id:`addon-category-tab-${d}`,"aria-selected":n,"aria-controls":`addon-category-panel-${d}`,children:e.jsxs(Jn,{"data-cy":"AddonCategoryTitle",children:[e.jsx($,{src:u,size:"20",color:"primary","aria-hidden":"true"}),e.jsx(eo,{children:S})]})})});var ge,ve;function ao(){if(ve)return ge;ve=1;var t="Expected a function",n=NaN,r="[object Symbol]",i=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,d=/^0o[0-7]+$/i,x=parseInt,S=typeof se=="object"&&se&&se.Object===Object&&se,u=typeof self=="object"&&self&&self.Object===Object&&self,v=S||u||Function("return this")(),h=Object.prototype,E=h.toString,b=Math.max,j=Math.min,y=function(){return v.Date.now()};function C(a,g,A){var _,N,V,B,R,W,M=0,H=!1,G=!1,Y=!0;if(typeof a!="function")throw new TypeError(t);g=O(g)||0,I(A)&&(H=!!A.leading,G="maxWait"in A,V=G?b(O(A.maxWait)||0,g):V,Y="trailing"in A?!!A.trailing:Y);function X(P){var U=_,K=N;return _=N=void 0,M=P,B=a.apply(K,U),B}function z(P){return M=P,R=setTimeout(F,g),H?X(P):B}function te(P){var U=P-W,K=P-M,w=g-U;return G?j(w,V-K):w}function ne(P){var U=P-W,K=P-M;return W===void 0||U>=g||U<0||G&&K>=V}function F(){var P=y();if(ne(P))return Q(P);R=setTimeout(F,te(P))}function Q(P){return R=void 0,Y&&_?X(P):(_=N=void 0,B)}function oe(){R!==void 0&&clearTimeout(R),M=0,_=W=N=R=void 0}function le(){return R===void 0?B:Q(y())}function Z(){var P=y(),U=ne(P);if(_=arguments,N=this,W=P,U){if(R===void 0)return z(W);if(G)return R=setTimeout(F,g),X(W)}return R===void 0&&(R=setTimeout(F,g)),B}return Z.cancel=oe,Z.flush=le,Z}function k(a,g,A){var _=!0,N=!0;if(typeof a!="function")throw new TypeError(t);return I(A)&&(_="leading"in A?!!A.leading:_,N="trailing"in A?!!A.trailing:N),C(a,g,{leading:_,maxWait:g,trailing:N})}function I(a){var g=typeof a;return!!a&&(g=="object"||g=="function")}function f(a){return!!a&&typeof a=="object"}function D(a){return typeof a=="symbol"||f(a)&&E.call(a)==r}function O(a){if(typeof a=="number")return a;
184if(D(a))return n;if(I(a)){var g=typeof a.valueOf=="function"?a.valueOf():a;a=I(g)?g+"":g}if(typeof a!="string")return a===0?a:+a;a=a.replace(i,"");var A=c.test(a);return A||d.test(a)?x(a.slice(2),A?2:8):s.test(a)?n:+a}return ge=k,ge}var ro=ao();const so=ft(ro);function io(t){const[,n]=m.useState(0);let r=0;function i(){const{scrollTop:c}=document.documentElement||document.body;n(d=>(r=d,c)),t({previousScrollTop:r,currentScrollTop:c})}const s=so(i,250);m.useEffect(()=>(window.addEventListener("scroll",s),()=>window.removeEventListener("scroll",s)),[s])}const je=150,Pe="20",co=80,lo=100,uo=()=>{const{isLargeViewport:t}=de(),n=xt(),[r,i]=m.useState(!1),[s,c]=m.useState(!1),d=o(Re),x=o(Ne),S=o(St),u=o(Tt),v=o(Ct),h=o(bt),E=J.useRef(null),b=J.useMemo(()=>{const a=n?.pathname?.split("/")||[];if(a.length===0)return 0;const g=a[a.length-1],A=d.findIndex(_=>_.id===g);return A>=0?A:0},[n.pathname,d]),j=m.useCallback((a,g)=>{g?.click()},[]),{focusedIndex:y,selectedIndex:C,setTabRef:k,handleKeyPress:I,setSelectedIndex:f}=An(d.length,j,b);m.useEffect(()=>{b!==C&&f(b)},[b,C,f]),io(a=>{const{previousScrollTop:g,currentScrollTop:A}=a,_=g<A,N=A>co;setTimeout(()=>{i(_&&N)},lo)});const D=m.useCallback(()=>{if(E.current){const{scrollWidth:a,clientWidth:g}=E.current;c(a>g)}},[]),O=m.useCallback(a=>{E.current&&E.current.scrollBy({left:a,behavior:"smooth"})},[]);return m.useEffect(()=>(D(),window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}),[D]),e.jsx(qn,{"data-cy":"AddonCategoryNavHeader",isHidden:r,imageUrl:h?.src,visibleScrollArrow:s,role:"navigation","aria-label":S,"data-testid":"AddonCategoryNavComponent",children:e.jsxs(Yn,{children:[e.jsx(Qn,{id:"addon-category-nav-title",children:x}),s&&e.jsx(tt,{onClick:()=>O(-je),"aria-label":u,children:e.jsx($,{name:"chevron-left",size:Pe,color:"white"})}),e.jsx(Zn,{ref:E,$isLargeViewport:t,role:"tablist","aria-labelledby":"addon-category-nav-title",children:d.map((a,g)=>e.jsx(oo,{ref:A=>k(g,A),category:a,isSelected:C===g,isFocused:y===g,onKeyUp:I},a.id))}),s&&e.jsx(nt,{onClick:()=>O(je),"aria-label":v,children:e.jsx($,{name:"chevron-right",size:Pe,color:"white"})})]})})},ot=l.div` 185 padding: 20px; 186 border-width: 2px; 187 border-style: solid; 188 border-color: ${t=>t.isSelected?t.theme.primary:t.theme.grey2}; 189 border-radius: 10px; 190 191 & > * + * { 192 margin-top: 10px; 193 } 194`,at=l(yt)``,rt=l.div` 195 display: flex; 196 flex-direction: column; 197 padding: 20px; 198 background-color: ${t=>t.theme.surface}; 199 box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15); 200 border-radius: 10px; 201 202 &.gift-card { 203 gap: 20px; 204 } 205 206 & > * + * { 207 margin-top: 20px; 208 } 209 210 @media ${q.DESKTOP} { 211 flex-direction: row; 212 padding: 30px; 213 214 & > * + * { 215 margin-top: 0; 216 margin-left: 20px; 217 } 218 } 219`,st=l.div` 220 display: flex; 221 flex-direction: column; 222 flex-grow: 1; 223 224 & > * + * { 225 margin-top: 10px; 226 } 227`,it=l.button` 228 display: flex; 229 justify-content: space-between; 230 align-items: center; 231 cursor: pointer; 232 233 @media ${q.DESKTOP} { 234 cursor: default; 235 } 236`,po=l.h2` 237 font-size: var(--text-lg); 238 font-weight: bold; 239 line-height: var(--line-height); 240 text-align: left; 241`,dt=l.div` 242 &:not(.no-margins) > * + * { 243 margin-top: 10px; 244 } 245 246 ${ot}, ${jn} { 247 margin-top: 20px; 248 } 249`,ct=l.p` 250 line-height: var(--line-height); 251 font-size: var(--text-smd); 252`,lt=l.div` 253 flex-shrink: 0; 254 position: relative; 255 cursor: pointer; 256 257 img { 258 width: 100%; 259 border-radius: 8px; 260 display: block; 261 } 262 263 @media ${q.DESKTOP} { 264 flex-basis: 180px; 265 cursor: default; 266 } 267`,mo=l.p` 268 display: flex; 269 gap: 8px; 270`,ut=l.div` 271 display: flex; 272 align-items: flex-start; 273 align-self: stretch; 274`,pt=l.div` 275 display: flex; 276 height: 28px; 277 padding: ${be.XS} ${be.LG}; 278 align-items: center; 279 gap: ${At.SM}; 280 align-self: stretch; 281 width: 100%; 282 border-radius: ${ye.MD} ${ye.MD} 0 0; 283 background-color: ${t=>t.theme.primary}; 284`,go=t=>{const{id:n}=t,r=!o(Et(n)),i=o(Lt(n)),s=c=>{c.stopPropagation()};return e.jsxs(ot,{"data-cy":"ProductPicker",isSelected:i,onClick:s,children:[r&&e.jsx(Pn,{productId:n}),e.jsx(kn,{productId:n})]})},ho=t=>{const{id:n}=t,{isLargeViewport:r,get:i}=de(),s=o(xe(n)),[c,d]=m.useState(r),x=o(vt(n)),S=o(jt(n)),u=o(Oe),v=o(Pt(n,i())),h=o(kt(n,i())),E=o(Dt(n)),b=o(wt(n)),j=o(Be),y=o($e),C=o(It(n)),k=m.useId();m.useEffect(()=>{d(r)},[r]);const I=m.useCallback(()=>{r||d(!c)},[c,r]);if(!s||s.hidden&&!j)return null;const f=[b?"gift-card":""].join(" ");return e.jsxs(at,{"data-cy":"AddonCard",className:f,children:[s.highlightContent&&e.jsx(ut,{children:e.jsxs(pt,{children:[e.jsx($,{size:"16",color:"white",name:"ticket-filled"}),e.jsx(Ye,{color:Ue.PRIMARY,inverted:!0,weight:he.BOLD,children:s.highlightContent})]})}),e.jsxs(rt,{children:[h&&e.jsx(vn,{imageList:h,desktopWidth:"180",imageBorderRadius:8}),!h&&v&&e.jsx(lt,{onClick:I,children:e.jsx(We,{image:v,width:"560",desktopWidth:"180"})}),e.jsxs(st,{children:[e.jsxs(it,{as:r?"div":"button",onClick:I,"data-cy":"AddonContentToggle","aria-expanded":c,"aria-controls":k,children:[e.jsx(po,{children:s.label}),!r&&e.jsx($,{name:c?"arrow-up":"arrow-down",size:"20",color:"primary"})]}),c&&e.jsxs(dt,{id:k,children:[e.jsx(ct,{"data-cy":"AddonConditions",children:s.validityConditions}),e.jsx(Qe,{modal:Ze,productLabel:S,iconUrl:x,metadataId:s.metadataId,productId:n,button:Fe,children:u}),y&&C&&e.jsx(En,{status:"danger",children:e.jsxs(mo,{children:[e.jsx($,{name:"warning",size:"20px"}),e.jsx("span",{children:y})]})}),b?e.jsx(Dn,{productId:n}):e.jsx(go,{id:n})]}),!c&&E&&e.jsx(e.Fragment,{children:e.jsx(_n,{product:E,isExpanded:!c})})]})]})]})};var T;(t=>{const n=_t` 285 0% { 286 background-position: -200px 0; 287 } 288 100% { 289 background-position: 200px 0; 290 } 291 `;t.WrapperForm=l.form` 292 display: flex; 293 flex-direction: column; 294 gap: 1rem; 295 padding: 2rem; 296 border-radius: 0.625rem; 297 box-shadow: 0 0.75rem 1.875rem 0 rgba(0, 0, 0, 0.15); 298 background-color: #fff; 299 `,t.FormContainer=l.div` 300 display: grid; 301 grid-template-columns: 1fr 1fr; 302 width: 100%; 303 gap: 1rem;
304 align-items: center; 305 padding: 1rem; 306 border-radius: 0.625rem; 307 border: 2px solid #E6E6E6; 308 309 .transport-ticket-form__input--align-right { 310 justify-self: right; 311 312 > div { 313 >.custom__menu { 314 min-width: max-content; 315 } 316 } 317 318 &.transport-ticket-form__input--disabled { 319 > * > * >.react-datepicker__input-container { 320 background-color: ${i=>i.theme.disabled}; 321 cursor: not-allowed; 322 323 input { 324 cursor: not-allowed; 325 } 326 } 327 } 328 } 329 330 .transport-ticket-form__submit-button { 331 grid-column: span 2; 332 333 svg > * { 334 stroke: ${i=>i.theme.onSurface}; 335 } 336 } 337 338 .transport-ticket-form__passenger-type-dropdown { 339 > div { 340 > .custom__menu { 341 min-width: max-content; 342 } 343 } 344 } 345 `,t.StationsDropdownWidth=l.div``;const r=l.div` 346 width: ${({width:i})=>i||"100px"}; 347 height: ${({height:i})=>i||"1rem"}; 348 border-radius: ${({borderRadius:i})=>i||"0.25rem"}; 349 background: #E6E6E6 linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); 350 background-size: 400% 100%; 351 animation: ${n} 1.5s infinite ease-in-out; 352 `;t.Title=l.h2` 353 font-size: 1.375rem; 354 font-weight: 700; 355 line-height: 1.5rem; 356 `,t.Subtitle=l.p` 357 font-size: 1rem; 358 font-weight: 400; 359 line-height: 1.5rem; 360 `,t.Label=l.label` 361 font-size: 1rem; 362 font-weight: 700; 363 line-height: 1rem; 364 `,t.SkeletonBox=r,t.TransportAlert=l($n)` 365 display: flex; 366 gap: 12px; 367 `,t.NoTicketAvailableAlert=l(t.TransportAlert)` 368 grid-column: 1 / -1; 369 width: 100%; 370 `})(T||(T={}));const fo=T.TransportAlert;function ke(){const t=o(Me(Rt.ERROR_TRANSPORT_SERVICE_UNAVAILABLE));return e.jsxs(fo,{status:"danger",children:[e.jsx($,{name:"warning",size:"20",color:"error"}),e.jsx(fe,{document:t})]})}const L={TitleWidth:"80%",XlHeight:"2rem",SubtitleWidth:"40%",SmHeight:"1rem",XlBorderRadius:"1rem",XlWidth:"60%",MdWidth:"50%",SmWidth:"40%"},xo=()=>e.jsxs(T.WrapperForm,{children:[e.jsx(T.SkeletonBox,{width:L.TitleWidth,height:L.XlHeight}),e.jsx(T.SkeletonBox,{width:L.SubtitleWidth,height:L.SmHeight}),e.jsxs(T.FormContainer,{children:[e.jsx(T.SkeletonBox,{width:L.SmWidth,height:L.SmHeight}),e.jsx(T.SkeletonBox,{width:L.XlWidth,height:L.XlHeight,borderRadius:L.XlBorderRadius}),e.jsx(T.SkeletonBox,{width:L.SmWidth,height:L.SmHeight}),e.jsx(T.SkeletonBox,{width:L.MdWidth,height:L.XlHeight,borderRadius:L.XlBorderRadius}),e.jsx(T.SkeletonBox,{width:L.SmWidth,height:L.SmHeight}),e.jsx(T.SkeletonBox,{width:L.MdWidth,height:L.XlHeight,borderRadius:L.XlBorderRadius}),e.jsx(T.SkeletonBox,{width:L.SmWidth,height:L.SmHeight}),e.jsx(T.SkeletonBox,{width:L.XlWidth,height:L.XlHeight,borderRadius:L.XlBorderRadius})]})]}),So="selectedTickets",To="all";var p=(t=>(t.DEPARTURE_STATION="departureStation",t.ROUND_TRIP_DATE="roundTripDate",t.PASSENGER_COUNT="passengerCount",t[t.SELECTED_TICKETS=So]="SELECTED_TICKETS",t))(p||{});const Co=({control:t,isDisabled:n,onSelectDate:r,defaultValue:i,options:s})=>{const{roundTripDateLabel:c}=o(ee),d=x=>s.some(S=>me(S.value).isSame(x,"day")&&!S.disabled);return e.jsxs(e.Fragment,{children:[e.jsx(T.Label,{htmlFor:p.ROUND_TRIP_DATE,children:c}),e.jsx(Te,{control:t,name:p.ROUND_TRIP_DATE,render:({field:x})=>e.jsx("div",{className:"transport-ticket-form__input--align-right transport-ticket-form__input--disabled",children:e.jsx(Wn,{readOnly:!0,disabled:n,noBorder:n,date:me(x.value)||i,numberOfMonths:1,onDateChange:r,dateFormat:me.localeData().longDateFormat("L"),customInputIcon:e.jsx($,{name:"calendar-products",size:"13",color:"dark"}),isDayBlocked:d})})})]})},bo=({control:t,isDisabled:n,onChangePassengers:r,isLoading:i,id:s})=>{const{passengerCountLabel:c}=o(ee),d=o(Nt);return e.jsxs(e.Fragment,{children:[e.jsx(T.Label,{htmlFor:p.PASSENGER_COUNT,children:c}),e.jsx(Te,{control:t,name:p.PASSENGER_COUNT,render:({field:x})=>e.jsx("div",{className:"transport-ticket-form__input--align-right",children:e.jsx(Rn,{onChange:S=>r(S),disabled:n,name:p.PASSENGER_COUNT,value:x.value??0,max:d,min:0,useDebounce:!0,buttonType:"button",isLoading:i,id:s})})})]})},yo=t=>({value:t.date,label:Ot(t).format("L"),disabled:!1}),Ao=(t,n)=>({value:t.id,label:t.label,disabled:n.isUnique}),Eo=(t,n)=>({value:t.id,label:`${t.label} (${t.price.value} ${Bt(t.price.currencyCode)})`,disabled:n.isUnique}),Lo=T.NoTicketAvailableAlert,vo=({passengerCount:t,departureStationId:n,onChange:r,fields:i})=>{const{ticketTypeLabel:s,passengerDesignationLabel:c,ticketTypePlaceholderL
370abel:d}=o(ee),x="warning.transport.unavailableProductOrStation",S=!!t,u=o(ze(n)),v=u.map(j=>Eo(j,{isUnique:u.length===1})),h=o(Me(x)),E=o($t),b=o(Ut(n));return e.jsxs(e.Fragment,{children:[E&&S&&e.jsx(e.Fragment,{children:e.jsxs(Lo,{status:"danger",children:[e.jsx($,{name:"warning",size:"20",color:"error"}),e.jsx(fe,{document:h})]})}),i.map((j,y)=>{const C=y+1,k=`passengers.${C}`,I=S?`${s} - ${c} ${C}`:s,f=u?.find(a=>a.id===j.value),D=u.length===1?u[0].id:void 0,O=a=>{r(y,a)};return e.jsxs(J.Fragment,{children:[e.jsx(T.Label,{htmlFor:k,children:I}),b?e.jsx("div",{className:"transport-ticket-form__passenger-type-dropdown","data-testid":"sncbTicketPassengerRow",children:e.jsx(Je,{name:k,onChange:O,isOutlined:!0,optionList:v,defaultOptionValue:D,selectedValue:j.value,hasLightPlaceholder:!0,placeholderLabel:d,shape:"round",customPaddingStyle:"0 0 0 1rem",id:k})}):e.jsx(T.SkeletonBox,{className:"transport-ticket-form__input--align-right",width:"100%",height:"2rem",borderRadius:"1rem"}),f?.highlightInformation&&e.jsx(Se,{message:f?.highlightInformation,iconName:"idea"})]},j.id)})]})},jo=T.StationsDropdownWidth,Po=({control:t,isDisabled:n,onSelectStation:r,defaultValue:i,options:s})=>{const c=o(Ve),{departureStationLabel:d,departureStationPlaceholderLabel:x}=o(ee);return e.jsxs(e.Fragment,{children:[e.jsx(T.Label,{htmlFor:p.DEPARTURE_STATION,children:d}),e.jsx(Te,{control:t,name:p.DEPARTURE_STATION,render:({field:S})=>e.jsx(jo,{className:"transport-ticket-form__input--align-right",children:c?e.jsx(Je,{isLong:!0,hasLightPlaceholder:n,onChange:u=>r(u),selectedValue:S.value,isOutlined:n,disabled:n,defaultOptionValue:i,placeholderL
370abel:x,name:S.name,id:p.DEPARTURE_STATION,optionList:s,shape:"round",customPaddingStyle:"0 0 0 14px"}):e.jsx(T.SkeletonBox,{className:"transport-ticket-form__input--align-right",width:"100%",height:"2rem",borderRadius:"1rem"})})})]})};function ko(t,n,r,i){const s=ce(),c=o(He),d=o(Ge),x=c?.[0]?.departureStation?.id,S=o(Xe(x)),{setValue:u,watch:v}=t,{append:h,remove:E}=n,[b]=v([p.PASSENGER_COUNT]);return{syncFormDataWithCart:m.useCallback(()=>{x&&u(p.DEPARTURE_STATION,x),u(p.PASSENGER_COUNT,S),E(),d.forEach(f=>h({value:f.variantId??""})),s(Wt(!1)),i(!1)},[S,x,h,E,u,s,d,i]),onSelectStation:f=>{u(p.DEPARTURE_STATION,f),u(p.PASSENGER_COUNT,0),E(),r(!0)},onSelectDate:f=>{f&&u(p.ROUND_TRIP_DATE,new Ke(f).date),u(p.PASSENGER_COUNT,0),E(),r(!0)},onChangePassengers:f=>{u(p.PASSENGER_COUNT,f),b<f?Array.from({length:f-b}).forEach(()=>h({value:""})):Array.from({length:b-f}).forEach(()=>E(-1)),r(!0)},onSelectTransportProduct:(f,D)=>{u(`${p.SELECTED_TICKETS}.${f}.value`,D),r(!0)}}}const Do=({id:t})=>{const n=ce(),r=o(xe(t)),i=o(Ft),s=o(Mt),c=o(ee),d=o(zt)??[],x=o(Vt),S=o(Ve),u=o(Ht),v=o(Gt),h=o(Xt),[E,b]=m.useState(!1),j=!o(Kt),[y,C]=m.useState(!1),[k,I]=m.useState(!1),f=d?.map(w=>Ao(w,{isUnique:d.length===1}))??[],D=x?x.map(yo):[],O=o(He),a=O?.[0]?.departureStation?.id,g=O?.[0]?.consumptionDateTime,A=o(Xe(a)),_=o(Ge),N=f.length===1?f?.[0].value:a,V=D.length===1?D[0]?.value:D.find(w=>w.value===g?.id)?.value,B=Nn({mode:To,defaultValues:{[p.DEPARTURE_STATION]:N,[p.ROUND_TRIP_DATE]:V,[p.PASSENGER_COUNT]:A,[p.SELECTED_TICKETS]:_.map(w=>({value:w.variantId}))}}),{control:R,watch:W,getValues:M,formState:{isSubmitting:H},handleSubmit:G}=B,Y=On({name:p.SELECTED_TICKETS,control:R}),{fields:X}=Y,[z,te,ne]=W([p.DEPARTURE_STATION,p.ROUND_TRIP_DATE,p.PASSENGER_COUNT]),F=o(ze(z)),Q={[p.PASSENGER_COUNT]:H||!z||u||F.length===0,[p.DEPARTURE_STATION]:H||!f.length,[p.ROUND_TRIP_DATE]:H||!D||D.length<=1,[p.SELECTED_TICKETS]:H},{syncFormDataWithCart:oe,onSelectStation:le,onSelectDate:Z,onChangePassengers:P,onSelectTransportProduct:U}=ko(B,Y,C,I),K=()=>{const w=B.getValues(),ae=w.selectedTickets.map((ue,pe)=>({index:pe,value:ue.value}));n(Yt(ae)),n(Qt(w.departureStation,w.roundTripDate,ae))};return m.useEffect(()=>{j||oe()},[j,oe]),m.useEffect(()=>{z&&(b(!0),n(qt(z,new Ke(te))))},[z,te,n]),m.useEffect(()=>{if(y){b(!0);const w=M(),ae=w.departureStation&&w.roundTripDate,ue=(w.passengerCount>0||v)&&w.passengerCount===X.length;F.length===1&&w.selectedTickets.forEach(re=>{re.value=F[0].id});const pe=w.selectedTickets.every(re=>re.value&&re.value!=="");I(!!(ae&&ue&&pe)),C(!1)}else h||b(!1)},[X,M,y,v,h,F]),m.useEffect(()=>{!u&&!h&&b(!1)},[u,h]),s?i?e.jsx(xo,{}):!r||!x||!c?e.jsx(ke,{}):d.length===0&&S?e.jsx(ke,{}):e.jsx(Bn,{...B,children:e.jsxs(T.WrapperForm,{onSubmit:G(K),children:[e.jsx(T.Title,{id:`variant-label-${r.id}`,children:r.label}),e.jsx(T.Subtitle,{children:r.validityConditions}),e.jsxs(T.FormContainer,{children:[e.jsx(Po,{control:R,isDisabled:Q[p.DEPARTURE_STATION],onSelectStation:le,defaultValue:N,options:f}),e.jsx(Co,{control:R,isDisabled:Q[p.ROUND_TRIP_DATE],onSelectDate:Z,defaultValue:V,options:D}),e.jsx(bo,{control:R,onChangePassengers:P,isDisabled:Q[p.PASSENGER_COUNT],isLoading:E,id:`variant-label-${r.id}`}),e.jsx(vo,{passengerCount:ne,onChange:U,departureStationId:z,fields:X}),e.jsx(Un,{className:"transport-ticket-form__submit-button",disabled:u||!k,isLoading:u,children:c.validateFormButton})]})]})}):null},wo=t=>{const{id:n}=t,r=o(xe(n));return r?r?.subType===Zt.TRANSPORT?e.jsx(Do,{id:n}):e.jsx(ho,{id:n}):null},Io=l.div` 371 & > * + * { 372 margin-top: 20px; 373 } 374`,_o=l.div` 375 text-align: center; 376`,Ro=t=>{const{id:n}=t,{isLargeViewport:r}=de(),i=m.useId(),[s,c]=m.useState(r),d=o(Jt(n))?.bundle,{additionalVariants:x,addOnInfo:S,highlightContent:u,imageUrl:v,label:h,metadataId:E,shortDescription:b,type:j,variants:y}=d||{},C=an(h,v),k=o(Be),I=o(en(n)),f=o($e),D=o(Oe),O=o(tn(n));m.useEffect(()=>{c(r)},[r]);const a=m.useCallback(()=>{r||c(!s)},[s,r]);return!d||S?.hidden&&!k?null:e.jsx(wn,{bundle:d,children:e.jsxs(at,{"data-cy":"AddonCard",children:[u&&e.jsx(ut,{children:e.jsxs(pt,{children:[e.jsx($,{size:"16",color:"white",name:"ticket-filled"}),e.jsx(Ye,{color:Ue.PRIMARY,inverted:!0,weight:he.BOLD,children:u})]})}),e.jsxs(rt,{children:[C&&e.jsx(lt,{onClick:a,children:e.jsx(We,{image:C,width:"560",desktopWidth:"180"})}),e.jsxs(st,{children:[e.jsxs(it,{"aria-controls":i,"aria-expanded":s,as:r?"div":"button","data-cy":"AddonContentToggle",onClick:a,children:[e.jsx(Ln,{size:nn.LG,weight:he.BOLD,children:h}),!r&&e.jsx($,{name:s?"arrow-up":"arrow-down",size:"20",color:"primary"})]}),s&&e.jsxs(dt,{id:i,className:"flex--column gap--SM no-margins",children:[e.jsx(ct,{"data-cy":"AddonConditions",children:b}),e.jsx(Qe,{button:Fe,isBundle:!0,metadataId:E,modal:Ze,productId:n,productLabel:h,children:D}),f&&I&&e.jsx(Se,{iconName:"warning",message:f,variant:qe.ALERT}
376),j!==on.UNDATED&&e.jsx(In,{bundleId:n}),e.jsx(Ae,{variants:y}),e.jsx(Ae,{variants:x})]}),!s&&O&&e.jsx(Fn,{cartBundles:[O]})]})]})]})})},No=()=>{const{category:t}=ie(),n=ce(),r=o(rn(t)),i=o(sn(t)),s=o(dn(t)),c=o(cn);return m.useEffect(()=>{s||n(ln(t))},[t,n,s]),s?e.jsxs(Io,{children:[i?.map(d=>e.jsx(Ro,{id:d},d)),r?.map(d=>e.jsx(wo,{id:d},d))]}):e.jsx(_o,{"aria-live":"polite","aria-label":c&&pn.documentToPlainTextString(c),children:e.jsx(un,{reverseColor:!0})})},fa=()=>{const t=ce(),n=Ie(),{isSmallViewport:r}=de(),{category:i}=ie(),s=o(mn),c=o(gn),d=o(Re),x=o(hn(r)),S=o(Ne),u=o(fn),v=d?.findIndex(h=>h.id===i);return m.useEffect(()=>{if(!s&&d?.length&&!d.map(h=>h.id).includes(i)){const h=_e(n);xn(n,h)}},[s,d,i,n]),m.useEffect(()=>{t(Sn(i))},[t,i]),m.useEffect(()=>{t(Tn(S))},[t,S]),s||x?e.jsx(Cn,{}):e.jsxs(zn,{children:[e.jsx(yn,{skipLinksData:u}),e.jsx(uo,{}),e.jsx(Hn,{id:"main",role:"main",children:e.jsxs(Vn,{role:"tabpanel",id:`addon-category-tab-panel-${v}`,"aria-labelledby":`category-tab-${v}`,children:[e.jsx(Gn,{"data-cy":"AddonCategoryTypeDescription",children:e.jsx(Xn,{})}),e.jsx(Kn,{}),e.jsx(Mn,{sidebar:e.jsx(bn,{image:c}),children:e.jsx(No,{})})]})})]})};export{fa as AddonListPresentation};
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.