1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CJwkjRBo.js","./hePW80VL.js"])))=>i.map(i=>d[i]); 2import{r as e}from"./hePW80VL.js";import{u as t}from"./Dh9m5nLe.js";import{r as n}from"./DaZ_54tw.js";import{t as r}from"./HclGiUj8.js";import{n as i,t as a}from"./Bn6X1U7U.js";import{mi as o}from"#entry";import{t as s}from"./C1pt6JUw.js";import{n as c,r as l}from"./D6pwwZQU.js";var u=null,d=null;function f(){return u?Promise.resolve(u):(d||=r(()=>import(`./CJwkjRBo.js`).then(t=>e(t.t(),1)).then(e=>(u=e.default??e,u)),__vite__mapDeps([0,1]),import.meta.url),d)}function p(){if(!u)throw Error(`mapbox-gl not loaded yet â call loadMapboxGl() first`);return u}function m(e,t){t({type:`map-clickunder`,hid:e?.BcomID||!1,form:document.querySelector(`.js-avail-form`)});let n=e?.Url??e?.Link;n&&window.open(n,`_blank`,`noopener`)}function h(e,t){e?.flyTo({center:t,zoom:12})}function g(e,t){t||e?.zoomIn({essential:!0})}function _(e,t){t||e?.zoomOut({essential:!0})}function v(){let e=document.querySelector(`.vue-filtering`);if(!e)return;let t=[];for(let[n,r]of new FormData(e).entries())if(r){if(n===`n`&&!String(r).trim())return;t.push(`${n}=${r}`)}return t.join(`&`)}function y(e,t=1){return t?`${e}&part=${t}`:e}function b(e,t,n){if(t&&n)return`${e}&sort=${t}&order=${n}`;let r=new URLSearchParams(window.location.search);return r.has(`sort`)&&r.has(`order`)?`${e}&sort=${r.get(`sort`)}&order=${r.get(`order`)}`:`${e}&sort=Popularity&order=DESC`}function x(e){let t=v(),n=c().getSelectedFilters;if(Object.keys(n).length>0){let r=c().getFullFiltersList,i=new Set(Object.values(r).map(e=>e.attributes?.param||e.type).filter(Boolean));i.add(`st`);let a=[...new URLSearchParams(t||``)].filter(([e])=>!i.has(e)),o=e;return a.length&&(o+=`&`+a.map(([e,t])=>`${e}=${t}`).join(`&`)),Object.entries(n).forEach(([e,t])=>{t.forEach(t=>{o+=`&${e}=${encodeURIComponent(t)}`})}),o}let r=c().getFullFiltersList,i=new Set(Object.values(r).map(e=>e.attributes?.param||e.type).filter(Boolean));i.add(`st`);let a=[...new URLSearchParams(t||``)].filter(([e])=>!i.has(e)),o=e;a.length&&(o+=`&`+a.map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join(`&`));let s=new Set([...new URLSearchParams(t||``)].map(([e])=>e));return Object.values(r).forEach(e=>{if(!e.item)return;let t=e.attributes?.param||e.type;t&&!s.has(t)&&e.item.forEach(e=>{e.selected&&(o+=`&${t}=${encodeURIComponent(e.ID)}`)})}),o}function S(e,t,n){let r=n??(()=>{let e=t.getBounds();return{ne_lng:e._ne.lng,ne_lat:e._ne.lat,sw_lng:e._sw.lng,sw_lat:e._sw.lat}})();return`${e}&by_coordinates=1&ne_lng=${r.ne_lng}&ne_lat=${r.ne_lat}&sw_lng=${r.sw_lng}&sw_lat=${r.sw_lat}`}function C(e,t=0){let n=e.getContainer(),r=e.unproject([t,0]),i=e.unproject([n.clientWidth,n.clientHeight]);return{ne_lng:i.lng,ne_lat:r.lat,sw_lng:r.lng,sw_lat:i.lat}}function w(e,t){return t?`${e}&viewHotelID=${t}`:e}function T(e){return e.map(e=>({type:`Feature`,id:String(e.ID),geometry:{type:`Point`,coordinates:[Number(e.GeoLong),Number(e.GeoLat)]},properties:{hid:String(e.ID),min_rate:e.show_price??e.price??e.MinRateUSD??``,type:e.AccomodationType??`0`}}))}function E(e,t,n){let r=T(t);if(n){let e=r.findIndex(e=>e.id===n);e>0&&r.unshift(...r.splice(e,1))}for(let t of[`hotel_clusters`,`hotels`])e.getLayer(t)&&e.removeLayer(t),e.getSource(t)&&e.removeSource(t);let i=t.length>25;e.addSource(`hotel_clusters`,{type:`geojson`,data:{type:`FeatureCollection`,features:r},cluster:i,clusterRadius:30,clusterMaxZoom:14}),e.addLayer({id:`hotel_clusters`,type:`circle`,source:`hotel_clusters`,filter:[`!=`,`cluster`,!0],paint:{"circle-opacity":0,"circle-radius":10}}),e.addSource(`hotels`,{type:`geojson`,data:{type:`FeatureCollection`,features:r}}),e.addLayer({id:`hotels`,type:`circle`,source:`hotels`,paint:{"circle-opacity":0,"circle-radius":10}})}function D(e,t,n={top:60,bottom:60,left:60,right:60}){let r=t.filter(e=>e.GeoLong&&e.GeoLat&&Number(e.GeoLong)&&Number(e.GeoLat));if(!r.length)return;if(r.length===1){let t=r[0];t&&e.flyTo({center:[Number(t.GeoLong),Number(t.GeoLat)],zoom:15,duration:300,padding:n});return}let i=r.map(e=>Number(e.GeoLong)),a=r.map(e=>Number(e.GeoLat));e.fitBounds([[Math.min(...i),Math.min(...a)],[Math.max(...i),Math.max(...a)]],{padding:n,maxZoom:15,duration:300})}function O(e,t){if(!t)return e;let n=e.findIndex(e=>String(e.ID)===t);return n>0&&e.unshift(...e.splice(n,1)),e}function k(){let e=a(),r=o(),u=l(),d=c(),m=null,h=t(()=>[e.hotelList?.city?.CenterLon/1e6||0,e.hotelList?.city?.CenterLat/1e6||0]),g=t(()=>`${r.apiSiteUrl}/api-json/?page=hotellist_feed_json&langID=${r.langid}&limit_per_page=30&CityID=${e.hotelList?.city?.ID}&mapinfo_flag=1`),_=t(()=>Number(r.langid)===20||Number(r.langid)===29);function v(e){let t=s().getPopUrl(``,!1,e);setTimeout(function(){location.href=t},200)}async function C(e){return new(await(f())).Map({container:e,minZoom:8,maxZoom:20,zoom:12,center:h.value,style:`/map/styles/basic_detailed.json`,customAttribution:[`<
2a href="https://daylightmap.org/" target="_blank">DaylightMap</a>`],pitch:0,bearing:0})}async function T(t,r={}){r.skipLoader||u.setHotelsLoading(!0);try{let i=y(g.value,r.part??1);i=b(i,r.sort,r.order),i=x(i),i=S(i,t,r.bounds),i=w(i,r.activeHid);let o={_parent_wsluuid:a().parentWslUuid,glob_dom_id:a().mainInfo.Affiliate?.GlobalDomainID||``};e.availParams?.avail_id&&e.availParams?.avail_id!==``&&e.availParams?.avail_id>0&&e.availParams?.avail_id!==!0?o.avail=e.availParams?.avail_id:o.dates_empty=1;let s=await n(i,{params:o});if(s.WTS&&!s?.WTS.hotellist)return document.location.reload(),{hotels:void 0,total:``};let c=s?.WTS?.hotellist?.hotels,l=String(s?.WTS?.hotellist?.total??``),d=s?.WTS?.hotellist?.parts;return r.skipLoader||u.setMapFeedHotels(c),{hotels:c,total:l,parts:d}}catch(e){return console.error(`Map feed fetch failed:`,e),{hotels:void 0,total:``}}finally{r.skipLoader||u.setHotelsLoading(!1)}}function E(t){if(!Number(t))return`...`;let n=e.mainInfo.Currencies?.find(e=>e.attributes?.selected===`selected`)?.Symbol,r=Math.round(Number(t)).toString().replace(/\B(?=(\d{3})+(?!\d))/g,` `);return _.value?`${r} ${n}`:`${n} ${r}`}function D(e,t,n,r,i=!1){t.querySelectorAll(`.js-map-marker`).forEach(e=>e.remove());let a=new Set,o=e.querySourceFeatures(`hotels`).filter(e=>{let t=String(e.id);return!a.has(t)&&(a.add(t),!0)}),s={};e.querySourceFeatures(`hotel_clusters`).forEach(e=>{e.id!=null&&(s[String(e.id)]=!0)});let c=!1;for(let t of o){let a=t.geometry.coordinates,{hid:o,min_rate:l,type:u}=t.properties,d=String(o),f=String(u??`0`),m=E(l);r&&d===r&&(c=!0);let h=document.createElement(`div`);h.id=d,h.setAttribute(`data-hid`,d),h.setAttribute(`data-coords`,a.join(`,`)),h.setAttribute(`data-type`,f),!s[d]&&d!==n&&d!==r?(h.classList.add(`map-hotel-dot`,`map-hotel-dot-${f}`,`js-map-marker`),h.innerHTML=`<div class="inner-dot"></div><div class="inner-price">${m}</div>`):(h.classList.add(`map-hl__marker`,`map-hl__marker-${f}`,`js-map-marker`),i?(d==n&&h.classList.add(`current-active`),d==r&&h.classList.add(`hotel-from-active`)):(d==n&&h.classList.add(`current-active`,`active-animation`),d==r&&h.classList.add(`hotel-from-active`)),h.innerHTML=`<span class="map-hl__marker-label">${m}</span>`),new(p()).Marker({element:h,anchor:`bottom`}).setLngLat(a).addTo(e)}if(r&&!c){let t=u.currentHotel;if(t&&String(t.ID)===r&&t.GeoLong&&t.GeoLat){let a=[Number(t.GeoLong),Number(t.GeoLat)],o=t.show_price??t.price??t.MinRateUSD??``,s=String(t.AccomodationType??`0`),c=E(o),l=document.createElement(`div`);l.id=r,l.setAttribute(`data-hid`,r),l.setAttribute(`data-coords`,a.join(`,`)),l.setAttribute(`data-type`,s),l.classList.add(`map-hl__marker`,`map-hl__marker-${s}`,`js-map-marker`,`hotel-from-active`),r===n&&(l.classList.add(`current-active`),i||l.classList.add(`active-animation`)),l.innerHTML=`<span class="map-hl__marker-label">${c}</span>`,new(p()).Marker({element:l,anchor:`bottom`}).setLngLat(a).addTo(e)}}}function O(t,n=i(`ohotel_site.city_center_map`,e.data?.api_vocab)){if(t.getSource(`places`))return null;let r=h.value;t.addSource(`places`,{type:`geojson`,data:{type:`FeatureCollection`,features:[{type:`Feature`,geometry:{type:`Point`,coordinates:r},properties:{}}]}}),t.addLayer({id:`places`,type:`circle`,source:`places`,paint:{"circle-radius":0,"circle-opacity":0}});let a=document.createElement(`div`);return a.className=`city-center__marker js-city-center-marker`,a.innerHTML=`<div class="city-center__label">${n||`City centre`}</div><div class="city-center__dot-wrap"><span class="city-center__ring"></span><span class="city-center__dot"></span></div>`,new(p()).Marker({element:a,anchor:`bottom`}).setLngLat(r).addTo(t),a}function k(e){u.setDisableMaxZoom(e.getZoom()>=e.getMaxZoom()),u.setDisableMinZoom(e.getZoom()<=e.getMinZoom())}function A(e){let t={1:{name:i(`b_city_right_xsl.rating_5`)||``,label:`5+`,classLabel:`filter-item__rating-level_one`},2:{name:i(`b_hotellist_left_xsl.nice_filters_new`)||``,label:`6+`,classLabel:`filter-item__rating-level_two`},3:{name:i(`b_hotellist_left_xsl.vgood_filters_new`)||``,label:`7+`,classLabel:`filter-item__rating-level_three`},4:{name:i(`b_hotellist_left_xsl.great_filters_new`)||``,label:`8+`,classLabel:`filter-item__rating-level_four`},5:{name:i(`b_hotellist_left_xsl.perfect_filters_new`)||``,label:`9+`,classLabel:`filter-item__rating-level_five`}}[e.ID];return t&&(e.Name=t.name,e.label=t.label,e.classLabel=t.classLabel),e}function j(e,t){let n={};
2return e.forEach(e=>{if(!t[e])return;let r=t[e];r.type=e,r.selectedCount=0,r.isSingle=!r.item||r.item.length<2,r.item&&(r.item.forEach(e=>{e.selected&&r.selectedCount++}),e===`Rating`&&(r.item=r.item.map(A))),n[e]=r}),n}function M(e){let t=e?.hotellist?.filters;if(!t)return;let n=j([`Stars`,`Rating`,`TypeID`],t);t.SubTypeID?.item&&n.TypeID&&(Array.isArray(t.SubTypeID.item)?t.SubTypeID.item:[t.SubTypeID.item]).map(e=>({...e,SubTypeID:!0})).forEach(e=>{let t=n.TypeID.item?.findIndex(t=>t.ID===e.ID);t>=0?n.TypeID.item[t]=e:(n.TypeID.item??=[]).push(e)});let r=j([`Stars`,`Rating`,`TypeID`,`Price`,`MetroID`,`LandmarkID`,`DistrictID`,`AirportID`,`AmenityID`,`FacilityID`,`BrandID`],t);d.setFilters(n),d.setFullFiltersList(r)}function N(t){t?.WTS?.hotellist?.hotels&&e.setHotelsList(t.WTS.hotellist.hotels)}async function P(t){m&&m.abort(),m=new AbortController;let i=e.hotelList?.city?.ID||``,a=e.hotelList?.city?.URL||``,o=m.signal,s=`${r.apiSiteUrl}${r.fullLangCodeForUrl}api-json/?hotellist_filters=1&page=hotellist_filters&CityID=${i}&${t}`;r.langid&&(s+=`&langID=${r.langid}`);let c=`${r.apiSiteUrl}${r.fullLangCodeForUrl}api-json/?page=hotellist_lite_json&CityID=${i}&wait=1&${t}`;r.langid&&(c+=`&langID=${r.langid}`),a&&(c+=`&cityUrl=${encodeURIComponent(a)}`);let l=t?`${window.location.pathname}?${new URLSearchParams(t).toString()}`:window.location.pathname;window.history.pushState({},``,l);try{let[e,t]=await Promise.all([n(s,{signal:o}),n(c,{signal:o})]);M(e),N(t)}catch(e){e?.name!==`AbortError`&&console.error(`filter API failed:`,e)}}return{hlCenter:h,isRtl:_,callHotelMapClickunder:v,createMap:C,fetchFeedHotels:T,formatPrice:E,renderHotelMarkers:D,addCityCenter:O,syncZoomState:k,submitWithFiltersAPI:P}}export{E as a,g as c,f as d,h as i,_ as l,D as n,m as o,C as r,O as s,k as t,p as 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.