PageSourceSearch

https://parakeetcommunities.com/wp-content/plugins/park-web-corner…/js/elements/cs-pro-map-min.js?ver=1.0.2

js parakeetcommunities.com collected 2026-10-09 02:07:09 UTC 14,377 bytes, 1 lines download raw bytes

1const csParseJsonAttribute=(e,t)=>{const r=e.getAttribute(t);if(!r)return null;try{return JSON.parse(r)}catch(e){return null}},CS_FILTER_REGISTRY_TIMEOUT=3e3,CS_FILTER_REGISTRY_POLL=50,csFilterIdsInDocument=()=>{const e=[];return document.querySelectorAll("[data-brx-filter]").forEach(t=>{const r=csParseJsonAttribute(t,"data-brx-filter");r&&r.filterId&&e.push(r.filterId)}),e},csFilterRegistryReady=()=>{if(!window.bricksData)return!1;const e=window.bricksData.filterInstances,t=csFilterIdsInDocument();return!t.length||!!e&&t.every(t=>Object.prototype.hasOwnProperty.call(e,t))};let csFilterRegistryPromise=null;const csWhenFilterRegistryReady=()=>csFilterRegistryPromise||(csFilterRegistryPromise=new Promise(e=>{if(csFilterRegistryReady())return void e(!0);const t=Date.now(),r=()=>{if(!csFilterRegistryReady())return Date.now()-t>=3e3?(console.warn("[cs-pro-map] Bricks never finished registering its filters; bulk markers may not match the filtered list.",{filtersInDocument:csFilterIdsInDocument(),registry:window.bricksData?.filterInstances}),void e(!1)):void setTimeout(r,50);e(!0)};setTimeout(r,50)}),csFilterRegistryPromise),csProMap=new BricksFunction({parentNode:document,selector:".brxe-cspromap[data-map-options]",eachElement:e=>{const t=e.querySelector(".cs-pro-map__container");if(!t)return;const r=e.dataset.scriptId;if(!r)return;const a=JSON.parse(e.dataset.mapOptions),{map:n,layers:o,staticMarkers:s,staticPolygons:i}=a,c=n.buildings3d||{};let l=null,p=!1;const u=e=>!p&&(l?(l=null,p=!0,!1):(l=e,!0));if(Array.isArray(s))for(let e=0;e<s.length;e++){const t=s[e];if(t.lat&&t.lng&&!u({lat:t.lat,lng:t.lng}))break}if(!p&&Array.isArray(i))for(let e=0;e<i.length;e++){const t=i[e];if(t&&t.geojson&&!u({geojson:t.geojson}))break}const d=`.brxe-${n.queryID}`;!p&&n.queryID&&(()=>{const e=document.querySelectorAll(d);for(let t=0;t<e.length;t++){const r=e[t].querySelectorAll("div.cs-pro-map-connector");for(let e=0;e<r.length;e++){const t=r[e],a=t.getAttribute("data-cs-pro-map-latitude"),n=t.getAttribute("data-cs-pro-map-longitude");if(a&&n&&!u({lat:a,lng:n}))return;if(t.hasAttribute("data-cs-pro-map-polygon")&&!u({element:t}))return}}})();const m=!p&&(()=>{if(!l)return null;if(l.lat&&l.lng)return[parseFloat(l.lat),parseFloat(l.lng)];const e=l.geojson||(csParseJsonAttribute(l.element,"data-cs-pro-map-polygon")||{}).geojson;if(!e)return null;try{const t=L.geoJSON(e).getBounds();if(!t||!t.isValid())return null;const r=t.getCenter();return[r.lat,r.lng]}catch(e){return null}})()||[n.center.lat,n.center.lng],g=L.map(t,{...n,center:m,zoom:n.zoom});if(g.attributionControl&&g.attributionControl.setPrefix(!1),o&&o.length>0){const e={};if(o.forEach((r,a)=>{if("function"!=typeof L.maplibreGL)return;const n=L.maplibreGL({style:r.style,updateInterval:c.increaseFrameRate?0:32,pitch:c.pitch}),o=r.name||r.label||`Style ${a+1}`;e[o]=n;const s=()=>{const e=t.querySelector(".leaflet-gl-layer");e.style.opacity="1",setTimeout(()=>{e.style.transition=""},260)},i=()=>{const e=n.getMaplibreMap();if(e)try{if(!c.flatten)return;const t=e.getStyle().layers||[];t.filter(e=>"fill-extrusion"===e.type).forEach(t=>{e.setPaintProperty(t.id,"fill-extrusion-height",0),e.setPaintProperty(t.id,"fill-extrusion-base",0)})}finally{var t=0;c.flatten&&(t=320),setTimeout(()=>{s()},t)}else s()},l=()=>{const e=n.getMaplibreMap();e?e.isStyleLoaded()?i():(e.once("load",i),setTimeout(s,2e3)):s()};0===a?(n.addTo(g),l()):n.on("add",l)}),o.length>1){const r=void 0!==n.collapseLayerControl&&n.collapseLayerControl;if(L.control.layers(e,null,{collapsed:r}).addTo(g),n.layerControlToggleIcon){const e=t.querySelector(".leaflet-control-layers-toggle");e&&(e.innerHTML=n.layerControlToggleIcon)}}}let y;if(n.enableMarkerClusters&&"function"==typeof L.markerClusterGroup){const e=n.clusterSizes;y=L.markerClusterGroup({showCoverageOnHover:!1,iconCreateFunction:function(t){const r=t.getChildCount();let a=" marker-cluster--",n=e.small;return r<10?(a+="small",n=e.small):r<50?(a+="medium",n=e.medium):(a+="large",n=e.large),new L.DivIcon({html:`\n                        <div style="--cs-pro-map-marker-cluster-diameter: ${n}px;">
1\n                            <span>${r}</span>\n                        </div>\n                    `,className:"marker-cluster"+a,iconSize:new L.Point(n,n)})}}).addTo(g),g.getContainer().addEventListener("keydown",function(e){if("Enter"===e.key){const t=e.target;t&&t.classList.contains("marker-cluster")&&t.click()}})}else y=L.layerGroup().addTo(g);const f=new Map;let h=null;const k=e=>{h||(h=document.createElement("style"),h.setAttribute("data-cs-pro-map-popup-css",r),document.head.appendChild(h)),h.textContent=e||""},b=e=>{if("function"==typeof e.getLatLng)return e.getLatLng();const t=e.getPopup(),r=t?t.getLatLng():null;if(r)return r;if("function"==typeof e.getBounds){const t=e.getBounds();if(t&&t.isValid())return t.getCenter()}return null},I=(e,t)=>{if(!e)return;const r=g.project(e),a=g.getSize();r.y+=a.y/2-a.y*t,g.panTo(g.unproject(r),{animate:!0})},w=(e,t)=>{if(!t||!t.elementId||!t.objectId)return;const r=parseFloat(t.yOffset),a=isNaN(r)?.75:Math.min(Math.max(r,0),100)/100;e.bindPopup('<div class="cs-pro-map__popup-state" role="status"><span class="cs-pro-map__popup-spinner" aria-hidden="true"></span><span class="cs-pro-map__popup-sr">Loading…</span></div>',{maxWidth:300,className:"cs-pro-map__infobox-popup",autoPan:!1}),e.on("popupopen",()=>{I(b(e),a);const r=e.getPopup();if(!r)return;const n=r.getElement();if(n){n.setAttribute("aria-live","polite");const e=n.querySelector(".leaflet-popup-content");e&&(e.setAttribute("tabindex","0"),e.focus())}void 0===e._csPopupCss?(e=>{const t=`${e.elementId}:${e.objectId}:${e.kind||"marker"}`;if(f.has(t))return f.get(t);const r=fetch(window.bricksData.ajaxUrl,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:new URLSearchParams({action:"cs_pro_map_popup",nonce:window.bricksData.nonce,pageId:window.bricksData.postId,elementId:e.elementId,objectId:e.objectId,objectType:e.objectType||"post",kind:e.kind||"marker"})}).then(e=>e.json()).then(e=>{if(!(e&&e.success&&e.data&&e.data.html))throw new Error("Empty popup response");return{html:e.data.html,css:e.data.css||""}}).catch(e=>{throw f.delete(t),e});return f.set(t,r),r})(t).then(t=>{e.isPopupOpen()&&(k(t.css),e._csPopupCss=t.css,r.setContent((e=>{const t=document.createElement("div");t.className="cs-pro-map-connector__marker-popup-content",t.innerHTML=e;const r=document.createElement("div");return r.appendChild(t),r})(t.html)),r.update(),I(b(e),a))}).catch(()=>{e.isPopupOpen()&&(r.setContent('<div class="cs-pro-map__popup-state cs-pro-map__popup-state--error" role="alert">Sorry, this content could not be loaded.</div>
1'),r.update())}):k(e._csPopupCss)})},A=new Map,S=e=>{const t=document.createElement("div");return t.textContent=null==e?"":String(e),t.innerHTML},P=n.markerDefaults||{},_={image:e=>{const t=parseInt(e.markerWidth,10)||32,r=parseInt(e.markerHeight,10)||32,a=e.markerAnchorX??50,n=e.markerAnchorY??100,o=`image|${e.markerImage}|${t}|${r}|${a}|${n}`;if(!A.has(o)){const s=t*(a/100),i=r*(n/100);A.set(o,L.icon({iconUrl:e.markerImage,iconSize:[t,r],iconAnchor:[s,i],popupAnchor:[0,-i],className:"cs-pro-map__image-marker"}))}return A.get(o)},text:e=>{const t=e.markerText||"",r=e.markerAnchorX??50,a=e.markerAnchorY??50,n=`text|${t}|${r}|${a}`;return A.has(n)||A.set(n,L.divIcon({className:"cs-pro-map__text-marker-wrapper",html:`<div class="cs-pro-map__text-marker" style="transform: translate(-${r}%, -${a}%);">${S(t)}</div>`,iconSize:null,iconAnchor:[0,0]})),A.get(n)}};let T=[];const E=new Set,x=new Set,F=(e,t,r={},a=null)=>{if(!e||!t)return null;const n=((e={})=>{let t=e;const r=t.markerType||"image";return"text"===r?{...t,markerType:r,markerAnchorX:t.markerAnchorX??P.textAnchorX??50,markerAnchorY:t.markerAnchorY??P.textAnchorY??50}:{...t,markerType:r,markerImage:t.markerImage||P.image,markerWidth:t.markerWidth||P.width,markerHeight:t.markerHeight||P.height,markerAnchorX:t.markerAnchorX??P.imageAnchorX??50,markerAnchorY:t.markerAnchorY??P.imageAnchorY??100}})(r),o=_[n.markerType],s=o?{icon:o(n)}:{},i=parseFloat(e),c=parseFloat(t),l=L.marker([i,c],s);return l.on("add",()=>{const e=l.getElement();if(e&&(n.markerLabel&&(e.setAttribute("aria-label",n.markerLabel),e.setAttribute("title",n.markerLabel),"image"===n.markerType&&e.setAttribute("alt",n.markerLabel)),n.markerStyle))if("text"===n.markerType){const t=e.querySelector(".cs-pro-map__text-marker");t&&(t.style.cssText+=n.markerStyle)}else e.style.cssText+=n.markerStyle}),y.addLayer(l),a&&w(l,a),T.push([i,c]),g.csProMap.markers.push(l),l},v=()=>{T.length>0&&!1!==n.autoFitBounds&&g.fitBounds(T,{padding:[40,40]})},j=e=>{if(!e||!e.lat||!e.lng)return null;if(e.objectId){if(E.has(e.objectId))return null;E.add(e.objectId)}return F(e.lat,e.lng,e.data||{},e.popup||null)};let D=null;const C=(e,t)=>{"function"!=typeof e.getElement?"function"==typeof e.eachLayer&&e.eachLayer(e=>C(e,t)):t(e)},M=(e,t,r,a)=>{const n=e.getElement();if(!n)return;const o=(e=>e instanceof L.Polygon?"area":"line")(e);n.classList.add("area"===o?"cs-pro-map__polygon-area":"cs-pro-map__polygon-line"),a&&n.classList.add("cs-pro-map__polygon--clickable"),t.class&&String(t.class).split(/\s+/).forEach(e=>{e&&n.classList.add(e)});const s="area"===o?t.areaStyle:t.lineStyle;s&&(n.style.cssText+=s),r&&(n.setAttribute("aria-label",r),n.setAttribute("role",a?"button":"img")),a&&(n.setAttribute("tabindex","0"),n.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.openPopup())}))},O=e=>{if(!e||!e.geojson)return null;if(e.objectId){if(x.has(e.objectId))return null;x.add(e.objectId)}const t=e.data||{},r=e.popup||null;let a;try{a=L.geoJSON(e.geojson,{className:"cs-pro-map__polygon",interactive:!1,fillOpacity:1,opacity:1,onEachFeature:(e,a)=>{const n=e&&e.properties||{},o=n.label||t.polygonLabel||"",s=n.class?{...t,class:n.class}:t;(r||o||s.class)&&(e=>{C(e,e=>{e.options.interactive=!0})})(a),o&&a.bindTooltip(S(String(o)),{sticky:!0}),r&&w(a,r),a.on("add",()=>{C(a,e=>{M(e,s,o,!!r)})})}})}catch(e){return null}(D||(D=L.featureGroup().addTo(g)),D).addLayer(a);const n=a.getBounds();return n&&n.isValid()&&T.push([n.getNorth(),n.getWest()],[n.getSouth(),n.getEast()]),g.csProMap.polygons.push(a),a},R=[],N=[];let q=0,$=!0,J=!1;const U=["pagination","reset","apply","active-filters"],z=e=>{const t=e.currentValue;if(""===t||null==t)return!0;if(Array.isArray(t)){if(0===t.length)return!0;if("range"===e.filterType)return!e.hasChanged||JSON.stringify(t)===JSON.stringify([e.min,e.max])}return!1},G=()=>{const e=(()=>{const e=new Set;return new URLSearchParams(window.location.search).forEach((t,r)=>{""!==t&&e.add(r.replace(/\[[^\]]*\]$/,""))}),e})(),t={};return("function"==typeof window.bricksUtils?.getFiltersForQuery?window.bricksUtils.getFiltersForQuery(n.queryID):[]).forEac
1h(r=>{if(!r||!r.filterId)return;if(-1!==U.indexOf(r.filterType))return;const a=r.filterNiceName;a?e.has(a)&&(z(r)||(t[r.filterId]=r.currentValue)):z(r)||(t[r.filterId]=r.currentValue)}),t},Y=()=>{const e=window.bricksData.filterInstances||{},t="function"==typeof window.bricksUtils?.getSelectedFiltersForQuery?window.bricksUtils.getSelectedFiltersForQuery(n.queryID):{};return(e=>{const t={};return e.forEach(e=>{e&&e.filterId&&-1===U.indexOf(e.filterType)&&(z(e)||(t[e.filterId]=e.currentValue))}),t})(Object.keys(t||{}).map(t=>e[t]))};let B=null;const V=()=>({filters:null!==B?B:G(),pageFilters:window.bricksData.pageFilters||{}});let X=null,H=0;const W=()=>{const e=JSON.stringify(V());return e!==X&&(X=e,R.length=0,N.length=0,q=0,$=!0,J=!1,H+=1,!0)},Q=(e,t)=>{if(J)return;const r=q*e.pageSize,a=(e=>{const t=window.bricksData.queryLoopInstances?.[n.queryID];if(t){let e=t.queryVars;if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}const r=parseInt(t.page,10),a=parseInt(e?.posts_per_page,10);if(r>0&&a>0)return r*a}return e})(t);if(a<r)return;if(!$)return;if(q>=200)return;J=!0;const o=H;((e,t,r)=>fetch(window.bricksData.ajaxUrl,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:new URLSearchParams({action:"cs_pro_map_markers",nonce:window.bricksData.nonce,pageId:window.bricksData.postId,elementId:e.elementId,page:t,pageSize:e.pageSize,filters:JSON.stringify(r.filters),pageFilters:JSON.stringify(r.pageFilters)})}).then(e=>e.json()).then(e=>{if(!e||!e.success||!e.data)throw new Error(e?.data?.message||"Bulk marker request failed");return e.data}))(e,q+1,V()).then(r=>{o===H&&(q+=1,$=!!r.hasMore,(r.markers||[]).forEach(e=>{R.push(e),j(e)}),(r.polygons||[]).forEach(e=>{N.push(e),O(e)}),v(),J=!1,Q(e,t))}).catch(()=>{o===H&&(J=!1)})},K=()=>{y.clearLayers(),g.csProMap.markers=[],T=[],E.clear(),D&&(D.clearLayers(),g.csProMap.polygons=[],x.clear()),Array.isArray(s)&&s.forEach(e=>{F(e.lat,e.lng,e.data||{})}),Array.isArray(i)&&i.forEach(O);let e=[];document.querySelectorAll(d).forEach(t=>{e.push(...Array.from(t.querySelectorAll("div.cs-pro-map-connector")))}),e.forEach(e=>{const t=parseInt(e.getAttribute("data-cs-pro-map-object-id"),10),r=isNaN(t)?0:t;j({lat:e.getAttribute("data-cs-pro-map-latitude"),lng:e.getAttribute("data-cs-pro-map-longitude"),data:csParseJsonAttribute(e,"data-cs-pro-map-marker-data")||{},popup:csParseJsonAttribute(e,"data-cs-pro-map-popup"),objectId:r});const a=csParseJsonAttribute(e,"data-cs-pro-map-polygon");a&&(!a.objectId&&r&&(a.objectId=r),O(a))}),W(),R.forEach(j),N.forEach(O),v();const t=e.find(e=>e.hasAttribute("data-cs-pro-map-bulk"));if(t){const r=csParseJsonAttribute(t,"data-cs-pro-map-bulk"),a=e.length;r&&r.elementId&&csWhenFilterRegistryReady().then(()=>{W(),Q(r,a)})}};g.csProMap={settings:a,markerGroup:y,markers:[],polygons:[],addMarkerRecord:j,addPolygonRecord:O,render:()=>K(),get polygonGroup(){return D}},window.bricksData.csProMapInstances||(window.bricksData.csProMapInstances={}),window.bricksData.csProMapInstances[r]=g,K(),n.queryID&&(document.addEventListener("bricks/ajax/start",e=>{e.detail?.queryId===n.queryID&&(B=Y())}),document.addEventListener("bricks/ajax/nodes_added",e=>{const t=e.detail?.queryId;t===n.queryID&&K()})),e.removeAttribute("data-map-options")}}),csProMapInit=()=>{setTimeout(()=>csProMap.run(),0)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",csProMapInit,{once:!0}):csProMapInit();

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.