
<?php if (isset($component)) { $__componentOriginal2587877bb4e520741a841aceca30fb82 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2587877bb4e520741a841aceca30fb82 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.mb-layout','data' => ['pageTitle' => $pageTitle ?? 'New chat','conversations' => $conversations,'conversationId' => $conversationId,'campaignPanel' => true,'hasCampaign' => $hasCampaign ?? false]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('mb-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['page-title' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($pageTitle ?? 'New chat'),'conversations' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($conversations),'conversation-id' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($conversationId),'campaign-panel' => true,'has-campaign' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($hasCampaign ?? false)]); ?>

    <section class="mb-chat<?php echo e(!empty($hasCampaign) ? ' has-campaign-open' : ''); ?>" data-context="Create a new ad campaign">
        <div class="mb-chat-scroll" id="chatScroll">
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(empty($transcript)): ?>
                <div class="mb-starters" id="starterPrompts">
                    <div class="mb-starters-title">What would you like to build today?</div>
                    <div class="mb-starters-grid">
                        <button type="button" class="mb-starter-card" data-action="starter" data-prompt="Create a new Meta ad campaign">
                            <div class="mb-starter-icon"><i class="bi bi-meta"></i></div>
                            <div class="mb-starter-body">
                                <strong>Meta Ads Campaign</strong>
                                <span>Drive traffic and conversions across Facebook & Instagram feeds and stories</span>
                            </div>
                        </button>
                        <button type="button" class="mb-starter-card" data-action="starter" data-prompt="Create a new Google Ads campaign">
                            <div class="mb-starter-icon"><i class="bi bi-google"></i></div>
                            <div class="mb-starter-body">
                                <strong>Google Ads Campaign</strong>
                                <span>Capture high-intent searches with Search, Display, and Performance Max</span>
                            </div>
                        </button>
                        <button type="button" class="mb-starter-card" data-action="starter" data-prompt="Create a new LinkedIn campaign">
                            <div class="mb-starter-icon"><i class="bi bi-linkedin"></i></div>
                            <div class="mb-starter-body">
                                <strong>LinkedIn Ads Campaign</strong>
                                <span>Engage decision-makers, professionals, and targeted B2B audiences</span>
                            </div>
                        </button>
                    </div>
                </div>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

            <div id="msgs" class="d-flex flex-column">
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $transcript; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $message): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="mb-msg<?php echo e($message['role'] === 'user' ? ' me' : ''); ?>">
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($message['html']): ?>
                            <?php echo $message['html']; ?>

                        <?php else: ?>
                            <?php echo e($message['text']); ?>

                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </div>
        </div>

        <button type="button" class="mb-scroll-bottom-pill d-none" id="scrollBottomBtn" aria-label="Scroll to newest messages">
            New messages <i class="bi bi-arrow-down-short"></i>
        </button>

        <div id="dropOverlay" class="mb-drop-overlay d-none">
            <i class="bi bi-cloud-arrow-up mb-drop-icon"></i>
            <span class="mb-drop-text">Drop image or video files to attach</span>
        </div>

        <div class="mb-composer-wrap">
            <div class="mb-composer" id="composerBox">
                <div class="mb-attachments" id="attachments"></div>
                <textarea rows="1" placeholder="<?php echo e(empty($transcript) ? 'Describe your campaign or paste a landing page URL...' : 'Type your message...'); ?>" aria-label="Message" id="composer"></textarea>
                <div class="mb-composer-bar">
                    <button class="mb-icon-btn" data-pop="attach" aria-label="Add attachment" aria-haspopup="menu"><i class="bi bi-plus-lg"></i></button>
                    <div class="d-flex align-items-center">
                        <span id="composerCounter" class="mb-char-counter small" aria-live="polite"></span>
                        <button class="mb-send" data-action="send" aria-label="Send"><i class="bi bi-arrow-up"></i></button>
                    </div>
                </div>
                <input type="file" id="fileInput" multiple hidden accept="image/*,video/mp4,video/quicktime">
            </div>
        </div>

        
        <div class="mb-pop mb-menu mb-attach-menu d-none" id="pop-attach" role="menu">
            <button type="button" class="mb-menu-item" data-action="attach-file" role="menuitem"><i class="bi bi-paperclip"></i>Attach file</button>
        </div>
    </section>

    
    <aside class="mb-campaign<?php echo e(!empty($hasCampaign) ? ' open' : ''); ?>" id="campaignDrawer" aria-label="Campaign">
        <div class="mb-campaign-head">
            <strong>Campaign</strong>
            <button class="mb-icon-btn" data-action="toggle-campaign" aria-label="Close campaign"><i class="bi bi-x-lg"></i></button>
        </div>
        <div class="mb-campaign-body" id="panel"><?php echo $panelHtml; ?></div>
        <div class="mb-campaign-foot">
            <button id="publish" class="btn btn-primary w-100" <?php if(! $ready || $published): echo 'disabled'; endif; ?>>
                <?php echo e($published ? 'Published' : 'Publish'); ?>

            </button>
            <div id="publishNote" class="mb-campaign-note"></div>
        </div>
    </aside>

    <?php $__env->startPush('scripts'); ?>
        <script>
            window.chat = {
                conversation: <?php echo json_encode($conversationId, 15, 512) ?>,
                sendUrl: <?php echo json_encode(route('chat.send'), 15, 512) ?>,
                publishUrl: <?php echo json_encode(route('chat.publish'), 15, 512) ?>,
                decideUrl: <?php echo json_encode(route('chat.decide'), 15, 512) ?>,
                viewUrl: <?php echo json_encode(route('chat.view'), 15, 512) ?>,
                awaiting: <?php echo json_encode($awaiting ?? [], 15, 512) ?>,
                choices: <?php echo json_encode($choices ?? [], 15, 512) ?>,
                hasCampaign: <?php echo json_encode((bool) ($hasCampaign ?? false), 15, 512) ?>,
                token: <?php echo json_encode(csrf_token(), 15, 512) ?>,
            };
        </script>
        <script src="<?php echo e(asset('assets/js/chat.js')); ?>?v=<?php echo e(filemtime(public_path('assets/js/chat.js'))); ?>"></script>
    <?php $__env->stopPush(); ?>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2587877bb4e520741a841aceca30fb82)): ?>
<?php $attributes = $__attributesOriginal2587877bb4e520741a841aceca30fb82; ?>
<?php unset($__attributesOriginal2587877bb4e520741a841aceca30fb82); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2587877bb4e520741a841aceca30fb82)): ?>
<?php $component = $__componentOriginal2587877bb4e520741a841aceca30fb82; ?>
<?php unset($__componentOriginal2587877bb4e520741a841aceca30fb82); ?>
<?php endif; ?>
<?php /**PATH /var/www/php85/koushik/arb.admedia.com/resources/views/chat.blade.php ENDPATH**/ ?>