import { mergeDeep, someNumber, someString, } from '@wix/metro-common-builders';
import { SortOrder, Tag, FilterOptionsType, FilterSelectionType, AvatarShape, ImageShape, ThumbnailType, PaginationMode, } from './types.impl';
// @ts-ignore
import stack from 'callsite';
export function aItemsSelectionProvider(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        key: someString(),
        appId: someString(),
        searchParams: aSearchParams(),
        contentData: aContentData(),
        additionalStepInfo: aAdditionalStepInfo(),
        supportedTags: [
            aTag(),
            aTag(),
            aTag(),
            aTag(),
            aTag(),
            aTag(),
            aTag(),
            aTag(),
            aTag(),
            aTag(),
        ],
        createNewItemInfo: aCreateNewItemInfo(),
        itemThumbnail: aItemThumbnail(),
        paginationMode: aPaginationMode(),
        tagsOverrides: [
            aTagOverridesEntry(),
            aTagOverridesEntry(),
            aTagOverridesEntry(),
            aTagOverridesEntry(),
            aTagOverridesEntry(),
            aTagOverridesEntry(),
            aTagOverridesEntry(),
            aTagOverridesEntry(),
            aTagOverridesEntry(),
            aTagOverridesEntry(),
        ],
        renderOverrides: aItemsSelectionProviderConfigRenderOverrides(),
    }, overrideObject);
}
export function aSearchParams(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        fields: [
            aSearchField(),
            aSearchField(),
            aSearchField(),
            aSearchField(),
            aSearchField(),
            aSearchField(),
            aSearchField(),
            aSearchField(),
            aSearchField(),
            aSearchField(),
        ],
        filters: [
            aFilterInfo(),
            aFilterInfo(),
            aFilterInfo(),
            aFilterInfo(),
            aFilterInfo(),
            aFilterInfo(),
            aFilterInfo(),
            aFilterInfo(),
            aFilterInfo(),
            aFilterInfo(),
        ],
    }, overrideObject);
}
export function aSearchField(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        key: someString(),
        description: someString({
            validations: [
                { type: 'MIN_LENGTH', value: '1' },
                { type: 'MAX_LENGTH', value: '100' },
            ],
        }),
    }, overrideObject);
}
export function aFilterInfo(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        staticOptions: aStaticFilterOptions(),
        key: someString({
            validations: [
                { type: 'MIN_LENGTH', value: '1' },
                { type: 'MAX_LENGTH', value: '100' },
            ],
        }),
        tag: aTag(),
        selectionType: aFilterSelectionType(),
        optionsType: aFilterOptionsType(),
        placeholder: someString({
            validations: [{ type: 'MAX_LENGTH', value: '500' }],
        }),
    }, overrideObject);
}
export function aTag(enumFirstItem) {
    if (enumFirstItem === void 0) { enumFirstItem = Tag.UNKNOWN_TAG; }
    return enumFirstItem;
}
export function aFilterSelectionType(enumFirstItem) {
    if (enumFirstItem === void 0) { enumFirstItem = FilterSelectionType.UNKNOWN_SELECTION; }
    return enumFirstItem;
}
export function aFilterOptionsType(enumFirstItem) {
    if (enumFirstItem === void 0) { enumFirstItem = FilterOptionsType.UNKNOWN_FILTER_OPTIONS; }
    return enumFirstItem;
}
export function aStaticFilterOptions(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        data: [
            aStaticFilterOption(),
            aStaticFilterOption(),
            aStaticFilterOption(),
            aStaticFilterOption(),
            aStaticFilterOption(),
            aStaticFilterOption(),
            aStaticFilterOption(),
            aStaticFilterOption(),
            aStaticFilterOption(),
            aStaticFilterOption(),
        ],
    }, overrideObject);
}
export function aStaticFilterOption(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        label: someString({
            validations: [
                { type: 'MIN_LENGTH', value: '1' },
                { type: 'MAX_LENGTH', value: '500' },
            ],
        }),
        value: someString({
            validations: [
                { type: 'MIN_LENGTH', value: '1' },
                { type: 'MAX_LENGTH', value: '100' },
            ],
        }),
    }, overrideObject);
}
export function aProviderFilterOptions(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        key: someString({
            validations: [
                { type: 'MIN_LENGTH', value: '3' },
                { type: 'MAX_LENGTH', value: '250' },
            ],
        }),
    }, overrideObject);
}
export function aContentData(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        iconKey: someString({
            validations: [
                { type: 'MIN_LENGTH', value: '3' },
                { type: 'MAX_LENGTH', value: '50' },
            ],
        }),
        providerName: someString({
            validations: [
                { type: 'MIN_LENGTH', value: '1' },
                { type: 'MAX_LENGTH', value: '100' },
            ],
        }),
        title: someString({
            validations: [
                { type: 'MIN_LENGTH', value: '1' },
                { type: 'MAX_LENGTH', value: '100' },
            ],
        }),
        button: someString({
            validations: [
                { type: 'MIN_LENGTH', value: '1' },
                { type: 'MAX_LENGTH', value: '50' },
            ],
        }),
        subtitle: someString({
            validations: [
                { type: 'MIN_LENGTH', value: '1' },
                { type: 'MAX_LENGTH', value: '100' },
            ],
        }),
        learnMore: aLearnMore(),
    }, overrideObject);
}
export function aLearnMore(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        url: someString({
            validations: [{ type: 'MAX_LENGTH', value: '2048' }],
        }),
        label: someString({
            validations: [{ type: 'MAX_LENGTH', value: '500' }],
        }),
    }, overrideObject);
}
export function aAdditionalStepInfo(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        widgetId: someString(),
        mobileComponentId: someString({
            validations: [
                { type: 'MIN_LENGTH', value: '1' },
                { type: 'MAX_LENGTH', value: '50' },
            ],
        }),
        title: someString({
            validations: [
                { type: 'MIN_LENGTH', value: '1' },
                { type: 'MAX_LENGTH', value: '100' },
            ],
        }),
        subtitle: someString({
            validations: [{ type: 'MAX_LENGTH', value: '100' }],
        }),
        hideItemNote: true,
    }, overrideObject);
}
export function aCreateNewItemInfo(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        widgetId: someString(),
        mobileComponentId: someString({
            validations: [
                { type: 'MIN_LENGTH', value: '1' },
                { type: 'MAX_LENGTH', value: '50' },
            ],
        }),
        buttonText: someString({
            validations: [
                { type: 'MIN_LENGTH', value: '1' },
                { type: 'MAX_LENGTH', value: '50' },
            ],
        }),
    }, overrideObject);
}
export function aItemThumbnail(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        imageConfig: aImageConfig(),
        type: aThumbnailType(),
        hidden: true,
    }, overrideObject);
}
export function aThumbnailType(enumFirstItem) {
    if (enumFirstItem === void 0) { enumFirstItem = ThumbnailType.UNKNOWN_THUMBNAIL_TYPE; }
    return enumFirstItem;
}
export function aImageConfig(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        shape: aImageShape(),
    }, overrideObject);
}
export function aImageShape(enumFirstItem) {
    if (enumFirstItem === void 0) { enumFirstItem = ImageShape.UNKNOWN_SHAPE; }
    return enumFirstItem;
}
export function aAvatarConfig(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        shape: aAvatarShape(),
    }, overrideObject);
}
export function aAvatarShape(enumFirstItem) {
    if (enumFirstItem === void 0) { enumFirstItem = AvatarShape.UNKNOWN_SHAPE; }
    return enumFirstItem;
}
export function aPaginationMode(enumFirstItem) {
    if (enumFirstItem === void 0) { enumFirstItem = PaginationMode.UNKNOWN_PAGINATION_MODE; }
    return enumFirstItem;
}
export function aTagOverridesEntry(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
        overrides: aTagOverrides(),
    }, overrideObject);
}
export function aTagOverrides(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        additionalFields: {},
        contentData: aContentDataOverrides(),
    }, overrideObject);
}
export function aContentDataOverrides(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        providerName: someString({
            validations: [
                { type: 'MIN_LENGTH', value: '1' },
                { type: 'MAX_LENGTH', value: '100' },
            ],
        }),
    }, overrideObject);
}
export function aItemsSelectionProviderConfigRenderOverrides(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        hideSearch: true,
    }, overrideObject);
}
export function aListInstalledProvidersRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aListInstalledProvidersResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        providers: [aItemsSelectionProvider()],
    }, overrideObject);
}
export function aListProvidersRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aListProvidersResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        providers: [aItemsSelectionProvider()],
    }, overrideObject);
}
export function aQueryItemsRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        providerKey: someString(),
        query: aQuery(),
        tag: aTag(),
    }, overrideObject);
}
export function aQuery(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        paging: aPaging(),
        filter: {},
        sort: [aSorting()],
        search: someString(),
    }, overrideObject);
}
export function aSorting(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        fieldName: someString({
            validations: [{ type: 'MAX_LENGTH', value: '512' }],
        }),
        order: aSortOrder(),
        selectItemsBy: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}],
    }, overrideObject);
}
export function aSortOrder(enumFirstItem) {
    if (enumFirstItem === void 0) { enumFirstItem = SortOrder.ASC; }
    return enumFirstItem;
}
export function aPaging(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        limit: someNumber({
            validations: [{ type: 'MIN' }],
        }),
        offset: someNumber({
            validations: [{ type: 'MIN' }],
        }),
    }, overrideObject);
}
export function aCursorPaging(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        limit: someNumber({
            validations: [
                { type: 'MIN' },
                { type: 'MAX', value: '100' },
            ],
        }),
        cursor: someString({
            validations: [
                { type: 'MAX_LENGTH', value: '16000' },
            ],
        }),
    }, overrideObject);
}
export function aQueryItemsResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        items: [aItem()],
        pagingMetadata: aPagingMetadataV2(),
        renderOverrides: aRenderOverrides(),
    }, overrideObject);
}
export function aItem(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        id: someString(),
        name: someString({
            validations: [{ type: 'MAX_LENGTH', value: '250' }],
        }),
        description: someString({
            validations: [{ type: 'MAX_LENGTH', value: '1000' }],
        }),
        image: aImage(),
        note: someString({
            validations: [{ type: 'MAX_LENGTH', value: '100' }],
        }),
        hasAdditionalStep: true,
        additionalData: aAdditionalData(),
        additionalFields: {},
    }, overrideObject);
}
export function aImage(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        url: someString({
            validations: [{ type: 'MAX_LENGTH', value: '2048' }],
        }),
    }, overrideObject);
}
export function aAdditionalData(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        ecomCatalogData: aEcomCatalogData(),
    }, overrideObject);
}
export function aEcomCatalogData(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        appId: someString({
            validations: [{ type: 'FORMAT', value: 'GUID' }],
        }),
        catalogItemId: someString({
            validations: [
                { type: 'MIN_LENGTH', value: '1' },
                { type: 'MAX_LENGTH', value: '36' },
            ],
        }),
        price: someString({
            validations: [
                {
                    type: 'DECIMAL_VALUE',
                    value: { gte: '0', lte: '1000000000000000' },
                },
            ],
        }),
        options: {},
    }, overrideObject);
}
export function aInboxData(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        actions: [
            aAction(),
            aAction(),
            aAction(),
            aAction(),
            aAction(),
            aAction(),
            aAction(),
            aAction(),
            aAction(),
            aAction(),
        ],
    }, overrideObject);
}
export function aAction(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        title: someString({
            validations: [{ type: 'MAX_LENGTH', value: '100' }],
        }),
        url: someString({
            validations: [{ type: 'MAX_LENGTH', value: '2048' }],
        }),
    }, overrideObject);
}
export function aPagingMetadataV2(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        count: someNumber(),
        offset: someNumber(),
        total: someNumber(),
        tooManyToCount: true,
        cursors: aCursors(),
        hasNext: true,
    }, overrideObject);
}
export function aCursors(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        next: someString({
            validations: [
                { type: 'MAX_LENGTH', value: '16000' },
            ],
        }),
        prev: someString({
            validations: [
                { type: 'MAX_LENGTH', value: '16000' },
            ],
        }),
    }, overrideObject);
}
export function aRenderOverrides(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        emptyState: aQueryItemsEmptyState(),
        totalText: someString({
            validations: [{ type: 'MAX_LENGTH', value: '200' }],
        }),
    }, overrideObject);
}
export function aQueryItemsEmptyState(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        title: someString({
            validations: [{ type: 'MAX_LENGTH', value: '200' }],
        }),
        subtitle: someString({
            validations: [{ type: 'MAX_LENGTH', value: '200' }],
        }),
    }, overrideObject);
}
function isCurrentBuilderWasPreviouslyCalled() {
    var callChainFunctionNames = stack().map(function (item) {
        return item.getFunctionName();
    });
    var callChainWithoutCurrentBuilder = callChainFunctionNames.splice(2);
    var currentBuilderName = callChainFunctionNames[1];
    return callChainWithoutCurrentBuilder.some(function (functionName) { return functionName === currentBuilderName; });
}
export * from '@wix/metro-common-builders';
//# sourceMappingURL=builders.impl.js.map