'use strict';

const Item = require('./Item-00ce8c24.js');

async function open(subset, connection, url) {
    let result;
    switch (subset) {
        case "authorization":
            result = new (await Promise.resolve().then(function () { return require('./Authorization-6dafd786.js'); })).Authorization(connection);
            break;
        case "verification":
            result = new (await Promise.resolve().then(function () { return require('./Verification-644f86d2.js'); })).Verification(connection);
            break;
        case "settlement":
            result = new (await Promise.resolve().then(function () { return require('./Settlement-7248b5af.js'); })).Settlement(connection);
            break;
        case "merchant":
            result = new (await Promise.resolve().then(function () { return require('./Merchant-6a4ea0dc.js'); })).Merchant(connection);
            break;
        case "card":
            result = new (await Promise.resolve().then(function () { return require('./Card-e9812246.js'); })).Card(connection);
            break;
        case "contact":
            result = new (await Promise.resolve().then(function () { return require('./Contact-f9e4facb.js'); })).Contact(connection);
            break;
        case "customer":
            result = new (await Promise.resolve().then(function () { return require('./Customer-53079c37.js'); })).Customer(connection);
            break;
        case "order":
            result = new (await Promise.resolve().then(function () { return require('./Order-97ceba6c.js'); })).Order(connection);
            break;
        case "log":
            result = new (await Promise.resolve().then(function () { return require('./Log-27fefbbf.js'); })).Log(connection);
            break;
        case "me":
            result = new (await Promise.resolve().then(function () { return require('./Me-77ac9d97.js'); })).Me(connection);
            break;
    }
    return result;
}

exports.Client = void 0;
(function (Client) {
    let Subset;
    (function (Subset) {
        Subset.acquirer = ["authorization", "merchant", "verification", "settlement"];
        Subset.card = ["card"];
        Subset.log = ["log"];
        Subset.psp = ["order", "customer", "me", "contact"];
        Subset.values = [...Subset.acquirer, ...Subset.card, ...Subset.log, ...Subset.psp];
        function is(value) {
            return typeof value == "string" && Subset.values.includes(value);
        }
        Subset.is = is;
        Subset.open = open;
    })(Subset = Client.Subset || (Client.Subset = {}));
    async function open$1(url, key, ...subset) {
        const connection = Item.Connection.open(url, key);
        return Object.fromEntries(await Promise.all(subset.map(async (m) => [m, await Subset.open(m, connection, url)])));
    }
    Client.open = open$1;
})(exports.Client || (exports.Client = {}));
