1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[74116],{41559:()=>{},65114:()=>{},69939:(e,t,a)=>{"use strict";a.d(t,{A:()=>O});var n=a(95155),r=a(12115),l=a(47650),o=a(1213),s=a(90721),i=a(96306);let c=[{name:"adults",defaultValue:1,age:"(12y +)"},{name:"children",defaultValue:0,age:"(2y - 12y)"},{name:"infants",defaultValue:0,age:"(below 2y)"}],d=e=>{let{name:t,defaultValue:a,onCounterChange:r,age:l,totalCount:o,maxTotal:i=9,adultsCount:c=0}=e,d=o<i;return"infants"===t&&(d=d&&c>0&&a<c),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"row y-gap-10 justify-between items-center",children:[(0,n.jsxs)("div",{className:"col-auto",children:[(0,n.jsxs)("div",{className:"text-15 lh-12 fw-500 text-capitalize",children:[t," ",l]}),(0,n.jsx)("span",{className:"text-muted text-14 fw-600",children:"on the day of travel"})]}),(0,n.jsx)("div",{className:"col-auto",children:(0,n.jsxs)("div",{className:"d-flex items-center js-counter",children:[(0,n.jsx)("button",{type:"button","aria-label":"Decrease ".concat(t),className:"button -outline-blue-1 text-blue-1 size-30 rounded-4",onClick:()=>{("adults"!==t||!(a<=1))&&a>0&&((0,s.u4)("guest_search_decrement_clicked",{name:t}),r(t,a-1))},disabled:"adults"===t?a<=1:0===a,children:(0,n.jsx)("i",{className:"icon-minus text-12"})}),(0,n.jsx)("div",{className:"flex-center size-20 ml-15 mr-15",children:(0,n.jsx)("div",{className:"text-15",children:a})}),(0,n.jsx)("button",{type:"button","aria-label":"Increase ".concat(t),className:"button -outline-blue-1 text-blue-1 size-30 rounded-4 ".concat(d?"":"opacity-50"),onClick:()=>{d&&((0,s.u4)("guest_search_increment_clicked",{name:t}),r(t,a+1))},disabled:!d,children:(0,n.jsx)("i",{className:"icon-plus text-12"})})]})})]}),(0,n.jsx)("div",{className:"border-top-light mt-20 mb-20"})]})},u=e=>{var t,a,l;let{title:o="",onChange:s,searchGuestCount:u={},heroVariant:h=!1}=e,[p,m]=(0,r.useState)({adults:null!=(t=u.adults)?t:1,children:null!=(a=u.children)?a:0,infants:null!=(l=u.infants)?l:0}),f=p.adults||0;p.infants;let v=(p.adults||0)+(p.children||0)+(p.infants||0),g=(()=>{let e=p.adults||0,t=p.children||0,a=p.infants||0,n=["".concat(e," adult").concat(1!==e?"s":"")];return t&&n.push("".concat(t," child").concat(1!==t?"ren":"")),a&&n.push("".concat(a," infant").concat(1!==a?"s":"")),n.join(" \xb7 ")})(),y=(()=>{let e=p.adults||0,t=p.children||0,a=p.infants||0,n=["".concat(e," Adult(s)")];return t&&n.push("".concat(t," Child(ren)")),a&&n.push("".concat(a," Infant(s)")),n.join(" | ")})(),x=(e,t)=>{let a={...p,[e]:t};"adults"===e&&a.infants>t&&(a.infants=t),m(a),s(a)},j=(0,r.useRef)(null);return(0,n.jsxs)("div",{className:"searchMenu-guests js-form-dd js-form-counters",children:[(0,n.jsxs)("div",{ref:j,"data-bs-toggle":"dropdown","data-bs-auto-close":"outside","data-bs-display":"static","aria-expanded":"false",role:"button",tabIndex:0,onKeyDown:(0,i.l)(()=>{var e;return null==(e=j.current)?void 0:e.click()}),children:[(0,n.jsx)("h4",{className:"text-15 fw-500 ls-2 lh-16 searchMenu-loc__title",children:o}),(0,n.jsx)("div",{className:"searchMenu-guests__title-value hotel-datepicker",children:(0,n.jsxs)("span",{children:[v," ",h&&1===v?"Traveller":"Travellers"]})}),(0,n.jsx)("div",{className:"searchbox-col-extra-info",children:h?g:y})]}),(0,n.jsx)("div",{className:"shadow-2 dropdown-menu min-width-400",onClick:e=>e.stopPropagation(),children:(0,n.jsxs)("div",{className:"bg-white px-20 py-20 rounded-4 counter-box",children:[(0,n.jsxs)("div",{className:"d-flex justify-between items-center mb-15",children:[(0,n.jsx)("div",{className:"fw-600 text-15",children:o||"Travellers"}),(0,n.jsx)("button",{type:"button",className:"guest-dropdown__close",onClick:()=>{var e;return null==(e=j.current)?void 0:e.click()},"aria-label":"Close",title:"Close",children:"\xd7"})]}),c.map(e=>(0,n.jsx)(d,{name:e.name,age:e.age,defaultValue:p[e.name],totalCount:v,maxTotal:9,adultsCount:f,onCounterChange:x},e.name))]})})]})};a(81583);let h=()=>(0,n.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":!0,children:[(0,n.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,n.jsx)("path",{d:"m21 21-4.3-4.3"})]}),p=e=>{let t=(e||"").trim();return/^[A-Za-z]{2}$/.test(t)?"https://flagcdn.com/24x18/".concat(t.toLowerCase(),".png"):""},m=e=>
1{let{title:t="",value:a="",onChange:l=()=>{},onSearch:o=()=>{},selectedValue:s,locations:c=[],heroVariant:d=!1}=e,[u,m]=(0,r.useState)(""),[f,v]=(0,r.useState)(s),[g,y]=(0,r.useState)(!1),x=(0,r.useRef)(null),j=(0,r.useRef)(null),w=(0,r.useRef)(null),b=(0,r.useId)(),C=a?a.split(",")[0].trim():"";(0,r.useEffect)(()=>{v(s||null)},[s]);let N=()=>{g||(y(!0),m(""),o(""))},S=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];y(!1),m(""),t&&(null==(e=w.current)||e.focus({preventScroll:!0}))};(0,r.useEffect)(()=>{if(!g)return;let e=requestAnimationFrame(()=>{var e;return null==(e=j.current)?void 0:e.focus({preventScroll:!0})});return()=>cancelAnimationFrame(e)},[g]);let k=e=>{v(e),S(!0),l(e)};return(0,r.useEffect)(()=>{if(!g)return;let e=e=>{x.current&&!x.current.contains(e.target)&&S()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[g]),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"searchMenu-loc js-form-dd js-liverSearch",ref:x,children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h4",{className:"text-15 fw-500 ls-2 lh-16 searchMenu-loc__title",children:t}),(0,n.jsx)("div",{className:"text-15 text-light-1 ls-2 lh-16",children:(0,n.jsx)("input",{ref:w,role:"combobox","aria-label":"".concat(t||"Select"," airport"),"aria-controls":b,autoComplete:"off",type:"text",readOnly:!0,placeholder:"Where are you going?",className:"js-search js-dd-focus lh-1 form-control location-search-input ls-field",value:C,onMouseDown:e=>{e.preventDefault(),g?S():N()},onFocus:N,onKeyDown:e=>{"Escape"===e.key&&S()},"aria-haspopup":"dialog","aria-expanded":g})}),(0,n.jsx)("div",{className:"searchbox-col-extra-info",children:d&&(null==s?void 0:s.airportCode)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"hsr-code",children:s.airportCode})," \xb7"," ",s.airportName]}):(null==s?void 0:s.airportCode)?"".concat(s.airportCode," - ").concat(s.airportName):null==s?void 0:s.airportName})]}),(0,n.jsxs)("div",{id:b,role:"dialog","aria-label":"Choose ".concat(t.toLowerCase()||"an"," airport"),inert:!g,className:"dropdown-menu min-width-400 overflow-auto location-search-dropdown show ".concat(g?"is-open":""),"aria-hidden":!g,children:[(0,n.jsxs)("div",{className:"ls-search",children:[(0,n.jsx)(h,{}),(0,n.jsx)("input",{ref:j,className:"ls-search-input",type:"search","aria-label":"Search city or airport",placeholder:"Search city or airport",value:u,onChange:e=>{let t=e.target.value;m(t),o(t.trim())},onKeyDown:e=>{"Escape"===e.key&&S(!0)},autoComplete:"off"})]}),(0,n.jsx)("div",{className:"rounded-4",children:(0,n.jsxs)("ul",{className:"js-results",style:{margin:0,padding:0,listStyle:"none"},children:[c.map((e,t)=>{let a=p(e.isoCountryCode),r=Array.isArray(e.nearby)?e.nearby:[];return(0,n.jsxs)("li",{className:"js-search-option-group",children:[(0,n.jsxs)("div",{className:"-link col-12 text-left js-search-option ls-row ".concat(f&&f.airportCode===e.airportCode?"active":""),role:"button",tabIndex:0,onKeyDown:(0,i.l)(()=>k(e)),onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),k(e)},children:[(0,n.jsx)("span",{className:"ls-code",children:e.airportCode}),(0,n.jsxs)("span",{className:"ls-text",children:[(0,n.jsxs)("span",{className:"ls-city",children:[e.city,e.country?", ".concat(e.country):"",a&&(0,n.jsx)("img",{src:a,alt:e.country||"",width:18,height:13,className:"ls-flag"})]}),(0,n.jsx)("span",{className:"ls-sub",children:e.airportName})]})]}),r.length>0&&(0,n.jsxs)("div",{className:"nearby-airports-section",children:[(0,n.jsxs)("div",{className:"ls-nearby-head",children:[r.length," nearby airport",1===r.length?"":"s"," within ",100," km"]}),(0,n.jsx)("ul",{children:r.map((t,a)=>{let r=p(t.isoCountryCode);return(0,n.jsxs)("li",{className:"-link col-12 text-left js-search-option ls-row nearby-airport-row ".concat(f&&f.airportCode===t.airportCode?"active":""),role:"button",tabIndex:0,onKeyDown:(0,i.l)(()=>k(t)),onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),k(t)},children:[(0,n.jsx)("span",{className:"ls-code",children:t.airportCode}),(0,n.jsxs)("span",{className:"ls-text",children:[(0,n.jsxs)("span",{className:"ls-city",children:[t.city,r&&(0,n.jsx)("img",{src:r,alt:t.country||"",width:18,height:13,className:"ls-flag"})]}),t.airportName&&(0,n.jsxs)("span",{className:"ls-sub",children:[t.airportName," \xb7 ",Math.round(t.distanceKm)," km from ",e.city]})]})]},"".concat(t.airportCode,"-nb-").concat(a))})})]})]},"".concat(e.airportCode,"-").concat(t))}),!c.length&&(0,n.jsxs)("li",{className:"ls-empty",children:[(0,n.jsx)("span",{className:"ls-empty-emoji","aria-hidden":!0,
1children:"â"}),u?'No airports match "'.concat(u,'"'):"Start typing a city or airport"]})]})})]})]})})};var f=a(40016);a(20063);var v=a(12999),g=a(19740),y=a(38581),x=a(85583),j=a(47674),w=a(85788),b=a(11099),C=a(73880);async function N(e){try{let{data:t}=await b.A.post("/flight/calendar-fare",e);return null!=t?t:null}catch(e){return(0,C.N)(e,{event:"caught_error",level:"warning",tags:{kind:"swallowed",module:"flights/calendar-fare"}}),null}}var S=a(92649),k=a(92610),_=a(46330),D=a(8818),T=a(6815),E=a(83239);a(41559);let M="DD MMM YY",Y={city:"Bangalore",airportCode:"BLR",airportName:"Bengaluru International Airport",country:"India"},A={city:"Dubai",airportCode:"DXB",airportName:"Dubai",country:"United Arab Emirates"},F=new Map;function O(e){var t,a,i,c,d;let h,p,{searchValues:b={},handleSearch:O,isShowSearchFilter:P,onEdit:R,isSearchPage:I=!1,presetDestination:G=null,heroVariant:L=!1}=e,J=(0,r.useRef)(!1),z=(0,r.useRef)(new Set),q="flight_origin_location",V="flight_destination_location",K=(e,t)=>{try{let a=localStorage.getItem(e);return a?JSON.parse(a):t}catch(e){return t}},B=(0,r.useRef)(!1),[H,U]=(0,r.useState)(!1),X=(0,r.useRef)(null),W=(0,r.useRef)(null),$=(0,r.useRef)(null),[Z,Q]=(0,r.useState)(""),ee=(0,k.o)(Z,200),{data:et,isLoading:ea}=(0,S.z)(ee),[en,er]=(0,r.useState)([]),el=(0,r.useMemo)(()=>{let e=new Map;return(null!=et?et:[]).forEach(t=>e.set(t.airportCode,t)),en.forEach(t=>e.set(t.airportCode,t)),Array.from(e.values())},[et,en]),[eo,es]=(0,r.useState)({}),ei=async function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eE;if(e&&t)try{let n=Array.from({length:2},(n,r)=>{let l;l=0===r?new v.YG(a):new v.YG(a).add(1,"months").setDay(1);let o="".concat(e,"-").concat(t,"-").concat(l.format("YYYY-MM")),s=F.get(o);if(s)return s;let i="".concat(l.format("YYYY-MM-DD"),"T00:00:00"),c=N({journeyType:1,preferredAirlines:null,segments:[{origin:e,destination:t,flightCabinClass:1,preferredDepartureTime:i}],sources:null}).then(e=>(e||F.delete(o),e)).catch(e=>{throw F.delete(o),e});return F.set(o,c),c}),r=await Promise.all(n),l={};r.forEach(e=>{var t;((null==e||null==(t=e.result)?void 0:t.searchResults)||[]).forEach(e=>{let t=new Date(e.departureDate).toDateString();(!l[t]||e.fare<l[t])&&(l[t]=e.fare)})}),es(e=>({...e,...l}))}catch(e){(0,C.N)(e,{event:"caught_error",level:"warning",tags:{kind:"swallowed",module:"flights/calendar-fare"}}),console.error("Calendar fare API error",e)}},ec=async e=>{Q(e)},ed=async e=>{if(!e)return null;let t=await (0,w.wf)(e);return(null==t?void 0:t.find(t=>t.airportCode===e))||null},eu=new v.YG,eh=(0,j.A)();(null==b?void 0:b.segments)&&(h=new v.YG(null==b||null==(i=b.segments[0])?void 0:i.preferredDepartureTime),p=(null==b||null==(c=b.segments[1])?void 0:c.preferredDepartureTime)?new v.YG(null==b||null==(d=b.segments[1])?void 0:d.preferredDepartureTime):h?new v.YG(h).add(7,"days"):new v.YG(eu).add(7,"days"));let[ep,em]=(0,r.useState)(!1),[ef,ev]=(0,r.useState)((null==b?void 0:b.journeyType)||"1"),[eg,ey]=(0,r.useState)((null==b?void 0:b.flightCabinClass)||"2");(0,r.useEffect)(()=>{(null==b?void 0:b.flightCabinClass)!=null&&ey(b.flightCabinClass)},[null==b?void 0:b.flightCabinClass]);let{ready:ex,cabinCode:ej}=(0,_.H)(),[ew,eb]=(0,r.useState)(!1),eC=(0,r.useRef)(!1);(0,r.useEffect)(()=>{!eC.current&&ex&&(eC.current=!0,(null==b?void 0:b.flightCabinClass)==null&&ej&&(ey(ej),eb(!0)))},[ex,ej,null==b?void 0:b.flightCabinClass]);let[eN,eS]=(0,r.useState)((null==b?void 0:b.journeyType)==="2"),[ek,e_]=(0,r.useState)(()=>{var e,t;return{...Y,airportCode:(null==b||null==(t=b.segments)||null==(e=t[0])?void 0:e.origin)||Y.airportCode}}),[eD,eT]=(0,r.useState)(()=>{var e,t;return{...A,airportCode:(null==b||null==(t=b.segments)||null==(e=t[0])?void 0:e.destination)||A.airportCode}}),[eE,eM]=(0,r.useState)(h||new v.YG(eu)),[eY,eA]=(0,r.useState)(p||new v.YG(eu).add(7,"days")),[eF,eO]=(0,r.useState)({adults:(null==b?void 0:b.adultCount)||1,children:(null==b?void 0:b.childCount)||0,infants:(null==b?void 0:b.infantCount)||0}),{tabs:eP,currentTab:eR}=(0,o.d4)(e=>e.hero)||{};(0,o.wA)();let[eI,eG]=(0,r.useState)(!1),[eL,eJ]=(0,r.useState)(!1),[ez,eq]=(0,r.useState)(!1),{isNavigating:eV}=(0,f.OX)(),eK=ez||eV,[eB,eH]=(0,r.useState)(0),eU=e=>{if(!e)return null;if("function"==typeof(null==e?void 0:e.toDate)){let t=e.toDate();return t instanceof Date&&!isNaN(t)?t.getTime():null}if(e instanceof Date)return isNaN(e.getTime())?null:e.getTime();if("number"==typeof e)return e;let t=new Date(e);return isNaN(t.getTime())?null:t.getTime()};(0,r.useEffect)(()=>{let e=K(q,null),t=K(V,null);e&&(e_(e),B.current=!0),t&&(eT(t),B.current=!0)},[]),(0,r.useEffect)(()=>{eN||eJ(!1)},[eN]),(0,r.useEffect)(()=>{z.current.clear(),es({})},[null==ek?void 0:ek.airportCode,null==eD?void 0:eD.airportCode]);let eX=(0,r.useRef)(!1);(0,r.useEffect)(()=>
1{if(!eX.current&&(null==b?void 0:b.segments)){if(B.current){eX.current=!0;return}eX.current=!0,(async()=>{var e,t;let a=null==(e=b.segments[0])?void 0:e.origin,n=null==(t=b.segments[0])?void 0:t.destination,r=el.find(e=>e.airportCode===a),l=el.find(e=>e.airportCode===n);!r&&a&&(r=await ed(a)),!l&&n&&(l=await ed(n)),r&&e_(r),l&&eT(l),er(e=>{let t=new Map(e.map(e=>[e.airportCode,e]));return r&&t.set(r.airportCode,r),l&&t.set(l.airportCode,l),Array.from(t.values())})})()}},[b,el]),(0,r.useEffect)(()=>{(null==ek?void 0:ek.airportCode)&&(null==eD?void 0:eD.airportCode)&&ei(ek.airportCode,eD.airportCode)},[null==ek?void 0:ek.airportCode,null==eD?void 0:eD.airportCode,eE]);let eW=(e,t,a,r)=>(0,n.jsx)("button",{type:"button",className:"rmdp-arrow-container rmdp-".concat(e),"aria-label":"left"===e?"Previous month":"Next month",onClick:t,onKeyDown:r,disabled:a,children:(0,n.jsx)("i",{className:"rmdp-arrow","aria-hidden":"true"})});(0,r.useEffect)(()=>{if(!eI&&!eL)return;let e=requestAnimationFrame(()=>{var e;let t=document.querySelector(".cal-v2.rmdp-wrapper");null==t||t.setAttribute("aria-label",eL?"Choose departure and return dates":"Choose departure date"),null==t||null==(e=t.querySelector(".rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden)"))||e.focus()}),t=e=>{var t,a,n,r,l;"Escape"===e.key&&(e.preventDefault(),null==(a=X.current)||null==(t=a.closeCalendar)||t.call(a),null==(r=W.current)||null==(n=r.closeCalendar)||n.call(r),eG(!1),eJ(!1),null==(l=$.current)||l.focus())};return document.addEventListener("keydown",t),()=>{cancelAnimationFrame(e),document.removeEventListener("keydown",t)}},[eI,eL]);let e$=e=>{if(!e)return null;let t=e.format("DD"),a=L?e.format("MMM"):e.format("MMM YY");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{children:t})," ",(0,n.jsx)("span",{style:L?{fontSize:15,fontWeight:700,color:"var(--hsr-ink-2)"}:{fontSize:"calc(1em - 8px)",fontWeight:400},children:a})]})},eZ=e=>{if(!e)return"";let t=e.format("dddd");return L?"".concat(t," \xb7 ").concat(e.format("YY")):t},eQ=eU(eE),e0=eU(eY);let e1=e=>{J.current=!0,eT(e),localStorage.setItem(V,JSON.stringify(e)),em(ek.airportCode===e.airportCode)},e2=(0,r.useRef)(0);(0,r.useEffect)(()=>{let e=null==G?void 0:G.nonce,t=null==G?void 0:G.name;if(!e||!t||e2.current===e)return;e2.current=e;let a=!1;return(async()=>{try{let e=await (0,w.wf)(t),n=Array.isArray(e)?e[0]:null;!a&&n&&(er(e=>{let t=new Map(e.map(e=>[e.airportCode,e]));return t.set(n.airportCode,n),Array.from(t.values())}),e1(n))}catch(e){(0,C.N)(e,{event:"caught_error",level:"warning",tags:{kind:"swallowed",module:"flights/popular-destination"}}),console.error("Popular destination lookup failed",e)}})(),()=>{a=!0}},[null==G?void 0:G.nonce]);let e4=new v.YG(eu).add(1,"year");return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"mainSearch flight-search-box flight-search-box--v2 ".concat(P?"open":""),children:[I&&(0,n.jsxs)("div",{className:"d-tab-show justify-between align-start w-100 mt-10",children:[(0,n.jsxs)("div",{className:"modify-flight-search text-16 fw-600 lh-1",children:[(0,n.jsx)(g.gc,{icon:y.MT7})," Modify Your Search"]}),(0,n.jsx)("div",{className:"close-btn",onClick:()=>R(),children:(0,n.jsx)(g.gc,{icon:y.GRI})})]}),(0,n.jsxs)("div",{className:"search-top-bar",children:[(0,n.jsxs)("div",{className:"trip-toggle",children:[(0,n.jsx)("div",{className:"trip-toggle__slider",style:{transform:"translateX(".concat("2"===ef?"100%":"0",")")}}),Object.keys(x.Do).map(e=>(0,n.jsx)("button",{className:"trip-toggle__btn".concat(ef===e?" active":""),onClick:()=>{(0,s.u4)("flight_trip_type_clicked",{trip_type:x.Do[e]}),ev(e),eS("2"===e)},children:x.Do[e]},e))]}),!I&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(E.A,{value:String(eg),className:"cabin-class-dropdown",ariaLabel:"Cabin class",searchable:!1,options:Object.keys(x.NN).map(e=>({value:e,label:x.NN[e]})),onChange:e=>{(0,s.u4)("flight_cabin_class_selected",{cabin_class:x.NN[e]}),ey(Number(e)),eb(!1)}}),ew&&(0,n.jsxs)("span",{className:"text-12 text-light-1 pref-seed-hint",children:["From your travel preferences."," ",(0,n.jsx)("button",{type:"button",className:"text-12 text-blue-1",onClick:()=>{(0,s.u4)("flight_cabin_class_preference_reset"),ey("2"),eb(!1)},children:"Reset"})]})]})]}),(0,n.jsxs)("div",{className:"button-grid items-center",children:[(0,n.jsxs)("div",{className:"location-wrap home-search-card home-search-card--location",children:[(0,n.jsx)(m,{title:"From",locations:el,value:"".concat(ek.city,", ").concat(ek.country),onChange:e=>{J.current=!0,e_(e),localStorage.setItem(q,JSON.stringify(e)),em(eD.airportCode===e.airportCode)},selectedValue:ek,onSearch:ec,heroVariant:L}),(0,n.jsx)("div",{className:"location-wrap-btn",children:(0,n.jsx)("button",{type:"button",className:"icon","aria-label":"Swap departure and destination",onClick:()=>{(0,s.u4)("flight_swap_locations_clicked"),e_(eD),eT(ek),localStorage.setItem(q,JSON.stringify(eD)),localStorage.setItem(V,JSON.stringify(ek)),em(!1),eH(e=>e+1)},children:(0,n.jsx)("span",{className:eB?"hsr-swap-spin":"",style:{display:"inline-flex"},children:(0,n.jsx)(g.gc,{icon:y.tNR})},eB)})}),(0,n.jsx)(m,{title:"To",locations:el,value:"".concat(eD.city,", ").concat(eD.country),onChange:e1,selectedValue:eD,onSearch:ec,heroVariant:L}),ep&&(0,n.jsx)("div",{className:"alert alert-danger source-dest-same-error",children:"From & To airports cannot be the same"})]}),(0,n.jsxs)("div",{className:"home-search-card date-selection-wrap",children:[(0,n.jsx)("div",{className:"searchMenu-date js-form-dd js-calendar",onMouseDown:e=>{var t,a;null!=(t=(a=e.target).closest)&&t.call(a,".rmdp-wrapper")||e.preventDefault()},onClick:e=>{var t,a;null!=(t=(a=e.target).closest)&&t.call(a,".rmdp-wrapper")||($.current=e.currentTarget,(0,s.u4)("flight_depart_date_field_clicked"),setTimeout(()=>{var e,t,a,n;eN?(eJ(!0),eG(!1),null==(t=W.current)||null==(e=t.openCalendar)||e.call(t)):(eG(!0),eJ(!1),null==(n=X.current)||null==(a=n.openCalendar)||a.call(n))},0))},role:"button",tabIndex:0,"aria-label":"Departure ".concat((null==eE||null==(t=eE.format)?void 0:t.call(eE,M))||"date"),"aria-haspopup":"dialog","aria-expanded":eN?eL:eI,onKeyDown:e=>
1{e.target===e.currentTarget&&("Enter"===e.key||" "===e.key)&&(e.preventDefault(),e.currentTarget.click())},style:{cursor:"pointer"},children:(0,n.jsxs)("div",{children:[(0,n.jsx)("h4",{className:"text-15 fw-500 ls-2 lh-16 searchMenu-loc__title",children:"Departure"}),(0,n.jsxs)("div",{className:"custom_dual_datepicker custom-datepicker",children:[(0,n.jsxs)("div",{className:"date-display-block",children:[(0,n.jsx)("div",{className:"custom_input-picker",style:{pointerEvents:"none",cursor:"pointer"},children:e$(eE)}),(0,n.jsx)("div",{className:"searchbox-col-extra-info",children:eZ(eE)})]}),!eN&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(v.Ay,{ref:X,render:()=>(0,n.jsx)("span",{"aria-hidden":"true"}),renderButton:eW,value:eE,onChange:e=>{var t,a;eM(e?new v.YG(e):null),eG(!1),null==(a=X.current)||null==(t=a.closeCalendar)||t.call(a),e&&eA(new v.YG(e).add(7,"days"))},numberOfMonths:eh?1:2,format:M,open:eI,onClose:()=>eG(!1),offsetY:10,calendarPosition:"bottom-start",fixMainPosition:!0,portal:!0,zIndex:999999,minDate:eu,maxDate:e4,mapDays:e=>{let{date:t}=e,a=eo[new Date(t.year,t.month.index,t.day).toDateString()];return{children:(0,n.jsxs)("div",{className:"date-with-fare",children:[(0,n.jsx)("div",{className:"date-day",children:t.day}),a&&(0,n.jsx)("div",{className:"cal-fares",children:Math.round(Number(a))})]})}},onMonthChange:e=>{let t="".concat(e.year,"-").concat(e.month.number);z.current.has(t)||(z.current.add(t),ei(null==ek?void 0:ek.airportCode,null==eD?void 0:eD.airportCode,e.toDate()))},className:"cal-v2".concat(L||I?" cal-hsr":"")})}),eN&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(v.Ay,{ref:W,render:()=>(0,n.jsx)("span",{"aria-hidden":"true"}),renderButton:eW,value:[eE,eY],onChange:e=>{let t=null,a=null;if(Array.isArray(e)?(t=e[0]||null,a=e[1]||null):(t=(null==e?void 0:e.from)||(null==e?void 0:e.start)||null,a=(null==e?void 0:e.to)||(null==e?void 0:e.end)||null),eM(t?new v.YG(t):null),eA(a?new v.YG(a):null),t&&a){var n,r;eJ(!1),null==(r=W.current)||null==(n=r.closeCalendar)||n.call(r)}},numberOfMonths:eh?1:2,range:!0,format:M,open:eL,onClose:()=>eJ(!1),maxDate:e4,offsetY:10,calendarPosition:"bottom-start",fixMainPosition:!0,portal:!0,zIndex:999999,minDate:eu,className:"cal-v2".concat(L||I?" cal-hsr":"")})}),H&&(0,n.jsx)("div",{className:"alert alert-danger date-dest-same-error",children:"Please select both Depart and Return dates"})]})]})}),(0,n.jsx)("div",{className:"searchMenu-date js-form-dd js-calendar",onMouseDown:e=>{var t,a;null!=(t=(a=e.target).closest)&&t.call(a,".rmdp-wrapper")||e.preventDefault()},onClick:e=>{var t,a;$.current=e.currentTarget,(0,s.u4)("flight_return_date_field_clicked"),eN||(0,l.flushSync)(()=>{ev("2"),eS(!0)}),eG(!1),eJ(!0),null==(a=W.current)||null==(t=a.openCalendar)||t.call(a)},role:"button",tabIndex:0,"aria-label":"Return ".concat((null==eY||null==(a=eY.format)?void 0:a.call(eY,M))||"date"),"aria-haspopup":"dialog","aria-expanded":eL,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"===e.key||" "===e.key)&&(e.preventDefault(),e.currentTarget.click())},style:{cursor:"pointer"},children:(0,n.jsxs)("div",{children:[(0,n.jsx)("h4",{className:"text-15 fw-500 ls-2 lh-16 searchMenu-loc__title",children:L?"Return":"Arrival"}),eN&&eY?(0,n.jsx)("div",{className:"custom_dual_datepicker",children:(0,n.jsxs)("div",{className:"date-display-block",children:[(0,n.jsx)("div",{className:"custom_input-picker",style:{pointerEvents:"none",cursor:"pointer"},children:e$(eY)}),(0,n.jsx)("div",{className:"searchbox-col-extra-info",children:eZ(eY)})]})}):(0,n.jsx)("div",{className:"custom_dual_datepicker arrival-placeholder",children:(0,n.jsx)("span",{className:"arrival-placeholder__text",children:L?"Add a return for bigger savings":"Tap to add a return date for bigger discounts"})})]})})]}),(0,n.jsx)("div",{className:"home-search-card guest-selection-wrap",children:(0,n.jsx)(u,{title:"Travellers",onChange:e=>{eO({...e})},searchGuestCount:eF,heroVariant:L})}),(0,n.jsx)("div",{className:"search-btn-card",children:(0,n.jsxs)("button",{type:"button",className:"search-btn-pill",onClick:()=>(()=>{var e,t;if((0,s.u4)("flights_search_clicked",{origin:null==ek?void 0:ek.airportCode,destination:null==eD?void 0:eD.airportCode,trip_type:2===Number(ef)?"round_trip":"one_way"}),eq(!0),U(!1),!eE||eN&&!eY){U(!0),eq(!1);return}let a=e=>"".concat(e.format("YYYY-MM-DD"),"T00:00:00Z"),n={adultCount:eF.adults,childCount:eF.children,infantCount:eF.infants,journeyType:Number(ef),flightCabinClass:Number(eg),directFlight:!0,oneStopFlight:!0,originLocation:null==ek?void 0:ek.airportCode,destinationLocation:null==eD?void 0:eD.airportCode,preferredDepartureTime:a(eE),...eN&&eY?{preferredArrivalTime:a(eY)}:{}};if(n.originLocation===n.destinationLocation){em(!0),eq(!1);return}(0,D.Y)(T.D.FLIGHT_SEARCH,{origin:null==ek?void 0:ek.airportCode,destination:null==eD?void 0:eD.airportCode,trip_type:2===Number(ef)?"round_trip":"one_way",adults:eF.adults,children:eF.children,infants:eF.infants,cabin_class:Number(eg),departure_date:null==eE||null==(e=eE.format)?void 0:e.call(eE,"YYYY-MM-DD"),return_date:null==eY||null==(t=eY.format)?void 0:t.call(eY,"YYYY-MM-DD")}),O(n),eq(!1)})(),disabled:eK,"aria-busy":eK,children:[eK?(0,n.jsx)(f.qh,{}):(0,n.jsx)(g.gc,{icon:y.$UM}),eK?"Searching...":"Search"]})})]})]})})}},85788:(e,t,a)=>{"use strict";a.d(t,{CL:()=>p,E9:()=>c,FD:()=>y,Hl:()=>h,Vl:()=>x,Xm:()=>u,aN:()=>f,iE:()=>d,pe:()=>v,sy:()=>m,tw:()=>s,wf:()=>g,zv:()=>i});var n=a(5186),r=a(98009),l=a(61168);let o=n.A.apiBaseUrl;async function s(e){let t="".concat(o,"/flight/farequote"),a=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...(0,l.m)()},body:JSON.stringify(e),cache:"no-store"});if(!a.ok){let e=await a.json().catch(()=>({})),t=Error((null==e?void 0:e.message)||"Fare quote failed");throw t.status=a.status,t}let n=await a.json();return null!=n?n:null}async function i(e){let t="".concat(o,"/flight/ssr"),a=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...(0,l.m)()},body:JSON.stringify(e),cache:"no-store"});if(!a.ok){let e=await a.json();throw Error(null==e?void 0:e.message)}let n=await a.json();return null!=n?n:null}async function c(){let e="".concat(o,"/web/booking-advisory/flight"),t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json",...(0,l.m)()}
1,cache:"no-store"});if(!t.ok){let e=await t.json();throw Error((null==e?void 0:e.message)||"Failed to load guidelines")}let a=await t.json();return null!=a?a:null}async function d(){var e;let t="".concat(o,"/web/coupon-codes/flight"),a=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",...(0,l.m)()},cache:"no-store"});if(!a.ok){let e=await a.json();throw Error((null==e?void 0:e.message)||"Failed to load coupon codes")}let n=await a.json();return null!=(e=null==n?void 0:n.result)?e:null}async function u(e){if(!e)throw Error("couponCode is required");let t=encodeURIComponent(String(e).trim()),a="".concat(o.replace(/\/$/,""),"/web/coupon-codes/flight/verify/").concat(t),n=await fetch(a,{method:"GET",headers:{"Content-Type":"application/json",...(0,l.m)()},cache:"no-store"}),r=null;try{r=await n.json()}catch(e){}if(!n.ok)throw Error((null==r?void 0:r.message)||"Failed to verify coupon");if(r&&!1===r.isSuccess)throw Error(r.message||"Coupon is not valid");return null!=r?r:null}async function h(e){let t="".concat(o,"/flight/book/pre-book"),a=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...(0,l.m)()},body:JSON.stringify(e)}),n=await a.json();if(!a.ok||(null==n?void 0:n.isSuccess)===!1)throw Error((null==n?void 0:n.message)||"Prebook failed");return n}async function p(e){let t="".concat(o,"/flight/book/flight-book"),a=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...(0,l.m)()},body:JSON.stringify(e)}),n=await a.json().catch(()=>null);if(!a.ok||(null==n?void 0:n.isSuccess)===!1){var r;let e=Error((null==n?void 0:n.message)||"Payment confirmation failed");throw e.responseCode=null!=(r=null==n?void 0:n.responseCode)?r:a.status,e.body=n,e}return n}async function m(e,t){let{signal:a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n="".concat(o,"/flight/book/").concat(e,"/").concat(t),s=await fetch(n,{method:"GET",headers:{"Content-Type":"application/json",...(0,l.m)(),...(0,r.r)()},cache:"no-store",signal:a}),i=await s.json();if(!s.ok||(null==i?void 0:i.isSuccess)===!1)throw Error((null==i?void 0:i.message)||"Failed to fetch booking details");return i.result}async function f(e){if(!e)throw Error("bookingId is required");let t="".concat(o,"/flight/book/payment-request?bookingId=").concat(e),a=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...(0,l.m)()},cache:"no-store"}),n=await a.json();if(!a.ok||(null==n?void 0:n.isSuccess)===!1)throw Error((null==n?void 0:n.message)||"Payment request failed");return n.result}async function v(e){let t="".concat(o,"/flight/ssr/special-service"),a=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...(0,l.m)()},body:JSON.stringify(e),cache:"no-store"});if(!a.ok){let e=await a.json();throw Error((null==e?void 0:e.message)||"Failed to fetch special services")}let n=await a.json();return null!=n?n:null}async function g(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a="".concat(o,"/flight/master/airport/codes"),n=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",accept:"text/plain",...(0,l.m)()},body:JSON.stringify({sParam:t}),cache:"no-store"}),r=await n.json();if(!n.ok||(null==r?void 0:r.isSuccess)===!1)throw Error((null==r?void 0:r.message)||"Failed to load airport codes");return null!=(e=null==r?void 0:r.result)?e:[]}async function y(e){let t="".concat(o,"/insurance/cfar/search"),a=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...(0,l.m)()},body:JSON.stringify(e),cache:"no-store"});if(!a.ok){let e=await a.json();throw Error((null==e?void 0:e.message)||"Failed to fetch CFAR")}return await a.json()}async function x(e){let t="".concat(o,"/insurance/travel/flight/search"),a=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...(0,l.m)()},body:JSON.stringify(e),cache:"no-store"}),n=await a.json();if(!a.ok||(null==n?void 0:n.isSuccess)===!1)throw Error((null==n?void 0:n.message)||"Failed to fetch travel insurance");return n}},92649:(e,t,a)=>{"use strict";a.d(t,{z:()=>s});var n=a(12115),r=a(85788),l=a(73880);let o=new Map;function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=(e||"").trim(),[a,s]=(0,n.use
1State)(()=>{var e,a;return null!=(a=null==(e=o.get(t))?void 0:e.data)?a:void 0}),[i,c]=(0,n.useState)(!1),d=(0,n.useRef)(null);return(0,n.useEffect)(()=>{let e=o.get(t);if(e&&Date.now()-e.ts<18e5)return void s(e.data);d.current&&d.current.abort();let a=new AbortController;return d.current=a,c(!0),(0,r.wf)(t).then(e=>{a.signal.aborted||(o.set(t,{data:e,ts:Date.now()}),s(e))}).catch(e=>{(0,l.N)(e,{event:"caught_error",level:"warning",tags:{kind:"swallowed",module:"flights/airport-codes"}}),a.signal.aborted||s([])}).finally(()=>{a.signal.aborted||c(!1)}),()=>a.abort()},[t]),{data:a,isLoading:i}}}}]);
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.