PageSourceSearch

https://www.sanfordhealth.org/scripts/find-a-doctor.min.js?v=vPuhqjeRGxbWLpV65OYEgR-sJD-FnAPJqiR7NsjurU01

js sanfordhealth.org collected 2026-10-09 22:19:05 UTC 19,544 bytes, 1 lines download raw bytes

1var autocomplete,constant_radius=1609.344,coveoDocPos,lat,lng,state,previousAddress,searchInterface=document.getElementById("search"),sort=document.getElementById("sort"),userLocationBtnClicked=!1,queryParamKey="q",addressParamKey="address",facetParamKey="f",sortClicked=!1,resultsTotalCount,surveyPosition,hash=new URLSearchParams(location.hash),isSuggestionSelectedFacet=!1,isAnyFacetChecked=!0,isSuggestionClicked=!1,isApplyingMatchedSpecialtyFacet=!1,initialAutoLocationPending=!1,medicalServices,pendingInitialSearch;document.addEventListener("DOMContentLoaded",function(){Coveo.$$(searchInterface).on(Coveo.InitializationEvents.afterComponentsInitialization,function(){Coveo.state(searchInterface).registerNewAttribute("address","");Coveo.state(searchInterface).registerNewAttribute("letter","");Coveo.state(searchInterface).registerNewAttribute("radius","")});Coveo.$$(searchInterface).on(Coveo.InitializationEvents.afterInitialization,function(){surveyPosition=$(".survey-block").data("survey-position");var u=document.querySelector(".CoveoResultList"),f=new MutationObserver(function(){initializeColorbox()});f.observe(u,{subtree:!0,childList:!0});document.getElementById("sort-last-name-ascending").value="@"+Coveo.coveoFieldName("lastname")+" ascending";document.getElementById("sort-last-name-descending").value="@"+Coveo.coveoFieldName("lastname")+" descending";initAutocomplete();var t=searchInterface.querySelector(".CoveoSearchbox .magic-box .magic-box-input > input");t&&t.setAttribute("title","Type a doctor's name or a type of care");$(".clear-all-facets").click(function(n){n.preventDefault();$(".coveo-breadcrumb-clear-all").click()});var e=function(){navigator.geolocation&&(initialAutoLocationPending=!0,navigator.geolocation.getCurrentPosition(geolocationSuccess,geolocationError,{timeout:12e4}))};e();populateMedicalServicesList();document.getElementById("use-location").onclick=function(){userLocationBtnClicked=!0;populateAddressField()};document.getElementById("sort").onchange=function(){const n=this.value;isSuggestionSelectedFacet=!1;Coveo.state(searchInterface,"srt",n);sortClicked=!0;executeSearch()};document.getElementById("letters-buttons").onclick=function(n){n.preventDefault();executeSearch()};$(".common-search").click(function(n){n.preventDefault();var t=Coveo.get(document.getElementById("doctors-facet-by-type-of-care")),i=$(this).data("type-of-care").split(";");t.reset();t.selectMultipleValues(i);executeSearch()});$(".coveo-summary-section").hide();Coveo.$$(searchInterface).on(Coveo.QueryEvents.newQuery,function(n,t){var i=$("#address").val(),r=document.getElementById("fad-results");if(r.classList.contains("hidden")&&r.classList.remove("hidden"),i!=""&&previousAddress!=i){t.cancel=!0;previousAddress=i;var u=new google.maps.Geocoder;u.geocode({address:i},function(n,t){if(t==google.maps.GeocoderStatus.OK){formattedAddress=n[0].formatted_address;var i=n[0].address_components.find(n=>n.types.includes("administrative_area_level_1"));state=i?i.long_name:null;formattedAddress=="Moorhead, MN, USA"?(lat="46.8538988",lng="-96.7324909"):(lat=n[0].geometry.location.lat(),lng=n[0].geometry.location.lng());Coveo.$("#search").coveo("executeQuery")}else locationReset(),Coveo.$("#search").coveo("executeQuery"),console.log("Geocode was not successful for the following reason: "+t)})}else i==""&&locationReset();coveoDocPos=$(document).scrollTop()});Coveo.$$(searchInterface).on(Coveo.QueryEvents.buildingQuery,function(n,t){var u=[],e=Coveo.state(searchInterface,"q"),v=document.getElementById("search-card-results").getAttribute("data-doctor-location-count"),o=document.getElementById("doctors-facet-by-type-of-care");o!==null&&(u=Coveo.get(o).getSelectedValues());let s=getMatchingSpecialties(medicalServices,e);if(!isApplyingMatchedSpecialtyFacet&&u.length===0&&Array.isArray(s)&&s.length){t.cancel=!0;applyMatchedSpecialtyFacet(s);executeSearch();return}if(document.getElementById("doctors-facet-by-city")!==null&&(citystateFacetSelectedValues=Coveo.get(document.getElementById("doctors-facet-by-city")).getSelectedValues(),citystateFacetSelectedValues.length>0)){let r=getDistinctStates(citystateFacetSelectedValues);const i=t.queryBuilder.advancedExpression.getParts(),n=i.findIndex(n=>n.includes("fcitystate"));if(n>=0){const f=i[n],u=buildVirtualCareConditions(r);if(u){const i=`((${f}) OR ${u})`;t.queryBuilder.advancedExpression.parts[n]=i}}}if(o!==null)if(u.length>0){isAnyFacetChecked=!0;for(var i=0;i<u.length;i++)t.queryBuilder.advancedExpression.add("$qre(expression:@"+Coveo.coveo
1FieldName("primaryspeciality")+'  == "'+u[i]+"\", modifier:'100')")}else isAnyFacetChecked=!1;e&&t.queryBuilder.advancedExpression.add("$qre(expression:@"+Coveo.coveoFieldName("primaryspeciality")+' == "'+e+"\", modifier:'100')");$(".coveo-facet-column").show();$(".coveo-results-column").show();$("#sort").show();var h=$(".letter.active").text(),h=$(".letter.active").text(),c=$("#address").val(),k=$("#address").val(),f=$("#radius").val();if(Coveo.state(Coveo.$$(document).find("#search"),"address",k),Coveo.state(Coveo.$$(document).find("#search"),"letter",h),Coveo.state(Coveo.$$(document).find("#search"),"radius",f),lat!=null&&lng!=null||c!=null&&c!==""){var y=new Coveo.ExpressionBuilder,r=new Coveo.ExpressionBuilder,l=new Coveo.ExpressionBuilder,d="$qf(function: 'dist(@".concat(Coveo.coveoFieldName("reflatitude"),", @").concat(Coveo.coveoFieldName("reflongitude"),",").concat(lat,", ").concat(lng,") / ").concat(constant_radius,"', fieldName: '").concat(Coveo.coveoFieldName("distance"),"')");l.add(d);var g=f?`@${Coveo.coveoFieldName("distance")} < ${f}`:`@${Coveo.coveoFieldName("distance")} > 0`;l.add(g);r=Coveo.ExpressionBuilder.mergeUsingOr(r,l);for(var nt="@"+Coveo.coveoFieldName("isvirtualonly"),i=0;i<v;i++){var p=new Coveo.ExpressionBuilder,tt="$qf(function:'(1 - "+nt+") * dist(@".concat(Coveo.coveoFieldName("doctorlatitude".concat(i)),", @").concat(Coveo.coveoFieldName("doctorlongitude".concat(i)),",").concat(lat,", ").concat(lng,") / ").concat(constant_radius,"',fieldName: 'distance").concat(i,"')");p.add(tt);r=Coveo.ExpressionBuilder.mergeUsingOr(r,p)}for(var a=new Coveo.ExpressionBuilder,w=[],i=0;i<v;i++)w.push("@distance"+i);var it="$qf(function:'min(".concat(w.join(","),")', fieldName:'mindistance')");a.add(it);var rt=f?"@mindistance > 0 and "+`@mindistance < ${f}`:"@mindistance > 0";a.add(rt);r=Coveo.ExpressionBuilder.mergeUsingOr(r,a);var b=new Coveo.ExpressionBuilder,ut=state?"@"+Coveo.coveoFieldName("state")+' == "'+state+'"':"@"+Coveo.coveoFieldName("state")+" =~ "+`".*${[c]}.*"`;var ft="@"+Coveo.coveoFieldName("isvirtualonly")+"==1 and "+ut;y.add(ft);b=Coveo.ExpressionBuilder.mergeUsingOr(r,y).build();t&&t.queryBuilder&&t.queryBuilder.advancedExpression.add(b)}h!=""&&t.queryBuilder.advancedExpression.add("@"+Coveo.coveoFieldName("lastname")+'*="'+h+'*"')});Coveo.$$(searchInterface).on(Coveo.QueryEvents.doneBuildingQuery,function(n,t){let f=document.getElementById("sort");var u=f.value,s="mindistance ascending",h="relevancy",c="@"+Coveo.coveoFieldName("lastname")+" ascending";let l=Coveo.state(searchInterface,"q"),e=l!==undefined&&l!="",i=document.getElementById("sort-relevance");e?i||(i=document.createElement("option"),i.id="sort-relevance",i.value="relevancy",i.text="Relevance",f.appendChild(i)):i&&f.removeChild(i);let o=lat!=null&&lng!=null,r=document.getElementById("sort-min-distance");o?r||(r=document.createElement("option"),r.id="sort-min-distance",r.value="mindistance ascending",r.text="Distance",f.appendChild(r)):r&&f.removeChild(r);sortClicked||(u=o?s:e?h:c);(u!==h||e)&&(u!==s||o)||(u=e?h:o?s:c);Coveo.state(searchInterface,"srt",u);document.getElementById("sort").value=u;t.queryBuilder.sortCriteria=u});Coveo.$$(searchInterface).on(Coveo.QueryEvents.querySuccess,function(n,t){resultsTotalCount=t.results.totalCount;t.results.results.length==1&&isSuggestionClicked&&redirectToDoctorDetailsPage(t.results.results[0].raw,t.query.q)});Coveo.$$(searchInterface).on(Coveo.QueryEvents.deferredQuerySuccess,function(n,t){t!=null&&t.results!=null&&t.results.results!=null&&t.results.results.length>0&&(coveoDocPos>=0?setTimeout(function(){$("html, body").animate({scrollTop:$(".coveo-main-section").offset().top-$(".site-header").height()-20})},100):$(document).scrollTop=0);$(".CoveoQuerySummary[data-only-result-count='true']").html('<span class="coveo-highlight">'+$('.CoveoQuerySummary[data-only-result-count="true"] .coveo-highlight:nth-child(3)').text()+" Results<\/span>");$(".coveo-summary-section").show()});Coveo.$$(searchInterface).on(Coveo.ResultListEvents.newResultDisplayed,function(n,t){const i=t.result.index+1,r=i-t.result.state.first;if(r==surveyPosition||r<surveyPosition&&i==resultsTotalCount){const n=$(".survey-block").clone();n.find(".survey-links .btn").attr("href",function(){this.href+="&"+location.hash.substring(1)});n.insertAfter(t.item).removeClass("hidden");n.find("a").colorbox({iframe:!0,innerHeight:"500px",innerWidth:"600px",maxHeight:"85%",maxWidth:"100%"})}$(t.item).find(".coveo-result-item").on("click","a",n=>{const t={event:"sanford-find-a-doctor-card-click",["sanford.doctorC
1ard"]:n.delegateTarget.querySelector(".title").innerText,"sanford.findCareReferral":String(!!hash.get("find-care")).toLowerCase().trim()};window.dataLayer.push({...t})})});Coveo.$$(searchInterface).on(Coveo.BreadcrumbEvents.populateBreadcrumb,function(n,t){if((!isSuggestionSelectedFacet||isAnyFacetChecked==!1)&&Coveo.state(searchInterface,"q")!=""){var i=buildBreadcrumbs(document.querySelectorAll(".CoveoSearchbox.name input")[0],"I'm looking for:");t.breadcrumbs.push({element:i})}if(Coveo.state(searchInterface,"address")!=""){var i=buildBreadcrumbs(document.getElementById("address"),"Address:");t.breadcrumbs.push({element:i})}if(Coveo.state(searchInterface,"radius")!=""){var i=buildBreadcrumbs(document.getElementById("radius"),"Radius:");t.breadcrumbs.push({element:i})}if(Coveo.state(searchInterface,"letter")!==""){var i=buildBreadcrumbs(document.querySelectorAll(".letter.active")[0],"Last name starts with:");t.breadcrumbs.push({element:i})}});Coveo.$$(searchInterface).on(Coveo.BreadcrumbEvents.clearBreadcrumb,function(){$(".magic-box-clear").click();$("#address").val("");$("#radius").val("");$("#letters-buttons .active").click()});$(".CoveoOmnibox input").change(function(){isSuggestionSelectedFacet=!1;sortClicked=!1});$("#address").change(function(){sortClicked=!1});$("#radius").change(function(){sortClicked=!1});$(".magic-box .magic-box-suggestions").click(function(){isSuggestionClicked=!0});let i=new RegExp("[#&]"+queryParamKey+"=([^&#]*)").exec(window.location.href),n=new RegExp("[#&]"+addressParamKey+"=([^&#]*)").exec(window.location.href),r=new RegExp("[#&]"+facetParamKey+":([^&#]*)").exec(window.location.href);if(n){let t=decodeURIComponent(n[1])||0;$("#address").val(t.replace(/\+/g," "))}(i||n||r)&&(pendingInitialSearch={qResults:i,facetResults:r},tryExecutePendingInitialSearch());Coveo.$$(searchInterface).on(Coveo.OmniboxEvents.populateOmniboxSuggestions,function(n,t){t.suggestions.forEach(function(n){n&&typeof n.then=="function"?n.then(function(n){formatSuggestions(n)}).catch(function(n){console.error("Suggestion promise rejected:",n)}):formatSuggestions(resolvedSuggestion)})});var o=$("#search .CoveoOmnibox input");o.on("keydown",function(n){if(n.key==="Enter"||n.keyCode===13){var t=$(".coveo-omnibox-selectable.coveo-omnibox-selected");t.length>0&&(n.preventDefault(),n.stopPropagation(),t.click())}})})});function buildVirtualCareConditions(n){if(n.length===0)return"";const i="@"+Coveo.coveoFieldName("state"),r="@"+Coveo.coveoFieldName("isvirtualonly"),t=[];for(let r=0;r<n.length;r++){const u=n[r];t.push(`(${i}="${u}")`)}const u=t.join(" OR ");return`(${r}==1 AND (${u}))`}function extractStateFromCity(n){const t=n.split(", ");return t.length>1?t[1].trim():""}function getDistinctStates(n){const t=n.map(extractStateFromCity),i=[...new Set(t)];return i.filter(n=>n!=="")}function locationReset(){lat=null;lng=null;state=null;previousAddress=null;matchedCityStateAddress=null}function buildBreadcrumbs(n,t){var i=document.createElement("div");$(i).addClass("coveo-facet-breadcrumb");var u=document.createElement("span");$(u).addClass("coveo-facet-breadcrumb-title");$(u).text(t);i.appendChild(u);var f=document.createElement("span");$(f).addClass("coveo-facet-breadcrumb-values");i.appendChild(f);var r=document.createElement("span");$(r).addClass("coveo-facet-breadcrumb-value coveo-selected");n.value!==undefined?$(r).text(n.value):$(r).text(n.innerHTML);var e=document.createElement("span");$(e).addClass("coveo-facet-breadcrumb-clear");r.appendChild(e);f.appendChild(r);$(i).on("click",function(){n.className.indexOf("letter")>-1?(n.className=n.className.replace("active",""),Coveo.state(searchInterface,"letter","")):n.value="";executeSearch()});return i}function executeSearch(){var n=$("#address").val();if(n!=""){previousAddress=n;var t=new google.maps.Geocoder;t.geocode({address:n},function(n,t){if(t==google.maps.GeocoderStatus.OK){formattedAddress=n[0].formatted_address;var i=n[0].address_components.find(n=>n.types.includes("administrative_area_level_1"));state=i?i.long_name:null;formattedAddress=="Moorhead, MN, USA"?(lat="46.8538988",lng="-96.7324909"):(lat=n[0].geometry.location.lat(),lng=n[0].geometry.location.lng());Coveo.$("#search").coveo("executeQuery")}else console.log("Geocode was not successful for the following reason: "+t)})}else locationReset(),Coveo.$("#search").coveo("executeQuery")}function getAlt(n){if(n!=undefined&&n!=""){var t=n.match(/alt="(.*?)"/g);if(t!=null&&t.length==1)return t[0].replace('alt="',"").replace('"',"")}return""}function getDistance(n,t){n=n.split(",");t=t.split(",");var i={lat:n[0],lng:n[1]},r={lat:t[0],lng:t[1]},u=rad(r.lat-i.lat),f=rad(r.lng-i.lng),e=Math.sin(u/2)*Math.sin(u/2)+Math.cos(rad(i.lat))*Math.cos(rad(r.lat))*Math.sin(f/2)*Math.sin(f/2),o=2*Math.atan2(Math.sqrt(e),Math.sqrt(1-e));return 6378137*o}function geolocationSuccess(n){var t=Coveo.state(searchInterface,"q");
1if(!userLocationBtnClicked&&(userLocationBtnClicked||$("#address").val().length)){if(!!$("#address").val().length){if(initialAutoLocationPending=!1,pendingInitialSearch){tryExecutePendingInitialSearch();return}(t||isFacetSelected())&&executeSearch()}}else{var i={lat:parseFloat(n.coords.latitude),lng:parseFloat(n.coords.longitude)},r=new google.maps.Geocoder;r.geocode({location:i},function(n,i){if(i==="OK")if(n[0]){var u="";if(n[0].formatted_address&&n[0].formatted_address.length>0)u=n[0].formatted_address;else for(var r=0;r<n[0].address_components.length;r++)if(n[0].address_components[r].types.includes("postal_code")){u=n[0].address_components[r].short_name;break}$("#address").val(u)}else console.log("No results found");else console.log("Reverse geocode was not successful for the following reason: "+i);if(initialAutoLocationPending=!1,pendingInitialSearch){tryExecutePendingInitialSearch();return}(t||isFacetSelected())&&executeSearch()})}}function geolocationError(n){var t=Coveo.state(searchInterface,"q");if(initialAutoLocationPending=!1,console.log(" Navigator geolocation error occured. Error code: "+n.code),pendingInitialSearch){tryExecutePendingInitialSearch();return}(t||isFacetSelected())&&executeSearch()}function initAutocomplete(){autocomplete=new google.maps.places.Autocomplete(document.getElementById("address"),{types:["geocode"]})}function initializeColorbox(){$(".open-scheduling-schedule-an-appointment").on("click",n=>{if(n.preventDefault(),typeof mychartWidget!="undefined"){let t={url:n.target.dataset.url,apiKey:n.target.dataset.apiKey,widgetType:"openscheduling",containerId:"open-scheduling-widget",additionalParams:{}};n.target.dataset.dept!==undefined&&(t.additionalParams.dept=n.target.dataset.dept);n.target.dataset.id!==undefined&&(t.additionalParams.id=n.target.dataset.id);let i=new URLSearchParams(location.search).get("linksource");if(i&&(t.additionalParams.linksource=i),window.amplitude){const n=window.amplitude.getDeviceId?.(),i=window.amplitude.getSessionId?.();n&&i&&(t.additionalParams.ampDeviceId=n,t.additionalParams.ampSessionId=i,t.additionalParams.ampTimestamp=Date.now()+3e5)}$.colorbox({html:"<div id='open-scheduling-widget' />",fixed:!0,scrolling:!0,innerHeight:"400px",width:"1200px",maxHeight:"85%",maxWidth:"100%",onComplete:function(){mychartWidget.renderWidget(t)}})}})}function populateAddressField(){navigator.geolocation&&navigator.geolocation.getCurrentPosition(geolocationSuccess,geolocationError)}function rad(n){return n*Math.PI/180}function replaceSemiColons(n){return n.indexOf(";")!==-1&&(n=n.replace(/;/g,", ")),n}function isFacetSelected(){return window.location.hash.includes("#f")}function applyMatchedSpecialtyFacet(n){var t=document.getElementById("doctors-facet-by-type-of-care");if(t===null||!Array.isArray(n)||n.length===0)return!1;isApplyingMatchedSpecialtyFacet=!0;Coveo.state(searchInterface,"q","");$("#search .CoveoOmnibox input").val("");var i=Coveo.get(t);return i.reset(),i.selectMultipleValues(n),isApplyingMatchedSpecialtyFacet=!1,!0}function tryExecutePendingInitialSearch(){if(pendingInitialSearch&&!initialAutoLocationPending&&(!pendingInitialSearch.qResults||pendingInitialSearch.facetResults||Array.isArray(medicalServices))){var n=pendingInitialSearch;pendingInitialSearch=null;executeInitialDoctorSearch(n.qResults,n.facetResults)}}function executeInitialDoctorSearch(n,t){if(n&&!t){var i=decodeURIComponent(n[1]||"").replace(/\+/g," "),r=getMatchingSpecialties(medicalServices,i);if(applyMatchedSpecialtyFacet(r)){executeSearch();return}}Coveo.$("#search").coveo("executeQuery")}function redirectToDoctorDetailsPage(n,t){let i=n[Coveo.coveoFieldName("fullname")];if(i.length>0&&t===i[0]){let t=new URL(n.clickableuri);t.hostname=window.location.hostname;window.location.href=t.toString();return}}function formatSuggestions(n){n!==undefined&&n!==null&&n.forEach(function(n){[...n.dom.getElementsByClassName("magic-box-suggestion")].forEach(function(n){let i="",t=!0,r=getMatchingSpecialties(medicalServices,n.innerText);if(Array.isArray(r)&&r.length&&(t=!1),i=t?'<span class="magic-box-suggestion-icon"><svg class="icon" aria-hidden="true" focusable="false"><use xlink:href="/svg-sprite.svg#icon-doctor" xmlns:xlink="http://www.w3.org/1999/xlink"><\/use> <\/svg><\/span>':'<span class="magic-box-suggestion-icon"><svg class="icon" aria-hidden="true" focusable="false"><use xlink:href="/svg-sprite.svg#Medical-Services" xmlns:xlink="http://www.w3.org/1999/xlink"><\/use> <\/svg><\/span>',$(n).prepend($(i)),!t)$(n).on("click keydown",function(t){(t.type==="click"||t.key==="Enter"||t.keyCode===13)&&(t.preventDefault(),t.stopPropagation(),applyMatchedSpecialtyFacet([n.innerText])?executeSearch():($("#search .CoveoOmnibox input").val(""),window.location.hash=`f:@${Coveo.coveo
1FieldName("doctorcategory")}=[${encodeURIComponent(n.innerText)}]`))})})})}function getMatchingSpecialties(n,t){const i=normalize(t).toLowerCase();if(i){if(!Array.isArray(n))return[];const r=n.filter(n=>normalize(n).toLowerCase()===i);return r.length===0?[]:[...new Set(r)]}}function normalize(n){return n.trim().replace(/^"|"$/g,"").replace(/\band\b/gi,"&").replace(/\s+/g," ").replace(/[^a-zA-Z0-9& — -]+/g," ").trim()}function populateMedicalServicesList(){$.ajax({url:"api/doctors/medicalservices",type:"GET",dataType:"json",success:function(n){medicalServices=n;tryExecutePendingInitialSearch()},error:function(n,t,i){medicalServices=[];console.error("Error fetching medical services:",i);tryExecutePendingInitialSearch()}})};

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.