/* Metro module 8552; source: design/components/Coachmark/native/Coachmark.native.tsx; dependencies: [29, 57, 31, 27, 33, 4017, 4501, 697, 8547, 4583, 8553, 1357, 4570, 4573, 4578, 1244, 5312, 8554, 8564, 477, 3868, 2] */ import ObjectWithoutProperties from '../../../../by-id/module-00029-ObjectWithoutProperties.js'; /* Metro dependency 29 */ import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */ import MobileVisualRefreshExperiment from '../../../../modules/themes/experiments/MobileVisualRefreshExperiment.tsx'; /* Metro dependency 1357 */ import ReanimatedRexport from '../../../../modules/reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */ import UseTooltipPositionNative from '../../Tooltip/native/useTooltipPosition.native.tsx'; /* Metro dependency 8547 */ import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */ import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as PlatformUtilsModule from '../../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */ import * as IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */ import * as NativeModule from '../../../../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */ import * as ReanimatedRexportModule from '../../../../modules/reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */ import * as SetAccessibilityFocusAndroidModule from '../../../../modules/a11y/native/setAccessibilityFocus.android.tsx'; /* Metro dependency 4570 */ import * as TextModule from '../../Text/native/Text.tsx'; /* Metro dependency 4573 */ import * as ButtonHooksNativeModule from '../../Button/native/ButtonHooks.native.tsx'; /* Metro dependency 4583 */ import * as XSmallIconModule from '../../Icon/native/redesign/generated/XSmallIcon.tsx'; /* Metro dependency 5312 */ function _fun67785(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67785, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8737:6, offset: 0x01c30800, size: 1024 bytes, params: 8, frame: 27 const env0_0 = require; const Coachmark2 = Coachmark; const env0_3 = ['style']; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ReactNativeModule; const env0_7 = value.View; const Pressable = value.Pressable; const env0_9 = value.Image; value = require(33) /* metro dependency 33 */; const env0_10 = value.jsx; const env0_11 = value.jsxs; const env0_12 = value.Fragment; const env0_13 = (ReanimatedRexport).createAnimatedComponent(Pressable); value = require(4501) /* metro dependency 4501: createStyles */; const createStyles = value.createStyles; object = {container: {'position': 'absolute', 'alignItems': 'center'}}; const object2 = {}; const SHADOW_BUTTON_OVERLAY = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_BUTTON_OVERLAY; copyDataProperties(object2, SHADOW_BUTTON_OVERLAY, undefined); object.shadow = object2; const object3 = {}; const COACHMARK_BODY_WIDTH = (importDefault(697) /* metro dependency 697: native */).modules.mobile.COACHMARK_BODY_WIDTH; object3.width = COACHMARK_BODY_WIDTH; object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg; object3.overflow = 'hidden'; object3.zIndex = 1; object.body = object3; object.textGap = {gap: 4}; const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24; object.textOnlyPadding = {paddingHorizontal: PX_24}; const object6 = {borderWidth: 1}; const MOBILE_COACHMARK_BORDER_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_COACHMARK_BORDER_DEFAULT; object6.borderColor = MOBILE_COACHMARK_BORDER_DEFAULT; const MOBILE_COACHMARK_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_COACHMARK_BACKGROUND_DEFAULT; object6.backgroundColor = MOBILE_COACHMARK_BACKGROUND_DEFAULT; object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg; object.bodyBgColor = object6; const object7 = {}; object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg; object7.overflow = 'hidden'; object.gradient = object7; const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16; object.bodyContainer = {'padding': null, 'alignItems': 'center', 'justifyContent': 'center', padding: PX_16}; object.center = {'alignItems': 'center', 'justifyContent': 'center'}; let COACHMARK_BUTTON_SPACING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.COACHMARK_BUTTON_SPACING; object.buttonSpacing = {height: COACHMARK_BUTTON_SPACING}; object.text = {'maxWidth': 200, 'textAlign': 'center'}; object.cursorContainer = {'alignItems': 'center', 'zIndex': 0}; const object10 = {'height': 8, 'width': 8, 'borderRadius': null, 'borderWidth': 2, 'backgroundColor': 'transparent'}; object10.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs; let INTERACTIVE_TEXT_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_ACTIVE; object10.borderColor = INTERACTIVE_TEXT_ACTIVE; object.cursorHead = object10; INTERACTIVE_TEXT_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_ACTIVE; object.cursorSpine = {'width': 2, 'height': 16, backgroundColor: INTERACTIVE_TEXT_ACTIVE}; object.image = {'height': 40, 'width': 40}; COACHMARK_BUTTON_SPACING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.COACHMARK_BUTTON_SPACING; object.bottomMargin = {marginBottom: COACHMARK_BUTTON_SPACING}; const object13 = {position: 'absolute'}; COACHMARK_BUTTON_SPACING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.COACHMARK_BUTTON_SPACING; object13.top = COACHMARK_BUTTON_SPACING; COACHMARK_BUTTON_SPACING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.COACHMARK_BUTTON_SPACING; object13.right = COACHMARK_BUTTON_SPACING; object.closeButton = object13; const env0_14 = Reflect.apply(createStyles, value, [object]); const env0_15 = {'21/9': 90, '16/9': 90, '6/4': 60, '2/1': 40, '1/1': 40}; (FileImportTrackerModule).fileFinishedImporting('design/components/Coachmark/native/Coachmark.native.tsx'); exports.Coachmark = Coachmark2; exports.CoachmarkContainer = CoachmarkContainer; function Coachmark({targetMeasurements, surfaceMeasurements, title, description, offsetY, graphic, imgSource, position, onDismiss, buttonLabel, buttonVariant, onButtonPress, gradientColor, experimental_withBlurBackground, renderImgComponent, enterExitAnimatedStyles}) { // fn#67786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8737:1653, offset: 0x01c30c00, size: 1796 bytes, params: 2, frame: 56 var object6; var r37; var r31; var r23; var r27; var jsxRuntimeEnv0_12Binding2; var items5; var Button; var object; var object5; let value = 0; let r12 = offsetY === undefined ? value : offsetY; const styles = useStyles(); const styles2 = styles; let binding = env0_6; const value5 = binding.useRef(null); const env0_4 = value5; const value7 = env0_5(env0_6.useState(null), 2); const property = value7[value]; var env0_5 = value7[1]; const {adjustmentX, tooltipX, tooltipY} = (UseTooltipPositionNative)(property, surfaceMeasurements, targetMeasurements, position, -8 + r12); const value10 = (ReanimatedRexportModule).useSharedValue(value); var env0_6 = value10; const value11 = env0_6.useCallback(_fun67787, [value10]); const value12 = env0_6.useCallback(_fun67788, [value10]); const value13 = (ButtonHooksNativeModule).useButtonPressAnimationProps(value10); const style = value13.style; const value14 = env0_4(value13, styles2); const value15 = env0_6.useMemo(_fun67789, [graphic, imgSource, renderImgComponent, styles]); const value16 = (MobileVisualRefreshExperiment)('Coachmark'); const jsxRuntimeEnv0_12Binding = jsxRuntimeEnv0_12; const viewBindingProps = {ref: value5, accessibilityRole: 'alert', style: styles.center, accessible: true, onLayout: onLayout_67790}; const textGap = value16 ? styles.textGap : undefined; const Text = (TextModule).Text; const view = ( {value15} {title} {description} ); if (buttonLabel != null) { if (onButtonPress != null) { jsxRuntimeEnv0_12Binding2 = jsxRuntimeEnv0_12; items5 = [ , ]; Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button; if (experimental_withBlurBackground) { r31 = {'variant': 'secondary-overlay', 'size': 'lg', 'text': null, 'onPress': null, 'grow': true, text: buttonLabel, onPress: onButtonPress}; } else { object = {}; r37 = buttonVariant ?? 'secondary'; object.variant = r37; r37 = value16 ? 'sm' : 'lg'; object.size = r37; object.text = buttonLabel; object.onPress = onButtonPress; object.grow = true; r31 = object; } items5[1] =