<!DOCTYPE html>
<html lang="<%= locale %>">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Automation Flow</title>
  <style>
    html, body {
      margin: 0;
      padding: 0;
      background: #fff;
      font-size: 13px;
    }
    #mailpoet_automation_flow_embed {
      background: #fff;
      min-height: 100vh;
    }
    .flow-embed-error {
      padding: 20px;
      text-align: center;
      color: #cc1818;
    }
    /* Disable clickable links in embed mode */
    #mailpoet_automation_flow_embed a {
      pointer-events: none;
      cursor: default;
      text-decoration: none;
      color: inherit;
    }
    /* Hide step more menu in embed mode */
    .mailpoet-automation-step-more-menu {
      display: none;
    }
  </style>
  <script type="text/javascript">
    // Global config needed by admin bundle
    var mailpoet_tracking_config = <%= json_encode(tracking_config) %>;
    // Premium-related variables needed for step type registration
    var mailpoet_has_valid_premium_key = <%= json_encode(has_valid_premium_key) %>;
    var mailpoet_subscribers_limit_reached = <%= json_encode(subscribers_limit_reached) %>;
    var mailpoet_premium_active = <%= json_encode(premium_active) %>;
    var mailpoet_capabilities = <%= json_encode(capabilities) %>;
    // WooCommerce-related variables needed for WooCommerce step types
    var mailpoet_woocommerce_active = <%= json_encode(woocommerce_active) %>;
    var mailpoet_woocommerce_subscriptions_active = <%= json_encode(woocommerce_subscriptions_active) %>;
    var mailpoet_woocommerce_bookings_active = <%= json_encode(woocommerce_bookings_active) %>;
    // Flow embed-specific variables
    var mailpoet_automation_id = <%= json_encode(automation_id) %>;
    var mailpoet_automation_api = <%= json_encode(api) %>;
    var mailpoet_automation_registry = <%= json_encode(registry) %>;
    var mailpoet_automation_context = <%= json_encode(context) %>;
    var mailpoet_automation = <%= json_encode(automation) %>;
    var mailpoet_woocommerce_store_config = <%= json_encode(woocommerce_store_config) %>;
  </script>
  <%= head_content | raw %>
</head>
<body>
  <div id="mailpoet_automation_flow_embed"></div>
  <%= footer_content | raw %>
</body>
</html>
