@robylon/react-native-sdk 2.0.27-staging.4 → 2.0.27-staging.6
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 +28 -5
- package/lib/commonjs/Chatbotsdk.js.map +1 -1
- package/lib/commonjs/openChatbot.js.map +1 -1
- package/lib/commonjs/utils/systemInfo.js +74 -1
- package/lib/commonjs/utils/systemInfo.js.map +1 -1
- package/lib/commonjs/versions/version.staging.js +1 -1
- package/lib/module/Chatbotsdk.js +28 -5
- package/lib/module/Chatbotsdk.js.map +1 -1
- package/lib/module/openChatbot.js +2 -1
- package/lib/module/utils/systemInfo.js +74 -1
- package/lib/module/utils/systemInfo.js.map +1 -1
- package/lib/module/versions/version.staging.js +1 -1
- package/lib/typescript/Chatbotsdk.d.ts.map +1 -1
- package/lib/typescript/utils/systemInfo.d.ts +9 -0
- package/lib/typescript/utils/systemInfo.d.ts.map +1 -1
- package/lib/typescript/versions/version.staging.d.ts +1 -1
- package/package.json +1 -1
- package/src/Chatbotsdk.tsx +54 -26
- package/src/utils/systemInfo.ts +91 -3
- package/src/versions/version.staging.ts +1 -1
|
@@ -1,11 +1,34 @@
|
|
|
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 _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 _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/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;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 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(isInitialized){openWebView();}},close:function close(){if(isInitialized){closeWebView();}},toggle:function toggle(){if(isInitialized){if(isWebViewVisible){closeWebView();}else{openWebView();}}},isReady:function isReady(){return isInitialized;}};},[isInitialized,isWebViewVisible]);var triggerAppInit=function triggerAppInit(){if(webViewRef.current){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 _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 _version=require("./version");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 _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/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;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 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(isInitialized){openWebView();}},close:function close(){if(isInitialized){closeWebView();}},toggle:function toggle(){if(isInitialized){if(isWebViewVisible){closeWebView();}else{openWebView();}}},isReady:function isReady(){return isInitialized;}};},[isInitialized,isWebViewVisible]);var triggerAppInit=function triggerAppInit(){if(webViewRef.current){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(event){var _webViewRef$current;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$current=webViewRef.current)==null?void 0:_webViewRef$current.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:""});return;}if((parsedData==null?void 0:parsedData.type)==="APP_READY"){emitEvent(_events.ChatbotEventType.CHATBOT_APP_READY);if(webViewRef.current&&isWebViewVisible){var _webViewRef$current2,_webViewRef$current3;
|
|
6
|
-
|
|
7
|
-
|
|
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};(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;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}});}},[emitEvent,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref2=(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$current4;(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref2.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current5;(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl=`${_constants.API_URL}/chat/chatbot/get/`;var payload={client_user_id:effectiveUserId,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 _ref3.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});var iFrameUrlFromBackend=chatbotConfig==null?void 0:chatbotConfig.chat_iframe_url;if(iFrameUrlFromBackend){return`${iFrameUrlFromBackend}`;}return`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;}var openWebView=(0,_react.useCallback)(function(){setIsWebViewVisible(true);if(enableAnimation){(0,_animations.animateWebViewOpen)(animatedValues,function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,2000);}});}else{requestAnimationFrame(function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,2000);}});}},[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(){setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);});}else{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){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 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,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,{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$current6;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript(`
|
|
5
|
+
`);}};var executeStorageOp=(0,_react.useCallback)(function(operation){if(isStorageReady){operation();}else{pendingStorageOps.current.push(operation);}},[isStorageReady]);var handleMessage=(0,_react.useCallback)(function(event){var _webViewRef$current;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$current=webViewRef.current)==null?void 0:_webViewRef$current.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:""});return;}if((parsedData==null?void 0:parsedData.type)==="APP_READY"){emitEvent(_events.ChatbotEventType.CHATBOT_APP_READY);if(webViewRef.current&&isWebViewVisible){var _webViewRef$current2,_webViewRef$current3;var rnSystemInfo={platform:_reactNative.Platform.OS,device:(0,_systemInfo.getDeviceType)(),screen_size:(0,_systemInfo.getScreenSize)(),sdk_version:_version.SDK_VERSION};(_webViewRef$current2=webViewRef.current)==null?void 0:_webViewRef$current2.injectJavaScript((0,_systemInfo.getCompleteSystemInfoScript)(rnSystemInfo));(_webViewRef$current3=webViewRef.current)==null?void 0:_webViewRef$current3.injectJavaScript(`
|
|
6
|
+
(function() {
|
|
7
|
+
const completeSystemInfo = ${(0,_systemInfo.getCompleteSystemInfoFromWebView)()};
|
|
8
|
+
if (completeSystemInfo) {
|
|
9
|
+
const systemInfo = JSON.parse(completeSystemInfo);
|
|
10
|
+
const messageData = {
|
|
11
|
+
name: "registerUserId",
|
|
12
|
+
action: "registerUserId",
|
|
13
|
+
data: {
|
|
14
|
+
userId: "${effectiveUserId}",
|
|
15
|
+
token: ${user_token?`"${user_token}"`:"undefined"},
|
|
16
|
+
userProfile: {
|
|
17
|
+
...${JSON.stringify(user_profile)},
|
|
18
|
+
...systemInfo,
|
|
19
|
+
__INT_SYS_INFO__: {
|
|
20
|
+
...systemInfo,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
console.log("messageData====>", JSON.stringify(messageData));
|
|
26
|
+
window.postMessage(${JSON.stringify({name:"openFrame",domain:"app-domain.com"})}, '*');
|
|
27
|
+
window.postMessage(JSON.stringify(messageData), '*');
|
|
28
|
+
}
|
|
29
|
+
})();
|
|
30
|
+
true;
|
|
31
|
+
`);}}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};(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;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}});}},[emitEvent,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref2=(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$current4;(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref2.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current5;(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl=`${_constants.API_URL}/chat/chatbot/get/`;var payload={client_user_id:effectiveUserId,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 _ref3.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});var iFrameUrlFromBackend=chatbotConfig==null?void 0:chatbotConfig.chat_iframe_url;if(iFrameUrlFromBackend){return`${iFrameUrlFromBackend}`;}return`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;}var openWebView=(0,_react.useCallback)(function(){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(){setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);});}else{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){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 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,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,{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$current6;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript(`
|
|
9
32
|
if (!document.querySelector('meta[name="viewport"]')) {
|
|
10
33
|
var meta = document.createElement('meta');
|
|
11
34
|
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","_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","_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","animatedValues","scale","Animated","Value","translateY","opacity","current","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","useImperativeHandle","open","openWebView","close","closeWebView","toggle","isReady","triggerAppInit","injectJavaScript","executeStorageOp","useCallback","operation","push","handleMessage","event","_webViewRef$current","data","nativeEvent","parsedData","JSON","parse","values","StorageMessageType","includes","type","storageMessage","STORAGE_READY","forEach","op","createStorageMessage","GET_STORAGE","STORAGE_RESPONSE","key","value","STORAGE_ERROR","logger","error","__DEV__","console","log","level","_parsedData$data","ChatbotEventType","CHATBOT_APP_READY","_webViewRef$current2","_webViewRef$current3","getBrowserAndOSInfoScript","messageData","name","action","token","undefined","userProfile","assign","getSystemInfo","__INT_SYS_INFO__","debug","stringify","domain","url","filename","downloadData","handleDownloadRequest","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","errorTracker","trackError","Error","ErrorTypes","RUNTIME_ERROR","context","useEffect","initializeUserId","_ref2","_asyncToGenerator2","String","generateUUID","_webViewRef$current4","SET_STORAGE","apply","arguments","getStorageScript","_webViewRef$current5","fetchChatbotConfig","_ref3","_data$user","endpointUrl","API_URL","payload","client_user_id","org_id","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","iFrameUrlFromBackend","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","screenDimensions","enableNetworkDebug","sideSpacing","bottomSpacing","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","webViewWrapper","pointerEvents","fullScreenContainer","transform","WebView","webviewDebuggingEnabled","source","uri","webview","containerStyle","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","request","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current6","enableWebViewDebug","onError","syntheticEvent","description","code","displayName","StyleSheet","create","flex","overflow","top","left","right","bottom","zIndex","backgroundColor","inlineContainer","_default"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"+aAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WASA,IAAAC,YAAA,CAAAD,OAAA,iBAUA,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,mBACA,IAAAS,OAAA,CAAAT,OAAA,mBACA,IAAAU,YAAA,CAAAV,OAAA,wBACA,IAAAW,YAAA,CAAAP,sBAAA,CAAAJ,OAAA,8BACA,IAAAY,cAAA,CA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,CAAE,CACnB7D,QAAQ,CAAE,UAAU,CACpB8F,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,CACDhC,OAAO,CAAE,CACPyB,IAAI,CAAE,CAAC,CACPO,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KACV,CACF,CAAC,CAAC,CAAC,IAAAG,QAAA,CAAAzU,OAAA,CAAAX,OAAA,CAEYc,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_systemInfo","_version","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_animations","_fileDownload","_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","_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","animatedValues","scale","Animated","Value","translateY","opacity","current","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","useImperativeHandle","open","openWebView","close","closeWebView","toggle","isReady","triggerAppInit","injectJavaScript","executeStorageOp","useCallback","operation","push","handleMessage","event","_webViewRef$current","data","nativeEvent","parsedData","JSON","parse","values","StorageMessageType","includes","type","storageMessage","STORAGE_READY","forEach","op","createStorageMessage","GET_STORAGE","STORAGE_RESPONSE","key","value","STORAGE_ERROR","logger","error","__DEV__","console","log","level","_parsedData$data","ChatbotEventType","CHATBOT_APP_READY","_webViewRef$current2","_webViewRef$current3","rnSystemInfo","platform","Platform","OS","device","getDeviceType","screen_size","getScreenSize","sdk_version","SDK_VERSION","getCompleteSystemInfoScript","getCompleteSystemInfoFromWebView","stringify","name","domain","url","filename","downloadData","handleDownloadRequest","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","errorTracker","trackError","Error","ErrorTypes","RUNTIME_ERROR","context","messageData","useEffect","initializeUserId","_ref2","_asyncToGenerator2","String","undefined","generateUUID","_webViewRef$current4","SET_STORAGE","apply","arguments","getStorageScript","_webViewRef$current5","fetchChatbotConfig","_ref3","_data$user","endpointUrl","API_URL","payload","client_user_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","iFrameUrlFromBackend","BASE_CHATBOT_URL","toString","animateWebViewOpen","CHATBOT_OPENED","setTimeout","requestAnimationFrame","postMessage","animateWebViewClose","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","StatusBar","currentHeight","screenDimensions","enableNetworkDebug","sideSpacing","bottomSpacing","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","webViewWrapper","pointerEvents","fullScreenContainer","transform","WebView","webviewDebuggingEnabled","source","uri","webview","containerStyle","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","request","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current6","enableWebViewDebug","onError","syntheticEvent","description","code","displayName","StyleSheet","create","flex","overflow","top","left","right","bottom","zIndex","backgroundColor","inlineContainer","_default"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"+aAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WASA,IAAAC,YAAA,CAAAD,OAAA,iBAUA,IAAAE,mBAAA,CAAAF,OAAA,yBACA,IAAAG,eAAA,CAAAC,sBAAA,CAAAJ,OAAA,sBACA,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D,QAAQ,CAAE,UAAU,CACpB4F,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,CACDtC,mBAAmB,CAAE,CACnB3D,QAAQ,CAAE,UAAU,CACpB4F,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,CACDhC,OAAO,CAAE,CACPyB,IAAI,CAAE,CAAC,CACPO,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KACV,CACF,CAAC,CAAC,CAAC,IAAAG,QAAA,CAAA5U,OAAA,CAAAX,OAAA,CAEYc,OAAO","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["openChatbot.tsx"],"mappings":"","ignoreList":[]}
|
|
@@ -1,4 +1,70 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.getSystemInfo=exports.getBrowserAndOSInfoScript=void 0;var _reactNative=require("react-native");var _version=require("../version");var getDeviceType=function getDeviceType(){var _Dimensions$get=_reactNative.Dimensions.get("window"),width=_Dimensions$get.width,height=_Dimensions$get.height;var aspectRatio=height/width;if(_reactNative.Platform.OS==="ios"){return _reactNative.Platform.isPad?"iPad":"iPhone";}else if(_reactNative.Platform.OS==="android"){return aspectRatio<1.6?"Android Tablet":"Android Phone";}return"Desktop";};var getScreenSize=function getScreenSize(){return{width:Math.round(_reactNative.Dimensions.get("window").width*_reactNative.PixelRatio.get()),height:Math.round(_reactNative.Dimensions.get("window").height*_reactNative.PixelRatio.get())};};var
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.getSystemInfo=exports.getScreenSize=exports.getDeviceType=exports.getCompleteSystemInfoScript=exports.getCompleteSystemInfoFromWebView=exports.getBrowserAndOSInfoScript=void 0;var _reactNative=require("react-native");var _version=require("../version");var getDeviceType=exports.getDeviceType=function getDeviceType(){var _Dimensions$get=_reactNative.Dimensions.get("window"),width=_Dimensions$get.width,height=_Dimensions$get.height;var aspectRatio=height/width;if(_reactNative.Platform.OS==="ios"){return _reactNative.Platform.isPad?"iPad":"iPhone";}else if(_reactNative.Platform.OS==="android"){return aspectRatio<1.6?"Android Tablet":"Android Phone";}return"Desktop";};var getScreenSize=exports.getScreenSize=function getScreenSize(){return{width:Math.round(_reactNative.Dimensions.get("window").width*_reactNative.PixelRatio.get()),height:Math.round(_reactNative.Dimensions.get("window").height*_reactNative.PixelRatio.get())};};var getCompleteSystemInfoScript=exports.getCompleteSystemInfoScript=function getCompleteSystemInfoScript(systemInfo){return`
|
|
2
|
+
(function() {
|
|
3
|
+
const userAgent = navigator.userAgent;
|
|
4
|
+
|
|
5
|
+
// OS Detection
|
|
6
|
+
let os = "unknown";
|
|
7
|
+
if (userAgent.indexOf("Win") !== -1) os = "Windows";
|
|
8
|
+
else if (userAgent.indexOf("Mac") !== -1) os = "MacOS";
|
|
9
|
+
else if (userAgent.indexOf("Linux") !== -1) os = "Linux";
|
|
10
|
+
else if (userAgent.indexOf("Android") !== -1) os = "Android";
|
|
11
|
+
else if (userAgent.indexOf("like Mac") !== -1) os = "iOS";
|
|
12
|
+
|
|
13
|
+
// Browser Detection
|
|
14
|
+
let browser = "unknown";
|
|
15
|
+
let browserVersion = null;
|
|
16
|
+
|
|
17
|
+
if (userAgent.indexOf("Chrome") !== -1) {
|
|
18
|
+
browser = "Chrome";
|
|
19
|
+
const chromeMatch = userAgent.match(/Chrome\\/([0-9.]+)/);
|
|
20
|
+
browserVersion = chromeMatch ? chromeMatch[1] : null;
|
|
21
|
+
} else if (userAgent.indexOf("Safari") !== -1) {
|
|
22
|
+
browser = "Safari";
|
|
23
|
+
const safariMatch = userAgent.match(/Version\\/([0-9.]+)/);
|
|
24
|
+
browserVersion = safariMatch ? safariMatch[1] : null;
|
|
25
|
+
} else if (userAgent.indexOf("Firefox") !== -1) {
|
|
26
|
+
browser = "Firefox";
|
|
27
|
+
const firefoxMatch = userAgent.match(/Firefox\\/([0-9.]+)/);
|
|
28
|
+
browserVersion = firefoxMatch ? firefoxMatch[1] : null;
|
|
29
|
+
} else if (userAgent.indexOf("Edge") !== -1) {
|
|
30
|
+
browser = "Edge";
|
|
31
|
+
const edgeMatch = userAgent.match(/Edge\\/([0-9.]+)/);
|
|
32
|
+
browserVersion = edgeMatch ? edgeMatch[1] : null;
|
|
33
|
+
} else if (userAgent.indexOf("MSIE") !== -1 || userAgent.indexOf("Trident/") !== -1) {
|
|
34
|
+
browser = "IE";
|
|
35
|
+
const ieMatch = userAgent.match(/(?:MSIE |rv:)([0-9.]+)/);
|
|
36
|
+
browserVersion = ieMatch ? ieMatch[1] : null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Browser Language
|
|
40
|
+
const browserLanguage = navigator.language || navigator.languages?.[0] || null;
|
|
41
|
+
|
|
42
|
+
// Complete system info object
|
|
43
|
+
const completeSystemInfo = {
|
|
44
|
+
platform: "${systemInfo.platform}",
|
|
45
|
+
os: os,
|
|
46
|
+
browser: browser,
|
|
47
|
+
browser_version: browserVersion,
|
|
48
|
+
browser_language: browserLanguage,
|
|
49
|
+
sdk_version: "${systemInfo.sdk_version}",
|
|
50
|
+
device: "${systemInfo.device}",
|
|
51
|
+
screen_size: ${JSON.stringify(systemInfo.screen_size)},
|
|
52
|
+
user_agent: navigator.userAgent
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// Store in window for immediate access
|
|
56
|
+
window.__COMPLETE_SYSTEM_INFO__ = completeSystemInfo;
|
|
57
|
+
|
|
58
|
+
// Also post message for backward compatibility
|
|
59
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
60
|
+
type: 'SYSTEM_INFO',
|
|
61
|
+
data: { os, browser, browser_version: browserVersion, browser_language: browserLanguage, user_agent: navigator.userAgent }
|
|
62
|
+
}));
|
|
63
|
+
|
|
64
|
+
return completeSystemInfo;
|
|
65
|
+
})();
|
|
66
|
+
true;
|
|
67
|
+
`;};var getBrowserAndOSInfoScript=exports.getBrowserAndOSInfoScript=function getBrowserAndOSInfoScript(){return`
|
|
2
68
|
function getOSAndBrowser() {
|
|
3
69
|
const userAgent = navigator.userAgent;
|
|
4
70
|
|
|
@@ -45,5 +111,12 @@ Object.defineProperty(exports,"__esModule",{value:true});exports.getSystemInfo=e
|
|
|
45
111
|
}
|
|
46
112
|
getOSAndBrowser();
|
|
47
113
|
true;
|
|
114
|
+
`;};var getCompleteSystemInfoFromWebView=exports.getCompleteSystemInfoFromWebView=function getCompleteSystemInfoFromWebView(){return`
|
|
115
|
+
(function() {
|
|
116
|
+
if (window.__COMPLETE_SYSTEM_INFO__) {
|
|
117
|
+
return JSON.stringify(window.__COMPLETE_SYSTEM_INFO__);
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
})();
|
|
48
121
|
`;};var getSystemInfo=exports.getSystemInfo=function getSystemInfo(webViewSystemInfo){return{platform:_reactNative.Platform.OS,os:webViewSystemInfo.os||_reactNative.Platform.OS,browser:webViewSystemInfo.browser||"WebView",browser_version:webViewSystemInfo.browser_version||null,browser_language:webViewSystemInfo.browser_language||null,sdk_version:_version.SDK_VERSION,device:getDeviceType(),screen_size:getScreenSize(),user_agent:(webViewSystemInfo==null?void 0:webViewSystemInfo.user_agent)||null};};
|
|
49
122
|
//# sourceMappingURL=systemInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_version","getDeviceType","_Dimensions$get","Dimensions","get","width","height","aspectRatio","Platform","OS","isPad","getScreenSize","Math","round","PixelRatio","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_version","getDeviceType","exports","_Dimensions$get","Dimensions","get","width","height","aspectRatio","Platform","OS","isPad","getScreenSize","Math","round","PixelRatio","getCompleteSystemInfoScript","systemInfo","platform","sdk_version","device","JSON","stringify","screen_size","getBrowserAndOSInfoScript","getCompleteSystemInfoFromWebView","getSystemInfo","webViewSystemInfo","os","browser","browser_version","browser_language","SDK_VERSION","user_agent"],"sourceRoot":"../../../src","sources":["utils/systemInfo.ts"],"mappings":"iPAAA,IAAAA,YAAA,CAAAC,OAAA,iBACA,IAAAC,QAAA,CAAAD,OAAA,eAoBO,GAAM,CAAAE,aAAa,CAAAC,OAAA,CAAAD,aAAA,CAAG,QAAhB,CAAAA,aAAaA,CAAA,CAAiB,CACzC,IAAAE,eAAA,CAA0BC,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CAA1CC,KAAK,CAAAH,eAAA,CAALG,KAAK,CAAEC,MAAM,CAAAJ,eAAA,CAANI,MAAM,CACrB,GAAM,CAAAC,WAAW,CAAGD,MAAM,CAAGD,KAAK,CAElC,GAAIG,qBAAQ,CAACC,EAAE,GAAK,KAAK,CAAE,CACzB,MAAO,CAAAD,qBAAQ,CAACE,KAAK,CAAG,MAAM,CAAG,QAAQ,CAC3C,CAAC,IAAM,IAAIF,qBAAQ,CAACC,EAAE,GAAK,SAAS,CAAE,CACpC,MAAO,CAAAF,WAAW,CAAG,GAAG,CAAG,gBAAgB,CAAG,eAAe,CAC/D,CACA,MAAO,SAAS,CAClB,CAAC,CAGM,GAAM,CAAAI,aAAa,CAAAV,OAAA,CAAAU,aAAA,CAAG,QAAhB,CAAAA,aAAaA,CAAA,CAAqB,CAC7C,MAAO,CACLN,KAAK,CAAEO,IAAI,CAACC,KAAK,CAACV,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CAACC,KAAK,CAAGS,uBAAU,CAACV,GAAG,CAAC,CAAC,CAAC,CACpEE,MAAM,CAAEM,IAAI,CAACC,KAAK,CAACV,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CAACE,MAAM,CAAGQ,uBAAU,CAACV,GAAG,CAAC,CAAC,CACvE,CAAC,CACH,CAAC,CAGM,GAAM,CAAAW,2BAA2B,CAAAd,OAAA,CAAAc,2BAAA,CAAG,QAA9B,CAAAA,2BAA2BA,CAAIC,UAK3C,CAAa,CACZ,MAAO;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqBA,UAAU,CAACC,QAAQ;AACxC;AACA;AACA;AACA;AACA,wBAAwBD,UAAU,CAACE,WAAW;AAC9C,mBAAmBF,UAAU,CAACG,MAAM;AACpC,uBAAuBC,IAAI,CAACC,SAAS,CAACL,UAAU,CAACM,WAAW,CAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CACH,CAAC,CAGM,GAAM,CAAAC,yBAAyB,CAAAtB,OAAA,CAAAsB,yBAAA,CAAG,QAA5B,CAAAA,yBAAyBA,CAAA,CAAiB,CACrD,MAAO;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CACH,CAAC,CAGM,GAAM,CAAAC,gCAAgC,CAAAvB,OAAA,CAAAuB,gCAAA,CAAG,QAAnC,CAAAA,gCAAgCA,CAAA,CAAiB,CAC5D,MAAO;AACT;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CACH,CAAC,CAGM,GAAM,CAAAC,aAAa,CAAAxB,OAAA,CAAAwB,aAAA,CAAG,QAAhB,CAAAA,aAAaA,CAAIC,iBAM7B,CAAiB,CAChB,MAAO,CACLT,QAAQ,CAAET,qBAAQ,CAACC,EAAE,CACrBkB,EAAE,CAAED,iBAAiB,CAACC,EAAE,EAAInB,qBAAQ,CAACC,EAAE,CACvCmB,OAAO,CAAEF,iBAAiB,CAACE,OAAO,EAAI,SAAS,CAC/CC,eAAe,CAAEH,iBAAiB,CAACG,eAAe,EAAI,IAAI,CAC1DC,gBAAgB,CAAEJ,iBAAiB,CAACI,gBAAgB,EAAI,IAAI,CAC5DZ,WAAW,CAAEa,oBAAW,CACxBZ,MAAM,CAAEnB,aAAa,CAAC,CAAC,CACvBsB,WAAW,CAAEX,aAAa,CAAC,CAAC,CAC5BqB,UAAU,CAAE,CAAAN,iBAAiB,cAAjBA,iBAAiB,CAAEM,UAAU,GAAI,IAC/C,CAAC,CACH,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.0.27-staging.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.27-staging.6';
|
|
2
2
|
//# sourceMappingURL=version.staging.js.map
|
package/lib/module/Chatbotsdk.js
CHANGED
|
@@ -1,11 +1,34 @@
|
|
|
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 _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 _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/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;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 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(isInitialized){openWebView();}},close:function close(){if(isInitialized){closeWebView();}},toggle:function toggle(){if(isInitialized){if(isWebViewVisible){closeWebView();}else{openWebView();}}},isReady:function isReady(){return isInitialized;}};},[isInitialized,isWebViewVisible]);var triggerAppInit=function triggerAppInit(){if(webViewRef.current){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 _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 _version=require("./version");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 _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/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;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 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(isInitialized){openWebView();}},close:function close(){if(isInitialized){closeWebView();}},toggle:function toggle(){if(isInitialized){if(isWebViewVisible){closeWebView();}else{openWebView();}}},isReady:function isReady(){return isInitialized;}};},[isInitialized,isWebViewVisible]);var triggerAppInit=function triggerAppInit(){if(webViewRef.current){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(event){var _webViewRef$current;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$current=webViewRef.current)==null?void 0:_webViewRef$current.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:""});return;}if((parsedData==null?void 0:parsedData.type)==="APP_READY"){emitEvent(_events.ChatbotEventType.CHATBOT_APP_READY);if(webViewRef.current&&isWebViewVisible){var _webViewRef$current2,_webViewRef$current3;
|
|
6
|
-
|
|
7
|
-
|
|
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};(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;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}});}},[emitEvent,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref2=(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$current4;(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref2.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current5;(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl=`${_constants.API_URL}/chat/chatbot/get/`;var payload={client_user_id:effectiveUserId,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 _ref3.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});var iFrameUrlFromBackend=chatbotConfig==null?void 0:chatbotConfig.chat_iframe_url;if(iFrameUrlFromBackend){return`${iFrameUrlFromBackend}`;}return`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;}var openWebView=(0,_react.useCallback)(function(){setIsWebViewVisible(true);if(enableAnimation){(0,_animations.animateWebViewOpen)(animatedValues,function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,2000);}});}else{requestAnimationFrame(function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,2000);}});}},[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(){setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);});}else{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){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 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,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,{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$current6;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript(`
|
|
5
|
+
`);}};var executeStorageOp=(0,_react.useCallback)(function(operation){if(isStorageReady){operation();}else{pendingStorageOps.current.push(operation);}},[isStorageReady]);var handleMessage=(0,_react.useCallback)(function(event){var _webViewRef$current;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$current=webViewRef.current)==null?void 0:_webViewRef$current.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:""});return;}if((parsedData==null?void 0:parsedData.type)==="APP_READY"){emitEvent(_events.ChatbotEventType.CHATBOT_APP_READY);if(webViewRef.current&&isWebViewVisible){var _webViewRef$current2,_webViewRef$current3;var rnSystemInfo={platform:_reactNative.Platform.OS,device:(0,_systemInfo.getDeviceType)(),screen_size:(0,_systemInfo.getScreenSize)(),sdk_version:_version.SDK_VERSION};(_webViewRef$current2=webViewRef.current)==null?void 0:_webViewRef$current2.injectJavaScript((0,_systemInfo.getCompleteSystemInfoScript)(rnSystemInfo));(_webViewRef$current3=webViewRef.current)==null?void 0:_webViewRef$current3.injectJavaScript(`
|
|
6
|
+
(function() {
|
|
7
|
+
const completeSystemInfo = ${(0,_systemInfo.getCompleteSystemInfoFromWebView)()};
|
|
8
|
+
if (completeSystemInfo) {
|
|
9
|
+
const systemInfo = JSON.parse(completeSystemInfo);
|
|
10
|
+
const messageData = {
|
|
11
|
+
name: "registerUserId",
|
|
12
|
+
action: "registerUserId",
|
|
13
|
+
data: {
|
|
14
|
+
userId: "${effectiveUserId}",
|
|
15
|
+
token: ${user_token?`"${user_token}"`:"undefined"},
|
|
16
|
+
userProfile: {
|
|
17
|
+
...${JSON.stringify(user_profile)},
|
|
18
|
+
...systemInfo,
|
|
19
|
+
__INT_SYS_INFO__: {
|
|
20
|
+
...systemInfo,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
console.log("messageData====>", JSON.stringify(messageData));
|
|
26
|
+
window.postMessage(${JSON.stringify({name:"openFrame",domain:"app-domain.com"})}, '*');
|
|
27
|
+
window.postMessage(JSON.stringify(messageData), '*');
|
|
28
|
+
}
|
|
29
|
+
})();
|
|
30
|
+
true;
|
|
31
|
+
`);}}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};(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;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}});}},[emitEvent,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref2=(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$current4;(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref2.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current5;(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl=`${_constants.API_URL}/chat/chatbot/get/`;var payload={client_user_id:effectiveUserId,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 _ref3.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});var iFrameUrlFromBackend=chatbotConfig==null?void 0:chatbotConfig.chat_iframe_url;if(iFrameUrlFromBackend){return`${iFrameUrlFromBackend}`;}return`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;}var openWebView=(0,_react.useCallback)(function(){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(){setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);});}else{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){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 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,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,{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$current6;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript(`
|
|
9
32
|
if (!document.querySelector('meta[name="viewport"]')) {
|
|
10
33
|
var meta = document.createElement('meta');
|
|
11
34
|
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","_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","_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","animatedValues","scale","Animated","Value","translateY","opacity","current","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","useImperativeHandle","open","openWebView","close","closeWebView","toggle","isReady","triggerAppInit","injectJavaScript","executeStorageOp","useCallback","operation","push","handleMessage","event","_webViewRef$current","data","nativeEvent","parsedData","JSON","parse","values","StorageMessageType","includes","type","storageMessage","STORAGE_READY","forEach","op","createStorageMessage","GET_STORAGE","STORAGE_RESPONSE","key","value","STORAGE_ERROR","logger","error","__DEV__","console","log","level","_parsedData$data","ChatbotEventType","CHATBOT_APP_READY","_webViewRef$current2","_webViewRef$current3","getBrowserAndOSInfoScript","messageData","name","action","token","undefined","userProfile","assign","getSystemInfo","__INT_SYS_INFO__","debug","stringify","domain","url","filename","downloadData","handleDownloadRequest","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","errorTracker","trackError","Error","ErrorTypes","RUNTIME_ERROR","context","useEffect","initializeUserId","_ref2","_asyncToGenerator2","String","generateUUID","_webViewRef$current4","SET_STORAGE","apply","arguments","getStorageScript","_webViewRef$current5","fetchChatbotConfig","_ref3","_data$user","endpointUrl","API_URL","payload","client_user_id","org_id","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","iFrameUrlFromBackend","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","screenDimensions","enableNetworkDebug","sideSpacing","bottomSpacing","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","webViewWrapper","pointerEvents","fullScreenContainer","transform","WebView","webviewDebuggingEnabled","source","uri","webview","containerStyle","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","request","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current6","enableWebViewDebug","onError","syntheticEvent","description","code","displayName","StyleSheet","create","flex","overflow","top","left","right","bottom","zIndex","backgroundColor","inlineContainer","_default"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"+aAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WASA,IAAAC,YAAA,CAAAD,OAAA,iBAUA,IAAAE,mBAAA,CAAAF,OAAA,yBACA,IAAAG,eAAA,CAAAC,sBAAA,CAAAJ,OAAA,sBACA,IAAAK,UAAA,CAAAL,OAAA,gBACA,IAAAM,WAAA,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,QAAQ,CAAE,UAAU,CACpB8F,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,CACDtC,mBAAmB,CAAE,CACnB7D,QAAQ,CAAE,UAAU,CACpB8F,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,CACDhC,OAAO,CAAE,CACPyB,IAAI,CAAE,CAAC,CACPO,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KACV,CACF,CAAC,CAAC,CAAC,IAAAG,QAAA,CAAAzU,OAAA,CAAAX,OAAA,CAEYc,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_systemInfo","_version","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_animations","_fileDownload","_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","_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","animatedValues","scale","Animated","Value","translateY","opacity","current","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","useImperativeHandle","open","openWebView","close","closeWebView","toggle","isReady","triggerAppInit","injectJavaScript","executeStorageOp","useCallback","operation","push","handleMessage","event","_webViewRef$current","data","nativeEvent","parsedData","JSON","parse","values","StorageMessageType","includes","type","storageMessage","STORAGE_READY","forEach","op","createStorageMessage","GET_STORAGE","STORAGE_RESPONSE","key","value","STORAGE_ERROR","logger","error","__DEV__","console","log","level","_parsedData$data","ChatbotEventType","CHATBOT_APP_READY","_webViewRef$current2","_webViewRef$current3","rnSystemInfo","platform","Platform","OS","device","getDeviceType","screen_size","getScreenSize","sdk_version","SDK_VERSION","getCompleteSystemInfoScript","getCompleteSystemInfoFromWebView","stringify","name","domain","url","filename","downloadData","handleDownloadRequest","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","errorTracker","trackError","Error","ErrorTypes","RUNTIME_ERROR","context","messageData","useEffect","initializeUserId","_ref2","_asyncToGenerator2","String","undefined","generateUUID","_webViewRef$current4","SET_STORAGE","apply","arguments","getStorageScript","_webViewRef$current5","fetchChatbotConfig","_ref3","_data$user","endpointUrl","API_URL","payload","client_user_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","iFrameUrlFromBackend","BASE_CHATBOT_URL","toString","animateWebViewOpen","CHATBOT_OPENED","setTimeout","requestAnimationFrame","postMessage","animateWebViewClose","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","StatusBar","currentHeight","screenDimensions","enableNetworkDebug","sideSpacing","bottomSpacing","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","webViewWrapper","pointerEvents","fullScreenContainer","transform","WebView","webviewDebuggingEnabled","source","uri","webview","containerStyle","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","request","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current6","enableWebViewDebug","onError","syntheticEvent","description","code","displayName","StyleSheet","create","flex","overflow","top","left","right","bottom","zIndex","backgroundColor","inlineContainer","_default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AC6T,WAAW,CAAG,SAAS,CAE/B,GAAM,CAAArC,MAAM,CAAGsC,uBAAU,CAACC,MAAM,CAAC,CAC/BtC,aAAa,CAAE,CACbuC,IAAI,CAAE,CAAC,CACP1F,QAAQ,CAAE,UAAU,CACpB2F,QAAQ,CAAE,SACZ,CAAC,CACDlC,cAAc,CAAE,CACdzD,QAAQ,CAAE,UAAU,CACpB4F,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,CACDtC,mBAAmB,CAAE,CACnB3D,QAAQ,CAAE,UAAU,CACpB4F,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,CACDhC,OAAO,CAAE,CACPyB,IAAI,CAAE,CAAC,CACPO,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KACV,CACF,CAAC,CAAC,CAAC,IAAAG,QAAA,CAAA5U,OAAA,CAAAX,OAAA,CAEYc,OAAO","ignoreList":[]}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
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);};
|
|
2
3
|
//# sourceMappingURL=openChatbot.js.map
|
|
@@ -1,4 +1,70 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.getSystemInfo=exports.getBrowserAndOSInfoScript=void 0;var _reactNative=require("react-native");var _version=require("../version");var getDeviceType=function getDeviceType(){var _Dimensions$get=_reactNative.Dimensions.get("window"),width=_Dimensions$get.width,height=_Dimensions$get.height;var aspectRatio=height/width;if(_reactNative.Platform.OS==="ios"){return _reactNative.Platform.isPad?"iPad":"iPhone";}else if(_reactNative.Platform.OS==="android"){return aspectRatio<1.6?"Android Tablet":"Android Phone";}return"Desktop";};var getScreenSize=function getScreenSize(){return{width:Math.round(_reactNative.Dimensions.get("window").width*_reactNative.PixelRatio.get()),height:Math.round(_reactNative.Dimensions.get("window").height*_reactNative.PixelRatio.get())};};var
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.getSystemInfo=exports.getScreenSize=exports.getDeviceType=exports.getCompleteSystemInfoScript=exports.getCompleteSystemInfoFromWebView=exports.getBrowserAndOSInfoScript=void 0;var _reactNative=require("react-native");var _version=require("../version");var getDeviceType=exports.getDeviceType=function getDeviceType(){var _Dimensions$get=_reactNative.Dimensions.get("window"),width=_Dimensions$get.width,height=_Dimensions$get.height;var aspectRatio=height/width;if(_reactNative.Platform.OS==="ios"){return _reactNative.Platform.isPad?"iPad":"iPhone";}else if(_reactNative.Platform.OS==="android"){return aspectRatio<1.6?"Android Tablet":"Android Phone";}return"Desktop";};var getScreenSize=exports.getScreenSize=function getScreenSize(){return{width:Math.round(_reactNative.Dimensions.get("window").width*_reactNative.PixelRatio.get()),height:Math.round(_reactNative.Dimensions.get("window").height*_reactNative.PixelRatio.get())};};var getCompleteSystemInfoScript=exports.getCompleteSystemInfoScript=function getCompleteSystemInfoScript(systemInfo){return`
|
|
2
|
+
(function() {
|
|
3
|
+
const userAgent = navigator.userAgent;
|
|
4
|
+
|
|
5
|
+
// OS Detection
|
|
6
|
+
let os = "unknown";
|
|
7
|
+
if (userAgent.indexOf("Win") !== -1) os = "Windows";
|
|
8
|
+
else if (userAgent.indexOf("Mac") !== -1) os = "MacOS";
|
|
9
|
+
else if (userAgent.indexOf("Linux") !== -1) os = "Linux";
|
|
10
|
+
else if (userAgent.indexOf("Android") !== -1) os = "Android";
|
|
11
|
+
else if (userAgent.indexOf("like Mac") !== -1) os = "iOS";
|
|
12
|
+
|
|
13
|
+
// Browser Detection
|
|
14
|
+
let browser = "unknown";
|
|
15
|
+
let browserVersion = null;
|
|
16
|
+
|
|
17
|
+
if (userAgent.indexOf("Chrome") !== -1) {
|
|
18
|
+
browser = "Chrome";
|
|
19
|
+
const chromeMatch = userAgent.match(/Chrome\\/([0-9.]+)/);
|
|
20
|
+
browserVersion = chromeMatch ? chromeMatch[1] : null;
|
|
21
|
+
} else if (userAgent.indexOf("Safari") !== -1) {
|
|
22
|
+
browser = "Safari";
|
|
23
|
+
const safariMatch = userAgent.match(/Version\\/([0-9.]+)/);
|
|
24
|
+
browserVersion = safariMatch ? safariMatch[1] : null;
|
|
25
|
+
} else if (userAgent.indexOf("Firefox") !== -1) {
|
|
26
|
+
browser = "Firefox";
|
|
27
|
+
const firefoxMatch = userAgent.match(/Firefox\\/([0-9.]+)/);
|
|
28
|
+
browserVersion = firefoxMatch ? firefoxMatch[1] : null;
|
|
29
|
+
} else if (userAgent.indexOf("Edge") !== -1) {
|
|
30
|
+
browser = "Edge";
|
|
31
|
+
const edgeMatch = userAgent.match(/Edge\\/([0-9.]+)/);
|
|
32
|
+
browserVersion = edgeMatch ? edgeMatch[1] : null;
|
|
33
|
+
} else if (userAgent.indexOf("MSIE") !== -1 || userAgent.indexOf("Trident/") !== -1) {
|
|
34
|
+
browser = "IE";
|
|
35
|
+
const ieMatch = userAgent.match(/(?:MSIE |rv:)([0-9.]+)/);
|
|
36
|
+
browserVersion = ieMatch ? ieMatch[1] : null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Browser Language
|
|
40
|
+
const browserLanguage = navigator.language || navigator.languages?.[0] || null;
|
|
41
|
+
|
|
42
|
+
// Complete system info object
|
|
43
|
+
const completeSystemInfo = {
|
|
44
|
+
platform: "${systemInfo.platform}",
|
|
45
|
+
os: os,
|
|
46
|
+
browser: browser,
|
|
47
|
+
browser_version: browserVersion,
|
|
48
|
+
browser_language: browserLanguage,
|
|
49
|
+
sdk_version: "${systemInfo.sdk_version}",
|
|
50
|
+
device: "${systemInfo.device}",
|
|
51
|
+
screen_size: ${JSON.stringify(systemInfo.screen_size)},
|
|
52
|
+
user_agent: navigator.userAgent
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// Store in window for immediate access
|
|
56
|
+
window.__COMPLETE_SYSTEM_INFO__ = completeSystemInfo;
|
|
57
|
+
|
|
58
|
+
// Also post message for backward compatibility
|
|
59
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
60
|
+
type: 'SYSTEM_INFO',
|
|
61
|
+
data: { os, browser, browser_version: browserVersion, browser_language: browserLanguage, user_agent: navigator.userAgent }
|
|
62
|
+
}));
|
|
63
|
+
|
|
64
|
+
return completeSystemInfo;
|
|
65
|
+
})();
|
|
66
|
+
true;
|
|
67
|
+
`;};var getBrowserAndOSInfoScript=exports.getBrowserAndOSInfoScript=function getBrowserAndOSInfoScript(){return`
|
|
2
68
|
function getOSAndBrowser() {
|
|
3
69
|
const userAgent = navigator.userAgent;
|
|
4
70
|
|
|
@@ -45,5 +111,12 @@ Object.defineProperty(exports,"__esModule",{value:true});exports.getSystemInfo=e
|
|
|
45
111
|
}
|
|
46
112
|
getOSAndBrowser();
|
|
47
113
|
true;
|
|
114
|
+
`;};var getCompleteSystemInfoFromWebView=exports.getCompleteSystemInfoFromWebView=function getCompleteSystemInfoFromWebView(){return`
|
|
115
|
+
(function() {
|
|
116
|
+
if (window.__COMPLETE_SYSTEM_INFO__) {
|
|
117
|
+
return JSON.stringify(window.__COMPLETE_SYSTEM_INFO__);
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
})();
|
|
48
121
|
`;};var getSystemInfo=exports.getSystemInfo=function getSystemInfo(webViewSystemInfo){return{platform:_reactNative.Platform.OS,os:webViewSystemInfo.os||_reactNative.Platform.OS,browser:webViewSystemInfo.browser||"WebView",browser_version:webViewSystemInfo.browser_version||null,browser_language:webViewSystemInfo.browser_language||null,sdk_version:_version.SDK_VERSION,device:getDeviceType(),screen_size:getScreenSize(),user_agent:(webViewSystemInfo==null?void 0:webViewSystemInfo.user_agent)||null};};
|
|
49
122
|
//# sourceMappingURL=systemInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_version","getDeviceType","_Dimensions$get","Dimensions","get","width","height","aspectRatio","Platform","OS","isPad","getScreenSize","Math","round","PixelRatio","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_version","getDeviceType","exports","_Dimensions$get","Dimensions","get","width","height","aspectRatio","Platform","OS","isPad","getScreenSize","Math","round","PixelRatio","getCompleteSystemInfoScript","systemInfo","platform","sdk_version","device","JSON","stringify","screen_size","getBrowserAndOSInfoScript","getCompleteSystemInfoFromWebView","getSystemInfo","webViewSystemInfo","os","browser","browser_version","browser_language","SDK_VERSION","user_agent"],"sourceRoot":"../../../src","sources":["utils/systemInfo.ts"],"mappings":"iPAAA,IAAAA,YAAA,CAAAC,OAAA,iBACA,IAAAC,QAAA,CAAAD,OAAA,eAoBO,GAAM,CAAAE,aAAa,CAAAC,OAAA,CAAAD,aAAA,CAAG,QAAhB,CAAAA,aAAaA,CAAA,CAAiB,CACzC,IAAAE,eAAA,CAA0BC,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC,CAA1CC,KAAK,CAAAH,eAAA,CAALG,KAAK,CAAEC,MAAM,CAAAJ,eAAA,CAANI,MAAM,CACrB,GAAM,CAAAC,WAAW,CAAGD,MAAM,CAAGD,KAAK,CAElC,GAAIG,qBAAQ,CAACC,EAAE,GAAK,KAAK,CAAE,CACzB,MAAO,CAAAD,qBAAQ,CAAC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AAtB,OAAA,CAAAsB,yBAAA,CAAG,QAA5B,CAAAA,yBAAyBA,CAAA,CAAiB,CACrD,MAAO;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CACH,CAAC,CAGM,GAAM,CAAAC,gCAAgC,CAAAvB,OAAA,CAAAuB,gCAAA,CAAG,QAAnC,CAAAA,gCAAgCA,CAAA,CAAiB,CAC5D,MAAO;AACT;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CACH,CAAC,CAGM,GAAM,CAAAC,aAAa,CAAAxB,OAAA,CAAAwB,aAAA,CAAG,QAAhB,CAAAA,aAAaA,CAAIC,iBAM7B,CAAiB,CAChB,MAAO,CACLT,QAAQ,CAAET,qBAAQ,CAACC,EAAE,CACrBkB,EAAE,CAAED,iBAAiB,CAACC,EAAE,EAAInB,qBAAQ,CAACC,EAAE,CACvCmB,OAAO,CAAEF,iBAAiB,CAACE,OAAO,EAAI,SAAS,CAC/CC,eAAe,CAAEH,iBAAiB,CAACG,eAAe,EAAI,IAAI,CAC1DC,gBAAgB,CAAEJ,iBAAiB,CAACI,gBAAgB,EAAI,IAAI,CAC5DZ,WAAW,CAAEa,oBAAW,CACxBZ,MAAM,CAAEnB,aAAa,CAAC,CAAC,CACvBsB,WAAW,CAAEX,aAAa,CAAC,CAAC,CAC5BqB,UAAU,CAAE,CAAAN,iBAAiB,cAAjBA,iBAAiB,CAAEM,UAAU,GAAI,IAC/C,CAAC,CACH,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.0.27-staging.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.27-staging.6';
|
|
2
2
|
//# sourceMappingURL=version.staging.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chatbotsdk.d.ts","sourceRoot":"","sources":["../../src/Chatbotsdk.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Chatbotsdk.d.ts","sourceRoot":"","sources":["../../src/Chatbotsdk.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAwBf,OAAO,EAAoB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAsBvE,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,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACzB,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;KAC7B,CAAC;IACF,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,OAAO,CAAC;CACxB;AAED,UAAU,oBAAqB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13,16 @@ interface SystemInfo {
|
|
|
13
13
|
screen_size: ScreenSize;
|
|
14
14
|
user_agent: any;
|
|
15
15
|
}
|
|
16
|
+
export declare const getDeviceType: () => string;
|
|
17
|
+
export declare const getScreenSize: () => ScreenSize;
|
|
18
|
+
export declare const getCompleteSystemInfoScript: (systemInfo: {
|
|
19
|
+
platform: string;
|
|
20
|
+
device: string;
|
|
21
|
+
screen_size: ScreenSize;
|
|
22
|
+
sdk_version: string;
|
|
23
|
+
}) => string;
|
|
16
24
|
export declare const getBrowserAndOSInfoScript: () => string;
|
|
25
|
+
export declare const getCompleteSystemInfoFromWebView: () => string;
|
|
17
26
|
export declare const getSystemInfo: (webViewSystemInfo: {
|
|
18
27
|
os: string;
|
|
19
28
|
browser: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"systemInfo.d.ts","sourceRoot":"","sources":["../../../src/utils/systemInfo.ts"],"names":[],"mappings":"AAGA,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,UAAU;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,UAAU,CAAC;IACxB,UAAU,EAAE,GAAG,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"systemInfo.d.ts","sourceRoot":"","sources":["../../../src/utils/systemInfo.ts"],"names":[],"mappings":"AAGA,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,UAAU;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,UAAU,CAAC;IACxB,UAAU,EAAE,GAAG,CAAC;CACjB;AAGD,eAAO,MAAM,aAAa,QAAO,MAUhC,CAAC;AAGF,eAAO,MAAM,aAAa,QAAO,UAKhC,CAAC;AAGF,eAAO,MAAM,2BAA2B,eAAgB;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,UAAU,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;CACrB,KAAG,MAoEH,CAAC;AAGF,eAAO,MAAM,yBAAyB,QAAO,MAiD5C,CAAC;AAGF,eAAO,MAAM,gCAAgC,QAAO,MASnD,CAAC;AAGF,eAAO,MAAM,aAAa,sBAAuB;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,KAAG,UAYH,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.27-staging.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.27-staging.6";
|
|
2
2
|
//# sourceMappingURL=version.staging.d.ts.map
|
package/package.json
CHANGED
package/src/Chatbotsdk.tsx
CHANGED
|
@@ -20,7 +20,15 @@ import {
|
|
|
20
20
|
import { WebView, WebViewMessageEvent } from "react-native-webview";
|
|
21
21
|
import FloatingButton from "./FloatingButton";
|
|
22
22
|
import { API_URL, BASE_CHATBOT_URL, DEFAULT_LAUNCHER_IMAGE } from "./constants";
|
|
23
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
getSystemInfo,
|
|
25
|
+
getBrowserAndOSInfoScript,
|
|
26
|
+
getCompleteSystemInfoScript,
|
|
27
|
+
getCompleteSystemInfoFromWebView,
|
|
28
|
+
getDeviceType,
|
|
29
|
+
getScreenSize,
|
|
30
|
+
} from "./utils/systemInfo";
|
|
31
|
+
import { SDK_VERSION } from "./version";
|
|
24
32
|
import { useChatbotEvents } from "./hooks/useChatbotEvents";
|
|
25
33
|
import { ChatbotEventType, ChatbotEventHandler } from "./types/events";
|
|
26
34
|
import { logger } from "./utils/logger";
|
|
@@ -294,6 +302,7 @@ const Chatbot = forwardRef<ChatbotRef, InternalChatbotProps>(
|
|
|
294
302
|
}
|
|
295
303
|
}
|
|
296
304
|
|
|
305
|
+
// Deprecated: SYSTEM_INFO handling - now handled synchronously in getCompleteSystemInfoScript
|
|
297
306
|
if (parsedData?.type === "SYSTEM_INFO") {
|
|
298
307
|
setSystemInfo(parsedData?.data ?? { os: "", browser: "" });
|
|
299
308
|
return;
|
|
@@ -302,31 +311,50 @@ const Chatbot = forwardRef<ChatbotRef, InternalChatbotProps>(
|
|
|
302
311
|
if (parsedData?.type === "APP_READY") {
|
|
303
312
|
emitEvent(ChatbotEventType.CHATBOT_APP_READY);
|
|
304
313
|
if (webViewRef.current && isWebViewVisible) {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
userId: effectiveUserId,
|
|
312
|
-
token: user_token ? `${user_token}` : undefined,
|
|
313
|
-
userProfile: {
|
|
314
|
-
...user_profile,
|
|
315
|
-
...getSystemInfo(systemInfo),
|
|
316
|
-
__INT_SYS_INFO__: {
|
|
317
|
-
...getSystemInfo(systemInfo),
|
|
318
|
-
},
|
|
319
|
-
},
|
|
320
|
-
},
|
|
314
|
+
// Get React Native system info
|
|
315
|
+
const rnSystemInfo = {
|
|
316
|
+
platform: Platform.OS,
|
|
317
|
+
device: getDeviceType(),
|
|
318
|
+
screen_size: getScreenSize(),
|
|
319
|
+
sdk_version: SDK_VERSION,
|
|
321
320
|
};
|
|
322
|
-
|
|
321
|
+
|
|
322
|
+
// Inject complete system info script
|
|
323
|
+
webViewRef.current?.injectJavaScript(
|
|
324
|
+
getCompleteSystemInfoScript(rnSystemInfo)
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
// Get complete system info from WebView
|
|
323
328
|
webViewRef.current?.injectJavaScript(`
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
329
|
+
(function() {
|
|
330
|
+
const completeSystemInfo = ${getCompleteSystemInfoFromWebView()};
|
|
331
|
+
if (completeSystemInfo) {
|
|
332
|
+
const systemInfo = JSON.parse(completeSystemInfo);
|
|
333
|
+
const messageData = {
|
|
334
|
+
name: "registerUserId",
|
|
335
|
+
action: "registerUserId",
|
|
336
|
+
data: {
|
|
337
|
+
userId: "${effectiveUserId}",
|
|
338
|
+
token: ${user_token ? `"${user_token}"` : "undefined"},
|
|
339
|
+
userProfile: {
|
|
340
|
+
...${JSON.stringify(user_profile)},
|
|
341
|
+
...systemInfo,
|
|
342
|
+
__INT_SYS_INFO__: {
|
|
343
|
+
...systemInfo,
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
console.log("messageData====>", JSON.stringify(messageData));
|
|
349
|
+
window.postMessage(${JSON.stringify({
|
|
350
|
+
name: "openFrame",
|
|
351
|
+
domain: "app-domain.com",
|
|
352
|
+
})}, '*');
|
|
353
|
+
window.postMessage(JSON.stringify(messageData), '*');
|
|
354
|
+
}
|
|
355
|
+
})();
|
|
356
|
+
true;
|
|
357
|
+
`);
|
|
330
358
|
}
|
|
331
359
|
}
|
|
332
360
|
|
|
@@ -547,7 +575,7 @@ const Chatbot = forwardRef<ChatbotRef, InternalChatbotProps>(
|
|
|
547
575
|
externalOnOpen?.();
|
|
548
576
|
emitEvent(ChatbotEventType.CHATBOT_OPENED);
|
|
549
577
|
if (!isFirstLoadRef.current) {
|
|
550
|
-
setTimeout(triggerAppInit,
|
|
578
|
+
setTimeout(triggerAppInit, 100);
|
|
551
579
|
}
|
|
552
580
|
});
|
|
553
581
|
} else {
|
|
@@ -555,7 +583,7 @@ const Chatbot = forwardRef<ChatbotRef, InternalChatbotProps>(
|
|
|
555
583
|
externalOnOpen?.();
|
|
556
584
|
emitEvent(ChatbotEventType.CHATBOT_OPENED);
|
|
557
585
|
if (!isFirstLoadRef.current) {
|
|
558
|
-
setTimeout(triggerAppInit,
|
|
586
|
+
setTimeout(triggerAppInit, 100);
|
|
559
587
|
}
|
|
560
588
|
});
|
|
561
589
|
}
|
package/src/utils/systemInfo.ts
CHANGED
|
@@ -19,7 +19,7 @@ interface SystemInfo {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
// Get device type based on platform and screen dimensions
|
|
22
|
-
const getDeviceType = (): string => {
|
|
22
|
+
export const getDeviceType = (): string => {
|
|
23
23
|
const { width, height } = Dimensions.get("window");
|
|
24
24
|
const aspectRatio = height / width;
|
|
25
25
|
|
|
@@ -32,14 +32,90 @@ const getDeviceType = (): string => {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
// Get screen dimensions with pixel ratio
|
|
35
|
-
const getScreenSize = (): ScreenSize => {
|
|
35
|
+
export const getScreenSize = (): ScreenSize => {
|
|
36
36
|
return {
|
|
37
37
|
width: Math.round(Dimensions.get("window").width * PixelRatio.get()),
|
|
38
38
|
height: Math.round(Dimensions.get("window").height * PixelRatio.get()),
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
// Get
|
|
42
|
+
// Get complete system info script that collects all data synchronously
|
|
43
|
+
export const getCompleteSystemInfoScript = (systemInfo: {
|
|
44
|
+
platform: string;
|
|
45
|
+
device: string;
|
|
46
|
+
screen_size: ScreenSize;
|
|
47
|
+
sdk_version: string;
|
|
48
|
+
}): string => {
|
|
49
|
+
return `
|
|
50
|
+
(function() {
|
|
51
|
+
const userAgent = navigator.userAgent;
|
|
52
|
+
|
|
53
|
+
// OS Detection
|
|
54
|
+
let os = "unknown";
|
|
55
|
+
if (userAgent.indexOf("Win") !== -1) os = "Windows";
|
|
56
|
+
else if (userAgent.indexOf("Mac") !== -1) os = "MacOS";
|
|
57
|
+
else if (userAgent.indexOf("Linux") !== -1) os = "Linux";
|
|
58
|
+
else if (userAgent.indexOf("Android") !== -1) os = "Android";
|
|
59
|
+
else if (userAgent.indexOf("like Mac") !== -1) os = "iOS";
|
|
60
|
+
|
|
61
|
+
// Browser Detection
|
|
62
|
+
let browser = "unknown";
|
|
63
|
+
let browserVersion = null;
|
|
64
|
+
|
|
65
|
+
if (userAgent.indexOf("Chrome") !== -1) {
|
|
66
|
+
browser = "Chrome";
|
|
67
|
+
const chromeMatch = userAgent.match(/Chrome\\/([0-9.]+)/);
|
|
68
|
+
browserVersion = chromeMatch ? chromeMatch[1] : null;
|
|
69
|
+
} else if (userAgent.indexOf("Safari") !== -1) {
|
|
70
|
+
browser = "Safari";
|
|
71
|
+
const safariMatch = userAgent.match(/Version\\/([0-9.]+)/);
|
|
72
|
+
browserVersion = safariMatch ? safariMatch[1] : null;
|
|
73
|
+
} else if (userAgent.indexOf("Firefox") !== -1) {
|
|
74
|
+
browser = "Firefox";
|
|
75
|
+
const firefoxMatch = userAgent.match(/Firefox\\/([0-9.]+)/);
|
|
76
|
+
browserVersion = firefoxMatch ? firefoxMatch[1] : null;
|
|
77
|
+
} else if (userAgent.indexOf("Edge") !== -1) {
|
|
78
|
+
browser = "Edge";
|
|
79
|
+
const edgeMatch = userAgent.match(/Edge\\/([0-9.]+)/);
|
|
80
|
+
browserVersion = edgeMatch ? edgeMatch[1] : null;
|
|
81
|
+
} else if (userAgent.indexOf("MSIE") !== -1 || userAgent.indexOf("Trident/") !== -1) {
|
|
82
|
+
browser = "IE";
|
|
83
|
+
const ieMatch = userAgent.match(/(?:MSIE |rv:)([0-9.]+)/);
|
|
84
|
+
browserVersion = ieMatch ? ieMatch[1] : null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Browser Language
|
|
88
|
+
const browserLanguage = navigator.language || navigator.languages?.[0] || null;
|
|
89
|
+
|
|
90
|
+
// Complete system info object
|
|
91
|
+
const completeSystemInfo = {
|
|
92
|
+
platform: "${systemInfo.platform}",
|
|
93
|
+
os: os,
|
|
94
|
+
browser: browser,
|
|
95
|
+
browser_version: browserVersion,
|
|
96
|
+
browser_language: browserLanguage,
|
|
97
|
+
sdk_version: "${systemInfo.sdk_version}",
|
|
98
|
+
device: "${systemInfo.device}",
|
|
99
|
+
screen_size: ${JSON.stringify(systemInfo.screen_size)},
|
|
100
|
+
user_agent: navigator.userAgent
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// Store in window for immediate access
|
|
104
|
+
window.__COMPLETE_SYSTEM_INFO__ = completeSystemInfo;
|
|
105
|
+
|
|
106
|
+
// Also post message for backward compatibility
|
|
107
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
108
|
+
type: 'SYSTEM_INFO',
|
|
109
|
+
data: { os, browser, browser_version: browserVersion, browser_language: browserLanguage, user_agent: navigator.userAgent }
|
|
110
|
+
}));
|
|
111
|
+
|
|
112
|
+
return completeSystemInfo;
|
|
113
|
+
})();
|
|
114
|
+
true;
|
|
115
|
+
`;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// Get browser detection script (deprecated - use getCompleteSystemInfoScript instead)
|
|
43
119
|
export const getBrowserAndOSInfoScript = (): string => {
|
|
44
120
|
return `
|
|
45
121
|
function getOSAndBrowser() {
|
|
@@ -91,6 +167,18 @@ export const getBrowserAndOSInfoScript = (): string => {
|
|
|
91
167
|
`;
|
|
92
168
|
};
|
|
93
169
|
|
|
170
|
+
// Get complete system information from WebView
|
|
171
|
+
export const getCompleteSystemInfoFromWebView = (): string => {
|
|
172
|
+
return `
|
|
173
|
+
(function() {
|
|
174
|
+
if (window.__COMPLETE_SYSTEM_INFO__) {
|
|
175
|
+
return JSON.stringify(window.__COMPLETE_SYSTEM_INFO__);
|
|
176
|
+
}
|
|
177
|
+
return null;
|
|
178
|
+
})();
|
|
179
|
+
`;
|
|
180
|
+
};
|
|
181
|
+
|
|
94
182
|
// Get complete system information
|
|
95
183
|
export const getSystemInfo = (webViewSystemInfo: {
|
|
96
184
|
os: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated. Do not modify it manually.
|
|
2
|
-
export const SDK_VERSION = '2.0.27-staging.
|
|
2
|
+
export const SDK_VERSION = '2.0.27-staging.6';
|