2026-07-25 08:10:48 +00:00
// Module ID: 7935
2026-07-27 11:26:19 +00:00
// Function ID: 63143
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-25 08:10:48 +00:00
// Dependencies: [4123, 4992, 1348, 1918, 4350, 1850, 7936, 653, 4330, 3772, 3776, 1392, 7937, 3765, 3748, 7938, 1212, 6020, 7940, 477, 7941, 7942, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-25 08:10:48 +00:00
// Module 7935 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import closure_4 from "_isNativeReflectConstruct" ;
import closure_5 from "_isNativeReflectConstruct" ;
import closure_6 from "_isNativeReflectConstruct" ;
import closure_7 from "_isNativeReflectConstruct" ;
import closure_8 from "_isNativeReflectConstruct" ;
import { getPollState } from "useMessagePollInteractions" ;
import ME from "ME" ;
import set from "_isNativeReflectConstruct" ;
const require = arg1 ;
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 reactionForId ( reactions , first ) {
let value ;
const tmp = _createForOfIteratorHelperLoose ( reactions ) ;
const iter = tmp ( ) ;
let iter2 = iter ;
if ( ! iter . done ) {
while ( true ) {
value = iter2 . value ;
if ( "number" === typeof value . emoji . id ) {
let _HermesInternal = HermesInternal ;
let id = "" + value . emoji . id ;
} else {
id = value . emoji . id ;
}
if ( id === first ) {
break ;
} else {
let iter3 = tmp ( ) ;
iter2 = iter3 ;
}
}
return value ;
}
}
function transformPollEmoji ( animated , size ) {
let obj = size ;
if ( size === undefined ) {
obj = { } ;
}
let flag = obj . animateEmoji ;
if ( flag === undefined ) {
flag = false ;
}
let num = obj . size ;
if ( num === undefined ) {
num = 48 ;
}
if ( null != animated ) {
animated = animated . animated ;
let tmp = animated ;
if ( null == animated ) {
tmp = animated ;
if ( null != animated . id ) {
2026-07-23 10:11:24 +00:00
customEmojiById = customEmojiById . getCustomEmojiById ( animated . id ) ;
2026-07-20 16:05:17 +00:00
animated = undefined ;
if ( null != customEmojiById ) {
animated = customEmojiById . animated ;
}
tmp = null != animated && animated ;
const tmp5 = null != animated && animated ;
}
}
if ( flag ) {
flag = null != tmp ;
}
if ( flag ) {
flag = tmp ;
}
obj = { } ;
let combined = null ;
if ( null != animated . id ) {
const _HermesInternal = HermesInternal ;
combined = "" + animated . id ;
}
obj . id = combined ;
obj . name = animated . name ;
if ( null == animated . id ) {
2026-07-25 08:10:48 +00:00
let name = importDefault ( 3772 ) . convertSurrogateToName ( animated . name ) ;
const obj3 = importDefault ( 3772 ) ;
2026-07-20 16:05:17 +00:00
} else {
name = animated . name ;
}
obj . displayName = name ;
if ( null == animated . id ) {
2026-07-25 08:10:48 +00:00
let uRL = importDefault ( 3776 ) . getURL ( animated . name ) ;
const obj6 = importDefault ( 3776 ) ;
2026-07-20 16:05:17 +00:00
} else {
obj = { id : animated.id , animated : flag , size : num } ;
2026-07-23 10:11:24 +00:00
uRL = importDefault ( 1392 ) . getEmojiURL ( obj ) ;
const obj4 = importDefault ( 1392 ) ;
2026-07-20 16:05:17 +00:00
}
obj . src = uRL ;
obj . animated = flag ;
return obj ;
}
}
function isPollMessageDirectlyInteractive ( poll ) {
let tmp = null == poll . poll ;
if ( ! tmp ) {
2026-07-23 10:11:24 +00:00
tmp = store . getMessage ( poll . channel_id , poll . id ) === poll ;
2026-07-20 16:05:17 +00:00
}
return tmp ;
}
function computeBasicPollChatData ( message , arg1 , maxSettingsForPreset ) {
let editing ;
let selectedAnswerIds ;
let showResults ;
let submitting ;
let tmp = arg1 ;
let obj = maxSettingsForPreset ;
if ( maxSettingsForPreset === undefined ) {
obj = { } ;
}
let formattedExpirationLabel = obj . formattedExpirationLabel ;
const poll = message . poll ;
if ( null != poll ) {
let str = "" ;
if ( message . state === MessageStates . SENT ) {
if ( null == formattedExpirationLabel ) {
2026-07-25 08:10:48 +00:00
formattedExpirationLabel = require ( 7937 ) /* formatExpirationLabel */ . formatExpirationLabel ( poll . expiry ) ;
const obj2 = require ( 7937 ) /* formatExpirationLabel */ ;
2026-07-20 16:05:17 +00:00
}
str = formattedExpirationLabel ;
}
if ( null == tmp ) {
tmp = getPollState ( message . getChannelId ( ) , message . id ) ;
}
if ( null == tmp ) {
tmp = obj ;
}
( { selectedAnswerIds , submitting , editing , showResults } = tmp ) ;
let reactions = message . reactions ;
let obj3 = reactions ;
let flag = true ;
if ( ! isPollMessageDirectlyInteractive ( message ) ) {
2026-07-23 10:11:24 +00:00
message = store . getMessage ( message . channel_id , message . id ) ;
2026-07-20 16:05:17 +00:00
reactions = undefined ;
if ( null != message ) {
reactions = message . reactions ;
}
obj3 = reactions ;
flag = ! message . isSearchHit && null != message ;
const tmp11 = ! message . isSearchHit && null != message ;
}
const someResult = obj3 . some ( ( me_vote ) = > true === me_vote . me_vote ) ;
let tmp15 = ! editing ;
if ( tmp15 ) {
tmp15 = someResult ;
}
let tmp17 = tmp15 ;
if ( ! tmp15 ) {
tmp17 = tmp6 ;
}
if ( ! tmp17 ) {
tmp17 = showResults ;
}
let tmp18 = tmp3 ;
if ( message . state === MessageStates . SENT ) {
tmp18 = flag ;
}
if ( tmp18 ) {
tmp18 = ! someResult || editing || tmp17 ;
const tmp19 = ! someResult || editing || tmp17 ;
}
2026-07-23 10:11:24 +00:00
channel = channel . getChannel ( message . getChannelId ( ) ) ;
2026-07-20 16:05:17 +00:00
let guildId ;
if ( null != channel ) {
if ( null != channel . getGuildId ) {
guildId = channel . getGuildId ( ) ;
}
}
let selfMember = null ;
if ( null != guildId ) {
selfMember = selfMember . getSelfMember ( guildId ) ;
}
2026-07-25 08:10:48 +00:00
const result = require ( 3765 ) /* getAutomodQuarantinedProfileFlags */ . hasAutomodQuarantinedProfile ( selfMember ) ;
const obj5 = require ( 3765 ) /* getAutomodQuarantinedProfileFlags */ ;
2026-07-20 16:05:17 +00:00
obj = { poll , canTapAnswers : tmp18 } ;
let tmp28 = tmp15 ;
2026-07-25 08:10:48 +00:00
const result1 = require ( 3748 ) /* isCommunicationDisabled */ . isMemberCommunicationDisabled ( selfMember ) ;
2026-07-20 16:05:17 +00:00
if ( tmp15 ) {
tmp28 = tmp3 ;
}
if ( tmp28 ) {
tmp28 = ! tmp6 ;
}
obj . canRemoveVote = tmp28 ;
obj . canShowVoteCounts = tmp17 ;
obj . canSubmitVote = ! submitting && selectedAnswerIds . size > 0 && ! tmp15 && message . state === MessageStates . SENT && ! result && ! result1 ;
obj . expirationLabel = str ;
obj . hasSelectedAnswer = selectedAnswerIds . size > 0 ;
obj . hasVoted = tmp15 ;
obj . hasVoteRecorded = someResult ;
obj . isEditingVote = editing ;
obj . isExpired = null == str && message . state === MessageStates . SENT ;
obj . isInteractive = flag ;
obj . isSent = message . state === MessageStates . SENT ;
obj . reactions = obj3 ;
obj . selectedAnswerIds = selectedAnswerIds ;
obj . submitting = submitting ;
obj . tapShouldOpenVotersModal = tmp17 ;
obj . showResults = showResults ;
return obj ;
}
}
2026-07-23 10:11:24 +00:00
const MessageStates = ME . MessageStates ;
let obj = { channelId : ME.EMPTY_STRING_SNOWFLAKE_ID , selectedAnswerIds : null , submitting : false , editing : false , showResults : false } ;
let set = new Set ( ) ;
obj . selectedAnswerIds = set ;
let result = set . fileFinishedImporting ( "modules/polls/chat/formatPollMessageChatData.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default function formatPollMessageChatData ( poll , arg1 , maxSettingsForPreset ) {
let answers ;
2026-07-23 10:11:24 +00:00
let c10 ;
let c9 ;
2026-07-20 16:05:17 +00:00
let canRemoveVote ;
let canShowVoteCounts ;
let canSubmitVote ;
let canTapAnswers ;
let expirationLabel ;
let isEditingVote ;
let isExpired ;
let isInteractive ;
let layout_type ;
let reactions ;
let showResults ;
let tapShouldOpenVotersModal ;
let obj = maxSettingsForPreset ;
if ( maxSettingsForPreset === undefined ) {
obj = { } ;
}
let flag = obj . animateEmoji ;
if ( flag === undefined ) {
flag = false ;
}
let str = obj . theme ;
if ( str === undefined ) {
str = "dark" ;
}
let useReducedMotion ;
2026-07-23 10:11:24 +00:00
layout_type = undefined ;
canSubmitVote = undefined ;
expirationLabel = undefined ;
let hasSelectedAnswer ;
let hasVoted ;
isExpired = undefined ;
reactions = undefined ;
c9 = undefined ;
c10 = undefined ;
showResults = undefined ;
let totalVotes ;
2026-07-20 16:05:17 +00:00
let closure_13 ;
let closure_14 ;
2026-07-23 10:11:24 +00:00
let c15 ;
2026-07-20 16:05:17 +00:00
poll = poll . poll ;
if ( null != poll ) {
2026-07-23 10:11:24 +00:00
const currentUser = reactions . getCurrentUser ( ) ;
2026-07-20 16:05:17 +00:00
if ( null != currentUser ) {
2026-07-23 10:11:24 +00:00
useReducedMotion = canSubmitVote . useReducedMotion ;
const channel = hasSelectedAnswer . getChannel ( poll . getChannelId ( ) ) ;
2026-07-20 16:05:17 +00:00
let guildId ;
if ( null != channel ) {
if ( null != channel . getGuildId ) {
guildId = channel . getGuildId ( ) ;
}
}
2026-07-23 10:11:24 +00:00
let obj1 = flag ( layout_type [ 15 ] ) ;
2026-07-20 16:05:17 +00:00
( { answers , layout_type } = poll ) ;
obj = { formattedExpirationLabel : tmp } ;
const avatarUrl = obj1 . getAvatarUrl ( currentUser , guildId ) ;
2026-07-23 10:11:24 +00:00
let tmp8 = computeBasicPollChatData ( poll , arg1 , obj ) ;
2026-07-20 16:05:17 +00:00
if ( null != tmp8 ) {
( { canTapAnswers , canSubmitVote } = tmp8 ) ;
( { expirationLabel , canRemoveVote , canShowVoteCounts } = tmp8 ) ;
if ( undefined === expirationLabel ) {
2026-07-23 10:11:24 +00:00
let intl = flag ( layout_type [ 16 ] ) . intl ;
expirationLabel = intl . string ( flag ( layout_type [ 16 ] ) . t [ "e+J3JZ" ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
hasSelectedAnswer = tmp8 . hasSelectedAnswer ;
hasVoted = tmp8 . hasVoted ;
2026-07-20 16:05:17 +00:00
( { isEditingVote , isExpired } = tmp8 ) ;
( { isInteractive , reactions } = tmp8 ) ;
2026-07-23 10:11:24 +00:00
( { selectedAnswerIds : c9 , submitting : c10 , tapShouldOpenVotersModal , showResults } = tmp8 ) ;
let obj3 = flag ( layout_type [ 17 ] ) ;
totalVotes = obj3 . getTotalVotes ( reactions ) ;
const intl2 = flag ( layout_type [ 16 ] ) . intl ;
2026-07-20 16:05:17 +00:00
obj = { count : totalVotes } ;
2026-07-23 10:11:24 +00:00
closure_13 = intl2 . formatToPlainString ( flag ( layout_type [ 16 ] ) . t . XRkuof , obj ) ;
2026-07-20 16:05:17 +00:00
const _Math = Math ;
const items = [ ] ;
HermesBuiltin . arraySpread ( answers . map ( ( answer_id ) = > {
const tmp = callback ( reactions , "" + answer_id . answer_id ) ;
let vote ;
if ( null != tmp ) {
const count_details = tmp . count_details ;
if ( null != count_details ) {
vote = count_details . vote ;
}
}
let num = 0 ;
if ( null != vote ) {
num = vote ;
}
return num ;
} ) , 0 ) ;
const _Math2 = Math ;
closure_14 = HermesBuiltin . apply ( items , Math ) ;
const mapped = answers . map ( ( answer_id ) = > {
const combined = "" + answer_id . answer_id ;
const tmp2 = callback ( reactions , combined ) ;
let vote ;
if ( null != tmp2 ) {
const count_details = tmp2 . count_details ;
if ( null != count_details ) {
vote = count_details . vote ;
}
}
let num = 0 ;
if ( null != vote ) {
num = vote ;
}
let num2 = 0 ;
if ( 0 !== totalVotes ) {
num2 = num / totalVotes ;
}
2026-07-23 10:11:24 +00:00
const hasItem = _undefined . has ( combined ) ;
2026-07-20 16:05:17 +00:00
let tmp7 = hasVoted ;
if ( hasVoted ) {
let me_vote ;
if ( null != tmp2 ) {
me_vote = tmp2 . me_vote ;
}
tmp7 = null != me_vote ;
const tmp8 = me_vote ;
}
if ( tmp7 ) {
tmp7 = tmp8 ;
}
let obj = { didSelfVote : tmp7 , hasVoted , isExpired , isSelected : hasItem , isLeader : num >= callback && 0 !== num , showResults } ;
2026-07-23 10:11:24 +00:00
const match = flag ( layout_type [ 8 ] ) . match ( obj ) ;
const str = flag ( layout_type [ 8 ] ) ;
const withResult = match . with ( { isExpired : true , isLeader : true , didSelfVote : true } , ( ) = > "victorSelected" ) ;
const withResult1 = match . with ( { isExpired : true , isLeader : true , didSelfVote : true } , ( ) = > "victorSelected" ) . with ( { isExpired : true , isLeader : true , didSelfVote : false } , ( ) = > "victorNotSelected" ) ;
const withResult2 = match . with ( { isExpired : true , isLeader : true , didSelfVote : true } , ( ) = > "victorSelected" ) . with ( { isExpired : true , isLeader : true , didSelfVote : false } , ( ) = > "victorNotSelected" ) . with ( { isExpired : true , didSelfVote : true } , ( ) = > "loserSelected" ) ;
const withResult3 = match . with ( { isExpired : true , isLeader : true , didSelfVote : true } , ( ) = > "victorSelected" ) . with ( { isExpired : true , isLeader : true , didSelfVote : false } , ( ) = > "victorNotSelected" ) . with ( { isExpired : true , didSelfVote : true } , ( ) = > "loserSelected" ) . with ( { isExpired : true } , ( ) = > "notVoted" ) ;
const withResult4 = match . with ( { isExpired : true , isLeader : true , didSelfVote : true } , ( ) = > "victorSelected" ) . with ( { isExpired : true , isLeader : true , didSelfVote : false } , ( ) = > "victorNotSelected" ) . with ( { isExpired : true , didSelfVote : true } , ( ) = > "loserSelected" ) . with ( { isExpired : true } , ( ) = > "notVoted" ) . with ( { didSelfVote : true , isExpired : false } , ( ) = > "voted" ) ;
const withResult5 = match . with ( { isExpired : true , isLeader : true , didSelfVote : true } , ( ) = > "victorSelected" ) . with ( { isExpired : true , isLeader : true , didSelfVote : false } , ( ) = > "victorNotSelected" ) . with ( { isExpired : true , didSelfVote : true } , ( ) = > "loserSelected" ) . with ( { isExpired : true } , ( ) = > "notVoted" ) . with ( { didSelfVote : true , isExpired : false } , ( ) = > "voted" ) . with ( { hasVoted : true , isExpired : false } , ( ) = > "notVoted" ) ;
const withResult6 = match . with ( { isExpired : true , isLeader : true , didSelfVote : true } , ( ) = > "victorSelected" ) . with ( { isExpired : true , isLeader : true , didSelfVote : false } , ( ) = > "victorNotSelected" ) . with ( { isExpired : true , didSelfVote : true } , ( ) = > "loserSelected" ) . with ( { isExpired : true } , ( ) = > "notVoted" ) . with ( { didSelfVote : true , isExpired : false } , ( ) = > "voted" ) . with ( { hasVoted : true , isExpired : false } , ( ) = > "notVoted" ) . with ( { isSelected : true } , ( ) = > "selected" ) ;
2026-07-20 16:05:17 +00:00
obj = { answerId : combined } ;
obj = { text : answer_id.poll_media.text } ;
const obj1 = { animateEmoji : num } ;
2026-07-23 10:11:24 +00:00
const withResult7 = match . with ( { isExpired : true , isLeader : true , didSelfVote : true } , ( ) = > "victorSelected" ) . with ( { isExpired : true , isLeader : true , didSelfVote : false } , ( ) = > "victorNotSelected" ) . with ( { isExpired : true , didSelfVote : true } , ( ) = > "loserSelected" ) . with ( { isExpired : true } , ( ) = > "notVoted" ) . with ( { didSelfVote : true , isExpired : false } , ( ) = > "voted" ) . with ( { hasVoted : true , isExpired : false } , ( ) = > "notVoted" ) . with ( { isSelected : true } , ( ) = > "selected" ) . with ( { isExpired : false , showResults : true } , ( ) = > "notVoted" ) ;
obj . emoji = _undefined2 ( answer_id . poll_media . emoji , obj1 ) ;
2026-07-20 16:05:17 +00:00
obj . stickerId = answer_id . poll_media . sticker_id ;
obj . attachmentIds = answer_id . poll_media . attachment_ids ;
obj . pollMedia = obj ;
obj . isSelected = hasItem ;
let tmp11 = isExpired ;
if ( isExpired ) {
tmp11 = tmp6 ;
}
obj . isVictor = tmp11 ;
obj . didSelfVote = tmp7 ;
2026-07-23 10:11:24 +00:00
obj . style = match . with ( { isExpired : true , isLeader : true , didSelfVote : true } , ( ) = > "victorSelected" ) . with ( { isExpired : true , isLeader : true , didSelfVote : false } , ( ) = > "victorNotSelected" ) . with ( { isExpired : true , didSelfVote : true } , ( ) = > "loserSelected" ) . with ( { isExpired : true } , ( ) = > "notVoted" ) . with ( { didSelfVote : true , isExpired : false } , ( ) = > "voted" ) . with ( { hasVoted : true , isExpired : false } , ( ) = > "notVoted" ) . with ( { isSelected : true } , ( ) = > "selected" ) . with ( { isExpired : false , showResults : true } , ( ) = > "notVoted" ) . otherwise ( ( ) = > "normalVote" ) ;
let tmp12 = c10 ;
if ( c10 ) {
2026-07-20 16:05:17 +00:00
tmp12 = ! useReducedMotion ;
}
obj . shouldAnimateTransition = tmp12 ;
obj . votesPercentage = Math . round ( 100 * num2 ) ;
2026-07-23 10:11:24 +00:00
const otherwiseResult = match . with ( { isExpired : true , isLeader : true , didSelfVote : true } , ( ) = > "victorSelected" ) . with ( { isExpired : true , isLeader : true , didSelfVote : false } , ( ) = > "victorNotSelected" ) . with ( { isExpired : true , didSelfVote : true } , ( ) = > "loserSelected" ) . with ( { isExpired : true } , ( ) = > "notVoted" ) . with ( { didSelfVote : true , isExpired : false } , ( ) = > "voted" ) . with ( { hasVoted : true , isExpired : false } , ( ) = > "notVoted" ) . with ( { isSelected : true } , ( ) = > "selected" ) . with ( { isExpired : false , showResults : true } , ( ) = > "notVoted" ) . otherwise ( ( ) = > "normalVote" ) ;
const match1 = flag ( layout_type [ 8 ] ) . match ( layout_type ) ;
const str2 = flag ( layout_type [ 8 ] ) ;
obj . votes = match1 . with ( flag ( layout_type [ 18 ] ) . PollLayoutTypes . IMAGE_ONLY_ANSWERS , ( ) = > "(" + num . toLocaleString ( ) + ")" ) . otherwise ( ( ) = > {
const intl = flag ( layout_type [ 16 ] ) . intl ;
return intl . formatToPlainString ( flag ( layout_type [ 16 ] ) . t . XRkuof , { count : num } ) ;
2026-07-20 16:05:17 +00:00
} ) ;
return obj ;
} ) ;
obj1 = { isExpired , canSubmitVote , hasVoted , isEditingVote , canRemoveVote , isInteractive , showResults } ;
2026-07-23 10:11:24 +00:00
let match = flag ( layout_type [ 8 ] ) . match ( obj1 ) ;
2026-07-20 16:05:17 +00:00
const obj2 = { isInteractive : false } ;
2026-07-23 10:11:24 +00:00
let str2 = flag ( layout_type [ 8 ] ) ;
2026-07-20 16:05:17 +00:00
obj3 = { isExpired : true } ;
2026-07-23 10:11:24 +00:00
let withResult = match . with ( obj2 , ( ) = > {
2026-07-20 16:05:17 +00:00
} ) ;
const obj4 = { isEditingVote : true } ;
2026-07-23 10:11:24 +00:00
let withResult1 = match . with ( obj2 , ( ) = > {
2026-07-20 16:05:17 +00:00
} ) . with ( obj3 , ( ) = > {
} ) ;
const obj5 = { canRemoveVote : true } ;
2026-07-23 10:11:24 +00:00
let withResult2 = match . with ( obj2 , ( ) = > {
2026-07-20 16:05:17 +00:00
} ) . with ( obj3 , ( ) = > {
} ) . with ( obj4 , ( ) = > {
const obj = { } ;
const intl = flag ( layout_type [ 16 ] ) . intl ;
obj . label = intl . string ( flag ( layout_type [ 16 ] ) . t . JwkNU4 ) ;
obj . presentation = "button" ;
obj . enabled = hasSelectedAnswer ;
obj . type = "submit" ;
return obj ;
} ) ;
2026-07-23 10:11:24 +00:00
let withResult3 = match . with ( obj2 , ( ) = > {
2026-07-20 16:05:17 +00:00
} ) . with ( obj3 , ( ) = > {
} ) . with ( obj4 , ( ) = > {
const obj = { } ;
const intl = flag ( layout_type [ 16 ] ) . intl ;
obj . label = intl . string ( flag ( layout_type [ 16 ] ) . t . JwkNU4 ) ;
obj . presentation = "button" ;
obj . enabled = hasSelectedAnswer ;
obj . type = "submit" ;
return obj ;
} ) . with ( obj5 , ( ) = > {
2026-07-23 10:11:24 +00:00
const obj = { label : null , presentation : "secondaryButton" , enabled : true , type : "remove" } ;
2026-07-20 16:05:17 +00:00
const intl = flag ( layout_type [ 16 ] ) . intl ;
obj . label = intl . string ( flag ( layout_type [ 16 ] ) . t . XhQEh8 ) ;
return obj ;
} ) ;
2026-07-23 10:11:24 +00:00
let withResult4 = match . with ( obj2 , ( ) = > {
2026-07-20 16:05:17 +00:00
} ) . with ( obj3 , ( ) = > {
} ) . with ( obj4 , ( ) = > {
const obj = { } ;
const intl = flag ( layout_type [ 16 ] ) . intl ;
obj . label = intl . string ( flag ( layout_type [ 16 ] ) . t . JwkNU4 ) ;
obj . presentation = "button" ;
obj . enabled = hasSelectedAnswer ;
obj . type = "submit" ;
return obj ;
} ) . with ( obj5 , ( ) = > {
2026-07-23 10:11:24 +00:00
const obj = { label : null , presentation : "secondaryButton" , enabled : true , type : "remove" } ;
2026-07-20 16:05:17 +00:00
const intl = flag ( layout_type [ 16 ] ) . intl ;
obj . label = intl . string ( flag ( layout_type [ 16 ] ) . t . XhQEh8 ) ;
return obj ;
2026-07-23 10:11:24 +00:00
} ) . with ( { hasVoted : false , showResults : true } , ( ) = > {
const obj = { label : null , presentation : "secondaryButton" , enabled : true , type : "showVotes" } ;
2026-07-20 16:05:17 +00:00
const intl = flag ( layout_type [ 16 ] ) . intl ;
obj . label = intl . string ( flag ( layout_type [ 16 ] ) . t . gNj6In ) ;
return obj ;
} ) ;
2026-07-23 10:11:24 +00:00
let obj16 = flag ( layout_type [ 19 ] ) ;
let otherwiseResult = match . with ( obj2 , ( ) = > {
2026-07-20 16:05:17 +00:00
} ) . with ( obj3 , ( ) = > {
} ) . with ( obj4 , ( ) = > {
const obj = { } ;
const intl = flag ( layout_type [ 16 ] ) . intl ;
obj . label = intl . string ( flag ( layout_type [ 16 ] ) . t . JwkNU4 ) ;
obj . presentation = "button" ;
obj . enabled = hasSelectedAnswer ;
obj . type = "submit" ;
return obj ;
} ) . with ( obj5 , ( ) = > {
2026-07-23 10:11:24 +00:00
const obj = { label : null , presentation : "secondaryButton" , enabled : true , type : "remove" } ;
2026-07-20 16:05:17 +00:00
const intl = flag ( layout_type [ 16 ] ) . intl ;
obj . label = intl . string ( flag ( layout_type [ 16 ] ) . t . XhQEh8 ) ;
return obj ;
2026-07-23 10:11:24 +00:00
} ) . with ( { hasVoted : false , showResults : true } , ( ) = > {
const obj = { label : null , presentation : "secondaryButton" , enabled : true , type : "showVotes" } ;
2026-07-20 16:05:17 +00:00
const intl = flag ( layout_type [ 16 ] ) . intl ;
obj . label = intl . string ( flag ( layout_type [ 16 ] ) . t . gNj6In ) ;
return obj ;
} ) . otherwise ( ( ) = > {
const obj = { } ;
const intl = flag ( layout_type [ 16 ] ) . intl ;
obj . label = intl . string ( flag ( layout_type [ 16 ] ) . t . JwkNU4 ) ;
obj . presentation = "button" ;
obj . enabled = canSubmitVote ;
obj . type = "submit" ;
return obj ;
} ) ;
2026-07-23 10:11:24 +00:00
const intl3 = flag ( layout_type [ 16 ] ) . intl ;
2026-07-20 16:05:17 +00:00
const string = intl3 . string ;
2026-07-23 10:11:24 +00:00
const t = flag ( layout_type [ 16 ] ) . t ;
2026-07-20 16:05:17 +00:00
if ( isIOSResult ) {
2026-07-23 10:11:24 +00:00
let stringResult = string ( t [ "PVATM/" ] ) ;
2026-07-20 16:05:17 +00:00
} else {
stringResult = string ( t . cHfFql ) ;
}
2026-07-23 10:11:24 +00:00
c15 = stringResult ;
isIOSResult = obj16 . isIOS ( ) ;
2026-07-20 16:05:17 +00:00
const obj6 = { isExpired , isInteractive , isEditingVote } ;
2026-07-23 10:11:24 +00:00
let match1 = flag ( layout_type [ 8 ] ) . match ( obj6 ) ;
const str3 = flag ( layout_type [ 8 ] ) ;
2026-07-20 16:05:17 +00:00
const obj7 = { isEditingVote : true } ;
2026-07-23 10:11:24 +00:00
let withResult5 = match1 . with ( { isInteractive : false , isExpired : false } , ( ) = > {
const obj = { label : null , presentation : "text" , enabled : false } ;
2026-07-20 16:05:17 +00:00
const intl = flag ( layout_type [ 16 ] ) . intl ;
obj . label = intl . string ( flag ( layout_type [ 16 ] ) . t . trrip0 ) ;
return obj ;
} ) ;
let tmp28 ;
2026-07-23 10:11:24 +00:00
let withResult6 = match1 . with ( { isInteractive : false , isExpired : false } , ( ) = > {
const obj = { label : null , presentation : "text" , enabled : false } ;
2026-07-20 16:05:17 +00:00
const intl = flag ( layout_type [ 16 ] ) . intl ;
obj . label = intl . string ( flag ( layout_type [ 16 ] ) . t . trrip0 ) ;
return obj ;
} ) . with ( obj7 , ( ) = > {
2026-07-23 10:11:24 +00:00
const obj = { label : null , presentation : "textButton" , enabled : true , type : "cancel" } ;
2026-07-20 16:05:17 +00:00
const intl = flag ( layout_type [ 16 ] ) . intl ;
2026-07-23 10:11:24 +00:00
obj . label = intl . string ( flag ( layout_type [ 16 ] ) . t [ "ETE/oC" ] ) ;
2026-07-20 16:05:17 +00:00
return obj ;
} ) ;
if ( isInteractive ) {
if ( ! isExpired ) {
if ( ! hasVoted ) {
if ( ! showResults ) {
2026-07-23 10:11:24 +00:00
const obj8 = { label : null , presentation : "textButton" , enabled : true , type : "showVotes" } ;
const intl4 = flag ( layout_type [ 16 ] ) . intl ;
obj8 . label = intl4 . string ( flag ( layout_type [ 16 ] ) . t [ "/KHAUF" ] ) ;
2026-07-20 16:05:17 +00:00
tmp28 = obj8 ;
}
}
}
}
const allow_multiselect = poll . allow_multiselect ;
2026-07-23 10:11:24 +00:00
const otherwiseResult1 = match1 . with ( { isInteractive : false , isExpired : false } , ( ) = > {
const obj = { label : null , presentation : "text" , enabled : false } ;
2026-07-20 16:05:17 +00:00
const intl = flag ( layout_type [ 16 ] ) . intl ;
obj . label = intl . string ( flag ( layout_type [ 16 ] ) . t . trrip0 ) ;
return obj ;
} ) . with ( obj7 , ( ) = > {
2026-07-23 10:11:24 +00:00
const obj = { label : null , presentation : "textButton" , enabled : true , type : "cancel" } ;
2026-07-20 16:05:17 +00:00
const intl = flag ( layout_type [ 16 ] ) . intl ;
2026-07-23 10:11:24 +00:00
obj . label = intl . string ( flag ( layout_type [ 16 ] ) . t [ "ETE/oC" ] ) ;
2026-07-20 16:05:17 +00:00
return obj ;
2026-07-23 10:11:24 +00:00
} ) . otherwise ( ( ) = > {
const obj = { label : closure_13 , secondaryLabel : expirationLabel , accessibilityHint : c15 , presentation : "text" , enabled : true , type : "showVoterDetails" } ;
return obj ;
} ) ;
2026-07-20 16:05:17 +00:00
const obj9 = { isInteractive , isExpired , canSelectMultipleAnswers : allow_multiselect } ;
2026-07-23 10:11:24 +00:00
const match2 = flag ( layout_type [ 8 ] ) . match ( obj9 ) ;
2026-07-20 16:05:17 +00:00
const obj10 = { isInteractive : false } ;
2026-07-23 10:11:24 +00:00
const str4 = flag ( layout_type [ 8 ] ) ;
2026-07-20 16:05:17 +00:00
const obj11 = { isExpired : true } ;
2026-07-23 10:11:24 +00:00
let withResult7 = match2 . with ( obj10 , ( ) = > {
2026-07-20 16:05:17 +00:00
} ) ;
const obj12 = { canSelectMultipleAnswers : true } ;
const withResult8 = match2 . with ( obj10 , ( ) = > {
} ) . with ( obj11 , ( ) = > {
} ) ;
const obj13 = {
question : poll.question ,
promptLabel : match2.with ( obj10 , ( ) = > {
} ) . with ( obj11 , ( ) = > {
} ) . with ( obj12 , ( ) = > {
const intl = flag ( layout_type [ 16 ] ) . intl ;
return intl . string ( flag ( layout_type [ 16 ] ) . t . yCXvxa ) ;
} ) . otherwise ( ( ) = > {
const intl = flag ( layout_type [ 16 ] ) . intl ;
2026-07-23 10:11:24 +00:00
return intl . string ( flag ( layout_type [ 16 ] ) . t [ "9Y2wKO" ] ) ;
2026-07-20 16:05:17 +00:00
} ) ,
answers : mapped
} ;
const withResult9 = match2 . with ( obj10 , ( ) = > {
} ) . with ( obj11 , ( ) = > {
} ) . with ( obj12 , ( ) = > {
const intl = flag ( layout_type [ 16 ] ) . intl ;
return intl . string ( flag ( layout_type [ 16 ] ) . t . yCXvxa ) ;
} ) ;
const obj14 = { tapShouldOpenVotersModal , canTapAnswers , canSelectMultipleAnswers : allow_multiselect } ;
2026-07-23 10:11:24 +00:00
const match3 = flag ( layout_type [ 8 ] ) . match ( obj14 ) ;
2026-07-20 16:05:17 +00:00
const obj15 = { tapShouldOpenVotersModal : true } ;
2026-07-23 10:11:24 +00:00
const str5 = flag ( layout_type [ 8 ] ) ;
2026-07-20 16:05:17 +00:00
obj16 = { canTapAnswers : false } ;
const withResult10 = match3 . with ( obj15 , ( ) = > flag ( layout_type [ 20 ] ) . PollChatAnswerInteractionType . LIST ) ;
const obj17 = { canSelectMultipleAnswers : false } ;
const withResult11 = match3 . with ( obj15 , ( ) = > flag ( layout_type [ 20 ] ) . PollChatAnswerInteractionType . LIST ) . with ( obj16 , ( ) = > flag ( layout_type [ 20 ] ) . PollChatAnswerInteractionType . LIST ) ;
const obj18 = { canSelectMultipleAnswers : true } ;
const withResult12 = match3 . with ( obj15 , ( ) = > flag ( layout_type [ 20 ] ) . PollChatAnswerInteractionType . LIST ) . with ( obj16 , ( ) = > flag ( layout_type [ 20 ] ) . PollChatAnswerInteractionType . LIST ) . with ( obj17 , ( ) = > flag ( layout_type [ 20 ] ) . PollChatAnswerInteractionType . RADIO_BUTTONS ) ;
obj13 . answersInteraction = match3 . with ( obj15 , ( ) = > flag ( layout_type [ 20 ] ) . PollChatAnswerInteractionType . LIST ) . with ( obj16 , ( ) = > flag ( layout_type [ 20 ] ) . PollChatAnswerInteractionType . LIST ) . with ( obj17 , ( ) = > flag ( layout_type [ 20 ] ) . PollChatAnswerInteractionType . RADIO_BUTTONS ) . with ( obj18 , ( ) = > flag ( layout_type [ 20 ] ) . PollChatAnswerInteractionType . CHECKBOXES ) . exhaustive ( ) ;
let tmp33 ;
if ( tapShouldOpenVotersModal ) {
tmp33 = stringResult ;
}
obj13 . answerTapAccessibilityLabel = tmp33 ;
obj13 . layoutType = layout_type ;
const obj19 = { theme : str , layoutType : layout_type } ;
2026-07-23 10:11:24 +00:00
obj13 . resources = useReducedMotion ( layout_type [ 21 ] ) ( obj19 ) ;
2026-07-20 16:05:17 +00:00
obj13 . containerStyle = "normal" ;
obj13 . primaryAction = otherwiseResult ;
obj13 . isInteractive = isInteractive ;
obj13 . canTapAnswers = canTapAnswers ;
obj13 . canSelectMultipleAnswers = allow_multiselect ;
obj13 . hasSelectedAnswer = hasSelectedAnswer ;
obj13 . canShowVoteCounts = canShowVoteCounts ;
obj13 . hasVoted = hasVoted ;
obj13 . isExpired = isExpired ;
obj13 . myAvatarUrl = avatarUrl ;
obj13 . secondaryAction = otherwiseResult1 ;
obj13 . tertiaryAction = tmp28 ;
return obj13 ;
}
}
}
} ;
export { reactionForId } ;
export { isPollMessageDirectlyInteractive } ;
export { computeBasicPollChatData } ;