PageSourceSearch

https://app.flowtheroom.com/_next/static/chunks/8837.d4964cad5ec38cd1.js

js flowtheroom.com collected 2026-09-25 09:51:28 UTC 79,085 bytes, 1 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="afb09aff-e872-4d24-85ca-1bae7e6f87ef",e._sentryDebugIdIdentifier="sentry-dbid-afb09aff-e872-4d24-85ca-1bae7e6f87ef")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8837],{81856:function(e,t,r){r.d(t,{Z:function(){return i}});var n=r(57437),a=r(11210);r(2265);let s=(0,a.default)(()=>Promise.all([r.e(5272),r.e(6915),r.e(2232),r.e(3675),r.e(1052),r.e(6115),r.e(1203),r.e(6152),r.e(8147)]).then(r.bind(r,98147)),{loadableGenerated:{webpack:()=>[98147]},ssr:!1});function i(e){return e.isOpen?(0,n.jsx)(s,{...e}):null}},35300:function(e,t,r){r.d(t,{x:function(){return a}});var n=r(57437);r(2265);let a=e=>{let{className:t,...r}=e;return(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,...r,children:(0,n.jsx)("path",{d:"M9.33333 4.66663H10.6667C12.5076 4.66663 14 6.15901 14 7.99996C14 9.84091 12.5076 11.3333 10.6667 11.3333H9.33333M6.66667 4.66663H5.33333C3.49238 4.66663 2 6.15901 2 7.99996C2 9.84091 3.49238 11.3333 5.33333 11.3333H6.66667M5.33333 7.99996H10.6667",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}},29327:function(e,t,r){r.d(t,{HL:function(){return n},U2:function(){return i},_H:function(){return s},g$:function(){return a}});let n={DUPLICATE_BOOKING_CONTINUE:"duplicate_booking_continue",RESV_TERMS_CONTINUE:"resv_terms_continue",RESV_TERMS_REJECT:"resv_terms_reject",FLOW_DOLLAR_TOP_UP:"flow_dollar_top_up",REFUND_BOOKING:"refund_booking",NON_FLOW_DOLLAR_CHECKOUT:"non_flow_dollar_checkout",PREVIOUS_PAGE:"previous_page",LOGIN_POP_UP:"login_pop_up",HOME_PAGE:"home_page",PW_LENGTH_SUPPORT:"pw_length_support",BACK_TO_CHECKOUT:"back_to_checkout",BACK_TO_DETAILS:"back_to_details"},a="flow-dollar-topped-up",s={CANCEL:"cancel"},i={GENERIC:"GENERIC",HTML:"HTML",LOADING:"LOADING"}},81156:function(e,t,r){r.r(t),r.d(t,{default:function(){return eH}});var n=r(57437),a=r(11362),s=r(30490),i=r(72301),l=r(38778),o=r(2265),c=r(12577),u=r(32950),d=r(6473),w=r(48473),m=r(45714),p=r(9698),h=r(97352),g=r(75282),f=r(1734),x=r(41919),v=r(39540),b=r(53899),y=r(39399),_=r(67512),j=r(98558),N=r(3113),k=r(81856),S=r(46542),T=r(6557),C=r(37054),R=r(38167),I=r(26141),E=r(72418);function L(e){let{suggestions:t,isAutoCompleteActive:r,onIndexChange:a,className:i}=e,l=(0,s.T)(),c=(0,o.useRef)(0),[u,d]=(0,o.useState)(0),w=(0,o.useRef)(null);return(0,o.useEffect)(()=>{let e;return r||(e=setInterval(async()=>{w.current?.classList?.remove("text-in","text-out"),w.current?.classList?.add("text-in"),setTimeout(()=>{w.current?.classList?.add("text-out")},4300),c.current===t.length-1?c.current=0:c.current=c.current+1,d(c.current),a&&a(t[c.current])},5e3)),()=>clearInterval(e)},[t,r]),r?(0,n.jsx)("span",{className:`tw-pointer-events-none tw-text-sm tw-py-2 tw-px-0 tw-text-body tw-placeholder-body ${i}`,children:l("search_bar.next_destination")}):(0,n.jsx)("span",{ref:w,className:`tw-pointer-events-none tw-text-sm tw-py-2 tw-px-0 tw-text-body tw-placeholder-body ${i}`,children:t?.[u]?.query})}var M=r(59864),O=r(35916),A=r(64021),P=r(42184),D=r(25429),B=r(42490),F=r(96623),G=r(53702);function U(e){let{remoteTime:t,swiperType:r=b.FR.FULL,isMapSearch:l=!1,className:c="",isAutoSearch:u=!0,type:d,isCenterModal:p=!1,showLabel:U=!1}=e,H=(0,s.T)(),{region:$,lang:V}=(0,i.useParams)(),Z=(0,i.useRouter)(),[K,W]=(0,o.useState)(!1),[Y,q]=(0,o.useState)(!1),z=(0,o.useRef)(!1),X=(0,o.useRef)(!1),J=(0,o.useRef)(null),Q=(0,o.useRef)(null),[ee]=(0,a.KO)(x.xR),[et]=(0,a.KO)(y.ll),[er,en]=(0,a.KO)(x.YV),ea=(0,a.b9)(y.AM),[es]=(0,a.KO)(x.G2),[ei]=(0,a.KO)(x.mN),[el]=(0,a.KO)(y.Ee),[eo]=(0,a.KO)(x.mv),[ec]=(0,a.KO)(y.bX),[eu]=(0,a.KO)(x.Gr),[ed]=(0,a.KO)(y.X7),[ew]=(0,a.KO)(y.tM),em=(0,I.Er)(M.FW.LOCATION_GROUP),{data:ep,error:eh}=(0,w.n)({region:$,lang:V,spaceType:l?et:ee,locationGroup:em&&"my"===$?em:void 0,priceMode:er?.priceMode}),{data:eg}=(0,m._)({region:$,spaceTypeKey:(0,v.Hg)((0,v.wJ)(ee)),suggestionIDs:ep?.placeholder?.animated}),[ef,ex,ev,eb,ey]=[N.cB.PRICE_RANGE,N.cB.STAR_RATING,N.cB.THEME,N.cB.PAYMENT_OPTION,N.cB.AMENITIES].map(e=>ep?.filtering?.find(t=>t.key===e)),e_=()=>{er?.priceMode&&G.Z.setItem(M.Jr.PRICE_MODE,er?.priceMode),Z.push(`/${$}/${V}/${(0,v.wJ)(ee)}`)},ej=(0,o.useMemo)(()=>{let e=l?el:ei;return(0,j.AH)(e,$,V,t.timestamp,{today:H("date.today"),tomorrow:H("date.tomorrow")})},[l,el,$,ei,V,H,t.timestamp]),eN=(0,o.useMemo)(()=>{let e=l?el:ei;return(0,j.WV)(e,$,V,t.timestamp,{today:H("date.today"),tomorrow:H("date.tomorrow")})},[l,el,ei,$,V,H,t.timestamp]),ek=(0,o.useMemo)(()=>{let e=l?ec:eo,t=J.current,r=p&&K&&t?t:e;return r?.text||H("search_bar.any_time")},[p,K,l,ec,eo,H]),eS=(0,o.useCallback)(()=>{W(!0),z.current=!1,X.current=!1,J.current=l?ec:eo,Q.current=l?ed:eu;let e={},r=(0,_.tg)(t.timestamp,$),n=N.OL.find(e=>e.value===N.TI.ANY_CHECK_IN_TIME),a={text:n.text[(0,I.VD)($,V)],periodType:n.value,value:n.value};ei||(e.date=r),0===eo.value.length&&(e.time=a),Object.keys(e).length>0&&en(e)},[en,$,V,t.timestamp,ei,eo,el,ec,ed,eu,l]),eT=(0,o.useCallback)(()=>{z.current=!0,l?ea({isImmediateSearch:!0}):en({isImmediateSearch:!0})}
1,[l,en,ea]),eC=(0,o.useCallback)(()=>{z.current=!0,l?ea({isImmediateSearch:!0}):en({isImmediateSearch:!0}),W(!1)},[l,en,ea]),eR=(0,o.useCallback)(()=>{X.current||(X.current=!0,W(!1),p&&!z.current&&(l?ea({time:J.current,duration:Q.current}):en({time:J.current,duration:Q.current})),z.current=!1)},[p,l,en,ea]),eI=(0,o.useMemo)(()=>r===b.FR.DATE?H("search_bar.date"):r===b.FR.TIME?H("search_bar.check_in_time"):r===b.FR.DURATION?H("search_bar.durations"):void 0,[r,H]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("div",{className:`${c}`,children:(0,n.jsxs)("div",{className:"tw-flex tw-items-center",children:[(0,n.jsxs)("div",{onClick:eS,className:"tw-w-full tw-cursor-pointer active:tw-opacity-75",children:[r===b.FR.FULL&&(0,n.jsxs)("div",{className:"tw-flex tw-items-center tw-bg-white-ground dark:tw-bg-[#2E3033] search-bar-shadow lg:tw-px-4 tw-rounded-full tw-w-full tw-h-[40px] lg:tw-border lg:tw-border-grey lg:tw-h-[55px] tw-pl-4 tw-pr-2",children:[" ",(0,n.jsxs)("div",{className:"tw-text-xs tw-text-body tw-text-left tw-w-full tw-line-clamp-1",children:[!es&&!ej&&!ek&&(eg?.length?(0,n.jsx)(L,{suggestions:eg,className:"tw-px-0"},ee):(0,n.jsx)("span",{children:ep?.placeholder?.home_search_bar})),es&&(0,n.jsx)("span",{children:es}),!es&&ej&&ek&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:es?"tw-ml-2":"",children:ej}),(0,n.jsx)("span",{className:"tw-ml-2",children:ek})]})]}),(0,n.jsx)(T.Z,{isMapSearch:l,handleSearchClicked:e_})]}),r===b.FR.DATE&&!U&&(0,n.jsxs)("div",{className:"tw-flex tw-items-center tw-rounded-full",children:[(0,n.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",stroke:"currentColor",strokeWidth:"2"}),(0,n.jsx)("path",{d:"M16 2V6M8 2V6M3 10H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),(0,n.jsx)("p",{className:"tw-text-xs tw-ml-2",children:(l?el:ei)||H("date.today")})]}),r===b.FR.DATE&&U&&(0,n.jsxs)("div",{className:"tw-flex tw-flex-col tw-items-start",children:[(0,n.jsx)("p",{className:"tw-text-[12px] tw-font-medium tw-leading-4 tw-text-info",children:H("search_bar.date")}),(0,n.jsx)("p",{className:"tw-whitespace-nowrap tw-text-[14px] tw-leading-[18px] tw-font-medium tw-text-[var(--themes-text-title)]",children:eN||H("date.today")})]}),r===b.FR.TIME&&(0,n.jsxs)("div",{className:"tw-flex tw-items-center tw-rounded-full",children:[(0,n.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{d:"M14 3H4v18h10V3zM14 3l6 3v12l-6 3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.jsx)("circle",{cx:"17",cy:"12",r:"1",fill:"currentColor"})]}),(0,n.jsx)("p",{className:"tw-text-xs tw-ml-2",children:ek})]}),r===b.FR.DURATION&&(0,n.jsxs)("div",{className:"tw-flex tw-items-center tw-rounded-full",children:[(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 13.5 13.5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M6.75 3.41667V6.75L8.41667 7.75M12.75 6.75C12.75 10.0637 10.0637 12.75 6.75 12.75C3.43629 12.75 0.75 10.0637 0.75 6.75C0.75 3.43629 3.43629 0.75 6.75 0.75C10.0637 0.75 12.75 3.43629 12.75 6.75Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,n.jsx)("p",{className:"tw-text-xs tw-ml-2",children:(()=>{let e=l?ed:eu,t=Q.current,r=p&&K&&"number"==typeof t?t:e;return r?`${(0,F.B)(r)}+`:H("search_bar.no_pref_duration")})()})]})]}),(0,n.jsx)(k.Z,{isOpen:K,isHighPriority:ew,isConfirmBtnCloseModal:!1,onClose:eR,onButtonClose:eR,isCenterModal:p,modalTitle:eI,hideHeaderBorder:p&&r===b.FR.DATE,centerModalConfirmTitle:p&&r!==b.FR.DATE?H("search_bar.save_and_continue"):void 0,handleConfirm:p&&r!==b.FR.DATE?eT:e_,content:(0,n.jsx)("div",{className:"tw-flex tw-flex-col tw-items-center tw-w-full",children:(0,n.jsxs)("div",{className:"tw-w-full",children:[(0,n.jsxs)("div",{className:`lg:tw-grid ${l?"lg:tw-grid-cols-1":"lg:tw-grid-cols-2 lg:tw-gap-8"}`,children:[(0,n.jsxs)("div",{children:[r===b.FR.FULL&&(0,n.jsx)(h.Z,{searchOptions:ep,handleDisableSearch:e=>{q(e)},type:d}),(r===b.FR.FULL||r===b.FR.DATE)&&(0,n.jsxs)("div",{children:[!(p&&r===b.FR.DATE)&&(0,n.jsx)(E.Z,{hideTitle:p,title:H("search_bar.date"),option:ej}),(0,n.jsx)(g.default,{remoteTime:t,searchOptions:ep,isMapSearch:l,type:d,section:"SEARCH_RESULT_BAR",className:"tw-mt-2",defaultShowCalendar:p,onDateSelected:p&&r===b.FR.DATE?eC:void 0})]})]}),(r===b.FR.FULL||r===b.FR.TIME)&&(0,n.jsx)(f.Z,{remoteTime:t,swiperType:r,isMapSearch:l,className:"tw-my-2 lg:tw-my-5",type:d,section:"SEARCH_RESULT_BAR",hideTitle:p,deferSearch:p}),r===b.FR.DURATION&&(0,n.jsx)(R.Z,{isMapSearch:l,isShowDivider:!1,className:"tw-w-full",hideTitle:p,deferSearch:p})]}),r===b.FR.FULL&&(0,n.jsxs)("div",{className:"tw-w-full tw-mt-4",children:[(0,n.jsx)("p",{className:"typography-body-1",children:H("search_bar.filter_search_results")}),(0,n.jsxs)("div",{className:"lg:tw-grid lg:tw-grid-cols-2 lg:tw-gap-8",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(O.Z,{priceRangeFilter:ef,isMapSearch:l,type:d}),(0,n.jsx)(P.Z,{themeFilter:ev,isMapSearch:l,type:d})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(A.Z,{starRatingFilter:ex,isMapSearch:l,type:d}),(0,n.jsx)(D.Z,{paymentOptionFilter:eb,isMapSearch:l,type:d}),(0,n.jsx)(B.Z,{amenitiesFilter:ey,isMapSearch:l,type:d})]})]})]})]})}),anchorType:"bottom",customDesktopStyle:l?S.aE:S.jp,confirmButtonTitle:!u&&H("search_bar.search_now"),sourceParams:{page:"HOME",section:"SEARCH_RESULT_BAR"},isDisableConfirmBtn:Y}),r===b.FR.FULL&&(0,n.jsxs)("div",{className:"tw-ml-2 tw-bg-black-ground lg:tw-bg-white dark:tw-bg-[#2E3033] tw-rounded-full",children:[" ",(0,n.jsx)("button",{onClick:()=>{let e={},r=(0,_.tg)(t.timestamp,$),n=N.OL.find(e=>e.value===N.TI.ANY_CHECK_IN_TIME),a={text:n.text[(0,I.VD)($,V)],periodType:n.value,value:n.value};el||(e.date=r),0===ec.value.length&&(e.time=a),ea({...e,isMapOpen:!0}),(0,C.D$)({page:"HOME",name:"MAP_PILL_BUTTON"})},"aria-label":"open map",className:"btn-outline-rounded tw-border-grey lg:tw-w-[55px] lg:tw-h-[55px] search-bar-shadow tw-flex tw-items-center tw-justify-center tw-bg-transparent tw-cursor-pointer",children:(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{color:"var(--color-grey-hex)"},children:(0,n.jsx)("path",{d:"M9 20L3.553 17.276A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]})})})}function H(e){let{page:t,isShowOvernight:r,dispatch:n}=e;return(0,o.useCallback)(()=>{let e=!r;(0,C.Oo)({page:t,isOvernight:e}),n({isShowOvernight:e,isImmediateSearch:!0})},[n,r,t])}let $=()=>(0,n.jsx)("div",{className:"tw-w-1 tw-h-1 tw-bg-red-500 tw-rounded-full tw-absolute tw-right-[10px] tw-top-[9px]"});function V(e){let{searchOptions:t,isMapSearch:r=!1,type:i,chipStyle:l=!1}=e,c=(0,s.T)(),[u,d]=(0,o.useState)(!1),[,w]=(0,o.useTransition)(),m=(0,o.useRef)(!1),p=(0,o.useRef)(null),[h]=(0,a.KO)(y.Uz),g=(0,a.b9)(y.AM),f=(0,a.b9)(x.Y
1V),v=(0,a.Dv)(x.CI),b=(0,a.Dv)(x.Ys),_=(0,a.Dv)(x.AG),j=(0,a.Dv)(x.x2),T=(0,a.Dv)(x.d),C=(0,a.Dv)(y.VJ),R=(0,a.Dv)(y.Ds),I=(0,a.Dv)(y.QG),E=(0,a.Dv)(y.Td),L=(0,a.Dv)(y.eS),[M,F,G,U,V]=[N.cB.PRICE_RANGE,N.cB.STAR_RATING,N.cB.THEME,N.cB.PAYMENT_OPTION,N.cB.AMENITIES].map(e=>t?.filtering?.find(t=>t.key===e)),Z=(0,o.useMemo)(()=>v||b?.length!==0||_||j?.length!==0||T?.length!==0,[v,b,_,j,T]),K=(0,o.useMemo)(()=>C||R?.length!==0||I||E?.length!==0||L?.length!==0,[C,R,I,E,L]),W=(0,o.useCallback)(()=>{m.current=!1,p.current={priceRange:v,starRating:b,theme:_,paymentOption:j,amenities:T},w(()=>d(!0))},[v,b,_,j,T]),Y=(0,o.useCallback)(()=>{m.current=!0,f({isImmediateSearch:!0})},[f]),q=(0,o.useCallback)(()=>{f({priceRange:void 0,starRating:[],theme:"",paymentOption:[],amenities:[]})},[f]),z=(0,o.useCallback)(()=>{l&&!m.current&&p.current&&f({priceRange:p.current.priceRange,starRating:p.current.starRating,theme:p.current.theme,paymentOption:p.current.paymentOption,amenities:p.current.amenities}),d(!1)},[l,f]),X=H({page:i,isShowOvernight:h,dispatch:g});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"tw-relative",children:[(0,n.jsxs)("button",{"aria-label":"open filter options",className:l?"tw-flex tw-items-center tw-gap-2 tw-bg-white hover:tw-bg-flow-hover active:tw-scale-[0.97] tw-transition tw-duration-150 tw-border-[1.5px] tw-border-solid tw-border-light tw-rounded-full tw-h-[40px] tw-px-4 tw-cursor-pointer tw-text-body-strong tw-whitespace-nowrap tw-shrink-0":"tw-ml-2 btn-outline-rounded tw-border-[#474D57] tw-w-[40px] tw-h-[40px] tw-flex tw-items-center tw-justify-center tw-bg-transparent tw-cursor-pointer",onClick:W,children:[(0,n.jsxs)("svg",{width:l?16:20,height:l?16:20,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:l?void 0:{color:"var(--color-white-ground-hex)"},children:[(0,n.jsx)("line",{x1:"21",x2:"14",y1:"4",y2:"4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,n.jsx)("line",{x1:"10",x2:"3",y1:"4",y2:"4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,n.jsx)("line",{x1:"21",x2:"12",y1:"12",y2:"12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,n.jsx)("line",{x1:"8",x2:"3",y1:"12",y2:"12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,n.jsx)("line",{x1:"21",x2:"16",y1:"20",y2:"20",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,n.jsx)("line",{x1:"12",x2:"3",y1:"20",y2:"20",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,n.jsx)("line",{x1:"14",x2:"14",y1:"2",y2:"6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,n.jsx)("line",{x1:"8",x2:"8",y1:"10",y2:"14",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,n.jsx)("line",{x1:"16",x2:"16",y1:"18",y2:"22",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),l&&(0,n.jsx)("span",{className:"tw-text-[13px] tw-font-medium",children:c("filter")})]}),(r?K:Z)&&(0,n.jsx)($,{})]}),(0,n.jsx)(k.Z,{isOpen:u,isHighPriority:!0,onClose:z,onButtonClose:z,anchorType:"bottom",customDesktopStyle:S.ar,isCenterModal:l,modalTitle:l?c("filter"):void 0,centerModalConfirmTitle:l?c("search_bar.save_and_continue"):void 0,clearButtonTitle:l?c("search_bar.clear_all"):void 0,handleClear:l?q:void 0,handleConfirm:l?Y:void 0,content:(0,n.jsxs)(n.Fragment,{children:[!l&&(0,n.jsx)("p",{className:"typography-body-1",children:c("search_bar.filter_search_results")}),r&&(0,n.jsxs)("div",{className:"between-content tw-py-3",children:[(0,n.jsx)("p",{className:"typography-body-1 tw-text-black",children:c("search_bar.display_overnight_stays")}),(0,n.jsx)("button",{role:"switch","aria-checked":h,onClick:X,className:`tw-relative tw-inline-flex tw-h-5 tw-w-9 tw-items-center tw-rounded-full tw-border-0 tw-cursor-pointer tw-transition-colors tw-duration-200 ${h?"tw-bg-brand":"tw-bg-gray-300"}`,children:(0,n.jsx)("span",{className:`tw-inline-block tw-h-3.5 tw-w-3.5 tw-rounded-full tw-bg-white tw-shadow tw-transition-transform tw-duration-200 ${h?"tw-translate-x-[18px]":"tw-translate-x-1"}`})})]}),(0,n.jsx)(O.Z,{priceRangeFilter:M,isMapSearch:r,type:i,deferSearch:l}),(0,n.jsx)(A.Z,{starRatingFilter:F,isMapSearch:r,type:i,deferSearch:l}),(0,n.jsx)(P.Z,{themeFilter:G,isMapSearch:r,type:i,deferSearch:l}),(0,n.jsx)(D.Z,{paymentOptionFilter:U,isMapSearch:r,type:i,deferSearch:l}),(0,n.jsx)(B.Z,{amenitiesFilter:V,isMapSearch:r,type:i,deferSearch:l})]})})]})}function Z(e){let{remoteTime:t,isMapSearch:r=!1,className:l,type:c,section:u="SEARCH_RESULT_BAR",handleBackBtnClicked:d}=e,p=(0,s.T)(),g=(0,i.useParams)(),[f]=(0,a.KO)(x.xR),[_]=(0,a.KO)(y.ll),[j]=(0,a.KO)(x.lX
1),k=r?_:f,{data:S}=(0,w.n)({region:g.region,lang:g.lang,spaceType:k,priceMode:j}),{data:T}=(0,m._)({region:g.region,spaceTypeKey:(0,v.Hg)((0,v.wJ)(k)),suggestionIDs:S?.placeholder?.animated}),C=S?{...S,searchBarSuggestions:T??S.searchBarSuggestions}:void 0,[R,I]=(0,o.useState)(""),E=(0,o.useRef)(null),L=(0,o.useCallback)((e,t)=>{I(e&&t?t:"")},[]),M=k===N.dP.REST,O=(0,o.useMemo)(()=>{let e=[b.FR.DATE,b.FR.TIME];return k===N.dP.REST&&e.push(b.FR.DURATION),e},[k]);return"LISTING"===c||r?(0,n.jsxs)("div",{className:l,children:[(0,n.jsxs)("div",{ref:E,className:`tw-flex tw-items-center tw-rounded-full tw-border-[1.5px] tw-border-solid ${R?"tw-border-red-400":"tw-border-brand-default"} tw-bg-white tw-overflow-hidden tw-h-[52px]`,children:[(0,n.jsxs)("div",{className:"tw-relative tw-flex tw-items-center tw-flex-1 tw-min-w-0 tw-pl-3 tw-pr-1 tw-h-full",children:[(0,n.jsx)("p",{className:"tw-pointer-events-none tw-absolute tw-top-2.5 tw-left-[40px] tw-text-[12px] tw-font-medium tw-leading-none tw-text-info",children:p("search_bar.destinations")}),(0,n.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"tw-shrink-0 tw-text-[var(--themes-text-body-subtle)]",children:[(0,n.jsx)("circle",{cx:"11",cy:"11",r:"8",stroke:"currentColor",strokeWidth:"2"}),(0,n.jsx)("path",{d:"M21 21l-4.35-4.35",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),(0,n.jsx)(h.Z,{type:c,searchOptions:C,isMapSearch:r,isMobile:!0,hideBorder:!0,fullWidthDropdown:!0,popperContainerRef:E,handleDisableSearch:L,className:"tw-flex-1 tw-min-w-0"})]}),(0,n.jsx)("div",{className:"tw-w-[1px] tw-h-6 tw-bg-[var(--themes-border-default)] tw-shrink-0"}),(0,n.jsx)(U,{remoteTime:t,swiperType:b.FR.DATE,isMapSearch:r,type:c,isCenterModal:!0,showLabel:!0,className:"tw-h-full tw-flex tw-items-center tw-px-4 tw-min-w-[120px] tw-shrink-0"})]}),R&&(0,n.jsx)("p",{className:"tw-text-xs tw-text-red-400 tw-mt-1 tw-px-3",children:R}),(0,n.jsxs)("div",{className:"tw--mx-4 tw-flex tw-overflow-x-auto tw-items-center tw-gap-2 tw-mt-3 scrollbar-hidden tw-px-4 tw-pr-4",children:[(0,n.jsxs)("div",{className:"tw-flex tw-items-center tw-bg-white tw-border-[1.5px] tw-border-solid tw-border-light tw-rounded-full tw-h-[40px] tw-shrink-0 tw-overflow-hidden tw-text-body-strong",children:[(0,n.jsx)(U,{remoteTime:t,swiperType:b.FR.TIME,isMapSearch:r,type:c,isCenterModal:!0,className:"tw-flex tw-items-center tw-h-full tw-px-3 tw-text-[13px] tw-font-medium tw-whitespace-nowrap tw-cursor-pointer hover:tw-bg-flow-hover tw-transition tw-duration-150"}),M&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"tw-w-[1px] tw-h-5 tw-bg-[var(--themes-border-default)] tw-shrink-0"}),(0,n.jsx)(U,{remoteTime:t,swiperType:b.FR.DURATION,isMapSearch:r,type:c,isCenterModal:!0,className:"tw-flex tw-items-center tw-h-full tw-px-3 tw-text-[13px] tw-font-medium tw-whitespace-nowrap tw-cursor-pointer hover:tw-bg-flow-hover tw-transition tw-duration-150"})]})]}),(0,n.jsx)(V,{searchOptions:C,type:c,section:u,isMapSearch:r,chipStyle:!0})]})]}):(0,n.jsxs)("div",{className:l,children:[(0,n.jsxs)("div",{className:"tw-flex lg:tw-w-[500px]",children:[d&&(0,n.jsx)("button",{onClick:d,"aria-label":"close",className:"tw--ml-3 tw-text-white-ground tw-h-[40px] tw-flex tw-items-center tw-justify-center tw-bg-transparent tw-border-0 tw-cursor-pointer tw-p-2",children:(0,n.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M19 12H5M5 12L12 19M5 12L12 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,n.jsx)(h.Z,{type:c,searchOptions:C,isMapSearch:r,isMobile:!0,className:"lg:tw-px-4"}),(0,n.jsx)(V,{searchOptions:C,type:c,section:u,isMapSearch:r})]}),(0,n.jsx)("div",{className:"tw-flex tw-text-nowrap tw-overflow-auto tw-items-center tw-justify-start tw-mt-3 lg:tw-mt-0 scrollbar-hidden",children:O.map(e=>(0,n.jsx)(U,{remoteTime:t,swiperType:e,isMapSearch:r,type:c,className:"swiper-card card-border tw-rounded-full tw-py-1.5 tw-px-3 tw-mr-1.5 tw-text-black"},e))})]})}var K=r(53598),W=r(23841),Y=r(18199),q=e=>{let{type:t,spaceType:r,themeFilterValue:s}
1=e,[l]=(0,a.KO)(x.AG),c=(0,a.b9)(x.YV),[u,d]=(0,o.useState)(!1),{region:w,lang:m}=(0,i.useParams)();return!(e=>{if(e?.length>0){let t=e.find(e=>e?.value==="newly-on-board");return!!t&&t?.action_banner.enable}return!1})(s)||u||"newly-on-board"===l||"rest"!==r?null:(0,n.jsx)("div",{className:"button-class tw-mb-3 lg:tw-mb-4",onClick:()=>{let e;let r="newly-on-board";c({theme:e=l===r?"":r,isImmediateSearch:!0}),d(!0),(0,C.pJ)(t,{theme:e})},children:(0,n.jsx)(W.Z,{src:(()=>{let e;switch(m+"-"+w){case"zh-hk":e="1155b459-a6b5-4945-5fb5-1f6bc648ac00";break;case"zh-my":case"zh-sg":case"zh-cn":e="75d14064-65a5-4239-0931-7c4bc2eb2200";break;case"ms-my":e="12620ae4-bde1-46ea-bd42-08026eef7800";break;default:e="8affc023-4c56-4de7-c749-c47e3a5a8400"}return(0,Y.rW)(e,"mobile")})(),alt:"newly added action banner",width:683,height:223,className:"tw-rounded-xl",loading:"eager",isPlaceholder:!0})})},z=r(4281),X=r(97075);function J(e){let{searchOptions:t,remoteTime:r,className:l,type:o}=e,c=(0,s.T)(),{region:u,lang:d}=(0,i.useParams)(),[w]=(0,a.KO)(x.xR),m=(0,a.b9)(x.YV),[p]=(0,a.KO)(x.Uz),[h]=(0,a.KO)(x.mN),[v,y,k,S,T]=[N.cB.PRICE_RANGE,N.cB.STAR_RATING,N.cB.THEME,N.cB.PAYMENT_OPTION,N.cB.AMENITIES].map(e=>t?.filtering?.find(t=>t.key===e)),C=H({page:o,isShowOvernight:p,dispatch:m});return(0,n.jsx)("div",{className:`${l}`,children:(0,n.jsx)("div",{className:"tw-h-screen tw-overflow-y-auto tw-overflow-x-hidden tw-py-4 tw-pr-4",children:(0,n.jsxs)("div",{className:"tw-w-[340px]",children:[(0,n.jsx)(q,{type:o,spaceType:w,themeFilterValue:k?.value}),(0,n.jsx)("div",{className:"tw-w-full",children:(0,n.jsxs)("div",{className:"tw-pt-2 tw-pb-6 tw-px-4 tw-border-default tw-border tw-bg-default-white dark:tw-bg-gray tw-rounded-[1.25rem]",children:[(0,n.jsx)(z.Z,{isShowOvernight:p,handleOvernightClicked:C,spaceType:w,className:"tw-my-4"}),"rest"===w&&(0,n.jsx)(K.Z,{}),(0,n.jsxs)("div",{className:"between-content tw-my-4",children:[(0,n.jsx)("p",{className:"tw-font-semibold tw-text-sm",children:c("search_bar.date_and_time")}),(0,n.jsx)("div",{className:"button-class typography-fixed-xs-medium tw-text-info-subtle",onClick:()=>{let e=(0,X.rh)(u,d);m({date:(0,_.tg)(r.timestamp,u),time:e,duration:0,isImmediateSearch:!0})},children:c("search_bar.clear_all")})]}),(0,n.jsx)(E.Z,{title:c("search_bar.date"),option:(0,j.AH)(h,u,d,r?.timestamp)}),(0,n.jsxs)("div",{className:"tw-grid tw-gap-8",children:[(0,n.jsx)(g.default,{isFullWeek:!0,searchOptions:t,remoteTime:r,className:"tw-mt-3 tw-hidden lg:tw-block",type:"LISTING",section:"SEARCH_RESULT_BAR"}),(0,n.jsx)(f.Z,{remoteTime:r,type:o,section:"SEARCH_RESULT_BAR",swiperType:b.FR.FULL})]}),(0,n.jsx)(K.Z,{}),(0,n.jsxs)("div",{className:"between-content tw-my-4",children:[(0,n.jsx)("p",{className:"typography-body-1",children:c("filter")}),(0,n.jsx)("div",{className:"button-class typography-fixed-xs-medium tw-text-info-subtle",onClick:()=>{m({theme:"",paymentOption:[],amenities:[],priceRange:void 0,starRating:[],page:1,tier:1,isImmediateSearch:!0})},children:c("search_bar.clear_all")})]}),(0,n.jsxs)("div",{className:"tw-grid tw-gap-8",children:[(0,n.jsx)(O.Z,{priceRangeFilter:v,type:o}),(0,n.jsx)(P.Z,{themeFilter:k,type:o}),(0,n.jsx)(A.Z,{starRatingFilter:y,type:o}),(0,n.jsx)(D.Z,{paymentOptionFilter:S,type:o}),(0,n.jsx)(B.Z,{amenitiesFilter:T,type:o})]})]})})]})})})}var Q=r(7802),ee=r(11210),et=r(85656),er=r(92461),en=r(85145),ea=r(10600),es=r(13430),ei=r(8521),el=r(36846);let eo=(e,t)=>{let r=t?.[0]?.slug;if(!r)return null;let n=`${t.length}:${r}`;return n===e?null:{slug:r,signature:n}},ec=(0,ee.default)(()=>Promise.all([r.e(7873),r.e(2419),r.e(6827)]).then(r.bind(r,72419)),{loadableGenerated:{webpack:()=>[72419]},ssr:!1}),eu=(0,ee.default)(()=>Promise.all([r.e(1910),r.e(8826),r.e(8048)]).then(r.bind(r,7341)),{loadableGenerated:{webpack:()=>[7341]},ssr:!1});function ed(e){let{remoteTime:t,className:r="",snapSheetPeekOnMapPan:s=!1,clearMarkerOnMapPan:l=!0,loadingPillTop:c}=e,u=(0,i.useParams)(),m=(0,i.useSearchParams)(),p=(0,a.oR)(),h=(0,a.Dv)(ea.fX),[g,f]=(0,a.KO)(y.AM),x=(0,a.Dv)(y.ll),v=(0,a.Dv)(y.Co),b=(0,a.Dv)(y.Ee),k=(0,a.Dv)(y.bX),S=(0,a.Dv)(y.mN),T=(0,a.b9)(es.HG),C=(0,a.b9)(es.PS),R=(0,a.b9)(es.wK),[E,L]=(0,a.KO)(y.CB),O=!(0,en.D)(1023),A=(0,o.useRef)(!0),P=(0,o.useMemo)(()=>!!g?.suggestionId||v?.length===2,[v?.length,g?.suggestionId]),D=(0,o.useMemo)(()=>(0,el.kS)(),[]),{data:B}=(0,w.n)({region:u.region,lang:u.lang,spaceType:x,priceMode:g?.priceMode}),F=(0,o.useMemo)(()=>{let e=B?.filtering?.find(e=>e.key===N.cB.PAYMENT_OPTION)?.value;return e?.reduce((e,t)=>
1{let{type:r,name:n}=t;return{...e,[r]:n}},{})??{}},[B]),G=m.get(X._B.GROUP)||(0,I.Er)(M.FW.LOCATION_GROUP),{data:U,isValidating:H}=(0,d.ZP)(P&&!D?["/map/search",u.region,u.lang,g.mapLatLng,g.suggestionId,g.suggestionCategory,G,g.priceMode,g.date,g.time,g.duration,g.priceRange,g.starRating,g.amenities,g.pax,g.bookType,g.paymentOption,g.theme,g.sortCriteria,g.zoomLevel,g.isShowOvernight,g.tier,g.prevIds,g.spaceType]:null,async e=>{let[,r,n,,,,a]=e;return g.date||(g.date=(0,j.FP)(t.timestamp,u.region)),(0,j.wG)(g.date,u.region,Math.max(t.timestamp,Date.now()))&&(g.date=(0,j.w6)((0,Q.E)(g.date,1))),(await (0,ei.Ju)({region:r,lang:n,criteria:g,page:1,locationGroup:a})).spaces},{revalidateOnFocus:!1,revalidateOnReconnect:!1,keepPreviousData:!0}),$=(0,o.useMemo)(()=>{let e=U?.[0]?._geoloc;return e?{lat:e[0],lng:e[1]}:v?.length===2?{lat:v[0],lng:v[1]}:void 0},[U,v]),V=(0,o.useRef)(null);(0,o.useEffect)(()=>{let e=eo(V.current,U);e&&(V.current=e.signature,!p.get(y.AM).isMapPan&&(window.innerWidth<=1023||T(e.slug)))},[U,T,p]);let Z=(0,o.useMemo)(()=>{let e=h?.groups;if(!e?.length)return;let t=m.get(X._B.GROUP)||(0,I.Er)(M.FW.LOCATION_GROUP);if(!t)return;let r=e.find(e=>e.slug===t);if(r?.latitude&&r?.longitude)return{lat:r.latitude,lng:r.longitude}},[h,m]),K=(0,o.useCallback)((e,r)=>{if(A.current){A.current=!1;return}!O&&l&&(s&&p.get(es.HG)&&R(!0),C(!0));let n={mapLatLng:[e.lat,e.lng],sortCriteria:"s_user_lat_long",isMapPan:!0};if(r&&(n.zoomLevel=r),b||(n.date=(0,_.tg)(t.timestamp,u.region)),0===k.value.length){let e=N.OL.find(e=>e.value===N.TI.ANY_CHECK_IN_TIME);n.time={text:e.text[(0,I.VD)(u.region,u.lang)],periodType:e.value,value:e.value}}f(n)},[O,l,s,p,R,C,b,k,t.timestamp,u.region,u.lang,f]),W=(0,o.useCallback)(e=>{T("");let r={isImmediateSearch:!1,mapLatLng:[e.lat,e.lng],sortCriteria:"s_user_lat_long",isMapPan:!0};if(b||(r.date=(0,_.tg)(t.timestamp,u.region)),0===k.value.length){let e=N.OL.find(e=>e.value===N.TI.ANY_CHECK_IN_TIME);r.time={text:e.text[(0,I.VD)(u.region,u.lang)],periodType:e.value,value:e.value}}f(r)},[T,b,k,t.timestamp,u.region,u.lang,f]),Y=(0,o.useMemo)(()=>Z||(h?.latitude&&h?.longitude?{lat:h.latitude,lng:h.longitude}:void 0),[Z,h?.latitude,h?.longitude]),q=(0,o.useRef)(null);return(0,o.useEffect)(()=>{if(!Y)return;let e=p.get(y.AM);if(e.suggestionId||m.get(X._B.SUGGESTION_ID)||"s_user_lat_long"===m.get(X._B.SORT_BY)||"s_user_lat_long"===e.sortCriteria)return;let t=`${Y.lat},${Y.lng}`;if(q.current===t)return;let r=e.mapLatLng?.[0],n=e.mapLatLng?.[1];if(r===Y.lat&&n===Y.lng){q.current=t;return}q.current=t,f({mapLatLng:[Y.lat,Y.lng]})},[Y?.lat,Y?.lng]),(0,o.useEffect)(()=>{if(E||"undefined"==typeof navigator||!navigator.geolocation||!navigator.permissions?.query)return;let e=!1;return navigator.permissions.query({name:"geolocation"}).then(t=>{e||"granted"!==t.state||navigator.geolocation.getCurrentPosition(t=>{e||L({lat:t.coords.latitude,lng:t.coords.longitude})},()=>{},{enableHighAccuracy:!0,maximumAge:6e4,timeout:1e4})}).catch(()=>{}),()=>{e=!0}},[]),(0,o.useEffect)(()=>()=>{q.current=null},[]),(0,n.jsxs)("div",{className:`tw-relative tw-h-full tw-w-full ${r}`,children:[(0,n.jsx)("button",{onClick:()=>{f({isMapExpanded:!S})},className:"tw-absolute tw-top-3 tw-right-3 tw-z-10 tw-bg-[var(--themes-bg-default-white)] tw-text-[var(--themes-text-title)] tw-rounded-full tw-shadow-md tw-hidden lg:tw-flex tw-items-center tw-justify-center tw-w-12 tw-h-12 tw-transition-transform tw-duration-200 tw-ease-out hover:tw-scale-105 active:tw-scale-90","aria-label":S?"Collapse map":"Expand map",children:(0,n.jsx)("span",{className:"map-icon-swap tw-flex tw-items-center tw-justify-center",children:S?(0,n.jsx)(et.I,{width:18,height:18}):(0,n.jsx)(er.D,{width:18,height:18})},S?"collapse":"expand")}),"cn"===u.region?(0,n.jsx)(ec,{results:U,onCenterChanged:K,onUserLocated:W,paymentOption:F,zoom:14,spaceLatLng:$,userLocation:E}):(0,n.jsx)(eu,{results:U,isValidating:H,onCenterChanged:K,paymentOption:F,isImmediateSearch:g.isImmediateSearch,spaceLatLng:$,userLocation:E,onUserLocated:W,defaultCenter:Z,defaultZoom:13,loadingPillTop:c})]})}var ew=r(90405),em=r(21156),ep=r(47581),eh=r(69582),eg=r(84983);let ef=e=>e||G.Z.getItem(M.Jr.PRICE_MODE,"BASE"),ex=e=>e?.suggestionId?{suggestionId:e.suggestionId,suggestionCategory:e.suggestionCategory,query:e.query,querySource:e.querySource,sortCriteria:e.sortCriteria,isImmediateSearch:!0}:e?.mapLatLng?{mapLatLng:e.mapLatLng,query:e.query,querySource:e.querySource,sortCriteria:e.sortCriteria,isImmediateSearch:!0}:{},ev=(e,t)=>
1e||t;var eb=r(69214),ey=r(20469);let e_=e=>{let{analyticsObj:t,store:r,criteria:n,priceLimitValue:a,globalSpace:s,variant:i,posthog:l,t:o,resetPrevRouteData:c}=e,{source:u}=r.get(ep.m);if(!u)return;let d=r.get(x.Ys),w=r.get(x.mN),m=r.get(x.mv),p=r.get(x.Gr),h=r.get(x.Uz),{query:g,mapLatLng:f,priceRange:v,sortCriteria:b,time:y,theme:_}=n,j=f?o("currentLocation"):g,k={date:w?(0,ey.Co)(w):"tdy",...d?.length>0&&{starRating:d},...v?.length>0&&!(0,ey.ih)({inputPriceRange:v,searchBarPriceRange:a})&&{priceRange:v},...b&&{sorting:b},..._&&{theme:_},...n.amenities?.length>0&&{amenities:n.amenities},...n.paymentOption?.length>0&&{paymentOption:n.paymentOption},..."free"===m.timeType||"specific"===m.timeType?{...m.value&&{checkInStart:(0,ey.UM)(m.value)},...m.endValue&&{checkInEnd:(0,ey.UM)(m.endValue)}}:{period:m.periodType?eb.Dm[m.periodType]:eb.Dm[N.TI.ANY_CHECK_IN_TIME]},...h&&{overnight:(0,ey.np)(h)},duration:(0,ey.Df)(p)},S={space:s,date:w,searchTerm:j,time:(0,ey.fU)(y),viewType:(0,ey.KY)({source:u,mode:i}),filterObj:k,analyticsObj:t,posthog:l};(0,C.RG)(S),c()};var ej=r(96294),eN=r(55934),ek=r(54350),eS=r(37407),eT=r(70855),eC=r(68961),eR=r(98668),eI=r(33004);let eE=o.forwardRef((e,t)=>(0,n.jsx)("div",{ref:t,...e,className:"tw-h-9 tw-w-28 tw-rounded-full tw-border tw-border-solid tw-border-default tw-flex tw-items-center tw-justify-center",children:(0,n.jsx)("div",{className:"tw-h-3 tw-w-16 skeleton-color tw-rounded tw-animate-pulse"})}));function eL(e){let{searchOptions:t,type:r}=e,l=(0,s.T)(),c=(0,i.useParams)(),[d,w]=(0,o.useState)(void 0),[m]=(0,a.KO)(x.Sp),p=(0,a.b9)(x.YV),[h,g]=(0,o.useState)(!1),[f,v]=(0,o.useState)(!1),b=(0,en.D)(),y=e=>{if(b?g(!1):v(!1),"s_user_lat_long"===e.key){let t={sortCriteria:"s_default",isImmediateSearch:!0};navigator.geolocation.getCurrentPosition(r=>{let n=l("search_bar.current_location_in_use");(0,eT.vl)(c.region)?(t.mapLatLng=[r.coords.latitude,r.coords.longitude],t.query=l("search_bar.current_location"),t.sortCriteria=e.key,w(e)):n=l("error.loc_outside_region",{region:(0,eC.MH)(c.region,c.lang)}),(0,u.A)(n),p(t)},e=>{let r="";r=e.code===e.PERMISSION_DENIED||e.code===e.POSITION_UNAVAILABLE?l("error.loc_limited_accuracy"):e.code===e.TIMEOUT?l("error.loc_permission_b"):l("error.loc_gps_timeout"),(0,u.A)(r),p(t)},{enableHighAccuracy:!0,maximumAge:5e3}),p({sortCriteria:e.key,isImmediateSearch:!0})}else e.key&&(w(e),p({sortCriteria:e.value?`${e.key}:${e.value}`:e.key,isImmediateSearch:!0}),(0,C.Du)({page:r,name:`${e.value+"_"+e?.ga_value}`,value:e.ga_value}))},_=t?.sorting;(0,o.useEffect)(()=>{if(_&&_?.length>0&&m){let e=m.split(":")[0],t=m.split(":")[1];t||(t=""),w(_?.find(r=>r.key===e&&r.value===t))}else void 0===d&&_?.length>0&&w(_[0])},[_,m]);let j=d?.text?(0,n.jsxs)(eR.z,{variant:"outline",onClick:()=>{b&&g(!0)},className:`tw-flex tw-h-auto tw-rounded-full tw-border tw-border-solid tw-py-2 tw-px-4 tw-text-body-strong ${f?"tw-border-brand-default":"tw-border-default"}`,children:[(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"tw-h-4 tw-w-4 tw-shrink-0",children:(0,n.jsx)("path",{fillRule:"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 2 8Zm0 4.25a.75.75 0 0 1 .75-.75h3.5a.75.75 0 0 1 0 1.5h-3.5a.75.75 0 0 1-.75-.75ZM12.22 6.22a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1-1.06 1.06l-.72-.72V13a.75.75 0 0 1-1.5 0V8.56l-.72.72a.75.75 0 0 1-1.06-1.06l2-2Z",clipRule:"evenodd"})}),(0,n.jsx)("p",{className:"typography-fixed-xs-medium tw-ml-2 tw-whitespace-nowrap",children:d?.text})]}):(0,n.jsx)(eE,{});return(0,n.jsxs)(n.Fragment,{children:[b?j:(0,n.jsxs)(eI.h_,{open:f,onOpenChange:v,children:[(0,n.jsx)(eI.$F,{asChild:!0,children:j}),(0,n.jsx)(eI.AW,{align:"end",sideOffset:4,className:"tw-rounded-card tw-border tw-border-flow-border tw-shadow-[0px_4px_6px_rgba(30,30,30,0.1),0px_10px_15px_rgba(30,30,30,0.1)]",children:_?.map((e,t)=>{let r=d===e;return n.jsx(eI.Xi,{onSelect:()=>y(e),className:`tw-cursor-pointer !tw-text-[14px] !tw-font-medium tw-h-12 !tw-rounded-lg !tw-px-4 ${r?"!tw-bg-flow-primary-subtle !tw-text-gold":"!tw-text-flow-foreground"}`,children:e.text},`sort-options-${t}`)})})]}),(0,n.jsx)(k.Z,{isOpen:h,onClose:()=>g(!1),isHighPriority:!0,content:(0,n.jsx)("div",{className:"tw-flex tw-flex-col",children:_?.map((e,t)=>{let r=d===e;return n.jsx("button",{type:"button",onClick:()=>y(e),className:`tw-flex tw-items-center tw-w-full tw-h-12 tw-px-4 tw-rounded-lg tw-border-0 tw-cursor-pointer tw-text-[14px] tw-font-medium tw-text-left ${r?"tw-bg-flow-primary-subtle tw-text-gold":"tw-bg-transparent tw-text-flow-foreground"}`,children:e.text},`sort-options-${t}`)})})})]})}eE.displayName="Skeleton";var eM=r(19824);function eO(e){let{results:t,searchOptions:r,totalHits:l,type:c,loading:u}=e,d=(0,s.T)(),w=(0,i.useParams)(),[m]=(0,a.KO)(x.Uz),p=(0,a.b9)(x.Y
1V),h=(0,o.useMemo)(()=>(0,v.jl)(Array.isArray(w.globalSpace)?w.globalSpace[0]:w.globalSpace)||N.dP.REST,[w]),g=(0,o.useMemo)(()=>(r?.filtering?.find(e=>e.key===N.cB.PAYMENT_OPTION)?.value??[]).reduce((e,t)=>{let{type:r,name:n}=t;return{...e,[r]:n}},{}),[r]),f=(0,o.useMemo)(()=>r?.filtering?.find(e=>e.key===N.cB.THEME)??[],[r]),b=H({page:c,isShowOvernight:m,dispatch:p});return(0,n.jsxs)("div",{className:"tw-overflow-auto lg:tw-px-4 tw-py-0",children:[(0,n.jsxs)("div",{className:"lg:tw-hidden",children:[(0,n.jsx)(q,{type:c,spaceType:h,themeFilterValue:f?.value}),(0,n.jsx)(z.Z,{isShowOvernight:m,handleOvernightClicked:b,spaceType:h,className:"tw-py-2"})]}),(0,n.jsxs)("div",{className:`between-content ${"LISTING"===c?"tw-mt-4 lg:tw-mt-0":"tw-mt-4"}`,children:[isNaN(l)?(0,n.jsx)(eA,{}):(0,n.jsx)("p",{className:"typography-fixed-xs-medium tw-text-body tw-mr-2",children:(0,n.jsx)(eM.Z,{i18nKey:"search_bar.showing_number_results",values:{total:l}})}),(0,n.jsx)("div",{className:"tw-flex tw-items-center",children:(0,n.jsx)(eL,{searchOptions:r,type:c})})]}),t?.length?(0,n.jsx)("div",{className:"tw-flex tw-flex-col lg:tw-grid lg:tw-grid-cols-1 min-[1440px]:tw-grid-cols-2 min-[1440px]:tw-max-w-[864px] tw-gap-4 tw-mt-5",children:(0,n.jsx)(eD,{results:t,type:c,spaceType:h,paymentOptions:g})}):0!==l||u?(0,n.jsx)("div",{className:"tw-flex tw-flex-col lg:tw-grid lg:tw-grid-cols-1 min-[1440px]:tw-grid-cols-2 min-[1440px]:tw-max-w-[864px] tw-gap-4 tw-mt-5",children:Array.from({length:6}).map((e,t)=>(0,n.jsx)(ek.Z,{},`list-item-skeleton-${t}`))}):(0,n.jsxs)("div",{className:"tw-flex tw-justify-center tw-flex-col tw-items-center tw-min-h-[51vh]",children:[(0,n.jsx)("div",{className:"tw-font-bold lg:tw-text-base",children:d("booking.noResultTitle")}),(0,n.jsx)("div",{className:"tw-text-info tw-text-xs lg:tw-text-sm tw-text-center tw-mt-2",children:d("booking.noResultBody")})]})]})}function eA(){return(0,n.jsx)("div",{className:"tw-animate-pulse tw-h-4 tw-w-20 lg:tw-w-30 skeleton-color tw-rounded"})}function eP(e){let{text:t}=e;return(0,n.jsx)("div",{className:"lg:tw-col-span-1 xl:tw-col-span-2 centered-content tw-h-12 tw-bg-brand-subtle tw-border-b-4 tw-border-brand-strong tw-rounded-lg tw-mb-5 lg:tw-mb-0",children:(0,n.jsx)("p",{className:"tw-mt-0 tw-font-semibold tw-text-sm tw-leading-[18px] tw-text-brand-strong dark:tw-text-title",children:t})})}let eD=o.memo(function(e){let{results:t,type:r,spaceType:s,paymentOptions:i}=e,l=(0,a.b9)(es.SU);return(0,n.jsx)(n.Fragment,{children:t.map((e,a)=>{if(e.banner)return"LOCATION"===r&&t.length-1===a?null:(0,n.jsx)(eP,{text:e.banner.text},`banner_${e.tier}_${a}`);let o=e?.slug;return(0,n.jsx)("div",{className:"tw-h-full",onMouseEnter:o?()=>l(o):void 0,onMouseLeave:o?()=>l(""):void 0,children:(0,n.jsx)(eS.Z,{item:e,spaceType:s,type:r,paymentOption:i,isMapSearch:!1,idx:a})},`listing_${e?.id}_${a}`)})})});var eB=e=>{let{totalHits:t,searchOptions:r,results:a,type:i,loading:l,hasNextPage:o,sentryRef:c,onMoreResults:u,skeletonGridClassName:d}=e,w=(0,s.T)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eO,{totalHits:t,searchOptions:r,results:a,type:i,loading:l}),"LOCATION"===i?(0,n.jsxs)(n.Fragment,{children:[!l&&(0,n.jsx)("div",{className:"tw-flex tw-justify-center tw-items-center tw-mt-8 tw-mb-4 lg:tw-mx-4",children:(0,n.jsxs)(ej.default,{onClick:u,className:"tw-h-12 tw-px-8 tw-bg-brand-subtle tw-border-b-4 tw-border-brand-strong tw-rounded-lg",fullWidth:!0,children:[(0,n.jsx)("p",{className:"tw-font-semibold tw-text-sm tw-leading-[18px] tw-text-brand-strong dark:tw-text-title",children:w("location.load_more_results")}),(0,n.jsx)(eN.Y,{width:24,height:24})]})}),a.length<=9&&(0,n.jsx)("div",{ref:c})]}):(0,n.jsx)("div",{ref:c}),("LOCATION"===i?l:o||l)&&(0,n.jsx)("div",{className:d,children:Array.from([,,,,].keys()).map(e=>(0,n.jsx)(ek.Z,{},`list-item-skeleton-${e}`))})]})},eF=r(69373),eG=r(37233);let eU="listing-date-roll";function eH(e){let{remoteTime:t,type:r,querySuggestion:g,className:f="",initialHits:k=null}=e,S=(0,s.T)(),T=(0,i.useParams)(),{region:C,lang:R}=(0,i.useParams)(),E=(0,i.useSearchParams)(),L=(0,i.usePathname)(),O=(0,i.useRouter)(),A=(0,l.ZR)("search-result-item-evaluation-2024"),{variant:P}=(0,eh.Z)(A),D=(0,l.U0)(),B=!!k&&k.hits.length>0,[F,G]=(0,o.useState)(B?k.hits:[]),[H,$]=(0,o.useState)(B?k.total:null),[K,W]=(0,o.useState)(!1),[Y,q]=(0,o.useState)(!!B&&k.hits.length<k.total),[z,Q]=(0,o.useState)(!B),ee=(0,o.useRef)([]),et=(0,o.useRef)(null),er=(0,o.useRef)(!0),en=(0,o.useRef)(!1),el=(0,o.useRef)(!0),eo=(0,a.oR)(),[ec,eu]=(0,a.KO)(x.Y
1V),eb=(0,a.b9)(y.AM),ey=(0,a.Dv)(y.mN),ej=(0,a.b9)(ep.m),eN=(0,a.b9)(ep.Y),ek=(0,a.Dv)(ea.fX),eS=T.globalSpace[0],eT=(0,v.jl)(eS)||N.dP.REST,eC="my"===C,eR=eC?(0,I.Er)(M.FW.LOCATION_GROUP):null,eI=(0,o.useMemo)(()=>ek?(0,I.xj)(ek.groups,E.get(X._B.GROUP)):null,[ek,E]),eE=E.get(X._B.SUGGESTION_CATEGORY),{group:eL,pending:eM}=function(e){let{enabled:t,region:r,globalSpace:n,query:a,suggestionId:s,category:i}=e,[l,c]=(0,o.useState)(null),[u,d]=(0,o.useState)(t);return((0,o.useEffect)(()=>{if(!t||!a||!s||!i){c(null),d(!1);return}let e=!1;return d(!0),c(null),(async()=>{try{let t=await (0,eG.nl)((0,eG.mb)(r,(0,v.Hg)(n),"PROD"),{q:`"${a}"`,query_by:"query",filter_by:`category:=${"SPACE"===i?"NAME":i}`,per_page:5,queryParameters:{region:r,query_suggestion:!0}},!0),l=t?.hits?.find(e=>e._id===s);e||c(l?.location_groups?.[0]??null)}catch{}finally{e||d(!1)}})(),()=>{e=!0}},[t,r,n,a,s,i]),t)?{group:l,pending:u}:{group:null,pending:!1}}({enabled:eC&&"LISTING"===r&&!!E.get(X._B.GROUP)&&("SPACE"===eE||!!eE?.startsWith("LOCATION-")),region:C,globalSpace:eS,query:E.get(X._B.QUERY),suggestionId:E.get(X._B.SUGGESTION_ID),category:eE}),eO=(0,o.useMemo)(()=>{if(!eC||!ek)return null;let e="LOCATION"===r?g?.location_groups?.[0]:"LISTING"===r?eL:null;return e&&(0,I.xj)(ek.groups,e)?e:null},[eC,r,ek,g,eL]),eA=(0,o.useMemo)(()=>eC?E.get(X._B.GROUP)||eR||M.RI:null,[eC,E,eR]),eP=(0,o.useRef)(null),eD=(0,o.useRef)(null),eH=(0,o.useRef)(!1);(0,o.useEffect)(()=>{if(!eC)return;let e=E.get(X._B.GROUP);if(!e)return;if(eO&&e!==eO&&eD.current!==e){let t=new URLSearchParams(E.toString());t.set(X._B.GROUP,eO),(0,eF.mj)(`${L}?${t.toString()}`),eo.get(x.YV).group===e&&eu({group:eO,isImmediateSearch:!0});return}if(eM||!eI)return;let t=(0,I.Er)(M.FW.LOCATION_GROUP);t!==e&&(eP.current=t||M.RI,(0,eg.G)(e))},[eC,E,eI,eO,eM,L,eo,eu]);let e$=(0,o.useCallback)(()=>{if(!eC)return;let e=ec.group||E.get(X._B.GROUP),t=ek?(0,I.xj)(ek.groups,e):null,r=eP.current??eR,n=e===r;if(!e||!t||n){n&&(eP.current=null);return}if(eM){eH.current=!0;return}if(eO&&e!==eO)return;let a=r||M.RI;eP.current=null,(0,u.A)(S("search_bar.location_switch_hint",{locationGroupName:t}),{action:{label:S("undo").toUpperCase(),onClick:()=>{eD.current=a,(0,eg.G)(a),eu({isImmediateSearch:!0,group:a})}}})},[S,E,ec.group,ek,C,eR,eu,eO,eM]);(0,o.useEffect)(()=>{!eM&&eH.current&&(eH.current=!1,e$())},[eM,e$]);let eV=(0,o.useCallback)(()=>{K||(ee.current=[],eu({isImmediateSearch:!0,page:1,tier:1,prevIds:[]}))},[K,eu]),eZ=(0,o.useCallback)(()=>{O.push(`/${C}/${R}/${eS}`)},[C,R,eS]),eK=(0,o.useCallback)(e=>{W(e)},[]),eW=(0,o.useCallback)(()=>{let e=eo.get(x.Ag),t=eo.get(x.Tr);(et.current?.page!==e||et.current?.tier!==t)&&eu({isImmediateSearch:!0,page:et.current?.page,tier:et.current?.tier,prevIds:ee.current??[]})},[eo,eu]),{listingSnap:eY,hasUserGesture:eq,isMobileCardVisible:ez,listingSnapRef:eX,mapViewInitRef:eJ,loadingRef:eQ,spacerRef:e0,resultsRef:e1,searchBarFixedRef:e2,searchBarPlaceholderRef:e3,searchBarHeight:e4,snapListingTo:e5,onHandleDragStart:e6,onHandleDragMove:e7,onHandleDragEnd:e9}=function(e){let{type:t,loading:r,hasNextPage:n,onLoadMore:s}=e,l=(0,i.useSearchParams)(),c=(0,a.oR)(),u="map"===l.get("view"),[d,w]=(0,o.useState)(u?"peek":"full"),m=(0,o.useRef)(null),p=(0,o.useRef)(null),h=(0,o.useRef)(null),g=(0,o.useRef)(null),[f,x]=(0,o.useState)(64),v=(0,o.useRef)(u?"peek":"full"),b=(0,o.useRef)(u),_=(0,o.useRef)(0),j=(0,o.useRef)(0),N=(0,o.useRef)(0),k=(0,o.useRef)(0),S=(0,o.useRef)(0),T=(0,o.useRef)(0),C=(0,o.useRef)(0),R=(0,o.useRef)(!1),I=(0,o.useRef)(null),E=(0,o.useRef)(null),L=(0,o.useRef)(!1),M=(0,o.useRef)(!1),O=(0,o.useRef)(!0),A=(0,o.useRef)(!1),[P,D]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if("LISTING"!==t)return;let e=["touchstart","pointerdown","wheel","keydown"],r=()=>{A.current=!0,D(!0),e.forEach(e=>window.removeEventListener(e,r))};return e.forEach(e=>window.addEventListener(e,r,{passive:!0})),()=>e.forEach(e=>window.removeEventListener(e,r))},[t]);let[B,F]=(0,a.KO)(es.wK),G=(0,a.Dv)(es.HG),[U,H]=(0,a.KO)(es.PS),$=(0,a.Dv)(y.mN),V=(0,a.b9)(y.AM),Z=!!G&&!U;(0,o.useLayoutEffect)(()=>
1{if("LISTING"!==t)return;let e=h.current;if(!e)return;let r=()=>{let t=e.getBoundingClientRect();if(!t.height||t.height<=0)return;let r=t.height;x(r),document.documentElement.style.setProperty("--listing-searchbar-height",`${r}px`)};r();let n=new ResizeObserver(()=>r());return n.observe(e),()=>n.disconnect()},[t]),(0,o.useEffect)(()=>{M.current=n},[n]),(0,o.useEffect)(()=>{O.current=r},[r]);let K=(0,o.useCallback)(()=>{null!==I.current&&(cancelAnimationFrame(I.current),I.current=null)},[]),W=(0,o.useCallback)(e=>{let t=p.current;if(!t)return;K(),t.style.transition="none";let r=0,n=t.style.transform;if(n&&"none"!==n){let e=n.match(/translate3d\([^,]+,\s*([^,]+)px/i),t=n.match(/translateY\(\s*([^)]+)px\s*\)/i);e?r=parseFloat(e[1]):t&&(r=parseFloat(t[1]))}if(r===e){t.style.transform=0===e?"":`translate3d(0px, ${e}px, 0px)`,_.current=e;return}let a=Math.min(Math.max(220+.55*Math.abs(e-r),200),900),s=e-r,i=performance.now(),l=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,o=n=>{if(!p.current){I.current=null;return}let c=Math.min(1,(n-i)/a),u=l(c),d=r+s*u;t.style.transform=0===d?"":`translate3d(0px, ${d}px, 0px)`,_.current=d,c<1?I.current=requestAnimationFrame(o):(I.current=null,t.style.transform=0===e?"":`translate3d(0px, ${e}px, 0px)`,_.current=e)};I.current=requestAnimationFrame(o)},[K]),Y=(0,o.useCallback)((e,t)=>{K();let r=p.current;r&&(r.style.transition=t?"transform 0.35s cubic-bezier(0.32, 0.72, 0, 1)":"none",r.style.transform=0===e?"":`translate3d(0px, ${e}px, 0px)`,t&&setTimeout(()=>{p.current&&(p.current.style.transition="")},350),_.current=e)},[K]),q=(0,o.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"smooth";null!==E.current&&(cancelAnimationFrame(E.current),E.current=null);let n=v.current;v.current=e,w(e);let a=new URL(window.location.href),s=window.innerWidth<1280;if("peek"===e?(a.searchParams.has("view")||(a.searchParams.set("view","map"),(0,eF.mj)(a.toString())),s&&!c.get(y.mN)&&V({isMapExpanded:!0})):s?(a.searchParams.has("view")&&(a.searchParams.delete("view"),(0,eF.mj)(a.toString())),c.get(y.mN)&&V({isMapExpanded:!1})):a.searchParams.has("view")&&!c.get(y.mN)&&(a.searchParams.delete("view"),(0,eF.mj)(a.toString())),"peek"===e){document.documentElement.style.overflow="hidden";let e=p.current,t="";e&&(t=e.style.transform,e.style.transform="",j.current=e.getBoundingClientRect().top,"smooth"===r&&(e.style.transform=t));let n=Math.max(0,window.innerHeight-76-j.current);"instant"===r?(K(),Y(n,!1)):W(n)}else"mid"===e?(document.documentElement.style.overflow="","peek"===n?W(0):Y(0,!0),window.scrollY>0&&window.scrollTo({top:0,behavior:"smooth"})):(document.documentElement.style.overflow="",Y(-0,!1),window.scrollTo({top:m.current?.offsetHeight??0,behavior:t?"instant":"smooth"}))},[Y,W,K]),z=(0,o.useCallback)(()=>{null!==E.current&&(cancelAnimationFrame(E.current),E.current=null)},[]),X=(0,o.useCallback)(e=>{z();let t=-e,r=performance.now(),n=window.scrollY,a=()=>z();window.addEventListener("touchstart",a,{once:!0,passive:!0});let s=e=>{let i=e-r;r=e,t*=Math.pow(.998,i),n+=t*i;let l=document.documentElement.scrollHeight-window.innerHeight;if(n>=l&&(n=l,t=0),window.scrollTo({top:n,behavior:"instant"}),.02>Math.abs(t)){E.current=null,window.removeEventListener("touchstart",a);let e=m.current?.offsetHeight??0;window.scrollY<e&&window.scrollTo({top:e,behavior:"smooth"});return}E.current=requestAnimationFrame(s)};E.current=requestAnimationFrame(s)},[z]),J=(0,o.useCallback)(()=>{document.documentElement.style.overflow="hidden";let e=p.current;if(!e)return;let t=e.style.transform;e.style.transform="",j.current=e.getBoundingClientRect().top,e.style.transform=t,Y(Math.max(0,window.innerHeight-j.current)+160,!0)},[Y]);(0,o.useEffect)(()=>{if("LISTING"!==t)return;let e=()=>{if(R.current)return;let e=window.scrollY,t=m.current?.offsetHeight??0,r=e>=t?"full":"mid";if("peek"!==v.current||"mid"!==r){if("mid"===r&&!A.current){window.scrollTo({top:t,behavior:"instant"});return}if(r!==v.current&&(v.current=r,w(r)),M.current&&!O.current){let t=document.documentElement.scrollHeight;e+window.innerHeight>t-1500&&s()}}};window.addEventListener("scroll",e,{passive:!0});let r=e=>{R.current&&e.preventDefault()};return document.addEventListener("touchmove",r,{passive:!1}),()=>{window.removeEventListener("scroll",e),document.removeEventListener("touchmove",r),document.documentElement.style.overflow="",document.documentElement.style.overscrollBehavior="",null!==I.current&&(cancelAnimationFrame(I.current),I.current=null),null!==E.current&&(cancelAnimationFrame(E.current),E.current=null)}},[t,s]),(0,o.useLayoutEffect)(()=>
1{if("LISTING"!==t){B&&F(!1);return}B&&(q("peek",!1,"instant"),F(!1))},[t,B,q,F]),(0,o.useEffect)(()=>{if("LISTING"===t)return()=>{c.set(es.HG,""),c.set(es.PS,!1)}},[t,c]),(0,o.useLayoutEffect)(()=>{H(!1)},[G,H]),(0,o.useLayoutEffect)(()=>{"LISTING"===t&&!(window.innerWidth>=1280)&&(Z?"full"!==v.current&&!O.current&&(L.current=!0,J()):L.current&&(L.current=!1,q("peek",!1,"smooth")))},[Z,t,q,J]),(0,o.useEffect)(()=>{"LISTING"===t&&b.current&&(V({isMapExpanded:!0}),window.innerWidth>=1280||requestAnimationFrame(()=>{q("peek",!1,"instant")}))},[]),(0,o.useEffect)(()=>{if("LISTING"!==t)return;let e=()=>{if(A.current||window.innerWidth>=1280||"full"!==v.current)return;let e=m.current?.offsetHeight??0;window.scrollY<e&&window.scrollTo({top:e,behavior:"instant"})};return window.visualViewport?.addEventListener("resize",e),window.addEventListener("resize",e),()=>{window.visualViewport?.removeEventListener("resize",e),window.removeEventListener("resize",e)}},[t]),(0,o.useEffect)(()=>{"LISTING"===t&&!b.current&&(window.innerWidth>=1280||requestAnimationFrame(()=>{q("full",!0)}))},[]),(0,o.useEffect)(()=>{if("LISTING"!==t)return;let e=new URL(window.location.href);$?e.searchParams.has("view")||(e.searchParams.set("view","map"),(0,eF.mj)(e.toString())):e.searchParams.has("view")&&(e.searchParams.delete("view"),(0,eF.mj)(e.toString()))},[t,$]);let Q=(0,o.useCallback)(e=>{K(),N.current=e,k.current=window.scrollY,S.current=e,T.current=Date.now(),C.current=0,R.current=!0,document.documentElement.style.overscrollBehavior="none";let t=p.current;if(t){let e=t.style.transform;t.style.transform="",j.current=t.getBoundingClientRect().top,t.style.transform=e,t.style.transition="none"}},[K]),ee=(0,o.useCallback)(e=>{if(!R.current)return;let t=Date.now(),r=t-T.current;r>0&&(C.current=(e-S.current)/r),S.current=e,T.current=t;let n=e-N.current,a=v.current,s=p.current;if("peek"===a){let e=Math.max(0,_.current+n);s&&(s.style.transform=0===e?"":`translateY(${e}px)`)}else"mid"===a?n>0?s&&(s.style.transform=`translateY(${n}px)`):window.scrollTo({top:Math.max(0,k.current-n),behavior:"instant"}):n>0&&window.scrollTo({top:Math.max(0,k.current-n),behavior:"instant"})},[]),et=(0,o.useCallback)(e=>{if(!R.current)return;R.current=!1,document.documentElement.style.overscrollBehavior="";let t=e-N.current,r=C.current,n=v.current;"peek"===n?r<-.4||t<-30?q("mid"):q("peek"):"mid"===n?t>30||r>.4?q("peek"):r<-.4?(v.current="full",w("full"),document.documentElement.style.overflow="",Y(0,!1),X(r)):t<-30?q("full"):q("mid"):t>30||r>.4?q("mid"):q("full")},[q,Y,X]);return{listingSnap:d,hasUserGesture:P,isMobileCardVisible:Z,listingSnapRef:v,mapViewInitRef:b,loadingRef:O,spacerRef:m,resultsRef:p,searchBarFixedRef:h,searchBarPlaceholderRef:g,searchBarHeight:f,snapListingTo:q,onHandleDragStart:Q,onHandleDragMove:ee,onHandleDragEnd:et}}({type:r,loading:z,hasNextPage:Y,onLoadMore:eW}),{mountMobileMap:e8,mountDesktopMap:te}=function(e,t){let[r,n]=(0,o.useState)(null);(0,o.useEffect)(()=>{if(!window.matchMedia)return;let e=window.matchMedia("(min-width: 1280px)"),t=()=>n(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let[a,s]=(0,o.useState)("full"!==e);(0,o.useEffect)(()=>{"full"!==e&&t&&s(!0)},[e,t]);let i=(0,o.useRef)(null);return(0,o.useEffect)(()=>{!1===r&&!0===i.current&&s(!0),i.current=r},[r]),{mountMobileMap:!1===r&&a,mountDesktopMap:!0===r}}(eY,eq),tt=eC&&(0,I.Er)(M.FW.LOCATION_GROUP)||void 0,{data:tr}=(0,w.n)({region:C,lang:R,spaceType:eT,locationGroup:tt,priceMode:ec.priceMode}),{data:tn}=(0,m._)({region:C,spaceTypeKey:(0,v.Hg)((0,v.wJ)(eT)),suggestionIDs:tr?.placeholder?.animated}),ta=tr?{...tr,searchBarSuggestions:tn??tr.searchBarSuggestions}:void 0,{data:ts,mutate:ti}=(0,d.ZP)("/misc/current-time",()=>(0,p.A)(),{fallbackData:t,revalidateOnMount:!1,revalidateOnFocus:!0,focusThrottleInterval:6e5,revalidateOnReconnect:!0}),tl=ts??t;(0,o.useEffect)(()=>{(0,_.tg)(t?.timestamp??Date.now(),C)!==(0,_.tg)(Date.now(),C)&&ti()},[]);let[to]=(0,c.Z)({loading:z,hasNextPage:Y,delayInMs:400,onLoadMore:eW,disabled:!1,rootMargin:"0px 0px 1000px 0px"}),tc=(0,o.useMemo)(()=>ta?.filtering?.find(e=>e.key===N.cB.PRICE_RANGE),[ta]),tu=(0,o.useMemo)(()=>{let e=[b.FR.DATE,b.FR.TIME];return eT===N.dP.REST&&e.push(b.FR.DURATION),e},[eT]),td=async()=>{let e;let t=(0,X.xU)(T,E,ec,tl?.timestamp,g);if(eO&&t.group!==eO&&(t.group=eO),"SUB_LANDING"===r&&!t.query){let e=Array.isArray(T.globalSpace)?T.globalSpace:T.globalSpace?[T.globalSpace]:[],r=e[e.length-1];r&&!(0,v.jl)(r)&&(t.query=r)}let n=er.current?t:ec,a=Math.max(tl?.timestamp??Date.now(),Date.now()),s=E.get(X._B.DATE),{date:i,toast:l}=(0,j.Po)(n.date,s,C,a);if(n.date=i,"past_date_redirected"===l?er.current&&(0,u.A)(S("search_bar.past_date_redirected")):"today_ended"===l&&(0,u.A)(S("search_bar.today_ended"),{id:eU}),er.current){if(er.current=!1,eu(n),"LISTING"===r&&!eJ.current){let e=(0,X.b$)({region:C,lang:R,criteria:n,priceLimit:tc?.value,pathName:L,isLocationPage:!1});O.replace(e,{scroll:!1})}}else if(ec.isImmediateSearch){let e=(0,X.b$)({region:C,lang:R,criteria:ec,priceLimit:tc?.value,pathName:L,isLocationPage:"LOCATION"===r||"SUB_LANDING"===r});if(1===ec.page&&1===ec.tier){let t="LISTING"===r&&"peek"===eX.current?`${e}&view=map`:e;O.replace(t,{scroll:!1})}}if(!n.date){Q(!1);return}let o={region:C,lang:R,criteria:n,page:ec.page,type:r};eC&&(o.locationGroup=n.group||eA);try{e=await (0,ei.Ju)(o)}catch(e){Q(!1),(0,u.A)(S("error.err_occurred"));return}if(e.next?(et.current={page:1,tier:e.next.tier},q(!0)):(et.current={page:ec.page+1,tier:et.current?.tier}
1,q(Math.ceil(e.total/N.mo.HITS_PER_PAGE_BATCH_WEB)>ec.page)),e.spaces&&e.spaces.length>0){let t=e.spaces,n=t.map(e=>e.id);e.next&&t.push(e.next),(H<=0||1===ec.page&&1===ec.tier)&&$(e.total),1===ec.page&&1===ec.tier?(G(t),ee.current=[...new Set(n)],"LISTING"!==r||(eJ.current?eJ.current=!1:"peek"===eX.current||ec.isSilentSearch||e5("full",!0))):(G(e=>[...e,...t]),ee.current=[...new Set([...ee.current,...n])]),e$()}else if(e.spaces&&e.spaces.length<=0&&1===ec.page&&1===ec.tier){G([]),$(0),Q(!1);return}let c={...e.metadata};e["X-Request-Schema-Version"]&&(c["X-Request-Schema-Version"]=e["X-Request-Schema-Version"]),e_({analyticsObj:c,store:eo,criteria:ec,priceLimitValue:tc?.value,globalSpace:eS,variant:P,posthog:D,t:S,resetPrevRouteData:eN}),Q(!1)};(0,o.useEffect)(()=>{if(!en.current){if(B){et.current={page:2,tier:1},ee.current=k.hits.map(e=>e.id).filter(Boolean);let e=Math.max(tl?.timestamp??Date.now(),Date.now()),{dispatchPayload:t,replacePath:n,dateRolled:a,dateToast:s}=(0,X.oK)({pathParams:T,searchParams:E,criteria:ec,nowTimestamp:tl?.timestamp,effectiveNow:e,rawUrlDate:E.get(X._B.DATE),querySuggestion:g,type:r,region:C,lang:R,priceLimit:tc?.value,pathName:L,mapViewInit:eJ.current});a&&(er.current=!1),"today_ended"===s&&(0,u.A)(S("search_bar.today_ended"),{id:eU}),eu(t),n&&O.replace(n,{scroll:!1})}else td()}return()=>{en.current,eu(x.xQ),eb(y.mC),en.current=!0}},[]),(0,o.useEffect)(()=>{ec.isImmediateSearch&&!z&&(Q(!0),eQ.current=!0,1!==ec.tier||1!==ec.page||ec.isSilentSearch||G([]),ec.isSilentSearch||ej({source:"LISTING"}),td(),eu({isImmediateSearch:!1}))},[ec.isImmediateSearch,ec.page,ec.tier,z,C,L,tc?.value,tl?.timestamp,O,eu]),(0,o.useEffect)(()=>{if(!ec.date&&!B){let e=(0,X.xU)(T,E,x.xQ,tl?.timestamp,g);eO&&e.group!==eO&&(e.group=eO),eu(e)}},[]),(0,o.useEffect)(()=>{if(el.current){el.current=!1;return}if(!ts?.timestamp)return;let e=(0,_.tg)(ts.timestamp,C),t=eo.get(x.mN);t&&t<e?(eu({date:e,isImmediateSearch:!0,page:1,tier:1,prevIds:[]}),t<(0,j.SP)(ts.timestamp,C)&&(0,u.A)(S("search_bar.past_date_redirected"))):(ee.current=[],eu({isImmediateSearch:!0,page:1,tier:1,prevIds:[]}))},[ts?.timestamp]),(0,o.useEffect)(()=>{let e=eo.get(x.YV),t=(0,_.tg)(tl?.timestamp??Date.now(),C);eb({spaceType:eT,date:ev(e.date,t),time:e.time,priceMode:ef(e.priceMode),...ex(e)})},[]),(0,o.useEffect)(()=>{if(!ec.isImmediateSearch)return;let e=(0,_.tg)(tl?.timestamp??Date.now(),C);eb({date:ev(ec.date,e),time:ec.time,priceRange:ec.priceRange,starRating:ec.starRating,amenities:ec.amenities,pax:ec.pax,duration:ec.duration,bookType:ec.bookType,paymentOption:ec.paymentOption,theme:ec.theme,priceMode:ef(ec.priceMode),...ex(ec)})},[ec.date,ec.time,ec.priceRange,ec.starRating,ec.amenities,ec.pax,ec.duration,ec.bookType,ec.paymentOption,ec.theme,ec.suggestionId,ec.suggestionCategory,ec.query,ec.querySource,ec.mapLatLng,ec.isImmediateSearch,ec.priceMode]);let tw=(0,n.jsx)(eB,{totalHits:H,searchOptions:ta,results:F,type:r,loading:z,hasNextPage:Y,sentryRef:to,onMoreResults:eZ,skeletonGridClassName:"tw-grid tw-grid-cols-1 xl:tw-grid-cols-2 tw-gap-4 tw-px-4 tw-mt-2 lg:tw-mt-4"});return(0,n.jsxs)("div",{className:f,children:[("LOCATION"===r||"SUB_LANDING"===r)&&(0,n.jsxs)("div",{className:"lg:tw-hidden",children:[(0,n.jsxs)("div",{className:"tw-px-4 tw-pt-4 tw-pb-2",children:[(0,n.jsxs)("div",{className:"tw-bg-gray tw-rounded-xl tw-p-2 tw-flex tw-flex-col tw-gap-2",children:[(0,n.jsxs)("div",{className:"tw-flex tw-items-stretch tw-bg-[var(--themes-bg-default-white)] tw-border tw-border-[var(--themes-border-default)] tw-rounded-lg tw-pr-[2px] tw-py-[2px]",children:[(0,n.jsx)(h.Z,{type:r,searchOptions:ta,isMapSearch:!1,isMobile:!0,hideBorder:!0,className:"tw-flex-1 tw-min-w-0"}),(0,n.jsx)("button",{onClick:eV,className:"tw-py-[14px] tw-px-6 tw-bg-brand tw-text-brand-strong tw-flex tw-items-center tw-justify-center tw-border-0 tw-cursor-pointer tw-shrink-0 tw-rounded-[6px]","aria-label":"Search",children:(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M21 21L16.514 16.506M19 11C19 15.418 15.418 19 11 19C6.582 19 3 15.418 3 11C3 6.582 6.582 3 11 3C15.418 3 19 6.582 19 11Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),(0,n.jsxs)("button",{onClick:()=>O.push(`/${C}/${R}/${eS}`),className:"tw-flex tw-items-center tw-justify-center tw-gap-2 tw-bg-white tw-border tw-border-solid tw-border-[var(--themes-border-default)] tw-rounded-lg tw-h-[48px] tw-w-full tw-cursor-pointer tw-text-[var(--themes-text-title)]",children:[(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M9 20L3.553 17.276A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,n.jsx)("span",{className:"tw-text-[13px] tw-font-medium",children:S("list_results.view_on_map")})]})]}),eC&&(0,n.jsx)("div",{className:"tw-mt-3 tw-h-[16px] tw-flex tw-items-center",children:ek?eI?(0,n.jsx)("p",{className:"tw-text-xs tw-leading-[16
1px] tw-text-gold",children:S.rich("search_bar.location_group_browsing_hint",{locationGroupName:eI,b:e=>(0,n.jsx)("span",{className:"tw-underline tw-decoration-solid tw-font-medium [text-decoration-skip-ink:none]",children:e})})}):null:(0,n.jsx)("div",{className:"tw-h-full tw-w-full tw-max-w-[480px] tw-rounded skeleton-color tw-animate-pulse"})})]}),(0,n.jsxs)("div",{className:"tw-flex tw-flex-wrap tw-gap-3 tw-px-4 tw-py-2",children:[tu.map(e=>(0,n.jsx)(U,{remoteTime:tl,swiperType:e,isMapSearch:!1,type:r,isCenterModal:!0,className:"tw-bg-brand-subtle tw-text-brand-info tw-rounded-full tw-h-[40px] tw-px-4 tw-flex tw-items-center tw-gap-2 tw-text-[13px] tw-font-medium tw-whitespace-nowrap tw-shrink-0 tw-cursor-pointer"},e)),(0,n.jsx)(V,{searchOptions:ta,type:r,section:"SEARCH_RESULT_BAR",isMapSearch:!1,chipStyle:!0})]}),(0,n.jsx)("div",{className:"tw-px-4",children:tw})]}),"LISTING"===r&&(0,n.jsxs)("div",{className:"xl:tw-hidden",children:[(0,n.jsx)("div",{className:`tw-fixed tw-top-0 tw-left-0 tw-right-0 tw-z-0 ${"peek"===eY||ez?"tw-h-screen":"tw-h-[95dvh]"}`,children:e8&&(0,n.jsx)(ed,{remoteTime:tl,snapSheetPeekOnMapPan:!0})}),(0,n.jsx)("div",{ref:e3,"aria-hidden":!0,style:{height:e4}}),(0,n.jsxs)("div",{ref:e2,className:"tw-fixed tw-z-50 tw-bg-[var(--themes-bg-default-white)] tw-border-b tw-border-[var(--themes-border-light)] tw-shadow-[0_2px_4px_rgba(0,0,0,0.08)] tw-left-0 tw-w-full",style:{top:"var(--navbar-height)"},children:[(0,n.jsx)(Z,{remoteTime:tl,type:r,className:"tw-pb-3 tw-px-4 min-[810px]:tw-hidden"}),(0,n.jsx)("div",{className:"tw-hidden min-[810px]:tw-flex tw-items-center tw-py-3 tw-px-10",children:(0,n.jsx)(ew.default,{remoteTime:tl,searchOptions:ta,type:r})})]}),(0,n.jsx)("div",{ref:e0,style:{height:"calc(50dvh - (var(--navbar-height) + var(--listing-searchbar-height,56px)))"}}),(0,n.jsxs)("div",{ref:e1,"data-testid":"listing-results",className:"tw-relative tw-z-20 tw-bg-[var(--themes-bg-default-white)] tw-min-h-screen tw-px-4 tw-rounded-t-3xl",style:{marginTop:"calc(var(--navbar-height) - 26px)",paddingBottom:"max(1.5rem, calc(1.5rem + env(safe-area-inset-bottom)))",touchAction:"full"===eY?"pan-y":"none"},onTouchStart:e=>{"full"!==eX.current&&e6(e.touches[0].clientY)},onTouchMove:e=>{"full"!==eX.current&&e7(e.touches[0].clientY)},onTouchEnd:e=>{"full"!==eX.current&&e9(e.changedTouches[0].clientY)},children:[(0,n.jsx)("div",{className:"tw-flex tw-justify-center tw-items-center tw-h-6 tw-cursor-grab active:tw-cursor-grabbing",style:{touchAction:"none"},onTouchStart:e=>e6(e.touches[0].clientY),onTouchMove:e=>e7(e.touches[0].clientY),onTouchEnd:e=>e9(e.changedTouches[0].clientY),children:(0,n.jsx)("div",{className:"tw-w-14 tw-h-1.5 tw-bg-gray-secondary tw-rounded-full"})}),tw]})]}),(0,n.jsxs)("div",{className:`tw-hidden ${"LISTING"===r?"xl:tw-flex":"lg:tw-flex"} tw-flex-row tw-items-start tw-max-w-[1920px] tw-mx-auto tw-w-full ${"LISTING"===r?"tw-bg-white dark:tw-bg-transparent xl:tw-px-10 2xl:tw-px-0 tw-py-10":""}`,children:["LISTING"!==r&&(0,n.jsx)(J,{searchOptions:ta,remoteTime:tl,className:"tw-flex-shrink-0 tw-sticky tw-top-0 tw-h-screen",type:r}),(0,n.jsxs)("div",{className:`${"LISTING"!==r?"tw-w-full":ey?"tw-w-0 tw-opacity-0 tw-overflow-hidden tw-transition-all tw-duration-300 tw-ease-out":"tw-w-[60%] tw-max-w-[896px] tw-shrink-0 tw-transition-all tw-duration-300 tw-ease-out"} tw-rounded-t-2xl lg:tw-rounded-none tw-bg-white dark:tw-bg-card dark:lg:tw-bg-transparent ${"SUB_LANDING"===r?"":"LISTING"===r?"":"tw-pt-4 tw-pb-4 lg:tw-pt-0 tw-px-4 lg:tw-px-0"}`,children:["LISTING"!==r&&(0,n.jsx)("div",{className:"tw-bg-gray tw-rounded-xl lg:tw-rounded-2xl tw-mb-4 tw-py-2 tw-px-2 lg:tw-mb-0 lg:tw-mt-4 lg:tw-mx-4 lg:tw-px-20 lg:tw-py-8",children:(0,n.jsx)(em.default,{type:r,region:C,lang:R,spaceType:eT,searchOptionsData:ta,locationGroup:eA,handleSearchClicked:eV,handleDisableSearch:eK})}),"LOCATION"===r&&(0,n.jsx)("div",{className:"tw-flex lg:tw-hidden tw-text-nowrap tw-overflow-auto tw-items-center tw-justify-start tw-mt-3 lg:tw-mt-0 scrollbar-hidden tw-mb-10",children:tu.map(e=>(0,n.jsx)(U,{remoteTime:tl,swiperType:e,isMapSearch:!1,type:r,className:"swiper-card card-border tw-rounded-full tw-py-1.5 tw-px-3 tw-mr-1.5 tw-text-black"},e))}),(0,n.jsx)(eB,{totalHits:H,searchOptions:ta,results:F,type:r,loading:z,hasNextPage:Y,sentryRef:to,onMoreResults:eZ,skeletonGridClassName:"tw-block lg:tw-grid lg:tw-grid-cols-2 lg:tw-gap-4 lg:tw-px-4 tw-mt-2 lg:tw-mt-4"})]}),"LISTING"===r&&(0,n.jsx)("div",{className:`tw-flex-1 tw-min-w-0 tw-sticky tw-overflow-hidden tw-bg-gray-secondary tw-rounded-3xl tw-transition-all tw-duration-300 tw-ease-out ${ey?"tw-top-0":"tw-top-[146px]"}`,style:{height:"calc(100vh - var(--navbar-height) - 40px - 16px)"},children:te&&(0,n.jsx)(ed,{remoteTime:tl,clearMarkerOnMapPan:!1,loadingPillTop:"1rem"})})]})]})}},6557:function(e,t,r){r.d(t,{Z:function(){return d}});var n=r(57437),a=r(2265),s=r(11362),i=r(32950),l=r(87897),o=r(41919),c=r(39399),u=r(30490);function d(e){let{isMapSearch:t=!1,handleSearchClicked:r,isSearchInput:d=!1,isShowButton:w=!0,spaceType:m="rest"}=e,p=(0,u.T)(),[h,g]=(0,a.useState)(!1),[f]=(0,s.KO)(o.G2),[x]=(0,s.KO)(c.t0),v=(0,s.b9)(o.YV),b=(0,s.b9)(c.AM),y=(0,s.b9)(l._l),_=(0,s.b9)(l.KH),j=(0,s.b9)(c.CB),N=e=>{h||(e.stopPropagation(),document.activeElement?.blur(),g(!0),navigator.geolocation.getCurrentPosition(e=>
1{g(!1),j({lat:e.coords.latitude,lng:e.coords.longitude}),t?b({isImmediateSearch:!0,mapLatLng:[e.coords.latitude,e.coords.longitude],query:p("search_bar.current_location")}):v({isImmediateSearch:!0,mapLatLng:[e.coords.latitude,e.coords.longitude],sortCriteria:"s_user_lat_long",query:p("search_bar.current_location")}),(0,i.A)(p("search_bar.current_location_in_use")),r&&r()},e=>{g(!1),y(!0),_({title:p("err"),message:1===e.code?p("error.loc_permission_web"):p("error.err_occurred")})},{enableHighAccuracy:!0,maximumAge:5e3}))},k=(0,a.useMemo)(()=>t&&x===p("search_bar.current_location")||!t&&f===p("search_bar.current_location"),[t,x,f,p]);return w?d?(0,n.jsxs)("div",{onClick:N,className:`tw-flex tw-items-center tw-bg-gray tw-rounded-lg tw-p-4 tw-gap-4 hover:tw-bg-brand-subtle ${h?"":"button-class"}`,children:[(0,n.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"tw-shrink-0 tw-text-[var(--themes-text-title)]",children:(0,n.jsx)("g",{transform:"translate(2 1)",children:(0,n.jsx)("path",{d:"M1.00002 10L20 1.00003L11 20L9.00002 12L1.00002 10Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,n.jsx)("span",{className:"tw-text-sm tw-font-medium tw-text-[var(--themes-text-title)]",children:"rest"===m?p("search_bar.find_hotels_near_me"):p("search_bar.find_workspaces_near_me")})]}):(0,n.jsx)("button",{disabled:h,onClick:N,className:`tw-flex tw-items-center tw-justify-center tw-w-10 tw-h-10 tw-rounded-full tw-border-0 tw-bg-transparent tw-cursor-pointer tw-p-2 hover:tw-bg-[var(--themes-bg-gray)] disabled:tw-opacity-50 disabled:tw-cursor-not-allowed ${k?"tw-bg-white-ground":""}`,"aria-label":"Open map search",children:h?(0,n.jsx)("span",{className:"tw-w-6 tw-h-6 tw-rounded-full tw-border-2 tw-border-[var(--color-white-ground-hex)] tw-border-t-transparent tw-animate-spin tw-block"}):(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`tw-w-5 tw-h-5 ${k?"tw-text-[var(--color-gold-hex)]":"tw-text-[var(--color-black-hex)]"}`,children:(0,n.jsx)("path",{d:"M3.7 13C2.03377 13.6353 1 14.5205 1 15.4997C1 17.4329 5.02944 19 10 19C14.9706 19 19 17.4329 19 15.4997C19 14.5205 17.9662 13.6353 16.3 13M10 7H10.01M16 7C16 11.0637 11.5 13 10 16C8.5 13 4 11.0637 4 7C4 3.68629 6.68629 1 10 1C13.3137 1 16 3.68629 16 7ZM11 7C11 7.55228 10.5523 8 10 8C9.44772 8 9 7.55228 9 7C9 6.44772 9.44772 6 10 6C10.5523 6 11 6.44772 11 7Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}):null}},21156:function(e,t,r){r.r(t),r.d(t,{default:function(){return y}});var n=r(57437),a=r(2265),s=r(11362),i=r(30490),l=r(48473),o=r(45714),c=r(97352),u=r(37054),d=r(95696),w=r(41919),m=r(72301),p=r(97075),h=r(67512),g=r(3113);function f(e){let{type:t,className:r=""}=e,a=(0,i.T)(),l=(0,m.useRouter)(),{region:o,lang:c}=(0,m.useParams)(),f=(0,m.usePathname)(),x=(0,s.Dv)(w.YV);return(0,n.jsxs)("div",{onClick:()=>{(0,u.D$)({page:t,name:"MAP_PILL_BUTTON"});let e={...x,date:x.date||(0,h.tg)(Date.now(),o),time:x.time?.periodType?x.time:{...x.time,periodType:g.TI.ANY_CHECK_IN_TIME}},r=(0,p.b$)({region:o,lang:c,criteria:e,pathName:f});l.push(`${r}&view=map`)},className:`tw-flex tw-items-center tw-justify-center md:tw-justify-start tw-gap-2 tw-px-4 tw-py-[14px] md:tw-p-4 tw-mt-3 md:tw-mt-0 md:tw-ml-4 tw-border-solid tw-border-default tw-border-[1px] tw-rounded-lg md:tw-rounded-xl tw-cursor-pointer tw-bg-gray hover:tw-bg-gray-secondary active:tw-scale-[0.97] tw-transition tw-duration-150 ${r}`,children:[(0,n.jsx)(d.X,{className:"tw-w-4 tw-h-4 md:tw-w-6 md:tw-h-6"}),(0,n.jsx)("div",{className:"tw-whitespace-nowrap tw-text-xs tw-leading-4 md:tw-text-sm md:tw-leading-[18px] tw-font-medium tw-text-flow-foreground",children:a("list_results.view_on_map")})]})}var x=r(59864),v=r(26141),b=r(10600);function y(e){let{type:t,spaceType:r,searchOptionsData:u,handleDisableSearch:d,handleSearchClicked:p,locationGroup:h}=e,g=(0,i.T)(),{region:y,lang:_}=(0,m.useParams)(),[j]=(0,s.KO)(w.xR),N="HOME"===t?j:r,k=(0,m.useSearchParams)(),S=(0,s.Dv)(b.fX),T=(0,s.Dv)(w.lX);h=k.get("group")||(0,v.Er)(x.FW.LOCATION_GROUP)||h||x.RI;let{data:C,mutate:R,error:I}=(0,l.n)({region:y,lang:_,spaceType:N,locationGroup:"my"===y?h:void 0,priceMode:T}),{data:E}=(0,o._)({region:y,spaceTypeKey:N,suggestionIDs:C?.placeholder?.animated}),L=C?{...C,searchBarSuggestions:E??C.searchBarSuggestions}:u??void 0,[M,O]=(0,a.useState)(void 0);return(0,a.useEffect)(()=>
1{if("my"!==y||!S?.groups?.length)return;let e=(0,v.xj)(S.groups,h);e&&O(e)},[y,S,h]),(0,n.jsxs)("div",{className:"tw-w-full",children:[(0,n.jsxs)("div",{className:"md:tw-flex tw-w-full",children:[(0,n.jsx)("div",{className:"tw-flex tw-items-center tw-w-full",children:(0,n.jsx)(c.Z,{searchOptions:L,onSearch:p,handleDisableSearch:d,type:t})}),(0,n.jsx)(f,{type:t})]}),"my"===y&&(0,n.jsx)("div",{className:"tw-mt-4 tw-h-[16px] md:tw-h-[18px] tw-flex tw-items-center",children:M?(0,n.jsx)("p",{className:"tw-text-xs tw-leading-[16px] md:tw-text-sm md:tw-leading-[18px] tw-text-gold",children:g.rich("search_bar.location_group_browsing_hint",{locationGroupName:M,b:e=>(0,n.jsx)("span",{className:"tw-underline tw-decoration-solid tw-font-medium [text-decoration-skip-ink:none]",children:e})})}):(0,n.jsx)("div",{className:"tw-h-full tw-w-full tw-max-w-[480px] md:tw-max-w-[600px] tw-rounded skeleton-color tw-animate-pulse"})})]})}},33004:function(e,t,r){r.d(t,{$F:function(){return o},AW:function(){return c},VD:function(){return d},Xi:function(){return u},h_:function(){return l}});var n=r(57437),a=r(2265),s=r(65330),i=r(89595);let l=s.fC,o=s.xz;s.ZA,s.Uv;let c=a.forwardRef((e,t)=>{let{className:r,sideOffset:a=4,...l}=e;return(0,n.jsx)(s.Uv,{children:(0,n.jsx)(s.VY,{ref:t,sideOffset:a,className:(0,i.cn)("tw-z-[1400] tw-min-w-[8rem] tw-overflow-hidden tw-rounded-card tw-border tw-border-flow-border tw-bg-flow-background tw-p-2 tw-text-flow-foreground tw-shadow-md tw-duration-200 data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out data-[state=closed]:tw-fade-out-0 data-[state=open]:tw-fade-in-0 data-[state=closed]:tw-zoom-out-95 data-[state=open]:tw-zoom-in-95 data-[side=bottom]:tw-slide-in-from-top-2 data-[side=left]:tw-slide-in-from-right-2 data-[side=right]:tw-slide-in-from-left-2 data-[side=top]:tw-slide-in-from-bottom-2",r),...l})})});c.displayName=s.VY.displayName;let u=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(s.ck,{ref:t,className:(0,i.cn)("tw-relative tw-flex tw-cursor-pointer tw-select-none tw-items-center tw-rounded-chip tw-px-3 tw-py-2 tw-text-sm tw-font-medium tw-outline-none focus:tw-bg-flow-muted focus:tw-text-[var(--flow-foreground)] data-[disabled]:tw-pointer-events-none data-[disabled]:tw-opacity-50",r),...a})});u.displayName=s.ck.displayName;let d=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(s.Z0,{ref:t,className:(0,i.cn)("tw-mx-3 tw-my-2 tw-h-px tw-bg-flow-border",r),...a})});d.displayName=s.Z0.displayName},13430:function(e,t,r){r.d(t,{HG:function(){return a},PS:function(){return l},SU:function(){return s},wK:function(){return i}});var n=r(39959);let a=(0,n.cn)(""),s=(0,n.cn)(""),i=(0,n.cn)(!1),l=(0,n.cn)(!1)},87897:function(e,t,r){r.d(t,{KH:function(){return i},Lt:function(){return l},_l:function(){return s}});var n=r(39959),a=r(29327);let s=(0,n.cn)(!1),i=(0,n.cn)({title:"",message:"",buttons:[],contentType:a.U2.GENERIC,type:"",additionalBtnText:"",id:0}),l=(0,n.cn)("")},85145:function(e,t,r){r.d(t,{D:function(){return a}});var n=r(2265);let a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:767,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],[r,a]=(0,n.useState)(t);return(0,n.useEffect)(()=>{if(!window.matchMedia)return;let t=window.matchMedia(`(max-width: ${e}px)`),r=()=>a(t.matches);return r(),t.addEventListener("change",r),()=>t.removeEventListener("change",r)},[e]),r}},45714:function(e,t,r){r.d(t,{_:function(){return s}});var n=r(6473),a=r(37233);function s(e){let{region:t,spaceTypeKey:r,suggestionIDs:s}=e,i=s?.length?s.join(","):null;return(0,n.ZP)(i,async()=>(await (0,a.Tz)({region:t,algoliaIndex:(0,a.mb)(t,r,"PROD"),suggestionIDs:s??[]})).hits,{revalidateOnFocus:!1,revalidateOnReconnect:!1,revalidateIfStale:!1,keepPreviousData:!0})}},11082:function(e,t,r){r.d(t,{Z:function(){return n}});let n=(0,r(28015).Z)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},37054:function(e,t,r){r.d(t,{$0:function(){return b},AV:function(){return g},Bq:function(){return A},Cg:function(){return p},Ci:function(){return E},D$:function(){return G},DV:function(){return y},Du:function(){return O},GH:function(){return k},K2:function(){return M},Nm:function(){return _},OA:function(){return x},Oo:function(){return L},RC:function(){return N},RG:function(){return m},Tv:function(){return u},VB:function(){return U},W$:function(){return C},ZF:function(){return $},_C:function(){return D},cG:function(){return P},h6:function(){return o},hF:function(){return c},ko:function(){return j},od:function(){return B},ok:function(){return f},pG:function(){return w},pJ:function(){return h},r9:function(){return T},s3:function(){return H},sV:function(){return i},tM:function(){return R},tN:function(){return S},tQ:function(){return l},v8:function(){return F},w9:function(){return d},wB:function(){return I},xd:function(){return v}});let n=null,a=()=>n??=Promise.all([r.e(7081),r.e(2732),r.e(7958),r.e(4442),r.e(6141),r.e(450),r.e(1741)]).then(r.bind(r,90450)),s=e=>function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return a().then(t=>t[e](...r))},i=s("sendSignUp"),l=s("sendLogin"),o=s("sendViewBlog"),c=s("sendViewBlogList"),u=s("sendViewOfferArticles"),d=s("sendViewCurrentOffersList"),w=s("sendAddToWishList"),m=s("sendViewSearchResults"),p=s("sendUserActiveSearch"),h=s("sendApplyQuickFilter"),g=s("sendViewItem"),f=s("sendDownloadAppClicked"),x=s("sendSelectCheckInDate"),v=s("sendSelectBookingLength"),b=s("sendSelectCheckInTime"),y=s("sendSelectCheckOutTime"),_=s("sendSelectPurchaseOption"),j=s("sendSelectBookType"),N=s("sendOpenStayFilter"),k=s("sendApplyStayFilter"),S=s("sendClearStayFilter"),T=s("sendSelectStayRow"),C=s("sendAddPaymentInfo"),R=s("sendBeginCheckout"),I=s("sendEcommercePurchase");s("sendFeedSpaceFilter");let E=s("sendCancelBooking");s("sendChatbotButtonClicked");let L=s("sendOvernightBtnClicked"),M=s("sendSocialShareClicked"),O=s("sendSort"),A=s("sendPopularCheckInTimeButtonClicked"),P=s("sendViewBookingSummary"),D=s("sendBookCtaBlocked");s("sendCheckoutViewed"),s("sendPaymentMethodSelected"),s("sendPaymentSubmitted");let B=s("sendCheckoutError"),F=s("sendPaymentRetry"),G=s("sendViewMap"),U=s("sendScrollPhotos"),H=s("sendViewPhotos"),$=s("sendRedeemPerk")},69373:function(e,t,r){r.d(t,{ir:function(){return l},mj:function(){return i}});let n=!1,a=e=>{n||(n=!0,console.warn("[history] the browser is throttling history writes; the address bar may lag the page until it settles",e))},s=e=>{try{let t=new URL(e,window.location.href);return t.pathname+t.search+t.hash}catch{return null}},i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=s(e),n=window.location.pathname+window.location.search+window.location.hash;if(null!==r&&r===n)return!1;try{return window.history.replaceState(void 0===t?window.history.state:t,"",e),!0}catch(e){return a(e),!1}},l=(e,t)=>
1{try{return window.history.pushState(e,"",t),!0}catch(e){return a(e),!1}}},32950:function(e,t,r){let n,a;r.d(t,{A:function(){return u}});let s=new Set(["Error occurred, please try again later.","發生錯誤,請稍後再試。","发生错误,请稍後再试。","Ralat berlaku, sila cuba sebentar lagi."]),i=(e,t)=>{"string"==typeof e&&s.has(e)&&Promise.all([r.e(7081),r.e(2732),r.e(7958),r.e(4442),r.e(6141),r.e(450),r.e(6074)]).then(r.bind(r,90450)).then(r=>r.sendMeaninglessError({surface:"toast",message:e,contentType:t?.type,page:window.location.pathname})).catch(()=>{})},l=[],o=()=>{if(n)for(;l.length;){let[e,t]=l.shift();try{n(e,t)}catch{}}},c=()=>a||(a=r.e(7805).then(r.bind(r,7805)).then(e=>(n=e.toast,o(),n))),u=(e,t)=>{if(i(e,t),n){n(e,t);return}l.push([e,t]),c()}},79775:function(e,t,r){r.d(t,{u:function(){return n}});function n(e,[t,r]){return Math.min(r,Math.max(t,e))}},82253:function(e,t,r){r.d(t,{D:function(){return a}});var n=r(2265);function a(e){let t=n.useRef({value:e,previous:e});return n.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}},12577:function(e,t,r){let n;r.d(t,{Z:function(){return c}});var a=r(2265),s=[0],i=(n=new Map,{getObserver:function({root:e,rootMargin:t,threshold:r}){let a=n.get(e);a||(a=new Map,n.set(e,a));let s=JSON.stringify({rootMargin:t,threshold:r}),i=a.get(s);if(!i){let n=new Map;i={observer:new IntersectionObserver(e=>{e.forEach(e=>{n.get(e.target)?.(e)})},{root:e,rootMargin:t,threshold:r}),entryCallbacks:n},a.set(s,i)}return{observe:(e,t)=>{i.entryCallbacks.set(e,t),i.observer.observe(e)},unobserve:e=>{i.entryCallbacks.delete(e),i.observer.unobserve(e)}}}}),l=function(e){let t=e?.rootMargin??"0px",r=e?.threshold??s,n=(0,a.useRef)(null),l=(0,a.useRef)(null),o=(0,a.useRef)(null),[c,u]=(0,a.useState)(),d=(0,a.useCallback)(()=>{let e=n.current;if(!e){u(void 0);return}let a=i.getObserver({root:l.current,rootMargin:t,threshold:r});a.observe(e,e=>{u(e)}),o.current=a},[t,r]),w=(0,a.useCallback)(()=>{let e=o.current,t=n.current;t&&e?.unobserve(t),o.current=null},[]);return[(0,a.useCallback)(e=>{w(),n.current=e,d()},[d,w]),{entry:c,rootRef:(0,a.useCallback)(e=>{w(),l.current=e,d()},[d,w])}]},o=function(e){let[t,r]=l(e),n=!!r.entry?.isIntersecting,[s,i]=(0,a.useState)(n);return n&&!s&&i(!0),[t,{...r,isVisible:n,wasEverVisible:s}]},c=function({loading:e,hasNextPage:t,onLoadMore:r,rootMargin:n,disabled:s,delayInMs:i=100}){let l=(0,a.useRef)(r),[c,{rootRef:u,isVisible:d}]=o({rootMargin:n});(0,a.useEffect)(()=>{l.current=r},[r]);let w=!s&&!e&&d&&t;return(0,a.useEffect)(()=>{if(w){let e=setTimeout(()=>{l.current()},i);return()=>{clearTimeout(e)}}},[w,i]),[c,{rootRef:u}]}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.