// src/utils/photo-helpers.ts
var VIDEO_EXTENSIONS = [".mp4", ".mov", ".webm", ".m4v", ".avi", ".mkv", ".flv", ".wmv"];
function isVideoUrl(url) {
  var _a;
  if (!url || typeof url !== "string") return false;
  const path = (_a = url.split("?")[0]) != null ? _a : "";
  const ext = path.slice(path.lastIndexOf(".")).toLowerCase();
  return VIDEO_EXTENSIONS.includes(ext);
}
function getPhotoUrl(photos) {
  if (photos && photos.length > 0) {
    const featuredPhoto = photos.find((pa) => pa.featured);
    const photoToUse = featuredPhoto || photos[0];
    const photo = photoToUse.photo;
    if (photo) {
      return photo.large_url || photo.medium_url || photo.thumbnail_url || photo.original_url || null;
    }
  }
  return null;
}
function getAvatarUrl(photos, _fallbackId, _name) {
  return getPhotoUrl(photos);
}
function getFeaturedImageUrl(photos) {
  return getPhotoUrl(photos);
}
function getLogoUrl(websitePhotos) {
  var _a;
  if ((_a = websitePhotos == null ? void 0 : websitePhotos.logo) == null ? void 0 : _a.url) {
    return websitePhotos.logo.url;
  }
  return void 0;
}
export {
  getAvatarUrl,
  getFeaturedImageUrl,
  getLogoUrl,
  getPhotoUrl,
  isVideoUrl
};
//# sourceMappingURL=photo-helpers.js.map