<?php  namespace App\Services;  use DOMDocument; use Carbon\Carbon; use App\Contracts\HasMedia; use Illuminate\Support\Str; use Illuminate\Http\Request; use Illuminate\Http\UploadedFile; use App\Contracts\HasTranslations; use Illuminate\Support\Collection; use App\Models\Media as MediaModel; use Spatie\MediaLibrary\Support\MediaStream; use Spatie\MediaLibrary\MediaCollections\Models\Media;  class MediaStorage { 	/** 	 * @var string 	 */ 	final public const FILENAME_GLUE = '-';  	/** 	 * @var string 	 */ 	final public const MEDIA_PREFIX = 'media';  	/** 	 * @var string 	 */ 	final public const THUMB_KEY = 'thumb';  	/** 	 * @var string 	 */ 	final public const IDS_KEY = 'ids';  	/** 	 * @var string 	 */ 	final public const NEW_NAMES_KEY = 'new_names';  	/** 	 * @var string 	 */ 	final public const TITLE_KEY = 'titles';  	/** 	 * @var string 	 */ 	final public const ORDER_KEY = 'order';  	/** 	 * @var string 	 */ 	final public const MARKED_REMOVAL_KEY = 'marked_removal';  	protected object $model;  	protected Request $request;  	public function __construct(HasMedia $model){}  	public static function getValidationRules(?string $prefix = null): array 	{ 		$prefix ??= self::MEDIA_PREFIX; 		$prefix = $prefix !== '' ? $prefix . '.' : '';  		return [ 			$prefix . self::IDS_KEY => ['array'], 			$prefix . self::IDS_KEY . '.*' => ['required', 'uuid', 'distinct'], 			$prefix . self::MARKED_REMOVAL_KEY => ['array'], 			$prefix . self::MARKED_REMOVAL_KEY . '.*' => ['required', 'uuid', 'distinct'], 			$prefix . self::NEW_NAMES_KEY => ['array'], 			$prefix . self::NEW_NAMES_KEY . '.*' => ['required', 'string', 'max:250'], 			$prefix . self::TITLE_KEY => ['array'], 			$prefix . self::TITLE_KEY . '.*' => ['nullable', 'string', 'max:250'], 			$prefix . self::ORDER_KEY => ['array'], 			$prefix . self::ORDER_KEY . '.*' => ['nullable', 'integer', 'min:0'], 		]; 	}  	public static function mergeValidationRules(array $rules = [], ?string $prefix = null): array 	{ 		return array_replace(self::getValidationRules($prefix), $rules); 	}  	public function setModel(HasMedia $model): self{}  	public function setRequest(Request $request): self{}  	public function setDisk(?string $disk = null): self{}  	public function handle(?array $media = [], array $pairs = []): self{}  	public function handleFromNestedArray(array $inputArray, ?array $media = [], array $pairs = []): self{}  	public function files(string $collection = ''): Collection{}  	public function deleteFiles(string $collection = ''): self{}  	public function isAudio(MediaModel $file): bool{}  	public function isImage(MediaModel $file): bool{}  	public function isVideo(MediaModel $file): bool{}  	public function isMime(MediaModel $file, string $mime): bool{}  	public function getMime(MediaModel $file): ?string{}  	public function url(?MediaModel $file = null, ?string $conversion = null): ?string{}  	public function getProtectedFirst(string $collection = '', ?string $conversion = null): ?string{}  	public function getProtectedFirstThumb(string $collection = ''): ?string{}  	public function getProtectedThumb(MediaModel $file): ?string{}  	public function protectedUrl(?MediaModel $file = null, ?string $conversion = null): ?string{}  	public function getProtectedAll(string $collection = '', ?string $conversion = null): array{}  	public function getProtectedAllThumbs(string $collection = ''): array{}  	public function getAll(string $collection = '', ?string $conversion = null): array{}  	public function getAllThumbs(string $collection = ''): array{}  	public function getThumb(MediaModel $file): ?string{}  	public function getFirst(string $collection = '', ?string $conversion = null): ?string{}  	public function getFirstThumb(string $collection = ''): ?string{}  	public function getFirstFile(string $collection = ''): ?MediaModel{}  	public function getResponsiveImages(MediaModel $file, ?string $conversion = null, bool $protected = false): array{}  	public function getResponsiveImage(string|MediaModel $file, int $width, ?string $conversion = null, bool $protected = false): ?string{}  	public function size(MediaModel $file): int{}  	public function getFileId(MediaModel $file): string{}  	public function getOrder(MediaModel $file): ?int{}  	public function getPath(MediaModel $file, ?string $conversion = null): string{}  	public function getName(MediaModel $file): string{}  	public function getTitle(MediaModel $file): ?string{}  	public function getExt(MediaModel $file): string{}  	public function lastModified(MediaModel $file): ?Carbon{}  	public function createdAt(MediaModel $file): ?Carbon{}  	public function generateFileName(string $filename): string{}  	public function zip(string $zip, array $collections = []): MediaStream{}  	public function saveFromFileUpload(UploadedFile $file, array $options): ?Media{}  	public function saveFromUrl(string $url, array $options): Media{}  	public function saveFromString(string $string, array $options): Media{}  	public function saveFromBase64(string $string, array $options): Media{}  	public function saveFromHtml(string $input, string $html, array $options): self{}  	public function saveFromStream(mixed $stream, array $options): Media{}  	protected function getProtectedMediaRoute(MediaModel $file, array $params = []): string{}  	protected function resolveMediaConfig(array $pairs = []): array{}  	protected function deleteFromRequest(?array $media = []): self{}  	protected function renameAndReorderFromRequest(?array $media = []): self{}  	protected function registerMediaCollections(array $pairs = []): self{}  	protected function saveFromRequest(array $pairs = []): self{} }