<div class="gh-publish-title" data-test-publish-flow="confirm">
    <div class="green">Ready, set, publish.</div>
    <div>Share it with the world.</div>
</div>
<p class="gh-publish-confirmation" data-test-text="confirm-details">
    {{#if @publishOptions.isScheduled}}
        {{#let (moment-site-tz @publishOptions.scheduledAtUTC) as |scheduledAt|}}
            On
            <strong>
                {{moment-format scheduledAt "D MMM YYYY"}}
                at
                {{moment-format scheduledAt "HH:mm"}}
            </strong>
            your
        {{/let}}
    {{else}}
        Your
    {{/if}}

    {{@publishOptions.post.displayName}}

    {{#if this.willPublish}}
        will be published on your site{{#if this.willEmail}}, and delivered to{{else}}.{{/if}}
    {{/if}}

    {{#if this.willEmail}}
        {{#unless this.willPublish}}
            will be delivered to
        {{/unless}}

        {{#let (members-count-fetcher query=(hash filter=@publishOptions.fullRecipientFilter)) as |countFetcher|}}
            <strong>
                {{if (eq @recipientType "all") "all"}}

                {{format-number countFetcher.count}}

                {{!-- @recipientType = none/free/paid/all/specific --}}
                {{if (not-eq @recipientType "all") @recipientType}}
            </strong>

            {{#if @publishOptions.onlyDefaultNewsletter}}
                <strong>{{gh-pluralize countFetcher.count "subscriber" without-count=true}}</strong>{{#if this.willPublish}}.{{else}},{{/if}}
            {{else}}
                <strong>{{gh-pluralize countFetcher.count "subscriber" without-count=true}}</strong>
                of <strong>{{@publishOptions.newsletter.name}}</strong>{{#if this.willPublish}}.{{else}},{{/if}}
            {{/if}}
        {{/let}}

        {{#unless this.willPublish}}
            and will <strong>not</strong> be published on your site.
        {{/unless}}
    {{/if}}
</p>

{{#if this.errorMessage}}
    <p class="error gh-box gh-box-error mt3 mb3" data-test-confirm-error>
        {{this.errorMessage}}
    </p>
{{/if}}

<div class="gh-publish-cta">
    <GhTaskButton
        @task={{this.confirmTask}}
        @buttonText={{this.confirmButtonText}}
        @runningText={{this.confirmRunningText}}
        @successText={{this.confirmSuccessText}}
        @class="gh-btn gh-btn-large"
        @idleClass="gh-btn-pulse"
        @runningClass="gh-btn-green gh-btn-icon"
        @failureClass="gh-btn-red gh-btn-icon"
        data-test-button="confirm-publish"
    />
    <button type="button" class="gh-btn gh-btn-link gh-btn-large gh-publish-cta-secondary" {{on "click" @cancel}} data-test-button="back-to-options">Back to settings</button>
</div>