import { __extends } from "tslib";
import { IgCollection } from "igniteui-angular-core";
import { markType } from "igniteui-angular-core";
import { SyncableObservableCollection$2 } from "igniteui-angular-core";
import { RingSeriesBase as RingSeriesBase_internal } from './RingSeriesBase';
import { IgxRingSeriesBaseComponent as IgxRingSeriesBaseComponent } from './igx-ring-series-base-component';
var IgxRingSeriesCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxRingSeriesCollection, _super);
    function IgxRingSeriesCollection(list) {
        var _this = _super.call(this) || this;
        if (!IgxRingSeriesBaseComponent.$type) {
            IgxRingSeriesBaseComponent.$type = markType(IgxRingSeriesBaseComponent, "IgxRingSeriesBaseComponent");
        }
        if (list) {
            for (var i = 0; i < list.length; i++) {
                _this.add(list[i]);
            }
        }
        return _this;
    }
    IgxRingSeriesCollection.prototype._createInnerColl = function () {
        if (!IgxRingSeriesBaseComponent.$type) {
            IgxRingSeriesBaseComponent.$type = markType(IgxRingSeriesBaseComponent, "IgxRingSeriesBaseComponent");
        }
        var coll = new SyncableObservableCollection$2(IgxRingSeriesBaseComponent.$type, RingSeriesBase_internal.$type, 0);
        coll.compare = function (ext, int) {
            var comp = ext;
            if (comp._implementation) {
                comp = comp._implementation;
            }
            if (comp.equals) {
                return comp.equals(int);
            }
            return comp === int;
        };
        coll.createTo = function (ext) {
            return ext._implementation;
        };
        coll.createFrom = function (int) {
            var ext = int.externalObject;
            if (!ext) {
                ext = IgxRingSeriesBaseComponent._createFromInternal(int);
                if (ext) {
                    ext._implementation = int;
                }
            }
            return ext;
        };
        return coll;
    };
    return IgxRingSeriesCollection;
}(IgCollection));
export { IgxRingSeriesCollection };
