PageSourceSearch

https://www.betreut-wohnen.de/wp-content/themes/my-listing/assets/dist/maps/mapbox/mapbox.js?ver=2.1.5

js betreut-wohnen.de collected 2026-10-05 03:00:50 UTC 38,286 bytes, 3 lines download raw bytes

1!function(t){"function"==typeof define&&define.amd?define("mapbox",t):t()}(function(){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t){if(t=Object.assign({},t),!(this instanceof i))throw new Error("MapboxLanguage needs to be called with the new keyword");this.setLanguage=this.setLanguage.bind(this),this._initialStyleUpdate=this._initialStyleUpdate.bind(this),this._defaultLanguage=t.defaultLanguage,this._isLanguageField=t.languageField||/^\{name/,this._getLanguageField=t.getLanguageField||function(t){return"mul"===t?"{name}":"{name_"+t+"}"},this._languageSource=t.languageSource||null,this._languageTransform=t.languageTransform||function(t,e){return"ar"===e?function(t){var e=t.layers.map(function(t){if(!(t.layout||{})["text-field"])return t;return Object.assign({},t,{layout:Object.assign({},t.layout,{"text-letter-spacing":0})})});return Object.assign({},t,{layers:e})}(t):function(t){var e=t.layers.map(function(t){if(!(t.layout||{})["text-field"])return t;var e=0;return"state_label"===t["source-layer"]&&(e=.15),"marine_label"===t["source-layer"]&&(/-lg/.test(t.id)&&
1(e=.25),/-md/.test(t.id)&&(e=.15),/-sm/.test(t.id)&&(e=.1)),"place_label"===t["source-layer"]&&(/-suburb/.test(t.id)&&(e=.15),/-neighbour/.test(t.id)&&(e=.1),/-islet/.test(t.id)&&(e=.01)),"airport_label"===t["source-layer"]&&(e=.01),"rail_station_label"===t["source-layer"]&&(e=.01),"poi_label"===t["source-layer"]&&/-scalerank/.test(t.id)&&(e=.01),"road_label"===t["source-layer"]&&(/-label-/.test(t.id)&&(e=.01),/-shields/.test(t.id)&&(e=.05)),Object.assign({},t,{layout:Object.assign({},t.layout,{"text-letter-spacing":e})})});return Object.assign({},t,{layers:e})}(t)},this._excludedLayerIds=t.excludedLayerIds||[],this.supportedLanguages=t.supportedLanguages||["ar","en","es","fr","de","ja","ko","mul","pt","ru","zh"]}function p(t,e,i,o){return e.layout&&e.layout["text-field"]&&-1===o.indexOf(e.id)?Object.assign({},e,{layout:Object.assign({},e.layout,{"text-field":function(e,t,i){if(function(t,e){return"string"==typeof e&&t.test(e)}(e,t))return i;if(function(e,t){return t.stops&&0<t.stops.filter(function(t){return e.test(t[1])}).length}(e,t)){var o=t.stops.map(function(t){return e.test(t[1])?[t[0],i]:t});return Object.assign({},t,{stops:o})}return t}(t,e.layout["text-field"],i)})}):e}function n(t){var e=navigator.languages?navigator.languages[0]:navigator.language||navigator.userLanguage,i=e.split("-"),o=e;return 1<i.length&&(o=i[0]),-1<t.indexOf(o)?o:null}var t,e;MyListing.Maps={options:{locations:[],zoom:12,minZoom:0,maxZoom:30,skin:"skin1",marker_type:"basic",gestureHandling:"greedy",cluster_markers:!0,draggable:!0,scrollwheel:!1},instances:[],skins:[],init:function(){},getInstance:function(e){var t=MyListing.Maps.instances.filter(function(t){return t.id==e});return!(!t||!t.length)&&t[0]}},jQuery(function(n){n('.form-location-autocomplete, input[name="job_location"], input[name="_job_location"]').each(function(t,e){new MyListing.Maps.Autocomplete(e)}),MyListing.Geocoder=new MyListing.Maps.Geocoder,n(".cts-get-location").click(function(t){t.preventDefault();var e=n(n(this).data("input")),i=n(this).data("map"),o=null;e.length&&(i.length&&(o=MyListing.Maps.getInstance(i))&&MyListing.Geocoder.setMap(o.instance),MyListing.Geocoder.getUserLocation({receivedAddress:function(t){if(e.val(t.address),e.data("autocomplete"))return e.data("autocomplete").fireChangeEvent(t)}}))})}),jQuery(function(l){l(document).on("maps:loaded",function(){if(document.getElementById("location-picker-map")){var i=MyListing.Maps.getInstance("location-picker-map").instance,t=l(".location-field-wrapper"),e=t.data("options"),o=t.find(".location-coords"),n=t.find(".latitude-input"),s=t.find(".longitude-input"),a=t.find(".address-input"),r=t.find('.lock-pin input[type="checkbox"]'),p=t.find(".enter-coordinates-toggle > span"),u=new MyListing.Maps.Marker({position:g(),map:i,template:{type:"traditional"}});i.addListener("click",function(t){if(!r.prop("checked")){var e=i.getClickPosition(t);u.setPosition(e),n.val(e.getLatitude()),s.val(e.getLongitude()),MyListing.Geocoder.geocode(e.toGeocoderFormat(),function(t){t&&a.val(t.address)})}}),a.on("autocomplete:change",function(t){if(!r.prop("checked")&&t.detail.place&&t.detail.place.latitude&&t.detail.place.longitude){var e=new MyListing.Maps.LatLng(t.detail.place.latitude,t.detail.place.longitude);u.setPosition(e),n.val(t.detail.place.latitude),s.val(t.detail.place.longitude),i.panTo(e)}}),i.addListenerOnce("idle",function(t){i.setZoom(12)}),r.on("change",function(t){i.trigger("resize"),i.setCenter(g())}).change(),p.click(function(t){o.toggleClass("hide")}),n.blur(c),s.blur(c)}function c(){var t=new MyListing.Maps.LatLng(n.val(),s.val());u.setPosition(t),n.val(t.getLatitude()),s.val(t.getLongitude()),i.panTo(t)}function g(){return n.val().trim()&&s.val().trim()?new MyListing.Maps.LatLng(n.val(),s.val()):new MyListing.Maps.LatLng(e["default-lat"],e["default-lng"])}})}),MyListing.Maps.Autocomplete=function(t){jQuery(t).data("autocomplete",this),this.init(t)},MyListing.Maps.Autocomplete.prototype.init=function(t){},MyListing.Maps.Autocomplete.prototype.fireChangeEvent=function(t){var e=document.createEvent("CustomEvent");e.initCustomEvent("autocomplete:change",!1,!0,{place:t||!1}),this.el.dispatchEvent(e)},MyListing.Maps.Clusterer=function(t){this.init(t)},MyListing.Maps.Clusterer.prototype.init=function(t){},MyListing.Maps.Geocoder=function(){this.init()},MyListing.Maps.Geocoder.prototype.init=function(){}
1,MyListing.Maps.Geocoder.prototype.geocode=function(t,e,i){},MyListing.Maps.Geocoder.prototype.formatFeature=function(t){},MyListing.Maps.Geocoder.prototype.getUserLocation=function(i){if(navigator.geolocation){i=jQuery.extend({shouldFetchAddress:!0,receivedCoordinates:!1,receivedAddress:!1,geolocationFailed:!1},i);navigator.geolocation.getCurrentPosition(function(t){if("function"==typeof i.receivedCoordinates&&i.receivedCoordinates(t),!1!==i.shouldFetchAddress){var e=new MyListing.Maps.LatLng(t.coords.latitude,t.coords.longitude);MyListing.Geocoder.geocode(e.toGeocoderFormat(),function(t){if(!t)return console.log("Couldn't determine your location."),void("function"==typeof i.geolocationFailed&&i.geolocationFailed());"function"==typeof i.receivedAddress&&i.receivedAddress(t)})}})}else alert("Geolocation is not supported by this browser.")},MyListing.Maps.Geocoder.prototype.setMap=function(t){this.map=t},MyListing.Maps.Map=function(t){this.$el=jQuery(t),this.init(t)},MyListing.Maps.Map.prototype.init=function(){},MyListing.Maps.Map.prototype.setZoom=function(t){},MyListing.Maps.Map.prototype.getZoom=function(){},MyListing.Maps.Map.prototype.getMinZoom=function(){},MyListing.Maps.Map.prototype.getMaxZoom=function(){},MyListing.Maps.Map.prototype.setCenter=function(t){},MyListing.Maps.Map.prototype.fitBounds=function(t){},MyListing.Maps.Map.prototype.panTo=function(t){},MyListing.Maps.Map.prototype.getClickPosition=function(t){},MyListing.Maps.Map.prototype.addListener=function(t,e){},MyListing.Maps.Map.prototype.addListenerOnce=function(t,e){},MyListing.Maps.Map.prototype.trigger=function(t){},MyListing.Maps.Map.prototype.addControl=function(t){},MyListing.Maps.Map.prototype.getSourceObject=function(){return this.map},MyListing.Maps.Map.prototype.getSourceEvent=function(t){return void 0!==this.events[t]?this.events[t]:t},MyListing.Maps.Map.prototype.closePopups=function(){this.trigger("mylisting:closing_popups");for(var t=0;t<this.markers.length;t++)"object"===o(this.markers[t].options.popup)&&this.markers[t].options.popup.hide()},MyListing.Maps.Map.prototype.removeMarkers=function(){for(var t=0;t<this.markers.length;t++)this.markers[t].remove();this.markers.length=0,this.markers=[]},MyListing.Maps.Map.prototype._maybeAddMarkers=function(){var i=this;if(i.markers=[],i.trigger("updating_markers"),"custom-locations"==i.options.items_type&&i.options.locations.length){"basic"==i.options.marker_type&&i.options.locations.forEach(function(t){i._addBasicMarker(t)}),"advanced"==i.options.marker_type&&i.options.locations.forEach(function(t){var e=new MyListing.Maps.Marker({position:new MyListing.Maps.LatLng(t.marker_lat,t.marker_lng),map:i,popup:new MyListing.Maps.Popup,template:{type:"advanced",thumbnail:t.marker_image.url}});i.markers.push(e),i.bounds.extend(e.getPosition())});var t=function(t){15<this.getZoom()&&this.setZoom(this.options.zoom)};i.addListenerOnce("zoom_changed",t.bind(i)),i.addListenerOnce("bounds_changed",t.bind(i)),i.fitBounds(i.bounds),i.trigger("updated_markers")}"listings"==i.options.items_type&&i.options.listings_query.lat&&i.options.listings_query.lng&&i.options.listings_query.radius&&i.options.listings_query.listing_type&&i.options._section_id&&this._addMarkersThroughQuery()},MyListing.Maps.Map.prototype._addBasicMarker=function(i){var o=this;if(i.marker_lat&&i.marker_lng){var t=new MyListing.Maps.Marker({position:new MyListing.Maps.LatLng(i.marker_lat,i.marker_lng),map:o,template:{type:"basic",thumbnail:i.marker_image.url}});o.markers.push(t),o.bounds.extend(t.getPosition())}else i.address&&MyListing.Geocoder.geocode(i.address,function(t){if(!t)return!1;var e=new MyListing.Maps.Marker({position:new MyListing.Maps.LatLng(t.latitude,t.longitude),map:o,template:{type:"basic",thumbnail:i.marker_image.url}});o.markers.push(e),o.bounds.extend(e.getPosition()),o.fitBounds(o.bounds),o.setZoom(o.options.zoom)})},MyListing.Maps.Map.prototype._addMarkersThroughQuery=function(){var n=this;n.$el.addClass("mylisting-map-loading"),jQuery.ajax({url:CASE27.ajax_url+"?action=get_listings&security="+CASE27.ajax_nonce,type:"POST",dataType:"json",data:{listing_type:n.options.listings_query.listing_type,form_data:{proximity:n.options.listings_query.radius,search_location_lat:n.options.listings_query.lat,search_location_lng:n.options.listings_query.lng,search_location:"radius search",per_page:n.options.listings_query.count}},success:function(t){jQuery("#"+n.options._section_id).find(".c27-map-listings").html(t.html),jQuery("#"+n.options._section_id).find(".c27-map-listings .lf-item-container").each(function(t,e){var i=jQuery(e);if(i.data("latitude")&&i.data("longitude")){var o=new MyListing.Maps.Marker({position:new MyListing.Maps.LatLng(i.data("latitude"),i.data("longitude")),map:n,popup:new MyListing.Maps.Popup({content:'<div class="lf-item-container lf-type-2">'+i.html()+"</div>"}),template:{type:"advanced",thumbnail:i.data("thumbnail"),icon_name:i.data("category-icon"),icon_color:i.data("category-text-color"),icon_background_color:i.data("category-color"),listing_id:i.data("id")}});n.markers.push(o),n.bounds.extend(o.getPosition())}}),jQuery(".lf-background-carousel").owlCarousel({margin:20,items:1,loop:!0}),n.fitBounds(n.bounds),n.trigger("updated_markers"),n.$el.removeClass("mylisting-map-loading")}})},MyListing.Maps.Marker=function(t){this.options=jQuery.extend(!0,{position:!1,map:!1,popup:!1,template:{type:"basic",icon_name:"",icon_color:"",icon_background_color:"",listing_id:"",thumbnail:""}},t),this.init(t)},MyListing.Maps.Marker.prototype.init=function(t){},MyListing.Maps.Marker.prototype.getPosition=function(){},MyListing.Maps.Marker.prototype.setPosition=function(t){},MyListing.Maps.Marker.prototype.setMap=function(t){},MyListing.Maps.Marker.prototype.remove=function(){},MyListing.Maps.Marker.prototype.getTemplate=function(){var t=document.createElement("div");t.className="marker-container",t.style.position="absolute",t.style.cursor="pointer",t.style.zIndex=10;var e="";return"basic"==this.options.template.type&&(e=jQuery("#case27-basic-marker-template").html().replace("{{marker-bg}}",this.options.template.thumbnail)),"traditional"==this.options.template.type&&(e=jQuery("#case27-traditional-marker-template").html()),"user-location"==this.options.template.type&&(e=jQuery("#case27-user-location-marker-template").html()),"advanced"==this.options.template.type&&(e=jQuery("#case27-marker-template").html().replace("{{icon}}",this.options.template.icon_name).replace("{{icon-bg}}",this.options.template.icon_background_color).replace("{{listing-id}}",this.options.template.listing_id).replace("{{marker-bg}}",this.options.template.thumbnail).replace("{{icon-color}}",this.options.template.icon_color)),jQuery(t).append(e),t},MyListing.Maps.Popup=function(t){this.options=jQuery.extend(!0,{content:"",classes:"cts-map-popup cts-listing-popup infoBox cts-popup-hidden",position:!1,map:!1},t),this.init(t)},MyListing.Maps.Popup.prototype.init=function(t){},MyListing.Maps.Popup.prototype.setContent=function(t){},MyListing.Maps.Popup.prototype.setPosition=function(t){},MyListing.Maps.Popup.prototype.setMap=function(t){},MyListing.Maps.Popup.prototype.remove=function(){},MyListing.Maps.Popup.prototype.show=function(){},MyListing.Maps.Popup.prototype.hide=function(){},MyListing.Maps.LatLng=function(t,e){this.init(t,e)},MyListing.Maps.LatLng.prototype.init=function(t,e){},MyListing.Maps.LatLng.prototype.getLatitude=function(){},MyListing.Maps.LatLng.prototype.getLongitude=function(){},MyListing.Maps.LatLng.prototype.toGeocoderFormat=function(){},MyListing.Maps.LatLng.prototype.getSourceObject=function(){return this.latlng},MyListing.Maps.LatLngBounds=function(t,e){this.init(t,e)},MyListing.Maps.LatLngBounds.prototype.init=function(t,e){},MyListing.Maps.LatLngBounds.prototype.extend=function(t){},MyListing.Maps.LatLngBounds.prototype.getSourceObject=function(){return this.bounds},i.prototype.setLanguage=function(t,e){if(this.supportedLanguages.indexOf(e)<0)throw new Error("Language "+e+" is not supported");var i=this._languageSource||function(i){return Object.keys(i.sources).filter(function(t){var e=i.sources[t];return/mapbox-streets-v\d/.test(e.url)})[0]}(t);if(!i)return t;var o=this._getLanguageField(e),n=this._isLanguageField,s=this._excludedLayerIds,a=t.layers.map(function(t){return t.source===i?p(n,t,o,s):t}),r=Object.assign({},t,{layers:a});return this._languageTransform(r,e)},i.prototype._initialStyleUpdate=function(){var t=this._map.getStyle(),e=this._defaultLanguage||n(this.supportedLanguages);this._map.off("styledata",this._initialStyleUpdate),this._map.setStyle(this.setLanguage(t,e))},i.prototype.onAdd=function(t){return this._map=t,this._map.on("styledata",this._initialStyleUpdate),this._container=document.createElement("div"),this._container},i.prototype.onRemove=function(){this._map.off("styledata",this._initialStyleUpdate),this._map=void 0},"undefined"!=typeof module&&void 0!==module.exports?module.exports=i:("function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null===t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),o=1;o<arguments.length;o++){var n=arguments[o];if(null!==n)for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])}return i},writable:!0,configurable:!0}),window.MapboxLanguage=i),MyListing.Maps.Marker.prototype.init=function(t){this.options=jQuery.extend(!0,{position:!1,map:!1,popup:!1,template:{type:"basic",icon_name:"",icon_color:"",icon_background_color:"",listing_id:"",thumbnail:""}},t),this.marker=new mapboxgl.Marker(this.template()),this.options.position&&this.setPosition(this.options.position),this.options.map&&this.setMap(this.options.map)},MyListing.Maps.Marker.prototype.getPosition=function(){return this.options.position},MyListing.Maps.Marker.prototype.setPosition=function(t){return this.marker.setLngLat(t.getSourceObject()),this},MyListing.Maps.Marker.prototype.setMap=function(t){return this.marker.addTo(t.getSourceObject()),this},MyListing.Maps.Marker.prototype.remove=function(){return this.options.popup&&this.options.popup.remove(),this.marker.remove(),this},MyListing.Maps.Marker.prototype.template=function(){var t=this.getTemplate();return t.addEventListener("click",function(t){t.preventDefault(),this.options.popup&&this.options.map&&this.options.position&&(this.options.popup.setPosition(this.options.position),setTimeout(function(){this.options.popup.setMap(this.options.map),this.options.popup.show(),this.options.popup.fitToScreen()}.bind(this),10))}.bind(this)),t},MyListing.Maps.Popup.prototype.init=function(t){this.options=jQuery.extend(!0,{content:"",classes:"cts-map-popup cts-listing-popup infoBox cts-popup-hidden listing-preview",position:!1,map:!1},t),this.popup=new mapboxgl.Popup({className:this.options.classes,closeButton:!1,closeOnClick:!1,anchor:"left"}),this.timeout=null,this.options.position&&this.setPosition(this.options.position),this.options.content&&this.setContent(this.options.content),this.options.map&&this.setMap(this.options.map)},MyListing.Maps.Popup.prototype.setContent=function(t){return this.options.content=t,this.popup.setHTML(t),this},MyListing.Maps.Popup.prototype.setPosition=function(t){return this.options.position=t,this.popup.setLngLat(t.getSourceObject()),this},MyListing.Maps.Popup.prototype.setMap=function(t){return this.options.map=t,this},MyListing.Maps.Popup.prototype.remove=function(){return this.popup.remove(),this},MyListing.Maps.Popup.prototype.show=function(){var t=this;return clearTimeout(t.timeout),t.popup.addTo(t.options.map.getSourceObject()),setTimeout(function(){t.popup._container.className=t.popup._container.className.replace("cts-popup-hidden","cts-popup-visible"),t._addTemplateClass()},10),t},MyListing.Maps.Popup.prototype.hide=function(){var t=this;return clearTimeout(t.timeout),void 0!==t.popup._container&&(t.popup._container.className=t.popup._container.className.replace("cts-popup-visible","cts-popup-hidden"),t._addTemplateClass()),t.timeout=setTimeout(function(){t.remove()},250),t},MyListing.Maps.Popup.prototype.fitToScreen=function(t){var e=jQuery.extend({top:130,right:360,bottom:130},t||{}),i=this.options.map.getSourceObject(),o=i.getCanvas().getBoundingClientRect(),n=i.project(i.getCenter()),s=n.x,a=n.y,r=i.project(this.popup.getLngLat());return o.width-r.x<e.right-1&&(n.x+=e.right-(o.width-r.x)),r.y<e.top-1&&(n.y-=e.top-r.y),o.height-r.y<e.bottom-1&&(n.y+=e.bottom-(o.height-r.y)),n.x===s&&n.y===a||i.panTo(i.unproject(n),{duration:200}),this},MyListing.Maps.Popup.prototype._addTemplateClass=function(){if(jQuery(this.options.content).find(".lf-item")){var t="tpl-"+jQuery(this.options.content).find(".lf-item").data("template");t&&void 0!==this.popup._container&&-1===this.popup._container.className.indexOf(t)&&(this.popup._container.className+=" "+t)}},MyListing.Maps.LatLng.prototype.init=function(t,e){this.latitude=t,this.longitude=e,this.latlng=new mapboxgl.LngLat(e,t)},MyListing.Maps.LatLng.prototype.getLatitude=function(){return this.latlng.lat},MyListing.Maps.LatLng.prototype.getLongitude=function(){return this.latlng.lng},MyListing.Maps.LatLng.prototype.toGeocoderFormat=function(){return[this.getLongitude(),this.getLatitude()].join(",")},MyListing.Maps.LatLngBounds.prototype.init=function(t,e){this.southwest=t,this.northeast=e,this.bounds=new mapboxgl.LngLatBounds(t,e)},MyListing.Maps.LatLngBounds.prototype.extend=function(t){this.bounds.extend(t.getSourceObject())},t=window,e=function(){function y(t,e,i,o){n(t,i,o),n(e,2*i,2*o),n(e,2*i+1,2*o+1)}function n(t,e,i){var o=t[e];t[e]=t[i],t[i]=o}function M(t,e,i,o){var n=t-i,s=e-o;return n*n+s*s}function u(t,e,i,o,n){return new s(t,e,i,o,n)}function s(t,e,i,o,n){e=e||a,i=i||r,n=n||Array,this.nodeSize=o||64,this.points=t,this.ids=new n(t.length),this.coords=new n(2*t.length);for(var s=0;s<t.length;s++)this.ids[s]=s,this.coords[2*s]=e(t[s]),this.coords[2*s+1]=i(t[s]);!function t(e,i,o,n,s,a){if(!(s-n<=o)){var r=Math.floor((n+s)/2);!function t(e,i,o,n,s,a){for(;n<s;){if(600<s-n){var r=s-n+1,p=o-n+1,u=Math.log(r),c=.5*Math.exp(2*u/3),g=.5*Math.sqrt(u*c*(r-c)/r)*(p-r/2<0?-1:1);t(e,i,o,Math.max(n,Math.floor(o-p*c/r+g)),Math.min(s,Math.floor(o+(r-p)*c/r+g)),a)}var l=i[2*o+a],d=n,h=s;for(y(e,i,n,o),i[2*s+a]>l&&y(e,i,n,s);d<h;){for(y(e,i,d,h),d++,h--;i[2*d+a]<l;)d++;for(;i[2*h+a]>l;)h--}i[2*n+a]===l?y(e,i,n,h):y(e,i,++h,s),h<=o&&(n=h+1),o<=h&&(s=h-1)}}(e,i,r,n,s,a%2),t(e,i,o,n,r-1,a+1),t(e,i,o,r+1,s,a+1)}}(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function a(t){return t[0]}function r(t){return t[1]}function e(t){this.options=o(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function d(t){return{type:"Feature",id:t.id,properties:c(t),geometry:{type:"Point",coordinates:[(o=t.x,360*(o-.5)),(e=t.y,i=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(i))/Math.PI-90)]}};var e,i,o}function c(t){var e=t.numPoints,i=1e4<=e?Math.round(e/1e3)+"k":1e3<=e?Math.round(e/100)/10+"k":e;return o(o({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:i})}function h(t){return t/360+.5}function m(t){var e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:1<i?1:i}function o(t,e){for(var i in e)t[i]=e[i];return t}function g(t){return t.x}function l(t){return t.y}return e.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:(s.prototype={range:function(t,e,
1i,o){return function(t,e,i,o,n,s,a){for(var r,p,u=[0,t.length-1,0],c=[];u.length;){var g=u.pop(),l=u.pop(),d=u.pop();if(l-d<=a)for(var h=d;h<=l;h++)r=e[2*h],p=e[2*h+1],i<=r&&r<=n&&o<=p&&p<=s&&c.push(t[h]);else{var y=Math.floor((d+l)/2);r=e[2*y],p=e[2*y+1],i<=r&&r<=n&&o<=p&&p<=s&&c.push(t[y]);var m=(g+1)%2;(0===g?i<=r:o<=p)&&(u.push(d),u.push(y-1),u.push(m)),(0===g?r<=n:p<=s)&&(u.push(y+1),u.push(l),u.push(m))}}return c}(this.ids,this.coords,t,e,i,o,this.nodeSize)},within:function(t,e,i){return function(t,e,i,o,n,s){for(var a=[0,t.length-1,0],r=[],p=n*n;a.length;){var u=a.pop(),c=a.pop(),g=a.pop();if(c-g<=s)for(var l=g;l<=c;l++)M(e[2*l],e[2*l+1],i,o)<=p&&r.push(t[l]);else{var d=Math.floor((g+c)/2),h=e[2*d],y=e[2*d+1];M(h,y,i,o)<=p&&r.push(t[d]);var m=(u+1)%2;(0===u?i-n<=h:o-n<=y)&&(a.push(g),a.push(d-1),a.push(m)),(0===u?h<=i+n:y<=o+n)&&(a.push(d+1),a.push(c),a.push(m))}}return r}(this.ids,this.coords,t,e,i,this.nodeSize)}},!1),reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var i="prepare "+t.length+" points";e&&console.time(i),this.points=t;for(var o,n,s=[],a=0;a<t.length;a++)t[a].geometry&&s.push({x:h((n=t[o=a].geometry.coordinates)[0]),y:m(n[1]),zoom:1/0,index:o,parentId:-1});this.trees[this.options.maxZoom+1]=u(s,g,l,this.options.nodeSize,Float32Array),e&&console.timeEnd(i);for(var r=this.options.maxZoom;r>=this.options.minZoom;r--){var p=+Date.now();s=this._cluster(s,r),this.trees[r]=u(s,g,l,this.options.nodeSize,Float32Array),e&&console.log("z%d: %d clusters in %dms",r,s.length,+Date.now()-p)}return e&&console.timeEnd("total time"),this},getClusters:function(t,e){var i=((t[0]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[1])),n=180===t[2]?180:((t[2]+180)%360+360)%360-180,s=Math.max(-90,Math.min(90,t[3]));if(360<=t[2]-t[0])i=-180,n=180;else if(n<i){var a=this.getClusters([i,o,180,s],e),r=this.getClusters([-180,o,n,s],e);return a.concat(r)}for(var p=this.trees[this._limitZoom(e)],u=p.range(h(i),m(s),h(n),m(o)),c=[],g=0;g<u.length;g++){var l=p.points[u[g]];c.push(l.numPoints?d(l):this.points[l.index])}return c},getChildren:function(t){var e=t>>5,i=t%32,o="No cluster with the specified id.",n=this.trees[i];if(!n)throw new Error(o);var s=n.points[e];if(!s)throw new Error(o);for(var a=this.options.radius/(this.options.extent*Math.pow(2,i-1)),r=n.within(s.x,s.y,a),p=[],u=0;u<r.length;u++){var c=n.points[r[u]];c.parentId===t&&p.push(c.numPoints?d(c):this.points[c.index])}if(0===p.length)throw new Error(o);return p},getLeaves:function(t,e,i){e=e||10,i=i||0;var o=[];return this._appendLeaves(o,t,e,i,0),o},getTile:function(t,e,i){var o=this.trees[this._limitZoom(t)],n=Math.pow(2,t),s=this.options.extent,a=this.options.radius/s,r=(i-a)/n,p=(i+1+a)/n,u={features:[]};return this._addTileFeatures(o.range((e-a)/n,r,(e+1+a)/n,p),o.points,e,i,n,u),0===e&&this._addTileFeatures(o.range(1-a/n,r,1,p),o.points,n,i,n,u),e===n-1&&this._addTileFeatures(o.range(0,r,a/n,p),o.points,-1,i,n,u),u.features.length?u:null},getClusterExpansionZoom:function(t){for(var e=t%32-1;e<this.options.maxZoom;){var i=this.getChildren(t);if(e++,1!==i.length)break;t=i[0].properties.cluster_id}return e},_appendLeaves:function(t,e,i,o,n){for(var s=this.getChildren(e),a=0;a<s.length;a++){var r=s[a].properties;if(r&&r.cluster?n+r.point_count<=o?n+=r.point_count:n=this._appendLeaves(t,r.cluster_id,i,o,n):n<o?n++:t.push(s[a]),t.length===i)break}return n},_addTileFeatures:function(t,e,i,o,n,s){for(var a=0;a<t.length;a++){var r=e[t[a]],p={type:1,geometry:[[Math.round(this.options.extent*(r.x*n-i)),Math.round(this.options.extent*(r.y*n-o))]],tags:r.numPoints?c(r):this.points[r.index].properties},u=r.numPoints?r.id:this.points[r.index].id;void 0!==u&&(p.id=u),s.features.push(p)}},_limitZoom:function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},_cluster:function(t,e){for(var i=[],o=this.options.radius/(this.options.extent*Math.pow(2,e)),n=0;n<t.length;n++){var s=t[n];if(!(s.zoom<=e)){s.zoom=e;var a=this.trees[e+1],r=a.within(s.x,s.y,o),p=s.numPoints||1,u=s.x*p,c=s.y*p,g=null;this.options.reduce&&(g=this.options.initial(),this._accumulate(g,s));for(var l=(n<<5)+(e+1),d=0;d<r.length;d++){var h=a.points[r[d]];if(!(h.zoom<=e)){h.zoom=e;var y=h.numPoints||1;u+=h.x*y,c+=h.y*y,p+=y,h.parentId=l,this.options.reduce&&this._accumulate(g,h)}}1===p?i.push(s):(s.parentId=l,i.push({x:u/p,y:c/p,zoom:1/0,id:l,parentId:-1,numPoints:p,properties:g}))}}return i},_accumulate:function(t,e){var i=e.numPoints?e.properties:this.options.map(this.points[e.index].properties);this.options.reduce(t,i)}},function(t){return new e(t)}},"object"==("undefined"==typeof exports?"undefined":o(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.supercluster
1=e(),MyListing.Maps.Clusterer.prototype.init=function(t){this.map=t,this.clusters={},this.clusterer=!1,this.clusterGroupPopup=new MyListing.Maps.Popup({map:this.map}),this.map.addListener("mylisting:closing_popups",function(){this.clusterGroupPopup.hide()}.bind(this))},MyListing.Maps.Clusterer.prototype.load=function(){this.clusterer=supercluster({radius:80,maxZoom:20}).load(this.getGeoJSON()),this.update()},MyListing.Maps.Clusterer.prototype.destroy=function(){this.clusterer=!1},MyListing.Maps.Clusterer.prototype.getGeoJSON=function(){return this.map.markers.map(function(t,e){return{type:"Feature",geometry:{type:"Point",coordinates:[t.getPosition().longitude,t.getPosition().latitude]},properties:{sID:e+1,scID:0,marker:{template:jQuery.extend(!0,{},t.options.template),popup:!!t.options.popup&&t.options.popup.options.content}}}})},MyListing.Maps.Clusterer.prototype.removeFeatures=function(){this.map.removeMarkers(),Object.keys(this.clusters).forEach(function(t){this.clusters[t].remove()}.bind(this))},MyListing.Maps.Clusterer.prototype.update=function(){var t=this;if(!t.clusterer)return!1;var e=t.map.getSourceObject().getBounds(),i=t.clusterer.getClusters([e.getWest(),e.getSouth(),e.getEast(),e.getNorth()],Math.floor(t.map.getSourceObject().getZoom()));this.removeFeatures(),t.displayFeatures(i)},MyListing.Maps.Clusterer.prototype.displayFeatures=function(t){var n=this;t.forEach(function(o){if(o.properties.cluster){var t=document.createElement("div");t.className="cts-marker-cluster",t.innerHTML=o.properties.point_count_abbreviated;var e=new mapboxgl.Marker(t);e.setLngLat(o.geometry.coordinates),e.addTo(n.map.getSourceObject()),n.clusters[o.properties.cluster_id]=e,t.addEventListener("click",function(t){if(t.preventDefault(),n.map.getZoom()>=n.map.getMaxZoom()){var e=n.clusterer.getLeaves(o.properties.cluster_id),i='<div class="marker-cluster-popup"><div class="lf-item marker-cluster-wrapper" data-template="marker-cluster-popup">';e.forEach(function(t){i+=t.properties.marker.popup}
1),i+="</div></div>",n.clusterGroupPopup.setPosition(new MyListing.Maps.LatLng(o.geometry.coordinates[1],o.geometry.coordinates[0])).setContent(i),n.map.addListenerOnce("click",function(t){n.clusterGroupPopup.show().fitToScreen({bottom:400})})}else n.map.getSourceObject().easeTo({center:o.geometry.coordinates,zoom:n.clusterer.getClusterExpansionZoom(o.properties.cluster_id)})})}else n.map.markers.push(new MyListing.Maps.Marker({map:n.map,popup:!!o.properties.marker.popup&&new MyListing.Maps.Popup({content:o.properties.marker.popup}),position:new MyListing.Maps.LatLng(o.geometry.coordinates[1],o.geometry.coordinates[0]),template:o.properties.marker.template}))})},MyListing.Maps.Geocoder.prototype.init=function(){},MyListing.Maps.Geocoder.prototype.geocode=function(t,i,e){var o=this,n=!1;if("function"==typeof i)e=i,i={};var s={access_token:MyListing.MapConfig.AccessToken,limit:1,language:MyListing.MapConfig.Language};MyListing.MapConfig.TypeRestrictions.length&&MyListing.MapConfig.TypeRestrictions.join(",").length&&(i.types=MyListing.MapConfig.TypeRestrictions.join(",")),MyListing.MapConfig.CountryRestrictions.length&&MyListing.MapConfig.CountryRestrictions.join(",").length&&(i.country=MyListing.MapConfig.CountryRestrictions.join(","));i=jQuery.extend(!0,{},s,i);if(!encodeURIComponent(t).length)return e(n);jQuery.get({url:"https://api.mapbox.com/geocoding/v5/mapbox.places/{query}.json".replace("{query}",encodeURIComponent(t)),data:i,dataType:"json",success:function(t,e){"success"===e&&t&&t.features.length&&(n=1!==i.limit?t.features.map(o.formatFeature):o.formatFeature(t.features[0]))},complete:function(){e(n)}})},MyListing.Maps.Geocoder.prototype.formatFeature=function(t){return{latitude:t.geometry.coordinates[1],longitude:t.geometry.coordinates[0],address:t.place_name}},MyListing.Maps.Autocomplete.prototype.init=function(t){if(!t instanceof Element)return!1;var e=this;this.el=t,this.input=jQuery(this.el),this.focusedItem=0,this.hasQueried=!1,this.attachDropdown(),this.input.on("input",MyListing.Helpers.debounce(this.querySuggestions.bind(this),300)),this.input.on("focusin",this.showDropdown.bind(this)),this.input.on("focusout",this.hideDropdown.bind(this)),this.input.on("keydown click",this.navigateDropdown.bind(this)),this.dropdown.on("click",".suggestion",function(t){e.selectItem(jQuery(this).index())})},MyListing.Maps.Autocomplete.prototype.querySuggestions=function(t){this.resetFocus(),this.showDropdown(),this.fireChangeEvent();MyListing.Geocoder.geocode(t.target.value,{limit:5},function(t){if(this.hasQueried=!0,this.removeSuggestions(),!t)return!1;t.forEach(this.addSuggestion.bind(this))}.bind(this))},MyListing.Maps.Autocomplete.prototype.navigateDropdown=function(t){this.hasQueried||this.input.trigger("input"),this.showDropdown(),40===t.keyCode&&(this.focusedItem++,this.focusItem()),38===t.keyCode&&(this.focusedItem--,this.focusItem()),13===t.keyCode&&(t.preventDefault(),0!==this.focusedItem&&this.selectItem(this.focusedItem-1))},MyListing.Maps.Autocomplete.prototype.focusItem=function(){this.dropdown.find(".suggestions-list .suggestion").removeClass("active");var t=this.dropdown.find(".suggestions-list .suggestion");this.focusedItem<0&&(this.focusedItem=t.length),this.focusedItem>t.length&&(this.focusedItem=0),0!==this.focusedItem&&this.dropdown.find(".suggestions-list .suggestion").eq(this.focusedItem-1).addClass("active")},MyListing.Maps.Autocomplete.prototype.resetFocus=function(t){this.focusedItem=0,this.dropdown.find(".suggestions-list .suggestion").removeClass("active")},MyListing.Maps.Autocomplete.prototype.showDropdown=function(t){this.dropdown.addClass("active");var e=this.input.get(0).getBoundingClientRect(),i=this.input.offset();this.dropdown.css({top:i.top+e.height+"px",left:i.left+"px",width:e.width+"px"})},MyListing.Maps.Autocomplete.prototype.hideDropdown=function(t){this.dropdown.removeClass("active")},MyListing.Maps.Autocomplete.prototype.selectItem=function(t){var e=this.dropdown.find(".suggestions-list .suggestion").eq(t).data("place");this.input.val(e.address),this.resetFocus(),this.hideDropdown(),this.fireChangeEvent(e)},MyListing.Maps.Autocomplete.prototype.attachDropdown=function(){this.dropdown=jQuery('<div class="cts-autocomplete-dropdown"><div class="suggestions-list"></div></div>'),this.input.addClass("cts-autocomplete-input").attr("autocomplete","off"),jQuery("body").append(this.dropdown)},MyListing.Maps.Autocomplete.prototype.removeSuggestions=function(){this.dropdown.find(".suggestions-list").html("")},MyListing.Maps.Autocomplete.prototype.addSuggestion=function(t){var e=jQuery(['<div class="suggestion">','<i class="mi location_on"></i>','<span class="suggestion--address"></span>',"</div>"].join(""));e.data("place",t),e.find(".suggestion--address").text(t.address),this.dropdown.find(".suggestions-list").append(e)},MyListing.Maps.Map.prototype.init=function(t){this.options=jQuery.extend({},MyListing.Maps.options,jQuery(t).data("options"));if(this.markers=[],this.bounds=new MyListing.Maps.LatLngBounds,this.id=!!jQuery(t).attr("id")&&jQuery(t).attr("id"),this.events={zoom_changed:"zoomstart",bounds_changed:"moveend"},24<this.options.maxZoom&&(this.options.maxZoom=24),this.map=new mapboxgl.Map({container:t,zoom:this.options.zoom,minZoom:this.options.minZoom,maxZoom:this.options.maxZoom,interactive:this.options.draggable,style:MyListing.Maps.skins[this.options.skin]?MyListing.Maps.skins[this.options.skin]:MyListing.Maps.skins.skin1,scrollZoom:this.options.scrollwheel}),this.map.addControl(new mapboxgl.NavigationControl({showCompass:!1})),this.map.addControl(new mapboxgl.FullscreenControl),this.addListenerOnce("load",function(){MyListing.Maps.MapboxSetLanguage(this)}.bind(this)),this.setZoom(3),this.setCenter(new MyListing.Maps.LatLng(0,0)),this.options.cluster_markers){var e=function(){this.clusterer.update(
1)};this.clusterer=new MyListing.Maps.Clusterer(this),this.addListener("updating_markers",function(){this.clusterer.destroy()}.bind(this)),this.addListener("updated_markers",function(){this.clusterer.load()}.bind(this)),this.addListener("zoomend",e.bind(this)),this.addListener("dragend",e.bind(this))}this._maybeAddMarkers(),this.addListener("zoom_changed",this.closePopups.bind(this)),this.addListener("click",this.closePopups.bind(this)),this.addListener("refresh",this.refresh.bind(this)),MyListing.Maps.instances.push({id:this.id,map:this.map,instance:this})},MyListing.Maps.Map.prototype.setZoom=function(t){this.map.setZoom(t)},MyListing.Maps.Map.prototype.getZoom=function(){return this.map.getZoom()},MyListing.Maps.Map.prototype.getMinZoom=function(){return this.map.getMinZoom()},MyListing.Maps.Map.prototype.getMaxZoom=function(){return this.map.getMaxZoom()},MyListing.Maps.Map.prototype.setCenter=function(t){this.map.setCenter(t.getSourceObject())},MyListing.Maps.Map.prototype.fitBounds=function(t){t.getSourceObject().isEmpty()||this.map.fitBounds(t.getSourceObject(),{padding:85,animate:!1})},MyListing.Maps.Map.prototype.panTo=function(t){this.map.panTo(t.getSourceObject())},MyListing.Maps.Map.prototype.getClickPosition=function(t){return new MyListing.Maps.LatLng(t.lngLat.lat,t.lngLat.lng)},MyListing.Maps.Map.prototype.addListener=function(t,e){this.map.on(this.getSourceEvent(t),function(t){e(t)})},MyListing.Maps.Map.prototype.addListenerOnce=function(t,e){this.map.once(this.getSourceEvent(t),function(t){e(t)})},MyListing.Maps.Map.prototype.trigger=function(t){this.map.fire(this.getSourceEvent(t))},MyListing.Maps.Map.prototype.refresh=function(){this.map.resize(),this.options.cluster_markers&&this.clusterer.update()},MyListing.Maps.Map.prototype.addControl=function(e){function t(){}t.prototype.onAdd=function(t){return this._map=t,this._container=e,this._container.className+=" mapboxgl-ctrl ",this._container},t.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map=void 0},this.map.addControl(new t)},MyListing.Maps.skins={skin1:"mapbox://styles/mapbox/streets-v10",skin2:"mapbox://styles/mapbox/outdoors-v10",skin3:"mapbox://styles/mapbox/light-v9",skin4:"mapbox://styles/mapbox/dark-v9",skin6:"mapbox://styles/mapbox/satellite-streets-v10",skin7:"mapbox://styles/mapbox/navigation-preview-day-v4",skin8:"mapbox://styles/mapbox/navigation-preview-night-v4",skin9:"mapbox://styles/mapbox/navigation-guidance-day-v4",skin10:"mapbox://styles/mapbox/navigation-guidance-night-v4",skin12:""},function(){if("object"===o(MyListing.MapConfig.CustomSkins)){var i={};Object.keys(MyListing.MapConfig.CustomSkins).forEach(function(t){if(MyListing.MapConfig.CustomSkins[t])if("mapbox://"!==MyListing.MapConfig.CustomSkins[t].trim().substring(0,9))try{var e=JSON.parse(MyListing.MapConfig.CustomSkins[t]);e&&"object"===o(e)&&(i[t]=e)}catch(t){}else i[t]=MyListing.MapConfig.CustomSkins[t].trim()}),jQuery.extend(MyListing.Maps.skins,i)}}(),MyListing.Maps.init=function(){jQuery(function(t){var e;MyListing.MapConfig.AccessToken.length||(MyListing.MapConfig.AccessToken="invalid_token"),mapboxgl.accessToken=MyListing.MapConfig.AccessToken,MyListing.Maps.MapboxLanguage=new i,MyListing.MapConfig.Language&&-1<MyListing.Maps.MapboxLanguage.supportedLanguages.indexOf(MyListing.MapConfig.Language)||(n(MyListing.Maps.MapboxLanguage.supportedLanguages)?MyListing.MapConfig.Language=n(MyListing.Maps.MapboxLanguage.supportedLanguages):MyListing.MapConfig.Language="en"),"ar"===MyListing.MapConfig.Language&&mapboxgl.setRTLTextPlugin("https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.1.0/mapbox-gl-rtl-text.js"),MyListing.Maps.MapboxSetLanguage=function(t){var e=t.getSourceObject();e.setStyle(MyListing.Maps.MapboxLanguage.setLanguage(e.getStyle(),MyListing.MapConfig.Language))},t(".c27-map:not(.delay-init)").each(function(t,e){new MyListing.Maps.Map(e)}),t("#c27-explore-listings").length&&MyListing.Explore.setupMap(),t(document).trigger("maps:loaded"),t("body.single-listing .listing-tab").on("mylisting:single:tab-switched",function(){MyListing.Maps.instances.forEac
1h(function(t){t.instance.map.resize()})}),e=function(){MyListing.Maps.instances.length&&MyListing.Maps.instances.forEach(function(t){t.map.resize()})},t(".mapboxgl-ctrl-icon.mapboxgl-ctrl-fullscreen").on("click",function(t){setTimeout(e,250)})})},MyListing.Maps.init()});
2
3//# sourceMappingURL=mapbox.js.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.