@cleartrip/ct-design-header 1.2.0-SNAPSHOT-testpeekCarousel.0 → 1.2.0-SNAPSHOT-header-holiday-v1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LobsHeader/type.d.ts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/ct-design-header.browser.cjs.js +1 -1
- package/dist/ct-design-header.browser.esm.js +1 -1
- package/dist/ct-design-header.cjs.js +3 -3
- package/dist/ct-design-header.cjs.js.map +1 -1
- package/dist/ct-design-header.esm.js +3 -3
- package/dist/ct-design-header.esm.js.map +1 -1
- package/dist/ct-design-header.umd.js +3 -3
- package/dist/ct-design-header.umd.js.map +1 -1
- package/package.json +9 -9
package/dist/constants.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),n=require("react/jsx-runtime"),r=require("react"),t=require("@cleartrip/ct-design-container"),o=require("@cleartrip/ct-design-typography"),i=require("@cleartrip/ct-design-button"),a=require("@cleartrip/ct-design-divider"),s=require("@cleartrip/ct-design-icons"),c=require("styled-components");function l(e){return e&&e.__esModule?e:{default:e}}var d,u,p=l(c),g=[{lefticon:s.Offers,text:"Offers",ravenActionName:"offers",isHoverable:!1,isClickable:!0,link:"all-offers/?categories=flights"},{lefticon:s.BusinessBag,text:"Business",ravenActionName:"business",rightIcon:s.ChevronDown,isHoverable:!0},{lefticon:s.MyTrips,text:"My Trips",ravenActionName:"mytrips",isHoverable:!1,isClickable:!0,link:"/account/trips"},{lefticon:s.SupportIcon,text:"Support",ravenActionName:"support",isHoverable:!1,isClickable:!0,link:"/support"}],h=[{title:"Flights",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Flights.png?cache=true",link:"/flights"},{title:"Hotels",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Hotels.png?cache=true",link:"/hotels"},{title:"Buses",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Buses.png?cache=true",link:"/bus"},{title:"Packages",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Packages.png?cache=true",link:"/holidays"}],f=[{title:"AgentBox",subtitle:"For travel agents",details:"One-stop travel solution offering the best deals to our travel agency partners",link:"https://agency.cleartrip.com"},{title:"OutOfOffice",subtitle:"For startups, corporates and SMEs",details:"Manage corporate business travel, smartly",link:"https://ooo.cleartrip.com/",ravenActionName:"ooo"},{title:"MICE",subtitle:"For corporate events",details:"An end-to-end management solution for all your corporate events",link:"https://business.cleartrip.com/"},{title:"API",subtitle:"For developers",details:"Unlock seamless integration and scale with our powerful, reliable APIs",link:"https://business.cleartrip.com/api-customers/more-details"}];exports.RAVEN_PAGE_NAMES=void 0,(d=exports.RAVEN_PAGE_NAMES||(exports.RAVEN_PAGE_NAMES={})).UNIFIED_HOME="unified_homepage",d.HOTELS_HOME="hotel_home",d.FLIGHTS_HOME="flights_home",function(e){e.DESKTOP="desktop"}(u||(u={}));var x={NOVAC:{headerBackground:"transparent",hoverColor:"#FDBA12",logoFill:"#FFF",fkcompanyColor:"#FFF",typographyColor:"#FFF",loginButtonColorVariant:i.ButtonColor.NEUTRAL},DEFAULT:{headerBackground:"#FFFFFF",hoverColor:"#FF4F17",logoFill:"#FF4F17",fkcompanyColor:"#1A1A1A",typographyColor:"#1A1A1A",loginButtonColorVariant:i.ButtonColor.PRIMARY}},m=r.createContext(void 0),v=function(){var e=r.useContext(m);if(!e)throw new Error("useHeaderContext must be used within a HeaderProvider");return e},y=function(r){var t=r.value,o=r.children;return n.jsx(m.Provider,e.__assign({value:t},{children:o}))},_=function(e){var n=Object.keys(e),r=[];return n.forEach(function(n){r.includes(n)?e[n]=Number(e[n]):e[n]=""+e[n]}),e},C=function(e){return"undefined"!=typeof window&&window?new URLSearchParams(window.location.search).get(e):""},b=function(e){switch(e){case"FkVip":return"fk_vip";case"FkPremium":return"fk_plus_premium";case"InsiderIcon":return"myntra_insidericon";case"InsiderElite":return"myntra_insiderelite";default:return""}},k=function(n,r,t,o,i,a){var s;if("function"==typeof i){var c={page_name:a,platform:u.DESKTOP,login_status:n?"yes":"no",domain:null===(s=null===window||void 0===window?void 0:window.location)||void 0===s?void 0:s.hostname},l=_(t),d=_(o),p=e.__assign(e.__assign(e.__assign({},c),l),d);try{1===i.length?i({eventName:r,eventData:p}):i(r,p)}catch(e){return void console.error(e)}}else console.error("ravenPushCallback is not provided or is not a function")},w=function(){var r=v(),i=r.selectedLOB,a=r.isUserLoggedIn,s=r.ravenEventName,c=r.ravenPageName,l=r.ravenPayload,d=void 0===l?{}:l,u=r.ravenPushCallback;return n.jsx(t.Container,e.__assign({display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",background:"#F7FAFF",top:"64px",zIndex:2,css:{gap:24}},{children:h.map(function(r,l){var p=r.title,g=r.link,h=r.image,f=i===p;return n.jsx("a",e.__assign({href:f?void 0:g,style:{textDecoration:"none",pointerEvents:f?"none":"auto"},onClick:function(){return function(e,n){if(!n){var r={action_name:"".concat(e.toLowerCase(),"_tab_click"),action_type:"click"};k(a,s,r,d,u,c)}}(p,f)}},{children:n.jsxs(t.Container,e.__assign({display:"flex",alignItems:"center",width:"116px",height:"48px",justifyContent:"center",cursor:"pointer",css:{gap:8,background:f?"#FFFFFF":"transparent",border:f?"1px solid #E6E6E6":"",borderRadius:"40px",padding:"8px 16px 8px 8px",transition:"background 0.2s ease"}},{children:[n.jsx("img",{src:h,alt:p,width:32,height:32}),n.jsx(o.Typography,e.__assign({variant:f?o.TypographyVariant.HM3:o.TypographyVariant.B1,isClickable:!0},{children:p}))]}))}),l)})}))};function j(o){var i=o.children,a=o.onMaskClick,s=o.show,c=o.marginTop,l=o.handleDropdownMouseEnter,d=o.handleDropdownMouseLeave;r.useEffect(function(){return s&&(document.body.style.overflow="hidden"),function(){document.body.style.overflow="initial"}},[s]);var u=function(e,n){var t=r.useState(e),o=t[0],i=t[1],a=r.useRef();return r.useEffect(function(){return e?i(e):a.current=setTimeout(function(){i(!1)},n),function(){(null==a?void 0:a.current)&&clearTimeout(a.current)}},[e]),o}(s,300),p=function(e,n){var t=r.useState(!1),o=t[0],i=t[1],a=r.useRef();return r.useEffect(function(){return e&&!o?setTimeout(function(){i(!0)},0):!e&&o&&(a.current=setTimeout(function(){return i(!1)},n)),function(){a&&a.current&&clearTimeout(a.current)}},[n,e]),o}(s,100),g=p;return n.jsxs(n.Fragment,{children:[u&&n.jsx(t.Container,{id:"mask-container",css:{position:"fixed",backgroundColor:"#000",opacity:g?.4:0,width:"100%",height:"100vh",left:0,top:c||0,zIndex:9,transition:"opacity 300ms ease-in"},onClick:a}),u&&n.jsx(t.Container,e.__assign({onMouseEnter:l,onMouseLeave:d},{children:i}))]})}var F,E,L,T,I,M,A=function(e){var n=void 0===e?{}:e,t=n.closeDelay,o=void 0===t?0:t,i=n.openDelay,a=void 0===i?500:i,s=Math.max(o,150),c=r.useState(!1),l=c[0],d=c[1],u=r.useState(null),p=u[0],g=u[1],h=r.useRef(null),f=r.useRef(null),x=r.useRef(!1),m=r.useCallback(function(e){h.current&&clearTimeout(h.current),f.current&&clearTimeout(f.current),x.current=!1,f.current=setTimeout(function(){d(!0),x.current||g(e)},a)},[a]),v=r.useCallback(function(){x.current=!0,h.current=setTimeout(function(){d(!1),g(null)},s)},[s]),y=r.useCallback(function(){h.current&&clearTimeout(h.current)},[]),_=r.useCallback(function(){x.current=!0,(null==h?void 0:h.current)&&clearTimeout(h.current),h.current=setTimeout(function(){d(!1),g(null)},s)},[]);return r.useEffect(function(){var e=function(e){e.clientY<=0&&(d(!1),g(null))};return window.addEventListener("mouseleave",e),function(){window.removeEventListener("mouseleave",e)}},[]),{isDropdownVisible:l,hoveredElemIndex:p,handleOnMouseEnter:m,handleOnMouseLeave:v,handleDropdownMouseEnter:y,handleDropdownMouseLeave:_}},D=function(e){var n=r.useRef(null);return r.useEffect(function(){e?function(){if(n.current){var e=n.current.scrollHeight;n.current.style.maxHeight="".concat(e/2,"px"),n.current.style.opacity="0",requestAnimationFrame(function(){n.current&&(n.current.style.transition="max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",n.current.style.maxHeight="".concat(e,"px"),n.current.style.opacity="1")})}}():function(){if(n.current){var e=n.current.scrollHeight;n.current.style.transition="max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",n.current.style.maxHeight="".concat(e/2,"px"),n.current.style.opacity="0",setTimeout(function(){n.current&&(n.current.style.maxHeight="0px")},300)}}()},[e]),{containerRef:n}},N={transition:"background-color 0.2s ease-in-out","&:hover":{backgroundColor:"#ECF3FF"}},B={transition:"background-color 0.2s ease-in-out","&:hover":{backgroundColor:"#FBEFEF"}},P=c.keyframes(F||(F=e.__makeTemplateObject(["\n from {\n transform: translateX(-20px);\n }\n to {\n transform: translateX(0px);\n }\n"],["\n from {\n transform: translateX(-20px);\n }\n to {\n transform: translateX(0px);\n }\n"]))),R=c.keyframes(E||(E=e.__makeTemplateObject(["\n from {\n transform: translateX(-20.01px);\n }\n to {\n transform: translateX(0px);\n }\n"],["\n from {\n transform: translateX(-20.01px);\n }\n to {\n transform: translateX(0px);\n }\n"]))),S={display:"flex",backgroundColor:"black",transition:"background-color 200ms ease","flex-direction":"row",justifyContent:"center",width:"20px",height:"20px",overflow:"hidden",borderRadius:"50%"},H=function(){return n.jsx(t.Container,e.__assign({className:"bd-arrow-container-js",css:S},{children:e.__spreadArray([],Array(3),!0).map(function(r,o){return n.jsx(t.Container,e.__assign({className:"bd-arrow-wrapper-js",display:"flex",alignItems:"center"},{children:n.jsx(s.ArrowRight,{})}),o)})}))},O=p.default.div.withConfig({displayName:"BusinessDropdown__BDHoverContainer",componentId:"sc-1tsshe4-0"})(L||(L=e.__makeTemplateObject(["\n cursor: pointer;\n width: 200px;\n &:hover {\n .bd-arrow-container-js {\n background-color: rgba(255, 79, 23, 1);\n transition: color 200ms ease;\n }\n .bd-arrow-wrapper-js {\n animation: "," 200ms linear;\n display: flex;\n }\n .color-orange-on-hover-js {\n color: rgba(255, 79, 23, 1);\n transition: background-color 200ms ease;\n }\n }\n &:not(:hover) .bd-arrow-wrapper-js {\n animation: "," 200ms linear backwards;\n }\n"],["\n cursor: pointer;\n width: 200px;\n &:hover {\n .bd-arrow-container-js {\n background-color: rgba(255, 79, 23, 1);\n transition: color 200ms ease;\n }\n .bd-arrow-wrapper-js {\n animation: "," 200ms linear;\n display: flex;\n }\n .color-orange-on-hover-js {\n color: rgba(255, 79, 23, 1);\n transition: background-color 200ms ease;\n }\n }\n &:not(:hover) .bd-arrow-wrapper-js {\n animation: "," 200ms linear backwards;\n }\n"])),P,R),G=function(i){var a=i.isOpen,s=v(),c=s.isUserLoggedIn,l=s.ravenPushCallback,d=s.ravenPageName,u=s.ravenEventName,p=s.loyaltyType,g=s.ravenPayload,h=void 0===g?{}:g,x=r.useState(0),m=x[0],y=x[1],_=D(a).containerRef;r.useEffect(function(){var e=function(){if(_.current){var e=(window.innerWidth-(_.current.offsetWidth||0))/2;e!==m&&y(e)}};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[_,m]);var w=r.useCallback(function(e,n,r){var t,o=null!==(t=C("utm_source"))&&void 0!==t?t:"organic",i={action_name:r?"".concat(r,"_business_click"):n?"".concat(n.toLowerCase(),"_business_click"):"",action_type:"click",u_utm_source:o,loyalty_type:b(p)};e&&(k(c,u,i,h,l,d),window.location.href=e)},[c,u,h,l,d,p]);return n.jsxs(t.Container,e.__assign({ref:_,backgroundColor:"#fff",top:"76px",position:"fixed",left:"".concat(m,"px"),borderRadius:24,boxShadow:"0px 8px 24px 0px rgba(26, 26, 26, 0.10)",width:"fit-content",zIndex:1002,css:{overflow:"hidden",opacity:0}},{children:[n.jsx(t.Container,e.__assign({padding:"20px 24px 20px 24px",backgroundColor:"#FFF1EC"},{children:n.jsx(o.Typography,e.__assign({variant:"HM2"},{children:"Other business services"}))})),n.jsx(t.Container,e.__assign({display:"flex",flexDirection:"row",padding:"24px",columnGap:"48px",width:"fit-content"},{children:f.map(function(r){var i=r.title,a=r.subtitle,s=r.details,c=r.link,l=r.ravenActionName;return n.jsxs(O,e.__assign({className:"bd-hover-container-js",onClick:function(){return w(c,i,l)}},{children:[n.jsxs(t.Container,e.__assign({display:"flex",flexDirection:"column",rowGap:"4px"},{children:[n.jsxs(t.Container,e.__assign({display:"flex",flexDirection:"row",alignItems:"center",columnGap:"8px"},{children:[n.jsx(o.Typography,e.__assign({variant:"HM2",className:"color-orange-on-hover-js",css:{transition:"color 200ms ease"}},{children:i})),n.jsx(H,{})]})),n.jsx(o.Typography,e.__assign({variant:"B3",css:{marginTop:"4px",opacity:.75}},{children:a}))]})),n.jsx(o.Typography,e.__assign({variant:"P3",color:"subheading",css:{marginTop:"12px"}},{children:s}))]}),i)})}))]}))},V=[{text:"My Profile",icon:n.jsx(s.MyAccount,{width:24,height:24}),redirectionLink:"/accounts/profile"},{text:"My Trips",icon:n.jsx(s.MyTrips,{width:24,height:24}),redirectionLink:"/accounts/trips"},{text:"Saved Cards",icon:n.jsx(s.SavedCard,{}),redirectionLink:"/accounts/expressway"},{text:"Saved Travellers",icon:n.jsx(s.Travellers,{width:24,height:24}),redirectionLink:"/account/travellers"},{text:"Hi-Five",icon:n.jsx(s.HiFive,{}),redirectionLink:"/accounts/hi-five?src=fh"},{text:"Wallet",icon:n.jsx(s.Wallet,{width:24,height:24}),redirectionLink:"/accounts/wallet"},{text:"Settings",icon:n.jsx(s.SettingsCog,{width:24,height:24}),redirectionLink:"/account/settings"},{text:"Privacy Rights",icon:n.jsx(s.PrivacyRights,{}),redirectionLink:"accounts/personal-data-dashboard"}],U="Logout",W="My Account",q="You are logged in with",z="header-acc-btn",X="account-options",Y=function(o){var i=o.icon,a=o.borderGradient,c=o.backgroundGradient,l=o.handleChipClick,d=o.chevronFillColor,u=v(),p=u.loyaltyType,g=u.isUserLoggedIn,h=u.ravenPushCallback,f=u.ravenPageName,x=u.ravenPayload,m=void 0===x?{}:x,y=u.ravenEventName,_=r.useState(!1),w=_[0],j=_[1],F=r.useCallback(function(){var e;if(l)l();else{var n={action_name:"loyalty_account_click",action_type:"click",u_utm_source:null!==(e=C("utm_source"))&&void 0!==e?e:"organic",loyaltyType:b(p)};k(g,y,n,m,h,f),window.location.href="/all-offers/loyalty-october"}},[l,p,g,y,m,h,f]);return n.jsxs(t.Container,e.__assign({display:"flex",position:"relative",alignItems:"center",justifyContent:"center",borderRadius:"8px",cursor:"pointer",paddingLeft:"8px",paddingRight:w?"4px":"8px",css:{overflow:"hidden",height:32,paddingLeft:8,transition:"padding-right 0.2s ease-in-out"},onMouseEnter:function(){return j(!0)},onMouseLeave:function(){return j(!1)},onClick:F},{children:[n.jsx(t.Container,{css:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",background:c,zIndex:-2}}),n.jsx(t.Container,{css:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",padding:"1px",background:a,WebkitMask:"linear-gradient(white, white) content-box, linear-gradient(white, white)",WebkitMaskComposite:"destination-out",maskComposite:"exclude",zIndex:-1}}),n.jsx(t.Container,e.__assign({display:"flex",alignItems:"center",position:"relative"},{children:i})),n.jsx(t.Container,e.__assign({display:"flex",alignItems:"center",css:{overflow:"hidden",maxWidth:w?16:0,transition:"max-width 0.2s ease-in-out, opacity 0.2s ease-in-out",opacity:w?.5:0}},{children:n.jsx(s.HeaderChevronRight,{color:d})}))]}))};exports.LOBS_VALUES=void 0,(T=exports.LOBS_VALUES||(exports.LOBS_VALUES={})).FLIGHTS="Flights",T.HOTELS="Hotels",T.BUSES="Buses",T.TRAINS="Trains",T.PACKAGES="Packages",exports.LoyaltyType=void 0,(I=exports.LoyaltyType||(exports.LoyaltyType={})).FkVip="FkVip",I.FkPremium="FkPremium",I.InsiderIcon="InsiderIcon",I.InsiderElite="InsiderElite",I.CtLoyalty="CtLoyalty";var K=((M={})[exports.LoyaltyType.FkVip]={icon:n.jsx(s.FkBlackIcon,{}),borderGradient:"linear-gradient(217.07deg, #0B182A 19.65%, #434E57 54.8%, #595952 89.95%)",backgroundGradient:"linear-gradient(217.07deg, #0B182A 19.65%, #434E57 54.8%, #595952 89.95%)",chevronFillColor:"#FFF"},M[exports.LoyaltyType.FkPremium]={icon:n.jsx(s.FkGold,{}),borderGradient:"linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)",backgroundGradient:"#191717",chevronFillColor:"#FFF"},M[exports.LoyaltyType.InsiderIcon]={icon:n.jsx(s.InsiderIcon,{}),borderGradient:"linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)",backgroundGradient:"linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)",chevronFillColor:"#FFF"},M[exports.LoyaltyType.InsiderElite]={icon:n.jsx(s.InsiderElite,{}),borderGradient:"linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)",backgroundGradient:"linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)",chevronFillColor:"#FFF"},M[exports.LoyaltyType.CtLoyalty]={icon:n.jsx(s.CtLoyalty,{}),borderGradient:"linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)",backgroundGradient:"linear-gradient(110.82deg, #FFF9EC 0%, #FEE3A8 100%)",chevronFillColor:"#1A1A1A"},M),J=function(i){var a=i.icon,c=i.handleChipClick,l=i.value,d=i.type,u=v(),p=u.loyaltyType,g=u.isUserLoggedIn,h=u.ravenPushCallback,f=u.ravenPageName,x=u.ravenEventName,m=u.ravenPayload,y=void 0===m?{}:m,_=r.useState(!1),w=_[0],j=_[1],F=r.useCallback(function(){var e;if(c)c();else{var n=null!==(e=C("utm_source"))&&void 0!==e?e:"organic",r={action_name:"".concat(d,"_account_click"),action_type:"click",u_utm_source:n,loyaltyType:b(p)};k(g,x,r,y,h,f);var t={supercoin:"/all-offers/supercoins/",wallet:"/accounts/wallet"};t[d]&&(window.location.href=t[d])}},[c,d,p,g,x,y,h,f]);return n.jsxs(t.Container,e.__assign({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px",cursor:"pointer",css:{height:32,paddingLeft:8,paddingRight:w?4:8,transition:"padding-right 0.2s ease-in-out",background:w?"#ffd7ca":"#ffe6df"},onMouseEnter:function(){return j(!0)},onMouseLeave:function(){return j(!1)},onClick:F},{children:[n.jsxs(t.Container,e.__assign({display:"flex",alignItems:"center",css:{gap:"4px"}},{children:[a,n.jsx(o.Typography,e.__assign({variant:"B3",isClickable:!0},{children:l}))]})),n.jsx(t.Container,e.__assign({display:"flex",alignItems:"center",css:{overflow:"hidden",maxWidth:w?16:0,transition:"max-width 0.2s ease-in-out, opacity 0.2s ease-in-out",opacity:w?1:0}},{children:n.jsx(s.HeaderChevronRight,{})}))]}))},Q=function(){var r,o=v(),i=o.loyaltyType,a=o.fkSupercoinBurnBalance,c=void 0===a?0:a,l=o.walletBalance,d=void 0===l?0:l,u=o.loyaltyLoading,p=o.superCoinsLoading,g=o.walletLoading,h=o.walletChipClick,f=o.supercoinsChipClick,x=o.loyaltyChipClick,m=o.hideWalletChip,y=o.hideSupercoinsChip,_=o.hideLoyaltyChip;return u||i&&K[i]&&!_||(p||!y)||(g||!m)?n.jsxs(t.Container,e.__assign({display:"flex",padding:"0 16px 16px 16px",justifyContent:"flex-start",css:{alignSelf:"stretch",gap:"4px"}},{children:[u?n.jsx(t.Container,{width:"50px",height:"32px",borderRadius:"8px",backgroundColor:"#efefef"}):i&&K[i]&&!_&&n.jsx(Y,{icon:K[i].icon,borderGradient:K[i].borderGradient,backgroundGradient:K[i].backgroundGradient,chevronFillColor:(null===(r=K[i])||void 0===r?void 0:r.chevronFillColor)||"#FFF",handleChipClick:x}),p?n.jsx(t.Container,{width:"50px",height:"32px",borderRadius:"8px",backgroundColor:"#efefef"}):!y&&n.jsx(J,{icon:n.jsx(s.Supercoin,{width:20,height:20}),value:c,handleChipClick:f,type:"supercoin"}),g?n.jsx(t.Container,{width:"50px",height:"32px",borderRadius:"8px",backgroundColor:"#efefef"}):!m&&n.jsx(J,{icon:n.jsx(s.Wallet,{width:20,height:20}),value:d,handleChipClick:h,type:"wallet"})]})):null},Z=function(i){var c=i.isOpen,l=v(),d=l.handleLogoutClick,u=l.userName,p=l.userMobileNumber,g=l.countryCode,h=l.userDetailsLoading,f=l.loyaltyType,x=l.isUserLoggedIn,m=l.ravenEventName,y=l.ravenPageName,_=l.ravenPayload,w=void 0===_?{}:_,j=l.ravenPushCallback,F=D(c).containerRef,E=r.useMemo(function(){return{userGreeting:u?"Hello ".concat(u,"!"):"",phoneNumber:g&&p?"".concat(g," ").concat(p):""}},[u,p,g]),L=E.userGreeting,T=E.phoneNumber,I=function(e){var n;return{action_name:e.toLowerCase().replace(/[\s-]/g,"")+"_account_click",action_type:"click",u_utm_source:null!==(n=C("utm_source"))&&void 0!==n?n:"organic",loyalty_type:b(f)}},M=r.useCallback(function(e,n){k(x,m,I(e),w,j,y),window.location.href=n},[x,m,w,j,y]);r.useCallback(function(){k(x,m,I(U),w,j,y),d()},[x,m,w,j,y,d]);var A=r.useCallback(function(){var e=document.getElementById(z),n=document.getElementById(X);if(e&&n){var r=e.getBoundingClientRect().right;n.style.left="".concat(r-328,"px")}},[]);r.useEffect(function(){A()},[A]);var P;return n.jsxs(t.Container,e.__assign({id:X,ref:F,display:"flex",flexDirection:"column",borderRadius:"16px",zIndex:1002,top:"76px",position:"fixed",css:{opacity:0,overflow:"hidden"},width:"".concat(328,"px"),background:"#FFF1EC"},{children:[n.jsx(t.Container,e.__assign({padding:"16px",height:"76px"},{children:(P=function(r,i,a,s){return n.jsx(o.Typography,e.__assign({variant:a,color:s},{children:r?n.jsx(t.Container,{height:"HM3"===a?"18px":"12px",width:"HM3"===a?"140px":"200px",backgroundColor:"#efefef",borderRadius:"8px"}):i}))},n.jsx(t.Container,e.__assign({display:"flex",flexDirection:"column",css:{gap:"4px"}},{children:L?n.jsxs(n.Fragment,{children:[P(h,L,"HM3","primary"),P(h,"".concat(q," ").concat(T),"P3","subheading")]}):n.jsxs(n.Fragment,{children:[P(h,q,"P3","subheading"),P(h,T,"HM3","primary")]})})))})),n.jsx(Q,{}),n.jsxs(t.Container,e.__assign({display:"flex",flexDirection:"column",padding:"8px",backgroundColor:"white",rowGap:"8px",css:{borderBottomLeftRadius:12,borderBottomRightRadius:12}},{children:[V.map(function(r){var i=r.text,a=r.icon,s=r.redirectionLink;return n.jsx(t.Container,e.__assign({padding:"8px",borderRadius:"8px",cursor:"pointer",onClick:function(){return M(i,s)},css:N},{children:n.jsxs(t.Container,e.__assign({display:"flex",cursor:"pointer",css:{columnGap:"8px"}},{children:[a,n.jsx(o.Typography,e.__assign({variant:"P1",css:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:i}))]}))}),"account-option-".concat(i))}),n.jsx(a.Divider,{css:{borderBottom:"1px dashed #E6E6E6"}}),n.jsxs(t.Container,e.__assign({display:"flex",padding:"8px",borderRadius:"8px",cursor:"pointer",columnGap:"8px",onClick:d,css:B},{children:[n.jsx(s.Signout,{height:24,width:24}),n.jsx(o.Typography,e.__assign({variant:"P1",css:{display:"flex",alignItems:"center",cursor:"pointer"},color:"warning"},{children:U}))]}))]}))]}))},$=function(){var i=v(),a=i.isNovacThemeEnabled,c=i.ravenEventName,l=i.ravenPayload,d=void 0===l?{}:l,u=i.ravenPushCallback,p=i.isUserLoggedIn,g=i.loyaltyType,h=i.ravenPageName,f=A({openDelay:0}),m=f.isDropdownVisible,y=f.handleOnMouseEnter,_=f.handleOnMouseLeave,w=f.handleDropdownMouseEnter,F=f.handleDropdownMouseLeave,E=r.useState(!1),L=E[0],T=E[1];r.useEffect(function(){var e=function(){T(window.scrollY>=50)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}},[]);var I=a&&!L?x.NOVAC:x.DEFAULT,M=I.hoverColor,D=I.typographyColor,N=r.useCallback(function(){var e,n=null!==(e=C("utm_source"))&&void 0!==e?e:"organic",r={action_name:"".concat(W.toLowerCase().replace(/[\s-]/g,""),"_header_hover"),action_type:"hover",u_utm_source:n,loyalty_type:b(g)};k(p,c,r,d,u,h)},[p,c,d,u,h,g]);return n.jsxs(t.Container,{children:[n.jsxs(t.Container,e.__assign({display:"flex",padding:"8px 12px",alignItems:"center",borderRadius:"12px",height:"100%",cursor:"pointer",css:{columnGap:8,height:64},onMouseEnter:function(){y(0),N()},onMouseLeave:_,id:z},{children:[n.jsx(s.MyAccount,{color:m?M:D}),n.jsxs(t.Container,e.__assign({display:"flex",flexDirection:"row",alignItems:"center"},{children:[n.jsx(o.Typography,e.__assign({variant:"B2",css:{cursor:"pointer"},colorCode:m?M:D},{children:W})),n.jsx(s.ChevronDown,{width:20,height:20,fill:m?M:D})]}))]})),n.jsx(j,e.__assign({show:m,marginTop:"64px",handleDropdownMouseEnter:w,handleDropdownMouseLeave:F,onMaskClick:F},{children:n.jsx(Z,{isOpen:m})}))]})},ee=function(){var c,l=v(),d=l.onLoginButtonClick,u=l.showAllLobs,p=void 0!==u&&u,h=l.isUserLoggedIn,f=l.loyaltyType,m=l.isNovacThemeEnabled,y=void 0!==m&&m,_=l.ravenPayload,F=void 0===_?{}:_,E=l.ravenPushCallback,L=l.ravenPageName,T=l.ravenEventName,I=r.useState(!1),M=I[0],D=I[1];r.useEffect(function(){var e=function(){D(window.scrollY>=50)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}},[]);var N,B=y&&!M?x.NOVAC:x.DEFAULT,P=B.headerBackground,R=B.logoFill,S=B.loginButtonColorVariant,H=B.hoverColor,O=B.fkcompanyColor,V=B.typographyColor,U=A({openDelay:0}),W=U.isDropdownVisible,q=U.hoveredElemIndex,z=U.handleOnMouseEnter,X=U.handleOnMouseLeave,Y=U.handleDropdownMouseEnter,K=U.handleDropdownMouseLeave,J=null!==(c=C("utm_source"))&&void 0!==c?c:"organic",Q=r.useCallback(function(e,n){return{action_name:e,action_type:n,u_utm_source:J,loyalty_type:b(f)}},[J,f]),Z=r.useCallback(function(e){if(e.isClickable&&e.link){var n="".concat(e.text.toLowerCase().replace(/\s/g,""),"_header_click"),r=Q(n,"click");k(h,T,r,F,E,L),window.location.href=e.link}},[Q,h,T,F,E,L]),ee=r.useCallback(function(){var e=Q("home_header_click","click");k(h,T,e,F,E,L),window.location.href="/"},[Q,h,T,F,E,L]),ne=r.useCallback(function(e){var n="".concat(e.text.toLowerCase().replace(/\s/g,""),"_header_hover"),r=Q(n,"hover");k(h,T,r,F,E,L)},[Q,h,T,F,E,L]);return n.jsxs(n.Fragment,{children:[n.jsx(t.Container,e.__assign({display:"flex",top:0,position:"sticky",width:"100%",alignItems:"center",justifyContent:"center",zIndex:1e3,height:"64px",background:P,css:{gap:"24px",flexShrink:0,borderBottom:"transparent"===P?"":"1px solid #E6E6E6",transition:"background-color 0.3s ease-in-out, border-bottom 0.3s ease-in-out"}},{children:n.jsxs(t.Container,e.__assign({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 28px",flex:1,css:{gap:"24px",maxWidth:1440}},{children:[n.jsxs(t.Container,e.__assign({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",cursor:"pointer",onClick:ee},{children:[n.jsx(s.CTLogo,{fillColor:R}),n.jsx(a.Divider,{css:{width:12,marginLeft:2,marginRight:2,transform:"rotate(90deg)",borderBottom:"1px solid #e0e0e0"}}),n.jsx(s.Fkcompany,{color:O})]})),n.jsxs(t.Container,e.__assign({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",columnGap:"24px"},{children:[n.jsx(t.Container,e.__assign({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",columnGap:"4px"},{children:g.map(function(r,i){var a=r.text,s=r.lefticon,c=r.rightIcon,l=r.isHoverable,d=q===i;return n.jsxs(t.Container,{children:[n.jsxs(t.Container,e.__assign({onMouseEnter:function(){z(i),r.isHoverable&&ne(r)},onMouseLeave:X,display:"flex",flexDirection:"row",alignItems:"center",padding:"8px 12px 8px 12px",cursor:"pointer",position:"relative",columnGap:8,height:"64px",onClick:function(){return Z(r)}},{children:[n.jsx(s,{color:d?H:V}),n.jsxs(t.Container,e.__assign({display:"flex",flexDirection:"row",alignItems:"center"},{children:[n.jsx(o.Typography,e.__assign({variant:"B2",colorCode:d?H:V,isClickable:!0},{children:a})),c&&n.jsx(c,{width:20,height:20,fill:d?H:V})]}))]}),"nav-option-".concat(i)),n.jsx(j,e.__assign({show:q===i&&l&&W,marginTop:"64px",handleDropdownMouseEnter:Y,handleDropdownMouseLeave:K,onMaskClick:K},{children:n.jsx(G,{isOpen:q===i&&l&&W})}))]})})})),h&&n.jsx(a.Divider,{css:{width:12,margin:"0 -18px",transform:"rotate(90deg)",borderBottom:"1px solid #e0e0e0"}}),n.jsx(t.Container,{children:h?n.jsx(t.Container,e.__assign({display:"flex",flexDirection:"row",alignItems:"center"},{children:n.jsx($,{})})):n.jsx(i.Button,e.__assign({onClick:d,css:e.__assign({width:153,height:40},(N="transparent"===P,N?{backgroundColor:"transparent !important","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.25)!important"}}:{backgroundColor:"transparent !important","&:hover":{backgroundColor:"#F3F3F3 !important"}})),loading:!1,color:S,variant:i.ButtonVariant.OUTLINE},{children:"Log in"}))})]}))]}))})),p&&n.jsx(w,{})]})};exports.Header=function(r){return n.jsx(y,e.__assign({value:r},{children:n.jsx(ee,{})}))};
|
|
1
|
+
"use strict";var e=require("tslib"),n=require("react/jsx-runtime"),r=require("react"),t=require("@cleartrip/ct-design-container"),o=require("@cleartrip/ct-design-typography"),i=require("@cleartrip/ct-design-button"),a=require("@cleartrip/ct-design-divider"),s=require("@cleartrip/ct-design-icons"),c=require("styled-components");function l(e){return e&&e.__esModule?e:{default:e}}var d,u,p=l(c),g=[{lefticon:s.Offers,text:"Offers",ravenActionName:"offers",isHoverable:!1,isClickable:!0,link:"all-offers/?categories=flights"},{lefticon:s.BusinessBag,text:"Business",ravenActionName:"business",rightIcon:s.ChevronDown,isHoverable:!0},{lefticon:s.MyTrips,text:"My Trips",ravenActionName:"mytrips",isHoverable:!1,isClickable:!0,link:"/account/trips"},{lefticon:s.SupportIcon,text:"Support",ravenActionName:"support",isHoverable:!1,isClickable:!0,link:"/support"}],h=[{title:"Flights",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Flights.png?cache=true",link:"/flights"},{title:"Hotels",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Hotels.png?cache=true",link:"/hotels"},{title:"Buses",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Buses.png?cache=true",link:"/bus"},{title:"Holidays",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Packages.png?cache=true",link:"/holidays"}],f=[{title:"AgentBox",subtitle:"For travel agents",details:"One-stop travel solution offering the best deals to our travel agency partners",link:"https://agency.cleartrip.com"},{title:"OutOfOffice",subtitle:"For startups, corporates and SMEs",details:"Manage corporate business travel, smartly",link:"https://ooo.cleartrip.com/",ravenActionName:"ooo"},{title:"MICE",subtitle:"For corporate events",details:"An end-to-end management solution for all your corporate events",link:"https://business.cleartrip.com/"},{title:"API",subtitle:"For developers",details:"Unlock seamless integration and scale with our powerful, reliable APIs",link:"https://business.cleartrip.com/api-customers/more-details"}];exports.RAVEN_PAGE_NAMES=void 0,(d=exports.RAVEN_PAGE_NAMES||(exports.RAVEN_PAGE_NAMES={})).UNIFIED_HOME="unified_homepage",d.HOTELS_HOME="hotel_home",d.FLIGHTS_HOME="flights_home",function(e){e.DESKTOP="desktop"}(u||(u={}));var x={NOVAC:{headerBackground:"transparent",hoverColor:"#FDBA12",logoFill:"#FFF",fkcompanyColor:"#FFF",typographyColor:"#FFF",loginButtonColorVariant:i.ButtonColor.NEUTRAL},DEFAULT:{headerBackground:"#FFFFFF",hoverColor:"#FF4F17",logoFill:"#FF4F17",fkcompanyColor:"#1A1A1A",typographyColor:"#1A1A1A",loginButtonColorVariant:i.ButtonColor.PRIMARY}},m=r.createContext(void 0),v=function(){var e=r.useContext(m);if(!e)throw new Error("useHeaderContext must be used within a HeaderProvider");return e},y=function(r){var t=r.value,o=r.children;return n.jsx(m.Provider,e.__assign({value:t},{children:o}))},_=function(e){var n=Object.keys(e),r=[];return n.forEach(function(n){r.includes(n)?e[n]=Number(e[n]):e[n]=""+e[n]}),e},C=function(e){return"undefined"!=typeof window&&window?new URLSearchParams(window.location.search).get(e):""},b=function(e){switch(e){case"FkVip":return"fk_vip";case"FkPremium":return"fk_plus_premium";case"InsiderIcon":return"myntra_insidericon";case"InsiderElite":return"myntra_insiderelite";default:return""}},k=function(n,r,t,o,i,a){var s;if("function"==typeof i){var c={page_name:a,platform:u.DESKTOP,login_status:n?"yes":"no",domain:null===(s=null===window||void 0===window?void 0:window.location)||void 0===s?void 0:s.hostname},l=_(t),d=_(o),p=e.__assign(e.__assign(e.__assign({},c),l),d);try{1===i.length?i({eventName:r,eventData:p}):i(r,p)}catch(e){return void console.error(e)}}else console.error("ravenPushCallback is not provided or is not a function")},w=function(){var r=v(),i=r.selectedLOB,a=r.isUserLoggedIn,s=r.ravenEventName,c=r.ravenPageName,l=r.ravenPayload,d=void 0===l?{}:l,u=r.ravenPushCallback;return n.jsx(t.Container,e.__assign({display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",background:"#F7FAFF",top:"64px",zIndex:2,css:{gap:24}},{children:h.map(function(r,l){var p=r.title,g=r.link,h=r.image,f=i===p;return n.jsx("a",e.__assign({href:f?void 0:g,style:{textDecoration:"none",pointerEvents:f?"none":"auto"},onClick:function(){return function(e,n){if(!n){var r={action_name:"".concat(e.toLowerCase(),"_tab_click"),action_type:"click"};k(a,s,r,d,u,c)}}(p,f)}},{children:n.jsxs(t.Container,e.__assign({display:"flex",alignItems:"center",width:"116px",height:"48px",justifyContent:"center",cursor:"pointer",css:{gap:8,background:f?"#FFFFFF":"transparent",border:f?"1px solid #E6E6E6":"",borderRadius:"40px",padding:"8px 16px 8px 8px",transition:"background 0.2s ease"}},{children:[n.jsx("img",{src:h,alt:p,width:32,height:32}),n.jsx(o.Typography,e.__assign({variant:f?o.TypographyVariant.HM3:o.TypographyVariant.B1,isClickable:!0},{children:p}))]}))}),l)})}))};function j(o){var i=o.children,a=o.onMaskClick,s=o.show,c=o.marginTop,l=o.handleDropdownMouseEnter,d=o.handleDropdownMouseLeave;r.useEffect(function(){return s&&(document.body.style.overflow="hidden"),function(){document.body.style.overflow="initial"}},[s]);var u=function(e,n){var t=r.useState(e),o=t[0],i=t[1],a=r.useRef();return r.useEffect(function(){return e?i(e):a.current=setTimeout(function(){i(!1)},n),function(){(null==a?void 0:a.current)&&clearTimeout(a.current)}},[e]),o}(s,300),p=function(e,n){var t=r.useState(!1),o=t[0],i=t[1],a=r.useRef();return r.useEffect(function(){return e&&!o?setTimeout(function(){i(!0)},0):!e&&o&&(a.current=setTimeout(function(){return i(!1)},n)),function(){a&&a.current&&clearTimeout(a.current)}},[n,e]),o}(s,100),g=p;return n.jsxs(n.Fragment,{children:[u&&n.jsx(t.Container,{id:"mask-container",css:{position:"fixed",backgroundColor:"#000",opacity:g?.4:0,width:"100%",height:"100vh",left:0,top:c||0,zIndex:9,transition:"opacity 300ms ease-in"},onClick:a}),u&&n.jsx(t.Container,e.__assign({onMouseEnter:l,onMouseLeave:d},{children:i}))]})}var F,E,L,T,I,M,A=function(e){var n=void 0===e?{}:e,t=n.closeDelay,o=void 0===t?0:t,i=n.openDelay,a=void 0===i?500:i,s=Math.max(o,150),c=r.useState(!1),l=c[0],d=c[1],u=r.useState(null),p=u[0],g=u[1],h=r.useRef(null),f=r.useRef(null),x=r.useRef(!1),m=r.useCallback(function(e){h.current&&clearTimeout(h.current),f.current&&clearTimeout(f.current),x.current=!1,f.current=setTimeout(function(){d(!0),x.current||g(e)},a)},[a]),v=r.useCallback(function(){x.current=!0,h.current=setTimeout(function(){d(!1),g(null)},s)},[s]),y=r.useCallback(function(){h.current&&clearTimeout(h.current)},[]),_=r.useCallback(function(){x.current=!0,(null==h?void 0:h.current)&&clearTimeout(h.current),h.current=setTimeout(function(){d(!1),g(null)},s)},[]);return r.useEffect(function(){var e=function(e){e.clientY<=0&&(d(!1),g(null))};return window.addEventListener("mouseleave",e),function(){window.removeEventListener("mouseleave",e)}},[]),{isDropdownVisible:l,hoveredElemIndex:p,handleOnMouseEnter:m,handleOnMouseLeave:v,handleDropdownMouseEnter:y,handleDropdownMouseLeave:_}},D=function(e){var n=r.useRef(null);return r.useEffect(function(){e?function(){if(n.current){var e=n.current.scrollHeight;n.current.style.maxHeight="".concat(e/2,"px"),n.current.style.opacity="0",requestAnimationFrame(function(){n.current&&(n.current.style.transition="max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",n.current.style.maxHeight="".concat(e,"px"),n.current.style.opacity="1")})}}():function(){if(n.current){var e=n.current.scrollHeight;n.current.style.transition="max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",n.current.style.maxHeight="".concat(e/2,"px"),n.current.style.opacity="0",setTimeout(function(){n.current&&(n.current.style.maxHeight="0px")},300)}}()},[e]),{containerRef:n}},N={transition:"background-color 0.2s ease-in-out","&:hover":{backgroundColor:"#ECF3FF"}},B={transition:"background-color 0.2s ease-in-out","&:hover":{backgroundColor:"#FBEFEF"}},P=c.keyframes(F||(F=e.__makeTemplateObject(["\n from {\n transform: translateX(-20px);\n }\n to {\n transform: translateX(0px);\n }\n"],["\n from {\n transform: translateX(-20px);\n }\n to {\n transform: translateX(0px);\n }\n"]))),R=c.keyframes(E||(E=e.__makeTemplateObject(["\n from {\n transform: translateX(-20.01px);\n }\n to {\n transform: translateX(0px);\n }\n"],["\n from {\n transform: translateX(-20.01px);\n }\n to {\n transform: translateX(0px);\n }\n"]))),S={display:"flex",backgroundColor:"black",transition:"background-color 200ms ease","flex-direction":"row",justifyContent:"center",width:"20px",height:"20px",overflow:"hidden",borderRadius:"50%"},H=function(){return n.jsx(t.Container,e.__assign({className:"bd-arrow-container-js",css:S},{children:e.__spreadArray([],Array(3),!0).map(function(r,o){return n.jsx(t.Container,e.__assign({className:"bd-arrow-wrapper-js",display:"flex",alignItems:"center"},{children:n.jsx(s.ArrowRight,{})}),o)})}))},O=p.default.div.withConfig({displayName:"BusinessDropdown__BDHoverContainer",componentId:"sc-1tsshe4-0"})(L||(L=e.__makeTemplateObject(["\n cursor: pointer;\n width: 200px;\n &:hover {\n .bd-arrow-container-js {\n background-color: rgba(255, 79, 23, 1);\n transition: color 200ms ease;\n }\n .bd-arrow-wrapper-js {\n animation: "," 200ms linear;\n display: flex;\n }\n .color-orange-on-hover-js {\n color: rgba(255, 79, 23, 1);\n transition: background-color 200ms ease;\n }\n }\n &:not(:hover) .bd-arrow-wrapper-js {\n animation: "," 200ms linear backwards;\n }\n"],["\n cursor: pointer;\n width: 200px;\n &:hover {\n .bd-arrow-container-js {\n background-color: rgba(255, 79, 23, 1);\n transition: color 200ms ease;\n }\n .bd-arrow-wrapper-js {\n animation: "," 200ms linear;\n display: flex;\n }\n .color-orange-on-hover-js {\n color: rgba(255, 79, 23, 1);\n transition: background-color 200ms ease;\n }\n }\n &:not(:hover) .bd-arrow-wrapper-js {\n animation: "," 200ms linear backwards;\n }\n"])),P,R),G=function(i){var a=i.isOpen,s=v(),c=s.isUserLoggedIn,l=s.ravenPushCallback,d=s.ravenPageName,u=s.ravenEventName,p=s.loyaltyType,g=s.ravenPayload,h=void 0===g?{}:g,x=r.useState(0),m=x[0],y=x[1],_=D(a).containerRef;r.useEffect(function(){var e=function(){if(_.current){var e=(window.innerWidth-(_.current.offsetWidth||0))/2;e!==m&&y(e)}};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[_,m]);var w=r.useCallback(function(e,n,r){var t,o=null!==(t=C("utm_source"))&&void 0!==t?t:"organic",i={action_name:r?"".concat(r,"_business_click"):n?"".concat(n.toLowerCase(),"_business_click"):"",action_type:"click",u_utm_source:o,loyalty_type:b(p)};e&&(k(c,u,i,h,l,d),window.location.href=e)},[c,u,h,l,d,p]);return n.jsxs(t.Container,e.__assign({ref:_,backgroundColor:"#fff",top:"76px",position:"fixed",left:"".concat(m,"px"),borderRadius:24,boxShadow:"0px 8px 24px 0px rgba(26, 26, 26, 0.10)",width:"fit-content",zIndex:1002,css:{overflow:"hidden",opacity:0}},{children:[n.jsx(t.Container,e.__assign({padding:"20px 24px 20px 24px",backgroundColor:"#FFF1EC"},{children:n.jsx(o.Typography,e.__assign({variant:"HM2"},{children:"Other business services"}))})),n.jsx(t.Container,e.__assign({display:"flex",flexDirection:"row",padding:"24px",columnGap:"48px",width:"fit-content"},{children:f.map(function(r){var i=r.title,a=r.subtitle,s=r.details,c=r.link,l=r.ravenActionName;return n.jsxs(O,e.__assign({className:"bd-hover-container-js",onClick:function(){return w(c,i,l)}},{children:[n.jsxs(t.Container,e.__assign({display:"flex",flexDirection:"column",rowGap:"4px"},{children:[n.jsxs(t.Container,e.__assign({display:"flex",flexDirection:"row",alignItems:"center",columnGap:"8px"},{children:[n.jsx(o.Typography,e.__assign({variant:"HM2",className:"color-orange-on-hover-js",css:{transition:"color 200ms ease"}},{children:i})),n.jsx(H,{})]})),n.jsx(o.Typography,e.__assign({variant:"B3",css:{marginTop:"4px",opacity:.75}},{children:a}))]})),n.jsx(o.Typography,e.__assign({variant:"P3",color:"subheading",css:{marginTop:"12px"}},{children:s}))]}),i)})}))]}))},V=[{text:"My Profile",icon:n.jsx(s.MyAccount,{width:24,height:24}),redirectionLink:"/accounts/profile"},{text:"My Trips",icon:n.jsx(s.MyTrips,{width:24,height:24}),redirectionLink:"/accounts/trips"},{text:"Saved Cards",icon:n.jsx(s.SavedCard,{}),redirectionLink:"/accounts/expressway"},{text:"Saved Travellers",icon:n.jsx(s.Travellers,{width:24,height:24}),redirectionLink:"/account/travellers"},{text:"Hi-Five",icon:n.jsx(s.HiFive,{}),redirectionLink:"/accounts/hi-five?src=fh"},{text:"Wallet",icon:n.jsx(s.Wallet,{width:24,height:24}),redirectionLink:"/accounts/wallet"},{text:"Settings",icon:n.jsx(s.SettingsCog,{width:24,height:24}),redirectionLink:"/account/settings"},{text:"Privacy Rights",icon:n.jsx(s.PrivacyRights,{}),redirectionLink:"accounts/personal-data-dashboard"}],U="Logout",W="My Account",q="You are logged in with",z="header-acc-btn",X="account-options",Y=function(o){var i=o.icon,a=o.borderGradient,c=o.backgroundGradient,l=o.handleChipClick,d=o.chevronFillColor,u=v(),p=u.loyaltyType,g=u.isUserLoggedIn,h=u.ravenPushCallback,f=u.ravenPageName,x=u.ravenPayload,m=void 0===x?{}:x,y=u.ravenEventName,_=r.useState(!1),w=_[0],j=_[1],F=r.useCallback(function(){var e;if(l)l();else{var n={action_name:"loyalty_account_click",action_type:"click",u_utm_source:null!==(e=C("utm_source"))&&void 0!==e?e:"organic",loyaltyType:b(p)};k(g,y,n,m,h,f),window.location.href="/all-offers/loyalty-october"}},[l,p,g,y,m,h,f]);return n.jsxs(t.Container,e.__assign({display:"flex",position:"relative",alignItems:"center",justifyContent:"center",borderRadius:"8px",cursor:"pointer",paddingLeft:"8px",paddingRight:w?"4px":"8px",css:{overflow:"hidden",height:32,paddingLeft:8,transition:"padding-right 0.2s ease-in-out"},onMouseEnter:function(){return j(!0)},onMouseLeave:function(){return j(!1)},onClick:F},{children:[n.jsx(t.Container,{css:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",background:c,zIndex:-2}}),n.jsx(t.Container,{css:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",padding:"1px",background:a,WebkitMask:"linear-gradient(white, white) content-box, linear-gradient(white, white)",WebkitMaskComposite:"destination-out",maskComposite:"exclude",zIndex:-1}}),n.jsx(t.Container,e.__assign({display:"flex",alignItems:"center",position:"relative"},{children:i})),n.jsx(t.Container,e.__assign({display:"flex",alignItems:"center",css:{overflow:"hidden",maxWidth:w?16:0,transition:"max-width 0.2s ease-in-out, opacity 0.2s ease-in-out",opacity:w?.5:0}},{children:n.jsx(s.HeaderChevronRight,{color:d})}))]}))};exports.LOBS_VALUES=void 0,(T=exports.LOBS_VALUES||(exports.LOBS_VALUES={})).FLIGHTS="Flights",T.HOTELS="Hotels",T.BUSES="Buses",T.TRAINS="Trains",T.HOLIDAYS="Holidays",exports.LoyaltyType=void 0,(I=exports.LoyaltyType||(exports.LoyaltyType={})).FkVip="FkVip",I.FkPremium="FkPremium",I.InsiderIcon="InsiderIcon",I.InsiderElite="InsiderElite",I.CtLoyalty="CtLoyalty";var K=((M={})[exports.LoyaltyType.FkVip]={icon:n.jsx(s.FkBlackIcon,{}),borderGradient:"linear-gradient(217.07deg, #0B182A 19.65%, #434E57 54.8%, #595952 89.95%)",backgroundGradient:"linear-gradient(217.07deg, #0B182A 19.65%, #434E57 54.8%, #595952 89.95%)",chevronFillColor:"#FFF"},M[exports.LoyaltyType.FkPremium]={icon:n.jsx(s.FkGold,{}),borderGradient:"linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)",backgroundGradient:"#191717",chevronFillColor:"#FFF"},M[exports.LoyaltyType.InsiderIcon]={icon:n.jsx(s.InsiderIcon,{}),borderGradient:"linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)",backgroundGradient:"linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)",chevronFillColor:"#FFF"},M[exports.LoyaltyType.InsiderElite]={icon:n.jsx(s.InsiderElite,{}),borderGradient:"linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)",backgroundGradient:"linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)",chevronFillColor:"#FFF"},M[exports.LoyaltyType.CtLoyalty]={icon:n.jsx(s.CtLoyalty,{}),borderGradient:"linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)",backgroundGradient:"linear-gradient(110.82deg, #FFF9EC 0%, #FEE3A8 100%)",chevronFillColor:"#1A1A1A"},M),J=function(i){var a=i.icon,c=i.handleChipClick,l=i.value,d=i.type,u=v(),p=u.loyaltyType,g=u.isUserLoggedIn,h=u.ravenPushCallback,f=u.ravenPageName,x=u.ravenEventName,m=u.ravenPayload,y=void 0===m?{}:m,_=r.useState(!1),w=_[0],j=_[1],F=r.useCallback(function(){var e;if(c)c();else{var n=null!==(e=C("utm_source"))&&void 0!==e?e:"organic",r={action_name:"".concat(d,"_account_click"),action_type:"click",u_utm_source:n,loyaltyType:b(p)};k(g,x,r,y,h,f);var t={supercoin:"/all-offers/supercoins/",wallet:"/accounts/wallet"};t[d]&&(window.location.href=t[d])}},[c,d,p,g,x,y,h,f]);return n.jsxs(t.Container,e.__assign({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px",cursor:"pointer",css:{height:32,paddingLeft:8,paddingRight:w?4:8,transition:"padding-right 0.2s ease-in-out",background:w?"#ffd7ca":"#ffe6df"},onMouseEnter:function(){return j(!0)},onMouseLeave:function(){return j(!1)},onClick:F},{children:[n.jsxs(t.Container,e.__assign({display:"flex",alignItems:"center",css:{gap:"4px"}},{children:[a,n.jsx(o.Typography,e.__assign({variant:"B3",isClickable:!0},{children:l}))]})),n.jsx(t.Container,e.__assign({display:"flex",alignItems:"center",css:{overflow:"hidden",maxWidth:w?16:0,transition:"max-width 0.2s ease-in-out, opacity 0.2s ease-in-out",opacity:w?1:0}},{children:n.jsx(s.HeaderChevronRight,{})}))]}))},Q=function(){var r,o=v(),i=o.loyaltyType,a=o.fkSupercoinBurnBalance,c=void 0===a?0:a,l=o.walletBalance,d=void 0===l?0:l,u=o.loyaltyLoading,p=o.superCoinsLoading,g=o.walletLoading,h=o.walletChipClick,f=o.supercoinsChipClick,x=o.loyaltyChipClick,m=o.hideWalletChip,y=o.hideSupercoinsChip,_=o.hideLoyaltyChip;return u||i&&K[i]&&!_||(p||!y)||(g||!m)?n.jsxs(t.Container,e.__assign({display:"flex",padding:"0 16px 16px 16px",justifyContent:"flex-start",css:{alignSelf:"stretch",gap:"4px"}},{children:[u?n.jsx(t.Container,{width:"50px",height:"32px",borderRadius:"8px",backgroundColor:"#efefef"}):i&&K[i]&&!_&&n.jsx(Y,{icon:K[i].icon,borderGradient:K[i].borderGradient,backgroundGradient:K[i].backgroundGradient,chevronFillColor:(null===(r=K[i])||void 0===r?void 0:r.chevronFillColor)||"#FFF",handleChipClick:x}),p?n.jsx(t.Container,{width:"50px",height:"32px",borderRadius:"8px",backgroundColor:"#efefef"}):!y&&n.jsx(J,{icon:n.jsx(s.Supercoin,{width:20,height:20}),value:c,handleChipClick:f,type:"supercoin"}),g?n.jsx(t.Container,{width:"50px",height:"32px",borderRadius:"8px",backgroundColor:"#efefef"}):!m&&n.jsx(J,{icon:n.jsx(s.Wallet,{width:20,height:20}),value:d,handleChipClick:h,type:"wallet"})]})):null},Z=function(i){var c=i.isOpen,l=v(),d=l.handleLogoutClick,u=l.userName,p=l.userMobileNumber,g=l.countryCode,h=l.userDetailsLoading,f=l.loyaltyType,x=l.isUserLoggedIn,m=l.ravenEventName,y=l.ravenPageName,_=l.ravenPayload,w=void 0===_?{}:_,j=l.ravenPushCallback,F=D(c).containerRef,E=r.useMemo(function(){return{userGreeting:u?"Hello ".concat(u,"!"):"",phoneNumber:g&&p?"".concat(g," ").concat(p):""}},[u,p,g]),L=E.userGreeting,T=E.phoneNumber,I=function(e){var n;return{action_name:e.toLowerCase().replace(/[\s-]/g,"")+"_account_click",action_type:"click",u_utm_source:null!==(n=C("utm_source"))&&void 0!==n?n:"organic",loyalty_type:b(f)}},M=r.useCallback(function(e,n){k(x,m,I(e),w,j,y),window.location.href=n},[x,m,w,j,y]);r.useCallback(function(){k(x,m,I(U),w,j,y),d()},[x,m,w,j,y,d]);var A=r.useCallback(function(){var e=document.getElementById(z),n=document.getElementById(X);if(e&&n){var r=e.getBoundingClientRect().right;n.style.left="".concat(r-328,"px")}},[]);r.useEffect(function(){A()},[A]);var P;return n.jsxs(t.Container,e.__assign({id:X,ref:F,display:"flex",flexDirection:"column",borderRadius:"16px",zIndex:1002,top:"76px",position:"fixed",css:{opacity:0,overflow:"hidden"},width:"".concat(328,"px"),background:"#FFF1EC"},{children:[n.jsx(t.Container,e.__assign({padding:"16px",height:"76px"},{children:(P=function(r,i,a,s){return n.jsx(o.Typography,e.__assign({variant:a,color:s},{children:r?n.jsx(t.Container,{height:"HM3"===a?"18px":"12px",width:"HM3"===a?"140px":"200px",backgroundColor:"#efefef",borderRadius:"8px"}):i}))},n.jsx(t.Container,e.__assign({display:"flex",flexDirection:"column",css:{gap:"4px"}},{children:L?n.jsxs(n.Fragment,{children:[P(h,L,"HM3","primary"),P(h,"".concat(q," ").concat(T),"P3","subheading")]}):n.jsxs(n.Fragment,{children:[P(h,q,"P3","subheading"),P(h,T,"HM3","primary")]})})))})),n.jsx(Q,{}),n.jsxs(t.Container,e.__assign({display:"flex",flexDirection:"column",padding:"8px",backgroundColor:"white",rowGap:"8px",css:{borderBottomLeftRadius:12,borderBottomRightRadius:12}},{children:[V.map(function(r){var i=r.text,a=r.icon,s=r.redirectionLink;return n.jsx(t.Container,e.__assign({padding:"8px",borderRadius:"8px",cursor:"pointer",onClick:function(){return M(i,s)},css:N},{children:n.jsxs(t.Container,e.__assign({display:"flex",cursor:"pointer",css:{columnGap:"8px"}},{children:[a,n.jsx(o.Typography,e.__assign({variant:"P1",css:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:i}))]}))}),"account-option-".concat(i))}),n.jsx(a.Divider,{css:{borderBottom:"1px dashed #E6E6E6"}}),n.jsxs(t.Container,e.__assign({display:"flex",padding:"8px",borderRadius:"8px",cursor:"pointer",columnGap:"8px",onClick:d,css:B},{children:[n.jsx(s.Signout,{height:24,width:24}),n.jsx(o.Typography,e.__assign({variant:"P1",css:{display:"flex",alignItems:"center",cursor:"pointer"},color:"warning"},{children:U}))]}))]}))]}))},$=function(){var i=v(),a=i.isNovacThemeEnabled,c=i.ravenEventName,l=i.ravenPayload,d=void 0===l?{}:l,u=i.ravenPushCallback,p=i.isUserLoggedIn,g=i.loyaltyType,h=i.ravenPageName,f=A({openDelay:0}),m=f.isDropdownVisible,y=f.handleOnMouseEnter,_=f.handleOnMouseLeave,w=f.handleDropdownMouseEnter,F=f.handleDropdownMouseLeave,E=r.useState(!1),L=E[0],T=E[1];r.useEffect(function(){var e=function(){T(window.scrollY>=50)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}},[]);var I=a&&!L?x.NOVAC:x.DEFAULT,M=I.hoverColor,D=I.typographyColor,N=r.useCallback(function(){var e,n=null!==(e=C("utm_source"))&&void 0!==e?e:"organic",r={action_name:"".concat(W.toLowerCase().replace(/[\s-]/g,""),"_header_hover"),action_type:"hover",u_utm_source:n,loyalty_type:b(g)};k(p,c,r,d,u,h)},[p,c,d,u,h,g]);return n.jsxs(t.Container,{children:[n.jsxs(t.Container,e.__assign({display:"flex",padding:"8px 12px",alignItems:"center",borderRadius:"12px",height:"100%",cursor:"pointer",css:{columnGap:8,height:64},onMouseEnter:function(){y(0),N()},onMouseLeave:_,id:z},{children:[n.jsx(s.MyAccount,{color:m?M:D}),n.jsxs(t.Container,e.__assign({display:"flex",flexDirection:"row",alignItems:"center"},{children:[n.jsx(o.Typography,e.__assign({variant:"B2",css:{cursor:"pointer"},colorCode:m?M:D},{children:W})),n.jsx(s.ChevronDown,{width:20,height:20,fill:m?M:D})]}))]})),n.jsx(j,e.__assign({show:m,marginTop:"64px",handleDropdownMouseEnter:w,handleDropdownMouseLeave:F,onMaskClick:F},{children:n.jsx(Z,{isOpen:m})}))]})},ee=function(){var c,l=v(),d=l.onLoginButtonClick,u=l.showAllLobs,p=void 0!==u&&u,h=l.isUserLoggedIn,f=l.loyaltyType,m=l.isNovacThemeEnabled,y=void 0!==m&&m,_=l.ravenPayload,F=void 0===_?{}:_,E=l.ravenPushCallback,L=l.ravenPageName,T=l.ravenEventName,I=r.useState(!1),M=I[0],D=I[1];r.useEffect(function(){var e=function(){D(window.scrollY>=50)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}},[]);var N,B=y&&!M?x.NOVAC:x.DEFAULT,P=B.headerBackground,R=B.logoFill,S=B.loginButtonColorVariant,H=B.hoverColor,O=B.fkcompanyColor,V=B.typographyColor,U=A({openDelay:0}),W=U.isDropdownVisible,q=U.hoveredElemIndex,z=U.handleOnMouseEnter,X=U.handleOnMouseLeave,Y=U.handleDropdownMouseEnter,K=U.handleDropdownMouseLeave,J=null!==(c=C("utm_source"))&&void 0!==c?c:"organic",Q=r.useCallback(function(e,n){return{action_name:e,action_type:n,u_utm_source:J,loyalty_type:b(f)}},[J,f]),Z=r.useCallback(function(e){if(e.isClickable&&e.link){var n="".concat(e.text.toLowerCase().replace(/\s/g,""),"_header_click"),r=Q(n,"click");k(h,T,r,F,E,L),window.location.href=e.link}},[Q,h,T,F,E,L]),ee=r.useCallback(function(){var e=Q("home_header_click","click");k(h,T,e,F,E,L),window.location.href="/"},[Q,h,T,F,E,L]),ne=r.useCallback(function(e){var n="".concat(e.text.toLowerCase().replace(/\s/g,""),"_header_hover"),r=Q(n,"hover");k(h,T,r,F,E,L)},[Q,h,T,F,E,L]);return n.jsxs(n.Fragment,{children:[n.jsx(t.Container,e.__assign({display:"flex",top:0,position:"sticky",width:"100%",alignItems:"center",justifyContent:"center",zIndex:1e3,height:"64px",background:P,css:{gap:"24px",flexShrink:0,borderBottom:"transparent"===P?"":"1px solid #E6E6E6",transition:"background-color 0.3s ease-in-out, border-bottom 0.3s ease-in-out"}},{children:n.jsxs(t.Container,e.__assign({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 28px",flex:1,css:{gap:"24px",maxWidth:1440}},{children:[n.jsxs(t.Container,e.__assign({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",cursor:"pointer",onClick:ee},{children:[n.jsx(s.CTLogo,{fillColor:R}),n.jsx(a.Divider,{css:{width:12,marginLeft:2,marginRight:2,transform:"rotate(90deg)",borderBottom:"1px solid #e0e0e0"}}),n.jsx(s.Fkcompany,{color:O})]})),n.jsxs(t.Container,e.__assign({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",columnGap:"24px"},{children:[n.jsx(t.Container,e.__assign({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",columnGap:"4px"},{children:g.map(function(r,i){var a=r.text,s=r.lefticon,c=r.rightIcon,l=r.isHoverable,d=q===i;return n.jsxs(t.Container,{children:[n.jsxs(t.Container,e.__assign({onMouseEnter:function(){z(i),r.isHoverable&&ne(r)},onMouseLeave:X,display:"flex",flexDirection:"row",alignItems:"center",padding:"8px 12px 8px 12px",cursor:"pointer",position:"relative",columnGap:8,height:"64px",onClick:function(){return Z(r)}},{children:[n.jsx(s,{color:d?H:V}),n.jsxs(t.Container,e.__assign({display:"flex",flexDirection:"row",alignItems:"center"},{children:[n.jsx(o.Typography,e.__assign({variant:"B2",colorCode:d?H:V,isClickable:!0},{children:a})),c&&n.jsx(c,{width:20,height:20,fill:d?H:V})]}))]}),"nav-option-".concat(i)),n.jsx(j,e.__assign({show:q===i&&l&&W,marginTop:"64px",handleDropdownMouseEnter:Y,handleDropdownMouseLeave:K,onMaskClick:K},{children:n.jsx(G,{isOpen:q===i&&l&&W})}))]})})})),h&&n.jsx(a.Divider,{css:{width:12,margin:"0 -18px",transform:"rotate(90deg)",borderBottom:"1px solid #e0e0e0"}}),n.jsx(t.Container,{children:h?n.jsx(t.Container,e.__assign({display:"flex",flexDirection:"row",alignItems:"center"},{children:n.jsx($,{})})):n.jsx(i.Button,e.__assign({onClick:d,css:e.__assign({width:153,height:40},(N="transparent"===P,N?{backgroundColor:"transparent !important","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.25)!important"}}:{backgroundColor:"transparent !important","&:hover":{backgroundColor:"#F3F3F3 !important"}})),loading:!1,color:S,variant:i.ButtonVariant.OUTLINE},{children:"Log in"}))})]}))]}))})),p&&n.jsx(w,{})]})};exports.Header=function(r){return n.jsx(y,e.__assign({value:r},{children:n.jsx(ee,{})}))};
|
|
2
2
|
//# sourceMappingURL=ct-design-header.browser.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__makeTemplateObject as n,__spreadArray as r}from"tslib";import{jsx as o,jsxs as t,Fragment as i}from"react/jsx-runtime";import{createContext as a,useContext as c,useState as l,useRef as s,useEffect as d,useCallback as u,useMemo as p}from"react";import{Container as h}from"@cleartrip/ct-design-container";import{Typography as f,TypographyVariant as g}from"@cleartrip/ct-design-typography";import{ButtonColor as m,Button as v,ButtonVariant as x}from"@cleartrip/ct-design-button";import{Divider as y}from"@cleartrip/ct-design-divider";import{Offers as b,BusinessBag as w,ChevronDown as k,MyTrips as C,SupportIcon as F,ArrowRight as _,MyAccount as E,SavedCard as L,Travellers as I,HiFive as M,Wallet as D,SettingsCog as P,PrivacyRights as T,HeaderChevronRight as N,FkBlackIcon as A,FkGold as B,InsiderIcon as H,InsiderElite as G,CtLoyalty as R,Supercoin as O,Signout as j,CTLogo as S,Fkcompany as U}from"@cleartrip/ct-design-icons";import V,{keyframes as z}from"styled-components";var W,X,Y=[{lefticon:b,text:"Offers",ravenActionName:"offers",isHoverable:!1,isClickable:!0,link:"all-offers/?categories=flights"},{lefticon:w,text:"Business",ravenActionName:"business",rightIcon:k,isHoverable:!0},{lefticon:C,text:"My Trips",ravenActionName:"mytrips",isHoverable:!1,isClickable:!0,link:"/account/trips"},{lefticon:F,text:"Support",ravenActionName:"support",isHoverable:!1,isClickable:!0,link:"/support"}],K=[{title:"Flights",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Flights.png?cache=true",link:"/flights"},{title:"Hotels",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Hotels.png?cache=true",link:"/hotels"},{title:"Buses",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Buses.png?cache=true",link:"/bus"},{title:"Packages",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Packages.png?cache=true",link:"/holidays"}],q=[{title:"AgentBox",subtitle:"For travel agents",details:"One-stop travel solution offering the best deals to our travel agency partners",link:"https://agency.cleartrip.com"},{title:"OutOfOffice",subtitle:"For startups, corporates and SMEs",details:"Manage corporate business travel, smartly",link:"https://ooo.cleartrip.com/",ravenActionName:"ooo"},{title:"MICE",subtitle:"For corporate events",details:"An end-to-end management solution for all your corporate events",link:"https://business.cleartrip.com/"},{title:"API",subtitle:"For developers",details:"Unlock seamless integration and scale with our powerful, reliable APIs",link:"https://business.cleartrip.com/api-customers/more-details"}];!function(e){e.UNIFIED_HOME="unified_homepage",e.HOTELS_HOME="hotel_home",e.FLIGHTS_HOME="flights_home"}(W||(W={})),function(e){e.DESKTOP="desktop"}(X||(X={}));var J={NOVAC:{headerBackground:"transparent",hoverColor:"#FDBA12",logoFill:"#FFF",fkcompanyColor:"#FFF",typographyColor:"#FFF",loginButtonColorVariant:m.NEUTRAL},DEFAULT:{headerBackground:"#FFFFFF",hoverColor:"#FF4F17",logoFill:"#FF4F17",fkcompanyColor:"#1A1A1A",typographyColor:"#1A1A1A",loginButtonColorVariant:m.PRIMARY}},Q=a(void 0),Z=function(){var e=c(Q);if(!e)throw new Error("useHeaderContext must be used within a HeaderProvider");return e},$=function(n){var r=n.value,t=n.children;return o(Q.Provider,e({value:r},{children:t}))},ee=function(e){var n=Object.keys(e),r=[];return n.forEach(function(n){r.includes(n)?e[n]=Number(e[n]):e[n]=""+e[n]}),e},ne=function(e){return"undefined"!=typeof window&&window?new URLSearchParams(window.location.search).get(e):""},re=function(e){switch(e){case"FkVip":return"fk_vip";case"FkPremium":return"fk_plus_premium";case"InsiderIcon":return"myntra_insidericon";case"InsiderElite":return"myntra_insiderelite";default:return""}},oe=function(n,r,o,t,i,a){var c;if("function"==typeof i){var l={page_name:a,platform:X.DESKTOP,login_status:n?"yes":"no",domain:null===(c=null===window||void 0===window?void 0:window.location)||void 0===c?void 0:c.hostname},s=ee(o),d=ee(t),u=e(e(e({},l),s),d);try{1===i.length?i({eventName:r,eventData:u}):i(r,u)}catch(e){return void console.error(e)}}else console.error("ravenPushCallback is not provided or is not a function")},te=function(){var n=Z(),r=n.selectedLOB,i=n.isUserLoggedIn,a=n.ravenEventName,c=n.ravenPageName,l=n.ravenPayload,s=void 0===l?{}:l,d=n.ravenPushCallback;return o(h,e({display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",background:"#F7FAFF",top:"64px",zIndex:2,css:{gap:24}},{children:K.map(function(n,l){var u=n.title,p=n.link,m=n.image,v=r===u;return o("a",e({href:v?void 0:p,style:{textDecoration:"none",pointerEvents:v?"none":"auto"},onClick:function(){return function(e,n){if(!n){var r={action_name:"".concat(e.toLowerCase(),"_tab_click"),action_type:"click"};oe(i,a,r,s,d,c)}}(u,v)}},{children:t(h,e({display:"flex",alignItems:"center",width:"116px",height:"48px",justifyContent:"center",cursor:"pointer",css:{gap:8,background:v?"#FFFFFF":"transparent",border:v?"1px solid #E6E6E6":"",borderRadius:"40px",padding:"8px 16px 8px 8px",transition:"background 0.2s ease"}},{children:[o("img",{src:m,alt:u,width:32,height:32}),o(f,e({variant:v?g.HM3:g.B1,isClickable:!0},{children:u}))]}))}),l)})}))};function ie(n){var r=n.children,a=n.onMaskClick,c=n.show,u=n.marginTop,p=n.handleDropdownMouseEnter,f=n.handleDropdownMouseLeave;d(function(){return c&&(document.body.style.overflow="hidden"),function(){document.body.style.overflow="initial"}},[c]);var g=function(e,n){var r=l(e),o=r[0],t=r[1],i=s();return d(function(){return e?t(e):i.current=setTimeout(function(){t(!1)},n),function(){(null==i?void 0:i.current)&&clearTimeout(i.current)}},[e]),o}(c,300),m=function(e,n){var r=l(!1),o=r[0],t=r[1],i=s();return d(function(){return e&&!o?setTimeout(function(){t(!0)},0):!e&&o&&(i.current=setTimeout(function(){return t(!1)},n)),function(){i&&i.current&&clearTimeout(i.current)}},[n,e]),o}(c,100);return t(i,{children:[g&&o(h,{id:"mask-container",css:{position:"fixed",backgroundColor:"#000",opacity:m?.4:0,width:"100%",height:"100vh",left:0,top:u||0,zIndex:9,transition:"opacity 300ms ease-in"},onClick:a}),g&&o(h,e({onMouseEnter:p,onMouseLeave:f},{children:r}))]})}var ae,ce,le,se,de,ue,pe=function(e){var n=void 0===e?{}:e,r=n.closeDelay,o=void 0===r?0:r,t=n.openDelay,i=void 0===t?500:t,a=Math.max(o,150),c=l(!1),p=c[0],h=c[1],f=l(null),g=f[0],m=f[1],v=s(null),x=s(null),y=s(!1),b=u(function(e){v.current&&clearTimeout(v.current),x.current&&clearTimeout(x.current),y.current=!1,x.current=setTimeout(function(){h(!0),y.current||m(e)},i)},[i]),w=u(function(){y.current=!0,v.current=setTimeout(function(){h(!1),m(null)},a)},[a]),k=u(function(){v.current&&clearTimeout(v.current)},[]),C=u(function(){y.current=!0,(null==v?void 0:v.current)&&clearTimeout(v.current),v.current=setTimeout(function(){h(!1),m(null)},a)},[]);return d(function(){var e=function(e){e.clientY<=0&&(h(!1),m(null))};return window.addEventListener("mouseleave",e),function(){window.removeEventListener("mouseleave",e)}},[]),{isDropdownVisible:p,hoveredElemIndex:g,handleOnMouseEnter:b,handleOnMouseLeave:w,handleDropdownMouseEnter:k,handleDropdownMouseLeave:C}},he=function(e){var n=s(null);return d(function(){e?function(){if(n.current){var e=n.current.scrollHeight;n.current.style.maxHeight="".concat(e/2,"px"),n.current.style.opacity="0",requestAnimationFrame(function(){n.current&&(n.current.style.transition="max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",n.current.style.maxHeight="".concat(e,"px"),n.current.style.opacity="1")})}}():function(){if(n.current){var e=n.current.scrollHeight;n.current.style.transition="max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",n.current.style.maxHeight="".concat(e/2,"px"),n.current.style.opacity="0",setTimeout(function(){n.current&&(n.current.style.maxHeight="0px")},300)}}()},[e]),{containerRef:n}},fe={transition:"background-color 0.2s ease-in-out","&:hover":{backgroundColor:"#ECF3FF"}},ge={transition:"background-color 0.2s ease-in-out","&:hover":{backgroundColor:"#FBEFEF"}},me=z(ae||(ae=n(["\n from {\n transform: translateX(-20px);\n }\n to {\n transform: translateX(0px);\n }\n"],["\n from {\n transform: translateX(-20px);\n }\n to {\n transform: translateX(0px);\n }\n"]))),ve=z(ce||(ce=n(["\n from {\n transform: translateX(-20.01px);\n }\n to {\n transform: translateX(0px);\n }\n"],["\n from {\n transform: translateX(-20.01px);\n }\n to {\n transform: translateX(0px);\n }\n"]))),xe={display:"flex",backgroundColor:"black",transition:"background-color 200ms ease","flex-direction":"row",justifyContent:"center",width:"20px",height:"20px",overflow:"hidden",borderRadius:"50%"},ye=function(){return o(h,e({className:"bd-arrow-container-js",css:xe},{children:r([],Array(3),!0).map(function(n,r){return o(h,e({className:"bd-arrow-wrapper-js",display:"flex",alignItems:"center"},{children:o(_,{})}),r)})}))},be=V.div.withConfig({displayName:"BusinessDropdown__BDHoverContainer",componentId:"sc-1tsshe4-0"})(le||(le=n(["\n cursor: pointer;\n width: 200px;\n &:hover {\n .bd-arrow-container-js {\n background-color: rgba(255, 79, 23, 1);\n transition: color 200ms ease;\n }\n .bd-arrow-wrapper-js {\n animation: "," 200ms linear;\n display: flex;\n }\n .color-orange-on-hover-js {\n color: rgba(255, 79, 23, 1);\n transition: background-color 200ms ease;\n }\n }\n &:not(:hover) .bd-arrow-wrapper-js {\n animation: "," 200ms linear backwards;\n }\n"],["\n cursor: pointer;\n width: 200px;\n &:hover {\n .bd-arrow-container-js {\n background-color: rgba(255, 79, 23, 1);\n transition: color 200ms ease;\n }\n .bd-arrow-wrapper-js {\n animation: "," 200ms linear;\n display: flex;\n }\n .color-orange-on-hover-js {\n color: rgba(255, 79, 23, 1);\n transition: background-color 200ms ease;\n }\n }\n &:not(:hover) .bd-arrow-wrapper-js {\n animation: "," 200ms linear backwards;\n }\n"])),me,ve),we=function(n){var r=n.isOpen,i=Z(),a=i.isUserLoggedIn,c=i.ravenPushCallback,s=i.ravenPageName,p=i.ravenEventName,g=i.loyaltyType,m=i.ravenPayload,v=void 0===m?{}:m,x=l(0),y=x[0],b=x[1],w=he(r).containerRef;d(function(){var e=function(){if(w.current){var e=(window.innerWidth-(w.current.offsetWidth||0))/2;e!==y&&b(e)}};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[w,y]);var k=u(function(e,n,r){var o,t=null!==(o=ne("utm_source"))&&void 0!==o?o:"organic",i={action_name:r?"".concat(r,"_business_click"):n?"".concat(n.toLowerCase(),"_business_click"):"",action_type:"click",u_utm_source:t,loyalty_type:re(g)};e&&(oe(a,p,i,v,c,s),window.location.href=e)},[a,p,v,c,s,g]);return t(h,e({ref:w,backgroundColor:"#fff",top:"76px",position:"fixed",left:"".concat(y,"px"),borderRadius:24,boxShadow:"0px 8px 24px 0px rgba(26, 26, 26, 0.10)",width:"fit-content",zIndex:1002,css:{overflow:"hidden",opacity:0}},{children:[o(h,e({padding:"20px 24px 20px 24px",backgroundColor:"#FFF1EC"},{children:o(f,e({variant:"HM2"},{children:"Other business services"}))})),o(h,e({display:"flex",flexDirection:"row",padding:"24px",columnGap:"48px",width:"fit-content"},{children:q.map(function(n){var r=n.title,i=n.subtitle,a=n.details,c=n.link,l=n.ravenActionName;return t(be,e({className:"bd-hover-container-js",onClick:function(){return k(c,r,l)}},{children:[t(h,e({display:"flex",flexDirection:"column",rowGap:"4px"},{children:[t(h,e({display:"flex",flexDirection:"row",alignItems:"center",columnGap:"8px"},{children:[o(f,e({variant:"HM2",className:"color-orange-on-hover-js",css:{transition:"color 200ms ease"}},{children:r})),o(ye,{})]})),o(f,e({variant:"B3",css:{marginTop:"4px",opacity:.75}},{children:i}))]})),o(f,e({variant:"P3",color:"subheading",css:{marginTop:"12px"}},{children:a}))]}),r)})}))]}))},ke=[{text:"My Profile",icon:o(E,{width:24,height:24}),redirectionLink:"/accounts/profile"},{text:"My Trips",icon:o(C,{width:24,height:24}),redirectionLink:"/accounts/trips"},{text:"Saved Cards",icon:o(L,{}),redirectionLink:"/accounts/expressway"},{text:"Saved Travellers",icon:o(I,{width:24,height:24}),redirectionLink:"/account/travellers"},{text:"Hi-Five",icon:o(M,{}),redirectionLink:"/accounts/hi-five?src=fh"},{text:"Wallet",icon:o(D,{width:24,height:24}),redirectionLink:"/accounts/wallet"},{text:"Settings",icon:o(P,{width:24,height:24}),redirectionLink:"/account/settings"},{text:"Privacy Rights",icon:o(T,{}),redirectionLink:"accounts/personal-data-dashboard"}],Ce="Logout",Fe="My Account",_e="You are logged in with",Ee="header-acc-btn",Le="account-options",Ie=function(n){var r=n.icon,i=n.borderGradient,a=n.backgroundGradient,c=n.handleChipClick,s=n.chevronFillColor,d=Z(),p=d.loyaltyType,f=d.isUserLoggedIn,g=d.ravenPushCallback,m=d.ravenPageName,v=d.ravenPayload,x=void 0===v?{}:v,y=d.ravenEventName,b=l(!1),w=b[0],k=b[1],C=u(function(){var e;if(c)c();else{var n={action_name:"loyalty_account_click",action_type:"click",u_utm_source:null!==(e=ne("utm_source"))&&void 0!==e?e:"organic",loyaltyType:re(p)};oe(f,y,n,x,g,m),window.location.href="/all-offers/loyalty-october"}},[c,p,f,y,x,g,m]);return t(h,e({display:"flex",position:"relative",alignItems:"center",justifyContent:"center",borderRadius:"8px",cursor:"pointer",paddingLeft:"8px",paddingRight:w?"4px":"8px",css:{overflow:"hidden",height:32,paddingLeft:8,transition:"padding-right 0.2s ease-in-out"},onMouseEnter:function(){return k(!0)},onMouseLeave:function(){return k(!1)},onClick:C},{children:[o(h,{css:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",background:a,zIndex:-2}}),o(h,{css:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",padding:"1px",background:i,WebkitMask:"linear-gradient(white, white) content-box, linear-gradient(white, white)",WebkitMaskComposite:"destination-out",maskComposite:"exclude",zIndex:-1}}),o(h,e({display:"flex",alignItems:"center",position:"relative"},{children:r})),o(h,e({display:"flex",alignItems:"center",css:{overflow:"hidden",maxWidth:w?16:0,transition:"max-width 0.2s ease-in-out, opacity 0.2s ease-in-out",opacity:w?.5:0}},{children:o(N,{color:s})}))]}))};!function(e){e.FLIGHTS="Flights",e.HOTELS="Hotels",e.BUSES="Buses",e.TRAINS="Trains",e.PACKAGES="Packages"}(se||(se={})),function(e){e.FkVip="FkVip",e.FkPremium="FkPremium",e.InsiderIcon="InsiderIcon",e.InsiderElite="InsiderElite",e.CtLoyalty="CtLoyalty"}(de||(de={}));var Me=((ue={})[de.FkVip]={icon:o(A,{}),borderGradient:"linear-gradient(217.07deg, #0B182A 19.65%, #434E57 54.8%, #595952 89.95%)",backgroundGradient:"linear-gradient(217.07deg, #0B182A 19.65%, #434E57 54.8%, #595952 89.95%)",chevronFillColor:"#FFF"},ue[de.FkPremium]={icon:o(B,{}),borderGradient:"linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)",backgroundGradient:"#191717",chevronFillColor:"#FFF"},ue[de.InsiderIcon]={icon:o(H,{}),borderGradient:"linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)",backgroundGradient:"linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)",chevronFillColor:"#FFF"},ue[de.InsiderElite]={icon:o(G,{}),borderGradient:"linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)",backgroundGradient:"linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)",chevronFillColor:"#FFF"},ue[de.CtLoyalty]={icon:o(R,{}),borderGradient:"linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)",backgroundGradient:"linear-gradient(110.82deg, #FFF9EC 0%, #FEE3A8 100%)",chevronFillColor:"#1A1A1A"},ue),De=function(n){var r=n.icon,i=n.handleChipClick,a=n.value,c=n.type,s=Z(),d=s.loyaltyType,p=s.isUserLoggedIn,g=s.ravenPushCallback,m=s.ravenPageName,v=s.ravenEventName,x=s.ravenPayload,y=void 0===x?{}:x,b=l(!1),w=b[0],k=b[1],C=u(function(){var e;if(i)i();else{var n=null!==(e=ne("utm_source"))&&void 0!==e?e:"organic",r={action_name:"".concat(c,"_account_click"),action_type:"click",u_utm_source:n,loyaltyType:re(d)};oe(p,v,r,y,g,m);var o={supercoin:"/all-offers/supercoins/",wallet:"/accounts/wallet"};o[c]&&(window.location.href=o[c])}},[i,c,d,p,v,y,g,m]);return t(h,e({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px",cursor:"pointer",css:{height:32,paddingLeft:8,paddingRight:w?4:8,transition:"padding-right 0.2s ease-in-out",background:w?"#ffd7ca":"#ffe6df"},onMouseEnter:function(){return k(!0)},onMouseLeave:function(){return k(!1)},onClick:C},{children:[t(h,e({display:"flex",alignItems:"center",css:{gap:"4px"}},{children:[r,o(f,e({variant:"B3",isClickable:!0},{children:a}))]})),o(h,e({display:"flex",alignItems:"center",css:{overflow:"hidden",maxWidth:w?16:0,transition:"max-width 0.2s ease-in-out, opacity 0.2s ease-in-out",opacity:w?1:0}},{children:o(N,{})}))]}))},Pe=function(){var n,r=Z(),i=r.loyaltyType,a=r.fkSupercoinBurnBalance,c=void 0===a?0:a,l=r.walletBalance,s=void 0===l?0:l,d=r.loyaltyLoading,u=r.superCoinsLoading,p=r.walletLoading,f=r.walletChipClick,g=r.supercoinsChipClick,m=r.loyaltyChipClick,v=r.hideWalletChip,x=r.hideSupercoinsChip,y=r.hideLoyaltyChip;return d||i&&Me[i]&&!y||(u||!x)||(p||!v)?t(h,e({display:"flex",padding:"0 16px 16px 16px",justifyContent:"flex-start",css:{alignSelf:"stretch",gap:"4px"}},{children:[d?o(h,{width:"50px",height:"32px",borderRadius:"8px",backgroundColor:"#efefef"}):i&&Me[i]&&!y&&o(Ie,{icon:Me[i].icon,borderGradient:Me[i].borderGradient,backgroundGradient:Me[i].backgroundGradient,chevronFillColor:(null===(n=Me[i])||void 0===n?void 0:n.chevronFillColor)||"#FFF",handleChipClick:m}),u?o(h,{width:"50px",height:"32px",borderRadius:"8px",backgroundColor:"#efefef"}):!x&&o(De,{icon:o(O,{width:20,height:20}),value:c,handleChipClick:g,type:"supercoin"}),p?o(h,{width:"50px",height:"32px",borderRadius:"8px",backgroundColor:"#efefef"}):!v&&o(De,{icon:o(D,{width:20,height:20}),value:s,handleChipClick:f,type:"wallet"})]})):null},Te=function(n){var r=n.isOpen,a=Z(),c=a.handleLogoutClick,l=a.userName,s=a.userMobileNumber,g=a.countryCode,m=a.userDetailsLoading,v=a.loyaltyType,x=a.isUserLoggedIn,b=a.ravenEventName,w=a.ravenPageName,k=a.ravenPayload,C=void 0===k?{}:k,F=a.ravenPushCallback,_=he(r).containerRef,E=p(function(){return{userGreeting:l?"Hello ".concat(l,"!"):"",phoneNumber:g&&s?"".concat(g," ").concat(s):""}},[l,s,g]),L=E.userGreeting,I=E.phoneNumber,M=function(e){var n;return{action_name:e.toLowerCase().replace(/[\s-]/g,"")+"_account_click",action_type:"click",u_utm_source:null!==(n=ne("utm_source"))&&void 0!==n?n:"organic",loyalty_type:re(v)}},D=u(function(e,n){oe(x,b,M(e),C,F,w),window.location.href=n},[x,b,C,F,w]);u(function(){oe(x,b,M(Ce),C,F,w),c()},[x,b,C,F,w,c]);var P=u(function(){var e=document.getElementById(Ee),n=document.getElementById(Le);if(e&&n){var r=e.getBoundingClientRect().right;n.style.left="".concat(r-328,"px")}},[]);d(function(){P()},[P]);var T;return t(h,e({id:Le,ref:_,display:"flex",flexDirection:"column",borderRadius:"16px",zIndex:1002,top:"76px",position:"fixed",css:{opacity:0,overflow:"hidden"},width:"".concat(328,"px"),background:"#FFF1EC"},{children:[o(h,e({padding:"16px",height:"76px"},{children:(T=function(n,r,t,i){return o(f,e({variant:t,color:i},{children:n?o(h,{height:"HM3"===t?"18px":"12px",width:"HM3"===t?"140px":"200px",backgroundColor:"#efefef",borderRadius:"8px"}):r}))},o(h,e({display:"flex",flexDirection:"column",css:{gap:"4px"}},{children:t(i,L?{children:[T(m,L,"HM3","primary"),T(m,"".concat(_e," ").concat(I),"P3","subheading")]}:{children:[T(m,_e,"P3","subheading"),T(m,I,"HM3","primary")]})})))})),o(Pe,{}),t(h,e({display:"flex",flexDirection:"column",padding:"8px",backgroundColor:"white",rowGap:"8px",css:{borderBottomLeftRadius:12,borderBottomRightRadius:12}},{children:[ke.map(function(n){var r=n.text,i=n.icon,a=n.redirectionLink;return o(h,e({padding:"8px",borderRadius:"8px",cursor:"pointer",onClick:function(){return D(r,a)},css:fe},{children:t(h,e({display:"flex",cursor:"pointer",css:{columnGap:"8px"}},{children:[i,o(f,e({variant:"P1",css:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:r}))]}))}),"account-option-".concat(r))}),o(y,{css:{borderBottom:"1px dashed #E6E6E6"}}),t(h,e({display:"flex",padding:"8px",borderRadius:"8px",cursor:"pointer",columnGap:"8px",onClick:c,css:ge},{children:[o(j,{height:24,width:24}),o(f,e({variant:"P1",css:{display:"flex",alignItems:"center",cursor:"pointer"},color:"warning"},{children:Ce}))]}))]}))]}))},Ne=function(){var n=Z(),r=n.isNovacThemeEnabled,i=n.ravenEventName,a=n.ravenPayload,c=void 0===a?{}:a,s=n.ravenPushCallback,p=n.isUserLoggedIn,g=n.loyaltyType,m=n.ravenPageName,v=pe({openDelay:0}),x=v.isDropdownVisible,y=v.handleOnMouseEnter,b=v.handleOnMouseLeave,w=v.handleDropdownMouseEnter,C=v.handleDropdownMouseLeave,F=l(!1),_=F[0],L=F[1];d(function(){var e=function(){L(window.scrollY>=50)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}},[]);var I=r&&!_?J.NOVAC:J.DEFAULT,M=I.hoverColor,D=I.typographyColor,P=u(function(){var e,n=null!==(e=ne("utm_source"))&&void 0!==e?e:"organic",r={action_name:"".concat(Fe.toLowerCase().replace(/[\s-]/g,""),"_header_hover"),action_type:"hover",u_utm_source:n,loyalty_type:re(g)};oe(p,i,r,c,s,m)},[p,i,c,s,m,g]);return t(h,{children:[t(h,e({display:"flex",padding:"8px 12px",alignItems:"center",borderRadius:"12px",height:"100%",cursor:"pointer",css:{columnGap:8,height:64},onMouseEnter:function(){y(0),P()},onMouseLeave:b,id:Ee},{children:[o(E,{color:x?M:D}),t(h,e({display:"flex",flexDirection:"row",alignItems:"center"},{children:[o(f,e({variant:"B2",css:{cursor:"pointer"},colorCode:x?M:D},{children:Fe})),o(k,{width:20,height:20,fill:x?M:D})]}))]})),o(ie,e({show:x,marginTop:"64px",handleDropdownMouseEnter:w,handleDropdownMouseLeave:C,onMaskClick:C},{children:o(Te,{isOpen:x})}))]})},Ae=function(n){return o($,e({value:n},{children:o(Be,{})}))},Be=function(){var n,r=Z(),a=r.onLoginButtonClick,c=r.showAllLobs,s=void 0!==c&&c,p=r.isUserLoggedIn,g=r.loyaltyType,m=r.isNovacThemeEnabled,b=void 0!==m&&m,w=r.ravenPayload,k=void 0===w?{}:w,C=r.ravenPushCallback,F=r.ravenPageName,_=r.ravenEventName,E=l(!1),L=E[0],I=E[1];d(function(){var e=function(){I(window.scrollY>=50)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}},[]);var M,D=b&&!L?J.NOVAC:J.DEFAULT,P=D.headerBackground,T=D.logoFill,N=D.loginButtonColorVariant,A=D.hoverColor,B=D.fkcompanyColor,H=D.typographyColor,G=pe({openDelay:0}),R=G.isDropdownVisible,O=G.hoveredElemIndex,j=G.handleOnMouseEnter,V=G.handleOnMouseLeave,z=G.handleDropdownMouseEnter,W=G.handleDropdownMouseLeave,X=null!==(n=ne("utm_source"))&&void 0!==n?n:"organic",K=u(function(e,n){return{action_name:e,action_type:n,u_utm_source:X,loyalty_type:re(g)}},[X,g]),q=u(function(e){if(e.isClickable&&e.link){var n="".concat(e.text.toLowerCase().replace(/\s/g,""),"_header_click"),r=K(n,"click");oe(p,_,r,k,C,F),window.location.href=e.link}},[K,p,_,k,C,F]),Q=u(function(){var e=K("home_header_click","click");oe(p,_,e,k,C,F),window.location.href="/"},[K,p,_,k,C,F]),$=u(function(e){var n="".concat(e.text.toLowerCase().replace(/\s/g,""),"_header_hover"),r=K(n,"hover");oe(p,_,r,k,C,F)},[K,p,_,k,C,F]);return t(i,{children:[o(h,e({display:"flex",top:0,position:"sticky",width:"100%",alignItems:"center",justifyContent:"center",zIndex:1e3,height:"64px",background:P,css:{gap:"24px",flexShrink:0,borderBottom:"transparent"===P?"":"1px solid #E6E6E6",transition:"background-color 0.3s ease-in-out, border-bottom 0.3s ease-in-out"}},{children:t(h,e({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 28px",flex:1,css:{gap:"24px",maxWidth:1440}},{children:[t(h,e({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",cursor:"pointer",onClick:Q},{children:[o(S,{fillColor:T}),o(y,{css:{width:12,marginLeft:2,marginRight:2,transform:"rotate(90deg)",borderBottom:"1px solid #e0e0e0"}}),o(U,{color:B})]})),t(h,e({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",columnGap:"24px"},{children:[o(h,e({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",columnGap:"4px"},{children:Y.map(function(n,r){var i=n.text,a=n.lefticon,c=n.rightIcon,l=n.isHoverable,s=O===r;return t(h,{children:[t(h,e({onMouseEnter:function(){j(r),n.isHoverable&&$(n)},onMouseLeave:V,display:"flex",flexDirection:"row",alignItems:"center",padding:"8px 12px 8px 12px",cursor:"pointer",position:"relative",columnGap:8,height:"64px",onClick:function(){return q(n)}},{children:[o(a,{color:s?A:H}),t(h,e({display:"flex",flexDirection:"row",alignItems:"center"},{children:[o(f,e({variant:"B2",colorCode:s?A:H,isClickable:!0},{children:i})),c&&o(c,{width:20,height:20,fill:s?A:H})]}))]}),"nav-option-".concat(r)),o(ie,e({show:O===r&&l&&R,marginTop:"64px",handleDropdownMouseEnter:z,handleDropdownMouseLeave:W,onMaskClick:W},{children:o(we,{isOpen:O===r&&l&&R})}))]})})})),p&&o(y,{css:{width:12,margin:"0 -18px",transform:"rotate(90deg)",borderBottom:"1px solid #e0e0e0"}}),o(h,{children:p?o(h,e({display:"flex",flexDirection:"row",alignItems:"center"},{children:o(Ne,{})})):o(v,e({onClick:a,css:e({width:153,height:40},(M="transparent"===P,M?{backgroundColor:"transparent !important","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.25)!important"}}:{backgroundColor:"transparent !important","&:hover":{backgroundColor:"#F3F3F3 !important"}})),loading:!1,color:N,variant:x.OUTLINE},{children:"Log in"}))})]}))]}))})),s&&o(te,{})]})};export{Ae as Header,se as LOBS_VALUES,de as LoyaltyType,W as RAVEN_PAGE_NAMES};
|
|
1
|
+
import{__assign as e,__makeTemplateObject as n,__spreadArray as r}from"tslib";import{jsx as o,jsxs as t,Fragment as i}from"react/jsx-runtime";import{createContext as a,useContext as c,useState as l,useRef as s,useEffect as d,useCallback as u,useMemo as p}from"react";import{Container as h}from"@cleartrip/ct-design-container";import{Typography as f,TypographyVariant as g}from"@cleartrip/ct-design-typography";import{ButtonColor as m,Button as v,ButtonVariant as x}from"@cleartrip/ct-design-button";import{Divider as y}from"@cleartrip/ct-design-divider";import{Offers as b,BusinessBag as w,ChevronDown as k,MyTrips as C,SupportIcon as F,ArrowRight as _,MyAccount as E,SavedCard as L,Travellers as I,HiFive as M,Wallet as D,SettingsCog as T,PrivacyRights as N,HeaderChevronRight as A,FkBlackIcon as P,FkGold as B,InsiderIcon as H,InsiderElite as R,CtLoyalty as G,Supercoin as O,Signout as j,CTLogo as S,Fkcompany as U}from"@cleartrip/ct-design-icons";import V,{keyframes as z}from"styled-components";var W,X,Y=[{lefticon:b,text:"Offers",ravenActionName:"offers",isHoverable:!1,isClickable:!0,link:"all-offers/?categories=flights"},{lefticon:w,text:"Business",ravenActionName:"business",rightIcon:k,isHoverable:!0},{lefticon:C,text:"My Trips",ravenActionName:"mytrips",isHoverable:!1,isClickable:!0,link:"/account/trips"},{lefticon:F,text:"Support",ravenActionName:"support",isHoverable:!1,isClickable:!0,link:"/support"}],K=[{title:"Flights",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Flights.png?cache=true",link:"/flights"},{title:"Hotels",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Hotels.png?cache=true",link:"/hotels"},{title:"Buses",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Buses.png?cache=true",link:"/bus"},{title:"Holidays",image:"https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Packages.png?cache=true",link:"/holidays"}],q=[{title:"AgentBox",subtitle:"For travel agents",details:"One-stop travel solution offering the best deals to our travel agency partners",link:"https://agency.cleartrip.com"},{title:"OutOfOffice",subtitle:"For startups, corporates and SMEs",details:"Manage corporate business travel, smartly",link:"https://ooo.cleartrip.com/",ravenActionName:"ooo"},{title:"MICE",subtitle:"For corporate events",details:"An end-to-end management solution for all your corporate events",link:"https://business.cleartrip.com/"},{title:"API",subtitle:"For developers",details:"Unlock seamless integration and scale with our powerful, reliable APIs",link:"https://business.cleartrip.com/api-customers/more-details"}];!function(e){e.UNIFIED_HOME="unified_homepage",e.HOTELS_HOME="hotel_home",e.FLIGHTS_HOME="flights_home"}(W||(W={})),function(e){e.DESKTOP="desktop"}(X||(X={}));var J={NOVAC:{headerBackground:"transparent",hoverColor:"#FDBA12",logoFill:"#FFF",fkcompanyColor:"#FFF",typographyColor:"#FFF",loginButtonColorVariant:m.NEUTRAL},DEFAULT:{headerBackground:"#FFFFFF",hoverColor:"#FF4F17",logoFill:"#FF4F17",fkcompanyColor:"#1A1A1A",typographyColor:"#1A1A1A",loginButtonColorVariant:m.PRIMARY}},Q=a(void 0),Z=function(){var e=c(Q);if(!e)throw new Error("useHeaderContext must be used within a HeaderProvider");return e},$=function(n){var r=n.value,t=n.children;return o(Q.Provider,e({value:r},{children:t}))},ee=function(e){var n=Object.keys(e),r=[];return n.forEach(function(n){r.includes(n)?e[n]=Number(e[n]):e[n]=""+e[n]}),e},ne=function(e){return"undefined"!=typeof window&&window?new URLSearchParams(window.location.search).get(e):""},re=function(e){switch(e){case"FkVip":return"fk_vip";case"FkPremium":return"fk_plus_premium";case"InsiderIcon":return"myntra_insidericon";case"InsiderElite":return"myntra_insiderelite";default:return""}},oe=function(n,r,o,t,i,a){var c;if("function"==typeof i){var l={page_name:a,platform:X.DESKTOP,login_status:n?"yes":"no",domain:null===(c=null===window||void 0===window?void 0:window.location)||void 0===c?void 0:c.hostname},s=ee(o),d=ee(t),u=e(e(e({},l),s),d);try{1===i.length?i({eventName:r,eventData:u}):i(r,u)}catch(e){return void console.error(e)}}else console.error("ravenPushCallback is not provided or is not a function")},te=function(){var n=Z(),r=n.selectedLOB,i=n.isUserLoggedIn,a=n.ravenEventName,c=n.ravenPageName,l=n.ravenPayload,s=void 0===l?{}:l,d=n.ravenPushCallback;return o(h,e({display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",background:"#F7FAFF",top:"64px",zIndex:2,css:{gap:24}},{children:K.map(function(n,l){var u=n.title,p=n.link,m=n.image,v=r===u;return o("a",e({href:v?void 0:p,style:{textDecoration:"none",pointerEvents:v?"none":"auto"},onClick:function(){return function(e,n){if(!n){var r={action_name:"".concat(e.toLowerCase(),"_tab_click"),action_type:"click"};oe(i,a,r,s,d,c)}}(u,v)}},{children:t(h,e({display:"flex",alignItems:"center",width:"116px",height:"48px",justifyContent:"center",cursor:"pointer",css:{gap:8,background:v?"#FFFFFF":"transparent",border:v?"1px solid #E6E6E6":"",borderRadius:"40px",padding:"8px 16px 8px 8px",transition:"background 0.2s ease"}},{children:[o("img",{src:m,alt:u,width:32,height:32}),o(f,e({variant:v?g.HM3:g.B1,isClickable:!0},{children:u}))]}))}),l)})}))};function ie(n){var r=n.children,a=n.onMaskClick,c=n.show,u=n.marginTop,p=n.handleDropdownMouseEnter,f=n.handleDropdownMouseLeave;d(function(){return c&&(document.body.style.overflow="hidden"),function(){document.body.style.overflow="initial"}},[c]);var g=function(e,n){var r=l(e),o=r[0],t=r[1],i=s();return d(function(){return e?t(e):i.current=setTimeout(function(){t(!1)},n),function(){(null==i?void 0:i.current)&&clearTimeout(i.current)}},[e]),o}(c,300),m=function(e,n){var r=l(!1),o=r[0],t=r[1],i=s();return d(function(){return e&&!o?setTimeout(function(){t(!0)},0):!e&&o&&(i.current=setTimeout(function(){return t(!1)},n)),function(){i&&i.current&&clearTimeout(i.current)}},[n,e]),o}(c,100);return t(i,{children:[g&&o(h,{id:"mask-container",css:{position:"fixed",backgroundColor:"#000",opacity:m?.4:0,width:"100%",height:"100vh",left:0,top:u||0,zIndex:9,transition:"opacity 300ms ease-in"},onClick:a}),g&&o(h,e({onMouseEnter:p,onMouseLeave:f},{children:r}))]})}var ae,ce,le,se,de,ue,pe=function(e){var n=void 0===e?{}:e,r=n.closeDelay,o=void 0===r?0:r,t=n.openDelay,i=void 0===t?500:t,a=Math.max(o,150),c=l(!1),p=c[0],h=c[1],f=l(null),g=f[0],m=f[1],v=s(null),x=s(null),y=s(!1),b=u(function(e){v.current&&clearTimeout(v.current),x.current&&clearTimeout(x.current),y.current=!1,x.current=setTimeout(function(){h(!0),y.current||m(e)},i)},[i]),w=u(function(){y.current=!0,v.current=setTimeout(function(){h(!1),m(null)},a)},[a]),k=u(function(){v.current&&clearTimeout(v.current)},[]),C=u(function(){y.current=!0,(null==v?void 0:v.current)&&clearTimeout(v.current),v.current=setTimeout(function(){h(!1),m(null)},a)},[]);return d(function(){var e=function(e){e.clientY<=0&&(h(!1),m(null))};return window.addEventListener("mouseleave",e),function(){window.removeEventListener("mouseleave",e)}},[]),{isDropdownVisible:p,hoveredElemIndex:g,handleOnMouseEnter:b,handleOnMouseLeave:w,handleDropdownMouseEnter:k,handleDropdownMouseLeave:C}},he=function(e){var n=s(null);return d(function(){e?function(){if(n.current){var e=n.current.scrollHeight;n.current.style.maxHeight="".concat(e/2,"px"),n.current.style.opacity="0",requestAnimationFrame(function(){n.current&&(n.current.style.transition="max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",n.current.style.maxHeight="".concat(e,"px"),n.current.style.opacity="1")})}}():function(){if(n.current){var e=n.current.scrollHeight;n.current.style.transition="max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",n.current.style.maxHeight="".concat(e/2,"px"),n.current.style.opacity="0",setTimeout(function(){n.current&&(n.current.style.maxHeight="0px")},300)}}()},[e]),{containerRef:n}},fe={transition:"background-color 0.2s ease-in-out","&:hover":{backgroundColor:"#ECF3FF"}},ge={transition:"background-color 0.2s ease-in-out","&:hover":{backgroundColor:"#FBEFEF"}},me=z(ae||(ae=n(["\n from {\n transform: translateX(-20px);\n }\n to {\n transform: translateX(0px);\n }\n"],["\n from {\n transform: translateX(-20px);\n }\n to {\n transform: translateX(0px);\n }\n"]))),ve=z(ce||(ce=n(["\n from {\n transform: translateX(-20.01px);\n }\n to {\n transform: translateX(0px);\n }\n"],["\n from {\n transform: translateX(-20.01px);\n }\n to {\n transform: translateX(0px);\n }\n"]))),xe={display:"flex",backgroundColor:"black",transition:"background-color 200ms ease","flex-direction":"row",justifyContent:"center",width:"20px",height:"20px",overflow:"hidden",borderRadius:"50%"},ye=function(){return o(h,e({className:"bd-arrow-container-js",css:xe},{children:r([],Array(3),!0).map(function(n,r){return o(h,e({className:"bd-arrow-wrapper-js",display:"flex",alignItems:"center"},{children:o(_,{})}),r)})}))},be=V.div.withConfig({displayName:"BusinessDropdown__BDHoverContainer",componentId:"sc-1tsshe4-0"})(le||(le=n(["\n cursor: pointer;\n width: 200px;\n &:hover {\n .bd-arrow-container-js {\n background-color: rgba(255, 79, 23, 1);\n transition: color 200ms ease;\n }\n .bd-arrow-wrapper-js {\n animation: "," 200ms linear;\n display: flex;\n }\n .color-orange-on-hover-js {\n color: rgba(255, 79, 23, 1);\n transition: background-color 200ms ease;\n }\n }\n &:not(:hover) .bd-arrow-wrapper-js {\n animation: "," 200ms linear backwards;\n }\n"],["\n cursor: pointer;\n width: 200px;\n &:hover {\n .bd-arrow-container-js {\n background-color: rgba(255, 79, 23, 1);\n transition: color 200ms ease;\n }\n .bd-arrow-wrapper-js {\n animation: "," 200ms linear;\n display: flex;\n }\n .color-orange-on-hover-js {\n color: rgba(255, 79, 23, 1);\n transition: background-color 200ms ease;\n }\n }\n &:not(:hover) .bd-arrow-wrapper-js {\n animation: "," 200ms linear backwards;\n }\n"])),me,ve),we=function(n){var r=n.isOpen,i=Z(),a=i.isUserLoggedIn,c=i.ravenPushCallback,s=i.ravenPageName,p=i.ravenEventName,g=i.loyaltyType,m=i.ravenPayload,v=void 0===m?{}:m,x=l(0),y=x[0],b=x[1],w=he(r).containerRef;d(function(){var e=function(){if(w.current){var e=(window.innerWidth-(w.current.offsetWidth||0))/2;e!==y&&b(e)}};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[w,y]);var k=u(function(e,n,r){var o,t=null!==(o=ne("utm_source"))&&void 0!==o?o:"organic",i={action_name:r?"".concat(r,"_business_click"):n?"".concat(n.toLowerCase(),"_business_click"):"",action_type:"click",u_utm_source:t,loyalty_type:re(g)};e&&(oe(a,p,i,v,c,s),window.location.href=e)},[a,p,v,c,s,g]);return t(h,e({ref:w,backgroundColor:"#fff",top:"76px",position:"fixed",left:"".concat(y,"px"),borderRadius:24,boxShadow:"0px 8px 24px 0px rgba(26, 26, 26, 0.10)",width:"fit-content",zIndex:1002,css:{overflow:"hidden",opacity:0}},{children:[o(h,e({padding:"20px 24px 20px 24px",backgroundColor:"#FFF1EC"},{children:o(f,e({variant:"HM2"},{children:"Other business services"}))})),o(h,e({display:"flex",flexDirection:"row",padding:"24px",columnGap:"48px",width:"fit-content"},{children:q.map(function(n){var r=n.title,i=n.subtitle,a=n.details,c=n.link,l=n.ravenActionName;return t(be,e({className:"bd-hover-container-js",onClick:function(){return k(c,r,l)}},{children:[t(h,e({display:"flex",flexDirection:"column",rowGap:"4px"},{children:[t(h,e({display:"flex",flexDirection:"row",alignItems:"center",columnGap:"8px"},{children:[o(f,e({variant:"HM2",className:"color-orange-on-hover-js",css:{transition:"color 200ms ease"}},{children:r})),o(ye,{})]})),o(f,e({variant:"B3",css:{marginTop:"4px",opacity:.75}},{children:i}))]})),o(f,e({variant:"P3",color:"subheading",css:{marginTop:"12px"}},{children:a}))]}),r)})}))]}))},ke=[{text:"My Profile",icon:o(E,{width:24,height:24}),redirectionLink:"/accounts/profile"},{text:"My Trips",icon:o(C,{width:24,height:24}),redirectionLink:"/accounts/trips"},{text:"Saved Cards",icon:o(L,{}),redirectionLink:"/accounts/expressway"},{text:"Saved Travellers",icon:o(I,{width:24,height:24}),redirectionLink:"/account/travellers"},{text:"Hi-Five",icon:o(M,{}),redirectionLink:"/accounts/hi-five?src=fh"},{text:"Wallet",icon:o(D,{width:24,height:24}),redirectionLink:"/accounts/wallet"},{text:"Settings",icon:o(T,{width:24,height:24}),redirectionLink:"/account/settings"},{text:"Privacy Rights",icon:o(N,{}),redirectionLink:"accounts/personal-data-dashboard"}],Ce="Logout",Fe="My Account",_e="You are logged in with",Ee="header-acc-btn",Le="account-options",Ie=function(n){var r=n.icon,i=n.borderGradient,a=n.backgroundGradient,c=n.handleChipClick,s=n.chevronFillColor,d=Z(),p=d.loyaltyType,f=d.isUserLoggedIn,g=d.ravenPushCallback,m=d.ravenPageName,v=d.ravenPayload,x=void 0===v?{}:v,y=d.ravenEventName,b=l(!1),w=b[0],k=b[1],C=u(function(){var e;if(c)c();else{var n={action_name:"loyalty_account_click",action_type:"click",u_utm_source:null!==(e=ne("utm_source"))&&void 0!==e?e:"organic",loyaltyType:re(p)};oe(f,y,n,x,g,m),window.location.href="/all-offers/loyalty-october"}},[c,p,f,y,x,g,m]);return t(h,e({display:"flex",position:"relative",alignItems:"center",justifyContent:"center",borderRadius:"8px",cursor:"pointer",paddingLeft:"8px",paddingRight:w?"4px":"8px",css:{overflow:"hidden",height:32,paddingLeft:8,transition:"padding-right 0.2s ease-in-out"},onMouseEnter:function(){return k(!0)},onMouseLeave:function(){return k(!1)},onClick:C},{children:[o(h,{css:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",background:a,zIndex:-2}}),o(h,{css:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",padding:"1px",background:i,WebkitMask:"linear-gradient(white, white) content-box, linear-gradient(white, white)",WebkitMaskComposite:"destination-out",maskComposite:"exclude",zIndex:-1}}),o(h,e({display:"flex",alignItems:"center",position:"relative"},{children:r})),o(h,e({display:"flex",alignItems:"center",css:{overflow:"hidden",maxWidth:w?16:0,transition:"max-width 0.2s ease-in-out, opacity 0.2s ease-in-out",opacity:w?.5:0}},{children:o(A,{color:s})}))]}))};!function(e){e.FLIGHTS="Flights",e.HOTELS="Hotels",e.BUSES="Buses",e.TRAINS="Trains",e.HOLIDAYS="Holidays"}(se||(se={})),function(e){e.FkVip="FkVip",e.FkPremium="FkPremium",e.InsiderIcon="InsiderIcon",e.InsiderElite="InsiderElite",e.CtLoyalty="CtLoyalty"}(de||(de={}));var Me=((ue={})[de.FkVip]={icon:o(P,{}),borderGradient:"linear-gradient(217.07deg, #0B182A 19.65%, #434E57 54.8%, #595952 89.95%)",backgroundGradient:"linear-gradient(217.07deg, #0B182A 19.65%, #434E57 54.8%, #595952 89.95%)",chevronFillColor:"#FFF"},ue[de.FkPremium]={icon:o(B,{}),borderGradient:"linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)",backgroundGradient:"#191717",chevronFillColor:"#FFF"},ue[de.InsiderIcon]={icon:o(H,{}),borderGradient:"linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)",backgroundGradient:"linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)",chevronFillColor:"#FFF"},ue[de.InsiderElite]={icon:o(R,{}),borderGradient:"linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)",backgroundGradient:"linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)",chevronFillColor:"#FFF"},ue[de.CtLoyalty]={icon:o(G,{}),borderGradient:"linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)",backgroundGradient:"linear-gradient(110.82deg, #FFF9EC 0%, #FEE3A8 100%)",chevronFillColor:"#1A1A1A"},ue),De=function(n){var r=n.icon,i=n.handleChipClick,a=n.value,c=n.type,s=Z(),d=s.loyaltyType,p=s.isUserLoggedIn,g=s.ravenPushCallback,m=s.ravenPageName,v=s.ravenEventName,x=s.ravenPayload,y=void 0===x?{}:x,b=l(!1),w=b[0],k=b[1],C=u(function(){var e;if(i)i();else{var n=null!==(e=ne("utm_source"))&&void 0!==e?e:"organic",r={action_name:"".concat(c,"_account_click"),action_type:"click",u_utm_source:n,loyaltyType:re(d)};oe(p,v,r,y,g,m);var o={supercoin:"/all-offers/supercoins/",wallet:"/accounts/wallet"};o[c]&&(window.location.href=o[c])}},[i,c,d,p,v,y,g,m]);return t(h,e({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px",cursor:"pointer",css:{height:32,paddingLeft:8,paddingRight:w?4:8,transition:"padding-right 0.2s ease-in-out",background:w?"#ffd7ca":"#ffe6df"},onMouseEnter:function(){return k(!0)},onMouseLeave:function(){return k(!1)},onClick:C},{children:[t(h,e({display:"flex",alignItems:"center",css:{gap:"4px"}},{children:[r,o(f,e({variant:"B3",isClickable:!0},{children:a}))]})),o(h,e({display:"flex",alignItems:"center",css:{overflow:"hidden",maxWidth:w?16:0,transition:"max-width 0.2s ease-in-out, opacity 0.2s ease-in-out",opacity:w?1:0}},{children:o(A,{})}))]}))},Te=function(){var n,r=Z(),i=r.loyaltyType,a=r.fkSupercoinBurnBalance,c=void 0===a?0:a,l=r.walletBalance,s=void 0===l?0:l,d=r.loyaltyLoading,u=r.superCoinsLoading,p=r.walletLoading,f=r.walletChipClick,g=r.supercoinsChipClick,m=r.loyaltyChipClick,v=r.hideWalletChip,x=r.hideSupercoinsChip,y=r.hideLoyaltyChip;return d||i&&Me[i]&&!y||(u||!x)||(p||!v)?t(h,e({display:"flex",padding:"0 16px 16px 16px",justifyContent:"flex-start",css:{alignSelf:"stretch",gap:"4px"}},{children:[d?o(h,{width:"50px",height:"32px",borderRadius:"8px",backgroundColor:"#efefef"}):i&&Me[i]&&!y&&o(Ie,{icon:Me[i].icon,borderGradient:Me[i].borderGradient,backgroundGradient:Me[i].backgroundGradient,chevronFillColor:(null===(n=Me[i])||void 0===n?void 0:n.chevronFillColor)||"#FFF",handleChipClick:m}),u?o(h,{width:"50px",height:"32px",borderRadius:"8px",backgroundColor:"#efefef"}):!x&&o(De,{icon:o(O,{width:20,height:20}),value:c,handleChipClick:g,type:"supercoin"}),p?o(h,{width:"50px",height:"32px",borderRadius:"8px",backgroundColor:"#efefef"}):!v&&o(De,{icon:o(D,{width:20,height:20}),value:s,handleChipClick:f,type:"wallet"})]})):null},Ne=function(n){var r=n.isOpen,a=Z(),c=a.handleLogoutClick,l=a.userName,s=a.userMobileNumber,g=a.countryCode,m=a.userDetailsLoading,v=a.loyaltyType,x=a.isUserLoggedIn,b=a.ravenEventName,w=a.ravenPageName,k=a.ravenPayload,C=void 0===k?{}:k,F=a.ravenPushCallback,_=he(r).containerRef,E=p(function(){return{userGreeting:l?"Hello ".concat(l,"!"):"",phoneNumber:g&&s?"".concat(g," ").concat(s):""}},[l,s,g]),L=E.userGreeting,I=E.phoneNumber,M=function(e){var n;return{action_name:e.toLowerCase().replace(/[\s-]/g,"")+"_account_click",action_type:"click",u_utm_source:null!==(n=ne("utm_source"))&&void 0!==n?n:"organic",loyalty_type:re(v)}},D=u(function(e,n){oe(x,b,M(e),C,F,w),window.location.href=n},[x,b,C,F,w]);u(function(){oe(x,b,M(Ce),C,F,w),c()},[x,b,C,F,w,c]);var T=u(function(){var e=document.getElementById(Ee),n=document.getElementById(Le);if(e&&n){var r=e.getBoundingClientRect().right;n.style.left="".concat(r-328,"px")}},[]);d(function(){T()},[T]);var N;return t(h,e({id:Le,ref:_,display:"flex",flexDirection:"column",borderRadius:"16px",zIndex:1002,top:"76px",position:"fixed",css:{opacity:0,overflow:"hidden"},width:"".concat(328,"px"),background:"#FFF1EC"},{children:[o(h,e({padding:"16px",height:"76px"},{children:(N=function(n,r,t,i){return o(f,e({variant:t,color:i},{children:n?o(h,{height:"HM3"===t?"18px":"12px",width:"HM3"===t?"140px":"200px",backgroundColor:"#efefef",borderRadius:"8px"}):r}))},o(h,e({display:"flex",flexDirection:"column",css:{gap:"4px"}},{children:t(i,L?{children:[N(m,L,"HM3","primary"),N(m,"".concat(_e," ").concat(I),"P3","subheading")]}:{children:[N(m,_e,"P3","subheading"),N(m,I,"HM3","primary")]})})))})),o(Te,{}),t(h,e({display:"flex",flexDirection:"column",padding:"8px",backgroundColor:"white",rowGap:"8px",css:{borderBottomLeftRadius:12,borderBottomRightRadius:12}},{children:[ke.map(function(n){var r=n.text,i=n.icon,a=n.redirectionLink;return o(h,e({padding:"8px",borderRadius:"8px",cursor:"pointer",onClick:function(){return D(r,a)},css:fe},{children:t(h,e({display:"flex",cursor:"pointer",css:{columnGap:"8px"}},{children:[i,o(f,e({variant:"P1",css:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:r}))]}))}),"account-option-".concat(r))}),o(y,{css:{borderBottom:"1px dashed #E6E6E6"}}),t(h,e({display:"flex",padding:"8px",borderRadius:"8px",cursor:"pointer",columnGap:"8px",onClick:c,css:ge},{children:[o(j,{height:24,width:24}),o(f,e({variant:"P1",css:{display:"flex",alignItems:"center",cursor:"pointer"},color:"warning"},{children:Ce}))]}))]}))]}))},Ae=function(){var n=Z(),r=n.isNovacThemeEnabled,i=n.ravenEventName,a=n.ravenPayload,c=void 0===a?{}:a,s=n.ravenPushCallback,p=n.isUserLoggedIn,g=n.loyaltyType,m=n.ravenPageName,v=pe({openDelay:0}),x=v.isDropdownVisible,y=v.handleOnMouseEnter,b=v.handleOnMouseLeave,w=v.handleDropdownMouseEnter,C=v.handleDropdownMouseLeave,F=l(!1),_=F[0],L=F[1];d(function(){var e=function(){L(window.scrollY>=50)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}},[]);var I=r&&!_?J.NOVAC:J.DEFAULT,M=I.hoverColor,D=I.typographyColor,T=u(function(){var e,n=null!==(e=ne("utm_source"))&&void 0!==e?e:"organic",r={action_name:"".concat(Fe.toLowerCase().replace(/[\s-]/g,""),"_header_hover"),action_type:"hover",u_utm_source:n,loyalty_type:re(g)};oe(p,i,r,c,s,m)},[p,i,c,s,m,g]);return t(h,{children:[t(h,e({display:"flex",padding:"8px 12px",alignItems:"center",borderRadius:"12px",height:"100%",cursor:"pointer",css:{columnGap:8,height:64},onMouseEnter:function(){y(0),T()},onMouseLeave:b,id:Ee},{children:[o(E,{color:x?M:D}),t(h,e({display:"flex",flexDirection:"row",alignItems:"center"},{children:[o(f,e({variant:"B2",css:{cursor:"pointer"},colorCode:x?M:D},{children:Fe})),o(k,{width:20,height:20,fill:x?M:D})]}))]})),o(ie,e({show:x,marginTop:"64px",handleDropdownMouseEnter:w,handleDropdownMouseLeave:C,onMaskClick:C},{children:o(Ne,{isOpen:x})}))]})},Pe=function(n){return o($,e({value:n},{children:o(Be,{})}))},Be=function(){var n,r=Z(),a=r.onLoginButtonClick,c=r.showAllLobs,s=void 0!==c&&c,p=r.isUserLoggedIn,g=r.loyaltyType,m=r.isNovacThemeEnabled,b=void 0!==m&&m,w=r.ravenPayload,k=void 0===w?{}:w,C=r.ravenPushCallback,F=r.ravenPageName,_=r.ravenEventName,E=l(!1),L=E[0],I=E[1];d(function(){var e=function(){I(window.scrollY>=50)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}},[]);var M,D=b&&!L?J.NOVAC:J.DEFAULT,T=D.headerBackground,N=D.logoFill,A=D.loginButtonColorVariant,P=D.hoverColor,B=D.fkcompanyColor,H=D.typographyColor,R=pe({openDelay:0}),G=R.isDropdownVisible,O=R.hoveredElemIndex,j=R.handleOnMouseEnter,V=R.handleOnMouseLeave,z=R.handleDropdownMouseEnter,W=R.handleDropdownMouseLeave,X=null!==(n=ne("utm_source"))&&void 0!==n?n:"organic",K=u(function(e,n){return{action_name:e,action_type:n,u_utm_source:X,loyalty_type:re(g)}},[X,g]),q=u(function(e){if(e.isClickable&&e.link){var n="".concat(e.text.toLowerCase().replace(/\s/g,""),"_header_click"),r=K(n,"click");oe(p,_,r,k,C,F),window.location.href=e.link}},[K,p,_,k,C,F]),Q=u(function(){var e=K("home_header_click","click");oe(p,_,e,k,C,F),window.location.href="/"},[K,p,_,k,C,F]),$=u(function(e){var n="".concat(e.text.toLowerCase().replace(/\s/g,""),"_header_hover"),r=K(n,"hover");oe(p,_,r,k,C,F)},[K,p,_,k,C,F]);return t(i,{children:[o(h,e({display:"flex",top:0,position:"sticky",width:"100%",alignItems:"center",justifyContent:"center",zIndex:1e3,height:"64px",background:T,css:{gap:"24px",flexShrink:0,borderBottom:"transparent"===T?"":"1px solid #E6E6E6",transition:"background-color 0.3s ease-in-out, border-bottom 0.3s ease-in-out"}},{children:t(h,e({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 28px",flex:1,css:{gap:"24px",maxWidth:1440}},{children:[t(h,e({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",cursor:"pointer",onClick:Q},{children:[o(S,{fillColor:N}),o(y,{css:{width:12,marginLeft:2,marginRight:2,transform:"rotate(90deg)",borderBottom:"1px solid #e0e0e0"}}),o(U,{color:B})]})),t(h,e({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",columnGap:"24px"},{children:[o(h,e({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",columnGap:"4px"},{children:Y.map(function(n,r){var i=n.text,a=n.lefticon,c=n.rightIcon,l=n.isHoverable,s=O===r;return t(h,{children:[t(h,e({onMouseEnter:function(){j(r),n.isHoverable&&$(n)},onMouseLeave:V,display:"flex",flexDirection:"row",alignItems:"center",padding:"8px 12px 8px 12px",cursor:"pointer",position:"relative",columnGap:8,height:"64px",onClick:function(){return q(n)}},{children:[o(a,{color:s?P:H}),t(h,e({display:"flex",flexDirection:"row",alignItems:"center"},{children:[o(f,e({variant:"B2",colorCode:s?P:H,isClickable:!0},{children:i})),c&&o(c,{width:20,height:20,fill:s?P:H})]}))]}),"nav-option-".concat(r)),o(ie,e({show:O===r&&l&&G,marginTop:"64px",handleDropdownMouseEnter:z,handleDropdownMouseLeave:W,onMaskClick:W},{children:o(we,{isOpen:O===r&&l&&G})}))]})})})),p&&o(y,{css:{width:12,margin:"0 -18px",transform:"rotate(90deg)",borderBottom:"1px solid #e0e0e0"}}),o(h,{children:p?o(h,e({display:"flex",flexDirection:"row",alignItems:"center"},{children:o(Ae,{})})):o(v,e({onClick:a,css:e({width:153,height:40},(M="transparent"===T,M?{backgroundColor:"transparent !important","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.25)!important"}}:{backgroundColor:"transparent !important","&:hover":{backgroundColor:"#F3F3F3 !important"}})),loading:!1,color:A,variant:x.OUTLINE},{children:"Log in"}))})]}))]}))})),s&&o(te,{})]})};export{Pe as Header,se as LOBS_VALUES,de as LoyaltyType,W as RAVEN_PAGE_NAMES};
|
|
2
2
|
//# sourceMappingURL=ct-design-header.browser.esm.js.map
|
|
@@ -49,7 +49,7 @@ var LOBS = {
|
|
|
49
49
|
FLIGHTS: 'Flights',
|
|
50
50
|
HOTELS: 'Hotels',
|
|
51
51
|
TRAIN: 'Trains',
|
|
52
|
-
|
|
52
|
+
HOLIDAYS: 'Holidays',
|
|
53
53
|
BUSES: 'Buses'
|
|
54
54
|
};
|
|
55
55
|
var LOB_DATA = [{
|
|
@@ -65,7 +65,7 @@ var LOB_DATA = [{
|
|
|
65
65
|
image: 'https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Buses.png?cache=true',
|
|
66
66
|
link: '/bus'
|
|
67
67
|
}, {
|
|
68
|
-
title: LOBS.
|
|
68
|
+
title: LOBS.HOLIDAYS,
|
|
69
69
|
image: 'https://rukmini-ct.flixcart.com/f_auto,w_32,h_32,dpr_4/offermgmt-prod/offermgmt/images/banner/Navbar_Packages.png?cache=true',
|
|
70
70
|
link: '/holidays'
|
|
71
71
|
}];
|
|
@@ -838,7 +838,7 @@ exports.LOBS_VALUES = void 0;
|
|
|
838
838
|
LOBS_VALUES["HOTELS"] = "Hotels";
|
|
839
839
|
LOBS_VALUES["BUSES"] = "Buses";
|
|
840
840
|
LOBS_VALUES["TRAINS"] = "Trains";
|
|
841
|
-
LOBS_VALUES["
|
|
841
|
+
LOBS_VALUES["HOLIDAYS"] = "Holidays";
|
|
842
842
|
})(exports.LOBS_VALUES || (exports.LOBS_VALUES = {}));
|
|
843
843
|
|
|
844
844
|
exports.LoyaltyType = void 0;
|