@axos-web-dev/shared-components 2.0.0-dev.9-fixdependencies → 2.0.0-dev.enableCTA2
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.
- package/README.md +111 -111
- package/dist/ATMLocator/ATMLocator.d.ts +1 -1
- package/dist/ATMLocator/ATMLocator.js +16 -10
- package/dist/Accordion/Accordion.d.ts +3 -3
- package/dist/Article/Article.css.d.ts +8 -4
- package/dist/Article/Article.d.ts +1 -1
- package/dist/ArticlesSet/ArticlesSet.css.d.ts +23 -1
- package/dist/ArticlesSet/ArticlesSet.css.js +7 -7
- package/dist/ArticlesSet/ArticlesSet.js +3 -4
- package/dist/Auth/ErrorAlert.d.ts +1 -1
- package/dist/Auth/ErrorAlert.js +17 -11
- package/dist/Auth/Logout.d.ts +1 -1
- package/dist/Auth/SignInPassword.d.ts +1 -1
- package/dist/Auth/SignInPassword.js +1 -1
- package/dist/Avatar/Avatar.module.js +7 -7
- package/dist/AwardsItem/AwardsItem.js +2 -2
- package/dist/Blockquote/Blockquote.module.js +3 -3
- package/dist/BulletItem/BulletItem.d.ts +1 -1
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.js +37 -13
- package/dist/Button/GoBackButton.d.ts +1 -1
- package/dist/Calculators/AnnualFeeCalculator/index.js +1 -1
- package/dist/Calculators/ApyCalculator/ApyCalculator.css.d.ts +46 -5
- package/dist/Calculators/ApyCalculator/ApyCalculator.css.js +72 -19
- package/dist/Calculators/ApyCalculator/index.js +654 -291
- package/dist/Calculators/ApyCalculatorUserTest/ApyCalculatorUserTest.css.d.ts +95 -0
- package/dist/Calculators/ApyCalculatorUserTest/ApyCalculatorUserTest.css.js +101 -0
- package/dist/Calculators/ApyCalculatorUserTest/index.d.ts +12 -0
- package/dist/Calculators/ApyCalculatorUserTest/index.js +618 -0
- package/dist/Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js +3 -1
- package/dist/Calculators/Calculator.d.ts +1 -1
- package/dist/Calculators/Calculator.js +24 -8
- package/dist/Calculators/MarginTradingCalculator/index.js +18 -12
- package/dist/Calculators/MarineLoanMonthlyPaymentCalculator/index.js +1 -1
- package/dist/Calculators/MaxLoanCalculator/index.js +1 -1
- package/dist/Calculators/MonthlyPaymentCalculator/index.js +1 -1
- package/dist/Calculators/calculator.css.d.ts +21 -1
- package/dist/Calculators/calculator.css.js +3 -3
- package/dist/Calculators/index.d.ts +1 -0
- package/dist/Calculators/index.js +2 -0
- package/dist/Carousel/index.d.ts +3 -3
- package/dist/Carousel/index.js +17 -11
- package/dist/Chatbot/AnimatedGradientBorder.css.d.ts +3 -0
- package/dist/Chatbot/AnimatedGradientBorder.css.js +8 -2
- package/dist/Chatbot/AudioManager.d.ts +19 -0
- package/dist/Chatbot/AudioManager.js +61 -0
- package/dist/Chatbot/Bubble.css.js +2 -2
- package/dist/Chatbot/Bubble.d.ts +2 -2
- package/dist/Chatbot/Bubble.js +84 -103
- package/dist/Chatbot/Chat.d.ts +1 -1
- package/dist/Chatbot/Chat.js +17 -7
- package/dist/Chatbot/ChatWindow.css.d.ts +4 -0
- package/dist/Chatbot/ChatWindow.css.js +45 -37
- package/dist/Chatbot/ChatWindow.d.ts +1 -0
- package/dist/Chatbot/ChatWindow.js +460 -370
- package/dist/Chatbot/Chatbot.css.js +0 -1
- package/dist/Chatbot/Chatbot.css.ts.vanilla.css.js +1 -0
- package/dist/Chatbot/Chatbot.d.ts +13 -2
- package/dist/Chatbot/Chatbot.js +207 -85
- package/dist/Chatbot/ChatbotMessage.d.ts +1 -0
- package/dist/Chatbot/ChatbotMessage.js +184 -197
- package/dist/Chatbot/EllipsisAnimation.d.ts +1 -1
- package/dist/Chatbot/EllipsisAnimation.js +0 -6
- package/dist/Chatbot/EllipsisIcon.d.ts +1 -1
- package/dist/Chatbot/ExpandChatToggle.d.ts +8 -0
- package/dist/Chatbot/ExpandChatToggle.js +74 -0
- package/dist/Chatbot/index.js +7 -2
- package/dist/Chatbot/store/chat.d.ts +8 -0
- package/dist/Chatbot/store/chat.js +14 -2
- package/dist/Chatbot/store/messages.d.ts +6 -1
- package/dist/Chatbot/store/messages.js +62 -3
- package/dist/Chatbot/useHeadlessChat.js +1 -2
- package/dist/Chevron/Chevron.interface.d.ts +1 -0
- package/dist/Chevron/index.js +23 -13
- package/dist/Comparison/Comparison.css.d.ts +1 -0
- package/dist/Comparison/Comparison.css.js +16 -16
- package/dist/Comparison/Comparison.d.ts +1 -1
- package/dist/Comparison/Comparison.js +16 -10
- package/dist/Comparison/ComparisonSet.d.ts +1 -1
- package/dist/Comparison/ComparisonSet.js +2 -1
- package/dist/Comparison/index.js +2 -1
- package/dist/ExecutiveBio/ExecutiveBio.css.d.ts +27 -0
- package/dist/ExecutiveBio/ExecutiveBio.d.ts +1 -1
- package/dist/ExecutiveBio/ExecutiveBio.js +290 -270
- package/dist/ExecutiveBio/ExecutiveBioSet.d.ts +1 -1
- package/dist/ExecutiveBio/Overlay.d.ts +1 -1
- package/dist/FaqAccordion/index.d.ts +5 -5
- package/dist/FaqAccordion/index.js +18 -12
- package/dist/FdicCallout/FdicCallout.module.js +2 -2
- package/dist/FdicCallout/index.d.ts +1 -1
- package/dist/FdicCallout/index.js +2 -1
- package/dist/FooterDisclosure/FooterDisclosure.d.ts +4 -4
- package/dist/FooterDisclosure/FooterDisclosure.js +1 -0
- package/dist/FooterDisclosure/LVF/LaVictorieFooter.d.ts +1 -1
- package/dist/FooterSiteMap/AxosBank/FooterSiteMap.d.ts +1 -1
- package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +688 -649
- package/dist/Forms/ApplicationStart.d.ts +1 -1
- package/dist/Forms/ApplicationStart.js +2 -1
- package/dist/Forms/ApplyNow.d.ts +1 -1
- package/dist/Forms/ApplyNow.js +17 -11
- package/dist/Forms/BoatMooringLocation.d.ts +5 -2
- package/dist/Forms/BoatMooringLocation.js +136 -54
- package/dist/Forms/ClearingForm.d.ts +1 -1
- package/dist/Forms/ClearingForm.js +2 -1
- package/dist/Forms/CommercialDeposits.d.ts +1 -1
- package/dist/Forms/CommercialDeposits.js +2 -1
- package/dist/Forms/CommercialDepositsACS.d.ts +3 -0
- package/dist/Forms/CommercialDepositsACS.js +279 -0
- package/dist/Forms/CommercialDepositsNoLendingOption.d.ts +1 -1
- package/dist/Forms/CommercialDepositsNoLendingOption.js +2 -1
- package/dist/Forms/CommercialLending.d.ts +1 -1
- package/dist/Forms/CommercialLending.js +2 -1
- package/dist/Forms/CommercialPremiumFinance.d.ts +1 -1
- package/dist/Forms/CommercialPremiumFinance.js +2 -1
- package/dist/Forms/CommercialTrustAndEstate.d.ts +15 -0
- package/dist/Forms/CommercialTrustAndEstate.js +238 -0
- package/dist/Forms/ConstructionLendingDynamic.d.ts +1 -1
- package/dist/Forms/ConstructionLendingDynamic.js +2 -1
- package/dist/Forms/ContactCompany.d.ts +1 -1
- package/dist/Forms/ContactCompany.js +2 -1
- package/dist/Forms/ContactCompanyTitle.d.ts +1 -1
- package/dist/Forms/ContactCompanyTitle.js +2 -1
- package/dist/Forms/ContactUs.d.ts +1 -1
- package/dist/Forms/ContactUs.js +2 -1
- package/dist/Forms/ContactUsAAS.d.ts +1 -1
- package/dist/Forms/ContactUsAAS.js +2 -1
- package/dist/Forms/ContactUsBusiness.d.ts +1 -1
- package/dist/Forms/ContactUsBusiness.js +20 -14
- package/dist/Forms/ContactUsBusinessNameEmail.d.ts +1 -1
- package/dist/Forms/ContactUsBusinessNameEmail.js +20 -14
- package/dist/Forms/ContactUsLVF.d.ts +1 -1
- package/dist/Forms/ContactUsLVF.js +2 -1
- package/dist/Forms/ContactUsNMLSId.d.ts +1 -1
- package/dist/Forms/ContactUsNMLSId.js +20 -14
- package/dist/Forms/ContactUsSchwabAAS.d.ts +11 -0
- package/dist/Forms/ContactUsSchwabAAS.js +264 -0
- package/dist/Forms/CpraRequest.d.ts +1 -1
- package/dist/Forms/CpraRequest.js +19 -13
- package/dist/Forms/CraPublicFile.d.ts +1 -1
- package/dist/Forms/CraPublicFile.js +20 -14
- package/dist/Forms/DealerServices.d.ts +1 -1
- package/dist/Forms/DealerServices.js +2 -1
- package/dist/Forms/EmailOnly.d.ts +1 -1
- package/dist/Forms/EmailOnly.js +21 -15
- package/dist/Forms/EmailUs.d.ts +1 -1
- package/dist/Forms/EmailUs.js +2 -1
- package/dist/Forms/FormEnums.d.ts +16 -0
- package/dist/Forms/FormEnums.js +29 -2
- package/dist/Forms/Forms.css.d.ts +4 -0
- package/dist/Forms/Forms.css.js +3 -1
- package/dist/Forms/HoneyPot/honeyPotValidation.d.ts +27 -0
- package/dist/Forms/HoneyPot/honeyPotValidation.js +17 -0
- package/dist/Forms/HoneyPot/index.d.ts +2 -17
- package/dist/Forms/HoneyPot/index.js +2 -8
- package/dist/Forms/MortgageRate/MortgageRateForm.d.ts +1 -1
- package/dist/Forms/MortgageRate/MortgageRateForm.js +43 -19
- package/dist/Forms/MortgageRate/MortgageRateQuoteFilters.d.ts +1 -1
- package/dist/Forms/MortgageRate/MortgageRateQuoteFilters.js +33 -11
- package/dist/Forms/MortgageRate/MortgageRateWatch.d.ts +2 -2
- package/dist/Forms/MortgageRate/MortgageRateWatch.js +107 -28
- package/dist/Forms/MortgageWarehouseLending.d.ts +2 -2
- package/dist/Forms/MortgageWarehouseLending.js +27 -21
- package/dist/Forms/NonQMLoans.d.ts +16 -0
- package/dist/Forms/NonQMLoans.js +471 -0
- package/dist/Forms/QuickPricer/QuickPricerForm.d.ts +1 -1
- package/dist/Forms/QuickPricer/QuickPricerForm.js +2 -1
- package/dist/Forms/QuickPricer/UserInformation.d.ts +1 -1
- package/dist/Forms/ScheduleCall.d.ts +1 -1
- package/dist/Forms/ScheduleCall.js +2 -1
- package/dist/Forms/ScheduleCallPremier.d.ts +1 -1
- package/dist/Forms/ScheduleCallPremier.js +2 -1
- package/dist/Forms/SuccesForm.d.ts +1 -1
- package/dist/Forms/SuccesForm.js +18 -12
- package/dist/Forms/VendorQuestionnaire.d.ts +1 -1
- package/dist/Forms/VendorQuestionnaire.js +2 -1
- package/dist/Forms/WcplSurvey.d.ts +1 -1
- package/dist/Forms/WcplSurvey.js +2 -1
- package/dist/Forms/index.d.ts +4 -0
- package/dist/Forms/index.js +13 -2
- package/dist/HeroBanner/HeroBanner.d.ts +1 -1
- package/dist/HeroBanner/HeroBanner.interface.d.ts +2 -0
- package/dist/HeroBanner/HeroBanner.js +33 -28
- package/dist/HeroBanner/HeroVideoPoster.d.ts +1 -1
- package/dist/HeroBanner/LargeHeroBanner.d.ts +1 -1
- package/dist/Hyperlink/index.js +18 -12
- package/dist/IconBillboard/IconBillboard.css.d.ts +16 -0
- package/dist/IconBillboard/IconBillboard.css.js +7 -4
- package/dist/IconBillboard/IconBillboard.d.ts +1 -1
- package/dist/IconBillboard/IconBillboard.interface.d.ts +2 -0
- package/dist/IconBillboard/IconBillboardSet.d.ts +1 -1
- package/dist/IconBillboard/IconBillboardSet.js +68 -62
- package/dist/IconBillboard/index.js +2 -1
- package/dist/IconBillboard/sections/CallToActionSection.d.ts +1 -1
- package/dist/IconBillboard/sections/CallToActionSection.js +3 -1
- package/dist/IconBillboard/sections/HeaderSection.d.ts +2 -2
- package/dist/IconBillboard/sections/IconSection.d.ts +1 -1
- package/dist/IconBillboard/sections/ItemsSection.d.ts +1 -1
- package/dist/IconBillboard/sections/LayoutSection.d.ts +1 -1
- package/dist/ImageBillboard/ExitIntentModal/ModalWrapper.d.ts +1 -1
- package/dist/ImageBillboard/ImageBillboard.d.ts +1 -1
- package/dist/ImageBillboard/ImageBillboard.interface.d.ts +2 -0
- package/dist/ImageBillboard/ImageBillboardSet.d.ts +1 -1
- package/dist/ImageBillboard/ImageBillboardSet.js +28 -20
- package/dist/ImageLink/ImageLink.d.ts +1 -1
- package/dist/ImageLink/ImageLink.js +13 -7
- package/dist/ImageLink/ImageLinkSet.d.ts +1 -1
- package/dist/ImageLink/ImageLinkSet.js +12 -6
- package/dist/ImageLink/index.js +17 -11
- package/dist/ImageToast/ImageToast.css.d.ts +5 -0
- package/dist/ImageToast/ImageToast.css.js +13 -0
- package/dist/ImageToast/index.d.ts +9 -0
- package/dist/{NavigationMenu/Navbar.js → ImageToast/index.js} +90 -100
- package/dist/ImageWrapper/ImageWrapper.d.ts +1 -1
- package/dist/Input/DownPaymentInput.js +1 -0
- package/dist/Insight/Featured/CategorySelector.d.ts +3 -3
- package/dist/Insight/Featured/CategorySelector.js +20 -13
- package/dist/Insight/Featured/Featured.d.ts +2 -2
- package/dist/Insight/Featured/Featured.js +17 -11
- package/dist/Insight/Featured/Header.d.ts +2 -3
- package/dist/Insight/Featured/Header.js +17 -11
- package/dist/Interstitial/Interstitial.module.js +10 -10
- package/dist/LandingPageHeader/LandingPageHeader.css.d.ts +5 -0
- package/dist/LandingPageHeader/LandingPageHeader.css.js +10 -0
- package/dist/LandingPageHeader/LandingPageHeader.d.ts +2 -1
- package/dist/LandingPageHeader/LandingPageHeader.js +36 -21
- package/dist/LandingPageHeader/WithLogin.d.ts +4 -0
- package/dist/LandingPageHeader/WithLogin.js +463 -0
- package/dist/LandingPageHeader/index.js +6 -1
- package/dist/LoadingIndicator/index.d.ts +1 -1
- package/dist/MainHTML/index.d.ts +1 -1
- package/dist/Modal/Modal.js +19 -13
- package/dist/Modal/contextApi/store.d.ts +6 -1
- package/dist/Modal/contextApi/store.js +112 -6
- package/dist/NavigationMenu/AxosALTS/NavBar.module.js +23 -23
- package/dist/NavigationMenu/AxosALTS/index.d.ts +1 -1
- package/dist/NavigationMenu/AxosALTS/index.js +51 -31
- package/dist/NavigationMenu/AxosAdvisor/NavBar.module.js +52 -52
- package/dist/NavigationMenu/AxosAdvisor/SubNavBar.d.ts +1 -1
- package/dist/NavigationMenu/AxosAdvisor/index.d.ts +1 -1
- package/dist/NavigationMenu/AxosAdvisor/index.js +1 -1
- package/dist/NavigationMenu/AxosAdvisorServices/NavBar.module.js +53 -53
- package/dist/NavigationMenu/AxosAdvisorServices/SubNavBar.d.ts +1 -1
- package/dist/NavigationMenu/AxosAdvisorServices/index.d.ts +1 -1
- package/dist/NavigationMenu/AxosAdvisorServices/index.js +31 -24
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.d.ts +1 -1
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +15 -9
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.module.js +27 -27
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.d.ts +15 -16
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +36 -43
- package/dist/NavigationMenu/AxosBank/NavBar.module.js +39 -39
- package/dist/NavigationMenu/AxosBank/SubNavBar.d.ts +1 -1
- package/dist/NavigationMenu/AxosBank/SubNavBar.js +111 -154
- package/dist/NavigationMenu/AxosBank/index.d.ts +1 -1
- package/dist/NavigationMenu/AxosBank/index.js +87 -57
- package/dist/NavigationMenu/AxosClearing/NavBar.module.js +37 -37
- package/dist/NavigationMenu/AxosClearing/SubNavBar.d.ts +1 -1
- package/dist/NavigationMenu/AxosClearing/SubNavBar.js +6 -6
- package/dist/NavigationMenu/AxosClearing/index.d.ts +1 -1
- package/dist/NavigationMenu/AxosClearing/index.js +31 -16
- package/dist/NavigationMenu/AxosFiduciary/NavBar.module.js +40 -43
- package/dist/NavigationMenu/AxosFiduciary/index.d.ts +1 -1
- package/dist/NavigationMenu/AxosFiduciary/index.js +5 -3
- package/dist/NavigationMenu/LaVictoire/NavBar.module.js +37 -37
- package/dist/NavigationMenu/LaVictoire/SubNavBar.d.ts +1 -1
- package/dist/NavigationMenu/LaVictoire/index.d.ts +1 -1
- package/dist/NavigationMenu/LaVictoire/index.js +19 -13
- package/dist/NavigationMenu/NavItem/index.d.ts +1 -1
- package/dist/NavigationMenu/NavItem/index.js +142 -1
- package/dist/NavigationMenu/ServerNavigation/DropwdownButton.d.ts +8 -0
- package/dist/NavigationMenu/ServerNavigation/DropwdownButton.js +249 -0
- package/dist/NavigationMenu/ServerNavigation/Menu.d.ts +40 -0
- package/dist/NavigationMenu/ServerNavigation/Menu.js +269 -0
- package/dist/NavigationMenu/ServerNavigation/MobileMenu/MobileMenu.d.ts +13 -0
- package/dist/NavigationMenu/ServerNavigation/MobileMenu/MobileMenu.js +638 -0
- package/dist/NavigationMenu/ServerNavigation/MobileMenu/MobileMenu.module.js +86 -0
- package/dist/NavigationMenu/ServerNavigation/MobileMenu/MobileNavData.d.ts +51 -0
- package/dist/NavigationMenu/ServerNavigation/MobileMenu/MobileNavData.js +96 -0
- package/dist/NavigationMenu/ServerNavigation/MobileMenu/mobileReducer.d.ts +36 -0
- package/dist/NavigationMenu/ServerNavigation/MobileMenu/mobileReducer.js +105 -0
- package/dist/NavigationMenu/ServerNavigation/NavBar.module.js +125 -0
- package/dist/NavigationMenu/ServerNavigation/NavigationBar.css.d.ts +7 -0
- package/dist/NavigationMenu/ServerNavigation/NavigationBar.css.js +22 -0
- package/dist/NavigationMenu/ServerNavigation/SubNavBar.d.ts +6 -0
- package/dist/NavigationMenu/ServerNavigation/SubNavBar.js +282 -0
- package/dist/NavigationMenu/ServerNavigation/SubNavItem.d.ts +1 -0
- package/dist/NavigationMenu/ServerNavigation/SubNavItem.js +318 -0
- package/dist/NavigationMenu/ServerNavigation/SubNavbar.css.d.ts +60 -0
- package/dist/NavigationMenu/ServerNavigation/SubNavbar.css.js +22 -0
- package/dist/NavigationMenu/ServerNavigation/index.d.ts +7 -0
- package/dist/NavigationMenu/ServerNavigation/index.js +298 -0
- package/dist/NavigationMenu/index.d.ts +2 -0
- package/dist/NavigationMenu/index.js +19 -10
- package/dist/NavigationMenu/utils.d.ts +480 -0
- package/dist/NavigationMenu/utils.js +128 -0
- package/dist/PageNavSet/PageNavSet.js +16 -8
- package/dist/Pagination/Pagination.d.ts +1 -1
- package/dist/SecondaryFooter/index.d.ts +1 -1
- package/dist/SecondaryFooter/index.js +8 -1
- package/dist/SetContainer/SetContainer.css.d.ts +4 -0
- package/dist/SetContainer/SetContainer.css.js +5 -3
- package/dist/SetContainer/SetContainer.d.ts +1 -1
- package/dist/SetContainer/SetContainer.js +21 -9
- package/dist/SetContainer/index.js +2 -1
- package/dist/SocialMediaBar/iconsRepository.d.ts +14 -14
- package/dist/SocialMediaBar/iconsRepository.js +17 -11
- package/dist/SocialMediaBar/index.d.ts +1 -1
- package/dist/SocialMediaBar/index.js +1 -1
- package/dist/StepItemSet/StepItemSet.css.d.ts +3 -0
- package/dist/Tab/Tab.d.ts +1 -1
- package/dist/Tab/TabContainer.d.ts +1 -1
- package/dist/Table/Table.css.d.ts +17 -1
- package/dist/Table/Table.css.js +26 -19
- package/dist/Table/Table.d.ts +5 -5
- package/dist/Table/Table.interface.d.ts +5 -8
- package/dist/Table/Table.js +30 -38
- package/dist/Table/index.js +3 -1
- package/dist/TextBlock/TextBlock.d.ts +1 -1
- package/dist/Topic/Topic.d.ts +4 -4
- package/dist/TopicalNavItem/TopicalNavItem.css.d.ts +0 -1
- package/dist/TopicalNavItem/TopicalNavItem.css.js +2 -4
- package/dist/TopicalNavItem/TopicalNavItem.js +11 -33
- package/dist/TopicalNavItem/index.js +1 -2
- package/dist/TopicalNavSet/TopicalNavSet.js +17 -9
- package/dist/VideoTile/VideoInit.d.ts +1 -1
- package/dist/VideoTile/VideoTile.js +16 -10
- package/dist/VideoWrapper/index.js +17 -11
- package/dist/WalnutIframe/index.d.ts +1 -1
- package/dist/WalnutIframe/wrapper.module.js +3 -3
- package/dist/assets/Article/Article.css +8 -4
- package/dist/assets/ArticlesSet/ArticlesSet.css +54 -39
- package/dist/assets/Auth/SignIn.css +2 -1
- package/dist/assets/Avatar/Avatar.css +59 -59
- package/dist/assets/Blockquote/Blockquote.css +72 -72
- package/dist/assets/Calculators/ApyCalculator/ApyCalculator.css +350 -64
- package/dist/assets/Calculators/ApyCalculatorUserTest/ApyCalculatorUserTest.css +424 -0
- package/dist/assets/Calculators/AxosOneCalculator/BalanceAPYCalculator.css +2 -2
- package/dist/assets/Calculators/calculator.css +25 -15
- package/dist/assets/CallToActionBar/CallToActionBar.css +2 -0
- package/dist/assets/Chatbot/AnimatedGradientBorder.css +39 -8
- package/dist/assets/Chatbot/Bubble.css +8 -2
- package/dist/assets/Chatbot/ChatWindow.css +166 -99
- package/dist/assets/Comparison/Comparison.css +32 -29
- package/dist/assets/DownloadTile/DownloadTile.css +3 -1
- package/dist/assets/ExecutiveBio/ExecutiveBio.css +55 -17
- package/dist/assets/FaqAccordion/FaqAccordion.css +1 -1
- package/dist/assets/FdicCallout/FdicCallout.css +48 -48
- package/dist/assets/FooterSiteMap/AxosBank/FooterSiteMap.css +2 -2
- package/dist/assets/Forms/Forms.css +9 -3
- package/dist/assets/HeroBanner/HeroBanner.css +1 -0
- package/dist/assets/IconBillboard/IconBillboard.css +64 -13
- package/dist/assets/ImageBillboard/ImageBillboard.css +1 -1
- package/dist/assets/ImageToast/ImageToast.css +39 -0
- package/dist/assets/Insight/Featured/Header.css +4 -2
- package/dist/assets/Interstitial/Interstitial.css +142 -142
- package/dist/assets/LandingPageHeader/LandingPageHeader.css +68 -0
- package/dist/assets/NavigationMenu/AxosALTS/NavBar.css +265 -264
- package/dist/assets/NavigationMenu/AxosAdvisor/NavBar.css +116 -116
- package/dist/assets/NavigationMenu/AxosAdvisorServices/NavBar.css +631 -630
- package/dist/assets/NavigationMenu/AxosBank/MobileMenu/MobileMenu.css +353 -353
- package/dist/assets/NavigationMenu/AxosBank/NavBar.css +445 -445
- package/dist/assets/NavigationMenu/AxosClearing/NavBar.css +485 -484
- package/dist/assets/NavigationMenu/AxosFiduciary/NavBar.css +428 -427
- package/dist/assets/NavigationMenu/LaVictoire/NavBar.css +429 -429
- package/dist/assets/NavigationMenu/ServerNavigation/MobileMenu/MobileMenu.css +353 -0
- package/dist/assets/NavigationMenu/ServerNavigation/NavBar.css +483 -0
- package/dist/assets/NavigationMenu/ServerNavigation/NavigationBar.css +40 -0
- package/dist/assets/NavigationMenu/ServerNavigation/SubNavbar.css +87 -0
- package/dist/assets/SetContainer/SetContainer.css +27 -20
- package/dist/assets/SocialMediaBar/SocialMediaBar.css +1 -0
- package/dist/assets/StepItemSet/StepItemSet.css +3 -3
- package/dist/assets/Table/Table.css +112 -78
- package/dist/assets/TextBlock/TextBlock.css +6 -0
- package/dist/assets/TopicalNavItem/TopicalNavItem.css +25 -52
- package/dist/assets/TopicalNavSet/TopicalNavSet.css +28 -6
- package/dist/assets/VideoTile/VideoTile.css +3 -0
- package/dist/assets/WalnutIframe/wrapper.css +48 -48
- package/dist/assets/globals.css +36 -4
- package/dist/assets/themes/axos.css +8 -7
- package/dist/assets/themes/premier.css +9 -8
- package/dist/assets/themes/ufb.css +9 -8
- package/dist/assets/themes/victorie.css +9 -8
- package/dist/assets/utils/optimizeImage/optimizeImage.css +47 -47
- package/dist/globals.css.js +8 -1
- package/dist/icons/AxosX/Blue.d.ts +1 -1
- package/dist/icons/AxosX/index.d.ts +1 -1
- package/dist/icons/CheckCircle.d.ts +1 -1
- package/dist/icons/CheckCircleLight.d.ts +1 -1
- package/dist/icons/CheckIcon/index.d.ts +1 -1
- package/dist/icons/ChevronDown.d.ts +1 -1
- package/dist/icons/ChevronUp.d.ts +1 -1
- package/dist/icons/Clock/index.d.ts +1 -1
- package/dist/icons/EqualHousingLender.d.ts +1 -1
- package/dist/icons/Logos/AAS.d.ts +1 -1
- package/dist/icons/Logos/AFS.d.ts +1 -1
- package/dist/icons/Logos/AXA.d.ts +1 -1
- package/dist/icons/Logos/AXB.d.ts +1 -1
- package/dist/icons/Logos/AXC.d.ts +1 -1
- package/dist/icons/Logos/AXI.d.ts +1 -1
- package/dist/icons/Logos/AXOS.d.ts +1 -1
- package/dist/icons/Logos/GBLVF.d.ts +1 -1
- package/dist/icons/Logos/LVF.d.ts +1 -1
- package/dist/icons/Logos/LVFText.d.ts +1 -1
- package/dist/icons/Logos/SPB.d.ts +1 -1
- package/dist/icons/MemberFdicLogo.d.ts +1 -1
- package/dist/icons/QuoteIconGrey.d.ts +1 -1
- package/dist/icons/QuoteIconGrey.js +1 -0
- package/dist/icons/QuoteIconWhite.d.ts +1 -1
- package/dist/icons/QuoteIconWhite.js +1 -0
- package/dist/icons/QuoteIconYellow.d.ts +1 -1
- package/dist/icons/QuoteIconYellow.js +1 -0
- package/dist/index.css.js +8 -1
- package/dist/main.js +60 -22
- package/dist/themes/axos.css.d.ts +1 -0
- package/dist/themes/axos.css.js +1 -1
- package/dist/utilities.d.ts +3 -0
- package/dist/utilities.js +12 -0
- package/dist/utils/allowedAxosDomains.js +9 -15
- package/dist/utils/appendQueryParams.d.ts +3 -1
- package/dist/utils/appendQueryParams.js +66 -66
- package/dist/utils/index.js +3 -1
- package/dist/utils/insightsData.d.ts +23 -0
- package/dist/utils/insightsData.js +41 -0
- package/dist/utils/optimizeImage/optimizeImage.module.js +3 -3
- package/dist/utils/tealiumOrganicFallback.d.ts +21 -0
- package/dist/utils/tealiumOrganicFallback.js +26 -0
- package/dist/utils/useVisibility.d.ts +1 -0
- package/dist/utils/useVisibility.js +21 -0
- package/dist/vite-env.d.js +1 -0
- package/package.json +18 -13
- package/dist/Chatbot/authenticate.d.ts +0 -3
- package/dist/Chatbot/authenticate.js +0 -16
- package/dist/NavigationMenu/Navbar.d.ts +0 -5
- package/dist/NavigationMenu/SignInNavButton.d.ts +0 -1
- package/dist/NavigationMenu/SignInNavButton.js +0 -363
- package/dist/assets/Chatbot/Chatbot.css +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
+
import { default as AudioManager } from './AudioManager';
|
|
2
|
+
|
|
3
|
+
export declare const audioManager: AudioManager;
|
|
1
4
|
export type ChatbotProps = {
|
|
2
5
|
project?: "axos" | "ufb";
|
|
3
6
|
debug?: boolean;
|
|
4
7
|
};
|
|
5
|
-
|
|
8
|
+
type InitalizeChatbot = {
|
|
9
|
+
companyId: string;
|
|
10
|
+
tenantName: string;
|
|
11
|
+
host: string;
|
|
12
|
+
authUrl: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const Chatbot: ({ project, projectEnv, menuOption, config, }: {
|
|
6
15
|
project?: "axos" | "ufb" | "Axos" | "Ufb";
|
|
7
16
|
projectEnv?: "dev" | "qa" | "uat" | "stg" | "prod";
|
|
8
17
|
menuOption?: "Support Virtual Agent" | string;
|
|
9
18
|
debug?: boolean;
|
|
10
|
-
|
|
19
|
+
config: InitalizeChatbot;
|
|
20
|
+
}) => false | import("react").JSX.Element;
|
|
21
|
+
export {};
|
package/dist/Chatbot/Chatbot.js
CHANGED
|
@@ -1,33 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { usePageVisibility } from "../utils/useVisibility.js";
|
|
3
4
|
import { useRef, useState, useEffect } from "react";
|
|
4
5
|
import { useMount, useUnmount } from "react-use";
|
|
5
6
|
import notificationSound from "../assets/notification.mp3.js";
|
|
6
|
-
import
|
|
7
|
+
import AudioManager from "./AudioManager.js";
|
|
7
8
|
import { Bubble } from "./Bubble.js";
|
|
8
9
|
import { chatbotAXB, chatbotUFB } from "./Chatbot.css.js";
|
|
9
10
|
import { ChatWindow } from "./ChatWindow.js";
|
|
10
11
|
import { useOpenChat } from "./store/chat.js";
|
|
11
12
|
import { useMessages } from "./store/messages.js";
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
constructor(src) {
|
|
18
|
-
const newSrc = src === "https://websdk.ujet.co/v3/ping.mp3" ? notificationSound : src;
|
|
19
|
-
super(newSrc);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
window.Audio = PatchedAudio;
|
|
13
|
+
const audioManager = new AudioManager();
|
|
14
|
+
audioManager.installUjetAudioOverride(notificationSound);
|
|
15
|
+
audioManager.setSoundEnabled(false);
|
|
16
|
+
function isChat(obj) {
|
|
17
|
+
return obj !== null && typeof obj === "object" && "id" in obj && "agent" in obj && typeof obj.connect === "function";
|
|
23
18
|
}
|
|
24
19
|
const Chatbot = ({
|
|
25
20
|
project = "axos",
|
|
26
21
|
projectEnv = "dev",
|
|
27
22
|
menuOption = "Support Virtual Agent",
|
|
28
|
-
|
|
23
|
+
config
|
|
29
24
|
}) => {
|
|
30
25
|
const {
|
|
26
|
+
isOpen,
|
|
31
27
|
hasOpenedOnce,
|
|
32
28
|
toggle,
|
|
33
29
|
reset,
|
|
@@ -35,21 +31,43 @@ const Chatbot = ({
|
|
|
35
31
|
hasEscalated,
|
|
36
32
|
endEscalation,
|
|
37
33
|
unblockInput,
|
|
38
|
-
blockInput
|
|
34
|
+
blockInput,
|
|
35
|
+
hasStarted,
|
|
36
|
+
setChatStarted,
|
|
37
|
+
resetChatStarted,
|
|
38
|
+
setChatStatus,
|
|
39
|
+
displayThankyouMessage,
|
|
40
|
+
hideDisplayThankyouMessage
|
|
39
41
|
} = useOpenChat();
|
|
40
|
-
const
|
|
42
|
+
const isVisible = usePageVisibility();
|
|
43
|
+
const {
|
|
44
|
+
addMessage,
|
|
45
|
+
addMessages,
|
|
46
|
+
clearMessages,
|
|
47
|
+
messages,
|
|
48
|
+
addPendingMessage,
|
|
49
|
+
resolvePendingMessage
|
|
50
|
+
} = useMessages();
|
|
41
51
|
const clientRef = useRef(null);
|
|
42
52
|
const menuRef = useRef(null);
|
|
43
53
|
const isMountedRef = useRef(false);
|
|
44
|
-
const hasLoadedBefore = useRef(true);
|
|
45
54
|
const chatRef = useRef(null);
|
|
55
|
+
const chatLoading = useRef(false);
|
|
46
56
|
const agent_virtual = useRef(null);
|
|
57
|
+
const messageQueueRef = useRef([]);
|
|
58
|
+
const sendInFlightRef = useRef(false);
|
|
59
|
+
const flushingRef = useRef(false);
|
|
60
|
+
const statusRef = useRef("idle");
|
|
47
61
|
const [status, setStatus] = useState("idle");
|
|
48
|
-
const [hasStarted, setHasStarted] = useState(false);
|
|
49
62
|
const [menusLoaded, setMenusLoaded] = useState(false);
|
|
50
|
-
const [pendingStart, setPendingStart] = useState(false);
|
|
51
63
|
const [isTyping, setIsTyping] = useState(false);
|
|
52
64
|
const [scalationStarted, setScalationStarted] = useState(false);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
statusRef.current = status;
|
|
67
|
+
if (status === "connected") {
|
|
68
|
+
flushQueuedMessages();
|
|
69
|
+
}
|
|
70
|
+
}, [status]);
|
|
53
71
|
useEffect(() => {
|
|
54
72
|
if (messages.length === 0) return;
|
|
55
73
|
const hasScalation = messages.some(
|
|
@@ -66,6 +84,9 @@ const Chatbot = ({
|
|
|
66
84
|
["axos", 1],
|
|
67
85
|
["ufb", 3]
|
|
68
86
|
]);
|
|
87
|
+
const hasRealReply = () => useMessages.getState().messages.some(
|
|
88
|
+
(m) => !m.pending && m.$userType !== "end_user" && m.type !== "noti" && m.$sid !== "typing-1"
|
|
89
|
+
);
|
|
69
90
|
const typingMessage = {
|
|
70
91
|
$sid: "typing-1",
|
|
71
92
|
type: "system",
|
|
@@ -76,7 +97,7 @@ const Chatbot = ({
|
|
|
76
97
|
$index: -10,
|
|
77
98
|
$userId: 0
|
|
78
99
|
};
|
|
79
|
-
const custom_data = {
|
|
100
|
+
const custom_data = () => ({
|
|
80
101
|
unsigned: {
|
|
81
102
|
facingBrandId: {
|
|
82
103
|
label: "facingBrandId",
|
|
@@ -93,15 +114,22 @@ const Chatbot = ({
|
|
|
93
114
|
env: {
|
|
94
115
|
label: "env",
|
|
95
116
|
value: projectEnv === "uat" ? "dev" : projectEnv
|
|
117
|
+
},
|
|
118
|
+
url: {
|
|
119
|
+
label: "url",
|
|
120
|
+
value: window.location.href
|
|
96
121
|
}
|
|
97
122
|
}
|
|
98
|
-
};
|
|
123
|
+
});
|
|
99
124
|
const onReadyHandler = async () => {
|
|
100
125
|
console.log("Chat client is ready");
|
|
101
126
|
if (clientRef.current) {
|
|
102
127
|
menuRef.current = await clientRef.current.getMenus();
|
|
103
128
|
setMenusLoaded(true);
|
|
104
129
|
console.log("menus:", menuRef.current);
|
|
130
|
+
if (menuRef.current !== null && useOpenChat.getState().isOpen) {
|
|
131
|
+
await startChat("onReady");
|
|
132
|
+
}
|
|
105
133
|
}
|
|
106
134
|
};
|
|
107
135
|
const onAuthenticatedHandler = async () => {
|
|
@@ -113,10 +141,11 @@ const Chatbot = ({
|
|
|
113
141
|
const onChatMessageHandler = async (message) => {
|
|
114
142
|
console.log("Received message:", message);
|
|
115
143
|
const { event, $userType } = message;
|
|
116
|
-
if (["
|
|
144
|
+
if (["virtual_agent", "user"].includes($userType) && event === void 0) {
|
|
117
145
|
addMessage(message);
|
|
118
146
|
if (!hasEscalated) {
|
|
119
147
|
unblockInput?.();
|
|
148
|
+
flushQueuedMessages();
|
|
120
149
|
}
|
|
121
150
|
return;
|
|
122
151
|
}
|
|
@@ -197,6 +226,7 @@ const Chatbot = ({
|
|
|
197
226
|
startEscalation?.();
|
|
198
227
|
}
|
|
199
228
|
}
|
|
229
|
+
flushQueuedMessages();
|
|
200
230
|
} catch (error) {
|
|
201
231
|
console.error("Error fetching messages on chat connected:", error);
|
|
202
232
|
}
|
|
@@ -218,7 +248,7 @@ const Chatbot = ({
|
|
|
218
248
|
const deregisterEventHandlers = () => {
|
|
219
249
|
clientRef.current?.off("ready", onReadyHandler);
|
|
220
250
|
clientRef.current?.off("authenticated", onAuthenticatedHandler);
|
|
221
|
-
clientRef.current?.off("chat.ongoing",
|
|
251
|
+
clientRef.current?.off("chat.ongoing", onChatOngoingHandler);
|
|
222
252
|
clientRef.current?.off("chat.message", onChatMessageHandler);
|
|
223
253
|
clientRef.current?.off("chat.typingStarted", onChatTypingStartedHandler);
|
|
224
254
|
clientRef.current?.off("chat.typingEnded", onChatTypingEndedHandler);
|
|
@@ -232,16 +262,24 @@ const Chatbot = ({
|
|
|
232
262
|
clientRef.current?.off("chat.connected", onChatConnectedHandler);
|
|
233
263
|
};
|
|
234
264
|
const createClient = async () => {
|
|
235
|
-
const { Client
|
|
236
|
-
if (projectEnv !== "prod" || debug) {
|
|
237
|
-
Logger.addHandler(consoleLoggerHandler);
|
|
238
|
-
}
|
|
265
|
+
const { Client } = await import("@ujet/websdk-headless");
|
|
239
266
|
if (clientRef.current) return;
|
|
240
267
|
const client = new Client({
|
|
241
|
-
companyId:
|
|
242
|
-
tenant:
|
|
243
|
-
host:
|
|
244
|
-
authenticate
|
|
268
|
+
companyId: config.companyId,
|
|
269
|
+
tenant: config.tenantName,
|
|
270
|
+
host: config.host,
|
|
271
|
+
authenticate: async () => {
|
|
272
|
+
const res = await fetch(config.authUrl, {
|
|
273
|
+
method: "GET",
|
|
274
|
+
headers: {
|
|
275
|
+
"Content-Type": "application/json"
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
const data = await res.json();
|
|
279
|
+
return {
|
|
280
|
+
token: data.token
|
|
281
|
+
};
|
|
282
|
+
}
|
|
245
283
|
});
|
|
246
284
|
client?.on("ready", onReadyHandler);
|
|
247
285
|
client?.on("authenticated", onAuthenticatedHandler);
|
|
@@ -250,37 +288,60 @@ const Chatbot = ({
|
|
|
250
288
|
registerEventHandlers();
|
|
251
289
|
return;
|
|
252
290
|
};
|
|
253
|
-
const startChat = async () => {
|
|
254
|
-
console.log("Starting chat");
|
|
291
|
+
const startChat = async (source) => {
|
|
255
292
|
const client = clientRef.current;
|
|
256
|
-
if (!client)
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
293
|
+
if (!client) {
|
|
294
|
+
console.log(`no client detected`);
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
if (hasStarted) {
|
|
298
|
+
console.log(`has started is ${hasStarted}`);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
hideDisplayThankyouMessage();
|
|
302
|
+
if (chatLoading.current) {
|
|
303
|
+
console.log(`startChat skipped [${source}] — already in progress`);
|
|
304
|
+
return;
|
|
267
305
|
}
|
|
306
|
+
setChatStatus("connected");
|
|
268
307
|
try {
|
|
308
|
+
console.log(`Starting chat [${source}]`, chatRef.current);
|
|
309
|
+
chatLoading.current = true;
|
|
310
|
+
if (!menuRef.current || !menuRef.current.menus) {
|
|
311
|
+
let waited = 0;
|
|
312
|
+
while ((!menuRef.current || !menuRef.current.menus) && waited < 5e3) {
|
|
313
|
+
await new Promise((res) => setTimeout(res, 100));
|
|
314
|
+
waited += 100;
|
|
315
|
+
}
|
|
316
|
+
if (!menuRef.current || !menuRef.current.menus) {
|
|
317
|
+
console.error("Menu not loaded, cannot start chat");
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
console.log("menus: ->", menuRef.current);
|
|
269
322
|
const ongoingChat = await client.loadOngoingChat();
|
|
323
|
+
console.log("theres a ongoing chat?: -->", ongoingChat);
|
|
270
324
|
if (ongoingChat) {
|
|
271
325
|
console.log("Ongoing chat found:", ongoingChat);
|
|
272
326
|
console.log("Resuming chat:", ongoingChat.id);
|
|
273
|
-
chatRef.current =
|
|
327
|
+
chatRef.current = ongoingChat;
|
|
274
328
|
agent_virtual.current = ongoingChat.agent;
|
|
275
329
|
return;
|
|
276
330
|
}
|
|
331
|
+
console.log("not ongoing chat ");
|
|
332
|
+
console.log(!!ongoingChat);
|
|
277
333
|
const foundMenu = menuRef.current.menus.find(
|
|
278
334
|
(menu) => menu.name === menuOption
|
|
279
335
|
);
|
|
280
336
|
const menuId = foundMenu && foundMenu.id;
|
|
281
337
|
console.log("Creating new chat with menu ID:", menuId);
|
|
282
|
-
|
|
283
|
-
|
|
338
|
+
if (!foundMenu) {
|
|
339
|
+
throw new Error("Menu not found: " + menuOption);
|
|
340
|
+
}
|
|
341
|
+
const newChat = await client.createChat(menuId, {
|
|
342
|
+
custom_data: custom_data()
|
|
343
|
+
});
|
|
344
|
+
if (newChat && typeof newChat === "object" && isChat(newChat)) {
|
|
284
345
|
chatRef.current = newChat;
|
|
285
346
|
agent_virtual.current = newChat.agent;
|
|
286
347
|
console.log("Chat created id:", newChat.id);
|
|
@@ -288,58 +349,106 @@ const Chatbot = ({
|
|
|
288
349
|
} catch (err) {
|
|
289
350
|
console.error("Error creating chat:", err);
|
|
290
351
|
} finally {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
class PatchedAudio extends OriginalAudio {
|
|
294
|
-
constructor(src) {
|
|
295
|
-
const newSrc = src === "https://websdk.ujet.co/v3/ping.mp3" ? notificationSound : src;
|
|
296
|
-
super(newSrc);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
window.Audio = PatchedAudio;
|
|
300
|
-
}
|
|
352
|
+
chatLoading.current = false;
|
|
353
|
+
setChatStarted();
|
|
301
354
|
}
|
|
302
355
|
};
|
|
303
356
|
const handleClick = async () => {
|
|
357
|
+
audioManager.setSoundEnabled(true);
|
|
304
358
|
toggle();
|
|
305
359
|
if (hasStarted) return;
|
|
306
|
-
if (!menusLoaded) {
|
|
307
|
-
setPendingStart(true);
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
360
|
if (!hasOpenedOnce) {
|
|
311
|
-
await startChat();
|
|
312
|
-
|
|
361
|
+
await startChat("bubbleClick");
|
|
362
|
+
setChatStarted();
|
|
313
363
|
}
|
|
314
364
|
};
|
|
315
|
-
const
|
|
316
|
-
|
|
365
|
+
const sendNow = async (msg) => {
|
|
366
|
+
sendInFlightRef.current = true;
|
|
367
|
+
let success = true;
|
|
317
368
|
try {
|
|
318
369
|
await clientRef.current?.sendTextMessage(msg);
|
|
319
370
|
} catch (error) {
|
|
320
371
|
console.log(error);
|
|
372
|
+
success = false;
|
|
321
373
|
} finally {
|
|
374
|
+
sendInFlightRef.current = false;
|
|
322
375
|
if (!hasEscalated) {
|
|
323
376
|
blockInput?.();
|
|
324
377
|
}
|
|
325
378
|
}
|
|
379
|
+
return success;
|
|
380
|
+
};
|
|
381
|
+
const flushQueuedMessages = async () => {
|
|
382
|
+
if (flushingRef.current) return;
|
|
383
|
+
if (messageQueueRef.current.length === 0) return;
|
|
384
|
+
if (!clientRef.current || statusRef.current !== "connected") return;
|
|
385
|
+
if (!hasRealReply()) return;
|
|
386
|
+
flushingRef.current = true;
|
|
387
|
+
try {
|
|
388
|
+
while (messageQueueRef.current.length > 0 && !useOpenChat.getState().isBlockedInput && !sendInFlightRef.current) {
|
|
389
|
+
const next = messageQueueRef.current[0];
|
|
390
|
+
const success = await sendNow(next.text);
|
|
391
|
+
messageQueueRef.current.shift();
|
|
392
|
+
if (!success) {
|
|
393
|
+
resolvePendingMessage(next.id);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
} finally {
|
|
397
|
+
flushingRef.current = false;
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
const onSendMessage = async (msg) => {
|
|
401
|
+
const clientChatId = clientRef.current?.chat?.id;
|
|
402
|
+
const refChatId = chatRef.current?.id;
|
|
403
|
+
console.log(
|
|
404
|
+
"Sending message:",
|
|
405
|
+
msg,
|
|
406
|
+
"| client.chat.id:",
|
|
407
|
+
clientChatId,
|
|
408
|
+
"| chatRef.id:",
|
|
409
|
+
refChatId
|
|
410
|
+
);
|
|
411
|
+
const notReady = !clientRef.current || statusRef.current !== "connected";
|
|
412
|
+
const isThinking = useOpenChat.getState().isBlockedInput;
|
|
413
|
+
const noReplyYet = !hasRealReply();
|
|
414
|
+
if (notReady || isThinking || sendInFlightRef.current || noReplyYet) {
|
|
415
|
+
const id = `pending-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
416
|
+
messageQueueRef.current.push({ id, text: msg });
|
|
417
|
+
addPendingMessage(id, msg);
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
await sendNow(msg);
|
|
326
421
|
};
|
|
327
422
|
const onEndChat = async () => {
|
|
328
|
-
console.log(
|
|
423
|
+
console.log(`Ending chat [end chat]`);
|
|
329
424
|
if (chatRef.current) {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
425
|
+
try {
|
|
426
|
+
await clientRef.current?.finishChat();
|
|
427
|
+
console.log(`Chat finished`);
|
|
428
|
+
try {
|
|
429
|
+
await chatRef.current?.destroy();
|
|
430
|
+
console.log(`Chat destroyed`);
|
|
431
|
+
clearMessages();
|
|
432
|
+
chatRef.current = null;
|
|
433
|
+
resetChatStarted();
|
|
434
|
+
messageQueueRef.current = [];
|
|
435
|
+
sendInFlightRef.current = false;
|
|
436
|
+
flushingRef.current = false;
|
|
437
|
+
console.log("Chat ended");
|
|
438
|
+
endEscalation?.();
|
|
439
|
+
} finally {
|
|
440
|
+
setChatStatus("ending");
|
|
441
|
+
displayThankyouMessage();
|
|
442
|
+
}
|
|
443
|
+
} catch (error) {
|
|
444
|
+
console.log(error, "from onEndChat");
|
|
445
|
+
}
|
|
337
446
|
}
|
|
338
447
|
};
|
|
339
448
|
const onEndAndStartNewChat = async () => {
|
|
340
449
|
console.log("Ending current chat and starting a new one");
|
|
341
450
|
await onEndChat();
|
|
342
|
-
await startChat();
|
|
451
|
+
await startChat("endAndStartNew");
|
|
343
452
|
};
|
|
344
453
|
useMount(async () => {
|
|
345
454
|
console.log("Chatbot mounted");
|
|
@@ -347,19 +456,14 @@ const Chatbot = ({
|
|
|
347
456
|
isMountedRef.current = true;
|
|
348
457
|
await createClient();
|
|
349
458
|
});
|
|
350
|
-
useEffect(() => {
|
|
351
|
-
if (menusLoaded && pendingStart && !hasStarted) {
|
|
352
|
-
startChat();
|
|
353
|
-
setPendingStart(false);
|
|
354
|
-
}
|
|
355
|
-
}, [menusLoaded, pendingStart, hasStarted]);
|
|
356
459
|
useUnmount(() => {
|
|
357
460
|
console.log("Chatbot unmounted");
|
|
358
461
|
deregisterEventHandlers();
|
|
359
|
-
|
|
360
|
-
|
|
462
|
+
chatLoading.current = false;
|
|
463
|
+
messageQueueRef.current = [];
|
|
464
|
+
sendInFlightRef.current = false;
|
|
361
465
|
reset();
|
|
362
|
-
|
|
466
|
+
resetChatStarted();
|
|
363
467
|
setStatus("idle");
|
|
364
468
|
clearMessages();
|
|
365
469
|
endEscalation?.();
|
|
@@ -370,9 +474,13 @@ const Chatbot = ({
|
|
|
370
474
|
const onClose = () => {
|
|
371
475
|
toggle();
|
|
372
476
|
};
|
|
373
|
-
const
|
|
477
|
+
const newChatSession = async () => {
|
|
478
|
+
console.log("create new session");
|
|
479
|
+
};
|
|
480
|
+
const onCloseAfterThankYou = async () => {
|
|
374
481
|
reset();
|
|
375
|
-
|
|
482
|
+
resetChatStarted();
|
|
483
|
+
newChatSession();
|
|
376
484
|
};
|
|
377
485
|
const onPreviewTyping = async (msg) => {
|
|
378
486
|
console.log("Preview typing message:", msg);
|
|
@@ -385,6 +493,19 @@ const Chatbot = ({
|
|
|
385
493
|
console.error("Error sending preview message:", error);
|
|
386
494
|
}
|
|
387
495
|
};
|
|
496
|
+
useEffect(() => {
|
|
497
|
+
if (chatRef.current) {
|
|
498
|
+
if (isVisible && isOpen) {
|
|
499
|
+
audioManager.setSoundEnabled(false);
|
|
500
|
+
}
|
|
501
|
+
if (isVisible && !isOpen) {
|
|
502
|
+
audioManager.setSoundEnabled(true);
|
|
503
|
+
}
|
|
504
|
+
if (!isVisible) {
|
|
505
|
+
audioManager.setSoundEnabled(true);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}, [isOpen, isVisible]);
|
|
388
509
|
return menusLoaded && /* @__PURE__ */ jsxs(
|
|
389
510
|
"div",
|
|
390
511
|
{
|
|
@@ -411,5 +532,6 @@ const Chatbot = ({
|
|
|
411
532
|
);
|
|
412
533
|
};
|
|
413
534
|
export {
|
|
414
|
-
Chatbot
|
|
535
|
+
Chatbot,
|
|
536
|
+
audioManager
|
|
415
537
|
};
|