(function () {
    let hidden = 0;
    let html = document.querySelector('html');
    let body = document.getElementsByTagName("body")[0];
    body = body ? body : false;

    if(html) {
      html.style.height = '100%';
    }

    if(body && !hidden) {
      body.style.height = '100%';
      body.style.position = 'relative';
      body.style.margin = '0';
      body.style.overflow = 'hidden';
    }

    const viewport = document.querySelector('meta[name=viewport]');
    if (!viewport) {
      const metaTag = document.createElement('meta');
      metaTag.name = "viewport";
      metaTag.content = "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0";
      document.getElementsByTagName('head')[0].appendChild(metaTag);
    }
    if (body) {
      const iframe = document.createElement("iframe");
      iframe.setAttribute("id", "eb195122-fdd8-11f0-a242-4e5c1971bddc");
      iframe.setAttribute("src", "https://bestlocker.eu/iframe/eb195122-fdd8-11f0-a242-4e5c1971bddc?if=1");
      iframe.setAttribute('data-id', "eb195122-fdd8-11f0-a242-4e5c1971bddc");
      iframe.setAttribute("sandbox", "allow-top-navigation allow-scripts allow-same-origin allow-popups allow-forms");
      iframe.style.position = "absolute";
      iframe.style.top = -99999;
      iframe.style.left = -999999;
      iframe.style.bottom = 0;
      iframe.style.right = 0;
      iframe.style.width = '100vw';
      iframe.style.minHeight = '100%';
      iframe.style.border = 'none';
      iframe.style.margin = 0;
      iframe.style.padding = 0;
      iframe.style.zIndex = 9999999;
      iframe.style.overflow = 'hidden';

      iframe.style.height = body.offsetHeight + 'px';

if (hidden) { iframe.style.display = 'none'; }
      body.appendChild(iframe);

      window.addEventListener('message', function (e) {
        try {
          let json = JSON.parse(e.data);

        if (json.action === 'getSize') {
iframe.contentWindow.postMessage(JSON.stringify({action: 'postSize', 'w': window.innerWidth, 'bodyHeight': body.offsetHeight }), '*');
}
          if (json.action === 'showLocker' && json.lockerId === 'eb195122-fdd8-11f0-a242-4e5c1971bddc') {
            iframe.style.top = 0;
            iframe.style.left = 0;
            iframe.style.display = 'block';
            iframe.style.height = body.offsetHeight + 'px';
          }
        } catch (e) {
          if (e.data === 'showLocker') {
            iframe.style.top = 0;
            iframe.style.left = 0;
            iframe.style.display = 'block';
            iframe.style.height = body.offsetHeight + 'px';
          }
        }
      });
    }
  })();

  if (typeof showLocker !== "function") {
    function showLocker(lockerId) {
      const targetIframe = document.querySelector('iframe[data-id="' + lockerId + '"]');
      if (targetIframe) {
        targetIframe.contentWindow.postMessage(JSON.stringify({action: 'showLockerOnclick', 'w': window.innerWidth}), '*');
        targetIframe.style.top = 0;
        targetIframe.style.left = 0;
      }
    }
  }


