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