text: import{Dimensions,I18nManager}from'react-native';import getSceneIndicesForInterpolationInputRange from'../../utils/getSceneIndicesForInterpolationInputRange';function hasHeader(scene){if(!scene){return true;}var descriptor=scene.descriptor;return descriptor.options.header!==null;}var crossFadeInterpolation=function crossFadeInterpolation(scenes,first,index,last){return{inputRange:[first,first+0.001,index-0.9,index-0.2,index,last-0.001,last],outputRange:[0,hasHeader(scenes[first])?0:1,hasHeader(scenes[first])?0:1,hasHeader(scenes[first])?0.3:1,hasHeader(scenes[index])?1:0,hasHeader(scenes[last])?0:1,0],extrapolate:'clamp'};};function isGoingBack(scenes){var lastSceneIndexInScenes=scenes.length-1;return!scenes[lastSceneIndexInScenes].isActive;}function forLayout(props){var layout=props.layout,position=props.position,scene=props.scene,scenes=props.scenes,mode=props.mode;if(mode!=='float'){return{};}var isBack=isGoingBack(scenes);var interpolate=getSceneIndicesForInterpolationInputRange(props);if(!interpolate)return{};var first=interpolate.first,last=interpolate.last;var index=scene.index;var width=layout.initWidth||Dimensions.get('window').width;if(isBack&&!hasHeader(scenes[index])&&!hasHeader(scenes[last])||!isBack&&!hasHeader(scenes[first])&&!hasHeader(scenes[index])){return{transform:[{translateX:width}]};}var rtlMult=I18nManager.isRTL?-1:1;var translateX=position.interpolate({inputRange:[first,index,last],outputRange:[rtlMult*(hasHeader(scenes[first])?0:width),rtlMult*(hasHeader(scenes[index])?0:isBack?width:-width),rtlMult*(hasHeader(scenes[last])?0:-width)],extrapolate:'clamp'});return{transform:[{translateX:translateX}]};}function forLeft(props){var position=props.position,scene=props.scene,scenes=props.scenes;var interpolate=getSceneIndicesForInterpolationInputRange(props);if(!interpolate)return{opacity:0};var first=interpolate.first,last=interpolate.last;var index=scene.index;return{opacity:position.interpolate(crossFadeInterpolation(scenes,first,index,last))};}function forCenter(props){var position=props.position,scene=props.scene,scenes=props.scenes;var interpolate=getSceneIndicesForInterpolationInputRange(props);if(!interpolate)return{opacity:0};var first=interpolate.first,last=interpolate.last;var index=scene.index;return{opacity:position.interpolate(crossFadeInterpolation(scenes,first,index,last))};}function forRight(props){var position=props.position,scene=props.scene,scenes=props.scenes;var interpolate=getSceneIndicesForInterpolationInputRange(props);if(!interpolate)return{opacity:0};var first=interpolate.first,last=interpolate.last;var index=scene.index;return{opacity:position.interpolate(crossFadeInterpolation(scenes,first,index,last))};}function forLeftButton(props){var position=props.position,scene=props.scene,scenes=props.scenes;var interpolate=getSceneIndicesForInterpolationInputRange(props);if(!interpolate)return{opacity:0};var first=interpolate.first,last=interpolate.last;var index=scene.index;var inputRange=[first,first+0.001,first+Math.abs(index-first)/2,index,last-Math.abs(last-index)/2,last-0.001,last];var outputRange=[0,hasHeader(scenes[first])?0:1,hasHeader(scenes[first])?0.3:1,hasHeader(scenes[index])?1:0,hasHeader(scenes[last])?0.3:1,hasHeader(scenes[last])?0:1,0];return{opacity:position.interpolate({inputRange:inputRange,outputRange:outputRange,extrapolate:'clamp'})};}var LEFT_LABEL_OFFSET=Dimensions.get('window').width/2-70-25;function forLeftLabel(props){var position=props.position,scene=props.scene,scenes=props.scenes;var interpolate=getSceneIndicesForInterpolationInputRange(props);if(!interpolate)return{opacity:0};var first=interpolate.first,last=interpolate.last;var index=scene.index;var offset=LEFT_LABEL_OFFSET;return{opacity:position.interpolate({inputRange:[first,first+0.001,index-0.35,index,index+0.5,last-0.001,last],outputRange:[0,hasHeader(scenes[first])?0:1,hasHeader(scenes[first])?0:1,hasHeader(scenes[index])?1:0,hasHeader(scenes[last])?0.5:1,hasHeader(scenes[last])?0:1,0],extrapolate:'clamp'}),transform:[{translateX:position.interpolate({inputRange:[first,first+0.001,index,last-0.001,last],outputRange:I18nManager.isRTL?[-offset*1.5,hasHeader(scenes[first])?-offset*1.5:0,0,hasHeader(scenes[last])?offset:0,offset]:[offset,hasHeader(scenes[first])?offset:0,0,hasHeader(scenes[last])?-offset*1.5:0,-offset*1.5],extrapolate:'clamp'})}]};}var TITLE_OFFSET_IOS=Dimensions.get('window').width/2-70+25;function forCenterFromLeft(props){var position=props.position,scene=props.scene,scenes=props.scenes;var interpolate=getSceneIndicesForInterpolationInputRange(props);if(!interpolate)return{opacity:0};var first=interpolate.first,last=interpolate.last;var index=scene.index;var offset=TITLE_OFFSET_IOS;return{opacity:position.interpolate({inputRange:[first,first+0.001,index-0.5,index,index+0.7,last-0.001,last],outputRange:[0,hasHeader(scenes[first])?0:1,hasHeader(scenes[first])?0:1,hasHeader(scenes[index])?1:0,hasHeader(scenes[last])?0:1,hasHeader(scenes[last])?0:1,0],extrapolate:'clamp'}),transform:[{translateX:position.interpolate({inputRange:[first,first+0.001,index,last-0.001,last],outputRange:I18nManager.isRTL?[-offset,hasHeader(scenes[first])?-offset:0,0,hasHeader(scenes[last])?offset:0,offset]:[offset,hasHeader(scenes[first])?offset:0,0,hasHeader(scenes[last])?-offset:0,-offset],extrapolate:'clamp'})}]};}function forBackgroundWithFade(props){var position=props.position,scene=props.scene;var sceneRange=getSceneIndicesForInterpolationInputRange(props);if(!sceneRange)return{opacity:0};return{opacity:position.interpolate({inputRange:[sceneRange.first,scene.index,sceneRange.last],outputRange:[0,1,0],extrapolate:'clamp'})};}var VISIBLE={opacity:1};var HIDDEN={opacity:0};function forBackgroundWithInactiveHidden(_ref){var navigation=_ref.navigation,scene=_ref.scene;return navigation.state.index===scene.index?VISIBLE:HIDDEN;}var BACKGROUND_OFFSET=Dimensions.get('window').width;function forBackgroundWithTranslation(props){var position=props.position,scene=props.scene;var interpolate=getSceneIndicesForInterpolationInputRange(props);if(!interpolate)return{opacity:0};var first=interpolate.first,last=interpolate.last;var index=scene.index;var offset=BACKGROUND_OFFSET;var outputRange=[offset,0,-offset];return{transform:[{translateX:position.interpolate({inputRange:[first,index,last],outputRange:I18nManager.isRTL?outputRange.reverse():outputRange,extrapolate:'clamp'})}]};}var forBackground=forBackgroundWithInactiveHidden;export default{forLayout:forLayout,forLeft:forLeft,forLeftButton:forLeftButton,forLeftLabel:forLeftLabel,forCenterFromLeft:forCenterFromLeft,forCenter:forCenter,forRight:forRight,forBackground:forBackground,forBackgroundWithInactiveHidden:forBackgroundWithInactiveHidden,forBackgroundWithFade:forBackgroundWithFade,forBackgroundWithTranslation:forBackgroundWithTranslation};
  //# sourceMappingURL=HeaderStyleInterpolator.js.map