"use strict";async function kord_io_init(){var t=document.getElementsByClassName("kord-io-widget"),e=!1;if(0!==t.length){var i=t[0];try{const d="LF2Hj-lFZbo262qam-8YJF8VQim0zVcc-M5yjbUZytE",a=i.getAttribute("data-vin")||"",r=i.getAttribute("data-mileage")||"",n=i.getAttribute("data-mileage-unit")||"",s=i.getAttribute("data-year")||"",l=i.getAttribute("data-make")||"",p=i.getAttribute("data-model")||"",c=i.getAttribute("data-trim")||"",g=parseInt(i.getAttribute("data-price"))||0,m=isNaN(g)?0:g,u=i.getAttribute("data-condition")||"",h=i.getAttribute("data-stock")||"",b=i.getAttribute("data-dealer")||"",x=i.getAttribute("data-postalcode")||"",w=window.location.href;var o=document.getElementById("kord-io-widget-iframe");if(o&&o.remove(),!a||!r||!n)return;let y="";try{const _=await fetch("https://app.kord.io/kapi/initWidget/",{method:"POST",body:JSON.stringify({apiKey:d,vin:a,mileage:r,unit:n,year:s,make:l,model:p,trim:c,condition:u,stockNumber:h,dealerInfo:b,postalCode:x,hostPageLink:w})});y=(await _.json()).report_id}catch(N){console.error(N)}const k=["en","fr"],f=document.documentElement.lang,A=k.includes(f)?f:"en",E=document.createElement("style");E.textContent=".kord-io-widget {display: block;position: relative;width: 100%;height: 100%;background-color: #f7f8fb;border-radius: 20px;}#kord-io-widget-iframe {display: block;position: absolute;top: 0;left: 0;width: 100%;height: 100%;}.kord-io-widget-loader {width: 12px;height: 12px;border-radius: 50%;display: block;margin:15px auto;position: relative;top: 50%;color: #3563E9;box-sizing: border-box;animation: animloader 1s linear infinite alternate;}@keyframes animloader {0% {box-shadow: -38px -12px , -14px 0, 14px 0, 38px 0;}33% {box-shadow: -38px 0px, -14px -12px, 14px 0, 38px 0;}66% {box-shadow: -38px 0px , -14px 0, 14px -12px, 38px 0;}100% {box-shadow: -38px 0 , -14px 0, 14px 0 , 38px -12px;}}",document.head.appendChild(E);const v=document.createElement("span");v.setAttribute("class","kord-io-widget-loader"),i.appendChild(v);const C=document.createElement("iframe");function I(){const t=document.getElementsByClassName("kord-io-widget")[0];t&&(e&&window.innerWidth<=800?(t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.zIndex=99999999):t.style.position="relative")}C.setAttribute("id","kord-io-widget-iframe"),C.setAttribute("title","kord.io - widget"),C.setAttribute("scrolling","no"),C.setAttribute("frameBorder","0"),C.setAttribute("src","https://app.kord.io/"+A+"/widgets/w/?reportId="+(y||"")+"&vin="+a+"&price="+m+"&apiKey="+d),i.appendChild(C),window.addEventListener("resize",I),window.addEventListener("message",(t=>{if("https://app.kord.io"!==t.origin)return;const i=t.data;if("kord-io-widget-widget-height"!==i.type)"kord-io-widget-chat-load"===i.type&&(e=!0,I()),"kord-io-widget-chat-close"===i.type&&(e=!1,I());else{const t=document.getElementById(i.widgetId);t&&(t.style.height=i.height+"px");const e=t?t.parentElement:null;e&&(e.style.height=i.height+"px")}}))}catch(B){console.error(B)}}else setTimeout(kord_io_init,1500)}setTimeout(kord_io_init,150);