{"version":3,"file":"/dist/imbox-late-loader.js","mappings":"MAIA,GAAmC,OAAhCA,SAASC,eADH,YACgC,CAMrC,IAJIC,EAKKC,EAAT,WAE4B,MA8BhC,SAAmBC,GACf,IAAIC,EAAKL,SAASM,OACdC,EAASH,EAAO,IAChBI,EAAQH,EAAGI,QAAQ,KAAOF,GAC9B,IAAc,GAAVC,GAEA,GAAa,IADbA,EAAQH,EAAGI,QAAQF,IACH,OAAO,SAG3B,CACIC,GAAS,EACT,IAAIE,EAAMV,SAASM,OAAOG,QAAQ,IAAKD,IAC3B,GAARE,IACAA,EAAML,EAAGM,OAEjB,CAGA,OAAOC,UAAUP,EAAGQ,UAAUL,EAAQD,EAAOI,OAAQD,GACzD,CAlD+BI,CAAU,yBAMzBC,IACAA,GAAS,EACTC,cAAcd,GAa1Be,OAAOC,KAAO,OACd,WACI,IAAIC,EAAKnB,SAASoB,cAAc,UAAWD,EAAGE,KAAO,kBAAmBF,EAAGG,OAAQ,EACnFH,EAAGI,KAAO,UAAYvB,SAASwB,SAASC,SAAW,WAAa,WAAa,wCAC7E,IAAIC,EAAI1B,SAAS2B,qBAAqB,UAAU,GAAID,EAAEE,WAAWC,aAAaV,EAAIO,EACrF,CAJD,GAVA,EAjBIX,GAAS,EAkBbZ,IAEAD,EAAQ4B,aAAY,WAChB3B,GACJ,GAAG,IACP,C","sources":["webpack://webien-site-widgets/./assets/js/imbox-late-loader.js"],"sourcesContent":["// First check if the script already exists in the dom\n// by searching for an id\n\nlet id = 'imbox-js'\nif(document.getElementById(id) === null) {\n\n let timer;\n let loaded = false;\n\n // Check if cookie consent has been set\n // Set up timer to listebn for when it has been accepted\n function checkConsentCookie() {\n let hasCookieConsent = getCookie(\"CookieLawInfoConsent\");\n if (hasCookieConsent == null) {\n // do cookie doesn't exist stuff;\n //console.log('No consent yet..');\n }\n else {\n if(!loaded){\n loaded = true;\n clearInterval(timer);\n loadAppScript();\n }\n }\n }\n checkConsentCookie();\n\n timer = setInterval(function (){\n checkConsentCookie();\n }, 200);\n}\n\nfunction loadAppScript(){\n window._sid = '1594';\n (function() {\n let se = document.createElement('script'); se.type = 'text/javascript'; se.async = true;\n se.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'files.imbox.io/app/dist/initWidget.js';\n let s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(se, s);\n })();\n}\n\n\n// Helper for getting cookies\nfunction getCookie(name) {\n var dc = document.cookie;\n var prefix = name + \"=\";\n var begin = dc.indexOf(\"; \" + prefix);\n if (begin == -1) {\n begin = dc.indexOf(prefix);\n if (begin != 0) return null;\n }\n else\n {\n begin += 2;\n var end = document.cookie.indexOf(\";\", begin);\n if (end == -1) {\n end = dc.length;\n }\n }\n // because unescape has been deprecated, replaced with decodeURI\n //return unescape(dc.substring(begin + prefix.length, end));\n return decodeURI(dc.substring(begin + prefix.length, end));\n}\n"],"names":["document","getElementById","timer","checkConsentCookie","name","dc","cookie","prefix","begin","indexOf","end","length","decodeURI","substring","getCookie","loaded","clearInterval","window","_sid","se","createElement","type","async","src","location","protocol","s","getElementsByTagName","parentNode","insertBefore","setInterval"],"sourceRoot":""}