react-native-srschat 0.1.7 → 0.1.9

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 (62) hide show
  1. package/README.md +70 -0
  2. package/lib/commonjs/assets/heritage.png +0 -0
  3. package/lib/commonjs/components/header.js +105 -0
  4. package/lib/commonjs/components/header.js.map +1 -0
  5. package/lib/commonjs/components/testing.js +61 -0
  6. package/lib/commonjs/components/testing.js.map +1 -0
  7. package/lib/commonjs/contexts/AppContext.js +99 -0
  8. package/lib/commonjs/contexts/AppContext.js.map +1 -0
  9. package/lib/commonjs/hooks/Stream.js +202 -0
  10. package/lib/commonjs/hooks/Stream.js.map +1 -0
  11. package/lib/commonjs/index.js +13 -262
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/layout/chatIcon.js +53 -0
  14. package/lib/commonjs/layout/chatIcon.js.map +1 -0
  15. package/lib/commonjs/layout/chatWindow.js +208 -0
  16. package/lib/commonjs/layout/chatWindow.js.map +1 -0
  17. package/lib/commonjs/layout/layout.js +35 -0
  18. package/lib/commonjs/layout/layout.js.map +1 -0
  19. package/lib/module/assets/heritage.png +0 -0
  20. package/lib/module/components/header.js +96 -0
  21. package/lib/module/components/header.js.map +1 -0
  22. package/lib/module/components/testing.js +53 -0
  23. package/lib/module/components/testing.js.map +1 -0
  24. package/lib/module/contexts/AppContext.js +90 -0
  25. package/lib/module/contexts/AppContext.js.map +1 -0
  26. package/lib/module/hooks/Stream.js +194 -0
  27. package/lib/module/hooks/Stream.js.map +1 -0
  28. package/lib/module/index.js +11 -261
  29. package/lib/module/index.js.map +1 -1
  30. package/lib/module/layout/chatIcon.js +44 -0
  31. package/lib/module/layout/chatIcon.js.map +1 -0
  32. package/lib/module/layout/chatWindow.js +199 -0
  33. package/lib/module/layout/chatWindow.js.map +1 -0
  34. package/lib/module/layout/layout.js +26 -0
  35. package/lib/module/layout/layout.js.map +1 -0
  36. package/lib/typescript/components/header.d.ts +3 -0
  37. package/lib/typescript/components/header.d.ts.map +1 -0
  38. package/lib/typescript/components/testing.d.ts +6 -0
  39. package/lib/typescript/components/testing.d.ts.map +1 -0
  40. package/lib/typescript/contexts/AppContext.d.ts +6 -0
  41. package/lib/typescript/contexts/AppContext.d.ts.map +1 -0
  42. package/lib/typescript/hooks/Stream.d.ts +2 -0
  43. package/lib/typescript/hooks/Stream.d.ts.map +1 -0
  44. package/lib/typescript/index.d.ts +5 -12
  45. package/lib/typescript/index.d.ts.map +1 -1
  46. package/lib/typescript/layout/chatIcon.d.ts +3 -0
  47. package/lib/typescript/layout/chatIcon.d.ts.map +1 -0
  48. package/lib/typescript/layout/chatWindow.d.ts +6 -0
  49. package/lib/typescript/layout/chatWindow.d.ts.map +1 -0
  50. package/lib/typescript/layout/layout.d.ts +6 -0
  51. package/lib/typescript/layout/layout.d.ts.map +1 -0
  52. package/package.json +1 -1
  53. package/src/assets/heritage.png +0 -0
  54. package/src/components/header.js +89 -0
  55. package/src/components/testing.js +47 -0
  56. package/src/contexts/AppContext.js +83 -0
  57. package/src/hooks/Stream.js +198 -0
  58. package/src/index.js +18 -0
  59. package/src/layout/chatIcon.js +38 -0
  60. package/src/layout/chatWindow.js +200 -0
  61. package/src/layout/layout.js +23 -0
  62. package/src/index.tsx +0 -323
@@ -0,0 +1,96 @@
1
+ import React, { useContext } from 'react';
2
+ import { View, Text, TouchableOpacity, StyleSheet, Image } from 'react-native';
3
+ import { Ionicons as Icon } from '@expo/vector-icons';
4
+ import { AppContext } from '../contexts/AppContext';
5
+ export const Header = () => {
6
+ const {
7
+ setShowModal
8
+ } = useContext(AppContext);
9
+ return /*#__PURE__*/React.createElement(View, {
10
+ style: styles.header
11
+ }, /*#__PURE__*/React.createElement(View, {
12
+ style: styles.section
13
+ }, /*#__PURE__*/React.createElement(Image, {
14
+ source: require('../assets/heritage.png'),
15
+ style: styles.logo
16
+ })), /*#__PURE__*/React.createElement(View, {
17
+ style: [styles.section, styles.titleContainer]
18
+ }, /*#__PURE__*/React.createElement(View, {
19
+ style: styles.titleWrapper
20
+ }, /*#__PURE__*/React.createElement(Text, {
21
+ style: styles.title
22
+ }, "Poseidon"), /*#__PURE__*/React.createElement(Text, {
23
+ style: styles.betaText
24
+ }, /*#__PURE__*/React.createElement(Icon, {
25
+ style: styles.icon,
26
+ name: "sparkles-outline",
27
+ size: 10,
28
+ color: "#007AFF"
29
+ }), "beta"))), /*#__PURE__*/React.createElement(View, {
30
+ style: styles.iconsSection
31
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
32
+ onPress: () => setShowModal("Icon")
33
+ }, /*#__PURE__*/React.createElement(Icon, {
34
+ name: "trash",
35
+ size: 24,
36
+ color: "gray"
37
+ })), /*#__PURE__*/React.createElement(TouchableOpacity, {
38
+ onPress: () => setShowModal("Icon")
39
+ }, /*#__PURE__*/React.createElement(Icon, {
40
+ name: "chevron-down",
41
+ size: 24,
42
+ color: "gray"
43
+ }))));
44
+ };
45
+ const styles = StyleSheet.create({
46
+ header: {
47
+ flexDirection: 'row',
48
+ alignItems: 'center',
49
+ backgroundColor: '#f6f6f6',
50
+ padding: 16,
51
+ borderBottomWidth: 1,
52
+ borderBottomColor: '#ddd'
53
+ },
54
+ section: {
55
+ flex: 1,
56
+ alignItems: 'center'
57
+ },
58
+ iconsSection: {
59
+ flex: 1,
60
+ display: 'flex',
61
+ flexDirection: 'row',
62
+ alignItems: 'center',
63
+ justifyContent: 'flex-end'
64
+ },
65
+ logo: {
66
+ width: 100,
67
+ height: 40,
68
+ resizeMode: 'contain'
69
+ },
70
+ icon: {
71
+ paddingLeft: 2,
72
+ paddingRight: 2
73
+ },
74
+ titleContainer: {
75
+ flex: 2 // Slightly larger space for the title
76
+ },
77
+ titleWrapper: {
78
+ alignItems: 'center',
79
+ justifyContent: 'center'
80
+ },
81
+ title: {
82
+ fontSize: 20,
83
+ fontWeight: 'medium',
84
+ color: '#000',
85
+ textAlign: 'center',
86
+ flexDirection: 'row'
87
+ },
88
+ betaText: {
89
+ fontSize: 12,
90
+ color: 'gray',
91
+ position: 'absolute',
92
+ top: -10,
93
+ right: -35
94
+ }
95
+ });
96
+ //# sourceMappingURL=header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useContext","View","Text","TouchableOpacity","StyleSheet","Image","Ionicons","Icon","AppContext","Header","setShowModal","createElement","style","styles","header","section","source","require","logo","titleContainer","titleWrapper","title","betaText","icon","name","size","color","iconsSection","onPress","create","flexDirection","alignItems","backgroundColor","padding","borderBottomWidth","borderBottomColor","flex","display","justifyContent","width","height","resizeMode","paddingLeft","paddingRight","fontSize","fontWeight","textAlign","position","top","right"],"sourceRoot":"../../../src","sources":["components/header.js"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,UAAU,EAAEC,KAAK,QAAQ,cAAc;AAC9E,SAASC,QAAQ,IAAIC,IAAI,QAAQ,oBAAoB;AACrD,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,OAAO,MAAMC,MAAM,GAAGA,CAAA,KAAM;EAC1B,MAAM;IAAEC;EAAa,CAAC,GAAGV,UAAU,CAACQ,UAAU,CAAC;EAE/C,oBACET,KAAA,CAAAY,aAAA,CAACV,IAAI;IAACW,KAAK,EAAEC,MAAM,CAACC;EAAO,gBAEzBf,KAAA,CAAAY,aAAA,CAACV,IAAI;IAACW,KAAK,EAAEC,MAAM,CAACE;EAAQ,gBAC1BhB,KAAA,CAAAY,aAAA,CAACN,KAAK;IAACW,MAAM,EAAEC,OAAO,CAAC,wBAAwB,CAAE;IAACL,KAAK,EAAEC,MAAM,CAACK;EAAK,CAAE,CACnE,CAAC,eAGPnB,KAAA,CAAAY,aAAA,CAACV,IAAI;IAACW,KAAK,EAAE,CAACC,MAAM,CAACE,OAAO,EAAEF,MAAM,CAACM,cAAc;EAAE,gBACnDpB,KAAA,CAAAY,aAAA,CAACV,IAAI;IAACW,KAAK,EAAEC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ACPL,UAAU,EAAE;EACd,CAAC;EACDJ,YAAY,EAAE;IACZS,IAAI,EAAE,CAAC;IACPC,OAAO,EAAE,MAAM;IACfP,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBO,cAAc,EAAE;EAClB,CAAC;EACDpB,IAAI,EAAE;IACJqB,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE,EAAE;IACVC,UAAU,EAAE;EACd,CAAC;EACDlB,IAAI,EAAE;IACJmB,WAAW,EAAE,CAAC;IACdC,YAAY,EAAE;EAChB,CAAC;EACDxB,cAAc,EAAE;IACdiB,IAAI,EAAE,CAAC,CAAE;EACX,CAAC;EACDhB,YAAY,EAAE;IACZW,UAAU,EAAE,QAAQ;IACpBO,cAAc,EAAE;EAClB,CAAC;EACDjB,KAAK,EAAE;IACLuB,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,QAAQ;IACpBnB,KAAK,EAAE,MAAM;IACboB,SAAS,EAAE,QAAQ;IACnBhB,aAAa,EAAE;EACjB,CAAC;EACDR,QAAQ,EAAE;IACRsB,QAAQ,EAAE,EAAE;IACZlB,KAAK,EAAE,MAAM;IACbqB,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC,EAAE;IACRC,KAAK,EAAE,CAAC;EACV;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import { View, Button, StyleSheet } from 'react-native';
3
+ export const Testing = ({
4
+ onProductCardClick,
5
+ onAddToCartClick
6
+ }) => {
7
+ const product = {
8
+ "part_number": "AEQO177",
9
+ "inventory_info": {
10
+ "default_uom": "EA",
11
+ "is_valid": true,
12
+ "info_by_uom": {
13
+ "EA": {
14
+ "gross_price": 7.83,
15
+ "net_price": 7.83,
16
+ "is_on_sale": false,
17
+ "quantity_available": 0,
18
+ "discounts": null
19
+ }
20
+ }
21
+ },
22
+ "product_details": {
23
+ "product_name": "Aladdin Hayward SPX1600S SuperPump Lid Gasket | O-177-2",
24
+ "part_number": "AEQO177",
25
+ "manufacturer_id": "O-177-2",
26
+ "heritage_link": "https://www.heritagepoolplus.com/aeqo177-aladdin-o-ring-o-177-o-177-2-o-177-2",
27
+ "image_url": "https://media.heritageplus.com/image/upload/v1668157956/image/AEQO177_0.jpg"
28
+ }
29
+ };
30
+ return /*#__PURE__*/React.createElement(View, {
31
+ style: styles.container
32
+ }, /*#__PURE__*/React.createElement(Button, {
33
+ title: "Product Card Click",
34
+ onPress: () => onProductCardClick(product)
35
+ }), /*#__PURE__*/React.createElement(Button, {
36
+ title: "Add to Cart",
37
+ onPress: () => onAddToCartClick({
38
+ "quantity": 1,
39
+ "product": product
40
+ })
41
+ }));
42
+ };
43
+ const styles = StyleSheet.create({
44
+ container: {
45
+ flexDirection: 'row',
46
+ justifyContent: 'space-evenly',
47
+ marginVertical: 10,
48
+ paddingHorizontal: 16,
49
+ borderTopWidth: 1,
50
+ borderTopColor: '#DDD'
51
+ }
52
+ });
53
+ //# sourceMappingURL=testing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","Button","StyleSheet","Testing","onProductCardClick","onAddToCartClick","product","createElement","style","styles","container","title","onPress","create","flexDirection","justifyContent","marginVertical","paddingHorizontal","borderTopWidth","borderTopColor"],"sourceRoot":"../../../src","sources":["components/testing.js"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,MAAM,EAAEC,UAAU,QAAQ,cAAc;AAEvD,OAAO,MAAMC,OAAO,GAAGA,CAAC;EAAEC,kBAAkB;EAAEC;AAAiB,CAAC,KAAK;EAEnE,MAAMC,OAAO,GAAG;IACd,aAAa,EAAE,SAAS;IACxB,gBAAgB,EAAE;MAChB,aAAa,EAAE,IAAI;MACnB,UAAU,EAAE,IAAI;MAChB,aAAa,EAAE;QACb,IAAI,EAAE;UACJ,aAAa,EAAE,IAAI;UACnB,WAAW,EAAE,IAAI;UACjB,YAAY,EAAE,KAAK;UACnB,oBAAoB,EAAE,CAAC;UACvB,WAAW,EAAE;QACf;MACF;IACF,CAAC;IACD,iBAAiB,EAAE;MACjB,cAAc,EAAE,yDAAyD;MACzE,aAAa,EAAE,SAAS;MACxB,iBAAiB,EAAE,SAAS;MAC5B,eAAe,EAAE,+EAA+E;MAChG,WAAW,EAAE;IACf;EACF,CAAC;EAED,oBACEP,KAAA,CAAAQ,aAAA,CAACP,IAAI;IAACQ,KAAK,EAAEC,MAAM,CAACC;EAAU,gBAC5BX,KAAA,CAAAQ,aAAA,CAACN,MAAM;IAACU,KAAK,EAAC,oBAAoB;IAACC,OAAO,EAAEA,CAAA,KAAMR,kBAAkB,CAACE,OAAO;EAAE,CAAE,CAAC,eACjFP,KAAA,CAAAQ,aAAA,CAACN,MAAM;IAACU,KAAK,EAAC,aAAa;IAACC,OAAO,EAAEA,CAAA,KAAMP,gBAAgB,CAAC;MAAC,UAAU,EAAC,CAAC;MAAC,SAAS,EAACC;IAAO,CAAC;EAAE,CAAE,CAC5F,CAAC;AAEX,CAAC;AAED,MAAMG,MAAM,GAAGP,UAAU,CAACW,MAAM,CAAC;EAC/BH,SAAS,EAAE;IACTI,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,cAAc;IAC9BC,cAAc,EAAE,EAAE;IAClBC,iBAAiB,EAAE,EAAE;IACrBC,cAAc,EAAE,CAAC;IACjBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,90 @@
1
+ import React, { createContext, useContext, useState, useEffect } from "react";
2
+ export const AppContext = /*#__PURE__*/createContext();
3
+ export const AppProvider = ({
4
+ children
5
+ }) => {
6
+ const [showModal, setShowModal] = useState("Icon");
7
+ const [input, setInput] = useState('');
8
+ const [messages, setMessages] = useState([{
9
+ type: "ai",
10
+ text: "Hi there 👋 I’m Poseidon, your Heritage Pool+ AI Agent. I can help you during your online visit with Product and Account information. How can I help you today?"
11
+ }, {
12
+ type: "user",
13
+ text: "Do you carry Hayward super pumps?"
14
+ }, {
15
+ type: "ai",
16
+ text: "Could you provide more details on the specific model or horsepower you are interested in for the Hayward Super Pump? We have various models with different features, such as variable speed settings and different horsepower ratings. Alternatively, I can offer you some recommendations right away to help you decide."
17
+ }]);
18
+ const handleSend = async () => {
19
+ if (!input.trim()) return;
20
+ const userMessage = input;
21
+ setInput('');
22
+
23
+ // Add user message to the list
24
+ setMessages(prev => [...prev, {
25
+ type: "user",
26
+ text: userMessage
27
+ }]);
28
+ try {
29
+ // Add placeholder for AI message
30
+ setMessages(prev => [...prev, {
31
+ type: "ai",
32
+ text: ''
33
+ }]);
34
+
35
+ // Simulate response with streaming
36
+ const response = await onSendMessage(userMessage, chunk => {
37
+ setMessages(prev => {
38
+ const newMessages = [...prev];
39
+ const lastMessage = newMessages[newMessages.length - 1];
40
+ if (lastMessage && lastMessage.type === "ai") {
41
+ lastMessage.text += chunk;
42
+ }
43
+ return newMessages;
44
+ });
45
+ });
46
+
47
+ // Finalize AI response
48
+ setMessages(prev => {
49
+ const newMessages = [...prev];
50
+ const lastMessage = newMessages[newMessages.length - 1];
51
+ if (lastMessage && lastMessage.type === "ai" && lastMessage.text !== response) {
52
+ lastMessage.text = response;
53
+ }
54
+ return newMessages;
55
+ });
56
+ } catch (error) {
57
+ console.error('Error sending message:', error);
58
+ }
59
+ };
60
+ const onSendMessage = async (message, onStream) => {
61
+ try {
62
+ if (onStream) {
63
+ const words = `You said: ${message}`.split(' ');
64
+ for (const word of words) {
65
+ await new Promise(resolve => setTimeout(resolve, 100));
66
+ onStream(word + ' ');
67
+ }
68
+ return `You said: ${message}`;
69
+ }
70
+ await new Promise(resolve => setTimeout(resolve, 1000));
71
+ return `You said: ${message}`;
72
+ } catch (error) {
73
+ console.error('Error handling message:', error);
74
+ return 'Error processing message';
75
+ }
76
+ };
77
+ return /*#__PURE__*/React.createElement(AppContext.Provider, {
78
+ value: {
79
+ showModal,
80
+ setShowModal,
81
+ messages,
82
+ setMessages,
83
+ handleSend,
84
+ onSendMessage,
85
+ input,
86
+ setInput
87
+ }
88
+ }, children);
89
+ };
90
+ //# sourceMappingURL=AppContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","createContext","useContext","useState","useEffect","AppContext","AppProvider","children","showModal","setShowModal","input","setInput","messages","setMessages","type","text","handleSend","trim","userMessage","prev","response","onSendMessage","chunk","newMessages","lastMessage","length","error","console","message","onStream","words","split","word","Promise","resolve","setTimeout","createElement","Provider","value"],"sourceRoot":"../../../src","sources":["contexts/AppContext.js"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,aAAa,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAE5E,OAAO,MAAMC,UAAU,gBAAGJ,aAAa,CAAC,CAAC;AAEzC,OAAO,MAAMK,WAAW,GAAGA,CAAC;EAAEC;AAAS,CAAC,KAAK;EAE3C,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGN,QAAQ,CAAC,MAAM,CAAC;EAElD,MAAM,CAACO,KAAK,EAAEC,QAAQ,CAAC,GAAGR,QAAQ,CAAC,EAAE,CAAC;EACtC,MAAM,CAACS,QAAQ,EAAEC,WAAW,CAAC,GAAGV,QAAQ,CAAC,CACvC;IAACW,IAAI,EAAE,IAAI;IAAEC,IAAI,EAAE;EAAiK,CAAC,EACrL;IAACD,IAAI,EAAE,MAAM;IAAEC,IAAI,EAAE;EAAmC,CAAC,EACzD;IAACD,IAAI,EAAE,IAAI;IAAEC,IAAI,EAAE;EAA2T,CAAC,CAChV,CAAC;EAEF,MAAMC,UAAU,GAAG,MAAAA,CAAA,KAAY;IAC7B,IAAI,CAACN,KAAK,CAACO,IAAI,CAAC,CAAC,EAAE;IAEnB,MAAMC,WAAW,GAAGR,KAAK;IACzBC,QAAQ,CAAC,EAAE,CAAC;;IAEZ;IACAE,WAAW,CAAEM,IAAI,IAAK,CAAC,GAAGA,IAAI,EAAE;MAAEL,IAAI,EAAE,MAAM;MAAEC,IAAI,EAAEG;IAAY,CAAC,CAAC,CA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UACxB,MAAM,IAAIG,OAAO,CAAEC,OAAO,IAAKC,UAAU,CAACD,OAAO,EAAE,GAAG,CAAC,CAAC;UACxDL,QAAQ,CAACG,IAAI,GAAG,GAAG,CAAC;QACtB;QACA,OAAO,aAAaJ,OAAO,EAAE;MAC/B;MAEA,MAAM,IAAIK,OAAO,CAAEC,OAAO,IAAKC,UAAU,CAACD,OAAO,EAAE,IAAI,CAAC,CAAC;MACzD,OAAO,aAAaN,OAAO,EAAE;IAC/B,CAAC,CAAC,OAAOF,KAAK,EAAE;MACdC,OAAO,CAACD,KAAK,CAAC,yBAAyB,EAAEA,KAAK,CAAC;MAC/C,OAAO,0BAA0B;IACnC;EACF,CAAC;EAGD,oBACE1B,KAAA,CAAAoC,aAAA,CAAC/B,UAAU,CAACgC,QAAQ;IAClBC,KAAK,EAAE;MAAE9B,SAAS;MAAEC,YAAY;MAAEG,QAAQ;MAAEC,WAAW;MAAEG,UAAU;MAAEK,aAAa;MAAEX,KAAK;MAAEC;IAC3F;EAAE,GAEDJ,QACkB,CAAC;AAE1B,CAAC","ignoreList":[]}
@@ -0,0 +1,194 @@
1
+ import React, { useState, useEffect, useRef, useContext } from 'react';
2
+ import { AppContext } from "../contexts/AppContext";
3
+ export function useWebSocketMessage() {
4
+ const {
5
+ setIsComplete,
6
+ startStreaming,
7
+ setMessages,
8
+ messages,
9
+ setGhostMessage,
10
+ isMobile,
11
+ setTypingIndicator,
12
+ setStartStreaming,
13
+ lastUserMessage,
14
+ stopActivated,
15
+ custEmail,
16
+ custName,
17
+ data,
18
+ setGhostCard,
19
+ BASE_URL,
20
+ setStopActivated,
21
+ setLastMessageId
22
+ } = useContext(AppContext);
23
+ const wsProtocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
24
+ const wsUrl = BASE_URL.replace(/^http(s)?:\/\//, '');
25
+ const ENDPOINT = '/send/event';
26
+ const payload = {
27
+ ...data,
28
+ user_query: lastUserMessage,
29
+ customer_name: data.customer_name
30
+ };
31
+ const wsRef = useRef(null);
32
+ useEffect(() => {
33
+ if (startStreaming) {
34
+ console.log(payload);
35
+ const socketUrl = `${wsProtocol}${wsUrl}${ENDPOINT}`;
36
+ const ws = new WebSocket(socketUrl);
37
+ wsRef.current = ws;
38
+ ws.onopen = () => {
39
+ console.log("WebSocket connection established.");
40
+ ws.send(JSON.stringify(payload));
41
+ };
42
+ ws.onmessage = event => {
43
+ var _response$resource_de, _response$resource_de2;
44
+ const response = JSON.parse(event.data);
45
+ console.log(response);
46
+ switch (response.type) {
47
+ case 'middle_message':
48
+ const middleMessage = {
49
+ type: "middle",
50
+ text: response.message,
51
+ products: [],
52
+ product_cards: "False"
53
+ };
54
+ setMessages([...messages, middleMessage]);
55
+ break;
56
+ case 'message':
57
+ if (response.product_cards == "False" || response.product_cards == false) {
58
+ setGhostMessage(false);
59
+ setTypingIndicator(false);
60
+ } else {
61
+ setGhostMessage(false);
62
+ setGhostCard(true);
63
+ }
64
+ const newMessage = {
65
+ type: "ai",
66
+ message_id: response.message_id || '',
67
+ text: [response.message],
68
+ feedback: "True",
69
+ products: [],
70
+ product_cards: response.product_cards || "False",
71
+ resource: (response === null || response === void 0 || (_response$resource_de = response.resource_details) === null || _response$resource_de === void 0 || (_response$resource_de = _response$resource_de[0]) === null || _response$resource_de === void 0 ? void 0 : _response$resource_de.link) ?? "",
72
+ resource_type: (response === null || response === void 0 || (_response$resource_de2 = response.resource_details) === null || _response$resource_de2 === void 0 || (_response$resource_de2 = _response$resource_de2[0]) === null || _response$resource_de2 === void 0 ? void 0 : _response$resource_de2.type) ?? ""
73
+ };
74
+ setMessages(prevMessages => [...prevMessages, newMessage]);
75
+ setLastMessageId(response.message_id);
76
+ break;
77
+ case 'chunk':
78
+ const newContent = response.chunk;
79
+ const newMessageId = response.message_id;
80
+ setMessages(prevMessages => {
81
+ const lastMessageIndex = prevMessages.length - 1;
82
+ if (prevMessages[lastMessageIndex] && prevMessages[lastMessageIndex].type === "ai") {
83
+ const updatedLastMessage = {
84
+ ...prevMessages[lastMessageIndex],
85
+ text: [prevMessages[lastMessageIndex].text[0] + newContent],
86
+ message_id: newMessageId || prevMessages[lastMessageIndex].message_id,
87
+ feedback: "True"
88
+ };
89
+ return [...prevMessages.slice(0, lastMessageIndex), updatedLastMessage];
90
+ } else {
91
+ setGhostMessage(false);
92
+ return [...prevMessages, {
93
+ type: "ai",
94
+ text: [newContent],
95
+ message_id: newMessageId,
96
+ feedback: "True"
97
+ }];
98
+ }
99
+ });
100
+ if (newMessageId) {
101
+ setLastMessageId(newMessageId);
102
+ }
103
+ break;
104
+ case 'product_cards':
105
+ setMessages(prevMessages => {
106
+ const lastMessageIndex = prevMessages.length - 1;
107
+ if (prevMessages[lastMessageIndex] && prevMessages[lastMessageIndex].type === "ai") {
108
+ const updatedLastMessage = {
109
+ ...prevMessages[lastMessageIndex],
110
+ products: response.products || [],
111
+ product_cards: "True"
112
+ };
113
+ return [...prevMessages.slice(0, lastMessageIndex), updatedLastMessage];
114
+ }
115
+ });
116
+ setGhostMessage(false);
117
+ setTypingIndicator(false);
118
+ setGhostCard(false);
119
+ break;
120
+ case 'product_document':
121
+ setMessages(prevMessages => {
122
+ const lastMessageIndex = prevMessages.length - 1;
123
+ if (prevMessages[lastMessageIndex] && prevMessages[lastMessageIndex].type === "ai") {
124
+ var _response$resource_de3, _response$resource_de4;
125
+ const updatedLastMessage = {
126
+ ...prevMessages[lastMessageIndex],
127
+ resource: (response === null || response === void 0 || (_response$resource_de3 = response.resource_details) === null || _response$resource_de3 === void 0 || (_response$resource_de3 = _response$resource_de3[0]) === null || _response$resource_de3 === void 0 ? void 0 : _response$resource_de3.link) ?? "",
128
+ resource_type: (response === null || response === void 0 || (_response$resource_de4 = response.resource_details) === null || _response$resource_de4 === void 0 || (_response$resource_de4 = _response$resource_de4[0]) === null || _response$resource_de4 === void 0 ? void 0 : _response$resource_de4.type) ?? ""
129
+ };
130
+ return [...prevMessages.slice(0, lastMessageIndex), updatedLastMessage];
131
+ }
132
+ });
133
+ setGhostMessage(false);
134
+ setTypingIndicator(false);
135
+ setGhostCard(false);
136
+ break;
137
+ case 'suggested_questions':
138
+ /* const questions = {
139
+ type: "questions",
140
+ message_id: response.message_id || '',
141
+ suggested_questions: response.suggested_questions || [],
142
+ }; */
143
+ setMessages(prevMessages => {
144
+ const lastMessageIndex = prevMessages.length - 1;
145
+ if (prevMessages[lastMessageIndex] && prevMessages[lastMessageIndex].type === "ai") {
146
+ const updatedLastMessage = {
147
+ ...prevMessages[lastMessageIndex],
148
+ suggested_questions: true,
149
+ questions: response.suggested_questions
150
+ };
151
+ return [...prevMessages.slice(0, lastMessageIndex), updatedLastMessage];
152
+ }
153
+ });
154
+ //setMessages((prevMessages) => [...prevMessages, questions]);
155
+ break;
156
+ case 'setComplete':
157
+ setIsComplete(true);
158
+ setTypingIndicator(false);
159
+ setStartStreaming(false);
160
+ setGhostCard(false);
161
+ break;
162
+ }
163
+ };
164
+ ws.onerror = error => {
165
+ setStartStreaming(false);
166
+ setGhostMessage(false);
167
+ setTypingIndicator(false);
168
+ setGhostCard(false);
169
+ };
170
+ ws.onclose = event => {
171
+ console.log("WebSocket connection closed:", event.reason);
172
+ setStartStreaming(false);
173
+ setGhostMessage(false);
174
+ setTypingIndicator(false);
175
+ setGhostCard(false);
176
+ };
177
+ return () => {
178
+ ws.close();
179
+ };
180
+ }
181
+ ;
182
+ }, [startStreaming]);
183
+ useEffect(() => {
184
+ if (wsRef.current && wsRef.current.readyState === WebSocket.OPEN) {
185
+ wsRef.current.close();
186
+ setStartStreaming(false);
187
+ setGhostMessage(false);
188
+ setGhostCard(false);
189
+ setTypingIndicator(false);
190
+ setStopActivated(false);
191
+ }
192
+ }, [stopActivated, setStartStreaming]);
193
+ }
194
+ //# sourceMappingURL=Stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useState","useEffect","useRef","useContext","AppContext","useWebSocketMessage","setIsComplete","startStreaming","setMessages","messages","setGhostMessage","isMobile","setTypingIndicator","setStartStreaming","lastUserMessage","stopActivated","custEmail","custName","data","setGhostCard","BASE_URL","setStopActivated","setLastMessageId","wsProtocol","window","location","protocol","wsUrl","replace","ENDPOINT","payload","user_query","customer_name","wsRef","console","log","socketUrl","ws","WebSocket","current","onopen","send","JSON","stringify","onmessage","event","_response$resource_de","_response$resource_de2","response","parse","type","middleMessage","text","message","products","product_cards","newMessage","message_id","feedback","resource","resource_details","link","resource_type","prevMessages","newContent","chunk","newMessageId","lastMessageIndex","length","updatedLastMessage","slice","_response$resource_de3","_response$resource_de4","suggested_questions","questions","onerror","error","onclose","reason","close","readyState","OPEN"],"sourceRoot":"../../../src","sources":["hooks/Stream.js"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAAEC,MAAM,EAAEC,UAAU,QAAQ,OAAO;AACtE,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,OAAO,SAASC,mBAAmBA,CAAA,EAAG;EAClC,MAAM;IAAEC,aAAa;IAAEC,cAAc;IAAEC,WAAW;IAAEC,QAAQ;IAAEC,eAAe;IAAEC,QAAQ;IACnFC,kBAAkB;IAAEC,iBAAiB;IAAEC,eAAe;IAAEC,aAAa;IAAEC,SAAS;IAAEC,QAAQ;IAAEC,IAAI;IAChGC,YAAY;IAAEC,QAAQ;IAAEC,gBAAgB;IAAEC;EAAiB,CAAC,GAAGnB,UAAU,CAACC,UAAU,CAAC;EAEzF,MAAMmB,UAAU,GAAGC,MAAM,CAACC,QAAQ,CAACC,QAAQ,KAAK,QAAQ,GAAG,QAAQ,GAAG,OAAO;EAC7E,MAAMC,KAAK,GAAGP,QAAQ,CAACQ,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;EACpD,MAAMC,QAAQ,GAAG,aAAa;EAE9B,MAAMC,OAAO,GAAG;IACZ,GAAGZ,IAAI;IACPa,UAAU,EAAEjB,eAAe;IAC3BkB,aAAa,EAAEd,IAAI,CAACc;EACxB,CAAC;EAED,MAAMC,KAAK,GAAG/B,MAAM,CAAC,I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