<?php $__env->startSection('content'); ?>
    <section class="page flush">
        <?php if(session('status')): ?>
            <div class="flash"><?php echo e(session('status')); ?></div>
        <?php endif; ?>

        <div class="panel inbox-shell" style="--inbox-list-w: <?php echo e($_COOKIE['inbox-list-w'] ?? '366'); ?>px; --inbox-context-w: <?php echo e($_COOKIE['inbox-context-w'] ?? '294'); ?>px">
            <aside class="inbox-list" style="position: relative;">
                <div class="resizer" data-target="inbox-list-w" data-edge="right" data-default="366" data-min="200" data-max="600"></div>
                <?php echo $__env->make('conversations.partials.inbox-header', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

                <div class="list-scroll">
                    <?php echo $__env->make('conversations.partials.sidebar-list', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                </div>
            </aside>

            <section class="inbox-thread">
                <div class="panel-header" style="padding: 16px;">
                    <div style="font-weight: 700; font-size: 16px; color: var(--text);">Conversation</div>
                </div>
                <div class="empty-state" style="align-self: center;">
                    Pick a thread from <?php echo e($organization?->name ?? 'the inbox'); ?> to view messages, customer context, and handoff status.
                </div>
                <div></div>
            </section>

            <aside class="inbox-context" style="position: relative;">
                <div class="resizer" data-target="inbox-context-w" data-edge="left" data-default="294" data-min="0" data-max="500"></div>
                <div class="panel-header" style="padding: 16px;">
                    <div style="font-weight: 700; font-size: 16px; color: var(--text);">Context</div>
                </div>
                <div class="context-scroll" style="flex: 1; min-height: 0; padding-bottom: 24px;">
                    <div class="context-profile">
                        <span class="profile-avatar">VN</span>
                        <h2><?php echo e($organization?->name ?? 'VejalNai'); ?></h2>
                        <span class="muted"><?php echo e($organization?->slug ?? 'workspace'); ?></span>
                        <a class="button" href="<?php echo e(route('chat-widget.show')); ?>" style="width: 100%;">View chat widget</a>
                    </div>
                    <div class="context-block">
                        <div class="context-title">
                            <h2>Queue health</h2>
                        </div>
                        <div class="activity-row">
                            <span class="muted">Open threads</span>
                            <strong><?php echo e($conversations->where('status', 'open')->count()); ?></strong>
                        </div>
                        <div class="activity-row">
                            <span class="muted">Human handoffs</span>
                            <strong><?php echo e($conversations->where('status', 'pending_human')->count()); ?></strong>
                        </div>
                    </div>
                    <div class="context-block">
                        <div class="context-title">
                            <h2>Channels</h2>
                        </div>
                        <?php $__currentLoopData = $conversations->groupBy('channel'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $channel => $items): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="activity-row">
                                <span class="muted"><?php echo e(ucfirst($channel)); ?></span>
                                <strong><?php echo e($items->count()); ?></strong>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                </div>
            </aside>
        </div>
    </section>

    <?php echo $__env->make('conversations.partials.inbox-scripts', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', [
    'title' => 'Inbox | VejalNai',
    'topbarTitle' => 'Shared Inbox',
    'topbarSubtitle' => $organization?->name ?? 'No organization assigned',
    'hideTopbar' => true,
], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/ecom123/public_html/chat.shunnointernational.com/resources/views/conversations/index.blade.php ENDPATH**/ ?>