{% extends "_layouts/cp" %}

{% set title = 'Plugin Store'|t('app') %}

{% do view.registerTranslations('app', [
    "Active installs",
    "Active Trials",
    "Add all to cart",
    "Add to cart",
    "Added to cart",
    "Address Line 1",
    "Address Line 2",
    "Already in your cart",
    "Ascending",
    "Back",
    "Billing",
    "Business Name",
    "Business Tax ID",
    "Buy later",
    "Buy now for {price}",
    "Buy now",
    "Card number",
    "Cart",
    "Categories",
    "Changelog",
    "Checkout",
    "City",
    "Cloud Storage Integration",
    "Community Support (Slack, Stack Exchange)",
    "Compatibility",
    "Connect to your Craft ID",
    "Contact",
    "Content Modeling",
    "Continue as guest",
    "Continue",
    "Copy the package’s name for this plugin.",
    "Coupon Code",
    "CVC",
    "Descending",
    "Description",
    "Developer Support",
    "Documentation",
    "Features",
    "First Name",
    "For when you’re building a website for yourself or a friend.",
    "For when you’re building something professionally for a client or team.",
    "Free",
    "Includes Custom login screen logo, Custom site icon, Custom HTML email template, Custom email message wording",
    "Includes Multiple locales, Section and entry locale targeting, Content translations",
    "Includes Sections, Global sets, Category groups, Tag groups, Asset volumes, Custom fields, Entry versioning, and Entry drafts",
    "Includes User accounts, User groups, User permissions, Public user registration",
    "Information",
    "Install",
    "Installed as a trial",
    "Installed",
    "Item",
    "Items in your cart",
    "Last Name",
    "Last update",
    "Last Update",
    "Less",
    "License",
    "Licensed",
    "Loading Plugin Store…",
    "Manage plugins",
    "MM / YY",
    "More",
    "Multi-site Multi-lingual",
    "Name",
    "Package Name",
    "Page not found.",
    "Pay",
    "Payment Method",
    "Payment",
    "Plugin Name",
    "Plugin Store",
    "Popularity",
    "Price includes 1 year of updates.",
    "Price",
    "Pro Rate Discount",
    "Reactivate",
    "Remove",
    "Renewal price",
    "Report an issue",
    "Save as my new credit card",
    "Screenshots",
    "Search plugins",
    "Security & Bug Fixes",
    "See all",
    "Showing results for “{searchQuery}”",
    "Staff Picks",
    "Subtotal",
    "Support",
    "System Branding",
    "Thank You!",
    "The Plugin Store is not available, please try again later.",
    "Total Price",
    "Total",
    "Try for free",
    "Try",
    "Try",
    "Updates until {date} ({sign}{price})",
    "Updates until {date}",
    "Updates",
    "Upgrade Craft CMS",
    "Use a new credit card",
    "Use card {cardDetails}",
    "Use your Craft ID",
    "User Accounts",
    "Version {version}",
    "Version",
    "Website",
    "Your order has been processed successfully.",
    "Zip Code",
    "{price} plus {renewalPrice}/year for updates",
    "{price}/year",
    "{renewalPrice}/year per site for updates after that.",
    "Your are currently using the {currentEdition} edition, and your licensed edition is {licensedEdition}.",
    "This license is tied to another Craft install. Purchase a license for this install.",
    "Your license key is invalid.",
    "Critical",
    "Couldn’t add all items to the cart.",
]) %}

{% block actionButton %}
    <div id="pluginstore-actions-spinner" class="spinner lg hidden"></div>

    <div id="pluginstore-actions" class="hidden">

        <a id="cart-button" role="button" tabindex="0">{{ svg('@app/icons/shopping-cart.svg', namespace=true) }} <span class="badge">0</span></a>

        <a id="craftid-account" class="menubtn hidden"><span class="photo">{{ svg('@app/icons/craftid.svg', namespace=true) }}</span><span class="label">Account</span></a>

        <div class="menu">
            <ul>
                <li><a href="{{ craft.cp.craftIdAccountUrl() }}" rel="noopener" target="_blank">{{ "Manage your Craft ID"|t('app') }}</a></li>
                <li>
                    <form method="post" id="disconnect">
                        {{ csrfInput() }}
                        <input type="hidden" name="action" value="plugin-store/disconnect">
                        <a onclick="document.getElementById('disconnect').submit();">{{ "Sign out from Craft ID"|t('app') }}</a>
                    </form>
                </li>
            </ul>
        </div>

        <form id="craftid-connect-form" method="post">
            {{ csrfInput() }}
            <input type="hidden" name="action" value="plugin-store/connect">
            <div class="ssl-status light" title="{{ craft.app.request.isSecureConnection ? "Your connection is secure"|t('app') : "Your connection is insecure"|t('app') }}">
                <i class="{{ craft.app.request.isSecureConnection ? "secure" : "insecure" }} icon"></i>
            </div>
            <a onclick="document.getElementById('craftid-connect-form').submit();">{{ 'Sign into Craft ID'|t('app') }}</a>
        </form>
    </div>
{% endblock %}

{% set content %}
    <div id="app"></div>
{% endset %}
