athena-xai-chat 1.0.61 → 1.0.62
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.
|
@@ -6681,7 +6681,10 @@ let yA = class extends y {
|
|
|
6681
6681
|
}
|
|
6682
6682
|
_resetChat() {
|
|
6683
6683
|
this.addEventListener("select-chat-reset", async () => {
|
|
6684
|
-
this._isVisible = !0, await this.selectChatController?.reset()
|
|
6684
|
+
this._isVisible = !0, await this.selectChatController?.reset(), window.innerWidth <= 768 && this._isVisible && window.scrollTo({
|
|
6685
|
+
top: 60,
|
|
6686
|
+
behavior: "smooth"
|
|
6687
|
+
});
|
|
6685
6688
|
});
|
|
6686
6689
|
}
|
|
6687
6690
|
async _initializeChat() {
|
|
@@ -1658,7 +1658,7 @@
|
|
|
1658
1658
|
max-height: 130px;
|
|
1659
1659
|
}
|
|
1660
1660
|
}
|
|
1661
|
-
`],cA([b()],rA.prototype,"_selectedResult",2),cA([b()],rA.prototype,"_isMobile",2),cA([b()],rA.prototype,"_isSwiperInitialized",2),cA([UA({type:Array})],rA.prototype,"results",2),cA([b()],rA.prototype,"_activeTextMessage",2),cA([b()],rA.prototype,"_seenResults",2),cA([b()],rA.prototype,"_isRelaxed",2),cA([b()],rA.prototype,"_lang",2),rA=cA([eA("athena-xai-select-chat-results")],rA);var Pn=Object.defineProperty,Gn=Object.getOwnPropertyDescriptor,pe=(e,A,g,B)=>{for(var t=B>1?void 0:B?Gn(A,g):A,o=e.length-1,s;o>=0;o--)(s=e[o])&&(t=(B?s(A,g,t):s(t))||t);return B&&t&&Pn(A,g,t),t};let XA=class extends W{constructor(){super(...arguments),this._isVisible=!0,this._lang="en",this.websiteToken=""}_scrollDownObserver(){const e=this.renderRoot.querySelector(".athena-xai-select-chat__chat-outer-container");if(!e||e._observerAttached)return;e._observerAttached=!0,new MutationObserver(()=>{e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}).observe(e,{childList:!0,subtree:!0})}_resetChat(){this.addEventListener("select-chat-reset",async()=>{this._isVisible=!0,await this.selectChatController?.reset()})}async _initializeChat(){this._isVisible=!0,await this.selectChatController?.startConversation(),OA("generic_gf_start")}_makeNewRecommendation(){this.addEventListener("make-new-recommendation",async e=>{await this.selectChatController?.fetchRecommendedProducts(e?.detail?.seen_results)})}async connectedCallback(){super.connectedCallback(),this._lang=document.documentElement.lang||"en",window.innerWidth<=768&&this._isVisible&&window.scrollTo({top:60,behavior:"smooth"}),await Ao(),this.selectChatController=new Oo(this,this.websiteToken),await this._initializeChat(),this._resetChat(),this._makeNewRecommendation()}updated(){this._scrollDownObserver()}render(){if(!this.selectChatController)return;const{messages:e,isLoading:A,isResetLoading:g,isError:B}=this.selectChatController;if(A)return M`<athena-xai-select-chat-loader></athena-xai-select-chat-loader>`;if(B)return M`<athena-xai-select-chat-error></athena-xai-select-chat-error>`;const t=e.some(o=>o?.results?.length);return M`
|
|
1661
|
+
`],cA([b()],rA.prototype,"_selectedResult",2),cA([b()],rA.prototype,"_isMobile",2),cA([b()],rA.prototype,"_isSwiperInitialized",2),cA([UA({type:Array})],rA.prototype,"results",2),cA([b()],rA.prototype,"_activeTextMessage",2),cA([b()],rA.prototype,"_seenResults",2),cA([b()],rA.prototype,"_isRelaxed",2),cA([b()],rA.prototype,"_lang",2),rA=cA([eA("athena-xai-select-chat-results")],rA);var Pn=Object.defineProperty,Gn=Object.getOwnPropertyDescriptor,pe=(e,A,g,B)=>{for(var t=B>1?void 0:B?Gn(A,g):A,o=e.length-1,s;o>=0;o--)(s=e[o])&&(t=(B?s(A,g,t):s(t))||t);return B&&t&&Pn(A,g,t),t};let XA=class extends W{constructor(){super(...arguments),this._isVisible=!0,this._lang="en",this.websiteToken=""}_scrollDownObserver(){const e=this.renderRoot.querySelector(".athena-xai-select-chat__chat-outer-container");if(!e||e._observerAttached)return;e._observerAttached=!0,new MutationObserver(()=>{e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}).observe(e,{childList:!0,subtree:!0})}_resetChat(){this.addEventListener("select-chat-reset",async()=>{this._isVisible=!0,await this.selectChatController?.reset(),window.innerWidth<=768&&this._isVisible&&window.scrollTo({top:60,behavior:"smooth"})})}async _initializeChat(){this._isVisible=!0,await this.selectChatController?.startConversation(),OA("generic_gf_start")}_makeNewRecommendation(){this.addEventListener("make-new-recommendation",async e=>{await this.selectChatController?.fetchRecommendedProducts(e?.detail?.seen_results)})}async connectedCallback(){super.connectedCallback(),this._lang=document.documentElement.lang||"en",window.innerWidth<=768&&this._isVisible&&window.scrollTo({top:60,behavior:"smooth"}),await Ao(),this.selectChatController=new Oo(this,this.websiteToken),await this._initializeChat(),this._resetChat(),this._makeNewRecommendation()}updated(){this._scrollDownObserver()}render(){if(!this.selectChatController)return;const{messages:e,isLoading:A,isResetLoading:g,isError:B}=this.selectChatController;if(A)return M`<athena-xai-select-chat-loader></athena-xai-select-chat-loader>`;if(B)return M`<athena-xai-select-chat-error></athena-xai-select-chat-error>`;const t=e.some(o=>o?.results?.length);return M`
|
|
1662
1662
|
<section class="athena-xai-select-chat__chat-outer-container">
|
|
1663
1663
|
<h1 class="athena-xai-select-chat__initial-heading">
|
|
1664
1664
|
${y.selectChatTranslations[this._lang].title}
|