{"version":3,"file":"TestHomeChatbot.DhitxpHh.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/fJEAf6pm31pzdDPo4CDF/lsxW51cEWi7JKf093E01/TestHomeChatbot.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";function SensayChatbot(){const scriptDivRef=useRef(null);useEffect(()=>{// First, destroy any existing chatbot instance\nif(window.SensayChatbot?.destroy){try{window.SensayChatbot.destroy();}catch(error){console.log(\"Error destroying existing chatbot:\",error);}}const loadScript=(src,id)=>{const existingScript=document.getElementById(id);if(existingScript){existingScript.parentNode.removeChild(existingScript);}const script=document.createElement(\"script\");script.src=src;script.id=id;script.defer=true;document.head.appendChild(script);return()=>{// Destroy the chatbot before cleanup\nif(window.SensayChatbot?.destroy){try{window.SensayChatbot.destroy();}catch(error){console.log(\"Error destroying chatbot during cleanup:\",error);}}const scriptToRemove=document.getElementById(id);if(scriptToRemove){scriptToRemove.parentNode.removeChild(scriptToRemove);}// Remove the Sensay widget container\nconst widgetContainer=document.getElementById(\"sensay-widget-container\");if(widgetContainer&&widgetContainer.parentNode){widgetContainer.parentNode.removeChild(widgetContainer);}};};const cleanup=loadScript(\"https://chat-widget.sensay.io/c10affd3-865a-4b2e-ba78-10c26ce5c666/embed-script.js\",\"chat-widget-script-sensay\");return cleanup;},[]);return /*#__PURE__*/_jsx(\"div\",{ref:scriptDivRef});}export default SensayChatbot;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SensayChatbot\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TestHomeChatbot.map"],"mappings":"2MAA+E,SAAS,GAAe,CAAC,IAAM,EAAaA,EAAO,KAAK,CAG+M,OAH9M,MAAc,CACtJ,GAAG,EAAO,eAAe,QAAS,GAAG,CAAC,EAAO,cAAc,SAAS,OAAQ,EAAM,CAAC,QAAQ,IAAI,qCAAqC,EAAM,CAEuL,QAFlK,EAAI,IAAK,CAAC,IAAM,EAAe,SAAS,eAAe,EAAG,CAAI,GAAgB,EAAe,WAAW,YAAY,EAAe,CAAE,IAAM,EAAO,SAAS,cAAc,SAAS,CAAiF,MAAhF,GAAO,IAAI,EAAI,EAAO,GAAG,EAAG,EAAO,MAAM,GAAK,SAAS,KAAK,YAAY,EAAO,KAAW,CAC5a,GAAG,EAAO,eAAe,QAAS,GAAG,CAAC,EAAO,cAAc,SAAS,OAAQ,EAAM,CAAC,QAAQ,IAAI,2CAA2C,EAAM,CAAG,IAAM,EAAe,SAAS,eAAe,EAAG,CAAI,GAAgB,EAAe,WAAW,YAAY,EAAe,CAC5Q,IAAM,EAAgB,SAAS,eAAe,0BAA0B,CAAI,GAAiB,EAAgB,YAAY,EAAgB,WAAW,YAAY,EAAgB,IAA+B,qFAAqF,4BAA4B,EAAkB,EAAE,CAAC,CAAqB,EAAK,MAAM,CAAC,IAAI,EAAa,CAAC,wBAH7V,IAAoC,GAG0U"}