<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/** @var $block \Magento\Backend\Block\Media\Uploader */
?>
<?php
    $maxWidth   = $block->getImageUploadMaxWidth()  ? $block->getImageUploadMaxWidth()  : 2880;
    $maxHeight  = $block->getImageUploadMaxHeight() ? $block->getImageUploadMaxHeight() : 1800;
?>
<div id="<?= $block->getHtmlId() ?>" class="uploader"
    data-mage-init='{
        "Magento_Backend/js/media-uploader" : {
            "maxFileSize": <?= /* @escapeNotVerified */ $block->getFileSizeService()->getMaxFileSize() ?>,
            "maxWidth":<?= /* @escapeNotVerified */ $maxWidth ?> ,
            "maxHeight": <?= /* @escapeNotVerified */ $maxHeight ?>
        }
    }'
>
    <div class="fileinput-button form-buttons button">
        <span><?= /* @escapeNotVerified */ __('Browse Files...') ?></span>
        <input id="fileupload" type="file" name="<?= /* @escapeNotVerified */ $block->getConfig()->getFileField() ?>"
            data-url="<?= /* @escapeNotVerified */ $block->getConfig()->getUrl() ?>" multiple="multiple" />
    </div>
    <div class="clear"></div>
    <script id="<?= $block->getHtmlId() ?>-template" type="text/x-magento-template" data-template="uploader">
        <div id="<%- data.id %>" class="file-row">
            <span class="file-info"><%- data.name %> (<%- data.size %>)</span>
            <div class="progressbar-container">
                <div class="progressbar upload-progress" style="width: 0%;"></div>
            </div>
            <div class="clear"></div>
        </div>
    </script>
</div>

