<% extends 'layout.html' %>

<% block content %>
<% include('shared_config.html') %>
  <div id="segments_container"></div>

  <script type="text/javascript">
    var mailpoet_listing_per_page = <%= items_per_page %>;
    var mailpoet_beacon_articles = [
      '5d667fc22c7d3a7a4d77c426',
      '57f47ca3c697914f21035256',
      '5d4beee42c7d3a330e3c4207',
      '5e187a3a2c7d3a7e9ae607ff',
      '57ce079f903360649f6e56fc',
      '5d722c7104286364bc8ecf19',
      '5a574bd92c7d3a194368233e',
      '59a89621042863033a1c82e6'
    ];
    var mailpoet_mss_active = <%= json_encode(mss_active) %>;
    var mailpoet_subscribers_limit = <%= subscribers_limit ? subscribers_limit : 'false'  %>;
    var mailpoet_subscribers_limit_reached = <%= subscribers_limit_reached ? 'true' : 'false' %>;
    var mailpoet_has_valid_api_key = <%= has_valid_api_key ? 'true' : 'false' %>;
    var mailpoet_has_valid_premium_key = <%= has_valid_premium_key ? 'true' : 'false' %>;
    var mailpoet_mss_key_invalid = <%= mss_key_invalid ? 'true' : 'false' %>;
    var mailpoet_subscribers_count = <%= subscriber_count %>;
    var mailpoet_custom_fields = <%= json_encode(custom_fields) %>;
    var mailpoet_static_segments_list = <%= json_encode(static_segments_list) %>;
    var mailpoet_tags = <%= json_encode(tags) %>;
    var mailpoet_has_premium_support = <%= has_premium_support ? 'true' : 'false' %>;
    var mailpoet_premium_link = <%= json_encode(link_premium) %>;
    var wordpress_editable_roles_list = <%= json_encode(wordpress_editable_roles_list)  %>;
    var mailpoet_newsletters_list = <%= json_encode(newsletters_list)  %>;
    var mailpoet_product_categories = <%= json_encode(product_categories)  %>;
    var mailpoet_products = <%= json_encode(products) %>;
    var mailpoet_membership_plans = <%= json_encode(membership_plans) %>;
    var mailpoet_subscription_products = <%= json_encode(subscription_products) %>;
    var is_woocommerce_active = <%= json_encode(is_woocommerce_active)  %>;
    var mailpoet_can_use_woocommerce_memberships = <%= json_encode(can_use_woocommerce_memberships)  %>;
    var mailpoet_can_use_woocommerce_subscriptions = <%= json_encode(can_use_woocommerce_subscriptions)  %>;
    var mailpoet_woocommerce_currency_symbol = <%= json_encode(woocommerce_currency_symbol)  %>;
    var mailpoet_woocommerce_countries = <%= json_encode(woocommerce_countries)  %>;
    var mailpoet_tracking_config = <%= json_encode(tracking_config) %>;
    var mailpoet_subscribers_counts_cache_created_at = <%= json_encode(subscribers_counts_cache_created_at) %>;
    var mailpoet_premium_active = <%= json_encode(premium_plugin_active) %>;
    var mailpoet_current_wp_user_email = '<%= current_wp_user_email %>';
  </script>
<% endblock %>

<% block translations %>
  <%= localize({
    'pageTitle': __('Lists'),
    'searchLabel': __('Search'),
    'loadingItems': __('Loading lists...'),
    'noItemsFound': __('No lists found'),
    'selectAllLabel': __('All lists on this page are selected.'),
    'selectedAllLabel': __('All %d lists are selected.'),
    'selectAllLink': __('Select all lists on all pages'),
    'clearSelection': __('Clear selection'),
    'permanentlyDeleted': __('%d lists were permanently deleted.'),
    'selectBulkAction': __('Select bulk action'),
    'bulkActions': __('Bulk Actions'),
    'apply': __('Apply'),
    'name': __('Name'),
    'description': __('Description'),
    'segmentUpdated': __('List successfully updated!'),
    'segmentAdded': __('List successfully added!'),
    'segment': __('List'),
    'subscribed': __('Subscribed'),
    'unconfirmed': __('Unconfirmed'),
    'unsubscribed': __('Unsubscribed'),
    'inactive': __('Inactive'),
    'bounced': __('Bounced'),
    'createdOn': __('Created on'),
    'oneSegmentTrashed': __('1 list was moved to the trash. Note that deleting a list does not delete its subscribers.'),
    'multipleSegmentsTrashed': __('%1$d lists were moved to the trash. Note that deleting a list does not delete its subscribers.'),
    'oneSegmentDeleted': __('1 list was permanently deleted. Note that deleting a list does not delete its subscribers.'),
    'multipleSegmentsDeleted': __('%1$d lists were permanently deleted. Note that deleting a list does not delete its subscribers.'),
    'oneSegmentRestored': __('1 list has been restored from the Trash.'),
    'multipleSegmentsRestored': __('%1$d lists have been restored from the Trash.'),
    'duplicate': __('Duplicate'),
    'listDuplicated': __('List "%1$s" has been duplicated.'),
    'update': __('Update'),
    'forceSync': __('Force Sync'),
    'readMore': __('Read More'),
    'listSynchronized': __('List "%1$s" has been synchronized.'),
    'listSynchronizationWasScheduled': __('Synchronization of the "%1$s" list started. It can take several minutes to finish.'),
    'viewSubscribers': __('View Subscribers'),
    'new': __('New List'),
    'newSegment': __('New Segment'),
    'edit': __('Edit'),
    'trash': __('Trash'),
    'moveToTrash': __('Move to trash'),
    'emptyTrash': __('Empty Trash'),
    'selectAll': __('Select All'),
    'restore': __('Restore'),
    'deletePermanently': __('Delete permanently'),
    'save': __('Save'),
    'trashAndDisable': __('Trash and disable'),
    'restoreAndEnable': __('Restore and enable'),
    'listScore': __('List score'),

    'previousPage': __('Previous page'),
    'firstPage': __('First page'),
    'nextPage': __('Next page'),
    'lastPage': __('Last page'),
    'currentPage': __('Current page'),
    'pageOutOf': __('of'),
    'numberOfItemsSingular': __('1 item'),
    'numberOfItemsMultiple': __('%1$d items'),

    'segmentDescriptionTip': __('This text box is for your own use and is never shown to your subscribers.'),
    'backToList': __('Back'),

    'subscribersInPlanCount': _x('%1$d / %2$d', 'count / total subscribers'),
    'subscribersInPlan': _x('%s subscribers in your plan', 'number of subscribers in a sending plan'),
    'subscribersInPlanTooltip': __('This is the total of subscribed, unconfirmed and inactive subscribers we count when you are sending with MailPoet Sending Service. The count excludes unsubscribed and bounced (invalid) email addresses.'),

    'mailpoetSubscribers': _x('%s MailPoet subscribers', 'number of subscribers in the plugin'),
    'mailpoetSubscribersTooltipFree': __('This is the total of all subscribers including %1$d WordPress users. To exclude WordPress users, please purchase one of our premium plans.'),
    'mailpoetSubscribersTooltipPremium': __('This is the total of all subscribers excluding all WordPress users.'),

    'pageTitleSegments': __('Segments'),
    'formPageTitle': __('Segment'),
    'formSegmentTitle': __('Segment'),
    'descriptionTip': __('This text box is for your own use and is never shown to your subscribers.'),
    'dynamicSegmentUpdated': __('Segment successfully updated!'),
    'dynamicSegmentAdded': __('Segment successfully added!'),
    'segmentType': __('Type'),
    'wpUserRole': __('Subscriber'),
    'email': __('Email'),
    'nameColumn': __('Name'),
    'subscribersCountColumn': __('Number of subscribers'),
    'updatedAtColumn': __('Modified on'),
    'missingPluginMessageColumn': __('Missing plugin message'),
    'loadingDynamicSegmentItems': __('Loading data…'),
    'noDynamicSegmentItemsFound': __('No segments found'),
    'numberOfItemsSingular': __('1 item'),
    'numberOfItemsMultiple': __('%1$d items'),
    'previousPage': __('Previous page'),
    'firstPage': __('First page'),
    'nextPage': __('Next page'),
    'lastPage': __('Last page'),
    'currentPage': __('Current page'),
    'pageOutOf': _x('of', 'Page X of Y'),
    'notSentYet': __('Not sent yet'),
    'allLinksPlaceholder': __('All links'),
    'noLinksHint': __('Email not sent yet!'),
    'selectNewsletterPlaceholder': __('Search emails'),
    'selectActionPlaceholder': __('Select action'),
    'selectUserRolePlaceholder': __('Search user roles'),
    'selectCustomFieldPlaceholder': __('Select custom field'),
    'emailActionOpened': _x('opened', 'Dynamic segment creation: when newsletter was opened'),
    'emailActionMachineOpened': _x('machine-opened', 'Dynamic segment creation: list of all subscribers that opened the newsletter automatically in the background'),
    'emailActionOpensAbsoluteCount': __('# of opens'),
    'emailActionMachineOpensAbsoluteCount': __('# of machine-opens'),
    'emailActionOpens': __('opens'),
    'emailActionDays': __('days'),
    'emailActionOpensSentence': _x('{condition} {opens} opens', 'The result will be "more than 20 opens"'),
    'emailActionOpensDaysSentence': _x('in the last {days} days', 'The result will be "in the last 5 days"'),
    'moreThan': __('more than'),
    'lessThan': __('less than'),
    'higherThan': __('higher than'),
    'lowerThan': __('lower than'),
    'equals': __('equals'),
    'notEquals': __('not equals'),
    'contains': __('contains'),
    'value': __('value'),
    'selectValue': __('Select value'),
    'checked': __('checked'),
    'unchecked': __('unchecked'),
    'unknown': __('unknown'),
    'notUnknown': __('not unknown'),

    'before': _x('before', 'Meaning: "Subscriber subscribed before April"'),
    'after': _x('after', 'Meaning: "Subscriber subscribed after April'),
    'on': _x('on', 'Meaning: "Subscriber subscribed on a given date"'),
    'notOn': _x('not on', 'Meaning: "Subscriber subscribed on a date other than the given date"'),
    'inTheLast': _x('in the last', 'Meaning: "Subscriber subscribed in the last 3 days"'),
    'notInTheLast': _x('not in the last', 'Meaning: "Subscriber subscribed not in the last 3 days"'),

    'emailActionNotOpened': _x('not opened', 'Dynamic segment creation: when newsletter was not opened'),
    'emailActionClicked': _x('clicked', 'Dynamic segment creation: when a newsletter link was clicked'),
    'emailActionClickedAnyEmail': _x('clicked any email', 'Dynamic segment creation: when a newsletter link in any email was clicked'),
    'emailActionNotClicked': _x('not clicked', 'Dynamic segment creation: when a newsletter link was not clicked'),
    'searchLabel': __('Search'),
    'segmentsTip': _x('Tip', 'A note about dynamic segments usage'),
    'segmentsTipText': __('segments allow you to group your subscribers by other criteria, such as events and actions.'),
    'segmentsTipLink': __('Read more.'),
    'subscribedDate': __('subscribed date'),
    'subscriberScore': _x('score', 'Subscriber engagement score'),
    'subscriberScorePlaceholder': _x('score', 'Placeholder for input: subscriber engagement score'),
    'subscriberScoreSentence': _x('{condition} {score} %', 'The result will be "higher than 20 %"'),
    'subscribedToList': __('subscribed to list'),
    'segmentsSubscriber': __('WordPress user role'),
    'mailpoetCustomField': __('MailPoet custom field'),
    'segmentsActiveMembership': __('is member of'),
    'woocommerceMemberships': _x('WooCommerce Memberships', 'Dynamic segment creation: User selects this to use any WooCommerce Memberships filters'),
    'selectWooMembership': __('Search membership plans'),
    'segmentsActiveSubscription': __('has active subscription'),
    'woocommerceSubscriptions': _x('WooCommerce Subscriptions', 'Dynamic segment creation: User selects this to use any WooCommerce Subscriptions filters'),
    'selectWooSubscription': __('Search subscriptions'),
    'searchLists': __('Search lists'),
    'subscriberTag': _x('tag', 'Subscriber tag'),
    'searchTags': _x('Search tags'),

    'anyOf': __('any of'),
    'allOf': __('all of'),
    'noneOf': __('none of'),

    'oneDynamicSegmentTrashed': __('1 segment was moved to the trash.'),
    'multipleDynamicSegmentsTrashed': __('%1$d segments were moved to the trash.'),
    'oneDynamicSegmentRestored': __('1 segment has been restored from the Trash.'),
    'multipleDynamicSegmentsRestored': __('%1$d segments have been restored from the Trash.'),
    'multipleDynamicSegmentsDeleted': __('%1$d segments were permanently deleted.'),
    'oneDynamicSegmentDeleted': __('1 segment was permanently deleted.'),

    'wooNumberOfOrders': __('# of orders'),
    'moreThan': __('more than'),
    'lessThan': __('less than'),
    'wooNumberOfOrdersCount': __('count'),
    'daysPlaceholder': __('days'),
    'days': _x('days', 'Appears together with `inTheLast` when creating a new WooCommerce segment based on the number of orders.'),
    'inTheLast': _x('in the last', 'Appears together with `days` when creating a new WooCommerce segment based on the number of orders.'),
    'wooNumberOfOrdersOrders': __('orders'),
    'wooPurchasedCategory': __('purchased in category'),
    'wooPurchasedProduct': __('purchased product'),
    'wooTotalSpent': __('total spent'),
    'wooCustomerInCountry': __('is in country'),
    'wooTotalSpentAmount': __('amount'),
    'selectWooPurchasedCategory': __('Search categories'),
    'selectWooPurchasedProduct': __('Search products'),
    'selectWooCountry': __('Search countries'),
    'woocommerce': _x('WooCommerce', 'Dynamic segment creation: User selects this to use any woocommerce filters'),

    'dynamicSegmentSizeIsCalculated': __('Calculating segment size…'),
    'dynamicSegmentSizeCalculatingTimeout': __("It's taking longer than usual to generate the segment, which may be due to a complex configuration. Try using fewer or simpler conditions."),
    'dynamicSegmentSize': __('This segment has %1$d subscribers.'),
    'learnMore': __('Learn more.'),

    'unknownBadgeName': __('Unknown'),
    'unknownBadgeTooltip': __('Not enough data.'),
    'tooltipUnknown': __('Fewer than 3 emails sent'),
    'excellentBadgeName': __('Excellent'),
    'excellentBadgeTooltip': __('Congrats!'),
    'tooltipExcellent': __('50% or more'),
    'goodBadgeName': __('Good'),
    'goodBadgeTooltip': __('Good stuff.'),
    'tooltipGood': __('between 20 and 50%'),
    'averageBadgeName': __('Low'),
    'averageBadgeTooltip': __('Something to improve.'),
    'tooltipAverage': __('20% or fewer'),
    'engagementScoreDescription': __('Average percent of emails subscribers read in the last year'),
    'addCondition': __('Add a condition'),

    'subscribersCountWereCalculatedWithMinutesAgo': __('Lists and Segments subscribers counts were calculated <abbr>{$mins} minutes ago</abbr>'),
    'recalculateNow': __('Recalculate now'),
    'privacyProtectionNotice': __('Due to email privacy protections, some opens may not be tracked. Consider using a different engagement metric.'),

    'premiumFeature': __('This is a Premium feature'),
    'premiumFeatureMultipleConditions': __('Your current MailPoet plan does not support advanced segments with multiple conditions. Upgrade to the MailPoet Business plan to more precisely target your emails based on how people engage with your business. [link]Learn more.[/link]'),
    'premiumBannerCtaFree': __('Upgrade'),
    'premiumFeatureDescription':  __('Your current MailPoet plan includes advanced features, but they require the MailPoet Premium plugin to be installed and activated.'),
    'premiumFeatureButtonDownloadPremium':  __('Download MailPoet Premium plugin'),
    'premiumFeatureButtonActivatePremium':  __('Activate MailPoet Premium plugin'),
    'premiumFeatureDescriptionSubscribersLimitReached':  __('Congratulations, you now have [subscribersCount] subscribers! Your plan is limited to [subscribersLimit] subscribers. You need to upgrade now to be able to continue using MailPoet.'),
    'premiumFeatureButtonUpgradePlan':  __('Upgrade your plan'),
  }) %>
<% endblock %>

<% block after_translations %>
<%= do_action('mailpoet_segments_translations_after') %>
<% endblock %>
