jQuery(document).ready(function ($) {

    setTimeout(function () {

        // CUSTOMIZER SIDEBAR
        var sidebar = $('#customize-theme-controls');

        // PREVENT DUPLICATE
        if ($('.the-corporate-business-wrapper').length) {
            return;
        }

     var html = $(`

    <div class="the-corporate-business-pro-wrapper">

         <div class="the-corporate-business-pro-heading">

                <span class="the-corporate-business-title">
                    The Corporate Business
                </span>

                 <!-- GO PRO BUTTON -->
        <a class="button the-corporate-business-pro-btn"
           href="https://www.webnotick.com/products/corporate-website-wordpress-theme"
           target="_blank">

            Go Pro

        </a>

            </div>
   

        <!-- DISCOUNT BOX -->
        <div id="customizer-discount-box">

            <div class="discount-box">

                <h3>Get Special Discount</h3>

                <p>Copy Code & Save 20% OFF!</p>

                <span class="coupon-code">
                        SAVE20NOW
                    </span>


            </div>

            <!-- SECOND BOX -->
<div class="discount-box discount-box2">
    <h3>Our New Features</h3>
   <div class="feature-box">

    <h2 class="feature-title">
        2 Homepage Layouts
    </h2>

</div>

<div class="feature-box">

    <h2 class="feature-title">
        Drag & Drop Sections
    </h2>

</div>

<div class="feature-box">

    <h2 class="feature-title">
        Unlimited Color Options
    </h2>

</div>
<div class="feature-box">

    <h2 class="feature-title">
       Sections Enable / Disable Options
    </h2>

</div>

</div>
<div class="feature-button">
<a href="https://www.webnotickdemo.com/the-corporate-business" target="_blank"
                    class="button button-primary button-hero">
                    View Demo
                </a>
</div>


        </div>

    </div>

`);

      $('.customize-pane-parent').append(html);
    }, 1000);

});


// COPY COUPON
jQuery(document).on('click', '.coupon-code', function () {

    let btn = jQuery(this);

    let text = btn.text().trim();

    navigator.clipboard.writeText(text).then(function () {

        btn.text('Copied!');

        setTimeout(function () {

            btn.text(text);

        }, 1000);

    });

});