<?php $__env->startSection('title', 'Sayfa Düzenle'); ?>

<?php $__env->startSection('breadcrumb'); ?>
    <div class="container-fluid px-4">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb my-0">
                <li class="breadcrumb-item"><a href="<?php echo e(route('admin.dashboard.index')); ?>">Anasayfa</a></li>
                <li class="breadcrumb-item <?php if(!$page): ?> active <?php endif; ?>">
                    <?php if($page): ?>
                        <a href="<?php echo e(route('admin.pages.index')); ?>">Sayfalar</a>
                    <?php else: ?>
                        <span>Sayfalar</span>
                    <?php endif; ?>
                </li>
                <?php $__currentLoopData = $ancestors; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ancestor): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li class="breadcrumb-item">
                        <a href="<?php echo e(route('admin.pages.index', ['id' => $ancestor->id])); ?>"><?php echo e($ancestor->title); ?></a>
                    </li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php if($page): ?>
                    <li class="breadcrumb-item active">
                        <a href="<?php echo e(route('admin.pages.index', ['id' => $page->id])); ?>"><?php echo e($page->title); ?></a>
                    </li>
                <?php endif; ?>
                <li class="breadcrumb-item active"><span>Sayfa Düzenle</span></li>
            </ol>
        </nav>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

    <div class="container-lg px-4">
        <div class="row">
            <div class="col-12">
                <div class="card mb-4">
                    <div class="card-header">
                        <strong>Sayfa Düzenle</strong>
                    </div>
                    <div class="card-body">
                        <div class="example">
                            <ul class="nav nav-underline-border" role="tablist">
                                <li class="nav-item">
                                    <a class="nav-link active" data-coreui-toggle="tab" href="#preview-1004" role="tab">
                                        <svg class="icon me-2">
                                            <use
                                                xlink:href="<?php echo e(URL::to('admin/vendors/@coreui/icons/svg/free.svg#cil-align-left')); ?>">
                                            </use>
                                        </svg>
                                        Sayfa Düzenle
                                    </a>
                                </li>
                            </ul>
                            <div class="tab-content rounded-bottom">
                                <div class="tab-pane p-3 active preview" role="tabpanel" id="preview-1004">
                                    <?php
$__split = function ($name, $params = []) {
    return [$name, $params];
};
[$__name, $__params] = $__split('admin.pages.edit', ['page' => $page]);

$__html = app('livewire')->mount($__name, $__params, 'lw-2311795596-0', $__slots ?? [], get_defined_vars());

echo $__html;

unset($__html);
unset($__name);
unset($__params);
unset($__split);
if (isset($__slots)) unset($__slots);
?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

<?php $__env->startSection('css'); ?>
    <?php echo \Livewire\Mechanisms\FrontendAssets\FrontendAssets::styles(); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('js'); ?>
<?php echo \Livewire\Mechanisms\FrontendAssets\FrontendAssets::scripts(); ?>

<script src="https://cdn.jsdelivr.net/gh/livewire/sortable@v1.x.x/dist/livewire-sortable.js"></script>


    <script src="<?php echo e(URL::to('admin/ckeditor/build/ckeditor.js')); ?>"></script>

    <script>
        const toastConfig = {
            toast: true,
            position: 'top-end',
            showConfirmButton: false,
            timer: 2000,
            timerProgressBar: true,
        };

        document.addEventListener('livewire:init', () => {
            initCKEditors();

            Livewire.on('highlight-updated', (event) => {
                var element = document.getElementById('item-' + event.id);
                if (element) {
                    ensureVisible(element);
                }
            });

            Livewire.on('showAlert', (event) => {
                Swal.fire({
                    ...toastConfig,
                    text: event[0].text,
                    icon: event[0].icon,
                });
            });

            var lfm = function(id, type, options) {
                let button = document.getElementById(id);

                button.addEventListener('click', function() {
                    var route_prefix = (options && options.prefix) ? options.prefix : '/laravel-filemanager';

                    window.open(route_prefix + '?type=' + (type || 'file'), 'FileManager', 'width=1200,height=800');
                    window.SetUrl = function(items) {
                        var file_paths = items.map(function(item) { return item.url; }).join(',');
                        var file_names = items.map(function(item) { return item.url.split('/').pop(); }).join(',');

                        var pathsArray = file_paths.split(',');
                        var namesArray = file_names.split(',');

                        for (var i = 0; i < pathsArray.length; i++) {
                            Livewire.dispatch('addInput', { filePath: pathsArray[i], fileName: namesArray[i] });
                        }
                    };
                });
            };

            var route_prefix = "<?php echo e(url('filemanager')); ?>";
            lfm('lfm1', 'image', { prefix: route_prefix });
        });
    </script>

<?php $__env->stopSection(); ?>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layout.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/furkanciloglu/Herd/impoholdingpanel/resources/views/admin/pages/edit.blade.php ENDPATH**/ ?>