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

$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames(([
    'accept' => '.jpg,.jpeg,.gif,.png',
    'maxSize' => null,
    'maxFiles' => 1,
    'fileTitle' => null,
    'fileLabel' => __('admin.selectFileOrDrag'),
    'buttonLabel' => __('admin.selectAFile'),
    'id' => 'file-uploader',
    'dropOnBody' => true,
    'inputName' => 'files',
    'onSelectFile' => null,
]));

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(([
    'accept' => '.jpg,.jpeg,.gif,.png',
    'maxSize' => null,
    'maxFiles' => 1,
    'fileTitle' => null,
    'fileLabel' => __('admin.selectFileOrDrag'),
    'buttonLabel' => __('admin.selectAFile'),
    'id' => 'file-uploader',
    'dropOnBody' => true,
    'inputName' => 'files',
    'onSelectFile' => null,
]), '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); ?>
<div class="artisan-uploader bg-light rounded uploader-<?php echo e($id); ?>">
    <input id="<?php echo e($id); ?>" type="file" name="<?php echo e($inputName); ?>"
        accept="<?php echo e($accept); ?>"<?php echo e($maxFiles > 1 ? ' multiple' : ''); ?> />
    <div class="bg-priamary p-2 add-more d-none position-absolute">
        <label class="btn btn-primary btn-pill" for="<?php echo e($id); ?>">+</label>
    </div>
    <label for="<?php echo e($id); ?>" class="file-drag<?php echo e($slot->isEmpty() ? '' : ' pb-1'); ?>">
        <div class="uploader-wrapper">
            <?php if(!empty($svg)): ?>
                <?php echo e($svg); ?>

            <?php else: ?>
                <i class="an an-upload-image"></i>
            <?php endif; ?>
            <?php if($fileTitle): ?>
                <h3><?php echo e($fileTitle); ?></h3>
            <?php endif; ?>
            <?php if(!empty($accept)): ?>
                <div class="uploader-extensions mb-3">
                    <?php $__currentLoopData = explode(',', $accept); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ext): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <span class="badge text-uppercase"><?php echo e($ext); ?></span>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            <?php endif; ?>
            <p><?php echo e($fileLabel); ?></p>
            <span class="btn btn-dark file-upload-btn"><?php echo e($buttonLabel); ?></span>
        </div>
        <div class="files-grid"></div>
    </label>
    <?php if(!$slot->isEmpty()): ?>
        <div class="uploader-after p-3">
            <?php echo e($slot); ?>

        </div>
    <?php endif; ?>
</div>

<?php $__env->startPush('page_scripts'); ?>
    <script>
        document.addEventListener("DOMContentLoaded", function(event) {
            ArtisanApp.initUpload(document.querySelector('.uploader-<?php echo e($id); ?>'), {
                dropOnBody: <?php echo e($dropOnBody ? 'true' : 'false'); ?>,
                maxFiles: <?php echo e($maxFiles); ?>,
                fileExtensions: "<?php echo e(Str::replace(',', '|', $accept)); ?>",
                <?php if(!empty($maxSize)): ?>
                    maxSize: <?php echo e($maxSize); ?>,
                <?php endif; ?>
                <?php if(!empty($onSelectFile)): ?>
                    fileSelectedCallback: '<?php echo e($onSelectFile); ?>',
                <?php endif; ?>
            }, {
                extensionsError: "<?php echo e(__('admin.fileTypeNotSupported')); ?>",
                sizeError: "<?php echo e(__('admin.maxFileSizeError', ['size' => $maxSize])); ?>",
                filesError: "<?php echo e(__('admin.maxFileLimitError')); ?>",
            });
        });
    </script>
<?php $__env->stopPush(); ?>
<?php /**PATH /www/wwwroot/webtoolzone.com/resources/themes/canvas/components/upload-wrapper.blade.php ENDPATH**/ ?>