(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){var css='.__flead_wrapper {\n  top: 50%;\n  transform: translateY(-50%);\n  position: fixed;\n  width: min-content;\n  height: min-content;\n  max-width: 40px;\n  z-index: 9999;\n  padding: 20px 5px;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  cursor: pointer;\n  max-height: 400px;\n}\n.__flead_wrapper.icon_position_right {\n  border-radius: 8px 0px 0px 8px;\n}\n.__flead_wrapper.icon_position_left {\n  border-radius: 0px 8px 8px 0px;\n}\n.__flead_wrapper img {\n  width: 60px;\n}\n/* The Modal (background) */\n.fm_modal {\n  display: none;\n  position: fixed;\n  z-index: 999999;\n  left: 0;\n  top: 0;\n  width: 100%;\n  height: 100%;\n  overflow: auto;\n  background-color: rgb(0,0,0);\n  background-color: rgba(0,0,0,0.4);\n  transition: transform 0.3s ease-in-out;\n  transform-origin: left center;\n}\n/* Add this CSS class for hiding the modal */\n.fm_modal_hidden {\n  animation-name: slideToRight;\n  animation-duration: 0.3s;\n  transform-origin: right center;\n  transition: transform 0.3s ease-in-out;\n  opacity: 0;\n}\n@keyframes slideToRight {\n  0% {\n    transform: translateX(0);\n    opacity: 1;\n  }\n\n  100% {\n    transform: translateX(-100%);\n    opacity: 0;\n  }\n}\n.fm_main_content {\n  width: 100%;\n  overflow: hidden;\n}\n/* Modal Content */\n.fm_modal-content {\n  position: relative;\n  background-color: #fefefe;\n  margin: auto;\n  padding: 0;\n  border: 1px solid #888;\n  width: min-content;\n  max-width: 60%;\n  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);\n  display: flex;\n  /*border-radius: 8px;\n  padding: 24px;\n  top: 50%;\n  transform: translateY(-50%);*/\n}\n.animation_right_to_left {\n  -webkit-animation-name: slideFromRight;\n  -webkit-animation-duration: 0.4s;\n  animation-name: slideFromRight;\n  animation-duration: 0.3s ease-in-out forwards;\n  flex-direction: row-reverse;\n}\n.animation_left_to_right {\n  -webkit-animation-name: slideFromLeft;\n  -webkit-animation-duration: 0.4s;\n  animation-name: slideFromLeft;\n  animation-duration: 0.3s ease-in-out forwards;\n  flex-direction: row;\n}\n.fm_icon {\n  cursor: pointer;\n}\n.fm_scroll_btn_right {\n  position: relative;\n  width: 30px;\n  /* Adjust the size as needed */\n  height: 45px;\n  /* Adjust the size as needed */\n  cursor: pointer;\n}\n.fm_modal-body {\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  width: 100%;\n  overflow: hidden;\n}\n.fm_scroll_btn_right::before {\n  content: "";\n  position: absolute;\n  top: 50%;\n  left: 0;\n  width: 0;\n  height: 0;\n  border-top: 20px solid transparent;\n  border-bottom: 20px solid transparent;\n  border-right: 18px solid purple;\n  transform: translateY(-50%);\n}\n/* .fm_inner_div {position: absolute;top: 0;left: 0;height: 100%;width: 100%;padding: 30px 0;box-sizing: border-box;} */\n.fm_inner_div {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  justify-content: center;\n  gap: 5px;\n}\n/* .fm_inner_div svg {\n    position: absolute;\n    bottom: 10px;\n    width: 100%;\n} */\n.fm_modal_sidebar {\n  width: 35px;\n  display: flex;\n  align-items: center;\n  cursor: pointer;\n}\n.fm_modal_opened {\n  display: flex;\n  transform: scaleX(1);\n}\n/* Add Animation */\n/*@-webkit-keyframes blowUpModal {\n\t 0% {\n\t\t transform: scale(0);\n\t}\n\t 100% {\n\t\t transform: scale(1);\n\t}\n}\n\n@keyframes blowUpModal {\n\t 0% {\n\t\t transform: scale(0);\n\t}\n\t 100% {\n\t\t transform: scale(1);\n\t}\n}*/\n@keyframes slideFromRight {\n  0% {\n    transform: translateX(100%);\n    opacity: 0;\n  }\n\n  100% {\n    transform: translateX(0);\n    opacity: 1;\n  }\n}\n@keyframes slideFromLeft {\n  0% {\n    transform: translateX(-100%);\n    opacity: 0;\n  }\n\n  100% {\n    transform: translateX(0);\n    opacity: 1;\n  }\n}\n/* The Close Button */\n.fm_close {\n  font-size: 28px;\n  /*background: rgb(130 190 32);*/\n  border-radius: 50%;\n  width: 40px;\n  height: 40px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  line-height: 41px;\n  position: absolute;\n  right: -12px;\n  margin-top: -70px;\n}\n.fm_close:hover,\n.fm_close:focus {\n  color: #fff;\n  text-decoration: none;\n  cursor: pointer;\n}\n.fm_modal-header {\n  color: #212121;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 10px 0px 0px 10px;\n}\n.fm_modal-header h2 {\n  color: #212121;\n  font-size: 24px;\n  font-weight: 700;\n  margin: 10px 0px;\n}\n.fm_productList {\n  display: flex;\n  width: 100%;\n  overflow: hidden;\n  scroll-behavior: smooth;\n  position: relative;\n  padding-bottom: 24px;\n  align-items: center;\n}\n.fm_productDetails img {\n  width: 100%;\n  min-width: 130px;\n  max-width: 150px;\n  height: 100%;\n  object-fit: contain;\n}\nspan.fm_span {\n  writing-mode: vertical-rl;\n  text-orientation: mixed;\n  text-align: center;\n  width: 100%;\n  font-weight: 600;\n  display: inherit;\n  align-items: center;\n  justify-content: center;\n  white-space: nowrap;\n}\n.fm_productDetails {\n  text-align: center;\n  padding: 0 12px;\n}\n.fm_productDetails h3 {\n  font-size: 15px;\n  font-weight: 500;\n  line-height: 19px;\n  word-break: break-word;\n  width: 100%;\n  min-width: 150px;\n  max-width: 200px;\n  margin: 10px 0px !important;\n}\n.fm_productDetails a {\n  text-decoration: none;\n  color: black;\n}\n.fm_viewBtn {\n  font-size: 14px;\n  font-weight: 500;\n  /*background: #82be20;*/\n  text-decoration: none;\n  box-shadow: unset;\n  padding: 6px 16px;\n  border-radius: 4px;\n  letter-spacing: .5px;\n  line-height: 1.5;\n}\n@media all and (max-width: 1200px) {\n\n}\n/* responsive design rules */\n.fm_modal-header h2 {\n  text-align: center;\n}\n.fm_modal-header {\n  justify-content: center !important;\n  padding: 0 !important;\n  border-bottom: 1px solid #e1e1e1;\n  margin: 0 0 21px;\n}\n/* @media (max-width: 1920px){\n    .fm_modal-header {\n        justify-content: center !important;\n        padding: 0 !important;\n        border-bottom: 1px solid #e1e1e1;\n        margin: 0 0 21px;\n    }\n  } */\n@media (min-width: 1601px) and (max-width: 1920.98px) {\n  .fm_productDetails {\n    min-width: 17%;\n  }\n\n  .fm_modal_opened .fm_modal-content {\n    max-width: 70%;\n  }\n}\n@media (min-width: 1369px) and (max-width: 1600.98px) {\n  /*.fm_productDetails {\n        min-width: 20%;\n    }*/\n\n  .fm_modal_opened .fm_modal-content {\n    max-width: 65%;\n  }\n}\n@media (min-width: 1200px) and (max-width: 1368.98px) {\n  .fm_modal-body {\n    justify-content: center;\n  }\n\n  .fm_main_content .fm_productList {\n    width: 78%;\n    min-width: 78%;\n    max-width: 90%;\n  }\n\n  .fm_modal-content {\n    max-width: 78% !important;\n  }\n\n  /*.fm_productDetails {\n        min-width: 25%;\n    }*/\n}\n@media (min-width: 1026px) and (max-width: 1199.98px) {\n  .fm_productDetails {\n    min-width: 33%;\n  }\n}\n@media (min-width: 768px) and (max-width: 1025.98px) {\n  .fm_modal-body svg {\n    z-index: 1;\n  }\n\n  .fm_main_content .fm_productDetails {\n    width: 100%;\n    min-width: 50%;\n  }\n\n  .fm_modal-header {\n    justify-content: center !important;\n    padding: 0 !important;\n    border-bottom: 1px solid #e1e1e1;\n    margin: 0 0 21px;\n  }\n\n  /* .fm_productList {\n        justify-content: center;\n    } */\n\n  .fm_productDetails h3 {\n    font-size: 14px !important;\n    line-height: 19px !important;\n  }\n}\n@media (min-width: 430px) and (max-width: 500px) {\n  .fm_main_content .fm_productList {\n    width: 70%;\n  }\n}\n@media (min-width: 300px) and (max-width: 767.98px) {\n  /*.fm_productDetails {\n        min-width: 100%;\n    }*/\n\n  #fm_scrollsvg_left,\n  #fm_scrollsvg_right {\n    z-index: 9999;\n  }\n\n  .fm_productDetails a {\n    justify-content: center;\n    display: flex;\n  }\n\n  .fm_modal-header {\n    justify-content: center !important;\n    padding: 0 !important;\n    border-bottom: 1px solid #e1e1e1;\n    margin: 0 0 21px;\n  }\n\n  .fm_modal-content {\n    max-width: 60%;\n  }\n\n  .fm_main_content .fm_modal-header h2 {\n    font-size: 16px;\n    text-align: center;\n    line-height: 20px;\n  }\n\n  .fm_main_content .fm_modal-header {\n    justify-content: center !important;\n  }\n\n  .fm_main_content .fm_productDetails h3 {\n    width: 100% !important;\n    min-width: 100% !important;\n    max-width: 100% !important;\n  }\n}\n';require("browserify-css").createStyle(css,{href:"assets/styles.css"},{insertAt:"bottom"});module.exports=css},{"browserify-css":3}],2:[function(require,module,exports){require("browserify-css");require("./assets/styles.css");(function(){"use strict";window.FmLead=function(){this.debugmode=false;this.deviceId=null;this.sessionId=null;this.maxProducts=10;this.deviceApiId="83a42d7f9511f84bbcace351be9ee1288035ef8d";this.cookieSaveTime=1;this.businessUrl=window.location.host==="localhost"?"leadgeneratetracking.xyz":window.location.host;this.deviceApiUrl="https://d1cr9zxt7u0sgu.cloudfront.net/shdfp.js?SITE_ID="+this.deviceApiId+"&TYPE=JS&AUTO=0";this.noScriptApiUrl="https://ap-device.csftr.com/shield-fp/v1/api/web/noscript?site_id="+this.deviceApiId;this.fLeadApi=window.location.host==="localhost"?"https://results.fanaticmarketing.com/api/":"https://results.fanaticmarketing.com/api/";this.customer_Id=this.getUrlParameters("customer_id",true,true);this.token=this.getUrlParameters("token",true,true);this.isMobileDevice=/Mobi|Android/i.test(navigator.userAgent);if(!this.customer_Id){this.customer_Id=this.getCookie("customer_id")}this.initialize()};FmLead.prototype.initialize=function(){var _=this;_.makeCall("businessSettings","POST",{business_url:_.businessUrl},function(response){var responseData=JSON.parse(response);_.setConfiguration(responseData.data.popup_config);try{const pixelScript=new Function(_.pixel_script);pixelScript()}catch(error){console.error("An error occurred in pixel script:",error)}if(responseData.data.ga4_measurement_id&&responseData.data.ga4_measurement_id.trim()!==""){try{_.addTagManagerScript(responseData.data.ga4_measurement_id)}catch(error){console.error("Error adding tag manager script:",error)}}_.getDeviceId(function(deviceData){_.___("device id in init",deviceData);_.deviceId=deviceData.device_intelligence.shield_id;_.sessionId=deviceData.session_id;console.log("DeviceID: ",_.deviceId);console.log("CustomerId: ",_.customer_Id);let payload={device_id:_.deviceId,business_url:_.businessUrl};if(_.customer_Id){payload.customer_id=_.customer_Id}if(_.token){payload.token=_.token}_.submitPostRequest(payload);_.makeCall("vdpHistoryCustomer?pageSize="+_.maxProducts,"GET",payload,function(response){var response=JSON.parse(response);if(response.data.history.length==0){return}_.___("get request data ",response);if(_.enablePopup=="1"||_.enablePopup==1){_.displayFleadIcon();_.addHistoryPopup(response.data)}})})});document.addEventListener("DOMContentLoaded",function(){document.body.addEventListener("click",function(event){const modalContent=document.querySelector(".fm_modal-content");const historyModal=document.getElementById("__flead_history_modal");const modalButton=document.getElementById("__flead_wrapper");if(modalContent&&!modalContent.contains(event.target)&&!modalButton.contains(event.target)){historyModal.classList.remove("fm_modal_opened")}})})};FmLead.prototype.setConfiguration=function(settings={}){var settings=JSON.parse(settings.config_data);this.___("business settings: ",settings);if(this.isMobileDevice){if(settings.recentyViewedIBLoc_Mobile=="left"){settings.position={left:"0px"}}if(settings.recentyViewedIBLoc_Mobile=="right"){settings.position={right:"0px"}}this.iconPosition=settings.recentyViewedIBLoc_Mobile||"left"}else{if(settings.recentyViewedIBLoc_Desktop=="left"){settings.position={left:"0px"}}if(settings.recentyViewedIBLoc_Desktop=="right"){settings.position={right:"0px"}}this.iconPosition=settings.recentyViewedIBLoc_Desktop||"left"}this.enablePopup=settings.inventorybox||"1";this.position=settings.position||{left:"0px"};this.popupHeading=settings.header||"This is a test header";this.theme_color=settings.themecolor||"#ededed";this.floatIconText=settings.IBTextOverrideFloat||"Viewed Inventory";this.textColor=settings.textcolor||"#ffffff";this.modalHeading=settings.IBTextOverride||"Welcome back %customer_name%";this.modal_button_text=settings.modal_button_text||"View Again";this.modal_button_color=settings.themecolor||"rgb(130 190 32)";this.showFooter=settings.show_footer||false;this.footerText=settings.footer_text||"";this.pixel_script=settings.pixel_script};FmLead.prototype.addTagManagerScript=function(id){var _=this;var script=document.createElement("script");script.async=true;script.src="https://www.googletagmanager.com/gtag/js?id="+id;document.head.appendChild(script);script.onload=()=>{const analyticsScript=document.createElement("script");analyticsScript.innerHTML=`
            window.dataLayer = window.dataLayer || [];
            function gtag(){dataLayer.push(arguments);}
            gtag('js', new Date());  gtag('config', '${id}');
        `;document.head.appendChild(analyticsScript)}};FmLead.prototype.getUrlParameters=function(sParam,saveInCookie=false,removeFromUrl=false){var sPageURL=window.location.search.substring(1),sURLVariables=sPageURL.split("&"),sParameterName,i;if(sURLVariables){for(i=0;i<sURLVariables.length;i++){sParameterName=sURLVariables[i].split("=");if(sParameterName[0]===sParam){if(sParameterName[1]===undefined){return true}else{if(saveInCookie===true){this.setCookie(sParam,sParameterName[1])}if(removeFromUrl===true){this.removeQueryVar(sParam)}return decodeURIComponent(sParameterName[1])}}}}return false};FmLead.prototype.setCookie=function(name,value,days){var expires="";if(this.cookieSaveTime&&!days){days=this.cookieSaveTime}if(days){var date=new Date;date.setTime(date.getTime()+days*24*60*60*1e3);expires="; expires="+date.toUTCString()}document.cookie=name+"="+(value||"")+expires+"; path=/"};FmLead.prototype.getCookie=function(key){const cookieArray=document.cookie.split("; ");for(const cookie of cookieArray){const[cookieName,cookieValue]=cookie.split("=");if(cookieName===key){return decodeURIComponent(cookieValue)}}return null};FmLead.prototype.addQueryVar=function(url,data){Object.keys(data).forEach(function(key){let value=data[key];var re=new RegExp("([?&])"+key+"=.*?(&|$)","i");var separator=url.indexOf("?")!==-1?"&":"?";if(url.match(re)){url=url.replace(re,"$1"+key+"="+value+"$2")}else{url=url+separator+key+"="+value}});return url};FmLead.prototype.removeQueryVar=function(key){var url=window.location.href;var urlParts=url.split("?");if(urlParts.length===1||url.indexOf(key)===-1){return url}else{var keyValues=urlParts[1].split("&"),refinedKeyValues=keyValues.filter(function(keyValuePair){return keyValuePair.indexOf(key)!==0}).join("&")}if(refinedKeyValues){var refinedUrl=urlParts[0]+"?"+refinedKeyValues}else{var refinedUrl=urlParts[0]}if("undefined"!==typeof history.pushState){history.pushState({},"",refinedUrl)}else{window.location.assign(refinedUrl)}};FmLead.prototype.submitPostRequest=function(payload){var _=this;payload.device_id=this.deviceId;payload.business_url=this.businessUrl;payload.link_visited=window.location.href.split("?")[0];_.___("post request body",payload);_.makeCall("vdpHistoryCustomer","POST",payload,function(response){_.___("last viewed Post request: ",response)})};FmLead.prototype.getDeviceId=function(callback){var _=this;var s=document.createElement("script");s.setAttribute("src",this.deviceApiUrl);s.setAttribute("language","javascript");s.setAttribute("type","text/javascript");s.setAttribute("async","");s.setAttribute("charset","UTF-8");s.onload=function(){if(typeof getDeviceResult==="function"){getDeviceResult().then(async function(res){if(res.result){_.___("device API result: ",res);var deviceData=await res.result;callback(deviceData)}},function(error){_.___("error in getting deviceID: ",error)})}};var noscriptElement=document.createElement("noscript");var noscriptIframe=document.createElement("iframe");noscriptIframe.setAttribute("src",_.noScriptApiUrl);noscriptIframe.setAttribute("width","0");noscriptIframe.setAttribute("height","0");noscriptIframe.style.display="none";noscriptElement.appendChild(noscriptIframe);var head=document.getElementsByTagName("head")[0];head.insertBefore(noscriptElement,head.firstChild);head.insertBefore(s,head.firstChild)};FmLead.prototype.addHistoryPopup=function(customerData){var historyData=customerData.history;if(historyData.length==0){return}var scrollPosition=0;var scrollStep=50;var customer=customerData.customer;var _=this;const svgLeft=_.svgElementRight();svgLeft.id="fm_scrollsvg_left";const svgRight=_.svgElementLeft();svgRight.id="fm_scrollsvg_right";_.___("customer detail",customer);let historyWrapper=document.createElement("div");historyWrapper.id="__flead_history_modal";historyWrapper.className="__flead_history_modal fm_modal";document.body.appendChild(historyWrapper);if(this.iconPosition=="left"){var animationclass="animation_left_to_right"}if(this.iconPosition=="right"){var animationclass="animation_right_to_left"}var modalContent=document.createElement("div");modalContent.className="fm_modal-content "+animationclass;var leftColumn=document.createElement("div");leftColumn.className="fm_main_content";var rightColumn=document.createElement("div");rightColumn.className="fm_modal_sidebar";rightColumn.style.backgroundColor=this.theme_color;let innerDiv=document.createElement("div");innerDiv.className="fm_inner_div";let spanElem=document.createElement("span");spanElem.innerHTML=this.floatIconText;spanElem.style.color=this.textColor;spanElem.className="fm_span";innerDiv.appendChild(spanElem);innerDiv.appendChild(this.getSvgIcon());rightColumn.onclick=function(){let modal=document.getElementById("__flead_history_modal");modal.classList.remove("fm_modal_opened");var innerElement=document.getElementsByClassName("fm_modal-content");if(innerElement.length>0){innerElement[0].classList.add("fm_modal_hidden")}};rightColumn.appendChild(innerDiv);var modalHeader=document.createElement("div");modalHeader.className="fm_modal-header";var modalTitle=document.createElement("h2");var modalTitleText=this.modalHeading;if(customer){modalTitleText=modalTitleText.replace("%customer_name%",customer.first_name+" "+customer.last_name)}else{modalTitleText=modalTitleText.replace(", %customer_name%","")}modalTitle.textContent=modalTitleText;modalHeader.appendChild(modalTitle);var modalBody=document.createElement("div");modalBody.className="fm_modal-body";var productList=document.createElement("div");productList.id="fm_productList";productList.className="fm_productList";var productWidth=0;historyData.forEach(function(history){let product=history.product;var productDetails=document.createElement("div");productDetails.className="fm_productDetails";var imgLink=document.createElement("a");imgLink.href=product.vdp_url;var productImage=document.createElement("img");var imagesArray=product.imagesList.split(",");productImage.src=imagesArray[0];productImage.alt="product-image";imgLink.appendChild(productImage);let nameLink=document.createElement("a");nameLink.href=product.vdp_url;var productName=document.createElement("h3");productName.textContent=`${product.year} ${product.make} ${product.model} ${product.trim}`;nameLink.appendChild(productName);var viewButton=document.createElement("a");viewButton.href=product.vdp_url;viewButton.className="fm_viewBtn";viewButton.textContent=_.modal_button_text;viewButton.style.backgroundColor=_.modal_button_color;viewButton.style.color=_.textColor;productDetails.appendChild(imgLink);productDetails.appendChild(nameLink);productDetails.appendChild(viewButton);productList.appendChild(productDetails);productWidth=productDetails.clientWidth});const rightScrollButton=document.createElementNS("http://www.w3.org/2000/svg","path");rightScrollButton.setAttribute("d","M12 2L2 12l10 10V2z");rightScrollButton.setAttribute("fill",_.theme_color);rightScrollButton.classList.add("fm_icon");svgRight.onclick=function(){scrollStep=_.getProductContWidth();scrollPosition+=scrollStep;_.___("clicked on scroll btn",scrollPosition);if(scrollPosition>productList.scrollWidth-productList.clientWidth){scrollPosition=productList.scrollWidth-productList.clientWidth}productList.scrollLeft=scrollPosition};const leftScrollButton=document.createElementNS("http://www.w3.org/2000/svg","path");leftScrollButton.setAttribute("d","M14 2v20l10-10L14 2z");leftScrollButton.setAttribute("fill",_.theme_color);leftScrollButton.classList.add("fm_icon");svgLeft.onclick=function(){scrollStep=_.getProductContWidth();scrollPosition-=scrollStep;_.___("clicked on left scroll btn",scrollPosition);if(scrollPosition<0){scrollPosition=0}productList.scrollLeft=scrollPosition};svgLeft.appendChild(rightScrollButton);svgRight.appendChild(leftScrollButton);modalBody.appendChild(svgLeft);modalBody.appendChild(productList);modalBody.appendChild(svgRight);leftColumn.appendChild(modalHeader);leftColumn.appendChild(modalBody);modalContent.appendChild(leftColumn);modalContent.appendChild(rightColumn);historyWrapper.appendChild(modalContent)};FmLead.prototype.getProductContWidth=function(){const element=document.querySelector(".fm_productDetails");const computedStyle=window.getComputedStyle(element);const paddingLeft=parseFloat(computedStyle.paddingLeft);const paddingRight=parseFloat(computedStyle.paddingRight);const marginLeft=parseFloat(computedStyle.marginLeft);const marginRight=parseFloat(computedStyle.marginRight);console.log("product element style",element.clientWidth,paddingLeft,paddingRight,marginLeft,marginRight);const totalWidth=element.clientWidth+paddingRight;return totalWidth};FmLead.prototype.displayFleadIcon=function(){var _=this;let wrapper=document.createElement("div");wrapper.id="__flead_wrapper";wrapper.className="__flead_wrapper icon_position_"+this.iconPosition;wrapper.onclick=function(){_.___("clicked on icon");let modal=document.getElementById("__flead_history_modal");if(modal!==null){modal.classList.add("fm_modal_opened");var innerElement=modal.querySelector(".fm_modal-content");if(innerElement){innerElement.classList.remove("fm_modal_hidden")}let productlist=document.getElementById("fm_productList");let svgLeft=document.getElementById("fm_scrollsvg_left");let svgRight=document.getElementById("fm_scrollsvg_right");const firstChild=productlist.firstElementChild;const lastChild=productlist.lastElementChild;productlist.scrollLeft=0;if(productlist.scrollWidth>productlist.clientWidth){svgLeft.style.display="block";svgRight.style.display="block";firstChild.style.paddingLeft=0;lastChild.style.paddingRight=0}else{svgLeft.style.display="none";svgRight.style.display="none";firstChild.style.paddingLeft="12px";lastChild.style.paddingRight="12px"}}};wrapper.style.backgroundColor=this.theme_color;if(this.position){if(typeof this.position.left!=="undefined"){wrapper.style.left=this.position.left}if(typeof this.position.right!=="undefined"){wrapper.style.right=this.position.right}}document.body.appendChild(wrapper);let innerDiv=document.createElement("div");innerDiv.className="fm_inner_div";let spanElem=document.createElement("span");spanElem.innerHTML=this.floatIconText;spanElem.style.color=this.textColor;spanElem.className="fm_span";innerDiv.appendChild(spanElem);innerDiv.appendChild(this.getSvgIcon());wrapper.appendChild(innerDiv)};FmLead.prototype.getSvgIcon=function(){const svg=document.createElementNS("http://www.w3.org/2000/svg","svg");svg.setAttribute("xmlns","http://www.w3.org/2000/svg");svg.setAttribute("height","1em");svg.setAttribute("viewBox","0 0 512 512");const path=document.createElementNS("http://www.w3.org/2000/svg","path");path.setAttribute("d","M135.2 117.4L109.1 192H402.9l-26.1-74.6C372.3 104.6 360.2 96 346.6 96H165.4c-13.6 0-25.7 8.6-30.2 21.4zM39.6 196.8L74.8 96.3C88.3 57.8 124.6 32 165.4 32H346.6c40.8 0 77.1 25.8 90.6 64.3l35.2 100.5c23.2 9.6 39.6 32.5 39.6 59.2V400v48c0 17.7-14.3 32-32 32H448c-17.7 0-32-14.3-32-32V400H96v48c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32V400 256c0-26.7 16.4-49.6 39.6-59.2zM128 288a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm288 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z");path.style.fill=this.textColor;svg.appendChild(path);return svg},FmLead.prototype.svgElementLeft=function(){var svg=document.createElementNS("http://www.w3.org/2000/svg","svg");svg.setAttribute("xmlns","http://www.w3.org/2000/svg");svg.setAttribute("width","48");svg.setAttribute("height","48");svg.setAttribute("viewBox","10 0 20 25");return svg};FmLead.prototype.svgElementRight=function(){var svg=document.createElementNS("http://www.w3.org/2000/svg","svg");svg.setAttribute("xmlns","http://www.w3.org/2000/svg");svg.setAttribute("width","48");svg.setAttribute("height","48");svg.setAttribute("viewBox","0 0 20 25");return svg};FmLead.prototype.___=function(...params){if(this.debugmode===true){console.log(params)}};FmLead.prototype.makeCall=async function(endPoint,method,data,callback){let apiUrl=this.fLeadApi+endPoint;var _=this;var payload={method:method,redirect:"follow"};if(method==="POST"){var postBody=JSON.stringify(data);payload.body=postBody}if(method==="GET"){apiUrl=_.addQueryVar(apiUrl,data)}await fetch(apiUrl,payload).then(response=>{if(response.ok){return response.text()}else{_.___("Request failed:",response.status,response.statusText);throw new Error("Request failed:",response.status,response.statusText)}}).then(function(data){callback(data)}).catch(function(error){_.___("Get the error in "+method+" end point "+endPoint,error)})};new FmLead})()},{"./assets/styles.css":1,"browserify-css":3}],3:[function(require,module,exports){"use strict";var styleElementsInsertedAtTop=[];var insertStyleElement=function(styleElement,options){var head=document.head||document.getElementsByTagName("head")[0];var lastStyleElementInsertedAtTop=styleElementsInsertedAtTop[styleElementsInsertedAtTop.length-1];options=options||{};options.insertAt=options.insertAt||"bottom";if(options.insertAt==="top"){if(!lastStyleElementInsertedAtTop){head.insertBefore(styleElement,head.firstChild)}else if(lastStyleElementInsertedAtTop.nextSibling){head.insertBefore(styleElement,lastStyleElementInsertedAtTop.nextSibling)}else{head.appendChild(styleElement)}styleElementsInsertedAtTop.push(styleElement)}else if(options.insertAt==="bottom"){head.appendChild(styleElement)}else{throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.")}};module.exports={createLink:function(href,attributes){var head=document.head||document.getElementsByTagName("head")[0];var link=document.createElement("link");link.href=href;link.rel="stylesheet";for(var key in attributes){if(!attributes.hasOwnProperty(key)){continue}var value=attributes[key];link.setAttribute("data-"+key,value)}head.appendChild(link)},createStyle:function(cssText,attributes,extraOptions){extraOptions=extraOptions||{};var style=document.createElement("style");style.type="text/css";for(var key in attributes){if(!attributes.hasOwnProperty(key)){continue}var value=attributes[key];style.setAttribute("data-"+key,value)}if(style.sheet){style.innerHTML=cssText;style.sheet.cssText=cssText;insertStyleElement(style,{insertAt:extraOptions.insertAt})}else if(style.styleSheet){insertStyleElement(style,{insertAt:extraOptions.insertAt});style.styleSheet.cssText=cssText}else{style.appendChild(document.createTextNode(cssText));insertStyleElement(style,{insertAt:extraOptions.insertAt})}}}},{}]},{},[2]);
