"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPreloadItems = getPreloadItems;
var lodash_1 = require("../../shared/lodash");
var ibsheet_1 = require("../../ibsheet");
var ibchart_1 = require("../../ibchart");
var ibmap_1 = require("../../ibmap");
function getPreloadItems(origins, options) {
    var alsoDefaultLib = (0, lodash_1.get)(options, 'defaultLibrary', false);
    var needDefaultLoadTask = alsoDefaultLib && !this.loadedDefaultLib;
    var noOrigins = (0, lodash_1.isNil)(origins);
    var res = [];
    var needRegAlias = false;
    if (needDefaultLoadTask) {
        if (noOrigins) {
            needRegAlias = true;
        }
        else if ((0, lodash_1.isString)(origins) || (0, lodash_1.isObject)(origins)) {
            needRegAlias = !(0, ibsheet_1.validSheetRegistData)(origins);
            needRegAlias = needRegAlias && !(0, ibchart_1.validChartRegistData)(origins);
            needRegAlias = needRegAlias && !(0, ibmap_1.validMapRegistData)(origins);
        }
        else if ((0, lodash_1.isArray)(origins)) {
            var arrS = origins.filter(function (t) { return (0, ibsheet_1.validSheetRegistData)(t); });
            var arrC = origins.filter(function (t) { return (0, ibchart_1.validChartRegistData)(t); });
            var arrM = origins.filter(function (t) { return (0, ibmap_1.validMapRegistData)(t); });
            needRegAlias = !arrS.length && !arrC.length && !arrM.length;
        }
    }
    if (needRegAlias) {
        var defItem = this._getDefaultRegItem();
        res.push(defItem.alias);
    }
    return res;
}
//# sourceMappingURL=get-preload-items.js.map