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Ac,CACpB,MAAMkC,EAAU,WACVjC,IAGLA,GAAY,EAEZkC,WAAY1B,EAASwB,EAAK9B,UAC3B,EAGAjG,EAAGoG,QACD9E,GAAI,SAAU0G,GACd1G,GAAI,SAAU0G,GACd1G,GAAI,QAAS0G,GACflC,GAAc,CACf,CAEKiC,EAAK7B,eACT+B,WAAY1B,EAASwB,EAAK9B,UAhE7B,SAAsBS,GACrBb,EAAUvB,KAAMoC,GAChBL,EAAe/B,MAChB,CAgEE4D,CAAaxB,EACd,EAEAd,eACC,QAAKE,IACJS,KACO,EAGT,GAED,CA3HD,CA2HKxG","sources":["webpack://connections/./assets/js/jquery/jquery.mapblock.js"],"sourcesContent":["/* eslint-disable no-console */\njQuery( function ( $ ) {\n\tconst map = [];\n\tlet id = 0;\n\n\t$.fn.mapBlock = function ( options ) {\n\t\tconsole.log( 'mapBlock found.' );\n\n\t\tconst attributes = {};\n\n\t\t$.each( $( this ).get( 0 ).attributes, function ( i, attrib ) {\n\t\t\tif ( 'data' === attrib.name.substring( 0, 4 ) ) {\n\t\t\t\tattributes[ attrib.name ] = attrib.value.replace( /_/g, ' ' );\n\t\t\t}\n\t\t} );\n\n\t\tconsole.log( attributes );\n\n\t\t$.each(\n\t\t\tattributes,\n\t\t\t/**\n\t\t\t * Iterate through the data attributes and strip off the leading \"data-\".\n\t\t\t *\n\t\t\t * @param {string} key\n\t\t\t * @param {string} value\n\t\t\t */\n\t\t\tfunction ( key, value ) {\n\t\t\t\tconst property = key.replace( 'data-', '' ).split( '-' );\n\n\t\t\t\tif ( property.length === 1 ) {\n\t\t\t\t\toptions[ property[ 0 ] ] = value;\n\t\t\t\t}\n\n\t\t\t\t// if ( property.length === 2 ) {\n\t\t\t\t// \tif ( typeof options[ property[ 0 ] ] === 'undefined' ) {\n\t\t\t\t// \t\toptions[ property[ 0 ] ] = {};\n\t\t\t\t// \t}\n\t\t\t\t// \toptions[ property[ 0 ] ][ property[ 1 ] ] = value;\n\t\t\t\t// }\n\n\t\t\t\t// if ( property.length === 3 ) {\n\t\t\t\t// \tif ( typeof options[ property[ 0 ] ] === 'undefined' ) {\n\t\t\t\t// \t\toptions[ property[ 0 ] ] = {};\n\t\t\t\t// \t}\n\t\t\t\t// \tif ( typeof options[ property[ 0 ] ][ property[ 1 ] ] === 'undefined' ) {\n\t\t\t\t// \t\toptions[ property[ 0 ] ][ property[ 1 ] ] = {};\n\t\t\t\t// \t}\n\t\t\t\t// \toptions[ property[ 0 ] ][ property[ 1 ] ][ property[ 2 ] ] = value;\n\t\t\t\t// }\n\t\t\t\t//\n\t\t\t\t// if ( property.length === 4 ) {\n\t\t\t\t// \tif ( typeof options[ property[ 0 ] ] === 'undefined' ) {\n\t\t\t\t// \t\toptions[ property[ 0 ] ] = {};\n\t\t\t\t// \t}\n\t\t\t\t// \tif ( typeof options[ property[ 0 ] ][ property[ 1 ] ] === 'undefined' ) {\n\t\t\t\t// \t\toptions[ property[ 0 ] ][ property[ 1 ] ] = {};\n\t\t\t\t// \t}\n\t\t\t\t// \tif ( typeof options[ property[ 0 ] ][ property[ 1 ] ][ property[ 2 ] ] === 'undefined' ) {\n\t\t\t\t// \t\toptions[ property[ 0 ] ][ property[ 1 ] ][ property[ 2 ] ] = {};\n\t\t\t\t// \t}\n\t\t\t\t// \toptions[ property[ 0 ] ][ property[ 1 ] ][ property[ 2 ] ][ property[ 3 ] ] = value;\n\t\t\t\t// }\n\t\t\t\t//\n\t\t\t\t// if ( property.length === 5 ) {\n\t\t\t\t// \tif ( typeof options[ property[ 0 ] ] === 'undefined' ) {\n\t\t\t\t// \t\toptions[ property[ 0 ] ] = {};\n\t\t\t\t// \t}\n\t\t\t\t// \tif ( typeof options[ property[ 0 ] ][ property[ 1 ] ] === 'undefined' ) {\n\t\t\t\t// \t\toptions[ property[ 0 ] ][ property[ 1 ] ] = {};\n\t\t\t\t// \t}\n\t\t\t\t// \tif ( typeof options[ property[ 0 ] ][ property[ 1 ] ][ property[ 2 ] ] === 'undefined' ) {\n\t\t\t\t// \t\toptions[ property[ 0 ] ][ property[ 1 ] ][ property[ 2 ] ] = {};\n\t\t\t\t// \t}\n\t\t\t\t// \tif ( typeof options[ property[ 0 ] ][ property[ 1 ] ][ property[ 2 ] ][ property[ 3 ] ] === 'undefined' ) {\n\t\t\t\t// \t\toptions[ property[ 0 ] ][ property[ 1 ] ][ property[ 2 ] ][ property[ 3 ] ] = {};\n\t\t\t\t// \t}\n\t\t\t\t//\n\t\t\t\t// \toptions[ property[ 0 ] ][ property[ 1 ] ][ property[ 2 ] ][ property[ 3 ] ][ property[ 4 ] ] = value;\n\t\t\t\t// }\n\t\t\t}\n\t\t);\n\n\t\tconsole.log( options );\n\n\t\tconst mapContainerID = $( this ).attr( 'id' );\n\t\tconsole.log( mapContainerID );\n\n\t\t// var tiles = L.tileLayer(\n\t\t// \t'//maps.wikimedia.org/osm-intl/{z}/{x}/{y}{r}.png',\n\t\t// \t{\n\t\t// \t\tattribution: 'Wikimedia'\n\t\t// \t}\n\t\t// );\n\n\t\t$( '#' + mapContainerID ).on(\n\t\t\t'appear',\n\t\t\t{ id, data: options },\n\t\t\tfunction ( event, elements ) {\n\t\t\t\telements.each( function () {\n\t\t\t\t\tconst mapID = event.data.id;\n\t\t\t\t\tconst mapOptions = event.data.data;\n\t\t\t\t\tconst mapContainer = $( this ).attr( 'id' );\n\n\t\t\t\t\tconsole.log( mapContainer + ':isVisible' );\n\n\t\t\t\t\tif ( 'undefined' === typeof map[ mapID ] ) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Temporarily set the array index to `addingMap` because maps are added async,\n\t\t\t\t\t\t * so if the event is triggered while the map is still being added it will\n\t\t\t\t\t\t * trigger a Leaflet error stating map has already being initialized.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * NOTE: Patching jQuery.appear() with PR gh-66 seems to negate this issue.\n\t\t\t\t\t\t */\n\t\t\t\t\t\t// map[ mapID ] = 'addingMap';\n\t\t\t\t\t\tmap[ mapID ] = L.map( mapContainer ).setView(\n\t\t\t\t\t\t\tL.latLng( mapOptions.center.split( ',' ) ),\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Clear the attribution, removing the Leaflet back link, so it can be customized.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tmap[ mapID ].attributionControl.setPrefix( '' );\n\n\t\t\t\t\t\tconst basemap = {};\n\n\t\t\t\t\t\t$.each(\n\t\t\t\t\t\t\t$( this ).children( 'map-tilelayer' ),\n\t\t\t\t\t\t\tfunction ( index, item ) {\n\t\t\t\t\t\t\t\tconst provider = $( item );\n\n\t\t\t\t\t\t\t\tconst tiles = /^google/.test(\n\t\t\t\t\t\t\t\t\tprovider.data( 'id' )\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t? L.gridLayer.googleMutant( {\n\t\t\t\t\t\t\t\t\t\t\ttype: provider.data( 'type' ),\n\t\t\t\t\t\t\t\t\t\t\tattribution: provider.html(),\n\t\t\t\t\t\t\t\t\t } )\n\t\t\t\t\t\t\t\t\t: L.tileLayer( provider.data( 'url' ), {\n\t\t\t\t\t\t\t\t\t\t\tattribution: provider.html(),\n\t\t\t\t\t\t\t\t\t\t\tsubdomains: provider.data(\n\t\t\t\t\t\t\t\t\t\t\t\t'subdomains'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tminZoom: provider.data( 'minzoom' ),\n\t\t\t\t\t\t\t\t\t\t\tmaxZoom: provider.data( 'maxzoom' ),\n\t\t\t\t\t\t\t\t\t } );\n\n\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t * Only add the first tile layer to the map, so it is selected by the\n\t\t\t\t\t\t\t\t * layer control by default.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tif ( $.isEmptyObject( basemap ) ) {\n\t\t\t\t\t\t\t\t\ttiles.addTo( map[ mapID ] );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Add the control for the tile layer.\n\t\t\t\t\t\t\t\tconst control = $( 'map-control-layers' ).find(\n\t\t\t\t\t\t\t\t\t'[data-id=\"' + provider.data( 'id' ) + '\"]'\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tif ( control.length ) {\n\t\t\t\t\t\t\t\t\tbasemap[ control.html() ] = tiles;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst layers = [];\n\t\t\t\t\t\tconst overlay = {};\n\t\t\t\t\t\tconst bounds = L.latLngBounds( [] ); // Create an empty instance of latLngBounds. Will be extended as layer groups are added.\n\t\t\t\t\t\tlet markerCount = 0;\n\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Find each layer group attached to the base map and add it as a feature group.\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$.each(\n\t\t\t\t\t\t\t$( this ).children( 'map-layergroup' ),\n\t\t\t\t\t\t\tfunction ( layerIndex, layerItem ) {\n\t\t\t\t\t\t\t\tconsole.log( layerItem );\n\t\t\t\t\t\t\t\tconst layer = $( layerItem );\n\t\t\t\t\t\t\t\tconst layerID = layer.data( 'id' );\n\t\t\t\t\t\t\t\t// const layerName = layer.data( 'name' );\n\t\t\t\t\t\t\t\t// var enableControl = layer.data( 'control' );\n\t\t\t\t\t\t\t\tconst markers = [];\n\n\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t * Find each marker attached to the current layer group and attach it to the feature group.\n\t\t\t\t\t\t\t\t * Expand the bounds to fit the markers added to the group.\n\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t\t * NOTE: This code is duplicated below and could be abstracted to remove duplicate code.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t$.each(\n\t\t\t\t\t\t\t\t\t$( this ).children( 'map-marker' ),\n\t\t\t\t\t\t\t\t\tfunction ( markerIndex, markerItem ) {\n\t\t\t\t\t\t\t\t\t\tconsole.log( markerItem );\n\t\t\t\t\t\t\t\t\t\tconst marker = $( markerItem );\n\t\t\t\t\t\t\t\t\t\tconst latitude = marker.data(\n\t\t\t\t\t\t\t\t\t\t\t'latitude'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tconst longitude = marker.data(\n\t\t\t\t\t\t\t\t\t\t\t'longitude'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tconst popup = marker.find(\n\t\t\t\t\t\t\t\t\t\t\t'map-marker-popup'\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\tif ( 0 === popup.length ) {\n\t\t\t\t\t\t\t\t\t\t\tmarkers.push(\n\t\t\t\t\t\t\t\t\t\t\t\tL.marker( [\n\t\t\t\t\t\t\t\t\t\t\t\t\tlatitude,\n\t\t\t\t\t\t\t\t\t\t\t\t\tlongitude,\n\t\t\t\t\t\t\t\t\t\t\t\t] )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tmarkers.push(\n\t\t\t\t\t\t\t\t\t\t\t\tL.marker( [\n\t\t\t\t\t\t\t\t\t\t\t\t\tlatitude,\n\t\t\t\t\t\t\t\t\t\t\t\t\tlongitude,\n\t\t\t\t\t\t\t\t\t\t\t\t] ).bindPopup( popup.html() )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tmarkerCount++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tlayers[ layerID ] = L.featureGroup(\n\t\t\t\t\t\t\t\t\tmarkers\n\t\t\t\t\t\t\t\t).addTo( map[ mapID ] );\n\n\t\t\t\t\t\t\t\t// Extend the map bounds to fit all makers added to layer group.\n\t\t\t\t\t\t\t\tbounds.extend( layers[ layerID ].getBounds() );\n\n\t\t\t\t\t\t\t\t// Add the control for the layer.\n\t\t\t\t\t\t\t\tconst control = $( 'map-control-layers' ).find(\n\t\t\t\t\t\t\t\t\t'[data-mapID=\"' + layerID + '\"]'\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tif ( control.length ) {\n\t\t\t\t\t\t\t\t\toverlay[ control.html() ] =\n\t\t\t\t\t\t\t\t\t\tlayers[ layerID ];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Add each marker directly to the map to the base map as a feature group.\n\t\t\t\t\t\t * Expand the bounds to fit the markers added to the group.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * NOTE: This is mostly duplicate code from above and could like be abstracted out.\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$.each(\n\t\t\t\t\t\t\t$( this ).children( 'map-marker' ),\n\t\t\t\t\t\t\tfunction ( index, item ) {\n\t\t\t\t\t\t\t\tconst markers = [];\n\n\t\t\t\t\t\t\t\tconsole.log( item );\n\t\t\t\t\t\t\t\tconst marker = $( item );\n\t\t\t\t\t\t\t\tconst latitude = marker.data( 'latitude' );\n\t\t\t\t\t\t\t\tconst longitude = marker.data( 'longitude' );\n\t\t\t\t\t\t\t\tconst popup = marker.find( 'map-marker-popup' );\n\n\t\t\t\t\t\t\t\tif ( 0 === popup.length ) {\n\t\t\t\t\t\t\t\t\tmarkers.push(\n\t\t\t\t\t\t\t\t\t\tL.marker( [ latitude, longitude ] )\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tmarkers.push(\n\t\t\t\t\t\t\t\t\t\tL.marker( [\n\t\t\t\t\t\t\t\t\t\t\tlatitude,\n\t\t\t\t\t\t\t\t\t\t\tlongitude,\n\t\t\t\t\t\t\t\t\t\t] ).bindPopup( popup.html() )\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tconst group = L.featureGroup( markers ).addTo(\n\t\t\t\t\t\t\t\t\tmap[ mapID ]\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t// Extend the map bounds to fit all makers added to layer group.\n\t\t\t\t\t\t\t\tbounds.extend( group.getBounds() );\n\n\t\t\t\t\t\t\t\tmarkerCount++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Only add the control if a layer group has been configured to be toggleable.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t! $.isEmptyObject( basemap ) ||\n\t\t\t\t\t\t\t! $.isEmptyObject( overlay )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst layerControl = $( this ).find(\n\t\t\t\t\t\t\t\t'map-control-layers'\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Whether a layer is \"selected\" or not in the layer control\n\t\t\t\t\t\t\t * depends on whether the layer is added to the map or not\n\t\t\t\t\t\t\t * via the `addTo()` method.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tL.control\n\t\t\t\t\t\t\t\t.layers( basemap, overlay, {\n\t\t\t\t\t\t\t\t\tcollapsed: layerControl.data( 'collapsed' ),\n\t\t\t\t\t\t\t\t\thideSingleBase: true,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t.addTo( map[ mapID ] );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( bounds.isValid() ) {\n\t\t\t\t\t\t\t// Set the map view to fit bounds of all layer groups.\n\t\t\t\t\t\t\tmap[ mapID ].fitBounds( bounds, {\n\t\t\t\t\t\t\t\tpadding: L.point( 20, 20 ),\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if the marker count is 1, use the supplied zoom value.\n\t\t\t\t\t\tif ( 1 >= markerCount ) {\n\t\t\t\t\t\t\tmap[ mapID ].setZoom( mapOptions.zoom );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Add a listener to fit map bounds.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * {@link https://stackoverflow.com/a/45303126/5351316}\n\t\t\t\t\t\t */\n\t\t\t\t\t\tmap[ mapID ].on(\n\t\t\t\t\t\t\t'overlayadd overlayremove',\n\t\t\t\t\t\t\tfunction ( e ) {\n\t\t\t\t\t\t\t\tconsole.log( e );\n\t\t\t\t\t\t\t\t// map[ mapID ].fitBounds(e.layer.getBounds());\n\n\t\t\t\t\t\t\t\t// Create new empty bounds\n\t\t\t\t\t\t\t\tconst bounds = new L.LatLngBounds( [] );\n\n\t\t\t\t\t\t\t\t// Iterate the map's layers\n\t\t\t\t\t\t\t\tmap[ mapID ].eachLayer( function ( layer ) {\n\t\t\t\t\t\t\t\t\t// Check if layer is a feature group.\n\t\t\t\t\t\t\t\t\tif ( layer instanceof L.FeatureGroup ) {\n\t\t\t\t\t\t\t\t\t\t// Extend bounds with group's bounds\n\t\t\t\t\t\t\t\t\t\tbounds.extend( layer.getBounds() );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\t// Check if bounds are valid (could be empty)\n\t\t\t\t\t\t\t\tif ( bounds.isValid() ) {\n\t\t\t\t\t\t\t\t\t// Valid, fit bounds\n\t\t\t\t\t\t\t\t\tmap[ mapID ].fitBounds( bounds );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// Invalid, fit world\n\t\t\t\t\t\t\t\t\tmap[ mapID ].fitWorld();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t);\n\n\t\t$.inView( '#' + mapContainerID );\n\n\t\t/**\n\t\t * {@link https://stackoverflow.com/a/16462443/5351316}\n\t\t * {@link https://stackoverflow.com/a/48303093/5351316}\n\t\t */\n\n\t\t// var observer = new MutationObserver( function( mutations ) {\n\t\t// \tconsole.log( 'Attributes changed!' );\n\t\t// });\n\t\t//\n\t\t// var target = document.querySelector( '#' + mapContainerID );\n\t\t//\n\t\t// observer.observe( target, {\n\t\t// \tattributes: true\n\t\t// });\n\n\t\t// var targetNode = document.getElementById( mapContainerID );\n\t\t//\n\t\t// var observer = new MutationObserver( function( mutations ) {\n\t\t//\n\t\t// \t// if ( 'none' !== targetNode.style.display ) {\n\t\t// \t// \tconsole.log( 'Attributes changed!' );\n\t\t// \t// }\n\t\t//\n\t\t// \t// For the sake of...observation...let's output the mutation to console to see how this all works\n\t\t// \tmutations.forEach( function( mutation ) {\n\t\t// \t\tconsole.log( mutation.type );\n\t\t// \t});\n\t\t// });\n\t\t//\n\t\t// observer.observe( targetNode, { attributes: true, childList: true, characterData: true } );\n\n\t\t/**\n\t\t * {@link https://stackoverflow.com/a/44670818/5351316}\n\t\t */\n\t\t// var respondToVisibility = function( element, callback ) {\n\t\t//\n\t\t// \tvar options = {\n\t\t// \t\troot: document.documentElement\n\t\t// \t};\n\t\t//\n\t\t// \tvar observer = new IntersectionObserver( ( entries, observer ) => {\n\t\t// \t\tentries.forEach( entry => {\n\t\t// \t\tcallback( entry.intersectionRatio > 0 )\n\t\t// \t\t});\n\t\t// \t},\n\t\t// \t\toptions\n\t\t// \t);\n\t\t//\n\t\t// \tobserver.observe( element );\n\t\t// };\n\t\t//\n\t\t// respondToVisibility( document.getElementById( mapContainerID ), visible => {\n\t\t//\n\t\t// \tconsole.log( 'isVisible');\n\t\t// });\n\n\t\tid++;\n\t};\n\n\t$( 'map-block' ).each( function () {\n\t\tconst options = {};\n\t\t$( this ).mapBlock( options );\n\t} );\n\n\t$.force_appear();\n} );\n\n/*\n * NOTE: Pull on 9/3/2018\n * Applied PR gh-66 to make sure appear is only fire once in view.\n *\n * NOTE: Add on click event to $.appear to make sure it is triggered when items in tabs appear.\n *\n * NOTE: Rename `appear` to `inView` to prevent conflict with theme's, such as Tower,\n * which are using old versions of this script.\n *\n * jQuery appear plugin\n *\n * Copyright (c) 2012 Andrey Sidorov\n * licensed under MIT license.\n *\n * https://github.com/morr/jquery.appear/\n *\n * Version: 0.4.1\n */\n( function ( $ ) {\n\tconst selectors = [];\n\n\tlet checkBinded = false;\n\tlet checkLock = false;\n\tconst defaults = {\n\t\tinterval: 250,\n\t\tforce_process: false,\n\t};\n\tconst $window = $( window );\n\n\tconst $priorAppeared = [];\n\tconst $inView = [];\n\n\tfunction appeared( selector ) {\n\t\treturn $( selector ).filter( function () {\n\t\t\treturn $( this ).is( ':appeared' );\n\t\t} );\n\t}\n\n\tfunction process() {\n\t\tcheckLock = false;\n\t\tfor (\n\t\t\tlet index = 0, selectorsLength = selectors.length;\n\t\t\tindex < selectorsLength;\n\t\t\tindex++\n\t\t) {\n\t\t\tconst $appeared = appeared( selectors[ index ] );\n\n\t\t\tif ( $appeared.length && $inView[ index ] !== true ) {\n\t\t\t\t$appeared.trigger( 'appear', [ $appeared ] );\n\t\t\t\t$inView[ index ] = true;\n\t\t\t}\n\n\t\t\tif ( $priorAppeared[ index ] ) {\n\t\t\t\tconst $disappeared = $priorAppeared[ index ].not( $appeared );\n\t\t\t\tif ( $disappeared.length ) {\n\t\t\t\t\t$disappeared.trigger( 'disappear', [ $disappeared ] );\n\t\t\t\t\t$inView[ index ] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$priorAppeared[ index ] = $appeared;\n\t\t}\n\t}\n\n\tfunction addSelector( selector ) {\n\t\tselectors.push( selector );\n\t\t$priorAppeared.push();\n\t}\n\n\t// \":appeared\" custom filter\n\t$.expr.pseudos.appeared = $.expr.createPseudo( function () {\n\t\treturn function ( element ) {\n\t\t\tconst $element = $( element );\n\t\t\tif ( ! $element.is( ':visible' ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst windowLeft = $window.scrollLeft();\n\t\t\tconst windowTop = $window.scrollTop();\n\t\t\tconst offset = $element.offset();\n\t\t\tconst left = offset.left;\n\t\t\tconst top = offset.top;\n\n\t\t\tif (\n\t\t\t\ttop + $element.height() >= windowTop &&\n\t\t\t\ttop - ( $element.data( 'in-view-top-offset' ) || 0 ) <=\n\t\t\t\t\twindowTop + $window.height() &&\n\t\t\t\tleft + $element.width() >= windowLeft &&\n\t\t\t\tleft - ( $element.data( 'in-view-left-offset' ) || 0 ) <=\n\t\t\t\t\twindowLeft + $window.width()\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t} );\n\n\t$.fn.extend( {\n\t\t// watching for element's appearance in browser viewport\n\t\tinView( selector, options ) {\n\t\t\t$.inView( this, options );\n\t\t\treturn this;\n\t\t},\n\t} );\n\n\t$.extend( {\n\t\tinView( selector, options ) {\n\t\t\tconst opts = $.extend( {}, defaults, options || {} );\n\n\t\t\tif ( ! checkBinded ) {\n\t\t\t\tconst onCheck = function () {\n\t\t\t\t\tif ( checkLock ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tcheckLock = true;\n\n\t\t\t\t\tsetTimeout( process, opts.interval );\n\t\t\t\t};\n\n\t\t\t\t// $(window).scroll(onCheck).resize(onCheck);\n\t\t\t\t$( window )\n\t\t\t\t\t.on( 'scroll', onCheck )\n\t\t\t\t\t.on( 'resize', onCheck )\n\t\t\t\t\t.on( 'click', onCheck );\n\t\t\t\tcheckBinded = true;\n\t\t\t}\n\n\t\t\tif ( opts.force_process ) {\n\t\t\t\tsetTimeout( process, opts.interval );\n\t\t\t}\n\n\t\t\taddSelector( selector );\n\t\t},\n\t\t// force element's appearance check\n\t\tforce_appear() {\n\t\t\tif ( checkBinded ) {\n\t\t\t\tprocess();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t} );\n} )( jQuery );\n"],"names":["jQuery","$","map","id","fn","mapBlock","options","attributes","each","this","get","i","attrib","name","substring","value","replace","key","property","split","length","mapContainerID","attr","on","data","event","elements","mapID","mapOptions","mapContainer","L","setView","latLng","center","attributionControl","setPrefix","basemap","children","index","item","provider","tiles","test","gridLayer","googleMutant","type","attribution","html","tileLayer","subdomains","minZoom","maxZoom","isEmptyObject","addTo","control","find","layers","overlay","bounds","latLngBounds","markerCount","layerIndex","layerItem","layerID","markers","markerIndex","markerItem","marker","latitude","longitude","popup","push","bindPopup","featureGroup","extend","getBounds","group","layerControl","collapsed","hideSingleBase","isValid","fitBounds","padding","point","setZoom","zoom","e","LatLngBounds","eachLayer","layer","FeatureGroup","fitWorld","inView","force_appear","selectors","checkBinded","checkLock","defaults","interval","force_process","$window","window","$priorAppeared","$inView","process","selectorsLength","$appeared","selector","filter","is","trigger","$disappeared","not","expr","pseudos","appeared","createPseudo","element","$element","windowLeft","scrollLeft","windowTop","scrollTop","offset","left","top","height","width","opts","onCheck","setTimeout","addSelector"],"sourceRoot":""}