<core:FragmentDefinition xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
						 xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:build="sap.build" xmlns:f="sap.f">
	<!-- This fragment is used only in ObjectPageDynamicHeaderTitle -->
	<!-- Note: This Image is only shown if the ObjectPageDynamicHeaderTitle is snapped -->
	<!-- If the ObjectPageDynamicHeaderTitle is not snapped (expanded) the Image in this fragment isn't visible but the Image in the HeaderContent fragment is shown instead -->
	<template:if test="{entityType>com.sap.vocabularies.UI.v1.HeaderInfo/ImageUrl}">
		<template:then>
			<f:Avatar id="template::ObjectPage::TitleImage"
				src="{parts:[{path: 'entityType>com.sap.vocabularies.UI.v1.HeaderInfo/ImageUrl'}, {path: 'parameter>/appComponentName'}, {value: true}], formatter: 'sap.suite.ui.generic.template.js.AnnotationHelper.formatImageUrl'}"
				displaySize="S"
				displayShape="Square"
				initials="{path: 'entityType>com.sap.vocabularies.UI.v1.HeaderInfo/Initials', formatter: 'sap.suite.ui.generic.template.js.AnnotationHelper.getAvatarInitials'}"
				fallbackIcon="{parts:[{path: 'entityType>com.sap.vocabularies.UI.v1.HeaderInfo/TypeImageUrl'}, {path: 'parameter>/appComponentName'}, {value: true}], formatter: 'sap.suite.ui.generic.template.js.AnnotationHelper.formatImageUrl'}"
				visible="{= ${ui>/editable} || !${_templPriv>/objectPage/isHeaderExpanded}}"
				press="._templateEventHandlers.onHeaderImagePress"
				class="sapUxAPObjectPageHeaderObjectImage sapSmartTemplatesObjectPageHeaderAvatar"/>
			<template:if test="{parts: [{path: 'entitySet>name'}, {path: 'manifestViewExtensions>'}], formatter: 'sap.suite.ui.generic.template.js.AnnotationHelper.extensionPointAfterImageExists' }">
				<core:ExtensionPoint name="AfterImageExtensionFacet|{entitySet>name}"/>
			</template:if>
		</template:then>
		<template:elseif test="{entityType>com.sap.vocabularies.UI.v1.HeaderInfo/TypeImageUrl}">
			<f:Avatar id="template::ObjectPage::TitleImage"
				src="{parts:[{path: 'entityType>com.sap.vocabularies.UI.v1.HeaderInfo/TypeImageUrl'}, {path: 'parameter>/appComponentName'}, {value: true}], formatter: 'sap.suite.ui.generic.template.js.AnnotationHelper.formatImageUrl'}"
				displaySize="S"
				displayShape="Square"
				initials="{path: 'entityType>com.sap.vocabularies.UI.v1.HeaderInfo/Initials', formatter: 'sap.suite.ui.generic.template.js.AnnotationHelper.getAvatarInitials'}"
				visible="{= ${ui>/editable} || !${_templPriv>/objectPage/isHeaderExpanded}}"
				class="sapUxAPObjectPageHeaderObjectImage sapSmartTemplatesObjectPageHeaderAvatar"/>
			<template:if test="{parts: [{path: 'entitySet>name'}, {path: 'manifestViewExtensions>'}], formatter: 'sap.suite.ui.generic.template.js.AnnotationHelper.extensionPointAfterImageExists' }">
				<core:ExtensionPoint name="AfterImageExtensionFacet|{entitySet>name}"/>
			</template:if>
		</template:elseif>
		<template:elseif test="{entityType>com.sap.vocabularies.UI.v1.HeaderInfo/Initials}">
			<f:Avatar id="{:= ${parameter>/stableId}.getStableId({type: 'ObjectPageHeader', subType: 'SnappedHeaderInitialsAvatar'})}"
				displaySize="S"
				displayShape="Square"
				class="sapUxAPObjectPageHeaderObjectImage sapSmartTemplatesObjectPageHeaderAvatar"
				initials="{path: 'entityType>com.sap.vocabularies.UI.v1.HeaderInfo/Initials', formatter: 'sap.suite.ui.generic.template.js.AnnotationHelper.getAvatarInitials'}"
				visible="{= ${ui>/editable} || !${_templPriv>/objectPage/isHeaderExpanded}}"/>
			<template:if test="{parts: [{path: 'entitySet>name'}, {path: 'manifestViewExtensions>'}], formatter: 'sap.suite.ui.generic.template.js.AnnotationHelper.extensionPointAfterImageExists' }">
				<core:ExtensionPoint name="AfterImageExtensionFacet|{entitySet>name}"/>
			</template:if>
		</template:elseif>
		<template:else>
			<template:if test="{parts: [{path: 'entitySet>name'}, {path: 'manifestViewExtensions>'}], formatter: 'sap.suite.ui.generic.template.js.AnnotationHelper.extensionPointNoImageExists' }">
				<core:ExtensionPoint name="NoImageExtensionFacet|{entitySet>name}"/>
			</template:if>
		</template:else>
	</template:if>
</core:FragmentDefinition>