@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
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { Activity, ActivityType } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Eén plek die beschrijft wat een activity-type *betekent* en hoe het als tekst leest.
|
|
4
|
+
*
|
|
5
|
+
* Waarom dit bestaat: dezelfde vraag stond zes keer los in de codebase — "is dit een echt
|
|
6
|
+
* bericht?" in `summarize`, in `lastMessagePreview`, in `attentionScore`, in
|
|
7
|
+
* `reply-to-interaction`, in de analytics-rollup en in de playbook-dry-run, elke keer met
|
|
8
|
+
* nét een andere lijst. Een nieuw type moest dus op zes plekken worden bijgeschreven, en
|
|
9
|
+
* een vergeten plek faalt *stil*: het type verdwijnt uit de focus-score of uit de
|
|
10
|
+
* analytics zonder dat er iets kapotgaat.
|
|
11
|
+
*
|
|
12
|
+
* Daarnaast werd de kanaalsoort geraden uit het type-voorvoegsel (`startsWith("EMAIL")`),
|
|
13
|
+
* op de server én — als losse regex — in de playbook-editor.
|
|
14
|
+
*
|
|
15
|
+
* Deze catalogus is bewust een platte declaratie en geen gedragslaag: hij beantwoordt
|
|
16
|
+
* vragen over een type, hij voert niets uit. De tekstfuncties zijn letterlijk verplaatst
|
|
17
|
+
* uit `preview.ts` en `TimelineEvent.tsx`, niet herschreven — de uitvoer is byte-identiek.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Wat voor soort ding is dit op de tijdlijn?
|
|
21
|
+
*
|
|
22
|
+
* - `message` — een bericht van of aan de tegenpartij, met een leesbare body.
|
|
23
|
+
* - `note` — interne tekst, zichtbaar voor collega's maar niet voor de tegenpartij.
|
|
24
|
+
* - `artifact` — meegeleverde inhoud die geen bericht is (bestand, transcript).
|
|
25
|
+
* - `event` — een gebeurtenis zonder eigen inhoud (gesprek gestart, status gewijzigd).
|
|
26
|
+
*/
|
|
27
|
+
export type ActivityShape = "message" | "note" | "artifact" | "event";
|
|
28
|
+
/** Kanaalsoort, voorheen geraden uit het type-voorvoegsel. */
|
|
29
|
+
export type ActivityChannelKind = "mail" | "chat" | "voice" | "video";
|
|
30
|
+
/** De arm van de `Activity`-union die bij precies dit type hoort. */
|
|
31
|
+
type ActivityOf<T extends ActivityType> = Extract<Activity, {
|
|
32
|
+
type: T;
|
|
33
|
+
}>;
|
|
34
|
+
interface ActivityTypeInfo<T extends ActivityType = ActivityType> {
|
|
35
|
+
shape: ActivityShape;
|
|
36
|
+
channelKind?: ActivityChannelKind;
|
|
37
|
+
/** Lucide-icoonnaam, gedeeld door web en mobiel. */
|
|
38
|
+
icon: string;
|
|
39
|
+
/**
|
|
40
|
+
* Kan een mens hierop antwoorden? Een interne notitie draagt wél tekst maar is geen
|
|
41
|
+
* antwoordbaar bericht — daarom een eigen vlag en niet afgeleid van `shape`.
|
|
42
|
+
*/
|
|
43
|
+
replyable?: boolean;
|
|
44
|
+
/** Telt mee als in-/uitgaand bericht in de analytics-rollup. */
|
|
45
|
+
countsAs?: "inbound_message" | "outbound_message";
|
|
46
|
+
/**
|
|
47
|
+
* Draagt dit type door mensen geschreven tekst die de moeite waard is om aan een model
|
|
48
|
+
* te voeren? Ruimer dan `shape === "message"`: een transcript is een artifact maar wel
|
|
49
|
+
* leesbare inhoud.
|
|
50
|
+
*/
|
|
51
|
+
carriesText?: boolean;
|
|
52
|
+
/** Door de engine zelf geschreven; mag geen nieuwe playbook-run openen. */
|
|
53
|
+
playbookAuthored?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Verschijnt in de trigger-keuzelijst van playbooks en webhooks.
|
|
56
|
+
*
|
|
57
|
+
* Niet elk type is een zinnig startsignaal: op "gesprek in de wacht" wil niemand een
|
|
58
|
+
* playbook hangen. Dit zijn exact de vijf die de builder tot nu toe hardcodeerde, nu op
|
|
59
|
+
* de plek waar een app zijn eigen type er ook aan toe kan voegen.
|
|
60
|
+
*/
|
|
61
|
+
triggerable?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Vertaalsleutel voor de naam in een keuzelijst. Alleen nodig zodra een type
|
|
64
|
+
* {@link triggerable} is — pas dan moet iemand het bij naam kunnen kiezen.
|
|
65
|
+
*/
|
|
66
|
+
displayNameKey?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Eigen component voor de feed, als `"<app>:<Resource>"`.
|
|
69
|
+
*
|
|
70
|
+
* Bewust hetzelfde veld dat een externe app straks in zijn descriptor zet: onze eigen
|
|
71
|
+
* rijke types (mail, chat, notitie, ...) lopen daarmee door precies dezelfde resolver
|
|
72
|
+
* als een helpdesk-app die `helpdesk:TicketActivity` meebrengt. Zou dit een aparte
|
|
73
|
+
* lijst in de comms-app zijn, dan zou dat pad alleen door vreemde apps gedragen worden
|
|
74
|
+
* en zouden de gaten erin pas bij de eerste externe bouwer opvallen.
|
|
75
|
+
*
|
|
76
|
+
* Spiegelt `TransportConfig.ui.canvas`, dat op dezelfde manier naar
|
|
77
|
+
* `communication:CallCanvas` wijst.
|
|
78
|
+
*/
|
|
79
|
+
component?: `${string}:${string}`;
|
|
80
|
+
/** Regel voor de inboxlijst. Verplaatst uit `preview.ts`. */
|
|
81
|
+
snippet?: (activity: ActivityOf<T>) => string;
|
|
82
|
+
/** Regel voor de tijdlijn. Verplaatst uit `TimelineEvent.tsx`. */
|
|
83
|
+
timeline?: (activity: ActivityOf<T>, authorName: string) => string;
|
|
84
|
+
/** Deelnameknop op de tijdlijnregel. Verplaatst uit `TimelineEvent.tsx`. */
|
|
85
|
+
joinUrl?: (activity: ActivityOf<T>) => string | undefined;
|
|
86
|
+
}
|
|
87
|
+
export declare function stripHtml(input: string): string;
|
|
88
|
+
type Catalog = {
|
|
89
|
+
[T in ActivityType]: ActivityTypeInfo<T>;
|
|
90
|
+
};
|
|
91
|
+
export declare const ACTIVITY_CATALOG: Catalog;
|
|
92
|
+
/** Onbekende types (van een app die zijn type nog niet declareert) geven `undefined`. */
|
|
93
|
+
export declare function activityTypeInfo(type: string): ActivityTypeInfo | undefined;
|
|
94
|
+
/** Lucide-icoonnaam; `circle` voor onbekende types. */
|
|
95
|
+
export declare function activityIconOf(type: string): string;
|
|
96
|
+
/** `mail` | `chat` | `voice` | `video`, of `undefined` voor een levenscyclus-event. */
|
|
97
|
+
export declare function channelKindOf(type: string): ActivityChannelKind | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Draagt dit type een bericht of een interne notitie — iets wat een mens schreef en wat
|
|
100
|
+
* als "het gesprek" telt? Sluit transcripten uit; die zijn wel tekst, maar geen bericht.
|
|
101
|
+
*/
|
|
102
|
+
export declare function isMessageType(type: string): boolean;
|
|
103
|
+
/** Kan een mens hierop antwoorden? Notities niet — die gaan nergens heen. */
|
|
104
|
+
export declare function isReplyableType(type: string): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Leesbare inhoud voor een model: berichten, notities én transcripten. Ruimer dan
|
|
107
|
+
* {@link isMessageType}, en dat verschil is opzettelijk — zie de dry-run van playbooks.
|
|
108
|
+
*/
|
|
109
|
+
export declare function carriesText(type: string): boolean;
|
|
110
|
+
/** Telt mee als in- of uitgaand bericht in de analytics-rollup. */
|
|
111
|
+
export declare function messageCountsAs(type: string): "inbound_message" | "outbound_message" | undefined;
|
|
112
|
+
/** Door de playbook-engine zelf geschreven; mag geen nieuwe run openen. */
|
|
113
|
+
export declare function isPlaybookAuthoredType(type: string): boolean;
|
|
114
|
+
/** De inboxlijst-regel, of `""` wanneer het type er geen heeft. */
|
|
115
|
+
export declare function activitySnippet(activity: Activity): string;
|
|
116
|
+
/**
|
|
117
|
+
* De tijdlijnregel. Valt terug op het ontstreepte type — precies wat de feed vandaag doet
|
|
118
|
+
* voor elk type zonder eigen tekst.
|
|
119
|
+
*/
|
|
120
|
+
export declare function activityTimelineText(activity: Activity, authorName: string): string;
|
|
121
|
+
/** Deelnamelink op de tijdlijnregel, wanneer het type er een draagt. */
|
|
122
|
+
export declare function activityJoinUrl(activity: Activity): string | undefined;
|
|
123
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { LocaleBundle } from '../analytics/dashboard';
|
|
2
|
+
import { ActivityChannelKind, ActivityShape } from './catalog';
|
|
3
|
+
/**
|
|
4
|
+
* Wat een app over zijn eigen activity-soort declareert.
|
|
5
|
+
*
|
|
6
|
+
* Dit is de JSON-tegenhanger van `ActivityTypeInfo`: dezelfde vragen, maar over de draad.
|
|
7
|
+
* Waar de ingebouwde catalogus functies gebruikt voor zijn teksten, gebruikt een
|
|
8
|
+
* gedeclareerd type een vertaalsleutel plus parameters — een functie overleeft geen
|
|
9
|
+
* HTTP-hop, en een letterlijke zin is niet te vertalen.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Een stuk tekst in een descriptor.
|
|
13
|
+
*
|
|
14
|
+
* Twee vormen, omdat er twee soorten tekst zijn:
|
|
15
|
+
*
|
|
16
|
+
* - **chrome** — door de app geschreven ("Ticket #{number} aangemaakt"). Vertaalbaar, dus
|
|
17
|
+
* een sleutel met parameters. De plaatshouders staan ín de vertaalde zin, zodat de
|
|
18
|
+
* woordvolgorde per taal mag verschillen; zou je de tekst eromheen plakken, dan is dat
|
|
19
|
+
* precies wat er stukgaat.
|
|
20
|
+
* - **data** — door een mens getypt (het onderwerp van het ticket). Valt niets te
|
|
21
|
+
* vertalen, dus een pad naar de waarde in de activity.
|
|
22
|
+
*
|
|
23
|
+
* `format` bepaalt of de weergave de tekst als platte tekst neemt of door de rijke
|
|
24
|
+
* renderer haalt. Nooit geraden: het staat op het tekstobject zelf.
|
|
25
|
+
*/
|
|
26
|
+
export type ActivityText = string | {
|
|
27
|
+
key: string;
|
|
28
|
+
params?: Record<string, string>;
|
|
29
|
+
format?: "plain" | "rich";
|
|
30
|
+
} | {
|
|
31
|
+
value: string;
|
|
32
|
+
format?: "plain" | "rich";
|
|
33
|
+
};
|
|
34
|
+
export interface ActivityTypeDescriptor {
|
|
35
|
+
/** Plat en app-geprefixt, bv. `HELPDESK_TICKET_ADDED`. */
|
|
36
|
+
type: string;
|
|
37
|
+
/** Vertaalsleutel voor de naam van dit type (keuzelijsten, filters). */
|
|
38
|
+
displayNameKey: string;
|
|
39
|
+
/** Lucide-icoonnaam; werkt op web en native. */
|
|
40
|
+
icon?: string;
|
|
41
|
+
shape: ActivityShape;
|
|
42
|
+
channelKind?: ActivityChannelKind;
|
|
43
|
+
replyable?: boolean;
|
|
44
|
+
countsAs?: "inbound_message" | "outbound_message";
|
|
45
|
+
carriesText?: boolean;
|
|
46
|
+
/** Verschijnt in de trigger-keuzelijst van playbooks en webhooks. */
|
|
47
|
+
triggerable?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* De regel voor de inboxlijst, de zoekindex en de assistent. **Altijd platte tekst**,
|
|
50
|
+
* los van hoe de rij eruitziet: opmaak hier lekt naar plekken die geen opmaak kunnen.
|
|
51
|
+
*/
|
|
52
|
+
text?: ActivityText;
|
|
53
|
+
/** Eigen component voor de feed, `"<app>:<Resource>"`. Alleen web. */
|
|
54
|
+
component?: `${string}:${string}`;
|
|
55
|
+
}
|
|
56
|
+
/** Wat de comms-app aan de client teruggeeft: de gedeclareerde types plus hun vertalingen. */
|
|
57
|
+
export interface ActivityTypeCatalog {
|
|
58
|
+
types: ActivityTypeDescriptor[];
|
|
59
|
+
locales: LocaleBundle;
|
|
60
|
+
}
|
|
61
|
+
/** Wat een `activity-source` op `GET /provider/activity-types/describe` teruggeeft. */
|
|
62
|
+
export interface ActivityTypeSourceDescription {
|
|
63
|
+
types: ActivityTypeDescriptor[];
|
|
64
|
+
locales?: LocaleBundle;
|
|
65
|
+
}
|
|
66
|
+
/** Leest `payload.number` / `author.name` uit een object; geeft "" als het pad niet bestaat. */
|
|
67
|
+
export declare function readPath(source: unknown, path: string): string;
|
|
68
|
+
/**
|
|
69
|
+
* Lost een `ActivityText` op tegen een activity.
|
|
70
|
+
*
|
|
71
|
+
* Geeft `null` terug wanneer er niets te tonen is, zodat de aanroeper kan terugvallen in
|
|
72
|
+
* plaats van een lege regel te tekenen.
|
|
73
|
+
*/
|
|
74
|
+
export declare function resolveActivityText(text: ActivityText | undefined, activity: unknown, translate: (key: string, params?: Record<string, string>) => string): string | null;
|
|
75
|
+
/** De parameters die een `ActivityText` uit de activity leest — voor een opgeslagen preview. */
|
|
76
|
+
export declare function activityTextParams(text: ActivityText | undefined, activity: unknown): {
|
|
77
|
+
key: string;
|
|
78
|
+
params: Record<string, string>;
|
|
79
|
+
} | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { ActivityPreview } from '../interaction/types';
|
|
2
|
+
import { ActivityTypeDescriptor } from './descriptor';
|
|
2
3
|
import { Activity } from './types';
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* De regel die in de inboxlijst onder de afzender staat.
|
|
6
|
+
*
|
|
7
|
+
* De per-type tekst zelf staat in {@link ACTIVITY_CATALOG}, niet hier: dezelfde vraag
|
|
8
|
+
* werd op zes plekken los beantwoord en dreef uit elkaar. Hier blijft alleen wat écht
|
|
9
|
+
* over de *preview* gaat — de lengtegrens en de velden die op de interactie belanden.
|
|
10
|
+
*
|
|
11
|
+
* `descriptor` is er voor types die een app zelf meebracht. Die dragen een vertaalsleutel
|
|
12
|
+
* in plaats van een zin, en die sleutel wordt méé opgeslagen: de preview wordt eenmalig
|
|
13
|
+
* server-side berekend, maar elke lezer heeft zijn eigen taal.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildActivityPreview(activity: Activity, descriptor?: ActivityTypeDescriptor): ActivityPreview;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ActivityChannelKind, ActivityShape } from './catalog';
|
|
2
|
+
import { ActivityTypeDescriptor } from './descriptor';
|
|
3
|
+
import { Activity } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Eén antwoord over een activity-type, ongeacht of het van ons is of van een app.
|
|
6
|
+
*
|
|
7
|
+
* De ingebouwde catalogus en een gedeclareerde descriptor beschrijven hetzelfde, maar in
|
|
8
|
+
* een andere vorm: de eerste gebruikt functies (die geen HTTP-hop overleven), de tweede
|
|
9
|
+
* vertaalsleutels. Deze laag vlakt dat verschil af, zodat de feed, de inboxlijst en de
|
|
10
|
+
* playbook-builder niet elk hun eigen "is het van ons of niet?"-tak krijgen — precies de
|
|
11
|
+
* tweedeling die dit hele traject wilde vermijden.
|
|
12
|
+
*
|
|
13
|
+
* Ingebouwd wint bij een botsing. Een app die `EMAIL_RECEIVED` claimt kan de mailweergave
|
|
14
|
+
* dus niet kapen.
|
|
15
|
+
*/
|
|
16
|
+
export interface ResolvedActivityType {
|
|
17
|
+
type: string;
|
|
18
|
+
shape: ActivityShape;
|
|
19
|
+
channelKind?: ActivityChannelKind;
|
|
20
|
+
icon: string;
|
|
21
|
+
replyable: boolean;
|
|
22
|
+
countsAs?: "inbound_message" | "outbound_message";
|
|
23
|
+
carriesText: boolean;
|
|
24
|
+
triggerable: boolean;
|
|
25
|
+
component?: string;
|
|
26
|
+
/** True voor de 41 types die het platform zelf meebrengt. */
|
|
27
|
+
builtIn: boolean;
|
|
28
|
+
/** De sleutel voor de naam in keuzelijsten; aanwezig zodra een type triggerbaar is. */
|
|
29
|
+
displayNameKey?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Vertaalfunctie voor sleutels uit een meegeleverde locale-bundel. */
|
|
32
|
+
export type Translate = (key: string, params?: Record<string, string>) => string;
|
|
33
|
+
/**
|
|
34
|
+
* Een opzoeker over de ingebouwde types plus wat apps declareerden.
|
|
35
|
+
*
|
|
36
|
+
* Bewust een expliciet object en geen module-globale registry: op de server leeft elke
|
|
37
|
+
* request in zijn eigen module-instantie, dus een geregistreerde lijst zou daar nooit
|
|
38
|
+
* geraakt worden — en dat zou onzichtbaar zijn.
|
|
39
|
+
*/
|
|
40
|
+
export declare class ActivityTypeRegistry {
|
|
41
|
+
private readonly translate;
|
|
42
|
+
private readonly declared;
|
|
43
|
+
constructor(descriptors?: ActivityTypeDescriptor[], translate?: Translate);
|
|
44
|
+
get(type: string): ResolvedActivityType | undefined;
|
|
45
|
+
/** Alles wat als trigger aangeboden mag worden, ingebouwd en gedeclareerd. */
|
|
46
|
+
triggerable(): ResolvedActivityType[];
|
|
47
|
+
/**
|
|
48
|
+
* De tijdlijnregel. Ingebouwd komt uit de catalogus, gedeclareerd uit `text` + de
|
|
49
|
+
* meegeleverde vertaling. Zonder bruikbare tekst valt het terug op de ontstreepte
|
|
50
|
+
* typenaam — dezelfde regel die de feed altijd al toonde voor onbekende types.
|
|
51
|
+
*/
|
|
52
|
+
timelineText(activity: Activity, authorName: string): string;
|
|
53
|
+
/** De regel voor de inboxlijst. Leeg wanneer het type niets te tonen heeft. */
|
|
54
|
+
snippet(activity: Activity): string;
|
|
55
|
+
/** De descriptor zoals hij binnenkwam; nodig om `text` als sleutel op te slaan. */
|
|
56
|
+
descriptor(type: string): ActivityTypeDescriptor | undefined;
|
|
57
|
+
}
|
|
58
|
+
/** De lege registry: alleen de ingebouwde types. Voor code die (nog) geen catalogus laadt. */
|
|
59
|
+
export declare const BUILT_IN_ONLY: ActivityTypeRegistry;
|
|
@@ -2,11 +2,29 @@ import { InteractionParticipant } from '../../platform/communication';
|
|
|
2
2
|
import { ActivityType } from '../activity/types';
|
|
3
3
|
export interface ActivityPreview {
|
|
4
4
|
activityId: string;
|
|
5
|
-
type
|
|
5
|
+
/** Ook een door een app gedeclareerd type; de union houdt alleen de autocomplete. */
|
|
6
|
+
type: ActivityType | (string & {});
|
|
7
|
+
/**
|
|
8
|
+
* De regel zoals de server hem kon maken. Voor ingebouwde types is dit de tekst zelf;
|
|
9
|
+
* voor een gedeclareerd type de al opgeloste versie in de org-taal.
|
|
10
|
+
*
|
|
11
|
+
* Server-consumenten (zoek, assistent, analytics) hebben geen gebruikerstaal en lezen
|
|
12
|
+
* dit veld. De client geeft de voorkeur aan {@link snippetKey}.
|
|
13
|
+
*/
|
|
6
14
|
snippet: string;
|
|
7
15
|
authorName: string;
|
|
8
16
|
direction: "inbound" | "outbound" | "internal" | "none";
|
|
9
17
|
createdAt: number;
|
|
18
|
+
/**
|
|
19
|
+
* Vertaalsleutel plus al uitgelezen parameters, voor types die er een declareerden.
|
|
20
|
+
*
|
|
21
|
+
* De preview wordt éénmalig op de server berekend en opgeslagen, maar elke lezer heeft
|
|
22
|
+
* zijn eigen taal. Door de sleutel te bewaren in plaats van alleen de zin kan de
|
|
23
|
+
* inboxlijst hem in de taal van de kijker tekenen. (De ingebouwde snippets zijn nu nog
|
|
24
|
+
* hardcoded Nederlands — dezelfde constructie lost dat later op.)
|
|
25
|
+
*/
|
|
26
|
+
snippetKey?: string;
|
|
27
|
+
snippetParams?: Record<string, string>;
|
|
10
28
|
}
|
|
11
29
|
/** Query for the interaction search endpoint (POST /search/interaction). */
|
|
12
30
|
export interface InteractionSearchQuery {
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=140;function T(e){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()}function Y(e){const n=e.trim();return n.length<=m?n:n.slice(0,m-1).trimEnd()+"…"}function d(e){if(!e||e<0)return"";const n=Math.floor(e/60),t=Math.floor(e%60);return`${n}:${t.toString().padStart(2,"0")}`}function j(e){switch(e.type){case"EMAIL_RECEIVED":case"EMAIL_SENT":{const n=e.payload,t=n.bodySnippet?.trim()||T(n.body??"");return n.subject?`${n.subject} — ${t}`:t}case"CHAT_MESSAGE_SENT":case"CHAT_MESSAGE_RECEIVED":return e.payload.text??"";case"CHAT_RENAMED":return`Hernoemd naar "${e.payload.newName}"`;case"CHAT_MEMBER_JOINED":return`${e.payload.members.map(n=>n.name).join(", ")} toegevoegd`;case"CHAT_MEMBER_LEFT":return`${e.payload.members.map(n=>n.name).join(", ")} verlaten`;case"CHAT_CALL_STARTED":return"Gesprek gestart";case"CHAT_CALL_ENDED":return`Gesprek beëindigd${e.payload.duration?` (${d(e.payload.duration)})`:""}`;case"CHAT_EVENT":return e.payload.text??e.payload.eventType;case"VOICE_CALL_STARTED":case"VIDEO_CALL_STARTED":return"Gesprek gestart";case"VOICE_CALL_ANSWERED":case"VIDEO_CALL_ANSWERED":return"Gesprek aangenomen";case"VOICE_CALL_HOLD":case"VIDEO_CALL_HOLD":return"In de wacht";case"VOICE_CALL_UNHOLD":case"VIDEO_CALL_UNHOLD":return"Hervat";case"VOICE_CALL_ENDED":case"VIDEO_CALL_ENDED":return`Gesprek beëindigd${e.payload.duration?` (${d(e.payload.duration)})`:""}`;case"VOICE_CALL_MISSED":case"VIDEO_CALL_MISSED":return"Gemiste oproep";case"VOICE_CALL_FAILED":case"VIDEO_CALL_FAILED":return"Gesprek mislukt";case"VOICE_CALL_VOICEMAIL":return e.payload.transcription?.trim()?e.payload.transcription:"Voicemail ontvangen";case"TRANSCRIPT_ADDED":return(e.payload.segments??[]).map(n=>n.text).join(" ");case"AI_MESSAGE_ADDED":return e.payload.output?.text??e.payload.input?.text??"";case"AI_ACTION_PROPOSED":return`Voorstel wacht op goedkeuring (${e.payload.actions?.length??0} actie(s))`;case"PLAYBOOK_STARTED":return`Playbook gestart${e.payload.playbookName?`: ${e.payload.playbookName}`:""}`;case"PLAYBOOK_COMPLETED":return"Playbook afgerond";case"PLAYBOOK_ESCALATED":return"Playbook geëscaleerd naar een mens";case"MEETING_SCHEDULED":return`Vergadering gepland: ${e.payload.title}`;case"MEETING_STARTED":return`Vergadering gestart: ${e.payload.title}`;case"MEETING_ENDED":return`Vergadering beëindigd${e.payload.duration?` (${d(e.payload.duration)})`:""}`;case"MEETING_PARTICIPANT_JOINED":return`${e.payload.name} deelgenomen`;case"MEETING_PARTICIPANT_LEFT":return`${e.payload.name} verlaten`;case"COMMENT_ADDED":return e.payload.text??"";case"FILE_UPLOADED":return`Bestand: ${e.payload.fileName}`;case"INTERACTION_CREATED":return"Interactie aangemaakt";case"INTERACTION_STATUS_CHANGED":return`Status: ${e.payload.fromStatus} → ${e.payload.toStatus}`;case"INTERACTION_ASSIGNED":return"Interactie toegewezen";default:return""}}function K(e){return{activityId:e.id,type:e.type,snippet:Y(j(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now()}}function z(e,n,t=[]){const r=e.createdAt;if(!r)return[];const a=new Set(t);return e.author.type==="user"&&e.author.id&&a.add(e.author.id),Object.entries(n).filter(([i,o])=>o>=r&&!a.has(i)).map(([i])=>i)}function q(e){return e.createdAt??0}const X=[{id:"agent",label:"Agent",labelSource:"user"},{id:"team",label:"Team",labelSource:"team"},{id:"inbox",label:"Inbox",labelSource:"inbox"},{id:"channel",label:"Kanaal",labelSource:"channel"},{id:"provider",label:"Provider",labelSource:"raw"},{id:"status",label:"Status",labelSource:"raw"},{id:"handledBy",label:"Afhandelaar",labelSource:"raw"},{id:"time",label:"Tijd",labelSource:"raw"}];function J(e){const n=[];for(const t of Object.keys(e))for(const r of Object.keys(e[t]))n.push({lang:t,key:r,value:e[t][r]});return n}function p(e){return e<10?`0${e}`:`${e}`}function D(e,n){const t=new Date(e),r=`${t.getUTCFullYear()}-${p(t.getUTCMonth()+1)}-${p(t.getUTCDate())}`;return n==="day"?r:`${r}T${p(t.getUTCHours())}`}function h(e,n){const t=new Date(e);return t.setUTCMinutes(0,0,0),n==="day"&&t.setUTCHours(0),t.getTime()}const Q=36e5,Z=864e5;function ee(e,n,t){const r=t==="hour"?Q:Z,a=[];for(let i=h(e,t);i<=n;i+=r)a.push(D(i,t));return a}const N=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],R=N.map(e=>e.id);function O(e,n){return`${e}.usage.${n}`}function ne(e,n){return n.map(t=>({id:O(e,t.unit),label:t.label,category:"Verbruik",valueType:t.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...R,...t.extraDimensions??[],"time"]}))}function te(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const re=[{name:"text",type:"string"},{name:"subject",type:"string"},{name:"from",type:"string"},{name:"type",type:"string"},{name:"direction",type:"string"},{name:"channelId",type:"string"},{name:"interactionId",type:"string"},{name:"activityId",type:"string"},{name:"authorType",type:"string"},{name:"authorName",type:"string"},{name:"textRaw",type:"string"},{name:"fromStatus",type:"string"},{name:"toStatus",type:"string"},{name:"contactId",type:"string"},{name:"companyId",type:"string"}],ae={topics:[{name:"topic",type:"string"},{name:"confidence",type:"number"}],question:[{name:"answer",type:"boolean"},{name:"confidence",type:"number"}],extract:[]};function C(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function ie(e){if(typeof e!="string")return;const n=e.trim();if(n==="org")return{kind:"org"};const t=n.indexOf(":");if(t<=0)return;const r=n.slice(0,t),a=n.slice(t+1).trim();if(a){if(r==="user")return{kind:"user",userId:a};if(r==="team")return{kind:"team",teamId:a}}}function L(e){return C(e)}function oe(e){switch(e.kind){case"personal":return{kind:"user",userId:e.userId};case"team":return{kind:"team",teamId:e.teamId};case"org":return{kind:"org"}}}function se(e){return L(e)}const y=["done","escalated","failed","timed_out","stopped"],U=["awaiting_approval","awaiting_reply"];function P(e){return y.includes(e)}function le(e){return P(e)}function ce(e){return U.includes(e)}const f=[{id:"openai",label:"OpenAI",capabilities:["chat","transcription","embedding"],defaultModel:"gpt-5-mini",baseUrl:"https://api.openai.com/v1"},{id:"gemini",label:"Google Gemini",capabilities:["chat","transcription","embedding"],defaultModel:"gemini-3.5-flash",baseUrl:"https://generativelanguage.googleapis.com/v1beta"},{id:"anthropic",label:"Anthropic",capabilities:["chat"],defaultModel:"claude-haiku-4-5",baseUrl:"https://api.anthropic.com/v1"},{id:"elevenlabs",label:"ElevenLabs",capabilities:["transcription"],baseUrl:"https://api.elevenlabs.io/v1"},{id:"moonshot",label:"Moonshot (Kimi)",capabilities:["chat"],defaultModel:"kimi-k3",baseUrl:"https://api.moonshot.ai/v1"},{id:"deepseek",label:"DeepSeek",capabilities:["chat"],defaultModel:"deepseek-v4-flash",baseUrl:"https://api.deepseek.com/v1"},{id:"groq",label:"Groq",capabilities:["chat"],defaultModel:"openai/gpt-oss-120b",baseUrl:"https://api.groq.com/openai/v1"},{id:"mistral",label:"Mistral",capabilities:["chat"],defaultModel:"mistral-large-latest",baseUrl:"https://api.mistral.ai/v1"},{id:"openrouter",label:"OpenRouter",capabilities:["chat"],defaultModel:"openrouter/auto",baseUrl:"https://openrouter.ai/api/v1"},{id:"ollama",label:"Ollama (self-hosted)",capabilities:["chat"],defaultModel:"llama3.3"},{id:"openai-compatible",label:"OpenAI-compatible (eigen endpoint)",capabilities:["chat"],defaultModel:"default"}];function c(e){return f.find(n=>n.id===e)}function ue(e){return c(e)?.label??e}function de(e,n="gpt-5-mini"){return c(e)?.defaultModel??n}function pe(e){return f.filter(n=>n.capabilities.includes(e))}function Ee(e){const n=c(e);return!!n&&!n.baseUrl}const fe=new Set(["mail","message"]);function k(e,n){const t=e.settings?.signatures?.[n];return!t||!t.enabled||!t.body||t.body.trim()===""?null:t}function ge(e,n,t,r="html"){if(!e)return t;const a=k(e,n);return a?`${t}${r==="text"?`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function k(e){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()}function p(e){if(!e||e<0)return"";const n=Math.floor(e/60),t=Math.floor(e%60);return`${n}:${t.toString().padStart(2,"0")}`}function _(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function y(e){return e?.split("@")?.[0]||e||""}function u(e){return e.map(n=>n.name).join(", ")}function T(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const s={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${y(e.payload.from)}`:`Outbound call started — ${y(e.payload.to)}`},VOICE_CALL_ANSWERED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek aangenomen",timeline:(e,n)=>`Call answered — ${n}`},VOICE_CALL_HOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"In de wacht",timeline:(e,n)=>`Call on hold — ${n}`},VOICE_CALL_UNHOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Hervat"},VOICE_CALL_ENDED:{shape:"event",channelKind:"voice",icon:"phone",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${p(e.payload.duration)})`:""}`,timeline:e=>`Call ended${_(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${y(e.payload.from)}`},VOICE_CALL_FAILED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek mislukt",timeline:()=>"Call failed"},VOICE_CALL_VOICEMAIL:{shape:"artifact",channelKind:"voice",icon:"phone",snippet:e=>e.payload.transcription?.trim()?e.payload.transcription:"Voicemail ontvangen"},VIDEO_CALL_STARTED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek gestart",timeline:()=>"Video call started"},VIDEO_CALL_ANSWERED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek aangenomen",timeline:()=>"Video call answered"},VIDEO_CALL_HOLD:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"In de wacht"},VIDEO_CALL_UNHOLD:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Hervat"},VIDEO_CALL_ENDED:{shape:"event",channelKind:"video",icon:"video",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${p(e.payload.duration)})`:""}`,timeline:()=>"Video call ended"},VIDEO_CALL_MISSED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gemiste oproep",timeline:()=>"Missed video call"},VIDEO_CALL_FAILED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek mislukt",timeline:()=>"Video call failed"},EMAIL_RECEIVED:{shape:"message",triggerable:!0,displayNameKey:"communication:activity.EMAIL_RECEIVED",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"inbound_message",snippet:S},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:S},CHAT_MESSAGE_SENT:{shape:"message",component:"communication:ChatMessage",channelKind:"chat",icon:"message-circle",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:e=>e.payload.text??""},CHAT_MESSAGE_RECEIVED:{shape:"message",triggerable:!0,displayNameKey:"communication:activity.CHAT_MESSAGE_RECEIVED",component:"communication:ChatMessage",channelKind:"chat",icon:"message-circle",replyable:!0,carriesText:!0,countsAs:"inbound_message",snippet:e=>e.payload.text??""},CHAT_MEMBER_JOINED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`${u(e.payload.members)} toegevoegd`,timeline:e=>{const n=u(e.payload.members)||"Someone",t=e.payload.initiator?.name?` · added by ${e.payload.initiator.name}`:"";return`${n} joined the chat${t}`}},CHAT_MEMBER_LEFT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`${u(e.payload.members)} verlaten`,timeline:e=>{const n=u(e.payload.members)||"Someone",t=e.payload.initiator?.name?` · removed by ${e.payload.initiator.name}`:"";return`${n} left the chat${t}`}},CHAT_RENAMED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`Hernoemd naar "${e.payload.newName}"`,timeline:e=>`Chat renamed to "${e.payload.newName}"${e.payload.initiator?` by ${e.payload.initiator.name}`:""}`},CHAT_CALL_STARTED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:()=>"Gesprek gestart",timeline:e=>`${T(e.payload.callType)} started${e.payload.initiator?` by ${e.payload.initiator.name}`:""}`,joinUrl:e=>e.payload.joinUrl},CHAT_CALL_ENDED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${p(e.payload.duration)})`:""}`,timeline:e=>`${T(e.payload.callType)} ended${_(e.payload.duration)}`,joinUrl:e=>e.payload.joinUrl},CHAT_EVENT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>e.payload.text??e.payload.eventType,timeline:e=>e.payload.text||e.payload.eventType},TRANSCRIPT_ADDED:{shape:"artifact",triggerable:!0,displayNameKey:"communication:activity.TRANSCRIPT_ADDED",component:"communication:TranscriptionActivity",icon:"captions",carriesText:!0,snippet:e=>(e.payload.segments??[]).map(n=>n.text).join(" ")},COMMENT_ADDED:{shape:"note",component:"communication:CommentActivity",icon:"sticky-note",carriesText:!0,snippet:e=>e.payload.text??""},FILE_UPLOADED:{shape:"artifact",component:"communication:FileActivity",icon:"paperclip",snippet:e=>`Bestand: ${e.payload.fileName}`},AI_MESSAGE_ADDED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.AI_MESSAGE_ADDED",icon:"circle",snippet:e=>e.payload.output?.text??e.payload.input?.text??"",timeline:()=>"AI message added"},AI_ACTION_PROPOSED:{shape:"event",component:"communication:ProposedActionCard",icon:"circle",playbookAuthored:!0,snippet:e=>`Voorstel wacht op goedkeuring (${e.payload.actions?.length??0} actie(s))`},PLAYBOOK_STARTED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:e=>`Playbook gestart${e.payload.playbookName?`: ${e.payload.playbookName}`:""}`,timeline:e=>`Playbook gestart${e.payload.playbookName?` — ${e.payload.playbookName}`:""}`},PLAYBOOK_COMPLETED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:()=>"Playbook afgerond",timeline:()=>"Playbook afgerond"},PLAYBOOK_ESCALATED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:()=>"Playbook geëscaleerd naar een mens",timeline:()=>"Playbook geëscaleerd naar een mens"},MEETING_SCHEDULED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering gepland: ${e.payload.title}`,timeline:()=>"Meeting scheduled",joinUrl:e=>e.payload.joinUrl},MEETING_STARTED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering gestart: ${e.payload.title}`,timeline:()=>"Meeting started",joinUrl:e=>e.payload.joinUrl},MEETING_ENDED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering beëindigd${e.payload.duration?` (${p(e.payload.duration)})`:""}`,timeline:()=>"Meeting ended"},MEETING_PARTICIPANT_JOINED:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} deelgenomen`,timeline:(e,n)=>`${n} joined the meeting`},MEETING_PARTICIPANT_LEFT:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} verlaten`,timeline:(e,n)=>`${n} left the meeting`},INTERACTION_CREATED:{shape:"event",icon:"circle",snippet:()=>"Interactie aangemaakt",timeline:(e,n)=>`Interaction started by ${n}`},INTERACTION_STATUS_CHANGED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.INTERACTION_STATUS_CHANGED",icon:"circle-dot",snippet:e=>`Status: ${e.payload.fromStatus} → ${e.payload.toStatus}`,timeline:(e,n)=>`Status changed to ${e.payload.toStatus} by ${n}`},INTERACTION_ASSIGNED:{shape:"event",icon:"user",snippet:()=>"Interactie toegewezen",timeline:(e,n)=>`Assigned by ${n}`}};function S(e){const n=e.payload,t=n.bodySnippet?.trim()||k(n.body??"");return n.subject?`${n.subject} — ${t}`:t}function l(e){return s[e]}function re(e){return l(e)?.icon??"circle"}function oe(e){return l(e)?.channelKind}function le(e){const n=l(e)?.shape;return n==="message"||n==="note"}function se(e){return l(e)?.replyable===!0}function ce(e){return l(e)?.carriesText===!0}function pe(e){return l(e)?.countsAs}function ue(e){return l(e)?.playbookAuthored===!0}function $(e){const n=l(e.type)?.snippet;return n?n(e):""}function de(e,n){const t=l(e.type)?.timeline;return t?t(e,n):e.type.replace(/_/g," ").toLowerCase()}function me(e){const n=l(e.type)?.joinUrl;return n?n(e):void 0}function m(e,n){let t=e;for(const i of n.split(".")){if(t==null||typeof t!="object")return"";t=t[i]}return t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):""}function f(e,n,t){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return m(n,e.value)||null;const i={};for(const[r,o]of Object.entries(e.params??{}))i[r]=m(n,o);const a=t(e.key,i);return a===e.key?null:a}function P(e,n){if(!e||typeof e=="string"||"value"in e)return null;const t={};for(const[i,a]of Object.entries(e.params??{}))t[i]=m(n,a);return{key:e.key,params:t}}const fe=e=>e;function M(e){const n=s[e];return{type:e,shape:n.shape,channelKind:n.channelKind,icon:n.icon,replyable:n.replyable===!0,countsAs:n.countsAs,carriesText:n.carriesText===!0,triggerable:n.triggerable===!0,component:n.component,builtIn:!0,displayNameKey:n.displayNameKey}}function N(e){return{type:e.type,shape:e.shape,channelKind:e.channelKind,icon:e.icon||"circle",replyable:e.replyable===!0,countsAs:e.countsAs,carriesText:e.carriesText===!0,triggerable:e.triggerable===!0,component:e.component,builtIn:!1,displayNameKey:e.displayNameKey}}class x{constructor(n=[],t=fe){this.translate=t;for(const i of n)i?.type&&(i.type in s||this.declared.has(i.type)||this.declared.set(i.type,i))}declared=new Map;get(n){if(n in s)return M(n);const t=this.declared.get(n);return t?N(t):void 0}triggerable(){const n=Object.keys(s).filter(i=>s[i].triggerable).map(M),t=[...this.declared.values()].map(N).filter(i=>i.triggerable);return[...n,...t]}timelineText(n,t){const i=s[n.type];if(i?.timeline)return i.timeline(n,t);const a=this.declared.get(n.type);return f(a?.text,n,this.translate)??n.type.replace(/_/g," ").toLowerCase()}snippet(n){const t=s[n.type];if(t?.snippet)return t.snippet(n);const i=this.declared.get(n.type);return f(i?.text,n,this.translate)??""}descriptor(n){return this.declared.get(n)}}const ge=new x,C=140;function Ee(e){const n=e.trim();return n.length<=C?n:n.slice(0,C-1).trimEnd()+"…"}function ye(e,n){const t=P(n?.text,e),i=n?f(n.text,e,a=>a):null;return{activityId:e.id,type:e.type,snippet:Ee(i??$(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...t?{snippetKey:t.key,snippetParams:t.params}:{}}}function he(e,n,t=[]){const i=e.createdAt;if(!i)return[];const a=new Set(t);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)}function Ae(e){return e.createdAt??0}const be=[{id:"agent",label:"Agent",labelSource:"user"},{id:"team",label:"Team",labelSource:"team"},{id:"inbox",label:"Inbox",labelSource:"inbox"},{id:"channel",label:"Kanaal",labelSource:"channel"},{id:"provider",label:"Provider",labelSource:"raw"},{id:"status",label:"Status",labelSource:"raw"},{id:"handledBy",label:"Afhandelaar",labelSource:"raw"},{id:"time",label:"Tijd",labelSource:"raw"}];function Ie(e){const n=[];for(const t of Object.keys(e))for(const i of Object.keys(e[t]))n.push({lang:t,key:i,value:e[t][i]});return n}function h(e){return e<10?`0${e}`:`${e}`}function G(e,n){const t=new Date(e),i=`${t.getUTCFullYear()}-${h(t.getUTCMonth()+1)}-${h(t.getUTCDate())}`;return n==="day"?i:`${i}T${h(t.getUTCHours())}`}function K(e,n){const t=new Date(e);return t.setUTCMinutes(0,0,0),n==="day"&&t.setUTCHours(0),t.getTime()}const _e=36e5,Te=864e5;function Se(e,n,t){const i=t==="hour"?_e:Te,a=[];for(let r=K(e,t);r<=n;r+=i)a.push(G(r,t));return a}const V=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],w=V.map(e=>e.id);function B(e,n){return`${e}.usage.${n}`}function Me(e,n){return n.map(t=>({id:B(e,t.unit),label:t.label,category:"Verbruik",valueType:t.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...w,...t.extraDimensions??[],"time"]}))}function Ne(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const Ce=[{name:"text",type:"string"},{name:"subject",type:"string"},{name:"from",type:"string"},{name:"type",type:"string"},{name:"direction",type:"string"},{name:"channelId",type:"string"},{name:"interactionId",type:"string"},{name:"activityId",type:"string"},{name:"authorType",type:"string"},{name:"authorName",type:"string"},{name:"textRaw",type:"string"},{name:"fromStatus",type:"string"},{name:"toStatus",type:"string"},{name:"contactId",type:"string"},{name:"companyId",type:"string"}],ve={topics:[{name:"topic",type:"string"},{name:"confidence",type:"number"}],question:[{name:"answer",type:"boolean"},{name:"confidence",type:"number"}],extract:[]};function H(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function De(e){if(typeof e!="string")return;const n=e.trim();if(n==="org")return{kind:"org"};const t=n.indexOf(":");if(t<=0)return;const i=n.slice(0,t),a=n.slice(t+1).trim();if(a){if(i==="user")return{kind:"user",userId:a};if(i==="team")return{kind:"team",teamId:a}}}function j(e){return H(e)}function Oe(e){switch(e.kind){case"personal":return{kind:"user",userId:e.userId};case"team":return{kind:"team",teamId:e.teamId};case"org":return{kind:"org"}}}function Re(e){return j(e)}const F=["done","escalated","failed","timed_out","stopped"],W=["awaiting_approval","awaiting_reply"];function Y(e){return F.includes(e)}function Le(e){return Y(e)}function Ue(e){return W.includes(e)}const b=[{id:"openai",label:"OpenAI",capabilities:["chat","transcription","embedding"],defaultModel:"gpt-5-mini",baseUrl:"https://api.openai.com/v1"},{id:"gemini",label:"Google Gemini",capabilities:["chat","transcription","embedding"],defaultModel:"gemini-3.5-flash",baseUrl:"https://generativelanguage.googleapis.com/v1beta"},{id:"anthropic",label:"Anthropic",capabilities:["chat"],defaultModel:"claude-haiku-4-5",baseUrl:"https://api.anthropic.com/v1"},{id:"elevenlabs",label:"ElevenLabs",capabilities:["transcription"],baseUrl:"https://api.elevenlabs.io/v1"},{id:"moonshot",label:"Moonshot (Kimi)",capabilities:["chat"],defaultModel:"kimi-k3",baseUrl:"https://api.moonshot.ai/v1"},{id:"deepseek",label:"DeepSeek",capabilities:["chat"],defaultModel:"deepseek-v4-flash",baseUrl:"https://api.deepseek.com/v1"},{id:"groq",label:"Groq",capabilities:["chat"],defaultModel:"openai/gpt-oss-120b",baseUrl:"https://api.groq.com/openai/v1"},{id:"mistral",label:"Mistral",capabilities:["chat"],defaultModel:"mistral-large-latest",baseUrl:"https://api.mistral.ai/v1"},{id:"openrouter",label:"OpenRouter",capabilities:["chat"],defaultModel:"openrouter/auto",baseUrl:"https://openrouter.ai/api/v1"},{id:"ollama",label:"Ollama (self-hosted)",capabilities:["chat"],defaultModel:"llama3.3"},{id:"openai-compatible",label:"OpenAI-compatible (eigen endpoint)",capabilities:["chat"],defaultModel:"default"}];function g(e){return b.find(n=>n.id===e)}function ke(e){return g(e)?.label??e}function $e(e,n="gpt-5-mini"){return g(e)?.defaultModel??n}function Pe(e){return b.filter(n=>n.capabilities.includes(e))}function xe(e){const n=g(e);return!!n&&!n.baseUrl}const Ge=new Set(["mail","message"]);function z(e,n){const t=e.settings?.signatures?.[n];return!t||!t.enabled||!t.body||t.body.trim()===""?null:t}function Ke(e,n,t,i="html"){if(!e)return t;const a=z(e,n);return a?`${t}${i==="text"?`
|
|
2
2
|
|
|
3
|
-
`:n==="mail"?"<br><br>-- <br>":"<br><br>"}${a.body}`:t}function
|
|
4
|
-
`);for(let t=0;t<n.length;t++)if(
|
|
5
|
-
`).trim();return e}function
|
|
3
|
+
`:n==="mail"?"<br><br>-- <br>":"<br><br>"}${a.body}`:t}function Ve(e){return e.endpoints??[]}const we=e=>!!e.assignedUserId||!!e.assignedInboxId,Be=e=>e.status==="closed",He=e=>({urgent:10,high:5,normal:2,low:1})[e.priority]||0,je=(e,n=30)=>e.title?.length<=n?e.title:`${e.title.substring(0,n)}...`;function Fe(e,n){return e.lastActivityAt?!(e.seenBy??[]).includes(n):!1}const We=2e3,Ye=500,ze=12e3,qe=4e3,q=["contact","company"];function Xe(e){if(!e)return!1;const n=e.slice(0,e.indexOf(":"));return q.includes(n)}const E={NL:{callingCode:"31",trunkPrefix:"0",nsnMin:7,nsnMax:9},BE:{callingCode:"32",trunkPrefix:"0",nsnMin:8,nsnMax:9},LU:{callingCode:"352",nsnMin:6,nsnMax:9},DE:{callingCode:"49",trunkPrefix:"0",nsnMin:6,nsnMax:13},FR:{callingCode:"33",trunkPrefix:"0",nsnMin:9,nsnMax:9},GB:{callingCode:"44",trunkPrefix:"0",nsnMin:9,nsnMax:10},IE:{callingCode:"353",trunkPrefix:"0",nsnMin:7,nsnMax:9},ES:{callingCode:"34",nsnMin:9,nsnMax:9},PT:{callingCode:"351",nsnMin:9,nsnMax:9},IT:{callingCode:"39",nsnMin:6,nsnMax:11},AT:{callingCode:"43",trunkPrefix:"0",nsnMin:7,nsnMax:13},CH:{callingCode:"41",trunkPrefix:"0",nsnMin:9,nsnMax:9},DK:{callingCode:"45",nsnMin:8,nsnMax:8},SE:{callingCode:"46",trunkPrefix:"0",nsnMin:7,nsnMax:13},NO:{callingCode:"47",nsnMin:8,nsnMax:8},FI:{callingCode:"358",trunkPrefix:"0",nsnMin:5,nsnMax:12},PL:{callingCode:"48",nsnMin:9,nsnMax:9},US:{callingCode:"1",nsnMin:10,nsnMax:10},CA:{callingCode:"1",nsnMin:10,nsnMax:10}},X="NL",Je=15,Qe=8,Ze=Array.from(new Set(Object.values(E).map(e=>e.callingCode))).sort((e,n)=>n.length-e.length);function v(e){if(e)return E[e.trim().toUpperCase()]}function d(e,n){return e.length>=n.nsnMin&&e.length<=n.nsnMax}function D(e){if(e.length>Je)return null;for(const n of Ze){if(!e.startsWith(n))continue;const t=e.slice(n.length);for(const i of Object.values(E)){if(i.callingCode!==n)continue;const a=i.trunkPrefix,r=a&&t.startsWith(a)?t.slice(a.length):t;if(d(r,i))return`+${n}${r}`}return null}return e.length<Qe?null:`+${e}`}function en(e){let n=e.trim();const t=n.match(/^(sips?|tel|whatsapp):/i);t&&(n=n.slice(t[0].length));const i=n.indexOf("@");return i>=0&&(n=n.slice(0,i)),n.trim()}function nn(e){if(!e)return!1;const n=e.indexOf("@");if(n<=0)return!1;const t=e.slice(0,n).trim();return!/^[+\d\s().-]+$/.test(t)}function A(e,n){if(!e)return null;const t=en(e);if(!t)return null;const i=t.startsWith("+"),a=t.replace(/\D/g,"");if(!a)return null;if(i)return D(a);if(a.startsWith("00"))return D(a.slice(2));const r=v(n)??v(X);if(!r)return null;const o=r.trunkPrefix;if(o&&a.startsWith(o)){const c=a.slice(o.length);return d(c,r)?`+${r.callingCode}${c}`:null}if(a.startsWith(r.callingCode)){const c=a.slice(r.callingCode.length);if(d(c,r))return`+${r.callingCode}${c}`}return!o&&d(a,r)?`+${r.callingCode}${a}`:null}function tn(e,n=9){const t=(e??"").replace(/\D/g,"");return t.length<n?null:t.slice(-n)}function I(e){if(!e)return null;const n=e.trim().toLowerCase(),t=n.lastIndexOf("@");if(t<=0||t===n.length-1)return null;const i=n.slice(0,t).split("+")[0],a=n.slice(t+1);return!i||!a.includes(".")?null:`${i}@${a}`}function an(e){const n=I(e);return n?n.slice(n.lastIndexOf("@")+1):null}const rn=new Set(["co.uk","org.uk","gov.uk","ac.uk","com.au","co.nz","com.br","co.za"]);function J(e){if(!e)return null;const n=e.trim().toLowerCase().replace(/\.$/,"").split(".").filter(Boolean);if(n.length<2)return null;const t=n.slice(-2).join(".");return rn.has(t)&&n.length>=3?n.slice(-3).join("."):t}const Q=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","hotmail.nl","hotmail.be","hotmail.co.uk","live.com","live.nl","live.be","msn.com","yahoo.com","yahoo.co.uk","ymail.com","icloud.com","me.com","mac.com","aol.com","gmx.net","gmx.de","web.de","protonmail.com","proton.me","pm.me","tutanota.com","zoho.com","mail.com","ziggo.nl","kpnmail.nl","planet.nl","home.nl","casema.nl","chello.nl","xs4all.nl","telfort.nl","hetnet.nl","zonnet.nl","upcmail.nl","quicknet.nl","telenet.be","skynet.be","proximus.be","scarlet.be"]);function on(e){const n=J(e);return n?Q.has(n):!1}function ln(e){if(!e)return!1;const n=e.trim().toLowerCase();return n==="tel"||n==="sms"||n==="whatsapp"||n==="fax"}function sn(e,n,t){if(!e||!n)return null;const i=e.trim().toLowerCase();if(i==="tel"||i==="sms"||i==="whatsapp"){const r=A(n,t);return r?`tel:${r}`:null}if(i==="fax"){const r=A(n,t);return r?`fax:${r}`:null}if(i==="mailto"||i==="email"){const r=I(n);return r?`mailto:${r}`:null}const a=n.trim().toLowerCase();return a?`${i}:${a}`:null}const cn=[/<blockquote/i,/class="?gmail_quote/i,/id="?[^"]*divRplyFwdMsg/i,/id="?[^"]*mail-editor-reference-message-container/i,/-{3,}\s*Original Message\s*-{3,}/i,/\n_{5,}\s*\n/,/\bOn\b[\s\S]{0,200}?\bwrote:/i],O=/^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i,pn=/^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;function un(e){const n=e.split(`
|
|
4
|
+
`);for(let t=0;t<n.length;t++)if(pn.test(n[t])||O.test(n[t])&&n.slice(t+1,t+4).some(i=>O.test(i)))return n.slice(0,t).join(`
|
|
5
|
+
`).trim();return e}function R(e){let n=e;return n=n.replace(/<(script|style)[\s\S]*?<\/\1>/gi,""),n=n.replace(/<br\s*\/?>/gi,`
|
|
6
6
|
`),n=n.replace(/<\/(p|div|li|tr|h[1-6]|ul|ol|table)>/gi,`
|
|
7
|
-
`),n=n.replace(/<[^>]+>/g,""),n=n.replace(/<[^>]*$/,""),n}function
|
|
7
|
+
`),n=n.replace(/<[^>]+>/g,""),n=n.replace(/<[^>]*$/,""),n}function L(e){return e.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&#(\d+);/g,(n,t)=>String.fromCharCode(Number(t))).replace(/&/gi,"&")}function U(e){return e.replace(/\r/g,"").replace(/[ \t]+/g," ").replace(/ *\n */g,`
|
|
8
8
|
`).replace(/\n{3,}/g,`
|
|
9
9
|
|
|
10
|
-
`).trim()}function
|
|
10
|
+
`).trim()}function dn(e){if(typeof e!="string"||!e)return"";let n=e.length;for(const r of cn){const o=e.search(r);o>=0&&o<n&&(n=o)}const t=e.slice(0,n);let i=U(L(R(t)));return i||(i=U(L(R(e)))),un(i)||i}const mn=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,fn=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function gn(e,n){return!!(e&&mn.test(e)||n&&fn.test(n))}const Z=3,ee=600;function En(e,n){return e>=Z||n>=ee}function ne(e,n){const t=new Set(e.disabledIntents??[]),i=e.intentOverrides??{},a=n.intents.filter(o=>!t.has(o.intent)).map(o=>hn(o,i[o.intent]));if(!e.extraIntents||e.extraIntents.length===0)return a;const r=new Set(a.map(o=>o.intent));for(const o of e.extraIntents)r.has(o.intent)||(a.push(o),r.add(o.intent));return a}function te(e,n){const t={};for(const i of e.intents){if(!i.togglable)continue;const a=n?.[i.intent];t[i.intent]=a??i.defaultEnabled??!0}return t}function yn(e,n){const t=te(e,n);return Object.entries(t).filter(([,i])=>!i).map(([i])=>i)}function hn(e,n){return n?{intent:n.intent??e.intent,targetSchemes:n.targetSchemes??e.targetSchemes,transport:n.transport??e.transport}:e}function An(e,n){const t=[];for(const i of e){if(!i.enabled)continue;const a=n[i.providerId];if(a)for(const r of ne(i,a))t.push({channel:i,description:a,capability:r})}return t}function bn(e,n){return n.filter(t=>t.capability.intent===e)}function ie(e,n){return n.filter(t=>t.capability.targetSchemes.includes(e))}function In(e,n){return ie(e.scheme,n)}function _n(e,n,t){const i=[];for(const a of e)for(const r of t)r.capability.intent===n&&r.capability.targetSchemes.includes(a.scheme)&&i.push({channelIntent:r,endpoint:a});return i}var ae=(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))(ae||{});const Tn="message_window",Sn="message_templates",Mn={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},Nn=(e,n)=>({intent:e,...n}),Cn="folder_management",vn="remote_search",Dn={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},On=9e4,Rn="installation-id";exports.ACTIVITY_CATALOG=s;exports.AI_VENDORS=b;exports.ActivityTypeRegistry=x;exports.BUILT_IN_ONLY=ge;exports.CLASSIFY_VARS=ve;exports.CORE_DIMENSIONS=be;exports.CommunicationScheme=ae;exports.DEFAULT_MEMORY_BUDGET=qe;exports.DEFAULT_PHONE_REGION=X;exports.FEATURE_FOLDER_MANAGEMENT=Cn;exports.FEATURE_REMOTE_SEARCH=vn;exports.INSTALLATION_HEADER=Rn;exports.InteractionParticipantRole=Mn;exports.MAX_MEMORY_BUDGET=ze;exports.MAX_MEMORY_CHARS=We;exports.MIN_MEMORY_BUDGET=Ye;exports.PAUSED_RUN_STATUSES=W;exports.PHONE_REGIONS=E;exports.PRESENCE_ONLINE_WINDOW_MS=On;exports.PROVIDER_FEATURE_MESSAGE_TEMPLATES=Sn;exports.PROVIDER_FEATURE_MESSAGE_WINDOW=Tn;exports.PUBLIC_EMAIL_DOMAINS=Q;exports.RELATED_SUBJECT_KINDS=q;exports.SIGNATURE_INTENTS=Ge;exports.SUMMARY_MIN_LAST_CHARS=ee;exports.SUMMARY_MIN_MESSAGES=Z;exports.TERMINAL_RUN_STATUSES=F;exports.TRIGGER_VARS=Ce;exports.UNSUPPORTED=Dn;exports.USAGE_DIMENSIONS=V;exports.USAGE_DIMENSION_IDS=w;exports.actingIdentityKey=j;exports.activityIconOf=re;exports.activityJoinUrl=me;exports.activitySnippet=$;exports.activityTextParams=P;exports.activityTimelineText=de;exports.activityTimestamp=Ae;exports.activityTypeInfo=l;exports.actorKey=Re;exports.aiVendorDefaultModel=$e;exports.aiVendorLabel=ke;exports.aiVendorNeedsBaseUrl=xe;exports.aiVendorsWith=Pe;exports.applySignature=Ke;exports.buildActivityPreview=ye;exports.buildChannelIntents=An;exports.carriesText=ce;exports.channelKindOf=oe;exports.cleanMessageText=dn;exports.defineIntent=Nn;exports.disabledIntentsFromCapabilities=yn;exports.emailDomain=an;exports.endpointKey=sn;exports.filterByEndpoint=In;exports.filterByIntent=bn;exports.filterByTargetScheme=ie;exports.findAiVendor=g;exports.flattenLocales=Ie;exports.floorToPeriod=K;exports.formatActingIdentity=H;exports.formatPeriod=G;exports.getActivitySeenUserIds=he;exports.getContactEndpoints=Ve;exports.getShortTitle=je;exports.getUrgencyScore=He;exports.humanizeAction=Ne;exports.isAssigned=we;exports.isClosed=Be;exports.isInteractionUnseen=Fe;exports.isLikelyBulk=gn;exports.isMessageType=le;exports.isPaused=Ue;exports.isPlaybookAuthoredType=ue;exports.isPublicEmailDomain=on;exports.isReplyableType=se;exports.isRetryable=Le;exports.isTerminal=Y;exports.isThreadLongEnough=En;exports.looksLikeEmail=nn;exports.matchContactToIntents=_n;exports.messageCountsAs=pe;exports.needsPhoneRegion=ln;exports.normalizeEmail=I;exports.parseActingIdentity=De;exports.periodsInRange=Se;exports.phoneSuffix=tn;exports.playbookActor=Oe;exports.readPath=m;exports.registrableDomain=J;exports.relatedByDefault=Xe;exports.resolveAccountCapabilities=te;exports.resolveActivityText=f;exports.resolveChannelIntents=ne;exports.resolveSignature=z;exports.stripHtml=k;exports.toE164=A;exports.usageMetricId=B;exports.usageMetrics=Me;
|