{"ast":null,"code":"import _inherits from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/createSuper\";\nimport _classCallCheck from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/createClass\";\nimport { Subscriber } from '../Subscriber';\nexport function count(predicate) {\n  return function (source) {\n    return source.lift(new CountOperator(predicate, source));\n  };\n}\n\nvar CountOperator = /*#__PURE__*/function () {\n  function CountOperator(predicate, source) {\n    _classCallCheck(this, CountOperator);\n\n    this.predicate = predicate;\n    this.source = source;\n  }\n\n  _createClass(CountOperator, [{\n    key: \"call\",\n    value: function call(subscriber, source) {\n      return source.subscribe(new CountSubscriber(subscriber, this.predicate, this.source));\n    }\n  }]);\n\n  return CountOperator;\n}();\n\nvar CountSubscriber = /*#__PURE__*/function (_Subscriber) {\n  _inherits(CountSubscriber, _Subscriber);\n\n  var _super = _createSuper(CountSubscriber);\n\n  function CountSubscriber(destination, predicate, source) {\n    var _this;\n\n    _classCallCheck(this, CountSubscriber);\n\n    _this = _super.call(this, destination);\n    _this.predicate = predicate;\n    _this.source = source;\n    _this.count = 0;\n    _this.index = 0;\n    return _this;\n  }\n\n  _createClass(CountSubscriber, [{\n    key: \"_next\",\n    value: function _next(value) {\n      if (this.predicate) {\n        this._tryPredicate(value);\n      } else {\n        this.count++;\n      }\n    }\n  }, {\n    key: \"_tryPredicate\",\n    value: function _tryPredicate(value) {\n      var result;\n\n      try {\n        result = this.predicate(value, this.index++, this.source);\n      } catch (err) {\n        this.destination.error(err);\n        return;\n      }\n\n      if (result) {\n        this.count++;\n      }\n    }\n  }, {\n    key: \"_complete\",\n    value: function _complete() {\n      this.destination.next(this.count);\n      this.destination.complete();\n    }\n  }]);\n\n  return CountSubscriber;\n}(Subscriber); //# sourceMappingURL=count.js.map","map":null,"metadata":{},"sourceType":"module"}