{"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 takeWhile(predicate) {\n  var inclusive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n  return function (source) {\n    return source.lift(new TakeWhileOperator(predicate, inclusive));\n  };\n}\n\nvar TakeWhileOperator = /*#__PURE__*/function () {\n  function TakeWhileOperator(predicate, inclusive) {\n    _classCallCheck(this, TakeWhileOperator);\n\n    this.predicate = predicate;\n    this.inclusive = inclusive;\n  }\n\n  _createClass(TakeWhileOperator, [{\n    key: \"call\",\n    value: function call(subscriber, source) {\n      return source.subscribe(new TakeWhileSubscriber(subscriber, this.predicate, this.inclusive));\n    }\n  }]);\n\n  return TakeWhileOperator;\n}();\n\nvar TakeWhileSubscriber = /*#__PURE__*/function (_Subscriber) {\n  _inherits(TakeWhileSubscriber, _Subscriber);\n\n  var _super = _createSuper(TakeWhileSubscriber);\n\n  function TakeWhileSubscriber(destination, predicate, inclusive) {\n    var _this;\n\n    _classCallCheck(this, TakeWhileSubscriber);\n\n    _this = _super.call(this, destination);\n    _this.predicate = predicate;\n    _this.inclusive = inclusive;\n    _this.index = 0;\n    return _this;\n  }\n\n  _createClass(TakeWhileSubscriber, [{\n    key: \"_next\",\n    value: function _next(value) {\n      var destination = this.destination;\n      var result;\n\n      try {\n        result = this.predicate(value, this.index++);\n      } catch (err) {\n        destination.error(err);\n        return;\n      }\n\n      this.nextOrComplete(value, result);\n    }\n  }, {\n    key: \"nextOrComplete\",\n    value: function nextOrComplete(value, predicateResult) {\n      var destination = this.destination;\n\n      if (Boolean(predicateResult)) {\n        destination.next(value);\n      } else {\n        if (this.inclusive) {\n          destination.next(value);\n        }\n\n        destination.complete();\n      }\n    }\n  }]);\n\n  return TakeWhileSubscriber;\n}(Subscriber); //# sourceMappingURL=takeWhile.js.map","map":null,"metadata":{},"sourceType":"module"}