<?php

namespace Database\Seeders;

use App\Models\Ad;
use Illuminate\Database\Seeder;

class AdsterraSeeder extends Seeder
{
    public function run(): void
    {
        $ads = [
            [
                'name' => 'Adsterra Leaderboard 728x90',
                'description' => 'Banner leaderboard untuk header/footer desktop',
                'position' => 'banner_top',
                'size' => '728x90',
                'code' => '<script>
  atOptions = {
    \'key\' : \'033cd72ef7ff7c5598f007c99b955273\',
    \'format\' : \'iframe\',
    \'height\' : 90,
    \'width\' : 728,
    \'params\' : {}
  };
</script>
<script src="https://www.highperformanceformat.com/033cd72ef7ff7c5598f007c99b955273/invoke.js"></script>',
                'is_active' => true,
                'sort_order' => 0,
            ],
            [
                'name' => 'Adsterra Banner 468x60',
                'description' => 'Banner medium untuk bottom page atau in-article',
                'position' => 'banner_bottom',
                'size' => '468x60',
                'code' => '<script>
  atOptions = {
    \'key\' : \'4dad2a0130316db0ce1e77c493b4dced\',
    \'format\' : \'iframe\',
    \'height\' : 60,
    \'width\' : 468,
    \'params\' : {}
  };
</script>
<script src="https://www.highperformanceformat.com/4dad2a0130316db0ce1e77c493b4dced/invoke.js"></script>',
                'is_active' => true,
                'sort_order' => 0,
            ],
            [
                'name' => 'Adsterra Mobile Banner 320x50',
                'description' => 'Banner khusus perangkat mobile',
                'position' => 'mobile_banner',
                'size' => '320x50',
                'code' => '<script>
  atOptions = {
    \'key\' : \'2a6df7051069590d515d7af7b88de46a\',
    \'format\' : \'iframe\',
    \'height\' : 50,
    \'width\' : 320,
    \'params\' : {}
  };
</script>
<script src="https://www.highperformanceformat.com/2a6df7051069590d515d7af7b88de46a/invoke.js"></script>',
                'is_active' => true,
                'sort_order' => 0,
            ],
            [
                'name' => 'Adsterra Medium Rectangle 300x250',
                'description' => 'Native ad untuk sisipan di listing dan sidebar',
                'position' => 'native',
                'size' => '300x250',
                'code' => '<script>
  atOptions = {
    \'key\' : \'60fee2cdf54fa28e03c8e1c909cd40d1\',
    \'format\' : \'iframe\',
    \'height\' : 250,
    \'width\' : 300,
    \'params\' : {}
  };
</script>
<script src="https://www.highperformanceformat.com/60fee2cdf54fa28e03c8e1c909cd40d1/invoke.js"></script>',
                'is_active' => true,
                'sort_order' => 0,
            ],
            [
                'name' => 'Adsterra Sidebar 300x250',
                'description' => 'Sidebar ad untuk halaman detail',
                'position' => 'sidebar',
                'size' => '300x250',
                'code' => '<script>
  atOptions = {
    \'key\' : \'60fee2cdf54fa28e03c8e1c909cd40d1\',
    \'format\' : \'iframe\',
    \'height\' : 250,
    \'width\' : 300,
    \'params\' : {}
  };
</script>
<script src="https://www.highperformanceformat.com/60fee2cdf54fa28e03c8e1c909cd40d1/invoke.js"></script>',
                'is_active' => true,
                'sort_order' => 0,
            ],
            [
                'name' => 'Adsterra Wide Skyscraper 160x600',
                'description' => 'Sidebar tall ad untuk halaman detail',
                'position' => 'sidebar',
                'size' => '160x600',
                'code' => '<script>
  atOptions = {
    \'key\' : \'5e9e69d68f6023bd8d2451cc9f140b81\',
    \'format\' : \'iframe\',
    \'height\' : 600,
    \'width\' : 160,
    \'params\' : {}
  };
</script>
<script src="https://www.highperformanceformat.com/5e9e69d68f6023bd8d2451cc9f140b81/invoke.js"></script>',
                'is_active' => true,
                'sort_order' => 1,
            ],
            [
                'name' => 'Adsterra Half-Page 160x300',
                'description' => 'Sidebar medium ad',
                'position' => 'in_article',
                'size' => '160x300',
                'code' => '<script>
  atOptions = {
    \'key\' : \'182dace8769c8001cd348ff06543e6a4\',
    \'format\' : \'iframe\',
    \'height\' : 300,
    \'width\' : 160,
    \'params\' : {}
  };
</script>
<script src="https://www.highperformanceformat.com/182dace8769c8001cd348ff06543e6a4/invoke.js"></script>',
                'is_active' => true,
                'sort_order' => 0,
            ],
            [
                'name' => 'Adsterra Countdown 300x250',
                'description' => 'Ad untuk halaman countdown sebelum apply',
                'position' => 'countdown',
                'size' => '300x250',
                'code' => '<script>
  atOptions = {
    \'key\' : \'60fee2cdf54fa28e03c8e1c909cd40d1\',
    \'format\' : \'iframe\',
    \'height\' : 250,
    \'width\' : 300,
    \'params\' : {}
  };
</script>
<script src="https://www.highperformanceformat.com/60fee2cdf54fa28e03c8e1c909cd40d1/invoke.js"></script>',
                'is_active' => true,
                'sort_order' => 0,
            ],
            [
                'name' => 'Adsterra Interstitial 468x60',
                'description' => 'Ad interstitial di halaman countdown',
                'position' => 'interstitial',
                'size' => '468x60',
                'code' => '<script>
  atOptions = {
    \'key\' : \'4dad2a0130316db0ce1e77c493b4dced\',
    \'format\' : \'iframe\',
    \'height\' : 60,
    \'width\' : 468,
    \'params\' : {}
  };
</script>
<script src="https://www.highperformanceformat.com/4dad2a0130316db0ce1e77c493b4dced/invoke.js"></script>',
                'is_active' => true,
                'sort_order' => 1,
            ],
            [
                'name' => 'Social Bar Adsterra',
                'description' => 'Script Social Bar floating yang tampil di semua halaman publik',
                'position' => 'social_bar',
                'size' => null,
                'code' => '<script src="https://ballisticcomainvitation.com/1c/fe/a4/1cfea4f9748e174002c79ae951f55b09.js"></script>',
                'is_active' => true,
                'sort_order' => 0,
            ],
        ];

        // Clear existing ads
        Ad::truncate();

        foreach ($ads as $ad) {
            Ad::create($ad);
        }
    }
}
