1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7010],{48320:function(e,t,n){n.d(t,{A:function(){return en},B:function(){return Lo},D:function(){return un},E:function(){return Jt},H:function(){return Ge},I:function(){return qe},M:function(){return ia},O:function(){return To},S:function(){return et},a:function(){return hn},b:function(){return Be},c:function(){return dn},d:function(){return Go},e:function(){return zo},f:function(){return Vo},g:function(){return sn},h:function(){return Xt},i:function(){return at},j:function(){return ot},k:function(){return gt},l:function(){return jo},m:function(){return Wt},n:function(){return zt},o:function(){return Oe},p:function(){return Yo},q:function(){return Ne},r:function(){return En},s:function(){return sa},u:function(){return mn},w:function(){return ln}});var a=n(1413),o=n(2043),i=n(63963),l=n(45987),r=n(28338),s=n(67294),u=n(16018),d=n(65964),c=n(42982),v=n(70885),f=n(32768),p=n.n(f),m=n(27484),g=n.n(m),h=n(15671),y=n(43144),b=n(53640),D=n(60136),Z=n(65053),C=n(75260),x=n(95430),I=n(55090),k=n(92637),E=n(47400),S=n(4942),T=(n(1966),n(14029)),O=n(88767),w=(n(20938),n(33394)),A=n(7438),R=n(48145),M=n(49907),_=n(32839),B=n(27247),N=n(58398),P=n(37948),F=n(98045),L=n(67415),V=n(32954),z=n(54354),H=n(73632),G=n(33036),K=n(92175),j=n(45244),U=n(84576),W=n(71111),Y=n(18105),q=n(76655),Q=n(35682),X=n(24136),J=n(86855),$=n(77903),ee=n(48237),te=n(78883),ne=n(77366),ae=n(83919),oe=n(13095),ie=n(51496),le=n.n(ie),re=n(23363),se=n(13916),ue=n(59410),de=n(12902),ce=n(87520),ve=n(56350),fe=n(40392),pe=n(94145),me=n(29701),ge=n(66267),he=n(74221),ye=n(5804),be=n(32866),De=n(37762),Ze=n(52230),Ce=n(14986),xe=s.createContext(!1);function Ie(e){var t=e.children,n=e.isIFrame,a=void 0!==n&&n;return s.createElement(xe.Provider,{value:a},t)}var ke=s.createContext({});function Ee(e){var t=e.translate,n=e.direction,a=e.localizationData,o=e.theme,i=e.moment,l=e.tenant,r=e.componentName,u=e.children,d=s.useMemo((function(){return{translate:t,direction:n.toLowerCase(),localizationData:a,theme:o,moment:i,tenant:l,componentName:r}}),[t,n,a,o,i,l,r]);return s.createElement(ke.Provider,{value:d},u)}var Se=function(e){return function(t,n,a){var o=e(t,n);return void 0===a||null===a||"object"!==typeof a?o:function(e,t){var n=new RegExp(Object.keys(t).map((function(e){return"\\{".concat(e,"\\}")})).join("|"),"g");return e.replace(n,(function(e){return t[e.substr(1,e.length-2)]}))}(o,a)}},Te=function(){return function(e){var t=Se(e);return function(e){var n=e.count,o=e.key,i=e.variables,l=void 0===i?{}:i,r=e.defaultValue,s=(0,a.Z)({count:n},l),u="".concat(o,"_").concat(n),d=t(u,void 0,s);return d!==u?d:t(o,r,s)}}((0,s.useContext)(ke).translate)},Oe=function(){var e=(0,s.useContext)(ke).translate;return Se(e)},we=function(){return(0,s.useContext)(ke).direction},Ae=s.createContext({config:{},icons:[]});function Re(){return(0,s.useContext)(Ae)}function Me(e){var t=e.paths.map((function(e,t){return s.createElement("path",{key:t,d:e})}));return s.createElement("symbol",{xmlns:"http://www.w3.org/2000/svg",id:"".concat(e.id).concat(e.icon)},t)}var _e=function(e){var t=e.children,n=e.iconProvider,a=n.config,o=n.icons,i=s.useMemo((function(){return{icons:o,config:a}}),[a,o]);return a&&a.enableSprite?s.createElement(Ae.Provider,{value:i},function(e,t){var n=t.id;return s.createElement("svg",{width:"0",height:"0",className:"hidden",style:{position:"absolute"}},e.map((function(e){return s.createElement(Me,{paths:e.paths,icon:e.icon,id:n,key:e.icon})})))}(o,a),t):s.createElement(Ae.Provider,{value:i},t)};function Be(){var e=(0,s.useContext)(xe);if((0,r.a)())return Boolean(e);var t=("undefined"!==typeof window.visualViewport&&null!==window.visualViewport?window.visualViewport.width:window.screen.availWidth)<=700;return e||t}function Ne(e){(0,s.useEffect)((function(){return e&&function(){var e=document.createEvent("Event");e.initEvent("container-enter-full-screen",!0,!0),window.dispatchEvent(e)}(),function(){e&&function(){var e=document.createEvent("Event");e.initEvent("container-exit-full-screen",!0,!0),window.dispatchEvent(e)}()}}),[e])}function Pe(e,t){return Array.isArray(t)?t.map((function(t){return Fe(null===e||void 0===e?void 0:e.space,t)})):t&&!Array.isArray(t)?void 0===Fe(null===e||void 0===e?void 0:e.space,t)?t:Fe(null===e||void 0===e?void 0:e.space,t):t}function Fe(e,t){return e?e[t]:"".concat(t,"px")}var Le=["gap","colGap","rowGap","columns"],Ve=s.forwardRef((function(e,t){var n,o,i,r,u=e.gap,d=void 0===u?0:u,c=e.colGap,v=e.rowGap,f=e.columns,p=void 0===f?[[1]]:f,m=(0,l.Z)(e,Le),g=(0,k.B7)().theme,h=s.Children.count(m.children),y=null!==c&&void 0!==c?c:d,b=null!==v&&void 0!==v?v:d,D={};n=p.map((function(e){return Math.ceil(h/e.length)})),o=p.map((function(e){return e.map((function(e){return"".concat(e,"fr")})).join(" ")})),i=p.map((function(e){return e.map((function(e){return"".concat(e,"fr")})).join(" ".concat(Pe(g,y)," "))})),r=n.map((function(e){if(m.rows){var t="";return m.rows.forEach((function(e,n){t+=" ".concat(Pe(g,e)," ")})),t}return Array(e).fill("auto").join(" ".concat(Pe(g,b)," "))}));for(var Z=m.rows?r:void 0,C=function(e){D["> div:nth-of-type(".concat(e,")")]={msGridRow:p.map((function(t){return function(e,t){return 2*Math.ceil(e/t)-1}(e,t.length)})),msGridColumn:p.map((function(t){return function(e,t){return 2*(e%t===0?t:e%t)-1}(e,t.length)}))}},x=1;x<=h;x++)C(x);return s.createElement(I.xu,Object.assign({ref:t}
1,m,{__themeKey:"grids",__css:(0,a.Z)({"@supports (display: grid)":{display:"grid",gridColumnGap:y,gridRowGap:b,gridTemplateColumns:o,gridTemplateRows:Z},display:"-ms-grid",msGridColumns:i,msGridRows:r},D)}))})),ze=["as"],He=s.createContext(2);var Ge=s.forwardRef((function(e,t){var n=e.as,a=(0,l.Z)(e,ze),o=s.useContext(He),i=null!==n&&void 0!==n?n:"h".concat(o);return s.createElement(I.X6,Object.assign({},a,{ref:t,as:i}))})),Ke=["icon","animation","size","viewBox","paths","rtlFlip","fill","sx"];function je(e){var t=e.icon,n=void 0===t?"broken-heart":t,o=e.animation,i=e.size,r=void 0===i?16:i,u=e.viewBox,d=void 0===u?"0 0 1024 1024":u,c=e.paths,f=void 0===c?[]:c,p=e.rtlFlip,m=void 0===p||p,g=e.fill,h=void 0===g?"currentcolor":g,y=e.sx,b=(0,l.Z)(e,Ke),D=we(),Z=(0,s.useState)(!1),C=(0,v.Z)(Z,2),x=C[0],I=C[1],S=d,T=n,O=!1,w=f,A=Re(),R=A.config,M=A.icons;if(M&&(null===M||void 0===M?void 0:M.length)>0){R&&R.enableSprite&&(O=!0),R&&R.id&&(T="".concat(R.id).concat(n));var _=M.find((function(e){return e.icon===n}));_?(R.enableSprite||(w=_.paths),_.viewBox&&(S=_.viewBox&&_.viewBox)):console.warn("Please add ".concat(n," to the iconsProvider. Searching and loading embedded icon."))}var B;return(0,k.tZ)("svg",Object.assign({onClick:function(){return"infinite"!==o&&void I(!x)},className:(0,E.Z)("fr-icon fr-icon-".concat(n),"infinite"===o&&"fr-icon-animation-".concat(o),x&&"fr-icon-animation-".concat(o,"-active")),width:r,height:r,"data-fr-icon":n,viewBox:S,sx:(0,a.Z)({fill:h,transform:m&&"rtl"===D?"scaleX(-1)":void 0},y)},b),O&&function(e){return(0,k.tZ)("use",{xlinkHref:"#".concat(e)})}(T),!O&&((B=w)?B.map((function(e,t){return"string"===typeof e?(0,k.tZ)("path",{key:t,d:e}):(0,k.tZ)("path",Object.assign({key:t},e))})):null))}var Ue={start:"flex-start",end:"flex-end",left:"flex-start",right:"flex-end",top:"flex-start",bottom:"flex-end",center:"center","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"},We={start:"flex-start",end:"flex-end",top:"flex-start",bottom:"flex-end",left:"flex-start",right:"flex-end",center:"center",baseline:"baseline",stretch:"stretch"},Ye=["gap","align","alignY","divider","wrap","reverse","childrenBottomMargin","UNSTABLE_nativeGap"],qe=s.forwardRef((function(e,t){var n=e.gap,o=e.align,i=e.alignY,r=e.divider,u=e.wrap,d=e.reverse,c=e.childrenBottomMargin,v=e.UNSTABLE_nativeGap,f=(0,l.Z)(e,Ye);return s.createElement(I.xu,Object.assign({ref:t},f,{__css:(0,a.Z)((0,a.Z)((0,a.Z)({display:"flex",justifyContent:o?Ue[o]:void 0,alignItems:i?We[i]:void 0,flexDirection:d?"row-reverse":"row",flexWrap:u?"wrap":"nowrap",gap:v},!c&&{rowGap:n}),c&&{"> *:last-child, > *:not(:last-child)":{mb:n}}),{},{"> *:not(:last-child)":(0,a.Z)((0,S.Z)({},d?"marginLeft":"marginRight",n),r&&{":after":(0,S.Z)({content:'"'.concat(r,'"')},d?"marginRight":"marginLeft",n)})})}))})),Qe=["disabled"],Xe=s.forwardRef((function(e,t){var n=e.disabled,a=(0,l.Z)(e,Qe);return n?s.createElement(I.rU,Object.assign({as:"div"},a,{ref:t})):s.createElement(I.rU,Object.assign({target:"_top",rel:"noreferrer noopener"},a,{ref:t}))})),Je=function(e){return s.createElement(I.xu,Object.assign({as:"hr",variant:"default"},e,{__themeKey:"separators"}))},$e=["gap","align","alignY"],et=s.forwardRef((function(e,t){var n=e.gap,a=e.align,o=e.alignY,i=(0,l.Z)(e,$e);return s.createElement(I.xu,Object.assign({ref:t},i,{__css:{display:"flex",flexDirection:"column",alignItems:a?We[a]:void 0,justifyContent:o?Ue[o]:void 0,"> *:not(:last-child)":{marginBottom:n}}}))})),tt=["gap","colGap","rowGap","columns"],nt=s.forwardRef((function(e,t){var n,o,i,r,u=e.gap,d=void 0===u?0:u,c=e.colGap,v=e.rowGap,f=e.columns,p=void 0===f?1:f,m=(0,l.Z)(e,tt),g=(0,k.B7)().theme,h=s.Children.count(m.children),y=null!==c&&void 0!==c?c:d,b=null!==v&&void 0!==v?v:d,D=m.selectChildrenWithoutType?"*:nth-child":"div:nth-of-type",Z=function(e){return Math.ceil(h/e)},C=function(e,t){return 2*Math.ceil(e/t)-1},x=function(e,t){return 2*(e%t===0?t:e%t)-1},E=function(e){return"repeat(".concat(e,", 1fr)")},S=function(e){return Array(e).fill("1fr").join(" ".concat(Pe(g,y)," "))},T=function(e){return Array(e).fill("auto").join(" ".concat(Pe(g,b)," "))},O={};if("number"===typeof p){n=Z(p),o=E(p),i=S(p),r=T(n);for(var w=1;w<=h;w++)O["> ".concat(D,"(").concat(w,")")]={msGridRow:C(w,p),msGridColumn:x(w,p)}}else{n=p.map(Z),o=p.map(E),i=p.map(S),r=n.map(T);for(var A=function(e){O["> ".concat(D,"(").concat(e,")")]={msGridRow:p.map((function(t){return C(e,t)})),msGridColumn:p.map((function(t){return x(e,t)}))}},R=1;R<=h;R++)A(R)}return s.createElement(I.xu,Object.assign({ref:t}
1,m,{__themeKey:"grids",__css:(0,a.Z)({"@supports (display: grid)":{display:"grid",gridColumnGap:y,gridRowGap:b,gridTemplateColumns:o},display:"-ms-grid",msGridColumns:i,msGridRows:r},O)}))})),at=function(e,t,n,l,r,s){var u=void 0===e?[]:e.sources;return new Promise((function(e,d){if(!l){var c="INTEGRATION__AIRLINES: **integrationSettings** not especified.";o.error(c),d(c)}var v=l.v3AvaliableAirlinesByRoute,f=v.cache,p=void 0!==f&&f,m=v.cacheDuration,g=void 0===m?i.N:m;if(!v||!v.method||!v.endPoint||!v.headers){var h="INTEGRATION__AIRLINES: **integrationSettings.airlinesApiSettings** configuration issues.";o.error(h),d(h)}t&&""!==t&&n&&""!==n&&(0,i.a)({method:v.method,url:"".concat(v.endPoint),headers:(0,a.Z)({},v.headers),data:{routes:[t+""+n],sources:u}},{resource:"INTEGRATION__AIRLINES",meta:r,integrationSettings:l,pageContext:s,cache:p,cacheDuration:g}).then((function(t){o.info("INTEGRATION__AIRLINES: Successful request",t.data),e(t.data)})).catch((function(e){d(e)}))}))},ot=function(e,t,n,l,r,s){return new Promise((function(u,d){if(!l){var c="INTEGRATION__BLACKOUT_DATES: **integrationSettings** not especified.";o.error(c),d(c)}var v=l.v1BlackoutDates,f=v.cache,p=void 0!==f&&f,m=v.cacheDuration,g=void 0===m?i.N:m;if(!v||!v.method||!v.endPoint){var h="INTEGRATION__BLACKOUT_DATES: **integrationSettings.blackoutDatesApiSettings** configuration issues.";o.error(h),d(h)}e&&""!==e&&t&&""!==t&&void 0!==n&&(0,i.a)({method:v.method,url:"".concat(v.endPoint),headers:(0,a.Z)({},null===v||void 0===v?void 0:v.headers),data:{origin:e,destination:t,roundtrip:n}},{resource:"INTEGRATION__BLACKOUT_DATES",meta:r,integrationSettings:l,pageContext:s,cache:p,cacheDuration:g}).then((function(e){o.info("INTEGRATION__BLACKOUT_DATES: Successful request",e.data),u(e.data)})).catch((function(e){u({})}))}))},it=function(e){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=(0,a.Z)({},e);return t&&t.forEach((function(e){e in o&&(o[e]=null,delete o[e])})),n&&n.forEach((function(e){!(e in o)||null!==o[e]&&0!==o[e].length||(o[e]=null,delete o[e])})),o}(e,["airlineIataCode","labelStructure","filterOriginAirportsByMarket","filterByMarket"])},lt=["labelStructure"];function rt(e){return e.name.replace(/ *\([^)]*\) */g,"")}var st="ALL",ut="ORIGIN",dt="DESTINATION",ct="NONE",vt="ORIGIN",ft="DESTINATION",pt=function(e,t){for(var n=[],a=function(){var a=e[i];if(a.iataCode){var l;if(!a.name)a.name=(null===(l=a.city)||void 0===l?void 0:l.name)||"NO_NAME_FROM_API";if(a.children&&Array.isArray(a.children))a.children.forEach((function(e){var o=mt(e,t,a);n.push(o)}));else{var r=mt(a,t);n.push(r)}}else o.error("INTEGRATION__AIRPORT: API Response Airport Issue",a)},i=0;i<e.length;i+=1)a();return n},mt=function(e,t){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{iataCode:void 0,name:void 0};n=t&&t?(0,r.s)(t,e):rt(e);var i=(0,a.Z)({label:n,value:e.iataCode,search:n,category:!0},e);return o.name&&o.iataCode?(delete i.category,n=t?(0,r.s)(t,e):rt(e),Object.assign(i,{label:n}),Object.assign(i,{search:n}),Object.assign(i,{parent:"".concat(e.name," ").concat(e.iataCode)}),e.extraInfo&&(i.zoneId||i.locationId)&&Object.assign(i,e.extraInfo)):e.extraInfo&&Object.assign(i,e.extraInfo),e.geo&&Object.assign(i,{geo:e.geo}),i},gt=function(e,t,n,r){var s=e.labelStructure,u=(0,l.Z)(e,lt);return new Promise((function(e,l){if(!t){var d="INTEGRATION__AIRPORT: **integrationSettings** not specified.";o.error(d),l(d)}var c=t.v2AirportsSearch,v=c.cache,f=void 0!==v&&v,p=c.cacheDuration,m=void 0===p?i.N:p,g=(0,a.Z)((0,a.Z)({},u),{},{market:""===u.market||void 0===u.market?null:u.market});if(!c||!c.method||!c.endPoint){var h="INTEGRATION__AIRPORT: **integrationSettings.airportApiSettings** configuration issues.";o.error(h),l(h)}null!==g.filterFields&&void 0!==g.filterFields||g.filterByMarket===ct?g=function(e){var t,n,o,i,l,r=(0,a.Z)({},e);if(null!==(null===r||void 0===r?void 0:r.filterOriginAirportsByMarket)&&void 0!==(null===r||void 0===r?void 0:r.filterOriginAirportsByMarket)&&!0===(null===r||void 0===r?void 0:r.filterOriginAirportsByMarket))return(null===r||void 0===r||null===(l=r.routeOption)||void 0===l?void 0:l.airportType)!==vt?(null!==r&&void 0!==r&&r.market&&delete r.market,null!==r&&void 0!==r&&r.filterFields&&delete r.filterFields):null!==r&&void 0!==r&&r.market&&delete r.market,r;if(null!==r&&void 0!==r&&r.filterByMarket){var s;switch(null===r||void 0===r||null===(s=r.filterByMarket)||void 0===s?void 0:s.toUpperCase()){case ct:null!==r&&void 0!==r&&r.market&&delete r.market,null!==r&&void 0!==r&&r.filterFields&&delete r.filterFields;break;case st:(null===r||void 0===r||null===(t=r.routeOption)||void 0===t?void 0:t.airportType)===vt?null!==r&&void 0!==r&&r.market&&(r.originMarkets=r.market,delete r.market):(null===r||void 0===r||null===(n=r.routeOption)||void 0===n?void 0:n.airportType)===ft?null!==r&&void 0!==r&&r.market&&(r.destinationMarkets=r.market,delete r.market):null!==r&&void 0!==r&&r.filterFields&&delete r.filterFields;break;case ut:(null===r||void 0===r||null===(o=r.routeOption)||void 0===o?void 0:o.airportType)!==vt?(null!==r&&void 0!==r&&r.market&&delete r.market,null!==r&&void 0!==r&&r.filterFields&&delete r.filterFields):null!==r&&void 0!==r&&r.market&&(r.originMarkets=r.market,delete r.market);break;case dt:(null===r||void 0===r||null===(i=r.routeOption)||void 0===i?void 0:i.airportType)!==ft?(null!==r&&void 0!==r&&r.market&&delete r.market,null!==r&&void 0!==r&&r.filterFields&&delete r.filterFields):null!==r&&void 0!==r&&r.market&&(r.destinationMarkets=r.market,delete r.market)}return delete r.filterByMarket,r}return r}(g):(g.filterByMarket&&delete g.filterByMarket,null!==g.filterFields&&void 0!==g.filterFields||delete g.filterFields),(0,i.a)({method:c.method,url:"".concat(c.endPoint),headers:(0,a.Z)({},c.headers),data:it(g)},{resource:"INTEGRATION__AIRPORT",meta:n,integrationSettings:t,pageContext:r,cache:f,cacheDuration:m}).then((function(t){var n=function(e){var t={isValid:!0,message:""};if(!e||!Array.isArray(e))return t.isValid=!1,{isValid:!1,data:e,message:"INTEGRATION__AIRPORT: airports must be an Array"};if(e.length>0){var n=e[0];if(!n.name||!n.iataCode)return{isValid:!1,data:n,message:"INTEGRATION__AIRPORT: Airport SCHEMA is invali
1d, please check Airports API documentation."}}return t}(t.data);if(n.isValid){o.info("INTEGRATION__AIRPORT: Successful request",t.data);var a=pt(t.data,s);e(a)}else{o.info("INTEGRATION__AIRPORT: Missing Data",n.data);for(var i=[],l=0;l<t.data.length;l++){var r=t.data[l];r.name&&r.iataCode&&i.push(r)}var u=pt(i,s);e(u)}})).catch((function(e){l(e)}))}))},ht="n/a";function yt(e){return"boolean"===typeof e||"number"===typeof e?e:Array.isArray(e)?0===e.length?ht:1===e.length?e[0]:"multiple-".concat(e.join(",")):(0,r.k)(e)||""===e?ht:e}function bt(e){var t=yt(e);return t===ht||"ALL"===t?"":t}function Dt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=e;if("number"===typeof e)n=g()().add(e,"day");else{if(!n)return ht;("object"!==typeof e||e instanceof Date||!n.format)&&(n=g()(e))}return void 0!==t?n.format(t):n.format("YYYY-MM-DD")}function Zt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!e)return ht;var n=new Date;if("Noon"===e)n.setHours(12),n.setMinutes(0),n.setSeconds(0);else{var a=e.split(" "),o=(0,v.Z)(a,2),i=o[0],l=o[1],r=i.split(":"),s=(0,v.Z)(r,2),u=s[0],d=s[1];n.setHours("pm"===l.toLowerCase()?+u+12:u),n.setMinutes(d),n.setSeconds(0)}return void 0!==t?g()(n).format(t):g()(n).format("HH:mm:ss")}var Ct={},xt=s.createContext({});function It(){return s.useContext(xt)}function kt(e){var t=e.value,n=e.children;return s.createElement(xt.Provider,{value:t},n)}function Et(e,t){!function(e,t){"undefined"!==typeof window&&window.FR&&window.FR.tracking&&"trace"===window.FR.tracking.mode&&(console.info(e),console.info(t))}(e,(0,a.Z)({},t));var n=function(){var e,t,n;return null===(e=window)||void 0===e||null===(t=e.EM)||void 0===t||null===(n=t.utils)||void 0===n?void 0:n.PubSub}();null===n||void 0===n||n.publish(e,(0,a.Z)({},t))}function St(e){var t=e.url,n=e.params,a=e.formData,o=e.method;if(!(0,r.a)())if(o&&"post"===o.toLocaleLowerCase()){var i=document.createElement("form");i.setAttribute("method","POST"),i.setAttribute("target","_top"),i.setAttribute("action",t);var l=n||a;Object.keys(l).forEach((function(e){var t=document.createElement("input");t.setAttribute("type","hidden"),t.setAttribute("name",e),t.setAttribute("value",l[e]),i.appendChild(t)})),document.body.appendChild(i),i.submit()}else window.open(t,"_top")}var Tt=["passengers"],Ot=(0,r.m)();function wt(e,t,n,o,i){0!==i.length?function(e,t){for(var n=0;n<t.length;n++)if(t[n].toUpperCase()===e)return!0;return!1}(e,i)&&Et(t,(0,a.Z)((0,a.Z)({},n),o)):Et(t,(0,a.Z)((0,a.Z)({},n),o))}function At(e,t){if((0,r.a)())return{};var n={};return Object.keys(t).forEach((function(a){e.includes(a)&&""!==t[a]&&("utm_campaign"===a?n.wl_promo=t[a]:n[a]=t[a])})),n}var Rt={adultCount:"passenger1",youngAdultCount:"passenger2",childCount:"passenger3",infantInLapCount:"passenger4",infantInSeatCount:"passenger5"};function Mt(e,t){var n,o,i,l,r,s,u,d,c,f,p,m,g,h,y,b,D,Z,C,x,I,k,E,S,T,O=e.dates;void 0!==e.passengers?S=e.passengers:S=void 0!==e.passengerInfo?{passenger1:null===(T=e.passengerInfo)||void 0===T?void 0:T.count[0]}:{passenger1:1};var w,A=(0,a.Z)({},e);if(e.type.includes("hotel")){var R,M,_=!0===(null===(R=A.businessRules)||void 0===R||null===(M=R.rooms)||void 0===M?void 0:M.separateInfantsFromChildren);if(e.rooms){var B=0,N=0,P=0,F=0,L=0;e.rooms.forEach((function(e){var t,n,a,o,i=e.types.findIndex((function(e){return"Adult"===e})),l=e.types.findIndex((function(e){return"Youths"===e})),r=e.types.findIndex((function(e){return"Children"===e})),s=e.types.findIndex((function(e){return"Infants"===e}));(B+=e.count[i],N+=void 0!==e.count[l]?e.count[l]:0,_)?[r,s].filter((function(e){return-1!==e})).map((function(t){var n,a;return null!==(n=null===(a=e.ages)||void 0===a?void 0:a[t])&&void 0!==n?n:[]})).forEach((function(e){e.forEach((function(e){e<1?F+=1:1===e?L+=1:P+=1}))})):(P+=void 0!==e.count[r]?e.count[r]:0,F+=null!==(t=null===(n=e.ages[s])||void 0===n?void 0:n.filter((function(e){return e<1})).length)&&void 0!==t?t:0,L+=null!==(a=null===(o=e.ages[s])||void 0===o?void 0:o.filter((function(e){return e>=1})).length)&&void 0!==a?a:0)})),w={adultCount:B,youngAdultCount:N,childCount:P,infantInSeatCount:L,infantInLapCount:F,passengerCount:B+N+P+F+L}}if(e.rooms&&A.businessRules&&A.businessRules.rooms&&A.businessRules.rooms.options&&0!==A.businessRules.rooms.options.length&&A.businessRules.rooms.options[0].type){var V=["Adult","Children","Youths","Infants"],z={passenger1:0,passenger2:0,passenger3:0,passenger4:0};-1!==A.businessRules.rooms.options.findIndex((function(e){return e.showDetailedAgeOptions}
1))&&(z=(0,a.Z)((0,a.Z)({},z),{},{passenger5:0})),e.rooms.forEach((function(t,n){for(var a=0;a<V.length;a++)for(var o=V[a],i=0;i<A.businessRules.rooms.options.length;i++){var l=A.businessRules.rooms.options[i];if(l.showDetailedAgeOptions){if(o===l.type&&e.rooms)for(var r=0;r<e.rooms[n].ages[i].length;r++){var s=e.rooms[n].ages[i][r];0===s?z.passenger4=z.passenger4+1:1===s?z.passenger5=z.passenger5+1:z.passenger2=z.passenger2+1}}else o===l.type&&e.rooms&&(z["passenger".concat(a+1)]=z["passenger".concat(a+1)]+e.rooms[n].count[i])}})),S=z}else S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.fromEntries(Object.entries(e).filter((function(e){var t=(0,v.Z)(e,1)[0];return Rt[t]})).map((function(e){var t=(0,v.Z)(e,2),n=t[0],a=t[1];return[Rt[n],a]})))}(w)}else{if(e.passengers&&A.businessRules&&A.businessRules.travelers&&A.businessRules.travelers.options&&0!==A.businessRules.travelers.options.length&&A.businessRules.travelers.options[0].type)if(-1!==A.businessRules.travelers.options.findIndex((function(e){return e.showDetailedAgeOptions}))){for(var H={},G=A.businessRules.travelers.options.filter((function(e){return"Children"===e.type})).pop(),K=0;K<A.businessRules.travelers.options.length;K++){var j=A.businessRules.travelers.options[K];if(j.showDetailedAgeOptions){var U=(0,a.Z)({},e.rooms);if(e.rooms&&e.rooms&&0!==e.rooms.length&&e.rooms[0].ages&&0!==e.rooms[0].ages.length)for(var W=0;W<U[0].ages[K].length;W++){var Y=U[0].ages[K][W];if(Array.isArray(j.param)){var q=j.param[0].split("_lap").shift(),Q=j.param[1].split("_seat").shift();0===Y?H["".concat(q)]=H["".concat(q)]?H["".concat(q)]+1:1:1===Y?H["".concat(Q)]=H["".concat(Q)]?H["".concat(Q)]+1:1:G&&G.param&&(H["".concat(G)]=H["".concat(G)]?H["".concat(G)]+1:1)}}}else H["".concat(j.param)]=e.passengers[j.name]}S=H}else if(e.passengers){var X={};A.businessRules.travelers.options.forEach((function(t){e.passengers&&(X["".concat(t.param)]=e.passengers[t.name])})),S=X}}return{currencyCode:null===t||void 0===t?void 0:t.currencyCode,departureDate:null!==O&&void 0!==O&&O.start?Dt(O.start):Dt(t.departureDateStart),destinationAirportIataCode:yt(null===(n=e.destination)||void 0===n?void 0:n.value),fareClass:yt(e.travelClass),flexibleDates:void 0===(null===O||void 0===O?void 0:O.isFlexibleDates)?"n/a":null===O||void 0===O?void 0:O.isFlexibleDates,journeyType:yt(e.flightType),originAirportIataCode:yt(null===(o=e.origin)||void 0===o?void 0:o.value),promoCode:yt(null!==(i=e.promoCode)&&void 0!==i?i:t.promoCode),returnDate:Dt(null===O||void 0===O?void 0:O.end),siteEdition:null===t||void 0===t?void 0:t.siteEdition,passengerCount:null!==(l=null===(r=S)||void 0===r?void 0:r.count)&&void 0!==l?l:null===(s=w)||void 0===s?void 0:s.count,passengers:S,guests:w,tagName:t.tagName,excludeBasicEconomy:yt(void 0!==e.excludeBasicEconomy?!e.excludeBasicEconomy:void 0),travelers:"".concat(null!==(u=null===(d=e.passengers)||void 0===d?void 0:d.age1)&&void 0!==u?u:0," + ").concat(null!==(c=null===(f=e.passengers)||void 0===f?void 0:f.age2)&&void 0!==c?c:0," + ").concat(null!==(p=null===(m=e.passengers)||void 0===m?void 0:m.age3)&&void 0!==p?p:0," + ").concat(null!==(g=null===(h=e.passengers)||void 0===h?void 0:h.age4)&&void 0!==g?g:0),airlineIataCode:null===t||void 0===t?void 0:t.airlineIataCode,provider:null===t||void 0===t||null===(y=t.pageContext)||void 0===y?void 0:y.provider,deeplinkSiteEdition:null===t||void 0===t?void 0:t.siteEdition,page:[{siteEdition:t.siteEdition,countryIsoCode:Array.isArray(null===t||void 0===t||null===(b=t.pageContext)||void 0===b?void 0:b.market)&&(null===t||void 0===t||null===(D=t.pageContext)||void 0===D?void 0:D.market.length)>0&&(null===t||void 0===t||null===(Z=t.pageContext)||void 0===Z?void 0:Z.market[0]),languageIsoCode:null===t||void 0===t?void 0:t.language,typeName:null===t||void 0===t?void 0:t.pageContext.pageType}],route:null!==(C=e.origin)&&void 0!==C&&C.value||null!==(x=e.destination)&&void 0!==x&&x.value?"".concat(bt(null===(I=e.origin)||void 0===I?void 0:I.value),">").concat(bt(null===(k=e.destination)||void 0===k?void 0:k.value)):"",pageTypeName:null===t||void 0===t||null===(E=t.pageContext)||void 0===E?void 0:E.pageType,modulePrevious:e.modulePrevious,miles:e.redemptionUnit?"CASH"!==e.redemptionUnit:t.useMiles}}function _t(e){var t;return null!==(t=Ot[e])&&void 0!==t?t:e}function Bt(e,t){return"".concat(t,":").concat(e)}function Nt(e){var t={flight:e.type.includes("flight"),hotel:e.type.includes("hotel"),car:e.type.includes("car"),activity:e.type.includes("activity")};if(e.type.includes("hotel")){if(e.rooms&&e.businessRules&&e.businessRules.rooms&&e.businessRules.rooms.options&&0!==e.businessRules.rooms.options.length&&e.businessRules.rooms.options[0].type){var n,o,i,l=["Adult","Children","Youths","Infants"];return{vacations:(0,a.Z)((0,a.Z)({},t),{},{numRooms:null!==(n=null===(o=e.rooms)||void 0===o?void 0:o.length)&&void 0!==n?n:1,rooms:null===(i=e.rooms)||void 0===i?void 0:i.map((function(t){for(var n,a,o,i,r,s,u,d,v,f=1,p=0,m=0,g=0,h=0,y=0,b=!1,D=[],Z=!0===(null===(n=e.businessRules)||void 0===n||null===(a=n.rooms)||void 0===a?void 0:a.includeInfantAgesInChildAges),C=0;C<l.length;C++)for(var x=l[C],I=0;I<e.businessRules.rooms.options.length;I++){var k=e.businessRules.rooms.options[I];if(x===k.type&&e.rooms)switch(C){case 0:f=t.count[I];break;case 1:var E;if(p=t.count[I],null!==(null===(o=t.ages)||void 0===o?void 0:o[I])&&void 0!==(null===(i=t.ages)||void 0===i?void 0:i[I])&&Array.isArray(null===(r=t.ages)||void 0===r?void 0:r[I])&&0!==(null===(s=t.ages)||void 0===s||null===(u=s[I])||void 0===u?void 0:u.length))D.push.apply(D,(0,c.Z)(null===(E=t.ages)||void 0===E?void 0:E[I]));break;case 2:m=t.count[I];break;case 3:var S;if(k.showDetailedAgeOptions)for(var T=0;T<t.ages[I].length;T++){var O=t.ages[I][T];if(0===O)y+=1,Z&&D.push(0);else if(1===O)h+=1,Z&&D.push(1);else{var w,A,R,M,_;if(p+=1,null!==(null===(w=t.ages)||void 0===w?void 0:w[I])&&void 0!==(null===(A=t.ages)||void 0===A?void 0:A[I])&&Array.isArray(null===(R=t.ages)||void 0===R?void 0:R[I])&&0!==(null===(M=t.ages)||void 0===M||null===(_=M[I])||void 0===_?void 0:_.length)){var B,N=null===(B=t.ages)||void 0===B?void 0:B[I].filter((function(e){return e>=2}));b||(D.push.apply(D,(0,c.Z)(N)),b=!0)}}}else if(g=t.count[I],Z&&null!==(S=t.ages)&&void 0!==S&&S[I])for(var P=0;P<t.count[I];P++)D.push(P%2)}}if(null===(d=e.businessRules)||void 0===d||null===(v=d.rooms)||void 0===v?void 0:v.separateInfantsFromChildren){var F=0,L=0,V=0,z=[];
1t.ages&&t.ages.forEach((function(e,t){e&&Array.isArray(e)&&e.forEach((function(e){0===e?L++:1===e?V++:e>=2&&(F++,z.push(e))}))})),p=F,y=L,h=V,D.length=0,D.push.apply(D,z)}if(-1!==e.businessRules.rooms.options.findIndex((function(e){return e.showDetailedAgeOptions})))return{numAdults:f,numChildren:p,numYouths:m,numInfantsInLaps:y,numInfantsInSeats:h,childAges:D};var H=e.businessRules.rooms.options.findIndex((function(e){return"Infants"===e.type}));if(-1!==H){var G=e.businessRules.rooms.options[H];if(!0===(null===G||void 0===G?void 0:G.allInfantsAsInfantsInLaps))return{numAdults:f,numChildren:p,numYouths:m,numInfantsInLaps:g,numInfantsInSeats:0,childAges:D}}return{numAdults:f,numChildren:p,numYouths:m,numInfants:g,childAges:D}}))})}}var r,s,u,d;return{vacations:(0,a.Z)((0,a.Z)({},t),{},{numRooms:null!==(r=null===(s=e.rooms)||void 0===s?void 0:s.length)&&void 0!==r?r:1,rooms:null!==(u=null===(d=e.rooms)||void 0===d?void 0:d.map((function(t){var n,o,i,l,r;if((null===(n=e.businessRules)||void 0===n||null===(o=n.rooms)||void 0===o?void 0:o.separateInfantsFromChildren)&&null!==(i=t.ages)&&void 0!==i&&i[1]){var s,u=0,d=0,v=0,f=[];return t.ages[1].forEach((function(e){0===e?d++:1===e?v++:(u++,f.push(e))})),null!==(s=t.ages)&&void 0!==s&&s[2]&&t.ages[2].forEach((function(e){0===e?d++:1===e?v++:(u++,f.push(e))})),(0,a.Z)({numSeniors:0,numInfantsInSeats:v,numInfantsInLaps:d,numAdults:t.count[0],numChildren:u},f.length>0&&{childAges:f})}return(0,a.Z)({numSeniors:0,numInfantsInSeats:0,numInfantsInLaps:0,numAdults:t.count[0],numChildren:t.count[1]+t.count[2]},t.count[1]+t.count[2]&&{childAges:[].concat((0,c.Z)(null===(l=t.ages)||void 0===l?void 0:l[1]),(0,c.Z)(null===(r=t.ages)||void 0===r?void 0:r[2]))})})))&&void 0!==u?u:[{numAdults:1,numChildren:0}]},null!==e&&void 0!==e&&e.hotelId?{hotelId:null===e||void 0===e?void 0:e.hotelId}:{})}}return{vacations:t}}function Pt(e,t){var n,i,l,s,u,d,c,v,f,p,m,g,h,y,b,D,Z,C,x,I,k,E,S,T,O,w=e.deviceCategory,A=e.siteEdition,R=e.language,M=e.currencyCode,_=e.v2DeepLinkApiSettings.params,B=_.extraInfo,N=_.trackingParameters;w||o.warn("INTEGRATION__DEEPLINK: **device** is not defined."),A||o.warn("INTEGRATION__DEEPLINK: **siteEdition** is not defined."),B||o.warn("INTEGRATION__DEEPLINK: **extraInfo** is not defined."),t||o.warn("INTEGRATION__DEEPLINK: **submit data** is empty.");var P=void 0,F=e.v2DeepLinkApiSettings.trackingParametersWhitelist;F&&Array.isArray(F)&&(P=At(F,(0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)({},function(){if((0,r.a)())return{};var e=window.location.search&&window.location.search.startsWith("?")?window.location.search.substring(1):window.location.search;return(0,r.l)(e)}()),null===t||void 0===t?void 0:t.extraInfo),null===t||void 0===t?void 0:t.trackingParameters),N)));var L,V,z=t.flightType?_t(t.flightType):t.flightType,H=(0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)({origin:null!==(n=null===(i=t.origin)||void 0===i?void 0:i.value)&&void 0!==n?n:"",destination:null!==(l=null===(s=t.destination)||void 0===s?void 0:s.value)&&void 0!==l?l:"",departure:null!==(u=t.dates)&&void 0!==u&&u.start?Dt(t.dates.start):"",return:"ow"!==t.flightType&&null!==(d=t.dates)&&void 0!==d&&d.end?Dt(t.dates.end):"",departureTime:t.type.includes("car")&&null!==(c=t.dates)&&void 0!==c&&c.startTime?Zt(null===(v=t.dates)||void 0===v?void 0:v.startTime):void 0,returnTime:t.type.includes("car")&&null!==(f=t.dates)&&void 0!==f&&f.endTime?Zt(null===(p=t.dates)||void 0===p?void 0:p.endTime):void 0,flightType:null!==z&&void 0!==z?z:"",siteEdition:A,language:R,passengers:t.passengers,currencyCode:null!==M&&void 0!==M?M:""},t.travelClass&&{travelClass:t.travelClass}),t.promoCode&&{promoCode:t.promoCode}),{},{flexibleDates:null!==(m=null===(g=t.dates)||void 0===g?void 0:g.isFlexibleDates)&&void 0!==m&&m,device:(null===w||void 0===w?void 0:w.toUpperCase())||"DESKTOP"},Nt(t)),((null===(h=t.origin)||void 0===h?void 0:h.zoneId)||(null===(y=t.origin)||void 0===y?void 0:y.locationId))&&{originInfo:{extraInfo:{zoneId:t.origin.zoneId,locationId:t.origin.locationId}}}),((null===(b=t.destination)||void 0===b?void 0:b.zoneId)||(null===(D=t.destination)||void 0===D?void 0:D.locationId))&&{destinationInfo:{extraInfo:{zoneId:t.destination.zoneId,locationId:t.destination.locationId}}}),(null===(Z=t.origin)||void 0===Z?void 0:Z.city)&&{originInfo:{city:null===(C=t.origin)||void 0===C?void 0:C.city,extraInfo:{type:null===(x=t.origin)||void 0===x||null===(I=x.extraInfo)||void 0===I?void 0:I.type}}}),(null===(k=t.destination)||void 0===k?void 0:k.city)&&{destinationInfo:{city:null===(E=t.destination)||void 0===E?void 0:E.
1city,extraInfo:{type:null===(S=t.destination)||void 0===S||null===(T=S.extraInfo)||void 0===T?void 0:T.type}}}),{},{extraInfo:(0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)({},B),t.hotelCategory&&{hotelCategories:t.hotelCategory}),t.hotel&&{hotelName:t.hotel}),{excludeBasicEconomy:void 0!==t.excludeBasicEconomy?!t.excludeBasicEconomy:void 0}),t.carType&&"all"!==t.carType&&{carType:t.carType}),trackingParameters:null!==(O=P)&&void 0!==O?O:{}});if(void 0!==e.v2DeepLinkApiSettings.params.optionalsDeeplinkParameters)for(var G=e.v2DeepLinkApiSettings.params.optionalsDeeplinkParameters,K=0;K<G.length;K++){var j=G[K];switch(j.type){case"area":for(var U=j.data,W=0;W<U.length;W++){switch(U[W]){case"area1":H.vacations=(0,a.Z)((0,a.Z)({},H.vacations),{},{area1:Bt(H.origin,j.prefix)});break;case"area2":H.vacations=(0,a.Z)((0,a.Z)({},H.vacations),{},{area2:Bt(H.destination,j.prefix)})}}break;case"date":for(var Y=0;Y<j.data.length;Y++){switch(j.data[Y]){case"date1":var q;H.vacations=(0,a.Z)((0,a.Z)({},H.vacations),{},{date1:Dt(null===(q=t.dates)||void 0===q?void 0:q.start,j.dateFormat)});break;case"date2":var Q;H.vacations=(0,a.Z)((0,a.Z)({},H.vacations),{},{date2:Dt(null===(Q=t.dates)||void 0===Q?void 0:Q.end,j.dateFormat)})}}break;case"air_room_car_radio":H.vacations=(0,a.Z)((0,a.Z)({},H.vacations),{},{air_room_car_radio:"air_room"})}}void 0!==t.hotelId&&(H=(0,a.Z)((0,a.Z)({},H),{},{vacations:(0,a.Z)((0,a.Z)({},null===(L=H)||void 0===L?void 0:L.vacations),{},{hotelId:t.hotelId})}));void 0!==t.airlines&&(H=(0,a.Z)((0,a.Z)({},H),{},{airline:null===(V=t.airlines)||void 0===V?void 0:V.value}));return H}var Ft=function(e){var t=e+"",n=p()("get");return e.indexOf("?")>0?t+="&":t+="?",t+=n};function Lt(e){return void 0!==e&&e.toUpperCase().includes("POPUP")}function Vt(e,t){var n=e.type,i=e.payload,s=Mt(i,t),d=s.passengers,c=(0,l.Z)(s,Tt),v=t.eventType,f=Lt(v),p=void 0!==t.trackingConfig&&void 0!==t.trackingConfig.enable?t.trackingConfig.enable:[];switch(n){case"SEARCH_FLIGHTS":var m,g,h,y={originAirportIataCode:yt(null===(m=i.origin)||void 0===m?void 0:m.value),departureDate:Dt(null===(g=i.dates)||void 0===g?void 0:g.start),destinationAirportIataCode:yt(null===(h=i.destination)||void 0===h?void 0:h.value)};wt("SEARCH_FLIGHTS_BOOKING","em.".concat(v,".fsi"),c,y,p),function(e,t){var n=Pt(e,t),i=e.v2DeepLinkApiSettings,l=e.airlineIataCode,s=e.forceAirline,d=t.airlines,c=(void 0===d?{}:d).value,v=t.airline,f=c||v||s||l,p=(0,a.Z)({},i),m="";i.method||(m+="INTEGRATION__DEEPLINK: **method** is not defined. "),i.endPoint||(m+="INTEGRATION__DEEPLINK: **endPoint** is not defined."),f||(m+="INTEGRATION__DEEPLINK: **airlineCode** is not defined."),-1===p.endPoint.search("%%airlineCode%%")&&-1===p.endPoint.search("@@airlineIataCode@@")||(p.endPoint=p.endPoint.replace("%%airlineCode%%",f),p.endPoint=p.endPoint.replace("@@airlineIataCode@@",f)),p.headers||(p.headers={}),m?o.error(m):(0,u.Z)({method:p.method,url:"".concat(p.endPoint),headers:(0,a.Z)({},p.headers),data:n}).then((function(e){if(p.crossDomainGoogleTagLinker){var t,n=Ft(null===(t=e.data)||void 0===t?void 0:t.url);o.info("REDIRECT_URL_WITH_GOOGLE_TAG_LINKER",n),St((0,a.Z)((0,a.Z)({},e.data),{},{url:n}))}else St(e.data)})).catch((function(t){o.error((0,r.c)(t,"INTEGRATION__DEEPLINK",!1,!1,e.integrationSettings,e.meta))}))}(t,(0,a.Z)((0,a.Z)({},i),{},{passengers:d}));break;case"CHANGE_ORIGIN":var b,D={originAirportIataCode:yt(null===(b=i.origin)||void 0===b?void 0:b.value)};wt("CHANGE_ORIGIN_BOOKING",f?"em.fare.popup.change-origin":"em.".concat(v,".change-origin"),c,D,p);break;case"CHANGE_AIRLINE":var Z,C={airlineCodes:null===(Z=i.airlines)||void 0===Z?void 0:Z.value};wt("CHANGE_AIRLINE_BOOKING",f?"em.fare.popup.change-airlineCodes":"em.".concat(v,".change-airlineCodes"),c,C,p);break;case"CHANGE_DESTINATION":var x,I={destinationAirportIataCode:yt(null===(x=i.destination)||void 0===x?void 0:x.value)};wt("CHANGE_DESTINATION_BOOKING",f?"em.fare.popup.change-destination":"em.".concat(v,".change-destination"),c,I,p);break;case"POPUP_OPENED":var k,E={destinationAirportIataCode:yt(null===(k=i.destination)||void 0===k?void 0:k.value)};wt("POPUP_OPENED_BOOKING","em.".concat(v,".opened"),c,E,p);break;case"POPUP_CLOSE":var S,T={destinationAirportIataCode:yt(null===(S=i.destination)||void 0===S?void 0:S.value)};wt("POPUP_CLOSE_BOOKING","em.".concat(v,".close"),c,T,p);break;case"CHANGE_DEPARTURE_DATE":var O,w={destinationAirportIataCode:yt(null===(O=i.destination)||void 0===O?void 0:O.value)};wt("CHANGE_DEPARTURE_DATE_BOOKING",f?"em.fare.popup.change-departure":"em.".concat(v,".change-departure"),c,w,p);break;case"CHANGE_RETURN_DATE":var A,R={destinationAirportIataCode:yt(null===(A=i.destination)||void 0===A?void 0:A.value)};wt("CHANGE_RETURN_DATE_BOOKING",f?"em.fare.popup.change-return":"em.".concat(v,".change-return"),c,R,p);break;case"CHANGE_JOURNEY_TYPE":var M={journeyType:null===i||void 0===i?void 0:i.flightType};wt("CHANGE_JOURNEY_TYPE_BOOKING",f?"em.fare.popup.change-journeyType":"em.".concat(v,".change-journeyType"),c,M,p);break;case"CHANGE_TRAVEL_CLASS":var _={travelClass:yt(null===i||void 0===i?void 0:i.travelClass)};wt("CHANGE_TRAVEL_CLASS_BOOKING",f?"em.fare.popup.changeTravelClass":"em.".concat(v,".changeTravelClass"),c,_,p);break;case"CHANGE_PROMO_CODE":var B={promoCode:yt(i.promoCode)};wt("CHANGE_PROMO_CODE_BOOKING",f?"em.fare.popup.changePromoCode":"em.".concat(v,".changePromoCode"),c,B,p);break;case"CHANGE_TRAVELERS":var N={travelers:i.travelers};wt("CHANGE_TRAVELERS_BOOKING",f?"em.fare.popup.changeTravelers":"em.".concat(v,".changeTravelers"),c,N,p)}}function zt(){var e=It();return(0,s.useCallback)((function(t,n){return Vt({type:t,payload:n},e)}),[e])}var Ht=["passengers","guests"];function Gt(e){if((0,r.a)())return{};var t={};if(Array.isArray(e)){var n=function(e){for(var t=e.split("&"),n={},a=0;a<t.length;a+=1){var o=t[a].split("="),i=decodeURIComponent(o[0]),l=decodeURIComponent(o[1]);
1"undefined"===typeof n[i]?n[i]=decodeURIComponent(l):"string"===typeof n[i]?n[i]=[n[i],decodeURIComponent(l)]:n[i].push(decodeURIComponent(l))}return n}(window.location.search&&window.location.search.startsWith("?")?window.location.search.substring(1):window.location.search);Object.keys(n).map((function(a){return e.includes(a)&&""!==n[a]&&(t[a]=n[a]),a}))}return t}function Kt(e,t){var n=function(e,t){var n,i,l,r,s,u,d,c,v,f,p,m,g,h,y,b,D,Z,C,x,I,k,E,S,T,O,w,A,R=e.deviceCategory,M=e.siteEdition,_=e.language,B=e.currencyCode,N=e.v2DeepLinkApiSettings.params,P=N.extraInfo,F=N.trackingParameters;R||o.warn("INTEGRATION__DEEPLINK: **device** is not defined."),M||o.warn("INTEGRATION__DEEPLINK: **siteEdition** is not defined."),P||o.warn("INTEGRATION__DEEPLINK: **extraInfo** is not defined."),t.type.includes("flight")&&(P=(0,a.Z)((0,a.Z)({},P),{},{useMiles:t.redemptionUnit?"CASH"!==t.redemptionUnit:null!==(O=null!==(w=e.useMiles)&&void 0!==w?w:null===(A=P)||void 0===A?void 0:A.useMiles)&&void 0!==O&&O})),t||o.warn("INTEGRATION__DEEPLINK: **submit data** is empty.");var L=void 0,V=e.v2DeepLinkApiSettings.trackingParametersWhitelist;V&&Array.isArray(V)&&(L=At(V,(0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)({},Gt(V)),null===t||void 0===t?void 0:t.extraInfo),null===t||void 0===t?void 0:t.trackingParameters),F)));var z,H,G=t.flightType?_t(t.flightType):t.flightType,K=(0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)({origin:null!==(n=null===(i=t.origin)||void 0===i?void 0:i.value)&&void 0!==n?n:"",destination:null!==(l=null===(r=t.destination)||void 0===r?void 0:r.value)&&void 0!==l?l:"",departure:null!==(s=t.dates)&&void 0!==s&&s.start?Dt(t.dates.start):"",return:"ow"!==t.flightType&&null!==(u=t.dates)&&void 0!==u&&u.end?Dt(t.dates.end):"",departureTime:t.type.includes("car")&&null!==(d=t.dates)&&void 0!==d&&d.startTime?Zt(null===(c=t.dates)||void 0===c?void 0:c.startTime):void 0,returnTime:t.type.includes("car")&&null!==(v=t.dates)&&void 0!==v&&v.endTime?Zt(null===(f=t.dates)||void 0===f?void 0:f.endTime):void 0,flightType:null!==G&&void 0!==G?G:"",siteEdition:M,language:_,passengers:t.passengers,currencyCode:null!==B&&void 0!==B?B:""},t.travelClass&&{travelClass:t.travelClass}),t.promoCode&&{promoCode:t.promoCode}),{},{flexibleDates:null!==(p=null===(m=t.dates)||void 0===m?void 0:m.isFlexibleDates)&&void 0!==p&&p,device:(null===R||void 0===R?void 0:R.toUpperCase())||"DESKTOP"},Nt(t)),((null===(g=t.origin)||void 0===g?void 0:g.zoneId)||(null===(h=t.origin)||void 0===h?void 0:h.locationId))&&{originInfo:{extraInfo:{zoneId:t.origin.zoneId,locationId:t.origin.locationId}}}),((null===(y=t.destination)||void 0===y?void 0:y.zoneId)||(null===(b=t.destination)||void 0===b?void 0:b.locationId))&&{destinationInfo:{extraInfo:{zoneId:t.destination.zoneId,locationId:t.destination.locationId}}}),(null===(D=t.origin)||void 0===D?void 0:D.city)&&{originInfo:{city:null===(Z=t.origin)||void 0===Z?void 0:Z.city,extraInfo:{type:null===(C=t.origin)||void 0===C||null===(x=C.extraInfo)||void 0===x?void 0:x.type}}}),(null===(I=t.destination)||void 0===I?void 0:I.city)&&{destinationInfo:{city:null===(k=t.destination)||void 0===k?void 0:k.city,extraInfo:{type:null===(E=t.destination)||void 0===E||null===(S=E.extraInfo)||void 0===S?void 0:S.type}}}),{},{extraInfo:(0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)({},P),t.hotelCategory&&{hotelCategories:t.hotelCategory}),t.hotel&&{hotelName:t.hotel}),{excludeBasicEconomy:void 0!==t.excludeBasicEconomy?!t.excludeBasicEconomy:void 0}),t.carType&&"all"!==t.carType&&{carType:t.carType}),trackingParameters:null!==(T=L)&&void 0!==T?T:{}});if(void 0!==e.v2DeepLinkApiSettings.params.optionalsDeeplinkParameters)for(var j=e.v2DeepLinkApiSettings.params.optionalsDeeplinkParameters,U=0;U<j.length;U++){var W=j[U];switch(W.type){case"area":for(var Y=W.data,q=0;q<Y.length;q++)switch(Y[q]){case"area1":K.vacations=(0,a.Z)((0,a.Z)({},K.vacations),{},{area1:Bt(K.origin,W.prefix)});break;case"area2":K.vacations=(0,a.Z)((0,a.Z)({},K.vacations),{},{area2:Bt(K.destination,W.prefix)})}break;case"date":for(var Q=0;Q<W.data.length;Q++)switch(W.data[Q]){case"date1":var X;K.vacations=(0,a.Z)((0,a.Z)({},K.vacations),{},{date1:Dt(null===(X=t.dates)||void 0===X?void 0:X.start,W.dateFormat)});break;case"date2":var J;K.vacations=(0,a.Z)((0,a.Z)({},K.vacations),{},{date2:Dt(null===(J=t.dates)||void 0===J?void 0:J.end,W.dateFormat)})}break;
1case"air_room_car_radio":K.vacations=(0,a.Z)((0,a.Z)({},K.vacations),{},{air_room_car_radio:"air_room"})}}return void 0!==t.hotelId&&(K=(0,a.Z)((0,a.Z)({},K),{},{vacations:(0,a.Z)((0,a.Z)({},null===(z=K)||void 0===z?void 0:z.vacations),{},{hotelId:t.hotelId})})),void 0!==t.airlines&&(K=(0,a.Z)((0,a.Z)({},K),{},{airline:null===(H=t.airlines)||void 0===H?void 0:H.value})),K}(e,t),i=e.v2DeepLinkApiSettings,l=e.airlineIataCode,s=e.forceAirline,d=t.airlines,c=(void 0===d?{}:d).value,v=t.airline,f=c||v||s||l,p=(0,a.Z)({},i),m="";i.method||(m+="INTEGRATION__DEEPLINK: **method** is not defined. "),i.endPoint||(m+="INTEGRATION__DEEPLINK: **endPoint** is not defined."),f||(m+="INTEGRATION__DEEPLINK: **airlineCode** is not defined."),-1===p.endPoint.search("%%airlineCode%%")&&-1===p.endPoint.search("@@airlineIataCode@@")||(p.endPoint=p.endPoint.replace("%%airlineCode%%",f),p.endPoint=p.endPoint.replace("@@airlineIataCode@@",f)),p.headers||(p.headers={}),m?o.error(m):(0,u.Z)({method:p.method,url:"".concat(p.endPoint),headers:(0,a.Z)({},p.headers),data:n}).then((function(e){if(p.crossDomainGoogleTagLinker){var t,n=Ft(null===(t=e.data)||void 0===t?void 0:t.url);o.info("REDIRECT_URL_WITH_GOOGLE_TAG_LINKER",n),St((0,a.Z)((0,a.Z)({},e.data),{},{url:n}))}else St(e.data)})).catch((function(t){o.error((0,r.c)(t,"INTEGRATION__DEEPLINK",!1,!1,e.integrationSettings,e.meta))}))}function jt(e,t,n,a,o){return a&&0!==a.length?function(e,t){for(var n=0;n<t.length;n++)if(t[n].toUpperCase()===e)return!0;return!1}(t,a)?o(e,n):void 0:o(e,n)}function Ut(e,t){var n=e.type,i=e.payload,r=function(e,t){var n,o,i=Mt(e,t),r=i.passengers,s=i.guests,u=(0,l.Z)(i,Ht);return(0,a.Z)((0,a.Z)((0,a.Z)({},u),null!=s&&{guests:s}),{},{passengerCount:null!==(n=null!==(o=u.passengerCount)&&void 0!==o?o:null===r||void 0===r?void 0:r.passengerCount)&&void 0!==n?n:null===s||void 0===s?void 0:s.passengerCount,passenger:r})}(i,t),s=t.eventType,u=Lt(s),c=void 0!==t.trackingConfig&&void 0!==t.trackingConfig.enable?t.trackingConfig.enable:[],v=function(e,t){console.log("OUTPUT FOR AIRLINES OBJECT",(0,a.Z)((0,a.Z)({module:s,event:e,eventAction:e},r),t)),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t;d.zW.formatAirlines((0,a.Z)((0,a.Z)({},e),{},{passenger:null!==(t=e.guests)&&void 0!==t?t:e.passenger}))}catch(i){var n="TRACKING: **@everymundo/airmodules-event-datalayer** ".concat(i);o.error(n)}}((0,a.Z)((0,a.Z)({module:s,event:e,eventAction:e},r),t))};switch(n){case"SEARCH_FLIGHTS":var f,p,m,g={originAirportIataCode:yt(null===(f=i.origin)||void 0===f?void 0:f.value),departureDate:Dt(null===(p=i.dates)||void 0===p?void 0:p.start),destinationAirportIataCode:yt(null===(m=i.destination)||void 0===m?void 0:m.value)},h=r.passenger;jt("fsi","em.".concat(s,".fsi"),(0,a.Z)((0,a.Z)((0,a.Z)({},r),g),{},{actionLabel:"book-now"}),c,v),Kt(t,(0,a.Z)((0,a.Z)({},i),{},{passengers:h}));break;case"CHANGE_ORIGIN":var y,b,D={originAirportIataCode:yt(null===(y=i.origin)||void 0===y?void 0:y.value)};jt("select-origin",u?"em.fare.popup.select-origin":"em.".concat(s,".select-origin"),(0,a.Z)((0,a.Z)((0,a.Z)({},r),D),{},{actionLabel:null===(b=i.origin)||void 0===b?void 0:b.value}),c,v);break;case"CHANGE_DESTINATION":var Z,C,x={destinationAirportIataCode:yt(null===(Z=i.destination)||void 0===Z?void 0:Z.value)};jt("select-destination",u?"em.fare.popup.select-destination":"em.".concat(s,".select-destination"),(0,a.Z)((0,a.Z)((0,a.Z)({},r),x),{},{actionLabel:null===(C=i.destination)||void 0===C?void 0:C.value}),c,v);break;case"CHANGE_DEPARTURE_DATE":var I,k,E={destinationAirportIataCode:yt(null===(I=i.destination)||void 0===I?void 0:I.value)};jt("select-departure-date",u?"em.fare.popup.change-departure":"em.".concat(s,".change-departure"),(0,a.Z)((0,a.Z)((0,a.Z)({},r),E),{},{actionLabel:Dt(null===(k=i.dates)||void 0===k?void 0:k.start)}),c,v);break;case"CHANGE_RETURN_DATE":var S,T,O={destinationAirportIataCode:yt(null===(S=i.destination)||void 0===S?void 0:S.value)};jt("select-return-date",u?"em.fare.popup.change-return":"em.".concat(s,".change-return"),(0,a.Z)((0,a.Z)((0,a.Z)({},r),O),{},{actionLabel:Dt(null===(T=i.dates)||void 0===T?void 0:T.end)}),c,v);break;case"CHANGE_JOURNEY_TYPE":var w,A={journeyType:null===i||void 0===i?void 0:i.flightType};jt("select-journey-type",u?"em.fare.popup.change-journeyType":"em.".concat(s,".change-journeyType"),(0,a.Z)((0,a.Z)((0,a.Z)({},r),A),{},{actionLabel:null===(w=i.destination)||void 0===w?void 0:w.value}),c,v);break;case"CHANGE_TRAVEL_CLASS":var R={travelClass:yt(null===i||void 0===i?void 0:i.travelClass)};jt("select-fare-class",u?"em.fare.popup.changeTravelClass":"em.".concat(s,".changeTravelClass"),(0,a.Z)((0,a.Z)((0,a.Z)({},r),R),{},{actionLabel:i.flightType}),c,v);break;case"CHANGE_AIRLINE":var M,_={airlineCodes:null===(M=i.airlines)||void 0===M?void 0:M.value};jt("select-airline-codes",u?"em.fare.popup.change-airlineCodes":"em.".concat(s,".change-airlineCodes"),(0,a.Z)((0,a.Z)({},r),_),c,v);break;case"POPUP_OPENED":var B,N={destinationAirportIataCode:yt(null===(B=i.destination)||void 0===B?void 0:B.value)};jt("open-booking-popup","em.".concat(s,".opened"),(0,a.Z)((0,a.Z)((0,a.Z)({},r),N),{},{event:"open-booking-popup",eventAction:"open-booking-popup"}),c,v);break;case"POPUP_CLOSE":var P,F={destinationAirportIataCode:yt(null===(P=i.destination)||void 0===P?void 0:P.value)};jt("close-booking-popup","em.".concat(s,".close"),{baseline:r,filteredData:F},c,v);break;case"CHANGE_PROMO_CODE":var L={promoCode:yt(i.promoCode)};jt("enter-promo-code",u?"em.fare.popup.changePromoCode":"em.".concat(s,".changePromoCode"),(0,a.Z)((0,a.Z)((0,a.Z)({},r),L),{},{actionLabel:i.promoCode}),c,v);break;case"CHANGE_TRAVELERS":jt("select-travelers",u?"em.fare.popup.changeTravelers":"em.".concat(s,".changeTravelers"),r,c,v);break;case"CHANGE_REDEMPTION":jt("select-redemption",u?"em.fare.popup.changeRedemption":"em.".concat(s,".changeRedemption"),(0,a.Z)((0,a.Z)({},r),{},{miles:i.redemptionUnit&&"CASH"!==i.redemptionUnit,actionLabel:i.redemptionUnit}),c,v)}}function Wt(){var e=It();return(0,s.useCallback)((function(t,n){return Ut({type:t,payload:n},e)}),[e])}var Yt="same";var qt=function(e){function t(){var e;(0,h.Z)(this,t);for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return(e=(0,b.Z)(this,t,[].concat(a))).state={error:null,errorInfo:null},e}
1return(0,D.Z)(t,e),(0,y.Z)(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,errorInfo:t})}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.fallback,a=this.state,o=a.error,i=a.errorInfo;return i?n?s.createElement(n,{errorInfo:i,error:o}):null:t}}])}(s.Component);qt.defaultProps={children:null,fallback:void 0},qt.componentName="ErrorBoundary";var Qt=function(e,t){return t||e};function Xt(e){function t(n){var o=(0,s.useContext)(ke),i=n.enableErrorBoundary,l=void 0===i||i,u=n.translate,d=void 0===u?o.translate||Qt:u,c=n.direction,v=void 0===c?o.direction||"ltr":c,f=n.localizationData,p=void 0===f?o.localizationData||null:f,m=n.theme,g=void 0===m?o.theme||null:m,h=n.moment,y=void 0===h?null:h,b=n.integrationSettings,D=void 0===b?{}:b,Z=n.iconProvider,C=void 0===Z?{config:{},icons:[]}:Z,x=(0,r._)({},e.defaultProps),I=Object.assign(x,n,{enableErrorBoundary:l,translate:d,direction:v,localizationData:p,theme:g,integrationSettings:D,iconProvider:C}),k=I.prePopulation;k.airlineIataCode&&(k.airlineCode=k.airlineIataCode);var E=function(e){var t,n,o,i=e.fareItemInteractionType,l=void 0===i?"popup":i,r=e.integrationSettings,u=void 0===r?Ct:r,d=e.meta,c=void 0===d?Ct:d,v=e.pageContext,f=void 0===v?Ct:v,p=e.prePopulation,m=void 0===p?Ct:p,g=e.tracking,h=void 0===g?Ct:g,y=e.filters,b=void 0===y?Ct:y,D=e.secondaryFilters,Z=void 0===D?Ct:D,C=e.originDestinationLogic,x=void 0===C?Yt:C,I=(0,a.Z)((0,a.Z)({},b),Z);return n=!0===(null===I||void 0===I||null===(t=I.dateRangeSettings)||void 0===t?void 0:t.enableFlexibleDates)?!(null===I||void 0===I||null===(o=I.dateRangeSettings)||void 0===o||!o.checkedFlexibleDates):h.flexibleDates||"n/a",s.useMemo((function(){var e,t,a,o;return{fareItemInteractionType:l,eventType:h.eventType,eventCategory:h.eventCategory,flexibleDates:n,passengerCount:h.passengerCount,promoCode:h.promoCode,trackingConfig:h.trackingConfig,useMiles:m.redemptionUnit&&"CASH"!==m.redemptionUnit||!1,airlineIataCode:m.airlineIataCode,flightType:m.flightType,departureDateStart:null!==(e=null===(t=m.departure)||void 0===t?void 0:t.start)&&void 0!==e?e:null,returnDateEnd:null!==(a=null===(o=m.return)||void 0===o?void 0:o.end)&&void 0!==a?a:null,language:m.languageCode,currencyCode:yt(m.outputCurrencies),fareClass:yt(m.travelClasses),journeyType:yt(m.flightType),forceAirline:m.forceAirline,deviceCategory:f.deviceCategory,siteEdition:f.siteEdition,v2DeepLinkApiSettings:u.v2DeepLinkApiSettings?u.v2DeepLinkApiSettings:null,integrationSettings:u,tagName:c.tag,meta:c,prePopulation:m,pageContext:f,originDestinationLogic:x}}),[l,u,c,f,m,h,n,x])}(I);return s.createElement(Ee,{translate:d,direction:v,localizationData:p,theme:g,moment:y,componentName:null===t||void 0===t?void 0:t.displayName,tenant:I.pageContext.provider},s.createElement(_e,{iconProvider:C},s.createElement(kt,{value:E},l?s.createElement(qt,null,s.createElement(e,I)):s.createElement(e,I))))}return t.displayName="HOC(".concat(e.displayName||e.name||"AnonymousComponent",")"),t.defaultProps={meta:{moduleId:"em-cmp-lib-airmodules",name:"TO_BE_OVERWRITE_BY_THE_SPECIFIC_CONTAINER",version:"NO_NEEDED"},pageContext:{deviceCategory:"DESKTOP",siteEdition:"en_HK"}},t}var Jt=function(e){return s.createElement($t,e)},$t=function(e){var t=e.children,n=e.direction,a=e.componentName,o=void 0===a?"as":a,i=e.tenant,l=void 0===i?"COpa":i,r=(0,s.useMemo)((function(){var e="".concat(o.toLowerCase(),"-").concat(l.toLowerCase(),"-").concat(n).replace(/\s+/g,"").replace(/_+/g,"-");return"ltr"===n?(0,Z.Z)({key:e}):(0,Z.Z)({key:e,stylisPlugins:[x.ZP]})}),[o,n,l]);return s.createElement(C.C,{key:n,value:r},t)},en=function(e){return e.ALL="ALL",e.ORIGIN="ORIGIN",e.DESTINATION="DESTINATION",e.NONE="NONE",e}({});function tn(e,t){var n,a,o="ORIGIN"===t.airportType?"origins-".concat(null!==(n=t.selectedDestination)&&void 0!==n?n:"","-").concat(t.panel):"destinations-".concat(null!==(a=t.selectedOrigin)&&void 0!==a?a:"","-").concat(t.panel);return"ORIGIN"===t.airportType&&t.sameCall&&(o="origins-".concat(t.panel)),(0,O.useQuery)(o,(function(){return t.avoidCall?[]:e(t)}),{refetchOnWindowFocus:!1,staleTime:864e5})}var nn=["styles"],an={},on=new O.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:864e5,queryFn:function(){}}}});function ln(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:an,n=e.displayName||e.name||"Component",a=function(n){var a=n.styles,o=void 0===a?an:a,i=(0,l.Z)(n,nn);return s.createElement(O.QueryClientProvider,{client:on},s.createElement(k.f6,{theme:t},s.createElement(k.f6,{theme:o},s.createElement(Ie,{isIFrame:i.isIFrame},s.createElement(Ee,{translate:i.translate,direction:i.direction,localizationData:i.localizationData,theme:o,moment:i.moment},s.createElement(e,i))))))};return a.displayName="withContainer(".concat(n,")"),a}function rn(){var e;if(!(0,r.a)())return null===(e=window)||void 0===e?void 0:e.moment}function sn(e,t){var n;if("object"===typeof e&&null!==e&&void 0!==e&&e.toDate)n=e.toDate();else if("string"===typeof e){var a=rn();a?((n=a(e,t,!0)).isValid()||(n=a(e)),n=(0,w.Z)(n.toDate())):(o.warn("INTEGRATION_ACTIONS: **OpenPopupAction** window.EM.___fcRuntime.vendors.moment not \n available as global variable and the **Booking Popup** needed it"),n=(0,w.Z)(new Date(e)))}else"number"===typeof e&&(n=(0,A.Z)((0,R.Z)(),e));if(!n||!isNaN(n.getTime()))return n}function un(e){var t=Oe();return s.createElement("div",null,s.createElement(I.xv,{sx:{marginTop:"12px",variant:"text.disclaimer"},dangerouslySetInnerHTML:{__html:t(e.label,"Disclaimer")||""}}))}function dn(e){var t,n=Oe();return s.createElement(I.xu,{sx:{variant:e.containerVariant}},s.createElement(I.xv,{sx:{marginTop:"12px",variant:"".concat(null!==(t=e.variant)&&void 0!==t?t:"text.disclaimer")},dangerouslySetInnerHTML:{__html:n(e.label,"Disclaimer")||""}}))}function cn(){}function vn(){return!1}function fn(e){var t=0;return e.forEach((function(e){return t+=e})),t}var pn={options:[],defaultValue:""};function mn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pn,t=arguments.length>1?arguments[1]:void 0,n=Oe();return(0,s.useMemo)((function(){return{defaultValue:null!==t&&void 0!==t?t:e.defaultValue,options:e.options.map((function(e){return{value:e.value,label:n(e.labelKey,e.labelKey),href:e.url,rules:e.rules}}))}}),[e.defaultValue,e.options,t,n])}var gn=[];function hn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gn,t=Oe();return(0,s.useMemo)((function(){return e.map((function(e){return{name:e.name,label:t(e.labelKey,e.labelKey),defaultValue:e.defaultValue}}))}),[e,t])}function yn(e,t){try{return(0,M.Z)(e,t)}catch(n){return e.toLocaleDateString()}}function bn(e){var t=(0,s.useContext)(ke),n=t.direction,a=t.theme,o=(0,Ze.Z)(e,{direction:n,theme:a}),i=(0,v.Z)(o,2),l=i[0],r=i[1],u=void 0!==(null===e||void 0===e?void 0:e.type)?null===e||void 0===e?void 0:e.type:"div";return s.createElement(u,Object.assign({},function(e){var t=e.children,n=e.onClick,a=e.onClickCapture,o=e.onMouseEnter,i=e.onMouseLeave,l=e.onMouseDown,r=e.onMouseMove,s=e.id,u=e.onFocus,d=e.onBlur,c=e.onKeyDown,v=e.onScroll,f=e.direction,p=e.title,m=e.tabIndex,g=e.role,h=e.ariaLabel,y=e.ariaSelected,b=e.ariaLabelledBy,D=e.ariaDescribedBy,Z=e.ariaDisabled,C=e.ariaOrientation,x=e.ariaControl
1s,I=e.ariaHidden,k=e.ariaLive,E=e.ariaHasPopUp,S=e.focusReferences,T=e.dataOverlayGradient,O=e.dataHeight,w=e.dataTestId;return{role:g,id:s,dir:f,title:p,tabIndex:m,ref:S,onClick:n,onMouseEnter:o,onMouseLeave:i,onMouseDown:l,onMouseMove:r,onBlur:d,onFocus:u,onScroll:v,onKeyDown:c,onClickCapture:a,"aria-label":h,"aria-selected":y,"aria-labelledby":b,"aria-describedby":D,"aria-hidden":I,"aria-live":k,"data-overlay-gradient":T,"data-height":O,"data-item-selected":e.dataItemSelected,"data-item-highlighted":e.dataItemHighlighted,"data-testid":w,"data-src":e.dataSrc,"data-default-image":e.dataDefaultImage,"aria-haspopup":E,"aria-roledescription":e.ariaRoleDescription,"aria-current":e.ariaCurrent,"aria-orientation":C,"aria-controls":x,"aria-disabled":Z,"aria-modal":e.ariaModal,children:t}}(e),{className:l,style:r}))}bn.componentName="Box";var Dn=["icon","animation","size","viewBox","paths","fill"];function Zn(e){var t=e.icon,n=void 0===t?"broken-heart":t,o=e.animation,i=e.size,r=void 0===i?16:i,u=e.viewBox,d=void 0===u?"0 0 1024 1024":u,c=e.paths,f=void 0===c?[]:c,p=e.fill,m=void 0===p?void 0:p,g=(0,l.Z)(e,Dn),h=(0,s.useContext)(ke),y=h.direction,b=h.theme,D=(0,Ze.Z)(g,{direction:y,theme:b}),Z=(0,v.Z)(D,2),C=Z[0],x=Z[1],I=(0,s.useState)(!1),k=(0,v.Z)(I,2),E=k[0],S=k[1],T=d,O=n,w=!1,A=f,R=Re(),M=R.config,_=R.icons;if(_&&(null===_||void 0===_?void 0:_.length)>0){M&&M.enableSprite&&(w=!0),M&&M.id&&(O="".concat(M.id).concat(n));var B=_.find((function(e){return e.icon===n}));B?(M.enableSprite||(A=B.paths),B.viewBox&&(T=B.viewBox&&B.viewBox)):console.warn("Please add ".concat(n," to the iconsProvider. Searching and loading embedded icon."))}var N="";o&&(N="infinite"!==o&&E?"fr-icon-animation-".concat(o,"-active"):"fr-icon-animation-".concat(o));var P,F="fr-icon fr-icon-".concat(n," ").concat(C," ").concat(N);return s.createElement("svg",{onClick:function(){return"infinite"!==o&&void S(!E)},className:F,style:void 0===m?x:(0,a.Z)((0,a.Z)({},x),{},{fill:m}),width:r,height:r,viewBox:T,"aria-hidden":g.ariaHidden},w&&function(e){return s.createElement("use",{xlinkHref:"#".concat(e)})}(O),!w&&(0!==(P=A).length?P.map((function(e,t){return s.createElement("path",{key:t,d:e})})):null),g.ariaLabel&&s.createElement("text",{className:"fr-sr-only"},g.ariaLabel))}Zn.defaultProps={style:{fill:"currentColor"}},Zn.componentName="Icon";var Cn=["active","value","type","iconSettings","iconLeftSettings","count","countValue","labelSeparator"],xn=s.forwardRef((function(e,t){var n,o=e.active,i=e.value,r=e.type,u=e.iconSettings,d=e.iconLeftSettings,c=e.count,v=e.countValue,f=e.labelSeparator,p=void 0===f?",":f,m=(0,l.Z)(e,Cn),g=null!==(n=m.layout)&&void 0!==n?n:"compact",h="string"===typeof i&&c?i.split(p).length:0;return s.createElement(I.zx,Object.assign({ref:t,variant:"closed"===g||"standard"===g?"text.fontSize5":"filter",type:null!==r&&void 0!==r?r:"button","data-active":o?"":void 0,sx:(0,a.Z)((0,a.Z)({display:"inline-flex",justifyContent:"space-between",alignItems:"center"},"standard"===g&&{variant:"layout.layoutStyles",width:"100%"}),"closed"===g&&{variant:"layout.inputStyles",cursor:"pointer",pt:"4px",pb:"5px",px:"9px",width:"100%","&:focus":{outline:"0"}})},m),d&&s.createElement(Zn,Object.assign({icon:"sort",size:12},d)),s.createElement(I.xv,{as:"span"},i),c&&!v&&h>1&&s.createElement(I.xv,{as:"p"},"(",h,")"),c&&void 0!==v&&v>1&&s.createElement(I.xv,{as:"p"},"(",v,")"),s.createElement(bn,{display:"flex",ariaHidden:!0},s.createElement(Zn,Object.assign({marginLeft:"2",marginTop:"-4px",icon:"keyboard_arrow_down",size:12},u))))})),In=[{name:"broken-heart",paths:["M712.653 58.215c-26.533 0-52.897 3.347-78.335 9.946-5.041 1.303-9.337 4.565-11.957 9.073l-113.332 195.188c-2.898 4.985-3.432 10.994-1.463 16.413s6.231 9.691 11.65 11.669l82.121 29.861-81.158 105.506c-4.357 5.669-5.268 13.26-2.36 19.793l35.214 79.246-53.246 106.487 6.476-55.035c0.477-4.050-0.335-8.157-2.318-11.735l-44.107-79.402 45.056-108.149c4.107-9.861-0.486-21.19-10.3-25.391l-52.467-22.493 56.919-202.377c2.233-7.921-0.751-16.384-7.454-21.152-52.868-37.584-115.192-57.452-180.248-57.452-186.229 0.005-311.343 125.119-311.343 311.348 0 150.972 253.391 393.903 331.051 464.761 42.786 39.038 143.462 127.696 179.049 131.354v0.038c0.496 0.047 1.001 0.076 1.529 0.076 0.198 0 0.439 0 0.647 0 0.515 0 1.015-0.019 1.501-0.066v-0.057c32.514-3.422 121.767-80.341 173.408-127.158 79.010-71.632 336.814-317.144 336.814-468.943-0.005-186.234-125.119-311.348-311.348-311.348zM511.848 926.635c-49.928-17.206-472.894-385.316-472.894-557.078 0-188.169 136.802-272.39 272.39-272.39 52.363 0 102.692 14.704 146.398 42.644l-57.735 205.276c-2.653 9.417 2.082 19.325 11.069 23.177l50.452 21.629-41.275 99.057c-2.294 5.495-1.94 11.744 0.949 16.956l45.641 82.149-18.745 159.313c-1.105 9.394 4.697 18.221 13.769 20.93 9.016 2.71 18.754-1.482 22.998-9.946l107.125-214.245c2.596-5.202 2.738-11.31 0.368-16.625l-34.237-77.051 90.306-117.401c3.786-4.923 5.004-11.357 3.262-17.319-1.732-5.962-6.203-10.748-12.042-12.868l-85.25-30.994 97.481-167.881c19.83-4.517 40.227-6.802 60.77-6.802 135.584 0 272.39 84.221 272.39 272.39 0.005 174.301-422.541 538.678-473.191 557.078z"]},{name:"switch",paths:["M686.674 880.034l1.265-825.473 116.751 116.751 22.622-24.976-144-146.335h-22.622l-144 146.335 22.622 23.808 116.623-116.047-1.265 825.569zM196.688 877.666l144 146.335h22.622l144-146.335-22.625-23.808-116.751 116.175-1.265-825.761-32-0.098 1.265 825.217-116.623-115.505z"]},{name:"keyboard_arrow_up",paths:["M130.788 682.11l39.627 39.758 341.585-340.471 341.585 340.471 39.627-39.758-381.212-379.978z"]},{name:"keyboard_arrow_down",paths:["M893.212 341.89l-39.627-39.758-341.585 340.471-341.585-340.471-39.627 39.758 381.212 379.978z"]},{name:"close",paths:["M840 221.492l-37.489-37.492-290.511 290.508-290.508-290.508-37.492 37.492 290.508 290.508-290.508 290.511 37.492 37.489 290.508-290.508 290.511 290.508 37.489-37.489-290.508-290.511z"]},{name:"search",paths:["M36.416 1017.749l311.574-311.572c71.854 64.716 166.592 104.49 270.678 104.49 223.498-0.002 405.332-181.834 405.332-405.334s-181.834-405.334-405.334-405.334-405.334 181.834-405.334 405.334c0 104.086 39.774 198.822 104.49 270.678l-311.572 311.572c-4.166 4.166-6.25 9.626-6.25 15.084s2.084 10.916 6.25 15.084c8.334 8.332 21.834 8.332 30.166-0.002zM256 405.334c0-199.958 162.688-362.666 362.666-362.666s362.668 162.708 362.668 362.666-162.688 362.666-362.668 362.666-362.666-162.708-362.666-362.666z"]},{name:"arrow-right",paths:["M689.55 162.82c-13.95-14.438-37.168-14.438-51.606 0-13.95 13.95-13.95 37.168 0 51.086l261.674 261.674h-863.49c-20.129 0.033-36.128 16.032-36.128 36.16s15.999 36.648 36.128 36.648h863.49l-261.674 261.
1187c-13.95 14.438-13.95 37.689 0 51.606 14.438 14.438 37.689 14.438 51.606 0l323.622-323.622c14.438-13.95 14.438-37.168 0-51.086l-323.622-323.654z"]},{name:"arrow-left",paths:["M334.034 162.888c14.436-14.436 37.163-14.436 51.599 0 13.949 13.949 13.949 37.163 0 51.079l-261.635 261.635h863.359c20.126 0 36.642 15.997 36.642 36.122s-16.517 36.642-36.642 36.642h-863.359l261.635 261.147c13.949 14.436 13.949 37.683 0 51.599-14.436 14.436-37.163 14.436-51.599 0l-323.573-323.573c-13.949-13.949-13.949-37.163 0-51.079l323.573-323.573z"]},{name:"marker",paths:["M512 0c-204.49 0-370.854 166.364-370.854 370.852 0 253.776 331.878 626.335 346.008 642.071 13.272 14.782 36.444 14.756 49.692 0 14.13-15.736 346.008-388.294 346.008-642.071-0.004-204.488-166.366-370.852-370.854-370.852zM512 557.439c-102.884 0-186.584-83.702-186.584-186.586s83.702-186.584 186.584-186.584 186.582 83.702 186.582 186.586-83.7 186.584-186.582 186.584z"]},{name:"travel",paths:["M171.731 725.235c-27.583-44.567-47.717-112.727-47.717-185.609 0-218.536 177.805-396.341 396.296-396.341 44.988 0 88.137 7.915 128.447 21.774l-48.116-58.426c-26.098-4.856-52.883-7.716-80.333-7.716-242.971 0-440.642 197.693-440.642 440.686 0 81.131 22.461 156.984 53.969 208.137l38.093-22.506zM904.279 441.91c7.96 31.264 12.35 63.969 12.35 97.716 0 218.492-177.805 396.296-396.319 396.296-92.794 0-177.982-32.217-245.476-85.92l-39.246 24.989c76.784 65.521 176.075 105.277 284.722 105.277 242.993 0 440.664-197.693 440.664-440.642 0-16.098-1.131-31.862-2.816-47.45l-53.88-50.266zM1023.414 419.027c-5.499-26.231-113.902-179.135-113.902-179.135s92.084-88.958 98.181-99.512c6.053-10.554 29.379-34.213-0.355-58.67-29.756-24.413-51.065-8.625-61.596 0.798-10.576 9.468-89.667 80.311-89.667 80.311s-160.554-116.896-187.073-118.958c-26.497-2.084-44.19 21.619-44.19 21.619l163.325 164.678-80.045 94.434-71.507-20.865-39.534 24.346c0 0 78.47 34.213 93.991 53.925 15.544 19.712 36.031 85.144 36.031 85.144l37.672-19.845-17.584-86.142 90.865-72.328 155.765 170.82c0.044 0 35.122-14.39 29.623-40.62zM656.674 408.007c-14.767-13.858-38.337-22.572-38.337-22.572-195.121 189.622-438.624 398.447-491.595 405.165-20.111 1.441-32.794-3.237-37.805-14.057-5.654-12.35-12.461-20.333 1.929-34.789l-41.153-91.729c-39.29 39.512-63.392 115.565-41.308 163.569 19.246 41.862 60.643 65.942 112.24 65.942 4.168 0 8.448-0.177 12.727-0.466 104.833-7.805 445.032-331.13 546.828-429.999-0.022-0.022-8.758-27.206-23.526-41.064z"]},{name:"send",paths:["M1011.697 93.116c-9.547-7.957-22.692-10.028-34.223-5.395l-864.495 348.934c-8.743 3.535-12.966 13.49-9.431 22.233s13.49 12.966 22.233 9.431l825.851-333.229-409.665 483.166c-6.095 7.193-5.205 17.965 1.988 24.060s17.965 5.205 24.060-1.988l415.86-490.508-55.579 278.982-55.987 374.109c-0.768 5.235-3.921 9.82-8.535 12.41-4.425 2.47-9.756 2.716-14.39 0.666l-232.774-91.526-111.701-46.769c-8.691-3.647-18.695 0.44-22.343 9.131-0.372 1.17-0.614 2.378-0.716 3.603h-0.41l-55.459 214.151-79.576-277.973 414.786-308.955c5.301-3.483 8.235-9.616 7.617-15.928s-4.685-11.762-10.56-14.15c-5.875-2.388-12.592-1.322-17.439 2.768l-416.918 310.404-300.524-121.653c-8.721-3.459-18.599 0.768-22.117 9.465s0.642 18.603 9.315 22.181l302.128 122.251 80.567 281.268c4.195 14.528 17.515 24.512 32.637 24.46h0.392c8.243-0.148 16.143-3.327 22.189-8.927 0.596-0.358 1.166-0.758 1.706-1.194l164.992-168.712 221.219 87.72c14.216 6.039 30.433 5.131 43.885-2.458 13.862-7.689 23.368-21.381 25.724-37.058l55.835-373.409 61.45-308.291c2.556-12.378-1.896-25.16-11.59-33.269zM473.826 855.707l36.034-138.894 56.431 23.692 14.542 5.769-107.007 109.433z"]},{name:"coins",paths:["M746.655 341.387c-137.735 0-277.346-51.415-277.346-149.27s139.606-149.267 277.346-149.267c137.736 0 277.346 51.415 277.346 149.267s-139.603 149.27-277.346 149.27zM746.655 128.239c-124.648 0-191.962 45.496-191.962 63.883 0 18.696 67.31 63.883 191.962 63.883s191.962-45.496 191.962-63.883c0-18.696-67.31-63.883-191.962-63.883zM746.655 512.155c-137.735 0-277.346-51.415-277.346-149.267v-170.77h85.383v170.77c0 18.696 67.31 63.883 191.962 63.883s191.962-45.496 191.962-63.883v-170.77h85.383v170.77c0 97.849-139.603 149.267-277.346 149.267zM746.655 682.617c-137.735 0-277.346-51.416-277.346-149.27v-170.769h85.383v170.77c0 18.696 67.31 63.883 191.962 63.883s191.9
162-45.496 191.962-63.883v-170.77h85.383v170.77c0 98.159-139.603 149.267-277.346 149.267zM746.655 853.387c-137.735 0-277.346-51.416-277.346-149.27v-170.769h85.383v170.77c0 18.696 67.31 63.883 191.962 63.883s191.962-45.496 191.962-63.883v-170.77h85.383v170.77c0 97.847-139.603 149.267-277.346 149.267zM277.346 639.924c-137.736 0-277.346-51.414-277.346-149.267s139.604-149.267 277.346-149.267 277.346 51.415 277.346 149.267c0.001 97.85-139.603 149.267-277.346 149.267zM277.346 426.771c-124.648 0-191.962 45.496-191.962 63.883 0 18.696 67.31 63.883 191.962 63.883s191.962-45.496 191.962-63.883-67.308-63.883-191.962-63.883zM277.346 810.695c-137.736 0-277.346-51.415-277.346-149.267v-170.77h85.383v170.77c0 18.696 67.31 63.883 191.962 63.883s191.962-45.496 191.962-63.883v-170.77h85.383v170.77c0.001 97.847-139.603 149.267-277.346 149.267zM277.346 981.15c-137.736 0-277.346-51.416-277.346-149.27v-170.77h85.383v170.77c0 18.698 67.31 63.887 191.962 63.887s191.962-45.496 191.962-63.887v-170.77h85.383v170.77c0.001 98.163-139.603 149.27-277.346 149.27z"]},{name:"left-chevron",paths:["M793.869 53.224l-53.404-53.224-510.334 512 510.334 512 53.404-53.224-457.278-458.776z"]},{name:"right-chevron",paths:["M283.534 0l-53.402 53.226 457.281 458.774-457.281 458.774 53.402 53.226 510.334-512z"]},{name:"flight-type",paths:["M892.864 835.421c45.537-72.067 70.125-155.97 70.125-242.205 0-250.082-203.061-453.144-453.18-453.144-250.082 0-453.144 203.061-453.144 453.144 0 110.292 40.202 216.804 113.118 299.576l-42.499 37.447c-82.030-93.124-127.284-212.918-127.284-337.022 0-281.382 228.427-509.809 509.809-509.809s509.845 228.427 509.845 509.809c0 97.68-28.049 192.711-79.981 274.141l84.327 57.478-170.561 15.755-47.622-164.519 87.046 59.35zM647.198 930.451l49.988-49.952-74.964-324.728 137.388-137.388c20.738-20.738 20.702-54.263 0-74.964-20.667-20.667-54.228-20.702-74.929 0l-137.388 137.388-324.728-74.929-49.988 49.952 262.305 137.388-137.388 137.388-87.435-12.471-37.483 37.483 112.412 62.423 62.458 112.412 37.483-37.447-12.506-87.435 137.388-137.388 137.388 262.27z"]},{name:"settings",paths:["M541.848 499.101v-470.319c0-15.99-12.792-28.782-28.782-28.782s-28.782 12.792-28.782 28.782v470.319c-66.732 13.432-117.26 72.488-117.26 143.27s50.528 129.839 117.26 143.27v209.362c0 15.99 12.792 28.782 28.782 28.782s28.782-12.792 28.782-28.782v-209.362c66.732-13.432 117.26-72.488 117.26-143.27 0-70.569-50.315-129.839-117.26-143.27zM513.066 730.851c-48.823 0-88.478-39.655-88.478-88.478s39.655-88.478 88.478-88.478 88.478 39.655 88.478 88.478-39.655 88.478-88.478 88.478zM189.428 257.759v-228.977c0-15.99-12.792-28.782-28.782-28.782s-28.782 12.792-28.782 28.782v228.977c-66.732 13.432-117.26 72.488-117.26 143.27s50.528 129.839 117.26 143.27v450.705c0 15.99 12.792 28.782 28.782 28.782s28.782-12.792 28.782-28.782v-450.918c66.732-13.432 117.26-72.488 117.26-143.27s-50.528-129.626-117.26-143.057zM160.646 489.507c-48.823 0-88.478-39.655-88.478-88.478s39.655-88.478 88.478-88.478 88.478 39.655 88.478 88.478-39.868 88.478-88.478 88.478zM892.136 257.759v-228.977c0-15.99-12.792-28.782-28.782-28.782s-28.782 12.792-28.782 28.782v228.977c-66.732 13.432-117.26 72.488-117.26 143.27s50.528 129.839 117.26 143.27v450.918c0 15.99 12.792 28.782 28.782 28.782s28.782-12.792 28.782-28.782v-451.131c66.732-13.432 117.26-72.488 117.26-143.27s-50.315-129.626-117.26-143.057zM863.354 489.507c-48.823 0-88.478-39.655-88.478-88.478s39.655-88.478 88.478-88.478 88.478 39.655 88.478 88.478-39.655 88.478-88.478 88.478z"]},{name:"star-empty",paths:["M1024 397.050l-353.78-51.408-158.22-320.582-158.216 320.582-353.784 51.408 256 249.538-60.432 352.352 316.432-166.358 316.432 166.358-60.434-352.352 256.002-249.538zM512 753.498l-223.462 117.48 42.676-248.83-180.786-176.222 249.84-36.304 111.732-226.396 111.736 226.396 249.836 36.304-180.788 176.222 42.678 248.83-223.462-117.48z"]},{name:"star-half",paths:["M1024 397.050l-353.78-51.408-158.22-320.582-158.216 320.582-353.784 51.408 256 249.538-60.432 352.352 316.432-166.358 316.432 166.358-60.434-352.352 256.002-249.538zM512 753.498l-0.942 0.496 0.942-570.768 111.736 226.396 249.836 36.304-180.788 176.222 42.678 248.83-223.462-117.48z"]},{name:"star-full",paths:["M1024 397.050l-353.78-51.408-158.22-320.582-158.216 320.582-353.784 51.408 256 249.538-60.432 352.352 316.432-166.358 316.432 166.358-60.434-352.352 256.002-249.538z"]},{name:"round-trip",paths:["M507.705 83.037c75.435 0 150.99 21.413 218.498 61.928 42.818 25.762 81.293 58.14 113.978 95.948l-112.778-3.72c-13.245-0.443-24.338 9.945-24.773 23.198-0.435 13.245 9.945 24.345 23.198 24.773l
1156.038 5.152c8.962 3.69 19.268 1.628 26.122-5.235 6.847-6.863 8.895-17.168 5.19-26.13l-5.137-156c-0.3-13.253-11.288-23.753-24.54-23.46-13.245 0.3-23.76 11.288-23.46 24.533 0 0.18 0 0.345 0.015 0.517l2.97 90c-33.015-35.28-70.748-65.828-112.125-90.75-74.963-44.978-159.060-68.753-243.195-68.753-134.4 0-258.315 55.418-348.87 156.038-80.22 89.138-128.115 209.115-128.115 320.948 0 13.252 10.74 24 24 24s24-10.748 24-24c0-100.298 43.283-208.275 115.793-288.833 81.345-90.368 192.563-140.153 313.193-140.153zM966.72 488.022c-13.26 0-24 10.74-24 24 0 100.29-43.283 208.275-115.793 288.84-81.345 90.368-192.563 140.138-313.193 140.138-75.435 0-150.99-21.398-218.498-61.913-42.818-25.77-81.293-58.148-113.978-95.948l112.778 3.72c13.245 0.427 24.338-9.96 24.773-23.205s-9.945-24.338-23.198-24.78l-156.038-5.145c-8.962-3.69-19.268-1.62-26.122 5.235-6.847 6.862-8.895 17.16-5.19 26.122l5.137 156c0.3 13.26 11.288 23.768 24.54 23.468 13.245-0.292 23.76-11.28 23.46-24.532 0-0.173 0-0.337-0.015-0.517l-2.97-90c33.015 35.288 70.748 65.82 112.125 90.758 74.963 44.985 159.060 68.753 243.195 68.753 134.4 0 258.315-55.41 348.87-156.030 80.22-89.145 128.115-209.123 128.115-320.963 0-13.26-10.74-24-24-24z"]},{name:"travel-class",paths:["M352.905 919.515c-6.206-1.201-15.063-10.817-16.476-17.895-0.672-3.346-1.214-14.152-1.214-24.006v-17.915h414.777v22.677c0 20.365-0.428 23.219-4.146 27.948-8.618 10.958-0.735 10.556-202.702 10.282-102.268-0.139-187.876-0.639-190.226-1.092zM970.753 915.263c-8.17-1.967-12.542-4.675-19.352-11.929-3.293-3.5-34.816-46.9-70.067-96.429-56.682-79.672-65.878-93.619-79.621-120.765-17.215-34.045-25.314-43.525-45.232-52.948-10.739-5.083-20.879-6.412-73.439-9.594l-20.095-1.218-8.392-21.349c-13.586-34.586-20.665-48.178-30.984-59.453-5.339-5.85-9.188-10.639-8.546-10.639s18.577 2.147 39.856 4.777c21.278 2.631 67.351 8.171 102.388 12.336 68.786 8.154 74.256 9.529 85.771 21.585 4.879 5.103 162.485 268.449 173.39 289.719 3.775 7.372 4.332 22.137 1.201 31.647-2.835 8.608-16.782 21.38-26.172 23.988-8.199 2.273-12.287 2.325-20.751 0.286zM292.652 830.968c-5.016-0.846-12.947-3.397-17.613-5.664-11.324-5.491-25.978-21.838-30.093-33.59-1.814-5.185-34.325-107.484-72.249-227.329-73.732-233.035-72.888-229.9-66.951-250.393 3.478-11.983 17.254-26.472 28.038-29.459 4.215-1.168 24.803-2.069 47.691-2.069 31.424-0.010 42.534 0.663 50.603 3.053 16.718 4.967 29.944 15.804 38.112 31.218 1.354 2.564 17.293 43.64 35.405 91.272s35.378 90.138 38.341 94.432c5.926 8.557 17.327 17.113 27.307 20.512 3.524 1.201 49.118 6.514 101.305 11.808 52.34 5.304 98.727 10.907 103.428 12.484 22.745 7.612 31.703 19.492 51.325 68.030l14.972 37.034 44.779 2.529c49.863 2.823 58.215 4.93 70.425 17.792 7.153 7.535 56.069 101.202 60.448 115.755 3.584 11.91 1.609 21.993-6.105 31.149-11.316 13.454 10.164 12.412-263.493 12.71-135.613 0.147-250.669-0.434-255.685-1.282zM474.936 504.047c-48.772-5.080-89.327-9.916-90.104-10.754-3.137-3.375-23.665-62.135-28.829-82.49-3.971-15.675-5.495-26.291-5.492-38.234 0.020-19.919 1.971-27.675 10.080-39.796 4.952-7.413 9.118-10.712 21.22-16.866 14.892-7.559 15.301-7.639 36.315-7.639 24.752 0 32.275 2.835 44.114 16.66 7.807 9.119 26.693 40.283 45.505 75.086 14.7 27.204 58.752 111.908 58.752 112.981 0 0.412-0.639 0.639-1.435 0.515s-41.347-4.38-90.119-9.46zM359.835 281.126c-31.522-15.761-58.828-54.179-64.71-91.064-6.856-42.889 21.857-79.365 67.671-85.965 36.349-5.237 67.429 15.457 79.825 53.157 6.407 19.458 6.36 56.846-0.089 7
17.386-5.934 18.887-10.374 27.274-20.007 37.78-10.583 11.52-20.053 15.669-35.928 15.723-10.805 0.030-14.699-0.993-26.755-7.021z"]},{name:"switch-vertical",paths:["M739.556 796.444v-398.222h-113.778v398.222h-170.667l227.556 227.556 227.556-227.556h-170.667zM341.333 0l-227.556 227.556h170.667v398.222h113.778v-398.222h170.667l-227.556-227.556z"]},{name:"calendar-material",paths:["M7,10H12V15H7M19,19H5V8H19M19,3H18V1H16V3H8V1H6V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3Z"],viewBox:"0 0 24 24"},{name:"right-arrow-fill",paths:["M10,17L15,12L10,7V17Z"],viewBox:"0 0 24 24"},{name:"left-arrow-fill",paths:["M14,7L9,12L14,17V7Z"],viewBox:"0 0 24 24"},{name:"up-arrow-fill",paths:["M7,15L12,10L17,15H7Z"],viewBox:"0 0 24 24"},{name:"down-arrow-fill",paths:["M7,10L12,15L17,10H7Z"],viewBox:"0 0 24 24"},{name:"airplane-takeoff",paths:["M2.5 19h19v2h-19zm7.18-5.73l4.35 1.16 5.31 1.42c.8.21 1.62-.26 1.84-1.06.21-.8-.26-1.62-1.06-1.84l-5.31-1.42-2.76-9.02L10.12 2v8.28L5.15 8.95l-.93-2.32-1.45-.39v5.17l1.6.43 5.31 1.43z"]},{name:"airplane-arrive",paths:["M2.5 19h19v2h-19zm19.57-9.36c-.21-.8-1.04-1.28-1.84-1.06L14.92 10l-6.9-6.43-1.93.51 4.14 7.17-4.97 1.33-1.97-1.54-1.45.39 1.82 3.16.77 1.33 1.6-.43 5.31-1.42 4.35-1.16L21 11.49c.81-.23 1.28-1.05 1.07-1.85z"]},{name:"currency",paths:["M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z"]},{name:"currency-fill",paths:["M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1.41 16.09V20h-2.67v-1.93c-1.71-.36-3.16-1.46-3.27-3.4h1.96c.1 1.05.82 1.87 2.65 1.87 1.96 0 2.4-.98 2.4-1.59 0-.83-.44-1.61-2.67-2.14-2.48-.6-4.18-1.62-4.18-3.67 0-1.72 1.39-2.84 3.11-3.21V4h2.67v1.95c1.86.45 2.79 1.86 2.85 3.39H14.3c-.05-1.11-.64-1.87-2.22-1.87-1.5 0-2.4.68-2.4 1.64 0 .84.65 1.39 2.67 1.91s4.18 1.39 4.18 3.91c-.01 1.83-1.38 2.83-3.12 3.16z"]},{name:"airplane",paths:["M10.18 9","M21 16v-2l-8-5V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5l8 2.5z"],viewBox:"0 0 24 24"},{name:"hotel",paths:["M7 13c1.66 0 3-1.34 3-3S8.66 7 7 7s-3 1.34-3 3 1.34 3 3 3zm12-6h-8v7H3V5H1v15h2v-3h18v3h2v-9c0-2.21-1.79-4-4-4z"],viewBox:"0 0 24 24"},{name:"drive",paths:["M18.92 5.01C18.72 4.42 18.16 4 17.5 4h-11c-.66 0-1.21.42-1.42 1.01L3 11v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8l-2.08-5.99zM6.5 15c-.83 0-1.5-.67-1.5-1.5S5.67 12 6.5 12s1.5.67 1.5 1.5S7.33 15 6.5 15zm11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM5 10l1.5-4.5h11L19 10H5z"],viewBox:"0 0 24 24"},{name:"localOffer",paths:["M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7z"],viewBox:"0 0 24 24"},{name:"add",paths:["M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"],viewBox:"0 0 24 24"},{name:"remove",paths:["M19 13H5v-2h14v2z"],viewBox:"0 0 24 24"}],kn=["icon","animation","size","viewBox","fill","paths","rtlFlip","style","className","sx"];function En(e){var t=e.icon,n=void 0===t?"broken-heart":t,o=e.animation,i=e.size,r=void 0===i?16:i,u=e.viewBox,d=e.fill,c=void 0===d?"currentColor":d,f=e.paths,p=void 0===f?[]:f,m=e.rtlFlip,g=void 0!==m&&m,h=e.style,y=e.className,b=e.sx,D=(0,l.Z)(e,kn),Z=(0,s.useState)(!1),C=(0,v.Z)(Z,2),x=C[0],I=C[1],E="";o&&(E="infinite"!==o&&x?"fr-icon-animation-".concat(o,"-active"):"fr-icon-animation-".concat(o));var S="fr-icon fr-icon-".concat(n," ").concat(E),T=we(),O=0===p.length?In.find((function(e){return e.name===n})):void 0,w=u;return w=!w&&O&&O.viewBox?O.viewBox:"0 0 1024 1024",(0,k.tZ)("svg",Object.assign({onClick:function(){return"infinite"!==o&&void I(!x)},className:"".concat(S," ").concat(y),style:h,viewBox:w,sx:(0,a.Z)({width:r,height:r,transform:g&&"rtl"===T?"scaleX(-1)":void 0,fill:c},b)},D),function(e,t){var n=0===t.length?null===e||void 0===e?void 0:e.paths:t;return n?n.map((function(e,t){return(0,k.tZ)("path",{key:t,d:e})})):null}(O,p))}En.componentName="Icon";var Sn=["label","layout","rightIcon","rightIconSize","disabled","hasError","state","rightElement","errorMessage"],Tn={layout:{variant:"layout.layoutStyles"},layoutClosed:{variant:"layout.layoutStylesClosed"},input:{variant:"layout.inputStyles"}},On=(0,s.forwardRef)((function(e,t){var n=e.label,o=e.layout,i=void 0===o?"closed":o,r=e.rightIcon,u=e.rightIconSize,d=e.disabled,c=e.hasError,f=e.state,p=e.rightElement,m=e.errorMessage,g
1=(0,l.Z)(e,Sn),h=s.useState(le()()),y=(0,v.Z)(h,1)[0],b=s.createElement(I.__,{htmlFor:y},n),D=s.useRef(null),Z=t||D,C=s.createElement(qe,{alignY:"center","data-disabled":d?"":void 0,"data-error":c?"":void 0,"data-state":f,"data-active":g.active?"":void 0,sx:(0,a.Z)((0,a.Z)({},"closed"===i?Tn.layoutClosed:Tn.layout),g.customInputStyle),onClick:function(e){var t,n;"function"!==typeof Z&&(null===(n=Z.current)||void 0===n||n.focus());null===(t=g.onClick)||void 0===t||t.call(g,e)}},s.createElement(et,{sx:{flex:"1"}},"closed"===i?b:null,g.children||s.createElement("div",null,s.createElement(I.II,Object.assign({id:y,sx:Tn.input,disabled:d,"aria-invalid":c},g,{ref:Z})))),r&&s.createElement(En,{sx:{cursor:"pointer"},icon:null!==r&&void 0!==r?r:"keyboard_arrow_down",size:u,fill:"textSoft"}),s.createElement("div",{style:{height:"100%"}},null!==p&&void 0!==p?p:null));return s.createElement(et,{gap:1},"closed"===i?null:b,C,c?m:null)})),wn={menu:{overflowY:"auto",padding:0,margin:0,listStyle:"none",position:"relative"}},An=function(e,t){var n,o,i,l=e.options,u=s.useState(le()()),d=(0,v.Z)(u,1)[0],c=s.useState(!1),f=(0,v.Z)(c,2),p=f[0],m=f[1],g=Oe(),h=null!==(n=e.layout)&&void 0!==n?n:"compact",y=null!==(o=e.showLabel)&&void 0!==o?o:"compact"!==h,b=s.useMemo((function(){return e.value?e.options.find((function(t){return t.value===e.value})):void 0}),[e.value,e.options]),D=s.useState((function(){return e.defaultValue?e.options.find((function(t){return t.value===e.defaultValue})):void 0})),Z=(0,v.Z)(D,1)[0],C=s.useRef(null),x=(0,se.E)(C),E=(0,oe.L7)({items:l,selectedItem:b,defaultSelectedItem:Z,stateReducer:function(e,t){var n=t.type,o=t.changes;return m(o.isOpen),n===oe.L7.stateChangeTypes.MenuMouseLeave?(0,a.Z)((0,a.Z)({},o),{},{highlightedIndex:e.highlightedIndex}):(0,a.Z)({},o)},onStateChange:function(){var t;return null===(t=e.onClick)||void 0===t?void 0:t.call(e)},onSelectedItemChange:function(t){var n,a,o;null===(n=e.onChange)||void 0===n||n.call(e,(null===(a=t.selectedItem)||void 0===a?void 0:a.value)||"");var i=null===(o=document)||void 0===o?void 0:o.querySelector("#listBoxId-".concat(d));i&&i.focus()},itemToString:function(e){return e?String(e.label):""}}),S=E.selectedItem,T=E.getToggleButtonProps,O=E.getLabelProps,w=E.getMenuProps,A=E.highlightedIndex,R=E.getItemProps,M=E.closeMenu,_=s.useContext(ke).direction,B=s.useRef(!1);s.useEffect((function(){var t,n=void 0===e.focusWhenIsShow||e.focusWhenIsShow,a=new AbortController;p||e.loading||B.current||n&&(null===(t=C.current)||void 0===t||t.focus(),B.current=!0);return function(){a.abort()}}),[S,p,e.loading]);var N=function(e,t,n){return(0,a.Z)((0,a.Z)({},e),{},{"aria-labelledby":e["aria-labelledby"].replace(t,"".concat(n))})},P=s.useRef(null),F=e.portal,L=void 0!==F&&F,V=Be(),z=function(t){var n=t.id;return(0,a.Z)((0,a.Z)({},t),{},{id:"".concat(n,"-").concat(d),"aria-labelledby":t["aria-labelledby"].replace(n,"".concat(n,"-").concat(d)),className:null===e||void 0===e?void 0:e.className})}(T({ref:C})),H=O(),G=H.id;z=N(z,G,(H=function(e){var t=e.id;return(0,a.Z)((0,a.Z)({},e),{},{id:"".concat(t,"-").concat(d)})}(H)).id);var K=N(w({style:wn.menu,onBlur:function(){m(!1)}}),G,H.id);K["aria-labelledby"]="listBoxId-".concat(d),s.useImperativeHandle(t,(function(){return{focusToggleElement:function(){if(!(0,r.a)()){var e,t=null===(e=document)||void 0===e?void 0:e.querySelector("#listBoxId-".concat(d));t&&t.focus()}}}}),[]),s.useEffect((function(){var t,n,a,o=function(){M()},i=V?null===(t=e.filterContentRef)||void 0===t||null===(n=t.current)||void 0===n?void 0:n.parentElement:null===(a=e.filterContentRef)||void 0===a?void 0:a.current;return null===i||void 0===i||i.addEventListener("scroll",o),function(){return null===i||void 0===i?void 0:i.removeEventListener("scroll",o)}}),[e.filterContentRef,V]);var j=(0,k.tZ)(s.Fragment,null,(0,k.tZ)(ue.T,{"aria-live":"polite"},p?g("cmp-listbox-filter-expanded","Filter expanded"):""),(0,k.tZ)(xn,Object.assign({},z,{iconLeftSettings:null===e||void 0===e?void 0:e.filterButtonIconLeftProps,iconSettings:null===e||void 0===e?void 0:e.filterButtonIconProps,active:void 0!==(null===e||void 0===e?void 0:e.activeFilterButton)?null===e||void 0===e?void 0:e.activeFilterButton:!e.disabled&&!(null===S||void 0===S||!S.value)&&"compact"===h,value:!e.forcePlaceholder&&"".concat(null!==e.prefixSelectedItem&&void 0!==e.prefixSelectedItem?e.prefixSelectedItem+" "+(null===S||void 0===S?void 0:S.label):null!==S&&void 0!==S&&S.label?null===S||void 0===S?void 0:S.label:e.label)||e.placeholder||e.labelNotSelectedItem||g("cmp-listbox-not-selected-item","Elements"),layout:h,"aria-labelledby":void 0!==e.ariaLabelledBy?"".concat(z["aria-labelledby"]," ").concat(e.ariaLabelledBy):y?z["aria-labelledby"]:null,"aria-describedby":void 0!==e.ariaDescribedBy?"".concat(null!==(i=z["aria-describedby"])&&void 0!==i?i:""," ").concat(e.ariaDescribedBy):z["aria-describedby"],"aria-label":"".concat(null!==S&&void 0!==S&&S.label?"".concat(g("cmp-travel-class-filter-label-selected-item","Select")," ").concat(e.label," ").concat(null===S||void 0===S?void 0:S.label):y?void 0:e.label," "),disabled:e.disabled,id:"listBoxId-".concat(d),"aria-haspopup":"listbox","aria-controls":p?K.id:null,"data-testid":e.dataTestIdButton,"aria-invalid":e.hasError}
1)),(0,k.tZ)(re.ZP,{targetRef:L?C:P,portal:L,style:{minWidth:null===x||void 0===x?void 0:x.width},sx:{variant:p?"layout.listbox":""},onKeyDown:function(e){if((9===e.keyCode||27===e.keyCode)&&(e.preventDefault(),!(0,r.a)())){var t,n=null===(t=document)||void 0===t?void 0:t.querySelector("#listBoxId-".concat(d));n&&n.focus()}},position:"ltr"===_?re.MN:re.Kp,"data-testid":e.dataTestIdPopover},p&&(0,k.tZ)("ul",Object.assign({},K,{sx:{variant:"menus.default"},role:"listbox"}),l.map((function(t,n){var o=S&&S.value===l[n].value,i=A===n;if("function"===typeof e.renderItem)return e.renderItem(t,(0,a.Z)({},R({item:t,index:n})),o,i);var r=(0,k.tZ)("li",Object.assign({"data-item-selected":o,"data-item-highlighted":i,sx:{variant:"menuItems.default",cursor:t.href?"cursor":"default",display:""===t.value?"none":"block"},key:"".concat(t.value,"-list")},R({item:t,index:n}),{"data-testid":t.testId?t.testId:null}),t.label);return t.href?(0,k.tZ)("li",Object.assign({"data-item-selected":o,"data-item-highlighted":i,sx:{cursor:t.href?"cursor":"default"},key:"".concat(t.value,"-list")},R({item:t,index:n})),(0,k.tZ)(Xe,{key:t.value,href:t.href},r)):r})))));if("closed"===h)return(0,k.tZ)(On,{hasError:e.hasError,label:e.label},(0,k.tZ)("div",{sx:{position:"relative",variant:"layout.closed"}},j));var U=y?(0,k.tZ)(I.__,Object.assign({variant:"text.fontSize6",color:"text",mb:"2"},(0,a.Z)((0,a.Z)({},H),{},{htmlFor:"".concat(z.id)})),e.label):null;return(0,k.tZ)("div",{sx:{position:"relative"}},U,j)},Rn=s.forwardRef(An),Mn={growContainer:{display:"inline-block"},grow:{},controls:{container:{borderStyle:"solid",borderWidth:"default",borderRadius:"default",borderColor:"border",height:"48px"},button:{display:"inline-flex",alignItems:"center",px:"8px"},counter:{variant:"text.fontSize5",alignSelf:"center",width:"30px",textAlign:"center"}}};function _n(e){var t,n,o=null!==(t=e.count)&&void 0!==t?t:0,i=null!==(n=e.config.showSpinSeparator)&&void 0!==n&&n,l="inline"===e.layout?et:qe,r=Oe(),u=r(e.config.label),d=s.useRef(null),c=s.useRef(null),v=s.useRef(!1);return s.useEffect((function(){var t,n;e.addButtonDisabled&&v.current&&(null===(t=c.current)||void 0===t||t.focus());e.removeButtonDisabled&&v.current&&(null===(n=d.current)||void 0===n||n.focus());v.current=!1}),[e.addButtonDisabled,e.removeButtonDisabled]),s.createElement(l,{alignY:"center",align:"start",gap:2,sx:Mn.growContainer,childrenBottomMargin:!0},s.createElement(et,{gap:1,sx:{flex:1},variant:"forms.spinButton.labelContainer"},s.createElement(I.xv,{variant:"fontSize5"},u),e.config.description&&s.createElement(I.xv,{variant:"fontSize7"},r(e.config.description))),s.createElement(qe,{sx:Mn.controls.container,variant:"forms.spinButton","data-disabled":e.addButtonDisabled&&e.removeButtonDisabled},s.createElement(I.zx,{ref:c,variant:"text","aria-label":r("cmp-people-counter-remove-btn-label","Decrease {label}",{label:u}),onClick:function(){var t;null===(t=e.onRemove)||void 0===t||t.call(e),v.current=!0},sx:(0,a.Z)((0,a.Z)({},Mn.controls.button),i?{}:{borderRight:"none !important"}),disabled:e.removeButtonDisabled},s.createElement(En,{"aria-hidden":!0,size:20,icon:"remove"})),s.createElement(I.xv,{"aria-live":"polite",as:"span",sx:Mn.controls.counter},o),s.createElement(I.zx,{ref:d,variant:"text","aria-label":r("cmp-people-counter-add-btn-label","Increase {label}",{label:u}),onClick:function(){var t;null===(t=e.onAdd)||void 0===t||t.call(e),v.current=!0},sx:(0,a.Z)((0,a.Z)({},Mn.controls.button),i?{}:{borderLeft:"none !important"}),disabled:e.addButtonDisabled},s.createElement(En,{"aria-hidden":!0,size:20,icon:"add"}))))}var Bn=["popoverRef","isOpen","onClose","children","variant"],Nn=function(e){var t=s.useRef(null),n=e.popoverRef,a=void 0===n?t:n,o=e.isOpen,i=e.onClose,r=e.children,u=e.variant,d=(0,l.Z)(e,Bn),c=(0,T.Ir)({isOpen:o,onClose:i,isDismissable:!0,shouldCloseOnInteractOutside:function(e){return"html"!==e.tagName.toLowerCase()&&(null===i||void 0===i||i(),!0)}},a).overlayProps;return(0,k.tZ)(fe.ZP,{autoFocus:!0,returnFocus:!0},(0,k.tZ)("div",Object.assign({},c,{sx:{position:"absolute",zIndex:1,variant:null!==u&&void 0!==u?u:"layout.popover"}},d,{ref:a}),r))},Pn={menu:{overflowY:"auto",padding:0,margin:0,listStyle:"none",position:"relative"}}
1,Fn=function(e,t){var n,o,i=e.options,l=s.useState(le()()),u=(0,v.Z)(l,1)[0],d=Oe(),c=null!==(n=e.layout)&&void 0!==n?n:"compact",f=null!==(o=e.showLabel)&&void 0!==o?o:"compact"!==c,p=s.useMemo((function(){return e.options.find((function(t){return t.value===e.defaultValue}))}),[e.defaultValue,e.options]),m=s.useRef(null),g=(0,se.E)(m),h=(0,oe.L7)({id:u,items:i,selectedItem:p,stateReducer:function(t,n){var o,l,r=n.type,s=n.changes;if((r===oe.L7.stateChangeTypes.ToggleButtonKeyDownArrowDown||r===oe.L7.stateChangeTypes.ToggleButtonKeyDownArrowUp||r===oe.L7.stateChangeTypes.ToggleButtonClick||r===oe.L7.stateChangeTypes.FunctionOpenMenu||r===oe.L7.stateChangeTypes.FunctionToggleMenu)&&!t.isOpen&&s.isOpen){var u=i.findIndex((function(e){return e.value===(t.selectedItem?t.selectedItem.value:void 0)}));return(0,a.Z)((0,a.Z)({},s),{},{highlightedIndex:u>=0?u:0})}return r===oe.L7.stateChangeTypes.MenuMouseLeave?(0,a.Z)((0,a.Z)({},s),{},{highlightedIndex:t.highlightedIndex}):r===oe.L7.stateChangeTypes.MenuKeyDownEscape?(A.close(),(0,a.Z)((0,a.Z)({},s),{},{highlightedIndex:t.highlightedIndex})):r===oe.L7.stateChangeTypes.MenuKeyDownEnter||r===oe.L7.stateChangeTypes.MenuKeyDownSpaceButton?(null===(o=e.onClick)||void 0===o||o.call(e),A.close(),b(s.selectedItem),(0,a.Z)((0,a.Z)({},s),{},{highlightedIndex:t.highlightedIndex})):r===oe.L7.stateChangeTypes.ItemClick?(null===(l=e.onClick)||void 0===l||l.call(e),A.close(),(0,a.Z)({},s)):(0,a.Z)({},s)},onSelectedItemChange:function(t){var n,a,o;null===(n=e.onChange)||void 0===n||n.call(e,(null===(a=t.selectedItem)||void 0===a?void 0:a.value)||""),A.close();var i=null===(o=document)||void 0===o?void 0:o.querySelector("#listBoxId-".concat(u));i&&i.focus()},itemToString:function(e){return e?String(e.label):""}}),y=h.selectedItem,b=h.selectItem,D=h.getToggleButtonProps,Z=h.getLabelProps,C=h.getMenuProps,x=h.highlightedIndex,E=h.getItemProps,S=h.closeMenu,O=s.useRef(!1),w=Be(),A=(0,ve.d)({});s.useEffect((function(){var t,n=void 0===e.focusWhenIsShow||e.focusWhenIsShow,a=new AbortController;A.isOpen||e.loading||O.current||n&&(null===(t=m.current)||void 0===t||t.focus(),O.current=!0);return function(){a.abort()}}),[y,A.isOpen,e.loading]);var R=function(e,t,n){return(0,a.Z)((0,a.Z)({},e),{},{"aria-labelledby":e["aria-labelledby"].replace(t,"".concat(n))})},M=s.useRef(null),_=function(t){var n=t.id;return(0,a.Z)((0,a.Z)({},t),{},{id:"".concat(n,"-").concat(u),"aria-labelledby":t["aria-labelledby"].replace(n,"".concat(n,"-").concat(u)),className:null===e||void 0===e?void 0:e.className})}(D({ref:m})),B=Z(),N=B.id;B=function(e){var t=e.id;return(0,a.Z)((0,a.Z)({},e),{},{id:"".concat(t,"-").concat(u)})}(B),_=R(_,N,B.id);var P=R(C({"aria-activedescendant":"".concat(u,"-item-").concat(x),role:"listbox",style:Pn.menu,onBlur:function(){A.close()}}),N,B.id);P["aria-labelledby"]="listBoxId-".concat(u),s.useImperativeHandle(t,(function(){return{focusToggleElement:function(){if(!(0,r.a)()){var e,t=null===(e=document)||void 0===e?void 0:e.querySelector("#listBoxId-".concat(u));t&&t.focus()}}}}),[]),s.useEffect((function(){if(A.isOpen&&x>=0){var e=document.getElementById("".concat(u,"-item-").concat(x));e&&e.scrollIntoView({behavior:"smooth",block:"nearest"})}}),[x,A.isOpen,u]),s.useEffect((function(){var e,t=function(){S(),A.close()},n=document.querySelectorAll("#room-container");return n.forEach((function(e){return e.addEventListener("scroll",t)})),null===(e=window)||void 0===e||e.addEventListener("scroll",(function(){return t()})),function(){var e;n.forEach((function(e){return e.removeEventListener("scroll",t)})),null===(e=window)||void 0===e||e.removeEventListener("scroll",t)}}),[]);var F=(0,ce.U)({onPress:function(e){A.open()},elementType:"div"},m).buttonProps,L=(0,T.tN)({targetRef:m,overlayRef:M,placement:"bottom left",offset:0,isOpen:A.isOpen}),V=L.overlayProps,z=L.updatePosition,H=(0,a.Z)((0,a.Z)({},A),{},{close:z}),G=(0,T.IB)({type:"dialog"},H,m).triggerProps,K=(0,k.tZ)(xn,Object.assign({},_,{iconLeftSettings:null===e||void 0===e?void 0:e.filterButtonIconLeftProps,iconSettings:null===e||void 0===e?void 0:e.filterButtonIconProps,active:void 0!==(null===e||void 0===e?void 0:e.activeFilterButton)?null===e||void 0===e?void 0:e.activeFilterButton:!(null===y||void 0===y||!y.value)&&"compact"===c,value:!e.forcePlaceholder&&"".concat(null!==e.prefixSelectedItem&&void 0!==e.prefixSelectedItem?e.prefixSelectedItem+" "+(null===y||void 0===y?void 0:y.label):null!==y&&void 0!==y&&y.label?null===y||void 0===y?void 0:y.label:e.label)||e.placeholder||e.labelNotSelectedItem||d("cmp-listbox-not-selected-item","Elements"),layout:c,"aria-labelledby":void 0!==e.ariaLabelledBy?"".concat(_["aria-labelledby"]," ").concat(e.ariaLabelledBy):f?_["aria-labelledby"]:null,"aria-label":"".concat(null!==y&&void 0!==y&&y.label?"".concat(d("cmp-travel-class-filter-label-selected-item","Select")," ").concat(e.label," ").concat(null===y||void 0===y?void 0:y.label):f?void 0:e.label," "),onClick:A.open,onKeyDown:function(e){var t,n;40===e.keyCode&&(e.preventDefault(),A.open()),null===(t=_)||void 0===t||null===(n=t.onKeyDown)||void 0===n||n.call(t,e)},disabled:e.disabled,id:"listBoxId-".concat(u),"aria-haspopup":"listbox","aria-controls":A.isOpen?P.id:null,"data-testid":e.dataTestIdButton})),j=s.cloneElement(K,(0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)({},F),G),K.props),{},{ref:m,componentReference:m,"aria-activedescendant":"".concat(u,"-item-").concat(x)})),U={style:(0,a.Z)((0,a.Z)({},V.style),{},{zIndex:99999999999,minWidth:null===g||void 0===g?void 0:g.width,maxWidth:w?null===g||void 0===g?void 0:g.width:"100%",background:"transparent"})},W=(0,k.tZ)(s.Fragment,null,(0,k.tZ)(ue.T,{"aria-live":"polite"},A.isOpen?d("cmp-listbox-filter-expanded","Filter expanded"):""),j,(0,k.tZ)(T.Xj,null,A.isOpen?(0,k.tZ)(Nn,Object.assign({},U,{popoverRef:M,onClose:A.close,variant:e.variant}),(0,k.tZ)("ul",Object.assign({},P,{onBlur:function(e){e.preventDefault()},sx:{"@media (max-height: 320px)":{height:"35dvh"},variant:"menus.default"}}),i.map((function(t,n){var o=y&&y.value===t.value,i=x===n;return"function"===typeof e.renderItem?e.renderItem(t,(0,a.Z)({}
1,E({item:t,index:n})),o,i):(0,k.tZ)("li",Object.assign({"data-item-selected":o,"data-item-highlighted":i,sx:{variant:"menuItems.default",cursor:t.href?"cursor":"default"},key:"".concat(t.value,"-list"),id:"".concat(u,"-item-").concat(n)},E({item:t,index:n}),{"data-testid":t.testId?t.testId:null}),t.href?(0,k.tZ)(Xe,{key:t.value,href:t.href},t.label):t.label)})))):null));if("closed"===c)return(0,k.tZ)(On,{label:e.label},W);var Y=f?(0,k.tZ)(I.__,Object.assign({variant:"text.fontSize6",color:"text",mb:"2"},(0,a.Z)((0,a.Z)({},B),{},{htmlFor:"".concat(_.id)})),e.label):null;return(0,k.tZ)("div",{sx:{position:"relative"}},Y,W)},Ln=s.forwardRef(Fn),Vn={grow:{flex:1,flexWrap:"wrap"}};function zn(e){var t=Oe(),n=e.config,a=e.ages,o=s.useState(le()()),i=(0,v.Z)(o,1)[0];if(n.shouldDetailAges&&a.length>0){var l=Array(n.maxAge-n.minAge+1).fill(0).map((function(e,a){var o="".concat(n.minAge+a);return n.showDetailedAgeOptions?"0"===o?{value:o,label:t("cmp-booking-mask-label-infant-lap","0-1 Infant in lap")}:"1"===o?{value:o,label:t("cmp-booking-mask-label-infant-seat","0-1 Infant in seat")}:{value:o,label:o}:{value:o,label:o}}));return s.createElement(et,{gap:"1"},s.createElement(I.xv,{variant:"fontSize5"},t("cmp-label-age-".concat(n.name),"Ages ".concat(n.name))),s.createElement(qe,{alignY:"center",align:"start",gap:2,sx:Vn.grow,childrenBottomMargin:!0},a.map((function(o,r){return s.createElement("div",null,s.createElement("div",{id:"screenReaderMessage-".concat(i,"-").concat(r),hidden:!0},"".concat(t("cmp-booking-selected-age-message","Selected age")," ").concat(a[r])),s.createElement(Ln,{portal:!0,variant:"layout.listbox",ariaLabelledBy:"screenReaderMessage-".concat(i,"-").concat(r),label:t("cmp-label-age-".concat(n.name,"-select"),"Select age ".concat(n.name)),options:l,defaultValue:"".concat(o),key:r,onChange:function(t){var n;null===(n=e.onChange)||void 0===n||n.call(e,r,Number(t))},onClick:function(){var t;return null===(t=e.doNotClosePopup)||void 0===t?void 0:t.call(e)},filterContentRef:e.filterContentRef}))}))))}return null}var Hn="childrenbyadult",Gn="maxchildrenbyadult",Kn="maxchildrenbyroom",jn="maxchildren",Un="maxchildrenandinfants",Wn=function(e){var t,n,a=e.split(":"),o={rule:"",param:-1};2===a.length?(o.rule=null===(t=a[0])||void 0===t?void 0:t.toLowerCase(),o.param=Number(a[1])):a[0]&&(o.rule=null===(n=a[0])||void 0===n?void 0:n.toLowerCase(),o.param=1);return o},Yn=function(e,t){var n=e.options.findIndex((function(e){return e.name===t}));return(0,a.Z)({index:n},e.options[n])},qn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=e.map(Wn),a=Yn(t,"age1"),o=Yn(t,"age2"),i=Yn(t,"age3");return function(e,t,l){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!Number.isInteger(l))return{valid:!0,ruleActions:function(){}};var s=!0,u=function(n){n.rule===jn&&"ADD"===t&&l===o.index&&(s=s&&e.count[o.index]+1<=n.param),n.rule===Un&&("ADD"===t&&l===i.index&&(s=s&&e.count[o.index]+e.count[i.index]+1<=n.param),"ADD"===t&&l===o.index&&(s=s&&e.count[o.index]+e.count[i.index]+1<=n.param))},d=function(n){n.rule===Hn&&"ADD"===t&&l===i.index&&(s=s&&e.count[l]+1<=n.param*e.count[a.index]),n.rule===Gn&&("ADD"===t&&l===i.index&&(s=s&&e.count[o.index]+e.count[i.index]+1<=(null===n||void 0===n?void 0:n.param)*e.count[a.index]),"ADD"===t&&l===o.index&&(s=s&&e.count[o.index]+e.count[i.index]+1<=n.param*e.count[a.index])),n.rule===Kn&&("ADD"===t&&l===i.index&&(s=s&&e.count[o.index]+e.count[i.index]+1<=(null===n||void 0===n?void 0:n.param)),"ADD"===t&&l===o.index&&(s=s&&e.count[o.index]+e.count[i.index]+1<=n.param))};r?n.forEach(u):n.forEach(d);var c=function(e){n.forEach((function(n){var r=n.param;if("REMOVE"===t&&l===a.index){if(n.rule===Hn&&e.count[i.index]>e.count[a.index]*r&&e.count[i.index]-r>=0){var s=r,u=e.count[i.index]%r;0===u?e.count[i.index]-=r:(e.count[i.index]-=u,s=u);for(var d=0;d<s;d++)e.ages[i.index].pop()}if(n.rule===Gn)if(e.count[o.index]+e.count[i.index]>e.count[a.index]*r)for(var c=e.count[o.index]+e.count[i.index];c>e.count[a.index]*r;)e.count[o.index]>e.count[i.index]?e.count[o.index]>0&&(e.count[o.index]-=1,e.ages[o.index].pop()):e.count[i.index]>0&&(e.count[i.index]-=1,e.ages[i.index].pop()),c=e.count[o.index]+e.count[i.index]}}))};return{valid:s,ruleActions:c}}};function Qn(e){var t,n,a,o=null!==(t=e.options)&&void 0!==t?t:[],i=null!==(n=e.value)&&void 0!==n?n:[1],l=e.dispatch,r=null!==(a=e.layout)&&void 0!==a?a:"block",u=e.isEventValid,d=s.createElement(s.Fragment,null,e.title&&s.createElement(I.xv,{variant:"fontSize4",sx:{pb:3,width:"100%"}},e.title),o.map((function(t,n){var a,o={index:n,type:"ADD"},d={index:n,type:"REMOVE"};return!(void 0!==(a=t.show)&&!a)&&s.createElement(s.Fragment,{key:t.name},s.createElement(_n,{onAdd:function(){return l(o)},onRemove:function(){return l(d)},addButtonDisabled:!!u&&!u(o,i),removeButtonDisabled:!!u&&!u(d,i),c
1onfig:t,count:i.count[n],layout:r,preventBottomDisplacement:e.preventBottomDisplacement}),"block"===r?s.createElement(zn,{config:t,ages:i.ages[n],onChange:function(e,t){return l({type:"AGE_CHANGE",typeIndex:n,instanceIndex:e,value:t})},updateFocusAction:null===e||void 0===e?void 0:e.updateFocusAction,popoverRef:null===e||void 0===e?void 0:e.popoverRef,filterContentRef:e.filterContentRef,doNotClosePopup:e.doNotClosePopup}):null)})));return"inline"===r?s.createElement(s.Fragment,null,s.createElement(qe,{sx:{display:"inline-block"},gap:1,align:"space-between"},d),o.map((function(t,n){return s.createElement(zn,{key:t.name,config:t,ages:i.ages[n],onChange:function(e,t){l({type:"AGE_CHANGE",typeIndex:n,instanceIndex:e,value:t})},updateFocusAction:null===e||void 0===e?void 0:e.updateFocusAction,popoverRef:null===e||void 0===e?void 0:e.popoverRef,filterContentRef:e.filterContentRef,doNotClosePopup:e.doNotClosePopup})}))):s.createElement(et,{gap:1},d)}function Xn(e,t){return[Object.fromEntries(e.map((function(e,n){return[e.name,t.count[n]]}))),t.ages?Object.fromEntries(e.map((function(e,n){return[e.name,t.ages[n]]}))):[]]}function Jn(e,t){return s.useMemo((function(){return n=t,Array.isArray(n.count)?t:{count:e.map((function(e){var n;return null!==(n=t[e.name])&&void 0!==n?n:0})),ages:e.map((function(e){return Array(e.shouldDetailAges&&t[e.name]||0).fill(e.minAge)})),types:e.map((function(e){var t;return null!==(t=e.type)&&void 0!==t?t:""}))};var n}),[t,e])}var $n=(0,s.forwardRef)((function(e,t){var n,a=function(e){var t,n,a=(0,s.useState)(!1),o=(0,v.Z)(a,2),i=o[0],l=o[1],r=(0,s.useRef)(null),u=null!==(t=e.targetRef)&&void 0!==t?t:r,d=null===(n=null===e||void 0===e?void 0:e.useDelay)||void 0===n||n,c=(0,s.useCallback)((function(){return l(!0)}),[]),f=e.onClose,p=e.onOpenPopup,m=(0,s.useCallback)((function(){l(!1),null===f||void 0===f||f()}),[f]),g=(0,s.useCallback)((function(){l((function(e){return e&&(null===f||void 0===f||f()),null===p||void 0===p||p(),!e}))}),[f,p]),h=(0,s.useRef)(void 0),y=(0,s.useCallback)((function(){h.current=window.setTimeout((function(){m()}))}),[m]),b=(0,s.useCallback)((function(){clearTimeout(h.current)}),[]),D={onClick:d?function(){setTimeout((function(){return g()}),45)}:g,"aria-haspopup":e.customAccessibility?null:"true","aria-expanded":i,ref:u};return{open:c,close:m,toggle:g,isOpen:i,toggleElementProps:D,containerProps:{onBlur:y,onFocus:b},targetRef:u,setOpen:l}}(e),o=a.toggleElementProps,i=a.open,l=a.close,r=a.toggle,u=a.containerProps,d=a.isOpen,c=a.targetRef,f=a.setOpen;(0,s.useImperativeHandle)(t,(function(){return{open:i,close:l,toggle:r,setOpen:f,isOpen:d}}));var p=(0,s.cloneElement)(e.toggleElement,o),m=e.position?{position:re.Kp}:null,g=(0,s.useRef)(null),h=e.portal,y=void 0===h||h;return(0,k.tZ)("div",u,p,(0,k.tZ)(re.ZP,Object.assign({portal:y,sx:{display:d?void 0:"none",variant:null!==(n=e.variant)&&void 0!==n?n:"layout.dropdown"},tabIndex:e.tabIndex?e.tabIndex:0,targetRef:y?c:g,onKeyDown:function(e){return 27===e.keyCode&&l()}},m),(0,k.tZ)(I.Zb,{"data-testid":e.dataTestId},e.children)))})),ea=["size","viewBox","fill","rtlFlip","sx","children"];function ta(e){var t=e.size,n=e.viewBox,o=void 0===n?"0 0 1024 1024":n,i=e.fill,r=void 0===i?"currentColor":i,s=e.rtlFlip,u=void 0!==s&&s,d=e.sx,c=e.children,v=(0,l.Z)(e,ea),f=we();return(0,k.tZ)("svg",Object.assign({width:"1em",height:"1em",fill:r,viewBox:o,sx:(0,a.Z)({fontSize:t,transform:u&&"rtl"===f?"scaleX(-1)":void 0},d)},v),c)}function na(e){return s.createElement(ta,Object.assign({className:"fr-left-chevron-icon"},e),s.createElement("path",{d:"M793.869 53.224l-53.404-53.224-510.334 512 510.334 512 53.404-53.224-457.278-458.776z"}))}var aa=["children","sx"],oa=["growChildren","children","sx"];function ia(e){var t,n,a=null===(t=e.isVisible)||void 0===t||t,o=null!==(n=e.label)&&void 0!==n?n:"Filters";return Ne(a),(0,k.tZ)(me.t9,{sx:{display:a?void 0:"none",position:"fixed",top:0,left:0,variant:"layout.popup.overlay"},onDismiss:e.onDismiss,dangerouslyBypassScrollLock:!a},(0,k.tZ)(me.cZ,{"aria-label":o,sx:{variant:"layout.container",width:"100vw",height:"100vh",padding:0,margin:0,overflow:"hidden",bg:"rgba(0, 0, 0, 80%)",display:"flex",justifyContent:"center"},className:"dialogContent"},(0,k.tZ)(la,null,e.children)))}function la(e){return(0,k.tZ)(et,{sx:{width:"100%",maxWidth:"sm",minHeight:"100vh",maxHeight:"100vh",overflow:"hidden",bg:"backgroundMain",position:"relative",variant:"layout.popup.mobileFilterLayout"}},e.children)}
1function ra(e){return(0,k.tZ)(qe,{alignY:"center",bg:"backgroundSoft",pt:"2",pb:"2",px:"2",sx:{variant:"layout.popup.mobileFilterHeader"},className:"MobileHeader"},(0,k.tZ)(I.zx,{variant:"icon",onClick:e.onBackButtonPress,sx:{paddingLeft:"2",paddingRight:"2"}},(0,k.tZ)(na,{className:"fr-icon fr-rotate",size:17,sx:{stroke:"primary",strokeWidth:"100px"}})),(0,k.tZ)(Ge,{variant:"fontSize3",sx:{textAlign:"center",flex:1,color:"text"},style:e.headingStyle},e.title||""))}function sa(e){var t=e.children,n=e.sx;return(0,l.Z)(e,aa),(0,k.tZ)(I.xu,{sx:(0,a.Z)({flex:"1",overflow:"auto",variant:"layout.popup.mobileFilterBody"},n)},t)}function ua(e){var t=e.growChildren,n=e.children,o=e.sx,i=(0,l.Z)(e,oa);return(0,k.tZ)(qe,Object.assign({p:"dialogMargin",className:"MobileFooter",sx:(0,a.Z)((0,a.Z)({},t&&{">*":{flex:"1"}}),{},{boxShadow:"footer",zIndex:"5",width:"sm",maxWidth:"100%",bg:"white",position:"fixed",bottom:"0px",variant:"layout.popup.mobileFilterFooter"},o)},i),n)}function da(e){var t=e.onSave,n=void 0===t?cn:t,a=e.onReset,o=void 0===a?cn:a,i=e.onDismiss,l=void 0===i?cn:i,r=e.onOpen,u=void 0===r?cn:r,d=s.useState(!1),c=(0,v.Z)(d,2),f=c[0],p=c[1];return{isOpen:f,open:s.useCallback((function(){u(),p(!0)}),[u]),dismiss:s.useCallback((function(){l(),p(!1)}),[l]),save:s.useCallback((function(){n(),p(!1)}),[n]),reset:o}}function ca(e){var t=s.useRef(null),n=s.useRef(null),a=s.useCallback((function(){var e;return null===(e=t.current)||void 0===e?void 0:e.toggle()}),[]),o=null===e||void 0===e?void 0:e.onClose,i=s.useCallback((function(){var e;null===(e=t.current)||void 0===e||e.close(),null===o||void 0===o||o()}),[o]);return{ref:t,filterRef:n,toggle:a,close:i}}function va(e,t){var n,a,o,i,l=e.saveOnClose,r=void 0===l||l,u=e.showSeparator,d=void 0!==u&&u,c=e.disabledDoneButton,f=void 0!==c&&c,p=e.disabledClearButton,m=void 0!==p&&p,g=e.enabledClearButton,h=void 0!==g&&g,y=e.customAccessibilityToggleElement,b=void 0!==y&&y,D=e.positionRight,Z=void 0!==D&&D,C=e.ariaHiddenFooterButtons,x=void 0!==C&&C,E=e.displayFooter,S=void 0===E||E,T=e.tabIndex,O=void 0===T?0:T,w=Be();e.mobileView&&(w=!0);var A=da({onSave:e.onSave,onReset:e.onReset,onDismiss:e.onDismiss,onOpen:e.onOpen}),R=s.useState(!0),M=(0,v.Z)(R,2),_=M[0],B=M[1],N=s.useState(!1),P=(0,v.Z)(N,2),F=P[0],L=P[1],V=ca();s.useImperativeHandle(t,(function(){var e,t;return{save:A.save,reset:A.reset,dismiss:A.dismiss,isOpen:null===(e=V.ref.current)||void 0===e?void 0:e.isOpen,close:null===(t=V.ref.current)||void 0===t?void 0:t.close}}),[A.dismiss,A.reset,A.save,V.ref]);var z=w?s.cloneElement(e.toggleElement,{onClick:A.open}):e.toggleElement,H=null!==(n=e.isOpenVisible)&&void 0!==n?n:A.isOpen,G=(0,k.tZ)(s.Fragment,null,A.isOpen?null:z,H&&(0,k.tZ)("div",{onScroll:function(t){(Math.round(t.target.scrollHeight-t.target.scrollTop)===t.target.clientHeight||Math.round(t.target.scrollHeight-t.target.scrollTop)===t.target.clientHeight-1)&&e.onScroll&&e.onScroll(t)}},(0,k.tZ)(ia,{label:e.label,onDismiss:A.dismiss,isVisible:A.isOpen},(0,k.tZ)(ra,{title:null!==(a=e.title)&&void 0!==a?a:"",onBackButtonPress:function(){e.onBackButtonPress&&e.onBackButtonPress(),A.dismiss()}}),e.topElement&&(0,k.tZ)(I.xu,{p:"2"},e.topElement),(0,k.tZ)(sa,null,e.children),(0,k.tZ)(ua,{align:"end"},e.footer)))),K=e.onScroll?G:(0,k.tZ)(s.Fragment,null,z,H&&(0,k.tZ)(ia,{label:e.label,onDismiss:A.dismiss,isVisible:A.isOpen},(0,k.tZ)(ra,{title:null!==(o=e.title)&&void 0!==o?o:"",onBackButtonPress:function(){e.onBackButtonPress&&e.onBackButtonPress(),A.dismiss()}}),(0,k.tZ)(sa,null,e.children),e.footer?e.footer:S&&(0,k.tZ)(ua,{align:"end"},h&&(0,k.tZ)(I.zx,{disabled:m,variant:"text",onClick:function(){e.onClearBtn&&e.onClearBtn()}},e.labelClearBtn||"Clear"),(0,k.tZ)(I.zx,{disabled:f,variant:"text",onClick:A.save},e.labelBottomBtn||"Done"))));if(w)return K;var j=(0,k.tZ)(qe,{variant:"layout.popover.footer",gap:2,align:"end",pb:"11px"},h&&(0,k.tZ)(I.zx,{type:"button",disabled:m,variant:"text",onClick:function(){e.onClearBtn&&e.onClearBtn()},"aria-hidden":x,className:"footerButtons"},e.labelClearBtn||"Clear"),(0,k.tZ)(I.zx,{disabled:f,type:"button",variant:"text",onClick:function(){var e;r||A.save(),null===(e=V.ref.current)||void 0===e||e.close()},onFocus:function(){B(!1)},onKeyDown:function(e){return L(e.shiftKey)},onBlur:function(){var e,t;F||(null===(e=V.filterRef)||void 0===e||null===(t=e.current)||void 0===t||t.focus())},"aria-hidden":x},e.labelBottomBtn||"Done"));return(0,k.tZ)($n,{useDelay:!1,customAccessibility:b,ref:V.ref,targetRef
1:V.filterRef,toggleElement:z,portal:!1,onClose:function(){var e;null===(e=V.ref.current)||void 0===e||e.setOpen(!1),r&&A.save(),_||(setTimeout((function(){var e;return null===(e=V.filterRef.current)||void 0===e?void 0:e.focus()}),10),B(!0))},onOpenPopup:function(){e.onOpenPopup&&(B(!1),e.onOpenPopup())},variant:null!==(i=e.variant)&&void 0!==i?i:"layout.dropdown",position:Z,tabIndex:O,dataTestId:e.dataTestId},e.children,d&&(0,k.tZ)(Je,{"aria-hidden":!0}),e.enabledDoneButton&&e.footer?e.footer:j)}var fa=s.forwardRef(va),pa=["options","onChange","defaultValue"];function ma(e){var t=e.options,n=e.onChange,a=e.defaultValue,o=(0,l.Z)(e,pa),i=(0,s.useState)(a),r=(0,v.Z)(i,2),u=r[0],d=r[1];return(0,k.tZ)(et,o,t.map((function(e){return(0,k.tZ)(I.__,{variant:"text.fontSize5",key:e.name,sx:{color:"text",width:"unset",display:"inline-flex",alignItems:"center","input:focus-within ~ svg,input:hover ~ svg,input:focus-visible ~ svg":{outline:"2px solid",outlineColor:"secondary",outlineOffset:"-1px",variant:"forms.checkbox"}}},(0,k.tZ)(I.XZ,{id:e.name,name:e.name,defaultChecked:a[e.name],onChange:function(){var t=(0,de.ZP)(u,(function(t){t[e.name]=!t[e.name]}));d(t),null===n||void 0===n||n(t)}}),e.label)})))}function ga(e){return(0,k.tZ)("div",{sx:{pl:"dialogMargin",pr:"dialogMargin","& label":{fontWeight:"normal"}}},e.children)}function ha(e){var t,n=e.showSeparator,a=void 0===n||n,o=s.Children.toArray(e.children).filter((function(e){return null!==e})),i=o.length-1,l=o.map((function(e,t){var n=(0,k.tZ)(ga,{key:t.toString()},e);return t===i?n:(0,k.tZ)(s.Fragment,{key:t.toString()},n,a&&(0,k.tZ)(Je,{"aria-hidden":!0}))}));return null!==(t=(0,k.tZ)(et,{gap:"dialogMargin",pt:"dialogMargin",pb:"dialogMargin"},l))&&void 0!==t?t:null}var ya=["onChange","label","name","defaultValue"];function ba(e){var t=e.onChange,n=e.label,a=e.name,o=e.defaultValue,i=(0,l.Z)(e,ya),r=(0,s.useState)(o),u=(0,v.Z)(r,2),d=u[0],c=u[1];return(0,k.tZ)(et,i,(0,k.tZ)(I.__,{variant:"text.fontSize5",sx:{width:"unset",display:"inline-flex",alignItems:"center","input:focus-within ~ svg,input:hover ~ svg,input:focus-visible ~ svg":{outline:"2px solid",outlineColor:"secondary",outlineOffset:"-1px",variant:"forms.checkbox"}}},(0,k.tZ)(I.XZ,{defaultChecked:o,key:a,onChange:function(){c(!d),null===t||void 0===t||t(!d)}}),n))}function Da(e){return e?Object.fromEntries(e.map((function(e){return[e.name,e.defaultValue]}))):{}}function Za(e){var t,n,o,i,l,r,u,d,c={carType:e.carTypes.defaultValue,rules:Da(e.rules),hotelCategory:e.hotelCategories.defaultValue,age:e.ages.defaultValue,nationality:e.nationalities.defaultValue,excludeBasicEconomy:e.defaultExcludeBasicEconomy},f=(0,s.useState)(c),p=(0,v.Z)(f,2),m=p[0],g=p[1],h=(0,s.useState)(m),y=(0,v.Z)(h,2),b=y[0],D=y[1],Z=(0,s.useState)(!0),C=(0,v.Z)(Z,2),x=C[0],E=C[1],T=(0,s.useState)(!1),O=(0,v.Z)(T,2),w=O[0],A=O[1],R=Oe(),M={onlyNumbers:"[0-9, ]",onlyLetters:"[a-zA-Z, ]",lettersAndNumbers:"[a-zA-Z, 0-9]"},_=e.register,B=e.control,N=null===(t=null===(n=e.componentsConfigurations.promotionalCodeSelector)||void 0===n?void 0:n.enabled)||void 0===t||t,P=null!==(o=null===(i=e.componentsConfigurations.excludeBasicEconomy)||void 0===i?void 0:i.enabled)&&void 0!==o&&o,F=e.type.includes("hotel")&&(null===(l=null===(r=e.componentsConfigurations.hotelSelector)||void 0===r?void 0:r.enabled)||void 0===l||l),L=e.type.includes("car"),V=function(e){g((0,a.Z)((0,a.Z)({},m),{},(0,S.Z)({},e,""))),E(!1)},z=function(e){var t=e.target.name,n=e.target.value;g((0,a.Z)((0,a.Z)({},m),{},(0,S.Z)({},t,n))),E(!1)},H=e.getValues,G=(0,s.useMemo)((function(){var e,t=!1,n=H(["promoCode","carCompany","hotel","rules","carType","hotelCategory","age","nationality","excludeBasicEconomy"]);for(e in n)t=!(!Boolean(n[e])&&!t);return t}),[H(),w]);return(0,s.useEffect)((function(){G?(E(!1),A(!1)):w&&(E(!0),A(!1))}),[G,w]),(0,k.tZ)(fa,{title:R("cmp-booking-title-filter","Filters"),label:R("cmp-flight-advanced-title","Advanced"),enabledDoneButton:e.enabledDoneButton,labelBottomBtn:R("cmp-booking-mask-advanced-done-button","Done"),disabledDoneButton:x,saveOnClose:!0,toggleElement:(0,k.tZ)(xn,{active:G,value:R("cmp-flight-advanced-title","Advanced")}),onSave:function(){var t=e.getValues(["promoCode","carCompany","hotel","rules","carType","hotelCategory","age","nationality","excludeBasicEconomy"]);D(t),g(t),G||E(!0)},onDismiss:function(){Object.keys(b).forEach((function(t){e.setValue(t,b[t])}));var t=e.getValues(["promoCode","carCompany","hotel","rules","carType","hotelCategory","age","nationality","excludeBasicEconomy"]);g(t),A(!0)},isOpenVisible:!0},(0,k.tZ)(ha,null,N?(0,k.tZ)(ae.Qr,{name:"promoCode",control:e.control,render:function(t){var n,o=t.onChange;return(0,k.tZ)(On,{ref:_,name:"promoCode",onChange:function(e){o(e),E(!1)},defaultValue:e.getValues().promoCode,value:e.getValues().promoCode,active:Boolean(e.getValues().promoCode),label:R("cmp-flight-promo-code-label","Promo code"),placeholder:R("cmp-flight-promo-code-placeholder","Type your co
1de"),layout:"standard",onBlur:function(){var t;return null===(t=e.onPromoCodeChange)||void 0===t?void 0:t.call(e,(0,a.Z)({},H()))},rightElement:e.getValues().promoCode?(0,k.tZ)(I.zx,{variant:"icon",onClick:function(){o(null),E(!1)},type:"button","aria-label":R("cmp-booking-mask-hotel-name-clear-button","Clear")},(0,k.tZ)(En,{icon:null!==(n=e.iconClear)&&void 0!==n?n:"close",size:18,sx:{stroke:"textSoft",strokeWidth:"60px"}})):null})}}):null,F?(0,k.tZ)(On,{name:"hotel",label:R("cmp-booking-mask-hotel-name-label","Hotel Name"),placeholder:R("cmp-booking-mask-hotel-name-placeholder","Type de hotel name"),layout:"standard",defaultValue:m.hotel,onKeyPress:function(t){var n,a=null===(n=e.componentsConfigurations.hotelSelector)||void 0===n?void 0:n.maximumAmountCharacters;if(a&&m.hotel&&m.hotel.length===a)t.preventDefault();else{var o,i=null===(o=e.componentsConfigurations.hotelSelector)||void 0===o?void 0:o.allowedCharacters;if(void 0!==i&&"all"!==i){var l=new RegExp(M[i]||i);l&&!l.test(t.key)&&t.preventDefault()}}},onPaste:function(t){var n,a=null===(n=e.componentsConfigurations.hotelSelector)||void 0===n?void 0:n.maximumAmountCharacters;if(a&&t.clipboardData.getData("text").length>a)t.preventDefault();else{var o,i=null===(o=e.componentsConfigurations.hotelSelector)||void 0===o?void 0:o.allowedCharacters;if(void 0!==i&&"all"!==i){var l=t.clipboardData.getData("text");new RegExp("^".concat(M[i]||i,"+$")).test(l)||t.preventDefault()}}},ref:_,value:m.hotel,active:Boolean(m.hotel),onChange:z,rightElement:m.hotel?(0,k.tZ)(I.zx,{variant:"icon",onClick:function(){V("hotel")},type:"button","aria-label":R("cmp-booking-mask-hotel-name-clear-button","Clear")},(0,k.tZ)(En,{icon:null!==(u=e.iconClear)&&void 0!==u?u:"close",size:18,sx:{stroke:"textSoft",strokeWidth:"60px"}})):null}):null,F&&e.hotelCategories.options.length?(0,k.tZ)(ae.Qr,{as:function(t){var n=t.onChange;return(0,k.tZ)(Rn,{layout:"standard",label:R("cmp-booking-hotel-category-label","Category"),options:e.hotelCategories.options,value:m.hotelCategory,onChange:function(e){g((0,a.Z)((0,a.Z)({},m),{},{hotelCategory:e})),n(e)}})},name:"hotelCategory",control:B,defaultValue:m.hotelCategory}):null,"hotel"===e.type&&e.nationalities.options.length?(0,k.tZ)(ae.Qr,{as:function(t){var n=t.onChange;return(0,k.tZ)(Rn,{layout:"standard",label:R("cmp-booking-hotel-category-label","Nationality"),options:e.nationalities.options,value:m.nationality,onChange:function(e){g((0,a.Z)((0,a.Z)({},m),{},{nationality:e})),n(e)}})},name:"nationality",control:B,defaultValue:m.nationality}):null,L?(0,k.tZ)(On,{name:"carCompany",label:R("cmp-booking-mask-car-rental-company-label","Car rental company"),defaultValue:m.carCompany,value:m.carCompany,active:Boolean(m.carCompany),onChange:z,placeholder:R("cmp-booking-mask-car-rental-company-placeholder","Type car rental company"),layout:"standard",ref:_,rightElement:m.carCompany?(0,k.tZ)(I.zx,{variant:"icon",onClick:function(){V("carCompany")},type:"button","aria-label":R("cmp-booking-mask-hotel-name-clear-button","Clear")},(0,k.tZ)(En,{icon:null!==(d=e.iconClear)&&void 0!==d?d:"close",size:18,sx:{stroke:"textSoft",strokeWidth:"60px"}})):null}):null,"car"===e.type&&e.ages.options.length?(0,k.tZ)(ae.Qr,{name:"age",control:B,render:function(t){var n=t.onChange;return(0,k.tZ)(Rn,{label:R("cmp-booking-mask-car-age-label","Driver age"),layout:"standard",value:m.age,options:e.ages.options,onChange:function(e){g((0,a.Z)((0,a.Z)({},m),{},{age:e})),n(e)}})}}):null,e.rules.length?(0,k.tZ)(ae.Qr,{name:"rules",control:B,as:(0,k.tZ)(ma,{options:e.rules,defaultValue:m.rules,gap:2}),defaultValue:m.rules}):null,P?(0,k.tZ)(ae.Qr,{name:"excludeBasicEconomy",control:B,render:function(e){var t=e.onChange;return(0,k.tZ)(ba,{name:"excludeBasicEconomy",label:R("cmp-booking-mask-exclude-basic-economy","Show Basic Economy Fares"),defaultValue:void 0!==m.excludeBasicEconomy&&m.excludeBasicEconomy,onChange:function(e){t(e),g((0,a.Z)((0,a.Z)({},m),{},{excludeBasicEconomy:e})),E(!1)},gap:2})},defaultValue:m.excludeBasicEconomy}):null))}var Ca={menu:{overflowY:"auto",padding:0,margin:0,listStyle:"none",position:"relative"}}
1;function xa(e){var t,n,o,i,l,r,u,d,c=(0,s.useState)(!1),f=(0,v.Z)(c,2),p=f[0],m=f[1],g=(0,s.useState)(""),h=(0,v.Z)(g,2),y=h[0],b=h[1],D=(0,s.useState)(""),Z=(0,v.Z)(D,2),C=Z[0],x=Z[1],E=(0,s.useState)(void 0),T=(0,v.Z)(E,2),O=T[0],w=T[1],A=(0,s.useState)(!1),R=(0,v.Z)(A,2),M=R[0],_=R[1],B=(0,s.useState)(!1),N=(0,v.Z)(B,2),P=N[0],F=N[1],L=null!==(t=e.onChange)&&void 0!==t?t:cn,V=Oe(),z=s.useState(le()()),H=(0,v.Z)(z,1)[0],G=null!==(n=e.searchOptions)&&void 0!==n?n:{isCaseSensitive:!1,includeScore:!1,includeMatches:!1,minMatchCharLength:1,shouldSort:!0,findAllMatches:!1,keys:["iataCode","label"],location:0,threshold:0,distance:10,ignoreLocation:!1};var K=e.openOnFocus&&!y?e.options:function(e,t,n){return""===t?e:new he.Z(e,(0,a.Z)((0,a.Z)({},n),{},{getFn:function(e,t){var o=function(e,t){for(var n,o=(0,a.Z)({},e),i=null!==(n=t.keys)&&void 0!==n?n:[],l=0;l<i.length;l++){var r=i[l],s=[""];"string"===typeof r?s=r.split("."):"object"===typeof r&&"name"in r&&Boolean(r.name)&&(s="string"===typeof r.name?r.name.split("."):r.name);for(var u=o,d=0;d<s.length;d++){var c=s[d];if(void 0!==u&&void 0===(u=u[c]))if(1===s.length)o[c]="";else for(var v={},f=s.length-1;f>=0;f--){var p=s[f];f===s.length-1?v[p]="":0===f?o[p]=v:v=(0,S.Z)({},p,v)}}}return o}(e,n),i=he.Z.config.getFn(o,t);return ye.remove(i)}})).search(t).map((function(e){return e.item}))}(e.options,y,G),j=e.itemHeight||40,U=s.useRef(null),W=Be(),Y=s.useRef(null),q=s.useRef(null),Q=(0,ge.o)({size:K.length,parentRef:U,overscan:2}),X=(0,oe.Kb)({items:K,stateReducer:function(t,n){var o=n.type,i=n.changes;switch(o){case oe.Kb.stateChangeTypes.FunctionReset:case oe.Kb.stateChangeTypes.InputBlur:return(0,a.Z)((0,a.Z)({},i),{},{isOpen:W&&!e.disabled?!Ee:i.isOpen},i.selectedItem?{inputValue:i.selectedItem.label}:{inputValue:""});case oe.Kb.stateChangeTypes.ItemClick:case oe.Kb.stateChangeTypes.InputKeyDownEnter:return(0,a.Z)((0,a.Z)({},i),i.selectedItem?{inputValue:i.selectedItem.label}:{inputValue:""});default:return i}},inputValue:y,itemToString:function(e){return(null===e||void 0===e?void 0:e.label)||""},onInputValueChange:function(e){var t=e.inputValue;b(void 0===t?"":t)},onSelectedItemChange:function(t){var n=t.selectedItem;m(!0),null!==n&&_(!1),W?null===e||void 0===e||!e.isPrepopulatedValue||null!==e&&void 0!==e&&e.wasSetedPrepopulatedValue||null===e||void 0===e||!e.setWasSetedPrepopulatedValue||(L(null!==n&&void 0!==n?n:{label:"",value:""}),null===e||void 0===e||e.setWasSetedPrepopulatedValue(!0)):L(null!==n&&void 0!==n?n:{label:"",value:""})},scrollIntoView:function(){},onHighlightedIndexChange:function(e){var t=e.highlightedIndex;void 0!==t&&Q.scrollToIndex(t)},getA11yStatusMessage:function(){var t=K.length;return ie&&(!e.minCharactersCountToOpen||y.length>=e.minCharactersCountToOpen||e.openOnFocus)&&ne<0?e.openOnFocus&&y.length>1||e.minCharactersCountToOpen&&y.length>=e.minCharactersCountToOpen+1?t>0?V("cmp-vertical-booking-a11y-status-message-without-combobox-status","{itemsAmount} results are available, use up and down arrows to navigate. Press enter key to select",{itemsAmount:t}):V("cmp-vertical-booking-a11y-no-result-message","No results to show. Type a valid city or airport"):V("cmp-vertical-booking-a11y-status-message","Combobox expanded {itemsAmount} results are available, use up and down arrows to navigate. Press enter key to select",{itemsAmount:t}):Ce&&(null!==ae&&y!==ae.label&&y.length<1||(null===ae||void 0===ae?void 0:ae.label)===y)?V("cmp-combobox-collapsed-message","Combobox collapsed"):""}}),J=X.getInputProps,$=X.getItemProps,ee=X.getLabelProps,te=X.getMenuProps,ne=X.highlightedIndex,ae=X.selectedItem,ie=X.isOpen,re=X.getToggleButtonProps,se=X.openMenu,de=X.reset,ce=X.selectItem,ve=X.closeMenu,fe=X.setInputValue;function pe(){var e;(de(),W)||(L({label:"",value:""}),Y&&(null===(e=Y.current)||void 0===e||e.focus()))}(0,s.useEffect)((function(){e.resetInputValue&&(fe(""),b(""),de(),ve())}),[fe,ve,e.resetInputValue,de]),(0,s.useEffect)((function(){if(!p&&!y&&e.defaultValue){var t=e.options.find((function(t){return t.value===e.defaultValue}));t&&ce(t)}}),[p,y,e.defaultValue,e.options,ce]),(0,s.useEffect)((function(){e.disabled&&pe()}),[e.disabled]);var me=J({onFocus:function(){W||ie||!e.openOnFocus||y||se()},type:"text",placeholder:e.placeholder,"aria-invalid":e.hasError,ref:Y,onClick:function(){se()}});me["aria-describedby"]="screenReaderMessageComboboxState-".concat(H);var be=e.errorMessage&&s.cloneElement(e.errorMessage,{id:"screenReaderMessageComboboxState-".concat(H)}
1),De=(0,s.useState)(!1),Ze=(0,v.Z)(De,2),Ce=Ze[0],xe=Ze[1],Ie=(0,s.useState)(!1),ke=(0,v.Z)(Ie,2),Ee=ke[0],Se=ke[1];s.useEffect((function(){Ee||Se(ie)}),[ie]),s.useEffect((function(){var e;W&&Ee&&(M||(x(y),w(ae)),O&&y&&O.label===y&&ce(O),F(!1),Y&&(null===Y||void 0===Y||null===(e=Y.current)||void 0===e||e.focus()))}),[Ee]);var Te=(0,k.tZ)("div",{sx:Ee&&W?{variant:"layout.containerInputStyles"}:{}},(0,k.tZ)(ue.T,{"aria-live":"polite"},"".concat(y?"":null!==(o=e.descriptionIconCloseAction)&&void 0!==o?o:V("cmp-combobox-value-cleared","Location cleared"))),(0,k.tZ)(qe,{alignY:"center","data-disabled":e.disabled?"":void 0,"data-error":e.hasError?"":void 0,"data-active":e.active?"":void 0,sx:{variant:"layout.layoutStylesClosed"}},(0,k.tZ)(et,{sx:{flex:"1"}},(0,k.tZ)(I.__,(0,a.Z)((0,a.Z)({},ee()),{},{htmlFor:"".concat(me.id,"-").concat(H)}),e.label),(0,k.tZ)("div",{"aria-expanded":!(""===y&&!ie)&&void 0,role:""!==y||ie?void 0:"combobox"},(0,k.tZ)("input",Object.assign({disabled:e.disabled,sx:{variant:"layout.inputStyles"}},me,{id:"".concat(me.id,"-").concat(H),onFocus:function(){me.onFocus(),xe(!0)},onBlur:function(e){var t;null===(t=me.onBlur)||void 0===t||t.call(me,e),xe(!1)},onKeyDown:function(t){var n;null===(n=me.onKeyDown)||void 0===n||n.call(me,t),null!==e&&void 0!==e&&e.onKeyDown&&(null===e||void 0===e||e.onKeyDown(t))}})))),!y&&!e.minCharactersCountToOpen&&(0,k.tZ)(I.zx,Object.assign({disabled:e.disabled,variant:"icon",type:"button"},re(),{tabIndex:0,"aria-label":null!==(i=e.ariaLabelIconToggle)&&void 0!==i?i:"Toggle view"}),(0,k.tZ)(En,{icon:ie?null!==(l=e.rightIconOpen)&&void 0!==l?l:"up-arrow-fill":null!==(r=e.rightIcon)&&void 0!==r?r:"down-arrow-fill",size:18})),y&&(0,k.tZ)(I.zx,{disabled:e.disabled,variant:"icon",onClick:W?function(){var e;(x(y),w(ae),pe(),Y)&&(null===(e=Y.current)||void 0===e||e.focus());_(!0)}:y?pe:se,type:"button","aria-label":null!==(u=e.ariaLabelIconClose)&&void 0!==u?u:"Clear"},(0,k.tZ)(En,{icon:null!==(d=e.iconClose)&&void 0!==d?d:"close",size:18,sx:{stroke:"textSoft",strokeWidth:"60px"}})))),we=(0,k.tZ)(s.Fragment,null,(0,k.tZ)(qe,{align:"end",sx:{flex:"1"}},(0,k.tZ)(I.zx,{disabled:""===y,variant:"text",onClick:function(){var e;(pe(),q)&&(null===(e=q.current)||void 0===e||e.focus());_(!0)},type:"button","data-testId":"buttonFooterClear"},V("cmp-booking-location-selector-clear-label","Clear")),(0,k.tZ)(I.zx,{variant:"text","data-testId":"buttonFooterDone",type:"button",disabled:""===y&&!M,ref:q,onClick:function(){ie&&ve(),x(y),w(ae),L(null!==ae&&void 0!==ae?ae:{label:"",value:""}),F(!0),M||Se(!1),_(!1)}},V("cmp-booking-location-selector-done-label","Done")))),Ae=W?ia:s.Fragment,Re=s.useState(-1),Me=(0,v.Z)(Re,2),_e=Me[0],Ne=Me[1];s.useEffect((function(){-1!==ne&&Ne(ne)}),[ne]),s.useEffect((function(){Ne(-1)}),[ie]);var Pe=(0,k.tZ)("div",{style:{position:W?void 0:"absolute",width:"100%",zIndex:10}},(0,k.tZ)("ul",Object.assign({},te({ref:U,style:Ca.menu}),{sx:(0,a.Z)({variant:W?"menus.mobile":"menus.default"},W&&{width:"100%",height:"100%",maxHeight:"100%",boxShadow:"none"})}),0===Q.virtualItems.length&&(0,k.tZ)("li",{sx:{variant:ie&&W?"menuItems.mobileNoResult":"menuItems.default"},style:{height:"60px"}},V("cmp-location-noresult","No result to show")),(0,k.tZ)("div",{sx:{variant:W?"menuItems.mobileContainer":"menuItems.defaultContainer",height:"".concat(Q.totalSize,"px")}},Q.virtualItems.map((function(e,t){return(0,k.tZ)("li",Object.assign({key:K[e.index].value,"data-item-selected":!(!ae||ae!==K[e.index])||void 0,"data-item-first":!ae&&0===t&&-1===ne&&-1===_e||void 0,"data-last-item-hover":!ae&&-1===ne&&-1!==_e&&t===_e||void 0,"data-item-highlighted":ne===e.index||void 0,sx:{variant:ie&&W?"menuItems.mobile":"menuItems.default"},style:{position:"absolute",top:0,left:0,marginTop:"0",marginBottom:"0",padding:"10px",minHeight:"".concat(j,"px"),width:"100%",transform:"translateY(".concat(e.start,"px)")}},$({index:e.index,item:K[e.index]}),{ref:e.measureRef}),K[e.index].label)})))));return(0,k.tZ)(et,{gap:1,sx:e.sx,className:e.className},W&&!ie&&Te,W&&ie&&(0,k.tZ)(On,{placeholder:e.placeholder,label:e.label}),(0,k.tZ)(Ae,Object.assign({label:"Filters"},W&&{isVisible:W?Ee:ie}),W?(0,k.tZ)(ra,{onBackButtonPress:function(){ie&&ve(),ce(O),P||b(C),F(!1),Se(!1),_(!1)},title:e.title}):null,(0,k.tZ)(I.xu,{id:"fr-combobox-container",p:W?2:0,sx:{position:"relative",flex:"1",variant:W?"layout.popup.mobileFilterBody":void 0}},(!W||ie||Ee)&&Te,ie&&(null===e||void 0===e||!e.minCharactersCountToOpen||y.length>=(null===e||void 0===e?void 0:e.minCharactersCountToOpen)||e.openOnFocus)&&Pe),W?(0,k.tZ)(ua,{align:"end"},we):null),e.hasError&&!e.disabled?be:null)}var Ia=["label"];function ka(e){var t=e.label,n=(0,l.Z)(e,Ia);return(0,k.tZ)(I.__,{variant:"text.fontSize5",sx:{color:"text",width:"unset",display:"inline-flex",alignItems:"center","input:focus ~ svg":{boxShadow:"focus"}}},(0,k.tZ)(I.XZ,n),t)}var Ea=["children"],Sa={dateFormat:"MM/DD/YYYY",focusedDate:null,selectPhase:null,isDateFocused:vn,isDateSelected:vn,isDateHovered:vn,isDateBlocked:v
1n,isFirstOrLastSelectedDate:vn,onDateFocus:cn,onDateHover:cn,onDateSelect:cn,isStartDate:vn,isEndDate:vn,getMinimumEnabledDate:function(){return new Date}},Ta=s.createContext(Sa),Oa=function(e){var t=e.children,n=(0,l.Z)(e,Ea),a=s.useMemo((function(){return{dateFormat:n.dateFormat,focusedDate:n.focusedDate,selectPhase:n.selectPhase,isDateSelected:n.isDateSelected,isDateHovered:n.isDateHovered,isFirstOrLastSelectedDate:n.isFirstOrLastSelectedDate,isDateBlocked:n.isDateBlocked,isDateFocused:n.isDateFocused,onDateHover:n.onDateHover,onDateSelect:n.onDateSelect,onDateFocus:n.onDateFocus,isStartDate:n.isStartDate,isEndDate:n.isEndDate,getMinimumEnabledDate:n.getMinimumEnabledDate}}),[n.dateFormat,n.focusedDate,n.selectPhase,n.isDateSelected,n.isDateHovered,n.isFirstOrLastSelectedDate,n.isDateBlocked,n.isDateFocused,n.onDateHover,n.onDateSelect,n.onDateFocus,n.isStartDate,n.isEndDate,n.getMinimumEnabledDate]);return s.createElement(Ta.Provider,{value:a},t)},wa={},Aa=(0,s.createContext)(wa),Ra=function(){return(0,s.useContext)(Aa)},Ma=["Su","Mo","Tu","We","Th","Fr","Sa"],_a=function(e){return Ma[(0,_.Z)(e)]},Ba=function(e){return(0,M.Z)(e,"dd")};var Na=["January","February","March","April","May","June","July","August","September","October","November","December"],Pa=function(e){return Na[(0,V.Z)(e)]+(0,M.Z)(e," yyyy")},Fa=function(e){return Na[(0,V.Z)(e)]};function La(e){var t=e.year,n=e.month,a=e.firstDayOfWeek,o=void 0===a?1:a,i=e.dayLabelFormat,l=e.weekdayLabelFormat,r=e.monthLabelFormat,u=void 0===r?Pa:r;return{days:(0,s.useMemo)((function(){return function(e){var t=e.year,n=e.month,a=e.firstDayOfWeek,o=void 0===a?1:a,i=e.dayLabelFormat,l=void 0===i?Ba:i,r=new Date(t,n),s=(0,F.Z)(r),u=(0,_.Z)(s),d=(0,L.Z)(r),v=Array.from(Array(u>=o?u-o:6-o+u+1).keys()).fill(0),f=(0,B.Z)({start:s,end:d}).map((function(e){return{date:e,dayLabel:l(e)}}));return[].concat((0,c.Z)(v),(0,c.Z)(f))}({year:t,month:n,firstDayOfWeek:o,dayLabelFormat:i})}),[t,n,o,i]),weekdayLabels:(0,s.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.firstDayOfWeek,n=void 0===t?1:t,a=e.weekdayLabelFormat,o=void 0===a?_a:a,i=new Date;return(0,B.Z)({start:(0,A.Z)((0,N.Z)(i),n),end:(0,A.Z)((0,P.Z)(i),n)}).reduce((function(e,t){return e.push(o(t)),e}),[])}({firstDayOfWeek:o,weekdayLabelFormat:l})}),[o,l]),monthLabel:u(new Date(t,n))}}var Va=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return e.some((function(e){return(0,z.Z)(t,e)}))};function za(e){var t=(0,F.Z)(e);return{year:(0,j.Z)(t),month:(0,V.Z)(t),date:t}}function Ha(e,t,n){var a=za(t||(0,R.Z)());return n&&function(e,t){return null===t||void 0===t?void 0:t.some((function(t){return t.month===e.month}))}(a,n)?n:function(e,t){var n=t.date,a=[t];return e>1&&(a=Array.from(Array(e-1).keys()).reduce((function(e){return n=(0,U.Z)(e[e.length-1].date,1),e.concat([za(n)])}),a)),a}(e,a)}function Ga(e,t,n,a){var o=e[a?n>0?0:e.length-a:n>0?e.length-1:0].date;return Array.from(Array(t).keys()).reduce((function(e){return o=0===e.length?(0,U.Z)(o,n):(0,U.Z)(o,n>=0?1:-1),n>0?e.concat([za(o)]):[za(o)].concat(e)}),[])}function Ka(e){var t=e.startDate,n=e.endDate,a=e.isDateBlocked,o=e.minBookingDays,i=e.exactMinBookingDays,l=e.minBookingDate,r=e.maxBookingDate,s=e.blackoutDatesIntegration,u=void 0!==s&&s,d=!l||!(0,G.Z)(t,(0,A.Z)(l,-1)),c=!r||!(0,K.Z)((0,A.Z)(t,o-1),r);if(u&&t&&n)return!0;if(t&&1===o&&!n&&!a(t))return!0;if(t&&o>1&&!n&&!i||t&&o>0&&i&&d&&c||t&&o>0&&i&&!l&&!r)return!(0,B.Z)({start:t,end:(0,A.Z)(t,o-1)}).some((function(e){return a(e)}));if(!t&&o>1&&n&&!i||!t&&n&&o>0&&i&&d&&c||!t&&n&&o>0&&i&&!l&&!r)return!(0,B.Z)({start:(0,A.Z)(n,1-o),end:n}).some((function(e){return a(e)}));if(t&&n&&!i){var v=(0,A.Z)(t,o-1);return!(0,G.Z)(n,v)&&!(0,B.Z)({start:t,end:n}).some((function(e){return a(e)}))}return!1}var ja=function(e){var t,n,a,o=e.date,i=e.minDate,l=e.maxDate,r=e.validDaysOfWeek,s=e.includedDates,u=e.excludedDates,d=e.formatFn,c=(0,W.Z)(i),v=(0,W.Z)(l);if(r&&(t=function(e,t){return e.some((function(e){return e.toLocaleUpperCase()===(0,Y.Z)(t,"eeee").toLocaleUpperCase()}))}(r,o)),s&&(n=function(e,t){return e.some((function(e){return e===t}))}
1(s,d(o,"YYYY-MM-DD"))),u&&(a=function(e,t,n){for(var a=0;a<e.length;a++){var o=e[a];if("string"===typeof o){if(n(t,"YYYY-MM-DD")===o)return!0}else if(null!==o&&void 0!==o&&o.start&&null!==o&&void 0!==o&&o.end){var i=(0,W.Z)(null===o||void 0===o?void 0:o.start),l=(0,W.Z)(null===o||void 0===o?void 0:o.end);if((0,z.Z)(t,i)||(0,z.Z)(t,l)||(0,G.Z)(t,l)&&(0,K.Z)(t,i))return!0}}return!1}(u,o,d)),!function(e,t,n){return(0,z.Z)(e,t)||(0,z.Z)(e,n)||(0,K.Z)(e,t)&&(0,G.Z)(e,n)}(o,c,v))return r?s?!t||(!n||!t):!t:!s||!n;if(r){if(u){if(!t||a)return!0}else if(!t)return!0;return!1}return!!u&&!!a},Ua=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;if(e)if(n===Ya){if(null!==e&&void 0!==e&&e.departure){var o=null===e||void 0===e?void 0:e.departure,i=o.minDate,l=o.maxDate,r=o.validDaysOfWeek,s=o.includedDates,u=o.excludedDates;return ja({date:t,minDate:i,maxDate:l,validDaysOfWeek:r,includedDates:s,excludedDates:u,formatFn:a})}}else if(n===qa&&null!==e&&void 0!==e&&e.return){var d=null===e||void 0===e?void 0:e.return,c=d.minDate,v=d.maxDate,f=d.validDaysOfWeek,p=d.includedDates,m=d.excludedDates;return ja({date:t,minDate:c,maxDate:v,validDaysOfWeek:f,includedDates:p,excludedDates:m,formatFn:a})}return!1};function Wa(e,t){switch(t.type){case"SET_ACTIVE_MONTHS":return(0,a.Z)((0,a.Z)({},e),{},{activeMonths:t.payload});case"SET_HOVERED_DATE":return(0,a.Z)((0,a.Z)({},e),{},{hoveredDate:t.payload});case"SET_FOCUSED_DATE":return(0,a.Z)((0,a.Z)({},e),{},{focusedDate:t.payload});case"GO_TO_PREVIOUS_MONTHS":return(0,a.Z)((0,a.Z)({},e),{},{activeMonths:Ga(e.activeMonths,t.payload.numberOfMonths,-1),focusedDate:null});case"GO_TO_PREVIOUS_MONTHS_BY_ONE":return(0,a.Z)((0,a.Z)({},e),{},{activeMonths:Ga(e.activeMonths,t.payload.numberOfMonths,-1,1),focusedDate:null});case"GO_TO_NEXT_MONTHS":return(0,a.Z)((0,a.Z)({},e),{},{activeMonths:Ga(e.activeMonths,t.payload.numberOfMonths,1),focusedDate:null});case"GO_TO_NEXT_MONTHS_BY_ONE":return(0,a.Z)((0,a.Z)({},e),{},{activeMonths:Ga(e.activeMonths,t.payload.numberOfMonths,1,1),focusedDate:null});case"GO_TO_DATE":return(0,a.Z)((0,a.Z)({},e),{},{activeMonths:Ha(t.payload.numberOfMonths,t.payload.date),focusedDate:null});case"GO_TO_PREVIOUS_YEAR":var n=t.payload.numYears||1;return(0,a.Z)((0,a.Z)({},e),{},{activeMonths:Ga(e.activeMonths,t.payload.numberOfMonths,-(12*n-t.payload.numberOfMonths+1)),focusedDate:null});case"GO_TO_NEXT_YEAR":var o=t.payload.numYears||1;return(0,a.Z)((0,a.Z)({},e),{},{activeMonths:Ga(e.activeMonths,t.payload.numberOfMonths,12*o-t.payload.numberOfMonths+1),focusedDate:null});case"FOCUS_DATE_WITH_MONTHS_UPDATE":return(0,a.Z)((0,a.Z)({},e),{},{focusedDate:t.payload.date,activeMonths:Ha(t.payload.numberOfMonths,t.payload.date,t.payload.currentActiveMonths)});case"CLEAR_FOCUS_AND_HOVER":return(0,a.Z)((0,a.Z)({},e),{},{focusedDate:null,hoveredDate:null});default:return e}}var Ya="startDate",qa="endDate";function Qa(e){var t=e.startDate,n=e.endDate,a=e.focusedInput,o=e.selectPhase,i=e.minBookingDate,l=e.maxBookingDate,r=e.onDatesChange,u=e.initialVisibleMonth,d=e.exactMinBookingDays,c=void 0!==d&&d,f=e.minBookingDays,p=void 0===f?1:f,m=e.numberOfMonths,g=void 0===m?2:m,h=e.firstDayOfWeek,y=void 0===h?1:h,b=e.isDateBlocked,D=void 0===b?function(){return!1}:b,Z=e.unavailableDates,C=void 0===Z?[]:Z,x=e.fetchUnavailableDates,I=void 0===x?null:x,k=e.blackoutDatesIntegration,E=void 0!==k&&k,S=(0,s.useReducer)(Wa,function(e,t,n){return{activeMonths:Ha(e,t||n||null),hoveredDate:null,focusedDate:t}}(g,t,u)),T=(0,v.Z)(S,2),O=T[0],w=T[1],R=Ra().format,M=void 0===R?yn:R,_=O.activeMonths,N=O.hoveredDate,P=O.focusedDate,F=function(e){return Va(C,e)||D(e)||Ua(I,e,o,M)},L=function(e){return function(e){var t=e.date,n=e.minBookingDate,a=e.maxBookingDate,o=e.isDateBlockedFn,i=e.startDate,l=e.endDate,r=e.minBookingDays,s=void 0===r?1:r,u=e.unavailableDates,d=void 0===u?[]:u,c=n?new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0):n,v=a?new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0):a,f=i&&(!l||(0,z.Z)(i,l))&&s>1&&(0,H.Z)(t,{start:(0,A.Z)(i,1),end:(0,A.Z)(i,s-2)}),p=l&&!i&&s>1&&(0,H.Z)(t,{start:(0,A.Z)(l,2-s),end:(0,A.Z)(l,-1)}),m=l&&i&&s>1&&(0,H.Z)(t,{start:(0,A.Z)(i,1),end:(0,A.Z)(i,s-2)});return!!(Va(d,t)||c&&(0,G.Z)(t,c)||v&&(0,K.Z)(t,v)||f||p||m||o&&o(t))}({date:e,minBookingDate:i,maxBookingDate:l,startDate:t,endDate:n,minBookingDays:p,isDateBlockedFn:F})};return{firstDayOfWeek:y,activeMonths:_,isDateSelected:function(e){return function(e,t,n){return!(!t||!n)&&(0,H.Z)(e,{start:t,end:n})}
1(e,t,n)},isDateHovered:function(e){return function(e){var t=e.date,n=e.startDate,a=e.endDate,o=e.isDateBlocked,i=e.hoveredDate,l=e.minBookingDays,r=e.exactMinBookingDays;return i&&l>1&&r&&(0,H.Z)(t,{start:i,end:(0,A.Z)(i,l-1)})?!(0,B.Z)({start:i,end:(0,A.Z)(i,l-1)}).some((function(e){return o(e)})):!(n&&!a&&i&&(0,H.Z)(t,{start:n,end:(0,A.Z)(n,l-1)})&&!(0,z.Z)(n,i)&&l>1)&&(n&&!a&&i&&(0,H.Z)(t,{start:n,end:(0,A.Z)(n,l-1)})&&(0,z.Z)(n,i)&&l>1?!(0,B.Z)({start:n,end:(0,A.Z)(n,l-1)}).some((function(e){return o(e)})):!(!n||a||!i||(0,G.Z)(i,n)||!(0,H.Z)(t,{start:n,end:i}))&&!(0,B.Z)({start:n,end:i}).some((function(e){return o(e)})))}({date:e,hoveredDate:N,startDate:t,endDate:n,minBookingDays:p,exactMinBookingDays:c,isDateBlocked:F})},isFirstOrLastSelectedDate:function(e){return function(e,t,n){return!!(t&&(0,z.Z)(e,t)||n&&(0,z.Z)(e,n))}(e,t,n)},isStartDate:function(e){return function(e,t){return!(!t||!(0,z.Z)(e,t))}(e,t)},isEndDate:function(e){return function(e,t){return!(!t||!(0,z.Z)(e,t))}(e,n)},isDateBlocked:L,numberOfMonths:g,isDateFocused:function(e){return!!P&&((0,z.Z)(e,P)&&!F(e))},focusedDate:P,hoveredDate:N,onResetDates:function(){r({startDate:null,endDate:null,focusedInput:Ya,selectPhase:Ya})},resetDatesKeepingFocus:function(){r({startDate:null,endDate:null,focusedInput:a,selectPhase:Ya})},onDateHover:function(e){if(e){if(e){var a=!L(e)||t&&(0,z.Z)(e,t),o=!i||!(0,G.Z)(e,(0,A.Z)(i,-1)),r=!l||!(0,K.Z)(e,l),s=(0,A.Z)(e,p-1),u=!i||!(0,G.Z)(s,i),d=!l||!(0,K.Z)(s,l),v=c&&p>1&&o&&r&&u&&d,f=t&&!n&&!c&&o&&r,m=!(p>1&&t)||(0,H.Z)(e,{start:t,end:(0,A.Z)(t,p-2)}),g=t&&(0,z.Z)(e,t)&&m;a&&(v||f||g)?w({type:"SET_HOVERED_DATE",payload:e}):null!==N&&w({type:"SET_HOVERED_DATE",payload:null})}}else w({type:"SET_HOVERED_DATE",payload:null})},onDateSelect:function(e){var s=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];(o===qa||o===Ya)&&p>0&&c&&Ka({minBookingDays:p,exactMinBookingDays:c,minBookingDate:i,maxBookingDate:l,isDateBlocked:F,startDate:e,endDate:null,blackoutDatesIntegration:E})?r({startDate:e,endDate:(0,A.Z)(e,p-1),focusedInput:s?null:a,selectPhase:null}):(o===qa&&t&&(0,G.Z)(e,t)||o===Ya&&n&&(0,K.Z)(e,n))&&!c&&Ka({minBookingDays:p,isDateBlocked:F,startDate:e,endDate:null,blackoutDatesIntegration:E})?r({endDate:null,startDate:e,focusedInput:s?qa:a,selectPhase:qa}):o===Ya&&!c&&Ka({minBookingDays:p,isDateBlocked:F,endDate:n,startDate:e,blackoutDatesIntegration:E})?r({endDate:n,startDate:e,focusedInput:s?qa:a,selectPhase:qa}):o===Ya&&!c&&Ka({minBookingDays:p,isDateBlocked:F,endDate:null,startDate:e,blackoutDatesIntegration:E})?r({endDate:null,startDate:e,focusedInput:s?qa:a,selectPhase:qa}):o===qa&&t&&!(0,G.Z)(e,t)&&!c&&Ka({minBookingDays:p,isDateBlocked:F,startDate:t,endDate:e,blackoutDatesIntegration:E})?r({startDate:t,endDate:e,focusedInput:s?null:a,selectPhase:null}):o!==qa||t||c||r({startDate:null,endDate:e,focusedInput:s?null:a,selectPhase:Ya})},onDateFocus:function(e){!P||P&&!(0,q.Z)(e,P)?w({type:"FOCUS_DATE_WITH_MONTHS_UPDATE",payload:{date:e,numberOfMonths:g,currentActiveMonths:_}}):w({type:"SET_FOCUSED_DATE",payload:e})},goToPreviousMonths:function(){w({type:"GO_TO_PREVIOUS_MONTHS",payload:{numberOfMonths:g}})},goToPreviousMonthsByOneMonth:function(){w({type:"GO_TO_PREVIOUS_MONTHS_BY_ONE",payload:{numberOfMonths:g}})},goToNextMonths:function(){w({type:"GO_TO_NEXT_MONTHS",payload:{numberOfMonths:g}})},goToNextMonthsByOneMonth:function(){w({type:"GO_TO_NEXT_MONTHS_BY_ONE",payload:{numberOfMonths:g}})},goToDate:function(e){w({type:"GO_TO_DATE",payload:{date:e,numberOfMonths:g}})},goToPreviousYear:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;w({type:"GO_TO_PREVIOUS_YEAR",payload:{numberOfMonths:g,numYears:e}})},goToNextYear:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;w({type:"GO_TO_NEXT_YEAR",payload:{numberOfMonths:g,numYears:e}})},getMinimumEnabledDate:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e;L(n)&&i&&(0,K.Z)(n,i)&&l&&(0,G.Z)(n,l);)n=(0,A.Z)(n,t);return i&&(0,G.Z)(n,i)?i:l&&(0,K.Z)(n,l)?l:n},dispatch:w}}var Xa=13,Ja=32;function $a(e,t){var n=new Date(e.getFullYear(),e.getMonth(),1,12);if(t)for(;!t(n);)n=(0,A.Z)(n,1);return n}var eo=function(e,t){var n=(0,X.Z)(e,1),a=function(e){return(0,L.Z)(e)}(n);if(t(a)){for(;!t(n)&&!(0,z.Z)(a,n);)n=(0,A.Z)(n,1);return n}return e};function to(e){var t=e.date,n=e.focusedDate,a=e.isDateSelected,o=e.isDateFocused,i=e.isFirstOrLastSelectedDate,l=e.isDateHovered,r=e.isDateBlocked,u=e.onDateSelect,d=e.onDateFocus,c=e.onDateHover,v=e.setIsDayFocused,f=e.blackoutDatesIntegration,p=void 0!==f&&f,m=e.fetchBlackoutDates,g=void 0===m?{}:m,h=e.focusedInput,y=void 0===h?"":h,b=e.getMinimumEnabledDate,D=void 0===b?function(e){return new Date}:b,Z=Ra().format,C=void 0===Z?yn:Z,x=(0,s.useCallback)((function(){return u(t)}),[t,u]),I=(0,s.useCallback)((function(){c(t)}),[t,c]),k=r(t)&&!l(t),E=(0,s.useCallback)((function(e){switch(e.keyCode){case 39:e.preventDefault();var n=(0,A.Z)(t,1);if(r(n)||l(n)){var a=D(n);d(a),null===v||void 0===v||v((0,z.Z)(a,t))}else d(n),null===v||void 0===v||v((0,z.Z)(n,t));break;case 37:e.preventDefault();var o=(0,A.Z)(t,-1);if(r(o)||l(o)){var i=D(o,-1);d(i),null===v||void 0===v||v((0,z.Z)(i,t))}else d(o),null===v||void 0===v||v((0,z.Z)(o,t));break;case 38:e.preventDefault();var s=(0,A.Z)(t,-7);if(r(s)||l(s)){var c=D(s,-1);d(c),null===v||void 0===v||v((0,z.Z)(c,t))}else d(s),null===v||void 0===v||v((0,z.Z)(s,t));break;case 40:e.preventDefault();var f=(0,A.Z)(t,7);if(r(f)||l(f)){var p=D(f);d(p),null===v||void 0===v||v((0,z.Z)(p,t))}else d(f),null===v||void 0===v||v((0,z.Z)(f,t));break;case 34:e.preventDefault();var m=function(e,t){var n=(0,U.Z)(e,1),a=$a(n);if(t(a)){for(;!t(n)&&!(0,z.Z)(a,n);)n=(0,Q.Z)(n,1);return n}return e}(t,(function(e){return!r(e)||l(e)}));r(m)||l(m)||(d(m),null===v||void 0===v||v((0,z.Z)(m,t)));break;case 33:e.preventDefault();var g=eo(t,(function(e){return!r(e)||l(e)}));r(g)||l(g)||(d(g),null===v||void 0===v||v((0,z.Z)(g,t)));break;case Xa:case Ja:e.preventDefault(),u(t)}}),[t,r,l,d,u,v]);return{tabIndex:null===n||o(t)?0:-1,isSelected:a(t),isSelectedStartOrEnd:i(t),isSelectedStartOrEndAndBlackout:!!p&&(Ua(g,t,y,
1C)&&i(t)),isAMiddleAndBlackout:!!p&&(Ua(g,t,y,C)&&a(t)&&!i(t)),isWithinHoverRange:l(t),disabledDate:k,onKeyDown:E,onClick:k?function(){}:x,onMouseEnter:I}}var no=["january","february","march","april","may","june","july","august","september","october","november","december"],ao=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],oo=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},io=function(e,t,n,a,o){var i=e[t]?e[t].charAt(0).toUpperCase()+e[t].substring(1):o,l=n(a,i);return l||i},lo=function(e,t,n,a,o){var i=e[t]?e[t].charAt(0).toUpperCase()+e[t].substring(1):o,l=n(a,i);return l||i},ro=function(e,t){var n=[];return t&&t._months&&Array.isArray(t._months)?n=t._months:t&&t._months&&t._months.standalone&&Array.isArray(t._months.standalone)&&(n=t._months.standalone),no.map((function(t,a){return io(n,a,e,"month-".concat(t),oo(t))}))},so=function(e,t){var n=[];t&&("function"===typeof t._monthsShort?n=t._monthsShort():t._monthsShort&&(n=t._monthsShort),"function"===typeof t.monthsShort?n=t.monthsShort():t.monthsShort&&(n=t.monthsShort));var a=[];return n&&Array.isArray(n)?a=n:n&&n.standalone&&Array.isArray(n.standalone)&&(a=n.standalone),no.map((function(t,n){return io(a,n,e,"month-short-".concat(t),oo(t.substr(0,3)))}))},uo=function(e,t){var n=t?t._weekdaysMin:[];return ao.map((function(t,a){return function(e,t,n,a,o){var i=e[t]?e[t].charAt(0).toUpperCase():o;return n(a,i)||i}(n,a,e,"day-one-letter-".concat(t),oo(t.substr(0,1)))}))},co=function(e,t){var n=t?t._weekdaysMin:[];return ao.map((function(t,a){return function(e,t,n,a,o){var i=e[t]?e[t].charAt(0).toUpperCase()+e[t].substring(1):o;return n(a,i)||i}(n,a,e,"day-min-".concat(t),t)}))},vo=function(e,t){var n=t?t._weekdaysShort:[];return ao.map((function(t,a){return function(e,t,n,a,o){var i=e[t]?e[t].charAt(0).toUpperCase()+e[t].substring(1):o;return n(a,i)||i}(n,a,e,"day-short-".concat(t),oo(t.substr(0,2)))}))},fo=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=[];t&&t._weekdays&&Array.isArray(t._weekdays)?n=t._weekdays:t&&t._weekdays&&Array.isArray(t._weekdays.standalone)&&(n=t._weekdays.standalone);var a=ao.map((function(t,a){return lo(n,a,e,"day-long-".concat(t),oo(t))}));return a},po=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;switch(e){case"long":return fo(t,n);case"short":return vo(t,n);case"min":return co(t,n);case"oneLetter":return uo(t,n);default:return null}},mo=["dayLabel","date","allowHoverStyleInRange"],go=["date","dayLabel"];function ho(e){var t=e.dayLabel,n=e.date,o=e.allowHoverStyleInRange,i=(0,l.Z)(e,mo),r=s.useRef(null),u=(0,k.B7)().theme,d=u.text,c=u.layout,v=s.useContext(Ta),f=v.dateFormat,p=v.focusedDate,m=v.selectPhase,g=v.isDateFocused,h=v.isDateSelected,y=v.isDateHovered,b=v.isDateBlocked,D=v.isFirstOrLastSelectedDate,Z=v.onDateSelect,C=v.onDateFocus,x=v.onDateHover,I=v.isStartDate,E=v.isEndDate,S=v.getMinimumEnabledDate,T=s.useMemo((function(){return t=p,!(!(e=n)||!t)&&e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear();var e,t}),[n,p]),O=to({date:n,focusedDate:p,isDateFocused:g,isDateSelected:h,isDateHovered:y,isDateBlocked:b,isFirstOrLastSelectedDate:D,onDateFocus:C,onDateSelect:Z,onDateHover:x,dayRef:r,blackoutDatesIntegration:null===i||void 0===i?void 0:i.blackoutDatesIntegration,fetchBlackoutDates:null===i||void 0===i?void 0:i.fetchBlackoutDates,focusedInput:null===i||void 0===i?void 0:i.focusedInput,getMinimumEnabledDate:S}),w=O.isSelected,A=O.isSelectedStartOrEnd,R=O.isWithinHoverRange,M=O.disabledDate,_=O.onClick,B=O.onKeyDown,N=O.onMouseEnter,P=O.tabIndex,F=O.isSelectedStartOrEndAndBlackout,L=O.isAMiddleAndBlackout,V=s.useContext(ke).localizationData,z=Oe(),H=fo(z,V),G=Be();if(s.useEffect((function(){var e;T&&!M&&(null===(e=r.current)||void 0===e||e.focus())}),[M,T]),!t)return(0,k.tZ)("div",null);var K=null===c||void 0===c?void 0:c.datepickerStyles,j=I(n)&&E(n),U=w||A||R;return(0,k.tZ)(bn,{className:"cell calendar-day","cmp-styles":{width:G?"100%":"auto"}},(0,k.tZ)(bn,{onClick:function(){_(),C(n)},role:"gridcell",onKeyDown:B,onMouseEnter:N,tabIndex:M?-1:P,ariaLabel:function(){var e=yn(n,f),t=n?H[null===n||void 0===n?void 0:n.getDay()]:"",a=b(n)?z("date-range-picker-date-not-available","Not available"):z("date-range-picker-date-available","Choose {stage} date",{stage:m===Ya?"departure":"return"});return"".concat(a," ").concat(t," ").concat(e)}(),ariaSelected:h(n),focusReferences:r,sx:(0,a.Z)((0,a.Z)((0,a.Z)({padding:"2",margin:0,border:"0",width:"100%",height:"38px",minWidth:"38px",variant:"text.fontSize5",outline:"none"},!M&&(o||!o&&!U)&&{"&:hover":{position:"relative",boxShadow:"inset 0 0 0 1px",variant:"layout.datepickerStyles.buttonsHover"},"&:focus":{position:"relative",boxShadow:"inset 0 0 0 1px",variant:"layout.datepickerStyles.buttonsHover"}}),function(){var e,t,n,o,i,l,r,s;if(c&&d)return L?null!==(e=null===K||void 0===K?void 0:K.dayMiddleAndBlackoutDay)&&void 0!==e?e:d.fontSize5:F?null!==(t=null===K||void 0===K?void 0:K.dayStartOrEndAnaBlackoutDay)&&void 0!==t?t:d.fontSize5:j&&w?null!==(n=null===K||void 0===K?void 0:K.dayStartOrEnd)&&void 0!==n?n:d.fontSize5:A?null!==(o=null===K||void 0===K?void 0:K.dayStartOrEnd)&&void 0!==o?o:d.fontSize5:w&&M?null!==K&&void 0!==K&&K.dayDisabled||null!==K&&void 0!==K&&K.daySelected?(0,a.Z)((0,a.Z)({},null===K||void 0===K?void 0:K.daySelected),null===K||void 0===K?void 0:K.dayDisabled):d.fontSize5:w?null!==(i=null===K||void 0===K?void 0:K.daySelected)&&void 0!==i?i:d.fontSize5:R?null!==(l=null===K||void 0===K?void 0:K.dayWithinRange)&&void 0!==l?l:d.fontSize5:M?null!==(r=null===K||void 0===K?void 0:K.dayDisabled)&&void 0!==r?r:d.fontSize5:null!==(s=null===K||void 0===K?void 0:K.dayNormal)&&void 0!==s?s:d.fontSize5}()),function(){if(c){if(j)return(0,a.Z)({zIndex:1},null===K||void 0===K?void 0:K.dayNormal.__selection);if(I(n))return(0,a.Z)({zIndex:1},null===K||void 0===K?void 0:K.dayStart);if(E(n))return(0,a.Z)({zIndex:1},null===K||void 0===K?void 0:K.dayEnd)}return""}())},t))}var yo=s.memo((function(e){var t=e.date,n=e.dayLabel,a=(0,l.Z)(e,go);return(0,k.tZ)(ho,{date:t,dayLabel:n,blackoutDatesIntegration:a.blackoutDatesIntegration,fetchBlackoutDates:a.fetchBlackoutDates,focusedInput:a.focusedInput,allowHoverStyleInRange:a.allowHoverStyleInRange})}),(function(e,t){var n=e.date.getTime()!==t.date.getTime(),a=e.dayLabel!==t.dayLabel,o=e.blackoutDatesIntegration!==t.blackoutDatesIntegration,i=e.focusedInput!==t.focusedInput,l=e.allowHoverStyleInRange!==t.allowHoverStyleInRange;return!n&&!a&&!o&&!i&&!l}));yo.displayName="MemoizedDay";var bo=["year","month","firstDayOfWeek","dayFormat","allowHoverStyleInRange"],Do=s.forwardRef((function(e,t){var n=e.year,a=e.month,o=e.firstDayOfWeek,i=e.dayFormat,r=e.allowHoverStyleInRange,u=(0,l.Z)(e,bo),d=Ra(),v=d.months,f=d.weekDays,p=d.isZh,m=d.format,g=void 0===m?yn:m,h=La({year:n,month:a,firstDayOfWeek:o,monthLabelFormat:v?p?function(e){return"".concat(g(e," yyyy\u5e74")," ").concat(v[e.getMonth()])}:function(e){return"".concat(v[e.getMonth()]," ").concat(e.getFullYear())}:void 0,weekdayLabelFormat:f?function(e){return f[e.getDay()]}:void 0,dayLabelFormat:function(e){return""+g(e,null!==i&&void 0!==i?i:"d")}}),y=h.days,b=h.weekdayLabels,D=h.monthLabel,Z=Be(),C=Z?"left":"center",x=s.useMemo((function(){return function(e){var t=[],n=[];e.forEach((function(a,o){n.push(a),7!==n.length&&o!==e.length-1||(t.push(n),n=[])}));var a=t[t.length-1];if(a.length<7){var o=7-a.length;a.push.apply(a,(0,c.Z)(Array(o).fill(0)))}return t}(y)}),[y]);return(0,k.tZ)(bn,{ref:t,sx:{variant:Z?"layout.datepickerStyles.monthMobile":"layout.datepickerStyles.month"}},(0,k.tZ)(bn,{id:D.replace(" ","_"),sx:{color:"text",variant:"text.fontSize4"},css:{textAlign:C,margin:"0 0 16px"}},(0,k.tZ)(I.xv,{"aria-label":D},D)),(0,k.tZ)(nt,{className:"table",role:"grid",selectChildrenWithoutType:!0,"aria-labelledby":D.replace(" ","_"),sx:{justifyContent:"center",variant:"layout.datepickerStyles.days"}},(0,k.tZ)(nt,{columns:7,sx:{variant:"layout.datepickerStyles.weeks"},role:"row",css:{justifyContent:"center",marginBottom:"10px",fontSize:"10px"}},b.map((function(e){return(0,k.tZ)(bn,{sx:{color:"text",width:Z?"100%":"auto",variant:"text.fontSize5"},css:{textAlign:"center",fontWeight:"bold"},key:e,role:"columnheader",display:"table-cell"},(0,k.tZ)(I.xv,{"aria-label":e},e))}))),x.map((function(e,t){return(0,k.tZ)(bn,{className:"calendar-week",display:"flex",justifyContent:"between",key:"month-".concat(e,"-").concat(t),role:"row"},e.map((function(e){return"object"===typeof e?(0,k.tZ)(yo,{date:e.date,key:e.date.toISOString().split("T")[0],dayLabel:e.dayLabel,blackoutDatesIntegration:null===u||void 0===u?void 0:u.blackoutDatesIntegration,fetchBlackoutDates:null===u||void 0===u?void 0:u.fetchBlackoutDates,focusedInput:null===u||void 0===u?void 0:u.focusedInput,allowHoverStyleInRange:r}):(0,k.tZ)(bn,{style:{minWidth:"38px",cursor:"default",width:Z?"100%":"auto"},className:"calendar-day",role:"gridcell"},(0,k.tZ)(bn,{key:t},"\xa0"))})))}))))}
1)),Zo=s.memo(Do),Co=["fetchBlackoutDates","blackoutDatesIntegration","defaultValue","timeOptions","flexibleDates","maxDate","minDate","maxRange","minRange","selectedOrigin","selectedDestination","singleSelection","numberOfMonths","enableAutomaticStatusNavBarButtons","dayFormat","dateFormat","dateFormatOnEdit","flightType","columns","showTimePickers","labels","startDateHasError","UNSTABLE_hideDisabledInput","endDateHasError","startDateErrorMessage","startDateTimeErrorMessage","endDateErrorMessage","endDateTimeErrorMessage","showFlexibleDates","activeTab","currentTab","setValue","getValues","setSelectedDates","onChange","onKeyDownHandleEnterAction","trigger","allowHoverStyleInRange","customInputStyle","shouldFlip"];function xo(e){return(0,$.Z)(Date.now(),e)>0}function Io(e){for(var t=(0,A.Z)(e,-1),n=0,a=new Date((0,R.Z)().getFullYear(),(0,R.Z)().getMonth(),1),o=a;(0,G.Z)(o,t)||(0,z.Z)(o,t);)n++,o=(0,U.Z)(a,n);return n}function ko(e,t){var n,o,i,u,d,c,f,p,m,g,h,y,b,D,Z=e.fetchBlackoutDates,C=e.blackoutDatesIntegration,x=e.defaultValue,E=e.timeOptions,S=e.flexibleDates,O=e.maxDate,w=e.minDate,M=e.maxRange,_=e.minRange,B=e.selectedOrigin,N=e.selectedDestination,P=e.singleSelection,F=e.numberOfMonths,V=e.enableAutomaticStatusNavBarButtons,H=e.dayFormat,j=e.dateFormat,Y=e.dateFormatOnEdit,q=e.flightType,Q=e.columns,X=e.showTimePickers,ae=e.labels,oe=e.startDateHasError,ie=e.UNSTABLE_hideDisabledInput,re=e.endDateHasError,se=e.startDateErrorMessage,fe=e.startDateTimeErrorMessage,pe=e.endDateErrorMessage,me=e.endDateTimeErrorMessage,ge=e.showFlexibleDates,he=e.activeTab,ye=e.currentTab,be=e.setValue,De=e.getValues,Ze=e.setSelectedDates,Ce=e.onChange,xe=e.onKeyDownHandleEnterAction,Ie=e.trigger,ke=e.allowHoverStyleInRange,Ee=void 0===ke||ke,Se=e.customInputStyle,Te=e.shouldFlip,we=(0,l.Z)(e,Co),Ae=Oe(),Re=Be(),Me=Z||null,_e="string"===typeof w?(0,W.Z)(w):(0,A.Z)((0,R.Z)(),null!==w&&void 0!==w?w:0),Ne=void 0;null!=O&&(Ne="string"===typeof O?(0,W.Z)(O):(0,A.Z)((0,R.Z)(),O-1));var Pe=(0,s.useState)({startDate:null!==(n=null===x||void 0===x?void 0:x.start)&&void 0!==n?n:null,previousStartDate:null!==(o=null===x||void 0===x?void 0:x.start)&&void 0!==o?o:null,endDate:null!==(i=null===x||void 0===x?void 0:x.end)&&void 0!==i?i:null,previousEndDate:null!==(u=null===x||void 0===x?void 0:x.end)&&void 0!==u?u:null,startTime:null!==(d=null===x||void 0===x?void 0:x.startTime)&&void 0!==d?d:null===E||void 0===E||null===(c=E[0])||void 0===c?void 0:c.value,endTime:null!==(f=null===x||void 0===x?void 0:x.endTime)&&void 0!==f?f:null===E||void 0===E||null===(p=E[0])||void 0===p?void 0:p.value,focusedInput:null,selectPhase:null,isFlexibleDates:null!==S&&void 0!==S&&S,numberOfMonths:Re&&Ne?Io(Ne):6}),Fe=(0,v.Z)(Pe,2),Le=Fe[0],Ve=Fe[1],ze=(0,ve.d)({}),He=function(e){var t=e.startDate,n=e.maxRange,a=function(e){for(var t=(0,W.Z)(e[0]),n=0;n<e.length;n++){var a=(0,W.Z)(e[n]);(0,G.Z)(a,t)&&(t=a)}return t},o=function(e){for(var t=(0,W.Z)(e[0]),n=0;n<e.length;n++){var a=(0,W.Z)(e[n]);(0,K.Z)(a,t)&&(t=a)}return t};function i(e,t,n){var a=e;if(t&&n){var o=(0,A.Z)(t,n-1);return a?(0,J.Z)([a,o]):o}return a}return{getMinBlackoutDate:function(e,t,n,o){if(!0!==t)return e;if(o===Ya){var i,l;if(t&&n&&null!==n&&void 0!==n&&n.departure&&null!==n&&void 0!==n&&null!==(i=n.departure)&&void 0!==i&&i.minDate){var r;if(null!==n&&void 0!==n&&null!==(r=n.departure)&&void 0!==r&&r.includedDates){var s,u,d=a(null===n||void 0===n||null===(s=n.departure)||void 0===s?void 0:s.includedDates),c=(0,W.Z)(null===n||void 0===n||null===(u=n.departure)||void 0===u?void 0:u.minDate);return((0,K.Z)(d,new Date)||(0,z.Z)(d,new Date))&&(0,G.Z)(d,c)?d:(0,K.Z)(c,new Date)||(0,z.Z)(c,new Date)?c:e}var v,f=(0,W.Z)(null===n||void 0===n||null===(v=n.departure)||void 0===v?void 0:v.minDate);return(0,K.Z)(f,new Date)||(0,z.Z)(f,new Date)?f:e}if(null!==n&&void 0!==n&&null!==(l=n.departure)&&void 0!==l&&l.includedDates){var p,m=a(null===n||void 0===n||null===(p=n.departure)||void 0===p?void 0:p.includedDates);if((0,K.Z)(m,new Date)||(0,z.Z)(m,new Date))return m}return e}if(o===qa){var g,h;if(t&&n&&null!==n&&void 0!==n&&n.return&&null!==n&&void 0!==n&&null!==(g=n.return)&&void 0!==g&&g.minDate){var y;if(null!==n&&void 0!==n&&null!==(y=n.return)&&void 0!==y&&y.includedDates){var b,D,Z=a(null===n||void 0===n||null===(b=n.return)||void 0===b?void 0:b.includedDates),C=(0,W.Z)(null===n||void 0===n||null===(D=n.return)||void 0===D?void 0:D.minDate);return((0,K.Z)(Z,new Date)||(0,z.Z)(Z,new Date))&&(0,G.Z)(Z,C)?Z:(0,K.Z)(C,new Date)||(0,z.Z)(C,new Date)?C:e}var x,I=(0,W.Z)(null===n||void 0===n||null===(x=n.return)||void 0===x?void 0:x.minDate);return(0,K.Z)(I,new Date)||(0,z.Z)(I,new Date)?I:e}if(null!==n&&void 0!==n&&null!==(h=n.return)&&void 0!==h&&h.includedDates){var k,E=a(null===n||void 0===n||null===(k=n.return)||void 0===k?void 0:k.includedDates);if((0,K.Z)(E,new Date)||(0,z.Z)(E,new Date))return E}return e}},getMaxBlackoutDate_:function(e,a,l,r){if(!0!==a)return i(e,t,n);if(r===Ya){var s,u;if(a&&l&&null!==l&&void 0!==l&&l.departure&&null!==l&&void 0!==l&&null!==(s=l.departure)&&void 0!==s&&s.maxDate){var d;if(null!==l&&void 0!==l&&null!==(d=l.departure)&&void 0!==d&&d.includedDates){var c,v,f=o(null===l||void 0===l||null===(c=l.departure)||void 0===c?void 0:c.includedDates),p=(0,W.Z)(null===l||void 0===l||null===(v=l.departure)||void 0===v?void 0:v.maxDate);return((0,K.Z)(f,new Date)||(0,z.Z)(f,new Date))&&(0,K.Z)(f,p)?i(f,t,n):(0,K.Z)(p,new Date)||(0,z.Z)(p,new Date)?
1i(p,t,n):i(e,t,n)}var m,g=(0,W.Z)(null===l||void 0===l||null===(m=l.departure)||void 0===m?void 0:m.maxDate);return(0,K.Z)(g,new Date)||(0,z.Z)(g,new Date)&&e&&(0,K.Z)(g,e)?i(g,t,n):i(e,t,n)}if(null!==l&&void 0!==l&&null!==(u=l.departure)&&void 0!==u&&u.includedDates){var h,y=o(null===l||void 0===l||null===(h=l.departure)||void 0===h?void 0:h.includedDates);if((0,K.Z)(y,new Date)&&e&&(0,K.Z)(y,e))return i(y,t,n)}return i(e,t,n)}var b,D,Z,C;return r===qa?a&&l&&null!==l&&void 0!==l&&l.return&&null!==l&&void 0!==l&&null!==(b=l.return)&&void 0!==b&&b.maxDate?null!==l&&void 0!==l&&null!==(D=l.return)&&void 0!==D&&D.includedDates?i(o(null===l||void 0===l||null===(Z=l.return)||void 0===Z?void 0:Z.includedDates),t,n):i((0,W.Z)(null===l||void 0===l||null===(C=l.return)||void 0===C?void 0:C.maxDate),t,n):i(e,t,n):void 0}}}({startDate:Le.startDate,maxRange:M}),Ge=He.getMinBlackoutDate,Ke=He.getMaxBlackoutDate_;s.useEffect((function(){!0===C&&Me&&(P?void 0!==(null===Me||void 0===Me?void 0:Me.isValidSelectedDepartureDate)&&(!1===(null===Me||void 0===Me?void 0:Me.isValidSelectedDepartureDate)?(be&&be("dates",{}),Ve((0,a.Z)((0,a.Z)({},Le),{},{startDate:null,endDate:null}))):be&&De&&Le.startDate&&(be("dates",{start:Le.startDate,end:null}),Ve((0,a.Z)((0,a.Z)({},Le),{},{startDate:Le.startDate,endDate:null})))):void 0!==(null===Me||void 0===Me?void 0:Me.isValidSelectedDepartureDate)&&!1===(null===Me||void 0===Me?void 0:Me.isValidSelectedDepartureDate)&&void 0!==(null===Me||void 0===Me?void 0:Me.isValidSelectedReturnDate)&&!1===(null===Me||void 0===Me?void 0:Me.isValidSelectedReturnDate)?Ve((0,a.Z)((0,a.Z)({},Le),{},{startDate:null,endDate:null})):void 0!==(null===Me||void 0===Me?void 0:Me.isValidSelectedDepartureDate)&&!1===(null===Me||void 0===Me?void 0:Me.isValidSelectedDepartureDate)?Ve((0,a.Z)((0,a.Z)({},Le),{},{startDate:null})):void 0!==(null===Me||void 0===Me?void 0:Me.isValidSelectedReturnDate)&&!1===(null===Me||void 0===Me?void 0:Me.isValidSelectedReturnDate)&&Ve((0,a.Z)((0,a.Z)({},Le),{},{endDate:null})))}),[Me]),s.useEffect((function(){!0===C&&""===(null===B||void 0===B?void 0:B.value)&&Ve((0,a.Z)((0,a.Z)({},Le),{},{startDate:null,endDate:null}))}),[B]),s.useEffect((function(){!0===C&&""===(null===N||void 0===N?void 0:N.value)&&Ve((0,a.Z)((0,a.Z)({},Le),{},{startDate:null,endDate:null}))}),[N]);var je=(0,s.useRef)(null),Ue=null!==F&&void 0!==F?F:2,We=Re?Le.numberOfMonths:Ue,Ye=(0,s.useRef)(null),Qe=(0,s.useRef)(null),Xe=(0,s.useRef)(null),Je=(0,s.useRef)(null),$e=(0,s.useRef)(null);(0,s.useEffect)((function(){null===Ze||void 0===Ze||Ze({startDate:Le.startDate,endDate:Le.endDate})}),[]);var tt=function(e,t){if(V||void 0===V){if(void 0!==w){var n=!0===C?(0,J.Z)([null!==mt&&void 0!==mt?mt:_e,_e]):_e;if(t<n.getFullYear())return!0;if(t===n.getFullYear()&&n.getMonth()>=e)return!0}return!1}return!1},at=function(e,t){var n=!0===C?pt:Ne;if(V||!n)return!1;var a=n.getTime()/1e3,o=function(e,t,n){var a=e+n,o=Math.floor((a>12?a:0)/12);return{month:a=0===(a%=12)?12:a,year:t+o}}(e,t,2);return new Date(o.year,o.month,0).getTime()/1e3>=a-86400},ot=Ra(),it=ot.parse,lt=void 0===it?W.Z:it,rt=ot.format,st=void 0===rt?yn:rt,ut=null!==j&&void 0!==j?j:"yyyy-MM-dd",dt=null!==Y&&void 0!==Y?Y:ut,ct=(0,r.r)((0,r.n)(dt," ","-")),vt=Ae("date-format-".concat(ct),ct),ft=function(e){return e?dt:ut};var pt=Ke(Ne,C,Me,Le.selectPhase),mt=Ge(_e,C,Me,Le.selectPhase),gt=(0,s.useMemo)((function(){var e;return Ha(We,mt&&(0,R.Z)()<mt?null!==(e=Le.startDate)&&void 0!==e?e:_e:(0,R.Z)())}),[We]);s.useEffect((function(){null!==Le.selectPhase&&Re&&Ve((0,a.Z)((0,a.Z)({},Le),{},{numberOfMonths:Io(null!==pt&&void 0!==pt?pt:Ne)}))}),[Le.selectPhase]);var ht=Qa({startDate:Le.startDate,endDate:null===P?null:null===Le.endDate?Le.startDate:Le.endDate,focusedInput:Le.focusedInput,selectPhase:Le.selectPhase,onDatesChange:rn,exactMinBookingDays:P,numberOfMonths:We,maxBookingDate:pt,minBookingDate:mt,minBookingDays:_?_+1:void 0,blackoutDatesIntegration:C,initialVisibleMonth:_e,isDateBlocked:xo,fetchUnavailableDates:C?Me:null}),yt=ht.firstDayOfWeek,bt=ht.activeMonths,Dt=ht.isDateSelected,Zt=ht.isDateHovered,Ct=ht.isFirstOrLastSelectedDate,xt=ht.isStartDate,It=ht.isEndDate,kt=ht.isDateBlocked,Et=ht.isDateFocused,St=ht.focusedDate,Tt=ht.onDateHover,Ot=ht.onDateSelect,wt=ht.onDateFocus,At=ht.goToDate,Rt=ht.onResetDates,Mt=ht.resetDatesKeepingFocus,_t=ht.goToNextMonthsByOneMonth,Bt=ht.goToPreviousMonthsByOneMonth,Nt=ht.getMinimumEnabledDate,Pt=(0,s.useRef)(null),Ft=Re?gt:bt,Lt=(0,s.use
1State)(!1),Vt=(0,v.Z)(Lt,2),zt=Vt[0],Ht=Vt[1],Gt=(0,s.useRef)(null),Kt=(0,s.useRef)(null),jt=(0,s.useState)((function(){return le()()})),Ut=(0,v.Z)(jt,1)[0],Wt=(0,s.useState)((function(){return le()()})),Yt=(0,v.Z)(Wt,1)[0],qt=(0,s.useState)(!1),Qt=(0,v.Z)(qt,2),Xt=Qt[0],Jt=Qt[1],$t=s.useState(!1),en=(0,v.Z)($t,2),tn=en[0],nn=en[1],an=function(){Ht(!1),Ve((0,a.Z)((0,a.Z)({},Le),{},{focusedInput:null,selectPhase:null})),Jt(!1)};function on(e,t){Gt.current&&(Gt.current.value=e?st(e,ft(t)):Ae((null===ae||void 0===ae?void 0:ae.departurePlaceholder)||"cmp-booking-departure-placeholder","From"))}function ln(e,t){Kt.current&&(Kt.current.value=e&&!P?st(e,ft(t)):Ae((null===ae||void 0===ae?void 0:ae.returnPlaceholder)||"cmp-booking-return-placeholder","To"))}function rn(e){var t,n,a=e.startDate,o=e.endDate;if((null!==a&&void 0!==a||null!==o&&void 0!==o)&&nn(!1),e.startDate&&e.endDate&&(0,K.Z)(e.startDate,e.endDate)&&(o=e.startDate),e.selectPhase===qa&&M&&a&&o){var i=(0,A.Z)(a,M-1);(0,G.Z)(i,o)&&(o=i)}(Ve((function(t){return(0,de.ZP)(t,(function(t){var n,i;t.focusedInput=null!==(n=e.focusedInput)&&void 0!==n?n:Ya,t.selectPhase=null!==(i=e.selectPhase)&&void 0!==i?i:Ya,t.startDate=a,t.endDate=o}))})),null===(t=e.shouldUpdate)||void 0===t||t)&&(n=e.selectPhase===Ya||null===e.selectPhase,on(a,n),ln(o,e.selectPhase===qa))}(0,s.useEffect)((function(){null===Le.selectPhase&&(on(Le.startDate,!1),ln(Le.endDate,!1))}),[Le.selectPhase,P]),(0,s.useEffect)((function(){!0===C?P&&void 0!==(null===Me||void 0===Me?void 0:Me.isValidSelectedDepartureDate)&&!1===(null===Me||void 0===Me?void 0:Me.isValidSelectedDepartureDate)&&Ve((0,a.Z)((0,a.Z)({},Le),{},{startDate:null,endDate:null})):Le.endDate&&P&&Ve((0,a.Z)((0,a.Z)({},Le),{},{endDate:null}))}),[P]),(0,s.useEffect)((function(){var e,t={start:null!==(e=Le.startDate)&&void 0!==e?e:void 0,end:Le.endDate&&!P?Le.endDate:void 0,startTime:Le.startTime,endTime:Le.endTime,isFlexibleDates:Le.isFlexibleDates};null===Ce||void 0===Ce||Ce(t),!Ie||Le.startDate||Le.endDate||setTimeout((function(){Ie("dates")}),0)}),[Le.endDate,Le.endTime,Le.startDate,Le.startTime,P,Le.isFlexibleDates,Le.numberOfMonths]);function sn(){Ve((0,a.Z)((0,a.Z)({},Le),{},{focusedInput:null})),ze.close()}function un(e){e&&(Le.focusedInput===Ya&&Le.startDate&&Ft.some((function(e){var t;return e.month===(null===(t=Le.startDate)||void 0===t?void 0:t.getMonth())}))?wt(Le.startDate):Le.focusedInput!==Ya||Le.startDate&&(!Le.startDate||Ft.some((function(e){var t;return e.month===(null===(t=Le.startDate)||void 0===t?void 0:t.getMonth())})))?Le.focusedInput===qa&&Le.endDate&&Ft.some((function(e){var t;return e.month===(null===(t=Le.endDate)||void 0===t?void 0:t.getMonth())}))?wt(Le.endDate):Le.focusedInput!==qa||Le.endDate&&(!Le.endDate||Ft.some((function(e){var t;return e.month===(null===(t=Le.endDate)||void 0===t?void 0:t.getMonth())})))||wt($a(Ft[0].date,(function(e){return!kt(e)}))):wt($a(Ft[0].date,(function(e){return!kt(e)}))))}var dn=(0,ce.U)({elementType:"input"},$e).buttonProps,cn=(0,s.useRef)(!1),vn=(0,s.useRef)(!1),fn=bt.map((function(e){return Pa(new Date(e.year,e.month))})),pn=(0,s.useMemo)((function(){return(0,U.Z)(bt[0].date,-1)}),[bt]),mn=s.useState(void 0),gn=(0,v.Z)(mn,2),hn=gn[0],bn=gn[1],Dn=s.useCallback((function(){bn(!1),setTimeout((function(){bn(!0)}),300)}),[]);s.useEffect((function(){bn(!1),setTimeout((function(){bn(!0)}),300)}),[bt]);var Zn=(0,k.tZ)("div",{key:Ft.map((function(e){return e.month+"_"+e.year})).join("-"),className:"fr-sr-only","aria-live":"polite"},hn?(0,k.tZ)(s.Fragment,null," ".concat(Ae("cmp-datepicker-show-month","Current month")," ").concat(fn[0]," ")," ".concat(vn.current&&_e&&(pn.getFullYear()>_e.getFullYear()||pn.getFullYear()===_e.getFullYear()&&pn.getMonth()>=_e.getMonth())?" ".concat(Ae("cmp-datepicker-prev-month","Previous month"),", ").concat(Fa((0,U.Z)(bt[0].date,-1))):""," ")," ".concat(cn.current?" ".concat(Ae("cmp-datepicker-next-month","Next month"),", ").concat(Fa(bt[1].date)," "):""," "),at(2===Ue?Ft[0].month:Ft[Ue-1].month,2===Ue?Ft[0].year:Ft[Ue-1].year)?Ae("cmp-datepicker-next-month-button-disabled","Next month button disabled"):"",tt(Ft[0].month,Ft[0].year)?Ae("cmp-datepicker-previous-month-button-disabled","Previous month button disabled"):""):null),Cn=se&&s.cloneElement(se,{id:"screenReaderMessageComboboxState-".concat(Ut)}),xn=(0,k.tZ)(s.Fragment,null,(0,k.tZ)(On,Object.assign({},dn,{"aria-haspopup":"dialog","aria-expanded":ze.isOpen&&Le.focu
1sedInput===Ya,readOnly:!0,"aria-readonly":"true",inputMode:"none",label:Ae(null!==(m=null===ae||void 0===ae?void 0:ae.departure)&&void 0!==m?m:"cmp-booking-departure","Departure"),"aria-describedby":"screenReaderMessageComboboxState-".concat(Ut," ").concat(Ut),value:Le.startDate?st(Le.startDate,ut):Ae(null!==(g=null===ae||void 0===ae?void 0:ae.departurePlaceholder)&&void 0!==g?g:"cmp-booking-departure-placeholder","From"),state:Le.focusedInput===Ya?"focus":void 0,sx:{textAlign:"start"},customInputStyle:(0,a.Z)({"&[data-state=focus]":{boxShadow:ze.isOpen?"none":"focus"}},Se),rightIcon:"calendar-material",rightIconSize:20,disabled:!!C&&(null===Me||void 0===Me||!B||""===(null===B||void 0===B?void 0:B.value)||!N||""===(null===N||void 0===N?void 0:N.value)),ref:Gt,hasError:oe,errorMessage:Cn,active:Boolean(Le.startDate),onChange:function(e){var t=""===e.target.value.trim(),n=t?null:lt(e.target.value,dt);(t||(0,ne.Z)(n)&&!kt(n))&&rn({startDate:n,endDate:Le.endDate,focusedInput:Ya,selectPhase:Ya,shouldUpdate:!1})},onClick:function(e){Re?Ht(!0):(Ve((0,a.Z)((0,a.Z)({},Le),{},{focusedInput:Ya,selectPhase:Ya})),ze.open())},onFocus:function(){if(on(Le.startDate,!0),Re&&Ve((0,a.Z)((0,a.Z)({},Le),{},{focusedInput:Ya,selectPhase:Ya})),null!==Le.startDate)At(Le.startDate);else{var e=Ge(_e,C,Me,Ya);At(!0===C&&e?e:_e)}},onBlur:function(){on(Le.startDate,!1)},onKeyDown:function(e){40!==e.keyCode&&e.keyCode!==Ja||(e.stopPropagation(),e.preventDefault(),Ve((0,a.Z)((0,a.Z)({},Le),{},{focusedInput:Ya,selectPhase:Ya})),setTimeout((function(){var e;return null===(e=Qe.current)||void 0===e?void 0:e.focus()}),100),Le.startDate?wt(Le.startDate):Le.endDate?wt(Le.endDate):wt($a(Ft[0].date,(function(e){return!kt(e)}))),Dn(),ze.open()),27===e.keyCode&&sn(),9===e.keyCode&&(e.shiftKey?Ve((0,a.Z)((0,a.Z)({},Le),{},{focusedInput:null,selectPhase:null})):Ve((0,a.Z)((0,a.Z)({},Le),{},{focusedInput:qa,selectPhase:qa}))),xe&&xe(e)}})),(0,k.tZ)(ue.T,{id:Ut},Ae("cmp-datepicker-departure-description","Type the departure date in the format {format}",{format:vt}),Le.startDate?Ae("cmp-datepicker-departure-start-day-selected"," Selected {date}",{date:yn(Le.startDate,ct)}):Ae("cmp-datepicker-departure-no-day-selected"," No date selected")),X&&(0,k.tZ)(et,{gap:1},(0,k.tZ)(Rn,{options:null!==E&&void 0!==E?E:[],onChange:function(e){Ve((0,a.Z)((0,a.Z)({},Le),{},{startTime:e})),null===be||void 0===be||be("dates",(0,a.Z)((0,a.Z)({},null===De||void 0===De?void 0:De().dates),{},{startTime:e}))},hasError:oe,label:Ae("cmp-booking-timepicker-label","Time"),layout:"closed",value:null!==(h=Le.startTime)&&void 0!==h?h:null===E||void 0===E?void 0:E[0].value,ariaDescribedBy:"screenReaderMessageComboboxState-".concat(Ut)}),oe&&fe)),In=pe&&s.cloneElement(pe,{id:"screenReaderMessageComboboxState-".concat(Yt)}),kn=(0,k.tZ)(s.Fragment,null,(0,k.tZ)(I.xu,{sx:{display:P&&ie?"none":"inline"}},(0,k.tZ)(On,Object.assign({},dn,{"aria-haspopup":"dialog","aria-expanded":ze.isOpen&&Le.focusedInput===qa,readOnly:!0,"aria-readonly":"true",inputMode:"none",label:Ae(null!==(y=null===ae||void 0===ae?void 0:ae.return)&&void 0!==y?y:"cmp-booking-return","Return"),"aria-describedby":"screenReaderMessageComboboxState-".concat(!oe||null!==Le&&void 0!==Le&&Le.endDate?Yt:Ut," ").concat(Yt),value:Le.endDate&&!P?st(Le.endDate,ut):Ae(null!==(b=null===ae||void 0===ae?void 0:ae.returnPlaceholder)&&void 0!==b?b:"cmp-booking-return-placeholder","To"),state:Le.focusedInput===qa?"focus":void 0,sx:{textAlign:"start"},customInputStyle:(0,a.Z)({"&[data-state=focus]":{boxShadow:ze.isOpen?"none":"focus"}},Se),rightIcon:"calendar-material",rightIconSize:20,ref:Kt,hasError:re,errorMessage:In,disabled:C?null===Me||void 0===Me||!B||""===(null===B||void 0===B?void 0:B.value)||!N||""===(null===N||void 0===N?void 0:N.value)||"ow"===q:P,active:Boolean(Le.endDate),onChange:function(e){var t=""===e.target.value.trim(),n=t?null:lt(e.target.value,dt);(t||(0,ne.Z)(n)&&!kt(n)&&(!Le.startDate||(0,$.Z)(n,Le.startDate)>=0))&&rn({startDate:Le.startDate,endDate:n,focusedInput:qa,selectPhase:qa,shouldUpdate:!1})},onClick:function(){Re?Ht(!0):(ze.open(),Ve((0,a.Z)((0,a.Z)({},Le),{},{focusedInput:qa,selectPhase:qa})))},onFocus:function(){if(ln(Le.endDate,!0),Re&&Ve((0,a.Z)((0,a.Z)({},Le),{},{focusedInput:qa,selectPhase:qa})),Le.endDate)At(Le.endDate);else{var e=Ge(_e,C,Me,qa);At(!0===C&&e?e:_e)}},onBlur:function(){ln(Le.endDate,!1)}
1,onKeyDown:function(e){40!==e.keyCode&&e.keyCode!==Ja||(e.preventDefault(),e.stopPropagation(),Ve((0,a.Z)((0,a.Z)({},Le),{},{focusedInput:qa,selectPhase:qa})),setTimeout((function(){var e,t;Ye.current&&!Ye.current.disabled?null===(e=Ye.current)||void 0===e||e.focus():null===(t=Qe.current)||void 0===t||t.focus()}),100),Le.endDate?wt(Le.endDate):Le.startDate?wt(Le.startDate):wt($a(Ft[0].date,(function(e){return!kt(e)}))),Dn(),ze.open()),27===e.keyCode&&sn(),9===e.keyCode&&(e.shiftKey?Ve((0,a.Z)((0,a.Z)({},Le),{},{focusedInput:Ya,selectPhase:Ya})):Ve((0,a.Z)((0,a.Z)({},Le),{},{focusedInput:null,selectPhase:null}))),xe&&xe(e)}})),(0,k.tZ)(ue.T,{id:Yt},Ae("cmp-datepicker-return-description","Type the return date in the format {format}",{format:vt}),Le.endDate?Ae("cmp-datepicker-departure-end-day-selected"," Selected {date}",{date:yn(Le.endDate,ct)}):Ae("cmp-datepicker-departure-no-day-selected"," No date selected"))),X&&(0,k.tZ)(et,{gap:1},(0,k.tZ)(Rn,{options:null!==E&&void 0!==E?E:[],onChange:function(e){Ve((0,a.Z)((0,a.Z)({},Le),{},{endTime:e})),null===be||void 0===be||be("dates",(0,a.Z)((0,a.Z)({},null===De||void 0===De?void 0:De().dates),{},{endTime:e}))},hasError:re,label:Ae("cmp-booking-timepicker-label","Time"),layout:"closed",value:null!==(D=Le.endTime)&&void 0!==D?D:null===E||void 0===E?void 0:E[0].value,ariaDescribedBy:"screenReaderMessageComboboxState-".concat(Yt)}),re&&me)),Sn=(0,k.tZ)(nt,{gap:2,sx:{height:"100%",alignContent:"space-evenly",variant:"layout.datepickerStyles.inputsContainer"},columns:null!==Q&&void 0!==Q?Q:X?[2,2,4]:2},xn,kn),Tn=(0,k.tZ)(s.Fragment,null,ge?(0,k.tZ)(ka,{role:"checkbox","aria-checked":Le.isFlexibleDates,checked:Le.isFlexibleDates,label:Ae("cmp-booking-flexible-dates-label","Flexible dates"),onChange:function(e){Ve((0,a.Z)((0,a.Z)({},Le),{},{isFlexibleDates:e.target.checked}))},onKeyDown:function(e){un(9===e.keyCode&&e.shiftKey&&!St)}}):null,(0,k.tZ)(qe,{align:"end",sx:{flex:"1"}},(0,k.tZ)(I.zx,{ref:Xe,variant:"text",disabled:null===Le.startDate&&null===Le.endDate,onClick:function(){nn(!0),Ve((0,de.ZP)(Le,(function(e){e.startDate=null,e.previousStartDate=null,e.endDate=null,e.previousEndDate=null,e.focusedInput=Ya,e.selectPhase=Ya}))),Jt(!0),null===Ze||void 0===Ze||Ze({startDate:null,endDate:null}),Rt();var e=Ge(_e,C,Me,Ya);At(!0===C&&e?e:_e)},onKeyDown:function(e){if(un(9===e.keyCode&&e.shiftKey&&!St&&!ge),e.keyCode===Ja||e.keyCode===Xa){e.preventDefault(),nn(!0),Ve((0,de.ZP)(Le,(function(e){e.startDate=null,e.previousStartDate=null,e.endDate=null,e.previousEndDate=null,e.selectPhase=Ya}))),Jt(!0),null===Ze||void 0===Ze||Ze({startDate:null,endDate:null}),Mt();var t=Ge(_e,C,Me,Ya);!0===C&&t?(At(t),wt(t)):(At(_e),wt(_e))}}},Ae("cmp-booking-datepicker-clear-label","Clear")),(0,k.tZ)(I.zx,{ref:Je,variant:"text",disabled:!!tn||!Xt&&(P?null===Le.startDate:null===Le.startDate||null===Le.endDate),onClick:function(){Re?Ht(!1):(on(Le.startDate,!1),ln(Le.endDate,!1),null===Ze||void 0===Ze||Ze({startDate:Le.startDate,endDate:Le.endDate}),Ve((function(e){return(0,de.ZP)(e,(function(t){t.focusedInput=null,t.selectPhase=null,t.previousStartDate=e.startDate,t.previousEndDate=e.endDate}))})),ze.close()),Jt(!1),Ie&&Ie("dates")},onKeyDown:function(e){var t;e.keyCode!==Ja&&e.keyCode!==Xa||(e.preventDefault(),null===(t=Je.current)||void 0===t||t.click())}},Ae("cmp-booking-datepicker-done-label","Done")))),wn=(0,k.tZ)(qe,{align:"space-between",pr:"4",pl:"4",sx:{position:"absolute",width:"100%",top:"20px",variant:"layout.datepickerStyles.navigation"},onKeyDown:function(e){27===e.keyCode&&sn()}},Zn,(0,k.tZ)("div",{className:"calendar-header-button-container"},(0,k.tZ)("div",{className:"cmp-datepicker-previous-button"},(0,k.tZ)(I.zx,{variant:"iconRounded",ref:Ye,"aria-label":Ae("cmp-datepicker-button-previous-label","Previous Month"),disabled:tt(Ft[0].month,Ft[0].year),"aria-disabled":tt(Ft[0].month,Ft[0].year),onClick:function(){Bt(),Le.selectPhase===Ya?on(Le.startDate,!0):Le.selectPhase===qa&&ln(Le.endDate,!0);var e,t=Ga(Ft,We,-1,1);tt(t[0].month,t[0].year)&&(null===(e=Qe.current)||void 0===e||e.focus());
1vn.current=!0,cn.current=!1},onKeyDown:function(e){var t;e.keyCode!==Ja&&e.keyCode!==Xa||(e.preventDefault(),null===(t=Ye.current)||void 0===t||t.click(),Dn())}},(0,k.tZ)(En,{icon:"left-chevron",size:14,fill:"currentColor",style:{stroke:"currentColor",strokeWidth:"120px"}}))),(0,k.tZ)("div",{className:"cmp-datepicker-next-button"},(0,k.tZ)(I.zx,{ref:Qe,variant:"iconRounded",disabled:at(2===Ue?Ft[0].month:Ft[Ue-1].month,2===Ue?Ft[0].year:Ft[Ue-1].year),"aria-disabled":at(2===Ue?Ft[0].month:Ft[Ue-1].month,2===Ue?Ft[0].year:Ft[Ue-1].year),"aria-label":Ae("cmp-datepicker-button-next-label","Next Month"),onClick:function(){_t(),Le.selectPhase===Ya?on(Le.startDate,!0):Le.selectPhase===qa&&ln(Le.endDate,!0);var e,t=Ga(Ft,We,1,1);at(t[0].month,t[0].year)&&(null===(e=Ye.current)||void 0===e||e.focus());cn.current=!0,vn.current=!1},onKeyDown:function(e){var t;(un(9===e.keyCode&&!e.shiftKey&&!St),e.keyCode===Ja||e.keyCode===Xa)&&(e.preventDefault(),null===(t=Qe.current)||void 0===t||t.click(),Dn())}},(0,k.tZ)(En,{icon:"right-chevron",size:14,fill:"currentColor",style:{stroke:"currentColor",strokeWidth:"120px"}}))))),An=(0,k.tZ)(nt,{columns:Re?1:Ft.length,gap:"4",p:"4",variant:"layout.datepickerStyles.monthContainer",onKeyDown:function(e){27===e.keyCode&&sn()}},Ft.map((function(e,t){var n,a=e.month===(null===(n=Le.startDate)||void 0===n?void 0:n.getMonth())&&e.year===Le.startDate.getFullYear();return(0,k.tZ)(Zo,Object.assign({ref:a?je:void 0,dayFormat:null!==H&&void 0!==H?H:"d",key:"".concat(e.year,"-").concat(e.month),year:e.year,month:e.month,firstDayOfWeek:yt,blackoutDatesIntegration:C,fetchBlackoutDates:Me,focusedInput:Le.focusedInput,allowHoverStyleInRange:Ee},we))})));s.useImperativeHandle(t,(function(){return{handleEnterAction:function(){ze.close(),Gt.current&&(Gt.current.value=Le.startDate?st(Le.startDate,ft(!1)):""),Kt.current&&(Kt.current.value=Le.endDate?st(Le.endDate,ft(!1)):"")}}}),[Le]);var Mn=(0,T.tN)({targetRef:$e,overlayRef:Pt,placement:"bottom left",offset:0,isOpen:ze.isOpen,shouldFlip:Te}),_n=Mn.overlayProps,Bn=Mn.updatePosition;_n=(0,a.Z)((0,a.Z)({},_n),{},{style:(0,a.Z)((0,a.Z)({},_n.style),{},{maxHeight:"fit-content"})});var Pn=(0,a.Z)((0,a.Z)({},ze),{},{close:Bn}),Fn=(0,T.IB)({type:"dialog"},Pn,$e).triggerProps,Ln=s.cloneElement(Sn,(0,a.Z)((0,a.Z)((0,a.Z)({},Fn),Sn.props),{},{ref:$e,componentReference:$e}));(0,s.useEffect)((function(){Re&&zt&&(nn(!1),setTimeout((function(){je&&je.current&&je.current.scrollIntoView({behavior:"smooth"})}),250))}),[Re,zt]);var Vn=Re&&zt?null:Ln;return(0,k.tZ)(Oa,{dateFormat:ut,focusedDate:St,selectPhase:Le.selectPhase,isDateFocused:Et,isDateSelected:Dt,isDateHovered:Zt,isDateBlocked:kt,isFirstOrLastSelectedDate:Ct,onDateSelect:Ot,onDateFocus:wt,onDateHover:Tt,isStartDate:xt,isEndDate:It,getMinimumEnabledDate:Nt},(0,k.tZ)("div",{ref:t,style:{alignSelf:"start"}},Re?(0,k.tZ)(s.Fragment,null,Vn,zt&&(0,k.tZ)("div",{onScroll:function(e){if(Ne){var t=(0,ee.Z)(Ne,(0,R.Z)());if((0,te.Z)(Ne,(0,L.Z)((0,U.Z)((0,R.Z)(),t)))>0&&t++,t>Le.numberOfMonths)e.target.scrollHeight-e.target.scrollTop===e.target.clientHeight&&(t-Le.numberOfMonths>=3?Ve((0,a.Z)((0,a.Z)({},Le),{},{numberOfMonths:Le.numberOfMonths+3})):Ve((0,a.Z)((0,a.Z)({},Le),{},{numberOfMonths:t-Le.numberOfMonths})))}else{e.target.scrollHeight-e.target.scrollTop===e.target.clientHeight&&Ve((0,a.Z)((0,a.Z)({},Le),{},{numberOfMonths:Le.numberOfMonths+3}))}}},(0,k.tZ)(ia,{label:Ae("cmp-datepicker-dialog-title","Date Range"),onDismiss:an},(0,k.tZ)(ra,{title:Ae("cmp-datepicker-header-title","Filters"),onBackButtonPress:an}),(0,k.tZ)(I.xu,{p:"2"},Sn),(0,k.tZ)(sa,null,An),(0,k.tZ)(ua,{align:"end"},Tn)))):(0,k.tZ)(s.Fragment,null,Ln,ze.isOpen?(0,k.tZ)(T.Xj,null,(0,k.tZ)(Nn,Object.assign({},_n,{popoverRef:Pt,activeTab:he,currentTab:ye,onClose:function(){on(Le.startDate,!1),ln(Le.endDate,!1),null===Ze||void 0===Ze||Ze({startDate:Le.startDate,endDate:Le.endDate}),Ve((function(e){return(0,de.ZP)(e,(function(e){e.focusedInput=null,e.selectPhase=null}))})),ze.close(),Jt(!1)}}),(0,k.tZ)("div",null,wn,An,(0,k.tZ)(qe,{p:"2",variant:"separators.default",align:"space-between",onKeyDown:function(e){27===e.ke
1yCode&&sn()}},Tn)))):null)))}var Eo=s.forwardRef(ko);function So(e){return s.createElement(be.B,Object.assign({name:e.name,as:I.xv,variant:"errorMessage",role:"alert"},e))}var To={SAME:"same",DIFFERENT:"different"},Oo=["10:30 AM","2:00 PM","5:00 PM"].map((function(e){return{value:e,labelKey:e}}));function wo(e){var t,n,o,i,l,u,d,f,p,m,g,h,y,b,D,Z,C,x,E,S,T,w=Oe(),A=e.errors,R=e.formState.isSubmitted,M=e.labels,_=e.watch("origin",e.defaultOrigin),B=e.defaultOrigin&&""!==e.defaultOrigin.value,N=s.useState(!1),P=(0,v.Z)(N,2),F=P[0],L=P[1],V=e.defaultDestination&&""!==e.defaultDestination.value,z=s.useState(!1),H=(0,v.Z)(z,2),G=H[0],K=H[1],j=e.watch("airlines",{value:null!==(t=e.prepopulatedAirlines)&&void 0!==t?t:"",label:null!==(n=e.prepopulatedAirlines)&&void 0!==n?n:""}),U=e.watch("destination",e.defaultDestination),W=(0,s.useState)({startDate:null,endDate:null}),Y=(0,v.Z)(W,2),q=Y[0],Q=Y[1],X=(0,s.useState)(!1),J=(0,v.Z)(X,2),$=J[0],ee=J[1],te=null!==(o=e.componentsConfigurations.locationSelector)&&void 0!==o?o:{},ne=null!==(i=e.componentsConfigurations.locationSelector)&&void 0!==i&&i.originTitle?w(null===(l=e.componentsConfigurations.locationSelector)||void 0===l?void 0:l.originTitle):"",oe=null!==(u=e.componentsConfigurations.locationSelector)&&void 0!==u&&u.destinationTitle?w(null===(d=e.componentsConfigurations.locationSelector)||void 0===d?void 0:d.destinationTitle):"",ie=e.componentsConfigurations.dateSelector,le=e.componentsConfigurations.flexibleDatesSelector,re=e.componentsConfigurations.airlinesSelector,se=null!==(f=e.filterFields)&&void 0!==f?f:en.NONE,ue=null===(p=e.showOrigin)||void 0===p||p,de=null===(m=e.showDestination)||void 0===m||m,ce=e.originDestinationLogic===To.SAME,ve=s.useCallback((function(e){return e.map((function(e){return{value:e.value,label:w(e.labelKey,e.labelKey)}}))}),[w]),fe=s.useMemo((function(){var t,n;return ve(null!==(t=null===(n=e.timePickerOptions)||void 0===n?void 0:n.options)&&void 0!==t?t:Oo)}),[null===(g=e.timePickerOptions)||void 0===g?void 0:g.options,ve]),pe=tn(e.fetchAirports,{airportType:"ORIGIN",selectedDestination:null!==U&&void 0!==U&&U.value&&!ce?U.value:void 0,filterFields:se,avoidCall:!ue,sameCall:ce,panel:e.activeTab}).data,me=void 0===pe?[]:pe,ge=tn(e.fetchAirports,{airportType:"DESTINATION",selectedOrigin:null!==_&&void 0!==_&&_.value?_.value:void 0,filterFields:se,avoidCall:!de||ce,panel:e.activeTab}).data,he=void 0===ge?[]:ge;ce&&0===he.length&&(he=(0,c.Z)(me));var ye=function(e,t){var n,a="origin-".concat(t.selectedOrigin,"-destination-").concat(t.selectedDestination);return(0,O.useQuery)(a,(function(){return e(t)}),{refetchOnWindowFocus:!1,staleTime:864e5,enabled:null!==(n=t.enableFilter)&&void 0!==n&&n})}(e.fetchAirlines,{selectedOrigin:null!==(h=e.airlines)&&void 0!==h&&h.enabled?null===_||void 0===_?void 0:_.value:"",selectedDestination:null!==(y=e.airlines)&&void 0!==y&&y.enabled?null===U||void 0===U?void 0:U.value:"",enableFilter:e.showAirlines}).data,be=void 0===ye?[]:ye;function De(e,t){if(t)for(var n=0;n<t.length;n++){var a=t[n];if(a.airlineCode===e)return a}return null}function Ze(){return!_||!U||""===(null===_||void 0===_?void 0:_.value)||""===(null===U||void 0===U?void 0:U.value)}var Ce=void 0!==e.airlines?function(e){var t=null===_||void 0===_?void 0:_.value,n=null===U||void 0===U?void 0:U.value,a=e.airlinesList,o=[];if(void 0!==a&&a.length>0)if(""===t&&""===n)for(var i=0;i<a.length;i++){var l=a[i];o.push({value:l.airlineCode,label:w(l.labelKey,l.defaultValue)})}else{if(""===t||""===n)return[];t&&""!==t&&n&&""!==n&&(o=function(e){for(var t=[],n=0;n<be.length;n++){var a=be[n];if(a.valid){var o=De(a.iataCode,e);null!==o&&t.push({value:o.airlineCode,label:w(o.labelKey,o.defaultValue)})}}return t}(a))}return o}(e.airlines):[],xe=e.updateSelectedOrigin,Ie=e.updateSelectedDestination;(0,s.useEffect)((function(){var e;xe(null!==(e=null===_||void 0===_?void 0:_.value)&&void 0!==e?e:"")}),[_,xe]),(0,s.useEffect)((function(){var e;Ie(null!==(e=null===U||void 0===U?void 0:U.value)&&void 0!==e?e:"")}),[U,Ie]);var ke=function(e,t){var n=("noon"===(null===t||void 0===t?void 0:t.toLowerCase())?"12:00":null===t||void 0===t?void 0:t.toLowerCase()).split(" "),a=(0,v.Z)(n,2),o=a[0],i=a[1],l=o.split(":"),r=(0,v.Z)(l,2),s=r[0],u=r[1];return e.setHours("pm"===(null===i||void 0===i?void 0:i.toLowerCase())?+s+12:+s),e.setMinutes(+u),e.setSeconds(0),e},Ee=function(e){var t,n,a,o,i=ke(new Date(null!==(t=null===e||void 0===e?void 0:e.start)&&void 0!==t?t:""),null!==(n=null===e||void 0===e?void 0:e.startTime)&&void 0!==n?n:"noon");return ke(new Date(null!==(a=null===e||void 0===e?void 0:e.end)&&void 0!==a?a:""),null!==(o=null===e||void 0===e?void 0:e.endTime)&&void 0!==o?o:"noon").valueOf()-i.valueOf()>0},Se=s.useRef(null),Te=Be();return(0,k.tZ)(Ve,{variant:"layout.filters",gap:2,columns:e.columns,rows:e.rows},ue?(0,k.tZ)(ae.Qr,{render:function(t){var n,a,o=t.onChange,i=t.name;return(0,k.tZ)(xa,Object.assign({key:e.activeTab,descriptionIconCloseA
1ction:w("cmp-clean-button-action-description-origin","Location cleared"),isPrepopulatedValue:B,wasSetedPrepopulatedValue:F,setWasSetedPrepopulatedValue:L,defaultValue:null===(n=me.find((function(t){return t.value===e.defaultOrigin.value})))||void 0===n?void 0:n.value,label:w(M.origin||"From"),options:me,active:Boolean(null===_||void 0===_?void 0:_.value),onChange:function(t){t.value&&t.value!==(null===_||void 0===_?void 0:_.value)&&e.onOriginChange(t),t.label&&""!==t.label&&t.label===(null===U||void 0===U?void 0:U.label)&&(ee(!0),setTimeout((function(){return ee(!1)}),500)),o(t)},errorMessage:(0,k.tZ)(So,{errors:A,name:i}),hasError:!!A.origin,placeholder:w(null!==(a=M.originPlaceholder)&&void 0!==a?a:"cmp-booking-flight-origin-placeholder","Choose city or airport"),onKeyDown:function(t){13===t.keyCode&&setTimeout((function(){null!==e&&void 0!==e&&e.trigger&&(null===e||void 0===e||e.trigger("origin"))}),200)},ariaLabelIconClose:w("cmp-clear-icon","Clear"),ariaLabelIconToggle:w("cmp-clear-icon-toggle","Clear")},te,{title:ne}))},name:"origin",control:e.control,rules:{validate:{required:function(e){return!!e.label||w("cmp-origin-validation-message","Origin is required")}}}}):null,de?(0,k.tZ)(ae.Qr,{render:function(t){var n,a=t.onChange,o=t.name;return(0,k.tZ)(xa,Object.assign({key:e.activeTab,descriptionIconCloseAction:w("cmp-clean-button-action-description-destination","Location cleared"),isPrepopulatedValue:V,wasSetedPrepopulatedValue:G,setWasSetedPrepopulatedValue:K,defaultValue:e.defaultDestination.value,hasError:!!A.destination,errorMessage:(0,k.tZ)(So,{errors:A,name:o}),placeholder:w(null!==(n=M.destinationPlaceholder)&&void 0!==n?n:"cmp-booking-flight-destination-placeholder","Choose city or airport"),label:w(M.destination||"To"),active:Boolean(null===U||void 0===U?void 0:U.value),onChange:function(t){t.value&&t.value!==(null===U||void 0===U?void 0:U.value)&&e.onDestinationChange(t),a(t)},options:he,ariaLabelIconClose:w("cmp-clear-icon","Clear"),ariaLabelIconToggle:w("cmp-clear-icon-toggle","Clear"),onKeyDown:function(t){13===t.keyCode&&setTimeout((function(){null!==e&&void 0!==e&&e.trigger&&(null===e||void 0===e||e.trigger("destination"))}),200)}},te,{title:oe,resetInputValue:$}))},name:"destination",control:e.control,rules:{validate:{required:function(e){return!!e.label||w("cmp-destination-validation-message","Destination is required")}}}}):null,(0,k.tZ)(ae.Qr,{render:function(t){var n,o,i,l,r,s,u,d,c,v,f,p,m,g,h,y,b,D,Z,C,x,I=t.onChange,E=t.name;return(0,k.tZ)(Eo,{ref:Se,shouldFlip:void 0!==(null===ie||void 0===ie?void 0:ie.shouldFlip)&&(null===ie||void 0===ie?void 0:ie.shouldFlip),activeTab:e.activeTab,currentTab:e.currentTab,selectedDates:q,setSelectedDates:Q,labels:M,startDateErrorMessage:(0,k.tZ)(So,{errors:(0,a.Z)((0,a.Z)({},A),{},{dates:(0,a.Z)((0,a.Z)({},A.dates),{},{message:"requiredDiffTime"===(null===(n=A.dates)||void 0===n?void 0:n.type)?null===(o=A.dates)||void 0===o?void 0:o.message:w(null!==(i=null===(l=e.labels)||void 0===l?void 0:l.startDateValidationMessage)&&void 0!==i?i:"cmp-date-range-start-validation-message","Pick a start date")})}),name:E}),startDateTimeErrorMessage:(0,k.tZ)(So,{errors:(0,a.Z)((0,a.Z)({},A),{},{dates:(0,a.Z)((0,a.Z)({},A.dates),{},{message:"requiredDiffTime"===(null===(r=A.dates)||void 0===r?void 0:r.type)?null===(s=A.dates)||void 0===s?void 0:s.message:w(null!==(u=null===(d=e.labels)||void 0===d?void 0:d.startTimeValidationMessage)&&void 0!==u?u:"cmp-date-range-start-validation-message","Pick a start date")})}),name:E}),endDateErrorMessage:(0,k.tZ)(So,{errors:(0,a.Z)((0,a.Z)({},A),{},{dates:(0,a.Z)((0,a.Z)({},A.dates),{},{message:"requiredDiffTime"===(null===(c=A.dates)||void 0===c?void 0:c.type)?null===(v=A.dates)||void 0===v?void 0:v.message:w(null!==(f=null===(p=e.labels)||void 0===p?void 0:p.endDateValidationMessage)&&void 0!==f?f:"cmp-date-range-end-validation-message","Pick an end date")})}),name:E}),endDateTimeErrorMessage:(0,k.tZ)(So,{errors:(0,a.Z)((0,a.Z)({},A),{},{dates:(0,a.Z)((0,a.Z)({},A.dates),{},{message:"requiredDiffTime"===(null===(m=A.dates)||void 0===m?void 0:m.type)?null===(g=A.dates)||void 0===g?void 0:g.message:w(null!==(h=null===(y=e.labels)||void 0===y?void 0:y.endTimeValidationMessage)&&void 0!==h?h:"cmp-date-range-end-validation-message","Pick an end date")})}),name:E}),startDateHasError:R&&!!A.dates&&void 0===e.selectedDepartureDate,endD
1ateHasError:e.singleDateSelection&&"rt"===(null===e||void 0===e?void 0:e.flightType)?R&&!!A.dates&&void 0===e.selectedReturnDate&&void 0!==e.selectedDepartureDate:R&&!!A.dates&&"rt"===(null===e||void 0===e?void 0:e.flightType)&&(void 0===e.selectedReturnDate&&void 0!==e.selectedDepartureDate||void 0===e.selectedReturnDate&&void 0===e.selectedDepartureDate||"requiredDiffTime"===(null===(b=A.dates)||void 0===b?void 0:b.type)&&!Ee(null===(D=e.getValues)||void 0===D?void 0:D.call(e).dates)),defaultValue:e.defaultDates,timeOptions:fe,showTimePickers:!!e.showTimePickers,singleSelection:e.singleDateSelection,minDate:null===(Z=e.blackoutDates)||void 0===Z?void 0:Z.minDate,maxDate:null===(C=e.blackoutDates)||void 0===C?void 0:C.maxDate,maxRange:e.maxTripDuration,minRange:e.minTripDuration,dateFormat:null===ie||void 0===ie?void 0:ie.dateFormat,dayFormat:null!==(x=null===ie||void 0===ie?void 0:ie.dayFormat)&&void 0!==x?x:"D",dateFormatOnEdit:null===ie||void 0===ie?void 0:ie.dateFormatOnEdit,enableAutomaticStatusNavBarButtons:null===ie||void 0===ie?void 0:ie.enableAutomaticStatusNavBarButtons,showFlexibleDates:null===le||void 0===le?void 0:le.enabled,flexibleDates:null===le||void 0===le?void 0:le.defaultValue,onChange:function(t){e.updateSelectedDepartureDate(t.start),e.updateSelectedReturnDate(t.end),void 0!==t.start&&t.start!==e.selectedDepartureDate?e.onDepartureDateChange(t.start,t.end):void 0!==t.end&&t.end!==e.selectedReturnDate&&e.onReturnDateChange(t.end,t.start),I(t)},onKeyDownHandleEnterAction:function(t){13===t.keyCode&&setTimeout((function(){var t;null!==e&&void 0!==e&&e.trigger&&(null===e||void 0===e||e.trigger("dates")),null===Se||void 0===Se||null===(t=Se.current)||void 0===t||t.handleEnterAction()}),200)},trigger:null===e||void 0===e?void 0:e.trigger,fetchBlackoutDates:null===e||void 0===e?void 0:e.fetchBlackoutDates,blackoutDatesIntegration:null===e||void 0===e?void 0:e.blackoutDatesIntegration,selectedOrigin:_,selectedDestination:U,flightType:null===e||void 0===e?void 0:e.flightType,setValue:null===e||void 0===e?void 0:e.setValue,getValues:null===e||void 0===e?void 0:e.getValues,customInputStyle:null===ie||void 0===ie?void 0:ie.customInputStyle,allowHoverStyleInRange:e.allowHoverStyleInRange})},name:"dates",rules:{validate:{required:function(t){var n,a,o,i,l,r,s,u,d,c;return e.singleDateSelection?!!e.selectedDepartureDate||w(null!==(n=null===(a=e.labels)||void 0===a?void 0:a.startDateValidationMessage)&&void 0!==n?n:"cmp-date-range-start-validation-message","Pick a start date"):!1===!(null===t||void 0===t||!t.start)&&!1===!(null===t||void 0===t||!t.end)?w(null!==(o=null===(i=e.labels)||void 0===i?void 0:i.rangeDateValidationMessage)&&void 0!==o?o:"cmp-date-range-validation-message","Pick a date range"):!1===!(null===t||void 0===t||!t.start)&&!0===!(null===t||void 0===t||!t.end)?w(null!==(l=null===(r=e.labels)||void 0===r?void 0:r.startDateValidationMessage)&&void 0!==l?l:"cmp-date-range-start-validation-message","Pick a start date"):!0===!(null===t||void 0===t||!t.start)&&!1===!(null===t||void 0===t||!t.end)?w(null!==(s=null===(u=e.labels)||void 0===u?void 0:u.endDateValidationMessage)&&void 0!==s?s:"cmp-date-range-end-validation-message","Pick an end date"):!!e.selectedDepartureDate||!!e.selectedReturnDate||w(null!==(d=null===(c=e.labels)||void 0===c?void 0:c.rangeDateValidationMessage)&&void 0!==d?d:"cmp-date-range-validation-message","Pick a date range")},requiredDiffTime:function(t){var n,a;if(e.showTimePickers&&!0===!(null===t||void 0===t||!t.start)&&!0===!(null===t||void 0===t||!t.end)&&!0===!(null===t||void 0===t||!t.startTime)&&!0===!(null===t||void 0===t||!t.endTime))return Ee(t)||w(null!==(n=null===(a=e.labels)||void 0===a?void 0:a.rangeDateTimeValidationMessage)&&void 0!==n?n:"cmp-date-range-time-validation-message","Return time should be after departure time")},requiredStart:function(t){var n,a;return!!e.selectedDepartureDate||w(null!==(n=null===(a=e.labels)||void 0===a?void 0:a.startDateValidationMessage)&&void 0!==n?n:"cmp-date-range-start-validation-message","Pick a start date")},requiredEnd:function(t){var n,a;return e.singleDateSelection||!!e.selectedReturnDate||w(null!==(n=null===(a=e.labels)||void 0===a?void 0:a.endDateValidationMessage)&&void 0!==n?n:"cmp-date-range-end-validation-message","Pick an end date")}}},control:e.control}),e.showAirlines?(0,k.tZ)(ae.Qr,{render:function(t){var n,a=t.onChange;return(0,k.tZ)("div",null,(0,k.tZ)(xa,Object.assign({label:w("cmp-booking-filter-airlines-label","Airlines"),options:Ce,onChange:function(t){t.value&&t.value!==(null===j||void 0===j?void 0:j.value)&&e.onAirlineChange(t),a(t)},defaultValue:null!==(n=e.prepopulatedAirlines)&&void 0!==n?n:"",errorMessage:(0,k.tZ)(So,{errors:A,n
1ame:"airlines"}),hasError:!!A.airlines||!Ze()&&0===Ce.length&&0!==be.length,placeholder:w("cmp-booking-flight-airlines-placeholder","Choose Airline"),ariaLabelIconClose:w("cmp-clear-icon","Clear"),ariaLabelIconToggle:w("cmp-clear-icon-toggle","Toggle"),disabled:Ze()},re)),!Ze()&&0===Ce.length&&0!==be.length&&(0,k.tZ)("p",{style:{fontSize:"12px"}},w("cmp-airlines-validation-message-no-airlines","No airlines available for the selected route")))},name:"airlines",control:e.control,rules:{validate:{required:function(e){var t=void 0===e?{label:"",value:""}:e;if(!Ze()&&""===t.label)return!!t.label||w("cmp-airlines-validation-message","Airlines is required")}}}}):null,(0,k.tZ)(nt,{columns:e.ctaHalfWidth?2:void 0,colGap:2,variant:"layout.ctaContainer"},e.ctaHalfWidth?(0,k.tZ)("div",null):null,(0,k.tZ)(I.zx,{type:"submit",variant:"primaryLg",disabled:R&&!(0,r.o)(A)&&(void 0===e.selectedDepartureDate||void 0===e.selectedReturnDate||""===(null===(b=e.getValues)||void 0===b||null===(D=b.call(e).destination)||void 0===D?void 0:D.value)||""===(null===(Z=e.getValues)||void 0===Z||null===(C=Z.call(e).origin)||void 0===C?void 0:C.value)),onClick:function(){null!==e&&void 0!==e&&e.onSubmit&&(null===e||void 0===e||e.onSubmit())}},e.isLoading?(0,k.tZ)(I.xu,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",variant:"forms.spinner"}},(0,k.tZ)(I.$j,{size:32})):w(M.submit||"Find Booking"))),null!==e&&void 0!==e&&null!==(x=e.disclaimer)&&void 0!==x&&x.enabled?(0,k.tZ)(I.xu,{sx:{display:"flex",flexDirection:Te?"column":"row",gap:"14px",mt:"20px",variant:"layout.disclaimerLinks"}},(0,k.tZ)(un,Object.assign({label:"cmp-booking-mask-disclaimer"},null===e||void 0===e?void 0:e.disclaimer)),null!==e&&void 0!==e&&null!==(E=e.disclaimer)&&void 0!==E&&E.links?null===e||void 0===e||null===(S=e.disclaimer)||void 0===S||null===(T=S.links)||void 0===T?void 0:T.map((function(e){return(0,k.tZ)(dn,e)})):null):null)}function Ao(e){var t,n,a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3?arguments[3]:void 0,o=e.options.map((function(e){return e.maxCount})),i=e.options.map((function(e){var t;return null!==(t=e.minCount)&&void 0!==t?t:0})),l=Jn(e.options,e.defaultSelection),r=null===e||void 0===e?void 0:e.totalTravelersPerRoomExcludeInfants,s=null!==e&&void 0!==e&&e.totalTravelersPerRoomExcludeInfants?e.options.findIndex((function(e){return"age3"===e.name})):-1,u=qn(n,e),d=(0,pe.M)((function(n,o,i){var l=(0,de.ZP)(n,(function(t){var a="AGE_CHANGE"===o.type?o.typeIndex:o.index,i=u(n,o.type,a).ruleActions;switch(o.type){case"ADD":var l=o.index;m(o,n)&&(t.count[l]+=1,t.ages[l].push(e.options[l].minAge));break;case"REMOVE":var r=o.index;m(o,n)&&(t.count[r]-=1,t.ages[r].pop(),i(t));break;case"AGE_CHANGE":var s=o.typeIndex,d=o.instanceIndex;t.ages[s][d]=o.value;break;case"VALUE_SET":return o.value}}));return i((function(){switch(null===t||void 0===t||t(l),o.type){case"ADD":var n;null===a||void 0===a||null===(n=a.add)||void 0===n||n.call(a,l);break;case"REMOVE":var i;null===a||void 0===a||null===(i=a.remove)||void 0===i||i.call(a,l);break;case"AGE_CHANGE":var r,s;null!==(r=e.options[o.typeIndex])&&void 0!==r&&r.shouldDetailAges&&(null===a||void 0===a||null===(s=a.change)||void 0===s||s.call(a,l))}})),l}),l),c=(0,v.Z)(d,2),f=c[0],p=c[1];function m(t,n){var a=fn(r?n.count.filter((function(e,t){return t!==s})):n.count),l=!(!r||s!==t.index)||a<e.totalTravelers,d=u(n,t.type,t.index).valid;switch(t.type){case"ADD":var c=t.index;return d&&l&&(void 0===o[c]||n.count[c]<o[c]);case"REMOVE":var v=t.index;return n.count[v]>i[v];default:return!0}}return{value:f,dispatch:p,count:fn(f.count),isEventValid:m}}(e.passengers,(function(t){y||e.onChange({passengers:t,travelClass:g})}),null===e||void 0===e?void 0:e.passengersRules,{add:function(t){var n;null===(n=e.trackTravelersChange)||void 0===n||n.call(e,t)},remove:function(t){var n;null===(n=e.trackTravelersChange)||void 0===n||n.call(e,t)},change:function(t){var n;null===(n=e.trackTravelersChange)||void 0===n||n.call(e,t)}}),o={passengers:a.value,travelClass:e.travelClasses.defaultValue},i=(0,s.useMemo)((function(){var t,n={},a=(0,De.Z)(e.travelClasses.options);try{for(a.s();!(t=a.n()).done;){var o=t.value;n[o.value]=o.label}}catch(i){a.e(i)}finally{a.f()}return n}
1),[e.travelClasses.options]),l=Oe(),r=(0,s.useState)(o),u=(0,v.Z)(r,2),d=u[0],f=u[1],p=(0,s.useState)(e.travelClasses.defaultValue),m=(0,v.Z)(p,2),g=m[0],h=m[1],y=Be(),b=null===(t=null===(n=e.travelClassConfig)||void 0===n?void 0:n.enabled)||void 0===t||t,D=(0,s.useRef)(),Z=l("cmp-flight-info-title","Flight Info"),C=l("cmp-passengers-class-label","{passengerCount} passenger, {travelClass}",{passengerCount:a.count,travelClass:i[g]}),x=l("cmp-passengers-class-label","{passengerCount} passenger",{passengerCount:a.count}),I=-1;function E(e,t,n){var a=I,o=e[0],i=e[1],l=e[2];if(0!==o.length)switch(o[0]){case"origin":for(var r=o[1],s=0;s<r.length;s++)if(t===r[s]){a=l?0:1;break}if(a===I){var u=i[1];if(void 0!==u)for(var d=0;d<u.length;d++)if(n===u[d]){a=l?0:1;break}}a===I&&(a=l?1:0);break;case"destination":for(var c=o[1],v=0;v<c.length;v++)if(n===c[v]){a=l?0:1;break}if(a===I){var f=i[1];if(void 0!==f)for(var p=0;p<f.length;p++)if(t===f[p]){a=l?0:1;break}}a===I&&(a=l?1:0)}else if(0!==i.length){switch(i[0]){case"origin":for(var m=i[1],g=0;g<m.length;g++)if(t===m[g]){a=l?0:1;break}a===I&&(a=l?1:0);break;case"destination":for(var h=i[1],y=0;y<h.length;y++)if(n===h[y]){a=l?0:1;break}a===I&&(a=l?1:0)}}return a}var S=function(e,t,n){for(var a,o,i=[],l=I,r=0;r<n.length;r++)if(void 0!==(o=n[r]).rules&&0!==o.rules.length){a=o.rules;for(var s=0;s<a.length;s++)l=E(a[s],e,t);0===l&&i.push(o),l=I}else i.push(o);return i}(e.origin,e.destination,e.travelClasses.options),T=b&&0!==S.length,O=function(e){for(var t=0;t<S.length;t++){if(S[t].value===e)return!0}return!1},w=T&&O(g);return(0,k.tZ)(fa,{variant:"layout.popover",label:Z,enabledDoneButton:e.enabledDoneButton,labelBottomBtn:l("cmp-booking-mask-passenger-done-button","Done"),toggleElement:(0,k.tZ)(xn,{value:w?C:x,"aria-label":"".concat(Z," ").concat(C),active:!0}),onSave:function(){var t={passengers:a.value,travelClass:g,passengerTypes:e.passengers};e.onChange(t),f(t)},onDismiss:function(){h(d.travelClass),a.dispatch({type:"VALUE_SET",value:d.passengers})}},(0,k.tZ)(ha,null,b?(0,k.tZ)("div",null,(0,k.tZ)(Rn,{ref:D,label:l("cmp-flight-travel-class-title","Travel Class"),layout:"standard",className:"travelClass",options:S,disabled:e.activateRouteOption&&(!e.origin||!e.destination),key:Math.floor(100*Math.random()+1),value:function(){var e=O(g);return T&&e?g:""}(),focusWhenIsShow:!1,onChange:function(t){h(t),y||e.onChange({travelClass:t,passengers:a.value}),setTimeout((function(){var e;null===(e=D.current)||void 0===e||e.focusToggleElement()}),20)}})):null,(0,k.tZ)(Qn,{origin:e.origin,destination:e.destination,title:l("cmp-booking-passenger-title","Passengers"),options:function(e,t,n){for(var a,o,i=(0,c.Z)(n),l=I,r=0;r<n.length;r++)if(void 0!==(a=n[r]).rules&&0!==a.rules.length){o=a.rules;for(var s=0;s<o.length;s++)l=E(o[s],e,t);i[r].show=0===l,l=I}else i[r].show=!0;return i}(e.origin,e.destination,e.passengers.options),dispatch:a.dispatch,value:a.value,isEventValid:a.isEventValid})))}var Ro=function(e){var t,n,a,o=s.useContext(ke),i=o.direction,l=o.theme,r=(0,Ze.Z)(e,{direction:i,theme:l}),u=(0,v.Z)(r,2),d=u[0],c=u[1],f=Oe();return s.createElement(I.bZ,{className:d,style:c},s.createElement(je,{role:"img","aria-label":f(null!==(t=e.iconLabelKey)&&void 0!==t?t:"cmp-icon-legend-label","Information"),icon:null!==(n=e.icon)&&void 0!==n?n:"info",sx:{mr:"4px",width:"20px",height:"20px",mt:"3px"}}),s.createElement(I.xv,{sx:{flex:9},dangerouslySetInnerHTML:{__html:f(null!==(a=e.labelKey)&&void 0!==a?a:"cmp-legend")}}))};function Mo(e,t,n){if(n)return(0,a.Z)({key:le()(),types:null!==t&&void 0!==t?t:[]},n);var o=Array(e);o.fill(0),o[0]=1;var i=Array(e);return i.fill([]),{key:le()(),count:o,ages:i,types:null!==t&&void 0!==t?t:[]}}function _o(e){var t,n,a,o,i,l,r,u,d=Oe(),c=Te(),f=e.rooms.totalRooms,p=e.rooms.totalTravelers,m=(0,s.useState)(!1),g=(0,v.Z)(m,2),h=g[0],y=g[1],b=s.useState(le()()),D=(0,v.Z)(b,1)[0],Z=(0,s.useState)(null!==(t=null===(n=e.defaultValue)||void 0===n?void 0:n.rooms)&&void 0!==t?t:[]),C=(0,v.Z)(Z,2),x=C[0],E=C[1],S=(0,s.useState)(null!==(a=null===(o=e.defaultValue)||void 0===o?void 0:o.travelClass)&&void 0!==a?a:""),T=(0,v.Z)(S,2),O=T[0],w=T[1],A=s.useRef(null),R=s.useRef(null),M=s.useRef(null),_=function(e,t,n){var a,o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],l=arguments.length>4?arguments[4]:void 0,r=arguments.length>5?arguments[5]:void 0,s=e.options.map((function(e){return e.maxCount})),u=e.options.map((function(e){var t;return null!==(t=e.minCount)&&void 0!==t?t:0})),d=e.options.length,c=e.options.map((function(e){var t;return null!==(t=e.type)&&void 0!==t?t:""})),f=null!==t&&void 0!==t?t:[Mo(d,c)],p=null!==(a=e.totalTravelers)&&void 0!==a?a:1e3,m=null!==(o=e.totalTravelersPerRoom)&&void 0!==o?o:1e3,g=e.totalTravelersPerRoomExcludeInfants,h=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=b(t,e.type,e.index,a).valid;switch(e.type){case"ADD":var i=fn(t.count.filter((function(e,t){return t!==D}))),l=e.index,r=!!(g&&l===D||a)||i<m,d=!(!g||D!==e.index)||n<p;return o&&r&&d&&(a||void 0===s[l]||t.count[l]<s[l]);case"REMOVE":var c=e.index;return t.count[c]>u[c];default:return!0}},y=function(e){var t={key:"global-room",count:[0,0,0,0],ages:[[],[],[],[]],types:["","","",""]};return e.forEach((function(e){e.count.forEach((function(e,n){return t.count[n]+=e}
1)),e.ages.forEach((function(e,n){return e.forEach((function(e){return t.ages[n].push(e)}))}))})),t},b=qn(i,e),D=null!==e&&void 0!==e&&e.totalTravelersPerRoomExcludeInfants?e.options.findIndex((function(e){return"age3"===e.name})):-1,Z=y(f),C=(0,pe.M)((function(t,a,o){var i=y(t.rooms),s=(0,de.ZP)(t.rooms,(function(n){var o=fn(t.rooms.map((function(e){return fn(e.count.filter((function(e,t){return t!==D})))}))),r=b(n[a.roomIndex],a.type,a.index).ruleActions;switch(a.type){case"ADD":var s=n[a.roomIndex],u=a.index;h(a,s,o)&&h(a,i,o,!0)&&(s.count[u]+=1,i.count[u]+=1,s.ages[u].push(e.options[u].minAge));break;case"REMOVE":var v=n[a.roomIndex],f=a.index;h(a,v,o)&&(v.count[f]-=1,i.count[f]-=1,v.ages[f].pop(),r(v));break;case"ADD_ROOM":o<p&&(n.push(Mo(d,c)),i.count[0]+=1,setTimeout((function(){l.current.scroll({top:1e3,left:0,behavior:"smooth"})}),500));break;case"REMOVE_ROOM":var m,g,y,Z,C=a.roomIndex,x=n.splice(C,1);i.count[0]-=null!==(m=x[0].count[0])&&void 0!==m?m:0,i.count[1]-=null!==(g=x[0].count[1])&&void 0!==g?g:0,i.count[2]-=null!==(y=x[0].count[2])&&void 0!==y?y:0,i.count[3]-=null!==(Z=x[0].count[3])&&void 0!==Z?Z:0;break;case"SET_ROOMS":return a.value;case"AGE_CHANGE":var I=n[a.roomIndex],k=a.typeIndex,E=a.instanceIndex;I.ages[k][E]=a.value;break;case"VALUE_SET":var S=n[a.roomIndex];S.ages=a.value.ages,S.count=a.value.count}}));return o((function(){switch(null===n||void 0===n||n(s),a.type){case"ADD":var t;null===r||void 0===r||null===(t=r.add)||void 0===t||t.call(r,s);break;case"REMOVE":var o;null===r||void 0===r||null===(o=r.remove)||void 0===o||o.call(r,s);break;case"ADD_ROOM":case"REMOVE_ROOM":case"SET_ROOMS":case"AGE_CHANGE":var i,l;if(null!==(i=e.options[a.typeIndex])&&void 0!==i&&i.shouldDetailAges)null===r||void 0===r||null===(l=r.change)||void 0===l||l.call(r,s)}})),{rooms:s,global:i}}),{rooms:f,global:Z}),x=(0,v.Z)(C,2),I=x[0],k=I.rooms,E=I.global,S=x[1];return{rooms:k,dispatch:S,isEventValid:function(e,t,n){return h(e,t,n)&&h(e,E,n,!0)}}}(e.rooms,x,(function(t){var n;return null===(n=e.onChange)||void 0===n?void 0:n.call(e,{rooms:t,travelClass:O})}),e.passengersRules,A,{add:function(t){var n;null===(n=e.trackTravelersChange)||void 0===n||n.call(e,t)},remove:function(t){var n;null===(n=e.trackTravelersChange)||void 0===n||n.call(e,t)},change:function(t){var n;null===(n=e.trackTravelersChange)||void 0===n||n.call(e,t)}}),B=_.rooms,N=_.dispatch,P=_.isEventValid,F=Be(),L=da({onDismiss:function(){N({type:"SET_ROOMS",value:x})},onSave:function(){E(B)}}),V=ca(),z=e.type.includes("flight")&&(null===(i=null===(l=e.travelClassConfig)||void 0===l?void 0:l.enabled)||void 0===i||i),H=-1;function G(e,t,n){var a=H,o=e[0],i=e[1],l=e[2];if(0!==o.length)switch(o[0]){case"origin":for(var r=o[1],s=0;s<r.length;s++)if(t===r[s]){a=l?0:1;break}if(a===H){var u=i[1];if(void 0!==u)for(var d=0;d<u.length;d++)if(n===u[d]){a=l?0:1;break}}a===H&&(a=l?1:0);break;case"destination":for(var c=o[1],v=0;v<c.length;v++)if(n===c[v]){a=l?0:1;break}if(a===H){var f=i[1];if(void 0!==f)for(var p=0;p<f.length;p++)if(t===f[p]){a=l?0:1;break}}a===H&&(a=l?1:0)}else if(0!==i.length){switch(i[0]){case"origin":for(var m=i[1],g=0;g<m.length;g++)if(t===m[g]){a=l?0:1;break}a===H&&(a=l?1:0);break;case"destination":for(var h=i[1],y=0;y<h.length;y++)if(n===h[y]){a=l?0:1;break}a===H&&(a=l?1:0)}}return a}var K=B.length,j=e.rooms.totalTravelersPerRoomExcludeInfants?e.rooms.options.findIndex((function(e){return"age3"===e.name})):-1,U=fn(B.map((function(t){return fn(t.count.filter((function(t,n){return!e.rooms.totalTravelersPerRoomExcludeInfants||n!==j})))}))),W=c({count:U,variables:{guestsCount:U},key:"cmp-booking-guests-label",defaultValue:"{guestsCount} guests"}),Y=c({count:K,variables:{roomsCount:K},key:"cmp-booking-rooms-label",defaultValue:"{roomsCount} rooms"}),q=d("cmp-booking-rooms-aria-label","Select rooms and guests, "),Q=d("cmp-booking-rooms-selected-label"),X=d("cmp-booking-rooms-info-label","{guestsLabel}, {roomsLabel}",{guestsLabel:W,roomsLabel:Y}),J=(0,k.tZ)(xn,{value:X,"aria-label":"".concat(q," ").concat(Q," ").concat(X),onClick:F?L.open:V.toggle,ref:V.filterRef,active:!0}),$=null!==(r=e.rooms.enabledLegendIn)&&void 0!==r?r:[],ee=s.useRef(!1),te=function(){return ee.current=!0},ne=(0,k.tZ)(s.Fragment,null,$.filter((function(t){return t===e.type})).length>0?(0,k.tZ)(Ro,{icon:"info",labelKey:"cmp-room-selector-legend",sx:{padding:"8px",ml:"dialogMargin",mr:"dialogMargin",variant:"layout.legend"}}):null,z?(0,k.tZ)("div",{sx:{pl:"dialogMargin",pr:"dialogMargin"}},(0,k.tZ)("div",{id:"screenReaderMessage-".concat(D),hidden:!0},d("cmp-booking-selected-travel-class-message","Selected")),(0,k.tZ)(Rn,{ariaLabelledBy:"screenReaderMessage-".concat(D),labelNotSelectedItem:d("cmp-travel-class-label-not-selected-item","Elements"),label:d("cmp-travel-class-label","Travel Class"),layout:"standard",disabled:e.activateRouteOption&&(!e.origin||!e.destination),focusWhenIsShow:!1,options:function(e,t,n){for(var a,o,i=[],l=H,r=0;r<n.length;r++)if(void 0!==(o=n[r]).rules&&0!==o.rules.length){a=o.rules;for(var s=0;s<a.length;s++)l=G(a[s],e,t);0===l&&i.push(o),l=H}else i.push(o);return i}(e.origin,e.destination,null===(u=e.travelClasses)||void 0===u?void 0:u.options),value:O,onClick:function(){return te()},onChange:function(t){var n;w(t),null===(n=e.onChange)||void 0===n||n.call(e,{rooms:B,travelClass:t})}})):null,(0,k.tZ)("div",{ref:A,id:"room-container",sx:{minHeight:"100px",overflowY:B.length>
11?"scroll":"auto",maxHeight:F?"100%":"300px",variant:"layout.roomSelector.scrollContainer"}},B.map((function(t,n){return(0,k.tZ)("div",{key:t.key,role:"group","aria-label":"".concat(d("cmp-booking-room-label","Room")," ").concat(n+1)},(0,k.tZ)(et,{gap:4,pl:"dialogMargin",pr:"dialogMargin"},(0,k.tZ)(qe,{align:"space-between"},(0,k.tZ)(I.xv,{variant:"text.fontSize4",color:"text"},d("cmp-booking-room-label","Room")," ".concat(n+1)),0!==n&&(0,k.tZ)(I.zx,{id:"remove-room-".concat(n),type:"button",variant:"links.fontSize5",sx:{bg:"transparent",textDecoration:"underline",p:"0"},onClick:function(){te(),N({type:"REMOVE_ROOM",roomIndex:n})},onKeyDown:function(e){e.keyCode!==Xa&&e.keyCode!==Ja||setTimeout((function(){R.current.focus()}),100)}},d("cmp-booking-remove-room-button","Remove"))),(0,k.tZ)(Bo,{origin:e.origin,destination:e.destination,roomIndex:n,options:e.rooms.options,dispatch:N,value:B[n],isEventValid:P,totalCount:U,preventBottomDisplacement:null===e||void 0===e?void 0:e.preventBottomDisplacement,filterContentRef:M,doNotClosePopup:te})),n<B.length-1&&(0,k.tZ)(Je,{sx:{marginTop:3,marginBottom:3},"aria-hidden":!0}))}))),B.length>=f&&(0,k.tZ)(ue.T,{"aria-live":"polite",role:"alert"},d("cmp-room-selector-maximum-room-reached","Maximum number of rooms reached."))),ae=(0,k.tZ)(qe,{variant:"layout.popover.footer",gap:2,align:"end"},B.length<f&&U<p?(0,k.tZ)(I.zx,{ref:R,type:"button",variant:"link",onClick:function(){te(),N({type:"ADD_ROOM"})},onKeyDown:function(e){(e.keyCode===Xa||e.keyCode===Ja)&&B.length+1>=f&&setTimeout((function(){var e=document.getElementById("remove-room-".concat(B.length));null===e||void 0===e||e.focus()}),100)}},d("cmp-booking-add-room-button","Add room")):null,(0,k.tZ)(I.zx,{type:"button",variant:"link",onFocus:function(){y(!1)},onClick:F?L.save:V.toggle,value:"Done"},d("cmp-booking-done-room-button","Done")));return s.useEffect((function(){var e=function(e){var t,n;(L.isOpen||null!==(t=V.ref.current)&&void 0!==t&&t.isOpen)&&(null!==(n=M.current)&&void 0!==n&&n.contains(e.target)||ee.current?ee.current=!1:V.close())};return document.addEventListener("click",e,!1),function(){V.close(),document.removeEventListener("click",e,!1)}}),[]),F?(0,k.tZ)(s.Fragment,null,J,L.isOpen&&(0,k.tZ)(ia,{label:e.title||"Select rooms"},(0,k.tZ)(ra,{title:e.title||d("cmp-booking-room-selector-header"),onBackButtonPress:L.dismiss}),(0,k.tZ)(sa,null,(0,k.tZ)(et,{ref:M,gap:4,pt:"30px",pb:"15px",sx:{variant:"layout.roomSelector.mobileContainer"}},ne)),(0,k.tZ)(ua,{align:"end"},ae))):(0,k.tZ)($n,{variant:"layout.popover",ref:V.ref,targetRef:V.filterRef,toggleElement:J,onClose:function(){L.save(),h||(V.filterRef.current.focus(),y(!0))}},(0,k.tZ)(et,{gap:4,pt:"30px",sx:{variant:"layout.roomSelector.dropdown"},ref:M},ne,ae))}function Bo(e){var t=e.dispatch,n=e.roomIndex,o=s.useCallback((function(e){t((0,a.Z)((0,a.Z)({},e),{},{roomIndex:n}))}),[t,n]);return(0,k.tZ)(Qn,{origin:e.origin,destination:e.destination,options:e.options,layout:"inline",dispatch:o,value:e.value,isEventValid:function(t,n){return e.isEventValid(t,n,e.totalCount)},preventBottomDisplacement:null===e||void 0===e?void 0:e.preventBottomDisplacement,filterContentRef:e.filterContentRef,doNotClosePopup:e.doNotClosePopup})}var No=function(e){var t=e.fieldName,n=e.defaultValue,a=e.selectedValue,o=e.options,i=e.getValues,l=void 0===i?function(){return{}}:i,r=e.setValue,u=void 0===r?function(){}:r,d=e.headerLabelKey,c=void 0===d?"":d,v=e.doneButtonLabelKey,f=void 0===v?"cmp-list-selector-filter-done-button":v,p=e.noSelectedItemLabelKey,m=void 0===p?"":p,g=Oe(),h=Be(),y=s.useMemo((function(){return o.filter((function(e){return e.value===n||e.value===a}))[0]}),[n,o,a]),b=!!l().carType,D=function(e){var n=e.item,a=n.value===y.value;return s.createElement(I.xu,{onClick:function(){u(t,n.value)},sx:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",variant:a?"buttons.selectedBase":"buttons.base"}},s.createElement(I.xv,{variant:"text.fontSize5"},g(n.label)),a?s.createElement(je,{icon:"check",size:20,sx:{fill:"primary"}}):null)},Z=s.createElement(fa,{label:g(c),title:g(c),onSave:function(){},saveOnClose:!0,toggleElement:s.createElement(xn,{active:b,value:g(y.label)}),labelBottomBtn:g(f,"Done")},s.createElement(ha,{showSeparator:!0},o.map((function(e){return s.createElement(D,{item:e})}
1)))),C=s.createElement(Rn,{label:g(c),value:null!==n&&void 0!==n?n:a,options:o,onChange:function(e){u(t,e)},labelNotSelectedItem:g(m,"Elements")});return h?Z:C},Po=function(e){var t=e.defaultValue,n=e.labelKey,a=void 0===n?"cmp-location-selector-label-redemption-unit":n,o=e.options,i=e.focusWhenIsShow,l=e.onChange,r=Oe(),u=(0,s.useState)((function(){return null!==t&&void 0!==t?t:o[0].value})),d=(0,v.Z)(u,1)[0];return s.createElement(Rn,{label:r(a),defaultValue:d,options:o,onChange:l,focusWhenIsShow:i})},Fo=[];function Lo(e){var t,n,o,i,l,r,u,d,c,f,p,m,g,h,y,b,D,Z,C,x,E,S,T,w,A,R,M,_,B,N,P,F,L,V,z,H,G=e.onRedemptionUnitChange,K=void 0===G?cn:G,j="string"===typeof e.type?e.type:e.type.defaultValue,U=Jn(null!==(t=null===(n=e.rooms)||void 0===n?void 0:n.options)&&void 0!==t?t:[],null!==(o=null===(i=e.rooms)||void 0===i?void 0:i.defaultSelection)&&void 0!==o?o:{}),W=null!==(l=e.additionalRules)&&void 0!==l?l:Fo,Y=null===(r=e.rooms)||void 0===r?void 0:r.options.map((function(e){var t;return null!==(t=e.type)&&void 0!==t?t:""})),q=(null===(u=e.componentsConfigurations.currencyMilesSelector)||void 0===u?void 0:u.enabled)||!1,Q=(0,s.useState)((function(){var t,n;return{type:j,flightType:e.journeyTypes.defaultValue,hotelCategory:e.hotelCategories.defaultValue,travelClass:e.travelClasses.defaultValue,passengers:e.passengers.defaultSelection,origin:{value:null!==(t=e.defaultOrigin)&&void 0!==t?t:"",label:""},destination:{value:null!==(n=e.defaultDestination)&&void 0!==n?n:"",label:""},dates:e.defaultDates,rooms:e.rooms?[Mo(e.rooms.options.length,Y,U)]:void 0,carType:e.carTypes.defaultValue,rules:Da(W),dropOff:e.dropOff.defaultValue,age:e.ages.defaultValue,nationality:e.nationalities.defaultValue,promoCode:e.promoCode,redemptionUnit:e.redemptionUnit.defaultValue}})),X=(0,v.Z)(Q,1)[0],J=(0,ae.cI)({defaultValues:X}),$=J.handleSubmit,ee=J.watch,te=J.control,ne=J.errors,oe=J.getValues,ie=J.setValue,le=J.register,re=J.trigger,se=J.formState,ue=ee("type",j),de=ee("travelClass",X.travelClass),ce=ee("dropOff",X.dropOff),ve=ee("carType",X.carType),fe=ee("flightType"),pe=ee("rooms"),me=(0,s.useState)(null!==(d=e.defaultOrigin)&&void 0!==d?d:""),ge=(0,v.Z)(me,2),he=ge[0],ye=ge[1],be=(0,s.useState)(null!==(c=e.defaultDestination)&&void 0!==c?c:""),De=(0,v.Z)(be,2),Ze=De[0],Ce=De[1],xe=(0,s.useState)(null===(f=e.defaultDates)||void 0===f?void 0:f.start),Ie=(0,v.Z)(xe,2),ke=Ie[0],Ee=Ie[1],Se=(0,s.useState)(null===(p=e.defaultDates)||void 0===p?void 0:p.end),Te=(0,v.Z)(Se,2),we=Te[0],Ae=Te[1],Re=(0,s.useState)(!1),Me=(0,v.Z)(Re,2),_e=Me[0],Be=Me[1],Ne=s.useMemo((function(){var e,t,n,a,o,i,l,r,s,u;return(null===(e=oe())||void 0===e||null===(t=e.origin)||void 0===t?void 0:t.country)&&(null===(n=oe())||void 0===n||null===(a=n.destination)||void 0===a?void 0:a.country)&&(null===(o=oe())||void 0===o||null===(i=o.origin)||void 0===i||null===(l=i.country)||void 0===l?void 0:l.isoCode)!==(null===(r=oe())||void 0===r||null===(s=r.destination)||void 0===s||null===(u=s.country)||void 0===u?void 0:u.isoCode)}),[null===(m=oe().origin)||void 0===m?void 0:m.country,null===(g=oe().destination)||void 0===g?void 0:g.country]),Pe=e.travelClasses.activateRouteOption||!1,Fe=mn(Pe?Ne?null!==(h=null===(y=e.travelClasses)||void 0===y?void 0:y.international)&&void 0!==h?h:e.travelClasses:null!==(b=null===(D=e.travelClasses)||void 0===D?void 0:D.domestic)&&void 0!==b?b:e.travelClasses:e.travelClasses);(0,s.useEffect)((function(){Pe&&ie("travelClass",Fe.defaultValue)}),[Fe.defaultValue,Pe,ie]);var Le,Ve,ze="side-banner"===e.layout||"dialog"===e.layout,He=Oe(),Ge=(0,s.useMemo)((function(){return(0,a.Z)((0,a.Z)({},e.componentsConfigurations),e.overrideComponentsConfigurations)}),[e.componentsConfigurations,e.overrideComponentsConfigurations]);if(ze)Le=[[1]],Ve="flight"===ue?["60px","60px","60px","minmax(0px, 1fr)"]:"hotel"===ue||"activity"===ue?["auto","auto","minmax(0px, 1fr)"]:"car"===ue?["auto","150px","minmax(0px, 1fr)"]:["auto","auto","auto","minmax(0px, 1fr)"];else if("car"===ue)Le=[[1],[1],[1],"different"===ce?[1,1,3,1]:[2,3,1]];else if("hotel"===ue||"activity"===ue)Le=[[1],[1],[1],[2,2,1]];else{var Ke;Le=[[1],[1],[1,1],null!==(Ke=e.componentsConfigurations.airlinesSelector)&&void 0!==Ke&&Ke.enabled?[1,1,2,1,1]:[2,2,3,1.55]]}(0,s.useEffect)((function(){var t;null===(t=e.onCurrentPopupDataChange)||void 0===t||t.call(e,(0,a.Z)({},oe()))}),[oe,fe,he,Ze,ke,we,de,pe]);var je=function(e,t){var n,o=Ra().format,i=void 0===o?yn:o,l="origin-".concat(t.selectedOrigin,"-destination-").concat(t.selectedDestination,'-"isRoundtrip"-').concat(null===t||void 0===t?void 0:t.isRoundtrip),r=(0,O.useQuery)(l,(function(){return e(t)}),{refetchOnWindowFocus:!1,staleTime:864e5,enabled:null!==(n=null===t||void 0===t?void 0:t.makeQuery)&&void 0!==n&&n});return null!==t&&void 0!==t&&t.selectedDepartureDate&&r&&null!==r&&void 0!==r&&r.data&&(r.data=(0,a.Z)((0,a.Z)({},null===r||void 0===r?void 0:r.data),{},{isValidSelectedDepartureDate:!Ua(null===r||void 0===r?void 0:r.data,null===t||void 0===t?void 0:t.selectedDepartureDate,Ya,i)})),null!==t&&void 0!==t&&t.selectedReturnDate&&r&&null!==r&&void 0!==r&&r.data&&(r.data=(0,a.Z)((0,a.Z)({},null===r||void 0===r?void 0:r.data),{},{isValidSelectedReturnDate:!Ua(null===r||void 0===r?void 0:r.data,null===t||void 0===t?void 0:t.selectedReturnDate,qa,i)})),r}
1(e.fetchBlackoutDates,{selectedOrigin:Boolean(null===Ge||void 0===Ge?void 0:Ge.blackoutDatesIntegration)?null===(Z=oe())||void 0===Z||null===(C=Z.origin)||void 0===C?void 0:C.value:"",selectedDestination:Boolean(null===Ge||void 0===Ge?void 0:Ge.blackoutDatesIntegration)?null===(x=oe())||void 0===x||null===(E=x.destination)||void 0===E?void 0:E.value:"",isRoundtrip:"rt"===(null===(S=oe())||void 0===S?void 0:S.flightType),makeQuery:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Boolean(e&&""!==e&&t&&""!==t&&Boolean(null===Ge||void 0===Ge?void 0:Ge.blackoutDatesIntegration)&&void 0!==n)}(null===(T=oe())||void 0===T||null===(w=T.origin)||void 0===w?void 0:w.value,null===(A=oe())||void 0===A||null===(R=A.destination)||void 0===R?void 0:R.value,fe),selectedDepartureDate:null===(M=oe())||void 0===M||null===(_=M.dates)||void 0===_?void 0:_.start,selectedReturnDate:null===(B=oe())||void 0===B||null===(N=B.dates)||void 0===N?void 0:N.end}).data,Ue=void 0===je?null:je;var We;return(0,k.tZ)("form",{onSubmit:function(e){e.preventDefault()},onKeyDown:function(e){return function(e){13===e.keyCode&&"submit"!==e.target.getAttribute("type")&&"button"!==e.target.getAttribute("type")&&e.preventDefault()}(e)},style:e.isMobile?{height:"100%"}:void 0},(0,k.tZ)("input",{type:"hidden",name:"travelClass",ref:le}),(0,k.tZ)(ae.Qr,{name:"passengers",control:te,defaultValue:X.passengers,render:function(){return(0,k.tZ)(s.Fragment,null)}}),(0,k.tZ)(ae.Qr,{name:"rooms",control:te,defaultValue:X.rooms,render:function(){return(0,k.tZ)(s.Fragment,null)}}),(0,k.tZ)(et,{gap:"activity"!==ue?"15px":0,style:e.isMobile?{height:"100%"}:void 0},null!==e&&void 0!==e&&e.enableLegend?(0,k.tZ)(Ro,{icon:"info",labelKey:e.labels.legend,sx:{padding:"8px",backgroundColor:"#eeeeee",color:"softText",variant:"layout.legend"}}):null,"activity"===ue?(0,k.tZ)(qe,{className:"booking-activity-message-container",style:{marginBottom:15}},(0,k.tZ)(I.xv,{variant:"text.fontSize5",className:"booking-activity-message"},He("cmp-booking-activity-message","Find tickets, tours and activities"))):null,(0,k.tZ)(qe,{gap:"5px",childrenBottomMargin:!0,wrap:!0},(0,k.tZ)(ae.Qr,{as:"string"!==typeof e.type?(0,k.tZ)(Rn,{label:He("cmp-filters-package-type","Package type"),options:(We=e.type.options,We.map((function(e){return{value:e.value,label:He(e.label,e.label),href:e.href,rules:e.rules}}))),value:ue,focusWhenIsShow:!1}):(0,k.tZ)(s.Fragment,null),defaultValue:j,name:"type",control:te}),(0,k.tZ)(ae.Qr,{render:function(t){var n,o=t.onChange;return!1!==(null===(n=Ge.journeyTypeSelector)||void 0===n?void 0:n.enabled)&&"hotel"!==ue&&"car"!==ue&&"activity"!==ue?(0,k.tZ)(Rn,{label:He("cmp-filters-journey-type","Journey type"),options:e.journeyTypes.options,value:fe,focusWhenIsShow:!1,onChange:function(t){o(t),function(t){var n;null===(n=e.onJourneyTypeChange)||void 0===n||n.call(e,(0,a.Z)((0,a.Z)({},oe()),{},{flightType:t}))}(t)}}):(0,k.tZ)(s.Fragment,null)},name:"flightType",control:te}),"flight+car"===ue||"flight"===ue?(0,k.tZ)(Ao,{key:Fe.defaultValue,origin:he,destination:Ze,travelClasses:Fe,activateRouteOption:e.travelClasses.activateRouteOption,passengers:e.passengers,passengersRules:e.passengersRules,travelClassConfig:Ge.travelClassSelector,trackTravelersChange:function(t){var n,o,i,l=Xn(e.passengers.options,t),r=(0,v.Z)(l,1)[0],s=oe(),u=null!==(n=null===(o=s.rooms)||void 0===o?void 0:o.map((function(e,n){return 0===n?(0,a.Z)((0,a.Z)({},e),{},{count:t.count,ages:t.ages}):e})))&&void 0!==n?n:s.rooms;null===(i=e.onTravelersChange)||void 0===i||i.call(e,(0,a.Z)((0,a.Z)({},s),{},{passengers:r,travelers:r},void 0!==u&&{rooms:u}))},onChange:function(t){var n,o=Xn(e.passengers.options,t.passengers),i=(0,v.Z)(o,2),l=i[0],r=i[1];(ie("passengers",l),ie("ages",r),ie("travelClass",t.travelClass),t.travelClass&&t.travelClass!==de)&&(null===(n=e.onTravelClassChange)||void 0===n||n.call(e,(0,a.Z)((0,a.Z)({},oe()),{},{travelClass:t.travelClass})));if(-1!==e.businessRules.travelers.options.findIndex((function(e){return e.showDetailedAgeOptions}))){for(var s=X.rooms&&0!==X.rooms.length?X.rooms[0]:null,u=[],d=0;d<e.businessRules.travelers.options.length;d++){e.businessRules.travelers.options[d].shouldDetailAges?u.push(t.passengers.ages[d]):u.push([])}s&&ie("rooms",[{key:s.key,count:t.passengers.count,ages:u}])}},enabledDoneButton:null===(P=null===(F=e.passengerSelector)||void 0===F?void 0:F.enabledBottomBtn)||void 0===P||P}):e.rooms&&"car"!==ue&&"activity"!==ue?(0,k.tZ)(_o,{key:Fe.defaultValue,origin:he,destination:Ze,travelClasses:Fe,activateRouteOption:e.travelClasses.activateRouteOption,passengersRules:e.passengersRules,defaultValue:{rooms:X.rooms,travelClass:Fe.defaultValue},rooms:e.rooms,trackTravelersChange:function(t){var n,o=t.map((function(t){return Xn(e.passengers.options,t)[0]}));null===(n=e.onTravelersChange)||void 0===n||n.call(e,(0,a.Z)((0,a.Z)({},oe()),{},{rooms:t,travelers:o}))},onChange:function(t){var n;(ie("rooms",t.rooms),t.travelClass&&t.travelClass!==de)&&(ie("travelClass",t.travelClass),null===(n=e.onTravelClassChange)||void 0===n||n.call(e,(0,a.Z)((0,a.Z)({},oe()),{},{travelClass:t.travelClass})))},type:ue,travelClassConfig:Ge.travelClassSelector,preventBottomDisplacement:e.preventBottomDisplacement}):null,null!==(L=Ge.dropOff)&&void 0!==L&&L.enabled&&"car"===ue?(0,k.tZ)(ae.Qr,{render:function(t){var n=t.onChange;return(0,k.tZ)(Rn,{label:He("cmp-filters-drop-off","Drop-off"),value:ce,focu
1sWhenIsShow:!1,options:e.dropOff.options,onChange:function(e){n(e)}})},name:"dropOff",control:te}):null,ue.includes("car")&&e.carTypes.options.length?(0,k.tZ)(ae.Qr,{render:function(t){return t.onChange,(0,k.tZ)(No,{defaultValue:ve,selectedValue:ve,fieldName:"carType",headerLabelKey:"cmp-booking-car-type-label",noSelectedItemLabelKey:"cmp-car-type-label-not-selected-item",doneButtonLabelKey:"cmp-car-type-filter-done-button",options:e.carTypes.options,control:te,register:le,setValue:ie,getValues:oe})},name:"carType",control:te}):null,q&&ue.includes("flight")&&(0,k.tZ)(ae.Qr,{render:function(t){var n=t.onChange;return(0,k.tZ)(Po,{focusWhenIsShow:!1,options:e.redemptionUnit.options,defaultValue:X.redemptionUnit,onChange:function(e){n(e),K((0,a.Z)((0,a.Z)({},oe()),{},{redemptionUnit:e}))}})},name:"redemptionUnit",control:te}),e.showAdvancedFilter&&"activity"!==ue&&(0,k.tZ)(Za,{onPromoCodeChange:e.onPromoCodeChange,carTypes:e.carTypes,ages:e.ages,nationalities:e.nationalities,rules:W,type:ue,componentsConfigurations:Ge,control:te,register:le,setValue:ie,getValues:oe,hotelCategories:e.hotelCategories,enabledDoneButton:null===(V=null===(z=e.advancedSelector)||void 0===z?void 0:z.enabledBottomBtn)||void 0===V||V,defaultExcludeBasicEconomy:e.excludeBasicEconomy})),"car"===ue&&"same"===ce?(0,k.tZ)(ae.Qr,{render:function(){return(0,k.tZ)(s.Fragment,null)},name:"destination",control:te}):(0,k.tZ)(s.Fragment,null),(0,k.tZ)(wo,{activeTab:e.activeTab,currentTab:e.currentTab,updateSelectedOrigin:ye,updateSelectedDestination:Ce,updateSelectedDepartureDate:Ee,updateSelectedReturnDate:Ae,defaultOrigin:X.origin,selectedDepartureDate:ke,selectedReturnDate:we,defaultDestination:X.destination,defaultDates:e.defaultDates,fetchAirports:e.fetchAirports,filterFields:e.filterFields,onOriginChange:function(t){var n;null===(n=e.onOriginChange)||void 0===n||n.call(e,(0,a.Z)((0,a.Z)({},oe()),{},{origin:t})),"car"===ue&&"same"===ce&&ie("destination",t)},onAirlineChange:function(t){var n;null===(n=e.onAirlineChange)||void 0===n||n.call(e,(0,a.Z)((0,a.Z)({},oe()),{},{airlines:t}))},onDestinationChange:function(t){var n;null===(n=e.onDestinationChange)||void 0===n||n.call(e,(0,a.Z)((0,a.Z)({},oe()),{},{destination:t}))},onDepartureDateChange:function(t,n){var o,i=(0,a.Z)({},oe());void 0!==i.dates&&(i.dates.start=t,i.dates.end=n),null===(o=e.onDepartureDateChange)||void 0===o||o.call(e,i)},onReturnDateChange:function(t,n){var o,i=(0,a.Z)({},oe());void 0!==i.dates&&(i.dates.end=t,i.dates.start=n),null===(o=e.onReturnDateChange)||void 0===o||o.call(e,i)},showOrigin:"hotel"!==ue&&"activity"!==ue&&("car"!==ue||"different"===ce),showTimePickers:"car"===ue,componentsConfigurations:Ge,watch:ee,errors:ne,control:te,formState:se,isLoading:_e,labels:e.labels,blackoutDates:e.blackoutDates,maxTripDuration:e.maxTripDuration,minTripDuration:e.minTripDuration,ctaHalfWidth:"dialog"===e.layout,columns:Le,rows:Ve,showAirlines:(null===(H=e.airlines)||void 0===H?void 0:H.enabled)&&"hotel"!==ue&&"car"!==ue&&"activity"!==ue,fetchAirlines:e.fetchAirlines,airlines:e.airlines,singleDateSelection:ue.includes("flight")&&"ow"===fe,prepopulatedAirlines:e.prepopulatedAirlines,originDestinationLogic:e.originDestinationLogic?e.originDestinationLogic:To.SAME,trigger:re,onSubmit:$((function(t){e.onSubmit(t),Be(!0),setTimeout((function(){Be(!1)}),1e4)}),(function(){Be(!1)})),fetchBlackoutDates:Ue,blackoutDatesIntegration:null===Ge||void 0===Ge?void 0:Ge.blackoutDatesIntegration,flightType:fe,setValue:ie,getValues:oe,disclaimer:e.disclaimer,allowHoverStyleInRange:e.allowHoverStyleInRange,timePickerOptions:e.businessRules.timePickers})))}Lo.defaultProps={showAdvancedFilter:!0};var Vo={space:{dialogMargin:"20px"},buttons:{primaryLg:{variant:"buttons.primary"}},sizes:{tabListWidth:"430px"}};function zo(e){var t=Oe();return(0,k.tZ)(Ce.OK,{sx:{flex:1}},(0,k.tZ)(et,{align:"center",gap:"3px"},(0,k.tZ)(je,{size:20,icon:e.icon}),(0,k.tZ)("span",null,t(e.labelKey,e.defaultLabel))))}var Ho=[{labelKey:"cmp-cash-label",value:"CASH"},{labelKey:"cmp-loyalty-unit-label",value:"MILES"}],Go={options:Ho,defaultValue:Ho[0].value},Ko=rn();function jo(e){var t,n=s.useMemo((function(){var t,n;return e.monthFormatForElements.includes(null===(t=e.localizationData._config)||void 0===t||null===(n=t.abbr)||void 0===n?void 0:n.toLowerCase())}),[null===(t=e.localizationData._config)||void 0===t?void 0:t.abbr,e.monthFormatForElements]),a=s.useMemo((function(){var t;return{months:n?so(e.translate,e.localizationData):ro(e.translate,e.localizationData),isZh:n,weekDays:null!==(t=po(e.weekdayFormat,e.translate,e.localizationData))&&void 0!==t?t:void 0,format:Ko?function(e,t){return Ko(e).format(t)}:void 0,parse:Ko?function(e,t){return Ko(e,t).toDate()}:void 0}}),[n,e.localizationData,e.translate,e.weekdayFormat]);return s.createElement(Aa.Provider,{value:a},e.children)}var Uo="ORIGIN",Wo="DESTINATION";function Yo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"NONE",o=e.filterFields;o||n===en.NONE||console.error("** NO_FILTER_FIELDS_ADDED_IN_CONFIGURATION**");var i=(0,a.Z)({},e);switch(n.toUpperCase()){case en.NONE:delete i.filterFields;break;case en.ALL:break;case en.ORIGIN:t!==Uo&&delete i.filterFields;break;case en.DESTINATION:t!==Wo&&delete i.filterFields}return i.filterDestination&&(t!==Wo?delete i.filterDestination:delete(i=(0,a.Z)((0,a.Z)({},i),{},{filterFields:i.filterDestination})).filterDestination),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.