@opencx/widget-core 4.0.41 → 4.0.43
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 +328 -158
- package/dist/index.js.map +1 -1
- package/dist/src/translation/et.d.ts +3 -0
- package/dist/src/translation/et.d.ts.map +1 -0
- package/dist/src/translation/hr.d.ts +3 -0
- package/dist/src/translation/hr.d.ts.map +1 -0
- package/dist/src/translation/hu.d.ts +3 -0
- package/dist/src/translation/hu.d.ts.map +1 -0
- package/dist/src/translation/index.d.ts +10 -0
- package/dist/src/translation/index.d.ts.map +1 -1
- package/dist/src/translation/is.d.ts +3 -0
- package/dist/src/translation/is.d.ts.map +1 -0
- package/dist/src/translation/lb.d.ts +3 -0
- package/dist/src/translation/lb.d.ts.map +1 -0
- package/dist/src/translation/lt.d.ts +3 -0
- package/dist/src/translation/lt.d.ts.map +1 -0
- package/dist/src/translation/lv.d.ts +3 -0
- package/dist/src/translation/lv.d.ts.map +1 -0
- package/dist/src/translation/mt.d.ts +3 -0
- package/dist/src/translation/mt.d.ts.map +1 -0
- package/dist/src/translation/nb.d.ts +3 -0
- package/dist/src/translation/nb.d.ts.map +1 -0
- package/dist/src/translation/sk.d.ts +3 -0
- package/dist/src/translation/sk.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { v4 as
|
|
4
|
-
const
|
|
1
|
+
import R from "openapi-fetch";
|
|
2
|
+
import D from "lodash.isequal";
|
|
3
|
+
import { v4 as E } from "uuid";
|
|
4
|
+
const V = (_) => {
|
|
5
5
|
console.log(_.error);
|
|
6
|
-
},
|
|
7
|
-
const a =
|
|
6
|
+
}, F = (_) => {
|
|
7
|
+
const a = R({
|
|
8
8
|
baseUrl: _.baseUrl
|
|
9
|
-
}),
|
|
9
|
+
}), n = {
|
|
10
10
|
onRequest: _.onRequest,
|
|
11
11
|
onResponse: _.onResponse,
|
|
12
|
-
onError: _.onError ||
|
|
12
|
+
onError: _.onError || V
|
|
13
13
|
};
|
|
14
|
-
return a.use(
|
|
14
|
+
return a.use(n), a;
|
|
15
15
|
};
|
|
16
|
-
class
|
|
16
|
+
class A {
|
|
17
17
|
constructor({ config: a }) {
|
|
18
18
|
var h, 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", o = {
|
|
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: o };
|
|
27
27
|
}, this.createOpenAPIClient = ({
|
|
28
28
|
baseUrl: e,
|
|
29
29
|
headers: t
|
|
30
|
-
}) =>
|
|
30
|
+
}) => F({
|
|
31
31
|
baseUrl: e,
|
|
32
|
-
onRequest: ({ request:
|
|
32
|
+
onRequest: ({ request: o }) => {
|
|
33
33
|
Object.entries(t).forEach(([i, l]) => {
|
|
34
|
-
l &&
|
|
34
|
+
l && o.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: o } = this.constructClientOptions(e);
|
|
40
|
+
this.client = this.createOpenAPIClient({ baseUrl: t, headers: o });
|
|
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,24 +54,24 @@ class E {
|
|
|
54
54
|
}), this.pollSessionAndHistory = async ({
|
|
55
55
|
sessionId: e,
|
|
56
56
|
lastMessageTimestamp: t,
|
|
57
|
-
abortSignal:
|
|
57
|
+
abortSignal: o
|
|
58
58
|
}) => {
|
|
59
59
|
const i = t ? { lastMessageTimestamp: t } : void 0;
|
|
60
60
|
return await this.client.GET("/backend/widget/v2/poll/{sessionId}", {
|
|
61
61
|
params: { path: { sessionId: e }, query: i },
|
|
62
|
-
signal:
|
|
62
|
+
signal: o
|
|
63
63
|
});
|
|
64
64
|
}, this.getSessions = async ({
|
|
65
65
|
cursor: e,
|
|
66
66
|
filters: t,
|
|
67
|
-
abortSignal:
|
|
67
|
+
abortSignal: o
|
|
68
68
|
}) => await this.client.GET("/backend/widget/v2/sessions", {
|
|
69
69
|
params: { query: { cursor: e, filters: JSON.stringify(t) } },
|
|
70
|
-
signal:
|
|
70
|
+
signal: o
|
|
71
71
|
}), this.uploadFile = async ({
|
|
72
72
|
file: e,
|
|
73
73
|
abortSignal: t,
|
|
74
|
-
onProgress:
|
|
74
|
+
onProgress: o
|
|
75
75
|
}) => new Promise((i, l) => {
|
|
76
76
|
var y;
|
|
77
77
|
const c = new FormData();
|
|
@@ -84,9 +84,9 @@ class E {
|
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
u.upload.addEventListener("progress", (v) => {
|
|
87
|
-
if (v.lengthComputable &&
|
|
88
|
-
const
|
|
89
|
-
|
|
87
|
+
if (v.lengthComputable && o) {
|
|
88
|
+
const b = Math.round(v.loaded / v.total * 100);
|
|
89
|
+
o(b);
|
|
90
90
|
}
|
|
91
91
|
}), u.addEventListener("load", () => {
|
|
92
92
|
if (u.status >= 200 && u.status < 300)
|
|
@@ -111,39 +111,39 @@ class E {
|
|
|
111
111
|
}), this.createStateCheckpoint = async (e) => await this.client.POST("/backend/widget/v2/checkpoint", {
|
|
112
112
|
body: e
|
|
113
113
|
}), this.submitCsat = async (e) => await this.client.POST("/backend/widget/v2/submit-csat", { body: e }), this.config = a, this.userToken = ((h = a.user) == null ? void 0 : h.token) || null;
|
|
114
|
-
const { baseUrl:
|
|
114
|
+
const { baseUrl: n, headers: r } = this.constructClientOptions(
|
|
115
115
|
(s = a.user) == null ? void 0 : s.token
|
|
116
116
|
);
|
|
117
|
-
this.client = this.createOpenAPIClient({ baseUrl:
|
|
117
|
+
this.client = this.createOpenAPIClient({ baseUrl: n, headers: r });
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function B(_, a) {
|
|
121
121
|
console.error(`Missing case for ${_} in ${a}`);
|
|
122
122
|
}
|
|
123
123
|
class S {
|
|
124
124
|
constructor(a) {
|
|
125
|
-
this.subscribers = /* @__PURE__ */ new Set(), this.get = () => this.state, this.set = (
|
|
126
|
-
|
|
127
|
-
}, this.setPartial = (
|
|
128
|
-
if (
|
|
129
|
-
const r = { ...this.state, ...
|
|
125
|
+
this.subscribers = /* @__PURE__ */ new Set(), this.get = () => this.state, this.set = (n) => {
|
|
126
|
+
D(this.state, n) || (this.state = n, this.notifySubscribers(n));
|
|
127
|
+
}, this.setPartial = (n) => {
|
|
128
|
+
if (n == null) return;
|
|
129
|
+
const r = { ...this.state, ...n };
|
|
130
130
|
this.set(r);
|
|
131
131
|
}, this.reset = () => {
|
|
132
132
|
this.set(this.initialState);
|
|
133
|
-
}, this.notifySubscribers = (
|
|
133
|
+
}, this.notifySubscribers = (n) => {
|
|
134
134
|
Array.from(this.subscribers).forEach((h) => {
|
|
135
135
|
try {
|
|
136
|
-
h(
|
|
136
|
+
h(n);
|
|
137
137
|
} catch (s) {
|
|
138
138
|
console.error(s);
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
|
-
}, this.subscribe = (
|
|
142
|
-
this.subscribers.delete(
|
|
141
|
+
}, this.subscribe = (n) => (this.subscribers.add(n), () => {
|
|
142
|
+
this.subscribers.delete(n);
|
|
143
143
|
}), this.state = a, this.initialState = a;
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
class
|
|
146
|
+
class L {
|
|
147
147
|
constructor() {
|
|
148
148
|
this.state = new S({
|
|
149
149
|
isPolling: !1,
|
|
@@ -151,7 +151,7 @@ class O {
|
|
|
151
151
|
}), this.abortController = new AbortController(), this.reset = () => {
|
|
152
152
|
var a;
|
|
153
153
|
this.abortController.abort("Resetting poller"), (a = this.stopPolling) == null || a.call(this), this.stopPolling = null;
|
|
154
|
-
}, this.stopPolling = null, this.startPolling = (a,
|
|
154
|
+
}, this.stopPolling = null, this.startPolling = (a, n) => {
|
|
155
155
|
if (this.stopPolling) return;
|
|
156
156
|
const r = [], h = async () => {
|
|
157
157
|
this.abortController = new AbortController(), this.state.setPartial({ isPolling: !0 });
|
|
@@ -164,7 +164,7 @@ 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(h,
|
|
167
|
+
this.abortController.signal.aborted ? console.log("Poller aborted, not scheduling anymore") : r.push(setTimeout(h, n));
|
|
168
168
|
};
|
|
169
169
|
h(), this.stopPolling = () => {
|
|
170
170
|
r.forEach(clearTimeout), this.state.reset();
|
|
@@ -172,23 +172,23 @@ class O {
|
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function U(_) {
|
|
176
176
|
try {
|
|
177
177
|
const a = _();
|
|
178
|
-
return a instanceof Promise ? a.then((
|
|
178
|
+
return a instanceof Promise ? a.then((n) => ({ data: n })).catch((n) => ({ error: n })) : { data: a };
|
|
179
179
|
} catch (a) {
|
|
180
180
|
return { error: a };
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
class
|
|
183
|
+
class K {
|
|
184
184
|
constructor({
|
|
185
185
|
api: a,
|
|
186
|
-
config:
|
|
186
|
+
config: n,
|
|
187
187
|
sessionCtx: r,
|
|
188
188
|
messageCtx: h,
|
|
189
189
|
sessionPollingIntervalSeconds: s
|
|
190
190
|
}) {
|
|
191
|
-
this.poller = new
|
|
191
|
+
this.poller = new L(), this.fetchSessionAndFullHistoryAbortController = new AbortController(), this.registerPolling = () => {
|
|
192
192
|
this.sessionCtx.sessionState.subscribe(({ session: e }) => {
|
|
193
193
|
e != null && e.id ? this.poller.startPolling(async (t) => {
|
|
194
194
|
this.fetchSessionAndHistory({ sessionId: e.id, abortSignal: t });
|
|
@@ -210,18 +210,18 @@ class H {
|
|
|
210
210
|
}, this.fetchSessionAndHistory = async ({
|
|
211
211
|
sessionId: e,
|
|
212
212
|
abortSignal: t,
|
|
213
|
-
fetchFullHistory:
|
|
213
|
+
fetchFullHistory: o = !1
|
|
214
214
|
}) => {
|
|
215
215
|
var u;
|
|
216
216
|
this.messageCtx.state.get().messages.length === 0 && this.messageCtx.state.setPartial({ isInitialFetchLoading: !0 });
|
|
217
217
|
const i = this.messageCtx.state.get().messages, l = i.length > 0 ? ((u = i[i.length - 1]) == null ? void 0 : u.timestamp) ?? void 0 : void 0, { data: c } = await this.api.pollSessionAndHistory({
|
|
218
218
|
sessionId: e,
|
|
219
219
|
abortSignal: t,
|
|
220
|
-
lastMessageTimestamp:
|
|
220
|
+
lastMessageTimestamp: o ? 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
223
|
const p = this.messageCtx.state.get().messages, w = c.history.map(this.mapHistoryToMessage).filter((d) => d !== null).filter(
|
|
224
|
-
(d) => !p.some((
|
|
224
|
+
(d) => !p.some((k) => k.id === d.id)
|
|
225
225
|
);
|
|
226
226
|
this.messageCtx.state.setPartial({
|
|
227
227
|
messages: [...p, ...w]
|
|
@@ -229,7 +229,7 @@ class H {
|
|
|
229
229
|
}
|
|
230
230
|
this.messageCtx.state.get().isInitialFetchLoading && this.messageCtx.state.setPartial({ isInitialFetchLoading: !1 });
|
|
231
231
|
}, this.mapHistoryToMessage = (e) => {
|
|
232
|
-
var
|
|
232
|
+
var o;
|
|
233
233
|
const t = {
|
|
234
234
|
id: e.publicId,
|
|
235
235
|
timestamp: e.sentAt || "",
|
|
@@ -268,7 +268,7 @@ class H {
|
|
|
268
268
|
component: "bot_message",
|
|
269
269
|
agent: {
|
|
270
270
|
id: null,
|
|
271
|
-
name: ((
|
|
271
|
+
name: ((o = this.config.bot) == null ? void 0 : o.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,
|
|
@@ -326,7 +326,7 @@ class H {
|
|
|
326
326
|
case "none":
|
|
327
327
|
return null;
|
|
328
328
|
default:
|
|
329
|
-
return
|
|
329
|
+
return B(
|
|
330
330
|
e.systemMessagePayload,
|
|
331
331
|
this.constructSystemMessage.name
|
|
332
332
|
), null;
|
|
@@ -335,17 +335,17 @@ class H {
|
|
|
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
|
|
338
|
+
const o = t.responseBodyText, i = U(() => JSON.parse(o)).data;
|
|
339
339
|
if (i) return i;
|
|
340
340
|
}
|
|
341
341
|
return e.result;
|
|
342
|
-
}, this.api = a, this.config =
|
|
342
|
+
}, this.api = a, this.config = n, this.sessionCtx = r, this.messageCtx = h, this.sessionPollingIntervalSeconds = s, this.registerPolling();
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
class
|
|
345
|
+
class H {
|
|
346
346
|
constructor({
|
|
347
347
|
config: a,
|
|
348
|
-
api:
|
|
348
|
+
api: n,
|
|
349
349
|
storageCtx: r
|
|
350
350
|
}) {
|
|
351
351
|
var h;
|
|
@@ -353,25 +353,25 @@ class q {
|
|
|
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, o, i, l, c, u, p, w, d, k, 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 ((o = this.config.extraDataCollectionFields) != null && o.length)
|
|
360
360
|
return;
|
|
361
|
-
const
|
|
362
|
-
|
|
361
|
+
const b = await ((i = this.storageCtx) == null ? void 0 : i.getContactToken());
|
|
362
|
+
b && await this.setUnverifiedContact(b);
|
|
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 b = await ((u = this.storageCtx) == null ? void 0 : u.getContactToken());
|
|
367
|
+
if (b) {
|
|
368
|
+
await this.setUnverifiedContact(b);
|
|
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: (
|
|
374
|
+
non_verified_name: (k = (d = this.config.user) == null ? void 0 : d.data) == null ? void 0 : k.name,
|
|
375
375
|
non_verified_custom_data: (v = (y = this.config.user) == null ? void 0 : y.data) == null ? void 0 : v.customData
|
|
376
376
|
});
|
|
377
377
|
}
|
|
@@ -388,10 +388,10 @@ class q {
|
|
|
388
388
|
this.state.setPartial({ isCreatingUnverifiedContact: !1 });
|
|
389
389
|
}
|
|
390
390
|
}, this.setUnverifiedContact = async (s) => {
|
|
391
|
-
var
|
|
392
|
-
const e = await ((
|
|
391
|
+
var o, i, l, c;
|
|
392
|
+
const e = await ((o = this.storageCtx) == null ? void 0 : o.getExternalContactId()), t = ((i = this.config.user) == null ? void 0 : i.externalId) || e || E();
|
|
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 = a, this.storageCtx = r, this.api =
|
|
394
|
+
}, this.config = a, this.storageCtx = r, this.api = n, this.state = new S({
|
|
395
395
|
contact: (h = a.user) != null && h.token ? {
|
|
396
396
|
token: a.user.token,
|
|
397
397
|
// Set optional externalId from config... not local storage
|
|
@@ -403,13 +403,13 @@ class q {
|
|
|
403
403
|
}), this.autoCreateUnverifiedUserIfNotExists();
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
function
|
|
407
|
-
return
|
|
406
|
+
function C() {
|
|
407
|
+
return E();
|
|
408
408
|
}
|
|
409
|
-
class
|
|
409
|
+
class J {
|
|
410
410
|
constructor({
|
|
411
411
|
config: a,
|
|
412
|
-
api:
|
|
412
|
+
api: n,
|
|
413
413
|
sessionCtx: r,
|
|
414
414
|
messageCtx: h
|
|
415
415
|
}) {
|
|
@@ -418,7 +418,7 @@ class K {
|
|
|
418
418
|
const e = (l = this.sessionCtx.sessionState.get().session) == null ? void 0 : l.id;
|
|
419
419
|
if (!e)
|
|
420
420
|
return { data: null, error: "No session id found" };
|
|
421
|
-
const t =
|
|
421
|
+
const t = C();
|
|
422
422
|
this.messageCtx.state.setPartial({
|
|
423
423
|
messages: [
|
|
424
424
|
...this.messageCtx.state.get().messages,
|
|
@@ -436,23 +436,23 @@ class K {
|
|
|
436
436
|
}
|
|
437
437
|
]
|
|
438
438
|
});
|
|
439
|
-
const { data:
|
|
439
|
+
const { data: o, 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 = a, this.api =
|
|
444
|
+
return { data: o, error: i };
|
|
445
|
+
}, this.config = a, this.api = n, this.sessionCtx = r, this.messageCtx = h;
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
|
-
class
|
|
448
|
+
class q {
|
|
449
449
|
constructor({
|
|
450
450
|
config: a,
|
|
451
|
-
api:
|
|
451
|
+
api: n,
|
|
452
452
|
contactCtx: r,
|
|
453
453
|
sessionsPollingIntervalSeconds: h
|
|
454
454
|
}) {
|
|
455
|
-
this.sessionsRefresher = new
|
|
455
|
+
this.sessionsRefresher = new L(), this.sessionState = new S({
|
|
456
456
|
session: null,
|
|
457
457
|
isCreatingSession: !1,
|
|
458
458
|
isResolvingSession: !1
|
|
@@ -481,7 +481,7 @@ class Y {
|
|
|
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 = U(() => JSON.stringify(e))) == null ? void 0 : t.data) || ""];
|
|
485
485
|
}
|
|
486
486
|
)
|
|
487
487
|
), this.createSession = async () => {
|
|
@@ -490,10 +490,10 @@ class Y {
|
|
|
490
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: o } = 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:", o), 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 Y {
|
|
|
501
501
|
});
|
|
502
502
|
if (s) {
|
|
503
503
|
const t = [...this.sessionsState.get().data, ...s.items].filter(
|
|
504
|
-
(
|
|
504
|
+
(o, i, l) => i === l.findIndex((c) => o.id === c.id)
|
|
505
505
|
);
|
|
506
506
|
this.sessionsState.setPartial({
|
|
507
507
|
data: t,
|
|
@@ -510,9 +510,9 @@ class Y {
|
|
|
510
510
|
});
|
|
511
511
|
}
|
|
512
512
|
}, this.getSessions = async ({ cursor: s }) => {
|
|
513
|
-
var t,
|
|
513
|
+
var t, o;
|
|
514
514
|
if (!((t = this.contactCtx.state.get().contact) != null && t.token)) return { data: null };
|
|
515
|
-
const e = (
|
|
515
|
+
const e = (o = this.contactCtx.state.get().contact) == null ? void 0 : o.externalId;
|
|
516
516
|
return await this.api.getSessions({
|
|
517
517
|
cursor: s,
|
|
518
518
|
filters: e ? {
|
|
@@ -521,7 +521,7 @@ class Y {
|
|
|
521
521
|
});
|
|
522
522
|
}, this.setSessions = (s) => {
|
|
523
523
|
const e = [...s, ...this.sessionsState.get().data].filter(
|
|
524
|
-
(t,
|
|
524
|
+
(t, o, i) => o === i.findIndex((l) => t.id === l.id)
|
|
525
525
|
);
|
|
526
526
|
this.sessionsState.setPartial({ data: e });
|
|
527
527
|
}, this.refreshSessions = async () => {
|
|
@@ -540,18 +540,18 @@ class Y {
|
|
|
540
540
|
var i;
|
|
541
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: o } = 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 = a, this.api =
|
|
548
|
+
}, this.config = a, this.api = n, this.contactCtx = r, this.sessionsPollingIntervalSeconds = h, this.registerSessionsRefresherWrapper();
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
class
|
|
551
|
+
class Y {
|
|
552
552
|
constructor({
|
|
553
553
|
config: a,
|
|
554
|
-
api:
|
|
554
|
+
api: n,
|
|
555
555
|
sessionCtx: r,
|
|
556
556
|
contactCtx: h
|
|
557
557
|
}) {
|
|
@@ -564,7 +564,7 @@ class $ {
|
|
|
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, o, i, l, c, u, p, w;
|
|
568
568
|
try {
|
|
569
569
|
if (!s.content.trim() && (!s.attachments || s.attachments.length === 0)) {
|
|
570
570
|
console.warn(
|
|
@@ -572,9 +572,9 @@ class $ {
|
|
|
572
572
|
);
|
|
573
573
|
return;
|
|
574
574
|
}
|
|
575
|
-
const d = this.sessionCtx.sessionState.get().session, y = (d == null ? void 0 : d.assignee.kind) === "ai", v = this.state.get().isSendingMessageToAI,
|
|
575
|
+
const d = this.sessionCtx.sessionState.get().session, y = (d == null ? void 0 : d.assignee.kind) === "ai", v = this.state.get().isSendingMessageToAI, b = this.state.get().messages.at(-1);
|
|
576
576
|
if (v || // If last message is from user, then bot response did not arrive yet
|
|
577
|
-
y && (
|
|
577
|
+
y && (b == null ? void 0 : b.type) === "USER") {
|
|
578
578
|
console.warn("Cannot send messages while awaiting AI response");
|
|
579
579
|
return;
|
|
580
580
|
}
|
|
@@ -583,9 +583,9 @@ class $ {
|
|
|
583
583
|
isSendingMessage: !0,
|
|
584
584
|
isSendingMessageToAI: !!y || !d
|
|
585
585
|
});
|
|
586
|
-
const
|
|
586
|
+
const I = this.state.get().messages, P = !((e = this.sessionCtx.sessionState.get().session) != null && e.id) && I.length === 0 && ((t = this.config.advancedInitialMessages) == null ? void 0 : t.some((g) => g.persistent)), j = P ? (this.config.advancedInitialMessages || []).filter((g) => g.persistent).map(
|
|
587
587
|
(g) => ({
|
|
588
|
-
id:
|
|
588
|
+
id: C(),
|
|
589
589
|
component: "bot_message",
|
|
590
590
|
type: "AI",
|
|
591
591
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -594,34 +594,34 @@ class $ {
|
|
|
594
594
|
},
|
|
595
595
|
agent: this.config.bot ? { ...this.config.bot, isAi: !0, id: null } : void 0
|
|
596
596
|
})
|
|
597
|
-
) : [],
|
|
597
|
+
) : [], z = this.toUserMessage(
|
|
598
598
|
s.content.trim(),
|
|
599
599
|
s.attachments || void 0
|
|
600
600
|
);
|
|
601
601
|
if (this.state.setPartial({
|
|
602
602
|
messages: [
|
|
603
|
-
...
|
|
604
|
-
...
|
|
605
|
-
|
|
603
|
+
...j,
|
|
604
|
+
...I,
|
|
605
|
+
z
|
|
606
606
|
]
|
|
607
|
-
}), !((
|
|
607
|
+
}), !((o = this.sessionCtx.sessionState.get().session) != null && o.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
|
|
615
|
-
if (!
|
|
614
|
+
const T = (i = this.sessionCtx.sessionState.get().session) == null ? void 0 : i.id;
|
|
615
|
+
if (!T) return;
|
|
616
616
|
const { data: m } = await this.api.sendMessage(
|
|
617
617
|
{
|
|
618
|
-
uuid:
|
|
618
|
+
uuid: z.id,
|
|
619
619
|
bot_token: this.config.token,
|
|
620
620
|
headers: this.config.headers,
|
|
621
621
|
query_params: this.config.queryParams,
|
|
622
622
|
body_properties: this.config.bodyProperties,
|
|
623
|
-
session_id:
|
|
624
|
-
content:
|
|
623
|
+
session_id: T,
|
|
624
|
+
content: z.content,
|
|
625
625
|
attachments: s.attachments,
|
|
626
626
|
clientContext: this.config.context,
|
|
627
627
|
custom_data: {
|
|
@@ -630,7 +630,7 @@ class $ {
|
|
|
630
630
|
},
|
|
631
631
|
language: this.config.language,
|
|
632
632
|
exit_mode_prompt: s.exitModePrompt,
|
|
633
|
-
initial_messages:
|
|
633
|
+
initial_messages: P ? j.map((g) => ({
|
|
634
634
|
uuid: g.id,
|
|
635
635
|
content: g.data.message
|
|
636
636
|
})) : void 0
|
|
@@ -642,7 +642,7 @@ class $ {
|
|
|
642
642
|
if (g) {
|
|
643
643
|
const x = this.state.get().messages;
|
|
644
644
|
if (!!x.some(
|
|
645
|
-
(
|
|
645
|
+
(O) => O.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)
|
|
@@ -673,14 +673,14 @@ class $ {
|
|
|
673
673
|
}
|
|
674
674
|
}, this.toUserMessage = (s, e) => {
|
|
675
675
|
const t = (() => {
|
|
676
|
-
const
|
|
677
|
-
return this.state.get().messages.length === 0 &&
|
|
676
|
+
const o = this.contactCtx.state.get().extraCollectedData;
|
|
677
|
+
return this.state.get().messages.length === 0 && o && Object.keys(o).length > 0 ? `${Object.entries(o).filter(([l, c]) => !!c).map(([l, c]) => `${l}: ${c}`).join(`
|
|
678
678
|
`)}
|
|
679
679
|
|
|
680
680
|
${s}` : s;
|
|
681
681
|
})();
|
|
682
682
|
return {
|
|
683
|
-
id:
|
|
683
|
+
id: C(),
|
|
684
684
|
type: "USER",
|
|
685
685
|
content: t,
|
|
686
686
|
deliveredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -691,7 +691,7 @@ ${s}` : s;
|
|
|
691
691
|
var e;
|
|
692
692
|
return s.success && s.autopilotResponse ? {
|
|
693
693
|
type: "AI",
|
|
694
|
-
id: s.autopilotResponse.id ||
|
|
694
|
+
id: s.autopilotResponse.id || C(),
|
|
695
695
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
696
696
|
component: "bot_message",
|
|
697
697
|
agent: this.config.bot ? {
|
|
@@ -712,7 +712,7 @@ ${s}` : s;
|
|
|
712
712
|
} : null;
|
|
713
713
|
}, this.toBotErrorMessage = (s) => ({
|
|
714
714
|
type: "AI",
|
|
715
|
-
id:
|
|
715
|
+
id: C(),
|
|
716
716
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
717
717
|
component: "bot_message",
|
|
718
718
|
data: {
|
|
@@ -720,13 +720,13 @@ ${s}` : s;
|
|
|
720
720
|
variant: "error",
|
|
721
721
|
action: void 0
|
|
722
722
|
}
|
|
723
|
-
}), this.config = a, this.api =
|
|
723
|
+
}), this.config = a, this.api = n, this.sessionCtx = r, this.contactCtx = h;
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
|
-
class
|
|
726
|
+
class G {
|
|
727
727
|
constructor({
|
|
728
728
|
config: a,
|
|
729
|
-
contactCtx:
|
|
729
|
+
contactCtx: n,
|
|
730
730
|
sessionCtx: r,
|
|
731
731
|
resetChat: h
|
|
732
732
|
}) {
|
|
@@ -739,8 +739,8 @@ class J {
|
|
|
739
739
|
});
|
|
740
740
|
}), this.sessionCtx.sessionsState.subscribe(
|
|
741
741
|
({ isInitialFetchLoading: e, data: t }) => {
|
|
742
|
-
var
|
|
743
|
-
if ((
|
|
742
|
+
var o, i, l, c;
|
|
743
|
+
if ((o = this.config.router) != null && o.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
745
|
!((i = this.sessionCtx.sessionState.get().session) != null && i.id)) {
|
|
746
746
|
const u = (l = t.find((p) => p.isOpened)) == null ? void 0 : l.id;
|
|
@@ -753,20 +753,20 @@ class J {
|
|
|
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((o) => o.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 = a, this.contactCtx =
|
|
761
|
+
}, this.config = a, this.contactCtx = n, this.sessionCtx = r, this.resetChat = h, 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
|
}
|
|
765
765
|
}
|
|
766
|
-
class
|
|
766
|
+
class $ {
|
|
767
767
|
constructor({
|
|
768
768
|
storage: a,
|
|
769
|
-
config:
|
|
769
|
+
config: n
|
|
770
770
|
}) {
|
|
771
771
|
this.KEYS = {
|
|
772
772
|
contactToken: (r) => `opencx-widget:org-token-${r}:contact-token`,
|
|
@@ -775,48 +775,48 @@ class G {
|
|
|
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 = a, this.config =
|
|
778
|
+
}, this.getExternalContactId = async () => this.storage.get(this.KEYS.externalContactId(this.config.token)), this.storage = a, this.config = n;
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
|
-
const
|
|
781
|
+
const f = class f {
|
|
782
782
|
constructor({
|
|
783
783
|
config: a,
|
|
784
|
-
storage:
|
|
784
|
+
storage: n,
|
|
785
785
|
modes: r,
|
|
786
786
|
org: h
|
|
787
787
|
}) {
|
|
788
788
|
if (this.modes = [], this.resetChat = () => {
|
|
789
789
|
this.sessionCtx.reset(), this.messageCtx.reset();
|
|
790
|
-
}, !
|
|
790
|
+
}, !f.pollingIntervalsSeconds)
|
|
791
791
|
throw Error(
|
|
792
792
|
"Widget polling values are not defined, did you call WidgetCtx.initialize()"
|
|
793
793
|
);
|
|
794
|
-
this.config = a, this.org = h, this.api = new
|
|
794
|
+
this.config = a, this.org = h, this.api = new A({ config: a }), this.storageCtx = n ? new $({ storage: n, config: a }) : void 0, this.modes = r, this.contactCtx = new H({
|
|
795
795
|
api: this.api,
|
|
796
796
|
config: this.config,
|
|
797
797
|
storageCtx: this.storageCtx
|
|
798
|
-
}), this.sessionCtx = new
|
|
798
|
+
}), this.sessionCtx = new q({
|
|
799
799
|
config: this.config,
|
|
800
800
|
api: this.api,
|
|
801
801
|
contactCtx: this.contactCtx,
|
|
802
|
-
sessionsPollingIntervalSeconds:
|
|
803
|
-
}), this.messageCtx = new
|
|
802
|
+
sessionsPollingIntervalSeconds: f.pollingIntervalsSeconds.sessions
|
|
803
|
+
}), this.messageCtx = new Y({
|
|
804
804
|
config: this.config,
|
|
805
805
|
api: this.api,
|
|
806
806
|
sessionCtx: this.sessionCtx,
|
|
807
807
|
contactCtx: this.contactCtx
|
|
808
|
-
}), this.csatCtx = new
|
|
808
|
+
}), this.csatCtx = new J({
|
|
809
809
|
config: this.config,
|
|
810
810
|
api: this.api,
|
|
811
811
|
sessionCtx: this.sessionCtx,
|
|
812
812
|
messageCtx: this.messageCtx
|
|
813
|
-
}), this.activeSessionPollingCtx = new
|
|
813
|
+
}), this.activeSessionPollingCtx = new K({
|
|
814
814
|
api: this.api,
|
|
815
815
|
config: this.config,
|
|
816
816
|
sessionCtx: this.sessionCtx,
|
|
817
817
|
messageCtx: this.messageCtx,
|
|
818
|
-
sessionPollingIntervalSeconds:
|
|
819
|
-
}), this.routerCtx = new
|
|
818
|
+
sessionPollingIntervalSeconds: f.pollingIntervalsSeconds.session
|
|
819
|
+
}), this.routerCtx = new G({
|
|
820
820
|
config: this.config,
|
|
821
821
|
contactCtx: this.contactCtx,
|
|
822
822
|
sessionCtx: this.sessionCtx,
|
|
@@ -824,22 +824,22 @@ const b = class b {
|
|
|
824
824
|
});
|
|
825
825
|
}
|
|
826
826
|
};
|
|
827
|
-
|
|
827
|
+
f.pollingIntervalsSeconds = null, f.initialize = async ({
|
|
828
828
|
config: a,
|
|
829
|
-
storage:
|
|
829
|
+
storage: n
|
|
830
830
|
}) => {
|
|
831
831
|
var h, s, e;
|
|
832
|
-
const r = await new
|
|
832
|
+
const r = await new A({
|
|
833
833
|
config: a
|
|
834
834
|
}).getExternalWidgetConfig();
|
|
835
835
|
if (!r.data)
|
|
836
836
|
throw new Error("Failed to fetch widget config");
|
|
837
|
-
return
|
|
837
|
+
return f.pollingIntervalsSeconds = {
|
|
838
838
|
session: ((h = r.data) == null ? void 0 : h.sessionPollingIntervalSeconds) || 10,
|
|
839
839
|
sessions: ((s = r.data) == null ? void 0 : s.sessionsPollingIntervalSeconds) || 60
|
|
840
|
-
}, new
|
|
840
|
+
}, new f({
|
|
841
841
|
config: a,
|
|
842
|
-
storage:
|
|
842
|
+
storage: n,
|
|
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 = f;
|
|
851
851
|
const W = {
|
|
852
852
|
write_a_message_placeholder: "اكتب رسالة...",
|
|
853
853
|
your_issue_has_been_resolved: "تم حل مشكلتك!",
|
|
@@ -976,7 +976,7 @@ const W = {
|
|
|
976
976
|
no_conversations_yet: "No conversations yet",
|
|
977
977
|
back_to_conversations: "Back to conversations",
|
|
978
978
|
closed_conversations: "Closed conversations"
|
|
979
|
-
},
|
|
979
|
+
}, oe = {
|
|
980
980
|
write_a_message_placeholder: "Escribe un mensaje...",
|
|
981
981
|
your_issue_has_been_resolved: "¡Tu problema fue resuelto!",
|
|
982
982
|
new_conversation: "Nueva conversación",
|
|
@@ -992,7 +992,7 @@ const W = {
|
|
|
992
992
|
no_conversations_yet: "Sin conversaciones aún",
|
|
993
993
|
back_to_conversations: "Volver a conversaciones",
|
|
994
994
|
closed_conversations: "Conversaciones cerradas"
|
|
995
|
-
},
|
|
995
|
+
}, ne = {
|
|
996
996
|
write_a_message_placeholder: "Magsulat ng mensahe...",
|
|
997
997
|
your_issue_has_been_resolved: "Nalutas na ang iyong isyu!",
|
|
998
998
|
new_conversation: "Bagong usapan",
|
|
@@ -1200,7 +1200,7 @@ const W = {
|
|
|
1200
1200
|
no_conversations_yet: "Inga konversationer ännu",
|
|
1201
1201
|
back_to_conversations: "Tillbaka till konversationer",
|
|
1202
1202
|
closed_conversations: "Stängda konversationer"
|
|
1203
|
-
},
|
|
1203
|
+
}, be = {
|
|
1204
1204
|
write_a_message_placeholder: "Напишите сообщение...",
|
|
1205
1205
|
your_issue_has_been_resolved: "Ваша проблема решена!",
|
|
1206
1206
|
new_conversation: "Новый разговор",
|
|
@@ -1216,7 +1216,7 @@ const W = {
|
|
|
1216
1216
|
no_conversations_yet: "Пока нет разговоров",
|
|
1217
1217
|
back_to_conversations: "Назад к разговорам",
|
|
1218
1218
|
closed_conversations: "Закрытые разговоры"
|
|
1219
|
-
},
|
|
1219
|
+
}, fe = {
|
|
1220
1220
|
write_a_message_placeholder: "เขียนข้อความ...",
|
|
1221
1221
|
your_issue_has_been_resolved: "ปัญหาของคุณได้รับการแก้ไขแล้ว!",
|
|
1222
1222
|
new_conversation: "การสนทนาใหม่",
|
|
@@ -1264,7 +1264,7 @@ const W = {
|
|
|
1264
1264
|
no_conversations_yet: "ابھی تک کوئی گفتگو نہیں",
|
|
1265
1265
|
back_to_conversations: "گفتگو پر واپس جائیں",
|
|
1266
1266
|
closed_conversations: "بند گفتگو"
|
|
1267
|
-
},
|
|
1267
|
+
}, ke = {
|
|
1268
1268
|
write_a_message_placeholder: "Viết tin nhắn...",
|
|
1269
1269
|
your_issue_has_been_resolved: "Vấn đề của bạn đã được giải quyết!",
|
|
1270
1270
|
new_conversation: "Cuộc trò chuyện mới",
|
|
@@ -1296,7 +1296,167 @@ const W = {
|
|
|
1296
1296
|
no_conversations_yet: "暂无对话",
|
|
1297
1297
|
back_to_conversations: "返回对话",
|
|
1298
1298
|
closed_conversations: "已关闭的对话"
|
|
1299
|
-
},
|
|
1299
|
+
}, Ce = {
|
|
1300
|
+
write_a_message_placeholder: "Napišite poruku...",
|
|
1301
|
+
your_issue_has_been_resolved: "Vaš problem je riješen!",
|
|
1302
|
+
new_conversation: "Novi razgovor",
|
|
1303
|
+
welcome_screen_title: "Dobrodošli u naš chat za podršku",
|
|
1304
|
+
welcome_screen_description: "Ovdje smo da pomognemo! Započnite razgovor i odgovorit ćemo vam što je prije moguće.",
|
|
1305
|
+
your_name_placeholder: "Vaše ime",
|
|
1306
|
+
your_email_placeholder: "Vaša e-mail adresa",
|
|
1307
|
+
start_chat_button: "Razgovarajte s podrškom",
|
|
1308
|
+
start_chat_button_loading: "Povezivanje...",
|
|
1309
|
+
i_need_more_help: "Trebam dodatnu pomoć",
|
|
1310
|
+
this_was_helpful: "Ovo je bilo korisno",
|
|
1311
|
+
optional: "Neobavezno",
|
|
1312
|
+
no_conversations_yet: "Još nema razgovora",
|
|
1313
|
+
back_to_conversations: "Natrag na razgovore",
|
|
1314
|
+
closed_conversations: "Zatvoreni razgovori"
|
|
1315
|
+
}, xe = {
|
|
1316
|
+
write_a_message_placeholder: "Kirjuta sõnum...",
|
|
1317
|
+
your_issue_has_been_resolved: "Teie probleem on lahendatud!",
|
|
1318
|
+
new_conversation: "Uus vestlus",
|
|
1319
|
+
welcome_screen_title: "Tere tulemast meie tugiteenusesse",
|
|
1320
|
+
welcome_screen_description: "Oleme siin, et aidata! Alustage vestlust ja vastame teile esimesel võimalusel.",
|
|
1321
|
+
your_name_placeholder: "Teie nimi",
|
|
1322
|
+
your_email_placeholder: "Teie e-posti aadress",
|
|
1323
|
+
start_chat_button: "Räägi toega",
|
|
1324
|
+
start_chat_button_loading: "Ühendamine...",
|
|
1325
|
+
i_need_more_help: "Vajan rohkem abi",
|
|
1326
|
+
this_was_helpful: "See oli kasulik",
|
|
1327
|
+
optional: "Valikuline",
|
|
1328
|
+
no_conversations_yet: "Vestlusi pole veel",
|
|
1329
|
+
back_to_conversations: "Tagasi vestluste juurde",
|
|
1330
|
+
closed_conversations: "Suletud vestlused"
|
|
1331
|
+
}, ze = {
|
|
1332
|
+
write_a_message_placeholder: "Írjon üzenetet...",
|
|
1333
|
+
your_issue_has_been_resolved: "A problémája megoldódott!",
|
|
1334
|
+
new_conversation: "Új beszélgetés",
|
|
1335
|
+
welcome_screen_title: "Üdvözöljük az ügyfélszolgálati chatünkön",
|
|
1336
|
+
welcome_screen_description: "Azért vagyunk itt, hogy segítsünk! Kezdjen beszélgetést, és mihamarabb válaszolunk.",
|
|
1337
|
+
your_name_placeholder: "Az Ön neve",
|
|
1338
|
+
your_email_placeholder: "Az Ön e-mail címe",
|
|
1339
|
+
start_chat_button: "Beszélgetés az ügyfélszolgálattal",
|
|
1340
|
+
start_chat_button_loading: "Csatlakozás...",
|
|
1341
|
+
i_need_more_help: "További segítségre van szükségem",
|
|
1342
|
+
this_was_helpful: "Ez hasznos volt",
|
|
1343
|
+
optional: "Opcionális",
|
|
1344
|
+
no_conversations_yet: "Még nincsenek beszélgetések",
|
|
1345
|
+
back_to_conversations: "Vissza a beszélgetésekhez",
|
|
1346
|
+
closed_conversations: "Lezárt beszélgetések"
|
|
1347
|
+
}, Ie = {
|
|
1348
|
+
write_a_message_placeholder: "Skrifaðu skilaboð...",
|
|
1349
|
+
your_issue_has_been_resolved: "Málið þitt hefur verið leyst!",
|
|
1350
|
+
new_conversation: "Nýtt samtal",
|
|
1351
|
+
welcome_screen_title: "Velkomin í þjónustuverið okkar",
|
|
1352
|
+
welcome_screen_description: "Við erum hér til að hjálpa! Byrjaðu samtal og við munum svara eins fljótt og auðið er.",
|
|
1353
|
+
your_name_placeholder: "Nafnið þitt",
|
|
1354
|
+
your_email_placeholder: "Netfangið þitt",
|
|
1355
|
+
start_chat_button: "Tala við þjónustuver",
|
|
1356
|
+
start_chat_button_loading: "Tengist...",
|
|
1357
|
+
i_need_more_help: "Ég þarf meiri hjálp",
|
|
1358
|
+
this_was_helpful: "Þetta var gagnlegt",
|
|
1359
|
+
optional: "Valfrjálst",
|
|
1360
|
+
no_conversations_yet: "Engin samtöl ennþá",
|
|
1361
|
+
back_to_conversations: "Til baka í samtöl",
|
|
1362
|
+
closed_conversations: "Lokuð samtöl"
|
|
1363
|
+
}, Pe = {
|
|
1364
|
+
write_a_message_placeholder: "Rakstiet ziņojumu...",
|
|
1365
|
+
your_issue_has_been_resolved: "Jūsu problēma ir atrisināta!",
|
|
1366
|
+
new_conversation: "Jauna saruna",
|
|
1367
|
+
welcome_screen_title: "Laipni lūdzam mūsu atbalsta tērzēšanā",
|
|
1368
|
+
welcome_screen_description: "Mēs esam šeit, lai palīdzētu! Sāciet sarunu, un mēs jums atbildēsim pēc iespējas ātrāk.",
|
|
1369
|
+
your_name_placeholder: "Jūsu vārds",
|
|
1370
|
+
your_email_placeholder: "Jūsu e-pasta adrese",
|
|
1371
|
+
start_chat_button: "Sazināties ar atbalstu",
|
|
1372
|
+
start_chat_button_loading: "Savienošana...",
|
|
1373
|
+
i_need_more_help: "Man vajag vairāk palīdzības",
|
|
1374
|
+
this_was_helpful: "Tas bija noderīgi",
|
|
1375
|
+
optional: "Neobligāts",
|
|
1376
|
+
no_conversations_yet: "Pagaidām nav sarunu",
|
|
1377
|
+
back_to_conversations: "Atpakaļ pie sarunām",
|
|
1378
|
+
closed_conversations: "Slēgtās sarunas"
|
|
1379
|
+
}, je = {
|
|
1380
|
+
write_a_message_placeholder: "Parašykite žinutę...",
|
|
1381
|
+
your_issue_has_been_resolved: "Jūsų problema išspręsta!",
|
|
1382
|
+
new_conversation: "Naujas pokalbis",
|
|
1383
|
+
welcome_screen_title: "Sveiki atvykę į mūsų pagalbos pokalbį",
|
|
1384
|
+
welcome_screen_description: "Mes čia, kad padėtume! Pradėkite pokalbį ir mes atsakysime kuo greičiau.",
|
|
1385
|
+
your_name_placeholder: "Jūsų vardas",
|
|
1386
|
+
your_email_placeholder: "Jūsų el. pašto adresas",
|
|
1387
|
+
start_chat_button: "Kalbėti su pagalba",
|
|
1388
|
+
start_chat_button_loading: "Jungiamasi...",
|
|
1389
|
+
i_need_more_help: "Man reikia daugiau pagalbos",
|
|
1390
|
+
this_was_helpful: "Tai buvo naudinga",
|
|
1391
|
+
optional: "Neprivaloma",
|
|
1392
|
+
no_conversations_yet: "Pokalbių dar nėra",
|
|
1393
|
+
back_to_conversations: "Grįžti į pokalbius",
|
|
1394
|
+
closed_conversations: "Uždaryti pokalbiai"
|
|
1395
|
+
}, Te = {
|
|
1396
|
+
write_a_message_placeholder: "Schreift eng Noriicht...",
|
|
1397
|
+
your_issue_has_been_resolved: "Äert Problem gouf geléist!",
|
|
1398
|
+
new_conversation: "Nei Konversatioun",
|
|
1399
|
+
welcome_screen_title: "Wëllkomm bei eisem Support-Chat",
|
|
1400
|
+
welcome_screen_description: "Mir sinn hei fir ze hëllefen! Start eng Konversatioun a mir äntweren Iech esou séier wéi méiglech.",
|
|
1401
|
+
your_name_placeholder: "Ären Numm",
|
|
1402
|
+
your_email_placeholder: "Är E-Mail-Adress",
|
|
1403
|
+
start_chat_button: "Mat dem Support schwätzen",
|
|
1404
|
+
start_chat_button_loading: "Verbindung...",
|
|
1405
|
+
i_need_more_help: "Ech brauch méi Hëllef",
|
|
1406
|
+
this_was_helpful: "Dat war hëllefräich",
|
|
1407
|
+
optional: "Fakultativ",
|
|
1408
|
+
no_conversations_yet: "Nach keng Konversatiounen",
|
|
1409
|
+
back_to_conversations: "Zréck zu de Konversatiounen",
|
|
1410
|
+
closed_conversations: "Zougemaachte Konversatiounen"
|
|
1411
|
+
}, Ae = {
|
|
1412
|
+
write_a_message_placeholder: "Ikteb messaġġ...",
|
|
1413
|
+
your_issue_has_been_resolved: "Il-problema tiegħek ġiet riżolta!",
|
|
1414
|
+
new_conversation: "Konversazzjoni ġdida",
|
|
1415
|
+
welcome_screen_title: "Merħba fis-support chat tagħna",
|
|
1416
|
+
welcome_screen_description: "Aħna hawn biex ngħinu! Ibda konversazzjoni u nirrispondu malajr kemm jista' jkun.",
|
|
1417
|
+
your_name_placeholder: "Ismek",
|
|
1418
|
+
your_email_placeholder: "L-indirizz tal-email tiegħek",
|
|
1419
|
+
start_chat_button: "Kellem lis-support",
|
|
1420
|
+
start_chat_button_loading: "Qed jikkonnettja...",
|
|
1421
|
+
i_need_more_help: "Għandi bżonn aktar għajnuna",
|
|
1422
|
+
this_was_helpful: "Dan kien ta' għajnuna",
|
|
1423
|
+
optional: "Mhux obbligatorju",
|
|
1424
|
+
no_conversations_yet: "Għad m'hemmx konversazzjonijiet",
|
|
1425
|
+
back_to_conversations: "Lura għall-konversazzjonijiet",
|
|
1426
|
+
closed_conversations: "Konversazzjonijiet magħluqa"
|
|
1427
|
+
}, Me = {
|
|
1428
|
+
write_a_message_placeholder: "Skriv en melding...",
|
|
1429
|
+
your_issue_has_been_resolved: "Saken din er løst!",
|
|
1430
|
+
new_conversation: "Ny samtale",
|
|
1431
|
+
welcome_screen_title: "Velkommen til vår kundestøtte",
|
|
1432
|
+
welcome_screen_description: "Vi er her for å hjelpe! Start en samtale, så svarer vi deg så snart som mulig.",
|
|
1433
|
+
your_name_placeholder: "Ditt navn",
|
|
1434
|
+
your_email_placeholder: "Din e-postadresse",
|
|
1435
|
+
start_chat_button: "Snakk med kundestøtte",
|
|
1436
|
+
start_chat_button_loading: "Kobler til...",
|
|
1437
|
+
i_need_more_help: "Jeg trenger mer hjelp",
|
|
1438
|
+
this_was_helpful: "Dette var nyttig",
|
|
1439
|
+
optional: "Valgfritt",
|
|
1440
|
+
no_conversations_yet: "Ingen samtaler ennå",
|
|
1441
|
+
back_to_conversations: "Tilbake til samtaler",
|
|
1442
|
+
closed_conversations: "Lukkede samtaler"
|
|
1443
|
+
}, Ee = {
|
|
1444
|
+
write_a_message_placeholder: "Napíšte správu...",
|
|
1445
|
+
your_issue_has_been_resolved: "Váš problém bol vyriešený!",
|
|
1446
|
+
new_conversation: "Nová konverzácia",
|
|
1447
|
+
welcome_screen_title: "Vitajte v našom zákazníckom chate",
|
|
1448
|
+
welcome_screen_description: "Sme tu, aby sme vám pomohli! Začnite konverzáciu a odpovieme vám čo najskôr.",
|
|
1449
|
+
your_name_placeholder: "Vaše meno",
|
|
1450
|
+
your_email_placeholder: "Vaša e-mailová adresa",
|
|
1451
|
+
start_chat_button: "Hovoriť s podporou",
|
|
1452
|
+
start_chat_button_loading: "Pripájanie...",
|
|
1453
|
+
i_need_more_help: "Potrebujem ďalšiu pomoc",
|
|
1454
|
+
this_was_helpful: "Toto bolo užitočné",
|
|
1455
|
+
optional: "Voliteľné",
|
|
1456
|
+
no_conversations_yet: "Zatiaľ žiadne konverzácie",
|
|
1457
|
+
back_to_conversations: "Späť na konverzácie",
|
|
1458
|
+
closed_conversations: "Uzavreté konverzácie"
|
|
1459
|
+
}, N = {
|
|
1300
1460
|
ar: W,
|
|
1301
1461
|
bn: Z,
|
|
1302
1462
|
bg: X,
|
|
@@ -1305,39 +1465,49 @@ const W = {
|
|
|
1305
1465
|
de: se,
|
|
1306
1466
|
el: te,
|
|
1307
1467
|
en: ae,
|
|
1308
|
-
es:
|
|
1468
|
+
es: oe,
|
|
1469
|
+
et: xe,
|
|
1309
1470
|
fi: ie,
|
|
1310
|
-
fil:
|
|
1471
|
+
fil: ne,
|
|
1311
1472
|
fr: re,
|
|
1312
1473
|
hi: le,
|
|
1474
|
+
hr: Ce,
|
|
1475
|
+
hu: ze,
|
|
1476
|
+
is: Ie,
|
|
1313
1477
|
it: ce,
|
|
1314
1478
|
ja: _e,
|
|
1315
1479
|
ko: he,
|
|
1480
|
+
lb: Te,
|
|
1481
|
+
lt: je,
|
|
1482
|
+
lv: Pe,
|
|
1483
|
+
mt: Ae,
|
|
1484
|
+
nb: Me,
|
|
1316
1485
|
nl: ue,
|
|
1317
1486
|
no: de,
|
|
1318
1487
|
pl: ge,
|
|
1319
1488
|
pt: me,
|
|
1320
1489
|
ro: pe,
|
|
1321
|
-
ru:
|
|
1490
|
+
ru: be,
|
|
1491
|
+
sk: Ee,
|
|
1322
1492
|
sv: ve,
|
|
1323
|
-
th:
|
|
1493
|
+
th: fe,
|
|
1324
1494
|
tr: we,
|
|
1325
1495
|
ur: ye,
|
|
1326
|
-
vi:
|
|
1496
|
+
vi: ke,
|
|
1327
1497
|
"zh-cn": Se
|
|
1328
|
-
},
|
|
1329
|
-
function
|
|
1330
|
-
return
|
|
1498
|
+
}, Le = Object.keys(N);
|
|
1499
|
+
function De(_) {
|
|
1500
|
+
return Le.includes(_);
|
|
1331
1501
|
}
|
|
1332
|
-
function
|
|
1502
|
+
function Ve(_, a, n) {
|
|
1333
1503
|
var r;
|
|
1334
|
-
return ((r =
|
|
1504
|
+
return ((r = n == null ? void 0 : n[a]) == null ? void 0 : r[_]) || N[a][_] || "";
|
|
1335
1505
|
}
|
|
1336
1506
|
export {
|
|
1337
1507
|
S as PrimitiveState,
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1508
|
+
M as WidgetCtx,
|
|
1509
|
+
Ve as getTranslation,
|
|
1510
|
+
B as isExhaustive,
|
|
1511
|
+
De as isSupportedLanguage
|
|
1342
1512
|
};
|
|
1343
1513
|
//# sourceMappingURL=index.js.map
|