@robylon/react-native-sdk 2.2.1-staging.1 → 2.2.3-staging.0

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.
Files changed (31) hide show
  1. package/README.md +206 -0
  2. package/lib/commonjs/Chatbotsdk.js +6 -3
  3. package/lib/commonjs/Chatbotsdk.js.map +1 -1
  4. package/lib/commonjs/openChatbot.js +2 -1
  5. package/lib/commonjs/openChatbot.js.map +1 -1
  6. package/lib/commonjs/utils/session.js +1 -1
  7. package/lib/commonjs/utils/session.js.map +1 -1
  8. package/lib/commonjs/utils/webViewNavigation.js +2 -0
  9. package/lib/commonjs/utils/webViewNavigation.js.map +1 -0
  10. package/lib/commonjs/versions/version.staging.js +1 -1
  11. package/lib/module/Chatbotsdk.js +6 -3
  12. package/lib/module/Chatbotsdk.js.map +1 -1
  13. package/lib/module/utils/session.js +1 -1
  14. package/lib/module/utils/session.js.map +1 -1
  15. package/lib/module/utils/webViewNavigation.js +2 -0
  16. package/lib/module/utils/webViewNavigation.js.map +1 -0
  17. package/lib/module/versions/version.staging.js +1 -1
  18. package/lib/typescript/Chatbotsdk.d.ts +1 -0
  19. package/lib/typescript/Chatbotsdk.d.ts.map +1 -1
  20. package/lib/typescript/utils/session.d.ts +11 -0
  21. package/lib/typescript/utils/session.d.ts.map +1 -1
  22. package/lib/typescript/utils/webViewNavigation.d.ts +34 -0
  23. package/lib/typescript/utils/webViewNavigation.d.ts.map +1 -0
  24. package/lib/typescript/versions/version.staging.d.ts +1 -1
  25. package/package.json +1 -1
  26. package/robylon-react-native-sdk-2.2.1-staging.1.tgz +0 -0
  27. package/src/Chatbotsdk.tsx +121 -13
  28. package/src/utils/session.ts +12 -0
  29. package/src/utils/webViewNavigation.ts +132 -0
  30. package/src/versions/version.staging.ts +1 -1
  31. package/robylon-react-native-sdk-2.2.1-staging.0.tgz +0 -0
package/README.md CHANGED
@@ -11,6 +11,7 @@
11
11
  - [Required Props](#required-props)
12
12
  - [Optional Props](#optional-props)
13
13
  - [User Profile Properties](#user-profile-properties)
14
+ - [Loading Screen](#loading-screen)
14
15
  - [External Trigger API](#external-trigger-api)
15
16
  - [Ref-based Imperative API](#ref-based-imperative-api)
16
17
  - [Ref Methods](#ref-methods)
@@ -18,8 +19,10 @@
18
19
  - [Session Management](#session-management)
19
20
  - [Reading the session id](#reading-the-session-id)
20
21
  - [Resuming a conversation](#resuming-a-conversation)
22
+ - [Opening a specific conversation](#opening-a-specific-conversation)
21
23
  - [`session_context`](#session_context)
22
24
  - [Privacy](#privacy)
25
+ - [Integrating Push Notifications](#integrating-push-notifications)
23
26
  - [Recipes](#recipes)
24
27
  - [One chat session per e-commerce order](#one-chat-session-per-e-commerce-order)
25
28
  - [Advanced Usage Examples](#advanced-usage-examples)
@@ -54,6 +57,7 @@ import {
54
57
  Chatbot, // Main chatbot component
55
58
  ChatbotRef, // Ref interface for imperative control
56
59
  ChatbotProps, // Props interface
60
+ ChatbotLoadingScreen, // Shape of the `loading_screen` prop
57
61
  ChatbotEventType, // Event types enum
58
62
  ChatbotEventHandler, // Event handler type
59
63
  } from "@robylon/react-native-sdk";
@@ -115,6 +119,7 @@ export default App;
115
119
  | `session_id` | string | Session to resume. Read when the chat initializes — see [Session Management](#session-management) |
116
120
  | `session_context` | Record<string, any> | Opaque value echoed back as the second argument to `onSession`. Never read by the SDK |
117
121
  | `discrete` | boolean | Defaults to `false`. When `true`, signals to Robylon that this chatbot should be treated as discrete. Read at initialization |
122
+ | `loading_screen` | ChatbotLoadingScreen | Branding shown while the chat UI boots — see [Loading Screen](#loading-screen) |
118
123
  | `onSession` | (session_id: string, session_context?: Record<string, any>) => void | Called whenever the active session id changes |
119
124
  | `onEvent` | ChatbotEventHandler | Callback for chatbot events |
120
125
  | `onOpen` | () => void | Callback when chatbot opens |
@@ -130,6 +135,60 @@ The `user_profile` object can include:
130
135
  - `mobile`: User's mobile number (optional)
131
136
  - `is_test_user`: Mark user as test user for development/testing purposes (optional)
132
137
 
138
+ ### Loading Screen
139
+
140
+ > **Requires SDK ≥ 2.2.1**
141
+
142
+ The chat UI fetches its own configuration when it boots. Until that call
143
+ returns it has nothing to render a header with, so it shows a skeleton and then
144
+ snaps to your branding — a visible flash every time the chat opens.
145
+
146
+ The SDK already holds that branding: it fetches your configuration before it
147
+ mounts the chat, to decide whether to render a launcher and what it should look
148
+ like. It now passes a few of those fields to the chat UI so the real header can
149
+ paint immediately.
150
+
151
+ **This happens automatically — no props required.** The values come from your
152
+ Robylon dashboard configuration. Use `loading_screen` only when you want to
153
+ override them for a particular integration:
154
+
155
+ ```typescript
156
+ <Chatbot
157
+ api_key="YOUR_API_KEY"
158
+ loading_screen={{
159
+ image: "https://example.com/header-avatar.png",
160
+ bot_name: "Acme Support",
161
+ brand_color: "#5B3DF5",
162
+ powered_by: false,
163
+ sub_text: "Typically replies in a minute",
164
+ }}
165
+ />
166
+ ```
167
+
168
+ | Field | Type | Description |
169
+ | ------------- | ------- | -------------------------------------------------------------------- |
170
+ | `image` | string | Header avatar. Defaults to your header image, then your brand logo |
171
+ | `bot_name` | string | Display name in the header |
172
+ | `brand_color` | string | Colour the header is tinted with |
173
+ | `powered_by` | boolean | Whether the "powered by" footer shows |
174
+ | `sub_text` | string | Sub-text under the header. No dashboard equivalent — prop only |
175
+
176
+ #### Behaviour
177
+
178
+ - **Every field is optional.** Anything you omit falls back to your dashboard
179
+ configuration, field by field. Passing `{ bot_name: "Acme" }` overrides only
180
+ the name; the image, colour and footer still come from your dashboard.
181
+ - **Explicit values always win**, including falsy ones. `powered_by: false`
182
+ overrides a dashboard setting of `true`.
183
+ - **`sub_text` has no dashboard equivalent**, so it appears only when you pass
184
+ it here.
185
+ - **First paint only.** These are sent once, when the chat surface first loads,
186
+ and are not re-sent when the user reopens the chat — by then the chat UI has
187
+ its own configuration. They do not restyle the running chat.
188
+ - **A hint, not a source of truth.** The chat UI reconciles to its own
189
+ configuration once that call lands, so a value that is missing or out of date
190
+ is corrected rather than sticking.
191
+
133
192
  ## External Trigger API
134
193
 
135
194
  The SDK now supports external triggering of the chatbot through both controlled component patterns and imperative ref methods.
@@ -185,6 +244,7 @@ const App = () => {
185
244
  | `toggle()` | Toggle chatbot visibility |
186
245
  | `isReady()` | Check if chatbot is ready for external triggers |
187
246
  | `getSessionId()` | Current session id, or `undefined` if no session has started yet |
247
+ | `openToSession(session_id, session_context?)` | Open the chatbot directly on a specific conversation, switching away from whatever is on screen — see [Opening a specific conversation](#opening-a-specific-conversation) |
188
248
 
189
249
  ### Callback Props
190
250
 
@@ -271,6 +331,41 @@ Things worth knowing:
271
331
  - **Changing `user_id` invalidates any stored session id.** Stop passing a
272
332
  session id that belongs to a different user.
273
333
 
334
+ ### Opening a specific conversation
335
+
336
+ `session_id` covers the mount-time case. When the chatbot is already running —
337
+ a push notification tapped while the app is open, or a "back to your chat" link
338
+ elsewhere in your UI — use `openToSession` instead:
339
+
340
+ ```typescript
341
+ const bot = useRef<ChatbotRef>(null);
342
+
343
+ <Chatbot api_key="YOUR_API_KEY" user_id={user.id} ref={bot} onSession={store} />;
344
+
345
+ // wherever the notification tap lands
346
+ bot.current?.openToSession(sessionId);
347
+ ```
348
+
349
+ It opens the chatbot if it is closed, and switches the conversation if a
350
+ different one is on screen. Unlike `session_id`, it takes effect immediately —
351
+ you do not have to remount the component or key it on the session id.
352
+
353
+ Things worth knowing:
354
+
355
+ - **It is a no-op if that conversation is already open.** Your place in a live
356
+ chat is not disturbed, so it is safe to call on every notification tap
357
+ without checking first.
358
+ - **Switching discards the conversation on screen.** Messages, drafts and any
359
+ in-progress form in the old conversation are cleared. Nothing is lost — the
360
+ old conversation is still on the server — but the user does not return to it
361
+ automatically.
362
+ - **Resolution is the same as `session_id`.** An expired, closed or foreign
363
+ session id starts a new conversation instead; compare the id you passed
364
+ against the one `onSession` reports to detect that.
365
+ - **It needs the chatbot to be ready.** Calls before `onReady` are ignored, so
366
+ hold the notification until then if your app can tap through on cold start.
367
+ On a cold start, passing the id as `session_id` on the first mount is simpler.
368
+
274
369
  ### `session_context`
275
370
 
276
371
  If your `onSession` handler is defined outside the component and cannot see the
@@ -302,6 +397,117 @@ The session id is delivered only through `onSession` and `getSessionId()`. It is
302
397
  never included in `onEvent` payloads and is not sent to Robylon's event logging.
303
398
  Integrations that do not use either API never observe it.
304
399
 
400
+ ## Integrating Push Notifications
401
+
402
+ Robylon can tell you when a customer has gone quiet on a conversation an agent
403
+ replied to. Tapping that notification should put them back in **that**
404
+ conversation rather than a new one — this section is about the part that makes
405
+ that happen.
406
+
407
+ It assumes the webhook is already configured and notifications are already
408
+ reaching the device through whatever push stack you use. Everything below is a
409
+ **guide, not a drop-in**: the delivery library, the navigation and the storage
410
+ are yours, and the shape of this will change to fit them.
411
+
412
+ ### What the SDK does and does not do
413
+
414
+ The SDK ships **no notification code**. Registering for FCM/APNs, asking for
415
+ permission, rendering the tray entry and receiving the tap all belong to your
416
+ app — you already own that stack, and a second one inside a library would
417
+ collide with it.
418
+
419
+ The SDK owns exactly one step: **given a session id, open the chatbot on that
420
+ conversation.** That is `openToSession`.
421
+
422
+ ### Carry the session id through your push payload
423
+
424
+ Robylon's webhook event carries the conversation at `user.session_id`. Put it
425
+ in the data of the notification you send, under whatever key you like:
426
+
427
+ ```jsonc
428
+ {
429
+ "notification": { "title": "Priya replied", "body": "Your refund…" },
430
+ "data": { "session_id": "9f2c7a04-1d55-4a9e-b6c2-7f0e3a8d4411" }
431
+ }
432
+ ```
433
+
434
+ Use the **data** block, not the notification block — on both platforms that is
435
+ what survives into the handler that runs when the notification is tapped.
436
+
437
+ ### Handle the tap
438
+
439
+ ```typescript
440
+ const chatbotRef = useRef<ChatbotRef>(null);
441
+
442
+ // Adapt the listener names to your push library; the body is the part
443
+ // that matters.
444
+ useEffect(() => {
445
+ const openFrom = (message: any) => {
446
+ const sessionId = message?.data?.session_id;
447
+ if (!sessionId) return; // not one of ours, leave it alone
448
+ chatbotRef.current?.openToSession(sessionId);
449
+ };
450
+
451
+ // Tapped while the app was in the background.
452
+ const unsubscribe = messaging().onNotificationOpenedApp(openFrom);
453
+
454
+ // Tapped while the app was killed: resolves once with whatever launched it,
455
+ // or null if something else did.
456
+ messaging().getInitialNotification().then((message) => {
457
+ if (message) openFrom(message);
458
+ });
459
+
460
+ return unsubscribe;
461
+ }, []);
462
+
463
+ <Chatbot
464
+ api_key="YOUR_API_KEY"
465
+ user_id={user.id}
466
+ ref={chatbotRef}
467
+ onSession={(id) => store(id)}
468
+ />;
469
+ ```
470
+
471
+ That is the whole integration. `openToSession` opens the chatbot if it is
472
+ closed, and switches the conversation if a different one is on screen.
473
+
474
+ ### Things that will bite you
475
+
476
+ - **Handle the cold-start case separately.** `onNotificationOpenedApp` only
477
+ fires when the app was already running; a tap that launches a killed app
478
+ arrives through `getInitialNotification()` instead. Miss it and the most
479
+ common path silently does nothing. You do **not** need to delay the call —
480
+ the SDK holds a request made before the chatbot is ready and applies it once
481
+ it can.
482
+ - **A foreground push shows no tray entry**, on either platform, so there is no
483
+ tap to handle. That is usually right: pulling someone out of the conversation
484
+ they are looking at is worse than showing nothing. If you want an in-app
485
+ banner, draw it yourself and call `openToSession` when it is tapped.
486
+ - **Check the session actually resumed.** An expired, closed or foreign session
487
+ id starts a fresh conversation instead of failing — compare the id you passed
488
+ against the one `onSession` reports:
489
+
490
+ ```typescript
491
+ onSession={(id) => {
492
+ if (requestedId && id !== requestedId) {
493
+ // Backend declined the resume; this is a new conversation.
494
+ }
495
+ store(id);
496
+ }}
497
+ ```
498
+ - **Drop stored session ids when the user changes.** A session belongs to the
499
+ `user_id` that created it; passing one across a logout resumes nothing and
500
+ starts a fresh conversation.
501
+ - **Tapping the conversation already on screen is a no-op**, so you can call
502
+ `openToSession` on every tap without checking first.
503
+
504
+ ### Verifying it works
505
+
506
+ With the app backgrounded, send yourself a notification carrying a session id
507
+ you have actually been in, tap it, and confirm the chatbot opens on that
508
+ conversation. The `onSession` callback firing with the **same** id you passed
509
+ is the signal that the resume was honoured rather than silently replaced.
510
+
305
511
  ## Recipes
306
512
 
307
513
  Complete integration patterns built from the APIs above.
@@ -1,12 +1,15 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.WidgetPositionEnums=exports.LauncherType=exports.ChatbotInterfaceType=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeWebview=require("react-native-webview");var _FloatingButton=_interopRequireDefault(require("./FloatingButton"));var _constants=require("./constants");var _systemInfo=require("./utils/systemInfo");var _useChatbotEvents2=require("./hooks/useChatbotEvents");var _events=require("./types/events");var _logger=require("./utils/logger");var _debugConfig=require("./utils/debugConfig");var _DebugButton=_interopRequireDefault(require("./components/DebugButton"));var _ErrorBoundary=require("./components/ErrorBoundary");var _errorConstants=require("./constants/errorConstants");var _ErrorTrackingService=require("./services/ErrorTrackingService");var _cookieUtils=require("./utils/cookieUtils");var _webViewStorage=require("./utils/webViewStorage");var _animations=require("./utils/animations");var _fileDownload=require("./utils/fileDownload");var _session=require("./utils/session");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/professional/Mobile sdks/robylon-react-native-sdk/src/Chatbotsdk.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var ChatbotInterfaceType=exports.ChatbotInterfaceType=function(ChatbotInterfaceType){ChatbotInterfaceType["WIDGET"]="WIDGET";ChatbotInterfaceType["POPOVER"]="POPOVER";ChatbotInterfaceType["EMBED"]="EMBED";return ChatbotInterfaceType;}({});var WidgetPositionEnums=exports.WidgetPositionEnums=function(WidgetPositionEnums){WidgetPositionEnums["RIGHT"]="Right";WidgetPositionEnums["LEFT"]="Left";return WidgetPositionEnums;}({});var LauncherType=exports.LauncherType=function(LauncherType){LauncherType["TEXT"]="TEXT";LauncherType["IMAGE"]="IMAGE";LauncherType["TEXTUAL_IMAGE"]="TEXTUAL_IMAGE";return LauncherType;}({});var Chatbot=(0,_react.forwardRef)(function(_ref,ref){var _chatbotConfig$interf,_chatbotConfig$interf2,_chatbotConfig$interf3,_chatbotConfig$interf4,_chatbotConfig$interf5;var api_key=_ref.api_key,user_id=_ref.user_id,user_token=_ref.user_token,_ref$show_floating_bu=_ref.show_floating_button,show_floating_button=_ref$show_floating_bu===void 0?true:_ref$show_floating_bu,onEvent=_ref.onEvent,onMessage=_ref.onMessage,_ref$isFullScreen=_ref.isFullScreen,isFullScreen=_ref$isFullScreen===void 0?true:_ref$isFullScreen,_ref$enableAnimation=_ref.enableAnimation,enableAnimation=_ref$enableAnimation===void 0?true:_ref$enableAnimation,externalOnOpen=_ref.onOpen,externalOnClose=_ref.onClose,onReady=_ref.onReady,user_profile=_ref.user_profile,session_id=_ref.session_id,session_context=_ref.session_context,_ref$discrete=_ref.discrete,discrete=_ref$discrete===void 0?false:_ref$discrete,onSession=_ref.onSession,loading_screen=_ref.loading_screen;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isWebViewVisible=_useState2[0],setIsWebViewVisible=_useState2[1];var _useState3=(0,_react.useState)(null),_useState4=(0,_slicedToArray2.default)(_useState3,2),chatbotConfig=_useState4[0],setChatbotConfig=_useState4[1];var _useState5=(0,_react.useState)(true),_useState6=(0,_slicedToArray2.default)(_useState5,2),loading=_useState6[0],setLoading=_useState6[1];var _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),isInitialized=_useState8[0],setIsInitialized=_useState8[1];var webViewRef=(0,_react.useRef)(null);var isFirstLoadRef=(0,_react.useRef)(true);var _useState9=(0,_react.useState)(false),_useState10=(0,_slicedToArray2.default)(_useState9,2),toastVisible=_useState10[0],setToastVisible=_useState10[1];var _useState11=(0,_react.useState)(""),_useState12=(0,_slicedToArray2.default)(_useState11,2),toastMessage=_useState12[0],setToastMessage=_useState12[1];var _useState13=(0,_react.useState)(),_useState14=(0,_slicedToArray2.default)(_useState13,2),effectiveUserId=_useState14[0],setEffectiveUserId=_useState14[1];var _useState15=(0,_react.useState)(false),_useState16=(0,_slicedToArray2.default)(_useState15,2),isStorageReady=_useState16[0],setIsStorageReady=_useState16[1];var pendingStorageOps=(0,_react.useRef)([]);var memoryCache=(0,_react.useRef)({});var _useState17=(0,_react.useState)({os:"",browser:""}),_useState18=(0,_slicedToArray2.default)(_useState17,2),systemInfo=_useState18[0],setSystemInfo=_useState18[1];var systemInfoRef=(0,_react.useRef)({os:"",browser:""});var isInitializedRef=(0,_react.useRef)(false);var isWebViewVisibleRef=(0,_react.useRef)(false);var sessionIdRef=(0,_react.useRef)(undefined);var onSessionRef=(0,_react.useRef)(onSession);var sessionContextRef=(0,_react.useRef)(session_context);var resumeSessionRef=(0,_react.useRef)(session_id);var discreteRef=(0,_react.useRef)(discrete);var loadingScreenRef=(0,_react.useRef)(loading_screen);onSessionRef.current=onSession;sessionContextRef.current=session_context;resumeSessionRef.current=session_id;discreteRef.current=discrete;loadingScreenRef.current=loading_screen;var chatbotConfigRef=(0,_react.useRef)(null);chatbotConfigRef.current=chatbotConfig;var hasSentInitLoadRef=(0,_react.useRef)(false);var animatedValues=(0,_react.useRef)({scale:new _reactNative.Animated.Value(1),translateY:new _reactNative.Animated.Value(0),opacity:new _reactNative.Animated.Value(1)}).current;var chatbotConfigForEvents=(0,_react.useMemo)(function(){return{userId:effectiveUserId,isAnonymous:!user_id&&user_id!==0};},[effectiveUserId,user_id]);var _useChatbotEvents=(0,_useChatbotEvents2.useChatbotEvents)({api_key:api_key,chatbotConfig:chatbotConfigForEvents!=null?chatbotConfigForEvents:{},user_profile:user_profile,onEvent:onEvent,systemInfo:systemInfo!=null?systemInfo:{os:"",browser:""}}),emitEvent=_useChatbotEvents.emitEvent,onInternalEvent=_useChatbotEvents.onInternalEvent;(0,_react.useImperativeHandle)(ref,function(){return{open:function open(){if(isInitializedRef.current){openWebView();}},close:function close(){if(isInitializedRef.current){closeWebView();}},toggle:function toggle(){if(isInitializedRef.current){if(isWebViewVisibleRef.current){closeWebView();}else{openWebView();}}},isReady:function isReady(){return isInitializedRef.current;},getSessionId:function getSessionId(){return sessionIdRef.current;}};},[isInitialized,isWebViewVisible]);var emitSession=(0,_react.useCallback)(function(data){var sessionId=(0,_session.extractSessionId)(data);if(!sessionId||sessionId===sessionIdRef.current)return;sessionIdRef.current=sessionId;try{var _sessionContextRef$cu;onSessionRef.current==null?void 0:onSessionRef.current(sessionId,(_sessionContextRef$cu=sessionContextRef.current)!=null?_sessionContextRef$cu:{});}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("onSession handler threw an error"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{source:_session.SESSION_UPDATED_MESSAGE_TYPE}});}},[]);var triggerAppInit=function triggerAppInit(){if(webViewRef.current){var _webViewRef$current;(_webViewRef$current=webViewRef.current)==null?void 0:_webViewRef$current.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());webViewRef.current.injectJavaScript(`
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 _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));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 _webViewNavigation=require("./utils/webViewNavigation");var _session=require("./utils/session");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/professional/Mobile sdks/robylon-react-native-sdk/src/Chatbotsdk.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var ChatbotInterfaceType=exports.ChatbotInterfaceType=function(ChatbotInterfaceType){ChatbotInterfaceType["WIDGET"]="WIDGET";ChatbotInterfaceType["POPOVER"]="POPOVER";ChatbotInterfaceType["EMBED"]="EMBED";return ChatbotInterfaceType;}({});var WidgetPositionEnums=exports.WidgetPositionEnums=function(WidgetPositionEnums){WidgetPositionEnums["RIGHT"]="Right";WidgetPositionEnums["LEFT"]="Left";return WidgetPositionEnums;}({});var LauncherType=exports.LauncherType=function(LauncherType){LauncherType["TEXT"]="TEXT";LauncherType["IMAGE"]="IMAGE";LauncherType["TEXTUAL_IMAGE"]="TEXTUAL_IMAGE";return LauncherType;}({});var Chatbot=(0,_react.forwardRef)(function(_ref,ref){var _chatbotConfig$interf,_chatbotConfig$interf2,_chatbotConfig$interf3,_chatbotConfig$interf4,_chatbotConfig$interf5;var api_key=_ref.api_key,user_id=_ref.user_id,user_token=_ref.user_token,_ref$show_floating_bu=_ref.show_floating_button,show_floating_button=_ref$show_floating_bu===void 0?true:_ref$show_floating_bu,onEvent=_ref.onEvent,onMessage=_ref.onMessage,_ref$isFullScreen=_ref.isFullScreen,isFullScreen=_ref$isFullScreen===void 0?true:_ref$isFullScreen,_ref$enableAnimation=_ref.enableAnimation,enableAnimation=_ref$enableAnimation===void 0?true:_ref$enableAnimation,externalOnOpen=_ref.onOpen,externalOnClose=_ref.onClose,onReady=_ref.onReady,user_profile=_ref.user_profile,session_id=_ref.session_id,session_context=_ref.session_context,_ref$discrete=_ref.discrete,discrete=_ref$discrete===void 0?false:_ref$discrete,onSession=_ref.onSession,loading_screen=_ref.loading_screen;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isWebViewVisible=_useState2[0],setIsWebViewVisible=_useState2[1];var _useState3=(0,_react.useState)(null),_useState4=(0,_slicedToArray2.default)(_useState3,2),chatbotConfig=_useState4[0],setChatbotConfig=_useState4[1];var _useState5=(0,_react.useState)(true),_useState6=(0,_slicedToArray2.default)(_useState5,2),loading=_useState6[0],setLoading=_useState6[1];var _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),isInitialized=_useState8[0],setIsInitialized=_useState8[1];var webViewRef=(0,_react.useRef)(null);var isFirstLoadRef=(0,_react.useRef)(true);var _useState9=(0,_react.useState)(false),_useState10=(0,_slicedToArray2.default)(_useState9,2),toastVisible=_useState10[0],setToastVisible=_useState10[1];var _useState11=(0,_react.useState)(""),_useState12=(0,_slicedToArray2.default)(_useState11,2),toastMessage=_useState12[0],setToastMessage=_useState12[1];var _useState13=(0,_react.useState)(),_useState14=(0,_slicedToArray2.default)(_useState13,2),effectiveUserId=_useState14[0],setEffectiveUserId=_useState14[1];var _useState15=(0,_react.useState)(false),_useState16=(0,_slicedToArray2.default)(_useState15,2),isStorageReady=_useState16[0],setIsStorageReady=_useState16[1];var pendingStorageOps=(0,_react.useRef)([]);var memoryCache=(0,_react.useRef)({});var _useState17=(0,_react.useState)({os:"",browser:""}),_useState18=(0,_slicedToArray2.default)(_useState17,2),systemInfo=_useState18[0],setSystemInfo=_useState18[1];var systemInfoRef=(0,_react.useRef)({os:"",browser:""});var isInitializedRef=(0,_react.useRef)(false);var isWebViewVisibleRef=(0,_react.useRef)(false);var sessionIdRef=(0,_react.useRef)(undefined);var onSessionRef=(0,_react.useRef)(onSession);var sessionContextRef=(0,_react.useRef)(session_context);var resumeSessionRef=(0,_react.useRef)(session_id);var discreteRef=(0,_react.useRef)(discrete);var loadingScreenRef=(0,_react.useRef)(loading_screen);onSessionRef.current=onSession;sessionContextRef.current=session_context;resumeSessionRef.current=session_id;discreteRef.current=discrete;loadingScreenRef.current=loading_screen;var imperativeSessionRef=(0,_react.useRef)(undefined);var resolveResumeTarget=function resolveResumeTarget(){var _imperativeSessionRef;return(_imperativeSessionRef=imperativeSessionRef.current)!=null?_imperativeSessionRef:resumeSessionRef.current;};var imperativeContextRef=(0,_react.useRef)(undefined);var pendingOpenRef=(0,_react.useRef)(undefined);var openWebViewRef=(0,_react.useRef)(undefined);var postSessionSwitchRef=(0,_react.useRef)(undefined);var chatbotConfigRef=(0,_react.useRef)(null);chatbotConfigRef.current=chatbotConfig;var hasSentInitLoadRef=(0,_react.useRef)(false);var animatedValues=(0,_react.useRef)({scale:new _reactNative.Animated.Value(1),translateY:new _reactNative.Animated.Value(0),opacity:new _reactNative.Animated.Value(1)}).current;var chatbotConfigForEvents=(0,_react.useMemo)(function(){return{userId:effectiveUserId,isAnonymous:!user_id&&user_id!==0};},[effectiveUserId,user_id]);var _useChatbotEvents=(0,_useChatbotEvents2.useChatbotEvents)({api_key:api_key,chatbotConfig:chatbotConfigForEvents!=null?chatbotConfigForEvents:{},user_profile:user_profile,onEvent:onEvent,systemInfo:systemInfo!=null?systemInfo:{os:"",browser:""}}),emitEvent=_useChatbotEvents.emitEvent,onInternalEvent=_useChatbotEvents.onInternalEvent;(0,_react.useImperativeHandle)(ref,function(){return{open:function open(){if(isInitializedRef.current){openWebView();}},close:function close(){if(isInitializedRef.current){closeWebView();}},toggle:function toggle(){if(isInitializedRef.current){if(isWebViewVisibleRef.current){closeWebView();}else{openWebView();}}},isReady:function isReady(){return isInitializedRef.current;},getSessionId:function getSessionId(){return sessionIdRef.current;},openToSession:function openToSession(sessionId,sessionContext){if(typeof sessionId!=="string"||sessionId.length===0)return;imperativeSessionRef.current=sessionId;imperativeContextRef.current=sessionContext;if(!isInitializedRef.current){pendingOpenRef.current=sessionId;return;}openWebView();postSessionSwitch(sessionId);}};},[isInitialized,isWebViewVisible]);var emitSession=(0,_react.useCallback)(function(data){var _imperativeContextRef;var sessionId=(0,_session.extractSessionId)(data);if(!sessionId)return;var context=(_imperativeContextRef=imperativeContextRef.current)!=null?_imperativeContextRef:sessionContextRef.current;imperativeSessionRef.current=undefined;imperativeContextRef.current=undefined;if(sessionId===sessionIdRef.current)return;sessionIdRef.current=sessionId;try{onSessionRef.current==null?void 0:onSessionRef.current(sessionId,context!=null?context:{});}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("onSession handler threw an error"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{source:_session.SESSION_UPDATED_MESSAGE_TYPE}});}},[]);var triggerAppInit=function triggerAppInit(){if(webViewRef.current){var _webViewRef$current;(_webViewRef$current=webViewRef.current)==null?void 0:_webViewRef$current.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());webViewRef.current.injectJavaScript(`
2
2
  // Trigger APP_READY equivalent
3
3
  window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'APP_READY' }));
4
4
  true;
5
- `);}};var executeStorageOp=(0,_react.useCallback)(function(operation){if(isStorageReady){operation();}else{pendingStorageOps.current.push(operation);}},[isStorageReady]);var handleMessage=(0,_react.useCallback)(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(event){var _webViewRef$current2;var data=event.nativeEvent.data;try{var parsedData=JSON.parse(data);if(Object.values(_webViewStorage.StorageMessageType).includes(parsedData.type)){var storageMessage=parsedData;switch(storageMessage.type){case _webViewStorage.StorageMessageType.STORAGE_READY:setIsStorageReady(true);pendingStorageOps.current.forEach(function(op){return op();});pendingStorageOps.current=[];(_webViewRef$current2=webViewRef.current)==null?void 0:_webViewRef$current2.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));break;case _webViewStorage.StorageMessageType.STORAGE_RESPONSE:if(storageMessage.key&&storageMessage.value){memoryCache.current[storageMessage.key]=storageMessage.value;if(storageMessage.key==="rblyn_anon"){setEffectiveUserId(storageMessage.value);}}break;case _webViewStorage.StorageMessageType.STORAGE_ERROR:_logger.logger.error("WebView storage error:",storageMessage.error);break;}return;}if(__DEV__){if((parsedData==null?void 0:parsedData.type)==="CONSOLE"){console.log(`WebView ${parsedData==null?void 0:parsedData.level}:`,parsedData==null?void 0:parsedData.data);return;}if((parsedData==null?void 0:parsedData.type)==="ERROR"){console.error("WebView Error:",parsedData==null?void 0:parsedData.data);return;}}if((parsedData==null?void 0:parsedData.type)==="SYSTEM_INFO"){var _parsedData$data;setSystemInfo((_parsedData$data=parsedData==null?void 0:parsedData.data)!=null?_parsedData$data:{os:"",browser:""});systemInfoRef.current=parsedData==null?void 0:parsedData.data;return;}if((parsedData==null?void 0:parsedData.type)===_session.SESSION_UPDATED_MESSAGE_TYPE){emitSession(parsedData==null?void 0:parsedData.data);return;}if((parsedData==null?void 0:parsedData.type)==="APP_READY"){emitEvent(_events.ChatbotEventType.CHATBOT_APP_READY);if(webViewRef.current&&isWebViewVisible){var _webViewRef$current3,_loadingScreen$image,_brandConfig$images,_brandConfig$images$h,_loadingScreen$bot_na,_loadingScreen$brand_,_loadingScreen$powere,_brandConfig$footer,_webViewRef$current4;(_webViewRef$current3=webViewRef.current)==null?void 0:_webViewRef$current3.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());var brandConfig=chatbotConfigRef.current;var loadingScreen=loadingScreenRef.current;var hint={};var addHint=function addHint(key,value){if(value!==undefined&&value!==""){hint[key]=value;}};addHint("init_load_image",(_loadingScreen$image=loadingScreen==null?void 0:loadingScreen.image)!=null?_loadingScreen$image:(brandConfig==null?void 0:(_brandConfig$images=brandConfig.images)==null?void 0:(_brandConfig$images$h=_brandConfig$images.header_image_url)==null?void 0:_brandConfig$images$h.url)||(brandConfig==null?void 0:brandConfig.image_url));addHint("init_load_bot_name",(_loadingScreen$bot_na=loadingScreen==null?void 0:loadingScreen.bot_name)!=null?_loadingScreen$bot_na:brandConfig==null?void 0:brandConfig.name);addHint("init_load_brand_color",(_loadingScreen$brand_=loadingScreen==null?void 0:loadingScreen.brand_color)!=null?_loadingScreen$brand_:brandConfig==null?void 0:brandConfig.brand_colour);addHint("init_load_powered_by",(_loadingScreen$powere=loadingScreen==null?void 0:loadingScreen.powered_by)!=null?_loadingScreen$powere:brandConfig==null?void 0:(_brandConfig$footer=brandConfig.footer)==null?void 0:_brandConfig$footer.show_powered_by);addHint("init_load_sub_text",loadingScreen==null?void 0:loadingScreen.sub_text);var initLoadHint;if(!hasSentInitLoadRef.current&&Object.keys(hint).length>0){initLoadHint=hint;hasSentInitLoadRef.current=true;}var messageData={name:"registerUserId",action:"registerUserId",data:Object.assign({userId:effectiveUserId},initLoadHint,(0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)({},_session.RESUME_SESSION_KEY,resumeSessionRef.current||undefined),"discrete",discreteRef.current?true:undefined),"token",user_token?`${user_token}`:undefined),"userProfile",Object.assign({},user_profile,(0,_systemInfo.getSystemInfo)(systemInfoRef==null?void 0:systemInfoRef.current),{__INT_SYS_INFO__:Object.assign({},(0,_systemInfo.getSystemInfo)(systemInfoRef==null?void 0:systemInfoRef.current))})))};_logger.logger.debug("messageData====>",JSON.stringify(Object.assign({},messageData,{data:Object.assign({},messageData.data,(0,_defineProperty2.default)({},_session.RESUME_SESSION_KEY,resumeSessionRef.current?"[redacted]":undefined))})));(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript(`
5
+ `);}};var postSessionSwitch=(0,_react.useCallback)(function(sessionId){if(!webViewRef.current)return;var messageData={name:_session.SWITCH_SESSION_ACTION,action:_session.SWITCH_SESSION_ACTION,data:(0,_defineProperty2.default)({},_session.RESUME_SESSION_KEY,sessionId)};webViewRef.current.injectJavaScript(`
6
+ window.postMessage(${JSON.stringify(messageData)}, '*');
7
+ true;
8
+ `);},[]);postSessionSwitchRef.current=postSessionSwitch;var executeStorageOp=(0,_react.useCallback)(function(operation){if(isStorageReady){operation();}else{pendingStorageOps.current.push(operation);}},[isStorageReady]);var handleMessage=(0,_react.useCallback)(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(event){var _webViewRef$current2;var data=event.nativeEvent.data;try{var parsedData=JSON.parse(data);if(Object.values(_webViewStorage.StorageMessageType).includes(parsedData.type)){var storageMessage=parsedData;switch(storageMessage.type){case _webViewStorage.StorageMessageType.STORAGE_READY:setIsStorageReady(true);pendingStorageOps.current.forEach(function(op){return op();});pendingStorageOps.current=[];(_webViewRef$current2=webViewRef.current)==null?void 0:_webViewRef$current2.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));break;case _webViewStorage.StorageMessageType.STORAGE_RESPONSE:if(storageMessage.key&&storageMessage.value){memoryCache.current[storageMessage.key]=storageMessage.value;if(storageMessage.key==="rblyn_anon"){setEffectiveUserId(storageMessage.value);}}break;case _webViewStorage.StorageMessageType.STORAGE_ERROR:_logger.logger.error("WebView storage error:",storageMessage.error);break;}return;}if(__DEV__){if((parsedData==null?void 0:parsedData.type)==="CONSOLE"){console.log(`WebView ${parsedData==null?void 0:parsedData.level}:`,parsedData==null?void 0:parsedData.data);return;}if((parsedData==null?void 0:parsedData.type)==="ERROR"){console.error("WebView Error:",parsedData==null?void 0:parsedData.data);return;}}if((parsedData==null?void 0:parsedData.type)==="SYSTEM_INFO"){var _parsedData$data;setSystemInfo((_parsedData$data=parsedData==null?void 0:parsedData.data)!=null?_parsedData$data:{os:"",browser:""});systemInfoRef.current=parsedData==null?void 0:parsedData.data;return;}if((parsedData==null?void 0:parsedData.type)===_session.SESSION_UPDATED_MESSAGE_TYPE){emitSession(parsedData==null?void 0:parsedData.data);return;}if((parsedData==null?void 0:parsedData.type)==="APP_READY"){emitEvent(_events.ChatbotEventType.CHATBOT_APP_READY);if(webViewRef.current&&isWebViewVisible){var _webViewRef$current3,_loadingScreen$image,_brandConfig$images,_brandConfig$images$h,_loadingScreen$bot_na,_loadingScreen$brand_,_loadingScreen$powere,_brandConfig$footer,_webViewRef$current4;(_webViewRef$current3=webViewRef.current)==null?void 0:_webViewRef$current3.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());var brandConfig=chatbotConfigRef.current;var loadingScreen=loadingScreenRef.current;var hint={};var addHint=function addHint(key,value){if(value!==undefined&&value!==""){hint[key]=value;}};addHint("init_load_image",(_loadingScreen$image=loadingScreen==null?void 0:loadingScreen.image)!=null?_loadingScreen$image:(brandConfig==null?void 0:(_brandConfig$images=brandConfig.images)==null?void 0:(_brandConfig$images$h=_brandConfig$images.header_image_url)==null?void 0:_brandConfig$images$h.url)||(brandConfig==null?void 0:brandConfig.image_url));addHint("init_load_bot_name",(_loadingScreen$bot_na=loadingScreen==null?void 0:loadingScreen.bot_name)!=null?_loadingScreen$bot_na:brandConfig==null?void 0:brandConfig.name);addHint("init_load_brand_color",(_loadingScreen$brand_=loadingScreen==null?void 0:loadingScreen.brand_color)!=null?_loadingScreen$brand_:brandConfig==null?void 0:brandConfig.brand_colour);addHint("init_load_powered_by",(_loadingScreen$powere=loadingScreen==null?void 0:loadingScreen.powered_by)!=null?_loadingScreen$powere:brandConfig==null?void 0:(_brandConfig$footer=brandConfig.footer)==null?void 0:_brandConfig$footer.show_powered_by);addHint("init_load_sub_text",loadingScreen==null?void 0:loadingScreen.sub_text);var initLoadHint;if(!hasSentInitLoadRef.current&&Object.keys(hint).length>0){initLoadHint=hint;hasSentInitLoadRef.current=true;}var messageData={name:"registerUserId",action:"registerUserId",data:Object.assign({userId:effectiveUserId},initLoadHint,(0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)((0,_defineProperty2.default)({},_session.RESUME_SESSION_KEY,resolveResumeTarget()||undefined),"discrete",discreteRef.current?true:undefined),"token",user_token?`${user_token}`:undefined),"userProfile",Object.assign({},user_profile,(0,_systemInfo.getSystemInfo)(systemInfoRef==null?void 0:systemInfoRef.current),{__INT_SYS_INFO__:Object.assign({},(0,_systemInfo.getSystemInfo)(systemInfoRef==null?void 0:systemInfoRef.current))})))};_logger.logger.debug("messageData====>",JSON.stringify(Object.assign({},messageData,{data:Object.assign({},messageData.data,(0,_defineProperty2.default)({},_session.RESUME_SESSION_KEY,resolveResumeTarget()?"[redacted]":undefined))})));(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript(`
6
9
  window.postMessage(${JSON.stringify({name:"openFrame",domain:"app-domain.com"})}, '*');
7
10
  window.postMessage(${JSON.stringify(messageData)}, '*');
8
11
  `);}}switch(parsedData==null?void 0:parsedData.type){case"close_chatbot":closeWebView();break;case"download_file":if(parsedData!=null&&parsedData.data||parsedData!=null&&parsedData.url&&parsedData!=null&&parsedData.filename){var downloadData=(parsedData==null?void 0:parsedData.data)||{url:parsedData==null?void 0:parsedData.url,filename:parsedData==null?void 0:parsedData.filename,inPlace:parsedData==null?void 0:parsedData.inPlace};(0,_fileDownload.handleDownloadRequest)(downloadData);}break;case"CHATBOT_LOADED":emitEvent(_events.ChatbotEventType.CHATBOT_LOADED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZED,parsedData==null?void 0:parsedData.data);break;case"SESSION_REFRESHED":emitEvent(_events.ChatbotEventType.SESSION_REFRESHED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZATION_FAILED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZATION_FAILED,parsedData==null?void 0:parsedData.data);break;case"REQUEST_MIC_PERMISSION":var granted=yield requestAndroidMicPermission();if(webViewRef.current&&isWebViewVisible){var _webViewRef$current5;var _messageData={name:"requestMicPermission",action:"requestMicPermission",type:granted?"MIC_PERMISSION_GRANTED":"MIC_PERMISSION_DENIED"};(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript(`
9
- window.postMessage(${JSON.stringify(_messageData)}, '*');`);}break;default:if(onMessage)onMessage(parsedData!=null?parsedData:{});}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to parse WebView message"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{messageData:data}});}});return function(_x){return _ref2.apply(this,arguments);};}(),[emitEvent,emitSession,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){var userId=user_id?String(user_id):undefined;if(!userId){userId=memoryCache.current["rblyn_anon"];if(!userId){userId=(0,_cookieUtils.generateUUID)();executeStorageOp(function(){var _webViewRef$current6;(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref3.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current7;(_webViewRef$current7=webViewRef.current)==null?void 0:_webViewRef$current7.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl=`${_constants.API_URL}/chat/chatbot/get/`;var payload={client_user_id:effectiveUserId,resumable_session_id:resumeSessionRef.current||undefined,discrete:discreteRef.current?true:undefined,org_id:api_key,token:user_token,extra_info:{}};var response=yield fetch(endpointUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(payload)});if(!response.ok){throw new Error("Failed to fetch chatbot configuration");}var data=yield response.json();var orgInfo=data==null?void 0:(_data$user=data.user)==null?void 0:_data$user.org_info;if(orgInfo){var _orgInfo$brand_config,_orgInfo$brand_config2,_orgInfo$brand_config3,_orgInfo$brand_config4,_orgInfo$brand_config5,_orgInfo$brand_config6,_orgInfo$brand_config7,_orgInfo$brand_config8,_orgInfo$brand_config9,_orgInfo$brand_config10,_orgInfo$brand_config11,_orgInfo$brand_config12,_orgInfo$brand_config13,_orgInfo$brand_config14,_orgInfo$brand_config15,_orgInfo$brand_config16,_orgInfo$brand_config17,_orgInfo$brand_config18,_orgInfo$brand_config19,_orgInfo$brand_config20,_orgInfo$brand_config21,_orgInfo$brand_config22,_orgInfo$brand_config23,_orgInfo$brand_config24,_orgInfo$brand_config25,_orgInfo$brand_config26,_orgInfo$brand_config27,_orgInfo$brand_config28;var config={brand_colour:((_orgInfo$brand_config=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config2=_orgInfo$brand_config.colors)==null?void 0:_orgInfo$brand_config2.brand_color)||"",name:((_orgInfo$brand_config3=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config3.name)||"",image_url:((_orgInfo$brand_config4=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config4.launcher_logo_url)||"",chat_interface_config:{chat_bubble_prompts:[],display_name:((_orgInfo$brand_config5=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config5.display_name)||"",welcome_message:((_orgInfo$brand_config6=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config6.welcome_message)||"Hey! What can we help you with today?",redirect_url:((_orgInfo$brand_config7=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config7.redirect_url)||""},interface_properties:{position:((_orgInfo$brand_config8=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config9=_orgInfo$brand_config8.interface_properties)==null?void 0:_orgInfo$brand_config9.position)||WidgetPositionEnums.RIGHT,side_spacing:(_orgInfo$brand_config10=(_orgInfo$brand_config11=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config12=_orgInfo$brand_config11.interface_properties)==null?void 0:_orgInfo$brand_config12.side_spacing)!=null?_orgInfo$brand_config10:20,bottom_spacing:(_orgInfo$brand_config13=(_orgInfo$brand_config14=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config15=_orgInfo$brand_config14.interface_properties)==null?void 0:_orgInfo$brand_config15.bottom_spacing)!=null?_orgInfo$brand_config13:20},interface_type:((_orgInfo$brand_config16=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config16.interface_type)||ChatbotInterfaceType.WIDGET,launcher_type:((_orgInfo$brand_config17=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config17.launcher_type)||LauncherType.IMAGE,launcher_properties:{text:((_orgInfo$brand_config18=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config19=_orgInfo$brand_config18.launcher_properties)==null?void 0:_orgInfo$brand_config19.text)||""},images:{launcher_image_url:{url:((_orgInfo$brand_config20=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config21=_orgInfo$brand_config20.images)==null?void 0:(_orgInfo$brand_config22=_orgInfo$brand_config21.launcher_image_url)==null?void 0:_orgInfo$brand_config22.url)||_constants.DEFAULT_LAUNCHER_IMAGE},header_image_url:{url:((_orgInfo$brand_config23=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config24=_orgInfo$brand_config23.images)==null?void 0:(_orgInfo$brand_config25=_orgInfo$brand_config24.header_image_url)==null?void 0:_orgInfo$brand_config25.url)||""}},footer:{show_powered_by:(_orgInfo$brand_config26=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config27=_orgInfo$brand_config26.footer)==null?void 0:_orgInfo$brand_config27.show_powered_by},chat_iframe_url:((_orgInfo$brand_config28=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config28.chat_iframe_url)||""};setChatbotConfig(config);}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to fetch chatbot configuration"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.NETWORK_ERROR,context:{api_key:api_key,user_id:user_id}});}finally{setLoading(false);}});return function fetchChatbotConfig(){return _ref4.apply(this,arguments);};}();if(api_key&&effectiveUserId){fetchChatbotConfig();}},[api_key,effectiveUserId,user_token]);function constructUrl(){if(!effectiveUserId)return"";var params=new URLSearchParams({id:api_key});return`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;}var openWebView=(0,_react.useCallback)(function(){if(isWebViewVisibleRef.current)return;isWebViewVisibleRef.current=true;setIsWebViewVisible(true);if(enableAnimation){(0,_animations.animateWebViewOpen)(animatedValues,function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{requestAnimationFrame(function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}},[enableAnimation,animatedValues,externalOnOpen,emitEvent]);var closeWebView=(0,_react.useCallback)(function(){if(webViewRef.current){webViewRef.current.postMessage(JSON.stringify({name:"closeFrame",domain:"app-domain.com"}));}if(enableAnimation){(0,_animations.animateWebViewClose)(animatedValues,function(){isWebViewVisibleRef.current=false;setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);});}else{isWebViewVisibleRef.current=false;setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);}},[enableAnimation,animatedValues,externalOnClose,emitEvent]);(0,_react.useEffect)(function(){if(show_floating_button&&chatbotConfig){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_LOADED);}},[show_floating_button,chatbotConfig,emitEvent]);(0,_react.useEffect)(function(){if(!loading&&chatbotConfig&&effectiveUserId&&!isInitialized){isInitializedRef.current=true;setIsInitialized(true);onReady==null?void 0:onReady();}},[loading,chatbotConfig,effectiveUserId,isInitialized,onReady]);var getScreenDimensions=function getScreenDimensions(){var windowHeight=_reactNative.Dimensions.get("window").height;var windowWidth=_reactNative.Dimensions.get("window").width;var statusBarHeight=_reactNative.Platform.OS==="ios"?0:_reactNative.StatusBar.currentHeight||0;return{height:windowHeight-statusBarHeight,width:windowWidth};};var requestAndroidMicPermission=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){try{if(_reactNative.Platform.OS==="ios"){return true;}var alreadyGranted=yield _reactNative.PermissionsAndroid.check(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO);if(alreadyGranted){return true;}var result=yield _reactNative.PermissionsAndroid.request(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,{title:"Microphone permission",message:"This app uses your microphone for voice features.",buttonPositive:"Allow",buttonNegative:"Deny"});var granted=result===_reactNative.PermissionsAndroid.RESULTS.GRANTED;if(!granted){_reactNative.Alert.alert("Microphone required","Voice features will not work unless you allow microphone access.");}return granted;}catch(err){console.warn("Error requesting mic permission",err);return false;}}),[]);var screenDimensions=getScreenDimensions();(0,_react.useEffect)(function(){if(__DEV__){(0,_debugConfig.enableNetworkDebug)();}},[]);var position=(chatbotConfig==null?void 0:(_chatbotConfig$interf=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf.position)||"Right";var sideSpacing=(_chatbotConfig$interf2=chatbotConfig==null?void 0:(_chatbotConfig$interf3=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf3.side_spacing)!=null?_chatbotConfig$interf2:20;var bottomSpacing=(_chatbotConfig$interf4=chatbotConfig==null?void 0:(_chatbotConfig$interf5=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf5.bottom_spacing)!=null?_chatbotConfig$interf4:20;return(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotSDK",children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles==null?void 0:styles.mainContainer,pointerEvents:isWebViewVisible?"auto":"box-none",children:[!loading&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"FloatingButton",children:show_floating_button&&api_key&&chatbotConfig&&(0,_jsxRuntime.jsx)(_FloatingButton.default,{chatbotConfig:chatbotConfig,isWebViewVisible:isWebViewVisible,onPress:function onPress(){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_CLICKED);openWebView();},brandColor:chatbotConfig.brand_colour,imageUrl:chatbotConfig.image_url})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.webViewWrapper,{height:isWebViewVisible?"100%":0}],pointerEvents:isWebViewVisible?"auto":"none",children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.fullScreenContainer,{opacity:animatedValues.opacity,transform:[{scale:animatedValues.scale},{translateY:animatedValues.translateY}]}],children:(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotWebView",children:(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,{mediaCapturePermissionGrantType:"grant",webviewDebuggingEnabled:true,ref:webViewRef,source:{uri:constructUrl()},onMessage:handleMessage,style:styles.webview,containerStyle:isFullScreen?{width:screenDimensions.width,height:screenDimensions.height-40}:undefined,allowsInlineMediaPlayback:true,mediaPlaybackRequiresUserAction:false,allowFileAccess:false,geolocationEnabled:false,javaScriptEnabled:true,domStorageEnabled:true,cacheEnabled:true,scrollEnabled:true,bounces:false,onShouldStartLoadWithRequest:function onShouldStartLoadWithRequest(request){return request.url.startsWith(_constants.BASE_CHATBOT_URL)||request.url.startsWith((chatbotConfig==null?void 0:chatbotConfig.chat_iframe_url)||"");},startInLoadingState:isFirstLoadRef.current,onLoadEnd:function onLoadEnd(){var _webViewRef$current8;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current8=webViewRef.current)==null?void 0:_webViewRef$current8.injectJavaScript(`
12
+ window.postMessage(${JSON.stringify(_messageData)}, '*');`);}break;default:if(onMessage)onMessage(parsedData!=null?parsedData:{});}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to parse WebView message"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{messageData:data}});}});return function(_x){return _ref2.apply(this,arguments);};}(),[emitEvent,emitSession,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){var userId=user_id?String(user_id):undefined;if(!userId){userId=memoryCache.current["rblyn_anon"];if(!userId){userId=(0,_cookieUtils.generateUUID)();executeStorageOp(function(){var _webViewRef$current6;(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref3.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current7;(_webViewRef$current7=webViewRef.current)==null?void 0:_webViewRef$current7.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl=`${_constants.API_URL}/chat/chatbot/get/`;var payload={client_user_id:effectiveUserId,resumable_session_id:resolveResumeTarget()||undefined,discrete:discreteRef.current?true:undefined,org_id:api_key,token:user_token,extra_info:{}};var response=yield fetch(endpointUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(payload)});if(!response.ok){throw new Error("Failed to fetch chatbot configuration");}var data=yield response.json();var orgInfo=data==null?void 0:(_data$user=data.user)==null?void 0:_data$user.org_info;if(orgInfo){var _orgInfo$brand_config,_orgInfo$brand_config2,_orgInfo$brand_config3,_orgInfo$brand_config4,_orgInfo$brand_config5,_orgInfo$brand_config6,_orgInfo$brand_config7,_orgInfo$brand_config8,_orgInfo$brand_config9,_orgInfo$brand_config10,_orgInfo$brand_config11,_orgInfo$brand_config12,_orgInfo$brand_config13,_orgInfo$brand_config14,_orgInfo$brand_config15,_orgInfo$brand_config16,_orgInfo$brand_config17,_orgInfo$brand_config18,_orgInfo$brand_config19,_orgInfo$brand_config20,_orgInfo$brand_config21,_orgInfo$brand_config22,_orgInfo$brand_config23,_orgInfo$brand_config24,_orgInfo$brand_config25,_orgInfo$brand_config26,_orgInfo$brand_config27,_orgInfo$brand_config28;var config={brand_colour:((_orgInfo$brand_config=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config2=_orgInfo$brand_config.colors)==null?void 0:_orgInfo$brand_config2.brand_color)||"",name:((_orgInfo$brand_config3=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config3.name)||"",image_url:((_orgInfo$brand_config4=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config4.launcher_logo_url)||"",chat_interface_config:{chat_bubble_prompts:[],display_name:((_orgInfo$brand_config5=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config5.display_name)||"",welcome_message:((_orgInfo$brand_config6=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config6.welcome_message)||"Hey! What can we help you with today?",redirect_url:((_orgInfo$brand_config7=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config7.redirect_url)||""},interface_properties:{position:((_orgInfo$brand_config8=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config9=_orgInfo$brand_config8.interface_properties)==null?void 0:_orgInfo$brand_config9.position)||WidgetPositionEnums.RIGHT,side_spacing:(_orgInfo$brand_config10=(_orgInfo$brand_config11=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config12=_orgInfo$brand_config11.interface_properties)==null?void 0:_orgInfo$brand_config12.side_spacing)!=null?_orgInfo$brand_config10:20,bottom_spacing:(_orgInfo$brand_config13=(_orgInfo$brand_config14=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config15=_orgInfo$brand_config14.interface_properties)==null?void 0:_orgInfo$brand_config15.bottom_spacing)!=null?_orgInfo$brand_config13:20},interface_type:((_orgInfo$brand_config16=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config16.interface_type)||ChatbotInterfaceType.WIDGET,launcher_type:((_orgInfo$brand_config17=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config17.launcher_type)||LauncherType.IMAGE,launcher_properties:{text:((_orgInfo$brand_config18=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config19=_orgInfo$brand_config18.launcher_properties)==null?void 0:_orgInfo$brand_config19.text)||""},images:{launcher_image_url:{url:((_orgInfo$brand_config20=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config21=_orgInfo$brand_config20.images)==null?void 0:(_orgInfo$brand_config22=_orgInfo$brand_config21.launcher_image_url)==null?void 0:_orgInfo$brand_config22.url)||_constants.DEFAULT_LAUNCHER_IMAGE},header_image_url:{url:((_orgInfo$brand_config23=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config24=_orgInfo$brand_config23.images)==null?void 0:(_orgInfo$brand_config25=_orgInfo$brand_config24.header_image_url)==null?void 0:_orgInfo$brand_config25.url)||""}},footer:{show_powered_by:(_orgInfo$brand_config26=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config27=_orgInfo$brand_config26.footer)==null?void 0:_orgInfo$brand_config27.show_powered_by},chat_iframe_url:((_orgInfo$brand_config28=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config28.chat_iframe_url)||""};setChatbotConfig(config);}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to fetch chatbot configuration"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.NETWORK_ERROR,context:{api_key:api_key,user_id:user_id}});}finally{setLoading(false);}});return function fetchChatbotConfig(){return _ref4.apply(this,arguments);};}();if(api_key&&effectiveUserId){fetchChatbotConfig();}},[api_key,effectiveUserId,user_token]);function constructUrl(){if(!effectiveUserId)return"";var params=new URLSearchParams({id:api_key});return`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;}var openWebView=(0,_react.useCallback)(function(){if(isWebViewVisibleRef.current)return;isWebViewVisibleRef.current=true;setIsWebViewVisible(true);if(enableAnimation){(0,_animations.animateWebViewOpen)(animatedValues,function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{requestAnimationFrame(function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}},[enableAnimation,animatedValues,externalOnOpen,emitEvent]);openWebViewRef.current=openWebView;var closeWebView=(0,_react.useCallback)(function(){if(webViewRef.current){webViewRef.current.postMessage(JSON.stringify({name:"closeFrame",domain:"app-domain.com"}));}if(enableAnimation){(0,_animations.animateWebViewClose)(animatedValues,function(){isWebViewVisibleRef.current=false;setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);});}else{isWebViewVisibleRef.current=false;setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);}},[enableAnimation,animatedValues,externalOnClose,emitEvent]);(0,_react.useEffect)(function(){if(show_floating_button&&chatbotConfig){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_LOADED);}},[show_floating_button,chatbotConfig,emitEvent]);(0,_react.useEffect)(function(){if(!loading&&chatbotConfig&&effectiveUserId&&!isInitialized){isInitializedRef.current=true;setIsInitialized(true);onReady==null?void 0:onReady();var pending=pendingOpenRef.current;if(pending){pendingOpenRef.current=undefined;openWebViewRef.current==null?void 0:openWebViewRef.current();postSessionSwitchRef.current==null?void 0:postSessionSwitchRef.current(pending);}}},[loading,chatbotConfig,effectiveUserId,isInitialized,onReady]);var getScreenDimensions=function getScreenDimensions(){var windowHeight=_reactNative.Dimensions.get("window").height;var windowWidth=_reactNative.Dimensions.get("window").width;var statusBarHeight=_reactNative.Platform.OS==="ios"?0:_reactNative.StatusBar.currentHeight||0;return{height:windowHeight-statusBarHeight,width:windowWidth};};var requestAndroidMicPermission=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){try{if(_reactNative.Platform.OS==="ios"){return true;}var alreadyGranted=yield _reactNative.PermissionsAndroid.check(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO);if(alreadyGranted){return true;}var result=yield _reactNative.PermissionsAndroid.request(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,{title:"Microphone permission",message:"This app uses your microphone for voice features.",buttonPositive:"Allow",buttonNegative:"Deny"});var granted=result===_reactNative.PermissionsAndroid.RESULTS.GRANTED;if(!granted){_reactNative.Alert.alert("Microphone required","Voice features will not work unless you allow microphone access.");}return granted;}catch(err){console.warn("Error requesting mic permission",err);return false;}}),[]);var screenDimensions=getScreenDimensions();(0,_react.useEffect)(function(){if(__DEV__){(0,_debugConfig.enableNetworkDebug)();}},[]);var position=(chatbotConfig==null?void 0:(_chatbotConfig$interf=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf.position)||"Right";var sideSpacing=(_chatbotConfig$interf2=chatbotConfig==null?void 0:(_chatbotConfig$interf3=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf3.side_spacing)!=null?_chatbotConfig$interf2:20;var bottomSpacing=(_chatbotConfig$interf4=chatbotConfig==null?void 0:(_chatbotConfig$interf5=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf5.bottom_spacing)!=null?_chatbotConfig$interf4:20;return(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotSDK",children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles==null?void 0:styles.mainContainer,pointerEvents:isWebViewVisible?"auto":"box-none",children:[!loading&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"FloatingButton",children:show_floating_button&&api_key&&chatbotConfig&&(0,_jsxRuntime.jsx)(_FloatingButton.default,{chatbotConfig:chatbotConfig,isWebViewVisible:isWebViewVisible,onPress:function onPress(){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_CLICKED);openWebView();},brandColor:chatbotConfig.brand_colour,imageUrl:chatbotConfig.image_url})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.webViewWrapper,{height:isWebViewVisible?"100%":0}],pointerEvents:isWebViewVisible?"auto":"none",children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.fullScreenContainer,{opacity:animatedValues.opacity,transform:[{scale:animatedValues.scale},{translateY:animatedValues.translateY}]}],children:(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotWebView",children:(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,{mediaCapturePermissionGrantType:"grant",webviewDebuggingEnabled:true,ref:webViewRef,source:{uri:constructUrl()},onMessage:handleMessage,style:styles.webview,containerStyle:isFullScreen?{width:screenDimensions.width,height:screenDimensions.height-40}:undefined,allowsInlineMediaPlayback:true,mediaPlaybackRequiresUserAction:false,allowFileAccess:false,geolocationEnabled:false,javaScriptEnabled:true,domStorageEnabled:true,cacheEnabled:true,scrollEnabled:true,bounces:false,originWhitelist:_webViewNavigation.CHATBOT_ORIGIN_WHITELIST,onShouldStartLoadWithRequest:function onShouldStartLoadWithRequest(request){return(0,_webViewNavigation.handleWebViewNavigationRequest)(request,[_constants.BASE_CHATBOT_URL,chatbotConfig==null?void 0:chatbotConfig.chat_iframe_url]);},startInLoadingState:isFirstLoadRef.current,onLoadEnd:function onLoadEnd(){var _webViewRef$current8;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current8=webViewRef.current)==null?void 0:_webViewRef$current8.injectJavaScript(`
10
13
  if (!document.querySelector('meta[name="viewport"]')) {
11
14
  var meta = document.createElement('meta');
12
15
  meta.name = 'viewport';
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_animations","_fileDownload","_session","_jsxRuntime","_this","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ChatbotInterfaceType","exports","WidgetPositionEnums","LauncherType","Chatbot","forwardRef","_ref","ref","_chatbotConfig$interf","_chatbotConfig$interf2","_chatbotConfig$interf3","_chatbotConfig$interf4","_chatbotConfig$interf5","api_key","user_id","user_token","_ref$show_floating_bu","show_floating_button","onEvent","onMessage","_ref$isFullScreen","isFullScreen","_ref$enableAnimation","enableAnimation","externalOnOpen","onOpen","externalOnClose","onClose","onReady","user_profile","session_id","session_context","_ref$discrete","discrete","onSession","loading_screen","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","_useState7","_useState8","isInitialized","setIsInitialized","webViewRef","useRef","isFirstLoadRef","_useState9","_useState10","toastVisible","setToastVisible","_useState11","_useState12","toastMessage","setToastMessage","_useState13","_useState14","effectiveUserId","setEffectiveUserId","_useState15","_useState16","isStorageReady","setIsStorageReady","pendingStorageOps","memoryCache","_useState17","os","browser","_useState18","systemInfo","setSystemInfo","systemInfoRef","isInitializedRef","isWebViewVisibleRef","sessionIdRef","undefined","onSessionRef","sessionContextRef","resumeSessionRef","discreteRef","loadingScreenRef","current","chatbotConfigRef","hasSentInitLoadRef","animatedValues","scale","Animated","Value","translateY","opacity","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","useImperativeHandle","open","openWebView","close","closeWebView","toggle","isReady","getSessionId","emitSession","useCallback","data","sessionId","extractSessionId","_sessionContextRef$cu","error","errorTracker","trackError","Error","type","ErrorTypes","RUNTIME_ERROR","context","source","SESSION_UPDATED_MESSAGE_TYPE","triggerAppInit","_webViewRef$current","injectJavaScript","getBrowserAndOSInfoScript","executeStorageOp","operation","push","handleMessage","_ref2","_asyncToGenerator2","event","_webViewRef$current2","nativeEvent","parsedData","JSON","parse","values","StorageMessageType","includes","storageMessage","STORAGE_READY","forEach","op","createStorageMessage","GET_STORAGE","STORAGE_RESPONSE","key","value","STORAGE_ERROR","logger","__DEV__","console","log","level","_parsedData$data","ChatbotEventType","CHATBOT_APP_READY","_webViewRef$current3","_loadingScreen$image","_brandConfig$images","_brandConfig$images$h","_loadingScreen$bot_na","_loadingScreen$brand_","_loadingScreen$powere","_brandConfig$footer","_webViewRef$current4","brandConfig","loadingScreen","hint","addHint","image","images","header_image_url","url","image_url","bot_name","name","brand_color","brand_colour","powered_by","footer","show_powered_by","sub_text","initLoadHint","keys","length","messageData","action","assign","_defineProperty2","RESUME_SESSION_KEY","getSystemInfo","__INT_SYS_INFO__","debug","stringify","domain","filename","downloadData","inPlace","handleDownloadRequest","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","granted","requestAndroidMicPermission","_webViewRef$current5","_x","apply","arguments","useEffect","initializeUserId","_ref3","String","generateUUID","_webViewRef$current6","SET_STORAGE","getStorageScript","_webViewRef$current7","fetchChatbotConfig","_ref4","_data$user","endpointUrl","API_URL","payload","client_user_id","resumable_session_id","org_id","token","extra_info","response","fetch","method","headers","body","ok","json","orgInfo","user","org_info","_orgInfo$brand_config","_orgInfo$brand_config2","_orgInfo$brand_config3","_orgInfo$brand_config4","_orgInfo$brand_config5","_orgInfo$brand_config6","_orgInfo$brand_config7","_orgInfo$brand_config8","_orgInfo$brand_config9","_orgInfo$brand_config10","_orgInfo$brand_config11","_orgInfo$brand_config12","_orgInfo$brand_config13","_orgInfo$brand_config14","_orgInfo$brand_config15","_orgInfo$brand_config16","_orgInfo$brand_config17","_orgInfo$brand_config18","_orgInfo$brand_config19","_orgInfo$brand_config20","_orgInfo$brand_config21","_orgInfo$brand_config22","_orgInfo$brand_config23","_orgInfo$brand_config24","_orgInfo$brand_config25","_orgInfo$brand_config26","_orgInfo$brand_config27","_orgInfo$brand_config28","config","brand_config","colors","launcher_logo_url","chat_interface_config","chat_bubble_prompts","display_name","welcome_message","redirect_url","interface_properties","position","RIGHT","side_spacing","bottom_spacing","interface_type","WIDGET","launcher_type","IMAGE","launcher_properties","text","launcher_image_url","DEFAULT_LAUNCHER_IMAGE","chat_iframe_url","NETWORK_ERROR","constructUrl","params","URLSearchParams","id","BASE_CHATBOT_URL","toString","animateWebViewOpen","CHATBOT_OPENED","setTimeout","requestAnimationFrame","postMessage","animateWebViewClose","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","alreadyGranted","PermissionsAndroid","check","PERMISSIONS","RECORD_AUDIO","result","request","title","message","buttonPositive","buttonNegative","RESULTS","GRANTED","Alert","alert","err","warn","screenDimensions","enableNetworkDebug","sideSpacing","bottomSpacing","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","pointerEvents","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","webViewWrapper","fullScreenContainer","transform","WebView","mediaCapturePermissionGrantType","webviewDebuggingEnabled","uri","webview","containerStyle","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current8","enableWebViewDebug","onError","syntheticEvent","description","code","displayName","StyleSheet","create","flex","overflow","top","left","right","bottom","zIndex","backgroundColor","inlineContainer","_default"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"6gBAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WASA,IAAAC,YAAA,CAAAD,OAAA,iBAYA,IAAAE,mBAAA,CAAAF,OAAA,yBACA,IAAAG,eAAA,CAAAC,sBAAA,CAAAJ,OAAA,sBACA,IAAAK,UAAA,CAAAL,OAAA,gBACA,IAAAM,WAAA,CAAAN,OAAA,uBACA,IAAAO,kBAAA,CAAAP,OAAA,6BACA,IAAAQ,OAAA,CAAAR,OAAA,mBAKA,IAAAS,OAAA,CAAAT,OAAA,mBACA,IAAAU,YAAA,CAAAV,OAAA,wBACA,IAAAW,YAAA,CAAAP,sBAAA,CAAAJ,OAAA,8BACA,IAAAY,cAAA,CAAAZ,OAAA,+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AAE,CAAC,CACPO,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KACV,CACF,CAAC,CAAC,CAAC,IAAAG,QAAA,CAAApZ,OAAA,CAAAX,OAAA,CAEYc,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_animations","_fileDownload","_webViewNavigation","_session","_jsxRuntime","_this","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ChatbotInterfaceType","exports","WidgetPositionEnums","LauncherType","Chatbot","forwardRef","_ref","ref","_chatbotConfig$interf","_chatbotConfig$interf2","_chatbotConfig$interf3","_chatbotConfig$interf4","_chatbotConfig$interf5","api_key","user_id","user_token","_ref$show_floating_bu","show_floating_button","onEvent","onMessage","_ref$isFullScreen","isFullScreen","_ref$enableAnimation","enableAnimation","externalOnOpen","onOpen","externalOnClose","onClose","onReady","user_profile","session_id","session_context","_ref$discrete","discrete","onSession","loading_screen","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","_useState7","_useState8","isInitialized","setIsInitialized","webViewRef","useRef","isFirstLoadRef","_useState9","_useState10","toastVisible","setToastVisible","_useState11","_useState12","toastMessage","setToastMessage","_useState13","_useState14","effectiveUserId","setEffectiveUserId","_useState15","_useState16","isStorageReady","setIsStorageReady","pendingStorageOps","memoryCache","_useState17","os","browser","_useState18","systemInfo","setSystemInfo","systemInfoRef","isInitializedRef","isWebViewVisibleRef","sessionIdRef","undefined","onSessionRef","sessionContextRef","resumeSessionRef","discreteRef","loadingScreenRef","current","imperativeSessionRef","resolveResumeTarget","_imperativeSessionRef","imperativeContextRef","pendingOpenRef","openWebViewRef","postSessionSwitchRef","chatbotConfigRef","hasSentInitLoadRef","animatedValues","scale","Animated","Value","translateY","opacity","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","useImperativeHandle","open","openWebView","close","closeWebView","toggle","isReady","getSessionId","openToSession","sessionId","sessionContext","length","postSessionSwitch","emitSession","useCallback","data","_imperativeContextRef","extractSessionId","context","error","errorTracker","trackError","Error","type","ErrorTypes","RUNTIME_ERROR","source","SESSION_UPDATED_MESSAGE_TYPE","triggerAppInit","_webViewRef$current","injectJavaScript","getBrowserAndOSInfoScript","messageData","name","SWITCH_SESSION_ACTION","action","_defineProperty2","RESUME_SESSION_KEY","JSON","stringify","executeStorageOp","operation","push","handleMessage","_ref2","_asyncToGenerator2","event","_webViewRef$current2","nativeEvent","parsedData","parse","values","StorageMessageType","includes","storageMessage","STORAGE_READY","forEach","op","createStorageMessage","GET_STORAGE","STORAGE_RESPONSE","key","value","STORAGE_ERROR","logger","__DEV__","console","log","level","_parsedData$data","ChatbotEventType","CHATBOT_APP_READY","_webViewRef$current3","_loadingScreen$image","_brandConfig$images","_brandConfig$images$h","_loadingScreen$bot_na","_loadingScreen$brand_","_loadingScreen$powere","_brandConfig$footer","_webViewRef$current4","brandConfig","loadingScreen","hint","addHint","image","images","header_image_url","url","image_url","bot_name","brand_color","brand_colour","powered_by","footer","show_powered_by","sub_text","initLoadHint","keys","assign","getSystemInfo","__INT_SYS_INFO__","debug","domain","filename","downloadData","inPlace","handleDownloadRequest","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","granted","requestAndroidMicPermission","_webViewRef$current5","_x","apply","arguments","useEffect","initializeUserId","_ref3","String","generateUUID","_webViewRef$current6","SET_STORAGE","getStorageScript","_webViewRef$current7","fetchChatbotConfig","_ref4","_data$user","endpointUrl","API_URL","payload","client_user_id","resumable_session_id","org_id","token","extra_info","response","fetch","method","headers","body","ok","json","orgInfo","user","org_info","_orgInfo$brand_config","_orgInfo$brand_config2","_orgInfo$brand_config3","_orgInfo$brand_config4","_orgInfo$brand_config5","_orgInfo$brand_config6","_orgInfo$brand_config7","_orgInfo$brand_config8","_orgInfo$brand_config9","_orgInfo$brand_config10","_orgInfo$brand_config11","_orgInfo$brand_config12","_orgInfo$brand_config13","_orgInfo$brand_config14","_orgInfo$brand_config15","_orgInfo$brand_config16","_orgInfo$brand_config17","_orgInfo$brand_config18","_orgInfo$brand_config19","_orgInfo$brand_config20","_orgInfo$brand_config21","_orgInfo$brand_config22","_orgInfo$brand_config23","_orgInfo$brand_config24","_orgInfo$brand_config25","_orgInfo$brand_config26","_orgInfo$brand_config27","_orgInfo$brand_config28","config","brand_config","colors","launcher_logo_url","chat_interface_config","chat_bubble_prompts","display_name","welcome_message","redirect_url","interface_properties","position","RIGHT","side_spacing","bottom_spacing","interface_type","WIDGET","launcher_type","IMAGE","launcher_properties","text","launcher_image_url","DEFAULT_LAUNCHER_IMAGE","chat_iframe_url","NETWORK_ERROR","constructUrl","params","URLSearchParams","id","BASE_CHATBOT_URL","toString","animateWebViewOpen","CHATBOT_OPENED","setTimeout","requestAnimationFrame","postMessage","animateWebViewClose","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","pending","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","alreadyGranted","PermissionsAndroid","check","PERMISSIONS","RECORD_AUDIO","result","request","title","message","buttonPositive","buttonNegative","RESULTS","GRANTED","Alert","alert","err","warn","screenDimensions","enableNetworkDebug","sideSpacing","bottomSpacing","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","pointerEvents","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","webViewWrapper","fullScreenContainer","transform","WebView","mediaCapturePermissionGrantType","webviewDebuggingEnabled","uri","webview","containerStyle","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","originWhitelist","CHATBOT_ORIGIN_WHITELIST","onShouldStartLoadWithRequest","handleWebViewNavigationRequest","startInLoadingState","onLoadEnd","_webViewRef$current8","enableWebViewDebug","onError","syntheticEvent","description","code","displayName","StyleSheet","create","flex","overflow","top","left","right","bottom","zIndex","backgroundColor","inlineContainer","_default"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"6gBAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WASA,IAAAC,YAAA,CAAAD,OAAA,iBAYA,IAAAE,mBAAA,CAAAF,OAAA,yBACA,IAAAG,eAAA,CAAAC,sBAAA,CAAAJ,OAAA,sBACA,IAAAK,UAAA,CAAAL,OAAA,gBACA,IAAAM,WAAA,CAAAN,OAAA,uBACA,IAAAO,kBAAA,CAAAP,OAAA,6BACA,IAAAQ,OAAA,CAAAR,OAAA,mBAKA,IAAAS,OAAA,CAAAT,OAAA,mBACA,IAAAU,YAAA,CAAAV,OAAA,wBACA,IAAAW,YAAA,CAAAP,sBAAA,CAAAJ,OAAA,8BACA,IAAAY,cAAA,CAAAZ,OAAA,+BACA,IAAAa,eAAA,CAAAb,OAAA,+BAMA,IAAAc,qBAAA,CAAAd,OAAA,oCACA,IAAAe,YAAA,CAAAf,OAAA,wBACA,IAAAgB,eAAA,CAAAhB,OAAA,2BAMA,IAAAiB,WAAA,CAAAjB,OAAA,uBACA,IAAAkB,aAAA,CAAAlB,OAAA,yBACA,IAAAmB,kBAAA,CAAAnB,OAAA,8BAIA,IAAAoB,QAAA,CAAApB,OAAA,oBAKyB,IAAAqB,WAAA,CAAArB,OAAA,0BAAAsB,KAAA,MAAAC,YAAA,+GAAAxB,wBAAAyB,CAAA,CAAAC,CAAA,wBAAAC,OAAA,KAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAA3B,uBAAA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ACxBD,MAAM,CAAE,KAAK,CACbL,QAAQ,CAAE,SAEZ,CAAC,CACDO,eAAe,CAAE,CACfR,IAAI,CAAE,CAAC,CACPO,eAAe,CAAE,OACnB,CAAC,CACDjC,OAAO,CAAE,CACP0B,IAAI,CAAE,CAAC,CACPO,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KACV,CACF,CAAC,CAAC,CAAC,IAAAG,QAAA,CAAAla,OAAA,CAAAX,OAAA,CAEYc,OAAO","ignoreList":[]}
@@ -1,2 +1,3 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.openChatbot=void 0;var _reactNative=require("react-native");var _constants=require("./constants");var openChatbot=exports.openChatbot=function openChatbot(chatbotId){var additionalParams=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var params=new URLSearchParams(Object.assign({id:chatbotId},additionalParams));var url=`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;_reactNative.Linking.openURL(url);};
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 +1 @@
1
- {"version":3,"names":["_reactNative","require","_constants","openChatbot","exports","chatbotId","additionalParams","arguments","length","undefined","params","URLSearchParams","Object","assign","id","url","BASE_CHATBOT_URL","toString","Linking","openURL"],"sourceRoot":"../../src","sources":["openChatbot.ts"],"mappings":"oFAAA,IAAAA,YAAA,CAAAC,OAAA,iBACA,IAAAC,UAAA,CAAAD,OAAA,gBAEO,GAAM,CAAAE,WAAW,CAAAC,OAAA,CAAAD,WAAA,CAAG,QAAd,CAAAA,WAAWA,CACtBE,SAAiB,CAER,IADT,CAAAC,gBAAwC,CAAAC,SAAA,CAAAC,MAAA,IAAAD,SAAA,MAAAE,SAAA,CAAAF,SAAA,IAAG,CAAC,CAAC,CAE7C,GAAM,CAAAG,MAAM,CAAG,GAAI,CAAAC,eAAe,CAAAC,MAAA,CAAAC,MAAA,EAAGC,EAAE,CAAET,SAAS,EAAKC,gBAAgB,CAAE,CAAC,CAC1E,GAAM,CAAAS,GAAG,CAAG,GAAGC,2BAAgB,IAAIN,MAAM,CAACO,QAAQ,CAAC,CAAC,EAAE,CACtDC,oBAAO,CAACC,OAAO,CAACJ,GAAG,CAAC,CACtB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["openChatbot.tsx"],"mappings":"","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.extractSessionId=exports.SESSION_UPDATED_MESSAGE_TYPE=exports.RESUME_SESSION_KEY=void 0;var SESSION_UPDATED_MESSAGE_TYPE=exports.SESSION_UPDATED_MESSAGE_TYPE="SESSION_UPDATED";var RESUME_SESSION_KEY=exports.RESUME_SESSION_KEY="sessionId";var extractSessionId=exports.extractSessionId=function extractSessionId(data){var _ref,_data$session_id,_data$session;var raw=(_ref=(_data$session_id=data==null?void 0:data.session_id)!=null?_data$session_id:data==null?void 0:data.sessionId)!=null?_ref:data==null?void 0:(_data$session=data.session)==null?void 0:_data$session.id;return typeof raw==="string"&&raw.length>0?raw:undefined;};
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.extractSessionId=exports.SWITCH_SESSION_ACTION=exports.SESSION_UPDATED_MESSAGE_TYPE=exports.RESUME_SESSION_KEY=void 0;var SESSION_UPDATED_MESSAGE_TYPE=exports.SESSION_UPDATED_MESSAGE_TYPE="SESSION_UPDATED";var RESUME_SESSION_KEY=exports.RESUME_SESSION_KEY="sessionId";var SWITCH_SESSION_ACTION=exports.SWITCH_SESSION_ACTION="switch_session";var extractSessionId=exports.extractSessionId=function extractSessionId(data){var _ref,_data$session_id,_data$session;var raw=(_ref=(_data$session_id=data==null?void 0:data.session_id)!=null?_data$session_id:data==null?void 0:data.sessionId)!=null?_ref:data==null?void 0:(_data$session=data.session)==null?void 0:_data$session.id;return typeof raw==="string"&&raw.length>0?raw:undefined;};
2
2
  //# sourceMappingURL=session.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SESSION_UPDATED_MESSAGE_TYPE","exports","RESUME_SESSION_KEY","extractSessionId","data","_ref","_data$session_id","_data$session","raw","session_id","sessionId","session","id","length","undefined"],"sourceRoot":"../../../src","sources":["utils/session.ts"],"mappings":"yJAUO,GAAM,CAAAA,4BAA4B,CAAAC,OAAA,CAAAD,4BAAA,CAAG,iBAAiB,CAGtD,GAAM,CAAAE,kBAAkB,CAAAD,OAAA,CAAAC,kBAAA,CAAG,WAAW,CAStC,GAAM,CAAAC,gBAAgB,CAAAF,OAAA,CAAAE,gBAAA,CAAG,QAAnB,CAAAA,gBAAgBA,CAAIC,IAAS,CAAyB,KAAAC,IAAA,CAAAC,gBAAA,CAAAC,aAAA,CACjE,GAAM,CAAAC,GAAG,EAAAH,IAAA,EAAAC,gBAAA,CAAGF,IAAI,cAAJA,IAAI,CAAEK,UAAU,QAAAH,gBAAA,CAAIF,IAAI,cAAJA,IAAI,CAAEM,SAAS,QAAAL,IAAA,CAAID,IAAI,eAAAG,aAAA,CAAJH,IAAI,CAAEO,OAAO,eAAbJ,aAAA,CAAeK,EAAE,CACpE,MAAO,OAAO,CAAAJ,GAAG,GAAK,QAAQ,EAAIA,GAAG,CAACK,MAAM,CAAG,CAAC,CAAGL,GAAG,CAAGM,SAAS,CACpE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["SESSION_UPDATED_MESSAGE_TYPE","exports","RESUME_SESSION_KEY","SWITCH_SESSION_ACTION","extractSessionId","data","_ref","_data$session_id","_data$session","raw","session_id","sessionId","session","id","length","undefined"],"sourceRoot":"../../../src","sources":["utils/session.ts"],"mappings":"uLAUO,GAAM,CAAAA,4BAA4B,CAAAC,OAAA,CAAAD,4BAAA,CAAG,iBAAiB,CAGtD,GAAM,CAAAE,kBAAkB,CAAAD,OAAA,CAAAC,kBAAA,CAAG,WAAW,CAYtC,GAAM,CAAAC,qBAAqB,CAAAF,OAAA,CAAAE,qBAAA,CAAG,gBAAgB,CAS9C,GAAM,CAAAC,gBAAgB,CAAAH,OAAA,CAAAG,gBAAA,CAAG,QAAnB,CAAAA,gBAAgBA,CAAIC,IAAS,CAAyB,KAAAC,IAAA,CAAAC,gBAAA,CAAAC,aAAA,CACjE,GAAM,CAAAC,GAAG,EAAAH,IAAA,EAAAC,gBAAA,CAAGF,IAAI,cAAJA,IAAI,CAAEK,UAAU,QAAAH,gBAAA,CAAIF,IAAI,cAAJA,IAAI,CAAEM,SAAS,QAAAL,IAAA,CAAID,IAAI,eAAAG,aAAA,CAAJH,IAAI,CAAEO,OAAO,eAAbJ,aAAA,CAAeK,EAAE,CACpE,MAAO,OAAO,CAAAJ,GAAG,GAAK,QAAQ,EAAIA,GAAG,CAACK,MAAM,CAAG,CAAC,CAAGL,GAAG,CAAGM,SAAS,CACpE,CAAC","ignoreList":[]}