"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isLegacyInboundMessageRequest = isLegacyInboundMessageRequest;
exports.isFindAllIframesRequest = isFindAllIframesRequest;
exports.isFileInputEventMessage = isFileInputEventMessage;
exports.isInputFieldEventMessage = isInputFieldEventMessage;
exports.createBaseContentEventMessage = createBaseContentEventMessage;
const dom_util_1 = require("@mablhq-internal/mablscript-find/dom-util");
const mablscriptFind_1 = require("@mablhq/test-model/mablscriptFind");
const messages_1 = require("./messages");
function isLegacyInboundMessageRequest(request) {
    return !(0, mablscriptFind_1.isFindScrollableElementsRequest)(request);
}
function isFindAllIframesRequest(request) {
    return request.action === messages_1.FIND_ALL_IFRAMES;
}
function isFileInputEventMessage(message) {
    return 'files' in message;
}
function isInputFieldEventMessage(message) {
    return 'keyInfoArray' in message;
}
const INCLUDE_APP_STATE = true;
const INCLUDE_OTHER_ATTRIBUTES = true;
function createBaseContentEventMessage(target, action, listener, xPath, sourceEventTimeStamp, customTestIdAttributes, context) {
    const baseEventMessage = (0, dom_util_1.createBaseEventMessage)(target, action, listener, xPath, context, INCLUDE_APP_STATE, INCLUDE_OTHER_ATTRIBUTES, customTestIdAttributes);
    return {
        ...baseEventMessage,
        sourceEventTimeStamp,
    };
}
