@opencxh/domain 1.132.0 → 1.134.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/blocks.d.ts +109 -0
- package/dist/entities/activity/blocks.test.d.ts +1 -0
- package/dist/entities/activity/descriptor.d.ts +10 -1
- package/dist/entities/activity/index.d.ts +1 -0
- package/dist/entities/activity/resolve.d.ts +5 -0
- package/dist/index.cjs +7 -7
- package/dist/index.js +364 -279
- package/dist/platform/ui.d.ts +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { ActivityText } from './descriptor';
|
|
2
|
+
/**
|
|
3
|
+
* De blokken waaruit een gedeclareerde tijdlijnrij is opgebouwd.
|
|
4
|
+
*
|
|
5
|
+
* Geleend van Slack's Block Kit: dezelfde namen en dezelfde grammatica, zodat iemand die
|
|
6
|
+
* ooit een Slack-app bouwde ze herkent — en wij schrijven Block Kit zelf al
|
|
7
|
+
* (`apps/slack/server/src/thread/context-blocks.ts`). Maar niet de hele catalogus: Block
|
|
8
|
+
* Kit telt inmiddels 21 bloktypes, waarvan de invoervelden-helft een compleet
|
|
9
|
+
* formuliersysteem is dat we al hebben in `ui-kit`'s `Form`.
|
|
10
|
+
*
|
|
11
|
+
* De scheiding die dat mogelijk maakt: **de blokken beschrijven de binnenkant van de rij,
|
|
12
|
+
* de descriptor-semantiek de buitenkant.** Uitlijning op `direction`, de avatar, de
|
|
13
|
+
* groepering van opeenvolgende bubbels en de tijdstempel blijven van de host — Block Kit
|
|
14
|
+
* kent die begrippen niet, want daar is een bericht een losstaande kaart.
|
|
15
|
+
*/
|
|
16
|
+
/** Semantische kleur. Geen vrije kleuren, zodat dark mode en de tokens blijven kloppen. */
|
|
17
|
+
export type ActivityTone = "info" | "success" | "warning" | "destructive";
|
|
18
|
+
export interface ActivityBadge {
|
|
19
|
+
text: ActivityText;
|
|
20
|
+
tone?: ActivityTone;
|
|
21
|
+
}
|
|
22
|
+
export interface ActivityAction {
|
|
23
|
+
/** Stabiel binnen de rij; routeert de klik en laat de host één knop hertekenen. */
|
|
24
|
+
action_id: string;
|
|
25
|
+
text: ActivityText;
|
|
26
|
+
/**
|
|
27
|
+
* De route waar de klik heen gaat, `"<app>.<scope>.<route>"`.
|
|
28
|
+
*
|
|
29
|
+
* Let op: `sdk.http.invoke` maakt van elke `.` een URL-`/`. Een id met punten hoort dus
|
|
30
|
+
* in {@link params} en niet in de action zelf.
|
|
31
|
+
*/
|
|
32
|
+
invoke: string;
|
|
33
|
+
/** Paden in de activity; de host leest ze uit en stuurt ze als body mee. */
|
|
34
|
+
params?: Record<string, string>;
|
|
35
|
+
style?: "primary" | "secondary" | "destructive";
|
|
36
|
+
}
|
|
37
|
+
export interface ActivityListItem {
|
|
38
|
+
text: ActivityText;
|
|
39
|
+
subtext?: ActivityText;
|
|
40
|
+
accessory?: ActivityBadge;
|
|
41
|
+
}
|
|
42
|
+
export type ActivityBlock = {
|
|
43
|
+
block_id?: string;
|
|
44
|
+
type: "header";
|
|
45
|
+
text: ActivityText;
|
|
46
|
+
subtitle?: ActivityText;
|
|
47
|
+
} | {
|
|
48
|
+
block_id?: string;
|
|
49
|
+
type: "section";
|
|
50
|
+
text?: ActivityText;
|
|
51
|
+
/** Tweekoloms sleutel/waarde. */
|
|
52
|
+
fields?: {
|
|
53
|
+
label: ActivityText;
|
|
54
|
+
value: ActivityText;
|
|
55
|
+
}[];
|
|
56
|
+
/** Het rechterslot. Voorlopig alleen een badge — een knop hoort in `actions`. */
|
|
57
|
+
accessory?: ActivityBadge;
|
|
58
|
+
} | {
|
|
59
|
+
block_id?: string;
|
|
60
|
+
type: "context";
|
|
61
|
+
text: ActivityText;
|
|
62
|
+
icon?: string;
|
|
63
|
+
} | {
|
|
64
|
+
block_id?: string;
|
|
65
|
+
type: "divider";
|
|
66
|
+
} | {
|
|
67
|
+
block_id?: string;
|
|
68
|
+
type: "image";
|
|
69
|
+
url: string;
|
|
70
|
+
alt: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Een rij per item. Kwam erbij door `ProposedActionCard` om te zetten: die toont een
|
|
74
|
+
* regel per voorgestelde actie, en `section.fields` is een rooster dat dat niet kan.
|
|
75
|
+
* Ticketregels en orderregels lopen op hetzelfde aan.
|
|
76
|
+
*/
|
|
77
|
+
| {
|
|
78
|
+
block_id?: string;
|
|
79
|
+
type: "list";
|
|
80
|
+
items: ActivityListItem[];
|
|
81
|
+
} | {
|
|
82
|
+
block_id?: string;
|
|
83
|
+
type: "actions";
|
|
84
|
+
elements: ActivityAction[];
|
|
85
|
+
}
|
|
86
|
+
/** Alleen aanzetten; de host tekent `activity.attachments` en regelt het downloaden. */
|
|
87
|
+
| {
|
|
88
|
+
block_id?: string;
|
|
89
|
+
type: "attachments";
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Een tijdlijnrij van vijftig blokken breekt de feed. Slack hanteert 50 per bericht; een
|
|
93
|
+
* rij in een lijst verdraagt minder, want hij staat tussen tientallen andere.
|
|
94
|
+
*/
|
|
95
|
+
export declare const MAX_BLOCKS = 10;
|
|
96
|
+
export declare const MAX_FIELDS = 10;
|
|
97
|
+
export declare const MAX_LIST_ITEMS = 10;
|
|
98
|
+
export declare const MAX_ACTIONS = 5;
|
|
99
|
+
/**
|
|
100
|
+
* Snoeit een gedeclareerde blokkenlijst tot iets wat de feed veilig kan tekenen.
|
|
101
|
+
*
|
|
102
|
+
* Weigeren en niet afkappen zou de hele rij laten verdwijnen om één slecht blok; dit laat
|
|
103
|
+
* de rest staan. Draait bij het samenstellen van de catalogus, zodat een verkeerde
|
|
104
|
+
* declaratie één keer gemeld wordt in plaats van bij elke render.
|
|
105
|
+
*
|
|
106
|
+
* `onDrop` krijgt te horen wat er wegviel — stil snoeien maakt "waarom staat mijn knop er
|
|
107
|
+
* niet?" onbeantwoordbaar.
|
|
108
|
+
*/
|
|
109
|
+
export declare function normalizeBlocks(blocks: unknown, onDrop?: (reason: string) => void): ActivityBlock[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LocaleBundle } from '../analytics/dashboard';
|
|
2
|
+
import { ActivityBlock } from './blocks';
|
|
2
3
|
import { ActivityChannelKind, ActivityShape } from './catalog';
|
|
3
4
|
/**
|
|
4
5
|
* Wat een app over zijn eigen activity-soort declareert.
|
|
@@ -50,7 +51,15 @@ export interface ActivityTypeDescriptor {
|
|
|
50
51
|
* los van hoe de rij eruitziet: opmaak hier lekt naar plekken die geen opmaak kunnen.
|
|
51
52
|
*/
|
|
52
53
|
text?: ActivityText;
|
|
53
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* Declaratieve blokken voor de feed. Rendert op web én mobiel, want er komt geen bundel
|
|
56
|
+
* aan te pas — en de host houdt de uitlijning, de avatar en de tijdstempel.
|
|
57
|
+
*/
|
|
58
|
+
render?: ActivityBlock[];
|
|
59
|
+
/**
|
|
60
|
+
* Eigen component voor de feed, `"<app>:<Resource>"`. **Alleen web**: op native bestaat
|
|
61
|
+
* geen module federation, dus daar zakt de rij terug naar {@link render} of {@link text}.
|
|
62
|
+
*/
|
|
54
63
|
component?: `${string}:${string}`;
|
|
55
64
|
}
|
|
56
65
|
/** Wat de comms-app aan de client teruggeeft: de gedeclareerde types plus hun vertalingen. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ActivityChannelKind, ActivityShape } from './catalog';
|
|
2
|
+
import { ActivityBlock } from './blocks';
|
|
2
3
|
import { ActivityTypeDescriptor } from './descriptor';
|
|
3
4
|
import { Activity } from './types';
|
|
4
5
|
/**
|
|
@@ -54,6 +55,10 @@ export declare class ActivityTypeRegistry {
|
|
|
54
55
|
snippet(activity: Activity): string;
|
|
55
56
|
/** De descriptor zoals hij binnenkwam; nodig om `text` als sleutel op te slaan. */
|
|
56
57
|
descriptor(type: string): ActivityTypeDescriptor | undefined;
|
|
58
|
+
/** De declaratieve blokken van een type, als het er heeft. */
|
|
59
|
+
blocks(type: string): ActivityBlock[] | undefined;
|
|
60
|
+
/** De vertaler die bij deze registry hoort, voor het oplossen van blokteksten. */
|
|
61
|
+
get translator(): Translate;
|
|
57
62
|
}
|
|
58
63
|
/** De lege registry: alleen de ingebouwde types. Voor code die (nog) geen catalogus laadt. */
|
|
59
64
|
export declare const BUILT_IN_ONLY: ActivityTypeRegistry;
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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"?`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=10,d=10,m=10,f=5,ue=new Set(["header","section","context","divider","image","list","actions","attachments"]);function b(e){if(typeof e=="string")return e.length>0;if(!e||typeof e!="object")return!1;const t=e;return typeof t.key=="string"||typeof t.value=="string"}function pe(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const i of e){if(n.length>=T){t("more than "+T+" blocks; the rest was dropped");break}if(!i||typeof i!="object")continue;const a=i;if(!ue.has(a.type)){t("unknown block type "+String(a.type));continue}switch(a.type){case"header":if(!b(a.text)){t("a header without text");continue}break;case"context":if(!b(a.text)){t("a context block without text");continue}break;case"image":if(!a.url||!a.alt){t("an image without url or alt");continue}break;case"section":Array.isArray(a.fields)&&a.fields.length>d&&(t("more than "+d+" fields in a section"),a.fields=a.fields.slice(0,d));break;case"list":if(!Array.isArray(a.items)||a.items.length===0){t("a list without items");continue}a.items.length>m&&(t("more than "+m+" list items"),a.items=a.items.slice(0,m));break;case"actions":{const r=Array.isArray(a.elements)?a.elements:[],o=r.filter(l=>l&&l.action_id&&l.invoke&&b(l.text));if(o.length!==r.length&&t("an action without action_id, invoke or text"),o.length===0)continue;o.length>f&&t("more than "+f+" actions"),a.elements=o.slice(0,f);break}}n.push(a)}return n}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 u(e){if(!e||e<0)return"";const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}function v(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function I(e){return e?.split("@")?.[0]||e||""}function p(e){return e.map(t=>t.name).join(", ")}function C(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const c={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${I(e.payload.from)}`:`Outbound call started — ${I(e.payload.to)}`},VOICE_CALL_ANSWERED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek aangenomen",timeline:(e,t)=>`Call answered — ${t}`},VOICE_CALL_HOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"In de wacht",timeline:(e,t)=>`Call on hold — ${t}`},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?` (${u(e.payload.duration)})`:""}`,timeline:e=>`Call ended${v(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${I(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?` (${u(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:O},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:O},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=>`${p(e.payload.members)} toegevoegd`,timeline:e=>{const t=p(e.payload.members)||"Someone",n=e.payload.initiator?.name?` · added by ${e.payload.initiator.name}`:"";return`${t} joined the chat${n}`}},CHAT_MEMBER_LEFT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`${p(e.payload.members)} verlaten`,timeline:e=>{const t=p(e.payload.members)||"Someone",n=e.payload.initiator?.name?` · removed by ${e.payload.initiator.name}`:"";return`${t} left the chat${n}`}},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=>`${C(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?` (${u(e.payload.duration)})`:""}`,timeline:e=>`${C(e.payload.callType)} ended${v(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(t=>t.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?` (${u(e.payload.duration)})`:""}`,timeline:()=>"Meeting ended"},MEETING_PARTICIPANT_JOINED:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} deelgenomen`,timeline:(e,t)=>`${t} joined the meeting`},MEETING_PARTICIPANT_LEFT:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} verlaten`,timeline:(e,t)=>`${t} left the meeting`},INTERACTION_CREATED:{shape:"event",icon:"circle",snippet:()=>"Interactie aangemaakt",timeline:(e,t)=>`Interaction started by ${t}`},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,t)=>`Status changed to ${e.payload.toStatus} by ${t}`},INTERACTION_ASSIGNED:{shape:"event",icon:"user",snippet:()=>"Interactie toegewezen",timeline:(e,t)=>`Assigned by ${t}`}};function O(e){const t=e.payload,n=t.bodySnippet?.trim()||K(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function s(e){return c[e]}function de(e){return s(e)?.icon??"circle"}function me(e){return s(e)?.channelKind}function fe(e){const t=s(e)?.shape;return t==="message"||t==="note"}function ge(e){return s(e)?.replyable===!0}function Ee(e){return s(e)?.carriesText===!0}function he(e){return s(e)?.countsAs}function ye(e){return s(e)?.playbookAuthored===!0}function w(e){const t=s(e.type)?.snippet;return t?t(e):""}function Ae(e,t){const n=s(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function be(e){const t=s(e.type)?.joinUrl;return t?t(e):void 0}function E(e,t){let n=e;for(const i of t.split(".")){if(n==null||typeof n!="object")return"";n=n[i]}return n==null?"":typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):""}function h(e,t,n){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return E(t,e.value)||null;const i={};for(const[r,o]of Object.entries(e.params??{}))i[r]=E(t,o);const a=n(e.key,i);return a===e.key?null:a}function V(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[i,a]of Object.entries(e.params??{}))n[i]=E(t,a);return{key:e.key,params:n}}const Ie=e=>e;function R(e){const t=c[e];return{type:e,shape:t.shape,channelKind:t.channelKind,icon:t.icon,replyable:t.replyable===!0,countsAs:t.countsAs,carriesText:t.carriesText===!0,triggerable:t.triggerable===!0,component:t.component,builtIn:!0,displayNameKey:t.displayNameKey}}function D(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 B{constructor(t=[],n=Ie){this.translate=n;for(const i of t)i?.type&&(i.type in c||this.declared.has(i.type)||this.declared.set(i.type,i))}declared=new Map;get(t){if(t in c)return R(t);const n=this.declared.get(t);return n?D(n):void 0}triggerable(){const t=Object.keys(c).filter(i=>c[i].triggerable).map(R),n=[...this.declared.values()].map(D).filter(i=>i.triggerable);return[...t,...n]}timelineText(t,n){const i=c[t.type];if(i?.timeline)return i.timeline(t,n);const a=this.declared.get(t.type);return h(a?.text,t,this.translate)??t.type.replace(/_/g," ").toLowerCase()}snippet(t){const n=c[t.type];if(n?.snippet)return n.snippet(t);const i=this.declared.get(t.type);return h(i?.text,t,this.translate)??""}descriptor(t){return this.declared.get(t)}blocks(t){const n=this.declared.get(t)?.render;return n?.length?n:void 0}get translator(){return this.translate}}const _e=new B,L=140;function Te(e){const t=e.trim();return t.length<=L?t:t.slice(0,L-1).trimEnd()+"…"}function Se(e,t){const n=V(t?.text,e),i=t?h(t.text,e,a=>a):null;return{activityId:e.id,type:e.type,snippet:Te(i??w(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}function Me(e,t,n=[]){const i=e.createdAt;if(!i)return[];const a=new Set(n);return e.author.type==="user"&&e.author.id&&a.add(e.author.id),Object.entries(t).filter(([r,o])=>o>=i&&!a.has(r)).map(([r])=>r)}function Ne(e){return e.createdAt??0}const ve=[{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 Ce(e){const t=[];for(const n of Object.keys(e))for(const i of Object.keys(e[n]))t.push({lang:n,key:i,value:e[n][i]});return t}function _(e){return e<10?`0${e}`:`${e}`}function H(e,t){const n=new Date(e),i=`${n.getUTCFullYear()}-${_(n.getUTCMonth()+1)}-${_(n.getUTCDate())}`;return t==="day"?i:`${i}T${_(n.getUTCHours())}`}function j(e,t){const n=new Date(e);return n.setUTCMinutes(0,0,0),t==="day"&&n.setUTCHours(0),n.getTime()}const Oe=36e5,Re=864e5;function De(e,t,n){const i=n==="hour"?Oe:Re,a=[];for(let r=j(e,n);r<=t;r+=i)a.push(H(r,n));return a}const F=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],W=F.map(e=>e.id);function Y(e,t){return`${e}.usage.${t}`}function Le(e,t){return t.map(n=>({id:Y(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...W,...n.extraDimensions??[],"time"]}))}function ke(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const Ue=[{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"}],xe={topics:[{name:"topic",type:"string"},{name:"confidence",type:"number"}],question:[{name:"answer",type:"boolean"},{name:"confidence",type:"number"}],extract:[]};function X(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function $e(e){if(typeof e!="string")return;const t=e.trim();if(t==="org")return{kind:"org"};const n=t.indexOf(":");if(n<=0)return;const i=t.slice(0,n),a=t.slice(n+1).trim();if(a){if(i==="user")return{kind:"user",userId:a};if(i==="team")return{kind:"team",teamId:a}}}function z(e){return X(e)}function Pe(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 Ge(e){return z(e)}const q=["done","escalated","failed","timed_out","stopped"],J=["awaiting_approval","awaiting_reply"];function Q(e){return q.includes(e)}function Ke(e){return Q(e)}function we(e){return J.includes(e)}const M=[{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 y(e){return M.find(t=>t.id===e)}function Ve(e){return y(e)?.label??e}function Be(e,t="gpt-5-mini"){return y(e)?.defaultModel??t}function He(e){return M.filter(t=>t.capabilities.includes(e))}function je(e){const t=y(e);return!!t&&!t.baseUrl}const Fe=new Set(["mail","message"]);function Z(e,t){const n=e.settings?.signatures?.[t];return!n||!n.enabled||!n.body||n.body.trim()===""?null:n}function We(e,t,n,i="html"){if(!e)return n;const a=Z(e,t);return a?`${n}${i==="text"?`
|
|
2
2
|
|
|
3
|
-
`:
|
|
4
|
-
`);for(let
|
|
5
|
-
`).trim();return e}function
|
|
6
|
-
`),
|
|
7
|
-
`),
|
|
3
|
+
`:t==="mail"?"<br><br>-- <br>":"<br><br>"}${a.body}`:n}function Ye(e){return e.endpoints??[]}const Xe=e=>!!e.assignedUserId||!!e.assignedInboxId,ze=e=>e.status==="closed",qe=e=>({urgent:10,high:5,normal:2,low:1})[e.priority]||0,Je=(e,t=30)=>e.title?.length<=t?e.title:`${e.title.substring(0,t)}...`;function Qe(e,t){return e.lastActivityAt?!(e.seenBy??[]).includes(t):!1}const Ze=2e3,et=500,tt=12e3,nt=4e3,ee=["contact","company"];function it(e){if(!e)return!1;const t=e.slice(0,e.indexOf(":"));return ee.includes(t)}const A={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}},te="NL",at=15,rt=8,ot=Array.from(new Set(Object.values(A).map(e=>e.callingCode))).sort((e,t)=>t.length-e.length);function k(e){if(e)return A[e.trim().toUpperCase()]}function g(e,t){return e.length>=t.nsnMin&&e.length<=t.nsnMax}function U(e){if(e.length>at)return null;for(const t of ot){if(!e.startsWith(t))continue;const n=e.slice(t.length);for(const i of Object.values(A)){if(i.callingCode!==t)continue;const a=i.trunkPrefix,r=a&&n.startsWith(a)?n.slice(a.length):n;if(g(r,i))return`+${t}${r}`}return null}return e.length<rt?null:`+${e}`}function st(e){let t=e.trim();const n=t.match(/^(sips?|tel|whatsapp):/i);n&&(t=t.slice(n[0].length));const i=t.indexOf("@");return i>=0&&(t=t.slice(0,i)),t.trim()}function lt(e){if(!e)return!1;const t=e.indexOf("@");if(t<=0)return!1;const n=e.slice(0,t).trim();return!/^[+\d\s().-]+$/.test(n)}function S(e,t){if(!e)return null;const n=st(e);if(!n)return null;const i=n.startsWith("+"),a=n.replace(/\D/g,"");if(!a)return null;if(i)return U(a);if(a.startsWith("00"))return U(a.slice(2));const r=k(t)??k(te);if(!r)return null;const o=r.trunkPrefix;if(o&&a.startsWith(o)){const l=a.slice(o.length);return g(l,r)?`+${r.callingCode}${l}`:null}if(a.startsWith(r.callingCode)){const l=a.slice(r.callingCode.length);if(g(l,r))return`+${r.callingCode}${l}`}return!o&&g(a,r)?`+${r.callingCode}${a}`:null}function ct(e,t=9){const n=(e??"").replace(/\D/g,"");return n.length<t?null:n.slice(-t)}function N(e){if(!e)return null;const t=e.trim().toLowerCase(),n=t.lastIndexOf("@");if(n<=0||n===t.length-1)return null;const i=t.slice(0,n).split("+")[0],a=t.slice(n+1);return!i||!a.includes(".")?null:`${i}@${a}`}function ut(e){const t=N(e);return t?t.slice(t.lastIndexOf("@")+1):null}const pt=new Set(["co.uk","org.uk","gov.uk","ac.uk","com.au","co.nz","com.br","co.za"]);function ne(e){if(!e)return null;const t=e.trim().toLowerCase().replace(/\.$/,"").split(".").filter(Boolean);if(t.length<2)return null;const n=t.slice(-2).join(".");return pt.has(n)&&t.length>=3?t.slice(-3).join("."):n}const ie=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 dt(e){const t=ne(e);return t?ie.has(t):!1}function mt(e){if(!e)return!1;const t=e.trim().toLowerCase();return t==="tel"||t==="sms"||t==="whatsapp"||t==="fax"}function ft(e,t,n){if(!e||!t)return null;const i=e.trim().toLowerCase();if(i==="tel"||i==="sms"||i==="whatsapp"){const r=S(t,n);return r?`tel:${r}`:null}if(i==="fax"){const r=S(t,n);return r?`fax:${r}`:null}if(i==="mailto"||i==="email"){const r=N(t);return r?`mailto:${r}`:null}const a=t.trim().toLowerCase();return a?`${i}:${a}`:null}const gt=[/<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],x=/^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i,Et=/^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;function ht(e){const t=e.split(`
|
|
4
|
+
`);for(let n=0;n<t.length;n++)if(Et.test(t[n])||x.test(t[n])&&t.slice(n+1,n+4).some(i=>x.test(i)))return t.slice(0,n).join(`
|
|
5
|
+
`).trim();return e}function $(e){let t=e;return t=t.replace(/<(script|style)[\s\S]*?<\/\1>/gi,""),t=t.replace(/<br\s*\/?>/gi,`
|
|
6
|
+
`),t=t.replace(/<\/(p|div|li|tr|h[1-6]|ul|ol|table)>/gi,`
|
|
7
|
+
`),t=t.replace(/<[^>]+>/g,""),t=t.replace(/<[^>]*$/,""),t}function P(e){return e.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&#(\d+);/g,(t,n)=>String.fromCharCode(Number(n))).replace(/&/gi,"&")}function G(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 yt(e){if(typeof e!="string"||!e)return"";let t=e.length;for(const r of gt){const o=e.search(r);o>=0&&o<t&&(t=o)}const n=e.slice(0,t);let i=G(P($(n)));return i||(i=G(P($(e)))),ht(i)||i}const At=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,bt=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function It(e,t){return!!(e&&At.test(e)||t&&bt.test(t))}const ae=3,re=600;function _t(e,t){return e>=ae||t>=re}function oe(e,t){const n=new Set(e.disabledIntents??[]),i=e.intentOverrides??{},a=t.intents.filter(o=>!n.has(o.intent)).map(o=>St(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 se(e,t){const n={};for(const i of e.intents){if(!i.togglable)continue;const a=t?.[i.intent];n[i.intent]=a??i.defaultEnabled??!0}return n}function Tt(e,t){const n=se(e,t);return Object.entries(n).filter(([,i])=>!i).map(([i])=>i)}function St(e,t){return t?{intent:t.intent??e.intent,targetSchemes:t.targetSchemes??e.targetSchemes,transport:t.transport??e.transport}:e}function Mt(e,t){const n=[];for(const i of e){if(!i.enabled)continue;const a=t[i.providerId];if(a)for(const r of oe(i,a))n.push({channel:i,description:a,capability:r})}return n}function Nt(e,t){return t.filter(n=>n.capability.intent===e)}function le(e,t){return t.filter(n=>n.capability.targetSchemes.includes(e))}function vt(e,t){return le(e.scheme,t)}function Ct(e,t,n){const i=[];for(const a of e)for(const r of n)r.capability.intent===t&&r.capability.targetSchemes.includes(a.scheme)&&i.push({channelIntent:r,endpoint:a});return i}var ce=(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))(ce||{});const Ot="message_window",Rt="message_templates",Dt={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},Lt=(e,t)=>({intent:e,...t}),kt="folder_management",Ut="remote_search",xt={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},$t=9e4,Pt="installation-id";exports.ACTIVITY_CATALOG=c;exports.AI_VENDORS=M;exports.ActivityTypeRegistry=B;exports.BUILT_IN_ONLY=_e;exports.CLASSIFY_VARS=xe;exports.CORE_DIMENSIONS=ve;exports.CommunicationScheme=ce;exports.DEFAULT_MEMORY_BUDGET=nt;exports.DEFAULT_PHONE_REGION=te;exports.FEATURE_FOLDER_MANAGEMENT=kt;exports.FEATURE_REMOTE_SEARCH=Ut;exports.INSTALLATION_HEADER=Pt;exports.InteractionParticipantRole=Dt;exports.MAX_ACTIONS=f;exports.MAX_BLOCKS=T;exports.MAX_FIELDS=d;exports.MAX_LIST_ITEMS=m;exports.MAX_MEMORY_BUDGET=tt;exports.MAX_MEMORY_CHARS=Ze;exports.MIN_MEMORY_BUDGET=et;exports.PAUSED_RUN_STATUSES=J;exports.PHONE_REGIONS=A;exports.PRESENCE_ONLINE_WINDOW_MS=$t;exports.PROVIDER_FEATURE_MESSAGE_TEMPLATES=Rt;exports.PROVIDER_FEATURE_MESSAGE_WINDOW=Ot;exports.PUBLIC_EMAIL_DOMAINS=ie;exports.RELATED_SUBJECT_KINDS=ee;exports.SIGNATURE_INTENTS=Fe;exports.SUMMARY_MIN_LAST_CHARS=re;exports.SUMMARY_MIN_MESSAGES=ae;exports.TERMINAL_RUN_STATUSES=q;exports.TRIGGER_VARS=Ue;exports.UNSUPPORTED=xt;exports.USAGE_DIMENSIONS=F;exports.USAGE_DIMENSION_IDS=W;exports.actingIdentityKey=z;exports.activityIconOf=de;exports.activityJoinUrl=be;exports.activitySnippet=w;exports.activityTextParams=V;exports.activityTimelineText=Ae;exports.activityTimestamp=Ne;exports.activityTypeInfo=s;exports.actorKey=Ge;exports.aiVendorDefaultModel=Be;exports.aiVendorLabel=Ve;exports.aiVendorNeedsBaseUrl=je;exports.aiVendorsWith=He;exports.applySignature=We;exports.buildActivityPreview=Se;exports.buildChannelIntents=Mt;exports.carriesText=Ee;exports.channelKindOf=me;exports.cleanMessageText=yt;exports.defineIntent=Lt;exports.disabledIntentsFromCapabilities=Tt;exports.emailDomain=ut;exports.endpointKey=ft;exports.filterByEndpoint=vt;exports.filterByIntent=Nt;exports.filterByTargetScheme=le;exports.findAiVendor=y;exports.flattenLocales=Ce;exports.floorToPeriod=j;exports.formatActingIdentity=X;exports.formatPeriod=H;exports.getActivitySeenUserIds=Me;exports.getContactEndpoints=Ye;exports.getShortTitle=Je;exports.getUrgencyScore=qe;exports.humanizeAction=ke;exports.isAssigned=Xe;exports.isClosed=ze;exports.isInteractionUnseen=Qe;exports.isLikelyBulk=It;exports.isMessageType=fe;exports.isPaused=we;exports.isPlaybookAuthoredType=ye;exports.isPublicEmailDomain=dt;exports.isReplyableType=ge;exports.isRetryable=Ke;exports.isTerminal=Q;exports.isThreadLongEnough=_t;exports.looksLikeEmail=lt;exports.matchContactToIntents=Ct;exports.messageCountsAs=he;exports.needsPhoneRegion=mt;exports.normalizeBlocks=pe;exports.normalizeEmail=N;exports.parseActingIdentity=$e;exports.periodsInRange=De;exports.phoneSuffix=ct;exports.playbookActor=Pe;exports.readPath=E;exports.registrableDomain=ne;exports.relatedByDefault=it;exports.resolveAccountCapabilities=se;exports.resolveActivityText=h;exports.resolveChannelIntents=oe;exports.resolveSignature=Z;exports.stripHtml=K;exports.toE164=S;exports.usageMetricId=Y;exports.usageMetrics=Le;
|