(function(){window._AHBubbleChatConfig = {"connectionId":"JdHsexSLU","welcomeMessage":null,"suggestions":[]};}());
(function(){"use strict";const b=`<realguru-component id="guruchat-container"></realguru-component>
`,p=`<div id="guruchat-bubble">
  <svg
    width="20"
    height="20"
    viewBox="0 0 20 20"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
  >
    <path
      d="M4 12H12V10H4V12ZM4 9H16V7H4V9ZM4 6H16V4H4V6ZM0 20V2C0 1.45 0.195833 0.979167 0.5875 0.5875C0.979167 0.195833 1.45 0 2 0H18C18.55 0 19.0208 0.195833 19.4125 0.5875C19.8042 0.979167 20 1.45 20 2V14C20 14.55 19.8042 15.0208 19.4125 15.4125C19.0208 15.8042 18.55 16 18 16H4L0 20ZM3.15 14H18V2H2V15.125L3.15 14Z"
      fill="white"
    />
  </svg>
  <p style="font-size: 16px; margin: 0">Chat 24/7</p>
</div>
`,m=`<div id="guruchat-close-btn">
  <svg
    width="24"
    height="24"
    viewBox="0 0 34 34"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
  >
    <path
      d="M26.9173 9.08148L24.9198 7.08398L17.0007 15.0032L9.08148 7.08398L7.08398 9.08148L15.0032 17.0007L7.08398 24.9198L9.08148 26.9173L17.0007 18.9982L24.9198 26.9173L26.9173 24.9198L18.9982 17.0007L26.9173 9.08148Z"
      fill="#fff"
    />
  </svg>
</div>
<iframe id="guruchat-iframe"></iframe>
`,f=`<div id="guruchat-welcome-greeting">
  <div id="guruchat-close-btn">
    <svg
      width="24"
      height="24"
      viewBox="0 0 34 34"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M26.9173 9.08148L24.9198 7.08398L17.0007 15.0032L9.08148 7.08398L7.08398 9.08148L15.0032 17.0007L7.08398 24.9198L9.08148 26.9173L17.0007 18.9982L24.9198 26.9173L26.9173 24.9198L18.9982 17.0007L26.9173 9.08148Z"
        fill="#0000008A"
      />
    </svg>
  </div>
</div>
<div id="guruchat-welcome-options"></div>
`,w=`<style>
  /* HEAD-START<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap">HEAD-END */

  :host {
    position: fixed;
    bottom: 5vh;
    right: 5vw;
    z-index: 9999;
    width: auto;
  }

  :host,
  :host #guruchat-bubble-container,
  :host #guruchat-welcome-options {
    display: flex;
    align-items: flex-end;
    pointer-events: none;
    font-family: 'Inter', sans-serif;
  }

  :host #guruchat-bubble-container {
    flex-direction: column-reverse;
  }

  :host,
  :host #guruchat-welcome-options {
    flex-direction: column;
  }

  :host #guruchat-bubble {
    cursor: pointer;
    display: flex;
    column-gap: 16px;
    align-items: center;
    width: fit-content;
    border-radius: 80px;
    padding: 16px 24px;
    background: linear-gradient(90deg, #6501a8 0%, #b060e6 100%);
    box-shadow: rgba(0, 0, 0, 0.3) 0px 4px 12px 0px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    transition: all 0.5s ease;
    pointer-events: auto;
  }
  :host #guruchat-bubble:hover {
    background: linear-gradient(90deg, #6501a8 0%, #b060e6 90%);
  }

  :host #guruchat-welcome-greeting,
  :host #guruchat-welcome-options div {
    box-shadow: rgba(0, 0, 0, 0.5) 0px 4px 12px 0px;
    transition: all 0.3s ease;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    width: min(300px, 85vw);
    color: #000;
  }

  :host .guruchat-welcome-option p {
    padding: 0px;
  }

  :host .guruchat-welcome-option:hover {
    background: #eac7ff !important;
  }

  :host #guruchat-welcome-greeting {
    background: #f6f6f6;
  }
  :host #guruchat-welcome-options div {
    background: #f3e1ff;
    max-width: fit-content;
    pointer-events: auto;
    cursor: pointer;
  }

  :host #guruchat-chat {
    display: flex;
    flex-direction: column;
    width: min(500px, 90vw);
    height: min(700px, 80vh);
    transition: all 0.5s ease;
  }

  :host #guruchat-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    pointer-events: auto;
  }

  :host iframe {
    height: 100%;
    border: 0;
    pointer-events: auto;
  }

  :host #guruchat-bubble.guruchat-bubble-hidden,
  :host #guruchat-chat.guruchat-chat-hidden {
    display: none;
  }
  :host #guruchat-bubble.guruchat-bubble-visible,
  :host #guruchat-chat.guruchat-chat-visible {
    display: flex;
  }
</style>
`,a=window._AHBubbleChatConfig,l=document.querySelector("body"),g=`https://guruchat.alohome.io/chat?connectionId=${a==null?void 0:a.connectionId}`;l==null||l.insertAdjacentHTML("beforeend",b);let h=!1;const v=e=>{e.stopPropagation(),d(null)},x=e=>{e.stopPropagation();const t=n.querySelector("#guruchat-chat");t&&(t.className="guruchat-chat-hidden"),y()},L=e=>{e.stopPropagation();const t=n.querySelector("#guruchat-welcome-container");t&&t.remove()},n=document.querySelector("#guruchat-container").attachShadow({mode:"open"});n.innerHTML=w;const C=()=>{if(!n)return!1;const e=document.createElement("div");e.id="guruchat-bubble-container",e.innerHTML=p,n.appendChild(e),n.querySelector("#guruchat-bubble").addEventListener("click",v),h||setTimeout(()=>!h&&M(),5e3)},d=e=>{if(!n)return!1;h=!0;const t=n.querySelector("#guruchat-bubble"),u=n.querySelector("#guruchat-welcome-container");if(!t)return!1;u&&u.remove(),t.className="guruchat-bubble-hidden";let o=n.querySelector("#guruchat-chat");if(!o){o=document.createElement("div"),o.id="guruchat-chat",o.innerHTML=m,n.appendChild(o);const r=n.querySelector("#guruchat-iframe");r==null||r.setAttribute("src",e?`${g}&text=${encodeURIComponent(e)}`:g);const i=n.querySelector("#guruchat-close-btn");i==null||i.addEventListener("click",x)}o.className="guruchat-chat-visible"},y=()=>{const e=n.querySelector("#guruchat-bubble");e&&(e.className="guruchat-bubble-visible")},M=()=>{var r;const e=n.querySelector("#guruchat-bubble-container");if(!a.welcomeMessage&&!a.suggestions)return!1;const t=document.createElement("div");t.id="guruchat-welcome-container",t.innerHTML=f,e.appendChild(t);const u=n.querySelector("#guruchat-welcome-options"),o=n.querySelector("#guruchat-welcome-greeting");if(a.welcomeMessage||o==null||o.remove(),a.welcomeMessage){const i=a.welcomeMessage,c=document.createElement("p");c.innerHTML=i,o&&o.appendChild(c);const s=n.querySelector("#guruchat-close-btn");s==null||s.addEventListener("click",L)}a.suggestions.length>0&&((r=a.suggestions)==null||r.forEach(i=>{const c=document.createElement("div");c.className="guruchat-welcome-option";const s=document.createElement("p");s.innerHTML=i,c.appendChild(s),u.appendChild(c),c.addEventListener("click",()=>{d(i)})}))};C()})();
