var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
import { registerWebPlugin, WebPlugin } from '@capacitor/core';
import * as firebase from 'firebase';
export class CapacitorFirebaseAnalyticsEventsWeb extends WebPlugin {
    constructor() {
        super({
            name: 'CapacitorFirebaseAnalyticsEvents',
            platforms: ['web']
        });
    }
    addPaymentInfo() {
        return __awaiter(this, void 0, void 0, function* () {
            // @ts-ignore
            firebase.analytics().logEvent('add_payment_info');
            return Promise.resolve();
        });
    }
    beginCheckout(options) {
        return __awaiter(this, void 0, void 0, function* () {
            firebase.analytics().logEvent('begin_checkout', Object.assign({}, options.event, { transaction_id: options.event.transactionId, number_of_nights: options.event.numberOfNights, number_of_rooms: options.event.numberOfRooms, number_of_passengers: options.event.numberOfPassengers, start_date: options.event.startDate, end_date: options.event.endDate, travel_class: options.event.travelClass }));
            return Promise.resolve();
        });
    }
    campaignDetails(options) {
        return __awaiter(this, void 0, void 0, function* () {
            firebase.analytics().logEvent('campaign_details', Object.assign({}, options.event));
            return Promise.resolve();
        });
    }
    checkoutProgress(options) {
        return __awaiter(this, void 0, void 0, function* () {
            firebase.analytics().logEvent('checkout_progress', {
                checkout_step: options.event.checkoutStep,
                checkout_option: options.event.checkoutOption
            });
            return Promise.resolve();
        });
    }
    eCommercePurchase(options) {
        return __awaiter(this, void 0, void 0, function* () {
            firebase.analytics().logEvent('purchase', Object.assign({}, options.event, { transaction_id: options.event.transactionId, number_of_nights: options.event.numberOfNights, number_of_rooms: options.event.numberOfRooms, number_of_passengers: options.event.numberOfPassengers, start_date: options.event.startDate, end_date: options.event.endDate, travel_class: options.event.travelClass }));
            return Promise.resolve();
        });
    }
    earnVirtualCurrency(options) {
        return __awaiter(this, void 0, void 0, function* () {
            firebase.analytics().logEvent('earnVirtualCurrency', Object.assign({}, options.event, { virtual_currency_name: options.event.virtualCurrencyName }));
            return Promise.resolve();
        });
    }
    levelEnd(options) {
        return __awaiter(this, void 0, void 0, function* () {
            firebase.analytics().logEvent('level_end', Object.assign({}, options.event, { level_name: options.event.levelName }));
            return Promise.resolve();
        });
    }
    levelStart(options) {
        return __awaiter(this, void 0, void 0, function* () {
            firebase.analytics().logEvent('level_start', Object.assign({}, options.event, { level_name: options.event.levelName }));
            return Promise.resolve();
        });
    }
    levelUp(options) {
        return __awaiter(this, void 0, void 0, function* () {
            firebase.analytics().logEvent('level_up', Object.assign({}, options.event));
            return Promise.resolve();
        });
    }
    purchaseRefund(options) {
        return __awaiter(this, void 0, void 0, function* () {
            firebase.analytics().logEvent('purchase_refund', Object.assign({}, options.event, { transaction_id: options.event.transactionId }));
            return Promise.resolve();
        });
    }
    spendVirtualCurrency(options) {
        return __awaiter(this, void 0, void 0, function* () {
            firebase.analytics().logEvent('spend_virtual_currency', Object.assign({}, options.event, { virtual_currency_name: options.event.virtualCurrencyName }));
            return Promise.resolve();
        });
    }
}
const CapacitorFirebaseAnalyticsEvents = new CapacitorFirebaseAnalyticsEventsWeb();
export { CapacitorFirebaseAnalyticsEvents };
registerWebPlugin(CapacitorFirebaseAnalyticsEvents);
//# sourceMappingURL=web.js.map