!function(){const t={iframe:null,contentContainer:null,fps:10,initElements(t){let{iframe:n}=t;n&&(this.iframe=n,this.contentContainer=n.contentWindow.document.body.querySelector(".content-container"),this.contentContainer&&this.loop())},loop(){this.recalcHeight({iframe:this.iframe,contentContainer:this.contentContainer}),setTimeout((()=>{this.loop()}),1e3/this.fps)},recalcHeight(t){let{iframe:n,contentContainer:e}=t;n.style.height="".concat(e.offsetHeight,"px")}},n={state:{analytics:!1,debug:!1},checkAnalytics(){const t=this.getScript();t.dataset.analytics&&(this.state.analytics=!0),t.dataset.debug&&(this.state.debug=!0)},getScript:()=>document.querySelector("[data-widget-clinic]"),scrollBackToTop(){const t=document.querySelector("#vetowidget");t&&t.scrollIntoView(!0)},handleEvent(t){this.state.debug&&console.log("Handling event",t),this.state.analytics&&window.dataLayer&&window.dataLayer.push&&(console.log("Pushing to datalayer"),dataLayer.push(t))}};!function(){const e=document.currentScript.src;window.addEventListener("load",(()=>{!function(e){let{currentScript:o}=e;const c=document.querySelector("#vetowidget");if(!c)return;const a=n.getScript();let i=a.dataset.primaryColor||"",s=a.dataset.secondaryColor||"";const r=a.dataset.customer||"";let d=parseInt(a.dataset.widgetClinic,10);const l=a.dataset.chv,u=a.dataset.confirmUrl||"";let h=a.dataset.locale||navigator.language||"fr";h=h.split("-")[0].toLowerCase(),["fr","en","es","de","it"].includes(h)||(h="fr");const p=document.createElement("iframe");p.style.border="none",p.style.width="100%",p.style.height="500px",c.appendChild(p);const w=function(){const t=window.location.search.substring(1),n={},e=("?"===t[0]?t.substr(1):t).split("&");for(let t=0;t<e.length;t++){const o=e[t].split("=");n[decodeURIComponent(o[0])]=decodeURIComponent(o[1]||"")}return n}();w.clinic&&(d=w.clinic),w.primaryColor&&(i=w.primaryColor),w.secondaryColor&&(s=w.secondaryColor);const m=document.querySelector('script[src*="widget.monrendezvousveto"][data-widget-clinic]');let g,v,y="fr";if(m&&m.src.includes("quebec")&&(y="quebec"),"quebec"===y)g="CA";else{var f,C;const t=["FR","BE","LU","CH","CA"],n=(a.dataset.country||"").toUpperCase(),e=t.includes(n)?n:null;g=null!==(f=null!==(C=null!=e?e:function(){const t=window.location.hostname;return t.endsWith(".be")?"BE":t.endsWith(".lu")?"LU":t.endsWith(".ch")?"CH":t.endsWith(".ca")?"CA":null}())&&void 0!==C?C:function(){var n;const e=null===(n=(navigator.language||"").split("-")[1])||void 0===n?void 0:n.toUpperCase();return t.includes(e)?e:null}())&&void 0!==f?f:"FR"}const b=a.dataset.mode;if(b)v="prod"===b?"https://www.monrendezvousveto.".concat(y):"https://recette.monrendezvousveto.".concat(y);else if(w.baseURL)v=w.baseURL;else if(o)try{const t=new URL(o).origin;t.includes("widget.monrendezvousveto")||(v=t)}catch(t){}v||(v="https://www.monrendezvousveto.".concat(y)),console.log("current script",v),console.log("current country",g),n.checkAnalytics();const j="\n    <head>\n        <script>\n            (function(h,o,t,j,a,r){\n                h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\n                h._hjSettings={hjid:2072395,hjsv:6};\n                a=o.getElementsByTagName('head')[0];\n                r=o.createElement('script');r.async=1;\n                r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\n                a.appendChild(r);\n            })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\n        <\/script>\n    </head>\n    <body class=\"widget-mrdvv\">\n        <div id=\"vetowidget\"></div>\n        <script>\n        window.currentLocale = \"".concat(h,'";\n        window.fallbackLocale = "').concat("fr",'";\n        const globalVars = {\n            clinic: ').concat(d,",\n            url: '").concat(v,"',\n            colors: {\n                primary: '").concat(i,"',\n                secondary: '").concat(s,"'\n            },\n            customer: '").concat(r,"',\n            isCHV: ").concat(!!l,",\n            confirmUrl: '").concat(u,"',\n            country: '").concat(g,"'\n        };\n        <\/script>\n        ").concat("",'\n        <script src="').concat(v,'/bundles/app/assets/js/new/widget.entry.js"><\/script>\n    </body>\n    ');p.contentWindow.document.open(),p.contentWindow.document.write(j),p.contentWindow.document.close(),p.addEventListener("load",(()=>{t.initElements({iframe:p})}))}({currentScript:e})})),window.addEventListener("message",(t=>{t.data&&t.data.id&&("ar_redirect"===t.data.id&&(window.location=t.data.url),"forgotten_redirect"===t.data.id&&window.open(t.data.url,"blank"),"scroll"===t.data.id&&n.scrollBackToTop(),"event"===t.data.id&&t.data.event&&n.handleEvent(t.data.event))}))}()}();