(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('ng-zorro-antd/core'), require('ng-zorro-antd/i18n'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('ng-zorro-antd/icon'), require('ng-zorro-antd/select'), require('@angular/forms')) :
    typeof define === 'function' && define.amd ? define('ng-zorro-antd/pagination', ['exports', '@angular/core', 'ng-zorro-antd/core', 'ng-zorro-antd/i18n', 'rxjs', 'rxjs/operators', '@angular/common', 'ng-zorro-antd/icon', 'ng-zorro-antd/select', '@angular/forms'], factory) :
    (global = global || self, factory((global['ng-zorro-antd'] = global['ng-zorro-antd'] || {}, global['ng-zorro-antd'].pagination = {}), global.ng.core, global['ng-zorro-antd'].core, global['ng-zorro-antd'].i18n, global.rxjs, global.rxjs.operators, global.ng.common, global['ng-zorro-antd'].icon, global['ng-zorro-antd'].select, global.ng.forms));
}(this, (function (exports, core, core$1, i18n, rxjs, operators, common, icon, select, forms) { 'use strict';

    /*! *****************************************************************************
    Copyright (c) Microsoft Corporation. All rights reserved.
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain a copy of the
    License at http://www.apache.org/licenses/LICENSE-2.0

    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
    MERCHANTABLITY OR NON-INFRINGEMENT.

    See the Apache Version 2.0 License for specific language governing permissions
    and limitations under the License.
    ***************************************************************************** */
    /* global Reflect, Promise */

    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);
    };

    function __extends(d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    }

    var __assign = function() {
        __assign = Object.assign || function __assign(t) {
            for (var s, i = 1, n = arguments.length; i < n; i++) {
                s = arguments[i];
                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
            }
            return t;
        };
        return __assign.apply(this, arguments);
    };

    function __rest(s, e) {
        var t = {};
        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
            t[p] = s[p];
        if (s != null && typeof Object.getOwnPropertySymbols === "function")
            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                    t[p[i]] = s[p[i]];
            }
        return t;
    }

    function __decorate(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;
    }

    function __param(paramIndex, decorator) {
        return function (target, key) { decorator(target, key, paramIndex); }
    }

    function __metadata(metadataKey, metadataValue) {
        if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
    }

    function __awaiter(thisArg, _arguments, P, generator) {
        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
        return new (P || (P = Promise))(function (resolve, reject) {
            function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
            function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
            function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
            step((generator = generator.apply(thisArg, _arguments || [])).next());
        });
    }

    function __generator(thisArg, body) {
        var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
        return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
        function verb(n) { return function (v) { return step([n, v]); }; }
        function step(op) {
            if (f) throw new TypeError("Generator is already executing.");
            while (_) try {
                if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
                if (y = 0, t) op = [op[0] & 2, t.value];
                switch (op[0]) {
                    case 0: case 1: t = op; break;
                    case 4: _.label++; return { value: op[1], done: false };
                    case 5: _.label++; y = op[1]; op = [0]; continue;
                    case 7: op = _.ops.pop(); _.trys.pop(); continue;
                    default:
                        if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                        if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                        if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                        if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                        if (t[2]) _.ops.pop();
                        _.trys.pop(); continue;
                }
                op = body.call(thisArg, _);
            } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
            if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
        }
    }

    function __exportStar(m, exports) {
        for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
    }

    function __values(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
            next: function () {
                if (o && i >= o.length) o = void 0;
                return { value: o && o[i++], done: !o };
            }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    }

    function __read(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i = m.call(o), r, ar = [], e;
        try {
            while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
        }
        catch (error) { e = { error: error }; }
        finally {
            try {
                if (r && !r.done && (m = i["return"])) m.call(i);
            }
            finally { if (e) throw e.error; }
        }
        return ar;
    }

    function __spread() {
        for (var ar = [], i = 0; i < arguments.length; i++)
            ar = ar.concat(__read(arguments[i]));
        return ar;
    }

    function __spreadArrays() {
        for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
        for (var r = Array(s), k = 0, i = 0; i < il; i++)
            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
                r[k] = a[j];
        return r;
    };

    function __await(v) {
        return this instanceof __await ? (this.v = v, this) : new __await(v);
    }

    function __asyncGenerator(thisArg, _arguments, generator) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var g = generator.apply(thisArg, _arguments || []), i, q = [];
        return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
        function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
        function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
        function fulfill(value) { resume("next", value); }
        function reject(value) { resume("throw", value); }
        function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
    }

    function __asyncDelegator(o) {
        var i, p;
        return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
        function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
    }

    function __asyncValues(o) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var m = o[Symbol.asyncIterator], i;
        return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
        function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
    }

    function __makeTemplateObject(cooked, raw) {
        if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
        return cooked;
    };

    function __importStar(mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
        result.default = mod;
        return result;
    }

    function __importDefault(mod) {
        return (mod && mod.__esModule) ? mod : { default: mod };
    }

    function __classPrivateFieldGet(receiver, privateMap) {
        if (!privateMap.has(receiver)) {
            throw new TypeError("attempted to get private field on non-instance");
        }
        return privateMap.get(receiver);
    }

    function __classPrivateFieldSet(receiver, privateMap, value) {
        if (!privateMap.has(receiver)) {
            throw new TypeError("attempted to set private field on non-instance");
        }
        privateMap.set(receiver, value);
        return value;
    }

    /**
     * @license
     * Copyright Alibaba.com All Rights Reserved.
     *
     * Use of this source code is governed by an MIT-style license that can be
     * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
     */
    var _c0 = ["nz-pagination-item", ""];
    function NzPaginationItemComponent_ng_template_0_a_1_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelementStart"](0, "a");
        core["ɵɵtext"](1);
        core["ɵɵelementEnd"]();
    } if (rf & 2) {
        var page_r2660 = core["ɵɵnextContext"]().page;
        core["ɵɵadvance"](1);
        core["ɵɵtextInterpolate"](page_r2660);
    } }
    function NzPaginationItemComponent_ng_template_0_ng_container_2_i_2_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelement"](0, "i", 9);
    } }
    function NzPaginationItemComponent_ng_template_0_ng_container_2_i_3_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelement"](0, "i", 10);
    } }
    function NzPaginationItemComponent_ng_template_0_ng_container_2_div_4_i_2_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelement"](0, "i", 15);
    } }
    function NzPaginationItemComponent_ng_template_0_ng_container_2_div_4_i_3_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelement"](0, "i", 16);
    } }
    function NzPaginationItemComponent_ng_template_0_ng_container_2_div_4_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelementStart"](0, "div", 11);
        core["ɵɵelementContainerStart"](1, 2);
        core["ɵɵtemplate"](2, NzPaginationItemComponent_ng_template_0_ng_container_2_div_4_i_2_Template, 1, 0, "i", 12);
        core["ɵɵtemplate"](3, NzPaginationItemComponent_ng_template_0_ng_container_2_div_4_i_3_Template, 1, 0, "i", 13);
        core["ɵɵelementContainerEnd"]();
        core["ɵɵelementStart"](4, "span", 14);
        core["ɵɵtext"](5, "\u2022\u2022\u2022");
        core["ɵɵelementEnd"]();
        core["ɵɵelementEnd"]();
    } if (rf & 2) {
        var type_r2659 = core["ɵɵnextContext"](2).$implicit;
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngSwitch", type_r2659);
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngSwitchCase", "prev_5");
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngSwitchCase", "next_5");
    } }
    function NzPaginationItemComponent_ng_template_0_ng_container_2_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelementContainerStart"](0);
        core["ɵɵelementStart"](1, "a", 5);
        core["ɵɵtemplate"](2, NzPaginationItemComponent_ng_template_0_ng_container_2_i_2_Template, 1, 0, "i", 6);
        core["ɵɵtemplate"](3, NzPaginationItemComponent_ng_template_0_ng_container_2_i_3_Template, 1, 0, "i", 7);
        core["ɵɵtemplate"](4, NzPaginationItemComponent_ng_template_0_ng_container_2_div_4_Template, 6, 3, "div", 8);
        core["ɵɵelementEnd"]();
        core["ɵɵelementContainerEnd"]();
    } if (rf & 2) {
        var type_r2659 = core["ɵɵnextContext"]().$implicit;
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngSwitch", type_r2659);
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngSwitchCase", "prev");
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngSwitchCase", "next");
    } }
    function NzPaginationItemComponent_ng_template_0_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelementContainerStart"](0, 2);
        core["ɵɵtemplate"](1, NzPaginationItemComponent_ng_template_0_a_1_Template, 2, 1, "a", 3);
        core["ɵɵtemplate"](2, NzPaginationItemComponent_ng_template_0_ng_container_2_Template, 5, 3, "ng-container", 4);
        core["ɵɵelementContainerEnd"]();
    } if (rf & 2) {
        var type_r2659 = ctx.$implicit;
        core["ɵɵproperty"]("ngSwitch", type_r2659);
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngSwitchCase", "page");
    } }
    function NzPaginationItemComponent_ng_template_2_Template(rf, ctx) { }
    var _c1 = function (a0, a1) { return { $implicit: a0, page: a1 }; };
    var NzPaginationItemComponent = /** @class */ (function () {
        function NzPaginationItemComponent() {
            this.active = false;
            this.locale = {};
            this.index = null;
            this.disabled = false;
            this.type = null;
            this.itemRender = null;
            this.diffIndex = new core.EventEmitter();
            this.gotoIndex = new core.EventEmitter();
            this.title = null;
        }
        NzPaginationItemComponent.prototype.clickItem = function () {
            if (!this.disabled) {
                if (this.type === 'page') {
                    this.gotoIndex.emit(this.index);
                }
                else {
                    this.diffIndex.emit({
                        next: 1,
                        prev: -1,
                        prev_5: -5,
                        next_5: 5
                    }[this.type]);
                }
            }
        };
        NzPaginationItemComponent.prototype.ngOnChanges = function (changes) {
            var locale = changes.locale, index = changes.index, type = changes.type;
            if (locale || index || type) {
                this.title = {
                    page: "" + this.index,
                    next: this.locale.next_page,
                    prev: this.locale.prev_page,
                    prev_5: this.locale.prev_5,
                    next_5: this.locale.next_5
                }[this.type];
            }
        };
        /** @nocollapse */ NzPaginationItemComponent.ɵfac = function NzPaginationItemComponent_Factory(t) { return new (t || NzPaginationItemComponent)(); };
        /** @nocollapse */ NzPaginationItemComponent.ɵcmp = core["ɵɵdefineComponent"]({ type: NzPaginationItemComponent, selectors: [["li", "nz-pagination-item", ""]], hostVars: 19, hostBindings: function NzPaginationItemComponent_HostBindings(rf, ctx) { if (rf & 1) {
                core["ɵɵlistener"]("click", function NzPaginationItemComponent_click_HostBindingHandler() { return ctx.clickItem(); });
            } if (rf & 2) {
                core["ɵɵattribute"]("title", ctx.title);
                core["ɵɵclassProp"]("ant-pagination-prev", ctx.type === "prev")("ant-pagination-next", ctx.type === "next")("ant-pagination-item", ctx.type === "page")("ant-pagination-jump-prev", ctx.type === "prev_5")("ant-pagination-jump-prev-custom-icon", ctx.type === "prev_5")("ant-pagination-jump-next", ctx.type === "next_5")("ant-pagination-jump-next-custom-icon", ctx.type === "next_5")("ant-pagination-disabled", ctx.disabled)("ant-pagination-item-active", ctx.active);
            } }, inputs: { active: "active", locale: "locale", index: "index", disabled: "disabled", type: "type", itemRender: "itemRender" }, outputs: { diffIndex: "diffIndex", gotoIndex: "gotoIndex" }, features: [core["ɵɵNgOnChangesFeature"]], attrs: _c0, decls: 3, vars: 5, consts: [["renderItemTemplate", ""], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], [3, "ngSwitch"], [4, "ngSwitchCase"], [4, "ngSwitchDefault"], [1, "ant-pagination-item-link", 3, "ngSwitch"], ["nz-icon", "", "nzType", "left", 4, "ngSwitchCase"], ["nz-icon", "", "nzType", "right", 4, "ngSwitchCase"], ["class", "ant-pagination-item-container", 4, "ngSwitchDefault"], ["nz-icon", "", "nzType", "left"], ["nz-icon", "", "nzType", "right"], [1, "ant-pagination-item-container"], ["nz-icon", "", "nzType", "double-left", "class", "ant-pagination-item-link-icon", 4, "ngSwitchCase"], ["nz-icon", "", "nzType", "double-right", "class", "ant-pagination-item-link-icon", 4, "ngSwitchCase"], [1, "ant-pagination-item-ellipsis"], ["nz-icon", "", "nzType", "double-left", 1, "ant-pagination-item-link-icon"], ["nz-icon", "", "nzType", "double-right", 1, "ant-pagination-item-link-icon"]], template: function NzPaginationItemComponent_Template(rf, ctx) { if (rf & 1) {
                core["ɵɵtemplate"](0, NzPaginationItemComponent_ng_template_0_Template, 3, 2, "ng-template", null, 0, core["ɵɵtemplateRefExtractor"]);
                core["ɵɵtemplate"](2, NzPaginationItemComponent_ng_template_2_Template, 0, 0, "ng-template", 1);
            } if (rf & 2) {
                var _r2656 = core["ɵɵreference"](1);
                core["ɵɵadvance"](2);
                core["ɵɵproperty"]("ngTemplateOutlet", ctx.itemRender || _r2656)("ngTemplateOutletContext", core["ɵɵpureFunction2"](2, _c1, ctx.type, ctx.index));
            } }, directives: [common.NgTemplateOutlet, common.NgSwitch, common.NgSwitchCase, common.NgSwitchDefault, icon.NzIconDirective], encapsulation: 2, changeDetection: 0 });
        return NzPaginationItemComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzPaginationItemComponent, [{
            type: core.Component,
            args: [{
                    selector: 'li[nz-pagination-item]',
                    preserveWhitespaces: false,
                    encapsulation: core.ViewEncapsulation.None,
                    changeDetection: core.ChangeDetectionStrategy.OnPush,
                    template: "\n    <ng-template #renderItemTemplate let-type let-page=\"page\">\n      <ng-container [ngSwitch]=\"type\">\n        <a *ngSwitchCase=\"'page'\">{{ page }}</a>\n        <ng-container *ngSwitchDefault>\n          <a class=\"ant-pagination-item-link\" [ngSwitch]=\"type\">\n            <i nz-icon nzType=\"left\" *ngSwitchCase=\"'prev'\"></i>\n            <i nz-icon nzType=\"right\" *ngSwitchCase=\"'next'\"></i>\n            <div class=\"ant-pagination-item-container\" *ngSwitchDefault>\n              <ng-container [ngSwitch]=\"type\">\n                <i *ngSwitchCase=\"'prev_5'\" nz-icon nzType=\"double-left\" class=\"ant-pagination-item-link-icon\"></i>\n                <i *ngSwitchCase=\"'next_5'\" nz-icon nzType=\"double-right\" class=\"ant-pagination-item-link-icon\"></i>\n              </ng-container>\n              <span class=\"ant-pagination-item-ellipsis\">\u2022\u2022\u2022</span>\n            </div>\n          </a>\n        </ng-container>\n      </ng-container>\n    </ng-template>\n    <ng-template\n      [ngTemplateOutlet]=\"itemRender || renderItemTemplate\"\n      [ngTemplateOutletContext]=\"{ $implicit: type, page: index }\"\n    ></ng-template>\n  ",
                    host: {
                        '[class.ant-pagination-prev]': "type === 'prev'",
                        '[class.ant-pagination-next]': "type === 'next'",
                        '[class.ant-pagination-item]': "type === 'page'",
                        '[class.ant-pagination-jump-prev]': "type === 'prev_5'",
                        '[class.ant-pagination-jump-prev-custom-icon]': "type === 'prev_5'",
                        '[class.ant-pagination-jump-next]': "type === 'next_5'",
                        '[class.ant-pagination-jump-next-custom-icon]': "type === 'next_5'",
                        '[class.ant-pagination-disabled]': 'disabled',
                        '[class.ant-pagination-item-active]]': 'active',
                        '[attr.title]': 'title',
                        '(click)': 'clickItem()'
                    }
                }]
        }], null, { active: [{
                type: core.Input
            }], locale: [{
                type: core.Input
            }], index: [{
                type: core.Input
            }], disabled: [{
                type: core.Input
            }], type: [{
                type: core.Input
            }], itemRender: [{
                type: core.Input
            }], diffIndex: [{
                type: core.Output
            }], gotoIndex: [{
                type: core.Output
            }] }); })();

    /**
     * @license
     * Copyright Alibaba.com All Rights Reserved.
     *
     * Use of this source code is governed by an MIT-style license that can be
     * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
     */
    var _c0$1 = ["nz-pagination-simple", ""];
    var NzPaginationSimpleComponent = /** @class */ (function () {
        function NzPaginationSimpleComponent() {
            this.itemRender = null;
            this.disabled = false;
            this.locale = {};
            this.total = 0;
            this.pageIndex = 1;
            this.pageSize = 10;
            this.pageIndexChange = new core.EventEmitter();
            this.lastIndex = 0;
            this.isFirstIndex = false;
            this.isLastIndex = false;
        }
        NzPaginationSimpleComponent.prototype.jumpToPageViaInput = function ($event) {
            var target = $event.target;
            var index = core$1.toNumber(target.value, this.pageIndex);
            this.onPageIndexChange(index);
            target.value = "" + this.pageIndex;
        };
        NzPaginationSimpleComponent.prototype.prePage = function () {
            this.onPageIndexChange(this.pageIndex - 1);
        };
        NzPaginationSimpleComponent.prototype.nextPage = function () {
            this.onPageIndexChange(this.pageIndex + 1);
        };
        NzPaginationSimpleComponent.prototype.onPageIndexChange = function (index) {
            this.pageIndexChange.next(index);
        };
        NzPaginationSimpleComponent.prototype.updateBindingValue = function () {
            this.lastIndex = Math.ceil(this.total / this.pageSize);
            this.isFirstIndex = this.pageIndex === 1;
            this.isLastIndex = this.pageIndex === this.lastIndex;
        };
        NzPaginationSimpleComponent.prototype.ngOnChanges = function (changes) {
            var pageIndex = changes.pageIndex, total = changes.total, pageSize = changes.pageSize;
            if (pageIndex || total || pageSize) {
                this.updateBindingValue();
            }
        };
        /** @nocollapse */ NzPaginationSimpleComponent.ɵfac = function NzPaginationSimpleComponent_Factory(t) { return new (t || NzPaginationSimpleComponent)(); };
        /** @nocollapse */ NzPaginationSimpleComponent.ɵcmp = core["ɵɵdefineComponent"]({ type: NzPaginationSimpleComponent, selectors: [["ul", "nz-pagination-simple", ""]], hostVars: 6, hostBindings: function NzPaginationSimpleComponent_HostBindings(rf, ctx) { if (rf & 2) {
                core["ɵɵclassProp"]("ant-pagination", true)("ant-pagination-simple", true)("ant-pagination-disabled", ctx.disabled);
            } }, inputs: { itemRender: "itemRender", disabled: "disabled", locale: "locale", total: "total", pageIndex: "pageIndex", pageSize: "pageSize" }, outputs: { pageIndexChange: "pageIndexChange" }, features: [core["ɵɵNgOnChangesFeature"]], attrs: _c0$1, decls: 7, vars: 10, consts: [["nz-pagination-item", "", "type", "prev", 3, "disabled", "itemRender", "click"], [1, "ant-pagination-simple-pager"], ["size", "3", 3, "disabled", "value", "keydown.enter"], [1, "ant-pagination-slash"], ["nz-pagination-item", "", "type", "next", 3, "disabled", "itemRender", "click"]], template: function NzPaginationSimpleComponent_Template(rf, ctx) { if (rf & 1) {
                core["ɵɵelementStart"](0, "li", 0);
                core["ɵɵlistener"]("click", function NzPaginationSimpleComponent_Template_li_click_0_listener() { return ctx.prePage(); });
                core["ɵɵelementEnd"]();
                core["ɵɵelementStart"](1, "li", 1);
                core["ɵɵelementStart"](2, "input", 2);
                core["ɵɵlistener"]("keydown.enter", function NzPaginationSimpleComponent_Template_input_keydown_enter_2_listener($event) { return ctx.jumpToPageViaInput($event); });
                core["ɵɵelementEnd"]();
                core["ɵɵelementStart"](3, "span", 3);
                core["ɵɵtext"](4, "/");
                core["ɵɵelementEnd"]();
                core["ɵɵtext"](5);
                core["ɵɵelementEnd"]();
                core["ɵɵelementStart"](6, "li", 4);
                core["ɵɵlistener"]("click", function NzPaginationSimpleComponent_Template_li_click_6_listener() { return ctx.nextPage(); });
                core["ɵɵelementEnd"]();
            } if (rf & 2) {
                core["ɵɵproperty"]("disabled", ctx.isFirstIndex)("itemRender", ctx.itemRender);
                core["ɵɵattribute"]("title", ctx.locale.prev_page);
                core["ɵɵadvance"](1);
                core["ɵɵattribute"]("title", ctx.pageIndex + "/" + ctx.lastIndex);
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("disabled", ctx.disabled)("value", ctx.pageIndex);
                core["ɵɵadvance"](3);
                core["ɵɵtextInterpolate1"](" ", ctx.lastIndex, " ");
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("disabled", ctx.isLastIndex)("itemRender", ctx.itemRender);
                core["ɵɵattribute"]("title", ctx.locale.next_page);
            } }, directives: [NzPaginationItemComponent], encapsulation: 2, changeDetection: 0 });
        return NzPaginationSimpleComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzPaginationSimpleComponent, [{
            type: core.Component,
            args: [{
                    selector: 'ul[nz-pagination-simple]',
                    preserveWhitespaces: false,
                    encapsulation: core.ViewEncapsulation.None,
                    changeDetection: core.ChangeDetectionStrategy.OnPush,
                    template: "\n    <li\n      nz-pagination-item\n      [attr.title]=\"locale.prev_page\"\n      [disabled]=\"isFirstIndex\"\n      (click)=\"prePage()\"\n      type=\"prev\"\n      [itemRender]=\"itemRender\"\n    ></li>\n    <li [attr.title]=\"pageIndex + '/' + lastIndex\" class=\"ant-pagination-simple-pager\">\n      <input [disabled]=\"disabled\" [value]=\"pageIndex\" (keydown.enter)=\"jumpToPageViaInput($event)\" size=\"3\" />\n      <span class=\"ant-pagination-slash\">/</span>\n      {{ lastIndex }}\n    </li>\n    <li\n      nz-pagination-item\n      [attr.title]=\"locale.next_page\"\n      [disabled]=\"isLastIndex\"\n      (click)=\"nextPage()\"\n      type=\"next\"\n      [itemRender]=\"itemRender\"\n    ></li>\n  ",
                    host: {
                        '[class.ant-pagination]': 'true',
                        '[class.ant-pagination-simple]': 'true',
                        '[class.ant-pagination-disabled]': 'disabled'
                    }
                }]
        }], null, { itemRender: [{
                type: core.Input
            }], disabled: [{
                type: core.Input
            }], locale: [{
                type: core.Input
            }], total: [{
                type: core.Input
            }], pageIndex: [{
                type: core.Input
            }], pageSize: [{
                type: core.Input
            }], pageIndexChange: [{
                type: core.Output
            }] }); })();

    var _c0$2 = ["nz-pagination-options", ""];
    function NzPaginationOptionsComponent_nz_select_0_nz_option_1_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelement"](0, "nz-option", 4);
    } if (rf & 2) {
        var option_r2685 = ctx.$implicit;
        core["ɵɵproperty"]("nzLabel", option_r2685.label)("nzValue", option_r2685.value);
    } }
    function NzPaginationOptionsComponent_nz_select_0_Template(rf, ctx) { if (rf & 1) {
        var _r2687 = core["ɵɵgetCurrentView"]();
        core["ɵɵelementStart"](0, "nz-select", 2);
        core["ɵɵlistener"]("ngModelChange", function NzPaginationOptionsComponent_nz_select_0_Template_nz_select_ngModelChange_0_listener($event) { core["ɵɵrestoreView"](_r2687); var ctx_r2686 = core["ɵɵnextContext"](); return ctx_r2686.onPageSizeChange($event); });
        core["ɵɵtemplate"](1, NzPaginationOptionsComponent_nz_select_0_nz_option_1_Template, 1, 2, "nz-option", 3);
        core["ɵɵelementEnd"]();
    } if (rf & 2) {
        var ctx_r2682 = core["ɵɵnextContext"]();
        core["ɵɵproperty"]("nzDisabled", ctx_r2682.disabled)("nzSize", ctx_r2682.nzSize)("ngModel", ctx_r2682.pageSize);
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngForOf", ctx_r2682.listOfPageSizeOption)("ngForTrackBy", ctx_r2682.trackByOption);
    } }
    function NzPaginationOptionsComponent_div_1_Template(rf, ctx) { if (rf & 1) {
        var _r2689 = core["ɵɵgetCurrentView"]();
        core["ɵɵelementStart"](0, "div", 5);
        core["ɵɵtext"](1);
        core["ɵɵelementStart"](2, "input", 6);
        core["ɵɵlistener"]("keydown.enter", function NzPaginationOptionsComponent_div_1_Template_input_keydown_enter_2_listener($event) { core["ɵɵrestoreView"](_r2689); var ctx_r2688 = core["ɵɵnextContext"](); return ctx_r2688.jumpToPageViaInput($event); });
        core["ɵɵelementEnd"]();
        core["ɵɵtext"](3);
        core["ɵɵelementEnd"]();
    } if (rf & 2) {
        var ctx_r2683 = core["ɵɵnextContext"]();
        core["ɵɵadvance"](1);
        core["ɵɵtextInterpolate1"](" ", ctx_r2683.locale.jump_to, " ");
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("disabled", ctx_r2683.disabled);
        core["ɵɵadvance"](1);
        core["ɵɵtextInterpolate1"](" ", ctx_r2683.locale.page, " ");
    } }
    var NzPaginationOptionsComponent = /** @class */ (function () {
        function NzPaginationOptionsComponent() {
            this.nzSize = 'default';
            this.disabled = false;
            this.showSizeChanger = false;
            this.showQuickJumper = false;
            this.locale = {};
            this.total = 0;
            this.pageIndex = 1;
            this.pageSize = 10;
            this.pageSizeOptions = [];
            this.pageIndexChange = new core.EventEmitter();
            this.pageSizeChange = new core.EventEmitter();
            this.listOfPageSizeOption = [];
        }
        NzPaginationOptionsComponent.prototype.onPageSizeChange = function (size) {
            if (this.pageSize !== size) {
                this.pageSizeChange.next(size);
            }
        };
        NzPaginationOptionsComponent.prototype.jumpToPageViaInput = function ($event) {
            var target = $event.target;
            var index = core$1.toNumber(target.value, this.pageIndex);
            this.pageIndexChange.next(index);
            target.value = '';
        };
        NzPaginationOptionsComponent.prototype.trackByOption = function (_, option) {
            return option.value;
        };
        NzPaginationOptionsComponent.prototype.ngOnChanges = function (changes) {
            var _this = this;
            var pageSize = changes.pageSize, pageSizeOptions = changes.pageSizeOptions, locale = changes.locale;
            if (pageSize || pageSizeOptions || locale) {
                this.listOfPageSizeOption = __spread(new Set(__spread(this.pageSizeOptions, [this.pageSize]))).map(function (item) {
                    return {
                        value: item,
                        label: item + " " + _this.locale.items_per_page
                    };
                });
            }
        };
        /** @nocollapse */ NzPaginationOptionsComponent.ɵfac = function NzPaginationOptionsComponent_Factory(t) { return new (t || NzPaginationOptionsComponent)(); };
        /** @nocollapse */ NzPaginationOptionsComponent.ɵcmp = core["ɵɵdefineComponent"]({ type: NzPaginationOptionsComponent, selectors: [["div", "nz-pagination-options", ""]], hostVars: 2, hostBindings: function NzPaginationOptionsComponent_HostBindings(rf, ctx) { if (rf & 2) {
                core["ɵɵclassProp"]("ant-pagination-options", true);
            } }, inputs: { nzSize: "nzSize", disabled: "disabled", showSizeChanger: "showSizeChanger", showQuickJumper: "showQuickJumper", locale: "locale", total: "total", pageIndex: "pageIndex", pageSize: "pageSize", pageSizeOptions: "pageSizeOptions" }, outputs: { pageIndexChange: "pageIndexChange", pageSizeChange: "pageSizeChange" }, features: [core["ɵɵNgOnChangesFeature"]], attrs: _c0$2, decls: 2, vars: 2, consts: [["class", "ant-pagination-options-size-changer", 3, "nzDisabled", "nzSize", "ngModel", "ngModelChange", 4, "ngIf"], ["class", "ant-pagination-options-quick-jumper", 4, "ngIf"], [1, "ant-pagination-options-size-changer", 3, "nzDisabled", "nzSize", "ngModel", "ngModelChange"], [3, "nzLabel", "nzValue", 4, "ngFor", "ngForOf", "ngForTrackBy"], [3, "nzLabel", "nzValue"], [1, "ant-pagination-options-quick-jumper"], [3, "disabled", "keydown.enter"]], template: function NzPaginationOptionsComponent_Template(rf, ctx) { if (rf & 1) {
                core["ɵɵtemplate"](0, NzPaginationOptionsComponent_nz_select_0_Template, 2, 5, "nz-select", 0);
                core["ɵɵtemplate"](1, NzPaginationOptionsComponent_div_1_Template, 4, 3, "div", 1);
            } if (rf & 2) {
                core["ɵɵproperty"]("ngIf", ctx.showSizeChanger);
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngIf", ctx.showQuickJumper);
            } }, directives: [common.NgIf, select.NzSelectComponent, forms.NgControlStatus, forms.NgModel, common.NgForOf, select.NzOptionComponent], encapsulation: 2, changeDetection: 0 });
        return NzPaginationOptionsComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzPaginationOptionsComponent, [{
            type: core.Component,
            args: [{
                    selector: 'div[nz-pagination-options]',
                    preserveWhitespaces: false,
                    encapsulation: core.ViewEncapsulation.None,
                    changeDetection: core.ChangeDetectionStrategy.OnPush,
                    template: "\n    <nz-select\n      class=\"ant-pagination-options-size-changer\"\n      *ngIf=\"showSizeChanger\"\n      [nzDisabled]=\"disabled\"\n      [nzSize]=\"nzSize\"\n      [ngModel]=\"pageSize\"\n      (ngModelChange)=\"onPageSizeChange($event)\"\n    >\n      <nz-option\n        *ngFor=\"let option of listOfPageSizeOption; trackBy: trackByOption\"\n        [nzLabel]=\"option.label\"\n        [nzValue]=\"option.value\"\n      ></nz-option>\n    </nz-select>\n    <div class=\"ant-pagination-options-quick-jumper\" *ngIf=\"showQuickJumper\">\n      {{ locale.jump_to }}\n      <input [disabled]=\"disabled\" (keydown.enter)=\"jumpToPageViaInput($event)\" />\n      {{ locale.page }}\n    </div>\n  ",
                    host: {
                        '[class.ant-pagination-options]': 'true'
                    }
                }]
        }], null, { nzSize: [{
                type: core.Input
            }], disabled: [{
                type: core.Input
            }], showSizeChanger: [{
                type: core.Input
            }], showQuickJumper: [{
                type: core.Input
            }], locale: [{
                type: core.Input
            }], total: [{
                type: core.Input
            }], pageIndex: [{
                type: core.Input
            }], pageSize: [{
                type: core.Input
            }], pageSizeOptions: [{
                type: core.Input
            }], pageIndexChange: [{
                type: core.Output
            }], pageSizeChange: [{
                type: core.Output
            }] }); })();

    var _c0$3 = ["nz-pagination-default", ""];
    function NzPaginationDefaultComponent_li_0_ng_template_1_Template(rf, ctx) { }
    var _c1$1 = function (a0, a1) { return { $implicit: a0, range: a1 }; };
    function NzPaginationDefaultComponent_li_0_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelementStart"](0, "li", 3);
        core["ɵɵtemplate"](1, NzPaginationDefaultComponent_li_0_ng_template_1_Template, 0, 0, "ng-template", 4);
        core["ɵɵelementEnd"]();
    } if (rf & 2) {
        var ctx_r2671 = core["ɵɵnextContext"]();
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngTemplateOutlet", ctx_r2671.showTotal)("ngTemplateOutletContext", core["ɵɵpureFunction2"](2, _c1$1, ctx_r2671.total, ctx_r2671.ranges));
    } }
    function NzPaginationDefaultComponent_li_1_Template(rf, ctx) { if (rf & 1) {
        var _r2677 = core["ɵɵgetCurrentView"]();
        core["ɵɵelementStart"](0, "li", 5);
        core["ɵɵlistener"]("gotoIndex", function NzPaginationDefaultComponent_li_1_Template_li_gotoIndex_0_listener($event) { core["ɵɵrestoreView"](_r2677); var ctx_r2676 = core["ɵɵnextContext"](); return ctx_r2676.jumpPage($event); })("diffIndex", function NzPaginationDefaultComponent_li_1_Template_li_diffIndex_0_listener($event) { core["ɵɵrestoreView"](_r2677); var ctx_r2678 = core["ɵɵnextContext"](); return ctx_r2678.jumpDiff($event); });
        core["ɵɵelementEnd"]();
    } if (rf & 2) {
        var page_r2675 = ctx.$implicit;
        var ctx_r2672 = core["ɵɵnextContext"]();
        core["ɵɵproperty"]("locale", ctx_r2672.locale)("type", page_r2675.type)("index", page_r2675.index)("disabled", page_r2675.disabled)("itemRender", ctx_r2672.itemRender)("active", ctx_r2672.pageIndex === page_r2675.index);
    } }
    function NzPaginationDefaultComponent_div_2_Template(rf, ctx) { if (rf & 1) {
        var _r2680 = core["ɵɵgetCurrentView"]();
        core["ɵɵelementStart"](0, "div", 6);
        core["ɵɵlistener"]("pageIndexChange", function NzPaginationDefaultComponent_div_2_Template_div_pageIndexChange_0_listener($event) { core["ɵɵrestoreView"](_r2680); var ctx_r2679 = core["ɵɵnextContext"](); return ctx_r2679.onPageIndexChange($event); })("pageSizeChange", function NzPaginationDefaultComponent_div_2_Template_div_pageSizeChange_0_listener($event) { core["ɵɵrestoreView"](_r2680); var ctx_r2681 = core["ɵɵnextContext"](); return ctx_r2681.onPageSizeChange($event); });
        core["ɵɵelementEnd"]();
    } if (rf & 2) {
        var ctx_r2673 = core["ɵɵnextContext"]();
        core["ɵɵproperty"]("total", ctx_r2673.total)("locale", ctx_r2673.locale)("disabled", ctx_r2673.disabled)("nzSize", ctx_r2673.nzSize)("showSizeChanger", ctx_r2673.showSizeChanger)("showQuickJumper", ctx_r2673.showQuickJumper)("pageIndex", ctx_r2673.pageIndex)("pageSize", ctx_r2673.pageSize)("pageSizeOptions", ctx_r2673.pageSizeOptions);
    } }
    var NzPaginationDefaultComponent = /** @class */ (function () {
        function NzPaginationDefaultComponent() {
            this.nzSize = 'default';
            this.showTotal = null;
            this.disabled = false;
            this.locale = {};
            this.showSizeChanger = false;
            this.showQuickJumper = false;
            this.total = 0;
            this.pageIndex = 1;
            this.pageSize = 10;
            this.pageSizeOptions = [10, 20, 30, 40];
            this.pageIndexChange = new core.EventEmitter();
            this.pageSizeChange = new core.EventEmitter();
            this.ranges = [0, 0];
            this.listOfPageItem = [];
        }
        NzPaginationDefaultComponent.prototype.jumpPage = function (index) {
            this.onPageIndexChange(index);
        };
        NzPaginationDefaultComponent.prototype.jumpDiff = function (diff) {
            this.jumpPage(this.pageIndex + diff);
        };
        NzPaginationDefaultComponent.prototype.trackByPageItem = function (_, value) {
            return value.type + "-" + value.index;
        };
        NzPaginationDefaultComponent.prototype.onPageIndexChange = function (index) {
            this.pageIndexChange.next(index);
        };
        NzPaginationDefaultComponent.prototype.onPageSizeChange = function (size) {
            this.pageSizeChange.next(size);
        };
        NzPaginationDefaultComponent.prototype.getLastIndex = function (total, pageSize) {
            return Math.ceil(total / pageSize);
        };
        NzPaginationDefaultComponent.prototype.buildIndexes = function () {
            var lastIndex = this.getLastIndex(this.total, this.pageSize);
            this.listOfPageItem = this.getListOfPageItem(this.pageIndex, lastIndex);
        };
        NzPaginationDefaultComponent.prototype.getListOfPageItem = function (pageIndex, lastIndex) {
            var concatWithPrevNext = function (listOfPage) {
                var prevItem = {
                    type: 'prev',
                    disabled: pageIndex === 1
                };
                var nextItem = {
                    type: 'next',
                    disabled: pageIndex === lastIndex
                };
                return __spread([prevItem], listOfPage, [nextItem]);
            };
            var generatePage = function (start, end) {
                var list = [];
                for (var i = start; i <= end; i++) {
                    list.push({
                        index: i,
                        type: 'page'
                    });
                }
                return list;
            };
            if (lastIndex <= 9) {
                return concatWithPrevNext(generatePage(1, lastIndex));
            }
            else {
                var generateRangeItem = function (selected, last) {
                    var listOfRange = [];
                    var prevFiveItem = {
                        type: 'prev_5'
                    };
                    var nextFiveItem = {
                        type: 'next_5'
                    };
                    var firstPageItem = generatePage(1, 1);
                    var lastPageItem = generatePage(lastIndex, lastIndex);
                    if (selected < 4) {
                        listOfRange = __spread(generatePage(2, 5), [nextFiveItem]);
                    }
                    else if (selected < last - 3) {
                        listOfRange = __spread([prevFiveItem], generatePage(selected - 2, selected + 2), [nextFiveItem]);
                    }
                    else {
                        listOfRange = __spread([prevFiveItem], generatePage(last - 4, last - 1));
                    }
                    return __spread(firstPageItem, listOfRange, lastPageItem);
                };
                return concatWithPrevNext(generateRangeItem(pageIndex, lastIndex));
            }
        };
        NzPaginationDefaultComponent.prototype.ngOnChanges = function (changes) {
            var pageIndex = changes.pageIndex, pageSize = changes.pageSize, total = changes.total;
            if (pageIndex || pageSize || total) {
                this.ranges = [(this.pageIndex - 1) * this.pageSize + 1, Math.min(this.pageIndex * this.pageSize, this.total)];
                this.buildIndexes();
            }
        };
        /** @nocollapse */ NzPaginationDefaultComponent.ɵfac = function NzPaginationDefaultComponent_Factory(t) { return new (t || NzPaginationDefaultComponent)(); };
        /** @nocollapse */ NzPaginationDefaultComponent.ɵcmp = core["ɵɵdefineComponent"]({ type: NzPaginationDefaultComponent, selectors: [["ul", "nz-pagination-default", ""]], hostVars: 6, hostBindings: function NzPaginationDefaultComponent_HostBindings(rf, ctx) { if (rf & 2) {
                core["ɵɵclassProp"]("ant-pagination", true)("ant-pagination-disabled", ctx.disabled)("mini", ctx.nzSize === "small");
            } }, inputs: { nzSize: "nzSize", itemRender: "itemRender", showTotal: "showTotal", disabled: "disabled", locale: "locale", showSizeChanger: "showSizeChanger", showQuickJumper: "showQuickJumper", total: "total", pageIndex: "pageIndex", pageSize: "pageSize", pageSizeOptions: "pageSizeOptions" }, outputs: { pageIndexChange: "pageIndexChange", pageSizeChange: "pageSizeChange" }, features: [core["ɵɵNgOnChangesFeature"]], attrs: _c0$3, decls: 3, vars: 4, consts: [["class", "ant-pagination-total-text", 4, "ngIf"], ["nz-pagination-item", "", 3, "locale", "type", "index", "disabled", "itemRender", "active", "gotoIndex", "diffIndex", 4, "ngFor", "ngForOf", "ngForTrackBy"], ["nz-pagination-options", "", 3, "total", "locale", "disabled", "nzSize", "showSizeChanger", "showQuickJumper", "pageIndex", "pageSize", "pageSizeOptions", "pageIndexChange", "pageSizeChange", 4, "ngIf"], [1, "ant-pagination-total-text"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], ["nz-pagination-item", "", 3, "locale", "type", "index", "disabled", "itemRender", "active", "gotoIndex", "diffIndex"], ["nz-pagination-options", "", 3, "total", "locale", "disabled", "nzSize", "showSizeChanger", "showQuickJumper", "pageIndex", "pageSize", "pageSizeOptions", "pageIndexChange", "pageSizeChange"]], template: function NzPaginationDefaultComponent_Template(rf, ctx) { if (rf & 1) {
                core["ɵɵtemplate"](0, NzPaginationDefaultComponent_li_0_Template, 2, 5, "li", 0);
                core["ɵɵtemplate"](1, NzPaginationDefaultComponent_li_1_Template, 1, 6, "li", 1);
                core["ɵɵtemplate"](2, NzPaginationDefaultComponent_div_2_Template, 1, 9, "div", 2);
            } if (rf & 2) {
                core["ɵɵproperty"]("ngIf", ctx.showTotal);
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngForOf", ctx.listOfPageItem)("ngForTrackBy", ctx.trackByPageItem);
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngIf", ctx.showQuickJumper || ctx.showSizeChanger);
            } }, directives: [common.NgIf, common.NgForOf, common.NgTemplateOutlet, NzPaginationItemComponent, NzPaginationOptionsComponent], encapsulation: 2, changeDetection: 0 });
        return NzPaginationDefaultComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzPaginationDefaultComponent, [{
            type: core.Component,
            args: [{
                    selector: 'ul[nz-pagination-default]',
                    preserveWhitespaces: false,
                    encapsulation: core.ViewEncapsulation.None,
                    changeDetection: core.ChangeDetectionStrategy.OnPush,
                    template: "\n    <li class=\"ant-pagination-total-text\" *ngIf=\"showTotal\">\n      <ng-template [ngTemplateOutlet]=\"showTotal\" [ngTemplateOutletContext]=\"{ $implicit: total, range: ranges }\"></ng-template>\n    </li>\n    <li\n      *ngFor=\"let page of listOfPageItem; trackBy: trackByPageItem\"\n      nz-pagination-item\n      [locale]=\"locale\"\n      [type]=\"page.type\"\n      [index]=\"page.index\"\n      [disabled]=\"page.disabled\"\n      [itemRender]=\"itemRender\"\n      [active]=\"pageIndex === page.index\"\n      (gotoIndex)=\"jumpPage($event)\"\n      (diffIndex)=\"jumpDiff($event)\"\n    ></li>\n    <div\n      nz-pagination-options\n      *ngIf=\"showQuickJumper || showSizeChanger\"\n      [total]=\"total\"\n      [locale]=\"locale\"\n      [disabled]=\"disabled\"\n      [nzSize]=\"nzSize\"\n      [showSizeChanger]=\"showSizeChanger\"\n      [showQuickJumper]=\"showQuickJumper\"\n      [pageIndex]=\"pageIndex\"\n      [pageSize]=\"pageSize\"\n      [pageSizeOptions]=\"pageSizeOptions\"\n      (pageIndexChange)=\"onPageIndexChange($event)\"\n      (pageSizeChange)=\"onPageSizeChange($event)\"\n    ></div>\n  ",
                    host: {
                        '[class.ant-pagination]': 'true',
                        '[class.ant-pagination-disabled]': 'disabled',
                        '[class.mini]': "nzSize === 'small'"
                    }
                }]
        }], null, { nzSize: [{
                type: core.Input
            }], itemRender: [{
                type: core.Input
            }], showTotal: [{
                type: core.Input
            }], disabled: [{
                type: core.Input
            }], locale: [{
                type: core.Input
            }], showSizeChanger: [{
                type: core.Input
            }], showQuickJumper: [{
                type: core.Input
            }], total: [{
                type: core.Input
            }], pageIndex: [{
                type: core.Input
            }], pageSize: [{
                type: core.Input
            }], pageSizeOptions: [{
                type: core.Input
            }], pageIndexChange: [{
                type: core.Output
            }], pageSizeChange: [{
                type: core.Output
            }] }); })();

    function NzPaginationComponent_ng_container_0_ul_1_Template(rf, ctx) { if (rf & 1) {
        var _r2652 = core["ɵɵgetCurrentView"]();
        core["ɵɵelementStart"](0, "ul", 3);
        core["ɵɵlistener"]("pageIndexChange", function NzPaginationComponent_ng_container_0_ul_1_Template_ul_pageIndexChange_0_listener($event) { core["ɵɵrestoreView"](_r2652); var ctx_r2651 = core["ɵɵnextContext"](2); return ctx_r2651.onPageIndexChange($event); });
        core["ɵɵelementEnd"]();
    } if (rf & 2) {
        var ctx_r2649 = core["ɵɵnextContext"](2);
        core["ɵɵclassProp"]("ant-table-pagination", ctx_r2649.nzInsideTable);
        core["ɵɵproperty"]("disabled", ctx_r2649.nzDisabled)("itemRender", ctx_r2649.nzItemRender)("locale", ctx_r2649.locale)("pageSize", ctx_r2649.nzPageSize)("total", ctx_r2649.nzTotal)("pageIndex", ctx_r2649.nzPageIndex);
    } }
    function NzPaginationComponent_ng_container_0_ul_2_Template(rf, ctx) { if (rf & 1) {
        var _r2654 = core["ɵɵgetCurrentView"]();
        core["ɵɵelementStart"](0, "ul", 4);
        core["ɵɵlistener"]("pageIndexChange", function NzPaginationComponent_ng_container_0_ul_2_Template_ul_pageIndexChange_0_listener($event) { core["ɵɵrestoreView"](_r2654); var ctx_r2653 = core["ɵɵnextContext"](2); return ctx_r2653.onPageIndexChange($event); })("pageSizeChange", function NzPaginationComponent_ng_container_0_ul_2_Template_ul_pageSizeChange_0_listener($event) { core["ɵɵrestoreView"](_r2654); var ctx_r2655 = core["ɵɵnextContext"](2); return ctx_r2655.onPageSizeChange($event); });
        core["ɵɵelementEnd"]();
    } if (rf & 2) {
        var ctx_r2650 = core["ɵɵnextContext"](2);
        core["ɵɵclassProp"]("ant-table-pagination", ctx_r2650.nzInsideTable);
        core["ɵɵproperty"]("nzSize", ctx_r2650.nzSize)("itemRender", ctx_r2650.nzItemRender)("showTotal", ctx_r2650.nzShowTotal)("disabled", ctx_r2650.nzDisabled)("locale", ctx_r2650.locale)("showSizeChanger", ctx_r2650.nzShowSizeChanger)("showQuickJumper", ctx_r2650.nzShowQuickJumper)("total", ctx_r2650.nzTotal)("pageIndex", ctx_r2650.nzPageIndex)("pageSize", ctx_r2650.nzPageSize)("pageSizeOptions", ctx_r2650.nzPageSizeOptions);
    } }
    function NzPaginationComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelementContainerStart"](0);
        core["ɵɵtemplate"](1, NzPaginationComponent_ng_container_0_ul_1_Template, 1, 8, "ul", 1);
        core["ɵɵtemplate"](2, NzPaginationComponent_ng_container_0_ul_2_Template, 1, 13, "ul", 2);
        core["ɵɵelementContainerEnd"]();
    } if (rf & 2) {
        var ctx_r2648 = core["ɵɵnextContext"]();
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngIf", ctx_r2648.nzSimple);
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngIf", !ctx_r2648.nzSimple);
    } }
    var NzPaginationComponent = /** @class */ (function () {
        function NzPaginationComponent(i18n, cdr) {
            this.i18n = i18n;
            this.cdr = cdr;
            this.nzPageSizeChange = new core.EventEmitter();
            this.nzPageIndexChange = new core.EventEmitter();
            this.nzShowTotal = null;
            this.nzSize = 'default';
            this.nzPageSizeOptions = [10, 20, 30, 40];
            this.nzDisabled = false;
            this.nzInsideTable = false;
            this.nzShowSizeChanger = false;
            this.nzHideOnSinglePage = false;
            this.nzShowQuickJumper = false;
            this.nzSimple = false;
            this.nzTotal = 0;
            this.nzPageIndex = 1;
            this.nzPageSize = 10;
            this.showPagination = true;
            this.locale = {};
            this.destroy$ = new rxjs.Subject();
            this.total$ = new rxjs.ReplaySubject(1);
        }
        NzPaginationComponent.prototype.validatePageIndex = function (value, lastIndex) {
            if (value > lastIndex) {
                return lastIndex;
            }
            else if (value < 1) {
                return 1;
            }
            else {
                return value;
            }
        };
        NzPaginationComponent.prototype.onPageIndexChange = function (index) {
            var lastIndex = this.getLastIndex(this.nzTotal, this.nzPageSize);
            var validIndex = this.validatePageIndex(index, lastIndex);
            if (validIndex !== this.nzPageIndex && !this.nzDisabled) {
                this.nzPageIndex = validIndex;
                this.nzPageIndexChange.emit(this.nzPageIndex);
            }
        };
        NzPaginationComponent.prototype.onPageSizeChange = function (size) {
            this.nzPageSize = size;
            this.nzPageSizeChange.emit(size);
            var lastIndex = this.getLastIndex(this.nzTotal, this.nzPageSize);
            if (this.nzPageIndex > lastIndex) {
                this.onPageIndexChange(lastIndex);
            }
        };
        NzPaginationComponent.prototype.onTotalChange = function (total) {
            var _this = this;
            var lastIndex = this.getLastIndex(total, this.nzPageSize);
            if (this.nzPageIndex > lastIndex) {
                Promise.resolve().then(function () { return _this.onPageIndexChange(lastIndex); });
            }
        };
        NzPaginationComponent.prototype.getLastIndex = function (total, pageSize) {
            return Math.ceil(total / pageSize);
        };
        NzPaginationComponent.prototype.ngOnInit = function () {
            var _this = this;
            this.i18n.localeChange.pipe(operators.takeUntil(this.destroy$)).subscribe(function () {
                _this.locale = _this.i18n.getLocaleData('Pagination');
                _this.cdr.markForCheck();
            });
            this.total$.pipe(operators.takeUntil(this.destroy$)).subscribe(function (total) {
                _this.onTotalChange(total);
            });
        };
        NzPaginationComponent.prototype.ngOnDestroy = function () {
            this.destroy$.next();
            this.destroy$.complete();
        };
        NzPaginationComponent.prototype.ngOnChanges = function (changes) {
            var nzHideOnSinglePage = changes.nzHideOnSinglePage, nzTotal = changes.nzTotal, nzPageSize = changes.nzPageSize;
            if (nzTotal) {
                this.total$.next(this.nzTotal);
            }
            if (nzHideOnSinglePage || nzTotal || nzPageSize) {
                this.showPagination = (this.nzHideOnSinglePage && this.nzTotal > this.nzPageSize) || (this.nzTotal > 0 && !this.nzHideOnSinglePage);
            }
        };
        /** @nocollapse */ NzPaginationComponent.ɵfac = function NzPaginationComponent_Factory(t) { return new (t || NzPaginationComponent)(core["ɵɵdirectiveInject"](i18n.NzI18nService), core["ɵɵdirectiveInject"](core.ChangeDetectorRef)); };
        /** @nocollapse */ NzPaginationComponent.ɵcmp = core["ɵɵdefineComponent"]({ type: NzPaginationComponent, selectors: [["nz-pagination"]], inputs: { nzShowTotal: "nzShowTotal", nzSize: "nzSize", nzPageSizeOptions: "nzPageSizeOptions", nzItemRender: "nzItemRender", nzDisabled: "nzDisabled", nzInsideTable: "nzInsideTable", nzShowSizeChanger: "nzShowSizeChanger", nzHideOnSinglePage: "nzHideOnSinglePage", nzShowQuickJumper: "nzShowQuickJumper", nzSimple: "nzSimple", nzTotal: "nzTotal", nzPageIndex: "nzPageIndex", nzPageSize: "nzPageSize" }, outputs: { nzPageSizeChange: "nzPageSizeChange", nzPageIndexChange: "nzPageIndexChange" }, exportAs: ["nzPagination"], features: [core["ɵɵNgOnChangesFeature"]], decls: 1, vars: 1, consts: [[4, "ngIf"], ["nz-pagination-simple", "", 3, "ant-table-pagination", "disabled", "itemRender", "locale", "pageSize", "total", "pageIndex", "pageIndexChange", 4, "ngIf"], ["nz-pagination-default", "", 3, "ant-table-pagination", "nzSize", "itemRender", "showTotal", "disabled", "locale", "showSizeChanger", "showQuickJumper", "total", "pageIndex", "pageSize", "pageSizeOptions", "pageIndexChange", "pageSizeChange", 4, "ngIf"], ["nz-pagination-simple", "", 3, "disabled", "itemRender", "locale", "pageSize", "total", "pageIndex", "pageIndexChange"], ["nz-pagination-default", "", 3, "nzSize", "itemRender", "showTotal", "disabled", "locale", "showSizeChanger", "showQuickJumper", "total", "pageIndex", "pageSize", "pageSizeOptions", "pageIndexChange", "pageSizeChange"]], template: function NzPaginationComponent_Template(rf, ctx) { if (rf & 1) {
                core["ɵɵtemplate"](0, NzPaginationComponent_ng_container_0_Template, 3, 2, "ng-container", 0);
            } if (rf & 2) {
                core["ɵɵproperty"]("ngIf", ctx.showPagination);
            } }, directives: [common.NgIf, NzPaginationSimpleComponent, NzPaginationDefaultComponent], encapsulation: 2, changeDetection: 0 });
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzPaginationComponent.prototype, "nzDisabled", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzPaginationComponent.prototype, "nzInsideTable", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzPaginationComponent.prototype, "nzShowSizeChanger", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzPaginationComponent.prototype, "nzHideOnSinglePage", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzPaginationComponent.prototype, "nzShowQuickJumper", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzPaginationComponent.prototype, "nzSimple", void 0);
        __decorate([
            core$1.InputNumber(),
            __metadata("design:type", Object)
        ], NzPaginationComponent.prototype, "nzTotal", void 0);
        __decorate([
            core$1.InputNumber(),
            __metadata("design:type", Object)
        ], NzPaginationComponent.prototype, "nzPageIndex", void 0);
        __decorate([
            core$1.InputNumber(),
            __metadata("design:type", Object)
        ], NzPaginationComponent.prototype, "nzPageSize", void 0);
        return NzPaginationComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzPaginationComponent, [{
            type: core.Component,
            args: [{
                    selector: 'nz-pagination',
                    exportAs: 'nzPagination',
                    preserveWhitespaces: false,
                    encapsulation: core.ViewEncapsulation.None,
                    changeDetection: core.ChangeDetectionStrategy.OnPush,
                    template: "\n    <ng-container *ngIf=\"showPagination\">\n      <ul\n        *ngIf=\"nzSimple\"\n        nz-pagination-simple\n        [class.ant-table-pagination]=\"nzInsideTable\"\n        [disabled]=\"nzDisabled\"\n        [itemRender]=\"nzItemRender\"\n        [locale]=\"locale\"\n        [pageSize]=\"nzPageSize\"\n        [total]=\"nzTotal\"\n        [pageIndex]=\"nzPageIndex\"\n        (pageIndexChange)=\"onPageIndexChange($event)\"\n      ></ul>\n      <ul\n        *ngIf=\"!nzSimple\"\n        nz-pagination-default\n        [class.ant-table-pagination]=\"nzInsideTable\"\n        [nzSize]=\"nzSize\"\n        [itemRender]=\"nzItemRender\"\n        [showTotal]=\"nzShowTotal\"\n        [disabled]=\"nzDisabled\"\n        [locale]=\"locale\"\n        [showSizeChanger]=\"nzShowSizeChanger\"\n        [showQuickJumper]=\"nzShowQuickJumper\"\n        [total]=\"nzTotal\"\n        [pageIndex]=\"nzPageIndex\"\n        [pageSize]=\"nzPageSize\"\n        [pageSizeOptions]=\"nzPageSizeOptions\"\n        (pageIndexChange)=\"onPageIndexChange($event)\"\n        (pageSizeChange)=\"onPageSizeChange($event)\"\n      ></ul>\n    </ng-container>\n  "
                }]
        }], function () { return [{ type: i18n.NzI18nService }, { type: core.ChangeDetectorRef }]; }, { nzPageSizeChange: [{
                type: core.Output
            }], nzPageIndexChange: [{
                type: core.Output
            }], nzShowTotal: [{
                type: core.Input
            }], nzSize: [{
                type: core.Input
            }], nzPageSizeOptions: [{
                type: core.Input
            }], nzItemRender: [{
                type: core.Input
            }], nzDisabled: [{
                type: core.Input
            }], nzInsideTable: [{
                type: core.Input
            }], nzShowSizeChanger: [{
                type: core.Input
            }], nzHideOnSinglePage: [{
                type: core.Input
            }], nzShowQuickJumper: [{
                type: core.Input
            }], nzSimple: [{
                type: core.Input
            }], nzTotal: [{
                type: core.Input
            }], nzPageIndex: [{
                type: core.Input
            }], nzPageSize: [{
                type: core.Input
            }] }); })();

    /**
     * @license
     * Copyright Alibaba.com All Rights Reserved.
     *
     * Use of this source code is governed by an MIT-style license that can be
     * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
     */
    var NzPaginationModule = /** @class */ (function () {
        function NzPaginationModule() {
        }
        /** @nocollapse */ NzPaginationModule.ɵmod = core["ɵɵdefineNgModule"]({ type: NzPaginationModule });
        /** @nocollapse */ NzPaginationModule.ɵinj = core["ɵɵdefineInjector"]({ factory: function NzPaginationModule_Factory(t) { return new (t || NzPaginationModule)(); }, imports: [[common.CommonModule, forms.FormsModule, select.NzSelectModule, i18n.NzI18nModule, icon.NzIconModule]] });
        return NzPaginationModule;
    }());
    (function () { (typeof ngJitMode === "undefined" || ngJitMode) && core["ɵɵsetNgModuleScope"](NzPaginationModule, { declarations: [NzPaginationComponent,
            NzPaginationSimpleComponent,
            NzPaginationOptionsComponent,
            NzPaginationItemComponent,
            NzPaginationDefaultComponent], imports: [common.CommonModule, forms.FormsModule, select.NzSelectModule, i18n.NzI18nModule, icon.NzIconModule], exports: [NzPaginationComponent] }); })();
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzPaginationModule, [{
            type: core.NgModule,
            args: [{
                    declarations: [
                        NzPaginationComponent,
                        NzPaginationSimpleComponent,
                        NzPaginationOptionsComponent,
                        NzPaginationItemComponent,
                        NzPaginationDefaultComponent
                    ],
                    exports: [NzPaginationComponent],
                    imports: [common.CommonModule, forms.FormsModule, select.NzSelectModule, i18n.NzI18nModule, icon.NzIconModule]
                }]
        }], null, null); })();

    exports.NzPaginationComponent = NzPaginationComponent;
    exports.NzPaginationDefaultComponent = NzPaginationDefaultComponent;
    exports.NzPaginationItemComponent = NzPaginationItemComponent;
    exports.NzPaginationModule = NzPaginationModule;
    exports.NzPaginationOptionsComponent = NzPaginationOptionsComponent;
    exports.NzPaginationSimpleComponent = NzPaginationSimpleComponent;

    Object.defineProperty(exports, '__esModule', { value: true });

})));
//# sourceMappingURL=ng-zorro-antd-pagination.umd.js.map
