<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;

$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['rating' => 0, 'size' => 'md', 'showNumber' => false, 'readonly' => false]));

foreach ($attributes->all() as $__key => $__value) {
    if (in_array($__key, $__propNames)) {
        $$__key = $$__key ?? $__value;
    } else {
        $__newAttributes[$__key] = $__value;
    }
}

$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);

unset($__propNames);
unset($__newAttributes);

foreach (array_filter((['rating' => 0, 'size' => 'md', 'showNumber' => false, 'readonly' => false]), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
    $$__key = $$__key ?? $__value;
}

$__defined_vars = get_defined_vars();

foreach ($attributes->all() as $__key => $__value) {
    if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}

unset($__defined_vars, $__key, $__value); ?>

<?php
    $rating = min(5, max(0, (float) $rating));
    $fullStars = floor($rating);
    $hasHalfStar = ($rating - $fullStars) >= 0.5;
    $emptyStars = 5 - $fullStars - ($hasHalfStar ? 1 : 0);
    
    $sizeClasses = [
        'sm' => 'text-sm',
        'md' => 'text-base',
        'lg' => 'text-lg',
        'xl' => 'text-xl',
    ];
    $iconSize = $sizeClasses[$size] ?? $sizeClasses['md'];
?>

<div class="star-rating <?php echo e($iconSize); ?>" <?php echo e($attributes); ?>>
    <?php for($i = 1; $i <= $fullStars; $i++): ?>
        <i class="bi bi-star-fill text-warning"></i>
    <?php endfor; ?>
    
    <?php if($hasHalfStar): ?>
        <i class="bi bi-star-half text-warning"></i>
    <?php endif; ?>
    
    <?php for($i = 1; $i <= $emptyStars; $i++): ?>
        <i class="bi bi-star text-muted"></i>
    <?php endfor; ?>
    
    <?php if($showNumber): ?>
        <span class="ms-2 text-muted"><?php echo e(number_format($rating, 1)); ?></span>
    <?php endif; ?>
</div>

<?php /**PATH /var/www/html/sudheerkt_uat/resources/views/components/star-rating.blade.php ENDPATH**/ ?>