2026-07-20 16:05:17 +00:00
// Module ID: 1454
2026-07-28 08:39:19 +00:00
// Function ID: 16972
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-23 10:11:24 +00:00
// Dependencies: [1455, 1314, 1552, 587, 1555, 1556, 1557, 477, 1569, 620, 682, 1570, 621, 1571, 1819, 1820, 1558, 1453, 2]
2026-07-20 16:05:17 +00:00
// Exports: addKeyboardTypeChangedListener, addKeyboardWillOpenChangedListener, setKeyboardType
// Module 1454 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import { AppLauncherRouteName } from "APP_LAUNCHER_BUILT_IN_SECTION_ICON" ;
import { ExpressionPickerViewType } from "ExpressionPickerViewType" ;
import { MediaKeyboardTarget } from "DRAG_HANDLE" ;
import set from "set" ;
import set from "set" ;
import keys from "keys" ;
import { KeyboardEvents } from "KeyboardChatScrollView" ;
import { KeyboardEvents as KeyboardEvents2 } from "KeyboardChatScrollView" ;
import set from "DRAG_HANDLE" ;
function _createForOfIteratorHelperLoose ( iterable ) {
let closure_0 = iterable ;
iterable = "undefined" !== typeof Symbol ;
if ( iterable ) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol ;
2026-07-23 10:11:24 +00:00
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( ! iterable ) {
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( iterable ) {
const iter = iterable . call ( iterable ) ;
2026-07-20 16:05:17 +00:00
const next = iter . next ;
return next . bind ( iter ) ;
} else {
const _Array = Array ;
2026-07-23 10:11:24 +00:00
let tmp = iterable ;
if ( ! Array . isArray ( iterable ) ) {
2026-07-20 16:05:17 +00:00
let tmp2 ;
2026-07-23 10:11:24 +00:00
if ( iterable ) {
if ( "string" === typeof iterable ) {
tmp2 = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
const toString = { } . toString ;
2026-07-23 10:11:24 +00:00
const substr = toString . call ( iterable ) . slice ( 8 , - 1 ) ;
2026-07-20 16:05:17 +00:00
let name = substr ;
if ( tmp3 ) {
2026-07-23 10:11:24 +00:00
name = iterable . constructor . name ;
2026-07-20 16:05:17 +00:00
}
if ( "Map" !== name ) {
if ( "Set" !== name ) {
if ( "Arguments" === name ) {
2026-07-23 10:11:24 +00:00
let arr = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ ;
2026-07-20 16:05:17 +00:00
}
}
tmp2 = arr ;
}
const _Array2 = Array ;
2026-07-23 10:11:24 +00:00
arr = Array . from ( iterable ) ;
const callResult = toString . call ( iterable ) ;
tmp3 = "Object" === substr && iterable . constructor ;
2026-07-20 16:05:17 +00:00
}
}
tmp = tmp2 ;
if ( ! tmp2 ) {
const _TypeError = TypeError ;
const typeError = new TypeError ( "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
throw typeError ;
}
}
if ( tmp ) {
2026-07-23 10:11:24 +00:00
closure_0 = tmp ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = 0 ;
2026-07-20 16:05:17 +00:00
return ( ) = > {
2026-07-23 10:11:24 +00:00
if ( closure_1 >= length . length ) {
2026-07-20 16:05:17 +00:00
let obj = { done : true } ;
} else {
obj = { done : false } ;
closure_1 = tmp3 + 1 ;
2026-07-23 10:11:24 +00:00
obj . value = length [ + closure_1 ] ;
2026-07-20 16:05:17 +00:00
}
return obj ;
} ;
}
}
function _arrayLikeToArray ( arg0 , arg1 ) {
let length ;
if ( tmp ) {
length = arg0 . length ;
}
const ArrayResult = Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
ArrayResult [ num ] = arg0 [ num ] ;
}
return ArrayResult ;
}
function getCustomKeyboardHeight ( arg0 , arg1 , arg2 , DEFAULT_APP_ENTRY_KEY ) {
2026-07-23 10:11:24 +00:00
const Storage = require ( 587 ) /* Storage */ . Storage ;
2026-07-20 16:05:17 +00:00
let num = 253 ;
2026-07-23 10:11:24 +00:00
const value = Storage . get ( customKeyboardHeight , 253 ) ;
2026-07-20 16:05:17 +00:00
if ( null != value ) {
num = value ;
}
2026-07-23 10:11:24 +00:00
if ( arg1 === require ( 1555 ) /* KeyboardTypes */ . KeyboardTypes . SYSTEM ) {
2026-07-20 16:05:17 +00:00
if ( 0 !== arg0 ) {
if ( obj3 . getIsAnyChatInputFocused ( ) ) {
const _Math = Math ;
const bound = Math . max ( arg0 , 200 ) ;
if ( bound !== num ) {
2026-07-23 10:11:24 +00:00
const Storage2 = require ( 587 ) /* Storage */ . Storage ;
const result = Storage2 . set ( customKeyboardHeight , bound ) ;
2026-07-20 16:05:17 +00:00
}
let num3 = 0 ;
if ( arg2 ) {
2026-07-23 10:11:24 +00:00
num3 = require ( 1557 ) /* useSafeAreaInsets */ . getSafeAreaInsets ( DEFAULT_APP_ENTRY_KEY ) . bottom ;
const obj = require ( 1557 ) /* useSafeAreaInsets */ ;
2026-07-20 16:05:17 +00:00
}
return bound - num3 ;
}
2026-07-23 10:11:24 +00:00
obj3 = require ( 1556 ) /* setIsAnyChatInputFocused */ ;
2026-07-20 16:05:17 +00:00
}
}
let num5 = 0 ;
if ( arg2 ) {
2026-07-23 10:11:24 +00:00
num5 = require ( 1557 ) /* useSafeAreaInsets */ . getSafeAreaInsets ( DEFAULT_APP_ENTRY_KEY ) . bottom ;
const obj2 = require ( 1557 ) /* useSafeAreaInsets */ ;
2026-07-20 16:05:17 +00:00
}
return num - num5 ;
}
function getSystemKeyboardHeight ( arg0 ) {
let appEntryKey ;
let excludeSafeAreaInsets ;
let keyboardHeight ;
( { keyboardHeight , excludeSafeAreaInsets , appEntryKey } = arg0 ) ;
if ( obj . isAndroid ( ) ) {
2026-07-23 10:11:24 +00:00
let num = importDefault ( 1569 ) . getImeInsets ( excludeSafeAreaInsets , appEntryKey ) ;
const obj3 = importDefault ( 1569 ) ;
2026-07-20 16:05:17 +00:00
} else {
num = 0 ;
if ( 0 !== keyboardHeight ) {
let num2 = 0 ;
if ( excludeSafeAreaInsets ) {
2026-07-23 10:11:24 +00:00
num2 = require ( 1557 ) /* useSafeAreaInsets */ . getSafeAreaInsets ( appEntryKey ) . bottom ;
const obj2 = require ( 1557 ) /* useSafeAreaInsets */ ;
2026-07-20 16:05:17 +00:00
}
num = keyboardHeight - num2 ;
}
}
return num ;
}
function computeEntryState ( arg0 , keyboardDuration , appEntryKey ) {
let tmp = arg0 ;
keyboardDuration = keyboardDuration . keyboardDuration ;
if ( null == keyboardDuration ) {
keyboardDuration = tmp . keyboardDuration ;
}
let obj = { } ;
let keyboardHeight = keyboardDuration . keyboardHeight ;
if ( null == keyboardHeight ) {
keyboardHeight = tmp . keyboardHeight ;
}
obj . keyboardHeight = keyboardHeight ;
obj . excludeSafeAreaInsets = false ;
obj . appEntryKey = appEntryKey ;
const tmp2Result = getSystemKeyboardHeight ( obj ) ;
obj = { } ;
let keyboardHeight2 = keyboardDuration . keyboardHeight ;
if ( null == keyboardHeight2 ) {
keyboardHeight2 = tmp . keyboardHeight ;
}
obj . keyboardHeight = keyboardHeight2 ;
obj . excludeSafeAreaInsets = true ;
obj . appEntryKey = appEntryKey ;
const tmp4Result = getSystemKeyboardHeight ( obj ) ;
const keyboardType = keyboardDuration . keyboardType ;
let type ;
if ( null != keyboardType ) {
type = keyboardType . type ;
}
if ( null == type ) {
type = tmp . keyboardType ;
}
const tmp8 = getCustomKeyboardHeight ( tmp2Result , type , false , appEntryKey ) ;
const tmp9 = getCustomKeyboardHeight ( tmp2Result , type , true , appEntryKey ) ;
const keyboardType2 = keyboardDuration . keyboardType ;
let context ;
if ( null != keyboardType2 ) {
context = keyboardType2 . context ;
}
let tmp12 = tmp10 ;
if ( null != context ) {
tmp12 = context ;
}
if ( "object" === typeof tmp . keyboardContexts [ type ] ) {
if ( "object" === typeof tmp12 ) {
2026-07-23 10:11:24 +00:00
let tmp13 = ! importDefault ( 620 ) ( tmp10 , tmp12 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let obj2 = require ( 477 ) /* set */ ;
2026-07-20 16:05:17 +00:00
if ( obj2 . isAndroid ( ) ) {
let systemKeyboardOpen = tmp2Result > 0 ;
} else {
systemKeyboardOpen = keyboardDuration . systemKeyboardOpen ;
if ( null == systemKeyboardOpen ) {
systemKeyboardOpen = tmp . systemKeyboardOpen ;
}
}
2026-07-23 10:11:24 +00:00
if ( tmp . keyboardContexts [ require ( undefined , 1555 ) /* KeyboardTypes */ . KeyboardTypes . SYSTEM ] . keyboardWillOpen ) {
2026-07-20 16:05:17 +00:00
if ( null != keyboardDuration . systemKeyboardOpen ) {
obj = { } ;
const merged = Object . assign ( tmp . keyboardContexts ) ;
const obj1 = { } ;
2026-07-23 10:11:24 +00:00
const merged1 = Object . assign ( tmp . keyboardContexts [ require ( undefined , 1555 ) /* KeyboardTypes */ . KeyboardTypes . SYSTEM ] ) ;
2026-07-20 16:05:17 +00:00
obj1 [ "keyboardWillOpen" ] = false ;
2026-07-23 10:11:24 +00:00
obj [ require ( 1555 ) /* KeyboardTypes */ . KeyboardTypes . SYSTEM ] = obj1 ;
2026-07-20 16:05:17 +00:00
let tmp20 = obj ;
}
if ( tmp . keyboardDuration === keyboardDuration ) {
2026-07-23 10:11:24 +00:00
if ( importDefault ( 620 ) ( tmp . keyboardContexts , tmp20 ) ) {
2026-07-20 16:05:17 +00:00
if ( tmp . keyboardHeight === tmp2Result ) {
if ( tmp . keyboardHeightExcludingSafeAreaInsets === tmp4Result ) {
if ( tmp . keyboardType === type ) {
if ( tmp . customKeyboardHeight === tmp8 ) {
return tmp ;
}
}
}
}
}
}
obj2 = { keyboardContexts : tmp20 , keyboardDuration , keyboardHeight : tmp2Result , keyboardHeightExcludingSafeAreaInsets : tmp4Result , systemKeyboardOpen , keyboardType : type , keyboardTypePrevious : tmp7 , customKeyboardHeight : tmp8 , customKeyboardHeightExcludingSafeAreaInsets : tmp9 } ;
tmp = obj2 ;
}
const keyboardContexts = tmp . keyboardContexts ;
if ( tmp13 ) {
const obj3 = { } ;
const merged2 = Object . assign ( keyboardContexts ) ;
obj3 [ type ] = tmp12 ;
tmp20 = obj3 ;
} else {
tmp20 = keyboardContexts ;
}
}
tmp13 = tmp10 !== tmp12 ;
}
function updateKeyboardStoreState ( arg0 , DEFAULT_APP_ENTRY_KEY ) {
2026-07-23 10:11:24 +00:00
const _require = arg0 ;
let closure_1 = DEFAULT_APP_ENTRY_KEY ;
_require ( 682 ) . batchUpdates ( ( ) = > outer1_9 . setState ( ( arg0 ) = > {
2026-07-20 16:05:17 +00:00
let iter3 ;
let tmp = arg0 ;
2026-07-23 10:11:24 +00:00
if ( null != outer1_1 ) {
const items = [ outer1_1 ] ;
2026-07-20 16:05:17 +00:00
let APP_ENTRY_KEYS = items ;
} else {
2026-07-23 10:11:24 +00:00
APP_ENTRY_KEYS = callback ( outer2_2 [ 11 ] ) . APP_ENTRY_KEYS ;
2026-07-20 16:05:17 +00:00
}
const byAppEntry = tmp . byAppEntry ;
2026-07-23 10:11:24 +00:00
const tmp5 = outer2_10 ( APP_ENTRY_KEYS ) ;
2026-07-20 16:05:17 +00:00
const iter = tmp5 ( ) ;
let iter2 = iter ;
let tmp6 = byAppEntry ;
let tmp7 = byAppEntry ;
if ( ! iter . done ) {
do {
let value = iter2 . value ;
let tmp8 = tmp6 [ value ] ;
2026-07-23 10:11:24 +00:00
let tmp9 = outer2_14 ;
let tmp10 = outer1_0 ;
let tmp11 = outer2_14 ( tmp8 , outer1_0 , value ) ;
2026-07-20 16:05:17 +00:00
let tmp12 = tmp6 ;
if ( tmp8 !== tmp11 ) {
let obj = { } ;
let tmp13 = obj ;
let tmp14 = tmp6 ;
let merged = Object . assign ( tmp6 ) ;
obj [ value ] = tmp11 ;
tmp12 = obj ;
}
iter3 = tmp5 ( ) ;
tmp6 = tmp12 ;
iter2 = iter3 ;
tmp7 = tmp12 ;
} while ( ! iter3 . done ) ;
}
if ( tmp7 !== tmp . byAppEntry ) {
obj = { byAppEntry : tmp7 } ;
tmp = obj ;
}
return tmp ;
} ) ) ;
}
function createInitialEntryState ( main ) {
2026-07-23 10:11:24 +00:00
obj = { customKeyboardHeight : getCustomKeyboardHeight ( 0 , require ( 1555 ) /* KeyboardTypes */ . KeyboardTypes . SYSTEM , false , main ) , customKeyboardHeightExcludingSafeAreaInsets : getCustomKeyboardHeight ( 0 , require ( 1555 ) /* KeyboardTypes */ . KeyboardTypes . SYSTEM , true , main ) , keyboardContexts : obj , keyboardDuration : 0 , keyboardHeight : getSystemKeyboardHeight ( obj2 ) , keyboardHeightExcludingSafeAreaInsets : getSystemKeyboardHeight ( obj3 ) , systemKeyboardOpen : false , keyboardType : require ( 1555 ) /* KeyboardTypes */ . KeyboardTypes . SYSTEM , keyboardTypePrevious : require ( 1555 ) /* KeyboardTypes */ . KeyboardTypes . SYSTEM } ;
2026-07-20 16:05:17 +00:00
obj = { [ closure_0 ( closure_2 [ 4 ] ) . KeyboardTypes . SYSTEM ] : { keyboardWillOpen : false } , [ closure_0 ( closure_2 [ 4 ] ) . KeyboardTypes . EXPRESSION ] : ExpressionPickerViewType . EMOJI , [ closure_0 ( closure_2 [ 4 ] ) . KeyboardTypes . MEDIA ] : obj , [ closure_0 ( closure_2 [ 4 ] ) . KeyboardTypes . APP_LAUNCHER ] : obj1 } ;
obj = { target : MediaKeyboardTarget.CHAT } ;
2026-07-23 10:11:24 +00:00
obj2 = { keyboardHeight : 0 , excludeSafeAreaInsets : false , appEntryKey : main } ;
obj3 = { keyboardHeight : 0 , excludeSafeAreaInsets : true , appEntryKey : main } ;
2026-07-20 16:05:17 +00:00
return obj ;
}
2026-07-23 10:11:24 +00:00
const customKeyboardHeight = "customKeyboardHeight" ;
let set = new Set ( ) ;
2026-07-20 16:05:17 +00:00
const set1 = new Set ( ) ;
let str = "keyboardWillShow" ;
2026-07-23 10:11:24 +00:00
if ( set . isAndroid ( ) ) {
2026-07-20 16:05:17 +00:00
str = "keyboardDidShow" ;
}
let str2 = "keyboardWillHide" ;
2026-07-23 10:11:24 +00:00
if ( set . isAndroid ( ) ) {
2026-07-20 16:05:17 +00:00
str2 = "keyboardDidHide" ;
}
2026-07-23 10:11:24 +00:00
let obj = keys . create ( ( ) = > {
2026-07-20 16:05:17 +00:00
let obj = { } ;
obj = { main : createInitialEntryState ( "main" ) , share : createInitialEntryState ( "share" ) } ;
obj . byAppEntry = obj ;
return obj ;
} ) ;
KeyboardEvents . addListener ( str , ( keyboardDuration ) = > {
const height = keyboardDuration . height ;
2026-07-23 10:11:24 +00:00
const result = importDefault ( 1819 ) . reactNativeKeyboardDidShow ( height , "KeyboardUIStore" ) ;
2026-07-20 16:05:17 +00:00
updateKeyboardStoreState ( { keyboardHeight : height , keyboardDuration : keyboardDuration.duration , systemKeyboardOpen : true } ) ;
2026-07-23 10:11:24 +00:00
const obj = importDefault ( 1819 ) ;
require ( 1820 ) /* dismissGlobalKeyboard */ . onKeyboardChanged ( true ) ;
2026-07-20 16:05:17 +00:00
const item = set1 . forEach ( ( arg0 ) = > arg0 ( false ) ) ;
} ) ;
KeyboardEvents2 . addListener ( str2 , ( ) = > {
2026-07-23 10:11:24 +00:00
const result = importDefault ( 1819 ) . reactNativeKeyboardDidHide ( "KeyboardUIStore" ) ;
updateKeyboardStoreState ( { keyboardHeight : 0 , systemKeyboardOpen : false } ) ;
const obj = importDefault ( 1819 ) ;
require ( 1820 ) /* dismissGlobalKeyboard */ . onKeyboardChanged ( false ) ;
2026-07-20 16:05:17 +00:00
const item = set1 . forEach ( ( arg0 ) = > arg0 ( false ) ) ;
} ) ;
2026-07-23 10:11:24 +00:00
const subscription = require ( "module_1558" ) . subscribe ( ( ) = > {
2026-07-20 16:05:17 +00:00
updateKeyboardStoreState ( { } ) ;
} ) ;
2026-07-23 10:11:24 +00:00
let result = set . fileFinishedImporting ( "modules/keyboard/native/KeyboardUIStore.native.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default obj ;
export const setKeyboardType = function setKeyboardType ( keyboardParams , DEFAULT_APP_ENTRY_KEY ) {
2026-07-23 10:11:24 +00:00
const _require = keyboardParams ;
2026-07-20 16:05:17 +00:00
if ( DEFAULT_APP_ENTRY_KEY === undefined ) {
2026-07-23 10:11:24 +00:00
DEFAULT_APP_ENTRY_KEY = _require ( 1453 ) . DEFAULT_APP_ENTRY_KEY ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const item = set . forEach ( ( arg0 ) = > arg0 ( closure_0 , DEFAULT_APP_ENTRY_KEY ) ) ;
const item1 = set1 . forEach ( ( arg0 ) = > {
let tmp = keyboardParams . type === keyboardParams ( outer1_2 [ 4 ] ) . KeyboardTypes . SYSTEM ;
2026-07-20 16:05:17 +00:00
if ( tmp ) {
2026-07-23 10:11:24 +00:00
const context = keyboardParams . context ;
2026-07-20 16:05:17 +00:00
let keyboardWillOpen ;
if ( null != context ) {
keyboardWillOpen = context . keyboardWillOpen ;
}
tmp = true === keyboardWillOpen ;
}
2026-07-23 10:11:24 +00:00
return arg0 ( tmp , DEFAULT_APP_ENTRY_KEY ) ;
2026-07-20 16:05:17 +00:00
} ) ;
updateKeyboardStoreState ( { keyboardType : keyboardParams } , DEFAULT_APP_ENTRY_KEY ) ;
} ;
export const addKeyboardWillOpenChangedListener = function addKeyboardWillOpenChangedListener ( arg0 ) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0 ;
2026-07-20 16:05:17 +00:00
set1 . add ( arg0 ) ;
2026-07-23 10:11:24 +00:00
return ( ) = > outer1_8 . delete ( closure_0 ) ;
2026-07-20 16:05:17 +00:00
} ;
export const addKeyboardTypeChangedListener = function addKeyboardTypeChangedListener ( arg0 ) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0 ;
2026-07-20 16:05:17 +00:00
set . add ( arg0 ) ;
2026-07-23 10:11:24 +00:00
return ( ) = > outer1_7 . delete ( closure_0 ) ;
2026-07-20 16:05:17 +00:00
} ;