@if($guard_web ?? false) @php $initialUnread = (int) ($orderNotificationsUnreadCount ?? 0); $variant = $variant ?? 'desktop'; $legacyHeader = $legacyHeader ?? ((int) config('app.template_version', 2)) === 1; $rootClasses = 'dropdown order-notifications-root order-notifications-root--' . $variant; if ($legacyHeader) { $rootClasses .= ' order-notifications-root--legacy'; } $legacyDesktop = $legacyHeader && $variant === 'desktop'; $triggerClasses = 'order-notifications-trigger'; if ($variant === 'desktop' && !$legacyHeader) { $triggerClasses .= ' app-header-pill'; } elseif ($legacyDesktop) { $triggerClasses = 'btn btn-icon btn-clean btn-lg mr-1'; } else { $triggerClasses .= ' btn p-0 mobile-action-btn'; } $triggerStyle = $legacyDesktop ? 'background-color: #FFFFFF; position: relative;' : ''; $badgeClasses = 'order-notif-badge'; if ($legacyDesktop) { $badgeClasses .= ' label label-danger label-rounded'; } $badgeStyle = 'position: absolute; top: -8px; right: -8px; background-color: #F64E60; color: #ffffff; border-radius: 50%; padding: 4px 6px; font-size: 10px; min-width: 18px; text-align: center;'; if ($initialUnread < 1) { $badgeStyle .= ' display: none;'; } $notifThemeBase = '#' . ltrim(trim((string) ($backgroundColor ?? '0c447c')), '#'); $notifR = hexdec(substr($notifThemeBase, 1, 2)); $notifG = hexdec(substr($notifThemeBase, 3, 2)); $notifB = hexdec(substr($notifThemeBase, 5, 2)); $notifDarkRatio = 0.25; $notifThemeDark = sprintf( '#%02X%02X%02X', (int) round($notifR * (1 - $notifDarkRatio)), (int) round($notifG * (1 - $notifDarkRatio)), (int) round($notifB * (1 - $notifDarkRatio)) ); $notifThemeRgb = $notifR . ', ' . $notifG . ', ' . $notifB; $notifThemeStyle = '--notif-primary: ' . $notifThemeBase . '; --notif-primary-dark: ' . $notifThemeDark . '; --notif-primary-rgb: ' . $notifThemeRgb . ';'; @endphp @once @endonce