@signalwire/js 4.0.0-beta.0 → 4.0.0-beta.2

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/browser.mjs CHANGED
@@ -6685,7 +6685,7 @@ var require_share = /* @__PURE__ */ __commonJSMin(((exports) => {
6685
6685
  var Subject_1$6 = require_Subject();
6686
6686
  var Subscriber_1$1 = require_Subscriber();
6687
6687
  var lift_1$19 = require_lift();
6688
- function share$1(options) {
6688
+ function share$3(options) {
6689
6689
  if (options === void 0) options = {};
6690
6690
  var _a = options.connector, connector = _a === void 0 ? function() {
6691
6691
  return new Subject_1$6.Subject();
@@ -6743,7 +6743,7 @@ var require_share = /* @__PURE__ */ __commonJSMin(((exports) => {
6743
6743
  })(wrapperSource);
6744
6744
  };
6745
6745
  }
6746
- exports.share = share$1;
6746
+ exports.share = share$3;
6747
6747
  function handleReset(reset, on) {
6748
6748
  var args = [];
6749
6749
  for (var _i = 2; _i < arguments.length; _i++) args[_i - 2] = arguments[_i];
@@ -8941,11 +8941,21 @@ var Destroyable = class {
8941
8941
  this._destroyed$ = new import_cjs$22.Subject();
8942
8942
  }
8943
8943
  destroy() {
8944
+ this._observableCache?.clear();
8944
8945
  this.subscriptions.forEach((sub) => sub.unsubscribe());
8945
8946
  this.subjects.forEach((subject) => subject.complete());
8946
8947
  this._destroyed$.next();
8947
8948
  this._destroyed$.complete();
8948
8949
  }
8950
+ cachedObservable(key, factory) {
8951
+ this._observableCache ??= /* @__PURE__ */ new Map();
8952
+ let cached = this._observableCache.get(key);
8953
+ if (!cached) {
8954
+ cached = factory();
8955
+ this._observableCache.set(key, cached);
8956
+ }
8957
+ return cached;
8958
+ }
8949
8959
  subscribeTo(observable, observerOrNext) {
8950
8960
  const subscription = observable.subscribe(observerOrNext);
8951
8961
  this.subscriptions.push(subscription);
@@ -8966,7 +8976,7 @@ var Destroyable = class {
8966
8976
  return subject;
8967
8977
  }
8968
8978
  get $() {
8969
- return (0, import_cjs$22.merge)(...this.subjects.map((s) => s instanceof import_cjs$22.BehaviorSubject ? s.pipe((0, import_cjs$22.skip)(1)) : s)).pipe((0, import_cjs$22.map)((_) => this));
8979
+ return this.cachedObservable("$", () => (0, import_cjs$22.merge)(...this.subjects.map((s) => s instanceof import_cjs$22.BehaviorSubject ? s.pipe((0, import_cjs$22.skip)(1)) : s)).pipe((0, import_cjs$22.map)((_) => this)));
8970
8980
  }
8971
8981
  /**
8972
8982
  * Observable that emits when the instance is destroyed
@@ -9979,25 +9989,25 @@ var NavigatorDeviceController = class extends Destroyable {
9979
9989
  return {};
9980
9990
  }
9981
9991
  get errors$() {
9982
- return this._errors$.asObservable().pipe((0, import_cjs$20.takeUntil)(this.destroyed$));
9992
+ return this.cachedObservable("errors$", () => this._errors$.asObservable().pipe((0, import_cjs$20.takeUntil)(this.destroyed$)));
9983
9993
  }
9984
9994
  get audioInputDevices$() {
9985
- return this._devicesState$.pipe((0, import_cjs$20.map)((state) => state.audioinput), (0, import_cjs$20.distinctUntilChanged)(), (0, import_cjs$20.takeUntil)(this.destroyed$));
9995
+ return this.cachedObservable("audioInputDevices$", () => this._devicesState$.pipe((0, import_cjs$20.map)((state) => state.audioinput), (0, import_cjs$20.distinctUntilChanged)(), (0, import_cjs$20.takeUntil)(this.destroyed$)));
9986
9996
  }
9987
9997
  get audioOutputDevices$() {
9988
- return this._devicesState$.pipe((0, import_cjs$20.map)((state) => state.audiooutput), (0, import_cjs$20.distinctUntilChanged)(), (0, import_cjs$20.takeUntil)(this.destroyed$));
9998
+ return this.cachedObservable("audioOutputDevices$", () => this._devicesState$.pipe((0, import_cjs$20.map)((state) => state.audiooutput), (0, import_cjs$20.distinctUntilChanged)(), (0, import_cjs$20.takeUntil)(this.destroyed$)));
9989
9999
  }
9990
10000
  get videoInputDevices$() {
9991
- return this._devicesState$.pipe((0, import_cjs$20.map)((state) => state.videoinput), (0, import_cjs$20.distinctUntilChanged)(), (0, import_cjs$20.takeUntil)(this.destroyed$));
10001
+ return this.cachedObservable("videoInputDevices$", () => this._devicesState$.pipe((0, import_cjs$20.map)((state) => state.videoinput), (0, import_cjs$20.distinctUntilChanged)(), (0, import_cjs$20.takeUntil)(this.destroyed$)));
9992
10002
  }
9993
10003
  get selectedAudioInputDevice$() {
9994
- return this._selectedDevicesState$.asObservable().pipe((0, import_cjs$20.map)((state) => state.audioinput), (0, import_cjs$20.distinctUntilChanged)(), (0, import_cjs$20.takeUntil)(this.destroyed$), (0, import_cjs$20.tap)((info) => logger$19.debug("[DeviceController] Selected audio input device changed:", info)));
10004
+ return this.cachedObservable("selectedAudioInputDevice$", () => this._selectedDevicesState$.asObservable().pipe((0, import_cjs$20.map)((state) => state.audioinput), (0, import_cjs$20.distinctUntilChanged)(), (0, import_cjs$20.takeUntil)(this.destroyed$), (0, import_cjs$20.tap)((info) => logger$19.debug("[DeviceController] Selected audio input device changed:", info))));
9995
10005
  }
9996
10006
  get selectedAudioOutputDevice$() {
9997
- return this._selectedDevicesState$.asObservable().pipe((0, import_cjs$20.map)((state) => state.audiooutput), (0, import_cjs$20.distinctUntilChanged)(), (0, import_cjs$20.takeUntil)(this.destroyed$), (0, import_cjs$20.tap)((info) => logger$19.debug("[DeviceController] Selected audio output device changed:", info)));
10007
+ return this.cachedObservable("selectedAudioOutputDevice$", () => this._selectedDevicesState$.asObservable().pipe((0, import_cjs$20.map)((state) => state.audiooutput), (0, import_cjs$20.distinctUntilChanged)(), (0, import_cjs$20.takeUntil)(this.destroyed$), (0, import_cjs$20.tap)((info) => logger$19.debug("[DeviceController] Selected audio output device changed:", info))));
9998
10008
  }
9999
10009
  get selectedVideoInputDevice$() {
10000
- return this._selectedDevicesState$.asObservable().pipe((0, import_cjs$20.map)((state) => state.videoinput), (0, import_cjs$20.distinctUntilChanged)(), (0, import_cjs$20.takeUntil)(this.destroyed$), (0, import_cjs$20.tap)((info) => logger$19.debug("[DeviceController] Selected video input device changed:", info)));
10010
+ return this.cachedObservable("selectedVideoInputDevice$", () => this._selectedDevicesState$.asObservable().pipe((0, import_cjs$20.map)((state) => state.videoinput), (0, import_cjs$20.distinctUntilChanged)(), (0, import_cjs$20.takeUntil)(this.destroyed$), (0, import_cjs$20.tap)((info) => logger$19.debug("[DeviceController] Selected video input device changed:", info))));
10001
10011
  }
10002
10012
  get selectedAudioInputDevice() {
10003
10013
  return this._selectedDevicesState$.value.audioinput;
@@ -11658,7 +11668,7 @@ var SelfCapabilities = class extends Destroyable {
11658
11668
  }
11659
11669
  /** Observable for self member capabilities */
11660
11670
  get self$() {
11661
- return this._state$.pipe((0, import_cjs$17.map)((state) => state.self), (0, import_cjs$17.distinctUntilChanged)());
11671
+ return this.cachedObservable("self$", () => this._state$.pipe((0, import_cjs$17.map)((state) => state.self), (0, import_cjs$17.distinctUntilChanged)()));
11662
11672
  }
11663
11673
  /** Current self member capabilities */
11664
11674
  get self() {
@@ -11666,7 +11676,7 @@ var SelfCapabilities = class extends Destroyable {
11666
11676
  }
11667
11677
  /** Observable for other member capabilities */
11668
11678
  get member$() {
11669
- return this._state$.pipe((0, import_cjs$17.map)((state) => state.member), (0, import_cjs$17.distinctUntilChanged)());
11679
+ return this.cachedObservable("member$", () => this._state$.pipe((0, import_cjs$17.map)((state) => state.member), (0, import_cjs$17.distinctUntilChanged)()));
11670
11680
  }
11671
11681
  /** Current other member capabilities */
11672
11682
  get member() {
@@ -11674,7 +11684,7 @@ var SelfCapabilities = class extends Destroyable {
11674
11684
  }
11675
11685
  /** Observable for end call capability */
11676
11686
  get end$() {
11677
- return this._state$.pipe((0, import_cjs$17.map)((state) => state.end), (0, import_cjs$17.distinctUntilChanged)());
11687
+ return this.cachedObservable("end$", () => this._state$.pipe((0, import_cjs$17.map)((state) => state.end), (0, import_cjs$17.distinctUntilChanged)()));
11678
11688
  }
11679
11689
  /** Current end call capability */
11680
11690
  get end() {
@@ -11682,7 +11692,7 @@ var SelfCapabilities = class extends Destroyable {
11682
11692
  }
11683
11693
  /** Observable for set layout capability */
11684
11694
  get setLayout$() {
11685
- return this._state$.pipe((0, import_cjs$17.map)((state) => state.setLayout), (0, import_cjs$17.distinctUntilChanged)());
11695
+ return this.cachedObservable("setLayout$", () => this._state$.pipe((0, import_cjs$17.map)((state) => state.setLayout), (0, import_cjs$17.distinctUntilChanged)()));
11686
11696
  }
11687
11697
  /** Current set layout capability */
11688
11698
  get setLayout() {
@@ -11690,7 +11700,7 @@ var SelfCapabilities = class extends Destroyable {
11690
11700
  }
11691
11701
  /** Observable for send digit capability */
11692
11702
  get sendDigit$() {
11693
- return this._state$.pipe((0, import_cjs$17.map)((state) => state.sendDigit), (0, import_cjs$17.distinctUntilChanged)());
11703
+ return this.cachedObservable("sendDigit$", () => this._state$.pipe((0, import_cjs$17.map)((state) => state.sendDigit), (0, import_cjs$17.distinctUntilChanged)()));
11694
11704
  }
11695
11705
  /** Current send digit capability */
11696
11706
  get sendDigit() {
@@ -11698,7 +11708,7 @@ var SelfCapabilities = class extends Destroyable {
11698
11708
  }
11699
11709
  /** Observable for vmuted hide capability */
11700
11710
  get vmutedHide$() {
11701
- return this._state$.pipe((0, import_cjs$17.map)((state) => state.vmutedHide), (0, import_cjs$17.distinctUntilChanged)());
11711
+ return this.cachedObservable("vmutedHide$", () => this._state$.pipe((0, import_cjs$17.map)((state) => state.vmutedHide), (0, import_cjs$17.distinctUntilChanged)()));
11702
11712
  }
11703
11713
  /** Current vmuted hide capability */
11704
11714
  get vmutedHide() {
@@ -11706,7 +11716,7 @@ var SelfCapabilities = class extends Destroyable {
11706
11716
  }
11707
11717
  /** Observable for lock capability */
11708
11718
  get lock$() {
11709
- return this._state$.pipe((0, import_cjs$17.map)((state) => state.lock), (0, import_cjs$17.distinctUntilChanged)());
11719
+ return this.cachedObservable("lock$", () => this._state$.pipe((0, import_cjs$17.map)((state) => state.lock), (0, import_cjs$17.distinctUntilChanged)()));
11710
11720
  }
11711
11721
  /** Current lock capability */
11712
11722
  get lock() {
@@ -11714,7 +11724,7 @@ var SelfCapabilities = class extends Destroyable {
11714
11724
  }
11715
11725
  /** Observable for device capability */
11716
11726
  get device$() {
11717
- return this._state$.pipe((0, import_cjs$17.map)((state) => state.device), (0, import_cjs$17.distinctUntilChanged)());
11727
+ return this.cachedObservable("device$", () => this._state$.pipe((0, import_cjs$17.map)((state) => state.device), (0, import_cjs$17.distinctUntilChanged)()));
11718
11728
  }
11719
11729
  /** Current device capability */
11720
11730
  get device() {
@@ -11722,7 +11732,7 @@ var SelfCapabilities = class extends Destroyable {
11722
11732
  }
11723
11733
  /** Observable for screenshare capability */
11724
11734
  get screenshare$() {
11725
- return this._state$.pipe((0, import_cjs$17.map)((state) => state.screenshare), (0, import_cjs$17.distinctUntilChanged)());
11735
+ return this.cachedObservable("screenshare$", () => this._state$.pipe((0, import_cjs$17.map)((state) => state.screenshare), (0, import_cjs$17.distinctUntilChanged)()));
11726
11736
  }
11727
11737
  /** Current screenshare capability */
11728
11738
  get screenshare() {
@@ -11775,83 +11785,83 @@ var Participant = class extends Destroyable {
11775
11785
  }
11776
11786
  /** Observable of the participant's display name. */
11777
11787
  get name$() {
11778
- return this._state$.pipe((0, import_operators$1.map)((state) => state.name), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11788
+ return this.cachedObservable("name$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.name), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11779
11789
  }
11780
11790
  /** Observable of the participant type (e.g. `'member'`, `'screen'`). */
11781
11791
  get type$() {
11782
- return this._state$.pipe((0, import_operators$1.map)((state) => state.type), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11792
+ return this.cachedObservable("type$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.type), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11783
11793
  }
11784
11794
  /** Observable indicating whether the participant has raised their hand. */
11785
11795
  get handraised$() {
11786
- return this._state$.pipe((0, import_operators$1.map)((state) => state.handraised), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11796
+ return this.cachedObservable("handraised$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.handraised), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11787
11797
  }
11788
11798
  /** Observable indicating whether the participant is visible in the layout. */
11789
11799
  get visible$() {
11790
- return this._state$.pipe((0, import_operators$1.map)((state) => state.visible), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11800
+ return this.cachedObservable("visible$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.visible), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11791
11801
  }
11792
11802
  /** Observable indicating whether the participant's audio is muted. */
11793
11803
  get audioMuted$() {
11794
- return this._state$.pipe((0, import_operators$1.map)((state) => state.audio_muted), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11804
+ return this.cachedObservable("audioMuted$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.audio_muted), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11795
11805
  }
11796
11806
  /** Observable indicating whether the participant's video is muted. */
11797
11807
  get videoMuted$() {
11798
- return this._state$.pipe((0, import_operators$1.map)((state) => state.video_muted), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11808
+ return this.cachedObservable("videoMuted$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.video_muted), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11799
11809
  }
11800
11810
  /** Observable indicating whether the participant is deafened. */
11801
11811
  get deaf$() {
11802
- return this._state$.pipe((0, import_operators$1.map)((state) => state.deaf), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11812
+ return this.cachedObservable("deaf$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.deaf), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11803
11813
  }
11804
11814
  /** Observable of the participant's microphone input volume. */
11805
11815
  get inputVolume$() {
11806
- return this._state$.pipe((0, import_operators$1.map)((state) => state.input_volume), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11816
+ return this.cachedObservable("inputVolume$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.input_volume), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11807
11817
  }
11808
11818
  /** Observable of the participant's speaker output volume. */
11809
11819
  get outputVolume$() {
11810
- return this._state$.pipe((0, import_operators$1.map)((state) => state.output_volume), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11820
+ return this.cachedObservable("outputVolume$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.output_volume), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11811
11821
  }
11812
11822
  /** Observable of the microphone input sensitivity level. */
11813
11823
  get inputSensitivity$() {
11814
- return this._state$.pipe((0, import_operators$1.map)((state) => state.input_sensitivity), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11824
+ return this.cachedObservable("inputSensitivity$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.input_sensitivity), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11815
11825
  }
11816
11826
  /** Observable indicating whether echo cancellation is enabled. */
11817
11827
  get echoCancellation$() {
11818
- return this._state$.pipe((0, import_operators$1.map)((state) => state.echo_cancellation), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11828
+ return this.cachedObservable("echoCancellation$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.echo_cancellation), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11819
11829
  }
11820
11830
  /** Observable indicating whether auto-gain control is enabled. */
11821
11831
  get autoGain$() {
11822
- return this._state$.pipe((0, import_operators$1.map)((state) => state.auto_gain), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11832
+ return this.cachedObservable("autoGain$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.auto_gain), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11823
11833
  }
11824
11834
  /** Observable indicating whether noise suppression is enabled. */
11825
11835
  get noiseSuppression$() {
11826
- return this._state$.pipe((0, import_operators$1.map)((state) => state.noise_suppression), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11836
+ return this.cachedObservable("noiseSuppression$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.noise_suppression), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11827
11837
  }
11828
11838
  /** Observable indicating whether low-bitrate mode is active. */
11829
11839
  get lowbitrate$() {
11830
- return this._state$.pipe((0, import_operators$1.map)((state) => state.lowbitrate), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11840
+ return this.cachedObservable("lowbitrate$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.lowbitrate), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11831
11841
  }
11832
11842
  /** Observable indicating whether noise reduction is active. */
11833
11843
  get denoise$() {
11834
- return this._state$.pipe((0, import_operators$1.map)((state) => state.denoise), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11844
+ return this.cachedObservable("denoise$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.denoise), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11835
11845
  }
11836
11846
  /** Observable of custom metadata for this participant. */
11837
11847
  get meta$() {
11838
- return this._state$.pipe((0, import_operators$1.map)((state) => state.meta), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11848
+ return this.cachedObservable("meta$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.meta), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11839
11849
  }
11840
11850
  /** Observable of the participant's subscriber ID. */
11841
11851
  get subscriberId$() {
11842
- return this._state$.pipe((0, import_operators$1.map)((state) => state.subscriber_id), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11852
+ return this.cachedObservable("subscriberId$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.subscriber_id), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11843
11853
  }
11844
11854
  /** Observable of the participant's address ID. */
11845
11855
  get addressId$() {
11846
- return this._state$.pipe((0, import_operators$1.map)((state) => state.address_id), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11856
+ return this.cachedObservable("addressId$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.address_id), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11847
11857
  }
11848
11858
  /** Observable of the server node ID for this participant. */
11849
11859
  get nodeId$() {
11850
- return this._state$.pipe((0, import_operators$1.map)((state) => state.node_id), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11860
+ return this.cachedObservable("nodeId$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.node_id), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11851
11861
  }
11852
11862
  /** Observable indicating whether the participant is currently speaking. */
11853
11863
  get isTalking$() {
11854
- return this._state$.pipe((0, import_operators$1.map)((state) => state.talking), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11864
+ return this.cachedObservable("isTalking$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.talking), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11855
11865
  }
11856
11866
  /** Whether the participant is currently speaking. */
11857
11867
  get isTalking() {
@@ -11859,7 +11869,7 @@ var Participant = class extends Destroyable {
11859
11869
  }
11860
11870
  /** Observable of the participant's layout position. */
11861
11871
  get position$() {
11862
- return this._state$.pipe((0, import_operators$1.map)((state) => state.position), (0, import_operators$1.distinctUntilChanged)(), filterNull());
11872
+ return this.cachedObservable("position$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.position), (0, import_operators$1.distinctUntilChanged)(), filterNull()));
11863
11873
  }
11864
11874
  /** Current layout position. */
11865
11875
  get position() {
@@ -12376,10 +12386,10 @@ var CallEventsManager = class extends Destroyable {
12376
12386
  this.initSubscriptions();
12377
12387
  }
12378
12388
  get participants$() {
12379
- return this._participants$.asObservable().pipe((0, import_cjs$14.map)((participantsRecord) => Object.values(participantsRecord)));
12389
+ return this.cachedObservable("participants$", () => this._participants$.asObservable().pipe((0, import_cjs$14.map)((participantsRecord) => Object.values(participantsRecord))));
12380
12390
  }
12381
12391
  get self$() {
12382
- return this._self$.asObservable().pipe(filterNull());
12392
+ return this.cachedObservable("self$", () => this._self$.asObservable().pipe(filterNull()));
12383
12393
  }
12384
12394
  get status$() {
12385
12395
  return this._status$.asObservable();
@@ -12397,40 +12407,40 @@ var CallEventsManager = class extends Destroyable {
12397
12407
  return this.callIds.has(callId);
12398
12408
  }
12399
12409
  get recording$() {
12400
- return this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.recording), (0, import_cjs$14.distinctUntilChanged)(), filterNull());
12410
+ return this.cachedObservable("recording$", () => this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.recording), (0, import_cjs$14.distinctUntilChanged)(), filterNull()));
12401
12411
  }
12402
12412
  get recordings$() {
12403
- return this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.recordings), (0, import_cjs$14.distinctUntilChanged)(), filterNull());
12413
+ return this.cachedObservable("recordings$", () => this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.recordings), (0, import_cjs$14.distinctUntilChanged)(), filterNull()));
12404
12414
  }
12405
12415
  get streaming$() {
12406
- return this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.streaming), (0, import_cjs$14.distinctUntilChanged)(), filterNull());
12416
+ return this.cachedObservable("streaming$", () => this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.streaming), (0, import_cjs$14.distinctUntilChanged)(), filterNull()));
12407
12417
  }
12408
12418
  get streams$() {
12409
- return this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.streams), (0, import_cjs$14.distinctUntilChanged)(), filterNull());
12419
+ return this.cachedObservable("streams$", () => this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.streams), (0, import_cjs$14.distinctUntilChanged)(), filterNull()));
12410
12420
  }
12411
12421
  get playbacks$() {
12412
- return this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.playbacks), (0, import_cjs$14.distinctUntilChanged)(), filterNull());
12422
+ return this.cachedObservable("playbacks$", () => this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.playbacks), (0, import_cjs$14.distinctUntilChanged)(), filterNull()));
12413
12423
  }
12414
12424
  get raiseHandPriority$() {
12415
- return this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.prioritize_handraise), (0, import_cjs$14.distinctUntilChanged)(), filterNull());
12425
+ return this.cachedObservable("raiseHandPriority$", () => this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.prioritize_handraise), (0, import_cjs$14.distinctUntilChanged)(), filterNull()));
12416
12426
  }
12417
12427
  get locked$() {
12418
- return this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.locked), (0, import_cjs$14.distinctUntilChanged)(), filterNull());
12428
+ return this.cachedObservable("locked$", () => this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.locked), (0, import_cjs$14.distinctUntilChanged)(), filterNull()));
12419
12429
  }
12420
12430
  get meta$() {
12421
- return this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.meta), (0, import_cjs$14.distinctUntilChanged)(), filterNull());
12431
+ return this.cachedObservable("meta$", () => this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.meta), (0, import_cjs$14.distinctUntilChanged)(), filterNull()));
12422
12432
  }
12423
12433
  get capabilities$() {
12424
- return this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.capabilities), (0, import_cjs$14.distinctUntilChanged)(), filterNull());
12434
+ return this.cachedObservable("capabilities$", () => this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.capabilities), (0, import_cjs$14.distinctUntilChanged)(), filterNull()));
12425
12435
  }
12426
12436
  get layout$() {
12427
- return this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.layout_name), (0, import_cjs$14.distinctUntilChanged)(), filterNull());
12437
+ return this.cachedObservable("layout$", () => this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.layout_name), (0, import_cjs$14.distinctUntilChanged)(), filterNull()));
12428
12438
  }
12429
12439
  get layouts$() {
12430
- return this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.layouts), (0, import_cjs$14.distinctUntilChanged)(), filterNull());
12440
+ return this.cachedObservable("layouts$", () => this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.layouts), (0, import_cjs$14.distinctUntilChanged)(), filterNull()));
12431
12441
  }
12432
12442
  get layoutLayers$() {
12433
- return this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.layout_layers), (0, import_cjs$14.distinctUntilChanged)(), filterNull());
12443
+ return this.cachedObservable("layoutLayers$", () => this._sessionState$.pipe((0, import_cjs$14.map)((state) => state.layout_layers), (0, import_cjs$14.distinctUntilChanged)(), filterNull()));
12434
12444
  }
12435
12445
  get self() {
12436
12446
  return this._self$.value;
@@ -12566,19 +12576,19 @@ var CallEventsManager = class extends Destroyable {
12566
12576
  this._participants$.next(this._participants$.value);
12567
12577
  }
12568
12578
  get callJoinedEvent$() {
12569
- return this.webRtcCallSession.callEvent$.pipe((0, import_cjs$14.filter)(isCallJoinedPayload), (0, import_cjs$14.tap)((event) => {
12579
+ return this.cachedObservable("callJoinedEvent$", () => this.webRtcCallSession.callEvent$.pipe((0, import_cjs$14.filter)(isCallJoinedPayload), (0, import_cjs$14.tap)((event) => {
12570
12580
  logger$15.debug("[CallEventsManager] Call joined event:", event);
12571
- }));
12581
+ })));
12572
12582
  }
12573
12583
  get layoutChangedEvent$() {
12574
- return this.webRtcCallSession.callEvent$.pipe(filterAs(isLayoutChangedPayload, "layout"), (0, import_cjs$14.tap)((event) => {
12584
+ return this.cachedObservable("layoutChangedEvent$", () => this.webRtcCallSession.callEvent$.pipe(filterAs(isLayoutChangedPayload, "layout"), (0, import_cjs$14.tap)((event) => {
12575
12585
  logger$15.debug("[CallEventsManager] Layout changed event:", event);
12576
- }));
12586
+ })));
12577
12587
  }
12578
12588
  get memberUpdates$() {
12579
- return (0, import_cjs$14.merge)(this.webRtcCallSession.memberJoined$, this.webRtcCallSession.memberUpdated$, this.webRtcCallSession.memberTalking$).pipe((0, import_cjs$14.map)((event) => event.member), (0, import_cjs$14.tap)((event) => {
12589
+ return this.cachedObservable("memberUpdates$", () => (0, import_cjs$14.merge)(this.webRtcCallSession.memberJoined$, this.webRtcCallSession.memberUpdated$, this.webRtcCallSession.memberTalking$).pipe((0, import_cjs$14.map)((event) => event.member), (0, import_cjs$14.tap)((event) => {
12580
12590
  logger$15.debug("[CallEventsManager] Member update event:", event);
12581
- }));
12591
+ })));
12582
12592
  }
12583
12593
  destroy() {
12584
12594
  Object.values(this._participants$.value).forEach((participant) => {
@@ -13309,43 +13319,43 @@ var RTCPeerConnectionController = class extends Destroyable {
13309
13319
  };
13310
13320
  }
13311
13321
  get iceGatheringState$() {
13312
- return this._iceGatheringState$.asObservable().pipe((0, import_cjs$11.takeUntil)(this.destroyed$));
13322
+ return this.cachedObservable("iceGatheringState$", () => this._iceGatheringState$.asObservable().pipe((0, import_cjs$11.takeUntil)(this.destroyed$)));
13313
13323
  }
13314
13324
  get mediaTrackEnded$() {
13315
- return this.localStreamController.mediaTrackEnded$.pipe((0, import_cjs$11.takeUntil)(this.destroyed$));
13325
+ return this.cachedObservable("mediaTrackEnded$", () => this.localStreamController.mediaTrackEnded$.pipe((0, import_cjs$11.takeUntil)(this.destroyed$)));
13316
13326
  }
13317
13327
  get errors$() {
13318
- return this._errors$.asObservable().pipe((0, import_cjs$11.takeUntil)(this.destroyed$));
13328
+ return this.cachedObservable("errors$", () => this._errors$.asObservable().pipe((0, import_cjs$11.takeUntil)(this.destroyed$)));
13319
13329
  }
13320
13330
  get iceCandidates$() {
13321
- return this._iceCandidates$.asObservable().pipe((0, import_cjs$11.takeUntil)(this.destroyed$));
13331
+ return this.cachedObservable("iceCandidates$", () => this._iceCandidates$.asObservable().pipe((0, import_cjs$11.takeUntil)(this.destroyed$)));
13322
13332
  }
13323
13333
  get initialized$() {
13324
- return this._initialized$.asObservable().pipe((0, import_cjs$11.filter)((initialized) => initialized), (0, import_cjs$11.takeUntil)(this.destroyed$));
13334
+ return this.cachedObservable("initialized$", () => this._initialized$.asObservable().pipe((0, import_cjs$11.filter)((initialized) => initialized), (0, import_cjs$11.takeUntil)(this.destroyed$)));
13325
13335
  }
13326
13336
  get remoteDescription$() {
13327
- return this._remoteDescription$.asObservable().pipe((0, import_cjs$11.takeUntil)(this.destroyed$));
13337
+ return this.cachedObservable("remoteDescription$", () => this._remoteDescription$.asObservable().pipe((0, import_cjs$11.takeUntil)(this.destroyed$)));
13328
13338
  }
13329
13339
  get localStream$() {
13330
- return this.localStreamController.localStream$.pipe((0, import_cjs$11.takeUntil)(this.destroyed$));
13340
+ return this.cachedObservable("localStream$", () => this.localStreamController.localStream$.pipe((0, import_cjs$11.takeUntil)(this.destroyed$)));
13331
13341
  }
13332
13342
  get remoteStream$() {
13333
- return this._remoteStream$.asObservable().pipe((0, import_cjs$11.takeUntil)(this.destroyed$));
13343
+ return this.cachedObservable("remoteStream$", () => this._remoteStream$.asObservable().pipe((0, import_cjs$11.takeUntil)(this.destroyed$)));
13334
13344
  }
13335
13345
  get localAudioTracks$() {
13336
- return this.localStreamController.localAudioTracks$.pipe((0, import_cjs$11.takeUntil)(this.destroyed$));
13346
+ return this.cachedObservable("localAudioTracks$", () => this.localStreamController.localAudioTracks$.pipe((0, import_cjs$11.takeUntil)(this.destroyed$)));
13337
13347
  }
13338
13348
  get localVideoTracks$() {
13339
- return this.localStreamController.localVideoTracks$.pipe((0, import_cjs$11.takeUntil)(this.destroyed$));
13349
+ return this.cachedObservable("localVideoTracks$", () => this.localStreamController.localVideoTracks$.pipe((0, import_cjs$11.takeUntil)(this.destroyed$)));
13340
13350
  }
13341
13351
  get iceConnectionState$() {
13342
- return this._iceConnectionState$.asObservable().pipe((0, import_cjs$11.takeUntil)(this.destroyed$));
13352
+ return this.cachedObservable("iceConnectionState$", () => this._iceConnectionState$.asObservable().pipe((0, import_cjs$11.takeUntil)(this.destroyed$)));
13343
13353
  }
13344
13354
  get connectionState$() {
13345
- return this._connectionState$.asObservable().pipe((0, import_cjs$11.takeUntil)(this.destroyed$));
13355
+ return this.cachedObservable("connectionState$", () => this._connectionState$.asObservable().pipe((0, import_cjs$11.takeUntil)(this.destroyed$)));
13346
13356
  }
13347
13357
  get signalingState$() {
13348
- return this._signalingState$.asObservable().pipe((0, import_cjs$11.takeUntil)(this.destroyed$));
13358
+ return this.cachedObservable("signalingState$", () => this._signalingState$.asObservable().pipe((0, import_cjs$11.takeUntil)(this.destroyed$)));
13349
13359
  }
13350
13360
  get type() {
13351
13361
  return this._type;
@@ -13924,11 +13934,11 @@ var WebRTCVertoManager = class extends VertoManager {
13924
13934
  return rtcPeerConnection;
13925
13935
  }
13926
13936
  get signalingStatus$() {
13927
- return (0, import_cjs$10.merge)(this._signalingStatus$.pipe(filterNull()), this.mainPeerConnection.connectionState$.pipe((0, import_cjs$10.filter)((connectionState) => [
13937
+ return this.cachedObservable("signalingStatus$", () => (0, import_cjs$10.merge)(this._signalingStatus$.pipe(filterNull()), this.mainPeerConnection.connectionState$.pipe((0, import_cjs$10.filter)((connectionState) => [
13928
13938
  "connected",
13929
13939
  "disconnected",
13930
13940
  "failed"
13931
- ].includes(connectionState))));
13941
+ ].includes(connectionState)))));
13932
13942
  }
13933
13943
  initSubscriptions() {
13934
13944
  this.subscribeTo(this.vertoAnswer$, (event) => {
@@ -13976,19 +13986,19 @@ var WebRTCVertoManager = class extends VertoManager {
13976
13986
  return this._selfId$.value;
13977
13987
  }
13978
13988
  get vertoAnswer$() {
13979
- return this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoAnswerInnerParams, "params"), (0, import_cjs$10.takeUntil)(this.destroyed$));
13989
+ return this.cachedObservable("vertoAnswer$", () => this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoAnswerInnerParams, "params"), (0, import_cjs$10.takeUntil)(this.destroyed$)));
13980
13990
  }
13981
13991
  get vertoMediaParams$() {
13982
- return this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoMediaParamsInnerParams, "params"), (0, import_cjs$10.takeUntil)(this.destroyed$));
13992
+ return this.cachedObservable("vertoMediaParams$", () => this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoMediaParamsInnerParams, "params"), (0, import_cjs$10.takeUntil)(this.destroyed$)));
13983
13993
  }
13984
13994
  get vertoBye$() {
13985
- return this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoByeMessage, "params"), (0, import_cjs$10.takeUntil)(this.destroyed$));
13995
+ return this.cachedObservable("vertoBye$", () => this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoByeMessage, "params"), (0, import_cjs$10.takeUntil)(this.destroyed$)));
13986
13996
  }
13987
13997
  get vertoAttach$() {
13988
- return this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoAttachMessage, "params"), (0, import_cjs$10.takeUntil)(this.destroyed$));
13998
+ return this.cachedObservable("vertoAttach$", () => this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoAttachMessage, "params"), (0, import_cjs$10.takeUntil)(this.destroyed$)));
13989
13999
  }
13990
14000
  get vertoPing$() {
13991
- return this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoPingInnerParams, "params"), (0, import_cjs$10.takeUntil)(this.destroyed$));
14001
+ return this.cachedObservable("vertoPing$", () => this.webRtcCallSession.webrtcMessages$.pipe(filterAs(isVertoPingInnerParams, "params"), (0, import_cjs$10.takeUntil)(this.destroyed$)));
13992
14002
  }
13993
14003
  async executeVerto(message, optionals = {}) {
13994
14004
  const webrtcVertoMessage = WebrtcVerto({
@@ -14550,7 +14560,7 @@ var WebRTCCall = class extends Destroyable {
14550
14560
  }
14551
14561
  /** Observable of the current call status (e.g. `'ringing'`, `'connected'`). */
14552
14562
  get status$() {
14553
- return (0, import_cjs$9.merge)(this._status$.asObservable(), this.vertoManager.signalingStatus$);
14563
+ return this.cachedObservable("status$", () => (0, import_cjs$9.merge)(this._status$.asObservable(), this.vertoManager.signalingStatus$));
14554
14564
  }
14555
14565
  /** Observable of the participants list, emits on join/leave/update. */
14556
14566
  get participants$() {
@@ -14654,7 +14664,7 @@ var WebRTCCall = class extends Destroyable {
14654
14664
  return this.vertoManager.mediaDirections;
14655
14665
  }
14656
14666
  get participantsId$() {
14657
- return this.participants$.pipe((0, import_cjs$9.map)((participants) => participants.map((participant) => participant.id)));
14667
+ return this.cachedObservable("participantsId$", () => this.participants$.pipe((0, import_cjs$9.map)((participants) => participants.map((participant) => participant.id))));
14658
14668
  }
14659
14669
  /** Executes a raw JSON-RPC request on the client session. */
14660
14670
  async execute(request, options) {
@@ -14689,35 +14699,35 @@ var WebRTCCall = class extends Destroyable {
14689
14699
  }
14690
14700
  }
14691
14701
  get callSessionEvents$() {
14692
- return this.clientSession.signalingEvent$.pipe((0, import_cjs$9.filter)((event) => this.isCallSessionEvent(event)), (0, import_cjs$9.tap)((event) => logger$9.debug("[Call] Received call session event:", event)), (0, import_cjs$9.takeUntil)(this.destroyed$));
14702
+ return this.cachedObservable("callSessionEvents$", () => this.clientSession.signalingEvent$.pipe((0, import_cjs$9.filter)((event) => this.isCallSessionEvent(event)), (0, import_cjs$9.tap)((event) => logger$9.debug("[Call] Received call session event:", event)), (0, import_cjs$9.takeUntil)(this.destroyed$), (0, import_cjs$9.share)()));
14693
14703
  }
14694
14704
  /** Observable of call-updated events. */
14695
14705
  get callUpdated$() {
14696
- return this.callSessionEvents$.pipe(filterAs(isCallUpdatedMetadata, "params"), (0, import_cjs$9.takeUntil)(this.destroyed$));
14706
+ return this.cachedObservable("callUpdated$", () => this.callSessionEvents$.pipe(filterAs(isCallUpdatedMetadata, "params"), (0, import_cjs$9.takeUntil)(this.destroyed$)));
14697
14707
  }
14698
14708
  /** Observable of member-joined events. */
14699
14709
  get memberJoined$() {
14700
- return this.callSessionEvents$.pipe(filterAs(isMemberJoinedMetadata, "params"), (0, import_cjs$9.takeUntil)(this.destroyed$));
14710
+ return this.cachedObservable("memberJoined$", () => this.callSessionEvents$.pipe(filterAs(isMemberJoinedMetadata, "params"), (0, import_cjs$9.takeUntil)(this.destroyed$)));
14701
14711
  }
14702
14712
  /** Observable of member-left events. */
14703
14713
  get memberLeft$() {
14704
- return this.callSessionEvents$.pipe(filterAs(isMemberLeftMetadata, "params"), (0, import_cjs$9.takeUntil)(this.destroyed$));
14714
+ return this.cachedObservable("memberLeft$", () => this.callSessionEvents$.pipe(filterAs(isMemberLeftMetadata, "params"), (0, import_cjs$9.takeUntil)(this.destroyed$)));
14705
14715
  }
14706
14716
  /** Observable of member-updated events (mute, volume, etc.). */
14707
14717
  get memberUpdated$() {
14708
- return this.callSessionEvents$.pipe(filterAs(isMemberUpdatedMetadata, "params"), (0, import_cjs$9.takeUntil)(this.destroyed$));
14718
+ return this.cachedObservable("memberUpdated$", () => this.callSessionEvents$.pipe(filterAs(isMemberUpdatedMetadata, "params"), (0, import_cjs$9.takeUntil)(this.destroyed$)));
14709
14719
  }
14710
14720
  /** Observable of member-talking events (speech start/stop). */
14711
14721
  get memberTalking$() {
14712
- return this.callSessionEvents$.pipe(filterAs(isMemberTalkingMetadata, "params"), (0, import_cjs$9.takeUntil)(this.destroyed$));
14722
+ return this.cachedObservable("memberTalking$", () => this.callSessionEvents$.pipe(filterAs(isMemberTalkingMetadata, "params"), (0, import_cjs$9.takeUntil)(this.destroyed$)));
14713
14723
  }
14714
14724
  /** Observable of call state-change events. */
14715
14725
  get callStates$() {
14716
- return this.callSessionEvents$.pipe(filterAs(isCallStateMetadata, "params"), (0, import_cjs$9.takeUntil)(this.destroyed$));
14726
+ return this.cachedObservable("callStates$", () => this.callSessionEvents$.pipe(filterAs(isCallStateMetadata, "params"), (0, import_cjs$9.takeUntil)(this.destroyed$)));
14717
14727
  }
14718
14728
  /** Observable of layout-changed events. */
14719
14729
  get layoutUpdates$() {
14720
- return this.callSessionEvents$.pipe(filterAs(isLayoutChangedMetadata, "params"), (0, import_cjs$9.takeUntil)(this.destroyed$));
14730
+ return this.cachedObservable("layoutUpdates$", () => this.callSessionEvents$.pipe(filterAs(isLayoutChangedMetadata, "params"), (0, import_cjs$9.takeUntil)(this.destroyed$)));
14721
14731
  }
14722
14732
  /** Underlying `RTCPeerConnection`, for advanced use cases. */
14723
14733
  get rtcPeerConnection() {
@@ -14725,19 +14735,19 @@ var WebRTCCall = class extends Destroyable {
14725
14735
  }
14726
14736
  /** Observable of raw signaling events as plain objects. */
14727
14737
  get signalingEvent$() {
14728
- return this.callEvent$.pipe((0, import_cjs$9.map)((event) => JSON.parse(JSON.stringify(event))));
14738
+ return this.cachedObservable("signalingEvent$", () => this.callEvent$.pipe((0, import_cjs$9.map)((event) => JSON.parse(JSON.stringify(event)))));
14729
14739
  }
14730
14740
  /** Observable of WebRTC-specific signaling messages. */
14731
14741
  get webrtcMessages$() {
14732
- return this.callSessionEvents$.pipe(filterAs(isWebrtcMessageMetadata, "params"), (0, import_cjs$9.tap)((event) => logger$9.debug("[Call] Event is a WebRTC message event:", event)), (0, import_cjs$9.takeUntil)(this.destroyed$));
14742
+ return this.cachedObservable("webrtcMessages$", () => this.callSessionEvents$.pipe(filterAs(isWebrtcMessageMetadata, "params"), (0, import_cjs$9.tap)((event) => logger$9.debug("[Call] Event is a WebRTC message event:", event)), (0, import_cjs$9.takeUntil)(this.destroyed$), (0, import_cjs$9.share)()));
14733
14743
  }
14734
14744
  /** Observable of call-level signaling events. */
14735
14745
  get callEvent$() {
14736
- return this.callSessionEvents$.pipe(filterAs(isSignalwireCallMetadata, "params"), (0, import_cjs$9.tap)((event) => logger$9.debug("[Call] Event is a call event:", event)), (0, import_cjs$9.takeUntil)(this.destroyed$));
14746
+ return this.cachedObservable("callEvent$", () => this.callSessionEvents$.pipe(filterAs(isSignalwireCallMetadata, "params"), (0, import_cjs$9.tap)((event) => logger$9.debug("[Call] Event is a call event:", event)), (0, import_cjs$9.takeUntil)(this.destroyed$), (0, import_cjs$9.share)()));
14737
14747
  }
14738
14748
  /** Observable of layout-changed signaling events. */
14739
14749
  get layoutEvent$() {
14740
- return this.callEvent$.pipe(filterAs(isLayoutChangedMetadata, "params"));
14750
+ return this.cachedObservable("layoutEvent$", () => this.callEvent$.pipe(filterAs(isLayoutChangedMetadata, "params")));
14741
14751
  }
14742
14752
  /** Hangs up the call and releases all resources. */
14743
14753
  async hangup() {
@@ -14890,7 +14900,7 @@ var EntityCollection = class extends Destroyable {
14890
14900
  return this.fetchController.hasMore ?? true;
14891
14901
  }
14892
14902
  get updated$() {
14893
- return this.loading$.pipe((0, import_cjs$8.distinctUntilChanged)(), (0, import_cjs$8.skip)(1), (0, import_cjs$8.filter)((loading) => !loading), (0, import_cjs$8.map)(() => void 0), (0, import_cjs$8.takeUntil)(this._destroy$));
14903
+ return this.cachedObservable("updated$", () => this.loading$.pipe((0, import_cjs$8.distinctUntilChanged)(), (0, import_cjs$8.skip)(1), (0, import_cjs$8.filter)((loading) => !loading), (0, import_cjs$8.map)(() => void 0), (0, import_cjs$8.takeUntil)(this._destroy$)));
14894
14904
  }
14895
14905
  get values() {
14896
14906
  return Array.from(this.collectionData.values());
@@ -14970,7 +14980,7 @@ var EntityCollectionTransformed = class {
14970
14980
  return this.originalCollection.values.filter(this.filter).map(this.mapper);
14971
14981
  }
14972
14982
  get values$() {
14973
- return this.originalCollection.values$.pipe((0, import_cjs$8.map)((values) => values.filter(this.filter).map(this.mapper)));
14983
+ return this._values$ ??= this.originalCollection.values$.pipe((0, import_cjs$8.map)((values) => values.filter(this.filter).map(this.mapper)));
14974
14984
  }
14975
14985
  get$(id) {
14976
14986
  const original$ = this.originalCollection.get$(id);
@@ -15044,7 +15054,7 @@ var Address = class extends Destroyable {
15044
15054
  }
15045
15055
  /** Observable of the human-readable display name. */
15046
15056
  get displayName$() {
15047
- return this._state$.pipe(filterNull(), (0, import_cjs$7.map)((state) => state.display_name), (0, import_cjs$7.takeUntil)(this.destroyed$));
15057
+ return this.cachedObservable("displayName$", () => this._state$.pipe(filterNull(), (0, import_cjs$7.map)((state) => state.display_name), (0, import_cjs$7.takeUntil)(this.destroyed$)));
15048
15058
  }
15049
15059
  /** Human-readable display name. */
15050
15060
  get displayName() {
@@ -15053,7 +15063,7 @@ var Address = class extends Destroyable {
15053
15063
  }
15054
15064
  /** Observable of the preview image URL. */
15055
15065
  get previewUrl$() {
15056
- return this._state$.pipe(filterNull(), (0, import_cjs$7.map)((state) => state.preview_url), (0, import_cjs$7.takeUntil)(this.destroyed$));
15066
+ return this.cachedObservable("previewUrl$", () => this._state$.pipe(filterNull(), (0, import_cjs$7.map)((state) => state.preview_url), (0, import_cjs$7.takeUntil)(this.destroyed$)));
15057
15067
  }
15058
15068
  /** Preview image URL. */
15059
15069
  get previewUrl() {
@@ -15062,7 +15072,7 @@ var Address = class extends Destroyable {
15062
15072
  }
15063
15073
  /** Observable of the cover image URL. */
15064
15074
  get coverUrl$() {
15065
- return this._state$.pipe(filterNull(), (0, import_cjs$7.shareReplay)(1), (0, import_cjs$7.map)((state) => state.cover_url), (0, import_cjs$7.takeUntil)(this.destroyed$));
15075
+ return this.cachedObservable("coverUrl$", () => this._state$.pipe(filterNull(), (0, import_cjs$7.shareReplay)(1), (0, import_cjs$7.map)((state) => state.cover_url), (0, import_cjs$7.takeUntil)(this.destroyed$)));
15066
15076
  }
15067
15077
  /** Cover image URL. */
15068
15078
  get coverUrl() {
@@ -15071,7 +15081,7 @@ var Address = class extends Destroyable {
15071
15081
  }
15072
15082
  /** Observable of the underlying resource ID. */
15073
15083
  get resourceId$() {
15074
- return this._state$.pipe(filterNull(), (0, import_cjs$7.shareReplay)(1), (0, import_cjs$7.map)((state) => state.resource_id), (0, import_cjs$7.takeUntil)(this.destroyed$));
15084
+ return this.cachedObservable("resourceId$", () => this._state$.pipe(filterNull(), (0, import_cjs$7.shareReplay)(1), (0, import_cjs$7.map)((state) => state.resource_id), (0, import_cjs$7.takeUntil)(this.destroyed$)));
15075
15085
  }
15076
15086
  /** Underlying resource ID. */
15077
15087
  get resourceId() {
@@ -15080,7 +15090,7 @@ var Address = class extends Destroyable {
15080
15090
  }
15081
15091
  /** Observable of the resource type (e.g. `'room'`, `'subscriber'`). */
15082
15092
  get type$() {
15083
- return this._state$.pipe(filterNull(), (0, import_cjs$7.shareReplay)(1), (0, import_cjs$7.map)((state) => state.type), (0, import_cjs$7.takeUntil)(this.destroyed$));
15093
+ return this.cachedObservable("type$", () => this._state$.pipe(filterNull(), (0, import_cjs$7.shareReplay)(1), (0, import_cjs$7.map)((state) => state.type), (0, import_cjs$7.takeUntil)(this.destroyed$)));
15084
15094
  }
15085
15095
  /** Resource type (e.g. `'room'`, `'subscriber'`). */
15086
15096
  get type() {
@@ -15089,7 +15099,7 @@ var Address = class extends Destroyable {
15089
15099
  }
15090
15100
  /** Observable of available communication channels (audio, video, messaging). */
15091
15101
  get channels$() {
15092
- return this._state$.pipe(filterNull(), (0, import_cjs$7.shareReplay)(1), (0, import_cjs$7.map)((state) => state.channels), (0, import_cjs$7.takeUntil)(this.destroyed$));
15102
+ return this.cachedObservable("channels$", () => this._state$.pipe(filterNull(), (0, import_cjs$7.shareReplay)(1), (0, import_cjs$7.map)((state) => state.channels), (0, import_cjs$7.takeUntil)(this.destroyed$)));
15093
15103
  }
15094
15104
  /** Available communication channels. */
15095
15105
  get channels() {
@@ -15103,7 +15113,7 @@ var Address = class extends Destroyable {
15103
15113
  }
15104
15114
  /** Observable indicating whether the address (room) is locked. */
15105
15115
  get locked$() {
15106
- return this._state$.pipe(filterNull(), (0, import_cjs$7.shareReplay)(1), (0, import_cjs$7.map)((state) => state.locked), (0, import_cjs$7.takeUntil)(this.destroyed$));
15116
+ return this.cachedObservable("locked$", () => this._state$.pipe(filterNull(), (0, import_cjs$7.shareReplay)(1), (0, import_cjs$7.map)((state) => state.locked), (0, import_cjs$7.takeUntil)(this.destroyed$)));
15107
15117
  }
15108
15118
  /** Sends a text message to this address. */
15109
15119
  async sendText(text) {
@@ -15253,7 +15263,7 @@ var ClientSessionManager = class extends Destroyable {
15253
15263
  this.initialized$ = (0, import_cjs$5.defer)(() => (0, import_cjs$5.from)(this.init())).pipe((0, import_cjs$5.shareReplay)(1), (0, import_cjs$5.takeUntil)(this.destroyed$));
15254
15264
  }
15255
15265
  get incomingCalls$() {
15256
- return this.calls$.pipe((0, import_cjs$5.map)((calls) => calls.filter((call) => call.direction === "inbound")));
15266
+ return this.cachedObservable("incomingCalls$", () => this.calls$.pipe((0, import_cjs$5.map)((calls) => calls.filter((call) => call.direction === "inbound"))));
15257
15267
  }
15258
15268
  get incomingCalls() {
15259
15269
  return Object.values(this._calls$.value).filter((call) => call.direction === "inbound");
@@ -15265,7 +15275,7 @@ var ClientSessionManager = class extends Destroyable {
15265
15275
  return this._subscriberInfo$.value;
15266
15276
  }
15267
15277
  get calls$() {
15268
- return this._calls$.pipe((0, import_cjs$5.map)((calls) => Object.values(calls)));
15278
+ return this.cachedObservable("calls$", () => this._calls$.pipe((0, import_cjs$5.map)((calls) => Object.values(calls))));
15269
15279
  }
15270
15280
  get calls() {
15271
15281
  return Object.values(this._calls$.value);
@@ -15368,20 +15378,20 @@ var ClientSessionManager = class extends Destroyable {
15368
15378
  }
15369
15379
  }
15370
15380
  get authStateEvent$() {
15371
- return this.signalingEvent$.pipe((0, import_cjs$5.tap)((msg) => {
15381
+ return this.cachedObservable("authStateEvent$", () => this.signalingEvent$.pipe((0, import_cjs$5.tap)((msg) => {
15372
15382
  logger$6.debug("[Session] Received incoming message:", msg);
15373
15383
  }), filterAs(isSignalwireAuthorizationStateMetadata, "params"), (0, import_cjs$5.tap)((event) => {
15374
15384
  logger$6.debug("[Session] Authorization state event received:", event.authorization_state);
15375
- }));
15385
+ })));
15376
15386
  }
15377
15387
  get signalingEvent$() {
15378
- return this.transport.incomingEvent$.pipe(filterAs(isSignalwireRequest, "params"));
15388
+ return this.cachedObservable("signalingEvent$", () => this.transport.incomingEvent$.pipe(filterAs(isSignalwireRequest, "params"), (0, import_cjs$5.share)()));
15379
15389
  }
15380
15390
  get vertoInvite$() {
15381
- return this.signalingEvent$.pipe((0, import_cjs$5.filter)(isWebrtcMessageMetadata), (0, import_cjs$5.filter)((event) => isVertoInviteMessage(event.params)), (0, import_cjs$5.map)((event) => ({
15391
+ return this.cachedObservable("vertoInvite$", () => this.signalingEvent$.pipe((0, import_cjs$5.filter)(isWebrtcMessageMetadata), (0, import_cjs$5.filter)((event) => isVertoInviteMessage(event.params)), (0, import_cjs$5.map)((event) => ({
15382
15392
  node_id: event.node_id,
15383
15393
  ...event.params.params
15384
- })));
15394
+ }))));
15385
15395
  }
15386
15396
  get contexts() {
15387
15397
  return [];
@@ -15508,12 +15518,15 @@ var ClientSessionManager = class extends Destroyable {
15508
15518
  }
15509
15519
  async createCall(options = {}) {
15510
15520
  try {
15511
- if (!this._directory) throw new DependencyError("Directory not initialized");
15512
15521
  const addressURI = getAddressSearchURI(options);
15513
- const addressId = await this._directory.findAddressIdByURI(addressURI);
15514
- if (!addressId) throw new DependencyError(`Address name: ${addressURI} not found`);
15515
- const address = this._directory.get(addressId);
15516
- if (!address) throw new DependencyError(`Address ID: ${addressId} not found`);
15522
+ let address;
15523
+ if (!addressURI.startsWith("+")) {
15524
+ if (!this._directory) throw new DependencyError("Directory not initialized");
15525
+ const addressId = await this._directory.findAddressIdByURI(addressURI);
15526
+ if (!addressId) throw new DependencyError(`Address name: ${addressURI} not found`);
15527
+ address = this._directory.get(addressId);
15528
+ if (!address) throw new DependencyError(`Address ID: ${addressId} not found`);
15529
+ }
15517
15530
  const callSession = this.callFactory.createCall(address, { ...options });
15518
15531
  callSession.status$.pipe((0, import_cjs$5.filter)((status) => status === "destroyed"), (0, import_cjs$5.take)(1)).subscribe(() => {
15519
15532
  const { [`${callSession.id}`]: _, ...remainingCalls } = this._calls$.value;
@@ -15543,6 +15556,9 @@ var ClientSessionWrapper = class {
15543
15556
  get signalingEvent$() {
15544
15557
  return this.clientSessionManager.signalingEvent$;
15545
15558
  }
15559
+ get iceServers() {
15560
+ return this.clientSessionManager.iceServers;
15561
+ }
15546
15562
  async execute(request, options) {
15547
15563
  return this.clientSessionManager.execute(request, options);
15548
15564
  }
@@ -16190,7 +16206,7 @@ var SignalWire = class extends Destroyable {
16190
16206
  async init() {
16191
16207
  this._subscriber$.next(new Subscriber(this._deps.http));
16192
16208
  if (!this._options.skipConnection) await this.connect();
16193
- if (this._options.skipReconnect && this._attachManager) await this._attachManager.flush();
16209
+ if (!this._options.reconnectAttachedCalls && this._attachManager) await this._attachManager.flush();
16194
16210
  if (!this._options.skipRegister) this.register();
16195
16211
  this.handleAttachments();
16196
16212
  }
@@ -16329,7 +16345,7 @@ var SignalWire = class extends Destroyable {
16329
16345
  }
16330
16346
  /** Observable that emits `true` when the client is both connected and authenticated. */
16331
16347
  get ready$() {
16332
- return this._isConnected$.pipe((0, import_cjs.switchMap)((connected) => connected ? this._clientSession.authenticated$ : (0, import_cjs.of)(false)));
16348
+ return this.cachedObservable("ready$", () => this._isConnected$.pipe((0, import_cjs.switchMap)((connected) => connected ? this._clientSession.authenticated$ : (0, import_cjs.of)(false))));
16333
16349
  }
16334
16350
  /** Observable stream of errors from transport, authentication, and devices. */
16335
16351
  get errors$() {
@@ -16621,5 +16637,5 @@ emitReadyEvent();
16621
16637
  if (typeof process === "undefined") globalThis.process = { env: { NODE_ENV: "production" } };
16622
16638
 
16623
16639
  //#endregion
16624
- export { Address, CallCreateError, ClientPreferences, CollectionFetchError, MediaTrackError, MessageParseError, Participant, SelfParticipant, SignalWire, StaticCredentialProvider, Subscriber, VertoPongError, WebRTCCall, embeddableCall, isSelfParticipant, ready, version };
16640
+ export { Address, CallCreateError, ClientPreferences, CollectionFetchError, InvalidCredentialsError, MediaTrackError, MessageParseError, Participant, SelfCapabilities, SelfParticipant, SignalWire, StaticCredentialProvider, Subscriber, UnexpectedError, VertoPongError, WebRTCCall, embeddableCall, isSelfParticipant, ready, version };
16625
16641
  //# sourceMappingURL=browser.mjs.map