@opencxh/domain 1.136.0 → 1.141.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/artifact/blocks.d.ts +168 -0
- package/dist/entities/artifact/blocks.test.d.ts +1 -0
- package/dist/entities/artifact/index.d.ts +3 -0
- package/dist/entities/artifact/markdown.d.ts +7 -0
- package/dist/entities/artifact/markdown.test.d.ts +1 -0
- package/dist/entities/artifact/types.d.ts +128 -0
- package/dist/index.cjs +14 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.js +757 -417
- package/dist/platform/ai-tools.d.ts +25 -0
- package/dist/platform/routing.d.ts +25 -0
- package/dist/platform/routing.test.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ut = 10, pt = 10, dt = 10, mt = 5, re = /* @__PURE__ */ new Set([
|
|
2
2
|
"header",
|
|
3
3
|
"section",
|
|
4
4
|
"context",
|
|
@@ -8,95 +8,95 @@ const De = 10, Le = 10, xe = 10, $e = 5, P = /* @__PURE__ */ new Set([
|
|
|
8
8
|
"actions",
|
|
9
9
|
"attachments"
|
|
10
10
|
]);
|
|
11
|
-
function
|
|
11
|
+
function T(e) {
|
|
12
12
|
if (typeof e == "string") return e.length > 0;
|
|
13
13
|
if (!e || typeof e != "object") return !1;
|
|
14
14
|
const t = e;
|
|
15
15
|
return typeof t.key == "string" || typeof t.value == "string";
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function ft(e, t = () => {
|
|
18
18
|
}) {
|
|
19
19
|
if (!Array.isArray(e)) return [];
|
|
20
20
|
const n = [];
|
|
21
|
-
for (const
|
|
21
|
+
for (const a of e) {
|
|
22
22
|
if (n.length >= 10) {
|
|
23
23
|
t("more than 10 blocks; the rest was dropped");
|
|
24
24
|
break;
|
|
25
25
|
}
|
|
26
|
-
if (!
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
29
|
-
t("unknown block type " + String(
|
|
26
|
+
if (!a || typeof a != "object") continue;
|
|
27
|
+
const i = a;
|
|
28
|
+
if (!re.has(i.type)) {
|
|
29
|
+
t("unknown block type " + String(i.type));
|
|
30
30
|
continue;
|
|
31
31
|
}
|
|
32
|
-
switch (
|
|
32
|
+
switch (i.type) {
|
|
33
33
|
case "header":
|
|
34
|
-
if (!
|
|
34
|
+
if (!T(i.text)) {
|
|
35
35
|
t("a header without text");
|
|
36
36
|
continue;
|
|
37
37
|
}
|
|
38
38
|
break;
|
|
39
39
|
case "context":
|
|
40
|
-
if (!
|
|
40
|
+
if (!T(i.text)) {
|
|
41
41
|
t("a context block without text");
|
|
42
42
|
continue;
|
|
43
43
|
}
|
|
44
44
|
break;
|
|
45
45
|
case "image":
|
|
46
|
-
if (!
|
|
46
|
+
if (!i.url || !i.alt) {
|
|
47
47
|
t("an image without url or alt");
|
|
48
48
|
continue;
|
|
49
49
|
}
|
|
50
50
|
break;
|
|
51
51
|
case "section":
|
|
52
|
-
Array.isArray(
|
|
52
|
+
Array.isArray(i.fields) && i.fields.length > 10 && (t("more than 10 fields in a section"), i.fields = i.fields.slice(0, 10));
|
|
53
53
|
break;
|
|
54
54
|
case "list":
|
|
55
|
-
if (!Array.isArray(
|
|
55
|
+
if (!Array.isArray(i.items) || i.items.length === 0) {
|
|
56
56
|
t("a list without items");
|
|
57
57
|
continue;
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
i.items.length > 10 && (t("more than 10 list items"), i.items = i.items.slice(0, 10));
|
|
60
60
|
break;
|
|
61
61
|
case "actions": {
|
|
62
|
-
const r = Array.isArray(
|
|
62
|
+
const r = Array.isArray(i.elements) ? i.elements : [], o = r.filter((s) => s && s.action_id && s.invoke && T(s.text));
|
|
63
63
|
if (o.length !== r.length && t("an action without action_id, invoke or text"), o.length === 0) continue;
|
|
64
|
-
o.length > 5 && t("more than 5 actions"),
|
|
64
|
+
o.length > 5 && t("more than 5 actions"), i.elements = o.slice(0, 5);
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
n.push(
|
|
68
|
+
n.push(i);
|
|
69
69
|
}
|
|
70
70
|
return n;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function oe(e) {
|
|
73
73
|
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();
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function y(e) {
|
|
76
76
|
if (!e || e < 0) return "";
|
|
77
77
|
const t = Math.floor(e / 60), n = Math.floor(e % 60);
|
|
78
78
|
return `${t}:${n.toString().padStart(2, "0")}`;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function k(e) {
|
|
81
81
|
return e ? ` — ${Math.floor(e / 60)}m ${e % 60}s` : "";
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function I(e) {
|
|
84
84
|
return e?.split("@")?.[0] || e || "";
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function A(e) {
|
|
87
87
|
return e.map((t) => t.name).join(", ");
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function x(e) {
|
|
90
90
|
return e === "meeting" ? "Meeting" : e === "video" ? "Video call" : "Audio call";
|
|
91
91
|
}
|
|
92
|
-
const
|
|
92
|
+
const f = {
|
|
93
93
|
/* ---- voice ---- */
|
|
94
94
|
VOICE_CALL_STARTED: {
|
|
95
95
|
shape: "event",
|
|
96
96
|
channelKind: "voice",
|
|
97
97
|
icon: "phone",
|
|
98
98
|
snippet: () => "Gesprek gestart",
|
|
99
|
-
timeline: (e) => e.direction === "inbound" ? `Inbound call started — ${
|
|
99
|
+
timeline: (e) => e.direction === "inbound" ? `Inbound call started — ${I(e.payload.from)}` : `Outbound call started — ${I(e.payload.to)}`
|
|
100
100
|
},
|
|
101
101
|
VOICE_CALL_ANSWERED: {
|
|
102
102
|
shape: "event",
|
|
@@ -122,15 +122,15 @@ const c = {
|
|
|
122
122
|
shape: "event",
|
|
123
123
|
channelKind: "voice",
|
|
124
124
|
icon: "phone",
|
|
125
|
-
snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${
|
|
126
|
-
timeline: (e) => `Call ended${
|
|
125
|
+
snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${y(e.payload.duration)})` : ""}`,
|
|
126
|
+
timeline: (e) => `Call ended${k(e.payload.duration)}`
|
|
127
127
|
},
|
|
128
128
|
VOICE_CALL_MISSED: {
|
|
129
129
|
shape: "event",
|
|
130
130
|
channelKind: "voice",
|
|
131
131
|
icon: "phone",
|
|
132
132
|
snippet: () => "Gemiste oproep",
|
|
133
|
-
timeline: (e) => `Missed call — ${
|
|
133
|
+
timeline: (e) => `Missed call — ${I(e.payload.from)}`
|
|
134
134
|
},
|
|
135
135
|
VOICE_CALL_FAILED: {
|
|
136
136
|
shape: "event",
|
|
@@ -176,7 +176,7 @@ const c = {
|
|
|
176
176
|
shape: "event",
|
|
177
177
|
channelKind: "video",
|
|
178
178
|
icon: "video",
|
|
179
|
-
snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${
|
|
179
|
+
snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${y(e.payload.duration)})` : ""}`,
|
|
180
180
|
timeline: () => "Video call ended"
|
|
181
181
|
},
|
|
182
182
|
VIDEO_CALL_MISSED: {
|
|
@@ -204,7 +204,7 @@ const c = {
|
|
|
204
204
|
replyable: !0,
|
|
205
205
|
carriesText: !0,
|
|
206
206
|
countsAs: "inbound_message",
|
|
207
|
-
snippet:
|
|
207
|
+
snippet: O
|
|
208
208
|
},
|
|
209
209
|
EMAIL_SENT: {
|
|
210
210
|
shape: "message",
|
|
@@ -214,7 +214,7 @@ const c = {
|
|
|
214
214
|
replyable: !0,
|
|
215
215
|
carriesText: !0,
|
|
216
216
|
countsAs: "outbound_message",
|
|
217
|
-
snippet:
|
|
217
|
+
snippet: O
|
|
218
218
|
},
|
|
219
219
|
/* ---- chat ---- */
|
|
220
220
|
CHAT_MESSAGE_SENT: {
|
|
@@ -243,9 +243,9 @@ const c = {
|
|
|
243
243
|
shape: "event",
|
|
244
244
|
channelKind: "chat",
|
|
245
245
|
icon: "message-circle",
|
|
246
|
-
snippet: (e) => `${
|
|
246
|
+
snippet: (e) => `${A(e.payload.members)} toegevoegd`,
|
|
247
247
|
timeline: (e) => {
|
|
248
|
-
const t =
|
|
248
|
+
const t = A(e.payload.members) || "Someone", n = e.payload.initiator?.name ? ` · added by ${e.payload.initiator.name}` : "";
|
|
249
249
|
return `${t} joined the chat${n}`;
|
|
250
250
|
}
|
|
251
251
|
},
|
|
@@ -253,9 +253,9 @@ const c = {
|
|
|
253
253
|
shape: "event",
|
|
254
254
|
channelKind: "chat",
|
|
255
255
|
icon: "message-circle",
|
|
256
|
-
snippet: (e) => `${
|
|
256
|
+
snippet: (e) => `${A(e.payload.members)} verlaten`,
|
|
257
257
|
timeline: (e) => {
|
|
258
|
-
const t =
|
|
258
|
+
const t = A(e.payload.members) || "Someone", n = e.payload.initiator?.name ? ` · removed by ${e.payload.initiator.name}` : "";
|
|
259
259
|
return `${t} left the chat${n}`;
|
|
260
260
|
}
|
|
261
261
|
},
|
|
@@ -271,15 +271,15 @@ const c = {
|
|
|
271
271
|
channelKind: "chat",
|
|
272
272
|
icon: "message-circle",
|
|
273
273
|
snippet: () => "Gesprek gestart",
|
|
274
|
-
timeline: (e) => `${
|
|
274
|
+
timeline: (e) => `${x(e.payload.callType)} started${e.payload.initiator ? ` by ${e.payload.initiator.name}` : ""}`,
|
|
275
275
|
joinUrl: (e) => e.payload.joinUrl
|
|
276
276
|
},
|
|
277
277
|
CHAT_CALL_ENDED: {
|
|
278
278
|
shape: "event",
|
|
279
279
|
channelKind: "chat",
|
|
280
280
|
icon: "message-circle",
|
|
281
|
-
snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${
|
|
282
|
-
timeline: (e) => `${
|
|
281
|
+
snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${y(e.payload.duration)})` : ""}`,
|
|
282
|
+
timeline: (e) => `${x(e.payload.callType)} ended${k(e.payload.duration)}`,
|
|
283
283
|
joinUrl: (e) => e.payload.joinUrl
|
|
284
284
|
},
|
|
285
285
|
CHAT_EVENT: {
|
|
@@ -367,7 +367,7 @@ const c = {
|
|
|
367
367
|
MEETING_ENDED: {
|
|
368
368
|
shape: "event",
|
|
369
369
|
icon: "calendar",
|
|
370
|
-
snippet: (e) => `Vergadering beëindigd${e.payload.duration ? ` (${
|
|
370
|
+
snippet: (e) => `Vergadering beëindigd${e.payload.duration ? ` (${y(e.payload.duration)})` : ""}`,
|
|
371
371
|
timeline: () => "Meeting ended"
|
|
372
372
|
},
|
|
373
373
|
MEETING_PARTICIPANT_JOINED: {
|
|
@@ -404,76 +404,76 @@ const c = {
|
|
|
404
404
|
timeline: (e, t) => `Assigned by ${t}`
|
|
405
405
|
}
|
|
406
406
|
};
|
|
407
|
-
function
|
|
408
|
-
const t = e.payload, n = t.bodySnippet?.trim() ||
|
|
407
|
+
function O(e) {
|
|
408
|
+
const t = e.payload, n = t.bodySnippet?.trim() || oe(t.body ?? "");
|
|
409
409
|
return t.subject ? `${t.subject} — ${n}` : n;
|
|
410
410
|
}
|
|
411
|
-
function
|
|
412
|
-
return
|
|
411
|
+
function d(e) {
|
|
412
|
+
return f[e];
|
|
413
413
|
}
|
|
414
|
-
function
|
|
415
|
-
return
|
|
414
|
+
function gt(e) {
|
|
415
|
+
return d(e)?.icon ?? "circle";
|
|
416
416
|
}
|
|
417
|
-
function
|
|
418
|
-
return
|
|
417
|
+
function ht(e) {
|
|
418
|
+
return d(e)?.channelKind;
|
|
419
419
|
}
|
|
420
|
-
function
|
|
421
|
-
const t =
|
|
420
|
+
function yt(e) {
|
|
421
|
+
const t = d(e)?.shape;
|
|
422
422
|
return t === "message" || t === "note";
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
return
|
|
424
|
+
function At(e) {
|
|
425
|
+
return d(e)?.replyable === !0;
|
|
426
426
|
}
|
|
427
|
-
function
|
|
428
|
-
return
|
|
427
|
+
function bt(e) {
|
|
428
|
+
return d(e)?.carriesText === !0;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
return
|
|
430
|
+
function Et(e) {
|
|
431
|
+
return d(e)?.countsAs;
|
|
432
432
|
}
|
|
433
|
-
function
|
|
434
|
-
return
|
|
433
|
+
function _t(e) {
|
|
434
|
+
return d(e)?.playbookAuthored === !0;
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
const t =
|
|
436
|
+
function se(e) {
|
|
437
|
+
const t = d(e.type)?.snippet;
|
|
438
438
|
return t ? t(e) : "";
|
|
439
439
|
}
|
|
440
|
-
function
|
|
441
|
-
const n =
|
|
440
|
+
function Tt(e, t) {
|
|
441
|
+
const n = d(e.type)?.timeline;
|
|
442
442
|
return n ? n(e, t) : e.type.replace(/_/g, " ").toLowerCase();
|
|
443
443
|
}
|
|
444
|
-
function
|
|
445
|
-
const t =
|
|
444
|
+
function It(e) {
|
|
445
|
+
const t = d(e.type)?.joinUrl;
|
|
446
446
|
return t ? t(e) : void 0;
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function C(e, t) {
|
|
449
449
|
let n = e;
|
|
450
|
-
for (const
|
|
450
|
+
for (const a of t.split(".")) {
|
|
451
451
|
if (n == null || typeof n != "object") return "";
|
|
452
|
-
n = n[
|
|
452
|
+
n = n[a];
|
|
453
453
|
}
|
|
454
454
|
return n == null ? "" : typeof n == "string" ? n : typeof n == "number" || typeof n == "boolean" ? String(n) : "";
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function N(e, t, n) {
|
|
457
457
|
if (e === void 0) return null;
|
|
458
458
|
if (typeof e == "string") return e || null;
|
|
459
459
|
if ("value" in e)
|
|
460
|
-
return
|
|
461
|
-
const
|
|
460
|
+
return C(t, e.value) || null;
|
|
461
|
+
const a = {};
|
|
462
462
|
for (const [r, o] of Object.entries(e.params ?? {}))
|
|
463
|
-
|
|
464
|
-
const
|
|
465
|
-
return
|
|
463
|
+
a[r] = C(t, o);
|
|
464
|
+
const i = n(e.key, a);
|
|
465
|
+
return i === e.key ? null : i;
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function le(e, t) {
|
|
468
468
|
if (!e || typeof e == "string" || "value" in e) return null;
|
|
469
469
|
const n = {};
|
|
470
|
-
for (const [
|
|
471
|
-
n[
|
|
470
|
+
for (const [a, i] of Object.entries(e.params ?? {}))
|
|
471
|
+
n[a] = C(t, i);
|
|
472
472
|
return { key: e.key, params: n };
|
|
473
473
|
}
|
|
474
|
-
const
|
|
475
|
-
function
|
|
476
|
-
const t =
|
|
474
|
+
const ce = (e) => e;
|
|
475
|
+
function L(e) {
|
|
476
|
+
const t = f[e];
|
|
477
477
|
return {
|
|
478
478
|
type: e,
|
|
479
479
|
shape: t.shape,
|
|
@@ -488,7 +488,7 @@ function M(e) {
|
|
|
488
488
|
displayNameKey: t.displayNameKey
|
|
489
489
|
};
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function $(e) {
|
|
492
492
|
return {
|
|
493
493
|
type: e.type,
|
|
494
494
|
shape: e.shape,
|
|
@@ -503,21 +503,21 @@ function S(e) {
|
|
|
503
503
|
displayNameKey: e.displayNameKey
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
|
-
class
|
|
507
|
-
constructor(t = [], n =
|
|
506
|
+
class ue {
|
|
507
|
+
constructor(t = [], n = ce) {
|
|
508
508
|
this.translate = n;
|
|
509
|
-
for (const
|
|
510
|
-
|
|
509
|
+
for (const a of t)
|
|
510
|
+
a?.type && (a.type in f || this.declared.has(a.type) || this.declared.set(a.type, a));
|
|
511
511
|
}
|
|
512
512
|
declared = /* @__PURE__ */ new Map();
|
|
513
513
|
get(t) {
|
|
514
|
-
if (t in
|
|
514
|
+
if (t in f) return L(t);
|
|
515
515
|
const n = this.declared.get(t);
|
|
516
|
-
return n ?
|
|
516
|
+
return n ? $(n) : void 0;
|
|
517
517
|
}
|
|
518
518
|
/** Alles wat als trigger aangeboden mag worden, ingebouwd en gedeclareerd. */
|
|
519
519
|
triggerable() {
|
|
520
|
-
const t = Object.keys(
|
|
520
|
+
const t = Object.keys(f).filter((a) => f[a].triggerable).map(L), n = [...this.declared.values()].map($).filter((a) => a.triggerable);
|
|
521
521
|
return [...t, ...n];
|
|
522
522
|
}
|
|
523
523
|
/**
|
|
@@ -526,17 +526,17 @@ class H {
|
|
|
526
526
|
* typenaam — dezelfde regel die de feed altijd al toonde voor onbekende types.
|
|
527
527
|
*/
|
|
528
528
|
timelineText(t, n) {
|
|
529
|
-
const
|
|
530
|
-
if (
|
|
531
|
-
const
|
|
532
|
-
return
|
|
529
|
+
const a = f[t.type];
|
|
530
|
+
if (a?.timeline) return a.timeline(t, n);
|
|
531
|
+
const i = this.declared.get(t.type);
|
|
532
|
+
return N(i?.text, t, this.translate) ?? t.type.replace(/_/g, " ").toLowerCase();
|
|
533
533
|
}
|
|
534
534
|
/** De regel voor de inboxlijst. Leeg wanneer het type niets te tonen heeft. */
|
|
535
535
|
snippet(t) {
|
|
536
|
-
const n =
|
|
536
|
+
const n = f[t.type];
|
|
537
537
|
if (n?.snippet) return n.snippet(t);
|
|
538
|
-
const
|
|
539
|
-
return
|
|
538
|
+
const a = this.declared.get(t.type);
|
|
539
|
+
return N(a?.text, t, this.translate) ?? "";
|
|
540
540
|
}
|
|
541
541
|
/** De descriptor zoals hij binnenkwam; nodig om `text` als sleutel op te slaan. */
|
|
542
542
|
descriptor(t) {
|
|
@@ -552,33 +552,33 @@ class H {
|
|
|
552
552
|
return this.translate;
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
const
|
|
556
|
-
function
|
|
555
|
+
const St = new ue(), R = 140;
|
|
556
|
+
function pe(e) {
|
|
557
557
|
const t = e.trim();
|
|
558
|
-
return t.length <=
|
|
558
|
+
return t.length <= R ? t : t.slice(0, R - 1).trimEnd() + "…";
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
const n =
|
|
560
|
+
function Mt(e, t) {
|
|
561
|
+
const n = le(t?.text, e), a = t ? N(t.text, e, (i) => i) : null;
|
|
562
562
|
return {
|
|
563
563
|
activityId: e.id,
|
|
564
564
|
type: e.type,
|
|
565
|
-
snippet:
|
|
565
|
+
snippet: pe(a ?? se(e)),
|
|
566
566
|
authorName: e.author?.name ?? "",
|
|
567
567
|
direction: e.direction,
|
|
568
568
|
createdAt: e.createdAt ?? Date.now(),
|
|
569
569
|
...n ? { snippetKey: n.key, snippetParams: n.params } : {}
|
|
570
570
|
};
|
|
571
571
|
}
|
|
572
|
-
function
|
|
573
|
-
const
|
|
574
|
-
if (!
|
|
575
|
-
const
|
|
576
|
-
return e.author.type === "user" && e.author.id &&
|
|
572
|
+
function Ct(e, t, n = []) {
|
|
573
|
+
const a = e.createdAt;
|
|
574
|
+
if (!a) return [];
|
|
575
|
+
const i = new Set(n);
|
|
576
|
+
return e.author.type === "user" && e.author.id && i.add(e.author.id), Object.entries(t).filter(([r, o]) => o >= a && !i.has(r)).map(([r]) => r);
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function Nt(e) {
|
|
579
579
|
return e.createdAt ?? 0;
|
|
580
580
|
}
|
|
581
|
-
const
|
|
581
|
+
const vt = [
|
|
582
582
|
{ id: "agent", label: "Agent", labelSource: "user" },
|
|
583
583
|
{ id: "team", label: "Team", labelSource: "team" },
|
|
584
584
|
{ id: "inbox", label: "Inbox", labelSource: "inbox" },
|
|
@@ -588,57 +588,364 @@ const ze = [
|
|
|
588
588
|
{ id: "handledBy", label: "Afhandelaar", labelSource: "raw" },
|
|
589
589
|
{ id: "time", label: "Tijd", labelSource: "raw" }
|
|
590
590
|
];
|
|
591
|
-
function
|
|
591
|
+
function kt(e) {
|
|
592
592
|
const t = [];
|
|
593
593
|
for (const n of Object.keys(e))
|
|
594
|
-
for (const
|
|
595
|
-
t.push({ lang: n, key:
|
|
594
|
+
for (const a of Object.keys(e[n]))
|
|
595
|
+
t.push({ lang: n, key: a, value: e[n][a] });
|
|
596
596
|
return t;
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function S(e) {
|
|
599
599
|
return e < 10 ? `0${e}` : `${e}`;
|
|
600
600
|
}
|
|
601
|
-
function
|
|
602
|
-
const n = new Date(e),
|
|
603
|
-
return t === "day" ?
|
|
601
|
+
function de(e, t) {
|
|
602
|
+
const n = new Date(e), a = `${n.getUTCFullYear()}-${S(n.getUTCMonth() + 1)}-${S(n.getUTCDate())}`;
|
|
603
|
+
return t === "day" ? a : `${a}T${S(n.getUTCHours())}`;
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function me(e, t) {
|
|
606
606
|
const n = new Date(e);
|
|
607
607
|
return n.setUTCMinutes(0, 0, 0), t === "day" && n.setUTCHours(0), n.getTime();
|
|
608
608
|
}
|
|
609
|
-
const
|
|
610
|
-
function
|
|
611
|
-
const
|
|
612
|
-
for (let r =
|
|
613
|
-
|
|
614
|
-
return
|
|
609
|
+
const fe = 36e5, ge = 864e5;
|
|
610
|
+
function xt(e, t, n) {
|
|
611
|
+
const a = n === "hour" ? fe : ge, i = [];
|
|
612
|
+
for (let r = me(e, n); r <= t; r += a)
|
|
613
|
+
i.push(de(r, n));
|
|
614
|
+
return i;
|
|
615
615
|
}
|
|
616
|
-
const
|
|
616
|
+
const he = [
|
|
617
617
|
{ id: "resource", label: "Resource", labelSource: "raw" },
|
|
618
618
|
{ id: "origin", label: "Herkomst", labelSource: "raw" }
|
|
619
|
-
],
|
|
620
|
-
function
|
|
619
|
+
], ye = he.map((e) => e.id);
|
|
620
|
+
function Ae(e, t) {
|
|
621
621
|
return `${e}.usage.${t}`;
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function Ot(e, t) {
|
|
624
624
|
return t.map((n) => ({
|
|
625
|
-
id:
|
|
625
|
+
id: Ae(e, n.unit),
|
|
626
626
|
label: n.label,
|
|
627
627
|
category: "Verbruik",
|
|
628
628
|
valueType: n.valueType ?? "count",
|
|
629
629
|
aggregation: "sum",
|
|
630
630
|
supportedDimensions: [
|
|
631
631
|
"provider",
|
|
632
|
-
...
|
|
632
|
+
...ye,
|
|
633
633
|
...n.extraDimensions ?? [],
|
|
634
634
|
"time"
|
|
635
635
|
]
|
|
636
636
|
}));
|
|
637
637
|
}
|
|
638
|
-
|
|
638
|
+
const J = /* @__PURE__ */ new Set(["info", "success", "warning", "destructive"]), D = 200, w = 100, U = 200, K = 12, P = 4, Q = 4e3, M = 500, Lt = 256 * 1024, be = /* @__PURE__ */ new Set([
|
|
639
|
+
"heading",
|
|
640
|
+
"paragraph",
|
|
641
|
+
"list",
|
|
642
|
+
"quote",
|
|
643
|
+
"code",
|
|
644
|
+
"divider",
|
|
645
|
+
"table",
|
|
646
|
+
"kpi",
|
|
647
|
+
"callout"
|
|
648
|
+
]), Ee = ["http:", "https:", "mailto:", "tel:"], _e = /^[a-z][a-z0-9+.-]*:/i;
|
|
649
|
+
function Z(e) {
|
|
650
|
+
const t = e.trim().replace(/^<|>$/g, "");
|
|
651
|
+
if (!t) return !1;
|
|
652
|
+
const n = _e.exec(t)?.[0];
|
|
653
|
+
return n ? Ee.includes(n.toLowerCase()) : !t.startsWith("//");
|
|
654
|
+
}
|
|
655
|
+
const Te = /^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;
|
|
656
|
+
function Ie(e) {
|
|
657
|
+
let t = "", n = 0;
|
|
658
|
+
for (; n < e.length; ) {
|
|
659
|
+
const a = e[n] === "!" && e[n + 1] === "[";
|
|
660
|
+
if (e[n] !== "[" && !a) {
|
|
661
|
+
t += e[n], n += 1;
|
|
662
|
+
continue;
|
|
663
|
+
}
|
|
664
|
+
const i = n + (a ? 2 : 1), r = G(e, i, "[", "]");
|
|
665
|
+
if (r < 0 || e[r + 1] !== "(") {
|
|
666
|
+
t += e[n], n += 1;
|
|
667
|
+
continue;
|
|
668
|
+
}
|
|
669
|
+
const o = G(e, r + 2, "(", ")");
|
|
670
|
+
if (o < 0) {
|
|
671
|
+
t += e[n], n += 1;
|
|
672
|
+
continue;
|
|
673
|
+
}
|
|
674
|
+
const s = e.slice(i, r), m = e.slice(r + 2, o).trim().split(/\s+/)[0] ?? "";
|
|
675
|
+
t += a || !Z(m) ? s : e.slice(n, o + 1), n = o + 1;
|
|
676
|
+
}
|
|
677
|
+
return t;
|
|
678
|
+
}
|
|
679
|
+
function G(e, t, n, a) {
|
|
680
|
+
let i = 1;
|
|
681
|
+
for (let r = t; r < e.length; r += 1) {
|
|
682
|
+
if (e[r] === "\\") {
|
|
683
|
+
r += 1;
|
|
684
|
+
continue;
|
|
685
|
+
}
|
|
686
|
+
if (e[r] === n) i += 1;
|
|
687
|
+
else if (e[r] === a && (i -= 1, i === 0))
|
|
688
|
+
return r;
|
|
689
|
+
}
|
|
690
|
+
return -1;
|
|
691
|
+
}
|
|
692
|
+
function Se(e) {
|
|
693
|
+
return Ie(e).replace(
|
|
694
|
+
Te,
|
|
695
|
+
(t, n, a) => Z(a) ? t : ""
|
|
696
|
+
);
|
|
697
|
+
}
|
|
698
|
+
function c(e, t = Q) {
|
|
699
|
+
return typeof e == "string" ? Se(e).slice(0, t) : "";
|
|
700
|
+
}
|
|
701
|
+
function Me(e, t = Q) {
|
|
702
|
+
return typeof e == "string" ? e.slice(0, t) : "";
|
|
703
|
+
}
|
|
704
|
+
function Ce(e, t = "info") {
|
|
705
|
+
return typeof e == "string" && J.has(e) ? e : t;
|
|
706
|
+
}
|
|
707
|
+
function $t(e, t = () => {
|
|
708
|
+
}) {
|
|
709
|
+
if (!Array.isArray(e)) return [];
|
|
710
|
+
const n = [];
|
|
711
|
+
for (const a of e) {
|
|
712
|
+
if (n.length >= D) {
|
|
713
|
+
t("more than " + D + " blocks; the rest was dropped");
|
|
714
|
+
break;
|
|
715
|
+
}
|
|
716
|
+
if (!a || typeof a != "object") continue;
|
|
717
|
+
const i = a;
|
|
718
|
+
if (!be.has(i.type)) {
|
|
719
|
+
t("unknown block type " + String(i.type));
|
|
720
|
+
continue;
|
|
721
|
+
}
|
|
722
|
+
const r = typeof i.block_id == "string" ? { block_id: i.block_id } : {};
|
|
723
|
+
switch (i.type) {
|
|
724
|
+
case "heading": {
|
|
725
|
+
const o = c(i.text);
|
|
726
|
+
if (!o) {
|
|
727
|
+
t("a heading without text");
|
|
728
|
+
continue;
|
|
729
|
+
}
|
|
730
|
+
const s = i.level === 2 || i.level === 3 ? i.level : 1;
|
|
731
|
+
n.push({ ...r, type: "heading", level: s, text: o });
|
|
732
|
+
break;
|
|
733
|
+
}
|
|
734
|
+
case "paragraph": {
|
|
735
|
+
const o = c(i.text);
|
|
736
|
+
if (!o) {
|
|
737
|
+
t("a paragraph without text");
|
|
738
|
+
continue;
|
|
739
|
+
}
|
|
740
|
+
n.push({ ...r, type: "paragraph", text: o });
|
|
741
|
+
break;
|
|
742
|
+
}
|
|
743
|
+
case "quote": {
|
|
744
|
+
const o = c(i.text);
|
|
745
|
+
if (!o) {
|
|
746
|
+
t("a quote without text");
|
|
747
|
+
continue;
|
|
748
|
+
}
|
|
749
|
+
n.push({ ...r, type: "quote", text: o });
|
|
750
|
+
break;
|
|
751
|
+
}
|
|
752
|
+
case "code": {
|
|
753
|
+
const o = Me(i.text);
|
|
754
|
+
if (!o) {
|
|
755
|
+
t("a code block without text");
|
|
756
|
+
continue;
|
|
757
|
+
}
|
|
758
|
+
const s = typeof i.lang == "string" ? { lang: i.lang.slice(0, 32) } : {};
|
|
759
|
+
n.push({ ...r, type: "code", ...s, text: o });
|
|
760
|
+
break;
|
|
761
|
+
}
|
|
762
|
+
case "divider":
|
|
763
|
+
n.push({ ...r, type: "divider" });
|
|
764
|
+
break;
|
|
765
|
+
case "list": {
|
|
766
|
+
const o = Array.isArray(i.items) ? i.items : [], s = [];
|
|
767
|
+
for (const u of o) {
|
|
768
|
+
if (s.length >= w) {
|
|
769
|
+
t("more than " + w + " list items");
|
|
770
|
+
break;
|
|
771
|
+
}
|
|
772
|
+
const p = c(u?.text);
|
|
773
|
+
if (!p) continue;
|
|
774
|
+
const l = c(u?.lead, 200);
|
|
775
|
+
s.push(l ? { lead: l, text: p } : { text: p });
|
|
776
|
+
}
|
|
777
|
+
if (s.length === 0) {
|
|
778
|
+
t("a list without usable items");
|
|
779
|
+
continue;
|
|
780
|
+
}
|
|
781
|
+
const m = i.style === "numbered" ? "numbered" : "bulleted";
|
|
782
|
+
n.push({ ...r, type: "list", style: m, items: s });
|
|
783
|
+
break;
|
|
784
|
+
}
|
|
785
|
+
case "table": {
|
|
786
|
+
const o = Array.isArray(i.columns) ? i.columns : [], s = [];
|
|
787
|
+
for (const l of o) {
|
|
788
|
+
if (s.length >= K) {
|
|
789
|
+
t("more than " + K + " table columns");
|
|
790
|
+
break;
|
|
791
|
+
}
|
|
792
|
+
const h = c(l?.label, M), _ = l?.align === "right" ? "right" : void 0;
|
|
793
|
+
s.push(_ ? { label: h, align: _ } : { label: h });
|
|
794
|
+
}
|
|
795
|
+
if (s.length === 0) {
|
|
796
|
+
t("a table without columns");
|
|
797
|
+
continue;
|
|
798
|
+
}
|
|
799
|
+
const m = Array.isArray(i.rows) ? i.rows : [], u = [];
|
|
800
|
+
for (const l of m) {
|
|
801
|
+
if (u.length >= U) {
|
|
802
|
+
t("more than " + U + " table rows");
|
|
803
|
+
break;
|
|
804
|
+
}
|
|
805
|
+
const h = Array.isArray(l) ? l : [];
|
|
806
|
+
u.push(
|
|
807
|
+
s.map((_, ae) => c(h[ae], M))
|
|
808
|
+
);
|
|
809
|
+
}
|
|
810
|
+
const p = c(i.caption, M);
|
|
811
|
+
n.push({
|
|
812
|
+
...r,
|
|
813
|
+
type: "table",
|
|
814
|
+
columns: s,
|
|
815
|
+
rows: u,
|
|
816
|
+
...p ? { caption: p } : {}
|
|
817
|
+
});
|
|
818
|
+
break;
|
|
819
|
+
}
|
|
820
|
+
case "kpi": {
|
|
821
|
+
const o = Array.isArray(i.items) ? i.items : [], s = [];
|
|
822
|
+
for (const m of o) {
|
|
823
|
+
if (s.length >= P) {
|
|
824
|
+
t("more than " + P + " kpi items");
|
|
825
|
+
break;
|
|
826
|
+
}
|
|
827
|
+
const u = c(m?.value, 40), p = c(m?.label, 80);
|
|
828
|
+
if (!u || !p) continue;
|
|
829
|
+
const l = m?.tone;
|
|
830
|
+
s.push(
|
|
831
|
+
typeof l == "string" && J.has(l) ? { value: u, label: p, tone: l } : { value: u, label: p }
|
|
832
|
+
);
|
|
833
|
+
}
|
|
834
|
+
if (s.length === 0) {
|
|
835
|
+
t("a kpi block without usable items");
|
|
836
|
+
continue;
|
|
837
|
+
}
|
|
838
|
+
n.push({ ...r, type: "kpi", items: s });
|
|
839
|
+
break;
|
|
840
|
+
}
|
|
841
|
+
case "callout": {
|
|
842
|
+
const o = c(i.text);
|
|
843
|
+
if (!o) {
|
|
844
|
+
t("a callout without text");
|
|
845
|
+
continue;
|
|
846
|
+
}
|
|
847
|
+
const s = c(i.title, 200);
|
|
848
|
+
n.push({
|
|
849
|
+
...r,
|
|
850
|
+
type: "callout",
|
|
851
|
+
tone: Ce(i.tone),
|
|
852
|
+
...s ? { title: s } : {},
|
|
853
|
+
text: o
|
|
854
|
+
});
|
|
855
|
+
break;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
return n;
|
|
860
|
+
}
|
|
861
|
+
function Rt(e) {
|
|
862
|
+
return JSON.stringify(e).length;
|
|
863
|
+
}
|
|
864
|
+
function Dt(e) {
|
|
865
|
+
return {
|
|
866
|
+
blocks: e.length,
|
|
867
|
+
types: e.map((t) => t.type),
|
|
868
|
+
headings: e.flatMap((t) => t.type === "heading" ? [t.text] : [])
|
|
869
|
+
};
|
|
870
|
+
}
|
|
871
|
+
function V(e) {
|
|
872
|
+
return e.replace(/\|/g, "\\|").replace(/\r?\n/g, " ").trim();
|
|
873
|
+
}
|
|
874
|
+
function j(e, t, n) {
|
|
875
|
+
const a = e.map((i, r) => n?.[r] === "right" ? "---:" : "---");
|
|
876
|
+
return [
|
|
877
|
+
`| ${e.map(V).join(" | ")} |`,
|
|
878
|
+
`| ${a.join(" | ")} |`,
|
|
879
|
+
...t.map((i) => `| ${i.map(V).join(" | ")} |`)
|
|
880
|
+
];
|
|
881
|
+
}
|
|
882
|
+
function Ne(e) {
|
|
883
|
+
switch (e.type) {
|
|
884
|
+
case "heading":
|
|
885
|
+
return [`${"#".repeat(e.level)} ${e.text}`];
|
|
886
|
+
case "paragraph":
|
|
887
|
+
return [e.text];
|
|
888
|
+
case "quote":
|
|
889
|
+
return e.text.split(/\r?\n/).map((t) => `> ${t}`);
|
|
890
|
+
case "code":
|
|
891
|
+
return [`\`\`\`${e.lang ?? ""}`, e.text, "```"];
|
|
892
|
+
case "divider":
|
|
893
|
+
return ["---"];
|
|
894
|
+
case "list":
|
|
895
|
+
return e.items.map((t, n) => {
|
|
896
|
+
const a = e.style === "numbered" ? `${n + 1}.` : "-";
|
|
897
|
+
return t.lead ? `${a} **${t.lead}** ${t.text}` : `${a} ${t.text}`;
|
|
898
|
+
});
|
|
899
|
+
case "table": {
|
|
900
|
+
const t = j(
|
|
901
|
+
e.columns.map((n) => n.label),
|
|
902
|
+
e.rows,
|
|
903
|
+
e.columns.map((n) => n.align ?? "left")
|
|
904
|
+
);
|
|
905
|
+
return e.caption ? [...t, "", `*${e.caption}*`] : t;
|
|
906
|
+
}
|
|
907
|
+
case "kpi":
|
|
908
|
+
return j(
|
|
909
|
+
e.items.map((t) => t.value),
|
|
910
|
+
[e.items.map((t) => t.label)]
|
|
911
|
+
);
|
|
912
|
+
case "callout":
|
|
913
|
+
return (e.title ? `**${e.title}** ${e.text}` : e.text).split(/\r?\n/).map((n) => `> ${n}`);
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
function wt(e, t) {
|
|
917
|
+
const n = [], a = e.some((i) => i.type === "heading" && i.level === 1);
|
|
918
|
+
t && !a && n.push(`# ${t}`);
|
|
919
|
+
for (const i of e) {
|
|
920
|
+
const r = Ne(i);
|
|
921
|
+
r.length > 0 && n.push(r.join(`
|
|
922
|
+
`));
|
|
923
|
+
}
|
|
924
|
+
return `${n.join(`
|
|
925
|
+
|
|
926
|
+
`)}
|
|
927
|
+
`;
|
|
928
|
+
}
|
|
929
|
+
const ee = (e) => `user:${e}`, te = (e) => `team:${e}`;
|
|
930
|
+
function Ut(e) {
|
|
931
|
+
const t = /* @__PURE__ */ new Set();
|
|
932
|
+
for (const n of e ?? [])
|
|
933
|
+
n?.id && (n.kind === "user" && t.add(ee(n.id)), n.kind === "team" && t.add(te(n.id)));
|
|
934
|
+
return [...t].sort();
|
|
935
|
+
}
|
|
936
|
+
function Kt(e, t) {
|
|
937
|
+
return [ee(e), ...t.map(te)];
|
|
938
|
+
}
|
|
939
|
+
function Pt(e) {
|
|
940
|
+
const t = /* @__PURE__ */ new Set();
|
|
941
|
+
for (const n of e ?? [])
|
|
942
|
+
n?.kind && t.add(n.kind);
|
|
943
|
+
return [...t];
|
|
944
|
+
}
|
|
945
|
+
function Gt(e) {
|
|
639
946
|
return (e.startsWith("tool:") ? e.slice(5) : e).replace(/__/g, " · ").replace(/\./g, " · ").replace(/_/g, " ");
|
|
640
947
|
}
|
|
641
|
-
const
|
|
948
|
+
const Vt = [
|
|
642
949
|
{ name: "text", type: "string" },
|
|
643
950
|
{ name: "subject", type: "string" },
|
|
644
951
|
{ name: "from", type: "string" },
|
|
@@ -661,7 +968,7 @@ const et = [
|
|
|
661
968
|
// een nieuw adres) — een stap die hierop leunt hoort dus een `condition` te hebben.
|
|
662
969
|
{ name: "contactId", type: "string" },
|
|
663
970
|
{ name: "companyId", type: "string" }
|
|
664
|
-
],
|
|
971
|
+
], jt = {
|
|
665
972
|
topics: [
|
|
666
973
|
{ name: "topic", type: "string" },
|
|
667
974
|
{ name: "confidence", type: "number" }
|
|
@@ -672,7 +979,7 @@ const et = [
|
|
|
672
979
|
],
|
|
673
980
|
extract: []
|
|
674
981
|
};
|
|
675
|
-
function
|
|
982
|
+
function ve(e) {
|
|
676
983
|
switch (e.kind) {
|
|
677
984
|
case "user":
|
|
678
985
|
return `user:${e.userId}`;
|
|
@@ -682,22 +989,22 @@ function J(e) {
|
|
|
682
989
|
return "org";
|
|
683
990
|
}
|
|
684
991
|
}
|
|
685
|
-
function
|
|
992
|
+
function Bt(e) {
|
|
686
993
|
if (typeof e != "string") return;
|
|
687
994
|
const t = e.trim();
|
|
688
995
|
if (t === "org") return { kind: "org" };
|
|
689
996
|
const n = t.indexOf(":");
|
|
690
997
|
if (n <= 0) return;
|
|
691
|
-
const
|
|
692
|
-
if (
|
|
693
|
-
if (
|
|
694
|
-
if (
|
|
998
|
+
const a = t.slice(0, n), i = t.slice(n + 1).trim();
|
|
999
|
+
if (i) {
|
|
1000
|
+
if (a === "user") return { kind: "user", userId: i };
|
|
1001
|
+
if (a === "team") return { kind: "team", teamId: i };
|
|
695
1002
|
}
|
|
696
1003
|
}
|
|
697
|
-
function
|
|
698
|
-
return
|
|
1004
|
+
function ke(e) {
|
|
1005
|
+
return ve(e);
|
|
699
1006
|
}
|
|
700
|
-
function
|
|
1007
|
+
function Ht(e) {
|
|
701
1008
|
switch (e.kind) {
|
|
702
1009
|
case "personal":
|
|
703
1010
|
return { kind: "user", userId: e.userId };
|
|
@@ -707,20 +1014,20 @@ function it(e) {
|
|
|
707
1014
|
return { kind: "org" };
|
|
708
1015
|
}
|
|
709
1016
|
}
|
|
710
|
-
function
|
|
711
|
-
return
|
|
1017
|
+
function Ft(e) {
|
|
1018
|
+
return ke(e);
|
|
712
1019
|
}
|
|
713
|
-
const
|
|
714
|
-
function
|
|
715
|
-
return
|
|
1020
|
+
const xe = ["done", "escalated", "failed", "timed_out", "stopped"], Oe = ["awaiting_approval", "awaiting_reply"];
|
|
1021
|
+
function Le(e) {
|
|
1022
|
+
return xe.includes(e);
|
|
716
1023
|
}
|
|
717
|
-
function
|
|
718
|
-
return
|
|
1024
|
+
function Xt(e) {
|
|
1025
|
+
return Le(e);
|
|
719
1026
|
}
|
|
720
|
-
function
|
|
721
|
-
return
|
|
1027
|
+
function Wt(e) {
|
|
1028
|
+
return Oe.includes(e);
|
|
722
1029
|
}
|
|
723
|
-
const
|
|
1030
|
+
const ne = [
|
|
724
1031
|
{
|
|
725
1032
|
id: "openai",
|
|
726
1033
|
attachmentKinds: ["image", "pdf"],
|
|
@@ -811,56 +1118,56 @@ const R = [
|
|
|
811
1118
|
defaultModel: "default"
|
|
812
1119
|
}
|
|
813
1120
|
];
|
|
814
|
-
function
|
|
815
|
-
return
|
|
1121
|
+
function E(e) {
|
|
1122
|
+
return ne.find((t) => t.id === e);
|
|
816
1123
|
}
|
|
817
|
-
function
|
|
818
|
-
return
|
|
1124
|
+
function zt(e) {
|
|
1125
|
+
return E(e)?.label ?? e;
|
|
819
1126
|
}
|
|
820
|
-
function
|
|
821
|
-
return
|
|
1127
|
+
function Yt(e, t = "gpt-5-mini") {
|
|
1128
|
+
return E(e)?.defaultModel ?? t;
|
|
822
1129
|
}
|
|
823
|
-
function
|
|
824
|
-
return
|
|
1130
|
+
function qt(e) {
|
|
1131
|
+
return ne.filter((t) => t.capabilities.includes(e));
|
|
825
1132
|
}
|
|
826
|
-
function
|
|
827
|
-
const t =
|
|
1133
|
+
function Jt(e) {
|
|
1134
|
+
const t = E(e);
|
|
828
1135
|
return !!t && !t.baseUrl;
|
|
829
1136
|
}
|
|
830
|
-
function
|
|
831
|
-
return t === "text" ? !0 :
|
|
1137
|
+
function Qt(e, t) {
|
|
1138
|
+
return t === "text" ? !0 : E(e)?.attachmentKinds?.includes(t) === !0;
|
|
832
1139
|
}
|
|
833
|
-
const
|
|
834
|
-
function
|
|
1140
|
+
const Zt = /* @__PURE__ */ new Set(["mail", "message"]);
|
|
1141
|
+
function $e(e, t) {
|
|
835
1142
|
const n = e.settings?.signatures?.[t];
|
|
836
1143
|
return !n || !n.enabled || !n.body || n.body.trim() === "" ? null : n;
|
|
837
1144
|
}
|
|
838
|
-
function
|
|
1145
|
+
function en(e, t, n, a = "html") {
|
|
839
1146
|
if (!e) return n;
|
|
840
|
-
const
|
|
841
|
-
return
|
|
1147
|
+
const i = $e(e, t);
|
|
1148
|
+
return i ? `${n}${a === "text" ? `
|
|
842
1149
|
|
|
843
|
-
` : t === "mail" ? "<br><br>-- <br>" : "<br><br>"}${
|
|
1150
|
+
` : t === "mail" ? "<br><br>-- <br>" : "<br><br>"}${i.body}` : n;
|
|
844
1151
|
}
|
|
845
|
-
function
|
|
1152
|
+
function tn(e) {
|
|
846
1153
|
return e.endpoints ?? [];
|
|
847
1154
|
}
|
|
848
|
-
const
|
|
1155
|
+
const nn = (e) => !!e.assignedUserId || !!e.assignedInboxId, an = (e) => e.status === "closed", rn = (e) => ({
|
|
849
1156
|
urgent: 10,
|
|
850
1157
|
high: 5,
|
|
851
1158
|
normal: 2,
|
|
852
1159
|
low: 1
|
|
853
|
-
})[e.priority] || 0,
|
|
854
|
-
function
|
|
1160
|
+
})[e.priority] || 0, on = (e, t = 30) => e.title?.length <= t ? e.title : `${e.title.substring(0, t)}...`;
|
|
1161
|
+
function sn(e, t) {
|
|
855
1162
|
return e.lastActivityAt ? !(e.seenBy ?? []).includes(t) : !1;
|
|
856
1163
|
}
|
|
857
|
-
const
|
|
858
|
-
function
|
|
1164
|
+
const ln = 2e3, cn = 500, un = 12e3, pn = 4e3, Re = ["contact", "company"];
|
|
1165
|
+
function dn(e) {
|
|
859
1166
|
if (!e) return !1;
|
|
860
1167
|
const t = e.slice(0, e.indexOf(":"));
|
|
861
|
-
return
|
|
1168
|
+
return Re.includes(t);
|
|
862
1169
|
}
|
|
863
|
-
const
|
|
1170
|
+
const v = {
|
|
864
1171
|
// The lower bounds are deliberately generous: service ranges (0800/0900) are
|
|
865
1172
|
// shorter than geographic numbers, and a too-strict minimum silently drops them.
|
|
866
1173
|
// An over-permissive key is harmless — it simply matches nothing.
|
|
@@ -883,81 +1190,81 @@ const A = {
|
|
|
883
1190
|
PL: { callingCode: "48", nsnMin: 9, nsnMax: 9 },
|
|
884
1191
|
US: { callingCode: "1", nsnMin: 10, nsnMax: 10 },
|
|
885
1192
|
CA: { callingCode: "1", nsnMin: 10, nsnMax: 10 }
|
|
886
|
-
},
|
|
887
|
-
new Set(Object.values(
|
|
1193
|
+
}, De = "NL", we = 15, Ue = 8, Ke = Array.from(
|
|
1194
|
+
new Set(Object.values(v).map((e) => e.callingCode))
|
|
888
1195
|
).sort((e, t) => t.length - e.length);
|
|
889
|
-
function
|
|
1196
|
+
function B(e) {
|
|
890
1197
|
if (e)
|
|
891
|
-
return
|
|
1198
|
+
return v[e.trim().toUpperCase()];
|
|
892
1199
|
}
|
|
893
|
-
function
|
|
1200
|
+
function b(e, t) {
|
|
894
1201
|
return e.length >= t.nsnMin && e.length <= t.nsnMax;
|
|
895
1202
|
}
|
|
896
|
-
function
|
|
897
|
-
if (e.length >
|
|
898
|
-
for (const t of
|
|
1203
|
+
function H(e) {
|
|
1204
|
+
if (e.length > we) return null;
|
|
1205
|
+
for (const t of Ke) {
|
|
899
1206
|
if (!e.startsWith(t)) continue;
|
|
900
1207
|
const n = e.slice(t.length);
|
|
901
|
-
for (const
|
|
902
|
-
if (
|
|
903
|
-
const
|
|
904
|
-
if (
|
|
1208
|
+
for (const a of Object.values(v)) {
|
|
1209
|
+
if (a.callingCode !== t) continue;
|
|
1210
|
+
const i = a.trunkPrefix, r = i && n.startsWith(i) ? n.slice(i.length) : n;
|
|
1211
|
+
if (b(r, a)) return `+${t}${r}`;
|
|
905
1212
|
}
|
|
906
1213
|
return null;
|
|
907
1214
|
}
|
|
908
|
-
return e.length <
|
|
1215
|
+
return e.length < Ue ? null : `+${e}`;
|
|
909
1216
|
}
|
|
910
|
-
function
|
|
1217
|
+
function Pe(e) {
|
|
911
1218
|
let t = e.trim();
|
|
912
1219
|
const n = t.match(/^(sips?|tel|whatsapp):/i);
|
|
913
1220
|
n && (t = t.slice(n[0].length));
|
|
914
|
-
const
|
|
915
|
-
return
|
|
1221
|
+
const a = t.indexOf("@");
|
|
1222
|
+
return a >= 0 && (t = t.slice(0, a)), t.trim();
|
|
916
1223
|
}
|
|
917
|
-
function
|
|
1224
|
+
function mn(e) {
|
|
918
1225
|
if (!e) return !1;
|
|
919
1226
|
const t = e.indexOf("@");
|
|
920
1227
|
if (t <= 0) return !1;
|
|
921
1228
|
const n = e.slice(0, t).trim();
|
|
922
1229
|
return !/^[+\d\s().-]+$/.test(n);
|
|
923
1230
|
}
|
|
924
|
-
function
|
|
1231
|
+
function F(e, t) {
|
|
925
1232
|
if (!e) return null;
|
|
926
|
-
const n =
|
|
1233
|
+
const n = Pe(e);
|
|
927
1234
|
if (!n) return null;
|
|
928
|
-
const
|
|
929
|
-
if (!
|
|
930
|
-
if (
|
|
931
|
-
if (
|
|
932
|
-
const r =
|
|
1235
|
+
const a = n.startsWith("+"), i = n.replace(/\D/g, "");
|
|
1236
|
+
if (!i) return null;
|
|
1237
|
+
if (a) return H(i);
|
|
1238
|
+
if (i.startsWith("00")) return H(i.slice(2));
|
|
1239
|
+
const r = B(t) ?? B(De);
|
|
933
1240
|
if (!r) return null;
|
|
934
1241
|
const o = r.trunkPrefix;
|
|
935
|
-
if (o &&
|
|
936
|
-
const s =
|
|
937
|
-
return
|
|
1242
|
+
if (o && i.startsWith(o)) {
|
|
1243
|
+
const s = i.slice(o.length);
|
|
1244
|
+
return b(s, r) ? `+${r.callingCode}${s}` : null;
|
|
938
1245
|
}
|
|
939
|
-
if (
|
|
940
|
-
const s =
|
|
941
|
-
if (
|
|
1246
|
+
if (i.startsWith(r.callingCode)) {
|
|
1247
|
+
const s = i.slice(r.callingCode.length);
|
|
1248
|
+
if (b(s, r)) return `+${r.callingCode}${s}`;
|
|
942
1249
|
}
|
|
943
|
-
return !o &&
|
|
1250
|
+
return !o && b(i, r) ? `+${r.callingCode}${i}` : null;
|
|
944
1251
|
}
|
|
945
|
-
function
|
|
1252
|
+
function fn(e, t = 9) {
|
|
946
1253
|
const n = (e ?? "").replace(/\D/g, "");
|
|
947
1254
|
return n.length < t ? null : n.slice(-t);
|
|
948
1255
|
}
|
|
949
|
-
function
|
|
1256
|
+
function ie(e) {
|
|
950
1257
|
if (!e) return null;
|
|
951
1258
|
const t = e.trim().toLowerCase(), n = t.lastIndexOf("@");
|
|
952
1259
|
if (n <= 0 || n === t.length - 1) return null;
|
|
953
|
-
const
|
|
954
|
-
return !
|
|
1260
|
+
const a = t.slice(0, n).split("+")[0], i = t.slice(n + 1);
|
|
1261
|
+
return !a || !i.includes(".") ? null : `${a}@${i}`;
|
|
955
1262
|
}
|
|
956
|
-
function
|
|
957
|
-
const t =
|
|
1263
|
+
function gn(e) {
|
|
1264
|
+
const t = ie(e);
|
|
958
1265
|
return t ? t.slice(t.lastIndexOf("@") + 1) : null;
|
|
959
1266
|
}
|
|
960
|
-
const
|
|
1267
|
+
const Ge = /* @__PURE__ */ new Set([
|
|
961
1268
|
"co.uk",
|
|
962
1269
|
"org.uk",
|
|
963
1270
|
"gov.uk",
|
|
@@ -967,14 +1274,14 @@ const ce = /* @__PURE__ */ new Set([
|
|
|
967
1274
|
"com.br",
|
|
968
1275
|
"co.za"
|
|
969
1276
|
]);
|
|
970
|
-
function
|
|
1277
|
+
function Ve(e) {
|
|
971
1278
|
if (!e) return null;
|
|
972
1279
|
const t = e.trim().toLowerCase().replace(/\.$/, "").split(".").filter(Boolean);
|
|
973
1280
|
if (t.length < 2) return null;
|
|
974
1281
|
const n = t.slice(-2).join(".");
|
|
975
|
-
return
|
|
1282
|
+
return Ge.has(n) && t.length >= 3 ? t.slice(-3).join(".") : n;
|
|
976
1283
|
}
|
|
977
|
-
const
|
|
1284
|
+
const je = /* @__PURE__ */ new Set([
|
|
978
1285
|
"gmail.com",
|
|
979
1286
|
"googlemail.com",
|
|
980
1287
|
"outlook.com",
|
|
@@ -1019,44 +1326,44 @@ const pe = /* @__PURE__ */ new Set([
|
|
|
1019
1326
|
"proximus.be",
|
|
1020
1327
|
"scarlet.be"
|
|
1021
1328
|
]);
|
|
1022
|
-
function
|
|
1023
|
-
const t =
|
|
1024
|
-
return t ?
|
|
1329
|
+
function hn(e) {
|
|
1330
|
+
const t = Ve(e);
|
|
1331
|
+
return t ? je.has(t) : !1;
|
|
1025
1332
|
}
|
|
1026
|
-
function
|
|
1333
|
+
function yn(e) {
|
|
1027
1334
|
if (!e) return !1;
|
|
1028
1335
|
const t = e.trim().toLowerCase();
|
|
1029
1336
|
return t === "tel" || t === "sms" || t === "whatsapp" || t === "fax";
|
|
1030
1337
|
}
|
|
1031
|
-
function
|
|
1338
|
+
function An(e, t, n) {
|
|
1032
1339
|
if (!e || !t) return null;
|
|
1033
|
-
const
|
|
1034
|
-
if (
|
|
1035
|
-
const r =
|
|
1340
|
+
const a = e.trim().toLowerCase();
|
|
1341
|
+
if (a === "tel" || a === "sms" || a === "whatsapp") {
|
|
1342
|
+
const r = F(t, n);
|
|
1036
1343
|
return r ? `tel:${r}` : null;
|
|
1037
1344
|
}
|
|
1038
|
-
if (
|
|
1039
|
-
const r =
|
|
1345
|
+
if (a === "fax") {
|
|
1346
|
+
const r = F(t, n);
|
|
1040
1347
|
return r ? `fax:${r}` : null;
|
|
1041
1348
|
}
|
|
1042
|
-
if (
|
|
1043
|
-
const r =
|
|
1349
|
+
if (a === "mailto" || a === "email") {
|
|
1350
|
+
const r = ie(t);
|
|
1044
1351
|
return r ? `mailto:${r}` : null;
|
|
1045
1352
|
}
|
|
1046
|
-
const
|
|
1047
|
-
return
|
|
1353
|
+
const i = t.trim().toLowerCase();
|
|
1354
|
+
return i ? `${a}:${i}` : null;
|
|
1048
1355
|
}
|
|
1049
|
-
const
|
|
1050
|
-
function
|
|
1356
|
+
const Be = /(\*\*|__)(?=\S)([\s\S]*?\S)\1/g, He = /(\*|_)(?=\S)([^*_\n]*?\S)\1/g;
|
|
1357
|
+
function bn(e) {
|
|
1051
1358
|
if (typeof e != "string" || !e) return "";
|
|
1052
1359
|
let t = e;
|
|
1053
1360
|
return t = t.replace(/```[a-z]*\n?/gi, "").replace(/~~~[a-z]*\n?/gi, ""), t = t.replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1"), t = t.replace(/\[([^\]]*)\]\([^)]*\)/g, "$1"), t = t.replace(/\[([^\]]*)\]\[[^\]]*\]/g, "$1"), t = t.replace(/<((?:https?|mailto):[^>\s]+)>/gi, "$1"), t = t.split(`
|
|
1054
1361
|
`).map(
|
|
1055
1362
|
(n) => n.replace(/^\s{0,3}#{1,6}\s+/, "").replace(/^\s{0,3}>\s?/, "").replace(/^\s*[-*+]\s+/, "").replace(/^\s*\d+[.)]\s+/, "").replace(/^\s*(?:[-*_]\s*){3,}$/, "")
|
|
1056
1363
|
).join(`
|
|
1057
|
-
`), t = t.replace(
|
|
1364
|
+
`), t = t.replace(Be, "$2"), t = t.replace(He, "$2"), t = t.replace(/~~(?=\S)([\s\S]*?\S)~~/g, "$1"), t = t.replace(/`([^`\n]+)`/g, "$1"), t.replace(/\s+/g, " ").trim();
|
|
1058
1365
|
}
|
|
1059
|
-
const
|
|
1366
|
+
const Fe = [
|
|
1060
1367
|
/<blockquote/i,
|
|
1061
1368
|
/class="?gmail_quote/i,
|
|
1062
1369
|
// Gmail quote container
|
|
@@ -1069,54 +1376,56 @@ const fe = [
|
|
|
1069
1376
|
// Outlook underscore separator before "From:"
|
|
1070
1377
|
/\bOn\b[\s\S]{0,200}?\bwrote:/i
|
|
1071
1378
|
// Gmail "On <date> <name> wrote:"
|
|
1072
|
-
],
|
|
1073
|
-
function
|
|
1379
|
+
], X = /^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i, Xe = /^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;
|
|
1380
|
+
function We(e) {
|
|
1074
1381
|
const t = e.split(`
|
|
1075
1382
|
`);
|
|
1076
1383
|
for (let n = 0; n < t.length; n++)
|
|
1077
|
-
if (
|
|
1384
|
+
if (Xe.test(t[n]) || X.test(t[n]) && t.slice(n + 1, n + 4).some((a) => X.test(a)))
|
|
1078
1385
|
return t.slice(0, n).join(`
|
|
1079
1386
|
`).trim();
|
|
1080
1387
|
return e;
|
|
1081
1388
|
}
|
|
1082
|
-
function
|
|
1389
|
+
function W(e) {
|
|
1083
1390
|
let t = e;
|
|
1084
1391
|
return t = t.replace(/<(script|style)[\s\S]*?<\/\1>/gi, ""), t = t.replace(/<br\s*\/?>/gi, `
|
|
1085
|
-
`), t = t.replace(/<\/(p|
|
|
1086
|
-
|
|
1392
|
+
`), t = t.replace(/<\/(p|h[1-6]|ul|ol|table|blockquote)>/gi, `
|
|
1393
|
+
|
|
1394
|
+
`), t = t.replace(/<\/(div|li|tr)>/gi, `
|
|
1395
|
+
`), t = t.replace(/<\/(td|th)>/gi, " "), t = t.replace(/<[^>]+>/g, ""), t = t.replace(/<[^>]*$/, ""), t;
|
|
1087
1396
|
}
|
|
1088
|
-
function
|
|
1397
|
+
function z(e) {
|
|
1089
1398
|
return !Number.isInteger(e) || e < 0 || e > 1114111 ? null : String.fromCodePoint(e);
|
|
1090
1399
|
}
|
|
1091
|
-
function
|
|
1092
|
-
return e.replace(/ /gi, " ").replace(/</gi, "<").replace(/>/gi, ">").replace(/"/gi, '"').replace(/&#(\d+);/g, (t, n) =>
|
|
1400
|
+
function Y(e) {
|
|
1401
|
+
return e.replace(/ /gi, " ").replace(/</gi, "<").replace(/>/gi, ">").replace(/"/gi, '"').replace(/&#(\d+);/g, (t, n) => z(Number(n)) ?? t).replace(/&#x([0-9a-f]+);/gi, (t, n) => z(parseInt(n, 16)) ?? t).replace(/&/gi, "&");
|
|
1093
1402
|
}
|
|
1094
|
-
function
|
|
1403
|
+
function q(e) {
|
|
1095
1404
|
return e.replace(/\r/g, "").replace(/[ \t]+/g, " ").replace(/ *\n */g, `
|
|
1096
1405
|
`).replace(/\n{3,}/g, `
|
|
1097
1406
|
|
|
1098
1407
|
`).trim();
|
|
1099
1408
|
}
|
|
1100
|
-
function
|
|
1409
|
+
function En(e) {
|
|
1101
1410
|
if (typeof e != "string" || !e) return "";
|
|
1102
1411
|
let t = e.length;
|
|
1103
|
-
for (const r of
|
|
1412
|
+
for (const r of Fe) {
|
|
1104
1413
|
const o = e.search(r);
|
|
1105
1414
|
o >= 0 && o < t && (t = o);
|
|
1106
1415
|
}
|
|
1107
1416
|
const n = e.slice(0, t);
|
|
1108
|
-
let
|
|
1109
|
-
return
|
|
1417
|
+
let a = q(Y(W(n)));
|
|
1418
|
+
return a || (a = q(Y(W(e)))), We(a) || a;
|
|
1110
1419
|
}
|
|
1111
|
-
const
|
|
1112
|
-
function
|
|
1113
|
-
return !!(e &&
|
|
1420
|
+
const ze = /(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i, Ye = /\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;
|
|
1421
|
+
function _n(e, t) {
|
|
1422
|
+
return !!(e && ze.test(e) || t && Ye.test(t));
|
|
1114
1423
|
}
|
|
1115
|
-
const
|
|
1116
|
-
function
|
|
1117
|
-
return e >=
|
|
1424
|
+
const qe = 3, Je = 600;
|
|
1425
|
+
function Tn(e, t) {
|
|
1426
|
+
return e >= qe || t >= Je;
|
|
1118
1427
|
}
|
|
1119
|
-
const
|
|
1428
|
+
const Qe = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/jpg", "image/gif", "image/webp"]), Ze = /* @__PURE__ */ new Set([
|
|
1120
1429
|
"text/plain",
|
|
1121
1430
|
"text/markdown",
|
|
1122
1431
|
"text/csv",
|
|
@@ -1125,77 +1434,77 @@ const _e = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/jpg", "ima
|
|
|
1125
1434
|
"application/xml",
|
|
1126
1435
|
"text/xml"
|
|
1127
1436
|
]);
|
|
1128
|
-
function
|
|
1437
|
+
function et(e) {
|
|
1129
1438
|
const t = (e ?? "").trim().toLowerCase().split(";")[0];
|
|
1130
|
-
return t ?
|
|
1131
|
-
}
|
|
1132
|
-
const
|
|
1133
|
-
image: 5 *
|
|
1134
|
-
pdf: 20 *
|
|
1135
|
-
text: 1 *
|
|
1136
|
-
audio: 20 *
|
|
1137
|
-
},
|
|
1138
|
-
function
|
|
1139
|
-
const n =
|
|
1140
|
-
return n === "unsupported" ? "unsupported" : t >
|
|
1141
|
-
}
|
|
1142
|
-
function
|
|
1143
|
-
const n = new Set(e.disabledIntents ?? []),
|
|
1144
|
-
if (!e.extraIntents || e.extraIntents.length === 0) return
|
|
1145
|
-
const r = new Set(
|
|
1439
|
+
return t ? Qe.has(t) ? "image" : t === "application/pdf" ? "pdf" : Ze.has(t) ? "text" : t.startsWith("audio/") ? "audio" : "unsupported" : "unsupported";
|
|
1440
|
+
}
|
|
1441
|
+
const g = 1024 * 1024, tt = {
|
|
1442
|
+
image: 5 * g,
|
|
1443
|
+
pdf: 20 * g,
|
|
1444
|
+
text: 1 * g,
|
|
1445
|
+
audio: 20 * g
|
|
1446
|
+
}, In = 25 * g, Sn = 5;
|
|
1447
|
+
function Mn(e, t) {
|
|
1448
|
+
const n = et(e);
|
|
1449
|
+
return n === "unsupported" ? "unsupported" : t > tt[n] ? "too-large" : null;
|
|
1450
|
+
}
|
|
1451
|
+
function nt(e, t) {
|
|
1452
|
+
const n = new Set(e.disabledIntents ?? []), a = e.intentOverrides ?? {}, i = t.intents.filter((o) => !n.has(o.intent)).map((o) => at(o, a[o.intent]));
|
|
1453
|
+
if (!e.extraIntents || e.extraIntents.length === 0) return i;
|
|
1454
|
+
const r = new Set(i.map((o) => o.intent));
|
|
1146
1455
|
for (const o of e.extraIntents)
|
|
1147
|
-
r.has(o.intent) || (
|
|
1148
|
-
return
|
|
1456
|
+
r.has(o.intent) || (i.push(o), r.add(o.intent));
|
|
1457
|
+
return i;
|
|
1149
1458
|
}
|
|
1150
|
-
function
|
|
1459
|
+
function it(e, t) {
|
|
1151
1460
|
const n = {};
|
|
1152
|
-
for (const
|
|
1153
|
-
if (!
|
|
1154
|
-
const
|
|
1155
|
-
n[
|
|
1461
|
+
for (const a of e.intents) {
|
|
1462
|
+
if (!a.togglable) continue;
|
|
1463
|
+
const i = t?.[a.intent];
|
|
1464
|
+
n[a.intent] = i ?? a.defaultEnabled ?? !0;
|
|
1156
1465
|
}
|
|
1157
1466
|
return n;
|
|
1158
1467
|
}
|
|
1159
|
-
function
|
|
1160
|
-
const n =
|
|
1161
|
-
return Object.entries(n).filter(([,
|
|
1468
|
+
function Cn(e, t) {
|
|
1469
|
+
const n = it(e, t);
|
|
1470
|
+
return Object.entries(n).filter(([, a]) => !a).map(([a]) => a);
|
|
1162
1471
|
}
|
|
1163
|
-
function
|
|
1472
|
+
function at(e, t) {
|
|
1164
1473
|
return t ? {
|
|
1165
1474
|
intent: t.intent ?? e.intent,
|
|
1166
1475
|
targetSchemes: t.targetSchemes ?? e.targetSchemes,
|
|
1167
1476
|
transport: t.transport ?? e.transport
|
|
1168
1477
|
} : e;
|
|
1169
1478
|
}
|
|
1170
|
-
function
|
|
1479
|
+
function Nn(e, t) {
|
|
1171
1480
|
const n = [];
|
|
1172
|
-
for (const
|
|
1173
|
-
if (!
|
|
1174
|
-
const
|
|
1175
|
-
if (
|
|
1176
|
-
for (const r of
|
|
1177
|
-
n.push({ channel:
|
|
1481
|
+
for (const a of e) {
|
|
1482
|
+
if (!a.enabled) continue;
|
|
1483
|
+
const i = t[a.providerId];
|
|
1484
|
+
if (i)
|
|
1485
|
+
for (const r of nt(a, i))
|
|
1486
|
+
n.push({ channel: a, description: i, capability: r });
|
|
1178
1487
|
}
|
|
1179
1488
|
return n;
|
|
1180
1489
|
}
|
|
1181
|
-
function
|
|
1490
|
+
function vn(e, t) {
|
|
1182
1491
|
return t.filter((n) => n.capability.intent === e);
|
|
1183
1492
|
}
|
|
1184
|
-
function
|
|
1493
|
+
function rt(e, t) {
|
|
1185
1494
|
return t.filter((n) => n.capability.targetSchemes.includes(e));
|
|
1186
1495
|
}
|
|
1187
|
-
function
|
|
1188
|
-
return
|
|
1496
|
+
function kn(e, t) {
|
|
1497
|
+
return rt(e.scheme, t);
|
|
1189
1498
|
}
|
|
1190
|
-
function
|
|
1191
|
-
const
|
|
1192
|
-
for (const
|
|
1499
|
+
function xn(e, t, n) {
|
|
1500
|
+
const a = [];
|
|
1501
|
+
for (const i of e)
|
|
1193
1502
|
for (const r of n)
|
|
1194
|
-
r.capability.intent === t && r.capability.targetSchemes.includes(
|
|
1195
|
-
return
|
|
1503
|
+
r.capability.intent === t && r.capability.targetSchemes.includes(i.scheme) && a.push({ channelIntent: r, endpoint: i });
|
|
1504
|
+
return a;
|
|
1196
1505
|
}
|
|
1197
|
-
var
|
|
1198
|
-
const
|
|
1506
|
+
var ot = /* @__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))(ot || {});
|
|
1507
|
+
const st = {
|
|
1199
1508
|
mailto: "mail",
|
|
1200
1509
|
sip: "tel",
|
|
1201
1510
|
tel: "tel",
|
|
@@ -1217,10 +1526,10 @@ const ke = {
|
|
|
1217
1526
|
id: "note",
|
|
1218
1527
|
custom: "note"
|
|
1219
1528
|
};
|
|
1220
|
-
function
|
|
1221
|
-
return e ?
|
|
1529
|
+
function On(e) {
|
|
1530
|
+
return e ? st[e] ?? "note" : "note";
|
|
1222
1531
|
}
|
|
1223
|
-
const
|
|
1532
|
+
const Ln = "message_window", $n = "message_templates", Rn = {
|
|
1224
1533
|
// E-mail
|
|
1225
1534
|
FROM: "from",
|
|
1226
1535
|
TO: "to",
|
|
@@ -1237,118 +1546,149 @@ const Bt = "message_window", Ft = "message_templates", Xt = {
|
|
|
1237
1546
|
// Voice/conference
|
|
1238
1547
|
HOST: "host",
|
|
1239
1548
|
PARTICIPANT: "participant"
|
|
1240
|
-
},
|
|
1549
|
+
}, Dn = (e, t) => ({ intent: e, ...t }), wn = "folder_management", Un = "remote_search", Kn = { ok: !1, code: "UNSUPPORTED", message: "Provider does not support this op" }, lt = "auth";
|
|
1550
|
+
function ct(e) {
|
|
1551
|
+
const t = typeof e == "string" ? e.match(/apps\/([^/?#]+)/) : null;
|
|
1552
|
+
return t ? t[1] : null;
|
|
1553
|
+
}
|
|
1554
|
+
function Pn(e) {
|
|
1555
|
+
const t = ct(e);
|
|
1556
|
+
return t ? t !== lt : typeof e == "string" && e.startsWith("/wake");
|
|
1557
|
+
}
|
|
1558
|
+
const Gn = 9e4, Vn = "installation-id";
|
|
1241
1559
|
export {
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1560
|
+
f as ACTIVITY_CATALOG,
|
|
1561
|
+
tt as AI_ATTACHMENT_LIMITS,
|
|
1562
|
+
Sn as AI_ATTACHMENT_MAX_PER_TURN,
|
|
1563
|
+
In as AI_ATTACHMENT_TURN_BUDGET,
|
|
1564
|
+
ne as AI_VENDORS,
|
|
1565
|
+
Ee as ALLOWED_LINK_SCHEMES,
|
|
1566
|
+
D as ARTIFACT_MAX_BLOCKS,
|
|
1567
|
+
Lt as ARTIFACT_MAX_BODY_BYTES,
|
|
1568
|
+
M as ARTIFACT_MAX_CELL_LEN,
|
|
1569
|
+
P as ARTIFACT_MAX_KPI_ITEMS,
|
|
1570
|
+
w as ARTIFACT_MAX_LIST_ITEMS,
|
|
1571
|
+
K as ARTIFACT_MAX_TABLE_COLUMNS,
|
|
1572
|
+
U as ARTIFACT_MAX_TABLE_ROWS,
|
|
1573
|
+
Q as ARTIFACT_MAX_TEXT_LEN,
|
|
1574
|
+
lt as AUTH_APP_NAME,
|
|
1575
|
+
ue as ActivityTypeRegistry,
|
|
1576
|
+
St as BUILT_IN_ONLY,
|
|
1577
|
+
jt as CLASSIFY_VARS,
|
|
1578
|
+
vt as CORE_DIMENSIONS,
|
|
1579
|
+
ot as CommunicationScheme,
|
|
1580
|
+
pn as DEFAULT_MEMORY_BUDGET,
|
|
1581
|
+
De as DEFAULT_PHONE_REGION,
|
|
1582
|
+
wn as FEATURE_FOLDER_MANAGEMENT,
|
|
1583
|
+
Un as FEATURE_REMOTE_SEARCH,
|
|
1584
|
+
Vn as INSTALLATION_HEADER,
|
|
1585
|
+
Rn as InteractionParticipantRole,
|
|
1586
|
+
mt as MAX_ACTIONS,
|
|
1587
|
+
ut as MAX_BLOCKS,
|
|
1588
|
+
pt as MAX_FIELDS,
|
|
1589
|
+
dt as MAX_LIST_ITEMS,
|
|
1590
|
+
un as MAX_MEMORY_BUDGET,
|
|
1591
|
+
ln as MAX_MEMORY_CHARS,
|
|
1592
|
+
cn as MIN_MEMORY_BUDGET,
|
|
1593
|
+
Oe as PAUSED_RUN_STATUSES,
|
|
1594
|
+
v as PHONE_REGIONS,
|
|
1595
|
+
Gn as PRESENCE_ONLINE_WINDOW_MS,
|
|
1596
|
+
$n as PROVIDER_FEATURE_MESSAGE_TEMPLATES,
|
|
1597
|
+
Ln as PROVIDER_FEATURE_MESSAGE_WINDOW,
|
|
1598
|
+
je as PUBLIC_EMAIL_DOMAINS,
|
|
1599
|
+
Re as RELATED_SUBJECT_KINDS,
|
|
1600
|
+
Zt as SIGNATURE_INTENTS,
|
|
1601
|
+
Je as SUMMARY_MIN_LAST_CHARS,
|
|
1602
|
+
qe as SUMMARY_MIN_MESSAGES,
|
|
1603
|
+
xe as TERMINAL_RUN_STATUSES,
|
|
1604
|
+
Vt as TRIGGER_VARS,
|
|
1605
|
+
Kn as UNSUPPORTED,
|
|
1606
|
+
he as USAGE_DIMENSIONS,
|
|
1607
|
+
ye as USAGE_DIMENSION_IDS,
|
|
1608
|
+
ke as actingIdentityKey,
|
|
1609
|
+
gt as activityIconOf,
|
|
1610
|
+
It as activityJoinUrl,
|
|
1611
|
+
se as activitySnippet,
|
|
1612
|
+
le as activityTextParams,
|
|
1613
|
+
Tt as activityTimelineText,
|
|
1614
|
+
Nt as activityTimestamp,
|
|
1615
|
+
d as activityTypeInfo,
|
|
1616
|
+
Ft as actorKey,
|
|
1617
|
+
et as aiAttachmentKind,
|
|
1618
|
+
Mn as aiAttachmentRejection,
|
|
1619
|
+
Qt as aiVendorAcceptsAttachment,
|
|
1620
|
+
Yt as aiVendorDefaultModel,
|
|
1621
|
+
zt as aiVendorLabel,
|
|
1622
|
+
Jt as aiVendorNeedsBaseUrl,
|
|
1623
|
+
qt as aiVendorsWith,
|
|
1624
|
+
ct as appNameFromPath,
|
|
1625
|
+
en as applySignature,
|
|
1626
|
+
Rt as artifactBodyBytes,
|
|
1627
|
+
Dt as artifactOutline,
|
|
1628
|
+
wt as artifactToMarkdown,
|
|
1629
|
+
Mt as buildActivityPreview,
|
|
1630
|
+
Nn as buildChannelIntents,
|
|
1631
|
+
Ut as buildShareKeys,
|
|
1632
|
+
bt as carriesText,
|
|
1633
|
+
On as channelKindForScheme,
|
|
1634
|
+
ht as channelKindOf,
|
|
1635
|
+
En as cleanMessageText,
|
|
1636
|
+
Dn as defineIntent,
|
|
1637
|
+
Cn as disabledIntentsFromCapabilities,
|
|
1638
|
+
gn as emailDomain,
|
|
1639
|
+
An as endpointKey,
|
|
1640
|
+
kn as filterByEndpoint,
|
|
1641
|
+
vn as filterByIntent,
|
|
1642
|
+
rt as filterByTargetScheme,
|
|
1643
|
+
E as findAiVendor,
|
|
1644
|
+
kt as flattenLocales,
|
|
1645
|
+
me as floorToPeriod,
|
|
1646
|
+
ve as formatActingIdentity,
|
|
1647
|
+
de as formatPeriod,
|
|
1648
|
+
Ct as getActivitySeenUserIds,
|
|
1649
|
+
tn as getContactEndpoints,
|
|
1650
|
+
on as getShortTitle,
|
|
1651
|
+
rn as getUrgencyScore,
|
|
1652
|
+
Gt as humanizeAction,
|
|
1653
|
+
nn as isAssigned,
|
|
1654
|
+
an as isClosed,
|
|
1655
|
+
Pn as isDeepLink,
|
|
1656
|
+
sn as isInteractionUnseen,
|
|
1657
|
+
_n as isLikelyBulk,
|
|
1658
|
+
yt as isMessageType,
|
|
1659
|
+
Wt as isPaused,
|
|
1660
|
+
_t as isPlaybookAuthoredType,
|
|
1661
|
+
hn as isPublicEmailDomain,
|
|
1662
|
+
At as isReplyableType,
|
|
1663
|
+
Xt as isRetryable,
|
|
1664
|
+
Le as isTerminal,
|
|
1665
|
+
Tn as isThreadLongEnough,
|
|
1666
|
+
mn as looksLikeEmail,
|
|
1667
|
+
xn as matchContactToIntents,
|
|
1668
|
+
Et as messageCountsAs,
|
|
1669
|
+
yn as needsPhoneRegion,
|
|
1670
|
+
$t as normalizeArtifactBlocks,
|
|
1671
|
+
ft as normalizeBlocks,
|
|
1672
|
+
ie as normalizeEmail,
|
|
1673
|
+
Bt as parseActingIdentity,
|
|
1674
|
+
xt as periodsInRange,
|
|
1675
|
+
fn as phoneSuffix,
|
|
1676
|
+
bn as plainTextFromMarkdown,
|
|
1677
|
+
Ht as playbookActor,
|
|
1678
|
+
C as readPath,
|
|
1679
|
+
Ve as registrableDomain,
|
|
1680
|
+
dn as relatedByDefault,
|
|
1681
|
+
it as resolveAccountCapabilities,
|
|
1682
|
+
N as resolveActivityText,
|
|
1683
|
+
nt as resolveChannelIntents,
|
|
1684
|
+
$e as resolveSignature,
|
|
1685
|
+
Se as sanitizeInline,
|
|
1686
|
+
te as shareKeyForTeam,
|
|
1687
|
+
ee as shareKeyForUser,
|
|
1688
|
+
Kt as shareKeysForViewer,
|
|
1689
|
+
oe as stripHtml,
|
|
1690
|
+
F as toE164,
|
|
1691
|
+
Pt as toolSourceKinds,
|
|
1692
|
+
Ae as usageMetricId,
|
|
1693
|
+
Ot as usageMetrics
|
|
1354
1694
|
};
|