@infrab4a/connect 4.9.4 → 4.9.5-beta.1

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/index.esm.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import 'reflect-metadata';
2
- import * as tslib_1 from 'tslib';
3
- import { __decorate, __metadata, __rest } from 'tslib';
2
+ import { __decorate, __metadata, __values, __spreadArray, __read, __extends, __rest } from 'tslib';
4
3
  import { plainToInstance, instanceToPlain, Type, Expose } from 'class-transformer';
5
4
  import { parseISO } from 'date-fns';
6
5
  export { add, addBusinessDays, addDays, addMonths, addYears, endOfDay, format, formatISO9075, parseISO, startOfDay, sub } from 'date-fns';
7
- import { isNil, isArray as isArray$1, first, last, flatten, compact, get, isString, each, unset, isObject as isObject$1, set, isNumber, chunk, isEmpty, isDate, isBoolean, isInteger, isNaN as isNaN$1, sortBy, omit } from 'lodash';
6
+ import { isNil, isArray, first, last, flatten, compact, get, isString, each, unset, isObject, set, isNumber, chunk, isEmpty, isDate, isBoolean, isInteger, isNaN as isNaN$1, sortBy, omit } from 'lodash';
8
7
  export { chunk, each, get, isBoolean, isDate, isEmpty, isInteger, isNaN, isNil, isNumber, isObject, isString, now, omit, pick, set, sortBy, unset } from 'lodash';
9
8
  import { debug } from 'debug';
10
9
  import { CustomError } from 'ts-custom-error';
@@ -676,478 +675,401 @@ __decorate([
676
675
  __metadata("design:type", Payment)
677
676
  ], SubscriptionPayment.prototype, "payment", void 0);
678
677
 
679
- /** PURE_IMPORTS_START PURE_IMPORTS_END */
680
- function isFunction(x) {
681
- return typeof x === 'function';
678
+ function isFunction(value) {
679
+ return typeof value === 'function';
682
680
  }
683
681
 
684
- /** PURE_IMPORTS_START PURE_IMPORTS_END */
685
- var _enable_super_gross_mode_that_will_cause_bad_things = false;
686
- var config = {
687
- Promise: undefined,
688
- set useDeprecatedSynchronousErrorHandling(value) {
689
- if (value) {
690
- var error = /*@__PURE__*/ new Error();
691
- /*@__PURE__*/ console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack);
692
- }
693
- _enable_super_gross_mode_that_will_cause_bad_things = value;
694
- },
695
- get useDeprecatedSynchronousErrorHandling() {
696
- return _enable_super_gross_mode_that_will_cause_bad_things;
697
- },
698
- };
699
-
700
- /** PURE_IMPORTS_START PURE_IMPORTS_END */
701
- function hostReportError(err) {
702
- setTimeout(function () { throw err; }, 0);
703
- }
704
-
705
- /** PURE_IMPORTS_START _config,_util_hostReportError PURE_IMPORTS_END */
706
- var empty = {
707
- closed: true,
708
- next: function (value) { },
709
- error: function (err) {
710
- if (config.useDeprecatedSynchronousErrorHandling) {
711
- throw err;
712
- }
713
- else {
714
- hostReportError(err);
715
- }
716
- },
717
- complete: function () { }
718
- };
719
-
720
- /** PURE_IMPORTS_START PURE_IMPORTS_END */
721
- var isArray = /*@__PURE__*/ (function () { return Array.isArray || (function (x) { return x && typeof x.length === 'number'; }); })();
722
-
723
- /** PURE_IMPORTS_START PURE_IMPORTS_END */
724
- function isObject(x) {
725
- return x !== null && typeof x === 'object';
682
+ function createErrorClass(createImpl) {
683
+ var _super = function (instance) {
684
+ Error.call(instance);
685
+ instance.stack = new Error().stack;
686
+ };
687
+ var ctorFunc = createImpl(_super);
688
+ ctorFunc.prototype = Object.create(Error.prototype);
689
+ ctorFunc.prototype.constructor = ctorFunc;
690
+ return ctorFunc;
726
691
  }
727
692
 
728
- /** PURE_IMPORTS_START PURE_IMPORTS_END */
729
- var UnsubscriptionErrorImpl = /*@__PURE__*/ (function () {
730
- function UnsubscriptionErrorImpl(errors) {
731
- Error.call(this);
732
- this.message = errors ?
733
- errors.length + " errors occurred during unsubscription:\n" + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ') : '';
693
+ var UnsubscriptionError = createErrorClass(function (_super) {
694
+ return function UnsubscriptionErrorImpl(errors) {
695
+ _super(this);
696
+ this.message = errors
697
+ ? errors.length + " errors occurred during unsubscription:\n" + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ')
698
+ : '';
734
699
  this.name = 'UnsubscriptionError';
735
700
  this.errors = errors;
736
- return this;
701
+ };
702
+ });
703
+
704
+ function arrRemove(arr, item) {
705
+ if (arr) {
706
+ var index = arr.indexOf(item);
707
+ 0 <= index && arr.splice(index, 1);
737
708
  }
738
- UnsubscriptionErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
739
- return UnsubscriptionErrorImpl;
740
- })();
741
- var UnsubscriptionError = UnsubscriptionErrorImpl;
742
-
743
- /** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_UnsubscriptionError PURE_IMPORTS_END */
744
- var Subscription$1 = /*@__PURE__*/ (function () {
745
- function Subscription(unsubscribe) {
709
+ }
710
+
711
+ var Subscription$1 = (function () {
712
+ function Subscription(initialTeardown) {
713
+ this.initialTeardown = initialTeardown;
746
714
  this.closed = false;
747
- this._parentOrParents = null;
748
- this._subscriptions = null;
749
- if (unsubscribe) {
750
- this._ctorUnsubscribe = true;
751
- this._unsubscribe = unsubscribe;
752
- }
715
+ this._parentage = null;
716
+ this._finalizers = null;
753
717
  }
754
718
  Subscription.prototype.unsubscribe = function () {
719
+ var e_1, _a, e_2, _b;
755
720
  var errors;
756
- if (this.closed) {
757
- return;
758
- }
759
- var _a = this, _parentOrParents = _a._parentOrParents, _ctorUnsubscribe = _a._ctorUnsubscribe, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
760
- this.closed = true;
761
- this._parentOrParents = null;
762
- this._subscriptions = null;
763
- if (_parentOrParents instanceof Subscription) {
764
- _parentOrParents.remove(this);
765
- }
766
- else if (_parentOrParents !== null) {
767
- for (var index = 0; index < _parentOrParents.length; ++index) {
768
- var parent_1 = _parentOrParents[index];
769
- parent_1.remove(this);
770
- }
771
- }
772
- if (isFunction(_unsubscribe)) {
773
- if (_ctorUnsubscribe) {
774
- this._unsubscribe = undefined;
775
- }
776
- try {
777
- _unsubscribe.call(this);
778
- }
779
- catch (e) {
780
- errors = e instanceof UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];
781
- }
782
- }
783
- if (isArray(_subscriptions)) {
784
- var index = -1;
785
- var len = _subscriptions.length;
786
- while (++index < len) {
787
- var sub = _subscriptions[index];
788
- if (isObject(sub)) {
721
+ if (!this.closed) {
722
+ this.closed = true;
723
+ var _parentage = this._parentage;
724
+ if (_parentage) {
725
+ this._parentage = null;
726
+ if (Array.isArray(_parentage)) {
789
727
  try {
790
- sub.unsubscribe();
791
- }
792
- catch (e) {
793
- errors = errors || [];
794
- if (e instanceof UnsubscriptionError) {
795
- errors = errors.concat(flattenUnsubscriptionErrors(e.errors));
728
+ for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {
729
+ var parent_1 = _parentage_1_1.value;
730
+ parent_1.remove(this);
796
731
  }
797
- else {
798
- errors.push(e);
732
+ }
733
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
734
+ finally {
735
+ try {
736
+ if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);
799
737
  }
738
+ finally { if (e_1) throw e_1.error; }
800
739
  }
801
740
  }
741
+ else {
742
+ _parentage.remove(this);
743
+ }
802
744
  }
803
- }
804
- if (errors) {
805
- throw new UnsubscriptionError(errors);
806
- }
807
- };
808
- Subscription.prototype.add = function (teardown) {
809
- var subscription = teardown;
810
- if (!teardown) {
811
- return Subscription.EMPTY;
812
- }
813
- switch (typeof teardown) {
814
- case 'function':
815
- subscription = new Subscription(teardown);
816
- case 'object':
817
- if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {
818
- return subscription;
745
+ var initialFinalizer = this.initialTeardown;
746
+ if (isFunction(initialFinalizer)) {
747
+ try {
748
+ initialFinalizer();
819
749
  }
820
- else if (this.closed) {
821
- subscription.unsubscribe();
822
- return subscription;
750
+ catch (e) {
751
+ errors = e instanceof UnsubscriptionError ? e.errors : [e];
823
752
  }
824
- else if (!(subscription instanceof Subscription)) {
825
- var tmp = subscription;
826
- subscription = new Subscription();
827
- subscription._subscriptions = [tmp];
753
+ }
754
+ var _finalizers = this._finalizers;
755
+ if (_finalizers) {
756
+ this._finalizers = null;
757
+ try {
758
+ for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {
759
+ var finalizer = _finalizers_1_1.value;
760
+ try {
761
+ execFinalizer(finalizer);
762
+ }
763
+ catch (err) {
764
+ errors = errors !== null && errors !== void 0 ? errors : [];
765
+ if (err instanceof UnsubscriptionError) {
766
+ errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));
767
+ }
768
+ else {
769
+ errors.push(err);
770
+ }
771
+ }
772
+ }
773
+ }
774
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
775
+ finally {
776
+ try {
777
+ if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);
778
+ }
779
+ finally { if (e_2) throw e_2.error; }
828
780
  }
829
- break;
830
- default: {
831
- throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
832
781
  }
833
- }
834
- var _parentOrParents = subscription._parentOrParents;
835
- if (_parentOrParents === null) {
836
- subscription._parentOrParents = this;
837
- }
838
- else if (_parentOrParents instanceof Subscription) {
839
- if (_parentOrParents === this) {
840
- return subscription;
782
+ if (errors) {
783
+ throw new UnsubscriptionError(errors);
841
784
  }
842
- subscription._parentOrParents = [_parentOrParents, this];
843
785
  }
844
- else if (_parentOrParents.indexOf(this) === -1) {
845
- _parentOrParents.push(this);
846
- }
847
- else {
848
- return subscription;
786
+ };
787
+ Subscription.prototype.add = function (teardown) {
788
+ var _a;
789
+ if (teardown && teardown !== this) {
790
+ if (this.closed) {
791
+ execFinalizer(teardown);
792
+ }
793
+ else {
794
+ if (teardown instanceof Subscription) {
795
+ if (teardown.closed || teardown._hasParent(this)) {
796
+ return;
797
+ }
798
+ teardown._addParent(this);
799
+ }
800
+ (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
801
+ }
849
802
  }
850
- var subscriptions = this._subscriptions;
851
- if (subscriptions === null) {
852
- this._subscriptions = [subscription];
803
+ };
804
+ Subscription.prototype._hasParent = function (parent) {
805
+ var _parentage = this._parentage;
806
+ return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));
807
+ };
808
+ Subscription.prototype._addParent = function (parent) {
809
+ var _parentage = this._parentage;
810
+ this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
811
+ };
812
+ Subscription.prototype._removeParent = function (parent) {
813
+ var _parentage = this._parentage;
814
+ if (_parentage === parent) {
815
+ this._parentage = null;
853
816
  }
854
- else {
855
- subscriptions.push(subscription);
817
+ else if (Array.isArray(_parentage)) {
818
+ arrRemove(_parentage, parent);
856
819
  }
857
- return subscription;
858
820
  };
859
- Subscription.prototype.remove = function (subscription) {
860
- var subscriptions = this._subscriptions;
861
- if (subscriptions) {
862
- var subscriptionIndex = subscriptions.indexOf(subscription);
863
- if (subscriptionIndex !== -1) {
864
- subscriptions.splice(subscriptionIndex, 1);
865
- }
821
+ Subscription.prototype.remove = function (teardown) {
822
+ var _finalizers = this._finalizers;
823
+ _finalizers && arrRemove(_finalizers, teardown);
824
+ if (teardown instanceof Subscription) {
825
+ teardown._removeParent(this);
866
826
  }
867
827
  };
868
- Subscription.EMPTY = (function (empty) {
828
+ Subscription.EMPTY = (function () {
829
+ var empty = new Subscription();
869
830
  empty.closed = true;
870
831
  return empty;
871
- }(new Subscription()));
832
+ })();
872
833
  return Subscription;
873
834
  }());
874
- function flattenUnsubscriptionErrors(errors) {
875
- return errors.reduce(function (errs, err) { return errs.concat((err instanceof UnsubscriptionError) ? err.errors : err); }, []);
835
+ var EMPTY_SUBSCRIPTION = Subscription$1.EMPTY;
836
+ function isSubscription(value) {
837
+ return (value instanceof Subscription$1 ||
838
+ (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));
839
+ }
840
+ function execFinalizer(finalizer) {
841
+ if (isFunction(finalizer)) {
842
+ finalizer();
843
+ }
844
+ else {
845
+ finalizer.unsubscribe();
846
+ }
847
+ }
848
+
849
+ var config = {
850
+ onUnhandledError: null,
851
+ onStoppedNotification: null,
852
+ Promise: undefined,
853
+ useDeprecatedSynchronousErrorHandling: false,
854
+ useDeprecatedNextContext: false,
855
+ };
856
+
857
+ var timeoutProvider = {
858
+ setTimeout: function (handler, timeout) {
859
+ var args = [];
860
+ for (var _i = 2; _i < arguments.length; _i++) {
861
+ args[_i - 2] = arguments[_i];
862
+ }
863
+ var delegate = timeoutProvider.delegate;
864
+ if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
865
+ return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));
866
+ }
867
+ return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));
868
+ },
869
+ clearTimeout: function (handle) {
870
+ var delegate = timeoutProvider.delegate;
871
+ return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
872
+ },
873
+ delegate: undefined,
874
+ };
875
+
876
+ function reportUnhandledError(err) {
877
+ timeoutProvider.setTimeout(function () {
878
+ {
879
+ throw err;
880
+ }
881
+ });
876
882
  }
877
883
 
878
- /** PURE_IMPORTS_START PURE_IMPORTS_END */
879
- var rxSubscriber = /*@__PURE__*/ (function () {
880
- return typeof Symbol === 'function'
881
- ? /*@__PURE__*/ Symbol('rxSubscriber')
882
- : '@@rxSubscriber_' + /*@__PURE__*/ Math.random();
883
- })();
884
-
885
- /** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */
886
- var Subscriber = /*@__PURE__*/ (function (_super) {
887
- tslib_1.__extends(Subscriber, _super);
888
- function Subscriber(destinationOrNext, error, complete) {
884
+ function noop() { }
885
+
886
+ var context = null;
887
+ function errorContext(cb) {
888
+ if (config.useDeprecatedSynchronousErrorHandling) {
889
+ var isRoot = !context;
890
+ if (isRoot) {
891
+ context = { errorThrown: false, error: null };
892
+ }
893
+ cb();
894
+ if (isRoot) {
895
+ var _a = context, errorThrown = _a.errorThrown, error = _a.error;
896
+ context = null;
897
+ if (errorThrown) {
898
+ throw error;
899
+ }
900
+ }
901
+ }
902
+ else {
903
+ cb();
904
+ }
905
+ }
906
+
907
+ var Subscriber = (function (_super) {
908
+ __extends(Subscriber, _super);
909
+ function Subscriber(destination) {
889
910
  var _this = _super.call(this) || this;
890
- _this.syncErrorValue = null;
891
- _this.syncErrorThrown = false;
892
- _this.syncErrorThrowable = false;
893
911
  _this.isStopped = false;
894
- switch (arguments.length) {
895
- case 0:
896
- _this.destination = empty;
897
- break;
898
- case 1:
899
- if (!destinationOrNext) {
900
- _this.destination = empty;
901
- break;
902
- }
903
- if (typeof destinationOrNext === 'object') {
904
- if (destinationOrNext instanceof Subscriber) {
905
- _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
906
- _this.destination = destinationOrNext;
907
- destinationOrNext.add(_this);
908
- }
909
- else {
910
- _this.syncErrorThrowable = true;
911
- _this.destination = new SafeSubscriber(_this, destinationOrNext);
912
- }
913
- break;
914
- }
915
- default:
916
- _this.syncErrorThrowable = true;
917
- _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);
918
- break;
912
+ if (destination) {
913
+ _this.destination = destination;
914
+ if (isSubscription(destination)) {
915
+ destination.add(_this);
916
+ }
917
+ }
918
+ else {
919
+ _this.destination = EMPTY_OBSERVER;
919
920
  }
920
921
  return _this;
921
922
  }
922
- Subscriber.prototype[rxSubscriber] = function () { return this; };
923
923
  Subscriber.create = function (next, error, complete) {
924
- var subscriber = new Subscriber(next, error, complete);
925
- subscriber.syncErrorThrowable = false;
926
- return subscriber;
924
+ return new SafeSubscriber(next, error, complete);
927
925
  };
928
926
  Subscriber.prototype.next = function (value) {
929
- if (!this.isStopped) {
927
+ if (this.isStopped) ;
928
+ else {
930
929
  this._next(value);
931
930
  }
932
931
  };
933
932
  Subscriber.prototype.error = function (err) {
934
- if (!this.isStopped) {
933
+ if (this.isStopped) ;
934
+ else {
935
935
  this.isStopped = true;
936
936
  this._error(err);
937
937
  }
938
938
  };
939
939
  Subscriber.prototype.complete = function () {
940
- if (!this.isStopped) {
940
+ if (this.isStopped) ;
941
+ else {
941
942
  this.isStopped = true;
942
943
  this._complete();
943
944
  }
944
945
  };
945
946
  Subscriber.prototype.unsubscribe = function () {
946
- if (this.closed) {
947
- return;
947
+ if (!this.closed) {
948
+ this.isStopped = true;
949
+ _super.prototype.unsubscribe.call(this);
950
+ this.destination = null;
948
951
  }
949
- this.isStopped = true;
950
- _super.prototype.unsubscribe.call(this);
951
952
  };
952
953
  Subscriber.prototype._next = function (value) {
953
954
  this.destination.next(value);
954
955
  };
955
956
  Subscriber.prototype._error = function (err) {
956
- this.destination.error(err);
957
- this.unsubscribe();
957
+ try {
958
+ this.destination.error(err);
959
+ }
960
+ finally {
961
+ this.unsubscribe();
962
+ }
958
963
  };
959
964
  Subscriber.prototype._complete = function () {
960
- this.destination.complete();
961
- this.unsubscribe();
962
- };
963
- Subscriber.prototype._unsubscribeAndRecycle = function () {
964
- var _parentOrParents = this._parentOrParents;
965
- this._parentOrParents = null;
966
- this.unsubscribe();
967
- this.closed = false;
968
- this.isStopped = false;
969
- this._parentOrParents = _parentOrParents;
970
- return this;
965
+ try {
966
+ this.destination.complete();
967
+ }
968
+ finally {
969
+ this.unsubscribe();
970
+ }
971
971
  };
972
972
  return Subscriber;
973
973
  }(Subscription$1));
974
- var SafeSubscriber = /*@__PURE__*/ (function (_super) {
975
- tslib_1.__extends(SafeSubscriber, _super);
976
- function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {
977
- var _this = _super.call(this) || this;
978
- _this._parentSubscriber = _parentSubscriber;
979
- var next;
980
- var context = _this;
981
- if (isFunction(observerOrNext)) {
982
- next = observerOrNext;
983
- }
984
- else if (observerOrNext) {
985
- next = observerOrNext.next;
986
- error = observerOrNext.error;
987
- complete = observerOrNext.complete;
988
- if (observerOrNext !== empty) {
989
- context = Object.create(observerOrNext);
990
- if (isFunction(context.unsubscribe)) {
991
- _this.add(context.unsubscribe.bind(context));
992
- }
993
- context.unsubscribe = _this.unsubscribe.bind(_this);
994
- }
995
- }
996
- _this._context = context;
997
- _this._next = next;
998
- _this._error = error;
999
- _this._complete = complete;
1000
- return _this;
974
+ var _bind = Function.prototype.bind;
975
+ function bind(fn, thisArg) {
976
+ return _bind.call(fn, thisArg);
977
+ }
978
+ var ConsumerObserver = (function () {
979
+ function ConsumerObserver(partialObserver) {
980
+ this.partialObserver = partialObserver;
1001
981
  }
1002
- SafeSubscriber.prototype.next = function (value) {
1003
- if (!this.isStopped && this._next) {
1004
- var _parentSubscriber = this._parentSubscriber;
1005
- if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
1006
- this.__tryOrUnsub(this._next, value);
982
+ ConsumerObserver.prototype.next = function (value) {
983
+ var partialObserver = this.partialObserver;
984
+ if (partialObserver.next) {
985
+ try {
986
+ partialObserver.next(value);
1007
987
  }
1008
- else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
1009
- this.unsubscribe();
988
+ catch (error) {
989
+ handleUnhandledError(error);
1010
990
  }
1011
991
  }
1012
992
  };
1013
- SafeSubscriber.prototype.error = function (err) {
1014
- if (!this.isStopped) {
1015
- var _parentSubscriber = this._parentSubscriber;
1016
- var useDeprecatedSynchronousErrorHandling = config.useDeprecatedSynchronousErrorHandling;
1017
- if (this._error) {
1018
- if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
1019
- this.__tryOrUnsub(this._error, err);
1020
- this.unsubscribe();
1021
- }
1022
- else {
1023
- this.__tryOrSetError(_parentSubscriber, this._error, err);
1024
- this.unsubscribe();
1025
- }
1026
- }
1027
- else if (!_parentSubscriber.syncErrorThrowable) {
1028
- this.unsubscribe();
1029
- if (useDeprecatedSynchronousErrorHandling) {
1030
- throw err;
1031
- }
1032
- hostReportError(err);
993
+ ConsumerObserver.prototype.error = function (err) {
994
+ var partialObserver = this.partialObserver;
995
+ if (partialObserver.error) {
996
+ try {
997
+ partialObserver.error(err);
1033
998
  }
1034
- else {
1035
- if (useDeprecatedSynchronousErrorHandling) {
1036
- _parentSubscriber.syncErrorValue = err;
1037
- _parentSubscriber.syncErrorThrown = true;
1038
- }
1039
- else {
1040
- hostReportError(err);
1041
- }
1042
- this.unsubscribe();
999
+ catch (error) {
1000
+ handleUnhandledError(error);
1043
1001
  }
1044
1002
  }
1045
- };
1046
- SafeSubscriber.prototype.complete = function () {
1047
- var _this = this;
1048
- if (!this.isStopped) {
1049
- var _parentSubscriber = this._parentSubscriber;
1050
- if (this._complete) {
1051
- var wrappedComplete = function () { return _this._complete.call(_this._context); };
1052
- if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
1053
- this.__tryOrUnsub(wrappedComplete);
1054
- this.unsubscribe();
1055
- }
1056
- else {
1057
- this.__tryOrSetError(_parentSubscriber, wrappedComplete);
1058
- this.unsubscribe();
1059
- }
1060
- }
1061
- else {
1062
- this.unsubscribe();
1063
- }
1003
+ else {
1004
+ handleUnhandledError(err);
1064
1005
  }
1065
1006
  };
1066
- SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {
1067
- try {
1068
- fn.call(this._context, value);
1069
- }
1070
- catch (err) {
1071
- this.unsubscribe();
1072
- if (config.useDeprecatedSynchronousErrorHandling) {
1073
- throw err;
1007
+ ConsumerObserver.prototype.complete = function () {
1008
+ var partialObserver = this.partialObserver;
1009
+ if (partialObserver.complete) {
1010
+ try {
1011
+ partialObserver.complete();
1074
1012
  }
1075
- else {
1076
- hostReportError(err);
1013
+ catch (error) {
1014
+ handleUnhandledError(error);
1077
1015
  }
1078
1016
  }
1079
1017
  };
1080
- SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {
1081
- if (!config.useDeprecatedSynchronousErrorHandling) {
1082
- throw new Error('bad call');
1083
- }
1084
- try {
1085
- fn.call(this._context, value);
1018
+ return ConsumerObserver;
1019
+ }());
1020
+ var SafeSubscriber = (function (_super) {
1021
+ __extends(SafeSubscriber, _super);
1022
+ function SafeSubscriber(observerOrNext, error, complete) {
1023
+ var _this = _super.call(this) || this;
1024
+ var partialObserver;
1025
+ if (isFunction(observerOrNext) || !observerOrNext) {
1026
+ partialObserver = {
1027
+ next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),
1028
+ error: error !== null && error !== void 0 ? error : undefined,
1029
+ complete: complete !== null && complete !== void 0 ? complete : undefined,
1030
+ };
1086
1031
  }
1087
- catch (err) {
1088
- if (config.useDeprecatedSynchronousErrorHandling) {
1089
- parent.syncErrorValue = err;
1090
- parent.syncErrorThrown = true;
1091
- return true;
1032
+ else {
1033
+ var context_1;
1034
+ if (_this && config.useDeprecatedNextContext) {
1035
+ context_1 = Object.create(observerOrNext);
1036
+ context_1.unsubscribe = function () { return _this.unsubscribe(); };
1037
+ partialObserver = {
1038
+ next: observerOrNext.next && bind(observerOrNext.next, context_1),
1039
+ error: observerOrNext.error && bind(observerOrNext.error, context_1),
1040
+ complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),
1041
+ };
1092
1042
  }
1093
1043
  else {
1094
- hostReportError(err);
1095
- return true;
1044
+ partialObserver = observerOrNext;
1096
1045
  }
1097
1046
  }
1098
- return false;
1099
- };
1100
- SafeSubscriber.prototype._unsubscribe = function () {
1101
- var _parentSubscriber = this._parentSubscriber;
1102
- this._context = null;
1103
- this._parentSubscriber = null;
1104
- _parentSubscriber.unsubscribe();
1105
- };
1047
+ _this.destination = new ConsumerObserver(partialObserver);
1048
+ return _this;
1049
+ }
1106
1050
  return SafeSubscriber;
1107
1051
  }(Subscriber));
1108
-
1109
- /** PURE_IMPORTS_START _Subscriber PURE_IMPORTS_END */
1110
- function canReportError(observer) {
1111
- while (observer) {
1112
- var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;
1113
- if (closed_1 || isStopped) {
1114
- return false;
1115
- }
1116
- else if (destination && destination instanceof Subscriber) {
1117
- observer = destination;
1118
- }
1119
- else {
1120
- observer = null;
1121
- }
1052
+ function handleUnhandledError(error) {
1053
+ {
1054
+ reportUnhandledError(error);
1122
1055
  }
1123
- return true;
1124
1056
  }
1125
-
1126
- /** PURE_IMPORTS_START _Subscriber,_symbol_rxSubscriber,_Observer PURE_IMPORTS_END */
1127
- function toSubscriber(nextOrObserver, error, complete) {
1128
- if (nextOrObserver) {
1129
- if (nextOrObserver instanceof Subscriber) {
1130
- return nextOrObserver;
1131
- }
1132
- if (nextOrObserver[rxSubscriber]) {
1133
- return nextOrObserver[rxSubscriber]();
1134
- }
1135
- }
1136
- if (!nextOrObserver && !error && !complete) {
1137
- return new Subscriber(empty);
1138
- }
1139
- return new Subscriber(nextOrObserver, error, complete);
1057
+ function defaultErrorHandler(err) {
1058
+ throw err;
1140
1059
  }
1060
+ var EMPTY_OBSERVER = {
1061
+ closed: true,
1062
+ next: noop,
1063
+ error: defaultErrorHandler,
1064
+ complete: noop,
1065
+ };
1141
1066
 
1142
- /** PURE_IMPORTS_START PURE_IMPORTS_END */
1143
- var observable = /*@__PURE__*/ (function () { return typeof Symbol === 'function' && Symbol.observable || '@@observable'; })();
1067
+ var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();
1144
1068
 
1145
- /** PURE_IMPORTS_START PURE_IMPORTS_END */
1146
1069
  function identity(x) {
1147
1070
  return x;
1148
1071
  }
1149
1072
 
1150
- /** PURE_IMPORTS_START _identity PURE_IMPORTS_END */
1151
1073
  function pipeFromArray(fns) {
1152
1074
  if (fns.length === 0) {
1153
1075
  return identity;
@@ -1160,10 +1082,8 @@ function pipeFromArray(fns) {
1160
1082
  };
1161
1083
  }
1162
1084
 
1163
- /** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */
1164
- var Observable = /*@__PURE__*/ (function () {
1085
+ var Observable = (function () {
1165
1086
  function Observable(subscribe) {
1166
- this._isScalar = false;
1167
1087
  if (subscribe) {
1168
1088
  this._subscribe = subscribe;
1169
1089
  }
@@ -1175,64 +1095,52 @@ var Observable = /*@__PURE__*/ (function () {
1175
1095
  return observable;
1176
1096
  };
1177
1097
  Observable.prototype.subscribe = function (observerOrNext, error, complete) {
1178
- var operator = this.operator;
1179
- var sink = toSubscriber(observerOrNext, error, complete);
1180
- if (operator) {
1181
- sink.add(operator.call(sink, this.source));
1182
- }
1183
- else {
1184
- sink.add(this.source || (config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?
1185
- this._subscribe(sink) :
1186
- this._trySubscribe(sink));
1187
- }
1188
- if (config.useDeprecatedSynchronousErrorHandling) {
1189
- if (sink.syncErrorThrowable) {
1190
- sink.syncErrorThrowable = false;
1191
- if (sink.syncErrorThrown) {
1192
- throw sink.syncErrorValue;
1193
- }
1194
- }
1195
- }
1196
- return sink;
1098
+ var _this = this;
1099
+ var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);
1100
+ errorContext(function () {
1101
+ var _a = _this, operator = _a.operator, source = _a.source;
1102
+ subscriber.add(operator
1103
+ ?
1104
+ operator.call(subscriber, source)
1105
+ : source
1106
+ ?
1107
+ _this._subscribe(subscriber)
1108
+ :
1109
+ _this._trySubscribe(subscriber));
1110
+ });
1111
+ return subscriber;
1197
1112
  };
1198
1113
  Observable.prototype._trySubscribe = function (sink) {
1199
1114
  try {
1200
1115
  return this._subscribe(sink);
1201
1116
  }
1202
1117
  catch (err) {
1203
- if (config.useDeprecatedSynchronousErrorHandling) {
1204
- sink.syncErrorThrown = true;
1205
- sink.syncErrorValue = err;
1206
- }
1207
- if (canReportError(sink)) {
1208
- sink.error(err);
1209
- }
1210
- else {
1211
- console.warn(err);
1212
- }
1118
+ sink.error(err);
1213
1119
  }
1214
1120
  };
1215
1121
  Observable.prototype.forEach = function (next, promiseCtor) {
1216
1122
  var _this = this;
1217
1123
  promiseCtor = getPromiseCtor(promiseCtor);
1218
1124
  return new promiseCtor(function (resolve, reject) {
1219
- var subscription;
1220
- subscription = _this.subscribe(function (value) {
1221
- try {
1222
- next(value);
1223
- }
1224
- catch (err) {
1225
- reject(err);
1226
- if (subscription) {
1227
- subscription.unsubscribe();
1125
+ var subscriber = new SafeSubscriber({
1126
+ next: function (value) {
1127
+ try {
1128
+ next(value);
1228
1129
  }
1229
- }
1230
- }, reject, resolve);
1130
+ catch (err) {
1131
+ reject(err);
1132
+ subscriber.unsubscribe();
1133
+ }
1134
+ },
1135
+ error: reject,
1136
+ complete: resolve,
1137
+ });
1138
+ _this.subscribe(subscriber);
1231
1139
  });
1232
1140
  };
1233
1141
  Observable.prototype._subscribe = function (subscriber) {
1234
- var source = this.source;
1235
- return source && source.subscribe(subscriber);
1142
+ var _a;
1143
+ return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
1236
1144
  };
1237
1145
  Observable.prototype[observable] = function () {
1238
1146
  return this;
@@ -1242,9 +1150,6 @@ var Observable = /*@__PURE__*/ (function () {
1242
1150
  for (var _i = 0; _i < arguments.length; _i++) {
1243
1151
  operations[_i] = arguments[_i];
1244
1152
  }
1245
- if (operations.length === 0) {
1246
- return this;
1247
- }
1248
1153
  return pipeFromArray(operations)(this);
1249
1154
  };
1250
1155
  Observable.prototype.toPromise = function (promiseCtor) {
@@ -1252,7 +1157,7 @@ var Observable = /*@__PURE__*/ (function () {
1252
1157
  promiseCtor = getPromiseCtor(promiseCtor);
1253
1158
  return new promiseCtor(function (resolve, reject) {
1254
1159
  var value;
1255
- _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });
1160
+ _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });
1256
1161
  });
1257
1162
  };
1258
1163
  Observable.create = function (subscribe) {
@@ -1261,155 +1166,139 @@ var Observable = /*@__PURE__*/ (function () {
1261
1166
  return Observable;
1262
1167
  }());
1263
1168
  function getPromiseCtor(promiseCtor) {
1264
- if (!promiseCtor) {
1265
- promiseCtor = config.Promise || Promise;
1266
- }
1267
- if (!promiseCtor) {
1268
- throw new Error('no Promise impl found');
1269
- }
1270
- return promiseCtor;
1169
+ var _a;
1170
+ return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
1171
+ }
1172
+ function isObserver(value) {
1173
+ return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
1174
+ }
1175
+ function isSubscriber(value) {
1176
+ return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));
1271
1177
  }
1272
1178
 
1273
- /** PURE_IMPORTS_START PURE_IMPORTS_END */
1274
- var ObjectUnsubscribedErrorImpl = /*@__PURE__*/ (function () {
1275
- function ObjectUnsubscribedErrorImpl() {
1276
- Error.call(this);
1277
- this.message = 'object unsubscribed';
1179
+ var ObjectUnsubscribedError = createErrorClass(function (_super) {
1180
+ return function ObjectUnsubscribedErrorImpl() {
1181
+ _super(this);
1278
1182
  this.name = 'ObjectUnsubscribedError';
1279
- return this;
1280
- }
1281
- ObjectUnsubscribedErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
1282
- return ObjectUnsubscribedErrorImpl;
1283
- })();
1284
- var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl;
1285
-
1286
- /** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */
1287
- var SubjectSubscription = /*@__PURE__*/ (function (_super) {
1288
- tslib_1.__extends(SubjectSubscription, _super);
1289
- function SubjectSubscription(subject, subscriber) {
1290
- var _this = _super.call(this) || this;
1291
- _this.subject = subject;
1292
- _this.subscriber = subscriber;
1293
- _this.closed = false;
1294
- return _this;
1295
- }
1296
- SubjectSubscription.prototype.unsubscribe = function () {
1297
- if (this.closed) {
1298
- return;
1299
- }
1300
- this.closed = true;
1301
- var subject = this.subject;
1302
- var observers = subject.observers;
1303
- this.subject = null;
1304
- if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {
1305
- return;
1306
- }
1307
- var subscriberIndex = observers.indexOf(this.subscriber);
1308
- if (subscriberIndex !== -1) {
1309
- observers.splice(subscriberIndex, 1);
1310
- }
1183
+ this.message = 'object unsubscribed';
1311
1184
  };
1312
- return SubjectSubscription;
1313
- }(Subscription$1));
1185
+ });
1314
1186
 
1315
- /** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */
1316
- var SubjectSubscriber = /*@__PURE__*/ (function (_super) {
1317
- tslib_1.__extends(SubjectSubscriber, _super);
1318
- function SubjectSubscriber(destination) {
1319
- var _this = _super.call(this, destination) || this;
1320
- _this.destination = destination;
1321
- return _this;
1322
- }
1323
- return SubjectSubscriber;
1324
- }(Subscriber));
1325
- var Subject = /*@__PURE__*/ (function (_super) {
1326
- tslib_1.__extends(Subject, _super);
1187
+ var Subject = (function (_super) {
1188
+ __extends(Subject, _super);
1327
1189
  function Subject() {
1328
1190
  var _this = _super.call(this) || this;
1329
- _this.observers = [];
1330
1191
  _this.closed = false;
1192
+ _this.currentObservers = null;
1193
+ _this.observers = [];
1331
1194
  _this.isStopped = false;
1332
1195
  _this.hasError = false;
1333
1196
  _this.thrownError = null;
1334
1197
  return _this;
1335
1198
  }
1336
- Subject.prototype[rxSubscriber] = function () {
1337
- return new SubjectSubscriber(this);
1338
- };
1339
1199
  Subject.prototype.lift = function (operator) {
1340
1200
  var subject = new AnonymousSubject(this, this);
1341
1201
  subject.operator = operator;
1342
1202
  return subject;
1343
1203
  };
1344
- Subject.prototype.next = function (value) {
1204
+ Subject.prototype._throwIfClosed = function () {
1345
1205
  if (this.closed) {
1346
1206
  throw new ObjectUnsubscribedError();
1347
1207
  }
1348
- if (!this.isStopped) {
1349
- var observers = this.observers;
1350
- var len = observers.length;
1351
- var copy = observers.slice();
1352
- for (var i = 0; i < len; i++) {
1353
- copy[i].next(value);
1208
+ };
1209
+ Subject.prototype.next = function (value) {
1210
+ var _this = this;
1211
+ errorContext(function () {
1212
+ var e_1, _a;
1213
+ _this._throwIfClosed();
1214
+ if (!_this.isStopped) {
1215
+ if (!_this.currentObservers) {
1216
+ _this.currentObservers = Array.from(_this.observers);
1217
+ }
1218
+ try {
1219
+ for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {
1220
+ var observer = _c.value;
1221
+ observer.next(value);
1222
+ }
1223
+ }
1224
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1225
+ finally {
1226
+ try {
1227
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1228
+ }
1229
+ finally { if (e_1) throw e_1.error; }
1230
+ }
1354
1231
  }
1355
- }
1232
+ });
1356
1233
  };
1357
1234
  Subject.prototype.error = function (err) {
1358
- if (this.closed) {
1359
- throw new ObjectUnsubscribedError();
1360
- }
1361
- this.hasError = true;
1362
- this.thrownError = err;
1363
- this.isStopped = true;
1364
- var observers = this.observers;
1365
- var len = observers.length;
1366
- var copy = observers.slice();
1367
- for (var i = 0; i < len; i++) {
1368
- copy[i].error(err);
1369
- }
1370
- this.observers.length = 0;
1235
+ var _this = this;
1236
+ errorContext(function () {
1237
+ _this._throwIfClosed();
1238
+ if (!_this.isStopped) {
1239
+ _this.hasError = _this.isStopped = true;
1240
+ _this.thrownError = err;
1241
+ var observers = _this.observers;
1242
+ while (observers.length) {
1243
+ observers.shift().error(err);
1244
+ }
1245
+ }
1246
+ });
1371
1247
  };
1372
1248
  Subject.prototype.complete = function () {
1373
- if (this.closed) {
1374
- throw new ObjectUnsubscribedError();
1375
- }
1376
- this.isStopped = true;
1377
- var observers = this.observers;
1378
- var len = observers.length;
1379
- var copy = observers.slice();
1380
- for (var i = 0; i < len; i++) {
1381
- copy[i].complete();
1382
- }
1383
- this.observers.length = 0;
1249
+ var _this = this;
1250
+ errorContext(function () {
1251
+ _this._throwIfClosed();
1252
+ if (!_this.isStopped) {
1253
+ _this.isStopped = true;
1254
+ var observers = _this.observers;
1255
+ while (observers.length) {
1256
+ observers.shift().complete();
1257
+ }
1258
+ }
1259
+ });
1384
1260
  };
1385
1261
  Subject.prototype.unsubscribe = function () {
1386
- this.isStopped = true;
1387
- this.closed = true;
1388
- this.observers = null;
1262
+ this.isStopped = this.closed = true;
1263
+ this.observers = this.currentObservers = null;
1389
1264
  };
1265
+ Object.defineProperty(Subject.prototype, "observed", {
1266
+ get: function () {
1267
+ var _a;
1268
+ return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;
1269
+ },
1270
+ enumerable: false,
1271
+ configurable: true
1272
+ });
1390
1273
  Subject.prototype._trySubscribe = function (subscriber) {
1391
- if (this.closed) {
1392
- throw new ObjectUnsubscribedError();
1393
- }
1394
- else {
1395
- return _super.prototype._trySubscribe.call(this, subscriber);
1396
- }
1274
+ this._throwIfClosed();
1275
+ return _super.prototype._trySubscribe.call(this, subscriber);
1397
1276
  };
1398
1277
  Subject.prototype._subscribe = function (subscriber) {
1399
- if (this.closed) {
1400
- throw new ObjectUnsubscribedError();
1278
+ this._throwIfClosed();
1279
+ this._checkFinalizedStatuses(subscriber);
1280
+ return this._innerSubscribe(subscriber);
1281
+ };
1282
+ Subject.prototype._innerSubscribe = function (subscriber) {
1283
+ var _this = this;
1284
+ var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;
1285
+ if (hasError || isStopped) {
1286
+ return EMPTY_SUBSCRIPTION;
1401
1287
  }
1402
- else if (this.hasError) {
1403
- subscriber.error(this.thrownError);
1404
- return Subscription$1.EMPTY;
1288
+ this.currentObservers = null;
1289
+ observers.push(subscriber);
1290
+ return new Subscription$1(function () {
1291
+ _this.currentObservers = null;
1292
+ arrRemove(observers, subscriber);
1293
+ });
1294
+ };
1295
+ Subject.prototype._checkFinalizedStatuses = function (subscriber) {
1296
+ var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;
1297
+ if (hasError) {
1298
+ subscriber.error(thrownError);
1405
1299
  }
1406
- else if (this.isStopped) {
1300
+ else if (isStopped) {
1407
1301
  subscriber.complete();
1408
- return Subscription$1.EMPTY;
1409
- }
1410
- else {
1411
- this.observers.push(subscriber);
1412
- return new SubjectSubscription(this, subscriber);
1413
1302
  }
1414
1303
  };
1415
1304
  Subject.prototype.asObservable = function () {
@@ -1422,8 +1311,8 @@ var Subject = /*@__PURE__*/ (function (_super) {
1422
1311
  };
1423
1312
  return Subject;
1424
1313
  }(Observable));
1425
- var AnonymousSubject = /*@__PURE__*/ (function (_super) {
1426
- tslib_1.__extends(AnonymousSubject, _super);
1314
+ var AnonymousSubject = (function (_super) {
1315
+ __extends(AnonymousSubject, _super);
1427
1316
  function AnonymousSubject(destination, source) {
1428
1317
  var _this = _super.call(this) || this;
1429
1318
  _this.destination = destination;
@@ -1431,31 +1320,20 @@ var AnonymousSubject = /*@__PURE__*/ (function (_super) {
1431
1320
  return _this;
1432
1321
  }
1433
1322
  AnonymousSubject.prototype.next = function (value) {
1434
- var destination = this.destination;
1435
- if (destination && destination.next) {
1436
- destination.next(value);
1437
- }
1323
+ var _a, _b;
1324
+ (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);
1438
1325
  };
1439
1326
  AnonymousSubject.prototype.error = function (err) {
1440
- var destination = this.destination;
1441
- if (destination && destination.error) {
1442
- this.destination.error(err);
1443
- }
1327
+ var _a, _b;
1328
+ (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);
1444
1329
  };
1445
1330
  AnonymousSubject.prototype.complete = function () {
1446
- var destination = this.destination;
1447
- if (destination && destination.complete) {
1448
- this.destination.complete();
1449
- }
1331
+ var _a, _b;
1332
+ (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);
1450
1333
  };
1451
1334
  AnonymousSubject.prototype._subscribe = function (subscriber) {
1452
- var source = this.source;
1453
- if (source) {
1454
- return this.source.subscribe(subscriber);
1455
- }
1456
- else {
1457
- return Subscription$1.EMPTY;
1458
- }
1335
+ var _a, _b;
1336
+ return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;
1459
1337
  };
1460
1338
  return AnonymousSubject;
1461
1339
  }(Subject));
@@ -1497,11 +1375,11 @@ class ReflectHelper {
1497
1375
  }
1498
1376
  static first({ key, target, property, own = true }) {
1499
1377
  const values = ReflectHelper.get({ key, target, property, own });
1500
- return isArray$1(values) ? first(values) : values;
1378
+ return isArray(values) ? first(values) : values;
1501
1379
  }
1502
1380
  static last({ key, target, property, own = true }) {
1503
1381
  const values = ReflectHelper.get({ key, target, property, own });
1504
- return isArray$1(values) ? last(values) : values;
1382
+ return isArray(values) ? last(values) : values;
1505
1383
  }
1506
1384
  static set({ key, target, property, value, propertyDescriptor }) {
1507
1385
  Reflect.defineMetadata(key, value, target, property);
@@ -1527,7 +1405,7 @@ class ReflectHelper {
1527
1405
  const values = target[property];
1528
1406
  let value = values.value;
1529
1407
  const propertyDescriptor = values.propertyDescriptor;
1530
- if (!isArray$1(value))
1408
+ if (!isArray(value))
1531
1409
  value = [value];
1532
1410
  return flatten(value.map((val) => {
1533
1411
  return {
@@ -2796,7 +2674,7 @@ const withFirestore = (MixinBase) => {
2796
2674
  if (iteratee(v, k)) {
2797
2675
  unset(value, k);
2798
2676
  }
2799
- else if (isObject$1(v)) {
2677
+ else if (isObject(v)) {
2800
2678
  omitByRecursivelyInPlace(v, iteratee);
2801
2679
  }
2802
2680
  });
@@ -2946,7 +2824,7 @@ const withFindFirestore = (MixinBase) => {
2946
2824
  FirestoreFieldType.Array ||
2947
2825
  !((_d = this.fields) === null || _d === void 0 ? void 0 : _d[firestoreFieldName])))
2948
2826
  return [[firestoreFieldName, 'array-contains', options.value]];
2949
- if (isObject$1(options) && isNil(options === null || options === void 0 ? void 0 : options.operator) && isNil(options === null || options === void 0 ? void 0 : options.value)) {
2827
+ if (isObject(options) && isNil(options === null || options === void 0 ? void 0 : options.operator) && isNil(options === null || options === void 0 ? void 0 : options.value)) {
2950
2828
  return Object.keys(options).reduce((queries, key) => [
2951
2829
  ...queries,
2952
2830
  ...this.buildWhereSentence(`${fieldName.toString()}.${key}`, is(options)[key]),
@@ -3930,7 +3808,7 @@ AttributeOptionHelper.FindByAttribute = (attributeName, fields) => {
3930
3808
  var _a;
3931
3809
  if (fields.includes(attributeName))
3932
3810
  return { columnName: attributeName.toString(), attributeName, to: (value) => value, from: (value) => value };
3933
- const field = fields.find((columnOption) => isObject$1(columnOption) && Object.keys(columnOption).includes(attributeName.toString()));
3811
+ const field = fields.find((columnOption) => isObject(columnOption) && Object.keys(columnOption).includes(attributeName.toString()));
3934
3812
  const fieldOption = (_a = is(field)) === null || _a === void 0 ? void 0 : _a[attributeName];
3935
3813
  if (isNil(fieldOption))
3936
3814
  return { columnName: attributeName.toString(), attributeName };
@@ -3943,7 +3821,7 @@ AttributeOptionHelper.FindColumnOptionFromList = (columnName, fields) => {
3943
3821
  if (fields.includes(columnName))
3944
3822
  return { columnName, attributeName: columnName };
3945
3823
  const field = is(fields.find((field) => {
3946
- if (!isObject$1(field))
3824
+ if (!isObject(field))
3947
3825
  return false;
3948
3826
  const columnOption = Object.values(field).find((option) => AttributeOptionHelper.CheckIsColumnOption(option) && option.columnName === columnName ? option : {});
3949
3827
  return AttributeOptionHelper.CheckIsColumnOption(columnOption) && (columnOption === null || columnOption === void 0 ? void 0 : columnOption.columnName) === columnName;
@@ -4060,7 +3938,7 @@ BindFilterQueryHelper.MakeGraphQLWhere = (filter, fields) => Object.keys(filter)
4060
3938
  BindFilterQueryHelper.BuildWhereSentence = (field, options, fields) => {
4061
3939
  const fieldSentenceOptions = AttributeOptionHelper.FindByAttribute(field, fields);
4062
3940
  const isNestedField = !Array.isArray(options) &&
4063
- isObject$1(options) &&
3941
+ isObject(options) &&
4064
3942
  isNil(options === null || options === void 0 ? void 0 : options.operator) &&
4065
3943
  isNil(options === null || options === void 0 ? void 0 : options.value) &&
4066
3944
  isNil(fieldSentenceOptions === null || fieldSentenceOptions === void 0 ? void 0 : fieldSentenceOptions.to);
@@ -4075,7 +3953,7 @@ BindFilterQueryHelper.BuildWhereSentence = (field, options, fields) => {
4075
3953
  return {
4076
3954
  [fieldSentenceOptions.fields[0]]: BindFilterQueryHelper.BuildOperatorSentence(options, fieldSentenceOptions),
4077
3955
  };
4078
- if (!Array.isArray(options) && isObject$1(options) && !FilterOptionHelper.CheckIfIsFilterOption(options))
3956
+ if (!Array.isArray(options) && isObject(options) && !FilterOptionHelper.CheckIfIsFilterOption(options))
4079
3957
  options = Object.values(options)[0];
4080
3958
  return Array.isArray(options)
4081
3959
  ? options.reduce((whereSentence, option) => (Object.assign(Object.assign({}, whereSentence), BindFilterQueryHelper.BuildOperatorSentence(option, fieldSentenceOptions))), {})
@@ -4131,7 +4009,7 @@ GraphQLFieldHelper.ConvertFieldValueFrom = (data, fields) => Object.keys(data).r
4131
4009
  return Object.assign(Object.assign({}, result), { [attributeName]: from
4132
4010
  ? from(data[columnName], data)
4133
4011
  : is(data[columnName]).map((value) => GraphQLFieldHelper.ConvertFieldValueFrom(is(value), attributeFields)) });
4134
- if (isObject$1(data[columnName]))
4012
+ if (isObject(data[columnName]))
4135
4013
  return Object.assign(Object.assign({}, result), { [attributeName]: !!from
4136
4014
  ? from(data[columnName])
4137
4015
  : GraphQLFieldHelper.ConvertFieldValueFrom(is(data[columnName]), attributeFields) });
@@ -4158,13 +4036,13 @@ GraphQLFieldHelper.ConvertFieldValueTo = (instance, fields, update = false) => {
4158
4036
  return Object.assign(Object.assign({}, object), { [foreignColumnName]: (_a = data[attributeName]) === null || _a === void 0 ? void 0 : _a[current] });
4159
4037
  }, Object.assign({}, result));
4160
4038
  if (update &&
4161
- isObject$1(data[attributeName]) &&
4039
+ isObject(data[attributeName]) &&
4162
4040
  !isNil(attributeFields) &&
4163
4041
  !isDate(data[attributeName]))
4164
4042
  return result;
4165
4043
  if (!!columnName &&
4166
4044
  Array.isArray(attributeFields) &&
4167
- isObject$1(data[attributeName])) {
4045
+ isObject(data[attributeName])) {
4168
4046
  const converted = !isNil(columnName) && to
4169
4047
  ? to(instance[attributeName], instance)
4170
4048
  : data[attributeName];