/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import * as tslib_1 from "tslib";
/**
 * @record
 */
export function ISummaryExpression() { }
if (false) {
    /** @type {?} */
    ISummaryExpression.prototype.fieldName;
    /** @type {?|undefined} */
    ISummaryExpression.prototype.customSummary;
}
/**
 * @record
 */
export function IgxSummaryResult() { }
if (false) {
    /** @type {?} */
    IgxSummaryResult.prototype.key;
    /** @type {?} */
    IgxSummaryResult.prototype.label;
    /** @type {?} */
    IgxSummaryResult.prototype.summaryResult;
}
/**
 * @record
 */
export function ISummaryRecord() { }
if (false) {
    /** @type {?} */
    ISummaryRecord.prototype.summaries;
    /** @type {?|undefined} */
    ISummaryRecord.prototype.max;
    /** @type {?|undefined} */
    ISummaryRecord.prototype.cellIndentation;
}
/** @type {?} */
var clear = function (el) { return el === 0 || Boolean(el); };
var ɵ0 = clear;
/** @type {?} */
var first = function (arr) { return arr[0]; };
var ɵ1 = first;
/** @type {?} */
var last = function (arr) { return arr[arr.length - 1]; };
var ɵ2 = last;
var IgxSummaryOperand = /** @class */ (function () {
    function IgxSummaryOperand() {
    }
    /**
     * Counts all the records in the data source.
     * If filtering is applied, counts only the filtered records.
     * ```typescript
     * IgxSummaryOperand.count(dataSource);
     * ```
     * @memberof IgxSummaryOperand
     */
    /**
     * Counts all the records in the data source.
     * If filtering is applied, counts only the filtered records.
     * ```typescript
     * IgxSummaryOperand.count(dataSource);
     * ```
     * \@memberof IgxSummaryOperand
     * @param {?} data
     * @return {?}
     */
    IgxSummaryOperand.count = /**
     * Counts all the records in the data source.
     * If filtering is applied, counts only the filtered records.
     * ```typescript
     * IgxSummaryOperand.count(dataSource);
     * ```
     * \@memberof IgxSummaryOperand
     * @param {?} data
     * @return {?}
     */
    function (data) {
        return data.length;
    };
    /**
     * Executes the static `count` method and returns `IgxSummaryResult[]`.
     * ```typescript
     * interface IgxSummaryResult {
     *   key: string;
     *   label: string;
     *   summaryResult: any;
     * }
     * ```
     * Can be overridden in the inherited classes to provide customization for the `summary`.
     * ```typescript
     * class CustomSummary extends IgxSummaryOperand {
     *   constructor() {
     *     super();
     *   }
     *   public operate(data: any[], allData: any[], fieldName: string): IgxSummaryResult[] {
     *     const result = [];
     *     result.push({
     *       key: "test",
     *       label: "Test",
     *       summaryResult: IgxSummaryOperand.count(data)
     *     });
     *     return result;
     *   }
     * }
     * this.grid.getColumnByName('ColumnName').summaries = CustomSummary;
     * ```
     * @memberof IgxSummaryOperand
     */
    /**
     * Executes the static `count` method and returns `IgxSummaryResult[]`.
     * ```typescript
     * interface IgxSummaryResult {
     *   key: string;
     *   label: string;
     *   summaryResult: any;
     * }
     * ```
     * Can be overridden in the inherited classes to provide customization for the `summary`.
     * ```typescript
     * class CustomSummary extends IgxSummaryOperand {
     *   constructor() {
     *     super();
     *   }
     *   public operate(data: any[], allData: any[], fieldName: string): IgxSummaryResult[] {
     *     const result = [];
     *     result.push({
     *       key: "test",
     *       label: "Test",
     *       summaryResult: IgxSummaryOperand.count(data)
     *     });
     *     return result;
     *   }
     * }
     * this.grid.getColumnByName('ColumnName').summaries = CustomSummary;
     * ```
     * \@memberof IgxSummaryOperand
     * @param {?=} data
     * @param {?=} allData
     * @param {?=} fieldName
     * @return {?}
     */
    IgxSummaryOperand.prototype.operate = /**
     * Executes the static `count` method and returns `IgxSummaryResult[]`.
     * ```typescript
     * interface IgxSummaryResult {
     *   key: string;
     *   label: string;
     *   summaryResult: any;
     * }
     * ```
     * Can be overridden in the inherited classes to provide customization for the `summary`.
     * ```typescript
     * class CustomSummary extends IgxSummaryOperand {
     *   constructor() {
     *     super();
     *   }
     *   public operate(data: any[], allData: any[], fieldName: string): IgxSummaryResult[] {
     *     const result = [];
     *     result.push({
     *       key: "test",
     *       label: "Test",
     *       summaryResult: IgxSummaryOperand.count(data)
     *     });
     *     return result;
     *   }
     * }
     * this.grid.getColumnByName('ColumnName').summaries = CustomSummary;
     * ```
     * \@memberof IgxSummaryOperand
     * @param {?=} data
     * @param {?=} allData
     * @param {?=} fieldName
     * @return {?}
     */
    function (data, allData, fieldName) {
        if (data === void 0) { data = []; }
        if (allData === void 0) { allData = []; }
        return [{
                key: 'count',
                label: 'Count',
                summaryResult: IgxSummaryOperand.count(data)
            }];
    };
    return IgxSummaryOperand;
}());
export { IgxSummaryOperand };
// @dynamic
var 
// @dynamic
IgxNumberSummaryOperand = /** @class */ (function (_super) {
    tslib_1.__extends(IgxNumberSummaryOperand, _super);
    function IgxNumberSummaryOperand() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /**
     * Returns the minimum numeric value in the provided data records.
     * If filtering is applied, returns the minimum value in the filtered data records.
     * ```typescript
     * IgxNumberSummaryOperand.min(data);
     * ```
     * @memberof IgxNumberSummaryOperand
     */
    /**
     * Returns the minimum numeric value in the provided data records.
     * If filtering is applied, returns the minimum value in the filtered data records.
     * ```typescript
     * IgxNumberSummaryOperand.min(data);
     * ```
     * \@memberof IgxNumberSummaryOperand
     * @param {?} data
     * @return {?}
     */
    IgxNumberSummaryOperand.min = /**
     * Returns the minimum numeric value in the provided data records.
     * If filtering is applied, returns the minimum value in the filtered data records.
     * ```typescript
     * IgxNumberSummaryOperand.min(data);
     * ```
     * \@memberof IgxNumberSummaryOperand
     * @param {?} data
     * @return {?}
     */
    function (data) {
        return data.length && data.filter(clear).length ? data.filter(clear).reduce(function (a, b) { return Math.min(a, b); }) : 0;
    };
    /**
     * Returns the maximum numeric value in the provided data records.
     * If filtering is applied, returns the maximum value in the filtered data records.
     * ```typescript
     * IgxNumberSummaryOperand.max(data);
     * ```
     * @memberof IgxNumberSummaryOperand
     */
    /**
     * Returns the maximum numeric value in the provided data records.
     * If filtering is applied, returns the maximum value in the filtered data records.
     * ```typescript
     * IgxNumberSummaryOperand.max(data);
     * ```
     * \@memberof IgxNumberSummaryOperand
     * @param {?} data
     * @return {?}
     */
    IgxNumberSummaryOperand.max = /**
     * Returns the maximum numeric value in the provided data records.
     * If filtering is applied, returns the maximum value in the filtered data records.
     * ```typescript
     * IgxNumberSummaryOperand.max(data);
     * ```
     * \@memberof IgxNumberSummaryOperand
     * @param {?} data
     * @return {?}
     */
    function (data) {
        return data.length && data.filter(clear).length ? data.filter(clear).reduce(function (a, b) { return Math.max(a, b); }) : 0;
    };
    /**
     * Returns the sum of the numeric values in the provided data records.
     * If filtering is applied, returns the sum of the numeric values in the data records.
     * ```typescript
     * IgxNumberSummaryOperand.sum(data);
     * ```
     * @memberof IgxNumberSummaryOperand
     */
    /**
     * Returns the sum of the numeric values in the provided data records.
     * If filtering is applied, returns the sum of the numeric values in the data records.
     * ```typescript
     * IgxNumberSummaryOperand.sum(data);
     * ```
     * \@memberof IgxNumberSummaryOperand
     * @param {?} data
     * @return {?}
     */
    IgxNumberSummaryOperand.sum = /**
     * Returns the sum of the numeric values in the provided data records.
     * If filtering is applied, returns the sum of the numeric values in the data records.
     * ```typescript
     * IgxNumberSummaryOperand.sum(data);
     * ```
     * \@memberof IgxNumberSummaryOperand
     * @param {?} data
     * @return {?}
     */
    function (data) {
        return data.length && data.filter(clear).length ? data.filter(clear).reduce(function (a, b) { return +a + +b; }) : 0;
    };
    /**
     * Returns the average numeric value in the data provided data records.
     * If filtering is applied, returns the average numeric value in the filtered data records.
     * ```typescript
     * IgxSummaryOperand.average(data);
     * ```
     * @memberof IgxNumberSummaryOperand
     */
    /**
     * Returns the average numeric value in the data provided data records.
     * If filtering is applied, returns the average numeric value in the filtered data records.
     * ```typescript
     * IgxSummaryOperand.average(data);
     * ```
     * \@memberof IgxNumberSummaryOperand
     * @param {?} data
     * @return {?}
     */
    IgxNumberSummaryOperand.average = /**
     * Returns the average numeric value in the data provided data records.
     * If filtering is applied, returns the average numeric value in the filtered data records.
     * ```typescript
     * IgxSummaryOperand.average(data);
     * ```
     * \@memberof IgxNumberSummaryOperand
     * @param {?} data
     * @return {?}
     */
    function (data) {
        return data.length && data.filter(clear).length ? this.sum(data) / this.count(data) : 0;
    };
    /**
     * Executes the static methods and returns `IgxSummaryResult[]`.
     * ```typescript
     * interface IgxSummaryResult {
     *   key: string;
     *   label: string;
     *   summaryResult: any;
     * }
     * ```
     * Can be overridden in the inherited classes to provide customization for the `summary`.
     * ```typescript
     * class CustomNumberSummary extends IgxNumberSummaryOperand {
     *   constructor() {
     *     super();
     *   }
     *   public operate(data: any[], allData: any[], fieldName: string): IgxSummaryResult[] {
     *     const result = [];
     *     result.push({
     *       key: "avg",
     *       label: "Avg",
     *       summaryResult: IgxNumberSummaryOperand.average(data)
     *     });
     *     result.push({
     *       key: "max",
     *       label: "Max",
     *       summaryResult: IgxNumberSummaryOperand.max(data)
     *     });
     *     return result;
     *   }
     * }
     * this.grid.getColumnByName('ColumnName').summaries = CustomNumberSummary;
     * ```
     * @memberof IgxNumberSummaryOperand
     */
    /**
     * Executes the static methods and returns `IgxSummaryResult[]`.
     * ```typescript
     * interface IgxSummaryResult {
     *   key: string;
     *   label: string;
     *   summaryResult: any;
     * }
     * ```
     * Can be overridden in the inherited classes to provide customization for the `summary`.
     * ```typescript
     * class CustomNumberSummary extends IgxNumberSummaryOperand {
     *   constructor() {
     *     super();
     *   }
     *   public operate(data: any[], allData: any[], fieldName: string): IgxSummaryResult[] {
     *     const result = [];
     *     result.push({
     *       key: "avg",
     *       label: "Avg",
     *       summaryResult: IgxNumberSummaryOperand.average(data)
     *     });
     *     result.push({
     *       key: "max",
     *       label: "Max",
     *       summaryResult: IgxNumberSummaryOperand.max(data)
     *     });
     *     return result;
     *   }
     * }
     * this.grid.getColumnByName('ColumnName').summaries = CustomNumberSummary;
     * ```
     * \@memberof IgxNumberSummaryOperand
     * @param {?=} data
     * @param {?=} allData
     * @param {?=} fieldName
     * @return {?}
     */
    IgxNumberSummaryOperand.prototype.operate = /**
     * Executes the static methods and returns `IgxSummaryResult[]`.
     * ```typescript
     * interface IgxSummaryResult {
     *   key: string;
     *   label: string;
     *   summaryResult: any;
     * }
     * ```
     * Can be overridden in the inherited classes to provide customization for the `summary`.
     * ```typescript
     * class CustomNumberSummary extends IgxNumberSummaryOperand {
     *   constructor() {
     *     super();
     *   }
     *   public operate(data: any[], allData: any[], fieldName: string): IgxSummaryResult[] {
     *     const result = [];
     *     result.push({
     *       key: "avg",
     *       label: "Avg",
     *       summaryResult: IgxNumberSummaryOperand.average(data)
     *     });
     *     result.push({
     *       key: "max",
     *       label: "Max",
     *       summaryResult: IgxNumberSummaryOperand.max(data)
     *     });
     *     return result;
     *   }
     * }
     * this.grid.getColumnByName('ColumnName').summaries = CustomNumberSummary;
     * ```
     * \@memberof IgxNumberSummaryOperand
     * @param {?=} data
     * @param {?=} allData
     * @param {?=} fieldName
     * @return {?}
     */
    function (data, allData, fieldName) {
        if (data === void 0) { data = []; }
        if (allData === void 0) { allData = []; }
        /** @type {?} */
        var result = _super.prototype.operate.call(this, data, allData, fieldName);
        result.push({
            key: 'min',
            label: 'Min',
            summaryResult: IgxNumberSummaryOperand.min(data)
        });
        result.push({
            key: 'max',
            label: 'Max',
            summaryResult: IgxNumberSummaryOperand.max(data)
        });
        result.push({
            key: 'sum',
            label: 'Sum',
            summaryResult: IgxNumberSummaryOperand.sum(data)
        });
        result.push({
            key: 'average',
            label: 'Avg',
            summaryResult: IgxNumberSummaryOperand.average(data)
        });
        return result;
    };
    return IgxNumberSummaryOperand;
}(IgxSummaryOperand));
// @dynamic
export { IgxNumberSummaryOperand };
// @dynamic
var 
// @dynamic
IgxDateSummaryOperand = /** @class */ (function (_super) {
    tslib_1.__extends(IgxDateSummaryOperand, _super);
    function IgxDateSummaryOperand() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /**
     * Returns the latest date value in the data records.
     * If filtering is applied, returns the latest date value in the filtered data records.
     * ```typescript
     * IgxDateSummaryOperand.latest(data);
     * ```
     * @memberof IgxDateSummaryOperand
     */
    /**
     * Returns the latest date value in the data records.
     * If filtering is applied, returns the latest date value in the filtered data records.
     * ```typescript
     * IgxDateSummaryOperand.latest(data);
     * ```
     * \@memberof IgxDateSummaryOperand
     * @param {?} data
     * @return {?}
     */
    IgxDateSummaryOperand.latest = /**
     * Returns the latest date value in the data records.
     * If filtering is applied, returns the latest date value in the filtered data records.
     * ```typescript
     * IgxDateSummaryOperand.latest(data);
     * ```
     * \@memberof IgxDateSummaryOperand
     * @param {?} data
     * @return {?}
     */
    function (data) {
        return data.length && data.filter(clear).length ?
            first(data.filter(clear).sort(function (a, b) { return new Date(b).valueOf() - new Date(a).valueOf(); })) : undefined;
    };
    /**
     * Returns the earliest date value in the data records.
     * If filtering is applied, returns the latest date value in the filtered data records.
     * ```typescript
     * IgxDateSummaryOperand.earliest(data);
     * ```
     * @memberof IgxDateSummaryOperand
     */
    /**
     * Returns the earliest date value in the data records.
     * If filtering is applied, returns the latest date value in the filtered data records.
     * ```typescript
     * IgxDateSummaryOperand.earliest(data);
     * ```
     * \@memberof IgxDateSummaryOperand
     * @param {?} data
     * @return {?}
     */
    IgxDateSummaryOperand.earliest = /**
     * Returns the earliest date value in the data records.
     * If filtering is applied, returns the latest date value in the filtered data records.
     * ```typescript
     * IgxDateSummaryOperand.earliest(data);
     * ```
     * \@memberof IgxDateSummaryOperand
     * @param {?} data
     * @return {?}
     */
    function (data) {
        return data.length && data.filter(clear).length ?
            last(data.filter(clear).sort(function (a, b) { return new Date(b).valueOf() - new Date(a).valueOf(); })) : undefined;
    };
    /**
     * Executes the static methods and returns `IgxSummaryResult[]`.
     * ```typescript
     * interface IgxSummaryResult {
     *   key: string;
     *   label: string;
     *   summaryResult: any;
     * }
     * ```
     * Can be overridden in the inherited classes to provide customization for the `summary`.
     * ```typescript
     * class CustomDateSummary extends IgxDateSummaryOperand {
     *   constructor() {
     *     super();
     *   }
     *   public operate(data: any[], allData: any[], fieldName: string): IgxSummaryResult[] {
     *     const result = [];
     *     result.push({
     *       key: "latest",
     *       label: "Latest Date",
     *       summaryResult: IgxDateSummaryOperand.latest(data)
     *     });
     *     return result;
     *   }
     * }
     * this.grid.getColumnByName('ColumnName').summaries = CustomDateSummary;
     * ```
     * @memberof IgxDateSummaryOperand
     */
    /**
     * Executes the static methods and returns `IgxSummaryResult[]`.
     * ```typescript
     * interface IgxSummaryResult {
     *   key: string;
     *   label: string;
     *   summaryResult: any;
     * }
     * ```
     * Can be overridden in the inherited classes to provide customization for the `summary`.
     * ```typescript
     * class CustomDateSummary extends IgxDateSummaryOperand {
     *   constructor() {
     *     super();
     *   }
     *   public operate(data: any[], allData: any[], fieldName: string): IgxSummaryResult[] {
     *     const result = [];
     *     result.push({
     *       key: "latest",
     *       label: "Latest Date",
     *       summaryResult: IgxDateSummaryOperand.latest(data)
     *     });
     *     return result;
     *   }
     * }
     * this.grid.getColumnByName('ColumnName').summaries = CustomDateSummary;
     * ```
     * \@memberof IgxDateSummaryOperand
     * @param {?=} data
     * @param {?=} allData
     * @param {?=} fieldName
     * @return {?}
     */
    IgxDateSummaryOperand.prototype.operate = /**
     * Executes the static methods and returns `IgxSummaryResult[]`.
     * ```typescript
     * interface IgxSummaryResult {
     *   key: string;
     *   label: string;
     *   summaryResult: any;
     * }
     * ```
     * Can be overridden in the inherited classes to provide customization for the `summary`.
     * ```typescript
     * class CustomDateSummary extends IgxDateSummaryOperand {
     *   constructor() {
     *     super();
     *   }
     *   public operate(data: any[], allData: any[], fieldName: string): IgxSummaryResult[] {
     *     const result = [];
     *     result.push({
     *       key: "latest",
     *       label: "Latest Date",
     *       summaryResult: IgxDateSummaryOperand.latest(data)
     *     });
     *     return result;
     *   }
     * }
     * this.grid.getColumnByName('ColumnName').summaries = CustomDateSummary;
     * ```
     * \@memberof IgxDateSummaryOperand
     * @param {?=} data
     * @param {?=} allData
     * @param {?=} fieldName
     * @return {?}
     */
    function (data, allData, fieldName) {
        if (data === void 0) { data = []; }
        if (allData === void 0) { allData = []; }
        /** @type {?} */
        var result = _super.prototype.operate.call(this, data, allData, fieldName);
        result.push({
            key: 'earliest',
            label: 'Earliest',
            summaryResult: IgxDateSummaryOperand.earliest(data)
        });
        result.push({
            key: 'latest',
            label: 'Latest',
            summaryResult: IgxDateSummaryOperand.latest(data)
        });
        return result;
    };
    return IgxDateSummaryOperand;
}(IgxSummaryOperand));
// @dynamic
export { IgxDateSummaryOperand };
export { ɵ0, ɵ1, ɵ2 };
//# sourceMappingURL=data:application/json;base64, 