<section>
    <header>
        <h2 class="text-lg font-medium text-gray-900">
            <?php echo e(__('Verified Accounts')); ?>

        </h2>
        <p class="mt-1 text-sm text-gray-600">
            Link your external profiles to build trust with buyers and sellers.
        </p>
    </header>

    <div class="mt-6 space-y-6">
        <?php if($activeServices->isEmpty()): ?>
            <p class="text-gray-600">No trust services available yet.</p>
        <?php else: ?>
            <?php $__currentLoopData = $activeServices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $service): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php
                    $userLink = auth()->user()->trustLinks()
                        ->where('trust_service_id', $service->id)
                        ->first();
                ?>

                <div class="border border-gray-200 rounded-lg p-4">
                    <div class="flex items-center justify-between mb-3">
                        <div>
                            <h3 class="font-semibold text-gray-900"><?php echo e($service->name); ?></h3>
                            <?php if($service->description): ?>
                                <p class="text-sm text-gray-600"><?php echo e($service->description); ?></p>
                            <?php endif; ?>
                        </div>
                        <?php if($userLink): ?>
                            <span class="px-3 py-1 rounded-full text-xs font-semibold
                                <?php if($userLink->status === 'verified'): ?>
                                    bg-green-100 text-green-700
                                <?php elseif($userLink->status === 'challenge_sent' || $userLink->status === 'submitted'): ?>
                                    bg-yellow-100 text-yellow-700
                                <?php else: ?>
                                    bg-gray-100 text-gray-700
                                <?php endif; ?>
                            ">
                                <?php echo e(ucfirst(str_replace('_', ' ', $userLink->status))); ?>

                            </span>
                        <?php else: ?>
                            <span class="px-3 py-1 rounded-full text-xs font-semibold bg-gray-100 text-gray-700">
                                Not Connected
                            </span>
                        <?php endif; ?>
                    </div>

                    <?php if(!$userLink): ?>
                        <form method="POST" action="<?php echo e(route('trust.store', $service)); ?>" class="space-y-3">
                            <?php echo csrf_field(); ?>
                            <div>
                                <?php if (isset($component)) { $__componentOriginale3da9d84bb64e4bc2eeebaafabfb2581 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginale3da9d84bb64e4bc2eeebaafabfb2581 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.input-label','data' => ['for' => 'remote_url_'.e($service->id).'','value' => 'Your Profile URL']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('input-label'); ?>
<?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(['for' => 'remote_url_'.e($service->id).'','value' => 'Your Profile URL']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginale3da9d84bb64e4bc2eeebaafabfb2581)): ?>
<?php $attributes = $__attributesOriginale3da9d84bb64e4bc2eeebaafabfb2581; ?>
<?php unset($__attributesOriginale3da9d84bb64e4bc2eeebaafabfb2581); ?>
<?php endif; ?>
<?php if (isset($__componentOriginale3da9d84bb64e4bc2eeebaafabfb2581)): ?>
<?php $component = $__componentOriginale3da9d84bb64e4bc2eeebaafabfb2581; ?>
<?php unset($__componentOriginale3da9d84bb64e4bc2eeebaafabfb2581); ?>
<?php endif; ?>
                                <?php if (isset($component)) { $__componentOriginal18c21970322f9e5c938bc954620c12bb = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal18c21970322f9e5c938bc954620c12bb = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.text-input','data' => ['id' => 'remote_url_'.e($service->id).'','name' => 'remote_user_url','type' => 'url','class' => 'w-full','placeholder' => 'https://'.e(parse_url($service->url, PHP_URL_HOST)).'/your-username','required' => true]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('text-input'); ?>
<?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(['id' => 'remote_url_'.e($service->id).'','name' => 'remote_user_url','type' => 'url','class' => 'w-full','placeholder' => 'https://'.e(parse_url($service->url, PHP_URL_HOST)).'/your-username','required' => true]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal18c21970322f9e5c938bc954620c12bb)): ?>
<?php $attributes = $__attributesOriginal18c21970322f9e5c938bc954620c12bb; ?>
<?php unset($__attributesOriginal18c21970322f9e5c938bc954620c12bb); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal18c21970322f9e5c938bc954620c12bb)): ?>
<?php $component = $__componentOriginal18c21970322f9e5c938bc954620c12bb; ?>
<?php unset($__componentOriginal18c21970322f9e5c938bc954620c12bb); ?>
<?php endif; ?>
                                <?php $__errorArgs = ['remote_user_url'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="text-red-600 text-sm"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <button type="submit" class="inline-flex items-center px-4 py-2 bg-gray-800 text-white rounded-lg hover:bg-gray-700 text-sm font-medium">
                                Connect <?php echo e($service->name); ?>

                            </button>
                        </form>
                    <?php elseif($userLink->status === 'challenge_sent'): ?>
                        <div class="bg-blue-50 border border-blue-200 rounded-lg p-3 mb-3">
                            <p class="text-sm text-blue-700 mb-2"><strong>Challenge Code:</strong> <code class="bg-white px-2 py-1 rounded font-mono"><?php echo e($userLink->challenge_code); ?></code></p>
                            <?php if($service->verification_mode === 'automated'): ?>
                                <p class="text-sm text-blue-600 mb-3">Post this code publicly on <?php echo e($service->name); ?>, then submit the URL of your post below.</p>
                                <form method="POST" action="<?php echo e(route('trust.proof', $userLink)); ?>" class="space-y-2">
                                    <?php echo csrf_field(); ?>
                                    <div>
                                        <?php if (isset($component)) { $__componentOriginale3da9d84bb64e4bc2eeebaafabfb2581 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginale3da9d84bb64e4bc2eeebaafabfb2581 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.input-label','data' => ['for' => 'proof_url_'.e($userLink->id).'','value' => 'URL of Your Post']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('input-label'); ?>
<?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(['for' => 'proof_url_'.e($userLink->id).'','value' => 'URL of Your Post']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginale3da9d84bb64e4bc2eeebaafabfb2581)): ?>
<?php $attributes = $__attributesOriginale3da9d84bb64e4bc2eeebaafabfb2581; ?>
<?php unset($__attributesOriginale3da9d84bb64e4bc2eeebaafabfb2581); ?>
<?php endif; ?>
<?php if (isset($__componentOriginale3da9d84bb64e4bc2eeebaafabfb2581)): ?>
<?php $component = $__componentOriginale3da9d84bb64e4bc2eeebaafabfb2581; ?>
<?php unset($__componentOriginale3da9d84bb64e4bc2eeebaafabfb2581); ?>
<?php endif; ?>
                                        <?php if (isset($component)) { $__componentOriginal18c21970322f9e5c938bc954620c12bb = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal18c21970322f9e5c938bc954620c12bb = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.text-input','data' => ['id' => 'proof_url_'.e($userLink->id).'','name' => 'remote_proof_url','type' => 'url','class' => 'w-full','required' => true]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('text-input'); ?>
<?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(['id' => 'proof_url_'.e($userLink->id).'','name' => 'remote_proof_url','type' => 'url','class' => 'w-full','required' => true]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal18c21970322f9e5c938bc954620c12bb)): ?>
<?php $attributes = $__attributesOriginal18c21970322f9e5c938bc954620c12bb; ?>
<?php unset($__attributesOriginal18c21970322f9e5c938bc954620c12bb); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal18c21970322f9e5c938bc954620c12bb)): ?>
<?php $component = $__componentOriginal18c21970322f9e5c938bc954620c12bb; ?>
<?php unset($__componentOriginal18c21970322f9e5c938bc954620c12bb); ?>
<?php endif; ?>
                                    </div>
                                    <button type="submit" class="inline-flex items-center px-3 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 text-sm font-medium">
                                        Submit Proof
                                    </button>
                                </form>
                            <?php else: ?>
                                <p class="text-sm text-blue-600">Send this code via private message to a support account on <?php echo e($service->name); ?>. An admin will verify within 48 hours.</p>
                            <?php endif; ?>
                        </div>
                        <button onclick="if(confirm('Disconnect from <?php echo e($service->name); ?>?')) document.getElementById('disconnect_<?php echo e($userLink->id); ?>').submit();" class="text-red-600 hover:text-red-700 text-sm font-medium">
                            Disconnect
                        </button>
                        <form id="disconnect_<?php echo e($userLink->id); ?>" method="POST" action="<?php echo e(route('admin.trust-links.destroy', $userLink)); ?>" style="display:none;">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('DELETE'); ?>
                        </form>
                    <?php elseif($userLink->status === 'submitted'): ?>
                        <div class="bg-yellow-50 border border-yellow-200 rounded-lg p-3">
                            <p class="text-sm text-yellow-700">Verification in progress. We'll notify you once verified.</p>
                        </div>
                    <?php elseif($userLink->status === 'verified'): ?>
                        <div class="bg-green-50 border border-green-200 rounded-lg p-3 flex items-center justify-between">
                            <span class="text-sm text-green-700">✓ Your <?php echo e($service->name); ?> account is verified!</span>
                            <a href="<?php echo e($userLink->remote_user_url); ?>" target="_blank" class="text-green-600 hover:text-green-700 text-sm font-medium">View Profile →</a>
                        </div>
                    <?php endif; ?>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        <?php endif; ?>
    </div>
</section>
<?php /**PATH /var/www/html/resources/views/profile/partials/verified-accounts-form.blade.php ENDPATH**/ ?>