/**
 * URL validation regex taken from stack overflow: https://stackoverflow.com/questions/5717093/check-if-a-javascript-string-is-a-url
 *
 * "https://www.google.com" => valid
 * "http://google.com" => valid
 * "http://booger.io" => valid
 * "http://intraneturl" => valid
 * "http://localhost:3375/components/test/index.html" => valid
 * "http://localhost:8089/SLEJSonServiceWeb/commonReact2.jsp?viewid=/lcm.houseacctprodlinexre.wrjs&swfversion=3_0&zone=CollateralManagement&functionName=Collateral%20Management&zoneLabel=Collateral%20Management#/?_k=f3xqnk" => valid
 * "http://127.0.0.1:3375/components/test/index.html" => valid
 * "http://127.0.01:3375/components/test/index.html" => not valid
 * "www.google.com" => not valid
 * "google.com" => not valid
 * "booger.io" => not valid
 * "boog" => not valid
 * NOTE: This function will fail intranet URLs without a top level domain.
 * @param str
 */
export function isValidURL(str) {
    if (str === "about:blank")
        return true;
    var pattern = new RegExp("^(https?:\\/\\/)" + // protocol
        "((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|" + // domain name
        "((\\d{1,3}\\.){3}\\d{1,3}))" + // OR ip (v4) address
        "(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*" + // port and path
        "(\\?)?([;&a-z\\d\\/#\\?%_.~+=-]*)?", // query string
    "i"); // fragment locator
    return !!pattern.test(str);
}
//# sourceMappingURL=validateURL.js.map