/*! * Leadoo bot * @copyright Leadoo - All rights reserved * @see https://leadoo.com */(()=>{var e,t,n={1417:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2276:(e,t,n)=>{"use strict";n.d(t,{GU:()=>r});var o=n(8500);class r extends Error{constructor(e,t){const n=[...arguments],{options:r,shortMessage:i}=function(e){let t,n="";if(0===e.length)t={};else if((0,o.b)(e[0]))t={cause:e[0]},n=e.slice(1).join(" ")||"";else if(e[0]&&"object"==typeof e[0])t=Object.assign({},e[0]),n=e.slice(1).join(" ")||"";else{if("string"!=typeof e[0])throw new Error("Invalid arguments passed to Layerr");t={},n=n=e.join(" ")||""}return{options:t,shortMessage:n}}(n);let a=i;if(r.cause&&(a=`${a}: ${r.cause.message}`),super(a),this.message=a,r.name&&"string"==typeof r.name?this.name=r.name:this.name="Layerr",r.cause&&Object.defineProperty(this,"_cause",{value:r.cause}),Object.defineProperty(this,"_info",{value:{}}),r.info&&"object"==typeof r.info&&Object.assign(this._info,r.info),Error.captureStackTrace){const e=r.constructorOpt||this.constructor;Error.captureStackTrace(this,e)}}static cause(e){return(0,o.t)(e),e._cause&&(0,o.b)(e._cause)?e._cause:null}static fullStack(e){(0,o.t)(e);const t=r.cause(e);return t?`${e.stack}\ncaused by: ${r.fullStack(t)}`:e.stack}static info(e){(0,o.t)(e);const t={},n=r.cause(e);return n&&Object.assign(t,r.info(n)),e._info&&Object.assign(t,e._info),t}cause(){return r.cause(this)}toString(){let e=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(e=`${e}: ${this.message}`),e}}},2791:()=>{Array.prototype.fill||Object.defineProperty(Array.prototype,"fill",{value:function(e){if(null==this)throw new TypeError("this is null or not defined");const t=Object(this),n=t.length>>>0,o=arguments[1]|0;let r=o<0?Math.max(n+o,0):Math.min(o,n);const i=arguments[2],a=void 0===i?n:i|0,s=a<0?Math.max(n+a,0):Math.min(a,n);for(;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createToken=void 0,t.createToken=function(){var e=[],t=!1;return{cancel:function(){if(!t){t=!0;for(var n=0,o=e;n=0)throw new Error("Callback already registered");var o;return e.push(n),t&&(o=setTimeout(n,0)),function(){clearTimeout(o);var t=e.indexOf(n);t>=0&&e.splice(t,1)}},throwIfCancelled:function(e){if(t)throw new Error(e||"Token was cancelled")}}}},6816:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function o(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,o,i,a){if("function"!=typeof o)throw new TypeError("The listener must be a function");var s=new r(o,i||e,a),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function s(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,o,r=[];if(0===this._eventsCount)return r;for(o in e=this._events)t.call(e,o)&&r.push(n?o.slice(1):o);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=n?n+e:e,o=this._events[t];if(!o)return[];if(o.fn)return[o.fn];for(var r=0,i=o.length,a=new Array(i);r{"use strict";function o(e){if(!r(e))throw new Error("Parameter was not an error")}function r(e){return"[object Error]"===(t=e,Object.prototype.toString.call(t))||e instanceof Error;var t}n.d(t,{b:()=>r,t:()=>o})},9374:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function o(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,o,i,a){if("function"!=typeof o)throw new TypeError("The listener must be a function");var s=new r(o,i||e,a),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function s(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,o,r=[];if(0===this._eventsCount)return r;for(o in e=this._events)t.call(e,o)&&r.push(n?o.slice(1):o);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=n?n+e:e,o=this._events[t];if(!o)return[];if(o.fn)return[o.fn];for(var r=0,i=o.length,a=new Array(i);r{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"bugsnag.165e5f7160929f9707f9.chunk.js",r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@leadoo/bots:",r.l=(n,o,i,a)=>{if(e[n])e[n].push(o);else{var s,l;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(p);var r=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),r&&r.forEach((e=>e(o))),t)return t(o)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror),s.onload=f.bind(null,s.onload),l&&document.head.appendChild(s)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="https://bot.leadoo.com/",(()=>{var e={450:0};r.f.j=(t,n)=>{var o=r.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else{var i=new Promise(((n,r)=>o=e[t]=[n,r]));n.push(o[2]=i);var a=r.p+r.u(t),s=new Error;r.l(a,(n=>{if(r.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var i=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,o[1](s)}}),"chunk-"+t,t)}};var t=(t,n)=>{var o,i,[a,s,l]=n,c=0;if(a.some((t=>0!==e[t]))){for(o in s)r.o(s,o)&&(r.m[o]=s[o]);if(l)l(r)}for(t&&t(n);c{"use strict";r(2791);function e(e){return new Promise((t=>setTimeout(t,e)))}var t=r(6816);Object.freeze({});const n=Function.prototype.call.bind(Object.prototype.toString);function o(e){return e.map((e=>Array.isArray(e)?o(e):a(e)?i(e):e))}function i(e){const t=Object.assign({},e);for(const e in t)t.hasOwnProperty(e)&&(Array.isArray(t[e])?t[e]=o(t[e]):a(t[e])&&(t[e]=i(t[e])));return t}function a(e){return!!e&&"object"==typeof e&&"[object Object]"===function(e){const t=n(e);return"[object Object]"!==t?t:`[object ${Object.getPrototypeOf(e).constructor.name}]`}(e)}function s(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Object.defineProperty(e,t,Object.assign({enumerable:!1,configurable:!1,writable:!1,value:n},o))}function l(e){return e instanceof Promise||!(!e||"object"!=typeof e||"function"!=typeof e.then)}const c=()=>{};var u,d,f,p,m,h,v,g;!function(e){e[e.Indefinite=1]="Indefinite",e[e.Schedule=0]="Schedule"}(u||(u={})),function(e){e[e.Auto=0]="Auto",e[e.Manual=1]="Manual"}(d||(d={})),function(e){e[e.Ended=3]="Ended",e[e.Launched=1]="Launched",e[e.Paused=2]="Paused"}(f||(f={})),function(e){e[e.BestConversionRate=0]="BestConversionRate",e[e.BestEngagementRate=1]="BestEngagementRate",e[e.MostLeadConversions=2]="MostLeadConversions"}(p||(p={})),function(e){e[e.Document=3]="Document",e[e.Internal=0]="Internal",e[e.URL=2]="URL",e[e.Window=1]="Window"}(m||(m={})),function(e){e[e.AdvancedAnalytics=16]="AdvancedAnalytics",e[e.Automation=17]="Automation",e[e.BannerBots=14]="BannerBots",e[e.CallbackBot=6]="CallbackBot",e[e.ChatBot=3]="ChatBot",e[e.CTABot=19]="CTABot",e[e.CustomerProfiles=13]="CustomerProfiles",e[e.Feedback=8]="Feedback",e[e.InPageBot=4]="InPageBot",e[e.Integrations=18]="Integrations",e[e.LiveChat=5]="LiveChat",e[e.Media=7]="Media",e[e.Messaging=11]="Messaging",e[e.OrganizationProfiles=15]="OrganizationProfiles",e[e.Page=1]="Page",e[e.Remarketing=10]="Remarketing",e[e.Video=2]="Video",e[e.VisualBot=9]="VisualBot"}(h||(h={})),function(e){e.FullName="",e.FirstName="first",e.LastName="last",e.Separate="separate"}(v||(v={})),function(e){e[e.AdvancedCalculatorResult=33]="AdvancedCalculatorResult",e[e.AdvancedRouterResult=34]="AdvancedRouterResult",e[e.AI=48]="AI",e[e.ApiCall=51]="ApiCall",e[e.Rating=52]="Rating",e[e.AttachmentPrompt=44]="AttachmentPrompt",e[e.AttachmentPromptSingle=43]="AttachmentPromptSingle",e[e.BookingCalendar=35]="BookingCalendar",e[e.CalculatorResult=31]="CalculatorResult",e[e.Calendar=22]="Calendar",e[e.Carousel=16]="Carousel",e[e.CompanyPrompt=3]="CompanyPrompt",e[e.ContactForm=9]="ContactForm",e[e.CTAForm=47]="CTAForm",e[e.CustomForm=45]="CustomForm",e[e.Dropdown=15]="Dropdown",e[e.EmailPrompt=2]="EmailPrompt",e[e.LiveChat=99]="LiveChat",e[e.LocationForm=6]="LocationForm",e[e.LookupCarousel=1016]="LookupCarousel",e[e.LookupDropdown=1015]="LookupDropdown",e[e.LookupMultipleChoice=1014]="LookupMultipleChoice",e[e.LookupSingleChoice=1011]="LookupSingleChoice",e[e.LookupSingleChoiceURL=1012]="LookupSingleChoiceURL",e[e.LookupQuery=36]="LookupQuery",e[e.MultipleChoice=14]="MultipleChoice",e[e.NamePrompt=1]="NamePrompt",e[e.TextPrompt=5]="TextPrompt",e[e.PhonePrompt=4]="PhonePrompt",e[e.RangeSelector=21]="RangeSelector",e[e.Say=0]="Say",e[e.SingleChoice=11]="SingleChoice",e[e.SingleChoiceURL=12]="SingleChoiceURL",e[e.SoftLiveChat=2099]="SoftLiveChat",e[e.SingleChoiceAPI=2011]="SingleChoiceAPI",e[e.MultipleChoiceAPI=2014]="MultipleChoiceAPI",e[e.DropdownSelectAPI=2015]="DropdownSelectAPI",e[e.CarouselAPI=2016]="CarouselAPI",e[e.Country=7]="Country"}(g||(g={}));const y="Leadoo",b=["Chat","CTA","Custom","InPage","Visual"];let w=null;function C(){if(!w)throw new Error("API is not initialised");return w}var _={455:e=>{e.exports=e=>{if("number"!=typeof e)throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(1e3*e)%1e3,nanoseconds:t(1e6*e)%1e3}}},258:(e,t,n)=>{const o=n(455);e.exports=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Number.isFinite(e))throw new TypeError("Expected a finite number");t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);const n=[],r=(e,o,r,i)=>{if(!(0!==n.length&&t.colonNotation||0!==e||t.colonNotation&&"m"===r))return;let a,s;if(i=(i||e||"0").toString(),t.colonNotation){a=n.length>0?":":"",s="";const e=i.includes(".")?i.split(".")[0].length:i.length,t=n.length>0?2:1;i="0".repeat(Math.max(0,t-e))+i}else a="",s=t.verbose?" "+(l=o,1===e?l:`${l}s`):r;var l;n.push(a+i+s)},i=o(e);if(r(Math.trunc(i.days/365),"year","y"),r(i.days%365,"day","d"),r(i.hours,"hour","h"),r(i.minutes,"minute","m"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3)if(r(i.seconds,"second","s"),t.formatSubMilliseconds)r(i.milliseconds,"millisecond","ms"),r(i.microseconds,"microsecond","µs"),r(i.nanoseconds,"nanosecond","ns");else{const e=i.milliseconds+i.microseconds/1e3+i.nanoseconds/1e6,n="number"==typeof t.millisecondsDecimalDigits?t.millisecondsDecimalDigits:0,o=e>=1?Math.round(e):Math.ceil(e),a=n?e.toFixed(n):o;r(Number.parseFloat(a,10),"millisecond","ms",a)}else{const n=((e,t)=>{const n=Math.floor(e*10**t+1e-7);return(Math.round(n)/10**t).toFixed(t)})(e/1e3%60,"number"==typeof t.secondsDecimalDigits?t.secondsDecimalDigits:1),o=t.keepDecimalsOnWholeSeconds?n:n.replace(/\.0+$/,"");r(Number.parseFloat(o,10),"second","s",o)}if(0===n.length)return"0"+(t.verbose?" milliseconds":"ms");if(t.compact)return n[0];if("number"==typeof t.unitCount){const e=t.colonNotation?"":" ";return n.slice(0,Math.max(t.unitCount,1)).join(e)}return t.colonNotation?n.join(""):n.join(" ")}},196:e=>{var t=/(\*|\?)/g;function n(e,t){this.text=e=e||"",this.hasWild=e.indexOf("*")>=0,this.separator=t,this.parts=e.split(t).map(this.classifyPart.bind(this))}n.prototype.match=function(e){var t,n,o=!0,r=this.parts,i=r.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(n=(e||"").split(this.separator),t=0;o&&t=0||e.indexOf("?")>=0?new RegExp(e.replace(t,".$1")):e},e.exports=function(e,t,o){var r=new n(e,o||/[\/\.]/);return void 0!==t?r.match(t):r}},246:()=>{}},A={};function I(e){var t=A[e];if(void 0!==t)return t.exports;var n=A[e]={exports:{}};return _[e](n,n.exports,I),n.exports}I.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return I.d(t,{a:t}),t},I.d=(e,t)=>{for(var n in t)I.o(t,n)&&!I.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},I.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),I.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var O={};(()=>{I.d(O,{xN:()=>b,Iq:()=>p,cM:()=>w,bp:()=>m,Y9:()=>A});var e=I(196),t=I.n(e),n=I(258),o=I.n(n);const r=["#a0937d","#a7c5eb","#bdd2b6","#cc7351","#d35d6e","#e08f62","#fbc6a4","#f4a9a8","#ce97b0","#5aa469","#70af85","#8b5e83","#8f4068","#9dad7f","#94d0cc","#949cdf"];let i=null;function a(){i||(i=[...r],function(e){for(let t=e.length-1;t>0;t-=1){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}}(i));const e=i.shift();return i.push(e),e}var s=I(246),l=I.n(s);function c(){if("undefined"!=typeof window)return window;if(void 0!==I.g)return I.g;if("undefined"!=typeof self)return self;throw new Error("Unable to determine global context")}function u(e,t){return e.map((e=>Array.isArray(e)?`[${u(e,", ")}]`:e&&"object"==typeof e&&"function"==typeof e.toString||"function"==typeof e?e.toString():`${e}`)).join(t)}function d(){console.log(...arguments)}let f=d;function p(){return f}function m(e){f=e||d}let h=null,v={};const g={},y={};function b(e){if(!_(e))return function(){};const t=g[e]=g[e]||a();return function(){for(var n=arguments.length,o=new Array(n),r=0;r1?t-1:0),o=1;or.add(e))),"string"==typeof(null===(n=null===(t=o.process)||void 0===t?void 0:t.env)||void 0===n?void 0:n.DEBUG)&&o.process.env.DEBUG.split(",").forEach((e=>r.add(e))),[...r]}().reduce(((e,t)=>{let n=t.trim(),o=!0;return/^-/.test(n)&&(n=n.substring(1),o=!1),!1!==e[n]&&(e[n]=o),e}),{})),void 0===v[e])for(const n in h)if(t()(n,e)&&(v[e]=!!h[n],!v[e]))break;return v[e]}function A(e,t){v[e]=t}})();var P=O.xN;let L,E=!1;function S(e){L||(L=P("leadoo:debug")),L(e)}var D=r(2276);function M(e,t){if(null==e)throw new Error(`Value is not set: ${t}`)}const T="script[src*='/bot/'][src*='/dynamic.js']";let N=null;function k(){if(N)return N;const{companyCode:e}={ab:null,apiRoot:"https://bot.leadoo.com",companyCode:"01f1037e",insertAnalytics:true,mode:"normal"},t=[...document.querySelectorAll(`${T}[src*='company=${e}']`),...document.querySelectorAll(`script[src*='/bot/'][src*='/dynamic/chat.js'][src*='company=${e}']`)];if(N=t.find((e=>"attached"!==e.getAttribute("data-ld")))||null,!N)throw new D.GU(`No dynamic script found for query: ${T}`);return N.setAttribute("data-ld","attached"),N}function j(){const e=k().getAttribute("src");M(e,"Script URL");const t=new URL(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"https";return/^\/\/.+/.test(e)?`${t}:${e}`:e}(e));return`${t.protocol}//${t.host}`}function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function x(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const R="(ctrl)",B={};function F(){return function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:B;if(e.hasOwnProperty("xignore")&&(S(`${R} xignore = ${e.xignore.toString()}`),t.xIgnore=Boolean(e.xignore)),"string"==typeof e.zindex){let n=null;"auto"===e.zindex?n="auto":/^\d+$/.test(e.zindex)&&(n=parseInt(e.zindex,10)),null!==n&&(S(`${R} zIndex = ${n}`),t.zIndex=n)}}function V(e,t){if(null===e){const e=new Error(t);throw e.name="AssertionError",e}}const q=/^\[object .+?Constructor\]$/,W=/__restorefunc_bound_method__/;function z(e,t){return function(){for(var n=arguments.length,o=new Array(n),r=0;r2&&void 0!==arguments[2]?arguments[2]:null;const o=e.split(".");let r=t;return{method:o.reduce(((t,n)=>{if(n.trim().length<=0)throw new Error("Path cannot contain empty properties");if(!t[n])throw new Error(`Cannot resolve path (${e}): Property not found: ${n}`);return r=t,t[n]}),r),context:null!=n?n:r}}function G(e,t,n){let o=Y(e,t.top);if(!o)throw new Error("Unknown method (top window): "+e);if(o&&!H(o.method,t.top,n)){if(o=Y(e,t.safe,o.context),!o)throw new Error("Unknown method (safe window): "+e);if(!H(o.method,t.safe,n))throw new Error("Failed finding a native method for: "+e)}return z(o.method,o.context)}function H(e,t,n){return"string"==typeof e?function(e,t,n){const o=Y(e,t);return!!o&&H(o.method,t,n)}(e,t,n):Q(e,n)}function Q(e,t){const n=function(e){const t=e.Object.prototype.toString;return new RegExp("^"+String(t).replace(/[.*+?^${}()|[\]\/\\]/g,"\\$&").replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$")}(t);var o=typeof e;const r="function"===o?t.Function.prototype.toString.call(e):null;return r?W.test(r)||n.test(r):e&&"object"==o&&q.test(toString.call(e))||!1}const J="a,aside,b,div,footer,header,i,p,strong,span",K=[[e=>Q(e.document.createElement,e),e=>{const t=e.document.createElement("iframe");return e.document.body.appendChild(t),t}],[e=>Q(e.document.body.insertAdjacentHTML,e),e=>{const t=Z();return e.document.body.insertAdjacentHTML("afterbegin",``),e.frames[t]}],[e=>{const t=e.document.body.querySelector(J);return!!t&&"string"==typeof t.innerHTML},e=>{const t=[...e.document.body.children].reverse(),n=J.split(","),o=Z(),r=t.find((e=>n.includes(e.tagName.toLowerCase())));if(!r)throw new Error("No element found for innerHTML insertion");return r.innerHTML=`${r.innerHTML}`,e.frames[o]}]];async function X(e){return await async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;await new Promise((t=>{const{document:n}=e;if(n.body)return t();const o=()=>{n.removeEventListener("DOMContentLoaded",o),n.removeEventListener("load",o),t()};n.addEventListener("DOMContentLoaded",o),n.addEventListener("load",o)}))}(e),new Promise(((t,n)=>{var o;const r=function(e){const t=K.find((t=>{let[n]=t;return n(e)}));if(!t)throw new Error("Found no reliable iframe insertion method");return t[1](e)}(e);if(r.setAttribute("style","display: none; visibility: hidden;"),"complete"===(null===(o=r.contentWindow)||void 0===o||null===(o=o.document)||void 0===o?void 0:o.readyState))return t(r.contentWindow);r.addEventListener("load",(()=>{if(!r.contentWindow)return n(new Error("IFrame loaded but no window available"));t(r.contentWindow)}))}))}function Z(){return`sf_${Date.now()}_${Math.floor(999999*Math.random())}`}class ee{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;this.__cache=new Map,this._safeWindow=null,this._currentWindow=e}getNativeMethod(e){if(V(this._safeWindow,"RestoreSession not initialised"),this.__cache.has(e))return this.__cache.get(e);const t=G(e,this.getEntryPoints(),this._safeWindow);return this.__cache.set(e,t),t}getNativePrototypeMethod(e,t,n){return V(this._safeWindow,"RestoreSession not initialised"),function(e,t,n,o){const r=e[t];if(Q(r,o.window))return z(r,e);const i=Y(n,o,e);if(!i)throw new Error("Unknown method (safe window): "+n);if(!Q(i.method,o.window))throw new Error("Failed finding a native method prototype: "+n);return z(i.method,i.context)}(e,t,n,this.getEntryPoints().safe)}async init(){this._safeWindow||(this._safeWindow=await X(this._currentWindow))}precacheMethods(e){V(this._safeWindow,"RestoreSession not initialised");for(const t of e){if(this.__cache.has(t))continue;const e=G(t,this.getEntryPoints(),this._safeWindow);this.__cache.set(t,e)}}getEntryPoints(){var e;return V(this._safeWindow,"RestoreSession not initialised"),{top:{window:this._currentWindow,document:this._currentWindow.document},safe:{window:this._safeWindow,document:null===(e=this._safeWindow)||void 0===e?void 0:e.document}}}}function te(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.__&&e._ instanceof t)return e.__;const o=new t,r={},i=(e,t)=>{o.emit("set",e,t)},a=Object.keys(e);for(const t of a)Object.defineProperty(r,t,{enumerable:!0,get:()=>e[t],set(n){e[t]=n,i(t,n)}});return Object.defineProperty(r,"_",{value:o,configurable:!1,writable:!1,enumerable:!1}),Object.defineProperty(r,"__",{value:r,configurable:!1,writable:!1,enumerable:!1}),n&&setTimeout((()=>{const t=Object.keys(e);for(const n of t)i(n,e[n])}),10),r}var ne,oe,re,ie,ae,se,le,ce,ue,de,fe,pe,me,he,ve,ge,ye,be,we,Ce,_e,Ae,Ie,Oe,Pe,Le,Ee,Se,De,Me,Te,Ne,ke,je,$e,xe,Re,Be,Fe,Ue,Ve,qe,We,ze,Ye,Ge,He,Qe,Je,Ke,Xe,Ze,et;!function(e){e[e.Indefinite=1]="Indefinite",e[e.Schedule=0]="Schedule"}(ne||(ne={})),function(e){e[e.Auto=0]="Auto",e[e.Manual=1]="Manual"}(oe||(oe={})),function(e){e[e.Ended=3]="Ended",e[e.Launched=1]="Launched",e[e.Paused=2]="Paused"}(re||(re={})),function(e){e[e.BestConversionRate=0]="BestConversionRate",e[e.BestEngagementRate=1]="BestEngagementRate",e[e.MostLeadConversions=2]="MostLeadConversions"}(ie||(ie={})),function(e){e.Document="document",e.WebPage="web_page"}(ae||(ae={})),function(e){e[e.Never=0]="Never",e[e.Immediately=1]="Immediately",e[e.Scroll=2]="Scroll",e[e.Time=3]="Time",e[e.Scroll_time=4]="Scroll_time"}(se||(se={})),function(e){e[e.Fast=3]="Fast",e[e.Medium=2]="Medium",e[e.Slow=1]="Slow"}(le||(le={})),function(e){e[e.Large=3]="Large",e[e.Medium=2]="Medium",e[e.Small=1]="Small"}(ce||(ce={})),function(e){e[e.Button=1]="Button",e[e.ExitIntent=3]="ExitIntent",e[e.ByPageLoad=2]="ByPageLoad",e[e.Standard=0]="Standard"}(ue||(ue={})),function(e){e.Auto="auto",e.Chat="chat",e.CTA="cta",e.Dynamic="dynamic",e.Inpage="inpage",e.Platform="platform",e.Visual="visual"}(de||(de={})),function(e){e.Multiple="multiple",e.Single="single"}(fe||(fe={})),function(e){e[e.Normal=1]="Normal",e[e.Small=2]="Small"}(pe||(pe={})),function(e){e[e.SimpleIcon=1]="SimpleIcon",e[e.TemporaryMessage=2]="TemporaryMessage",e[e.ImageOrGIF=3]="ImageOrGIF",e[e.TextCTA=6]="TextCTA",e[e.BubbleImage=7]="BubbleImage",e[e.BubbleImageAnswers=8]="BubbleImageAnswers",e[e.MessageAndAnswers=9]="MessageAndAnswers",e[e.IconAndAnswers=10]="IconAndAnswers",e[e.CardAndAnswers=11]="CardAndAnswers",e[e.ImageOrGIFAndAnswers=12]="ImageOrGIFAndAnswers"}(me||(me={})),function(e){e.CheckGroup="checkGroup",e.City="city",e.CompanyName="companyName",e.Country="country",e.Dropdown="dropdown",e.Email="email",e.FirstName="firstName",e.LastName="lastName",e.Location="location",e.Message="other",e.Name="name",e.Phone="phone",e.Postcode="zip",e.RadioGroup="radioGroup"}(he||(he={})),function(e){e[e.Any=0]="Any",e[e.Desktop=1]="Desktop",e[e.Mobile=2]="Mobile"}(ve||(ve={})),function(e){e.Normal="normal",e.SPA="spa"}(ge||(ge={})),function(e){e.Page="page",e.Slots="slots"}(ye||(ye={})),function(e){e[e.ReadValue=1]="ReadValue",e[e.SetValue=2]="SetValue",e[e.AddValue=3]="AddValue"}(be||(be={})),function(e){e[e.Document=3]="Document",e[e.Internal=0]="Internal",e[e.URL=2]="URL",e[e.Window=1]="Window"}(we||(we={})),function(e){e[e.Number=2]="Number",e[e.Text=1]="Text"}(Ce||(Ce={})),function(e){e.Free="free"}(_e||(_e={})),function(e){e.AIServiceError="err/ai/serviceError",e.AIStreamConfigNotFound="err/ai/streaming/configNotFound",e.AnswerInvalidForQuestion="err/answer/payloadInvalidForQuestion",e.AnswerInvalidType="err/answer/invalidType",e.AnswerMissingCategory="err/answer/categoryNotSet",e.AnswerRequired="err/answer/emptyButRequired",e.AssetNotFound="err/asset/notFound",e.AttachmentLeadMismatch="err/attachment/leadIDMismatch",e.AttachmentMediaInvalid="err/attachment/invalidMedia",e.AttachmentUploadNotFound="err/attachment/uploadNotFound",e.BadBotType="err/bot/badType",e.BotCodeInvalid="err/bot/botCodeInvalid",e.BotConfigInvalid="err/bot/configInvalid",e.BotDeleted="err/bot/deleted",e.BotIDMismatch="err/bot/botIDMismatch",e.BotIsTemplate="err/bot/isTemplate",e.BotNotActive="err/bot/notActive",e.BotNotPublished="err/bot/notPublished",e.CalendarServiceError="err/calendar/serviceError",e.CalendarSlotOccupied="err/calendar/slotOccupied",e.CompanyCodeInvalid="err/company/companyCodeInvalid",e.CompanyDeleted="err/company/deleted",e.CompanyIDMismatch="err/company/companyIDMismatch",e.CompanyInactive="err/company/inactive",e.DBResultInvalid="err/db/resultInvalid",e.DisabledByUser="err/feature/disabledByUser",e.DomainInvalid="err/domain/invalid",e.DomainForbidden="err/domain/forbidden",e.DynamicConfigurationInvalid="err/dynamic/invalid",e.DynamicVariableInvalidUserValue="err/dv/invalidUserValue",e.DynamicVariableInvalidValue="err/dv/invalidValue",e.EncryptionServiceError="err/encryption/serviceError",e.ItemNotProvided="err/advNodes/itemNotProvided",e.ItemTypeUnknown="err/advNodes/itemTypeUnknown",e.ItemTypeUnrecognised="err/enum/itemUnrecognised",e.JWTGeneric="err/jwt/generic",e.JWTPayload="err/jwt/payload",e.LeadBotMismatch="err/lead/botIDMismatch",e.LeadCreatePayloadInvalid="err/lead/createPayloadInvalid",e.LeadDataResponseInvalid="err/lead/dataResponseInvalid",e.LeadLabelsResponseInvalid="err/lead/labelsResponseInvalid",e.LeadTokenMissing="err/lead/tokenMissing",e.LeadTokenMismatch="err/lead/tokenMismatch",e.LiveChatRequestFailed="err/livechat/requestFailed",e.LiveChatRequestInvalid="err/livechat/requestInvalid",e.LookupConfigurationInvalid="err/lookup/invalid",e.LookupCSVParse="err/lookup/csvParseError",e.LookupEmptyNoNextPosition="err/lookup/emptyNoNext",e.LookupMappingsInvalid="err/lookup/invalidMappings",e.LookupReservedColumns="err/lookup/reservedColumns",e.LookupRowNotFound="err/lookup/rowNotFound",e.LookupUploadEmpty="err/lookup/emptyUpload",e.MathExpressionFailure="err/advNodes/canNotExecuteExpression",e.MediaPartnerNoResult="err/mediaPartner/noResult",e.PageURLInvalid="err/page/invalidURL",e.ProfileServiceError="err/profile/serviceError",e.PublicAPIKeyEmpty="err/auth/publicAPIKeyEmpty",e.PublicAPIKeyInvalid="err/auth/publicAPIKeyInvalid",e.QuestionNoAttachments="err/question/attachmentsNotSupported",e.QuestionMissingCategory="err/question/categoryNotSet",e.QuestionMissingConfiguration="err/question/configurationIncomplete",e.QuestionInvalidSource="err/question/invalidDBSource",e.QuestionInvalidType="err/question/invalidType",e.RequestPayloadInvalid="err/request/payloadInvalid",e.RequestPayloadTooLarge="err/request/payloadTooLarge",e.ResourceNotFound="err/resource/notFound",e.ResourceSchemaInvalid="err/resource/invalidSchema",e.ResourceRelationshipInvalid="err/resource/relationshipInvalid",e.UploadMissingFields="err/upload/missingFields"}(Ae||(Ae={})),function(e){e.AIServiceBusy="error.api.ai.service-busy",e.AIServiceIncorrectPrompt="error.api.ai.service-incorrect-prompt",e.AIServiceTimeout="error.api.ai.service-timeout",e.AIServiceUnavailable="error.api.ai.service-unavailable",e.AIViolatePolicyContent="error.api.ai.violate-policy-content",e.AnswerRequired="error.api.answer-required",e.AttachmentDownloadInvalidJWT="error.api.attachment.download-invalid-jwt",e.BotNodeOwnership="error.api.bot-question-mismatch",e.BotTypeInvalid="error.api.bot-type-invalid",e.CalendarBookingSlots="error.api.calendar.slots",e.CalendarBookingSlotOccupied="error.api.calendar.slot.occupied",e.DomainValidation="error.api.domain.invalid",e.DynamicNodeConfig="error.api.dynamic-node-configuration",e.DynamicVariableInvalidValueInternal="error.api.dv.invalid-value-internal",e.DynamicVariableNumberRequired="error.api.dv.number.required",e.EmailValidation="error.api.email.invalid",e.EncryptionServiceBusy="Encryption service is busy",e.GenericValidation="error.api.validation-error",e.LeadUpdate="error.api.lead.updated",e.LiveChatAnswerMissingCategory="error.api.livechat-missing-cat-answer",e.LiveChatCriteriaUnmet="error.api.livechat-criteria-unmet",e.LiveChatQuestionMissingCategory="error.api.livechat-missing-cat-question",e.LookupMissing="error.api.lookup-not-found",e.LookupQueryConfig="error.api.lookup-query-configuration",e.LookupUploadMissingFields="error.api.lookup-upload-missing-fields",e.MathEvalBadInput="error.api.math.bad-input",e.MathEvalBadResult="error.api.math.bad-result",e.MaxAnswersUnsatisfied="error.api.max-answers-unsatisfied",e.MinAnswersUnsatisfied="error.api.min-answers-unsatisfied",e.NodeInvalidMeta="error.api.node-meta-parse-failure",e.PhoneValidation="error.api.phone.invalid",e.RequestInvalid="error.api.request-payload-invalid",e.SanitizingSecurityIssue="This message was sanitized due to security reasons"}(Ie||(Ie={})),function(e){e.Header="header",e.Footer="footer"}(Oe||(Oe={})),function(e){e[e.New=1]="New",e[e.NoReply=2]="NoReply",e[e.NoLead=3]="NoLead",e[e.ReplyLead=4]="ReplyLead"}(Pe||(Pe={})),function(e){e.Email="email",e.Number="number",e.String="string"}(Le||(Le={})),function(e){e.Left="left",e.Right="right",e.Center="center"}(Ee||(Ee={})),function(e){e.Top="top",e.BelowHeading="below-heading",e.BelowSubheading="below-subheading",e.Bottom="bottom"}(Se||(Se={})),function(e){e.Full="full",e.Large="large",e.Medium="medium",e.Small="small"}(De||(De={})),function(e){e.Image="image",e.Video="video"}(Me||(Me={})),function(e){e.Youtube="youtube",e.Vimeo="vimeo"}(Te||(Te={})),function(e){e[e.Text=1]="Text",e[e.Number=2]="Number"}(Ne||(Ne={})),function(e){e.Document="document",e.Static="static",e.URL="url",e.Window="window"}(ke||(ke={})),function(e){e[e.Bot=1]="Bot",e[e.AI=2]="AI",e[e.Livechat=3]="Livechat"}(je||(je={})),function(e){e.Button="button",e.Point="point",e.Range="range",e.Scale="scale",e.HeatScale="heat-scale",e.InfinityScale="infinity-scale"}($e||($e={})),function(e){e[e.Always=1]="Always",e[e.Consent=2]="Consent",e[e.Never=3]="Never",e[e.CMP=4]="CMP"}(xe||(xe={})),function(e){e[e.Input=1]="Input",e[e.Output=2]="Output"}(Re||(Re={})),function(e){e[e.FULL=1]="FULL",e[e.INSIDE=2]="INSIDE"}(Be||(Be={})),function(e){e[e.Contain=1]="Contain",e[e.NotContain=2]="NotContain",e[e.PageSpecific=0]="PageSpecific"}(Fe||(Fe={})),function(e){e[e.ReadValue=1]="ReadValue",e[e.SetValue=2]="SetValue",e[e.AddValue=3]="AddValue"}(Ue||(Ue={})),function(e){e[e.Number=2]="Number",e[e.Text=1]="Text"}(Ve||(Ve={})),function(e){e[e.Always=2]="Always",e[e.Disabled=0]="Disabled",e[e.Manual=1]="Manual"}(qe||(qe={})),function(e){e[e.StoreAlways=0]="StoreAlways",e[e.StoreAfterTracking=1]="StoreAfterTracking",e[e.Never=2]="Never"}(We||(We={})),function(e){e.Destroy="destroy",e.Reload="reload"}(ze||(ze={})),function(e){e.Bot="bot",e.Launch="launch",e.Media="media",e.Prompt="prompt"}(Ye||(Ye={})),function(e){e[e.Any=0]="Any",e[e.Desktop=1]="Desktop",e[e.Mobile=2]="Mobile"}(Ge||(Ge={})),function(e){e.ExternalSizing="external",e.InternalSizing="internal"}(He||(He={})),function(e){e.Failed="failed",e.Sending="sending",e.Sent="sent"}(Qe||(Qe={})),function(e){e.Document="document",e.Static="static",e.URL="url",e.Window="window"}(Je||(Je={})),function(e){e.Defer="defer",e.Handled="handled"}(Ke||(Ke={})),function(e){e.AI="ai"}(Xe||(Xe={})),function(e){e.Iframe="iframe",e.InLine="inline"}(Ze||(Ze={})),function(e){e.AI="ai",e.BOT="bot",e.BOT_NODE="bot_node",e.LIVECHAT="livechat"}(et||(et={}));const tt={answeredConsents:{},aiCurrentNodeID:null,aiSessionHistory:{lastPrompt:null,history:[]},aiSession:null,answerMotif:null,answers:null,cleanup:[],dvTexts:{},dynVarEnvCollected:[],fbPageID:null,finished:!1,gtmDisc:!1,hasInitd:!1,hideInitial:!1,interaction:!1,labels:{},labelTexts:[],lcAudio:null,lcCategory:null,lcChannel:null,lcCriteria:null,lcData:null,lcState:null,lead:null,leadID:null,leadVerified:!1,mustInit:!0,nextPosition:1,prefetched:null,refreshed:!1,prefetchedStarted:!1,question:null,score:0,encryptionKey:null,token:null,triggeredLead:!1,triggerPreviewPos:null,waNumber:null},nt={ab:null,aiSessionHistory:{lastPrompt:null,history:[]},aiMessage:null,aiSession:null,animQueue:function(){const e=[];let t=!1;const n=()=>{if(0!==e.length)return t=!0,Promise.resolve().then((()=>{const[t,n,o]=e.shift();let r=t;if("function"==typeof r)try{const e=r();if(!l(e))return void n(e);r=e}catch(e){return void o(e)}if(l(r))return r.then((e=>{n(e)}),(e=>(o(e),Promise.resolve())))})).catch(c).then(n);t=!1},o=o=>new Promise(((r,i)=>{e.push([o,r,i]),t||n()}));return{enqueue:o,whenComplete:()=>o(c)}}(),answerOptionStyles:null,api:null,apiName:null,apiRoot:null,botCode:null,botIcon:null,botID:null,botInternalName:"",botName:"",botType:null,branding:!0,category:null,companyCode:null,companyID:null,companyRatings:null,consent:!1,customAPI:null,destroyed:!1,destroying:!1,deviceID:null,deviceType:null,dialogueSpeed:le.Medium,dynamicVarsEnv:[],footerContent:null,gtm:null,gtmDL:null,hasInteracted:!1,headerContent:null,i18n:{},insertAnalytics:!0,isBotVisible:!0,language:"en-GB",launchSrc:null,launchWidth:0,lcEvents:!0,liveChat:null,lock:null,maxHeight:null,maxUpload:0,mock:!1,mockStyles:null,module:null,mpTarget:null,nofocus:!1,noscroll:!1,persist:!0,preview:!1,prevState:!1,privacyURL:null,privacyText:null,protections:[],remainClosed:!1,seamless:!0,settings:null,showImmediate:!0,startMessage:null,t24:!1,tag:null,targetQuestion:null,theme:null,timeoutContainer:null,ui:{},visualFullscreen:!0,winHeight:0,xIgnore:!1,zIndex:2147483647};let ot=null;function rt(){return ot||(ot=te(nt)),ot}!function(){for(const e in tt){const t=tt[e];Array.isArray(t)?nt[e]=[...tt[e]]:nt[e]=t&&"object"==typeof t?JSON.parse(JSON.stringify(tt[e])):t}}();let it=null;function at(){return M(it,"RestoreSession not initialised"),it}async function st(){it||(it=await async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const t=new ee(e);return await t.init(),t}(),it.precacheMethods(["document.createElement"]))}function lt(e){return at().getNativeMethod("document.createElement")(e)}function ct(e,t){return at().getNativePrototypeMethod(e,"appendChild","window.Element.prototype.appendChild")(t)}function ut(e){try{const t=new URL(e),n="https://bot.leadoo.com";if("https:"===t.protocol&&n===t.origin)return t.href;throw new Error("Untrusted script source")}catch(e){throw new Error("Blocked potentially unsafe script URL")}}function dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ft(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:C();t.tags||(t.tags={}),t.tags[e]||(t.tags[e]=ft({},mt)),t.tags[e].destroy||(t.tags[e].destroy=!0)}async function gt(e,t,n,o){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5?arguments[5]:void 0;if(null!=r&&r.aborted)return null;const a=i||{ab:null,apiRoot:"https://bot.leadoo.com",companyCode:"01f1037e",insertAnalytics:true,mode:"normal"}.apiRoot,s=function(){let e="";for(let t=0;t<12;t+=1)e+=ht.charAt(Math.floor(62*Math.random()));return e}();t&&(rt().ab=t),o(e,s);const{zIndex:l=null,xIgnore:c}=F(),u=lt("script");let d=`${a}/bot/${n}.js?code=${e}`;"number"!=typeof t||isNaN(t)||(d=`${d}&ab=${t}`),d=`${d}#tag=${s}`,null!==l&&(d=`${d},zindex=${l}`),c&&(d=`${d},xignore`);const f=ut(d);return f&&(u.src=f),u.async=!0,new Promise((e=>{var t;if(null!=r&&r.aborted)return e(null);u.onload=()=>e(u);const n=null===(t=document.querySelector("script"))||void 0===t?void 0:t.parentElement;if(!n)throw new Error("Found no parent to insert script into");ct(n,u),null==r||r.addEventListener("abort",(()=>{u.onload=null,e(null)}))}))}const yt="@leadoo:";function bt(e){const t=`${yt}${JSON.stringify(e)}`;window.postMessage(t,document.location.origin)}const wt=["bot-init","bot-init-failure","dynamic-no-bot"],Ct=["chat","cta","visual-modal"];function _t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new Promise((t=>{if(null!=e&&e.aborted)return t();const n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;const n=t=>{const n=t.data;if("string"==typeof n&&0===n.indexOf(yt)){const t=JSON.parse(n.substring(8));e(t)}};return t.addEventListener("message",n,!1),()=>{t.removeEventListener("message",n,!1)}}((e=>{e.botType&&-1===Ct.indexOf(e.botType)||("dynamic-no-bot"===e.type&&S("launch detect: no bot detected"),wt.indexOf(e.type)>=0&&(n(),t()))}));null==e||e.addEventListener("abort",(()=>{n(),t()}))}))}function At(e,t){const n=[...t],o=n.shift();if(!o)return null;const r=e[o];return n.length<=0?"string"==typeof(i=r)||"number"==typeof i?r:null:r&&"object"==typeof r?At(r,n):null;var i}function It(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:rt();const{i18n:o}=n;if(!o)return e;const r=At(o,e.split("."));return"string"==typeof r?function(e,t){let n=e;return Object.keys(t).forEach((e=>{let o=n;const r=`{{${e}}}`;for(;(n=n.replace(r,t[e]||""))!==o;)o=n})),n}(r,t):e}function Ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Pt(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:window;if(!e||!e.preview)return t.Leadoo&&t.Leadoo.Analytics?t.Leadoo.Analytics:void 0}async function Mt(){var e,t;return!0!==(null!==(e=null===(t=rt().settings)||void 0===t?void 0:t.flags)&&void 0!==e?e:{}).bugsnag?null:r.e(872).then(r.bind(r,1253))}me.BubbleImageAnswers,me.MessageAndAnswers,me.IconAndAnswers,me.CardAndAnswers,me.ImageOrGIFAndAnswers,he.CheckGroup,he.RadioGroup,he.Dropdown,g.AdvancedCalculatorResult,g.AdvancedRouterResult,g.ApiCall,g.CalculatorResult,g.Say,g.AdvancedCalculatorResult,g.ApiCall,g.Rating,g.AdvancedCalculatorResult,g.ApiCall,g.BookingCalendar,g.Calendar,g.PhonePrompt,g.CustomForm,g.CTAForm,g.BookingCalendar,g.EmailPrompt,g.CompanyPrompt,g.PhonePrompt,g.TextPrompt,g.SoftLiveChat;let Tt=null;function Nt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;if(!function(e){let t;try{t=window[e];const n="__storage_test__";return t.setItem(n,n),t.removeItem(n),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&t&&0!==t.length}}(e))return null;const n=t[e];return{async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const o=n.getItem(e);return null===o?t:JSON.parse(o)},async remove(e){n.removeItem(e)},async set(e,t){n.setItem(e,JSON.stringify(t))}}}function kt(){if(null===Tt&&(Tt=Nt("localStorage")),!Tt)throw new Error("No shared storage available");return Tt}const jt="ld_bot_consent";function $t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rt();return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:kt();return e?e.get(jt,0).then((e=>1===e)):Promise.resolve(!1)}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:kt()).then((t=>{e.consent=t}))}let xt=!1;async function Rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const r=window,i=!(!e||!t.preview),{companyCode:a}=t;if(i)return S("analytics script insertion disabled by preview"),Promise.resolve();if(!1===t.insertAnalytics)return S("analytics script insertion disabled by company"),Promise.resolve();let s=null;if(r.Leadoo&&r.Leadoo.Analytics)s=Promise.resolve();else{S("inserting analytics script");const e=lt("script");e.src="https://bot.leadoo.com/i/al/lanlt.js?code=[COMPANY]".replace("[COMPANY]",a),e.async=!0;let t=!1;s=new Promise((n=>{const o=setTimeout((()=>{t=!0,S("timed-out waiting for analytics script to load"),n()}),1500);e.addEventListener("load",(()=>{Ft((()=>{clearTimeout(o),t?S("analytics script loaded late"):(S("analytics script connected"),n())}))})),e.addEventListener("error",(()=>{clearTimeout(o),S("analytics script failed to load"),n()}))})),r.document.body.appendChild(e)}const l=e&&t.gtm||null;if(Ft((e=>{S(`analytics system active (sending: ${o.toString()})`),e.toggleTransfer(o),l&&(S(`bot-specific GTM: ${l}`),e.setGTMCode(l)),Bt("page_visit"),e.pageVisit()})),e){const e=t;return s.then((()=>$t(e))).then((()=>{n&&(S("inserting GTM script"),Ft((e=>{e.insertGTMScript().catch((e=>{console.error(e)}))}))),e.consent&&Ft((e=>{S("analytics tracking enabled"),e.toggleTracking(!0),xt||(e.trackID(),xt=!0),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rt();if(e.preview)return;Ft((t=>{t.onTrackingID((t=>{S(`received device ID from analytics: ${t}`),e.deviceID=t}))}))}()}))}))}return s.then((()=>$t(t)))}function Bt(e){S(` ∴ ${e} (sent)`)}function Ft(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;Array.isArray(t.ldanalytics)||(t.ldanalytics=[]),t.ldanalytics.push(e)}async function Ut(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,St.createToken)();if((arguments.length>1&&void 0!==arguments[1]?arguments[1]:rt()).preview)return Promise.resolve();await new Promise((t=>{e.onCancel(t),Ft((()=>{e.isCancelled()||t()}))}))}function Vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function qt(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:rt();return new Promise((n=>{const o=Dt(t).getDeviceID();o?n(o):Ft((t=>{e.isCancelled()||t.onTrackingID((e=>{n(e)}))}))}))}async function Gt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rt();return new Promise((n=>{const o=Dt(t).getCompanyID();o?n({orgID:o,orgInfo:Dt(t).getCompanyInfo()}):Ft((t=>{e.isCancelled()||t.onOrgID(((t,o)=>{e.isCancelled()||n({orgID:t,orgInfo:o})}))}))}))}async function Ht(t,n,o,r,a){const s=await async function(){var t,n,o,r,a,s,l,c,u,d,f;let p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rt(),m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,h={deviceID:null,orgID:null,orgInfo:null};const v=(0,St.createToken)();await Ut(v);try{await Promise.race([Ut(v).then((()=>Promise.all([Yt(v,p).then((e=>{h.deviceID=e})),Gt(v,p).then((e=>{h=qt(qt({},h),{},{orgID:e.orgID,orgInfo:e.orgInfo})}))]))),e(m).then((()=>{v.cancel()}))])}catch(e){return console.error(e),i(zt)}const g=Dt(p);if(!g)return i(zt);const y=g.getSessionSource();return{deviceID:h.deviceID,orgID:h.orgID,orgInfo:{headcount:null!==(t=null===(n=h.orgInfo)||void 0===n?void 0:n.h)&&void 0!==t?t:null,industry:null!==(o=null===(r=h.orgInfo)||void 0===r?void 0:r.i)&&void 0!==o?o:null,revenue:null!==(a=null===(s=h.orgInfo)||void 0===s?void 0:s.r)&&void 0!==a?a:null},sessionID:null==y?void 0:y.sessionID,source:{ref:(null==y?void 0:y.ref)||null,utm:(null==y?void 0:y.utm)&&Object.keys((null==y?void 0:y.utm)||{}).length&&{source:null!==(l=null==y?void 0:y.utm.source)&&void 0!==l?l:null,medium:null!==(c=null==y?void 0:y.utm.medium)&&void 0!==c?c:null,campaign:null!==(u=null==y?void 0:y.utm.campaign)&&void 0!==u?u:null,term:null!==(d=null==y?void 0:y.utm.term)&&void 0!==d?d:null,content:null!==(f=null==y?void 0:y.utm.content)&&void 0!==f?f:null}||null}}}(),l={ctx:s,device:t,slots:o,types:r,url:n};let c=null;try{c=await fetch(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ab:null,apiRoot:"https://bot.leadoo.com",companyCode:"01f1037e",insertAnalytics:true,mode:"normal"};const{apiRoot:t,companyCode:n}=e;return`${t}/api/v2/dynamic/company/${n}/resolve`}(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})}catch(e){if(!a.aborted)throw new D.GU(e,"Request for dynamic resolution failed")}if(a.aborted||!c)return{chat:null,cta:null,visual:null,slots:[]};!function(e){var t;if(e.ok)return;const n=e.headers.get("x-ld-req"),o=e.headers.get("x-ld-err"),r=e.headers.get("x-ld-err-params"),i=r?JSON.parse(r):{},a=o?It(o,Pt(Pt({},Et),i)):null,s=new D.GU({info:{friendly:a,status:e.status,params:JSON.parse(null!==(t=e.headers.get("X-Ld-Err-Params"))&&void 0!==t?t:"{}")}},`Request failed: ${e.status} ${l=e.statusText,l.split("\n")[0]} x-ld-req=${n}`);var l;throw s.name="LeadooError",s}(c);const u=await c.json(),{result:d}=u,{chat:f=null,cta:p=null,visual:m=null}=d.page;return{chat:f,visual:m,cta:p,slots:d.slots}}function Qt(e){const t=[];let n=e.parentElement;for(;n&&n.tagName&&"html"!==n.tagName.toLowerCase();)t.push(n),n=n.parentElement;return t}function Jt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;return[...Qt(e),e].every((e=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;const n=function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:window).getComputedStyle(e)}(e,t);if("none"===n.display||"hidden"===n.visibility)return!1;return!0}(e,t)))}const Kt="ld-slot-noseamless";const Xt=r(9374),Zt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let en,tn=[];function nn(){return en||(en=new Xt),en}const on="bot-slot-";class rn{constructor(e){this.__filled=!1,this.__id=null,this.__name=null,this.__slotCancelToken=null,this.__parent=e}get id(){return this.__id}get name(){return this.__name}get parent(){return this.__parent}create(){if(this.__id)throw new Error("Slot already created: Cannot re-create before destroy");this.__id=function(){let e="";for(let t=0;t<12;t+=1)e+=Zt.charAt(Math.floor(62*Math.random()));return e}(),S(`slot created: ${this.__name} (${this.__id})`)}destroy(){var e,t;this.__id&&(S(`slot destroyed: ${this.__name} (${this.__id})`),this.__slotCancelToken&&(e=this,(t=this.__slotCancelToken).cancel(),nn().emit("slot:deregistered",{slot:e,token:t}),tn=tn.filter((t=>t.slot.id!==e.id))),this.__visWatchRemove&&(this.__visWatchRemove(),this.__visWatchRemove=null),vt(`${on}${this.__id}`))}fill(e,t,n){if(this.__filled)return void S(`slot fill rejected: already filled: ${this.name} (${this.id})`);if(this.__slotCancelToken&&this.__slotCancelToken.isCancelled())return void S(`slot fill rejected: cancelled: ${this.name} (${this.id})`);const o={ab:null,apiRoot:"https://bot.leadoo.com",companyCode:"01f1037e",insertAnalytics:true,mode:"normal"},r=`${on}${this.id}`;let i;if(t===h.InPageBot)i=`${o.apiRoot}/bot/inpage.js?code=${e}`;else{if(t!==h.VisualBot)return void S(`invalid bot type for slot: ${t} (${this.name} / ${this.id})`);i=`${o.apiRoot}/bot/visual.js?code=${e}`}if(n&&"number"==typeof n&&(i=`${i}&ab=${n}`),i=`${i}#tag=${r}`,t===h.InPageBot){const e=function(e){if(!e)return[];const t=[],n=e.classList;return n.contains(Kt)&&t.push("noseamless"),n.contains("ld-slot-nofocus")&&t.push("nofocus"),n.contains("ld-slot-noscroll")&&t.push("noscroll"),n.contains("ld-slot-forcescroll")&&t.push("forcescroll"),n.contains("ld-slot-forcefocus")&&t.push("forcefocus"),t}(this.__parent);i=`${i}${e.length?`,${e.join(",")}`:""}`}else if(t===h.VisualBot){const e=function(e){if(!e)return[];const t=[];return e.classList.contains(Kt)&&t.push("noseamless"),e.classList.contains("ld-slot-fullsize")&&t.push("fullsize"),t}(this.__parent);i=`${i}${e.length?`,${e.join(",")}`:""}`}const a=lt("script"),s=ut(i);s&&(a.src=s),ct(this.__parent,a),this.__filled=!0}update(e){if(e.length>256)throw new Error(`Invalid slot name: Slot name too long (limit: 256): ${e}`);this.__name&&!e?(this.destroy(),this.__name=e):this.__name!==e&&(this.destroy(),this.__name=e,this.create())}watchParent(){this.__name&&(this.__visWatchRemove&&this.__visWatchRemove(),S(`slot watched: ${this.__name} (${this.__id})`),this.__visWatchRemove=function(e,t){let n,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,i=Jt(e,r);o&&(n=setTimeout((()=>t(i)),25));const a=()=>{const n=Jt(e,r);n!==i&&(i=n,t(n))},s=new MutationObserver((()=>{a()})),l={attributes:!0};[...Qt(e),e].forEach((e=>{s.observe(e,l)}));const c=setInterval(a,500);return()=>{clearTimeout(n),clearInterval(c),s.disconnect()}}(this.__parent,(e=>{e&&(S(`slot visible: ${this.__name} (${this.__id})`),this.__visWatchRemove&&this.__visWatchRemove(),this.__visWatchRemove=null,this.__slotCancelToken=function(e){const t=(0,St.createToken)(),n={slot:e,token:t};return tn.push(n),nn().emit("slot:registered",n),t}(this))})))}}const an="ld-slot";class sn extends HTMLElement{static get observedAttributes(){return["name"]}constructor(){super(),this.__slot=new rn(this)}adoptedCallback(){this.__slot.name&&S(`slot adopted: ${this.__slot.name} (${this.__slot.id})`)}attributeChangedCallback(e,t,n){"name"===e&&this.__slot.update(n)}connectedCallback(){this.__slot.name&&(S(`slot connected: ${this.__slot.name} (${this.__slot.id})`),this.__slot.watchParent())}disconnectedCallback(){S(`slot disconnected: ${this.__slot.name} (${this.__slot.id})`),this.__slot.destroy()}}let ln=null;function cn(e){e.customElements.get(an)||e.customElements.define(an,sn),ln=function(e){const t=[];S("watching for fallback slots");const n=e=>{if("div"===e.tagName.toLowerCase()&&e.classList.contains("ld-slot")&&"string"==typeof e.dataset.name)return void o(e);const t=function(e){return[...e.querySelectorAll("div.ld-slot[data-name]")].filter((e=>"string"==typeof e.dataset.name))}(e);for(const e of t)o(e)},o=e=>{let n=t.find((t=>t.parent===e));if(!n&&e.dataset.name)return S(`new slot element: ${e.dataset.name}`),n=new rn(e),n.update(e.dataset.name),n.watchParent(),void t.push(n);var o;n&&n.name!==e.dataset.name&&e.dataset.name&&(S(`slot already exists, will update: ${n.name} => ${e.dataset.name}`),null===(o=n)||void 0===o||o.update(e.dataset.name))},r=e=>{const n=t.find((t=>t.parent===e));n&&(n.destroy(),t.splice(t.indexOf(n),1))},i=new MutationObserver((e=>{for(const i of e)if("attributes"===i.type&&i.target.nodeType===Node.ELEMENT_NODE&&"div"===i.target.tagName.toLowerCase()){var t;const e=i.target;e.classList.contains("ld-slot")&&"string"==typeof e.dataset.name?o(e):("class"===i.attributeName&&/\bld-slot\b/.test(null!==(t=null==i?void 0:i.oldValue)&&void 0!==t?t:"")||"data-name"===i.attributeName&&"string"==typeof i.oldValue)&&r(e)}else if("childList"===i.type){for(const e of i.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;const t=e;"div"===t.tagName.toLowerCase()&&t.classList.contains("ld-slot")&&r(t)}for(const e of i.addedNodes)e.nodeType===Node.ELEMENT_NODE&&n(e)}}));return i.observe(e,{attributes:!0,attributeFilter:["class","data-name"],attributeOldValue:!0,childList:!0,subtree:!0}),n(e),()=>{S("disconnecting fallback slot watcher"),i.disconnect();for(const e of t)e.destroy();t.splice(0,1/0)}}(e.document.body)}function un(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const t=[e.location.href,e.document.URL,e.document.referrer];if(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;try{return e.self!==e.top}catch(e){return!0}}(e)){const[n]=t.splice(2,1);t.unshift(n);try{e.top&&t.unshift(e.top.location.href)}catch(e){/DOMException/i.test(e.message)||console.error(e)}}return t.find((e=>e&&e.trim().length>0))||null}function dn(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&e();const t=()=>{S(`SPA URL changed: ${un()}`),e()};window.addEventListener("popstate",t);const n=history.pushState;let o;return history.pushState=function(){for(var e=arguments.length,o=new Array(e),r=0;r{const n=un();n!==t&&(t=n,e())}),500);return()=>clearInterval(n)}(t)),()=>{history.pushState=n,o&&o(),window.removeEventListener("popstate",t)}}const fn=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,pn=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i;function mn(){const e=rt();if(null!==e.deviceType)return e.deviceType;return e.deviceType=function(){let e=Ge.Desktop;return(fn.test(navigator.userAgent)||pn.test(navigator.userAgent.substr(0,4)))&&(e=Ge.Mobile),e}()}const hn="ldlocks";async function vn(e){return new Promise((t=>{if(e.aborted)return t();e.addEventListener("abort",(()=>{t()}))}))}async function gn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C();await Promise.all(e.map((async e=>{if(t.tags[e])return new Promise((n=>{if(!t.tags[e].destroyed)return n();const o=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:C();M(n.tags[e],"API tag instance");const o=te(n.tags[e],!0),r=Object.keys(mt),i=o=>{r.includes(o)&&t(n.tags[e])};return o._.on("set",i),s(n.tags,e,o,{configurable:!0,enumerable:!0,writable:!0}),()=>{o._.off("set",i)}}(e,(e=>{!0===(null==e?void 0:e.destroyed)&&(o(),n())}),t);t.tags[e].destroy||(t.tags[e].destroy=!0)}))})))}const yn="ldSesh";let bn=[];async function wn(){const e=kt();if(e){await e.remove(yn);for(const e of bn)e("cleared");bn=[]}}const Cn="data-ld-dyn",_n="3.13.0",An=[];let In=null,On=null,Pn=[],Ln=null,En=null;function Sn(){return new AbortController}async function Dn(){var e;S(`destroying dynamic script: ${{ab:null,apiRoot:"https://bot.leadoo.com",companyCode:"01f1037e",insertAnalytics:true,mode:"normal"}.companyCode} (ac=${!!In})`),In&&In.abort("API destroy"),await Mn(),ln&&(ln(),ln=null),null===(e=On)||void 0===e||e.release(),S(`waiting for tags to destroy: ${An.join(", ")}`),await gn(An)}function Mn(){return S("cleanup created bots"),Array.from(document.querySelectorAll(`[${Cn}="${_n}"]`)).forEach((e=>{var t;null===(t=e.parentElement)||void 0===t||t.removeChild(e)})),An.forEach((e=>{vt(e)})),e(250)}async function Tn(e,t){const n=Nn(),o=mn(),r=(e,t)=>{S(`dynamic watching bot tag: ${e} => ${t}`),An.push(t)},i=j(),a=await Ht(o,n,[],[ye.Page],t),{chat:s,cta:l,visual:c}=a;if(!s&&!c&&!l||t.aborted)return S("no global bots found for current page"),window.postMessage("@leadoo:"+JSON.stringify({type:"dynamic-no-bot"}),document.location.origin),[];const u=[];var d,f,p;s&&!1===e.includes(de.Chat)&&(S(`launching chat bot: ${s.botCode}`),u.push(gt(s.botCode,null!==(d=s.ab)&&void 0!==d?d:null,de.Chat,r,t,i)));c&&!1===e.includes(de.Visual)&&(S(`launching visual bot: ${c.botCode}`),u.push(gt(c.botCode,null!==(f=c.ab)&&void 0!==f?f:null,de.Visual,r,t,i)));l&&!1===e.includes(de.CTA)&&(S(`launching CTA bot: ${l.botCode}`),u.push(gt(l.botCode,null!==(p=l.ab)&&void 0!==p?p:null,de.CTA,r,t,i)));return Promise.all(u)}function Nn(){const e=un();return M(e,"top page URL"),e}function kn(){window.customElements.get(an)?S("slot support already attached, skipping attachment"):(Ln=nn(),Ln.on("slot:registered",(e=>{Pn.push(e),S(`slot registered: ${e.slot.name} (${e.slot.id})`),En||(En=setTimeout((()=>{(async function(){const e=Nn();if(clearTimeout(function(e){if(null!==e)return e}(En)),En=null,Pn=Pn.filter((e=>!1===e.token.isCancelled())),0===Pn.length)return;const t=Pn.map((e=>{var t,n;return{identifier:null!==(t=e.slot.id)&&void 0!==t?t:"",name:null!==(n=e.slot.name)&&void 0!==n?n:""}}));Pn=[];const n=mn();S(`tick slots requests: ${t.length}`);const o=Sn(),r=await Ht(n,e,t,[ye.Slots],o.signal);S(`tick slots results: ${r.slots.length}`),function(e){for(const t of e){if(!t.filled){S(`slot response not filled: ${t.name} (${t.identifier})`);continue}const e=tn.find((e=>e.slot.id===t.identifier));if(e)if(e.token.isCancelled())S(`slot response invalid: slot cancelled: ${t.name} (${t.identifier})`);else{if(S(`slot fill: ${e.slot.name} => ${t.botCode} (${t.botType})${t.ab?` (ab: ${t.ab})`:""}`),!t.botCode)throw new Error("No bot code for slot result");if(!t.botType)throw new Error("No bot type for slot result");e.slot.fill(t.botCode,t.botType,t.ab)}else S(`slot response disconnected: no slot registration: ${t.name} (${t.identifier})`)}}(r.slots)})().catch(console.error)}),250))})),Ln.on("slot:deregistered",(e=>{S(`slot deregistered: ${e.slot.name} (${e.slot.id})`),Pn=Pn.filter((t=>t.slot.id!==e.slot.id))})),cn(window))}async function jn(e){const t={ab:null,apiRoot:"https://bot.leadoo.com",companyCode:"01f1037e",insertAnalytics:true,mode:"normal"};if(await Mn(),e.aborted)return;let n=!1;const o=await async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rt();const t=kt();if(!t)return null;const n=await t.get(yn);if(!n)return null;const o=JSON.parse(n);return Date.now()-o.ts>18e5?(S("persisted livechat session stale, clearing"),await wn(),null):o.companyID!==e.companyID||o.botID!==e.botID?null:o}();if((null==o?void 0:o.companyCode)===t.companyCode){var r;S(`detected persistent session: launching chat bot: ${o.botCode}`);const i=j();n=!0,await gt(o.botCode,null!==(r=t.ab)&&void 0!==r?r:null,de.Chat,(e=>An.push(e)),e,i)}const i=_t(e);(await Tn(n?[de.Chat]:[],e)).forEach((e=>{e&&e.setAttribute(Cn,_n)})),await async function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return Promise.race([e,new Promise(((e,a)=>{const s=e=>{a(new Error("Aborted"+(e.reason?`: ${e.reason}`:"")))};if(!0===(null==i?void 0:i.aborted))return s(i);n=setTimeout((()=>{if(o)return e();let t="Timed-out waiting for async task";r&&(t=`${t}: ${r}`),a(new Error(t))}),t),i&&i.addEventListener("abort",(()=>{clearTimeout(n),s(i)}))}))]).then((e=>(clearTimeout(n),e)))}(i,1e4,!0,"Failed launching bot(s) - timed out",e),e.aborted&&await Mn()}async function $n(e){const t=Sn(),n=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.aborted))},get reason(){var e;return null===(e=t.find((e=>!!e.reason)))||void 0===e?void 0:e.reason},get onabort(){return o},set onabort(e){o=e;for(const e of t)e.onabort=o},addEventListener:(e,n,o)=>{for(const r of t)r.addEventListener(e,n,o)},dispatchEvent:e=>t.some((t=>t.dispatchEvent(e))),removeEventListener:(e,n,o)=>{for(const r of t)r.removeEventListener(e,n,o)},throwIfAborted:()=>{for(const e of t)e.throwIfAborted()}}}(e,t.signal);if(n.aborted)return;const o=dn((()=>{t.abort("SPA URL changed")}));return await Mn(),n.aborted||(await jn(n),await vn(n)),o()}(async function(e){const t={ab:null,apiRoot:"https://bot.leadoo.com",companyCode:"01f1037e",insertAnalytics:true,mode:"normal"};var n;if(n="dynamic",E||(L=P(`leadoo:bot:${n}`),E=!0),S(`Leadoo dynamic: v${_n}`),await async function(){await st();const e=await Mt();if(e){S("initialising bugsnag");const{botCode:t,botID:n,companyCode:o,companyID:r}=rt();await e.initialise("4e30ab8572223eed601cb876970ce2a2",{botCode:t,botID:n,companyCode:o,companyID:r})}}(),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"object"==typeof e[y]&&e[y]?w=e[y]:(w={},s(e,y,w));const t=w;b.forEach((e=>{t[e]||s(t,e,{})}))}(),M(t.apiRoot,"Dynamic script API root"),On=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;return"object"!=typeof t[hn]&&(t[hn]={}),t[hn][e]?null:(t[hn][e]=!0,{release:()=>{t[hn][e]=!1}})}("dynamic"),!On)throw new Error("Failed obtaining script lock: Multiple scripts running");await function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;return new Promise((t=>{const{document:n}=e;if(n.body)return t();const o=()=>{n.removeEventListener("DOMContentLoaded",o),n.removeEventListener("load",o),t()};n.addEventListener("DOMContentLoaded",o),n.addEventListener("load",o)}))}();const o=Sn();In=o,function(){U(function(e){const[,t=""]=e.src.split("#");return`${t},${e.getAttribute("data-ctrl")||""}`.split(/,/g).reduce(((e,t)=>{const n=t.trim();if(!n)return e;const[o,r=!0]=n.split("=");let i=r;return"string"==typeof i&&(/^(no|false|0)$/i.test(i)?i=!1:/^(yes|true|1)$/i.test(i)&&(i=!0)),e[o]=i,e}),{})}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:k()))}(),rt().insertAnalytics=t.insertAnalytics,await Rt(!1,{ab:null,apiRoot:"https://bot.leadoo.com",companyCode:"01f1037e",insertAnalytics:true,mode:"normal"}),kn(),C().Dynamic={destroy:Dn,getLastTags:()=>[...An]},bt({type:"dyn-init"}),/^spa$/i.test(null!==(e=t.mode)&&void 0!==e?e:"")?(S("running in SPA mode"),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=async()=>{if(null==t||!t.aborted){try{await e()}catch(e){return void console.error(e)}setTimeout(n,0)}};setTimeout(n,0)}((()=>$n(o.signal)),o.signal),await vn(o.signal)):(S("running in standard mode"),await jn(o.signal))})().catch((e=>{On&&On.release(),bt({type:"dyn-init-fail"}),S("initialisation error"),console.error(e)}))})()})();