@botonic/react 0.31.0-alpha.1 → 0.31.0-alpha.3
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/cjs/components/element.js +6 -6
- package/lib/cjs/components/element.js.map +1 -1
- package/lib/cjs/components/index-types.d.ts +2 -0
- package/lib/cjs/components/multichannel/multichannel-button.js +2 -2
- package/lib/cjs/components/multichannel/multichannel-button.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel-carousel.js +4 -4
- package/lib/cjs/components/multichannel/multichannel-carousel.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel-text.js +12 -11
- package/lib/cjs/components/multichannel/multichannel-text.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel-utils.d.ts +9 -15
- package/lib/cjs/components/multichannel/multichannel-utils.js +48 -27
- package/lib/cjs/components/multichannel/multichannel-utils.js.map +1 -1
- package/lib/cjs/components/multichannel/multichannel.js +7 -7
- package/lib/cjs/components/multichannel/multichannel.js.map +1 -1
- package/lib/cjs/components/multichannel/whatsapp/constants.d.ts +11 -0
- package/lib/cjs/components/multichannel/whatsapp/constants.js +13 -0
- package/lib/cjs/components/multichannel/whatsapp/constants.js.map +1 -0
- package/lib/cjs/components/whatsapp-button-list.js +2 -2
- package/lib/cjs/components/whatsapp-button-list.js.map +1 -1
- package/lib/cjs/components/whatsapp-cta-url-button.js +5 -5
- package/lib/cjs/components/whatsapp-cta-url-button.js.map +1 -1
- package/lib/cjs/constants.d.ts +0 -6
- package/lib/cjs/constants.js +1 -7
- package/lib/cjs/constants.js.map +1 -1
- package/lib/cjs/contexts.js +6 -0
- package/lib/cjs/contexts.js.map +1 -1
- package/lib/cjs/dev-app.d.ts +7 -0
- package/lib/cjs/dev-app.js +5 -2
- package/lib/cjs/dev-app.js.map +1 -1
- package/lib/cjs/index-types.d.ts +4 -7
- package/lib/cjs/index-types.js.map +1 -1
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/webchat/actions.d.ts +2 -1
- package/lib/cjs/webchat/actions.js +1 -0
- package/lib/cjs/webchat/actions.js.map +1 -1
- package/lib/cjs/webchat/cover-component/index.d.ts +6 -0
- package/lib/cjs/webchat/cover-component/index.js +21 -0
- package/lib/cjs/webchat/cover-component/index.js.map +1 -0
- package/lib/cjs/webchat/hooks/use-scroll-to-bottom.d.ts +6 -4
- package/lib/cjs/webchat/hooks/use-scroll-to-bottom.js.map +1 -1
- package/lib/cjs/webchat/hooks/use-webchat.d.ts +1 -0
- package/lib/cjs/webchat/hooks/use-webchat.js +8 -0
- package/lib/cjs/webchat/hooks/use-webchat.js.map +1 -1
- package/lib/cjs/webchat/index-types.d.ts +1 -0
- package/lib/cjs/webchat/input-panel/textarea.js +8 -2
- package/lib/cjs/webchat/input-panel/textarea.js.map +1 -1
- package/lib/cjs/webchat/message-list/index.js +63 -35
- package/lib/cjs/webchat/message-list/index.js.map +1 -1
- package/lib/cjs/webchat/message-list/styles.js +3 -3
- package/lib/cjs/webchat/typing-indicator/index.d.ts +3 -1
- package/lib/cjs/webchat/typing-indicator/index.js +4 -3
- package/lib/cjs/webchat/typing-indicator/index.js.map +1 -1
- package/lib/cjs/webchat/typing-indicator/styles.d.ts +3 -2
- package/lib/cjs/webchat/typing-indicator/styles.js +6 -3
- package/lib/cjs/webchat/typing-indicator/styles.js.map +1 -1
- package/lib/cjs/webchat/webchat-reducer.js +2 -0
- package/lib/cjs/webchat/webchat-reducer.js.map +1 -1
- package/lib/cjs/webchat/webchat-typed/styles.d.ts +7 -0
- package/lib/cjs/webchat/webchat-typed/styles.js +54 -0
- package/lib/cjs/webchat/webchat-typed/styles.js.map +1 -0
- package/lib/cjs/webchat/webchat-typed/webchat-typed.d.ts +0 -0
- package/lib/cjs/webchat/webchat-typed/webchat-typed.js +663 -0
- package/lib/cjs/webchat/webchat-typed/webchat-typed.js.map +1 -0
- package/lib/cjs/webchat/webchat.js +16 -18
- package/lib/cjs/webchat/webchat.js.map +1 -1
- package/lib/cjs/webchat-app.d.ts +119 -72
- package/lib/cjs/webchat-app.js +98 -53
- package/lib/cjs/webchat-app.js.map +1 -1
- package/lib/cjs/webview-app.js +5 -2
- package/lib/cjs/webview-app.js.map +1 -1
- package/lib/esm/components/element.js +6 -6
- package/lib/esm/components/element.js.map +1 -1
- package/lib/esm/components/index-types.d.ts +2 -0
- package/lib/esm/components/multichannel/multichannel-button.js +1 -1
- package/lib/esm/components/multichannel/multichannel-carousel.js +5 -5
- package/lib/esm/components/multichannel/multichannel-carousel.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel-text.js +2 -1
- package/lib/esm/components/multichannel/multichannel-text.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel-utils.d.ts +9 -15
- package/lib/esm/components/multichannel/multichannel-utils.js +40 -24
- package/lib/esm/components/multichannel/multichannel-utils.js.map +1 -1
- package/lib/esm/components/multichannel/multichannel.js +7 -7
- package/lib/esm/components/multichannel/multichannel.js.map +1 -1
- package/lib/esm/components/multichannel/whatsapp/constants.d.ts +11 -0
- package/lib/esm/components/multichannel/whatsapp/constants.js +10 -0
- package/lib/esm/components/multichannel/whatsapp/constants.js.map +1 -0
- package/lib/esm/components/whatsapp-button-list.js +1 -1
- package/lib/esm/components/whatsapp-cta-url-button.js +1 -1
- package/lib/esm/constants.d.ts +0 -6
- package/lib/esm/constants.js +0 -6
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/contexts.js +6 -0
- package/lib/esm/contexts.js.map +1 -1
- package/lib/esm/dev-app.d.ts +7 -0
- package/lib/esm/dev-app.js +5 -2
- package/lib/esm/dev-app.js.map +1 -1
- package/lib/esm/index-types.d.ts +4 -7
- package/lib/esm/index-types.js.map +1 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/webchat/actions.d.ts +2 -1
- package/lib/esm/webchat/actions.js +1 -0
- package/lib/esm/webchat/actions.js.map +1 -1
- package/lib/esm/webchat/cover-component/index.d.ts +6 -0
- package/lib/esm/webchat/cover-component/index.js +17 -0
- package/lib/esm/webchat/cover-component/index.js.map +1 -0
- package/lib/esm/webchat/hooks/use-scroll-to-bottom.d.ts +6 -4
- package/lib/esm/webchat/hooks/use-scroll-to-bottom.js.map +1 -1
- package/lib/esm/webchat/hooks/use-webchat.d.ts +1 -0
- package/lib/esm/webchat/hooks/use-webchat.js +8 -0
- package/lib/esm/webchat/hooks/use-webchat.js.map +1 -1
- package/lib/esm/webchat/index-types.d.ts +1 -0
- package/lib/esm/webchat/input-panel/textarea.js +8 -2
- package/lib/esm/webchat/input-panel/textarea.js.map +1 -1
- package/lib/esm/webchat/message-list/index.js +62 -35
- package/lib/esm/webchat/message-list/index.js.map +1 -1
- package/lib/esm/webchat/message-list/styles.js +3 -3
- package/lib/esm/webchat/typing-indicator/index.d.ts +3 -1
- package/lib/esm/webchat/typing-indicator/index.js +5 -2
- package/lib/esm/webchat/typing-indicator/index.js.map +1 -1
- package/lib/esm/webchat/typing-indicator/styles.d.ts +3 -2
- package/lib/esm/webchat/typing-indicator/styles.js +5 -2
- package/lib/esm/webchat/typing-indicator/styles.js.map +1 -1
- package/lib/esm/webchat/webchat-reducer.js +2 -0
- package/lib/esm/webchat/webchat-reducer.js.map +1 -1
- package/lib/esm/webchat/webchat-typed/styles.d.ts +7 -0
- package/lib/esm/webchat/webchat-typed/styles.js +50 -0
- package/lib/esm/webchat/webchat-typed/styles.js.map +1 -0
- package/lib/esm/webchat/webchat-typed/webchat-typed.d.ts +0 -0
- package/lib/esm/webchat/webchat-typed/webchat-typed.js +663 -0
- package/lib/esm/webchat/webchat-typed/webchat-typed.js.map +1 -0
- package/lib/esm/webchat/webchat.js +16 -18
- package/lib/esm/webchat/webchat.js.map +1 -1
- package/lib/esm/webchat-app.d.ts +119 -72
- package/lib/esm/webchat-app.js +99 -54
- package/lib/esm/webchat-app.js.map +1 -1
- package/lib/esm/webview-app.js +5 -2
- package/lib/esm/webview-app.js.map +1 -1
- package/package.json +3 -2
- package/src/components/element.jsx +4 -11
- package/src/components/index-types.ts +4 -0
- package/src/components/multichannel/multichannel-button.jsx +1 -1
- package/src/components/multichannel/multichannel-carousel.jsx +7 -5
- package/src/components/multichannel/multichannel-text.jsx +4 -2
- package/src/components/multichannel/multichannel-utils.js +45 -27
- package/src/components/multichannel/multichannel.jsx +12 -7
- package/src/components/multichannel/whatsapp/constants.ts +10 -0
- package/src/components/whatsapp-button-list.tsx +1 -1
- package/src/components/whatsapp-cta-url-button.tsx +1 -1
- package/src/constants.js +0 -7
- package/src/contexts.tsx +6 -0
- package/src/dev-app.jsx +5 -5
- package/src/index-types.ts +4 -7
- package/src/index.ts +1 -1
- package/src/webchat/actions.ts +1 -0
- package/src/webchat/cover-component/index.tsx +31 -0
- package/src/webchat/hooks/use-scroll-to-bottom.ts +8 -2
- package/src/webchat/hooks/use-webchat.ts +9 -0
- package/src/webchat/index-types.ts +1 -0
- package/src/webchat/input-panel/textarea.tsx +12 -1
- package/src/webchat/message-list/index.tsx +79 -48
- package/src/webchat/message-list/styles.ts +3 -3
- package/src/webchat/typing-indicator/index.tsx +20 -12
- package/src/webchat/typing-indicator/styles.ts +7 -3
- package/src/webchat/webchat-reducer.ts +2 -0
- package/src/webchat/webchat-typed/styles.ts +54 -0
- package/src/webchat/webchat-typed/webchat-typed.tsx +728 -0
- package/src/webchat/webchat.jsx +48 -48
- package/src/webchat-app.tsx +546 -0
- package/src/webview-app.tsx +6 -4
- package/src/webchat-app.jsx +0 -389
|
@@ -0,0 +1,663 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import {
|
|
3
|
+
// BotonicAction,
|
|
4
|
+
// INPUT,
|
|
5
|
+
// isMobile,
|
|
6
|
+
// params2queryString,
|
|
7
|
+
// } from '@botonic/core'
|
|
8
|
+
// import merge from 'lodash.merge'
|
|
9
|
+
// import React, {
|
|
10
|
+
// forwardRef,
|
|
11
|
+
// useEffect,
|
|
12
|
+
// useImperativeHandle,
|
|
13
|
+
// useRef,
|
|
14
|
+
// useState,
|
|
15
|
+
// } from 'react'
|
|
16
|
+
// import { StyleSheetManager } from 'styled-components'
|
|
17
|
+
// import { v7 as uuidv7 } from 'uuid'
|
|
18
|
+
// import { Audio, Document, Image, Text, Video } from '../../components'
|
|
19
|
+
// import { Handoff } from '../../components/handoff'
|
|
20
|
+
// import { normalizeWebchatSettings } from '../../components/webchat-settings'
|
|
21
|
+
// import { COLORS, MAX_ALLOWED_SIZE_MB, ROLES, WEBCHAT } from '../../constants'
|
|
22
|
+
// import { WebchatContext, WebviewRequestContext } from '../../contexts'
|
|
23
|
+
// import { SENDERS } from '../../index-types'
|
|
24
|
+
// import {
|
|
25
|
+
// getMediaType,
|
|
26
|
+
// isAllowedSize,
|
|
27
|
+
// isAudio,
|
|
28
|
+
// isDocument,
|
|
29
|
+
// isImage,
|
|
30
|
+
// isMedia,
|
|
31
|
+
// isText,
|
|
32
|
+
// isVideo,
|
|
33
|
+
// readDataURL,
|
|
34
|
+
// } from '../../message-utils'
|
|
35
|
+
// import { msgToBotonic } from '../../msg-to-botonic'
|
|
36
|
+
// import { isDev } from '../../util/environment'
|
|
37
|
+
// import { deserializeRegex, stringifyWithRegexs } from '../../util/regexs'
|
|
38
|
+
// import {
|
|
39
|
+
// _getThemeProperty,
|
|
40
|
+
// getServerErrorMessage,
|
|
41
|
+
// initSession,
|
|
42
|
+
// shouldKeepSessionOnReload,
|
|
43
|
+
// } from '../../util/webchat'
|
|
44
|
+
// import { ChatArea } from '../chat-area'
|
|
45
|
+
// import { OpenedPersistentMenu } from '../components/opened-persistent-menu'
|
|
46
|
+
// import { BotonicContainerId } from '../constants'
|
|
47
|
+
// import { CoverComponent } from '../cover-component'
|
|
48
|
+
// import { WebchatHeader } from '../header'
|
|
49
|
+
// import {
|
|
50
|
+
// useComponentWillMount,
|
|
51
|
+
// usePrevious,
|
|
52
|
+
// useScrollToBottom,
|
|
53
|
+
// useTyping,
|
|
54
|
+
// useWebchat,
|
|
55
|
+
// } from '../hooks'
|
|
56
|
+
// import { InputPanel } from '../input-panel'
|
|
57
|
+
// import { TriggerButton } from '../trigger-button'
|
|
58
|
+
// import { useStorageState } from '../use-storage-state-hook'
|
|
59
|
+
// import { getParsedAction } from '../utils'
|
|
60
|
+
// import { WebviewContainer } from '../webview'
|
|
61
|
+
// import {
|
|
62
|
+
// DarkBackgroundMenu,
|
|
63
|
+
// ErrorMessage,
|
|
64
|
+
// ErrorMessageContainer,
|
|
65
|
+
// StyledWebchat,
|
|
66
|
+
// } from './styles'
|
|
67
|
+
// // eslint-disable-next-line complexity, react/display-name
|
|
68
|
+
// export const WebchatTyped = forwardRef((props: WebchatTypeProps, ref) => {
|
|
69
|
+
// const {
|
|
70
|
+
// addMessage,
|
|
71
|
+
// addMessageComponent,
|
|
72
|
+
// clearMessages,
|
|
73
|
+
// doRenderCustomComponent,
|
|
74
|
+
// openWebviewT,
|
|
75
|
+
// resetUnreadMessages,
|
|
76
|
+
// setCurrentAttachment,
|
|
77
|
+
// setError,
|
|
78
|
+
// setLastMessageVisible,
|
|
79
|
+
// setOnline,
|
|
80
|
+
// toggleCoverComponent,
|
|
81
|
+
// toggleEmojiPicker,
|
|
82
|
+
// togglePersistentMenu,
|
|
83
|
+
// toggleWebchat,
|
|
84
|
+
// updateDevSettings,
|
|
85
|
+
// updateHandoff,
|
|
86
|
+
// updateLastMessageDate,
|
|
87
|
+
// updateLastRoutePath,
|
|
88
|
+
// updateLatestInput,
|
|
89
|
+
// updateMessage,
|
|
90
|
+
// updateReplies,
|
|
91
|
+
// updateSession,
|
|
92
|
+
// updateTheme,
|
|
93
|
+
// updateTyping,
|
|
94
|
+
// updateWebview,
|
|
95
|
+
// webchatState,
|
|
96
|
+
// webchatRef,
|
|
97
|
+
// chatAreaRef,
|
|
98
|
+
// inputPanelRef,
|
|
99
|
+
// headerRef,
|
|
100
|
+
// scrollableMessagesListRef,
|
|
101
|
+
// // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
102
|
+
// } = props.webchatHooks || useWebchat()
|
|
103
|
+
// const firstUpdate = useRef(true)
|
|
104
|
+
// const isOnline = () => webchatState.online
|
|
105
|
+
// const currentDateString = () => new Date().toISOString()
|
|
106
|
+
// const theme = merge(webchatState.theme, props.theme)
|
|
107
|
+
// const { initialSession, initialDevSettings, onStateChange } = props
|
|
108
|
+
// const getThemeProperty = _getThemeProperty(theme)
|
|
109
|
+
// const [customComponent, setCustomComponent] = useState(null)
|
|
110
|
+
// const storage = props.storage
|
|
111
|
+
// const storageKey =
|
|
112
|
+
// typeof props.storageKey === 'function'
|
|
113
|
+
// ? props.storageKey()
|
|
114
|
+
// : props.storageKey
|
|
115
|
+
// const [botonicState, saveState] = useStorageState(storage, storageKey)
|
|
116
|
+
// const host = props.host || document.body
|
|
117
|
+
// const { scrollToBottom } = useScrollToBottom({ host })
|
|
118
|
+
// const saveWebchatState = webchatState => {
|
|
119
|
+
// storage &&
|
|
120
|
+
// saveState(
|
|
121
|
+
// JSON.parse(
|
|
122
|
+
// stringifyWithRegexs({
|
|
123
|
+
// messages: webchatState.messagesJSON,
|
|
124
|
+
// session: webchatState.session,
|
|
125
|
+
// lastRoutePath: webchatState.lastRoutePath,
|
|
126
|
+
// devSettings: webchatState.devSettings,
|
|
127
|
+
// lastMessageUpdate: webchatState.lastMessageUpdate,
|
|
128
|
+
// themeUpdates: webchatState.themeUpdates,
|
|
129
|
+
// })
|
|
130
|
+
// )
|
|
131
|
+
// )
|
|
132
|
+
// }
|
|
133
|
+
// const handleAttachment = event => {
|
|
134
|
+
// if (!isAllowedSize(event.target.files[0].size)) {
|
|
135
|
+
// throw new Error(
|
|
136
|
+
// `The file is too large. A maximum of ${MAX_ALLOWED_SIZE_MB}MB is allowed.`
|
|
137
|
+
// )
|
|
138
|
+
// }
|
|
139
|
+
// setCurrentAttachment({
|
|
140
|
+
// fileName: event.target.files[0].name,
|
|
141
|
+
// file: event.target.files[0], // TODO: Attach more files?
|
|
142
|
+
// attachmentType: getMediaType(event.target.files[0].type),
|
|
143
|
+
// })
|
|
144
|
+
// }
|
|
145
|
+
// useEffect(() => {
|
|
146
|
+
// if (webchatState.currentAttachment)
|
|
147
|
+
// sendAttachment(webchatState.currentAttachment)
|
|
148
|
+
// }, [webchatState.currentAttachment])
|
|
149
|
+
// const sendUserInput = async input => {
|
|
150
|
+
// if (props.onUserInput) {
|
|
151
|
+
// resetUnreadMessages()
|
|
152
|
+
// scrollToBottom()
|
|
153
|
+
// props.onUserInput({
|
|
154
|
+
// user: webchatState.session.user,
|
|
155
|
+
// input: input,
|
|
156
|
+
// session: webchatState.session,
|
|
157
|
+
// lastRoutePath: webchatState.lastRoutePath,
|
|
158
|
+
// })
|
|
159
|
+
// }
|
|
160
|
+
// }
|
|
161
|
+
// // Load styles stored in window._botonicInsertStyles by Webpack
|
|
162
|
+
// useComponentWillMount(() => {
|
|
163
|
+
// if (window._botonicInsertStyles && window._botonicInsertStyles.length) {
|
|
164
|
+
// for (const botonicStyle of window._botonicInsertStyles) {
|
|
165
|
+
// // Injecting styles at head is needed even if we use shadowDOM
|
|
166
|
+
// // as some dependencies like simplebar rely on creating ephemeral elements
|
|
167
|
+
// // on document.body and assume styles will be available globally
|
|
168
|
+
// document.head.appendChild(botonicStyle)
|
|
169
|
+
// // injecting styles in host node too so that shadowDOM works
|
|
170
|
+
// if (props.shadowDOM) host.appendChild(botonicStyle.cloneNode(true))
|
|
171
|
+
// }
|
|
172
|
+
// delete window._botonicInsertStyles
|
|
173
|
+
// }
|
|
174
|
+
// if (props.shadowDOM) {
|
|
175
|
+
// // emoji-picker-react injects styles in head, so we need to
|
|
176
|
+
// // re-inject them in our host node to make it work with shadowDOM
|
|
177
|
+
// for (const style of document.querySelectorAll('style')) {
|
|
178
|
+
// if (
|
|
179
|
+
// style.textContent &&
|
|
180
|
+
// style.textContent.includes('emoji-picker-react')
|
|
181
|
+
// )
|
|
182
|
+
// host.appendChild(style.cloneNode(true))
|
|
183
|
+
// }
|
|
184
|
+
// }
|
|
185
|
+
// })
|
|
186
|
+
// // Load initial state from storage
|
|
187
|
+
// useEffect(() => {
|
|
188
|
+
// let {
|
|
189
|
+
// messages,
|
|
190
|
+
// session,
|
|
191
|
+
// lastRoutePath,
|
|
192
|
+
// devSettings,
|
|
193
|
+
// lastMessageUpdate,
|
|
194
|
+
// themeUpdates,
|
|
195
|
+
// } = botonicState || {}
|
|
196
|
+
// session = initSession(session)
|
|
197
|
+
// updateSession(session)
|
|
198
|
+
// if (shouldKeepSessionOnReload({ initialDevSettings, devSettings })) {
|
|
199
|
+
// if (messages) {
|
|
200
|
+
// messages.forEach(message => {
|
|
201
|
+
// addMessage(message)
|
|
202
|
+
// const newMessageComponent = msgToBotonic(
|
|
203
|
+
// { ...message, delay: 0, typing: 0 },
|
|
204
|
+
// (props.theme.message && props.theme.message.customTypes) ||
|
|
205
|
+
// props.theme.customMessageTypes
|
|
206
|
+
// )
|
|
207
|
+
// if (newMessageComponent) addMessageComponent(newMessageComponent)
|
|
208
|
+
// })
|
|
209
|
+
// }
|
|
210
|
+
// if (initialSession) updateSession(merge(initialSession, session))
|
|
211
|
+
// if (lastRoutePath) updateLastRoutePath(lastRoutePath)
|
|
212
|
+
// } else updateSession(merge(initialSession, session))
|
|
213
|
+
// if (devSettings) updateDevSettings(devSettings)
|
|
214
|
+
// else if (initialDevSettings) updateDevSettings(initialDevSettings)
|
|
215
|
+
// if (lastMessageUpdate) updateLastMessageDate(lastMessageUpdate)
|
|
216
|
+
// if (themeUpdates !== undefined)
|
|
217
|
+
// updateTheme(merge(props.theme, themeUpdates), themeUpdates)
|
|
218
|
+
// if (props.onInit) setTimeout(() => props.onInit(), 100)
|
|
219
|
+
// }, [])
|
|
220
|
+
// useEffect(() => {
|
|
221
|
+
// if (!webchatState.isWebchatOpen) {
|
|
222
|
+
// if (webchatState.isLastMessageVisible) {
|
|
223
|
+
// resetUnreadMessages()
|
|
224
|
+
// }
|
|
225
|
+
// return
|
|
226
|
+
// }
|
|
227
|
+
// }, [webchatState.isWebchatOpen])
|
|
228
|
+
// useEffect(() => {
|
|
229
|
+
// if (onStateChange && typeof onStateChange === 'function') {
|
|
230
|
+
// onStateChange(webchatState)
|
|
231
|
+
// }
|
|
232
|
+
// saveWebchatState(webchatState)
|
|
233
|
+
// }, [
|
|
234
|
+
// webchatState.messagesJSON,
|
|
235
|
+
// webchatState.session,
|
|
236
|
+
// webchatState.lastRoutePath,
|
|
237
|
+
// webchatState.devSettings,
|
|
238
|
+
// webchatState.lastMessageUpdate,
|
|
239
|
+
// ])
|
|
240
|
+
// useEffect(() => {
|
|
241
|
+
// if (!webchatState.online) {
|
|
242
|
+
// setError({
|
|
243
|
+
// message: getServerErrorMessage(props.server),
|
|
244
|
+
// })
|
|
245
|
+
// } else {
|
|
246
|
+
// if (!firstUpdate.current) {
|
|
247
|
+
// setError(undefined)
|
|
248
|
+
// }
|
|
249
|
+
// }
|
|
250
|
+
// }, [webchatState.online])
|
|
251
|
+
// useTyping({ webchatState, updateTyping, updateMessage, host })
|
|
252
|
+
// useEffect(() => {
|
|
253
|
+
// updateTheme(merge(props.theme, theme, webchatState.themeUpdates))
|
|
254
|
+
// }, [props.theme, webchatState.themeUpdates])
|
|
255
|
+
// const openWebview = (webviewComponent, params) => {
|
|
256
|
+
// updateWebview(webviewComponent, params)
|
|
257
|
+
// }
|
|
258
|
+
// const textareaRef = useRef(null)
|
|
259
|
+
// const closeWebview = async options => {
|
|
260
|
+
// updateWebview()
|
|
261
|
+
// if (userInputEnabled) {
|
|
262
|
+
// textareaRef.current.focus()
|
|
263
|
+
// }
|
|
264
|
+
// if (options?.payload) {
|
|
265
|
+
// await sendPayload(options.payload)
|
|
266
|
+
// } else if (options?.path) {
|
|
267
|
+
// const params = options.params ? params2queryString(options.params) : ''
|
|
268
|
+
// await sendPayload(`__PATH_PAYLOAD__${options.path}?${params}`)
|
|
269
|
+
// }
|
|
270
|
+
// }
|
|
271
|
+
// const persistentMenuOptions = getThemeProperty(
|
|
272
|
+
// WEBCHAT.CUSTOM_PROPERTIES.persistentMenu,
|
|
273
|
+
// props.persistentMenu
|
|
274
|
+
// )
|
|
275
|
+
// const darkBackgroundMenu = getThemeProperty(
|
|
276
|
+
// WEBCHAT.CUSTOM_PROPERTIES.darkBackgroundMenu
|
|
277
|
+
// )
|
|
278
|
+
// const getBlockInputs = (rule, inputData) => {
|
|
279
|
+
// const processedInput = rule.preprocess
|
|
280
|
+
// ? rule.preprocess(inputData)
|
|
281
|
+
// : inputData
|
|
282
|
+
// return rule.match.some(regex => {
|
|
283
|
+
// if (typeof regex === 'string') regex = deserializeRegex(regex)
|
|
284
|
+
// return regex.test(processedInput)
|
|
285
|
+
// })
|
|
286
|
+
// }
|
|
287
|
+
// const checkBlockInput = input => {
|
|
288
|
+
// // if is a text we check if it is a serialized RE
|
|
289
|
+
// const blockInputs = getThemeProperty(
|
|
290
|
+
// WEBCHAT.CUSTOM_PROPERTIES.blockInputs,
|
|
291
|
+
// props.blockInputs
|
|
292
|
+
// )
|
|
293
|
+
// if (!Array.isArray(blockInputs)) return false
|
|
294
|
+
// for (const rule of blockInputs) {
|
|
295
|
+
// if (getBlockInputs(rule, input.data)) {
|
|
296
|
+
// addMessageComponent(
|
|
297
|
+
// <Text
|
|
298
|
+
// sentBy={SENDERS.user}
|
|
299
|
+
// blob={false}
|
|
300
|
+
// style={{
|
|
301
|
+
// backgroundColor: COLORS.SCORPION_GRAY,
|
|
302
|
+
// borderColor: COLORS.SCORPION_GRAY,
|
|
303
|
+
// padding: '8px 12px',
|
|
304
|
+
// }}
|
|
305
|
+
// >
|
|
306
|
+
// {rule.message}
|
|
307
|
+
// </Text>
|
|
308
|
+
// )
|
|
309
|
+
// updateReplies(false)
|
|
310
|
+
// return true
|
|
311
|
+
// }
|
|
312
|
+
// }
|
|
313
|
+
// return false
|
|
314
|
+
// }
|
|
315
|
+
// const closeMenu = () => {
|
|
316
|
+
// togglePersistentMenu(false)
|
|
317
|
+
// }
|
|
318
|
+
// const persistentMenu = () => {
|
|
319
|
+
// return (
|
|
320
|
+
// <OpenedPersistentMenu
|
|
321
|
+
// onClick={closeMenu}
|
|
322
|
+
// options={persistentMenuOptions}
|
|
323
|
+
// borderRadius={webchatState.theme.style.borderRadius || '10px'}
|
|
324
|
+
// />
|
|
325
|
+
// )
|
|
326
|
+
// }
|
|
327
|
+
// const getCoverComponent = () => {
|
|
328
|
+
// return getThemeProperty(
|
|
329
|
+
// WEBCHAT.CUSTOM_PROPERTIES.coverComponent,
|
|
330
|
+
// props.coverComponent &&
|
|
331
|
+
// (props.coverComponent.component || props.coverComponent)
|
|
332
|
+
// )
|
|
333
|
+
// }
|
|
334
|
+
// const coverComponent = getCoverComponent()
|
|
335
|
+
// const coverComponentProps = props.coverComponent?.props
|
|
336
|
+
// useEffect(() => {
|
|
337
|
+
// if (!coverComponent) return
|
|
338
|
+
// if (
|
|
339
|
+
// !botonicState ||
|
|
340
|
+
// (botonicState.messages && botonicState.messages.length === 0)
|
|
341
|
+
// )
|
|
342
|
+
// toggleCoverComponent(true)
|
|
343
|
+
// }, [])
|
|
344
|
+
// const messageComponentFromInput = input => {
|
|
345
|
+
// let messageComponent: any = null
|
|
346
|
+
// if (isText(input)) {
|
|
347
|
+
// messageComponent = <Text sentBy={SENDERS.user}>{input.data}</Text>
|
|
348
|
+
// } else if (isMedia(input)) {
|
|
349
|
+
// const temporaryDisplayUrl = URL.createObjectURL(input.data)
|
|
350
|
+
// const mediaProps = {
|
|
351
|
+
// id: input.id,
|
|
352
|
+
// sentBy: SENDERS.user,
|
|
353
|
+
// src: temporaryDisplayUrl,
|
|
354
|
+
// }
|
|
355
|
+
// if (isImage(input)) {
|
|
356
|
+
// mediaProps.input = input
|
|
357
|
+
// messageComponent = <Image {...mediaProps} />
|
|
358
|
+
// } else if (isAudio(input)) messageComponent = <Audio {...mediaProps} />
|
|
359
|
+
// else if (isVideo(input)) messageComponent = <Video {...mediaProps} />
|
|
360
|
+
// else if (isDocument(input))
|
|
361
|
+
// messageComponent = <Document {...mediaProps} />
|
|
362
|
+
// }
|
|
363
|
+
// return messageComponent
|
|
364
|
+
// }
|
|
365
|
+
// const sendInput = async input => {
|
|
366
|
+
// if (!input || Object.keys(input).length == 0) return
|
|
367
|
+
// if (isText(input) && (!input.data || !input.data.trim())) return // in case trim() doesn't work in a browser we can use !/\S/.test(input.data)
|
|
368
|
+
// if (isText(input) && checkBlockInput(input)) return
|
|
369
|
+
// if (!input.id) input.id = uuidv7()
|
|
370
|
+
// const messageComponent = messageComponentFromInput(input)
|
|
371
|
+
// if (messageComponent) addMessageComponent(messageComponent)
|
|
372
|
+
// if (isMedia(input)) input.data = await readDataURL(input.data)
|
|
373
|
+
// sendUserInput(input)
|
|
374
|
+
// updateLatestInput(input)
|
|
375
|
+
// isOnline() && updateLastMessageDate(currentDateString())
|
|
376
|
+
// updateReplies(false)
|
|
377
|
+
// togglePersistentMenu(false)
|
|
378
|
+
// toggleEmojiPicker(false)
|
|
379
|
+
// }
|
|
380
|
+
// /* This is the public API this component exposes to its parents
|
|
381
|
+
// https://stackoverflow.com/questions/37949981/call-child-method-from-parent
|
|
382
|
+
// */
|
|
383
|
+
// const updateSessionWithUser = userToUpdate =>
|
|
384
|
+
// updateSession(merge(webchatState.session, { user: userToUpdate }))
|
|
385
|
+
// useImperativeHandle(ref, () => ({
|
|
386
|
+
// addBotResponse: ({ response, session, lastRoutePath }) => {
|
|
387
|
+
// updateTyping(false)
|
|
388
|
+
// const isUnread =
|
|
389
|
+
// !webchatState.isLastMessageVisible || webchatState.numUnreadMessages > 0
|
|
390
|
+
// if (Array.isArray(response)) {
|
|
391
|
+
// response.forEach(r => {
|
|
392
|
+
// addMessageComponent({ ...r, props: { ...r.props, isUnread } })
|
|
393
|
+
// })
|
|
394
|
+
// } else if (response) {
|
|
395
|
+
// addMessageComponent({
|
|
396
|
+
// ...response,
|
|
397
|
+
// props: { ...response.props, isUnread },
|
|
398
|
+
// })
|
|
399
|
+
// }
|
|
400
|
+
// if (session) {
|
|
401
|
+
// updateSession(merge(session, { user: webchatState.session.user }))
|
|
402
|
+
// const action = session._botonic_action || ''
|
|
403
|
+
// const handoff = action.startsWith(BotonicAction.CreateCase)
|
|
404
|
+
// if (handoff && isDev) addMessageComponent(<Handoff />)
|
|
405
|
+
// updateHandoff(handoff)
|
|
406
|
+
// }
|
|
407
|
+
// if (lastRoutePath) updateLastRoutePath(lastRoutePath)
|
|
408
|
+
// updateLastMessageDate(currentDateString())
|
|
409
|
+
// },
|
|
410
|
+
// setTyping: typing => updateTyping(typing),
|
|
411
|
+
// addUserMessage: message => sendInput(message),
|
|
412
|
+
// updateUser: updateSessionWithUser,
|
|
413
|
+
// openWebchat: () => toggleWebchat(true),
|
|
414
|
+
// closeWebchat: () => toggleWebchat(false),
|
|
415
|
+
// toggleWebchat: () => toggleWebchat(!webchatState.isWebchatOpen),
|
|
416
|
+
// openCoverComponent: () => toggleCoverComponent(true),
|
|
417
|
+
// closeCoverComponent: () => toggleCoverComponent(false),
|
|
418
|
+
// renderCustomComponent: _customComponent => {
|
|
419
|
+
// setCustomComponent(_customComponent)
|
|
420
|
+
// doRenderCustomComponent(true)
|
|
421
|
+
// },
|
|
422
|
+
// unmountCustomComponent: () => doRenderCustomComponent(false),
|
|
423
|
+
// toggleCoverComponent: () =>
|
|
424
|
+
// toggleCoverComponent(!webchatState.isCoverComponentOpen),
|
|
425
|
+
// openWebviewApi: component => openWebviewT(component),
|
|
426
|
+
// setError,
|
|
427
|
+
// setOnline,
|
|
428
|
+
// getMessages: () => webchatState.messagesJSON,
|
|
429
|
+
// isOnline,
|
|
430
|
+
// clearMessages: () => {
|
|
431
|
+
// clearMessages()
|
|
432
|
+
// updateReplies(false)
|
|
433
|
+
// },
|
|
434
|
+
// getLastMessageUpdate: () => webchatState.lastMessageUpdate,
|
|
435
|
+
// updateMessageInfo: (msgId, messageInfo) => {
|
|
436
|
+
// const messageToUpdate = webchatState.messagesJSON.filter(
|
|
437
|
+
// m => m.id == msgId
|
|
438
|
+
// )[0]
|
|
439
|
+
// const updatedMsg = merge(messageToUpdate, messageInfo)
|
|
440
|
+
// if (updatedMsg.ack === 1) delete updatedMsg.unsentInput
|
|
441
|
+
// updateMessage(updatedMsg)
|
|
442
|
+
// },
|
|
443
|
+
// updateWebchatSettings: settings => {
|
|
444
|
+
// if (settings.user) {
|
|
445
|
+
// updateSessionWithUser(settings.user)
|
|
446
|
+
// }
|
|
447
|
+
// const themeUpdates = normalizeWebchatSettings(settings)
|
|
448
|
+
// updateTheme(merge(webchatState.theme, themeUpdates), themeUpdates)
|
|
449
|
+
// updateTyping(false)
|
|
450
|
+
// },
|
|
451
|
+
// closeWebview: closeWebview,
|
|
452
|
+
// }))
|
|
453
|
+
// const resolveCase = () => {
|
|
454
|
+
// updateHandoff(false)
|
|
455
|
+
// updateSession({ ...webchatState.session, _botonic_action: null })
|
|
456
|
+
// }
|
|
457
|
+
// const prevSession = usePrevious(webchatState.session)
|
|
458
|
+
// useEffect(() => {
|
|
459
|
+
// // Resume conversation after handoff
|
|
460
|
+
// if (
|
|
461
|
+
// prevSession &&
|
|
462
|
+
// prevSession._botonic_action &&
|
|
463
|
+
// !webchatState.session._botonic_action
|
|
464
|
+
// ) {
|
|
465
|
+
// const action = getParsedAction(prevSession._botonic_action)
|
|
466
|
+
// if (action && action.on_finish) sendPayload(action.on_finish)
|
|
467
|
+
// }
|
|
468
|
+
// }, [webchatState.session._botonic_action])
|
|
469
|
+
// const sendText = async (text, payload) => {
|
|
470
|
+
// if (!text) return
|
|
471
|
+
// const input = { type: INPUT.TEXT, data: text, payload }
|
|
472
|
+
// await sendInput(input)
|
|
473
|
+
// }
|
|
474
|
+
// const sendPayload = async payload => {
|
|
475
|
+
// if (!payload) return
|
|
476
|
+
// const input = { type: INPUT.POSTBACK, payload }
|
|
477
|
+
// await sendInput(input)
|
|
478
|
+
// }
|
|
479
|
+
// const sendAttachment = async attachment => {
|
|
480
|
+
// if (attachment.file) {
|
|
481
|
+
// const attachmentType = getMediaType(attachment.file.type)
|
|
482
|
+
// if (!attachmentType) return
|
|
483
|
+
// const input = {
|
|
484
|
+
// type: attachmentType,
|
|
485
|
+
// data: attachment.file,
|
|
486
|
+
// }
|
|
487
|
+
// await sendInput(input)
|
|
488
|
+
// setCurrentAttachment(undefined)
|
|
489
|
+
// }
|
|
490
|
+
// }
|
|
491
|
+
// const webviewRequestContext = {
|
|
492
|
+
// closeWebview: closeWebview,
|
|
493
|
+
// getString: stringId => props.getString(stringId, webchatState.session),
|
|
494
|
+
// params: webchatState.webviewParams || {},
|
|
495
|
+
// session: webchatState.session || {},
|
|
496
|
+
// }
|
|
497
|
+
// useEffect(() => {
|
|
498
|
+
// if (firstUpdate.current) {
|
|
499
|
+
// firstUpdate.current = false
|
|
500
|
+
// return
|
|
501
|
+
// }
|
|
502
|
+
// if (webchatState.isWebchatOpen && props.onOpen) props.onOpen()
|
|
503
|
+
// if (!webchatState.isWebchatOpen && props.onClose && !firstUpdate.current) {
|
|
504
|
+
// props.onClose()
|
|
505
|
+
// toggleEmojiPicker(false)
|
|
506
|
+
// togglePersistentMenu(false)
|
|
507
|
+
// }
|
|
508
|
+
// }, [webchatState.isWebchatOpen])
|
|
509
|
+
// const isUserInputEnabled = () => {
|
|
510
|
+
// const isUserInputEnabled = getThemeProperty(
|
|
511
|
+
// WEBCHAT.CUSTOM_PROPERTIES.enableUserInput,
|
|
512
|
+
// props.enableUserInput !== undefined ? props.enableUserInput : true
|
|
513
|
+
// )
|
|
514
|
+
// return isUserInputEnabled && !webchatState.isCoverComponentOpen
|
|
515
|
+
// }
|
|
516
|
+
// const userInputEnabled = isUserInputEnabled()
|
|
517
|
+
// const webchatWebview = () => (
|
|
518
|
+
// <WebviewRequestContext.Provider value={webviewRequestContext}>
|
|
519
|
+
// <WebviewContainer
|
|
520
|
+
// style={{
|
|
521
|
+
// ...getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.webviewStyle),
|
|
522
|
+
// ...mobileStyle,
|
|
523
|
+
// }}
|
|
524
|
+
// webview={webchatState.webview}
|
|
525
|
+
// />
|
|
526
|
+
// </WebviewRequestContext.Provider>
|
|
527
|
+
// )
|
|
528
|
+
// let mobileStyle = {}
|
|
529
|
+
// if (isMobile(getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.mobileBreakpoint))) {
|
|
530
|
+
// mobileStyle = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.mobileStyle) || {
|
|
531
|
+
// width: '100%',
|
|
532
|
+
// height: '100%',
|
|
533
|
+
// right: 0,
|
|
534
|
+
// bottom: 0,
|
|
535
|
+
// borderRadius: 0,
|
|
536
|
+
// }
|
|
537
|
+
// }
|
|
538
|
+
// useEffect(() => {
|
|
539
|
+
// // Prod mode
|
|
540
|
+
// saveWebchatState(webchatState)
|
|
541
|
+
// }, [webchatState.themeUpdates])
|
|
542
|
+
// // Only needed for dev/serve mode
|
|
543
|
+
// const updateWebchatDevSettings = settings => {
|
|
544
|
+
// // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
545
|
+
// useEffect(() => {
|
|
546
|
+
// const themeUpdates = normalizeWebchatSettings(settings)
|
|
547
|
+
// updateTheme(merge(webchatState.theme, themeUpdates), themeUpdates)
|
|
548
|
+
// }, [webchatState.messagesJSON])
|
|
549
|
+
// }
|
|
550
|
+
// const DarkenBackground = ({ component }) => {
|
|
551
|
+
// return (
|
|
552
|
+
// <div>
|
|
553
|
+
// {darkBackgroundMenu && (
|
|
554
|
+
// <DarkBackgroundMenu
|
|
555
|
+
// style={{
|
|
556
|
+
// borderRadius: webchatState.theme.style.borderRadius,
|
|
557
|
+
// }}
|
|
558
|
+
// />
|
|
559
|
+
// )}
|
|
560
|
+
// {component}
|
|
561
|
+
// </div>
|
|
562
|
+
// )
|
|
563
|
+
// }
|
|
564
|
+
// const _renderCustomComponent = () => {
|
|
565
|
+
// if (!customComponent) return <></>
|
|
566
|
+
// else return customComponent
|
|
567
|
+
// }
|
|
568
|
+
// const WebchatComponent = (
|
|
569
|
+
// <WebchatContext.Provider
|
|
570
|
+
// value={{
|
|
571
|
+
// addMessage,
|
|
572
|
+
// getThemeProperty,
|
|
573
|
+
// openWebview,
|
|
574
|
+
// resolveCase,
|
|
575
|
+
// resetUnreadMessages,
|
|
576
|
+
// setLastMessageVisible,
|
|
577
|
+
// sendAttachment,
|
|
578
|
+
// sendInput,
|
|
579
|
+
// sendPayload,
|
|
580
|
+
// sendText,
|
|
581
|
+
// toggleWebchat,
|
|
582
|
+
// toggleEmojiPicker,
|
|
583
|
+
// togglePersistentMenu,
|
|
584
|
+
// toggleCoverComponent,
|
|
585
|
+
// updateLatestInput,
|
|
586
|
+
// updateMessage,
|
|
587
|
+
// updateReplies,
|
|
588
|
+
// updateUser: updateSessionWithUser,
|
|
589
|
+
// updateWebchatDevSettings: updateWebchatDevSettings,
|
|
590
|
+
// webchatState,
|
|
591
|
+
// trackEvent: props.onTrackEvent,
|
|
592
|
+
// webchatRef,
|
|
593
|
+
// chatAreaRef,
|
|
594
|
+
// inputPanelRef,
|
|
595
|
+
// headerRef,
|
|
596
|
+
// scrollableMessagesListRef,
|
|
597
|
+
// }}
|
|
598
|
+
// >
|
|
599
|
+
// {!webchatState.isWebchatOpen && <TriggerButton />}
|
|
600
|
+
// {webchatState.isWebchatOpen && (
|
|
601
|
+
// <StyledWebchat
|
|
602
|
+
// id={BotonicContainerId.Webchat}
|
|
603
|
+
// ref={webchatRef}
|
|
604
|
+
// // TODO: Distinguish between multiple instances of webchat, e.g. `${uniqueId}-botonic-webchat`
|
|
605
|
+
// role={ROLES.WEBCHAT}
|
|
606
|
+
// width={webchatState.width}
|
|
607
|
+
// height={webchatState.height}
|
|
608
|
+
// style={{
|
|
609
|
+
// ...webchatState.theme.style,
|
|
610
|
+
// ...mobileStyle,
|
|
611
|
+
// }}
|
|
612
|
+
// >
|
|
613
|
+
// <WebchatHeader
|
|
614
|
+
// id={BotonicContainerId.Header}
|
|
615
|
+
// ref={headerRef}
|
|
616
|
+
// onCloseClick={() => {
|
|
617
|
+
// toggleWebchat(false)
|
|
618
|
+
// }}
|
|
619
|
+
// />
|
|
620
|
+
// {webchatState.isCoverComponentOpen ? (
|
|
621
|
+
// <CoverComponent
|
|
622
|
+
// component={coverComponent}
|
|
623
|
+
// componentProps={coverComponentProps}
|
|
624
|
+
// />
|
|
625
|
+
// ) : (
|
|
626
|
+
// <>
|
|
627
|
+
// {webchatState.error.message && (
|
|
628
|
+
// <ErrorMessageContainer>
|
|
629
|
+
// <ErrorMessage>{webchatState.error.message}</ErrorMessage>
|
|
630
|
+
// </ErrorMessageContainer>
|
|
631
|
+
// )}
|
|
632
|
+
// <ChatArea />
|
|
633
|
+
// {webchatState.isPersistentMenuOpen && (
|
|
634
|
+
// <DarkenBackground component={persistentMenu()} />
|
|
635
|
+
// )}
|
|
636
|
+
// {!webchatState.handoff && userInputEnabled && (
|
|
637
|
+
// <InputPanel
|
|
638
|
+
// persistentMenu={props.persistentMenu}
|
|
639
|
+
// enableEmojiPicker={props.enableEmojiPicker}
|
|
640
|
+
// enableAttachments={props.enableAttachments}
|
|
641
|
+
// handleAttachment={handleAttachment}
|
|
642
|
+
// textareaRef={textareaRef}
|
|
643
|
+
// host={host}
|
|
644
|
+
// onUserInput={props.onUserInput}
|
|
645
|
+
// />
|
|
646
|
+
// )}
|
|
647
|
+
// {webchatState.webview && webchatWebview()}
|
|
648
|
+
// {webchatState.isCustomComponentRendered &&
|
|
649
|
+
// customComponent &&
|
|
650
|
+
// _renderCustomComponent()}
|
|
651
|
+
// </>
|
|
652
|
+
// )}
|
|
653
|
+
// </StyledWebchat>
|
|
654
|
+
// )}
|
|
655
|
+
// </WebchatContext.Provider>
|
|
656
|
+
// )
|
|
657
|
+
// return props.shadowDOM ? (
|
|
658
|
+
// <StyleSheetManager target={host}>{WebchatComponent}</StyleSheetManager>
|
|
659
|
+
// ) : (
|
|
660
|
+
// WebchatComponent
|
|
661
|
+
// )
|
|
662
|
+
// })
|
|
663
|
+
//# sourceMappingURL=webchat-typed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webchat-typed.js","sourceRoot":"","sources":["../../../../src/webchat/webchat-typed/webchat-typed.tsx"],"names":[],"mappings":";AAAA,WAAW;AACX,mBAAmB;AACnB,WAAW;AACX,cAAc;AACd,wBAAwB;AACxB,yBAAyB;AACzB,mCAAmC;AACnC,kBAAkB;AAClB,gBAAgB;AAChB,eAAe;AACf,yBAAyB;AACzB,YAAY;AACZ,cAAc;AACd,iBAAiB;AACjB,wDAAwD;AACxD,sCAAsC;AAEtC,yEAAyE;AACzE,qDAAqD;AACrD,+EAA+E;AAC/E,gFAAgF;AAChF,yEAAyE;AACzE,8CAA8C;AAC9C,WAAW;AACX,kBAAkB;AAClB,mBAAmB;AACnB,aAAa;AACb,gBAAgB;AAChB,aAAa;AACb,aAAa;AACb,YAAY;AACZ,aAAa;AACb,iBAAiB;AACjB,+BAA+B;AAC/B,sDAAsD;AACtD,iDAAiD;AACjD,4EAA4E;AAC5E,WAAW;AACX,uBAAuB;AACvB,2BAA2B;AAC3B,iBAAiB;AACjB,+BAA+B;AAC/B,8BAA8B;AAC9B,0CAA0C;AAC1C,8EAA8E;AAC9E,oDAAoD;AACpD,sDAAsD;AACtD,4CAA4C;AAC5C,WAAW;AACX,2BAA2B;AAC3B,iBAAiB;AACjB,uBAAuB;AACvB,eAAe;AACf,gBAAgB;AAChB,oBAAoB;AACpB,8CAA8C;AAC9C,oDAAoD;AACpD,8DAA8D;AAC9D,6CAA6C;AAC7C,gDAAgD;AAChD,WAAW;AACX,wBAAwB;AACxB,kBAAkB;AAClB,2BAA2B;AAC3B,mBAAmB;AACnB,oBAAoB;AAEpB,6DAA6D;AAC7D,6EAA6E;AAC7E,YAAY;AACZ,kBAAkB;AAClB,2BAA2B;AAC3B,qBAAqB;AACrB,+BAA+B;AAC/B,oBAAoB;AACpB,2BAA2B;AAC3B,4BAA4B;AAC5B,gBAAgB;AAChB,6BAA6B;AAC7B,iBAAiB;AACjB,4BAA4B;AAC5B,yBAAyB;AACzB,4BAA4B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