${t("ABOUT_US")}
`);
}
if(loc0.shortDescription!=="" && _LB_Map_ObjInfo_1.StoreLocationInfo.showDetailsShortDescription){
let displayShortDesc = getLocalizedField(loc0.localized_ShortDescription, loc0.shortDescription);
DomObj("#"+ID + " #LB_Details_description").append(`${AboutHr}
${t("ABOUT_US")}
`);
}
let catalogueHtml = "";
if (
_LB_Map_ObjInfo_1.StoreLocationInfo.showLocationCatalogue &&
_LB_Map_ObjInfo_1.StoreLocationInfo.locations[0].catalogue &&
_LB_Map_ObjInfo_1.StoreLocationInfo.locations[0].catalogue.trim() !== ""
) {
catalogueHtml = _LB_Map_ObjInfo_1.StoreLocationInfo.locations[0].catalogue;
} else if (
_LB_Map_ObjInfo_1.StoreLocationInfo.showUniversalCatalogue &&
_LB_Map_ObjInfo_1.StoreLocationInfo.universalCatalogue &&
_LB_Map_ObjInfo_1.StoreLocationInfo.universalCatalogue.trim() !== ""
) {
catalogueHtml = _LB_Map_ObjInfo_1.StoreLocationInfo.universalCatalogue;
}
if (catalogueHtml !== "") {
DomObj("#" + ID + " #LB_Details_catalogue").append(`
`);
}
else{
DomObj( "#"+ID + " #LB_Catalogue_hr" ).hide();
}
if(!_LB_Map_ObjInfo_1.StoreLocationInfo.showDetailsMedia || _LB_Map_ObjInfo_1.StoreLocationInfo.doNotShowMedia){
DomObj( "#"+ID + " #LB_Details_media" ).hide();
DomObj( "#"+ID + " #LB_Media_hr" ).hide();
}
if(data.length>0){
if (isRTL) {
data = [...data].reverse();
}
let someImage = "";
for(let i = 0;i
`
}
let img = `
${t("MEDIA")}
`;
DomObj("#"+ID + " #LB_Details_media").append(DomObj(img));
if(_LB_Map_ObjInfo_1.Layout==='') {
let minToShow = Math.min(data.length,_LB_Map_ObjInfo_1.StoreLocationInfo.detailsNumberMedia);
if(minToShow===0){
minToShow = 3;
}
if(DomObj.fn.slick){
DomObj("#"+ID + " .gallery_slider").slick({
dots: true,
slidesToShow: minToShow,
slidesToScroll: minToShow,
autoplay: true,
autoplaySpeed: _LB_Map_ObjInfo_1.StoreLocationInfo.detailsMediaAutoPlaySpeed*1000,
nextArrow:_LB_Map_ObjInfo_1.slick_nextArrow,
prevArrow: _LB_Map_ObjInfo_1.slick_prevArrow,
responsive: sliderResponsiveSettings
});
}else{
window.setTimeout(function(){
DomObj("#"+ID + " .gallery_slider").slick({
dots: true,
slidesToShow: minToShow,
slidesToScroll: minToShow,
autoplay: true,
autoplaySpeed: _LB_Map_ObjInfo_1.StoreLocationInfo.detailsMediaAutoPlaySpeed*1000,
nextArrow:_LB_Map_ObjInfo_1.slick_nextArrow,
prevArrow: _LB_Map_ObjInfo_1.slick_prevArrow,
responsive: sliderResponsiveSettings
});
},6000);
}
}else{
DomObj("#"+ID + " .gallery_slider").slick({
dots: true,
slidesToShow: 1,
slidesToScroll: 1,
autoplay: true,
autoplaySpeed: _LB_Map_ObjInfo_1.StoreLocationInfo.detailsMediaAutoPlaySpeed*1000,
nextArrow:_LB_Map_ObjInfo_1.slick_nextArrow,
prevArrow: _LB_Map_ObjInfo_1.slick_prevArrow,
responsive: sliderResponsiveSettings
});
}
DomObj("#"+ID + " #LB_Details_media .img-wrapper" ).hover(
function() {
DomObj(this).find(".img-overlay").animate({opacity: 1}, 600);
}, function() {
DomObj(this).find(".img-overlay").animate({opacity: 0}, 600);
}
);
//https://locationbank.net
if(_LB_Map_ObjInfo_1.Layout=="template2"){
_LB_Map_ObjInfo_1.StoreLocationInfo.detailsReviewWidgetType="Slider";
_LB_Map_ObjInfo_1.StoreLocationInfo.detailsNumberReviews=1;
}
var $overlay = DomObj('
');
var $image = DomObj("
![]()
");
var $prevButton = DomObj('
');
var $nextButton = DomObj('
');
var $exitButton = DomObj('
');
$overlay.append($image).prepend($prevButton).append($nextButton).append($exitButton);
DomObj("#gallery").append($overlay);
//DomObj("#"+ID).append($overlay);
$overlay.hide();
DomObj(".img-overlay").click(function(event) {
event.preventDefault();
var imageLocation = DomObj(this).prev().attr("href");
$image.attr("src", imageLocation);
$overlay.fadeIn("slow");
_LB_Map_ObjInfo_1.analytic('media',_LB_Map_ObjInfo_1.StoreLocationInfo.locations[0].id,imageLocation);
});
$overlay.click(function() {
DomObj(this).fadeOut("slow");
});
$nextButton.click(function(event) {
DomObj("#overlay img").hide();
var $currentImgSrc = DomObj("#overlay img").attr("src");
var $currentImg = DomObj('#image-gallery img[src="' + $currentImgSrc + '"]');
var $nextImg = DomObj($currentImg.closest(".slick-slide").next().find("img"));
var $images = DomObj("#image-gallery img");
if ($nextImg.length > 0) {
DomObj("#overlay img").attr("src", $nextImg.attr("src")).fadeIn(800);
} else {
DomObj("#overlay img").attr("src", DomObj($images[0]).attr("src")).fadeIn(800);
}
event.stopPropagation();
});
$prevButton.click(function(event) {
DomObj("#overlay img").hide();
var $currentImgSrc = DomObj("#overlay img").attr("src");
var $currentImg = DomObj('#image-gallery img[src="' + $currentImgSrc + '"]');
var $nextImg = DomObj($currentImg.closest(".slick-slide").prev().find("img"));
DomObj("#overlay img").attr("src", $nextImg.attr("src")).fadeIn(800);
event.stopPropagation();
});
$exitButton.click(function() {
DomObj("#overlay").fadeOut("slow");
});
}
let setOptionsReview = "navigationColor="+encodeURIComponent(_LB_Map_ObjInfo_1.StoreLocationInfo.detailsReviewsNavigationColor) + "&";
setOptionsReview+= "widgetType="+encodeURIComponent(_LB_Map_ObjInfo_1.StoreLocationInfo.detailsReviewWidgetType) + "&";
setOptionsReview+= "autoPlaySpeed="+encodeURIComponent(_LB_Map_ObjInfo_1.StoreLocationInfo.detailsReviewsAutoPlaySpeed) + "&";
setOptionsReview+= "numberShow="+encodeURIComponent(_LB_Map_ObjInfo_1.StoreLocationInfo.detailsNumberReviews);
if(_LB_Map_ObjInfo_1.StoreLocationInfo.showDetailsPublicReview){
let setMaxShowLen = "";
if(_LB_Map_ObjInfo_1.StoreLocationInfo.maxLengthReviews>0){
setMaxShowLen = "&MaxDisplayReviewsLen="+_LB_Map_ObjInfo_1.StoreLocationInfo.maxLengthReviews;
}
DomObj("#"+ID + " #LB_Details_review" ).append(`
`);
}
_LB_Map_ObjInfo_1.applyTranslations(userLanguage.language);
}
_LB_Map_ObjInfo_1.createSocialMedia = function(socialMedia){
let strReturn = "";
if(socialMedia==null){
return "";
}
(isRTL ? socialMedia.slice().reverse() : socialMedia).forEach(Social => {
strReturn += `
`;
});
return strReturn;
}
_LB_Map_ObjInfo_1.setOrderAhead = function(orderAhead) {
if(orderAhead){
if(orderAhead!=null && orderAhead!=""){
DomObj("#lb-order-ahead-big","#"+ID).attr("href",orderAhead);
DomObj("#lb-order-ahead-small","#"+ID).attr("href",orderAhead);
return;
}
}
DomObj("#lb-order-ahead-big","#"+ID).hide();
DomObj("#lb-order-ahead-small","#"+ID).hide();
}
_LB_Map_ObjInfo_1.createPost = function(Post) {
let strReturn = "";
if(Post!==null){
Post.forEach(p=> {
let style = ""
let firstImg ='';
if(p._MediaList!==null){
if(p._MediaList.length>0){
if(p._MediaList[0].mediaFormat==="VIDEO"){
firstImg = `
`;
}else{
firstImg = `

`;
}
}
}else{
if(p._LocalPost.media!==null){
if(p._LocalPost.media.length>0){
if(p._LocalPost.media[0].mediaFormat==="VIDEO"){
firstImg = `
`;
}else{
firstImg = `

`;
}
}
}
}
let href = "";
let ButtonName = "Learn More";
if(p._LocalPost){
if(p._LocalPost.callToAction){
ButtonName = p._LocalPost.callToAction.actionType;
switch(p._LocalPost.callToAction.actionType){
case "SIGN_UP":
ButtonName="Sign Up";
break;
case "ORDER":
ButtonName="Order Online";
break;
case "SHOP":
ButtonName="Buy";
break;
case "LEARN_MORE":
ButtonName="Learn More";
break;
case "CALL":
ButtonName="Call";
p._LocalPost.callToAction.url =`tel:${_LB_Map_ObjInfo_1.StoreLocationInfo.locations[0].primaryPhone}`;
break;
}
if(p._LocalPost.callToAction!=null){
href = p._LocalPost.callToAction.url;
}
}
}
let actionButton = `
${ButtonName}`
if(href===""){
actionButton="";
}
strReturn+= `
${p.title}
${p.summary}
${actionButton}
`;
});
}
return strReturn;
}
_LB_Map_ObjInfo_1.findClosest = function(nearest) {
let distances = [];
let closest = -1;
let pos = new google_sl.maps.LatLng(parseFloat(_LB_Map_ObjInfo_1.StoreLocationInfo.locations[0].latitude).toFixed(6), parseFloat(_LB_Map_ObjInfo_1.StoreLocationInfo.locations[0].longitude).toFixed(6))
for (i = 0; i < nearest.length; i++) {
var loc = nearest[i];
let marPos = new google_sl.maps.LatLng(parseFloat(loc.latitude).toFixed(6), parseFloat(loc.longitude).toFixed(6))
let d = google_sl.maps.geometry.spherical.computeDistanceBetween(marPos, pos);
distances.push({d:d,km:Math.round(d/1000),index:i,Title:loc.locationName,id:loc.id,
lat:parseFloat(loc.latitude).toFixed(6), long:parseFloat(loc.longitude).toFixed(6),
location:loc,
Pos:marPos});// = d;
if (closest == -1 || d < distances[closest].d) {
closest = i;
distances[i].isClose = true;
}
}
//console.log("find_closest_marker",distances);
let allClose = distances.sort((x,y)=>{
if(x.d
y.d){return 1;}
return 0;
});
//console.log("find_closest_marker",allClose);
let arrReturn = [];
for(let i = 0;i{
let OpenDayText = x.openDay;
if(lastOpenDay!=x.openDay){
lastOpenDay=x.openDay
}else{
OpenDayText ="";
}
let colSizeDay = "col-xs-6";
let colSizeHour = "col-xs-6";
if(_LB_Map_ObjInfo_1.Layout=="overandunder" || _LB_Map_ObjInfo_1.Layout=="listonly"){
colSizeDay = "col-xs-6 col-md-1 col-lg-1";
colSizeHour = "col-xs-6 col-md-4 col-lg-4";
}
if(_LB_Map_ObjInfo_1.checkNowDate(OpenDayText)){
if(x.isOpen){
function formatTime(x, TimeFormat, isRTL) {
if (TimeFormat !== "24") {
x.openTime = _LB_Map_ObjInfo_1.formate12Time(x.openTime);
x.closeTime = _LB_Map_ObjInfo_1.formate12Time(x.closeTime);
}
if (isRTL) {
x.openTime = _LB_Map_ObjInfo_1.convertToRTLTime(x.openTime);
x.closeTime = _LB_Map_ObjInfo_1.convertToRTLTime(x.closeTime);
}
}
if (_LB_Map_ObjInfo_1.checkNowDateOpen(OpenDayText, x, loc)) {
formatTime(x, TimeFormat, isRTL);
hours = isRTL
? `${x.closeTime} - ${x.openTime} OPEN`
: `OPEN ${x.openTime} - ${x.closeTime}`;
} else {
formatTime(x, TimeFormat, isRTL);
hours = isRTL
? `${x.closeTime} - ${x.openTime} ${OpenDayText}`
: `${OpenDayText} ${x.openTime} - ${x.closeTime}`;
}
}else{
hours= `CLOSE`;
}
}
});
return hours;
}
_LB_Map_ObjInfo_1.showDetails = function(data){
let allAttributes = "";
let priceList = "";
_LB_Map_ObjInfo_1.setOrderAhead(data.orderAhead);
let Post = "";
if(_LB_Map_ObjInfo_1.StoreLocationInfo.showPost){
Post =_LB_Map_ObjInfo_1.createPost(data.posts);
}
if(data.attributes){
if(data.attributes.length>0){
data.attributes.forEach(att=>{
if(_LB_Map_ObjInfo_1.StoreLocationInfo.showCustomAmenitiesIcon && att.imageUrl)
allAttributes+=`
${att.attributeId} `;
else
allAttributes+=` ${att.attributeId} `;
});
}
}
if(allAttributes!=="") {
if(_LB_Map_ObjInfo_1.StoreLocationInfo.showDetailsAmenities){
if(isRTL){
DomObj( "#"+ID + " #LB_Details_Address" ).append(`
${t("AMENITIES")}
${allAttributes}
`);
}
else{
DomObj( "#"+ID + " #LB_Details_Address" ).append(`
${t("AMENITIES")}
${allAttributes}
`);
}
}
}
let socialMedia =_LB_Map_ObjInfo_1.createSocialMedia(data.socialMedia);
if(_LB_Map_ObjInfo_1.StoreLocationInfo.showSocial){
if(isRTL){
let socialMediaCol = _LB_Map_ObjInfo_1.Layout === "template1" || _LB_Map_ObjInfo_1.Layout === "template3" ? "col-lg-11 col-md-10 col-sm-10 col-xs-12": "col-lg-12 col-md-12 col-sm-12 col-xs-12";
DomObj("#"+ID + " #LB_Details_Social").append(`
${t("SOCIAL_PROFILES")}
${socialMedia}
`);
}
else{
DomObj("#"+ID + " #LB_Details_Social").append(`
${t("SOCIAL_PROFILES")}
${socialMedia}
`);
}
let socialHander = function(e)
{
//let href = DomObj(e.target).attr("href");
_LB_Map_ObjInfo_1.analytic('socialprofile',_LB_Map_ObjInfo_1.StoreLocationInfo.locations[0].id,"");
};
DomObj("#"+ID + " #LB_Details_Social").click(socialHander)
}
if(Post!=""){
let style ="";
if(_LB_Map_ObjInfo_1.Layout==='' || _LB_Map_ObjInfo_1.Layout==='template2'){
style="ml mr"
}
let postHeader=`
${t("NEWS_FEED")}
`;
DomObj( "#"+ID + " #LB_News" ).append(postHeader);
let postHander = function(e) {
//e.preventDefault();
let href = DomObj(e.target).attr("href");
_LB_Map_ObjInfo_1.analytic('post',_LB_Map_ObjInfo_1.StoreLocationInfo.locations[0].id,href);
};
DomObj( "#"+ID + " #LB_News" ).find(".interlock").click(postHander);
if(_LB_Map_ObjInfo_1.Layout==='' || _LB_Map_ObjInfo_1.Layout==='template2'){
let minToShow = Math.min(data.posts.length,_LB_Map_ObjInfo_1.StoreLocationInfo.detailsNumberPost);
if(minToShow === 0){
minToShow = 3;
}
if(minToShow === 1){
DomObj(".news-feed-container .slick-track").css("margin-left","0");
DomObj(".bootstrap-iso .news-feed-container .news-image-wrap").addClass("single-image");
}
DomObj("#"+ID + " .news-feed-container").slick({
dots: true,
rtl: isRTL,
nextArrow:_LB_Map_ObjInfo_1.slick_nextArrow,
prevArrow: _LB_Map_ObjInfo_1.slick_prevArrow,
slidesToShow: minToShow,
slidesToScroll: minToShow,
autoplay: true,
autoplaySpeed: _LB_Map_ObjInfo_1.StoreLocationInfo.detailsPostAutoPlaySpeed*1000,
responsive: sliderResponsiveSettings
});
}else{
DomObj("#"+ID + " .news-feed-container").slick({
dots: true,
rtl: isRTL,
nextArrow:_LB_Map_ObjInfo_1.slick_nextArrow,
prevArrow: _LB_Map_ObjInfo_1.slick_prevArrow,
slidesToShow: minToShow,
slidesToScroll: minToShow,
autoplay: true,
autoplaySpeed: _LB_Map_ObjInfo_1.StoreLocationInfo.detailsPostAutoPlaySpeed*1000,
responsive: sliderResponsiveSettings
});
}
DomObj("#"+ID + " #LB_News .interlock " ).hover(
function() {
DomObj(this).find(".img-overlay").animate({opacity: 1}, 600);
}, function() {
DomObj(this).find(".img-overlay").animate({opacity: 0}, 600);
}
);
var $overlay = DomObj('');
var $image = DomObj("
");
var $prevButton = DomObj('
');
var $nextButton = DomObj('
');
var $exitButton = DomObj('
');
$overlay.append($image).prepend($prevButton).append($nextButton).append($exitButton);
DomObj("#newsGallary").append($overlay);
//DomObj("#"+ID).append($overlay);
$overlay.hide();
DomObj(".card .img-overlay").click(function(event) {
event.preventDefault();
var imageLocation = DomObj(this).prev().attr("src");
$image.attr("src", imageLocation);
$overlay.fadeIn("slow");
_LB_Map_ObjInfo_1.analytic('post',_LB_Map_ObjInfo_1.StoreLocationInfo.locations[0].id,imageLocation);
});
$overlay.click(function() {
DomObj(this).fadeOut("slow");
});
$nextButton.click(function(event) {
DomObj("#newsOverlay img").hide();
var $currentImgSrc = DomObj("#newsOverlay img").attr("src");
var $currentImg = DomObj('#image-gallery img[src="' + $currentImgSrc + '"]');
var $nextImg = DomObj($currentImg.closest(".slick-slide").next().find("img"));
var $images = DomObj("#image-gallery img");
if ($nextImg.length > 0) {
DomObj("#newsOverlay img").attr("src", $nextImg.attr("src")).fadeIn(800);
} else {
DomObj("#newsOverlay img").attr("src", DomObj($images[0]).attr("src")).fadeIn(800);
}
event.stopPropagation();
});
$prevButton.click(function(event) {
DomObj("#newsOverlay img").hide();
var $currentImgSrc = DomObj("#newsOverlay img").attr("src");
var $currentImg = DomObj('#image-gallery img[src="' + $currentImgSrc + '"]');
var $nextImg = DomObj($currentImg.closest(".slick-slide").prev().find("img"));
DomObj("#newsOverlay img").attr("src", $nextImg.attr("src")).fadeIn(800);
event.stopPropagation();
});
$exitButton.click(function() {
DomObj("#newsOverlay").fadeOut("slow");
});
}else{
DomObj( "#"+ID + " #LB_News" ).hide();
DomObj( "#"+ID + " #LB_News_hr" ).hide();
//DomObj( "#"+ID + " #LB_Details_media" ).removeClass("col-sm-6 col-md-6 col-6 ");
//DomObj( "#"+ID + " #LB_Details_media" ).addClass("center-block");
}
//DomObj( "#"+ID + " #LB_Details_Address" ).append(`${priceList}`);
if(data.nearest && _LB_Map_ObjInfo_1.StoreLocationInfo.showDetailsNearByLocation){
let nearest3 = data.nearest;
let getURL = function(nearestLocation){
let backURL =""
if(SLMPage!=""){
backURL = "&SLMPage=" + encodeURI(SLMPage)
}
let locationNameUrl = "loc="+encodeURI(nearestLocation.locationName);
let detailsPageView = `/public/TestLocationDetails?${locationNameUrl}&id=${nearestLocation.id}&clientid=${nearestLocation.clientID}`;
let detailsPageReplaceDetails=locationNameUrl+"&locationid="+encodeURI(nearestLocation.id);
if(nearestLocation.storeLocatorDetailsShortURL && nearestLocation.storeLocatorDetailsShortURL!==null && nearestLocation.storeLocatorDetailsShortURL !=="" && _LB_Map_ObjInfo_1.StoreLocationInfo.useShortUrls){
detailsPageReplaceDetails = nearestLocation.storeLocatorDetailsShortURL
if(_LB_Map_ObjInfo_1.StoreLocationInfo.detailViewUrl.indexOf('?')>=0){
_LB_Map_ObjInfo_1.StoreLocationInfo.detailViewUrl=_LB_Map_ObjInfo_1.StoreLocationInfo.detailViewUrl.replace("?","/");
}
}
else if(nearestLocation.storeLocatorDetailsShortURL && nearestLocation.storeLocatorDetailsShortURL!==null && nearestLocation.storeLocatorDetailsShortURL !=="" && _LB_Map_ObjInfo_1.StoreLocationInfo.enableShortUrls){
detailsPageReplaceDetails = `?location=${nearestLocation.storeLocatorDetailsShortURL}`;
}
if(Debug==='False'){
if(Platform=="web"){
if(_LB_Map_ObjInfo_1.StoreLocationInfo.detailViewUrl){
if(_LB_Map_ObjInfo_1.StoreLocationInfo.detailViewUrl!==null){
detailsPageView = _LB_Map_ObjInfo_1.StoreLocationInfo.detailViewUrl.replace("locationid={locationid}",detailsPageReplaceDetails);
}
}
}else{
if(_LB_Map_ObjInfo_1.StoreLocationInfo.detailView_app_Url){
if(_LB_Map_ObjInfo_1.StoreLocationInfo.detailView_app_Url!==null){
detailsPageView = _LB_Map_ObjInfo_1.StoreLocationInfo.detailView_app_Url.replace("locationid={locationid}",detailsPageReplaceDetails)+ backURLEncode;
}
}
}
if(bOverrideDetailURL==true) {
detailsPageView = strDetailURL.replace("locationid={locationid}",detailsPageReplaceDetails)+ backURLEncode;
}
if(bOverrideDetailURL==true && _LB_Map_ObjInfo_1.StoreLocationInfo.useShortUrls) {
detailsPageView = strDetailURL.replace("locationid={locationid}",detailsPageReplaceDetails);
}
if (nearestLocation.storeLocatorDetailsShortURL && nearestLocation.storeLocatorDetailsShortURL !== null && nearestLocation.storeLocatorDetailsShortURL !== "" && _LB_Map_ObjInfo_1.StoreLocationInfo.enableShortUrls && !_LB_Map_ObjInfo_1.StoreLocationInfo.useShortUrls) {
detailsPageView = detailsPageView.replace(/\/+\?|^\?+|\?+/, "?");
if(detailsPageView.indexOf('??')>=0){
detailsPageView = detailsPageView.replace("??","?");
}
}
}
return detailsPageView;
}
if(data.nearest.length>3){
nearest3 = _LB_Map_ObjInfo_1.findClosest(data.nearest);
}
if(nearest3.length==0){
nearest3 = [{locationName:"",addressLine1:"",OpenTime:"",atag:"",endTag:""},
{locationName:"",addressLine1:"",OpenTime:"",atag:"",endTag:""},
{locationName:"",addressLine1:"",OpenTime:"",atag:"",endTag:""}];
}else if(nearest3.length==1){
nearest3 = [{locationName:nearest3[0].locationName,addressLine1:nearest3[0].addressLine1,
OpenTime:_LB_Map_ObjInfo_1.findClosestTime(nearest3[0]),
atag:``,endTag:""},
{locationName:"",addressLine1:"",OpenTime:"",atag:"",endTag:""},
{locationName:"",addressLine1:"",OpenTime:"",atag:"",endTag:""}];
}else if(nearest3.length==2){
nearest3 = [{locationName:nearest3[0].locationName,addressLine1:nearest3[0].addressLine1,
OpenTime:_LB_Map_ObjInfo_1.findClosestTime(nearest3[0]),
atag:``,endTag:""},
{locationName:nearest3[1].locationName,addressLine1:nearest3[1].addressLine1,
OpenTime:_LB_Map_ObjInfo_1.findClosestTime(nearest3[1]),
atag:``,endTag:""},
{locationName:"",addressLine1:"",OpenTime:"",atag:"",endTag:""}];
}else if(nearest3.length==3){
nearest3 = [{locationName:nearest3[0].locationName,addressLine1:nearest3[0].addressLine1,
OpenTime:_LB_Map_ObjInfo_1.findClosestTime(nearest3[0]),
atag:``,endTag:""},
{locationName:nearest3[1].locationName,addressLine1:nearest3[1].addressLine1,
OpenTime:_LB_Map_ObjInfo_1.findClosestTime(nearest3[1]),
atag:``,endTag:""},
{locationName:nearest3[2].locationName,addressLine1:nearest3[2].addressLine1,
OpenTime:_LB_Map_ObjInfo_1.findClosestTime(nearest3[2]),
atag:``,endTag:""}];
}
let rtlClass = isRTL ? 'text-right' : '';
let firstLocation = `
${nearest3[0].atag}
${nearest3[0].locationName}
${nearest3[0].addressLine1}
${nearest3[0].OpenTime}
${nearest3[0].endTag}
`;
let SecondLocation = `
${nearest3[1].atag}
${nearest3[1].locationName}
${nearest3[1].addressLine1}
${nearest3[1].OpenTime}
${nearest3[1].endTag}
`;
let ThirdLocation = `
${nearest3[2].atag}
${nearest3[2].locationName}
${nearest3[2].addressLine1}
${nearest3[2].OpenTime}
${nearest3[1].endTag}
`;
let backButton = `${t("FIND_MORE")}`;
if(SLMPage!=""){
backButton = `${t("FIND_MORE")}`;
}
let nearestHTML = '';
if (isRTL) {
nearestHTML = `
${ThirdLocation}
${SecondLocation}
${firstLocation}
${backButton}
`;
} else {
nearestHTML = `${t("NEARBY_LOCATIONS")}
${firstLocation}
${SecondLocation}
${ThirdLocation}
${backButton}`;
}
DomObj( "#"+ID + " #LB_Nearby_locations" ).append(nearestHTML);
if (isRTL) {
DomObj("#" + ID + " #LB_Nearby_locations").addClass("LB_Nearby_locations_RTL");
}
}else{
DomObj( "#"+ID + " #LB_Nearby_hr").hide();
DomObj( "#"+ID + " #LB_Nearby_locations").hide();
}
_LB_Map_ObjInfo_1.applyTranslations(userLanguage.language);
}
_LB_Map_ObjInfo_1.initMap = function() {
if (!window.google_sl || !google_sl.maps) {
console.error("Google Maps is not properly initialized.");
return;
}
_LB_Map_ObjInfo_1.map = new google_sl.maps.Map(document.getElementById("LB_MAP_"+ID), {
center: {lat: -34.397, lng: 150.644},
zoom: 1,
mapId: ID,
zoomControl: false,
cameraControl: true
});
_LB_Map_ObjInfo_1.isLoaded=true;
setTimeout(function() {
DomObj.ajax({url:loadFile+"StoreLocatorAPI/location?LocationID="+LocationID + "&clientID="+ID + "&language=" + encodeURIComponent(userLanguage.language), success: function(result){
LocationID= result.locations[0].id;
_LB_Map_ObjInfo_1.showGoogleMapLoad(result,_LB_Map_ObjInfo_1.map);
let detailsImage = result.imagesCategory;
let MediaCat2="",MediaCat3="";
if(result.detailsImagesCategory){
if(result.detailsImagesCategory!==null){
if(result.detailsImagesCategory!==""){
detailsImage = result.detailsImagesCategory;
}
}
}
if(result.detailsImagesCategory2){
if(result.detailsImagesCategory2!==null){
if(result.detailsImagesCategory2!==""){
MediaCat2= "&MediaCat2="+result.detailsImagesCategory2;
}
}
}
if(result.detailsImagesCategory3){
if(result.detailsImagesCategory3!==null){
if(result.detailsImagesCategory3!==""){
MediaCat3= "&MediaCat3="+result.detailsImagesCategory3;
}
}
}
DomObj.ajax({url:loadFile+"StoreLocatorAPI/languageList?ClientID="+result.locations[0].clientID, success: function(result){
if(result.enableLanguageOptions && result.languageOptions && result.languageOptions.length > 1){
updateLanguageUI(result.languageOptions);
}
else{
const storedLang = localStorage.getItem('StoreLocatorLanguage');
if (storedLang && storedLang.toLowerCase() !== 'en') {
localStorage.removeItem('StoreLocatorLanguage');
localStorage.removeItem('LanguageDirection');
location.reload();
return;
}
const languageToggleElement = document.querySelector('.language-toggle');
if (languageToggleElement) {
languageToggleElement.style.display = 'none';
}
}
}});
DomObj.ajax({url:loadFile+"StoreLocatorAPI/locationImageList?ClientID="+ID+"&LocationID="+LocationID +"&MediaCat=" + detailsImage + MediaCat2+ MediaCat3, success: function(result){
_LB_Map_ObjInfo_1.showImages(result);
DomObj.ajax({url:loadFile+"StoreLocatorAPI/locationDetails?LocationID="+LocationID+"&ClientID="+ID + "&language=" + encodeURIComponent(userLanguage.language), success: function(result){
_LB_Map_ObjInfo_1.showDetails(result);
_LB_Map_ObjInfo_1.applyTranslations(userLanguage.language);
}});
}});
}}); }, 2000);
}
_LB_Map_ObjInfo_1.getOpeningHours = function (locinfo) {
if (!locinfo || !Array.isArray(locinfo.regularHours)) return "";
const dayMap = {
MONDAY: "Mo",
TUESDAY: "Tu",
WEDNESDAY: "We",
THURSDAY: "Th",
FRIDAY: "Fr",
SATURDAY: "Sa",
SUNDAY: "Su"
};
const dayOrder = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"];
const normalizeTime = (open, close) => {
if (
(open === "00:00" && close === "00:00") ||
(open === "24:00" && close === "24:00")
) {
return "00:00-24:00";
}
return `${open}-${close}`;
};
const timeGroups = {};
locinfo.regularHours.forEach((entry) => {
const dayCode = dayMap[entry.openDay];
if (!dayCode) return;
const time = entry.isOpen
? normalizeTime(entry.openTime, entry.closeTime)
: "Closed";
if (!timeGroups[time]) {
timeGroups[time] = [];
}
timeGroups[time].push(dayCode);
});
const formatted = [];
for (const [time, days] of Object.entries(timeGroups)) {
const sorted = days.sort(
(a, b) => dayOrder.indexOf(a) - dayOrder.indexOf(b)
);
let start = sorted[0];
let prev = sorted[0];
for (let i = 1; i <= sorted.length; i++) {
const current = sorted[i];
const prevIndex = dayOrder.indexOf(prev);
const currentIndex = dayOrder.indexOf(current);
if (currentIndex !== prevIndex + 1 || i === sorted.length) {
const label = start === prev ? start : `${start}-${prev}`;
formatted.push(`${label} ${time}`);
start = current;
}
prev = current;
}
}
formatted.sort((a, b) => {
const startA = a.split(" ")[0].split("-")[0];
const startB = b.split(" ")[0].split("-")[0];
return dayOrder.indexOf(startA) - dayOrder.indexOf(startB);
});
return formatted.join(", ");
};
_LB_Map_ObjInfo_1.removeEmptyValues = function (obj) {
if (Array.isArray(obj)) {
return obj
.map(_LB_Map_ObjInfo_1.removeEmptyValues)
.filter(item => item != null && (typeof item !== 'object' || Object.keys(item).length > 0));
}
if (typeof obj === 'object' && obj !== null) {
const cleaned = {};
for (const key in obj) {
if (!obj.hasOwnProperty(key)) continue;
const value = obj[key];
if (value === null || value === undefined || value === '') continue;
const cleanedValue = typeof value === 'object'
? _LB_Map_ObjInfo_1.removeEmptyValues(value)
: value;
if (cleanedValue !== null && (typeof cleanedValue !== 'object' || Object.keys(cleanedValue).length > 0)) {
cleaned[key] = cleanedValue;
}
}
return cleaned;
}
return obj;
};
_LB_Map_ObjInfo_1.JsonLD=[];
_LB_Map_ObjInfo_1.createJsonLD = function(locinfo){
const jsonLD = {
"@context": "https://schema.org/",
"@type": locinfo.industry || "Store",
"name": locinfo.locationName,
"image": locinfo.logoUrl || locinfo.imageUrlLogo_Small,
"telephone": locinfo.primaryPhone,
"url": locinfo.websiteUrl,
"priceRange": locinfo.price,
"hasMenu": locinfo.menuUrl,
"acceptsReservations": locinfo.acceptsReservations,
"brand": locinfo.brandName ? { "@type": "Brand", "name": locinfo.brandName } : undefined,
"sameAs": Array.isArray(locinfo.socialMedia) ? locinfo.socialMedia.map(function(s) { return s && s.url; }).filter(Boolean) : undefined,
"openingHours": _LB_Map_ObjInfo_1.getOpeningHours(locinfo),
"address": {
"@type": "PostalAddress",
"addressLocality": locinfo.locality,
"addressRegion": locinfo.administrativeArea,
"postalCode": locinfo.postalCode,
"streetAddress": locinfo.addressLine1,
"addressCountry": locinfo.country
},
"geo": {
"@type": "GeoCoordinates",
"latitude": locinfo.latitude,
"longitude": locinfo.longitude
}
};
const cleanedJsonLD = _LB_Map_ObjInfo_1.removeEmptyValues(jsonLD);
_LB_Map_ObjInfo_1.JsonLD.push(cleanedJsonLD);
}
_LB_Map_ObjInfo_1.saveJsonLD = function(){
let head = (document.getElementsByTagName("head")[0] || document.documentElement);
_LB_Map_ObjInfo_1.JsonLD.forEach(x=>{
var d = document.createElement("script");
d.setAttribute("type", "application/ld+json");
d.innerHTML+=JSON.stringify(x)
head.appendChild(d)
});
}
///////////////////////////////////////////////////////////////
_LB_Map_ObjInfo_1.analytic = function(type='',locationID='',context='',customType=''){
type = encodeURI(type);
locationID = encodeURI(locationID);
let analyticClientId = '00000000-0000-0000-0000-000000000000';
context = encodeURI(context);
DomObj.ajax({url:loadFile+`StoreLocatorAnalyticsAPI/save?ClientID=${analyticClientId}&type=${type}&locationid=${locationID}&contex=${context}&customType=${customType}`,
success: function(result){
//do nothing
}});
}
function CreateScript(url){
var mapDom = document.createElement("script");
mapDom.src = url;
return mapDom;
}
function CreateCSS(url){
var css = document.createElement("link");
css.href = url;
css.rel="stylesheet";
css.type="text/css";
//css.rel="preload";
return css;
}
function CreateScriptWithOnLoad(url,onload){
var mapDom = document.createElement("script");
mapDom.src = url;
mapDom.onload = onload;
return mapDom;
}
function bps_isMobile(){
return window.outerWidth<=768?true:false
};
})();