'use strict';

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });

const tailwindConfig = require('./tailwind-config-24192028.cjs');
const copyAssets = require('./copy-assets.cjs');
const assets_index = require('./assets/index.cjs');
const cn = require('./cn.cjs');
const assets_fonts_index = require('./assets/fonts/index.cjs');
const assets_images_index = require('./assets/images/index.cjs');
require('fs');
require('path');

const sliceAddress = (address, startSliceBy = 6, endSliceBy) => {
  if (!address || typeof address !== "string") {
    return "";
  }
  let sliceAddress2 = "";
  const effectiveEndSliceBy = endSliceBy || startSliceBy;
  if (address.length < startSliceBy + effectiveEndSliceBy) {
    return address;
  }
  sliceAddress2 = address.length > startSliceBy + 2 ? `${address.slice(0, startSliceBy + 2)}...${address.slice(
    -effectiveEndSliceBy
  )}` : address;
  return sliceAddress2;
};

const SOCIAL_MEDIA = {
  facebook: ["facebook.com", "messenger.com", "fb.com", "fb.me"],
  x: ["x.com", "twitter.com", "t.co"],
  instagram: ["instagram.com"],
  medium: ["medium.com"],
  discord: ["discord.com", "discordapp.com", "discord.gg"],
  snapchat: ["snapchat.com"],
  whatsapp: ["whatsapp.com", "wa.me"],
  telegram: ["telegram.com", "t.me", "telegram.org"],
  linkedin: ["linkedin.com"],
  github: ["github.com"],
  "universal-page": ["universal.page"],
  youtube: ["youtube.com", "youtu.be", "youtube-nocookie.com"],
  spotify: ["spotify.com", "open.spotify.com"],
  soundcloud: ["soundcloud.com"],
  warpcast: ["warpcast.com"]
};
const detectSocialMedia = (url) => {
  if (!url) {
    return;
  }
  try {
    const hostname = new URL(url).hostname;
    for (const [key, domains] of Object.entries(SOCIAL_MEDIA)) {
      const hostnameFormatted = hostname.replace("www.", "");
      const match = domains.some(
        (domain) => new RegExp(`\\b${domain}\\b`, "i").test(hostnameFormatted)
      );
      if (match) {
        return key;
      }
    }
  } catch {
    return;
  }
};

exports.borderRadius = tailwindConfig.borderRadius;
exports.boxShadows = tailwindConfig.boxShadows;
exports.colorPalette = tailwindConfig.colorPalette;
exports.fontSizes = tailwindConfig.fontSizes;
exports.fontWeights = tailwindConfig.fontWeights;
exports.heights = tailwindConfig.heights;
exports.hslColorMap = tailwindConfig.hslColorMap;
exports.lineHeights = tailwindConfig.lineHeights;
exports.neutral1 = tailwindConfig.neutral1;
exports.neutral2 = tailwindConfig.neutral2;
exports.neutral3 = tailwindConfig.neutral3;
exports.scales = tailwindConfig.scales;
exports.spacing = tailwindConfig.spacing;
exports.copyAssets = copyAssets.copyAssets;
exports.assets = assets_index.assets;
exports.cn = cn.cn;
exports.fonts = assets_fonts_index.fonts;
exports.images = assets_images_index.images;
exports.detectSocialMedia = detectSocialMedia;
exports.sliceAddress = sliceAddress;
