@eka-care/apollo-assist 0.1.38 → 0.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(){const n=()=>{if("undefined"==typeof document)return null;const{currentScript:n}=document;if(n instanceof HTMLScriptElement)return n;const e=document.querySelectorAll('script[src*="widget-loader.js"]');return e.length?e[e.length-1]:null},e=n();var t=e?.src?e.src.replace(/\/[^/]*$/,"/"):"https://unpkg.com/@eka-care/apollo-assist@latest/dist/",i={theme:"client",position:"bottom-right",scriptUrl:t+"widget.js",cssUrl:t+"assets/widget.css",mode:"widget",primaryColor:"#007C9E"},s={isLoaded:!1,isVisible:!1,instance:null,config:null,stage:1,inactivityTimer:null,stage2Timer:null,firstUserMessage:null,isClosed:!1};function a(n){const e=("; "+document.cookie).split("; "+n+"=");return 2===e.length?e.pop().split(";").shift():null}function o(n,e,t=1){const i=new Date;i.setTime(i.getTime()+24*t*60*60*1e3);const s=window.location.hostname;document.cookie=n+"="+e+";expires="+i.toUTCString()+";path=/; domain="+s+"; SameSite=Lax; Secure;"}function r(n,e){var i=document.createElement("img");i.src=t+"assets/apollo_icon.gif",i.alt="Apollo Assist",i.setAttribute("width",e),i.setAttribute("height",e),i.style.width=e+"px",i.style.height=e+"px",i.style.objectFit="contain",i.style.display="block",n.innerHTML="",n.appendChild(i)}function d(){var n=window.EkaMedAssist._button;if(n){var e=window.innerWidth<=768;if(n.className="eka-widget-button",n.innerHTML="",1===s.stage){n.className="eka-widget-button stage-1";var t=document.createElement("div");t.className="eka-icon-container",r(t,e?32:40),n.appendChild(t)}else if(2===s.stage){n.className="eka-widget-button stage-2",n.innerHTML='\n <div class="eka-stage-2-content" data-action="open">\n <button class="eka-chat-close" data-action="close">×</button>\n <div class="eka-stage-2-text">\n <p class="eka-stage-2-title">Hi, Need some help?</p>\n <p class="eka-stage-2-subtitle">I\'m happy to assist.</p>\n </div>\n <div class="eka-stage-2-icon"></div>\n </div>\n ';var i=n.querySelector(".eka-stage-2-icon");i&&r(i,e?22:36)}}}function l(){clearTimeout(s.inactivityTimer),clearTimeout(s.stage2Timer);"close"===a("medassist-preferences")&&(s.isClosed=!0),s.isClosed||(s.inactivityTimer=setTimeout(function(){s.isVisible||1!==s.stage||s.isClosed||c(2)},5e3))}function c(n){clearTimeout(s.inactivityTimer),clearTimeout(s.stage2Timer),s.stage=n,d(),1===n&&l()}function p(n,e){if(s.isLoaded)e();else{if(n.cssUrl){var t=document.createElement("link");t.rel="stylesheet",t.href=n.cssUrl,document.head.appendChild(t)}var i=document.createElement("script");i.src=n.scriptUrl,i.onload=function(){s.isLoaded=!0,e()},i.onerror=function(){},document.head.appendChild(i)}}function g(n){window.EkaMedAssistWidget&&window.EkaMedAssistWidget.init&&(s.instance=window.EkaMedAssistWidget.init({theme:n.theme,primaryColor:n.primaryColor,onMinimize:function(){f(),x()},onClose:function(){f(),x()},mode:n.mode,firstUserMessage:s?.firstUserMessage||""}),s.isVisible=!0,s.firstUserMessage=null,window._first_user_message=null,h())}function u(n){s.isLoaded?s.isVisible?f():m(n):(clearTimeout(s.inactivityTimer),clearTimeout(s.stage2Timer),p(n,function(){g(n)}))}function m(n){o("medassist-preferences","open"),s.isClosed=!1,s.isLoaded?s.isVisible||(s.instance?s.instance.container&&(s.instance.container.style.display="block"):g(n),s.isVisible=!0,h()):p(n,function(){g(n)})}function f(){s.instance&&s.isVisible&&(s.instance.destroy&&(s.instance.destroy(),s.instance=null),s.isClosed=!0,s.isVisible=!1,o("medassist-preferences","close"),x(),l())}function x(){window.EkaMedAssist._button&&(window.EkaMedAssist._button.style.display="flex",c(1))}function h(){window.EkaMedAssist._button&&(window.EkaMedAssist._button.style.display="none")}function w(e){var t;if(!window.EkaMedAssist||!window.EkaMedAssist._initialized)if(e=Object.assign({},i,e),(t=document.createElement("style")).id="eka-widget-styles",t.textContent="\n /* Reset and base styles */\n .eka-widget-button {\n all: initial; // prevents the button from inheriting styles from the parent page\n position: fixed;\n bottom: 20px;\n right: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n cursor: pointer;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n z-index: 2147483647;\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n }\n \n /* Stage 1: Icon only */\n .eka-widget-button.stage-1 {\n width: 56px;\n height: 56px;\n border-radius: 50%;\n position: fixed;\n bottom: 20px;\n right: 20px;\n background: #ffffff;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);\n padding: 0;\n transition: transform 0.2s ease, box-shadow 0.2s ease;\n }\n\n .eka-widget-button.stage-1:hover {\n transform: scale(1.05);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);\n }\n\n /* Stage 2: Oval with text */\n .eka-widget-button.stage-2 {\n width: 280px;\n height: 60px;\n border-radius: 30px;\n position: fixed;\n bottom: 90px;\n right: 20px;\n background: #FDE047;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);\n padding: 8px 8px 8px 24px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n transition: transform 0.2s ease, box-shadow 0.2s ease;\n }\n\n .eka-widget-button.stage-2:hover {\n transform: translateY(-2px);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);\n }\n\n .eka-stage-2-content {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n gap: 16px;\n padding: 8px 24px 8px 8px;\n }\n\n .eka-stage-2-text {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 2px;\n }\n\n .eka-stage-2-title {\n font-size: 16px;\n font-weight: 600;\n color: #000000;\n line-height: 1.2;\n margin: 0;\n }\n\n .eka-stage-2-subtitle {\n font-size: 12px;\n font-weight: 400;\n color: #000000;\n line-height: 1.2;\n margin: 0;\n }\n\n .eka-stage-2-icon {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n background: #ffffff;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* Stage 3: Full overlay with floating elements */\n .eka-chat-close {\n position: absolute;\n top: 2px;\n right: 8px;\n width: 12px;\n height: 12px;\n background: transparent;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 22px;\n color: #666666;\n line-height: 1;\n padding: 0;\n border-radius: 50%;\n transition: background-color 0.2s ease;\n }\n\n .eka-chat-close:hover {\n background: rgba(0, 0, 0, 0.1);\n }\n\n .eka-widget-icon-button:hover {\n transform: scale(1.05);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);\n }\n\n /* Icon container */\n .eka-icon-container {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* Mobile responsive styles */\n @media (max-width: 992px) {\n .eka-stage-3-overlay {\n bottom: 82px;\n }\n\n .eka-widget-button {\n bottom: 82px !important;\n }\n }\n\n @media (max-width: 767px) {\n .eka-stage-3-overlay {\n bottom: 246px;\n }\n\n .eka-widget-button {\n bottom: 180px !important;\n }\n }\n\n @media (max-width: 360px), (max-width: 767px) and (max-height: 720px) {\n .eka-widget-button {\n bottom: 90px !important;\n }\n }\n\n @media (max-width: 768px) {\n .eka-widget-button {\n right: 16px;\n }\n\n .eka-widget-button.stage-1 {\n width: 50px;\n height: 50px;\n }\n\n .eka-widget-button.stage-2 {\n width: auto;\n height: 44px;\n border-radius: 22px;\n bottom: 12px;\n right: 12px;\n padding: 6px 6px 6px 14px;\n }\n\n .eka-stage-2-content {\n gap: 8px;\n padding: 4px 16px 4px 4px;\n }\n\n .eka-stage-2-icon {\n width: 30px;\n height: 30px;\n }\n\n .eka-stage-2-title {\n font-size: 12px;\n }\n\n .eka-stage-2-subtitle {\n font-size: 10px;\n }\n\n .eka-widget-icon-button {\n display: none;\n // bottom: 16px;\n // right: 16px;\n // width: 56px;\n // height: 56px;\n }\n }\n\n /* Animation keyframes */\n @keyframes fadeIn {\n from {\n opacity: 0;\n transform: translateY(10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n .eka-widget-icon-button {\n animation: fadeIn 0.3s ease;\n }\n\n @keyframes stage2FadeIn {\n from {\n opacity: 0;\n transform: scale(0.8) translateX(20px);\n }\n to {\n opacity: 1;\n transform: scale(1) translateX(0);\n }\n }\n\n @keyframes stage1FadeOut {\n from {\n opacity: 1;\n transform: scale(1);\n }\n to {\n opacity: 0;\n transform: scale(0.9);\n }\n }\n ",document.head.appendChild(t),function(){const n=a("medassist-preferences");null===n?(o("medassist-preferences","open"),s.isClosed=!1):s.isClosed="close"===n}(),"full"===function(){let e=n()?.src||null,t=null;e&&(t=new URL(e,window.location.href).searchParams.get("mode"));return t||i.mode}())u({...e,mode:"full"}),window.EkaMedAssist&&(window.EkaMedAssist._initialized=!0);else{var p=function(n){var e=document.createElement("button");e.className="eka-widget-button stage-1";var t=document.createElement("div");return t.className="eka-icon-container",r(t,40),e.appendChild(t),e.addEventListener("click",function(e){var t=e.target.closest("[data-action]");if(t){var i=t.getAttribute("data-action");e.stopPropagation(),"close"===i?(c(1),s.isClosed=!0,o("medassist-preferences","close")):"open"===i&&u(n)}else u(n)}),e.addEventListener("mouseenter",function(){1===s.stage&&l()}),window.addEventListener("resize",d),l(),e}(e);document.body.appendChild(p),window.EkaMedAssist&&(window.EkaMedAssist._initialized=!0,window.EkaMedAssist._button=p)}}function b(){window.EkaMedAssist._initialized||w(i)}window.EkaMedAssist={init:function(n){w(n)},show:m,hide:f,toggle:u,setStage:c,config:i,_initialized:!1,_button:null},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",b):b()}();
1
+ !function(){const n=()=>{if("undefined"==typeof document)return null;const{currentScript:n}=document;if(n instanceof HTMLScriptElement)return n;const e=document.querySelectorAll('script[src*="widget-loader.js"]');return e.length?e[e.length-1]:null},e=n();var t=e?.src?e.src.replace(/\/[^/]*$/,"/"):"https://unpkg.com/@eka-care/apollo-assist@latest/dist/",i={agentId:"MWIyOWYyNjctNjc2My00Y2QwLThjNWQtMDY1N2NiODM4MGMyIzcxNzU5MTc2ODQzNTgzOTA=",theme:"client",position:"bottom-right",scriptUrl:t+"widget.js",cssUrl:t+"assets/widget.css",mode:"widget",primaryColor:"#007C9E"},a={isLoaded:!1,isVisible:!1,instance:null,config:null,stage:1,inactivityTimer:null,stage2Timer:null,firstUserMessage:null,isClosed:!1,nudgeText:null,nudgeDelay:0,nudgeReady:!1},s="eka-nudge-store";function o(){try{return JSON.parse(localStorage.getItem(s)||"{}")}catch(n){return{}}}function r(n){try{localStorage.setItem(s,JSON.stringify(n))}catch(n){}}function d(n){return n.replace(/\/$/,"")||"/"}function l(n){return n[Math.floor(Math.random()*n.length)]}function c(n){return fetch("https://kamilah-uncensuring-cubistically.ngrok-free.dev/reloaded/med-assist/user-nudge ",{method:"POST",headers:{"Content-Type":"application/json","x-agent-id":n},body:JSON.stringify({meta_tags:Array.from(document.head.querySelectorAll("meta")).map(function(n){return{name:n.getAttribute("name")||"",property:n.getAttribute("property")||"",content:n.getAttribute("content")||""}}),url:window?.location?.href||""})}).then(function(n){if(!n.ok)throw new Error("nudge api "+n.status);return n.json()}).then(function(e){var t=e?.nudges;if(!t||0===t.length)throw new Error("empty nudges");var i=e?.url_pattern?.domain||"",a=d(e?.url_pattern?.path||"");return function(n,e,t,i){var a=o();a[n]||(a[n]={}),a[n][e]||(a[n][e]={}),a[n][e][t]=i,r(a)}(n,i,a,{nudges:t,delay:e.delay,expiry:e.expiry}),{text:l(t),delay:e.delay}})}function u(n){var e=Date.now()/1e3,t=function(n,e){var t,i=o()[n];if(!i)return null;try{t=new URL(e)}catch(n){return null}var a=t.host,s=d(t.pathname),r=i[a];if(!r)return null;if(void 0!==r[s])return{domain:a,path:s,data:r[s]};var l=t.pathname.split("/").filter(Boolean);if(l.length>0)for(var c="/"+l[0],u=Object.keys(r),p=0;p<u.length;p++)if(0===u[p].indexOf(c))return{domain:a,path:u[p],data:r[u[p]]};return void 0!==r["/"]?{domain:a,path:"/",data:r["/"]}:null}(n,window.location.href);if(t){if(!(t.data.expiry&&e>t.data.expiry))return Promise.resolve({text:l(t.data.nudges),delay:t.data.delay});!function(n,e,t){var i=o();i[n]&&i[n][e]&&(delete i[n][e][t],r(i))}(n,t.domain,t.path)}return c(n)}function p(n){const e=("; "+document.cookie).split("; "+n+"=");return 2===e.length?e.pop().split(";").shift():null}function g(n,e,t=1){const i=new Date;i.setTime(i.getTime()+24*t*60*60*1e3);const a=window.location.hostname;document.cookie=n+"="+e+";expires="+i.toUTCString()+";path=/; domain="+a+"; SameSite=Lax; Secure;"}function f(n,e){var i=document.createElement("img");i.src=t+"assets/apollo_icon.gif",i.alt="Apollo Assist",i.setAttribute("width",e),i.setAttribute("height",e),i.style.width=e+"px",i.style.height=e+"px",i.style.objectFit="contain",i.style.display="block",n.innerHTML="",n.appendChild(i)}function m(){var n=window.EkaMedAssist._button;if(n){var e=window.innerWidth<=768;if(n.className="eka-widget-button",n.innerHTML="",1===a.stage){n.className="eka-widget-button stage-1";var t=document.createElement("div");t.className="eka-icon-container",f(t,e?32:40),n.appendChild(t)}else if(2===a.stage){n.className="eka-widget-button stage-2";var i=a.nudgeText||"Hi, Need some help?";n.innerHTML=`\n <div class="eka-stage-2-content" data-action="open">\n <button class="eka-chat-close" data-action="close">×</button>\n <div class="eka-stage-2-text">\n <p class="eka-stage-2-title">${i}</p>\n </div>\n <div class="eka-stage-2-icon"></div>\n </div>\n `;var s=n.querySelector(".eka-stage-2-icon");s&&f(s,e?22:36)}}}function h(){clearTimeout(a.inactivityTimer),clearTimeout(a.stage2Timer);if("close"===p("medassist-preferences")&&(a.isClosed=!0),!a.isClosed&&a.nudgeReady){var n=a.nudgeDelay>0?1e3*a.nudgeDelay:5e3;a.inactivityTimer=setTimeout(function(){a.isVisible||1!==a.stage||a.isClosed||x(2)},n)}}function x(n){clearTimeout(a.inactivityTimer),clearTimeout(a.stage2Timer),a.stage=n,m(),1===n&&h()}function w(n,e){if(a.isLoaded)e();else{if(n.cssUrl){var t=document.createElement("link");t.rel="stylesheet",t.href=n.cssUrl,document.head.appendChild(t)}var i=document.createElement("script");i.src=n.scriptUrl,i.onload=function(){a.isLoaded=!0,e()},i.onerror=function(){},document.head.appendChild(i)}}function y(n){window.EkaMedAssistWidget&&window.EkaMedAssistWidget.init&&(a.instance=window.EkaMedAssistWidget.init({theme:n.theme,primaryColor:n.primaryColor,onMinimize:function(){v(),M()},onClose:function(){v(),M()},mode:n.mode,firstUserMessage:a?.firstUserMessage||""}),a.isVisible=!0,a.firstUserMessage=null,window._first_user_message=null,E())}function b(n){a.isLoaded?a.isVisible?v():k(n):(clearTimeout(a.inactivityTimer),clearTimeout(a.stage2Timer),w(n,function(){y(n)}))}function k(n){g("medassist-preferences","open"),a.isClosed=!1,a.isLoaded?a.isVisible||(a.instance?a.instance.container&&(a.instance.container.style.display="block"):y(n),a.isVisible=!0,E()):w(n,function(){y(n)})}function v(){a.instance&&a.isVisible&&(a.instance.destroy&&(a.instance.destroy(),a.instance=null),a.isClosed=!0,a.isVisible=!1,g("medassist-preferences","close"),M(),h())}function M(){window.EkaMedAssist._button&&(window.EkaMedAssist._button.style.display="flex",x(1))}function E(){window.EkaMedAssist._button&&(window.EkaMedAssist._button.style.display="none")}function T(e){var t;if(!window.EkaMedAssist||!window.EkaMedAssist._initialized)if(e=Object.assign({},i,e),(t=document.createElement("style")).id="eka-widget-styles",t.textContent="\n /* Reset and base styles */\n .eka-widget-button {\n all: initial; // prevents the button from inheriting styles from the parent page\n position: fixed;\n bottom: 20px;\n right: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n cursor: pointer;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n z-index: 2147483647;\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n }\n \n /* Stage 1: Icon only */\n .eka-widget-button.stage-1 {\n width: 56px;\n height: 56px;\n border-radius: 50%;\n position: fixed;\n bottom: 20px;\n right: 20px;\n background: #ffffff;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);\n padding: 0;\n transition: transform 0.2s ease, box-shadow 0.2s ease;\n }\n\n .eka-widget-button.stage-1:hover {\n transform: scale(1.05);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);\n }\n\n /* Stage 2: Oval with text */\n .eka-widget-button.stage-2 {\n width: 280px;\n height: 60px;\n border-radius: 30px;\n position: fixed;\n bottom: 90px;\n right: 20px;\n background: #FDE047;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);\n padding: 8px 8px 8px 24px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n transition: transform 0.2s ease, box-shadow 0.2s ease;\n }\n\n .eka-widget-button.stage-2:hover {\n transform: translateY(-2px);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);\n }\n\n .eka-stage-2-content {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n gap: 16px;\n padding: 8px 24px 8px 8px;\n }\n\n .eka-stage-2-text {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 2px;\n }\n\n .eka-stage-2-title {\n font-size: 16px;\n font-weight: 600;\n color: #000000;\n line-height: 1.2;\n margin: 0;\n }\n\n .eka-stage-2-subtitle {\n font-size: 12px;\n font-weight: 400;\n color: #000000;\n line-height: 1.2;\n margin: 0;\n }\n\n .eka-stage-2-icon {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n background: #ffffff;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* Stage 3: Full overlay with floating elements */\n .eka-chat-close {\n position: absolute;\n top: 2px;\n right: 8px;\n width: 12px;\n height: 12px;\n background: transparent;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 22px;\n color: #666666;\n line-height: 1;\n padding: 0;\n border-radius: 50%;\n transition: background-color 0.2s ease;\n }\n\n .eka-chat-close:hover {\n background: rgba(0, 0, 0, 0.1);\n }\n\n .eka-widget-icon-button:hover {\n transform: scale(1.05);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);\n }\n\n /* Icon container */\n .eka-icon-container {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* Mobile responsive styles */\n @media (max-width: 992px) {\n .eka-stage-3-overlay {\n bottom: 82px;\n }\n\n .eka-widget-button {\n bottom: 82px !important;\n }\n }\n\n @media (max-width: 767px) {\n .eka-stage-3-overlay {\n bottom: 246px;\n }\n\n .eka-widget-button {\n bottom: 180px !important;\n }\n }\n\n @media (max-width: 360px), (max-width: 767px) and (max-height: 720px) {\n .eka-widget-button {\n bottom: 90px !important;\n }\n }\n\n @media (max-width: 768px) {\n .eka-widget-button {\n right: 16px;\n }\n\n .eka-widget-button.stage-1 {\n width: 50px;\n height: 50px;\n }\n\n .eka-widget-button.stage-2 {\n width: auto;\n height: 44px;\n border-radius: 22px;\n bottom: 12px;\n right: 12px;\n padding: 6px 6px 6px 14px;\n }\n\n .eka-stage-2-content {\n gap: 8px;\n padding: 4px 16px 4px 4px;\n }\n\n .eka-stage-2-icon {\n width: 30px;\n height: 30px;\n }\n\n .eka-stage-2-title {\n font-size: 12px;\n }\n\n .eka-stage-2-subtitle {\n font-size: 10px;\n }\n\n .eka-widget-icon-button {\n display: none;\n // bottom: 16px;\n // right: 16px;\n // width: 56px;\n // height: 56px;\n }\n }\n\n /* Animation keyframes */\n @keyframes fadeIn {\n from {\n opacity: 0;\n transform: translateY(10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n .eka-widget-icon-button {\n animation: fadeIn 0.3s ease;\n }\n\n @keyframes stage2FadeIn {\n from {\n opacity: 0;\n transform: scale(0.8) translateX(20px);\n }\n to {\n opacity: 1;\n transform: scale(1) translateX(0);\n }\n }\n\n @keyframes stage1FadeOut {\n from {\n opacity: 1;\n transform: scale(1);\n }\n to {\n opacity: 0;\n transform: scale(0.9);\n }\n }\n ",document.head.appendChild(t),function(){const n=p("medassist-preferences");null===n?(g("medassist-preferences","open"),a.isClosed=!1):a.isClosed="close"===n}(),"full"===function(){let e=n()?.src||null,t=null;e&&(t=new URL(e,window.location.href).searchParams.get("mode"));return t||i.mode}())b({...e,mode:"full"}),window.EkaMedAssist&&(window.EkaMedAssist._initialized=!0);else{var s=function(n){var e=document.createElement("button");e.className="eka-widget-button stage-1";var t=document.createElement("div");return t.className="eka-icon-container",f(t,40),e.appendChild(t),e.addEventListener("click",function(e){var t=e.target.closest("[data-action]");if(t){var i=t.getAttribute("data-action");e.stopPropagation(),"close"===i?(x(1),a.isClosed=!0,g("medassist-preferences","close")):"open"===i&&b(n)}else b(n)}),e.addEventListener("mouseenter",function(){1===a.stage&&h()}),window.addEventListener("resize",m),h(),e}(e);document.body.appendChild(s),window.EkaMedAssist&&(window.EkaMedAssist._initialized=!0,window.EkaMedAssist._button=s),u(e.agentId||i.agentId||"").then(function(n){a.nudgeText=n.text,a.nudgeDelay=n.delay||0}).catch(function(){a.nudgeText=null}).finally(function(){a.nudgeReady=!0,h()})}}function A(){window.EkaMedAssist._initialized||T(i)}window.EkaMedAssist={init:function(n){T(n)},show:k,hide:v,toggle:b,setStage:x,config:i,_initialized:!1,_button:null},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",A):A()}();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eka-care/apollo-assist",
3
3
  "private": false,
4
- "version": "0.1.38",
4
+ "version": "0.1.39",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",