{% import "/common/macros.twig" as icwp_macros %}
{% set mode_shell = vars.mode_shell|default({}) %}
{% set mode_panel = vars.mode_panel|default({}) %}
{% set is_mode_landing = mode_shell.is_mode_landing|default(false) %}
{% set use_operator_chrome = is_mode_landing and mode_shell.use_operator_chrome|default(false) %}
{% set mode_active_panel = mode_panel.active_target|default('') %}

{% block inner_page_header %}{% endblock %}

{% block inner_page_body_shell %}
	<div class="inner-page-body-shell{% if is_mode_landing %} is-mode-landing{% endif %}"
		 data-inner-page-body-shell="1"
		 {% if is_mode_landing %}
		 data-mode-shell="1"
		 data-mode="{{ mode_shell.mode }}"
		 data-mode-interactive="{{ mode_shell.is_interactive ? '1' : '0' }}"
		 {% if mode_active_panel is not empty %}
		 data-mode-active-panel="{{ mode_active_panel }}"
		 {% endif %}
		 {% if use_operator_chrome %}
		 data-operator-chrome="1"
		 data-operator-home-href="{{ mode_shell.home_href|e('html_attr') }}"
		 data-operator-home-label="{{ mode_shell.home_label|e('html_attr') }}"
		 data-operator-parent-href="{{ mode_shell.parent_href|e('html_attr') }}"
		 data-operator-parent-label="{{ mode_shell.parent_label|e('html_attr') }}"
		 data-operator-root-step="{{ mode_shell.root_step_json|e('html_attr') }}"
		 data-operator-context-focus="{{ strings.operator_context_focus|e('html_attr') }}"
		 data-operator-context-next="{{ strings.operator_context_next|e('html_attr') }}"
		 data-operator-context-actions="{{ strings.operator_context_actions|e('html_attr') }}"
		 {% endif %}
		 {% endif %}>
		{% set inner_page_body_html %}
			{% block inner_page_body %}
				{% for element in content|default([]) %}
					{{ element|raw }}
				{% endfor %}
			{% endblock %}
		{% endset %}
		{% if use_operator_chrome %}
			{% set operator_body_html %}
				<div class="container-fluid py-2">
					{{ inner_page_body_html }}
				</div>
			{% endset %}
			{% set operator_rail_html %}
				{% include '/wpadmin/components/page/context_rail.twig' with {
					step: mode_shell.root_step,
					mode: mode_shell.mode,
					label: strings.operator_context_label
				} only %}
			{% endset %}
			{% include '/wpadmin/components/page/step_tabs.twig' with {
				hrefs: hrefs,
				imgs: imgs,
				strings: strings
			} only %}
			{% include '/wpadmin/components/page/shield_rail_layout.twig' with { layout: {
				class: 'shield-rail-layout--context-end' ~ ( mode_shell.root_step.actions is empty ? ' is-operator-context-rail-inactive' : '' ),
				content_first: true,
				content_html: operator_body_html,
				rail_html: operator_rail_html
			} } only %}
		{% else %}
			{{ inner_page_body_html }}
		{% endif %}
	</div>
{% endblock %}
