@absolutejs/voice 0.0.22-beta.151 → 0.0.22-beta.153

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.
@@ -193,9 +193,199 @@ VoiceOpsStatusService = __decorateElement(_init, 0, "VoiceOpsStatusService", _de
193
193
  __runInitializers(_init, 1, VoiceOpsStatusService);
194
194
  __decoratorMetadata(_init, VoiceOpsStatusService);
195
195
  let _VoiceOpsStatusService = VoiceOpsStatusService;
196
- // src/angular/voice-campaign-dialer-proof.service.ts
196
+ // src/angular/voice-delivery-runtime.service.ts
197
197
  import { computed as computed2, Injectable as Injectable2, signal as signal2 } from "@angular/core";
198
198
 
199
+ // src/client/deliveryRuntime.ts
200
+ var getDefaultActionPath = (path, action, options) => {
201
+ if (action === "tick") {
202
+ return options.tickPath ?? `${path.replace(/\/$/, "")}/tick`;
203
+ }
204
+ return options.requeueDeadLettersPath ?? `${path.replace(/\/$/, "")}/requeue-dead-letters`;
205
+ };
206
+ var fetchVoiceDeliveryRuntime = async (path = "/api/voice-delivery-runtime", options = {}) => {
207
+ const fetchImpl = options.fetch ?? globalThis.fetch;
208
+ const response = await fetchImpl(path);
209
+ if (!response.ok) {
210
+ throw new Error(`Voice delivery runtime failed: HTTP ${response.status}`);
211
+ }
212
+ return await response.json();
213
+ };
214
+ var runVoiceDeliveryRuntimeAction = async (action, path = "/api/voice-delivery-runtime", options = {}) => {
215
+ const fetchImpl = options.fetch ?? globalThis.fetch;
216
+ const response = await fetchImpl(getDefaultActionPath(path, action, options), {
217
+ method: "POST"
218
+ });
219
+ if (!response.ok) {
220
+ throw new Error(`Voice delivery runtime ${action} failed: HTTP ${response.status}`);
221
+ }
222
+ const body = await response.json();
223
+ return {
224
+ action,
225
+ result: body.result,
226
+ summary: body.summary,
227
+ updatedAt: Date.now()
228
+ };
229
+ };
230
+ var createVoiceDeliveryRuntimeStore = (path = "/api/voice-delivery-runtime", options = {}) => {
231
+ const listeners = new Set;
232
+ let closed = false;
233
+ let timer;
234
+ let snapshot = {
235
+ actionError: null,
236
+ actionStatus: "idle",
237
+ error: null,
238
+ isLoading: false
239
+ };
240
+ const emit = () => {
241
+ for (const listener of listeners) {
242
+ listener();
243
+ }
244
+ };
245
+ const refresh = async () => {
246
+ if (closed) {
247
+ return snapshot.report;
248
+ }
249
+ snapshot = {
250
+ ...snapshot,
251
+ error: null,
252
+ isLoading: true
253
+ };
254
+ emit();
255
+ try {
256
+ const report = await fetchVoiceDeliveryRuntime(path, options);
257
+ snapshot = {
258
+ ...snapshot,
259
+ error: null,
260
+ isLoading: false,
261
+ report,
262
+ updatedAt: Date.now()
263
+ };
264
+ emit();
265
+ return report;
266
+ } catch (error) {
267
+ snapshot = {
268
+ ...snapshot,
269
+ error: error instanceof Error ? error.message : String(error),
270
+ isLoading: false
271
+ };
272
+ emit();
273
+ throw error;
274
+ }
275
+ };
276
+ const runAction = async (action) => {
277
+ if (closed) {
278
+ return snapshot.lastAction;
279
+ }
280
+ snapshot = {
281
+ ...snapshot,
282
+ actionError: null,
283
+ actionStatus: "running"
284
+ };
285
+ emit();
286
+ try {
287
+ const result = await runVoiceDeliveryRuntimeAction(action, path, options);
288
+ snapshot = {
289
+ ...snapshot,
290
+ actionError: null,
291
+ actionStatus: "completed",
292
+ lastAction: result
293
+ };
294
+ emit();
295
+ await refresh();
296
+ return result;
297
+ } catch (error) {
298
+ snapshot = {
299
+ ...snapshot,
300
+ actionError: error instanceof Error ? error.message : String(error),
301
+ actionStatus: "failed"
302
+ };
303
+ emit();
304
+ throw error;
305
+ }
306
+ };
307
+ const close = () => {
308
+ closed = true;
309
+ if (timer) {
310
+ clearInterval(timer);
311
+ timer = undefined;
312
+ }
313
+ listeners.clear();
314
+ };
315
+ if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
316
+ timer = setInterval(() => {
317
+ refresh().catch(() => {});
318
+ }, options.intervalMs);
319
+ }
320
+ return {
321
+ close,
322
+ getServerSnapshot: () => snapshot,
323
+ getSnapshot: () => snapshot,
324
+ requeueDeadLetters: () => runAction("requeue-dead-letters"),
325
+ refresh,
326
+ tick: () => runAction("tick"),
327
+ subscribe: (listener) => {
328
+ listeners.add(listener);
329
+ return () => {
330
+ listeners.delete(listener);
331
+ };
332
+ }
333
+ };
334
+ };
335
+
336
+ // src/angular/voice-delivery-runtime.service.ts
337
+ var _dec = [
338
+ Injectable2({ providedIn: "root" })
339
+ ];
340
+ var _init = __decoratorStart(undefined);
341
+
342
+ class VoiceDeliveryRuntimeService {
343
+ connect(path = "/api/voice-delivery-runtime", options = {}) {
344
+ const store = createVoiceDeliveryRuntimeStore(path, options);
345
+ const actionErrorSignal = signal2(null);
346
+ const actionStatusSignal = signal2("idle");
347
+ const errorSignal = signal2(null);
348
+ const isLoadingSignal = signal2(false);
349
+ const reportSignal = signal2(undefined);
350
+ const updatedAtSignal = signal2(undefined);
351
+ const sync = () => {
352
+ const snapshot = store.getSnapshot();
353
+ actionErrorSignal.set(snapshot.actionError);
354
+ actionStatusSignal.set(snapshot.actionStatus);
355
+ errorSignal.set(snapshot.error);
356
+ isLoadingSignal.set(snapshot.isLoading);
357
+ reportSignal.set(snapshot.report);
358
+ updatedAtSignal.set(snapshot.updatedAt);
359
+ };
360
+ const unsubscribe = store.subscribe(sync);
361
+ sync();
362
+ if (typeof window !== "undefined") {
363
+ store.refresh().catch(() => {});
364
+ }
365
+ return {
366
+ close: () => {
367
+ unsubscribe();
368
+ store.close();
369
+ },
370
+ error: computed2(() => errorSignal()),
371
+ actionError: computed2(() => actionErrorSignal()),
372
+ actionStatus: computed2(() => actionStatusSignal()),
373
+ isLoading: computed2(() => isLoadingSignal()),
374
+ requeueDeadLetters: store.requeueDeadLetters,
375
+ refresh: store.refresh,
376
+ report: computed2(() => reportSignal()),
377
+ tick: store.tick,
378
+ updatedAt: computed2(() => updatedAtSignal())
379
+ };
380
+ }
381
+ }
382
+ VoiceDeliveryRuntimeService = __decorateElement(_init, 0, "VoiceDeliveryRuntimeService", _dec, VoiceDeliveryRuntimeService);
383
+ __runInitializers(_init, 1, VoiceDeliveryRuntimeService);
384
+ __decoratorMetadata(_init, VoiceDeliveryRuntimeService);
385
+ let _VoiceDeliveryRuntimeService = VoiceDeliveryRuntimeService;
386
+ // src/angular/voice-campaign-dialer-proof.service.ts
387
+ import { computed as computed3, Injectable as Injectable3, signal as signal3 } from "@angular/core";
388
+
199
389
  // src/client/campaignDialerProof.ts
200
390
  var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
201
391
  const fetchImpl = options.fetch ?? globalThis.fetch;
@@ -316,18 +506,18 @@ var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-p
316
506
 
317
507
  // src/angular/voice-campaign-dialer-proof.service.ts
318
508
  var _dec = [
319
- Injectable2({ providedIn: "root" })
509
+ Injectable3({ providedIn: "root" })
320
510
  ];
321
511
  var _init = __decoratorStart(undefined);
322
512
 
323
513
  class VoiceCampaignDialerProofService {
324
514
  connect(path = "/api/voice/campaigns/dialer-proof", options = {}) {
325
515
  const store = createVoiceCampaignDialerProofStore(path, options);
326
- const errorSignal = signal2(null);
327
- const isLoadingSignal = signal2(false);
328
- const reportSignal = signal2(undefined);
329
- const statusSignal = signal2(undefined);
330
- const updatedAtSignal = signal2(undefined);
516
+ const errorSignal = signal3(null);
517
+ const isLoadingSignal = signal3(false);
518
+ const reportSignal = signal3(undefined);
519
+ const statusSignal = signal3(undefined);
520
+ const updatedAtSignal = signal3(undefined);
331
521
  const sync = () => {
332
522
  const snapshot = store.getSnapshot();
333
523
  errorSignal.set(snapshot.error);
@@ -344,13 +534,13 @@ class VoiceCampaignDialerProofService {
344
534
  unsubscribe();
345
535
  store.close();
346
536
  },
347
- error: computed2(() => errorSignal()),
348
- isLoading: computed2(() => isLoadingSignal()),
537
+ error: computed3(() => errorSignal()),
538
+ isLoading: computed3(() => isLoadingSignal()),
349
539
  refresh: store.refresh,
350
- report: computed2(() => reportSignal()),
540
+ report: computed3(() => reportSignal()),
351
541
  runProof: store.runProof,
352
- status: computed2(() => statusSignal()),
353
- updatedAt: computed2(() => updatedAtSignal())
542
+ status: computed3(() => statusSignal()),
543
+ updatedAt: computed3(() => updatedAtSignal())
354
544
  };
355
545
  }
356
546
  }
@@ -359,7 +549,7 @@ __runInitializers(_init, 1, VoiceCampaignDialerProofService);
359
549
  __decoratorMetadata(_init, VoiceCampaignDialerProofService);
360
550
  let _VoiceCampaignDialerProofService = VoiceCampaignDialerProofService;
361
551
  // src/angular/voice-stream.service.ts
362
- import { computed as computed3, Injectable as Injectable3, signal as signal3 } from "@angular/core";
552
+ import { computed as computed4, Injectable as Injectable4, signal as signal4 } from "@angular/core";
363
553
 
364
554
  // src/client/actions.ts
365
555
  var normalizeErrorMessage = (value) => {
@@ -1003,23 +1193,23 @@ var createVoiceStream = (path, options = {}) => {
1003
1193
 
1004
1194
  // src/angular/voice-stream.service.ts
1005
1195
  var _dec = [
1006
- Injectable3({ providedIn: "root" })
1196
+ Injectable4({ providedIn: "root" })
1007
1197
  ];
1008
1198
  var _init = __decoratorStart(undefined);
1009
1199
 
1010
1200
  class VoiceStreamService {
1011
1201
  connect(path, options = {}) {
1012
1202
  const stream = createVoiceStream(path, options);
1013
- const assistantAudioSignal = signal3([]);
1014
- const assistantTextsSignal = signal3([]);
1015
- const callSignal = signal3(null);
1016
- const errorSignal = signal3(null);
1017
- const isConnectedSignal = signal3(false);
1018
- const partialSignal = signal3("");
1019
- const reconnectSignal = signal3(stream.reconnect);
1020
- const sessionIdSignal = signal3(stream.sessionId);
1021
- const statusSignal = signal3(stream.status);
1022
- const turnsSignal = signal3([]);
1203
+ const assistantAudioSignal = signal4([]);
1204
+ const assistantTextsSignal = signal4([]);
1205
+ const callSignal = signal4(null);
1206
+ const errorSignal = signal4(null);
1207
+ const isConnectedSignal = signal4(false);
1208
+ const partialSignal = signal4("");
1209
+ const reconnectSignal = signal4(stream.reconnect);
1210
+ const sessionIdSignal = signal4(stream.sessionId);
1211
+ const statusSignal = signal4(stream.status);
1212
+ const turnsSignal = signal4([]);
1023
1213
  const sync = () => {
1024
1214
  assistantAudioSignal.set([...stream.assistantAudio]);
1025
1215
  assistantTextsSignal.set([...stream.assistantTexts]);
@@ -1035,23 +1225,23 @@ class VoiceStreamService {
1035
1225
  const unsubscribe = stream.subscribe(sync);
1036
1226
  sync();
1037
1227
  return {
1038
- assistantAudio: computed3(() => assistantAudioSignal()),
1039
- assistantTexts: computed3(() => assistantTextsSignal()),
1040
- call: computed3(() => callSignal()),
1228
+ assistantAudio: computed4(() => assistantAudioSignal()),
1229
+ assistantTexts: computed4(() => assistantTextsSignal()),
1230
+ call: computed4(() => callSignal()),
1041
1231
  callControl: (message) => stream.callControl(message),
1042
1232
  close: () => {
1043
1233
  unsubscribe();
1044
1234
  stream.close();
1045
1235
  },
1046
1236
  endTurn: () => stream.endTurn(),
1047
- error: computed3(() => errorSignal()),
1048
- isConnected: computed3(() => isConnectedSignal()),
1049
- partial: computed3(() => partialSignal()),
1050
- reconnect: computed3(() => reconnectSignal()),
1237
+ error: computed4(() => errorSignal()),
1238
+ isConnected: computed4(() => isConnectedSignal()),
1239
+ partial: computed4(() => partialSignal()),
1240
+ reconnect: computed4(() => reconnectSignal()),
1051
1241
  sendAudio: (audio) => stream.sendAudio(audio),
1052
- sessionId: computed3(() => sessionIdSignal()),
1053
- status: computed3(() => statusSignal()),
1054
- turns: computed3(() => turnsSignal())
1242
+ sessionId: computed4(() => sessionIdSignal()),
1243
+ status: computed4(() => statusSignal()),
1244
+ turns: computed4(() => turnsSignal())
1055
1245
  };
1056
1246
  }
1057
1247
  }
@@ -1060,7 +1250,7 @@ __runInitializers(_init, 1, VoiceStreamService);
1060
1250
  __decoratorMetadata(_init, VoiceStreamService);
1061
1251
  let _VoiceStreamService = VoiceStreamService;
1062
1252
  // src/angular/voice-controller.service.ts
1063
- import { computed as computed4, Injectable as Injectable4, signal as signal4 } from "@angular/core";
1253
+ import { computed as computed5, Injectable as Injectable5, signal as signal5 } from "@angular/core";
1064
1254
 
1065
1255
  // src/client/htmx.ts
1066
1256
  var DEFAULT_EVENT_NAME = "voice-refresh";
@@ -1705,24 +1895,24 @@ var createVoiceController = (path, options = {}) => {
1705
1895
 
1706
1896
  // src/angular/voice-controller.service.ts
1707
1897
  var _dec = [
1708
- Injectable4({ providedIn: "root" })
1898
+ Injectable5({ providedIn: "root" })
1709
1899
  ];
1710
1900
  var _init = __decoratorStart(undefined);
1711
1901
 
1712
1902
  class VoiceControllerService {
1713
1903
  connect(path, options = {}) {
1714
1904
  const controller = createVoiceController(path, options);
1715
- const assistantAudioSignal = signal4([]);
1716
- const assistantTextsSignal = signal4([]);
1717
- const errorSignal = signal4(null);
1718
- const isConnectedSignal = signal4(false);
1719
- const isRecordingSignal = signal4(false);
1720
- const partialSignal = signal4("");
1721
- const reconnectSignal = signal4(controller.reconnect);
1722
- const recordingErrorSignal = signal4(null);
1723
- const sessionIdSignal = signal4(controller.sessionId);
1724
- const statusSignal = signal4(controller.status);
1725
- const turnsSignal = signal4([]);
1905
+ const assistantAudioSignal = signal5([]);
1906
+ const assistantTextsSignal = signal5([]);
1907
+ const errorSignal = signal5(null);
1908
+ const isConnectedSignal = signal5(false);
1909
+ const isRecordingSignal = signal5(false);
1910
+ const partialSignal = signal5("");
1911
+ const reconnectSignal = signal5(controller.reconnect);
1912
+ const recordingErrorSignal = signal5(null);
1913
+ const sessionIdSignal = signal5(controller.sessionId);
1914
+ const statusSignal = signal5(controller.status);
1915
+ const turnsSignal = signal5([]);
1726
1916
  const sync = () => {
1727
1917
  assistantAudioSignal.set([...controller.assistantAudio]);
1728
1918
  assistantTextsSignal.set([...controller.assistantTexts]);
@@ -1739,27 +1929,27 @@ class VoiceControllerService {
1739
1929
  const unsubscribe = controller.subscribe(sync);
1740
1930
  sync();
1741
1931
  return {
1742
- assistantAudio: computed4(() => assistantAudioSignal()),
1743
- assistantTexts: computed4(() => assistantTextsSignal()),
1932
+ assistantAudio: computed5(() => assistantAudioSignal()),
1933
+ assistantTexts: computed5(() => assistantTextsSignal()),
1744
1934
  bindHTMX: controller.bindHTMX,
1745
1935
  close: () => {
1746
1936
  unsubscribe();
1747
1937
  controller.close();
1748
1938
  },
1749
1939
  endTurn: () => controller.endTurn(),
1750
- error: computed4(() => errorSignal()),
1751
- isConnected: computed4(() => isConnectedSignal()),
1752
- isRecording: computed4(() => isRecordingSignal()),
1753
- partial: computed4(() => partialSignal()),
1754
- reconnect: computed4(() => reconnectSignal()),
1755
- recordingError: computed4(() => recordingErrorSignal()),
1940
+ error: computed5(() => errorSignal()),
1941
+ isConnected: computed5(() => isConnectedSignal()),
1942
+ isRecording: computed5(() => isRecordingSignal()),
1943
+ partial: computed5(() => partialSignal()),
1944
+ reconnect: computed5(() => reconnectSignal()),
1945
+ recordingError: computed5(() => recordingErrorSignal()),
1756
1946
  sendAudio: (audio) => controller.sendAudio(audio),
1757
- sessionId: computed4(() => sessionIdSignal()),
1947
+ sessionId: computed5(() => sessionIdSignal()),
1758
1948
  startRecording: () => controller.startRecording(),
1759
- status: computed4(() => statusSignal()),
1949
+ status: computed5(() => statusSignal()),
1760
1950
  stopRecording: () => controller.stopRecording(),
1761
1951
  toggleRecording: () => controller.toggleRecording(),
1762
- turns: computed4(() => turnsSignal())
1952
+ turns: computed5(() => turnsSignal())
1763
1953
  };
1764
1954
  }
1765
1955
  }
@@ -1768,7 +1958,7 @@ __runInitializers(_init, 1, VoiceControllerService);
1768
1958
  __decoratorMetadata(_init, VoiceControllerService);
1769
1959
  let _VoiceControllerService = VoiceControllerService;
1770
1960
  // src/angular/voice-provider-capabilities.service.ts
1771
- import { computed as computed5, Injectable as Injectable5, signal as signal5 } from "@angular/core";
1961
+ import { computed as computed6, Injectable as Injectable6, signal as signal6 } from "@angular/core";
1772
1962
 
1773
1963
  // src/client/providerCapabilities.ts
1774
1964
  var fetchVoiceProviderCapabilities = async (path = "/api/provider-capabilities", options = {}) => {
@@ -1851,17 +2041,17 @@ var createVoiceProviderCapabilitiesStore = (path = "/api/provider-capabilities",
1851
2041
 
1852
2042
  // src/angular/voice-provider-capabilities.service.ts
1853
2043
  var _dec = [
1854
- Injectable5({ providedIn: "root" })
2044
+ Injectable6({ providedIn: "root" })
1855
2045
  ];
1856
2046
  var _init = __decoratorStart(undefined);
1857
2047
 
1858
2048
  class VoiceProviderCapabilitiesService {
1859
2049
  connect(path = "/api/provider-capabilities", options = {}) {
1860
2050
  const store = createVoiceProviderCapabilitiesStore(path, options);
1861
- const errorSignal = signal5(null);
1862
- const isLoadingSignal = signal5(false);
1863
- const reportSignal = signal5(undefined);
1864
- const updatedAtSignal = signal5(undefined);
2051
+ const errorSignal = signal6(null);
2052
+ const isLoadingSignal = signal6(false);
2053
+ const reportSignal = signal6(undefined);
2054
+ const updatedAtSignal = signal6(undefined);
1865
2055
  const sync = () => {
1866
2056
  const snapshot = store.getSnapshot();
1867
2057
  errorSignal.set(snapshot.error);
@@ -1877,11 +2067,11 @@ class VoiceProviderCapabilitiesService {
1877
2067
  unsubscribe();
1878
2068
  store.close();
1879
2069
  },
1880
- error: computed5(() => errorSignal()),
1881
- isLoading: computed5(() => isLoadingSignal()),
2070
+ error: computed6(() => errorSignal()),
2071
+ isLoading: computed6(() => isLoadingSignal()),
1882
2072
  refresh: store.refresh,
1883
- report: computed5(() => reportSignal()),
1884
- updatedAt: computed5(() => updatedAtSignal())
2073
+ report: computed6(() => reportSignal()),
2074
+ updatedAt: computed6(() => updatedAtSignal())
1885
2075
  };
1886
2076
  }
1887
2077
  }
@@ -1890,7 +2080,7 @@ __runInitializers(_init, 1, VoiceProviderCapabilitiesService);
1890
2080
  __decoratorMetadata(_init, VoiceProviderCapabilitiesService);
1891
2081
  let _VoiceProviderCapabilitiesService = VoiceProviderCapabilitiesService;
1892
2082
  // src/angular/voice-provider-status.service.ts
1893
- import { computed as computed6, Injectable as Injectable6, signal as signal6 } from "@angular/core";
2083
+ import { computed as computed7, Injectable as Injectable7, signal as signal7 } from "@angular/core";
1894
2084
 
1895
2085
  // src/client/providerStatus.ts
1896
2086
  var fetchVoiceProviderStatus = async (path = "/api/provider-status", options = {}) => {
@@ -1974,17 +2164,17 @@ var createVoiceProviderStatusStore = (path = "/api/provider-status", options = {
1974
2164
 
1975
2165
  // src/angular/voice-provider-status.service.ts
1976
2166
  var _dec = [
1977
- Injectable6({ providedIn: "root" })
2167
+ Injectable7({ providedIn: "root" })
1978
2168
  ];
1979
2169
  var _init = __decoratorStart(undefined);
1980
2170
 
1981
2171
  class VoiceProviderStatusService {
1982
2172
  connect(path = "/api/provider-status", options = {}) {
1983
2173
  const store = createVoiceProviderStatusStore(path, options);
1984
- const errorSignal = signal6(null);
1985
- const isLoadingSignal = signal6(false);
1986
- const providersSignal = signal6([]);
1987
- const updatedAtSignal = signal6(undefined);
2174
+ const errorSignal = signal7(null);
2175
+ const isLoadingSignal = signal7(false);
2176
+ const providersSignal = signal7([]);
2177
+ const updatedAtSignal = signal7(undefined);
1988
2178
  const sync = () => {
1989
2179
  const snapshot = store.getSnapshot();
1990
2180
  errorSignal.set(snapshot.error);
@@ -2000,11 +2190,11 @@ class VoiceProviderStatusService {
2000
2190
  unsubscribe();
2001
2191
  store.close();
2002
2192
  },
2003
- error: computed6(() => errorSignal()),
2004
- isLoading: computed6(() => isLoadingSignal()),
2005
- providers: computed6(() => providersSignal()),
2193
+ error: computed7(() => errorSignal()),
2194
+ isLoading: computed7(() => isLoadingSignal()),
2195
+ providers: computed7(() => providersSignal()),
2006
2196
  refresh: store.refresh,
2007
- updatedAt: computed6(() => updatedAtSignal())
2197
+ updatedAt: computed7(() => updatedAtSignal())
2008
2198
  };
2009
2199
  }
2010
2200
  }
@@ -2013,7 +2203,7 @@ __runInitializers(_init, 1, VoiceProviderStatusService);
2013
2203
  __decoratorMetadata(_init, VoiceProviderStatusService);
2014
2204
  let _VoiceProviderStatusService = VoiceProviderStatusService;
2015
2205
  // src/angular/voice-routing-status.service.ts
2016
- import { Injectable as Injectable7, signal as signal7 } from "@angular/core";
2206
+ import { Injectable as Injectable8, signal as signal8 } from "@angular/core";
2017
2207
 
2018
2208
  // src/client/routingStatus.ts
2019
2209
  var fetchVoiceRoutingStatus = async (path = "/api/routing/latest", options = {}) => {
@@ -2097,17 +2287,17 @@ var createVoiceRoutingStatusStore = (path = "/api/routing/latest", options = {})
2097
2287
 
2098
2288
  // src/angular/voice-routing-status.service.ts
2099
2289
  var _dec = [
2100
- Injectable7({ providedIn: "root" })
2290
+ Injectable8({ providedIn: "root" })
2101
2291
  ];
2102
2292
  var _init = __decoratorStart(undefined);
2103
2293
 
2104
2294
  class VoiceRoutingStatusService {
2105
2295
  connect(path = "/api/routing/latest", options = {}) {
2106
2296
  const store = createVoiceRoutingStatusStore(path, options);
2107
- const decisionSignal = signal7(null);
2108
- const errorSignal = signal7(null);
2109
- const isLoadingSignal = signal7(false);
2110
- const updatedAtSignal = signal7(undefined);
2297
+ const decisionSignal = signal8(null);
2298
+ const errorSignal = signal8(null);
2299
+ const isLoadingSignal = signal8(false);
2300
+ const updatedAtSignal = signal8(undefined);
2111
2301
  const sync = () => {
2112
2302
  const snapshot = store.getSnapshot();
2113
2303
  decisionSignal.set(snapshot.decision);
@@ -2136,7 +2326,7 @@ __runInitializers(_init, 1, VoiceRoutingStatusService);
2136
2326
  __decoratorMetadata(_init, VoiceRoutingStatusService);
2137
2327
  let _VoiceRoutingStatusService = VoiceRoutingStatusService;
2138
2328
  // src/angular/voice-trace-timeline.service.ts
2139
- import { computed as computed7, Injectable as Injectable8, signal as signal8 } from "@angular/core";
2329
+ import { computed as computed8, Injectable as Injectable9, signal as signal9 } from "@angular/core";
2140
2330
 
2141
2331
  // src/client/traceTimeline.ts
2142
2332
  var fetchVoiceTraceTimeline = async (path = "/api/voice-traces", options = {}) => {
@@ -2220,17 +2410,17 @@ var createVoiceTraceTimelineStore = (path = "/api/voice-traces", options = {}) =
2220
2410
 
2221
2411
  // src/angular/voice-trace-timeline.service.ts
2222
2412
  var _dec = [
2223
- Injectable8({ providedIn: "root" })
2413
+ Injectable9({ providedIn: "root" })
2224
2414
  ];
2225
2415
  var _init = __decoratorStart(undefined);
2226
2416
 
2227
2417
  class VoiceTraceTimelineService {
2228
2418
  connect(path = "/api/voice-traces", options = {}) {
2229
2419
  const store = createVoiceTraceTimelineStore(path, options);
2230
- const errorSignal = signal8(null);
2231
- const isLoadingSignal = signal8(false);
2232
- const reportSignal = signal8(null);
2233
- const updatedAtSignal = signal8(undefined);
2420
+ const errorSignal = signal9(null);
2421
+ const isLoadingSignal = signal9(false);
2422
+ const reportSignal = signal9(null);
2423
+ const updatedAtSignal = signal9(undefined);
2234
2424
  const sync = () => {
2235
2425
  const snapshot = store.getSnapshot();
2236
2426
  errorSignal.set(snapshot.error);
@@ -2246,11 +2436,11 @@ class VoiceTraceTimelineService {
2246
2436
  unsubscribe();
2247
2437
  store.close();
2248
2438
  },
2249
- error: computed7(() => errorSignal()),
2250
- isLoading: computed7(() => isLoadingSignal()),
2439
+ error: computed8(() => errorSignal()),
2440
+ isLoading: computed8(() => isLoadingSignal()),
2251
2441
  refresh: store.refresh,
2252
- report: computed7(() => reportSignal()),
2253
- updatedAt: computed7(() => updatedAtSignal())
2442
+ report: computed8(() => reportSignal()),
2443
+ updatedAt: computed8(() => updatedAtSignal())
2254
2444
  };
2255
2445
  }
2256
2446
  }
@@ -2259,7 +2449,7 @@ __runInitializers(_init, 1, VoiceTraceTimelineService);
2259
2449
  __decoratorMetadata(_init, VoiceTraceTimelineService);
2260
2450
  let _VoiceTraceTimelineService = VoiceTraceTimelineService;
2261
2451
  // src/angular/voice-turn-latency.service.ts
2262
- import { computed as computed8, Injectable as Injectable9, signal as signal9 } from "@angular/core";
2452
+ import { computed as computed9, Injectable as Injectable10, signal as signal10 } from "@angular/core";
2263
2453
 
2264
2454
  // src/client/turnLatency.ts
2265
2455
  var fetchVoiceTurnLatency = async (path = "/api/turn-latency", options = {}) => {
@@ -2366,17 +2556,17 @@ var createVoiceTurnLatencyStore = (path = "/api/turn-latency", options = {}) =>
2366
2556
 
2367
2557
  // src/angular/voice-turn-latency.service.ts
2368
2558
  var _dec = [
2369
- Injectable9({ providedIn: "root" })
2559
+ Injectable10({ providedIn: "root" })
2370
2560
  ];
2371
2561
  var _init = __decoratorStart(undefined);
2372
2562
 
2373
2563
  class VoiceTurnLatencyService {
2374
2564
  connect(path = "/api/turn-latency", options = {}) {
2375
2565
  const store = createVoiceTurnLatencyStore(path, options);
2376
- const errorSignal = signal9(null);
2377
- const isLoadingSignal = signal9(false);
2378
- const reportSignal = signal9(undefined);
2379
- const updatedAtSignal = signal9(undefined);
2566
+ const errorSignal = signal10(null);
2567
+ const isLoadingSignal = signal10(false);
2568
+ const reportSignal = signal10(undefined);
2569
+ const updatedAtSignal = signal10(undefined);
2380
2570
  const sync = () => {
2381
2571
  const snapshot = store.getSnapshot();
2382
2572
  errorSignal.set(snapshot.error);
@@ -2392,12 +2582,12 @@ class VoiceTurnLatencyService {
2392
2582
  unsubscribe();
2393
2583
  store.close();
2394
2584
  },
2395
- error: computed8(() => errorSignal()),
2396
- isLoading: computed8(() => isLoadingSignal()),
2585
+ error: computed9(() => errorSignal()),
2586
+ isLoading: computed9(() => isLoadingSignal()),
2397
2587
  refresh: store.refresh,
2398
- report: computed8(() => reportSignal()),
2588
+ report: computed9(() => reportSignal()),
2399
2589
  runProof: store.runProof,
2400
- updatedAt: computed8(() => updatedAtSignal())
2590
+ updatedAt: computed9(() => updatedAtSignal())
2401
2591
  };
2402
2592
  }
2403
2593
  }
@@ -2406,7 +2596,7 @@ __runInitializers(_init, 1, VoiceTurnLatencyService);
2406
2596
  __decoratorMetadata(_init, VoiceTurnLatencyService);
2407
2597
  let _VoiceTurnLatencyService = VoiceTurnLatencyService;
2408
2598
  // src/angular/voice-turn-quality.service.ts
2409
- import { computed as computed9, Injectable as Injectable10, signal as signal10 } from "@angular/core";
2599
+ import { computed as computed10, Injectable as Injectable11, signal as signal11 } from "@angular/core";
2410
2600
 
2411
2601
  // src/client/turnQuality.ts
2412
2602
  var fetchVoiceTurnQuality = async (path = "/api/turn-quality", options = {}) => {
@@ -2489,17 +2679,17 @@ var createVoiceTurnQualityStore = (path = "/api/turn-quality", options = {}) =>
2489
2679
 
2490
2680
  // src/angular/voice-turn-quality.service.ts
2491
2681
  var _dec = [
2492
- Injectable10({ providedIn: "root" })
2682
+ Injectable11({ providedIn: "root" })
2493
2683
  ];
2494
2684
  var _init = __decoratorStart(undefined);
2495
2685
 
2496
2686
  class VoiceTurnQualityService {
2497
2687
  connect(path = "/api/turn-quality", options = {}) {
2498
2688
  const store = createVoiceTurnQualityStore(path, options);
2499
- const errorSignal = signal10(null);
2500
- const isLoadingSignal = signal10(false);
2501
- const reportSignal = signal10(undefined);
2502
- const updatedAtSignal = signal10(undefined);
2689
+ const errorSignal = signal11(null);
2690
+ const isLoadingSignal = signal11(false);
2691
+ const reportSignal = signal11(undefined);
2692
+ const updatedAtSignal = signal11(undefined);
2503
2693
  const sync = () => {
2504
2694
  const snapshot = store.getSnapshot();
2505
2695
  errorSignal.set(snapshot.error);
@@ -2515,11 +2705,11 @@ class VoiceTurnQualityService {
2515
2705
  unsubscribe();
2516
2706
  store.close();
2517
2707
  },
2518
- error: computed9(() => errorSignal()),
2519
- isLoading: computed9(() => isLoadingSignal()),
2708
+ error: computed10(() => errorSignal()),
2709
+ isLoading: computed10(() => isLoadingSignal()),
2520
2710
  refresh: store.refresh,
2521
- report: computed9(() => reportSignal()),
2522
- updatedAt: computed9(() => updatedAtSignal())
2711
+ report: computed10(() => reportSignal()),
2712
+ updatedAt: computed10(() => updatedAtSignal())
2523
2713
  };
2524
2714
  }
2525
2715
  }
@@ -2528,7 +2718,7 @@ __runInitializers(_init, 1, VoiceTurnQualityService);
2528
2718
  __decoratorMetadata(_init, VoiceTurnQualityService);
2529
2719
  let _VoiceTurnQualityService = VoiceTurnQualityService;
2530
2720
  // src/angular/voice-workflow-status.service.ts
2531
- import { computed as computed10, Injectable as Injectable11, signal as signal11 } from "@angular/core";
2721
+ import { computed as computed11, Injectable as Injectable12, signal as signal12 } from "@angular/core";
2532
2722
 
2533
2723
  // src/client/workflowStatus.ts
2534
2724
  var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
@@ -2611,17 +2801,17 @@ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options =
2611
2801
 
2612
2802
  // src/angular/voice-workflow-status.service.ts
2613
2803
  var _dec = [
2614
- Injectable11({ providedIn: "root" })
2804
+ Injectable12({ providedIn: "root" })
2615
2805
  ];
2616
2806
  var _init = __decoratorStart(undefined);
2617
2807
 
2618
2808
  class VoiceWorkflowStatusService {
2619
2809
  connect(path = "/evals/scenarios/json", options = {}) {
2620
2810
  const store = createVoiceWorkflowStatusStore(path, options);
2621
- const errorSignal = signal11(null);
2622
- const isLoadingSignal = signal11(false);
2623
- const reportSignal = signal11(undefined);
2624
- const updatedAtSignal = signal11(undefined);
2811
+ const errorSignal = signal12(null);
2812
+ const isLoadingSignal = signal12(false);
2813
+ const reportSignal = signal12(undefined);
2814
+ const updatedAtSignal = signal12(undefined);
2625
2815
  const sync = () => {
2626
2816
  const snapshot = store.getSnapshot();
2627
2817
  errorSignal.set(snapshot.error);
@@ -2639,11 +2829,11 @@ class VoiceWorkflowStatusService {
2639
2829
  unsubscribe();
2640
2830
  store.close();
2641
2831
  },
2642
- error: computed10(() => errorSignal()),
2643
- isLoading: computed10(() => isLoadingSignal()),
2832
+ error: computed11(() => errorSignal()),
2833
+ isLoading: computed11(() => isLoadingSignal()),
2644
2834
  refresh: store.refresh,
2645
- report: computed10(() => reportSignal()),
2646
- updatedAt: computed10(() => updatedAtSignal())
2835
+ report: computed11(() => reportSignal()),
2836
+ updatedAt: computed11(() => updatedAtSignal())
2647
2837
  };
2648
2838
  }
2649
2839
  }
@@ -2651,6 +2841,294 @@ VoiceWorkflowStatusService = __decorateElement(_init, 0, "VoiceWorkflowStatusSer
2651
2841
  __runInitializers(_init, 1, VoiceWorkflowStatusService);
2652
2842
  __decoratorMetadata(_init, VoiceWorkflowStatusService);
2653
2843
  let _VoiceWorkflowStatusService = VoiceWorkflowStatusService;
2844
+ // src/angular/voice-delivery-runtime.component.ts
2845
+ import { Component, Input, signal as signal13 } from "@angular/core";
2846
+
2847
+ // src/client/deliveryRuntimeWidget.ts
2848
+ var DEFAULT_TITLE = "Voice Delivery Runtime";
2849
+ var DEFAULT_DESCRIPTION = "Audit and trace delivery worker health from your AbsoluteJS voice app.";
2850
+ var escapeHtml = (value) => value.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&#39;");
2851
+ var createSurface = (id, summary) => {
2852
+ if (!summary) {
2853
+ return {
2854
+ deadLettered: 0,
2855
+ detail: "Worker disabled",
2856
+ failed: 0,
2857
+ id,
2858
+ label: id === "audit" ? "Audit delivery" : "Trace delivery",
2859
+ pending: 0,
2860
+ status: "disabled",
2861
+ total: 0
2862
+ };
2863
+ }
2864
+ const blocked = summary.failed + summary.deadLettered;
2865
+ return {
2866
+ deadLettered: summary.deadLettered,
2867
+ detail: `${summary.delivered}/${summary.total} delivered, ${summary.pending} pending`,
2868
+ failed: summary.failed,
2869
+ id,
2870
+ label: id === "audit" ? "Audit delivery" : "Trace delivery",
2871
+ pending: summary.pending,
2872
+ status: blocked > 0 ? "warn" : "pass",
2873
+ total: summary.total
2874
+ };
2875
+ };
2876
+ var createVoiceDeliveryRuntimeViewModel = (snapshot, options = {}) => {
2877
+ const report = snapshot.report;
2878
+ const surfaces = [
2879
+ createSurface("audit", report?.summary.audit),
2880
+ createSurface("trace", report?.summary.trace)
2881
+ ];
2882
+ const hasWarnings = surfaces.some((surface) => surface.status === "warn");
2883
+ return {
2884
+ description: options.description ?? DEFAULT_DESCRIPTION,
2885
+ error: snapshot.error,
2886
+ actionError: snapshot.actionError,
2887
+ actionStatus: snapshot.actionStatus,
2888
+ isLoading: snapshot.isLoading,
2889
+ isRunning: Boolean(report?.isRunning),
2890
+ label: snapshot.error ? "Unavailable" : report ? report.isRunning ? "Running" : "Stopped" : "Checking",
2891
+ status: snapshot.error ? "error" : report ? hasWarnings ? "warn" : "pass" : "loading",
2892
+ surfaces,
2893
+ title: options.title ?? DEFAULT_TITLE,
2894
+ updatedAt: snapshot.updatedAt
2895
+ };
2896
+ };
2897
+ var renderVoiceDeliveryRuntimeHTML = (snapshot, options = {}) => {
2898
+ const model = createVoiceDeliveryRuntimeViewModel(snapshot, options);
2899
+ const surfaces = model.surfaces.map((surface) => `<li class="absolute-voice-delivery-runtime__surface absolute-voice-delivery-runtime__surface--${escapeHtml(surface.status)}">
2900
+ <span>${escapeHtml(surface.label)}</span>
2901
+ <strong>${escapeHtml(surface.detail)}</strong>
2902
+ <small>${String(surface.failed)} failed &middot; ${String(surface.deadLettered)} dead-lettered</small>
2903
+ </li>`).join("");
2904
+ const actions = options.includeActions === false ? "" : `<div class="absolute-voice-delivery-runtime__actions">
2905
+ <button type="button" data-absolute-voice-delivery-runtime-action="tick">${model.actionStatus === "running" ? "Working..." : "Tick workers"}</button>
2906
+ <button type="button" data-absolute-voice-delivery-runtime-action="requeue-dead-letters"${model.surfaces.some((surface) => surface.deadLettered > 0) ? "" : " disabled"}>Requeue dead letters</button>
2907
+ </div>`;
2908
+ const actionError = model.actionError ? `<p class="absolute-voice-delivery-runtime__error">${escapeHtml(model.actionError)}</p>` : "";
2909
+ return `<section class="absolute-voice-delivery-runtime absolute-voice-delivery-runtime--${escapeHtml(model.status)}">
2910
+ <header class="absolute-voice-delivery-runtime__header">
2911
+ <span class="absolute-voice-delivery-runtime__eyebrow">${escapeHtml(model.title)}</span>
2912
+ <strong class="absolute-voice-delivery-runtime__label">${escapeHtml(model.label)}</strong>
2913
+ </header>
2914
+ <p class="absolute-voice-delivery-runtime__description">${escapeHtml(model.description)}</p>
2915
+ <ul class="absolute-voice-delivery-runtime__surfaces">${surfaces}</ul>
2916
+ ${actions}
2917
+ ${actionError}
2918
+ ${model.error ? `<p class="absolute-voice-delivery-runtime__error">${escapeHtml(model.error)}</p>` : ""}
2919
+ </section>`;
2920
+ };
2921
+ var getVoiceDeliveryRuntimeCSS = () => `.absolute-voice-delivery-runtime{border:1px solid #c9d8cf;border-radius:20px;background:#f6fff9;color:#0d1b12;padding:18px;box-shadow:0 18px 40px rgba(19,55,35,.12);font-family:inherit}.absolute-voice-delivery-runtime--warn,.absolute-voice-delivery-runtime--error{border-color:#f2b56b;background:#fff9ed}.absolute-voice-delivery-runtime__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-delivery-runtime__eyebrow{color:#4e6b59;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-delivery-runtime__label{font-size:28px;line-height:1}.absolute-voice-delivery-runtime__description{color:#33483b;margin:12px 0 0}.absolute-voice-delivery-runtime__surfaces{display:grid;gap:8px;list-style:none;margin:16px 0 0;padding:0}.absolute-voice-delivery-runtime__surface{background:#fff;border:1px solid #d9eadf;border-radius:14px;display:grid;gap:4px;padding:10px 12px}.absolute-voice-delivery-runtime__surface--warn{border-color:#f2b56b}.absolute-voice-delivery-runtime__surface--disabled{opacity:.72}.absolute-voice-delivery-runtime__surface span,.absolute-voice-delivery-runtime__surface small{color:#587063}.absolute-voice-delivery-runtime__actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.absolute-voice-delivery-runtime__actions button{background:#134e2d;border:0;border-radius:999px;color:#f6fff9;cursor:pointer;font:inherit;font-weight:800;padding:8px 12px}.absolute-voice-delivery-runtime__actions button:disabled{cursor:not-allowed;opacity:.48}.absolute-voice-delivery-runtime__error{color:#9f1239;font-weight:700}`;
2922
+ var mountVoiceDeliveryRuntime = (element, path = "/api/voice-delivery-runtime", options = {}) => {
2923
+ const store = createVoiceDeliveryRuntimeStore(path, options);
2924
+ const render = () => {
2925
+ element.innerHTML = renderVoiceDeliveryRuntimeHTML(store.getSnapshot(), options);
2926
+ };
2927
+ const unsubscribe = store.subscribe(render);
2928
+ const handleClick = (event) => {
2929
+ const target = event.target;
2930
+ if (!(target instanceof Element)) {
2931
+ return;
2932
+ }
2933
+ const action = target.closest("[data-absolute-voice-delivery-runtime-action]");
2934
+ const actionName = action?.getAttribute("data-absolute-voice-delivery-runtime-action");
2935
+ if (actionName === "tick") {
2936
+ store.tick().catch(() => {});
2937
+ }
2938
+ if (actionName === "requeue-dead-letters") {
2939
+ store.requeueDeadLetters().catch(() => {});
2940
+ }
2941
+ };
2942
+ element.addEventListener?.("click", handleClick);
2943
+ render();
2944
+ store.refresh().catch(() => {});
2945
+ return {
2946
+ close: () => {
2947
+ element.removeEventListener?.("click", handleClick);
2948
+ unsubscribe();
2949
+ store.close();
2950
+ },
2951
+ refresh: store.refresh
2952
+ };
2953
+ };
2954
+ var defineVoiceDeliveryRuntimeElement = (tagName = "absolute-voice-delivery-runtime") => {
2955
+ if (typeof window === "undefined" || typeof customElements === "undefined" || customElements.get(tagName)) {
2956
+ return;
2957
+ }
2958
+ customElements.define(tagName, class AbsoluteVoiceDeliveryRuntimeElement extends HTMLElement {
2959
+ mounted;
2960
+ connectedCallback() {
2961
+ const intervalMs = Number(this.getAttribute("interval-ms") ?? 5000);
2962
+ this.mounted = mountVoiceDeliveryRuntime(this, this.getAttribute("path") ?? "/api/voice-delivery-runtime", {
2963
+ description: this.getAttribute("description") ?? undefined,
2964
+ intervalMs: Number.isFinite(intervalMs) ? intervalMs : 5000,
2965
+ title: this.getAttribute("title") ?? undefined
2966
+ });
2967
+ }
2968
+ disconnectedCallback() {
2969
+ this.mounted?.close();
2970
+ this.mounted = undefined;
2971
+ }
2972
+ });
2973
+ };
2974
+
2975
+ // src/angular/voice-delivery-runtime.component.ts
2976
+ var _dec = [
2977
+ Component({
2978
+ selector: "absolute-voice-delivery-runtime",
2979
+ standalone: true,
2980
+ template: `
2981
+ <section
2982
+ class="absolute-voice-delivery-runtime"
2983
+ [class.absolute-voice-delivery-runtime--pass]="model().status === 'pass'"
2984
+ [class.absolute-voice-delivery-runtime--warn]="model().status === 'warn'"
2985
+ [class.absolute-voice-delivery-runtime--loading]="
2986
+ model().status === 'loading'
2987
+ "
2988
+ [class.absolute-voice-delivery-runtime--error]="
2989
+ model().status === 'error'
2990
+ "
2991
+ >
2992
+ <header class="absolute-voice-delivery-runtime__header">
2993
+ <span class="absolute-voice-delivery-runtime__eyebrow">{{
2994
+ model().title
2995
+ }}</span>
2996
+ <strong class="absolute-voice-delivery-runtime__label">{{
2997
+ model().label
2998
+ }}</strong>
2999
+ </header>
3000
+ <p class="absolute-voice-delivery-runtime__description">
3001
+ {{ model().description }}
3002
+ </p>
3003
+ <ul class="absolute-voice-delivery-runtime__surfaces">
3004
+ @for (surface of model().surfaces; track surface.id) {
3005
+ <li
3006
+ class="absolute-voice-delivery-runtime__surface"
3007
+ [class.absolute-voice-delivery-runtime__surface--pass]="
3008
+ surface.status === 'pass'
3009
+ "
3010
+ [class.absolute-voice-delivery-runtime__surface--warn]="
3011
+ surface.status === 'warn'
3012
+ "
3013
+ [class.absolute-voice-delivery-runtime__surface--disabled]="
3014
+ surface.status === 'disabled'
3015
+ "
3016
+ >
3017
+ <span>{{ surface.label }}</span>
3018
+ <strong>{{ surface.detail }}</strong>
3019
+ <small
3020
+ >{{ surface.failed }} failed /
3021
+ {{ surface.deadLettered }} dead-lettered</small
3022
+ >
3023
+ </li>
3024
+ }
3025
+ </ul>
3026
+ <div class="absolute-voice-delivery-runtime__actions">
3027
+ <button
3028
+ type="button"
3029
+ [disabled]="model().actionStatus === 'running'"
3030
+ (click)="tick()"
3031
+ >
3032
+ {{ model().actionStatus === "running" ? "Working..." : "Tick workers" }}
3033
+ </button>
3034
+ <button
3035
+ type="button"
3036
+ [disabled]="
3037
+ model().actionStatus === 'running' || deadLettered() === 0
3038
+ "
3039
+ (click)="requeueDeadLetters()"
3040
+ >
3041
+ Requeue dead letters
3042
+ </button>
3043
+ </div>
3044
+ @if (model().actionError) {
3045
+ <p class="absolute-voice-delivery-runtime__error">
3046
+ {{ model().actionError }}
3047
+ </p>
3048
+ }
3049
+ @if (model().error) {
3050
+ <p class="absolute-voice-delivery-runtime__error">
3051
+ {{ model().error }}
3052
+ </p>
3053
+ }
3054
+ </section>
3055
+ `
3056
+ })
3057
+ ];
3058
+ var _dec2 = [
3059
+ Input()
3060
+ ];
3061
+ var _dec3 = [
3062
+ Input()
3063
+ ];
3064
+ var _dec4 = [
3065
+ Input()
3066
+ ];
3067
+ var _dec5 = [
3068
+ Input()
3069
+ ];
3070
+ var _init = __decoratorStart(undefined);
3071
+
3072
+ class VoiceDeliveryRuntimeComponent {
3073
+ constructor() {
3074
+ this.description = __runInitializers(_init, 8, this);
3075
+ __runInitializers(_init, 11, this);
3076
+ this.intervalMs = __runInitializers(_init, 12, this);
3077
+ __runInitializers(_init, 15, this);
3078
+ this.path = __runInitializers(_init, 16, this, "/api/voice-delivery-runtime");
3079
+ __runInitializers(_init, 19, this);
3080
+ this.title = __runInitializers(_init, 20, this);
3081
+ __runInitializers(_init, 23, this);
3082
+ }
3083
+ cleanup = () => {};
3084
+ store;
3085
+ model = signal13(createVoiceDeliveryRuntimeViewModel({
3086
+ actionError: null,
3087
+ actionStatus: "idle",
3088
+ error: null,
3089
+ isLoading: true
3090
+ }));
3091
+ ngOnInit() {
3092
+ const options = this.options();
3093
+ this.store = createVoiceDeliveryRuntimeStore(this.path, options);
3094
+ const sync = () => {
3095
+ this.model.set(createVoiceDeliveryRuntimeViewModel(this.store.getSnapshot(), options));
3096
+ };
3097
+ this.cleanup = this.store.subscribe(sync);
3098
+ sync();
3099
+ if (typeof window !== "undefined") {
3100
+ this.store.refresh().catch(() => {});
3101
+ }
3102
+ }
3103
+ ngOnDestroy() {
3104
+ this.cleanup();
3105
+ this.store?.close();
3106
+ }
3107
+ deadLettered() {
3108
+ return this.model().surfaces.reduce((total, surface) => total + surface.deadLettered, 0);
3109
+ }
3110
+ tick() {
3111
+ this.store?.tick().catch(() => {});
3112
+ }
3113
+ requeueDeadLetters() {
3114
+ this.store?.requeueDeadLetters().catch(() => {});
3115
+ }
3116
+ options() {
3117
+ return {
3118
+ description: this.description,
3119
+ intervalMs: this.intervalMs,
3120
+ title: this.title
3121
+ };
3122
+ }
3123
+ }
3124
+ __decorateElement(_init, 5, "description", _dec2, VoiceDeliveryRuntimeComponent);
3125
+ __decorateElement(_init, 5, "intervalMs", _dec3, VoiceDeliveryRuntimeComponent);
3126
+ __decorateElement(_init, 5, "path", _dec4, VoiceDeliveryRuntimeComponent);
3127
+ __decorateElement(_init, 5, "title", _dec5, VoiceDeliveryRuntimeComponent);
3128
+ VoiceDeliveryRuntimeComponent = __decorateElement(_init, 0, "VoiceDeliveryRuntimeComponent", _dec, VoiceDeliveryRuntimeComponent);
3129
+ __runInitializers(_init, 1, VoiceDeliveryRuntimeComponent);
3130
+ __decoratorMetadata(_init, VoiceDeliveryRuntimeComponent);
3131
+ let _VoiceDeliveryRuntimeComponent = VoiceDeliveryRuntimeComponent;
2654
3132
  export {
2655
3133
  VoiceWorkflowStatusService,
2656
3134
  VoiceTurnQualityService,
@@ -2661,6 +3139,8 @@ export {
2661
3139
  VoiceProviderStatusService,
2662
3140
  VoiceProviderCapabilitiesService,
2663
3141
  VoiceOpsStatusService,
3142
+ VoiceDeliveryRuntimeService,
3143
+ VoiceDeliveryRuntimeComponent,
2664
3144
  VoiceControllerService,
2665
3145
  VoiceCampaignDialerProofService
2666
3146
  };