@opencxh/domain 1.197.0 → 1.198.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 CHANGED
@@ -1,13 +1,13 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=10,I=10,b=10,M=5,Sn=new Set(["header","section","context","divider","image","list","actions","attachments"]);function P(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 _n(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(n.length>=$){t(`more than ${$} blocks; the rest was dropped`);break}if(!r||typeof r!="object")continue;const i=r;if(!Sn.has(i.type)){t(`unknown block type ${String(i.type)}`);continue}switch(i.type){case"header":if(!P(i.text)){t("a header without text");continue}break;case"context":if(!P(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>I&&(t(`more than ${I} fields in a section`),i.fields=i.fields.slice(0,I));break;case"list":if(!Array.isArray(i.items)||i.items.length===0){t("a list without items");continue}i.items.length>b&&(t(`more than ${b} list items`),i.items=i.items.slice(0,b));break;case"actions":{const a=Array.isArray(i.elements)?i.elements:[],o=a.filter(s=>s?.action_id&&s.invoke&&P(s.text));if(o.length!==a.length&&t("an action without action_id, invoke or text"),o.length===0)continue;o.length>M&&t(`more than ${M} actions`),i.elements=o.slice(0,M);break}}n.push(i)}return n}function Re(e){return e.replace(/<style[\s\S]*?<\/style>/gi," ").replace(/<script[\s\S]*?<\/script>/gi," ").replace(/<[^>]+>/g," ").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/\s+/g," ").trim()}function _(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 le(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function x(e){return e?.split("@")?.[0]||e||""}function T(e){return e.map(t=>t.name).join(", ")}function ue(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const m={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${x(e.payload.from)}`:`Outbound call started — ${x(e.payload.to)}`},VOICE_CALL_ANSWERED:{shape:"event",channelKind:"voice",icon:"phone",connected:!0,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.payload.duration)})`:""}`,timeline:e=>`Call ended${le(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${x(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",connected:!0,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.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:de},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:de},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=>`${T(e.payload.members)} toegevoegd`,timeline:e=>{const t=T(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=>`${T(e.payload.members)} verlaten`,timeline:e=>{const t=T(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=>`${ue(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.payload.duration)})`:""}`,timeline:e=>`${ue(e.payload.callType)} ended${le(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",connected:!0,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.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}`},WORK_COMMENT_ADDED:{shape:"note",icon:"sticky-note",carriesText:!0,snippet:()=>"Reactie"},WORK_ITEM_ASSIGNED:{shape:"event",icon:"user",snippet:()=>"Taak toegewezen",timeline:(e,t)=>`Assigned by ${t}`},WORK_ITEM_STATUS_CHANGED:{shape:"event",triggerable:!0,icon:"circle-dot",snippet:()=>"Status gewijzigd",timeline:(e,t)=>`Status changed by ${t}`}};function de(e){const t=e.payload,n=t.bodyText?.trim()||t.bodySnippet?.trim()||Re(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function c(e){return m[e]}function Tn(e){return c(e)?.icon??"circle"}function In(e){return c(e)?.channelKind}function z(e){return e==="message"||e==="note"}function bn(e){return z(c(e)?.shape)}function Mn(e){return c(e)?.replyable===!0}function On(e){return c(e)?.carriesText===!0}function Ce(e){return c(e)?.countsAs}function Rn(e){return c(e)?.playbookAuthored===!0}function Cn(e){return c(e)?.connected===!0}function wn(e){const t=c(e);return t?.shape==="artifact"&&t?.carriesText===!0}function we(e){const t=c(e.type)?.snippet;return t?t(e):""}function Nn(e,t){const n=c(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function kn(e){const t=c(e.type)?.joinUrl;return t?t(e):void 0}function w(e,t){let n=e;for(const r of t.split(".")){if(n==null||typeof n!="object")return"";n=n[r]}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 w(t,e.value)||null;const r={};for(const[a,o]of Object.entries(e.params??{}))r[a]=w(t,o);const i=n(e.key,r);return i===e.key?null:i}function Ne(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[r,i]of Object.entries(e.params??{}))n[r]=w(t,i);return{key:e.key,params:n}}const pe=140;function vn(e){const t=e.trim();return t.length<=pe?t:`${t.slice(0,pe-1).trimEnd()}…`}function Dn(e,t){const n=Ne(t?.text,e),r=t?N(t.text,e,i=>i):null;return{activityId:e.id,type:e.type,snippet:vn(r??we(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}const Ln=e=>e;function fe(e){const t=m[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 me(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 ke{constructor(t=[],n=Ln){this.translate=n;for(const r of t)r?.type&&(r.type in m||this.declared.has(r.type)||this.declared.set(r.type,r))}declared=new Map;get(t){if(t in m)return fe(t);const n=this.declared.get(t);return n?me(n):void 0}triggerable(){const t=Object.keys(m).filter(r=>m[r].triggerable).map(fe),n=[...this.declared.values()].map(me).filter(r=>r.triggerable);return[...t,...n]}timelineText(t,n){const r=m[t.type];if(r?.timeline)return r.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=m[t.type];if(n?.snippet)return n.snippet(t);const r=this.declared.get(t.type);return N(r?.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}isMessage(t){return z(this.get(t)?.shape)}isReplyable(t){return this.get(t)?.replyable===!0}carriesText(t){return this.get(t)?.carriesText===!0}countsAs(t){return this.get(t)?.countsAs}channelKind(t){return this.get(t)?.channelKind}isTranscript(t){const n=this.get(t);return n?.shape==="artifact"&&n.carriesText}get translator(){return this.translate}}const Pn=new ke;function xn(e,t,n=[]){const r=e.createdAt;if(!r)return[];const i=new Set(n);return e.author.type==="user"&&e.author.id&&i.add(e.author.id),Object.entries(t).filter(([a,o])=>o>=r&&!i.has(a)).map(([a])=>a)}function ve(e){return e.createdAt??0}function Un(e){return e.type==="EMAIL_RECEIVED"||e.type==="EMAIL_SENT"}function $n(e){return e.type==="CHAT_MESSAGE_SENT"||e.type==="CHAT_MESSAGE_RECEIVED"}const q=[{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 y(e){return q.find(t=>t.id===e)}function Kn(e){return y(e)?.label??e}function Bn(e,t="gpt-5-mini"){return y(e)?.defaultModel??t}function Gn(e){return q.filter(t=>t.capabilities.includes(e))}function Fn(e){const t=y(e);return!!t&&!t.baseUrl}function Hn(e,t){return t==="text"?!0:y(e)?.attachmentKinds?.includes(t)===!0}function Wn(e,t){if(!e.enabled)return"ok";const n=K(e.hardLimitNanos),r=K(e.softLimitNanos);return n!==void 0&&t>=n?"hard":r!==void 0&&t>=r?"soft":"ok"}function K(e){return typeof e=="number"?e:void 0}function De(e,t="month"){const n=new Date(e);return Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1)}function Vn(e,t="month"){const n=new Date(De(e,t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,"0")}`}function jn(e){return e?.listeningEnabled!==!1}const Yn=[{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 U(e){return e<10?`0${e}`:`${e}`}function Le(e,t){const n=new Date(e),r=`${n.getUTCFullYear()}-${U(n.getUTCMonth()+1)}-${U(n.getUTCDate())}`;return t==="day"?r:`${r}T${U(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 Xn=36e5,zn=864e5;function qn(e,t,n){const r=n==="hour"?Xn:zn,i=[];for(let a=Pe(e,n);a<=t;a+=r)i.push(Le(a,n));return i}const xe=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],Ue=xe.map(e=>e.id);function $e(e,t){return`${e}.usage.${t}`}function Jn(e,t){return t.map(n=>({id:$e(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...Ue,...n.extraDimensions??[],"time"]}))}const Ke=new Set(["info","success","warning","destructive"]),B=200,G=100,F=200,H=12,W=4,J=4e3,O=500,Zn=256*1024,Qn=new Set(["heading","paragraph","list","quote","code","divider","table","kpi","callout"]),Be=["http:","https:","mailto:","tel:"],er=/^[a-z][a-z0-9+.-]*:/i;function Ge(e){const t=e.trim().replace(/^<|>$/g,"");if(!t)return!1;const n=er.exec(t)?.[0];return n?Be.includes(n.toLowerCase()):!t.startsWith("//")}const tr=/^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;function nr(e){let t="",n=0;for(;n<e.length;){const r=e[n]==="!"&&e[n+1]==="[";if(e[n]!=="["&&!r){t+=e[n],n+=1;continue}const i=n+(r?2:1),a=ge(e,i,"[","]");if(a<0||e[a+1]!=="("){t+=e[n],n+=1;continue}const o=ge(e,a+2,"(",")");if(o<0){t+=e[n],n+=1;continue}const s=e.slice(i,a),l=e.slice(a+2,o).trim().split(/\s+/)[0]??"";t+=r||!Ge(l)?s:e.slice(n,o+1),n=o+1}return t}function ge(e,t,n,r){let i=1;for(let a=t;a<e.length;a+=1){if(e[a]==="\\"){a+=1;continue}if(e[a]===n)i+=1;else if(e[a]===r&&(i-=1,i===0))return a}return-1}function Fe(e){return nr(e).replace(tr,(t,n,r)=>Ge(r)?t:"")}function d(e,t=J){return typeof e=="string"?Fe(e).slice(0,t):""}function rr(e,t=J){return typeof e=="string"?e.slice(0,t):""}function ir(e,t="info"){return typeof e=="string"&&Ke.has(e)?e:t}function ar(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(n.length>=B){t(`more than ${B} blocks; the rest was dropped`);break}if(!r||typeof r!="object")continue;const i=r;if(!Qn.has(i.type)){t(`unknown block type ${String(i.type)}`);continue}const a=typeof i.block_id=="string"?{block_id:i.block_id}:{};switch(i.type){case"heading":{const o=d(i.text);if(!o){t("a heading without text");continue}const s=i.level===2||i.level===3?i.level:1;n.push({...a,type:"heading",level:s,text:o});break}case"paragraph":{const o=d(i.text);if(!o){t("a paragraph without text");continue}n.push({...a,type:"paragraph",text:o});break}case"quote":{const o=d(i.text);if(!o){t("a quote without text");continue}n.push({...a,type:"quote",text:o});break}case"code":{const o=rr(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({...a,type:"code",...s,text:o});break}case"divider":n.push({...a,type:"divider"});break;case"list":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const p of o){if(s.length>=G){t(`more than ${G} list items`);break}const f=d(p?.text);if(!f)continue;const u=d(p?.lead,200);s.push(u?{lead:u,text:f}:{text:f})}if(s.length===0){t("a list without usable items");continue}const l=i.style==="numbered"?"numbered":"bulleted";n.push({...a,type:"list",style:l,items:s});break}case"table":{const o=Array.isArray(i.columns)?i.columns:[],s=[];for(const u of o){if(s.length>=H){t(`more than ${H} table columns`);break}const S=d(u?.label,O),L=u?.align==="right"?"right":void 0;s.push(L?{label:S,align:L}:{label:S})}if(s.length===0){t("a table without columns");continue}const l=Array.isArray(i.rows)?i.rows:[],p=[];for(const u of l){if(p.length>=F){t(`more than ${F} table rows`);break}const S=Array.isArray(u)?u:[];p.push(s.map((L,yn)=>d(S[yn],O)))}const f=d(i.caption,O);n.push({...a,type:"table",columns:s,rows:p,...f?{caption:f}:{}});break}case"kpi":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const l of o){if(s.length>=W){t(`more than ${W} kpi items`);break}const p=d(l?.value,40),f=d(l?.label,80);if(!p||!f)continue;const u=l?.tone;s.push(typeof u=="string"&&Ke.has(u)?{value:p,label:f,tone:u}:{value:p,label:f})}if(s.length===0){t("a kpi block without usable items");continue}n.push({...a,type:"kpi",items:s});break}case"callout":{const o=d(i.text);if(!o){t("a callout without text");continue}const s=d(i.title,200);n.push({...a,type:"callout",tone:ir(i.tone),...s?{title:s}:{},text:o});break}}}return n}function or(e){return JSON.stringify(e).length}function sr(e){return{blocks:e.length,types:e.map(t=>t.type),headings:e.flatMap(t=>t.type==="heading"?[t.text]:[])}}function he(e){return e.replace(/\|/g,"\\|").replace(/\r?\n/g," ").trim()}function Ae(e,t,n){const r=e.map((i,a)=>n?.[a]==="right"?"---:":"---");return[`| ${e.map(he).join(" | ")} |`,`| ${r.join(" | ")} |`,...t.map(i=>`| ${i.map(he).join(" | ")} |`)]}function cr(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 r=e.style==="numbered"?`${n+1}.`:"-";return t.lead?`${r} **${t.lead}** ${t.text}`:`${r} ${t.text}`});case"table":{const t=Ae(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 Ae(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 lr(e,t){const n=[],r=e.some(i=>i.type==="heading"&&i.level===1);t&&!r&&n.push(`# ${t}`);for(const i of e){const a=cr(i);a.length>0&&n.push(a.join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=10,I=10,b=10,M=5,yn=new Set(["header","section","context","divider","image","list","actions","attachments"]);function P(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 _n(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(n.length>=$){t(`more than ${$} blocks; the rest was dropped`);break}if(!r||typeof r!="object")continue;const i=r;if(!yn.has(i.type)){t(`unknown block type ${String(i.type)}`);continue}switch(i.type){case"header":if(!P(i.text)){t("a header without text");continue}break;case"context":if(!P(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>I&&(t(`more than ${I} fields in a section`),i.fields=i.fields.slice(0,I));break;case"list":if(!Array.isArray(i.items)||i.items.length===0){t("a list without items");continue}i.items.length>b&&(t(`more than ${b} list items`),i.items=i.items.slice(0,b));break;case"actions":{const a=Array.isArray(i.elements)?i.elements:[],o=a.filter(s=>s?.action_id&&s.invoke&&P(s.text));if(o.length!==a.length&&t("an action without action_id, invoke or text"),o.length===0)continue;o.length>M&&t(`more than ${M} actions`),i.elements=o.slice(0,M);break}}n.push(i)}return n}function Re(e){return e.replace(/<style[\s\S]*?<\/style>/gi," ").replace(/<script[\s\S]*?<\/script>/gi," ").replace(/<[^>]+>/g," ").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/\s+/g," ").trim()}function _(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 le(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function x(e){return e?.split("@")?.[0]||e||""}function T(e){return e.map(t=>t.name).join(", ")}function ue(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const m={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${x(e.payload.from)}`:`Outbound call started — ${x(e.payload.to)}`},VOICE_CALL_ANSWERED:{shape:"event",channelKind:"voice",icon:"phone",connected:!0,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.payload.duration)})`:""}`,timeline:e=>`Call ended${le(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${x(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",connected:!0,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.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:de},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:de},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=>`${T(e.payload.members)} toegevoegd`,timeline:e=>{const t=T(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=>`${T(e.payload.members)} verlaten`,timeline:e=>{const t=T(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=>`${ue(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.payload.duration)})`:""}`,timeline:e=>`${ue(e.payload.callType)} ended${le(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",connected:!0,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.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}`},WORK_COMMENT_ADDED:{shape:"note",icon:"sticky-note",carriesText:!0,snippet:()=>"Reactie"},WORK_ITEM_ASSIGNED:{shape:"event",icon:"user",snippet:()=>"Taak toegewezen",timeline:(e,t)=>`Assigned by ${t}`},WORK_ITEM_STATUS_CHANGED:{shape:"event",triggerable:!0,icon:"circle-dot",snippet:()=>"Status gewijzigd",timeline:(e,t)=>`Status changed by ${t}`}};function de(e){const t=e.payload,n=t.bodyText?.trim()||t.bodySnippet?.trim()||Re(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function c(e){return m[e]}function Tn(e){return c(e)?.icon??"circle"}function In(e){return c(e)?.channelKind}function z(e){return e==="message"||e==="note"}function bn(e){return z(c(e)?.shape)}function Mn(e){return c(e)?.replyable===!0}function On(e){return c(e)?.carriesText===!0}function Ce(e){return c(e)?.countsAs}function Rn(e){return c(e)?.playbookAuthored===!0}function Cn(e){return c(e)?.connected===!0}function wn(e){const t=c(e);return t?.shape==="artifact"&&t?.carriesText===!0}function we(e){const t=c(e.type)?.snippet;return t?t(e):""}function Nn(e,t){const n=c(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function kn(e){const t=c(e.type)?.joinUrl;return t?t(e):void 0}function w(e,t){let n=e;for(const r of t.split(".")){if(n==null||typeof n!="object")return"";n=n[r]}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 w(t,e.value)||null;const r={};for(const[a,o]of Object.entries(e.params??{}))r[a]=w(t,o);const i=n(e.key,r);return i===e.key?null:i}function Ne(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[r,i]of Object.entries(e.params??{}))n[r]=w(t,i);return{key:e.key,params:n}}const pe=140;function vn(e){const t=e.trim();return t.length<=pe?t:`${t.slice(0,pe-1).trimEnd()}…`}function Dn(e,t){const n=Ne(t?.text,e),r=t?N(t.text,e,i=>i):null;return{activityId:e.id,type:e.type,snippet:vn(r??we(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}const Ln=e=>e;function fe(e){const t=m[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 me(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 ke{constructor(t=[],n=Ln){this.translate=n;for(const r of t)r?.type&&(r.type in m||this.declared.has(r.type)||this.declared.set(r.type,r))}declared=new Map;get(t){if(t in m)return fe(t);const n=this.declared.get(t);return n?me(n):void 0}triggerable(){const t=Object.keys(m).filter(r=>m[r].triggerable).map(fe),n=[...this.declared.values()].map(me).filter(r=>r.triggerable);return[...t,...n]}timelineText(t,n){const r=m[t.type];if(r?.timeline)return r.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=m[t.type];if(n?.snippet)return n.snippet(t);const r=this.declared.get(t.type);return N(r?.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}isMessage(t){return z(this.get(t)?.shape)}isReplyable(t){return this.get(t)?.replyable===!0}carriesText(t){return this.get(t)?.carriesText===!0}countsAs(t){return this.get(t)?.countsAs}channelKind(t){return this.get(t)?.channelKind}isTranscript(t){const n=this.get(t);return n?.shape==="artifact"&&n.carriesText}get translator(){return this.translate}}const Pn=new ke;function xn(e,t,n=[]){const r=e.createdAt;if(!r)return[];const i=new Set(n);return e.author.type==="user"&&e.author.id&&i.add(e.author.id),Object.entries(t).filter(([a,o])=>o>=r&&!i.has(a)).map(([a])=>a)}function ve(e){return e.createdAt??0}function Un(e){return e.type==="EMAIL_RECEIVED"||e.type==="EMAIL_SENT"}function $n(e){return e.type==="CHAT_MESSAGE_SENT"||e.type==="CHAT_MESSAGE_RECEIVED"}const q=[{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 S(e){return q.find(t=>t.id===e)}function Kn(e){return S(e)?.label??e}function Bn(e,t="gpt-5-mini"){return S(e)?.defaultModel??t}function Gn(e){return q.filter(t=>t.capabilities.includes(e))}function Fn(e){const t=S(e);return!!t&&!t.baseUrl}function Hn(e,t){return t==="text"?!0:S(e)?.attachmentKinds?.includes(t)===!0}function Wn(e,t){if(!e.enabled)return"ok";const n=K(e.hardLimitNanos),r=K(e.softLimitNanos);return n!==void 0&&t>=n?"hard":r!==void 0&&t>=r?"soft":"ok"}function K(e){return typeof e=="number"?e:void 0}function De(e,t="month"){const n=new Date(e);return Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1)}function Vn(e,t="month"){const n=new Date(De(e,t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,"0")}`}function jn(e){return e?.listeningEnabled!==!1}const Yn=[{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 U(e){return e<10?`0${e}`:`${e}`}function Le(e,t){const n=new Date(e),r=`${n.getUTCFullYear()}-${U(n.getUTCMonth()+1)}-${U(n.getUTCDate())}`;return t==="day"?r:`${r}T${U(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 Xn=36e5,zn=864e5;function qn(e,t,n){const r=n==="hour"?Xn:zn,i=[];for(let a=Pe(e,n);a<=t;a+=r)i.push(Le(a,n));return i}const xe=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],Ue=xe.map(e=>e.id);function $e(e,t){return`${e}.usage.${t}`}function Jn(e,t){return t.map(n=>({id:$e(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...Ue,...n.extraDimensions??[],"time"]}))}const Ke=new Set(["info","success","warning","destructive"]),B=200,G=100,F=200,H=12,W=4,J=4e3,O=500,Zn=256*1024,Qn=new Set(["heading","paragraph","list","quote","code","divider","table","kpi","callout"]),Be=["http:","https:","mailto:","tel:"],er=/^[a-z][a-z0-9+.-]*:/i;function Ge(e){const t=e.trim().replace(/^<|>$/g,"");if(!t)return!1;const n=er.exec(t)?.[0];return n?Be.includes(n.toLowerCase()):!t.startsWith("//")}const tr=/^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;function nr(e){let t="",n=0;for(;n<e.length;){const r=e[n]==="!"&&e[n+1]==="[";if(e[n]!=="["&&!r){t+=e[n],n+=1;continue}const i=n+(r?2:1),a=ge(e,i,"[","]");if(a<0||e[a+1]!=="("){t+=e[n],n+=1;continue}const o=ge(e,a+2,"(",")");if(o<0){t+=e[n],n+=1;continue}const s=e.slice(i,a),l=e.slice(a+2,o).trim().split(/\s+/)[0]??"";t+=r||!Ge(l)?s:e.slice(n,o+1),n=o+1}return t}function ge(e,t,n,r){let i=1;for(let a=t;a<e.length;a+=1){if(e[a]==="\\"){a+=1;continue}if(e[a]===n)i+=1;else if(e[a]===r&&(i-=1,i===0))return a}return-1}function Fe(e){return nr(e).replace(tr,(t,n,r)=>Ge(r)?t:"")}function d(e,t=J){return typeof e=="string"?Fe(e).slice(0,t):""}function rr(e,t=J){return typeof e=="string"?e.slice(0,t):""}function ir(e,t="info"){return typeof e=="string"&&Ke.has(e)?e:t}function ar(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(n.length>=B){t(`more than ${B} blocks; the rest was dropped`);break}if(!r||typeof r!="object")continue;const i=r;if(!Qn.has(i.type)){t(`unknown block type ${String(i.type)}`);continue}const a=typeof i.block_id=="string"?{block_id:i.block_id}:{};switch(i.type){case"heading":{const o=d(i.text);if(!o){t("a heading without text");continue}const s=i.level===2||i.level===3?i.level:1;n.push({...a,type:"heading",level:s,text:o});break}case"paragraph":{const o=d(i.text);if(!o){t("a paragraph without text");continue}n.push({...a,type:"paragraph",text:o});break}case"quote":{const o=d(i.text);if(!o){t("a quote without text");continue}n.push({...a,type:"quote",text:o});break}case"code":{const o=rr(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({...a,type:"code",...s,text:o});break}case"divider":n.push({...a,type:"divider"});break;case"list":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const p of o){if(s.length>=G){t(`more than ${G} list items`);break}const f=d(p?.text);if(!f)continue;const u=d(p?.lead,200);s.push(u?{lead:u,text:f}:{text:f})}if(s.length===0){t("a list without usable items");continue}const l=i.style==="numbered"?"numbered":"bulleted";n.push({...a,type:"list",style:l,items:s});break}case"table":{const o=Array.isArray(i.columns)?i.columns:[],s=[];for(const u of o){if(s.length>=H){t(`more than ${H} table columns`);break}const y=d(u?.label,O),L=u?.align==="right"?"right":void 0;s.push(L?{label:y,align:L}:{label:y})}if(s.length===0){t("a table without columns");continue}const l=Array.isArray(i.rows)?i.rows:[],p=[];for(const u of l){if(p.length>=F){t(`more than ${F} table rows`);break}const y=Array.isArray(u)?u:[];p.push(s.map((L,Sn)=>d(y[Sn],O)))}const f=d(i.caption,O);n.push({...a,type:"table",columns:s,rows:p,...f?{caption:f}:{}});break}case"kpi":{const o=Array.isArray(i.items)?i.items:[],s=[];for(const l of o){if(s.length>=W){t(`more than ${W} kpi items`);break}const p=d(l?.value,40),f=d(l?.label,80);if(!p||!f)continue;const u=l?.tone;s.push(typeof u=="string"&&Ke.has(u)?{value:p,label:f,tone:u}:{value:p,label:f})}if(s.length===0){t("a kpi block without usable items");continue}n.push({...a,type:"kpi",items:s});break}case"callout":{const o=d(i.text);if(!o){t("a callout without text");continue}const s=d(i.title,200);n.push({...a,type:"callout",tone:ir(i.tone),...s?{title:s}:{},text:o});break}}}return n}function or(e){return JSON.stringify(e).length}function sr(e){return{blocks:e.length,types:e.map(t=>t.type),headings:e.flatMap(t=>t.type==="heading"?[t.text]:[])}}function he(e){return e.replace(/\|/g,"\\|").replace(/\r?\n/g," ").trim()}function Ae(e,t,n){const r=e.map((i,a)=>n?.[a]==="right"?"---:":"---");return[`| ${e.map(he).join(" | ")} |`,`| ${r.join(" | ")} |`,...t.map(i=>`| ${i.map(he).join(" | ")} |`)]}function cr(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 r=e.style==="numbered"?`${n+1}.`:"-";return t.lead?`${r} **${t.lead}** ${t.text}`:`${r} ${t.text}`});case"table":{const t=Ae(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 Ae(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 lr(e,t){const n=[],r=e.some(i=>i.type==="heading"&&i.level===1);t&&!r&&n.push(`# ${t}`);for(const i of e){const a=cr(i);a.length>0&&n.push(a.join(`
2
2
  `))}return`${n.join(`
3
3
 
4
4
  `)}
5
- `}const Z=e=>`user:${e}`,Q=e=>`team:${e}`;function ur(e){const t=new Set;for(const n of e??[])n?.id&&(n.kind==="user"&&t.add(Z(n.id)),n.kind==="team"&&t.add(Q(n.id)));return[...t].sort()}function dr(e,t){return[Z(e),...t.map(Q)]}function pr(e){const t=new Set;for(const n of e??[])n?.kind&&t.add(n.kind);return[...t]}const He=["done","escalated"];function fr(e){return He.includes(e)}const We="assignment";function mr(e){return`${We}:${e}`}function gr(e,t,n){if(e.direction==="inbound")return!0;if(e.author?.type==="user"&&e.author.id===t)return!1;const r=e.payload?.mentions;return Array.isArray(r)&&r.includes(t)?!0:n==="reply"}function hr(e){return e.subjectKind&&e.subjectId?{type:e.subjectKind,id:e.subjectId}:void 0}const Ve=12;function Ar(e,t,n=Ve){const r=t+1;return e?e.kind==="done"?{status:"done",waitingOn:null,turns:r,reason:e.note}:e.kind==="escalate"?{status:"escalated",waitingOn:null,turns:r,reason:e.reason}:r>=n?{status:"escalated",waitingOn:null,turns:r,reason:`na ${n} beurten nog niet afgerond, dus een mens neemt het over`}:{status:"waiting",waitingOn:e.on,turns:r}:{status:"escalated",waitingOn:null,turns:r,reason:"de agent rondde zijn beurt af zonder te zeggen wat er moet gebeuren (wachten, afronden of overdragen)"}}const Er=new Set(["mail","message"]);function je(e,t){const n=e.settings?.signatures?.[t];return!n?.enabled||!n.body||n.body.trim()===""?null:n}function yr(e,t,n,r="html"){if(!e)return n;const i=je(e,t);return i?`${n}${r==="text"?`
5
+ `}const Z=e=>`user:${e}`,Q=e=>`team:${e}`;function ur(e){const t=new Set;for(const n of e??[])n?.id&&(n.kind==="user"&&t.add(Z(n.id)),n.kind==="team"&&t.add(Q(n.id)));return[...t].sort()}function dr(e,t){return[Z(e),...t.map(Q)]}function pr(e){const t=new Set;for(const n of e??[])n?.kind&&t.add(n.kind);return[...t]}const He=["done","escalated"];function fr(e){return He.includes(e)}const We="assignment";function mr(e){return`${We}:${e}`}function gr(e,t,n){if(e.direction==="inbound")return!0;if(e.author?.type==="user"&&e.author.id===t)return!1;const r=e.payload?.mentions;return Array.isArray(r)&&r.includes(t)?!0:n==="reply"}function hr(e){return e.subjectKind&&e.subjectId?{type:e.subjectKind,id:e.subjectId}:void 0}const Ve=12;function Ar(e,t,n=Ve){const r=t+1;return e?e.kind==="done"?{status:"done",waitingOn:null,turns:r,reason:e.note}:e.kind==="escalate"?{status:"escalated",waitingOn:null,turns:r,reason:e.reason}:r>=n?{status:"escalated",waitingOn:null,turns:r,reason:`na ${n} beurten nog niet afgerond, dus een mens neemt het over`}:{status:"waiting",waitingOn:e.on,turns:r}:{status:"escalated",waitingOn:null,turns:r,reason:"de agent rondde zijn beurt af zonder te zeggen wat er moet gebeuren (wachten, afronden of overdragen)"}}const Er=new Set(["mail","message"]);function je(e,t){const n=e.settings?.signatures?.[t];return!n?.enabled||!n.body||n.body.trim()===""?null:n}function Sr(e,t,n,r="html"){if(!e)return n;const i=je(e,t);return i?`${n}${r==="text"?`
6
6
 
7
- `:t==="mail"?"<br><br>-- <br>":"<br><br>"}${i.body}`:n}function Sr(e){return e.endpoints??[]}const Ye=36e5,Xe=864e5,g=-1/0,_r=e=>e.score>g,E={urgent:40,high:25,normal:10,low:0};function Tr(e){return Object.fromEntries(e.map(t=>[t.resourceId,t]))}const Ir=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,br=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function ze(e,t){return!!(e&&Ir.test(e)||t&&br.test(t))}const qe=3,Je=600;function Mr(e,t){return e>=qe||t>=Je}function Ze(e,t){return e.lastActivityAt?!(e.seenBy??[]).includes(t):!1}const Qe=["open","pending"],et=1e3,tt={urgent:1,high:4,normal:8,low:24},nt=72;function rt(e){return e.lastActivityAt??(e.createdAt?new Date(ve(e)).getTime():0)}function it(e,t){return at(t.remindersById?.[e.id],e,t.now)}function at(e,t,n){return!e||e.remindAt<=n?!1:!((t.lastActivityAt??0)>e.parkedAt&&t.lastActivityPreview?.direction==="inbound")}const ot=e=>Ce(e)==="outbound_message",st=e=>Qe.includes(e);function k(e,t){return Math.max(0,(t-rt(e))/Ye)}function ct(e,t){const n=e.assignedInboxId?t?.[e.assignedInboxId]:void 0;return typeof n=="number"&&n>0?n:tt[e.priority??"normal"]}function Or(e){const t={};for(const n of e)typeof n.slaHours=="number"&&n.slaHours>0&&(t[n.id]=n.slaHours);return t}function Rr(e,t,n){return!st(e.status)||e.firstResponseAt?!1:k(e,t)>ct(e,n)}function lt(e,t){const n=e.lastActivityPreview;return n?.direction!=="outbound"||!ot(n.type)?!1:k(e,t)<nt}function Cr(e,t){if(!st(e.status))return{score:g,reasons:[]};if(e.snoozedTill&&e.snoozedTill>t.now)return{score:g,reasons:[]};if(lt(e,t.now))return{score:g,reasons:[]};if(it(e,t))return{score:g,reasons:[]};let n=0;const r=[],i=e.priority??"normal";E[i]>0&&(n+=E[i],r.push(`priority:${i}`)),Ze(e,t.userId)&&(n+=20,r.push("unseen")),e.assignedUserId&&e.assignedUserId===t.userId&&(n+=15,r.push("assigned-to-you"));const a=k(e,t.now);if(a>0){const s=Math.min(a*2,30);n+=s,a>=1&&r.push(`waiting:${Math.round(a)}h`)}const o=e.lastActivityPreview;return o?.type==="AI_ACTION_PROPOSED"&&(n+=30,r.push("awaiting-approval")),o?.direction==="outbound"&&ot(o.type)&&(n+=10,r.push("no-reply")),!e.firstResponseAt&&e.lastActivityPreview?.direction==="inbound"&&(n+=10,r.push("awaiting-reply")),ze(e.remoteParty?.resource,e.lastActivityPreview?.snippet)&&(n-=et,r.push("bulk")),{score:n,reasons:r}}const wr=e=>!!e.assignedUserId||!!e.assignedInboxId,Nr=e=>e.status==="closed",kr=e=>({urgent:10,high:5,normal:2,low:1})[e.priority]||0,vr=(e,t=30)=>e.title?.length<=t?e.title:`${e.title.substring(0,t)}...`;function Dr(e,t){const n=e.labels??[];return n.find(r=>r.locale===t)?.label??n[0]?.label??e.url}function Lr(e,t,n){const r=e.translations??[];return r.find(i=>i.locale===t)??(n?r.find(i=>i.locale===n):void 0)??{locale:t}}const V=[{code:"nl",label:"Nederlands",english:"Dutch"},{code:"en",label:"English",english:"English"},{code:"de",label:"Deutsch",english:"German"},{code:"fr",label:"Français",english:"French"},{code:"es",label:"Español",english:"Spanish"},{code:"it",label:"Italiano",english:"Italian"},{code:"pt",label:"Português",english:"Portuguese"},{code:"pl",label:"Polski",english:"Polish"},{code:"sv",label:"Svenska",english:"Swedish"},{code:"da",label:"Dansk",english:"Danish"},{code:"nb",label:"Norsk bokmål",english:"Norwegian Bokmål"},{code:"fi",label:"Suomi",english:"Finnish"},{code:"tr",label:"Türkçe",english:"Turkish"}];function ut(e){const t=(e??"").toLowerCase();return V.find(n=>n.code===t)??V.find(n=>n.code===t.split("-")[0])}function Pr(e){return ut(e)?.label??e}function xr(e){const t=ut(e);return t?t.english===t.label?`${t.english} (${t.code})`:`${t.english} — ${t.label} (${t.code})`:e}const ee=3;function dt(e,t){const n=new Set;let r=1,i=t.get(e)?.parentId;for(;i;){if(n.has(i)||(n.add(i),r++,r>ee+1))return 1/0;i=t.get(i)?.parentId}return r}function Ur(e,t,n){if(!e)return!0;if(e===t)return!1;const r=new Map(n.map(o=>[o.id,o]));if(!r.has(e)||t&&pt(e,t,r))return!1;const i=dt(e,r),a=t?te(t,n):1;return i+a<=ee}function pt(e,t,n){const r=new Set;let i=n.get(e)?.parentId;for(;i;){if(i===t)return!0;if(r.has(i))return!1;r.add(i),i=n.get(i)?.parentId}return!1}function te(e,t,n=new Set){if(n.has(e))return 1;n.add(e);const r=t.filter(i=>i.parentId===e);return r.length?1+Math.max(...r.map(i=>te(i.id,t,n))):1}const ft="en";function mt(e){return e.defaultLocale||e.locale||ft}function $r(e){const t=new Set,n=[];for(const r of[mt(e),...e.locales??[]])!r||t.has(r)||(t.add(r),n.push(r));return n}function Kr(e,t,n){const r=e.translations??[];return r.find(i=>i.locale===t)?.name??(n?r.find(i=>i.locale===n)?.name:void 0)??e.name}const j=["lookup","condition","parallel","for-each"];function Y(e){for(const t of e){if(!j.includes(t.type))return`staptype "${t.type}" mag niet meelezen (alleen ${j.join(", ")})`;if(t.type==="parallel")for(const n of t.branches??[]){const r=Y(n);if(r)return r}if(t.type==="for-each"){const n=Y(t.body??[]);if(n)return n}}return null}function Br(e,t){switch(e.kind){case"org":return!0;case"team":return!!t.teamId&&e.teamId===t.teamId;case"personal":return e.userId===t.userId}}function Gr(e,t){return e.filter(n=>n.enabled&&Br(n.ownerScope,t))}function Fr(e){return e.credentialScope?e.credentialScope:(e.authMode??"header")==="header"||e.oauth?.scope==="org"?"shared":"per-user"}function Hr(e){return`mcp__${e}__`}const Wr=1e3,Vr=2e3,jr=500,Yr=12e3,Xr=4e3,gt=["contact","company","work_item"];function zr(e){if(!e)return!1;const t=e.slice(0,e.indexOf(":"));return gt.includes(t)}const qr="onboarding-source",Jr=["support","billing","availability","sales","onboarding"],Zr=["keep","replace"];function ht(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function Qr(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 r=t.slice(0,n),i=t.slice(n+1).trim();if(i){if(r==="user")return{kind:"user",userId:i};if(r==="team")return{kind:"team",teamId:i}}}function At(e){return ht(e)}function Et(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"}}}const yt=Et;function ei(e){return e.agentId?{kind:"user",userId:e.agentId}:yt(e.ownerScope)}function ti(e){return At(e)}function ni(e,t){if(!t)return;let n=e;for(const r of t.split(".")){if(n===null||typeof n!="object")return;n=n[r]}return n}function ri(e,t){return e.targets.find(n=>n.activityTypes.includes(t))}function ii(e,t){if(t)return e.targets.find(n=>n.id===t)}function St(e){return e?.kind==="assignment"}function ai(e){const{trigger:t,agentId:n,target:r,activityType:i,assigneeUserId:a,authorUserId:o}=e;return St(t)?n?r?r.activityTypes.includes(i)?a?a!==n?"assigned to someone else":o&&o===n?"the agent assigned this to itself, which would restart its own run":null:`no assignee found at ${r.assigneePath}`:`activity type ${i} does not announce an assignment for ${r.id}`:`assignment target kind "${t.targetKind}" is not declared by any installed app`:"this playbook has no agent, so an assignment can never be for it":"trigger is not an assignment trigger"}function oi(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const si=[{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:"itemId",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:"toCategory",type:"string"},{name:"contactId",type:"string"},{name:"companyId",type:"string"},{name:"assigneeUserId",type:"string"}],ci={topics:[{name:"topicId",type:"string"},{name:"topic",type:"string"},{name:"confidence",type:"number"},{name:"reasoning",type:"string"}],question:[{name:"answer",type:"boolean"},{name:"reasoning",type:"string"}],extract:[]};function _t(e){return`${e.type}:${e.id}`}const Tt="interaction";function It(e){return e?.type===Tt?e.id:void 0}const bt=64,Mt=8e3;function li(e){const t=typeof e=="number"?e:Number(String(e??"").trim());if(!(!Number.isFinite(t)||t<=0))return Math.min(Math.max(Math.round(t),bt),Mt)}const ui={kind:"workflow",steps:[]};function di(e){return e?.kind==="workflow"?e.steps:[]}function pi(e){return e?.kind==="procedure"?e.procedure:void 0}function Ot(e){const t=e?.approved??0,n=t+(e?.rejected??0);return{total:n,rate:n?t/n:0}}const Rt=10,Ct=.9;function fi(e){const{total:t,rate:n}=Ot(e);return t>=Rt&&n>=Ct}const wt=["done","escalated","failed","stopped"];function mi(e){return wt.includes(e)}function Nt(e){return e==="waiting"}function gi(e){return e==="running"||Nt(e)}function ne(e){return e.subjectKind&&e.subjectId?{type:e.subjectKind,id:e.subjectId}:void 0}function hi(e){const t=ne(e);return t?_t(t):void 0}function Ai(e){return It(ne(e))}function Ei(e,t){const n=e.accumulatedSeconds||0;return e.runningSince?n+Math.max(0,Math.floor((t-e.runningSince)/1e3)):n}function yi(e,t){const n=Math.max(1,Math.ceil(Math.max(0,e)/60));if(!t||t==="exact")return n*60;const r=Number(t);return!Number.isFinite(r)||r<=0?n*60:Math.ceil(n/r)*r*60}function Si(e){const t=Math.max(0,Math.round(e/60));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function _i(e){const t=Math.max(0,Math.floor(e)),n=a=>String(a).padStart(2,"0"),r=Math.floor(t/60)%60,i=Math.floor(t/3600);return i>0?`${i}:${n(r)}:${n(t%60)}`:`${n(r)}:${n(t%60)}`}function kt(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,48).replace(/^-+|-+$/g,"")}function Ti(e,t){const n=kt(e)||"werksoort",r=new Set(t);if(!r.has(n))return n;for(let i=2;i<500;i++){const a=`${n}-${i}`;if(!r.has(a))return a}return`${n}-${r.size+1}`}function Ii(e,t){const n=e.ownerScope;return!n||n.kind==="org"?!0:t.includes(n.teamId)}function bi(e){return e.filter(t=>!t.archived).sort(vt)}function vt(e,t){const n=(e.order??0)-(t.order??0);return n!==0?n:(e.label||"").localeCompare(t.label||"")}const Dt=20,Lt=20,R=300;function h(e){return e.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu," ").replace(/\s+/g," ").trim()}function Pt(e){const t=e.replace(/\s+/g," ").trim();if(t.length<=R)return t;const n=t.slice(0,R),r=Math.max(n.lastIndexOf(". "),n.lastIndexOf("! "),n.lastIndexOf("? "));return r>R*.6?n.slice(0,r+1):`${n.trimEnd()}…`}function Mi(e,t){const n=Pt(t.text),r=h(n);if(!r||(e.examples??[]).some(o=>h(o)===r))return null;const i=e.exampleCandidates??[],a=i.findIndex(o=>h(o.text)===r);if(a>=0){if(i[a].corrected||!t.corrected)return null;const o=[...i];return o[a]={...o[a],corrected:!0,addedAt:t.addedAt},Ee(o)}return Ee([{...t,text:n},...i]).slice(0,Lt)}function Ee(e){return[...e].sort((t,n)=>Number(n.corrected)-Number(t.corrected)||n.addedAt-t.addedAt)}function Oi(e,t){const n=h(t),r=(e.examples??[]).filter(a=>a.trim());return{examples:r.some(a=>h(a)===n)?r:[...r,t].slice(-Dt),exampleCandidates:xt(e,t)}}function xt(e,t){const n=h(t);return(e.exampleCandidates??[]).filter(r=>h(r.text)!==n)}function Ut(e,t){const n=e.ownerScope;return n?n.kind==="org"?!0:n.kind==="team"?!!t&&n.teamId===t:!1:!1}function Ri(e,t){return e.filter(n=>Ut(n,t))}function Ci(e){return e.type==="agent"}const wi="WORK_COMMENT_ADDED",Ni="WORK_ITEM_ASSIGNED",ki="WORK_ITEM_STATUS_CHANGED";function vi(e,t){const n=r=>{const i=new Date(r);return i.setHours(0,0,0,0),i.getTime()};return Math.round((n(e)-n(t))/Xe)}function Di(e,t){if(e.closedAt!=null)return{score:g,reasons:[]};const n=t.remindersById?.[e.id];if(n&&n.remindAt>t.now)return{score:g,reasons:[]};let r=0;const i=[],a=e.priority??"normal";if(E[a]>0&&(r+=E[a],i.push(`priority:${a}`)),typeof e.dueDate=="number"){const o=vi(e.dueDate,t.now);o<0?(r+=35,i.push("overdue")):o===0&&(r+=20,i.push("due-today"))}return e.source?.initiator==="system"&&e.source.systemReason&&(r+=15,i.push(`auto:${e.source.systemReason}`)),{score:r,reasons:i}}const $t="work_item",Kt="work_project";function Bt(e){return`${$t}:${e}`}function re(e){return`${Kt}:${e}`}function Li(e,t,n){const r=`${e}-${t}`;return n?`${r}-${n}`:r}function Pi(e){const t=/^([A-Za-z0-9]{2,8})-(\d+)(?:-(\d+))?$/.exec((e||"").trim());return t?{projectKey:t[1].toUpperCase(),sequenceNumber:Number(t[2]),...t[3]?{subSequence:Number(t[3])}:{}}:null}function xi(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,3)||"PRJ"}function Ui(e,t=25){const n=new Set([Bt(e.id)]);e.projectId&&n.add(re(e.projectId));for(const r of e.ancestorKeys??[])n.add(r);for(const r of e.partyKeys??[])n.add(r);return Array.from(n).slice(0,t)}function $i(e){return[re(e.id)]}const v=[{key:"open",label:"status_open",category:"todo",order:0},{key:"in_progress",label:"status_in_progress",category:"in_progress",order:1},{key:"done",label:"status_done",category:"done",order:2},{key:"cancelled",label:"status_cancelled",category:"done",order:3}],ie=v.map(e=>e.key);function Gt(e){return e?.statuses?.length?e.statuses:v}function Ft(e,t){return t.find(n=>n.key===e)?.category??"todo"}function Ki(e,t){return t.find(n=>n.key===e)}function Bi(e){const t=Gt(e),n=e?.defaultStatusKey;return n&&t.some(r=>r.key===n)?n:Ht(t)[0]?.key??v[0].key}function Ht(e){return[...e].sort((t,n)=>{const r=(t.order??0)-(n.order??0);return r!==0?r:(t.label||"").localeCompare(n.label||"")})}function Gi(e,t){return Ft(e,t)==="done"}function Wt(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,48).replace(/^-+|-+$/g,"")}function Fi(e,t){const n=Wt(e)||"status",r=new Set([...t,...ie]);if(!r.has(n))return n;for(let i=2;i<500;i++){const a=`${n}-${i}`;if(!r.has(a))return a}return`${n}-${r.size+1}`}function Hi(e){const t=[];if(!e.length)return[{index:-1,reason:"empty"}];const n=new Set;return e.forEach((r,i)=>{if(!r.key){t.push({index:i,reason:"missing_key"});return}ie.includes(r.key)&&t.push({index:i,reason:"reserved_key",key:r.key}),n.has(r.key)&&t.push({index:i,reason:"duplicate_key",key:r.key}),n.add(r.key)}),e.some(r=>r.category==="todo"||r.category==="in_progress")||t.push({index:-1,reason:"no_open"}),e.some(r=>r.category==="done")||t.push({index:-1,reason:"no_done"}),t}const Wi=new Set(["image/png","image/jpeg","image/jpg","image/gif","image/webp"]),Vi=new Set(["text/plain","text/markdown","text/csv","application/json","text/html","application/xml","text/xml"]);function Vt(e){const t=(e??"").trim().toLowerCase().split(";")[0];return t?Wi.has(t)?"image":t==="application/pdf"?"pdf":Vi.has(t)?"text":t.startsWith("audio/")?"audio":"unsupported":"unsupported"}const A=1024*1024,jt={image:5*A,pdf:20*A,text:1*A,audio:20*A},ji=25*A,Yi=5;function Xi(e,t){const n=Vt(e);return n==="unsupported"?"unsupported":t>jt[n]?"too-large":null}function zi(e){return e.access!=="read"&&e.effect!=="internal"}function Yt(e){return`${e.kind}:${e.id||e.url||e.title}`}function qi(e,t=[]){const n=new Set(t),r=[],i=[];for(const a of e){const o=Yt(a);n.has(o)||(n.add(o),r.push(a),i.push(o))}return{sources:r,keys:i}}const Ji="assist-source",Zi=["blocking","due","open"];function Qi(e,t){const[n,r]=(e.subjectKey??"").split(":");return n===t&&r?r:void 0}const ye={blocking:0,due:1,open:2};function ea(e,t){return ye[e.band??"open"]-ye[t.band??"open"]||(t.priority??0)-(e.priority??0)||e.id.localeCompare(t.id)}function ta(e){return e.sessions.filter(t=>t.id!==e.exceptSessionId&&t.state==="connected"&&e.canHold(t.providerId))}function na(e){return e.sessions.filter(t=>t.id!==e.exceptSessionId&&t.state==="connected"&&!e.canHold(t.providerId))}function ra(e){return e.sessions.some(n=>n.id!==e.exceptSessionId&&(n.state==="connected"||n.state==="on_hold"))?{admit:!1,reason:"busy"}:{admit:!0}}function Xt(e,t){const n=new Set(e.disabledIntents??[]),r=e.intentOverrides??{},i=t.intents.filter(o=>!n.has(o.intent)).map(o=>aa(o,r[o.intent]));if(!e.extraIntents||e.extraIntents.length===0)return i;const a=new Set(i.map(o=>o.intent));for(const o of e.extraIntents)a.has(o.intent)||(i.push(o),a.add(o.intent));return i}function zt(e,t){const n={};for(const r of e.intents){if(!r.togglable)continue;const i=t?.[r.intent];n[r.intent]=i??r.defaultEnabled??!0}return n}function ia(e,t){const n=zt(e,t);return Object.entries(n).filter(([,r])=>!r).map(([r])=>r)}function aa(e,t){return t?{intent:t.intent??e.intent,targetSchemes:t.targetSchemes??e.targetSchemes,transport:t.transport??e.transport}:e}function oa(e,t){const n=[];for(const r of e){if(!r.enabled)continue;const i=t[r.providerId];if(i)for(const a of Xt(r,i))n.push({channel:r,description:i,capability:a})}return n}function sa(e,t){return t.filter(n=>n.capability.intent===e)}function qt(e,t){return t.filter(n=>n.capability.targetSchemes.includes(e))}function ca(e,t){return qt(e.scheme,t)}function la(e,t,n){const r=[];for(const i of e)for(const a of n)a.capability.intent===t&&a.capability.targetSchemes.includes(i.scheme)&&r.push({channelIntent:a,endpoint:i});return r}var Jt=(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))(Jt||{});const ua={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 da(e){return e?ua[e]??"note":"note"}const pa="message_window",fa="message_templates",ma={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},ga=(e,t)=>({intent:e,...t}),ha="folder_management",Aa="remote_search",Ea={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},ya="context.collect",Sa="installation-id";function _a(e){const t=[];for(const n of Object.keys(e))for(const r of Object.keys(e[n]))t.push({lang:n,key:r,value:e[n][r]});return t}const Ta="notification-source",Ia=(e,t)=>`${e}.pref.${t}`,ba={ai:["account.read","account.write","agent.read","agent.write","assignment.read","assignment.write","budget.read","budget.write","connector.read","connector.write","context.read","context.write","conversation.read","conversation.write","lens.read","lens.write","message.read","message.write","playbook.read","playbook.write","profile.read","profile.write","run.read","run.write","settings.read","settings.write","tool.read","transcript.write","usage.read"],analytics:["report.read"],"app-store":["app.publish","app.read","app.write","setting.read","setting.write"],assist:["board.read"],automations:["sync.read","sync.write","webhook.read","webhook.write"],communication:["account.read","account.write","activity-type.read","activity.read","activity.write","attachment.read","attribute.read","attribute.write","calendar.read","calendar.write","channel.read","channel.write","custom-field.read","custom-field.write","folder.read","folder.write","inbox.read","inbox.write","interaction.read","interaction.write","reminder.read","template.read","template.write","topic.read","topic.write"],context:["kind.read","kind.write","memory.read","memory.write"],crm:["company.read","company.write","contact.read","contact.write"],"eylo-voip":["account.read","account.write","callflow.read","callflow.write","channel.read","channel.write","contact.read","contact.write","device.read","device.write","group.read","group.write","interaction.read","interaction.write","media.read","media.write","menu.read","menu.write","phone-number.read","phone-number.write","recording.read","recording.write","sip.read","temporal-rule.read","temporal-rule.write","user.read","user.write","vmbox.read","vmbox.write","webhook.read","webhook.write"],google:["account.read","account.write","contact.read"],kb:["article.read","article.write","category.read","category.write","help-center.read","help-center.write","kb.read","kb.write"],mail:["account.write"],meta:["account.read","account.write"],microsoft:["account.read","account.write","contact.read","sync.write"],organization:["billing.read","billing.write","settings.read","settings.write","team.read","team.write"],shopify:["account.read","account.write","order.read"],slack:["thread.read","thread.write"],storage:["artifact.read","artifact.write","file.read","file.write","mount.read","mount.write"],time:["entry.read","entry.write","work-type.read","work-type.write"],user:["user.read","user.write"],work:["item.read","item.write","project.read","project.write"]},ae=9e4,Zt=["out_of_office"],Qt=e=>Zt.includes(e);function Ma(e,t,n){const r=n-e<ae,i=t?.status&&(!t.expiresAt||t.expiresAt>n)?t:void 0;if(!i?.status)return{online:r,status:r?"available":"offline"};const a=i.status;return!r&&!Qt(a)?{online:!1,status:"offline"}:{online:r,status:a,message:i.message}}function Oa(e,t){const n=t-e.lastSeenAt<ae,r=n||Qt(e.status)?e.status:"offline";return n===e.online&&r===e.status?e:{...e,online:n,status:r}}function Ra(e,t){return e?.teamId&&t.includes(e.teamId)?{teamId:e.teamId,mustChoose:!1}:t.length===1?{teamId:t[0],mustChoose:!1}:{teamId:void 0,mustChoose:t.length>1}}function Ca(e){return e.providerAvailable&&e.allowed}const wa="resources.describe",Na="resources.search",ka="resources.resolve",va="resources.attached";function Da(e){const t=e.indexOf(":");return t===-1?e:e.slice(0,t)}const oe="auth";function se(e){const t=typeof e=="string"?e.match(/apps\/([^/?#]+)/):null;return t?t[1]:null}function La(e){const t=se(e);return t?t!==oe:typeof e=="string"&&e.startsWith("/wake")}function Pa(e){return typeof e!="string"||e===""||e==="/"?!0:se(e)===oe}function xa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function en(e){const n=e.split("/").filter(Boolean).map(r=>r.startsWith(":")?r.endsWith("?")?"(?:/[^/]+)?":"/[^/]+":`/${xa(r)}`).join("");return new RegExp(`^${n}\\/?$`)}function tn(e,t){const n=e.split("/").filter(Boolean),r=t.split("/").filter(Boolean),i={};return n.forEach((a,o)=>{if(a.startsWith(":")){const s=a.endsWith("?")?a.slice(1,-1):a.slice(1),l=r[o];l&&(i[s]=l)}}),i}function nn(e){return e.publicBasePath??`/apps/${e.name}`}function Ua(e){const t=[];for(const n of e){if(!n?.name)continue;const r=nn(n);for(const i of n.routes??[]){if(!i.public)continue;const a=i.path==="/"?"":i.path;t.push({appName:n.name,resource:i.resource,pattern:`${r}${a}`,props:i.props})}}return t}function rn(e,t){const n=e.split("/").filter(Boolean),r=t.split("/").filter(Boolean);for(let i=0;i<Math.min(n.length,r.length);i++){const a=n[i].startsWith(":"),o=r[i].startsWith(":");if(a!==o)return o}return n.length>r.length}function an(e,t){if(typeof e!="string")return null;let n=null;for(const r of t)en(r.pattern).test(e)&&(!n||rn(r.pattern,n.pattern))&&(n=r);return n?{...n,params:{...n.props,...tn(n.pattern,e)}}:null}function $a(e,t){return an(e,t)!==null}const Ka="sync-source",Ba="sync-target",Ga=20,Fa={afrikaans:["[Muziek]","(C) TV GELDERLAND 2021","*Thomp thomp thomp*","www.youtube.com","ä n wood s","!.."],english:["[applause]","[APPLAUSE]","(claps)","(clapping)","(audience applauds)","(keyboard clicking)","(keyboard clacking)","(clicking)","[CLICK]","[BLANK_AUDIO]","(upbeat music)","(dramatic music)","[music playing]","(electronic music)","(audience cheering)","(audience cheers)","[MUSIC]","( ( ( ( ) ( ) ( ) ( )","(laughs)","(air whooshing)","<u>Transcribed</u> by https://otter.ai","All new tonight at 6... coming up. A new look at your forecast is A new look at your forecast is","www.mooji.org","KATHRYN A new forecast is coming up... A new forecast is coming up...","KATHRYN pandemic started. increasing since the The pandemic has been","A new look at your forecast this morning... A new look at your","We'll be right back.","We'll see you next week.","Thanks for watching!","❤️ Translated by Amara.org Communit"],flemish:["*clap*","TV GELDERLAND 2020","TV Gelderland 2021","(C) TV GELDERLAND 2021","[Muziek]","Kuman","Ondertitels ingediend door de Amara.org gemeenschap","Ondertiteld door de Amara.org gemeenschap","Dank u wel voor het kijken.","Ondertiteling door de Amara.org gemeenschap","GELUID VAN MAHIH U similarly"],french:["(applaudissements)","[Applaudissements]","Sous-titres réalisés par la communauté d'Amara.org","- Bonne journée. - Bonjour.","POP POP הי","Merci d'avoir regardé cette vidéo.","Merci d'avoir regardé cette vidéo!","Merci d'avoir regardé la vidéo.","J'espère que vous avez apprécié la vidéo.","Je vous remercie de vous abonner","Merci d'avoir regardé!","❤️ par SousTitreur.com","— Sous-titrage ST'501 —","Thanks for watching!","Sous-titres réalisés par l'Amara.org","Sous-titres réalisés para la communauté d'Amara.org","Sous-titres réalisés par la communauté d'Amara.org","Sous-titres fait par Sous-titres par Amara.org","Sous-titres réalisés par les SousTitres d'Amara.org","Sous-titres par Amara.org","Sous-titres par la communauté d'Amara.org","Sous-titres réalisés pour la communauté d'Amara.org","Sous-titres réalisés par la communauté de l'Amara.org","Sous-Titres faits par la communauté d'Amara.org","Sous-titres par l'Amara.org","Sous-titres fait par la communauté d'Amara.org","Sous-titrage ST' 501","Sous-titrage ST'501","Cliquez-vous sur les sous-titres et abonnez-vous à la chaîne d'Amara.org","❤️ par SousTitreur.com"],german:["[Klicken]","(Jubel)","*lacht*","[Anhaltender Beifall]","[Applaus]","(Applaus)","* Applaus *","[MUSIK]","* mustard ml Drumglöck und knack in einem Handbewerb *","Untertitelung aufgrund der Amara.org-Community","Untertitel im Auftrag des ZDF für funk, 2017","Untertitel von Stephanie Geiges","Untertitel der Amara.org-Community","Untertitel im Auftrag des ZDF, 2017","Untertitel im Auftrag des ZDF, 2020","Untertitel im Auftrag des ZDF, 2018","Untertitel im Auftrag des ZDF, 2021","Untertitelung im Auftrag des ZDF, 2021","Copyright WDR 2021","Copyright WDR 2020","Copyright WDR 2019","SWR 2021","SWR 2020"],italian:["Alla prossima!","*applauso*","[Musica]","[Musica]","[Applausi]","*Bip bip bip bip*","(musica del NS shore)","D' 1962 alle tribunte del Gulf","Sottotitoli creati dalla comunità Amara.org","Sottotitoli di Sottotitoli di Amara.org","Sottotitoli e revisione al canale di Amara.org","Sottotitoli e revisione a cura di Amara.org","Sottotitoli e revisione a cura di QTSS","Sottotitoli e revisione a cura di QTSS.","Sottotitoli a cura di QTSS","Sottotitoli a cura di Sottotitoli"],spanish:["[música]","[Música de cierre]","[Aplausos]","(Aplausos)","www.alimmenta.com","¡Gracias por ver el vídeo!","(sonidos del celular) (Inudible distorsión)","¡Suscríbete!","Subtítulos realizados por la comunidad de Amara.org","Subtitulado por la comunidad de Amara.org","Subtítulos por la comunidad de Amara.org","Subtítulos creados por la comunidad de Amara.org","Subtítulos en español de Amara.org","Subtítulos hechos por la comunidad de Amara.org","Subtitulos por la comunidad de Amara.org","Más información www.alimmenta.com","www.mooji.org","[MÚSICA]","[Music cuts in British]"]},on=e=>{let t=e;return Object.values(Fa).forEach(n=>{n.forEach(r=>{t=t.replaceAll(r,"")})}),t=t.replace(/\(.*?\)/g,""),t=t.replace(/\[.*?\]/g,""),t},sn=6e4,cn=8e3,ln=2,un=.4,Ha=3,Wa=new Set(["aan","als","ben","bent","bij","dan","dat","deze","die","dit","doen","door","dus","echt","een","eens","even","gaan","gaat","geen","geweest","goed","graag","had","heb","hebben","hebt","heeft","het","hier","hoe","hoor","iets","inderdaad","kan","klopt","kunnen","kunt","maar","mag","mee","meer","met","mij","mijn","misschien","moet","moeten","naar","net","niet","nog","nou","oke","ook","over","prima","toch","uhm","uit","van","veel","voor","wat","weer","weet","wel","wij","wil","wilt","worden","wordt","zeg","zeggen","zijn","zou","zult","about","and","are","been","but","can","does","for","have","just","know","like","not","okay","right","she","that","the","them","then","there","they","this","want","was","well","were","what","will","with","would","yeah","you","your"]);function dn(e){const t=new Set;for(const n of e.toLowerCase().split(/[^a-z0-9À-ɏ]+/))n.length<Ha||Wa.has(n)||t.add(n);return[...t]}function pn(e,t){if(!e.length)return 0;if(!t.length)return 1;const n=new Set(t),r=new Set(e);let i=0;for(const a of r)n.has(a)||(i+=1);return i/r.size}function fn(e,t=sn){const n=e.filter(o=>!o.partial&&typeof o.text=="string");if(!n.length)return{text:"",segmentCount:0};const i=n.reduce((o,s)=>Math.max(o,s.endedAt??0),0)-t;return{text:n.filter(o=>(o.endedAt??0)>=i).map(o=>on(o.text).trim()).filter(Boolean).join(" ").replace(/\s+/g," ").trim(),segmentCount:n.length}}const mn=60;function Va(e,t,n=mn){const r=new Set(e),i=[...e];for(const a of t)!a||r.has(a)||(r.add(a),i.push(a));return i.slice(-n)}function ja(e){const{segments:t,now:n,state:r}=e;if(r.lastTriggerAt&&n-r.lastTriggerAt<cn)return{trigger:!1,reason:"too_soon"};const i=fn(t,e.windowMs);if(!i.text)return{trigger:!1,reason:"no_speech"};const a=i.segmentCount-(r.lastSegmentCount??0);if(r.lastQueryTerms&&a<ln)return{trigger:!1,reason:"too_few_new"};const o=dn(i.text);return o.length?r.lastQueryTerms?.length&&pn(o,r.lastQueryTerms)<un?{trigger:!1,reason:"same_topic"}:{trigger:!0,text:i.text,terms:o,segmentCount:i.segmentCount}:{trigger:!1,reason:"no_speech"}}const Ya="navNotice",D={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}},gn="NL",Xa=15,za=8,qa=Array.from(new Set(Object.values(D).map(e=>e.callingCode))).sort((e,t)=>t.length-e.length);function Se(e){if(e)return D[e.trim().toUpperCase()]}function C(e,t){return e.length>=t.nsnMin&&e.length<=t.nsnMax}function _e(e){if(e.length>Xa)return null;for(const t of qa){if(!e.startsWith(t))continue;const n=e.slice(t.length);for(const r of Object.values(D)){if(r.callingCode!==t)continue;const i=r.trunkPrefix,a=i&&n.startsWith(i)?n.slice(i.length):n;if(C(a,r))return`+${t}${a}`}return null}return e.length<za?null:`+${e}`}function Ja(e){let t=e.trim();const n=t.match(/^(sips?|tel|whatsapp):/i);n&&(t=t.slice(n[0].length));const r=t.indexOf("@");return r>=0&&(t=t.slice(0,r)),t.trim()}function Za(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 X(e,t){if(!e)return null;const n=Ja(e);if(!n)return null;const r=n.startsWith("+"),i=n.replace(/\D/g,"");if(!i)return null;if(r)return _e(i);if(i.startsWith("00"))return _e(i.slice(2));const a=Se(t)??Se(gn);if(!a)return null;const o=a.trunkPrefix;if(o&&i.startsWith(o)){const s=i.slice(o.length);return C(s,a)?`+${a.callingCode}${s}`:null}if(i.startsWith(a.callingCode)){const s=i.slice(a.callingCode.length);if(C(s,a))return`+${a.callingCode}${s}`}return!o&&C(i,a)?`+${a.callingCode}${i}`:null}function Qa(e,t=9){const n=(e??"").replace(/\D/g,"");return n.length<t?null:n.slice(-t)}function ce(e){if(!e)return null;const t=e.trim().toLowerCase(),n=t.lastIndexOf("@");if(n<=0||n===t.length-1)return null;const r=t.slice(0,n).split("+")[0],i=t.slice(n+1);return!r||!i.includes(".")?null:`${r}@${i}`}function eo(e){const t=ce(e);return t?t.slice(t.lastIndexOf("@")+1):null}const to=new Set(["co.uk","org.uk","gov.uk","ac.uk","com.au","co.nz","com.br","co.za"]);function hn(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 to.has(n)&&t.length>=3?t.slice(-3).join("."):n}const An=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 no(e){const t=hn(e);return t?An.has(t):!1}function ro(e){if(!e)return!1;const t=e.trim().toLowerCase();return t==="tel"||t==="sms"||t==="whatsapp"||t==="fax"}function io(e,t,n){if(!e||!t)return null;const r=e.trim().toLowerCase();if(r==="tel"||r==="sms"||r==="whatsapp"){const a=X(t,n);return a?`tel:${a}`:null}if(r==="fax"){const a=X(t,n);return a?`fax:${a}`:null}if(r==="mailto"||r==="email"){const a=ce(t);return a?`mailto:${a}`:null}const i=t.trim().toLowerCase();return i?`${r}:${i}`:null}const ao=/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g,oo=/(\*|_)(?=\S)([^*_\n]*?\S)\1/g;function so(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(`
7
+ `:t==="mail"?"<br><br>-- <br>":"<br><br>"}${i.body}`:n}function yr(e){return e.endpoints??[]}const Ye=36e5,Xe=864e5,g=-1/0,_r=e=>e.score>g,E={urgent:40,high:25,normal:10,low:0};function Tr(e){return Object.fromEntries(e.map(t=>[t.resourceId,t]))}const Ir=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,br=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function ze(e,t){return!!(e&&Ir.test(e)||t&&br.test(t))}const qe=3,Je=600;function Mr(e,t){return e>=qe||t>=Je}function Ze(e,t){return e.lastActivityAt?!(e.seenBy??[]).includes(t):!1}const Qe=["open","pending"],et=1e3,tt={urgent:1,high:4,normal:8,low:24},nt=72;function rt(e){return e.lastActivityAt??(e.createdAt?new Date(ve(e)).getTime():0)}function it(e,t){return at(t.remindersById?.[e.id],e,t.now)}function at(e,t,n){return!e||e.remindAt<=n?!1:!((t.lastActivityAt??0)>e.parkedAt&&t.lastActivityPreview?.direction==="inbound")}const ot=e=>Ce(e)==="outbound_message",st=e=>Qe.includes(e);function k(e,t){return Math.max(0,(t-rt(e))/Ye)}function ct(e,t){const n=e.assignedInboxId?t?.[e.assignedInboxId]:void 0;return typeof n=="number"&&n>0?n:tt[e.priority??"normal"]}function Or(e){const t={};for(const n of e)typeof n.slaHours=="number"&&n.slaHours>0&&(t[n.id]=n.slaHours);return t}function Rr(e,t,n){return!st(e.status)||e.firstResponseAt?!1:k(e,t)>ct(e,n)}function lt(e,t){const n=e.lastActivityPreview;return n?.direction!=="outbound"||!ot(n.type)?!1:k(e,t)<nt}function Cr(e,t){if(!st(e.status))return{score:g,reasons:[]};if(e.snoozedTill&&e.snoozedTill>t.now)return{score:g,reasons:[]};if(lt(e,t.now))return{score:g,reasons:[]};if(it(e,t))return{score:g,reasons:[]};let n=0;const r=[],i=e.priority??"normal";E[i]>0&&(n+=E[i],r.push(`priority:${i}`)),Ze(e,t.userId)&&(n+=20,r.push("unseen")),e.assignedUserId&&e.assignedUserId===t.userId&&(n+=15,r.push("assigned-to-you"));const a=k(e,t.now);if(a>0){const s=Math.min(a*2,30);n+=s,a>=1&&r.push(`waiting:${Math.round(a)}h`)}const o=e.lastActivityPreview;return o?.type==="AI_ACTION_PROPOSED"&&(n+=30,r.push("awaiting-approval")),o?.direction==="outbound"&&ot(o.type)&&(n+=10,r.push("no-reply")),!e.firstResponseAt&&e.lastActivityPreview?.direction==="inbound"&&(n+=10,r.push("awaiting-reply")),ze(e.remoteParty?.resource,e.lastActivityPreview?.snippet)&&(n-=et,r.push("bulk")),{score:n,reasons:r}}const wr=e=>!!e.assignedUserId||!!e.assignedInboxId,Nr=e=>e.status==="closed",kr=e=>({urgent:10,high:5,normal:2,low:1})[e.priority]||0,vr=(e,t=30)=>e.title?.length<=t?e.title:`${e.title.substring(0,t)}...`;function Dr(e,t){const n=e.labels??[];return n.find(r=>r.locale===t)?.label??n[0]?.label??e.url}function Lr(e,t,n){const r=e.translations??[];return r.find(i=>i.locale===t)??(n?r.find(i=>i.locale===n):void 0)??{locale:t}}const V=[{code:"nl",label:"Nederlands",english:"Dutch"},{code:"en",label:"English",english:"English"},{code:"de",label:"Deutsch",english:"German"},{code:"fr",label:"Français",english:"French"},{code:"es",label:"Español",english:"Spanish"},{code:"it",label:"Italiano",english:"Italian"},{code:"pt",label:"Português",english:"Portuguese"},{code:"pl",label:"Polski",english:"Polish"},{code:"sv",label:"Svenska",english:"Swedish"},{code:"da",label:"Dansk",english:"Danish"},{code:"nb",label:"Norsk bokmål",english:"Norwegian Bokmål"},{code:"fi",label:"Suomi",english:"Finnish"},{code:"tr",label:"Türkçe",english:"Turkish"}];function ut(e){const t=(e??"").toLowerCase();return V.find(n=>n.code===t)??V.find(n=>n.code===t.split("-")[0])}function Pr(e){return ut(e)?.label??e}function xr(e){const t=ut(e);return t?t.english===t.label?`${t.english} (${t.code})`:`${t.english} — ${t.label} (${t.code})`:e}const ee=3;function dt(e,t){const n=new Set;let r=1,i=t.get(e)?.parentId;for(;i;){if(n.has(i)||(n.add(i),r++,r>ee+1))return 1/0;i=t.get(i)?.parentId}return r}function Ur(e,t,n){if(!e)return!0;if(e===t)return!1;const r=new Map(n.map(o=>[o.id,o]));if(!r.has(e)||t&&pt(e,t,r))return!1;const i=dt(e,r),a=t?te(t,n):1;return i+a<=ee}function pt(e,t,n){const r=new Set;let i=n.get(e)?.parentId;for(;i;){if(i===t)return!0;if(r.has(i))return!1;r.add(i),i=n.get(i)?.parentId}return!1}function te(e,t,n=new Set){if(n.has(e))return 1;n.add(e);const r=t.filter(i=>i.parentId===e);return r.length?1+Math.max(...r.map(i=>te(i.id,t,n))):1}const ft="en";function mt(e){return e.defaultLocale||e.locale||ft}function $r(e){const t=new Set,n=[];for(const r of[mt(e),...e.locales??[]])!r||t.has(r)||(t.add(r),n.push(r));return n}function Kr(e,t,n){const r=e.translations??[];return r.find(i=>i.locale===t)?.name??(n?r.find(i=>i.locale===n)?.name:void 0)??e.name}const j=["lookup","condition","parallel","for-each"];function Y(e){for(const t of e){if(!j.includes(t.type))return`staptype "${t.type}" mag niet meelezen (alleen ${j.join(", ")})`;if(t.type==="parallel")for(const n of t.branches??[]){const r=Y(n);if(r)return r}if(t.type==="for-each"){const n=Y(t.body??[]);if(n)return n}}return null}function Br(e,t){switch(e.kind){case"org":return!0;case"team":return!!t.teamId&&e.teamId===t.teamId;case"personal":return e.userId===t.userId}}function Gr(e,t){return e.filter(n=>n.enabled&&Br(n.ownerScope,t))}function Fr(e){return e.credentialScope?e.credentialScope:(e.authMode??"header")==="header"||e.oauth?.scope==="org"?"shared":"per-user"}function Hr(e){return`mcp__${e}__`}const Wr=1e3,Vr=2e3,jr=500,Yr=12e3,Xr=4e3,gt=["contact","company","work_item"];function zr(e){if(!e)return!1;const t=e.slice(0,e.indexOf(":"));return gt.includes(t)}const qr="onboarding-source",Jr=["support","billing","availability","sales","onboarding"],Zr=["keep","replace"];function ht(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function Qr(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 r=t.slice(0,n),i=t.slice(n+1).trim();if(i){if(r==="user")return{kind:"user",userId:i};if(r==="team")return{kind:"team",teamId:i}}}function At(e){return ht(e)}function Et(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"}}}const St=Et;function ei(e){return e.agentId?{kind:"user",userId:e.agentId}:St(e.ownerScope)}function ti(e){return At(e)}function ni(e,t){if(!t)return;let n=e;for(const r of t.split(".")){if(n===null||typeof n!="object")return;n=n[r]}return n}function ri(e,t){return e.targets.find(n=>n.activityTypes.includes(t))}function ii(e,t){if(t)return e.targets.find(n=>n.id===t)}function yt(e){return e?.kind==="assignment"}function ai(e){const{trigger:t,agentId:n,target:r,activityType:i,assigneeUserId:a,authorUserId:o}=e;return yt(t)?n?r?r.activityTypes.includes(i)?a?a!==n?"assigned to someone else":o&&o===n?"the agent assigned this to itself, which would restart its own run":null:`no assignee found at ${r.assigneePath}`:`activity type ${i} does not announce an assignment for ${r.id}`:`assignment target kind "${t.targetKind}" is not declared by any installed app`:"this playbook has no agent, so an assignment can never be for it":"trigger is not an assignment trigger"}function oi(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const si=[{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:"itemId",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:"toCategory",type:"string"},{name:"contactId",type:"string"},{name:"companyId",type:"string"},{name:"assigneeUserId",type:"string"}],ci={topics:[{name:"topicId",type:"string"},{name:"topic",type:"string"},{name:"confidence",type:"number"},{name:"reasoning",type:"string"}],question:[{name:"answer",type:"boolean"},{name:"reasoning",type:"string"}],extract:[]};function _t(e){return`${e.type}:${e.id}`}const Tt="interaction";function It(e){return e?.type===Tt?e.id:void 0}const bt=64,Mt=8e3;function li(e){const t=typeof e=="number"?e:Number(String(e??"").trim());if(!(!Number.isFinite(t)||t<=0))return Math.min(Math.max(Math.round(t),bt),Mt)}const ui={kind:"workflow",steps:[]};function di(e){return e?.kind==="workflow"?e.steps:[]}function pi(e){return e?.kind==="procedure"?e.procedure:void 0}function Ot(e){const t=e?.approved??0,n=t+(e?.rejected??0);return{total:n,rate:n?t/n:0}}const Rt=10,Ct=.9;function fi(e){const{total:t,rate:n}=Ot(e);return t>=Rt&&n>=Ct}const wt=["done","escalated","failed","stopped"];function mi(e){return wt.includes(e)}function Nt(e){return e==="waiting"}function gi(e){return e==="running"||Nt(e)}function ne(e){return e.subjectKind&&e.subjectId?{type:e.subjectKind,id:e.subjectId}:void 0}function hi(e){const t=ne(e);return t?_t(t):void 0}function Ai(e){return It(ne(e))}function Ei(e,t){const n=e.accumulatedSeconds||0;return e.runningSince?n+Math.max(0,Math.floor((t-e.runningSince)/1e3)):n}function Si(e,t){const n=Math.max(1,Math.ceil(Math.max(0,e)/60));if(!t||t==="exact")return n*60;const r=Number(t);return!Number.isFinite(r)||r<=0?n*60:Math.ceil(n/r)*r*60}function yi(e){const t=Math.max(0,Math.round(e/60));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function _i(e){const t=Math.max(0,Math.floor(e)),n=a=>String(a).padStart(2,"0"),r=Math.floor(t/60)%60,i=Math.floor(t/3600);return i>0?`${i}:${n(r)}:${n(t%60)}`:`${n(r)}:${n(t%60)}`}function kt(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,48).replace(/^-+|-+$/g,"")}function Ti(e,t){const n=kt(e)||"werksoort",r=new Set(t);if(!r.has(n))return n;for(let i=2;i<500;i++){const a=`${n}-${i}`;if(!r.has(a))return a}return`${n}-${r.size+1}`}function Ii(e,t){const n=e.ownerScope;return!n||n.kind==="org"?!0:t.includes(n.teamId)}function bi(e){return e.filter(t=>!t.archived).sort(vt)}function vt(e,t){const n=(e.order??0)-(t.order??0);return n!==0?n:(e.label||"").localeCompare(t.label||"")}const Dt=20,Lt=20,R=300;function h(e){return e.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu," ").replace(/\s+/g," ").trim()}function Pt(e){const t=e.replace(/\s+/g," ").trim();if(t.length<=R)return t;const n=t.slice(0,R),r=Math.max(n.lastIndexOf(". "),n.lastIndexOf("! "),n.lastIndexOf("? "));return r>R*.6?n.slice(0,r+1):`${n.trimEnd()}…`}function Mi(e,t){const n=Pt(t.text),r=h(n);if(!r||(e.examples??[]).some(o=>h(o)===r))return null;const i=e.exampleCandidates??[],a=i.findIndex(o=>h(o.text)===r);if(a>=0){if(i[a].corrected||!t.corrected)return null;const o=[...i];return o[a]={...o[a],corrected:!0,addedAt:t.addedAt},Ee(o)}return Ee([{...t,text:n},...i]).slice(0,Lt)}function Ee(e){return[...e].sort((t,n)=>Number(n.corrected)-Number(t.corrected)||n.addedAt-t.addedAt)}function Oi(e,t){const n=h(t),r=(e.examples??[]).filter(a=>a.trim());return{examples:r.some(a=>h(a)===n)?r:[...r,t].slice(-Dt),exampleCandidates:xt(e,t)}}function xt(e,t){const n=h(t);return(e.exampleCandidates??[]).filter(r=>h(r.text)!==n)}function Ut(e,t){const n=e.ownerScope;return n?n.kind==="org"?!0:n.kind==="team"?!!t&&n.teamId===t:!1:!1}function Ri(e,t){return e.filter(n=>Ut(n,t))}function Ci(e){return e.type==="agent"}const wi="WORK_COMMENT_ADDED",Ni="WORK_ITEM_ASSIGNED",ki="WORK_ITEM_STATUS_CHANGED";function vi(e,t){const n=r=>{const i=new Date(r);return i.setHours(0,0,0,0),i.getTime()};return Math.round((n(e)-n(t))/Xe)}function Di(e,t){if(e.closedAt!=null)return{score:g,reasons:[]};const n=t.remindersById?.[e.id];if(n&&n.remindAt>t.now)return{score:g,reasons:[]};let r=0;const i=[],a=e.priority??"normal";if(E[a]>0&&(r+=E[a],i.push(`priority:${a}`)),typeof e.dueDate=="number"){const o=vi(e.dueDate,t.now);o<0?(r+=35,i.push("overdue")):o===0&&(r+=20,i.push("due-today"))}return e.source?.initiator==="system"&&e.source.systemReason&&(r+=15,i.push(`auto:${e.source.systemReason}`)),{score:r,reasons:i}}const $t="work_item",Kt="work_project";function Bt(e){return`${$t}:${e}`}function re(e){return`${Kt}:${e}`}function Li(e,t,n){const r=`${e}-${t}`;return n?`${r}-${n}`:r}function Pi(e){const t=/^([A-Za-z0-9]{2,8})-(\d+)(?:-(\d+))?$/.exec((e||"").trim());return t?{projectKey:t[1].toUpperCase(),sequenceNumber:Number(t[2]),...t[3]?{subSequence:Number(t[3])}:{}}:null}function xi(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,3)||"PRJ"}function Ui(e,t=25){const n=new Set([Bt(e.id)]);e.projectId&&n.add(re(e.projectId));for(const r of e.ancestorKeys??[])n.add(r);for(const r of e.partyKeys??[])n.add(r);return Array.from(n).slice(0,t)}function $i(e){return[re(e.id)]}const v=[{key:"open",label:"status_open",category:"todo",order:0},{key:"in_progress",label:"status_in_progress",category:"in_progress",order:1},{key:"done",label:"status_done",category:"done",order:2},{key:"cancelled",label:"status_cancelled",category:"done",order:3}],ie=v.map(e=>e.key);function Gt(e){return e?.statuses?.length?e.statuses:v}function Ft(e,t){return t.find(n=>n.key===e)?.category??"todo"}function Ki(e,t){return t.find(n=>n.key===e)}function Bi(e){const t=Gt(e),n=e?.defaultStatusKey;return n&&t.some(r=>r.key===n)?n:Ht(t)[0]?.key??v[0].key}function Ht(e){return[...e].sort((t,n)=>{const r=(t.order??0)-(n.order??0);return r!==0?r:(t.label||"").localeCompare(n.label||"")})}function Gi(e,t){return Ft(e,t)==="done"}function Wt(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,48).replace(/^-+|-+$/g,"")}function Fi(e,t){const n=Wt(e)||"status",r=new Set([...t,...ie]);if(!r.has(n))return n;for(let i=2;i<500;i++){const a=`${n}-${i}`;if(!r.has(a))return a}return`${n}-${r.size+1}`}function Hi(e){const t=[];if(!e.length)return[{index:-1,reason:"empty"}];const n=new Set;return e.forEach((r,i)=>{if(!r.key){t.push({index:i,reason:"missing_key"});return}ie.includes(r.key)&&t.push({index:i,reason:"reserved_key",key:r.key}),n.has(r.key)&&t.push({index:i,reason:"duplicate_key",key:r.key}),n.add(r.key)}),e.some(r=>r.category==="todo"||r.category==="in_progress")||t.push({index:-1,reason:"no_open"}),e.some(r=>r.category==="done")||t.push({index:-1,reason:"no_done"}),t}const Wi=new Set(["image/png","image/jpeg","image/jpg","image/gif","image/webp"]),Vi=new Set(["text/plain","text/markdown","text/csv","application/json","text/html","application/xml","text/xml"]);function Vt(e){const t=(e??"").trim().toLowerCase().split(";")[0];return t?Wi.has(t)?"image":t==="application/pdf"?"pdf":Vi.has(t)?"text":t.startsWith("audio/")?"audio":"unsupported":"unsupported"}const A=1024*1024,jt={image:5*A,pdf:20*A,text:1*A,audio:20*A},ji=25*A,Yi=5;function Xi(e,t){const n=Vt(e);return n==="unsupported"?"unsupported":t>jt[n]?"too-large":null}function zi(e){return e.access!=="read"&&e.effect!=="internal"}function Yt(e){return`${e.kind}:${e.id||e.url||e.title}`}function qi(e,t=[]){const n=new Set(t),r=[],i=[];for(const a of e){const o=Yt(a);n.has(o)||(n.add(o),r.push(a),i.push(o))}return{sources:r,keys:i}}const Ji="assist-source",Zi=["blocking","due","open"];function Qi(e,t){const[n,r]=(e.subjectKey??"").split(":");return n===t&&r?r:void 0}const Se={blocking:0,due:1,open:2};function ea(e,t){return Se[e.band??"open"]-Se[t.band??"open"]||(t.priority??0)-(e.priority??0)||e.id.localeCompare(t.id)}function ta(e){return e.sessions.filter(t=>t.id!==e.exceptSessionId&&t.state==="connected"&&e.canHold(t.providerId))}function na(e){return e.sessions.filter(t=>t.id!==e.exceptSessionId&&t.state==="connected"&&!e.canHold(t.providerId))}function ra(e){return e.sessions.some(n=>n.id!==e.exceptSessionId&&(n.state==="connected"||n.state==="on_hold"))?{admit:!1,reason:"busy"}:{admit:!0}}function Xt(e,t){const n=new Set(e.disabledIntents??[]),r=e.intentOverrides??{},i=t.intents.filter(o=>!n.has(o.intent)).map(o=>aa(o,r[o.intent]));if(!e.extraIntents||e.extraIntents.length===0)return i;const a=new Set(i.map(o=>o.intent));for(const o of e.extraIntents)a.has(o.intent)||(i.push(o),a.add(o.intent));return i}function zt(e,t){const n={};for(const r of e.intents){if(!r.togglable)continue;const i=t?.[r.intent];n[r.intent]=i??r.defaultEnabled??!0}return n}function ia(e,t){const n=zt(e,t);return Object.entries(n).filter(([,r])=>!r).map(([r])=>r)}function aa(e,t){return t?{intent:t.intent??e.intent,targetSchemes:t.targetSchemes??e.targetSchemes,transport:t.transport??e.transport}:e}function oa(e,t){const n=[];for(const r of e){if(!r.enabled)continue;const i=t[r.providerId];if(i)for(const a of Xt(r,i))n.push({channel:r,description:i,capability:a})}return n}function sa(e,t){return t.filter(n=>n.capability.intent===e)}function qt(e,t){return t.filter(n=>n.capability.targetSchemes.includes(e))}function ca(e,t){return qt(e.scheme,t)}function la(e,t,n){const r=[];for(const i of e)for(const a of n)a.capability.intent===t&&a.capability.targetSchemes.includes(i.scheme)&&r.push({channelIntent:a,endpoint:i});return r}var Jt=(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))(Jt||{});const ua={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 da(e){return e?ua[e]??"note":"note"}const pa="message_window",fa="message_templates",ma={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},ga=(e,t)=>({intent:e,...t}),ha="folder_management",Aa="remote_search",Ea={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},Sa="context.collect",ya="installation-id";function _a(e){const t=[];for(const n of Object.keys(e))for(const r of Object.keys(e[n]))t.push({lang:n,key:r,value:e[n][r]});return t}const Ta="notification-source",Ia=(e,t)=>`${e}.pref.${t}`,ba={ai:["account.read","account.write","agent.read","agent.write","assignment.read","assignment.write","budget.read","budget.write","connector.read","connector.write","context.read","context.write","conversation.read","conversation.write","lens.read","lens.write","message.read","message.write","playbook.read","playbook.write","profile.read","profile.write","run.read","run.write","settings.read","settings.write","tool.read","transcript.write","usage.read"],analytics:["report.read"],"app-store":["app.publish","app.read","app.write","setting.read","setting.write"],assist:["board.read"],automations:["sync.read","sync.write","webhook.read","webhook.write"],communication:["account.read","account.write","activity-type.read","activity.read","activity.write","attachment.read","attribute.read","attribute.write","calendar.read","calendar.write","channel.read","channel.write","custom-field.read","custom-field.write","folder.read","folder.write","inbox.read","inbox.write","interaction.read","interaction.write","reminder.read","template.read","template.write","topic.read","topic.write"],context:["kind.read","kind.write","memory.read","memory.write"],crm:["company.read","company.write","contact.read","contact.write"],"eylo-voip":["account.read","account.write","callflow.read","callflow.write","channel.read","channel.write","contact.read","contact.write","device.read","device.write","group.read","group.write","interaction.read","interaction.write","media.read","media.write","menu.read","menu.write","phone-number.read","phone-number.write","recording.read","recording.write","sip.read","temporal-rule.read","temporal-rule.write","user.read","user.write","vmbox.read","vmbox.write","webhook.read","webhook.write"],google:["account.read","account.write","contact.read"],kb:["article.read","article.write","category.read","category.write","help-center.read","help-center.write","kb.read","kb.write"],mail:["account.write"],meta:["account.read","account.write"],microsoft:["account.read","account.write","contact.read","sync.write"],organization:["billing.read","billing.write","settings.read","settings.write","team.read","team.write"],shopify:["account.read","account.write","order.read"],slack:["thread.read","thread.write"],storage:["artifact.read","artifact.write","file.read","file.write","mount.read","mount.write"],time:["entry.read","entry.write","work-type.read","work-type.write"],user:["user.read","user.write"],work:["item.read","item.write","project.read","project.write"]},ae=9e4,Zt=["out_of_office"],Qt=e=>Zt.includes(e);function Ma(e,t,n){const r=n-e<ae,i=t?.status&&(!t.expiresAt||t.expiresAt>n)?t:void 0;if(!i?.status)return{online:r,status:r?"available":"offline"};const a=i.status;return!r&&!Qt(a)?{online:!1,status:"offline"}:{online:r,status:a,message:i.message}}function Oa(e,t){const n=t-e.lastSeenAt<ae,r=n||Qt(e.status)?e.status:"offline";return n===e.online&&r===e.status?e:{...e,online:n,status:r}}function Ra(e,t){return e?.teamId&&t.includes(e.teamId)?{teamId:e.teamId,mustChoose:!1}:t.length===1?{teamId:t[0],mustChoose:!1}:{teamId:void 0,mustChoose:t.length>1}}function Ca(e){return e.providerAvailable&&e.allowed}const wa="resources.describe",Na="resources.search",ka="resources.resolve",va="resources.attached";function Da(e){const t=e.indexOf(":");return t===-1?e:e.slice(0,t)}const oe="auth";function se(e){const t=typeof e=="string"?e.match(/apps\/([^/?#]+)/):null;return t?t[1]:null}function La(e){const t=se(e);return t?t!==oe:typeof e=="string"&&e.startsWith("/wake")}function Pa(e){return typeof e!="string"||e===""||e==="/"?!0:se(e)===oe}function xa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function en(e){const n=e.split("/").filter(Boolean).map(r=>r.startsWith(":")?r.endsWith("?")?"(?:/[^/]+)?":"/[^/]+":`/${xa(r)}`).join("");return new RegExp(`^${n}\\/?$`)}function tn(e,t){const n=e.split("/").filter(Boolean),r=t.split("/").filter(Boolean),i={};return n.forEach((a,o)=>{if(a.startsWith(":")){const s=a.endsWith("?")?a.slice(1,-1):a.slice(1),l=r[o];l&&(i[s]=l)}}),i}function nn(e){return e.publicBasePath??`/apps/${e.name}`}function Ua(e){const t=[];for(const n of e){if(!n?.name)continue;const r=nn(n);for(const i of n.routes??[]){if(!i.public)continue;const a=i.path==="/"?"":i.path;t.push({appName:n.name,resource:i.resource,pattern:`${r}${a}`,props:i.props})}}return t}function rn(e,t){const n=e.split("/").filter(Boolean),r=t.split("/").filter(Boolean);for(let i=0;i<Math.min(n.length,r.length);i++){const a=n[i].startsWith(":"),o=r[i].startsWith(":");if(a!==o)return o}return n.length>r.length}function an(e,t){if(typeof e!="string")return null;let n=null;for(const r of t)en(r.pattern).test(e)&&(!n||rn(r.pattern,n.pattern))&&(n=r);return n?{...n,params:{...n.props,...tn(n.pattern,e)}}:null}function $a(e,t){return an(e,t)!==null}const Ka="sync-source",Ba="sync-target",Ga=20,Fa={afrikaans:["[Muziek]","(C) TV GELDERLAND 2021","*Thomp thomp thomp*","www.youtube.com","ä n wood s","!.."],english:["[applause]","[APPLAUSE]","(claps)","(clapping)","(audience applauds)","(keyboard clicking)","(keyboard clacking)","(clicking)","[CLICK]","[BLANK_AUDIO]","(upbeat music)","(dramatic music)","[music playing]","(electronic music)","(audience cheering)","(audience cheers)","[MUSIC]","( ( ( ( ) ( ) ( ) ( )","(laughs)","(air whooshing)","<u>Transcribed</u> by https://otter.ai","All new tonight at 6... coming up. A new look at your forecast is A new look at your forecast is","www.mooji.org","KATHRYN A new forecast is coming up... A new forecast is coming up...","KATHRYN pandemic started. increasing since the The pandemic has been","A new look at your forecast this morning... A new look at your","We'll be right back.","We'll see you next week.","Thanks for watching!","❤️ Translated by Amara.org Communit"],flemish:["*clap*","TV GELDERLAND 2020","TV Gelderland 2021","(C) TV GELDERLAND 2021","[Muziek]","Kuman","Ondertitels ingediend door de Amara.org gemeenschap","Ondertiteld door de Amara.org gemeenschap","Dank u wel voor het kijken.","Ondertiteling door de Amara.org gemeenschap","GELUID VAN MAHIH U similarly"],french:["(applaudissements)","[Applaudissements]","Sous-titres réalisés par la communauté d'Amara.org","- Bonne journée. - Bonjour.","POP POP הי","Merci d'avoir regardé cette vidéo.","Merci d'avoir regardé cette vidéo!","Merci d'avoir regardé la vidéo.","J'espère que vous avez apprécié la vidéo.","Je vous remercie de vous abonner","Merci d'avoir regardé!","❤️ par SousTitreur.com","— Sous-titrage ST'501 —","Thanks for watching!","Sous-titres réalisés par l'Amara.org","Sous-titres réalisés para la communauté d'Amara.org","Sous-titres réalisés par la communauté d'Amara.org","Sous-titres fait par Sous-titres par Amara.org","Sous-titres réalisés par les SousTitres d'Amara.org","Sous-titres par Amara.org","Sous-titres par la communauté d'Amara.org","Sous-titres réalisés pour la communauté d'Amara.org","Sous-titres réalisés par la communauté de l'Amara.org","Sous-Titres faits par la communauté d'Amara.org","Sous-titres par l'Amara.org","Sous-titres fait par la communauté d'Amara.org","Sous-titrage ST' 501","Sous-titrage ST'501","Cliquez-vous sur les sous-titres et abonnez-vous à la chaîne d'Amara.org","❤️ par SousTitreur.com"],german:["[Klicken]","(Jubel)","*lacht*","[Anhaltender Beifall]","[Applaus]","(Applaus)","* Applaus *","[MUSIK]","* mustard ml Drumglöck und knack in einem Handbewerb *","Untertitelung aufgrund der Amara.org-Community","Untertitel im Auftrag des ZDF für funk, 2017","Untertitel von Stephanie Geiges","Untertitel der Amara.org-Community","Untertitel im Auftrag des ZDF, 2017","Untertitel im Auftrag des ZDF, 2020","Untertitel im Auftrag des ZDF, 2018","Untertitel im Auftrag des ZDF, 2021","Untertitelung im Auftrag des ZDF, 2021","Copyright WDR 2021","Copyright WDR 2020","Copyright WDR 2019","SWR 2021","SWR 2020"],italian:["Alla prossima!","*applauso*","[Musica]","[Musica]","[Applausi]","*Bip bip bip bip*","(musica del NS shore)","D' 1962 alle tribunte del Gulf","Sottotitoli creati dalla comunità Amara.org","Sottotitoli di Sottotitoli di Amara.org","Sottotitoli e revisione al canale di Amara.org","Sottotitoli e revisione a cura di Amara.org","Sottotitoli e revisione a cura di QTSS","Sottotitoli e revisione a cura di QTSS.","Sottotitoli a cura di QTSS","Sottotitoli a cura di Sottotitoli"],spanish:["[música]","[Música de cierre]","[Aplausos]","(Aplausos)","www.alimmenta.com","¡Gracias por ver el vídeo!","(sonidos del celular) (Inudible distorsión)","¡Suscríbete!","Subtítulos realizados por la comunidad de Amara.org","Subtitulado por la comunidad de Amara.org","Subtítulos por la comunidad de Amara.org","Subtítulos creados por la comunidad de Amara.org","Subtítulos en español de Amara.org","Subtítulos hechos por la comunidad de Amara.org","Subtitulos por la comunidad de Amara.org","Más información www.alimmenta.com","www.mooji.org","[MÚSICA]","[Music cuts in British]"]},on=e=>{let t=e;return Object.values(Fa).forEach(n=>{n.forEach(r=>{t=t.replaceAll(r,"")})}),t=t.replace(/\(.*?\)/g,""),t=t.replace(/\[.*?\]/g,""),t},sn=6e4,cn=8e3,ln=2,un=.4,Ha=3,Wa=new Set(["aan","als","ben","bent","bij","dan","dat","deze","die","dit","doen","door","dus","echt","een","eens","even","gaan","gaat","geen","geweest","goed","graag","had","heb","hebben","hebt","heeft","het","hier","hoe","hoor","iets","inderdaad","kan","klopt","kunnen","kunt","maar","mag","mee","meer","met","mij","mijn","misschien","moet","moeten","naar","net","niet","nog","nou","oke","ook","over","prima","toch","uhm","uit","van","veel","voor","wat","weer","weet","wel","wij","wil","wilt","worden","wordt","zeg","zeggen","zijn","zou","zult","about","and","are","been","but","can","does","for","have","just","know","like","not","okay","right","she","that","the","them","then","there","they","this","want","was","well","were","what","will","with","would","yeah","you","your"]);function dn(e){const t=new Set;for(const n of e.toLowerCase().split(/[^a-z0-9À-ɏ]+/))n.length<Ha||Wa.has(n)||t.add(n);return[...t]}function pn(e,t){if(!e.length)return 0;if(!t.length)return 1;const n=new Set(t),r=new Set(e);let i=0;for(const a of r)n.has(a)||(i+=1);return i/r.size}function fn(e,t=sn){const n=e.filter(o=>!o.partial&&typeof o.text=="string");if(!n.length)return{text:"",segmentCount:0};const i=n.reduce((o,s)=>Math.max(o,s.endedAt??0),0)-t;return{text:n.filter(o=>(o.endedAt??0)>=i).map(o=>on(o.text).trim()).filter(Boolean).join(" ").replace(/\s+/g," ").trim(),segmentCount:n.length}}const mn=60;function Va(e,t,n=mn){const r=new Set(e),i=[...e];for(const a of t)!a||r.has(a)||(r.add(a),i.push(a));return i.slice(-n)}function ja(e){const{segments:t,now:n,state:r}=e;if(r.lastTriggerAt&&n-r.lastTriggerAt<cn)return{trigger:!1,reason:"too_soon"};const i=fn(t,e.windowMs);if(!i.text)return{trigger:!1,reason:"no_speech"};const a=i.segmentCount-(r.lastSegmentCount??0);if(r.lastQueryTerms&&a<ln)return{trigger:!1,reason:"too_few_new"};const o=dn(i.text);return o.length?r.lastQueryTerms?.length&&pn(o,r.lastQueryTerms)<un?{trigger:!1,reason:"same_topic"}:{trigger:!0,text:i.text,terms:o,segmentCount:i.segmentCount}:{trigger:!1,reason:"no_speech"}}const Ya=["personal","workspace","connections","work","ai"],Xa="navNotice",D={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}},gn="NL",za=15,qa=8,Ja=Array.from(new Set(Object.values(D).map(e=>e.callingCode))).sort((e,t)=>t.length-e.length);function ye(e){if(e)return D[e.trim().toUpperCase()]}function C(e,t){return e.length>=t.nsnMin&&e.length<=t.nsnMax}function _e(e){if(e.length>za)return null;for(const t of Ja){if(!e.startsWith(t))continue;const n=e.slice(t.length);for(const r of Object.values(D)){if(r.callingCode!==t)continue;const i=r.trunkPrefix,a=i&&n.startsWith(i)?n.slice(i.length):n;if(C(a,r))return`+${t}${a}`}return null}return e.length<qa?null:`+${e}`}function Za(e){let t=e.trim();const n=t.match(/^(sips?|tel|whatsapp):/i);n&&(t=t.slice(n[0].length));const r=t.indexOf("@");return r>=0&&(t=t.slice(0,r)),t.trim()}function Qa(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 X(e,t){if(!e)return null;const n=Za(e);if(!n)return null;const r=n.startsWith("+"),i=n.replace(/\D/g,"");if(!i)return null;if(r)return _e(i);if(i.startsWith("00"))return _e(i.slice(2));const a=ye(t)??ye(gn);if(!a)return null;const o=a.trunkPrefix;if(o&&i.startsWith(o)){const s=i.slice(o.length);return C(s,a)?`+${a.callingCode}${s}`:null}if(i.startsWith(a.callingCode)){const s=i.slice(a.callingCode.length);if(C(s,a))return`+${a.callingCode}${s}`}return!o&&C(i,a)?`+${a.callingCode}${i}`:null}function eo(e,t=9){const n=(e??"").replace(/\D/g,"");return n.length<t?null:n.slice(-t)}function ce(e){if(!e)return null;const t=e.trim().toLowerCase(),n=t.lastIndexOf("@");if(n<=0||n===t.length-1)return null;const r=t.slice(0,n).split("+")[0],i=t.slice(n+1);return!r||!i.includes(".")?null:`${r}@${i}`}function to(e){const t=ce(e);return t?t.slice(t.lastIndexOf("@")+1):null}const no=new Set(["co.uk","org.uk","gov.uk","ac.uk","com.au","co.nz","com.br","co.za"]);function hn(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 no.has(n)&&t.length>=3?t.slice(-3).join("."):n}const An=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 ro(e){const t=hn(e);return t?An.has(t):!1}function io(e){if(!e)return!1;const t=e.trim().toLowerCase();return t==="tel"||t==="sms"||t==="whatsapp"||t==="fax"}function ao(e,t,n){if(!e||!t)return null;const r=e.trim().toLowerCase();if(r==="tel"||r==="sms"||r==="whatsapp"){const a=X(t,n);return a?`tel:${a}`:null}if(r==="fax"){const a=X(t,n);return a?`fax:${a}`:null}if(r==="mailto"||r==="email"){const a=ce(t);return a?`mailto:${a}`:null}const i=t.trim().toLowerCase();return i?`${r}:${i}`:null}const oo=/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g,so=/(\*|_)(?=\S)([^*_\n]*?\S)\1/g;function co(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(ao,"$2"),t=t.replace(oo,"$2"),t=t.replace(/~~(?=\S)([\s\S]*?\S)~~/g,"$1"),t=t.replace(/`([^`\n]+)`/g,"$1"),t.replace(/\s+/g," ").trim()}const co=[/<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,lo=/^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;function uo(e){const t=e.split(`
10
- `);for(let n=0;n<t.length;n++)if(lo.test(t[n])||Te.test(t[n])&&t.slice(n+1,n+4).some(r=>Te.test(r)))return t.slice(0,n).join(`
9
+ `),t=t.replace(oo,"$2"),t=t.replace(so,"$2"),t=t.replace(/~~(?=\S)([\s\S]*?\S)~~/g,"$1"),t=t.replace(/`([^`\n]+)`/g,"$1"),t.replace(/\s+/g," ").trim()}const lo=[/<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,uo=/^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;function po(e){const t=e.split(`
10
+ `);for(let n=0;n<t.length;n++)if(uo.test(t[n])||Te.test(t[n])&&t.slice(n+1,n+4).some(r=>Te.test(r)))return t.slice(0,n).join(`
11
11
  `).trim();return e}function Ie(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 be(e){return!Number.isInteger(e)||e<0||e>1114111?null:String.fromCodePoint(e)}function Me(e){return e.replace(/&nbsp;/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#(\d+);/g,(t,n)=>be(Number(n))??t).replace(/&#x([0-9a-f]+);/gi,(t,n)=>be(parseInt(n,16))??t).replace(/&amp;/gi,"&")}function Oe(e){return e.replace(/\r/g,"").replace(/[ \t]+/g," ").replace(/ *\n */g,`
16
16
  `).replace(/\n{3,}/g,`
17
17
 
18
- `).trim()}const En=/<\s*(html|body|div|p|table|br|span)\b/i;function po(e){return En.test(e)}function fo(e){if(typeof e!="string"||!e)return"";let t=e.length;for(const a of co){const o=e.search(a);o>=0&&o<t&&(t=o)}const n=e.slice(0,t);let r=Oe(Me(Ie(n)));return r||(r=Oe(Me(Ie(e)))),uo(r)||r}exports.ACTIVITY_CATALOG=m;exports.AI_ATTACHMENT_LIMITS=jt;exports.AI_ATTACHMENT_MAX_PER_TURN=Yi;exports.AI_ATTACHMENT_TURN_BUDGET=ji;exports.AI_VENDORS=q;exports.ALLOWED_LINK_SCHEMES=Be;exports.APP_PERMISSIONS=ba;exports.ARTIFACT_MAX_BLOCKS=B;exports.ARTIFACT_MAX_BODY_BYTES=Zn;exports.ARTIFACT_MAX_CELL_LEN=O;exports.ARTIFACT_MAX_KPI_ITEMS=W;exports.ARTIFACT_MAX_LIST_ITEMS=G;exports.ARTIFACT_MAX_TABLE_COLUMNS=H;exports.ARTIFACT_MAX_TABLE_ROWS=F;exports.ARTIFACT_MAX_TEXT_LEN=J;exports.ASSIGNMENT_SCOPE_KIND=We;exports.ASSIST_BANDS=Zi;exports.ASSIST_SOURCE_PROVIDER_GROUP=Ji;exports.ATTENTION_STATUSES=Qe;exports.AUTH_APP_NAME=oe;exports.AUTO_READY_MIN_PROPOSALS=Rt;exports.AUTO_READY_RATE=Ct;exports.ActivityTypeRegistry=ke;exports.BUILT_IN_ONLY=Pn;exports.BULK_PENALTY=et;exports.CADENCE_FLOOR_MS=cn;exports.CADENCE_MIN_NEW_SEGMENTS=ln;exports.CADENCE_MIN_NOVELTY=un;exports.CADENCE_WINDOW_MS=sn;exports.CLASSIFY_VARS=ci;exports.CONTEXT_COLLECT_SERVICE=ya;exports.CORE_DIMENSIONS=Yn;exports.CommunicationScheme=Jt;exports.DAY_MS=Xe;exports.DEFAULT_MEMORY_BUDGET=Xr;exports.DEFAULT_PHONE_REGION=gn;exports.EMPTY_WORKFLOW=ui;exports.FEATURE_FOLDER_MANAGEMENT=ha;exports.FEATURE_REMOTE_SEARCH=Aa;exports.FOLLOW_UP_HOURS=nt;exports.HOUR_MS=Ye;exports.HTML_BODY_RE=En;exports.INELIGIBLE=g;exports.INSTALLATION_HEADER=Sa;exports.INTERACTION_KIND=Tt;exports.InteractionParticipantRole=ma;exports.KB_FALLBACK_LOCALE=ft;exports.KB_LOCALES=V;exports.LOOSE_STATUSES=v;exports.MAX_ACTIONS=M;exports.MAX_ASSIGNMENT_TURNS=Ve;exports.MAX_BLOCKS=$;exports.MAX_COLLECTION_DEPTH=ee;exports.MAX_FIELDS=I;exports.MAX_LIST_ITEMS=b;exports.MAX_MEMORY_BROWSE=Wr;exports.MAX_MEMORY_BUDGET=Yr;exports.MAX_MEMORY_CHARS=Vr;exports.MAX_SHOWN_KEYS=mn;exports.MAX_TOPIC_CANDIDATES=Lt;exports.MAX_TOPIC_EXAMPLES=Dt;exports.MAX_TOPIC_EXAMPLE_CHARS=R;exports.MIN_MEMORY_BUDGET=jr;exports.NAV_NOTICE_SLOT=Ya;exports.NOTIFICATION_SOURCE_PROVIDER_GROUP=Ta;exports.ONBOARDING_SOURCE_PROVIDER_GROUP=qr;exports.PHONE_REGIONS=D;exports.PRESENCE_ONLINE_WINDOW_MS=ae;exports.PRESENCE_SURVIVES_OFFLINE=Zt;exports.PROFILE_TOOL_DISPOSITIONS=Zr;exports.PROVIDER_FEATURE_MESSAGE_TEMPLATES=fa;exports.PROVIDER_FEATURE_MESSAGE_WINDOW=pa;exports.PUBLIC_EMAIL_DOMAINS=An;exports.READ_STEP_TYPES=j;exports.RELATED_SUBJECT_KINDS=gt;exports.RESERVED_STATUS_KEYS=ie;exports.RESOURCE_ATTACHED_SERVICE=va;exports.RESOURCE_DESCRIBE_SERVICE=wa;exports.RESOURCE_RESOLVE_SERVICE=ka;exports.RESOURCE_SEARCH_SERVICE=Na;exports.SIGNATURE_INTENTS=Er;exports.SLA_HOURS_BY_PRIORITY=tt;exports.STEP_MAX_TOKENS_MAX=Mt;exports.STEP_MAX_TOKENS_MIN=bt;exports.SUMMARY_MIN_LAST_CHARS=Je;exports.SUMMARY_MIN_MESSAGES=qe;exports.SYNC_RUN_MAX_ERRORS=Ga;exports.SYNC_SOURCE_PROVIDER_GROUP=Ka;exports.SYNC_TARGET_PROVIDER_GROUP=Ba;exports.TERMINAL_ASSIGNMENT_STATUSES=He;exports.TERMINAL_RUN_STATUSES=wt;exports.TRIGGER_VARS=si;exports.UNSUPPORTED=Ea;exports.USAGE_DIMENSIONS=xe;exports.USAGE_DIMENSION_IDS=Ue;exports.WORK_AREAS=Jr;exports.WORK_COMMENT_ADDED=wi;exports.WORK_ITEM_ASSIGNED=Ni;exports.WORK_ITEM_SCOPE_KIND=$t;exports.WORK_ITEM_STATUS_CHANGED=ki;exports.WORK_PROJECT_SCOPE_KIND=Kt;exports.W_PRIORITY=E;exports.acceptExampleCandidate=Oi;exports.actingIdentityKey=At;exports.activeWorkTypes=bi;exports.activityIconOf=Tn;exports.activityJoinUrl=kn;exports.activitySnippet=we;exports.activityTextParams=Ne;exports.activityTimelineText=Nn;exports.activityTimestamp=ve;exports.activityTypeInfo=c;exports.actorKey=ti;exports.addExampleCandidate=Mi;exports.agePresenceEntry=Oa;exports.aiAttachmentKind=Vt;exports.aiAttachmentRejection=Xi;exports.aiBudgetLimit=K;exports.aiBudgetPeriodKey=Vn;exports.aiBudgetPeriodStart=De;exports.aiBudgetState=Wn;exports.aiVendorAcceptsAttachment=Hn;exports.aiVendorDefaultModel=Bn;exports.aiVendorLabel=Kn;exports.aiVendorNeedsBaseUrl=Fn;exports.aiVendorsWith=Gn;exports.appNameFromPath=se;exports.applyRounding=yi;exports.applySignature=yr;exports.approvalRate=Ot;exports.artifactBodyBytes=or;exports.artifactOutline=sr;exports.artifactToMarkdown=lr;exports.assignmentMismatch=ai;exports.assignmentScopeKey=mr;exports.assignmentSubject=hr;exports.buildActivityPreview=Dn;exports.buildChannelIntents=oa;exports.buildShareKeys=ur;exports.buildWindow=fn;exports.canNestUnder=Ur;exports.carriesText=On;exports.categoryLabel=Kr;exports.categoryOf=Ft;exports.channelKindForScheme=da;exports.channelKindOf=In;exports.clampStepMaxTokens=li;exports.cleanMessageText=fo;exports.compareAssistRank=ea;exports.compareWorkTypes=vt;exports.decideAssignmentState=Ar;exports.decideCadence=ja;exports.decideIncomingCall=ra;exports.defaultLocaleOf=mt;exports.defaultStatusKey=Bi;exports.defineIntent=ga;exports.depthOf=dt;exports.derivePresence=Ma;exports.disabledIntentsFromCapabilities=ia;exports.elapsedSeconds=Ei;exports.emailDomain=eo;exports.endpointKey=io;exports.extractParams=tn;exports.extractTerms=dn;exports.filterByEndpoint=ca;exports.filterByIntent=sa;exports.filterByTargetScheme=qt;exports.findAiVendor=y;exports.flattenLocales=_a;exports.floorToPeriod=Pe;exports.formatActingIdentity=ht;exports.formatClock=_i;exports.formatHm=Si;exports.formatItemKey=Li;exports.formatPeriod=Le;exports.freshSources=qi;exports.getActivitySeenUserIds=xn;exports.getContactEndpoints=Sr;exports.getShortTitle=vr;exports.getUrgencyScore=kr;exports.heightOf=te;exports.helpCenterText=Lr;exports.humanizeAction=oi;exports.interactionIdOf=It;exports.isAgentUser=Ci;exports.isAssigned=wr;exports.isAssignmentTerminal=fr;exports.isAssignmentTrigger=St;exports.isAutoReady=fi;exports.isAwaitingThem=lt;exports.isChatMessageActivity=$n;exports.isClosed=Nr;exports.isConnectedType=Cn;exports.isDeepLink=La;exports.isDescendant=pt;exports.isEligible=_r;exports.isEmailActivity=Un;exports.isHtmlBody=po;exports.isInFlight=gi;exports.isInteractionUnseen=Ze;exports.isLandingPath=Pa;exports.isLikelyBulk=ze;exports.isMessageShape=z;exports.isMessageType=bn;exports.isMoreSpecificPattern=rn;exports.isOutwardTool=zi;exports.isParked=it;exports.isPaused=Nt;exports.isPlaybookAuthoredType=Rn;exports.isPublicEmailDomain=no;exports.isPublicPath=$a;exports.isReminderActive=at;exports.isReplyableType=Mn;exports.isSlaAtRisk=Rr;exports.isTerminal=mi;exports.isThreadLongEnough=Mr;exports.isTranscriptType=wn;exports.isWorkClosed=Gi;exports.isWorkTypeVisible=Ii;exports.itemDossierKeys=Ui;exports.ladderFor=Gt;exports.linkLabel=Dr;exports.listeningAllowed=jn;exports.localeInstruction=xr;exports.localeName=Pr;exports.localesOf=$r;exports.looksLikeEmail=Za;exports.matchContactToIntents=la;exports.matchPublicRoute=an;exports.mcpCredentialScope=Fr;exports.mcpToolPrefix=Hr;exports.mergeShownKeys=Va;exports.messageCountsAs=Ce;exports.needsPhoneRegion=ro;exports.normalizeArtifactBlocks=ar;exports.normalizeBlocks=_n;exports.normalizeEmail=ce;exports.normalizeExample=h;exports.notificationPrefKey=Ia;exports.novelty=pn;exports.parkMarksById=Tr;exports.parseActingIdentity=Qr;exports.parseItemKey=Pi;exports.pathToRegex=en;exports.periodsInRange=qn;exports.phoneSuffix=Qa;exports.plainTextFromMarkdown=so;exports.playbookActor=yt;exports.procedureOf=pi;exports.projectDossierKeys=$i;exports.publicBasePathFor=nn;exports.publicRoutePatterns=Ua;exports.readPath=w;exports.readStepError=Y;exports.recencyOf=rt;exports.refKey=_t;exports.registrableDomain=hn;exports.rejectExampleCandidate=xt;exports.relatedByDefault=zr;exports.resolveAccountCapabilities=zt;exports.resolveActivityText=N;exports.resolveChannelIntents=Xt;exports.resolveSignature=je;exports.resolveWorkMode=Ra;exports.resourceKindOf=Da;exports.runActor=ei;exports.runInteractionId=Ai;exports.sanitizeInline=Fe;exports.sanitizeTranscript=on;exports.scoreInteraction=Cr;exports.scoreWorkItem=Di;exports.selectLenses=Gr;exports.sessionsHoldCannotReach=na;exports.sessionsToHold=ta;exports.shareKeyForTeam=Q;exports.shareKeyForUser=Z;exports.shareKeysForViewer=dr;exports.shouldRunAudioPipeline=Ca;exports.slaHoursByInbox=Or;exports.slaHoursFor=ct;exports.sortStatuses=Ht;exports.sourceKey=Yt;exports.statusIn=Ki;exports.stepsOf=di;exports.stripHtml=Re;exports.subjectKeyOf=hi;exports.subjectOf=ne;exports.subjectRef=Qi;exports.suggestProjectKey=xi;exports.targetById=ii;exports.targetForActivityType=ri;exports.toActingIdentity=Et;exports.toE164=X;exports.toolSourceKinds=pr;exports.topicOfferedForTeam=Ut;exports.topicsForTeam=Ri;exports.truncateExample=Pt;exports.uniqueWorkStatusKey=Fi;exports.uniqueWorkTypeKey=Ti;exports.usageMetricId=$e;exports.usageMetrics=Jn;exports.validateStatuses=Hi;exports.valueAtPath=ni;exports.waitHoursOf=k;exports.wakesAssignment=gr;exports.workItemScopeKey=Bt;exports.workProjectScopeKey=re;exports.workStatusKey=Wt;exports.workTypeKey=kt;
18
+ `).trim()}const En=/<\s*(html|body|div|p|table|br|span)\b/i;function fo(e){return En.test(e)}function mo(e){if(typeof e!="string"||!e)return"";let t=e.length;for(const a of lo){const o=e.search(a);o>=0&&o<t&&(t=o)}const n=e.slice(0,t);let r=Oe(Me(Ie(n)));return r||(r=Oe(Me(Ie(e)))),po(r)||r}exports.ACTIVITY_CATALOG=m;exports.AI_ATTACHMENT_LIMITS=jt;exports.AI_ATTACHMENT_MAX_PER_TURN=Yi;exports.AI_ATTACHMENT_TURN_BUDGET=ji;exports.AI_VENDORS=q;exports.ALLOWED_LINK_SCHEMES=Be;exports.APP_PERMISSIONS=ba;exports.ARTIFACT_MAX_BLOCKS=B;exports.ARTIFACT_MAX_BODY_BYTES=Zn;exports.ARTIFACT_MAX_CELL_LEN=O;exports.ARTIFACT_MAX_KPI_ITEMS=W;exports.ARTIFACT_MAX_LIST_ITEMS=G;exports.ARTIFACT_MAX_TABLE_COLUMNS=H;exports.ARTIFACT_MAX_TABLE_ROWS=F;exports.ARTIFACT_MAX_TEXT_LEN=J;exports.ASSIGNMENT_SCOPE_KIND=We;exports.ASSIST_BANDS=Zi;exports.ASSIST_SOURCE_PROVIDER_GROUP=Ji;exports.ATTENTION_STATUSES=Qe;exports.AUTH_APP_NAME=oe;exports.AUTO_READY_MIN_PROPOSALS=Rt;exports.AUTO_READY_RATE=Ct;exports.ActivityTypeRegistry=ke;exports.BUILT_IN_ONLY=Pn;exports.BULK_PENALTY=et;exports.CADENCE_FLOOR_MS=cn;exports.CADENCE_MIN_NEW_SEGMENTS=ln;exports.CADENCE_MIN_NOVELTY=un;exports.CADENCE_WINDOW_MS=sn;exports.CLASSIFY_VARS=ci;exports.CONTEXT_COLLECT_SERVICE=Sa;exports.CORE_DIMENSIONS=Yn;exports.CommunicationScheme=Jt;exports.DAY_MS=Xe;exports.DEFAULT_MEMORY_BUDGET=Xr;exports.DEFAULT_PHONE_REGION=gn;exports.EMPTY_WORKFLOW=ui;exports.FEATURE_FOLDER_MANAGEMENT=ha;exports.FEATURE_REMOTE_SEARCH=Aa;exports.FOLLOW_UP_HOURS=nt;exports.HOUR_MS=Ye;exports.HTML_BODY_RE=En;exports.INELIGIBLE=g;exports.INSTALLATION_HEADER=ya;exports.INTERACTION_KIND=Tt;exports.InteractionParticipantRole=ma;exports.KB_FALLBACK_LOCALE=ft;exports.KB_LOCALES=V;exports.LOOSE_STATUSES=v;exports.MAX_ACTIONS=M;exports.MAX_ASSIGNMENT_TURNS=Ve;exports.MAX_BLOCKS=$;exports.MAX_COLLECTION_DEPTH=ee;exports.MAX_FIELDS=I;exports.MAX_LIST_ITEMS=b;exports.MAX_MEMORY_BROWSE=Wr;exports.MAX_MEMORY_BUDGET=Yr;exports.MAX_MEMORY_CHARS=Vr;exports.MAX_SHOWN_KEYS=mn;exports.MAX_TOPIC_CANDIDATES=Lt;exports.MAX_TOPIC_EXAMPLES=Dt;exports.MAX_TOPIC_EXAMPLE_CHARS=R;exports.MIN_MEMORY_BUDGET=jr;exports.NAV_NOTICE_SLOT=Xa;exports.NOTIFICATION_SOURCE_PROVIDER_GROUP=Ta;exports.ONBOARDING_SOURCE_PROVIDER_GROUP=qr;exports.PHONE_REGIONS=D;exports.PRESENCE_ONLINE_WINDOW_MS=ae;exports.PRESENCE_SURVIVES_OFFLINE=Zt;exports.PROFILE_TOOL_DISPOSITIONS=Zr;exports.PROVIDER_FEATURE_MESSAGE_TEMPLATES=fa;exports.PROVIDER_FEATURE_MESSAGE_WINDOW=pa;exports.PUBLIC_EMAIL_DOMAINS=An;exports.READ_STEP_TYPES=j;exports.RELATED_SUBJECT_KINDS=gt;exports.RESERVED_STATUS_KEYS=ie;exports.RESOURCE_ATTACHED_SERVICE=va;exports.RESOURCE_DESCRIBE_SERVICE=wa;exports.RESOURCE_RESOLVE_SERVICE=ka;exports.RESOURCE_SEARCH_SERVICE=Na;exports.SETTINGS_CATEGORIES=Ya;exports.SIGNATURE_INTENTS=Er;exports.SLA_HOURS_BY_PRIORITY=tt;exports.STEP_MAX_TOKENS_MAX=Mt;exports.STEP_MAX_TOKENS_MIN=bt;exports.SUMMARY_MIN_LAST_CHARS=Je;exports.SUMMARY_MIN_MESSAGES=qe;exports.SYNC_RUN_MAX_ERRORS=Ga;exports.SYNC_SOURCE_PROVIDER_GROUP=Ka;exports.SYNC_TARGET_PROVIDER_GROUP=Ba;exports.TERMINAL_ASSIGNMENT_STATUSES=He;exports.TERMINAL_RUN_STATUSES=wt;exports.TRIGGER_VARS=si;exports.UNSUPPORTED=Ea;exports.USAGE_DIMENSIONS=xe;exports.USAGE_DIMENSION_IDS=Ue;exports.WORK_AREAS=Jr;exports.WORK_COMMENT_ADDED=wi;exports.WORK_ITEM_ASSIGNED=Ni;exports.WORK_ITEM_SCOPE_KIND=$t;exports.WORK_ITEM_STATUS_CHANGED=ki;exports.WORK_PROJECT_SCOPE_KIND=Kt;exports.W_PRIORITY=E;exports.acceptExampleCandidate=Oi;exports.actingIdentityKey=At;exports.activeWorkTypes=bi;exports.activityIconOf=Tn;exports.activityJoinUrl=kn;exports.activitySnippet=we;exports.activityTextParams=Ne;exports.activityTimelineText=Nn;exports.activityTimestamp=ve;exports.activityTypeInfo=c;exports.actorKey=ti;exports.addExampleCandidate=Mi;exports.agePresenceEntry=Oa;exports.aiAttachmentKind=Vt;exports.aiAttachmentRejection=Xi;exports.aiBudgetLimit=K;exports.aiBudgetPeriodKey=Vn;exports.aiBudgetPeriodStart=De;exports.aiBudgetState=Wn;exports.aiVendorAcceptsAttachment=Hn;exports.aiVendorDefaultModel=Bn;exports.aiVendorLabel=Kn;exports.aiVendorNeedsBaseUrl=Fn;exports.aiVendorsWith=Gn;exports.appNameFromPath=se;exports.applyRounding=Si;exports.applySignature=Sr;exports.approvalRate=Ot;exports.artifactBodyBytes=or;exports.artifactOutline=sr;exports.artifactToMarkdown=lr;exports.assignmentMismatch=ai;exports.assignmentScopeKey=mr;exports.assignmentSubject=hr;exports.buildActivityPreview=Dn;exports.buildChannelIntents=oa;exports.buildShareKeys=ur;exports.buildWindow=fn;exports.canNestUnder=Ur;exports.carriesText=On;exports.categoryLabel=Kr;exports.categoryOf=Ft;exports.channelKindForScheme=da;exports.channelKindOf=In;exports.clampStepMaxTokens=li;exports.cleanMessageText=mo;exports.compareAssistRank=ea;exports.compareWorkTypes=vt;exports.decideAssignmentState=Ar;exports.decideCadence=ja;exports.decideIncomingCall=ra;exports.defaultLocaleOf=mt;exports.defaultStatusKey=Bi;exports.defineIntent=ga;exports.depthOf=dt;exports.derivePresence=Ma;exports.disabledIntentsFromCapabilities=ia;exports.elapsedSeconds=Ei;exports.emailDomain=to;exports.endpointKey=ao;exports.extractParams=tn;exports.extractTerms=dn;exports.filterByEndpoint=ca;exports.filterByIntent=sa;exports.filterByTargetScheme=qt;exports.findAiVendor=S;exports.flattenLocales=_a;exports.floorToPeriod=Pe;exports.formatActingIdentity=ht;exports.formatClock=_i;exports.formatHm=yi;exports.formatItemKey=Li;exports.formatPeriod=Le;exports.freshSources=qi;exports.getActivitySeenUserIds=xn;exports.getContactEndpoints=yr;exports.getShortTitle=vr;exports.getUrgencyScore=kr;exports.heightOf=te;exports.helpCenterText=Lr;exports.humanizeAction=oi;exports.interactionIdOf=It;exports.isAgentUser=Ci;exports.isAssigned=wr;exports.isAssignmentTerminal=fr;exports.isAssignmentTrigger=yt;exports.isAutoReady=fi;exports.isAwaitingThem=lt;exports.isChatMessageActivity=$n;exports.isClosed=Nr;exports.isConnectedType=Cn;exports.isDeepLink=La;exports.isDescendant=pt;exports.isEligible=_r;exports.isEmailActivity=Un;exports.isHtmlBody=fo;exports.isInFlight=gi;exports.isInteractionUnseen=Ze;exports.isLandingPath=Pa;exports.isLikelyBulk=ze;exports.isMessageShape=z;exports.isMessageType=bn;exports.isMoreSpecificPattern=rn;exports.isOutwardTool=zi;exports.isParked=it;exports.isPaused=Nt;exports.isPlaybookAuthoredType=Rn;exports.isPublicEmailDomain=ro;exports.isPublicPath=$a;exports.isReminderActive=at;exports.isReplyableType=Mn;exports.isSlaAtRisk=Rr;exports.isTerminal=mi;exports.isThreadLongEnough=Mr;exports.isTranscriptType=wn;exports.isWorkClosed=Gi;exports.isWorkTypeVisible=Ii;exports.itemDossierKeys=Ui;exports.ladderFor=Gt;exports.linkLabel=Dr;exports.listeningAllowed=jn;exports.localeInstruction=xr;exports.localeName=Pr;exports.localesOf=$r;exports.looksLikeEmail=Qa;exports.matchContactToIntents=la;exports.matchPublicRoute=an;exports.mcpCredentialScope=Fr;exports.mcpToolPrefix=Hr;exports.mergeShownKeys=Va;exports.messageCountsAs=Ce;exports.needsPhoneRegion=io;exports.normalizeArtifactBlocks=ar;exports.normalizeBlocks=_n;exports.normalizeEmail=ce;exports.normalizeExample=h;exports.notificationPrefKey=Ia;exports.novelty=pn;exports.parkMarksById=Tr;exports.parseActingIdentity=Qr;exports.parseItemKey=Pi;exports.pathToRegex=en;exports.periodsInRange=qn;exports.phoneSuffix=eo;exports.plainTextFromMarkdown=co;exports.playbookActor=St;exports.procedureOf=pi;exports.projectDossierKeys=$i;exports.publicBasePathFor=nn;exports.publicRoutePatterns=Ua;exports.readPath=w;exports.readStepError=Y;exports.recencyOf=rt;exports.refKey=_t;exports.registrableDomain=hn;exports.rejectExampleCandidate=xt;exports.relatedByDefault=zr;exports.resolveAccountCapabilities=zt;exports.resolveActivityText=N;exports.resolveChannelIntents=Xt;exports.resolveSignature=je;exports.resolveWorkMode=Ra;exports.resourceKindOf=Da;exports.runActor=ei;exports.runInteractionId=Ai;exports.sanitizeInline=Fe;exports.sanitizeTranscript=on;exports.scoreInteraction=Cr;exports.scoreWorkItem=Di;exports.selectLenses=Gr;exports.sessionsHoldCannotReach=na;exports.sessionsToHold=ta;exports.shareKeyForTeam=Q;exports.shareKeyForUser=Z;exports.shareKeysForViewer=dr;exports.shouldRunAudioPipeline=Ca;exports.slaHoursByInbox=Or;exports.slaHoursFor=ct;exports.sortStatuses=Ht;exports.sourceKey=Yt;exports.statusIn=Ki;exports.stepsOf=di;exports.stripHtml=Re;exports.subjectKeyOf=hi;exports.subjectOf=ne;exports.subjectRef=Qi;exports.suggestProjectKey=xi;exports.targetById=ii;exports.targetForActivityType=ri;exports.toActingIdentity=Et;exports.toE164=X;exports.toolSourceKinds=pr;exports.topicOfferedForTeam=Ut;exports.topicsForTeam=Ri;exports.truncateExample=Pt;exports.uniqueWorkStatusKey=Fi;exports.uniqueWorkTypeKey=Ti;exports.usageMetricId=$e;exports.usageMetrics=Jn;exports.validateStatuses=Hi;exports.valueAtPath=ni;exports.waitHoursOf=k;exports.wakesAssignment=gr;exports.workItemScopeKey=Bt;exports.workProjectScopeKey=re;exports.workStatusKey=Wt;exports.workTypeKey=kt;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const qn = 10, Jn = 10, Zn = 10, Qn = 5, ve = /* @__PURE__ */ new Set([
1
+ const qn = 10, Jn = 10, Zn = 10, Qn = 5, Ne = /* @__PURE__ */ new Set([
2
2
  "header",
3
3
  "section",
4
4
  "context",
@@ -25,7 +25,7 @@ function er(e, t = () => {
25
25
  }
26
26
  if (!r || typeof r != "object") continue;
27
27
  const i = r;
28
- if (!ve.has(i.type)) {
28
+ if (!Ne.has(i.type)) {
29
29
  t(`unknown block type ${String(i.type)}`);
30
30
  continue;
31
31
  }
@@ -69,7 +69,7 @@ function er(e, t = () => {
69
69
  }
70
70
  return n;
71
71
  }
72
- function Ne(e) {
72
+ function ve(e) {
73
73
  return e.replace(/<style[\s\S]*?<\/style>/gi, " ").replace(/<script[\s\S]*?<\/script>/gi, " ").replace(/<[^>]+>/g, " ").replace(/&nbsp;/g, " ").replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/\s+/g, " ").trim();
74
74
  }
75
75
  function b(e) {
@@ -439,7 +439,7 @@ const m = {
439
439
  }
440
440
  };
441
441
  function P(e) {
442
- const t = e.payload, n = t.bodyText?.trim() || t.bodySnippet?.trim() || Ne(t.body ?? "");
442
+ const t = e.payload, n = t.bodyText?.trim() || t.bodySnippet?.trim() || ve(t.body ?? "");
443
443
  return t.subject ? `${t.subject} — ${n}` : n;
444
444
  }
445
445
  function d(e) {
@@ -488,7 +488,7 @@ function ur(e) {
488
488
  const t = d(e.type)?.joinUrl;
489
489
  return t ? t(e) : void 0;
490
490
  }
491
- function v(e, t) {
491
+ function N(e, t) {
492
492
  let n = e;
493
493
  for (const r of t.split(".")) {
494
494
  if (n == null || typeof n != "object") return "";
@@ -496,14 +496,14 @@ function v(e, t) {
496
496
  }
497
497
  return n == null ? "" : typeof n == "string" ? n : typeof n == "number" || typeof n == "boolean" ? String(n) : "";
498
498
  }
499
- function N(e, t, n) {
499
+ function v(e, t, n) {
500
500
  if (e === void 0) return null;
501
501
  if (typeof e == "string") return e || null;
502
502
  if ("value" in e)
503
- return v(t, e.value) || null;
503
+ return N(t, e.value) || null;
504
504
  const r = {};
505
505
  for (const [o, a] of Object.entries(e.params ?? {}))
506
- r[o] = v(t, a);
506
+ r[o] = N(t, a);
507
507
  const i = n(e.key, r);
508
508
  return i === e.key ? null : i;
509
509
  }
@@ -511,7 +511,7 @@ function xe(e, t) {
511
511
  if (!e || typeof e == "string" || "value" in e) return null;
512
512
  const n = {};
513
513
  for (const [r, i] of Object.entries(e.params ?? {}))
514
- n[r] = v(t, i);
514
+ n[r] = N(t, i);
515
515
  return { key: e.key, params: n };
516
516
  }
517
517
  const U = 140;
@@ -520,7 +520,7 @@ function De(e) {
520
520
  return t.length <= U ? t : `${t.slice(0, U - 1).trimEnd()}…`;
521
521
  }
522
522
  function dr(e, t) {
523
- const n = xe(t?.text, e), r = t ? N(t.text, e, (i) => i) : null;
523
+ const n = xe(t?.text, e), r = t ? v(t.text, e, (i) => i) : null;
524
524
  return {
525
525
  activityId: e.id,
526
526
  type: e.type,
@@ -548,7 +548,7 @@ function K(e) {
548
548
  displayNameKey: t.displayNameKey
549
549
  };
550
550
  }
551
- function j(e) {
551
+ function G(e) {
552
552
  return {
553
553
  type: e.type,
554
554
  shape: e.shape,
@@ -573,11 +573,11 @@ class Pe {
573
573
  get(t) {
574
574
  if (t in m) return K(t);
575
575
  const n = this.declared.get(t);
576
- return n ? j(n) : void 0;
576
+ return n ? G(n) : void 0;
577
577
  }
578
578
  /** Everything that may be offered as a trigger, built-in and declared. */
579
579
  triggerable() {
580
- const t = Object.keys(m).filter((r) => m[r].triggerable).map(K), n = [...this.declared.values()].map(j).filter((r) => r.triggerable);
580
+ const t = Object.keys(m).filter((r) => m[r].triggerable).map(K), n = [...this.declared.values()].map(G).filter((r) => r.triggerable);
581
581
  return [...t, ...n];
582
582
  }
583
583
  /**
@@ -589,14 +589,14 @@ class Pe {
589
589
  const r = m[t.type];
590
590
  if (r?.timeline) return r.timeline(t, n);
591
591
  const i = this.declared.get(t.type);
592
- return N(i?.text, t, this.translate) ?? t.type.replace(/_/g, " ").toLowerCase();
592
+ return v(i?.text, t, this.translate) ?? t.type.replace(/_/g, " ").toLowerCase();
593
593
  }
594
594
  /** The line for the inbox list. Empty when the type has nothing to show. */
595
595
  snippet(t) {
596
596
  const n = m[t.type];
597
597
  if (n?.snippet) return n.snippet(t);
598
598
  const r = this.declared.get(t.type);
599
- return N(r?.text, t, this.translate) ?? "";
599
+ return v(r?.text, t, this.translate) ?? "";
600
600
  }
601
601
  /** The descriptor as it arrived; needed to store `text` as a key. */
602
602
  descriptor(t) {
@@ -776,10 +776,10 @@ function Er(e, t) {
776
776
  }
777
777
  function Sr(e, t) {
778
778
  if (!e.enabled) return "ok";
779
- const n = G(e.hardLimitNanos), r = G(e.softLimitNanos);
779
+ const n = j(e.hardLimitNanos), r = j(e.softLimitNanos);
780
780
  return n !== void 0 && t >= n ? "hard" : r !== void 0 && t >= r ? "soft" : "ok";
781
781
  }
782
- function G(e) {
782
+ function j(e) {
783
783
  return typeof e == "number" ? e : void 0;
784
784
  }
785
785
  function Ke(e, t = "month") {
@@ -806,19 +806,19 @@ const Ir = [
806
806
  function k(e) {
807
807
  return e < 10 ? `0${e}` : `${e}`;
808
808
  }
809
- function je(e, t) {
809
+ function Ge(e, t) {
810
810
  const n = new Date(e), r = `${n.getUTCFullYear()}-${k(n.getUTCMonth() + 1)}-${k(n.getUTCDate())}`;
811
811
  return t === "day" ? r : `${r}T${k(n.getUTCHours())}`;
812
812
  }
813
- function Ge(e, t) {
813
+ function je(e, t) {
814
814
  const n = new Date(e);
815
815
  return n.setUTCMinutes(0, 0, 0), t === "day" && n.setUTCHours(0), n.getTime();
816
816
  }
817
817
  const Be = 36e5, He = 864e5;
818
818
  function wr(e, t, n) {
819
819
  const r = n === "hour" ? Be : He, i = [];
820
- for (let o = Ge(e, n); o <= t; o += r)
821
- i.push(je(o, n));
820
+ for (let o = je(e, n); o <= t; o += r)
821
+ i.push(Ge(o, n));
822
822
  return i;
823
823
  }
824
824
  const Fe = [
@@ -1067,7 +1067,7 @@ function Cr(e, t = () => {
1067
1067
  function Or(e) {
1068
1068
  return JSON.stringify(e).length;
1069
1069
  }
1070
- function vr(e) {
1070
+ function Nr(e) {
1071
1071
  return {
1072
1072
  blocks: e.length,
1073
1073
  types: e.map((t) => t.type),
@@ -1119,7 +1119,7 @@ function tt(e) {
1119
1119
  return (e.title ? `**${e.title}** ${e.text}` : e.text).split(/\r?\n/).map((n) => `> ${n}`);
1120
1120
  }
1121
1121
  }
1122
- function Nr(e, t) {
1122
+ function vr(e, t) {
1123
1123
  const n = [], r = e.some((i) => i.type === "heading" && i.level === 1);
1124
1124
  t && !r && n.push(`# ${t}`);
1125
1125
  for (const i of e) {
@@ -1180,12 +1180,12 @@ function Kr(e, t, n = it) {
1180
1180
  reason: "de agent rondde zijn beurt af zonder te zeggen wat er moet gebeuren (wachten, afronden of overdragen)"
1181
1181
  };
1182
1182
  }
1183
- const jr = /* @__PURE__ */ new Set(["mail", "message"]);
1183
+ const Gr = /* @__PURE__ */ new Set(["mail", "message"]);
1184
1184
  function ot(e, t) {
1185
1185
  const n = e.settings?.signatures?.[t];
1186
1186
  return !n?.enabled || !n.body || n.body.trim() === "" ? null : n;
1187
1187
  }
1188
- function Gr(e, t, n, r = "html") {
1188
+ function jr(e, t, n, r = "html") {
1189
1189
  if (!e) return n;
1190
1190
  const i = ot(e, t);
1191
1191
  return i ? `${n}${r === "text" ? `
@@ -1423,10 +1423,10 @@ function Ai(e) {
1423
1423
  if (r === "team") return { kind: "team", teamId: i };
1424
1424
  }
1425
1425
  }
1426
- function vt(e) {
1426
+ function Nt(e) {
1427
1427
  return Ot(e);
1428
1428
  }
1429
- function Nt(e) {
1429
+ function vt(e) {
1430
1430
  switch (e.kind) {
1431
1431
  case "personal":
1432
1432
  return { kind: "user", userId: e.userId };
@@ -1436,12 +1436,12 @@ function Nt(e) {
1436
1436
  return { kind: "org" };
1437
1437
  }
1438
1438
  }
1439
- const Rt = Nt;
1439
+ const Rt = vt;
1440
1440
  function bi(e) {
1441
1441
  return e.agentId ? { kind: "user", userId: e.agentId } : Rt(e.ownerScope);
1442
1442
  }
1443
1443
  function Ei(e) {
1444
- return vt(e);
1444
+ return Nt(e);
1445
1445
  }
1446
1446
  function Si(e, t) {
1447
1447
  if (!t) return;
@@ -1531,20 +1531,20 @@ function Ci(e) {
1531
1531
  return Math.min(Math.max(Math.round(t), Pt), Ut);
1532
1532
  }
1533
1533
  const Oi = { kind: "workflow", steps: [] };
1534
- function vi(e) {
1534
+ function Ni(e) {
1535
1535
  return e?.kind === "workflow" ? e.steps : [];
1536
1536
  }
1537
- function Ni(e) {
1537
+ function vi(e) {
1538
1538
  return e?.kind === "procedure" ? e.procedure : void 0;
1539
1539
  }
1540
1540
  function Kt(e) {
1541
1541
  const t = e?.approved ?? 0, n = t + (e?.rejected ?? 0);
1542
1542
  return { total: n, rate: n ? t / n : 0 };
1543
1543
  }
1544
- const jt = 10, Gt = 0.9;
1544
+ const Gt = 10, jt = 0.9;
1545
1545
  function Ri(e) {
1546
1546
  const { total: t, rate: n } = Kt(e);
1547
- return t >= jt && n >= Gt;
1547
+ return t >= Gt && n >= jt;
1548
1548
  }
1549
1549
  const Bt = ["done", "escalated", "failed", "stopped"];
1550
1550
  function $i(e) {
@@ -1580,14 +1580,14 @@ function Ki(e) {
1580
1580
  const t = Math.max(0, Math.round(e / 60));
1581
1581
  return `${Math.floor(t / 60)}:${String(t % 60).padStart(2, "0")}`;
1582
1582
  }
1583
- function ji(e) {
1583
+ function Gi(e) {
1584
1584
  const t = Math.max(0, Math.floor(e)), n = (o) => String(o).padStart(2, "0"), r = Math.floor(t / 60) % 60, i = Math.floor(t / 3600);
1585
1585
  return i > 0 ? `${i}:${n(r)}:${n(t % 60)}` : `${n(r)}:${n(t % 60)}`;
1586
1586
  }
1587
1587
  function Ft(e) {
1588
1588
  return (e || "").normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").slice(0, 48).replace(/^-+|-+$/g, "");
1589
1589
  }
1590
- function Gi(e, t) {
1590
+ function ji(e, t) {
1591
1591
  const n = Ft(e) || "werksoort", r = new Set(t);
1592
1592
  if (!r.has(n)) return n;
1593
1593
  for (let i = 2; i < 500; i++) {
@@ -1913,7 +1913,7 @@ const ko = "message_window", Co = "message_templates", Oo = {
1913
1913
  // Voice/conference
1914
1914
  HOST: "host",
1915
1915
  PARTICIPANT: "participant"
1916
- }, vo = (e, t) => ({ intent: e, ...t }), No = "folder_management", Ro = "remote_search", $o = {
1916
+ }, No = (e, t) => ({ intent: e, ...t }), vo = "folder_management", Ro = "remote_search", $o = {
1917
1917
  ok: !1,
1918
1918
  code: "UNSUPPORTED",
1919
1919
  message: "Provider does not support this op"
@@ -2059,13 +2059,13 @@ const Po = "notification-source", Uo = (e, t) => `${e}.pref.${t}`, Ko = {
2059
2059
  user: ["user.read", "user.write"],
2060
2060
  work: ["item.read", "item.write", "project.read", "project.write"]
2061
2061
  }, Ie = 9e4, yn = ["out_of_office"], we = (e) => yn.includes(e);
2062
- function jo(e, t, n) {
2062
+ function Go(e, t, n) {
2063
2063
  const r = n - e < Ie, i = t?.status && (!t.expiresAt || t.expiresAt > n) ? t : void 0;
2064
2064
  if (!i?.status) return { online: r, status: r ? "available" : "offline" };
2065
2065
  const o = i.status;
2066
2066
  return !r && !we(o) ? { online: !1, status: "offline" } : { online: r, status: o, message: i.message };
2067
2067
  }
2068
- function Go(e, t) {
2068
+ function jo(e, t) {
2069
2069
  const n = t - e.lastSeenAt < Ie, r = n || we(e.status) ? e.status : "offline";
2070
2070
  return n === e.online && r === e.status ? e : { ...e, online: n, status: r };
2071
2071
  }
@@ -2304,7 +2304,7 @@ const Qo = "sync-source", ea = "sync-target", ta = 20, In = {
2304
2304
  t = t.replaceAll(r, "");
2305
2305
  });
2306
2306
  }), t = t.replace(/\(.*?\)/g, ""), t = t.replace(/\[.*?\]/g, ""), t;
2307
- }, Mn = 6e4, kn = 8e3, Cn = 2, On = 0.4, vn = 3, Nn = /* @__PURE__ */ new Set([
2307
+ }, Mn = 6e4, kn = 8e3, Cn = 2, On = 0.4, Nn = 3, vn = /* @__PURE__ */ new Set([
2308
2308
  "aan",
2309
2309
  "als",
2310
2310
  "ben",
@@ -2420,7 +2420,7 @@ const Qo = "sync-source", ea = "sync-target", ta = 20, In = {
2420
2420
  function Rn(e) {
2421
2421
  const t = /* @__PURE__ */ new Set();
2422
2422
  for (const n of e.toLowerCase().split(/[^a-z0-9À-ɏ]+/))
2423
- n.length < vn || Nn.has(n) || t.add(n);
2423
+ n.length < Nn || vn.has(n) || t.add(n);
2424
2424
  return [...t];
2425
2425
  }
2426
2426
  function $n(e, t) {
@@ -2456,7 +2456,13 @@ function ra(e) {
2456
2456
  const a = Rn(i.text);
2457
2457
  return a.length ? r.lastQueryTerms?.length && $n(a, r.lastQueryTerms) < On ? { trigger: !1, reason: "same_topic" } : { trigger: !0, text: i.text, terms: a, segmentCount: i.segmentCount } : { trigger: !1, reason: "no_speech" };
2458
2458
  }
2459
- const ia = "navNotice", x = {
2459
+ const ia = [
2460
+ "personal",
2461
+ "workspace",
2462
+ "connections",
2463
+ "work",
2464
+ "ai"
2465
+ ], oa = "navNotice", x = {
2460
2466
  // The lower bounds are deliberately generous: service ranges (0800/0900) are
2461
2467
  // shorter than geographic numbers, and a too-strict minimum silently drops them.
2462
2468
  // An over-permissive key is harmless — it simply matches nothing.
@@ -2503,14 +2509,14 @@ function ne(e) {
2503
2509
  }
2504
2510
  return e.length < Un ? null : `+${e}`;
2505
2511
  }
2506
- function jn(e) {
2512
+ function Gn(e) {
2507
2513
  let t = e.trim();
2508
2514
  const n = t.match(/^(sips?|tel|whatsapp):/i);
2509
2515
  n && (t = t.slice(n[0].length));
2510
2516
  const r = t.indexOf("@");
2511
2517
  return r >= 0 && (t = t.slice(0, r)), t.trim();
2512
2518
  }
2513
- function oa(e) {
2519
+ function aa(e) {
2514
2520
  if (!e) return !1;
2515
2521
  const t = e.indexOf("@");
2516
2522
  if (t <= 0) return !1;
@@ -2519,7 +2525,7 @@ function oa(e) {
2519
2525
  }
2520
2526
  function re(e, t) {
2521
2527
  if (!e) return null;
2522
- const n = jn(e);
2528
+ const n = Gn(e);
2523
2529
  if (!n) return null;
2524
2530
  const r = n.startsWith("+"), i = n.replace(/\D/g, "");
2525
2531
  if (!i) return null;
@@ -2538,7 +2544,7 @@ function re(e, t) {
2538
2544
  }
2539
2545
  return !a && S(i, o) ? `+${o.callingCode}${i}` : null;
2540
2546
  }
2541
- function aa(e, t = 9) {
2547
+ function sa(e, t = 9) {
2542
2548
  const n = (e ?? "").replace(/\D/g, "");
2543
2549
  return n.length < t ? null : n.slice(-t);
2544
2550
  }
@@ -2549,11 +2555,11 @@ function Ce(e) {
2549
2555
  const r = t.slice(0, n).split("+")[0], i = t.slice(n + 1);
2550
2556
  return !r || !i.includes(".") ? null : `${r}@${i}`;
2551
2557
  }
2552
- function sa(e) {
2558
+ function ca(e) {
2553
2559
  const t = Ce(e);
2554
2560
  return t ? t.slice(t.lastIndexOf("@") + 1) : null;
2555
2561
  }
2556
- const Gn = /* @__PURE__ */ new Set([
2562
+ const jn = /* @__PURE__ */ new Set([
2557
2563
  "co.uk",
2558
2564
  "org.uk",
2559
2565
  "gov.uk",
@@ -2568,7 +2574,7 @@ function Bn(e) {
2568
2574
  const t = e.trim().toLowerCase().replace(/\.$/, "").split(".").filter(Boolean);
2569
2575
  if (t.length < 2) return null;
2570
2576
  const n = t.slice(-2).join(".");
2571
- return Gn.has(n) && t.length >= 3 ? t.slice(-3).join(".") : n;
2577
+ return jn.has(n) && t.length >= 3 ? t.slice(-3).join(".") : n;
2572
2578
  }
2573
2579
  const Hn = /* @__PURE__ */ new Set([
2574
2580
  "gmail.com",
@@ -2615,16 +2621,16 @@ const Hn = /* @__PURE__ */ new Set([
2615
2621
  "proximus.be",
2616
2622
  "scarlet.be"
2617
2623
  ]);
2618
- function ca(e) {
2624
+ function la(e) {
2619
2625
  const t = Bn(e);
2620
2626
  return t ? Hn.has(t) : !1;
2621
2627
  }
2622
- function la(e) {
2628
+ function ua(e) {
2623
2629
  if (!e) return !1;
2624
2630
  const t = e.trim().toLowerCase();
2625
2631
  return t === "tel" || t === "sms" || t === "whatsapp" || t === "fax";
2626
2632
  }
2627
- function ua(e, t, n) {
2633
+ function da(e, t, n) {
2628
2634
  if (!e || !t) return null;
2629
2635
  const r = e.trim().toLowerCase();
2630
2636
  if (r === "tel" || r === "sms" || r === "whatsapp") {
@@ -2643,7 +2649,7 @@ function ua(e, t, n) {
2643
2649
  return i ? `${r}:${i}` : null;
2644
2650
  }
2645
2651
  const Fn = /(\*\*|__)(?=\S)([\s\S]*?\S)\1/g, Vn = /(\*|_)(?=\S)([^*_\n]*?\S)\1/g;
2646
- function da(e) {
2652
+ function pa(e) {
2647
2653
  if (typeof e != "string" || !e) return "";
2648
2654
  let t = e;
2649
2655
  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(`
@@ -2696,10 +2702,10 @@ function ce(e) {
2696
2702
  `).trim();
2697
2703
  }
2698
2704
  const Yn = /<\s*(html|body|div|p|table|br|span)\b/i;
2699
- function pa(e) {
2705
+ function fa(e) {
2700
2706
  return Yn.test(e);
2701
2707
  }
2702
- function fa(e) {
2708
+ function ma(e) {
2703
2709
  if (typeof e != "string" || !e) return "";
2704
2710
  let t = e.length;
2705
2711
  for (const o of Wn) {
@@ -2731,8 +2737,8 @@ export {
2731
2737
  mo as ASSIST_SOURCE_PROVIDER_GROUP,
2732
2738
  mt as ATTENTION_STATUSES,
2733
2739
  Me as AUTH_APP_NAME,
2734
- jt as AUTO_READY_MIN_PROPOSALS,
2735
- Gt as AUTO_READY_RATE,
2740
+ Gt as AUTO_READY_MIN_PROPOSALS,
2741
+ jt as AUTO_READY_RATE,
2736
2742
  Pe as ActivityTypeRegistry,
2737
2743
  pr as BUILT_IN_ONLY,
2738
2744
  gt as BULK_PENALTY,
@@ -2748,7 +2754,7 @@ export {
2748
2754
  fi as DEFAULT_MEMORY_BUDGET,
2749
2755
  Ln as DEFAULT_PHONE_REGION,
2750
2756
  Oi as EMPTY_WORKFLOW,
2751
- No as FEATURE_FOLDER_MANAGEMENT,
2757
+ vo as FEATURE_FOLDER_MANAGEMENT,
2752
2758
  Ro as FEATURE_REMOTE_SEARCH,
2753
2759
  yt as FOLLOW_UP_HOURS,
2754
2760
  at as HOUR_MS,
@@ -2774,7 +2780,7 @@ export {
2774
2780
  Wt as MAX_TOPIC_EXAMPLES,
2775
2781
  O as MAX_TOPIC_EXAMPLE_CHARS,
2776
2782
  di as MIN_MEMORY_BUDGET,
2777
- ia as NAV_NOTICE_SLOT,
2783
+ oa as NAV_NOTICE_SLOT,
2778
2784
  Po as NOTIFICATION_SOURCE_PROVIDER_GROUP,
2779
2785
  gi as ONBOARDING_SOURCE_PROVIDER_GROUP,
2780
2786
  x as PHONE_REGIONS,
@@ -2791,7 +2797,8 @@ export {
2791
2797
  Fo as RESOURCE_DESCRIBE_SERVICE,
2792
2798
  Wo as RESOURCE_RESOLVE_SERVICE,
2793
2799
  Vo as RESOURCE_SEARCH_SERVICE,
2794
- jr as SIGNATURE_INTENTS,
2800
+ ia as SETTINGS_CATEGORIES,
2801
+ Gr as SIGNATURE_INTENTS,
2795
2802
  ht as SLA_HOURS_BY_PRIORITY,
2796
2803
  Ut as STEP_MAX_TOKENS_MAX,
2797
2804
  Pt as STEP_MAX_TOKENS_MIN,
@@ -2814,7 +2821,7 @@ export {
2814
2821
  Qt as WORK_PROJECT_SCOPE_KIND,
2815
2822
  _ as W_PRIORITY,
2816
2823
  Vi as acceptExampleCandidate,
2817
- vt as actingIdentityKey,
2824
+ Nt as actingIdentityKey,
2818
2825
  Hi as activeWorkTypes,
2819
2826
  tr as activityIconOf,
2820
2827
  ur as activityJoinUrl,
@@ -2825,10 +2832,10 @@ export {
2825
2832
  d as activityTypeInfo,
2826
2833
  Ei as actorKey,
2827
2834
  Fi as addExampleCandidate,
2828
- Go as agePresenceEntry,
2835
+ jo as agePresenceEntry,
2829
2836
  cn as aiAttachmentKind,
2830
2837
  uo as aiAttachmentRejection,
2831
- G as aiBudgetLimit,
2838
+ j as aiBudgetLimit,
2832
2839
  _r as aiBudgetPeriodKey,
2833
2840
  Ke as aiBudgetPeriodStart,
2834
2841
  Sr as aiBudgetState,
@@ -2839,11 +2846,11 @@ export {
2839
2846
  Ar as aiVendorsWith,
2840
2847
  ke as appNameFromPath,
2841
2848
  Ui as applyRounding,
2842
- Gr as applySignature,
2849
+ jr as applySignature,
2843
2850
  Kt as approvalRate,
2844
2851
  Or as artifactBodyBytes,
2845
- vr as artifactOutline,
2846
- Nr as artifactToMarkdown,
2852
+ Nr as artifactOutline,
2853
+ vr as artifactToMarkdown,
2847
2854
  Ii as assignmentMismatch,
2848
2855
  Lr as assignmentScopeKey,
2849
2856
  Ur as assignmentSubject,
@@ -2858,7 +2865,7 @@ export {
2858
2865
  Mo as channelKindForScheme,
2859
2866
  nr as channelKindOf,
2860
2867
  Ci as clampStepMaxTokens,
2861
- fa as cleanMessageText,
2868
+ ma as cleanMessageText,
2862
2869
  yo as compareAssistRank,
2863
2870
  Vt as compareWorkTypes,
2864
2871
  Kr as decideAssignmentState,
@@ -2866,13 +2873,13 @@ export {
2866
2873
  Eo as decideIncomingCall,
2867
2874
  Mt as defaultLocaleOf,
2868
2875
  io as defaultStatusKey,
2869
- vo as defineIntent,
2876
+ No as defineIntent,
2870
2877
  Tt as depthOf,
2871
- jo as derivePresence,
2878
+ Go as derivePresence,
2872
2879
  So as disabledIntentsFromCapabilities,
2873
2880
  Pi as elapsedSeconds,
2874
- sa as emailDomain,
2875
- ua as endpointKey,
2881
+ ca as emailDomain,
2882
+ da as endpointKey,
2876
2883
  En as extractParams,
2877
2884
  Rn as extractTerms,
2878
2885
  Io as filterByEndpoint,
@@ -2880,12 +2887,12 @@ export {
2880
2887
  mn as filterByTargetScheme,
2881
2888
  T as findAiVendor,
2882
2889
  Lo as flattenLocales,
2883
- Ge as floorToPeriod,
2890
+ je as floorToPeriod,
2884
2891
  Ot as formatActingIdentity,
2885
- ji as formatClock,
2892
+ Gi as formatClock,
2886
2893
  Ki as formatHm,
2887
2894
  Zi as formatItemKey,
2888
- je as formatPeriod,
2895
+ Ge as formatPeriod,
2889
2896
  fo as freshSources,
2890
2897
  fr as getActivitySeenUserIds,
2891
2898
  Br as getContactEndpoints,
@@ -2908,7 +2915,7 @@ export {
2908
2915
  It as isDescendant,
2909
2916
  Hr as isEligible,
2910
2917
  mr as isEmailActivity,
2911
- pa as isHtmlBody,
2918
+ fa as isHtmlBody,
2912
2919
  xi as isInFlight,
2913
2920
  ft as isInteractionUnseen,
2914
2921
  qo as isLandingPath,
@@ -2920,7 +2927,7 @@ export {
2920
2927
  bt as isParked,
2921
2928
  Ht as isPaused,
2922
2929
  ar as isPlaybookAuthoredType,
2923
- ca as isPublicEmailDomain,
2930
+ la as isPublicEmailDomain,
2924
2931
  Zo as isPublicPath,
2925
2932
  Et as isReminderActive,
2926
2933
  ir as isReplyableType,
@@ -2937,14 +2944,14 @@ export {
2937
2944
  ni as localeInstruction,
2938
2945
  ti as localeName,
2939
2946
  ii as localesOf,
2940
- oa as looksLikeEmail,
2947
+ aa as looksLikeEmail,
2941
2948
  wo as matchContactToIntents,
2942
2949
  Tn as matchPublicRoute,
2943
2950
  si as mcpCredentialScope,
2944
2951
  ci as mcpToolPrefix,
2945
2952
  na as mergeShownKeys,
2946
2953
  Re as messageCountsAs,
2947
- la as needsPhoneRegion,
2954
+ ua as needsPhoneRegion,
2948
2955
  Cr as normalizeArtifactBlocks,
2949
2956
  er as normalizeBlocks,
2950
2957
  Ce as normalizeEmail,
@@ -2956,14 +2963,14 @@ export {
2956
2963
  Qi as parseItemKey,
2957
2964
  bn as pathToRegex,
2958
2965
  wr as periodsInRange,
2959
- aa as phoneSuffix,
2960
- da as plainTextFromMarkdown,
2966
+ sa as phoneSuffix,
2967
+ pa as plainTextFromMarkdown,
2961
2968
  Rt as playbookActor,
2962
- Ni as procedureOf,
2969
+ vi as procedureOf,
2963
2970
  no as projectDossierKeys,
2964
2971
  Sn as publicBasePathFor,
2965
2972
  Jo as publicRoutePatterns,
2966
- v as readPath,
2973
+ N as readPath,
2967
2974
  Z as readStepError,
2968
2975
  At as recencyOf,
2969
2976
  xt as refKey,
@@ -2971,7 +2978,7 @@ export {
2971
2978
  Yt as rejectExampleCandidate,
2972
2979
  mi as relatedByDefault,
2973
2980
  pn as resolveAccountCapabilities,
2974
- N as resolveActivityText,
2981
+ v as resolveActivityText,
2975
2982
  dn as resolveChannelIntents,
2976
2983
  ot as resolveSignature,
2977
2984
  Bo as resolveWorkMode,
@@ -2994,22 +3001,22 @@ export {
2994
3001
  rn as sortStatuses,
2995
3002
  un as sourceKey,
2996
3003
  ro as statusIn,
2997
- vi as stepsOf,
2998
- Ne as stripHtml,
3004
+ Ni as stepsOf,
3005
+ ve as stripHtml,
2999
3006
  Di as subjectKeyOf,
3000
3007
  Se as subjectOf,
3001
3008
  ho as subjectRef,
3002
3009
  eo as suggestProjectKey,
3003
3010
  Ti as targetById,
3004
3011
  _i as targetForActivityType,
3005
- Nt as toActingIdentity,
3012
+ vt as toActingIdentity,
3006
3013
  re as toE164,
3007
3014
  xr as toolSourceKinds,
3008
3015
  qt as topicOfferedForTeam,
3009
3016
  Wi as topicsForTeam,
3010
3017
  Xt as truncateExample,
3011
3018
  ao as uniqueWorkStatusKey,
3012
- Gi as uniqueWorkTypeKey,
3019
+ ji as uniqueWorkTypeKey,
3013
3020
  We as usageMetricId,
3014
3021
  Mr as usageMetrics,
3015
3022
  so as validateStatuses,
@@ -37,6 +37,21 @@ export type ResourceDefinition<T = any> = T;
37
37
  * It defines the app's identity, its components, its UI contributions,
38
38
  * and most importantly, its security sandbox via the permissions block.
39
39
  */
40
+ /** The two groups of the app switcher: the product itself, and what extends it. */
41
+ export type AppSwitcherGroup = "core" | "apps";
42
+ /**
43
+ * Where an app sits in the shell's app switcher. Declaring this — not having an
44
+ * `icon` — is what puts an app in the switcher; settings-only and provider apps
45
+ * leave it out and stay reachable through settings, panels and docks.
46
+ */
47
+ export interface AppSwitcherPlacement {
48
+ /** `core` is reserved for first-party product apps; everything else is `apps`. */
49
+ group: AppSwitcherGroup;
50
+ /** Position within `core` — a fixed reading order, not alphabetical. Ignored for `apps`. */
51
+ order?: number;
52
+ /** Also offer the app in the mobile tab bar. Core apps are there by default. */
53
+ mobile?: boolean;
54
+ }
40
55
  export interface AppManifest<_TSDK = any> {
41
56
  /**
42
57
  * The namespace of the application.
@@ -63,9 +78,12 @@ export interface AppManifest<_TSDK = any> {
63
78
  */
64
79
  description?: string;
65
80
  /**
66
- * Optional icon for the application.
81
+ * Optional icon for the application. Shown wherever the app is listed; on its own
82
+ * it does not place the app in the switcher — see `switcher`.
67
83
  */
68
84
  icon?: IconDefinition;
85
+ /** Placement in the app switcher and the mobile tab bar. Absent = not listed. */
86
+ switcher?: AppSwitcherPlacement;
69
87
  /**
70
88
  * Optional default route for the application.
71
89
  */
@@ -72,6 +72,14 @@ export interface DockControls {
72
72
  * Which settings-panel tab a page appears under. A page may belong to both.
73
73
  */
74
74
  export type SettingsScope = "personal" | "company";
75
+ /**
76
+ * The heading a settings page sits under. The overlay groups on this, not on the
77
+ * app that registered the page, so a mailbox, a PBX and an MCP server all land
78
+ * under "connections" whichever app owns them.
79
+ */
80
+ export type SettingsCategory = "personal" | "workspace" | "connections" | "work" | "ai";
81
+ /** Reading order of the categories in the settings nav. */
82
+ export declare const SETTINGS_CATEGORIES: readonly SettingsCategory[];
75
83
  export interface SettingsPageConfig {
76
84
  id: string;
77
85
  displayName: string;
@@ -86,6 +94,12 @@ export interface SettingsPageConfig {
86
94
  * the group itself.
87
95
  */
88
96
  group?: string;
97
+ /**
98
+ * Heading in the settings nav. Absent = `personal` for a personal-only page,
99
+ * otherwise `workspace`; declare it, the fallback is only there for apps
100
+ * that have not caught up.
101
+ */
102
+ category?: SettingsCategory;
89
103
  icon?: string;
90
104
  resource: string;
91
105
  order?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencxh/domain",
3
- "version": "1.197.0",
3
+ "version": "1.198.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",