<?php
if (!is_child_theme()) {
    $theme = wp_get_theme();
} else {
    $theme = wp_get_theme()->parent();
}
$party_corp_link_icon = '<span class="svg-external-link"><i class="dashicons dashicons-arrow-right-alt"></i></span>';

$party_corp_admin_ur = admin_url();
function import_button_html() {

    $party_corp_btn_texts = __('View Starter Templates', 'party-corp');
    $party_corp_button_url = '#'; // Replace with actual starter templates URL if needed

    $party_corp_html = '<a class="btn-get-started" href="' . esc_url($party_corp_button_url) . '"
        aria-label="' . esc_attr($party_corp_btn_texts) . '">' .
        esc_html($party_corp_btn_texts) .
        '</a>';

    return $party_corp_html;
}

?>
    <div class="party-corp-dashboard-content">
        <div class="dashboard-content-panel content-panel-upper">
            <div class="postbox">
                <div class="inside party-corp-dashboard-welcome">
                    <div class="party-corp-notice-left">
                        <h2 class="party-corp-notice-heading">
                            <?php
                            printf(
                                esc_html__('Build Your Site with Party Corp!', 'party-corp')
                            );
                            ?>
                        </h2>
                        <p><?php esc_html_e('Easily build your website using blocks and explore all the settings and features in one place.', 'party-corp'); ?></p>
                        <div class="dashboard-button-group">
                            <?php if (!$this->party_corp_pro_status) { ?>
                                <a href="<?php echo esc_url($this->party_corp_pro_theme_url); ?>"
                                   class="button button-secondary dashboard-button dashboard-button-primary"
                                   target="_blank">
                                    <?php esc_html_e('Go Pro', 'party-corp'); ?>
                                </a>
                            <?php } ?>
                            <a href="<?php echo esc_url($this->party_corp_preview_url); ?>"
                               class="button button-secondary dashboard-button dashboard-button-secondary"
                               target="_blank">
                                <?php esc_html_e('View Demo', 'party-corp'); ?>
                            </a>
                            <a href="<?php echo esc_url($this->party_corp_bundle_url); ?>"
                               class="button button-secondary dashboard-button dashboard-button-primary"
                               target="_blank">
                                <?php esc_html_e('Get the Bundle', 'party-corp'); ?>
                            </a>
                        </div>
                    </div>
                    <div class="party-corp-notice-right">
                        <div class="party-corp-intro-image">
                            <img src="<?php echo esc_url(get_template_directory_uri()); ?>/screenshot.png" alt="Party Corp WordPress Theme">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="dashboard-content-panel content-panel-lower">
            <div class="dashboard-content-left">
                <div class="postbox party-corp-premium-settings">
                    <div class="postbox-header">
                        <h2 class="hndle ui-sortable-handle"><?php esc_html_e('Premium Features', 'party-corp'); ?></h2>
                        <?php if (!$this->party_corp_pro_status) { ?>
                            <a href="<?php echo esc_url($this->party_corp_pro_theme_url); ?>"
                               class="hndle-controller party-corp-link" target="_blank">
                                <?php echo 'Upgrade Now' . $party_corp_link_icon; ?>
                            </a>
                        <?php } ?>
                    </div>
                    <div class="pro-discount-content">
                        <p class="pro-discount-text">
                           <?php echo esc_html__('Upgrade To Premium Just at ', 'party-corp');  ?> <span class="discount-price"><?php echo esc_html__('$69 ', 'party-corp');  ?></span><span><?php echo esc_html__('$45 ', 'party-corp');  ?></span>
                        </p>
                    </div>
                    <div class="dashboard-button-group features-bottom-btn">
                        <?php if (!$this->party_corp_pro_status) { ?>
                            <a href="<?php echo esc_url($this->party_corp_pro_theme_url); ?>"
                            class="button button-secondary dashboard-button dashboard-button-secondary"
                            target="_blank">
                                <?php esc_html_e('Go Pro', 'party-corp'); ?>
                            </a>
                        <?php } ?>
                        <a href="<?php echo esc_url($this->party_corp_preview_url); ?>"
                        class="button button-secondary dashboard-button dashboard-button-secondary"
                        target="_blank">
                            <?php esc_html_e('View Demo', 'party-corp'); ?>
                        </a>
                        <a href="<?php echo esc_url($this->party_corp_pro_doc_url); ?>"
                        class="button button-secondary dashboard-button dashboard-button-secondary"
                        target="_blank">
                            <?php esc_html_e('Premium Documentation', 'party-corp'); ?>
                        </a>
                    </div>
                    <div class="pro-distails-content">
                        <p class="pro-distails-text">
                           <?php echo esc_html__('Limited Time Offer - Get 20% OFF on Premium Party Corp WordPress Themes | Use Code "FLAT20OFF"', 'party-corp'); ?>
                        </p>
                    </div>
                    <div class="inside party-corp-unavailable-settings">
                        <?php
                        // Array of premium features items
                        $party_corp_premium_features = array(
                            array(
                                'title' => esc_html__('Advanced Typography Controls', 'party-corp'),
                            ),
                            array(
                                'title' => esc_html__('Extended Color Settings', 'party-corp'),
                            ),
                            array(
                                'title' => esc_html__('Enhanced WooCommerce Features', 'party-corp'),
                            ),
                            array(
                                'title' => esc_html__('Optimized Performance & Speed', 'party-corp'),
                            ),
                            array(
                                'title' => esc_html__('Dedicated Priority Support', 'party-corp'),
                            ),
                            array(
                                'title' => esc_html__('Social Sharing Integration', 'party-corp'),
                            ),
                        );
                        // Loop through the premium features items
                        foreach ($party_corp_premium_features as $party_corp_item) {
                            ?>
                            <div class="party-corp-features-list party-corp-premium-features">
                                <div class="item-content-left">
                                    <h4><?php echo esc_html($party_corp_item['title']); ?></h4>
                                </div>
                                <div class="item-content-right">
                                    <img class="party-corp-premium-badge"
                                         src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/images/pro-img.png'); ?>"
                                         alt="<?php esc_attr_e('Party Corp', 'party-corp'); ?>">
                                </div>
                            </div>
                            <?php
                        }
                        ?>
                    </div>
                </div>
                <div class="postbox party-corp-quick-settings">
                    <div class="postbox-header">
                        <h2 class="hndle ui-sortable-handle"><?php esc_html_e('Quick Settings', 'party-corp'); ?></h2>
                        <a href="<?php echo esc_url(' ' . $party_corp_admin_ur . 'site-editor.php'); ?>"
                           class="hndle-controller party-corp-link" target="_blank">
                            <?php echo 'Visit Editor' . $party_corp_link_icon; ?>
                        </a>
                    </div>
                    <div class="inside party-corp-available-settings">
                        <?php
                        $party_corp_current_theme = wp_get_theme();
                        $theme_slug    = $party_corp_current_theme->get('TextDomain');

                        // Array of settings items (now mapped for Site Editor)
                        $party_corp_settings_items = array(
                            array(
                                'title' => esc_html__('Site Identity', 'party-corp'),
                                'url'   => admin_url('customize.php?autofocus[section]=title_tagline'),
                            ),
                            array(
                                'title' => esc_html__('Header Options', 'party-corp'),
                                'url'   => admin_url('site-editor.php?path=%2Fpatterns&postType=wp_template_part&categoryId=header'),
                            ),
                            array(
                                'title' => esc_html__('Footer Options', 'party-corp'),
                                'url'   => admin_url('site-editor.php?path=%2Fpatterns&postType=wp_template_part&categoryId=footer'),
                            ),
                            array(
                                'title' => esc_html__('Archive Template', 'party-corp'),
                                'url'   => admin_url('site-editor.php?p=%2Fwp_template%2F' . $theme_slug . '%2F%2Farchive&canvas=edit'),
                            ),
                            array(
                                'title' => esc_html__('Single Template', 'party-corp'),
                                'url'   => admin_url('site-editor.php?p=%2Fwp_template%2F' . $theme_slug . '%2F%2Fsingle-post-sidebar-on-right&canvas=edit'),
                            ),
                            array(
                                'title' => esc_html__('Page Template', 'party-corp'),
                                'url'   => admin_url('site-editor.php?p=%2Fwp_template%2F' . $theme_slug . '%2F%2Fpage&canvas=edit'),
                            ),
                            array(
                                'title' => esc_html__('404 Template', 'party-corp'),
                                'url'   => admin_url('site-editor.php?p=%2Fwp_template%2F' . $theme_slug . '%2F%2F404&canvas=edit'),
                            ),
                        );

                        // Loop
                        foreach ($party_corp_settings_items as $party_corp_item) {
                            ?>
                            <a href="<?php echo esc_url($party_corp_item['url']); ?>" class="theme-editor-card" target="_blank">
                                <h4><?php echo esc_html($party_corp_item['title']); ?></h4>
                                <span><?php echo esc_html__('Start Edit', 'party-corp'); ?></span>
                                <i class="dashicons dashicons-arrow-right-alt"></i>
                            </a>
                            <?php
                        }
                        ?>
                    </div>
                </div>
            </div>
            <div class="dashboard-content-right">
                <div class="postbox party-corp-bundle-box">
                    <div class="postbox-header">
                        <div class="head-img">
                            <img class="party-corp-premium-badge"
                                    src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/images/pro-img.png'); ?>"
                                    alt="<?php esc_attr_e('Party Corp', 'party-corp'); ?>">
                        </div>
                        <div class="head-content">
                            <h3 class="hndle ui-sortable-handle">
                                <?php esc_html_e('Best Value - Get More, Save More!', 'party-corp'); ?>
                            </h3>
                            <p><?php esc_html_e('Unlock all our premium themes with exclusive discount.', 'party-corp'); ?></p>
                        </div>
                    </div>
                    <div class="inside">
                        <div class="item-content-left">
                            <img class="party-corp-bundle-badge"
                                    src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/images/bundle-image.png'); ?>"
                                    alt="<?php esc_attr_e('Party Corp', 'party-corp'); ?>">
                        </div>
                        <div class="item-content-right">
                            <ul>
                                <li>
                                    <img class="list-check" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/images/circle-check.png'); ?>" alt="<?php esc_attr_e('Party Corp', 'party-corp'); ?>">
                                    <?php echo esc_html__('All Premium Themes', 'party-corp'); ?>
                                </li>
                                <li>
                                    <img class="list-check" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/images/circle-check.png'); ?>" alt="<?php esc_attr_e('Party Corp', 'party-corp'); ?>">
                                    <?php echo esc_html__('One Year of Updates', 'party-corp'); ?>
                                </li>
                                <li>
                                    <img class="list-check" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/images/circle-check.png'); ?>" alt="<?php esc_attr_e('Party Corp', 'party-corp'); ?>">
                                    <?php echo esc_html__('Premium Support', 'party-corp'); ?>
                                </li>
                                <li>
                                    <img class="list-check" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/images/circle-check.png'); ?>" alt="<?php esc_attr_e('Party Corp', 'party-corp'); ?>">
                                    <?php echo esc_html__('Lifetime Domain Usage', 'party-corp'); ?>
                                </li>
                                <li>
                                    <img class="list-check" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/images/circle-check.png'); ?>" alt="<?php esc_attr_e('Party Corp', 'party-corp'); ?>">
                                    <?php echo esc_html__('Future Themes Included', 'party-corp'); ?>
                                </li>
                                <li>
                                    <img class="list-check" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/images/circle-check.png'); ?>" alt="<?php esc_attr_e('Party Corp', 'party-corp'); ?>">
                                    <?php echo esc_html__('Exclusive Bundle Discount', 'party-corp'); ?>
                                </li>
                            </ul>
                            <div class="save-box">
                                <p class="special-text"><?php echo esc_html__('Special Price', 'party-corp'); ?></p>
                                <p class="save-text"><?php echo esc_html__('Save 20%', 'party-corp'); ?></p>
                            </div>
                            <div class="price-box">
                                <p class="sale-text"><?php echo esc_html__('$79', 'party-corp'); ?></p>
                                <p class="regular-text"><?php echo esc_html__('$279', 'party-corp'); ?></p>
                            </div>
                            <a href="<?php echo esc_url($this->party_corp_bundle_url); ?>"
                            target="_blank" class="bundle-btn"><?php esc_html_e('Explore Bundles   ', 'party-corp'); ?></a>
                        </div>
                    </div>
                </div>
                
                <div class="postbox party-corp-postbox-documentation">
                    <div class="postbox-header">
                        <h3 class="hndle ui-sortable-handle">
                            <?php esc_html_e('User Guide', 'party-corp'); ?>
                        </h3>
                        <div class="hndle-controller">
                            <svg xmlns="http://www.w3.org/2000/svg" width="21" height="20" viewBox="0 0 21 20"
                                 fill="none">
                                <path d="M12.584 1.66602H5.50065C5.05862 1.66602 4.6347 1.84161 4.32214 2.15417C4.00958 2.46673 3.83398 2.89065 3.83398 3.33268V16.666C3.83398 17.108 4.00958 17.532 4.32214 17.8445C4.6347 18.1571 5.05862 18.3327 5.50065 18.3327H15.5006C15.9427 18.3327 16.3666 18.1571 16.6792 17.8445C16.9917 17.532 17.1673 17.108 17.1673 16.666V6.24935L12.584 1.66602Z"
                                      stroke="#2563EB" stroke-width="1.5" stroke-linecap="round"
                                      stroke-linejoin="round"/>
                                <path d="M12.166 1.66602V6.66602H17.166" stroke="#2563EB" stroke-width="1.5"
                                      stroke-linecap="round" stroke-linejoin="round"/>
                                <path d="M13.8327 10.833H7.16602" stroke="#2563EB" stroke-width="1.5"
                                      stroke-linecap="round" stroke-linejoin="round"/>
                                <path d="M13.8327 14.166H7.16602" stroke="#2563EB" stroke-width="1.5"
                                      stroke-linecap="round" stroke-linejoin="round"/>
                                <path d="M8.83268 7.5H7.16602" stroke="#2563EB" stroke-width="1.5"
                                      stroke-linecap="round" stroke-linejoin="round"/>
                            </svg>
                        </div>
                    </div>
                    <div class="inside">
                        <p>
                            <?php
                            echo esc_html__('Having an issue? Check our documentation for clear steps and help with using blocks and settings.', 'party-corp');
                            ?>
                        </p>
                        <a href="<?php echo esc_url($this->party_corp_doc_url); ?>"
                           target="_blank"><?php esc_html_e('User Guide', 'party-corp'); ?></a>
                    </div>
                </div>

                <div class="postbox party-corp-postbox-support">
                    <div class="postbox-header">
                        <h3 class="hndle ui-sortable-handle">
                            <?php esc_html_e('Support', 'party-corp'); ?>
                        </h3>
                        <div class="hndle-controller">
                            <svg xmlns="http://www.w3.org/2000/svg" width="21" height="20" viewBox="0 0 21 20"
                                 fill="none">
                                <path d="M3 11.6667H5.5C5.94203 11.6667 6.36595 11.8423 6.67851 12.1548C6.99107 12.4674 7.16667 12.8913 7.16667 13.3333V15.8333C7.16667 16.2754 6.99107 16.6993 6.67851 17.0118C6.36595 17.3244 5.94203 17.5 5.5 17.5H4.66667C4.22464 17.5 3.80072 17.3244 3.48816 17.0118C3.17559 16.6993 3 16.2754 3 15.8333V10C3 8.01088 3.79018 6.10322 5.1967 4.6967C6.60322 3.29018 8.51088 2.5 10.5 2.5C12.4891 2.5 14.3968 3.29018 15.8033 4.6967C17.2098 6.10322 18 8.01088 18 10V15.8333C18 16.2754 17.8244 16.6993 17.5118 17.0118C17.1993 17.3244 16.7754 17.5 16.3333 17.5H15.5C15.058 17.5 14.634 17.3244 14.3215 17.0118C14.0089 16.6993 13.8333 16.2754 13.8333 15.8333V13.3333C13.8333 12.8913 14.0089 12.4674 14.3215 12.1548C14.634 11.8423 15.058 11.6667 15.5 11.6667H18"
                                      stroke="#2563EB" stroke-width="1.66667" stroke-linecap="round"
                                      stroke-linejoin="round"/>
                            </svg>
                        </div>
                    </div>
                    <div class="inside">
                        <p>
                            <?php
                            echo sprintf(
                            /* translators: %s: Theme Name */
                                esc_html__(
                                    'Need help? Visit the WordPress.org support forum where the community is ready to assist you. While we focus on premium support for Pro users, we’re happy to help with basic questions about the free theme.',
                                    'party-corp'
                                )
                            );
                            ?>
                        </p>
                        <a href="<?php echo esc_url($this->party_corp_community_url); ?>" target="_blank">
                            <?php esc_html_e('Get Help', 'party-corp'); ?>
                        </a>
                    </div>
                </div>

                <div class="postbox party-corp-postbox-review">
                    <div class="postbox-header">
                        <h3 class="hndle ui-sortable-handle">
                            <?php esc_html_e('Leave us a Review', 'party-corp'); ?>
                        </h3>
                        <div class="hndle-controller">
                            <svg xmlns="http://www.w3.org/2000/svg" width="21" height="20" viewBox="0 0 21 20"
                                 fill="none">
                                <path d="M10.5001 1.66699L13.0751 6.88366L18.8334 7.72533L14.6667 11.7837L15.6501 17.517L10.5001 14.8087L5.35008 17.517L6.33341 11.7837L2.16675 7.72533L7.92508 6.88366L10.5001 1.66699Z"
                                      stroke="#2563EB" stroke-width="1.66667" stroke-linecap="round"
                                      stroke-linejoin="round"/>
                            </svg>
                        </div>
                    </div>
                    <div class="inside">
                        <p>
                            <?php
                            echo sprintf(
                            /* translators: %s: Theme Name. */
                                esc_html__('How was your experience with our theme? Did it meet your expectations? Share your feedback to help us improve.', 'party-corp'),
                                $theme->Name
                            );
                            ?>
                        </p>
                        <a href="<?php echo esc_url('https://WordPress.org/support/theme/party-corp/reviews/?rate=5#new-post'); ?>"
                           target="_blank"><?php esc_html_e('Submit a Review', 'party-corp'); ?></a>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php
