var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
import { Inject, Injectable, NgZone } from '@angular/core';
import { BlockScrollStrategy, ScrollDispatcher, ScrollStrategyOptions } from '@angular/cdk/overlay';
import { ElLayoutScrollService } from '../../../services/scroll.service';
import { EL_DOCUMENT } from '../../../theme.options';
import { ElViewportRulerAdapter } from './viewport-ruler-adapter';
import * as i0 from "@angular/core";
import * as i1 from "../../../services/scroll.service";
import * as i2 from "@angular/cdk/scrolling";
import * as i3 from "./viewport-ruler-adapter";
import * as i4 from "../../../theme.options";
/**
 * Overrides default block scroll strategy because default strategy blocks scrolling on the body only.
 * But Endlessjs has its own scrollable container - el-layout. So, we need to block scrolling in it to.
 * */
var ElBlockScrollStrategyAdapter = /** @class */ (function (_super) {
    __extends(ElBlockScrollStrategyAdapter, _super);
    function ElBlockScrollStrategyAdapter(document, viewportRuler, scrollService) {
        var _this = _super.call(this, viewportRuler, document) || this;
        _this.scrollService = scrollService;
        return _this;
    }
    ElBlockScrollStrategyAdapter.prototype.enable = function () {
        _super.prototype.enable.call(this);
        this.scrollService.scrollable(false);
    };
    ElBlockScrollStrategyAdapter.prototype.disable = function () {
        _super.prototype.disable.call(this);
        this.scrollService.scrollable(true);
    };
    ElBlockScrollStrategyAdapter = __decorate([
        Injectable(),
        __param(0, Inject(EL_DOCUMENT)),
        __metadata("design:paramtypes", [Object, ElViewportRulerAdapter,
            ElLayoutScrollService])
    ], ElBlockScrollStrategyAdapter);
    return ElBlockScrollStrategyAdapter;
}(BlockScrollStrategy));
export { ElBlockScrollStrategyAdapter };
var ElScrollStrategyOptions = /** @class */ (function (_super) {
    __extends(ElScrollStrategyOptions, _super);
    function ElScrollStrategyOptions(scrollService, scrollDispatcher, viewportRuler, ngZone, document) {
        var _this = _super.call(this, scrollDispatcher, viewportRuler, ngZone, document) || this;
        _this.scrollService = scrollService;
        _this.scrollDispatcher = scrollDispatcher;
        _this.viewportRuler = viewportRuler;
        _this.ngZone = ngZone;
        _this.document = document;
        _this.block = function () { return new ElBlockScrollStrategyAdapter(_this.document, _this.viewportRuler, _this.scrollService); };
        return _this;
    }
    ElScrollStrategyOptions.ngInjectableDef = i0.ɵɵdefineInjectable({ factory: function ElScrollStrategyOptions_Factory() { return new ElScrollStrategyOptions(i0.ɵɵinject(i1.ElLayoutScrollService), i0.ɵɵinject(i2.ScrollDispatcher), i0.ɵɵinject(i3.ElViewportRulerAdapter), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(i4.EL_DOCUMENT)); }, token: ElScrollStrategyOptions, providedIn: "root" });
    ElScrollStrategyOptions = __decorate([
        __param(4, Inject(EL_DOCUMENT)),
        __metadata("design:paramtypes", [ElLayoutScrollService,
            ScrollDispatcher,
            ElViewportRulerAdapter,
            NgZone, Object])
    ], ElScrollStrategyOptions);
    return ElScrollStrategyOptions;
}(ScrollStrategyOptions));
export { ElScrollStrategyOptions };
//# sourceMappingURL=block-scroll-strategy-adapter.js.map