@robylon/react-native-sdk 2.2.1-staging.0 → 2.2.1-staging.1
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/lib/commonjs/Chatbotsdk.js +3 -3
- package/lib/commonjs/Chatbotsdk.js.map +1 -1
- package/lib/commonjs/versions/version.staging.js +1 -1
- package/lib/module/Chatbotsdk.js +3 -3
- package/lib/module/Chatbotsdk.js.map +1 -1
- package/lib/module/openChatbot.js +1 -2
- package/lib/module/openChatbot.js.map +1 -1
- package/lib/module/versions/version.staging.js +1 -1
- package/lib/typescript/Chatbotsdk.d.ts +40 -0
- package/lib/typescript/Chatbotsdk.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/versions/version.staging.d.ts +1 -1
- package/package.json +1 -1
- package/robylon-react-native-sdk-2.2.1-staging.0.tgz +0 -0
- package/src/Chatbotsdk.tsx +120 -0
- package/src/index.tsx +5 -1
- package/src/versions/version.staging.ts +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.WidgetPositionEnums=exports.LauncherType=exports.ChatbotInterfaceType=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeWebview=require("react-native-webview");var _FloatingButton=_interopRequireDefault(require("./FloatingButton"));var _constants=require("./constants");var _systemInfo=require("./utils/systemInfo");var _useChatbotEvents2=require("./hooks/useChatbotEvents");var _events=require("./types/events");var _logger=require("./utils/logger");var _debugConfig=require("./utils/debugConfig");var _DebugButton=_interopRequireDefault(require("./components/DebugButton"));var _ErrorBoundary=require("./components/ErrorBoundary");var _errorConstants=require("./constants/errorConstants");var _ErrorTrackingService=require("./services/ErrorTrackingService");var _cookieUtils=require("./utils/cookieUtils");var _webViewStorage=require("./utils/webViewStorage");var _animations=require("./utils/animations");var _fileDownload=require("./utils/fileDownload");var _session=require("./utils/session");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/professional/Mobile sdks/robylon-react-native-sdk/src/Chatbotsdk.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var ChatbotInterfaceType=exports.ChatbotInterfaceType=function(ChatbotInterfaceType){ChatbotInterfaceType["WIDGET"]="WIDGET";ChatbotInterfaceType["POPOVER"]="POPOVER";ChatbotInterfaceType["EMBED"]="EMBED";return ChatbotInterfaceType;}({});var WidgetPositionEnums=exports.WidgetPositionEnums=function(WidgetPositionEnums){WidgetPositionEnums["RIGHT"]="Right";WidgetPositionEnums["LEFT"]="Left";return WidgetPositionEnums;}({});var LauncherType=exports.LauncherType=function(LauncherType){LauncherType["TEXT"]="TEXT";LauncherType["IMAGE"]="IMAGE";LauncherType["TEXTUAL_IMAGE"]="TEXTUAL_IMAGE";return LauncherType;}({});var Chatbot=(0,_react.forwardRef)(function(_ref,ref){var _chatbotConfig$interf,_chatbotConfig$interf2,_chatbotConfig$interf3,_chatbotConfig$interf4,_chatbotConfig$interf5;var api_key=_ref.api_key,user_id=_ref.user_id,user_token=_ref.user_token,_ref$show_floating_bu=_ref.show_floating_button,show_floating_button=_ref$show_floating_bu===void 0?true:_ref$show_floating_bu,onEvent=_ref.onEvent,onMessage=_ref.onMessage,_ref$isFullScreen=_ref.isFullScreen,isFullScreen=_ref$isFullScreen===void 0?true:_ref$isFullScreen,_ref$enableAnimation=_ref.enableAnimation,enableAnimation=_ref$enableAnimation===void 0?true:_ref$enableAnimation,externalOnOpen=_ref.onOpen,externalOnClose=_ref.onClose,onReady=_ref.onReady,user_profile=_ref.user_profile,session_id=_ref.session_id,session_context=_ref.session_context,_ref$discrete=_ref.discrete,discrete=_ref$discrete===void 0?false:_ref$discrete,onSession=_ref.onSession;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isWebViewVisible=_useState2[0],setIsWebViewVisible=_useState2[1];var _useState3=(0,_react.useState)(null),_useState4=(0,_slicedToArray2.default)(_useState3,2),chatbotConfig=_useState4[0],setChatbotConfig=_useState4[1];var _useState5=(0,_react.useState)(true),_useState6=(0,_slicedToArray2.default)(_useState5,2),loading=_useState6[0],setLoading=_useState6[1];var _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),isInitialized=_useState8[0],setIsInitialized=_useState8[1];var webViewRef=(0,_react.useRef)(null);var isFirstLoadRef=(0,_react.useRef)(true);var _useState9=(0,_react.useState)(false),_useState10=(0,_slicedToArray2.default)(_useState9,2),toastVisible=_useState10[0],setToastVisible=_useState10[1];var _useState11=(0,_react.useState)(""),_useState12=(0,_slicedToArray2.default)(_useState11,2),toastMessage=_useState12[0],setToastMessage=_useState12[1];var _useState13=(0,_react.useState)(),_useState14=(0,_slicedToArray2.default)(_useState13,2),effectiveUserId=_useState14[0],setEffectiveUserId=_useState14[1];var _useState15=(0,_react.useState)(false),_useState16=(0,_slicedToArray2.default)(_useState15,2),isStorageReady=_useState16[0],setIsStorageReady=_useState16[1];var pendingStorageOps=(0,_react.useRef)([]);var memoryCache=(0,_react.useRef)({});var _useState17=(0,_react.useState)({os:"",browser:""}),_useState18=(0,_slicedToArray2.default)(_useState17,2),systemInfo=_useState18[0],setSystemInfo=_useState18[1];var systemInfoRef=(0,_react.useRef)({os:"",browser:""});var isInitializedRef=(0,_react.useRef)(false);var isWebViewVisibleRef=(0,_react.useRef)(false);var sessionIdRef=(0,_react.useRef)(undefined);var onSessionRef=(0,_react.useRef)(onSession);var sessionContextRef=(0,_react.useRef)(session_context);var resumeSessionRef=(0,_react.useRef)(session_id);var discreteRef=(0,_react.useRef)(discrete);onSessionRef.current=onSession;sessionContextRef.current=session_context;resumeSessionRef.current=session_id;discreteRef.current=discrete;var animatedValues=(0,_react.useRef)({scale:new _reactNative.Animated.Value(1),translateY:new _reactNative.Animated.Value(0),opacity:new _reactNative.Animated.Value(1)}).current;var chatbotConfigForEvents=(0,_react.useMemo)(function(){return{userId:effectiveUserId,isAnonymous:!user_id&&user_id!==0};},[effectiveUserId,user_id]);var _useChatbotEvents=(0,_useChatbotEvents2.useChatbotEvents)({api_key:api_key,chatbotConfig:chatbotConfigForEvents!=null?chatbotConfigForEvents:{},user_profile:user_profile,onEvent:onEvent,systemInfo:systemInfo!=null?systemInfo:{os:"",browser:""}}),emitEvent=_useChatbotEvents.emitEvent,onInternalEvent=_useChatbotEvents.onInternalEvent;(0,_react.useImperativeHandle)(ref,function(){return{open:function open(){if(isInitializedRef.current){openWebView();}},close:function close(){if(isInitializedRef.current){closeWebView();}},toggle:function toggle(){if(isInitializedRef.current){if(isWebViewVisibleRef.current){closeWebView();}else{openWebView();}}},isReady:function isReady(){return isInitializedRef.current;},getSessionId:function getSessionId(){return sessionIdRef.current;}};},[isInitialized,isWebViewVisible]);var emitSession=(0,_react.useCallback)(function(data){var sessionId=(0,_session.extractSessionId)(data);if(!sessionId||sessionId===sessionIdRef.current)return;sessionIdRef.current=sessionId;try{var _sessionContextRef$cu;onSessionRef.current==null?void 0:onSessionRef.current(sessionId,(_sessionContextRef$cu=sessionContextRef.current)!=null?_sessionContextRef$cu:{});}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("onSession handler threw an error"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{source:_session.SESSION_UPDATED_MESSAGE_TYPE}});}},[]);var triggerAppInit=function triggerAppInit(){if(webViewRef.current){var _webViewRef$current;(_webViewRef$current=webViewRef.current)==null?void 0:_webViewRef$current.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());webViewRef.current.injectJavaScript(`
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.WidgetPositionEnums=exports.LauncherType=exports.ChatbotInterfaceType=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeWebview=require("react-native-webview");var _FloatingButton=_interopRequireDefault(require("./FloatingButton"));var _constants=require("./constants");var _systemInfo=require("./utils/systemInfo");var _useChatbotEvents2=require("./hooks/useChatbotEvents");var _events=require("./types/events");var _logger=require("./utils/logger");var _debugConfig=require("./utils/debugConfig");var _DebugButton=_interopRequireDefault(require("./components/DebugButton"));var _ErrorBoundary=require("./components/ErrorBoundary");var _errorConstants=require("./constants/errorConstants");var _ErrorTrackingService=require("./services/ErrorTrackingService");var _cookieUtils=require("./utils/cookieUtils");var _webViewStorage=require("./utils/webViewStorage");var _animations=require("./utils/animations");var _fileDownload=require("./utils/fileDownload");var _session=require("./utils/session");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/professional/Mobile sdks/robylon-react-native-sdk/src/Chatbotsdk.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var ChatbotInterfaceType=exports.ChatbotInterfaceType=function(ChatbotInterfaceType){ChatbotInterfaceType["WIDGET"]="WIDGET";ChatbotInterfaceType["POPOVER"]="POPOVER";ChatbotInterfaceType["EMBED"]="EMBED";return ChatbotInterfaceType;}({});var WidgetPositionEnums=exports.WidgetPositionEnums=function(WidgetPositionEnums){WidgetPositionEnums["RIGHT"]="Right";WidgetPositionEnums["LEFT"]="Left";return WidgetPositionEnums;}({});var LauncherType=exports.LauncherType=function(LauncherType){LauncherType["TEXT"]="TEXT";LauncherType["IMAGE"]="IMAGE";LauncherType["TEXTUAL_IMAGE"]="TEXTUAL_IMAGE";return LauncherType;}({});var Chatbot=(0,_react.forwardRef)(function(_ref,ref){var _chatbotConfig$interf,_chatbotConfig$interf2,_chatbotConfig$interf3,_chatbotConfig$interf4,_chatbotConfig$interf5;var api_key=_ref.api_key,user_id=_ref.user_id,user_token=_ref.user_token,_ref$show_floating_bu=_ref.show_floating_button,show_floating_button=_ref$show_floating_bu===void 0?true:_ref$show_floating_bu,onEvent=_ref.onEvent,onMessage=_ref.onMessage,_ref$isFullScreen=_ref.isFullScreen,isFullScreen=_ref$isFullScreen===void 0?true:_ref$isFullScreen,_ref$enableAnimation=_ref.enableAnimation,enableAnimation=_ref$enableAnimation===void 0?true:_ref$enableAnimation,externalOnOpen=_ref.onOpen,externalOnClose=_ref.onClose,onReady=_ref.onReady,user_profile=_ref.user_profile,session_id=_ref.session_id,session_context=_ref.session_context,_ref$discrete=_ref.discrete,discrete=_ref$discrete===void 0?false:_ref$discrete,onSession=_ref.onSession,loading_screen=_ref.loading_screen;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isWebViewVisible=_useState2[0],setIsWebViewVisible=_useState2[1];var _useState3=(0,_react.useState)(null),_useState4=(0,_slicedToArray2.default)(_useState3,2),chatbotConfig=_useState4[0],setChatbotConfig=_useState4[1];var _useState5=(0,_react.useState)(true),_useState6=(0,_slicedToArray2.default)(_useState5,2),loading=_useState6[0],setLoading=_useState6[1];var _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),isInitialized=_useState8[0],setIsInitialized=_useState8[1];var webViewRef=(0,_react.useRef)(null);var isFirstLoadRef=(0,_react.useRef)(true);var _useState9=(0,_react.useState)(false),_useState10=(0,_slicedToArray2.default)(_useState9,2),toastVisible=_useState10[0],setToastVisible=_useState10[1];var _useState11=(0,_react.useState)(""),_useState12=(0,_slicedToArray2.default)(_useState11,2),toastMessage=_useState12[0],setToastMessage=_useState12[1];var _useState13=(0,_react.useState)(),_useState14=(0,_slicedToArray2.default)(_useState13,2),effectiveUserId=_useState14[0],setEffectiveUserId=_useState14[1];var _useState15=(0,_react.useState)(false),_useState16=(0,_slicedToArray2.default)(_useState15,2),isStorageReady=_useState16[0],setIsStorageReady=_useState16[1];var pendingStorageOps=(0,_react.useRef)([]);var memoryCache=(0,_react.useRef)({});var _useState17=(0,_react.useState)({os:"",browser:""}),_useState18=(0,_slicedToArray2.default)(_useState17,2),systemInfo=_useState18[0],setSystemInfo=_useState18[1];var systemInfoRef=(0,_react.useRef)({os:"",browser:""});var isInitializedRef=(0,_react.useRef)(false);var isWebViewVisibleRef=(0,_react.useRef)(false);var sessionIdRef=(0,_react.useRef)(undefined);var onSessionRef=(0,_react.useRef)(onSession);var sessionContextRef=(0,_react.useRef)(session_context);var resumeSessionRef=(0,_react.useRef)(session_id);var discreteRef=(0,_react.useRef)(discrete);var loadingScreenRef=(0,_react.useRef)(loading_screen);onSessionRef.current=onSession;sessionContextRef.current=session_context;resumeSessionRef.current=session_id;discreteRef.current=discrete;loadingScreenRef.current=loading_screen;var chatbotConfigRef=(0,_react.useRef)(null);chatbotConfigRef.current=chatbotConfig;var hasSentInitLoadRef=(0,_react.useRef)(false);var animatedValues=(0,_react.useRef)({scale:new _reactNative.Animated.Value(1),translateY:new _reactNative.Animated.Value(0),opacity:new _reactNative.Animated.Value(1)}).current;var chatbotConfigForEvents=(0,_react.useMemo)(function(){return{userId:effectiveUserId,isAnonymous:!user_id&&user_id!==0};},[effectiveUserId,user_id]);var _useChatbotEvents=(0,_useChatbotEvents2.useChatbotEvents)({api_key:api_key,chatbotConfig:chatbotConfigForEvents!=null?chatbotConfigForEvents:{},user_profile:user_profile,onEvent:onEvent,systemInfo:systemInfo!=null?systemInfo:{os:"",browser:""}}),emitEvent=_useChatbotEvents.emitEvent,onInternalEvent=_useChatbotEvents.onInternalEvent;(0,_react.useImperativeHandle)(ref,function(){return{open:function open(){if(isInitializedRef.current){openWebView();}},close:function close(){if(isInitializedRef.current){closeWebView();}},toggle:function toggle(){if(isInitializedRef.current){if(isWebViewVisibleRef.current){closeWebView();}else{openWebView();}}},isReady:function isReady(){return isInitializedRef.current;},getSessionId:function getSessionId(){return sessionIdRef.current;}};},[isInitialized,isWebViewVisible]);var emitSession=(0,_react.useCallback)(function(data){var sessionId=(0,_session.extractSessionId)(data);if(!sessionId||sessionId===sessionIdRef.current)return;sessionIdRef.current=sessionId;try{var _sessionContextRef$cu;onSessionRef.current==null?void 0:onSessionRef.current(sessionId,(_sessionContextRef$cu=sessionContextRef.current)!=null?_sessionContextRef$cu:{});}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("onSession handler threw an error"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{source:_session.SESSION_UPDATED_MESSAGE_TYPE}});}},[]);var triggerAppInit=function triggerAppInit(){if(webViewRef.current){var _webViewRef$current;(_webViewRef$current=webViewRef.current)==null?void 0:_webViewRef$current.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());webViewRef.current.injectJavaScript(`
|
|
2
2
|
// Trigger APP_READY equivalent
|
|
3
3
|
window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'APP_READY' }));
|
|
4
4
|
true;
|
|
5
|
-
`);}};var executeStorageOp=(0,_react.useCallback)(function(operation){if(isStorageReady){operation();}else{pendingStorageOps.current.push(operation);}},[isStorageReady]);var handleMessage=(0,_react.useCallback)(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(event){var _webViewRef$current2;var data=event.nativeEvent.data;try{var parsedData=JSON.parse(data);if(Object.values(_webViewStorage.StorageMessageType).includes(parsedData.type)){var storageMessage=parsedData;switch(storageMessage.type){case _webViewStorage.StorageMessageType.STORAGE_READY:setIsStorageReady(true);pendingStorageOps.current.forEach(function(op){return op();});pendingStorageOps.current=[];(_webViewRef$current2=webViewRef.current)==null?void 0:_webViewRef$current2.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));break;case _webViewStorage.StorageMessageType.STORAGE_RESPONSE:if(storageMessage.key&&storageMessage.value){memoryCache.current[storageMessage.key]=storageMessage.value;if(storageMessage.key==="rblyn_anon"){setEffectiveUserId(storageMessage.value);}}break;case _webViewStorage.StorageMessageType.STORAGE_ERROR:_logger.logger.error("WebView storage error:",storageMessage.error);break;}return;}if(__DEV__){if((parsedData==null?void 0:parsedData.type)==="CONSOLE"){console.log(`WebView ${parsedData==null?void 0:parsedData.level}:`,parsedData==null?void 0:parsedData.data);return;}if((parsedData==null?void 0:parsedData.type)==="ERROR"){console.error("WebView Error:",parsedData==null?void 0:parsedData.data);return;}}if((parsedData==null?void 0:parsedData.type)==="SYSTEM_INFO"){var _parsedData$data;setSystemInfo((_parsedData$data=parsedData==null?void 0:parsedData.data)!=null?_parsedData$data:{os:"",browser:""});systemInfoRef.current=parsedData==null?void 0:parsedData.data;return;}if((parsedData==null?void 0:parsedData.type)===_session.SESSION_UPDATED_MESSAGE_TYPE){emitSession(parsedData==null?void 0:parsedData.data);return;}if((parsedData==null?void 0:parsedData.type)==="APP_READY"){emitEvent(_events.ChatbotEventType.CHATBOT_APP_READY);if(webViewRef.current&&isWebViewVisible){var _webViewRef$current3,_webViewRef$current4;(_webViewRef$current3=webViewRef.current)==null?void 0:_webViewRef$current3.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());var messageData={name:"registerUserId",action:"registerUserId",data:(0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)({
|
|
5
|
+
`);}};var executeStorageOp=(0,_react.useCallback)(function(operation){if(isStorageReady){operation();}else{pendingStorageOps.current.push(operation);}},[isStorageReady]);var handleMessage=(0,_react.useCallback)(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(event){var _webViewRef$current2;var data=event.nativeEvent.data;try{var parsedData=JSON.parse(data);if(Object.values(_webViewStorage.StorageMessageType).includes(parsedData.type)){var storageMessage=parsedData;switch(storageMessage.type){case _webViewStorage.StorageMessageType.STORAGE_READY:setIsStorageReady(true);pendingStorageOps.current.forEach(function(op){return op();});pendingStorageOps.current=[];(_webViewRef$current2=webViewRef.current)==null?void 0:_webViewRef$current2.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));break;case _webViewStorage.StorageMessageType.STORAGE_RESPONSE:if(storageMessage.key&&storageMessage.value){memoryCache.current[storageMessage.key]=storageMessage.value;if(storageMessage.key==="rblyn_anon"){setEffectiveUserId(storageMessage.value);}}break;case _webViewStorage.StorageMessageType.STORAGE_ERROR:_logger.logger.error("WebView storage error:",storageMessage.error);break;}return;}if(__DEV__){if((parsedData==null?void 0:parsedData.type)==="CONSOLE"){console.log(`WebView ${parsedData==null?void 0:parsedData.level}:`,parsedData==null?void 0:parsedData.data);return;}if((parsedData==null?void 0:parsedData.type)==="ERROR"){console.error("WebView Error:",parsedData==null?void 0:parsedData.data);return;}}if((parsedData==null?void 0:parsedData.type)==="SYSTEM_INFO"){var _parsedData$data;setSystemInfo((_parsedData$data=parsedData==null?void 0:parsedData.data)!=null?_parsedData$data:{os:"",browser:""});systemInfoRef.current=parsedData==null?void 0:parsedData.data;return;}if((parsedData==null?void 0:parsedData.type)===_session.SESSION_UPDATED_MESSAGE_TYPE){emitSession(parsedData==null?void 0:parsedData.data);return;}if((parsedData==null?void 0:parsedData.type)==="APP_READY"){emitEvent(_events.ChatbotEventType.CHATBOT_APP_READY);if(webViewRef.current&&isWebViewVisible){var _webViewRef$current3,_loadingScreen$image,_brandConfig$images,_brandConfig$images$h,_loadingScreen$bot_na,_loadingScreen$brand_,_loadingScreen$powere,_brandConfig$footer,_webViewRef$current4;(_webViewRef$current3=webViewRef.current)==null?void 0:_webViewRef$current3.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());var brandConfig=chatbotConfigRef.current;var loadingScreen=loadingScreenRef.current;var hint={};var addHint=function addHint(key,value){if(value!==undefined&&value!==""){hint[key]=value;}};addHint("init_load_image",(_loadingScreen$image=loadingScreen==null?void 0:loadingScreen.image)!=null?_loadingScreen$image:(brandConfig==null?void 0:(_brandConfig$images=brandConfig.images)==null?void 0:(_brandConfig$images$h=_brandConfig$images.header_image_url)==null?void 0:_brandConfig$images$h.url)||(brandConfig==null?void 0:brandConfig.image_url));addHint("init_load_bot_name",(_loadingScreen$bot_na=loadingScreen==null?void 0:loadingScreen.bot_name)!=null?_loadingScreen$bot_na:brandConfig==null?void 0:brandConfig.name);addHint("init_load_brand_color",(_loadingScreen$brand_=loadingScreen==null?void 0:loadingScreen.brand_color)!=null?_loadingScreen$brand_:brandConfig==null?void 0:brandConfig.brand_colour);addHint("init_load_powered_by",(_loadingScreen$powere=loadingScreen==null?void 0:loadingScreen.powered_by)!=null?_loadingScreen$powere:brandConfig==null?void 0:(_brandConfig$footer=brandConfig.footer)==null?void 0:_brandConfig$footer.show_powered_by);addHint("init_load_sub_text",loadingScreen==null?void 0:loadingScreen.sub_text);var initLoadHint;if(!hasSentInitLoadRef.current&&Object.keys(hint).length>0){initLoadHint=hint;hasSentInitLoadRef.current=true;}var messageData={name:"registerUserId",action:"registerUserId",data:Object.assign({userId:effectiveUserId},initLoadHint,(0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)({},_session.RESUME_SESSION_KEY,resumeSessionRef.current||undefined),"discrete",discreteRef.current?true:undefined),"token",user_token?`${user_token}`:undefined),"userProfile",Object.assign({},user_profile,(0,_systemInfo.getSystemInfo)(systemInfoRef==null?void 0:systemInfoRef.current),{__INT_SYS_INFO__:Object.assign({},(0,_systemInfo.getSystemInfo)(systemInfoRef==null?void 0:systemInfoRef.current))})))};_logger.logger.debug("messageData====>",JSON.stringify(Object.assign({},messageData,{data:Object.assign({},messageData.data,(0,_defineProperty2.default)({},_session.RESUME_SESSION_KEY,resumeSessionRef.current?"[redacted]":undefined))})));(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript(`
|
|
6
6
|
window.postMessage(${JSON.stringify({name:"openFrame",domain:"app-domain.com"})}, '*');
|
|
7
7
|
window.postMessage(${JSON.stringify(messageData)}, '*');
|
|
8
8
|
`);}}switch(parsedData==null?void 0:parsedData.type){case"close_chatbot":closeWebView();break;case"download_file":if(parsedData!=null&&parsedData.data||parsedData!=null&&parsedData.url&&parsedData!=null&&parsedData.filename){var downloadData=(parsedData==null?void 0:parsedData.data)||{url:parsedData==null?void 0:parsedData.url,filename:parsedData==null?void 0:parsedData.filename,inPlace:parsedData==null?void 0:parsedData.inPlace};(0,_fileDownload.handleDownloadRequest)(downloadData);}break;case"CHATBOT_LOADED":emitEvent(_events.ChatbotEventType.CHATBOT_LOADED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZED,parsedData==null?void 0:parsedData.data);break;case"SESSION_REFRESHED":emitEvent(_events.ChatbotEventType.SESSION_REFRESHED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZATION_FAILED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZATION_FAILED,parsedData==null?void 0:parsedData.data);break;case"REQUEST_MIC_PERMISSION":var granted=yield requestAndroidMicPermission();if(webViewRef.current&&isWebViewVisible){var _webViewRef$current5;var _messageData={name:"requestMicPermission",action:"requestMicPermission",type:granted?"MIC_PERMISSION_GRANTED":"MIC_PERMISSION_DENIED"};(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript(`
|
|
9
|
-
window.postMessage(${JSON.stringify(_messageData)}, '*');`);}break;default:if(onMessage)onMessage(parsedData!=null?parsedData:{});}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to parse WebView message"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{messageData:data}});}});return function(_x){return _ref2.apply(this,arguments);};}(),[emitEvent,emitSession,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){var userId=user_id?String(user_id):undefined;if(!userId){userId=memoryCache.current["rblyn_anon"];if(!userId){userId=(0,_cookieUtils.generateUUID)();executeStorageOp(function(){var _webViewRef$current6;(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref3.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current7;(_webViewRef$current7=webViewRef.current)==null?void 0:_webViewRef$current7.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl=`${_constants.API_URL}/chat/chatbot/get/`;var payload={client_user_id:effectiveUserId,resumable_session_id:resumeSessionRef.current||undefined,discrete:discreteRef.current?true:undefined,org_id:api_key,token:user_token,extra_info:{}};var response=yield fetch(endpointUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(payload)});if(!response.ok){throw new Error("Failed to fetch chatbot configuration");}var data=yield response.json();var orgInfo=data==null?void 0:(_data$user=data.user)==null?void 0:_data$user.org_info;if(orgInfo){var _orgInfo$brand_config,_orgInfo$brand_config2,_orgInfo$brand_config3,_orgInfo$brand_config4,_orgInfo$brand_config5,_orgInfo$brand_config6,_orgInfo$brand_config7,_orgInfo$brand_config8,_orgInfo$brand_config9,_orgInfo$brand_config10,_orgInfo$brand_config11,_orgInfo$brand_config12,_orgInfo$brand_config13,_orgInfo$brand_config14,_orgInfo$brand_config15,_orgInfo$brand_config16,_orgInfo$brand_config17,_orgInfo$brand_config18,_orgInfo$brand_config19,_orgInfo$brand_config20,_orgInfo$brand_config21,_orgInfo$brand_config22;var config={brand_colour:((_orgInfo$brand_config=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config2=_orgInfo$brand_config.colors)==null?void 0:_orgInfo$brand_config2.brand_color)||"",image_url:((_orgInfo$brand_config3=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config3.launcher_logo_url)||"",chat_interface_config:{chat_bubble_prompts:[],display_name:((_orgInfo$brand_config4=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config4.display_name)||"",welcome_message:((_orgInfo$brand_config5=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config5.welcome_message)||"Hey! What can we help you with today?",redirect_url:((_orgInfo$brand_config6=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config6.redirect_url)||""},interface_properties:{position:((_orgInfo$brand_config7=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config8=_orgInfo$brand_config7.interface_properties)==null?void 0:_orgInfo$brand_config8.position)||WidgetPositionEnums.RIGHT,side_spacing:(_orgInfo$brand_config9=(_orgInfo$brand_config10=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config11=_orgInfo$brand_config10.interface_properties)==null?void 0:_orgInfo$brand_config11.side_spacing)!=null?_orgInfo$brand_config9:20,bottom_spacing:(_orgInfo$brand_config12=(_orgInfo$brand_config13=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config14=_orgInfo$brand_config13.interface_properties)==null?void 0:_orgInfo$brand_config14.bottom_spacing)!=null?_orgInfo$brand_config12:20},interface_type:((_orgInfo$brand_config15=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config15.interface_type)||ChatbotInterfaceType.WIDGET,launcher_type:((_orgInfo$brand_config16=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config16.launcher_type)||LauncherType.IMAGE,launcher_properties:{text:((_orgInfo$brand_config17=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config18=_orgInfo$brand_config17.launcher_properties)==null?void 0:_orgInfo$brand_config18.text)||""},images:{launcher_image_url:{url:((_orgInfo$brand_config19=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config20=_orgInfo$brand_config19.images)==null?void 0:(_orgInfo$brand_config21=_orgInfo$brand_config20.launcher_image_url)==null?void 0:_orgInfo$brand_config21.url)||_constants.DEFAULT_LAUNCHER_IMAGE}},chat_iframe_url:((_orgInfo$brand_config22=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config22.chat_iframe_url)||""};setChatbotConfig(config);}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to fetch chatbot configuration"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.NETWORK_ERROR,context:{api_key:api_key,user_id:user_id}});}finally{setLoading(false);}});return function fetchChatbotConfig(){return _ref4.apply(this,arguments);};}();if(api_key&&effectiveUserId){fetchChatbotConfig();}},[api_key,effectiveUserId,user_token]);function constructUrl(){if(!effectiveUserId)return"";var params=new URLSearchParams({id:api_key});return`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;}var openWebView=(0,_react.useCallback)(function(){if(isWebViewVisibleRef.current)return;isWebViewVisibleRef.current=true;setIsWebViewVisible(true);if(enableAnimation){(0,_animations.animateWebViewOpen)(animatedValues,function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{requestAnimationFrame(function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}},[enableAnimation,animatedValues,externalOnOpen,emitEvent]);var closeWebView=(0,_react.useCallback)(function(){if(webViewRef.current){webViewRef.current.postMessage(JSON.stringify({name:"closeFrame",domain:"app-domain.com"}));}if(enableAnimation){(0,_animations.animateWebViewClose)(animatedValues,function(){isWebViewVisibleRef.current=false;setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);});}else{isWebViewVisibleRef.current=false;setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);}},[enableAnimation,animatedValues,externalOnClose,emitEvent]);(0,_react.useEffect)(function(){if(show_floating_button&&chatbotConfig){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_LOADED);}},[show_floating_button,chatbotConfig,emitEvent]);(0,_react.useEffect)(function(){if(!loading&&chatbotConfig&&effectiveUserId&&!isInitialized){isInitializedRef.current=true;setIsInitialized(true);onReady==null?void 0:onReady();}},[loading,chatbotConfig,effectiveUserId,isInitialized,onReady]);var getScreenDimensions=function getScreenDimensions(){var windowHeight=_reactNative.Dimensions.get("window").height;var windowWidth=_reactNative.Dimensions.get("window").width;var statusBarHeight=_reactNative.Platform.OS==="ios"?0:_reactNative.StatusBar.currentHeight||0;return{height:windowHeight-statusBarHeight,width:windowWidth};};var requestAndroidMicPermission=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){try{if(_reactNative.Platform.OS==="ios"){return true;}var alreadyGranted=yield _reactNative.PermissionsAndroid.check(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO);if(alreadyGranted){return true;}var result=yield _reactNative.PermissionsAndroid.request(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,{title:"Microphone permission",message:"This app uses your microphone for voice features.",buttonPositive:"Allow",buttonNegative:"Deny"});var granted=result===_reactNative.PermissionsAndroid.RESULTS.GRANTED;if(!granted){_reactNative.Alert.alert("Microphone required","Voice features will not work unless you allow microphone access.");}return granted;}catch(err){console.warn("Error requesting mic permission",err);return false;}}),[]);var screenDimensions=getScreenDimensions();(0,_react.useEffect)(function(){if(__DEV__){(0,_debugConfig.enableNetworkDebug)();}},[]);var position=(chatbotConfig==null?void 0:(_chatbotConfig$interf=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf.position)||"Right";var sideSpacing=(_chatbotConfig$interf2=chatbotConfig==null?void 0:(_chatbotConfig$interf3=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf3.side_spacing)!=null?_chatbotConfig$interf2:20;var bottomSpacing=(_chatbotConfig$interf4=chatbotConfig==null?void 0:(_chatbotConfig$interf5=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf5.bottom_spacing)!=null?_chatbotConfig$interf4:20;return(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotSDK",children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles==null?void 0:styles.mainContainer,pointerEvents:isWebViewVisible?"auto":"box-none",children:[!loading&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"FloatingButton",children:show_floating_button&&api_key&&chatbotConfig&&(0,_jsxRuntime.jsx)(_FloatingButton.default,{chatbotConfig:chatbotConfig,isWebViewVisible:isWebViewVisible,onPress:function onPress(){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_CLICKED);openWebView();},brandColor:chatbotConfig.brand_colour,imageUrl:chatbotConfig.image_url})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.webViewWrapper,{height:isWebViewVisible?"100%":0}],pointerEvents:isWebViewVisible?"auto":"none",children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.fullScreenContainer,{opacity:animatedValues.opacity,transform:[{scale:animatedValues.scale},{translateY:animatedValues.translateY}]}],children:(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotWebView",children:(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,{mediaCapturePermissionGrantType:"grant",webviewDebuggingEnabled:true,ref:webViewRef,source:{uri:constructUrl()},onMessage:handleMessage,style:styles.webview,containerStyle:isFullScreen?{width:screenDimensions.width,height:screenDimensions.height-40}:undefined,allowsInlineMediaPlayback:true,mediaPlaybackRequiresUserAction:false,allowFileAccess:false,geolocationEnabled:false,javaScriptEnabled:true,domStorageEnabled:true,cacheEnabled:true,scrollEnabled:true,bounces:false,onShouldStartLoadWithRequest:function onShouldStartLoadWithRequest(request){return request.url.startsWith(_constants.BASE_CHATBOT_URL)||request.url.startsWith((chatbotConfig==null?void 0:chatbotConfig.chat_iframe_url)||"");},startInLoadingState:isFirstLoadRef.current,onLoadEnd:function onLoadEnd(){var _webViewRef$current8;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current8=webViewRef.current)==null?void 0:_webViewRef$current8.injectJavaScript(`
|
|
9
|
+
window.postMessage(${JSON.stringify(_messageData)}, '*');`);}break;default:if(onMessage)onMessage(parsedData!=null?parsedData:{});}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to parse WebView message"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{messageData:data}});}});return function(_x){return _ref2.apply(this,arguments);};}(),[emitEvent,emitSession,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){var userId=user_id?String(user_id):undefined;if(!userId){userId=memoryCache.current["rblyn_anon"];if(!userId){userId=(0,_cookieUtils.generateUUID)();executeStorageOp(function(){var _webViewRef$current6;(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref3.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current7;(_webViewRef$current7=webViewRef.current)==null?void 0:_webViewRef$current7.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl=`${_constants.API_URL}/chat/chatbot/get/`;var payload={client_user_id:effectiveUserId,resumable_session_id:resumeSessionRef.current||undefined,discrete:discreteRef.current?true:undefined,org_id:api_key,token:user_token,extra_info:{}};var response=yield fetch(endpointUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(payload)});if(!response.ok){throw new Error("Failed to fetch chatbot configuration");}var data=yield response.json();var orgInfo=data==null?void 0:(_data$user=data.user)==null?void 0:_data$user.org_info;if(orgInfo){var _orgInfo$brand_config,_orgInfo$brand_config2,_orgInfo$brand_config3,_orgInfo$brand_config4,_orgInfo$brand_config5,_orgInfo$brand_config6,_orgInfo$brand_config7,_orgInfo$brand_config8,_orgInfo$brand_config9,_orgInfo$brand_config10,_orgInfo$brand_config11,_orgInfo$brand_config12,_orgInfo$brand_config13,_orgInfo$brand_config14,_orgInfo$brand_config15,_orgInfo$brand_config16,_orgInfo$brand_config17,_orgInfo$brand_config18,_orgInfo$brand_config19,_orgInfo$brand_config20,_orgInfo$brand_config21,_orgInfo$brand_config22,_orgInfo$brand_config23,_orgInfo$brand_config24,_orgInfo$brand_config25,_orgInfo$brand_config26,_orgInfo$brand_config27,_orgInfo$brand_config28;var config={brand_colour:((_orgInfo$brand_config=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config2=_orgInfo$brand_config.colors)==null?void 0:_orgInfo$brand_config2.brand_color)||"",name:((_orgInfo$brand_config3=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config3.name)||"",image_url:((_orgInfo$brand_config4=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config4.launcher_logo_url)||"",chat_interface_config:{chat_bubble_prompts:[],display_name:((_orgInfo$brand_config5=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config5.display_name)||"",welcome_message:((_orgInfo$brand_config6=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config6.welcome_message)||"Hey! What can we help you with today?",redirect_url:((_orgInfo$brand_config7=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config7.redirect_url)||""},interface_properties:{position:((_orgInfo$brand_config8=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config9=_orgInfo$brand_config8.interface_properties)==null?void 0:_orgInfo$brand_config9.position)||WidgetPositionEnums.RIGHT,side_spacing:(_orgInfo$brand_config10=(_orgInfo$brand_config11=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config12=_orgInfo$brand_config11.interface_properties)==null?void 0:_orgInfo$brand_config12.side_spacing)!=null?_orgInfo$brand_config10:20,bottom_spacing:(_orgInfo$brand_config13=(_orgInfo$brand_config14=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config15=_orgInfo$brand_config14.interface_properties)==null?void 0:_orgInfo$brand_config15.bottom_spacing)!=null?_orgInfo$brand_config13:20},interface_type:((_orgInfo$brand_config16=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config16.interface_type)||ChatbotInterfaceType.WIDGET,launcher_type:((_orgInfo$brand_config17=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config17.launcher_type)||LauncherType.IMAGE,launcher_properties:{text:((_orgInfo$brand_config18=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config19=_orgInfo$brand_config18.launcher_properties)==null?void 0:_orgInfo$brand_config19.text)||""},images:{launcher_image_url:{url:((_orgInfo$brand_config20=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config21=_orgInfo$brand_config20.images)==null?void 0:(_orgInfo$brand_config22=_orgInfo$brand_config21.launcher_image_url)==null?void 0:_orgInfo$brand_config22.url)||_constants.DEFAULT_LAUNCHER_IMAGE},header_image_url:{url:((_orgInfo$brand_config23=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config24=_orgInfo$brand_config23.images)==null?void 0:(_orgInfo$brand_config25=_orgInfo$brand_config24.header_image_url)==null?void 0:_orgInfo$brand_config25.url)||""}},footer:{show_powered_by:(_orgInfo$brand_config26=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config27=_orgInfo$brand_config26.footer)==null?void 0:_orgInfo$brand_config27.show_powered_by},chat_iframe_url:((_orgInfo$brand_config28=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config28.chat_iframe_url)||""};setChatbotConfig(config);}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to fetch chatbot configuration"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.NETWORK_ERROR,context:{api_key:api_key,user_id:user_id}});}finally{setLoading(false);}});return function fetchChatbotConfig(){return _ref4.apply(this,arguments);};}();if(api_key&&effectiveUserId){fetchChatbotConfig();}},[api_key,effectiveUserId,user_token]);function constructUrl(){if(!effectiveUserId)return"";var params=new URLSearchParams({id:api_key});return`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;}var openWebView=(0,_react.useCallback)(function(){if(isWebViewVisibleRef.current)return;isWebViewVisibleRef.current=true;setIsWebViewVisible(true);if(enableAnimation){(0,_animations.animateWebViewOpen)(animatedValues,function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{requestAnimationFrame(function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}},[enableAnimation,animatedValues,externalOnOpen,emitEvent]);var closeWebView=(0,_react.useCallback)(function(){if(webViewRef.current){webViewRef.current.postMessage(JSON.stringify({name:"closeFrame",domain:"app-domain.com"}));}if(enableAnimation){(0,_animations.animateWebViewClose)(animatedValues,function(){isWebViewVisibleRef.current=false;setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);});}else{isWebViewVisibleRef.current=false;setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);}},[enableAnimation,animatedValues,externalOnClose,emitEvent]);(0,_react.useEffect)(function(){if(show_floating_button&&chatbotConfig){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_LOADED);}},[show_floating_button,chatbotConfig,emitEvent]);(0,_react.useEffect)(function(){if(!loading&&chatbotConfig&&effectiveUserId&&!isInitialized){isInitializedRef.current=true;setIsInitialized(true);onReady==null?void 0:onReady();}},[loading,chatbotConfig,effectiveUserId,isInitialized,onReady]);var getScreenDimensions=function getScreenDimensions(){var windowHeight=_reactNative.Dimensions.get("window").height;var windowWidth=_reactNative.Dimensions.get("window").width;var statusBarHeight=_reactNative.Platform.OS==="ios"?0:_reactNative.StatusBar.currentHeight||0;return{height:windowHeight-statusBarHeight,width:windowWidth};};var requestAndroidMicPermission=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){try{if(_reactNative.Platform.OS==="ios"){return true;}var alreadyGranted=yield _reactNative.PermissionsAndroid.check(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO);if(alreadyGranted){return true;}var result=yield _reactNative.PermissionsAndroid.request(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,{title:"Microphone permission",message:"This app uses your microphone for voice features.",buttonPositive:"Allow",buttonNegative:"Deny"});var granted=result===_reactNative.PermissionsAndroid.RESULTS.GRANTED;if(!granted){_reactNative.Alert.alert("Microphone required","Voice features will not work unless you allow microphone access.");}return granted;}catch(err){console.warn("Error requesting mic permission",err);return false;}}),[]);var screenDimensions=getScreenDimensions();(0,_react.useEffect)(function(){if(__DEV__){(0,_debugConfig.enableNetworkDebug)();}},[]);var position=(chatbotConfig==null?void 0:(_chatbotConfig$interf=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf.position)||"Right";var sideSpacing=(_chatbotConfig$interf2=chatbotConfig==null?void 0:(_chatbotConfig$interf3=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf3.side_spacing)!=null?_chatbotConfig$interf2:20;var bottomSpacing=(_chatbotConfig$interf4=chatbotConfig==null?void 0:(_chatbotConfig$interf5=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf5.bottom_spacing)!=null?_chatbotConfig$interf4:20;return(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotSDK",children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles==null?void 0:styles.mainContainer,pointerEvents:isWebViewVisible?"auto":"box-none",children:[!loading&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"FloatingButton",children:show_floating_button&&api_key&&chatbotConfig&&(0,_jsxRuntime.jsx)(_FloatingButton.default,{chatbotConfig:chatbotConfig,isWebViewVisible:isWebViewVisible,onPress:function onPress(){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_CLICKED);openWebView();},brandColor:chatbotConfig.brand_colour,imageUrl:chatbotConfig.image_url})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.webViewWrapper,{height:isWebViewVisible?"100%":0}],pointerEvents:isWebViewVisible?"auto":"none",children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.fullScreenContainer,{opacity:animatedValues.opacity,transform:[{scale:animatedValues.scale},{translateY:animatedValues.translateY}]}],children:(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotWebView",children:(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,{mediaCapturePermissionGrantType:"grant",webviewDebuggingEnabled:true,ref:webViewRef,source:{uri:constructUrl()},onMessage:handleMessage,style:styles.webview,containerStyle:isFullScreen?{width:screenDimensions.width,height:screenDimensions.height-40}:undefined,allowsInlineMediaPlayback:true,mediaPlaybackRequiresUserAction:false,allowFileAccess:false,geolocationEnabled:false,javaScriptEnabled:true,domStorageEnabled:true,cacheEnabled:true,scrollEnabled:true,bounces:false,onShouldStartLoadWithRequest:function onShouldStartLoadWithRequest(request){return request.url.startsWith(_constants.BASE_CHATBOT_URL)||request.url.startsWith((chatbotConfig==null?void 0:chatbotConfig.chat_iframe_url)||"");},startInLoadingState:isFirstLoadRef.current,onLoadEnd:function onLoadEnd(){var _webViewRef$current8;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current8=webViewRef.current)==null?void 0:_webViewRef$current8.injectJavaScript(`
|
|
10
10
|
if (!document.querySelector('meta[name="viewport"]')) {
|
|
11
11
|
var meta = document.createElement('meta');
|
|
12
12
|
meta.name = 'viewport';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_animations","_fileDownload","_session","_jsxRuntime","_this","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ChatbotInterfaceType","exports","WidgetPositionEnums","LauncherType","Chatbot","forwardRef","_ref","ref","_chatbotConfig$interf","_chatbotConfig$interf2","_chatbotConfig$interf3","_chatbotConfig$interf4","_chatbotConfig$interf5","api_key","user_id","user_token","_ref$show_floating_bu","show_floating_button","onEvent","onMessage","_ref$isFullScreen","isFullScreen","_ref$enableAnimation","enableAnimation","externalOnOpen","onOpen","externalOnClose","onClose","onReady","user_profile","session_id","session_context","_ref$discrete","discrete","onSession","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","_useState7","_useState8","isInitialized","setIsInitialized","webViewRef","useRef","isFirstLoadRef","_useState9","_useState10","toastVisible","setToastVisible","_useState11","_useState12","toastMessage","setToastMessage","_useState13","_useState14","effectiveUserId","setEffectiveUserId","_useState15","_useState16","isStorageReady","setIsStorageReady","pendingStorageOps","memoryCache","_useState17","os","browser","_useState18","systemInfo","setSystemInfo","systemInfoRef","isInitializedRef","isWebViewVisibleRef","sessionIdRef","undefined","onSessionRef","sessionContextRef","resumeSessionRef","discreteRef","current","animatedValues","scale","Animated","Value","translateY","opacity","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","useImperativeHandle","open","openWebView","close","closeWebView","toggle","isReady","getSessionId","emitSession","useCallback","data","sessionId","extractSessionId","_sessionContextRef$cu","error","errorTracker","trackError","Error","type","ErrorTypes","RUNTIME_ERROR","context","source","SESSION_UPDATED_MESSAGE_TYPE","triggerAppInit","_webViewRef$current","injectJavaScript","getBrowserAndOSInfoScript","executeStorageOp","operation","push","handleMessage","_ref2","_asyncToGenerator2","event","_webViewRef$current2","nativeEvent","parsedData","JSON","parse","values","StorageMessageType","includes","storageMessage","STORAGE_READY","forEach","op","createStorageMessage","GET_STORAGE","STORAGE_RESPONSE","key","value","STORAGE_ERROR","logger","__DEV__","console","log","level","_parsedData$data","ChatbotEventType","CHATBOT_APP_READY","_webViewRef$current3","_webViewRef$current4","messageData","name","action","_defineProperty2","RESUME_SESSION_KEY","assign","getSystemInfo","__INT_SYS_INFO__","debug","stringify","domain","url","filename","downloadData","inPlace","handleDownloadRequest","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","granted","requestAndroidMicPermission","_webViewRef$current5","_x","apply","arguments","useEffect","initializeUserId","_ref3","String","generateUUID","_webViewRef$current6","SET_STORAGE","getStorageScript","_webViewRef$current7","fetchChatbotConfig","_ref4","_data$user","endpointUrl","API_URL","payload","client_user_id","resumable_session_id","org_id","token","extra_info","response","fetch","method","headers","body","ok","json","orgInfo","user","org_info","_orgInfo$brand_config","_orgInfo$brand_config2","_orgInfo$brand_config3","_orgInfo$brand_config4","_orgInfo$brand_config5","_orgInfo$brand_config6","_orgInfo$brand_config7","_orgInfo$brand_config8","_orgInfo$brand_config9","_orgInfo$brand_config10","_orgInfo$brand_config11","_orgInfo$brand_config12","_orgInfo$brand_config13","_orgInfo$brand_config14","_orgInfo$brand_config15","_orgInfo$brand_config16","_orgInfo$brand_config17","_orgInfo$brand_config18","_orgInfo$brand_config19","_orgInfo$brand_config20","_orgInfo$brand_config21","_orgInfo$brand_config22","config","brand_colour","brand_config","colors","brand_color","image_url","launcher_logo_url","chat_interface_config","chat_bubble_prompts","display_name","welcome_message","redirect_url","interface_properties","position","RIGHT","side_spacing","bottom_spacing","interface_type","WIDGET","launcher_type","IMAGE","launcher_properties","text","images","launcher_image_url","DEFAULT_LAUNCHER_IMAGE","chat_iframe_url","NETWORK_ERROR","constructUrl","params","URLSearchParams","id","BASE_CHATBOT_URL","toString","animateWebViewOpen","CHATBOT_OPENED","setTimeout","requestAnimationFrame","postMessage","animateWebViewClose","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","alreadyGranted","PermissionsAndroid","check","PERMISSIONS","RECORD_AUDIO","result","request","title","message","buttonPositive","buttonNegative","RESULTS","GRANTED","Alert","alert","err","warn","screenDimensions","enableNetworkDebug","sideSpacing","bottomSpacing","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","pointerEvents","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","webViewWrapper","fullScreenContainer","transform","WebView","mediaCapturePermissionGrantType","webviewDebuggingEnabled","uri","webview","containerStyle","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current8","enableWebViewDebug","onError","syntheticEvent","description","code","displayName","StyleSheet","create","flex","overflow","top","left","right","bottom","zIndex","backgroundColor","inlineContainer","_default"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"6gBAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WASA,IAAAC,YAAA,CAAAD,OAAA,iBAYA,IAAAE,mBAAA,CAAAF,OAAA,yBACA,IAAAG,eAAA,CAAAC,sBAAA,CAAAJ,OAAA,sBACA,IAAAK,UAAA,CAAAL,OAAA,gBACA,IAAAM,WAAA,CAAAN,OAAA,uBACA,IAAAO,kBAAA,CAAAP,OAAA,6BACA,IAAAQ,OAAA,CAAAR,OAAA,mBAKA,IAAAS,OAAA,CAAAT,OAAA,mBACA,IAAAU,YAAA,CAAAV,OAAA,wBACA,IAAAW,YAAA,CAAAP,sBAAA,CAAAJ,OAAA,8BACA,IAAAY,cAAA,CAAAZ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,CACPO,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KACV,CACF,CAAC,CAAC,CAAC,IAAAG,QAAA,CAAArX,OAAA,CAAAX,OAAA,CAEYc,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_animations","_fileDownload","_session","_jsxRuntime","_this","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ChatbotInterfaceType","exports","WidgetPositionEnums","LauncherType","Chatbot","forwardRef","_ref","ref","_chatbotConfig$interf","_chatbotConfig$interf2","_chatbotConfig$interf3","_chatbotConfig$interf4","_chatbotConfig$interf5","api_key","user_id","user_token","_ref$show_floating_bu","show_floating_button","onEvent","onMessage","_ref$isFullScreen","isFullScreen","_ref$enableAnimation","enableAnimation","externalOnOpen","onOpen","externalOnClose","onClose","onReady","user_profile","session_id","session_context","_ref$discrete","discrete","onSession","loading_screen","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","_useState7","_useState8","isInitialized","setIsInitialized","webViewRef","useRef","isFirstLoadRef","_useState9","_useState10","toastVisible","setToastVisible","_useState11","_useState12","toastMessage","setToastMessage","_useState13","_useState14","effectiveUserId","setEffectiveUserId","_useState15","_useState16","isStorageReady","setIsStorageReady","pendingStorageOps","memoryCache","_useState17","os","browser","_useState18","systemInfo","setSystemInfo","systemInfoRef","isInitializedRef","isWebViewVisibleRef","sessionIdRef","undefined","onSessionRef","sessionContextRef","resumeSessionRef","discreteRef","loadingScreenRef","current","chatbotConfigRef","hasSentInitLoadRef","animatedValues","scale","Animated","Value","translateY","opacity","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","useImperativeHandle","open","openWebView","close","closeWebView","toggle","isReady","getSessionId","emitSession","useCallback","data","sessionId","extractSessionId","_sessionContextRef$cu","error","errorTracker","trackError","Error","type","ErrorTypes","RUNTIME_ERROR","context","source","SESSION_UPDATED_MESSAGE_TYPE","triggerAppInit","_webViewRef$current","injectJavaScript","getBrowserAndOSInfoScript","executeStorageOp","operation","push","handleMessage","_ref2","_asyncToGenerator2","event","_webViewRef$current2","nativeEvent","parsedData","JSON","parse","values","StorageMessageType","includes","storageMessage","STORAGE_READY","forEach","op","createStorageMessage","GET_STORAGE","STORAGE_RESPONSE","key","value","STORAGE_ERROR","logger","__DEV__","console","log","level","_parsedData$data","ChatbotEventType","CHATBOT_APP_READY","_webViewRef$current3","_loadingScreen$image","_brandConfig$images","_brandConfig$images$h","_loadingScreen$bot_na","_loadingScreen$brand_","_loadingScreen$powere","_brandConfig$footer","_webViewRef$current4","brandConfig","loadingScreen","hint","addHint","image","images","header_image_url","url","image_url","bot_name","name","brand_color","brand_colour","powered_by","footer","show_powered_by","sub_text","initLoadHint","keys","length","messageData","action","assign","_defineProperty2","RESUME_SESSION_KEY","getSystemInfo","__INT_SYS_INFO__","debug","stringify","domain","filename","downloadData","inPlace","handleDownloadRequest","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","granted","requestAndroidMicPermission","_webViewRef$current5","_x","apply","arguments","useEffect","initializeUserId","_ref3","String","generateUUID","_webViewRef$current6","SET_STORAGE","getStorageScript","_webViewRef$current7","fetchChatbotConfig","_ref4","_data$user","endpointUrl","API_URL","payload","client_user_id","resumable_session_id","org_id","token","extra_info","response","fetch","method","headers","body","ok","json","orgInfo","user","org_info","_orgInfo$brand_config","_orgInfo$brand_config2","_orgInfo$brand_config3","_orgInfo$brand_config4","_orgInfo$brand_config5","_orgInfo$brand_config6","_orgInfo$brand_config7","_orgInfo$brand_config8","_orgInfo$brand_config9","_orgInfo$brand_config10","_orgInfo$brand_config11","_orgInfo$brand_config12","_orgInfo$brand_config13","_orgInfo$brand_config14","_orgInfo$brand_config15","_orgInfo$brand_config16","_orgInfo$brand_config17","_orgInfo$brand_config18","_orgInfo$brand_config19","_orgInfo$brand_config20","_orgInfo$brand_config21","_orgInfo$brand_config22","_orgInfo$brand_config23","_orgInfo$brand_config24","_orgInfo$brand_config25","_orgInfo$brand_config26","_orgInfo$brand_config27","_orgInfo$brand_config28","config","brand_config","colors","launcher_logo_url","chat_interface_config","chat_bubble_prompts","display_name","welcome_message","redirect_url","interface_properties","position","RIGHT","side_spacing","bottom_spacing","interface_type","WIDGET","launcher_type","IMAGE","launcher_properties","text","launcher_image_url","DEFAULT_LAUNCHER_IMAGE","chat_iframe_url","NETWORK_ERROR","constructUrl","params","URLSearchParams","id","BASE_CHATBOT_URL","toString","animateWebViewOpen","CHATBOT_OPENED","setTimeout","requestAnimationFrame","postMessage","animateWebViewClose","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","alreadyGranted","PermissionsAndroid","check","PERMISSIONS","RECORD_AUDIO","result","request","title","message","buttonPositive","buttonNegative","RESULTS","GRANTED","Alert","alert","err","warn","screenDimensions","enableNetworkDebug","sideSpacing","bottomSpacing","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","pointerEvents","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","webViewWrapper","fullScreenContainer","transform","WebView","mediaCapturePermissionGrantType","webviewDebuggingEnabled","uri","webview","containerStyle","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current8","enableWebViewDebug","onError","syntheticEvent","description","code","displayName","StyleSheet","create","flex","overflow","top","left","right","bottom","zIndex","backgroundColor","inlineContainer","_default"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"6gBAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WASA,IAAAC,YAAA,CAAAD,OAAA,iBAYA,IAAAE,mBAAA,CAAAF,OAAA,yBACA,IAAAG,eAAA,CAAAC,sBAAA,CAAAJ,OAAA,sBACA,IAAAK,UAAA,CAAAL,OAAA,gBACA,IAAAM,WAAA,CAAAN,OAAA,uBACA,IAAAO,kBAAA,CAAAP,OAAA,6BACA,IAAAQ,OAAA,CAAAR,OAAA,mBAKA,IAAAS,OAAA,CAAAT,OAAA,mBACA,IAAAU,YAAA,CAAAV,OAAA,wBACA,IAAAW,YAAA,CAAAP,sBAAA,CAAAJ,OAAA,8BACA,IAAAY,cAAA,CAAAZ,OAAA,+BACA,IAAAa,eAAA,CAAAb,OAAA,+BAMA,IAAAc,qBAAA,CAAAd,OAAA,oCACA,IAAAe,YAAA,CAAAf,OAAA,wBACA,IAAAgB,eAAA,CAAAhB,OAAA,2BAMA,IAAAiB,WAAA,CAAAjB,OAAA,uBACA,IAAAkB,aAAA,CAAAlB,OAAA,yBACA,IAAAmB,QAAA,CAAAnB,OAAA,oBAIyB,IAAAoB,WAAA,CAAApB,OAAA,0BAAAqB,KAAA,MAAAC,YAAA,+GAAAvB,wBAAAwB,CAAA,CAAAC,CAAA,wBAAAC,OAAA,KAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAA1B,uBAAA,UAAAA,wBAAAwB,CAAA,CAAAC,CAAA,MAAAA,CAAA,EAAAD,CAAA,EAAAA,CAAA,CAAAK,UAAA,QAAAL,CAAA,KAAAM,CAAA,CAAAC,CAAA,CAAAC,CAAA,EAAAC,SAAA,MAAAC,OAAA,CAAAV,CAAA,YAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CA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AAQ,CAAE,SACZ,CAAC,CACDhC,cAAc,CAAE,CACd3E,QAAQ,CAAE,UAAU,CACpB4G,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTJ,QAAQ,CAAE,SAAS,CACnBK,MAAM,CAAE,KAAK,CACbC,eAAe,CAAE,SACnB,CAAC,CACDrC,mBAAmB,CAAE,CACnB5E,QAAQ,CAAE,UAAU,CACpB4G,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTE,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KAAK,CACbL,QAAQ,CAAE,SAEZ,CAAC,CACDO,eAAe,CAAE,CACfR,IAAI,CAAE,CAAC,CACPO,eAAe,CAAE,OACnB,CAAC,CACD/B,OAAO,CAAE,CACPwB,IAAI,CAAE,CAAC,CACPO,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KACV,CACF,CAAC,CAAC,CAAC,IAAAG,QAAA,CAAApZ,OAAA,CAAAX,OAAA,CAEYc,OAAO","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.2.1-staging.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.2.1-staging.1';
|
|
2
2
|
//# sourceMappingURL=version.staging.js.map
|
package/lib/module/Chatbotsdk.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.WidgetPositionEnums=exports.LauncherType=exports.ChatbotInterfaceType=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeWebview=require("react-native-webview");var _FloatingButton=_interopRequireDefault(require("./FloatingButton"));var _constants=require("./constants");var _systemInfo=require("./utils/systemInfo");var _useChatbotEvents2=require("./hooks/useChatbotEvents");var _events=require("./types/events");var _logger=require("./utils/logger");var _debugConfig=require("./utils/debugConfig");var _DebugButton=_interopRequireDefault(require("./components/DebugButton"));var _ErrorBoundary=require("./components/ErrorBoundary");var _errorConstants=require("./constants/errorConstants");var _ErrorTrackingService=require("./services/ErrorTrackingService");var _cookieUtils=require("./utils/cookieUtils");var _webViewStorage=require("./utils/webViewStorage");var _animations=require("./utils/animations");var _fileDownload=require("./utils/fileDownload");var _session=require("./utils/session");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/professional/Mobile sdks/robylon-react-native-sdk/src/Chatbotsdk.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var ChatbotInterfaceType=exports.ChatbotInterfaceType=function(ChatbotInterfaceType){ChatbotInterfaceType["WIDGET"]="WIDGET";ChatbotInterfaceType["POPOVER"]="POPOVER";ChatbotInterfaceType["EMBED"]="EMBED";return ChatbotInterfaceType;}({});var WidgetPositionEnums=exports.WidgetPositionEnums=function(WidgetPositionEnums){WidgetPositionEnums["RIGHT"]="Right";WidgetPositionEnums["LEFT"]="Left";return WidgetPositionEnums;}({});var LauncherType=exports.LauncherType=function(LauncherType){LauncherType["TEXT"]="TEXT";LauncherType["IMAGE"]="IMAGE";LauncherType["TEXTUAL_IMAGE"]="TEXTUAL_IMAGE";return LauncherType;}({});var Chatbot=(0,_react.forwardRef)(function(_ref,ref){var _chatbotConfig$interf,_chatbotConfig$interf2,_chatbotConfig$interf3,_chatbotConfig$interf4,_chatbotConfig$interf5;var api_key=_ref.api_key,user_id=_ref.user_id,user_token=_ref.user_token,_ref$show_floating_bu=_ref.show_floating_button,show_floating_button=_ref$show_floating_bu===void 0?true:_ref$show_floating_bu,onEvent=_ref.onEvent,onMessage=_ref.onMessage,_ref$isFullScreen=_ref.isFullScreen,isFullScreen=_ref$isFullScreen===void 0?true:_ref$isFullScreen,_ref$enableAnimation=_ref.enableAnimation,enableAnimation=_ref$enableAnimation===void 0?true:_ref$enableAnimation,externalOnOpen=_ref.onOpen,externalOnClose=_ref.onClose,onReady=_ref.onReady,user_profile=_ref.user_profile,session_id=_ref.session_id,session_context=_ref.session_context,_ref$discrete=_ref.discrete,discrete=_ref$discrete===void 0?false:_ref$discrete,onSession=_ref.onSession;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isWebViewVisible=_useState2[0],setIsWebViewVisible=_useState2[1];var _useState3=(0,_react.useState)(null),_useState4=(0,_slicedToArray2.default)(_useState3,2),chatbotConfig=_useState4[0],setChatbotConfig=_useState4[1];var _useState5=(0,_react.useState)(true),_useState6=(0,_slicedToArray2.default)(_useState5,2),loading=_useState6[0],setLoading=_useState6[1];var _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),isInitialized=_useState8[0],setIsInitialized=_useState8[1];var webViewRef=(0,_react.useRef)(null);var isFirstLoadRef=(0,_react.useRef)(true);var _useState9=(0,_react.useState)(false),_useState10=(0,_slicedToArray2.default)(_useState9,2),toastVisible=_useState10[0],setToastVisible=_useState10[1];var _useState11=(0,_react.useState)(""),_useState12=(0,_slicedToArray2.default)(_useState11,2),toastMessage=_useState12[0],setToastMessage=_useState12[1];var _useState13=(0,_react.useState)(),_useState14=(0,_slicedToArray2.default)(_useState13,2),effectiveUserId=_useState14[0],setEffectiveUserId=_useState14[1];var _useState15=(0,_react.useState)(false),_useState16=(0,_slicedToArray2.default)(_useState15,2),isStorageReady=_useState16[0],setIsStorageReady=_useState16[1];var pendingStorageOps=(0,_react.useRef)([]);var memoryCache=(0,_react.useRef)({});var _useState17=(0,_react.useState)({os:"",browser:""}),_useState18=(0,_slicedToArray2.default)(_useState17,2),systemInfo=_useState18[0],setSystemInfo=_useState18[1];var systemInfoRef=(0,_react.useRef)({os:"",browser:""});var isInitializedRef=(0,_react.useRef)(false);var isWebViewVisibleRef=(0,_react.useRef)(false);var sessionIdRef=(0,_react.useRef)(undefined);var onSessionRef=(0,_react.useRef)(onSession);var sessionContextRef=(0,_react.useRef)(session_context);var resumeSessionRef=(0,_react.useRef)(session_id);var discreteRef=(0,_react.useRef)(discrete);onSessionRef.current=onSession;sessionContextRef.current=session_context;resumeSessionRef.current=session_id;discreteRef.current=discrete;var animatedValues=(0,_react.useRef)({scale:new _reactNative.Animated.Value(1),translateY:new _reactNative.Animated.Value(0),opacity:new _reactNative.Animated.Value(1)}).current;var chatbotConfigForEvents=(0,_react.useMemo)(function(){return{userId:effectiveUserId,isAnonymous:!user_id&&user_id!==0};},[effectiveUserId,user_id]);var _useChatbotEvents=(0,_useChatbotEvents2.useChatbotEvents)({api_key:api_key,chatbotConfig:chatbotConfigForEvents!=null?chatbotConfigForEvents:{},user_profile:user_profile,onEvent:onEvent,systemInfo:systemInfo!=null?systemInfo:{os:"",browser:""}}),emitEvent=_useChatbotEvents.emitEvent,onInternalEvent=_useChatbotEvents.onInternalEvent;(0,_react.useImperativeHandle)(ref,function(){return{open:function open(){if(isInitializedRef.current){openWebView();}},close:function close(){if(isInitializedRef.current){closeWebView();}},toggle:function toggle(){if(isInitializedRef.current){if(isWebViewVisibleRef.current){closeWebView();}else{openWebView();}}},isReady:function isReady(){return isInitializedRef.current;},getSessionId:function getSessionId(){return sessionIdRef.current;}};},[isInitialized,isWebViewVisible]);var emitSession=(0,_react.useCallback)(function(data){var sessionId=(0,_session.extractSessionId)(data);if(!sessionId||sessionId===sessionIdRef.current)return;sessionIdRef.current=sessionId;try{var _sessionContextRef$cu;onSessionRef.current==null?void 0:onSessionRef.current(sessionId,(_sessionContextRef$cu=sessionContextRef.current)!=null?_sessionContextRef$cu:{});}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("onSession handler threw an error"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{source:_session.SESSION_UPDATED_MESSAGE_TYPE}});}},[]);var triggerAppInit=function triggerAppInit(){if(webViewRef.current){var _webViewRef$current;(_webViewRef$current=webViewRef.current)==null?void 0:_webViewRef$current.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());webViewRef.current.injectJavaScript(`
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.WidgetPositionEnums=exports.LauncherType=exports.ChatbotInterfaceType=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeWebview=require("react-native-webview");var _FloatingButton=_interopRequireDefault(require("./FloatingButton"));var _constants=require("./constants");var _systemInfo=require("./utils/systemInfo");var _useChatbotEvents2=require("./hooks/useChatbotEvents");var _events=require("./types/events");var _logger=require("./utils/logger");var _debugConfig=require("./utils/debugConfig");var _DebugButton=_interopRequireDefault(require("./components/DebugButton"));var _ErrorBoundary=require("./components/ErrorBoundary");var _errorConstants=require("./constants/errorConstants");var _ErrorTrackingService=require("./services/ErrorTrackingService");var _cookieUtils=require("./utils/cookieUtils");var _webViewStorage=require("./utils/webViewStorage");var _animations=require("./utils/animations");var _fileDownload=require("./utils/fileDownload");var _session=require("./utils/session");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/professional/Mobile sdks/robylon-react-native-sdk/src/Chatbotsdk.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var ChatbotInterfaceType=exports.ChatbotInterfaceType=function(ChatbotInterfaceType){ChatbotInterfaceType["WIDGET"]="WIDGET";ChatbotInterfaceType["POPOVER"]="POPOVER";ChatbotInterfaceType["EMBED"]="EMBED";return ChatbotInterfaceType;}({});var WidgetPositionEnums=exports.WidgetPositionEnums=function(WidgetPositionEnums){WidgetPositionEnums["RIGHT"]="Right";WidgetPositionEnums["LEFT"]="Left";return WidgetPositionEnums;}({});var LauncherType=exports.LauncherType=function(LauncherType){LauncherType["TEXT"]="TEXT";LauncherType["IMAGE"]="IMAGE";LauncherType["TEXTUAL_IMAGE"]="TEXTUAL_IMAGE";return LauncherType;}({});var Chatbot=(0,_react.forwardRef)(function(_ref,ref){var _chatbotConfig$interf,_chatbotConfig$interf2,_chatbotConfig$interf3,_chatbotConfig$interf4,_chatbotConfig$interf5;var api_key=_ref.api_key,user_id=_ref.user_id,user_token=_ref.user_token,_ref$show_floating_bu=_ref.show_floating_button,show_floating_button=_ref$show_floating_bu===void 0?true:_ref$show_floating_bu,onEvent=_ref.onEvent,onMessage=_ref.onMessage,_ref$isFullScreen=_ref.isFullScreen,isFullScreen=_ref$isFullScreen===void 0?true:_ref$isFullScreen,_ref$enableAnimation=_ref.enableAnimation,enableAnimation=_ref$enableAnimation===void 0?true:_ref$enableAnimation,externalOnOpen=_ref.onOpen,externalOnClose=_ref.onClose,onReady=_ref.onReady,user_profile=_ref.user_profile,session_id=_ref.session_id,session_context=_ref.session_context,_ref$discrete=_ref.discrete,discrete=_ref$discrete===void 0?false:_ref$discrete,onSession=_ref.onSession,loading_screen=_ref.loading_screen;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isWebViewVisible=_useState2[0],setIsWebViewVisible=_useState2[1];var _useState3=(0,_react.useState)(null),_useState4=(0,_slicedToArray2.default)(_useState3,2),chatbotConfig=_useState4[0],setChatbotConfig=_useState4[1];var _useState5=(0,_react.useState)(true),_useState6=(0,_slicedToArray2.default)(_useState5,2),loading=_useState6[0],setLoading=_useState6[1];var _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),isInitialized=_useState8[0],setIsInitialized=_useState8[1];var webViewRef=(0,_react.useRef)(null);var isFirstLoadRef=(0,_react.useRef)(true);var _useState9=(0,_react.useState)(false),_useState10=(0,_slicedToArray2.default)(_useState9,2),toastVisible=_useState10[0],setToastVisible=_useState10[1];var _useState11=(0,_react.useState)(""),_useState12=(0,_slicedToArray2.default)(_useState11,2),toastMessage=_useState12[0],setToastMessage=_useState12[1];var _useState13=(0,_react.useState)(),_useState14=(0,_slicedToArray2.default)(_useState13,2),effectiveUserId=_useState14[0],setEffectiveUserId=_useState14[1];var _useState15=(0,_react.useState)(false),_useState16=(0,_slicedToArray2.default)(_useState15,2),isStorageReady=_useState16[0],setIsStorageReady=_useState16[1];var pendingStorageOps=(0,_react.useRef)([]);var memoryCache=(0,_react.useRef)({});var _useState17=(0,_react.useState)({os:"",browser:""}),_useState18=(0,_slicedToArray2.default)(_useState17,2),systemInfo=_useState18[0],setSystemInfo=_useState18[1];var systemInfoRef=(0,_react.useRef)({os:"",browser:""});var isInitializedRef=(0,_react.useRef)(false);var isWebViewVisibleRef=(0,_react.useRef)(false);var sessionIdRef=(0,_react.useRef)(undefined);var onSessionRef=(0,_react.useRef)(onSession);var sessionContextRef=(0,_react.useRef)(session_context);var resumeSessionRef=(0,_react.useRef)(session_id);var discreteRef=(0,_react.useRef)(discrete);var loadingScreenRef=(0,_react.useRef)(loading_screen);onSessionRef.current=onSession;sessionContextRef.current=session_context;resumeSessionRef.current=session_id;discreteRef.current=discrete;loadingScreenRef.current=loading_screen;var chatbotConfigRef=(0,_react.useRef)(null);chatbotConfigRef.current=chatbotConfig;var hasSentInitLoadRef=(0,_react.useRef)(false);var animatedValues=(0,_react.useRef)({scale:new _reactNative.Animated.Value(1),translateY:new _reactNative.Animated.Value(0),opacity:new _reactNative.Animated.Value(1)}).current;var chatbotConfigForEvents=(0,_react.useMemo)(function(){return{userId:effectiveUserId,isAnonymous:!user_id&&user_id!==0};},[effectiveUserId,user_id]);var _useChatbotEvents=(0,_useChatbotEvents2.useChatbotEvents)({api_key:api_key,chatbotConfig:chatbotConfigForEvents!=null?chatbotConfigForEvents:{},user_profile:user_profile,onEvent:onEvent,systemInfo:systemInfo!=null?systemInfo:{os:"",browser:""}}),emitEvent=_useChatbotEvents.emitEvent,onInternalEvent=_useChatbotEvents.onInternalEvent;(0,_react.useImperativeHandle)(ref,function(){return{open:function open(){if(isInitializedRef.current){openWebView();}},close:function close(){if(isInitializedRef.current){closeWebView();}},toggle:function toggle(){if(isInitializedRef.current){if(isWebViewVisibleRef.current){closeWebView();}else{openWebView();}}},isReady:function isReady(){return isInitializedRef.current;},getSessionId:function getSessionId(){return sessionIdRef.current;}};},[isInitialized,isWebViewVisible]);var emitSession=(0,_react.useCallback)(function(data){var sessionId=(0,_session.extractSessionId)(data);if(!sessionId||sessionId===sessionIdRef.current)return;sessionIdRef.current=sessionId;try{var _sessionContextRef$cu;onSessionRef.current==null?void 0:onSessionRef.current(sessionId,(_sessionContextRef$cu=sessionContextRef.current)!=null?_sessionContextRef$cu:{});}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("onSession handler threw an error"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{source:_session.SESSION_UPDATED_MESSAGE_TYPE}});}},[]);var triggerAppInit=function triggerAppInit(){if(webViewRef.current){var _webViewRef$current;(_webViewRef$current=webViewRef.current)==null?void 0:_webViewRef$current.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());webViewRef.current.injectJavaScript(`
|
|
2
2
|
// Trigger APP_READY equivalent
|
|
3
3
|
window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'APP_READY' }));
|
|
4
4
|
true;
|
|
5
|
-
`);}};var executeStorageOp=(0,_react.useCallback)(function(operation){if(isStorageReady){operation();}else{pendingStorageOps.current.push(operation);}},[isStorageReady]);var handleMessage=(0,_react.useCallback)(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(event){var _webViewRef$current2;var data=event.nativeEvent.data;try{var parsedData=JSON.parse(data);if(Object.values(_webViewStorage.StorageMessageType).includes(parsedData.type)){var storageMessage=parsedData;switch(storageMessage.type){case _webViewStorage.StorageMessageType.STORAGE_READY:setIsStorageReady(true);pendingStorageOps.current.forEach(function(op){return op();});pendingStorageOps.current=[];(_webViewRef$current2=webViewRef.current)==null?void 0:_webViewRef$current2.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));break;case _webViewStorage.StorageMessageType.STORAGE_RESPONSE:if(storageMessage.key&&storageMessage.value){memoryCache.current[storageMessage.key]=storageMessage.value;if(storageMessage.key==="rblyn_anon"){setEffectiveUserId(storageMessage.value);}}break;case _webViewStorage.StorageMessageType.STORAGE_ERROR:_logger.logger.error("WebView storage error:",storageMessage.error);break;}return;}if(__DEV__){if((parsedData==null?void 0:parsedData.type)==="CONSOLE"){console.log(`WebView ${parsedData==null?void 0:parsedData.level}:`,parsedData==null?void 0:parsedData.data);return;}if((parsedData==null?void 0:parsedData.type)==="ERROR"){console.error("WebView Error:",parsedData==null?void 0:parsedData.data);return;}}if((parsedData==null?void 0:parsedData.type)==="SYSTEM_INFO"){var _parsedData$data;setSystemInfo((_parsedData$data=parsedData==null?void 0:parsedData.data)!=null?_parsedData$data:{os:"",browser:""});systemInfoRef.current=parsedData==null?void 0:parsedData.data;return;}if((parsedData==null?void 0:parsedData.type)===_session.SESSION_UPDATED_MESSAGE_TYPE){emitSession(parsedData==null?void 0:parsedData.data);return;}if((parsedData==null?void 0:parsedData.type)==="APP_READY"){emitEvent(_events.ChatbotEventType.CHATBOT_APP_READY);if(webViewRef.current&&isWebViewVisible){var _webViewRef$current3,_webViewRef$current4;(_webViewRef$current3=webViewRef.current)==null?void 0:_webViewRef$current3.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());var messageData={name:"registerUserId",action:"registerUserId",data:(0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)({
|
|
5
|
+
`);}};var executeStorageOp=(0,_react.useCallback)(function(operation){if(isStorageReady){operation();}else{pendingStorageOps.current.push(operation);}},[isStorageReady]);var handleMessage=(0,_react.useCallback)(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(event){var _webViewRef$current2;var data=event.nativeEvent.data;try{var parsedData=JSON.parse(data);if(Object.values(_webViewStorage.StorageMessageType).includes(parsedData.type)){var storageMessage=parsedData;switch(storageMessage.type){case _webViewStorage.StorageMessageType.STORAGE_READY:setIsStorageReady(true);pendingStorageOps.current.forEach(function(op){return op();});pendingStorageOps.current=[];(_webViewRef$current2=webViewRef.current)==null?void 0:_webViewRef$current2.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));break;case _webViewStorage.StorageMessageType.STORAGE_RESPONSE:if(storageMessage.key&&storageMessage.value){memoryCache.current[storageMessage.key]=storageMessage.value;if(storageMessage.key==="rblyn_anon"){setEffectiveUserId(storageMessage.value);}}break;case _webViewStorage.StorageMessageType.STORAGE_ERROR:_logger.logger.error("WebView storage error:",storageMessage.error);break;}return;}if(__DEV__){if((parsedData==null?void 0:parsedData.type)==="CONSOLE"){console.log(`WebView ${parsedData==null?void 0:parsedData.level}:`,parsedData==null?void 0:parsedData.data);return;}if((parsedData==null?void 0:parsedData.type)==="ERROR"){console.error("WebView Error:",parsedData==null?void 0:parsedData.data);return;}}if((parsedData==null?void 0:parsedData.type)==="SYSTEM_INFO"){var _parsedData$data;setSystemInfo((_parsedData$data=parsedData==null?void 0:parsedData.data)!=null?_parsedData$data:{os:"",browser:""});systemInfoRef.current=parsedData==null?void 0:parsedData.data;return;}if((parsedData==null?void 0:parsedData.type)===_session.SESSION_UPDATED_MESSAGE_TYPE){emitSession(parsedData==null?void 0:parsedData.data);return;}if((parsedData==null?void 0:parsedData.type)==="APP_READY"){emitEvent(_events.ChatbotEventType.CHATBOT_APP_READY);if(webViewRef.current&&isWebViewVisible){var _webViewRef$current3,_loadingScreen$image,_brandConfig$images,_brandConfig$images$h,_loadingScreen$bot_na,_loadingScreen$brand_,_loadingScreen$powere,_brandConfig$footer,_webViewRef$current4;(_webViewRef$current3=webViewRef.current)==null?void 0:_webViewRef$current3.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());var brandConfig=chatbotConfigRef.current;var loadingScreen=loadingScreenRef.current;var hint={};var addHint=function addHint(key,value){if(value!==undefined&&value!==""){hint[key]=value;}};addHint("init_load_image",(_loadingScreen$image=loadingScreen==null?void 0:loadingScreen.image)!=null?_loadingScreen$image:(brandConfig==null?void 0:(_brandConfig$images=brandConfig.images)==null?void 0:(_brandConfig$images$h=_brandConfig$images.header_image_url)==null?void 0:_brandConfig$images$h.url)||(brandConfig==null?void 0:brandConfig.image_url));addHint("init_load_bot_name",(_loadingScreen$bot_na=loadingScreen==null?void 0:loadingScreen.bot_name)!=null?_loadingScreen$bot_na:brandConfig==null?void 0:brandConfig.name);addHint("init_load_brand_color",(_loadingScreen$brand_=loadingScreen==null?void 0:loadingScreen.brand_color)!=null?_loadingScreen$brand_:brandConfig==null?void 0:brandConfig.brand_colour);addHint("init_load_powered_by",(_loadingScreen$powere=loadingScreen==null?void 0:loadingScreen.powered_by)!=null?_loadingScreen$powere:brandConfig==null?void 0:(_brandConfig$footer=brandConfig.footer)==null?void 0:_brandConfig$footer.show_powered_by);addHint("init_load_sub_text",loadingScreen==null?void 0:loadingScreen.sub_text);var initLoadHint;if(!hasSentInitLoadRef.current&&Object.keys(hint).length>0){initLoadHint=hint;hasSentInitLoadRef.current=true;}var messageData={name:"registerUserId",action:"registerUserId",data:Object.assign({userId:effectiveUserId},initLoadHint,(0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)({},_session.RESUME_SESSION_KEY,resumeSessionRef.current||undefined),"discrete",discreteRef.current?true:undefined),"token",user_token?`${user_token}`:undefined),"userProfile",Object.assign({},user_profile,(0,_systemInfo.getSystemInfo)(systemInfoRef==null?void 0:systemInfoRef.current),{__INT_SYS_INFO__:Object.assign({},(0,_systemInfo.getSystemInfo)(systemInfoRef==null?void 0:systemInfoRef.current))})))};_logger.logger.debug("messageData====>",JSON.stringify(Object.assign({},messageData,{data:Object.assign({},messageData.data,(0,_defineProperty2.default)({},_session.RESUME_SESSION_KEY,resumeSessionRef.current?"[redacted]":undefined))})));(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript(`
|
|
6
6
|
window.postMessage(${JSON.stringify({name:"openFrame",domain:"app-domain.com"})}, '*');
|
|
7
7
|
window.postMessage(${JSON.stringify(messageData)}, '*');
|
|
8
8
|
`);}}switch(parsedData==null?void 0:parsedData.type){case"close_chatbot":closeWebView();break;case"download_file":if(parsedData!=null&&parsedData.data||parsedData!=null&&parsedData.url&&parsedData!=null&&parsedData.filename){var downloadData=(parsedData==null?void 0:parsedData.data)||{url:parsedData==null?void 0:parsedData.url,filename:parsedData==null?void 0:parsedData.filename,inPlace:parsedData==null?void 0:parsedData.inPlace};(0,_fileDownload.handleDownloadRequest)(downloadData);}break;case"CHATBOT_LOADED":emitEvent(_events.ChatbotEventType.CHATBOT_LOADED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZED,parsedData==null?void 0:parsedData.data);break;case"SESSION_REFRESHED":emitEvent(_events.ChatbotEventType.SESSION_REFRESHED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZATION_FAILED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZATION_FAILED,parsedData==null?void 0:parsedData.data);break;case"REQUEST_MIC_PERMISSION":var granted=yield requestAndroidMicPermission();if(webViewRef.current&&isWebViewVisible){var _webViewRef$current5;var _messageData={name:"requestMicPermission",action:"requestMicPermission",type:granted?"MIC_PERMISSION_GRANTED":"MIC_PERMISSION_DENIED"};(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript(`
|
|
9
|
-
window.postMessage(${JSON.stringify(_messageData)}, '*');`);}break;default:if(onMessage)onMessage(parsedData!=null?parsedData:{});}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to parse WebView message"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{messageData:data}});}});return function(_x){return _ref2.apply(this,arguments);};}(),[emitEvent,emitSession,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){var userId=user_id?String(user_id):undefined;if(!userId){userId=memoryCache.current["rblyn_anon"];if(!userId){userId=(0,_cookieUtils.generateUUID)();executeStorageOp(function(){var _webViewRef$current6;(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref3.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current7;(_webViewRef$current7=webViewRef.current)==null?void 0:_webViewRef$current7.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl=`${_constants.API_URL}/chat/chatbot/get/`;var payload={client_user_id:effectiveUserId,resumable_session_id:resumeSessionRef.current||undefined,discrete:discreteRef.current?true:undefined,org_id:api_key,token:user_token,extra_info:{}};var response=yield fetch(endpointUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(payload)});if(!response.ok){throw new Error("Failed to fetch chatbot configuration");}var data=yield response.json();var orgInfo=data==null?void 0:(_data$user=data.user)==null?void 0:_data$user.org_info;if(orgInfo){var _orgInfo$brand_config,_orgInfo$brand_config2,_orgInfo$brand_config3,_orgInfo$brand_config4,_orgInfo$brand_config5,_orgInfo$brand_config6,_orgInfo$brand_config7,_orgInfo$brand_config8,_orgInfo$brand_config9,_orgInfo$brand_config10,_orgInfo$brand_config11,_orgInfo$brand_config12,_orgInfo$brand_config13,_orgInfo$brand_config14,_orgInfo$brand_config15,_orgInfo$brand_config16,_orgInfo$brand_config17,_orgInfo$brand_config18,_orgInfo$brand_config19,_orgInfo$brand_config20,_orgInfo$brand_config21,_orgInfo$brand_config22;var config={brand_colour:((_orgInfo$brand_config=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config2=_orgInfo$brand_config.colors)==null?void 0:_orgInfo$brand_config2.brand_color)||"",image_url:((_orgInfo$brand_config3=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config3.launcher_logo_url)||"",chat_interface_config:{chat_bubble_prompts:[],display_name:((_orgInfo$brand_config4=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config4.display_name)||"",welcome_message:((_orgInfo$brand_config5=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config5.welcome_message)||"Hey! What can we help you with today?",redirect_url:((_orgInfo$brand_config6=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config6.redirect_url)||""},interface_properties:{position:((_orgInfo$brand_config7=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config8=_orgInfo$brand_config7.interface_properties)==null?void 0:_orgInfo$brand_config8.position)||WidgetPositionEnums.RIGHT,side_spacing:(_orgInfo$brand_config9=(_orgInfo$brand_config10=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config11=_orgInfo$brand_config10.interface_properties)==null?void 0:_orgInfo$brand_config11.side_spacing)!=null?_orgInfo$brand_config9:20,bottom_spacing:(_orgInfo$brand_config12=(_orgInfo$brand_config13=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config14=_orgInfo$brand_config13.interface_properties)==null?void 0:_orgInfo$brand_config14.bottom_spacing)!=null?_orgInfo$brand_config12:20},interface_type:((_orgInfo$brand_config15=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config15.interface_type)||ChatbotInterfaceType.WIDGET,launcher_type:((_orgInfo$brand_config16=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config16.launcher_type)||LauncherType.IMAGE,launcher_properties:{text:((_orgInfo$brand_config17=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config18=_orgInfo$brand_config17.launcher_properties)==null?void 0:_orgInfo$brand_config18.text)||""},images:{launcher_image_url:{url:((_orgInfo$brand_config19=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config20=_orgInfo$brand_config19.images)==null?void 0:(_orgInfo$brand_config21=_orgInfo$brand_config20.launcher_image_url)==null?void 0:_orgInfo$brand_config21.url)||_constants.DEFAULT_LAUNCHER_IMAGE}},chat_iframe_url:((_orgInfo$brand_config22=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config22.chat_iframe_url)||""};setChatbotConfig(config);}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to fetch chatbot configuration"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.NETWORK_ERROR,context:{api_key:api_key,user_id:user_id}});}finally{setLoading(false);}});return function fetchChatbotConfig(){return _ref4.apply(this,arguments);};}();if(api_key&&effectiveUserId){fetchChatbotConfig();}},[api_key,effectiveUserId,user_token]);function constructUrl(){if(!effectiveUserId)return"";var params=new URLSearchParams({id:api_key});return`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;}var openWebView=(0,_react.useCallback)(function(){if(isWebViewVisibleRef.current)return;isWebViewVisibleRef.current=true;setIsWebViewVisible(true);if(enableAnimation){(0,_animations.animateWebViewOpen)(animatedValues,function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{requestAnimationFrame(function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}},[enableAnimation,animatedValues,externalOnOpen,emitEvent]);var closeWebView=(0,_react.useCallback)(function(){if(webViewRef.current){webViewRef.current.postMessage(JSON.stringify({name:"closeFrame",domain:"app-domain.com"}));}if(enableAnimation){(0,_animations.animateWebViewClose)(animatedValues,function(){isWebViewVisibleRef.current=false;setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);});}else{isWebViewVisibleRef.current=false;setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);}},[enableAnimation,animatedValues,externalOnClose,emitEvent]);(0,_react.useEffect)(function(){if(show_floating_button&&chatbotConfig){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_LOADED);}},[show_floating_button,chatbotConfig,emitEvent]);(0,_react.useEffect)(function(){if(!loading&&chatbotConfig&&effectiveUserId&&!isInitialized){isInitializedRef.current=true;setIsInitialized(true);onReady==null?void 0:onReady();}},[loading,chatbotConfig,effectiveUserId,isInitialized,onReady]);var getScreenDimensions=function getScreenDimensions(){var windowHeight=_reactNative.Dimensions.get("window").height;var windowWidth=_reactNative.Dimensions.get("window").width;var statusBarHeight=_reactNative.Platform.OS==="ios"?0:_reactNative.StatusBar.currentHeight||0;return{height:windowHeight-statusBarHeight,width:windowWidth};};var requestAndroidMicPermission=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){try{if(_reactNative.Platform.OS==="ios"){return true;}var alreadyGranted=yield _reactNative.PermissionsAndroid.check(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO);if(alreadyGranted){return true;}var result=yield _reactNative.PermissionsAndroid.request(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,{title:"Microphone permission",message:"This app uses your microphone for voice features.",buttonPositive:"Allow",buttonNegative:"Deny"});var granted=result===_reactNative.PermissionsAndroid.RESULTS.GRANTED;if(!granted){_reactNative.Alert.alert("Microphone required","Voice features will not work unless you allow microphone access.");}return granted;}catch(err){console.warn("Error requesting mic permission",err);return false;}}),[]);var screenDimensions=getScreenDimensions();(0,_react.useEffect)(function(){if(__DEV__){(0,_debugConfig.enableNetworkDebug)();}},[]);var position=(chatbotConfig==null?void 0:(_chatbotConfig$interf=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf.position)||"Right";var sideSpacing=(_chatbotConfig$interf2=chatbotConfig==null?void 0:(_chatbotConfig$interf3=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf3.side_spacing)!=null?_chatbotConfig$interf2:20;var bottomSpacing=(_chatbotConfig$interf4=chatbotConfig==null?void 0:(_chatbotConfig$interf5=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf5.bottom_spacing)!=null?_chatbotConfig$interf4:20;return(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotSDK",children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles==null?void 0:styles.mainContainer,pointerEvents:isWebViewVisible?"auto":"box-none",children:[!loading&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"FloatingButton",children:show_floating_button&&api_key&&chatbotConfig&&(0,_jsxRuntime.jsx)(_FloatingButton.default,{chatbotConfig:chatbotConfig,isWebViewVisible:isWebViewVisible,onPress:function onPress(){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_CLICKED);openWebView();},brandColor:chatbotConfig.brand_colour,imageUrl:chatbotConfig.image_url})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.webViewWrapper,{height:isWebViewVisible?"100%":0}],pointerEvents:isWebViewVisible?"auto":"none",children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.fullScreenContainer,{opacity:animatedValues.opacity,transform:[{scale:animatedValues.scale},{translateY:animatedValues.translateY}]}],children:(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotWebView",children:(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,{mediaCapturePermissionGrantType:"grant",webviewDebuggingEnabled:true,ref:webViewRef,source:{uri:constructUrl()},onMessage:handleMessage,style:styles.webview,containerStyle:isFullScreen?{width:screenDimensions.width,height:screenDimensions.height-40}:undefined,allowsInlineMediaPlayback:true,mediaPlaybackRequiresUserAction:false,allowFileAccess:false,geolocationEnabled:false,javaScriptEnabled:true,domStorageEnabled:true,cacheEnabled:true,scrollEnabled:true,bounces:false,onShouldStartLoadWithRequest:function onShouldStartLoadWithRequest(request){return request.url.startsWith(_constants.BASE_CHATBOT_URL)||request.url.startsWith((chatbotConfig==null?void 0:chatbotConfig.chat_iframe_url)||"");},startInLoadingState:isFirstLoadRef.current,onLoadEnd:function onLoadEnd(){var _webViewRef$current8;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current8=webViewRef.current)==null?void 0:_webViewRef$current8.injectJavaScript(`
|
|
9
|
+
window.postMessage(${JSON.stringify(_messageData)}, '*');`);}break;default:if(onMessage)onMessage(parsedData!=null?parsedData:{});}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to parse WebView message"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{messageData:data}});}});return function(_x){return _ref2.apply(this,arguments);};}(),[emitEvent,emitSession,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){var userId=user_id?String(user_id):undefined;if(!userId){userId=memoryCache.current["rblyn_anon"];if(!userId){userId=(0,_cookieUtils.generateUUID)();executeStorageOp(function(){var _webViewRef$current6;(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref3.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current7;(_webViewRef$current7=webViewRef.current)==null?void 0:_webViewRef$current7.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl=`${_constants.API_URL}/chat/chatbot/get/`;var payload={client_user_id:effectiveUserId,resumable_session_id:resumeSessionRef.current||undefined,discrete:discreteRef.current?true:undefined,org_id:api_key,token:user_token,extra_info:{}};var response=yield fetch(endpointUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(payload)});if(!response.ok){throw new Error("Failed to fetch chatbot configuration");}var data=yield response.json();var orgInfo=data==null?void 0:(_data$user=data.user)==null?void 0:_data$user.org_info;if(orgInfo){var _orgInfo$brand_config,_orgInfo$brand_config2,_orgInfo$brand_config3,_orgInfo$brand_config4,_orgInfo$brand_config5,_orgInfo$brand_config6,_orgInfo$brand_config7,_orgInfo$brand_config8,_orgInfo$brand_config9,_orgInfo$brand_config10,_orgInfo$brand_config11,_orgInfo$brand_config12,_orgInfo$brand_config13,_orgInfo$brand_config14,_orgInfo$brand_config15,_orgInfo$brand_config16,_orgInfo$brand_config17,_orgInfo$brand_config18,_orgInfo$brand_config19,_orgInfo$brand_config20,_orgInfo$brand_config21,_orgInfo$brand_config22,_orgInfo$brand_config23,_orgInfo$brand_config24,_orgInfo$brand_config25,_orgInfo$brand_config26,_orgInfo$brand_config27,_orgInfo$brand_config28;var config={brand_colour:((_orgInfo$brand_config=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config2=_orgInfo$brand_config.colors)==null?void 0:_orgInfo$brand_config2.brand_color)||"",name:((_orgInfo$brand_config3=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config3.name)||"",image_url:((_orgInfo$brand_config4=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config4.launcher_logo_url)||"",chat_interface_config:{chat_bubble_prompts:[],display_name:((_orgInfo$brand_config5=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config5.display_name)||"",welcome_message:((_orgInfo$brand_config6=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config6.welcome_message)||"Hey! What can we help you with today?",redirect_url:((_orgInfo$brand_config7=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config7.redirect_url)||""},interface_properties:{position:((_orgInfo$brand_config8=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config9=_orgInfo$brand_config8.interface_properties)==null?void 0:_orgInfo$brand_config9.position)||WidgetPositionEnums.RIGHT,side_spacing:(_orgInfo$brand_config10=(_orgInfo$brand_config11=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config12=_orgInfo$brand_config11.interface_properties)==null?void 0:_orgInfo$brand_config12.side_spacing)!=null?_orgInfo$brand_config10:20,bottom_spacing:(_orgInfo$brand_config13=(_orgInfo$brand_config14=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config15=_orgInfo$brand_config14.interface_properties)==null?void 0:_orgInfo$brand_config15.bottom_spacing)!=null?_orgInfo$brand_config13:20},interface_type:((_orgInfo$brand_config16=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config16.interface_type)||ChatbotInterfaceType.WIDGET,launcher_type:((_orgInfo$brand_config17=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config17.launcher_type)||LauncherType.IMAGE,launcher_properties:{text:((_orgInfo$brand_config18=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config19=_orgInfo$brand_config18.launcher_properties)==null?void 0:_orgInfo$brand_config19.text)||""},images:{launcher_image_url:{url:((_orgInfo$brand_config20=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config21=_orgInfo$brand_config20.images)==null?void 0:(_orgInfo$brand_config22=_orgInfo$brand_config21.launcher_image_url)==null?void 0:_orgInfo$brand_config22.url)||_constants.DEFAULT_LAUNCHER_IMAGE},header_image_url:{url:((_orgInfo$brand_config23=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config24=_orgInfo$brand_config23.images)==null?void 0:(_orgInfo$brand_config25=_orgInfo$brand_config24.header_image_url)==null?void 0:_orgInfo$brand_config25.url)||""}},footer:{show_powered_by:(_orgInfo$brand_config26=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config27=_orgInfo$brand_config26.footer)==null?void 0:_orgInfo$brand_config27.show_powered_by},chat_iframe_url:((_orgInfo$brand_config28=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config28.chat_iframe_url)||""};setChatbotConfig(config);}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to fetch chatbot configuration"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.NETWORK_ERROR,context:{api_key:api_key,user_id:user_id}});}finally{setLoading(false);}});return function fetchChatbotConfig(){return _ref4.apply(this,arguments);};}();if(api_key&&effectiveUserId){fetchChatbotConfig();}},[api_key,effectiveUserId,user_token]);function constructUrl(){if(!effectiveUserId)return"";var params=new URLSearchParams({id:api_key});return`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;}var openWebView=(0,_react.useCallback)(function(){if(isWebViewVisibleRef.current)return;isWebViewVisibleRef.current=true;setIsWebViewVisible(true);if(enableAnimation){(0,_animations.animateWebViewOpen)(animatedValues,function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{requestAnimationFrame(function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}},[enableAnimation,animatedValues,externalOnOpen,emitEvent]);var closeWebView=(0,_react.useCallback)(function(){if(webViewRef.current){webViewRef.current.postMessage(JSON.stringify({name:"closeFrame",domain:"app-domain.com"}));}if(enableAnimation){(0,_animations.animateWebViewClose)(animatedValues,function(){isWebViewVisibleRef.current=false;setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);});}else{isWebViewVisibleRef.current=false;setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);}},[enableAnimation,animatedValues,externalOnClose,emitEvent]);(0,_react.useEffect)(function(){if(show_floating_button&&chatbotConfig){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_LOADED);}},[show_floating_button,chatbotConfig,emitEvent]);(0,_react.useEffect)(function(){if(!loading&&chatbotConfig&&effectiveUserId&&!isInitialized){isInitializedRef.current=true;setIsInitialized(true);onReady==null?void 0:onReady();}},[loading,chatbotConfig,effectiveUserId,isInitialized,onReady]);var getScreenDimensions=function getScreenDimensions(){var windowHeight=_reactNative.Dimensions.get("window").height;var windowWidth=_reactNative.Dimensions.get("window").width;var statusBarHeight=_reactNative.Platform.OS==="ios"?0:_reactNative.StatusBar.currentHeight||0;return{height:windowHeight-statusBarHeight,width:windowWidth};};var requestAndroidMicPermission=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){try{if(_reactNative.Platform.OS==="ios"){return true;}var alreadyGranted=yield _reactNative.PermissionsAndroid.check(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO);if(alreadyGranted){return true;}var result=yield _reactNative.PermissionsAndroid.request(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,{title:"Microphone permission",message:"This app uses your microphone for voice features.",buttonPositive:"Allow",buttonNegative:"Deny"});var granted=result===_reactNative.PermissionsAndroid.RESULTS.GRANTED;if(!granted){_reactNative.Alert.alert("Microphone required","Voice features will not work unless you allow microphone access.");}return granted;}catch(err){console.warn("Error requesting mic permission",err);return false;}}),[]);var screenDimensions=getScreenDimensions();(0,_react.useEffect)(function(){if(__DEV__){(0,_debugConfig.enableNetworkDebug)();}},[]);var position=(chatbotConfig==null?void 0:(_chatbotConfig$interf=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf.position)||"Right";var sideSpacing=(_chatbotConfig$interf2=chatbotConfig==null?void 0:(_chatbotConfig$interf3=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf3.side_spacing)!=null?_chatbotConfig$interf2:20;var bottomSpacing=(_chatbotConfig$interf4=chatbotConfig==null?void 0:(_chatbotConfig$interf5=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf5.bottom_spacing)!=null?_chatbotConfig$interf4:20;return(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotSDK",children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles==null?void 0:styles.mainContainer,pointerEvents:isWebViewVisible?"auto":"box-none",children:[!loading&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"FloatingButton",children:show_floating_button&&api_key&&chatbotConfig&&(0,_jsxRuntime.jsx)(_FloatingButton.default,{chatbotConfig:chatbotConfig,isWebViewVisible:isWebViewVisible,onPress:function onPress(){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_CLICKED);openWebView();},brandColor:chatbotConfig.brand_colour,imageUrl:chatbotConfig.image_url})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.webViewWrapper,{height:isWebViewVisible?"100%":0}],pointerEvents:isWebViewVisible?"auto":"none",children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.fullScreenContainer,{opacity:animatedValues.opacity,transform:[{scale:animatedValues.scale},{translateY:animatedValues.translateY}]}],children:(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotWebView",children:(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,{mediaCapturePermissionGrantType:"grant",webviewDebuggingEnabled:true,ref:webViewRef,source:{uri:constructUrl()},onMessage:handleMessage,style:styles.webview,containerStyle:isFullScreen?{width:screenDimensions.width,height:screenDimensions.height-40}:undefined,allowsInlineMediaPlayback:true,mediaPlaybackRequiresUserAction:false,allowFileAccess:false,geolocationEnabled:false,javaScriptEnabled:true,domStorageEnabled:true,cacheEnabled:true,scrollEnabled:true,bounces:false,onShouldStartLoadWithRequest:function onShouldStartLoadWithRequest(request){return request.url.startsWith(_constants.BASE_CHATBOT_URL)||request.url.startsWith((chatbotConfig==null?void 0:chatbotConfig.chat_iframe_url)||"");},startInLoadingState:isFirstLoadRef.current,onLoadEnd:function onLoadEnd(){var _webViewRef$current8;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current8=webViewRef.current)==null?void 0:_webViewRef$current8.injectJavaScript(`
|
|
10
10
|
if (!document.querySelector('meta[name="viewport"]')) {
|
|
11
11
|
var meta = document.createElement('meta');
|
|
12
12
|
meta.name = 'viewport';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_animations","_fileDownload","_session","_jsxRuntime","_this","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ChatbotInterfaceType","exports","WidgetPositionEnums","LauncherType","Chatbot","forwardRef","_ref","ref","_chatbotConfig$interf","_chatbotConfig$interf2","_chatbotConfig$interf3","_chatbotConfig$interf4","_chatbotConfig$interf5","api_key","user_id","user_token","_ref$show_floating_bu","show_floating_button","onEvent","onMessage","_ref$isFullScreen","isFullScreen","_ref$enableAnimation","enableAnimation","externalOnOpen","onOpen","externalOnClose","onClose","onReady","user_profile","session_id","session_context","_ref$discrete","discrete","onSession","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","_useState7","_useState8","isInitialized","setIsInitialized","webViewRef","useRef","isFirstLoadRef","_useState9","_useState10","toastVisible","setToastVisible","_useState11","_useState12","toastMessage","setToastMessage","_useState13","_useState14","effectiveUserId","setEffectiveUserId","_useState15","_useState16","isStorageReady","setIsStorageReady","pendingStorageOps","memoryCache","_useState17","os","browser","_useState18","systemInfo","setSystemInfo","systemInfoRef","isInitializedRef","isWebViewVisibleRef","sessionIdRef","undefined","onSessionRef","sessionContextRef","resumeSessionRef","discreteRef","current","animatedValues","scale","Animated","Value","translateY","opacity","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","useImperativeHandle","open","openWebView","close","closeWebView","toggle","isReady","getSessionId","emitSession","useCallback","data","sessionId","extractSessionId","_sessionContextRef$cu","error","errorTracker","trackError","Error","type","ErrorTypes","RUNTIME_ERROR","context","source","SESSION_UPDATED_MESSAGE_TYPE","triggerAppInit","_webViewRef$current","injectJavaScript","getBrowserAndOSInfoScript","executeStorageOp","operation","push","handleMessage","_ref2","_asyncToGenerator2","event","_webViewRef$current2","nativeEvent","parsedData","JSON","parse","values","StorageMessageType","includes","storageMessage","STORAGE_READY","forEach","op","createStorageMessage","GET_STORAGE","STORAGE_RESPONSE","key","value","STORAGE_ERROR","logger","__DEV__","console","log","level","_parsedData$data","ChatbotEventType","CHATBOT_APP_READY","_webViewRef$current3","_webViewRef$current4","messageData","name","action","_defineProperty2","RESUME_SESSION_KEY","assign","getSystemInfo","__INT_SYS_INFO__","debug","stringify","domain","url","filename","downloadData","inPlace","handleDownloadRequest","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","granted","requestAndroidMicPermission","_webViewRef$current5","_x","apply","arguments","useEffect","initializeUserId","_ref3","String","generateUUID","_webViewRef$current6","SET_STORAGE","getStorageScript","_webViewRef$current7","fetchChatbotConfig","_ref4","_data$user","endpointUrl","API_URL","payload","client_user_id","resumable_session_id","org_id","token","extra_info","response","fetch","method","headers","body","ok","json","orgInfo","user","org_info","_orgInfo$brand_config","_orgInfo$brand_config2","_orgInfo$brand_config3","_orgInfo$brand_config4","_orgInfo$brand_config5","_orgInfo$brand_config6","_orgInfo$brand_config7","_orgInfo$brand_config8","_orgInfo$brand_config9","_orgInfo$brand_config10","_orgInfo$brand_config11","_orgInfo$brand_config12","_orgInfo$brand_config13","_orgInfo$brand_config14","_orgInfo$brand_config15","_orgInfo$brand_config16","_orgInfo$brand_config17","_orgInfo$brand_config18","_orgInfo$brand_config19","_orgInfo$brand_config20","_orgInfo$brand_config21","_orgInfo$brand_config22","config","brand_colour","brand_config","colors","brand_color","image_url","launcher_logo_url","chat_interface_config","chat_bubble_prompts","display_name","welcome_message","redirect_url","interface_properties","position","RIGHT","side_spacing","bottom_spacing","interface_type","WIDGET","launcher_type","IMAGE","launcher_properties","text","images","launcher_image_url","DEFAULT_LAUNCHER_IMAGE","chat_iframe_url","NETWORK_ERROR","constructUrl","params","URLSearchParams","id","BASE_CHATBOT_URL","toString","animateWebViewOpen","CHATBOT_OPENED","setTimeout","requestAnimationFrame","postMessage","animateWebViewClose","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","alreadyGranted","PermissionsAndroid","check","PERMISSIONS","RECORD_AUDIO","result","request","title","message","buttonPositive","buttonNegative","RESULTS","GRANTED","Alert","alert","err","warn","screenDimensions","enableNetworkDebug","sideSpacing","bottomSpacing","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","pointerEvents","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","webViewWrapper","fullScreenContainer","transform","WebView","mediaCapturePermissionGrantType","webviewDebuggingEnabled","uri","webview","containerStyle","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current8","enableWebViewDebug","onError","syntheticEvent","description","code","displayName","StyleSheet","create","flex","overflow","top","left","right","bottom","zIndex","backgroundColor","inlineContainer","_default"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"6gBAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WASA,IAAAC,YAAA,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AAe,CAAE,SACnB,CAAC,CACDrC,mBAAmB,CAAE,CACnB7E,QAAQ,CAAE,UAAU,CACpB6G,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTE,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KAAK,CACbL,QAAQ,CAAE,SAEZ,CAAC,CACDO,eAAe,CAAE,CACfR,IAAI,CAAE,CAAC,CACPO,eAAe,CAAE,OACnB,CAAC,CACD/B,OAAO,CAAE,CACPwB,IAAI,CAAE,CAAC,CACPO,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KACV,CACF,CAAC,CAAC,CAAC,IAAAG,QAAA,CAAArX,OAAA,CAAAX,OAAA,CAEYc,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_animations","_fileDownload","_session","_jsxRuntime","_this","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ChatbotInterfaceType","exports","WidgetPositionEnums","LauncherType","Chatbot","forwardRef","_ref","ref","_chatbotConfig$interf","_chatbotConfig$interf2","_chatbotConfig$interf3","_chatbotConfig$interf4","_chatbotConfig$interf5","api_key","user_id","user_token","_ref$show_floating_bu","show_floating_button","onEvent","onMessage","_ref$isFullScreen","isFullScreen","_ref$enableAnimation","enableAnimation","externalOnOpen","onOpen","externalOnClose","onClose","onReady","user_profile","session_id","session_context","_ref$discrete","discrete","onSession","loading_screen","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","_useState7","_useState8","isInitialized","setIsInitialized","webViewRef","useRef","isFirstLoadRef","_useState9","_useState10","toastVisible","setToastVisible","_useState11","_useState12","toastMessage","setToastMessage","_useState13","_useState14","effectiveUserId","setEffectiveUserId","_useState15","_useState16","isStorageReady","setIsStorageReady","pendingStorageOps","memoryCache","_useState17","os","browser","_useState18","systemInfo","setSystemInfo","systemInfoRef","isInitializedRef","isWebViewVisibleRef","sessionIdRef","undefined","onSessionRef","sessionContextRef","resumeSessionRef","discreteRef","loadingScreenRef","current","chatbotConfigRef","hasSentInitLoadRef","animatedValues","scale","Animated","Value","translateY","opacity","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","useImperativeHandle","open","openWebView","close","closeWebView","toggle","isReady","getSessionId","emitSession","useCallback","data","sessionId","extractSessionId","_sessionContextRef$cu","error","errorTracker","trackError","Error","type","ErrorTypes","RUNTIME_ERROR","context","source","SESSION_UPDATED_MESSAGE_TYPE","triggerAppInit","_webViewRef$current","injectJavaScript","getBrowserAndOSInfoScript","executeStorageOp","operation","push","handleMessage","_ref2","_asyncToGenerator2","event","_webViewRef$current2","nativeEvent","parsedData","JSON","parse","values","StorageMessageType","includes","storageMessage","STORAGE_READY","forEach","op","createStorageMessage","GET_STORAGE","STORAGE_RESPONSE","key","value","STORAGE_ERROR","logger","__DEV__","console","log","level","_parsedData$data","ChatbotEventType","CHATBOT_APP_READY","_webViewRef$current3","_loadingScreen$image","_brandConfig$images","_brandConfig$images$h","_loadingScreen$bot_na","_loadingScreen$brand_","_loadingScreen$powere","_brandConfig$footer","_webViewRef$current4","brandConfig","loadingScreen","hint","addHint","image","images","header_image_url","url","image_url","bot_name","name","brand_color","brand_colour","powered_by","footer","show_powered_by","sub_text","initLoadHint","keys","length","messageData","action","assign","_defineProperty2","RESUME_SESSION_KEY","getSystemInfo","__INT_SYS_INFO__","debug","stringify","domain","filename","downloadData","inPlace","handleDownloadRequest","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","granted","requestAndroidMicPermission","_webViewRef$current5","_x","apply","arguments","useEffect","initializeUserId","_ref3","String","generateUUID","_webViewRef$current6","SET_STORAGE","getStorageScript","_webViewRef$current7","fetchChatbotConfig","_ref4","_data$user","endpointUrl","API_URL","payload","client_user_id","resumable_session_id","org_id","token","extra_info","response","fetch","method","headers","body","ok","json","orgInfo","user","org_info","_orgInfo$brand_config","_orgInfo$brand_config2","_orgInfo$brand_config3","_orgInfo$brand_config4","_orgInfo$brand_config5","_orgInfo$brand_config6","_orgInfo$brand_config7","_orgInfo$brand_config8","_orgInfo$brand_config9","_orgInfo$brand_config10","_orgInfo$brand_config11","_orgInfo$brand_config12","_orgInfo$brand_config13","_orgInfo$brand_config14","_orgInfo$brand_config15","_orgInfo$brand_config16","_orgInfo$brand_config17","_orgInfo$brand_config18","_orgInfo$brand_config19","_orgInfo$brand_config20","_orgInfo$brand_config21","_orgInfo$brand_config22","_orgInfo$brand_config23","_orgInfo$brand_config24","_orgInfo$brand_config25","_orgInfo$brand_config26","_orgInfo$brand_config27","_orgInfo$brand_config28","config","brand_config","colors","launcher_logo_url","chat_interface_config","chat_bubble_prompts","display_name","welcome_message","redirect_url","interface_properties","position","RIGHT","side_spacing","bottom_spacing","interface_type","WIDGET","launcher_type","IMAGE","launcher_properties","text","launcher_image_url","DEFAULT_LAUNCHER_IMAGE","chat_iframe_url","NETWORK_ERROR","constructUrl","params","URLSearchParams","id","BASE_CHATBOT_URL","toString","animateWebViewOpen","CHATBOT_OPENED","setTimeout","requestAnimationFrame","postMessage","animateWebViewClose","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","alreadyGranted","PermissionsAndroid","check","PERMISSIONS","RECORD_AUDIO","result","request","title","message","buttonPositive","buttonNegative","RESULTS","GRANTED","Alert","alert","err","warn","screenDimensions","enableNetworkDebug","sideSpacing","bottomSpacing","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","pointerEvents","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","webViewWrapper","fullScreenContainer","transform","WebView","mediaCapturePermissionGrantType","webviewDebuggingEnabled","uri","webview","containerStyle","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current8","enableWebViewDebug","onError","syntheticEvent","description","code","displayName","StyleSheet","create","flex","overflow","top","left","right","bottom","zIndex","backgroundColor","inlineContainer","_default"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"6gBAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WASA,IAAAC,YAAA,CAAAD,OAAA,iBAYA,IAAAE,mBAAA,CAAAF,OAAA,yBACA,IAAAG,eAAA,CAAAC,sBAAA,CAAAJ,OAAA,sBACA,IAAAK,UAAA,CAAAL,OAAA,gBACA,IAAAM,WAAA,CAAAN,OAAA,uBACA,IAAAO,kBAAA,CAAAP,OAAA,6BACA,IAAAQ,OAAA,CAAAR,OAAA,mBAKA,IAAAS,OAAA,CAAAT,OAAA,mBACA,IAAAU,YAAA,CAAAV,OAAA,wBACA,IAAAW,YAAA,CAAAP,sBAAA,CAAAJ,OAAA,8BACA,IAAAY,cAAA,CAAAZ,OAAA,+BACA,IAAAa,eAAA,CAAAb,OAAA,+BAMA,IAAAc,qBAAA,CAAAd,OAAA,oCACA,IAAAe,YAAA,CAAAf,OAAA,wBACA,IAAAgB,eAAA,CAAAhB,OAAA,2BAMA,IAAAiB,WAAA,CAAAjB,OAAA,uBACA,IAAAkB,aAAA,CAAAlB,OAAA,yBACA,IAAAmB,QAAA,CAAAnB,OAAA,oBAIyB,IAAAoB,WAAA,CAAApB,OAAA,0B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,CACH,CAAC,CACW,CAAC,CACH,CAAC,CACZ,CAAC,EACP,CACH,CAEAtO,OAAO,EAAI,GAAAzL,WAAA,CAAAqX,GAAA,EAAC9X,YAAA,CAAAsB,OAAW,GAAE,CAAC,EACvB,CAAC,CACM,CAAC,CAEpB,CACF,CAAC,CAEDc,OAAO,CAACqY,WAAW,CAAG,SAAS,CAE/B,GAAM,CAAApC,MAAM,CAAGqC,uBAAU,CAACC,MAAM,CAAC,CAC/BrC,aAAa,CAAE,CACbsC,IAAI,CAAE,CAAC,CACP1G,QAAQ,CAAE,UAAU,CACpB2G,QAAQ,CAAE,SACZ,CAAC,CACDhC,cAAc,CAAE,CACd3E,QAAQ,CAAE,UAAU,CACpB4G,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTJ,QAAQ,CAAE,SAAS,CACnBK,MAAM,CAAE,KAAK,CACbC,eAAe,CAAE,SACnB,CAAC,CACDrC,mBAAmB,CAAE,CACnB5E,QAAQ,CAAE,UAAU,CACpB4G,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTE,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KAAK,CACbL,QAAQ,CAAE,SAEZ,CAAC,CACDO,eAAe,CAAE,CACfR,IAAI,CAAE,CAAC,CACPO,eAAe,CAAE,OACnB,CAAC,CACD/B,OAAO,CAAE,CACPwB,IAAI,CAAE,CAAC,CACPO,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KACV,CACF,CAAC,CAAC,CAAC,IAAAG,QAAA,CAAApZ,OAAA,CAAAX,OAAA,CAEYc,OAAO","ignoreList":[]}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=openChatbot.js.mape",{value:true});exports.openChatbot=void 0;var _reactNative=require("react-native");var _constants=require("./constants");var openChatbot=exports.openChatbot=function openChatbot(chatbotId){var additionalParams=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var params=new URLSearchParams(Object.assign({id:chatbotId},additionalParams));var url=`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;_reactNative.Linking.openURL(url);};
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.openChatbot=void 0;var _reactNative=require("react-native");var _constants=require("./constants");var openChatbot=exports.openChatbot=function openChatbot(chatbotId){var additionalParams=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var params=new URLSearchParams(Object.assign({id:chatbotId},additionalParams));var url=`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;_reactNative.Linking.openURL(url);};
|
|
3
2
|
//# sourceMappingURL=openChatbot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["openChatbot.
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_constants","openChatbot","exports","chatbotId","additionalParams","arguments","length","undefined","params","URLSearchParams","Object","assign","id","url","BASE_CHATBOT_URL","toString","Linking","openURL"],"sourceRoot":"../../src","sources":["openChatbot.ts"],"mappings":"oFAAA,IAAAA,YAAA,CAAAC,OAAA,iBACA,IAAAC,UAAA,CAAAD,OAAA,gBAEO,GAAM,CAAAE,WAAW,CAAAC,OAAA,CAAAD,WAAA,CAAG,QAAd,CAAAA,WAAWA,CACtBE,SAAiB,CAER,IADT,CAAAC,gBAAwC,CAAAC,SAAA,CAAAC,MAAA,IAAAD,SAAA,MAAAE,SAAA,CAAAF,SAAA,IAAG,CAAC,CAAC,CAE7C,GAAM,CAAAG,MAAM,CAAG,GAAI,CAAAC,eAAe,CAAAC,MAAA,CAAAC,MAAA,EAAGC,EAAE,CAAET,SAAS,EAAKC,gBAAgB,CAAE,CAAC,CAC1E,GAAM,CAAAS,GAAG,CAAG,GAAGC,2BAAgB,IAAIN,MAAM,CAACO,QAAQ,CAAC,CAAC,EAAE,CACtDC,oBAAO,CAACC,OAAO,CAACJ,GAAG,CAAC,CACtB,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.2.1-staging.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.2.1-staging.1';
|
|
2
2
|
//# sourceMappingURL=version.staging.js.map
|
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ChatbotEventHandler } from "./types/events";
|
|
3
|
+
/**
|
|
4
|
+
* Host-app overrides for the branding the chat UI paints on its very first
|
|
5
|
+
* frame, before its own config call lands. Every field is optional and wins
|
|
6
|
+
* over the value the SDK fetched from /chat/chatbot/get/; anything omitted
|
|
7
|
+
* falls back to that fetched config.
|
|
8
|
+
*/
|
|
9
|
+
export interface ChatbotLoadingScreen {
|
|
10
|
+
/** Header avatar. */
|
|
11
|
+
image?: string;
|
|
12
|
+
/** Display name in the header. */
|
|
13
|
+
bot_name?: string;
|
|
14
|
+
/** Colour the header is tinted with. */
|
|
15
|
+
brand_color?: string;
|
|
16
|
+
/** Whether the "powered by" footer shows. */
|
|
17
|
+
powered_by?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Sub-text shown under the header. Unlike the fields above, no brand_config
|
|
20
|
+
* field backs this one, so it ships only when the host app supplies it.
|
|
21
|
+
*/
|
|
22
|
+
sub_text?: string;
|
|
23
|
+
}
|
|
3
24
|
export interface ChatbotProps {
|
|
4
25
|
api_key: string;
|
|
5
26
|
user_id?: string | null | number;
|
|
@@ -14,6 +35,12 @@ export interface ChatbotProps {
|
|
|
14
35
|
session_id?: string;
|
|
15
36
|
session_context?: Record<string, any>;
|
|
16
37
|
discrete?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Overrides for the branding the chat UI paints before its own config call
|
|
40
|
+
* lands. Purely a first-paint concern: the chat UI reconciles to its own
|
|
41
|
+
* config afterwards, so these do not restyle the running chat.
|
|
42
|
+
*/
|
|
43
|
+
loading_screen?: ChatbotLoadingScreen;
|
|
17
44
|
onEvent?: ChatbotEventHandler;
|
|
18
45
|
onOpen?: () => void;
|
|
19
46
|
onClose?: () => void;
|
|
@@ -54,6 +81,13 @@ export declare enum LauncherType {
|
|
|
54
81
|
}
|
|
55
82
|
export interface ChatbotConfig {
|
|
56
83
|
brand_colour: string;
|
|
84
|
+
/**
|
|
85
|
+
* Bot display name, from brand_config.name. Not to be confused with
|
|
86
|
+
* chat_interface_config.display_name below, which reads a
|
|
87
|
+
* brand_config.display_name that the API does not return and which nothing
|
|
88
|
+
* in the SDK consumes.
|
|
89
|
+
*/
|
|
90
|
+
name?: string;
|
|
57
91
|
image_url?: string;
|
|
58
92
|
chat_interface_config?: {
|
|
59
93
|
chat_bubble_prompts?: string[];
|
|
@@ -71,6 +105,12 @@ export interface ChatbotConfig {
|
|
|
71
105
|
launcher_image_url?: {
|
|
72
106
|
url: string;
|
|
73
107
|
};
|
|
108
|
+
header_image_url?: {
|
|
109
|
+
url: string;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
footer?: {
|
|
113
|
+
show_powered_by?: boolean;
|
|
74
114
|
};
|
|
75
115
|
chat_iframe_url: string;
|
|
76
116
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chatbotsdk.d.ts","sourceRoot":"","sources":["../../src/Chatbotsdk.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAkBf,OAAO,EAEL,mBAAmB,EAEpB,MAAM,gBAAgB,CAAC;AA2BxB,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE;QACb,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C,EAAE;QACP,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;IACF,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,QAAA,MAAM,OAAO,yFA47BZ,CAAC;AA0CF,eAAe,OAAO,CAAC"}
|
|
@@ -3,5 +3,5 @@ export { openChatbot } from "./openChatbot";
|
|
|
3
3
|
export { errorTracker, ErrorTrackingService, } from "./services/ErrorTrackingService";
|
|
4
4
|
export * from "./constants/errorConstants";
|
|
5
5
|
export * from "./types/events";
|
|
6
|
-
export type { ChatbotProps, ChatbotRef } from "./Chatbotsdk";
|
|
6
|
+
export type { ChatbotProps, ChatbotRef, ChatbotLoadingScreen, } from "./Chatbotsdk";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,YAAY,EACZ,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAE/B,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,YAAY,EACZ,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAE/B,YAAY,EACV,YAAY,EACZ,UAAU,EACV,oBAAoB,GACrB,MAAM,cAAc,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.2.1-staging.
|
|
1
|
+
export declare const SDK_VERSION = "2.2.1-staging.1";
|
|
2
2
|
//# sourceMappingURL=version.staging.d.ts.map
|
package/package.json
CHANGED
|
Binary file
|
package/src/Chatbotsdk.tsx
CHANGED
|
@@ -55,6 +55,28 @@ import {
|
|
|
55
55
|
extractSessionId,
|
|
56
56
|
} from "./utils/session";
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Host-app overrides for the branding the chat UI paints on its very first
|
|
60
|
+
* frame, before its own config call lands. Every field is optional and wins
|
|
61
|
+
* over the value the SDK fetched from /chat/chatbot/get/; anything omitted
|
|
62
|
+
* falls back to that fetched config.
|
|
63
|
+
*/
|
|
64
|
+
export interface ChatbotLoadingScreen {
|
|
65
|
+
/** Header avatar. */
|
|
66
|
+
image?: string;
|
|
67
|
+
/** Display name in the header. */
|
|
68
|
+
bot_name?: string;
|
|
69
|
+
/** Colour the header is tinted with. */
|
|
70
|
+
brand_color?: string;
|
|
71
|
+
/** Whether the "powered by" footer shows. */
|
|
72
|
+
powered_by?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Sub-text shown under the header. Unlike the fields above, no brand_config
|
|
75
|
+
* field backs this one, so it ships only when the host app supplies it.
|
|
76
|
+
*/
|
|
77
|
+
sub_text?: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
58
80
|
export interface ChatbotProps {
|
|
59
81
|
api_key: string;
|
|
60
82
|
user_id?: string | null | number;
|
|
@@ -69,6 +91,12 @@ export interface ChatbotProps {
|
|
|
69
91
|
session_id?: string;
|
|
70
92
|
session_context?: Record<string, any>;
|
|
71
93
|
discrete?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Overrides for the branding the chat UI paints before its own config call
|
|
96
|
+
* lands. Purely a first-paint concern: the chat UI reconciles to its own
|
|
97
|
+
* config afterwards, so these do not restyle the running chat.
|
|
98
|
+
*/
|
|
99
|
+
loading_screen?: ChatbotLoadingScreen;
|
|
72
100
|
onEvent?: ChatbotEventHandler;
|
|
73
101
|
onOpen?: () => void;
|
|
74
102
|
onClose?: () => void;
|
|
@@ -128,6 +156,13 @@ export enum LauncherType {
|
|
|
128
156
|
|
|
129
157
|
export interface ChatbotConfig {
|
|
130
158
|
brand_colour: string;
|
|
159
|
+
/**
|
|
160
|
+
* Bot display name, from brand_config.name. Not to be confused with
|
|
161
|
+
* chat_interface_config.display_name below, which reads a
|
|
162
|
+
* brand_config.display_name that the API does not return and which nothing
|
|
163
|
+
* in the SDK consumes.
|
|
164
|
+
*/
|
|
165
|
+
name?: string;
|
|
131
166
|
image_url?: string;
|
|
132
167
|
chat_interface_config?: {
|
|
133
168
|
chat_bubble_prompts?: string[];
|
|
@@ -145,6 +180,12 @@ export interface ChatbotConfig {
|
|
|
145
180
|
launcher_image_url?: {
|
|
146
181
|
url: string;
|
|
147
182
|
};
|
|
183
|
+
header_image_url?: {
|
|
184
|
+
url: string;
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
footer?: {
|
|
188
|
+
show_powered_by?: boolean;
|
|
148
189
|
};
|
|
149
190
|
chat_iframe_url: string;
|
|
150
191
|
}
|
|
@@ -168,6 +209,7 @@ const Chatbot = forwardRef<ChatbotRef, InternalChatbotProps>(
|
|
|
168
209
|
session_context,
|
|
169
210
|
discrete = false,
|
|
170
211
|
onSession,
|
|
212
|
+
loading_screen,
|
|
171
213
|
},
|
|
172
214
|
ref,
|
|
173
215
|
) => {
|
|
@@ -205,10 +247,22 @@ const Chatbot = forwardRef<ChatbotRef, InternalChatbotProps>(
|
|
|
205
247
|
const sessionContextRef = useRef(session_context);
|
|
206
248
|
const resumeSessionRef = useRef(session_id);
|
|
207
249
|
const discreteRef = useRef(discrete);
|
|
250
|
+
const loadingScreenRef = useRef(loading_screen);
|
|
208
251
|
onSessionRef.current = onSession;
|
|
209
252
|
sessionContextRef.current = session_context;
|
|
210
253
|
resumeSessionRef.current = session_id;
|
|
211
254
|
discreteRef.current = discrete;
|
|
255
|
+
loadingScreenRef.current = loading_screen;
|
|
256
|
+
|
|
257
|
+
// Same reasoning as above: the branding hint is read inside handleMessage,
|
|
258
|
+
// which does not list chatbotConfig among its dependencies.
|
|
259
|
+
const chatbotConfigRef = useRef<ChatbotConfig | null>(null);
|
|
260
|
+
chatbotConfigRef.current = chatbotConfig;
|
|
261
|
+
|
|
262
|
+
// The init_load_* hint rides the first registerUserId after the chat
|
|
263
|
+
// surface loads and no later one. A reopen re-triggers APP_READY, but by
|
|
264
|
+
// then the chat UI has its own config and the hint would be noise.
|
|
265
|
+
const hasSentInitLoadRef = useRef(false);
|
|
212
266
|
|
|
213
267
|
// Initialize animated values
|
|
214
268
|
const animatedValues = useRef({
|
|
@@ -388,11 +442,67 @@ const Chatbot = forwardRef<ChatbotRef, InternalChatbotProps>(
|
|
|
388
442
|
if (webViewRef.current && isWebViewVisible) {
|
|
389
443
|
webViewRef.current?.injectJavaScript(getBrowserAndOSInfoScript());
|
|
390
444
|
|
|
445
|
+
// First-paint branding hint. The chat UI makes its own config
|
|
446
|
+
// call on boot and renders a skeleton until it lands; the SDK
|
|
447
|
+
// already holds the same branding from /chat/chatbot/get/, so
|
|
448
|
+
// passing it here lets the header paint immediately. A hint, not
|
|
449
|
+
// a source of truth: the chat UI keeps whatever its own call
|
|
450
|
+
// returns, and must stay correct when these are absent.
|
|
451
|
+
const brandConfig = chatbotConfigRef.current;
|
|
452
|
+
const loadingScreen = loadingScreenRef.current;
|
|
453
|
+
|
|
454
|
+
// Every key is dropped unless something actually backs it, so
|
|
455
|
+
// the chat UI never has to tell "the SDK knows it is blank" from
|
|
456
|
+
// "the SDK does not know" — a missing key and an empty one mean
|
|
457
|
+
// the same thing to it, and both fall back to its own config.
|
|
458
|
+
// ?? rather than || throughout, so a host app that deliberately
|
|
459
|
+
// passes powered_by: false still overrides a truthy config.
|
|
460
|
+
const hint: Record<string, string | boolean> = {};
|
|
461
|
+
const addHint = (
|
|
462
|
+
key: string,
|
|
463
|
+
value: string | boolean | undefined,
|
|
464
|
+
) => {
|
|
465
|
+
if (value !== undefined && value !== "") {
|
|
466
|
+
hint[key] = value;
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
addHint(
|
|
471
|
+
"init_load_image",
|
|
472
|
+
// Header image first, brand logo second, so orgs that set only
|
|
473
|
+
// a launcher logo still get a branded header.
|
|
474
|
+
loadingScreen?.image ??
|
|
475
|
+
(brandConfig?.images?.header_image_url?.url ||
|
|
476
|
+
brandConfig?.image_url),
|
|
477
|
+
);
|
|
478
|
+
addHint(
|
|
479
|
+
"init_load_bot_name",
|
|
480
|
+
loadingScreen?.bot_name ?? brandConfig?.name,
|
|
481
|
+
);
|
|
482
|
+
addHint(
|
|
483
|
+
"init_load_brand_color",
|
|
484
|
+
loadingScreen?.brand_color ?? brandConfig?.brand_colour,
|
|
485
|
+
);
|
|
486
|
+
addHint(
|
|
487
|
+
"init_load_powered_by",
|
|
488
|
+
loadingScreen?.powered_by ?? brandConfig?.footer?.show_powered_by,
|
|
489
|
+
);
|
|
490
|
+
// Prop-only: no brand_config field backs the sub-text.
|
|
491
|
+
addHint("init_load_sub_text", loadingScreen?.sub_text);
|
|
492
|
+
|
|
493
|
+
let initLoadHint: Record<string, string | boolean> | undefined;
|
|
494
|
+
// Left unlatched when there was nothing to send, so a later
|
|
495
|
+
// registration can still carry the hint once config arrives.
|
|
496
|
+
if (!hasSentInitLoadRef.current && Object.keys(hint).length > 0) {
|
|
497
|
+
initLoadHint = hint;
|
|
498
|
+
hasSentInitLoadRef.current = true;
|
|
499
|
+
}
|
|
391
500
|
const messageData = {
|
|
392
501
|
name: "registerUserId",
|
|
393
502
|
action: "registerUserId",
|
|
394
503
|
data: {
|
|
395
504
|
userId: effectiveUserId,
|
|
505
|
+
...initLoadHint,
|
|
396
506
|
[RESUME_SESSION_KEY]: resumeSessionRef.current || undefined,
|
|
397
507
|
// Sent only when opted in. false is the default and is
|
|
398
508
|
// conveyed by the key's absence, so integrations that do not
|
|
@@ -598,6 +708,7 @@ const Chatbot = forwardRef<ChatbotRef, InternalChatbotProps>(
|
|
|
598
708
|
if (orgInfo) {
|
|
599
709
|
const config: ChatbotConfig = {
|
|
600
710
|
brand_colour: orgInfo.brand_config?.colors?.brand_color || "",
|
|
711
|
+
name: orgInfo.brand_config?.name || "",
|
|
601
712
|
image_url: orgInfo.brand_config?.launcher_logo_url || "",
|
|
602
713
|
chat_interface_config: {
|
|
603
714
|
chat_bubble_prompts: [],
|
|
@@ -632,6 +743,15 @@ const Chatbot = forwardRef<ChatbotRef, InternalChatbotProps>(
|
|
|
632
743
|
orgInfo.brand_config?.images?.launcher_image_url?.url ||
|
|
633
744
|
DEFAULT_LAUNCHER_IMAGE,
|
|
634
745
|
},
|
|
746
|
+
header_image_url: {
|
|
747
|
+
url: orgInfo.brand_config?.images?.header_image_url?.url || "",
|
|
748
|
+
},
|
|
749
|
+
},
|
|
750
|
+
footer: {
|
|
751
|
+
// Left uncoerced so an org that never set it stays undefined
|
|
752
|
+
// and the init_load_powered_by key is dropped rather than
|
|
753
|
+
// asserting a false the backend never stated.
|
|
754
|
+
show_powered_by: orgInfo.brand_config?.footer?.show_powered_by,
|
|
635
755
|
},
|
|
636
756
|
chat_iframe_url: orgInfo.brand_config?.chat_iframe_url || "",
|
|
637
757
|
};
|
package/src/index.tsx
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated. Do not modify it manually.
|
|
2
|
-
export const SDK_VERSION = '2.2.1-staging.
|
|
2
|
+
export const SDK_VERSION = '2.2.1-staging.1';
|