@if(isset($front_logo) && $front_logo && file_exists(public_path() . '/images/genral/footer/' . $front_logo))
 }})
@else
{{ strtoupper(substr($title ?? 'E', 0, 1)) }}
@endif
{{ $footerContent ? strip_tags($footerContent->content) : __('Your trusted online marketplace for electronics, mobiles, fashion, home, beauty & more.') }}
@php
// Map every supported network slug -> SVG path data + label.
// Resolution order: explicit `icon` column first, then URL substring fallback for legacy data.
$socialIconLib = [
'facebook' => ['label' => 'Facebook', 'host' => 'facebook.com', 'd' => 'M9 8h-3v4h3v12h5v-12h3.6l.4-4h-4v-1.7c0-1 .2-1.3 1.1-1.3h2.9v-5h-3.8c-3.6 0-5.2 1.6-5.2 4.6v3.4z'],
'twitter' => ['label' => 'Twitter', 'host' => 'twitter.com', 'd' => 'M22 4.01c-1 .49-1.98.689-3 .99-1.121-1.265-2.783-1.335-4.38-.737S11.977 6.323 12 8v1c-3.245.083-6.135-1.395-8-4 0 0-4.182 7.433 4 11-1.872 1.247-3.739 2.088-6 2 3.308 1.803 6.913 2.423 10.034 1.517 3.58-1.04 6.522-3.723 7.651-7.742a13.84 13.84 0 0 0 .497-3.753c-.002-.249 1.51-2.772 1.818-4.013z'],
'instagram' => ['label' => 'Instagram', 'host' => 'instagram.com', 'd' => 'M12 2.16c3.2 0 3.58 0 4.85.07 3.25.15 4.77 1.69 4.92 4.92.06 1.27.07 1.65.07 4.85s0 3.58-.07 4.85c-.15 3.23-1.66 4.77-4.92 4.92-1.27.06-1.65.07-4.85.07s-3.58 0-4.85-.07c-3.26-.15-4.77-1.7-4.92-4.92-.06-1.27-.07-1.65-.07-4.85s0-3.58.07-4.85C2.38 3.92 3.9 2.38 7.15 2.23 8.42 2.18 8.8 2.16 12 2.16zM12 0C8.74 0 8.33 0 7.05.07 2.7.27.27 2.69.07 7.05.01 8.33 0 8.74 0 12s.01 3.67.07 4.95c.2 4.36 2.62 6.78 6.98 6.98C8.33 23.99 8.74 24 12 24s3.67-.01 4.95-.07c4.35-.2 6.78-2.62 6.98-6.98.06-1.28.07-1.69.07-4.95s-.01-3.67-.07-4.95c-.2-4.35-2.63-6.78-6.98-6.98C15.67.01 15.26 0 12 0z M12 5.84c-3.4 0-6.16 2.76-6.16 6.16s2.76 6.16 6.16 6.16 6.16-2.76 6.16-6.16-2.76-6.16-6.16-6.16zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4z M19.85 5.59c0 .8-.65 1.44-1.44 1.44s-1.44-.64-1.44-1.44.65-1.44 1.44-1.44 1.44.64 1.44 1.44z'],
'youtube' => ['label' => 'YouTube', 'host' => 'youtube.com', 'd' => 'M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z'],
'linkedin' => ['label' => 'LinkedIn', 'host' => 'linkedin.com', 'd' => 'M20.5 2h-17A1.5 1.5 0 0 0 2 3.5v17A1.5 1.5 0 0 0 3.5 22h17a1.5 1.5 0 0 0 1.5-1.5v-17A1.5 1.5 0 0 0 20.5 2zM8 19H5v-9h3zM6.5 8.25A1.75 1.75 0 1 1 8.3 6.5a1.78 1.78 0 0 1-1.8 1.75zM19 19h-3v-4.74c0-1.42-.6-1.93-1.38-1.93A1.74 1.74 0 0 0 13 14.19a.66.66 0 0 0 0 .14V19h-3v-9h2.9v1.3a3.11 3.11 0 0 1 2.7-1.4c1.55 0 3.36.86 3.36 3.66z'],
'pinterest' => ['label' => 'Pinterest', 'host' => 'pinterest.', 'd' => 'M12 0a12 12 0 0 0-4.4 23.16c-.1-.92-.2-2.34.04-3.34.22-.91 1.42-5.78 1.42-5.78s-.36-.72-.36-1.78c0-1.67.97-2.92 2.18-2.92 1.03 0 1.52.77 1.52 1.7 0 1.03-.66 2.58-1 4.02-.28 1.2.6 2.18 1.78 2.18 2.14 0 3.78-2.26 3.78-5.52 0-2.88-2.07-4.9-5.03-4.9-3.43 0-5.44 2.57-5.44 5.23 0 1.04.4 2.15.9 2.75.1.12.11.22.08.34l-.33 1.37c-.05.22-.18.27-.4.16-1.5-.7-2.43-2.88-2.43-4.64 0-3.78 2.74-7.25 7.91-7.25 4.15 0 7.38 2.96 7.38 6.92 0 4.13-2.6 7.45-6.21 7.45-1.21 0-2.36-.63-2.74-1.38l-.75 2.85c-.27 1.04-1 2.34-1.49 3.13A12 12 0 1 0 12 0z'],
'whatsapp' => ['label' => 'WhatsApp', 'host' => 'wa.me', 'd' => 'M20.5 3.5A11.4 11.4 0 0 0 12 0a12 12 0 0 0-10.4 18L0 24l6.2-1.6A12 12 0 0 0 12 24a12 12 0 0 0 8.5-20.5zM12 21.8a9.8 9.8 0 0 1-5-1.4l-.4-.2-3.7 1 1-3.6-.2-.4a9.8 9.8 0 1 1 8.3 4.6zm5.4-7.3c-.3-.2-1.7-.9-2-1s-.5-.2-.7.2-.8 1-1 1.2-.4.2-.7 0a8 8 0 0 1-2.4-1.4 9 9 0 0 1-1.6-2c-.2-.3 0-.5.1-.6l.4-.5.3-.4.1-.5c0-.1 0-.4-.1-.6l-1-2.2c-.2-.5-.5-.5-.7-.5h-.6a1.1 1.1 0 0 0-.8.4 3.4 3.4 0 0 0-1 2.5c0 1.5 1 2.9 1.2 3.1.1.2 2.1 3.2 5 4.5 2.1.9 2.4.7 2.8.7s1.6-.7 1.8-1.2c.2-.6.2-1.1.2-1.2-.1-.1-.3-.2-.6-.4z'],
'telegram' => ['label' => 'Telegram', 'host' => 't.me', 'd' => 'M9.78 18.65l.28-4.23 7.68-6.92c.34-.31-.07-.46-.52-.19l-9.49 6L3.7 11.87c-.88-.25-.89-.86.2-1.3l15.97-6.16c.73-.33 1.43.18 1.15 1.3l-2.72 12.81c-.19.91-.74 1.13-1.5.71l-4.13-3.05-1.99 1.93c-.23.23-.42.42-.85.42z'],
'tiktok' => ['label' => 'TikTok', 'host' => 'tiktok.com', 'd' => 'M19.6 7.4a6.4 6.4 0 0 1-3.7-1.2 6.4 6.4 0 0 1-2.5-3.6h-3.3v13.2a3 3 0 1 1-2.1-2.9V9.6a6.3 6.3 0 1 0 5.4 6.2V9.7a9.6 9.6 0 0 0 6.2 2.1z'],
'snapchat' => ['label' => 'Snapchat', 'host' => 'snapchat.com', 'd' => 'M12 0a8 8 0 0 0-8 8c0 1.1 0 2.5-.4 3.5-.3.7-1.1 1.2-1.7 1.6-.5.3-.8.6-.6 1 .3.5 1.5.8 2.5 1.1.5.2.6.7.6 1.1 0 .2.1.4.4.5l1.6.4c.2 0 .3.2.4.5.2.7.6 1.5 1.6 1.5.6 0 1.1-.2 1.7-.4.6-.2 1.2-.4 1.9-.4s1.4.2 2 .4c.5.2 1 .4 1.6.4 1 0 1.4-.8 1.6-1.5.1-.3.2-.5.4-.5l1.6-.4c.3-.1.4-.3.4-.5 0-.4.1-.9.6-1.1 1-.3 2.2-.6 2.5-1.1.2-.4-.1-.7-.6-1-.6-.4-1.4-.9-1.7-1.6-.4-1-.4-2.4-.4-3.5a8 8 0 0 0-8-8z'],
'discord' => ['label' => 'Discord', 'host' => 'discord.', 'd' => 'M20.3 4.4A19.8 19.8 0 0 0 15.4 3l-.3.4c1.6.4 3.1 1 4.5 1.9-1.7-.9-3.6-1.4-5.6-1.6-.6 0-1.3-.1-1.9-.1s-1.3 0-1.9.1c-2 .2-3.9.7-5.6 1.6 1.4-.9 2.9-1.5 4.5-1.9L8.6 3a19.8 19.8 0 0 0-4.9 1.4 21.6 21.6 0 0 0-3.6 14.6 14.7 14.7 0 0 0 4.4 2.3l1-1.4c-.7-.2-1.4-.6-2-1.1l.5-.3a14 14 0 0 0 12 0l.5.3c-.6.4-1.3.8-2 1.1l1 1.4a14.7 14.7 0 0 0 4.4-2.3 21.6 21.6 0 0 0-3.6-14.6zM8.5 15.4c-1.1 0-2-1-2-2.3s.9-2.3 2-2.3 2 1 2 2.3-.9 2.3-2 2.3zm7 0c-1.1 0-2-1-2-2.3s.9-2.3 2-2.3 2 1 2 2.3-.9 2.3-2 2.3z'],
'github' => ['label' => 'GitHub', 'host' => 'github.com', 'd' => 'M12 .3a12 12 0 0 0-3.8 23.4c.6.1.8-.3.8-.6v-2.2c-3.3.7-4-1.6-4-1.6-.5-1.4-1.3-1.7-1.3-1.7-1.1-.8.1-.7.1-.7 1.2.1 1.8 1.2 1.8 1.2 1.1 1.8 2.8 1.3 3.5 1 .1-.8.4-1.3.8-1.6-2.7-.3-5.5-1.3-5.5-6 0-1.3.5-2.4 1.2-3.2-.1-.3-.5-1.5.1-3.2 0 0 1-.3 3.3 1.2a11.5 11.5 0 0 1 6 0c2.3-1.5 3.3-1.2 3.3-1.2.7 1.7.2 2.9.1 3.2.8.8 1.2 1.9 1.2 3.2 0 4.6-2.8 5.7-5.5 6 .4.4.8 1.1.8 2.2v3.3c0 .3.2.7.8.6A12 12 0 0 0 12 .3z'],
];
// Aliases — legacy short codes admins may have stored.
$socialAliases = [
'fb' => 'facebook', 'tw' => 'twitter', 'ig' => 'instagram', 'yt' => 'youtube',
'in' => 'linkedin', 'pin' => 'pinterest', 'wa' => 'whatsapp', 'tg' => 'telegram',
'x' => 'twitter',
];
@endphp
@if(!empty($socials) && count($socials))
@php
$renderedSocials = collect($socials)->filter(function ($s) {
return (int) ($s->status ?? 1) === 1 && !empty($s->url);
});
@endphp
@if($renderedSocials->count())
@foreach($renderedSocials as $social)
@php
$key = strtolower(trim((string) $social->icon));
if (isset($socialAliases[$key])) $key = $socialAliases[$key];
$glyph = $socialIconLib[$key] ?? null;
// Fallback: detect by URL host if icon code didn't match.
if (!$glyph) {
$hostHaystack = strtolower((string) $social->url);
foreach ($socialIconLib as $g) {
if (strpos($hostHaystack, $g['host']) !== false) { $glyph = $g; break; }
}
}
@endphp
@if($glyph)
@else
{{-- Generic share glyph for any unknown network --}}
@endif
@endforeach
@endif
@endif