@opencx/widget-core 4.0.38 → 4.0.39
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/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +270 -202
- package/dist/index.js.map +1 -1
- package/dist/src/translation/bg.d.ts +3 -0
- package/dist/src/translation/bg.d.ts.map +1 -0
- package/dist/src/translation/cs.d.ts +3 -0
- package/dist/src/translation/cs.d.ts.map +1 -0
- package/dist/src/translation/index.d.ts +4 -0
- package/dist/src/translation/index.d.ts.map +1 -1
- package/dist/src/translation/th.d.ts +3 -0
- package/dist/src/translation/th.d.ts.map +1 -0
- package/dist/src/translation/vi.d.ts +3 -0
- package/dist/src/translation/vi.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import
|
|
1
|
+
import D from "openapi-fetch";
|
|
2
2
|
import N from "lodash.isequal";
|
|
3
|
-
import { v4 as
|
|
3
|
+
import { v4 as U } from "uuid";
|
|
4
4
|
const F = (h) => {
|
|
5
5
|
console.log(h.error);
|
|
6
6
|
}, B = (h) => {
|
|
7
|
-
const n =
|
|
7
|
+
const n = D({
|
|
8
8
|
baseUrl: h.baseUrl
|
|
9
|
-
}),
|
|
9
|
+
}), o = {
|
|
10
10
|
onRequest: h.onRequest,
|
|
11
11
|
onResponse: h.onResponse,
|
|
12
12
|
onError: h.onError || F
|
|
13
13
|
};
|
|
14
|
-
return n.use(
|
|
14
|
+
return n.use(o), n;
|
|
15
15
|
};
|
|
16
|
-
class
|
|
16
|
+
class z {
|
|
17
17
|
constructor({ config: n }) {
|
|
18
|
-
var
|
|
18
|
+
var u, s;
|
|
19
19
|
this.userToken = null, this.constructClientOptions = (e) => {
|
|
20
|
-
const t = this.config.apiUrl || "https://api.open.cx",
|
|
20
|
+
const t = this.config.apiUrl || "https://api.open.cx", a = {
|
|
21
21
|
"X-Bot-Token": this.config.token,
|
|
22
22
|
"Content-Type": "application/json",
|
|
23
23
|
Accept: "application/json",
|
|
24
24
|
Authorization: e ? `Bearer ${e}` : void 0
|
|
25
25
|
};
|
|
26
|
-
return { baseUrl: t, headers:
|
|
26
|
+
return { baseUrl: t, headers: a };
|
|
27
27
|
}, this.createOpenAPIClient = ({
|
|
28
28
|
baseUrl: e,
|
|
29
29
|
headers: t
|
|
30
30
|
}) => B({
|
|
31
31
|
baseUrl: e,
|
|
32
|
-
onRequest: ({ request:
|
|
33
|
-
Object.entries(t).forEach(([
|
|
34
|
-
l &&
|
|
32
|
+
onRequest: ({ request: a }) => {
|
|
33
|
+
Object.entries(t).forEach(([i, l]) => {
|
|
34
|
+
l && a.headers.set(i, l);
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
}), this.setAuthToken = (e) => {
|
|
38
38
|
this.userToken = e;
|
|
39
|
-
const { baseUrl: t, headers:
|
|
40
|
-
this.client = this.createOpenAPIClient({ baseUrl: t, headers:
|
|
39
|
+
const { baseUrl: t, headers: a } = this.constructClientOptions(e);
|
|
40
|
+
this.client = this.createOpenAPIClient({ baseUrl: t, headers: a });
|
|
41
41
|
}, this.getExternalWidgetConfig = async () => await this.client.GET("/backend/widget/v2/config", {
|
|
42
42
|
params: { header: { "X-Bot-Token": this.config.token } }
|
|
43
43
|
}), this.sendMessage = async (e, t) => await this.client.POST("/backend/widget/v2/chat/send", {
|
|
@@ -54,106 +54,106 @@ class M {
|
|
|
54
54
|
}), this.pollSessionAndHistory = async ({
|
|
55
55
|
sessionId: e,
|
|
56
56
|
lastMessageTimestamp: t,
|
|
57
|
-
abortSignal:
|
|
57
|
+
abortSignal: a
|
|
58
58
|
}) => {
|
|
59
|
-
const
|
|
59
|
+
const i = t ? { lastMessageTimestamp: t } : void 0;
|
|
60
60
|
return await this.client.GET("/backend/widget/v2/poll/{sessionId}", {
|
|
61
|
-
params: { path: { sessionId: e }, query:
|
|
62
|
-
signal:
|
|
61
|
+
params: { path: { sessionId: e }, query: i },
|
|
62
|
+
signal: a
|
|
63
63
|
});
|
|
64
64
|
}, this.getSessions = async ({
|
|
65
65
|
cursor: e,
|
|
66
66
|
filters: t,
|
|
67
|
-
abortSignal:
|
|
67
|
+
abortSignal: a
|
|
68
68
|
}) => await this.client.GET("/backend/widget/v2/sessions", {
|
|
69
69
|
params: { query: { cursor: e, filters: JSON.stringify(t) } },
|
|
70
|
-
signal:
|
|
70
|
+
signal: a
|
|
71
71
|
}), this.uploadFile = async ({
|
|
72
72
|
file: e,
|
|
73
73
|
abortSignal: t,
|
|
74
|
-
onProgress:
|
|
75
|
-
}) => new Promise((
|
|
76
|
-
var
|
|
74
|
+
onProgress: a
|
|
75
|
+
}) => new Promise((i, l) => {
|
|
76
|
+
var y;
|
|
77
77
|
const c = new FormData();
|
|
78
78
|
c.append("file", e);
|
|
79
|
-
const
|
|
79
|
+
const _ = new XMLHttpRequest();
|
|
80
80
|
if (t && (t.addEventListener("abort", () => {
|
|
81
|
-
|
|
81
|
+
_.abort(), l(new DOMException("Aborted", "AbortError"));
|
|
82
82
|
}), t.aborted)) {
|
|
83
83
|
l(new DOMException("Aborted", "AbortError"));
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
|
-
|
|
87
|
-
if (
|
|
88
|
-
const
|
|
89
|
-
|
|
86
|
+
_.upload.addEventListener("progress", (v) => {
|
|
87
|
+
if (v.lengthComputable && a) {
|
|
88
|
+
const f = Math.round(v.loaded / v.total * 100);
|
|
89
|
+
a(f);
|
|
90
90
|
}
|
|
91
|
-
}),
|
|
92
|
-
if (
|
|
91
|
+
}), _.addEventListener("load", () => {
|
|
92
|
+
if (_.status >= 200 && _.status < 300)
|
|
93
93
|
try {
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
} catch (
|
|
97
|
-
l(new Error(`Failed to parse response: ${
|
|
94
|
+
const v = JSON.parse(_.responseText);
|
|
95
|
+
i(v);
|
|
96
|
+
} catch (v) {
|
|
97
|
+
l(new Error(`Failed to parse response: ${v}`));
|
|
98
98
|
}
|
|
99
99
|
else
|
|
100
|
-
l(new Error(`Upload failed with status: ${
|
|
101
|
-
}),
|
|
100
|
+
l(new Error(`Upload failed with status: ${_.status}`));
|
|
101
|
+
}), _.addEventListener("error", () => {
|
|
102
102
|
l(new Error("Network error occurred"));
|
|
103
|
-
}),
|
|
103
|
+
}), _.addEventListener("timeout", () => {
|
|
104
104
|
l(new Error("Upload timed out"));
|
|
105
105
|
});
|
|
106
|
-
const { baseUrl: p } = this.constructClientOptions(this.userToken),
|
|
107
|
-
|
|
106
|
+
const { baseUrl: p } = this.constructClientOptions(this.userToken), d = `${p}/backend/widget/v2/upload`;
|
|
107
|
+
_.open("POST", d), _.setRequestHeader("X-Bot-Token", this.config.token), this.userToken ?? ((y = this.config.user) == null ? void 0 : y.token) ? _.setRequestHeader("Authorization", `Bearer ${this.userToken}`) : console.error("User token not set"), _.send(c);
|
|
108
108
|
}), this.vote = async (e) => await this.client.POST("/backend/widget/v2/chat/vote", { body: e }), this.resolveSession = async (e, t) => await this.client.POST("/backend/widget/v2/session/resolve", {
|
|
109
109
|
body: e,
|
|
110
110
|
signal: t
|
|
111
111
|
}), this.createStateCheckpoint = async (e) => await this.client.POST("/backend/widget/v2/checkpoint", {
|
|
112
112
|
body: e
|
|
113
|
-
}), this.submitCsat = async (e) => await this.client.POST("/backend/widget/v2/submit-csat", { body: e }), this.config = n, this.userToken = ((
|
|
114
|
-
const { baseUrl:
|
|
113
|
+
}), this.submitCsat = async (e) => await this.client.POST("/backend/widget/v2/submit-csat", { body: e }), this.config = n, this.userToken = ((u = n.user) == null ? void 0 : u.token) || null;
|
|
114
|
+
const { baseUrl: o, headers: r } = this.constructClientOptions(
|
|
115
115
|
(s = n.user) == null ? void 0 : s.token
|
|
116
116
|
);
|
|
117
|
-
this.client = this.createOpenAPIClient({ baseUrl:
|
|
117
|
+
this.client = this.createOpenAPIClient({ baseUrl: o, headers: r });
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function V(h, n) {
|
|
121
121
|
console.error(`Missing case for ${h} in ${n}`);
|
|
122
122
|
}
|
|
123
|
-
class
|
|
123
|
+
class S {
|
|
124
124
|
constructor(n) {
|
|
125
|
-
this.subscribers = /* @__PURE__ */ new Set(), this.get = () => this.state, this.set = (
|
|
126
|
-
N(this.state,
|
|
127
|
-
}, this.setPartial = (
|
|
128
|
-
if (
|
|
129
|
-
const r = { ...this.state, ...
|
|
125
|
+
this.subscribers = /* @__PURE__ */ new Set(), this.get = () => this.state, this.set = (o) => {
|
|
126
|
+
N(this.state, o) || (this.state = o, this.notifySubscribers(o));
|
|
127
|
+
}, this.setPartial = (o) => {
|
|
128
|
+
if (o == null) return;
|
|
129
|
+
const r = { ...this.state, ...o };
|
|
130
130
|
this.set(r);
|
|
131
131
|
}, this.reset = () => {
|
|
132
132
|
this.set(this.initialState);
|
|
133
|
-
}, this.notifySubscribers = (
|
|
134
|
-
Array.from(this.subscribers).forEach((
|
|
133
|
+
}, this.notifySubscribers = (o) => {
|
|
134
|
+
Array.from(this.subscribers).forEach((u) => {
|
|
135
135
|
try {
|
|
136
|
-
|
|
136
|
+
u(o);
|
|
137
137
|
} catch (s) {
|
|
138
138
|
console.error(s);
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
|
-
}, this.subscribe = (
|
|
142
|
-
this.subscribers.delete(
|
|
141
|
+
}, this.subscribe = (o) => (this.subscribers.add(o), () => {
|
|
142
|
+
this.subscribers.delete(o);
|
|
143
143
|
}), this.state = n, this.initialState = n;
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
class O {
|
|
147
147
|
constructor() {
|
|
148
|
-
this.state = new
|
|
148
|
+
this.state = new S({
|
|
149
149
|
isPolling: !1,
|
|
150
150
|
isError: !1
|
|
151
151
|
}), this.abortController = new AbortController(), this.reset = () => {
|
|
152
152
|
var n;
|
|
153
153
|
this.abortController.abort("Resetting poller"), (n = this.stopPolling) == null || n.call(this), this.stopPolling = null;
|
|
154
|
-
}, this.stopPolling = null, this.startPolling = (n,
|
|
154
|
+
}, this.stopPolling = null, this.startPolling = (n, o) => {
|
|
155
155
|
if (this.stopPolling) return;
|
|
156
|
-
const r = [],
|
|
156
|
+
const r = [], u = async () => {
|
|
157
157
|
this.abortController = new AbortController(), this.state.setPartial({ isPolling: !0 });
|
|
158
158
|
try {
|
|
159
159
|
await n(this.abortController.signal);
|
|
@@ -164,28 +164,28 @@ class O {
|
|
|
164
164
|
} finally {
|
|
165
165
|
this.state.setPartial({ isPolling: !1 });
|
|
166
166
|
}
|
|
167
|
-
this.abortController.signal.aborted ? console.log("Poller aborted, not scheduling anymore") : r.push(setTimeout(
|
|
167
|
+
this.abortController.signal.aborted ? console.log("Poller aborted, not scheduling anymore") : r.push(setTimeout(u, o));
|
|
168
168
|
};
|
|
169
|
-
|
|
169
|
+
u(), this.stopPolling = () => {
|
|
170
170
|
r.forEach(clearTimeout), this.state.reset();
|
|
171
171
|
};
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function j(h) {
|
|
176
176
|
try {
|
|
177
177
|
const n = h();
|
|
178
|
-
return n instanceof Promise ? n.then((
|
|
178
|
+
return n instanceof Promise ? n.then((o) => ({ data: o })).catch((o) => ({ error: o })) : { data: n };
|
|
179
179
|
} catch (n) {
|
|
180
180
|
return { error: n };
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
class
|
|
183
|
+
class H {
|
|
184
184
|
constructor({
|
|
185
185
|
api: n,
|
|
186
|
-
config:
|
|
186
|
+
config: o,
|
|
187
187
|
sessionCtx: r,
|
|
188
|
-
messageCtx:
|
|
188
|
+
messageCtx: u,
|
|
189
189
|
sessionPollingIntervalSeconds: s
|
|
190
190
|
}) {
|
|
191
191
|
this.poller = new O(), this.fetchSessionAndFullHistoryAbortController = new AbortController(), this.registerPolling = () => {
|
|
@@ -210,18 +210,18 @@ class q {
|
|
|
210
210
|
}, this.fetchSessionAndHistory = async ({
|
|
211
211
|
sessionId: e,
|
|
212
212
|
abortSignal: t,
|
|
213
|
-
fetchFullHistory:
|
|
213
|
+
fetchFullHistory: a = !1
|
|
214
214
|
}) => {
|
|
215
|
-
var
|
|
215
|
+
var _;
|
|
216
216
|
this.messageCtx.state.get().messages.length === 0 && this.messageCtx.state.setPartial({ isInitialFetchLoading: !0 });
|
|
217
|
-
const
|
|
217
|
+
const i = this.messageCtx.state.get().messages, l = i.length > 0 ? ((_ = i[i.length - 1]) == null ? void 0 : _.timestamp) ?? void 0 : void 0, { data: c } = await this.api.pollSessionAndHistory({
|
|
218
218
|
sessionId: e,
|
|
219
219
|
abortSignal: t,
|
|
220
|
-
lastMessageTimestamp:
|
|
220
|
+
lastMessageTimestamp: a ? void 0 : l
|
|
221
221
|
});
|
|
222
222
|
if (c != null && c.session && (this.sessionCtx.sessionState.setPartial({ session: c.session }), this.sessionCtx.setSessions([c.session])), c != null && c.history && c.history.length > 0) {
|
|
223
|
-
const p = this.messageCtx.state.get().messages, w = c.history.map(this.mapHistoryToMessage).filter((
|
|
224
|
-
(
|
|
223
|
+
const p = this.messageCtx.state.get().messages, w = c.history.map(this.mapHistoryToMessage).filter((d) => d !== null).filter(
|
|
224
|
+
(d) => !p.some((C) => C.id === d.id)
|
|
225
225
|
);
|
|
226
226
|
this.messageCtx.state.setPartial({
|
|
227
227
|
messages: [...p, ...w]
|
|
@@ -229,7 +229,7 @@ class q {
|
|
|
229
229
|
}
|
|
230
230
|
this.messageCtx.state.get().isInitialFetchLoading && this.messageCtx.state.setPartial({ isInitialFetchLoading: !1 });
|
|
231
231
|
}, this.mapHistoryToMessage = (e) => {
|
|
232
|
-
var
|
|
232
|
+
var a;
|
|
233
233
|
const t = {
|
|
234
234
|
id: e.publicId,
|
|
235
235
|
timestamp: e.sentAt || "",
|
|
@@ -261,14 +261,14 @@ class q {
|
|
|
261
261
|
}
|
|
262
262
|
};
|
|
263
263
|
if (e.sender.kind === "ai") {
|
|
264
|
-
const
|
|
264
|
+
const i = e.actionCalls && e.actionCalls.length > 0 ? e.actionCalls[e.actionCalls.length - 1] : void 0;
|
|
265
265
|
return {
|
|
266
266
|
...t,
|
|
267
267
|
type: "AI",
|
|
268
268
|
component: "bot_message",
|
|
269
269
|
agent: {
|
|
270
270
|
id: null,
|
|
271
|
-
name: ((
|
|
271
|
+
name: ((a = this.config.bot) == null ? void 0 : a.name) || "",
|
|
272
272
|
isAi: !0,
|
|
273
273
|
// Do not set avatarUrl from config here... let it be taken from the config at render time
|
|
274
274
|
avatarUrl: null,
|
|
@@ -276,16 +276,16 @@ class q {
|
|
|
276
276
|
},
|
|
277
277
|
data: {
|
|
278
278
|
message: e.content.text || "",
|
|
279
|
-
action:
|
|
280
|
-
name:
|
|
281
|
-
data: this.extractActionResult(
|
|
279
|
+
action: i ? {
|
|
280
|
+
name: i.actionName,
|
|
281
|
+
data: this.extractActionResult(i)
|
|
282
282
|
} : void 0
|
|
283
283
|
}
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
286
|
if (e.sender.kind === "system") {
|
|
287
|
-
const
|
|
288
|
-
return
|
|
287
|
+
const i = this.constructSystemMessage(e);
|
|
288
|
+
return i === null ? null : { ...i };
|
|
289
289
|
}
|
|
290
290
|
return null;
|
|
291
291
|
}, this.constructSystemMessage = (e) => {
|
|
@@ -326,7 +326,7 @@ class q {
|
|
|
326
326
|
case "none":
|
|
327
327
|
return null;
|
|
328
328
|
default:
|
|
329
|
-
return
|
|
329
|
+
return V(
|
|
330
330
|
e.systemMessagePayload,
|
|
331
331
|
this.constructSystemMessage.name
|
|
332
332
|
), null;
|
|
@@ -335,44 +335,44 @@ class q {
|
|
|
335
335
|
const t = e.result;
|
|
336
336
|
if (t === null || typeof t != "object") return t;
|
|
337
337
|
if ("responseBodyText" in t && typeof t.responseBodyText == "string") {
|
|
338
|
-
const
|
|
339
|
-
if (
|
|
338
|
+
const a = t.responseBodyText, i = j(() => JSON.parse(a)).data;
|
|
339
|
+
if (i) return i;
|
|
340
340
|
}
|
|
341
341
|
return e.result;
|
|
342
|
-
}, this.api = n, this.config =
|
|
342
|
+
}, this.api = n, this.config = o, this.sessionCtx = r, this.messageCtx = u, this.sessionPollingIntervalSeconds = s, this.registerPolling();
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
class
|
|
345
|
+
class q {
|
|
346
346
|
constructor({
|
|
347
347
|
config: n,
|
|
348
|
-
api:
|
|
348
|
+
api: o,
|
|
349
349
|
storageCtx: r
|
|
350
350
|
}) {
|
|
351
|
-
var
|
|
351
|
+
var u;
|
|
352
352
|
this.shouldCollectData = () => {
|
|
353
353
|
var s;
|
|
354
354
|
return !!(!((s = this.state.get().contact) != null && s.token) && this.config.collectUserData);
|
|
355
355
|
}, this.autoCreateUnverifiedUserIfNotExists = async () => {
|
|
356
|
-
var s, e, t,
|
|
356
|
+
var s, e, t, a, i, l, c, _, p, w, d, C, y, v;
|
|
357
357
|
if (!((s = this.config.user) != null && s.token)) {
|
|
358
358
|
if (this.config.collectUserData && !((t = (e = this.config.user) == null ? void 0 : e.data) != null && t.email)) {
|
|
359
|
-
if ((
|
|
359
|
+
if ((a = this.config.extraDataCollectionFields) != null && a.length)
|
|
360
360
|
return;
|
|
361
|
-
const
|
|
362
|
-
|
|
361
|
+
const f = await ((i = this.storageCtx) == null ? void 0 : i.getContactToken());
|
|
362
|
+
f && await this.setUnverifiedContact(f);
|
|
363
363
|
return;
|
|
364
364
|
}
|
|
365
365
|
if (!((c = (l = this.config.user) == null ? void 0 : l.data) != null && c.email)) {
|
|
366
|
-
const
|
|
367
|
-
if (
|
|
368
|
-
await this.setUnverifiedContact(
|
|
366
|
+
const f = await ((_ = this.storageCtx) == null ? void 0 : _.getContactToken());
|
|
367
|
+
if (f) {
|
|
368
|
+
await this.setUnverifiedContact(f);
|
|
369
369
|
return;
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
372
|
await this.createUnverifiedContact({
|
|
373
373
|
email: (w = (p = this.config.user) == null ? void 0 : p.data) == null ? void 0 : w.email,
|
|
374
|
-
non_verified_name: (C = (
|
|
375
|
-
non_verified_custom_data: (
|
|
374
|
+
non_verified_name: (C = (d = this.config.user) == null ? void 0 : d.data) == null ? void 0 : C.name,
|
|
375
|
+
non_verified_custom_data: (v = (y = this.config.user) == null ? void 0 : y.data) == null ? void 0 : v.customData
|
|
376
376
|
});
|
|
377
377
|
}
|
|
378
378
|
}, this.createUnverifiedContact = async (s, e) => {
|
|
@@ -388,11 +388,11 @@ class V {
|
|
|
388
388
|
this.state.setPartial({ isCreatingUnverifiedContact: !1 });
|
|
389
389
|
}
|
|
390
390
|
}, this.setUnverifiedContact = async (s) => {
|
|
391
|
-
var
|
|
392
|
-
const e = await ((
|
|
391
|
+
var a, i, l, c;
|
|
392
|
+
const e = await ((a = this.storageCtx) == null ? void 0 : a.getExternalContactId()), t = ((i = this.config.user) == null ? void 0 : i.externalId) || e || U();
|
|
393
393
|
this.api.setAuthToken(s), await ((l = this.storageCtx) == null ? void 0 : l.setContactToken(s)), await ((c = this.storageCtx) == null ? void 0 : c.setExternalContactId(t)), this.state.setPartial({ contact: { token: s, externalId: t } });
|
|
394
|
-
}, this.config = n, this.storageCtx = r, this.api =
|
|
395
|
-
contact: (
|
|
394
|
+
}, this.config = n, this.storageCtx = r, this.api = o, this.state = new S({
|
|
395
|
+
contact: (u = n.user) != null && u.token ? {
|
|
396
396
|
token: n.user.token,
|
|
397
397
|
// Set optional externalId from config... not local storage
|
|
398
398
|
externalId: n.user.externalId
|
|
@@ -404,14 +404,14 @@ class V {
|
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
function k() {
|
|
407
|
-
return
|
|
407
|
+
return U();
|
|
408
408
|
}
|
|
409
409
|
class Y {
|
|
410
410
|
constructor({
|
|
411
411
|
config: n,
|
|
412
|
-
api:
|
|
412
|
+
api: o,
|
|
413
413
|
sessionCtx: r,
|
|
414
|
-
messageCtx:
|
|
414
|
+
messageCtx: u
|
|
415
415
|
}) {
|
|
416
416
|
this.submitCsat = async (s) => {
|
|
417
417
|
var l;
|
|
@@ -436,27 +436,27 @@ class Y {
|
|
|
436
436
|
}
|
|
437
437
|
]
|
|
438
438
|
});
|
|
439
|
-
const { data:
|
|
439
|
+
const { data: a, error: i } = await this.api.submitCsat({
|
|
440
440
|
...s,
|
|
441
441
|
system_message_uuid: t,
|
|
442
442
|
session_id: e
|
|
443
443
|
});
|
|
444
|
-
return { data:
|
|
445
|
-
}, this.config = n, this.api =
|
|
444
|
+
return { data: a, error: i };
|
|
445
|
+
}, this.config = n, this.api = o, this.sessionCtx = r, this.messageCtx = u;
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
|
-
class
|
|
448
|
+
class K {
|
|
449
449
|
constructor({
|
|
450
450
|
config: n,
|
|
451
|
-
api:
|
|
451
|
+
api: o,
|
|
452
452
|
contactCtx: r,
|
|
453
|
-
sessionsPollingIntervalSeconds:
|
|
453
|
+
sessionsPollingIntervalSeconds: u
|
|
454
454
|
}) {
|
|
455
|
-
this.sessionsRefresher = new O(), this.sessionState = new
|
|
455
|
+
this.sessionsRefresher = new O(), this.sessionState = new S({
|
|
456
456
|
session: null,
|
|
457
457
|
isCreatingSession: !1,
|
|
458
458
|
isResolvingSession: !1
|
|
459
|
-
}), this.sessionsState = new
|
|
459
|
+
}), this.sessionsState = new S({
|
|
460
460
|
data: [],
|
|
461
461
|
cursor: void 0,
|
|
462
462
|
isLastPage: !1,
|
|
@@ -481,19 +481,19 @@ class $ {
|
|
|
481
481
|
Object.entries(this.config.sessionCustomData || {}).map(
|
|
482
482
|
([s, e]) => {
|
|
483
483
|
var t;
|
|
484
|
-
return typeof e == "string" ? [s, e] : typeof e == "boolean" ? [s, e] : typeof e == "number" ? [s, e] : [s, ((t =
|
|
484
|
+
return typeof e == "string" ? [s, e] : typeof e == "boolean" ? [s, e] : typeof e == "number" ? [s, e] : [s, ((t = j(() => JSON.stringify(e))) == null ? void 0 : t.data) || ""];
|
|
485
485
|
}
|
|
486
486
|
)
|
|
487
487
|
), this.createSession = async () => {
|
|
488
|
-
var
|
|
488
|
+
var i;
|
|
489
489
|
this.sessionState.setPartial({ session: null, isCreatingSession: !0 });
|
|
490
|
-
const s = (
|
|
490
|
+
const s = (i = this.contactCtx.state.get().contact) == null ? void 0 : i.externalId, e = {
|
|
491
491
|
...this.getParsedCustomData(),
|
|
492
492
|
...s ? { external_id: s } : {}
|
|
493
|
-
}, { data: t, error:
|
|
493
|
+
}, { data: t, error: a } = await this.api.createSession({
|
|
494
494
|
customData: Object.keys(e).length > 0 ? e : void 0
|
|
495
495
|
});
|
|
496
|
-
return t ? (this.sessionState.setPartial({ session: t, isCreatingSession: !1 }), t) : (this.sessionState.setPartial({ isCreatingSession: !1 }), console.error("Failed to create session:",
|
|
496
|
+
return t ? (this.sessionState.setPartial({ session: t, isCreatingSession: !1 }), t) : (this.sessionState.setPartial({ isCreatingSession: !1 }), console.error("Failed to create session:", a), null);
|
|
497
497
|
}, this.loadMoreSessions = async () => {
|
|
498
498
|
if (this.sessionsState.get().isLastPage) return;
|
|
499
499
|
const { data: s } = await this.getSessions({
|
|
@@ -501,7 +501,7 @@ class $ {
|
|
|
501
501
|
});
|
|
502
502
|
if (s) {
|
|
503
503
|
const t = [...this.sessionsState.get().data, ...s.items].filter(
|
|
504
|
-
(
|
|
504
|
+
(a, i, l) => i === l.findIndex((c) => a.id === c.id)
|
|
505
505
|
);
|
|
506
506
|
this.sessionsState.setPartial({
|
|
507
507
|
data: t,
|
|
@@ -510,9 +510,9 @@ class $ {
|
|
|
510
510
|
});
|
|
511
511
|
}
|
|
512
512
|
}, this.getSessions = async ({ cursor: s }) => {
|
|
513
|
-
var t,
|
|
513
|
+
var t, a;
|
|
514
514
|
if (!((t = this.contactCtx.state.get().contact) != null && t.token)) return { data: null };
|
|
515
|
-
const e = (
|
|
515
|
+
const e = (a = this.contactCtx.state.get().contact) == null ? void 0 : a.externalId;
|
|
516
516
|
return await this.api.getSessions({
|
|
517
517
|
cursor: s,
|
|
518
518
|
filters: e ? {
|
|
@@ -521,7 +521,7 @@ class $ {
|
|
|
521
521
|
});
|
|
522
522
|
}, this.setSessions = (s) => {
|
|
523
523
|
const e = [...s, ...this.sessionsState.get().data].filter(
|
|
524
|
-
(t,
|
|
524
|
+
(t, a, i) => a === i.findIndex((l) => t.id === l.id)
|
|
525
525
|
);
|
|
526
526
|
this.sessionsState.setPartial({ data: e });
|
|
527
527
|
}, this.refreshSessions = async () => {
|
|
@@ -537,25 +537,25 @@ class $ {
|
|
|
537
537
|
});
|
|
538
538
|
return e ? (this.sessionState.setPartial({ session: e, isResolvingSession: !1 }), { success: !0, data: e }) : (this.sessionState.setPartial({ isResolvingSession: !1 }), { success: !1, error: t });
|
|
539
539
|
}, this.createStateCheckpoint = async (s) => {
|
|
540
|
-
var
|
|
541
|
-
const e = (
|
|
540
|
+
var i;
|
|
541
|
+
const e = (i = this.sessionState.get().session) == null ? void 0 : i.id;
|
|
542
542
|
if (!e) return;
|
|
543
|
-
const { data: t, error:
|
|
543
|
+
const { data: t, error: a } = await this.api.createStateCheckpoint({
|
|
544
544
|
session_id: e,
|
|
545
545
|
payload: s
|
|
546
546
|
});
|
|
547
547
|
return t != null && t.success ? { success: !0 } : { success: !1 };
|
|
548
|
-
}, this.config = n, this.api =
|
|
548
|
+
}, this.config = n, this.api = o, this.contactCtx = r, this.sessionsPollingIntervalSeconds = u, this.registerSessionsRefresherWrapper();
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
class
|
|
551
|
+
class $ {
|
|
552
552
|
constructor({
|
|
553
553
|
config: n,
|
|
554
|
-
api:
|
|
554
|
+
api: o,
|
|
555
555
|
sessionCtx: r,
|
|
556
|
-
contactCtx:
|
|
556
|
+
contactCtx: u
|
|
557
557
|
}) {
|
|
558
|
-
this.state = new
|
|
558
|
+
this.state = new S({
|
|
559
559
|
messages: [],
|
|
560
560
|
isSendingMessage: !1,
|
|
561
561
|
isSendingMessageToAI: !1,
|
|
@@ -564,7 +564,7 @@ class K {
|
|
|
564
564
|
}), this.sendMessageAbortController = new AbortController(), this.reset = () => {
|
|
565
565
|
this.sendMessageAbortController.abort("Resetting chat"), this.state.reset();
|
|
566
566
|
}, this.sendMessage = async (s) => {
|
|
567
|
-
var e, t,
|
|
567
|
+
var e, t, a, i, l, c, _, p, w;
|
|
568
568
|
try {
|
|
569
569
|
if (!s.content.trim() && (!s.attachments || s.attachments.length === 0)) {
|
|
570
570
|
console.warn(
|
|
@@ -572,16 +572,16 @@ class K {
|
|
|
572
572
|
);
|
|
573
573
|
return;
|
|
574
574
|
}
|
|
575
|
-
const
|
|
576
|
-
if (
|
|
577
|
-
|
|
575
|
+
const d = this.sessionCtx.sessionState.get().session, y = (d == null ? void 0 : d.assignee.kind) === "ai", v = this.state.get().isSendingMessageToAI, f = this.state.get().messages.at(-1);
|
|
576
|
+
if (v || // If last message is from user, then bot response did not arrive yet
|
|
577
|
+
y && (f == null ? void 0 : f.type) === "USER") {
|
|
578
578
|
console.warn("Cannot send messages while awaiting AI response");
|
|
579
579
|
return;
|
|
580
580
|
}
|
|
581
581
|
this.sendMessageAbortController = new AbortController(), this.state.setPartial({
|
|
582
582
|
lastAIResMightSolveUserIssue: !1,
|
|
583
583
|
isSendingMessage: !0,
|
|
584
|
-
isSendingMessageToAI: !!
|
|
584
|
+
isSendingMessageToAI: !!y || !d
|
|
585
585
|
});
|
|
586
586
|
const P = this.state.get().messages, A = !((e = this.sessionCtx.sessionState.get().session) != null && e.id) && P.length === 0 && ((t = this.config.advancedInitialMessages) == null ? void 0 : t.some((g) => g.persistent)), T = A ? (this.config.advancedInitialMessages || []).filter((g) => g.persistent).map(
|
|
587
587
|
(g) => ({
|
|
@@ -604,14 +604,14 @@ class K {
|
|
|
604
604
|
...P,
|
|
605
605
|
I
|
|
606
606
|
]
|
|
607
|
-
}), !((
|
|
607
|
+
}), !((a = this.sessionCtx.sessionState.get().session) != null && a.id)) {
|
|
608
608
|
if (!await this.sessionCtx.createSession()) {
|
|
609
609
|
console.error("Failed to create session");
|
|
610
610
|
return;
|
|
611
611
|
}
|
|
612
612
|
this.sessionCtx.refreshSessions();
|
|
613
613
|
}
|
|
614
|
-
const E = (
|
|
614
|
+
const E = (i = this.sessionCtx.sessionState.get().session) == null ? void 0 : i.id;
|
|
615
615
|
if (!E) return;
|
|
616
616
|
const { data: m } = await this.api.sendMessage(
|
|
617
617
|
{
|
|
@@ -642,7 +642,7 @@ class K {
|
|
|
642
642
|
if (g) {
|
|
643
643
|
const x = this.state.get().messages;
|
|
644
644
|
if (!!x.some(
|
|
645
|
-
(
|
|
645
|
+
(L) => L.id === g.id
|
|
646
646
|
)) {
|
|
647
647
|
this.state.setPartial({
|
|
648
648
|
lastAIResMightSolveUserIssue: ((l = m.autopilotResponse) == null ? void 0 : l.mightSolveUserIssue) || ((c = m.uiResponse) == null ? void 0 : c.mightSolveUserIssue)
|
|
@@ -651,7 +651,7 @@ class K {
|
|
|
651
651
|
}
|
|
652
652
|
this.state.setPartial({
|
|
653
653
|
messages: [...x, g],
|
|
654
|
-
lastAIResMightSolveUserIssue: ((
|
|
654
|
+
lastAIResMightSolveUserIssue: ((_ = m.autopilotResponse) == null ? void 0 : _.mightSolveUserIssue) || ((p = m.uiResponse) == null ? void 0 : p.mightSolveUserIssue)
|
|
655
655
|
});
|
|
656
656
|
}
|
|
657
657
|
m.session && this.sessionCtx.sessionState.setPartial({ session: m.session });
|
|
@@ -663,8 +663,8 @@ class K {
|
|
|
663
663
|
messages: [...x, g]
|
|
664
664
|
});
|
|
665
665
|
}
|
|
666
|
-
} catch (
|
|
667
|
-
this.sendMessageAbortController.signal.aborted || console.error("Failed to send message:",
|
|
666
|
+
} catch (d) {
|
|
667
|
+
this.sendMessageAbortController.signal.aborted || console.error("Failed to send message:", d);
|
|
668
668
|
} finally {
|
|
669
669
|
this.state.setPartial({
|
|
670
670
|
isSendingMessage: !1,
|
|
@@ -673,8 +673,8 @@ class K {
|
|
|
673
673
|
}
|
|
674
674
|
}, this.toUserMessage = (s, e) => {
|
|
675
675
|
const t = (() => {
|
|
676
|
-
const
|
|
677
|
-
return this.state.get().messages.length === 0 &&
|
|
676
|
+
const a = this.contactCtx.state.get().extraCollectedData;
|
|
677
|
+
return this.state.get().messages.length === 0 && a && Object.keys(a).length > 0 ? `${Object.entries(a).filter(([l, c]) => !!c).map(([l, c]) => `${l}: ${c}`).join(`
|
|
678
678
|
`)}
|
|
679
679
|
|
|
680
680
|
${s}` : s;
|
|
@@ -720,15 +720,15 @@ ${s}` : s;
|
|
|
720
720
|
variant: "error",
|
|
721
721
|
action: void 0
|
|
722
722
|
}
|
|
723
|
-
}), this.config = n, this.api =
|
|
723
|
+
}), this.config = n, this.api = o, this.sessionCtx = r, this.contactCtx = u;
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
726
|
class G {
|
|
727
727
|
constructor({
|
|
728
728
|
config: n,
|
|
729
|
-
contactCtx:
|
|
729
|
+
contactCtx: o,
|
|
730
730
|
sessionCtx: r,
|
|
731
|
-
resetChat:
|
|
731
|
+
resetChat: u
|
|
732
732
|
}) {
|
|
733
733
|
var s;
|
|
734
734
|
this.registerRoutingListener = () => {
|
|
@@ -739,12 +739,12 @@ class G {
|
|
|
739
739
|
});
|
|
740
740
|
}), this.sessionCtx.sessionsState.subscribe(
|
|
741
741
|
({ isInitialFetchLoading: e, data: t }) => {
|
|
742
|
-
var
|
|
743
|
-
if ((
|
|
742
|
+
var a, i, l, c;
|
|
743
|
+
if ((a = this.config.router) != null && a.chatScreenOnly && // Do not route to a chat if we are currently inside one already
|
|
744
744
|
// This also applies to newly created sessions; the new session will be in `sessionState` before it is refreshed and included in `sessionsState`
|
|
745
|
-
!((
|
|
746
|
-
const
|
|
747
|
-
return
|
|
745
|
+
!((i = this.sessionCtx.sessionState.get().session) != null && i.id)) {
|
|
746
|
+
const _ = (l = t.find((p) => p.isOpened)) == null ? void 0 : l.id;
|
|
747
|
+
return _ ? this.toChatScreen(_) : void 0;
|
|
748
748
|
}
|
|
749
749
|
t.length || ((c = this.config.router) == null ? void 0 : c.goToChatIfNoSessions) !== !1 && !e && this.state.get().screen !== "chat" && this.toChatScreen();
|
|
750
750
|
}
|
|
@@ -753,12 +753,12 @@ class G {
|
|
|
753
753
|
this.resetChat(), this.state.setPartial({ screen: "sessions" });
|
|
754
754
|
}, this.toChatScreen = (e) => {
|
|
755
755
|
if (this.resetChat(), e) {
|
|
756
|
-
const t = this.sessionCtx.sessionsState.get().data.find((
|
|
756
|
+
const t = this.sessionCtx.sessionsState.get().data.find((a) => a.id === e);
|
|
757
757
|
if (!t) return;
|
|
758
758
|
this.sessionCtx.sessionState.setPartial({ session: t });
|
|
759
759
|
}
|
|
760
760
|
this.state.setPartial({ screen: "chat" });
|
|
761
|
-
}, this.config = n, this.contactCtx =
|
|
761
|
+
}, this.config = n, this.contactCtx = o, this.sessionCtx = r, this.resetChat = u, this.state = new S({
|
|
762
762
|
screen: this.contactCtx.shouldCollectData() ? "welcome" : (s = this.config.router) != null && s.chatScreenOnly ? "chat" : "sessions"
|
|
763
763
|
}), this.registerRoutingListener();
|
|
764
764
|
}
|
|
@@ -766,7 +766,7 @@ class G {
|
|
|
766
766
|
class J {
|
|
767
767
|
constructor({
|
|
768
768
|
storage: n,
|
|
769
|
-
config:
|
|
769
|
+
config: o
|
|
770
770
|
}) {
|
|
771
771
|
this.KEYS = {
|
|
772
772
|
contactToken: (r) => `opencx-widget:org-token-${r}:contact-token`,
|
|
@@ -775,15 +775,15 @@ class J {
|
|
|
775
775
|
await this.storage.set(this.KEYS.contactToken(this.config.token), r);
|
|
776
776
|
}, this.getContactToken = async () => this.storage.get(this.KEYS.contactToken(this.config.token)), this.setExternalContactId = async (r) => {
|
|
777
777
|
await this.storage.set(this.KEYS.externalContactId(this.config.token), r);
|
|
778
|
-
}, this.getExternalContactId = async () => this.storage.get(this.KEYS.externalContactId(this.config.token)), this.storage = n, this.config =
|
|
778
|
+
}, this.getExternalContactId = async () => this.storage.get(this.KEYS.externalContactId(this.config.token)), this.storage = n, this.config = o;
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
781
|
const b = class b {
|
|
782
782
|
constructor({
|
|
783
783
|
config: n,
|
|
784
|
-
storage:
|
|
784
|
+
storage: o,
|
|
785
785
|
modes: r,
|
|
786
|
-
org:
|
|
786
|
+
org: u
|
|
787
787
|
}) {
|
|
788
788
|
if (this.modes = [], this.resetChat = () => {
|
|
789
789
|
this.sessionCtx.reset(), this.messageCtx.reset();
|
|
@@ -791,16 +791,16 @@ const b = class b {
|
|
|
791
791
|
throw Error(
|
|
792
792
|
"Widget polling values are not defined, did you call WidgetCtx.initialize()"
|
|
793
793
|
);
|
|
794
|
-
this.config = n, this.org =
|
|
794
|
+
this.config = n, this.org = u, this.api = new z({ config: n }), this.storageCtx = o ? new J({ storage: o, config: n }) : void 0, this.modes = r, this.contactCtx = new q({
|
|
795
795
|
api: this.api,
|
|
796
796
|
config: this.config,
|
|
797
797
|
storageCtx: this.storageCtx
|
|
798
|
-
}), this.sessionCtx = new
|
|
798
|
+
}), this.sessionCtx = new K({
|
|
799
799
|
config: this.config,
|
|
800
800
|
api: this.api,
|
|
801
801
|
contactCtx: this.contactCtx,
|
|
802
802
|
sessionsPollingIntervalSeconds: b.pollingIntervalsSeconds.sessions
|
|
803
|
-
}), this.messageCtx = new
|
|
803
|
+
}), this.messageCtx = new $({
|
|
804
804
|
config: this.config,
|
|
805
805
|
api: this.api,
|
|
806
806
|
sessionCtx: this.sessionCtx,
|
|
@@ -810,7 +810,7 @@ const b = class b {
|
|
|
810
810
|
api: this.api,
|
|
811
811
|
sessionCtx: this.sessionCtx,
|
|
812
812
|
messageCtx: this.messageCtx
|
|
813
|
-
}), this.activeSessionPollingCtx = new
|
|
813
|
+
}), this.activeSessionPollingCtx = new H({
|
|
814
814
|
api: this.api,
|
|
815
815
|
config: this.config,
|
|
816
816
|
sessionCtx: this.sessionCtx,
|
|
@@ -826,20 +826,20 @@ const b = class b {
|
|
|
826
826
|
};
|
|
827
827
|
b.pollingIntervalsSeconds = null, b.initialize = async ({
|
|
828
828
|
config: n,
|
|
829
|
-
storage:
|
|
829
|
+
storage: o
|
|
830
830
|
}) => {
|
|
831
|
-
var
|
|
832
|
-
const r = await new
|
|
831
|
+
var u, s, e;
|
|
832
|
+
const r = await new z({
|
|
833
833
|
config: n
|
|
834
834
|
}).getExternalWidgetConfig();
|
|
835
835
|
if (!r.data)
|
|
836
836
|
throw new Error("Failed to fetch widget config");
|
|
837
837
|
return b.pollingIntervalsSeconds = {
|
|
838
|
-
session: ((
|
|
838
|
+
session: ((u = r.data) == null ? void 0 : u.sessionPollingIntervalSeconds) || 10,
|
|
839
839
|
sessions: ((s = r.data) == null ? void 0 : s.sessionsPollingIntervalSeconds) || 60
|
|
840
840
|
}, new b({
|
|
841
841
|
config: n,
|
|
842
|
-
storage:
|
|
842
|
+
storage: o,
|
|
843
843
|
modes: ((e = r.data) == null ? void 0 : e.modes) || [],
|
|
844
844
|
org: {
|
|
845
845
|
id: r.data.org.id,
|
|
@@ -847,7 +847,7 @@ b.pollingIntervalsSeconds = null, b.initialize = async ({
|
|
|
847
847
|
}
|
|
848
848
|
});
|
|
849
849
|
};
|
|
850
|
-
let
|
|
850
|
+
let M = b;
|
|
851
851
|
const W = {
|
|
852
852
|
write_a_message_placeholder: "اكتب رسالة...",
|
|
853
853
|
your_issue_has_been_resolved: "تم حل مشكلتك!",
|
|
@@ -864,7 +864,39 @@ const W = {
|
|
|
864
864
|
no_conversations_yet: "لا يوجد محادثات",
|
|
865
865
|
back_to_conversations: "العودة إلى المحادثات",
|
|
866
866
|
closed_conversations: "المحادثات المغلقة"
|
|
867
|
+
}, Z = {
|
|
868
|
+
write_a_message_placeholder: "Напишете съобщение...",
|
|
869
|
+
your_issue_has_been_resolved: "Вашият проблем е разрешен!",
|
|
870
|
+
new_conversation: "Нов разговор",
|
|
871
|
+
welcome_screen_title: "Добре дошли в нашия чат за поддръжка",
|
|
872
|
+
welcome_screen_description: "Тук сме, за да помогнем! Започнете разговор и ще ви отговорим възможно най-скоро.",
|
|
873
|
+
your_name_placeholder: "Вашето име",
|
|
874
|
+
your_email_placeholder: "Вашият имейл адрес",
|
|
875
|
+
start_chat_button: "Свържете се с поддръжка",
|
|
876
|
+
start_chat_button_loading: "Свързване...",
|
|
877
|
+
i_need_more_help: "Имам нужда от повече помощ",
|
|
878
|
+
this_was_helpful: "Това беше полезно",
|
|
879
|
+
optional: "По избор",
|
|
880
|
+
no_conversations_yet: "Все още няма разговори",
|
|
881
|
+
back_to_conversations: "Назад към разговорите",
|
|
882
|
+
closed_conversations: "Затворени разговори"
|
|
867
883
|
}, X = {
|
|
884
|
+
write_a_message_placeholder: "Napište zprávu...",
|
|
885
|
+
your_issue_has_been_resolved: "Váš problém byl vyřešen!",
|
|
886
|
+
new_conversation: "Nová konverzace",
|
|
887
|
+
welcome_screen_title: "Vítejte v našem chatu podpory",
|
|
888
|
+
welcome_screen_description: "Jsme tu, abychom vám pomohli! Zahajte konverzaci a ozveme se vám co nejdříve.",
|
|
889
|
+
your_name_placeholder: "Vaše jméno",
|
|
890
|
+
your_email_placeholder: "Vaše e-mailová adresa",
|
|
891
|
+
start_chat_button: "Kontaktovat podporu",
|
|
892
|
+
start_chat_button_loading: "Připojování...",
|
|
893
|
+
i_need_more_help: "Potřebuji další pomoc",
|
|
894
|
+
this_was_helpful: "Toto bylo užitečné",
|
|
895
|
+
optional: "Volitelné",
|
|
896
|
+
no_conversations_yet: "Zatím žádné konverzace",
|
|
897
|
+
back_to_conversations: "Zpět na konverzace",
|
|
898
|
+
closed_conversations: "Uzavřené konverzace"
|
|
899
|
+
}, Q = {
|
|
868
900
|
write_a_message_placeholder: "Skriv en besked...",
|
|
869
901
|
your_issue_has_been_resolved: "Dit problem er løst!",
|
|
870
902
|
new_conversation: "Ny samtale",
|
|
@@ -880,7 +912,7 @@ const W = {
|
|
|
880
912
|
no_conversations_yet: "Ingen samtaler endnu",
|
|
881
913
|
back_to_conversations: "Tilbage til samtaler",
|
|
882
914
|
closed_conversations: "Lukkede samtaler"
|
|
883
|
-
},
|
|
915
|
+
}, ee = {
|
|
884
916
|
write_a_message_placeholder: "Γράψτε ένα μήνυμα...",
|
|
885
917
|
your_issue_has_been_resolved: "Το πρόβλημά σας επιλύθηκε!",
|
|
886
918
|
new_conversation: "Νέα συνομιλία",
|
|
@@ -896,7 +928,7 @@ const W = {
|
|
|
896
928
|
no_conversations_yet: "Δεν υπάρχουν συνομιλίες ακόμα",
|
|
897
929
|
back_to_conversations: "Πίσω στις συνομιλίες",
|
|
898
930
|
closed_conversations: "Κλειστές συνομιλίες"
|
|
899
|
-
},
|
|
931
|
+
}, te = {
|
|
900
932
|
write_a_message_placeholder: "Nachricht schreiben...",
|
|
901
933
|
your_issue_has_been_resolved: "Ihr Problem wurde gelöst!",
|
|
902
934
|
new_conversation: "Neue Konversation",
|
|
@@ -912,7 +944,7 @@ const W = {
|
|
|
912
944
|
no_conversations_yet: "noch keine Gespräche",
|
|
913
945
|
back_to_conversations: "Zurück zur Konversationen",
|
|
914
946
|
closed_conversations: "Geschlossene Konversationen"
|
|
915
|
-
},
|
|
947
|
+
}, se = {
|
|
916
948
|
write_a_message_placeholder: "Write a message...",
|
|
917
949
|
your_issue_has_been_resolved: "Your issue has been resolved!",
|
|
918
950
|
new_conversation: "New conversation",
|
|
@@ -928,7 +960,7 @@ const W = {
|
|
|
928
960
|
no_conversations_yet: "No conversations yet",
|
|
929
961
|
back_to_conversations: "Back to conversations",
|
|
930
962
|
closed_conversations: "Closed conversations"
|
|
931
|
-
},
|
|
963
|
+
}, ne = {
|
|
932
964
|
write_a_message_placeholder: "Escribe un mensaje...",
|
|
933
965
|
your_issue_has_been_resolved: "¡Tu problema fue resuelto!",
|
|
934
966
|
new_conversation: "Nueva conversación",
|
|
@@ -944,7 +976,7 @@ const W = {
|
|
|
944
976
|
no_conversations_yet: "Sin conversaciones aún",
|
|
945
977
|
back_to_conversations: "Volver a conversaciones",
|
|
946
978
|
closed_conversations: "Conversaciones cerradas"
|
|
947
|
-
},
|
|
979
|
+
}, ae = {
|
|
948
980
|
write_a_message_placeholder: "Kirjoita viesti...",
|
|
949
981
|
your_issue_has_been_resolved: "Ongelmasi on ratkaistu!",
|
|
950
982
|
new_conversation: "Uusi keskustelu",
|
|
@@ -960,7 +992,7 @@ const W = {
|
|
|
960
992
|
no_conversations_yet: "Ei vielä keskusteluja",
|
|
961
993
|
back_to_conversations: "Takaisin keskusteluihin",
|
|
962
994
|
closed_conversations: "Suljetut keskustelut"
|
|
963
|
-
},
|
|
995
|
+
}, oe = {
|
|
964
996
|
write_a_message_placeholder: "Écrivez un message...",
|
|
965
997
|
your_issue_has_been_resolved: "Votre problème a été résolu !",
|
|
966
998
|
new_conversation: "Nouvelle conversation",
|
|
@@ -992,7 +1024,7 @@ const W = {
|
|
|
992
1024
|
no_conversations_yet: "Nessuna conversazione ancora",
|
|
993
1025
|
back_to_conversations: "Torna alle conversazioni",
|
|
994
1026
|
closed_conversations: "Conversazioni chiuse"
|
|
995
|
-
},
|
|
1027
|
+
}, re = {
|
|
996
1028
|
write_a_message_placeholder: "Schrijf een bericht...",
|
|
997
1029
|
your_issue_has_been_resolved: "Uw probleem is opgelost!",
|
|
998
1030
|
new_conversation: "Nieuw gesprek",
|
|
@@ -1008,7 +1040,7 @@ const W = {
|
|
|
1008
1040
|
no_conversations_yet: "Nog geen gesprekken",
|
|
1009
1041
|
back_to_conversations: "Terug naar gesprekken",
|
|
1010
1042
|
closed_conversations: "Afgesloten gesprekken"
|
|
1011
|
-
},
|
|
1043
|
+
}, le = {
|
|
1012
1044
|
write_a_message_placeholder: "Skriv en melding...",
|
|
1013
1045
|
your_issue_has_been_resolved: "Problemet ditt er løst!",
|
|
1014
1046
|
new_conversation: "Ny samtale",
|
|
@@ -1024,7 +1056,7 @@ const W = {
|
|
|
1024
1056
|
no_conversations_yet: "Ingen samtaler ennå",
|
|
1025
1057
|
back_to_conversations: "Tilbake til samtaler",
|
|
1026
1058
|
closed_conversations: "Lukkede samtaler"
|
|
1027
|
-
},
|
|
1059
|
+
}, ce = {
|
|
1028
1060
|
write_a_message_placeholder: "Napisz wiadomość...",
|
|
1029
1061
|
your_issue_has_been_resolved: "Twój problem został rozwiązany!",
|
|
1030
1062
|
new_conversation: "Nowa rozmowa",
|
|
@@ -1040,7 +1072,7 @@ const W = {
|
|
|
1040
1072
|
no_conversations_yet: "Jeszcze brak rozmów",
|
|
1041
1073
|
back_to_conversations: "Powrót do rozmów",
|
|
1042
1074
|
closed_conversations: "Zamknięte rozmowy"
|
|
1043
|
-
},
|
|
1075
|
+
}, he = {
|
|
1044
1076
|
write_a_message_placeholder: "Escreva uma mensagem...",
|
|
1045
1077
|
your_issue_has_been_resolved: "Seu problema foi resolvido!",
|
|
1046
1078
|
new_conversation: "Nova conversa",
|
|
@@ -1056,7 +1088,7 @@ const W = {
|
|
|
1056
1088
|
no_conversations_yet: "Nenhuma conversa ainda",
|
|
1057
1089
|
back_to_conversations: "Voltar para conversas",
|
|
1058
1090
|
closed_conversations: "Conversas fechadas"
|
|
1059
|
-
},
|
|
1091
|
+
}, ue = {
|
|
1060
1092
|
write_a_message_placeholder: "Scrie un mesaj...",
|
|
1061
1093
|
your_issue_has_been_resolved: "Problema ta a fost rezolvată!",
|
|
1062
1094
|
new_conversation: "Conversație nouă",
|
|
@@ -1072,7 +1104,7 @@ const W = {
|
|
|
1072
1104
|
no_conversations_yet: "Încă nu există conversații",
|
|
1073
1105
|
back_to_conversations: "Înapoi la conversații",
|
|
1074
1106
|
closed_conversations: "Conversații închise"
|
|
1075
|
-
},
|
|
1107
|
+
}, _e = {
|
|
1076
1108
|
write_a_message_placeholder: "Skriv ett meddelande...",
|
|
1077
1109
|
your_issue_has_been_resolved: "Ditt problem har lösts!",
|
|
1078
1110
|
new_conversation: "Ny konversation",
|
|
@@ -1104,7 +1136,23 @@ const W = {
|
|
|
1104
1136
|
no_conversations_yet: "Пока нет разговоров",
|
|
1105
1137
|
back_to_conversations: "Назад к разговорам",
|
|
1106
1138
|
closed_conversations: "Закрытые разговоры"
|
|
1107
|
-
},
|
|
1139
|
+
}, ge = {
|
|
1140
|
+
write_a_message_placeholder: "เขียนข้อความ...",
|
|
1141
|
+
your_issue_has_been_resolved: "ปัญหาของคุณได้รับการแก้ไขแล้ว!",
|
|
1142
|
+
new_conversation: "การสนทนาใหม่",
|
|
1143
|
+
welcome_screen_title: "ยินดีต้อนรับสู่แชทสนับสนุนของเรา",
|
|
1144
|
+
welcome_screen_description: "เราพร้อมช่วยเหลือคุณ! เริ่มการสนทนาและเราจะติดต่อกลับโดยเร็วที่สุด",
|
|
1145
|
+
your_name_placeholder: "ชื่อของคุณ",
|
|
1146
|
+
your_email_placeholder: "ที่อยู่อีเมลของคุณ",
|
|
1147
|
+
start_chat_button: "พูดคุยกับฝ่ายสนับสนุน",
|
|
1148
|
+
start_chat_button_loading: "กำลังเชื่อมต่อ...",
|
|
1149
|
+
i_need_more_help: "ฉันต้องการความช่วยเหลือเพิ่มเติม",
|
|
1150
|
+
this_was_helpful: "สิ่งนี้เป็นประโยชน์",
|
|
1151
|
+
optional: "ไม่บังคับ",
|
|
1152
|
+
no_conversations_yet: "ยังไม่มีการสนทนา",
|
|
1153
|
+
back_to_conversations: "กลับไปที่การสนทนา",
|
|
1154
|
+
closed_conversations: "การสนทนาที่ปิดแล้ว"
|
|
1155
|
+
}, me = {
|
|
1108
1156
|
write_a_message_placeholder: "Bir mesaj yazın...",
|
|
1109
1157
|
your_issue_has_been_resolved: "Sorununuz çözüldü!",
|
|
1110
1158
|
new_conversation: "Yeni konuşma",
|
|
@@ -1120,37 +1168,57 @@ const W = {
|
|
|
1120
1168
|
no_conversations_yet: "Henüz konuşma yok",
|
|
1121
1169
|
back_to_conversations: "Konuşmalara geri dön",
|
|
1122
1170
|
closed_conversations: "Kapatılan konuşmalar"
|
|
1123
|
-
},
|
|
1171
|
+
}, pe = {
|
|
1172
|
+
write_a_message_placeholder: "Viết tin nhắn...",
|
|
1173
|
+
your_issue_has_been_resolved: "Vấn đề của bạn đã được giải quyết!",
|
|
1174
|
+
new_conversation: "Cuộc trò chuyện mới",
|
|
1175
|
+
welcome_screen_title: "Chào mừng đến với hỗ trợ trò chuyện của chúng tôi",
|
|
1176
|
+
welcome_screen_description: "Chúng tôi ở đây để giúp đỡ! Bắt đầu cuộc trò chuyện và chúng tôi sẽ phản hồi sớm nhất có thể.",
|
|
1177
|
+
your_name_placeholder: "Tên của bạn",
|
|
1178
|
+
your_email_placeholder: "Địa chỉ email của bạn",
|
|
1179
|
+
start_chat_button: "Liên hệ hỗ trợ",
|
|
1180
|
+
start_chat_button_loading: "Đang kết nối...",
|
|
1181
|
+
i_need_more_help: "Tôi cần thêm trợ giúp",
|
|
1182
|
+
this_was_helpful: "Điều này hữu ích",
|
|
1183
|
+
optional: "Tùy chọn",
|
|
1184
|
+
no_conversations_yet: "Chưa có cuộc trò chuyện nào",
|
|
1185
|
+
back_to_conversations: "Quay lại cuộc trò chuyện",
|
|
1186
|
+
closed_conversations: "Cuộc trò chuyện đã đóng"
|
|
1187
|
+
}, R = {
|
|
1124
1188
|
ar: W,
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1189
|
+
bg: Z,
|
|
1190
|
+
cs: X,
|
|
1191
|
+
da: Q,
|
|
1192
|
+
de: te,
|
|
1193
|
+
el: ee,
|
|
1194
|
+
en: se,
|
|
1195
|
+
es: ne,
|
|
1196
|
+
fi: ae,
|
|
1197
|
+
fr: oe,
|
|
1132
1198
|
it: ie,
|
|
1133
|
-
nl:
|
|
1134
|
-
no:
|
|
1135
|
-
pl:
|
|
1136
|
-
pt:
|
|
1137
|
-
ro:
|
|
1199
|
+
nl: re,
|
|
1200
|
+
no: le,
|
|
1201
|
+
pl: ce,
|
|
1202
|
+
pt: he,
|
|
1203
|
+
ro: ue,
|
|
1138
1204
|
ru: de,
|
|
1139
|
-
sv:
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1205
|
+
sv: _e,
|
|
1206
|
+
th: ge,
|
|
1207
|
+
tr: me,
|
|
1208
|
+
vi: pe
|
|
1209
|
+
}, ve = Object.keys(R);
|
|
1210
|
+
function Ce(h) {
|
|
1211
|
+
return ve.includes(h);
|
|
1144
1212
|
}
|
|
1145
|
-
function
|
|
1213
|
+
function Se(h, n, o) {
|
|
1146
1214
|
var r;
|
|
1147
|
-
return ((r =
|
|
1215
|
+
return ((r = o == null ? void 0 : o[n]) == null ? void 0 : r[h]) || R[n][h] || "";
|
|
1148
1216
|
}
|
|
1149
1217
|
export {
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1218
|
+
S as PrimitiveState,
|
|
1219
|
+
M as WidgetCtx,
|
|
1220
|
+
Se as getTranslation,
|
|
1221
|
+
V as isExhaustive,
|
|
1222
|
+
Ce as isSupportedLanguage
|
|
1155
1223
|
};
|
|
1156
1224
|
//# sourceMappingURL=index.js.map
|