vendor: 5,005 bytes, lines 1-10
1/*! 2* WP Grid Builder Map Facet Add-on 3* 4* @package WP Grid Builder - Map Facet 5* @author Loïc Blascos 6* @link https://www.wpgridbuilder.com 7* @copyright 2019-2022 Loïc Blascos 8* 9*/ 10!function(){var t={690:function(t,e,n){var o=n(441).Symbol;t.exports=o},318:function(t,e,n){var o=n(690),r=n(77),i=n(954),a=o?o.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?r(t):i(t)}},349:function(t,e,n){var o=n(720),r=/^\s+/;t.exports=function(t){return t?t.slice(0,o(t)+1).replace(r,""):t}},414:function(t,e,n){var o="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=o},77:function(t,e,n){var o=n(690),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,c=o?o.toStringTag:void 0;t.exports=function(t){var e=i.call(t,c),n=t[c];try{t[c]=void 0;var o=!0}catch(t){}var r=a.call(t);return o&&(e?t[c]=n:delete t[c]),r}},954:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},441:function(t,e,n){var o=n(414),r="object"==typeof self&&self&&self.Object===Object&&self,i=o||r||Function("return this")();t.exports=i},720:function(t){var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},750:function(t,e,n){var o=n(973),r=n(148),i=n(746),a=Math.max,c=Math.min;t.exports=function(t,e,n){var s,u,l,f,p,d,g=0,h=!1,v=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(e){var n=s,o=u;return s=u=void 0,g=e,f=t.apply(o,n)}function b(t){return g=t,p=setTimeout(w,e),h?y(t):f}function _(t){var n=t-d;return void 0===d||n>=e||n<0||v&&t-g>=l}function w(){var t=r();if(_(t))return x(t);p=setTimeout(w,function(t){var n=e-(t-d);return v?c(n,l-(t-g)):n}(t))}function x(t){return p=void 0,m&&s?y(t):(s=u=void 0,f)}function j(){var t=r(),n=_(t);if(s=arguments,u=this,d=t,n){if(void 0===p)return b(d);if(v)return clearTimeout(p),p=setTimeout(w,e),y(d)}return void 0===p&&(p=setTimeout(w,e)),f}return e=i(e)||0,o(n)&&(h=!!n.leading,l=(v="maxWait"in n)?a(i(n.maxWait)||0,e):l,m="trailing"in n?!!n.trailing:m),j.cancel=function(){void 0!==p&&clearTimeout(p),g=0,s=d=u=p=void 0},j.flush=function(){return void 0===p?f:x(r())},j}},973:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},387:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},945:function(t,e,n){var o=n(318),r=n(387);t.exports=function(t){return"symbol"==typeof t||r(t)&&"[object Symbol]"==o(t)}},148:function(t,e,n){var o=n(441);t.exports=function(){return o.Date.now()}},746:function(t,e,n){var o=n(349),r=n(973),i=n(945),a=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=o(t);var n=c.test(t);return n||s.test(t)?u(t.slice(2),n?2:8):a.test(t)?NaN:+t}}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var i=e[o]={exports:{}};return t[o](i,i.exports,n),i.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?t(e,n):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var o=n(750),r=n.n(o),i="undefined"!=typeof Map&&new Map,a={};function c(t){return i.has(t.instance)}function s(t,e){t.instance=function(t){return a[t.type]||(a[t.type]=0),"".concat(t.type,"-").concat(++a[t.type])}(t),i.set(t.instance,e)}function u(t){return i.get(t.instance)}function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};
10e%2?f(Object(n),!0).forEach((function(e){l(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function h(t,e,n){return e&&g(t.prototype,e),n&&g(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var v,m=function(){function t(e){d(this,t),this.facet=e,this.load()}return h(t,[{key:"load",value:function(){var t=this;if((v=document.getElementById("wpgb-gmap-script"))&&v.loaded)this.init();else{if(!v){var e=this.facet.settings,n=e.map_api_key,o=e.locale;(v=document.createElement("script")).id="wpgb-gmap-script",v.src="".concat("https://maps.googleapis.com/maps/api/js?","key=").concat(n,"&libraries=places&language=").concat(o.substring(0,2)),document.querySelector("head").appendChild(v)}v.addEventListener("load",(function(){return t.init()}))}}},{key:"init",value:function(){v.loaded=!0,this.session=new google.maps.places.AutocompleteSessionToken,this.autoclt=new google.maps.places.AutocompleteService,this.service=new google.maps.places.PlacesService(document.createElement("p")),this.loaded=!0}},{key:"search",value:function(t,e){if(!this.autoclt)return e([]);var n=this.facet.settings,o=n.geo_countries,r=n.geo_google_types,i={sessionToken:this.session,input:t};o&&o.length&&(i.componentRestrictions={country:o}),r&&r.length&&(i.types=r),this.autoclt.getPlacePredictions(i,(function(t,n){if(n!==google.maps.places.PlacesServiceStatus.OK)return e([]);t=t.map((function(t){return p(p({},t),{},{label:t.description,value:t.description,primary:t.structured_formatting.main_text,secondary:t.structured_formatting.secondary_text})})),e(t)}))}},{key:"select",value:function(t,e){this.service&&this.service.getDetails({sessionToken:this.session,placeId:t.place_id,fields:["geometry"]},(function(n,o){if(o===google.maps.places.PlacesServiceStatus.OK){var r=n.geometry.location,i=r.lat,a=r.lng,c=[i(),a(),0,t.description];e(c)}}))}},{key:"reverse",value:function(t,e,n){(new google.maps.Geocoder).geocode({location:{lat:t,lng:e}},(function(t,e){if(e!==google.maps.GeocoderStatus.OK)return n("");n(t[0].formatted_address)}))}}]),t}(),y=function(){function t(e){d(this,t),this.facet=e,this.loaded=!0}return h(t,[{key:"search",value:function(t,e){var n=this,o=this.facet.settings,r=o.map_access_token,i=o.geo_countries,a=o.geo_mapbox_types,c=o.locale,s=i&&i.length?"&country=".concat(i.join()):"",u=a&&a.length?"&types=".concat(a.join()):"",l="https://api.mapbox.com/geocoding/v5/mapbox.places/".concat(t,".json?access_token=").concat(r,"&autocomplete=true&").concat(s).concat(u,"&language=").concat(c.substring(0,2));this.xhr&&this.xhr.abort(),this.xhr=new XMLHttpRequest,this.xhr.onload=function(t){return n.onLoad(t,e)},this.xhr.open("GET",l),this.xhr.send()}},{key:"onLoad",value:function(t,e){var n=JSON.parse(t.target.responseText);return n.features?e(n=n.features.map((function(t){var e=t.place_name.split(",");return p(p({},t),{},{label:t.place_name,value:t.place_name,primary:e[0],secondary:e.splice(1,e.length).join(",")})}))):e([])}},{key:"select",value:function(t,e){var n=t.geometry.coordinates;e([n[1],n[0],0,t.label])}},{key:"reverse",value:function(t,e,n){var o=this.facet.settings.map_access_token,r="https://api.mapbox.com/geocoding/v5/mapbox.places/".concat(e,",").concat(t,".json?access_token=").concat(o);this.xhr&&this.xhr.abort(),this.xhr=new XMLHttpRequest,this.xhr.onload=function(t){var e=JSON.parse(t.target.responseText);if(!e.features)return n("");n(e.features[0].place_name)},this.xhr.open("GET",r),this.xhr.send()}}]),t}(),b="undefined"!=typeof Map&&new Map;function _(t){"geolocation"===this.facet.type&&(j.call(this,this.facet),this.facet.html?(this.facet.rendered||(P.apply(this,[t,this.facet]),O.call(this,t,this.facet)),L.apply(this,[t,this.facet]),this.facet.rendered=!0):w.apply(this,[t,this.facet]))}function w(t,e){c(e)&&(u(e).destroy(),function(t){i.delete(t.instance)}
10(e),this.emit("autocomplete.destroy",[e])),e.rendered=!1}function x(t){var e=this.getParams(t.slug);this.emit("geolocate",[e[0],e[1],e[2]||t.settings.geo_radius_def||25,t.settings.geo_radius_unit||"mi",t.settings.geo_location_circle,t.settings.geo_circle_color])}function j(t){var e=this;t.binded||(this.on("refresh",x.bind(this,t)),this.on("map.afterInit",(function(n){"mapbox"!==n.type&&(x.call(e,t),n.location&&n.setMapPosition())})),this.on("map.loaded",(function(n){x.call(e,t),n.location&&n.setMapPosition()})),t.binded=!0)}function O(t,e){var n=this,o=t.querySelector('input[type="number"]');o&&(o.addEventListener("input",(function(){return A(o)})),o.addEventListener("change",(function(){return S.call(n,o,e.slug)})))}var S=r()((function(t,e){var n=this.getFacet(e)[0],o=t.value,r=t.min,i=t.max;o=parseFloat(o),r=parseFloat(r),o>(i=parseFloat(i))?t.value=i:o<r?t.value=r:isNaN(o)&&(t.value=n.settings.geo_radius_def||25),A(t),n.radius=parseFloat(t.value).toFixed(function(t){if(Math.floor(t)===t)return 0;var e=t.toString().split(".");return e[1]&&e[1].length||0}(t.value)),x.bind(this,n),C.call(this,n.slug,n.selected)}),250);function P(t,e){var n=this;WP_Grid_Builder.AutoComplete((function(o){var r=n.getFacet(e.id),i=t.querySelector('input[type="search"]'),a=t.querySelector(".wpgb-locate-button");if(r.length&&i){var c=G.apply(n,[t,e]);n.emit("autocomplete.options",[c,e]),o=o(i,c),i.setAttribute("autocomplete","new-password"),s(e,o),n.emit("autocomplete.init",[o,e]),t.addEventListener("change",(function(t){return t.stopPropagation()})),i.addEventListener("input",(function(){return a&&(a.hidden=""!==i.value)}))}else w.apply(n,[t,n.facet])}))}function k(t,e){var n=this,o=u(e),r=e.holder.querySelector(".wpgb-locate-button");"geolocation"in navigator&&(r&&(r.hidden=!0),o&&o.components.Clear.remove(),o&&o.components.Loader.append(),t.loaded&&navigator.geolocation.getCurrentPosition((function(o){var r=o.coords,i="".concat(r.latitude,",").concat(r.longitude);b.has(i)?T.call(n,e,r,b.get(i)):t.reverse(r.latitude,r.longitude,T.bind(n,e,r))}),(function(){o&&o.update(),!o.components.Clear.element.parentElement&&r&&(r.hidden=!1)})))}function E(t){var e,n=this,o=t.settings,r=o.geo_type;if(o.auto_geo_locate&&!t.hasGeolocated&&!t.selected.length){if((e="google"===r?new m(t):new y(t)).loaded)k.call(this,e,t);else var i=setInterval((function(){e.loaded&&(k.call(n,e,t),clearInterval(i))}),50);t.hasGeolocated=!0}}function T(t,e,n){var o="".concat(e.latitude,",").concat(e.longitude);b.set(o,n),t.selected=[e.latitude,e.longitude,t.radius||t.settings.geo_radius_def||25,n],C.call(this,t.slug,t.selected),L.call(this,t.holder,t)}function L(t,n){var o=n.selected,r=t.querySelector('input[type="search"]'),i=t.querySelector('input[type="number"]'),a=t.querySelector(".wpgb-locate-button");r&&(o.length<4?r.value="":r.value=e(o).slice(3).join(),a&&(a.hidden=""!==r.value),i&&(i.value=o[2]||n.radius||n.settings.geo_radius_def||25,n.radius=i.value,A(i)),c(n)&&u(n).update())}function A(t){t.style.width=0,t.style.minWidth=0,t.style.width=(t.scrollWidth||8*t.value.length+8)+"px",t.style.minWidth=""}function C(t,e){var n=this.getParams(t),o=this.getFacet(t);e.length>2&&(e[2]=o[0].radius||o[0].settings.geo_radius_def||25),(n&&n.join(","))!==(e&&e.join(","))&&(this.setParams(t,e),this.emit("change",[t,e]),this.refresh())}function G(t,e){var n,o=this,r=e.settings.geo_type,i=t.querySelector(".wpgb-locate-button");return n="google"===r?new m(e):new y(e),i&&i.addEventListener("click",(function(){return k.call(o,n,e)})),{loader:!0,messages:wpgb_settings.autocomplete,minLength:1,matchAll:!1,autoFocus:!0,clearLabel:wpgb_settings.autocomplete.clearLabel,highlighter:!1,filterResults:function(){return!0},autoSearch:!0,sortResults:!1,renderItem:function(t,e){var n=document.createDocumentFragment(),o=document.createElement("strong"),r=document.createElement("span");return o.textContent=t.primary,r.textContent=t.secondary,n.appendChild(o),t.secondary&&n.appendChild(r),e.classList.add("wpgb-geolocation-item"),n},source:function(t,e){if(t=t.toLowerCase().trim(),b.has(t))return e(b.get(t));M.call(n,t,e,b)},onSelect:function(t){var r=JSON.stringify(t);if(b.has(r))return C.call(o,e.slug,b.get(r));n.select(t,q.bind(o,e.slug,r))},onClear:function(){return C.call(o,e.slug,"")},onAbort:function(){return M.cancel()}}}var M=r()((function(t,e){t=t.toLowerCase().trim(),this.search(t,W.bind(null,t,e))}),250),W=function(t,e,n){b.set(t,n),e(n)},q=function(t,e,n){b.set(e,n),C.call(this,t,n)};function F(t){!function(t){t.facets.once("loaded",(function(){var t=this.facets;if(!Object.keys(t).length)return{};for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var n=t[e][0];if("geolocation"!==n.type)continue;return void E.call(this,n)}})),t.facets.on("render",_),WP_Grid_Builder.on("prerender",(function(t){t.querySelector(".wpgb-geolocation-facet")&&WP_Grid_Builder.AutoComplete()}
10))}(t)}function I(){if(WP_Grid_Builder.on("init",F),WP_Grid_Builder.instances)for(var t in WP_Grid_Builder.instances){var e=WP_Grid_Builder.instances[t];e.element.classList.contains("wpgb-enabled")&&F(e)}}window.WP_Grid_Builder?I():window.addEventListener("wpgb.loaded",(function(){return I()}))}()}();
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.