cmcts-c-agent-embedding 1.1.2-cmcuni → 1.1.5-cmcuni

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cmcts-c-agent-embedding",
3
- "version": "1.1.2-cmcuni",
3
+ "version": "1.1.5-cmcuni",
4
4
  "description": "Javascript library to display flowise chatbot on your website",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -78,4 +78,4 @@
78
78
  "uuid": "^9.0.1"
79
79
  },
80
80
  "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
81
- }
81
+ }
package/public/index.html CHANGED
@@ -8,53 +8,55 @@
8
8
 
9
9
  <!doctype html>
10
10
  <html lang="en">
11
- <head>
12
- <meta charset="UTF-8" />
13
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
14
- <title>Flowise Chatbot Widget</title>
15
- </head>
16
11
 
17
- <body>
18
- <!-- <div id="root">
12
+ <head>
13
+ <meta charset="UTF-8" />
14
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
15
+ <title>Flowise Chatbot Widget</title>
16
+ </head>
17
+
18
+ <body>
19
+ <!-- <div id="root">
19
20
  <flowise-fullchatbot></flowise-fullchatbot>
20
21
  </div> -->
21
- <script type="module">
22
- import Chatbot from './web.js';
22
+ <script type="module">
23
+ import Chatbot from './web.js';
24
+
25
+ const customStringify = (obj) => {
26
+ let stringified = JSON.stringify(obj, null, 4)
27
+ .replace(/"([^"]+)":/g, '$1:')
28
+ .replace(/: "([^"]+)"/g, (match, value) => (value.includes('<') ? `: "${value}"` : `: '${value}'`))
29
+ .replace(/: "(true|false|\d+)"/g, ': $1')
30
+ .replace(/customCSS: ""/g, 'customCSS: ``');
31
+ return stringified
32
+ .split('\n')
33
+ .map((line, index) => {
34
+ if (index === 0) return line;
35
+ return ' '.repeat(8) + line;
36
+ })
37
+ .join('\n');
38
+ };
23
39
 
24
- const customStringify = (obj) => {
25
- let stringified = JSON.stringify(obj, null, 4)
26
- .replace(/"([^"]+)":/g, '$1:')
27
- .replace(/: "([^"]+)"/g, (match, value) => (value.includes('<') ? `: "${value}"` : `: '${value}'`))
28
- .replace(/: "(true|false|\d+)"/g, ': $1')
29
- .replace(/customCSS: ""/g, 'customCSS: ``');
30
- return stringified
31
- .split('\n')
32
- .map((line, index) => {
33
- if (index === 0) return line;
34
- return ' '.repeat(8) + line;
35
- })
36
- .join('\n');
37
- };
40
+ // Example initialization:
41
+ // If your .env contains:
42
+ // agent1=xyz789-uvw456,https://example.com
43
+ // support=abc123-def456,https://example.com
44
+ // salesbot=ghi123-jkl456,https://example.com
45
+ //
46
+ // Then use the environment variable name as chatflowid:
47
+ Chatbot.init({
48
+ // chatflowid: '6a63bb88-88f7-4c4d-805e-9c027c85707b', // or 'support', 'salesbot', etc.
49
+ // chatflowid: 'b573e66d-0e28-4798-8e4f-fbbaff8e236f', // or 'support', 'salesbot', etc.
50
+ // chatflowid: '7ee803b4-e3f8-4f33-bf85-ef9ab9d6f693', // or 'support', 'salesbot', etc.
51
+ chatflowid: '373bfccc-9796-48df-a63a-45dcf5855aeb', // or 'support', 'salesbot', etc.
52
+ apiHost: 'https://cmc-uni.cagent.cmcts.ai',
53
+ // apiHost: 'https://c-agent.cmcts.studio.ai.vn',
54
+ chatwootUrl: 'https://livechat.cagent.cmcts.ai',
55
+ roomIds: {
56
+ '0123456789': 'Xa6HmhfbU5K73ZhHnspzKhqs',
57
+ },
58
+ });
59
+ </script>
60
+ </body>
38
61
 
39
- // Example initialization:
40
- // If your .env contains:
41
- // agent1=xyz789-uvw456,https://example.com
42
- // support=abc123-def456,https://example.com
43
- // salesbot=ghi123-jkl456,https://example.com
44
- //
45
- // Then use the environment variable name as chatflowid:
46
- Chatbot.init({
47
- // chatflowid: '6a63bb88-88f7-4c4d-805e-9c027c85707b', // or 'support', 'salesbot', etc.
48
- // chatflowid: 'b573e66d-0e28-4798-8e4f-fbbaff8e236f', // or 'support', 'salesbot', etc.
49
- // chatflowid: '7ee803b4-e3f8-4f33-bf85-ef9ab9d6f693', // or 'support', 'salesbot', etc.
50
- chatflowid: '226da69f-74ed-4250-b754-a388e57b2877', // or 'support', 'salesbot', etc.
51
- apiHost: 'https://cmc-uni.cagent.cmcts.ai',
52
- // apiHost: 'https://c-agent.cmcts.studio.ai.vn',
53
- chatwootUrl: 'https://livechat.cagent.cmcts.ai',
54
- roomIds: {
55
- '0123456789': 'Xa6HmhfbU5K73ZhHnspzKhqs',
56
- },
57
- });
58
- </script>
59
- </body>
60
- </html>
62
+ </html>