1/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */ 2!(function($,Drupal){Drupal.behaviors.locationHomePageMapBehavior={attach:function(context){const environmentLocationAsc=drupalSettings.uihc_location_search.search_environment+'_uihc_locations_asc';const searchClient=Drupal.uihcAlgoliaProxyClient('APP_ID','SEARCH_KEY');const search=instantsearch({searchClient,indexName:environmentLocationAsc,routing:true});search.addWidgets([instantsearch.widgets.configure({hitsPerPage:9999}),instantsearch.widgets.searchBox({container:'#location-homepage-map__keyword-search-box',placeholder:'Search locations',cssClasses:{root:'location-homepage-map__keywordSearchBox'},queryHook:function(query,search){clearTimeout(window._roSearchTimer);window._roSearchTimer=setTimeout(function(){search(query);},300);}}),instantsearch.widgets.toggleRefinement({container:'#location-homepage-map__providers-peds-toggle',attribute:'field_provides_pediatric_care',templates:{labelText:'Provides pediatric care'}}),instantsearch.widgets.hits({container:'#location-homepage-map__location-results',escapeHTML:false,templates:{item:'<div class="location-address-directions">'+'<div class="location-title">'+'<a class="location-title-link" href="{{url}}">'+'<h4 class="location-title-heading{{#field_provides_pediatric_care}} peds-flag{{/field_provides_pediatric_care}}">{{title}}</h4>'+'</a>'+'</div>'+'<div class="location-address">'+'<div class="location-street">{{address_line1}}</div>'+'<div class="location-city-state-zip">{{locality}}, {{administrative_area}} {{postal_code}}</div>'+'</div>'+'{{#phone}}<div class="location-phone"><a class="location-phone-link" href="tel:{{phone}}">{{phone}}</a></div>{{/phone}}'+'{{#field_get_directions_url}}<div class="location-directions"><a href="{{field_get_directions_url}}" target="_blank">Get Directions</a></div>{{/field_get_directions_url}}'+'</div>'},transformItems:function(items){items.forEach(function(item,i){if(item.phone){const formattedPhone=formatPhoneNumber(item.phone);item.phone=formattedPhone;}if(item.field_get_directions_url)item.field_get_directions_url=item.field_get_directions_url;else item.field_get_directions_url=formatAddressForGoogle(item.address_line1,item.locality,item.administrative_area,item.postal_code);if(item.url){let secondaryUrl="";if(item.provider_secondary_url)secondaryUrl=item.provider_secondary_url;item.url=pedsCheckUrl(item.url,secondaryUrl);}if(item.field_hero_image)item.image=item.field_hero_image;else item.image=item.image;});return items;}}),instantsearch.widgets.geoSearch({container:'#location-homepage-map__map',initialZoom:8,enableRefine:false,enableClearMapRefinement:false,enableRefineControl:false,enableRefineOnMapMove:false,googleReference:window.google,mapOptions:{mapTypeId:window.google.maps.MapTypeId.ROADMAP,maxZoom:18,zoomControlOptions:{position:window.google.maps.ControlPosition.RIGHT_TOP}},customHTMLMarker:{events:{click({event,item,marker,map}){if(item.phone)phone='<div class="location-phone"><a class="location-phone-link" href="tel:'+formatPhoneNumber(item.phone)+'">'+formatPhoneNumber(item.phone)+'</a></div>';else phone='';const contentString='<div class="location-homepage-map__map-marker-info-window">'+'<div class="location-homepage-map__map-marker-location-title"><a class="location-title-link" href="'+item.url+'"><div class="location-title-heading">'+item.title+'</div></a></div>'+'<div class="location-address">'+'<div class="location-street">'+item.address_line1+'</div>'+'<div class="location-city-state-zip">'+item.locality+', '+item.administrative_area+' '+item.postal_code+'</div>'+phone+'<div class="location-directions"><a href="'+formatAddressForGoogle(item.address_line1,item.locality,item.administrative_area,item.postal_code)+'" target="_blank">Get Directions</a></div>'+'</div>'+'<div class="location-homepage-map__map-marker-info-window-arrow"></div>'+'</div>';const infowindow=new google.maps.InfoWindow({content:contentString});infowindow.open({anchor:marker,map,shouldFocus:true});map.setCenter(marker.getPosition());map.setZoom(18);}}},templates:{HTMLMarker:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="34" height="50" viewB
2ox="0 0 34 50" xml:space="preserve"><path fill="#FFFFFF" d="M29.2,26.3L17.1,47.7l-0.3,0.6l-12.4-22c0-0.1-3.2-6-3.2-9.5c0-8.6,7-15.6,15.6-15.6s15.6,7,15.6,15.6 C32.4,20.3,29.2,26.2,29.2,26.3z"/><g><path fill="#FFCD00" d="M30,8C24.3,1.5,14.5,0.8,8,6.5c-3.4,3-5.4,7.3-5.4,11.8c0,3.5,3.1,9.4,3.2,9.5l12.4,22l0.3-0.6l12.1-21.4 c0,0,3.2-6,3.2-9.5C33.9,14.5,32.5,10.8,30,8z M16.8,28c-6.2,0-11.2-5-11.2-11.2C5.6,9.9,12,5.6,16.8,5.6c1.4,0,2.8,0.3,4.1,0.8 c4.3,1.7,7.1,5.8,7.1,10.4C27.9,22.9,22.9,27.9,16.8,28z"/><path d="M32.9,12.9c-2-8.2-9.7-13.6-18.1-12.6C6.4,1.3,0.1,8.4,0.1,16.8c0,3.8,3.2,9.7,3.3,10l12.9,22.8c0.1,0.2,0.5,0.3,0.7,0.2 c0.1,0,0.1-0.1,0.2-0.2l0.5-0.8l12.4-22c0.1-0.2,3.3-6.2,3.3-10C33.4,15.5,33.2,14.2,32.9,12.9z M29.2,26.3L17.1,47.7l-0.3,0.6 l-12.4-22c0-0.1-3.2-6-3.2-9.5c0-8.6,7-15.6,15.6-15.6s15.6,7,15.6,15.6C32.4,20.3,29.2,26.2,29.2,26.3z"/><path d="M16.8,4.6C10,4.6,4.5,10,4.5,16.8C4.5,23.5,9.9,29,16.7,29s12.2-5.4,12.2-12.2S23.5,4.6,16.8,4.6z M16.8,28 c-6.2,0-11.1-5-11.2-11.2C5.6,9.9,12,5.6,16.8,5.6c1.4,0,2.8,0.3,4.1,0.8c4.3,1.7,7.1,5.8,7.1,10.4C27.9,22.9,22.9,27.9,16.8,28 C16.8,28,16.8,28,16.8,28z"/></g></svg>'}})]);search.start();function pedsCheckUrl(url,secondaryUrl){if($('#providers-childrens-toggle .ais-ToggleRefinement-checkbox').is(':checked')){if(!url.includes('/childrens/'))url=secondaryUrl;return url;}else return url;}function formatPhoneNumber(phone){const phoneIni=phone.replace(/[^\d]/g,"");if(phoneIni.length>=12){const match=phoneIni.match(/^(\d{1})(\d{3})?[- ]??[\s]?(\d{3})?[\s]?(\d{4})?(.*)?$/);return [match[1]+'-'+match[2]+'-'+match[3]+'-'+match[4]+' x'+match[5]];}else if(phoneIni.length===11){const match=phoneIni.match(/^(\d{1})(\d{3})(\d{3})(\d{4})$/);if(match)return [match[1]+'-'+match[2]+'-'+match[3]+'-'+match[4]];return null;}else if(phoneIni.length===10){const match=phoneIni.match(/^(\d{3})(\d{3})(\d{4})$/);if(match)return '1-'+[match[1]+'-'+match[2]+'-'+match[3]];return null;}else if(phoneIni.length===7){const match=phoneIni.match(/^(\d{3})(\d{4})$/);if(match)return [match[1]+'-'+match[2]];return null;}else return null;}function formatAddressForGoogle(loc_address,loc_city,loc_state,loc_zip){const saddress=loc_address.replace(/\s+/g,'+');const city=loc_city.replace(/\s+/g,'+');const state=loc_state.replace(/\s+/g,'+');const map_url='https://www.google.com/maps/dir/?api=1&destination='+saddress+'%2C+'+city+'%2C+'+state+'+'+loc_zip;return map_url;}}};})(jQuery,Drupal);;
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.