@opencxh/domain 1.137.0 → 1.141.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -6
- package/dist/index.js +178 -166
- package/dist/platform/routing.d.ts +25 -0
- package/dist/platform/routing.test.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=10,_=10,T=10,b=5,Pe=new Set(["header","section","context","divider","image","list","actions","attachments"]);function O(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 Ke(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const a of e){if(n.length>=k){t("more than "+k+" blocks; the rest was dropped");break}if(!a||typeof a!="object")continue;const i=a;if(!Pe.has(i.type)){t("unknown block type "+String(i.type));continue}switch(i.type){case"header":if(!O(i.text)){t("a header without text");continue}break;case"context":if(!O(i.text)){t("a context block without text");continue}break;case"image":if(!i.url||!i.alt){t("an image without url or alt");continue}break;case"section":Array.isArray(i.fields)&&i.fields.length>_&&(t("more than "+_+" fields in a section"),i.fields=i.fields.slice(0,_));break;case"list":if(!Array.isArray(i.items)||i.items.length===0){t("a list without items");continue}i.items.length>T&&(t("more than "+T+" list items"),i.items=i.items.slice(0,T));break;case"actions":{const r=Array.isArray(i.elements)?i.elements:[],o=r.filter(s=>s&&s.action_id&&s.invoke&&O(s.text));if(o.length!==r.length&&t("an action without action_id, invoke or text"),o.length===0)continue;o.length>b&&t("more than "+b+" actions"),i.elements=o.slice(0,b);break}}n.push(i)}return n}function oe(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 E(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 H(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function v(e){return e?.split("@")?.[0]||e||""}function y(e){return e.map(t=>t.name).join(", ")}function j(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const f={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${v(e.payload.from)}`:`Outbound call started — ${v(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?` (${E(e.payload.duration)})`:""}`,timeline:e=>`Call ended${H(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${v(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?` (${E(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:X},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:X},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=>`${y(e.payload.members)} toegevoegd`,timeline:e=>{const t=y(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=>`${y(e.payload.members)} verlaten`,timeline:e=>{const t=y(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=>`${j(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?` (${E(e.payload.duration)})`:""}`,timeline:e=>`${j(e.payload.callType)} ended${H(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?` (${E(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 X(e){const t=e.payload,n=t.bodySnippet?.trim()||oe(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function u(e){return f[e]}function Ge(e){return u(e)?.icon??"circle"}function Be(e){return u(e)?.channelKind}function Fe(e){const t=u(e)?.shape;return t==="message"||t==="note"}function Ve(e){return u(e)?.replyable===!0}function He(e){return u(e)?.carriesText===!0}function je(e){return u(e)?.countsAs}function Xe(e){return u(e)?.playbookAuthored===!0}function se(e){const t=u(e.type)?.snippet;return t?t(e):""}function We(e,t){const n=u(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function Ye(e){const t=u(e.type)?.joinUrl;return t?t(e):void 0}function M(e,t){let n=e;for(const a of t.split(".")){if(n==null||typeof n!="object")return"";n=n[a]}return n==null?"":typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):""}function N(e,t,n){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return M(t,e.value)||null;const a={};for(const[r,o]of Object.entries(e.params??{}))a[r]=M(t,o);const i=n(e.key,a);return i===e.key?null:i}function le(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[a,i]of Object.entries(e.params??{}))n[a]=M(t,i);return{key:e.key,params:n}}const ze=e=>e;function W(e){const t=f[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 Y(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 ce{constructor(t=[],n=ze){this.translate=n;for(const a of t)a?.type&&(a.type in f||this.declared.has(a.type)||this.declared.set(a.type,a))}declared=new Map;get(t){if(t in f)return W(t);const n=this.declared.get(t);return n?Y(n):void 0}triggerable(){const t=Object.keys(f).filter(a=>f[a].triggerable).map(W),n=[...this.declared.values()].map(Y).filter(a=>a.triggerable);return[...t,...n]}timelineText(t,n){const a=f[t.type];if(a?.timeline)return a.timeline(t,n);const i=this.declared.get(t.type);return N(i?.text,t,this.translate)??t.type.replace(/_/g," ").toLowerCase()}snippet(t){const n=f[t.type];if(n?.snippet)return n.snippet(t);const a=this.declared.get(t.type);return N(a?.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 qe=new ce,z=140;function Je(e){const t=e.trim();return t.length<=z?t:t.slice(0,z-1).trimEnd()+"…"}function Qe(e,t){const n=le(t?.text,e),a=t?N(t.text,e,i=>i):null;return{activityId:e.id,type:e.type,snippet:Je(a??se(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}function Ze(e,t,n=[]){const a=e.createdAt;if(!a)return[];const i=new Set(n);return e.author.type==="user"&&e.author.id&&i.add(e.author.id),Object.entries(t).filter(([r,o])=>o>=a&&!i.has(r)).map(([r])=>r)}function et(e){return e.createdAt??0}const tt=[{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 nt(e){const t=[];for(const n of Object.keys(e))for(const a of Object.keys(e[n]))t.push({lang:n,key:a,value:e[n][a]});return t}function L(e){return e<10?`0${e}`:`${e}`}function ue(e,t){const n=new Date(e),a=`${n.getUTCFullYear()}-${L(n.getUTCMonth()+1)}-${L(n.getUTCDate())}`;return t==="day"?a:`${a}T${L(n.getUTCHours())}`}function pe(e,t){const n=new Date(e);return n.setUTCMinutes(0,0,0),t==="day"&&n.setUTCHours(0),n.getTime()}const it=36e5,at=864e5;function rt(e,t,n){const a=n==="hour"?it:at,i=[];for(let r=pe(e,n);r<=t;r+=a)i.push(ue(r,n));return i}const de=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],me=de.map(e=>e.id);function fe(e,t){return`${e}.usage.${t}`}function ot(e,t){return t.map(n=>({id:fe(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...me,...n.extraDimensions??[],"time"]}))}const ge=new Set(["info","success","warning","destructive"]),x=200,D=100,$=200,U=12,w=4,K=4e3,I=500,st=256*1024,lt=new Set(["heading","paragraph","list","quote","code","divider","table","kpi","callout"]),he=["http:","https:","mailto:","tel:"],ct=/^[a-z][a-z0-9+.-]*:/i;function Ae(e){const t=e.trim().replace(/^<|>$/g,"");if(!t)return!1;const n=ct.exec(t)?.[0];return n?he.includes(n.toLowerCase()):!t.startsWith("//")}const ut=/^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;function pt(e){let t="",n=0;for(;n<e.length;){const a=e[n]==="!"&&e[n+1]==="[";if(e[n]!=="["&&!a){t+=e[n],n+=1;continue}const i=n+(a?2:1),r=q(e,i,"[","]");if(r<0||e[r+1]!=="("){t+=e[n],n+=1;continue}const o=q(e,r+2,"(",")");if(o<0){t+=e[n],n+=1;continue}const s=e.slice(i,r),m=e.slice(r+2,o).trim().split(/\s+/)[0]??"";t+=a||!Ae(m)?s:e.slice(n,o+1),n=o+1}return t}function q(e,t,n,a){let i=1;for(let r=t;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]===n)i+=1;else if(e[r]===a&&(i-=1,i===0))return r}return-1}function Ee(e){return pt(e).replace(ut,(t,n,a)=>Ae(a)?t:"")}function c(e,t=K){return typeof e=="string"?Ee(e).slice(0,t):""}function dt(e,t=K){return typeof e=="string"?e.slice(0,t):""}function mt(e,t="info"){return typeof e=="string"&&ge.has(e)?e:t}function ft(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const a of e){if(n.length>=x){t("more than "+x+" blocks; the rest was dropped");break}if(!a||typeof a!="object")continue;const i=a;if(!lt.has(i.type)){t("unknown block type "+String(i.type));continue}const r=typeof i.block_id=="string"?{block_id:i.block_id}:{};switch(i.type){case"heading":{const o=c(i.text);if(!o){t("a heading without text");continue}const s=i.level===2||i.level===3?i.level:1;n.push({...r,type:"heading",level:s,text:o});break}case"paragraph":{const o=c(i.text);if(!o){t("a paragraph without text");continue}n.push({...r,type:"paragraph",text:o});break}case"quote":{const o=c(i.text);if(!o){t("a quote without text");continue}n.push({...r,type:"quote",text:o});break}case"code":{const o=dt(i.text);if(!o){t("a code block without text");continue}const s=typeof i.lang=="string"?{lang:i.lang.slice(0,32)}:{};n.push({...r,type:"code",...s,text:o});break}case"divider":n.push({...r,type:"divider"});break;case"list":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const p of o){if(s.length>=D){t("more than "+D+" list items");break}const d=c(p?.text);if(!d)continue;const l=c(p?.lead,200);s.push(l?{lead:l,text:d}:{text:d})}if(s.length===0){t("a list without usable items");continue}const m=i.style==="numbered"?"numbered":"bulleted";n.push({...r,type:"list",style:m,items:s});break}case"table":{const o=Array.isArray(i.columns)?i.columns:[],s=[];for(const l of o){if(s.length>=U){t("more than "+U+" table columns");break}const A=c(l?.label,I),R=l?.align==="right"?"right":void 0;s.push(R?{label:A,align:R}:{label:A})}if(s.length===0){t("a table without columns");continue}const m=Array.isArray(i.rows)?i.rows:[],p=[];for(const l of m){if(p.length>=$){t("more than "+$+" table rows");break}const A=Array.isArray(l)?l:[];p.push(s.map((R,we)=>c(A[we],I)))}const d=c(i.caption,I);n.push({...r,type:"table",columns:s,rows:p,...d?{caption:d}:{}});break}case"kpi":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const m of o){if(s.length>=w){t("more than "+w+" kpi items");break}const p=c(m?.value,40),d=c(m?.label,80);if(!p||!d)continue;const l=m?.tone;s.push(typeof l=="string"&&ge.has(l)?{value:p,label:d,tone:l}:{value:p,label:d})}if(s.length===0){t("a kpi block without usable items");continue}n.push({...r,type:"kpi",items:s});break}case"callout":{const o=c(i.text);if(!o){t("a callout without text");continue}const s=c(i.title,200);n.push({...r,type:"callout",tone:mt(i.tone),...s?{title:s}:{},text:o});break}}}return n}function gt(e){return JSON.stringify(e).length}function ht(e){return{blocks:e.length,types:e.map(t=>t.type),headings:e.flatMap(t=>t.type==="heading"?[t.text]:[])}}function J(e){return e.replace(/\|/g,"\\|").replace(/\r?\n/g," ").trim()}function Q(e,t,n){const a=e.map((i,r)=>n?.[r]==="right"?"---:":"---");return[`| ${e.map(J).join(" | ")} |`,`| ${a.join(" | ")} |`,...t.map(i=>`| ${i.map(J).join(" | ")} |`)]}function At(e){switch(e.type){case"heading":return[`${"#".repeat(e.level)} ${e.text}`];case"paragraph":return[e.text];case"quote":return e.text.split(/\r?\n/).map(t=>`> ${t}`);case"code":return[`\`\`\`${e.lang??""}`,e.text,"```"];case"divider":return["---"];case"list":return e.items.map((t,n)=>{const a=e.style==="numbered"?`${n+1}.`:"-";return t.lead?`${a} **${t.lead}** ${t.text}`:`${a} ${t.text}`});case"table":{const t=Q(e.columns.map(n=>n.label),e.rows,e.columns.map(n=>n.align??"left"));return e.caption?[...t,"",`*${e.caption}*`]:t}case"kpi":return Q(e.items.map(t=>t.value),[e.items.map(t=>t.label)]);case"callout":return(e.title?`**${e.title}** ${e.text}`:e.text).split(/\r?\n/).map(n=>`> ${n}`)}}function Et(e,t){const n=[],a=e.some(i=>i.type==="heading"&&i.level===1);t&&!a&&n.push(`# ${t}`);for(const i of e){const r=At(i);r.length>0&&n.push(r.join(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=10,_=10,T=10,b=5,Ge=new Set(["header","section","context","divider","image","list","actions","attachments"]);function O(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 Be(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const a of e){if(n.length>=k){t("more than "+k+" blocks; the rest was dropped");break}if(!a||typeof a!="object")continue;const i=a;if(!Ge.has(i.type)){t("unknown block type "+String(i.type));continue}switch(i.type){case"header":if(!O(i.text)){t("a header without text");continue}break;case"context":if(!O(i.text)){t("a context block without text");continue}break;case"image":if(!i.url||!i.alt){t("an image without url or alt");continue}break;case"section":Array.isArray(i.fields)&&i.fields.length>_&&(t("more than "+_+" fields in a section"),i.fields=i.fields.slice(0,_));break;case"list":if(!Array.isArray(i.items)||i.items.length===0){t("a list without items");continue}i.items.length>T&&(t("more than "+T+" list items"),i.items=i.items.slice(0,T));break;case"actions":{const r=Array.isArray(i.elements)?i.elements:[],o=r.filter(s=>s&&s.action_id&&s.invoke&&O(s.text));if(o.length!==r.length&&t("an action without action_id, invoke or text"),o.length===0)continue;o.length>b&&t("more than "+b+" actions"),i.elements=o.slice(0,b);break}}n.push(i)}return n}function oe(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 E(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 H(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function v(e){return e?.split("@")?.[0]||e||""}function y(e){return e.map(t=>t.name).join(", ")}function j(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const f={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${v(e.payload.from)}`:`Outbound call started — ${v(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?` (${E(e.payload.duration)})`:""}`,timeline:e=>`Call ended${H(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${v(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?` (${E(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:X},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:X},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=>`${y(e.payload.members)} toegevoegd`,timeline:e=>{const t=y(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=>`${y(e.payload.members)} verlaten`,timeline:e=>{const t=y(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=>`${j(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?` (${E(e.payload.duration)})`:""}`,timeline:e=>`${j(e.payload.callType)} ended${H(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?` (${E(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 X(e){const t=e.payload,n=t.bodySnippet?.trim()||oe(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function u(e){return f[e]}function Fe(e){return u(e)?.icon??"circle"}function Ve(e){return u(e)?.channelKind}function He(e){const t=u(e)?.shape;return t==="message"||t==="note"}function je(e){return u(e)?.replyable===!0}function Xe(e){return u(e)?.carriesText===!0}function We(e){return u(e)?.countsAs}function Ye(e){return u(e)?.playbookAuthored===!0}function se(e){const t=u(e.type)?.snippet;return t?t(e):""}function ze(e,t){const n=u(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function qe(e){const t=u(e.type)?.joinUrl;return t?t(e):void 0}function M(e,t){let n=e;for(const a of t.split(".")){if(n==null||typeof n!="object")return"";n=n[a]}return n==null?"":typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):""}function N(e,t,n){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return M(t,e.value)||null;const a={};for(const[r,o]of Object.entries(e.params??{}))a[r]=M(t,o);const i=n(e.key,a);return i===e.key?null:i}function le(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[a,i]of Object.entries(e.params??{}))n[a]=M(t,i);return{key:e.key,params:n}}const Je=e=>e;function W(e){const t=f[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 Y(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 ce{constructor(t=[],n=Je){this.translate=n;for(const a of t)a?.type&&(a.type in f||this.declared.has(a.type)||this.declared.set(a.type,a))}declared=new Map;get(t){if(t in f)return W(t);const n=this.declared.get(t);return n?Y(n):void 0}triggerable(){const t=Object.keys(f).filter(a=>f[a].triggerable).map(W),n=[...this.declared.values()].map(Y).filter(a=>a.triggerable);return[...t,...n]}timelineText(t,n){const a=f[t.type];if(a?.timeline)return a.timeline(t,n);const i=this.declared.get(t.type);return N(i?.text,t,this.translate)??t.type.replace(/_/g," ").toLowerCase()}snippet(t){const n=f[t.type];if(n?.snippet)return n.snippet(t);const a=this.declared.get(t.type);return N(a?.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 Qe=new ce,z=140;function Ze(e){const t=e.trim();return t.length<=z?t:t.slice(0,z-1).trimEnd()+"…"}function et(e,t){const n=le(t?.text,e),a=t?N(t.text,e,i=>i):null;return{activityId:e.id,type:e.type,snippet:Ze(a??se(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}function tt(e,t,n=[]){const a=e.createdAt;if(!a)return[];const i=new Set(n);return e.author.type==="user"&&e.author.id&&i.add(e.author.id),Object.entries(t).filter(([r,o])=>o>=a&&!i.has(r)).map(([r])=>r)}function nt(e){return e.createdAt??0}const it=[{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 at(e){const t=[];for(const n of Object.keys(e))for(const a of Object.keys(e[n]))t.push({lang:n,key:a,value:e[n][a]});return t}function L(e){return e<10?`0${e}`:`${e}`}function ue(e,t){const n=new Date(e),a=`${n.getUTCFullYear()}-${L(n.getUTCMonth()+1)}-${L(n.getUTCDate())}`;return t==="day"?a:`${a}T${L(n.getUTCHours())}`}function pe(e,t){const n=new Date(e);return n.setUTCMinutes(0,0,0),t==="day"&&n.setUTCHours(0),n.getTime()}const rt=36e5,ot=864e5;function st(e,t,n){const a=n==="hour"?rt:ot,i=[];for(let r=pe(e,n);r<=t;r+=a)i.push(ue(r,n));return i}const de=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],me=de.map(e=>e.id);function fe(e,t){return`${e}.usage.${t}`}function lt(e,t){return t.map(n=>({id:fe(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...me,...n.extraDimensions??[],"time"]}))}const ge=new Set(["info","success","warning","destructive"]),x=200,D=100,$=200,U=12,w=4,K=4e3,I=500,ct=256*1024,ut=new Set(["heading","paragraph","list","quote","code","divider","table","kpi","callout"]),he=["http:","https:","mailto:","tel:"],pt=/^[a-z][a-z0-9+.-]*:/i;function Ae(e){const t=e.trim().replace(/^<|>$/g,"");if(!t)return!1;const n=pt.exec(t)?.[0];return n?he.includes(n.toLowerCase()):!t.startsWith("//")}const dt=/^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;function mt(e){let t="",n=0;for(;n<e.length;){const a=e[n]==="!"&&e[n+1]==="[";if(e[n]!=="["&&!a){t+=e[n],n+=1;continue}const i=n+(a?2:1),r=q(e,i,"[","]");if(r<0||e[r+1]!=="("){t+=e[n],n+=1;continue}const o=q(e,r+2,"(",")");if(o<0){t+=e[n],n+=1;continue}const s=e.slice(i,r),m=e.slice(r+2,o).trim().split(/\s+/)[0]??"";t+=a||!Ae(m)?s:e.slice(n,o+1),n=o+1}return t}function q(e,t,n,a){let i=1;for(let r=t;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]===n)i+=1;else if(e[r]===a&&(i-=1,i===0))return r}return-1}function Ee(e){return mt(e).replace(dt,(t,n,a)=>Ae(a)?t:"")}function c(e,t=K){return typeof e=="string"?Ee(e).slice(0,t):""}function ft(e,t=K){return typeof e=="string"?e.slice(0,t):""}function gt(e,t="info"){return typeof e=="string"&&ge.has(e)?e:t}function ht(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const a of e){if(n.length>=x){t("more than "+x+" blocks; the rest was dropped");break}if(!a||typeof a!="object")continue;const i=a;if(!ut.has(i.type)){t("unknown block type "+String(i.type));continue}const r=typeof i.block_id=="string"?{block_id:i.block_id}:{};switch(i.type){case"heading":{const o=c(i.text);if(!o){t("a heading without text");continue}const s=i.level===2||i.level===3?i.level:1;n.push({...r,type:"heading",level:s,text:o});break}case"paragraph":{const o=c(i.text);if(!o){t("a paragraph without text");continue}n.push({...r,type:"paragraph",text:o});break}case"quote":{const o=c(i.text);if(!o){t("a quote without text");continue}n.push({...r,type:"quote",text:o});break}case"code":{const o=ft(i.text);if(!o){t("a code block without text");continue}const s=typeof i.lang=="string"?{lang:i.lang.slice(0,32)}:{};n.push({...r,type:"code",...s,text:o});break}case"divider":n.push({...r,type:"divider"});break;case"list":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const p of o){if(s.length>=D){t("more than "+D+" list items");break}const d=c(p?.text);if(!d)continue;const l=c(p?.lead,200);s.push(l?{lead:l,text:d}:{text:d})}if(s.length===0){t("a list without usable items");continue}const m=i.style==="numbered"?"numbered":"bulleted";n.push({...r,type:"list",style:m,items:s});break}case"table":{const o=Array.isArray(i.columns)?i.columns:[],s=[];for(const l of o){if(s.length>=U){t("more than "+U+" table columns");break}const A=c(l?.label,I),R=l?.align==="right"?"right":void 0;s.push(R?{label:A,align:R}:{label:A})}if(s.length===0){t("a table without columns");continue}const m=Array.isArray(i.rows)?i.rows:[],p=[];for(const l of m){if(p.length>=$){t("more than "+$+" table rows");break}const A=Array.isArray(l)?l:[];p.push(s.map((R,Ke)=>c(A[Ke],I)))}const d=c(i.caption,I);n.push({...r,type:"table",columns:s,rows:p,...d?{caption:d}:{}});break}case"kpi":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const m of o){if(s.length>=w){t("more than "+w+" kpi items");break}const p=c(m?.value,40),d=c(m?.label,80);if(!p||!d)continue;const l=m?.tone;s.push(typeof l=="string"&&ge.has(l)?{value:p,label:d,tone:l}:{value:p,label:d})}if(s.length===0){t("a kpi block without usable items");continue}n.push({...r,type:"kpi",items:s});break}case"callout":{const o=c(i.text);if(!o){t("a callout without text");continue}const s=c(i.title,200);n.push({...r,type:"callout",tone:gt(i.tone),...s?{title:s}:{},text:o});break}}}return n}function At(e){return JSON.stringify(e).length}function Et(e){return{blocks:e.length,types:e.map(t=>t.type),headings:e.flatMap(t=>t.type==="heading"?[t.text]:[])}}function J(e){return e.replace(/\|/g,"\\|").replace(/\r?\n/g," ").trim()}function Q(e,t,n){const a=e.map((i,r)=>n?.[r]==="right"?"---:":"---");return[`| ${e.map(J).join(" | ")} |`,`| ${a.join(" | ")} |`,...t.map(i=>`| ${i.map(J).join(" | ")} |`)]}function yt(e){switch(e.type){case"heading":return[`${"#".repeat(e.level)} ${e.text}`];case"paragraph":return[e.text];case"quote":return e.text.split(/\r?\n/).map(t=>`> ${t}`);case"code":return[`\`\`\`${e.lang??""}`,e.text,"```"];case"divider":return["---"];case"list":return e.items.map((t,n)=>{const a=e.style==="numbered"?`${n+1}.`:"-";return t.lead?`${a} **${t.lead}** ${t.text}`:`${a} ${t.text}`});case"table":{const t=Q(e.columns.map(n=>n.label),e.rows,e.columns.map(n=>n.align??"left"));return e.caption?[...t,"",`*${e.caption}*`]:t}case"kpi":return Q(e.items.map(t=>t.value),[e.items.map(t=>t.label)]);case"callout":return(e.title?`**${e.title}** ${e.text}`:e.text).split(/\r?\n/).map(n=>`> ${n}`)}}function _t(e,t){const n=[],a=e.some(i=>i.type==="heading"&&i.level===1);t&&!a&&n.push(`# ${t}`);for(const i of e){const r=yt(i);r.length>0&&n.push(r.join(`
|
|
2
2
|
`))}return`${n.join(`
|
|
3
3
|
|
|
4
4
|
`)}
|
|
5
|
-
`}const G=e=>`user:${e}`,B=e=>`team:${e}`;function
|
|
5
|
+
`}const G=e=>`user:${e}`,B=e=>`team:${e}`;function Tt(e){const t=new Set;for(const n of e??[])n?.id&&(n.kind==="user"&&t.add(G(n.id)),n.kind==="team"&&t.add(B(n.id)));return[...t].sort()}function bt(e,t){return[G(e),...t.map(B)]}function It(e){const t=new Set;for(const n of e??[])n?.kind&&t.add(n.kind);return[...t]}function St(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const Mt=[{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"}],Nt={topics:[{name:"topic",type:"string"},{name:"confidence",type:"number"}],question:[{name:"answer",type:"boolean"},{name:"confidence",type:"number"}],extract:[]};function ye(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function Ct(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 a=t.slice(0,n),i=t.slice(n+1).trim();if(i){if(a==="user")return{kind:"user",userId:i};if(a==="team")return{kind:"team",teamId:i}}}function _e(e){return ye(e)}function Rt(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 Ot(e){return _e(e)}const Te=["done","escalated","failed","timed_out","stopped"],be=["awaiting_approval","awaiting_reply"];function Ie(e){return Te.includes(e)}function vt(e){return Ie(e)}function Lt(e){return be.includes(e)}const F=[{id:"openai",attachmentKinds:["image","pdf"],label:"OpenAI",capabilities:["chat","transcription","embedding"],defaultModel:"gpt-5-mini",baseUrl:"https://api.openai.com/v1"},{id:"gemini",attachmentKinds:["image","pdf"],label:"Google Gemini",capabilities:["chat","transcription","embedding"],defaultModel:"gemini-3.5-flash",baseUrl:"https://generativelanguage.googleapis.com/v1beta"},{id:"anthropic",attachmentKinds:["image","pdf"],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 h(e){return F.find(t=>t.id===e)}function kt(e){return h(e)?.label??e}function xt(e,t="gpt-5-mini"){return h(e)?.defaultModel??t}function Dt(e){return F.filter(t=>t.capabilities.includes(e))}function $t(e){const t=h(e);return!!t&&!t.baseUrl}function Ut(e,t){return t==="text"?!0:h(e)?.attachmentKinds?.includes(t)===!0}const wt=new Set(["mail","message"]);function Se(e,t){const n=e.settings?.signatures?.[t];return!n||!n.enabled||!n.body||n.body.trim()===""?null:n}function Pt(e,t,n,a="html"){if(!e)return n;const i=Se(e,t);return i?`${n}${a==="text"?`
|
|
6
6
|
|
|
7
|
-
`:t==="mail"?"<br><br>-- <br>":"<br><br>"}${i.body}`:n}function
|
|
7
|
+
`:t==="mail"?"<br><br>-- <br>":"<br><br>"}${i.body}`:n}function Kt(e){return e.endpoints??[]}const Gt=e=>!!e.assignedUserId||!!e.assignedInboxId,Bt=e=>e.status==="closed",Ft=e=>({urgent:10,high:5,normal:2,low:1})[e.priority]||0,Vt=(e,t=30)=>e.title?.length<=t?e.title:`${e.title.substring(0,t)}...`;function Ht(e,t){return e.lastActivityAt?!(e.seenBy??[]).includes(t):!1}const jt=2e3,Xt=500,Wt=12e3,Yt=4e3,Me=["contact","company"];function zt(e){if(!e)return!1;const t=e.slice(0,e.indexOf(":"));return Me.includes(t)}const C={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}},Ne="NL",qt=15,Jt=8,Qt=Array.from(new Set(Object.values(C).map(e=>e.callingCode))).sort((e,t)=>t.length-e.length);function Z(e){if(e)return C[e.trim().toUpperCase()]}function S(e,t){return e.length>=t.nsnMin&&e.length<=t.nsnMax}function ee(e){if(e.length>qt)return null;for(const t of Qt){if(!e.startsWith(t))continue;const n=e.slice(t.length);for(const a of Object.values(C)){if(a.callingCode!==t)continue;const i=a.trunkPrefix,r=i&&n.startsWith(i)?n.slice(i.length):n;if(S(r,a))return`+${t}${r}`}return null}return e.length<Jt?null:`+${e}`}function Zt(e){let t=e.trim();const n=t.match(/^(sips?|tel|whatsapp):/i);n&&(t=t.slice(n[0].length));const a=t.indexOf("@");return a>=0&&(t=t.slice(0,a)),t.trim()}function en(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 P(e,t){if(!e)return null;const n=Zt(e);if(!n)return null;const a=n.startsWith("+"),i=n.replace(/\D/g,"");if(!i)return null;if(a)return ee(i);if(i.startsWith("00"))return ee(i.slice(2));const r=Z(t)??Z(Ne);if(!r)return null;const o=r.trunkPrefix;if(o&&i.startsWith(o)){const s=i.slice(o.length);return S(s,r)?`+${r.callingCode}${s}`:null}if(i.startsWith(r.callingCode)){const s=i.slice(r.callingCode.length);if(S(s,r))return`+${r.callingCode}${s}`}return!o&&S(i,r)?`+${r.callingCode}${i}`:null}function tn(e,t=9){const n=(e??"").replace(/\D/g,"");return n.length<t?null:n.slice(-t)}function V(e){if(!e)return null;const t=e.trim().toLowerCase(),n=t.lastIndexOf("@");if(n<=0||n===t.length-1)return null;const a=t.slice(0,n).split("+")[0],i=t.slice(n+1);return!a||!i.includes(".")?null:`${a}@${i}`}function nn(e){const t=V(e);return t?t.slice(t.lastIndexOf("@")+1):null}const an=new Set(["co.uk","org.uk","gov.uk","ac.uk","com.au","co.nz","com.br","co.za"]);function Ce(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 an.has(n)&&t.length>=3?t.slice(-3).join("."):n}const Re=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 rn(e){const t=Ce(e);return t?Re.has(t):!1}function on(e){if(!e)return!1;const t=e.trim().toLowerCase();return t==="tel"||t==="sms"||t==="whatsapp"||t==="fax"}function sn(e,t,n){if(!e||!t)return null;const a=e.trim().toLowerCase();if(a==="tel"||a==="sms"||a==="whatsapp"){const r=P(t,n);return r?`tel:${r}`:null}if(a==="fax"){const r=P(t,n);return r?`fax:${r}`:null}if(a==="mailto"||a==="email"){const r=V(t);return r?`mailto:${r}`:null}const i=t.trim().toLowerCase();return i?`${a}:${i}`:null}const ln=/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g,cn=/(\*|_)(?=\S)([^*_\n]*?\S)\1/g;function un(e){if(typeof e!="string"||!e)return"";let t=e;return t=t.replace(/```[a-z]*\n?/gi,"").replace(/~~~[a-z]*\n?/gi,""),t=t.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1"),t=t.replace(/\[([^\]]*)\]\([^)]*\)/g,"$1"),t=t.replace(/\[([^\]]*)\]\[[^\]]*\]/g,"$1"),t=t.replace(/<((?:https?|mailto):[^>\s]+)>/gi,"$1"),t=t.split(`
|
|
8
8
|
`).map(n=>n.replace(/^\s{0,3}#{1,6}\s+/,"").replace(/^\s{0,3}>\s?/,"").replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+[.)]\s+/,"").replace(/^\s*(?:[-*_]\s*){3,}$/,"")).join(`
|
|
9
|
-
`),t=t.replace(
|
|
10
|
-
`);for(let n=0;n<t.length;n++)if(
|
|
9
|
+
`),t=t.replace(ln,"$2"),t=t.replace(cn,"$2"),t=t.replace(/~~(?=\S)([\s\S]*?\S)~~/g,"$1"),t=t.replace(/`([^`\n]+)`/g,"$1"),t.replace(/\s+/g," ").trim()}const pn=[/<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],te=/^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i,dn=/^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;function mn(e){const t=e.split(`
|
|
10
|
+
`);for(let n=0;n<t.length;n++)if(dn.test(t[n])||te.test(t[n])&&t.slice(n+1,n+4).some(a=>te.test(a)))return t.slice(0,n).join(`
|
|
11
11
|
`).trim();return e}function ne(e){let t=e;return t=t.replace(/<(script|style)[\s\S]*?<\/\1>/gi,""),t=t.replace(/<br\s*\/?>/gi,`
|
|
12
12
|
`),t=t.replace(/<\/(p|h[1-6]|ul|ol|table|blockquote)>/gi,`
|
|
13
13
|
|
|
@@ -15,4 +15,4 @@
|
|
|
15
15
|
`),t=t.replace(/<\/(td|th)>/gi," "),t=t.replace(/<[^>]+>/g,""),t=t.replace(/<[^>]*$/,""),t}function ie(e){return!Number.isInteger(e)||e<0||e>1114111?null:String.fromCodePoint(e)}function ae(e){return e.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/&#(\d+);/g,(t,n)=>ie(Number(n))??t).replace(/&#x([0-9a-f]+);/gi,(t,n)=>ie(parseInt(n,16))??t).replace(/&/gi,"&")}function re(e){return e.replace(/\r/g,"").replace(/[ \t]+/g," ").replace(/ *\n */g,`
|
|
16
16
|
`).replace(/\n{3,}/g,`
|
|
17
17
|
|
|
18
|
-
`).trim()}function
|
|
18
|
+
`).trim()}function fn(e){if(typeof e!="string"||!e)return"";let t=e.length;for(const r of pn){const o=e.search(r);o>=0&&o<t&&(t=o)}const n=e.slice(0,t);let a=re(ae(ne(n)));return a||(a=re(ae(ne(e)))),mn(a)||a}const gn=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,hn=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function An(e,t){return!!(e&&gn.test(e)||t&&hn.test(t))}const Oe=3,ve=600;function En(e,t){return e>=Oe||t>=ve}const yn=new Set(["image/png","image/jpeg","image/jpg","image/gif","image/webp"]),_n=new Set(["text/plain","text/markdown","text/csv","application/json","text/html","application/xml","text/xml"]);function Le(e){const t=(e??"").trim().toLowerCase().split(";")[0];return t?yn.has(t)?"image":t==="application/pdf"?"pdf":_n.has(t)?"text":t.startsWith("audio/")?"audio":"unsupported":"unsupported"}const g=1024*1024,ke={image:5*g,pdf:20*g,text:1*g,audio:20*g},Tn=25*g,bn=5;function In(e,t){const n=Le(e);return n==="unsupported"?"unsupported":t>ke[n]?"too-large":null}function xe(e,t){const n=new Set(e.disabledIntents??[]),a=e.intentOverrides??{},i=t.intents.filter(o=>!n.has(o.intent)).map(o=>Mn(o,a[o.intent]));if(!e.extraIntents||e.extraIntents.length===0)return i;const r=new Set(i.map(o=>o.intent));for(const o of e.extraIntents)r.has(o.intent)||(i.push(o),r.add(o.intent));return i}function De(e,t){const n={};for(const a of e.intents){if(!a.togglable)continue;const i=t?.[a.intent];n[a.intent]=i??a.defaultEnabled??!0}return n}function Sn(e,t){const n=De(e,t);return Object.entries(n).filter(([,a])=>!a).map(([a])=>a)}function Mn(e,t){return t?{intent:t.intent??e.intent,targetSchemes:t.targetSchemes??e.targetSchemes,transport:t.transport??e.transport}:e}function Nn(e,t){const n=[];for(const a of e){if(!a.enabled)continue;const i=t[a.providerId];if(i)for(const r of xe(a,i))n.push({channel:a,description:i,capability:r})}return n}function Cn(e,t){return t.filter(n=>n.capability.intent===e)}function $e(e,t){return t.filter(n=>n.capability.targetSchemes.includes(e))}function Rn(e,t){return $e(e.scheme,t)}function On(e,t,n){const a=[];for(const i of e)for(const r of n)r.capability.intent===t&&r.capability.targetSchemes.includes(i.scheme)&&a.push({channelIntent:r,endpoint:i});return a}var Ue=(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))(Ue||{});const vn={mailto:"mail",sip:"tel",tel:"tel",fax:"tel",sms:"chat",teams:"chat",telegram:"chat",messenger:"chat",instagram:"chat",viber:"chat",whatsapp:"wa",webhook:"note",url:"note",calendar:"note",username:"note",id:"note",custom:"note"};function Ln(e){return e?vn[e]??"note":"note"}const kn="message_window",xn="message_templates",Dn={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},$n=(e,t)=>({intent:e,...t}),Un="folder_management",wn="remote_search",Pn={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},we="auth";function Pe(e){const t=typeof e=="string"?e.match(/apps\/([^/?#]+)/):null;return t?t[1]:null}function Kn(e){const t=Pe(e);return t?t!==we:typeof e=="string"&&e.startsWith("/wake")}const Gn=9e4,Bn="installation-id";exports.ACTIVITY_CATALOG=f;exports.AI_ATTACHMENT_LIMITS=ke;exports.AI_ATTACHMENT_MAX_PER_TURN=bn;exports.AI_ATTACHMENT_TURN_BUDGET=Tn;exports.AI_VENDORS=F;exports.ALLOWED_LINK_SCHEMES=he;exports.ARTIFACT_MAX_BLOCKS=x;exports.ARTIFACT_MAX_BODY_BYTES=ct;exports.ARTIFACT_MAX_CELL_LEN=I;exports.ARTIFACT_MAX_KPI_ITEMS=w;exports.ARTIFACT_MAX_LIST_ITEMS=D;exports.ARTIFACT_MAX_TABLE_COLUMNS=U;exports.ARTIFACT_MAX_TABLE_ROWS=$;exports.ARTIFACT_MAX_TEXT_LEN=K;exports.AUTH_APP_NAME=we;exports.ActivityTypeRegistry=ce;exports.BUILT_IN_ONLY=Qe;exports.CLASSIFY_VARS=Nt;exports.CORE_DIMENSIONS=it;exports.CommunicationScheme=Ue;exports.DEFAULT_MEMORY_BUDGET=Yt;exports.DEFAULT_PHONE_REGION=Ne;exports.FEATURE_FOLDER_MANAGEMENT=Un;exports.FEATURE_REMOTE_SEARCH=wn;exports.INSTALLATION_HEADER=Bn;exports.InteractionParticipantRole=Dn;exports.MAX_ACTIONS=b;exports.MAX_BLOCKS=k;exports.MAX_FIELDS=_;exports.MAX_LIST_ITEMS=T;exports.MAX_MEMORY_BUDGET=Wt;exports.MAX_MEMORY_CHARS=jt;exports.MIN_MEMORY_BUDGET=Xt;exports.PAUSED_RUN_STATUSES=be;exports.PHONE_REGIONS=C;exports.PRESENCE_ONLINE_WINDOW_MS=Gn;exports.PROVIDER_FEATURE_MESSAGE_TEMPLATES=xn;exports.PROVIDER_FEATURE_MESSAGE_WINDOW=kn;exports.PUBLIC_EMAIL_DOMAINS=Re;exports.RELATED_SUBJECT_KINDS=Me;exports.SIGNATURE_INTENTS=wt;exports.SUMMARY_MIN_LAST_CHARS=ve;exports.SUMMARY_MIN_MESSAGES=Oe;exports.TERMINAL_RUN_STATUSES=Te;exports.TRIGGER_VARS=Mt;exports.UNSUPPORTED=Pn;exports.USAGE_DIMENSIONS=de;exports.USAGE_DIMENSION_IDS=me;exports.actingIdentityKey=_e;exports.activityIconOf=Fe;exports.activityJoinUrl=qe;exports.activitySnippet=se;exports.activityTextParams=le;exports.activityTimelineText=ze;exports.activityTimestamp=nt;exports.activityTypeInfo=u;exports.actorKey=Ot;exports.aiAttachmentKind=Le;exports.aiAttachmentRejection=In;exports.aiVendorAcceptsAttachment=Ut;exports.aiVendorDefaultModel=xt;exports.aiVendorLabel=kt;exports.aiVendorNeedsBaseUrl=$t;exports.aiVendorsWith=Dt;exports.appNameFromPath=Pe;exports.applySignature=Pt;exports.artifactBodyBytes=At;exports.artifactOutline=Et;exports.artifactToMarkdown=_t;exports.buildActivityPreview=et;exports.buildChannelIntents=Nn;exports.buildShareKeys=Tt;exports.carriesText=Xe;exports.channelKindForScheme=Ln;exports.channelKindOf=Ve;exports.cleanMessageText=fn;exports.defineIntent=$n;exports.disabledIntentsFromCapabilities=Sn;exports.emailDomain=nn;exports.endpointKey=sn;exports.filterByEndpoint=Rn;exports.filterByIntent=Cn;exports.filterByTargetScheme=$e;exports.findAiVendor=h;exports.flattenLocales=at;exports.floorToPeriod=pe;exports.formatActingIdentity=ye;exports.formatPeriod=ue;exports.getActivitySeenUserIds=tt;exports.getContactEndpoints=Kt;exports.getShortTitle=Vt;exports.getUrgencyScore=Ft;exports.humanizeAction=St;exports.isAssigned=Gt;exports.isClosed=Bt;exports.isDeepLink=Kn;exports.isInteractionUnseen=Ht;exports.isLikelyBulk=An;exports.isMessageType=He;exports.isPaused=Lt;exports.isPlaybookAuthoredType=Ye;exports.isPublicEmailDomain=rn;exports.isReplyableType=je;exports.isRetryable=vt;exports.isTerminal=Ie;exports.isThreadLongEnough=En;exports.looksLikeEmail=en;exports.matchContactToIntents=On;exports.messageCountsAs=We;exports.needsPhoneRegion=on;exports.normalizeArtifactBlocks=ht;exports.normalizeBlocks=Be;exports.normalizeEmail=V;exports.parseActingIdentity=Ct;exports.periodsInRange=st;exports.phoneSuffix=tn;exports.plainTextFromMarkdown=un;exports.playbookActor=Rt;exports.readPath=M;exports.registrableDomain=Ce;exports.relatedByDefault=zt;exports.resolveAccountCapabilities=De;exports.resolveActivityText=N;exports.resolveChannelIntents=xe;exports.resolveSignature=Se;exports.sanitizeInline=Ee;exports.shareKeyForTeam=B;exports.shareKeyForUser=G;exports.shareKeysForViewer=bt;exports.stripHtml=oe;exports.toE164=P;exports.toolSourceKinds=It;exports.usageMetricId=fe;exports.usageMetrics=lt;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ut = 10, pt = 10, dt = 10, mt = 5, re = /* @__PURE__ */ new Set([
|
|
2
2
|
"header",
|
|
3
3
|
"section",
|
|
4
4
|
"context",
|
|
@@ -14,7 +14,7 @@ function T(e) {
|
|
|
14
14
|
const t = e;
|
|
15
15
|
return typeof t.key == "string" || typeof t.value == "string";
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function ft(e, t = () => {
|
|
18
18
|
}) {
|
|
19
19
|
if (!Array.isArray(e)) return [];
|
|
20
20
|
const n = [];
|
|
@@ -83,7 +83,7 @@ function k(e) {
|
|
|
83
83
|
function I(e) {
|
|
84
84
|
return e?.split("@")?.[0] || e || "";
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function A(e) {
|
|
87
87
|
return e.map((t) => t.name).join(", ");
|
|
88
88
|
}
|
|
89
89
|
function x(e) {
|
|
@@ -243,9 +243,9 @@ const f = {
|
|
|
243
243
|
shape: "event",
|
|
244
244
|
channelKind: "chat",
|
|
245
245
|
icon: "message-circle",
|
|
246
|
-
snippet: (e) => `${
|
|
246
|
+
snippet: (e) => `${A(e.payload.members)} toegevoegd`,
|
|
247
247
|
timeline: (e) => {
|
|
248
|
-
const t =
|
|
248
|
+
const t = A(e.payload.members) || "Someone", n = e.payload.initiator?.name ? ` · added by ${e.payload.initiator.name}` : "";
|
|
249
249
|
return `${t} joined the chat${n}`;
|
|
250
250
|
}
|
|
251
251
|
},
|
|
@@ -253,9 +253,9 @@ const f = {
|
|
|
253
253
|
shape: "event",
|
|
254
254
|
channelKind: "chat",
|
|
255
255
|
icon: "message-circle",
|
|
256
|
-
snippet: (e) => `${
|
|
256
|
+
snippet: (e) => `${A(e.payload.members)} verlaten`,
|
|
257
257
|
timeline: (e) => {
|
|
258
|
-
const t =
|
|
258
|
+
const t = A(e.payload.members) || "Someone", n = e.payload.initiator?.name ? ` · removed by ${e.payload.initiator.name}` : "";
|
|
259
259
|
return `${t} left the chat${n}`;
|
|
260
260
|
}
|
|
261
261
|
},
|
|
@@ -411,37 +411,37 @@ function O(e) {
|
|
|
411
411
|
function d(e) {
|
|
412
412
|
return f[e];
|
|
413
413
|
}
|
|
414
|
-
function
|
|
414
|
+
function gt(e) {
|
|
415
415
|
return d(e)?.icon ?? "circle";
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function ht(e) {
|
|
418
418
|
return d(e)?.channelKind;
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function yt(e) {
|
|
421
421
|
const t = d(e)?.shape;
|
|
422
422
|
return t === "message" || t === "note";
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function At(e) {
|
|
425
425
|
return d(e)?.replyable === !0;
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function bt(e) {
|
|
428
428
|
return d(e)?.carriesText === !0;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function Et(e) {
|
|
431
431
|
return d(e)?.countsAs;
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function _t(e) {
|
|
434
434
|
return d(e)?.playbookAuthored === !0;
|
|
435
435
|
}
|
|
436
436
|
function se(e) {
|
|
437
437
|
const t = d(e.type)?.snippet;
|
|
438
438
|
return t ? t(e) : "";
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function Tt(e, t) {
|
|
441
441
|
const n = d(e.type)?.timeline;
|
|
442
442
|
return n ? n(e, t) : e.type.replace(/_/g, " ").toLowerCase();
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function It(e) {
|
|
445
445
|
const t = d(e.type)?.joinUrl;
|
|
446
446
|
return t ? t(e) : void 0;
|
|
447
447
|
}
|
|
@@ -552,12 +552,12 @@ class ue {
|
|
|
552
552
|
return this.translate;
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
const
|
|
555
|
+
const St = new ue(), R = 140;
|
|
556
556
|
function pe(e) {
|
|
557
557
|
const t = e.trim();
|
|
558
558
|
return t.length <= R ? t : t.slice(0, R - 1).trimEnd() + "…";
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function Mt(e, t) {
|
|
561
561
|
const n = le(t?.text, e), a = t ? N(t.text, e, (i) => i) : null;
|
|
562
562
|
return {
|
|
563
563
|
activityId: e.id,
|
|
@@ -569,16 +569,16 @@ function It(e, t) {
|
|
|
569
569
|
...n ? { snippetKey: n.key, snippetParams: n.params } : {}
|
|
570
570
|
};
|
|
571
571
|
}
|
|
572
|
-
function
|
|
572
|
+
function Ct(e, t, n = []) {
|
|
573
573
|
const a = e.createdAt;
|
|
574
574
|
if (!a) return [];
|
|
575
575
|
const i = new Set(n);
|
|
576
576
|
return e.author.type === "user" && e.author.id && i.add(e.author.id), Object.entries(t).filter(([r, o]) => o >= a && !i.has(r)).map(([r]) => r);
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function Nt(e) {
|
|
579
579
|
return e.createdAt ?? 0;
|
|
580
580
|
}
|
|
581
|
-
const
|
|
581
|
+
const vt = [
|
|
582
582
|
{ id: "agent", label: "Agent", labelSource: "user" },
|
|
583
583
|
{ id: "team", label: "Team", labelSource: "team" },
|
|
584
584
|
{ id: "inbox", label: "Inbox", labelSource: "inbox" },
|
|
@@ -588,7 +588,7 @@ const Ct = [
|
|
|
588
588
|
{ id: "handledBy", label: "Afhandelaar", labelSource: "raw" },
|
|
589
589
|
{ id: "time", label: "Tijd", labelSource: "raw" }
|
|
590
590
|
];
|
|
591
|
-
function
|
|
591
|
+
function kt(e) {
|
|
592
592
|
const t = [];
|
|
593
593
|
for (const n of Object.keys(e))
|
|
594
594
|
for (const a of Object.keys(e[n]))
|
|
@@ -607,7 +607,7 @@ function me(e, t) {
|
|
|
607
607
|
return n.setUTCMinutes(0, 0, 0), t === "day" && n.setUTCHours(0), n.getTime();
|
|
608
608
|
}
|
|
609
609
|
const fe = 36e5, ge = 864e5;
|
|
610
|
-
function
|
|
610
|
+
function xt(e, t, n) {
|
|
611
611
|
const a = n === "hour" ? fe : ge, i = [];
|
|
612
612
|
for (let r = me(e, n); r <= t; r += a)
|
|
613
613
|
i.push(de(r, n));
|
|
@@ -617,12 +617,12 @@ const he = [
|
|
|
617
617
|
{ id: "resource", label: "Resource", labelSource: "raw" },
|
|
618
618
|
{ id: "origin", label: "Herkomst", labelSource: "raw" }
|
|
619
619
|
], ye = he.map((e) => e.id);
|
|
620
|
-
function
|
|
620
|
+
function Ae(e, t) {
|
|
621
621
|
return `${e}.usage.${t}`;
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function Ot(e, t) {
|
|
624
624
|
return t.map((n) => ({
|
|
625
|
-
id:
|
|
625
|
+
id: Ae(e, n.unit),
|
|
626
626
|
label: n.label,
|
|
627
627
|
category: "Verbruik",
|
|
628
628
|
valueType: n.valueType ?? "count",
|
|
@@ -635,7 +635,7 @@ function kt(e, t) {
|
|
|
635
635
|
]
|
|
636
636
|
}));
|
|
637
637
|
}
|
|
638
|
-
const J = /* @__PURE__ */ new Set(["info", "success", "warning", "destructive"]), D = 200, w = 100, U = 200, K = 12, P = 4, Q = 4e3, M = 500,
|
|
638
|
+
const J = /* @__PURE__ */ new Set(["info", "success", "warning", "destructive"]), D = 200, w = 100, U = 200, K = 12, P = 4, Q = 4e3, M = 500, Lt = 256 * 1024, be = /* @__PURE__ */ new Set([
|
|
639
639
|
"heading",
|
|
640
640
|
"paragraph",
|
|
641
641
|
"list",
|
|
@@ -704,7 +704,7 @@ function Me(e, t = Q) {
|
|
|
704
704
|
function Ce(e, t = "info") {
|
|
705
705
|
return typeof e == "string" && J.has(e) ? e : t;
|
|
706
706
|
}
|
|
707
|
-
function
|
|
707
|
+
function $t(e, t = () => {
|
|
708
708
|
}) {
|
|
709
709
|
if (!Array.isArray(e)) return [];
|
|
710
710
|
const n = [];
|
|
@@ -715,7 +715,7 @@ function Ot(e, t = () => {
|
|
|
715
715
|
}
|
|
716
716
|
if (!a || typeof a != "object") continue;
|
|
717
717
|
const i = a;
|
|
718
|
-
if (!
|
|
718
|
+
if (!be.has(i.type)) {
|
|
719
719
|
t("unknown block type " + String(i.type));
|
|
720
720
|
continue;
|
|
721
721
|
}
|
|
@@ -858,10 +858,10 @@ function Ot(e, t = () => {
|
|
|
858
858
|
}
|
|
859
859
|
return n;
|
|
860
860
|
}
|
|
861
|
-
function
|
|
861
|
+
function Rt(e) {
|
|
862
862
|
return JSON.stringify(e).length;
|
|
863
863
|
}
|
|
864
|
-
function
|
|
864
|
+
function Dt(e) {
|
|
865
865
|
return {
|
|
866
866
|
blocks: e.length,
|
|
867
867
|
types: e.map((t) => t.type),
|
|
@@ -913,7 +913,7 @@ function Ne(e) {
|
|
|
913
913
|
return (e.title ? `**${e.title}** ${e.text}` : e.text).split(/\r?\n/).map((n) => `> ${n}`);
|
|
914
914
|
}
|
|
915
915
|
}
|
|
916
|
-
function
|
|
916
|
+
function wt(e, t) {
|
|
917
917
|
const n = [], a = e.some((i) => i.type === "heading" && i.level === 1);
|
|
918
918
|
t && !a && n.push(`# ${t}`);
|
|
919
919
|
for (const i of e) {
|
|
@@ -927,25 +927,25 @@ function Rt(e, t) {
|
|
|
927
927
|
`;
|
|
928
928
|
}
|
|
929
929
|
const ee = (e) => `user:${e}`, te = (e) => `team:${e}`;
|
|
930
|
-
function
|
|
930
|
+
function Ut(e) {
|
|
931
931
|
const t = /* @__PURE__ */ new Set();
|
|
932
932
|
for (const n of e ?? [])
|
|
933
933
|
n?.id && (n.kind === "user" && t.add(ee(n.id)), n.kind === "team" && t.add(te(n.id)));
|
|
934
934
|
return [...t].sort();
|
|
935
935
|
}
|
|
936
|
-
function
|
|
936
|
+
function Kt(e, t) {
|
|
937
937
|
return [ee(e), ...t.map(te)];
|
|
938
938
|
}
|
|
939
|
-
function
|
|
939
|
+
function Pt(e) {
|
|
940
940
|
const t = /* @__PURE__ */ new Set();
|
|
941
941
|
for (const n of e ?? [])
|
|
942
942
|
n?.kind && t.add(n.kind);
|
|
943
943
|
return [...t];
|
|
944
944
|
}
|
|
945
|
-
function
|
|
945
|
+
function Gt(e) {
|
|
946
946
|
return (e.startsWith("tool:") ? e.slice(5) : e).replace(/__/g, " · ").replace(/\./g, " · ").replace(/_/g, " ");
|
|
947
947
|
}
|
|
948
|
-
const
|
|
948
|
+
const Vt = [
|
|
949
949
|
{ name: "text", type: "string" },
|
|
950
950
|
{ name: "subject", type: "string" },
|
|
951
951
|
{ name: "from", type: "string" },
|
|
@@ -968,7 +968,7 @@ const Pt = [
|
|
|
968
968
|
// een nieuw adres) — een stap die hierop leunt hoort dus een `condition` te hebben.
|
|
969
969
|
{ name: "contactId", type: "string" },
|
|
970
970
|
{ name: "companyId", type: "string" }
|
|
971
|
-
],
|
|
971
|
+
], jt = {
|
|
972
972
|
topics: [
|
|
973
973
|
{ name: "topic", type: "string" },
|
|
974
974
|
{ name: "confidence", type: "number" }
|
|
@@ -989,7 +989,7 @@ function ve(e) {
|
|
|
989
989
|
return "org";
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
|
-
function
|
|
992
|
+
function Bt(e) {
|
|
993
993
|
if (typeof e != "string") return;
|
|
994
994
|
const t = e.trim();
|
|
995
995
|
if (t === "org") return { kind: "org" };
|
|
@@ -1004,7 +1004,7 @@ function Vt(e) {
|
|
|
1004
1004
|
function ke(e) {
|
|
1005
1005
|
return ve(e);
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1007
|
+
function Ht(e) {
|
|
1008
1008
|
switch (e.kind) {
|
|
1009
1009
|
case "personal":
|
|
1010
1010
|
return { kind: "user", userId: e.userId };
|
|
@@ -1014,17 +1014,17 @@ function jt(e) {
|
|
|
1014
1014
|
return { kind: "org" };
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
|
-
function
|
|
1017
|
+
function Ft(e) {
|
|
1018
1018
|
return ke(e);
|
|
1019
1019
|
}
|
|
1020
1020
|
const xe = ["done", "escalated", "failed", "timed_out", "stopped"], Oe = ["awaiting_approval", "awaiting_reply"];
|
|
1021
1021
|
function Le(e) {
|
|
1022
1022
|
return xe.includes(e);
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1024
|
+
function Xt(e) {
|
|
1025
1025
|
return Le(e);
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1027
|
+
function Wt(e) {
|
|
1028
1028
|
return Oe.includes(e);
|
|
1029
1029
|
}
|
|
1030
1030
|
const ne = [
|
|
@@ -1121,48 +1121,48 @@ const ne = [
|
|
|
1121
1121
|
function E(e) {
|
|
1122
1122
|
return ne.find((t) => t.id === e);
|
|
1123
1123
|
}
|
|
1124
|
-
function
|
|
1124
|
+
function zt(e) {
|
|
1125
1125
|
return E(e)?.label ?? e;
|
|
1126
1126
|
}
|
|
1127
|
-
function
|
|
1127
|
+
function Yt(e, t = "gpt-5-mini") {
|
|
1128
1128
|
return E(e)?.defaultModel ?? t;
|
|
1129
1129
|
}
|
|
1130
|
-
function
|
|
1130
|
+
function qt(e) {
|
|
1131
1131
|
return ne.filter((t) => t.capabilities.includes(e));
|
|
1132
1132
|
}
|
|
1133
|
-
function
|
|
1133
|
+
function Jt(e) {
|
|
1134
1134
|
const t = E(e);
|
|
1135
1135
|
return !!t && !t.baseUrl;
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1137
|
+
function Qt(e, t) {
|
|
1138
1138
|
return t === "text" ? !0 : E(e)?.attachmentKinds?.includes(t) === !0;
|
|
1139
1139
|
}
|
|
1140
|
-
const
|
|
1140
|
+
const Zt = /* @__PURE__ */ new Set(["mail", "message"]);
|
|
1141
1141
|
function $e(e, t) {
|
|
1142
1142
|
const n = e.settings?.signatures?.[t];
|
|
1143
1143
|
return !n || !n.enabled || !n.body || n.body.trim() === "" ? null : n;
|
|
1144
1144
|
}
|
|
1145
|
-
function
|
|
1145
|
+
function en(e, t, n, a = "html") {
|
|
1146
1146
|
if (!e) return n;
|
|
1147
1147
|
const i = $e(e, t);
|
|
1148
1148
|
return i ? `${n}${a === "text" ? `
|
|
1149
1149
|
|
|
1150
1150
|
` : t === "mail" ? "<br><br>-- <br>" : "<br><br>"}${i.body}` : n;
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function tn(e) {
|
|
1153
1153
|
return e.endpoints ?? [];
|
|
1154
1154
|
}
|
|
1155
|
-
const
|
|
1155
|
+
const nn = (e) => !!e.assignedUserId || !!e.assignedInboxId, an = (e) => e.status === "closed", rn = (e) => ({
|
|
1156
1156
|
urgent: 10,
|
|
1157
1157
|
high: 5,
|
|
1158
1158
|
normal: 2,
|
|
1159
1159
|
low: 1
|
|
1160
|
-
})[e.priority] || 0,
|
|
1161
|
-
function
|
|
1160
|
+
})[e.priority] || 0, on = (e, t = 30) => e.title?.length <= t ? e.title : `${e.title.substring(0, t)}...`;
|
|
1161
|
+
function sn(e, t) {
|
|
1162
1162
|
return e.lastActivityAt ? !(e.seenBy ?? []).includes(t) : !1;
|
|
1163
1163
|
}
|
|
1164
|
-
const
|
|
1165
|
-
function
|
|
1164
|
+
const ln = 2e3, cn = 500, un = 12e3, pn = 4e3, Re = ["contact", "company"];
|
|
1165
|
+
function dn(e) {
|
|
1166
1166
|
if (!e) return !1;
|
|
1167
1167
|
const t = e.slice(0, e.indexOf(":"));
|
|
1168
1168
|
return Re.includes(t);
|
|
@@ -1197,7 +1197,7 @@ function B(e) {
|
|
|
1197
1197
|
if (e)
|
|
1198
1198
|
return v[e.trim().toUpperCase()];
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1200
|
+
function b(e, t) {
|
|
1201
1201
|
return e.length >= t.nsnMin && e.length <= t.nsnMax;
|
|
1202
1202
|
}
|
|
1203
1203
|
function H(e) {
|
|
@@ -1208,7 +1208,7 @@ function H(e) {
|
|
|
1208
1208
|
for (const a of Object.values(v)) {
|
|
1209
1209
|
if (a.callingCode !== t) continue;
|
|
1210
1210
|
const i = a.trunkPrefix, r = i && n.startsWith(i) ? n.slice(i.length) : n;
|
|
1211
|
-
if (
|
|
1211
|
+
if (b(r, a)) return `+${t}${r}`;
|
|
1212
1212
|
}
|
|
1213
1213
|
return null;
|
|
1214
1214
|
}
|
|
@@ -1221,7 +1221,7 @@ function Pe(e) {
|
|
|
1221
1221
|
const a = t.indexOf("@");
|
|
1222
1222
|
return a >= 0 && (t = t.slice(0, a)), t.trim();
|
|
1223
1223
|
}
|
|
1224
|
-
function
|
|
1224
|
+
function mn(e) {
|
|
1225
1225
|
if (!e) return !1;
|
|
1226
1226
|
const t = e.indexOf("@");
|
|
1227
1227
|
if (t <= 0) return !1;
|
|
@@ -1241,15 +1241,15 @@ function F(e, t) {
|
|
|
1241
1241
|
const o = r.trunkPrefix;
|
|
1242
1242
|
if (o && i.startsWith(o)) {
|
|
1243
1243
|
const s = i.slice(o.length);
|
|
1244
|
-
return
|
|
1244
|
+
return b(s, r) ? `+${r.callingCode}${s}` : null;
|
|
1245
1245
|
}
|
|
1246
1246
|
if (i.startsWith(r.callingCode)) {
|
|
1247
1247
|
const s = i.slice(r.callingCode.length);
|
|
1248
|
-
if (
|
|
1248
|
+
if (b(s, r)) return `+${r.callingCode}${s}`;
|
|
1249
1249
|
}
|
|
1250
|
-
return !o &&
|
|
1250
|
+
return !o && b(i, r) ? `+${r.callingCode}${i}` : null;
|
|
1251
1251
|
}
|
|
1252
|
-
function
|
|
1252
|
+
function fn(e, t = 9) {
|
|
1253
1253
|
const n = (e ?? "").replace(/\D/g, "");
|
|
1254
1254
|
return n.length < t ? null : n.slice(-t);
|
|
1255
1255
|
}
|
|
@@ -1260,7 +1260,7 @@ function ie(e) {
|
|
|
1260
1260
|
const a = t.slice(0, n).split("+")[0], i = t.slice(n + 1);
|
|
1261
1261
|
return !a || !i.includes(".") ? null : `${a}@${i}`;
|
|
1262
1262
|
}
|
|
1263
|
-
function
|
|
1263
|
+
function gn(e) {
|
|
1264
1264
|
const t = ie(e);
|
|
1265
1265
|
return t ? t.slice(t.lastIndexOf("@") + 1) : null;
|
|
1266
1266
|
}
|
|
@@ -1326,16 +1326,16 @@ const je = /* @__PURE__ */ new Set([
|
|
|
1326
1326
|
"proximus.be",
|
|
1327
1327
|
"scarlet.be"
|
|
1328
1328
|
]);
|
|
1329
|
-
function
|
|
1329
|
+
function hn(e) {
|
|
1330
1330
|
const t = Ve(e);
|
|
1331
1331
|
return t ? je.has(t) : !1;
|
|
1332
1332
|
}
|
|
1333
|
-
function
|
|
1333
|
+
function yn(e) {
|
|
1334
1334
|
if (!e) return !1;
|
|
1335
1335
|
const t = e.trim().toLowerCase();
|
|
1336
1336
|
return t === "tel" || t === "sms" || t === "whatsapp" || t === "fax";
|
|
1337
1337
|
}
|
|
1338
|
-
function
|
|
1338
|
+
function An(e, t, n) {
|
|
1339
1339
|
if (!e || !t) return null;
|
|
1340
1340
|
const a = e.trim().toLowerCase();
|
|
1341
1341
|
if (a === "tel" || a === "sms" || a === "whatsapp") {
|
|
@@ -1354,7 +1354,7 @@ function hn(e, t, n) {
|
|
|
1354
1354
|
return i ? `${a}:${i}` : null;
|
|
1355
1355
|
}
|
|
1356
1356
|
const Be = /(\*\*|__)(?=\S)([\s\S]*?\S)\1/g, He = /(\*|_)(?=\S)([^*_\n]*?\S)\1/g;
|
|
1357
|
-
function
|
|
1357
|
+
function bn(e) {
|
|
1358
1358
|
if (typeof e != "string" || !e) return "";
|
|
1359
1359
|
let t = e;
|
|
1360
1360
|
return t = t.replace(/```[a-z]*\n?/gi, "").replace(/~~~[a-z]*\n?/gi, ""), t = t.replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1"), t = t.replace(/\[([^\]]*)\]\([^)]*\)/g, "$1"), t = t.replace(/\[([^\]]*)\]\[[^\]]*\]/g, "$1"), t = t.replace(/<((?:https?|mailto):[^>\s]+)>/gi, "$1"), t = t.split(`
|
|
@@ -1406,7 +1406,7 @@ function q(e) {
|
|
|
1406
1406
|
|
|
1407
1407
|
`).trim();
|
|
1408
1408
|
}
|
|
1409
|
-
function
|
|
1409
|
+
function En(e) {
|
|
1410
1410
|
if (typeof e != "string" || !e) return "";
|
|
1411
1411
|
let t = e.length;
|
|
1412
1412
|
for (const r of Fe) {
|
|
@@ -1418,11 +1418,11 @@ function bn(e) {
|
|
|
1418
1418
|
return a || (a = q(Y(W(e)))), We(a) || a;
|
|
1419
1419
|
}
|
|
1420
1420
|
const ze = /(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i, Ye = /\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;
|
|
1421
|
-
function
|
|
1421
|
+
function _n(e, t) {
|
|
1422
1422
|
return !!(e && ze.test(e) || t && Ye.test(t));
|
|
1423
1423
|
}
|
|
1424
1424
|
const qe = 3, Je = 600;
|
|
1425
|
-
function
|
|
1425
|
+
function Tn(e, t) {
|
|
1426
1426
|
return e >= qe || t >= Je;
|
|
1427
1427
|
}
|
|
1428
1428
|
const Qe = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/jpg", "image/gif", "image/webp"]), Ze = /* @__PURE__ */ new Set([
|
|
@@ -1443,8 +1443,8 @@ const g = 1024 * 1024, tt = {
|
|
|
1443
1443
|
pdf: 20 * g,
|
|
1444
1444
|
text: 1 * g,
|
|
1445
1445
|
audio: 20 * g
|
|
1446
|
-
},
|
|
1447
|
-
function
|
|
1446
|
+
}, In = 25 * g, Sn = 5;
|
|
1447
|
+
function Mn(e, t) {
|
|
1448
1448
|
const n = et(e);
|
|
1449
1449
|
return n === "unsupported" ? "unsupported" : t > tt[n] ? "too-large" : null;
|
|
1450
1450
|
}
|
|
@@ -1465,7 +1465,7 @@ function it(e, t) {
|
|
|
1465
1465
|
}
|
|
1466
1466
|
return n;
|
|
1467
1467
|
}
|
|
1468
|
-
function
|
|
1468
|
+
function Cn(e, t) {
|
|
1469
1469
|
const n = it(e, t);
|
|
1470
1470
|
return Object.entries(n).filter(([, a]) => !a).map(([a]) => a);
|
|
1471
1471
|
}
|
|
@@ -1476,7 +1476,7 @@ function at(e, t) {
|
|
|
1476
1476
|
transport: t.transport ?? e.transport
|
|
1477
1477
|
} : e;
|
|
1478
1478
|
}
|
|
1479
|
-
function
|
|
1479
|
+
function Nn(e, t) {
|
|
1480
1480
|
const n = [];
|
|
1481
1481
|
for (const a of e) {
|
|
1482
1482
|
if (!a.enabled) continue;
|
|
@@ -1487,16 +1487,16 @@ function Mn(e, t) {
|
|
|
1487
1487
|
}
|
|
1488
1488
|
return n;
|
|
1489
1489
|
}
|
|
1490
|
-
function
|
|
1490
|
+
function vn(e, t) {
|
|
1491
1491
|
return t.filter((n) => n.capability.intent === e);
|
|
1492
1492
|
}
|
|
1493
1493
|
function rt(e, t) {
|
|
1494
1494
|
return t.filter((n) => n.capability.targetSchemes.includes(e));
|
|
1495
1495
|
}
|
|
1496
|
-
function
|
|
1496
|
+
function kn(e, t) {
|
|
1497
1497
|
return rt(e.scheme, t);
|
|
1498
1498
|
}
|
|
1499
|
-
function
|
|
1499
|
+
function xn(e, t, n) {
|
|
1500
1500
|
const a = [];
|
|
1501
1501
|
for (const i of e)
|
|
1502
1502
|
for (const r of n)
|
|
@@ -1526,10 +1526,10 @@ const st = {
|
|
|
1526
1526
|
id: "note",
|
|
1527
1527
|
custom: "note"
|
|
1528
1528
|
};
|
|
1529
|
-
function
|
|
1529
|
+
function On(e) {
|
|
1530
1530
|
return e ? st[e] ?? "note" : "note";
|
|
1531
1531
|
}
|
|
1532
|
-
const
|
|
1532
|
+
const Ln = "message_window", $n = "message_templates", Rn = {
|
|
1533
1533
|
// E-mail
|
|
1534
1534
|
FROM: "from",
|
|
1535
1535
|
TO: "to",
|
|
@@ -1546,126 +1546,138 @@ const xn = "message_window", On = "message_templates", Ln = {
|
|
|
1546
1546
|
// Voice/conference
|
|
1547
1547
|
HOST: "host",
|
|
1548
1548
|
PARTICIPANT: "participant"
|
|
1549
|
-
},
|
|
1549
|
+
}, Dn = (e, t) => ({ intent: e, ...t }), wn = "folder_management", Un = "remote_search", Kn = { ok: !1, code: "UNSUPPORTED", message: "Provider does not support this op" }, lt = "auth";
|
|
1550
|
+
function ct(e) {
|
|
1551
|
+
const t = typeof e == "string" ? e.match(/apps\/([^/?#]+)/) : null;
|
|
1552
|
+
return t ? t[1] : null;
|
|
1553
|
+
}
|
|
1554
|
+
function Pn(e) {
|
|
1555
|
+
const t = ct(e);
|
|
1556
|
+
return t ? t !== lt : typeof e == "string" && e.startsWith("/wake");
|
|
1557
|
+
}
|
|
1558
|
+
const Gn = 9e4, Vn = "installation-id";
|
|
1550
1559
|
export {
|
|
1551
1560
|
f as ACTIVITY_CATALOG,
|
|
1552
1561
|
tt as AI_ATTACHMENT_LIMITS,
|
|
1553
|
-
|
|
1554
|
-
|
|
1562
|
+
Sn as AI_ATTACHMENT_MAX_PER_TURN,
|
|
1563
|
+
In as AI_ATTACHMENT_TURN_BUDGET,
|
|
1555
1564
|
ne as AI_VENDORS,
|
|
1556
1565
|
Ee as ALLOWED_LINK_SCHEMES,
|
|
1557
1566
|
D as ARTIFACT_MAX_BLOCKS,
|
|
1558
|
-
|
|
1567
|
+
Lt as ARTIFACT_MAX_BODY_BYTES,
|
|
1559
1568
|
M as ARTIFACT_MAX_CELL_LEN,
|
|
1560
1569
|
P as ARTIFACT_MAX_KPI_ITEMS,
|
|
1561
1570
|
w as ARTIFACT_MAX_LIST_ITEMS,
|
|
1562
1571
|
K as ARTIFACT_MAX_TABLE_COLUMNS,
|
|
1563
1572
|
U as ARTIFACT_MAX_TABLE_ROWS,
|
|
1564
1573
|
Q as ARTIFACT_MAX_TEXT_LEN,
|
|
1574
|
+
lt as AUTH_APP_NAME,
|
|
1565
1575
|
ue as ActivityTypeRegistry,
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1576
|
+
St as BUILT_IN_ONLY,
|
|
1577
|
+
jt as CLASSIFY_VARS,
|
|
1578
|
+
vt as CORE_DIMENSIONS,
|
|
1569
1579
|
ot as CommunicationScheme,
|
|
1570
|
-
|
|
1580
|
+
pn as DEFAULT_MEMORY_BUDGET,
|
|
1571
1581
|
De as DEFAULT_PHONE_REGION,
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1582
|
+
wn as FEATURE_FOLDER_MANAGEMENT,
|
|
1583
|
+
Un as FEATURE_REMOTE_SEARCH,
|
|
1584
|
+
Vn as INSTALLATION_HEADER,
|
|
1585
|
+
Rn as InteractionParticipantRole,
|
|
1586
|
+
mt as MAX_ACTIONS,
|
|
1587
|
+
ut as MAX_BLOCKS,
|
|
1588
|
+
pt as MAX_FIELDS,
|
|
1589
|
+
dt as MAX_LIST_ITEMS,
|
|
1590
|
+
un as MAX_MEMORY_BUDGET,
|
|
1591
|
+
ln as MAX_MEMORY_CHARS,
|
|
1592
|
+
cn as MIN_MEMORY_BUDGET,
|
|
1583
1593
|
Oe as PAUSED_RUN_STATUSES,
|
|
1584
1594
|
v as PHONE_REGIONS,
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1595
|
+
Gn as PRESENCE_ONLINE_WINDOW_MS,
|
|
1596
|
+
$n as PROVIDER_FEATURE_MESSAGE_TEMPLATES,
|
|
1597
|
+
Ln as PROVIDER_FEATURE_MESSAGE_WINDOW,
|
|
1588
1598
|
je as PUBLIC_EMAIL_DOMAINS,
|
|
1589
1599
|
Re as RELATED_SUBJECT_KINDS,
|
|
1590
|
-
|
|
1600
|
+
Zt as SIGNATURE_INTENTS,
|
|
1591
1601
|
Je as SUMMARY_MIN_LAST_CHARS,
|
|
1592
1602
|
qe as SUMMARY_MIN_MESSAGES,
|
|
1593
1603
|
xe as TERMINAL_RUN_STATUSES,
|
|
1594
|
-
|
|
1595
|
-
|
|
1604
|
+
Vt as TRIGGER_VARS,
|
|
1605
|
+
Kn as UNSUPPORTED,
|
|
1596
1606
|
he as USAGE_DIMENSIONS,
|
|
1597
1607
|
ye as USAGE_DIMENSION_IDS,
|
|
1598
1608
|
ke as actingIdentityKey,
|
|
1599
|
-
|
|
1600
|
-
|
|
1609
|
+
gt as activityIconOf,
|
|
1610
|
+
It as activityJoinUrl,
|
|
1601
1611
|
se as activitySnippet,
|
|
1602
1612
|
le as activityTextParams,
|
|
1603
|
-
|
|
1604
|
-
|
|
1613
|
+
Tt as activityTimelineText,
|
|
1614
|
+
Nt as activityTimestamp,
|
|
1605
1615
|
d as activityTypeInfo,
|
|
1606
|
-
|
|
1616
|
+
Ft as actorKey,
|
|
1607
1617
|
et as aiAttachmentKind,
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1618
|
+
Mn as aiAttachmentRejection,
|
|
1619
|
+
Qt as aiVendorAcceptsAttachment,
|
|
1620
|
+
Yt as aiVendorDefaultModel,
|
|
1621
|
+
zt as aiVendorLabel,
|
|
1622
|
+
Jt as aiVendorNeedsBaseUrl,
|
|
1623
|
+
qt as aiVendorsWith,
|
|
1624
|
+
ct as appNameFromPath,
|
|
1625
|
+
en as applySignature,
|
|
1626
|
+
Rt as artifactBodyBytes,
|
|
1627
|
+
Dt as artifactOutline,
|
|
1628
|
+
wt as artifactToMarkdown,
|
|
1629
|
+
Mt as buildActivityPreview,
|
|
1630
|
+
Nn as buildChannelIntents,
|
|
1631
|
+
Ut as buildShareKeys,
|
|
1632
|
+
bt as carriesText,
|
|
1633
|
+
On as channelKindForScheme,
|
|
1634
|
+
ht as channelKindOf,
|
|
1635
|
+
En as cleanMessageText,
|
|
1636
|
+
Dn as defineIntent,
|
|
1637
|
+
Cn as disabledIntentsFromCapabilities,
|
|
1638
|
+
gn as emailDomain,
|
|
1639
|
+
An as endpointKey,
|
|
1640
|
+
kn as filterByEndpoint,
|
|
1641
|
+
vn as filterByIntent,
|
|
1631
1642
|
rt as filterByTargetScheme,
|
|
1632
1643
|
E as findAiVendor,
|
|
1633
|
-
|
|
1644
|
+
kt as flattenLocales,
|
|
1634
1645
|
me as floorToPeriod,
|
|
1635
1646
|
ve as formatActingIdentity,
|
|
1636
1647
|
de as formatPeriod,
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1648
|
+
Ct as getActivitySeenUserIds,
|
|
1649
|
+
tn as getContactEndpoints,
|
|
1650
|
+
on as getShortTitle,
|
|
1651
|
+
rn as getUrgencyScore,
|
|
1652
|
+
Gt as humanizeAction,
|
|
1653
|
+
nn as isAssigned,
|
|
1654
|
+
an as isClosed,
|
|
1655
|
+
Pn as isDeepLink,
|
|
1656
|
+
sn as isInteractionUnseen,
|
|
1657
|
+
_n as isLikelyBulk,
|
|
1658
|
+
yt as isMessageType,
|
|
1659
|
+
Wt as isPaused,
|
|
1660
|
+
_t as isPlaybookAuthoredType,
|
|
1661
|
+
hn as isPublicEmailDomain,
|
|
1662
|
+
At as isReplyableType,
|
|
1663
|
+
Xt as isRetryable,
|
|
1652
1664
|
Le as isTerminal,
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1665
|
+
Tn as isThreadLongEnough,
|
|
1666
|
+
mn as looksLikeEmail,
|
|
1667
|
+
xn as matchContactToIntents,
|
|
1668
|
+
Et as messageCountsAs,
|
|
1669
|
+
yn as needsPhoneRegion,
|
|
1670
|
+
$t as normalizeArtifactBlocks,
|
|
1671
|
+
ft as normalizeBlocks,
|
|
1660
1672
|
ie as normalizeEmail,
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1673
|
+
Bt as parseActingIdentity,
|
|
1674
|
+
xt as periodsInRange,
|
|
1675
|
+
fn as phoneSuffix,
|
|
1676
|
+
bn as plainTextFromMarkdown,
|
|
1677
|
+
Ht as playbookActor,
|
|
1666
1678
|
C as readPath,
|
|
1667
1679
|
Ve as registrableDomain,
|
|
1668
|
-
|
|
1680
|
+
dn as relatedByDefault,
|
|
1669
1681
|
it as resolveAccountCapabilities,
|
|
1670
1682
|
N as resolveActivityText,
|
|
1671
1683
|
nt as resolveChannelIntents,
|
|
@@ -1673,10 +1685,10 @@ export {
|
|
|
1673
1685
|
Se as sanitizeInline,
|
|
1674
1686
|
te as shareKeyForTeam,
|
|
1675
1687
|
ee as shareKeyForUser,
|
|
1676
|
-
|
|
1688
|
+
Kt as shareKeysForViewer,
|
|
1677
1689
|
oe as stripHtml,
|
|
1678
1690
|
F as toE164,
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1691
|
+
Pt as toolSourceKinds,
|
|
1692
|
+
Ae as usageMetricId,
|
|
1693
|
+
Ot as usageMetrics
|
|
1682
1694
|
};
|
|
@@ -14,3 +14,28 @@ export interface NamespacedRouteDefinition extends RouteDefinition {
|
|
|
14
14
|
/** The full, namespaced path, e.g., /apps/my-app/settings */
|
|
15
15
|
absolutePath: string;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* The app that owns the login screen. Landing there is never a destination —
|
|
19
|
+
* it is where you get sent when you have no session yet.
|
|
20
|
+
*/
|
|
21
|
+
export declare const AUTH_APP_NAME = "auth";
|
|
22
|
+
/**
|
|
23
|
+
* The app that owns this path, or null when the path names no app.
|
|
24
|
+
*
|
|
25
|
+
* Tolerates a missing path on purpose: one caller is a router bridge that has
|
|
26
|
+
* not been bound yet, and it asks from inside an RxJS subscriber — where a
|
|
27
|
+
* thrown TypeError takes the subscription down without a word.
|
|
28
|
+
*/
|
|
29
|
+
export declare function appNameFromPath(path: string | null | undefined): string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Does this landing path say where the user wanted to go?
|
|
32
|
+
*
|
|
33
|
+
* Asked at startup by everything that would otherwise send the user somewhere
|
|
34
|
+
* of its own choosing. It has to be one shared answer: the shell and the module
|
|
35
|
+
* loader both used to decide this, and the loader's "go to the default app"
|
|
36
|
+
* simply ran last and overwrote whatever URL you had opened.
|
|
37
|
+
*
|
|
38
|
+
* `/wake` counts — the service worker lands there with a provider in the query
|
|
39
|
+
* and `WakeRoute` routes onward itself.
|
|
40
|
+
*/
|
|
41
|
+
export declare function isDeepLink(path: string | null | undefined): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|