"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.IOS_ELEMENT_RESPONSE_ATTRIBUTES = void 0;
exports.isIOSElementReference = isIOSElementReference;
const Candidate_1 = __importDefault(require("../Candidate"));
class iOSElementReferenceClass {
    enabled = undefined;
    label = undefined;
    rect = undefined;
    selected = undefined;
    type = undefined;
    'attribute/accessible' = undefined;
    'attribute/index' = undefined;
    'attribute/name' = undefined;
    'attribute/value' = undefined;
    'attribute/visible' = undefined;
}
exports.IOS_ELEMENT_RESPONSE_ATTRIBUTES = Object.keys(new iOSElementReferenceClass());
class iOSCandidate extends Candidate_1.default {
    static fromElementReference(elementReference) {
        const selector = elementReferenceToSelector(elementReference);
        return new iOSCandidate(elementReference, selector);
    }
}
exports.default = iOSCandidate;
function isIOSElementReference(element) {
    return element.type !== undefined;
}
function elementReferenceToSelector(elementReference) {
    const iOSElementReference = elementReference;
    return {
        enabled: iOSElementReference.enabled,
        label: iOSElementReference.label,
        rect: iOSElementReference.rect,
        selected: iOSElementReference.selected,
        type: iOSElementReference.type,
        index: iOSElementReference['attribute/index'],
        name: iOSElementReference['attribute/name'],
        value: iOSElementReference['attribute/value']?.toString(),
        visible: iOSElementReference['attribute/visible'],
    };
}
