@opencxh/domain 1.131.0 → 1.132.0
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/entities/activity/catalog.d.ts +123 -0
- package/dist/entities/activity/catalog.test.d.ts +1 -0
- package/dist/entities/activity/descriptor.d.ts +79 -0
- package/dist/entities/activity/descriptor.test.d.ts +1 -0
- package/dist/entities/activity/index.d.ts +3 -0
- package/dist/entities/activity/preview.d.ts +13 -2
- package/dist/entities/activity/resolve.d.ts +59 -0
- package/dist/entities/interaction/types.d.ts +19 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +752 -347
- package/dist/platform/sdk.d.ts +8 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,116 +1,504 @@
|
|
|
1
|
-
function
|
|
1
|
+
function $(e) {
|
|
2
2
|
return e.replace(/<style[\s\S]*?<\/style>/gi, " ").replace(/<script[\s\S]*?<\/script>/gi, " ").replace(/<[^>]+>/g, " ").replace(/ /g, " ").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/\s+/g, " ").trim();
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
const n = e.trim();
|
|
6
|
-
return n.length <= 140 ? n : n.slice(0, 139).trimEnd() + "…";
|
|
7
|
-
}
|
|
8
|
-
function c(e) {
|
|
4
|
+
function p(e) {
|
|
9
5
|
if (!e || e < 0) return "";
|
|
10
6
|
const n = Math.floor(e / 60), t = Math.floor(e % 60);
|
|
11
7
|
return `${n}:${t.toString().padStart(2, "0")}`;
|
|
12
8
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
function b(e) {
|
|
10
|
+
return e ? ` — ${Math.floor(e / 60)}m ${e % 60}s` : "";
|
|
11
|
+
}
|
|
12
|
+
function m(e) {
|
|
13
|
+
return e?.split("@")?.[0] || e || "";
|
|
14
|
+
}
|
|
15
|
+
function u(e) {
|
|
16
|
+
return e.map((n) => n.name).join(", ");
|
|
17
|
+
}
|
|
18
|
+
function A(e) {
|
|
19
|
+
return e === "meeting" ? "Meeting" : e === "video" ? "Video call" : "Audio call";
|
|
20
|
+
}
|
|
21
|
+
const s = {
|
|
22
|
+
/* ---- voice ---- */
|
|
23
|
+
VOICE_CALL_STARTED: {
|
|
24
|
+
shape: "event",
|
|
25
|
+
channelKind: "voice",
|
|
26
|
+
icon: "phone",
|
|
27
|
+
snippet: () => "Gesprek gestart",
|
|
28
|
+
timeline: (e) => e.direction === "inbound" ? `Inbound call started — ${m(e.payload.from)}` : `Outbound call started — ${m(e.payload.to)}`
|
|
29
|
+
},
|
|
30
|
+
VOICE_CALL_ANSWERED: {
|
|
31
|
+
shape: "event",
|
|
32
|
+
channelKind: "voice",
|
|
33
|
+
icon: "phone",
|
|
34
|
+
snippet: () => "Gesprek aangenomen",
|
|
35
|
+
timeline: (e, n) => `Call answered — ${n}`
|
|
36
|
+
},
|
|
37
|
+
VOICE_CALL_HOLD: {
|
|
38
|
+
shape: "event",
|
|
39
|
+
channelKind: "voice",
|
|
40
|
+
icon: "phone",
|
|
41
|
+
snippet: () => "In de wacht",
|
|
42
|
+
timeline: (e, n) => `Call on hold — ${n}`
|
|
43
|
+
},
|
|
44
|
+
VOICE_CALL_UNHOLD: {
|
|
45
|
+
shape: "event",
|
|
46
|
+
channelKind: "voice",
|
|
47
|
+
icon: "phone",
|
|
48
|
+
snippet: () => "Hervat"
|
|
49
|
+
},
|
|
50
|
+
VOICE_CALL_ENDED: {
|
|
51
|
+
shape: "event",
|
|
52
|
+
channelKind: "voice",
|
|
53
|
+
icon: "phone",
|
|
54
|
+
snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${p(e.payload.duration)})` : ""}`,
|
|
55
|
+
timeline: (e) => `Call ended${b(e.payload.duration)}`
|
|
56
|
+
},
|
|
57
|
+
VOICE_CALL_MISSED: {
|
|
58
|
+
shape: "event",
|
|
59
|
+
channelKind: "voice",
|
|
60
|
+
icon: "phone",
|
|
61
|
+
snippet: () => "Gemiste oproep",
|
|
62
|
+
timeline: (e) => `Missed call — ${m(e.payload.from)}`
|
|
63
|
+
},
|
|
64
|
+
VOICE_CALL_FAILED: {
|
|
65
|
+
shape: "event",
|
|
66
|
+
channelKind: "voice",
|
|
67
|
+
icon: "phone",
|
|
68
|
+
snippet: () => "Gesprek mislukt",
|
|
69
|
+
timeline: () => "Call failed"
|
|
70
|
+
},
|
|
71
|
+
VOICE_CALL_VOICEMAIL: {
|
|
72
|
+
shape: "artifact",
|
|
73
|
+
channelKind: "voice",
|
|
74
|
+
icon: "phone",
|
|
75
|
+
snippet: (e) => e.payload.transcription?.trim() ? e.payload.transcription : "Voicemail ontvangen"
|
|
76
|
+
},
|
|
77
|
+
/* ---- video ---- */
|
|
78
|
+
VIDEO_CALL_STARTED: {
|
|
79
|
+
shape: "event",
|
|
80
|
+
channelKind: "video",
|
|
81
|
+
icon: "video",
|
|
82
|
+
snippet: () => "Gesprek gestart",
|
|
83
|
+
timeline: () => "Video call started"
|
|
84
|
+
},
|
|
85
|
+
VIDEO_CALL_ANSWERED: {
|
|
86
|
+
shape: "event",
|
|
87
|
+
channelKind: "video",
|
|
88
|
+
icon: "video",
|
|
89
|
+
snippet: () => "Gesprek aangenomen",
|
|
90
|
+
timeline: () => "Video call answered"
|
|
91
|
+
},
|
|
92
|
+
VIDEO_CALL_HOLD: {
|
|
93
|
+
shape: "event",
|
|
94
|
+
channelKind: "video",
|
|
95
|
+
icon: "video",
|
|
96
|
+
snippet: () => "In de wacht"
|
|
97
|
+
},
|
|
98
|
+
VIDEO_CALL_UNHOLD: {
|
|
99
|
+
shape: "event",
|
|
100
|
+
channelKind: "video",
|
|
101
|
+
icon: "video",
|
|
102
|
+
snippet: () => "Hervat"
|
|
103
|
+
},
|
|
104
|
+
VIDEO_CALL_ENDED: {
|
|
105
|
+
shape: "event",
|
|
106
|
+
channelKind: "video",
|
|
107
|
+
icon: "video",
|
|
108
|
+
snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${p(e.payload.duration)})` : ""}`,
|
|
109
|
+
timeline: () => "Video call ended"
|
|
110
|
+
},
|
|
111
|
+
VIDEO_CALL_MISSED: {
|
|
112
|
+
shape: "event",
|
|
113
|
+
channelKind: "video",
|
|
114
|
+
icon: "video",
|
|
115
|
+
snippet: () => "Gemiste oproep",
|
|
116
|
+
timeline: () => "Missed video call"
|
|
117
|
+
},
|
|
118
|
+
VIDEO_CALL_FAILED: {
|
|
119
|
+
shape: "event",
|
|
120
|
+
channelKind: "video",
|
|
121
|
+
icon: "video",
|
|
122
|
+
snippet: () => "Gesprek mislukt",
|
|
123
|
+
timeline: () => "Video call failed"
|
|
124
|
+
},
|
|
125
|
+
/* ---- mail ---- */
|
|
126
|
+
EMAIL_RECEIVED: {
|
|
127
|
+
shape: "message",
|
|
128
|
+
triggerable: !0,
|
|
129
|
+
displayNameKey: "communication:activity.EMAIL_RECEIVED",
|
|
130
|
+
component: "communication:EmailActivity",
|
|
131
|
+
channelKind: "mail",
|
|
132
|
+
icon: "mail",
|
|
133
|
+
replyable: !0,
|
|
134
|
+
carriesText: !0,
|
|
135
|
+
countsAs: "inbound_message",
|
|
136
|
+
snippet: I
|
|
137
|
+
},
|
|
138
|
+
EMAIL_SENT: {
|
|
139
|
+
shape: "message",
|
|
140
|
+
component: "communication:EmailActivity",
|
|
141
|
+
channelKind: "mail",
|
|
142
|
+
icon: "mail",
|
|
143
|
+
replyable: !0,
|
|
144
|
+
carriesText: !0,
|
|
145
|
+
countsAs: "outbound_message",
|
|
146
|
+
snippet: I
|
|
147
|
+
},
|
|
148
|
+
/* ---- chat ---- */
|
|
149
|
+
CHAT_MESSAGE_SENT: {
|
|
150
|
+
shape: "message",
|
|
151
|
+
component: "communication:ChatMessage",
|
|
152
|
+
channelKind: "chat",
|
|
153
|
+
icon: "message-circle",
|
|
154
|
+
replyable: !0,
|
|
155
|
+
carriesText: !0,
|
|
156
|
+
countsAs: "outbound_message",
|
|
157
|
+
snippet: (e) => e.payload.text ?? ""
|
|
158
|
+
},
|
|
159
|
+
CHAT_MESSAGE_RECEIVED: {
|
|
160
|
+
shape: "message",
|
|
161
|
+
triggerable: !0,
|
|
162
|
+
displayNameKey: "communication:activity.CHAT_MESSAGE_RECEIVED",
|
|
163
|
+
component: "communication:ChatMessage",
|
|
164
|
+
channelKind: "chat",
|
|
165
|
+
icon: "message-circle",
|
|
166
|
+
replyable: !0,
|
|
167
|
+
carriesText: !0,
|
|
168
|
+
countsAs: "inbound_message",
|
|
169
|
+
snippet: (e) => e.payload.text ?? ""
|
|
170
|
+
},
|
|
171
|
+
CHAT_MEMBER_JOINED: {
|
|
172
|
+
shape: "event",
|
|
173
|
+
channelKind: "chat",
|
|
174
|
+
icon: "message-circle",
|
|
175
|
+
snippet: (e) => `${u(e.payload.members)} toegevoegd`,
|
|
176
|
+
timeline: (e) => {
|
|
177
|
+
const n = u(e.payload.members) || "Someone", t = e.payload.initiator?.name ? ` · added by ${e.payload.initiator.name}` : "";
|
|
178
|
+
return `${n} joined the chat${t}`;
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
CHAT_MEMBER_LEFT: {
|
|
182
|
+
shape: "event",
|
|
183
|
+
channelKind: "chat",
|
|
184
|
+
icon: "message-circle",
|
|
185
|
+
snippet: (e) => `${u(e.payload.members)} verlaten`,
|
|
186
|
+
timeline: (e) => {
|
|
187
|
+
const n = u(e.payload.members) || "Someone", t = e.payload.initiator?.name ? ` · removed by ${e.payload.initiator.name}` : "";
|
|
188
|
+
return `${n} left the chat${t}`;
|
|
19
189
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
190
|
+
},
|
|
191
|
+
CHAT_RENAMED: {
|
|
192
|
+
shape: "event",
|
|
193
|
+
channelKind: "chat",
|
|
194
|
+
icon: "message-circle",
|
|
195
|
+
snippet: (e) => `Hernoemd naar "${e.payload.newName}"`,
|
|
196
|
+
timeline: (e) => `Chat renamed to "${e.payload.newName}"${e.payload.initiator ? ` by ${e.payload.initiator.name}` : ""}`
|
|
197
|
+
},
|
|
198
|
+
CHAT_CALL_STARTED: {
|
|
199
|
+
shape: "event",
|
|
200
|
+
channelKind: "chat",
|
|
201
|
+
icon: "message-circle",
|
|
202
|
+
snippet: () => "Gesprek gestart",
|
|
203
|
+
timeline: (e) => `${A(e.payload.callType)} started${e.payload.initiator ? ` by ${e.payload.initiator.name}` : ""}`,
|
|
204
|
+
joinUrl: (e) => e.payload.joinUrl
|
|
205
|
+
},
|
|
206
|
+
CHAT_CALL_ENDED: {
|
|
207
|
+
shape: "event",
|
|
208
|
+
channelKind: "chat",
|
|
209
|
+
icon: "message-circle",
|
|
210
|
+
snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${p(e.payload.duration)})` : ""}`,
|
|
211
|
+
timeline: (e) => `${A(e.payload.callType)} ended${b(e.payload.duration)}`,
|
|
212
|
+
joinUrl: (e) => e.payload.joinUrl
|
|
213
|
+
},
|
|
214
|
+
CHAT_EVENT: {
|
|
215
|
+
shape: "event",
|
|
216
|
+
channelKind: "chat",
|
|
217
|
+
icon: "message-circle",
|
|
218
|
+
snippet: (e) => e.payload.text ?? e.payload.eventType,
|
|
219
|
+
timeline: (e) => e.payload.text || e.payload.eventType
|
|
220
|
+
},
|
|
221
|
+
/* ---- inhoud ---- */
|
|
222
|
+
TRANSCRIPT_ADDED: {
|
|
223
|
+
shape: "artifact",
|
|
224
|
+
triggerable: !0,
|
|
225
|
+
displayNameKey: "communication:activity.TRANSCRIPT_ADDED",
|
|
226
|
+
component: "communication:TranscriptionActivity",
|
|
227
|
+
icon: "captions",
|
|
228
|
+
carriesText: !0,
|
|
229
|
+
snippet: (e) => (e.payload.segments ?? []).map((n) => n.text).join(" ")
|
|
230
|
+
},
|
|
231
|
+
COMMENT_ADDED: {
|
|
232
|
+
shape: "note",
|
|
233
|
+
component: "communication:CommentActivity",
|
|
234
|
+
icon: "sticky-note",
|
|
235
|
+
carriesText: !0,
|
|
236
|
+
snippet: (e) => e.payload.text ?? ""
|
|
237
|
+
},
|
|
238
|
+
FILE_UPLOADED: {
|
|
239
|
+
shape: "artifact",
|
|
240
|
+
component: "communication:FileActivity",
|
|
241
|
+
icon: "paperclip",
|
|
242
|
+
snippet: (e) => `Bestand: ${e.payload.fileName}`
|
|
243
|
+
},
|
|
244
|
+
/* ---- AI & playbooks ---- */
|
|
245
|
+
AI_MESSAGE_ADDED: {
|
|
246
|
+
shape: "event",
|
|
247
|
+
triggerable: !0,
|
|
248
|
+
displayNameKey: "communication:activity.AI_MESSAGE_ADDED",
|
|
249
|
+
icon: "circle",
|
|
250
|
+
snippet: (e) => e.payload.output?.text ?? e.payload.input?.text ?? "",
|
|
251
|
+
timeline: () => "AI message added"
|
|
252
|
+
},
|
|
253
|
+
AI_ACTION_PROPOSED: {
|
|
254
|
+
shape: "event",
|
|
255
|
+
component: "communication:ProposedActionCard",
|
|
256
|
+
icon: "circle",
|
|
257
|
+
playbookAuthored: !0,
|
|
258
|
+
snippet: (e) => `Voorstel wacht op goedkeuring (${e.payload.actions?.length ?? 0} actie(s))`
|
|
259
|
+
},
|
|
260
|
+
PLAYBOOK_STARTED: {
|
|
261
|
+
shape: "event",
|
|
262
|
+
icon: "circle",
|
|
263
|
+
playbookAuthored: !0,
|
|
264
|
+
snippet: (e) => `Playbook gestart${e.payload.playbookName ? `: ${e.payload.playbookName}` : ""}`,
|
|
265
|
+
timeline: (e) => `Playbook gestart${e.payload.playbookName ? ` — ${e.payload.playbookName}` : ""}`
|
|
266
|
+
},
|
|
267
|
+
PLAYBOOK_COMPLETED: {
|
|
268
|
+
shape: "event",
|
|
269
|
+
icon: "circle",
|
|
270
|
+
playbookAuthored: !0,
|
|
271
|
+
snippet: () => "Playbook afgerond",
|
|
272
|
+
timeline: () => "Playbook afgerond"
|
|
273
|
+
},
|
|
274
|
+
PLAYBOOK_ESCALATED: {
|
|
275
|
+
shape: "event",
|
|
276
|
+
icon: "circle",
|
|
277
|
+
playbookAuthored: !0,
|
|
278
|
+
snippet: () => "Playbook geëscaleerd naar een mens",
|
|
279
|
+
timeline: () => "Playbook geëscaleerd naar een mens"
|
|
280
|
+
},
|
|
281
|
+
/* ---- meetings ---- */
|
|
282
|
+
MEETING_SCHEDULED: {
|
|
283
|
+
shape: "event",
|
|
284
|
+
icon: "calendar",
|
|
285
|
+
snippet: (e) => `Vergadering gepland: ${e.payload.title}`,
|
|
286
|
+
timeline: () => "Meeting scheduled",
|
|
287
|
+
joinUrl: (e) => e.payload.joinUrl
|
|
288
|
+
},
|
|
289
|
+
MEETING_STARTED: {
|
|
290
|
+
shape: "event",
|
|
291
|
+
icon: "calendar",
|
|
292
|
+
snippet: (e) => `Vergadering gestart: ${e.payload.title}`,
|
|
293
|
+
timeline: () => "Meeting started",
|
|
294
|
+
joinUrl: (e) => e.payload.joinUrl
|
|
295
|
+
},
|
|
296
|
+
MEETING_ENDED: {
|
|
297
|
+
shape: "event",
|
|
298
|
+
icon: "calendar",
|
|
299
|
+
snippet: (e) => `Vergadering beëindigd${e.payload.duration ? ` (${p(e.payload.duration)})` : ""}`,
|
|
300
|
+
timeline: () => "Meeting ended"
|
|
301
|
+
},
|
|
302
|
+
MEETING_PARTICIPANT_JOINED: {
|
|
303
|
+
shape: "event",
|
|
304
|
+
icon: "calendar",
|
|
305
|
+
snippet: (e) => `${e.payload.name} deelgenomen`,
|
|
306
|
+
timeline: (e, n) => `${n} joined the meeting`
|
|
307
|
+
},
|
|
308
|
+
MEETING_PARTICIPANT_LEFT: {
|
|
309
|
+
shape: "event",
|
|
310
|
+
icon: "calendar",
|
|
311
|
+
snippet: (e) => `${e.payload.name} verlaten`,
|
|
312
|
+
timeline: (e, n) => `${n} left the meeting`
|
|
313
|
+
},
|
|
314
|
+
/* ---- interactie-levenscyclus ---- */
|
|
315
|
+
INTERACTION_CREATED: {
|
|
316
|
+
shape: "event",
|
|
317
|
+
icon: "circle",
|
|
318
|
+
snippet: () => "Interactie aangemaakt",
|
|
319
|
+
timeline: (e, n) => `Interaction started by ${n}`
|
|
320
|
+
},
|
|
321
|
+
INTERACTION_STATUS_CHANGED: {
|
|
322
|
+
shape: "event",
|
|
323
|
+
triggerable: !0,
|
|
324
|
+
displayNameKey: "communication:activity.INTERACTION_STATUS_CHANGED",
|
|
325
|
+
icon: "circle-dot",
|
|
326
|
+
snippet: (e) => `Status: ${e.payload.fromStatus} → ${e.payload.toStatus}`,
|
|
327
|
+
timeline: (e, n) => `Status changed to ${e.payload.toStatus} by ${n}`
|
|
328
|
+
},
|
|
329
|
+
INTERACTION_ASSIGNED: {
|
|
330
|
+
shape: "event",
|
|
331
|
+
icon: "user",
|
|
332
|
+
snippet: () => "Interactie toegewezen",
|
|
333
|
+
timeline: (e, n) => `Assigned by ${n}`
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
function I(e) {
|
|
337
|
+
const n = e.payload, t = n.bodySnippet?.trim() || $(n.body ?? "");
|
|
338
|
+
return n.subject ? `${n.subject} — ${t}` : t;
|
|
339
|
+
}
|
|
340
|
+
function l(e) {
|
|
341
|
+
return s[e];
|
|
342
|
+
}
|
|
343
|
+
function Ae(e) {
|
|
344
|
+
return l(e)?.icon ?? "circle";
|
|
345
|
+
}
|
|
346
|
+
function Ie(e) {
|
|
347
|
+
return l(e)?.channelKind;
|
|
348
|
+
}
|
|
349
|
+
function _e(e) {
|
|
350
|
+
const n = l(e)?.shape;
|
|
351
|
+
return n === "message" || n === "note";
|
|
352
|
+
}
|
|
353
|
+
function Te(e) {
|
|
354
|
+
return l(e)?.replyable === !0;
|
|
355
|
+
}
|
|
356
|
+
function Me(e) {
|
|
357
|
+
return l(e)?.carriesText === !0;
|
|
358
|
+
}
|
|
359
|
+
function Se(e) {
|
|
360
|
+
return l(e)?.countsAs;
|
|
361
|
+
}
|
|
362
|
+
function ve(e) {
|
|
363
|
+
return l(e)?.playbookAuthored === !0;
|
|
364
|
+
}
|
|
365
|
+
function x(e) {
|
|
366
|
+
const n = l(e.type)?.snippet;
|
|
367
|
+
return n ? n(e) : "";
|
|
368
|
+
}
|
|
369
|
+
function Ce(e, n) {
|
|
370
|
+
const t = l(e.type)?.timeline;
|
|
371
|
+
return t ? t(e, n) : e.type.replace(/_/g, " ").toLowerCase();
|
|
372
|
+
}
|
|
373
|
+
function De(e) {
|
|
374
|
+
const n = l(e.type)?.joinUrl;
|
|
375
|
+
return n ? n(e) : void 0;
|
|
376
|
+
}
|
|
377
|
+
function g(e, n) {
|
|
378
|
+
let t = e;
|
|
379
|
+
for (const i of n.split(".")) {
|
|
380
|
+
if (t == null || typeof t != "object") return "";
|
|
381
|
+
t = t[i];
|
|
92
382
|
}
|
|
383
|
+
return t == null ? "" : typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : "";
|
|
93
384
|
}
|
|
94
|
-
function
|
|
385
|
+
function h(e, n, t) {
|
|
386
|
+
if (e === void 0) return null;
|
|
387
|
+
if (typeof e == "string") return e || null;
|
|
388
|
+
if ("value" in e)
|
|
389
|
+
return g(n, e.value) || null;
|
|
390
|
+
const i = {};
|
|
391
|
+
for (const [r, o] of Object.entries(e.params ?? {}))
|
|
392
|
+
i[r] = g(n, o);
|
|
393
|
+
const a = t(e.key, i);
|
|
394
|
+
return a === e.key ? null : a;
|
|
395
|
+
}
|
|
396
|
+
function U(e, n) {
|
|
397
|
+
if (!e || typeof e == "string" || "value" in e) return null;
|
|
398
|
+
const t = {};
|
|
399
|
+
for (const [i, a] of Object.entries(e.params ?? {}))
|
|
400
|
+
t[i] = g(n, a);
|
|
401
|
+
return { key: e.key, params: t };
|
|
402
|
+
}
|
|
403
|
+
const P = (e) => e;
|
|
404
|
+
function _(e) {
|
|
405
|
+
const n = s[e];
|
|
406
|
+
return {
|
|
407
|
+
type: e,
|
|
408
|
+
shape: n.shape,
|
|
409
|
+
channelKind: n.channelKind,
|
|
410
|
+
icon: n.icon,
|
|
411
|
+
replyable: n.replyable === !0,
|
|
412
|
+
countsAs: n.countsAs,
|
|
413
|
+
carriesText: n.carriesText === !0,
|
|
414
|
+
triggerable: n.triggerable === !0,
|
|
415
|
+
component: n.component,
|
|
416
|
+
builtIn: !0,
|
|
417
|
+
displayNameKey: n.displayNameKey
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
function T(e) {
|
|
421
|
+
return {
|
|
422
|
+
type: e.type,
|
|
423
|
+
shape: e.shape,
|
|
424
|
+
channelKind: e.channelKind,
|
|
425
|
+
icon: e.icon || "circle",
|
|
426
|
+
replyable: e.replyable === !0,
|
|
427
|
+
countsAs: e.countsAs,
|
|
428
|
+
carriesText: e.carriesText === !0,
|
|
429
|
+
triggerable: e.triggerable === !0,
|
|
430
|
+
component: e.component,
|
|
431
|
+
builtIn: !1,
|
|
432
|
+
displayNameKey: e.displayNameKey
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
class K {
|
|
436
|
+
constructor(n = [], t = P) {
|
|
437
|
+
this.translate = t;
|
|
438
|
+
for (const i of n)
|
|
439
|
+
i?.type && (i.type in s || this.declared.has(i.type) || this.declared.set(i.type, i));
|
|
440
|
+
}
|
|
441
|
+
declared = /* @__PURE__ */ new Map();
|
|
442
|
+
get(n) {
|
|
443
|
+
if (n in s) return _(n);
|
|
444
|
+
const t = this.declared.get(n);
|
|
445
|
+
return t ? T(t) : void 0;
|
|
446
|
+
}
|
|
447
|
+
/** Alles wat als trigger aangeboden mag worden, ingebouwd en gedeclareerd. */
|
|
448
|
+
triggerable() {
|
|
449
|
+
const n = Object.keys(s).filter((i) => s[i].triggerable).map(_), t = [...this.declared.values()].map(T).filter((i) => i.triggerable);
|
|
450
|
+
return [...n, ...t];
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* De tijdlijnregel. Ingebouwd komt uit de catalogus, gedeclareerd uit `text` + de
|
|
454
|
+
* meegeleverde vertaling. Zonder bruikbare tekst valt het terug op de ontstreepte
|
|
455
|
+
* typenaam — dezelfde regel die de feed altijd al toonde voor onbekende types.
|
|
456
|
+
*/
|
|
457
|
+
timelineText(n, t) {
|
|
458
|
+
const i = s[n.type];
|
|
459
|
+
if (i?.timeline) return i.timeline(n, t);
|
|
460
|
+
const a = this.declared.get(n.type);
|
|
461
|
+
return h(a?.text, n, this.translate) ?? n.type.replace(/_/g, " ").toLowerCase();
|
|
462
|
+
}
|
|
463
|
+
/** De regel voor de inboxlijst. Leeg wanneer het type niets te tonen heeft. */
|
|
464
|
+
snippet(n) {
|
|
465
|
+
const t = s[n.type];
|
|
466
|
+
if (t?.snippet) return t.snippet(n);
|
|
467
|
+
const i = this.declared.get(n.type);
|
|
468
|
+
return h(i?.text, n, this.translate) ?? "";
|
|
469
|
+
}
|
|
470
|
+
/** De descriptor zoals hij binnenkwam; nodig om `text` als sleutel op te slaan. */
|
|
471
|
+
descriptor(n) {
|
|
472
|
+
return this.declared.get(n);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
const Ne = new K(), M = 140;
|
|
476
|
+
function G(e) {
|
|
477
|
+
const n = e.trim();
|
|
478
|
+
return n.length <= M ? n : n.slice(0, M - 1).trimEnd() + "…";
|
|
479
|
+
}
|
|
480
|
+
function Oe(e, n) {
|
|
481
|
+
const t = U(n?.text, e), i = n ? h(n.text, e, (a) => a) : null;
|
|
95
482
|
return {
|
|
96
483
|
activityId: e.id,
|
|
97
484
|
type: e.type,
|
|
98
|
-
snippet:
|
|
485
|
+
snippet: G(i ?? x(e)),
|
|
99
486
|
authorName: e.author?.name ?? "",
|
|
100
487
|
direction: e.direction,
|
|
101
|
-
createdAt: e.createdAt ?? Date.now()
|
|
488
|
+
createdAt: e.createdAt ?? Date.now(),
|
|
489
|
+
...t ? { snippetKey: t.key, snippetParams: t.params } : {}
|
|
102
490
|
};
|
|
103
491
|
}
|
|
104
|
-
function
|
|
105
|
-
const
|
|
106
|
-
if (!
|
|
492
|
+
function Le(e, n, t = []) {
|
|
493
|
+
const i = e.createdAt;
|
|
494
|
+
if (!i) return [];
|
|
107
495
|
const a = new Set(t);
|
|
108
|
-
return e.author.type === "user" && e.author.id && a.add(e.author.id), Object.entries(n).filter(([
|
|
496
|
+
return e.author.type === "user" && e.author.id && a.add(e.author.id), Object.entries(n).filter(([r, o]) => o >= i && !a.has(r)).map(([r]) => r);
|
|
109
497
|
}
|
|
110
|
-
function
|
|
498
|
+
function ke(e) {
|
|
111
499
|
return e.createdAt ?? 0;
|
|
112
500
|
}
|
|
113
|
-
const
|
|
501
|
+
const Re = [
|
|
114
502
|
{ id: "agent", label: "Agent", labelSource: "user" },
|
|
115
503
|
{ id: "team", label: "Team", labelSource: "team" },
|
|
116
504
|
{ id: "inbox", label: "Inbox", labelSource: "inbox" },
|
|
@@ -120,57 +508,57 @@ const le = [
|
|
|
120
508
|
{ id: "handledBy", label: "Afhandelaar", labelSource: "raw" },
|
|
121
509
|
{ id: "time", label: "Tijd", labelSource: "raw" }
|
|
122
510
|
];
|
|
123
|
-
function
|
|
511
|
+
function $e(e) {
|
|
124
512
|
const n = [];
|
|
125
513
|
for (const t of Object.keys(e))
|
|
126
|
-
for (const
|
|
127
|
-
n.push({ lang: t, key:
|
|
514
|
+
for (const i of Object.keys(e[t]))
|
|
515
|
+
n.push({ lang: t, key: i, value: e[t][i] });
|
|
128
516
|
return n;
|
|
129
517
|
}
|
|
130
|
-
function
|
|
518
|
+
function f(e) {
|
|
131
519
|
return e < 10 ? `0${e}` : `${e}`;
|
|
132
520
|
}
|
|
133
|
-
function
|
|
134
|
-
const t = new Date(e),
|
|
135
|
-
return n === "day" ?
|
|
521
|
+
function w(e, n) {
|
|
522
|
+
const t = new Date(e), i = `${t.getUTCFullYear()}-${f(t.getUTCMonth() + 1)}-${f(t.getUTCDate())}`;
|
|
523
|
+
return n === "day" ? i : `${i}T${f(t.getUTCHours())}`;
|
|
136
524
|
}
|
|
137
|
-
function
|
|
525
|
+
function V(e, n) {
|
|
138
526
|
const t = new Date(e);
|
|
139
527
|
return t.setUTCMinutes(0, 0, 0), n === "day" && t.setUTCHours(0), t.getTime();
|
|
140
528
|
}
|
|
141
|
-
const
|
|
142
|
-
function
|
|
143
|
-
const
|
|
144
|
-
for (let
|
|
145
|
-
a.push(
|
|
529
|
+
const H = 36e5, j = 864e5;
|
|
530
|
+
function xe(e, n, t) {
|
|
531
|
+
const i = t === "hour" ? H : j, a = [];
|
|
532
|
+
for (let r = V(e, t); r <= n; r += i)
|
|
533
|
+
a.push(w(r, t));
|
|
146
534
|
return a;
|
|
147
535
|
}
|
|
148
|
-
const
|
|
536
|
+
const B = [
|
|
149
537
|
{ id: "resource", label: "Resource", labelSource: "raw" },
|
|
150
538
|
{ id: "origin", label: "Herkomst", labelSource: "raw" }
|
|
151
|
-
],
|
|
152
|
-
function
|
|
539
|
+
], F = B.map((e) => e.id);
|
|
540
|
+
function W(e, n) {
|
|
153
541
|
return `${e}.usage.${n}`;
|
|
154
542
|
}
|
|
155
|
-
function
|
|
543
|
+
function Ue(e, n) {
|
|
156
544
|
return n.map((t) => ({
|
|
157
|
-
id:
|
|
545
|
+
id: W(e, t.unit),
|
|
158
546
|
label: t.label,
|
|
159
547
|
category: "Verbruik",
|
|
160
548
|
valueType: t.valueType ?? "count",
|
|
161
549
|
aggregation: "sum",
|
|
162
550
|
supportedDimensions: [
|
|
163
551
|
"provider",
|
|
164
|
-
...
|
|
552
|
+
...F,
|
|
165
553
|
...t.extraDimensions ?? [],
|
|
166
554
|
"time"
|
|
167
555
|
]
|
|
168
556
|
}));
|
|
169
557
|
}
|
|
170
|
-
function
|
|
558
|
+
function Pe(e) {
|
|
171
559
|
return (e.startsWith("tool:") ? e.slice(5) : e).replace(/__/g, " · ").replace(/\./g, " · ").replace(/_/g, " ");
|
|
172
560
|
}
|
|
173
|
-
const
|
|
561
|
+
const Ke = [
|
|
174
562
|
{ name: "text", type: "string" },
|
|
175
563
|
{ name: "subject", type: "string" },
|
|
176
564
|
{ name: "from", type: "string" },
|
|
@@ -193,7 +581,7 @@ const fe = [
|
|
|
193
581
|
// een nieuw adres) — een stap die hierop leunt hoort dus een `condition` te hebben.
|
|
194
582
|
{ name: "contactId", type: "string" },
|
|
195
583
|
{ name: "companyId", type: "string" }
|
|
196
|
-
],
|
|
584
|
+
], Ge = {
|
|
197
585
|
topics: [
|
|
198
586
|
{ name: "topic", type: "string" },
|
|
199
587
|
{ name: "confidence", type: "number" }
|
|
@@ -204,7 +592,7 @@ const fe = [
|
|
|
204
592
|
],
|
|
205
593
|
extract: []
|
|
206
594
|
};
|
|
207
|
-
function
|
|
595
|
+
function Y(e) {
|
|
208
596
|
switch (e.kind) {
|
|
209
597
|
case "user":
|
|
210
598
|
return `user:${e.userId}`;
|
|
@@ -214,22 +602,22 @@ function k(e) {
|
|
|
214
602
|
return "org";
|
|
215
603
|
}
|
|
216
604
|
}
|
|
217
|
-
function
|
|
605
|
+
function we(e) {
|
|
218
606
|
if (typeof e != "string") return;
|
|
219
607
|
const n = e.trim();
|
|
220
608
|
if (n === "org") return { kind: "org" };
|
|
221
609
|
const t = n.indexOf(":");
|
|
222
610
|
if (t <= 0) return;
|
|
223
|
-
const
|
|
611
|
+
const i = n.slice(0, t), a = n.slice(t + 1).trim();
|
|
224
612
|
if (a) {
|
|
225
|
-
if (
|
|
226
|
-
if (
|
|
613
|
+
if (i === "user") return { kind: "user", userId: a };
|
|
614
|
+
if (i === "team") return { kind: "team", teamId: a };
|
|
227
615
|
}
|
|
228
616
|
}
|
|
229
|
-
function
|
|
230
|
-
return
|
|
617
|
+
function z(e) {
|
|
618
|
+
return Y(e);
|
|
231
619
|
}
|
|
232
|
-
function
|
|
620
|
+
function Ve(e) {
|
|
233
621
|
switch (e.kind) {
|
|
234
622
|
case "personal":
|
|
235
623
|
return { kind: "user", userId: e.userId };
|
|
@@ -239,20 +627,20 @@ function me(e) {
|
|
|
239
627
|
return { kind: "org" };
|
|
240
628
|
}
|
|
241
629
|
}
|
|
242
|
-
function
|
|
243
|
-
return
|
|
630
|
+
function He(e) {
|
|
631
|
+
return z(e);
|
|
244
632
|
}
|
|
245
|
-
const
|
|
246
|
-
function
|
|
247
|
-
return
|
|
633
|
+
const q = ["done", "escalated", "failed", "timed_out", "stopped"], X = ["awaiting_approval", "awaiting_reply"];
|
|
634
|
+
function J(e) {
|
|
635
|
+
return q.includes(e);
|
|
248
636
|
}
|
|
249
|
-
function
|
|
250
|
-
return
|
|
637
|
+
function je(e) {
|
|
638
|
+
return J(e);
|
|
251
639
|
}
|
|
252
|
-
function
|
|
253
|
-
return
|
|
640
|
+
function Be(e) {
|
|
641
|
+
return X.includes(e);
|
|
254
642
|
}
|
|
255
|
-
const
|
|
643
|
+
const k = [
|
|
256
644
|
{
|
|
257
645
|
id: "openai",
|
|
258
646
|
label: "OpenAI",
|
|
@@ -340,53 +728,53 @@ const _ = [
|
|
|
340
728
|
defaultModel: "default"
|
|
341
729
|
}
|
|
342
730
|
];
|
|
343
|
-
function
|
|
344
|
-
return
|
|
731
|
+
function E(e) {
|
|
732
|
+
return k.find((n) => n.id === e);
|
|
345
733
|
}
|
|
346
|
-
function
|
|
347
|
-
return
|
|
734
|
+
function Fe(e) {
|
|
735
|
+
return E(e)?.label ?? e;
|
|
348
736
|
}
|
|
349
|
-
function
|
|
350
|
-
return
|
|
737
|
+
function We(e, n = "gpt-5-mini") {
|
|
738
|
+
return E(e)?.defaultModel ?? n;
|
|
351
739
|
}
|
|
352
|
-
function
|
|
353
|
-
return
|
|
740
|
+
function Ye(e) {
|
|
741
|
+
return k.filter((n) => n.capabilities.includes(e));
|
|
354
742
|
}
|
|
355
|
-
function
|
|
356
|
-
const n =
|
|
743
|
+
function ze(e) {
|
|
744
|
+
const n = E(e);
|
|
357
745
|
return !!n && !n.baseUrl;
|
|
358
746
|
}
|
|
359
|
-
const
|
|
360
|
-
function
|
|
747
|
+
const qe = /* @__PURE__ */ new Set(["mail", "message"]);
|
|
748
|
+
function Q(e, n) {
|
|
361
749
|
const t = e.settings?.signatures?.[n];
|
|
362
750
|
return !t || !t.enabled || !t.body || t.body.trim() === "" ? null : t;
|
|
363
751
|
}
|
|
364
|
-
function
|
|
752
|
+
function Xe(e, n, t, i = "html") {
|
|
365
753
|
if (!e) return t;
|
|
366
|
-
const a =
|
|
367
|
-
return a ? `${t}${
|
|
754
|
+
const a = Q(e, n);
|
|
755
|
+
return a ? `${t}${i === "text" ? `
|
|
368
756
|
|
|
369
757
|
` : n === "mail" ? "<br><br>-- <br>" : "<br><br>"}${a.body}` : t;
|
|
370
758
|
}
|
|
371
|
-
function
|
|
759
|
+
function Je(e) {
|
|
372
760
|
return e.endpoints ?? [];
|
|
373
761
|
}
|
|
374
|
-
const
|
|
762
|
+
const Qe = (e) => !!e.assignedUserId || !!e.assignedInboxId, Ze = (e) => e.status === "closed", en = (e) => ({
|
|
375
763
|
urgent: 10,
|
|
376
764
|
high: 5,
|
|
377
765
|
normal: 2,
|
|
378
766
|
low: 1
|
|
379
|
-
})[e.priority] || 0,
|
|
380
|
-
function
|
|
767
|
+
})[e.priority] || 0, nn = (e, n = 30) => e.title?.length <= n ? e.title : `${e.title.substring(0, n)}...`;
|
|
768
|
+
function tn(e, n) {
|
|
381
769
|
return e.lastActivityAt ? !(e.seenBy ?? []).includes(n) : !1;
|
|
382
770
|
}
|
|
383
|
-
const
|
|
384
|
-
function
|
|
771
|
+
const an = 2e3, rn = 500, on = 12e3, ln = 4e3, Z = ["contact", "company"];
|
|
772
|
+
function sn(e) {
|
|
385
773
|
if (!e) return !1;
|
|
386
774
|
const n = e.slice(0, e.indexOf(":"));
|
|
387
|
-
return
|
|
775
|
+
return Z.includes(n);
|
|
388
776
|
}
|
|
389
|
-
const
|
|
777
|
+
const y = {
|
|
390
778
|
// The lower bounds are deliberately generous: service ranges (0800/0900) are
|
|
391
779
|
// shorter than geographic numbers, and a too-strict minimum silently drops them.
|
|
392
780
|
// An over-permissive key is harmless — it simply matches nothing.
|
|
@@ -409,81 +797,81 @@ const p = {
|
|
|
409
797
|
PL: { callingCode: "48", nsnMin: 9, nsnMax: 9 },
|
|
410
798
|
US: { callingCode: "1", nsnMin: 10, nsnMax: 10 },
|
|
411
799
|
CA: { callingCode: "1", nsnMin: 10, nsnMax: 10 }
|
|
412
|
-
},
|
|
413
|
-
new Set(Object.values(
|
|
800
|
+
}, ee = "NL", ne = 15, te = 8, ie = Array.from(
|
|
801
|
+
new Set(Object.values(y).map((e) => e.callingCode))
|
|
414
802
|
).sort((e, n) => n.length - e.length);
|
|
415
|
-
function
|
|
803
|
+
function S(e) {
|
|
416
804
|
if (e)
|
|
417
|
-
return
|
|
805
|
+
return y[e.trim().toUpperCase()];
|
|
418
806
|
}
|
|
419
|
-
function
|
|
807
|
+
function d(e, n) {
|
|
420
808
|
return e.length >= n.nsnMin && e.length <= n.nsnMax;
|
|
421
809
|
}
|
|
422
|
-
function
|
|
423
|
-
if (e.length >
|
|
424
|
-
for (const n of
|
|
810
|
+
function v(e) {
|
|
811
|
+
if (e.length > ne) return null;
|
|
812
|
+
for (const n of ie) {
|
|
425
813
|
if (!e.startsWith(n)) continue;
|
|
426
814
|
const t = e.slice(n.length);
|
|
427
|
-
for (const
|
|
428
|
-
if (
|
|
429
|
-
const a =
|
|
430
|
-
if (
|
|
815
|
+
for (const i of Object.values(y)) {
|
|
816
|
+
if (i.callingCode !== n) continue;
|
|
817
|
+
const a = i.trunkPrefix, r = a && t.startsWith(a) ? t.slice(a.length) : t;
|
|
818
|
+
if (d(r, i)) return `+${n}${r}`;
|
|
431
819
|
}
|
|
432
820
|
return null;
|
|
433
821
|
}
|
|
434
|
-
return e.length <
|
|
822
|
+
return e.length < te ? null : `+${e}`;
|
|
435
823
|
}
|
|
436
|
-
function
|
|
824
|
+
function ae(e) {
|
|
437
825
|
let n = e.trim();
|
|
438
826
|
const t = n.match(/^(sips?|tel|whatsapp):/i);
|
|
439
827
|
t && (n = n.slice(t[0].length));
|
|
440
|
-
const
|
|
441
|
-
return
|
|
828
|
+
const i = n.indexOf("@");
|
|
829
|
+
return i >= 0 && (n = n.slice(0, i)), n.trim();
|
|
442
830
|
}
|
|
443
|
-
function
|
|
831
|
+
function cn(e) {
|
|
444
832
|
if (!e) return !1;
|
|
445
833
|
const n = e.indexOf("@");
|
|
446
834
|
if (n <= 0) return !1;
|
|
447
835
|
const t = e.slice(0, n).trim();
|
|
448
836
|
return !/^[+\d\s().-]+$/.test(t);
|
|
449
837
|
}
|
|
450
|
-
function
|
|
838
|
+
function C(e, n) {
|
|
451
839
|
if (!e) return null;
|
|
452
|
-
const t =
|
|
840
|
+
const t = ae(e);
|
|
453
841
|
if (!t) return null;
|
|
454
|
-
const
|
|
842
|
+
const i = t.startsWith("+"), a = t.replace(/\D/g, "");
|
|
455
843
|
if (!a) return null;
|
|
456
|
-
if (
|
|
457
|
-
if (a.startsWith("00")) return
|
|
458
|
-
const
|
|
459
|
-
if (!
|
|
460
|
-
const
|
|
461
|
-
if (
|
|
462
|
-
const
|
|
463
|
-
return
|
|
844
|
+
if (i) return v(a);
|
|
845
|
+
if (a.startsWith("00")) return v(a.slice(2));
|
|
846
|
+
const r = S(n) ?? S(ee);
|
|
847
|
+
if (!r) return null;
|
|
848
|
+
const o = r.trunkPrefix;
|
|
849
|
+
if (o && a.startsWith(o)) {
|
|
850
|
+
const c = a.slice(o.length);
|
|
851
|
+
return d(c, r) ? `+${r.callingCode}${c}` : null;
|
|
464
852
|
}
|
|
465
|
-
if (a.startsWith(
|
|
466
|
-
const
|
|
467
|
-
if (
|
|
853
|
+
if (a.startsWith(r.callingCode)) {
|
|
854
|
+
const c = a.slice(r.callingCode.length);
|
|
855
|
+
if (d(c, r)) return `+${r.callingCode}${c}`;
|
|
468
856
|
}
|
|
469
|
-
return !
|
|
857
|
+
return !o && d(a, r) ? `+${r.callingCode}${a}` : null;
|
|
470
858
|
}
|
|
471
|
-
function
|
|
859
|
+
function pn(e, n = 9) {
|
|
472
860
|
const t = (e ?? "").replace(/\D/g, "");
|
|
473
861
|
return t.length < n ? null : t.slice(-n);
|
|
474
862
|
}
|
|
475
|
-
function
|
|
863
|
+
function R(e) {
|
|
476
864
|
if (!e) return null;
|
|
477
865
|
const n = e.trim().toLowerCase(), t = n.lastIndexOf("@");
|
|
478
866
|
if (t <= 0 || t === n.length - 1) return null;
|
|
479
|
-
const
|
|
480
|
-
return !
|
|
867
|
+
const i = n.slice(0, t).split("+")[0], a = n.slice(t + 1);
|
|
868
|
+
return !i || !a.includes(".") ? null : `${i}@${a}`;
|
|
481
869
|
}
|
|
482
|
-
function
|
|
483
|
-
const n =
|
|
870
|
+
function un(e) {
|
|
871
|
+
const n = R(e);
|
|
484
872
|
return n ? n.slice(n.lastIndexOf("@") + 1) : null;
|
|
485
873
|
}
|
|
486
|
-
const
|
|
874
|
+
const re = /* @__PURE__ */ new Set([
|
|
487
875
|
"co.uk",
|
|
488
876
|
"org.uk",
|
|
489
877
|
"gov.uk",
|
|
@@ -493,14 +881,14 @@ const W = /* @__PURE__ */ new Set([
|
|
|
493
881
|
"com.br",
|
|
494
882
|
"co.za"
|
|
495
883
|
]);
|
|
496
|
-
function
|
|
884
|
+
function oe(e) {
|
|
497
885
|
if (!e) return null;
|
|
498
886
|
const n = e.trim().toLowerCase().replace(/\.$/, "").split(".").filter(Boolean);
|
|
499
887
|
if (n.length < 2) return null;
|
|
500
888
|
const t = n.slice(-2).join(".");
|
|
501
|
-
return
|
|
889
|
+
return re.has(t) && n.length >= 3 ? n.slice(-3).join(".") : t;
|
|
502
890
|
}
|
|
503
|
-
const
|
|
891
|
+
const le = /* @__PURE__ */ new Set([
|
|
504
892
|
"gmail.com",
|
|
505
893
|
"googlemail.com",
|
|
506
894
|
"outlook.com",
|
|
@@ -545,34 +933,34 @@ const K = /* @__PURE__ */ new Set([
|
|
|
545
933
|
"proximus.be",
|
|
546
934
|
"scarlet.be"
|
|
547
935
|
]);
|
|
548
|
-
function
|
|
549
|
-
const n =
|
|
550
|
-
return n ?
|
|
936
|
+
function dn(e) {
|
|
937
|
+
const n = oe(e);
|
|
938
|
+
return n ? le.has(n) : !1;
|
|
551
939
|
}
|
|
552
|
-
function
|
|
940
|
+
function mn(e) {
|
|
553
941
|
if (!e) return !1;
|
|
554
942
|
const n = e.trim().toLowerCase();
|
|
555
943
|
return n === "tel" || n === "sms" || n === "whatsapp" || n === "fax";
|
|
556
944
|
}
|
|
557
|
-
function
|
|
945
|
+
function fn(e, n, t) {
|
|
558
946
|
if (!e || !n) return null;
|
|
559
|
-
const
|
|
560
|
-
if (
|
|
561
|
-
const
|
|
562
|
-
return
|
|
947
|
+
const i = e.trim().toLowerCase();
|
|
948
|
+
if (i === "tel" || i === "sms" || i === "whatsapp") {
|
|
949
|
+
const r = C(n, t);
|
|
950
|
+
return r ? `tel:${r}` : null;
|
|
563
951
|
}
|
|
564
|
-
if (
|
|
565
|
-
const
|
|
566
|
-
return
|
|
952
|
+
if (i === "fax") {
|
|
953
|
+
const r = C(n, t);
|
|
954
|
+
return r ? `fax:${r}` : null;
|
|
567
955
|
}
|
|
568
|
-
if (
|
|
569
|
-
const
|
|
570
|
-
return
|
|
956
|
+
if (i === "mailto" || i === "email") {
|
|
957
|
+
const r = R(n);
|
|
958
|
+
return r ? `mailto:${r}` : null;
|
|
571
959
|
}
|
|
572
960
|
const a = n.trim().toLowerCase();
|
|
573
|
-
return a ? `${
|
|
961
|
+
return a ? `${i}:${a}` : null;
|
|
574
962
|
}
|
|
575
|
-
const
|
|
963
|
+
const se = [
|
|
576
964
|
/<blockquote/i,
|
|
577
965
|
/class="?gmail_quote/i,
|
|
578
966
|
// Gmail quote container
|
|
@@ -585,107 +973,107 @@ const Y = [
|
|
|
585
973
|
// Outlook underscore separator before "From:"
|
|
586
974
|
/\bOn\b[\s\S]{0,200}?\bwrote:/i
|
|
587
975
|
// Gmail "On <date> <name> wrote:"
|
|
588
|
-
],
|
|
589
|
-
function
|
|
976
|
+
], D = /^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i, ce = /^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;
|
|
977
|
+
function pe(e) {
|
|
590
978
|
const n = e.split(`
|
|
591
979
|
`);
|
|
592
980
|
for (let t = 0; t < n.length; t++)
|
|
593
|
-
if (
|
|
981
|
+
if (ce.test(n[t]) || D.test(n[t]) && n.slice(t + 1, t + 4).some((i) => D.test(i)))
|
|
594
982
|
return n.slice(0, t).join(`
|
|
595
983
|
`).trim();
|
|
596
984
|
return e;
|
|
597
985
|
}
|
|
598
|
-
function
|
|
986
|
+
function N(e) {
|
|
599
987
|
let n = e;
|
|
600
988
|
return n = n.replace(/<(script|style)[\s\S]*?<\/\1>/gi, ""), n = n.replace(/<br\s*\/?>/gi, `
|
|
601
989
|
`), n = n.replace(/<\/(p|div|li|tr|h[1-6]|ul|ol|table)>/gi, `
|
|
602
990
|
`), n = n.replace(/<[^>]+>/g, ""), n = n.replace(/<[^>]*$/, ""), n;
|
|
603
991
|
}
|
|
604
|
-
function
|
|
992
|
+
function O(e) {
|
|
605
993
|
return e.replace(/ /gi, " ").replace(/</gi, "<").replace(/>/gi, ">").replace(/"/gi, '"').replace(/'/gi, "'").replace(/&#(\d+);/g, (n, t) => String.fromCharCode(Number(t))).replace(/&/gi, "&");
|
|
606
994
|
}
|
|
607
|
-
function
|
|
995
|
+
function L(e) {
|
|
608
996
|
return e.replace(/\r/g, "").replace(/[ \t]+/g, " ").replace(/ *\n */g, `
|
|
609
997
|
`).replace(/\n{3,}/g, `
|
|
610
998
|
|
|
611
999
|
`).trim();
|
|
612
1000
|
}
|
|
613
|
-
function
|
|
1001
|
+
function gn(e) {
|
|
614
1002
|
if (typeof e != "string" || !e) return "";
|
|
615
1003
|
let n = e.length;
|
|
616
|
-
for (const
|
|
617
|
-
const
|
|
618
|
-
|
|
1004
|
+
for (const r of se) {
|
|
1005
|
+
const o = e.search(r);
|
|
1006
|
+
o >= 0 && o < n && (n = o);
|
|
619
1007
|
}
|
|
620
1008
|
const t = e.slice(0, n);
|
|
621
|
-
let
|
|
622
|
-
return
|
|
1009
|
+
let i = L(O(N(t)));
|
|
1010
|
+
return i || (i = L(O(N(e)))), pe(i) || i;
|
|
623
1011
|
}
|
|
624
|
-
const
|
|
625
|
-
function
|
|
626
|
-
return !!(e &&
|
|
1012
|
+
const ue = /(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i, de = /\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;
|
|
1013
|
+
function hn(e, n) {
|
|
1014
|
+
return !!(e && ue.test(e) || n && de.test(n));
|
|
627
1015
|
}
|
|
628
|
-
const
|
|
629
|
-
function
|
|
630
|
-
return e >=
|
|
1016
|
+
const me = 3, fe = 600;
|
|
1017
|
+
function En(e, n) {
|
|
1018
|
+
return e >= me || n >= fe;
|
|
631
1019
|
}
|
|
632
|
-
function
|
|
633
|
-
const t = new Set(e.disabledIntents ?? []),
|
|
1020
|
+
function ge(e, n) {
|
|
1021
|
+
const t = new Set(e.disabledIntents ?? []), i = e.intentOverrides ?? {}, a = n.intents.filter((o) => !t.has(o.intent)).map((o) => Ee(o, i[o.intent]));
|
|
634
1022
|
if (!e.extraIntents || e.extraIntents.length === 0) return a;
|
|
635
|
-
const
|
|
636
|
-
for (const
|
|
637
|
-
|
|
1023
|
+
const r = new Set(a.map((o) => o.intent));
|
|
1024
|
+
for (const o of e.extraIntents)
|
|
1025
|
+
r.has(o.intent) || (a.push(o), r.add(o.intent));
|
|
638
1026
|
return a;
|
|
639
1027
|
}
|
|
640
|
-
function
|
|
1028
|
+
function he(e, n) {
|
|
641
1029
|
const t = {};
|
|
642
|
-
for (const
|
|
643
|
-
if (!
|
|
644
|
-
const a = n?.[
|
|
645
|
-
t[
|
|
1030
|
+
for (const i of e.intents) {
|
|
1031
|
+
if (!i.togglable) continue;
|
|
1032
|
+
const a = n?.[i.intent];
|
|
1033
|
+
t[i.intent] = a ?? i.defaultEnabled ?? !0;
|
|
646
1034
|
}
|
|
647
1035
|
return t;
|
|
648
1036
|
}
|
|
649
|
-
function
|
|
650
|
-
const t =
|
|
651
|
-
return Object.entries(t).filter(([,
|
|
1037
|
+
function yn(e, n) {
|
|
1038
|
+
const t = he(e, n);
|
|
1039
|
+
return Object.entries(t).filter(([, i]) => !i).map(([i]) => i);
|
|
652
1040
|
}
|
|
653
|
-
function
|
|
1041
|
+
function Ee(e, n) {
|
|
654
1042
|
return n ? {
|
|
655
1043
|
intent: n.intent ?? e.intent,
|
|
656
1044
|
targetSchemes: n.targetSchemes ?? e.targetSchemes,
|
|
657
1045
|
transport: n.transport ?? e.transport
|
|
658
1046
|
} : e;
|
|
659
1047
|
}
|
|
660
|
-
function
|
|
1048
|
+
function bn(e, n) {
|
|
661
1049
|
const t = [];
|
|
662
|
-
for (const
|
|
663
|
-
if (!
|
|
664
|
-
const a = n[
|
|
1050
|
+
for (const i of e) {
|
|
1051
|
+
if (!i.enabled) continue;
|
|
1052
|
+
const a = n[i.providerId];
|
|
665
1053
|
if (a)
|
|
666
|
-
for (const
|
|
667
|
-
t.push({ channel:
|
|
1054
|
+
for (const r of ge(i, a))
|
|
1055
|
+
t.push({ channel: i, description: a, capability: r });
|
|
668
1056
|
}
|
|
669
1057
|
return t;
|
|
670
1058
|
}
|
|
671
|
-
function
|
|
1059
|
+
function An(e, n) {
|
|
672
1060
|
return n.filter((t) => t.capability.intent === e);
|
|
673
1061
|
}
|
|
674
|
-
function
|
|
1062
|
+
function ye(e, n) {
|
|
675
1063
|
return n.filter((t) => t.capability.targetSchemes.includes(e));
|
|
676
1064
|
}
|
|
677
|
-
function
|
|
678
|
-
return
|
|
1065
|
+
function In(e, n) {
|
|
1066
|
+
return ye(e.scheme, n);
|
|
679
1067
|
}
|
|
680
|
-
function
|
|
681
|
-
const
|
|
1068
|
+
function _n(e, n, t) {
|
|
1069
|
+
const i = [];
|
|
682
1070
|
for (const a of e)
|
|
683
|
-
for (const
|
|
684
|
-
|
|
685
|
-
return
|
|
1071
|
+
for (const r of t)
|
|
1072
|
+
r.capability.intent === n && r.capability.targetSchemes.includes(a.scheme) && i.push({ channelIntent: r, endpoint: a });
|
|
1073
|
+
return i;
|
|
686
1074
|
}
|
|
687
|
-
var
|
|
688
|
-
const
|
|
1075
|
+
var be = /* @__PURE__ */ ((e) => (e.MAILTO = "mailto", e.SIP = "sip", e.TEL = "tel", e.WEBHOOK = "webhook", e.USERNAME = "username", e.ID = "id", e.CUSTOM = "custom", e.URL = "url", e.TELEGRAM = "telegram", e.WHATSAPP = "whatsapp", e.MESSENGER = "messenger", e.INSTAGRAM = "instagram", e.VIBER = "viber", e.SMS = "sms", e.FAX = "fax", e.TEAMS = "teams", e.CALENDAR = "calendar", e))(be || {});
|
|
1076
|
+
const Tn = "message_window", Mn = "message_templates", Sn = {
|
|
689
1077
|
// E-mail
|
|
690
1078
|
FROM: "from",
|
|
691
1079
|
TO: "to",
|
|
@@ -702,88 +1090,105 @@ const Je = "message_window", Qe = "message_templates", Ze = {
|
|
|
702
1090
|
// Voice/conference
|
|
703
1091
|
HOST: "host",
|
|
704
1092
|
PARTICIPANT: "participant"
|
|
705
|
-
},
|
|
1093
|
+
}, vn = (e, n) => ({ intent: e, ...n }), Cn = "folder_management", Dn = "remote_search", Nn = { ok: !1, code: "UNSUPPORTED", message: "Provider does not support this op" }, On = 9e4, Ln = "installation-id";
|
|
706
1094
|
export {
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
fe as
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
1095
|
+
s as ACTIVITY_CATALOG,
|
|
1096
|
+
k as AI_VENDORS,
|
|
1097
|
+
K as ActivityTypeRegistry,
|
|
1098
|
+
Ne as BUILT_IN_ONLY,
|
|
1099
|
+
Ge as CLASSIFY_VARS,
|
|
1100
|
+
Re as CORE_DIMENSIONS,
|
|
1101
|
+
be as CommunicationScheme,
|
|
1102
|
+
ln as DEFAULT_MEMORY_BUDGET,
|
|
1103
|
+
ee as DEFAULT_PHONE_REGION,
|
|
1104
|
+
Cn as FEATURE_FOLDER_MANAGEMENT,
|
|
1105
|
+
Dn as FEATURE_REMOTE_SEARCH,
|
|
1106
|
+
Ln as INSTALLATION_HEADER,
|
|
1107
|
+
Sn as InteractionParticipantRole,
|
|
1108
|
+
on as MAX_MEMORY_BUDGET,
|
|
1109
|
+
an as MAX_MEMORY_CHARS,
|
|
1110
|
+
rn as MIN_MEMORY_BUDGET,
|
|
1111
|
+
X as PAUSED_RUN_STATUSES,
|
|
1112
|
+
y as PHONE_REGIONS,
|
|
1113
|
+
On as PRESENCE_ONLINE_WINDOW_MS,
|
|
1114
|
+
Mn as PROVIDER_FEATURE_MESSAGE_TEMPLATES,
|
|
1115
|
+
Tn as PROVIDER_FEATURE_MESSAGE_WINDOW,
|
|
1116
|
+
le as PUBLIC_EMAIL_DOMAINS,
|
|
1117
|
+
Z as RELATED_SUBJECT_KINDS,
|
|
1118
|
+
qe as SIGNATURE_INTENTS,
|
|
1119
|
+
fe as SUMMARY_MIN_LAST_CHARS,
|
|
1120
|
+
me as SUMMARY_MIN_MESSAGES,
|
|
1121
|
+
q as TERMINAL_RUN_STATUSES,
|
|
1122
|
+
Ke as TRIGGER_VARS,
|
|
1123
|
+
Nn as UNSUPPORTED,
|
|
1124
|
+
B as USAGE_DIMENSIONS,
|
|
1125
|
+
F as USAGE_DIMENSION_IDS,
|
|
1126
|
+
z as actingIdentityKey,
|
|
1127
|
+
Ae as activityIconOf,
|
|
1128
|
+
De as activityJoinUrl,
|
|
1129
|
+
x as activitySnippet,
|
|
1130
|
+
U as activityTextParams,
|
|
1131
|
+
Ce as activityTimelineText,
|
|
1132
|
+
ke as activityTimestamp,
|
|
1133
|
+
l as activityTypeInfo,
|
|
1134
|
+
He as actorKey,
|
|
1135
|
+
We as aiVendorDefaultModel,
|
|
1136
|
+
Fe as aiVendorLabel,
|
|
1137
|
+
ze as aiVendorNeedsBaseUrl,
|
|
1138
|
+
Ye as aiVendorsWith,
|
|
1139
|
+
Xe as applySignature,
|
|
1140
|
+
Oe as buildActivityPreview,
|
|
1141
|
+
bn as buildChannelIntents,
|
|
1142
|
+
Me as carriesText,
|
|
1143
|
+
Ie as channelKindOf,
|
|
1144
|
+
gn as cleanMessageText,
|
|
1145
|
+
vn as defineIntent,
|
|
1146
|
+
yn as disabledIntentsFromCapabilities,
|
|
1147
|
+
un as emailDomain,
|
|
1148
|
+
fn as endpointKey,
|
|
1149
|
+
In as filterByEndpoint,
|
|
1150
|
+
An as filterByIntent,
|
|
1151
|
+
ye as filterByTargetScheme,
|
|
1152
|
+
E as findAiVendor,
|
|
1153
|
+
$e as flattenLocales,
|
|
1154
|
+
V as floorToPeriod,
|
|
1155
|
+
Y as formatActingIdentity,
|
|
1156
|
+
w as formatPeriod,
|
|
1157
|
+
Le as getActivitySeenUserIds,
|
|
1158
|
+
Je as getContactEndpoints,
|
|
1159
|
+
nn as getShortTitle,
|
|
1160
|
+
en as getUrgencyScore,
|
|
1161
|
+
Pe as humanizeAction,
|
|
1162
|
+
Qe as isAssigned,
|
|
1163
|
+
Ze as isClosed,
|
|
1164
|
+
tn as isInteractionUnseen,
|
|
1165
|
+
hn as isLikelyBulk,
|
|
1166
|
+
_e as isMessageType,
|
|
1167
|
+
Be as isPaused,
|
|
1168
|
+
ve as isPlaybookAuthoredType,
|
|
1169
|
+
dn as isPublicEmailDomain,
|
|
1170
|
+
Te as isReplyableType,
|
|
1171
|
+
je as isRetryable,
|
|
1172
|
+
J as isTerminal,
|
|
1173
|
+
En as isThreadLongEnough,
|
|
1174
|
+
cn as looksLikeEmail,
|
|
1175
|
+
_n as matchContactToIntents,
|
|
1176
|
+
Se as messageCountsAs,
|
|
1177
|
+
mn as needsPhoneRegion,
|
|
1178
|
+
R as normalizeEmail,
|
|
1179
|
+
we as parseActingIdentity,
|
|
1180
|
+
xe as periodsInRange,
|
|
1181
|
+
pn as phoneSuffix,
|
|
1182
|
+
Ve as playbookActor,
|
|
1183
|
+
g as readPath,
|
|
1184
|
+
oe as registrableDomain,
|
|
1185
|
+
sn as relatedByDefault,
|
|
1186
|
+
he as resolveAccountCapabilities,
|
|
1187
|
+
h as resolveActivityText,
|
|
1188
|
+
ge as resolveChannelIntents,
|
|
1189
|
+
Q as resolveSignature,
|
|
1190
|
+
$ as stripHtml,
|
|
1191
|
+
C as toE164,
|
|
1192
|
+
W as usageMetricId,
|
|
1193
|
+
Ue as usageMetrics
|
|
789
1194
|
};
|