import { loadEnd, loadStart } from '@wix/bex-core/bi';
import { reportEvent } from '@wix/bex-utils/@wix/ambassador-dealer-v1-offer-event/http';
import { EventType } from '@wix/bex-utils/@wix/ambassador-dealer-v1-offer-event/types';
export class SuggestionsBIReporter {
    constructor(params) {
        this.reportBI = params.reportBI;
        this.realEstateId = params.realEstateId;
        this.httpClient = params.httpClient;
    }
    loadStart() {
        this.reportBI(loadStart({}));
    }
    loadEnd(startTime) {
        this.reportBI(loadEnd({ loadingTime: Math.round(performance.now() - startTime) }));
    }
    reportOfferViewed(offerId) {
        this.httpClient.request(reportEvent({
            event: {
                type: EventType.VIEW,
                offerId,
                realEstateId: this.realEstateId,
            },
        }));
    }
    reportOfferClicked(offerId, targetUrl) {
        this.httpClient.request(reportEvent({
            event: {
                type: EventType.MAIN_CTA_CLICK,
                offerId,
                realEstateId: this.realEstateId,
                mainCtaClick: {
                    targetUrl: targetUrl ?? '',
                },
            },
        }));
    }
}
//# sourceMappingURL=SuggestionsBIReporter.js.map