"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.presets = void 0;
const actions_core_1 = require("@segment/actions-core");
const saveBaseEvent_1 = __importDefault(require("./saveBaseEvent"));
const saveCartEvent_1 = __importDefault(require("./saveCartEvent"));
const saveCheckoutEvent_1 = __importDefault(require("./saveCheckoutEvent"));
const saveCollectionEvent_1 = __importDefault(require("./saveCollectionEvent"));
const saveFormEvent_1 = __importDefault(require("./saveFormEvent"));
const saveOrder_1 = __importDefault(require("./saveOrder"));
const saveProductEvent_1 = __importDefault(require("./saveProductEvent"));
const saveSearchEvent_1 = __importDefault(require("./saveSearchEvent"));
const saveUser_1 = __importDefault(require("./saveUser"));
exports.presets = [
    {
        name: 'Save User',
        subscribe: 'type = "identify"',
        partnerAction: 'saveUser',
        mapping: (0, actions_core_1.defaultValues)(saveUser_1.default.fields),
        type: 'automatic'
    },
    {
        name: 'Save Event - Page Viewed',
        subscribe: 'type = "page"',
        partnerAction: 'saveBaseEvent',
        mapping: {
            ...(0, actions_core_1.defaultValues)(saveBaseEvent_1.default.fields),
            eventName: { '@template': 'page_viewed' }
        },
        type: 'automatic'
    },
    {
        name: 'Save Event - Cart Viewed',
        subscribe: 'event = "Cart Viewed"',
        partnerAction: 'saveBaseEvent',
        mapping: {
            ...(0, actions_core_1.defaultValues)(saveBaseEvent_1.default.fields),
            eventName: { '@template': 'cart_viewed' }
        },
        type: 'automatic'
    },
    {
        name: 'Save Event - Checkout Address Info Submitted',
        subscribe: 'event = "Checkout Address Info Submitted"',
        partnerAction: 'saveCheckoutEvent',
        mapping: {
            ...(0, actions_core_1.defaultValues)(saveCheckoutEvent_1.default.fields),
            eventName: 'checkout_address_info_submitted'
        },
        type: 'automatic'
    },
    {
        name: 'Save Event - Checkout Completed',
        subscribe: 'event = "Order Completed"',
        partnerAction: 'saveCheckoutEvent',
        mapping: {
            ...(0, actions_core_1.defaultValues)(saveCheckoutEvent_1.default.fields),
            eventName: 'checkout_completed'
        },
        type: 'automatic'
    },
    {
        name: 'Save Event - Checkout Contact Info Submitted',
        subscribe: 'event = "Checkout Contact Info Submitted"',
        partnerAction: 'saveCheckoutEvent',
        mapping: {
            ...(0, actions_core_1.defaultValues)(saveCheckoutEvent_1.default.fields),
            eventName: 'checkout_contact_info_submitted'
        },
        type: 'automatic'
    },
    {
        name: 'Save Event - Checkout Shipping Info Submitted',
        subscribe: 'event = "Checkout Shipping Info Submitted"',
        partnerAction: 'saveCheckoutEvent',
        mapping: {
            ...(0, actions_core_1.defaultValues)(saveCheckoutEvent_1.default.fields),
            eventName: 'checkout_shipping_info_submitted'
        },
        type: 'automatic'
    },
    {
        name: 'Save Event - Checkout Started',
        subscribe: 'event = "Checkout Started"',
        partnerAction: 'saveCheckoutEvent',
        mapping: {
            ...(0, actions_core_1.defaultValues)(saveCheckoutEvent_1.default.fields),
            eventName: 'checkout_started'
        },
        type: 'automatic'
    },
    {
        name: 'Save Event - Checkout Payment Info Submitted',
        subscribe: 'event = "Payment Info Entered"',
        partnerAction: 'saveCheckoutEvent',
        mapping: {
            ...(0, actions_core_1.defaultValues)(saveCheckoutEvent_1.default.fields),
            eventName: 'checkout_payment_info_submitted'
        },
        type: 'automatic'
    },
    {
        name: 'Save Event - Collection Viewed',
        subscribe: 'event = "Product List Viewed"',
        partnerAction: 'saveCollectionEvent',
        mapping: {
            ...(0, actions_core_1.defaultValues)(saveCollectionEvent_1.default.fields),
            eventName: 'collection_viewed'
        },
        type: 'automatic'
    },
    {
        name: 'Save Event - Search Submitted',
        subscribe: 'event = "Products Searched"',
        partnerAction: 'saveSearchEvent',
        mapping: {
            ...(0, actions_core_1.defaultValues)(saveSearchEvent_1.default.fields),
            eventName: 'search_submitted'
        },
        type: 'automatic'
    },
    {
        name: 'Save Event - Product Added To Cart',
        subscribe: 'event = "Product Added"',
        partnerAction: 'saveCartEvent',
        mapping: {
            ...(0, actions_core_1.defaultValues)(saveCartEvent_1.default.fields),
            eventName: 'product_added_to_cart'
        },
        type: 'automatic'
    },
    {
        name: 'Save Event - Product Removed From Cart',
        subscribe: 'event = "Product Removed"',
        partnerAction: 'saveCartEvent',
        mapping: {
            ...(0, actions_core_1.defaultValues)(saveCartEvent_1.default.fields),
            eventName: 'product_removed_from_cart'
        },
        type: 'automatic'
    },
    {
        name: 'Save Event - Product Viewed',
        subscribe: 'event = "Product Viewed"',
        partnerAction: 'saveProductEvent',
        mapping: {
            ...(0, actions_core_1.defaultValues)(saveProductEvent_1.default.fields),
            eventName: 'product_viewed'
        },
        type: 'automatic'
    },
    {
        name: 'Save Event - Form Submitted',
        subscribe: 'event = "Form Submitted"',
        partnerAction: 'saveFormEvent',
        mapping: {
            ...(0, actions_core_1.defaultValues)(saveFormEvent_1.default.fields),
            eventName: 'form_submitted'
        },
        type: 'automatic'
    },
    {
        name: 'Save Order',
        subscribe: 'event = "Order Completed"',
        partnerAction: 'saveOrder',
        mapping: (0, actions_core_1.defaultValues)(saveOrder_1.default.fields),
        type: 'automatic'
    }
];
//# sourceMappingURL=presets.js.map