"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get defaultHttpProtocol () {
        return defaultHttpProtocol;
    },
    get httpToWsUrl () {
        return httpToWsUrl;
    }
});
const _zod = require("zod");
const _normalizeurl = require("./normalize-url");
const defaultHttpProtocol = "https";
function httpToWsUrl(url) {
    const validUrl = _zod.z.string().parse(url);
    const protocolNormalizedAddress = (0, _normalizeurl.normalizeUrl)(validUrl, {
        defaultProtocol: defaultHttpProtocol
    });
    const wsUrl = new URL(protocolNormalizedAddress);
    wsUrl.protocol = wsUrl.protocol === "https:" ? "wss:" : "ws:";
    return wsUrl;
}

//# sourceMappingURL=url.utils.js.map