"use strict";async function kord_io_init(){var t=document.getElementsByClassName("kord-io-widget")[0],e=!1;if(t&&!(t?.children??[]).length)try{const o="lI5BpuNpg5ZPXupEn85OYtMwHWONTR2cYusSPQkR45Y",d=t.getAttribute("data-vin")||"",a=Number(t.getAttribute("data-mileage")||"0"),r=t.getAttribute("data-mileage-unit")||"",n=t.getAttribute("data-year")||"",s=t.getAttribute("data-make")||"",p=t.getAttribute("data-model")||"",l=t.getAttribute("data-trim")||"",c=parseInt(t.getAttribute("data-price"))||0,g=isNaN(c)?0:c,u=t.getAttribute("data-condition")||"",m=t.getAttribute("data-stock")||"",h=t.getAttribute("data-dealer")||"",x=t.getAttribute("data-postalcode")||"",b=window.location.href;var i=document.getElementById("kord-io-widget-iframe");i&&i.remove();let w="";try{const I=await fetch("https://app.kord.io/kapi/initWidget/",{method:"POST",body:JSON.stringify({apiKey:o,vin:d,mileage:a,unit:r,year:n,make:s,model:p,trim:l,condition:u,stockNumber:m,dealerInfo:h,postalCode:x,hostPageLink:b})});w=(await I.json()).report_id}catch(C){console.error(C)}const k=["en","fr"],y=document.documentElement.lang,f=k.includes(y)?y:"en",A=document.createElement("style");A.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(A);const E=document.createElement("span");E.setAttribute("class","kord-io-widget-loader"),t.appendChild(E);const v=document.createElement("iframe");function N(){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")}v.setAttribute("id","kord-io-widget-iframe"),v.setAttribute("title","kord.io - widget"),v.setAttribute("scrolling","no"),v.setAttribute("frameBorder","0"),v.setAttribute("src","https://app.kord.io/"+f+"/widgets/w/?reportId="+(w||"")+"&vin="+d+"&price="+g+"&apiKey="+o),t.appendChild(v),window.addEventListener("resize",N),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,N()),"kord-io-widget-chat-close"===i.type&&(e=!1,N());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(_){console.error(_)}setTimeout(kord_io_init,150)}setTimeout(kord_io_init,150);