@eshal-bot/chat-widget 0.1.70 → 0.1.72
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/dist/chat-widget.js
CHANGED
|
@@ -8779,14 +8779,14 @@
|
|
|
8779
8779
|
/**
|
|
8780
8780
|
* Constructs the voice WebSocket base URL.
|
|
8781
8781
|
*
|
|
8782
|
-
* If wsBaseUrl is provided (
|
|
8783
|
-
*
|
|
8784
|
-
*
|
|
8782
|
+
* If wsBaseUrl is provided explicitly (via ChatWidget.init({ wsBaseUrl })),
|
|
8783
|
+
* use it directly. Required for Mode B external embeds where apiBaseUrl is
|
|
8784
|
+
* the customer server, not the eshal frontend.
|
|
8785
8785
|
*
|
|
8786
8786
|
* For in-app use (apiBaseUrl IS the eshal frontend), derives from apiBaseUrl.
|
|
8787
8787
|
*
|
|
8788
8788
|
* @param {string} apiBaseUrl - Frontend base URL, e.g. https://demo.eshal.ai
|
|
8789
|
-
* @param {string} [wsBaseUrl] -
|
|
8789
|
+
* @param {string} [wsBaseUrl] - Explicit override, e.g. wss://dev.eshal.ai/voice/ws
|
|
8790
8790
|
* @returns {string} Voice WS base URL
|
|
8791
8791
|
*/
|
|
8792
8792
|
const getWebSocketUrl = (apiBaseUrl, wsBaseUrl) => {
|
|
@@ -100695,7 +100695,8 @@
|
|
|
100695
100695
|
onboardingQuestions,
|
|
100696
100696
|
collectionPrompt,
|
|
100697
100697
|
allowedDomains,
|
|
100698
|
-
onboardingEnabled
|
|
100698
|
+
onboardingEnabled,
|
|
100699
|
+
wsBaseUrl
|
|
100699
100700
|
} = _ref;
|
|
100700
100701
|
const [agentConfig, setAgentConfig] = reactExports.useState(null);
|
|
100701
100702
|
const [isLoadingConfig, setIsLoadingConfig] = reactExports.useState(true);
|
|
@@ -100726,7 +100727,7 @@
|
|
|
100726
100727
|
|
|
100727
100728
|
// Map API response to widget props (use props as overrides if provided)
|
|
100728
100729
|
const widgetConfig = reactExports.useMemo(() => {
|
|
100729
|
-
var _agentConfig$config, _cfg$identity, _cfg$branding, _cfg$typography, _cfg$messages, _cfg$voice, _cfg$onboarding, _cfg$disclaimer, _cfg$csat, _cfg$inactivity, _cfg$behavior, _cfg$security, _cfg$layout, _ref2, _messages$bundles$loc, _messages$bundles, _messages$bundles$en, _messages$bundles2, _ref3, _ref4, _ref5, _ref6, _branding$chatbotAvat, _branding$chatbotAvat2, _ref7, _ref8, _ref9, _ref0, _ref1, _ref10, _ref11, _ref12, _typography$headerTex, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _inactivity$timeoutVa, _inactivity$timeoutUn, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _csat$enabled, _csat$format, _csat$prompt, _csat$triggerType, _csat$idleTimeoutMins, _csat$followUpEnabled, _csat$followUpPrompt, _behavior$autoPromptE, _behavior$allowFeedba, _behavior$provideCita, _agentConfig$organiza
|
|
100730
|
+
var _agentConfig$config, _cfg$identity, _cfg$branding, _cfg$typography, _cfg$messages, _cfg$voice, _cfg$onboarding, _cfg$disclaimer, _cfg$csat, _cfg$inactivity, _cfg$behavior, _cfg$security, _cfg$layout, _ref2, _messages$bundles$loc, _messages$bundles, _messages$bundles$en, _messages$bundles2, _ref3, _ref4, _ref5, _ref6, _branding$chatbotAvat, _branding$chatbotAvat2, _ref7, _ref8, _ref9, _ref0, _ref1, _ref10, _ref11, _ref12, _typography$headerTex, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _inactivity$timeoutVa, _inactivity$timeoutUn, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _csat$enabled, _csat$format, _csat$prompt, _csat$triggerType, _csat$idleTimeoutMins, _csat$followUpEnabled, _csat$followUpPrompt, _behavior$autoPromptE, _behavior$allowFeedba, _behavior$provideCita, _agentConfig$organiza;
|
|
100730
100731
|
if (!agentConfig) {
|
|
100731
100732
|
return null;
|
|
100732
100733
|
}
|
|
@@ -100824,8 +100825,7 @@
|
|
|
100824
100825
|
provideCitations: (_behavior$provideCita = behavior.provideCitations) !== null && _behavior$provideCita !== void 0 ? _behavior$provideCita : true,
|
|
100825
100826
|
// organizationId from the backend response — used internally for
|
|
100826
100827
|
// session isolation (localStorage keys) and WS paths. Not a user prop.
|
|
100827
|
-
organizationId: (_agentConfig$organiza = agentConfig.organizationId) !== null && _agentConfig$organiza !== void 0 ? _agentConfig$organiza : null
|
|
100828
|
-
wsBaseUrl: (_agentConfig$wsBaseUr = agentConfig.wsBaseUrl) !== null && _agentConfig$wsBaseUr !== void 0 ? _agentConfig$wsBaseUr : null
|
|
100828
|
+
organizationId: (_agentConfig$organiza = agentConfig.organizationId) !== null && _agentConfig$organiza !== void 0 ? _agentConfig$organiza : null
|
|
100829
100829
|
};
|
|
100830
100830
|
}, [agentConfig, darkMode, primaryColor, position, companyName, conciergeName, companyLogo, welcomeMessage, quickQuestions, quickQuestionsEnabled, textColor, agentMessageBubbleColor, userMessageBoxColor, assistantTextColor, userTextColor, fontFamily, fontSize, defaultLanguage, headerTextBold, headerTextItalic, enableVoiceInteraction, disclaimerEnabled, disclaimerText, disclaimerPosition, disclaimerLinkLabel, disclaimerLinkUrl, showPoweredBy, onboardingQuestions, onboardingEnabled, collectionPrompt, allowedDomains, agentMessageBubbleFontFamily, agentMessageBubbleFontSize, userMessageBubbleFontFamily, userMessageBubbleFontSize
|
|
100831
100831
|
// CSAT dependencies
|
|
@@ -100896,7 +100896,7 @@
|
|
|
100896
100896
|
welcomeMessage: widgetConfig.welcomeMessage,
|
|
100897
100897
|
quickQuestions: widgetConfig.quickQuestions,
|
|
100898
100898
|
apiBaseUrl,
|
|
100899
|
-
wsBaseUrl
|
|
100899
|
+
wsBaseUrl,
|
|
100900
100900
|
apiKey,
|
|
100901
100901
|
organizationId: widgetConfig.organizationId,
|
|
100902
100902
|
getAuthToken,
|