"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.URLResolver = void 0;
const options_resolver_1 = require("../options-resolver");
/**
 * URL resolver
 */
class URLResolver {
    /**
     * Resolves an url provided by the user.
     * @param {Options} options - Command options.
     * @param {Profile} secondSource - Secondary data source.
     * @param {string} altText - Alternative text.
     * @param {string} altKey - Alternative key.
     * @returns {Promise<string>}
     */
    async resolve(options, secondSource, altText, altKey) {
        const resolution = await (0, options_resolver_1.OptionsResolver)(options, altKey ? altKey : 'url', () => (secondSource ? secondSource.url : undefined), altText ? altText : 'Enter the Symbol node URL. (Example: http://localhost:3000):', 'text', undefined);
        return resolution.endsWith('/') ? resolution.slice(0, -1) : resolution;
    }
}
exports.URLResolver = URLResolver;
