'',
'film' => '',
'music' => '',
'headphones'=> '',
'image' => '',
'sparkles' => '',
'filetext' => '',
'tool' => '',
'download' => '',
'video' => '',
'search' => '',
'info' => '',
'text' => '',
'users' => '',
'link' => '',
'code' => '',
'clock' => '',
'qr' => '',
'shield' => '',
'key' => '',
'palette' => '',
'file' => '',
'folder' => '',
'phone' => '',
'list' => '',
'swap' => '',
'layers' => '',
'star' => '',
'arrow' => '',
'menu' => '',
];
$d = $paths[$name] ?? $paths['file'];
return '';
}
}
if (! function_exists('textPlaceholder')) {
function textPlaceholder(string $operation): string
{
return match ($operation) {
'hash_text' => 'Paste any text to hash…',
'json_format' => '{"paste":"your JSON here"}',
'url_encode' => 'Text to encode…',
'url_decode' => 'Text%20to%20decode…',
'uuid_gen' => '',
'timestamp_convert' => '1735689600 or 2025-01-01 12:00:00',
'color_convert' => '#7c3aed',
'yt_url_analyze' => 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
'yt_embed' => 'Paste a YouTube URL to build an embed code…',
'yt_timestamp' => 'Paste a YouTube URL and set the time below…',
default => 'Type or paste text here…',
};
}
}
if (! function_exists('format_bytes')) {
function format_bytes(int|float|null $bytes, int $precision = 1): string
{
$bytes = max(0, (int) $bytes);
if ($bytes < 1024) {
return $bytes . ' B';
}
foreach (['KB', 'MB', 'GB', 'TB'] as $unit) {
$bytes /= 1024;
if ($bytes < 1024) {
return round((float) $bytes, $precision) . ' ' . $unit;
}
}
return round((float) $bytes, $precision) . ' PB';
}
}