1"use strict";(self.webpackChunklib=self.webpackChunklib||[]).push([[5267],{72874(t,s,i){i.r(s),i.d(s,{default:()=>c});var a=i(60842),e=i.n(a),r=i(79244),o=(i(28981),i(74692)),p=Math.floor(travel.opts.theme/100);class c{constructor(){if("map_districts"==travel.opts.page)this.city_id=travel.opts.c_id,this.mobilePopupContainer=o(".js-districts-mobile-popup"),this.zoomInitLvl=travel.isMobile()?9:9.7,this.mapParams={container:"districts-map",zoom:this.zoomInitLvl,minZoom:1,maxZoom:20,center:[travel.opts.map_params.long,travel.opts.map_params.lat],customAttribution:['<a href="https://www.openmaptiles.org/" target="_blank">© OpenMapTiles</a>'],style:"/map-styles/"+p+"/map-style.json",bearing:0,transformRequest:function(t,s){var i=t;return"Tile"===s&&-1!==t.indexOf("/tiles-data/map3/")?i=location.origin+t:"SpriteJSON"!==s&&"SpriteImage"!==s||-1===t.indexOf("/maps-data/mapboxgl/sprite")||(i=t.replace("https://",location.origin+"/")),{url:i}}},this.map=null,this.hoveredStateId=null,this.langCode=travel.opts.lang,this.getDistricts();else{if(this.landmarksElements=o('.js-district-landmarks span[class^="data-land-id-"]'),this.landmarksIds=[],0==this.landmarksElements.length)return!1;this.getDistrictLandmarkData()}}getDistrictLandmarkData(){this.landmarksElements.each((t,s)=>{var i=o(s).attr("class").replace("data-land-id-","");this.landmarksIds.push(i)});var t={ids:this.landmarksIds.join(","),lang_id:travel.opts.lang_id,ui:travel.options.uuid,top:travel.options.nid};o.ajax({data:t,method:"get",url:"/geo-data/landmarks/api/landmarkinfo"}).then(t=>{this.createLandmarksPopup(t)}).fail(function(t){travel.log(t)})}createLandmarksPopup(t){this.landmarksElements.each((s,i)=>{var a=o(i).attr("class").replace("data-land-id-",""),e=t.features.filter(t=>t.id==a);if(e[0].properties.PhotoUrl){o(i).addClass("is-landmark-active");var r=e[0].properties.PhotoUrl,p="",c="";e[0].properties.CategoryDesc?(p=this.sliceLandmarkDescription(e[0].properties.CategoryDesc.split("|")[0]),c='<div class="district-popup__desc">'.concat(p,"</div>")):e[0].properties.shortDesc?(p=this.sliceLandmarkDescription(e[0].properties.shortDesc.split("|")[0]),c='<div class="district-popup__desc">'.concat(p,"</div>")):e[0].properties.Desc?(p=this.sliceLandmarkDescription(e[0].properties.Desc.split("|")[0]),c='<div class="district-popup__desc">'.concat(p,"</div>")):e[0].properties.TagNames&&(p=e[0].properties.TagNames.split("|"),c='<div class="district-popup__tag">\n '.concat(p[0],"\n </div>"),c='<div class="district-popup__tags">'.concat(c,"</div>"));var n='<div class="district-single__district-popup district-popup js-district-popup">\n <img class="district-popup__img" src="'.concat(r,'" loading="lazy"></img>\n ').concat(c,"\n </div>\n </div>");this.createLandmarkTooltip(i,n)}})}sliceLandmarkDescription(t){if(t.length<125)return t;var s=(t=t.slice(0,125)).slice(-1);return" "!=s&&"."!=s&&","!=s||(t=t.slice(0,-1)),t+="..."}createLandmarkTooltip(t,s){(0,r.Ay)(t,{content:s,allowHTML:!0})}getDistricts(){var t={page:"districts",city_id:this.city_id,type:7,ui:travel.options.uuid};o.ajax({data:t,method:"get",url:"/geo-data/landmarks/"}).then(t=>{this.initMap(t)}).fail(function(t){travel.log(t)})}initMap(t){var s=[];t.features.forEach(t=>{travel.opts.districts.forEach(i=>{t.properties.name.toLowerCase()==i.NameEng.toLowerCase()&&s.push(t)})}),this.map=new(e().Map)(this.mapParams),this.map.on("load",()=>{this.map.addSource("districts",{type:"geojson",data:{type:"FeatureCollection",features:s}}),this.addMapLayers(),this.mapEvents()})}addMapLayers(){this.map.addLayer({id:"districts-fills",type:"fill",source:"districts",layout:{},paint:{"fill-color":["case",["boolean",["feature-state","hover"],!1],"#f68059","#3c6780"],"fill-opacity":.15}}),this.map.addLayer({id:"districts-line",type:"line",source:"districts",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":["case",["boolean",["feature-state","hover"],!1],"#f68059","#3c6780"],"line-width":2}}),this.map.addLayer({id:"districts-name",type:"symbol",source:"districts",layout:{"text-field":"{name}","text-font":["Roboto Bold","Arial Unicode MS Bold"],"text-size":13},paint:{"text-color":"#242c4a"}})}mapEvents(){this.map.on("mousemove","districts-fills",t=>{this.map.getCanvas().style.cursor="pointer",t.features.length>0&&(this.hoveredStateId&&this.map.setFeatureState({source:"districts",id:this.hoveredStateId},{hover:!1}),this.hoveredStateId=t.features[0].id,this.map.setFeatureState({source:"districts",id:this.hoveredStateId},{hover:!0}))}),this.map.on("mouseleave","districts-fills",()=>{this.map.getCanvas().style.cursor="",this.hoveredStateId&&this.map.setFeatureState({source:"districts",id:this.hoveredStateId},{hover:!1}),this.hoveredStateId=null}),this.map.on("click","districts-fills",t=>{var s=t.lngLat,i=t.features[0].properties.name.toLowerCase();
1travel.opts.districts.forEach(t=>{if(t.NameEng.toLowerCase()===i&&t.TripnetDistrictDescription){var a=t.Name?t.Name:t.NameEng,r="";r=t.TripnetDistrictPhotos?'<img class="districts-popup__photo" src="'.concat(t.TripnetDistrictPhotos.DistrictPopup[0].Url,'" loading="lazy">'):'<div class="districts-popup__photo districts-popup__photo--no-photo"></div>';var o=t.TripnetDistrictDescription.PopupText,p=t.TripnetDistrictDescription.PopupShortText,c="/".concat(this.langCode,"/").concat(t.FilterUrl),n='<div class="districts-map__districts-popup districts-popup">\n <div class="districts-popup__header">\n <p class="districts-popup__place">'.concat(p,"</p>\n ").concat(r,'\n <h4 class="districts-popup__title">').concat(a,'</h4>\n </div>\n <div class="districts-popup__content">\n <p class="districts-popup__text">').concat(o,'</p>\n <a href="').concat(c,'" class="districts-popup__button">Explore hotels <span class="districts-popup__button--arrow"></span></a>\n </div>\n </div>');travel.isMobile()?this.mobilePopupContainer.html(n):new(e().Popup)({closeButton:!1,maxWidth:"300px"}).setLngLat(s).setHTML(n).addTo(this.map)}})})}}}}]);
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.