"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const schematics_1 = require("@angular-devkit/schematics");
const lib_1 = require("../../lib");
const angular_utility_1 = require("../../lib/angular-utility");
function default_1(_options) {
    return (tree, _context) => {
        let sourceTemplates = schematics_1.url('files');
        let project = lib_1.loadProject(tree, _context);
        let tapDevicePage = project.appConfigBuilder.getPageByType('TapDevicePage');
        if (tapDevicePage) {
            const { name, path } = lib_1.getAngularProjectPath(tapDevicePage.projectPath, tree, _options);
            return angular_utility_1.applyWithOverwriteRule(sourceTemplates, [
                schematics_1.template(Object.assign({ name, menu: project.getDeviceMenu() }, project.toTemplate())),
                schematics_1.move(path)
            ], {
                overwrite: _options.overwrite,
                format: true
            });
        }
    };
}
exports.default = default_1;
//# sourceMappingURL=index.js.map