"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sharedOutputConfigSchema = exports.SvgDefaultExportSchema = exports.DisableSourceMapOptionSchema = exports.LegalCommentsSchema = exports.DataUriLimitSchema = exports.AssetsRetryOptionsSchema = exports.PolyfillSchema = exports.CharsetSchema = exports.FilenameConfigSchema = exports.DistPathConfigSchema = void 0;
const utils_1 = require("../utils");
const source_1 = require("./source");
exports.DistPathConfigSchema = utils_1.z.partialObj({
    root: utils_1.z.string(),
    js: utils_1.z.string(),
    css: utils_1.z.string(),
    svg: utils_1.z.string(),
    font: utils_1.z.string(),
    html: utils_1.z.string(),
    image: utils_1.z.string(),
    media: utils_1.z.string(),
    server: utils_1.z.string(),
});
exports.FilenameConfigSchema = utils_1.z.partialObj({
    js: utils_1.z.string(),
    css: utils_1.z.string(),
    svg: utils_1.z.string(),
    font: utils_1.z.string(),
    image: utils_1.z.string(),
    media: utils_1.z.string(),
});
exports.CharsetSchema = utils_1.z.literals(['ascii', 'utf8']);
exports.PolyfillSchema = utils_1.z.literals([
    'usage',
    'entry',
    'ua',
    'off',
]);
exports.AssetsRetryOptionsSchema = utils_1.z.partialObj({
    max: utils_1.z.number(),
    type: utils_1.z.array(utils_1.z.string()),
    test: utils_1.z.union([utils_1.z.string(), utils_1.z.function(utils_1.z.tuple([utils_1.z.string()]), utils_1.z.boolean())]),
    domain: utils_1.z.array(utils_1.z.string()),
    crossOrigin: utils_1.z.boolean(),
    onFail: utils_1.z.function(),
    onRetry: utils_1.z.function(),
    onSuccess: utils_1.z.function(),
});
exports.DataUriLimitSchema = utils_1.z.partialObj({
    svg: utils_1.z.number(),
    font: utils_1.z.number(),
    image: utils_1.z.number(),
    media: utils_1.z.number(),
});
exports.LegalCommentsSchema = utils_1.z.literals([
    'none',
    'inline',
    'linked',
]);
exports.DisableSourceMapOptionSchema = utils_1.z.union([utils_1.z.boolean(), utils_1.z.partialObj({ js: utils_1.z.boolean(), css: utils_1.z.boolean() })]);
exports.SvgDefaultExportSchema = utils_1.z.literals([
    'component',
    'url',
]);
exports.sharedOutputConfigSchema = utils_1.z.partialObj({
    distPath: exports.DistPathConfigSchema,
    filename: exports.FilenameConfigSchema,
    charset: exports.CharsetSchema,
    polyfill: exports.PolyfillSchema,
    assetsRetry: exports.AssetsRetryOptionsSchema,
    assetPrefix: utils_1.z.string(),
    dataUriLimit: utils_1.z.union([utils_1.z.number(), exports.DataUriLimitSchema]),
    legalComments: exports.LegalCommentsSchema,
    cleanDistPath: utils_1.z.boolean(),
    convertToRem: utils_1.z.union([utils_1.z.boolean(), utils_1.z.instanceof(Object)]),
    cssModuleLocalIdentName: utils_1.z.string(),
    disableCssExtract: utils_1.z.boolean(),
    disableMinimize: utils_1.z.boolean(),
    disableSourceMap: exports.DisableSourceMapOptionSchema,
    disableTsChecker: utils_1.z.boolean(),
    disableFilenameHash: utils_1.z.boolean(),
    disableInlineRuntimeChunk: utils_1.z.boolean(),
    disableCssModuleExtension: utils_1.z.boolean(),
    enableAssetManifest: utils_1.z.boolean(),
    enableAssetFallback: utils_1.z.boolean(),
    enableLatestDecorators: utils_1.z.boolean(),
    enableCssModuleTSDeclaration: utils_1.z.boolean(),
    enableInlineScripts: utils_1.z.union([utils_1.z.boolean(), utils_1.z.instanceof(RegExp)]),
    enableInlineStyles: utils_1.z.union([utils_1.z.boolean(), utils_1.z.instanceof(RegExp)]),
    externals: utils_1.z.any(),
    overrideBrowserslist: utils_1.z.union([
        utils_1.z.array(utils_1.z.string()),
        utils_1.z.record(source_1.BuilderTargetSchema, utils_1.z.array(utils_1.z.string())),
    ]),
    svgDefaultExport: exports.SvgDefaultExportSchema,
});
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _schema = exports.sharedOutputConfigSchema;
