@d19n/webchat 1.1.33 → 1.1.35

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 (485) hide show
  1. package/dist/TwilioChat/components/styled/ChatContent.d.ts +2 -1
  2. package/dist/TwilioChat/components/styled/ChatContentList.d.ts +2 -1
  3. package/dist/TwilioChat/components/styled/ChatWrapper.d.ts +2 -1
  4. package/dist/TwilioChat/components/styled/EventPost.d.ts +2 -1
  5. package/dist/TwilioChat/components/styled/Header.d.ts +2 -1
  6. package/dist/TwilioChat/components/styled/InputForm.d.ts +2 -1
  7. package/dist/TwilioChat/components/styled/MyPost.d.ts +2 -1
  8. package/dist/TwilioChat/components/styled/Splitter.d.ts +2 -1
  9. package/dist/TwilioChat/components/styled/WidgetButton.d.ts +2 -1
  10. package/dist/TwilioChat/components/styled/YFPost.d.ts +2 -1
  11. package/dist/_virtual/index11.js +1 -1
  12. package/dist/_virtual/index6.js +1 -1
  13. package/dist/_virtual/index7.js +1 -1
  14. package/dist/_virtual/index8.js +1 -1
  15. package/dist/index.js +9 -4
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.mjs +9 -4
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/package.json/package.json +17 -18
  20. package/dist/src/TwilioChat/Chat.js +1 -1
  21. package/dist/src/TwilioChat/Chat.js.map +1 -1
  22. package/dist/src/TwilioChat/components/ChatHeader.js +1 -1
  23. package/dist/src/TwilioChat/components/ChatHeader.js.map +1 -1
  24. package/dist/src/TwilioChat/components/ChatInput.js +1 -1
  25. package/dist/src/TwilioChat/components/ChatInput.js.map +1 -1
  26. package/dist/src/TwilioChat/components/Container.js +1 -1
  27. package/dist/src/TwilioChat/components/Container.js.map +1 -1
  28. package/dist/src/TwilioChat/components/Message.js +1 -1
  29. package/dist/src/TwilioChat/components/Message.js.map +1 -1
  30. package/dist/src/TwilioChat/components/MessageList.js +1 -1
  31. package/dist/src/TwilioChat/components/MessageList.js.map +1 -1
  32. package/dist/src/TwilioChat/components/NotificationBar.js +1 -1
  33. package/dist/src/TwilioChat/components/NotificationBar.js.map +1 -1
  34. package/dist/src/TwilioChat/components/TypingIndicator.js +1 -1
  35. package/dist/src/TwilioChat/components/TypingIndicator.js.map +1 -1
  36. package/dist/src/TwilioChat/components/Widget.js +1 -1
  37. package/dist/src/TwilioChat/components/Widget.js.map +1 -1
  38. package/dist/src/TwilioChat/index.js +1 -1
  39. package/dist/src/TwilioChat/index.js.map +1 -1
  40. package/dist/src/context/ChatGlobalContext.js +1 -1
  41. package/dist/src/index.js +1 -1
  42. package/dist/src/index.js.map +1 -1
  43. package/package.json +17 -18
  44. package/dist/_virtual/hoist-non-react-statics.cjs.js +0 -2
  45. package/dist/_virtual/hoist-non-react-statics.cjs.js.map +0 -1
  46. package/dist/_virtual/index12.js +0 -2
  47. package/dist/_virtual/index12.js.map +0 -1
  48. package/dist/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js +0 -2
  49. package/dist/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js.map +0 -1
  50. package/dist/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js +0 -2
  51. package/dist/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js.map +0 -1
  52. package/dist/node_modules/@emotion/stylis/dist/stylis.browser.esm.js +0 -2
  53. package/dist/node_modules/@emotion/stylis/dist/stylis.browser.esm.js.map +0 -1
  54. package/dist/node_modules/@emotion/unitless/dist/unitless.browser.esm.js +0 -2
  55. package/dist/node_modules/@emotion/unitless/dist/unitless.browser.esm.js.map +0 -1
  56. package/dist/node_modules/@socket.io/component-emitter/lib/esm/index.js +0 -2
  57. package/dist/node_modules/@socket.io/component-emitter/lib/esm/index.js.map +0 -1
  58. package/dist/node_modules/attr-accept/dist/es/index.js +0 -2
  59. package/dist/node_modules/attr-accept/dist/es/index.js.map +0 -1
  60. package/dist/node_modules/bail/index.js +0 -2
  61. package/dist/node_modules/bail/index.js.map +0 -1
  62. package/dist/node_modules/ccount/index.js +0 -2
  63. package/dist/node_modules/ccount/index.js.map +0 -1
  64. package/dist/node_modules/classnames/index.js +0 -7
  65. package/dist/node_modules/classnames/index.js.map +0 -1
  66. package/dist/node_modules/clsx/dist/clsx.m.js +0 -2
  67. package/dist/node_modules/clsx/dist/clsx.m.js.map +0 -1
  68. package/dist/node_modules/engine.io-client/build/esm/contrib/has-cors.js +0 -2
  69. package/dist/node_modules/engine.io-client/build/esm/contrib/has-cors.js.map +0 -1
  70. package/dist/node_modules/engine.io-client/build/esm/contrib/parseqs.js +0 -2
  71. package/dist/node_modules/engine.io-client/build/esm/contrib/parseqs.js.map +0 -1
  72. package/dist/node_modules/engine.io-client/build/esm/contrib/parseuri.js +0 -2
  73. package/dist/node_modules/engine.io-client/build/esm/contrib/parseuri.js.map +0 -1
  74. package/dist/node_modules/engine.io-client/build/esm/globals.js +0 -2
  75. package/dist/node_modules/engine.io-client/build/esm/globals.js.map +0 -1
  76. package/dist/node_modules/engine.io-client/build/esm/socket.js +0 -2
  77. package/dist/node_modules/engine.io-client/build/esm/socket.js.map +0 -1
  78. package/dist/node_modules/engine.io-client/build/esm/transport.js +0 -2
  79. package/dist/node_modules/engine.io-client/build/esm/transport.js.map +0 -1
  80. package/dist/node_modules/engine.io-client/build/esm/transports/index.js +0 -2
  81. package/dist/node_modules/engine.io-client/build/esm/transports/index.js.map +0 -1
  82. package/dist/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +0 -2
  83. package/dist/node_modules/engine.io-client/build/esm/transports/polling-xhr.js.map +0 -1
  84. package/dist/node_modules/engine.io-client/build/esm/transports/polling.js +0 -2
  85. package/dist/node_modules/engine.io-client/build/esm/transports/polling.js.map +0 -1
  86. package/dist/node_modules/engine.io-client/build/esm/transports/websocket.js +0 -2
  87. package/dist/node_modules/engine.io-client/build/esm/transports/websocket.js.map +0 -1
  88. package/dist/node_modules/engine.io-client/build/esm/transports/webtransport.js +0 -2
  89. package/dist/node_modules/engine.io-client/build/esm/transports/webtransport.js.map +0 -1
  90. package/dist/node_modules/engine.io-client/build/esm/util.js +0 -2
  91. package/dist/node_modules/engine.io-client/build/esm/util.js.map +0 -1
  92. package/dist/node_modules/engine.io-parser/build/esm/commons.js +0 -2
  93. package/dist/node_modules/engine.io-parser/build/esm/commons.js.map +0 -1
  94. package/dist/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +0 -2
  95. package/dist/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js.map +0 -1
  96. package/dist/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +0 -2
  97. package/dist/node_modules/engine.io-parser/build/esm/decodePacket.browser.js.map +0 -1
  98. package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +0 -2
  99. package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js.map +0 -1
  100. package/dist/node_modules/engine.io-parser/build/esm/index.js +0 -2
  101. package/dist/node_modules/engine.io-parser/build/esm/index.js.map +0 -1
  102. package/dist/node_modules/escape-string-regexp/index.js +0 -2
  103. package/dist/node_modules/escape-string-regexp/index.js.map +0 -1
  104. package/dist/node_modules/extend/index.js +0 -2
  105. package/dist/node_modules/extend/index.js.map +0 -1
  106. package/dist/node_modules/file-selector/dist/es2015/file-selector.js +0 -2
  107. package/dist/node_modules/file-selector/dist/es2015/file-selector.js.map +0 -1
  108. package/dist/node_modules/file-selector/dist/es2015/file.js +0 -2
  109. package/dist/node_modules/file-selector/dist/es2015/file.js.map +0 -1
  110. package/dist/node_modules/form-data/lib/browser.js +0 -2
  111. package/dist/node_modules/form-data/lib/browser.js.map +0 -1
  112. package/dist/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +0 -2
  113. package/dist/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js.map +0 -1
  114. package/dist/node_modules/is-buffer/index.js +0 -8
  115. package/dist/node_modules/is-buffer/index.js.map +0 -1
  116. package/dist/node_modules/is-plain-obj/index.js +0 -2
  117. package/dist/node_modules/is-plain-obj/index.js.map +0 -1
  118. package/dist/node_modules/linkify-html/dist/linkify-html.js +0 -2
  119. package/dist/node_modules/linkify-html/dist/linkify-html.js.map +0 -1
  120. package/dist/node_modules/linkifyjs/dist/linkify.js +0 -2
  121. package/dist/node_modules/linkifyjs/dist/linkify.js.map +0 -1
  122. package/dist/node_modules/lodash.debounce/index.js +0 -2
  123. package/dist/node_modules/lodash.debounce/index.js.map +0 -1
  124. package/dist/node_modules/markdown-table/index.js +0 -2
  125. package/dist/node_modules/markdown-table/index.js.map +0 -1
  126. package/dist/node_modules/mdast-add-list-metadata/index.js +0 -2
  127. package/dist/node_modules/mdast-add-list-metadata/index.js.map +0 -1
  128. package/dist/node_modules/mdast-util-find-and-replace/index.js +0 -2
  129. package/dist/node_modules/mdast-util-find-and-replace/index.js.map +0 -1
  130. package/dist/node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents/color.browser.js +0 -2
  131. package/dist/node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents/color.browser.js.map +0 -1
  132. package/dist/node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents/index.js +0 -2
  133. package/dist/node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents/index.js.map +0 -1
  134. package/dist/node_modules/mdast-util-from-markdown/dist/index.js +0 -2
  135. package/dist/node_modules/mdast-util-from-markdown/dist/index.js.map +0 -1
  136. package/dist/node_modules/mdast-util-from-markdown/index.js +0 -2
  137. package/dist/node_modules/mdast-util-from-markdown/index.js.map +0 -1
  138. package/dist/node_modules/mdast-util-gfm/from-markdown.js +0 -2
  139. package/dist/node_modules/mdast-util-gfm/from-markdown.js.map +0 -1
  140. package/dist/node_modules/mdast-util-gfm/to-markdown.js +0 -2
  141. package/dist/node_modules/mdast-util-gfm/to-markdown.js.map +0 -1
  142. package/dist/node_modules/mdast-util-gfm-autolink-literal/from-markdown.js +0 -2
  143. package/dist/node_modules/mdast-util-gfm-autolink-literal/from-markdown.js.map +0 -1
  144. package/dist/node_modules/mdast-util-gfm-autolink-literal/to-markdown.js +0 -2
  145. package/dist/node_modules/mdast-util-gfm-autolink-literal/to-markdown.js.map +0 -1
  146. package/dist/node_modules/mdast-util-gfm-strikethrough/from-markdown.js +0 -2
  147. package/dist/node_modules/mdast-util-gfm-strikethrough/from-markdown.js.map +0 -1
  148. package/dist/node_modules/mdast-util-gfm-strikethrough/to-markdown.js +0 -2
  149. package/dist/node_modules/mdast-util-gfm-strikethrough/to-markdown.js.map +0 -1
  150. package/dist/node_modules/mdast-util-gfm-table/from-markdown.js +0 -2
  151. package/dist/node_modules/mdast-util-gfm-table/from-markdown.js.map +0 -1
  152. package/dist/node_modules/mdast-util-gfm-table/to-markdown.js +0 -2
  153. package/dist/node_modules/mdast-util-gfm-table/to-markdown.js.map +0 -1
  154. package/dist/node_modules/mdast-util-gfm-task-list-item/from-markdown.js +0 -2
  155. package/dist/node_modules/mdast-util-gfm-task-list-item/from-markdown.js.map +0 -1
  156. package/dist/node_modules/mdast-util-gfm-task-list-item/to-markdown.js +0 -2
  157. package/dist/node_modules/mdast-util-gfm-task-list-item/to-markdown.js.map +0 -1
  158. package/dist/node_modules/mdast-util-to-markdown/lib/configure.js +0 -2
  159. package/dist/node_modules/mdast-util-to-markdown/lib/configure.js.map +0 -1
  160. package/dist/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js +0 -2
  161. package/dist/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js.map +0 -1
  162. package/dist/node_modules/mdast-util-to-markdown/lib/handle/list-item.js +0 -2
  163. package/dist/node_modules/mdast-util-to-markdown/lib/handle/list-item.js.map +0 -1
  164. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js +0 -2
  165. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js.map +0 -1
  166. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js +0 -2
  167. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js.map +0 -1
  168. package/dist/node_modules/mdast-util-to-markdown/lib/util/container-flow.js +0 -2
  169. package/dist/node_modules/mdast-util-to-markdown/lib/util/container-flow.js.map +0 -1
  170. package/dist/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js +0 -2
  171. package/dist/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js.map +0 -1
  172. package/dist/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js +0 -2
  173. package/dist/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js.map +0 -1
  174. package/dist/node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js +0 -2
  175. package/dist/node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js.map +0 -1
  176. package/dist/node_modules/mdast-util-to-string/index.js +0 -2
  177. package/dist/node_modules/mdast-util-to-string/index.js.map +0 -1
  178. package/dist/node_modules/micromark/dist/character/ascii-alpha.js +0 -2
  179. package/dist/node_modules/micromark/dist/character/ascii-alpha.js.map +0 -1
  180. package/dist/node_modules/micromark/dist/character/ascii-alphanumeric.js +0 -2
  181. package/dist/node_modules/micromark/dist/character/ascii-alphanumeric.js.map +0 -1
  182. package/dist/node_modules/micromark/dist/character/ascii-atext.js +0 -2
  183. package/dist/node_modules/micromark/dist/character/ascii-atext.js.map +0 -1
  184. package/dist/node_modules/micromark/dist/character/ascii-control.js +0 -2
  185. package/dist/node_modules/micromark/dist/character/ascii-control.js.map +0 -1
  186. package/dist/node_modules/micromark/dist/character/ascii-digit.js +0 -2
  187. package/dist/node_modules/micromark/dist/character/ascii-digit.js.map +0 -1
  188. package/dist/node_modules/micromark/dist/character/ascii-hex-digit.js +0 -2
  189. package/dist/node_modules/micromark/dist/character/ascii-hex-digit.js.map +0 -1
  190. package/dist/node_modules/micromark/dist/character/ascii-punctuation.js +0 -2
  191. package/dist/node_modules/micromark/dist/character/ascii-punctuation.js.map +0 -1
  192. package/dist/node_modules/micromark/dist/character/markdown-line-ending-or-space.js +0 -2
  193. package/dist/node_modules/micromark/dist/character/markdown-line-ending-or-space.js.map +0 -1
  194. package/dist/node_modules/micromark/dist/character/markdown-line-ending.js +0 -2
  195. package/dist/node_modules/micromark/dist/character/markdown-line-ending.js.map +0 -1
  196. package/dist/node_modules/micromark/dist/character/markdown-space.js +0 -2
  197. package/dist/node_modules/micromark/dist/character/markdown-space.js.map +0 -1
  198. package/dist/node_modules/micromark/dist/character/unicode-punctuation.js +0 -2
  199. package/dist/node_modules/micromark/dist/character/unicode-punctuation.js.map +0 -1
  200. package/dist/node_modules/micromark/dist/character/unicode-whitespace.js +0 -2
  201. package/dist/node_modules/micromark/dist/character/unicode-whitespace.js.map +0 -1
  202. package/dist/node_modules/micromark/dist/constant/assign.js +0 -2
  203. package/dist/node_modules/micromark/dist/constant/assign.js.map +0 -1
  204. package/dist/node_modules/micromark/dist/constant/from-char-code.js +0 -2
  205. package/dist/node_modules/micromark/dist/constant/from-char-code.js.map +0 -1
  206. package/dist/node_modules/micromark/dist/constant/has-own-property.js +0 -2
  207. package/dist/node_modules/micromark/dist/constant/has-own-property.js.map +0 -1
  208. package/dist/node_modules/micromark/dist/constant/html-block-names.js +0 -2
  209. package/dist/node_modules/micromark/dist/constant/html-block-names.js.map +0 -1
  210. package/dist/node_modules/micromark/dist/constant/html-raw-names.js +0 -2
  211. package/dist/node_modules/micromark/dist/constant/html-raw-names.js.map +0 -1
  212. package/dist/node_modules/micromark/dist/constant/splice.js +0 -2
  213. package/dist/node_modules/micromark/dist/constant/splice.js.map +0 -1
  214. package/dist/node_modules/micromark/dist/constant/unicode-punctuation-regex.js +0 -2
  215. package/dist/node_modules/micromark/dist/constant/unicode-punctuation-regex.js.map +0 -1
  216. package/dist/node_modules/micromark/dist/constructs.js +0 -2
  217. package/dist/node_modules/micromark/dist/constructs.js.map +0 -1
  218. package/dist/node_modules/micromark/dist/initialize/content.js +0 -2
  219. package/dist/node_modules/micromark/dist/initialize/content.js.map +0 -1
  220. package/dist/node_modules/micromark/dist/initialize/document.js +0 -2
  221. package/dist/node_modules/micromark/dist/initialize/document.js.map +0 -1
  222. package/dist/node_modules/micromark/dist/initialize/flow.js +0 -2
  223. package/dist/node_modules/micromark/dist/initialize/flow.js.map +0 -1
  224. package/dist/node_modules/micromark/dist/initialize/text.js +0 -2
  225. package/dist/node_modules/micromark/dist/initialize/text.js.map +0 -1
  226. package/dist/node_modules/micromark/dist/parse.js +0 -2
  227. package/dist/node_modules/micromark/dist/parse.js.map +0 -1
  228. package/dist/node_modules/micromark/dist/postprocess.js +0 -2
  229. package/dist/node_modules/micromark/dist/postprocess.js.map +0 -1
  230. package/dist/node_modules/micromark/dist/preprocess.js +0 -2
  231. package/dist/node_modules/micromark/dist/preprocess.js.map +0 -1
  232. package/dist/node_modules/micromark/dist/tokenize/attention.js +0 -2
  233. package/dist/node_modules/micromark/dist/tokenize/attention.js.map +0 -1
  234. package/dist/node_modules/micromark/dist/tokenize/autolink.js +0 -2
  235. package/dist/node_modules/micromark/dist/tokenize/autolink.js.map +0 -1
  236. package/dist/node_modules/micromark/dist/tokenize/block-quote.js +0 -2
  237. package/dist/node_modules/micromark/dist/tokenize/block-quote.js.map +0 -1
  238. package/dist/node_modules/micromark/dist/tokenize/character-escape.js +0 -2
  239. package/dist/node_modules/micromark/dist/tokenize/character-escape.js.map +0 -1
  240. package/dist/node_modules/micromark/dist/tokenize/character-reference.js +0 -2
  241. package/dist/node_modules/micromark/dist/tokenize/character-reference.js.map +0 -1
  242. package/dist/node_modules/micromark/dist/tokenize/code-fenced.js +0 -2
  243. package/dist/node_modules/micromark/dist/tokenize/code-fenced.js.map +0 -1
  244. package/dist/node_modules/micromark/dist/tokenize/code-indented.js +0 -2
  245. package/dist/node_modules/micromark/dist/tokenize/code-indented.js.map +0 -1
  246. package/dist/node_modules/micromark/dist/tokenize/code-text.js +0 -2
  247. package/dist/node_modules/micromark/dist/tokenize/code-text.js.map +0 -1
  248. package/dist/node_modules/micromark/dist/tokenize/content.js +0 -2
  249. package/dist/node_modules/micromark/dist/tokenize/content.js.map +0 -1
  250. package/dist/node_modules/micromark/dist/tokenize/definition.js +0 -2
  251. package/dist/node_modules/micromark/dist/tokenize/definition.js.map +0 -1
  252. package/dist/node_modules/micromark/dist/tokenize/factory-destination.js +0 -2
  253. package/dist/node_modules/micromark/dist/tokenize/factory-destination.js.map +0 -1
  254. package/dist/node_modules/micromark/dist/tokenize/factory-label.js +0 -2
  255. package/dist/node_modules/micromark/dist/tokenize/factory-label.js.map +0 -1
  256. package/dist/node_modules/micromark/dist/tokenize/factory-space.js +0 -2
  257. package/dist/node_modules/micromark/dist/tokenize/factory-space.js.map +0 -1
  258. package/dist/node_modules/micromark/dist/tokenize/factory-title.js +0 -2
  259. package/dist/node_modules/micromark/dist/tokenize/factory-title.js.map +0 -1
  260. package/dist/node_modules/micromark/dist/tokenize/factory-whitespace.js +0 -2
  261. package/dist/node_modules/micromark/dist/tokenize/factory-whitespace.js.map +0 -1
  262. package/dist/node_modules/micromark/dist/tokenize/hard-break-escape.js +0 -2
  263. package/dist/node_modules/micromark/dist/tokenize/hard-break-escape.js.map +0 -1
  264. package/dist/node_modules/micromark/dist/tokenize/heading-atx.js +0 -2
  265. package/dist/node_modules/micromark/dist/tokenize/heading-atx.js.map +0 -1
  266. package/dist/node_modules/micromark/dist/tokenize/html-flow.js +0 -2
  267. package/dist/node_modules/micromark/dist/tokenize/html-flow.js.map +0 -1
  268. package/dist/node_modules/micromark/dist/tokenize/html-text.js +0 -2
  269. package/dist/node_modules/micromark/dist/tokenize/html-text.js.map +0 -1
  270. package/dist/node_modules/micromark/dist/tokenize/label-end.js +0 -2
  271. package/dist/node_modules/micromark/dist/tokenize/label-end.js.map +0 -1
  272. package/dist/node_modules/micromark/dist/tokenize/label-start-image.js +0 -2
  273. package/dist/node_modules/micromark/dist/tokenize/label-start-image.js.map +0 -1
  274. package/dist/node_modules/micromark/dist/tokenize/label-start-link.js +0 -2
  275. package/dist/node_modules/micromark/dist/tokenize/label-start-link.js.map +0 -1
  276. package/dist/node_modules/micromark/dist/tokenize/line-ending.js +0 -2
  277. package/dist/node_modules/micromark/dist/tokenize/line-ending.js.map +0 -1
  278. package/dist/node_modules/micromark/dist/tokenize/list.js +0 -2
  279. package/dist/node_modules/micromark/dist/tokenize/list.js.map +0 -1
  280. package/dist/node_modules/micromark/dist/tokenize/partial-blank-line.js +0 -2
  281. package/dist/node_modules/micromark/dist/tokenize/partial-blank-line.js.map +0 -1
  282. package/dist/node_modules/micromark/dist/tokenize/setext-underline.js +0 -2
  283. package/dist/node_modules/micromark/dist/tokenize/setext-underline.js.map +0 -1
  284. package/dist/node_modules/micromark/dist/tokenize/thematic-break.js +0 -2
  285. package/dist/node_modules/micromark/dist/tokenize/thematic-break.js.map +0 -1
  286. package/dist/node_modules/micromark/dist/util/chunked-push.js +0 -2
  287. package/dist/node_modules/micromark/dist/util/chunked-push.js.map +0 -1
  288. package/dist/node_modules/micromark/dist/util/chunked-splice.js +0 -2
  289. package/dist/node_modules/micromark/dist/util/chunked-splice.js.map +0 -1
  290. package/dist/node_modules/micromark/dist/util/classify-character.js +0 -2
  291. package/dist/node_modules/micromark/dist/util/classify-character.js.map +0 -1
  292. package/dist/node_modules/micromark/dist/util/combine-extensions.js +0 -2
  293. package/dist/node_modules/micromark/dist/util/combine-extensions.js.map +0 -1
  294. package/dist/node_modules/micromark/dist/util/create-tokenizer.js +0 -2
  295. package/dist/node_modules/micromark/dist/util/create-tokenizer.js.map +0 -1
  296. package/dist/node_modules/micromark/dist/util/miniflat.js +0 -2
  297. package/dist/node_modules/micromark/dist/util/miniflat.js.map +0 -1
  298. package/dist/node_modules/micromark/dist/util/move-point.js +0 -2
  299. package/dist/node_modules/micromark/dist/util/move-point.js.map +0 -1
  300. package/dist/node_modules/micromark/dist/util/normalize-identifier.js +0 -2
  301. package/dist/node_modules/micromark/dist/util/normalize-identifier.js.map +0 -1
  302. package/dist/node_modules/micromark/dist/util/prefix-size.js +0 -2
  303. package/dist/node_modules/micromark/dist/util/prefix-size.js.map +0 -1
  304. package/dist/node_modules/micromark/dist/util/regex-check.js +0 -2
  305. package/dist/node_modules/micromark/dist/util/regex-check.js.map +0 -1
  306. package/dist/node_modules/micromark/dist/util/resolve-all.js +0 -2
  307. package/dist/node_modules/micromark/dist/util/resolve-all.js.map +0 -1
  308. package/dist/node_modules/micromark/dist/util/safe-from-int.js +0 -2
  309. package/dist/node_modules/micromark/dist/util/safe-from-int.js.map +0 -1
  310. package/dist/node_modules/micromark/dist/util/serialize-chunks.js +0 -2
  311. package/dist/node_modules/micromark/dist/util/serialize-chunks.js.map +0 -1
  312. package/dist/node_modules/micromark/dist/util/shallow.js +0 -2
  313. package/dist/node_modules/micromark/dist/util/shallow.js.map +0 -1
  314. package/dist/node_modules/micromark/dist/util/size-chunks.js +0 -2
  315. package/dist/node_modules/micromark/dist/util/size-chunks.js.map +0 -1
  316. package/dist/node_modules/micromark/dist/util/slice-chunks.js +0 -2
  317. package/dist/node_modules/micromark/dist/util/slice-chunks.js.map +0 -1
  318. package/dist/node_modules/micromark/dist/util/subtokenize.js +0 -2
  319. package/dist/node_modules/micromark/dist/util/subtokenize.js.map +0 -1
  320. package/dist/node_modules/micromark-extension-gfm/index.js +0 -2
  321. package/dist/node_modules/micromark-extension-gfm/index.js.map +0 -1
  322. package/dist/node_modules/micromark-extension-gfm/syntax.js +0 -2
  323. package/dist/node_modules/micromark-extension-gfm/syntax.js.map +0 -1
  324. package/dist/node_modules/micromark-extension-gfm-autolink-literal/index.js +0 -2
  325. package/dist/node_modules/micromark-extension-gfm-autolink-literal/index.js.map +0 -1
  326. package/dist/node_modules/micromark-extension-gfm-autolink-literal/syntax.js +0 -2
  327. package/dist/node_modules/micromark-extension-gfm-autolink-literal/syntax.js.map +0 -1
  328. package/dist/node_modules/micromark-extension-gfm-strikethrough/index.js +0 -2
  329. package/dist/node_modules/micromark-extension-gfm-strikethrough/index.js.map +0 -1
  330. package/dist/node_modules/micromark-extension-gfm-table/index.js +0 -2
  331. package/dist/node_modules/micromark-extension-gfm-table/index.js.map +0 -1
  332. package/dist/node_modules/micromark-extension-gfm-table/syntax.js +0 -2
  333. package/dist/node_modules/micromark-extension-gfm-table/syntax.js.map +0 -1
  334. package/dist/node_modules/micromark-extension-gfm-task-list-item/index.js +0 -2
  335. package/dist/node_modules/micromark-extension-gfm-task-list-item/index.js.map +0 -1
  336. package/dist/node_modules/micromark-extension-gfm-task-list-item/syntax.js +0 -2
  337. package/dist/node_modules/micromark-extension-gfm-task-list-item/syntax.js.map +0 -1
  338. package/dist/node_modules/moment/moment.js +0 -4
  339. package/dist/node_modules/moment/moment.js.map +0 -1
  340. package/dist/node_modules/object-assign/index.js +0 -7
  341. package/dist/node_modules/object-assign/index.js.map +0 -1
  342. package/dist/node_modules/parse-entities/decode-entity.browser.js +0 -2
  343. package/dist/node_modules/parse-entities/decode-entity.browser.js.map +0 -1
  344. package/dist/node_modules/prop-types/checkPropTypes.js +0 -2
  345. package/dist/node_modules/prop-types/checkPropTypes.js.map +0 -1
  346. package/dist/node_modules/prop-types/factoryWithThrowingShims.js +0 -2
  347. package/dist/node_modules/prop-types/factoryWithThrowingShims.js.map +0 -1
  348. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +0 -2
  349. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js.map +0 -1
  350. package/dist/node_modules/prop-types/index.js +0 -2
  351. package/dist/node_modules/prop-types/index.js.map +0 -1
  352. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +0 -2
  353. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js.map +0 -1
  354. package/dist/node_modules/prop-types/lib/has.js +0 -2
  355. package/dist/node_modules/prop-types/lib/has.js.map +0 -1
  356. package/dist/node_modules/react-bootstrap/esm/Col.js +0 -2
  357. package/dist/node_modules/react-bootstrap/esm/Col.js.map +0 -1
  358. package/dist/node_modules/react-bootstrap/esm/Row.js +0 -2
  359. package/dist/node_modules/react-bootstrap/esm/Row.js.map +0 -1
  360. package/dist/node_modules/react-bootstrap/esm/ThemeProvider.js +0 -2
  361. package/dist/node_modules/react-bootstrap/esm/ThemeProvider.js.map +0 -1
  362. package/dist/node_modules/react-debounce-input/lib/Component.js +0 -2
  363. package/dist/node_modules/react-debounce-input/lib/Component.js.map +0 -1
  364. package/dist/node_modules/react-debounce-input/lib/index.js +0 -2
  365. package/dist/node_modules/react-debounce-input/lib/index.js.map +0 -1
  366. package/dist/node_modules/react-dropzone/dist/es/index.js +0 -2
  367. package/dist/node_modules/react-dropzone/dist/es/index.js.map +0 -1
  368. package/dist/node_modules/react-dropzone/dist/es/utils/index.js +0 -2
  369. package/dist/node_modules/react-dropzone/dist/es/utils/index.js.map +0 -1
  370. package/dist/node_modules/react-icons/bs/index.js +0 -2
  371. package/dist/node_modules/react-icons/bs/index.js.map +0 -1
  372. package/dist/node_modules/react-icons/io/index.js +0 -2
  373. package/dist/node_modules/react-icons/io/index.js.map +0 -1
  374. package/dist/node_modules/react-icons/lib/iconBase.js +0 -2
  375. package/dist/node_modules/react-icons/lib/iconBase.js.map +0 -1
  376. package/dist/node_modules/react-icons/lib/iconContext.js +0 -2
  377. package/dist/node_modules/react-icons/lib/iconContext.js.map +0 -1
  378. package/dist/node_modules/react-is/cjs/react-is.development.js +0 -10
  379. package/dist/node_modules/react-is/cjs/react-is.development.js.map +0 -1
  380. package/dist/node_modules/react-is/cjs/react-is.production.min.js +0 -10
  381. package/dist/node_modules/react-is/cjs/react-is.production.min.js.map +0 -1
  382. package/dist/node_modules/react-is/index.js +0 -2
  383. package/dist/node_modules/react-is/index.js.map +0 -1
  384. package/dist/node_modules/react-markdown/lib/ast-to-react.js +0 -2
  385. package/dist/node_modules/react-markdown/lib/ast-to-react.js.map +0 -1
  386. package/dist/node_modules/react-markdown/lib/get-definitions.js +0 -2
  387. package/dist/node_modules/react-markdown/lib/get-definitions.js.map +0 -1
  388. package/dist/node_modules/react-markdown/lib/plugins/disallow-node.js +0 -2
  389. package/dist/node_modules/react-markdown/lib/plugins/disallow-node.js.map +0 -1
  390. package/dist/node_modules/react-markdown/lib/plugins/naive-html.js +0 -2
  391. package/dist/node_modules/react-markdown/lib/plugins/naive-html.js.map +0 -1
  392. package/dist/node_modules/react-markdown/lib/react-markdown.js +0 -2
  393. package/dist/node_modules/react-markdown/lib/react-markdown.js.map +0 -1
  394. package/dist/node_modules/react-markdown/lib/renderers.js +0 -2
  395. package/dist/node_modules/react-markdown/lib/renderers.js.map +0 -1
  396. package/dist/node_modules/react-markdown/lib/symbols.js +0 -2
  397. package/dist/node_modules/react-markdown/lib/symbols.js.map +0 -1
  398. package/dist/node_modules/react-markdown/lib/uri-transformer.js +0 -2
  399. package/dist/node_modules/react-markdown/lib/uri-transformer.js.map +0 -1
  400. package/dist/node_modules/react-markdown/lib/wrap-table-rows.js +0 -2
  401. package/dist/node_modules/react-markdown/lib/wrap-table-rows.js.map +0 -1
  402. package/dist/node_modules/react-modal-image/es/Header.js +0 -2
  403. package/dist/node_modules/react-modal-image/es/Header.js.map +0 -1
  404. package/dist/node_modules/react-modal-image/es/Image.js +0 -2
  405. package/dist/node_modules/react-modal-image/es/Image.js.map +0 -1
  406. package/dist/node_modules/react-modal-image/es/Lightbox.js +0 -2
  407. package/dist/node_modules/react-modal-image/es/Lightbox.js.map +0 -1
  408. package/dist/node_modules/react-modal-image/es/icons.js +0 -2
  409. package/dist/node_modules/react-modal-image/es/icons.js.map +0 -1
  410. package/dist/node_modules/react-modal-image/es/styles.js +0 -2
  411. package/dist/node_modules/react-modal-image/es/styles.js.map +0 -1
  412. package/dist/node_modules/react-timer-hook/dist/index.js +0 -2
  413. package/dist/node_modules/react-timer-hook/dist/index.js.map +0 -1
  414. package/dist/node_modules/react-toastify/dist/react-toastify.esm.js +0 -2
  415. package/dist/node_modules/react-toastify/dist/react-toastify.esm.js.map +0 -1
  416. package/dist/node_modules/remark-gfm/index.js +0 -2
  417. package/dist/node_modules/remark-gfm/index.js.map +0 -1
  418. package/dist/node_modules/remark-parse/index.js +0 -2
  419. package/dist/node_modules/remark-parse/index.js.map +0 -1
  420. package/dist/node_modules/repeat-string/index.js +0 -8
  421. package/dist/node_modules/repeat-string/index.js.map +0 -1
  422. package/dist/node_modules/socket.io-client/build/esm/contrib/backo2.js +0 -2
  423. package/dist/node_modules/socket.io-client/build/esm/contrib/backo2.js.map +0 -1
  424. package/dist/node_modules/socket.io-client/build/esm/index.js +0 -2
  425. package/dist/node_modules/socket.io-client/build/esm/index.js.map +0 -1
  426. package/dist/node_modules/socket.io-client/build/esm/manager.js +0 -2
  427. package/dist/node_modules/socket.io-client/build/esm/manager.js.map +0 -1
  428. package/dist/node_modules/socket.io-client/build/esm/on.js +0 -2
  429. package/dist/node_modules/socket.io-client/build/esm/on.js.map +0 -1
  430. package/dist/node_modules/socket.io-client/build/esm/socket.js +0 -2
  431. package/dist/node_modules/socket.io-client/build/esm/socket.js.map +0 -1
  432. package/dist/node_modules/socket.io-client/build/esm/url.js +0 -2
  433. package/dist/node_modules/socket.io-client/build/esm/url.js.map +0 -1
  434. package/dist/node_modules/socket.io-parser/build/esm/binary.js +0 -2
  435. package/dist/node_modules/socket.io-parser/build/esm/binary.js.map +0 -1
  436. package/dist/node_modules/socket.io-parser/build/esm/index.js +0 -2
  437. package/dist/node_modules/socket.io-parser/build/esm/index.js.map +0 -1
  438. package/dist/node_modules/socket.io-parser/build/esm/is-binary.js +0 -2
  439. package/dist/node_modules/socket.io-parser/build/esm/is-binary.js.map +0 -1
  440. package/dist/node_modules/style-inject/dist/style-inject.es.js +0 -2
  441. package/dist/node_modules/style-inject/dist/style-inject.es.js.map +0 -1
  442. package/dist/node_modules/styled-components/dist/styled-components.browser.esm.js +0 -2
  443. package/dist/node_modules/styled-components/dist/styled-components.browser.esm.js.map +0 -1
  444. package/dist/node_modules/trough/index.js +0 -2
  445. package/dist/node_modules/trough/index.js.map +0 -1
  446. package/dist/node_modules/trough/wrap.js +0 -2
  447. package/dist/node_modules/trough/wrap.js.map +0 -1
  448. package/dist/node_modules/tslib/tslib.es6.js +0 -2
  449. package/dist/node_modules/tslib/tslib.es6.js.map +0 -1
  450. package/dist/node_modules/unified/index.js +0 -2
  451. package/dist/node_modules/unified/index.js.map +0 -1
  452. package/dist/node_modules/unist-util-is/convert.js +0 -2
  453. package/dist/node_modules/unist-util-is/convert.js.map +0 -1
  454. package/dist/node_modules/unist-util-stringify-position/index.js +0 -2
  455. package/dist/node_modules/unist-util-stringify-position/index.js.map +0 -1
  456. package/dist/node_modules/unist-util-visit/index.js +0 -2
  457. package/dist/node_modules/unist-util-visit/index.js.map +0 -1
  458. package/dist/node_modules/unist-util-visit/node_modules/unist-util-visit-parents/color.browser.js +0 -2
  459. package/dist/node_modules/unist-util-visit/node_modules/unist-util-visit-parents/color.browser.js.map +0 -1
  460. package/dist/node_modules/unist-util-visit/node_modules/unist-util-visit-parents/index.js +0 -2
  461. package/dist/node_modules/unist-util-visit/node_modules/unist-util-visit-parents/index.js.map +0 -1
  462. package/dist/node_modules/unist-util-visit-parents/index.js +0 -2
  463. package/dist/node_modules/unist-util-visit-parents/index.js.map +0 -1
  464. package/dist/node_modules/uuid/dist/esm-browser/native.js +0 -2
  465. package/dist/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
  466. package/dist/node_modules/uuid/dist/esm-browser/rng.js +0 -2
  467. package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +0 -1
  468. package/dist/node_modules/uuid/dist/esm-browser/stringify.js +0 -2
  469. package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +0 -1
  470. package/dist/node_modules/uuid/dist/esm-browser/v4.js +0 -2
  471. package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +0 -1
  472. package/dist/node_modules/vfile/index.js +0 -2
  473. package/dist/node_modules/vfile/index.js.map +0 -1
  474. package/dist/node_modules/vfile/lib/core.js +0 -2
  475. package/dist/node_modules/vfile/lib/core.js.map +0 -1
  476. package/dist/node_modules/vfile/lib/index.js +0 -2
  477. package/dist/node_modules/vfile/lib/index.js.map +0 -1
  478. package/dist/node_modules/vfile/lib/minpath.browser.js +0 -2
  479. package/dist/node_modules/vfile/lib/minpath.browser.js.map +0 -1
  480. package/dist/node_modules/vfile/lib/minproc.browser.js +0 -2
  481. package/dist/node_modules/vfile/lib/minproc.browser.js.map +0 -1
  482. package/dist/node_modules/vfile-message/index.js +0 -2
  483. package/dist/node_modules/vfile-message/index.js.map +0 -1
  484. package/dist/node_modules/xtend/immutable.js +0 -2
  485. package/dist/node_modules/xtend/immutable.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{__rest as t,__assign as e,__spreadArray as n,__awaiter as l,__generator as o,__makeTemplateObject as i}from"../../../node_modules/tslib/tslib.es6.js";import a,{useContext as r,useState as s,useRef as c,useEffect as u}from"react";import d from"../../../node_modules/styled-components/dist/styled-components.browser.esm.js";import h from"../../context/ChatGlobalContext.js";import v from"./Message.js";import m from"../../../_virtual/moment.js";import{defaultMessages as C,initialTwilioChatState as f,userTypeLabels as g,categories as w,yesAccountHolder as p,notAccountHolder as b,newAccountHolder as y}from"../../utils/chats.js";import{connectToWebsocket as T,scrollToBottom as I,didAgentPost as E,getFiles as _,sendMessage as U,createConversation as S,getToken as x}from"../../services/chatService.js";import A from"./TypingIndicator.js";import O from"./styled/ChatContentList.js";import j from"./styled/Splitter.js";import D from"../../../node_modules/uuid/dist/esm-browser/v4.js";var N,k,L=function(i){t(i,[]);var d=r(h),N=s(null),k=N[0],L=N[1],M=s({}),V=M[0],W=M[1],B=s(C),H=B[0],z=B[1],G=c(H),P=c(null),Y=s(!0),q=Y[0];Y[1];var J,K=c([]),Q=s(null),X=Q[0],Z=Q[1],$=s(!1),tt=$[0],et=$[1];u(function(){},[]),u(function(){var t,e,n;if(null==d?void 0:d.twilioChat.chatUserId){var l=k||D();L(l),localStorage.setItem("chatSessionId",l),P.current||(P.current=T(l)),null===(t=P.current)||void 0===t||t.on("connect",function(){console.log("Connected to WebSocket server")}),null===(e=P.current)||void 0===e||e.on("connect_error",function(t){console.log("Connect error due to ".concat(t.message)),P.current=null,P.current=T(null==d?void 0:d.twilioChat.chatUserId)}),null===(n=P.current)||void 0===n||n.on("disconnect",function(t){console.log("Disconnected: ".concat(t)),P.current=null,P.current=T(null==d?void 0:d.twilioChat.chatUserId)})}else z(C)},[null==d?void 0:d.twilioChat.chatUserId]),u(function(){var t;(null==d?void 0:d.twilioChat.chatCaseId)&&(P.current&&(null==d?void 0:d.twilioChat.chatCaseId)&&P.current.emit("joinRoom",null==d?void 0:d.twilioChat.chatCaseId),P.current&&!P.current.listeners("case-event-".concat(null==d?void 0:d.twilioChat.chatCaseId)).length&&(null===(t=P.current)||void 0===t||t.on("case-event-".concat(null==d?void 0:d.twilioChat.chatCaseId),function(t){var n,l;switch(t.type){case"CASE_UPDATED":d.twilioChat.agentId=null===(n=t.data.properties)||void 0===n?void 0:n.OwnerId;break;case"CONVERSATION_CLOSED":null==d||d.goSetTwilioChat(e(e({},f),{openChat:null==d?void 0:d.twilioChat.openChat,fullscreen:null==d?void 0:d.twilioChat.fullscreen,side:null==d?void 0:d.twilioChat.side,chatClosing:"CUSTOMER"!==t.data.properties.ClosedBy})),(null==d?void 0:d.twilioChat.chatCaseId)&&(null===(l=null==P?void 0:P.current)||void 0===l||l.emit("leaveRoom",null==d?void 0:d.twilioChat.chatCaseId));break;case"MESSAGE_CREATED":ot(t.data)}})))},[null==d?void 0:d.twilioChat.chatCaseId]),u(function(){var t;X&&(G.current=null===(t=G.current)||void 0===t?void 0:t.filter(function(t){return!t.form}),z(G.current),I(),setTimeout(function(){var t=Array.from(new Map(n([X],G.current,!0).map(function(t){return[t.messageId,t]})).values());G.current=t;var l=e(e({},null==d?void 0:d.twilioChat),{messages:t,chatUnreaded:(null==d?void 0:d.twilioChat.chatConversationId)&&(!(null==d?void 0:d.twilioChat.openChat)||!(null==d?void 0:d.twilioChat.visibilityChange)),typingAgent:!1,agentId:null==d?void 0:d.twilioChat.agentId,lastTimeActive:Date.now()});E(H)&&(l=e(e({},l),{lastTimeActive:Date.now()})),null==d||d.goSetTwilioChat(l),I(),Z(null)},500))},[X]),u(function(){z(null==d?void 0:d.twilioChat.messages),G.current=null==d?void 0:d.twilioChat.messages},[null==d?void 0:d.twilioChat.messages]),u(function(){tt&&K.current.length>0&&!J?J=setInterval(function(){var t=[K.current[0],K.current.slice(1)||[]],e=t[0],n=t[1];K.current=n,Z(e),I(),0===K.current.length&&(et(!1),clearInterval(J))},600):tt||(et(!1),clearInterval(J))},[tt]);var nt=function(t){((null==d?void 0:d.twilioChat.chatActive)||(null==d?void 0:d.twilioChat.chatCaseId))&&setTimeout(function(){switch(t){case"new_customer":null==d||d.goSetTwilioChat(e(e({},null==d?void 0:d.twilioChat),{chatUserType:"NEW_CUSTOMER"})),K.current=y,et(!0);break;case"not_customer":null==d||d.goSetTwilioChat(e(e({},null==d?void 0:d.twilioChat),{chatUserType:"NOT_ACCOUNT_HOLDER"})),K.current=b,et(!0);break;case"old_customer":null==d||d.goSetTwilioChat(e(e({},null==d?void 0:d.twilioChat),{chatUserType:"ACCOUNT_HOLDER"})),K.current=p,et(!0);break;case"submit_form":V.full_name&&V.address&&"/"!==V.address&&V.email&&(null==d?void 0:d.twilioChat.chatUserType)&&("ACCOUNT_HOLDER"===(null==d?void 0:d.twilioChat.chatUserType)&&void 0!==V.last_bill||"ACCOUNT_HOLDER"!==(null==d?void 0:d.twilioChat.chatUserType))&&V.category&&lt("<b>".concat(g[null==d?void 0:d.twilioChat.chatUserType],"</b><br /><b>Full name</b>: ").concat(V.full_name,"<br /><b>Email</b>: ").concat(V.email,"<br /><b>Address</b>: ").concat(V.address,"<br />").concat(void 0!==V.last_bill?"<b>What was the total value of your last bill</b>: "+V.last_bill+"<br />":"","<b>What do you need help with today</b>: ").concat(w[V.category]))}},500)},lt=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return l(void 0,n([],t,!0),void 0,function(t){var n,l,i,a,r,s,c,u,h,v,m;return void 0===t&&(t=""),o(this,function(o){switch(o.label){case 0:return null==d||d.goSetTwilioChat(e(e({},null==d?void 0:d.twilioChat),{chatLoading:!0,chatUsername:V.full_name,chatEmail:V.email,chatCategory:V.category,chatAddress:V.address,chatLastBill:V.last_bill,visibilityChange:!0})),[4,x(V.email)];case 1:return(n=o.sent())?(null==d||d.goSetTwilioChat(e(e({},null==d?void 0:d.twilioChat),{token:n})),[4,S(V.full_name,V.email,V.address,V.last_bill,null==d?void 0:d.twilioChat.chatUserType,V.category,q)]):[3,3];case 2:return(l=o.sent())&&(i={},i=409===(null==l?void 0:l.statusCode)?(null===(a=null==l?void 0:l.data)||void 0===a?void 0:a.body)?{outage:!0,outageMessage:null===(r=null==l?void 0:l.data)||void 0===r?void 0:r.body,outageTitle:null===(s=null==l?void 0:l.data)||void 0===s?void 0:s.header,allowCreateChat:null===(c=null==l?void 0:l.data)||void 0===c?void 0:c.allowCreateChat}:{outage:!0,outageMessage:null==l?void 0:l.message,outageTitle:"Chat not available",allowCreateChat:!1}:201===(null==l?void 0:l.statusCode)&&(null==l?void 0:l.data)?{logged:!0,chatUserId:null===(u=null==l?void 0:l.data)||void 0===u?void 0:u.participantId,chatUsername:V.full_name,chatConversationId:null===(h=null==l?void 0:l.data)||void 0===h?void 0:h.conversationId,token:null===(v=null==l?void 0:l.data)||void 0===v?void 0:v.caseId,chatCaseId:null===(m=null==l?void 0:l.data)||void 0===m?void 0:m.caseId,messages:[],visibilityChange:!0}:{outage:!0,outageMessage:"Please try later, chat is not available at the moment.",outageTitle:"Chat not available",allowCreateChat:!1},null==d||d.goSetTwilioChat(e(e({},null==d?void 0:d.twilioChat),i)),it({id:"".concat(Date.now(),"-0000-0000-0000-000000000000"),type:"EVENT",title:"Waiting for the agent to join the chat."},null),U(t)),[3,4];case 3:null==d||d.goSetTwilioChat(e(e({},null==d?void 0:d.twilioChat),{chatLoading:!1})),o.label=4;case 4:return[2]}})})},ot=function(t,e){return l(void 0,void 0,void 0,function(){var e,n;return o(this,function(l){switch(l.label){case 0:if(!t||(null==d?void 0:d.twilioChat.messages.some(function(e){return e.messageId===t.id})))return[3,6];l.label=1;case 1:return l.trys.push([1,5,,6]),t.properties.Files?[4,_(t.properties.Files)]:[3,3];case 2:return e=l.sent(),0===Object.keys(e).length&&(e=null),it(t,e),[3,4];case 3:it(t,[]),l.label=4;case 4:return[3,6];case 5:return n=l.sent(),console.error("Error fetching message:",n),[3,6];case 6:return[2]}})})},it=function(t,e,l){var o={senderType:"EVENT"!==t.type?t.properties.SenderType:t.type,createdAt:m(new Date).format(),from:"EVENT"!==t.type?t.properties.From:t.type,message:"EVENT"!==t.type?t.properties.Body:t.title,form:null,files:e,messageId:t.id,fromId:"EVENT"!==t.type?t.createdBy.id:"YouFibre"};I(),K.current=n(n([],K.current,!0),[o],!1),et(!0)};return a.createElement(R,null,a.createElement(O,{id:"ChatContentList"},P.current&&a.createElement(A,{sc:P}),X&&a.createElement(a.Fragment,null,a.createElement(F,null,a.createElement(j,null),a.createElement(v,{item:X,buttonAction:nt,setChatForm:W}))),H&&H.map(function(t,e){return a.createElement(a.Fragment,null,t.senderType&&a.createElement(v,{item:t,buttonAction:nt,setChatForm:W}),Object.keys(H).length-1!==e&&a.createElement(j,null))})))},R=d.div(N||(N=i(["\n width: 100%;\n flex: 1;\n overflow-x: hidden;\n display: flex;\n flex-direction: column-reverse;\n"],["\n width: 100%;\n flex: 1;\n overflow-x: hidden;\n display: flex;\n flex-direction: column-reverse;\n"]))),F=d.div(k||(k=i(["\n &, .animation {\n width: 100%;\n display: flex;\n flex-direction: column;\n position: inherit;\n margin-bottom: -64px;\n animation: slideIn .4s cubic-bezier(0.41, 0.39, 0.53, 1.38) forwards;\n }\n @keyframes slideIn {\n from {\n margin-bottom: -64px;\n }\n to {\n margin-bottom: 0px;\n }\n }\n"],["\n &, .animation {\n width: 100%;\n display: flex;\n flex-direction: column;\n position: inherit;\n margin-bottom: -64px;\n animation: slideIn .4s cubic-bezier(0.41, 0.39, 0.53, 1.38) forwards;\n }\n @keyframes slideIn {\n from {\n margin-bottom: -64px;\n }\n to {\n margin-bottom: 0px;\n }\n }\n"])));export{L as default};
1
+ import{__makeTemplateObject as t,__rest as e,__assign as n,__spreadArray as l,__awaiter as o,__generator as i}from"../../../node_modules/tslib/tslib.es6.js";import a,{useContext as r,useState as s,useRef as c,useEffect as u}from"react";import d from"../../../node_modules/styled-components/dist/styled-components.browser.esm.js";import h from"../../context/ChatGlobalContext.js";import v from"./Message.js";import m from"../../../_virtual/moment.js";import{defaultMessages as C,initialTwilioChatState as f,userTypeLabels as w,categories as g,yesAccountHolder as p,notAccountHolder as b,newAccountHolder as y}from"../../utils/chats.js";import{connectToWebsocket as T,scrollToBottom as I,didAgentPost as E,getFiles as _,sendMessage as U,createConversation as S,getToken as x}from"../../services/chatService.js";import A from"./TypingIndicator.js";import O from"./styled/ChatContentList.js";import j from"./styled/Splitter.js";import D from"../../../node_modules/uuid/dist/esm-browser/v4.js";var N,k,L=function(t){e(t,[]);var d=r(h),N=s(null),k=N[0],L=N[1],M=s({}),V=M[0],W=M[1],B=s(C),H=B[0],z=B[1],G=c(H),P=c(null),Y=s(!0),q=Y[0];Y[1];var J,K=c([]),Q=s(null),X=Q[0],Z=Q[1],$=s(!1),tt=$[0],et=$[1];u(function(){},[]),u(function(){var t,e,n;if(null==d?void 0:d.twilioChat.chatUserId){var l=k||D();L(l),localStorage.setItem("chatSessionId",l),P.current||(P.current=T(l)),null===(t=P.current)||void 0===t||t.on("connect",function(){console.log("Connected to WebSocket server")}),null===(e=P.current)||void 0===e||e.on("connect_error",function(t){console.log("Connect error due to ".concat(t.message)),P.current=null,P.current=T(null==d?void 0:d.twilioChat.chatUserId)}),null===(n=P.current)||void 0===n||n.on("disconnect",function(t){console.log("Disconnected: ".concat(t)),P.current=null,P.current=T(null==d?void 0:d.twilioChat.chatUserId)})}else z(C)},[null==d?void 0:d.twilioChat.chatUserId]),u(function(){var t;(null==d?void 0:d.twilioChat.chatCaseId)&&(P.current&&(null==d?void 0:d.twilioChat.chatCaseId)&&P.current.emit("joinRoom",null==d?void 0:d.twilioChat.chatCaseId),P.current&&!P.current.listeners("case-event-".concat(null==d?void 0:d.twilioChat.chatCaseId)).length&&(null===(t=P.current)||void 0===t||t.on("case-event-".concat(null==d?void 0:d.twilioChat.chatCaseId),function(t){var e,l;switch(t.type){case"CASE_UPDATED":d.twilioChat.agentId=null===(e=t.data.properties)||void 0===e?void 0:e.OwnerId;break;case"CONVERSATION_CLOSED":null==d||d.goSetTwilioChat(n(n({},f),{openChat:null==d?void 0:d.twilioChat.openChat,fullscreen:null==d?void 0:d.twilioChat.fullscreen,side:null==d?void 0:d.twilioChat.side,chatClosing:"CUSTOMER"!==t.data.properties.ClosedBy})),(null==d?void 0:d.twilioChat.chatCaseId)&&(null===(l=null==P?void 0:P.current)||void 0===l||l.emit("leaveRoom",null==d?void 0:d.twilioChat.chatCaseId));break;case"MESSAGE_CREATED":ot(t.data)}})))},[null==d?void 0:d.twilioChat.chatCaseId]),u(function(){var t;X&&(G.current=null===(t=G.current)||void 0===t?void 0:t.filter(function(t){return!t.form}),z(G.current),I(),setTimeout(function(){var t=Array.from(new Map(l([X],G.current,!0).map(function(t){return[t.messageId,t]})).values());G.current=t;var e=n(n({},null==d?void 0:d.twilioChat),{messages:t,chatUnreaded:(null==d?void 0:d.twilioChat.chatConversationId)&&(!(null==d?void 0:d.twilioChat.openChat)||!(null==d?void 0:d.twilioChat.visibilityChange)),typingAgent:!1,agentId:null==d?void 0:d.twilioChat.agentId,lastTimeActive:Date.now()});E(H)&&(e=n(n({},e),{lastTimeActive:Date.now()})),null==d||d.goSetTwilioChat(e),I(),Z(null)},500))},[X]),u(function(){z(null==d?void 0:d.twilioChat.messages),G.current=null==d?void 0:d.twilioChat.messages},[null==d?void 0:d.twilioChat.messages]),u(function(){tt&&K.current.length>0&&!J?J=setInterval(function(){var t=[K.current[0],K.current.slice(1)||[]],e=t[0],n=t[1];K.current=n,Z(e),I(),0===K.current.length&&(et(!1),clearInterval(J))},600):tt||(et(!1),clearInterval(J))},[tt]);var nt=function(t){((null==d?void 0:d.twilioChat.chatActive)||(null==d?void 0:d.twilioChat.chatCaseId))&&setTimeout(function(){switch(t){case"new_customer":null==d||d.goSetTwilioChat(n(n({},null==d?void 0:d.twilioChat),{chatUserType:"NEW_CUSTOMER"})),K.current=y,et(!0);break;case"not_customer":null==d||d.goSetTwilioChat(n(n({},null==d?void 0:d.twilioChat),{chatUserType:"NOT_ACCOUNT_HOLDER"})),K.current=b,et(!0);break;case"old_customer":null==d||d.goSetTwilioChat(n(n({},null==d?void 0:d.twilioChat),{chatUserType:"ACCOUNT_HOLDER"})),K.current=p,et(!0);break;case"submit_form":V.full_name&&V.address&&"/"!==V.address&&V.email&&(null==d?void 0:d.twilioChat.chatUserType)&&("ACCOUNT_HOLDER"===(null==d?void 0:d.twilioChat.chatUserType)&&void 0!==V.last_bill||"ACCOUNT_HOLDER"!==(null==d?void 0:d.twilioChat.chatUserType))&&V.category&&lt("<b>".concat(w[null==d?void 0:d.twilioChat.chatUserType],"</b><br /><b>Full name</b>: ").concat(V.full_name,"<br /><b>Email</b>: ").concat(V.email,"<br /><b>Address</b>: ").concat(V.address,"<br />").concat(void 0!==V.last_bill?"<b>What was the total value of your last bill</b>: "+V.last_bill+"<br />":"","<b>What do you need help with today</b>: ").concat(g[V.category]))}},500)},lt=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o(void 0,l([],t,!0),void 0,function(t){var e,l,o,a,r,s,c,u,h,v,m;return void 0===t&&(t=""),i(this,function(i){switch(i.label){case 0:return null==d||d.goSetTwilioChat(n(n({},null==d?void 0:d.twilioChat),{chatLoading:!0,chatUsername:V.full_name,chatEmail:V.email,chatCategory:V.category,chatAddress:V.address,chatLastBill:V.last_bill,visibilityChange:!0})),[4,x(V.email)];case 1:return(e=i.sent())?(null==d||d.goSetTwilioChat(n(n({},null==d?void 0:d.twilioChat),{token:e})),[4,S(V.full_name,V.email,V.address,V.last_bill,null==d?void 0:d.twilioChat.chatUserType,V.category,q)]):[3,3];case 2:return(l=i.sent())&&(o={},o=409===(null==l?void 0:l.statusCode)?(null===(a=null==l?void 0:l.data)||void 0===a?void 0:a.body)?{outage:!0,outageMessage:null===(r=null==l?void 0:l.data)||void 0===r?void 0:r.body,outageTitle:null===(s=null==l?void 0:l.data)||void 0===s?void 0:s.header,allowCreateChat:null===(c=null==l?void 0:l.data)||void 0===c?void 0:c.allowCreateChat}:{outage:!0,outageMessage:null==l?void 0:l.message,outageTitle:"Chat not available",allowCreateChat:!1}:201===(null==l?void 0:l.statusCode)&&(null==l?void 0:l.data)?{logged:!0,chatUserId:null===(u=null==l?void 0:l.data)||void 0===u?void 0:u.participantId,chatUsername:V.full_name,chatConversationId:null===(h=null==l?void 0:l.data)||void 0===h?void 0:h.conversationId,token:null===(v=null==l?void 0:l.data)||void 0===v?void 0:v.caseId,chatCaseId:null===(m=null==l?void 0:l.data)||void 0===m?void 0:m.caseId,messages:[],visibilityChange:!0}:{outage:!0,outageMessage:"Please try later, chat is not available at the moment.",outageTitle:"Chat not available",allowCreateChat:!1},null==d||d.goSetTwilioChat(n(n({},null==d?void 0:d.twilioChat),o)),it({id:"".concat(Date.now(),"-0000-0000-0000-000000000000"),type:"EVENT",title:"Waiting for the agent to join the chat."},null),U(t)),[3,4];case 3:null==d||d.goSetTwilioChat(n(n({},null==d?void 0:d.twilioChat),{chatLoading:!1})),i.label=4;case 4:return[2]}})})},ot=function(t,e){return o(void 0,void 0,void 0,function(){var e,n;return i(this,function(l){switch(l.label){case 0:if(!t||(null==d?void 0:d.twilioChat.messages.some(function(e){return e.messageId===t.id})))return[3,6];l.label=1;case 1:return l.trys.push([1,5,,6]),t.properties.Files?[4,_(t.properties.Files)]:[3,3];case 2:return e=l.sent(),0===Object.keys(e).length&&(e=null),it(t,e),[3,4];case 3:it(t,[]),l.label=4;case 4:return[3,6];case 5:return n=l.sent(),console.error("Error fetching message:",n),[3,6];case 6:return[2]}})})},it=function(t,e,n){var o={senderType:"EVENT"!==t.type?t.properties.SenderType:t.type,createdAt:m(new Date).format(),from:"EVENT"!==t.type?t.properties.From:t.type,message:"EVENT"!==t.type?t.properties.Body:t.title,form:null,files:e,messageId:t.id,fromId:"EVENT"!==t.type?t.createdBy.id:"YouFibre"};I(),K.current=l(l([],K.current,!0),[o],!1),et(!0)};return"undefined"==typeof window?null:a.createElement(R,null,a.createElement(O,{id:"ChatContentList"},P.current&&a.createElement(A,{sc:P}),X&&a.createElement(a.Fragment,null,a.createElement(F,null,a.createElement(j,null),a.createElement(v,{item:X,buttonAction:nt,setChatForm:W}))),H&&H.map(function(t,e){return a.createElement(a.Fragment,null,t.senderType&&a.createElement(v,{item:t,buttonAction:nt,setChatForm:W}),Object.keys(H).length-1!==e&&a.createElement(j,null))})))},R=d.div(N||(N=t(["\n width: 100%;\n flex: 1;\n overflow-x: hidden;\n display: flex;\n flex-direction: column-reverse;\n"],["\n width: 100%;\n flex: 1;\n overflow-x: hidden;\n display: flex;\n flex-direction: column-reverse;\n"]))),F=d.div(k||(k=t(["\n &, .animation {\n width: 100%;\n display: flex;\n flex-direction: column;\n position: inherit;\n margin-bottom: -64px;\n animation: slideIn .4s cubic-bezier(0.41, 0.39, 0.53, 1.38) forwards;\n }\n @keyframes slideIn {\n from {\n margin-bottom: -64px;\n }\n to {\n margin-bottom: 0px;\n }\n }\n"],["\n &, .animation {\n width: 100%;\n display: flex;\n flex-direction: column;\n position: inherit;\n margin-bottom: -64px;\n animation: slideIn .4s cubic-bezier(0.41, 0.39, 0.53, 1.38) forwards;\n }\n @keyframes slideIn {\n from {\n margin-bottom: -64px;\n }\n to {\n margin-bottom: 0px;\n }\n }\n"])));export{L as default};
2
2
  //# sourceMappingURL=MessageList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MessageList.js","sources":["../../../../src/TwilioChat/components/MessageList.tsx"],"sourcesContent":["import React, { useContext, useState, useEffect, useRef } from \"react\";\nimport { io, Socket } from 'socket.io-client';\nimport styled from 'styled-components';\nimport ChatGlobalContext from \"../../context/ChatGlobalContext\";\nimport Message from \"./Message\";\nimport moment from 'moment';\nimport { categories, defaultMessages, initialTwilioChatState, newAccountHolder, notAccountHolder, userTypeLabels, yesAccountHolder } from \"../../utils/chats\";\nimport { connectToWebsocket, createConversation, didAgentPost, getAllMessages, getFiles, getToken, scrollToBottom, sendMessage } from \"../../services/chatService\";\nimport { v4 as uuidv4 } from 'uuid';\nimport TypingIndicator from \"./TypingIndicator\";\nimport ChatContentList from \"./styled/ChatContentList\";\nimport Splitter from \"./styled/Splitter\";\n\ninterface Message {\n createdAt: string;\n from?: string | null;\n files?: string | null;\n message: string | null;\n form: FormType | null;\n messageId: string;\n fromId: string;\n senderType: string;\n}\n\ninterface FormType {\n type: string;\n value: Array<{ title: string; action: string; placeholder?: string | null; type?: string; required?: boolean; options?:object }>;\n}\n \ntype UserType = 'NEW_CUSTOMER' | 'ACCOUNT_HOLDER' | 'NOT_ACCOUNT_HOLDER';\n\nconst MessageList = ({...props}) => {\n const gContext: any = useContext(ChatGlobalContext);\n const [chatSessionId, setChatSessionId] = useState<string | null>(null);\n const [chatForm, setChatForm] = useState<{ [key: string]: any }>({});\n const [messages, setMessages] = useState<Message[]>(defaultMessages);\n const messagesRef = useRef<Message[]>(messages);\n const sc = useRef<Socket | null>(null);\n\n const [allowCreateChat, setAllowCreateChat] = useState(true);\n const messageRef = useRef<Message[]>([]);\n const [message, setMessage] = useState<Message|null>(null);\n const [newMessage, setNewMessage] = useState<boolean>(false);\n\n useEffect(() => {\n \n }, []);\n \n useEffect(() => {\n if(gContext?.twilioChat.chatUserId){\n const tmpUUID = chatSessionId || uuidv4();\n setChatSessionId(tmpUUID);\n localStorage.setItem('chatSessionId', tmpUUID); \n if(!sc.current) sc.current = connectToWebsocket(tmpUUID);\n sc.current?.on('connect', () => {\n console.log('Connected to WebSocket server');\n });\n sc.current?.on(\"connect_error\", (err) => {\n console.log(`Connect error due to ${err.message}`);\n sc.current = null;\n sc.current = connectToWebsocket(gContext?.twilioChat.chatUserId);\n }); \n sc.current?.on(\"disconnect\", (reason) => {\n console.log(`Disconnected: ${reason}`);\n sc.current = null;\n sc.current = connectToWebsocket(gContext?.twilioChat.chatUserId);\n });\n } else {\n setMessages(defaultMessages);\n }\n }, [gContext?.twilioChat.chatUserId]);\n \n useEffect(() => {\n if(gContext?.twilioChat.chatCaseId){\n // Subscribe to room with Case ID\n sc.current && gContext?.twilioChat.chatCaseId && sc.current.emit(\"joinRoom\", gContext?.twilioChat.chatCaseId); \n // Listen events only for our Case/Conversation\n sc.current && !sc.current.listeners(`case-event-${gContext?.twilioChat.chatCaseId}`).length && sc.current?.on(`case-event-${gContext?.twilioChat.chatCaseId}`, (data) => { \n switch(data.type){\n case \"CASE_UPDATED\": \n gContext.twilioChat.agentId = data.data.properties?.OwnerId;\n // gContext?.goSetTwilioChat({...gContext?.twilioChat, agentId: gContext?.twilioChat.agentId});\n break;\n case \"CONVERSATION_CLOSED\":\n gContext?.goSetTwilioChat({\n ...initialTwilioChatState,\n openChat: gContext?.twilioChat.openChat,\n fullscreen: gContext?.twilioChat.fullscreen,\n side: gContext?.twilioChat.side,\n chatClosing: data.data.properties.ClosedBy !== 'CUSTOMER'\n });\n gContext?.twilioChat.chatCaseId && sc?.current?.emit(\"leaveRoom\", gContext?.twilioChat.chatCaseId);\n break;\n case \"MESSAGE_CREATED\": receiveMessage(data.data, true); break;\n default: break;\n }\n });\n }\n }, [gContext?.twilioChat.chatCaseId]);\n \n useEffect(() => {\n if(message){\n messagesRef.current = messagesRef.current?.filter(item => !item.form);\n setMessages(messagesRef.current);\n scrollToBottom();\n setTimeout(() => {\n // Merge new messages with existing ones with unique messageId\n const tmpMessages = Array.from(new Map([message, ...messagesRef.current].map(item => [item.messageId, item])).values());\n messagesRef.current = tmpMessages;\n let tmpState = {\n ...gContext?.twilioChat, \n messages: tmpMessages, \n chatUnreaded: gContext?.twilioChat.chatConversationId && (!gContext?.twilioChat.openChat || !gContext?.twilioChat.visibilityChange),\n typingAgent: false, \n agentId: gContext?.twilioChat.agentId, \n lastTimeActive: Date.now()\n };\n // Check if Agent has posted to start timer\n if(didAgentPost(messages)){ \n tmpState = {...tmpState, lastTimeActive: Date.now()};\n } \n gContext?.goSetTwilioChat(tmpState);\n scrollToBottom();\n setMessage(null);\n }, 500);\n }\n }, [message]);\n \n useEffect(() => {\n setMessages(gContext?.twilioChat.messages);\n messagesRef.current = gContext?.twilioChat.messages;\n }, [gContext?.twilioChat.messages]);\n \n let newMessageInterval:any;\n \n useEffect(() => {\n // Buffer for new messages\n if(newMessage && messageRef.current.length > 0 && !newMessageInterval){\n newMessageInterval = setInterval(() => {\n const [first, rest] = [messageRef.current[0], messageRef.current.slice(1) || []];\n messageRef.current = rest;\n setMessage(first);\n scrollToBottom();\n if(messageRef.current.length === 0){\n setNewMessage(false);\n clearInterval(newMessageInterval);\n }\n }, 600); \n } else if (!newMessage) {\n setNewMessage(false);\n clearInterval(newMessageInterval);\n } else {\n\n }\n }, [newMessage]);\n \n const buttonAction = (action) => {\n if(gContext?.twilioChat.chatActive || gContext?.twilioChat.chatCaseId){\n setTimeout(() => {\n switch(action){\n case 'new_customer': \n gContext?.goSetTwilioChat({...gContext?.twilioChat, chatUserType: 'NEW_CUSTOMER'});\n messageRef.current = newAccountHolder;\n setNewMessage(true);\n break;\n case 'not_customer': \n gContext?.goSetTwilioChat({...gContext?.twilioChat, chatUserType: 'NOT_ACCOUNT_HOLDER'});\n messageRef.current = notAccountHolder;\n setNewMessage(true);\n break;\n case 'old_customer': \n gContext?.goSetTwilioChat({...gContext?.twilioChat, chatUserType: 'ACCOUNT_HOLDER'});\n messageRef.current = yesAccountHolder;\n setNewMessage(true);\n break;\n case 'submit_form':\n chatForm.full_name && \n chatForm.address && chatForm.address !== '/' && \n chatForm.email && \n gContext?.twilioChat.chatUserType && \n (((gContext?.twilioChat.chatUserType === \"ACCOUNT_HOLDER\") && typeof chatForm.last_bill !== \"undefined\") || (gContext?.twilioChat.chatUserType !== \"ACCOUNT_HOLDER\")) &&\n chatForm.category && \n submitForm(`<b>${userTypeLabels[gContext?.twilioChat.chatUserType]}</b><br /><b>Full name</b>: ${chatForm.full_name}<br /><b>Email</b>: ${chatForm.email}<br /><b>Address</b>: ${chatForm.address}<br />${(typeof chatForm.last_bill !== 'undefined')?'<b>What was the total value of your last bill</b>: '+chatForm.last_bill+'<br />':''}<b>What do you need help with today</b>: ${categories[chatForm.category]}`);\n break;\n default: break;\n }\n }, 500);\n }\n };\n\n const submitForm = async (message:string = '') => { \n gContext?.goSetTwilioChat({...gContext?.twilioChat, \n chatLoading: true,\n chatUsername: chatForm.full_name,\n chatEmail: chatForm.email,\n chatCategory: chatForm.category,\n chatAddress: chatForm.address,\n chatLastBill: chatForm.last_bill,\n visibilityChange: true\n });\n\n // Create Token \n const tmpToken = await getToken(chatForm.email);\n if(tmpToken){\n gContext?.goSetTwilioChat({...gContext?.twilioChat, \n token: tmpToken\n });\n // Create Conversation \n const tmpConversation = await createConversation(\n chatForm.full_name,\n chatForm.email,\n chatForm.address,\n chatForm.last_bill,\n gContext?.twilioChat.chatUserType,\n chatForm.category,\n allowCreateChat\n );\n if(tmpConversation){\n let tmpMessage:any = {};\n if (tmpConversation?.statusCode === 409) {\n tmpMessage = tmpConversation?.data?.body ? {\n outage: true,\n outageMessage: tmpConversation?.data?.body,\n outageTitle: tmpConversation?.data?.header,\n allowCreateChat: tmpConversation?.data?.allowCreateChat,\n } : {\n outage: true,\n outageMessage: tmpConversation?.message,\n outageTitle: 'Chat not available',\n allowCreateChat: false,\n };\n } else if (tmpConversation?.statusCode === 201 && tmpConversation?.data) {\n tmpMessage = {\n logged: true,\n chatUserId: tmpConversation?.data?.participantId,\n chatUsername: chatForm.full_name,\n chatConversationId: tmpConversation?.data?.conversationId,\n token: tmpConversation?.data?.caseId,\n chatCaseId: tmpConversation?.data?.caseId,\n messages: [],\n visibilityChange: true\n };\n } else {\n tmpMessage = {\n outage: true,\n outageMessage: 'Please try later, chat is not available at the moment.',\n outageTitle: 'Chat not available',\n allowCreateChat: false,\n };\n }\n gContext?.goSetTwilioChat({...gContext?.twilioChat, ...tmpMessage});\n updateMessage({\n id: `${Date.now()}-0000-0000-0000-000000000000`,\n type: 'EVENT',\n title: 'Waiting for the agent to join the chat.'},\n null, true);\n sendMessage(message); \n } \n } else {\n gContext?.goSetTwilioChat({...gContext?.twilioChat, chatLoading: false});\n }\n };\n \n const receiveMessage = async (data:any, resetTimer:boolean) => {\n if(data && !gContext?.twilioChat.messages.some(obj => obj.messageId === data.id)){\n try{\n if(data.properties.Files){\n let tmpFiles:any = await getFiles(data.properties.Files);\n if(Object.keys(tmpFiles).length === 0) tmpFiles = null;\n updateMessage(data, tmpFiles, resetTimer);\n } else {\n updateMessage(data, [], resetTimer);\n }\n } catch (error) {\n console.error('Error fetching message:', error);\n }\n }\n };\n\n const updateMessage = (data: any, files:any, resetTimer:boolean) => {\n let tmpMessage:Message = {\n senderType: data.type !== 'EVENT' ? data.properties.SenderType : data.type,\n createdAt: moment(new Date()).format(),\n from: data.type !== 'EVENT' ? data.properties.From : data.type,\n message: data.type !== 'EVENT' ? data.properties.Body : data.title,\n form: null,\n files: files,\n messageId: data.id,\n fromId: data.type !== 'EVENT' ? data.createdBy.id : \"YouFibre\"\n };\n scrollToBottom();\n messageRef.current = [ ...messageRef.current, tmpMessage];\n setNewMessage(true);\n };\n\n return (\n <ChatArea>\n <ChatContentList id='ChatContentList'>\n { sc.current && <TypingIndicator sc={sc} /> }\n { message && <><Animation> \n <Splitter /> \n {/* { (Object.keys(message).length - 1) !== i && <Splitter /> } */}\n <Message item={message} buttonAction={buttonAction} setChatForm={setChatForm} />\n </Animation></>\n }\n { messages && messages.map((item, index) => \n <>\n { item.senderType && <Message item={item} buttonAction={buttonAction} setChatForm={setChatForm} /> }\n { (Object.keys(messages).length - 1) !== index && <Splitter /> }\n </>\n )}\n </ChatContentList>\n </ChatArea>\n );\n};\n\nconst ChatArea = styled.div`\n width: 100%;\n flex: 1;\n overflow-x: hidden;\n display: flex;\n flex-direction: column-reverse;\n`;\n\nconst Animation = styled.div`\n &, .animation {\n width: 100%;\n display: flex;\n flex-direction: column;\n position: inherit;\n margin-bottom: -64px;\n animation: slideIn .4s cubic-bezier(0.41, 0.39, 0.53, 1.38) forwards;\n }\n @keyframes slideIn {\n from {\n margin-bottom: -64px;\n }\n to {\n margin-bottom: 0px;\n }\n }\n`;\n\nexport default MessageList;\n"],"names":["MessageList","_a","__rest","gContext","useContext","ChatGlobalContext","_b","useState","chatSessionId","setChatSessionId","_c","chatForm","setChatForm","_d","defaultMessages","messages","setMessages","messagesRef","useRef","sc","_e","allowCreateChat","newMessageInterval","messageRef","_f","message","setMessage","_g","newMessage","setNewMessage","useEffect","twilioChat","chatUserId","tmpUUID","uuidv4","localStorage","setItem","current","connectToWebsocket","on","console","log","err","concat","reason","chatCaseId","emit","listeners","length","data","type","agentId","properties","OwnerId","goSetTwilioChat","__assign","initialTwilioChatState","openChat","fullscreen","side","chatClosing","ClosedBy","receiveMessage","filter","item","form","scrollToBottom","setTimeout","tmpMessages","Array","from","Map","__spreadArray","map","messageId","values","tmpState","chatUnreaded","chatConversationId","visibilityChange","typingAgent","lastTimeActive","Date","now","didAgentPost","setInterval","slice","first","rest","clearInterval","buttonAction","action","chatActive","chatUserType","newAccountHolder","notAccountHolder","yesAccountHolder","full_name","address","email","last_bill","category","submitForm","userTypeLabels","categories","chatLoading","chatUsername","chatEmail","chatCategory","chatAddress","chatLastBill","getToken","tmpToken","_j","sent","token","createConversation","tmpConversation","tmpMessage","statusCode","body","outage","outageMessage","outageTitle","header","logged","participantId","conversationId","caseId","_h","updateMessage","id","title","sendMessage","resetTimer","__awaiter","some","obj","Files","getFiles","tmpFiles","Object","keys","error","error_1","files","senderType","SenderType","createdAt","moment","format","From","Body","fromId","createdBy","React","ChatArea","createElement","ChatContentList","TypingIndicator","Fragment","Animation","Splitter","Message","index","styled","div","templateObject_1","__makeTemplateObject","templateObject_2"],"mappings":"69BA+BA,QAAMA,EAAc,SAACC,GAASC,EAAAD,EAAT,IACnB,IAAME,EAAg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dxG,EAAKC,KAAmBD,EAAKyG,UAAUvB,GAAK,YAEtDjE,IACA3C,EAAWc,QAAOmC,EAAAA,EAAA,GAAQjD,EAAWc,SAAO,GAAA,CAAEiF,IAAU,GACxDzF,IAAc,EAChB,EAEA,OACE8H,gBAACC,EAAQ,KACPD,EAAAE,cAACC,EAAe,CAAC3B,GAAG,mBAChBhH,EAAGkB,SAAWsH,EAAAE,cAACE,EAAe,CAAC5I,GAAIA,IACnCM,GAAWkI,EAAAE,cAAAF,EAAAK,SAAA,KAAEL,EAAAE,cAACI,EAAS,KACvBN,EAAAE,cAACK,EAAQ,MAEPP,EAAAE,cAACM,EAAO,CAACnG,KAAMvC,EAASiE,aAAcA,GAAc9E,YAAaA,MAGnEG,GAAYA,EAAS0D,IAAI,SAACT,EAAMoG,GAChC,OAAAT,EAAAE,cAAAF,EAAAK,SAAA,KACEhG,EAAKkF,YAAcS,EAAAE,cAACM,GAAQnG,KAAMA,EAAM0B,aAAcA,GAAc9E,YAAaA,IAChFiI,OAAOC,KAAK/H,GAAUiC,OAAS,IAAOoH,GAAUT,EAAAE,cAACK,QAFpD,IAQV,EAEMN,EAAWS,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,8GAAA,CAAA,iHAQrBP,EAAYI,EAAOC,IAAGG,IAAAA,EAAAD,EAAA,CAAA,wVAAA,CAAA"}
1
+ {"version":3,"file":"MessageList.js","sources":["../../../../src/TwilioChat/components/MessageList.tsx"],"sourcesContent":["import React, { useContext, useState, useEffect, useRef } from \"react\";\nimport { io, Socket } from 'socket.io-client';\nimport styled from 'styled-components';\nimport ChatGlobalContext from \"../../context/ChatGlobalContext\";\nimport Message from \"./Message\";\nimport moment from 'moment';\nimport { categories, defaultMessages, initialTwilioChatState, newAccountHolder, notAccountHolder, userTypeLabels, yesAccountHolder } from \"../../utils/chats\";\nimport { connectToWebsocket, createConversation, didAgentPost, getAllMessages, getFiles, getToken, scrollToBottom, sendMessage } from \"../../services/chatService\";\nimport { v4 as uuidv4 } from 'uuid';\nimport TypingIndicator from \"./TypingIndicator\";\nimport ChatContentList from \"./styled/ChatContentList\";\nimport Splitter from \"./styled/Splitter\";\n\ninterface Message {\n createdAt: string;\n from?: string | null;\n files?: string | null;\n message: string | null;\n form: FormType | null;\n messageId: string;\n fromId: string;\n senderType: string;\n}\n\ninterface FormType {\n type: string;\n value: Array<{ title: string; action: string; placeholder?: string | null; type?: string; required?: boolean; options?:object }>;\n}\n \ntype UserType = 'NEW_CUSTOMER' | 'ACCOUNT_HOLDER' | 'NOT_ACCOUNT_HOLDER';\n\nconst MessageList = ({...props}) => {\n const gContext: any = useContext(ChatGlobalContext);\n const [chatSessionId, setChatSessionId] = useState<string | null>(null);\n const [chatForm, setChatForm] = useState<{ [key: string]: any }>({});\n const [messages, setMessages] = useState<Message[]>(defaultMessages);\n const messagesRef = useRef<Message[]>(messages);\n const sc = useRef<Socket | null>(null);\n\n const [allowCreateChat, setAllowCreateChat] = useState(true);\n const messageRef = useRef<Message[]>([]);\n const [message, setMessage] = useState<Message|null>(null);\n const [newMessage, setNewMessage] = useState<boolean>(false);\n\n useEffect(() => {\n \n }, []);\n \n useEffect(() => {\n if(gContext?.twilioChat.chatUserId){\n const tmpUUID = chatSessionId || uuidv4();\n setChatSessionId(tmpUUID);\n localStorage.setItem('chatSessionId', tmpUUID); \n if(!sc.current) sc.current = connectToWebsocket(tmpUUID);\n sc.current?.on('connect', () => {\n console.log('Connected to WebSocket server');\n });\n sc.current?.on(\"connect_error\", (err) => {\n console.log(`Connect error due to ${err.message}`);\n sc.current = null;\n sc.current = connectToWebsocket(gContext?.twilioChat.chatUserId);\n }); \n sc.current?.on(\"disconnect\", (reason) => {\n console.log(`Disconnected: ${reason}`);\n sc.current = null;\n sc.current = connectToWebsocket(gContext?.twilioChat.chatUserId);\n });\n } else {\n setMessages(defaultMessages);\n }\n }, [gContext?.twilioChat.chatUserId]);\n \n useEffect(() => {\n if(gContext?.twilioChat.chatCaseId){\n // Subscribe to room with Case ID\n sc.current && gContext?.twilioChat.chatCaseId && sc.current.emit(\"joinRoom\", gContext?.twilioChat.chatCaseId); \n // Listen events only for our Case/Conversation\n sc.current && !sc.current.listeners(`case-event-${gContext?.twilioChat.chatCaseId}`).length && sc.current?.on(`case-event-${gContext?.twilioChat.chatCaseId}`, (data) => { \n switch(data.type){\n case \"CASE_UPDATED\": \n gContext.twilioChat.agentId = data.data.properties?.OwnerId;\n // gContext?.goSetTwilioChat({...gContext?.twilioChat, agentId: gContext?.twilioChat.agentId});\n break;\n case \"CONVERSATION_CLOSED\":\n gContext?.goSetTwilioChat({\n ...initialTwilioChatState,\n openChat: gContext?.twilioChat.openChat,\n fullscreen: gContext?.twilioChat.fullscreen,\n side: gContext?.twilioChat.side,\n chatClosing: data.data.properties.ClosedBy !== 'CUSTOMER'\n });\n gContext?.twilioChat.chatCaseId && sc?.current?.emit(\"leaveRoom\", gContext?.twilioChat.chatCaseId);\n break;\n case \"MESSAGE_CREATED\": receiveMessage(data.data, true); break;\n default: break;\n }\n });\n }\n }, [gContext?.twilioChat.chatCaseId]);\n \n useEffect(() => {\n if(message){\n messagesRef.current = messagesRef.current?.filter(item => !item.form);\n setMessages(messagesRef.current);\n scrollToBottom();\n setTimeout(() => {\n // Merge new messages with existing ones with unique messageId\n const tmpMessages = Array.from(new Map([message, ...messagesRef.current].map(item => [item.messageId, item])).values());\n messagesRef.current = tmpMessages;\n let tmpState = {\n ...gContext?.twilioChat, \n messages: tmpMessages, \n chatUnreaded: gContext?.twilioChat.chatConversationId && (!gContext?.twilioChat.openChat || !gContext?.twilioChat.visibilityChange),\n typingAgent: false, \n agentId: gContext?.twilioChat.agentId, \n lastTimeActive: Date.now()\n };\n // Check if Agent has posted to start timer\n if(didAgentPost(messages)){ \n tmpState = {...tmpState, lastTimeActive: Date.now()};\n } \n gContext?.goSetTwilioChat(tmpState);\n scrollToBottom();\n setMessage(null);\n }, 500);\n }\n }, [message]);\n \n useEffect(() => {\n setMessages(gContext?.twilioChat.messages);\n messagesRef.current = gContext?.twilioChat.messages;\n }, [gContext?.twilioChat.messages]);\n \n let newMessageInterval:any;\n \n useEffect(() => {\n // Buffer for new messages\n if(newMessage && messageRef.current.length > 0 && !newMessageInterval){\n newMessageInterval = setInterval(() => {\n const [first, rest] = [messageRef.current[0], messageRef.current.slice(1) || []];\n messageRef.current = rest;\n setMessage(first);\n scrollToBottom();\n if(messageRef.current.length === 0){\n setNewMessage(false);\n clearInterval(newMessageInterval);\n }\n }, 600); \n } else if (!newMessage) {\n setNewMessage(false);\n clearInterval(newMessageInterval);\n } else {\n\n }\n }, [newMessage]);\n \n const buttonAction = (action) => {\n if(gContext?.twilioChat.chatActive || gContext?.twilioChat.chatCaseId){\n setTimeout(() => {\n switch(action){\n case 'new_customer': \n gContext?.goSetTwilioChat({...gContext?.twilioChat, chatUserType: 'NEW_CUSTOMER'});\n messageRef.current = newAccountHolder;\n setNewMessage(true);\n break;\n case 'not_customer': \n gContext?.goSetTwilioChat({...gContext?.twilioChat, chatUserType: 'NOT_ACCOUNT_HOLDER'});\n messageRef.current = notAccountHolder;\n setNewMessage(true);\n break;\n case 'old_customer': \n gContext?.goSetTwilioChat({...gContext?.twilioChat, chatUserType: 'ACCOUNT_HOLDER'});\n messageRef.current = yesAccountHolder;\n setNewMessage(true);\n break;\n case 'submit_form':\n chatForm.full_name && \n chatForm.address && chatForm.address !== '/' && \n chatForm.email && \n gContext?.twilioChat.chatUserType && \n (((gContext?.twilioChat.chatUserType === \"ACCOUNT_HOLDER\") && typeof chatForm.last_bill !== \"undefined\") || (gContext?.twilioChat.chatUserType !== \"ACCOUNT_HOLDER\")) &&\n chatForm.category && \n submitForm(`<b>${userTypeLabels[gContext?.twilioChat.chatUserType]}</b><br /><b>Full name</b>: ${chatForm.full_name}<br /><b>Email</b>: ${chatForm.email}<br /><b>Address</b>: ${chatForm.address}<br />${(typeof chatForm.last_bill !== 'undefined')?'<b>What was the total value of your last bill</b>: '+chatForm.last_bill+'<br />':''}<b>What do you need help with today</b>: ${categories[chatForm.category]}`);\n break;\n default: break;\n }\n }, 500);\n }\n };\n\n const submitForm = async (message:string = '') => { \n gContext?.goSetTwilioChat({...gContext?.twilioChat, \n chatLoading: true,\n chatUsername: chatForm.full_name,\n chatEmail: chatForm.email,\n chatCategory: chatForm.category,\n chatAddress: chatForm.address,\n chatLastBill: chatForm.last_bill,\n visibilityChange: true\n });\n\n // Create Token \n const tmpToken = await getToken(chatForm.email);\n if(tmpToken){\n gContext?.goSetTwilioChat({...gContext?.twilioChat, \n token: tmpToken\n });\n // Create Conversation \n const tmpConversation = await createConversation(\n chatForm.full_name,\n chatForm.email,\n chatForm.address,\n chatForm.last_bill,\n gContext?.twilioChat.chatUserType,\n chatForm.category,\n allowCreateChat\n );\n if(tmpConversation){\n let tmpMessage:any = {};\n if (tmpConversation?.statusCode === 409) {\n tmpMessage = tmpConversation?.data?.body ? {\n outage: true,\n outageMessage: tmpConversation?.data?.body,\n outageTitle: tmpConversation?.data?.header,\n allowCreateChat: tmpConversation?.data?.allowCreateChat,\n } : {\n outage: true,\n outageMessage: tmpConversation?.message,\n outageTitle: 'Chat not available',\n allowCreateChat: false,\n };\n } else if (tmpConversation?.statusCode === 201 && tmpConversation?.data) {\n tmpMessage = {\n logged: true,\n chatUserId: tmpConversation?.data?.participantId,\n chatUsername: chatForm.full_name,\n chatConversationId: tmpConversation?.data?.conversationId,\n token: tmpConversation?.data?.caseId,\n chatCaseId: tmpConversation?.data?.caseId,\n messages: [],\n visibilityChange: true\n };\n } else {\n tmpMessage = {\n outage: true,\n outageMessage: 'Please try later, chat is not available at the moment.',\n outageTitle: 'Chat not available',\n allowCreateChat: false,\n };\n }\n gContext?.goSetTwilioChat({...gContext?.twilioChat, ...tmpMessage});\n updateMessage({\n id: `${Date.now()}-0000-0000-0000-000000000000`,\n type: 'EVENT',\n title: 'Waiting for the agent to join the chat.'},\n null, true);\n sendMessage(message); \n } \n } else {\n gContext?.goSetTwilioChat({...gContext?.twilioChat, chatLoading: false});\n }\n };\n \n const receiveMessage = async (data:any, resetTimer:boolean) => {\n if(data && !gContext?.twilioChat.messages.some(obj => obj.messageId === data.id)){\n try{\n if(data.properties.Files){\n let tmpFiles:any = await getFiles(data.properties.Files);\n if(Object.keys(tmpFiles).length === 0) tmpFiles = null;\n updateMessage(data, tmpFiles, resetTimer);\n } else {\n updateMessage(data, [], resetTimer);\n }\n } catch (error) {\n console.error('Error fetching message:', error);\n }\n }\n };\n\n const updateMessage = (data: any, files:any, resetTimer:boolean) => {\n let tmpMessage:Message = {\n senderType: data.type !== 'EVENT' ? data.properties.SenderType : data.type,\n createdAt: moment(new Date()).format(),\n from: data.type !== 'EVENT' ? data.properties.From : data.type,\n message: data.type !== 'EVENT' ? data.properties.Body : data.title,\n form: null,\n files: files,\n messageId: data.id,\n fromId: data.type !== 'EVENT' ? data.createdBy.id : \"YouFibre\"\n };\n scrollToBottom();\n messageRef.current = [ ...messageRef.current, tmpMessage];\n setNewMessage(true);\n };\n\n return typeof window === \"undefined\"\n ? null\n : (\n <ChatArea>\n <ChatContentList id='ChatContentList'>\n { sc.current && <TypingIndicator sc={sc} /> }\n { message && <><Animation> \n <Splitter /> \n {/* { (Object.keys(message).length - 1) !== i && <Splitter /> } */}\n <Message item={message} buttonAction={buttonAction} setChatForm={setChatForm} />\n </Animation></>\n }\n { messages && messages.map((item, index) => \n <>\n { item.senderType && <Message item={item} buttonAction={buttonAction} setChatForm={setChatForm} /> }\n { (Object.keys(messages).length - 1) !== index && <Splitter /> }\n </>\n )}\n </ChatContentList>\n </ChatArea>\n );\n};\n\nconst ChatArea = styled.div`\n width: 100%;\n flex: 1;\n overflow-x: hidden;\n display: flex;\n flex-direction: column-reverse;\n`;\n\nconst Animation = styled.div`\n &, .animation {\n width: 100%;\n display: flex;\n flex-direction: column;\n position: inherit;\n margin-bottom: -64px;\n animation: slideIn .4s cubic-bezier(0.41, 0.39, 0.53, 1.38) forwards;\n }\n @keyframes slideIn {\n from {\n margin-bottom: -64px;\n }\n to {\n margin-bottom: 0px;\n }\n }\n`;\n\nexport default MessageList;\n"],"names":["MessageList","_a","__rest","gContext","useContext","ChatGlobalContext","_b","useState","chatSessionId","setChatSessionId","_c","chatForm","setChatForm","_d","defaultMessages","messages","setMessages","messagesRef","useRef","sc","_e","allowCreateChat","newMessageInterval","messageRef","_f","message","setMessage","_g","newMessage","setNewMessage","useEffect","twilioChat","chatUserId","tmpUUID","uuidv4","localStorage","setItem","current","connectToWebsocket","on","console","log","err","concat","reason","chatCaseId","emit","listeners","length","data","type","agentId","properties","OwnerId","goSetTwilioChat","__assign","initialTwilioChatState","openChat","fullscreen","side","chatClosing","ClosedBy","receiveMessage","filter","item","form","scrollToBottom","setTimeout","tmpMessages","Array","from","Map","__spreadArray","map","messageId","values","tmpState","chatUnreaded","chatConversationId","visibilityChange","typingAgent","lastTimeActive","Date","now","didAgentPost","setInterval","slice","first","rest","clearInterval","buttonAction","action","chatActive","chatUserType","newAccountHolder","notAccountHolder","yesAccountHolder","full_name","address","email","last_bill","category","submitForm","userTypeLabels","categories","chatLoading","chatUsername","chatEmail","chatCategory","chatAddress","chatLastBill","getToken","tmpToken","_j","sent","token","createConversation","tmpConversation","tmpMessage","statusCode","body","outage","outageMessage","outageTitle","header","logged","participantId","conversationId","caseId","_h","updateMessage","id","title","sendMessage","resetTimer","__awaiter","some","obj","Files","getFiles","tmpFiles","Object","keys","error","error_1","files","senderType","SenderType","createdAt","moment","format","From","Body","fromId","createdBy","window","React","createElement","ChatArea","ChatContentList","TypingIndicator","Fragment","Animation","Splitter","Message","index","styled","div","templateObject_1","__makeTemplateObject","templateObject_2"],"mappings":"69BA+BA,QAAMA,EAAc,SAACC,GAASC,EAAAD,EAAT,IACnB,IAAME,EAAgBC,EAAWC,GAC3BC,EAAoCC,EAAwB,MAA3DC,EAAaF,EAAA,GAAEG,EAAgBH,EAAA,GAChCI,EAA0BH,EAAiC,CAAA,GAA1DI,EAAQD,EAAA,GAAEE,EAAWF,EAAA,GACtBG,EA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AAyB,oBAAX8H,OACV,KAEFC,EAAAC,cAACC,EAAQ,KACPF,EAAAC,cAACE,EAAe,CAAC5B,GAAG,mBAChBhH,EAAGkB,SAAWuH,EAAAC,cAACG,EAAe,CAAC7I,GAAIA,IACnCM,GAAWmI,EAAAC,cAAAD,EAAAK,SAAA,KAAEL,EAAAC,cAACK,EAAS,KACvBN,EAAAC,cAACM,EAAQ,MAEPP,EAAAC,cAACO,EAAO,CAACpG,KAAMvC,EAASiE,aAAcA,GAAc9E,YAAaA,MAGnEG,GAAYA,EAAS0D,IAAI,SAACT,EAAMqG,GAChC,OAAAT,EAAAC,cAAAD,EAAAK,SAAA,KACEjG,EAAKkF,YAAcU,EAAAC,cAACO,GAAQpG,KAAMA,EAAM0B,aAAcA,GAAc9E,YAAaA,IAChFiI,OAAOC,KAAK/H,GAAUiC,OAAS,IAAOqH,GAAUT,EAAAC,cAACM,QAFpD,IAQV,EAEML,EAAWQ,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,8GAAA,CAAA,iHAQrBP,EAAYI,EAAOC,IAAGG,IAAAA,EAAAD,EAAA,CAAA,wVAAA,CAAA"}
@@ -1,2 +1,2 @@
1
- import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import t,{useContext as e,useState as o,useEffect as a}from"react";import i from"../../../node_modules/styled-components/dist/styled-components.browser.esm.js";import r from"../../context/ChatGlobalContext.js";import{IoIosCloseCircleOutline as p}from"../../../node_modules/react-icons/io/index.js";import s from"axios";import l from"../../../_virtual/react-markdown.js";import x from"../../../_virtual/index2.js";var m,c,d=i.div(m||(m=n(["\n background-color: #f9423a;\n width: 100%;\n -webkit-box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n -moz-box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n"],["\n background-color: #f9423a;\n width: 100%;\n -webkit-box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n -moz-box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n"]))),g=i.div(c||(c=n(["\n position: relative;\n margin: 0px auto;\n width: calc(100% - 10px);\n padding: 0px 5px;\n max-width: 1338px;\n display: flex;\n justify-content: space-between;\n align-items: center; \n align-content: center;\n flex-direction: row;\n gap: 10px;\n small { p { \n color: #000000 !important; \n margin: 0px !important;\n flex: 1;\n text-align: center;\n font-size: 14px !important;\n font-weight: 400;\n line-height: 21px !important;\n }}\n span {\n color: #000000;\n marging: 0px;\n padding: 0px;\n cursor: pointer;\n transition: all 0.3s ease-in-out;\n svg { transition: all 0.3s ease-in-out; }\n &:hover {\n color: #ffffff;\n svg { transform: rotate(-90deg); }\n }\n }\n"],["\n position: relative;\n margin: 0px auto;\n width: calc(100% - 10px);\n padding: 0px 5px;\n max-width: 1338px;\n display: flex;\n justify-content: space-between;\n align-items: center; \n align-content: center;\n flex-direction: row;\n gap: 10px;\n small { p { \n color: #000000 !important; \n margin: 0px !important;\n flex: 1;\n text-align: center;\n font-size: 14px !important;\n font-weight: 400;\n line-height: 21px !important;\n }}\n span {\n color: #000000;\n marging: 0px;\n padding: 0px;\n cursor: pointer;\n transition: all 0.3s ease-in-out;\n svg { transition: all 0.3s ease-in-out; }\n &:hover {\n color: #ffffff;\n svg { transform: rotate(-90deg); }\n }\n }\n"]))),f=function(){var n=e(r),i=o(null),m=i[0],c=i[1],f=o(!0),u=f[0],h=f[1];return a(function(){s.get("https://strapi.youfibre.com/api/information").then(function(t){n.setAppMessages(t.data.data)}).catch(function(t){n.setAppMessages(null)})},[]),a(function(){var t,e;c((null===(t=null==n?void 0:n.appMessages)||void 0===t?void 0:t.chat_banner_toggle)?null===(e=null==n?void 0:n.appMessages)||void 0===e?void 0:e.chat_banner_text:"")},[n.appMessages]),t.createElement(t.Fragment,null,m&&u&&t.createElement(d,{className:"text-white p-1"},t.createElement(g,null,t.createElement("small",null,t.createElement(l,{plugins:[x],className:"p-0",source:m,linkTarget:"_blank"})),t.createElement("span",{onClick:function(){return h(!1)}},t.createElement(p,null)))))};export{f as default};
1
+ import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import t,{useContext as e,useState as o,useEffect as a}from"react";import i from"../../../node_modules/styled-components/dist/styled-components.browser.esm.js";import r from"../../context/ChatGlobalContext.js";import{IoIosCloseCircleOutline as p}from"../../../node_modules/react-icons/io/index.js";import s from"axios";import l from"../../../_virtual/react-markdown.js";import x from"../../../_virtual/index2.js";var m,c,d=i.div(m||(m=n(["\n background-color: #f9423a;\n width: 100%;\n -webkit-box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n -moz-box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n"],["\n background-color: #f9423a;\n width: 100%;\n -webkit-box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n -moz-box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n"]))),g=i.div(c||(c=n(["\n position: relative;\n margin: 0px auto;\n width: calc(100% - 10px);\n padding: 0px 5px;\n max-width: 1338px;\n display: flex;\n justify-content: space-between;\n align-items: center; \n align-content: center;\n flex-direction: row;\n gap: 10px;\n small { p { \n color: #000000 !important; \n margin: 0px !important;\n flex: 1;\n text-align: center;\n font-size: 14px !important;\n font-weight: 400;\n line-height: 21px !important;\n }}\n span {\n color: #000000;\n marging: 0px;\n padding: 0px;\n cursor: pointer;\n transition: all 0.3s ease-in-out;\n svg { transition: all 0.3s ease-in-out; }\n &:hover {\n color: #ffffff;\n svg { transform: rotate(-90deg); }\n }\n }\n"],["\n position: relative;\n margin: 0px auto;\n width: calc(100% - 10px);\n padding: 0px 5px;\n max-width: 1338px;\n display: flex;\n justify-content: space-between;\n align-items: center; \n align-content: center;\n flex-direction: row;\n gap: 10px;\n small { p { \n color: #000000 !important; \n margin: 0px !important;\n flex: 1;\n text-align: center;\n font-size: 14px !important;\n font-weight: 400;\n line-height: 21px !important;\n }}\n span {\n color: #000000;\n marging: 0px;\n padding: 0px;\n cursor: pointer;\n transition: all 0.3s ease-in-out;\n svg { transition: all 0.3s ease-in-out; }\n &:hover {\n color: #ffffff;\n svg { transform: rotate(-90deg); }\n }\n }\n"]))),f=function(){var n=e(r),i=o(null),m=i[0],c=i[1],f=o(!0),u=f[0],h=f[1];return a(function(){s.get("https://strapi.youfibre.com/api/information").then(function(t){n.setAppMessages(t.data.data)}).catch(function(t){n.setAppMessages(null)})},[]),a(function(){var t,e;c((null===(t=null==n?void 0:n.appMessages)||void 0===t?void 0:t.chat_banner_toggle)?null===(e=null==n?void 0:n.appMessages)||void 0===e?void 0:e.chat_banner_text:"")},[n.appMessages]),"undefined"==typeof window?null:t.createElement(t.Fragment,null,m&&u&&t.createElement(d,{className:"text-white p-1"},t.createElement(g,null,t.createElement("small",null,t.createElement(l,{plugins:[x],className:"p-0",source:m,linkTarget:"_blank"})),t.createElement("span",{onClick:function(){return h(!1)}},t.createElement(p,null)))))};export{f as default};
2
2
  //# sourceMappingURL=NotificationBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationBar.js","sources":["../../../../src/TwilioChat/components/NotificationBar.tsx"],"sourcesContent":["import React, { useEffect, useState, useContext } from 'react';\nimport styled, { keyframes, css } from \"styled-components\";\nimport ChatGlobalContext from \"../../context/ChatGlobalContext\";\nimport { IoIosCloseCircleOutline } from \"react-icons/io\";\nimport axios from 'axios';\nimport ReactMarkdown from 'react-markdown'\nimport gfm from 'remark-gfm';\n\nconst Bar = styled.div`\n background-color: #f9423a;\n width: 100%;\n -webkit-box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n -moz-box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n`;\n\nconst Content = styled.div`\n position: relative;\n margin: 0px auto;\n width: calc(100% - 10px);\n padding: 0px 5px;\n max-width: 1338px;\n display: flex;\n justify-content: space-between;\n align-items: center; \n align-content: center;\n flex-direction: row;\n gap: 10px;\n small { p { \n color: #000000 !important; \n margin: 0px !important;\n flex: 1;\n text-align: center;\n font-size: 14px !important;\n font-weight: 400;\n line-height: 21px !important;\n }}\n span {\n color: #000000;\n marging: 0px;\n padding: 0px;\n cursor: pointer;\n transition: all 0.3s ease-in-out;\n svg { transition: all 0.3s ease-in-out; }\n &:hover {\n color: #ffffff;\n svg { transform: rotate(-90deg); }\n }\n }\n`;\n\nconst NotificationBar = () => {\n const gContext: any = useContext(ChatGlobalContext);\n const [message, setMessage] = useState<string|null>(null);\n const [showBar, setShowBar] = useState<boolean>(true);\n\n useEffect(() => {\n axios.get(`https://strapi.youfibre.com/api/information`)\n .then(function (response) {\n gContext.setAppMessages(response.data.data);\n })\n .catch(function (error) {\n gContext.setAppMessages(null);\n });\n }, []);\n\n useEffect(() => {\n setMessage(gContext?.appMessages?.chat_banner_toggle ? gContext?.appMessages?.chat_banner_text : '');\n }, [gContext.appMessages]);\n \n return (\n <>\n {message && showBar && <Bar className=\"text-white p-1\">\n <Content>\n <small><ReactMarkdown plugins={[gfm]} className=\"p-0\" source={message} linkTarget=\"_blank\" /></small>\n <span onClick={() => setShowBar(false)}><IoIosCloseCircleOutline /></span>\n </Content>\n </Bar>}\n </>\n );\n};\n\nexport default NotificationBar;"],"names":["Bar","styled","div","templateObject_1","__makeTemplateObject","Content","templateObject_2","NotificationBar","gContext","useContext","ChatGlobalContext","_a","useState","message","setMessage","_b","showBar","setShowBar","useEffect","axios","get","then","response","setAppMessages","data","catch","error","appMessages","chat_banner_toggle","chat_banner_text","React","createElement","Fragment","className","ReactMarkdown","plugins","gfm","source","linkTarget","onClick","IoIosCloseCircleOutline"],"mappings":"6eAQA,QAAMA,EAAMC,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,0OAAA,CAAA,6OAQhBC,EAAUJ,EAAOC,IAAGI,IAAAA,EAAAF,EAAA,CAAA,i1BAAA,CAAA,o1BAmCpBG,EAAkB,WACpB,IAAMC,EAAgBC,EAAWC,GAC3BC,EAAwBC,EAAsB,MAA7CC,EAAOF,EAAA,GAAEG,EAAUH,EAAA,GACpBI,EAAwBH,GAAkB,GAAzCI,EAAOD,EAAA,GAAEE,EAAUF,EAAA,GAgB1B,OAdAG,EAAU,WACNC,EAAMC,IAAI,+CACLC,KAAK,SAAUC,GACZd,EAASe,eAAeD,EAASE,KAAKA,KAC1C,GACCC,MAAM,SAAUC,GACblB,EAASe,eAAe,KAC5B,EACR,EAAG,IAEHL,EAAU,mBACNJ,GAAgC,QAArBH,EAAAH,aAAQ,EAARA,EAAUmB,mBAAW,IAAAhB,OAAA,EAAAA,EAAEiB,oBAA0C,QAArBb,EAAAP,aAAQ,EAARA,EAAUmB,mBAAW,IAAAZ,OAAA,EAAAA,EAAEc,iBAAmB,GACrG,EAAG,CAACrB,EAASmB,cAGTG,EAAAC,cAAAD,EAAAE,SAAA,KACKnB,GAAWG,GAAWc,EAAAC,cAAC/B,EAAG,CAACiC,UAAU,kBAClCH,EAAAC,cAAC1B,EAAO,KACJyB,EAAAC,cAAA,QAAA,KAAOD,EAAAC,cAACG,GAAcC,QAAS,CAACC,GAAMH,UAAU,MAAMI,OAAQxB,EAASyB,WAAW,YAClFR,EAAAC,cAAA,OAAA,CAAMQ,QAAS,WAAM,OAAAtB,GAAW,EAAX,GAAmBa,EAAAC,cAACS,EAAuB,SAKpF"}
1
+ {"version":3,"file":"NotificationBar.js","sources":["../../../../src/TwilioChat/components/NotificationBar.tsx"],"sourcesContent":["import React, { useEffect, useState, useContext } from 'react';\nimport styled, { keyframes, css } from \"styled-components\";\nimport ChatGlobalContext from \"../../context/ChatGlobalContext\";\nimport { IoIosCloseCircleOutline } from \"react-icons/io\";\nimport axios from 'axios';\nimport ReactMarkdown from 'react-markdown'\nimport gfm from 'remark-gfm';\n\nconst Bar = styled.div`\n background-color: #f9423a;\n width: 100%;\n -webkit-box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n -moz-box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n box-shadow: 2px 1px 12px 0px rgba(0, 0, 0, 0.35);\n`;\n\nconst Content = styled.div`\n position: relative;\n margin: 0px auto;\n width: calc(100% - 10px);\n padding: 0px 5px;\n max-width: 1338px;\n display: flex;\n justify-content: space-between;\n align-items: center; \n align-content: center;\n flex-direction: row;\n gap: 10px;\n small { p { \n color: #000000 !important; \n margin: 0px !important;\n flex: 1;\n text-align: center;\n font-size: 14px !important;\n font-weight: 400;\n line-height: 21px !important;\n }}\n span {\n color: #000000;\n marging: 0px;\n padding: 0px;\n cursor: pointer;\n transition: all 0.3s ease-in-out;\n svg { transition: all 0.3s ease-in-out; }\n &:hover {\n color: #ffffff;\n svg { transform: rotate(-90deg); }\n }\n }\n`;\n\nconst NotificationBar = () => {\n const gContext: any = useContext(ChatGlobalContext);\n const [message, setMessage] = useState<string|null>(null);\n const [showBar, setShowBar] = useState<boolean>(true);\n\n useEffect(() => {\n axios.get(`https://strapi.youfibre.com/api/information`)\n .then(function (response) {\n gContext.setAppMessages(response.data.data);\n })\n .catch(function (error) {\n gContext.setAppMessages(null);\n });\n }, []);\n\n useEffect(() => {\n setMessage(gContext?.appMessages?.chat_banner_toggle ? gContext?.appMessages?.chat_banner_text : '');\n }, [gContext.appMessages]);\n \n return typeof window === \"undefined\"\n ? null\n : (\n <>\n {message && showBar && <Bar className=\"text-white p-1\">\n <Content>\n <small><ReactMarkdown plugins={[gfm]} className=\"p-0\" source={message} linkTarget=\"_blank\" /></small>\n <span onClick={() => setShowBar(false)}><IoIosCloseCircleOutline /></span>\n </Content>\n </Bar>}\n </>\n );\n};\n\nexport default NotificationBar;"],"names":["Bar","styled","div","templateObject_1","__makeTemplateObject","Content","templateObject_2","NotificationBar","gContext","useContext","ChatGlobalContext","_a","useState","message","setMessage","_b","showBar","setShowBar","useEffect","axios","get","then","response","setAppMessages","data","catch","error","appMessages","chat_banner_toggle","chat_banner_text","window","React","createElement","Fragment","className","ReactMarkdown","plugins","gfm","source","linkTarget","onClick","IoIosCloseCircleOutline"],"mappings":"6eAQA,QAAMA,EAAMC,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,0OAAA,CAAA,6OAQhBC,EAAUJ,EAAOC,IAAGI,IAAAA,EAAAF,EAAA,CAAA,i1BAAA,CAAA,o1BAmCpBG,EAAkB,WACpB,IAAMC,EAAgBC,EAAWC,GAC3BC,EAAwBC,EAAsB,MAA7CC,EAAOF,EAAA,GAAEG,EAAUH,EAAA,GACpBI,EAAwBH,GAAkB,GAAzCI,EAAOD,EAAA,GAAEE,EAAUF,EAAA,GAgB1B,OAdAG,EAAU,WACNC,EAAMC,IAAI,+CACLC,KAAK,SAAUC,GACZd,EAASe,eAAeD,EAASE,KAAKA,KAC1C,GACCC,MAAM,SAAUC,GACblB,EAASe,eAAe,KAC5B,EACR,EAAG,IAEHL,EAAU,mBACNJ,GAAgC,QAArBH,EAAAH,aAAQ,EAARA,EAAUmB,mBAAW,IAAAhB,OAAA,EAAAA,EAAEiB,oBAA0C,QAArBb,EAAAP,aAAQ,EAARA,EAAUmB,mBAAW,IAAAZ,OAAA,EAAAA,EAAEc,iBAAmB,GACrG,EAAG,CAACrB,EAASmB,cAEa,oBAAXG,OACb,KAEEC,EAAAC,cAAAD,EAAAE,SAAA,KACKpB,GAAWG,GAAWe,EAAAC,cAAChC,EAAG,CAACkC,UAAU,kBAClCH,EAAAC,cAAC3B,EAAO,KACJ0B,EAAAC,cAAA,QAAA,KAAOD,EAAAC,cAACG,GAAcC,QAAS,CAACC,GAAMH,UAAU,MAAMI,OAAQzB,EAAS0B,WAAW,YAClFR,EAAAC,cAAA,OAAA,CAAMQ,QAAS,WAAM,OAAAvB,GAAW,EAAX,GAAmBc,EAAAC,cAACS,EAAuB,SAKpF"}
@@ -1,2 +1,2 @@
1
- import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import t,{useContext as e,useState as o,useEffect as i}from"react";import l from"../../../node_modules/styled-components/dist/styled-components.browser.esm.js";import r from"../../context/ChatGlobalContext.js";var a,d=function(n){var l,a=n.sc,d=e(r),c=o(!1),p=c[0],f=c[1];return i(function(){var n;a.current&&(null==d?void 0:d.twilioChat.chatCaseId)&&(a.current.emit("joinRoom",null==d?void 0:d.twilioChat.chatCaseId),!a.current.listeners("web-chat-input-".concat(null==d?void 0:d.twilioChat.chatCaseId)).length&&(null===(n=a.current)||void 0===n||n.on("web-chat-input-".concat(null==d?void 0:d.twilioChat.chatCaseId),function(n){"AGENT"===n.sender&&f(!0)})))},[a,null==d?void 0:d.twilioChat.chatCaseId]),i(function(){p&&(f(!0),l=setTimeout(function(){f(!1),clearTimeout(l)},3e3))},[p]),p?t.createElement(s,null,t.createElement("small",null,"Agent is typing...")):null},s=l.div(a||(a=n(["\n width: 100%;\n display: flex;\n flex-direction: row-reverse;\n small {\n position: absolute;\n margin: 0px 3px 0px 0px;\n font-size: 11px !important;\n font-weight: 100;\n line-height: 13px;\n color: #015e9c;\n background-color: #ddf0fc;\n border: 1px solid #ffffff;\n border-radius: 100px;\n padding: 5px 15px;\n z-index: 50;\n }\n"],["\n width: 100%;\n display: flex;\n flex-direction: row-reverse;\n small {\n position: absolute;\n margin: 0px 3px 0px 0px;\n font-size: 11px !important;\n font-weight: 100;\n line-height: 13px;\n color: #015e9c;\n background-color: #ddf0fc;\n border: 1px solid #ffffff;\n border-radius: 100px;\n padding: 5px 15px;\n z-index: 50;\n }\n"])));export{d as default};
1
+ import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import t,{useContext as e,useState as o,useEffect as i}from"react";import l from"../../../node_modules/styled-components/dist/styled-components.browser.esm.js";import r from"../../context/ChatGlobalContext.js";var d,a=function(n){var l,d=n.sc,a=e(r),c=o(!1),p=c[0],f=c[1];return i(function(){var n;d.current&&(null==a?void 0:a.twilioChat.chatCaseId)&&(d.current.emit("joinRoom",null==a?void 0:a.twilioChat.chatCaseId),!d.current.listeners("web-chat-input-".concat(null==a?void 0:a.twilioChat.chatCaseId)).length&&(null===(n=d.current)||void 0===n||n.on("web-chat-input-".concat(null==a?void 0:a.twilioChat.chatCaseId),function(n){"AGENT"===n.sender&&f(!0)})))},[d,null==a?void 0:a.twilioChat.chatCaseId]),i(function(){p&&(f(!0),l=setTimeout(function(){f(!1),clearTimeout(l)},3e3))},[p]),"undefined"==typeof window?null:p?t.createElement(s,null,t.createElement("small",null,"Agent is typing...")):null},s=l.div(d||(d=n(["\n width: 100%;\n display: flex;\n flex-direction: row-reverse;\n small {\n position: absolute;\n margin: 0px 3px 0px 0px;\n font-size: 11px !important;\n font-weight: 100;\n line-height: 13px;\n color: #015e9c;\n background-color: #ddf0fc;\n border: 1px solid #ffffff;\n border-radius: 100px;\n padding: 5px 15px;\n z-index: 50;\n }\n"],["\n width: 100%;\n display: flex;\n flex-direction: row-reverse;\n small {\n position: absolute;\n margin: 0px 3px 0px 0px;\n font-size: 11px !important;\n font-weight: 100;\n line-height: 13px;\n color: #015e9c;\n background-color: #ddf0fc;\n border: 1px solid #ffffff;\n border-radius: 100px;\n padding: 5px 15px;\n z-index: 50;\n }\n"])));export{a as default};
2
2
  //# sourceMappingURL=TypingIndicator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TypingIndicator.js","sources":["../../../../src/TwilioChat/components/TypingIndicator.tsx"],"sourcesContent":["import React, { useContext, useEffect, useState } from \"react\";\nimport styled from 'styled-components';\nimport ChatGlobalContext from \"../../context/ChatGlobalContext\";\n\nconst TypingIndicator = ({sc}) => {\n const gContext: any = useContext(ChatGlobalContext);\n const [typingAgent, setTypingAgent] = useState(false);\n\n useEffect(() =>{\n if(sc.current && gContext?.twilioChat.chatCaseId){\n sc.current.emit(\"joinRoom\", gContext?.twilioChat.chatCaseId); \n !sc.current.listeners(`web-chat-input-${gContext?.twilioChat.chatCaseId}`).length && sc.current?.on(`web-chat-input-${gContext?.twilioChat.chatCaseId}`, (data) => {\n if(data.sender === \"AGENT\"){\n setTypingAgent(true);\n }\n });\n }\n }, [sc, gContext?.twilioChat.chatCaseId]);\n \n let typingTimeout:any;\n \n useEffect(() => {\n if(typingAgent){\n setTypingAgent(true);\n typingTimeout = setTimeout(() => {\n setTypingAgent(false);\n clearTimeout(typingTimeout);\n }, 3000); \n }\n }, [typingAgent]);\n\n return ( typingAgent ? <Agent><small>Agent is typing...</small></Agent> : null );\n};\n\nexport default TypingIndicator;\n\nconst Agent = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row-reverse;\n small {\n position: absolute;\n margin: 0px 3px 0px 0px;\n font-size: 11px !important;\n font-weight: 100;\n line-height: 13px;\n color: #015e9c;\n background-color: #ddf0fc;\n border: 1px solid #ffffff;\n border-radius: 100px;\n padding: 5px 15px;\n z-index: 50;\n }\n`;"],"names":["TypingIndicator","_a","typingTimeout","sc","gContext","useContext","ChatGlobalContext","_b","useState","typingAgent","setTypingAgent","useEffect","current","twilioChat","chatCaseId","emit","listeners","length","on","data","sender","setTimeout","clearTimeout","React","Agent","createElement","styled","div","templateObject_1","__makeTemplateObject"],"mappings":"kSAIA,MAAMA,EAAkB,SAACC,GAAC,IAepBC,EAfoBC,EAAEF,EAAAE,GACpBC,EAAgBC,EAAWC,GAC3BC,EAAgCC,GAAS,GAAxCC,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GAyBlC,OAvBAI,EAAU,iBACLR,EAAGS,UAAWR,eAAAA,EAAUS,WAAWC,cACpCX,EAAGS,QAAQG,KAAK,WAAYX,eAAAA,EAAUS,WAAWC,aAChDX,EAAGS,QAAQI,UAAU,yBAAkBZ,aAAQ,EAARA,EAAUS,WAAWC,aAAcG,iBAAUhB,EAAAE,EAAGS,wBAASM,GAAG,yBAAkBd,eAAAA,EAAUS,WAAWC,YAAc,SAACK,GACrI,UAAhBA,EAAKC,QACNV,GAAe,EAEnB,IAEJ,EAAG,CAACP,EAAIC,eAAAA,EAAUS,WAAWC,aAI7BH,EAAU,WACLF,IACDC,GAAe,GACfR,EAAgBmB,WAAW,WACzBX,GAAe,GACfY,aAAapB,EACf,EAAG,KAEP,EAAG,CAACO,IAEKA,EAAcc,gBAACC,EAAK,KAACD,EAAAE,cAAA,QAAA,KAAA,uBAA4C,IAC5E,EAIMD,EAAQE,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,yXAAA,CAAA"}
1
+ {"version":3,"file":"TypingIndicator.js","sources":["../../../../src/TwilioChat/components/TypingIndicator.tsx"],"sourcesContent":["import React, { useContext, useEffect, useState } from \"react\";\nimport styled from 'styled-components';\nimport ChatGlobalContext from \"../../context/ChatGlobalContext\";\n\nconst TypingIndicator = ({sc}) => {\n const gContext: any = useContext(ChatGlobalContext);\n const [typingAgent, setTypingAgent] = useState(false);\n\n useEffect(() =>{\n if(sc.current && gContext?.twilioChat.chatCaseId){\n sc.current.emit(\"joinRoom\", gContext?.twilioChat.chatCaseId); \n !sc.current.listeners(`web-chat-input-${gContext?.twilioChat.chatCaseId}`).length && sc.current?.on(`web-chat-input-${gContext?.twilioChat.chatCaseId}`, (data) => {\n if(data.sender === \"AGENT\"){\n setTypingAgent(true);\n }\n });\n }\n }, [sc, gContext?.twilioChat.chatCaseId]);\n \n let typingTimeout:any;\n \n useEffect(() => {\n if(typingAgent){\n setTypingAgent(true);\n typingTimeout = setTimeout(() => {\n setTypingAgent(false);\n clearTimeout(typingTimeout);\n }, 3000); \n }\n }, [typingAgent]);\n\n return typeof window === \"undefined\"\n ? null\n : ( typingAgent ? <Agent><small>Agent is typing...</small></Agent> : null );\n};\n\nexport default TypingIndicator;\n\nconst Agent = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row-reverse;\n small {\n position: absolute;\n margin: 0px 3px 0px 0px;\n font-size: 11px !important;\n font-weight: 100;\n line-height: 13px;\n color: #015e9c;\n background-color: #ddf0fc;\n border: 1px solid #ffffff;\n border-radius: 100px;\n padding: 5px 15px;\n z-index: 50;\n }\n`;"],"names":["TypingIndicator","_a","typingTimeout","sc","gContext","useContext","ChatGlobalContext","_b","useState","typingAgent","setTypingAgent","useEffect","current","twilioChat","chatCaseId","emit","listeners","length","on","data","sender","setTimeout","clearTimeout","window","React","Agent","createElement","styled","div","templateObject_1","__makeTemplateObject"],"mappings":"kSAIA,MAAMA,EAAkB,SAACC,GAAC,IAepBC,EAfoBC,EAAEF,EAAAE,GACpBC,EAAgBC,EAAWC,GAC3BC,EAAgCC,GAAS,GAAxCC,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GAyBlC,OAvBAI,EAAU,iBACLR,EAAGS,UAAWR,eAAAA,EAAUS,WAAWC,cACpCX,EAAGS,QAAQG,KAAK,WAAYX,eAAAA,EAAUS,WAAWC,aAChDX,EAAGS,QAAQI,UAAU,yBAAkBZ,aAAQ,EAARA,EAAUS,WAAWC,aAAcG,iBAAUhB,EAAAE,EAAGS,wBAASM,GAAG,yBAAkBd,eAAAA,EAAUS,WAAWC,YAAc,SAACK,GACrI,UAAhBA,EAAKC,QACNV,GAAe,EAEnB,IAEJ,EAAG,CAACP,EAAIC,eAAAA,EAAUS,WAAWC,aAI7BH,EAAU,WACLF,IACDC,GAAe,GACfR,EAAgBmB,WAAW,WACzBX,GAAe,GACfY,aAAapB,EACf,EAAG,KAEP,EAAG,CAACO,IAEsB,oBAAXc,OACX,KACEd,EAAce,gBAACC,EAAK,KAACD,EAAAE,cAAA,QAAA,KAAA,uBAA4C,IACzE,EAIMD,EAAQE,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,yXAAA,CAAA"}
@@ -1,2 +1,2 @@
1
- import{__rest as l,__assign as o}from"../../../node_modules/tslib/tslib.es6.js";import i,{useContext as t,useState as e,useEffect as a}from"react";import n from"../../context/ChatGlobalContext.js";import d from"../../assets/images/chat.svg.js";import u from"../../assets/images/ico-close.png.js";import v from"./styled/WidgetButton.js";var s=function(s){var r,c,h;l(s,[]);var m=t(n),C=e(!1),f=C[0],p=C[1],w=e(!1),g=w[0],j=w[1];a(function(){var l;p(null===(l=null==m?void 0:m.twilioChat)||void 0===l?void 0:l.openChat)},[null===(r=null==m?void 0:m.twilioChat)||void 0===r?void 0:r.openChat]),a(function(){var l;j(null===(l=null==m?void 0:m.twilioChat)||void 0===l?void 0:l.fullscreen)},[null===(c=null==m?void 0:m.twilioChat)||void 0===c?void 0:c.fullscreen]);return i.createElement(v,{onClick:function(){return function(){var l,i,t,e,a;(null===(l=null==m?void 0:m.twilioChat)||void 0===l?void 0:l.chatClosing)&&(null==m||m.goResetTwilioChat());var n=o(o({},null==m?void 0:m.twilioChat),{openChat:!(null===(i=null==m?void 0:m.twilioChat)||void 0===i?void 0:i.openChat),outage:!(null==m?void 0:m.twilioChat.outage)});!(null===(t=null==m?void 0:m.twilioChat)||void 0===t?void 0:t.openChat)&&(null===(e=null==m?void 0:m.twilioChat)||void 0===e?void 0:e.chatUnreaded)&&(n=o(o({},n),{chatUnreaded:!1})),(null===(a=null==m?void 0:m.twilioChat)||void 0===a?void 0:a.messages)&&(null==m||m.goSetTwilioChat(n))}()},className:"YFChat ".concat(f?"open":""," ").concat(g?"fullscreen":"")},i.createElement("img",{src:d,className:"icon-default"}),i.createElement("img",{src:u,className:"icon-hover"}),(null===(h=null==m?void 0:m.twilioChat)||void 0===h?void 0:h.chatUnreaded)&&i.createElement("small",{className:"unread"},"1"))};export{s as default};
1
+ import{__rest as l,__assign as o}from"../../../node_modules/tslib/tslib.es6.js";import i,{useContext as t,useState as e,useEffect as n}from"react";import a from"../../context/ChatGlobalContext.js";import d from"../../assets/images/chat.svg.js";import u from"../../assets/images/ico-close.png.js";import v from"./styled/WidgetButton.js";var s=function(s){var r,c,h;l(s,[]);var m=t(a),C=e(!1),f=C[0],w=C[1],p=e(!1),g=p[0],j=p[1];n(function(){var l;w(null===(l=null==m?void 0:m.twilioChat)||void 0===l?void 0:l.openChat)},[null===(r=null==m?void 0:m.twilioChat)||void 0===r?void 0:r.openChat]),n(function(){var l;j(null===(l=null==m?void 0:m.twilioChat)||void 0===l?void 0:l.fullscreen)},[null===(c=null==m?void 0:m.twilioChat)||void 0===c?void 0:c.fullscreen]);return"undefined"==typeof window?null:i.createElement(v,{onClick:function(){return function(){var l,i,t,e,n;(null===(l=null==m?void 0:m.twilioChat)||void 0===l?void 0:l.chatClosing)&&(null==m||m.goResetTwilioChat());var a=o(o({},null==m?void 0:m.twilioChat),{openChat:!(null===(i=null==m?void 0:m.twilioChat)||void 0===i?void 0:i.openChat),outage:!(null==m?void 0:m.twilioChat.outage)});!(null===(t=null==m?void 0:m.twilioChat)||void 0===t?void 0:t.openChat)&&(null===(e=null==m?void 0:m.twilioChat)||void 0===e?void 0:e.chatUnreaded)&&(a=o(o({},a),{chatUnreaded:!1})),(null===(n=null==m?void 0:m.twilioChat)||void 0===n?void 0:n.messages)&&(null==m||m.goSetTwilioChat(a))}()},className:"YFChat ".concat(f?"open":""," ").concat(g?"fullscreen":"")},i.createElement("img",{src:d,className:"icon-default"}),i.createElement("img",{src:u,className:"icon-hover"}),(null===(h=null==m?void 0:m.twilioChat)||void 0===h?void 0:h.chatUnreaded)&&i.createElement("small",{className:"unread"},"1"))};export{s as default};
2
2
  //# sourceMappingURL=Widget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Widget.js","sources":["../../../../src/TwilioChat/components/Widget.tsx"],"sourcesContent":["import React, { useContext, useState, useEffect } from \"react\";\nimport ChatGlobalContext from \"../../context/ChatGlobalContext\";\nimport icoChat from '../../assets/images/chat.svg';\nimport icoCloseChat from '../../assets/images/ico-close.png';\nimport WidgetButton from \"./styled/WidgetButton\";\n\nconst Widget = ({...props}) => {\n const gContext: any = useContext(ChatGlobalContext);\n\n const [openChat, setOpenChat] = useState(false);\n const [fullscreen, setFullscreen] = useState(false);\n \n useEffect(() => {\n setOpenChat(gContext?.twilioChat?.openChat);\n }, [gContext?.twilioChat?.openChat]);\n \n useEffect(() => {\n setFullscreen(gContext?.twilioChat?.fullscreen);\n }, [gContext?.twilioChat?.fullscreen]);\n \n const chatToggle = () => {\n gContext?.twilioChat?.chatClosing && gContext?.goResetTwilioChat();\n let tmpState = {...gContext?.twilioChat, openChat: !gContext?.twilioChat?.openChat, outage: !gContext?.twilioChat.outage};\n if(!gContext?.twilioChat?.openChat && gContext?.twilioChat?.chatUnreaded) tmpState = {...tmpState, chatUnreaded: false};\n gContext?.twilioChat?.messages && gContext?.goSetTwilioChat(tmpState);\n };\n\n return (\n <WidgetButton onClick={() => chatToggle()} className={`YFChat ${openChat ? 'open' : ''} ${fullscreen?'fullscreen':''}`}>\n <img src={icoChat} className='icon-default' />\n <img src={icoCloseChat} className='icon-hover' />\n {gContext?.twilioChat?.chatUnreaded && <small className='unread'>1</small>}\n </WidgetButton>\n );\n};\n\nexport default Widget;"],"names":["Widget","_a","__rest","gContext","useContext","ChatGlobalContext","_e","useState","openChat","setOpenChat","_f","fullscreen","setFullscreen","useEffect","twilioChat","_b","_c","React","createElement","WidgetButton","onClick","chatClosing","goResetTwilioChat","tmpState","__assign","outage","_d","chatUnreaded","messages","goSetTwilioChat","chatToggle","className","concat","src","icoChat","icoCloseChat"],"mappings":"gVAMA,IAAMA,EAAS,SAACC,aAASC,EAAAD,EAAT,IACZ,IAAME,EAAgBC,EAAWC,GAE3BC,EAA0BC,GAAS,GAAlCC,EAAQF,EAAA,GAAEG,EAAWH,EAAA,GACtBI,EAA8BH,GAAS,GAAtCI,EAAUD,EAAA,GAAEE,EAAaF,EAAA,GAEhCG,EAAU,iBACNJ,EAAgC,QAApBR,EAAAE,aAAQ,EAARA,EAAUW,kBAAU,IAAAb,OAAA,EAAAA,EAAEO,SACtC,EAAG,CAAqB,QAApBO,EAAAZ,aAAQ,EAARA,EAAUW,kBAAU,IAAAC,OAAA,EAAAA,EAAEP,WAE1BK,EAAU,iBACND,EAAkC,QAApBX,EAAAE,aAAQ,EAARA,EAAUW,kBAAU,IAAAb,OAAA,EAAAA,EAAEU,WACxC,EAAG,CAAqB,QAApBK,EAAAb,aAAQ,EAARA,EAAUW,kBAAU,IAAAE,OAAA,EAAAA,EAAEL,aAS1B,OACIM,EAAAC,cAACC,EAAY,CAACC,QAAS,WAAM,OARd,0BACK,QAApBnB,EAAAE,eAAAA,EAAUW,sBAAUb,OAAA,EAAAA,EAAEoB,eAAelB,SAAAA,EAAUmB,qBAC/C,IAAIC,EAAQC,EAAAA,EAAA,CAAA,EAAOrB,aAAQ,EAARA,EAAUW,YAAU,CAAEN,qBAAWL,aAAQ,EAARA,EAAUW,iCAAYN,UAAUiB,SAAStB,aAAQ,EAARA,EAAUW,WAAWW,YAC1F,QAApBT,EAAAb,aAAQ,EAARA,EAAUW,kBAAU,IAAAE,OAAA,EAAAA,EAAER,YAAgC,QAApBkB,EAAAvB,aAAQ,EAARA,EAAUW,kBAAU,IAAAY,OAAA,EAAAA,EAAEC,gBAAcJ,SAAeA,GAAQ,CAAEI,cAAc,MAC7F,QAApBrB,EAAAH,eAAAA,EAAUW,kBAAU,IAAAR,OAAA,EAAAA,EAAEsB,YAAYzB,SAAAA,EAAU0B,gBAAgBN,GAChE,CAGiCO,EAAA,EAAcC,UAAW,UAAAC,OAAUxB,EAAW,OAAS,GAAE,KAAAwB,OAAIrB,EAAW,aAAa,KAChHM,EAAAC,cAAA,MAAA,CAAKe,IAAKC,EAASH,UAAU,iBAC7Bd,EAAAC,cAAA,MAAA,CAAKe,IAAKE,EAAcJ,UAAU,gBACb,UAApB5B,aAAQ,EAARA,EAAUW,sBAAUY,OAAA,EAAAA,EAAEC,eAAgBV,yBAAOc,UAAU,UAAQ,KAG1E"}
1
+ {"version":3,"file":"Widget.js","sources":["../../../../src/TwilioChat/components/Widget.tsx"],"sourcesContent":["import React, { useContext, useState, useEffect } from \"react\";\nimport ChatGlobalContext from \"../../context/ChatGlobalContext\";\nimport icoChat from '../../assets/images/chat.svg';\nimport icoCloseChat from '../../assets/images/ico-close.png';\nimport WidgetButton from \"./styled/WidgetButton\";\n\nconst Widget = ({...props}) => {\n const gContext: any = useContext(ChatGlobalContext);\n\n const [openChat, setOpenChat] = useState(false);\n const [fullscreen, setFullscreen] = useState(false);\n \n useEffect(() => {\n setOpenChat(gContext?.twilioChat?.openChat);\n }, [gContext?.twilioChat?.openChat]);\n \n useEffect(() => {\n setFullscreen(gContext?.twilioChat?.fullscreen);\n }, [gContext?.twilioChat?.fullscreen]);\n \n const chatToggle = () => {\n gContext?.twilioChat?.chatClosing && gContext?.goResetTwilioChat();\n let tmpState = {...gContext?.twilioChat, openChat: !gContext?.twilioChat?.openChat, outage: !gContext?.twilioChat.outage};\n if(!gContext?.twilioChat?.openChat && gContext?.twilioChat?.chatUnreaded) tmpState = {...tmpState, chatUnreaded: false};\n gContext?.twilioChat?.messages && gContext?.goSetTwilioChat(tmpState);\n };\n\n return typeof window === \"undefined\"\n ? null\n : (\n <WidgetButton onClick={() => chatToggle()} className={`YFChat ${openChat ? 'open' : ''} ${fullscreen?'fullscreen':''}`}>\n <img src={icoChat} className='icon-default' />\n <img src={icoCloseChat} className='icon-hover' />\n {gContext?.twilioChat?.chatUnreaded && <small className='unread'>1</small>}\n </WidgetButton>\n );\n};\n\nexport default Widget;"],"names":["Widget","_a","__rest","gContext","useContext","ChatGlobalContext","_e","useState","openChat","setOpenChat","_f","fullscreen","setFullscreen","useEffect","twilioChat","_b","_c","window","React","createElement","WidgetButton","onClick","chatClosing","goResetTwilioChat","tmpState","__assign","outage","_d","chatUnreaded","messages","goSetTwilioChat","chatToggle","className","concat","src","icoChat","icoCloseChat"],"mappings":"gVAMA,IAAMA,EAAS,SAACC,aAASC,EAAAD,EAAT,IACZ,IAAME,EAAgBC,EAAWC,GAE3BC,EAA0BC,GAAS,GAAlCC,EAAQF,EAAA,GAAEG,EAAWH,EAAA,GACtBI,EAA8BH,GAAS,GAAtCI,EAAUD,EAAA,GAAEE,EAAaF,EAAA,GAEhCG,EAAU,iBACNJ,EAAgC,QAApBR,EAAAE,aAAQ,EAARA,E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AOc,UAAU,UAAQ,KAG1E"}
@@ -1,2 +1,2 @@
1
- import{__assign as e,__awaiter as t,__spreadArray as n,__generator as o}from"../../node_modules/tslib/tslib.es6.js";import i,{useContext as r,useRef as l,useEffect as s}from"react";import a from"./components/Widget.js";import c,{ChatGlobalProvider as u}from"../context/ChatGlobalContext.js";import d from"./Chat.js";import{initialTwilioChatState as m,defaultMessages as v}from"../utils/chats.js";import h from"./components/styled/ChatWrapper.js";import{isConversationActive as f,findUnreadedMessages as g,chatLocalStorage as p,getAllMessages as y}from"../services/chatService.js";import"../assets/styles/fonts.css.js";import"../assets/styles/app.scss.js";var C=function(u){var C=u.fullscreen,b=void 0!==C&&C,w=u.side,S=void 0===w?"right":w,E=r(c),I=l([]);return s(function(){var i;b&&"undefined"!=typeof document&&(null===(i=document.getElementById("main_chat"))||void 0===i||i.remove());t(void 0,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,f()];case 1:return"CLOSED"===t.sent()&&(null==E||E.goResetTwilioChat()),[3,3];case 2:return e=t.sent(),console.error("Error fetching is conversation active:",e),[3,3];case 3:return[2]}})});var r=function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];return t(void 0,n([],i,!0),void 0,function(t){var n,i,r,l,s;return void 0===t&&(t=!1),o(this,function(o){switch(o.label){case 0:return o.trys.push([0,7,,8]),[4,p()];case 1:return n=o.sent(),p("chatConversationId")&&n?[4,y()]:[3,5];case 2:return(i=o.sent())?[4,g(I.current,i)]:[3,4];case 3:if(r=o.sent(),i&&n&&r)return l=e(t?e({},null==E?void 0:E.twilioChat):e(e({},m),n||[]),{messages:i,chatUnreaded:(null==E?void 0:E.twilioChat.chatConversationId)&&(!(null==E?void 0:E.twilioChat.openChat)||!(null==E?void 0:E.twilioChat.visibilityChange))&&Object.keys(r).length>1,fullscreen:b,side:S}),null==E||E.goSetTwilioChat(l),I.current=i,[2,l];o.label=4;case 4:return[3,6];case 5:return l=e(e(e({},m),n||[]),{chatUserType:null,openChat:!1,fullscreen:b,side:S}),null==E||E.goSetTwilioChat(l),I.current=v,[2,l];case 6:return[3,8];case 7:return s=o.sent(),console.error("Error fetching active conversation:",s),[3,8];case 8:return[2]}})})};r(),localStorage.removeItem("title"),document.addEventListener("visibilitychange",function(){return t(void 0,void 0,void 0,function(){var t,n;return o(this,function(o){switch(o.label){case 0:return[4,r()];case 1:return(t=o.sent())&&("undefined"!=typeof document&&"visible"===document.visibilityState?(localStorage.getItem("title")&&(document.title=localStorage.getItem("title")||""),null==E||E.goSetTwilioChat(e(e({},t),{visibilityChange:!0,chatUnreaded:!1})),document.title=localStorage.getItem("title")||"",null===(n=document.getElementById("inputMessage"))||void 0===n||n.focus(),setTimeout(function(){return localStorage.removeItem("title")},1e3),localStorage.getItem("conversationId")&&y()):"hidden"===document.visibilityState?null==E||E.goSetTwilioChat(e(e({},t),{visibilityChange:!1})):null==E||E.goSetTwilioChat(e(e({},t),{visibilityChange:!0}))),[2]}})})})},[]),s(function(){"undefined"!=typeof document&&(b?(document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden"):(document.body.style.overflow="",document.documentElement.style.overflow=""))},[b]),i.createElement(h,{className:"chat-body ".concat(S||"right")},i.createElement(d,null),!b&&i.createElement(a,null))},b=function(t){return i.createElement(u,null,i.createElement(C,e({},t)))};export{b as default};
1
+ import{__assign as e,__awaiter as t,__spreadArray as n,__generator as o}from"../../node_modules/tslib/tslib.es6.js";import i,{useContext as r,useRef as l,useEffect as s}from"react";import a from"./components/Widget.js";import c,{ChatGlobalProvider as u}from"../context/ChatGlobalContext.js";import d from"./Chat.js";import{initialTwilioChatState as m,defaultMessages as v}from"../utils/chats.js";import h from"./components/styled/ChatWrapper.js";import{isConversationActive as f,findUnreadedMessages as g,chatLocalStorage as p,getAllMessages as y}from"../services/chatService.js";import"../assets/styles/fonts.css.js";import"../assets/styles/app.scss.js";var C=function(u){var C=u.fullscreen,b=void 0!==C&&C,w=u.side,S=void 0===w?"right":w,E=r(c),I=l([]);return s(function(){var i;b&&"undefined"!=typeof document&&(null===(i=document.getElementById("main_chat"))||void 0===i||i.remove());t(void 0,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,f()];case 1:return"CLOSED"===t.sent()&&(null==E||E.goResetTwilioChat()),[3,3];case 2:return e=t.sent(),console.error("Error fetching is conversation active:",e),[3,3];case 3:return[2]}})});var r=function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];return t(void 0,n([],i,!0),void 0,function(t){var n,i,r,l,s;return void 0===t&&(t=!1),o(this,function(o){switch(o.label){case 0:return o.trys.push([0,7,,8]),[4,p()];case 1:return n=o.sent(),p("chatConversationId")&&n?[4,y()]:[3,5];case 2:return(i=o.sent())?[4,g(I.current,i)]:[3,4];case 3:if(r=o.sent(),i&&n&&r)return l=e(t?e({},null==E?void 0:E.twilioChat):e(e({},m),n||[]),{messages:i,chatUnreaded:(null==E?void 0:E.twilioChat.chatConversationId)&&(!(null==E?void 0:E.twilioChat.openChat)||!(null==E?void 0:E.twilioChat.visibilityChange))&&Object.keys(r).length>1,fullscreen:b,side:S}),null==E||E.goSetTwilioChat(l),I.current=i,[2,l];o.label=4;case 4:return[3,6];case 5:return l=e(e(e({},m),n||[]),{chatUserType:null,openChat:!1,fullscreen:b,side:S}),null==E||E.goSetTwilioChat(l),I.current=v,[2,l];case 6:return[3,8];case 7:return s=o.sent(),console.error("Error fetching active conversation:",s),[3,8];case 8:return[2]}})})};r(),localStorage.removeItem("title"),document.addEventListener("visibilitychange",function(){return t(void 0,void 0,void 0,function(){var t,n;return o(this,function(o){switch(o.label){case 0:return[4,r()];case 1:return(t=o.sent())&&("undefined"!=typeof document&&"visible"===document.visibilityState?(localStorage.getItem("title")&&(document.title=localStorage.getItem("title")||""),null==E||E.goSetTwilioChat(e(e({},t),{visibilityChange:!0,chatUnreaded:!1})),document.title=localStorage.getItem("title")||"",null===(n=document.getElementById("inputMessage"))||void 0===n||n.focus(),setTimeout(function(){return localStorage.removeItem("title")},1e3),localStorage.getItem("conversationId")&&y()):"hidden"===document.visibilityState?null==E||E.goSetTwilioChat(e(e({},t),{visibilityChange:!1})):null==E||E.goSetTwilioChat(e(e({},t),{visibilityChange:!0}))),[2]}})})})},[]),s(function(){"undefined"!=typeof document&&(b?(document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden"):(document.body.style.overflow="",document.documentElement.style.overflow=""))},[b]),"undefined"==typeof window?null:i.createElement(h,{className:"chat-body ".concat(S||"right")},i.createElement(d,null),!b&&i.createElement(a,null))},b=function(t){return i.createElement(u,null,i.createElement(C,e({},t)))};export{b as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/TwilioChat/index.tsx"],"sourcesContent":["import React, { useContext, useEffect, useRef, useState } from \"react\";\nimport Widget from \"./components/Widget\";\nimport ChatGlobalContext, { ChatGlobalProvider } from \"../context/ChatGlobalContext\";\nimport Chat from \"./Chat\";\nimport { defaultMessages, initialTwilioChatState } from \"../utils/chats\";\nimport ChatWrapper from \"./components/styled/ChatWrapper\";\nimport { Message, chatLocalStorage, findUnreadedMessages, getAllMessages, isConversationActive } from \"../services/chatService\";\nimport '../assets/styles/fonts.css';\nimport '../assets/styles/app.scss'\n\nconst TwilioChat2Inner = ({fullscreen = false, side = \"right\"}) => {\n const gContext: any = useContext(ChatGlobalContext);\n const messages = useRef<Message[]>([]);\n \n useEffect(() => { \n if(fullscreen && typeof document !== \"undefined\") document.getElementById(\"main_chat\")?.remove();\n // Check if Conversation is closed in mean time\n const fetchConversationActive = async () => {\n try {\n const response:any = await isConversationActive();\n if(response === \"CLOSED\"){\n gContext?.goResetTwilioChat();\n }\n } catch (error) {\n console.error(\"Error fetching is conversation active:\", error);\n }\n };\n fetchConversationActive(); \n\n // On reload get chat messages from previous session / on page reload\n const fetchExistingMessages = async (onlyMessages:boolean = false) => {\n try { \n const tmpLocalStorage = await chatLocalStorage(); \n if(chatLocalStorage('chatConversationId') && tmpLocalStorage){\n const tmpMessages:any = await getAllMessages(); \n if(tmpMessages){\n const tmpUnreadedMessages = await findUnreadedMessages(messages.current, tmpMessages);\n if(tmpMessages && tmpLocalStorage && tmpUnreadedMessages){ \n const tmpState = \n onlyMessages ? \n {\n ...gContext?.twilioChat,\n messages: tmpMessages,\n chatUnreaded: gContext?.twilioChat.chatConversationId && (!gContext?.twilioChat.openChat || !gContext?.twilioChat.visibilityChange) && Object.keys(tmpUnreadedMessages).length > 1,\n fullscreen: fullscreen,\n side: side\n } : \n {\n ...initialTwilioChatState, \n ...tmpLocalStorage || [],\n messages: tmpMessages,\n chatUnreaded: gContext?.twilioChat.chatConversationId && (!gContext?.twilioChat.openChat || !gContext?.twilioChat.visibilityChange) && Object.keys(tmpUnreadedMessages).length > 1,\n fullscreen: fullscreen,\n side: side\n };\n gContext?.goSetTwilioChat(tmpState);\n messages.current = tmpMessages;\n return tmpState; \n }\n }\n } else {\n const tmpState = {\n ...initialTwilioChatState,\n ...tmpLocalStorage || [],\n chatUserType: null,\n openChat: false,\n fullscreen: fullscreen,\n side: side\n }; \n gContext?.goSetTwilioChat(tmpState);\n messages.current = defaultMessages;\n return tmpState; \n }\n } catch (error) {\n console.error(\"Error fetching active conversation:\", error);\n }\n };\n fetchExistingMessages();\n \n localStorage.removeItem(\"title\");\n\n document.addEventListener('visibilitychange', async () => {\n const response:any = await fetchExistingMessages();\n if(response){\n if (typeof document !== \"undefined\" && document.visibilityState === 'visible') {\n if(localStorage.getItem(\"title\")){\n document.title = localStorage.getItem(\"title\") || \"\";\n } \n gContext?.goSetTwilioChat({ \n ...response,\n visibilityChange: true,\n chatUnreaded: false,\n });\n document.title = localStorage.getItem(\"title\") || \"\";\n document.getElementById('inputMessage')?.focus();\n setTimeout(() => localStorage.removeItem(\"title\"), 1000);\n localStorage.getItem('conversationId') && getAllMessages();\n } else if (document.visibilityState === 'hidden') {\n gContext?.goSetTwilioChat({ \n ...response,\n visibilityChange: false\n });\n } else {\n gContext?.goSetTwilioChat({ \n ...response,\n visibilityChange: true\n });\n }\n }\n });\n }, []);\n\n useEffect(() => {\n if (typeof document !== \"undefined\") {\n if (fullscreen) {\n document.body.style.overflow = 'hidden';\n document.documentElement.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = '';\n document.documentElement.style.overflow = '';\n }\n }\n }, [fullscreen])\n \n return (\n <ChatWrapper className={`chat-body ${side || 'right'}`}>\n <Chat />\n { !fullscreen && <Widget /> }\n </ChatWrapper>\n );\n};\n\nconst TwilioChat = (props) => (\n <ChatGlobalProvider>\n <TwilioChat2Inner {...props} />\n </ChatGlobalProvider>\n);\n\nexport default TwilioChat;\n"],"names":["TwilioChat2Inner","_a","_b","fullscreen","_c","side","gContext","useContext","ChatGlobalContext","messages","useRef","useEffect","document","getElementById","remove","__awaiter","isConversationActive","sent","goResetTwilioChat","console","error","error_1","fetchExistingMessages","onlyMessages","chatLocalStorage","tmpLocalStorage","getAllMessages","tmpMessages","findUnreadedMessages","current","tmpUnreadedMessages","tmpState","twilioChat","__assign","initialTwilioChatState","chatUnreaded","chatConversationId","openChat","visibilityChange","Object","keys","length","goSetTwilioChat","chatUserType","defaultMessages","error_2","localStorage","removeItem","addEventListener","response","visibilityState","getItem","title","focus","setTimeout","body","style","overflow","documentElement","React","createElement","ChatWrapper","className","concat","Chat","Widget","TwilioChat","props","ChatGlobalProvider"],"mappings":"+oBAUA,IAAMA,EAAmB,SAACC,OAACC,EAAAD,EAAAE,WAAAA,OAAU,IAAAD,GAAQA,EAAEE,EAAAH,EAAAI,KAAAA,OAAI,IAAAD,EAAG,QAAOA,EACnDE,EAAgBC,EAAWC,GAC3BC,EAAWC,EAAkB,IAgHnC,OA9GAC,EAAU,iBACHR,GAAkC,oBAAbS,WAA8D,QAApCX,EAAAW,SAASC,eAAe,oBAAY,IAAAZ,GAAAA,EAAEa,UAExDC,OAAA,OAAA,OAAA,EAAA,kEAEH,6BAAA,CAAA,EAAMC,kBAC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ASwC,MAAQN,aAAaK,QAAQ,UAAY,IAEtD7C,SAAAA,EAAUoC,gBAAeT,EAAAA,EAAA,CAAA,EAClBgB,GAAQ,CACXX,kBAAkB,EAClBH,cAAc,KAElBvB,SAASwC,MAAQN,aAAaK,QAAQ,UAAY,GACX,QAAvClD,EAAAW,SAASC,eAAe,uBAAe,IAAAZ,GAAAA,EAAEoD,QACzCC,WAAW,WAAM,OAAAR,aAAaC,WAAW,QAAxB,EAAkC,KACnDD,aAAaK,QAAQ,mBAAqBzB,KACN,WAA7Bd,SAASsC,gBAChB5C,SAAAA,EAAUoC,gBAAeT,EAAAA,EAAA,CAAA,EAClBgB,GAAQ,CACXX,kBAAkB,KAGtBhC,SAAAA,EAAUoC,gBAAeT,EAAAA,EAAA,CAAA,EAClBgB,GAAQ,CACXX,kBAAkB,YAIjC,EAAA,EACL,EAAG,IAEH3B,EAAU,WACgB,oBAAbC,WACLT,GACFS,SAAS2C,KAAKC,MAAMC,SAAW,SAC/B7C,SAAS8C,gBAAgBF,MAAMC,SAAW,WAE1C7C,SAAS2C,KAAKC,MAAMC,SAAW,GAC/B7C,SAAS8C,gBAAgBF,MAAMC,SAAW,IAGhD,EAAG,CAACtD,IAGAwD,EAAAC,cAACC,EAAW,CAACC,UAAW,aAAAC,OAAa1D,GAAQ,UACzCsD,EAAAC,cAACI,EAAI,OACF7D,GAAcwD,EAAAC,cAACK,EAAM,MAGpC,EAEMC,EAAa,SAACC,GAAU,OAC5BR,gBAACS,EAAkB,KACjBT,EAAAC,cAAC5D,OAAqBmE,IAFI"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/TwilioChat/index.tsx"],"sourcesContent":["import React, { useContext, useEffect, useRef, useState } from \"react\";\nimport Widget from \"./components/Widget\";\nimport ChatGlobalContext, { ChatGlobalProvider } from \"../context/ChatGlobalContext\";\nimport Chat from \"./Chat\";\nimport { defaultMessages, initialTwilioChatState } from \"../utils/chats\";\nimport ChatWrapper from \"./components/styled/ChatWrapper\";\nimport { Message, chatLocalStorage, findUnreadedMessages, getAllMessages, isConversationActive } from \"../services/chatService\";\nimport '../assets/styles/fonts.css';\nimport '../assets/styles/app.scss'\n\nconst TwilioChat2Inner = ({fullscreen = false, side = \"right\"}) => {\n const gContext: any = useContext(ChatGlobalContext);\n const messages = useRef<Message[]>([]);\n \n useEffect(() => { \n if(fullscreen && typeof document !== \"undefined\") document.getElementById(\"main_chat\")?.remove();\n // Check if Conversation is closed in mean time\n const fetchConversationActive = async () => {\n try {\n const response:any = await isConversationActive();\n if(response === \"CLOSED\"){\n gContext?.goResetTwilioChat();\n }\n } catch (error) {\n console.error(\"Error fetching is conversation active:\", error);\n }\n };\n fetchConversationActive(); \n\n // On reload get chat messages from previous session / on page reload\n const fetchExistingMessages = async (onlyMessages:boolean = false) => {\n try { \n const tmpLocalStorage = await chatLocalStorage(); \n if(chatLocalStorage('chatConversationId') && tmpLocalStorage){\n const tmpMessages:any = await getAllMessages(); \n if(tmpMessages){\n const tmpUnreadedMessages = await findUnreadedMessages(messages.current, tmpMessages);\n if(tmpMessages && tmpLocalStorage && tmpUnreadedMessages){ \n const tmpState = \n onlyMessages ? \n {\n ...gContext?.twilioChat,\n messages: tmpMessages,\n chatUnreaded: gContext?.twilioChat.chatConversationId && (!gContext?.twilioChat.openChat || !gContext?.twilioChat.visibilityChange) && Object.keys(tmpUnreadedMessages).length > 1,\n fullscreen: fullscreen,\n side: side\n } : \n {\n ...initialTwilioChatState, \n ...tmpLocalStorage || [],\n messages: tmpMessages,\n chatUnreaded: gContext?.twilioChat.chatConversationId && (!gContext?.twilioChat.openChat || !gContext?.twilioChat.visibilityChange) && Object.keys(tmpUnreadedMessages).length > 1,\n fullscreen: fullscreen,\n side: side\n };\n gContext?.goSetTwilioChat(tmpState);\n messages.current = tmpMessages;\n return tmpState; \n }\n }\n } else {\n const tmpState = {\n ...initialTwilioChatState,\n ...tmpLocalStorage || [],\n chatUserType: null,\n openChat: false,\n fullscreen: fullscreen,\n side: side\n }; \n gContext?.goSetTwilioChat(tmpState);\n messages.current = defaultMessages;\n return tmpState; \n }\n } catch (error) {\n console.error(\"Error fetching active conversation:\", error);\n }\n };\n fetchExistingMessages();\n \n localStorage.removeItem(\"title\");\n\n document.addEventListener('visibilitychange', async () => {\n const response:any = await fetchExistingMessages();\n if(response){\n if (typeof document !== \"undefined\" && document.visibilityState === 'visible') {\n if(localStorage.getItem(\"title\")){\n document.title = localStorage.getItem(\"title\") || \"\";\n } \n gContext?.goSetTwilioChat({ \n ...response,\n visibilityChange: true,\n chatUnreaded: false,\n });\n document.title = localStorage.getItem(\"title\") || \"\";\n document.getElementById('inputMessage')?.focus();\n setTimeout(() => localStorage.removeItem(\"title\"), 1000);\n localStorage.getItem('conversationId') && getAllMessages();\n } else if (document.visibilityState === 'hidden') {\n gContext?.goSetTwilioChat({ \n ...response,\n visibilityChange: false\n });\n } else {\n gContext?.goSetTwilioChat({ \n ...response,\n visibilityChange: true\n });\n }\n }\n });\n }, []);\n\n useEffect(() => {\n if (typeof document !== \"undefined\") {\n if (fullscreen) {\n document.body.style.overflow = 'hidden';\n document.documentElement.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = '';\n document.documentElement.style.overflow = '';\n }\n }\n }, [fullscreen])\n \n return typeof window === \"undefined\"\n ? null\n : (\n <ChatWrapper className={`chat-body ${side || 'right'}`}>\n <Chat />\n { !fullscreen && <Widget /> }\n </ChatWrapper>\n );\n};\n\nconst TwilioChat = (props) => (\n <ChatGlobalProvider>\n <TwilioChat2Inner {...props} />\n </ChatGlobalProvider>\n);\n\nexport default TwilioChat;\n"],"names":["TwilioChat2Inner","_a","_b","fullscreen","_c","side","gContext","useContext","ChatGlobalContext","messages","useRef","useEffect","document","getElementById","remove","__awaiter","isConversationActive","sent","goResetTwilioChat","console","error","error_1","fetchExistingMessages","onlyMessages","chatLocalStorage","tmpLocalStorage","getAllMessages","tmpMessages","findUnreadedMessages","current","tmpUnreadedMessages","tmpState","twilioChat","__assign","initialTwilioChatState","chatUnreaded","chatConversationId","openChat","visibilityChange","Object","keys","length","goSetTwilioChat","chatUserType","defaultMessages","error_2","localStorage","removeItem","addEventListener","response","visibilityState","getItem","title","focus","setTimeout","body","style","overflow","documentElement","window","React","createElement","ChatWrapper","className","concat","Chat","Widget","TwilioChat","props","ChatGlobalProvider"],"mappings":"+oBAUA,IAAMA,EAAmB,SAACC,OAACC,EAAAD,EAAAE,WAAAA,OAAU,IAAAD,GAAQA,EAAEE,EAAAH,EAAAI,KAAAA,OAAI,IAAAD,EAAG,QAAOA,EACnDE,EAAgBC,EAAWC,GAC3BC,EAAWC,EAAkB,IAgHnC,OA9GAC,EAAU,iBACHR,GAAkC,oBAAbS,WAA8D,QAApCX,EAAAW,SAASC,eAAe,oBAAY,IAAAZ,GAAAA,EAAEa,UAExDC,OAAA,OAAA,OAAA,EAAA,kEAEH,6BAAA,CAAA,EAAMC,kBACX,WADKf,EAAAgB,SAEnBX,SAAAA,EAAUY,oDAGdC,QAAQC,MAAM,yCAA0CC,+BAM9D,IAAMC,EAAwB,gHAAOC,6BAAA,IAAAA,IAAAA,GAAA,6CAEL,6BAAA,CAAA,EAAMC,mBAAxBC,EAAkBxB,EAAAgB,OACrBO,EAAiB,uBAAyBC,EACjB,CAAA,EAAMC,KAD/B,CAAA,EAAA,UAEI,OADGC,EAAkB1B,EAAAgB,QAEQ,CAAA,EAAMW,EAAqBnB,EAASoB,QAASF,IAD1E,CAAA,EAAA,UAEC,GADMG,EAAsB7B,EAAAgB,OACzBU,GAAeF,GAAmBK,EAoBjC,OAnBMC,IACNR,OAEWjB,aAAQ,EAARA,EAAU0B,YAKdC,EAAAA,EAAA,CAAA,EAEIC,GACAT,GAAmB,IARC,CACvBhB,SAAUkB,EACVQ,cAAc7B,eAAAA,EAAU0B,WAAWI,wBAAwB9B,aAAQ,EAARA,EAAU0B,WAAWK,aAAa/B,aAAQ,EAARA,EAAU0B,WAAWM,oBAAqBC,OAAOC,KAAKV,GAAqBW,OAAS,EACjLtC,WAAYA,EAC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/B7C,SAAS8C,gBAAgBF,MAAMC,SAAW,IAGhD,EAAG,CAACtD,IAEqB,oBAAXwD,OACZ,KAEEC,EAAAC,cAACC,EAAW,CAACC,UAAW,aAAAC,OAAa3D,GAAQ,UACzCuD,EAAAC,cAACI,EAAI,OACF9D,GAAcyD,EAAAC,cAACK,EAAM,MAGpC,EAEMC,EAAa,SAACC,GAAU,OAC5BR,gBAACS,EAAkB,KACjBT,EAAAC,cAAC7D,OAAqBoE,IAFI"}
@@ -1,2 +1,2 @@
1
- import{__assign as t,__rest as e}from"../../node_modules/tslib/tslib.es6.js";import i,{useState as o,createContext as a}from"react";import{initialTwilioSettingsState as s,initialTwilioTimerState as n,initialTwilioChatState as r}from"../utils/chats.js";var l=a({}),g=function(a){var g=a.children,c=o({}),f=c[0],u=c[1],m=o({}),w=m[0],S=m[1],h=o(null),d=h[0],T=h[1],p=o({}),v=p[0],y=p[1],C=o({}),I=C[0],R=C[1],D=o({}),J=D[0],N=D[1],O=o(!1),b=O[0],A=O[1],B=o(!1),M=B[0],j=B[1],G=function(t){u(t),"undefined"!=typeof window&&localStorage.setItem("webchatData",JSON.stringify(t))};return i.createElement(l.Provider,{value:{webchatData:f,appMessages:w,twilioChat:v,twilioTimer:I,setAppMessages:S,goGetTwilioChat:function(){return v},goSetTwilioChat:function(t){if(t&&y(t),"undefined"!=typeof window&&window){var i=t||{};i.messages;var o=e(i,["messages"]);localStorage.setItem("twilioChat",JSON.stringify(o))}},goResetTwilioChat:function(){var i=t(t({},r),{openChat:v.openChat,fullscreen:v.fullscreen,side:v.side});y(i),i.messages;var o=e(i,["messages"]);localStorage.setItem("twilioChat",JSON.stringify(o))},goSetTwilioTimer:function(t){t&&(R(t),localStorage.setItem("twilioTimer",JSON.stringify(t)))},goResetTwilioTimer:function(){var e=t(t({},n),{chatUnreaded:!1,lastTimeActive:null});localStorage.removeItem("timer"),R(e),localStorage.setItem("twilioTimer",JSON.stringify(e))},goSetTwilioSettings:function(t){t&&(N(t),localStorage.setItem("twilioSettings",JSON.stringify(t)))},goResetTwilioSettings:function(){var e=t(t({},s),{fullscreen:!1,side:"right"});N(e),localStorage.setItem("twilioSettings",JSON.stringify(e))},twilioSettings:J,showAgentBanner:b,setShowAgentBanner:A,showBusinessModal:M,setShowBusinessModal:j,goSetWebchatData:G,goResetWebchatData:function(){G(null)},goSetRegistrationData:T,goResetRegistrationData:function(){return T(null)},goGetRegistrationData:function(){return d}}},g)};export{g as ChatGlobalProvider,l as default};
1
+ import{__assign as t,__rest as e}from"../../node_modules/tslib/tslib.es6.js";import i,{createContext as o,useState as a}from"react";import{initialTwilioSettingsState as s,initialTwilioTimerState as n,initialTwilioChatState as r}from"../utils/chats.js";var l=o({}),g=function(o){var g=o.children,c=a({}),f=c[0],u=c[1],m=a({}),w=m[0],S=m[1],h=a(null),d=h[0],T=h[1],p=a({}),v=p[0],y=p[1],C=a({}),I=C[0],R=C[1],D=a({}),J=D[0],N=D[1],O=a(!1),b=O[0],A=O[1],B=a(!1),M=B[0],j=B[1],G=function(t){u(t),"undefined"!=typeof window&&localStorage.setItem("webchatData",JSON.stringify(t))};return i.createElement(l.Provider,{value:{webchatData:f,appMessages:w,twilioChat:v,twilioTimer:I,setAppMessages:S,goGetTwilioChat:function(){return v},goSetTwilioChat:function(t){if(t&&y(t),"undefined"!=typeof window&&window){var i=t||{};i.messages;var o=e(i,["messages"]);localStorage.setItem("twilioChat",JSON.stringify(o))}},goResetTwilioChat:function(){var i=t(t({},r),{openChat:v.openChat,fullscreen:v.fullscreen,side:v.side});y(i),i.messages;var o=e(i,["messages"]);localStorage.setItem("twilioChat",JSON.stringify(o))},goSetTwilioTimer:function(t){t&&(R(t),localStorage.setItem("twilioTimer",JSON.stringify(t)))},goResetTwilioTimer:function(){var e=t(t({},n),{chatUnreaded:!1,lastTimeActive:null});localStorage.removeItem("timer"),R(e),localStorage.setItem("twilioTimer",JSON.stringify(e))},goSetTwilioSettings:function(t){t&&(N(t),localStorage.setItem("twilioSettings",JSON.stringify(t)))},goResetTwilioSettings:function(){var e=t(t({},s),{fullscreen:!1,side:"right"});N(e),localStorage.setItem("twilioSettings",JSON.stringify(e))},twilioSettings:J,showAgentBanner:b,setShowAgentBanner:A,showBusinessModal:M,setShowBusinessModal:j,goSetWebchatData:G,goResetWebchatData:function(){G(null)},goSetRegistrationData:T,goResetRegistrationData:function(){return T(null)},goGetRegistrationData:function(){return d}}},g)};export{g as ChatGlobalProvider,l as default};
2
2
  //# sourceMappingURL=ChatGlobalContext.js.map
package/dist/src/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import e,{useState as n,useEffect as t}from"react";var r=function(r){var i=r.side,u=void 0===i?"right":i,o=r.fullscreen,l=void 0!==o&&o,f=n(null),d=f[0],a=f[1];return t(function(){"undefined"!=typeof window&&import("./TwilioChat/index.js").then(function(e){return a(function(){return e.default})})},[]),d?e.createElement(d,{side:u,fullscreen:l}):null};export{r as default};
1
+ import e from"react";import r from"./TwilioChat/index.js";function i(i){var t=i.side,o=void 0===t?"right":t,l=i.fullscreen,n=void 0!==l&&l;return e.createElement(r,{side:o,fullscreen:n})}export{i as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\ninterface Props {\n side?: string;\n fullscreen?: boolean;\n}\n\nconst App: React.FC<Props> = ({ side = 'right', fullscreen = false }) => {\n const [TwilioChat, setTwilioChat] = useState<React.ComponentType<Props> | null>(null);\n\n useEffect(() => {\n if (typeof window !== 'undefined') {\n import('./TwilioChat').then(module => setTwilioChat(() => module.default));\n }\n }, []);\n\n if (!TwilioChat) return null;\n\n return <TwilioChat side={side} fullscreen={fullscreen} />;\n};\n\nexport default App;"],"names":["App","_a","_b","side","_c","fullscreen","_d","useState","TwilioChat","setTwilioChat","useEffect","window","import","then","module","default","React","createElement"],"mappings":"mDAOA,IAAMA,EAAuB,SAACC,OAAEC,EAAAD,EAAAE,KAAAA,OAAI,IAAAD,EAAG,QAAOA,EAAEE,EAAAH,EAAAI,WAAAA,OAAU,IAAAD,GAAQA,EAC1DE,EAA8BC,EAA4C,MAAzEC,EAAUF,EAAA,GAAEG,EAAaH,EAAA,GAQhC,OANAI,EAAU,WACc,oBAAXC,QACTC,OAAO,yBAAgBC,KAAK,SAAAC,GAAU,OAAAL,EAAc,WAAM,OAAAK,EAAOC,OAAP,EAApB,EAE1C,EAAG,IAEEP,EAEEQ,EAAAC,cAACT,EAAU,CAACL,KAAMA,EAAME,WAAYA,IAFnB,IAG1B"}
1
+ {"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport TwilioChat from './TwilioChat';\n\ninterface Props {\n side: string;\n fullscreen: boolean;\n}\n\nfunction App({ side = 'right', fullscreen = false }: Props) {\n return (\n <TwilioChat\n side={side}\n fullscreen={fullscreen}\n />\n );\n}\n\nexport default App;\n"],"names":["App","_a","_b","side","_c","fullscreen","React","createElement","TwilioChat"],"mappings":"0DAQA,SAASA,EAAIC,OAAEC,EAAAD,EAAAE,KAAAA,OAAI,IAAAD,EAAG,QAAOA,EAAEE,EAAAH,EAAAI,WAAAA,OAAU,IAAAD,GAAQA,EAC/C,OACEE,EAAAC,cAACC,EAAU,CACTL,KAAMA,EACNE,WAAYA,GAGlB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d19n/webchat",
3
- "version": "1.1.33",
3
+ "version": "1.1.35",
4
4
  "description": "D19N WebChat package",
5
5
  "author": "@d19n",
6
6
  "license": "ISC",
@@ -22,21 +22,7 @@
22
22
  "dependencies": {
23
23
  "@d19n/odin-sdk-generator": "^3.0.166",
24
24
  "@d19n/odin-types": "^1.0.62",
25
- "@d19n/youfibre-odin-sdk": "^1.0.125"
26
- },
27
- "peerDependencies": {
28
- "axios": "^1.11.0",
29
- "react": ">=18.2.0 <21",
30
- "react-dom": ">=18.2.0 <21"
31
- },
32
- "devDependencies": {
33
- "@types/node": "^24.1.0",
34
- "@types/react": "^18.3.23",
35
- "@types/react-dom": "^18.3.7",
36
- "@types/react-modal-image": "^2.6.4",
37
- "@types/styled-components": "^5.1.34",
38
- "tslib": "^2.8.1",
39
- "typescript": "^5.8.3",
25
+ "@d19n/youfibre-odin-sdk": "^1.0.125",
40
26
  "@rollup/plugin-commonjs": "^28.0.6",
41
27
  "@rollup/plugin-json": "^6.1.0",
42
28
  "@rollup/plugin-node-resolve": "^16.0.1",
@@ -68,12 +54,25 @@
68
54
  "sass": "^1.87.0",
69
55
  "sass-loader": "^10.5.2",
70
56
  "socket.io-client": "^4.7.5",
71
- "styled-components": "^5.3.11",
57
+ "styled-components": "^6.1.8",
72
58
  "ts-node": "^10.9.2",
73
59
  "use-debounce": "^10.0.5",
74
- "postcss": "^8.4.32",
75
60
  "uuid": "^11.1.0"
76
61
  },
62
+ "peerDependencies": {
63
+ "axios": "^1.11.0",
64
+ "react": ">=18.2.0 <21",
65
+ "react-dom": ">=18.2.0 <21"
66
+ },
67
+ "devDependencies": {
68
+ "@types/node": "^24.1.0",
69
+ "@types/react": "^18.3.23",
70
+ "@types/react-dom": "^18.3.7",
71
+ "@types/react-modal-image": "^2.6.4",
72
+ "@types/styled-components": "^5.1.34",
73
+ "tslib": "^2.8.1",
74
+ "typescript": "^5.8.3"
75
+ },
77
76
  "keywords": [
78
77
  "webchat",
79
78
  "chat"
@@ -1,2 +0,0 @@
1
- import{getDefaultExportFromCjs as s}from"./_commonjsHelpers.js";import{__require as o}from"../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js";var t=s(o());export{t as default};
2
- //# sourceMappingURL=hoist-non-react-statics.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hoist-non-react-statics.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- var r={};export{r as __exports};
2
- //# sourceMappingURL=index12.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index12.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import e from"../../memoize/dist/emotion-memoize.esm.js";var t=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,r=e(function(e){return t.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91});export{r as default};
2
- //# sourceMappingURL=emotion-is-prop-valid.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"emotion-is-prop-valid.esm.js","sources":["../../../../../node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js"],"sourcesContent":["import memoize from '@emotion/memoize';\n\n// eslint-disable-next-line no-undef\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar isPropValid = /* #__PURE__ */memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport { isPropValid as default };\n"],"names":["reactPropsRegex","isPropValid","memoize","prop","test","charCodeAt"],"mappings":"yDAGA,IAAIA,EAAkB,gjIAElBC,EAA6BC,EAAQ,SAAUC,GACjD,OAAOH,EAAgBI,KAAKD,IAAgC,MAAvBA,EAAKE,WAAW,IAE3B,MAAvBF,EAAKE,WAAW,IAEhBF,EAAKE,WAAW,GAAK,EAC1B","x_google_ignoreList":[0]}
@@ -1,2 +0,0 @@
1
- function t(t){var e=Object.create(null);return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}export{t as default};
2
- //# sourceMappingURL=emotion-memoize.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"emotion-memoize.esm.js","sources":["../../../../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js"],"sourcesContent":["function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport { memoize as default };\n"],"names":["memoize","fn","cache","Object","create","arg","undefined"],"mappings":"AAAA,SAASA,EAAQC,GACf,IAAIC,EAAQC,OAAOC,OAAO,MAC1B,OAAO,SAAUC,GAEf,YADmBC,IAAfJ,EAAMG,KAAoBH,EAAMG,GAAOJ,EAAGI,IACvCH,EAAMG,EACf,CACF","x_google_ignoreList":[0]}
@@ -1,2 +0,0 @@
1
- function e(e){function r(e,t,l,f,h){for(var u,k,d,w,C,v=0,x=0,$=0,O=0,z=0,D=0,F=d=u=0,H=0,I=0,J=0,K=0,L=l.length,M=L-1,N="",P="",Q="",R="";H<L;){if(k=l.charCodeAt(H),H===M&&0!==x+O+$+v&&(0!==x&&(k=47===x?10:47),O=$=v=0,L++,M++),0===x+O+$+v){if(H===M&&(0<I&&(N=N.replace(b,"")),0<N.trim().length)){switch(k){case 32:case 9:case 59:case 13:case 10:break;default:N+=l.charAt(H)}k=59}switch(k){case 123:for(u=(N=N.trim()).charCodeAt(0),d=1,K=++H;H<L;){switch(k=l.charCodeAt(H)){case 123:d++;break;case 125:d--;break;case 47:switch(k=l.charCodeAt(H+1)){case 42:case 47:e:{for(F=H+1;F<M;++F)switch(l.charCodeAt(F)){case 47:if(42===k&&42===l.charCodeAt(F-1)&&H+2!==F){H=F+1;break e}break;case 10:if(47===k){H=F+1;break e}}H=F}}break;case 91:k++;case 40:k++;case 34:case 39:for(;H++<M&&l.charCodeAt(H)!==k;);}if(0===d)break;H++}if(d=l.substring(K,H),0===u&&(u=(N=N.replace(o,"").trim()).charCodeAt(0)),64===u){switch(0<I&&(N=N.replace(b,"")),k=N.charCodeAt(1)){case 100:case 109:case 115:case 45:I=t;break;default:I=B}if(K=(d=r(t,I,d,k,h+1)).length,0<E&&(C=n(3,d,I=a(B,N,J),t,j,y,K,k,h,f),N=I.join(""),void 0!==C&&0===(K=(d=C.trim()).length)&&(k=0,d="")),0<K)switch(k){case 115:N=N.replace(m,i);case 100:case 109:case 45:d=N+"{"+d+"}";break;case 107:d=(N=N.replace(p,"$1 $2"))+"{"+d+"}",d=1===q||2===q&&s("@"+d,3)?"@-webkit-"+d+"@"+d:"@"+d;break;default:d=N+d,112===f&&(P+=d,d="")}else d=""}else d=r(t,a(t,N,J),d,f,h+1);Q+=d,d=J=I=F=u=0,N="",k=l.charCodeAt(++H);break;case 125:case 59:if(1<(K=(N=(0<I?N.replace(b,""):N).trim()).length))switch(0===F&&(u=N.charCodeAt(0),45===u||96<u&&123>u)&&(K=(N=N.replace(" ",":")).length),0<E&&void 0!==(C=n(1,N,t,e,j,y,P.length,f,h,f))&&0===(K=(N=C.trim()).length)&&(N="\0\0"),u=N.charCodeAt(0),k=N.charCodeAt(1),u){case 0:break;case 64:if(105===k||99===k){R+=N+l.charAt(H);break}default:58!==N.charCodeAt(K-1)&&(P+=c(N,u,k,N.charCodeAt(2)))}J=I=F=u=0,N="",k=l.charCodeAt(++H)}}switch(k){case 13:case 10:47===x?x=0:0===1+u&&107!==f&&0<N.length&&(I=1,N+="\0"),0<E*G&&n(0,N,t,e,j,y,P.length,f,h,f),y=1,j++;break;case 59:case 125:if(0===x+O+$+v){y++;break}default:switch(y++,w=l.charAt(H),k){case 9:case 32:if(0===O+v+x)switch(z){case 44:case 58:case 9:case 32:w="";break;default:32!==k&&(w=" ")}break;case 0:w="\\0";break;case 12:w="\\f";break;case 11:w="\\v";break;case 38:0===O+x+v&&(I=J=1,w="\f"+w);break;case 108:if(0===O+x+v+S&&0<F)switch(H-F){case 2:112===z&&58===l.charCodeAt(H-3)&&(S=z);case 8:111===D&&(S=D)}break;case 58:0===O+x+v&&(F=H);break;case 44:0===x+$+O+v&&(I=1,w+="\r");break;case 34:case 39:0===x&&(O=O===k?0:0===O?k:O);break;case 91:0===O+x+$&&v++;break;case 93:0===O+x+$&&v--;break;case 41:0===O+x+v&&$--;break;case 40:if(0===O+x+v){if(0===u)if(2*z+3*D==533);else u=1;$++}break;case 64:0===x+$+O+v+F+d&&(d=1);break;case 42:case 47:if(!(0<O+v+$))switch(x){case 0:switch(2*k+3*l.charCodeAt(H+1)){case 235:x=47;break;case 220:K=H,x=42}break;case 42:47===k&&42===z&&K+2!==H&&(33===l.charCodeAt(K+2)&&(P+=l.substring(K,H+1)),w="",x=0)}}0===x&&(N+=w)}D=z,z=k,H++}if(0<(K=P.length)){if(I=t,0<E&&(void 0!==(C=n(2,P,I,e,j,y,K,f,h,f))&&0===(P=C).length))return R+P+Q;if(P=I.join(",")+"{"+P+"}",0!==q*S){switch(2!==q||s(P,2)||(S=0),S){case 111:P=P.replace(A,":-moz-$1")+P;break;case 112:P=P.replace(g,"::-webkit-input-$1")+P.replace(g,"::-moz-$1")+P.replace(g,":-ms-input-$1")+P}S=0}}return R+P+Q}function a(e,r,a){var c=r.trim().split(d);r=c;var s=c.length,i=e.length;switch(i){case 0:case 1:var n=0;for(e=0===i?"":e[0]+" ";n<s;++n)r[n]=t(e,r[n],a).trim();break;default:var l=n=0;for(r=[];n<s;++n)for(var f=0;f<i;++f)r[l++]=t(e[f]+" ",c[n],a).trim()}return r}function t(e,r,a){var t=r.charCodeAt(0);switch(33>t&&(t=(r=r.trim()).charCodeAt(0)),t){case 38:return r.replace(w,"$1"+e.trim());case 58:return e.trim()+r.replace(w,"$1"+e.trim());default:if(0<1*a&&0<r.indexOf("\f"))return r.replace(w,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+r}function c(e,r,a,t){var i=e+";",n=2*r+3*a+4*t;if(944===n){e=i.indexOf(":",9)+1;var l=i.substring(e,i.length-1).trim();return l=i.substring(0,e).trim()+l+";",1===q||2===q&&s(l,1)?"-webkit-"+l+l:l}if(0===q||2===q&&!s(i,1))return i;switch(n){case 1015:return 97===i.charCodeAt(10)?"-webkit-"+i+i:i;case 951:return 116===i.charCodeAt(3)?"-webkit-"+i+i:i;case 963:return 110===i.charCodeAt(5)?"-webkit-"+i+i:i;case 1009:if(100!==i.charCodeAt(4))break;case 969:case 942:return"-webkit-"+i+i;case 978:return"-webkit-"+i+"-moz-"+i+i;case 1019:case 983:return"-webkit-"+i+"-moz-"+i+"-ms-"+i+i;case 883:if(45===i.charCodeAt(8))return"-webkit-"+i+i;if(0<i.indexOf("image-set(",11))return i.replace(z,"$1-webkit-$2")+i;break;case 932:if(45===i.charCodeAt(4))switch(i.charCodeAt(5)){case 103:return"-webkit-box-"+i.replace("-grow","")+"-webkit-"+i+"-ms-"+i.replace("grow","positive")+i;case 115:return"-webkit-"+i+"-ms-"+i.replace("shrink","negative")+i;case 98:return"-webkit-"+i+"-ms-"+i.replace("basis","preferred-size")+i}return"-webkit-"+i+"-ms-"+i+i;case 964:return"-webkit-"+i+"-ms-flex-"+i+i;case 1023:if(99!==i.charCodeAt(8))break;return"-webkit-box-pack"+(l=i.substring(i.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+i+"-ms-flex-pack"+l+i;case 1005:return u.test(i)?i.replace(h,":-webkit-")+i.replace(h,":-moz-")+i:i;case 1e3:switch(r=(l=i.substring(13).trim()).indexOf("-")+1,l.charCodeAt(0)+l.charCodeAt(r)){case 226:l=i.replace(C,"tb");break;case 232:l=i.replace(C,"tb-rl");break;case 220:l=i.replace(C,"lr");break;default:return i}return"-webkit-"+i+"-ms-"+l+i;case 1017:if(-1===i.indexOf("sticky",9))break;case 975:switch(r=(i=e).length-10,n=(l=(33===i.charCodeAt(r)?i.substring(0,r):i).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|l.charCodeAt(7))){case 203:if(111>l.charCodeAt(8))break;case 115:i=i.replace(l,"-webkit-"+l)+";"+i;break;case 207:case 102:i=i.replace(l,"-webkit-"+(102<n?"inline-":"")+"box")+";"+i.replace(l,"-webkit-"+l)+";"+i.replace(l,"-ms-"+l+"box")+";"+i}return i+";";case 938:if(45===i.charCodeAt(5))switch(i.charCodeAt(6)){case 105:return l=i.replace("-items",""),"-webkit-"+i+"-webkit-box-"+l+"-ms-flex-"+l+i;case 115:return"-webkit-"+i+"-ms-flex-item-"+i.replace(x,"")+i;default:return"-webkit-"+i+"-ms-flex-line-pack"+i.replace("align-content","").replace(x,"")+i}break;case 973:case 989:if(45!==i.charCodeAt(3)||122===i.charCodeAt(4))break;case 931:case 953:if(!0===O.test(e))return 115===(l=e.substring(e.indexOf(":")+1)).charCodeAt(0)?c(e.replace("stretch","fill-available"),r,a,t).replace(":fill-available",":stretch"):i.replace(l,"-webkit-"+l)+i.replace(l,"-moz-"+l.replace("fill-",""))+i;break;case 962:if(i="-webkit-"+i+(102===i.charCodeAt(5)?"-ms-"+i:"")+i,211===a+t&&105===i.charCodeAt(13)&&0<i.indexOf("transform",10))return i.substring(0,i.indexOf(";",27)+1).replace(k,"$1-webkit-$2")+i}return i}function s(e,r){var a=e.indexOf(1===r?":":"{"),t=e.substring(0,3!==r?a:10);return a=e.substring(a+1,e.length-1),F(2!==r?t:t.replace($,"$1"),a,r)}function i(e,r){var a=c(r,r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2));return a!==r+";"?a.replace(v," or ($1)").substring(4):"("+r+")"}function n(e,r,a,t,c,s,i,n,l,o){for(var b,h=0,u=r;h<E;++h)switch(b=D[h].call(f,e,u,a,t,c,s,i,n,l,o)){case void 0:case!1:case!0:case null:break;default:u=b}if(u!==r)return u}function l(e){return void 0!==(e=e.prefix)&&(F=null,e?"function"!=typeof e?q=1:(q=2,F=e):q=0),l}function f(e,a){var t=e;if(33>t.charCodeAt(0)&&(t=t.trim()),t=[t],0<E){var c=n(-1,a,t,t,j,y,0,0,0,0);void 0!==c&&"string"==typeof c&&(a=c)}var s=r(B,t,a,0,0);return 0<E&&(void 0!==(c=n(-2,s,t,t,j,y,s.length,0,0,0))&&(s=c)),S=0,y=j=1,s}var o=/^\0+/g,b=/[\0\r\f]/g,h=/: */g,u=/zoo|gra/,k=/([,: ])(transform)/g,d=/,\r+?/g,w=/([\t\r\n ])*\f?&/g,p=/@(k\w+)\s*(\S*)\s*/,g=/::(place)/g,A=/:(read-only)/g,C=/[svh]\w+-[tblr]{2}/,m=/\(\s*(.*)\s*\)/g,v=/([\s\S]*?);/g,x=/-self|flex-/g,$=/[^]*?(:[rp][el]a[\w-]+)[^]*/,O=/stretch|:\s*\w+\-(?:conte|avail)/,z=/([^-])(image-set\()/,y=1,j=1,S=0,q=1,B=[],D=[],E=0,F=null,G=0;return f.use=function e(r){switch(r){case void 0:case null:E=D.length=0;break;default:if("function"==typeof r)D[E++]=r;else if("object"==typeof r)for(var a=0,t=r.length;a<t;++a)e(r[a]);else G=0|!!r}return e},f.set=l,void 0!==e&&l(e),f}export{e as default};
2
- //# sourceMappingURL=stylis.browser.esm.js.map