"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.contactIdentifier = void 0;
const channelIdentifier = {
    label: 'Contact Identifier type',
    description: 'Select the field to identify contacts.',
    type: 'string',
    default: 'email',
    required: true,
    choices: [
        { label: 'Email address', value: 'email' },
        { label: 'Mobile number', value: 'mobileNumber' }
    ]
};
const emailIdentifier = {
    label: 'Email Address',
    description: "The Contact's email address.",
    type: 'string',
    format: 'email',
    default: {
        '@if': {
            exists: { '@path': '$.traits.email' },
            then: { '@path': '$.traits.email' },
            else: { '@path': '$.properties.email' }
        }
    },
    depends_on: {
        conditions: [{ fieldKey: 'channelIdentifier', operator: 'is', value: 'email' }]
    },
    required: {
        conditions: [{ fieldKey: 'channelIdentifier', operator: 'is', value: 'email' }]
    }
};
const mobileNumberIdentifier = {
    label: 'Mobile Number',
    description: "The Contact's mobile number.",
    type: 'string',
    default: {
        '@if': {
            exists: { '@path': '$.traits.phone' },
            then: { '@path': '$.traits.phone' },
            else: { '@path': '$.properties.phone' }
        }
    },
    depends_on: {
        conditions: [{ fieldKey: 'channelIdentifier', operator: 'is', value: 'mobileNumber' }]
    },
    required: {
        conditions: [{ fieldKey: 'channelIdentifier', operator: 'is', value: 'mobileNumber' }]
    }
};
exports.contactIdentifier = {
    channelIdentifier,
    emailIdentifier,
    mobileNumberIdentifier
};
//# sourceMappingURL=contact-identifier.js.map