<?php $__env->startSection('header'); ?>
    <?php echo e(trans('admin.head.api_doc')); ?>


    &nbsp;&nbsp;

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

<?php $__env->startSection('main'); ?>
    <div class="row" style="padding-bottom: 20px;">

        <div class="col-md-12" style="padding-bottom: 15px;">
            <ul class="nav nav-tabs">
                <?php $__currentLoopData = $versions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $vName => $version): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <li <?php echo $active_version == $vName ? 'class="active"' : ''; ?>>
                    <a href="<?php echo e(route('admin.api_doc.list', ['version' => $vName])); ?>"><?php echo e($version['title']); ?></a>
                </li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </ul>
        </div>

        <div class="col-md-3">
            <div class="panel-group" id="accordion-categories">

                <?php $__currentLoopData = $docs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $categories): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if($categories): ?>
                    <div class="panel">
                        <div class="panel-heading">
                            <a class="accordion-toggle collapsed api-doc"
                               data-toggle="collapse"
                               data-parent="#accordion-categories"
                               href="#collapse-category-<?php echo e($key); ?>"
                               aria-expanded="false">

                                <?php echo e($categories['title']); ?>

                            </a>
                        </div>
                        <div id="collapse-category-<?php echo e($key); ?>"
                             class="panel-collapse collapse <?php echo e($key == 0 ? 'in' : ''); ?>"
                             aria-expanded="<?php echo e($key == 0 ? 'true' : 'false'); ?>">

                            <div class="list-group">

                                <?php if(isset($categories['endpoints']) && !empty($categories['endpoints'])): ?>
                                    <?php $__currentLoopData = $categories['endpoints']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat_key => $endpoint): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <a href="#api-desc-<?php echo e($key); ?>-<?php echo e($cat_key); ?>" class="list-group-item api-link-item <?php echo e(($key == 0 && $cat_key == 0) ? 'active' : ''); ?>">

                                            <?php if(isset($endpoint['method'])): ?>
                                                <?php if(is_array($endpoint['method'])): ?>
                                                    <?php $__currentLoopData = $endpoint['method']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $method): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <span class="badge badge-<?php echo e($method == 'GET' ? 'info' : 'success'); ?>">
                                                            <?php echo e($method); ?>

                                                        </span>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php else: ?>
                                                    <span class="badge badge-<?php echo e($endpoint['method'] == 'GET' ? 'info' : 'success'); ?>">
                                                        <?php echo e($endpoint['method']); ?>

                                                    </span>
                                                <?php endif; ?>
                                            <?php endif; ?>

                                                <?php echo e($endpoint['title'] ?? ''); ?>


                                            <?php if(isset($endpoint['desc']) && !empty($endpoint['desc'])): ?>
                                                <div class="text-muted api-desc-item"><?php echo e($endpoint['desc']); ?></div>
                                            <?php endif; ?>
                                        </a>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <?php else: ?>
                                    <span class="list-group-item">Empty</span>
                                <?php endif; ?>

                            </div>
                        </div>
                    </div>
                    <?php else: ?>
                        <hr />
                    <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

            </div>
        </div>

        <div class="col-md-9">

            <?php $__currentLoopData = $docs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $categories): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                <?php if(isset($categories['endpoints']) && !empty($categories['endpoints'])): ?>

                    <?php $__currentLoopData = $categories['endpoints']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat_key => $endpoint): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="panel api-panel-desc <?php echo e(($key == 0 && $cat_key == 0) ? '' : 'hidden'); ?>"
                         id="api-desc-<?php echo e($key); ?>-<?php echo e($cat_key); ?>">

                        <div class="panel-title"><?php echo e(isset($endpoint['title'])?$endpoint['title']:''); ?></div>

                        <?php if(isset($endpoint['desc']) && !empty($endpoint['desc'])): ?>
                            <small class="panel-subtitle text-muted"><?php echo e($endpoint['desc']); ?></small>
                        <?php endif; ?>

                        <div class="panel-body">
                            <h3 class="m-t-0">Request</h3>

                            <?php if(isset($endpoint['method']) && !empty($endpoint['method'])): ?>
                                <div class="flex-row">
                                    <b>Method:</b>

                                    <?php if(is_array($endpoint['method'])): ?>
                                        <?php $__currentLoopData = $endpoint['method']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $method): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <span class="badge badge-<?php echo e($method == 'GET' ? 'info' : 'success'); ?>">
                                                <?php echo e($method); ?>

                                            </span>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php else: ?>
                                        <span class="badge badge-<?php echo e($endpoint['method'] == 'GET' ? 'info' : 'success'); ?>">
                                            <?php echo e($endpoint['method']); ?>

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

                            <?php if(isset($endpoint['route']) && !empty($endpoint['route'])): ?>
                                <p><b>URL:</b> <?php echo e($endpoint['route']); ?></p>
                            <?php endif; ?>

                            <?php if(isset($endpoint['headers']) && !empty($endpoint['headers'])): ?>
                                <p>
                                    <b>Headers: </b>
                                    <pre><?php echo e(json_encode($endpoint['headers'], JSON_PRETTY_PRINT)); ?></pre>
                                </p>
                            <?php endif; ?>

                            <?php if(isset($endpoint['parameters']) && !empty($endpoint['parameters'])): ?>
                                <p>
                                    <b>Parameters: </b>
                                <ul>
                                    <?php $__currentLoopData = $endpoint['parameters']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $parameter): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <li>
                                            <b><?php echo e($parameter['name']); ?></b>
                                            <?php echo e($parameter['desc'] ?? ''); ?>

                                        </li>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </ul>
                                </p>
                            <?php endif; ?>

                            <?php if(isset($endpoint['body']) && !empty($endpoint['body'])): ?>
                                <p>
                                    <b>Body: </b>
                                    <pre><?php echo e(json_encode($endpoint['body'], JSON_PRETTY_PRINT)); ?></pre>
                                </p>
                            <?php endif; ?>

                            <?php if(isset($endpoint['response']) && !empty($endpoint['response'])): ?>
                                <hr>
                                <h3 class="m-t-0">Response</h3>

                                <?php $__currentLoopData = $endpoint['response']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $responseCode => $response): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                                    <div class="flex-row">
                                        <b>Code:</b>
                                        <span class="badge badge-<?php echo e($responseCode == '200' ? 'success' : 'danger'); ?>">
                                            <?php echo e($responseCode); ?>

                                        </span>
                                    </div>

                                    <?php if(isset($response['headers']) && !empty($response['headers'])): ?>

                                        <p>
                                            <b>Headers: </b>
                                            <pre><?php echo e(json_encode($response['headers'], JSON_PRETTY_PRINT)); ?></pre>
                                        </p>
                                    <?php endif; ?>

                                    <?php if(isset($response['body']) && !empty($response['body'])): ?>
                                        <p>
                                            <b>Body: </b>
                                            <pre><code><?php echo e(json_encode($response['body'], JSON_PRETTY_PRINT)); ?></code></pre>
                                        </p>
                                    <?php endif; ?>

                                    <p>&nbsp;</p>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php endif; ?>

                            
                                
                                
                                
                            
                        </div>
                    </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                <?php endif; ?>

            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

        </div>

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

<?php $__env->startSection('scripts'); ?>
    <script>
        $(document).ready(function () {
            $('.api-link-item').on('click', function (e) {
                e.preventDefault();

                if (!$(this).hasClass('active')) {
                    var active = $('.api-link-item.active');
                    active.removeClass('active');
                    $(active.attr('href')).addClass('hidden');

                    $(this).addClass('active');
                    $($(this).attr('href')).removeClass('hidden');
                }
            });
        });
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin._layout.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/resources/views.admin/admin/api_doc/list.blade.php ENDPATH**/ ?>