import { isAbsoluteUrl } from "./is-absolute-url.js";
import { WIX_MEDIA_BASE_URL, WIX_VIDEO_BASE_URL } from "./media-url-consts.js";
const getAbsoluteUrl = (url, type) => {
  if (isAbsoluteUrl(url)) {
    return url;
  }
  let baseUrl, baseFolder;
  if (type === "image") {
    baseUrl = WIX_MEDIA_BASE_URL;
    baseFolder = "media/";
  } else {
    baseUrl = WIX_VIDEO_BASE_URL;
    baseFolder = "video/";
  }
  const pathWithFolder = url.startsWith(baseFolder) ? url : baseFolder + url;
  return baseUrl + pathWithFolder;
};
export {
  getAbsoluteUrl
};
//# sourceMappingURL=get-absolute-url.js.map
