var CLSTAMP = "8811541";
(() => {
var e,
t,
n,
i,
o,
r = {
3119: (e, t, n) => {
var i = {
"./friendsui_arabic.json": [58480, 6992],
"./friendsui_brazilian.json": [33109, 2862],
"./friendsui_bulgarian.json": [5242, 8518],
"./friendsui_czech.json": [98399, 4448],
"./friendsui_danish.json": [34581, 9775],
"./friendsui_dutch.json": [27904, 7575],
"./friendsui_english.json": [67927, 8247],
"./friendsui_finnish.json": [63907, 4596],
"./friendsui_french.json": [49877, 3500],
"./friendsui_german.json": [90262, 4989],
"./friendsui_greek.json": [84583, 1471],
"./friendsui_hungarian.json": [85581, 5802],
"./friendsui_indonesian.json": [37371, 6646],
"./friendsui_italian.json": [31577, 8815],
"./friendsui_japanese.json": [86521, 6727],
"./friendsui_koreana.json": [73827, 6986],
"./friendsui_latam.json": [13236, 7651],
"./friendsui_norwegian.json": [19181, 4716],
"./friendsui_polish.json": [3751, 699],
"./friendsui_portuguese.json": [21520, 4264],
"./friendsui_romanian.json": [98235, 3182],
"./friendsui_russian.json": [99942, 2913],
"./friendsui_sc_schinese.json": [64522, 3140],
"./friendsui_schinese.json": [19456, 7706],
"./friendsui_spanish.json": [12011, 3471],
"./friendsui_swedish.json": [66100, 9818],
"./friendsui_tchinese.json": [74628, 7340],
"./friendsui_thai.json": [88902, 9263],
"./friendsui_turkish.json": [95797, 5632],
"./friendsui_ukrainian.json": [83292, 2822],
"./friendsui_vietnamese.json": [39248, 1635],
};
function o(e) {
if (!n.o(i, e))
return Promise.resolve().then(() => {
var t = new Error("Cannot find module '" + e + "'");
throw ((t.code = "MODULE_NOT_FOUND"), t);
});
var t = i[e],
o = t[0];
return n.e(t[1]).then(() => n.t(o, 19));
}
(o.keys = () => Object.keys(i)), (o.id = 3119), (e.exports = o);
},
9014: (e, t, n) => {
var i = {
"./friendsui_arabic.json": [58480, 6992],
"./friendsui_brazilian.json": [33109, 2862],
"./friendsui_bulgarian.json": [5242, 8518],
"./friendsui_czech.json": [98399, 4448],
"./friendsui_danish.json": [34581, 9775],
"./friendsui_dutch.json": [27904, 7575],
"./friendsui_english.json": [67927, 8247],
"./friendsui_finnish.json": [63907, 4596],
"./friendsui_french.json": [49877, 3500],
"./friendsui_german.json": [90262, 4989],
"./friendsui_greek.json": [84583, 1471],
"./friendsui_hungarian.json": [85581, 5802],
"./friendsui_indonesian.json": [37371, 6646],
"./friendsui_italian.json": [31577, 8815],
"./friendsui_japanese.json": [86521, 6727],
"./friendsui_koreana.json": [73827, 6986],
"./friendsui_latam.json": [13236, 7651],
"./friendsui_norwegian.json": [19181, 4716],
"./friendsui_polish.json": [3751, 699],
"./friendsui_portuguese.json": [21520, 4264],
"./friendsui_romanian.json": [98235, 3182],
"./friendsui_russian.json": [99942, 2913],
"./friendsui_sc_schinese.json": [64522, 3140],
"./friendsui_schinese.json": [19456, 7706],
"./friendsui_spanish.json": [12011, 3471],
"./friendsui_swedish.json": [66100, 9818],
"./friendsui_tchinese.json": [74628, 7340],
"./friendsui_thai.json": [88902, 9263],
"./friendsui_turkish.json": [95797, 5632],
"./friendsui_ukrainian.json": [83292, 2822],
"./friendsui_vietnamese.json": [39248, 1635],
};
function o(e) {
if (!n.o(i, e))
return Promise.resolve().then(() => {
var t = new Error("Cannot find module '" + e + "'");
throw ((t.code = "MODULE_NOT_FOUND"), t);
});
var t = i[e],
o = t[0];
return n.e(t[1]).then(() => n.t(o, 19));
}
(o.keys = () => Object.keys(i)), (o.id = 9014), (e.exports = o);
},
27385: (e) => {
e.exports = { "duration-app-launch": "800ms" };
},
44550: (e) => {
e.exports = {
"duration-app-launch": "800ms",
ChatMessageSteamStore_Failed: "bbcode_ChatMessageSteamStore_Failed_POkia",
ChatMessageSteamStore: "bbcode_ChatMessageSteamStore_tdVvE",
ChatMessagesSteamStore_FilteredContent: "bbcode_ChatMessagesSteamStore_FilteredContent_3D-qb",
TinyContent: "bbcode_TinyContent_2nHeA",
ChatMessageSteamStore_HeaderImage: "bbcode_ChatMessageSteamStore_HeaderImage_2TxYr",
Blurred: "bbcode_Blurred_1PTbG",
SmallContent: "bbcode_SmallContent_1jJqS",
MediumContent: "bbcode_MediumContent_qWPvC",
ChatMessageSteamStore_GameDetails: "bbcode_ChatMessageSteamStore_GameDetails_2lHQv",
ChatMessageSteamStore_MediaContainer: "bbcode_ChatMessageSteamStore_MediaContainer_E2ikP",
ChatMessageSteamStore_MainMedia: "bbcode_ChatMessageSteamStore_MainMedia_3N2Lb",
senderName: "bbcode_senderName_vnEqe",
URLSent: "bbcode_URLSent_3emIc",
SteamURL: "bbcode_SteamURL_l55fo",
ChatMessageSteamStore_Name: "bbcode_ChatMessageSteamStore_Name_ihXhe",
ChatMessageSteamStore_GameNameAndIcon: "bbcode_ChatMessageSteamStore_GameNameAndIcon_4GpSr",
ChatMessageSteamStore_Header: "bbcode_ChatMessageSteamStore_Header_2KIJQ",
ChatMessageSteamStore_HeaderImageFiltered: "bbcode_ChatMessageSteamStore_HeaderImageFiltered_3mT9j",
ChatMessageSteamStore_Description: "bbcode_ChatMessageSteamStore_Description_2-RDz",
ChatMessageSteamStore_FilteredDescription: "bbcode_ChatMessageSteamStore_FilteredDescription_2ck_R",
ChatMessageSteamStore_GameIcon: "bbcode_ChatMessageSteamStore_GameIcon_1F9xl",
ChatMessageSteamStore_Body: "bbcode_ChatMessageSteamStore_Body_2VE1v",
ChatMessageSteamStore_DetailsContainer: "bbcode_ChatMessageSteamStore_DetailsContainer_3gcwY",
ChatMessageSteamStore_VideoThumbnail: "bbcode_ChatMessageSteamStore_VideoThumbnail_3I1zl",
ChatMessageSteamStore_ThumbnailsContainer: "bbcode_ChatMessageSteamStore_ThumbnailsContainer_34Rxn",
ChatMessageSteamStore_Screenshot: "bbcode_ChatMessageSteamStore_Screenshot_3qmZW",
ChatMessageSteamStore_ScreenshotThumbnail: "bbcode_ChatMessageSteamStore_ScreenshotThumbnail_2dT1V",
videoPlaying: "bbcode_videoPlaying_RHKEP",
ChatMessageSteamStore_VideoPlayButton: "bbcode_ChatMessageSteamStore_VideoPlayButton_hvkD1",
ChatMessageSteamStore_VideoLargeContainer: "bbcode_ChatMessageSteamStore_VideoLargeContainer_1WCdP",
ChatMessageSteamStore_VideoLarge: "bbcode_ChatMessageSteamStore_VideoLarge_-Ge8B",
ChatMessageSteamStore_Footer: "bbcode_ChatMessageSteamStore_Footer_EuKJj",
ChatMessageSteamStore_PricingContainer: "bbcode_ChatMessageSteamStore_PricingContainer_23NxJ",
ChatMessageSteamStore_Pricing: "bbcode_ChatMessageSteamStore_Pricing_3qTYl",
ChatMessageSteamStore_Pricing_Discount: "bbcode_ChatMessageSteamStore_Pricing_Discount_2u76T",
ChatMessageSteamStore_Pricing_FinalContainer: "bbcode_ChatMessageSteamStore_Pricing_FinalContainer_1ZFsy",
ChatMessageSteamStore_Pricing_Final: "bbcode_ChatMessageSteamStore_Pricing_Final_1Nn_P",
hasDiscount: "bbcode_hasDiscount_t5udJ",
ChatMessageSteamStore_Pricing_Initial: "bbcode_ChatMessageSteamStore_Pricing_Initial_2jXsq",
ChatMessageSteamStore_ViewStore: "bbcode_ChatMessageSteamStore_ViewStore_2SBI6",
ChatMessageSteamStore_Free: "bbcode_ChatMessageSteamStore_Free_rJaoz",
ChatMessageSteamStore_CopyURL: "bbcode_ChatMessageSteamStore_CopyURL_FLbi2",
ChatMessageTweet: "bbcode_ChatMessageTweet_xuMZ3",
ChatMessageTweet_Header: "bbcode_ChatMessageTweet_Header_38ujm",
ChatMessageTweet_ProfileImage: "bbcode_ChatMessageTweet_ProfileImage_zx9vf",
ChatMessageTweet_NameSection: "bbcode_ChatMessageTweet_NameSection_-lb62",
ChatMessageTweet_NameGroup: "bbcode_ChatMessageTweet_NameGroup_pjf4e",
ChatMessageTweet_Name: "bbcode_ChatMessageTweet_Name_1lQ98",
ChatMessageTweet_Logo: "bbcode_ChatMessageTweet_Logo_3WqG0",
ChatMessageTweet_Verified: "bbcode_ChatMessageTweet_Verified_2gPBN",
ChatMessageTweet_ScreenName: "bbcode_ChatMessageTweet_ScreenName_3VjS6",
ChatMessageTweet_Body: "bbcode_ChatMessageTweet_Body_1RFo5",
ChatMessageTweet_Footer: "bbcode_ChatMessageTweet_Footer_35Jlr",
ChatMessageTweet_Created: "bbcode_ChatMessageTweet_Created_shGvL",
numberCounterContainer: "bbcode_numberCounterContainer_C4Hz0",
numberColumn: "bbcode_numberColumn_2enY9",
randomNumberLabel: "bbcode_randomNumberLabel_2-fsM",
randomActual: "bbcode_randomActual_1EGTO",
randomNumberShadow: "bbcode_randomNumberShadow_19_KK",
startingZero: "bbcode_startingZero_1kHyX",
randomMsg: "bbcode_randomMsg_13nuz",
MsgAnimating: "bbcode_MsgAnimating_1yiaq",
none: "bbcode_none_3CUw2",
randomValues: "bbcode_randomValues_4j8MC",
coinLabel: "bbcode_coinLabel_dj-Tq",
CoinModel: "bbcode_CoinModel_1YPnK",
flipCoinContainer: "bbcode_flipCoinContainer_3piF5",
coinFade: "bbcode_coinFade_3vnZn",
flipCoinAndResult: "bbcode_flipCoinAndResult_1Cjb-",
coin: "bbcode_coin_1NRdX",
front: "bbcode_front_M-4A0",
back: "bbcode_back_VjaUk",
coinFlipBottom: "bbcode_coinFlipBottom_2QVOk",
coinFlipTop: "bbcode_coinFlipTop_YyWbD",
front_b: "bbcode_front_b_J0ttd",
back_b: "bbcode_back_b_2iPGJ",
mid: "bbcode_mid_1nWDG",
coinFace: "bbcode_coinFace_1abwJ",
flipCoinWinningSide: "bbcode_flipCoinWinningSide_1Akyv",
flipCoinLosingSide: "bbcode_flipCoinLosingSide_3Bl0q",
coinFlip: "bbcode_coinFlip_1Jv6_",
resultLabel: "bbcode_resultLabel_1E5Fs",
coinFlipResult: "bbcode_coinFlipResult_19V-m",
plusOne: "bbcode_plusOne_1QO4I",
ImageModalBackground: "bbcode_ImageModalBackground_1feGl",
ImageModalContent: "bbcode_ImageModalContent_gDAHS",
RoomEffectContainer: "bbcode_RoomEffectContainer_1JKUF",
RoomEffectIcon: "bbcode_RoomEffectIcon_3uKYi",
randomNumbers: "bbcode_randomNumbers_1n1A9",
randomNumbers0: "bbcode_randomNumbers0_3QS0S",
randomNumbers1: "bbcode_randomNumbers1_3jFyW",
randomNumbers2: "bbcode_randomNumbers2_20O32",
randomNumbers3: "bbcode_randomNumbers3_zIVdx",
randomNumbers4: "bbcode_randomNumbers4_aYdH6",
randomNumbers5: "bbcode_randomNumbers5_jPYa-",
randomNumbers6: "bbcode_randomNumbers6_2pW0w",
randomNumbers7: "bbcode_randomNumbers7_16G5k",
randomNumbers8: "bbcode_randomNumbers8_3gDn5",
randomNumbers9: "bbcode_randomNumbers9_1TE63",
randomNumbers10: "bbcode_randomNumbers10_2WzZJ",
randomNumbersZero: "bbcode_randomNumbersZero_1LaDI",
coinSpin: "bbcode_coinSpin_2j-M3",
};
},
64179: (e) => {
e.exports = { InviteDropMessage: "invitedrop_InviteDropMessage_2f19f", InviteDropImage: "invitedrop_InviteDropImage_2r81X", InviteDropName: "invitedrop_InviteDropName_3jmXx", InviteDropContainer: "invitedrop_InviteDropContainer_zQt7M", InviteDropBackground: "invitedrop_InviteDropBackground_1JqA8", ChatModalCover: "invitedrop_ChatModalCover_tIAxX", appear: "invitedrop_appear_2qt74", enter: "invitedrop_enter_2uAVr", appearActive: "invitedrop_appearActive_38QQQ", enterActive: "invitedrop_enterActive_22bK-", exit: "invitedrop_exit_1G2Ph", exitActive: "invitedrop_exitActive_ccqOP" };
},
257: (e) => {
e.exports = { PreMessage: "messages_PreMessage_2M4GH", CodeMessage: "messages_CodeMessage_1E4OI", QuoteMessage: "messages_QuoteMessage_3-LVU" };
},
94207: (e) => {
e.exports = { MessageReactions: "reactions_MessageReactions_2AYLk", OpenPickerButton: "reactions_OpenPickerButton_2q3fS", AddReactionIcon: "reactions_AddReactionIcon_ynET7", Plus: "reactions_Plus_1TuQz", MessageReaction: "reactions_MessageReaction_22B6h", EmoticonReaction: "reactions_EmoticonReaction_1NDA4", Large: "reactions_Large_1s0yZ", StickerReaction: "reactions_StickerReaction_2rRhc", ReactionCount: "reactions_ReactionCount_2-mTQ", ReactionHover: "reactions_ReactionHover_12Ox3", HoverDescription: "reactions_HoverDescription_3nUn3", ReactorName: "reactions_ReactorName_1epTJ", ReactionName: "reactions_ReactionName_2bwkm" };
},
10237: (e) => {
e.exports = {
"duration-app-launch": "800ms",
DialogContent_InnerWidth: "chatroom_DialogContent_InnerWidth_3GRWm",
FriendPicker_Focus: "chatroom_FriendPicker_Focus_3qxoN",
FriendRequestViewActive: "chatroom_FriendRequestViewActive_1o-7-",
VoiceRequested: "chatroom_VoiceRequested_1ocVq",
chatRoomGroupHeader: "chatroom_chatRoomGroupHeader_2t--s",
YuleLog: "chatroom_YuleLog_2SldD",
Watching: "chatroom_Watching_18OiO",
VoiceChatQuickChatChannelOption: "chatroom_VoiceChatQuickChatChannelOption_sV-rY",
ManageVoiceChannelsModal: "chatroom_ManageVoiceChannelsModal_1e0x4",
ManageTextChannelsModal: "chatroom_ManageTextChannelsModal_3XLA3",
ManageVoiceChannels: "chatroom_ManageVoiceChannels_ojO_e",
AddVoiceChannelBtn: "chatroom_AddVoiceChannelBtn_1t6E6",
"ItemFocusAnim-darkerGrey": "chatroom_ItemFocusAnim-darkerGrey_3R7Sv",
ChannelStatusLabel: "chatroom_ChannelStatusLabel_3jAZQ",
ChatRoomGroupControlsSteamDeck: "chatroom_ChatRoomGroupControlsSteamDeck_imObP",
currentUserInVoiceChannel: "chatroom_currentUserInVoiceChannel_2TAg1",
HasActiveVoiceRoom: "chatroom_HasActiveVoiceRoom_3leHQ",
VoiceChannelCount: "chatroom_VoiceChannelCount_115TN",
"ItemFocusAnim-darkGrey": "chatroom_ItemFocusAnim-darkGrey_1a6zU",
"ItemFocusAnim-green": "chatroom_ItemFocusAnim-green_w6bcQ",
RightAlignedStats: "chatroom_RightAlignedStats_2sB5U",
MemberCount: "chatroom_MemberCount_2wtcJ",
InGame: "chatroom_InGame_32Voq",
Total: "chatroom_Total_2Zymb",
TextChannelCount: "chatroom_TextChannelCount_13NBA",
ChatRoomGroupControlsFiller: "chatroom_ChatRoomGroupControlsFiller_1Op5Z",
UnreadTextChannel: "chatroom_UnreadTextChannel_KiYpf",
GroupMemberListDialog: "chatroom_GroupMemberListDialog_45AAE",
ChatRoomVoiceInviteDialog: "chatroom_ChatRoomVoiceInviteDialog_3k-p6",
FriendSearchInput: "chatroom_FriendSearchInput_2OcL1",
InviteLists: "chatroom_InviteLists_29o-F",
InviteList: "chatroom_InviteList_3KgQD",
BackgroundAnimation: "chatroom_BackgroundAnimation_225-z",
"ItemFocusAnim-darkerGrey-nocolor": "chatroom_ItemFocusAnim-darkerGrey-nocolor_2SpA2",
"ItemFocusAnim-grey": "chatroom_ItemFocusAnim-grey_3b0vu",
"ItemFocusAnim-translucent-white-10": "chatroom_ItemFocusAnim-translucent-white-10_3sQ7j",
"ItemFocusAnim-translucent-white-20": "chatroom_ItemFocusAnim-translucent-white-20_j2b41",
"ItemFocusAnimBorder-darkGrey": "chatroom_ItemFocusAnimBorder-darkGrey_1gy_j",
};
},
47109: (e) => {
e.exports = { ChatRoomContextNoPermission: "chatroommenu_ChatRoomContextNoPermission_w04cA", SVGIcon_Lock: "chatroommenu_SVGIcon_Lock_2GYOl", ChatroomContextMenuDisableableItem: "chatroommenu_ChatroomContextMenuDisableableItem_wxpoI", DisabledDescriptor: "chatroommenu_DisabledDescriptor_l2_77" };
},
89911: (e) => {
e.exports = {
"duration-app-launch": "800ms",
DialogContent_InnerWidth: "chattabs_DialogContent_InnerWidth_3SFdH",
FriendPicker_Focus: "chattabs_FriendPicker_Focus_2TZpS",
FriendRequestViewActive: "chattabs_FriendRequestViewActive_cWNMu",
VoiceRequested: "chattabs_VoiceRequested_x4Xq_",
chatRoomGroupHeader: "chattabs_chatRoomGroupHeader_33pi7",
ChatTabTransitionGroup: "chattabs_ChatTabTransitionGroup_1GEzX",
ChatTab: "chattabs_ChatTab_2Vrcp",
Active: "chattabs_Active_Lrqoj",
ChatTabTransition_Enter: "chattabs_ChatTabTransition_Enter_2GwaB",
ChatTabTransition_EnterActive: "chattabs_ChatTabTransition_EnterActive_2DmAV",
ChatTabTransition_Exit: "chattabs_ChatTabTransition_Exit_2aLc6",
TabBounce: "chattabs_TabBounce_2PkSl",
ChatTabTransition_ExitActive: "chattabs_ChatTabTransition_ExitActive_pfXry",
VoiceStatusMessage: "chattabs_VoiceStatusMessage_2UhLP",
VoiceActive: "chattabs_VoiceActive_33vMa",
MicMuted: "chattabs_MicMuted_2Sn4b",
MicStatus: "chattabs_MicStatus_30H7N",
CloseButton: "chattabs_CloseButton_7gMwY",
ChatTabRow: "chattabs_ChatTabRow_2TndF",
ChatTabContent_Friend: "chattabs_ChatTabContent_Friend_2ZiZ7",
IsNotFriendLabel: "chattabs_IsNotFriendLabel_2vv7a",
ChatTabContent_ChatRoom: "chattabs_ChatTabContent_ChatRoom_3kJeo",
ChatTabContent_ChatRoomName: "chattabs_ChatTabContent_ChatRoomName_1svcL",
UnreadGlow: "chattabs_UnreadGlow_3oV47",
UnreadCircle: "chattabs_UnreadCircle_52cn_",
BackgroundAnimation: "chattabs_BackgroundAnimation_20GyX",
"ItemFocusAnim-darkerGrey-nocolor": "chattabs_ItemFocusAnim-darkerGrey-nocolor_wLNQI",
"ItemFocusAnim-darkerGrey": "chattabs_ItemFocusAnim-darkerGrey_hzsQQ",
"ItemFocusAnim-darkGrey": "chattabs_ItemFocusAnim-darkGrey_1esdt",
"ItemFocusAnim-grey": "chattabs_ItemFocusAnim-grey_ry028",
"ItemFocusAnim-translucent-white-10": "chattabs_ItemFocusAnim-translucent-white-10_33vsA",
"ItemFocusAnim-translucent-white-20": "chattabs_ItemFocusAnim-translucent-white-20_2nvh8",
"ItemFocusAnimBorder-darkGrey": "chattabs_ItemFocusAnimBorder-darkGrey_1NFKR",
"ItemFocusAnim-green": "chattabs_ItemFocusAnim-green_1-pOQ",
};
},
21658: (e) => {
e.exports = { General: "chatroomgroupsettings_General_8XwlG", Avatar: "chatroomgroupsettings_Avatar_2LpXh", AvatarAndUser: "chatroomgroupsettings_AvatarAndUser_24KH7", NoIconLabel: "chatroomgroupsettings_NoIconLabel_2ZLCb", ChannelsButtons: "chatroomgroupsettings_ChannelsButtons_oAUPW", Notification: "chatroomgroupsettings_Notification_3uem_", LeaveButton: "chatroomgroupsettings_LeaveButton_2qL15", PermissionsEdit: "chatroomgroupsettings_PermissionsEdit_18be2", Back: "chatroomgroupsettings_Back_15FJA", PermissionsGroup: "chatroomgroupsettings_PermissionsGroup_3-iw_", PermissionToggle: "chatroomgroupsettings_PermissionToggle_55say", PermissionsDescription: "chatroomgroupsettings_PermissionsDescription_3volV", RoleNameHeader: "chatroomgroupsettings_RoleNameHeader_33Yxs", FixedRoleName: "chatroomgroupsettings_FixedRoleName_2aLHy" };
},
65040: (e) => {
e.exports = { scrollMaskVertical: "chatroomnotificationsettings_scrollMaskVertical_3tyz6" };
},
98865: (e) => {
e.exports = { DialogTitle: "dialogs_DialogTitle_2dqzN", DialogContent: "dialogs_DialogContent_3yd-p" };
},
51630: (e) => {
e.exports = {
"duration-app-launch": "800ms",
DialogContent_InnerWidth: "pagedcontent_DialogContent_InnerWidth_3bR0Z",
FriendPicker_Focus: "pagedcontent_FriendPicker_Focus_1SF7f",
FriendRequestViewActive: "pagedcontent_FriendRequestViewActive_3R0N_",
VoiceRequested: "pagedcontent_VoiceRequested_1DtjQ",
chatRoomGroupHeader: "pagedcontent_chatRoomGroupHeader_7oNG5",
Container: "pagedcontent_Container_3-t6T",
Nav: "pagedcontent_Nav_1Vqsn",
NavTitle: "pagedcontent_NavTitle_tK0Cu",
NavItems: "pagedcontent_NavItems_1ce4K",
NavItem: "pagedcontent_NavItem_-GYTF",
Active: "pagedcontent_Active_36pPi",
Content: "pagedcontent_Content_2mJpA",
BackgroundAnimation: "pagedcontent_BackgroundAnimation_1XVbj",
"ItemFocusAnim-darkerGrey-nocolor": "pagedcontent_ItemFocusAnim-darkerGrey-nocolor_1vMKF",
"ItemFocusAnim-darkerGrey": "pagedcontent_ItemFocusAnim-darkerGrey_2g_AN",
"ItemFocusAnim-darkGrey": "pagedcontent_ItemFocusAnim-darkGrey_1c2HK",
"ItemFocusAnim-grey": "pagedcontent_ItemFocusAnim-grey_2BLVS",
"ItemFocusAnim-translucent-white-10": "pagedcontent_ItemFocusAnim-translucent-white-10_3TnSz",
"ItemFocusAnim-translucent-white-20": "pagedcontent_ItemFocusAnim-translucent-white-20_1C2QC",
"ItemFocusAnimBorder-darkGrey": "pagedcontent_ItemFocusAnimBorder-darkGrey_OpVxu",
"ItemFocusAnim-green": "pagedcontent_ItemFocusAnim-green_fceUL",
};
},
36226: (e) => {
e.exports = {
"duration-app-launch": "800ms",
PanelSection: "remoteplay_PanelSection_3CTSQ",
PanelSectionTitle: "remoteplay_PanelSectionTitle_2y3UQ",
Text: "remoteplay_Text__u55r",
PanelSectionRow: "remoteplay_PanelSectionRow_rC25a",
Label: "remoteplay_Label_UfIGB",
ComingSoon: "remoteplay_ComingSoon_2MGRk",
QuickAccessNotifications: "remoteplay_QuickAccessNotifications_3EHGW",
VR: "remoteplay_VR_3zGD_",
EmptyNotifications: "remoteplay_EmptyNotifications_2H2il",
LowBattery: "remoteplay_LowBattery_2byQS",
ReallyLow: "remoteplay_ReallyLow_3CHEe",
LowBatteryGauge: "remoteplay_LowBatteryGauge_1UMUg",
Remaining: "remoteplay_Remaining_lttQ8",
BatterySectionContainer: "remoteplay_BatterySectionContainer_1Dlgs",
BatteryIcon: "remoteplay_BatteryIcon_3XW55",
BatteryPercentageLabel: "remoteplay_BatteryPercentageLabel_1SDW_",
BatteryDetailsLabels: "remoteplay_BatteryDetailsLabels_2pdWI",
BatteryProjectedValue: "remoteplay_BatteryProjectedValue_30ZTF",
BatteryProjectedLabel: "remoteplay_BatteryProjectedLabel_1bS5R",
ContentForm: "remoteplay_ContentForm_3yIT_",
ContentBox: "remoteplay_ContentBox_3g04Q",
Interactable: "remoteplay_Interactable_2_OjI",
DialogHeader: "remoteplay_DialogHeader_1omLn",
StreamPausedNote: "remoteplay_StreamPausedNote_1yY7B",
HeaderActions: "remoteplay_HeaderActions_IZNod",
GameInfo: "remoteplay_GameInfo_1Wexk",
GameName: "remoteplay_GameName_3tbCv",
GameIcon: "remoteplay_GameIcon_1xj5E",
HeaderActionsButtons: "remoteplay_HeaderActionsButtons_3VsHt",
MediaBox: "remoteplay_MediaBox_UAdii",
Media: "remoteplay_Media_1b-b-",
Content: "remoteplay_Content_7-0ht",
Top: "remoteplay_Top_2e2Pp",
DesktopButtons: "remoteplay_DesktopButtons_2dyAi",
Bottom: "remoteplay_Bottom_2sHQp",
Section: "remoteplay_Section_1gsof",
SectionItemMargin: "remoteplay_SectionItemMargin_14zCU",
SectionTitle: "remoteplay_SectionTitle_2w_yp",
GameSettingsBox: "remoteplay_GameSettingsBox_3CJFr",
ControllerDropSlotsContainer: "remoteplay_ControllerDropSlotsContainer_EIvpa",
ControllerDropSlots: "remoteplay_ControllerDropSlots_1BzWI",
HowToHint: "remoteplay_HowToHint_3tZOj",
ControllerDropSlot: "remoteplay_ControllerDropSlot_14PL3",
WithMargin: "remoteplay_WithMargin_3SadY",
Controller: "remoteplay_Controller_1Kwg5",
SlotFilled: "remoteplay_SlotFilled_xQywn",
DragHovered: "remoteplay_DragHovered_Md8vG",
DropSlotNumber: "remoteplay_DropSlotNumber_16UQH",
QuickAccessControllerOrderSlot: "remoteplay_QuickAccessControllerOrderSlot_bA_5P",
DropSlotBackgroundPulse: "remoteplay_DropSlotBackgroundPulse_FQlQN",
ControllerClearDropSlot: "remoteplay_ControllerClearDropSlot_23QlC",
ClearDropSlotIcon: "remoteplay_ClearDropSlotIcon_3q7Qx",
DropSlotClearFillPulse: "remoteplay_DropSlotClearFillPulse_GQKQT",
MediaButton: "remoteplay_MediaButton_2a9L1",
ButtonContent: "remoteplay_ButtonContent_1HCRV",
RecentlyInteracted: "remoteplay_RecentlyInteracted_2TDHR",
MediaButtonLabel: "remoteplay_MediaButtonLabel_1a0qK",
MediaImage: "remoteplay_MediaImage_3TsrF",
PersonaName: "remoteplay_PersonaName_11FQa",
PersonaNameName: "remoteplay_PersonaNameName_1vbfY",
PersonaAvatar: "remoteplay_PersonaAvatar_1sgR5",
PlayerControlsContainer: "remoteplay_PlayerControlsContainer_1MLzR",
PlayerControls: "remoteplay_PlayerControls_3IoOu",
QuickAccessPlayerControlsContainer: "remoteplay_QuickAccessPlayerControlsContainer_RNCoe",
PlayerControl: "remoteplay_PlayerControl_1SN8P",
NoInputWarning: "remoteplay_NoInputWarning_1hPkC",
WarningIcon: "remoteplay_WarningIcon_1fiUw",
ControlEnabled: "remoteplay_ControlEnabled_XdDQO",
QuickAccess: "remoteplay_QuickAccess_2UJXH",
ControlDisabled: "remoteplay_ControlDisabled_306vA",
InteractableControl: "remoteplay_InteractableControl_1qor0",
SliderControlContainer: "remoteplay_SliderControlContainer_1RJcX",
SliderIconContainer: "remoteplay_SliderIconContainer_2XRDA",
SliderContainer: "remoteplay_SliderContainer_1Ppzh",
SliderIcon: "remoteplay_SliderIcon_1Ygk7",
Disabled: "remoteplay_Disabled_wH_Ax",
Slider: "remoteplay_Slider_3fHEV",
MediaBoxTitle: "remoteplay_MediaBoxTitle_3WR0p",
TitleText: "remoteplay_TitleText_H4M1y",
TitleStatusDivider: "remoteplay_TitleStatusDivider_1b2Fy",
TitleStatus: "remoteplay_TitleStatus_1UC1a",
InvitedGuestBox: "remoteplay_InvitedGuestBox_st7xQ",
LinkContainer: "remoteplay_LinkContainer_2Ojy0",
GuestTitle: "remoteplay_GuestTitle_1ysXO",
PlayerController: "remoteplay_PlayerController_14Xjj",
PlayerControllerNumber: "remoteplay_PlayerControllerNumber_3dA2r",
Hidden: "remoteplay_Hidden_MlU_V",
PlayerControllerIcon: "remoteplay_PlayerControllerIcon_2kild",
Enabled: "remoteplay_Enabled_2T1ZK",
InteractableController: "remoteplay_InteractableController_k4Tnw",
Grabbable: "remoteplay_Grabbable_1vagK",
QuickAccessPlayerController: "remoteplay_QuickAccessPlayerController_wHOHE",
BoxButton: "remoteplay_BoxButton_hewCY",
Light: "remoteplay_Light_3QXQR",
Dark: "remoteplay_Dark_31ktR",
MicFillOverride: "remoteplay_MicFillOverride_3PcsE",
ClientQualityContainer: "remoteplay_ClientQualityContainer_2lHmz",
CanGrab: "remoteplay_CanGrab_3XVXb",
Wiggle: "remoteplay_Wiggle_2D6_l",
HeaderBitrate: "remoteplay_HeaderBitrate_2tJ0L",
PlayerBitRate: "remoteplay_PlayerBitRate_3ILbI",
BitRateQuality_1: "remoteplay_BitRateQuality_1_253Jl",
BitRateQuality_2: "remoteplay_BitRateQuality_2_1kGJj",
BitRateQuality_3: "remoteplay_BitRateQuality_3_1eQXB",
BitRateQuality_4: "remoteplay_BitRateQuality_4_215zU",
IconMobile: "remoteplay_IconMobile_2371n",
Row: "remoteplay_Row_1Z52v",
HeaderButton: "remoteplay_HeaderButton_2IHDm",
NoMarginTop: "remoteplay_NoMarginTop_1qAhG",
QuickAccessContainer: "remoteplay_QuickAccessContainer_3Moue",
QuickAccessTitle: "remoteplay_QuickAccessTitle_2dcwM",
QuickAccessScrollPanel: "remoteplay_QuickAccessScrollPanel_1kWfg",
QuickAccessMediaBoxTitleRow: "remoteplay_QuickAccessMediaBoxTitleRow_2ouij",
Wrap: "remoteplay_Wrap_1M_Cq",
QuickAccessMediaBoxTitle: "remoteplay_QuickAccessMediaBoxTitle_doZeh",
QuickAccessIconContainer: "remoteplay_QuickAccessIconContainer_bVyVi",
QuickAccessMediaBoxChildrenContainer: "remoteplay_QuickAccessMediaBoxChildrenContainer_2NyJr",
QuickAccessStatusText: "remoteplay_QuickAccessStatusText_1EJYY",
QuickAccessConnectURL: "remoteplay_QuickAccessConnectURL_H2sUm",
QuickAccessClipboardStatus: "remoteplay_QuickAccessClipboardStatus_2rioh",
QuickAccessControlIcon: "remoteplay_QuickAccessControlIcon_Ll-uN",
Mouse: "remoteplay_Mouse_3lhsI",
Keyboard: "remoteplay_Keyboard_2kge0",
QuickAccessControllerOrderContainer: "remoteplay_QuickAccessControllerOrderContainer_2xZxy",
Divider: "remoteplay_Divider_1D4hg",
ReorderLabelName: "remoteplay_ReorderLabelName_3ZavZ",
ReorderLabelPersonaAvatar: "remoteplay_ReorderLabelPersonaAvatar_-dtG_",
InviteFriendGuestButtons: "remoteplay_InviteFriendGuestButtons_XVDsC",
InlineInviteButton: "remoteplay_InlineInviteButton_2WLe2",
MediaBoxBody: "remoteplay_MediaBoxBody_322vo",
Footer: "remoteplay_Footer_2l7VY",
BackgroundAnimation: "remoteplay_BackgroundAnimation_2Uu7J",
"ItemFocusAnim-darkerGrey-nocolor": "remoteplay_ItemFocusAnim-darkerGrey-nocolor_PvXtR",
"ItemFocusAnim-darkerGrey": "remoteplay_ItemFocusAnim-darkerGrey_2B8-4",
"ItemFocusAnim-darkGrey": "remoteplay_ItemFocusAnim-darkGrey_3ybDj",
"ItemFocusAnim-grey": "remoteplay_ItemFocusAnim-grey_1C6kb",
"ItemFocusAnim-translucent-white-10": "remoteplay_ItemFocusAnim-translucent-white-10_260b3",
"ItemFocusAnim-translucent-white-20": "remoteplay_ItemFocusAnim-translucent-white-20_3OEDn",
"ItemFocusAnimBorder-darkGrey": "remoteplay_ItemFocusAnimBorder-darkGrey_1SP1k",
"ItemFocusAnim-green": "remoteplay_ItemFocusAnim-green_3xx9X",
focusAnimation: "remoteplay_focusAnimation_-2njw",
hoverAnimation: "remoteplay_hoverAnimation_jPA3E",
};
},
43965: (e) => {
e.exports = { RecommendedNote: "voicesettings_RecommendedNote_iZ7Ud", TransmissionTypeSettings: "voicesettings_TransmissionTypeSettings_2lDZA", HotkeySettingRow: "voicesettings_HotkeySettingRow_2TALW", HotkeyButton: "voicesettings_HotkeyButton_1Lz3_", Capturing: "voicesettings_Capturing_ANwfj", WalkDashedOutline: "voicesettings_WalkDashedOutline_37_j8", HotkeyClearButton: "voicesettings_HotkeyClearButton_CRx3r", HotkeySettingDescription: "voicesettings_HotkeySettingDescription_1WaGV", VoiceSettings: "voicesettings_VoiceSettings_W4WXV", AdvancedSettingsButton: "voicesettings_AdvancedSettingsButton_1e8R9", ToggleRow: "voicesettings_ToggleRow_2u4ju" };
},
33613: (e) => {
e.exports = {
"duration-app-launch": "800ms",
DialogContent_InnerWidth: "friendinvites_DialogContent_InnerWidth_1y6SQ",
FriendPicker_Focus: "friendinvites_FriendPicker_Focus_1XujO",
FriendRequestViewActive: "friendinvites_FriendRequestViewActive_3EsTu",
VoiceRequested: "friendinvites_VoiceRequested_1QzU9",
chatRoomGroupHeader: "friendinvites_chatRoomGroupHeader_3F_La",
InvitesList: "friendinvites_InvitesList_3i8Fo",
IncomingInvites: "friendinvites_IncomingInvites_3Usmq",
OutgoingInvites: "friendinvites_OutgoingInvites_exhhf",
InvitesSectionHeader: "friendinvites_InvitesSectionHeader_3B_sJ",
Text: "friendinvites_Text_45XAJ",
InvitesRow: "friendinvites_InvitesRow_35_aF",
InvitesFriend: "friendinvites_InvitesFriend_HtZ4l",
MutualFriendRow: "friendinvites_MutualFriendRow_3ajxC",
TopSection: "friendinvites_TopSection_2uvvl",
AddFriendSection: "friendinvites_AddFriendSection_3BjIx",
InputForm: "friendinvites_InputForm_36n9v",
Input: "friendinvites_Input_OgGFI",
SubmitButton: "friendinvites_SubmitButton_3H1Wq",
Title: "friendinvites_Title_1ZEdD",
Description: "friendinvites_Description_KI_gF",
FriendCodeSection: "friendinvites_FriendCodeSection_39nte",
FriendCode: "friendinvites_FriendCode_27408",
Code: "friendinvites_Code_1-bTQ",
Caption: "friendinvites_Caption__XK9j",
Divider: "friendinvites_Divider_3Jqss",
BackgroundAnimation: "friendinvites_BackgroundAnimation_3ZMc5",
"ItemFocusAnim-darkerGrey-nocolor": "friendinvites_ItemFocusAnim-darkerGrey-nocolor_1OURP",
"ItemFocusAnim-darkerGrey": "friendinvites_ItemFocusAnim-darkerGrey_1Fi1a",
"ItemFocusAnim-darkGrey": "friendinvites_ItemFocusAnim-darkGrey_wQRdQ",
"ItemFocusAnim-grey": "friendinvites_ItemFocusAnim-grey_51gAo",
"ItemFocusAnim-translucent-white-10": "friendinvites_ItemFocusAnim-translucent-white-10_2JKoK",
"ItemFocusAnim-translucent-white-20": "friendinvites_ItemFocusAnim-translucent-white-20_2oq2Q",
"ItemFocusAnimBorder-darkGrey": "friendinvites_ItemFocusAnimBorder-darkGrey_WAjoc",
"ItemFocusAnim-green": "friendinvites_ItemFocusAnim-green_Dm1Of",
};
},
94357: (e) => {
e.exports = {
"duration-app-launch": "800ms",
DialogContent_InnerWidth: "friendslist_DialogContent_InnerWidth_21fxW",
FriendPicker_Focus: "friendslist_FriendPicker_Focus_2E-wE",
FriendRequestViewActive: "friendslist_FriendRequestViewActive_3JB6m",
VoiceRequested: "friendslist_VoiceRequested_1_H_d",
chatRoomGroupHeader: "friendslist_chatRoomGroupHeader_33QGT",
RemotePlayInviteLinkSection: "friendslist_RemotePlayInviteLinkSection_3J8nN",
LinkRow: "friendslist_LinkRow_3rRyF",
LinkRowText: "friendslist_LinkRowText_25cZw",
LinkRowIconContainer: "friendslist_LinkRowIconContainer_psSBf",
LinkRowIcon: "friendslist_LinkRowIcon_1aGTk",
LinkExplanation: "friendslist_LinkExplanation_-1XpC",
ExplanationText: "friendslist_ExplanationText_1Qb3G",
Strong: "friendslist_Strong_23ygL",
GotItButton: "friendslist_GotItButton_2Pup6",
AccentChevron: "friendslist_AccentChevron_1m0a1",
TabBumper: "friendslist_TabBumper_3Jr0A",
RecentChatIcon: "friendslist_RecentChatIcon_2mQc_",
UnreadAlert: "friendslist_UnreadAlert_1RSzq",
NotificationUnreadMention: "friendslist_NotificationUnreadMention_pSwCC",
LastMessage: "friendslist_LastMessage_3HNwU",
OfflineContainer: "friendslist_OfflineContainer_J8oP5",
OfflineMessage: "friendslist_OfflineMessage_2aYfi",
summaryText: "friendslist_summaryText_A_QAo",
detailText: "friendslist_detailText_37w_J",
retryButton: "friendslist_retryButton_1NI2e",
BackgroundAnimation: "friendslist_BackgroundAnimation_1-Raw",
"ItemFocusAnim-darkerGrey-nocolor": "friendslist_ItemFocusAnim-darkerGrey-nocolor_3BGg0",
"ItemFocusAnim-darkerGrey": "friendslist_ItemFocusAnim-darkerGrey_3FD_T",
"ItemFocusAnim-darkGrey": "friendslist_ItemFocusAnim-darkGrey_i0vR_",
"ItemFocusAnim-grey": "friendslist_ItemFocusAnim-grey_m46wK",
"ItemFocusAnim-translucent-white-10": "friendslist_ItemFocusAnim-translucent-white-10_118kp",
"ItemFocusAnim-translucent-white-20": "friendslist_ItemFocusAnim-translucent-white-20_9L9Wc",
"ItemFocusAnimBorder-darkGrey": "friendslist_ItemFocusAnimBorder-darkGrey_I4Me_",
"ItemFocusAnim-green": "friendslist_ItemFocusAnim-green_2Ox84",
};
},
20850: (e) => {
e.exports = {
"duration-app-launch": "800ms",
DialogContent_InnerWidth: "quickaccessvoicecontrolssteamdeck_DialogContent_InnerWidth_HlXy1",
FriendPicker_Focus: "quickaccessvoicecontrolssteamdeck_FriendPicker_Focus_120ia",
FriendRequestViewActive: "quickaccessvoicecontrolssteamdeck_FriendRequestViewActive_3Uu-6",
VoiceRequested: "quickaccessvoicecontrolssteamdeck_VoiceRequested_RXOEA",
chatRoomGroupHeader: "quickaccessvoicecontrolssteamdeck_chatRoomGroupHeader_3TQLb",
Title: "quickaccessvoicecontrolssteamdeck_Title_8BFsa",
PendingVoiceChats: "quickaccessvoicecontrolssteamdeck_PendingVoiceChats_3WFt2",
PendingVoiceChatsList: "quickaccessvoicecontrolssteamdeck_PendingVoiceChatsList_kGZyg",
PendingVoiceChatRequest: "quickaccessvoicecontrolssteamdeck_PendingVoiceChatRequest_1qta3",
VoiceChatList: "quickaccessvoicecontrolssteamdeck_VoiceChatList_3Ri6R",
FriendVoiceChatSliderContainer: "quickaccessvoicecontrolssteamdeck_FriendVoiceChatSliderContainer_ucY0N",
SliderPadding: "quickaccessvoicecontrolssteamdeck_SliderPadding_1xn70",
FriendVoiceChatContainer: "quickaccessvoicecontrolssteamdeck_FriendVoiceChatContainer_303Rc",
FriendVoiceChat: "quickaccessvoicecontrolssteamdeck_FriendVoiceChat_2djlw",
"ItemFocusAnim-darkerGrey": "quickaccessvoicecontrolssteamdeck_ItemFocusAnim-darkerGrey_3xI7Y",
GroupVoiceChatContainer: "quickaccessvoicecontrolssteamdeck_GroupVoiceChatContainer_3rgaD",
GroupContainer: "quickaccessvoicecontrolssteamdeck_GroupContainer_2x4Fd",
GroupTitle: "quickaccessvoicecontrolssteamdeck_GroupTitle_3uwZc",
LeaveVoiceChat: "quickaccessvoicecontrolssteamdeck_LeaveVoiceChat_1DSas",
GroupRoomContainer: "quickaccessvoicecontrolssteamdeck_GroupRoomContainer_2MbsP",
ActiveVoiceRoom: "quickaccessvoicecontrolssteamdeck_ActiveVoiceRoom_xHmjh",
UserInRoom: "quickaccessvoicecontrolssteamdeck_UserInRoom_1hpKh",
RoomHeader: "quickaccessvoicecontrolssteamdeck_RoomHeader_1lbdO",
RoomTitle: "quickaccessvoicecontrolssteamdeck_RoomTitle_1H-_S",
GroupVoiceChatFriend: "quickaccessvoicecontrolssteamdeck_GroupVoiceChatFriend_jSCjW",
MicMutedLocally: "quickaccessvoicecontrolssteamdeck_MicMutedLocally_KMowQ",
OutputMutedRemotely: "quickaccessvoicecontrolssteamdeck_OutputMutedRemotely_32Kh-",
MicMutedRemotely: "quickaccessvoicecontrolssteamdeck_MicMutedRemotely_3gMw6",
BackgroundAnimation: "quickaccessvoicecontrolssteamdeck_BackgroundAnimation_23GbG",
"ItemFocusAnim-darkerGrey-nocolor": "quickaccessvoicecontrolssteamdeck_ItemFocusAnim-darkerGrey-nocolor_1xyIi",
"ItemFocusAnim-darkGrey": "quickaccessvoicecontrolssteamdeck_ItemFocusAnim-darkGrey_2GqB7",
"ItemFocusAnim-grey": "quickaccessvoicecontrolssteamdeck_ItemFocusAnim-grey_2bTxY",
"ItemFocusAnim-translucent-white-10": "quickaccessvoicecontrolssteamdeck_ItemFocusAnim-translucent-white-10_2jM4E",
"ItemFocusAnim-translucent-white-20": "quickaccessvoicecontrolssteamdeck_ItemFocusAnim-translucent-white-20_O-onA",
"ItemFocusAnimBorder-darkGrey": "quickaccessvoicecontrolssteamdeck_ItemFocusAnimBorder-darkGrey_OGL0h",
"ItemFocusAnim-green": "quickaccessvoicecontrolssteamdeck_ItemFocusAnim-green_RX24G",
};
},
6708: (e) => {
e.exports = {
"duration-app-launch": "800ms",
DialogContent_InnerWidth: "recentchatssteamdeck_DialogContent_InnerWidth_7aHI_",
FriendPicker_Focus: "recentchatssteamdeck_FriendPicker_Focus_2dn20",
FriendRequestViewActive: "recentchatssteamdeck_FriendRequestViewActive_1Rudc",
VoiceRequested: "recentchatssteamdeck_VoiceRequested_TymZy",
chatRoomGroupHeader: "recentchatssteamdeck_chatRoomGroupHeader_3GxlH",
RecentChatsList: "recentchatssteamdeck_RecentChatsList_2-4f0",
RecentChatElement: "recentchatssteamdeck_RecentChatElement_1-Coz",
"ItemFocusAnim-darkerGrey": "recentchatssteamdeck_ItemFocusAnim-darkerGrey_-5J2j",
"ItemFocusAnim-darkGrey": "recentchatssteamdeck_ItemFocusAnim-darkGrey_1pEXV",
UnreadCount: "recentchatssteamdeck_UnreadCount_LTCvn",
Time: "recentchatssteamdeck_Time_20ewu",
BackgroundAnimation: "recentchatssteamdeck_BackgroundAnimation_v87rF",
"ItemFocusAnim-darkerGrey-nocolor": "recentchatssteamdeck_ItemFocusAnim-darkerGrey-nocolor_1W_MK",
"ItemFocusAnim-grey": "recentchatssteamdeck_ItemFocusAnim-grey_35kWn",
"ItemFocusAnim-translucent-white-10": "recentchatssteamdeck_ItemFocusAnim-translucent-white-10_odmKL",
"ItemFocusAnim-translucent-white-20": "recentchatssteamdeck_ItemFocusAnim-translucent-white-20_smtou",
"ItemFocusAnimBorder-darkGrey": "recentchatssteamdeck_ItemFocusAnimBorder-darkGrey_8pVLM",
"ItemFocusAnim-green": "recentchatssteamdeck_ItemFocusAnim-green_ENPFC",
};
},
62210: (e) => {
e.exports = {
"duration-app-launch": "800ms",
DialogContent_InnerWidth: "main_DialogContent_InnerWidth_3NSzY",
FriendPicker_Focus: "main_FriendPicker_Focus_1VEHr",
FriendRequestViewActive: "main_FriendRequestViewActive_2m8dd",
VoiceRequested: "main_VoiceRequested_1Us1G",
chatRoomGroupHeader: "main_chatRoomGroupHeader_2kpIH",
throbberContainer: "main_throbberContainer_2gRz4",
throbberContainerSteamDeckFriendsQuickAccess: "main_throbberContainerSteamDeckFriendsQuickAccess_oq071",
throbberContainerSteamDeckFriends: "main_throbberContainerSteamDeckFriends_28sB2",
"throbberContainer-exit-active": "main_throbberContainer-exit-active_2z9OY",
SteamPageHeader: "main_SteamPageHeader_3NLSM",
SteamPageHeaderShortLogo: "main_SteamPageHeaderShortLogo_lWgFM",
LogoGlobal: "main_LogoGlobal_3A7qr",
LogoChina: "main_LogoChina_iYyr7",
SteamPageHeaderTopLink: "main_SteamPageHeaderTopLink_2mGrI",
BackgroundAnimation: "main_BackgroundAnimation_3-MCu",
"ItemFocusAnim-darkerGrey-nocolor": "main_ItemFocusAnim-darkerGrey-nocolor_3plWN",
"ItemFocusAnim-darkerGrey": "main_ItemFocusAnim-darkerGrey_BqEst",
"ItemFocusAnim-darkGrey": "main_ItemFocusAnim-darkGrey_3khNe",
"ItemFocusAnim-grey": "main_ItemFocusAnim-grey_9rnEz",
"ItemFocusAnim-translucent-white-10": "main_ItemFocusAnim-translucent-white-10_38cxd",
"ItemFocusAnim-translucent-white-20": "main_ItemFocusAnim-translucent-white-20_1KpqF",
"ItemFocusAnimBorder-darkGrey": "main_ItemFocusAnimBorder-darkGrey_4BFNo",
"ItemFocusAnim-green": "main_ItemFocusAnim-green_1mHZe",
};
},
22982: (e) => {
e.exports = { "duration-app-launch": "800ms", SpeakerName_InGame: "messages_SpeakerName_InGame_3xyn_", SpeakerName_WatchingBroadcast: "messages_SpeakerName_WatchingBroadcast_42oIW", SpeakerName_Online: "messages_SpeakerName_Online_7B6M2", SpeakerName_Default: "messages_SpeakerName_Default_2NMuV", MsgWithAddons: "messages_MsgWithAddons_32Uri", Addons: "messages_Addons_1pGgX", Emoticon: "messages_Emoticon_3uwQM", Open: "messages_Open_3GQR8" };
},
58118: (e) => {
e.exports = {
"duration-app-launch": "800ms",
DialogContent_InnerWidth: "unreadchatmessagesheadersteamdeck_DialogContent_InnerWidth_hbNOn",
FriendPicker_Focus: "unreadchatmessagesheadersteamdeck_FriendPicker_Focus_3_Emp",
FriendRequestViewActive: "unreadchatmessagesheadersteamdeck_FriendRequestViewActive_2mE7I",
VoiceRequested: "unreadchatmessagesheadersteamdeck_VoiceRequested_1FUOI",
chatRoomGroupHeader: "unreadchatmessagesheadersteamdeck_chatRoomGroupHeader_cZggu",
NotificationUnreadMentionContainer: "unreadchatmessagesheadersteamdeck_NotificationUnreadMentionContainer_jWNCx",
HasMessages: "unreadchatmessagesheadersteamdeck_HasMessages_3Xg0H",
Header_NotificationUnreadMention: "unreadchatmessagesheadersteamdeck_Header_NotificationUnreadMention_16uUR",
BackgroundAnimation: "unreadchatmessagesheadersteamdeck_BackgroundAnimation_1Hj25",
"ItemFocusAnim-darkerGrey-nocolor": "unreadchatmessagesheadersteamdeck_ItemFocusAnim-darkerGrey-nocolor_1drG4",
"ItemFocusAnim-darkerGrey": "unreadchatmessagesheadersteamdeck_ItemFocusAnim-darkerGrey_3dXBv",
"ItemFocusAnim-darkGrey": "unreadchatmessagesheadersteamdeck_ItemFocusAnim-darkGrey_3vJLM",
"ItemFocusAnim-grey": "unreadchatmessagesheadersteamdeck_ItemFocusAnim-grey_1-Lro",
"ItemFocusAnim-translucent-white-10": "unreadchatmessagesheadersteamdeck_ItemFocusAnim-translucent-white-10_3yWy7",
"ItemFocusAnim-translucent-white-20": "unreadchatmessagesheadersteamdeck_ItemFocusAnim-translucent-white-20_3Z08b",
"ItemFocusAnimBorder-darkGrey": "unreadchatmessagesheadersteamdeck_ItemFocusAnimBorder-darkGrey_1gM3D",
"ItemFocusAnim-green": "unreadchatmessagesheadersteamdeck_ItemFocusAnim-green_3Pxdu",
};
},
43825: (e) => {
e.exports = {
"duration-app-launch": "800ms",
"vrgamepadui-floating-side-panel-width": "300px",
"vrgamepadui-floating-side-panel-height": "600px",
"vrgamepadui-floating-bar-popup-panel-width": "300px",
"vrgamepadui-floating-bar-popup-panel-height": "600px",
"vrgamepadui-floating-keyboard-width": "854px",
"vrgamepadui-floating-keyboard-height": "279px",
DialogContent_InnerWidth: "voicechatheadersteamdeck_DialogContent_InnerWidth_30h2e",
FriendPicker_Focus: "voicechatheadersteamdeck_FriendPicker_Focus_Lv2z8",
FriendRequestViewActive: "voicechatheadersteamdeck_FriendRequestViewActive_2cb6v",
VoiceRequested: "voicechatheadersteamdeck_VoiceRequested_2S7KP",
chatRoomGroupHeader: "voicechatheadersteamdeck_chatRoomGroupHeader_-AK_a",
PopupBody: "voicechatheadersteamdeck_PopupBody_1s0kV",
VoiceChatHeader: "voicechatheadersteamdeck_VoiceChatHeader_18snG",
ActiveCall: "voicechatheadersteamdeck_ActiveCall_1ln1Q",
VoiceChatStatusBackground: "voicechatheadersteamdeck_VoiceChatStatusBackground_1zp0Z",
IncomingCall: "voicechatheadersteamdeck_IncomingCall_3Wjn7",
GroupVoice: "voicechatheadersteamdeck_GroupVoice_2f6GG",
FriendVoice: "voicechatheadersteamdeck_FriendVoice_13yPS",
BackgroundAnimation: "voicechatheadersteamdeck_BackgroundAnimation_3E1yZ",
"ItemFocusAnim-darkerGrey-nocolor": "voicechatheadersteamdeck_ItemFocusAnim-darkerGrey-nocolor_jyLlf",
"ItemFocusAnim-darkerGrey": "voicechatheadersteamdeck_ItemFocusAnim-darkerGrey_2CPyB",
"ItemFocusAnim-darkGrey": "voicechatheadersteamdeck_ItemFocusAnim-darkGrey_HsK6E",
"ItemFocusAnim-grey": "voicechatheadersteamdeck_ItemFocusAnim-grey_2plaQ",
"ItemFocusAnim-translucent-white-10": "voicechatheadersteamdeck_ItemFocusAnim-translucent-white-10_2f5VL",
"ItemFocusAnim-translucent-white-20": "voicechatheadersteamdeck_ItemFocusAnim-translucent-white-20_AoFA7",
"ItemFocusAnimBorder-darkGrey": "voicechatheadersteamdeck_ItemFocusAnimBorder-darkGrey_lrn8I",
"ItemFocusAnim-green": "voicechatheadersteamdeck_ItemFocusAnim-green_2Gaqx",
};
},
57428: (e) => {
e.exports = {
Bold: "bbcodes_Bold_Whyj8",
Italic: "bbcodes_Italic_3sfhE",
Paragraph: "bbcodes_Paragraph_KPN-t",
Header1: "bbcodes_Header1_2SIyP",
Header2: "bbcodes_Header2_38_5M",
Header3: "bbcodes_Header3_2QwSx",
Header4: "bbcodes_Header4_qpkV7",
Header5: "bbcodes_Header5_2_91m",
CenterSpan: "bbcodes_CenterSpan_23ZsN",
SmallText: "bbcodes_SmallText_I5szu",
Underline: "bbcodes_Underline_2vtht",
Strike: "bbcodes_Strike_1f7F7",
Spoiler: "bbcodes_Spoiler_3JtzY",
Revealed: "bbcodes_Revealed_34mzj",
SpoilerText: "bbcodes_SpoilerText_3j-5-",
DisabledMouseEvents: "bbcodes_DisabledMouseEvents_2-fAv",
BlockQuote: "bbcodes_BlockQuote_3yBUp",
QuoteAuthor: "bbcodes_QuoteAuthor_1VjBB",
PullQuote: "bbcodes_PullQuote_11kxj",
Code: "bbcodes_Code_3R99i",
CodeBlock: "bbcodes_CodeBlock_3hI9g",
List: "bbcodes_List_2YF79",
OrderedList: "bbcodes_OrderedList_1DQ9h",
ListItem: "bbcodes_ListItem_3FrNm",
HR: "bbcodes_HR_3M2PS",
Table: "bbcodes_Table_1iK3C",
NoBorder: "bbcodes_NoBorder_3Gpas",
TableRow: "bbcodes_TableRow_qVi0G",
TableData: "bbcodes_TableData_1vHUl",
TableHeader: "bbcodes_TableHeader_3rbaO",
EqualCells: "bbcodes_EqualCells_2_DPN",
ExpandSectionBlock: "bbcodes_ExpandSectionBlock_2UXXq",
ExpandSectionHeader: "bbcodes_ExpandSectionHeader_3d8DX",
EmbedArrow: "bbcodes_EmbedArrow_PDL62",
ExpandSectionBody: "bbcodes_ExpandSectionBody_2U2l0",
ExpandSection_WithTitle: "bbcodes_ExpandSection_WithTitle_HXzMO",
LinkButton: "bbcodes_LinkButton_jPpgc",
Image: "bbcodes_Image_38ivO",
};
},
20698: (e) => {
e.exports = {
BroadcastChat: "broadcastchat_BroadcastChat_3URK7",
ChatEntry: "broadcastchat_ChatEntry_3soy-",
ChatPanel: "broadcastchat_ChatPanel_2ZCAI",
ChatMessages: "broadcastchat_ChatMessages_3M5L0",
EmoticonContainer: "broadcastchat_EmoticonContainer_1wa4o",
ChatSend: "broadcastchat_ChatSend_3JUnD",
ChatBox: "broadcastchat_ChatBox_2qfgS",
ChatControls: "broadcastchat_ChatControls_1TekO",
MessageChat: "broadcastchat_MessageChat_22PB4",
MessageName: "broadcastchat_MessageName_BJe6C",
MessageContents: "broadcastchat_MessageContents_PNYZa",
EmoticonsOnly: "broadcastchat_EmoticonsOnly_gFjH8",
MessageNotification: "broadcastchat_MessageNotification_3Xb4_",
MessageError: "broadcastchat_MessageError_8MzyW",
minHeightZero: "broadcastchat_minHeightZero_r7HLM",
ChatLoginButton: "broadcastchat_ChatLoginButton_2TAQo",
RateLimitProgressBarContainer: "broadcastchat_RateLimitProgressBarContainer_JPqUG",
RateLimitProgressBar: "broadcastchat_RateLimitProgressBar_1EcVK",
TimedProgressBarContainer: "broadcastchat_TimedProgressBarContainer_39xGj",
wrapper: "broadcastchat_wrapper_2vz6R",
pie: "broadcastchat_pie_1k4dS",
spinner: "broadcastchat_spinner_3nRh5",
rota: "broadcastchat_rota_1xXh6",
filler: "broadcastchat_filler_3Eegk",
fill: "broadcastchat_fill_2tyuX",
mask: "broadcastchat_mask_1V4Ke",
SelectedUserNameCtn: "broadcastchat_SelectedUserNameCtn_3K4QX",
SelectedUserName: "broadcastchat_SelectedUserName_c907V",
FlairContainer: "broadcastchat_FlairContainer_166wp",
RoleFlairContainer: "broadcastchat_RoleFlairContainer_1QRJ2",
Description: "broadcastchat_Description_105HH",
LogInPrompt: "broadcastchat_LogInPrompt_CsA8v",
SignInButton: "broadcastchat_SignInButton_1dMwW",
};
},
93628: (e) => {
e.exports = { GiveawayWinnerBox: "broadcastchatannouncement_GiveawayWinnerBox_3cv4l", GiveawayWinnerAnnounced: "broadcastchatannouncement_GiveawayWinnerAnnounced_oLk3w", WinnerFlash: "broadcastchatannouncement_WinnerFlash_29x--", GiveawayWinnerBoxRight: "broadcastchatannouncement_GiveawayWinnerBoxRight_2ftrc", GiveawayWinnerText: "broadcastchatannouncement_GiveawayWinnerText_1SY2g", GiveawayWinnerCountdown: "broadcastchatannouncement_GiveawayWinnerCountdown_1eP67", GiveawayWinnerBoxLeft: "broadcastchatannouncement_GiveawayWinnerBoxLeft_N6Rk1", GiveawayWinnerArt: "broadcastchatannouncement_GiveawayWinnerArt_1sgyp", GiveawayWinnerQuestion: "broadcastchatannouncement_GiveawayWinnerQuestion_3mvdc", InViewerBar: "broadcastchatannouncement_InViewerBar_25VQ8", GiveawayRegisterButton: "broadcastchatannouncement_GiveawayRegisterButton_eKSAv", GiveawayAlreadyRegistered: "broadcastchatannouncement_GiveawayAlreadyRegistered_2AVNR" };
},
14664: (e) => {
e.exports = { FocusRingRoot: "focusring_FocusRingRoot_3m2Fo", FocusRing: "focusring_FocusRing_1sTuv", flash: "focusring_flash_15zi-", growOutline: "focusring_growOutline_3vSPb", fadeOutline: "focusring_fadeOutline_xL-jG", blinker: "focusring_blinker_3mURo", DebugFocusRing: "focusring_DebugFocusRing_1cTVW", FocusRingOnHiddenItem: "focusring_FocusRingOnHiddenItem_8uyqy" };
},
88975: (e) => {
e.exports = { ScrollPanel: "scrollpanel_ScrollPanel_1Ecbh", ScrollY: "scrollpanel_ScrollY_3yFwd", ScrollX: "scrollpanel_ScrollX_3TJWg", ScrollBoth: "scrollpanel_ScrollBoth_7h7DE" };
},
31721: (e) => {
e.exports = {
Login: "newlogindialog_Login_lat0M",
SideBySide: "newlogindialog_SideBySide_ZHRZ8",
GuestContainer: "newlogindialog_GuestContainer_3Sfbz",
GuestLayout: "newlogindialog_GuestLayout_1r_sY",
GuestText: "newlogindialog_GuestText_2gE59",
GuestLink: "newlogindialog_GuestLink_3zcmX",
QRSection: "newlogindialog_QRSection_3wSeH",
MessagingContainer: "newlogindialog_MessagingContainer_mFCQS",
MessagingTag: "newlogindialog_MessagingTag_2vrvE",
MessagingSubtitleCtn: "newlogindialog_MessagingSubtitleCtn_1SepN",
MessagingIcon: "newlogindialog_MessagingIcon_1IIkZ",
MessagingSubtitle: "newlogindialog_MessagingSubtitle_14ZzK",
MessagingButton: "newlogindialog_MessagingButton_3k-6J",
MessagingLink: "newlogindialog_MessagingLink_1kBrG",
ScanQRButton: "newlogindialog_ScanQRButton_3wGxE",
QRIcon: "newlogindialog_QRIcon_27u_P",
QRCodeContainer: "newlogindialog_QRCodeContainer_3ToZQ",
QR: "newlogindialog_QR_35Q-U",
QRHideLink: "newlogindialog_QRHideLink_1MIDA",
HideButton: "newlogindialog_HideButton_1kEk5",
UseMobileAppForQR: "newlogindialog_UseMobileAppForQR_3pxTS",
InClient: "newlogindialog_InClient_1VAFg",
TextField: "newlogindialog_TextField_3BkiH",
TextInput: "newlogindialog_TextInput_2GBWe",
Danger: "newlogindialog_Danger_16BUa",
LoginForm: "newlogindialog_LoginForm_2v60t",
FieldLabel: "newlogindialog_FieldLabel_XrYge",
Highlight: "newlogindialog_Highlight_12zBm",
CheckboxField: "newlogindialog_CheckboxField_1Qku5",
CheckboxFieldLabel: "newlogindialog_CheckboxFieldLabel_10bGi",
Checkbox: "newlogindialog_Checkbox_LBS7I",
Check: "newlogindialog_Check_28MB9",
RefreshButtonContainer: "newlogindialog_RefreshButtonContainer_1Y8X9",
SignInButtonContainer: "newlogindialog_SignInButtonContainer_16fbi",
RefreshQuitButton: "newlogindialog_RefreshQuitButton_9Ig1o",
OfferOfflineButton: "newlogindialog_OfferOfflineButton_2Z68v",
TryAgainButton: "newlogindialog_TryAgainButton_25eT2",
GuestButton: "newlogindialog_GuestButton_3t6Qg",
SubmitButton: "newlogindialog_SubmitButton_DjSvC",
Loading: "newlogindialog_Loading_2NVQc",
LoadingContainer: "newlogindialog_LoadingContainer_3AseU",
Text: "newlogindialog_Text_1zFEa",
Center: "newlogindialog_Center_2jDjx",
TextLink: "newlogindialog_TextLink_1K431",
FormError: "newlogindialog_FormError_1W_6H",
TextAlignCenter: "newlogindialog_TextAlignCenter_2FyQD",
FlexCol: "newlogindialog_FlexCol_1NOsG",
AlignItemsCenter: "newlogindialog_AlignItemsCenter_2QHQ1",
JustifyContentCenter: "newlogindialog_JustifyContentCenter_2tsIi",
ProtectingAccount: "newlogindialog_ProtectingAccount_3JBYG",
Label: "newlogindialog_Label_1hKgi",
AccountName: "newlogindialog_AccountName_31Vq4",
Description: "newlogindialog_Description_2o5mE",
ConfirmationContainer: "newlogindialog_ConfirmationContainer_3zQ9h",
AwaitingMobileConfText: "newlogindialog_AwaitingMobileConfText_2WgwH",
ConfirmationEntryContainer: "newlogindialog_ConfirmationEntryContainer_3huyZ",
AwaitingMobileConfIcon: "newlogindialog_AwaitingMobileConfIcon_3WvDp",
AwaitingEmailConfIcon: "newlogindialog_AwaitingEmailConfIcon_3qdu3",
LinkContainer: "newlogindialog_LinkContainer_3yz6x",
EnterCodeInsteadLink: "newlogindialog_EnterCodeInsteadLink_2YsaR",
EnterBackupCodeContainer: "newlogindialog_EnterBackupCodeContainer_DdK_F",
EnterCodeFromMobileContainer: "newlogindialog_EnterCodeFromMobileContainer_2Io_J",
EnterCodeFromEmailContainer: "newlogindialog_EnterCodeFromEmailContainer_1YQZI",
EnterCodeFromMobile: "newlogindialog_EnterCodeFromMobile_1rEWO",
EnterCodeFromEmail: "newlogindialog_EnterCodeFromEmail_3aMbj",
EnterCodeEmailAddress: "newlogindialog_EnterCodeEmailAddress_3BKzb",
CodeInputFieldContainer: "newlogindialog_CodeInputFieldContainer_3FIQq",
CodeInputField: "newlogindialog_CodeInputField_1gZuG",
SegmentContainer: "newlogindialog_SegmentContainer_8gteG",
Segment: "newlogindialog_Segment_3l55O",
RefreshTitle: "newlogindialog_RefreshTitle_3yMMw",
RefreshReason: "newlogindialog_RefreshReason_1b-mL",
InsecureComputer: "newlogindialog_InsecureComputer_3onX-",
StandardLayout: "newlogindialog_StandardLayout_2EuR6",
PrimaryHeader: "newlogindialog_PrimaryHeader_g5L61",
FormContainer: "newlogindialog_FormContainer_3XCnc",
Embedded: "newlogindialog_Embedded_2R_n2",
Compact: "newlogindialog_Compact_3FB9K",
HeaderLogo: "newlogindialog_HeaderLogo_3v6Wn",
LogoContainer: "newlogindialog_LogoContainer_14exB",
BackArrowContainer: "newlogindialog_BackArrowContainer_2Jkgs",
BackArrow: "newlogindialog_BackArrow_3NHpq",
EmbeddedRoot: "newlogindialog_EmbeddedRoot_2v9dC",
RefreshReasonContainer: "newlogindialog_RefreshReasonContainer_1kQPd",
Universe: "newlogindialog_Universe_yQUZi",
EmbeddedRootFooter: "newlogindialog_EmbeddedRootFooter_27aIt",
AccountCreation: "newlogindialog_AccountCreation_3oena",
AccountCreationPrompt: "newlogindialog_AccountCreationPrompt_3dwSW",
FailureTitle: "newlogindialog_FailureTitle_1A8Mk",
FailureDescription: "newlogindialog_FailureDescription_3H-JH",
FailureButtons: "newlogindialog_FailureButtons_Vf2Dk",
OfferOffline: "newlogindialog_OfferOffline_2gqhn",
LoadingSpinner: "newlogindialog_LoadingSpinner_1VLuk",
LoadAmin: "newlogindialog_LoadAmin_14OTB",
Small: "newlogindialog_Small_WYrJy",
Medium: "newlogindialog_Medium_CQ9fA",
Large: "newlogindialog_Large_1EIKW",
MutedErrorReference: "newlogindialog_MutedErrorReference_J_2Q0",
WaitingForTokenContainer: "newlogindialog_WaitingForTokenContainer_1h8nX",
Client: "newlogindialog_Client_3NSip",
};
},
10335: (e) => {
e.exports = { LoginQR: "qrlogin_LoginQR_xlEVp", NonPublic: "qrlogin_NonPublic_39rmY", QRLoginDeck: "qrlogin_QRLoginDeck_J3DO-", Blur: "qrlogin_Blur_1rteF", Overlay: "qrlogin_Overlay_464mF", Box: "qrlogin_Box_2ltn2", Column: "qrlogin_Column_2u8B9", Loading: "qrlogin_Loading_3jObI", LoadAmin: "qrlogin_LoadAmin_3GMW9", Small: "qrlogin_Small_3YZnI", Medium: "qrlogin_Medium_rYn6L", Large: "qrlogin_Large_16VPM" };
},
75377: (e) => {
e.exports = { SnoozeContainer: "friendsnooze_SnoozeContainer_1Dsum", SnoozeZ: "friendsnooze_SnoozeZ_2n0Ei", none: "friendsnooze_none_T3Fb5", Medium: "friendsnooze_Medium_1iYPl", Large: "friendsnooze_Large_3BESV", Dim: "friendsnooze_Dim_rpZ9b", Z1: "friendsnooze_Z1_2hnF3", Z2: "friendsnooze_Z2_VmQTO", Z3: "friendsnooze_Z3_29mta", hoverParent: "friendsnooze_hoverParent_3-8cB", animating: "friendsnooze_animating_2rXc7", Snoring: "friendsnooze_Snoring_38wIV" };
},
61805: (e) => {
e.exports = { HoverPosition: "hoverposition_HoverPosition_3vg1v", Ready: "hoverposition_Ready_1Ye_0", NoSpace: "hoverposition_NoSpace_pxVZH", EnablePointerEvents: "hoverposition_EnablePointerEvents_2b9OE", HoverAboveModal: "hoverposition_HoverAboveModal_EQqOx", HoverPositionOuter: "hoverposition_HoverPositionOuter_2_lmT" };
},
49361: (e) => {
e.exports = {
miniProfile: "miniprofile_miniProfile_2QPdq",
miniProfileContent: "miniprofile_miniProfileContent_1xTAT",
miniProfileHeader: "miniprofile_miniProfileHeader_3CZcH",
miniProfilePlayer: "miniprofile_miniProfilePlayer_2jZ0A",
playerContent: "miniprofile_playerContent_2-pwJ",
miniProfileBackground: "miniprofile_miniProfileBackground_3HzZh",
miniProfileBackgroundBlur: "miniprofile_miniProfileBackgroundBlur_xUosY",
miniProfileVideoBackground: "miniprofile_miniProfileVideoBackground_2Zqfb",
miniProfileVideoBackgroundContainer: "miniprofile_miniProfileVideoBackgroundContainer_3MrYv",
miniProfileBackdropBlur: "miniprofile_miniProfileBackdropBlur_1QhpY",
miniProfileBlocked: "miniprofile_miniProfileBlocked_39Jef",
miniProfileNotFriends: "miniprofile_miniProfileNotFriends_3Ea91",
notFriends: "miniprofile_notFriends_2zgR7",
SnoozeContainer: "miniprofile_SnoozeContainer_1cAsx",
miniProfileHover: "miniprofile_miniProfileHover_2AWay",
miniprofile_arrow: "miniprofile_miniprofile_arrow_1YsNo",
left: "miniprofile_left_1qS_b",
playerAvatar: "miniprofile_playerAvatar_36eQg",
Frame: "miniprofile_Frame_2nPON",
avatarStatus: "miniprofile_avatarStatus_1YdpX",
miniProfileAvatarStatus: "miniprofile_miniProfileAvatarStatus_1k5Yk",
personaName: "miniprofile_personaName_qiP8a",
hasNickname: "miniprofile_hasNickname_2TAWS",
personaNameLabel: "miniprofile_personaNameLabel_2VUw8",
nickName: "miniprofile_nickName_h_So5",
persona: "miniprofile_persona_3c5GO",
personaAndIcons: "miniprofile_personaAndIcons_1p9kf",
awayStatusLabel: "miniprofile_awayStatusLabel_1FgWI",
nickname: "miniprofile_nickname_1SWhp",
playerNicknameBracket: "miniprofile_playerNicknameBracket_3qa8c",
notInOrWatchingGame: "miniprofile_notInOrWatchingGame_1NkB7",
miniProfileBottom: "miniprofile_miniProfileBottom_26ga2",
miniProfileGameContainer: "miniprofile_miniProfileGameContainer_7-U6j",
gameLogo: "miniprofile_gameLogo_A0XYr",
ingame: "miniprofile_ingame_24oQz",
richPresence: "miniprofile_richPresence_39T3E",
gameState: "miniprofile_gameState_3Hxc3",
watchingbroadcast: "miniprofile_watchingbroadcast_3hSAG",
watchingbroadcastThumbnail: "miniprofile_watchingbroadcastThumbnail_FmBWy",
gameContent: "miniprofile_gameContent_3YwnZ",
miniProfileFeaturedContainer: "miniprofile_miniProfileFeaturedContainer_1KDhd",
favoriteBadgeIcon: "miniprofile_favoriteBadgeIcon_qP4hs",
badgeIcon: "miniprofile_badgeIcon_1oWOa",
featuredLabels: "miniprofile_featuredLabels_39har",
friendPlayerLevelNum: "miniprofile_friendPlayerLevelNum_3vvwM",
featuredTitle: "miniprofile_featuredTitle_2mCgt",
mutualFriends: "miniprofile_mutualFriends_3AWk3",
featuredSubTitle: "miniprofile_featuredSubTitle_3DelZ",
};
},
58557: (e) => {
e.exports = {
"duration-app-launch": "800ms",
statusAndName: "personanameandstatus_statusAndName_4ZTzG",
threeLines: "personanameandstatus_threeLines_1oYSX",
blocked: "personanameandstatus_blocked_VTxPk",
richPresenceLabel: "personanameandstatus_richPresenceLabel_2Ri00",
playerName: "personanameandstatus_playerName_nOdcT",
playerNickname: "personanameandstatus_playerNickname_2saJT",
playerNicknameBracket: "personanameandstatus_playerNicknameBracket_3XEmW",
richPresenceContainer: "personanameandstatus_richPresenceContainer_3sxE7",
gameName: "personanameandstatus_gameName_1cB0q",
NoMask: "personanameandstatus_NoMask_2dAj6",
twoLine: "personanameandstatus_twoLine_1BbOe",
DNDContainer: "personanameandstatus_DNDContainer_3IswZ",
partyBeaconJoin: "personanameandstatus_partyBeaconJoin_3BnDs",
hidePersona: "personanameandstatus_hidePersona_3ZJkO",
compactView: "personanameandstatus_compactView_3bbRZ",
noContextMenu: "personanameandstatus_noContextMenu_1JE5G",
gameIsPrivateIcon: "personanameandstatus_gameIsPrivateIcon_2gBKQ",
PendingPersona: "personanameandstatus_PendingPersona_2sxXn",
};
},
30677: (e) => {
e.exports = { "duration-app-launch": "800ms", PersonaStatusIcon: "personastatusicons_PersonaStatusIcon_KxAI_", MobilePhoneIcon: "personastatusicons_MobilePhoneIcon_1iRFj" };
},
81376: (e) => {
e.exports = { avatarHolder: "steamavatar_avatarHolder_nibod", avatarStatus: "steamavatar_avatarStatus_3xUpb", avatar: "steamavatar_avatar_3h-QR", avatarFrame: "steamavatar_avatarFrame_X_mJE", avatarFrameImg: "steamavatar_avatarFrameImg_3fM0F" };
},
64627: (e) => {
e.exports = { "duration-app-launch": "800ms", Picker: "addonpicker_Picker_tid_O", Tabs: "addonpicker_Tabs_1yVkT", Tab: "addonpicker_Tab_2CJ0L", Focus: "addonpicker_Focus_1xH5s", TabContent: "addonpicker_TabContent_1mROo", Active: "addonpicker_Active_1ddEQ", Content: "addonpicker_Content_dUQIH", ItemList: "addonpicker_ItemList_2OWGR", Item: "addonpicker_Item_1SFqy", SectionedPageTitle: "addonpicker_SectionedPageTitle_ZmsEl", SectionTitle: "addonpicker_SectionTitle_3WuFl", FilterInputContainer: "addonpicker_FilterInputContainer_EuFeP", FilterInput: "addonpicker_FilterInput_2l4z-", AddonPickerMessage: "addonpicker_AddonPickerMessage_2wUk7" };
},
28464: (e) => {
e.exports = { DynamicLinkBox: "youtubeembed_DynamicLinkBox_1IGUR", DynamicLink_Preview: "youtubeembed_DynamicLink_Preview_3ZK9R", DynamicLink_Author: "youtubeembed_DynamicLink_Author_3z0n0", DynamicLink_Description: "youtubeembed_DynamicLink_Description_eMdGA", DynamicLink_Content: "youtubeembed_DynamicLink_Content_2FhVX", DynamicLink_Name: "youtubeembed_DynamicLink_Name_1R7Ng", DynamicLink_YoutubeViews: "youtubeembed_DynamicLink_YoutubeViews_3clz2", Dynamiclink_Content: "youtubeembed_Dynamiclink_Content_1EYgV", DynamicLink_URL: "youtubeembed_DynamicLink_URL_3otyz", DynamicLink_AuthorName: "youtubeembed_DynamicLink_AuthorName_2DML9", DynamicLink_Date: "youtubeembed_DynamicLink_Date_281Dh", PreviewYouTubeVideo: "youtubeembed_PreviewYouTubeVideo_rUASs", sizeThumb: "youtubeembed_sizeThumb_3dy3K", sizeFull: "youtubeembed_sizeFull_14CxW", floatLeft: "youtubeembed_floatLeft_2OWxr", floatRight: "youtubeembed_floatRight_om0Rs" };
},
2204: (e) => {
e.exports = { "duration-app-launch": "800ms", chatEntryControls: "chatentry_chatEntryControls_3Ule3", chatTextarea: "chatentry_chatTextarea_113iu", chatEntryActionsGroup: "chatentry_chatEntryActionsGroup_2WfNo", chatEntryActionsContainer: "chatentry_chatEntryActionsContainer_W0Ohk", minHeightZero: "chatentry_minHeightZero_2zeeh", chatSubmitButton: "chatentry_chatSubmitButton_RVIs8", EmbedButton: "chatentry_EmbedButton_3zOBe", EmoticonPickerButton: "chatentry_EmoticonPickerButton_Aupsw", disabled: "chatentry_disabled_jaQN2", Inactive: "chatentry_Inactive_3G-I9", AudioLines: "chatentry_AudioLines_IWaba", Active: "chatentry_Active_37tPt" };
},
97841: (e) => {
e.exports = {
"duration-app-launch": "800ms",
ContextMenuMouseOverlay: "contextmenu_ContextMenuMouseOverlay_3Knd7",
ContextMenuFocusContainer: "contextmenu_ContextMenuFocusContainer_1S6CC",
contextMenu: "contextmenu_contextMenu_PP7LM",
ContextMenuPopup: "contextmenu_ContextMenuPopup_14wqd",
contextMenuContents: "contextmenu_contextMenuContents_2EstN",
contextMenuItem: "contextmenu_contextMenuItem_1n7Wl",
active: "contextmenu_active_18z-3",
MenuSectionHeader: "contextmenu_MenuSectionHeader_2Bb4J",
ContextMenuSeparator: "contextmenu_ContextMenuSeparator_WUOrU",
NoSeparation: "contextmenu_NoSeparation_3hRb6",
UpperCase: "contextmenu_UpperCase_uz1Xm",
SubMenu: "contextmenu_SubMenu_2RlEO",
Label: "contextmenu_Label_2qdHl",
Arrow: "contextmenu_Arrow_114nF",
IconContainer: "contextmenu_IconContainer_38-c8",
ContextMenuHRSeparator: "contextmenu_ContextMenuHRSeparator_IjIBR",
ForceDesktop: "contextmenu_ForceDesktop_3qIuY",
PopoutSubMenu: "contextmenu_PopoutSubMenu_Baq37",
PopoutSubMenuItems: "contextmenu_PopoutSubMenuItems_2fZ_e",
};
},
81034: (e) => {
e.exports = { DialogDropDownMenu_Item: "dropdown_DialogDropDownMenu_Item_2oAiZ", DialogDropDownMenu: "dropdown_DialogDropDownMenu_30wJO" };
},
76362: (e) => {
e.exports = { DropDownLabelContainer: "dropdownlabel_DropDownLabelContainer_uujQH", DropDownLabelIconContainer: "dropdownlabel_DropDownLabelIconContainer_3H05C", DropDownLabelTextColumn: "dropdownlabel_DropDownLabelTextColumn_3WTX4", DropDownLabelTitle: "dropdownlabel_DropDownLabelTitle_3g-QH", DropDownLabelUpperDescription: "dropdownlabel_DropDownLabelUpperDescription_2fl-T", DropDownLabelDescription: "dropdownlabel_DropDownLabelDescription_cbinv" };
},
34245: (e) => {
e.exports = {
"duration-app-launch": "800ms",
GamepadDialogContent: "gamepaddialog_GamepadDialogContent_16sYN",
GamepadDialogContent_InnerWidth: "gamepaddialog_GamepadDialogContent_InnerWidth_2ywyS",
Field: "gamepaddialog_Field_eKmEX",
Button: "gamepaddialog_Button_cXzBZ",
NoMinWidth: "gamepaddialog_NoMinWidth_R7OZb",
ActiveAndUnfocused: "gamepaddialog_ActiveAndUnfocused_28cXJ",
StandaloneFieldSeparator: "gamepaddialog_StandaloneFieldSeparator_1vcky",
StandardPadding: "gamepaddialog_StandardPadding_xIITX",
CompactPadding: "gamepaddialog_CompactPadding_3hgIZ",
WithDescription: "gamepaddialog_WithDescription_3tB2l",
WithBottomSeparatorStandard: "gamepaddialog_WithBottomSeparatorStandard_GxgIy",
WithBottomSeparatorThick: "gamepaddialog_WithBottomSeparatorThick_39x36",
HighlightOnFocus: "gamepaddialog_HighlightOnFocus_2HFrm",
Clickable: "gamepaddialog_Clickable_2Huzv",
Disabled: "gamepaddialog_Disabled_aIeh3",
WithBottomSeparator: "gamepaddialog_WithBottomSeparator_3YKpU",
"ItemFocusAnim-darkerGrey": "gamepaddialog_ItemFocusAnim-darkerGrey_3NU8G",
"ItemFocusAnim-darkGrey": "gamepaddialog_ItemFocusAnim-darkGrey_2NVMb",
FieldChildrenWithIcon: "gamepaddialog_FieldChildrenWithIcon_1aw7c",
FieldChildrenInner: "gamepaddialog_FieldChildrenInner_2o2fX",
FieldClickTarget: "gamepaddialog_FieldClickTarget_1cGG5",
FieldIcon: "gamepaddialog_FieldIcon_2DM37",
Front: "gamepaddialog_Front_2sj0i",
BeforeChildren: "gamepaddialog_BeforeChildren_1mbHa",
FieldLabelRow: "gamepaddialog_FieldLabelRow_2VcTl",
VerticalAlignCenter: "gamepaddialog_VerticalAlignCenter_16vVn",
InlineWrapShiftsChildrenBelow: "gamepaddialog_InlineWrapShiftsChildrenBelow_3LCXh",
ExtraPaddingOnChildrenBelow: "gamepaddialog_ExtraPaddingOnChildrenBelow_3nLNL",
ChildrenWidthFixed: "gamepaddialog_ChildrenWidthFixed_ljcbL",
ChildrenWidthGrow: "gamepaddialog_ChildrenWidthGrow_Jgod1",
WithFirstRow: "gamepaddialog_WithFirstRow_2bDqk",
WithChildrenBelow: "gamepaddialog_WithChildrenBelow_37xzV",
FieldLabel: "gamepaddialog_FieldLabel_3jMlJ",
FieldLabelValue: "gamepaddialog_FieldLabelValue_KGS2r",
FieldDescription: "gamepaddialog_FieldDescription_1W1to",
ModalPosition: "gamepaddialog_ModalPosition_3A5uj",
VR: "gamepaddialog_VR_3-Nqu",
WithStandardPadding: "gamepaddialog_WithStandardPadding_1XQXQ",
NoHeaderPadding: "gamepaddialog_NoHeaderPadding_1Y7qW",
ModalClickToDismiss: "gamepaddialog_ModalClickToDismiss_27uCS",
slideInAnimation: "gamepaddialog_slideInAnimation_2JseU",
ScrollWithin: "gamepaddialog_ScrollWithin_ze1or",
BasicTextInput: "gamepaddialog_BasicTextInput_3ZR32",
Toggle: "gamepaddialog_Toggle_9Ql-o",
ToggleRail: "gamepaddialog_ToggleRail_2bl0i",
On: "gamepaddialog_On_yLrDA",
ToggleSwitch: "gamepaddialog_ToggleSwitch_1PQpp",
LabelFieldValue: "gamepaddialog_LabelFieldValue_3pteV",
DropDownControlButtonContents: "gamepaddialog_DropDownControlButtonContents_3OHR1",
Spacer: "gamepaddialog_Spacer_2H-4-",
DropDownRow: "gamepaddialog_DropDownRow_1fwM1",
IconContainer: "gamepaddialog_IconContainer_3xrmZ",
Label: "gamepaddialog_Label_sNbXz",
ControlsListOuterPanel: "gamepaddialog_ControlsListOuterPanel_2XSsN",
StandardSpacing: "gamepaddialog_StandardSpacing_1_1cc",
ExtraSpacing: "gamepaddialog_ExtraSpacing_3CqNn",
ItemMaxSizeDesktop: "gamepaddialog_ItemMaxSizeDesktop_30JCQ",
AlignRight: "gamepaddialog_AlignRight_DfEz4",
AlignLeft: "gamepaddialog_AlignLeft_32h79",
AlignCenter: "gamepaddialog_AlignCenter_2ilj8",
FullWidth: "gamepaddialog_FullWidth_3vgH-",
ControlsListChild: "gamepaddialog_ControlsListChild_2LQjj",
"QuickAccess-Menu": "gamepaddialog_QuickAccess-Menu_1RRDR",
BottomButtons: "gamepaddialog_BottomButtons_UeBsD",
BackgroundAnimation: "gamepaddialog_BackgroundAnimation_3PwEE",
"ItemFocusAnim-darkerGrey-nocolor": "gamepaddialog_ItemFocusAnim-darkerGrey-nocolor_OLaBY",
"ItemFocusAnim-grey": "gamepaddialog_ItemFocusAnim-grey_2cC0L",
"ItemFocusAnim-translucent-white-10": "gamepaddialog_ItemFocusAnim-translucent-white-10_2ZXhF",
"ItemFocusAnim-translucent-white-20": "gamepaddialog_ItemFocusAnim-translucent-white-20_3FYJQ",
"ItemFocusAnimBorder-darkGrey": "gamepaddialog_ItemFocusAnimBorder-darkGrey_2bQL7",
"ItemFocusAnim-green": "gamepaddialog_ItemFocusAnim-green_3YEiB",
focusAnimation: "gamepaddialog_focusAnimation_27hQa",
hoverAnimation: "gamepaddialog_hoverAnimation_1n0zr",
};
},
11808: (e) => {
e.exports = { "duration-app-launch": "800ms", DropDownControlButton: "gamepaddropdown_DropDownControlButton_v8oJc" };
},
64699: (e) => {
e.exports = { TogglePasswordVisibilityBtn: "gamepadinput_TogglePasswordVisibilityBtn_2-fpY", Digits: "gamepadinput_Digits_c-4HN", PinDigit: "gamepadinput_PinDigit_15-eR" };
},
51921: (e) => {
e.exports = {
"duration-app-launch": "800ms",
PagedSettingsDialog: "gamepadpagedsettings_PagedSettingsDialog_33vqr",
PagedSettingsDialog_PageContent: "gamepadpagedsettings_PagedSettingsDialog_PageContent_3mgb-",
NoPadding: "gamepadpagedsettings_NoPadding_3ePFF",
PagedSettingsDialog_PageListColumn: "gamepadpagedsettings_PagedSettingsDialog_PageListColumn_1d6VI",
PagedSettingsDialog_Title: "gamepadpagedsettings_PagedSettingsDialog_Title_3aOHb",
PagedSettingsDialog_PageList: "gamepadpagedsettings_PagedSettingsDialog_PageList_gNwoz",
PagedSettingsDialog_PageList_DisableScrolling: "gamepadpagedsettings_PagedSettingsDialog_PageList_DisableScrolling_sMDrh",
PagedSettingsDialog_PageList_ShowTitle: "gamepadpagedsettings_PagedSettingsDialog_PageList_ShowTitle_3UfIN",
PageSettingsDialog_PageList_NoHeaderPadding: "gamepadpagedsettings_PageSettingsDialog_PageList_NoHeaderPadding_2EiZ3",
PagedSettingsDialog_PageListItem: "gamepadpagedsettings_PagedSettingsDialog_PageListItem_2mL2H",
DisabledItem: "gamepadpagedsettings_DisabledItem_1G3wh",
Active: "gamepadpagedsettings_Active_1ELdD",
"ItemFocusAnim-darkerGrey": "gamepadpagedsettings_ItemFocusAnim-darkerGrey_2Shps",
"ItemFocusAnim-darkGrey": "gamepadpagedsettings_ItemFocusAnim-darkGrey_2x0HR",
PageListItem_Icon: "gamepadpagedsettings_PageListItem_Icon_3f2IO",
PageListItem_Title: "gamepadpagedsettings_PageListItem_Title_4niDT",
Separator: "gamepadpagedsettings_Separator_3sUwu",
PagedSettingDialog_ContentColumn: "gamepadpagedsettings_PagedSettingDialog_ContentColumn_ZjHHX",
Up: "gamepadpagedsettings_Up_1dnQH",
ContentTransition: "gamepadpagedsettings_ContentTransition_1IuEv",
Enter: "gamepadpagedsettings_Enter_1GyNi",
EnterActive: "gamepadpagedsettings_EnterActive_3MKje",
Exit: "gamepadpagedsettings_Exit_3Xxqh",
ExitActive: "gamepadpagedsettings_ExitActive_13X1O",
Down: "gamepadpagedsettings_Down_1C1Jj",
BackgroundAnimation: "gamepadpagedsettings_BackgroundAnimation_5VEJ9",
"ItemFocusAnim-darkerGrey-nocolor": "gamepadpagedsettings_ItemFocusAnim-darkerGrey-nocolor_gmWXV",
"ItemFocusAnim-grey": "gamepadpagedsettings_ItemFocusAnim-grey_2_WUb",
"ItemFocusAnim-translucent-white-10": "gamepadpagedsettings_ItemFocusAnim-translucent-white-10_3JK1V",
"ItemFocusAnim-translucent-white-20": "gamepadpagedsettings_ItemFocusAnim-translucent-white-20_2PDwQ",
"ItemFocusAnimBorder-darkGrey": "gamepadpagedsettings_ItemFocusAnimBorder-darkGrey_21sRA",
"ItemFocusAnim-green": "gamepadpagedsettings_ItemFocusAnim-green_1JVe0",
focusAnimation: "gamepadpagedsettings_focusAnimation_2mE4Z",
hoverAnimation: "gamepadpagedsettings_hoverAnimation_2TiOQ",
};
},
23773: (e) => {
e.exports = {
"duration-app-launch": "800ms",
"error-shake-duration": "500ms",
SliderControlPanelGroup: "gamepadslider_SliderControlPanelGroup_198v6",
SliderControlAndNotches: "gamepadslider_SliderControlAndNotches_23hjX",
WithDefaultValue: "gamepadslider_WithDefaultValue_2vIQR",
SliderControl: "gamepadslider_SliderControl_1udlG",
Disabled: "gamepadslider_Disabled_35GyZ",
SliderTrack: "gamepadslider_SliderTrack_2_vG6",
SliderHasNotches: "gamepadslider_SliderHasNotches_1Lr71",
DefaultValueIsColorRange: "gamepadslider_DefaultValueIsColorRange_BKyEN",
DefaultValueColorLeft: "gamepadslider_DefaultValueColorLeft_3mRyv",
DefaultValueColorRight: "gamepadslider_DefaultValueColorRight_2KP6T",
SliderTrackDark: "gamepadslider_SliderTrackDark_20c10",
SliderHandleContainer: "gamepadslider_SliderHandleContainer_8xNY6",
VerticalLineSliderHandleContainer: "gamepadslider_VerticalLineSliderHandleContainer_2jnK7",
ParenSliderHandleContainer: "gamepadslider_ParenSliderHandleContainer_VKqgk",
SliderHandle: "gamepadslider_SliderHandle_11PBf",
SliderHandleFocusPop: "gamepadslider_SliderHandleFocusPop_1RC4f",
VerticalLineSliderHandle: "gamepadslider_VerticalLineSliderHandle_3zRgr",
ParenSliderHandle: "gamepadslider_ParenSliderHandle_2Yg4-",
Left: "gamepadslider_Left_2vrO5",
Icon: "gamepadslider_Icon_K9V_G",
SliderNotchContainer: "gamepadslider_SliderNotchContainer_2yM7S",
SliderNotch: "gamepadslider_SliderNotch_LYPXt",
AlignToEnds: "gamepadslider_AlignToEnds_VvfcC",
SliderNotchLabel: "gamepadslider_SliderNotchLabel_dbACW",
AlignToLeft: "gamepadslider_AlignToLeft_3jR_d",
AlignToRight: "gamepadslider_AlignToRight_OBP79",
SliderNotchTick: "gamepadslider_SliderNotchTick_u8QEa",
TickActive: "gamepadslider_TickActive_j418S",
LabelText: "gamepadslider_LabelText_1eMTv",
DescriptionValue: "gamepadslider_DescriptionValue_11I0_",
EditableValue: "gamepadslider_EditableValue_3aMli",
FakeEditableValue: "gamepadslider_FakeEditableValue_1iWWS",
RedBorder: "gamepadslider_RedBorder_2fKVy",
ErrorShake: "gamepadslider_ErrorShake_1Fa-z",
"error-shake": "gamepadslider_error-shake_1LFde",
CompoundSlider: "gamepadslider_CompoundSlider_2hwF2",
CompoundSliderSubSlider: "gamepadslider_CompoundSliderSubSlider_uOFmz",
Right: "gamepadslider_Right_3GOpB",
CompoundSliderSubSliderLabelContainer: "gamepadslider_CompoundSliderSubSliderLabelContainer_2iD1m",
CompoundSliderSubSliderLabelPositioner: "gamepadslider_CompoundSliderSubSliderLabelPositioner_3Tp7J",
CompoundSliderSubSliderLabel: "gamepadslider_CompoundSliderSubSliderLabel_2Yb0r",
CompoundSliderSubSliderLabelInternal: "gamepadslider_CompoundSliderSubSliderLabelInternal_38VX5",
DefaultValueTickContainer: "gamepadslider_DefaultValueTickContainer_2aCoH",
DefaultValueTick: "gamepadslider_DefaultValueTick_1NgUy",
BackgroundAnimation: "gamepadslider_BackgroundAnimation_34gou",
"ItemFocusAnim-darkerGrey-nocolor": "gamepadslider_ItemFocusAnim-darkerGrey-nocolor_3uBtl",
"ItemFocusAnim-darkerGrey": "gamepadslider_ItemFocusAnim-darkerGrey_1so9R",
"ItemFocusAnim-darkGrey": "gamepadslider_ItemFocusAnim-darkGrey_3rHHM",
"ItemFocusAnim-grey": "gamepadslider_ItemFocusAnim-grey_3bS2Y",
"ItemFocusAnim-translucent-white-10": "gamepadslider_ItemFocusAnim-translucent-white-10_1eyjV",
"ItemFocusAnim-translucent-white-20": "gamepadslider_ItemFocusAnim-translucent-white-20_1iqNj",
"ItemFocusAnimBorder-darkGrey": "gamepadslider_ItemFocusAnimBorder-darkGrey_2Pzyj",
"ItemFocusAnim-green": "gamepadslider_ItemFocusAnim-green_2C-5C",
};
},
3067: (e) => {
e.exports = {
"duration-app-launch": "800ms",
PagedSettingsDialog: "pagedsettings_PagedSettingsDialog_2sssI",
PagedSettingsDialog_PageContent: "pagedsettings_PagedSettingsDialog_PageContent_CFTLX",
NoPadding: "pagedsettings_NoPadding_qvR0K",
PagedSettingsDialog_PageListColumn: "pagedsettings_PagedSettingsDialog_PageListColumn_2kwFF",
Hidden: "pagedsettings_Hidden_1v7Jd",
NewNoteButton: "pagedsettings_NewNoteButton_g8SKU",
PagedSettingsDialog_Title: "pagedsettings_PagedSettingsDialog_Title_2rjVT",
PagedSettingsDialog_PageList: "pagedsettings_PagedSettingsDialog_PageList_18QCu",
PagedSettingsDialog_PageList_DisableScrolling: "pagedsettings_PagedSettingsDialog_PageList_DisableScrolling_yTqIu",
PagedSettingsDialog_PageListItem: "pagedsettings_PagedSettingsDialog_PageListItem_1-vlr",
PageListItem_Icon: "pagedsettings_PageListItem_Icon_1rD8X",
PageListItem_Title: "pagedsettings_PageListItem_Title_2PPbM",
DisabledItem: "pagedsettings_DisabledItem_oUzYn",
Active: "pagedsettings_Active_2DpXj",
PageListSpacer: "pagedsettings_PageListSpacer_3HW2U",
PageListSeparator: "pagedsettings_PageListSeparator_1Hye7",
Transparent: "pagedsettings_Transparent_1ahzM",
HidePageListButton: "pagedsettings_HidePageListButton_3LLH_",
};
},
66500: (e) => {
e.exports = { Group: "radio_Group_1ml4S", Button: "radio_Button_Hijmc", Active: "radio_Active_3-_jM" };
},
22820: (e) => {
e.exports = {
"duration-app-launch": "800ms",
ReorderableListDialog: "reorderablelist_ReorderableListDialog_2NTC7",
ModalHeader: "reorderablelist_ModalHeader_3JmF6",
CloseButtonContainer: "reorderablelist_CloseButtonContainer_3Pp8L",
ReorderableListIconIndexCtr: "reorderablelist_ReorderableListIconIndexCtr_3cPT1",
Selected: "reorderablelist_Selected_3HlFd",
ReorderableListIndexCtr: "reorderablelist_ReorderableListIndexCtr_bu2nP",
ReorderArrow: "reorderablelist_ReorderArrow_1jEeo",
ReorderableListIndex: "reorderablelist_ReorderableListIndex_3ZoWp",
ReorderableListItemLabel: "reorderablelist_ReorderableListItemLabel_2HB1m",
Disabled: "reorderablelist_Disabled_QkdPx",
ReorderableListItem: "reorderablelist_ReorderableListItem_ZO8-r",
BackgroundAnimation: "reorderablelist_BackgroundAnimation_3Jw1U",
"ItemFocusAnim-darkerGrey-nocolor": "reorderablelist_ItemFocusAnim-darkerGrey-nocolor_T4rhf",
"ItemFocusAnim-darkerGrey": "reorderablelist_ItemFocusAnim-darkerGrey_3gv_g",
"ItemFocusAnim-darkGrey": "reorderablelist_ItemFocusAnim-darkGrey_2Uq4O",
"ItemFocusAnim-grey": "reorderablelist_ItemFocusAnim-grey_8Gnfe",
"ItemFocusAnim-translucent-white-10": "reorderablelist_ItemFocusAnim-translucent-white-10_3iJJl",
"ItemFocusAnim-translucent-white-20": "reorderablelist_ItemFocusAnim-translucent-white-20_1bgRU",
"ItemFocusAnimBorder-darkGrey": "reorderablelist_ItemFocusAnimBorder-darkGrey_108fZ",
"ItemFocusAnim-green": "reorderablelist_ItemFocusAnim-green_1jzI2",
focusAnimation: "reorderablelist_focusAnimation_3yn4k",
hoverAnimation: "reorderablelist_hoverAnimation_3lmWT",
};
},
63561: (e) => {
e.exports = { Toggle: "toggle_Toggle_3Sl0Q", Disabled: "toggle_Disabled_M8qsA", ToggleRail: "toggle_ToggleRail_2Fw7g", Highlight: "toggle_Highlight_2OUxg", On: "toggle_On_317le", Off: "toggle_Off_3blKB", ToggleSwitch: "toggle_ToggleSwitch_3IWp5", ToggleRow: "toggle_ToggleRow_1MBq0", Label: "toggle_Label_1Dhs8" };
},
23663: (e) => {
e.exports = {
NewEmoticonIndicator: "emoticon_NewEmoticonIndicator_3O2gR",
NewEmoticonCircle: "emoticon_NewEmoticonCircle_JRMFr",
EmoticonSelector: "emoticon_EmoticonSelector_1_1QI",
emoticon: "emoticon_emoticon_AB86v",
large: "emoticon_large_4xBaT",
EmoticonSelector_Emoticons: "emoticon_EmoticonSelector_Emoticons_XWWY6",
EmoticonSelector_Separator: "emoticon_EmoticonSelector_Separator_2rvMU",
EmoticonSelector_SeparatorBackground: "emoticon_EmoticonSelector_SeparatorBackground_3_kYc",
EmoticonSelector_Controls: "emoticon_EmoticonSelector_Controls_2cdkF",
EmoticonSelector_Item: "emoticon_EmoticonSelector_Item_2C8r7",
EmoticonSelector_Item_New: "emoticon_EmoticonSelector_Item_New_1vWJH",
EffectHeading: "emoticon_EffectHeading_2-uNY",
StickerHeading: "emoticon_StickerHeading_3-4KS",
GetFestive: "emoticon_GetFestive_1tX6q",
TopDivider: "emoticon_TopDivider_2A8Fl",
BottomDivider: "emoticon_BottomDivider_2IZ1K",
StickerButton: "emoticon_StickerButton_3Wc3j",
EffectButton: "emoticon_EffectButton_nnnSn",
EmoticonHover: "emoticon_EmoticonHover_36iQ4",
Info: "emoticon_Info_1EGMu",
Name: "emoticon_Name_1Ancw",
AppName: "emoticon_AppName_335w0",
StickerHoverSticker: "emoticon_StickerHoverSticker_2VN79",
EffectHoverEffect: "emoticon_EffectHoverEffect_3ngRv",
PickerTab: "emoticon_PickerTab_3JpKJ",
Clock: "emoticon_Clock_2osi8",
EmoticonItem: "emoticon_EmoticonItem_gZL64",
};
},
95762: (e) => {
e.exports = { Emoticon_Toggle: "emoticonsuggestion_Emoticon_Toggle_Y5J3n", Active: "emoticonsuggestion_Active_YCbwL", Emoticon: "emoticonsuggestion_Emoticon_2o57_" };
},
29324: (e) => {
e.exports = {
Header1: "eventbbcodeparser_Header1_SPYFj",
Header2: "eventbbcodeparser_Header2_QuKtT",
Header3: "eventbbcodeparser_Header3_3s7cU",
Link: "eventbbcodeparser_Link_29bMZ",
LinkHost: "eventbbcodeparser_LinkHost_16eO9",
LinkButton: "eventbbcodeparser_LinkButton_2HnDg",
UnorderedList: "eventbbcodeparser_UnorderedList_2FoSx",
OrderedList: "eventbbcodeparser_OrderedList_vV4Iw",
StoreWidget: "eventbbcodeparser_StoreWidget_36Y-l",
MedalTVWidget: "eventbbcodeparser_MedalTVWidget_1j2vi",
LoyaltyRewardCtn: "eventbbcodeparser_LoyaltyRewardCtn_14p7R",
SaleSectionCtn: "eventbbcodeparser_SaleSectionCtn_39HWX",
SaleTextCtn: "eventbbcodeparser_SaleTextCtn_2Tqq0",
ReminderCtn: "eventbbcodeparser_ReminderCtn_25AZk",
BlockQuote: "eventbbcodeparser_BlockQuote_2cY7b",
SocialLink: "eventbbcodeparser_SocialLink_2LAnc",
SocialIcon: "eventbbcodeparser_SocialIcon_dDjYN",
LocalizeBlock: "eventbbcodeparser_LocalizeBlock_1oBce",
CheckMark: "eventbbcodeparser_CheckMark_24AtT",
ScreenshotCarousel: "eventbbcodeparser_ScreenshotCarousel_3uA0h",
};
},
47013: (e) => {
e.exports = {
FlexColumnContainer: "eventreminder_FlexColumnContainer_15ufN",
FullStartTime: "eventreminder_FullStartTime_1YLHW",
ReminderDialog: "eventreminder_ReminderDialog_3YUEY",
ReminderOptions: "eventreminder_ReminderOptions_1Tp8K",
ReminderBackground: "eventreminder_ReminderBackground_TNf9_",
ReminderExpandsLeft: "eventreminder_ReminderExpandsLeft_38Xly",
ReminderOption: "eventreminder_ReminderOption_26nnh",
Unverified: "eventreminder_Unverified_1dcmA",
CheckboxWrapper: "eventreminder_CheckboxWrapper_1xuKE",
ReminderCheckBox: "eventreminder_ReminderCheckBox_vPo2j",
IconMode: "eventreminder_IconMode_1YjsR",
RemindBell: "eventreminder_RemindBell_3-_M2",
RemindCheck: "eventreminder_RemindCheck_2qaPr",
ReminderDefault: "eventreminder_ReminderDefault_19p2Q",
TextMode: "eventreminder_TextMode_553rC",
ReminderCheck: "eventreminder_ReminderCheck_3fMhC",
ReminderOpennedOptions: "eventreminder_ReminderOpennedOptions_vBuhk",
ReminderOptionsHeader: "eventreminder_ReminderOptionsHeader_2oOZC",
ReminderCalendarOptions: "eventreminder_ReminderCalendarOptions_VO6FS",
ReminderSettings: "eventreminder_ReminderSettings_2Pn59",
ReminderNotes: "eventreminder_ReminderNotes_3qE0w",
RpcThrobber: "eventreminder_RpcThrobber_3F3aB",
};
},
70404: (e) => {
e.exports = {
"duration-app-launch": "800ms",
PartnerEventFont: "partnereventshared_PartnerEventFont_LK4bX",
Clear: "partnereventshared_Clear_3UhsQ",
Divider: "partnereventshared_Divider_3B5HO",
EventDefaultRowContainer: "partnereventshared_EventDefaultRowContainer_3WO6c",
EventStartPublic: "partnereventshared_EventStartPublic_2LU_Y",
EventOptions: "partnereventshared_EventOptions_2r_Qe",
EventStatusContainer: "partnereventshared_EventStatusContainer_vOPSZ",
FlexColumnContainer: "partnereventshared_FlexColumnContainer_1qhLq",
FlexRowContainer: "partnereventshared_FlexRowContainer_Ke5f1",
Centered: "partnereventshared_Centered_qy-9m",
FlexContainSpaceBetween: "partnereventshared_FlexContainSpaceBetween_3nPGW",
FlexRowWrapSpaceBetweenContainer: "partnereventshared_FlexRowWrapSpaceBetweenContainer_19CjI",
FlexRowWrapFlexStartContainer: "partnereventshared_FlexRowWrapFlexStartContainer_tyP_c",
SaveBackground: "partnereventshared_SaveBackground_V0mbI",
SupportedGroupLabel: "partnereventshared_SupportedGroupLabel_APmJN",
LanguageWithContent: "partnereventshared_LanguageWithContent_2Cd1u",
LargeInput: "partnereventshared_LargeInput_fq68I",
InputBorder: "partnereventshared_InputBorder_Obyys",
RadioOption: "partnereventshared_RadioOption_3iJX1",
FlexGrow: "partnereventshared_FlexGrow_1KvZA",
EventEditorTextTitleCtn: "partnereventshared_EventEditorTextTitleCtn_htm7d",
doclink: "partnereventshared_doclink_1-bAK",
EventEditorUnpaddedTextTitle: "partnereventshared_EventEditorUnpaddedTextTitle_9hsCL",
EventEditorTextTitle: "partnereventshared_EventEditorTextTitle_18fHx",
EventEditorTextTitleLengthInfo: "partnereventshared_EventEditorTextTitleLengthInfo_2nHJ1",
CollapsableSectionTitle: "partnereventshared_CollapsableSectionTitle_2zejQ",
SectionTitle: "partnereventshared_SectionTitle_7Qc_e",
EventSectionTitleCtn: "partnereventshared_EventSectionTitleCtn_onqWK",
EventSectionTitle: "partnereventshared_EventSectionTitle_Idd_A",
EventSectionSpacer: "partnereventshared_EventSectionSpacer_1Bloe",
EventSectionMoreBtn: "partnereventshared_EventSectionMoreBtn_uckBi",
EventEditorSpacerPadding: "partnereventshared_EventEditorSpacerPadding_1RBfN",
EventEditorVisibilityCtn: "partnereventshared_EventEditorVisibilityCtn_1nqBh",
EventEditorTextSubTitle: "partnereventshared_EventEditorTextSubTitle_1i_pY",
FloatingTitle: "partnereventshared_FloatingTitle_31XRt",
EventEditorEventStatus: "partnereventshared_EventEditorEventStatus_2JGoL",
EventHidden: "partnereventshared_EventHidden_2H6fn",
EventVisible: "partnereventshared_EventVisible_3Z0Qr",
EventBarBackAndTitle: "partnereventshared_EventBarBackAndTitle_2rTjP",
EventBarTitleCtn: "partnereventshared_EventBarTitleCtn_WfVze",
EventBarTitle: "partnereventshared_EventBarTitle_29kVX",
EventEditButtons: "partnereventshared_EventEditButtons_3nYmf",
EventStatus: "partnereventshared_EventStatus_1sOFB",
EventBarBack: "partnereventshared_EventBarBack_s3r9b",
EditPreviewButton: "partnereventshared_EditPreviewButton_1FhZQ",
Delete: "partnereventshared_Delete_32kR7",
Disabled: "partnereventshared_Disabled_2wVCx",
BrowseMoreButton: "partnereventshared_BrowseMoreButton_1Yrcl",
Button: "partnereventshared_Button_1ABCO",
Icon: "partnereventshared_Icon_1dDpS",
Primary: "partnereventshared_Primary_30ipl",
ClearThings: "partnereventshared_ClearThings_3x_qL",
OnIndicator: "partnereventshared_OnIndicator_1GBsB",
OffIndicator: "partnereventshared_OffIndicator_w0I94",
IconImage: "partnereventshared_IconImage_2RY89",
RightColumnContainer: "partnereventshared_RightColumnContainer_30-E9",
EventPublishButton: "partnereventshared_EventPublishButton_3nIAe",
FloatRight: "partnereventshared_FloatRight_1bzHf",
TTip: "partnereventshared_TTip_2aWuk",
ValveSupportOnly: "partnereventshared_ValveSupportOnly_wC6-U",
ArtworkAgeNotAppropriate: "partnereventshared_ArtworkAgeNotAppropriate_3V64Z",
EventDashboardHeader: "partnereventshared_EventDashboardHeader_2kZr_",
ContainerSpaceBetween: "partnereventshared_ContainerSpaceBetween_3gYZG",
EventDashboardTitles: "partnereventshared_EventDashboardTitles_1ym4r",
EventDashboardActions: "partnereventshared_EventDashboardActions_2z_02",
EventDashboardStatsCtn: "partnereventshared_EventDashboardStatsCtn_3IptF",
EventDashboardAppCtn: "partnereventshared_EventDashboardAppCtn_2iPrK",
maintitle: "partnereventshared_maintitle_vEk_z",
AppTitle: "partnereventshared_AppTitle_l-Ow7",
subtitle: "partnereventshared_subtitle_2mJfc",
ValveOnlyBackground: "partnereventshared_ValveOnlyBackground_Jckrn",
ValveOnlyAdminBackground: "partnereventshared_ValveOnlyAdminBackground_3HVu1",
Columns: "partnereventshared_Columns_1oVIR",
LeftCol: "partnereventshared_LeftCol_3PPz-",
RightCol: "partnereventshared_RightCol_25xel",
DropDownScroll: "partnereventshared_DropDownScroll_1CewB",
DropDownScrollItem: "partnereventshared_DropDownScrollItem_3D3hC",
CloseButton: "partnereventshared_CloseButton_gR2gS",
CloseSectionTools: "partnereventshared_CloseSectionTools_1d0D9",
HalfColumn: "partnereventshared_HalfColumn_3Xmp4",
tooltip_Ctn: "partnereventshared_tooltip_Ctn_3nqxI",
SaleEditorSpacing: "partnereventshared_SaleEditorSpacing_2ZGwd",
SaleSectionHeader: "partnereventshared_SaleSectionHeader_2WMiQ",
SaleSectionSubtitle: "partnereventshared_SaleSectionSubtitle_2rIaW",
SaleSectionContainer: "partnereventshared_SaleSectionContainer_3gb3J",
AddSectionButton: "partnereventshared_AddSectionButton_2_djj",
EventElementRequired: "partnereventshared_EventElementRequired_12rm6",
EventElementOptional: "partnereventshared_EventElementOptional_1mpG6",
HelperTooltip: "partnereventshared_HelperTooltip_3T6MQ",
PixelOffsetCtn: "partnereventshared_PixelOffsetCtn_3Xk96",
PixelOffsetRow: "partnereventshared_PixelOffsetRow_2PtWb",
PixelOffsetNote: "partnereventshared_PixelOffsetNote_JjEwa",
PixelOffsetCallout: "partnereventshared_PixelOffsetCallout_f5QZT",
Error: "partnereventshared_Error_mSSED",
GamepadOnlyScrollPanel: "partnereventshared_GamepadOnlyScrollPanel_2NO6w",
};
},
44864: (e) => {
e.exports = { SpeakerOuter: "presenterpopup_SpeakerOuter_3rRqP", Speaker: "presenterpopup_Speaker_3F7-F", SpeakerPopup: "presenterpopup_SpeakerPopup_3y7kV", SpeakerInfoOuter: "presenterpopup_SpeakerInfoOuter_1NC9n", SpeakerInfoInner: "presenterpopup_SpeakerInfoInner_1bMpE", SpeakerTitle: "presenterpopup_SpeakerTitle_2Vo0l", SpeakerBio: "presenterpopup_SpeakerBio_2yP7s", SpeakerHover: "presenterpopup_SpeakerHover_16UyH" };
},
71411: (e) => {
e.exports = { ErrorDiv: "saleeventbbcodeparser_ErrorDiv_XeZEx" };
},
40155: (e) => {
e.exports = { Dark: "footericons_Dark_2UAf_", Background: "footericons_Background_yjs9m", Foreground: "footericons_Foreground_JgT6Z", Light: "footericons_Light_1LgIo", Knockout: "footericons_Knockout_3BGwJ", SizeSmall: "footericons_SizeSmall_1Zc5j", SizeMedium: "footericons_SizeMedium_12wgo", SizeLarge: "footericons_SizeLarge_3E-9r", ChordSummary: "footericons_ChordSummary_2NB_h" };
},
3987: (e) => {
e.exports = { "duration-app-launch": "800ms", Heading: "managefriends_Heading_3kTQI", Body: "managefriends_Body_2s393", HeaderBlock: "managefriends_HeaderBlock_X9bYN", Background: "managefriends_Background_1xwi0", DimBackground: "managefriends_DimBackground_2N55H", Input: "managefriends_Input_1BUty", CopyContainer: "managefriends_CopyContainer_1HjkZ", Text: "managefriends_Text_1ehqR", Link: "managefriends_Link_18Sc0", Button: "managefriends_Button_2772E", GenerateLinkButton: "managefriends_GenerateLinkButton_T52tU", ProfileCard: "managefriends_ProfileCard_28a_C", UserContainer: "managefriends_UserContainer_29w-2", Image: "managefriends_Image_1n4lD", ProfileContent: "managefriends_ProfileContent_1qz9x", ProfileLink: "managefriends_ProfileLink_1tEt0", Failure: "managefriends_Failure_UoMCo", Success: "managefriends_Success_zNkyw", FriendCodeSelector: "managefriends_FriendCodeSelector_3nmSp", SendInviteButton: "managefriends_SendInviteButton_kcAlk" };
},
96139: (e) => {
e.exports = { Spinner: "gamepadui_svg_library_Spinner_3m_2l", SpinnerSpokeFade: "gamepadui_svg_library_SpinnerSpokeFade_2Wg5d", WirelessConnectingActive: "gamepadui_svg_library_WirelessConnectingActive_cop8-", WifiBar1: "gamepadui_svg_library_WifiBar1_1o6HA", WifiBar1Anim: "gamepadui_svg_library_WifiBar1Anim_1PDAZ", WifiBar2: "gamepadui_svg_library_WifiBar2_1q8-n", WifiBar2Anim: "gamepadui_svg_library_WifiBar2Anim_QyijT", WifiBar3: "gamepadui_svg_library_WifiBar3_23ih_", WifiBar3Anim: "gamepadui_svg_library_WifiBar3Anim_2wGDz", WifiBar4: "gamepadui_svg_library_WifiBar4_2DSRH", WifiBar4Anim: "gamepadui_svg_library_WifiBar4Anim_3jrA8", GenericGamepadHighlight: "gamepadui_svg_library_GenericGamepadHighlight_3-ZZD", GenericGamepadEmpty: "gamepadui_svg_library_GenericGamepadEmpty_1toTl" };
},
49269: (e) => {
e.exports = {
"duration-app-launch": "800ms",
PanelSection: "quickaccesscontrols_PanelSection_3gY0a",
PanelSectionTitle: "quickaccesscontrols_PanelSectionTitle_1IigU",
Text: "quickaccesscontrols_Text_1cokl",
PanelSectionRow: "quickaccesscontrols_PanelSectionRow_3LM_Z",
Label: "quickaccesscontrols_Label_2HohC",
ComingSoon: "quickaccesscontrols_ComingSoon_3GXel",
QuickAccessNotifications: "quickaccesscontrols_QuickAccessNotifications_2qO6x",
VR: "quickaccesscontrols_VR_1sOgl",
EmptyNotifications: "quickaccesscontrols_EmptyNotifications_1W8Ty",
LowBattery: "quickaccesscontrols_LowBattery_3R8-d",
ReallyLow: "quickaccesscontrols_ReallyLow_1iaw2",
LowBatteryGauge: "quickaccesscontrols_LowBatteryGauge_yBJZj",
Remaining: "quickaccesscontrols_Remaining_1tx3e",
BatterySectionContainer: "quickaccesscontrols_BatterySectionContainer_2prtQ",
BatteryIcon: "quickaccesscontrols_BatteryIcon_1BT6i",
BatteryPercentageLabel: "quickaccesscontrols_BatteryPercentageLabel_3S2zx",
BatteryDetailsLabels: "quickaccesscontrols_BatteryDetailsLabels_2jtM9",
BatteryProjectedValue: "quickaccesscontrols_BatteryProjectedValue_3ISN8",
BatteryProjectedLabel: "quickaccesscontrols_BatteryProjectedLabel_1N4s2",
BackgroundAnimation: "quickaccesscontrols_BackgroundAnimation_nTEVK",
"ItemFocusAnim-darkerGrey-nocolor": "quickaccesscontrols_ItemFocusAnim-darkerGrey-nocolor_2HixS",
"ItemFocusAnim-darkerGrey": "quickaccesscontrols_ItemFocusAnim-darkerGrey_qTKB3",
"ItemFocusAnim-darkGrey": "quickaccesscontrols_ItemFocusAnim-darkGrey_3s1Va",
"ItemFocusAnim-grey": "quickaccesscontrols_ItemFocusAnim-grey_1DbWa",
"ItemFocusAnim-translucent-white-10": "quickaccesscontrols_ItemFocusAnim-translucent-white-10_wzXlo",
"ItemFocusAnim-translucent-white-20": "quickaccesscontrols_ItemFocusAnim-translucent-white-20_2l5JI",
"ItemFocusAnimBorder-darkGrey": "quickaccesscontrols_ItemFocusAnimBorder-darkGrey_3wM82",
"ItemFocusAnim-green": "quickaccesscontrols_ItemFocusAnim-green_1-PV8",
focusAnimation: "quickaccesscontrols_focusAnimation_38pAq",
hoverAnimation: "quickaccesscontrols_hoverAnimation_r9xRK",
};
},
52112: (e) => {
e.exports = { ScrollFade: "scrollfade_ScrollFade_30Xro", ScrolledToTop: "scrollfade_ScrolledToTop_3bWn5", ScrolledToBottom: "scrollfade_ScrolledToBottom_2wvQS" };
},
25548: (e) => {
e.exports = { "duration-app-launch": "800ms", FriendsListInsetShadowCtn: "insetshadow_FriendsListInsetShadowCtn_1qeW3", FriendListInsetShadowTop: "insetshadow_FriendListInsetShadowTop_1osHa", FriendListInsetShadowBottom: "insetshadow_FriendListInsetShadowBottom_2OoTJ" };
},
8314: (e) => {
e.exports = { DateAndTime: "localdateandtime_DateAndTime_2V6GL", DateAndTimeInline: "localdateandtime_DateAndTimeInline_HZ6b2", At: "localdateandtime_At_Fn5EU", ActiveEvent: "localdateandtime_ActiveEvent_rT7Ek", ActiveEventCallOut: "localdateandtime_ActiveEventCallOut_2pJft", RightSideTitles: "localdateandtime_RightSideTitles_4LAnP", DateToolTip: "localdateandtime_DateToolTip_2E5LH", ShortDateAndTime: "localdateandtime_ShortDateAndTime_MBkkh", ShortDateRange: "localdateandtime_ShortDateRange_3CN6I" };
},
53600: (e) => {
e.exports = { BodyNoScroll: "modals_BodyNoScroll_1Xs5d", BodyNoScrollDialog: "modals_BodyNoScrollDialog_3jhMI", OverlayModal: "modals_OverlayModal_24YFX", GamepadOnlyModalWrapper: "modals_GamepadOnlyModalWrapper_1GlTs", GamepadOnlyPanelWrapper: "modals_GamepadOnlyPanelWrapper_1aY-r" };
},
187: (e) => {
e.exports = { QRBits: "qrcode_QRBits_3BALY", Bit: "qrcode_Bit_1YVDT", Active: "qrcode_Active_1zNnN" };
},
87149: (e) => {
e.exports = { SegmentedCharacterInput: "segmentedinputs_SegmentedCharacterInput_1gzkm", Disabled: "segmentedinputs_Disabled_4Wrcv", Danger: "segmentedinputs_Danger_3lEvx", BackupCode: "segmentedinputs_BackupCode_V5oAz", Loading: "segmentedinputs_Loading_3khV2", Input: "segmentedinputs_Input_3xcXq" };
},
94729: (e) => {
e.exports = { ManualOverlayContainer: "logsettings_ManualOverlayContainer_jKuCG", DropDownRow: "logsettings_DropDownRow_cv_p8", IconContainer: "logsettings_IconContainer_ka3_o", Label: "logsettings_Label_3ces1" };
},
65059: (e) => {
e.exports = { v6: "shared_common_v6_2Lxgd", SubText: "shared_common_SubText_vg0EO", AvatarImageContainer: "shared_common_AvatarImageContainer_33hdF", GameImageContainer: "shared_common_GameImageContainer_2OYAD", AvatarImage: "shared_common_AvatarImage_2CQYc", STV_HomeGridPreviewDetails: "shared_common_STV_HomeGridPreviewDetails_Yncr-", ChatAvatarImage: "shared_common_ChatAvatarImage_1cUR_", EditButton: "shared_common_EditButton_VsZ-b", Small: "shared_common_Small_3M4j8", FlexCenter: "shared_common_FlexCenter_1R3yc", ThrobberCtn: "shared_common_ThrobberCtn_3m7p6", MarkdownLink: "shared_common_MarkdownLink_1Wqum", SummaryTextArea: "shared_common_SummaryTextArea_cNMZ-", RemoveIcon: "shared_common_RemoveIcon_3NeLW" };
},
35313: (e) => {
e.exports = { "duration-app-launch": "800ms", EmoticonBow: "shared_svg_library_EmoticonBow_2Llzt", EmoticonBow_st0: "shared_svg_library_EmoticonBow_st0_Fw2WG", EmoticonBow_st1: "shared_svg_library_EmoticonBow_st1_luj0t", SteamDeckCompatInfo: "shared_svg_library_SteamDeckCompatInfo_3VPnv", SteamDeckCompatLogo: "shared_svg_library_SteamDeckCompatLogo_1dzQL", SteamDeckCompatIcon: "shared_svg_library_SteamDeckCompatIcon_3hAj0", SteamDeckCompatVerified: "shared_svg_library_SteamDeckCompatVerified_kEODD", SteamDeckCompatPlayable: "shared_svg_library_SteamDeckCompatPlayable_mPD42", SteamDeckCompatUnsupported: "shared_svg_library_SteamDeckCompatUnsupported_2LAax", SteamDeckCompatUnknown: "shared_svg_library_SteamDeckCompatUnknown_xBqU_" };
},
87805: (e) => {
e.exports = { "duration-app-launch": "800ms", mentionDialogPosition: "suggestdialog_mentionDialogPosition_3isL0", mentionDialog: "suggestdialog_mentionDialog_1QU3c", mentionSearchText: "suggestdialog_mentionSearchText_1xVcZ", suggestOption: "suggestdialog_suggestOption_vquL9", mentionSearchOption: "suggestdialog_mentionSearchOption_3O0sM", manyMatches: "suggestdialog_manyMatches_1cweL", selected: "suggestdialog_selected_boNOG", nickname: "suggestdialog_nickname_2dKJq", mentionSearchMatch: "suggestdialog_mentionSearchMatch_2_0t_" };
},
54196: (e) => {
e.exports = {
LoadingWrapper: "throbber_LoadingWrapper_2wAKy",
Static: "throbber_Static_1Qfwp",
none: "throbber_none_1F0lz",
bottomCircle: "throbber_bottomCircle_2qjZm",
noString: "throbber_noString_1Sy0p",
Throbber: "throbber_Throbber_lYUEj",
throbber_small: "throbber_throbber_small_2zbyh",
throbber_medium: "throbber_throbber_medium_2CphU",
throbber_large: "throbber_throbber_large_1x18v",
throbber_center_wrapper: "throbber_throbber_center_wrapper_3IYPz",
ThrobberText: "throbber_ThrobberText_21nVi",
blur: "throbber_blur_1ctjA",
ThrobberRoundLoop: "throbber_ThrobberRoundLoop_1O-cW",
roundOuterOutline: "throbber_roundOuterOutline_1Vv--",
roundOuter: "throbber_roundOuter_2K0Lz",
roundFill: "throbber_roundFill_3sQFk",
ThrobberFillLoop: "throbber_ThrobberFillLoop_ofdi9",
topCircle: "throbber_topCircle_1LZff",
circlePulse: "throbber_circlePulse_1XN6Z",
ThrobberTopCircleLoop: "throbber_ThrobberTopCircleLoop_1jALk",
ThrobberBottomCircleLoop: "throbber_ThrobberBottomCircleLoop_1KvOg",
roundThrobber15: "throbber_roundThrobber15_2LGHp",
roundThrobber14: "throbber_roundThrobber14_2FGCn",
roundThrobber13: "throbber_roundThrobber13_1X-5j",
roundThrobber12: "throbber_roundThrobber12_1pj1Q",
roundThrobber11: "throbber_roundThrobber11_xFmZa",
roundThrobber10: "throbber_roundThrobber10_3MGYo",
roundThrobber09: "throbber_roundThrobber09_ktVJ4",
roundThrobber08: "throbber_roundThrobber08_3s_7m",
roundThrobber07: "throbber_roundThrobber07_11MVp",
roundThrobber06: "throbber_roundThrobber06_2cl-m",
roundThrobber05: "throbber_roundThrobber05_3-JE0",
roundThrobber04: "throbber_roundThrobber04_1xNIK",
roundThrobber03: "throbber_roundThrobber03_1S17y",
roundThrobber02: "throbber_roundThrobber02_1-oUJ",
roundThrobber01: "throbber_roundThrobber01_2tXge",
ThrobberRoundLoopThickness: "throbber_ThrobberRoundLoopThickness_1fs4R",
throbber_xlarge: "throbber_throbber_xlarge_1gYeZ",
throbber_xxlarge: "throbber_throbber_xxlarge_3j-p4",
ThrobberDelayAppear: "throbber_ThrobberDelayAppear_I3aEq",
Visible: "throbber_Visible_2SwSJ",
NewThrobber: "throbber_NewThrobber_1m8iQ",
};
},
10491: (e) => {
e.exports = { TextToolTip: "tooltip_TextToolTip_2FxbH", ToolTipCustom: "tooltip_ToolTipCustom_3XGRk", ToolTipTitle: "tooltip_ToolTipTitle_1LhVf", Center: "tooltip_Center_2ZDqE", ToolTipInsetContent: "tooltip_ToolTipInsetContent_i4LuY" };
},
5430: (e) => {
e.exports = { TransitionGroup: "overlappingtransition_TransitionGroup_2PuNB", ContentWrapper: "overlappingtransition_ContentWrapper_MGaAv" };
},
37174: (e) => {
e.exports = {
confettiDurationMs: "7000s/s",
goldfettiDurationMs: "7000s/s",
goldfettiColorsNum: "3",
goldfettiEmojiNum: "4",
crackerDurationMs: "300s/s",
balloonsDurationMs: "4000s/s",
balloonsDurationS: "4s/s",
balloonsDurationJitterS: "1s/s",
balloonsDurationMaxMs: "5000s/s",
snowballDurationMs: "3010s/s",
snowballSpeed: "1s",
"animation-container": "chatroomeffects_animation-container_3ZR8Q",
Snowflake: "chatroomeffects_Snowflake_cZ5Au",
"Snowflake-0": "chatroomeffects_Snowflake-0_2-hBh",
"snowflake-0": "chatroomeffects_snowflake-0_U-YAV",
"Snowflake-1": "chatroomeffects_Snowflake-1_2b67l",
"snowflake-1": "chatroomeffects_snowflake-1_2Rb7w",
"Snowflake-2": "chatroomeffects_Snowflake-2_2_NWs",
"snowflake-2": "chatroomeffects_snowflake-2_1Y4tS",
"Snowflake-3": "chatroomeffects_Snowflake-3_cBxtQ",
"snowflake-3": "chatroomeffects_snowflake-3_3t5Lt",
"Snowflake-4": "chatroomeffects_Snowflake-4_1JQNl",
"snowflake-4": "chatroomeffects_snowflake-4_1vyLw",
"Snowflake-5": "chatroomeffects_Snowflake-5_cUP1f",
"snowflake-5": "chatroomeffects_snowflake-5_3louc",
"Snowflake-6": "chatroomeffects_Snowflake-6_2F8cs",
"snowflake-6": "chatroomeffects_snowflake-6_3Hfej",
"Snowflake-7": "chatroomeffects_Snowflake-7_zJ9BE",
"snowflake-7": "chatroomeffects_snowflake-7_nX1rZ",
"Snowflake-8": "chatroomeffects_Snowflake-8_3BAdG",
"snowflake-8": "chatroomeffects_snowflake-8_WFJba",
"Snowflake-9": "chatroomeffects_Snowflake-9_2DNE8",
"snowflake-9": "chatroomeffects_snowflake-9_1m6q0",
"Snowflake-10": "chatroomeffects_Snowflake-10_19m8q",
"snowflake-10": "chatroomeffects_snowflake-10_3HhrW",
"Snowflake-11": "chatroomeffects_Snowflake-11_ijWSF",
"snowflake-11": "chatroomeffects_snowflake-11_vukho",
"Snowflake-12": "chatroomeffects_Snowflake-12_Ripsa",
"snowflake-12": "chatroomeffects_snowflake-12_2KXNx",
"Snowflake-13": "chatroomeffects_Snowflake-13__5IUE",
"snowflake-13": "chatroomeffects_snowflake-13_35I49",
"Snowflake-14": "chatroomeffects_Snowflake-14_pmIdk",
"snowflake-14": "chatroomeffects_snowflake-14_1MH-J",
"Snowflake-15": "chatroomeffects_Snowflake-15_2nQdH",
"snowflake-15": "chatroomeffects_snowflake-15_ek7ku",
"Snowflake-16": "chatroomeffects_Snowflake-16_lJyG7",
"snowflake-16": "chatroomeffects_snowflake-16_20hUR",
"Snowflake-17": "chatroomeffects_Snowflake-17_1L0AZ",
"snowflake-17": "chatroomeffects_snowflake-17_3CfBV",
"Snowflake-18": "chatroomeffects_Snowflake-18_1ozac",
"snowflake-18": "chatroomeffects_snowflake-18_HP-ye",
"Snowflake-19": "chatroomeffects_Snowflake-19_FOXzc",
"snowflake-19": "chatroomeffects_snowflake-19_1d9D9",
"Snowflake-20": "chatroomeffects_Snowflake-20_Qt7pR",
"snowflake-20": "chatroomeffects_snowflake-20_2N-xe",
confetti: "chatroomeffects_confetti_VelNh",
"confetti-0": "chatroomeffects_confetti-0_tlO-i",
"drop-0": "chatroomeffects_drop-0__37zJ",
"confetti-1": "chatroomeffects_confetti-1_3OuSs",
"drop-1": "chatroomeffects_drop-1_x-HP7",
"confetti-2": "chatroomeffects_confetti-2_1mdZ0",
"drop-2": "chatroomeffects_drop-2_3XfWb",
"confetti-3": "chatroomeffects_confetti-3_36OCs",
"drop-3": "chatroomeffects_drop-3_OTZKZ",
"confetti-4": "chatroomeffects_confetti-4_3NbOc",
"drop-4": "chatroomeffects_drop-4_1CAil",
"confetti-5": "chatroomeffects_confetti-5_VnTYG",
"drop-5": "chatroomeffects_drop-5_1pPPC",
"confetti-6": "chatroomeffects_confetti-6_3KEfm",
"drop-6": "chatroomeffects_drop-6_4Wj8s",
"confetti-7": "chatroomeffects_confetti-7_1C-Ak",
"drop-7": "chatroomeffects_drop-7_oHsjU",
"confetti-8": "chatroomeffects_confetti-8_4oJYN",
"drop-8": "chatroomeffects_drop-8_2y189",
"confetti-9": "chatroomeffects_confetti-9_1bEjR",
"drop-9": "chatroomeffects_drop-9_5c9w0",
"confetti-10": "chatroomeffects_confetti-10_1oRBM",
"drop-10": "chatroomeffects_drop-10_1L13_",
"confetti-11": "chatroomeffects_confetti-11_3W9ZL",
"drop-11": "chatroomeffects_drop-11_vYvGB",
"confetti-12": "chatroomeffects_confetti-12_2TwZ0",
"drop-12": "chatroomeffects_drop-12_3b2Dc",
"confetti-13": "chatroomeffects_confetti-13_1m8Vr",
"drop-13": "chatroomeffects_drop-13_2n4ZP",
"confetti-14": "chatroomeffects_confetti-14_1YV6p",
"drop-14": "chatroomeffects_drop-14_xQzPb",
"confetti-15": "chatroomeffects_confetti-15_2D2LH",
"drop-15": "chatroomeffects_drop-15_oKVqM",
"confetti-16": "chatroomeffects_confetti-16_pvt2J",
"drop-16": "chatroomeffects_drop-16_T5UBd",
"confetti-17": "chatroomeffects_confetti-17_2NCF0",
"drop-17": "chatroomeffects_drop-17_1d8Dj",
"confetti-18": "chatroomeffects_confetti-18_o_Hf7",
"drop-18": "chatroomeffects_drop-18_1zoqm",
"confetti-19": "chatroomeffects_confetti-19_28L_3",
"drop-19": "chatroomeffects_drop-19_1zkpz",
"confetti-20": "chatroomeffects_confetti-20_P-SKX",
"drop-20": "chatroomeffects_drop-20_2HmVc",
"confetti-21": "chatroomeffects_confetti-21_27GkO",
"drop-21": "chatroomeffects_drop-21_1T4Mt",
"confetti-22": "chatroomeffects_confetti-22_1sCDh",
"drop-22": "chatroomeffects_drop-22_2svz8",
"confetti-23": "chatroomeffects_confetti-23_9SZ_A",
"drop-23": "chatroomeffects_drop-23_3vAxI",
"confetti-24": "chatroomeffects_confetti-24_1Am3e",
"drop-24": "chatroomeffects_drop-24_RhAjb",
"confetti-25": "chatroomeffects_confetti-25_1Ja7L",
"drop-25": "chatroomeffects_drop-25_201NA",
"confetti-26": "chatroomeffects_confetti-26_2jMUO",
"drop-26": "chatroomeffects_drop-26_29n7q",
"confetti-27": "chatroomeffects_confetti-27_2yQQd",
"drop-27": "chatroomeffects_drop-27_2m3A7",
"confetti-28": "chatroomeffects_confetti-28_1Qlxx",
"drop-28": "chatroomeffects_drop-28_18frj",
"confetti-29": "chatroomeffects_confetti-29_1b2l6",
"drop-29": "chatroomeffects_drop-29_2Q2T3",
"confetti-30": "chatroomeffects_confetti-30_1JH00",
"drop-30": "chatroomeffects_drop-30_35aPE",
"confetti-31": "chatroomeffects_confetti-31_Osdxn",
"drop-31": "chatroomeffects_drop-31_3xx2U",
"confetti-32": "chatroomeffects_confetti-32_f1SYA",
"drop-32": "chatroomeffects_drop-32_215c3",
"confetti-33": "chatroomeffects_confetti-33_g65ei",
"drop-33": "chatroomeffects_drop-33_2oegr",
"confetti-34": "chatroomeffects_confetti-34_2yCKI",
"drop-34": "chatroomeffects_drop-34_3K9VA",
"confetti-35": "chatroomeffects_confetti-35_3JsiR",
"drop-35": "chatroomeffects_drop-35_5jMlo",
"confetti-36": "chatroomeffects_confetti-36_R14L0",
"drop-36": "chatroomeffects_drop-36_13yR4",
"confetti-37": "chatroomeffects_confetti-37_24ZmD",
"drop-37": "chatroomeffects_drop-37_2uYeL",
"confetti-38": "chatroomeffects_confetti-38_25jbU",
"drop-38": "chatroomeffects_drop-38_3BJYZ",
"confetti-39": "chatroomeffects_confetti-39_8zwxi",
"drop-39": "chatroomeffects_drop-39_2zKzQ",
"confetti-40": "chatroomeffects_confetti-40_Du-Wg",
"drop-40": "chatroomeffects_drop-40_3DiQ2",
"confetti-41": "chatroomeffects_confetti-41_3LjK4",
"drop-41": "chatroomeffects_drop-41_10ZGR",
"confetti-42": "chatroomeffects_confetti-42_3u0x8",
"drop-42": "chatroomeffects_drop-42_2GaWP",
"confetti-43": "chatroomeffects_confetti-43_2Iip-",
"drop-43": "chatroomeffects_drop-43_3zDFZ",
"confetti-44": "chatroomeffects_confetti-44_2qI_Q",
"drop-44": "chatroomeffects_drop-44_3G_AJ",
"confetti-45": "chatroomeffects_confetti-45_3FUIw",
"drop-45": "chatroomeffects_drop-45_1BAsF",
"confetti-46": "chatroomeffects_confetti-46_2wAK3",
"drop-46": "chatroomeffects_drop-46_1LOgZ",
"confetti-47": "chatroomeffects_confetti-47_2dO3B",
"drop-47": "chatroomeffects_drop-47_l_1GZ",
"confetti-48": "chatroomeffects_confetti-48_2ud75",
"drop-48": "chatroomeffects_drop-48_cnRU6",
"confetti-49": "chatroomeffects_confetti-49_EX-pu",
"drop-49": "chatroomeffects_drop-49_3ElNG",
"confetti-50": "chatroomeffects_confetti-50_8qyUx",
"drop-50": "chatroomeffects_drop-50_IlkNs",
"confetti-51": "chatroomeffects_confetti-51_AtKXb",
"drop-51": "chatroomeffects_drop-51_2msFB",
"confetti-52": "chatroomeffects_confetti-52_1my5Z",
"drop-52": "chatroomeffects_drop-52_1QnRe",
"confetti-53": "chatroomeffects_confetti-53_2Cb1i",
"drop-53": "chatroomeffects_drop-53_1CQh7",
"confetti-54": "chatroomeffects_confetti-54_2VhA6",
"drop-54": "chatroomeffects_drop-54_3hZKt",
"confetti-55": "chatroomeffects_confetti-55_yL87g",
"drop-55": "chatroomeffects_drop-55_3dM49",
"confetti-56": "chatroomeffects_confetti-56_1xqgg",
"drop-56": "chatroomeffects_drop-56_3SnEp",
"confetti-57": "chatroomeffects_confetti-57_f9kuG",
"drop-57": "chatroomeffects_drop-57_3DCDa",
"confetti-58": "chatroomeffects_confetti-58_1O4Ku",
"drop-58": "chatroomeffects_drop-58_3d1_1",
"confetti-59": "chatroomeffects_confetti-59_XOFkR",
"drop-59": "chatroomeffects_drop-59_1ZKa_",
"confetti-60": "chatroomeffects_confetti-60_2iInd",
"drop-60": "chatroomeffects_drop-60_3stXq",
"confetti-61": "chatroomeffects_confetti-61_4hvgI",
"drop-61": "chatroomeffects_drop-61_ENSW2",
"confetti-62": "chatroomeffects_confetti-62_1vcmC",
"drop-62": "chatroomeffects_drop-62_3gyQe",
"confetti-63": "chatroomeffects_confetti-63_3dgPj",
"drop-63": "chatroomeffects_drop-63_2047M",
"confetti-64": "chatroomeffects_confetti-64_Cewk5",
"drop-64": "chatroomeffects_drop-64_2YCRK",
"confetti-65": "chatroomeffects_confetti-65_ciQUm",
"drop-65": "chatroomeffects_drop-65_3kUQk",
"confetti-66": "chatroomeffects_confetti-66_3a3mu",
"drop-66": "chatroomeffects_drop-66_3DoHw",
"confetti-67": "chatroomeffects_confetti-67_39YTy",
"drop-67": "chatroomeffects_drop-67_Qb0h2",
"confetti-68": "chatroomeffects_confetti-68_2zcwH",
"drop-68": "chatroomeffects_drop-68_zRaTb",
"confetti-69": "chatroomeffects_confetti-69_1O9Qn",
"drop-69": "chatroomeffects_drop-69_oogaf",
"confetti-70": "chatroomeffects_confetti-70_3wL25",
"drop-70": "chatroomeffects_drop-70_ouiMF",
"confetti-71": "chatroomeffects_confetti-71_2FN6I",
"drop-71": "chatroomeffects_drop-71_y2t-j",
"confetti-72": "chatroomeffects_confetti-72_2tgnG",
"drop-72": "chatroomeffects_drop-72_3hLQt",
"confetti-73": "chatroomeffects_confetti-73_-0y9h",
"drop-73": "chatroomeffects_drop-73_-Wx7W",
"confetti-74": "chatroomeffects_confetti-74_1_vWA",
"drop-74": "chatroomeffects_drop-74_2L0XL",
"confetti-75": "chatroomeffects_confetti-75_qNiwF",
"drop-75": "chatroomeffects_drop-75_2iJw_",
"confetti-76": "chatroomeffects_confetti-76_2Isn6",
"drop-76": "chatroomeffects_drop-76_3MdvI",
"confetti-77": "chatroomeffects_confetti-77_2bgtx",
"drop-77": "chatroomeffects_drop-77_2ItPx",
"confetti-78": "chatroomeffects_confetti-78_veCdx",
"drop-78": "chatroomeffects_drop-78_3D9KT",
"confetti-79": "chatroomeffects_confetti-79_5cczs",
"drop-79": "chatroomeffects_drop-79_1x9H7",
"confetti-80": "chatroomeffects_confetti-80_hz59y",
"drop-80": "chatroomeffects_drop-80_2ZjKF",
"confetti-81": "chatroomeffects_confetti-81_1rhSJ",
"drop-81": "chatroomeffects_drop-81_tGBBf",
"confetti-82": "chatroomeffects_confetti-82_1jWl7",
"drop-82": "chatroomeffects_drop-82_26Ftm",
"confetti-83": "chatroomeffects_confetti-83_1Veaf",
"drop-83": "chatroomeffects_drop-83_2VByP",
"confetti-84": "chatroomeffects_confetti-84_3_bdr",
"drop-84": "chatroomeffects_drop-84_m6um-",
"confetti-85": "chatroomeffects_confetti-85_9Zttw",
"drop-85": "chatroomeffects_drop-85_2xtS5",
"confetti-86": "chatroomeffects_confetti-86_2EJMi",
"drop-86": "chatroomeffects_drop-86_2dudW",
"confetti-87": "chatroomeffects_confetti-87_uys-9",
"drop-87": "chatroomeffects_drop-87_1PZvt",
"confetti-88": "chatroomeffects_confetti-88_24exN",
"drop-88": "chatroomeffects_drop-88_5ZbRz",
"confetti-89": "chatroomeffects_confetti-89_2yKbS",
"drop-89": "chatroomeffects_drop-89_1s66w",
"confetti-90": "chatroomeffects_confetti-90_2tEzr",
"drop-90": "chatroomeffects_drop-90_1dLha",
"confetti-91": "chatroomeffects_confetti-91_3T4UL",
"drop-91": "chatroomeffects_drop-91_P_MRR",
"confetti-92": "chatroomeffects_confetti-92_7p5vh",
"drop-92": "chatroomeffects_drop-92_1Mwkv",
"confetti-93": "chatroomeffects_confetti-93_2BaTW",
"drop-93": "chatroomeffects_drop-93_3NCsF",
"confetti-94": "chatroomeffects_confetti-94_3DVf7",
"drop-94": "chatroomeffects_drop-94_fZgnW",
"confetti-95": "chatroomeffects_confetti-95_23jtb",
"drop-95": "chatroomeffects_drop-95_1tw1t",
"confetti-96": "chatroomeffects_confetti-96_2CxeZ",
"drop-96": "chatroomeffects_drop-96_37GFJ",
"confetti-97": "chatroomeffects_confetti-97_qoLlt",
"drop-97": "chatroomeffects_drop-97_v1bhd",
"confetti-98": "chatroomeffects_confetti-98_3Po3_",
"drop-98": "chatroomeffects_drop-98_1TcCu",
"confetti-99": "chatroomeffects_confetti-99_2-vdA",
"drop-99": "chatroomeffects_drop-99_3lQGo",
cracker: "chatroomeffects_cracker_k_Aq7",
"cracker-left": "chatroomeffects_cracker-left_IBSjh",
"cracker-right": "chatroomeffects_cracker-right_3M0en",
goldfetti: "chatroomeffects_goldfetti_2oOnq",
"goldfetti-fragment": "chatroomeffects_goldfetti-fragment_oRJxW",
"goldfetti-color-1": "chatroomeffects_goldfetti-color-1_2zN8S",
"goldfetti-color-2": "chatroomeffects_goldfetti-color-2_1fchb",
"goldfetti-color-3": "chatroomeffects_goldfetti-color-3_2pBYi",
"goldfetti-emoji-1": "chatroomeffects_goldfetti-emoji-1_33y_B",
"goldfetti-emoji-2": "chatroomeffects_goldfetti-emoji-2_oOIEt",
"goldfetti-emoji-3": "chatroomeffects_goldfetti-emoji-3_1oNfH",
"goldfetti-emoji-4": "chatroomeffects_goldfetti-emoji-4_YFAWN",
balloons: "chatroomeffects_balloons_2_1pf",
lantern_glow: "chatroomeffects_lantern_glow_v2QAm",
snowball_fragment: "chatroomeffects_snowball_fragment_VMzCI",
"snowball-container": "chatroomeffects_snowball-container_UvZyS",
snowball: "chatroomeffects_snowball_2buSf",
SnowballImage: "chatroomeffects_SnowballImage_2_42e",
SnowballImageCW: "chatroomeffects_SnowballImageCW_1Tf0O",
"snowball-rotate-cw": "chatroomeffects_snowball-rotate-cw_1x1_6",
SnowballImageCCW: "chatroomeffects_SnowballImageCCW_3NMkR",
"snowball-rotate-ccw": "chatroomeffects_snowball-rotate-ccw_2U4NC",
"snowball-path": "chatroomeffects_snowball-path_3gxEb",
"snowball-residue": "chatroomeffects_snowball-residue_1aw_2",
"snowball-chunk": "chatroomeffects_snowball-chunk_379oU",
"snowball-chunk-1": "chatroomeffects_snowball-chunk-1_7DFP9",
"snowball-chunk-2": "chatroomeffects_snowball-chunk-2_2TZ3i",
"snowball-chunk-3": "chatroomeffects_snowball-chunk-3_2dgXy",
"snowball-chunk-4": "chatroomeffects_snowball-chunk-4_9zq4T",
"slide-out-tl": "chatroomeffects_slide-out-tl_2vxAr",
"slide-out-tr": "chatroomeffects_slide-out-tr_1UxlH",
"slide-out-bottom": "chatroomeffects_slide-out-bottom_2bNZV",
pyro: "chatroomeffects_pyro_1uf8l",
before: "chatroomeffects_before_35CE-",
after: "chatroomeffects_after_1tbcr",
bang: "chatroomeffects_bang_3GL2k",
gravity: "chatroomeffects_gravity_S4aDc",
position: "chatroomeffects_position_15NGb",
pyroBodyShake: "chatroomeffects_pyroBodyShake_3E298",
"pyro-body-shake": "chatroomeffects_pyro-body-shake_38sc5",
pyroBodyShake2: "chatroomeffects_pyroBodyShake2_1Ti3z",
"pyro-body-shake2": "chatroomeffects_pyro-body-shake2_3qwwM",
FireworkPath: "chatroomeffects_FireworkPath_1Bk7_",
"firework-path-animation": "chatroomeffects_firework-path-animation_Mm8cl",
FireworkContainer: "chatroomeffects_FireworkContainer_1aN3b",
FireworkPNG: "chatroomeffects_FireworkPNG_EHDSM",
balloon_small_1: "chatroomeffects_balloon_small_1_h2Q7G",
balloon_move_right: "chatroomeffects_balloon_move_right_8PLpZ",
balloon_move_left: "chatroomeffects_balloon_move_left_tgIbt",
balloon_big_1: "chatroomeffects_balloon_big_1_1TGq_",
balloon_big_2: "chatroomeffects_balloon_big_2_1dSX8",
balloon_small_2: "chatroomeffects_balloon_small_2_2SLtS",
balloon_small_3: "chatroomeffects_balloon_small_3_3-4lC",
"snowball-path-1": "chatroomeffects_snowball-path-1_2XM4v",
"snowball-path-2": "chatroomeffects_snowball-path-2_1rYsb",
"snowball-path-3": "chatroomeffects_snowball-path-3_3EhG3",
"snowball-path-4": "chatroomeffects_snowball-path-4_oIEK7",
"snowball-path-5": "chatroomeffects_snowball-path-5_1nGpu",
"snowball-path-6": "chatroomeffects_snowball-path-6_2bquC",
fireworkBigX: "chatroomeffects_fireworkBigX_3EASz",
fireworkBigY: "chatroomeffects_fireworkBigY_3HtJy",
fireworkSmallX: "chatroomeffects_fireworkSmallX_xZrme",
fireworkSmallY: "chatroomeffects_fireworkSmallY_Vy4av",
fireworkLongX: "chatroomeffects_fireworkLongX_1h91p",
fireworkLongY: "chatroomeffects_fireworkLongY_3f3gs",
};
},
95126: (e, t, n) => {
var i = {
"./af": 1009,
"./af.js": 1009,
"./ar": 88769,
"./ar-dz": 23739,
"./ar-dz.js": 23739,
"./ar-kw": 93745,
"./ar-kw.js": 93745,
"./ar-ly": 99576,
"./ar-ly.js": 99576,
"./ar-ma": 67408,
"./ar-ma.js": 67408,
"./ar-ps": 13857,
"./ar-ps.js": 13857,
"./ar-sa": 48781,
"./ar-sa.js": 48781,
"./ar-tn": 87856,
"./ar-tn.js": 87856,
"./ar.js": 88769,
"./az": 2030,
"./az.js": 2030,
"./be": 56476,
"./be.js": 56476,
"./bg": 25304,
"./bg.js": 25304,
"./bm": 48125,
"./bm.js": 48125,
"./bn": 34,
"./bn-bd": 29835,
"./bn-bd.js": 29835,
"./bn.js": 34,
"./bo": 64082,
"./bo.js": 64082,
"./br": 8317,
"./br.js": 8317,
"./bs": 93107,
"./bs.js": 93107,
"./ca": 68272,
"./ca.js": 68272,
"./cs": 98567,
"./cs.js": 98567,
"./cv": 61583,
"./cv.js": 61583,
"./cy": 10076,
"./cy.js": 10076,
"./da": 31760,
"./da.js": 31760,
"./de": 8973,
"./de-at": 63214,
"./de-at.js": 63214,
"./de-ch": 74728,
"./de-ch.js": 74728,
"./de.js": 8973,
"./dv": 54053,
"./dv.js": 54053,
"./el": 7499,
"./el.js": 7499,
"./en-au": 67876,
"./en-au.js": 67876,
"./en-ca": 47010,
"./en-ca.js": 47010,
"./en-gb": 34239,
"./en-gb.js": 34239,
"./en-ie": 99830,
"./en-ie.js": 99830,
"./en-il": 28438,
"./en-il.js": 28438,
"./en-in": 25322,
"./en-in.js": 25322,
"./en-nz": 43264,
"./en-nz.js": 43264,
"./en-sg": 55449,
"./en-sg.js": 55449,
"./eo": 39486,
"./eo.js": 39486,
"./es": 32430,
"./es-do": 16310,
"./es-do.js": 16310,
"./es-mx": 27038,
"./es-mx.js": 27038,
"./es-us": 73099,
"./es-us.js": 73099,
"./es.js": 32430,
"./et": 34975,
"./et.js": 34975,
"./eu": 87063,
"./eu.js": 87063,
"./fa": 68073,
"./fa.js": 68073,
"./fi": 50957,
"./fi.js": 50957,
"./fil": 8764,
"./fil.js": 8764,
"./fo": 81775,
"./fo.js": 81775,
"./fr": 74179,
"./fr-ca": 14306,
"./fr-ca.js": 14306,
"./fr-ch": 73791,
"./fr-ch.js": 73791,
"./fr.js": 74179,
"./fy": 47014,
"./fy.js": 47014,
"./ga": 46911,
"./ga.js": 46911,
"./gd": 62958,
"./gd.js": 62958,
"./gl": 87344,
"./gl.js": 87344,
"./gom-deva": 33161,
"./gom-deva.js": 33161,
"./gom-latn": 35798,
"./gom-latn.js": 35798,
"./gu": 68485,
"./gu.js": 68485,
"./he": 27917,
"./he.js": 27917,
"./hi": 52159,
"./hi.js": 52159,
"./hr": 95842,
"./hr.js": 95842,
"./hu": 30005,
"./hu.js": 30005,
"./hy-am": 51312,
"./hy-am.js": 51312,
"./id": 60781,
"./id.js": 60781,
"./is": 64101,
"./is.js": 64101,
"./it": 43467,
"./it-ch": 4759,
"./it-ch.js": 4759,
"./it.js": 43467,
"./ja": 44164,
"./ja.js": 44164,
"./jv": 70079,
"./jv.js": 70079,
"./ka": 57036,
"./ka.js": 57036,
"./kk": 92022,
"./kk.js": 92022,
"./km": 63418,
"./km.js": 63418,
"./kn": 43655,
"./kn.js": 43655,
"./ko": 30986,
"./ko.js": 30986,
"./ku": 91902,
"./ku-kmr": 16513,
"./ku-kmr.js": 16513,
"./ku.js": 91902,
"./ky": 4604,
"./ky.js": 4604,
"./lb": 99026,
"./lb.js": 99026,
"./lo": 20537,
"./lo.js": 20537,
"./lt": 22288,
"./lt.js": 22288,
"./lv": 1495,
"./lv.js": 1495,
"./me": 60690,
"./me.js": 60690,
"./mi": 2571,
"./mi.js": 2571,
"./mk": 93959,
"./mk.js": 93959,
"./ml": 97225,
"./ml.js": 97225,
"./mn": 88,
"./mn.js": 88,
"./mr": 46622,
"./mr.js": 46622,
"./ms": 11070,
"./ms-my": 48899,
"./ms-my.js": 48899,
"./ms.js": 11070,
"./mt": 63931,
"./mt.js": 63931,
"./my": 95393,
"./my.js": 95393,
"./nb": 4274,
"./nb.js": 4274,
"./ne": 8914,
"./ne.js": 8914,
"./nl": 33114,
"./nl-be": 68479,
"./nl-be.js": 68479,
"./nl.js": 33114,
"./nn": 4513,
"./nn.js": 4513,
"./oc-lnc": 46549,
"./oc-lnc.js": 46549,
"./pa-in": 28264,
"./pa-in.js": 28264,
"./pl": 32848,
"./pl.js": 32848,
"./pt": 90899,
"./pt-br": 55077,
"./pt-br.js": 55077,
"./pt.js": 90899,
"./ro": 92512,
"./ro.js": 92512,
"./ru": 21753,
"./ru.js": 21753,
"./sd": 16840,
"./sd.js": 16840,
"./se": 78362,
"./se.js": 78362,
"./si": 50464,
"./si.js": 50464,
"./sk": 66324,
"./sk.js": 66324,
"./sl": 41963,
"./sl.js": 41963,
"./sq": 53039,
"./sq.js": 53039,
"./sr": 93454,
"./sr-cyrl": 10466,
"./sr-cyrl.js": 10466,
"./sr.js": 93454,
"./ss": 95158,
"./ss.js": 95158,
"./sv": 28859,
"./sv.js": 28859,
"./sw": 57594,
"./sw.js": 57594,
"./ta": 26915,
"./ta.js": 26915,
"./te": 15677,
"./te.js": 15677,
"./tet": 92154,
"./tet.js": 92154,
"./tg": 74098,
"./tg.js": 74098,
"./th": 89071,
"./th.js": 89071,
"./tk": 49381,
"./tk.js": 49381,
"./tl-ph": 1869,
"./tl-ph.js": 1869,
"./tlh": 92346,
"./tlh.js": 92346,
"./tr": 71483,
"./tr.js": 71483,
"./tzl": 30266,
"./tzl.js": 30266,
"./tzm": 33138,
"./tzm-latn": 32960,
"./tzm-latn.js": 32960,
"./tzm.js": 33138,
"./ug-cn": 29456,
"./ug-cn.js": 29456,
"./uk": 50805,
"./uk.js": 50805,
"./ur": 61127,
"./ur.js": 61127,
"./uz": 29628,
"./uz-latn": 80840,
"./uz-latn.js": 80840,
"./uz.js": 29628,
"./vi": 56962,
"./vi.js": 56962,
"./x-pseudo": 49257,
"./x-pseudo.js": 49257,
"./yo": 62423,
"./yo.js": 62423,
"./zh-cn": 61002,
"./zh-cn.js": 61002,
"./zh-hk": 6046,
"./zh-hk.js": 6046,
"./zh-mo": 36903,
"./zh-mo.js": 36903,
"./zh-tw": 24710,
"./zh-tw.js": 24710,
};
function o(e) {
var t = r(e);
return n(t);
}
function r(e) {
if (!n.o(i, e)) {
var t = new Error("Cannot find module '" + e + "'");
throw ((t.code = "MODULE_NOT_FOUND"), t);
}
return i[e];
}
(o.keys = function () {
return Object.keys(i);
}),
(o.resolve = r),
(e.exports = o),
(o.id = 95126);
},
19953: (e, t, n) => {
"use strict";
n.d(t, { De: () => i.De, E_: () => i.E_, Ek: () => i.Ek, Kc: () => i.Kc, L7: () => i.L7, id: () => i.id });
var i = n(10553);
},
4853: (e, t, n) => {
"use strict";
var i = n(85556),
o = n(19953),
r = n(62553),
a = n(14206),
s = n.n(a),
l = n(1736),
c = n(2049),
m = n(79588),
d = n(11612),
h = n(88991),
u = n(93635);
class p {
constructor(e, t) {
(this.m_bLogonFailed = !1),
(this.m_bForcedDisconnect = !1),
(this.m_eSteamRealm = d.IN.k_ESteamRealmUnknown),
(this.m_bConnectSucceeded = !1),
(this.m_bEverConnected = !1),
(this.m_bEverLoggedOn = !1),
(this.m_cConsecutiveConnectionFailures = 0),
(this.m_bWaitingToReconnect = !1),
(this.m_rgdtRecentFailures = []),
(this.m_eWebLogonState = 0),
(0, m.rC)(this),
(this.m_CMInterface = e),
(this.m_eSteamRealm = t),
this.m_CMInterface.AddOnDisconnectCallback(this.OnCMDisconnected),
this.m_CMInterface.AddOnLogonCallback(this.OnCMLoggedOn),
this.m_CMInterface.messageHandlers.RegisterEMessageHandler(757, r.bL, (e) => {
34 == e.Body().eresult() && ((this.m_eWebLogonState = 15), (this.m_bWaitingToReconnect = !0));
});
}
get web_logon_state() {
return this.m_eWebLogonState;
}
BIsInInitialConnect() {
return 1 == this.m_eWebLogonState || 5 == this.m_eWebLogonState;
}
BIsWaitingToReconnect() {
return this.m_bWaitingToReconnect;
}
BWillAutoReconnect() {
return void 0 !== this.m_iTimeoutRetryLogon;
}
ClearRetryTimeout() {
this.m_iTimeoutRetryLogon && (window.clearTimeout(this.m_iTimeoutRetryLogon), (this.m_iTimeoutRetryLogon = void 0));
}
GetMSUntilNextReconnectAttempt() {
return this.m_dtNextLogonAttempt ? Math.max(0, this.m_dtNextLogonAttempt.getTime() - new Date().getTime()) : 0;
}
ReconnectNow() {
this.m_bWaitingToReconnect && ((this.m_rgdtRecentFailures = []), this.RetryLogin());
}
OnCMDisconnected(e) {
if (13 != this.m_eWebLogonState && 14 != this.m_eWebLogonState && 15 != this.m_eWebLogonState) {
if (this.m_bForcedDisconnect) return (this.m_bForcedDisconnect = !1), void this.RetryLogin();
for (; this.m_rgdtRecentFailures.length >= 24; ) this.m_rgdtRecentFailures.shift();
if ((this.m_rgdtRecentFailures.push(new Date()), this.m_bConnectSucceeded && !this.m_CMInterface.session.m_bWaitingForLogonResponse)) {
let e = this.m_CMInterface.session.m_eResultLogonSuccess;
this.m_eWebLogonState = 1 != e ? (this.m_bEverLoggedOn ? 6 : 8) : 10;
} else this.m_eWebLogonState = this.m_bEverConnected ? 10 : 2;
this.m_cConsecutiveConnectionFailures++, e || this.RescheduleLogin();
}
}
OnCMLoggedOn() {
(this.m_eWebLogonState = 9), (this.m_bEverLoggedOn = !0), (this.m_cConsecutiveConnectionFailures = 0);
}
PerformInitialLogon(e) {
e.token_use_id && (window.sessionStorage.getItem("token_use_id") == e.token_use_id ? (console.log("In-page token has already been consumed, requesting a new token."), (e = null)) : window.sessionStorage.setItem("token_use_id", e.token_use_id)), this.PerformWebLogOn(e);
}
PerformWebLogOn(e) {
if (((this.m_bConnectSucceeded = !1), (this.m_eWebLogonState = this.m_bEverConnected ? 3 : 1), !(e && e.steamid && e.token && e.account_name))) return void this.RetryLogin();
(o.L7.steamid = e.steamid), (o.L7.accountid = new h.K(e.steamid).GetAccountID()), (o.L7.account_name = e.account_name);
let t = l.gA.Init(r.p$, 5514);
t.Body().set_account_name(e.account_name),
t.Body().set_protocol_version(65580),
t.Body().set_qos_level(2),
t.Body().set_client_os_type(4294966596),
t.Body().set_ui_mode(3),
t.Body().set_chat_mode(2),
t.Body().set_web_logon_nonce(e.token),
t.Hdr().set_steamid(e.steamid),
(function (e, t) {
switch (t) {
case d.IN.k_ESteamRealmChina:
e.Body().set_launcher_type(7);
break;
case d.IN.k_ESteamRealmGlobal:
break;
default:
(0, u.X)(!1, "Unknown realm: " + t);
}
})(t, this.m_eSteamRealm),
this.m_CMInterface.session.m_nSessionIDLast && t.Body().set_last_session_id(this.m_CMInterface.session.m_nSessionIDLast >>> 0),
t.Body().set_client_instance_id(this.m_CMInterface.session.m_nClientInstanceID),
this.m_CMInterface.Connect().then(() => {
(o.L7.logged_in = !0), (this.m_bConnectSucceeded = !0), (this.m_bEverConnected = !0), (this.m_eWebLogonState = this.m_bEverLoggedOn ? 7 : 5), this.m_CMInterface.Send(t);
});
}
RetryLogin() {
if (((this.m_bWaitingToReconnect = !1), this.ClearRetryTimeout(), this.m_CMInterface.BIsConnected() && this.m_bConnectSucceeded)) return (this.m_bForcedDisconnect = !0), void this.m_CMInterface.ForceDisconnect();
(0, u.X)(11 != this.m_eWebLogonState, "RetryLogin called while request in flight"),
11 != this.m_eWebLogonState &&
((this.m_eWebLogonState = 11),
this.m_CMInterface.Connect().catch(() => {}),
s()
.get(o.De.TOKEN_URL, { method: "POST" })
.then((e) => {
let t = e.data;
if (t.logged_in && t.steamid && t.token && t.account_name) {
let e = new h.K(t.steamid);
this.m_bEverLoggedOn && this.m_CMInterface.steamid.GetAccountID() != e.GetAccountID() ? ((this.m_eWebLogonState = 14), this.m_CMInterface.ForceDisconnect()) : this.PerformWebLogOn(t);
} else (this.m_eWebLogonState = 13), this.m_CMInterface.ForceDisconnect();
})
.catch((e) => {
(this.m_eWebLogonState = 12), this.RescheduleLogin();
}));
}
RescheduleLogin() {
let e = 0,
t = 0,
n = new Date();
for (let i of this.m_rgdtRecentFailures) i.getTime() >= n.getTime() - 6e4 ? e++ : i.getTime() >= n.getTime() - 36e5 && t++;
t += e;
let i = this.m_cConsecutiveConnectionFailures + e;
if (i <= 2) this.RetryLogin();
else if (i <= 10 && t <= 10) {
let e = 5e3 * (i - 2);
(this.m_dtNextLogonAttempt = new Date(new Date().getTime() + e)),
(this.m_bWaitingToReconnect = !0),
this.ClearRetryTimeout(),
(this.m_iTimeoutRetryLogon = window.setTimeout(() => {
(this.m_dtNextLogonAttempt = void 0), this.RetryLogin();
}, e));
} else this.m_bWaitingToReconnect = !0;
}
}
(0, i.gn)([m.LO], p.prototype, "m_eWebLogonState", void 0), (0, i.gn)([c.ak], p.prototype, "OnCMDisconnected", null), (0, i.gn)([c.ak], p.prototype, "OnCMLoggedOn", null);
var _ = n(37234),
g = n(63036),
C = n(66035),
f = n(91300),
v = n(62902),
S = n(24782),
b = n(10553),
I = n(23282),
y = n(76262),
E = n(40786),
D = n(6181),
w = n(85105),
R = n(22394);
class A {
constructor(e = !1) {
(this.m_bRunOnce = !1), (this.m_ClientConnectionCallbacks = new R.pB()), (this.m_mapServerTypeCallbacks = new Map()), (this.m_bRunOnce = e);
}
RunCallbacks(e, ...t) {
void 0 === e ? (this.m_ClientConnectionCallbacks.Dispatch(...t), this.m_bRunOnce && this.m_ClientConnectionCallbacks.ClearAllCallbacks()) : this.m_mapServerTypeCallbacks.has(e) && (this.m_mapServerTypeCallbacks.get(e).Dispatch(...t), this.m_bRunOnce && this.m_mapServerTypeCallbacks.delete(e));
}
RunAllCallbacks(e, ...t) {
this.RunCallbacks(void 0, ...t), e.forEach((e) => this.RunCallbacks(e, ...t));
}
AddCallback(e, t) {
let n = this.m_ClientConnectionCallbacks;
return void 0 !== t && (this.m_mapServerTypeCallbacks.has(t) || this.m_mapServerTypeCallbacks.set(t, new R.pB()), (n = this.m_mapServerTypeCallbacks.get(t))), n.Register(e);
}
}
function M(e, t) {
return () => {
try {
e();
} catch (e) {
console.error(`Error in ${t} callback:`, e);
}
};
}
class k {
constructor() {
(this.m_steamid = new h.K()),
(this.m_bLoggedOn = !1),
(this.m_bCompletedInitialConnect = !1),
(this.m_unAccountFlags = 0),
(this.m_strIPCountry = ""),
(this.m_strPersonaName = ""),
(this.m_rtReconnectThrottleStart = 0),
(this.m_rtReconnectThrottleExpiration = 0),
(this.m_bConnected = !1),
(this.m_bConnectionFailed = !1),
(this.m_setConnectedServers = new Set()),
(this.m_callbacksOnConnectOneTime = new A(!0)),
(this.m_callbacksOnConnect = new A()),
(this.m_callbacksOnDisconnect = new A()),
(this.m_bForceDisconnect = !1),
(this.m_bPerformedInitialClockAdjustment = !1),
(this.m_nWallClockDriftMS = 0),
(this.m_nPerfClockServerMSOffset = new Date().getTime() - performance.now()),
(this.m_messageHandlers = new E.N()),
(this.ClientServersAvailableHandler = this.m_messageHandlers.RegisterEMessageAction(5501, w.f9, (e) => {
let t = new Set(this.m_setConnectedServers);
for (let n of e.Body().server_types_available()) {
let e = n.server();
void 0 !== e && (this.m_bLoggedOn && ((this.m_setConnectedServers.has(e) && !n.changed()) || (n.changed() && this.m_setConnectedServers.has(e) && this.m_callbacksOnDisconnect.RunCallbacks(e, !1), this.m_callbacksOnConnect.RunCallbacks(e), this.m_callbacksOnConnectOneTime.RunCallbacks(e))), this.m_setConnectedServers.add(e), t.delete(e));
}
t.forEach((e) => {
this.m_setConnectedServers.delete(e), this.m_bLoggedOn && this.m_callbacksOnDisconnect.RunCallbacks(e, !1);
});
})),
(0, m.rC)(this),
(this.m_ServiceTransport = { SendMsg: (e, t, n) => ((void 0 !== t.GetEMsg() && 9804 == t.GetEMsg()) || t.SetEMsg(151), t.Hdr().set_target_job_name(e), this.SendMsgAndAwaitResponse(t, n)), SendNotification: (e, t) => ((void 0 !== t.GetEMsg() && 9804 == t.GetEMsg()) || t.SetEMsg(151), t.Hdr().set_target_job_name(e), this.Send(t)), MakeReady: this.MakeReady.bind(this) }),
window &&
window.addEventListener &&
window.addEventListener("unload", (e) => {
this.ForceDisconnect();
});
}
get steamid() {
return this.m_steamid;
}
get logged_on() {
return this.m_bLoggedOn;
}
get persona_name() {
return this.m_strPersonaName;
}
get messageHandlers() {
return this.m_messageHandlers;
}
get rtReconnectThrottleStart() {
return this.m_rtReconnectThrottleStart;
}
get rtReconnectThrottleExpiration() {
return this.m_rtReconnectThrottleExpiration;
}
BDisconnected() {
return !this.logged_on && this.m_steamid.BIsValid();
}
BConnectedToServer(e) {
return void 0 === e ? this.m_bLoggedOn : this.m_setConnectedServers.has(e);
}
get has_completed_initial_connect() {
return this.m_bCompletedInitialConnect;
}
get account_flags() {
return this.m_unAccountFlags;
}
GetServiceTransport() {
return this.m_ServiceTransport;
}
GetAnonymousServiceTransport() {
return this.m_ServiceTransport;
}
MakeReady() {
return SteamClient.User.Connect();
}
RunWhenLoggedOn(e, t) {
let n = M(e, "RunWhenLoggedOn");
this.BConnectedToServer(t) ? n() : this.m_callbacksOnConnectOneTime.AddCallback(n, t);
}
WaitUntilLoggedOn() {
return new Promise((e) => this.RunWhenLoggedOn(e));
}
AddOnLogonCallback(e, t) {
let n = M(e, "AddOnLogonCallback");
return this.BConnectedToServer(t) && n(), this.m_callbacksOnConnect.AddCallback(n, t);
}
AddOnDisconnectCallback(e, t) {
let n = (function (e, t) {
return (n) => {
try {
e(n);
} catch (e) {
console.error(`Error in ${t} callback:`, e);
}
};
})(e, "AddOnDisconnectCallback");
return this.m_callbacksOnDisconnect.AddCallback(n, t);
}
ForceDisconnect() {
(this.m_bForceDisconnect = !0), this.Disconnect();
}
Send(e) {
return !!this.BIsConnected() && (this.DEBUG_LogCMInterfaceActivity(e, "send"), this.SendInternal(e));
}
BInternalShouldDispatchMessage(e) {
return !0;
}
ResolveAwaitWithTransportError(e, t, n, i) {
let o = l.gA.Init(t);
o.Hdr().set_eresult(2), o.Hdr().set_transport_error(n), i && o.Hdr().set_error_message(i), e(o);
}
DispatchMessage(e) {
try {
if (!this.BInternalShouldDispatchMessage(e)) return;
if (e.BIsValid()) {
let t = (t) => {
t.Hdr().set_jobid_target(e.Hdr().jobid_source()), this.Send(t);
};
this.m_messageHandlers.DispatchMsgToHandlers(e, t) || this.DEBUG_LogCMInterfaceActivity(e, "receive", !1);
} else console.error("CMInterface RECV could not parse message of type " + (0, D.SR)(e.GetEMsg()) + " " + e.GetEMsg());
} catch (t) {
console.error(`CMInterface RECV exception thrown while processing message of type ${(0, D.SR)(e.GetEMsg())}`, t), e.DEBUG_LogToConsole();
}
}
BIsConnected() {
return this.m_bConnected;
}
OnConnect() {
(this.m_bConnected = !0), (this.m_bConnectionFailed = !1), (this.m_bForceDisconnect = !1);
}
OnLoggedOn() {
(this.m_bCompletedInitialConnect = !0), this.InternalAdjustClock(), this.m_callbacksOnConnect.RunAllCallbacks(this.m_setConnectedServers), this.m_callbacksOnConnectOneTime.RunAllCallbacks(this.m_setConnectedServers);
}
OnDisconnect() {
(this.m_bConnected = !1), (this.m_bConnectionFailed = !0), (this.m_onConnect = void 0), (this.m_bLoggedOn = !1), (this.m_unAccountFlags = 0), (this.m_strIPCountry = ""), this.m_callbacksOnDisconnect.RunAllCallbacks(this.m_setConnectedServers, this.m_bForceDisconnect), this.m_setConnectedServers.clear();
}
DEBUG_LogCMInterfaceActivity(e, t, n = !0) {
0;
}
DEBUG_LogMessage(e, ...t) {
0;
}
InternalAdjustClock() {
return (0, i.mG)(this, void 0, void 0, function* () {
let e = l.gA.Init(r.mr, 9802);
return (
e.Body().set_client_request_timestamp(Math.floor(performance.now()).toString()),
this.SendMsgAndAwaitResponse(e, r.a1).then((e) => {
let t = performance.now(),
n = new Date(),
i = parseInt(e.Body().client_request_timestamp()),
o = parseInt(e.Body().server_timestamp_ms()) - ((t - i) >> 1);
return o && !isNaN(o) && t && !isNaN(t) ? ((this.m_bPerformedInitialClockAdjustment = !0), (this.m_nPerfClockServerMSOffset = o - t), (this.m_nWallClockDriftMS = n.getTime() - o)) : (0, u.X)(!1, `Error computing server time, server echo: ${i} server time ${o}`), !0;
})
);
});
}
BPerformedInitialClockAdjustment() {
return this.m_bPerformedInitialClockAdjustment;
}
GetServerTimeMS() {
return performance.now() + this.m_nPerfClockServerMSOffset;
}
GetServerRTime32() {
return Math.floor((performance.now() + this.m_nPerfClockServerMSOffset) / 1e3);
}
RTime32ToDate(e) {
return new Date(1e3 * e + this.m_nWallClockDriftMS);
}
}
(0, i.gn)([m.LO], k.prototype, "m_steamid", void 0), (0, i.gn)([m.LO], k.prototype, "m_bLoggedOn", void 0), (0, i.gn)([m.LO], k.prototype, "m_bCompletedInitialConnect", void 0), (0, i.gn)([m.LO], k.prototype, "m_unAccountFlags", void 0), (0, i.gn)([m.LO], k.prototype, "m_strIPCountry", void 0), (0, i.gn)([m.LO], k.prototype, "m_strPersonaName", void 0), (0, i.gn)([m.LO], k.prototype, "m_rtReconnectThrottleStart", void 0), (0, i.gn)([m.LO], k.prototype, "m_rtReconnectThrottleExpiration", void 0), (0, i.gn)([m.LO], k.prototype, "m_bConnected", void 0), (0, i.gn)([m.LO], k.prototype, "m_bPerformedInitialClockAdjustment", void 0), (0, i.gn)([m.aD], k.prototype, "DispatchMessage", null), (0, i.gn)([m.aD], k.prototype, "OnDisconnect", null);
var T = n(57476),
L = n(5395);
class G extends k {
constructor() {
super(), (this.m_setEMsgHandlers = new Set()), (this.m_setServiceMethodHandlers = new Set()), (this.m_bShouldChangePersonaStatusOnDisconnect = !0), (0, m.rC)(this), (0, T.U5)("User.RegisterForConnectionAttemptsThrottled") && SteamClient.User.RegisterForConnectionAttemptsThrottled(this.OnConnectionAttemptThrottled);
}
SendMsgAndAwaitResponse(e, t) {
return new Promise((n, i) => {
if (this.m_hSharedConnection) {
this.DEBUG_LogCMInterfaceActivity(e, "send");
let i = S.JQ(e.Serialize());
void 0 !== SteamClient.SharedConnection.SendMsgAndAwaitBinaryResponse
? SteamClient.SharedConnection.SendMsgAndAwaitBinaryResponse(this.m_hSharedConnection, i)
.then((e) => {
let i = new I.At(e),
o = l.gA.InitFromPacket(t, i);
this.DEBUG_LogCMInterfaceActivity(o, "receive", !0), o.BIsValid() ? n(o) : this.ResolveAwaitWithTransportError(n, t, 102, "Failed to parse response from server");
})
.catch((e) => {
this.ResolveAwaitWithTransportError(n, t, 2, e);
})
: SteamClient.SharedConnection.SendMsgAndAwaitResponse(this.m_hSharedConnection, i)
.then((e) => {
let i = new I.At(S.b$(e)),
o = l.gA.InitFromPacket(t, i);
this.DEBUG_LogCMInterfaceActivity(o, "receive", !0), o.BIsValid() ? n(o) : this.ResolveAwaitWithTransportError(n, t, 102, "Failed to parse response from server");
})
.catch((e) => {
this.ResolveAwaitWithTransportError(n, t, 2, e);
});
} else this.ResolveAwaitWithTransportError(n, t, 102, "Shared connection handle is empty, dropping traffic"), console.warn("Shared connection handle is empty, dropping traffic");
});
}
SendInternal(e) {
let t = S.JQ(e.Serialize());
return SteamClient.SharedConnection.SendMsg(this.m_hSharedConnection, t), !0;
}
OnMsgRecvd(e) {
let t = new I.At(e),
n = l.lq.InitHeaderFromPacket(t);
this.DispatchMessage(n);
}
OnLogonInfoChanged(e) {
this.DEBUG_LogMessage("Login info from client: ", e), (this.m_bLoggedOn = e.bLoggedOn), (b.De.EUNIVERSE = e.eUniverse), (b.De.MEDIA_CDN_COMMUNITY_URL = e.strCommunityImagesURL), (b.De.COUNTRY = e.strUserCountry), e.strSteamid ? ((this.m_steamid = new h.K(e.strSteamid)), (this.m_strPersonaName = e.strPersonaName), (b.L7.logged_in = e.bLoggedOn), (b.L7.steamid = e.strSteamid), (b.L7.accountid = this.m_steamid.GetAccountID()), (b.L7.account_name = e.strAccountName)) : 0 != this.m_steamid.GetAccountID() && (this.m_steamid = new h.K()), this.m_bLoggedOn ? (this.m_bConnected || this.OnConnect(), this.OnLoggedOn()) : this.OnDisconnect();
}
Connect() {
return this.m_hSharedConnection
? Promise.resolve()
: (this.m_onConnect = new Promise((e, t) => {
SteamClient.SharedConnection.AllocateSharedConnection()
.then((n) => {
n ? (this.OnSharedConnectionEstablished(n), this.DEBUG_LogMessage("obtained handle ", this.m_hSharedConnection), this.OnConnect(), e()) : t();
})
.catch(t);
}));
}
OnSharedConnectionEstablished(e) {
(this.m_hSharedConnection = e),
this.m_setEMsgHandlers.clear(),
this.m_setServiceMethodHandlers.clear(),
this.m_hEMsgRegistrationObserver && this.m_hEMsgRegistrationObserver(),
(this.m_hEMsgRegistrationObserver = (0, m.EH)(() => {
if (this.m_hSharedConnection) {
for (let e of this.m_messageHandlers.emsg_list) this.m_setEMsgHandlers.has(e) || (this.m_setEMsgHandlers.add(e), SteamClient.SharedConnection.SubscribeToEMsg(this.m_hSharedConnection, e));
for (let e of this.m_messageHandlers.servicemethod_list) this.m_setServiceMethodHandlers.has(e) || (this.m_setServiceMethodHandlers.add(e), SteamClient.SharedConnection.SubscribeToClientServiceMethod(this.m_hSharedConnection, e));
}
}));
let t = !1;
SteamClient.SharedConnection.RegisterOnLogonInfoChanged(this.m_hSharedConnection, (e) => {
this.OnLogonInfoChanged(e), t || ((t = !0), void 0 !== SteamClient.SharedConnection.RegisterOnBinaryMessageReceived ? SteamClient.SharedConnection.RegisterOnBinaryMessageReceived(this.m_hSharedConnection, this.OnMsgRecvd.bind(this)) : SteamClient.SharedConnection.RegisterOnMessageReceived(this.m_hSharedConnection, (e) => this.OnMsgRecvd(S.b$(e))));
});
}
OnConnect() {
super.OnConnect();
}
Disconnect() {
if (this.m_hSharedConnection) {
if (this.m_bShouldChangePersonaStatusOnDisconnect) {
let e = l.gA.Init(y.bx, 716);
e.Body().set_persona_state(0), e.Body().set_persona_set_by_user(!1), this.Send(e);
}
SteamClient.SharedConnection.Close(this.m_hSharedConnection), this.OnSharedConnectionClosed();
}
}
OnSharedConnectionClosed() {
super.OnDisconnect(), (this.m_hSharedConnection = void 0), this.m_setEMsgHandlers.clear(), this.m_hEMsgRegistrationObserver && (this.m_hEMsgRegistrationObserver(), (this.m_hEMsgRegistrationObserver = void 0));
}
SendHeartbeat() {}
ClearHeartbeatInterval() {}
ResetHeartbeatInterval() {}
SetShouldChangePersonaStatusOnDisconnect(e) {
this.m_bShouldChangePersonaStatusOnDisconnect = e;
}
GetShouldChangePersonaStatusOnDisconnect() {
return this.m_bShouldChangePersonaStatusOnDisconnect;
}
OnConnectionAttemptThrottled(e) {
0 == e.rtCooldownExpiration ? (this.m_rtReconnectThrottleStart = 0) : 0 == this.m_rtReconnectThrottleStart && (this.m_rtReconnectThrottleStart = (0, L.QU)()), (this.m_rtReconnectThrottleExpiration = e.rtCooldownExpiration);
}
}
(0, i.gn)([m.aD], G.prototype, "OnLogonInfoChanged", null), (0, i.gn)([m.aD.bound], G.prototype, "OnConnectionAttemptThrottled", null);
var O = n(60991),
F = n(27918),
B = n(78654);
class x {
constructor() {
this.m_CMList = { rgCMList: [], rtLastLoaded: 0 };
}
Init(e) {
(this.m_Storage = e), (this.m_InitPromise = this.LoadFromCache());
}
LoadFromCache() {
return (0, i.mG)(this, void 0, void 0, function* () {
if (this.m_InitPromise) return this.m_InitPromise;
const e = yield this.m_Storage.GetObject(this.GetLocalStorageKey());
return (t = e) && "object" == typeof t && Array.isArray(t.rgCMList) && "number" == typeof t.rtLastLoaded ? ((this.m_CMList = e), this.m_CMList) : ((this.m_CMList = { rgCMList: [], rtLastLoaded: 0 }), this.WriteCMListToLocalStorage(), this.m_CMList);
var t;
});
}
GetBestCMsToConnectTo() {
return (0, i.mG)(this, void 0, void 0, function* () {
try {
let e = yield this.LoadFromCache();
(!e.rgCMList.length || Date.now() / 1e3 - e.rtLastLoaded > 604800) && ((this.m_CMList = yield this.GetCMListFromWebAPI()), this.WriteCMListToLocalStorage());
} catch (e) {
console.error(`There was a problem loading CM list. Attempting to use stale data. ${e}`);
}
return this.PingCMs();
});
}
RecordCMDisconnected(e) {
(e.nConnectFailures = (e.nConnectFailures || 0) + 1), (e.msPing = Number.MAX_SAFE_INTEGER), (e.nCMLoad = Number.MAX_SAFE_INTEGER), this.WriteCMListToLocalStorage();
}
BuildCMWebSocketURL(e) {
return "wss://" + this.FixDevHost(e) + "/cmsocket/";
}
FixDevHost(e) {
if (4 == b.De.EUNIVERSE && "dev" == b.De.WEB_UNIVERSE && e.match(/^127\.0\.0\.1/)) {
let t = b.De.WEBAPI_BASE_URL.match(/https?:\/\/([^\/:]*)/);
if (t && t[1]) return e.replace(/^127\.0\.0\.1/, t[1]);
}
return e;
}
GetLocalStorageKey() {
return "CCMList_" + b.De.EUNIVERSE;
}
WriteCMListToLocalStorage() {
this.m_Storage.StoreObject(this.GetLocalStorageKey(), this.m_CMList);
}
GetCMListFromWebAPI() {
return (0, i.mG)(this, void 0, void 0, function* () {
try {
const n = yield ((e = N),
(t = 1e4),
() =>
new Promise((n, i) => {
let o = !1;
const r = window.setTimeout(() => {
(o = !0), i(new Error("Timed out"));
}, t);
e().then(
(e) => {
o || (clearTimeout(r), n(e));
},
(e) => {
o || (clearTimeout(r), i(e));
},
);
}))(),
i = this.m_CMList.rgCMList.reduce((e, t) => Object.assign(Object.assign({}, e), { [t.strHost]: t }), {});
return { rgCMList: n.map((e) => Object.assign(Object.assign({}, i[e.strHost] || {}), e)), rtLastLoaded: new Date().getTime() / 1e3 };
} catch (e) {
throw new Error("Failed to load CM List from webapi");
}
var e, t;
});
}
PingCMs() {
let e = new Date().getTime() / 1e3 - 18e3,
t = [];
const n = {};
for (const i of this.m_CMList.rgCMList) {
const o = P(i),
r = !o || i.rtLastCheck < e;
r && t.length < 20 && t.push(i), (r && !b.De.IN_MOBILE) || (o && o < 1e4 && (n[i.strHost] = i));
}
t.length;
let i = !1;
return new Promise((e, o) => {
let r,
a,
s = "immediate",
l = (t) => {
if (((0, u.X)(!i, "fnPingingComplete called a second time"), !i)) {
const n = Object.keys(t)
.map((e) => t[e])
.sort((e, t) => P(e) - P(t));
if ((n.length, n.length && n[0].strHost, (i = !0), this.WriteCMListToLocalStorage(), r && window.clearTimeout(r), a && window.clearTimeout(a), n.length)) return e(n);
const s = this.GetCMWithFewestDisconnects();
if (s) return e([s]);
o("No CMs available");
}
};
(0 === t.length || Object.keys(n).some((e) => this.BCMOkToUse(n[e], s)) || (b.De.IN_MOBILE && Object.keys(n).length)) && (Object.keys(n).length && b.De.IN_MOBILE, l(n)),
i ||
((r = window.setTimeout(() => {
(s = "timeout"), !i && Object.keys(n).some((e) => this.BCMOkToUse(n[e], s)) && l(n);
}, 400)),
(a = window.setTimeout(() => {
(s = "seriouslytimeout"), l(n);
}, 12e3)));
let c,
m = 0,
d = 0,
h = (e) => {
!i && this.BCMOkToUse(e, s) ? l({ [e.strHost]: e }) : (n[e.strHost] = e), (!i && c()) || (0 == --d && (i ? this.WriteCMListToLocalStorage() : this.BCMOkToUse(e, "seriouslytimeout") ? l({ [e.strHost]: e }) : ((n[e.strHost] = e), l(n))));
};
c = () => {
if (m < t.length) {
let e = t[m++];
return (
this.PingCM(e).then(() => {
h(e);
}),
!0
);
}
return !1;
};
for (let e = 0; e < 4; e++) c() && d++;
});
}
GetCMWithFewestDisconnects() {
if (!this.m_CMList.rgCMList.length) return;
let e = this.m_CMList.rgCMList[0],
t = 1;
for (; e.nConnectFailures > 0 && t < this.m_CMList.rgCMList.length; ) {
let n = this.m_CMList.rgCMList[t++];
(!n.nConnectFailures || n.nConnectFailures < e.nConnectFailures) && (e = n);
}
return e && this.FixDevHost(e.strHost), e;
}
BCMOkToUse(e, t) {
if (!e) return !1;
let n = e.msPing + e.nCMLoad;
return (n < 80 && e.msPing < 60) || ("immediate" !== t && ((n < 140 && e.msPing < 100) || ("timeout" !== t && n < 350 && e.msPing < 275)));
}
PingCM(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
let t = "https://" + this.FixDevHost(e.strHost) + "/cmping/",
n = performance.now();
const i = s().CancelToken.source();
let o = window.setTimeout(() => {
e.strHost, i.cancel();
}, 1e3);
try {
let r = yield s().head(t, { cancelToken: i.token });
e.strHost, window.clearTimeout(o);
let a = performance.now() - n,
l = r.headers["x-steam-cmload"] ? parseInt(r.headers["x-steam-cmload"]) : void 0;
e.strHost, (e.msPing = a), (e.nCMLoad = l);
} catch (t) {
s().isCancel(t) ? e.strHost : window.clearTimeout(o), (e.msPing = 1e4), (e.nCMLoad = 0);
}
return (e.rtLastCheck = new Date().getTime() / 1e3), e.msPing;
});
}
}
function N() {
return (0, i.mG)(this, void 0, void 0, function* () {
const e = b.De.WEBAPI_BASE_URL + "ISteamDirectory/GetCMListForConnect/v1/?cellid=0&cmtype=websockets",
t = (yield s().get(e)).data,
n = (t && t.response && t.response.serverlist) || [];
return n.length, n.map((e, t) => ({ strHost: e.endpoint, nPriority: t }));
});
}
function P(e) {
return (e.msPing || 0) + (e.nCMLoad || 0);
}
class U extends k {
constructor(e) {
super(),
(this.m_Session = { m_bWaitingForLogonResponse: !1, m_nSessionID: 0, m_eResultLogonSuccess: 2, m_nSessionIDLast: 0, m_nClientInstanceID: "0" }),
(this.m_bLoadingCMList = !1),
(this.m_iCallSeq = 1),
(this.m_mapWaitingCallbacks = new Map()),
(this.m_CMList = new x()),
(this.LogOnResponseHandler = this.messageHandlers.RegisterEMessageAction(751, r.Cm, (e) => {
let t = e.Body().eresult();
(this.m_Session.m_bWaitingForLogonResponse = !1), (this.m_Session.m_eResultLogonSuccess = t), 1 == t ? ((this.m_steamid = new h.K(e.Body().client_supplied_steamid())), (this.m_bLoggedOn = !0), (this.m_Session.m_nSessionID = e.Hdr().client_sessionid()), (this.m_Session.m_nSessionIDLast = this.m_Session.m_nSessionID), (this.m_Session.m_nClientInstanceID = e.Body().client_instance_id()), this.OnLoggedOn()) : (console.warn("Received error code from LogOnResponse, disconnecting. EResult=", e.Body().eresult()), 48 == t && this.m_CMList.RecordCMDisconnected(this.m_SocketCMHost), this.Disconnect());
})),
(this.ClientAccountInfoHandler = this.messageHandlers.RegisterEMessageAction(768, r.Rt, (e) => {
(this.m_unAccountFlags = e.Body().account_flags() || 0), (this.m_strIPCountry = e.Body().ip_country() || ""), (this.m_strPersonaName = e.Body().persona_name() || "");
})),
(0, m.rC)(this),
this.m_CMList.Init(e);
}
BIsConnected() {
return this.m_Socket && this.m_Socket.readyState == WebSocket.OPEN;
}
Connect() {
return (
this.m_onConnect ||
(console.log("Loading CM List"),
(this.m_bConnected = !1),
(this.m_bLoggedOn = !1),
(this.m_bForceDisconnect = !1),
(this.m_Session.m_bWaitingForLogonResponse = !0),
(this.m_bLoadingCMList = !0),
(this.m_onConnect = this.m_CMList
.GetBestCMsToConnectTo()
.then(
(e) => (
(this.m_bLoadingCMList = !1),
new Promise((t, n) => {
let i = 0,
o = !1;
e.slice(0, 3).forEach((e, r, a) =>
this.AttemptHostConnect(e).then(
(n) => {
o ? n.close(4e3) : ((o = !0), (this.m_Socket = n), (this.m_SocketCMHost = e), (this.m_bConnected = !0), this.OnConnect(), t());
},
() => {
console.log(`Failed to connect to CM ${r + 1} of ${a.length}: ${e.strHost}`), i++, i === a.length && (console.log(`Failed to connect to all ${a.length} best CMs`), n());
},
),
);
})
),
)
.catch((e) => {
throw ((this.m_bLoadingCMList = !1), this.OnDisconnect(), e);
}))),
this.m_onConnect
);
}
AttemptHostConnect(e) {
console.log(`Attempting to connect to host ${e.strHost}`);
let t = new WebSocket(this.m_CMList.BuildCMWebSocketURL(e.strHost));
return (
(t.binaryType = "arraybuffer"),
(t.onmessage = (e) => {
let t = new I.At(e.data),
n = l.lq.InitHeaderFromPacket(t);
1 == n.GetEMsg() ? this.DecodeAndDispatchMultiMsg(l.gA.InitFromMsg(F.ne, n)) : this.DispatchMessage(n);
}),
new Promise((n, i) => {
let o = !1;
const r = window.setTimeout(() => {
console.warn(`Socket connection timed out after 3000ms: ${e.strHost}`), (o = !0), t.close(4e3), this.m_CMList.RecordCMDisconnected(e), i();
}, 3e3);
(t.onopen = () => {
console.log(`Connected socket to host ${e.strHost}`), (0, u.X)(!o, "Socket connection was opened after timing out."), o || window.clearTimeout(r), n(t);
}),
(t.onerror = (t) => {
o || (window.clearTimeout(r), (0, u.X)(!1, "Socket connect failed", t), console.log(t), t.message ? console.log(t.message) : console.log("No message"), this.m_CMList.RecordCMDisconnected(e), i());
});
})
);
}
get session() {
return this.m_Session;
}
ClearHeartbeatInterval() {
this.m_iIntervalHeartbeat && (window.clearInterval(this.m_iIntervalHeartbeat), (this.m_iIntervalHeartbeat = void 0));
}
ResetHeartbeatInterval() {
this.ClearHeartbeatInterval(), (this.m_iIntervalHeartbeat = window.setInterval(() => this.SendHeartbeat(), 27e3));
}
SendHeartbeat() {
let e = l.gA.Init(r.cp, 703);
this.Send(e);
}
OnConnect() {
super.OnConnect(),
this.m_Socket &&
((this.m_Socket.onerror = (e) => {}),
this.ResetHeartbeatInterval(),
(this.m_Socket.onclose = (e) => {
this.OnDisconnect();
}));
}
Disconnect() {
this.m_Socket && this.m_Socket.close();
}
OnDisconnect() {
(this.m_Socket = void 0), (this.m_SocketCMHost = void 0), (this.m_onConnect = void 0), this.ClearHeartbeatInterval(), super.OnDisconnect();
}
SendMsgAndAwaitResponse(e, t) {
return new Promise((n, i) => {
let o = this.m_iCallSeq++;
e.Hdr().set_jobid_source("" + o), this.Send(e) ? this.m_mapWaitingCallbacks.set(o, { iSeq: o, msgClass: t, fnCallback: n }) : this.ResolveAwaitWithTransportError(n, t, 2, "Web socket not connected");
});
}
SendInternal(e) {
return !!this.m_Socket && (this.m_steamid.BIsValid() && e.Hdr().set_steamid(this.m_steamid.ConvertTo64BitString()), this.m_Session.m_nSessionID && e.Hdr().set_client_sessionid(this.m_Session.m_nSessionID), this.m_Socket.send(e.Serialize()), 703 != e.GetEMsg() && this.ResetHeartbeatInterval(), !0);
}
BInternalShouldDispatchMessage(e) {
if (e.BIsValid() && e.Hdr().jobid_target() && e.Hdr().jobid_target() !== B.Z3) {
let t = parseInt(e.Hdr().jobid_target());
if (this.m_mapWaitingCallbacks.has(t)) {
let n = this.m_mapWaitingCallbacks.get(t);
if (n) {
let i = l.gA.InitFromMsg(n.msgClass, e);
this.DEBUG_LogCMInterfaceActivity(i, "receive", !0), i.BIsValid() ? n.fnCallback(i) : this.ResolveAwaitWithTransportError(n.fnCallback, n.msgClass, 102, "Failed to parse response from server"), this.m_mapWaitingCallbacks.delete(t);
}
return !1;
}
this.DEBUG_LogCMInterfaceActivity(e, "receive", !1);
}
return !0;
}
DecodeAndDispatchMultiMsg(e) {
let t = e.Body().message_body();
if (!t) return;
e.Body().size_unzipped() && (t = O.inflate(t));
let n = new I.At(t);
for (; n.GetCountBytesRemaining() > 0; ) {
let e = n.GetUint32(),
t = l.lq.InitHeaderFromPacket(new I.At(n.GetPacket(), n.TellGet(), e));
this.DispatchMessage(t), n.SeekGetCurrent(e);
}
}
}
(0, i.gn)([m.aD], U.prototype, "DecodeAndDispatchMultiMsg", null);
n(65059), n(19744);
new Map();
var V = n(84290),
H = n(72746);
n(46361), n(27385);
(0, m.jQ)({ enforceActions: "never" }),
(window.AssertMsg = u.X),
document.addEventListener("DOMContentLoaded", function () {
return (0, i.mG)(this, void 0, void 0, function* () {
(0, o.Ek)(),
o.De.IN_GAMEPADUI || (yield n.e(2388).then(n.t.bind(n, 72388, 23))),
yield (function (e) {
return (0, i.mG)(this, void 0, void 0, function* () {
const t = V.LJ.GetLanguageFallback(e),
i = e === t,
[o, r, a, s] = yield Promise.all([n(41171)(`./shared_${e}.json`), n(3119)(`./friendsui_${e}.json`), i ? {} : n(91090)(`./shared_${t}.json`), i ? {} : n(9014)(`./friendsui_${t}.json`)]);
V.Yt.AddTokens(Object.assign(Object.assign({}, o), r), Object.assign(Object.assign({}, a), s));
});
})(o.De.LANGUAGE);
let e = !0;
b.dk.steamid && (0, C.G$)(b.dk.steamid),
!o.De.IN_CLIENT &&
o.De.STEAM_TV &&
(o.L7.logged_in
? (0, _.yz)(b.dk.steamid)
: ((e = !1),
(function () {
(0, i.mG)(this, void 0, void 0, function* () {
(0, _.PX)();
let { CBroadcastApp: e } = yield Promise.all([n.e(5140), n.e(4679)]).then(n.bind(n, 73035));
new e().Init(() => {
window.location = window.location;
});
});
})())),
v.ZP.SetNavEventParams("steamclient", o.De.STEAM_TV ? "steamtv" : "friendsui"),
e &&
(function () {
let e,
t = o.De.IN_GAMEPADUI,
n = new _.iY(t),
i = null,
r = !1;
{
const t = {
GetFriendsUIExportsVersion: () => f.NA,
FriendsListRoot: (e) => (0, g.IU)(n.FriendStore, n.ChatStore, e),
FriendsListQuickAccess: (e) => (0, g.Sd)(n.FriendStore, n.ChatStore, e),
GroupsListRoot: (e) => (0, g.nY)(n.FriendStore, n.ChatStore, e),
FriendsListAndChatsRoot: (e) => (0, g.r0)(n.FriendStore, n.ChatStore, e),
TabSetRoot: (e) => (0, g.GR)(e),
VoiceChatControlsRoot: (e) => (0, g._l)(n.ChatStore, e),
VoiceChatHeaderRoot: (e) => (0, g.dS)(n.ChatStore, e),
RemotePlayTogetherControlsRoot: (e) => (0, g.cc)(n.ChatStore, e),
BShowRemotePlayQuickAccessControls: () => H.Ul.RemotePlayStore.BShowQuickAccessControls(),
UnreadChatMessagesHeaderRoot: (e) => (0, g.g5)(n.ChatStore, e),
InvitesList: (e) => (0, g.E6)(n.FriendStore, e),
InstrumentWindow: (e) => {
_.g_FriendsUIDesktopApp.InstrumentWindow(e), (0, _.YF)(e, _.D);
},
GetCurrentUserStatusInterface: () => n.GetCurrentUserStatusInterface(),
GetVoiceInterface: () => n.GetVoiceInterface(),
SetEmoticonTrackerCallback: (e) => n.SetEmoticonTrackerCallback(e),
SetStickerTrackerCallback: (e) => n.SetStickerTrackerCallback(e),
ShowPopupFriendsList: (e) => H.Ul.ShowPopupFriendsList(_.D, !e, e),
SetShouldChangePersonaStatusOnDisconnect: (e) => _.g_FriendsUIDesktopApp.SetShouldChangePersonaStatusOnDisconnect(e),
StopListening: () => H.Ul.StopListening(),
Reconnect: () => e.Connect(),
GetPreferredPersonaState: () => H.Ul.FriendStore.GetPersonaStatePreference(),
};
Object.assign(window, t);
}
if (o.De.IN_CLIENT) {
(0, b.Tl)();
let t = { message: "ChatJavascriptInitialized", data: o.De.BUILD_TIMESTAMP };
window.parent.postMessage(t, "https://steamloopback.host"), window.parent.postMessage("ChatJavascriptIntialized", "https://steamloopback.host"), (e = new G()), (r = !0), e.Connect();
} else {
const t = (e = new U(n.Storage));
(i = new p(t, o.De.EREALM)), i.PerformInitialLogon(o.L7);
}
n.Init(e, r, i), r ? (0, g.bI)(n.FriendStore, n.ChatStore, document.getElementById("friendslist-container")) : (0, g.Li)(n.FriendStore, n.ChatStore, document.getElementById("friendslist-container"));
})();
});
});
},
46519: (e, t, n) => {
"use strict";
n.d(t, { j: () => C });
var i = n(85556),
o = n(19953),
r = n(46962),
a = n(92883),
s = n(79588),
l = n(78654),
c = n(93635),
m = n(77385),
d = n(5395);
class h {
constructor(e, t) {
if (!t.hasOwnProperty(e)) throw new Error("Room effect " + e + " is not defined.");
(this.name = e), (this.timestamp = Date.now()), (this.settings = t[e]), (this.expires = this.timestamp + this.settings.timeout);
}
static QueueFor(e) {
return h.k_QueueForEffect[e];
}
Queue() {
return h.k_QueueForEffect[this.name];
}
bIsExpired() {
return Date.now() > this.expires;
}
bIsActive() {
const e = Date.now();
return this.timestamp <= e && this.expires > e;
}
iTimeToExpiry() {
return this.expires - Date.now();
}
render() {
return this.bIsActive() ? this.settings.render(this) : null;
}
}
h.k_QueueForEffect = { snowball: "snowball", snow: "confetti_snow", confetti: "confetti_snow", goldfetti: "confetti_snow", firework: "festive", balloons: "festive", lny2020_lanterns: "festive", lny2020_firework: "festive", lny2020_confetti: "confetti_snow" };
class u {
constructor(e) {
(this.m_mapRoomEffectQueue = { default: [], snowball: [], confetti_snow: [], festive: [] }), (this.m_rgRunningEffects = []), (0, s.rC)(this), (this.m_effectSettings = e);
}
AddRoomEffect(e) {
this.QueueRoomEffect(e), this.UpdateRunningRoomEffects();
}
QueueRoomEffect(e) {
this.m_mapRoomEffectQueue[h.QueueFor(e)].push(e);
}
ActivateRoomEffect(e) {
try {
const t = new h(e, this.m_effectSettings);
this.m_rgRunningEffects.push(t),
window.setTimeout(() => {
this.UpdateRunningRoomEffects();
}, t.iTimeToExpiry() + 100);
} catch (e) {
console.log(e);
}
}
BIsQueueFull(e) {
return this.m_rgRunningEffects.filter((t) => t.Queue() == e).length >= u.k_MaxRoomEffectRunning[e];
}
UpdateRunningRoomEffects() {
this.m_rgRunningEffects = this.m_rgRunningEffects.filter((e) => !e.bIsExpired());
for (let e in this.m_mapRoomEffectQueue) {
const t = e;
for (; this.m_mapRoomEffectQueue[t].length > 0 && !this.BIsQueueFull(t); ) this.ActivateRoomEffect(this.m_mapRoomEffectQueue[t].shift());
}
}
}
(u.k_MaxRoomEffectRunning = { default: 1, snowball: 10, confetti_snow: 3, festive: 10 }), (0, i.gn)([s.LO], u.prototype, "m_rgRunningEffects", void 0);
var p = n(72746);
const _ = d._H.PerMinute,
g = 6 * d._H.PerHour;
class C {
constructor(e, t, n) {
(this.BASELOG = new m.sO("Chat", () => this.unique_id).Debug), (this.m_rgChatViews = []), (this.m_bChatLogsLoaded = !1), (this.m_bReceivedChatLogs = !1), (this.m_bMoreAvailable = !1), (this.m_nLoadingHistoryInProgressCount = 0), (this.m_rgChatMessages = []), (this.m_ChatMessageBlockList = new r.n()), (this.m_cUnreadChatMessages = 0), (this.m_bHasUnreadPriorityChatMessages = !1), (this.m_rtFirstUnreadChatMsg = 0), (this.m_rtLastAckedChatMsg = 0), (this.m_rtLastServerAckedChatMsg = 0), (this.m_rtLastMessageReceived = 0), (this.m_rtLastServerMessageReceived = 0), (this.m_strLastMessage = void 0), (this.m_accountIDLastMessage = void 0), (this.m_rtFirstUnread = 0), (this.m_msTimeActivated = 0), (this.m_setInflightClientMessageID = new Set()), (this.m_bPrepended = !1), (0, s.rC)(this), (this.m_FriendStore = e), (this.m_ChatStore = t), (this.m_CMInterface = n), (this.m_chatRoomEffects = new u(t.ChatRoomEffectSettings));
}
UnloadChatState() {
this.UnloadActiveChatState(), (this.m_rtLastMessageReceived = 0), (this.m_rtLastServerMessageReceived = 0);
}
UnloadActiveChatState() {
(this.m_rgChatMessages = []), this.m_ChatMessageBlockList.Clear(), (this.m_bChatLogsLoaded = !1), (this.m_bReceivedChatLogs = !1);
}
get BIsPrepend() {
return this.m_bPrepended;
}
ResetPrepended() {
this.m_bPrepended = !1;
}
OnTyping() {}
get is_friend_typing() {
return !1;
}
OnReceivedNewMessage(e, t, n, i) {}
BShouldTrackUnreadMessages() {
return !0;
}
BIsVoiceAllowed() {
return !0;
}
GetVoiceNotAllowedReason() {
return null;
}
SendChatMessage(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
const t = this.m_MessageSendQueue.Add(e);
try {
const n = yield this.SendChatMessageInternal(e);
n === r.p.None ? this.m_MessageSendQueue.RemoveItem(t) : this.m_MessageSendQueue.SetItemFailed(t, n);
} catch (e) {
this.m_MessageSendQueue.SetItemFailed(t, r.p.Generic);
}
});
}
SendWithRetries(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
let n = 1;
const i = Date.now();
for (; Date.now() - 1e3 * _ < i; ) {
try {
const i = yield t();
if (1 === i.GetEResult())
return (0, s.z)(() => {
(e.rtTimestamp = i.Body().server_timestamp()), (e.unOrdinal = i.Body().ordinal() || 0), this.OnUserChatEcho(e.rtTimestamp, e.unOrdinal, e.strMessage, i.Body().message_without_bb_code() || e.strMessage);
let t = i.Body().modified_message();
return t && (this.m_ChatStore.EmoticonStore.TrackEmoticonUsage(t, e.rtTimestamp), (e.strMessage = t), (this.m_strLastMessage = t), (this.m_accountIDLastMessage = this.m_FriendStore.self.accountid), this.AddRoomEffectIfNeeded(t)), e.OnServerAcknowledged(), r.p.None;
});
switch (i.GetEResult()) {
case 15:
return e.SetErrorSending(r.p.NotFriends), e.eErrorSending;
case 84:
return e.SetErrorSending(r.p.RateLimitExceeded), e.eErrorSending;
default:
if (3 === i.Hdr().transport_error()) return e.SetErrorSending(r.p.Generic), e.eErrorSending;
console.warn(`Error sending message (Attempt #${n}). Got EResult ${i.GetEResult()}`);
}
} catch (e) {
console.warn(`Error sending message (Attempt #${n}). Got error ${e}`);
}
const i = 1 * Math.pow(2, n - 1);
yield new Promise((e) => setTimeout(e, 1e3 * i)), n++;
}
return e.SetErrorSending(r.p.Generic), e.eErrorSending;
});
}
InitMessageSessionFromServer(e, t, n) {
4 !== this.GetVisibilityState() && (this.m_cUnreadChatMessages = e), (this.m_bHasUnreadPriorityChatMessages = !1), (this.m_rtLastAckedChatMsg = this.m_rtLastServerAckedChatMsg = t), (this.m_rtLastMessageReceived = n), this.m_rtLastAckedChatMsg < this.m_rtLastMessageReceived && (this.m_rtFirstUnreadChatMsg = this.m_rtLastAckedChatMsg + 1);
}
AddChatView(e) {
this.m_rgChatViews.push(e);
}
RemoveChatView(e) {
let t = this.m_rgChatViews.indexOf(e);
-1 != t && this.m_rgChatViews.splice(t, 1);
}
IsMoreHistoryAvailable() {
return this.m_bMoreAvailable;
}
RoomEffectManager() {
return this.m_chatRoomEffects;
}
InternalLoadChatLogs(e = !1) {
let t, n, i, o;
if (e) {
let e = this.GetMostRecentChatMsg();
e ? ((t = e.rtTimestamp), (n = e.unOrdinal)) : ((t = l.r7), (n = 0));
} else (t = l.r7), (n = 0);
return (
(i = l.g1),
(o = 0),
(this.m_nLoadingHistoryInProgressCount += 1),
this.GetMessagesFromTimeRange(t, n, i, 0, C.k_InitialMessageCount)
.then(({ messages: e, moreAvailable: t }) => {
this.AddMessagesToHistory(e, t), (this.m_nLoadingHistoryInProgressCount -= 1), (this.m_bReceivedChatLogs = !0);
})
.catch((e) => ((this.m_nLoadingHistoryInProgressCount -= 1), Promise.reject(e)))
);
}
LoadMoreHistory() {
return 0 != this.m_nLoadingHistoryInProgressCount
? Promise.resolve(!0)
: ((this.m_nLoadingHistoryInProgressCount += 1),
this.GetMessagesFromTimeRange(l.r7, 0, this.m_oldestMessageTime, this.m_oldestMessageOrdinal, C.k_LoadMoreMessageCount)
.then(({ messages: e, moreAvailable: t }) => (this.AddMessagesToHistory(e, t), (this.m_nLoadingHistoryInProgressCount -= 1), !0))
.catch((e) => ((this.m_nLoadingHistoryInProgressCount -= 1), Promise.reject(e))));
}
AddMessagesToHistory(e, t) {
this.BASELOG(`merging ${e.length} messages`), this.MergeChatHistoryChunk(e), this.BASELOG(`${this.m_rgChatMessages.length} total messages`), (this.m_bMoreAvailable = t), this.BASELOG(`friend chat oldest time ${this.m_oldestMessageTime} oldest ordinal ${this.m_oldestMessageOrdinal} bMoreAvailable ${this.m_bMoreAvailable}`);
}
get ChatStore() {
return this.m_ChatStore;
}
OnActivate() {
(this.m_cUnreadChatMessages || this.m_bHasUnreadPriorityChatMessages) && ((this.m_cUnreadChatMessages = 0), (this.m_bHasUnreadPriorityChatMessages = !1), this.m_rtLastMessageReceived && ((this.m_rtLastAckedChatMsg = this.m_rtLastMessageReceived), this.AckChatMsg(this.m_rtLastMessageReceived)), p.Ul.FriendStore.UpdateUnreadMessagesGlobal(), p.Ul.UIStore.FlashChatWindow(this, !1));
}
OnDeactivate() {
this.m_rtFirstUnreadChatMsg = 0;
}
get self() {
return this.m_FriendStore.self;
}
InternalAppendChatMsg(e) {
(0 != this.m_rgChatViews.length || this.m_bChatLogsLoaded) && (this.HasChatMessage(e.rtTimestamp, e.unOrdinal) || (this.m_rgChatMessages.push(e), this.m_ChatMessageBlockList.AppendNewMessage(e), this.TrimLogsIfPossible()));
}
TrimLogsIfPossible() {
let e = this.m_rgChatMessages.length - C.k_KeepLoadedWhenAtScrollBottom;
if (e <= 0) return;
for (let e of this.m_rgChatViews) if (!e.is_scrolled_to_bottom) return;
let t = this.m_ChatMessageBlockList.RemoveOldestMessages(e);
if (!t) return;
let n = this.m_rgChatMessages.indexOf(t);
n < 0 ? (0, c.X)(!1, "Failed to find message being removed") : this.m_rgChatMessages.splice(0, n + 1);
}
HasChatMessage(e, t) {
for (let n = this.m_rgChatMessages.length - 1; n >= 0; n--) {
let i = this.m_rgChatMessages[n];
if (i.rtTimestamp == e && i.unOrdinal == t) return !0;
}
return !1;
}
HasClientMessageInFlight(e) {
return this.m_setInflightClientMessageID.has(e);
}
AppendChatMsg(e, t, n, i) {
let o = new r.dz(e, t, n, i);
return (o.eAnimationState = r.P9.Animating), this.InternalAppendChatMsg(o), o;
}
AppendLocalEchoChatMsg(e) {
let t = new r.iA(this.self.accountid, p.Ul.GetServerRTime32(), e);
return (t.eAnimationState = r.P9.Animating), this.InternalAppendChatMsg(t), t;
}
RemoveMessage(e) {
const t = this.m_rgChatMessages.findIndex((t) => t.UniqueKey() === e.UniqueKey());
-1 === t ? console.warn("Could not find message to remove.") : this.m_rgChatMessages.splice(t, 1), this.m_ChatMessageBlockList.RemoveLocalMessage(e), this.TrimLogsIfPossible();
}
RetryFailedMessage(e) {
e.eErrorSending !== r.p.None ? (this.RemoveMessage(e), this.SendChatMessage(e.strMessage)) : console.log("RetryFailedMessage called with a non-failed message. Ignoring.");
}
AddNewChatMsgAndNotify(e, t, n, i, o, r) {
let a = this.AppendChatMsg(e, t, n, i);
(a.Mentions = r), this.OnNewChatMsgAdded(e, t, n, i);
let s = void 0 !== o;
this.CheckShouldNotify(a, s ? o : i, i), this.AddRoomEffectIfNeeded(a.strMessage);
}
AddRoomEffectIfNeeded(e) {
const t = (0, a.jr)(e);
t && t[0] && "roomeffect" === t[0].tag && this.m_chatRoomEffects.AddRoomEffect(t[0].args.type);
}
UpdateChatMessageDeletedState(e, t) {
for (let n of this.m_rgChatMessages) for (let i of e) n.rtTimestamp == i.rtTimestamp && n.unOrdinal == i.unOrdinal && n.eDeleteState != r.im.Deleted && (n.eDeleteState = t);
}
BShouldSilentlyAddMessage(e) {
return !1;
}
DecorateNotification(e, t, n, i) {
if (i !== n) {
const n = this.m_ChatStore.NotificationBBCodeParser,
o = { chat: this, unAccountIDSender: e.unAccountID, key: e.UniqueKey(), rtTimestamp: e.rtTimestamp, onLoad: () => {} },
r = n.ParseBBCode(i, o);
if (r) return Object.assign(Object.assign({}, t), r);
}
return t;
}
CheckShouldNotify(e, t, n) {
let i = this.self.accountid == e.unAccountID,
o = !1,
r = !1,
a = this.GetVisibilityState(),
s = this.BShouldSilentlyAddMessage(e),
l = e.Mentions;
if (e.BIsServerMessage() && !l.mention_all && !l.mention_here && !l.mention_user) return void (this.m_rtLastServerMessageReceived = e.rtTimestamp);
i
? ((o = !0), (r = !0))
: (s && 0 == this.m_cUnreadChatMessages) || 4 == a
? (o = !0)
: 3 == a &&
0 == this.m_cUnreadChatMessages &&
p.Ul.IdleTracker.AddOnNextActivityCallback(() => {
4 == this.GetVisibilityState() && this.OnActivate();
}),
(this.m_rtLastMessageReceived = e.rtTimestamp),
(this.m_strLastMessage = e.strMessage),
(this.m_accountIDLastMessage = e.unAccountID);
let c = this.m_cUnreadChatMessages,
m = this.m_bHasUnreadPriorityChatMessages;
this.BShouldTrackUnreadMessages() && (o ? ((this.m_rtLastAckedChatMsg = e.rtTimestamp), (this.m_cUnreadChatMessages = 0), (this.m_bHasUnreadPriorityChatMessages = !1), r || this.AckChatMsg(e.rtTimestamp)) : (0 == this.m_rtFirstUnreadChatMsg && (this.m_rtFirstUnreadChatMsg = this.m_rtLastMessageReceived), this.m_cUnreadChatMessages++)), s || this.OnReceivedNewMessage(e, a, t, n), (c == this.m_cUnreadChatMessages && m == this.m_bHasUnreadPriorityChatMessages) || p.Ul.FriendStore.UpdateUnreadMessagesGlobal();
}
AddVoiceChannelInviteMsg(e, t, n) {
this.InternalAppendChatMsg(new r.Ok(e, t, n));
}
AddLocalMsg(e, t, n) {
this.InternalAppendChatMsg(new r.tw(e, t, n));
}
AddNewServerMsg(e, t, n, i, o, a, s) {
if (!(0, r.R$)(i)) return;
let l = new r.dz(e, t, n, o, [], i, a, s);
11 == l.eServerMsgType &&
this.SetupAppCustomServerMsg(l).then((i) => {
this.OnNewChatMsgAdded(e, t, n, i), this.CheckShouldNotify(l, i, l.strServerMsgAppCustomLocalized);
}),
this.InternalAppendChatMsg(l);
}
AckChatMsg(e) {
(this.m_cUnreadChatMessages > 0 || this.m_rtLastServerAckedChatMsg != e) && (this.AckChatMsgOnServer(e), (this.m_rtLastServerAckedChatMsg = e));
}
OnUserChatEcho(e, t, n, i) {
e >= this.m_rtLastAckedChatMsg && ((this.m_rtLastMessageReceived = e), this.UpdateLastAckTimeFromServer(e)), this.OnNewChatMsgAdded(this.m_FriendStore.self.accountid, e, t, n);
}
UpdateLastAckTimeFromServer(e) {
this.m_rtLastServerAckedChatMsg <= e && ((this.m_rtLastServerAckedChatMsg = e), (this.m_rtLastAckedChatMsg = e), this.m_rtLastMessageReceived <= e && ((this.m_cUnreadChatMessages = 0), (this.m_bHasUnreadPriorityChatMessages = !1), p.Ul.FriendStore.UpdateUnreadMessagesGlobal(), p.Ul.UIStore.FlashChatWindow(this, !1)));
}
GetMostRecentChatMsg() {
for (let e = this.m_rgChatMessages.length - 1; e >= 0; e--) if (-1 != this.m_rgChatMessages[e].unOrdinal) return this.m_rgChatMessages[e];
return null;
}
MergeChatHistoryChunk(e) {
if (!e.length) return;
let t,
n = e[0],
i = e[e.length - 1],
o = 0;
for (t = this.m_rgChatMessages.length - 1; t >= 0; t--)
if (-1 != this.m_rgChatMessages[t].unOrdinal) {
if (this.m_rgChatMessages[t].BIsOlderThan(n)) break;
this.m_rgChatMessages[t].BIsNewerThan(i) && o++;
}
for (let t of e) this.MsgLoadedFromHistory(t);
for (t++, this.m_rgChatMessages.splice(t, this.m_rgChatMessages.length - t - o, ...e), t = 0; t < this.m_rgChatMessages.length && -1 == this.m_rgChatMessages[t].unOrdinal; t++);
t >= this.m_rgChatMessages.length ? ((this.m_oldestMessageTime = l.g1), (this.m_oldestMessageOrdinal = 0)) : ((this.m_oldestMessageTime = this.m_rgChatMessages[t].rtTimestamp), (this.m_oldestMessageOrdinal = this.m_rgChatMessages[t].unOrdinal)), this.m_ChatMessageBlockList.BuildMessageBlocks(this.m_rgChatMessages), (this.m_bPrepended = !0);
}
InitQueuedMessages() {
const e = this.m_MessageSendQueue.queued_messages;
if (0 === e.length) return;
const t = [];
e.forEach(({ timestamp: e, message: n, eError: i, id: o }) => {
if (void 0 === i || i === r.p.None) Date.now() - 1e3 * g < e && (this.m_MessageSendQueue.RemoveItem(o), this.SendChatMessage(n));
else {
const o = new r.iA(this.self.accountid, p.Ul.GetServerRTime32(), n);
(o.rtTimestamp = e), o.SetErrorSending(i), t.push(o);
}
}),
this.MergeLocalMessages(t);
}
MergeLocalMessages(e) {
e.sort((e, t) => e.rtTimestamp - t.rtTimestamp);
const t = [];
let n = 0,
i = 0;
for (; n < this.m_rgChatMessages.length || i < e.length; ) n >= this.m_rgChatMessages.length ? t.push(e[i++]) : i >= e.length ? t.push(this.m_rgChatMessages[n++]) : this.m_rgChatMessages[n].rtTimestamp < e[i].rtTimestamp ? t.push(e[i++]) : t.push(this.m_rgChatMessages[n++]);
this.m_rgChatMessages = t;
}
GetBeginFileUploadURL() {
return o.De.CHAT_BASE_URL + "chat/beginfileupload/";
}
GetCommitFileUploadURL() {
return o.De.CHAT_BASE_URL + "chat/commitfileupload/";
}
LogFileUploadMessage(e) {
this.BASELOG(e);
}
GetMaxFileSizeMB() {
return 30;
}
MsgLoadedFromHistory(e) {
11 == e.eServerMsgType && this.SetupAppCustomServerMsg(e);
}
SetupAppCustomServerMsg(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
return console.warn("App custom server message should only be used in a class that knows what to do with it"), "";
});
}
GetVisibilityState(e) {
let t = 0;
for (let n of this.m_rgChatViews) {
if (e && !n.BIsInBrowserContext(e)) continue;
let i = n.GetVisibilityState();
i > t && (t = i);
}
return t;
}
GetLastMessage() {
return this.m_strLastMessage;
}
get accountid_last_message() {
return this.m_accountIDLastMessage;
}
get unread_message_count() {
return this.m_cUnreadChatMessages;
}
get has_unread_priority_messages() {
return this.m_bHasUnreadPriorityChatMessages;
}
get first_unread_msg_time() {
return this.m_rtFirstUnreadChatMsg;
}
get time_last_message() {
return this.m_rtLastMessageReceived;
}
get time_last_ack() {
return this.m_rtLastAckedChatMsg;
}
get chat_messages() {
return this.m_rgChatMessages;
}
get chat_message_blocks() {
return this.m_ChatMessageBlockList;
}
get last_voice_participation_time() {
return this.m_rtLastAckedChatMsg;
}
LoadChatLogs() {
return (0, i.mG)(this, void 0, void 0, function* () {
if (!this.m_bChatLogsLoaded && this.m_CMInterface.logged_on) return (this.m_bChatLogsLoaded = !0), this.InternalLoadChatLogs(!1);
});
}
OnConnectionRestored() {
this.m_bChatLogsLoaded && this.InternalLoadChatLogs(!0);
}
}
(C.k_InitialMessageCount = 100),
(C.k_KeepLoadedWhenAtScrollBottom = 2 * C.k_InitialMessageCount),
(C.k_LoadMoreMessageCount = 50),
(0, i.gn)([s.LO], C.prototype, "m_bReceivedChatLogs", void 0),
(0, i.gn)([s.LO], C.prototype, "m_bMoreAvailable", void 0),
(0, i.gn)([s.LO.shallow], C.prototype, "m_rgChatMessages", void 0),
(0, i.gn)([s.LO], C.prototype, "m_cUnreadChatMessages", void 0),
(0, i.gn)([s.LO], C.prototype, "m_rtFirstUnreadChatMsg", void 0),
(0, i.gn)([s.LO], C.prototype, "m_rtLastAckedChatMsg", void 0),
(0, i.gn)([s.LO], C.prototype, "m_rtLastMessageReceived", void 0),
(0, i.gn)([s.LO], C.prototype, "m_rtLastServerMessageReceived", void 0),
(0, i.gn)([s.LO], C.prototype, "m_strLastMessage", void 0),
(0, i.gn)([s.LO], C.prototype, "m_accountIDLastMessage", void 0),
(0, i.gn)([s.LO], C.prototype, "m_rtFirstUnread", void 0),
(0, i.gn)([s.aD], C.prototype, "InitMessageSessionFromServer", null),
(0, i.gn)([s.aD], C.prototype, "AddMessagesToHistory", null),
(0, i.gn)([s.aD], C.prototype, "OnActivate", null),
(0, i.gn)([s.aD], C.prototype, "OnDeactivate", null),
(0, i.gn)([s.aD], C.prototype, "AppendChatMsg", null),
(0, i.gn)([s.aD], C.prototype, "AppendLocalEchoChatMsg", null),
(0, i.gn)([s.aD], C.prototype, "AddNewChatMsgAndNotify", null),
(0, i.gn)([s.aD], C.prototype, "UpdateChatMessageDeletedState", null),
(0, i.gn)([s.aD], C.prototype, "AddVoiceChannelInviteMsg", null),
(0, i.gn)([s.aD], C.prototype, "AddLocalMsg", null),
(0, i.gn)([s.aD], C.prototype, "AddNewServerMsg", null);
},
23503: (e, t, n) => {
"use strict";
n.d(t, { v: () => l });
var i = n(85556),
o = n(71576),
r = n(79588),
a = n(66035),
s = n(88991);
class l extends o.Q {
constructor(e, t) {
super(), (this.m_info = void 0), (this.m_bShowWatchPromptDialog = !1), (this.m_watchPromptInitialFriend = void 0), (0, r.rC)(this), (this.m_steamID = s.K.InitFromAccountID(t)), (this.m_tabset = e), this.InitInfo();
}
InitInfo() {
return (0, i.mG)(this, void 0, void 0, function* () {
this.m_info = (yield l.GetBroadcastWatchStore()).StartInfo(this.m_steamID.ConvertTo64BitString());
});
}
static GetBroadcastWatchStore() {
return (0, i.mG)(this, void 0, void 0, function* () {
const { BroadcastWatchStore: e } = yield Promise.all([n.e(5140), n.e(4679)]).then(n.bind(n, 90656));
return e;
});
}
GetSteamID() {
return this.m_steamID;
}
GetTabName() {
const e = this.m_info && this.m_info.m_strTitle;
return !e && a.rr.bValid ? a.rr.name : e;
}
GetUniqueID() {
return "br" + this.m_steamID.GetAccountID();
}
OnTabFocus() {}
InternalOnTabActivate() {}
OnTabDeactivate() {}
OnTabClosed() {
(() => {
(0, i.mG)(this, void 0, void 0, function* () {
(yield l.GetBroadcastWatchStore()).StopInfo(this.m_info);
});
})();
}
IsVoiceActive() {
return !1;
}
GetUnreadMessageCount() {
return 0;
}
IsTabForChat(e) {
return !1;
}
GetChatView() {
return null;
}
IsBroadcast() {
return !0;
}
ShowWatchPromptDialog(e) {
(this.m_bShowWatchPromptDialog = !0), (this.m_watchPromptInitialFriend = e);
}
HideWatchPromptDialog() {
(this.m_bShowWatchPromptDialog = !1), (this.m_watchPromptInitialFriend = void 0);
}
}
(0, i.gn)([r.LO], l.prototype, "m_info", void 0), (0, i.gn)([r.LO], l.prototype, "m_bShowWatchPromptDialog", void 0), (0, i.gn)([r.LO], l.prototype, "m_watchPromptInitialFriend", void 0), (0, i.gn)([r.aD], l.prototype, "ShowWatchPromptDialog", null), (0, i.gn)([r.aD], l.prototype, "HideWatchPromptDialog", null);
},
67915: (e, t, n) => {
"use strict";
n.d(t, { R5: () => G.R5, ic: () => F });
var i = n(85556),
o = n(19953),
r = n(46962),
a = n(72746),
s = n(79588);
class l {
constructor() {
this.bCollapsed = !1;
}
IsEmpty() {
return !this.bCollapsed && void 0 === this.nDefaultWidth && void 0 === this.nDesiredWidth;
}
}
const c = "ChatEmbeds";
class m {
constructor() {
this.m_mapEmbed = new s.vP();
}
Init() {
a.Ul.SettingsStore.GetObjectFromLocalStorageWhenReady(c, {}).then((e) => {
this.m_mapEmbed.clear();
for (let t in e) {
let n = new l();
Object.assign(n, e[t]), this.m_mapEmbed.set(t, n);
}
});
}
GetKey(e, t) {
return t + "_" + e;
}
EvictOldestIfNecessary() {
if (this.m_mapEmbed.size > 100) {
let e = Array.from(this.m_mapEmbed.keys()).sort()[0];
this.m_mapEmbed.delete(e);
}
}
GetOrCreateEmbedData(e, t) {
let n = this.GetKey(e, t),
i = this.m_mapEmbed.get(n);
return i || ((i = new l()), (i.bCollapsed = !1)), i;
}
SaveEmbedData(e, t, n) {
n.IsEmpty() ? this.m_mapEmbed.delete(this.GetKey(e, t)) : this.m_mapEmbed.set(this.GetKey(e, t), n), this.EvictOldestIfNecessary(), this.WriteToLocalStorage();
}
WriteToLocalStorage() {
a.Ul.SettingsStore.StoreObjectInLocalStorage(c, this.m_mapEmbed);
}
GetCollapsedState(e, t) {
let n = this.m_mapEmbed.get(this.GetKey(e, t));
return !(!n || !n.bCollapsed);
}
SetCollapsedState(e, t, n) {
let i = this.GetOrCreateEmbedData(e, t);
(i.bCollapsed = n), this.SaveEmbedData(e, t, i);
}
GetWidths(e, t) {
let n = this.m_mapEmbed.get(this.GetKey(e, t));
if (n && n.nDesiredWidth && n.nDefaultWidth) return { nDesiredWidth: n.nDesiredWidth, nDefaultWidth: n.nDefaultWidth };
}
SetWidths(e, t, n, i) {
let o = this.GetOrCreateEmbedData(e, t);
n == i ? (delete o.nDefaultWidth, delete o.nDesiredWidth) : ((o.nDesiredWidth = n), (o.nDefaultWidth = i)), this.SaveEmbedData(e, t, o);
}
}
var d = n(13114),
h = n(25629),
u = n(20891),
p = n(93354),
_ = n(19339),
g = n(1736),
C = n(88991),
f = n(57476),
v = n(4638),
S = n(91867),
b = n(76262);
class I extends S.u {
Init(e) {
(this.m_CMInterface = e),
this.m_CMInterface.messageHandlers.RegisterEMessageAction(9331, b.jD, (e) => {
let t = [];
for (let n of e.Body().emoticons()) {
let e = n.name();
if (e.startsWith("^")) t.push({ name: e });
else {
let i = { name: e.substr(1, e.length - 2) },
o = i.name.toLowerCase();
o != i.name && (i.name_normalized = o), n.time_last_used() && (i.last_used = n.time_last_used()), n.use_count() && (i.use_count = n.use_count()), n.time_received() && (i.time_received = n.time_received()), n.appid() && (i.appid = n.appid()), t.push(i);
}
}
this.OnEmoticonListReceived(t);
const n = e.Body().toObject();
n.stickers && (this.m_rgStickers = n.stickers.map((e) => e)),
n.effects &&
(this.m_rgEffects = n.effects.map((e) => {
var { name: t } = e,
n = (0, i._T)(e, ["name"]);
return Object.assign({ name: t }, n);
}));
let o = this.m_rgStickers.map((e) => e.time_received).reduce((e, t) => Math.max(e, t), Number.MIN_SAFE_INTEGER),
r = this.m_rgEffects.map((e) => e.time_received).reduce((e, t) => Math.max(e, t), Number.MIN_SAFE_INTEGER);
this.m_rtLastStickerOrEffect = Math.max(o, r);
});
}
BInitialized() {
return !!this.m_CMInterface;
}
GetServerTime() {
return this.m_CMInterface.GetServerRTime32();
}
RequestEmoticonListInternal() {
this.m_CMInterface.RunWhenLoggedOn(() => {
let e = g.gA.Init(b.nW, 9330);
this.m_CMInterface.Send(e);
});
}
}
var y = n(58594),
E = n(9612);
class D extends E.l {
InitCM(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
return null != this.m_CMInterface ? null : ((this.m_CMInterface = e), yield this.m_CMInterface.WaitUntilLoggedOn(), this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandlerAction(y.jj.NotifyCommunityPreferencesChangedHandler, (e) => (this.UpdateCommunityPreferences(e.Body().preferences()), this.OnFilterDataChanged(), 1)), this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandlerAction(y.jj.NotifyTextFilterWordsChangedHandler, (e) => (this.UpdateTextFilterWords(e.Body().words()), this.OnFilterDataChanged(), 1)), this.Init(this.m_CMInterface.steamid.GetAccountID(), this.m_CMInterface.GetServiceTransport(), t));
});
}
}
var w = n(9824),
R = n(93635),
A = n(84290);
function M(e, t) {
if (!e || !t) return [];
let n = [],
i = e.values(),
o = i.next();
for (; !o.done; ) t(o.value) && n.push(o.value), (o = i.next());
return n;
}
function k(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
const n = Math.floor(Math.random() * t * 1e3);
return yield new Promise((e) => setTimeout(e, n)), e();
});
}
var T = n(5395);
class L {
constructor() {
(this.m_bReady = !1), (0, s.rC)(this);
}
Init(e) {
(this.m_storage = e), this.InitFromStorage();
}
get bReady() {
return this.m_bReady;
}
InitFromStorage() {
return (0, i.mG)(this, void 0, void 0, function* () {
try {
const e = yield this.m_storage.GetObject(L.strSettingsStorageKey);
if (!e) return (this.m_settings = s.LO.object({ friends: {}, groups: {} })), void (this.m_bReady = !0);
if (!this.ParseStoredObject(e)) throw new Error("Stored object was malformed. Could not parse correctly.");
(this.m_settings = s.LO.object(e)), (this.m_bReady = !0);
} catch (e) {
console.error(`CHiddenRecentItemsSettings: Problem initializing from cache: ${e}`), this.m_storage.RemoveObject(L.strSettingsStorageKey), (this.m_settings = s.LO.object({ friends: {}, groups: {} })), (this.m_bReady = !0);
}
});
}
ParseStoredObject(e) {
try {
if ("object" != typeof e) return !1;
const t = e;
return "object" == typeof t.friends && "object" == typeof t.groups && !Object.keys(t.friends).some((e) => "number" != typeof t.friends[e]) && !Object.keys(t.groups).some((e) => "number" != typeof t.groups[e]);
} catch (e) {
return !1;
}
}
BIsFriendHidden(e, t) {
if (!this.m_bReady) return !1;
const n = this.m_settings.friends[e.accountid.toString()];
return n && n >= t;
}
BIsGroupHidden(e, t) {
if (!this.m_bReady) return !1;
const n = this.m_settings.groups[e.GetGroupID()];
return n && n >= t;
}
SetHiddenTimeForFriend(e, t) {
return (this.m_settings.friends[e.accountid.toString()] = t), (this.m_settings.bHasEverHiddenFriend = !0), this.Save();
}
SetHiddenTimeForGroup(e, t) {
return (this.m_settings.groups[e.GetGroupID()] = t), (this.m_settings.bHasEverHiddenGroup = !0), this.Save();
}
Save() {
return this.m_storage.StoreObject(L.strSettingsStorageKey, this.m_settings);
}
BHasEverHiddenFriend() {
return this.m_settings.bHasEverHiddenFriend;
}
BHasEverHiddenGroup() {
return this.m_settings.bHasEverHiddenGroup;
}
}
(L.strSettingsStorageKey = "RecentChats.HiddenItems"), (0, i.gn)([s.LO], L.prototype, "m_bReady", void 0);
var G = n(71240),
O = n(22394);
n(46519);
class F {
constructor(e) {
(this.m_EmoticonStore = new I()), (this.m_FriendChatStore = new _.d(this)), (this.m_InviteStore = new h.kQ(this)), (this.m_GameInviteStore = new d.JL()), (this.m_ChatRoomGroupDisplayPrefs = new p.jx()), (this.m_EmbedStore = new m()), (this.m_TextFilterStore = new D({ BIsFriend: (e) => !!this.m_FriendStore.GetFriendIfCached(e) })), (this.m_mapChatGroups = s.LO.map()), (this.m_mapActiveChatGroupsToRefCount = s.LO.map()), (this.m_mapVirtualizedMemberListViews = new Map()), (this.m_mapClanChatsByClanID = new Map()), (this.m_HiddenRecentChatSettings = new L()), (this.m_GroupAddedCallbacks = new O.pB()), (this.m_bReceivedChatGroupList = !1), (this.m_bReadyToRender = !1), (this.m_bSendingActiveGroups = !1), (this.m_bSendActiveGroupsQueued = !1), (0, s.rC)(this), (this.m_FriendStore = e);
}
Init(e, t) {
(this.m_CMInterface = e), this.m_EmoticonStore.Init(e), (this.m_VoiceChat = t), (this.m_ChatRoomBBCodeParser = a.Ul.GetChatRoomBBCodeParser()), (this.m_FriendChatBBCodeParser = a.Ul.GetFriendChatBBCodeParser()), (this.m_NotificationBBCodeParser = a.Ul.GetNotificationBBCodeParser()), (this.m_ChatRoomEffectSettings = a.Ul.GetChatRoomEffectSettings()), this.m_ChatRoomGroupDisplayPrefs.Init(a.Ul.SettingsStore), this.m_EmbedStore.Init(), this.m_FriendChatStore.Init(), this.m_HiddenRecentChatSettings.Init(a.Ul.Storage), this.m_TextFilterStore.InitCM(this.m_CMInterface, a.Ul.Storage);
let n = !1,
i = 0;
return (
this.m_CMInterface.AddOnLogonCallback(() => {
if (n) {
const e = i < Date.now() / 1e3 - T._H.PerMinute / 2;
e ? k(() => this.RestoreStatePostDisconnect(e), 4) : this.RestoreStatePostDisconnect(e);
} else u.d.Init(a.Ul.Storage, e.steamid.GetAccountID().toString()).then(() => this.LoadMyChatRooms()), this.m_FriendChatStore.OnLogon(), (n = !0);
this.m_GameInviteStore.Init();
}, 102),
this.m_CMInterface.AddOnDisconnectCallback(() => (i = Date.now() / 1e3), 102),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandlerAction(v.ej.NotifyIncomingChatMessageHandler, (e) => {
let t = e.Body(),
n = this.FindChatRoom(t.chat_group_id(), t.chat_id());
if (!n) return 2;
let i = new C.K(t.steamid_sender());
if (0 != (t.server_message().message() || 0)) n.AddNewServerMsg(i.GetAccountID(), t.timestamp(), t.ordinal() || 0, t.server_message().message(), t.message(), t.server_message().string_param(), t.server_message().accountid_param());
else {
let e = t.mentions(),
o = null;
e && ((o = {}), e.mention_all() && (o.mention_all = !0), e.mention_here() && (o.mention_here = !0), e.mention_accountids() && -1 !== e.mention_accountids().indexOf(this.m_FriendStore.self.accountid) && (o.mention_user = !0)), n.AddNewChatMsgAndNotify(i.GetAccountID(), t.timestamp(), t.ordinal() || 0, t.message(), t.message_no_bbcode(), o);
let r = this.m_TextFilterStore;
if (!r.BShownFilterTip() && r.BHasFilter()) {
let e = t.message();
this.m_TextFilterStore.FilterText(i.GetAccountID(), e) !== e && (n.AddLocalMsg(i.GetAccountID(), t.timestamp(), (0, A.Xx)("#Chat_TextFilter_Active", this.GetTextFilterSettingsURL())), r.SetFilterTipShown(!0));
}
}
return 1;
}),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandlerAction(v.ej.NotifyChatMessageModifiedHandler, (e) => {
let t = e.Body(),
n = this.FindChatRoom(t.chat_group_id(), t.chat_id());
if (!n) return 2;
let i = [];
for (let t of e.Body().messages()) t.deleted && i.push({ rtTimestamp: t.server_timestamp(), unOrdinal: t.ordinal() });
return n.UpdateChatMessageDeletedState(i, r.im.Deleting), 1;
}),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandler(v.ej.NotifyChatRoomHeaderStateChangeHandler, (e) => {
let t = e.Body().header_state().chat_group_id(),
n = this.m_mapChatGroups.get(t);
return n && n.UpdateChatRoomHeaderState(e.Body().header_state()), 1;
}),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandler(v.ej.NotifyMemberStateChangeHandler, (e) => {
let t = e.Body().chat_group_id(),
n = e.Body().change(),
i = e.Body().member();
o.De.IN_CLIENT && (0, f.U5)("WebChat.OnGroupChatUserStateChange") && a.Ul.SettingsStore.BClientHasFeatureOrOnWeb("SteamworksChatAPI") && SteamClient.WebChat.OnGroupChatUserStateChange(t, i.accountid(), n);
let r = this.m_mapChatGroups.get(t);
return r && r.OnUserStateChange(i, n), 1;
}),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandler(v.ej.NotifyChatRoomGroupRoomsChangeHandler, (e) => {
let t = e.Body(),
n = this.m_mapChatGroups.get(t.chat_group_id());
return n && n.OnRoomStateChange(t), 1;
}),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandler(v.ej.NotifyChatGroupUserStateChangedHandler, (e) => {
let t = e.Body(),
n = t.chat_group_id(),
i = t.user_action();
switch ((o.De.IN_CLIENT && (0, f.U5)("WebChat.OnGroupChatUserStateChange") && a.Ul.SettingsStore.BClientHasFeatureOrOnWeb("SteamworksChatAPI") && SteamClient.WebChat.OnGroupChatUserStateChange(n, o.L7.accountid, i), i)) {
case 1: {
let e = this.AddJoinedChatRoomGroup(t.group_summary(), t.user_chat_group_state());
a.Ul.UIStore.ShowAndOrActivateChatRoomGroup(a.Ul.GetDefaultBrowserContext(), e, !1);
break;
}
case 2:
case 3:
case 10: {
a.Ul.VoiceStore.GetActiveChatRoomGroupID() == n && a.Ul.VoiceStore.OnUserEndVoiceChat();
let e = this.GetChatRoomGroup(n),
t = e ? e.name : void 0;
this.RemoveChatRoomGroup(n), t && (3 == i ? a.Ul.ShowAlert((0, A.Xx)("#Alert_YouWereKickedTitle"), (0, A.Xx)("#Alert_YouWereKickedDescription", t)) : 10 == i && a.Ul.ShowAlert((0, A.Xx)("#Alert_YouWereBannedTitle"), (0, A.Xx)("#Alert_YouWereBannedDescription", t)));
break;
}
case 7:
case 0: {
let e = this.GetChatRoomGroup(n);
(0, R.X)(e, "Got state change for ChatRoomGroup we don't know about"), e && e.UpdateUserState(t.user_chat_group_state());
break;
}
case 4:
break;
default:
(0, R.X)(!1, `Don't know how to handle state change of type ${(0, v.dH)(i)} `);
}
return 1;
}),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandlerAction(v.ej.NotifyAckChatMessageEchoHandler, (e) => {
let t = e.Body().chat_group_id(),
n = e.Body().chat_id(),
i = e.Body().timestamp(),
o = this.GetChatRoomGroup(t);
if (!o) return 2;
if (n) {
let e = o.GetChatRoom(n);
if (!e) return 11;
e.UpdateLastAckTimeFromServer(i);
} else o.UpdateLastAckTimeFromServer(i);
return 1;
}),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandlerAction(v.ej.NotifyMessageReactionHandler, (e) => {
const { chat_group_id: t, chat_id: n, server_timestamp: i, ordinal: o, is_add: r, reactor: s, reaction: l, reaction_type: c } = e.Body().toObject(),
m = this.GetChatRoomGroup(t);
if (m) {
const e = m.GetChatRoom(n);
if (e) {
const t = e.chat_messages.find((e) => e.rtTimestamp === i && e.unOrdinal === o);
if (t) {
const n = t.reactions.find((e) => e.strReaction === l),
i = r ? 1 : -1;
if (-1 === i && !n) return console.error("ChatRoomClientService.NotifyMessageReaction: Got reaction removal notifiaction but no matching reaction was found."), 1;
let o = !!n && n.bUserReacted;
s === a.Ul.FriendStore.self.steamid64 && (o = r);
t.UpdateReaction(c, l, n ? n.cReactors + i : i, o);
const m = new C.K(s);
e.UpdateMessageReactionReactors(t, l, m.GetAccountID(), r);
}
}
}
return 1;
}),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandler(
v.ej.NotifyChatRoomDisconnectHandler,
(e) => (
k(
() =>
(0, s.z)(() => {
for (let t of e.Body().chat_group_ids()) {
let e = this.m_mapChatGroups.get(t);
e && e.OnConnectionRestored(!0);
}
this.SendActiveChatRoomGroupsToServer();
}),
4,
),
1
),
),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandler(v.ej.NotifyMemberListViewUpdatedHandler, (e) => {
let t = this.m_mapVirtualizedMemberListViews.get(e.Body().view_id());
return t && t.OnServerUpdate(e.Body()), 1;
}),
new Promise((e) => {
this.m_fnOnReadyToRender = e;
})
);
}
SetReadyToRender() {
this.m_bReadyToRender || ((this.m_bReadyToRender = !0), this.m_fnOnReadyToRender && (this.m_fnOnReadyToRender(), (this.m_fnOnReadyToRender = void 0)));
}
RestoreStatePostDisconnect(e) {
e && this.LoadMyChatRooms();
const t = Array.from(this.m_mapActiveChatGroupsToRefCount.values()).some((e) => e > 0);
this.m_FriendChatStore.RestoreStatePostDisconnect(e), this.m_mapChatGroups.forEach((t) => t.OnConnectionRestored(e)), t && this.SendActiveChatRoomGroupsToServer();
}
LoadMyChatRooms() {
let e = !1,
t = g.gA.Init(v.RG);
v.Xn.GetMyChatRoomGroups(this.m_CMInterface.GetServiceTransport(), t)
.then((t) => {
(0, s.z)(() => {
1 != t.GetEResult() && (e = !0);
let n = t.Body().chat_room_groups();
for (let t of n) {
let n = t.group_summary().chat_group_id();
if (!n) {
e = !0;
continue;
}
let i = this.m_mapChatGroups.get(n);
i || ((i = new p.PR(this, n)), this.m_mapChatGroups.set(n, i)), i.SetInitialGroupState(t.group_summary()), i.UpdateUserState(t.user_chat_group_state()), this.OnGroupAdded(i), i.BHasEverBeenAcked() || a.Ul.UIStore.ShowUnackedGroup(i);
}
this.SetReadyToRender(), (this.m_bReceivedChatGroupList = !0);
});
})
.catch((e) => {
console.error("Failed to load chat rooms from server", e), this.SetReadyToRender();
});
}
OnGroupAdded(e) {
e.GetClanID() && (this.m_mapClanChatsByClanID.set(e.GetClanID(), e.GetGroupID()), this.m_FriendStore.ClanStore.SetClanChatGroupID(e.GetClanID(), e.GetGroupID())), this.m_GroupAddedCallbacks.Dispatch(e);
}
RegisterForGroupAdded(e) {
return this.m_GroupAddedCallbacks.Register(e);
}
OnChatRoomActivated(e) {
e.GetGroup().OnActivate();
}
JoinAndShowChatRoomGroup(e, t, n) {
let i = this.GetChatRoomGroup(t);
i && i.BIsCurrentUserAMember() ? a.Ul.UIStore.ShowAndOrActivateChatRoomGroup(e, i, n) : this.m_InviteStore.JoinChatGroup(t, null, e);
}
AddCreatedChatRoomGroup(e, t, n, i) {
if (this.m_mapChatGroups.has(t)) return;
let o = new p.PR(this, t);
this.m_mapChatGroups.set(t, o), o.UpdateGroupState(n), o.UpdateUserState(i), this.OnGroupAdded(o), a.Ul.UIStore.ShowAndOrActivateChatRoomGroup(e, o, !0);
}
AddKnownChatRoomGroup(e, t) {
let n = e.chat_group_id();
if (this.m_mapChatGroups.has(n)) {
this.m_mapChatGroups.get(n).SetInitialGroupState(e);
} else {
let i = new p.PR(this, n);
this.m_mapChatGroups.set(n, i), i.SetInitialGroupState(e), t && i.UpdateUserState(t), this.OnGroupAdded(i);
}
}
AddJoinedChatRoomGroup(e, t) {
let n = t.chat_group_id(),
i = this.m_mapChatGroups.get(n);
return i || ((i = new p.PR(this, n)), this.m_mapChatGroups.set(n, i)), e instanceof v.Pt ? i.UpdateGroupState(e) : i.SetInitialGroupState(e), this.OnGroupAdded(i), i.UpdateUserState(t), i;
}
RemoveChatRoomGroup(e) {
let t = this.m_mapChatGroups.get(e);
if (!t) return;
let n = this.m_mapChatGroups.get(e);
n && a.Ul.UIStore.CloseTabByID(n.unique_id), this.GetRefCountActiveChatRoomGroup(e) <= 0 && t.UnloadAndResetGroupState();
}
FindChatRoom_Deprecated(e) {
let t = null;
return (
this.m_mapChatGroups.forEach((n) => {
let i = n.GetChatRoom(e);
i && (t = i);
}),
t
);
}
FindChatRoom(e, t) {
let n = this.m_mapChatGroups.get(e);
return n ? n.GetChatRoom(t) : null;
}
get chat_group_list_ready() {
return this.m_bReceivedChatGroupList;
}
get FriendStore() {
return this.m_FriendStore;
}
get CMInterface() {
return this.m_CMInterface;
}
get VoiceChat() {
return this.m_VoiceChat;
}
get ChatRoomBBCodeParser() {
return this.m_ChatRoomBBCodeParser;
}
get FriendChatBBCodeParser() {
return this.m_FriendChatBBCodeParser;
}
get NotificationBBCodeParser() {
return this.m_NotificationBBCodeParser;
}
get ChatRoomEffectSettings() {
return this.m_ChatRoomEffectSettings;
}
get FriendChatStore() {
return this.m_FriendChatStore;
}
get EmoticonStore() {
return this.m_EmoticonStore;
}
get InviteStore() {
return this.m_InviteStore;
}
get GameInviteStore() {
return this.m_GameInviteStore;
}
get EmbedStore() {
return this.m_EmbedStore;
}
get TextFilterStore() {
return this.m_TextFilterStore;
}
GetTextFilterStatus() {
let e = this.m_TextFilterStore.TextFilterPreferences;
switch (e.eTextFilterSetting) {
case 0:
return (0, A.Xx)("#TextFilterStatus_SteamLabOptedOut");
case 1:
return e.bIgnoreFriends ? (0, A.Xx)("#TextFilterStatus_Enabled_IgnoreFriends") : (0, A.Xx)("#TextFilterStatus_Enabled");
case 2:
return e.bIgnoreFriends ? (0, A.Xx)("#TextFilterStatus_EnabledAllowProfanity_IgnoreFriends") : (0, A.Xx)("#TextFilterStatus_EnabledAllowProfanity");
case 3:
return (0, A.Xx)("#TextFilterStatus_Disabled");
default:
return "";
}
}
GetTextFilterSettingsURL() {
return o.De.STORE_BASE_URL + "account/preferences#CommunityContentPreferences";
}
get ChatRoomGroupDisplayPrefs() {
return this.m_ChatRoomGroupDisplayPrefs;
}
BIsEligibleForVoiceChat(e, t) {
let n;
t && t instanceof _.a && (n = t);
let i = 2 == e.efriendrelationship,
o = 4 == e.efriendrelationship;
return e.persona.is_online && !n && !i && !o && !e.is_blocked;
}
GetActiveVoiceChat() {
let e = this.m_VoiceChat.GetActiveVoiceChatID();
if ("" != e) {
let t = this.FindChatRoom_Deprecated(e);
if (t) return t;
} else {
let e = this.m_VoiceChat.GetActiveOneOnOneVoiceChatAccountID();
if (0 != e) {
let t = this.GetFriendChat(e, !1);
if (t) return t;
}
}
}
GetActiveVoiceChannelName() {
let e = this.GetActiveVoiceChat();
return null != e ? e.name : "";
}
GetFriendChat(e, t = !0) {
return e == this.FriendStore.self.accountid ? null : this.m_FriendChatStore.GetFriendChat(e, t);
}
GetRecentChats() {
function e(e) {
return Math.max(e.time_last_ack, e.time_last_message);
}
function t(e) {
return e.time_last_activity;
}
const n = a.Ul.ChatStore.FriendChatStore.GetAllChats()
.filter((t) => !this.m_HiddenRecentChatSettings.BIsFriendHidden(t.chat_partner, e(t)) && e(t) > 0)
.sort((t, n) => e(n) - e(t)),
i = a.Ul.ChatStore.currentChatRoomGroups.filter((e) => !!e.room_with_last_message && !this.m_HiddenRecentChatSettings.BIsGroupHidden(e, t(e))).sort((e, n) => t(n) - t(e)),
o = [];
for (let r = 0, a = 0; r + a < n.length + i.length; ) r === n.length ? o.push(i[a++]) : a === i.length ? o.push(n[r++]) : i[a].room_with_last_message ? (e(n[r]) < t(i[a]) ? o.push(i[a++]) : o.push(n[r++])) : a++;
return o;
}
GetChatRoomGroup(e) {
return this.m_mapChatGroups.get(e);
}
get currentChatRoomGroups() {
return M(this.m_mapChatGroups, (e) => e.BIsCurrentUserAMember());
}
FindChatRoomGroupsMatchingSearch(e) {
return this.currentChatRoomGroups.filter((t) => -1 !== t.name.toLocaleLowerCase().indexOf(e));
}
get ClanChatRooms() {
return M(this.m_mapChatGroups, (e) => e.BIsClanChatRoom());
}
GetRefCountActiveChatRoomGroup(e) {
let t = this.m_mapActiveChatGroupsToRefCount.get(e);
return void 0 === t && (t = 0), t;
}
IncRefActiveChatRoomGroup(e, t) {
let n = this.m_mapActiveChatGroupsToRefCount.get(e);
return void 0 === n && (n = 0), (n += 1), this.m_mapActiveChatGroupsToRefCount.set(e, n), 1 == n && t && this.SendActiveChatRoomGroupsToServer(), n;
}
DecRefActiveChatRoomGroup(e) {
let t = this.m_mapActiveChatGroupsToRefCount.get(e),
n = void 0 !== t && t > 0;
if (((0, R.X)(n, "Attempting to DecRef a Chat Group that has no existing references. Doing nothing."), !n)) return 0;
if (((t -= 1), t <= 0)) {
this.m_mapActiveChatGroupsToRefCount.delete(e);
let t = this.m_mapChatGroups.get(e);
t && t.UnloadActiveGroupState(), this.SendActiveChatRoomGroupsToServer();
} else this.m_mapActiveChatGroupsToRefCount.set(e, t);
return t;
}
OnRestorePopupsComplete() {
this.m_mapActiveChatGroupsToRefCount.size > 0 && this.SendActiveChatRoomGroupsToServer();
}
SendActiveChatRoomGroupsToServer() {
return (0, i.mG)(this, void 0, void 0, function* () {
if (this.m_bSendingActiveGroups) return void (this.m_bSendActiveGroupsQueued = !0);
let e = 0.5;
const t = () =>
(0, i.mG)(this, void 0, void 0, function* () {
try {
return yield this.InternalSendActiveChatRoomGroupsToServer();
} catch (e) {
return !1;
}
});
for (; !(yield t()); ) yield new Promise((t) => setTimeout(t, 1e3 * e)), (e *= 2);
});
}
InternalSendActiveChatRoomGroupsToServer() {
return (0, i.mG)(this, void 0, void 0, function* () {
return new Promise((e) => {
let t = [],
n = g.gA.Init(v.$r);
this.m_mapActiveChatGroupsToRefCount.forEach((e, i) => {
if (((0, R.X)(e > 0, "SendActiveChatRoomGroupsToServer found invalid ref count for chat group."), e <= 0)) return;
n.Body().add_chat_group_ids(i);
let o = this.m_mapChatGroups.get(i);
(o && o.readyToRender) || n.Body().add_chat_groups_data_requested(i), a.Ul.SettingsStore.BClientHasFeatureOrOnWeb("ServerVirtualizedMemberLists") && n.Body().set_virtualize_members_threshold(100), o && o.BIsClanChatRoom() && t.push(o.GetClanID());
});
const i = (n) => {
o.De.IN_CLIENT && SteamClient.WebChat.SetActiveClanChatIDs(t), n && void 0 !== r && ClearBackgroundTimeout(r), (this.m_bSendingActiveGroups = !1), this.m_bSendActiveGroupsQueued ? e(!1) : e(n);
},
r = SetBackgroundTimeout(() => {
(this.m_bSendActiveGroupsQueued = !0), i(!1);
}, 1e4);
(this.m_bSendActiveGroupsQueued = !1),
(this.m_bSendingActiveGroups = !0),
v.Xn.SetSessionActiveChatRoomGroups(this.m_CMInterface.GetServiceTransport(), n)
.then(
(e) => {
let n = !1;
return (
(0, s.z)(() => {
if (1 == e.GetEResult()) {
for (let i of e.Body().chat_states()) {
let e = this.m_mapChatGroups.get(i.header_state().chat_group_id());
if (e)
try {
e.UpdateGroupState(i), e.BIsClanChatRoom() && -1 === t.indexOf(e.GetClanID()) && t.push(e.GetClanID());
} catch (t) {
(n = !0), console.error(`exception processing group update for group ${e.GetGroupID()}`, t);
}
}
for (let t of e.Body().virtualize_members_chat_group_ids()) {
let e = this.m_mapChatGroups.get(t);
e && e.SetMemberListVirtualized(!0);
}
} else n = !0;
}),
!n
);
},
() => !1,
)
.then(i);
});
});
}
CreateChatRoomGroup(e, t, n, i = {}) {
const { unBroadcastAccountId: o } = i;
let r = g.gA.Init(v.Hf);
r.Body().set_name(t);
for (let e of n) r.Body().add_steamid_invitees(e);
return (
o && r.Body().set_watching_broadcast_accountid(o),
v.Xn.CreateChatRoomGroup(this.m_CMInterface.GetServiceTransport(), r).then((t) => {
let n = t.GetEResult();
if (1 != n) throw n;
return this.AddCreatedChatRoomGroup(e, t.Body().chat_group_id(), t.Body().state(), t.Body().user_chat_state()), t.Body().chat_group_id();
})
);
}
LeaveChatRoomGroup(e, t) {
let n = g.gA.Init(v.ju);
return (
n.Body().set_chat_group_id(t),
v.Xn.LeaveChatRoomGroup(this.m_CMInterface.GetServiceTransport(), n).then((e) => {
let n = e.GetEResult();
if (1 != n) throw n;
this.RemoveChatRoomGroup(t);
})
);
}
FindNamelessChatGroupWithFriends(e) {
if (0 == e.length) return null;
let t = e.map((e) => new C.K(e).GetAccountID()),
n = Array.from(this.m_mapChatGroups.values());
for (let e of n) if (!e.IsNamedGroupChat() && e.BRoomContainsJustTheseFriendsAndSelf(t)) return e;
return null;
}
FillInChatUsabilityMetrics(e) {
e.metrics().set_group_chat_count(w.W(Array.from(this.m_mapChatGroups.values()), (e) => e.BIsCurrentUserAMember())), this.m_ChatRoomGroupDisplayPrefs.FillInChatUsabilityMetrics(e);
}
GetChatsWithUnreadPriorityMessages() {
let e = [],
t = this.FriendChatStore.GetFriendsWithUnreadMessages(null);
for (let n of t) n.has_unread_priority_messages && e.push(n);
let n = this;
return (
this.m_mapActiveChatGroupsToRefCount.forEach(function (t, i) {
n.m_mapChatGroups.get(i).GetChatRoomsWithUnreadPriorityMessages(e);
}),
e
);
}
GetChatToActivateForOldestUnread(e) {
let t = null,
n = (n) => !(!n.has_unread_priority_messages && 0 == n.GetVisibilityState(e)) && (!t || (!(t.has_unread_priority_messages && !n.has_unread_priority_messages) && (!(t.has_unread_priority_messages || !n.has_unread_priority_messages) || t.m_msTimeActivated < n.m_msTimeActivated || (!(t.m_msTimeActivated > n.m_msTimeActivated) && t.time_last_message < n.time_last_message))));
this.m_mapActiveChatGroupsToRefCount.forEach((e, i) => {
const o = this.m_mapChatGroups.get(i).chatRoomList;
for (let e of o) n(e) && (t = e);
});
const i = this.m_FriendChatStore.GetAllChats();
for (let e of i) n(e) && (t = e);
return t;
}
RegisterVirtualizedMemberListView(e) {
this.m_mapVirtualizedMemberListViews.set(e.GetViewID(), e);
}
UnregisterVirtualizedMemberListView(e) {
e && (this.m_mapVirtualizedMemberListViews.delete(e.GetViewID()), e.UnregisterFromServer());
}
}
(0, i.gn)([s.LO], F.prototype, "m_bReceivedChatGroupList", void 0), (0, i.gn)([a.IN], F.prototype, "JoinAndShowChatRoomGroup", null), (0, i.gn)([s.aD], F.prototype, "AddCreatedChatRoomGroup", null), (0, i.gn)([s.aD], F.prototype, "AddKnownChatRoomGroup", null), (0, i.gn)([s.aD], F.prototype, "AddJoinedChatRoomGroup", null), (0, i.gn)([s.aD], F.prototype, "RemoveChatRoomGroup", null), (0, i.gn)([s.Fl], F.prototype, "currentChatRoomGroups", null), (0, i.gn)([s.Fl], F.prototype, "ClanChatRooms", null);
},
46962: (e, t, n) => {
"use strict";
n.d(t, { Ok: () => v, P9: () => _, R$: () => b, VO: () => h, dz: () => C, iA: () => f, im: () => p, n: () => I, oT: () => u, p: () => g, tw: () => S });
var i = n(85556),
o = n(79588),
r = n(78654),
a = n(72746),
s = n(10553),
l = n(11612);
const c = { "/me": { strDescriptionToken: "#SlashCommandDescription_Me", bAvailableInChina: !0 }, "/code": { strDescriptionToken: "#SlashCommandDescription_Code", bAvailableInChina: !0 }, "/pre": { strDescriptionToken: "#SlashCommandDescription_Pre", bAvailableInChina: !0 }, "/giphy": { strDescriptionToken: "#SlashCommandDescription_Giphy", bAvailableInChina: !1 }, "/spoiler": { strDescriptionToken: "#SlashCommandDescription_Spoiler", bAvailableInChina: !0 }, "/quote": { strDescriptionToken: "#SlashCommandDescription_Quote", bAvailableInChina: !0 }, "/random": { strDescriptionToken: "#SlashCommandDescription_Random", unExpectedArguments: [1, 2], bAvailableInChina: !0 }, "/flip": { strDescriptionToken: "#SlashCommandDescription_Flip", unExpectedArguments: 0, bAvailableInChina: !0 }, "/store": { strDescriptionToken: "#SlashCommandDescription_Store", bAvailableInChina: !1 } };
let m = null;
function d() {
if (null == m) {
m = {};
for (let e in c) {
let t = c[e];
(s.De.EREALM != l.IN.k_ESteamRealmChina || t.bAvailableInChina) && (m[e] = t);
}
}
return m;
}
function h() {
return Object.keys(d());
}
function u(e) {
return d()[e];
}
var p, _, g;
!(function (e) {
(e[(e.None = 0)] = "None"), (e[(e.Deleting = 1)] = "Deleting"), (e[(e.Deleted = 2)] = "Deleted");
})(p || (p = {})),
(function (e) {
(e[(e.None = 0)] = "None"), (e[(e.Animating = 1)] = "Animating");
})(_ || (_ = {})),
(function (e) {
(e[(e.None = 0)] = "None"), (e[(e.Generic = 1)] = "Generic"), (e[(e.NotFriends = 2)] = "NotFriends"), (e[(e.NoChatPermissionInGroup = 3)] = "NoChatPermissionInGroup"), (e[(e.RateLimitExceeded = 4)] = "RateLimitExceeded");
})(g || (g = {}));
class C {
constructor(e, t, n, i, r = [], a, s, l) {
(this.rtTimestamp = void 0),
(this.unOrdinal = 0),
(this.eDeleteState = p.None),
(this.eAnimationState = _.None),
(this.strServerMsgAppCustomLocalized = void 0),
(this.m_rgReactions = void 0),
(0, o.rC)(this),
(this.unAccountID = e),
(this.rtTimestamp = t),
(this.unOrdinal = n || 0),
(this.m_rgReactions = r),
i && i.length > 13e3 ? (this.strMessageInternal = i.substr(0, 13e3)) : (this.strMessageInternal = i),
(this.m_strSlashCommand = (function (e) {
if (!e) return null;
const [t, ...n] = e.split(/\s/);
let i = d();
if (i[t]) {
const e = i[t].unExpectedArguments;
if (void 0 === e || ("number" == typeof e ? e === n.length : e.indexOf(n.length) > -1)) return t;
}
return null;
})(i)),
(this.strMessageInternal = this.HandleSpecialMessage(this.strMessageInternal)),
void 0 !== a && ((this.eServerMsgType = a), (this.strServerMsgParam = s), (this.unServerMsgParamAccountID = l));
}
get strMessage() {
return this.strMessageInternal;
}
UniqueKey() {
return this.unOrdinal ? this.rtTimestamp + "_" + this.unOrdinal : this.rtTimestamp;
}
set Mentions(e) {
this.m_mentions = e;
}
get Mentions() {
return this.m_mentions || {};
}
BIsLocalEcho() {
return !1;
}
BHasServerAcknowledged() {
return !0;
}
get eErrorSending() {
return g.None;
}
BIsServerMessage() {
return null != this.eServerMsgType && 0 != this.eServerMsgType;
}
BIsInvite() {
return 5 == this.eServerMsgType;
}
GetSlashCommand() {
return this.m_strSlashCommand;
}
BIsOlderThan(e) {
return this.rtTimestamp < e.rtTimestamp || (this.rtTimestamp == e.rtTimestamp && this.unOrdinal < e.unOrdinal);
}
BIsNewerThan(e) {
return this.rtTimestamp > e.rtTimestamp || (this.rtTimestamp == e.rtTimestamp && this.unOrdinal > e.unOrdinal);
}
HasUserContent() {
return !this.m_bNoUserContent;
}
HandleSpecialMessage(e) {
return "+1" == e ? ((this.m_bNoUserContent = !0), "[plusone][/plusone]") : e;
}
OnAnimationEnd() {
this.eAnimationState = _.None;
}
UpdateReaction(e, t, n, i) {
const o = this.m_rgReactions.findIndex((e) => e.strReaction === t);
if (-1 === o) {
if (n > 0) {
const o = { eReactionType: e, strReaction: t, cReactors: n, bUserReacted: i };
return this.m_rgReactions.push(o), o;
}
return console.error("Did not find reaction we wanted to remove"), null;
}
return 0 === n ? (this.m_rgReactions.splice(o, 1), null) : ((this.m_rgReactions[o].cReactors = n), (this.m_rgReactions[o].bUserReacted = i), this.m_rgReactions[o]);
}
get reactions() {
return this.m_rgReactions;
}
}
(0, i.gn)([o.LO], C.prototype, "rtTimestamp", void 0), (0, i.gn)([o.LO], C.prototype, "unOrdinal", void 0), (0, i.gn)([o.LO], C.prototype, "eDeleteState", void 0), (0, i.gn)([o.LO], C.prototype, "eAnimationState", void 0), (0, i.gn)([o.LO], C.prototype, "strServerMsgAppCustomLocalized", void 0), (0, i.gn)([o.LO], C.prototype, "m_rgReactions", void 0);
class f extends C {
constructor(e, t, n) {
super(e, t, -1, n), (this.eErrorSendingObservable = g.None), (this.strMessageObservable = void 0), (this.m_bServerAcknowledged = !1), (0, o.rC)(this), (this.strMessageObservable = this.HandleSpecialMessage(n)), (this.m_iLocalEchoID = f.sm_iLocalEchoID++);
}
get strMessage() {
return this.strMessageObservable;
}
set strMessage(e) {
this.strMessageObservable = this.HandleSpecialMessage(e);
}
get eErrorSending() {
return this.eErrorSendingObservable;
}
SetErrorSending(e) {
this.eErrorSendingObservable = e;
}
BIsLocalEcho() {
return !0;
}
UniqueKey() {
return this.m_bServerAcknowledged ? super.UniqueKey() : "localecho_" + this.m_iLocalEchoID;
}
BHasServerAcknowledged() {
return this.m_bServerAcknowledged;
}
OnServerAcknowledged() {
this.m_bServerAcknowledged = !0;
}
}
(f.sm_iLocalEchoID = 0), (0, i.gn)([o.LO], f.prototype, "eErrorSendingObservable", void 0), (0, i.gn)([o.LO], f.prototype, "strMessageObservable", void 0), (0, i.gn)([o.LO], f.prototype, "m_bServerAcknowledged", void 0), (0, i.gn)([o.aD], f.prototype, "OnServerAcknowledged", null);
class v extends C {
constructor(e, t, n) {
super(e, t, ++v.m_nOrdinal, n);
}
}
v.m_nOrdinal = 0;
class S extends C {
constructor(e, t, n) {
super(e, t, ++S.m_nOrdinal, n);
}
}
function b(e) {
switch (e) {
case 1:
case 5:
case 2:
case 3:
case 4:
case 9:
case 10:
case 11:
return !0;
}
return !1;
}
S.m_nOrdinal = 0;
class I {
constructor() {
(this.m_rgMessageBlocks = o.LO.array([], { deep: !1 })), (this.m_iIndexLastTimePassesGap = void 0), (0, o.rC)(this), this.Clear();
}
get message_blocks() {
return this.m_rgMessageBlocks;
}
get time_passes_index() {
return this.m_iIndexLastTimePassesGap;
}
Clear() {
this.m_rgMessageBlocks.clear(), this.m_rgMessageBlocks.push(new y()), (this.m_iIndexLastTimePassesGap = void 0);
}
AppendMessage(e) {
let t = this.m_rgMessageBlocks[this.m_rgMessageBlocks.length - 1];
if (!t.BCanAccumulateMessage(e)) {
let n = t;
(t = new y()), this.m_rgMessageBlocks.push(t), n.SetNextBlock(t), e.rtTimestamp - n.GetRTimeLastMessage() >= 3600 && (n.GetRTimeMidnightBeforeBlock() == a.Ul.GetLocalMidnightInRTime32(e.rtTimestamp) ? (this.m_iIndexLastTimePassesGap = this.m_rgMessageBlocks.length - 1) : (this.m_iIndexLastTimePassesGap = void 0));
}
t.AppendMessage(e);
}
BuildMessageBlocks(e) {
this.Clear();
for (let t of e) this.AppendMessage(t);
}
AppendNewMessage(e) {
this.AppendMessage(e);
}
RemoveLocalMessage(e) {
for (const t of this.m_rgMessageBlocks) if (t.RemoveLocalMessage(e)) return !0;
return !1;
}
RemoveOldestMessages(e) {
let t = 0;
for (; e > 0 && !(t >= this.m_rgMessageBlocks.length); ) {
let n = this.m_rgMessageBlocks[t].messages;
if (n.length > e) break;
(e -= n.length), t++;
}
if (0 == t) return null;
let n = null;
for (let e = t - 1; e >= 0; e--) {
let t = this.m_rgMessageBlocks[e].messages;
if (0 != t.length) {
n = t[t.length - 1];
break;
}
}
return this.m_rgMessageBlocks.splice(0, t), n;
}
}
(0, i.gn)([o.LO], I.prototype, "m_iIndexLastTimePassesGap", void 0), (0, i.gn)([o.aD], I.prototype, "BuildMessageBlocks", null), (0, i.gn)([o.aD], I.prototype, "AppendNewMessage", null), (0, i.gn)([o.aD], I.prototype, "RemoveLocalMessage", null), (0, i.gn)([o.aD], I.prototype, "RemoveOldestMessages", null);
class y {
constructor() {
(this.m_rgMessages = []), (this.m_nextBlock = void 0), (this.m_bMessageBlockIsOnlyEmotes = !0), (0, o.rC)(this);
}
CreateVirtualSplitOnTimestamp(e) {
let t = new y(),
n = new y();
t.SetNextBlock(n), n.SetNextBlock(this.m_nextBlock);
for (let i of this.m_rgMessages) i.rtTimestamp < e ? t.AppendMessage(i) : n.AppendMessage(i);
return [t, n];
}
UniqueKey() {
return this.m_rgMessages.length ? this.m_rgMessages[0].UniqueKey() : "EmptyBlock";
}
get messages() {
return this.m_rgMessages;
}
SetNextBlock(e) {
this.m_nextBlock = e;
}
get is_last_block() {
return void 0 === this.m_nextBlock;
}
GetRTimeMidnightBeforeBlock() {
return this.m_rtMidnightBeforeBlock;
}
GetRTimeMidnightBeforeNextBlock() {
return this.m_nextBlock ? this.m_nextBlock.GetRTimeMidnightBeforeBlock() : a.Ul.GetLocalMidnightInRTime32();
}
GetRTimeLastMessage() {
return this.m_rgMessages.length ? this.m_rgMessages[this.m_rgMessages.length - 1].rtTimestamp : r.g1;
}
GetRTimeFirstMessage() {
return this.m_rgMessages.length ? this.m_rgMessages[0].rtTimestamp : 0;
}
AppendMessage(e) {
"/me" === e.GetSlashCommand() || (this.m_bMessageBlockIsOnlyEmotes = !1), this.m_rgMessages.length || (this.m_rtMidnightBeforeBlock = a.Ul.GetLocalMidnightInRTime32(e.rtTimestamp)), this.m_rgMessages.push(e);
}
BCanAccumulateMessage(e) {
if (!this.m_rgMessages.length) return !0;
let t = this.m_rgMessages[0].unAccountID,
n = this.m_rgMessages[this.m_rgMessages.length - 1].rtTimestamp,
i = this.m_rgMessages[this.m_rgMessages.length - 1];
return e.BIsServerMessage() == this.m_rgMessages[0].BIsServerMessage() && (!(!e.BIsServerMessage() || e.BIsInvite() || this.m_rgMessages[0].BIsInvite()) || (!(!t || t != e.unAccountID) && e.BIsInvite() == this.m_rgMessages[0].BIsInvite() && !(e.rtTimestamp - n > 300) && (!this.m_bMessageBlockIsOnlyEmotes || "/me" === e.GetSlashCommand()) && !(e instanceof v || i instanceof v) && !(a.Ul.GetLocalMidnightInRTime32(e.rtTimestamp) > this.m_rtMidnightBeforeBlock) && !(e instanceof S || i instanceof S)));
}
BIsInvite() {
return this.m_rgMessages.length > 0 && this.m_rgMessages[0].BIsInvite();
}
BIsServerMsg() {
return this.m_rgMessages.length > 0 && this.m_rgMessages[0].BIsServerMessage() && !this.m_rgMessages[0].BIsInvite();
}
BIsLocalMsg() {
return this.m_rgMessages.length > 0 && this.m_rgMessages[0] instanceof S;
}
RemoveLocalMessage(e) {
const t = this.m_rgMessages.findIndex((t) => t.BIsLocalEcho() && t.UniqueKey() === e.UniqueKey());
return -1 !== t && (this.m_rgMessages.splice(t, 1), !0);
}
}
(0, i.gn)([o.LO.shallow], y.prototype, "m_rgMessages", void 0), (0, i.gn)([o.LO.shallow], y.prototype, "m_nextBlock", void 0), (0, i.gn)([o.aD], y.prototype, "CreateVirtualSplitOnTimestamp", null);
},
71576: (e, t, n) => {
"use strict";
n.d(t, { Q: () => i });
class i {
OnTabActivate() {
(this.m_msLastActive = performance.now()), this.InternalOnTabActivate();
}
GetTimeLastActivate() {
return this.m_msLastActive || 0;
}
IsChatRoom() {
return !1;
}
IsFriendChat() {
return !1;
}
IsBroadcast() {
return !1;
}
}
},
71240: (e, t, n) => {
"use strict";
n.d(t, { R5: () => _, ub: () => p });
var i = n(85556),
o = n(92883),
r = n(79588),
a = n(9824),
s = n(22394),
l = n(10553),
c = n(84446),
m = n(35341),
d = n(19339),
h = n(72746),
u = n(71576);
class p extends u.Q {
constructor(e, t) {
super(), (this.m_rgOnChatFrameChangedCallbacks = []), (this.m_rgOnChatRequestScrollBottomCallbacks = []), (this.m_bScrolledToBottom = !0), (this.m_scrollTop = -1), (this.m_scrollHeight = -1), (this.m_clientHeight = 1), (this.m_textEntryFocusCallbacks = new s.pB()), (this.m_clipToUpload = void 0), (0, r.rC)(this), (this.m_tabset = e), (this.m_chat = t), this.m_tabset && this.m_chat.AddChatView(this), (this.m_strTextEntry = ""), (this.m_fileUploadManager = new m.Gg(t));
}
GetTabName() {
return this.m_chat.name;
}
GetUniqueID() {
return this.m_chat.unique_id;
}
OnTabFocus() {
this.OnFocus();
}
InternalOnTabActivate() {
this.OnActivate();
}
OnTabDeactivate() {
this.OnDeactivate();
}
OnTabClosed() {
this.OnViewClosed();
}
IsChatRoom() {
return this.m_chat instanceof c.K;
}
IsFriendChat() {
return this.m_chat instanceof d.a;
}
IsVoiceActive() {
return this.m_chat.BVoiceActive();
}
GetUnreadMessageCount() {
return this.m_chat.unread_message_count;
}
IsTabForChat(e) {
return this.m_chat == e;
}
GetChatView() {
return this;
}
OnViewClosed() {
this.m_chat.RemoveChatView(this);
}
get chat() {
return this.m_chat;
}
BIsInBrowserContext(e) {
let t = this.m_tabset.GetBrowserContext();
return e.m_nBrowserID == t.m_nBrowserID && e.m_unPID == t.m_unPID;
}
GetVisibilityState() {
if (!this.m_tabset || (!this.m_tabset.is_popup_active && !l.De.IN_MOBILE)) return 0;
let e;
return this.m_tabset.activeTab && (e = this.m_tabset.activeTab.GetChatView()), e != this || (!this.m_tabset.is_popup_visible && !l.De.IN_MOBILE) ? 1 : this.m_tabset.is_popup_focused || l.De.IN_MOBILE ? (this.m_bScrolledToBottom && !h.Ul.IdleTracker.BIsUserIdle(60) ? 4 : 3) : 2;
}
get lastScrollHeight() {
return this.m_scrollHeight;
}
set lastScrollHeight(e) {
this.m_scrollHeight = e;
}
get lastScrollTop() {
return this.m_scrollTop;
}
set lastScrollTop(e) {
this.m_scrollTop = e;
}
get lastClientHeight() {
return this.m_clientHeight;
}
set lastClientHeight(e) {
this.m_clientHeight = e;
}
get is_scrolled_to_bottom() {
return this.m_bScrolledToBottom;
}
set is_scrolled_to_bottom(e) {
!this.m_bScrolledToBottom && e && this.m_chat.OnActivate(), (this.m_bScrolledToBottom = e);
}
get text_entry() {
return this.m_strTextEntry;
}
set text_entry(e) {
this.m_strTextEntry = e;
}
get file_upload_manager() {
return this.m_fileUploadManager;
}
get clip_to_upload() {
return this.m_clipToUpload;
}
CheckActivationAndNotifyChat() {
this.m_bScrolledToBottom && this.m_chat.OnActivate();
}
OnActivate() {
this.CheckActivationAndNotifyChat(), this.FocusTextInput(), (this.m_chat.m_msTimeActivated = Date.now());
}
OnDeactivate() {
this.m_chat.OnDeactivate();
}
OnFocus() {
this.CheckActivationAndNotifyChat();
}
FocusTextInput() {
this.m_textEntryFocusCallbacks.Dispatch();
}
AddOnChatFrameChangedCallback(e) {
this.m_rgOnChatFrameChangedCallbacks.push(e);
}
RemoveOnChatFrameChangedCallback(e) {
a.Zf(this.m_rgOnChatFrameChangedCallbacks, e);
}
AddOnChatRequestScrollBottomCallback(e) {
this.m_rgOnChatRequestScrollBottomCallbacks.push(e);
}
RemoveOnChatRequestScrollBottomCallback(e) {
a.Zf(this.m_rgOnChatRequestScrollBottomCallbacks, e);
}
OnChatFrameChanged() {
for (let e of this.m_rgOnChatFrameChangedCallbacks) e();
}
OnScrollBottomRequest() {
for (let e of this.m_rgOnChatRequestScrollBottomCallbacks) e();
}
SetFileToUpload(e, t) {
this.m_fileUploadManager.SetImageFileToUpload(e, t);
}
UploadFile(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
yield this.m_fileUploadManager.BeginFileUpload({ bSpoiler: e }), this.m_fileUploadManager.Reset();
});
}
SetClipToUpload(e) {
this.m_clipToUpload = e;
}
RegisterForTextEntryFocus(e) {
return this.m_textEntryFocusCallbacks.Register(e);
}
BVoiceActive() {
return this.m_chat.BVoiceActive();
}
ConvertMessageToBBCode(e) {
return (0, o.Ao)(e);
}
SendChatMessage(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
return this.m_chat.SendChatMessage(this.ConvertMessageToBBCode(e));
});
}
}
(0, i.gn)([r.LO], p.prototype, "m_bScrolledToBottom", void 0), (0, i.gn)([r.LO], p.prototype, "m_clipToUpload", void 0);
class _ extends p {
constructor(e, t, n) {
super(e, t), (this.m_parentGroupView = n);
}
SearchMembers(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
return this.m_parentGroupView.SearchMembers(e, t);
});
}
SearchMembersForMention(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
const n = yield this.SearchMembers(e, t);
return this.m_parentGroupView.GetGroup().AddMetaMentionsToResults(e, n), n;
});
}
BIsMemberNameAmbiguous(e) {
return this.m_parentGroupView.BIsMemberNameAmbiguous(e);
}
ConvertMessageToBBCode(e) {
let t = (0, o.Ao)(e);
return this.m_parentGroupView.ProcessMentions(t);
}
get virtualizer() {
return this.m_parentGroupView.GetGroup().BIsMemberListVirtualized() ? this.m_parentGroupView.GetVirtualizedMemberListView() : null;
}
GetParentGroupView() {
return this.m_parentGroupView;
}
}
},
13114: (e, t, n) => {
"use strict";
n.d(t, { JL: () => h, gh: () => l });
var i = n(85556),
o = n(88991),
r = n(72746),
a = n(19953),
s = n(79588);
function l(e, t, n, i, r) {
let s,
l = o.K.InitFromAccountID(e);
return r ? (s = "steam://joinlobby/" + t + "/" + r + "/" + l.ConvertTo64BitString()) : i ? (s = a.De.IN_MOBILE ? "https://s.team/remoteplay/connect/" + l.ConvertTo64BitString() + "?appid=" + t + "&" + i : "steam://remoteplay/connect/" + l.ConvertTo64BitString() + "?appid=" + t + "&" + i) : ((s = "steam://rungame/" + t + "/" + l.ConvertTo64BitString()), void 0 !== n && (s += "/" + encodeURIComponent(n))), s;
}
class c {
constructor(e, t, n, i, o, r, a) {
(this.bDismissed = void 0), (this.bAccepted = void 0), (0, s.rC)(this), (this.unAccountIDInviter = e), (this.rtTimestamp = t), (this.appID = n), (this.connectString = i), (this.remoteplayString = o), (this.lobbyID = a), (this.bDismissed = r), (this.bAccepted = !1);
}
get inviteString() {
return l(this.unAccountIDInviter, this.appID, null == this ? void 0 : this.connectString, null == this ? void 0 : this.remoteplayString, null == this ? void 0 : this.lobbyID);
}
AcceptGameInvite() {
r.Ul.OpenURLInBrowser(this.inviteString, r.D), (this.bAccepted = !0), r.Ul.ChatStore.GameInviteStore.RecordDismissTime(this), this.remoteplayString ? SteamClient.Messaging.PostMessage("FriendsUI", "AcceptedRemotePlayInvite", JSON.stringify({ id: this.appID })) : SteamClient.Messaging.PostMessage("FriendsUI", "AcceptedGameInvite", JSON.stringify({ id: this.appID }));
}
DismissInvite() {
(this.bDismissed = !0), r.Ul.ChatStore.GameInviteStore.RecordDismissTime(this);
}
get bOld() {
return r.Ul.GetServerRTime32() - this.rtTimestamp > 21600;
}
}
(0, i.gn)([s.LO], c.prototype, "bDismissed", void 0), (0, i.gn)([s.LO], c.prototype, "bAccepted", void 0), (0, i.gn)([s.aD], c.prototype, "AcceptGameInvite", null), (0, i.gn)([s.aD], c.prototype, "DismissInvite", null);
const m = { dismisstimes: {} },
d = "GameInvites";
class h {
constructor() {
(this.m_mapGameInvites = new Map()), (this.m_mapDismissedInvites = s.LO.map()), (this.m_mapInviteByCode = new Map());
}
Init() {
r.Ul.SettingsStore.GetObjectFromLocalStorageWhenReady(d, m).then((e) => {
let t = new Date();
t.setDate(t.getDate() - 14), this.m_mapDismissedInvites.clear();
for (let n in e.dismisstimes) {
let i = parseInt(n),
o = e.dismisstimes[n];
new Date(1e3 * o) < t || this.m_mapDismissedInvites.set(i, o);
}
});
}
RegisterGameInvite(e, t, n, i, o, r) {
let a = this.m_mapGameInvites.get(e);
a || ((a = new Map()), this.m_mapGameInvites.set(e, a));
let s = a.get(t);
if (!s) {
let l = !1,
m = this.m_mapDismissedInvites.get(e);
m && (l = t <= m),
(s = new c(e, t, n, i, o, l, r)),
a.set(t, s),
a.forEach((e) => {
e.rtTimestamp < t && e.DismissInvite();
});
}
return s;
}
RecordDismissTime(e) {
let t = this.m_mapDismissedInvites.get(e.unAccountIDInviter);
(t && t > e.rtTimestamp) || (this.m_mapDismissedInvites.set(e.unAccountIDInviter, e.rtTimestamp), this.WriteToLocalStorage());
}
WriteToLocalStorage() {
r.Ul.SettingsStore.StoreObjectInLocalStorage(d, { dismisstimes: this.m_mapDismissedInvites });
}
}
},
25629: (e, t, n) => {
"use strict";
n.d(t, { kQ: () => u, qH: () => p });
var i = n(85556),
o = n(79588),
r = n(4638),
a = n(1736),
s = n(88991),
l = n(78654),
c = n(72746),
m = n(51075),
d = n(84290);
class h extends m.x {
constructor(e) {
super(e), (0, o.rC)(this);
}
BIsExpired() {
return c.Ul.GetServerRTime32() >= this.m_rtTimeExpires;
}
InitFromInviteLinkInfo(e) {
(this.m_ulChatRoomGroupID = e.group_summary().chat_group_id()), (this.m_ulChatID = e.chat_id());
let t = new s.K(e.steamid_sender());
t.BIsIndividualAccount() && (this.m_unAccountIDInviter = t.GetAccountID()), (this.m_rtTimeExpires = e.time_expires()), (this.m_bIsBanned = e.banned()), (this.m_rtKickExpires = e.time_kick_expire()), (this.m_bValid = !0), (this.m_bReady = !0);
}
InitInvalid() {
(this.m_bValid = !1), (this.m_bReady = !0);
}
InitDirectInvite(e, t, n = !1, i = void 0) {
(this.m_ulChatRoomGroupID = e), (this.m_ulChatID = t), (this.m_bIsBanned = n), (this.m_rtKickExpires = i), (this.m_rtTimeExpires = l.g1), (this.m_bValid = !0), (this.m_bReady = !0);
}
}
(0, i.gn)([o.aD], h.prototype, "InitFromInviteLinkInfo", null);
class u {
constructor(e) {
(this.m_mapInviteByCode = new Map()), (this.m_ChatStore = e);
}
JoinChatGroup(e, t, n) {
let i = new h();
return i.InitDirectInvite(e, t), this.AcceptInvite(i, n);
}
AcceptInvite(e, t) {
null == t && (t = c.Ul.GetDefaultBrowserContext());
let n = a.gA.Init(r.Gz);
return (
n.Body().set_chat_group_id(e.GetChatRoomGroupID()),
e.BIsInviteLink() && n.Body().set_invite_code(e.GetInviteCode()),
e.GetChatID() && n.Body().set_chat_id(e.GetChatID()),
r.Xn.JoinChatRoomGroup(this.m_ChatStore.CMInterface.GetServiceTransport(), n).then((e) => {
let n = { result: e.GetEResult() };
if (1 == n.result) {
let n = this.m_ChatStore.AddJoinedChatRoomGroup(e.Body().state(), e.Body().user_chat_state());
c.Ul.UIStore.ShowAndOrActivateChatRoomGroup(t, n, !0);
let i = e.Body().join_chat_id();
if (n) {
let e = n.GetChatRoom(i);
e && e.StartVoiceChat();
}
} else 15 == n.result && (n.time = e.Body().time_expire());
return n;
})
);
}
GetInviteFromCode(e) {
let t = this.m_mapInviteByCode.get(e);
if ((t || ((t = new h(e)), this.m_mapInviteByCode.set(e, t)), !t.BIsReady() || !this.m_ChatStore.GetChatRoomGroup(t.GetChatRoomGroupID()))) {
let n = a.gA.Init(r.Jh);
n.Body().set_invite_code(e),
r.Xn.GetInviteLinkInfo(this.m_ChatStore.CMInterface.GetServiceTransport(), n).then((e) => {
1 == e.GetEResult() ? (this.m_ChatStore.AddKnownChatRoomGroup(e.Body().group_summary(), e.Body().user_chat_group_state()), t.InitFromInviteLinkInfo(e.Body())) : t.InitInvalid();
});
}
return t;
}
GetDirectInviteInfo(e, t, n) {
let i = new h(),
o = this.m_ChatStore.GetChatRoomGroup(e);
if (o && o.GetChatRoom(t)) i.InitDirectInvite(e, t);
else {
let o = a.gA.Init(r.I9);
o.Body().set_steamid_invitee(s.K.InitFromAccountID(n).ConvertTo64BitString()),
o.Body().set_chat_group_id(e),
o.Body().set_chat_id(t),
r.Xn.GetInviteInfo(this.m_ChatStore.CMInterface.GetServiceTransport(), o).then((n) => {
if (1 != n.GetEResult() || !n.Body().group_summary().chat_group_id()) return console.log(`GetDirectInviteInfo: respose EResult ${n.GetEResult()}`), void i.InitInvalid();
this.m_ChatStore.AddKnownChatRoomGroup(n.Body().group_summary(), null), i.InitDirectInvite(e, t, n.Body().banned(), n.Body().time_kick_expire());
});
}
return i;
}
}
function p(e) {
if (15 == e.result) {
0 == e.time && console.log("no longer valid");
let t = c.Ul.RTime32ToDate(e.time).toLocaleString([], { weekday: "long", year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric" });
return (0, d.Xx)("#ChatRoom_InviteMessage_Failed_Kicked", t);
}
return 17 == e.result ? (0, d.Xx)("#ChatRoom_InviteMessage_Failed_Banned") : 42 == e.result ? (0, d.Xx)("#ChatRoom_InviteMessage_Not_Found") : null;
}
},
20891: (e, t, n) => {
"use strict";
n.d(t, { d: () => a, o: () => s });
var i = n(85556);
function o(e) {
return (
!(!e || "object" != typeof e || Array.isArray(e)) &&
Object.keys(e).every((t) =>
(function (e) {
return !(!e || "object" != typeof e || !Array.isArray(e)) && e.every(r);
})(e[t]),
)
);
}
function r(e) {
if (!e || "object" != typeof e || Array.isArray(e)) return !1;
const t = e;
return "number" == typeof t.timestamp && "string" == typeof t.message && (void 0 === t.eError || "number" == typeof t.eError);
}
const a = new (class {
constructor() {
this.m_bInitialized = !1;
}
Init(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
if (!this.m_bInitialized) {
(this.m_storage = e), (this.m_strStorageKey = `InflightMessageQueue_${t}`);
try {
const t = yield e.GetObject(this.m_strStorageKey);
t ? (o(t) ? (this.m_queues = t) : (console.warn(`Malformed ${this.m_strStorageKey} found in storage. Resetting.`), (this.m_queues = {}), this.WriteToStorage())) : (this.m_queues = {});
} catch (e) {
console.warn("Error while parsing stored message queues. Resetting.", e), (this.m_queues = {}), this.WriteToStorage();
}
this.m_bInitialized = !0;
}
});
}
Update(e, t) {
0 === t.length ? delete this.m_queues[e] : (this.m_queues[e] = t), this.WriteToStorage();
}
WriteToStorage() {
Object.keys(this.m_queues).length > 0 ? this.m_storage.StoreObject(this.m_strStorageKey, this.m_queues) : this.m_storage.RemoveObject(this.m_strStorageKey);
}
Get(e) {
return this.m_queues[e] || [];
}
})();
class s {
constructor(e) {
(this.m_id = e), this.InitFromStorage();
}
InitFromStorage() {
return (0, i.mG)(this, void 0, void 0, function* () {
this.m_queue = yield a.Get(this.m_id);
});
}
Add(e) {
const t = { message: e, timestamp: Date.now() };
return this.m_queue.push(t), this.UpdateStoredQueue(), this.GetItemID(t);
}
get queued_messages() {
return this.m_queue.map((e) => Object.assign(Object.assign({}, e), { id: this.GetItemID(e) }));
}
RemoveItem(e) {
const t = this.GetItemIndex(e);
-1 !== t ? (this.m_queue.splice(t, 1), this.UpdateStoredQueue()) : console.warn("Could not find item to remove from send queue");
}
UpdateStoredQueue() {
a.Update(this.m_id, this.m_queue);
}
GetItemID(e) {
return `${e.message.slice(0, 10)}_${e.timestamp}`;
}
GetItemIndex(e) {
return this.m_queue.findIndex((t) => this.GetItemID(t) === e);
}
SetItemFailed(e, t) {
const n = this.GetItemIndex(e);
-1 !== n ? ((this.m_queue[n].eError = t), this.UpdateStoredQueue()) : console.warn("Could not find item to update from send queue");
}
}
},
51075: (e, t, n) => {
"use strict";
n.d(t, { V: () => l, x: () => s });
var i = n(85556),
o = n(79588),
r = n(78654),
a = n(19953);
class s {
constructor(e) {
(this.m_bReady = !1), (this.m_bValid = !1), (0, o.rC)(this), (this.m_strInviteCode = e);
}
BIsReady() {
return this.m_bReady;
}
BIsValid() {
return this.m_bValid;
}
BIsInviteLink() {
return !!this.m_strInviteCode;
}
GetInviteCode() {
return this.m_strInviteCode;
}
BNeverExpires() {
return this.m_rtTimeExpires == r.g1;
}
GetChatRoomGroupID() {
return this.m_ulChatRoomGroupID;
}
BIsVoiceChatInvite() {
return !!this.m_ulChatID;
}
GetChatID() {
return this.m_ulChatID;
}
GetURL() {
return this.m_strInviteCode ? l(this.m_strInviteCode) : null;
}
BIsUserBanned() {
return this.m_bIsBanned;
}
GetTimeKickExpires() {
return this.m_rtKickExpires;
}
get time_expires() {
return this.m_rtTimeExpires;
}
InitInvalid() {
(this.m_bValid = !1), (this.m_bReady = !0);
}
InitDirectInvite(e, t, n = !1, i = void 0) {
(this.m_ulChatRoomGroupID = e), (this.m_ulChatID = t), (this.m_bIsBanned = n), (this.m_rtKickExpires = i), (this.m_rtTimeExpires = r.g1), (this.m_bValid = !0), (this.m_bReady = !0);
}
}
function l(e) {
return "public" == a.De.WEB_UNIVERSE ? `https://s.team/chat/${e}` : `${a.De.COMMUNITY_BASE_URL}chat/invite/${e}`;
}
(0, i.gn)([o.LO], s.prototype, "m_bReady", void 0), (0, i.gn)([o.aD], s.prototype, "InitInvalid", null), (0, i.gn)([o.aD], s.prototype, "InitDirectInvite", null);
},
84446: (e, t, n) => {
"use strict";
n.d(t, { K: () => I });
var i = n(85556),
o = n(19953),
r = n(1736),
a = n(4638),
s = n(92883),
l = n(79588),
c = n(84290),
m = n(77385),
d = n(46519),
h = (n(67915), n(10167)),
u = n(72746),
p = n(2049),
_ = n(46962),
g = n(51075),
C = n(97063),
f = n(93635),
v = n(20891),
S = n(57476),
b = n(22394);
class I extends d.j {
constructor(e, t, n, i) {
super(e.FriendStore, e, e.CMInterface), (this.LOG = new m.sO("ChatRoom", () => this.unique_id).Debug), (this.m_strName = void 0), (this.m_unSortOrder = 0), (this.m_lastChatLink = null), (this.m_rtLastMention = void 0), (this.m_groupVoiceActiveMembers = new h.a2((0, c.Xx)("#Chat_MemberGroup_VoiceChatting"))), (this.m_eDesktopNotificationLevel = 0), (this.m_eMobileNotificationLevel = 0), (this.m_bUnreadIndicatorMuted = !1), (this.m_mapMessageReactionReactors = l.LO.map()), (this.m_NewChatMsgAddedCallbacks = new b.pB()), (0, l.rC)(this), (this.m_group = t), (this.m_ulGroupID = t.GetGroupID()), (this.m_ulChatID = n), (this.m_bIsDefaultForGroup = i), this.m_groupVoiceActiveMembers.SetOnHeaderClick(this.StartVoiceChat), (this.m_MessageSendQueue = new v.o(`${this.m_ulGroupID}.${this.m_ulChatID}`)), this.m_MessageSendQueue.InitFromStorage().then(() => this.InitQueuedMessages());
}
get VoiceChatStore() {
return this.ChatStore.VoiceChat;
}
get unread_message_count() {
switch (this.GetPlatformNotificationLevel()) {
case 4:
return this.m_cUnreadChatMessages;
case 3:
case 2:
return this.has_unread_mention ? 1 : 0;
default:
return 0;
}
}
get time_last_activity() {
let e = this.GetPlatformNotificationLevel(),
t = 0,
n = this.m_rtFirstUnread || this.time_last_ack;
switch ((n && (t = Math.max(n, t)), e)) {
case 4:
t = Math.max(this.time_last_message || 0, t);
break;
case 3:
case 2:
t = Math.max(this.time_last_mention || 0, t);
break;
case 1:
case 0:
break;
default:
(0, f.X)(!1, `unhandled EChatRoomNotificationLevel: ${e}`);
}
return t;
}
get has_unread_messages() {
return this.BIsUnreadIndicatorMuted() ? this.unread_message_count > 0 : this.has_any_unread_messages;
}
get has_any_unread_messages() {
return this.m_cUnreadChatMessages > 0;
}
get has_unread_mention() {
return this.m_rtLastMention > this.m_rtLastAckedChatMsg;
}
get time_last_mention() {
return this.m_rtLastMention;
}
BHasAckedChatMsg() {
return this.m_rtLastAckedChatMsg && 0 != this.m_rtLastAckedChatMsg;
}
LoadChatLogs() {
return super.LoadChatLogs();
}
GetMessagesFromTimeRange(e, t, n, i, o) {
let s = r.gA.Init(a.Xf);
return (
s.Body().set_chat_group_id(this.m_ulGroupID),
s.Body().set_chat_id(this.m_ulChatID),
s.Body().set_max_count(o),
s.Body().set_start_time(e),
s.Body().set_start_ordinal(t),
s.Body().set_last_time(n),
s.Body().set_last_ordinal(i),
this.LOG(`trying to load ${o} messages in range ${e}:${t} - ${n}:${i}`),
a.Xn.GetMessageHistory(this.m_ChatStore.CMInterface.GetServiceTransport(), s).then((e) => {
let t = e.GetEResult();
if (1 != t) throw t;
return { messages: this.GetMessagesFromResponse(e), moreAvailable: e.Body().more_available() };
})
);
}
GetMessagesFromResponse(e) {
let t = e.Body().messages(),
n = [];
if (m.cH.Get().IsDebugLogEnabled("ChatRoom")) {
let e = t[0],
n = t[t.length - 1];
this.LOG(`received ${t.length} messages in range ${n.server_timestamp()}:${n.ordinal()} to ${e.server_timestamp()}:${e.ordinal()}`);
}
for (let e = t.length - 1; e >= 0; e--) {
let i,
o,
r = t[e],
a = r.server_message().message() || 0;
if (0 != a) {
if (((a = r.server_message().message()), (i = r.server_message().string_param()), (o = r.server_message().accountid_param()), !(0, _.R$)(a))) {
this.LOG(`unrenderable message ${a}`);
continue;
}
} else if (!r.message() || 0 == r.message().trim().length) continue;
let s = new _.dz(
r.sender(),
r.server_timestamp(),
r.ordinal() || 0,
r.message(),
r.reactions().map((e) => ({ eReactionType: e.reaction_type(), strReaction: e.reaction(), cReactors: e.num_reactors(), bUserReacted: e.has_user_reacted() })),
a,
i,
o,
);
r.deleted() && (s.eDeleteState = _.im.Deleted), n.push(s);
}
return n;
}
GetBBCodeParser() {
return this.m_ChatStore.ChatRoomBBCodeParser;
}
OnNewChatMsgAdded(e, t, n, i) {
o.De.IN_CLIENT && (0, S.U5)("WebChat.OnNewGroupChatMsgAdded") && u.Ul.SettingsStore.BClientHasFeatureOrOnWeb("SteamworksChatAPI") && SteamClient.WebChat.OnNewGroupChatMsgAdded(this.m_ulGroupID, this.m_ulChatID, e, t, n, i), this.m_NewChatMsgAddedCallbacks.Dispatch(this.m_ulGroupID, this.m_ulChatID, e, t, n, i);
}
RegisterOnNewChatMsgAdded(e) {
return this.m_NewChatMsgAddedCallbacks.Register(e);
}
AckChatMsgOnServer(e) {
let t = r.gA.Init(a.ig);
t.Body().set_chat_group_id(this.m_ulGroupID), t.Body().set_chat_id(this.m_ulChatID), t.Body().set_timestamp(e), a.Xn.AckChatMessage(this.m_CMInterface.GetServiceTransport(), t);
}
GetPlatformNotificationLevel() {
return o.De.IN_MOBILE ? this.GetMobileNotificationLevel() : this.GetDesktopNotificationLevel();
}
GetDesktopNotificationLevel() {
return 0 == this.m_eDesktopNotificationLevel ? this.m_group.GetDesktopNotificationLevel() : this.m_eDesktopNotificationLevel;
}
GetMobileNotificationLevel() {
return 0 === this.m_eMobileNotificationLevel ? this.m_group.GetMobileNotificationLevel() : this.m_eMobileNotificationLevel;
}
BIsUnreadIndicatorMuted() {
return this.m_group.BIsUnreadIndicatorMuted();
}
GetDesktopNotificationLevelSetting() {
return this.m_eDesktopNotificationLevel;
}
GetMobileNotificationLevelsetting() {
return this.m_eMobileNotificationLevel;
}
UpdateUserState(e) {
(this.m_rtLastAckedChatMsg = e.time_last_ack()), (this.m_rtLastMention = e.time_last_mention()), (this.m_eDesktopNotificationLevel = e.desktop_notification_level()), (this.m_eMobileNotificationLevel = e.mobile_notification_level()), (this.m_bUnreadIndicatorMuted = e.unread_indicator_muted()), (this.m_rtFirstUnread = e.time_first_unread()), (this.m_rtLastAckedChatMsg || 0) < this.m_rtLastMessageReceived && ((this.m_cUnreadChatMessages = 1), this.m_rtLastAckedChatMsg && (this.m_rtFirstUnreadChatMsg = this.m_rtLastAckedChatMsg + 1), u.Ul.FriendStore.UpdateUnreadMessagesGlobal());
}
UpdateChatState(e) {
(0, f.X)(this.m_ulChatID == e.chat_id(), "State for different chat room"), (this.m_strName = e.chat_name()), (this.m_bVoiceAllowed = e.voice_allowed());
let t = !1,
n = !1,
i = this.m_FriendStore.self.accountid,
r = new Set(this.m_groupVoiceActiveMembers.GetCurrentMemberSet());
for (let n of e.members_in_voice()) r.delete(n) || (this.m_groupVoiceActiveMembers.AddMember(n), n != i && (t = !0));
r.forEach((e) => {
this.m_groupVoiceActiveMembers.RemoveMember(e);
let t = this.m_groupVoiceActiveMembers.HasMember(e);
this.VoiceChatStore.OnUserLeftChatRoomVoiceChat(this.m_ulGroupID, this.m_ulChatID, e, t), e != i && (n = !0);
}),
this.BVoiceActive() && (t ? u.Ul.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/steam_voice_channel_enter.m4a?v=1") : n && u.Ul.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/steam_voice_channel_exit.m4a?v=1")),
(this.m_rtLastMessageReceived = e.time_last_message()),
(this.m_strLastMessage = e.last_message()),
(this.m_accountIDLastMessage = e.accountid_last_message()),
(this.m_unSortOrder = e.sort_order());
}
get voice_active_member_list() {
return this.m_groupVoiceActiveMembers;
}
get voice_active_contains_friends() {
for (let e = 0; e < this.m_groupVoiceActiveMembers.member_list.length; e++) if (this.m_groupVoiceActiveMembers.member_list[e].is_friend || this.m_groupVoiceActiveMembers.member_list[e] == u.Ul.FriendStore.self) return !0;
return !1;
}
get voice_active_contains_self() {
for (let e = 0; e < this.m_groupVoiceActiveMembers.member_list.length; e++) if (this.m_groupVoiceActiveMembers.member_list[e] == u.Ul.FriendStore.self) return !0;
return !1;
}
get voice_active_contains_only_self() {
return 1 == this.m_groupVoiceActiveMembers.member_list.length && this.m_groupVoiceActiveMembers.member_list[0] == u.Ul.FriendStore.self;
}
get name() {
return this.IsDefaultRoomForGroup() ? "Home" : this.IsUnsavedVoiceChannel() ? (0, c.Xx)("#Chat_CreateChatChannel_DefaultName") : this.m_strName;
}
IsUnsavedVoiceChannel() {
return !(0 != this.m_strName.length || !this.m_bVoiceAllowed);
}
GetParentGroupID() {
return this.m_ulGroupID;
}
GetGroup() {
return this.m_group;
}
IsDefaultRoomForGroup() {
return this.m_bIsDefaultForGroup;
}
GetRoomID() {
return this.m_ulChatID;
}
BIsDefaultRoom() {
return this.m_bIsDefaultForGroup;
}
get unique_id() {
return "cr" + this.m_ulChatID;
}
GetVoiceAllowed() {
return this.m_bVoiceAllowed;
}
IsTempVoiceRoom() {
return !!this.GetVoiceAllowed() && (!this.m_strName || 0 == this.m_strName.length);
}
GetSortOrder() {
return this.m_unSortOrder;
}
StartVoiceChat() {
this.BVoiceActive() || this.ChatStore.VoiceChat.InitiateRoomChat(this.m_ulGroupID, this.m_ulChatID);
}
ToggleVoiceChat() {
this.BVoiceActive() ? this.ChatStore.VoiceChat.OnUserEndVoiceChat() : this.StartVoiceChat();
}
BVoiceActive() {
return this.ChatStore.VoiceChat.IsVoiceActiveForRoom(this.m_ulGroupID, this.m_ulChatID);
}
UpdateMessageReaction(e, t, n, o) {
return (0, i.mG)(this, void 0, void 0, function* () {
const i = r.gA.Init(a.uV);
i.Body().set_chat_group_id(this.m_ulGroupID), i.Body().set_chat_id(this.m_ulChatID), i.Body().set_reaction_type(t), i.Body().set_reaction(n), i.Body().set_is_add(o), i.Body().set_server_timestamp(e.rtTimestamp), i.Body().set_ordinal(e.unOrdinal);
const s = e.reactions.find((e) => n === e.strReaction),
l = o ? 1 : -1,
c = s ? s.cReactors + l : l;
e.UpdateReaction(t, n, c, o);
const m = yield a.Xn.UpdateMessageReaction(this.m_CMInterface.GetServiceTransport(), i);
return 1 !== m.GetEResult() ? (e.UpdateReaction(t, n, c - l, !o), console.log(`Error updating message reaction. EResult: ${m.GetEResult()}`)) : o && 1 === m.Body().num_reactors() && (1 === t ? this.m_ChatStore.EmoticonStore.TrackEmoticonUsage(n, Date.now() / 1e3) : 2 === t && this.m_ChatStore.EmoticonStore.TrackStickerUsage(n, Date.now() / 1e3)), m.GetEResult();
});
}
GetMessageReactionReactors(e, t, n) {
const i = [];
if (t.bUserReacted && (i.push(u.Ul.FriendStore.self.accountid), 1 === t.cReactors)) return i;
const o = this.GetMessageReactionKey(e, t.strReaction),
r = () =>
this.LoadMessageReactionReactors(e, t, n).then((e) => {
const t = {};
e.forEach((e) => (t[e] = !0)), this.m_mapMessageReactionReactors.set(o, { cRequested: n, reactors: t });
});
if (this.m_mapMessageReactionReactors.has(o)) {
const o = this.m_mapMessageReactionReactors.get(this.GetMessageReactionKey(e, t.strReaction));
o.cRequested < n && o.cRequested < t.cReactors && r();
const a = Object.keys(o.reactors)
.map((e) => parseInt(e))
.filter((e) => e !== u.Ul.FriendStore.self.accountid);
i.push(...a);
} else r();
return i.slice(0, n);
}
UpdateMessageReactionReactors(e, t, n, i) {
const o = this.GetMessageReactionKey(e, t);
if (this.m_mapMessageReactionReactors.has(o)) {
const e = this.m_mapMessageReactionReactors.get(o);
e.reactors[n] && !i ? (delete e.reactors[n], e.cRequested--, 0 == e.cRequested && this.m_mapMessageReactionReactors.delete(o)) : !e.reactors[n] && i && ((e.reactors[n] = !0), e.cRequested++);
} else i && this.m_mapMessageReactionReactors.set(o, { cRequested: 1, reactors: { [n]: !0 } });
}
GetMessageReactionKey(e, t) {
return `${e.rtTimestamp}_${e.unOrdinal}_${t}`;
}
LoadMessageReactionReactors(e, t, n) {
return (0, i.mG)(this, void 0, void 0, function* () {
const i = r.gA.Init(a.vL);
i.Body().set_chat_group_id(this.m_ulGroupID), i.Body().set_chat_id(this.m_ulChatID), i.Body().set_server_timestamp(e.rtTimestamp), i.Body().set_ordinal(e.unOrdinal), i.Body().set_reaction_type(1), i.Body().set_reaction(t.strReaction), i.Body().set_limit(n);
const o = yield a.Xn.GetMessageReactionReactors(this.m_CMInterface.GetServiceTransport(), i);
return 1 != o.GetEResult() ? (console.error(`Failed to load message reaction reactors: ${o.GetEResult()}`), []) : o.Body().reactors();
});
}
SendChatMessageInternal(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
if (!this.GetChatRoomGroup().BCanChat()) {
let e = this.AppendLocalEchoChatMsg("");
return e.SetErrorSending(_.p.NoChatPermissionInGroup), e.eErrorSending;
}
let t = r.gA.Init(a.qk);
t.Body().set_chat_group_id(this.m_ulGroupID), t.Body().set_chat_id(this.m_ulChatID), t.Body().set_message(e);
let n = this.AppendLocalEchoChatMsg(e);
(this.m_strLastMessage = e), (this.m_accountIDLastMessage = this.m_FriendStore.self.accountid);
const i = yield this.SendWithRetries(n, () => a.Xn.SendChatMessage(this.m_ChatStore.CMInterface.GetServiceTransport(), t));
return i === _.p.None && (this.m_accountIDLastMessage = this.m_FriendStore.self.accountid), i;
});
}
DeleteChatMessages(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
let t = e.map((e) => ({ rtTimestamp: e.rtTimestamp, unOrdinal: e.unOrdinal }));
this.UpdateChatMessageDeletedState(t, _.im.Deleting);
let n = r.gA.Init(a.Jo);
n.Body().set_chat_group_id(this.m_ulGroupID), n.Body().set_chat_id(this.m_ulChatID);
for (let t of e) {
let e = n.Body().add_messages();
e.set_server_timestamp(t.rtTimestamp), e.set_ordinal(t.unOrdinal);
}
let i = (yield a.Xn.DeleteChatMessages(this.m_ChatStore.CMInterface.GetServiceTransport(), n)).GetEResult();
return 1 != i ? (this.UpdateChatMessageDeletedState(t, _.im.None), i) : (this.UpdateChatMessageDeletedState(t, _.im.Deleted), 1);
});
}
PopulateCommitFileUploadFormData(e, t) {
e.append("chat_group_id", this.m_ulGroupID), e.append("chat_id", this.m_ulChatID), e.append("spoiler", t.bSpoiler ? "1" : "0");
}
BShouldTrackUnreadMessages() {
return this.m_bIsDefaultForGroup || !this.m_bVoiceAllowed || this.BVoiceActive();
}
BShouldSilentlyAddMessage(e) {
return u.Ul.FriendStore.GetPlayer(e.unAccountID).is_blocked;
}
PlayChatRoomNotificationSound() {
u.Ul.FriendStore.GetUserDoNotDisturb() || u.Ul.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/steam_chatroom_notification.m4a?v=1");
}
PlayAtMentionSound() {
u.Ul.FriendStore.GetUserDoNotDisturb() || u.Ul.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/steam_at_mention.m4a?v=1");
}
OnReceivedNewMessage(e, t, n, i) {
if (this.BShouldTrackUnreadMessages()) {
if (!e.BIsLocalEcho() && e.unAccountID != this.self.accountid) {
let o;
switch (((e.Mentions.mention_all || e.Mentions.mention_here || e.Mentions.mention_user) && (this.m_rtLastMention = e.rtTimestamp), this.GetPlatformNotificationLevel())) {
case 1:
o = !1;
break;
case 2:
o = e.Mentions.mention_user;
break;
case 3:
o = e.Mentions.mention_user || e.Mentions.mention_here || e.Mentions.mention_all;
break;
default:
o = !0;
}
if (o && !u.Ul.FriendStore.GetUserDoNotDisturb()) {
let o = e.Mentions.mention_all || e.Mentions.mention_here || e.Mentions.mention_user;
if ((u.Ul.BPlayChatRoomNotificationSound() && o ? this.PlayAtMentionSound() : u.Ul.BPlayChatRoomNotificationSound() && t < 4 && this.PlayChatRoomNotificationSound(), u.Ul.NotificationManager.BNotificationsPermitted() && t < 4 && u.Ul.BShowChatRoomNotification())) {
const t = u.Ul.FriendStore.GetPlayer(e.unAccountID);
t.LoadIfNecessary();
const r = () => {
let r = { title: this.m_bIsDefaultForGroup ? this.GetGroup().name : this.GetGroup().name + " | " + this.name, body: `${t.display_name}: "${n}"`, icon: t.persona.avatar_url_medium, rawbody: n, tag: "groupmsg_" + (o ? "mention_" : "") + t.accountid, steamid: t.persona.m_steamid.ConvertTo64BitString(), chatroomgroupid: this.GetParentGroupID(), chatroomid: this.GetRoomID() };
(r = this.DecorateNotification(e, r, n, i)), (r.body = this.m_ChatStore.TextFilterStore.FilterText(e.unAccountID, r.body)), r.body && (u.Ul.NotificationManager.DisplayNotification(r, (e) => u.Ul.UIStore.ShowAndOrActivateChat(e, this, !0)), this.m_bHasUnreadPriorityChatMessages || ((this.m_bHasUnreadPriorityChatMessages = !0), u.Ul.FriendStore.UpdateUnreadMessagesGlobal()));
};
(0, l.gx)(() => t.is_ready, r, { timeout: 1e3 });
}
if (t < 4) {
const e = u.Ul.SettingsStore.FriendsSettings.nChatFlashMode;
let t = Promise.resolve(0 == e);
1 == e && (t = u.Ul.UIStore.IsChatWindowMinimized(this)),
t.then((e) => {
e && u.Ul.UIStore.FlashChatWindow(this, !0);
});
}
}
}
(!this.m_rtFirstUnread || (!this.m_group.BIsUnreadIndicatorMuted() && this.m_rtFirstUnread <= this.m_rtLastAckedChatMsg)) && (this.m_rtFirstUnread = e.rtTimestamp);
}
}
GetChatRoomGroup() {
return this.m_ChatStore.GetChatRoomGroup(this.m_ulGroupID);
}
GetMember(e) {
return this.GetChatRoomGroup().GetMember(e);
}
CreateInviteLink(e) {
let t = r.gA.Init(a.Q2);
t.Body().set_chat_group_id(this.m_ulGroupID),
t.Body().set_seconds_valid(e),
t.Body().set_chat_id(this.m_ulChatID),
a.Xn.CreateInviteLink(this.m_ChatStore.CMInterface.GetServiceTransport(), t).then((e) => {
let t = e.Body().invite_code(),
n = (0, g.V)(t),
i = e.Body().seconds_valid();
0 != i && (i += Math.floor(Date.now() / 1e3)), (this.m_lastChatLink = { strInviteURL: n, rtExpires: i });
});
}
OnActivate() {
this.m_ChatStore.OnChatRoomActivated(this), super.OnActivate();
}
get lastChatLinkInfo() {
return this.m_lastChatLink;
}
BCanDeleteMemberMessages(e) {
return this.GetChatRoomGroup().BCanDeleteMemberMessages(e);
}
ChangeNameWhileWaitingForRenameRequest(e) {
this.m_strName = e;
}
SetNotificationPreferences(e, t, n) {
let i = r.gA.Init(a.x1);
i.Body().set_chat_group_id(this.m_ulGroupID);
let o = i.Body().add_chat_room_preferences();
return o.set_chat_id(this.m_ulChatID), void 0 !== e && ((this.m_eDesktopNotificationLevel = e), o.set_desktop_notification_level(e), 4 == e && this.m_bUnreadIndicatorMuted && (n = !1)), void 0 !== t && ((this.m_eMobileNotificationLevel = t), o.set_mobile_notification_level(t)), void 0 !== n && ((this.m_bUnreadIndicatorMuted = n), o.set_unread_indicator_muted(n)), a.Xn.SetUserChatGroupPreferences(u.Ul.CMInterface.GetServiceTransport(), i).then((e) => 1 == e.GetEResult());
}
SetupAppCustomServerMsg(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
let t = JSON.parse(e.strMessage) || {},
n = new Map();
if (t.params) for (let e in t.params) n.set(e.toString(), t.params[e].toString());
e.strServerMsgAppCustomLocalized = "...";
let i = yield u.Ul.AppInfoStore.GetRichPresenceLocAsync(this.m_group.GetOwnerAppID());
t.tok ? (e.strServerMsgAppCustomLocalized = i.Localize(t.tok, n)) : t.msg ? (e.strServerMsgAppCustomLocalized = i.SubstituteParams(t.msg, n)) : (e.strServerMsgAppCustomLocalized = e.strMessage);
let o = (0, s.jr)(e.strServerMsgAppCustomLocalized),
r = null,
a = "",
l = !1;
for (let e of o)
if (1 != e.type) {
if (2 == e.type)
if ("mention" != e.tag) "spoiler" != e.tag && (console.log("bbcode tag '" + e.tag + "' not allowed!"), (l = !0));
else if (e.args) {
r || (r = {});
let t = e.args[""];
"all" == t ? (r.mention_all = !0) : "here" == t ? (r.mention_here = !0) : t == this.m_FriendStore.self.accountid.toString() && (r.mention_user = !0);
}
} else a += e.text;
return l && (e.strServerMsgAppCustomLocalized = a), r && (e.Mentions = r), a;
});
}
}
(0, i.gn)([l.LO], I.prototype, "m_strName", void 0),
(0, i.gn)([l.LO], I.prototype, "m_unSortOrder", void 0),
(0, i.gn)([l.LO], I.prototype, "m_lastChatLink", void 0),
(0, i.gn)([l.LO], I.prototype, "m_rtLastMention", void 0),
(0, i.gn)([l.LO], I.prototype, "m_eDesktopNotificationLevel", void 0),
(0, i.gn)([l.LO], I.prototype, "m_eMobileNotificationLevel", void 0),
(0, i.gn)([l.LO], I.prototype, "m_bUnreadIndicatorMuted", void 0),
(0, i.gn)([l.aD], I.prototype, "UpdateUserState", null),
(0, i.gn)([l.aD], I.prototype, "UpdateChatState", null),
(0, i.gn)([l.Fl], I.prototype, "name", null),
(0, i.gn)([p.ak], I.prototype, "StartVoiceChat", null),
(0, i.gn)([l.aD], I.prototype, "UpdateMessageReactionReactors", null),
(0, i.gn)([p.ak, (0, C.D)(100)], I.prototype, "PlayChatRoomNotificationSound", null),
(0, i.gn)([p.ak, (0, C.D)(100)], I.prototype, "PlayAtMentionSound", null),
(0, i.gn)([l.aD], I.prototype, "CreateInviteLink", null),
(0, i.gn)([l.KG], I.prototype, "OnActivate", null),
(0, i.gn)([l.aD], I.prototype, "ChangeNameWhileWaitingForRenameRequest", null);
},
93354: (e, t, n) => {
"use strict";
n.d(t, { Xc: () => w, PR: () => E, jx: () => M, we: () => D });
var i = n(85556),
o = n(9824),
r = n(72080),
a = n(77385),
s = n(67915),
l = n(84446),
c = n(88991),
m = n(79588),
d = n(84290),
h = n(1736),
u = n(4638),
p = n(23346),
_ = n(72746),
g = n(23282),
C = n(19953),
f = n(93635);
class v {
constructor(e) {
(this.m_nLastClientChangenumberFromServer = -1), (this.m_bViewChanged = !1), (this.m_iStartIndex = void 0), (this.m_iEndIndex = void 0), (this.m_nLastServerChangenumber = void 0), (this.m_iLastServerStartIndex = void 0), (this.m_iLastServerEndIndex = void 0), (this.m_mapMembers = new Map()), (this.m_mapRankByAccountID = new Map()), (this.m_mapPersonaStates = m.LO.map()), (this.m_cMemberSummaryTotal = void 0), (this.m_cMemberSummaryOnline = void 0), (this.m_cMemberSummaryInGame = void 0), (this.m_mapPersonaSubscriptions = new Map()), (this.m_setQueuedPersonaSubscriptions = new Set()), (this.m_setQueuedPersonaUnsubscriptions = new Set()), (this.m_rgUpdateQueue = []), (this.m_rgQueuedViewExtents = { iStartIndex: -1, iEndIndex: -1 }), (0, m.rC)(this), (this.m_ulChatRoomGroupID = e), (this.m_nClientChangenumber = 0), (this.m_ulViewID = "" + v.sm_ulNextViewID++);
}
GetViewID() {
return this.m_ulViewID;
}
ApplyUpdates() {
for (const e of this.m_rgUpdateQueue) {
if (e.view(!1)) {
const t = e.view();
let n = t.client_changenumber() == this.m_nClientChangenumber,
i = t.client_changenumber() == this.m_nLastClientChangenumberFromServer;
if (((this.m_nLastServerChangenumber = t.server_changenumber()), t.start() != this.m_iLastServerStartIndex && i)) {
let e = [];
for (let t = this.m_iLastServerStartIndex; t <= this.m_iLastServerEndIndex; t++) e.push(this.m_mapMembers.get(t));
for (let n = t.start(); n <= t.end(); n++) {
let t = e.shift();
if (!t) continue;
let i = this.m_mapRankByAccountID.get(t);
void 0 !== i && this.m_mapMembers.get(i) == t && this.m_mapMembers.delete(i), this.m_mapMembers.set(n, t), this.m_mapRankByAccountID.set(t, n);
}
}
(this.m_nLastClientChangenumberFromServer = t.client_changenumber()), (this.m_iLastServerStartIndex = t.start()), (this.m_iLastServerEndIndex = t.end()), this.m_bViewChanged || ((this.m_iLastServerStartIndex < this.m_iStartIndex - 10 || this.m_iLastServerEndIndex > this.m_iEndIndex + 10) && this.PublishViewExtentsToServer(this.m_iStartIndex, this.m_iEndIndex, 11)), n && (this.m_bViewChanged = !1);
}
for (let t of e.members()) {
let n = t.accountid(),
i = this.m_mapRankByAccountID.get(n);
void 0 !== i && this.m_mapMembers.get(i) == n && this.m_mapMembers.delete(i), this.m_mapMembers.set(t.rank(), n), this.m_mapRankByAccountID.set(n, t.rank()), t.persona() && this.UpdatePersonaState(t.accountid(), e.status_flags(), t.persona());
}
let t = e.member_summary(!1);
t && ((this.m_cMemberSummaryTotal = t.offline() + t.online() + t.ingame()), (this.m_cMemberSummaryOnline = t.online() + t.ingame()), (this.m_cMemberSummaryInGame = t.ingame()));
}
(this.m_rgUpdateQueue = []), (this.m_iTimeoutApplyUpdates = void 0);
}
OnServerUpdate(e) {
this.m_rgUpdateQueue.push(e), this.m_bViewChanged ? (this.m_iTimeoutApplyUpdates && window.clearInterval(this.m_iTimeoutApplyUpdates), this.ApplyUpdates()) : this.m_iTimeoutApplyUpdates || (this.m_iTimeoutApplyUpdates = window.setTimeout(() => this.ApplyUpdates(), 1e3));
for (const t of e.subscribed_personas()) {
const n = new c.K(t.friendid()).GetAccountID();
this.UpdatePersonaState(n, e.status_flags(), t);
}
}
GetViewChangenumber() {
return [this.m_nLastClientChangenumberFromServer, this.m_nLastServerChangenumber];
}
GetAccountIDAt(e) {
return e >= this.m_iLastServerStartIndex && e <= this.m_iLastServerEndIndex && this.m_mapMembers.has(e) ? this.m_mapMembers.get(e) : null;
}
GetMember(e) {
return this.m_mapPersonaStates.has(e) ? this.m_mapPersonaStates.get(e) : _.Ul.FriendStore.GetPlayer(e);
}
GetMemberCountTotal() {
return this.m_cMemberSummaryTotal;
}
GetMemberCountOnline() {
return this.m_cMemberSummaryOnline;
}
GetMemberCountInGame() {
return this.m_cMemberSummaryInGame;
}
UpdatePersonaState(e, t, n) {
if (n && n.player_name())
if (this.m_mapPersonaStates.has(e)) this.m_mapPersonaStates.get(e).mutable_persona.UpdateFromMessage(t, n);
else {
let i = _.Ul.FriendStore.GetPlayer(e);
i.mutable_persona.UpdateFromMessage(t, n), this.m_mapPersonaStates.set(e, i);
}
}
SetViewExtents(e, t) {
(this.m_rgQueuedViewExtents = { iStartIndex: e, iEndIndex: t }), this.m_hSetViewExtentsInterval || (this.PublishQueuedViewExtentsToServer(), (this.m_hSetViewExtentsInterval = window.setTimeout(() => this.PublishQueuedViewExtentsToServer(), 400)));
}
PublishQueuedViewExtentsToServer() {
if (((this.m_hSetViewExtentsInterval = void 0), !this.m_rgQueuedViewExtents)) return;
const { iStartIndex: e, iEndIndex: t } = this.m_rgQueuedViewExtents;
(this.m_rgQueuedViewExtents = null),
this.PublishViewExtentsToServer(e, t, 100),
this.m_hResetViewExtentsInterval && clearInterval(this.m_hResetViewExtentsInterval),
(this.m_hResetViewExtentsInterval = window.setTimeout(() => {
this.PublishViewExtentsToServer(e, t, 11), (this.m_hResetViewExtentsInterval = void 0);
}, 1e4));
}
PublishViewExtentsToServer(e, t, n) {
const i = Math.max(e - n, 0),
o = t + n;
if (this.m_iStartIndex == i && this.m_iEndIndex == o) return;
(this.m_iStartIndex = i), (this.m_iEndIndex = o), this.m_nClientChangenumber++, (this.m_bViewChanged = !0);
let r = h.gA.Init(u.QN);
r.Body().set_chat_group_id(this.m_ulChatRoomGroupID), r.Body().set_view_id(this.m_ulViewID), r.Body().set_client_changenumber(this.m_nClientChangenumber), r.Body().set_start(this.m_iStartIndex), r.Body().set_end(this.m_iEndIndex), u.Xn.UpdateMemberListView(_.Ul.CMInterface.GetServiceTransport(), r);
}
SubscribeToPersona(e) {
const t = this.m_mapPersonaSubscriptions.get(e);
t ? this.m_mapPersonaSubscriptions.set(e, t + 1) : (this.m_mapPersonaSubscriptions.set(e, 1), this.m_setQueuedPersonaSubscriptions.add(e), this.ScheduleSubscriptionUpdate());
}
UnsubscribeFromPersona(e) {
const t = this.m_mapPersonaSubscriptions.get(e);
t ? (t > 1 ? this.m_mapPersonaSubscriptions.set(e, t - 1) : (this.m_mapPersonaSubscriptions.delete(e), this.m_setQueuedPersonaUnsubscriptions.add(e), this.ScheduleSubscriptionUpdate())) : console.warn(`Attempting to unsubscribe from a persona that we are not subscribed to. Chat: ${this.m_ulChatRoomGroupID}, Account: ${e}`);
}
ScheduleSubscriptionUpdate() {
this.m_nPersonaSubscriptionTimer ||
(this.m_nPersonaSubscriptionTimer = window.setTimeout(() => {
this.m_nClientChangenumber++;
let e = h.gA.Init(u.QN);
e.Body().set_chat_group_id(this.m_ulChatRoomGroupID), e.Body().set_view_id(this.m_ulViewID), e.Body().set_client_changenumber(this.m_nClientChangenumber), e.Body().set_start(this.m_iStartIndex), e.Body().set_end(this.m_iEndIndex), this.m_setQueuedPersonaSubscriptions.size && (e.Body().set_persona_subscribe_accountids(Array.from(this.m_setQueuedPersonaSubscriptions)), this.m_setQueuedPersonaSubscriptions.clear()), this.m_setQueuedPersonaUnsubscriptions.size && (e.Body().set_persona_unsubscribe_accountids(Array.from(this.m_setQueuedPersonaUnsubscriptions)), this.m_setQueuedPersonaUnsubscriptions.clear()), u.Xn.UpdateMemberListView(_.Ul.CMInterface.GetServiceTransport(), e), (this.m_nPersonaSubscriptionTimer = void 0);
}, 50));
}
UnregisterFromServer() {
let e = h.gA.Init(u.QN);
e.Body().set_chat_group_id(this.m_ulChatRoomGroupID), e.Body().set_view_id(this.m_ulViewID), e.Body().set_delete_view(!0), u.Xn.UpdateMemberListView(_.Ul.CMInterface.GetServiceTransport(), e);
}
PerformSearch(e, t, n) {
return (0, i.mG)(this, void 0, void 0, function* () {
let e = n.toLocaleLowerCase(),
i = h.gA.Init(u.B3);
return (
i.Body().set_chat_group_id(this.m_ulChatRoomGroupID),
i.Body().set_search_id(t),
i.Body().set_search_text(e),
u.Xn.SearchMembers(_.Ul.CMInterface.GetServiceTransport(), i).then((t) => {
let n = [];
for (let i of t.Body().matching_members()) {
i.persona() && this.UpdatePersonaState(i.accountid(), t.Body().status_flags(), i.persona());
let o = this.m_mapPersonaStates.get(i.accountid());
if (((0, f.X)(o, "Missing persona in member matches"), !o)) continue;
let r = o.MatchSearchString(e);
n.push({ friend: o, iMatchOffset: r.iOffset, bNicknameMatch: 2 == r.match });
}
return n;
})
);
});
}
GetAllKnownPersonas() {
return Array.from(this.m_mapPersonaStates.values());
}
}
(v.sm_ulNextViewID = 1), (0, i.gn)([m.LO], v.prototype, "m_iStartIndex", void 0), (0, i.gn)([m.LO], v.prototype, "m_iEndIndex", void 0), (0, i.gn)([m.LO], v.prototype, "m_nLastServerChangenumber", void 0), (0, i.gn)([m.LO], v.prototype, "m_iLastServerStartIndex", void 0), (0, i.gn)([m.LO], v.prototype, "m_iLastServerEndIndex", void 0), (0, i.gn)([m.LO], v.prototype, "m_cMemberSummaryTotal", void 0), (0, i.gn)([m.LO], v.prototype, "m_cMemberSummaryOnline", void 0), (0, i.gn)([m.LO], v.prototype, "m_cMemberSummaryInGame", void 0), (0, i.gn)([m.aD], v.prototype, "ApplyUpdates", null), (0, i.gn)([m.aD], v.prototype, "OnServerUpdate", null);
var S = n(92883),
b = n(71576);
class I {
constructor(e = 20, t) {
(this.m_rank = void 0), (this.m_role_ids = void 0), (0, m.rC)(this), (this.m_rank = e), (this.m_role_ids = t);
}
BHasRole(e) {
return -1 != this.m_role_ids.findIndex((t) => t == e);
}
}
(0, i.gn)([m.LO], I.prototype, "m_rank", void 0), (0, i.gn)([m.LO], I.prototype, "m_role_ids", void 0);
class y {
constructor(e) {
(this.m_roleActions = new u.Xm()), (this.m_roleActions = e);
}
BCanPerformAction(e) {
switch (e) {
case 1:
return this.m_roleActions.can_create_rename_delete_channel();
case 2:
return this.m_roleActions.can_kick();
case 3:
return this.m_roleActions.can_ban();
case 4:
return this.m_roleActions.can_invite();
case 5:
return this.m_roleActions.can_change_tagline_avatar_name();
case 6:
return this.m_roleActions.can_chat();
case 8:
return this.m_roleActions.can_change_group_roles();
case 9:
return this.m_roleActions.can_change_user_roles();
case 10:
return this.m_roleActions.can_mention_all();
case 11:
return this.m_roleActions.can_set_watching_broadcast();
default:
return !1;
}
}
SetCanPerformAction(e, t) {
switch (e) {
case 1:
this.m_roleActions.set_can_create_rename_delete_channel(t);
break;
case 2:
this.m_roleActions.set_can_kick(t);
break;
case 3:
this.m_roleActions.set_can_ban(t);
break;
case 4:
this.m_roleActions.set_can_invite(t);
break;
case 5:
this.m_roleActions.set_can_change_tagline_avatar_name(t);
break;
case 6:
this.m_roleActions.set_can_chat(t);
break;
case 8:
this.m_roleActions.set_can_change_group_roles(t);
break;
case 9:
this.m_roleActions.set_can_change_user_roles(t);
break;
case 10:
this.m_roleActions.set_can_mention_all(t);
break;
case 11:
this.m_roleActions.set_can_set_watching_broadcast(t);
}
}
toString() {
let e = this.role_id;
return this.m_roleActions.can_create_rename_delete_channel() && (e += " CreateRenameDeleteChannel"), this.m_roleActions.can_kick() && (e += " Kick"), this.m_roleActions.can_ban() && (e += " Ban"), this.m_roleActions.can_invite() && (e += " Invite"), this.m_roleActions.can_change_tagline_avatar_name() && (e += " ChangeTaglineAvatarName"), this.m_roleActions.can_chat() && (e += " Chat"), this.m_roleActions.can_change_group_roles() && (e += " ChangeGroupRoles"), this.m_roleActions.can_change_user_roles() && (e += " ChangeUserRoles"), e;
}
get role_id() {
return this.m_roleActions.role_id();
}
get roleActions() {
return this.m_roleActions;
}
}
class E {
constructor(e, t) {
(this.LOG = new a.sO("ChatRoomGroup", () => this.unique_id).Debug), (this.m_chatStore = null), (this.m_ulGroupID = ""), (this.m_ulDefaultChatID = ""), (this.m_rtTimeJoined = 0), (this.m_rtLastAck = 0), (this.m_unOwnerAccountID = void 0), (this.m_bFullStateLoaded = !1), (this.m_strName = ""), (this.m_strTagLine = ""), (this.m_strAvatarSHA = ""), (this.m_strAvatarUGCURL = ""), (this.m_unWatchingBroadcastAccountID = void 0), (this.m_strWatchingBroadcastChannelID = ""), (this.m_mapRooms = m.LO.map(null, { deep: !1 })), (this.m_rgPartyBeacons = []), (this.m_eUserDesktopNotificationLevel = 4), (this.m_eUserMobileNotificationLevel = 4), (this.m_bUnreadIndicatorMuted = !1), (this.m_roles = []), (this.m_roleActions = []), (this.m_rgGroupMembersSummary = void 0), (this.m_groupMembers = new k()), (this.m_cMemberSummaryCount = 0), (this.m_bMemberListVirtualized = !1), (0, m.rC)(this), (this.m_chatStore = e), (this.m_ulGroupID = t);
}
get ChatStore() {
return this.m_chatStore;
}
BIsValid() {
return this.m_mapRooms.size > 0;
}
IsNamedGroupChat() {
return !!this.m_strName || this.BIsClanChatRoom();
}
GetOwnerAccountID() {
return this.m_unOwnerAccountID;
}
BIsAccountIDOwner(e) {
return this.BIsClanChatRoom() ? 50 == this.GetMemberRankIfPresent(e) : this.GetOwnerAccountID() == e;
}
SetOwnerAppID(e) {
e || (e = 0), this.m_unAppID != e && ((this.m_unAppID = e), this.m_unAppID && (_.Ul.AppInfoStore.GetAppInfo(this.m_unAppID), _.Ul.AppInfoStore.GetRichPresenceLoc(this.m_unAppID)));
}
GetOwnerAppID() {
return this.m_unAppID;
}
get name() {
if (this.m_strName || this.BIsClanChatRoom()) return this.m_strName;
{
let e = this.members_to_highlight_name,
t = e.members;
if (!t.length) return e.remaining_count ? (0, d.Xx)("#ChatRoom_GenericWithOthers", e.remaining_count) : (0, d.Xx)("#ChatRoom_GenericEmpty");
switch (t.length) {
case 1:
return e.remaining_count > 0 ? (0, d.Xx)("#ChatRoom_OneFriendPlusMore", t[0].display_name, e.remaining_count) : (0, d.Xx)("#ChatRoom_OneFriend", t[0].display_name);
case 2:
return e.remaining_count > 0 ? (0, d.Xx)("#ChatRoom_TwoPlusMore", t[0].display_name, t[1].display_name, e.remaining_count) : (0, d.Xx)("#ChatRoom_TwoFriends", t[0].display_name, t[1].display_name);
case 3:
return (0, d.Xx)("#ChatRoom_ThreeFriends", t[0].display_name, t[1].display_name, t[2].display_name);
default:
return (0, f.X)(!1, `unexpected number of friends: ${t.length}`), "";
}
}
}
get tagline() {
return this.m_strTagLine;
}
get avatarSHA() {
return this.m_strAvatarSHA;
}
get avatarUGCURL() {
return this.m_strAvatarUGCURL;
}
get watching_broadcast_steamid() {
return this.m_unWatchingBroadcastAccountID ? c.K.InitFromAccountID(this.m_unWatchingBroadcastAccountID) : null;
}
get watching_broadcast_channel_id() {
return this.m_strWatchingBroadcastChannelID;
}
get hasAvatarSHA() {
return this.m_strAvatarSHA.length > 0;
}
get hasIcon() {
return this.hasAvatarSHA || 0 != this.m_unAppID;
}
GetAvatarOrAppIconURL(e) {
if (this.m_strAvatarUGCURL) return this.m_strAvatarUGCURL;
if (!this.m_strAvatarSHA && this.m_unAppID) {
let e = _.Ul.AppInfoStore.GetAppInfo(this.m_unAppID);
if (e.is_valid && e.icon_url) return e.icon_url;
}
return (function (e, t) {
t = t <= 32 ? 32 : t <= 64 ? 64 : 256;
let n = C.De.AVATAR_BASE_URL;
return n || (n = C.De.MEDIA_CDN_COMMUNITY_URL + "images/chaticons/" + e.substr(0, 2) + "/" + e.substr(2, 2) + "/" + e.substr(4, 2) + "/"), (n += e + "_" + t + ".jpg"), n;
})(this.m_strAvatarSHA, e);
}
get avatar_url_small() {
return this.GetAvatarOrAppIconURL(32);
}
get avatar_url_medium() {
return this.GetAvatarOrAppIconURL(64);
}
get avatar_url_full() {
return this.GetAvatarOrAppIconURL(256);
}
get memberCountTotal() {
return this.m_bFullStateLoaded ? this.m_groupMembers.unfiltered_count : this.m_cMemberSummaryCount;
}
get readyToRender() {
return this.m_bFullStateLoaded;
}
get memberCountOnline() {
return this.m_bFullStateLoaded ? this.m_groupMembers.member_counts.online : this.memberCountTotal;
}
get memberCountInGame() {
return this.m_groupMembers.member_counts.ingame;
}
get memberList() {
return this.m_groupMembers;
}
get unique_id() {
return "cg" + this.m_ulGroupID;
}
get timeJoined() {
return this.m_rtTimeJoined;
}
GetGroupID() {
return this.m_ulGroupID;
}
GetDefaultChatID() {
return this.m_ulDefaultChatID;
}
BIsClanChatRoom() {
return !!this.m_unClanID;
}
BIsVoiceChannel(e) {
let t = this.GetChatRoom(e);
return null != t && t.GetVoiceAllowed() && t.GetRoomID() != this.GetDefaultChatID();
}
BIsTempVoiceChannel(e) {
let t = this.GetChatRoom(e);
return t && t.IsTempVoiceRoom();
}
GetClanID() {
return this.m_unClanID;
}
get chatRoomList() {
let e = Array.from(this.m_mapRooms.values());
return (
e.sort((e, t) => {
if (e.GetSortOrder() < t.GetSortOrder()) return -1;
if (e.GetSortOrder() > t.GetSortOrder()) return 1;
let n = r.Z.fromString(e.GetRoomID()),
i = r.Z.fromString(t.GetRoomID());
return n.lessThan(i) ? -1 : n.greaterThan(i) ? 1 : 0;
}),
e
);
}
get textRoomList() {
return this.chatRoomList.filter((e) => !e.GetVoiceAllowed() || e.GetRoomID() == this.GetDefaultChatID());
}
get voiceRoomList() {
return this.chatRoomList.filter((e) => e.GetVoiceAllowed());
}
get hasVoiceRoom() {
let e,
t = this.m_mapRooms.values();
for (; (e = t.next()) && !e.done; ) if (e.value.GetVoiceAllowed()) return !0;
return !1;
}
GetDesktopNotificationLevel(e = !1) {
return 0 == this.m_eUserDesktopNotificationLevel ? (this.BIsClanChatRoom() ? 3 : 4) : this.m_eUserDesktopNotificationLevel;
}
GetMobileNotificationLevel() {
return 0 === this.m_eUserMobileNotificationLevel ? 3 : this.m_eUserMobileNotificationLevel;
}
BIsUnreadIndicatorMuted() {
return this.m_bUnreadIndicatorMuted;
}
get hasUnreadChatMessage() {
let e = Array.from(this.m_mapRooms.values());
for (let t of e) {
if ((this.m_bUnreadIndicatorMuted ? t.has_unread_messages : t.has_any_unread_messages) && (t.BIsDefaultRoom() || t.time_last_ack >= this.m_rtLastAck || t.time_last_mention > this.m_rtLastAck)) return !0;
}
return !1;
}
get HasUnreadMention() {
let e = Array.from(this.m_mapRooms.values());
for (let t of e) if (t.has_unread_mention) return !0;
return !1;
}
GetChatRoomsWithUnreadPriorityMessages(e) {
this.m_mapRooms.forEach(function (t) {
t.has_unread_priority_messages && e.push(t);
});
}
get time_last_activity() {
let e = 0,
t = 0;
this.m_mapRooms.forEach((n) => {
if (!n.BShouldTrackUnreadMessages()) return;
let i = n.time_last_activity;
i > this.m_rtLastAck ? (t = 0 == t ? i : Math.min(i, t)) : (e = Math.max(i, e));
});
let n = t;
return n || (n = e), this.m_rtTimeJoined > n && (n = this.m_rtTimeJoined), n;
}
get room_with_last_message() {
let e,
t = 0;
return (
this.m_mapRooms.forEach((n) => {
t < n.time_last_message && ((e = n), (t = n.time_last_message));
}),
e
);
}
GetRoomWithLastMessageForUser() {
let e,
t = 0;
return (
this.m_mapRooms.forEach((n) => {
t < n.time_last_message && ((e = n), (t = n.time_last_message));
}),
e
);
}
BHasEverBeenAcked() {
if (this.m_rtLastAck) return !0;
let e = Array.from(this.m_mapRooms.values());
for (let t of e) if (t.time_last_ack) return !0;
return !1;
}
UpdateLastAckTimeFromServer(e) {
this.m_rtLastAck < e && (this.m_rtLastAck = e);
}
IsInRoom(e) {
return (0, f.X)(this.m_bFullStateLoaded, "Group state not fully loaded"), this.m_groupMembers.HasMember(e);
}
BRoomContainsJustTheseFriendsAndSelf(e) {
if (!this.BIsCurrentUserAMember()) return !1;
if (this.memberCountTotal != e.length + 1) return !1;
let t = !0;
for (let n of e)
if (this.m_rgGroupMembersSummary.indexOf(n) < 0) {
t = !1;
break;
}
return t;
}
GetMyRank() {
return this.GetMemberRank(this.m_chatStore.CMInterface.steamid.GetAccountID());
}
ChangeMemberRank(e, t) {
(0, f.X)(this.m_groupMembers.HasMember(e), "ChangeMemberRank: missing member"), (this.m_groupMembers.GetExtra(e).m_rank = t);
}
GetMemberRank(e) {
(0, f.X)(this.m_groupMembers.HasMember(e), "GetMemberRank: missing member");
let t = this.m_groupMembers.GetExtra(e);
return t && 0 != t.m_rank ? t.m_rank : this.BIsClanChatRoom() ? 0 : 20;
}
GetMemberRankIfPresent(e) {
let t = this.m_groupMembers.GetExtra(e);
return t ? t.m_rank : 0;
}
GetMemberPartyBeacon(e) {
return this.m_rgPartyBeacons.find(function (t) {
return t.account_id == e;
});
}
ChangeMemberRoles(e, t) {
(0, f.X)(this.m_groupMembers.HasMember(e), "GetMemberRank: missing member");
let n = this.m_groupMembers.GetExtra(e);
n && (n.m_role_ids = t);
}
GetMemberRankString(e) {
if (!this.IsInRoom(e)) return "";
switch (this.GetMemberRank(e)) {
case 50:
return (0, d.Xx)("#Chat_rank_owner");
case 40:
return (0, d.Xx)("#Chat_rank_officer");
case 30:
return (0, d.Xx)("#Chat_rank_moderator");
case 20:
return (0, d.Xx)("#Chat_rank_member");
case 15:
return (0, d.Xx)("#Chat_rank_guest");
case 10:
return (0, d.Xx)("#Chat_rank_viewer");
case 0:
return "";
default:
return (0, d.Xx)("#Chat_rank_unknown");
}
}
GetMemberRankStringUnlocalized(e) {
if (!this.IsInRoom(e)) return "";
switch (this.GetMemberRank(e)) {
case 50:
return "Owner";
case 40:
return "Officer";
case 30:
return "Moderator";
case 20:
return "Member";
case 15:
return "Guest";
case 10:
return "Viewer";
case 0:
return "DefaultRank";
default:
return (0, d.Xx)("UnknownRank");
}
}
GetMember(e) {
if (this.IsInRoom(e)) return this.m_chatStore.FriendStore.GetPlayer(e);
this.m_bFullStateLoaded;
}
SetInitialGroupState(e) {
(0, f.X)(e.chat_group_id() == this.m_ulGroupID, "Chat group id doesn't match header"), this.UpdateGroupStateFromSummary(e), this.UpdateChatRoomState(e.default_chat_id(), e.chat_rooms());
}
UpdateGroupStateFromSummary(e) {
(this.m_strTagLine = e.chat_group_tagline()),
null != e.chat_group_avatar_sha() && (this.m_strAvatarSHA = (0, g.BH)(e.chat_group_avatar_sha())),
(this.m_strAvatarUGCURL = e.avatar_ugc_url() || ""),
(this.m_unWatchingBroadcastAccountID = e.watching_broadcast_accountid()),
(this.m_strWatchingBroadcastChannelID = e.watching_broadcast_channel_id()),
(this.m_cMemberSummaryCount = e.active_member_count()),
(this.m_unClanID = e.clanid()),
(this.m_unOwnerAccountID = e.accountid_owner()),
(this.m_rgGroupMembersSummary = e.top_members()),
(this.m_defaultRoleID = e.default_role_id()),
(this.m_roleActions = e.role_actions().map((e) => new y(e))),
this.m_groupMembers.AddMember(_.Ul.CMInterface.steamid.GetAccountID(), new I(e.rank(), e.role_ids())),
this.SetOwnerAppID(e.appid()),
this.SetNameCheckingForAppLocalization(e.chat_group_name()),
(this.m_rgPartyBeacons = e.party_beacons().map((e) => ({ account_id: new c.K(e.steamid_owner()).GetAccountID(), app_id: e.app_id(), beacon_id: e.beacon_id(), game_metadata: e.game_metadata() }))),
_.Ul.GroupMemberStore.OnPartyBeaconsUpdated(this.m_ulGroupID, this.m_rgPartyBeacons);
}
SetNameCheckingForAppLocalization(e) {
let t = null;
!this.m_unOwnerAccountID && this.GetOwnerAppID() && ("#" == e[0] ? (t = { tok: e }) : "{" == e[0] && (t = JSON.parse(e))),
t && t.tok
? ((this.m_strName = "..."),
_.Ul.AppInfoStore.GetRichPresenceLocAsync(this.GetOwnerAppID()).then((e) => {
let n = new Map();
if (t.params) for (let e in t.params) n.set(e.toString(), t.params[e].toString());
this.m_strName = e.Localize(t.tok, n);
}))
: (this.m_strName = e);
}
UpdateGroupState(e) {
(0, f.X)(e.header_state().chat_group_id() == this.m_ulGroupID, "Chat group id doesn't match header"), this.UpdateChatRoomHeaderState(e.header_state()), this.m_groupMembers.Clear();
let t = [];
for (let n of e.members()) {
let e = n.accountid();
this.m_groupMembers.AddMember(e, new I(n.rank(), n.role_ids())), t.length < 10 && t.push(e);
}
(!this.m_rgGroupMembersSummary || this.m_rgGroupMembersSummary.length < t.length) && (this.m_rgGroupMembersSummary = t), this.UpdateChatRoomState(e.default_chat_id(), e.chat_rooms()), (this.m_bFullStateLoaded = !0);
}
SetMemberListVirtualized(e) {
(this.m_bMemberListVirtualized = e), this.m_groupMembers.SetMemberDataVirtualized(e);
}
BIsMemberListVirtualized() {
return this.m_bMemberListVirtualized;
}
UnloadActiveGroupState() {
this.UnloadGroupState(),
this.m_mapRooms.forEach((e) => {
e.UnloadActiveChatState();
});
}
UnloadGroupState() {
(this.m_bFullStateLoaded = !1), (this.m_bMemberListVirtualized = !1), this.m_groupMembers.Clear();
}
UnloadAndResetGroupState() {
this.UnloadGroupState(),
this.UpdateUserState(new u.r9()),
this.m_mapRooms.forEach((e) => {
e.UnloadChatState();
});
}
OnUserStateChange(e, t) {
let n = e.accountid();
1 == t ? (this.LOG(`new member ${n} roles [${e.role_ids().toString()}]`), this.m_groupMembers.AddMember(n, new I(e.rank(), e.role_ids())), _.Ul.GroupMemberStore.OnMemberAdded(this.m_ulGroupID, n), this.m_rgGroupMembersSummary.length < 10 && -1 == this.m_rgGroupMembersSummary.indexOf(n) && (this.m_rgGroupMembersSummary = [...this.m_rgGroupMembersSummary, n])) : 2 == t || 3 == t || 10 == t ? (this.m_groupMembers.RemoveMember(n), _.Ul.GroupMemberStore.OnMemberRemoved(this.m_ulGroupID, n), -1 !== this.m_rgGroupMembersSummary.indexOf(n) && (this.m_rgGroupMembersSummary = o.de(this.m_rgGroupMembersSummary, n))) : 7 == t ? this.ChangeMemberRank(n, e.rank()) : 12 == t && this.ChangeMemberRoles(n, e.role_ids());
}
UpdateChatRoomState(e, t) {
this.m_ulDefaultChatID = e;
let n = new Set();
this.m_mapRooms.forEach((e, t) => n.add(t));
for (let i of t) {
let t = i.chat_id();
n.delete(t);
let o = this.m_mapRooms.get(t);
o || ((o = new l.K(this.m_chatStore, this, t, t == e)), this.m_mapRooms.set(t, o)), o.UpdateChatState(i);
}
n.forEach((e) => this.m_mapRooms.delete(e));
}
UpdateUserState(e) {
for (let t of e.user_chat_room_state()) {
let e = t.chat_id(),
n = this.m_mapRooms.get(e);
n && n.UpdateUserState(t);
}
(this.m_rtTimeJoined = e.time_joined()), (this.m_rtLastAck = e.time_last_group_ack()), (this.m_eUserDesktopNotificationLevel = e.desktop_notification_level()), (this.m_eUserMobileNotificationLevel = e.mobile_notification_level()), (this.m_bUnreadIndicatorMuted = e.unread_indicator_muted());
}
UpdateChatRoomHeaderState(e) {
(0, f.X)(e.chat_group_id() == this.m_ulGroupID, "Chat group id doesn't match header"), (this.m_strTagLine = e.tagline()), null != e.avatar_sha() && (this.m_strAvatarSHA = (0, g.BH)(e.avatar_sha())), (this.m_strAvatarUGCURL = e.avatar_ugc_url() || ""), (this.m_unWatchingBroadcastAccountID = e.watching_broadcast_accountid()), (this.m_unClanID = e.clanid()), (this.m_unOwnerAccountID = e.accountid_owner()), (this.m_defaultRoleID = e.default_role_id()), (this.m_roles = e.roles().map((e) => ({ role_id: e.role_id(), name: e.name(), ordinal: e.ordinal() })));
for (let e of this.m_roles) this.LOG(`role ${e.role_id} ${e.name}`);
this.m_roleActions = e.role_actions().map((e) => new y(e));
for (let e of this.m_roleActions) this.LOG(`role/action ${e.toString()}`);
this.SetOwnerAppID(e.appid()), this.SetNameCheckingForAppLocalization(e.chat_name()), (this.m_rgPartyBeacons = e.party_beacons().map((e) => ({ account_id: new c.K(e.steamid_owner()).GetAccountID(), app_id: e.app_id(), beacon_id: e.beacon_id(), game_metadata: e.game_metadata() }))), _.Ul.GroupMemberStore.OnPartyBeaconsUpdated(this.m_ulGroupID, this.m_rgPartyBeacons);
}
BIsCurrentUserAMember() {
return !!this.m_rtTimeJoined;
}
DefaultRoleID() {
return this.m_defaultRoleID;
}
GetRoleActions(e) {
for (let t of this.m_roleActions) if (t.role_id == e) return t;
}
GetRoles() {
return this.m_roles;
}
GetRoleOrdinal(e) {
for (let t of this.m_roles) if (t.role_id == e) return t.ordinal;
}
BIsUserGroupMember(e) {
for (let t of this.m_rgGroupMembersSummary) if (t == e.accountid) return !0;
return !1;
}
GetMemberRoleIDs(e) {
return null == this.m_groupMembers.GetExtra(e) ? [] : this.m_groupMembers.GetExtra(e).m_role_ids;
}
ToggleMemberRoleState(e, t) {
let n = this.BMemberHasRole(e, t);
return this.SetMemberRoleState(e, t, !n);
}
SetMemberRoleState(e, t, n) {
if (n == this.BMemberHasRole(e, t)) return Promise.resolve(!0);
if (!this.BCanIAssignRole(t)) return Promise.resolve(!1);
let i = c.K.InitFromAccountID(e);
if (n) {
let e = h.gA.Init(u.eF);
return e.Body().set_chat_group_id(this.GetGroupID()), e.Body().set_steamid(i.ConvertTo64BitString()), e.Body().set_role_id(t), u.Xn.AddRoleToUser(_.Ul.ChatStore.CMInterface.GetServiceTransport(), e).then((e) => (e.GetEResult(), 1 == e.GetEResult()));
}
{
let e = h.gA.Init(u.$n);
return e.Body().set_chat_group_id(this.GetGroupID()), e.Body().set_steamid(i.ConvertTo64BitString()), e.Body().set_role_id(t), u.Xn.DeleteRoleFromUser(_.Ul.ChatStore.CMInterface.GetServiceTransport(), e).then((e) => (e.GetEResult(), 1 == e.GetEResult()));
}
}
BDoesRoleAllowAction(e, t) {
for (let n of this.m_roleActions) if (n.role_id == e && n.BCanPerformAction(t)) return !0;
return !1;
}
BCanIPerformActionOnUser(e, t, n = !1) {
return !(!n && !this.BHasMember(e)) && !this.BIsAccountIDOwner(e) && this.BCanIPerformAction(t);
}
BHasMember(e) {
return void 0 !== this.m_groupMembers.GetExtra(e);
}
BMemberHasRole(e, t) {
let n = this.m_groupMembers.GetExtra(e);
return !!n && n.BHasRole(t);
}
BCanIPerformAction(e) {
if (this.BIsAccountIDOwner(this.m_chatStore.CMInterface.steamid.GetAccountID())) return !0;
let t = this.m_chatStore.CMInterface.steamid.GetAccountID(),
n = this.m_groupMembers.GetExtra(t);
if (n) for (let t of n.m_role_ids) if (this.BDoesRoleAllowAction(t, e)) return !0;
return !1;
}
BCanKickMember(e) {
return this.BCanIPerformActionOnUser(e, 2);
}
BCanBanMember(e) {
return this.BCanIPerformActionOnUser(e, 3);
}
BCanDeleteMemberMessages(e) {
if (_.Ul.FriendStore.self.accountid == e) return !0;
return this.BCanIPerformActionOnUser(e, 2, true) || this.BCanIPerformActionOnUser(e, 3, true);
}
BCanICreateRoles() {
return this.BCanIPerformAction(8);
}
BCanIModifyRole(e) {
if (this.BIsAccountIDOwner(this.m_chatStore.CMInterface.steamid.GetAccountID())) return !0;
if (!this.BCanIPerformAction(8)) return !1;
if (!this.GetRoleActions(e)) return !1;
let t = this.GetRoleOrdinal(e);
if (null == t) return !1;
let n = this.GetHighestRankRoleIDForPermission(this.m_chatStore.CMInterface.steamid.GetAccountID(), 8),
i = this.GetRoleOrdinal(n);
return null != i && i < t;
}
BCanIAssignRoles() {
return this.BCanIPerformAction(9);
}
BCanIAssignRole(e) {
if (this.BIsClanChatRoom()) return !1;
if (e == this.DefaultRoleID()) return !1;
if (this.BIsAccountIDOwner(this.m_chatStore.CMInterface.steamid.GetAccountID())) return !0;
if (!this.BCanIPerformAction(9)) return !1;
if (!this.GetRoleActions(e)) return !1;
let t = this.GetRoleOrdinal(e);
if (null == t) return !1;
let n = this.GetHighestRankRoleIDForPermission(this.m_chatStore.CMInterface.steamid.GetAccountID(), 9),
i = this.GetRoleOrdinal(n);
return null != i && i < t;
}
BCanIMentionAll() {
return this.BCanIPerformAction(10);
}
BCanIAssociateBroadcast() {
return this.BCanIPerformAction(11);
}
GetHighestRankRoleIDForPermission(e, t) {
let n,
i = Number.MAX_VALUE,
o = this.m_groupMembers.GetExtra(e);
if (o) {
for (let e of o.m_role_ids)
if (this.BDoesRoleAllowAction(e, t)) {
let t = this.GetRoleOrdinal(e);
t < i && ((n = e), (i = t));
}
return n;
}
}
GetDefaultChatRoom() {
return this.m_mapRooms.get(this.m_ulDefaultChatID);
}
GetChatRoom(e) {
return this.m_mapRooms.get(e);
}
OnConnectionRestored(e) {
e && this.UnloadGroupState(), this.m_mapRooms.forEach((e) => e.OnConnectionRestored());
}
OnRoomStateChange(e) {
this.UpdateChatRoomState(e.default_chat_id(), e.chat_rooms());
}
OnActivate() {
if (!this.m_rtLastAck || this.hasUnreadChatMessage) {
let e = 0;
this.m_mapRooms.forEach((t) => {
t.time_last_message && (e = Math.max(e, t.time_last_message));
}),
(this.m_rtLastAck = e || _.Ul.GetServerRTime32());
let t = h.gA.Init(u.ig);
t.Body().set_chat_group_id(this.m_ulGroupID), t.Body().set_timestamp(this.m_rtLastAck), u.Xn.AckChatMessage(_.Ul.CMInterface.GetServiceTransport(), t);
}
}
InviteFriend(e, t) {
let n = c.K.InitFromAccountID(e),
i = h.gA.Init(u.xT);
i.Body().set_chat_group_id(this.m_ulGroupID),
i.Body().set_steamid(n.ConvertTo64BitString()),
t && i.Body().set_chat_id(t.GetRoomID()),
u.Xn.InviteFriendToChatRoomGroup(this.m_chatStore.CMInterface.GetServiceTransport(), i).then((e) => {
e.GetEResult();
});
}
SaveChatRoomGroup(e) {
let t = h.gA.Init(u.Rz);
return (
t.Body().set_chat_group_id(this.m_ulGroupID),
t.Body().set_name(e),
u.Xn.SaveChatRoomGroup(this.m_chatStore.CMInterface.GetServiceTransport(), t).then((e) => {
let t = e.GetEResult();
if (1 != t) throw t;
})
);
}
RenameChatRoomGroup(e) {
if (!e) return Promise.resolve(2);
let t = this.m_strName;
this.m_strName = e;
let n = h.gA.Init(u.E9);
return n.Body().set_chat_group_id(this.m_ulGroupID), n.Body().set_name(e), u.Xn.RenameChatRoomGroup(this.m_chatStore.CMInterface.GetServiceTransport(), n).then((e) => (1 != e.GetEResult() && (this.m_strName = t), e.GetEResult()));
}
SetChatRoomGroupTagline(e) {
let t = this.m_strTagLine;
if ((e.length > 255 && (e = e.substring(0, 255)), e == this.m_strTagLine)) return Promise.resolve();
this.m_strTagLine = e;
let n = h.gA.Init(u.Yv);
return (
n.Body().set_chat_group_id(this.m_ulGroupID),
n.Body().set_tagline(e),
u.Xn.SetChatRoomGroupTagline(this.m_chatStore.CMInterface.GetServiceTransport(), n).then((e) => {
1 != e.GetEResult() && (this.m_strTagLine = t);
})
);
}
SetChatRoomGroupWatchingBroadcast(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
if (e == this.m_unWatchingBroadcastAccountID && !t) return Promise.resolve();
let n = h.gA.Init(u.Sm);
n.Body().set_chat_group_id(this.m_ulGroupID), n.Body().set_watching_broadcast_accountid(e), t && n.Body().set_watching_broadcast_channel_id(t);
const i = (yield u.Xn.SetChatRoomGroupWatchingBroadcast(this.m_chatStore.CMInterface.GetServiceTransport(), n)).GetEResult();
if (1 !== i) throw i;
(this.m_unWatchingBroadcastAccountID = e), (this.m_strWatchingBroadcastChannelID = t);
});
}
SetChatRoomGroupAvatar(e) {
if (e == this.m_strAvatarSHA) return Promise.resolve();
let t = h.gA.Init(u.SS);
return (
t.Body().set_chat_group_id(this.m_ulGroupID),
t.Body().set_avatar_sha((0, g.$x)(e)),
u.Xn.SetChatRoomGroupAvatar(this.m_chatStore.CMInterface.GetServiceTransport(), t).then((t) => {
let n = t.GetEResult();
if (1 != n) throw n;
this.m_strAvatarSHA = e;
})
);
}
BCanInvite() {
return this.BCanIPerformAction(4);
}
BCanBan() {
return this.BCanIPerformAction(3);
}
BCanKick() {
return this.BCanIPerformAction(2);
}
BCanAdminChannel() {
return this.BCanIPerformAction(1);
}
BCanAdminGroup() {
return this.BCanIPerformAction(5);
}
BCanChat() {
return this.BCanIPerformAction(6);
}
BCanEditRoles() {
return !this.BIsClanChatRoom() && this.BCanIPerformAction(9);
}
get members_to_highlight_name() {
return this.InternalGetMembersToHighlight(3, !0);
}
get members_to_highlight() {
return this.InternalGetMembersToHighlight(4, !1);
}
InternalGetMembersToHighlight(e, t) {
const n = !t,
i = !!this.m_rtTimeJoined;
let o = this.m_bFullStateLoaded ? this.m_groupMembers.unfiltered_count : this.m_cMemberSummaryCount;
const r = o > e ? e - 1 : e;
let a = _.Ul.FriendStore,
s = a.self,
l = [],
c = a.GetPlayer(this.GetOwnerAccountID());
if ((c && c.accountid != s.accountid && l.push(c), this.m_rgGroupMembersSummary)) {
for (let e of this.m_rgGroupMembersSummary) {
if (e == s.accountid || this.BIsAccountIDOwner(e)) continue;
let n = a.GetFriendIfCached(e);
if (n && (t || n.persona.BHasAvatarSet()) && (l.push(n), l.length >= r)) break;
}
if (n && l.length < r)
for (let e of this.m_rgGroupMembersSummary) {
if (e == s.accountid || this.BIsAccountIDOwner(e)) continue;
let n = a.GetPlayer(e);
if (n && !n.is_friend && (t || n.persona.BHasAvatarSet()) && (l.push(n), l.length >= r)) break;
}
}
return i && l.length < r && l.push(s), { members: l, remaining_count: o - l.length };
}
SetUserBanState(e, t) {
let n = c.K.InitFromAccountID(e).ConvertTo64BitString(),
i = h.gA.Init(u.NQ);
return (
i.Body().set_chat_group_id(this.m_ulGroupID),
i.Body().set_steamid(n),
i.Body().set_ban_state(t),
u.Xn.SetUserBanState(this.m_chatStore.CMInterface.GetServiceTransport(), i).then((e) => {
let t = e.GetEResult();
if (1 != t && 29 != t) throw ((0, f.X)(!1, `Failed to change ban state ${t}`), t);
})
);
}
MuteUser(e, t) {
let n = c.K.InitFromAccountID(e).ConvertTo64BitString(),
i = h.gA.Init(u.l);
return (
i.Body().set_chat_group_id(this.m_ulGroupID),
i.Body().set_steamid(n),
i.Body().set_expiration(t),
u.Xn.MuteUserInGroup(this.m_chatStore.CMInterface.GetServiceTransport(), i).then((e) => {
let t = e.GetEResult();
if (1 != t) throw ((0, f.X)(!1, `Failed to change muteexpiration ${t}`), t);
})
);
}
KickUser(e, t) {
let n = c.K.InitFromAccountID(e).ConvertTo64BitString(),
i = h.gA.Init(u.LA);
return (
i.Body().set_chat_group_id(this.m_ulGroupID),
i.Body().set_steamid(n),
i.Body().set_expiration(t),
u.Xn.KickUserFromGroup(this.m_chatStore.CMInterface.GetServiceTransport(), i).then((e) => {
let t = e.GetEResult();
if (1 != t) throw (this.LOG(`Kick returned ${t}`), t);
})
);
}
RevokeInvite(e) {
let t = c.K.InitFromAccountID(e).ConvertTo64BitString(),
n = h.gA.Init(u.H0);
return (
n.Body().set_chat_group_id(this.m_ulGroupID),
n.Body().set_steamid(t),
u.Xn.RevokeInviteToGroup(this.m_chatStore.CMInterface.GetServiceTransport(), n).then((e) => {
let t = e.GetEResult();
if (1 != t) throw (this.LOG(`RevokeInvite returned ${t}`), t);
})
);
}
CreateChatRoom(e, t) {
let n = h.gA.Init(u.vx);
return (
n.Body().set_chat_group_id(this.m_ulGroupID),
n.Body().set_name(e),
n.Body().set_allow_voice(t),
u.Xn.CreateChatRoom(this.m_chatStore.CMInterface.GetServiceTransport(), n).then((e) => {
let t = e.Body().chat_room().chat_id();
if (1 != e.GetEResult() || "" == t || "0" == t) throw ((0, f.X)(!1, "Failed to create chat room"), new Error("Failed to create chat room"));
return this.AddCreatedRoom(t, e.Body().chat_room());
})
);
}
CreateAndJoinTempVoiceRoom() {
this.CreateChatRoom("", !0)
.then((e) => {
e.StartVoiceChat();
})
.catch(() => {});
}
AddCreatedRoom(e, t) {
let n = this.m_mapRooms.get(e);
return n || ((n = new l.K(this.m_chatStore, this, e, !1)), this.m_mapRooms.set(e, n)), n.UpdateChatState(t), n;
}
RenameRoom(e, t) {
if (e == this.m_ulDefaultChatID) return;
if (!t) return;
let n = this.GetChatRoom(e);
if (!n) return;
let i = n.name;
n.ChangeNameWhileWaitingForRenameRequest(t);
let o = h.gA.Init(u.YT);
o.Body().set_chat_group_id(this.m_ulGroupID),
o.Body().set_chat_id(e),
o.Body().set_name(t),
u.Xn.RenameChatRoom(this.m_chatStore.CMInterface.GetServiceTransport(), o).then((e) => {
1 == e.GetEResult() || ((0, f.X)(!1, "Failed to change room name"), n.ChangeNameWhileWaitingForRenameRequest(i));
});
}
ReorderRoom(e, t) {
let n = h.gA.Init(u.nw);
n.Body().set_chat_group_id(this.m_ulGroupID),
n.Body().set_chat_id(e),
n.Body().set_move_after_chat_id(t),
u.Xn.ReorderChatRoom(this.m_chatStore.CMInterface.GetServiceTransport(), n).then((e) => {
1 == e.GetEResult() || (0, f.X)(!1, "Failed to reorder room");
});
}
DeleteChatRoom(e) {
let t = h.gA.Init(u.YS);
t.Body().set_chat_group_id(this.m_ulGroupID),
t.Body().set_chat_id(e),
u.Xn.DeleteChatRoom(this.m_chatStore.CMInterface.GetServiceTransport(), t).then((t) => {
1 == t.GetEResult() ? this.RemoveRoom(e) : (0, f.X)(!1, "Failed to delete chat room");
});
}
RemoveRoom(e) {
this.m_mapRooms.delete(e);
}
LeaveChatRoomGroup(e) {
this.m_chatStore.LeaveChatRoomGroup(e, this.m_ulGroupID).catch(() => {});
}
GetInviteLinksForGroup() {
let e = h.gA.Init(u.At);
return (
e.Body().set_chat_group_id(this.GetGroupID()),
u.Xn.GetInviteLinksForGroup(_.Ul.ChatStore.CMInterface.GetServiceTransport(), e).then((e) => {
let t;
return (t = 1 != e.GetEResult() ? { loadingState: "failed", rgInviteLinks: null } : { loadingState: "loaded", rgInviteLinks: e.Body().invite_links() }), t;
})
);
}
GetInvitedUsersForGroup() {
let e = h.gA.Init(u.G4);
return (
e.Body().set_chat_group_id(this.GetGroupID()),
u.Xn.GetInviteList(_.Ul.ChatStore.CMInterface.GetServiceTransport(), e).then((e) => {
let t;
return (t = 1 != e.GetEResult() ? { loadingState: "failed", rgInvitedUsers: null } : { loadingState: "loaded", rgInvitedUsers: e.Body().invites() }), t;
})
);
}
GetBanList() {
let e = h.gA.Init(u.Qx);
return (
e.Body().set_chat_group_id(this.GetGroupID()),
u.Xn.GetBanList(_.Ul.ChatStore.CMInterface.GetServiceTransport(), e).then((e) => {
let t = new w();
return 15 == e.GetEResult() ? (t.loadingState = "denied") : 1 == e.GetEResult() ? ((t.rgBans = e.Body().bans()), (t.loadingState = "loaded")) : (t.loadingState = "failed"), t;
})
);
}
GetRoleName(e) {
let t = this.m_roles.findIndex((t) => t.role_id == e);
if (t >= 0) return this.m_roles[t].name;
}
CreateRole(e) {
if (0 == (e = e.trim()).length) return Promise.resolve();
let t = h.gA.Init(u.NU);
return (
t.Body().set_chat_group_id(this.GetGroupID()),
t.Body().set_name(e),
this.m_roles.push({ role_id: "-1", name: e, ordinal: Number.MAX_VALUE }),
u.Xn.CreateRole(_.Ul.ChatStore.CMInterface.GetServiceTransport(), t).then((t) => {
let n = t.GetEResult();
if (1 != n) {
let e = this.m_roles.findIndex((e) => "-1" == e.role_id);
throw (e >= 0 && this.m_roles.splice(e, 1), new Error(`unable to create role, error ${n}`));
}
this.LOG(`created role ${e}`);
})
);
}
DeleteRole(e) {
let t = h.gA.Init(u.A_);
return (
t.Body().set_chat_group_id(this.GetGroupID()),
t.Body().set_role_id(e),
u.Xn.DeleteRole(_.Ul.ChatStore.CMInterface.GetServiceTransport(), t).then((t) => {
if (1 != t.GetEResult()) throw new Error(`unable to delete role ${e}`);
let n = this.m_roles.findIndex((t) => t.role_id == e);
n >= 0 && this.m_roles.splice(n, 1);
})
);
}
RenameRole(e, t) {
if (0 == (t = t.trim()).length) return Promise.resolve();
let n = h.gA.Init(u.zT);
return (
n.Body().set_chat_group_id(this.GetGroupID()),
n.Body().set_role_id(e),
n.Body().set_name(t),
u.Xn.RenameRole(_.Ul.ChatStore.CMInterface.GetServiceTransport(), n).then((n) => {
let i = n.GetEResult();
if (1 != i) throw new Error(`unable to rename role ${e} ${i}`);
let o = this.m_roles.findIndex((t) => t.role_id == e);
o >= 0 && (this.m_roles[o].name = t);
})
);
}
ReorderRole(e, t) {
let n = h.gA.Init(u.uB);
return n.Body().set_chat_group_id(this.GetGroupID()), n.Body().set_role_id(e), n.Body().set_ordinal(t), u.Xn.ReorderRole(_.Ul.ChatStore.CMInterface.GetServiceTransport(), n).then((e) => 1 == e.GetEResult());
}
SetRoleAction(e, t, n) {
let i = this.GetRoleActions(e);
if (i) {
if (n == i.BCanPerformAction(t)) return;
let o = i.BCanPerformAction(t);
i.SetCanPerformAction(t, n);
let r = h.gA.Init(u.m3);
return (
r.Body().set_chat_group_id(this.GetGroupID()),
r.Body().set_role_id(e),
r.Body().set_actions(i.roleActions),
u.Xn.ReplaceRoleActions(_.Ul.ChatStore.CMInterface.GetServiceTransport(), r).then((e) => {
1 != e.GetEResult() && (i.SetCanPerformAction(t, o), this.LOG(`SetRoleAction error, restoring ${t} to ${o}`));
})
);
}
}
DeleteInviteLink(e, t) {
let n = h.gA.Init(u.qu);
if ((n.Body().set_chat_group_id(this.GetGroupID()), n.Body().set_invite_code(e), t && "loaded" == t.loadingState)) {
let n = t.rgInviteLinks.findIndex((t) => t.invite_code() == e);
n >= 0 && (t.rgInviteLinks.splice(n, 1), this.LOG(`removed link ${t.rgInviteLinks}`));
}
return u.Xn.DeleteInviteLink(_.Ul.ChatStore.CMInterface.GetServiceTransport(), n).then((e) => 1 == e.GetEResult());
}
SetNotificationPreferences(e, t, n) {
let i = h.gA.Init(u.x1);
return i.Body().set_chat_group_id(this.m_ulGroupID), void 0 !== e && ((this.m_eUserDesktopNotificationLevel = e), i.Body().chat_group_preferences().set_desktop_notification_level(e), 4 == e && this.m_bUnreadIndicatorMuted && (n = !1)), void 0 !== t && ((this.m_eUserMobileNotificationLevel = t), i.Body().chat_group_preferences().set_mobile_notification_level(t)), void 0 !== n && ((this.m_bUnreadIndicatorMuted = n), i.Body().chat_group_preferences().set_unread_indicator_muted(n)), u.Xn.SetUserChatGroupPreferences(_.Ul.CMInterface.GetServiceTransport(), i).then((e) => 1 == e.GetEResult());
}
AddMetaMentionsToResults(e, t) {
let n = this.BCanIMentionAll() ? "" : (0, d.Xx)("#ChatMentionSuggest_NoPermission");
"online".startsWith(e) && t.unshift({ friend: null, iMatchOffset: 0, bNicknameMatch: !1, meta_mention: "online", strNotSelectable: n }), "all".startsWith(e) && t.unshift({ friend: null, iMatchOffset: 0, bNicknameMatch: !1, meta_mention: "all", strNotSelectable: n });
}
SearchMembers(e, t = 5, n = !1) {
let i = [],
o = e.toLocaleLowerCase(),
r = this.m_chatStore.CMInterface.steamid.GetAccountID(),
a = [],
s = [];
for (let e of this.memberList.member_list)
if (e.accountid != r) {
if (o.length) {
let t = e.MatchSearchString(o),
i = 0 === t.iOffset;
if (0 == t.match || (n && !i)) continue;
let r = { friend: e, iMatchOffset: t.iOffset, bNicknameMatch: 2 == t.match };
i ? (t.bFullMatch ? a.unshift(r) : a.push(r)) : s.push(r);
} else i.push({ friend: e, iMatchOffset: 0, bNicknameMatch: !1 });
if (i.length + a.length >= t) break;
}
for (let e = 0; e < a.length && i.length < t; e++) i.push(a[e]);
for (let e = 0; e < s.length && i.length < t; e++) i.push(s[e]);
return i;
}
BNameMatchesSearch(e) {
return -1 != this.name.toLocaleLowerCase().indexOf(e);
}
}
(0, i.gn)([m.LO], E.prototype, "m_rtTimeJoined", void 0),
(0, i.gn)([m.LO], E.prototype, "m_rtLastAck", void 0),
(0, i.gn)([m.LO], E.prototype, "m_unOwnerAccountID", void 0),
(0, i.gn)([m.LO], E.prototype, "m_bFullStateLoaded", void 0),
(0, i.gn)([m.LO], E.prototype, "m_strName", void 0),
(0, i.gn)([m.LO], E.prototype, "m_strTagLine", void 0),
(0, i.gn)([m.LO], E.prototype, "m_strAvatarSHA", void 0),
(0, i.gn)([m.LO], E.prototype, "m_strAvatarUGCURL", void 0),
(0, i.gn)([m.LO], E.prototype, "m_unWatchingBroadcastAccountID", void 0),
(0, i.gn)([m.LO], E.prototype, "m_strWatchingBroadcastChannelID", void 0),
(0, i.gn)([m.LO], E.prototype, "m_rgPartyBeacons", void 0),
(0, i.gn)([m.LO], E.prototype, "m_eUserDesktopNotificationLevel", void 0),
(0, i.gn)([m.LO], E.prototype, "m_eUserMobileNotificationLevel", void 0),
(0, i.gn)([m.LO], E.prototype, "m_bUnreadIndicatorMuted", void 0),
(0, i.gn)([m.LO], E.prototype, "m_roles", void 0),
(0, i.gn)([m.LO], E.prototype, "m_rgGroupMembersSummary", void 0),
(0, i.gn)([m.LO], E.prototype, "m_cMemberSummaryCount", void 0),
(0, i.gn)([m.LO], E.prototype, "m_bMemberListVirtualized", void 0),
(0, i.gn)([m.Fl], E.prototype, "name", null),
(0, i.gn)([m.Fl], E.prototype, "hasAvatarSHA", null),
(0, i.gn)([m.Fl], E.prototype, "hasIcon", null),
(0, i.gn)([m.Fl], E.prototype, "avatar_url_small", null),
(0, i.gn)([m.Fl], E.prototype, "avatar_url_medium", null),
(0, i.gn)([m.Fl], E.prototype, "avatar_url_full", null),
(0, i.gn)([m.Fl], E.prototype, "chatRoomList", null),
(0, i.gn)([m.Fl], E.prototype, "textRoomList", null),
(0, i.gn)([m.Fl], E.prototype, "voiceRoomList", null),
(0, i.gn)([m.Fl], E.prototype, "hasVoiceRoom", null),
(0, i.gn)([m.Fl], E.prototype, "hasUnreadChatMessage", null),
(0, i.gn)([m.Fl], E.prototype, "HasUnreadMention", null),
(0, i.gn)([m.Fl], E.prototype, "time_last_activity", null),
(0, i.gn)([m.Fl], E.prototype, "room_with_last_message", null),
(0, i.gn)([m.aD], E.prototype, "ChangeMemberRank", null),
(0, i.gn)([m.aD], E.prototype, "ChangeMemberRoles", null),
(0, i.gn)([m.aD], E.prototype, "SetInitialGroupState", null),
(0, i.gn)([m.aD], E.prototype, "UpdateGroupStateFromSummary", null),
(0, i.gn)([m.aD], E.prototype, "SetNameCheckingForAppLocalization", null),
(0, i.gn)([m.aD], E.prototype, "UpdateGroupState", null),
(0, i.gn)([m.aD], E.prototype, "UnloadActiveGroupState", null),
(0, i.gn)([m.aD], E.prototype, "UnloadGroupState", null),
(0, i.gn)([m.aD], E.prototype, "UnloadAndResetGroupState", null),
(0, i.gn)([m.aD], E.prototype, "UpdateChatRoomState", null),
(0, i.gn)([m.aD], E.prototype, "UpdateUserState", null),
(0, i.gn)([m.aD], E.prototype, "UpdateChatRoomHeaderState", null),
(0, i.gn)([m.aD], E.prototype, "OnActivate", null),
(0, i.gn)([m.Fl], E.prototype, "members_to_highlight_name", null),
(0, i.gn)([m.Fl], E.prototype, "members_to_highlight", null),
(0, i.gn)([m.aD], E.prototype, "AddCreatedRoom", null),
(0, i.gn)([m.aD], E.prototype, "RemoveRoom", null);
class D extends b.Q {
constructor(e, t) {
super(),
(this.LOG = new a.sO("ChatRoomGroup", () => this.GetUniqueID()).Debug),
(this.m_mapChatViews = new Map()),
(this.m_selectedChatView = void 0),
(this.m_popoverChatView = void 0),
(this.m_bShowSettingsDialog = !1),
(this.m_ulRenameChatRoomID = void 0),
(this.m_bShowBroadcast = !1),
(this.m_bShowVerticalBroadcastChat = void 0),
(this.m_strLocalBroadcastId = void 0),
(this.m_bChatHidden = !1),
(this.m_bShowGlobalChat = !1),
(this.m_bMemberSearchActive = !1),
(this.m_strMemberSearchString = ""),
(this.m_rgSearchResults = []),
(this.m_bSearchError = !1),
(this.m_bMemberListCollapsedOverride = void 0),
(this.m_bChannelListCollapsedOverride = void 0),
(0, m.rC)(this),
(this.m_tabset = e),
(this.m_group = t),
this.m_group.BIsValid() && this.SelectChat(this.m_group.GetDefaultChatID()),
(this.m_disposeChatRooms = (0, m.EH)(() => {
let e = this.m_group.chatRoomList;
this.m_selectedChatView && e.length && e.indexOf(this.m_selectedChatView.chat) < 0 && this.SelectChat(this.m_group.GetDefaultChatID());
}));
}
get search_results() {
return this.m_rgSearchResults;
}
get has_search_error() {
return this.m_bSearchError;
}
GetGroup() {
return this.m_group;
}
GetSelectedChatView() {
return this.m_selectedChatView;
}
GetActiveChatView() {
return this.GetPopoverChatView() || this.GetSelectedChatView();
}
GetPopoverChatView() {
return this.m_popoverChatView;
}
get isBroadcastShown() {
return this.m_bShowBroadcast;
}
ShowBroadcast() {
(this.m_bShowBroadcast = !0), this.SetLayoutForBroadcast();
}
SetLayoutForBroadcast() {
this.SetChannelListCollapsed(!0, !1),
this.SetMemberListCollapsed(!0, !1),
SetBackgroundTimeout(() => {
this.GetActiveChatView() && this.GetActiveChatView().OnChatFrameChanged();
}, 30);
}
HideBroadcast() {
(this.m_bShowBroadcast = !1), this.SetLayoutForHiddenBroadcast();
}
SetLayoutForHiddenBroadcast() {
_.Ul.UIStore.SetTheaterMode(!1),
SetBackgroundTimeout(() => {
this.GetActiveChatView() && this.GetActiveChatView().OnChatFrameChanged();
}, 30);
}
SetVerticalBroadcastChat(e) {
this.m_bShowVerticalBroadcastChat = e;
}
ToggleTheaterModeBroadcastChat() {
_.Ul.UIStore.SetTheaterMode(!_.Ul.UIStore.GetTheaterMode());
}
SetChatHidden(e) {
this.m_bChatHidden = e;
}
SetGlobalBroadcastChatShown(e) {
(this.m_bShowGlobalChat = e), this.GetActiveChatView() && this.GetActiveChatView().OnChatFrameChanged();
}
SetLocalBroadcastId(e) {
this.m_strLocalBroadcastId = e;
}
SetMemberListCollapsed(e, t = !0) {
if (t) {
this.m_bMemberListCollapsedOverride = void 0;
const t = this.GetGroup();
_.Ul.ChatStore.ChatRoomGroupDisplayPrefs.SetChatRoomDisplayPref(t.GetGroupID(), "bMemberListCollapsed", e);
} else this.m_bMemberListCollapsedOverride = e;
}
SetChannelListCollapsed(e, t = !0) {
if (t) {
this.m_bChannelListCollapsedOverride = void 0;
const t = this.GetGroup();
_.Ul.ChatStore.ChatRoomGroupDisplayPrefs.SetChatRoomDisplayPref(t.GetGroupID(), "bChannelListCollapsed", e);
} else this.m_bChannelListCollapsedOverride = e;
}
ClosePopoverChat() {
this.m_popoverChatView && (this.m_popoverChatView.OnViewClosed(), this.m_disposeActiveVoice && this.m_disposeActiveVoice(), (this.m_popoverChatView = null));
}
SelectChat(e) {
let t = this.m_group.GetChatRoom(e);
if (t) {
if (t.GetVoiceAllowed() && t != this.m_group.GetDefaultChatRoom()) {
if (this.m_popoverChatView && this.m_popoverChatView.chat == t) return;
} else if ((this.ClosePopoverChat(), this.m_selectedChatView && this.m_selectedChatView.chat == t)) return;
t.GetVoiceAllowed() && this.m_group.GetDefaultChatRoom() != t && !_.Ul.IsGamepadUIActive()
? (this.ClosePopoverChat(),
(this.m_popoverChatView = this.GetChatViewForRoom(t)),
this.m_disposeActiveVoice && this.m_disposeActiveVoice(),
(this.m_disposeActiveVoice = (0, m.gx)(
() => !t.BVoiceActive(),
() => {
this.m_popoverChatView && this.m_popoverChatView.chat == t && this.ClosePopoverChat();
},
)))
: (this.m_selectedChatView && this.m_selectedChatView.OnViewClosed(), (this.m_selectedChatView = this.GetChatViewForRoom(t))),
this.m_tabset.activeTab == this && this.m_tabset.is_popup_focused && this.OnTabActivate();
}
}
SelectNextChannel() {
const e = this.GetSelectedChannelIndex(),
t = this.GetGroup().textRoomList,
n = e >= t.length - 1 ? 0 : e + 1;
this.SelectChat(t[n].GetRoomID());
}
SelectPreviousChannel() {
const e = this.GetSelectedChannelIndex(),
t = this.GetGroup().textRoomList,
n = e <= 0 ? t.length - 1 : e - 1;
this.SelectChat(t[n].GetRoomID());
}
GetSelectedChannelIndex() {
const e = this.GetSelectedChatView().chat.GetRoomID();
return this.GetGroup().textRoomList.findIndex((t) => t.GetRoomID() === e);
}
GetChatViewForRoom(e) {
let t = e.GetRoomID(),
n = this.m_mapChatViews.get(t);
return n ? this.LOG(`reusing chat for ${t}`) : (n = new s.R5(this.m_tabset, e, this)), n;
}
StartRoomRename(e) {
this.m_ulRenameChatRoomID = e;
}
EndRoomRename() {
this.m_ulRenameChatRoomID = "";
}
IsRoomRenameActive(e) {
return "" != this.m_ulRenameChatRoomID && this.m_ulRenameChatRoomID == e;
}
GetRenameRoomID() {
return this.m_ulRenameChatRoomID;
}
OnTabClosed() {
this.m_disposeActiveVoice && this.m_disposeActiveVoice(), this.m_disposeChatRooms && this.m_disposeChatRooms(), this.m_VirtualizedMemberList && _.Ul.ChatStore.UnregisterVirtualizedMemberListView(this.m_VirtualizedMemberList), this.ClosePopoverChat(), this.GetSelectedChatView().OnViewClosed(), _.Ul.ChatStore.DecRefActiveChatRoomGroup(this.GetGroup().GetGroupID());
}
IsVoiceActive() {
return _.Ul.ChatStore.VoiceChat.GetActiveChatRoomGroupID() == this.m_group.GetGroupID();
}
IsTabForChat(e) {
if (!(e instanceof l.K)) return !1;
let t = e;
return !!this.m_group.GetChatRoom(t.GetRoomID());
}
GetUnreadMessageCount() {
return this.m_group.hasUnreadChatMessage ? 1 : 0;
}
UpdateMemberSearch(e) {
(this.m_bMemberSearchActive && this.m_strMemberSearchString == e) ||
((this.m_bMemberSearchActive = !0),
(this.m_strMemberSearchString = e || ""),
e
? this.SearchMembers(e, 200).then(
(e) => {
(this.m_rgSearchResults = e), (this.m_bSearchError = !1);
},
(e) => {
console.warn(`Failed to filter members: ${e}`), (this.m_bSearchError = !0);
},
)
: (this.m_rgSearchResults = void 0));
}
ClearMemberSearch() {
(this.m_bMemberSearchActive = !1), (this.m_strMemberSearchString = ""), (this.m_rgSearchResults = void 0);
}
IsMemberSearchActive() {
return this.m_bMemberSearchActive;
}
GetMemberSearch() {
return this.m_strMemberSearchString;
}
get normalizedMemberSearch() {
return this.m_strMemberSearchString.trim().toLocaleLowerCase();
}
get isMemberListExpanded() {
if (this.m_bMemberSearchActive) return !0;
if (void 0 === this.m_bMemberListCollapsedOverride) {
const e = this.GetGroup();
return !_.Ul.ChatStore.ChatRoomGroupDisplayPrefs.GetChatRoomDisplayPref(e.GetGroupID(), "bMemberListCollapsed");
}
return !this.m_bMemberListCollapsedOverride;
}
get isChannelListCollapsed() {
if (void 0 === this.m_bChannelListCollapsedOverride) {
const e = this.GetGroup();
return _.Ul.ChatStore.ChatRoomGroupDisplayPrefs.GetChatRoomDisplayPref(e.GetGroupID(), "bChannelListCollapsed");
}
return this.m_bChannelListCollapsedOverride;
}
GetTabName() {
return this.m_group.name;
}
GetUniqueID() {
return this.m_group.unique_id;
}
OnTabFocus() {
let e = this.GetActiveChatView();
e && e.OnFocus();
}
InternalOnTabActivate() {
let e = this.GetActiveChatView();
e && e.OnActivate();
}
OnTabDeactivate() {
let e = this.GetActiveChatView();
e && e.OnDeactivate();
}
IsChatRoom() {
return !0;
}
GetChatView() {
return this.GetActiveChatView();
}
GetMemberCountTotal() {
return this.m_group.BIsMemberListVirtualized() ? this.GetVirtualizedMemberListView().GetMemberCountTotal() : this.m_group.memberCountTotal;
}
GetMemberCountOnline() {
return this.m_group.BIsMemberListVirtualized() ? this.GetVirtualizedMemberListView().GetMemberCountOnline() : this.m_group.memberCountOnline;
}
GetMemberCountInGame() {
return this.m_group.BIsMemberListVirtualized() ? this.GetVirtualizedMemberListView().GetMemberCountInGame() : this.m_group.memberCountInGame;
}
GetVirtualizedMemberListView() {
return this.m_VirtualizedMemberList || ((this.m_VirtualizedMemberList = new v(this.m_group.GetGroupID())), _.Ul.ChatStore.RegisterVirtualizedMemberListView(this.m_VirtualizedMemberList)), this.m_VirtualizedMemberList;
}
SearchMembers(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
return this.m_group.BIsMemberListVirtualized() ? this.GetVirtualizedMemberListView().PerformSearch(this.m_group, "1", e) : this.m_group.SearchMembers(e, t);
});
}
BIsMemberNameAmbiguous(e) {
if (this.m_group.BIsMemberListVirtualized()) return !0;
return this.m_group.SearchMembers(e, 2, !0).length >= 2;
}
ProcessMentions(e) {
e.replace(/@/g, "@");
let t = e.indexOf("@");
for (; -1 !== t; ) {
let n,
i,
o,
r = e.indexOf("@", t + 1),
a = e.indexOf(" ", t + 1),
s = Math.min(-1 === r ? e.length : r, -1 === a ? e.length : a),
l = e.substr(t + 1, s - t - 1).toLocaleLowerCase();
o = this.m_group.BIsMemberListVirtualized() ? this.GetVirtualizedMemberListView().GetAllKnownPersonas() : this.m_group.memberList.member_list_unsorted;
for (let r of o) {
let o = (0, S.Ao)(r.player_name_normalized),
a = o + "#" + r.accountid.toString(36);
if (a.startsWith(l)) {
let s,
c = a.length === l.length,
m = c || o.length === l.length;
(m || c) && (s = l.length), !c && e.length - t - 1 >= a.length && e.substr(t + 1, a.length).toLocaleLowerCase() === a && ((m = c = !0), (s = a.length)), !m && e.length - t - 1 >= o.length && e.substr(t + 1, o.length).toLocaleLowerCase() === o && (s = o.length), s && (void 0 === i || s >= i) && ((n = r), (i = s));
}
}
let c,
m,
d,
h = !1;
if ((this.m_group.BCanIMentionAll() && (h = "online" == l || "online#0" == l || "all" == l || "all#0" == l), h && (void 0 === i || i <= l.length))) {
let e = l;
-1 !== l.indexOf("#") && (e = l.substr(0, l.indexOf("#"))), (c = e), (m = e), (d = l.length), "online" == c && (c = "here");
} else n && void 0 !== i && ((c = "" + n.accountid), (m = n.persona.m_strPlayerName), (d = i));
if (m && void 0 !== d) {
let n = e.substr(0, t),
i = e.substr(t + 1 + d),
o = `[mention=${c}]@${(0, S.Ao)(m)}[/mention]`;
r = (e = n + o + i).indexOf("@", n.length + o.length);
}
t = r;
}
return e;
}
}
(0, i.gn)([m.LO], D.prototype, "m_selectedChatView", void 0),
(0, i.gn)([m.LO], D.prototype, "m_popoverChatView", void 0),
(0, i.gn)([m.LO], D.prototype, "m_bShowSettingsDialog", void 0),
(0, i.gn)([m.LO], D.prototype, "m_ulRenameChatRoomID", void 0),
(0, i.gn)([m.LO], D.prototype, "m_bShowBroadcast", void 0),
(0, i.gn)([m.LO], D.prototype, "m_bShowVerticalBroadcastChat", void 0),
(0, i.gn)([m.LO], D.prototype, "m_strLocalBroadcastId", void 0),
(0, i.gn)([m.LO], D.prototype, "m_bChatHidden", void 0),
(0, i.gn)([m.LO], D.prototype, "m_bShowGlobalChat", void 0),
(0, i.gn)([m.LO], D.prototype, "m_bMemberSearchActive", void 0),
(0, i.gn)([m.LO], D.prototype, "m_strMemberSearchString", void 0),
(0, i.gn)([m.LO.ref], D.prototype, "m_rgSearchResults", void 0),
(0, i.gn)([m.LO], D.prototype, "m_bSearchError", void 0),
(0, i.gn)([m.LO], D.prototype, "m_bMemberListCollapsedOverride", void 0),
(0, i.gn)([m.LO], D.prototype, "m_bChannelListCollapsedOverride", void 0),
(0, i.gn)([m.aD], D.prototype, "ShowBroadcast", null),
(0, i.gn)([m.aD.bound], D.prototype, "HideBroadcast", null),
(0, i.gn)([m.aD.bound], D.prototype, "SetVerticalBroadcastChat", null),
(0, i.gn)([m.aD], D.prototype, "ToggleTheaterModeBroadcastChat", null),
(0, i.gn)([m.aD], D.prototype, "SetChatHidden", null),
(0, i.gn)([m.aD], D.prototype, "SetGlobalBroadcastChatShown", null),
(0, i.gn)([m.aD], D.prototype, "SetLocalBroadcastId", null),
(0, i.gn)([m.aD], D.prototype, "SetMemberListCollapsed", null),
(0, i.gn)([m.aD], D.prototype, "SetChannelListCollapsed", null),
(0, i.gn)([m.aD], D.prototype, "ClosePopoverChat", null),
(0, i.gn)([m.aD], D.prototype, "SelectChat", null),
(0, i.gn)([m.aD], D.prototype, "SelectNextChannel", null),
(0, i.gn)([m.aD], D.prototype, "SelectPreviousChannel", null),
(0, i.gn)([m.aD], D.prototype, "StartRoomRename", null),
(0, i.gn)([m.aD], D.prototype, "EndRoomRename", null),
(0, i.gn)([m.aD], D.prototype, "OnTabClosed", null),
(0, i.gn)([m.aD], D.prototype, "UpdateMemberSearch", null),
(0, i.gn)([m.aD], D.prototype, "ClearMemberSearch", null),
(0, i.gn)([m.Fl], D.prototype, "isMemberListExpanded", null),
(0, i.gn)([m.Fl], D.prototype, "isChannelListCollapsed", null);
class w {
constructor() {
(this.loadingState = "pending"), (this.rgBans = void 0), (0, m.rC)(this);
}
}
(0, i.gn)([m.LO], w.prototype, "loadingState", void 0), (0, i.gn)([m.LO], w.prototype, "rgBans", void 0);
const R = { bMemberListCollapsed: void 0, bChannelListCollapsed: void 0 },
A = "ChatRoomGroupDisplayPrefs";
class M {
constructor() {
(this.m_mapDisplayPrefs = m.LO.map()), (0, m.rC)(this);
}
Init(e) {
(this.m_SettingsStore = e),
this.m_SettingsStore.GetObjectFromLocalStorageWhenReady(A).then((e) => {
this.m_mapDisplayPrefs.clear();
for (let t in e.chatRoomGroups) {
const n = e.chatRoomGroups[t];
"object" == typeof n && (("boolean" != typeof n.bMemberListCollapsed && "boolean" != typeof n.bChannelListCollapsed) || this.m_mapDisplayPrefs.set(t, e.chatRoomGroups[t]));
}
});
}
GetChatRoomDisplayPref(e, t) {
return (this.m_mapDisplayPrefs.get(e) || R)[t];
}
ToggleChatRoomDisplayPref(e, t) {
let n = this.GetChatRoomDisplayPref(e, t);
this.SetChatRoomDisplayPref(e, t, !n);
}
SetChatRoomDisplayPref(e, t, n) {
let i = this.m_mapDisplayPrefs.get(e);
(i && i[t] === n) || (i || (this.m_mapDisplayPrefs.set(e, Object.assign({}, R)), (i = this.m_mapDisplayPrefs.get(e))), (i[t] = n), this.WritePrefs());
}
WritePrefs() {
this.m_SettingsStore.StoreObjectInLocalStorage(A, { chatRoomGroups: Object.fromEntries(this.m_mapDisplayPrefs) });
}
FillInChatUsabilityMetrics(e) {
let t = Array.from(this.m_mapDisplayPrefs.values());
e.ui_state().set_group_chat_left_col_collapsed(o.W(t, (e) => e.bChannelListCollapsed)), e.ui_state().set_group_chat_right_col_collapsed(o.W(t, (e) => e.bMemberListCollapsed));
}
}
(0, i.gn)([m.aD], M.prototype, "SetChatRoomDisplayPref", null);
class k {
constructor() {
(this.m_mapAccountToExtra = m.LO.map()), (this.m_bMemberDataVirtualized = !1), (0, m.rC)(this);
}
GetCurrentMemberSet() {
let e = new Set();
return (
this.m_mapAccountToExtra.forEach((t, n) => {
e.add(n);
}),
e
);
}
SetMemberDataVirtualized(e) {
this.m_bMemberDataVirtualized = e;
}
get unfiltered_count() {
return this.m_mapAccountToExtra.size;
}
get member_counts() {
let e = 0,
t = 0;
for (let n of this.member_list_unsorted) n.persona.is_online && (e++, n.persona.is_ingame && t++);
return { online: e, ingame: t };
}
Clear() {
this.m_mapAccountToExtra.clear(), (this.m_bMemberDataVirtualized = !1);
}
AddMember(e, t = void 0) {
this.HasMember(e) || this.m_mapAccountToExtra.set(e, t);
}
RemoveMember(e) {
this.HasMember(e) && this.m_mapAccountToExtra.delete(e);
}
GetExtra(e) {
return this.m_mapAccountToExtra.get(e);
}
HasMember(e) {
return this.m_mapAccountToExtra.has(e);
}
get member_list() {
let e = this.member_list_unsorted.slice();
return e.sort(p.Xp.DefaultFriendSortComparator), e;
}
get member_list_unsorted() {
(0, f.X)(!this.m_bMemberDataVirtualized, "Shouldn't be accessing member_list when virtualized");
let e = [];
return (
this.m_bMemberDataVirtualized ||
this.m_mapAccountToExtra.forEach((t, n) => {
e.push(_.Ul.FriendStore.GetPlayer(n));
}),
e
);
}
}
(0, i.gn)([m.Fl], k.prototype, "unfiltered_count", null), (0, i.gn)([m.Fl], k.prototype, "member_counts", null), (0, i.gn)([m.aD], k.prototype, "Clear", null), (0, i.gn)([m.aD], k.prototype, "AddMember", null), (0, i.gn)([m.aD], k.prototype, "RemoveMember", null), (0, i.gn)([m.Fl], k.prototype, "member_list", null), (0, i.gn)([m.Fl], k.prototype, "member_list_unsorted", null);
},
23346: (e, t, n) => {
"use strict";
n.d(t, { Yp: () => W, Xp: () => U, ji: () => X, Ev: () => P });
var i = n(85556),
o = n(19953),
r = n(1736),
a = n(70215),
s = n(23282),
l = n(66035),
c = n(88991),
m = n(22103);
class d extends a.Pv {
UpdateFromMessage(e, t) {
if ((0 != (1 & e) && ((this.m_bStatusInitialized = !0), (this.m_ePersonaState = t.persona_state() || 0), 0 != this.m_ePersonaState ? ((this.m_unGamePlayedAppID = t.game_played_app_id() || 0), (this.m_gameid = t.gameid() || "0"), (this.m_strGameExtraInfo = t.game_name() || ""), (this.m_unGameServerIP = t.game_server_ip() || 0), (this.m_unGameServerPort = t.game_server_port() || 0), (this.m_game_lobby_id = t.game_lobby_id() || "")) : this.Reset()), 0 != (2 & e))) {
this.m_bNameInitialized = !0;
let e = t.player_name() || "";
this.m_strPlayerName = e;
}
if ((0 != (64 & e) && (this.m_rtLastSeenOnline = t.last_seen_online() || t.last_logoff() || 0), 0 != (16 & e))) {
let e = t.avatar_hash(),
n = !0;
if (e) {
for (let t = 0; t < e.length && n; t++) n = !e[t];
this.m_strAvatarHash = n ? m.W : (0, s.BH)(e);
}
}
if ((void 0 !== t.persona_state_flags() && (this.m_unPersonaStateFlags = t.persona_state_flags()), 0 != (4096 & e))) {
this.m_mapRichPresence.clear();
for (let e of t.rich_presence()) this.m_mapRichPresence.set(e.key().toLowerCase(), e.value());
}
if ((0 != (8192 & e) && (this.m_broadcastId = t.broadcast_id()), 0 != (16384 & e))) {
let e = c.K.InitFromAccountID(t.watching_broadcast_accountid()).ConvertTo64BitString();
e && l.rr.stream[e] ? ((this.m_broadcastAccountId = t.watching_broadcast_accountid()), (this.m_broadcastAppId = t.watching_broadcast_appid()), (this.m_broadcastViewerCount = t.watching_broadcast_viewers()), (this.m_strBroadcastTitle = t.watching_broadcast_title())) : ((this.m_broadcastAccountId = 0), (this.m_broadcastAppId = 0), (this.m_broadcastViewerCount = 0), (this.m_strBroadcastTitle = ""));
}
(this.m_bCommunityBanned = t.is_community_banned()), this.m_bNameInitialized && this.m_bStatusInitialized && (this.m_bInitialized = !0), void 0 !== t.player_name_pending_review() && (this.m_bPlayerNamePending = t.player_name_pending_review()), void 0 !== t.avatar_pending_review() && (this.m_bAvatarPending = t.avatar_pending_review());
}
}
var h = n(4638),
u = n(76262),
p = n(85105),
_ = n(46186),
g = n(22858),
C = n(26626),
f = n(58594),
v = n(98004),
S = n(50403),
b = n(72746),
I = n(79588),
y = n(93635);
class E {
constructor(e, t) {
(this.m_bInitialized = !1), (this.m_bGotInitialState = !1), (this.m_eClanRelationship = void 0), (this.m_strClanName = ""), (this.m_strClanTag = ""), (this.m_strAvatarHash = a.WV), (this.m_eClanAccountFlags = 0), (this.m_ulChatRoomGroupID = void 0), (this.m_cMemberCount = 0), (this.m_cUsersOnline = 0), (this.m_cUsersInGame = 0), (this.m_cChatRoomMembers = 0), (this.m_bChatRoomPrivate = void 0), (this.m_bPersonaStateDesired = !1), (this.m_bPersonaStateLoadRequested = !1), (0, I.rC)(this), (this.m_steamid = e), (this.m_eClanRelationship = t);
}
BNeedsToLoadPersonaStateData() {
return !this.m_bInitialized && !this.m_bPersonaStateLoadRequested;
}
BPersonaStateDesired() {
return this.m_bPersonaStateDesired;
}
SetPersonaStateDesired() {
this.m_bPersonaStateDesired = !0;
}
SetPersonaStateLoadRequested() {
this.m_bPersonaStateLoadRequested = !0;
}
get name() {
return this.m_bInitialized ? this.m_strClanName : "";
}
get steamid() {
return this.m_steamid;
}
get clanid() {
return this.m_steamid.GetAccountID();
}
get member_count() {
return this.m_cMemberCount;
}
get users_online() {
return this.m_cUsersOnline;
}
get users_ingame() {
return this.m_cUsersInGame;
}
get count_chat_room_members() {
return this.m_cChatRoomMembers;
}
get chat_room_private() {
return this.m_bChatRoomPrivate;
}
BIsMember() {
return 3 == this.m_eClanRelationship;
}
BIsInvite() {
return 2 == this.m_eClanRelationship;
}
SetRelationship(e) {
this.m_eClanRelationship = e;
}
BIsOGG() {
return !!this.m_unOGGAppID || (this.m_bGotInitialState && 0 != (16 & this.m_eClanAccountFlags));
}
GetOGGAppID() {
return this.m_unOGGAppID;
}
BMatchesSearchString(e) {
return -1 !== this.m_strClanName.toLocaleLowerCase().indexOf(e);
}
get avatar_url() {
return (0, a.U0)(this.m_strAvatarHash);
}
get avatar_url_medium() {
return this.BIsOGG() ? this.avatar_url : (0, a.U0)(this.m_strAvatarHash, "medium");
}
get avatar_url_full() {
return this.BIsOGG() ? this.avatar_url : (0, a.U0)(this.m_strAvatarHash, "full");
}
OpenChatDialog(e, t = !0) {
return this.GetChatRoomGroupID().then((n) => (b.Ul.ChatStore.JoinAndShowChatRoomGroup(e, n, t), n));
}
ReadPersonaStateUpdate(e, t) {
if (((this.m_bInitialized = !0), 0 != (2 & e) && (this.m_strClanName = t.player_name()), 0 != (1024 & e) && ((this.m_strClanTag = t.clan_tag()), t.clan_data().chat_group_id() && (this.m_ulChatRoomGroupID = t.clan_data().chat_group_id()), t.clan_data().ogg_app_id() && (this.m_unOGGAppID = t.clan_data().ogg_app_id())), 0 != (16 & e))) {
let e = t.avatar_hash(),
n = !0;
if (e) {
for (let t = 0; t < e.length && n; t++) n = !e[t];
this.m_strAvatarHash = n ? a.WV : (0, s.BH)(e);
}
}
}
ReadStateUpdate(e) {
if (((this.m_bGotInitialState = !0), (this.m_eClanAccountFlags = e.clan_account_flags()), (this.m_bChatRoomPrivate = e.chat_room_private()), void 0 !== e.user_counts() && e.user_counts().members())) {
let t = e.user_counts();
(this.m_cMemberCount = t.members()), (this.m_cUsersOnline = t.online()), (this.m_cUsersInGame = t.in_game()), (this.m_cChatRoomMembers = t.chat_room_members());
}
}
GetChatGroupIDIfLoaded() {
return this.m_ulChatRoomGroupID;
}
GetChatRoomGroupID() {
if (this.m_ulChatRoomGroupID) return Promise.resolve(this.m_ulChatRoomGroupID);
{
let e = r.gA.Init(h.w4);
return e.Body().set_steamid(this.steamid.ConvertTo64BitString()), e.Body().set_autocreate(!0), h.s6.GetClanChatRoomInfo(b.Ul.CMInterface.GetServiceTransport(), e).then((e) => (1 == e.GetEResult() && e.Body().chat_group_summary().chat_group_id() ? ((this.m_ulChatRoomGroupID = e.Body().chat_group_summary().chat_group_id()), this.m_ulChatRoomGroupID) : null));
}
}
SetChatGroupID(e) {
this.m_ulChatRoomGroupID = e;
}
}
(0, i.gn)([I.LO], E.prototype, "m_bInitialized", void 0), (0, i.gn)([I.LO], E.prototype, "m_bGotInitialState", void 0), (0, i.gn)([I.LO], E.prototype, "m_eClanRelationship", void 0), (0, i.gn)([I.LO], E.prototype, "m_strAvatarHash", void 0), (0, i.gn)([I.LO], E.prototype, "m_ulChatRoomGroupID", void 0), (0, i.gn)([I.LO], E.prototype, "m_cMemberCount", void 0), (0, i.gn)([I.LO], E.prototype, "m_cUsersOnline", void 0), (0, i.gn)([I.LO], E.prototype, "m_cUsersInGame", void 0), (0, i.gn)([I.LO], E.prototype, "m_cChatRoomMembers", void 0), (0, i.gn)([I.LO], E.prototype, "m_bChatRoomPrivate", void 0), (0, i.gn)([I.Fl], E.prototype, "avatar_url", null), (0, i.gn)([I.Fl], E.prototype, "avatar_url_medium", null), (0, i.gn)([I.Fl], E.prototype, "avatar_url_full", null);
class D {
constructor(e) {
(this.m_mapClans = I.LO.map()), (0, I.rC)(this), (this.m_FriendStore = e);
}
Init(e) {
(this.m_CMInterface = e),
this.m_CMInterface.AddOnLogonCallback(this.OnLogOn.bind(this)),
this.m_CMInterface.messageHandlers.RegisterEMessageAction(822, p.m$, (e) => {
let t = new c.K(e.Body().steamid_clan());
this.GetOrCreateClan(t).ReadStateUpdate(e.Body());
});
}
OnLogOn() {}
get clan_invite_count() {
let e = 0;
return (
this.m_mapClans.forEach((t) => {
t.BIsInvite() && e++;
}),
e
);
}
get clan_invites() {
let e = [];
return (
this.m_mapClans.forEach((t) => {
t.m_bInitialized && t.BIsInvite() && e.push(t);
}),
e.sort((e, t) => e.name.localeCompare(t.name)),
e
);
}
GetClan(e) {
let t;
e instanceof c.K ? ((0, y.X)(e.BIsClanAccount(), "expected clan steamid in GetClan()"), (t = e.GetAccountID())) : (t = e);
const n = this.m_mapClans.get(t);
return n && this.LoadClanPersonaIfNeeded(n), n;
}
JoinClanChatRoom(e, t) {
let n = this.GetOrCreateClan(t);
n.OpenChatDialog(e, !0), this.LoadClanPersonaIfNeeded(n);
}
ClearClanMembershipData() {
this.m_mapClans.forEach((e) => {
e.SetRelationship(0);
});
}
SetClanChatGroupID(e, t) {
this.GetOrCreateClan(e).SetChatGroupID(t);
}
LoadClanPersonaIfNeeded(e) {
e.SetPersonaStateDesired(), e.BNeedsToLoadPersonaStateData() && this.ScheduleLoadMissingClanPersonas();
}
GetOrCreateClan(e, t) {
let n;
n = e instanceof c.K ? e : c.K.InitFromClanID(e);
let i = this.m_mapClans.get(n.GetAccountID());
return i ? void 0 !== t && i.SetRelationship(t) : ((i = new E(n, t || 0)), this.m_mapClans.set(n.GetAccountID(), i)), i;
}
OnClanRelationshipChanged(e, t) {
this.GetOrCreateClan(e, t);
}
RespondToClanInvite(e, t) {
let n = r.gA.Init(S.NA);
return n.Body().set_steamid(e.ConvertTo64BitString()), n.Body().set_accept(t), S.Zh.RespondToClanInvite(this.m_CMInterface.GetServiceTransport(), n).then((e) => 1 == e.GetEResult());
}
EnsureInitialStateForClanInvites() {
let e = r.gA.Init(v.$Z, 5554);
this.clan_invites.forEach((t) => {
t.m_bGotInitialState || e.Body().add_steamid_clans(t.steamid.ConvertTo64BitString());
}),
e.Body().steamid_clans().length <= 0 || this.m_CMInterface.Send(e);
}
ScheduleLoadMissingClanPersonas() {
this.m_iIntervalLoadClanData || (this.m_iIntervalLoadClanData = SetBackgroundTimeout(this.LoadMissingClanPersonas.bind(this), 100));
}
LoadMissingClanPersonas() {
this.m_iIntervalLoadClanData && (ClearBackgroundTimeout(this.m_iIntervalLoadClanData), (this.m_iIntervalLoadClanData = void 0));
let e = r.gA.Init(u.KW, 815);
e.Body().set_persona_state_requested(1042),
this.m_mapClans.forEach((t) => {
t.BPersonaStateDesired() && t.BNeedsToLoadPersonaStateData() && (e.Body().add_friends(t.steamid.ConvertTo64BitString()), t.SetPersonaStateLoadRequested());
}),
e.Body().friends().length && this.m_CMInterface.Send(e);
}
OnClanPersonaStateUpdate(e, t) {
let n = new c.K(t.friendid());
this.GetOrCreateClan(n).ReadPersonaStateUpdate(e, t);
}
}
(0, i.gn)([I.Fl], D.prototype, "clan_invite_count", null), (0, i.gn)([I.Fl], D.prototype, "clan_invites", null);
var w = n(10167),
R = n(32572),
A = n(78654),
M = n(22394),
k = n(97063),
T = n(84290),
L = n(2049),
G = n(14206),
O = n.n(G),
F = n(52705);
class B {
constructor(e, t, n) {
(this.m_numStartingTokens = 0), (this.m_numTokensPerMillisecond = 0), (this.m_numIntervalsPerMillisecond = 0), (this.m_TimeLastChecked = 0), (this.m_flTokens = 0), (this.m_numIntervalsPerMillisecond = 0.001 / Math.max(1, n)), (this.m_numStartingTokens = e), (this.m_numTokensPerMillisecond = Math.max(0, t) * this.m_numIntervalsPerMillisecond), this.Reset();
}
Reset() {
(this.m_TimeLastChecked = performance.now()), (this.m_flTokens = this.m_numStartingTokens);
}
AddTokens() {
let e = performance.now(),
t = (e - this.m_TimeLastChecked) * this.m_numTokensPerMillisecond;
(this.m_flTokens = Math.min(this.m_flTokens + t, this.m_numStartingTokens)), (this.m_TimeLastChecked = e);
}
BRemoveToken() {
return this.AddTokens(), !(this.m_flTokens < 1) && ((this.m_flTokens -= 1), !0);
}
}
var x = n(57476),
N = n(38060);
class P {
constructor() {
(this.Notifications_ShowInGame = 0), (this.Notifications_ShowOnline = 0), (this.Notifications_ShowMessage = 0), (this.Notifications_SendMobile = 0), (this.Sounds_PlayInGame = 0), (this.Sounds_PlayOnline = 0), (this.Sounds_PlayMessage = 0);
}
}
class U {
constructor(e, t = null, n = null) {
(this.m_persona = void 0), (this.m_eFriendRelationship = 0), (this.m_bPersonaStateLoadRequested = !1), (this.m_bPersonaNameHistoryLoaded = void 0), (this.m_rgPersonaNameHistory = []), (this.m_strPlayerNicknameNormalized = void 0), (this.m_strNickname = void 0), (this.m_NotificationSettings = void 0), (this.m_bLoadedEquippedProfileItems = !1), (this.m_bRequestedEquippedProfileItems = !1), (this.m_equippedProfileItems = {}), (this.m_nAppIDLastSeenPlaying = 0), (0, I.rC)(this), (this.m_unAccountID = e), (this.m_persona = new d(c.K.InitFromAccountID(e))), 0 == e && ((0, y.X)(!1, "unset accountid"), (this.m_persona.m_bInitialized = !0)), t && this.m_persona.UpdateFromMessage(n, t);
}
LoadIfNecessary() {
this.m_persona.m_bInitialized || this.m_bPersonaStateLoadRequested || ((this.m_bPersonaStateLoadRequested = !0), b.Ul.FriendStore.QueueFriendPersonaStateLoad(this));
}
ClearStateOnDisconnect() {
this.m_persona.m_bInitialized && this.m_persona.ClearStateOnDisconnect();
}
get is_ready() {
return !!this.m_persona.m_bNameInitialized && (Object.defineProperty(this, "is_ready", { value: !0 }), !0);
}
get persona() {
return this.LoadIfNecessary(), Object.defineProperty(this, "persona", { value: this.m_persona }), this.m_persona;
}
get mutable_persona() {
return this.m_persona;
}
get accountid() {
return this.m_unAccountID;
}
get steamid() {
return this.m_persona.m_steamid;
}
get steamid64() {
return this.m_persona.m_steamid.ConvertTo64BitString();
}
get efriendrelationship() {
return this.m_eFriendRelationship;
}
set efriendrelationship(e) {
this.m_eFriendRelationship = e;
}
get is_friend() {
return (0, A.my)(this.m_eFriendRelationship);
}
get is_blocked() {
return (0, A.fk)(this.m_eFriendRelationship);
}
GetCommunityProfileURL() {
return o.De.COMMUNITY_BASE_URL + "profiles/" + this.steamid64 + "/";
}
get has_nickname() {
return !!this.m_strNickname;
}
get nickname() {
return this.m_strNickname;
}
set nickname(e) {
(this.m_strNickname = e), (this.m_strPlayerNicknameNormalized = e ? U.NormalizeNameForSearch(e) : "");
}
get notification_settings() {
return this.m_NotificationSettings || (this.m_NotificationSettings = new P()), this.m_NotificationSettings;
}
set notification_settings(e) {
this.m_NotificationSettings = e;
}
BShowInGameNotification() {
return !!b.Ul.IsGamepadUIActive() || 1 == this.notification_settings.Notifications_ShowInGame || (b.Ul.SettingsStore.FriendsSettings.bNotifications_ShowIngame && 2 != this.notification_settings.Notifications_ShowInGame);
}
BShowMessageNotification() {
return o.De.IN_MOBILE ? 1 === this.notification_settings.Notifications_SendMobile || (b.Ul.BShowDirectChatNotification() && 2 !== this.notification_settings.Notifications_SendMobile) : !!b.Ul.IsGamepadUIActive() || 1 === this.notification_settings.Notifications_ShowMessage || (b.Ul.BShowDirectChatNotification() && 2 !== this.notification_settings.Notifications_ShowMessage);
}
BShowOnlineNotification() {
return !!b.Ul.IsGamepadUIActive() || 1 == this.notification_settings.Notifications_ShowOnline || (b.Ul.SettingsStore.FriendsSettings.bNotifications_ShowOnline && 2 != this.notification_settings.Notifications_ShowOnline);
}
BPlayInGameSound() {
return !b.Ul.IsGamepadUIActive() && (1 == this.notification_settings.Sounds_PlayInGame || (b.Ul.SettingsStore.FriendsSettings.bSounds_PlayIngame && 2 != this.notification_settings.Sounds_PlayInGame));
}
BPlayMessageSound() {
return !b.Ul.IsGamepadUIActive() && (1 == this.notification_settings.Sounds_PlayMessage || (b.Ul.SettingsStore.FriendsSettings.bSounds_PlayMessage && 2 != this.notification_settings.Sounds_PlayMessage));
}
BPlayOnlineSound() {
return !b.Ul.IsGamepadUIActive() && (1 == this.notification_settings.Sounds_PlayOnline || (b.Ul.SettingsStore.FriendsSettings.bSounds_PlayOnline && 2 != this.notification_settings.Sounds_PlayOnline));
}
get display_name() {
if (this.has_nickname) {
let e = this.primary_display_name;
return this.showing_secondary_display_name && (e += " (" + this.secondary_display_name + ")"), e;
}
return this.persona.m_strPlayerName;
}
get primary_display_name() {
if (this.has_nickname) {
if (!b.Ul.SettingsStore.CommunityPreferences.bParenthesizeNicknames) return this.nickname;
}
return this.persona.m_strPlayerName;
}
get has_secondary_display_name() {
return this.has_nickname;
}
get showing_secondary_display_name() {
return !!b.Ul.SettingsStore.CommunityPreferences.bParenthesizeNicknames && this.has_secondary_display_name;
}
get secondary_display_name() {
return b.Ul.SettingsStore.CommunityPreferences.bParenthesizeNicknames && this.has_nickname ? this.nickname : this.persona.m_strPlayerName;
}
get is_display_name_nickname() {
return this.has_nickname && !b.Ul.SettingsStore.CommunityPreferences.bParenthesizeNicknames;
}
static NormalizeNameForSearch(e) {
return e.toLocaleLowerCase();
}
get player_name_normalized() {
if (void 0 === this.m_strPlayerNameNormalized) {
if (!this.is_ready) return "";
let e = () => {
this.m_strPlayerNameNormalized = U.NormalizeNameForSearch(this.m_persona.m_strPlayerName);
};
(0, I.EH)(e), void 0 === this.m_strPlayerNameNormalized && e();
}
return this.m_strPlayerNameNormalized;
}
get current_game_name() {
return this.m_persona.GetCurrentGameName();
}
get current_game_icon_url() {
return this.m_persona.GetCurrentGameIconURL();
}
is_appinfo_ready() {
return this.m_persona.BIsAppInfoReady();
}
get current_game_rich_presence() {
return this.m_persona.GetCurrentGameRichPresence();
}
get game_name_normalized() {
if (void 0 === this.m_strGameNameNormalized) {
if (!this.is_ready) return "";
let e = () => {
this.m_strGameNameNormalized = U.NormalizeNameForSearch(this.current_game_name);
};
(0, I.EH)(e), void 0 === this.m_strGameNameNormalized && e();
}
return this.m_strGameNameNormalized;
}
MatchSearchString(e) {
let t = this.player_name_normalized.indexOf(e);
return -1 !== t ? { match: 1, iOffset: t, bFullMatch: 0 === t && this.player_name_normalized.length === e.length } : this.has_nickname && ((t = this.m_strPlayerNicknameNormalized.indexOf(e)), -1 !== t) ? { match: 2, iOffset: t, bFullMatch: 0 === t && this.m_strPlayerNicknameNormalized.length === e.length } : { match: 0 };
}
BMatchesSearchString(e, t) {
if (-1 !== this.player_name_normalized.indexOf(e)) return !0;
if (this.has_nickname) {
if (-1 !== this.m_strPlayerNicknameNormalized.indexOf(e)) return !0;
} else if (t && this.m_persona.is_ingame && -1 !== this.game_name_normalized.indexOf(e)) return !0;
return !1;
}
get persona_name_history() {
if (void 0 === this.m_bPersonaNameHistoryLoaded) {
let e = r.gA.Init(p.x0, 5570);
e.Body().add_Ids().set_steamid(this.steamid64),
e.Body().set_id_count(1),
b.Ul.CMInterface.SendMsgAndAwaitResponse(e, p.Km).then((e) => {
if (((0, y.X)(1 == e.Body().responses().length, "Got an invalid number of responses to CMsgClientAMGetPersonaNameHistory"), 1 != e.Body().responses().length)) return;
let t = e.Body().responses()[0];
(0, y.X)(t.steamid() == this.steamid64, "Got a response for the wrong user from CMsgClientAMGetPersonaNameHistory"),
t.steamid() == this.steamid64 &&
((0, y.X)(0 == this.m_rgPersonaNameHistory.length, "Got persona name history response for same user twice."),
(0, I.z)(() => {
for (let e of t.names()) this.m_rgPersonaNameHistory.push(e.name());
this.m_bPersonaNameHistoryLoaded = !0;
}));
}),
(this.m_bPersonaNameHistoryLoaded = !1);
}
return this.m_rgPersonaNameHistory;
}
get persona_name_history_loaded() {
return !0 === this.m_bPersonaNameHistoryLoaded;
}
OpenChatDialog(e) {
return this.is_blocked ? (o.De.IN_MOBILE ? b.Ul.ShowAlert((0, T.Xx)("#Friend_Chat_OpenError_Blocked"), (0, T.Xx)("#Friend_Chat_OpenError_BlockedBody")) : b.Ul.OpenURLInBrowser(this.GetCommunityProfileURL(), e), null) : b.Ul.ShowFriendChatDialog(e, this.m_unAccountID, !0);
}
static get FriendSortStatusComparator() {
let e = b.Ul.SettingsStore.BForceAlphabeticFriendSorting();
return U.FriendSortStatusComparatorInternal.bind(null, e);
}
static FriendSortStatusComparatorInternal(e, t, n) {
let i = t.persona,
o = n.persona;
return a.Pv.SortStatusComparator(!e, i, o);
}
static get DefaultFriendSortComparator() {
let e = b.Ul.SettingsStore.BForceAlphabeticFriendSorting();
return (t, n) => {
let i = U.FriendSortStatusComparatorInternal(e, t, n);
return 0 != i ? i : t.display_name.localeCompare(n.display_name);
};
}
static FriendSortByLastSeenComparator(e, t) {
let n = e.persona,
i = t.persona;
if (!n.is_online && !i.is_online) {
let e = b.Ul.GetServerRTime32() - n.last_seen_online,
t = b.Ul.GetServerRTime32() - i.last_seen_online;
if (e > t) return 1;
if (t > e) return -1;
}
return e.display_name.localeCompare(t.display_name);
}
static FriendSortByFriendOrNotComparator(e, t) {
return (e.is_friend && !t.is_friend) || (!e.is_friend && t.is_friend) ? (e.is_friend ? -1 : 1) : e.display_name.localeCompare(t.display_name);
}
get localized_online_status() {
return this.persona.GetLocalizedOnlineStatus();
}
GetBroadcastDescription() {
if (this.persona.m_strBroadcastTitle) return this.persona.m_strBroadcastTitle;
if (this.persona.m_broadcastAccountId) {
let e = b.Ul.FriendStore.GetPlayer(this.persona.m_broadcastAccountId),
t = this.persona.m_broadcastAppId ? b.Ul.AppInfoStore.GetAppInfo(this.persona.m_broadcastAppId) : null;
return t && t.is_valid ? (0, T.Xx)("#PersonaStateWatchingBroadcast_PlayerGame", e.display_name, t.name) : (0, T.Xx)("#PersonaStateWatchingBroadcast_Player", e.display_name);
}
return null;
}
LoadEquippedProfileItems(e = !1) {
return (0, i.mG)(this, void 0, void 0, function* () {
if (!b.Ul.CMInterface.logged_on || (this.m_bRequestedEquippedProfileItems && !e)) return;
this.m_bRequestedEquippedProfileItems = !0;
let t = r.gA.Init(f.cy);
t.Body().set_steamid(this.m_persona.m_steamid.ConvertTo64BitString());
let n = yield f.lk.GetProfileItemsEquipped(b.Ul.CMInterface.GetServiceTransport(), t).catch((e) => console.log("Couldn't get friend equipped items, ", e));
n && 1 == n.GetEResult() ? ((this.m_bLoadedEquippedProfileItems = !0), (this.m_equippedProfileItems = n.Body().toObject()), this.m_persona.is_golden && this.m_equippedProfileItems.profile_modifier && this.m_equippedProfileItems.profile_modifier.appid && ((this.m_equippedProfileItems.avatar_frame.image_small && 0 != this.m_equippedProfileItems.avatar_frame.image_small.length) || this.LoadAndSetGoldenProfileFrame())) : ((this.m_bLoadedEquippedProfileItems = !1), (this.m_bRequestedEquippedProfileItems = !1));
});
}
LoadAndSetGoldenProfileFrame() {
return (0, i.mG)(this, void 0, void 0, function* () {
try {
const e = { appid: this.m_equippedProfileItems.profile_modifier.appid, origin: self.origin };
yield O()
.get(`${o.De.CHAT_BASE_URL}actions/ajaxgetgoldenprofiledata/`, { params: e })
.then((e) => {
const t = e.data;
(this.m_equippedProfileItems.avatar_frame.image_small = t.frame), (this.m_equippedProfileItems.avatar_frame.image_large = t.frame);
});
} catch (e) {
let t = (0, F.l)(e);
console.error(`Error when calling ajaxgetgoldenprofiledata: ${t}`);
}
});
}
BLoadedEquippedItems() {
return this.m_bLoadedEquippedProfileItems;
}
GetEquippedProfileItems() {
return (0, y.X)(this.BLoadedEquippedItems(), "Called GetEquippedProfileItems without loading"), this.m_equippedProfileItems;
}
SetLastSeenPlaying(e) {
(this.m_nAppIDLastSeenPlaying = e), (this.m_dtLastSeenPlaying = new Date());
}
BWasRecentlyPlayingAppID(e, t = 15) {
return this.m_nAppIDLastSeenPlaying == e && new Date().getTime() - this.m_dtLastSeenPlaying.getTime() < 1e3 * t;
}
get miniProfileData() {
return this.m_miniProfileDataLoader || (this.m_miniProfileDataLoader = new N.s(this.m_unAccountID)), this.m_miniProfileDataLoader;
}
}
(0, i.gn)([I.LO], U.prototype, "m_persona", void 0),
(0, i.gn)([I.LO], U.prototype, "m_eFriendRelationship", void 0),
(0, i.gn)([I.LO], U.prototype, "m_bPersonaNameHistoryLoaded", void 0),
(0, i.gn)([I.LO], U.prototype, "m_rgPersonaNameHistory", void 0),
(0, i.gn)([I.LO], U.prototype, "m_strPlayerNicknameNormalized", void 0),
(0, i.gn)([I.LO], U.prototype, "m_strNickname", void 0),
(0, i.gn)([I.LO], U.prototype, "m_NotificationSettings", void 0),
(0, i.gn)([I.LO], U.prototype, "m_bLoadedEquippedProfileItems", void 0),
(0, i.gn)([I.LO], U.prototype, "m_bRequestedEquippedProfileItems", void 0),
(0, i.gn)([I.LO], U.prototype, "m_equippedProfileItems", void 0),
(0, i.gn)([I.Fl], U.prototype, "display_name", null),
(0, i.gn)([I.Fl], U.prototype, "secondary_display_name", null),
(0, i.gn)([I.Fl], U.prototype, "current_game_name", null),
(0, i.gn)([I.Fl], U.prototype, "current_game_icon_url", null),
(0, i.gn)([I.Fl], U.prototype, "current_game_rich_presence", null),
(0, i.gn)([I.Fl], U.prototype, "persona_name_history", null),
(0, i.gn)([I.Fl], U.prototype, "persona_name_history_loaded", null),
(0, i.gn)([I.Fl], U.prototype, "localized_online_status", null);
const V = "FriendStoreLocalPrefs";
class H {
constructor() {
(this.m_currentMsg = null), (this.m_mapLastSeenApp = new Map()), (0, I.rC)(this);
}
Init(e) {
(this.m_CMInterface = e), o.De.IN_MOBILE || SetBackgroundInterval(this.NotifyImpressions, 12e4);
}
RecordFriendInGameImpression(e) {
if (o.De.IN_MOBILE) return;
if (e == A.p6 || (e >= A.RI && e <= A.pv)) return;
this.m_currentMsg || (this.m_currentMsg = r.gA.Init(g.XX));
let t = !0;
if (this.m_mapLastSeenApp.has(e)) {
let n = this.m_mapLastSeenApp.get(e);
t = Date.now() - n > 864e5;
}
let n = null;
if (t) this.m_mapLastSeenApp.set(e, Date.now()), (n = this.m_currentMsg.Body().add_impressions()), n.set_appid(e), n.set_type(2), n.set_num_impressions(0);
else {
for (let t = 0; t < this.m_currentMsg.Body().impressions().length; ++t) {
let i = this.m_currentMsg.Body().impressions()[t];
if (i.appid() == e && 1 == i.type()) {
n = i;
break;
}
}
n || ((n = this.m_currentMsg.Body().add_impressions()), n.set_appid(e), n.set_type(1), n.set_num_impressions(0));
}
n.set_num_impressions(n.num_impressions() + 1);
}
NotifyImpressions() {
if (this.m_currentMsg) {
let e = this.m_currentMsg;
(this.m_currentMsg = null), g.KZ.ReportProductImpressionsFromClient(this.m_CMInterface.GetServiceTransport(), e);
}
}
}
(0, i.gn)([I.aD.bound], H.prototype, "NotifyImpressions", null);
class W {
constructor() {
(this.m_FriendGroupStore = new w.jY(this)),
(this.m_ClanStore = new D(this)),
(this.m_FavoritesStore = new R.C(this)),
(this.m_self = void 0),
(this.m_mapPlayerCache = new Map()),
(this.m_setFriendsNeedingPersonaStateLoad = new Set()),
(this.m_iIntervalSubscribeToPersonaStateUpdates = 0),
(this.m_setFriendAccountIDs = new Set()),
(this.m_setIncomingInviteAccountIDs = new Set()),
(this.m_bUserSetPersonaState = !1),
(this.m_eUserPersonaState = 0),
(this.m_bIsClientIdle = !1),
(this.m_FriendStorePrefs = { ePersonaState: 1, strNonFriendsAllowedToMsg: "" }),
(this.m_cFriendPersonaStatesInitialized = 0),
(this.m_bReadyToRender = !1),
(this.m_bPerFriendPreferencesLoaded = !1),
(this.m_bReceivedFriendsList = !1),
(this.m_bInitialPersonaStatesLoaded = !1),
(this.m_InitialAppInfoPromises = []),
(this.m_bInitialAppInfoLoaded = !1),
(this.m_bParentalLocked = void 0),
(this.m_eUserPersonaStateParental = 1),
(this.m_rgPersonaStateChangeCallbacks = new M.pB()),
(this.m_rgPlayerGameChangedCallbacks = new M.pB()),
(this.m_nMissingPersonaStateRetryCount = 0),
(this.m_nMissingPersonaStateMaxRetries = 5),
(this.m_FriendInGameNotificationStore = new H()),
(this.m_TokenBucketChangeStatus = new B(200, 1, 10)),
(this.m_vecLastTenChangeStatusReasons = []),
(this.m_TokenFailureAssertCount = 30),
(this.m_cLastUnreadPriorityMessageCountPosted = void 0),
(this.m_bSnoozeCallbackFired = !0),
(this.m_bAwayCallbackFired = !0),
(this.m_bReconnectedSinceLastIdleUpdate = !0),
(this.m_bNextActivityCallbackRegistered = !1),
(0, I.rC)(this);
}
Init(e) {
(this.m_CMInterface = e), this.m_FriendGroupStore.Init(e), this.m_ClanStore.Init(e), this.m_FavoritesStore.Init(e), this.m_FriendInGameNotificationStore.Init(e);
let t = !1;
return (
this.m_CMInterface.AddOnLogonCallback(() =>
(0, i.mG)(this, void 0, void 0, function* () {
if (t) this.SendPersonaStateToServer(!0, "MoreLogonCallback");
else {
(t = !0), (this.m_self = this.AddPlayerToCache(this.m_CMInterface.steamid.GetAccountID(), 1));
let e = !0;
(0, x.U5)("WebChat.GetSignIntoFriendsOnStart") && (e = yield SteamClient.WebChat.GetSignIntoFriendsOnStart()),
b.Ul.SettingsStore.GetObjectFromLocalStorage(V, this.m_FriendStorePrefs).then((t) => {
(this.m_FriendStorePrefs = t), e && ((this.m_eUserPersonaState = t.ePersonaState), (this.m_bUserSetPersonaState = !1), this.SendPersonaStateToServer(!0, "LogonCallback"));
}),
this.m_bReadyToRender || SetBackgroundTimeout(this.ForceReadyToRender.bind(this), 1e3);
}
this.GetFriendsList(), this.SetReconnectedSinceLastIdleUpdate();
}),
),
this.m_CMInterface.AddOnDisconnectCallback(() => {
this.SetPersonasOffline(!0);
}, 102),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandlerAction(f.jj.NotifyPerFriendPreferencesChangedHandler, (e) => {
let t = this.GetPlayer(e.Body().accountid());
if (t) {
let n = e.Body().preferences();
t.nickname = n.nickname() || void 0;
let i = new P();
this.FillPerFriendNotificationSettingsFromMessage(i, n), (t.notification_settings = i);
}
return 1;
}),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandlerAction(f.jj.NotifyFriendEquippedProfileItemsChangedHandler, (e) => {
let t = this.GetPlayer(e.Body().accountid());
return t && t.BLoadedEquippedItems() && t.LoadEquippedProfileItems(!0), 1;
}),
this.m_CMInterface.messageHandlers.RegisterEMessageAction(767, u.Qu, (e) => {
e.Body().bincremental() && this.SetFriendsList(e.Body());
}),
this.m_CMInterface.messageHandlers.RegisterEMessageAction(766, u.$K, (e) => {
let t = e.Body().status_flags(),
n = new Set(),
i = new Set();
for (let o of e.Body().friends()) {
let e = new c.K(o.friendid());
if (e.BIsClanAccount()) {
this.m_ClanStore.OnClanPersonaStateUpdate(t, o);
continue;
}
if (!e.BIsIndividualAccount()) continue;
let r = this.GetPlayerIfCached(e.GetAccountID());
r || (r = this.GetPlayer(e.GetAccountID()));
let a = r.mutable_persona,
s = a.m_ePersonaState,
m = a.m_strPlayerName,
d = a.m_unGamePlayedAppID,
h = a.m_strGameExtraInfo,
u = a.is_in_nonsteam_game,
p = a.m_broadcastAppId,
_ = a.m_bInitialized;
a.UpdateFromMessage(t, o), !_ && a.m_bInitialized && this.m_setFriendAccountIDs.has(r.accountid) && this.m_cFriendPersonaStatesInitialized++;
let g = 0 != (1 & t);
if (e.GetAccountID() == this.self.accountid && g) {
let e = !!o.persona_set_by_user(),
t = a.m_ePersonaState;
this.UpdateUserPersonaStateInternal(t, e, this.m_bIsClientIdle, !0, "RecvFromSrv"), 1 == t && this.m_bReconnectedSinceLastIdleUpdate && ((this.m_bReconnectedSinceLastIdleUpdate = !1), (t = this.AdjustPersonaStateForIdleTime(t)), 1 != t && this.UpdateUserPersonaStateInternal(t, !1, this.m_bIsClientIdle, !1, "AdjustForIdle"));
}
let C = !1,
f = a.m_unGamePlayedAppID,
v = a.m_broadcastAppId;
l.rr.bValid && p && p != l.rr.appID && (p = void 0), l.rr.bValid && v && v != l.rr.appID && (v = void 0);
let S = !1;
if (f || d || u || a.is_in_nonsteam_game || v || p) {
if (((C = d != f), f && n.add(f), v && n.add(v), a.GetAccountID() != this.m_self.accountid)) {
let t = d,
n = f;
0 == a.m_ePersonaState && (n = 0), u && (t = w.v5), a.is_in_nonsteam_game && (n = w.v5), !t && p && (t = p), !n && v && (n = v), r.is_friend && this.m_FriendGroupStore.OnFriendGameChanged(e.GetAccountID(), t, n), this.m_rgPlayerGameChangedCallbacks.Dispatch(e.GetAccountID(), t, n), (S = !0);
}
} else a.m_strGameExtraInfo && (C = h != a.m_strGameExtraInfo);
(4096 & t || C) && f && a.HasCurrentGameRichPresence() && i.add(f), _ && r.is_friend && r.accountid != this.m_self.accountid && (s != a.m_ePersonaState || C) && (r.BPlayInGameSound() && C && r.persona.is_ingame ? this.PlayJoinGameSound() : r.BPlayOnlineSound() && s != a.m_ePersonaState && 1 == a.m_ePersonaState && this.PlayFriendOnlineSound(), d && !r.persona.is_ingame && r.SetLastSeenPlaying(d), this.OnFriendPersonaStateChanged(r, s, a.m_ePersonaState, C, f && r.BWasRecentlyPlayingAppID(f))), S || (a.m_ePersonaState == s && !C && a.m_strPlayerName == m) || this.m_rgPersonaStateChangeCallbacks.Dispatch(r);
}
const o = b.Ul.AppInfoStore.EnsureAppInfoForAppIDs(n);
this.m_bInitialPersonaStatesLoaded || this.m_InitialAppInfoPromises.push(o), !this.m_bInitialPersonaStatesLoaded && i.size && (console.log("Preloading Game Rich Presence for AppIDs:", Array.from(i)), i.forEach((e) => b.Ul.AppInfoStore.GetRichPresenceLoc(e)));
}),
(0, I.EH)(() => {
let e = b.Ul.ParentalStore.BIsFriendsBlocked() || b.Ul.SettingsStore.IsSteamInTournamentMode();
this.OnParentalLockChanged(e);
}),
this.InitializeIdleTracking(),
this.m_bReadyToRender
? Promise.resolve()
: new Promise((e, t) => {
this.m_fnOnReadyToRender = e;
})
);
}
UpdateUnreadMessagesGlobal() {
if (void 0 !== window.SteamClient && null != window.SteamClient.WebChat && null != window.SteamClient.WebChat.SetNumChatsWithUnreadPriorityMessages) {
let e = b.Ul.ChatStore.GetChatsWithUnreadPriorityMessages().length;
this.m_cLastUnreadPriorityMessageCountPosted !== e && (window.SteamClient.WebChat.SetNumChatsWithUnreadPriorityMessages(e), (this.m_cLastUnreadPriorityMessageCountPosted = e));
}
}
GetFriendsList() {
return (0, i.mG)(this, void 0, void 0, function* () {
let e = r.gA.Init(C.Fi),
t = yield C.qW.GetFriendsList(this.m_CMInterface.GetServiceTransport(), e);
if (1 == t.GetEResult()) this.SetFriendsList(t.Body().friendslist());
else {
let e = { message: "ShowFriendsErrorRetryDialog" };
window.parent.postMessage(e, "https://steamloopback.host"), (0, y.X)(!1, "GetFriendsList returned", t.GetEResult());
}
});
}
get not_ready_to_render_reason() {
if (this.m_bReadyToRender) return "";
let e = "";
return this.m_bPerFriendPreferencesLoaded || (e += "P"), this.m_bReceivedFriendsList || (e += "F"), this.m_bInitialPersonaStatesLoaded || (e += "I"), this.m_bInitialAppInfoLoaded || (e += "A"), e;
}
UpdateReadyToRenderState() {
this.m_bReadyToRender || (this.m_bReceivedFriendsList && this.m_bInitialPersonaStatesLoaded && this.m_bPerFriendPreferencesLoaded && this.m_bInitialAppInfoLoaded && ((this.m_bReadyToRender = !0), this.m_fnOnReadyToRender && (this.m_fnOnReadyToRender(), (this.m_fnOnReadyToRender = void 0))));
}
ForceReadyToRender() {
const e = o.De.IN_CLIENT ? console.warn : console.error;
this.m_bReceivedFriendsList ? (this.m_bInitialPersonaStatesLoaded || e(`FriendStore.ForceReadyToRender() - Initial Persona States not ready: ${this.m_cFriendPersonaStatesInitialized} received, friends list: ${this.m_setFriendAccountIDs.size} users`), this.m_bInitialAppInfoLoaded || e("FriendStore.ForceReadyToRender() - Initial app info not ready"), this.m_bPerFriendPreferencesLoaded || e("FriendStore.ForceReadyToRender() - Per-friend preferences not ready")) : e("FriendStore Initialization - Still no friends list from server. Waiting."), (this.m_bInitialPersonaStatesLoaded = !0), (this.m_bPerFriendPreferencesLoaded = !0), (this.m_bInitialAppInfoLoaded = !0), this.UpdateReadyToRenderState();
}
AddPersonaStateChangedCallback(e) {
return this.m_rgPersonaStateChangeCallbacks.Register(e);
}
AddPlayerGameChangedCallback(e) {
return this.m_rgPlayerGameChangedCallbacks.Register(e);
}
BIsInvisibleMode() {
return 7 == this.m_eUserPersonaState;
}
BIsOfflineMode() {
return 0 == this.m_eUserPersonaState;
}
GetUserDoNotDisturb() {
var e;
return null === (e = b.Ul.SettingsStore.FriendsSettings) || void 0 === e ? void 0 : e.bDoNotDisturbMode;
}
SetUserDoNotDisturb(e) {
(b.Ul.SettingsStore.FriendsSettings.bDoNotDisturbMode = e), b.Ul.SettingsStore.BUpdateFriendsSettings(b.Ul.SettingsStore.FriendsSettings);
}
SetUserPersonaState(e, t = !0) {
this.UpdateUserPersonaStateInternal(e, t, !1, !1, "SetUserPersonaState");
}
EnsureApprovedNonFriendMapReady() {
if (void 0 === this.m_mapApprovedNonFriendMessages && ((this.m_mapApprovedNonFriendMessages = I.LO.map()), null != this.m_FriendStorePrefs.strNonFriendsAllowedToMsg && "" != this.m_FriendStorePrefs.strNonFriendsAllowedToMsg)) {
let e = new Date().getTime(),
t = this.m_FriendStorePrefs.strNonFriendsAllowedToMsg.split(",");
for (let n = 0; n < t.length; ++n) {
let i = t[n].split("=");
if (2 == i.length) {
let t = Number(i[0]),
n = Number(i[1]);
n > e && this.m_mapApprovedNonFriendMessages.set(t, n);
}
}
}
}
BApprovedNonFriendMessages(e) {
this.EnsureApprovedNonFriendMapReady();
let t = new Date(),
n = this.m_mapApprovedNonFriendMessages.get(e);
return null != n && n > t.getTime();
}
SetApprovedNonFriendMessages(e) {
this.EnsureApprovedNonFriendMapReady();
let t = new Date().getTime();
this.m_mapApprovedNonFriendMessages.set(e, t + 864e5);
let n = "";
this.m_mapApprovedNonFriendMessages.forEach(function (e, i, o) {
e > t && (0 != n.length && (n += ","), (n += i.toString() + "=" + e.toString()));
}),
(this.m_FriendStorePrefs.strNonFriendsAllowedToMsg = n),
b.Ul.SettingsStore.StoreObjectInLocalStorage(V, this.m_FriendStorePrefs);
}
OnParentalLockChanged(e) {
!this.m_bParentalLocked && e ? ((this.m_eUserPersonaStateParental = this.m_eUserPersonaState), this.UpdateUserPersonaStateInternal(0, !1, this.m_bIsClientIdle, !1, "ParentalLockChange"), (this.m_bParentalLocked = e)) : this.m_bParentalLocked && !e && ((this.m_bParentalLocked = e), this.UpdateUserPersonaStateInternal(this.m_eUserPersonaStateParental, !1, this.m_bIsClientIdle, !1, "ParentalLockChange"));
}
UpdateUserPersonaStateInternal(e, t, n, i, o) {
if (this.m_bParentalLocked) return;
if ((b.Ul.UpdatePersonaState(e), e == this.m_eUserPersonaState && this.m_bUserSetPersonaState == t && this.m_bIsClientIdle == n)) return;
if ((0 == e && t && b.Ul.SignOutOfFriends(void 0), 0 == this.m_eUserPersonaState && !t)) return;
t || (3 != e && 4 != e) || (n = !0), i && this.m_bIsClientIdle != n && (i = !1);
let r = this.m_eUserPersonaState,
a = this.m_bUserSetPersonaState,
s = this.m_bIsClientIdle;
(this.m_eUserPersonaState = e), (this.m_bUserSetPersonaState = t), (this.m_bIsClientIdle = n), i || (this.SendPersonaStateToServer(!1, o) || ((this.m_eUserPersonaState = r), (this.m_bUserSetPersonaState = a), (this.m_bIsClientIdle = s)), 0 === this.m_eUserPersonaState && (this.m_self.mutable_persona.m_ePersonaState = 0)), 0 === r && this.m_eUserPersonaState !== r && b.Ul.Reconnect(), (!t && 1 != this.m_eUserPersonaState) || 0 === this.m_eUserPersonaState || ((this.m_FriendStorePrefs.ePersonaState = e), b.Ul.SettingsStore.StoreObjectInLocalStorage(V, this.m_FriendStorePrefs));
}
SendPersonaStateToServer(e, t) {
if ((this.m_vecLastTenChangeStatusReasons.push(t), this.m_vecLastTenChangeStatusReasons.length > 10 && (this.m_vecLastTenChangeStatusReasons = this.m_vecLastTenChangeStatusReasons.slice(1)), !this.m_TokenBucketChangeStatus.BRemoveToken())) return this.m_TokenFailureAssertCount > 0 && (--this.m_TokenFailureAssertCount, (0, y.X)(!1, "No ClientChangeStatus tokens, last 10 reasons: " + this.m_vecLastTenChangeStatusReasons.join(","))), !1;
let n = r.gA.Init(u.bx, 716);
return n.Body().set_persona_state(this.m_eUserPersonaState), n.Body().set_persona_set_by_user(this.m_bUserSetPersonaState), n.Body().set_need_persona_response(e), n.Body().set_is_client_idle(this.m_bIsClientIdle), this.m_CMInterface.Send(n), !0;
}
AdjustPersonaStateForIdleTime(e) {
return (1 == e || 3 == e) && b.Ul.IdleTracker.GetUserIdleTime() >= 7200 ? 4 : 1 == e && b.Ul.IdleTracker.GetUserIdleTime() >= 300 ? 3 : e;
}
get FriendGroupStore() {
return this.m_FriendGroupStore;
}
get ClanStore() {
return this.m_ClanStore;
}
get FavoritesStore() {
return this.m_FavoritesStore;
}
get all_friends() {
return Array.from(this.m_setFriendAccountIDs).map((e) => this.GetFriend(e));
}
get online_friends() {
return this.all_friends.filter((e) => e.persona.is_online);
}
get all_friends_accountids() {
return this.m_setFriendAccountIDs;
}
get friends_list_ready() {
return this.m_bReceivedFriendsList;
}
GetFriend(e) {
let t = this.m_mapPlayerCache.get(e);
if (t) {
if (!t.is_friend) return null;
} else (0, y.X)(!1, `Friend missing from cache: ${e}`);
return t;
}
GetPlayer(e) {
let t = this.m_mapPlayerCache.get(e);
return t || (t = this.AddPlayerToCache(e, 3)), t;
}
AddPlayerToCache(e, t, n = !0) {
if (this.m_mapPlayerCache.has(e)) return this.m_mapPlayerCache.get(e);
let i = new U(e);
return this.m_mapPlayerCache.set(e, i), i;
}
GetPlayerIfCached(e) {
return this.m_mapPlayerCache.get(e);
}
GetFriendIfCached(e) {
let t = this.m_mapPlayerCache.get(e);
return t && t.is_friend ? t : null;
}
SetPersonasOffline(e) {
this.m_mapPlayerCache.forEach((t) => {
(e && (t.is_friend || t.accountid == this.self.accountid)) || t.ClearStateOnDisconnect();
});
}
QueueFriendPersonaStateLoad(e) {
this.m_setFriendsNeedingPersonaStateLoad.add(e.accountid), !this.m_iIntervalSubscribeToPersonaStateUpdates && this.m_bInitialPersonaStatesLoaded && (this.m_iIntervalSubscribeToPersonaStateUpdates = SetBackgroundTimeout(this.SubscribeToMissingPersonaStates.bind(this), 50));
}
get self() {
return this.m_self;
}
SubscribeToMissingPersonaStates() {
this.m_iIntervalSubscribeToPersonaStateUpdates && (ClearBackgroundTimeout(this.m_iIntervalSubscribeToPersonaStateUpdates), (this.m_iIntervalSubscribeToPersonaStateUpdates = 0));
let e = [];
if (
(this.m_setFriendsNeedingPersonaStateLoad.forEach((t) => {
let n = this.m_mapPlayerCache.get(t);
n && !n.persona.m_bNameInitialized && e.push(n.accountid);
}),
this.m_setFriendsNeedingPersonaStateLoad.clear(),
e.length)
) {
let t = r.gA.Init(u.KW, 815);
t.Body().set_persona_state_requested(1106);
for (let n of e) t.Body().add_friends(c.K.InitFromAccountID(n).ConvertTo64BitString());
this.m_CMInterface.Send(t),
SetBackgroundTimeout(() => {
let t = 0;
for (let n of e) {
let e = this.GetPlayer(n);
e && !e.persona.m_bNameInitialized && ((0, y.X)(e.m_bPersonaStateLoadRequested, "PersonaStateLoadRequested not set"), this.m_setFriendsNeedingPersonaStateLoad.add(n), t++);
}
t > 0 ? (this.m_nMissingPersonaStateRetryCount < this.m_nMissingPersonaStateMaxRetries ? (this.m_nMissingPersonaStateRetryCount++, this.m_iIntervalSubscribeToPersonaStateUpdates || (this.m_iIntervalSubscribeToPersonaStateUpdates = SetBackgroundTimeout(this.SubscribeToMissingPersonaStates.bind(this), 1e4))) : console.log("Giving up persona state retries with", t, "still not filled", this.m_setFriendsNeedingPersonaStateLoad)) : (this.m_nMissingPersonaStateRetryCount = 0);
}, W.k_nMSToWaitForFriendData);
}
}
InitializeIdleTracking() {
this.m_bAwayCallbackFired && ((this.m_bAwayCallbackFired = !1), b.Ul.IdleTracker.AddOnIdleCallback(this.OnIdle.bind(this, 3), 300)), this.m_bSnoozeCallbackFired && ((this.m_bSnoozeCallbackFired = !1), b.Ul.IdleTracker.AddOnIdleCallback(this.OnIdle.bind(this, 4), 7200));
}
ResetIdleState() {
this.m_bReconnectedSinceLastIdleUpdate = !1;
let e = this.m_eUserPersonaState;
this.m_bUserSetPersonaState || (3 != this.m_eUserPersonaState && 4 != this.m_eUserPersonaState) || (e = 1), this.UpdateUserPersonaStateInternal(e, this.m_bUserSetPersonaState, !1, !1, "ResetIdleState"), (this.m_bNextActivityCallbackRegistered = !1), this.InitializeIdleTracking();
}
SetReconnectedSinceLastIdleUpdate() {
this.m_bReconnectedSinceLastIdleUpdate = !0;
}
OnIdle(e) {
this.m_bReconnectedSinceLastIdleUpdate = !1;
let t = e;
3 == e ? ((this.m_bAwayCallbackFired = !0), 4 == this.m_eUserPersonaState && (t = 4)) : 4 == e && (this.m_bSnoozeCallbackFired = !0), this.m_bUserSetPersonaState && (t = this.m_eUserPersonaState), this.UpdateUserPersonaStateInternal(t, this.m_bUserSetPersonaState, !0, !1, "OnIdle"), this.m_bNextActivityCallbackRegistered || ((this.m_bNextActivityCallbackRegistered = !0), b.Ul.IdleTracker.AddOnNextActivityCallback(this.ResetIdleState.bind(this)));
}
GetFriendInviteCount() {
return this.m_FriendGroupStore.incoming_invites_group.unfiltered_count;
}
GetClanInviteCount() {
return this.m_ClanStore.clan_invite_count;
}
GetPendingInviteCount() {
return this.GetFriendInviteCount() + this.GetClanInviteCount();
}
GetOutgoingFriendRequestCount() {
return this.m_FriendGroupStore.outgoing_invites_group.unfiltered_count;
}
GetOnlineFriendCount() {
return this.online_friends.length;
}
SendFriendInvite(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
return this.SendFriendInviteBySteamID(e.persona.m_steamid);
});
}
SendFriendInviteBySteamID(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
let t = r.gA.Init(f.pl);
t.Body().set_steamid(e.ConvertTo64BitString());
let n = yield f.lk.AddFriend(this.m_CMInterface.GetServiceTransport(), t),
i = 1;
return void 0 !== n.Body().result() && (i = n.Body().result()), { eResult: i, eFriendRelationship: n.Body().friend_relationship() };
});
}
RemoveFriend(e) {
let t = r.gA.Init(f.Xg);
return t.Body().set_steamid(e.persona.m_steamid.ConvertTo64BitString()), f.lk.RemoveFriend(this.m_CMInterface.GetServiceTransport(), t).then((e) => e.Body().friend_relationship());
}
BlockPlayer(e, t = !1) {
let n = r.gA.Init(f.iM);
return n.Body().set_steamid(e.persona.m_steamid.ConvertTo64BitString()), t && n.Body().set_unignore(!0), f.lk.IgnoreFriend(this.m_CMInterface.GetServiceTransport(), n).then((e) => e.Body().friend_relationship());
}
AddFriend(e, t, n) {
let i = new c.K(e).GetAccountID(),
o = this.m_setIncomingInviteAccountIDs.has(i);
if (2 == t) {
if (!o) {
let e = this.AddPlayerToCache(i, 3, !1);
(e.efriendrelationship = t), n || e.LoadIfNecessary(), this.m_setIncomingInviteAccountIDs.add(i), this.m_FriendGroupStore.OnIncomingInviteAdded(i);
}
} else if (o) {
(this.AddPlayerToCache(i, 3, !1).efriendrelationship = t), this.m_setIncomingInviteAccountIDs.delete(i), this.m_FriendGroupStore.OnIncomingInviteRemoved(i);
}
if (4 == t) {
let e = this.AddPlayerToCache(i, 3, !1);
(e.efriendrelationship = t), n || e.LoadIfNecessary(), this.m_FriendGroupStore.OnOutgoingInviteAdded(i);
} else this.m_FriendGroupStore.OnOutgoingInviteRemoved(i);
if (5 == t || 6 == t) {
let e = b.Ul.ChatStore.GetFriendChat(i, !1);
e && b.Ul.UIStore.CloseTabByID(e.unique_id);
}
let r = this.m_setFriendAccountIDs.has(i);
if ((0, A.my)(t)) {
let e;
r ? (e = this.GetFriend(i)) : (this.m_setFriendAccountIDs.add(i), (e = this.AddPlayerToCache(i, 2, !1)), n || e.LoadIfNecessary(), this.m_FriendGroupStore.OnFriendAdded(i)), (e.efriendrelationship = t);
} else {
r && (this.m_FriendGroupStore.OnFriendRemoved(i), this.m_FavoritesStore.OnFriendRemoved(i), this.m_setFriendAccountIDs.delete(i)), (this.AddPlayerToCache(i, 3, !1).efriendrelationship = t);
}
}
SetFriendsList(e) {
let t = e.friends();
const n = !e.bincremental();
if (n) {
for (let e of this.all_friends) e.efriendrelationship = 0;
this.m_setFriendAccountIDs.clear(), this.m_setIncomingInviteAccountIDs.clear(), this.m_FriendGroupStore.OnFullFriendsListUpdateStart(), this.m_ClanStore.ClearClanMembershipData();
}
for (let e of t) {
let t = new c.K(e.ulfriendid());
if (t.BIsIndividualAccount()) {
let i = e.efriendrelationship();
this.AddFriend(t.ConvertTo64BitString(), i, n);
} else t.BIsClanAccount() && this.m_ClanStore.OnClanRelationshipChanged(t, e.efriendrelationship());
}
n && (this.m_FriendGroupStore.OnFullFriendsListUpdateComplete(), (this.m_bReceivedFriendsList = !0), this.RequestPerFriendPreferences(), this.RequestFriendPersonaStates(), this.UpdateReadyToRenderState());
}
RequestFriendPersonaStates() {
return (0, i.mG)(this, void 0, void 0, function* () {
if (this.m_setFriendAccountIDs.size > 0) {
let e = r.gA.Init(h.TJ);
yield h.al.RequestFriendPersonaStates(this.m_CMInterface.GetServiceTransport(), e);
}
window.setTimeout(() => {
(this.m_bInitialPersonaStatesLoaded = !0), this.StartWaitForInitialAppInfo(), this.SubscribeToMissingPersonaStates(), this.UpdateReadyToRenderState();
}, 1);
});
}
OnFriendPersonaStateChanged(e, t, n, i, o) {
if (!b.Ul.NotificationManager.BNotificationsPermitted() || !b.Ul.SettingsStore.BReady() || b.Ul.FriendStore.GetUserDoNotDisturb()) return;
const r = b.Ul.IsGamepadUIActive() || e.BShowInGameNotification();
if (i && e.persona.is_ingame && r) {
let t = e.current_game_name;
return e.persona.is_in_nonsteam_game || o || this.m_FriendInGameNotificationStore.RecordFriendInGameImpression(e.persona.m_unGamePlayedAppID), void (t && b.Ul.NotificationManager.DisplayNotificationFromFriend(e, { title: e.display_name, body: (0, T.Xx)("#Friend_StateChange_InGame", t), rawbody: t, tag: "state_" + e.accountid, state: "ingame", steamid: e.persona.m_steamid.ConvertTo64BitString() }));
}
0 == t && 0 != n && e.BShowOnlineNotification() && b.Ul.NotificationManager.DisplayNotificationFromFriend(e, { title: e.display_name, body: (0, T.Xx)("#Friend_StateChange_Online"), tag: "state_" + e.accountid, state: "online", steamid: e.persona.m_steamid.ConvertTo64BitString() });
}
PlayJoinGameSound() {
b.Ul.FriendStore.GetUserDoNotDisturb() || b.Ul.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/ui_steam_smoother_friend_join.m4a");
}
PlayFriendOnlineSound() {
b.Ul.FriendStore.GetUserDoNotDisturb() || b.Ul.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/ui_steam_smoother_friend_online.m4a");
}
FillPerFriendNotificationSettingsFromMessage(e, t) {
(e.Notifications_ShowInGame = t.notifications_showingame()), (e.Notifications_ShowMessage = t.notifications_showmessages()), (e.Notifications_ShowOnline = t.notifications_showonline()), (e.Notifications_SendMobile = t.notifications_sendmobile()), (e.Sounds_PlayInGame = t.sounds_showingame()), (e.Sounds_PlayMessage = t.sounds_showmessages()), (e.Sounds_PlayOnline = t.sounds_showonline());
}
RequestPerFriendPreferences() {
let e = r.gA.Init(f.gN);
f.lk.GetPerFriendPreferences(this.m_CMInterface.GetServiceTransport(), e).then((e) => {
(0, I.z)(() => {
for (let t of e.Body().preferences()) {
let e = this.GetPlayer(t.accountid());
if (e) {
e.nickname = t.nickname() || void 0;
let n = new P();
this.FillPerFriendNotificationSettingsFromMessage(n, t), (e.notification_settings = n);
} else console.log("Got per-friend preferences back for a user we don't have a Player for:", t);
}
(this.m_bPerFriendPreferencesLoaded = !0), this.UpdateReadyToRenderState();
});
});
}
StartWaitForInitialAppInfo() {
return (0, i.mG)(this, void 0, void 0, function* () {
yield Promise.all(this.m_InitialAppInfoPromises), (this.m_bInitialAppInfoLoaded = !0), this.UpdateReadyToRenderState();
});
}
FillMessageFromPerFriendNotificationSettings(e, t) {
e.set_notifications_showingame(t.Notifications_ShowInGame), e.set_notifications_showmessages(t.Notifications_ShowMessage), e.set_notifications_showonline(t.Notifications_ShowOnline), e.set_notifications_sendmobile(t.Notifications_SendMobile), e.set_sounds_showingame(t.Sounds_PlayInGame), e.set_sounds_showmessages(t.Sounds_PlayMessage), e.set_sounds_showonline(t.Sounds_PlayOnline);
}
SetPlayerNickname(e, t) {
return this.SetPlayerPerFriendPreferences(e, t, e.notification_settings);
}
SetPlayerNotificationSettings(e, t) {
return this.SetPlayerPerFriendPreferences(e, e.nickname, t);
}
SetPlayerPerFriendPreferences(e, t, n) {
let i = r.gA.Init(f.Qq),
o = i.Body().preferences();
return o.set_accountid(e.accountid), o.set_nickname(t), this.FillMessageFromPerFriendNotificationSettings(o, n), f.lk.SetPerFriendPreferences(b.Ul.CMInterface.GetServiceTransport(), i).then((e) => e.GetEResult());
}
InviteToGame(e, t, n) {
let i = r.gA.Init(p.yc, 7005);
i.Hdr().set_routing_appid(t), i.Body().set_steam_id_src(this.m_CMInterface.steamid.ConvertTo64BitString()), i.Body().set_steam_id_dest(c.K.InitFromAccountID(e.accountid).ConvertTo64BitString()), n && i.Body().set_connect_string(n), this.m_CMInterface.Send(i);
}
InviteToLobby(e, t, n) {
let i = r.gA.Init(_.BQ, 6621);
i.Hdr().set_routing_appid(t), i.Body().set_steam_id_lobby(n), i.Body().set_steam_id_user_invited(c.K.InitFromAccountID(e.accountid).ConvertTo64BitString()), this.m_CMInterface.Send(i);
}
InviteToWatch(e) {
b.Ul.ShowFriendChatDialog(b.Ul.GetDefaultBrowserContext(), e.accountid, !0);
b.Ul.BroadcastStore.InviteToWatch(e.accountid).then((e) => {});
}
FillInChatUsabilityMetrics(e) {
let t = 0,
n = 0,
i = 0;
for (let e of this.all_friends) 3 == e.efriendrelationship && (t++, e.persona.is_online && n++, e.persona.is_ingame && i++);
e.metrics().set_friends_count(t), e.metrics().set_friends_online_count(n), e.metrics().set_friends_in_game_count(i), this.m_FriendGroupStore.FillInChatUsabilityMetrics(e), this.m_FavoritesStore.FillInChatUsabilityMetrics(e);
}
GetPersonaStatePreference() {
var e;
return null === (e = this.m_FriendStorePrefs) || void 0 === e ? void 0 : e.ePersonaState;
}
}
function X(e) {
switch (e) {
case 25:
return "#Friend_InviteError_LimitExceeded";
case 15:
return "#Friend_InviteError_AccessDenied";
case 40:
return "#Friend_InviteError_Blocked";
case 11:
return "#Friend_InviteError_InvalidState";
case 84:
return "#Friend_InviteError_RateLimitExceeded";
case 24:
return "#Friend_InviteError_InsufficientPrivilege";
}
return "#Friend_InviteError";
}
(W.k_nMSToWaitForFriendData = 1e3),
(0, i.gn)([I.LO], W.prototype, "m_self", void 0),
(0, i.gn)([I.LO], W.prototype, "m_setFriendAccountIDs", void 0),
(0, i.gn)([I.LO], W.prototype, "m_eUserPersonaState", void 0),
(0, i.gn)([I.LO], W.prototype, "m_bPerFriendPreferencesLoaded", void 0),
(0, i.gn)([I.LO], W.prototype, "m_bReceivedFriendsList", void 0),
(0, i.gn)([I.LO], W.prototype, "m_bInitialPersonaStatesLoaded", void 0),
(0, i.gn)([I.LO], W.prototype, "m_bInitialAppInfoLoaded", void 0),
(0, i.gn)([I.Fl], W.prototype, "not_ready_to_render_reason", null),
(0, i.gn)([I.aD], W.prototype, "OnParentalLockChanged", null),
(0, i.gn)([I.Fl], W.prototype, "all_friends", null),
(0, i.gn)([I.Fl], W.prototype, "online_friends", null),
(0, i.gn)([I.aD], W.prototype, "SetPersonasOffline", null),
(0, i.gn)([I.aD], W.prototype, "SetFriendsList", null),
(0, i.gn)([L.ak, (0, k.D)(100)], W.prototype, "PlayJoinGameSound", null),
(0, i.gn)([L.ak, (0, k.D)(100)], W.prototype, "PlayFriendOnlineSound", null),
(0, i.gn)([I.aD], W.prototype, "SetPlayerNickname", null),
(0, i.gn)([I.aD], W.prototype, "SetPlayerNotificationSettings", null),
(0, i.gn)([I.aD], W.prototype, "SetPlayerPerFriendPreferences", null),
(0, i.gn)([I.aD], W.prototype, "InviteToGame", null),
(0, i.gn)([I.aD], W.prototype, "InviteToLobby", null),
(0, i.gn)([I.aD], W.prototype, "InviteToWatch", null);
},
19339: (e, t, n) => {
"use strict";
n.d(t, { a: () => y, d: () => I });
var i = n(85556),
o = n(59702),
r = n(19953),
a = n(1736),
s = n(88991),
l = n(61326),
c = n(23346),
m = n(72746),
d = n(79588),
h = n(84290),
u = n(46519),
p = (n(67915), n(46962)),
_ = n(2049),
g = n(97063),
C = n(5395),
f = n(77385),
v = n(20891);
const S = new f.sO("Chat");
const b = "FriendRecentChats";
class I {
constructor(e) {
(this.m_rgFriendChats = []), (this.m_bReceivedFriendChats = !1), (this.m_rtLastSessionUpdate = 0), (this.m_mapLastChatTimeByFriend = d.LO.map()), (this.m_mapRecentIgnoreTimeBeforeByFriend = d.LO.map()), (this.m_LastMessageCache = r.De.IN_MOBILE ? new E() : new D()), (0, d.rC)(this), (this.m_ChatStore = e);
}
Init() {
this.m_LastMessageCache.Init(),
this.m_ChatStore.CMInterface.messageHandlers.RegisterServiceNotificationHandlerAction(l.cV.IncomingMessageHandler, (e) => {
let t = new s.K(e.Body().steamid_friend()),
n = m.Ul.FriendStore.GetPlayerIfCached(t.GetAccountID());
if (!n) {
if (e.Body().low_priority()) return 41;
n = m.Ul.FriendStore.GetPlayer(t.GetAccountID());
}
if (1 == e.Body().chat_entry_type()) {
let i = e.Body().local_echo(),
o = n.is_blocked || (e.Body().low_priority() && !n.is_friend),
a = i ? this.m_ChatStore.FriendStore.self.persona.m_steamid : t,
s = this.GetFriendChat(t.GetAccountID(), !o),
l = s.GetVisibilityState();
if ((!o && !i && !m.Ul.FriendStore.BIsInvisibleMode() && !m.Ul.FriendStore.GetUserDoNotDisturb() && m.Ul.BShowIncomingChatMessages() && !r.De.IN_MOBILE && m.Ul.UIStore.ShowAndOrActivateChat(m.Ul.GetDefaultBrowserContext(), s, !1), s))
if ((n.is_friend || 0 != l || s.SetShowNonFriendWarning(!0), i || !n.is_blocked)) {
s.AddNewChatMsgAndNotify(a.GetAccountID(), e.Body().rtime32_server_timestamp(), e.Body().ordinal(), e.Body().message(), e.Body().message_no_bbcode());
let t = this.m_ChatStore.TextFilterStore;
if (!i && !t.BShownFilterTip() && t.BHasFilter()) {
let n = e.Body().message();
t.FilterText(a.GetAccountID(), n) !== n && (s.AddLocalMsg(a.GetAccountID(), e.Body().rtime32_server_timestamp(), (0, h.Xx)("#Chat_TextFilter_Active", this.m_ChatStore.GetTextFilterSettingsURL())), t.SetFilterTipShown(!0));
}
} else s.AppendChatMsg(a.GetAccountID(), e.Body().rtime32_server_timestamp(), e.Body().ordinal(), e.Body().message());
this.m_mapLastChatTimeByFriend.set(t.GetAccountID(), e.Body().rtime32_server_timestamp());
} else if (2 == e.Body().chat_entry_type() && !e.Body().local_echo() && !n.is_blocked) {
let e = this.GetFriendChat(t.GetAccountID(), !1);
e && e.OnFriendTypingNotification();
}
return 1;
}),
this.m_ChatStore.CMInterface.messageHandlers.RegisterServiceNotificationHandlerAction(l.cV.NotifyAckMessageEchoHandler, (e) => {
let t = new s.K(e.Body().steamid_partner()),
n = this.GetFriendChat(t.GetAccountID());
return n && n.UpdateLastAckTimeFromServer(e.Body().timestamp()), 1;
}),
this.m_ChatStore.CMInterface.messageHandlers.RegisterServiceNotificationHandlerAction(l.cV.MessageReactionHandler, (e) => {
const t = new s.K(e.Body().steamid_friend()),
n = this.GetFriendChat(t.GetAccountID());
if (n) {
const t = n.chat_messages.find((t) => t.rtTimestamp === e.Body().server_timestamp() && t.unOrdinal === e.Body().ordinal());
if (t) {
const { is_add: n, reactor: i, reaction: o } = e.Body().toObject(),
r = t.reactions.find((e) => e.strReaction === o),
a = n ? 1 : -1;
if (-1 === a && !r) return S.Error("Got reaction removal notification but no matching reaction was found"), 1;
let s = !!r && r.bUserReacted;
i === m.Ul.FriendStore.self.steamid64 && (s = n), t.UpdateReaction(e.Body().reaction_type(), e.Body().reaction(), r ? r.cReactors + a : a, s);
}
}
return 1;
});
}
GetFriendChat(e, t = !0) {
for (let t of this.m_rgFriendChats) if (t.accountid_partner == e) return t;
if (!t) return null;
let n = new y(e, this.m_ChatStore, this.m_ChatStore.CMInterface);
return this.m_rgFriendChats.push(n), n;
}
OnLogon() {
this.LoadFriendMessageSessions(),
m.Ul.SettingsStore.GetObjectFromLocalStorageWhenReady(b).then((e) => {
this.m_mapRecentIgnoreTimeBeforeByFriend.clear();
for (let t in e.ignoretimes) {
let n = parseInt(t, 10);
this.m_mapRecentIgnoreTimeBeforeByFriend.set(n, e.ignoretimes[t]);
}
});
}
RestoreStatePostDisconnect(e) {
e && this.LoadFriendMessageSessions();
for (let e of this.m_rgFriendChats) e.OnConnectionRestored();
}
GetServiceTransport() {
return this.m_ChatStore.CMInterface.GetServiceTransport();
}
LoadFriendMessageSessions() {
let e = a.gA.Init(l.mb);
e.Body().set_lastmessage_since(this.m_rtLastSessionUpdate),
e.Body().set_only_sessions_with_messages(!0),
l.Pt.GetActiveMessageSessions(this.GetServiceTransport(), e).then((e) => {
this.m_rtLastSessionUpdate = e.Body().timestamp();
for (let t of e.Body().message_sessions()) {
this.m_mapLastChatTimeByFriend.set(t.accountid_friend(), t.last_message()), this.GetFriendChat(t.accountid_friend()).InitMessageSessionFromServer(t.unread_message_count(), t.last_view(), t.last_message());
}
m.Ul.FriendStore.UpdateUnreadMessagesGlobal(), (this.m_bReceivedFriendChats = !0);
});
}
GetFriendChatsByLastChatTime() {
const e = [];
return (
this.m_mapLastChatTimeByFriend.forEach((t, n) => {
e.push([t, this.GetFriendChat(n)]);
}),
e.sort(([e], [t]) => t - e).map(([e, t]) => t)
);
}
GetFriendsWithUnreadMessages(e) {
let t = [];
for (let n of this.m_rgFriendChats) n.unread_message_count > 0 && (!e || n.GetVisibilityState(e) < 2) && !n.is_blocked_friend && t.push(n);
return t.sort((e, t) => e.time_last_message - t.time_last_message), t;
}
BIsFriendChatRecent(e) {
const t = m.Ul.GetServerRTime32() - this.RecentChatCutoffDuration,
n = this.m_mapLastChatTimeByFriend.get(e);
if (!n) return !1;
if (n >= t) {
let t = this.m_mapRecentIgnoreTimeBeforeByFriend.get(e);
if (!t || t < n) return !0;
}
return !1;
}
GetFriendChatsWithRecentMessages() {
return this.m_rgFriendChats.filter((e) => this.BIsFriendChatRecent(e.accountid_partner));
}
GetUnfilteredFriendsWithUnreadMessages() {
let e = [];
for (let t of this.m_rgFriendChats) t.unread_message_count > 0 && !t.is_blocked_friend && e.push(t);
return e.sort((e, t) => e.time_last_message - t.time_last_message), e;
}
GetAllChats() {
return this.m_rgFriendChats.slice();
}
get RecentChatCutoffDuration() {
return 3600;
}
get LastMessageCache() {
return this.m_LastMessageCache;
}
ClearRecentChatsForFriend(e) {
this.m_mapRecentIgnoreTimeBeforeByFriend.set(e, m.Ul.GetServerRTime32()), this.WriteRecentChatsPrefs();
}
WriteRecentChatsPrefs() {
let e = m.Ul.GetServerRTime32() - this.RecentChatCutoffDuration;
this.m_mapRecentIgnoreTimeBeforeByFriend.forEach((t, n) => {
t < e && this.m_mapRecentIgnoreTimeBeforeByFriend.delete(n);
}),
m.Ul.SettingsStore.StoreObjectInLocalStorage(b, { ignoretimes: new Map(this.m_mapRecentIgnoreTimeBeforeByFriend) });
}
get GetRecentlyChattingFriends() {
let e = [];
return (
this.m_mapLastChatTimeByFriend.forEach((t, n) => {
if (this.BIsFriendChatRecent(n)) {
let t = m.Ul.FriendStore.GetFriend(n);
t && e.push(t);
}
}),
e.sort(c.Xp.DefaultFriendSortComparator),
e
);
}
GetUnreadFriendMessageCount(e) {
let t = 0;
for (let n of this.m_rgFriendChats) n.unread_message_count > 0 && (!e || n.GetVisibilityState(e) < 2) && !n.is_blocked_friend && (t += n.unread_message_count);
return t;
}
GetFriendLastChatTime(e) {
return this.m_mapLastChatTimeByFriend.get(e) || 0;
}
AddFriendPushNotificationData(e, t) {
let n = new s.K(e.steamid_friend()).GetAccountID();
if (1 == e.chat_entry_type()) {
let t = e.local_echo() ? this.m_ChatStore.FriendStore.self.persona.m_steamid.GetAccountID() : n,
i = this.GetFriendChat(n, !1);
if (!i) return;
if (e.local_echo() && i.HasClientMessageInFlight(e.client_message_id())) return;
if (!i.HasChatMessage(e.previous_message_timestamp(), e.previous_message_ordinal())) return;
i.AppendChatMsg(t, e.current_message_timestamp(), e.current_message_ordinal(), e.message()), this.m_mapLastChatTimeByFriend.set(n, e.current_message_timestamp());
}
}
}
(0, i.gn)([d.LO], I.prototype, "m_rgFriendChats", void 0), (0, i.gn)([d.LO], I.prototype, "m_bReceivedFriendChats", void 0), (0, i.gn)([d.aD], I.prototype, "ClearRecentChatsForFriend", null), (0, i.gn)([d.Fl], I.prototype, "GetRecentlyChattingFriends", null);
class y extends u.j {
constructor(e, t, n) {
super(t.FriendStore, t, n), (this.m_iClearFriendIsTypingInterval = void 0), (this.m_bFriendIsTyping = !1), (this.m_bNeedsNonFriendWarning = !1), (0, d.rC)(this), (this.m_unAccountIDFriend = e), (this.m_MessageSendQueue = new v.o(e.toString())), this.m_MessageSendQueue.InitFromStorage().then(() => this.InitQueuedMessages());
}
GetLastMessage() {
if (!this.m_strLastMessage && !this.m_bChatLogsLoaded) {
const e = this.m_ChatStore.FriendChatStore.LastMessageCache.GetLastMessage(this.m_unAccountIDFriend);
if (e && this.m_rtLastMessageReceived <= e.rtTime) return e.strMessage;
if (
(this.LoadChatLogs().then(() => {
const e = this.chat_messages[this.chat_messages.length - 1];
e && ((this.m_strLastMessage = e.strMessage), (this.m_accountIDLastMessage = e.unAccountID), (this.m_rtLastMessageReceived = e.rtTimestamp), this.m_ChatStore.FriendChatStore.LastMessageCache.UpdateLastMessage(this.m_unAccountIDFriend, { strMessage: e.strMessage, rtTime: e.rtTimestamp, unAccountIDSender: e.unAccountID }));
}),
e)
)
return e.strMessage;
}
return this.m_strLastMessage;
}
get time_last_message() {
if (this.m_rtLastMessageReceived) return this.m_rtLastMessageReceived;
const e = this.m_ChatStore.FriendChatStore.LastMessageCache.GetLastMessage(this.m_unAccountIDFriend);
return e ? e.rtTime : void 0;
}
get accountid_last_message() {
if (this.m_accountIDLastMessage) return this.m_accountIDLastMessage;
const e = this.m_ChatStore.FriendChatStore.LastMessageCache.GetLastMessage(this.m_unAccountIDFriend);
return e ? e.unAccountIDSender : void 0;
}
get unread_message_count() {
let e = this.m_ChatStore.VoiceChat.BPartnerHasRequestedAndIsInOneOnOneChat(this.m_unAccountIDFriend);
return (e = e && !this.BVoiceActive()), this.m_cUnreadChatMessages + (e ? 1 : 0);
}
get VoiceChatStore() {
return this.m_ChatStore.VoiceChat;
}
SetShowNonFriendWarning(e) {
this.m_bNeedsNonFriendWarning = e;
}
GetShowNonFriendWarning() {
let e = this.m_bNeedsNonFriendWarning && !m.Ul.FriendStore.BApprovedNonFriendMessages(this.accountid_partner);
if (e) {
let t = m.Ul.FriendStore.GetFriend(this.accountid_partner);
e = !t || !t.is_friend;
}
return e;
}
GetMessagesFromTimeRange(e, t, n, i, o) {
let r = a.gA.Init(l.yq);
return (
r.Body().set_steamid1(this.m_CMInterface.steamid.ConvertTo64BitString()),
r.Body().set_steamid2(s.K.InitFromAccountID(this.m_unAccountIDFriend).ConvertTo64BitString()),
r.Body().set_count(u.j.k_LoadMoreMessageCount),
r.Body().set_bbcode_format(!0),
r.Body().set_rtime32_start_time(e),
r.Body().set_start_ordinal(t),
r.Body().set_time_last(n),
r.Body().set_ordinal_last(i),
S.Info(`${this.unique_id} friend trying to load ${o} messages in range ${e}:${t} - ${n}:${i}`),
l.Pt.GetRecentMessages(this.m_ChatStore.CMInterface.GetServiceTransport(), r).then((e) => {
let t = e.GetEResult();
if (1 != t) throw t;
return { messages: this.GetMessagesFromResponse(e), moreAvailable: e.Body().more_available() };
})
);
}
GetMessagesFromResponse(e) {
let t = e.Body().messages(),
n = [];
for (let e = t.length - 1; e >= 0; e--) {
let i = t[e],
o = i.accountid();
n.push(
new p.dz(
o,
i.timestamp(),
i.ordinal(),
i.message() || "",
i.reactions().map((e) => ({ eReactionType: e.reaction_type(), strReaction: e.reaction(), cReactors: e.reactors().length, bUserReacted: e.reactors().indexOf(m.Ul.FriendStore.self.accountid) > -1 })),
),
);
}
return n;
}
OnNewChatMsgAdded(e, t, n, i) {}
GetBBCodeParser() {
return this.m_ChatStore.FriendChatBBCodeParser;
}
AckChatMsgOnServer(e) {
let t = a.gA.Init(l.F5);
t.Body().set_steamid_partner(s.K.InitFromAccountID(this.accountid_partner).ConvertTo64BitString()), t.Body().set_timestamp(e), l.Pt.AckMessage(this.m_CMInterface.GetServiceTransport(), t);
}
CheckShouldNotify(e, t, n) {
super.CheckShouldNotify(e, t, n), this.m_ChatStore.FriendChatStore.LastMessageCache.UpdateLastMessage(this.m_unAccountIDFriend, { rtTime: e.rtTimestamp, strMessage: e.strMessage, unAccountIDSender: e.unAccountID });
}
get name() {
let e = this.chat_partner;
return e ? e.display_name : void 0;
}
get unique_id() {
return "f" + this.accountid_partner;
}
BIsVoiceAllowed() {
return !!this.chat_partner.is_friend && 0 != this.chat_partner.persona.m_ePersonaState;
}
GetVoiceNotAllowedReason() {
return this.chat_partner.is_friend ? (0 == this.chat_partner.persona.m_ePersonaState ? (0, h.Xx)("#VoiceChat_Unavailable_NotOnline", this.chat_partner.display_name) : null) : (0, h.Xx)("#VoiceChat_Unavailable_NotFriend", this.chat_partner.display_name);
}
ToggleVoiceChat() {
return this.ChatStore.VoiceChat.IsVoiceActiveForFriend(this.accountid_partner) ? this.ChatStore.VoiceChat.OnUserEndVoiceChat() : this.ChatStore.VoiceChat.InitiateFriendChat(this.accountid_partner), !0;
}
BVoiceActive() {
return this.ChatStore.VoiceChat.IsVoiceActiveForFriend(this.accountid_partner);
}
get is_blocked_friend() {
return this.chat_partner.is_blocked;
}
SendChatMessageInternal(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
this.chat_partner.is_friend || m.Ul.FriendStore.SetApprovedNonFriendMessages(this.chat_partner.accountid);
let t = this.AppendLocalEchoChatMsg(e);
this.m_strLastMessage = e;
let n = a.gA.Init(l.lN);
n.Body().set_chat_entry_type(1), n.Body().set_message(e), n.Body().set_steamid(s.K.InitFromAccountID(this.accountid_partner).ConvertTo64BitString()), n.Body().set_contains_bbcode(!0);
let i = (function () {
let e = "";
for (let t = 0; t < 16; t++) e += o.LO(0, 15).toString(16);
return e;
})();
n.Body().set_client_message_id(i), this.m_setInflightClientMessageID.add(i), (this.m_tsLastSentTypingNotification = void 0);
const r = yield this.SendWithRetries(t, () => l.Pt.SendMessage(this.m_CMInterface.GetServiceTransport(), n));
return this.m_setInflightClientMessageID.delete(i), r === p.p.None && this.m_ChatStore.FriendChatStore.LastMessageCache.UpdateLastMessage(this.m_unAccountIDFriend, { rtTime: t.rtTimestamp, unAccountIDSender: this.self.accountid, strMessage: t.strMessage }), r;
});
}
UpdateMessageReaction(e, t, n, o) {
return (0, i.mG)(this, void 0, void 0, function* () {
const i = a.gA.Init(l.UD);
i.Body().set_steamid(s.K.InitFromAccountID(this.accountid_partner).ConvertTo64BitString()), i.Body().set_reaction_type(t), i.Body().set_reaction(n), i.Body().set_is_add(o), i.Body().set_server_timestamp(e.rtTimestamp), i.Body().set_ordinal(e.unOrdinal);
const r = e.reactions.find((e) => n === e.strReaction),
c = o ? 1 : -1,
m = r ? r.cReactors + c : c;
e.UpdateReaction(t, n, m, o);
const d = yield l.Pt.UpdateMessageReaction(this.m_CMInterface.GetServiceTransport(), i);
return 1 !== d.GetEResult() ? (e.UpdateReaction(t, n, m - c, !o), S.Warning(`Error updating message reaction. EResult: ${d.GetEResult()}`)) : o && 1 === d.Body().reactors().length && (1 === t ? this.m_ChatStore.EmoticonStore.TrackEmoticonUsage(n, Date.now() / 1e3) : 2 === t && this.m_ChatStore.EmoticonStore.TrackStickerUsage(n, Date.now() / 1e3)), d.GetEResult();
});
}
GetMessageReactionReactors(e, t, n) {
const i = [];
return t.bUserReacted && i.push(m.Ul.FriendStore.self.accountid), t.cReactors > i.length && i.push(this.chat_partner.accountid), i.slice(0, n);
}
OnTyping() {
if (!this.m_tsLastSentTypingNotification || performance.now() - this.m_tsLastSentTypingNotification > 1e4) {
this.m_tsLastSentTypingNotification = performance.now();
let e = a.gA.Init(l.lN);
e.Body().set_chat_entry_type(2), e.Body().set_steamid(s.K.InitFromAccountID(this.accountid_partner).ConvertTo64BitString()), l.Pt.SendMessage(this.m_CMInterface.GetServiceTransport(), e);
}
}
get is_friend_typing() {
return this.m_bFriendIsTyping;
}
OnFriendTypingNotification() {
this.m_bFriendIsTyping || (this.m_bFriendIsTyping = !0),
void 0 !== this.m_iClearFriendIsTypingInterval && window.clearInterval(this.m_iClearFriendIsTypingInterval),
(this.m_iClearFriendIsTypingInterval = window.setTimeout(() => {
(this.m_iClearFriendIsTypingInterval = void 0), this.ClearFriendIsTypingState();
}, 11e3));
}
PlayFriendMessageSound() {
m.Ul.FriendStore.GetUserDoNotDisturb() || m.Ul.AudioPlaybackManager.PlayAudioURL(r.De.COMMUNITY_CDN_URL + "public/sounds/webui/ui_steam_message_old_smooth.m4a");
}
OnReceivedNewMessage(e, t, n, i) {
if (!e.BIsLocalEcho() && e.unAccountID != this.self.accountid) {
if ((this.ClearFriendIsTypingState(), t < 2 && (this.is_blocked_friend || m.Ul.FriendStore.BIsInvisibleMode()))) return;
if (m.Ul.NotificationManager.BNotificationsPermitted() && this.chat_partner.BShowMessageNotification() && t < 4 && !m.Ul.FriendStore.GetUserDoNotDisturb()) {
let t = { title: this.chat_partner.display_name, body: n, tag: "message_" + this.chat_partner.accountid, steamid: this.chat_partner.persona.m_steamid.ConvertTo64BitString() };
(t = this.DecorateNotification(e, t, n, i)), (t.body = this.m_ChatStore.TextFilterStore.FilterText(e.unAccountID, t.body)), t.body && (this.GetShowNonFriendWarning() && m.Ul.SettingsStore.BClientHasFeatureOrOnWeb("NonFriendMessageHandling") && (t.body = ""), m.Ul.NotificationManager.DisplayNotificationFromFriend(this.chat_partner, t), this.m_bHasUnreadPriorityChatMessages || ((this.m_bHasUnreadPriorityChatMessages = !0), m.Ul.FriendStore.UpdateUnreadMessagesGlobal()));
}
if ((this.chat_partner.BPlayMessageSound() && t < 4 && this.PlayFriendMessageSound(), t < 4 && !m.Ul.FriendStore.GetUserDoNotDisturb())) {
const e = m.Ul.SettingsStore.FriendsSettings.nChatFlashMode;
let t = Promise.resolve(0 == e);
1 == e && (t = m.Ul.UIStore.IsChatWindowMinimized(this)),
t.then((e) => {
e && m.Ul.UIStore.FlashChatWindow(this, !0);
});
}
}
}
ClearFriendIsTypingState() {
void 0 !== this.m_iClearFriendIsTypingInterval && (window.clearInterval(this.m_iClearFriendIsTypingInterval), (this.m_iClearFriendIsTypingInterval = void 0)), (this.m_bFriendIsTyping = !1);
}
PopulateCommitFileUploadFormData(e, t) {
e.append("friend_steamid", s.K.InitFromAccountID(this.accountid_partner).ConvertTo64BitString()), e.append("spoiler", t.bSpoiler ? "1" : "0");
}
GetMember(e) {
return e == this.m_unAccountIDFriend ? this.chat_partner : e == this.self.accountid ? this.self : void 0;
}
get accountid_partner() {
return this.m_unAccountIDFriend;
}
get chat_partner() {
return m.Ul.FriendStore.GetPlayer(this.m_unAccountIDFriend);
}
ViewerNeedsApproval(e) {
let t = `[broadcastviewrequest requestid="${e}"][/broadcastviewrequest]`;
this.InternalAppendChatMsg(new p.dz(this.chat_partner.accountid, m.Ul.GetServerRTime32(), 0, t)), m.Ul.FriendStore.GetUserDoNotDisturb() || m.Ul.NotificationManager.DisplayNotificationFromFriend(this.chat_partner, { title: "", body: (0, h.Xx)("#Chat_BroadcastViewRequest_Notification"), tag: "message_" + this.chat_partner.accountid, steamid: this.chat_partner.persona.m_steamid.ConvertTo64BitString() });
}
}
(0, i.gn)([d.LO], y.prototype, "m_bFriendIsTyping", void 0), (0, i.gn)([d.LO], y.prototype, "m_bNeedsNonFriendWarning", void 0), (0, i.gn)([d.aD], y.prototype, "ToggleVoiceChat", null), (0, i.gn)([_.ak, (0, g.D)(100)], y.prototype, "PlayFriendMessageSound", null), (0, i.gn)([d.aD], y.prototype, "ClearFriendIsTypingState", null), (0, i.gn)([d.aD], y.prototype, "ViewerNeedsApproval", null);
class E {
constructor() {
this.m_cache = d.LO.map();
}
Init() {
return (0, i.mG)(this, void 0, void 0, function* () {
try {
const e = yield m.Ul.Storage.GetObject(E.StorageKey);
this.Validate(e) ? (this.m_cache.replace(e), this.TrimCache()) : this.ClearCache();
} catch (e) {
S.Error(`There was a problem loading recent friend messages from storage: ${e}`), this.ClearCache();
}
});
}
Validate(e) {
if ("object" != typeof e || !e) return !1;
for (const t in e) {
if (isNaN(parseInt(t))) return !1;
const n = e[t];
if ("object" != typeof n) return !1;
if (("string" != typeof n.strMessage && null !== n.strMessage) || "number" != typeof n.rtTime || "number" != typeof n.unAccountIDSender) return !1;
}
return !0;
}
ClearCache() {
this.m_cache.clear(), this.SerializeToStorage();
}
SerializeToStorage() {
return m.Ul.Storage.StoreObject(E.StorageKey, Object.fromEntries(this.m_cache));
}
GetLastMessage(e) {
return this.m_cache.get(e.toString());
}
UpdateLastMessage(e, t) {
return this.m_cache.set(e.toString(), t), this.SerializeToStorage();
}
TrimCache() {
const e = Date.now() / 1e3;
this.m_cache.forEach(({ rtTime: t }, n) => {
t < e - C._H.PerYear / 2 && this.m_cache.delete(n);
}),
this.SerializeToStorage();
}
}
E.StorageKey = "FriendLastMessageCache";
class D {
Init() {
return (0, i.mG)(this, void 0, void 0, function* () {});
}
GetLastMessage() {}
UpdateLastMessage() {
return (0, i.mG)(this, void 0, void 0, function* () {});
}
}
},
10167: (e, t, n) => {
"use strict";
n.d(t, { a2: () => C, h1: () => g, jY: () => M, v5: () => _ });
var i = n(85556),
o = n(9824),
r = n(1736),
a = n(88991),
s = n(76262),
l = n(58594),
c = n(72746),
m = n(79588),
d = n(84290),
h = n(23346),
u = n(26626),
p = n(66035);
const _ = -6;
var g;
!(function (e) {
(e[(e.eOnlineOnly = 0)] = "eOnlineOnly"), (e[(e.eOnlineOnlyNotInGame = 1)] = "eOnlineOnlyNotInGame"), (e[(e.eOfflineOnly = 2)] = "eOfflineOnly"), (e[(e.eIncomingInvites = 3)] = "eIncomingInvites"), (e[(e.eOutgoingInvites = 4)] = "eOutgoingInvites"), (e[(e.eAll = 5)] = "eAll");
})(g || (g = {}));
class C {
constructor(e) {
(this.m_eDisplayType = g.eAll), (this.m_strName = ""), (this.m_bCollapsed = !1), (this.m_OnHeaderClick = void 0), (this.m_rgAccountIDMembers = m.LO.array()), (this.m_setMembers = new Set()), (0, m.rC)(this), (this.m_strName = e);
}
get name() {
return this.m_strName;
}
set name(e) {
this.m_strName = e;
}
get icon_url() {
return "";
}
get display_type() {
return this.m_eDisplayType;
}
get onheaderclick() {
return this.m_OnHeaderClick;
}
get collapsed() {
return this.m_bCollapsed;
}
set collapsed(e) {
this.m_bCollapsed = e;
}
GetCurrentMemberSet() {
return this.m_setMembers;
}
get member_count() {
return this.display_type == g.eAll ? this.unfiltered_count : this.member_list.length;
}
get unfiltered_count() {
return this.member_accountid_list.length;
}
get member_counts() {
let e = 0,
t = 0;
for (let n of this.member_list_unsorted) n.persona.is_online && (e++, n.persona.is_ingame && t++);
return { online: e, ingame: t };
}
SetOnHeaderClick(e) {
this.m_OnHeaderClick = e;
}
Clear() {
this.m_rgAccountIDMembers.clear(), this.m_setMembers.clear();
}
AddMember(e) {
this.HasMember(e) || (this.m_setMembers.add(e), this.m_rgAccountIDMembers.push(e));
}
RemoveMember(e) {
this.HasMember(e) && (this.m_setMembers.delete(e), o.Zf(this.m_rgAccountIDMembers, e));
}
HasMember(e) {
return this.m_setMembers.has(e);
}
get GetRawMemberList() {
return this.m_rgAccountIDMembers.map((e) => c.Ul.FriendStore.GetPlayer(e));
}
get member_list() {
let e = this.member_list_unsorted.slice();
return e.sort(h.Xp.DefaultFriendSortComparator), e;
}
get member_list_unsorted() {
let e = [];
for (let t of this.GetRawMemberList)
if ((this.display_type != g.eOnlineOnly || t.persona.is_online) && (this.display_type != g.eOfflineOnly || !t.persona.is_online)) {
if (this.display_type == g.eOnlineOnlyNotInGame) {
if (!t.persona.is_online || t.persona.is_ingame) continue;
if (t.persona.m_broadcastAppId && t.persona.m_broadcastAppId == p.rr.appID) continue;
}
e.push(t);
}
return e;
}
get member_accountid_list() {
return this.m_rgAccountIDMembers;
}
}
(0, i.gn)([m.LO], C.prototype, "m_strName", void 0), (0, i.gn)([m.LO], C.prototype, "m_bCollapsed", void 0), (0, i.gn)([m.Fl], C.prototype, "member_count", null), (0, i.gn)([m.Fl], C.prototype, "unfiltered_count", null), (0, i.gn)([m.Fl], C.prototype, "member_counts", null), (0, i.gn)([m.aD], C.prototype, "SetOnHeaderClick", null), (0, i.gn)([m.aD], C.prototype, "Clear", null), (0, i.gn)([m.aD], C.prototype, "AddMember", null), (0, i.gn)([m.aD], C.prototype, "RemoveMember", null), (0, i.gn)([m.Fl], C.prototype, "member_list", null), (0, i.gn)([m.Fl], C.prototype, "member_list_unsorted", null);
class f extends C {
constructor(e, t = -1, n = !1, i = !1) {
super(e), (this.m_bModifiable = !1), (this.m_bAcceptsGroupRemovals = !1), (0, m.rC)(this), (this.m_iGroupID = t), (this.m_bModifiable = n), (this.m_bAcceptsGroupRemovals = i);
}
get id() {
return this.m_iGroupID;
}
get unique_id() {
return "" + this.m_iGroupID;
}
get modifiable() {
return this.m_bModifiable;
}
get accepts_group_removals() {
return this.m_bAcceptsGroupRemovals;
}
get should_filter_categorized_friends() {
return !1;
}
get GetRawMemberList() {
return this.member_accountid_list.map((e) => c.Ul.FriendStore.GetPlayer(e));
}
GetMembersMatchingSearch(e) {
let t = [];
for (let n of this.GetRawMemberList) n.BMatchesSearchString(e, !1) && t.push(n);
return t.sort(h.Xp.DefaultFriendSortComparator), t;
}
}
(0, i.gn)([m.Fl], f.prototype, "GetRawMemberList", null);
class v extends f {
get display_type() {
return c.Ul.SettingsStore.FriendsSettings.bHideOfflineFriendsInTagGroups ? g.eOnlineOnly : g.eAll;
}
}
class S extends f {
constructor(e, t) {
super(e, t, !1, !0), (this.m_eDisplayType = g.eOnlineOnlyNotInGame);
}
get unique_id() {
return "all";
}
get display_type() {
return c.Ul.SettingsStore.FriendsSettings.bCategorizeInGameFriendsByGame ? g.eOnlineOnlyNotInGame : g.eOnlineOnly;
}
get should_filter_categorized_friends() {
return c.Ul.SettingsStore.FriendsSettings.bHideCategorizedFriends;
}
}
class b extends f {
constructor(e, t) {
super(e, t, !1, !0);
}
get unique_id() {
return "offline";
}
get should_filter_categorized_friends() {
let e = c.Ul.SettingsStore.FriendsSettings;
return e.bHideCategorizedFriends && !e.bHideOfflineFriendsInTagGroups;
}
}
class I extends f {
constructor(e, t) {
super(e, t, !1, !0), (this.m_eDisplayType = g.eOutgoingInvites);
}
get unique_id() {
return "outgoing";
}
}
class y extends f {
constructor(e, t) {
super(e, t, !1, !0);
}
get unique_id() {
return "ingame";
}
}
class E extends f {
constructor(e, t) {
super(e, t, !1, !0), (this.m_mapSteamIDToMutualFriends = m.LO.map()), (this.m_unMutualFriendsCacheHash = 0), (this.m_eDisplayType = g.eIncomingInvites);
}
get unique_id() {
return "incominginvites";
}
GetMutualFriendsCacheHash() {
return this.m_unMutualFriendsCacheHash;
}
SetMutualFriendsCacheHash(e) {
this.m_unMutualFriendsCacheHash = e;
}
SetMutualFriends(e) {
this.m_mapSteamIDToMutualFriends.replace(e);
}
get map_steamid_to_mutual_friends() {
return this.m_mapSteamIDToMutualFriends;
}
}
class D extends f {
constructor(e) {
super("", e, !1, !1), (0, m.rC)(this);
}
get is_initialized() {
return 0 != this.id && c.Ul.AppInfoStore.GetAppInfo(this.id).is_initialized;
}
get unique_id() {
return "game_" + this.id;
}
get name() {
return !this.is_initialized || this.id < 0 ? "" : c.Ul.AppInfoStore.GetAppInfo(this.id).name;
}
set name(e) {}
get icon_url() {
return !this.is_initialized || this.id < 0 ? "" : c.Ul.AppInfoStore.GetAppInfo(this.id).icon_url;
}
PlayerGroupSortComparator(e, t, n, i) {
let o = e.persona.player_group,
r = t.persona.player_group,
a = o ? Math.max(e.persona.player_group_size, n.get(o) || 1) : 1,
s = r ? Math.max(t.persona.player_group_size, n.get(r) || 1) : 1;
return a != s ? s - a : a > 1 && o != r ? o.localeCompare(r) : i(e, t);
}
get member_list() {
let e = [],
t = new Map();
for (let n of this.GetRawMemberList)
if ((e.push(n), n.persona.player_group)) {
let e = t.get(n.persona.player_group);
t.set(n.persona.player_group, e ? e + 1 : 1);
}
let n = h.Xp.DefaultFriendSortComparator;
return 0 == this.id ? e.sort(n) : e.sort((e, i) => this.PlayerGroupSortComparator(e, i, t, n)), e;
}
}
(0, i.gn)([m.KG], D.prototype, "member_list", null);
const w = { groups: { offline: !0, outgoing: !0 } },
R = "FriendGroupCollapse";
class A {
constructor() {
(this.m_mapCollapsePrefs = m.LO.map()), (0, m.rC)(this);
}
Init() {
c.Ul.SettingsStore.GetObjectFromLocalStorageWhenReady(R, w).then((e) => {
this.m_mapCollapsePrefs.clear();
for (let t in e.groups) "boolean" == typeof e.groups[t] && this.m_mapCollapsePrefs.set(t, e.groups[t]);
});
}
GetUserGroupCollapsed(e) {
return !!this.m_mapCollapsePrefs.get(e);
}
SetUserGroupCollapsed(e, t) {
!!this.m_mapCollapsePrefs.get(e) != t && (t || w.groups[e] ? this.m_mapCollapsePrefs.set(e, t) : this.m_mapCollapsePrefs.delete(e), this.WritePrefs());
}
ToggleUserGroupCollapsed(e) {
this.SetUserGroupCollapsed(e, !this.GetUserGroupCollapsed(e));
}
WritePrefs() {
c.Ul.SettingsStore.StoreObjectInLocalStorage(R, { groups: Object.fromEntries(this.m_mapCollapsePrefs) });
}
}
(0, i.gn)([m.aD], A.prototype, "SetUserGroupCollapsed", null), (0, i.gn)([m.aD], A.prototype, "ToggleUserGroupCollapsed", null);
class M {
constructor(e) {
(this.m_FriendGroupDisplayPrefs = new A()), (this.m_mapGroups = m.LO.map()), (this.m_mapGameGroups = m.LO.map()), (this.m_singletonGameGroup = new D(0)), (this.m_nonSteamGameGroup = new D(_)), (this.m_groupAllFriends = new S((0, d.Xx)("#FriendGroup_Online"), -1)), (this.m_groupOfflineFriends = new b((0, d.Xx)("#FriendGroup_Offline"), -3)), (this.m_groupIngameFriends = new y((0, d.Xx)("#FriendGroup_InGame"), -4)), (this.m_groupIncomingInvites = new E((0, d.Xx)("#FriendGroup_IncomingInvites"), -5)), (this.m_groupOutgoingInvites = new I((0, d.Xx)("#FriendGroup_Outgoing"), -6)), (0, m.rC)(this), (this.m_FriendStore = e), (this.m_groupOfflineFriends.m_eDisplayType = g.eOfflineOnly);
}
Init(e) {
(this.m_CMInterface = e),
this.m_FriendGroupDisplayPrefs.Init(),
this.m_CMInterface.AddOnLogonCallback(
() =>
(0, i.mG)(this, void 0, void 0, function* () {
let e = r.gA.Init(u.u),
t = yield u.qW.GetCategories(this.m_CMInterface.GetServiceTransport(), e);
1 == t.GetEResult() && this.RecvCategoriesList(t.Body());
}),
47,
);
}
get all_friends() {
return this.m_groupAllFriends;
}
get ingame_group() {
return this.m_groupIngameFriends;
}
get incoming_invites_group() {
return this.m_groupIncomingInvites;
}
get outgoing_invites_group() {
return this.m_groupOutgoingInvites;
}
get friend_groups() {
return [...this.game_groups, ...this.user_groups, ...this.default_groups];
}
get groupDisplayPrefs() {
return this.m_FriendGroupDisplayPrefs;
}
get user_groups() {
let e = [];
return (
this.m_mapGroups.forEach((t) => {
e.push(t);
}),
e.sort((e, t) => e.name.localeCompare(t.name)),
e
);
}
get game_groups() {
let e = [],
t = 2;
return (
1 == this.m_singletonGameGroup.unfiltered_count && (t = 1),
this.m_mapGameGroups.forEach((n) => {
n.name && n.member_count >= t && e.push(n);
}),
e.sort((e, t) => (e.member_count == t.member_count ? e.name.localeCompare(t.name) : t.member_count - e.member_count)),
e
);
}
get singleton_game_group() {
if (1 == this.m_singletonGameGroup.unfiltered_count) {
let e = this.m_singletonGameGroup.member_accountid_list[0];
if (!c.Ul.FriendStore.GetPlayer(e).persona.is_in_nonsteam_game) return;
}
return this.m_singletonGameGroup;
}
get default_groups() {
return [this.m_groupAllFriends, this.m_groupOfflineFriends];
}
get games_with_friends_playing() {
return Array.from(this.m_mapGameGroups.keys());
}
GetGameGroup(e) {
return this.m_mapGameGroups.get(e);
}
GetCountFriendsInGame(e) {
var t;
return (null === (t = this.m_mapGameGroups.get(e)) || void 0 === t ? void 0 : t.unfiltered_count) || 0;
}
GetMaxCountFriendsInGame() {
return Array.from(this.m_mapGameGroups.values()).reduce((e, t) => (t.unfiltered_count > e ? t.unfiltered_count : e), 0);
}
OnFullFriendsListUpdateStart() {
this.m_groupOfflineFriends.Clear(), this.m_groupAllFriends.Clear(), this.m_groupIncomingInvites.Clear(), this.m_groupOutgoingInvites.Clear();
}
OnFullFriendsListUpdateComplete() {
this.m_mapGameGroups.clear(), this.m_singletonGameGroup.Clear(), this.m_groupIngameFriends.Clear();
for (let e of this.m_FriendStore.all_friends)
if (e.persona.is_ingame) {
let t = e.persona.is_in_nonsteam_game ? _ : e.persona.m_unGamePlayedAppID;
this.OnFriendGameChanged(e.accountid, 0, t);
}
}
OnPersonaStateCacheReset() {
this.m_mapGameGroups.clear(), this.m_singletonGameGroup.Clear(), this.m_groupIngameFriends.Clear();
}
OnFriendAdded(e) {
this.m_groupAllFriends.AddMember(e), this.m_groupOfflineFriends.AddMember(e);
}
OnFriendRemoved(e) {
this.m_groupAllFriends.RemoveMember(e),
this.m_groupOfflineFriends.RemoveMember(e),
this.m_groupIngameFriends.RemoveMember(e),
this.m_singletonGameGroup.RemoveMember(e),
this.m_mapGroups.forEach((t) => {
t.RemoveMember(e);
}),
this.m_mapGameGroups.forEach((t) => {
t.RemoveMember(e);
});
}
OnFriendGameChanged(e, t, n) {
let i = t == _ ? this.m_nonSteamGameGroup : 0 != t ? this.m_mapGameGroups.get(t) : null,
o = n == _ ? this.m_nonSteamGameGroup : 0 != n ? this.m_mapGameGroups.get(n) : null;
(i && o && t == n) || (o && o.HasMember(e)) || (i && i.HasMember(e) && (i.RemoveMember(e), 0 == i.unfiltered_count || i == this.m_nonSteamGameGroup ? this.m_singletonGameGroup.RemoveMember(e) : 1 == i.unfiltered_count && this.m_singletonGameGroup.AddMember(i.member_accountid_list[0])), o || 0 == n || ((o = new D(n)), this.m_mapGameGroups.set(n, o)), o && (0 == o.unfiltered_count || o == this.m_nonSteamGameGroup ? this.m_singletonGameGroup.AddMember(e) : 1 == o.unfiltered_count && this.m_singletonGameGroup.RemoveMember(o.member_accountid_list[0]), o.AddMember(e)), 0 != n ? this.m_groupIngameFriends.AddMember(e) : this.m_groupIngameFriends.RemoveMember(e));
}
OnIncomingInviteAdded(e) {
this.m_groupIncomingInvites.AddMember(e);
}
OnIncomingInviteRemoved(e) {
this.m_groupIncomingInvites.RemoveMember(e);
}
OnOutgoingInviteAdded(e) {
this.m_groupOutgoingInvites.AddMember(e);
}
OnOutgoingInviteRemoved(e) {
this.m_groupOutgoingInvites.RemoveMember(e);
}
EnsureMutualFriendsForIncomingInvites() {
function e(e) {
let t = 2166136261;
for (let n = 0; n < e.length; ++n) (t ^= e.charCodeAt(n)), (t += (t << 1) + (t << 4) + (t << 7) + (t << 8) + (t << 24));
return t >>> 0;
}
let t = 0;
for (let n of this.m_groupIncomingInvites.member_list) t ^= e("" + n.accountid);
if (this.m_groupIncomingInvites.GetMutualFriendsCacheHash() == t) return;
this.m_groupIncomingInvites.SetMutualFriendsCacheHash(t);
let n = r.gA.Init(l.B);
l.lk.GetMutualFriendsForIncomingInvites(this.m_CMInterface.GetServiceTransport(), n).then((e) => {
if (1 != e.GetEResult()) return;
if (this.m_groupIncomingInvites.GetMutualFriendsCacheHash() != t) return;
let n = m.LO.map();
for (let t of e.Body().incoming_invite_mutual_friends_lists()) {
let e = new Set();
for (let n of t.mutual_friend_account_ids()) e.add(n);
n.set(t.steamid(), e);
}
this.m_groupIncomingInvites.SetMutualFriends(n);
});
}
CreateGroup(e, t) {
let n = r.gA.Init(s.l5, 5560);
return (
n.Body().set_groupname(e),
t && n.Body().set_steamid_friends(t),
new Promise((i, o) => {
this.m_CMInterface
.SendMsgAndAwaitResponse(n, s.wr)
.then((n) => {
1 == n.Body().eresult() &&
(0, m.z)(() => {
let i = n.Body().groupid(),
o = new v(e, n.Body().groupid(), !0);
if (t) for (let e of t) o.AddMember(new a.K(e).GetAccountID());
this.m_mapGroups.set(i, o);
}),
i(1 == n.Body().eresult());
})
.catch(() => {
i(!1);
});
})
);
}
ManageGroup(e, t, n, i) {
if (t == e.name && !n && !i) return Promise.resolve(!0);
let o = r.gA.Init(s._q, 5564);
return (
o.Body().set_groupid(e.id),
t && t != e.name && o.Body().set_groupname(t),
n && o.Body().set_steamid_friends_added(n),
i && o.Body().set_steamid_friends_removed(i),
new Promise((r, l) => {
this.m_CMInterface
.SendMsgAndAwaitResponse(o, s.r1)
.then((o) => {
if (1 == o.Body().eresult()) {
e.name = t;
for (let t of n) e.AddMember(new a.K(t).GetAccountID());
for (let t of i) e.RemoveMember(new a.K(t).GetAccountID());
}
r(1 == o.Body().eresult());
})
.catch(() => {
r(!1);
});
})
);
}
RemoveGroup(e) {
let t = r.gA.Init(s.QY, 5562);
t.Body().set_groupid(e.id),
this.m_CMInterface.SendMsgAndAwaitResponse(t, s.dZ).then((t) => {
1 == t.Body().eresult() && this.HandleGroupRemoval(e);
});
}
HandleGroupRemoval(e) {
this.m_mapGroups.delete(e.id);
}
get categorized_friend_set() {
let e = new Set();
return (
this.m_mapGroups.forEach((t) => {
t.member_accountid_list.forEach(e.add.bind(e));
}),
e
);
}
RecvCategoriesList(e) {
this.m_mapGroups.clear();
for (let t of e.categories()) {
let e = t.groupid(),
n = new v(t.name() || "", t.groupid(), !0);
(n.m_eDisplayType = g.eAll), this.m_mapGroups.set(e, n);
for (let e of t.accountid_members()) n.AddMember(e);
}
}
TransferFriendFromToGroup(e, t, n) {
let i = n && n.modifiable,
o = t && t.modifiable,
a = [];
if (i) {
let t = r.gA.Init(s.Ek, 5566);
t.Body().set_groupid(n.id), t.Body().set_steamiduser(e.persona.m_steamid.ConvertTo64BitString()), a.push(this.m_CMInterface.SendMsgAndAwaitResponse(t, s.Yw).then((t) => 1 == t.Body().eresult() && (n.AddMember(e.accountid), !0)));
}
if (o) {
let n = r.gA.Init(s.Py, 5568);
n.Body().set_groupid(t.id), n.Body().set_steamiduser(e.persona.m_steamid.ConvertTo64BitString()), a.push(this.m_CMInterface.SendMsgAndAwaitResponse(n, s.Kl).then((n) => 1 == n.Body().eresult() && (t.RemoveMember(e.accountid), 0 == t.unfiltered_count && this.HandleGroupRemoval(t), !0)));
}
return Promise.all(a);
}
FillInChatUsabilityMetrics(e) {
e.metrics().set_friends_category_count(this.m_mapGroups.size), e.metrics().set_friends_categorized_count(this.categorized_friend_set.size), this.singleton_game_group && e.metrics().set_friends_in_game_singleton_count(this.singleton_game_group.unfiltered_count), e.metrics().set_game_group_count(this.game_groups.length);
let t = (e) => this.m_FriendGroupDisplayPrefs.GetUserGroupCollapsed(e.unique_id),
n = e.ui_state().category_collapse();
n.set_in_game_collapsed(t(this.m_singletonGameGroup)), n.set_online_collapsed(t(this.m_groupAllFriends)), n.set_offline_collapsed(t(this.m_groupOfflineFriends)), n.set_categories_collapsed(o.W(Array.from(this.m_mapGroups.values()), t)), n.set_game_groups_collapsed(o.W(Array.from(this.m_mapGameGroups.values()), t));
}
}
(0, i.gn)([m.Fl], M.prototype, "friend_groups", null), (0, i.gn)([m.Fl], M.prototype, "user_groups", null), (0, i.gn)([m.Fl], M.prototype, "game_groups", null), (0, i.gn)([m.Fl], M.prototype, "singleton_game_group", null), (0, i.gn)([m.Fl], M.prototype, "default_groups", null), (0, i.gn)([m.Fl], M.prototype, "games_with_friends_playing", null), (0, i.gn)([m.aD], M.prototype, "OnFullFriendsListUpdateComplete", null), (0, i.gn)([m.aD], M.prototype, "OnPersonaStateCacheReset", null), (0, i.gn)([m.aD], M.prototype, "HandleGroupRemoval", null), (0, i.gn)([m.Fl], M.prototype, "categorized_friend_set", null), (0, i.gn)([m.aD], M.prototype, "RecvCategoriesList", null), (0, i.gn)([m.aD], M.prototype, "TransferFriendFromToGroup", null);
},
32572: (e, t, n) => {
"use strict";
n.d(t, { C: () => d, j: () => m });
var i = n(85556),
o = n(1736),
r = n(26626),
a = n(72746),
s = n(79588),
l = n(9824),
c = n(93635);
function m(e, t) {
return e == t || (e && t && e.friend == t.friend && e.clan == t.clan && e.chat == t.chat);
}
class d {
constructor(e) {
(this.m_rgFavorites = s.LO.array()), (0, s.rC)(this), (this.m_FriendStore = e), (this.m_ClanStore = e.ClanStore);
}
Init(e) {
(this.m_CMInterface = e),
(this.m_ChatStore = a.Ul.ChatStore),
this.m_CMInterface.AddOnLogonCallback(() => {
let e = o.gA.Init(r.Zi);
r.qW.GetFavorites(this.m_CMInterface.GetServiceTransport(), e).then((e) => {
1 == e.GetEResult() && this.RecvFavoritesList(e.Body().favorites());
});
}, 47),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandlerAction(r.i6.FavoritesChangedHandler, (e) => (this.RecvFavoritesList(e.Body().favorites()), 1));
}
BIsFavorited(e) {
for (let t of this.m_rgFavorites) if (m(t, e)) return !0;
return !1;
}
get favorites() {
return this.m_rgFavorites;
}
AddToFavorites(e, t) {
let n = this.m_rgFavorites.findIndex((t) => m(t, e));
return -1 === n || (void 0 !== t && n !== t) ? (-1 !== n ? l.hV(this.m_rgFavorites, n, t > n ? t - 1 : t) : void 0 !== t ? this.m_rgFavorites.splice(t, 0, e) : this.m_rgFavorites.push(e), this.SaveFavorites()) : Promise.resolve(!0);
}
RemoveFromFavorites(e) {
return l.Qf(this.m_rgFavorites, (t) => m(t, e)) ? this.SaveFavorites() : Promise.resolve(!0);
}
OnFriendRemoved(e) {
let t = this.m_FriendStore.GetPlayer(e);
this.RemoveFromFavorites({ friend: t });
}
SaveFavorites() {
let e = o.gA.Init(r.k4);
for (let t of this.m_rgFavorites) {
let n = e.Body().add_favorites();
t.friend ? n.set_accountid(t.friend.accountid) : t.clan ? n.set_clanid(t.clan.clanid) : t.chat ? n.set_chat_group_id(t.chat.GetGroupID()) : (0, c.X)(!1, "empty favorite struct");
}
return r.qW.SetFavorites(this.m_CMInterface.GetServiceTransport(), e).then((e) => 1 == e.GetEResult());
}
ReadFavorites(e) {
this.m_rgFavorites.clear();
for (let t of e)
if (t.accountid()) {
let e = this.m_FriendStore.GetFriend(t.accountid());
e && this.m_rgFavorites.push({ friend: e });
} else if (t.clanid()) {
let e = this.m_ClanStore.GetClan(t.clanid());
e && this.m_rgFavorites.push({ clan: e });
} else if (t.chat_group_id()) {
let e = this.m_ChatStore.GetChatRoomGroup(t.chat_group_id());
e && this.m_rgFavorites.push({ chat: e });
}
}
RecvFavoritesList(e) {
(0, s.gx)(() => this.m_FriendStore.friends_list_ready && this.m_ChatStore.chat_group_list_ready, this.ReadFavorites.bind(this, e));
}
FillInChatUsabilityMetrics(e) {
e.metrics().set_friends_favorite_count(l.W(this.m_rgFavorites, (e) => !!e.friend)), e.metrics().set_group_chat_favorite_count(l.W(this.m_rgFavorites, (e) => !!e.chat || !!e.clan));
}
}
(0, i.gn)([s.aD], d.prototype, "AddToFavorites", null), (0, i.gn)([s.aD], d.prototype, "RemoveFromFavorites", null), (0, i.gn)([s.aD], d.prototype, "OnFriendRemoved", null), (0, i.gn)([s.aD], d.prototype, "ReadFavorites", null);
},
33082: (e, t, n) => {
"use strict";
function i(e, t) {
return e.m_unPID == t.m_unPID && e.m_nBrowserID == t.m_nBrowserID;
}
n.d(t, { D: () => o, n: () => i });
const o = { m_unPID: 0, m_nBrowserID: -1 };
},
37234: (e, t, n) => {
"use strict";
n.d(t, { YF: () => In, D: () => sn.D, i5: () => un, iY: () => fn, PX: () => vn, Um: () => ln, rb: () => cn, Og: () => mn, yz: () => Sn, g_FriendsUIDesktopApp: () => yn, pF: () => bn });
var i = n(85556),
o = n(19953),
r = n(39827);
class a {
constructor() {
this.m_rgActivityCallbacks = [];
}
AddTrackedWindow(e) {}
BIsUserIdle(e) {
return this.GetUserIdleTime() > e;
}
AddOnIdleCallback(e, t) {
this.RunOnIdleCallback(e, t);
}
AddOnNextActivityCallback(e) {
this.m_rgActivityCallbacks.push(e);
}
Init() {}
FireOnUserActivityCallbacks() {
if (this.m_rgActivityCallbacks.length) {
for (let e of this.m_rgActivityCallbacks) e();
this.m_rgActivityCallbacks = [];
}
}
RunOnIdleCallback(e, t) {
this.GetUserIdleTime() >= t - 1 ? e() : SetBackgroundTimeout(this.RunOnIdleCallback.bind(this, e, t), 1e3 * (t - this.GetUserIdleTime()));
}
}
var s = n(2049),
l = n(9824);
class c extends a {
constructor() {
super(), (this.m_rgWindows = []), (this.m_bEventTrackingActive = !1), (this.m_msUserLastAction = performance.now());
}
GetUserIdleTime() {
return Math.floor((performance.now() - this.m_msUserLastAction) / 1e3);
}
AddTrackedWindow(e) {
this.m_rgWindows.push(e), e.addEventListener("unload", this.RemoveTrackedWindow.bind(this, e)), this.m_bEventTrackingActive && this.BindEventsForWindow(e);
}
Init() {
window.setTimeout(this.BindEvents.bind(this), 1e4);
}
RemoveTrackedWindow(e) {
this.m_bEventTrackingActive && this.UnbindEventsForWindow(e), l.Zf(this.m_rgWindows, e);
}
OnUserAction() {
(this.m_msUserLastAction = performance.now()), this.FireOnUserActivityCallbacks(), this.UnbindEvents(), window.setTimeout(this.BindEvents.bind(this), 1e4);
}
BindEvents() {
if (!this.m_bEventTrackingActive) {
this.m_bEventTrackingActive = !0;
for (let e of this.m_rgWindows) this.BindEventsForWindow(e);
}
}
UnbindEvents() {
if (this.m_bEventTrackingActive) {
this.m_bEventTrackingActive = !1;
for (let e of this.m_rgWindows) this.UnbindEventsForWindow(e);
}
}
UnbindEventsForWindow(e) {
for (let t of c.sm_rgUserEvents) e.removeEventListener(t, this.OnUserAction);
}
BindEventsForWindow(e) {
for (let t of c.sm_rgUserEvents) e.addEventListener(t, this.OnUserAction);
}
}
(c.sm_rgUserEvents = ["mousemove", "mousedown", "keypress", "focus"]), (0, i.gn)([s.ak], c.prototype, "OnUserAction", null);
class m extends c {
constructor() {
super(), (this.m_eActiveState = r.c4.k_EComputerActiveStateActive), (this.m_hRegisterForComputerActiveStateChange = null), (this.m_hFireUserStillActive = void 0);
}
Init() {
this.m_hRegisterForComputerActiveStateChange = SteamClient.WebChat.RegisterForComputerActiveStateChange(this.OnComputerActiveStateChange);
}
OnComputerActiveStateChange(e, t) {
let n = new Date().getTime() / 1e3 - t;
(this.m_eActiveState = e), (this.m_msUserLastAction = Math.max(performance.now() - 1e3 * n, this.m_msUserLastAction)), this.m_eActiveState == r.c4.k_EComputerActiveStateActive && (this.m_hFireUserStillActive && (clearTimeout(this.m_hFireUserStillActive), (this.m_hFireUserStillActive = void 0)), this.UpdateStillActive());
}
UpdateStillActive() {
(this.m_hFireUserStillActive = void 0), this.m_eActiveState == r.c4.k_EComputerActiveStateActive && (this.OnUserAction(), (this.m_hFireUserStillActive = SetBackgroundTimeout(this.UpdateStillActive, 1e4)));
}
}
(0, i.gn)([s.ak], m.prototype, "OnComputerActiveStateChange", null), (0, i.gn)([s.ak], m.prototype, "UpdateStillActive", null);
var d,
h = n(72746);
class u {
constructor(e) {
this.m_FriendStore = e;
}
DisplayNotificationFromFriend(e, t, n = {}) {
return this.DisplayNotification(Object.assign({ icon: e.persona.avatar_url_medium }, t), (t) => e.OpenChatDialog(t), n);
}
BNotificationsPermitted() {
return !h.Ul.ParentalStore.BIsFriendsBlocked() && !h.Ul.SettingsStore.IsSteamInTournamentMode();
}
RequestNotificationPermission() {
return Promise.resolve(!0);
}
}
!(function (e) {
(e[(e.k_EClientUINotificationGroupChatMessage = 1)] = "k_EClientUINotificationGroupChatMessage"), (e[(e.k_EClientUINotificationFriendChatMessage = 2)] = "k_EClientUINotificationFriendChatMessage"), (e[(e.k_EClientUINotificationFriendPersonaState = 3)] = "k_EClientUINotificationFriendPersonaState");
})(d || (d = {}));
class p extends u {
DisplayNotification(e, t, n = {}) {
if (e.tag) {
let n = JSON.stringify(e);
e.tag.startsWith("groupmsg_") ? SteamClient.ClientNotifications.DisplayClientNotification(d.k_EClientUINotificationGroupChatMessage, n, t) : e.tag.startsWith("message_") ? SteamClient.ClientNotifications.DisplayClientNotification(d.k_EClientUINotificationFriendChatMessage, n, t) : h.Ul.SettingsStore.BClientHasFeatureOrOnWeb("PersonaNotifications") && e.tag.startsWith("state_") && SteamClient.ClientNotifications.DisplayClientNotification(d.k_EClientUINotificationFriendPersonaState, n, t);
}
return Promise.resolve();
}
}
class _ extends u {
GetNotificationPermissionLevel() {
if ("undefined" == typeof Notification) return "unsupported";
let e = Notification.permission;
return "default" == e || "granted" == e || "denied" == e ? e : "unsupported";
}
DisplayNotification(e, t, n = {}) {
let i = { body: e.body, icon: e.icon, tag: e.tag, silent: !0 },
r = new Notification(e.title, Object.assign({ badge: o.De.COMMUNITY_CDN_URL + "public/shared/images/responsive/share_steam_logo.png" }, i));
return (
window.setTimeout(() => {
r.close();
}, n.timeoutMS || 5e3),
r.addEventListener("click", () => this.OnNotificationClicked(r, t)),
new Promise((e, t) => {
r.addEventListener("close", () => {
e();
});
})
);
}
OnNotificationClicked(e, t) {
t(h.D), e.close();
}
BNotificationsPermitted() {
return "granted" == this.GetNotificationPermissionLevel();
}
RequestNotificationPermission() {
return "unsupported" == this.GetNotificationPermissionLevel()
? Promise.resolve(!1)
: this.BNotificationsPermitted()
? super.RequestNotificationPermission()
: new Promise((e, t) => {
Notification.requestPermission((t) => {
e("granted" == t);
});
});
}
}
var g = n(23503),
C = n(33690),
f = n(22394),
v = n(93635);
class S {
constructor() {
(this.m_bDropConsumed = !1), (this.m_onDropCompleteCallbacks = new f.pB()), (this.m_vecClasses = []);
}
BInDrag() {
return !!this.m_data;
}
StartDrag(e) {
(0, v.X)(!this.m_data, "second drag started, existing data discarded", this.m_data), (this.m_data = e), (this.m_bDropConsumed = !1), this.m_vecClasses.push("in_global_drag"), this.m_vecClasses.push("drag_type_" + e.type), void 0 !== e.source && this.m_vecClasses.push("drag_source_" + e.source);
for (let e of Array.from(C.AN.GetPopups())) e.window && e.window.document.body && e.window.document.body.classList.add(...this.m_vecClasses);
window.document.body.classList.add(...this.m_vecClasses);
}
EndDrag() {
this.m_onDropCompleteCallbacks.Dispatch(this.m_bDropConsumed), this.m_onDropCompleteCallbacks.ClearAllCallbacks(), (this.m_data = void 0), (this.m_bDropConsumed = void 0);
for (let e of Array.from(C.AN.GetPopups())) e.window && e.window.document.body && e.window.document.body.classList.remove(...this.m_vecClasses);
window.document.body.classList.remove(...this.m_vecClasses), (this.m_vecClasses = []);
}
GetDragData() {
return this.m_data;
}
BWasDropConsumed() {
return this.m_bDropConsumed;
}
SetDropConsumed() {
(0, v.X)(this.BInDrag(), "Asked to set drop consumed but no active drag"), (this.m_bDropConsumed = !0);
}
RegisterForDropComplete(e) {
return this.m_onDropCompleteCallbacks.Register(e);
}
}
var b = n(4638),
I = n(1736),
y = n(79588);
class E {
constructor(e, t) {
(this.m_fnFillAppUsabilityMetrics = e),
t.messageHandlers.RegisterServiceNotificationHandler(b.hq.NotifyRequestClientUsabilityMetricsHandler, (e) =>
(0, i.mG)(this, void 0, void 0, function* () {
let t = I.gA.Init(b.y3);
return t.Body().set_metrics_run_id(e.Body().metrics_run_id()), t.Body().set_metrics_version(3), t.Body().set_client_build(o.De.BUILD_TIMESTAMP), t.Body().set_in_web(!o.De.IN_CLIENT), h.Ul.ready_to_render || (yield (0, y.gx)(() => h.Ul.ready_to_render)), yield h.Ul.SettingsStore.FillInChatUsabilityMetrics(t.Body()), yield h.Ul.FriendStore.FillInChatUsabilityMetrics(t.Body()), yield h.Ul.ChatStore.FillInChatUsabilityMetrics(t.Body()), yield h.Ul.UIStore.FillInChatUsabilityMetrics(t.Body()), yield h.Ul.VoiceStore.FillInChatUsabilityMetrics(t.Body()), this.m_fnFillAppUsabilityMetrics && (yield this.m_fnFillAppUsabilityMetrics(t.Body())), b.uC.NotifyClientUsabilityMetrics(h.Ul.CMInterface.GetServiceTransport(), t), 1;
}),
);
}
}
var D = n(24292);
class w {
constructor() {
(this.m_mapBrowserInfo = new Map()), (this.m_hOverlayChatBrowserInfoChanged = null);
}
Init(e) {
(this.m_CMInterface = e),
(this.m_hOverlayChatBrowserInfoChanged = SteamClient.WebChat.RegisterOverlayChatBrowserInfoChanged(this.OnOverlayChatBrowserInfoChanged)),
this.m_CMInterface.RunWhenLoggedOn(() => {
this.OnOverlayChatBrowserInfoChanged();
});
}
HasOverlayInstance(e) {
return this.m_mapBrowserInfo.has(e);
}
OnOverlayChatBrowserInfoChanged() {
SteamClient.WebChat.GetOverlayChatBrowserInfo()
.then((e) => {
let t = new Map(this.m_mapBrowserInfo);
for (let n of e) {
t.delete(n.unPID);
let e = { m_unPID: n.unPID, m_nBrowserID: n.nBrowserID, m_eBrowserType: n.eBrowserType, m_eUIMode: n.eUIMode },
i = this.m_mapBrowserInfo.get(n.unPID);
i && (i.m_nBrowserID != n.nBrowserID ? (this.OverlayBrowserClosed(i), this.m_mapBrowserInfo.delete(n.unPID), (i = void 0)) : h.Ul.UIStore.OnOverlayBrowserChanged(e, n.nScreenWidth, n.nScreenHeight)), i || (this.m_mapBrowserInfo.set(n.unPID, e), this.OverlayBrowserCreated(e, n.nScreenWidth, n.nScreenHeight));
}
t.forEach((e, t) => {
this.m_mapBrowserInfo.delete(t), this.OverlayBrowserClosed(e);
});
})
.catch((e) => {
console.log("Failed to load overlay browser info:", e);
});
}
OverlayBrowserCreated(e, t, n) {
var i;
const o = Object.assign(Object.assign({}, e), { m_eUIMode: null !== (i = e.m_eUIMode) && void 0 !== i ? i : h.Ul.IsGamepadUIActive() ? 4 : 0 });
h.Ul.UIStore.OnOverlayBrowserCreated(o, t, n), 0 == o.m_eUIMode && yn.ShowPopupFriendsList(o, !1, !1), h.Ul.SetDefaultPopupContext(o);
}
OverlayBrowserClosed(e) {
var t;
const n = Object.assign(Object.assign({}, e), { m_eUIMode: null !== (t = e.m_eUIMode) && void 0 !== t ? t : h.Ul.IsGamepadUIActive() ? 4 : 0 });
h.Ul.UIStore.SetSuppressBrowserContextBroadcasting(!0), h.Ul.GetDefaultBrowserContext().m_nBrowserID == e.m_nBrowserID && h.Ul.GetDefaultBrowserContext().m_unPID == e.m_unPID && h.Ul.SetDefaultPopupContext(h.D), console.log("Removing overlay browser window:", e.m_unPID, e.m_nBrowserID), C.AN.ClosePopupsOwnedByBrowser(n), h.Ul.UIStore.SetSuppressBrowserContextBroadcasting(!1), h.Ul.UIStore.OnOverlayBrowserClosed(n);
}
}
(0, i.gn)([s.ak], w.prototype, "OnOverlayChatBrowserInfoChanged", null);
var R = n(96119),
A = n(14206),
M = n.n(A),
k = n(50649),
T = n(27378),
L = n(84290),
G = n(14341),
O = n(41758),
F = n(83817),
B = n(16518);
let x = class extends T.Component {
constructor(e) {
super(e), (this.state = { bSubscribed: !1, bDismissed: !1, bThumbnailLoaded: !1 });
}
componentDidMount() {
this.props.broadcaster.accountid != h.Ul.FriendStore.self.accountid && this.props.broadcastid && (h.Ul.BroadcastStore.SubscribeToBroadcastDetails(this.props.broadcastid, this.props.broadcaster.steamid64), this.setState({ bSubscribed: !0 }));
}
componentWillUnmount() {
this.state.bSubscribed && h.Ul.BroadcastStore.UnsubscribeFromBroadcastDetails(this.props.broadcastid, this.props.broadcaster.steamid64);
}
OnWatch(e) {
if ("undefined" != typeof SteamClient && void 0 !== SteamClient.WebChat) {
let t = "steam://broadcast/watch/" + this.props.broadcaster.steamid64,
n = ln(this, e);
SteamClient.WebChat.OpenURLInClient(t, n.m_unPID, !1);
} else {
let t = `${o.De.COMMUNITY_BASE_URL}broadcast/watch/${this.props.broadcaster.steamid64}`;
(0, G.b8)(e, t), e.stopPropagation();
}
this.OnClose();
}
OnClose() {
this.setState({ bDismissed: !0 });
}
OnOpen() {
this.setState({ bDismissed: !1 });
}
ShowThumbnail() {
this.setState({ bThumbnailLoaded: !0 });
}
render() {
let e = h.Ul.AppInfoStore.GetAppInfo(this.props.appid),
t = T.createElement("span", null, T.createElement("img", { src: e.icon_url, className: "productImage" }), T.createElement("span", { className: "productName" }, e.name));
if (this.props.broadcaster.accountid == h.Ul.FriendStore.self.accountid) {
let e = this.props.viewer.display_name;
return T.createElement("div", { className: "broadcastInviteSelf" }, this.props.appid ? (0, L.kQ)("#ChatRoom_BroadcastInvite_YouInvited", e, t) : (0, L.kQ)("#ChatRoom_BroadcastInvite_YouInvited_NoAppID", e));
}
{
let n = this.props.broadcaster.display_name;
const i = h.Ul.BroadcastStore.GetBroadcastDetails(this.props.broadcastid, this.props.broadcaster.steamid64) || { strThumbnail: "", bExpired: !1 };
if (this.state.bDismissed || !this.props.broadcastid || i.bExpired) return T.createElement("div", { className: "broadcastInviteDismissed" }, this.props.appid ? (0, L.kQ)("#ChatRoom_BroadcastInvite_Expired", n, t) : (0, L.kQ)("#ChatRoom_BroadcastInvite_Expired_NoAppID", n));
let r = o.De.COMMUNITY_CDN_URL + "public/images/broadcast/apphub_default_thumbnail.jpg",
a = (0, L.kQ)("#ChatRoom_BroadcastInvite_Invite", n);
return T.createElement(
F.s,
{ className: "msg ChatMessageInvite broadcastInviteMsg", focusable: !0, onOKButton: this.OnWatch, onOKActionDescription: (0, L.Xx)("#ChatRoom_BroadcastInvite_Watch"), onCancel: this.OnClose, onCancelActionDescription: (0, L.Xx)("#ChatRoom_BroadcastInvite_Dismiss") },
T.createElement("div", { className: "leftInviteContainer" }, T.createElement("img", { src: i.strThumbnail, onLoad: this.ShowThumbnail, className: "broadcastThumbnail" + (this.state.bThumbnailLoaded ? " loaded" : "") }), T.createElement("img", { src: r, className: "broadcastThumbnail broadcastThumbnailFallback" + (this.state.bThumbnailLoaded ? "" : " loaded") }), T.createElement("div", { className: "noisePattern" })),
T.createElement("div", { className: "rightInviteContainer" }, T.createElement(O.v$, null, T.createElement("div", { className: "centerBlock" }, T.createElement("div", { className: "inviteLabel" }, a), T.createElement("div", { className: "productName" }, e.name))), T.createElement("button", { className: "DialogButton Primary inviteButtonWatchBroadcast", onClick: this.OnWatch }, (0, L.Xx)("#ChatRoom_BroadcastInvite_Watch")), T.createElement("div", { className: "closeButton", onClick: this.OnClose }, T.createElement(B.pVO, null))),
);
}
}
};
(0, i.gn)([s.ak], x.prototype, "OnWatch", null), (0, i.gn)([s.ak], x.prototype, "OnClose", null), (0, i.gn)([s.ak], x.prototype, "OnOpen", null), (0, i.gn)([s.ak], x.prototype, "ShowThumbnail", null), (x = (0, i.gn)([k.Pi], x));
var N = n(49367);
let P = class extends T.Component {
constructor(e) {
super(e), (this.m_pollTimeout = void 0), (this.m_broadcastid = void 0), (this.m_bExpired = !1), (this.state = { strThumbnail: "", nUpdateInterval: 10, bThumbnailLoaded: !1, nThumbnailUpdateCounter: 0 });
}
OnAccept(e) {
h.Ul.BroadcastStore.ApproveViewerRequest(this.props.viewer.accountid, this.props.requestid);
}
OnClose() {
h.Ul.BroadcastStore.RejectViewerRequest(this.props.viewer.accountid, this.props.requestid);
}
ShowThumbnail() {
this.setState({ bThumbnailLoaded: !0 });
}
render() {
let e = h.Ul.AppInfoStore.GetAppInfo(this.props.appid),
t = T.createElement("span", null, T.createElement("img", { src: e.icon_url, className: "productImage" }), T.createElement("span", { className: "productName" }, e.name)),
n = this.props.viewer.display_name,
i = h.Ul.BroadcastStore.GetRequestState(this.props.viewer.accountid, this.props.requestid),
r = void 0 !== this.m_broadcastid && this.m_broadcastid != h.Ul.BroadcastStore.broadcastid;
if ((void 0 === this.m_broadcastid && "0" !== h.Ul.BroadcastStore.broadcastid && (this.m_broadcastid = h.Ul.BroadcastStore.broadcastid), r || i != N.c$.k_EPending)) {
let e = "#ChatRoom_BroadcastViewRequest_Expired";
return i == N.c$.k_EAccepted ? (e = "#ChatRoom_BroadcastViewRequest_Accepted") : i == N.c$.k_ERejected && (e = "#ChatRoom_BroadcastViewRequest_Dismissed"), T.createElement("div", { className: "broadcastViewRequestDismissed" }, (0, L.kQ)(e, n, t));
}
let a = o.De.COMMUNITY_CDN_URL + "public/images/broadcast/apphub_default_thumbnail.jpg",
s = (this.state.bThumbnailLoaded, this.state.nThumbnailUpdateCounter),
l = (0, L.kQ)("#ChatRoom_BroadcastViewRequest_Invite", n);
return T.createElement(
"div",
{ className: "msg ChatMessageInvite broadcastInviteMsg broadcastViewRequestMsg" },
T.createElement("div", { className: "leftInviteContainer" }, this.state.strThumbnail && T.createElement("img", { src: this.state.strThumbnail + "?n=" + s, onLoad: this.ShowThumbnail, className: "broadcastThumbnail" + (this.state.bThumbnailLoaded ? " loaded" : "") }), T.createElement("img", { src: a, className: "broadcastThumbnail broadcastThumbnailFallback" + (this.state.bThumbnailLoaded ? "" : " loaded") }), T.createElement("div", { className: "noisePattern" })),
T.createElement("div", { className: "rightInviteContainer" }, T.createElement(O.v$, null, T.createElement("div", { className: "centerBlock" }, T.createElement("div", { className: "inviteLabel" }, l), T.createElement("div", { className: "productName" }, e.name))), T.createElement("button", { className: "inviteButton inviteButtonWatchBroadcast", onClick: this.OnAccept }, (0, L.Xx)("#ChatRoom_BroadcastViewRequest_Accept")), T.createElement("div", { className: "closeButton", onClick: this.OnClose })),
);
}
};
(0, i.gn)([s.ak], P.prototype, "OnAccept", null), (0, i.gn)([s.ak], P.prototype, "OnClose", null), (0, i.gn)([s.ak], P.prototype, "ShowThumbnail", null), (P = (0, i.gn)([k.Pi], P));
class U extends T.Component {
constructor(e) {
super(e), (this.m_pollTimeout = void 0), (this.m_broadcastid = void 0), (this.m_bExpired = !1), (this.state = { strThumbnail: "", nUpdateInterval: 10, bThumbnailLoaded: !1, nThumbnailUpdateCounter: 0 });
}
OnWatch(e) {
if ("undefined" != typeof SteamClient && void 0 !== SteamClient.WebChat) {
let t = "steam://broadcast/watch/" + this.props.broadcaster.steamid64,
n = ln(this, e);
SteamClient.WebChat.OpenURLInClient(t, n.m_unPID, !1);
} else {
let t = `${o.De.COMMUNITY_BASE_URL}broadcast/watch/${this.props.broadcaster.steamid64}`;
(0, G.b8)(e, t), e.stopPropagation();
}
}
ShowThumbnail() {
this.setState({ bThumbnailLoaded: !0 });
}
render() {
let e = this.props.broadcaster.current_game_name,
t = this.props.broadcaster.display_name,
n = o.De.COMMUNITY_CDN_URL + "public/images/broadcast/apphub_default_thumbnail.jpg",
i = (this.state.bThumbnailLoaded, this.state.nThumbnailUpdateCounter),
r = (0, L.kQ)("#ChatRoom_BroadcastInvite_WatchGame", t);
return T.createElement(
"div",
{ className: "msg ChatMessageInvite broadcastInviteMsg", style: { padding: 0, display: "flex", overflow: "hidden" } },
T.createElement("div", { className: "leftInviteContainer" }, this.state.strThumbnail && T.createElement("img", { src: this.state.strThumbnail + "?n=" + i, onLoad: this.ShowThumbnail, className: "broadcastThumbnail" + (this.state.bThumbnailLoaded ? " loaded" : "") }), T.createElement("img", { src: n, className: "broadcastThumbnail broadcastThumbnailFallback" + (this.state.bThumbnailLoaded ? "" : " loaded") }), T.createElement("div", { className: "noisePattern" })),
T.createElement("div", { className: "rightInviteContainer" }, T.createElement(O.v$, null, T.createElement("div", { className: "centerBlock" }, T.createElement("div", { className: "inviteLabel" }, r), e && T.createElement("div", { className: "productName" }, e))), T.createElement("button", { className: "DialogButton Primary inviteButtonWatchBroadcast", onClick: this.OnWatch }, (0, L.Xx)("#ChatRoom_BroadcastInvite_Watch"))),
);
}
}
(0, i.gn)([s.ak], U.prototype, "OnWatch", null), (0, i.gn)([s.ak], U.prototype, "ShowThumbnail", null);
var V = n(46057),
H = n(97669);
let W = class extends T.Component {
constructor() {
super(...arguments), (this.state = { bCanAcceptRemotePlayInvite: !1 });
}
componentDidMount() {
return (0, i.mG)(this, void 0, void 0, function* () {
if (this.props.gameInvite.remoteplayString) {
let e = this.props.gameInvite.remoteplayString.split("&"),
t = "restricted_countries=",
n = "";
e.forEach((e) => {
e.startsWith(t) && (n = e.slice(t.length));
});
const i = yield h.Ul.RemotePlayStore.BCanAcceptInviteForGame(this.props.gameInvite.appID.toString(), n);
this.setState({ bCanAcceptRemotePlayInvite: i });
}
});
}
AcceptGameInvite() {
this.props.gameInvite.AcceptGameInvite();
}
BCanAcceptVoiceChat() {
let e = this.props.inviter,
t = 2 == e.efriendrelationship,
n = 4 == e.efriendrelationship,
i = e.persona.is_online && !t && !n && !e.is_blocked;
return !h.Ul.VoiceStore.IsAnyVoiceActive() && i;
}
AcceptGameInviteAndVoiceChat() {
this.props.gameInvite.AcceptGameInvite(), this.BCanAcceptVoiceChat() && h.Ul.UIStore.ShowFriendChatDialogAndStartVoice(h.Ul.GetDefaultBrowserContext(), this.props.inviter.accountid);
}
DismissInvite() {
this.props.gameInvite.DismissInvite();
}
OnShowGameContextMenu(e) {
(0, V.HR)(ln(this, e), this.props.gameInvite.appID, e);
}
render() {
let e = h.Ul.AppInfoStore.GetAppInfo(this.props.gameInvite.appID);
if ((e || ((e = new H.Am(this.props.gameInvite.appID)), e.DeserializeFromCacheObject({ strName: (0, L.Xx)("#ChatRoom_GameInvite_UnreleasedGame"), strIconURL: "", strLogoURL: "", eAppType: 1 })), h.Ul.FriendStore.self == this.props.inviter)) {
let t = this.props.inviteTarget.display_name,
n = this.props.gameInvite.remoteplayString ? "#ChatRoom_GameInviteRemotePlay_YouInvited" : "#ChatRoom_GameInvite_YouInvited";
return T.createElement("div", { className: "gameInviteSelf" }, T.createElement("div", { onClick: this.OnShowGameContextMenu }, (0, L.kQ)(n, t, T.createElement("img", { src: e.icon_url, className: "productImage" }), e.name)));
}
if (this.props.gameInvite.bOld || this.props.gameInvite.bDismissed || this.props.inviter.persona.m_unGamePlayedAppID != this.props.gameInvite.appID) {
let t = this.props.inviter.display_name,
n = this.props.gameInvite.remoteplayString ? "#ChatRoom_GameInviteRemotePlay_Dismissed" : "#ChatRoom_GameInvite_Dismissed";
return T.createElement("div", { className: "gameInviteDismissed" }, T.createElement("div", { onClick: this.OnShowGameContextMenu }, (0, L.kQ)(n, t, T.createElement("img", { src: e.icon_url, className: "productImage" }), e.name)));
}
if (this.props.gameInvite.bAccepted) {
let t = this.props.gameInvite.remoteplayString ? "#ChatRoom_GameInviteRemotePlay_Accepted" : "#ChatRoom_GameInvite_Accepted";
return T.createElement("div", { className: "gameInviteAccepted" }, T.createElement("div", { onClick: this.OnShowGameContextMenu }, (0, L.kQ)(t, T.createElement("img", { src: e.icon_url, className: "productImage" }), e.name)));
}
if (this.props.gameInvite.remoteplayString && !this.state.bCanAcceptRemotePlayInvite) {
let t = this.props.inviter.display_name,
n = "#ChatRoom_GameInviteRemotePlay_CantAccept";
return T.createElement("div", { className: "gameInviteDismissed" }, T.createElement("div", { onClick: this.OnShowGameContextMenu }, (0, L.kQ)(n, t, T.createElement("img", { src: e.icon_url, className: "productImage" }), e.name)));
}
let t = this.props.inviter,
n = null,
i = t.persona.player_group_size - 1;
if (t.persona.m_unGamePlayedAppID == this.props.gameInvite.appID && t.persona.player_group_size > 0) {
let e = t.persona.player_group;
if (e) {
n = h.Ul.FriendStore.FriendGroupStore.ingame_group.member_list.map((n) => (n != t && n.persona.player_group == e ? (i--, T.createElement(V.o2, { key: n.accountid, friend: n, context: null })) : null)).filter(Boolean);
}
}
let o = { paddingLeft: 0, display: "flex", alignItems: "stretch", overflow: "hidden" };
this.props.chatGutterWidth && (o.marginLeft = "-" + this.props.chatGutterWidth + "px");
let r = this.props.gameInvite.remoteplayString ? "#ChatRoom_GameInviteRemotePlay_Invite" : "#ChatRoom_GameInvite_Invite",
a = (0, L.kQ)(r, this.props.inviter.display_name),
s = this.props.gameInvite.remoteplayString && this.BCanAcceptVoiceChat() && h.Ul.VoiceStore.BPartnerHasAcceptedOrInitiatedOneOnOneChat(this.props.inviter.accountid),
l = h.Ul.ParentalStore.BIsAppBlocked(this.props.gameInvite.appID),
c = (null == n ? void 0 : n.length) || i > 0;
return T.createElement(
F.s,
{ className: "msg ChatMessageInvite gameInviteMsg", style: o, onOKButton: l ? null : this.AcceptGameInvite, onOKActionDescription: l ? null : (0, L.Xx)("#ChatRoom_GameInvite_Accept") },
T.createElement("div", { className: "leftInviteContainer", style: { overflow: "visible" } }, T.createElement("img", { src: e.header_image_url, className: "productImage productImageBlur" }), T.createElement("img", { src: e.header_image_url, className: "productImage" })),
T.createElement(
"div",
{ className: "rightInviteContainer" },
T.createElement("div", { className: "centerBlock" }, T.createElement("div", { className: "invitedTimeLabel" }, (0, L.Xx)("#ChatRoom_GameInvite_InviteTime"), T.createElement(G.tS, { rtime: this.props.gameInvite.rtTimestamp, bTimeOnly: !0 })), T.createElement(O.v$, null, T.createElement("div", { className: "inviteLabel" }, a)), T.createElement(O.v$, null, T.createElement("div", { className: "productName" }, e.name)), c && T.createElement(O.v$, null, T.createElement("div", { className: "playingWithBlock" }, T.createElement("div", null, (0, L.Xx)("#ChatRoom_GameInvite_PlayingWith")), T.createElement("div", { className: "playingWithAvatars" }, T.createElement("div", { className: "playingWithLine" }), n, i > 0 && T.createElement("div", { className: "playingWithExtraCount" }, (0, L.Xx)("#ChatRoom_GameInvite_PartyMore", i), " "))))),
T.createElement("div", { className: "acceptButtonsGroup" }, l ? T.createElement("div", null, (0, L.Xx)("#ChatRoom_GameInvite_Family_View")) : T.createElement(T.Fragment, null, T.createElement("button", { className: "DialogButton GreenPlay", onClick: this.AcceptGameInvite }, (0, L.Xx)("#ChatRoom_GameInvite_Accept")), s && T.createElement("button", { className: "DialogButton GreenPlay", onClick: this.AcceptGameInviteAndVoiceChat }, (0, L.Xx)("#ChatRoom_GameInvite_Accept_And_Voice_Chat")))),
T.createElement("div", { className: "closeButton", onClick: this.DismissInvite }, T.createElement(B.pVO, null)),
),
);
}
};
(0, i.gn)([s.ak], W.prototype, "AcceptGameInvite", null), (0, i.gn)([s.ak], W.prototype, "BCanAcceptVoiceChat", null), (0, i.gn)([s.ak], W.prototype, "AcceptGameInviteAndVoiceChat", null), (0, i.gn)([s.ak], W.prototype, "DismissInvite", null), (0, i.gn)([s.ak], W.prototype, "OnShowGameContextMenu", null), (W = (0, i.gn)([k.Pi], W));
var X = n(88669),
j = n(25629),
z = n(618),
K = n(71357),
q = n(68816),
Z = n(99165),
Q = n(10553);
const $ = (0, h.R6)(function (e, t, n) {
(0, q.BR)(T.createElement(ee, Object.assign({}, e, { bIsInviteDialog: !0 })), n, "InviteDialog", { strTitle: "Invite", popupWidth: 540, popupHeight: 260 }, mn(n));
});
let Y = class extends T.Component {
AcceptInvite(e) {
let t = X.RA(e);
h.Ul.ChatStore.InviteStore.AcceptInvite(this.props.invite, ln(this, e)).then((e) => {
this.HandleJoinResult(t, e);
});
}
HandleJoinResult(e, t) {
const n = (0, j.qH)(t);
n && (0, K.zp)(e, (0, L.Xx)("#ChatRoom_InviteMessage_Header"), n, (0, L.Xx)("#Button_OK")), this.props.onAccept && this.props.onAccept();
}
render() {
var e, t;
let n = this.props.invite;
if (!n || !n.BIsReady()) return T.createElement("div", { className: "ChatMessageInvite RequestingInfo displayRow" }, T.createElement(Z.V, { size: "small" }), T.createElement("div", { className: "postedExpiredInvite" }, (0, L.Xx)("#bbcode_invite_requesting_info")));
if (!n.BIsValid()) return T.createElement("div", { className: "ChatMessageInvite InviteExpired" }, T.createElement("div", { className: "postedExpiredInvite" }, (0, L.Xx)("#bbcode_invite_no_longer_valid")));
let i = this.props.inviter && h.Ul.FriendStore.self.accountid == this.props.inviter.accountid,
o = h.Ul.ChatStore.GetChatRoomGroup(n.GetChatRoomGroupID()),
r = o && o.BIsCurrentUserAMember(),
a = n.BIsExpired(),
s = o && o.name,
l = "",
c = "ChatMessageInvite NoBGSplitInvite",
m = "inviteButton inviteButtonJoinChat";
this.props.strClassName && (c += " " + this.props.strClassName);
let d,
u,
p = n.BIsInviteLink(),
_ = n.BIsVoiceChatInvite();
if (_) {
(m += " inviteButtonJoinVoice"), (c += " VoiceChannelInvite");
let e = o.GetChatRoom(n.GetChatID());
e && (l = e.name);
}
if ((this.props.bIsInviteDialog || (r && !i && (c += " GroupAlreadyJoined"), i && (c += " Inviter")), p && (c += " InviteLink"), a)) c += " InviteExpired";
else if (n.BNeverExpires()) d = T.createElement("div", { className: "Invite_ExpireTime" }, (0, L.Xx)("#bbcode_invite_never_expires"));
else {
let e = h.Ul.RTime32ToDate(n.time_expires);
d = T.createElement("div", { className: "Invite_ExpireTime" }, (0, L.Xx)("#bbcode_invite_expires", e.toLocaleTimeString(), e.toDateString()));
}
u = i ? (_ ? (0, L.Xx)("#Voice_StartTalking") : (0, L.Xx)("#ChatRoom_Invite_Accept_Inviter")) : _ ? (0, L.Xx)("#Voice_StartTalking") : r ? (0, L.Xx)("#ChatRoom_Invite_Accept_Inviter") : (0, L.Xx)("#ChatRoom_Invite_Accept");
let g = null,
C = !1;
if (n.BIsUserBanned()) (C = !0), (g = T.createElement("div", null, (0, L.Xx)("#bbcode_invite_banned_forever")));
else if (n.GetTimeKickExpires() && n.GetTimeKickExpires() > h.Ul.GetServerRTime32()) {
C = !0;
let e = h.Ul.RTime32ToDate(n.GetTimeKickExpires()).toLocaleString([], { weekday: "long", year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric" });
g = T.createElement("div", null, (0, L.Xx)("#bbcode_invite_banned_until", e));
}
let f = this.props.inviter && r,
v = !f && !i,
S = _ ? l : s;
return T.createElement(
O.v$,
{ text: [u, S, n.GetURL()] },
T.createElement(
F.s,
{ className: c, focusable: !0, onActivate: a || C ? null : this.AcceptInvite },
T.createElement("div", { className: "leftInviteContainer" }, T.createElement(z._P, { group: o, small: f, large: v }), _ && T.createElement("div", null, T.createElement(B.Cq4, null))),
T.createElement("div", { className: "rightInviteContainer" + (r || i ? " rightInvite_Horizontal" : "") }, T.createElement("div", { className: "rightInviteContainerContent" }, T.createElement(J, { invite: this.props.invite, inviter: this.props.inviter, invitee: this.props.invitee }), T.createElement("div", null, T.createElement("div", { className: "groupName" }, S)), p && T.createElement(te, { url: n.GetURL(), bDisabled: n.BIsExpired() }), g, !i && r && !_ && T.createElement("div", null, T.createElement("span", { className: "groupAlreadyJoined" }, (0, L.Xx)("#bbcode_invite_already_group_member")))), !a && !C && !(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) && T.createElement("button", { className: m, type: "button", onClick: this.AcceptInvite }, u), !a && !C && (null === (t = this.context) || void 0 === t ? void 0 : t.IN_GAMEPADUI) && T.createElement(F.s, { className: m, onOKButton: this.AcceptInvite }, u)),
((!i && !r) || p) && d,
T.createElement("div", { style: { clear: "left" } }),
),
);
}
};
(Y.contextType = Q.E_), (0, i.gn)([s.ak], Y.prototype, "AcceptInvite", null), (Y = (0, i.gn)([k.Pi], Y));
let J = (0, k.Pi)((e) => {
let t = e.invite,
n = e.inviter,
i = e.invitee,
o = t.BIsVoiceChatInvite(),
r = t.BIsInviteLink(),
a = e.inviter && h.Ul.FriendStore.self.accountid == e.inviter.accountid,
s = h.Ul.ChatStore.GetChatRoomGroup(t.GetChatRoomGroupID()).name,
l = (0, L.Xx)("#bbcode_invite_youre_invited");
return (
a
? (l = o ? (r ? (0, L.kQ)("#bbcode_invite_you_shared_voice_link", T.createElement("span", { className: "inviteHighlight" }, s, " ")) : (0, L.kQ)("#bbcode_invite_you_invited_friend_voice", T.createElement("span", { className: "inviteHighlight" }, i.display_name, " "), T.createElement("span", { className: "inviteHighlight" }, s, " "))) : r ? (0, L.kQ)("#bbcode_invite_you_shared_invite_link") : (0, L.kQ)("#bbcode_invite_you_invited_friend", T.createElement("span", { className: "inviteHighlight" }, i.display_name, " ")))
: n && (l = o ? (r ? (0, L.kQ)("#bbcode_invite_voice_url_description", T.createElement("span", { className: "inviteHighlight" }, n.display_name, " "), T.createElement("span", { className: "inviteHighlight" }, s, " ")) : (0, L.kQ)("#bbcode_invite_voice_description", T.createElement("span", { className: "inviteHighlight" }, n.display_name, " "), T.createElement("span", { className: "inviteHighlight" }, s, " "))) : r ? (0, L.kQ)("#bbcode_invite_url_description", T.createElement("span", { className: "inviteHighlight" }, n.display_name, " ")) : (0, L.kQ)("#bbcode_invite_description", T.createElement("span", { className: "inviteHighlight" }, n.display_name, " "))),
T.createElement("div", { className: "inviteLabel" }, l)
);
});
class ee extends T.Component {
render() {
let e = this.props,
{ closeModal: t, onAccept: n, strClassName: o } = e,
r = (0, i._T)(e, ["closeModal", "onAccept", "strClassName"]);
return (
(o = "InviteDialog" + (o ? " " + o : "")),
T.createElement(
q.e1,
{ onEscKeypress: t },
T.createElement(
Y,
Object.assign({}, r, {
strClassName: o,
onAccept: () => {
this.props.closeModal && this.props.closeModal(), n && n();
},
}),
),
)
);
}
}
class te extends T.Component {
CopyToClipboard(e) {
X.J$(this.props.url);
}
HandleFocus(e) {
e.currentTarget.select();
}
render() {
let e = this.props.strLabel || (0, L.Xx)("#bbcode_invite_url_desc");
return T.createElement("div", { className: "inviteURLContainer" }, T.createElement("span", { className: "inviteURLLinkDesc" }, e), T.createElement("div", { className: "inviteURLAndCopy" }, T.createElement("input", { className: "inviteURLLink", value: this.props.bDisabled ? (0, L.Xx)("#bbcode_invite_link_text_expired") : this.props.url, onFocus: this.HandleFocus, onClick: this.HandleFocus, readOnly: !0 }), !this.props.bDisabled && T.createElement("span", { className: "copyInviteLink", onClick: this.CopyToClipboard, title: (0, L.Xx)("#Chat_Copy_Clipboard") }, T.createElement(B.h9, null))));
}
}
(0, i.gn)([s.ak], te.prototype, "CopyToClipboard", null), (0, i.gn)([s.ak], te.prototype, "HandleFocus", null);
var ne = n(87018),
ie = n(257),
oe = n.n(ie);
class re extends T.Component {
CheckLoadPrettify() {
if (!this.m_preElem) return;
let e = this.m_preElem.ownerDocument.defaultView;
if (!e || "object" == typeof e.PR || !0 === e.PR) return;
e.PR = !0;
let t = e.document.createElement("script");
e.document.head.appendChild(t),
(t.onload = () => {
this.TryRunPrettyPrint();
}),
(t.src = o.De.COMMUNITY_CDN_ASSET_URL + "prettify/prettify.js");
}
BindRef(e) {
this.m_preElem = e;
}
TryRunPrettyPrint() {
if ((this.CheckLoadPrettify(), !this.m_preElem)) return;
let e = this.m_preElem.ownerDocument.defaultView;
e && "object" == typeof e.PR && e.PR.prettyPrint();
}
componentDidMount() {
this.TryRunPrettyPrint();
}
componentDidUpdate() {
this.TryRunPrettyPrint();
}
render() {
return T.createElement("div", null, T.createElement("pre", { className: (0, ne.Z)("prettyprint", oe().CodeMessage), ref: this.BindRef }, this.props.children));
}
}
(0, i.gn)([s.ak], re.prototype, "BindRef", null);
const ae = ({ children: e }) => T.createElement("div", null, T.createElement("pre", { className: oe().PreMessage }, e)),
se = ({ children: e }) => T.createElement("div", { className: oe().QuoteMessage }, e),
le = ({ children: e }) => T.createElement(O.v$, { text: e }, T.createElement("div", { className: "spoilerMsgText" }, T.createElement("div", { className: "spoilerMsg" }, e)));
var ce = n(92883),
me = n(31542);
const de = /^(?:(?:([\d]+)h)?(?:([\d]+)m)?(?:([\d]+)s)?|([\d]+))$/;
function he(e) {
const t = de.exec(e);
if (!((null == t ? void 0 : t[1]) || (null == t ? void 0 : t[2]) || (null == t ? void 0 : t[3]) || (null == t ? void 0 : t[4]))) return;
if (null == t ? void 0 : t[4]) return parseInt(null == t ? void 0 : t[4]);
let n = 0;
return (null == t ? void 0 : t[1]) && (n += 3600 * parseInt(t[1])), (null == t ? void 0 : t[2]) && (n += 60 * parseInt(t[2])), (null == t ? void 0 : t[3]) && (n += parseInt(t[3])), n;
}
var ue = n(88991),
pe = n(62902),
_e = n(98004),
ge = n(26671),
Ce = n(37153),
fe = n(11259),
ve = n(51579),
Se = n(18608),
be = n(39353),
Ie = n(97063),
ye = n(59702),
Ee = n(21298),
De = n(61752),
we = n(36175),
Re = n(90406),
Ae = n(44550),
Me = n.n(Ae),
ke = n(19339),
Te = n(13114);
function Le(e) {
var t, n, i, o, r, a;
if (e.context.chat instanceof ke.a) {
let s = e.args.appid,
l = h.Ul.AppInfoStore.GetAppInfo(parseInt(s)).name;
const c = (null === (t = e.args) || void 0 === t ? void 0 : t.connectString) || (null === (n = e.args) || void 0 === n ? void 0 : n.remoteplay) || (null === (i = e.args) || void 0 === i ? void 0 : i.lobbyID) ? (0, Te.gh)(e.context.chat.chat_partner.accountid, parseInt(s), null === (o = e.args) || void 0 === o ? void 0 : o.connectString, null === (r = e.args) || void 0 === r ? void 0 : r.remoteplay, null === (a = e.args) || void 0 === a ? void 0 : a.lobbyID) : void 0;
let m = "";
return (m = e.context.unAccountIDSender === e.context.chat.self.accountid ? (e.args.remoteplay ? "#ChatRoom_GameInviteRemotePlay_YouInvited" : "#ChatRoom_GameInvite_YouInvited") : e.args.remoteplay ? "#Friend_Notification_GameInviteRemotePlay" : "#Friend_Notification_GameInvite"), { title: "", body: (0, L.Xx)(m, e.context.chat.chat_partner.display_name, l, ""), state: c };
}
return null;
}
function Ge(e) {
if (e.context.chat instanceof ke.a) {
let t = e.args.appid,
n = e.args.lobbyid,
i = h.Ul.AppInfoStore.GetAppInfo(parseInt(t)).name;
return { title: "", body: e.context.unAccountIDSender === e.context.chat.self.accountid ? (0, L.Xx)("#Friend_Notification_GameInviteYouInvited", e.context.chat.chat_partner.display_name, i) : (0, L.Xx)("#Friend_Notification_GameInvite", e.context.chat.chat_partner.display_name, i), state: "steam://joinlobby/" + t + "/" + n + "/" + e.context.chat.chat_partner.steamid64.toString() };
}
return null;
}
function Oe(e) {
if (e.context.chat instanceof ke.a) {
return null != e.args.chatid ? { title: "", body: e.context.unAccountIDSender === e.context.chat.self.accountid ? (0, L.Xx)("#bbcode_invite_you_invited_friend_voice", e.context.chat.chat_partner.display_name, e.args.chatname) : (0, L.Xx)("#Friend_Notification_InviteVoice", e.context.chat.chat_partner.display_name, e.args.chatname) } : { title: "", body: e.context.unAccountIDSender === e.context.chat.self.accountid ? (0, L.Xx)("#bbcode_invite_you_invited_friend", e.context.chat.chat_partner.display_name) : (0, L.Xx)("#Friend_Notification_Invite", e.context.chat.chat_partner.display_name, e.args.chatgroupname) };
}
return null;
}
function Fe(e) {
const t = e.context.chat;
return t instanceof ke.a ? { title: (0, L.Xx)("#TradeOffer_FriendSentYou", t.chat_partner.display_name), body: e.text } : null;
}
function Be(e) {
return { body: (0, L.Xx)("#Notification_Spoiler") };
}
function xe(e) {
const t = h.Ul.FriendStore.GetPlayer(e.context.unAccountIDSender),
n = e.args.type;
if (!n) return null;
const i = e.context.chat.ChatStore.ChatRoomEffectSettings[n];
return i && i.locToken ? { body: (0, L.Xx)(i.locToken, t.display_name) } : null;
}
Pe("#bbcode_random_description"), Pe("#bbcode_flip_description"), Pe("#bbcode_video_description"), Pe("#bbcode_inviteurl_description"), Pe("#bbcode_image_description");
const Ne = Pe("#bbcode_sticker_description");
function Pe(e) {
return (t) => {
const n = h.Ul.FriendStore.GetPlayer(t.context.unAccountIDSender);
return { body: (0, L.Xx)(e, n.display_name) };
};
}
var Ue = n(37091),
Ve = n(73085);
function He(e) {
const { href: t, copyText: n, loadFailed: i, children: o } = e;
let r = "NonInlinedEmbed";
return i && (r += " LoadFailed"), T.createElement(O.v$, { text: n || t, style: "merge-adjacent" }, T.createElement("div", { className: r }, T.createElement(Ue.ns, { href: t, title: t }, o)));
}
function We(e) {
const { preference: t, render: n, fallbackHref: i, fallbackRender: o, children: r } = e,
a = (0, Ve.d)(h.Ul.CookiePreferenceStore);
if (!a) return null;
return h.Ul.CookiePreferenceStore.CheckThirdPartyCookiePreference(a, t) ? (n ? n() : r) : o ? o() : T.createElement(He, { href: i }, i);
}
var Xe,
je = n(5997);
const ze = function (e) {
return T.createElement(T.Fragment, null);
};
function Ke(e) {
return T.createElement(T.Suspense, { fallback: null }, T.createElement(ze, Object.assign({}, e)));
}
function qe() {
return { url: Qe, youtube: tt, filteredurl: Gt, emoticon: Ft, img: ot, video: lt, og: dt, tweet: ht, inviteurl: It, publishedfile: At, tradeofferlink: Mt, econitem: Lt, steamstore: xt, broadcast: Tt, oembed: ut, spoiler: _t, plusone: gt, flip: Ct, random: ft, quote: vt, pre: St, code: bt, roomeffect: Nt, sticker: Pt };
}
function Ze(e) {
if ("string" == typeof e) return e;
let t = "";
return (
T.Children.forEach(e, (e) => {
if ("string" != typeof e) {
if ("object" == typeof e && e.props) {
let n = e.props["bbcode-text"];
n && (t += n);
}
} else t += e;
}),
t
);
}
let Qe = class extends ce.fb {
render() {
let e = this.GetArgument(),
t = this.props.children,
n = null,
i = De.H8(e);
return i != e && (n = i), (t && !this.GetArgument("fromclient")) || (n = i), h.Ul.SettingsStore.FriendsSettings.bDisableEmbedInlining && "string" != typeof t ? T.createElement(He, { href: e }, T.createElement(B.nWq, null), i) : T.createElement(O.v$, { text: e, style: "merge-adjacent" }, T.createElement(G.ns, { href: e }, n || t));
}
};
Qe = (0, i.gn)([k.Pi], Qe);
class $e extends T.Component {
constructor(e) {
super(e);
let t = h.Ul.ChatStore.EmbedStore.GetCollapsedState(this.props.unAccountIDSender, this.props.msgUniqueKey),
n = h.Ul.ChatStore.EmbedStore.GetWidths(this.props.unAccountIDSender, this.props.msgUniqueKey);
(this.state = { nResizedWidth: t ? 16 : n ? n.nDesiredWidth : 0, bResized: void 0 !== n, bIsResizing: !1, bIsRestoring: !1, bMinimized: t, bIsMinimizing: !1 }), (this.m_frameInitialXPos = -1), (this.m_frameInitialYPos = -1), (this.m_frameInitialWidth = -1), (this.m_frameDefaultWidth = n ? n.nDefaultWidth : -1), (this.m_frameDesiredWidth = n ? n.nDesiredWidth : -1);
}
BindContainer(e) {
(this.m_elContainer = e), this.m_elContainer && this.props.height > 450 && this.HandleTallImages();
}
handleCollapse(e) {
this.state.bMinimized || (this.m_frameDesiredWidth = this.m_elContainer.clientWidth), this.m_animationCollapse && this.m_animationCollapse.Cancel();
let t = !this.state.bMinimized,
n = t ? this.m_frameDesiredWidth : 16,
i = t ? 16 : this.m_frameDesiredWidth;
this.setState({ nResizedWidth: n, bMinimized: !1, bIsMinimizing: !0 }, () => {
(this.m_animationCollapse = new be.P(this, { nResizedWidth: i }, { msDuration: 300, timing: "sine", setStateOnComplete: { bMinimized: t, bIsMinimizing: !1 }, onComplete: this.OnSizeChanged })), this.m_animationCollapse.Start();
}),
h.Ul.ChatStore.EmbedStore.SetCollapsedState(this.props.unAccountIDSender, this.props.msgUniqueKey, t);
}
OnSizeChanged() {
this.props.onSizeChanged("BBCodeResizableComponent " + this.props.msgUniqueKey + this.state.bResized + this.state.bMinimized);
}
handleRestore(e) {
this.state.bResized &&
(this.m_animationCollapse && this.m_animationCollapse.Cancel(),
this.setState({ bIsRestoring: !0 }, () => {
(this.m_animationCollapse = new be.P(this, { nResizedWidth: this.m_frameDefaultWidth }, { msDuration: 300, timing: "sine", setStateOnComplete: { bMinimized: !1, bIsRestoring: !1, bResized: !1 }, onComplete: this.OnSizeChanged })), this.m_animationCollapse.Start();
}),
h.Ul.ChatStore.EmbedStore.SetWidths(this.props.unAccountIDSender, this.props.msgUniqueKey, this.m_frameDefaultWidth, this.m_frameDefaultWidth));
}
OnResize(e) {
let t = e.currentTarget.ownerDocument.defaultView;
t.addEventListener("mousemove", this.HandleMouseMove), t.addEventListener("mouseup", this.HandleMouseUp);
}
HandleMouseMove(e) {
this.m_frameInitialXPos < 0 && (this.m_frameInitialXPos = e.clientX), this.m_frameInitialWidth < 0 && (this.m_frameInitialWidth = this.m_elContainer.clientWidth), this.m_frameDefaultWidth < 0 && !this.state.bResized && (this.m_frameDefaultWidth = this.m_elContainer.clientWidth), this.m_frameInitialYPos < 0 && (this.m_frameInitialYPos = e.clientY);
let t = e.clientX - this.m_frameInitialXPos,
n = e.clientY - this.m_frameInitialYPos,
i = this.m_frameInitialWidth + t + n,
o = "image" == this.props.strMediaType ? 64 : 320;
i < o && (i = o), i > 1280 && (i = 1280), this.setState({ nResizedWidth: i, bResized: !0, bIsResizing: !0 }), this.OnSizeChanged();
}
HandleTallImages() {
let e = 450 * (this.props.width / this.props.height),
t = this.props.width;
t > Math.min(1280, e) && (t = Math.min(1280, e)), t < parseInt(this.m_elContainer.ownerDocument.defaultView.getComputedStyle(this.m_elContainer).maxWidth) && this.setState({ nMaxWidth: t }), this.OnSizeChanged();
}
HandleMouseUp(e) {
e.view.removeEventListener("mousemove", this.HandleMouseMove), e.view.removeEventListener("mouseup", this.HandleMouseUp), (this.m_frameInitialXPos = -1), (this.m_frameInitialYPos = -1), (this.m_frameInitialWidth = -1), this.state.bIsResizing && this.setState({ bIsResizing: !1 }), !this.state.bMinimized && this.m_elContainer && (this.m_frameDesiredWidth = this.m_elContainer.clientWidth), h.Ul.ChatStore.EmbedStore.SetWidths(this.props.unAccountIDSender, this.props.msgUniqueKey, this.m_frameDesiredWidth, this.m_frameDefaultWidth);
}
render() {
let e = {};
this.state.nResizedWidth > 0 ? (e.width = this.state.nResizedWidth + "px") : this.state.nMaxWidth && (e.maxWidth = this.state.nMaxWidth + "px");
let t = "BBCodeResizableComponent";
this.props.className && (t += " " + this.props.className), this.state.bResized && (t += " Resized"), this.state.bIsResizing && (t += " ActivelyResizing"), this.state.bMinimized && (t += " Minimized"), this.state.bIsMinimizing && (t += " Minimizing");
let n = this.props.titleInfo ? this.props.titleInfo : "";
return T.createElement(
O.v$,
{ style: this.props["data-copystyle"], text: this.props["data-copytext"] },
T.createElement(
"div",
{ className: t, style: e, ref: this.BindContainer },
T.createElement("div", { className: "BBCodeCollapsed", onClick: this.handleCollapse, title: n }, (0, L.Xx)(`#bbcode_${this.props.strMediaType}_minimized`)),
!this.state.bMinimized && !this.state.bIsMinimizing && this.props.children,
T.createElement("div", { className: "BBCodeRestoreControl", onClick: this.handleRestore, title: (0, L.Xx)(`#bbcode_${this.props.strMediaType}_tooltip_restore`) }, T.createElement("div", { className: "restoreSize" })),
T.createElement("div", { className: "BBCodeResizeControl", onMouseDown: this.OnResize, title: (0, L.Xx)(`#bbcode_${this.props.strMediaType}_tooltip_resize`) }, T.createElement(B.$nj, null)),
T.createElement("div", { className: "BBCodeCollapseControl", onClick: this.handleCollapse, title: this.state.bMinimized ? (0, L.Xx)(`#bbcode_${this.props.strMediaType}_tooltip_uncollapse`) : (0, L.Xx)(`#bbcode_${this.props.strMediaType}_tooltip_collapse`) }, T.createElement(B.X, null)),
),
);
}
}
(0, i.gn)([s.ak], $e.prototype, "BindContainer", null), (0, i.gn)([s.ak], $e.prototype, "handleCollapse", null), (0, i.gn)([s.ak], $e.prototype, "OnSizeChanged", null), (0, i.gn)([s.ak], $e.prototype, "handleRestore", null), (0, i.gn)([s.ak], $e.prototype, "OnResize", null), (0, i.gn)([s.ak], $e.prototype, "HandleMouseMove", null), (0, i.gn)([s.ak], $e.prototype, "HandleTallImages", null), (0, i.gn)([s.ak], $e.prototype, "HandleMouseUp", null);
class Ye extends T.Component {
constructor(e) {
super(e);
let t = h.Ul.ChatStore.EmbedStore.GetCollapsedState(this.props.unAccountIDSender, this.props.msgUniqueKey);
this.state = { bCollapsed: t };
}
OnToggleCollapse(e) {
let t = !this.state.bCollapsed;
this.setState({ bCollapsed: t }), h.Ul.ChatStore.EmbedStore.SetCollapsedState(this.props.unAccountIDSender, this.props.msgUniqueKey, t);
}
render() {
let e = this.state.bCollapsed,
t = "BBCodeResizableComponent";
this.props.className && (t += " " + this.props.className), e && (t += " Minimized");
let n = this.props.titleInfo ? this.props.titleInfo : "",
i = e ? (0, L.Xx)(`#bbcode_${this.props.strMediaType}_tooltip_uncollapse`) : (0, L.Xx)(`#bbcode_${this.props.strMediaType}_tooltip_collapse`);
return T.createElement(O.v$, { style: this.props["data-copystyle"], text: this.props["data-copytext"] }, T.createElement("div", { className: t }, T.createElement("div", { className: "BBCodeCollapsed", onClick: this.OnToggleCollapse, title: n }, (0, L.Xx)(`#bbcode_${this.props.strMediaType}_minimized`)), !this.state.bCollapsed && this.props.children, T.createElement(Je, { onClick: this.OnToggleCollapse, title: i })));
}
}
function Je(e) {
return T.createElement("div", { className: "BBCodeCollapseControl", onClick: e.onClick, title: e.title }, T.createElement(B.X, null));
}
function et(e) {
let t = e.titleInfo ? e.titleInfo : "",
n = (0, L.Xx)(`#bbcode_${e.mediaType}_minimized`);
(0, L.Xx)(`#bbcode_${e.mediaType}_tooltip_restore`);
return T.createElement("div", { className: "BBCodeAlreadyCollapsed Minimized" }, T.createElement("div", { className: "BBCodeAlreadyCollapsedText", onClick: e.onClick, title: t }, n), T.createElement("div", { className: "BBCodeCollapseControl", onClick: e.onClick, title: e.titleInfo }, T.createElement(B.X, null)));
}
(0, i.gn)([s.ak], Ye.prototype, "OnToggleCollapse", null);
let tt = class extends ce.fb {
GetVideoID() {
return this.GetArgument("v").replace(/^[^a-z0-9\-_]*([a-z0-9\-_]+).*$/gi, "$1");
}
render() {
return h.Ul.SettingsStore.FriendsSettings.bDisableEmbedInlining ? this.renderNoEmbed() : T.createElement(We, { preference: "youtube", fallbackRender: () => this.renderNoEmbed() }, T.createElement(nt, { videoId: this.GetVideoID(), t: this.GetArgument("t"), context: this.props.context }));
}
renderNoEmbed() {
let e = this.GetArgument("t"),
t = "https://www.youtube.com/watch?v=" + encodeURIComponent(this.GetVideoID());
return e && (t += "&t=" + encodeURIComponent(e)), T.createElement(He, { href: t }, T.createElement(B._F3, null), t);
}
};
tt = (0, i.gn)([k.Pi], tt);
class nt extends T.Component {
constructor(e) {
super(e), (this.state = { strTitle: "", strAuthor: "", strVideoID: "" });
}
OnVideoInfoChanged(e) {
let { strTitle: t, strAuthor: n, strVideoID: i } = e;
this.setState({ strTitle: t, strAuthor: n, strVideoID: i });
}
OnPlayerReady() {
this.props.context.onLoad && this.props.context.onLoad("BBCodeYouTubeComponent " + this.state.strVideoID);
}
OnPlaceholderImageLoad() {
this.props.context.onLoad && this.props.context.onLoad("BBCodeYouTubeComponent " + this.state.strVideoID);
}
componentDidMount() {
me.findDOMNode(this).ownerDocument.defaultView.setTimeout(() => {
this.props.context.onLoad && this.props.context.onLoad("BBCodeYouTubeComponent " + this.state.strVideoID);
}, 250);
}
render() {
let e = this.state.strAuthor,
t = this.state.strTitle,
n = "https://www.youtube.com/watch?v=" + this.state.strVideoID;
const { videoId: i, t: r } = this.props;
r && (n += "&t=" + encodeURIComponent(r));
const a = he(r);
return T.createElement(
O.v$,
{ style: "block", text: [t, n] },
T.createElement(
$e,
{ className: "BBCodeYouTubeComponent", unAccountIDSender: this.props.context.unAccountIDSender, msgUniqueKey: this.props.context.key, strMediaType: "video", titleInfo: t, onSizeChanged: this.props.context.onLoad },
T.createElement("div", { className: "BBCodeYouTubeComponent_Sizer BBCodeResizableElement" }, T.createElement(Se.e, { video: i, startSeconds: a, width: 640, height: 385, autoplay: !1, controls: !0, showFullscreenBtn: !0, onVideoInfoChanged: this.OnVideoInfoChanged, onPlayerReady: this.OnPlayerReady }), T.createElement(O.v$, { style: "block", text: [t, n] }, T.createElement("img", { src: o.De.PUBLIC_SHARED_URL + "images/responsive/youtube_16x9_placeholder.gif", width: "100%", onLoad: this.OnPlaceholderImageLoad }))),
t.length > 0 && T.createElement(G.ns, { className: "test HideWhenMinimized", href: n }, T.createElement("div", { className: "BBCodeTitle" }, t)),
e.length > 0 && T.createElement("div", { className: "BBCodeDetails HideWhenMinimized" }, (0, L.Xx)("#bbcode_youtube_author", e)),
),
);
}
}
var it;
(0, i.gn)([s.ak], nt.prototype, "OnVideoInfoChanged", null),
(0, i.gn)([s.ak], nt.prototype, "OnPlayerReady", null),
(0, i.gn)([s.ak], nt.prototype, "OnPlaceholderImageLoad", null),
(function (e) {
(e[(e.Loading = 1)] = "Loading"), (e[(e.Loaded = 2)] = "Loaded"), (e[(e.Error = 3)] = "Error");
})(it || (it = {}));
let ot = class extends ce.fb {
constructor(e) {
super(e), (this.k_nUnknownImageWidth = 300), (this.k_nUnknownImageHeight = 300), (this.k_nMaxImageWidth = 315);
let t = h.Ul.ChatStore.EmbedStore.GetCollapsedState(this.props.context.unAccountIDSender, this.props.context.key),
n = parseInt(this.GetArgument("width")),
i = parseInt(this.GetArgument("height"));
this.state = { eLoadingState: it.Loading, bCollapsed: t, nMediaWidth: n, nMediaHeight: i };
}
OnToggleCollapse(e) {
let t = !this.state.bCollapsed;
this.setState({ bCollapsed: t }), h.Ul.ChatStore.EmbedStore.SetCollapsedState(this.props.context.unAccountIDSender, this.props.context.key, t);
}
IsEmbeddedInOtherTag() {
for (let e of this.props.parentTags) if ("tweet" == e) return !0;
return !1;
}
IsGiphy() {
return void 0 !== this.GetArgument("giphy_search");
}
IsImgur() {
return this.GetArgument("src").startsWith("https://imgur.com");
}
OnImageLoad(e) {
let t = e.currentTarget;
this.setState({ eLoadingState: it.Loaded, nMediaWidth: t.naturalWidth, nMediaHeight: t.naturalHeight }), this.props.context.onLoad && this.props.context.onLoad("BBCodeImage " + this.props.args.src);
}
OnImageError() {
this.setState({ eLoadingState: it.Error });
}
ShowModal(e, t) {
let n = parseInt(this.GetArgument("width")),
i = parseInt(this.GetArgument("height")),
o = n / i;
const r = e.currentTarget.ownerDocument.defaultView;
let a = 0.85 * r.screen.height,
s = ye.Lh(n || 600, 0.5 * r.screen.width, 0.85 * r.screen.width),
l = ye.Lh(i || 800, 0.5 * r.screen.height, a);
o >= 1 ? ((l = (s - 50) / o + 50), l > a && ((l = a), (s = (l - 50) * o + 50))) : (s = (l - 50) * o + 50), (0, q.BR)(T.createElement(st, { imageUrl: t, ownerWin: r, fullImageUrl: this.GetArgument("src") }), r, "ImageModal", { strTitle: (0, L.Xx)("#bbcode_image_popout"), popupHeight: l, popupWidth: s }, mn(r));
}
OnContextMenu(e) {
(0, G.VK)(e, this.GetArgument("src"));
}
OnClick(e) {
let t = this.GetArgument("src"),
n = this.GetArgument("thumbnail_src");
this.IsGiphy() ? (t = n) : this.IsImgur() && (t = n.replace("?fb", "")), this.ShowModal(e, t);
}
render() {
let e,
t = this.GetArgument("thumbnail_src"),
n = this.GetArgument("srcset", !0),
i = this.GetArgument("src"),
o = this.GetArgument("title"),
r = this.state.eLoadingState,
a = this.IsGiphy(),
s = r == it.Error;
if ((a && (e = `/giphy ${this.GetArgument("giphy_search")}`), s || h.Ul.SettingsStore.FriendsSettings.bDisableEmbedInlining)) {
if (a) return T.createElement(He, { href: i, copyText: [e, i], loadFailed: s }, T.createElement("div", { className: "NonInlinedEmbedLogo NonInlinedEmbedLogo_Giphy" }), T.createElement("span", { style: { fontWeight: "bold" } }, " ", (0, L.kQ)("#bbcode_image_link_giphy", T.createElement("span", { className: "giphySearch" }, this.GetArgument("giphy_search")))));
let t = i;
return o && (t = (0, L.Xx)("#bbcode_disable_embed_inlining_parenthetical", o, De.XW(i))), T.createElement(He, { href: i, copyText: [o, i], loadFailed: s }, T.createElement(B.Eep, null), t);
}
if (this.IsEmbeddedInOtherTag()) return T.createElement(ct, { className: "embeddedImg", context: this.props.context, src: t, onContextMenu: G.mO, onError: this.OnImageError });
if (this.state.bCollapsed) return T.createElement(et, { onClick: this.OnToggleCollapse, mediaType: "image" });
let l = this.state.nMediaWidth,
c = this.state.nMediaHeight;
(l && c) || ((l = this.k_nUnknownImageWidth), (c = this.k_nUnknownImageHeight)), "true" == this.GetArgument("proxied") && (t += "?s=652x652");
let m = "chatImageContainer";
a && (m += " giphyImg");
let d = a ? (0, L.Xx)("#bbcode_image_link_giphy", this.GetArgument("giphy_search")) : i;
return T.createElement(T.Fragment, null, a && T.createElement(O.v$, null, T.createElement("div", null, e)), T.createElement(O.v$, { style: "block", text: [o, i] }, T.createElement("div", { className: m }, T.createElement(rt, { className: "BBCodeImageWrapper", width: l, height: c, maxHeight: Math.min(c, this.k_nMaxImageWidth) }, T.createElement("img", { className: "chatImageFull BBCodeResizableElement", src: t, srcSet: n, onLoad: this.OnImageLoad, onError: this.OnImageError, onContextMenu: this.OnContextMenu, onClick: this.OnClick }), a && T.createElement(at, { strLink: i, searchText: this.GetArgument("giphy_search") }), T.createElement(Je, { onClick: this.OnToggleCollapse, title: d })))));
}
};
function rt(e) {
let t = e.height / e.width,
n = { height: 0, overflow: "hidden", paddingTop: `calc( ${t} * 100% )`, position: "relative" },
i = {};
return e.maxHeight && (i.maxWidth = e.maxHeight / t), T.createElement("div", { style: i, className: e.className }, T.createElement("div", { style: n, className: "PreserveAspect" }, e.children));
}
function at(e) {
let t = (0, L.Xx)("#bbcode_image_tooltip_link_giphy", e.searchText);
return T.createElement(T.Fragment, null, T.createElement(G.ns, { className: "chatImageURL", href: e.strLink, title: t }, T.createElement("div", { className: "giphyTag" }, (0, L.kQ)("#bbcode_image_link_giphy", T.createElement("span", { className: "giphySearch" }, e.searchText)))));
}
function st(e) {
const { closeModal: t, ownerWin: n, imageUrl: i, fullImageUrl: o } = e,
r = T.useCallback(
(e) => {
(0, G.VK)(e, o);
},
[o],
);
return T.createElement(q.e1, { onEscKeypress: t, hideTopBar: !0 }, T.createElement("div", { className: Me().ImageModalBackground }, T.createElement("img", { className: Me().ImageModalContent, src: i, onContextMenu: r })));
}
(0, i.gn)([s.ak], ot.prototype, "OnToggleCollapse", null), (0, i.gn)([s.ak], ot.prototype, "OnImageLoad", null), (0, i.gn)([s.ak], ot.prototype, "OnImageError", null), (0, i.gn)([s.ak], ot.prototype, "ShowModal", null), (0, i.gn)([s.ak], ot.prototype, "OnContextMenu", null), (0, i.gn)([s.ak], ot.prototype, "OnClick", null), (ot = (0, i.gn)([k.Pi], ot));
let lt = class extends ce.fb {
constructor(e) {
super(e), (this.state = { bSeeking: !1, bPlay: !1, bError: !1 });
}
StartVideo() {
this.m_elVideo && this.m_elVideo.play();
}
BindVideo(e) {
this.m_elVideo = e;
}
OnVideoPlay() {
this.setState({ bPlay: !0 });
}
OnVideoPause() {
this.state.bPlay || this.state.bSeeking || this.setState({ bPlay: !1 });
}
OnVideoError(e) {
this.setState({ bError: !0 });
}
OnVideoLoaded() {
this.props.context.onLoad && this.props.context.onLoad("CBBCodeVideo " + this.props.context.key);
}
render() {
return h.Ul.SettingsStore.FriendsSettings.bDisableEmbedInlining ? this.renderNoEmbed() : T.createElement(We, { preference: "generic", render: () => this.renderEmbedded(), fallbackRender: () => this.renderNoEmbed() });
}
renderNoEmbed() {
const e = this.GetArgument("src"),
t = this.GetArgument("title");
let n = e;
return t && (n = (0, L.Xx)("#bbcode_disable_embed_inlining_parenthetical", t, De.XW(e))), T.createElement(He, { href: e }, T.createElement(B.nkn, null), n);
}
renderEmbedded() {
this.GetArgument("simple");
const e = this.GetArgument("src"),
t = this.GetArgument("title");
let n,
i = this.state.bError,
o = { controls: this.state.bPlay, autoPlay: !1, loop: !1, muted: !1 };
return (
i && (n = T.createElement(G.ns, { className: "failedVideoURL", href: e, title: (0, L.Xx)("#bbcode_video_tooltip_link") }, T.createElement("span", { className: "failedVideoSpan" }, e))),
i
? T.createElement("div", { className: "ChatMessageErrorSendingAlert VideoFailed" }, (0, L.kQ)("#Chat_VideoLoadError", n))
: T.createElement(
O.v$,
{ style: "block", text: [t, e] },
T.createElement(
$e,
{ className: "chatVideoContainer", strMediaType: "video", unAccountIDSender: this.props.context.unAccountIDSender, msgUniqueKey: this.props.context.key, titleInfo: e, onSizeChanged: this.props.context.onLoad },
T.createElement("video", Object.assign({ className: "BBCodeResizableElement" }, o, { ref: this.BindVideo, onPause: this.OnVideoPause, onPlay: this.OnVideoPlay, controlsList: "nodownload", onError: this.OnVideoError, onLoadedData: this.OnVideoLoaded }), T.createElement("source", { src: e, type: this.GetArgument("type", !0), onError: this.OnVideoError, onLoad: this.OnVideoLoaded })),
!this.state.bPlay && T.createElement("div", { className: "chatVideoPlayControl HideWhenMinimized", onClick: this.StartVideo }, T.createElement("div", { className: "playButtonContainer" }, T.createElement(B.shV, null))),
T.createElement(G.ns, { className: "chatImageURL", href: e, title: (0, L.Xx)("#bbcode_video_tooltip_link") }, T.createElement(B.yRy, null)),
),
)
);
}
};
(0, i.gn)([s.ak], lt.prototype, "StartVideo", null), (0, i.gn)([s.ak], lt.prototype, "BindVideo", null), (0, i.gn)([s.ak], lt.prototype, "OnVideoPlay", null), (0, i.gn)([s.ak], lt.prototype, "OnVideoPause", null), (0, i.gn)([s.ak], lt.prototype, "OnVideoError", null), (0, i.gn)([s.ak], lt.prototype, "OnVideoLoaded", null), (lt = (0, i.gn)([k.Pi], lt));
class ct extends T.Component {
OnLoad() {
this.props.context.onLoad && this.props.context.onLoad("ImgNotifyChatOnLoad " + this.props.src);
}
render() {
let e = this.props,
{ context: t } = e,
n = (0, i._T)(e, ["context"]);
return T.createElement("img", Object.assign({}, n, { onLoad: this.OnLoad }));
}
}
function mt(e) {
const { context: t, width: n, height: o, src: r } = e,
a = (0, i._T)(e, ["context", "width", "height", "src"]),
s = `${r}?s=${n}x${o}`,
l = s + "dpx2x";
return T.createElement(ct, Object.assign({ context: t }, a, { src: s, srcSet: `${s} 1x, ${l} 2x` }));
}
(0, i.gn)([s.ak], ct.prototype, "OnLoad", null);
let dt = class extends ce.fb {
CopyToClipboard() {
let e = this.GetArgument("url");
e && 0 != e.length && X.J$(e);
}
HandleFocus(e) {
e.target.select();
}
OnLoad() {
this.props.context.onLoad && this.props.context.onLoad(`CBBCodeOpenGraph.OnLoad ${this.GetArgument("url")}`);
}
render() {
let e = this.GetArgument("img"),
t = this.GetArgument("title"),
n = this.GetArgument("desc"),
i = this.GetArgument("url"),
o = De.XW(i);
if (h.Ul.SettingsStore.FriendsSettings.bDisableEmbedInlining) {
let e = i;
return t && (e = (0, L.Xx)("#bbcode_disable_embed_inlining_parenthetical", t, o)), T.createElement(He, { href: i, copyText: [e, i] }, T.createElement(B.nWq, null), e);
}
return T.createElement(
O.v$,
{ style: "block", text: [t, n, i] },
T.createElement(
F.s,
{
className: "ChatMessageOpenGraph",
focusable: h.Ul.IsGamepadUIActive(),
onActivate: () => {
if (!h.Ul.IsGamepadUIActive()) return;
let e = (0, je.A)(i) ? (0, je.d)(i) : i;
h.Ul.OpenURLInBrowser(e, h.D);
},
onOKActionDescription: (0, L.Xx)("#Chat_Visit_Link"),
},
T.createElement(
"div",
{ className: "OpenGraphContent" },
e && e.length > 0 && T.createElement("div", { className: "OpenGraphImgBackground" }, T.createElement("img", { className: "ChatMessageOpenGraph_Image", src: e, onLoad: this.OnLoad })),
e &&
e.length > 0 &&
T.createElement(
G.ns,
{ className: "OpenGraphImgContainer", href: i },
T.createElement(mt, {
width: 256,
height: 140,
context: this.props.context,
className: "ChatMessageOpenGraph_Image",
src: e,
onContextMenu: (e) => {
(0, G.mO)(e, i);
},
}),
),
T.createElement("div", { className: "ChatMessageOpenGraph_Body" }, t && t.length > 0 && T.createElement(G.ns, { className: "ChatMessageOpenGraph_Title", href: i }, t), n && n.length > 0 && T.createElement("div", { className: "ChatMessageOpenGraph_Description" }, n)),
T.createElement("div", { style: { clear: "left" } }),
),
T.createElement("div", { className: "OpenGraphFooter" }, T.createElement("div", { className: "OpenGraphMessageURL" }, T.createElement("span", { className: "OpenGraphMessageURLPosition", onFocus: this.HandleFocus, onClick: this.HandleFocus }, T.createElement("span", { className: "OpenGraphMessageURL_short" }, o), T.createElement("input", { className: "OpenGraphMessageURL_full", value: i, onFocus: this.HandleFocus, onClick: this.HandleFocus, readOnly: !0 }))), T.createElement("div", { className: "OpenGraphURLButton CopyToClipboard", onClick: this.CopyToClipboard, title: (0, L.Xx)("#Chat_Copy_Link_Clipboard") }, T.createElement(B.h9, null))),
),
);
}
};
(0, i.gn)([s.ak], dt.prototype, "CopyToClipboard", null), (0, i.gn)([s.ak], dt.prototype, "HandleFocus", null), (0, i.gn)([s.ak], dt.prototype, "OnLoad", null), (dt = (0, i.gn)([k.Pi], dt));
let ht = class extends ce.fb {
FormatCreatedDate(e) {
let t = new Date(e),
n = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][t.getMonth()];
return `${t.getDate()} ${n} ${t.getFullYear()}`;
}
OpenTweet(e) {
let t = !1,
n = e.target,
i = e.currentTarget;
for (; n && n != i; ) {
if ("A" == n.nodeName || n.classList.contains("chatVideoContainer")) {
t = !0;
break;
}
n = n.parentElement;
}
t || X.p8(i) || (0, G.b8)(e, this.GetArgument("url"));
}
OnImageLoaded() {
this.props.context.onLoad && this.props.context.onLoad("CBBCodeTweet " + this.GetArgument("url"));
}
render() {
let e = this.GetArgument("created"),
t = this.GetArgument("profile_name"),
n = this.GetArgument("profile_screen_name"),
i = this.GetArgument("profile_image"),
o = this.GetArgument("profile_verified"),
r = this.GetArgument("url"),
a = `http://twitter.com/${n}`,
s = "true" == o;
if (((e = this.FormatCreatedDate(e)), h.Ul.SettingsStore.FriendsSettings.bDisableEmbedInlining)) {
let n,
i = { year: "numeric", month: "long", day: "numeric" },
o = new Date(e).toLocaleDateString(L.Yt.GetPreferredLocales(), i);
if ("string" == typeof this.props.children) n = this.props.children;
else if (this.props.children instanceof Array)
for (let e of this.props.children)
if ("string" == typeof e) {
n = e;
break;
}
return T.createElement(He, { href: r, copyText: [n, r] }, T.createElement("div", { className: "NonInlinedEmbedLogo NonInlinedEmbedLogo_Twitter" }), (0, L.Xx)("#bbcode_disable_embed_inlining_tweet", t, o), T.createElement("br", null), T.createElement("div", { className: "NonInlinedEmbedSingleLine" }, n));
}
return T.createElement(
"div",
{ className: Me().ChatMessageTweet, onClick: this.OpenTweet },
T.createElement(O.v$, { style: "block", text: `${t} (@${n})` }, T.createElement("div", { className: Me().ChatMessageTweet_Header }, T.createElement(G.ns, { className: Me().ChatMessageTweet_ProfileImage, href: a }, T.createElement("img", { src: i, onLoad: this.OnImageLoaded })), T.createElement("div", { className: Me().ChatMessageTweet_NameSection }, T.createElement("div", { className: Me().ChatMessageTweet_NameGroup }, T.createElement(G.ns, { className: Me().ChatMessageTweet_Name, href: a }, t), s && T.createElement("div", { className: Me().ChatMessageTweet_Verified })), T.createElement(G.ns, { className: Me().ChatMessageTweet_ScreenName, href: a }, "@", n)), T.createElement(G.ns, { className: Me().ChatMessageTweet_Logo, href: r }))),
T.createElement(O.v$, { style: "block-continue prepend-innertext-with-newline", text: r }, T.createElement("div", { className: Me().ChatMessageTweet_Body }, this.props.children)),
T.createElement("div", { className: Me().ChatMessageTweet_Footer }, T.createElement("div", { className: Me().ChatMessageTweet_Created }, e)),
);
}
};
(0, i.gn)([s.ak], ht.prototype, "OpenTweet", null), (0, i.gn)([s.ak], ht.prototype, "OnImageLoaded", null), (ht = (0, i.gn)([k.Pi], ht));
let ut = class extends ce.fb {
constructor(e) {
super(e), (this.state = { bActivated: !1 });
}
Activate() {
this.setState({ bActivated: !0 });
}
OnImageLoaded() {
this.props.context.onLoad && this.props.context.onLoad("CBBCodeOEmbed " + this.props.context.key);
}
render() {
let e = this.GetArgument("url"),
t = this.GetArgument("title"),
n = this.GetArgument("author"),
i = this.GetArgument("provider_name"),
o = this.GetArgument("preview_image");
if (h.Ul.SettingsStore.FriendsSettings.bDisableEmbedInlining) {
let n = e;
return t && (n = (0, L.Xx)("#bbcode_disable_embed_inlining_parenthetical", t, e)), T.createElement(He, { href: e, copyText: [t, e] }, T.createElement(B.nWq, null), n);
}
let r,
a = !this.state.bActivated;
if ((("SoundCloud" != i && "Spotify" != i) || (a = !1), a)) r = T.createElement("div", { className: "OEmbedPreview", onClick: this.Activate }, T.createElement("div", { className: "oembedImgContainer" }, T.createElement(O.v$, { style: "block", text: [t, e] }, T.createElement("img", { src: o, onLoad: this.OnImageLoaded })), T.createElement("div", { className: "oembedHint" }, (0, L.Xx)("#bbcode_oembed_preview_hint"))), T.createElement("div", { className: "oembedProvider" }, i), T.createElement("div", { className: "oembedTitle" }, t));
else {
const { src: o, width: a, height: s } = JSON.parse(this.GetArgument("iframe_attrs"));
r = T.createElement(G.ns, { className: "OpenGraphImgContainer", href: e, style: { display: "flex", flexDirection: "column" } }, T.createElement(pt, { width: a, height: s, src: o, strProviderName: i }), i && i.length && T.createElement("div", { className: "oembedProvider" }, i), t && t.length > 0 && T.createElement("div", { className: "oembedTitle" }, t), n && n.length > 0 && T.createElement("div", { className: "oembedAuthor" }, (0, L.Xx)("#bbcode_oembed_author", n)));
}
let s = "generic";
return "Vimeo" == i ? (s = "vimeo") : "Sketchfab" == i && (s = "sketchfab"), T.createElement(We, { fallbackHref: e, preference: s }, T.createElement(O.v$, { style: "block", text: [t, e] }, T.createElement("div", { className: "BBCodeOEmbedComponent " + i }, r)));
}
};
function pt(e) {
const t = e.strProviderName;
let { src: n, width: i, height: o } = e;
if (!n || !n.startsWith("http")) return null;
"SoundCloud" == t && (n = n.replace("visual=true", "visual=false"));
const r = 640;
let a = "number" == typeof i ? i : parseInt(i),
s = "number" == typeof o ? o : parseInt(o);
!isNaN(a) && !isNaN(s) && a > r && ((s *= r / a), (a = r));
const l = { flex: isNaN(s) ? void 0 : `1 1 ${s}px`, maxWidth: r };
return T.createElement("iframe", { height: isNaN(s) ? void 0 : `${s}px`, style: l, src: n, scrolling: "no", frameBorder: 0, sandbox: "allow-scripts allow-same-origin", allowFullScreen: "Vimeo" === t || void 0 });
}
(0, i.gn)([s.ak], ut.prototype, "Activate", null), (0, i.gn)([s.ak], ut.prototype, "OnImageLoaded", null), (ut = (0, i.gn)([k.Pi], ut));
class _t extends ce.fb {
render() {
return T.createElement(le, null, this.props.children);
}
}
class gt extends ce.fb {
render() {
const {
context: { bAnimate: e, onAnimationStart: t, onAnimationEnd: n },
} = this.props;
return T.createElement("div", { className: (0, ne.Z)(Me().plusOne, e && Me().MsgAnimating), onAnimationStart: t, onAnimationEnd: n }, "+1");
}
}
class Ct extends ce.fb {
render() {
const {
context: { bAnimate: e, onAnimationStart: t, onAnimationEnd: n },
} = this.props,
i = this.props.children,
o = this.GetArgument("result"),
r = (0, ne.Z)(Me().flipCoinAndResult, e && Me().MsgAnimating),
a = (0, ne.Z)(Me().flipCoinContainer, o);
return T.createElement(O.v$, { text: i }, T.createElement("div", { className: r, onAnimationStart: t, onAnimationEnd: n }, T.createElement("div", null, "/flip:"), T.createElement("div", { className: a }, T.createElement("div", { className: Me().coin }, T.createElement("div", { className: Me().front }), T.createElement("div", { className: Me().front_b }), T.createElement("div", { className: Me().mid }), T.createElement("div", { className: Me().back }), T.createElement("div", { className: Me().back_b }))), T.createElement("div", { className: Me().resultLabel }, (0, L.Xx)("#SlashCommandCoinFlip_Result_" + o))));
}
}
class ft extends ce.fb {
Pad(e, t) {
let n = e + "";
for (; n.length < t; ) n = "0" + n;
return n;
}
GetLastNumber(e) {
if (e < 10) return e;
let t = Math.pow(10, Math.floor(Math.log(e) / Math.log(10)) - 1),
n = Math.floor(e / t);
return n - 10 * Math.floor(n / 10);
}
render() {
let e = this.props.children,
t = this.GetArgument("min"),
n = this.GetArgument("max"),
i = this.Pad(this.GetArgument("result"), n.length),
o = [],
r = !0;
for (let e = 0; e < n.length; e++) {
"0" != i[e] && (r = !1);
let t = ((n.length - e) * Math.max(0.5 * n.length, 2)) / n.length,
a = 10 - e;
o.push(
T.createElement(
"div",
{ key: "random" + e, className: Me().numberCounterContainer },
T.createElement(
"div",
{ className: Me().numberColumn + (r ? " " + Me().startingZero : ""), style: { animationDuration: t + "s", animationName: Me()["randomNumbers" + a] } },
T.createElement("div", { className: `${Me().randomNumberLabel} ${Me().randomActual}` }, i[e]),
T.createElement("div", { className: Me().randomNumberLabel }, this.GetLastNumber(parseInt(i[e]) + 1)),
T.createElement("div", { className: Me().randomNumberLabel }, this.GetLastNumber(parseInt(i[e]) + 2)),
T.createElement("div", { className: Me().randomNumberLabel }, this.GetLastNumber(parseInt(i[e]) + 3)),
T.createElement("div", { className: Me().randomNumberLabel }, this.GetLastNumber(parseInt(i[e]) + 4)),
T.createElement("div", { className: Me().randomNumberLabel }, this.GetLastNumber(parseInt(i[e]) + 5)),
T.createElement("div", { className: Me().randomNumberLabel }, this.GetLastNumber(parseInt(i[e]) + 6)),
T.createElement("div", { className: Me().randomNumberLabel }, this.GetLastNumber(parseInt(i[e]) + 7)),
T.createElement("div", { className: Me().randomNumberLabel }, this.GetLastNumber(parseInt(i[e]) + 8)),
T.createElement("div", { className: Me().randomNumberLabel }, this.GetLastNumber(parseInt(i[e]) + 9)),
T.createElement("div", { className: Me().randomNumberLabel }, i[e]),
),
T.createElement("div", { className: Me().randomNumberShadow }),
),
);
}
const {
context: { bAnimate: a, onAnimationStart: s, onAnimationEnd: l },
} = this.props;
return T.createElement(O.v$, { text: e }, T.createElement("div", { className: (0, ne.Z)(Me().randomMsg, a && Me().MsgAnimating), onAnimationStart: s, onAnimationEnd: l }, T.createElement("span", null, "/random "), T.createElement("span", { className: Me().randomValues }, t, "-", n), " : ", o));
}
}
class vt extends ce.fb {
render() {
return T.createElement(se, null, this.props.children);
}
}
class St extends ce.fb {
render() {
return T.createElement(ae, null, this.props.children);
}
}
class bt extends ce.fb {
render() {
return T.createElement(re, null, this.props.children);
}
}
class It extends ce.fb {
constructor(e) {
super(e), (this.state = { invite: void 0 });
}
static getDerivedStateFromProps(e, t) {
let n = e.args.invitecode;
return { invite: e.context.chat.ChatStore.InviteStore.GetInviteFromCode(n) };
}
render() {
let e = this.props.context.chat.GetMember(this.props.context.unAccountIDSender);
return T.createElement(Y, { invite: this.state.invite, inviter: e });
}
}
class yt extends ce.fb {
constructor(e) {
super(e), (this.state = { invite: void 0, inviter: void 0, invitee: void 0 });
}
static getDerivedStateFromProps(e, t) {
let n,
i,
o,
r = e.args.chatgroupid,
a = e.args.chatid,
s = e.context.chat;
return s.self.accountid == e.context.unAccountIDSender ? ((i = s.self), (o = s.chat_partner), (n = s.accountid_partner)) : ((i = s.chat_partner), (o = s.self), (n = s.self.accountid)), { invite: e.context.chat.ChatStore.InviteStore.GetDirectInviteInfo(r, a, n), inviter: i, invitee: o };
}
render() {
return T.createElement(Y, { invite: this.state.invite, inviter: this.state.inviter, invitee: this.state.invitee });
}
}
class Et extends ce.fb {
constructor(e) {
super(e), (this.state = { inviter: void 0, inviteTarget: void 0, gameInvite: void 0 });
}
static getDerivedStateFromProps(e, t) {
let n,
i,
o = e.args.appid,
r = e.args.connect,
a = e.args.remoteplay,
s = e.context.chat;
return s.self.accountid == e.context.unAccountIDSender ? ((n = s.self), (i = s.chat_partner)) : ((n = s.chat_partner), (i = s.self)), { inviter: n, inviteTarget: i, gameInvite: e.context.chat.ChatStore.GameInviteStore.RegisterGameInvite(e.context.unAccountIDSender, e.context.rtTimestamp, parseInt(o), r, a, void 0) };
}
render() {
return T.createElement(W, { inviter: this.state.inviter, inviteTarget: this.state.inviteTarget, gameInvite: this.state.gameInvite });
}
}
class Dt extends ce.fb {
constructor(e) {
super(e), (this.state = { inviter: void 0, inviteTarget: void 0, gameInvite: void 0 });
}
static getDerivedStateFromProps(e, t) {
let n,
i,
o = e.args.appid,
r = e.args.lobbyid,
a = e.context.chat;
return a.self.accountid == e.context.unAccountIDSender ? ((n = a.self), (i = a.chat_partner)) : ((n = a.chat_partner), (i = a.self)), { inviter: n, inviteTarget: i, gameInvite: e.context.chat.ChatStore.GameInviteStore.RegisterGameInvite(e.context.unAccountIDSender, e.context.rtTimestamp, parseInt(o), "", "", r) };
}
render() {
return T.createElement(W, { inviter: this.state.inviter, inviteTarget: this.state.inviteTarget, gameInvite: this.state.gameInvite });
}
}
class wt extends ce.fb {
constructor(e) {
super(e), (this.state = { broadcastid: "", broadcaster: void 0, viewer: void 0, appid: 0 });
}
static getDerivedStateFromProps(e, t) {
let n,
i,
o = e.args.broadcastid,
r = Number(e.args.appid),
a = e.context.chat;
return a.self.accountid == e.context.unAccountIDSender ? ((n = a.self), (i = a.chat_partner)) : ((n = a.chat_partner), (i = a.self)), { broadcastid: o, broadcaster: n, viewer: i, appid: r };
}
render() {
return T.createElement(x, { broadcastid: this.state.broadcastid, appid: this.state.appid, broadcaster: this.state.broadcaster, viewer: this.state.viewer });
}
}
class Rt extends ce.fb {
constructor(e) {
super(e), (this.state = { broadcaster: void 0, viewer: void 0, requestid: 0, appid: 0 });
}
static getDerivedStateFromProps(e, t) {
let n,
i,
o = Number(e.args.requestid),
r = e.context.chat,
a = h.Ul.FriendStore.self.persona.m_unGamePlayedAppID;
return r.self.accountid != e.context.unAccountIDSender ? ((n = r.self), (i = r.chat_partner)) : ((n = r.chat_partner), (i = r.self)), { requestid: o, appid: a, broadcaster: n, viewer: i };
}
render() {
return T.createElement(P, { requestid: this.state.requestid, appid: this.state.appid, broadcaster: this.state.broadcaster, viewer: this.state.viewer });
}
}
let At = class extends ce.fb {
constructor(e) {
super(e), (this.m_bMounted = !1), (this.state = { bHaveVoteData: !1, bLocalVoteDown: !1, bLocalVoteUp: !1, nCommentCount: parseInt(this.GetArgument("num_comments_public")) });
}
componentWillUnmount() {
this.m_bMounted = !1;
}
componentDidMount() {
this.m_bMounted = !0;
let e = h.Ul.CMInterface;
if (e) {
let t = this.GetArgument("fileid"),
n = I.gA.Init(_e.Zc, 8509);
n.Body().add_published_file_ids().set_published_file_id(t),
e.SendMsgAndAwaitResponse(n, _e.tj).then((e) => {
if (1 == e.Body().eresult() && 1 == e.Body().user_item_vote_details().length) {
let t = e.Body().user_item_vote_details()[0].vote();
this.m_bMounted && this.setState({ bHaveVoteData: !0, bLocalVoteUp: 1 == t, bLocalVoteDown: 2 == t });
}
});
}
}
VoteItem(e, t) {
let n = h.Ul.CMInterface;
if (n) {
let i = I.gA.Init(_e.RI, 8507);
i.Body().set_published_file_id(t),
i.Body().set_vote_up(e),
n.SendMsgAndAwaitResponse(i, _e.ep).then((t) => {
1 == t.Body().eresult() && this.m_bMounted && this.setState({ bLocalVoteUp: e, bLocalVoteDown: !e });
});
}
}
render() {
let e,
t = this.GetArgument("fileid"),
n = this.GetArgument("url"),
i = this.GetArgument("title"),
o = this.GetArgument("description"),
r = this.GetArgument("preview_url"),
a = parseInt(this.GetArgument("file_type")),
s = ["SteamPublishedFile"];
switch (a) {
case 16:
s.push("clip"), (e = T.createElement(Ke, { previewURL: r, clipID: this.GetArgument("external_asset_id") })), (r = void 0);
break;
case 4:
s.push("video");
break;
case 3:
case 5:
s.push("image");
}
if (h.Ul.SettingsStore.FriendsSettings.bDisableEmbedInlining) {
let e = n;
i && (e = (0, L.Xx)("#bbcode_disable_embed_inlining_steam_workshop", i));
let t = T.createElement(B.nWq, null);
switch (a) {
case 4:
t = T.createElement(B.nkn, null);
break;
case 3:
case 5:
t = T.createElement(B.Eep, null);
}
return T.createElement(He, { href: n, copyText: [e, n] }, t, e);
}
let l,
c = parseInt(this.GetArgument("num_comments_public")),
m = parseInt(this.GetArgument("votes_up"));
return (
this.state.bLocalVoteUp && m++,
(i || o) && (l = T.createElement(O.v$, { text: [i, o, n] }, T.createElement("div", { className: "ChatLargeImageContainer_Description" }, i && T.createElement(G.ns, { className: "ChatMessageOpenGraph_Title", href: n }, i), o && T.createElement("div", { className: "ChatMessageOpenGraph_Description" }, o)))),
T.createElement(
"div",
{ className: s.join(" ") },
r &&
r.length > 0 &&
T.createElement(
G.ns,
{ className: "ChatLargeImageContainer", href: n },
T.createElement(ct, {
context: this.props.context,
className: "ChatLargeImageContainer_Image",
src: r,
onContextMenu: (e) => {
(0, G.VK)(e, n);
},
}),
),
e,
l,
T.createElement(G.ns, { className: "SteamPublishedFile_Logo", href: n }),
this.state.bHaveVoteData &&
T.createElement(
"div",
null,
T.createElement(
"div",
{ className: "workshopItemControls" },
T.createElement(
"div",
{ className: "workshopItemControlCtn" },
m >= 0 && T.createElement("span", { className: "upvoteCount" }, m),
c >= 0 && T.createElement("span", { className: "commentCount" }, c),
T.createElement(
"span",
{
className: this.state.bLocalVoteUp ? "general_btn voteUp toggled" : "general_btn voteUp",
onClick: () => {
this.VoteItem(!0, t);
},
},
(0, L.Xx)("#bbcode_community_publishedfile_vote_up"),
),
T.createElement("span", {
className: this.state.bLocalVoteDown ? "general_btn voteDown toggled" : "general_btn voteDown",
onClick: () => {
this.VoteItem(!1, t);
},
}),
),
),
),
)
);
}
};
At = (0, i.gn)([k.Pi], At);
class Mt extends ce.fb {
OnCreateOfferClick(e) {
let t = "NewTradeOffer" + parseInt(this.GetArgument("partner"));
X.RA(e).open(this.GetArgument("url"), t, "height=1120,width=1028,resize=yes,scrollbars=yes").focus();
}
render() {
let e = this.GetArgument("url"),
t = parseInt(this.GetArgument("partner"));
if (t && t == this.props.context.unAccountIDSender) {
let n = this.props.context.chat.GetMember(t);
if (n) {
let t = (0, L.Xx)("#TradeOfferLink_Label");
return T.createElement(O.v$, { style: "block", text: [t, e] }, T.createElement("div", { className: "ChatMessageInvite NoBGSplitInvite TradeOfferInvite" }, T.createElement("div", { className: "leftInviteContainer" }, T.createElement(V.o2, { friend: n, context: { chat: this.props.context.chat }, bLarge: !0 })), T.createElement("div", { className: "rightInviteContainer rightInvite_Horizontal" }, T.createElement("div", { className: "rightInviteContainerContent" }, T.createElement("div", { className: "inviteLabel TradeOfferInvite_Title" }, (0, L.kQ)("#TradeOfferLink_SharedTradeLink", n.display_name)), T.createElement(te, { url: e, strLabel: t })), T.createElement("button", { className: "inviteButton inviteButtonJoinChat", type: "button", onClick: this.OnCreateOfferClick }, (0, L.kQ)("#TradeOfferLink_SendUserOffer"))), T.createElement("div", { style: { clear: "left" } })));
}
}
return T.createElement(G.ns, { href: e }, e);
}
}
(0, i.gn)([s.ak], Mt.prototype, "OnCreateOfferClick", null);
class kt extends ce.fb {
ViewOfferClick(e) {
let t = this.GetArgument("id"),
n = o.De.COMMUNITY_BASE_URL + "tradeoffer/" + t + "/",
i = "ViewTradeOffer" + t;
X.RA(e).open(n, i, "height=1120,width=1028,resize=yes,scrollbars=yes").focus();
}
ViewMyOffersClick(e) {
let t = this.props.context.chat.self.steamid64,
n = this.GetArgument("id"),
i = `${o.De.COMMUNITY_BASE_URL}profiles/${t}/tradeoffers/sent/#tradeofferid_${n}`;
(0, G.b8)(e, i);
}
render() {
let e = this.GetArgument("id"),
t = parseInt(this.GetArgument("sender"));
if (!e && this.GetArgument("url")) return T.createElement(Mt, Object.assign({}, this.props));
let n = this.props.context.chat,
i = n.self.accountid == t,
o = T.createElement("span", { className: "inviteeNameLabel" }, n.chat_partner.display_name);
return T.createElement(
"div",
{ className: "ChatMessageInvite TradeOfferInvite" },
T.createElement("div", { className: "leftInviteContainer" }, T.createElement(V.o2, { friend: i ? n.self : n.chat_partner, context: { chat: n }, bLarge: !0 }), T.createElement(B.hoX, null)),
T.createElement("div", { className: "rightInviteContainer" + (i ? " rightInvite_Horizontal" : "") }, T.createElement("div", { className: "rightInviteContainerContent" }, T.createElement(O.v$, null, T.createElement("div", { className: "inviteLabel TradeOfferInvite_Title" }, (0, L.kQ)(i ? "#TradeOffer_YouSentFriend" : "#TradeOffer_FriendSentYou", o)), T.Children.count(this.props.children) > 0 && T.createElement("div", { className: "TradeOffer_NoteFromFriendCtn" }, T.createElement("div", { className: "TradeOffer_NoteFromFriend_QuoteArrow" }), T.createElement("div", { className: "inviteLabel TradeOffer_NoteFromFriend" }, this.props.children)))), T.createElement("button", { className: "DialogButton Primary", type: "button", onClick: i ? this.ViewMyOffersClick : this.ViewOfferClick }, (0, L.kQ)("#TradeOffer_ViewTradeOffer"))),
T.createElement("div", { style: { clear: "left" } }),
);
}
}
(0, i.gn)([s.ak], kt.prototype, "ViewOfferClick", null), (0, i.gn)([s.ak], kt.prototype, "ViewMyOffersClick", null);
class Tt extends ce.fb {
constructor(e) {
super(e), (this.state = { broadcaster: void 0 });
}
static getDerivedStateFromProps(e, t) {
let n = new ue.K(e.args.broadcaster);
return { broadcaster: h.Ul.FriendStore.GetPlayer(n.GetAccountID()) };
}
render() {
return T.createElement(U, { broadcaster: this.state.broadcaster });
}
}
let Lt = class extends ce.fb {
CopyToClipboard() {
let e = this.GetArgument("url");
e && 0 != e.length && X.J$(e);
}
constructor(e) {
super(e), (this.m_bMounted = !1), (this.state = { bLoading: !0, bStillLoading: !1, bLoadFail: !1, bLoadSuccess: !1, description: null });
}
componentWillUnmount() {
this.m_bMounted = !1;
}
componentDidMount() {
this.m_bMounted = !0;
let e = h.Ul.CMInterface;
if (e) {
let t = parseInt(this.GetArgument("appid")),
n = this.GetArgument("classid"),
i = this.GetArgument("instanceid"),
r = I.gA.Init(ge.T4);
r.Body().set_language(o.De.LANGUAGE), r.Body().set_appid(t);
let a = r.Body().add_classes();
a.set_classid(n),
a.set_instanceid(i),
ge.$n.GetAssetClassInfo(e.GetServiceTransport(), r).then((e) => {
this.m_bMounted && (1 == e.GetEResult() ? this.setState({ bLoading: !1, bLoadFail: !1, bLoadSuccess: !0, description: e.Body().descriptions()[0] }) : this.setState({ bLoading: !1, bLoadFail: !0, bLoadSuccess: !1 }));
});
}
me.findDOMNode(this).ownerDocument.defaultView.setTimeout(() => {
this.m_bMounted && this.setState((e) => (e.bLoading ? { bStillLoading: !0 } : null));
}, 500);
}
OnImageLoaded() {
this.props.context.onLoad && this.props.context.onLoad("CBBCodeEconItem " + this.GetArgument("url"));
}
render() {
let e = this.GetArgument("image"),
t = this.GetArgument("url"),
n = parseInt(this.GetArgument("appid")),
i = this.GetArgument("contextid"),
r = this.GetArgument("assetid"),
a = this.GetArgument("market_hash_name"),
s = parseInt(this.GetArgument("owner")),
l = h.Ul.AppInfoStore.GetAppInfo(n);
if (s && t) {
let c = this.props.context.chat.GetMember(s),
m = c ? c.display_name : this.GetArgument("persona"),
d = De.XW(t),
u = `${o.De.COMMUNITY_BASE_URL}economy/image/${e}/512x512`,
p = { color: "" },
_ = `${o.De.COMMUNITY_BASE_URL}market/listings/${n}/${a}`,
g = `${o.De.COMMUNITY_BASE_URL}tradeoffer/new/?partner=${s}&for_items[]=${n}_${i}_${r}`;
return (
this.state.bLoadSuccess && (this.state.description.name_color() && (p.color = "#" + this.state.description.name_color()), this.state.description.icon_url_large() ? (u = `${o.De.COMMUNITY_BASE_URL}economy/image/${this.state.description.icon_url_large()}/512x512`) : this.state.description.icon_url() && (u = `${o.De.COMMUNITY_BASE_URL}economy/image/${this.state.description.icon_url()}/512x512`)),
T.createElement(
O.v$,
{ text: t },
T.createElement(
"div",
{ className: "ChatMessageOpenGraph" },
T.createElement(
"div",
{ className: "OpenGraphContent ClientFetchesData" },
T.createElement("div", { className: "OpenGraphImgBackground" }, T.createElement("img", { className: "ChatMessageOpenGraph_Image", src: u, onLoad: this.OnImageLoaded })),
T.createElement(
G.ns,
{ className: "OpenGraphImgContainer", href: t },
T.createElement(ct, {
context: this.props.context,
className: "ChatMessageOpenGraph_Image",
src: u,
onContextMenu: (e) => {
(0, G.mO)(e, t);
},
}),
),
T.createElement(
"div",
{ className: "ChatMessageOpenGraph_Body" },
this.state.bStillLoading && T.createElement(Z.V, { size: "medium", position: "center" }),
this.state.bLoadSuccess &&
T.createElement(
O.v$,
{ text: [(0, L.Xx)("#bbcode_econ_ItemTitle", m, this.state.description.name()), t] },
T.createElement(
"div",
null,
T.createElement(G.ns, { className: "ChatMessageOpenGraph_Title", href: t, style: p }, (0, L.Xx)("#bbcode_econ_ItemTitle", m, this.state.description.name())),
T.createElement("div", { className: "ChatMessageOpenGraph_Description" }, T.createElement("div", { className: "EconItemOpenGraph_GameInfo" }, T.createElement("img", { src: l.icon_url, onLoad: this.OnImageLoaded }), T.createElement("div", null, T.createElement("div", null, l.name), T.createElement("div", null, this.state.description.type())))),
T.createElement("div", { style: { marginTop: "1em" } }, this.state.description.tradable() && h.Ul.CMInterface && s != h.Ul.CMInterface.steamid.GetAccountID() && T.createElement(G.ns, { className: "general_btn inline", href: g }, (0, L.Xx)("#bbcode_econ_TradeWithOwner", m)), this.state.description.marketable() && T.createElement(G.ns, { className: "general_btn inline", href: _ }, (0, L.Xx)("#bbcode_econ_ViewInMarket"))),
),
),
this.state.bLoadFail && T.createElement("div", null, T.createElement(G.ns, { className: "ChatMessageOpenGraph_Title", href: t }, (0, L.Xx)("#bbcode_econ_UnknownItem")), T.createElement("div", { className: "ChatMessageOpenGraph_Description" }, (0, L.Xx)("#bbcode_econ_LoadFail"))),
),
),
T.createElement("div", { className: "OpenGraphFooter" }, T.createElement(G.ns, { className: "OpenGraphMessageURL", href: t }, T.createElement("span", { className: "OpenGraphMessageURLPosition" }, T.createElement("span", { className: "OpenGraphMessageURL_short" }, d), T.createElement("span", { className: "OpenGraphMessageURL_full" }, t))), T.createElement("div", { className: "OpenGraphURLButton CopyToClipboard", onClick: this.CopyToClipboard }, T.createElement(B.h9, null))),
),
)
);
}
return T.createElement(G.ns, { href: t }, t);
}
};
(0, i.gn)([s.ak], Lt.prototype, "CopyToClipboard", null), (0, i.gn)([s.ak], Lt.prototype, "OnImageLoaded", null), (Lt = (0, i.gn)([k.Pi], Lt));
class Gt extends ce.fb {
render() {
let e = this.props.children ? this.props.args[""] : "";
return T.createElement(O.v$, { text: (0, L.Xx)("#bbcode_linkremoved") }, T.createElement("span", { className: "filteredURL bb_removedlink", title: (0, L.Xx)("#Community_RemoveLink_Tooltip") }, T.createElement(B.ge, null), T.createElement("span", { className: "threatURLDesc" }, (0, L.Xx)("#bbcode_linkremoved_desc")), T.createElement("span", { className: "threatURL" }, e)));
}
}
let Ot = class extends ce.fb {
render() {
let e = this.GetArgument();
if (e) {
if (("here" == e && (e = "online"), "all" == e || "online" == e)) return T.createElement("span", { className: "mention me" }, T.createElement("span", { className: "MentionAtSymbol" }, "@"), e);
{
let t = parseInt(e),
n = t && this.props.context.chat.GetMember(t);
if ((n || (n = t && h.Ul.FriendStore.GetPlayer(t)), n)) {
let e = n.accountid == this.props.context.chat.self.accountid;
return T.createElement(V.yd, { friend: n, context: { chat: this.props.context.chat } }, T.createElement("span", { className: "mention" + (e ? " me" : "") }, T.createElement("span", { className: "MentionAtSymbol" }, "@"), n.display_name));
}
}
}
return T.createElement("span", null, "@" + e);
}
};
Ot = (0, i.gn)([k.Pi], Ot);
class Ft extends ce.fb {
render() {
let e = "";
return (
"string" == typeof this.props.children
? (e = this.props.children)
: T.Children.forEach(this.props.children, (t) => {
if (("string" == typeof t && (e += t), "object" == typeof t && t.props)) {
let n = t.props["bbcode-text"];
n && (e += n);
}
}),
e ? T.createElement(ve.tk, { emoticon: e, emoticonHoverStore: Ce.$, large: this.props.context.bUseLargeEmoticons }) : null
);
}
}
var Bt;
!(function (e) {
(e[(e.Large = 3)] = "Large"), (e[(e.Medium = 2)] = "Medium"), (e[(e.Small = 1)] = "Small"), (e[(e.Tiny = 0)] = "Tiny");
})(Bt || (Bt = {}));
let xt = class extends ce.fb {
constructor() {
super(...arguments), (this.state = { SteamStoreItem: null, bStoreRequestFailed: !1, bPlayVideo: !1, nThumbnailHovered: -1, nContentSize: Bt.Large }), (this.m_contentRef = T.createRef()), (this.m_storePreferences = h.Ul.SettingsStore.StorePreferences), (this.m_resizeObserver = null);
}
componentDidMount() {
return (0, i.mG)(this, void 0, void 0, function* () {
const e = this.GetArgument("app"),
t = o.De.COUNTRY || "US",
n = yield M().get(`${o.De.STORE_BASE_URL}api/appdetails?appids=${e}&cc=${t}&language=${o.De.LANGUAGE}&filters=basic,price_overview,developers,screenshots,movies,release_date,content_descriptors&client=${o.De.IN_CLIENT}&origin=${(0, o.Kc)()}`);
let i = null;
if (n && n.data) {
const e = this.GetArgument("app");
i = n.data[e];
}
i && i.success ? this.setState({ SteamStoreItem: this.ExtractGameData(i.data), bStoreRequestFailed: !1 }, this.OnFrameLoaded) : this.setState({ bStoreRequestFailed: !0 });
let r = this.m_contentRef.current;
r && (this.m_resizeObserver = (0, s.it)(r, this.OnResize));
});
}
componentWillUnmount() {
this.m_resizeObserver && this.m_resizeObserver.disconnect();
}
OnResize() {
var e, t;
let n = null === (t = null === (e = this.m_contentRef.current) || void 0 === e ? void 0 : e.getClientRects()[0]) || void 0 === t ? void 0 : t.width;
n && (n < 288 ? this.setState({ nContentSize: Bt.Tiny }) : n < 348 ? this.setState({ nContentSize: Bt.Small }) : n < 484 ? this.setState({ nContentSize: Bt.Medium }) : this.setState({ nContentSize: Bt.Large }));
}
ExtractGameData(e) {
const { name: t, is_free: n, short_description: i, header_image: o, developers: r, screenshots: a, movies: s, release_date: l, price_overview: c, content_descriptors: m, steam_appid: d } = e;
return { name: t, is_free: n, description: (0, Ee.HA)(i), header_image: o, developer: r && r[0], screenshot: a && a[0] && a[0].path_thumbnail, screenshots: a && a, movie: s && s[0] && s[0].webm && s[0].webm[480] && s[0].webm[480].replace("http://", "https://"), thumbnail: s && s[0] && s[0].thumbnail, release_date: l && l.date, url: (0, pe.FG)(d, "chatlink"), price: c && c.final_formatted, initial_price: c && c.initial_formatted, discount: c && c.discount_percent && c.discount_percent, content_descriptor_ids: m && m.ids };
}
OnFrameLoaded() {
this.props.context.onLoad && this.props.context.onLoad("CBBCodeSteamStore " + this.GetArgument("app"));
}
OpenStoreLink(e) {
let t = X.RA(e);
(0, G.b8)(t, this.state.SteamStoreItem.url);
}
PlayVideoClicked() {
this.setState({ bPlayVideo: !this.state.bPlayVideo });
}
OnThumbnailOver(e) {
this.setState({ nThumbnailHovered: e });
}
OnThumbnailLeave() {
this.setState({ nThumbnailHovered: -1 });
}
CopyToClipboard() {
let e = this.props.children;
e && 0 != e.length && X.J$(e);
}
render() {
if (h.Ul.SettingsStore.FriendsSettings.bDisableEmbedInlining) {
let e = Ze(this.props.children);
return T.createElement(He, { href: e }, T.createElement(B.nWq, null), e);
}
const e = () => {};
if (this.state.bStoreRequestFailed) {
let t = h.Ul.FriendStore.GetPlayer(this.props.context.unAccountIDSender).display_name,
n = Ze(this.props.children),
i = T.createElement("span", { className: Me().senderName }, t),
o = T.createElement("span", { className: Me().URLSent }, n),
r = T.createElement(G.ns, { className: Me().SteamURL, href: "https://store.steampowered.com/" }, (0, L.Xx)("#bbcode_steam_store_embed_Failed_Steam_Store"));
return T.createElement(F.s, { className: Me().ChatMessageSteamStore_Failed, onActivate: e, onOKActionDescription: (0, L.Xx)("#bbcode_steam_store_embed_ViewStorePage_Filtered") }, T.createElement("span", null, (0, L.kQ)("#bbcode_steam_store_embed_Failed", i, r, o)));
}
let t = this.state.SteamStoreItem;
if (!t) return T.createElement("div", { className: Me().ChatMessageSteamStore, style: { width: 640, height: 208 } }, T.createElement("div", { className: Me().ChatMessageSteamStore_Header, style: { height: 70 } }, T.createElement("div", { className: Me().ChatMessageSteamStore_HeaderImage })), T.createElement(Z.V, null));
const { name: n, price: i, description: o, header_image: r, developer: a, movie: s, thumbnail: l, release_date: c, screenshots: m, is_free: d, initial_price: u, discount: p, content_descriptor_ids: _ } = t;
let g = !1;
const C =
this.m_storePreferences &&
this.m_storePreferences.content_descriptor_preferences() &&
this.m_storePreferences.content_descriptor_preferences().content_descriptors_to_exclude() &&
this.m_storePreferences
.content_descriptor_preferences()
.content_descriptors_to_exclude()
.map((e) => e.content_descriptorid());
_ && C && _.some((e) => -1 !== C.indexOf(e)) && (g = !0);
let f = [],
v = !0;
if (g) v = !1;
else
for (let e = 0; e < m.length; e++) {
let t = e;
if ((s || (t = e + 1), (s && t > 2) || (!s && t > 3))) break;
let n = "";
m && m[t] && "undefined" !== m[t].path_thumbnail ? (n = `${m[t].path_thumbnail}`) : (v = !1), f.push(T.createElement("div", { key: "screenshot" + t, className: Me().ChatMessageSteamStore_Screenshot }, T.createElement("img", { className: Me().ChatMessageSteamStore_ScreenshotThumbnail, src: n, onMouseEnter: () => this.OnThumbnailOver(t) })));
}
let S = Me().Large,
b = !("0" == p || null == p),
I = this.state.nThumbnailHovered,
y = this.state.bPlayVideo,
E = T.createElement("div", { className: Me().ChatMessageSteamStore_FilteredDescription }, (0, L.Xx)("#bbcode_steam_store_embed_Filtered"), " ");
switch (this.state.nContentSize) {
case Bt.Tiny:
S = Me().TinyContent;
break;
case Bt.Small:
S = Me().SmallContent;
break;
case Bt.Medium:
S = Me().MediumContent;
break;
case Bt.Large:
S = Me().LargeContent;
}
return T.createElement(
F.s,
{ ref: this.m_contentRef, className: (0, ne.Z)(Me().ChatMessageSteamStore, g ? Me().ChatMessagesSteamStore_FilteredContent : null, S), onActivate: this.OpenStoreLink, onOKActionDescription: (0, L.Xx)(g ? "#bbcode_steam_store_embed_ViewStorePage_Filtered" : "#bbcode_steam_store_embed_ViewStorePage") },
T.createElement(
"div",
{ className: Me().ChatMessageSteamStore_Header },
r && T.createElement(T.Fragment, null, T.createElement("img", { className: Me().ChatMessageSteamStore_HeaderImage, src: r, onClick: g ? null : this.OpenStoreLink }), g && T.createElement("div", { className: Me().ChatMessageSteamStore_HeaderImageFiltered }, (0, L.Xx)("#bbcode_steam_store_embed_Image_Filtered")), T.createElement("img", { className: (0, ne.Z)(Me().ChatMessageSteamStore_HeaderImage, Me().Blurred), src: r })),
T.createElement("div", { className: Me().ChatMessageSteamStore_GameDetails }, T.createElement("div", { className: Me().ChatMessageSteamStore_GameNameAndIcon, onClick: g ? null : this.OpenStoreLink }, T.createElement("div", { className: Me().ChatMessageSteamStore_Name }, n)), T.createElement("div", null, (0, L.Xx)("#bbcode_steam_store_embed_From"), T.createElement("span", { style: { color: "#fffc" } }, `${a}`)), T.createElement("div", { style: { fontSize: 12 } }, (0, L.Xx)("#bbcode_steam_store_embed_ReleaseDate"), T.createElement("span", { style: { color: "#fffc" } }, `${c}`))),
),
T.createElement(
"div",
{ className: Me().ChatMessageSteamStore_Body },
T.createElement(
"div",
{ className: Me().ChatMessageSteamStore_DetailsContainer },
T.createElement(
"div",
{ className: Me().ChatMessageTweet_NameSection },
T.createElement("div", { className: Me().ChatMessageSteamStore_Description }, g ? E : o, " "),
T.createElement(
"div",
{ className: Me().ChatMessageSteamStore_Footer },
T.createElement("div", { className: Me().ChatMessageSteamStore_PricingContainer }, T.createElement("div", { className: Me().ChatMessageSteamStore_Pricing }, b && T.createElement("div", { className: Me().ChatMessageSteamStore_Pricing_Discount }, "-" + p + "%"), T.createElement("div", { className: Me().ChatMessageSteamStore_Pricing_FinalContainer }, b && u && T.createElement("div", { className: Me().ChatMessageSteamStore_Pricing_Initial }, `${u}`), i && T.createElement("div", { className: (0, ne.Z)(Me().ChatMessageSteamStore_Pricing_Final, b ? Me().hasDiscount : null) }, `${i}`)), d && !i && T.createElement("span", { className: Me().ChatMessageSteamStore_Free }, (0, L.Xx)("#bbcode_steam_store_embed_FreeToPlay"))), T.createElement("div", { className: Me().ChatMessageSteamStore_ViewStore, onClick: this.OpenStoreLink }, (0, L.Xx)(g ? "#bbcode_steam_store_embed_ViewStorePage_Filtered" : "#bbcode_steam_store_embed_ViewStorePage"))),
T.createElement("div", { className: Me().ChatMessageSteamStore_CopyURL, onClick: this.CopyToClipboard, title: (0, L.Xx)("#Chat_Copy_Link_Clipboard") }, T.createElement(B.h9, null)),
),
),
),
!g && T.createElement("div", { className: Me().ChatMessageSteamStore_MediaContainer }, T.createElement("div", { className: Me().ChatMessageSteamStore_MainMedia }, s && T.createElement("div", { className: (0, ne.Z)(Me().ChatMessageSteamStore_VideoThumbnail, y ? Me().videoPlaying : null), onClick: this.PlayVideoClicked }, I < 0 || null == I ? T.createElement(T.Fragment, null, T.createElement("img", { src: l }), T.createElement("div", { className: Me().ChatMessageSteamStore_VideoPlayButton }, T.createElement(B.shV, null))) : T.createElement("img", { src: `${m[I].path_thumbnail}`, style: { width: "100%" } })), !s && m && T.createElement("img", { src: `${m[Math.max(I, 0)].path_thumbnail}`, style: { width: "100%" } })), v && m && T.createElement("div", { className: Me().ChatMessageSteamStore_ThumbnailsContainer, onMouseLeave: this.OnThumbnailLeave }, f)),
T.createElement("div", { className: (0, ne.Z)(Me().ChatMessageSteamStore_VideoLargeContainer, y ? Me().videoPlaying : null), onClick: this.PlayVideoClicked }, y && T.createElement("video", { className: Me().ChatMessageSteamStore_VideoLarge, src: s, controls: !0, autoPlay: !0 }), T.createElement("div", { onClick: this.PlayVideoClicked }, T.createElement(B.pVO, null))),
),
);
}
};
(0, i.gn)([s.ak, (0, Ie.D)(100)], xt.prototype, "OnResize", null), (0, i.gn)([s.ak], xt.prototype, "ExtractGameData", null), (0, i.gn)([s.ak], xt.prototype, "OnFrameLoaded", null), (0, i.gn)([s.ak], xt.prototype, "OpenStoreLink", null), (0, i.gn)([s.ak], xt.prototype, "PlayVideoClicked", null), (0, i.gn)([s.ak], xt.prototype, "OnThumbnailOver", null), (0, i.gn)([s.ak], xt.prototype, "OnThumbnailLeave", null), (0, i.gn)([s.ak], xt.prototype, "CopyToClipboard", null), (xt = (0, i.gn)([k.Pi], xt));
let Nt = (Xe = class extends ce.fb {
constructor() {
super(...arguments), (this.state = { bDisabled: !1 });
}
OnReplayAnimation() {
const e = this.props.args.type;
this.props.context.chat.RoomEffectManager().ActivateRoomEffect(e);
const t = window.setTimeout(() => {
this.setState({ bDisabled: !1, iTimerID: void 0 });
}, Xe.k_iCooldownMs);
this.setState({ bDisabled: !0, iTimerID: t });
}
componentWillUnmount() {
this.state.iTimerID && window.clearTimeout(this.state.iTimerID);
}
render() {
const e = h.Ul.FriendStore.GetPlayer(this.props.context.unAccountIDSender),
t = this.props.args.type,
n = Re.F[t];
if (!n) return console.log("Attempt to render unknown room effect " + t), null;
const i = n.locToken;
return T.createElement("div", { className: Me().RoomEffectContainer }, T.createElement("span", { className: Me().RoomEffectIcon }, n.renderEffectIcon()), (0, L.kQ)(i, e.display_name), T.createElement("div", { style: { marginLeft: "auto", marginRight: "16px" } }, T.createElement(fe.KM, { disabled: this.state.bDisabled, style: { padding: "0px 8px" }, onClick: this.state.bDisabled ? void 0 : this.OnReplayAnimation }, (0, L.Xx)("#ChatRoom_ReplayRoomEffect"))));
}
});
(Nt.k_iCooldownMs = 5e3), (0, i.gn)([s.ak], Nt.prototype, "OnReplayAnimation", null), (Nt = Xe = (0, i.gn)([k.Pi], Nt));
class Pt extends ce.fb {
constructor() {
super(...arguments), (this.m_imageRef = T.createRef()), (this.state = { bIsHovered: !1 });
}
OnMouseOver() {
this.setState({ bIsHovered: !0 });
}
OnMouseOut() {
this.setState({ bIsHovered: !1 });
}
render() {
const e = this.GetArgument("type"),
t = (0, we.a)(o.De.COMMUNITY_CDN_URL, e);
return T.createElement("div", { style: { cursor: "pointer", position: "relative", width: "150px", height: "150px" }, onMouseOver: this.OnMouseOver, onMouseOut: this.OnMouseOut, onFocus: this.OnMouseOver, onBlur: this.OnMouseOut }, T.createElement("img", { ref: this.m_imageRef, style: { display: "block", zIndex: 1 }, src: t }), this.state.bIsHovered && T.createElement(Ut, { target: this.m_imageRef.current, sticker: e }));
}
}
function Ut(e) {
const { target: t, sticker: n } = e,
i = (function (e) {
const [t, n] = T.useState(null);
return (
T.useEffect(() => {
let t = !0;
return (
M()
.get(`${o.De.COMMUNITY_CDN_URL}economy/stickerjson/${encodeURIComponent(e)}?l=${encodeURIComponent(o.De.LANGUAGE)}&origin=${(0, o.Kc)()}`)
.then((e) => t && n(e.data))
.catch((e) => console.error(`Failed to load stickerJSON: ${e}`)),
() => {
t = !1;
}
);
}, [e]),
t
);
})(n);
if (!i) return null;
const { appid: r } = i;
return T.createElement(ve.Nr, { target: t, sticker: { appid: r, name: n } });
}
(0, i.gn)([s.ak], Pt.prototype, "OnMouseOver", null), (0, i.gn)([s.ak], Pt.prototype, "OnMouseOut", null);
var Vt = n(15152),
Ht = n(69807),
Wt = n(13106),
Xt = n(63036),
jt = n(37634),
zt = n(78654),
Kt = n(54054),
qt = n(77385);
const Zt = n.p + "javascript/webui/noisegate-audio-worklet.js?contenthash=ef007c9e0249549f997c",
Qt = new qt.sO("AudioPlaybackManager");
class $t {
constructor() {
(this.m_mapPlaybackObjs = new Map()), (this.m_bVoiceActive = !1), (this.m_hCloseContextTimeout = void 0), (this.m_voiceStore = void 0), (this.m_nLastObservedSampleRate = 0), (this.m_bSupportsAudioWorkletProcessors = !1), (this.m_MediaStreamDestination = void 0), (this.m_MediaStreamAudioElem = void 0), (0, y.rC)(this), ($t.sm_instance = this);
}
static Get() {
return $t.sm_instance;
}
get context() {
return this.m_Context;
}
get supports_audio_worklets() {
return this.m_bSupportsAudioWorkletProcessors;
}
SetVoiceStore(e) {
this.m_voiceStore = e;
}
GetActiveDestination() {
if ((this.CreateContextIfNeeded(), this.m_voiceStore && this.m_voiceStore.IsAnyVoiceActive() && "default" != this.m_voiceStore.GetSelectedOutputDevice())) {
if (null == this.m_MediaStreamDestination) {
let e = this.m_Context;
(this.m_MediaStreamDestination = e.createMediaStreamDestination()), (this.m_MediaStreamAudioElem = document.createElement("audio")), (this.m_MediaStreamAudioElem.srcObject = this.m_MediaStreamDestination.stream), this.m_MediaStreamAudioElem.play();
try {
this.m_MediaStreamAudioElem.setSinkId(this.m_voiceStore.GetSelectedOutputDevice());
} catch (e) {
Qt.Error("Failed setting audio output device to " + this.m_voiceStore.GetSelectedOutputDevice() + ": " + e);
}
}
return this.m_MediaStreamDestination;
}
return this.m_Context.destination;
}
PlayAudioURL(e, t = 1) {
return this.PlayAudioURLWithRepeats(e);
}
PlayAudioURLWithRepeats(e, t = 0) {
Qt.Debug("web audio playback requested: " + e), this.CreateContextIfNeeded();
let n = new Yt(this, e, t);
return this.m_mapPlaybackObjs.set(n, !0), n;
}
PlaybackFinished(e) {
this.m_mapPlaybackObjs.delete(e), this.CleanupContextIfUneeded(!1);
}
SetVoiceActive(e) {
(this.m_bVoiceActive = !0), this.CreateContextIfNeeded(e);
}
SetVoiceNotActive() {
(this.m_bVoiceActive = !1), this.CleanupContextIfUneeded(!0);
}
GetLastObservedSampleRate() {
return this.m_nLastObservedSampleRate;
}
CreateContextIfNeeded(e = void 0) {
if (null == this.m_Context) {
Qt.Debug("new context");
let t = window,
n = t.AudioContext || t.webkitAudioContext || !1;
(this.m_Context = new n()), (this.m_Context.onstatechange = this.OnAudioContextStateChange), Qt.Debug("sample rate " + this.m_Context.sampleRate), (this.m_nLastObservedSampleRate = this.m_Context.sampleRate);
let i = this.m_Context;
null != i.audioWorklet
? ((this.m_bSupportsAudioWorkletProcessors = !0),
i.audioWorklet
.addModule(Zt)
.then(() => {
Qt.Debug("noisegate-audio-worklet.js worklet processor loaded"), e && e();
})
.catch((t) => {
Qt.Error("Failed to load noisegate-audio-worklet.js worklet processor"), e && e();
}))
: e && e();
} else e && e();
}
DelayedCleanupContextIfInactive() {
(this.m_hCloseContextTimeout = void 0), 0 == this.m_mapPlaybackObjs.size && 0 == this.m_bVoiceActive && (Qt.Debug("close context"), null != this.m_MediaStreamAudioElem && (this.m_MediaStreamAudioElem.pause(), (this.m_MediaStreamAudioElem.src = void 0), (this.m_MediaStreamAudioElem.srcObject = void 0)), (this.m_MediaStreamAudioElem = void 0), (this.m_MediaStreamDestination = void 0), this.m_Context.close(), (this.m_Context = void 0));
}
CleanupContextIfUneeded(e) {
if (0 == this.m_mapPlaybackObjs.size && 0 == this.m_bVoiceActive) {
if ((null != this.m_hCloseContextTimeout && (clearTimeout(this.m_hCloseContextTimeout), (this.m_hCloseContextTimeout = void 0)), e)) return void this.DelayedCleanupContextIfInactive();
this.m_hCloseContextTimeout = SetBackgroundTimeout(this.DelayedCleanupContextIfInactive, 1e4);
}
}
OnAudioContextStateChange() {
null != this.m_Context && Qt.Debug("web audio context state changed: " + this.m_Context.state);
}
}
($t.sm_instance = null), (0, i.gn)([y.LO], $t.prototype, "m_nLastObservedSampleRate", void 0), (0, i.gn)([y.LO], $t.prototype, "m_bSupportsAudioWorkletProcessors", void 0), (0, i.gn)([s.ak], $t.prototype, "DelayedCleanupContextIfInactive", null), (0, i.gn)([y.aD.bound], $t.prototype, "OnAudioContextStateChange", null);
class Yt {
constructor(e, t, n) {
(this.m_Source = void 0),
(this.m_RepeatCount = 0),
(this.m_TimesPlayed = 0),
(this.m_Cancelled = !1),
(this.m_cbPlaybackFinished = null),
(0, y.rC)(this),
(this.m_Manager = e),
(this.m_URL = t),
(this.m_RepeatCount = n),
M()
.get(t, { responseType: "arraybuffer" })
.then((t) => {
e.context
.decodeAudioData(t.data)
.then((t) => {
if (this.m_Cancelled) this.NotifyPlaybackFinished();
else {
let n = e.context.createBufferSource();
(n.buffer = t), n.connect(e.GetActiveDestination()), n.start(0), (n.onended = this.OnPlaybackEnded), (this.m_Source = n);
}
})
.catch((e) => {
this.OnFailure();
});
})
.catch((e) => {
this.OnFailure();
});
}
StopPlayback() {
(this.m_Cancelled = !0), this.m_Source && (this.m_Source.stop(0), this.m_Source.disconnect(), (this.m_Source = void 0), this.NotifyPlaybackFinished());
}
get url() {
return this.m_URL;
}
OnFailure() {
SetBackgroundTimeout(() => this.m_Manager.PlaybackFinished(this), 1);
}
OnPlaybackEnded() {
if (((this.m_TimesPlayed += 1), !this.m_Cancelled && this.m_TimesPlayed <= this.m_RepeatCount)) {
let e = this.m_Manager.context.createBufferSource();
return (e.buffer = this.m_Source.buffer), e.connect(this.m_Manager.GetActiveDestination()), e.start(0), (e.onended = this.OnPlaybackEnded), this.m_Source.disconnect(), (this.m_Source = void 0), void (this.m_Source = e);
}
this.m_Source && (this.m_Source.disconnect(), (this.m_Source = void 0)), this.NotifyPlaybackFinished();
}
NotifyPlaybackFinished() {
this.m_cbPlaybackFinished && this.m_cbPlaybackFinished(), this.m_Manager.PlaybackFinished(this);
}
RegisterOnPlaybackFinished(e) {
this.m_cbPlaybackFinished = e;
}
}
(0, i.gn)([y.aD.bound], Yt.prototype, "OnFailure", null), (0, i.gn)([y.aD.bound], Yt.prototype, "OnPlaybackEnded", null);
var Jt = n(24110);
class en extends Jt.L {
GetString(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
try {
return yield SteamClient.Storage.GetString(e).then((t) => {
if (t) return t;
let n = localStorage.getItem(e);
return n && SteamClient.Storage.SetString(e, n), n;
});
} catch (e) {
return null;
}
});
}
StoreString(e, t) {
return SteamClient.Storage.SetString(e, t), Promise.resolve();
}
RemoveObject(e) {
return SteamClient.Storage.DeleteKey(e), Promise.resolve();
}
}
var tn = n(99627),
nn = n(82909),
on = (n(20646), n(82398), n(95967)),
rn = n(57476),
an = n(76135),
sn = n(33082);
function ln(e, t) {
let n = (0, X.RA)(t);
if (!n && e) {
let t = me.findDOMNode(e);
t && t.ownerDocument && (n = t.ownerDocument.defaultView);
}
return (0, v.X)(n, "Couldn't find owning window to determine browser context"), cn(n);
}
function cn(e) {
let t = sn.D;
return e && ((0, v.X)(e.__FriendsUIBrowserContext, "FriendsUI Browser context missing from owner window"), e.__FriendsUIBrowserContext && (t = e.__FriendsUIBrowserContext)), t;
}
function mn(e) {
let t = cn(e);
return t && t.m_unPID != sn.D.m_unPID && t.m_nBrowserID != sn.D.m_nBrowserID ? t : null;
}
var dn = n(37232);
class hn extends C.K3 {
constructor(e, t, n) {
super("InvisiblePopup", { title: "", bIgnoreSavedDimensions: !0, dimensions: { width: 1, height: 1, left: e, top: t }, eCreationFlags: C.eL.AlwaysOnTop | C.eL.NoTaskbarIcon | C.eL.NotFocusable | C.eL.OverrideRedirect }), (this.m_fnOnRender = n);
}
OnClose() {
this.m_reactRoot.unmount();
}
OnLoad() {}
OnResize() {}
Render(e, t) {
this.m_reactRoot = this.m_fnOnRender(e, t);
}
}
class un extends h.cX {
constructor(e) {
super(), (this.m_window = e);
}
BringToFront() {
null != this.m_window.SteamClient && null != this.m_window.SteamClient.Window && null != this.m_window.SteamClient.Window.BringToFront ? this.m_window.SteamClient.Window.BringToFront() : this.m_window.focus();
}
FlashWindow(e) {
null != this.m_window.SteamClient && null != this.m_window.SteamClient.Window && (e && null != this.m_window.SteamClient.Window.FlashWindow ? this.m_window.SteamClient.Window.FlashWindow() : null != this.m_window.SteamClient.Window.StopFlashWindow && this.m_window.SteamClient.Window.StopFlashWindow());
}
Close() {
this.m_window && this.m_window.close();
}
get title() {
return this.m_window.document.title;
}
set title(e) {
this.m_window.document.title = e;
}
BIsClosed() {
return this.m_window.closed;
}
BIsVisible() {
return "visible" == this.m_window.document.visibilityState;
}
BIsFocused() {
return this.m_window.document.hasFocus();
}
IsMinimized() {
return (0, rn.w3)(this.m_window, "Window.IsWindowMinimized") ? this.m_window.SteamClient.Window.IsWindowMinimized() : Promise.resolve(!1);
}
OnFocus(e) {
let t = () => {
e();
};
return (
this.m_window.addEventListener("focus", t),
{
unregister: () => {
this.m_window.removeEventListener("focus", t);
},
}
);
}
GetWindow() {
return this.m_window;
}
}
class pn extends h.i9 {
constructor(e) {
super(), (this.m_popup = e);
}
get container() {
return !this.m_container && this.m_popup.window && (this.m_container = new un(this.m_popup.window)), this.m_container;
}
Show(e) {
h.Ul.ParentalStore.BIsFriendsBlocked() || h.Ul.SettingsStore.IsSteamInTournamentMode() ? console.log("Blocked popup due to parental controls or tournament mode") : this.m_popup.Show(e);
}
Close() {
this.m_popup.Close();
}
GetWindowRestoreDetails() {
return this.m_popup.GetWindowRestoreDetails();
}
IsMinimized() {
return this.m_popup.IsMinimized();
}
GetBrowserContext() {
return this.m_popup.browser_info;
}
GetWindow() {
return this.m_popup.window;
}
}
const _n = { nChatRoomListHeightPx: 224, bChatRoomListCollapsed: !1, bDontShowVoiceAlert: !1, nFriendsListSingleWindowWidthPx: 300, bFavoritesHintDismissed: !1, bRemotePlayLinkHintDismissed: !1, nChangeLogDismissed: 0 },
gn = "UIDisplayPrefs";
class Cn {
constructor(e, t) {
(this.m_FriendHoverStore = new D.x5()),
(this.m_DragDropManager = new S()),
(this.m_OverlayStore = new w()),
(this.m_FocusNavController = new on.ZT()),
(this.m_mapFriendsListPopups = new y.vP()),
(this.m_UIDisplayPrefs = _n),
(this.m_bUpdatedBuildAvailable = !1),
(this.m_nSecondsOutOfDate = 0),
(this.m_strLoaderWindowRestoreDetails = void 0),
(this.m_bShowFriendsListOnLoadFromLoader = void 0),
(this.m_eUIMode = -1),
(this.m_setSteamClientListeners = new Set()),
(0, y.rC)(this),
(this.m_FriendsUIApp = e),
(this.m_bEmbeddedApp = t),
this.IsEmbeddedApp() ||
(this.RegisterListeners(),
In(window, sn.D),
this.InstrumentWindow(window),
C.AN.AddPopupCreatedCallback((e) => {
this.InstrumentWindow(e.window);
}));
}
RegisterListeners() {
"undefined" != typeof SteamClient && SteamClient.WebChat && SteamClient.WebChat.RegisterForFriendPostMessage ? (this.m_setSteamClientListeners.add(SteamClient.WebChat.RegisterForFriendPostMessage(this.HandlePostMessage)), window.addEventListener("message", this.HandleWebLoaderPostMessage)) : ((0, v.X)(!o.De.IN_CLIENT, "Config.IN_CLIENT set but SteamClient globals not available"), window.addEventListener("message", this.HandlePostMessage)),
(0, rn.U5)("Messaging.RegisterForMessages") && (this.m_setSteamClientListeners.add(SteamClient.Messaging.RegisterForMessages("LibraryCommands", this.HandleLibraryCommandMessage)), this.m_setSteamClientListeners.add(SteamClient.Messaging.RegisterForMessages("ContextMenus", this.HandleContextMenuMessage)), this.m_setSteamClientListeners.add(SteamClient.Messaging.RegisterForMessages("PersonaState", this.HandlePersonaStateMessage))),
(0, rn.U5)("WebChat.RegisterForUIModeChange") && this.m_setSteamClientListeners.add(SteamClient.WebChat.RegisterForUIModeChange(this.HandleUIModeChange));
}
RemoveListeners() {
this.m_setSteamClientListeners.forEach((e) => e.unregister()), this.m_setSteamClientListeners.clear();
}
IsGamepadUIActive() {
return 4 == this.m_eUIMode;
}
IsDesktopUIActive() {
return 7 == this.m_eUIMode;
}
IsEmbeddedApp() {
return this.m_bEmbeddedApp;
}
OverlayStore() {
return this.m_OverlayStore;
}
FriendGroupStore() {
return this.m_FriendsUIApp.FriendStore.FriendGroupStore;
}
ChatStore() {
return this.m_FriendsUIApp.ChatStore;
}
UIStore() {
return this.m_FriendsUIApp.UIStore;
}
FocusNavController() {
return this.m_FocusNavController;
}
BNeedsUpdate() {
return this.m_bUpdatedBuildAvailable;
}
GetSecondsOutOfDate() {
return this.m_nSecondsOutOfDate;
}
GetFriendsListPopup(e) {
var t;
return null !== (t = this.m_mapFriendsListPopups.get(e.m_unPID)) && void 0 !== t ? t : null;
}
SetVisibilityForDesktopUIOverlay(e, t) {
const n = this.GetFriendsListPopup(e);
t ? (n ? n.window.SteamClient.Window.ShowWindow() : this.ShowPopupFriendsList(e)) : n && n.window.SteamClient.Window.HideWindow();
}
SetChatWindowsVisibilityForDesktopUIOverlay(e, t) {
let n = this.m_FriendsUIApp.UIStore.GetPerContextChatData(e);
for (let e of Array.from(n.popup_list)) {
let n = e.popup.GetWindow();
t ? n.SteamClient.Window.ShowWindow() : n.SteamClient.Window.HideWindow();
}
}
InstrumentWindow(e) {
this.m_FriendsUIApp.IdleTracker.AddTrackedWindow(e);
}
HandlePostMessage(e) {
let t = e.data;
if (!t || !t.command) return;
let n = this.m_FriendsUIApp.GetDefaultBrowserContext();
void 0 !== e.data.pid && (n = { m_unPID: e.data.pid, m_nBrowserID: e.data.browserid, m_eUIMode: this.m_eUIMode }), this.ExecuteCommand(n, e.data);
}
HandleUIModeChange(e) {
this.m_eUIMode = e;
}
SetShouldChangePersonaStatusOnDisconnect(e) {
this.m_FriendsUIApp.CMInterface.SetShouldChangePersonaStatusOnDisconnect(e);
}
HandleLibraryCommandMessage(e, t, n) {
let i = this.m_FriendsUIApp.GetDefaultBrowserContext(),
o = JSON.parse(n);
(o.command = t), this.ExecuteCommand(i, o);
}
OnCloseFakeContextMenu(e) {
SteamClient.Messaging.PostMessage("ContextMenus", "OnFriendContextMenuClosed", ""), (this.m_LibraryFriendContextMenu = void 0);
}
HandleContextMenuMessage(e, t, n) {
if ("ShowFriendContextMenu" == t) {
let e = JSON.parse(n),
t = new ue.K(e.steamid);
if (t.GetAccountID() == this.m_FriendsUIApp.FriendStore.self.steamid.GetAccountID()) return void this.OnCloseFakeContextMenu(e.steamid);
let i = new hn(e.x, e.y, (n, o) => {
const r = jt.s(o);
r.render(T.createElement(C.Rt, { ownerWindow: n, children: [T.createElement(an.Y0, { browserInfo: sn.D, children: null })] }));
let a = h.Ul.FriendStore.GetFriend(t.GetAccountID());
return a
? ((this.m_LibraryFriendContextMenu = (0, nn.Xh)((0, Wt.wd)(this.m_FriendsUIApp.GetDefaultBrowserContext(), { chatContext: "friendslist" }, a, n), o, e.x, e.y)),
this.m_LibraryFriendContextMenu.SetOnHideCallback(() => {
this.OnCloseFakeContextMenu(e.steamid), i.Close();
}),
SteamClient.Messaging.PostMessage("ContextMenus", "OnFriendContextMenuShown", ""),
r)
: (this.OnCloseFakeContextMenu(e.steamid), r);
});
i.Show();
} else "CloseFriendContextMenu" == t && this.m_LibraryFriendContextMenu && this.m_LibraryFriendContextMenu.Hide();
}
SendPersonaUpdateToLibrary(e) {
(0, rn.U5)("Messaging.PostMessage") && SteamClient.Messaging.PostMessage("PersonaState", "PersonaUpdate", JSON.stringify(e));
}
HandlePersonaStateMessage(e, t, n) {
var i;
"RequestPersonaState" == t && (null === (i = null === h.Ul || void 0 === h.Ul ? void 0 : h.Ul.FriendStore) || void 0 === i ? void 0 : i.self) && this.SendPersonaUpdateToLibrary(h.Ul.FriendStore.self.persona.m_ePersonaState);
}
PerformFriendsUIUpdate() {
let e = this.m_FriendsUIApp.UIStore.SerializePopupStateToObject(!0);
window.parent.postMessage({ message: "ChatReloadRequest", state: e }, "https://steamloopback.host");
}
HandleWebLoaderPostMessage(e) {
null != e.data.message &&
("UpdatedBuildAvailable" == e.data.message
? (console.log("There is an updated friendsui build available, we are " + (e.data.bVeryOutOfDate ? "" : "NOT ") + "very out of date. We are " + (e.data.bForce ? "" : "NOT ") + "forcing an update."), (this.m_bUpdatedBuildAvailable = !0), void 0 !== e.data.nSecondsOutOfDate && (this.m_nSecondsOutOfDate = e.data.nSecondsOutOfDate), (this.m_FriendsUIApp.IdleTracker.GetUserIdleTime() > 7200 || (void 0 !== e.data.bForce && 1 == e.data.bForce)) && this.PerformFriendsUIUpdate())
: "ReloadSerializedChatState" == e.data.message && void 0 !== e.data.state
? (console.log("Asked by loader to reload serialized chat state"), this.m_FriendsUIApp.UIStore.SetStateToRestoreFrom(e.data.state))
: "LoaderWindowRestoreDetails" == e.data.message
? ((this.m_bShowFriendsListOnLoadFromLoader = e.data.bVisible), (this.m_strLoaderWindowRestoreDetails = e.data.data))
: "SetPersonaState" == e.data.message && this.SetUserPersonaStateWhenReady(e.data.persona_state));
}
SetUserPersonaStateWhenReady(e) {
this.m_FriendsUIApp.FriendStore.SetUserPersonaState(e);
}
ExecuteCommand(e, t) {
switch (t.command) {
case "ShowPopupFriendsList":
this.ShowPopupFriendsList(e, !1, !0);
break;
case "ShowFriendChatDialog":
{
let n = new ue.K(t.steamid),
i = 0 != t.btakefocus;
n.BIsValid() ? (n.BIsIndividualAccount() ? this.m_FriendsUIApp.UIStore.ShowFriendChatDialogWhenReady(e, n.GetAccountID(), !0, i) : n.BIsClanAccount() && this.m_FriendsUIApp.FriendStore.ClanStore.JoinClanChatRoom(e, n)) : this.ShowChatUnreadMessages(e);
}
break;
case "CloseChatDialog":
{
let e = new ue.K(t.steamid);
if (e.BIsIndividualAccount()) {
let t = this.m_FriendsUIApp.ChatStore.GetFriendChat(e.GetAccountID(), !1);
t && this.m_FriendsUIApp.UIStore.CloseTabByID(t.unique_id);
} else if (e.BIsClanAccount()) {
let t = this.m_FriendsUIApp.FriendStore.ClanStore.GetClan(e);
if (t && t.GetChatGroupIDIfLoaded()) {
let e = this.m_FriendsUIApp.ChatStore.GetChatRoomGroup(t.GetChatGroupIDIfLoaded());
e && this.m_FriendsUIApp.UIStore.CloseTabByID(e.unique_id);
}
}
}
break;
case "ShowChatRoomGroupDialog":
{
let n = t.chat_group_id,
i = t.chat_room_id;
this.ShowChatRoomGroupDialog(e, n, i);
}
break;
case "ShowChatRoomGroupInvite":
if (this.m_FriendsUIApp.ready_to_render) {
let n = t.invite_code,
i = this.m_FriendsUIApp.ChatStore.InviteStore.GetInviteFromCode(n);
$({ invite: i, inviter: null }, e, window);
}
break;
case "SetPersonaState":
this.m_FriendsUIApp.FriendStore.SetUserPersonaState(t.persona_state);
break;
case "ShowWatchBroadcast":
let n = new ue.K(t.steamid);
this.m_FriendsUIApp.UIStore.ShowOrActivateBroadcast(e, n.GetAccountID(), !0).ShowWatchPromptDialog();
break;
case "ToggleDockedMode":
this.ToggleSingleWindowMode(t.checked);
}
}
Init(e, t, n) {
let i = [];
return (
i.push([
"Load Preferences",
() =>
this.m_FriendsUIApp.SettingsStore.GetObjectFromLocalStorageWhenReady(gn, _n).then((e) => {
(0, y.z)(() => {
this.m_UIDisplayPrefs = e;
});
}),
]),
e.RunWhenLoggedOn(() => {
C.AN.SetCurrentLoggedInAccountID(e.steamid.GetAccountID());
}),
(this.m_WebLogonManager = n),
(this.m_UsabilityMetricsStore = new E(this.FillInChatUsabilityMetrics.bind(this), e)),
t && this.m_OverlayStore.Init(e),
window.addEventListener(
"dragover",
(e) => {
e.preventDefault();
},
!1,
),
window.addEventListener(
"dragenter",
(e) => {
e.preventDefault();
},
!1,
),
window.addEventListener(
"drop",
(e) => {
e.preventDefault();
},
!1,
),
o.De.IN_CLIENT &&
!this.m_FriendsUIApp.IsLoadedInClientSharedJSContext() &&
void 0 !== SteamClient.FriendSettings.GetEnabledFeatures &&
i.push([
"SteamClient.FriendSettings.GetEnabledFeatures",
() =>
SteamClient.FriendSettings.GetEnabledFeatures().then((e) => {
let t = !1;
for (let n of e)
if ("LoaderWindowSynchronization" == n.feature) {
t = n.bEnabled;
break;
}
return t ? (0, y.gx)(() => void 0 !== this.m_strLoaderWindowRestoreDetails) : Promise.resolve();
}),
]),
t || i.push(["GRS", () => (0, dn.Vj)(void 0)]),
i
);
}
get FriendHoverStore() {
return this.m_FriendHoverStore;
}
get WebLogonManager() {
return this.m_WebLogonManager;
}
get DragDropManager() {
return this.m_DragDropManager;
}
get UIDisplayPrefs() {
return this.m_UIDisplayPrefs;
}
SetUIDisplayPref(e, t) {
this.m_UIDisplayPrefs[e] != t &&
((this.m_UIDisplayPrefs[e] = t),
this.m_iTimeoutSaveUIDisplayPrefs && window.clearTimeout(this.m_iTimeoutSaveUIDisplayPrefs),
(this.m_iTimeoutSaveUIDisplayPrefs = window.setTimeout(() => {
this.m_FriendsUIApp && this.m_FriendsUIApp.SettingsStore && this.m_FriendsUIApp.SettingsStore.StoreObjectInLocalStorage(gn, this.m_UIDisplayPrefs), (this.m_iTimeoutSaveUIDisplayPrefs = void 0);
}, 1e3)));
}
ShowPopupFriendsList(e, t, n, i) {
if (this.m_FriendsUIApp.ParentalStore.BIsFriendsBlocked() || this.m_FriendsUIApp.SettingsStore.IsSteamInTournamentMode()) return void console.log("Blocked friends list popup due to parental controls or tournament mode");
const o = !t && n ? zt.IF.k_EWindowBringToFrontAndForceOS : zt.IF.k_EWindowBringToFrontInvalid;
let r = this.m_mapFriendsListPopups.get(e.m_unPID);
if (r) return void r.Focus(o);
if (this.m_FriendsUIApp.UIStore.BIsFriendsListEmbedded(e)) return;
(r = new Xt.wV(this.m_FriendsUIApp.FriendStore, this.m_FriendsUIApp.ChatStore, e, t, i)), this.m_mapFriendsListPopups.set(e.m_unPID, r), r.Show(o);
let a = new pn(r);
this.m_FriendsUIApp.UIStore.GetPerContextChatData(e).SetFriendsListWindow(a.container), this.m_FriendsUIApp.UIStore.SerializePopupState();
}
ShowChatRoomGroupDialog(e, t, n) {
let i = this.m_FriendsUIApp.ChatStore.GetChatRoomGroup(t),
o = i && n ? i.GetChatRoom(n) : null;
if (!i || !i.BIsCurrentUserAMember() || (o && o.BVoiceActive())) {
let i = this.m_FriendsUIApp.ChatStore.InviteStore.GetDirectInviteInfo(t, n, this.m_FriendsUIApp.FriendStore.self.accountid);
$({ invite: i, inviter: null }, e, window);
} else o ? this.m_FriendsUIApp.UIStore.ShowAndOrActivateChat(e, o, !0) : this.m_FriendsUIApp.UIStore.ShowAndOrActivateChatRoomGroupWhenReady(e, i, !0);
}
OnFriendsListClosed(e) {
this.m_mapFriendsListPopups.delete(e.m_unPID), this.m_FriendsUIApp.UIStore.GetPerContextChatData(e).SetFriendsListWindow(void 0), this.m_FriendsUIApp.UIStore.SerializePopupState();
}
ToggleSingleWindowMode(e) {
if (h.Ul.SettingsStore.BSingleWindowModeEnabled() != e) {
h.Ul.SettingsStore.SetSingleWindowMode(e);
for (let t of this.m_FriendsUIApp.UIStore.GetAllBrowserContexts()) this.ToggleSingleWindowModeForContext(e, t);
}
}
ToggleSingleWindowModeForContext(e, t) {
const n = this.m_FriendsUIApp.UIStore.GetPerContextChatData(t);
if (n.IsFriendsListSingleWindow() != e && (n.SetFriendsListSingleWindowMode(e), n.IsFriendsListSingleWindow() == e))
if (e) {
this.m_FriendsUIApp.UIStore.ConvertDefaultTabSetToEmbedded(t), this.m_FriendsUIApp.UIStore.MergeTabSets(t);
const e = n.friends_list_window;
if (e) {
if (e instanceof un) {
const t = e.GetWindow();
t.SteamClient.Window.SetMinSize && t.SteamClient.Window.SetMinSize(Xt.o2, Xt.wE), t.SteamClient.Window.ResizeTo(1280, t.innerHeight, !1);
}
} else this.ShowPopupFriendsList(t, !1, !0, { width: 1280 });
} else {
this.m_FriendsUIApp.UIStore.ConvertDefaultTabSetToPopup(t);
const e = n.friends_list_window;
if (e) {
if (e instanceof un) {
const t = e.GetWindow();
t.SteamClient.Window.SetMinSize && t.SteamClient.Window.SetMinSize(Xt.Cs, Xt.wE), t.SteamClient.Window.ResizeTo(yn.UIDisplayPrefs.nFriendsListSingleWindowWidthPx, t.innerHeight, !1);
}
} else {
const e = yn.UIDisplayPrefs.nFriendsListSingleWindowWidthPx;
this.ShowPopupFriendsList(t, !1, !0, { width: e });
}
}
}
FillInChatUsabilityMetrics(e) {
e.ui_state().set_friends_list_group_chats_height(this.UIDisplayPrefs.nChatRoomListHeightPx);
let t,
n = this.m_FriendsUIApp.UIStore.GetPerContextChatData(sn.D),
i = n.friends_list_window;
i && i instanceof un && (e.ui_state().set_friends_list_width(i.GetWindow().outerWidth), e.ui_state().set_friends_list_height(i.GetWindow().outerHeight));
for (let e of Array.from(n.popup_list)) if (((t = e), e.tab_set === n.default_tabset && !n.IsFriendsListSingleWindow())) break;
t && t.popup.GetWindow() && (e.ui_state().set_friends_list_width(t.popup.GetWindow().outerWidth), e.ui_state().set_friends_list_height(t.popup.GetWindow().outerHeight));
}
ShowChatUnreadMessages(e) {
if (this.m_FriendsUIApp.ParentalStore.BIsFriendsBlocked() || this.m_FriendsUIApp.SettingsStore.IsSteamInTournamentMode) return void console.log("Blocked friends list popup due to parental controls or tournament mode");
let t = this.m_FriendsUIApp.ChatStore.GetChatToActivateForOldestUnread(e);
return t ? (console.log("ShowChatUnreadMessages - showing chat " + t.unique_id), void this.m_FriendsUIApp.UIStore.ShowAndOrActivateChat(e, t, !0)) : this.ShowPopupFriendsList(e, !1, !0);
}
CreateRemotePlayDialogs(e, t, n) {
if (4 == this.m_eUIMode) return;
let i = null;
n && (i = h.Ul.RemotePlayStore.dialog_context), i || (i = h.Ul.UIStore.GetAllBrowserContexts().find((e) => !(0, sn.n)(e, sn.D))), i || (i = sn.D), (0, Ht.Q$)(i, e, this.m_eUIMode, t, n);
}
}
(0, i.gn)([y.LO], Cn.prototype, "m_UIDisplayPrefs", void 0),
(0, i.gn)([y.LO], Cn.prototype, "m_bUpdatedBuildAvailable", void 0),
(0, i.gn)([y.LO], Cn.prototype, "m_nSecondsOutOfDate", void 0),
(0, i.gn)([y.LO], Cn.prototype, "m_strLoaderWindowRestoreDetails", void 0),
(0, i.gn)([y.LO], Cn.prototype, "m_bShowFriendsListOnLoadFromLoader", void 0),
(0, i.gn)([y.LO], Cn.prototype, "m_eUIMode", void 0),
(0, i.gn)([s.ak], Cn.prototype, "HandlePostMessage", null),
(0, i.gn)([s.ak], Cn.prototype, "HandleUIModeChange", null),
(0, i.gn)([s.ak], Cn.prototype, "HandleLibraryCommandMessage", null),
(0, i.gn)([s.ak], Cn.prototype, "OnCloseFakeContextMenu", null),
(0, i.gn)([s.ak], Cn.prototype, "HandleContextMenuMessage", null),
(0, i.gn)([s.ak], Cn.prototype, "HandlePersonaStateMessage", null),
(0, i.gn)([s.ak], Cn.prototype, "HandleWebLoaderPostMessage", null),
(0, i.gn)([h.IN], Cn.prototype, "SetUserPersonaStateWhenReady", null),
(0, i.gn)([y.Fl], Cn.prototype, "UIDisplayPrefs", null),
(0, i.gn)([y.aD], Cn.prototype, "SetUIDisplayPref", null),
(0, i.gn)([h.IN], Cn.prototype, "ShowPopupFriendsList", null),
(0, i.gn)([h.IN], Cn.prototype, "ShowChatUnreadMessages", null);
class fn extends h.wZ {
constructor(e) {
super(o.De.IN_CLIENT && void 0 !== SteamClient.Storage ? new en() : new tn.Z()),
(this.m_AudioPlaybackManager = new $t()),
(this.m_bLoadedInClientSharedJSContext = e),
e && this.VoiceStore.RegisterForVoiceChatActiveStateChange(this.OnVoiceChatActiveStateChange),
(this.m_IdleTracker = o.De.IN_CLIENT ? new m() : new c()),
(this.m_DesktopApp = ((yn = new Cn(this, !1)), yn)),
(this.m_ChatRoomBBCodeParser = new ce.AZ(Object.assign(qe(), { mention: Ot }), ce.So)),
(this.m_FriendChatBBCodeParser = new ce.AZ(Object.assign(qe(), { invite: yt, gameinvite: Et, lobbyinvite: Dt, tradeoffer: kt, broadcastinvite: wt, broadcastviewrequest: Rt }), ce.So)),
(this.m_NotificationBBCodeParser = new ce.YO({ gameinvite: Le, lobbyinvite: Ge, invite: Oe, tradeoffer: Fe, spoiler: Be, roomeffect: xe, sticker: Ne })),
(this.m_ChatRoomEffectSettings = Re.F),
(yn = this.m_DesktopApp),
this.m_AudioPlaybackManager.SetVoiceStore(this.m_VoiceChatStore),
(0, v.X)(!o.De.IN_MOBILE, "DesktopApp initialized in mobile context");
}
Init(e, t, n) {
let i = t ? new p(this.m_FriendStore) : new _(this.m_FriendStore),
o = this.m_DesktopApp.Init(e, t, n);
super.InitInternal(e, i, o);
}
OnReadyToRender() {
return (0, i.mG)(this, void 0, void 0, function* () {
o.De.IN_CLIENT && ((0, rn.U5)("RemotePlay.RegisterForRemoteClientStarted") && SteamClient.RemotePlay.RegisterForRemoteClientStarted(this.RemoteClientStarted), (0, rn.U5)("RemotePlay.RegisterForInviteResult") ? SteamClient.RemotePlay.RegisterForInviteResult(this.RemoteClientInviteResult) : (0, rn.U5)("RemotePlay.RegisterForRemoteClientLaunchResult") && SteamClient.RemotePlay.RegisterForRemoteClientLaunchResult(this.RemoteClientLaunchResult), (0, rn.U5)("RemotePlay.RegisterForRemoteClientLaunchFailed") && SteamClient.RemotePlay.RegisterForRemoteClientLaunchFailed(this.RemoteClientLaunchFailed), (0, rn.U5)("RemotePlay.RegisterForGroupCreated") && SteamClient.RemotePlay.RegisterForGroupCreated(this.RemotePlayGroupCreated)), yield this.UIStore.RestorePopupState();
let e = C.AN.GetRestoreDetails("PopupFriendsListDimensions");
e && window.parent.postMessage({ message: "FriendsListRestoreDetailsChanged", data: e }, "https://steamloopback.host");
try {
let e = window.sessionStorage.getItem(fn.k_pchStartupParamKey);
if (e) {
let t = JSON.parse(e);
t && t.command && this.m_DesktopApp.ExecuteCommand(sn.D, t.command);
}
window.sessionStorage.removeItem(fn.k_pchStartupParamKey);
} catch (e) {}
if ((this.m_IdleTracker.Init(), window.opener)) {
let e = [o.De.COMMUNITY_BASE_URL, o.De.STORE_BASE_URL, o.De.CHAT_BASE_URL];
for (let t of e) window.opener.postMessage("FriendsUIReady", t.replace(/\/$/, ""));
}
});
}
IsGamepadUIActive() {
return this.m_DesktopApp.IsGamepadUIActive();
}
IsDesktopUIActive() {
return this.m_DesktopApp.IsDesktopUIActive();
}
IsLoadedInClientSharedJSContext() {
return this.m_bLoadedInClientSharedJSContext;
}
get AudioPlaybackManager() {
return this.m_AudioPlaybackManager;
}
get IdleTracker() {
return this.m_IdleTracker;
}
AddPopupManagerShutdownCallback(e) {
C.AN.AddShutdownCallback(e);
}
CreateChatPopup(e, t, n, i, o, r) {
let a = new Xt.a1(e, t, n, this.m_ChatStore, i, o, r),
s = new pn(a);
return new R.r0(s, a);
}
ShowPopupFriendsListAtStartup(e) {
let t = e;
if ((void 0 !== yn.m_bShowFriendsListOnLoadFromLoader && (t = yn.m_bShowFriendsListOnLoadFromLoader), this.ChatStore.FriendChatStore.GetUnreadFriendMessageCount() > 0 && this.SettingsStore.FriendsSettings.bSignIntoFriends && (t = !0), t)) {
let e = !0 === yn.m_bShowFriendsListOnLoadFromLoader;
(0, sn.n)(h.Ul.GetDefaultBrowserContext(), sn.D) || (console.log("Blocked taking focus in root context during ShowPopupFriendsList, because other context is primary"), (e = !1)), h.Ul.ShowPopupFriendsList(sn.D, !1, e);
}
}
ShowPopupFriendsList(e, t, n) {
this.m_DesktopApp.ShowPopupFriendsList(e, t, n);
}
OnFriendsListClosed(e) {
this.m_DesktopApp.OnFriendsListClosed(e);
}
RemotePlayGroupCreated(e, t) {
let n = new ue.K(e).GetAccountID();
if (0 == n) return;
let i = h.Ul.FriendStore.GetPlayer(n);
const o = e === h.Ul.FriendStore.self.steamid64;
h.Ul.RemotePlayStore.OnGroupCreated(i, o, t), o && this.m_DesktopApp.CreateRemotePlayDialogs(i, window, o);
}
RemoteClientStarted(e, t) {
let n = new ue.K(e).GetAccountID();
if (0 == n) return;
if (n == h.Ul.FriendStore.self.accountid) return;
let i = h.Ul.FriendStore.GetPlayer(n);
h.Ul.RemotePlayStore.RemoteClientStarted(i, !1, t);
const o = h.Ul.UIStore.RegisterForOverlayCreated(() => {
o(), this.m_DesktopApp.CreateRemotePlayDialogs(i, window, !1);
});
setTimeout(() => {
o(), this.m_DesktopApp.CreateRemotePlayDialogs(i, window, !1);
}, 3e3);
}
RemoteClientInviteResult(e, t, n, i, o) {
this.RemoteClientLaunchResult(e, t, n, i, o);
}
RemoteClientLaunchResult(e, t, n, i, o) {
let r = new ue.K(e).GetAccountID(),
a = h.Ul.FriendStore.GetPlayer(r);
if (n === Kt.u.k_ERemoteClientLaunchOK) {
if (0 !== r) {
let e = 2 == a.efriendrelationship,
t = 4 == a.efriendrelationship,
n = a.persona.is_online && !e && !t && !a.is_blocked;
(n = !1), !h.Ul.VoiceStore.IsAnyVoiceActive() && n && i ? h.Ul.UIStore.ShowFriendChatDialogAndStartVoice(h.Ul.GetDefaultBrowserContext(), a.accountid) : h.Ul.UIStore.ShowFriendChatDialog(h.Ul.GetDefaultBrowserContext(), a.accountid, !0, !1);
}
this.m_DesktopApp.CreateRemotePlayDialogs(h.Ul.FriendStore.self, window, !0);
} else {
let e = "";
switch (n) {
case Kt.u.k_ERemoteClientLaunchParentalUnlockFailed:
e = "#RemotePlay_ErrorInviteFailed_ParentalUnlockFailed";
break;
case Kt.u.k_ERemoteClientLaunchScreenLocked:
e = "#RemotePlay_ErrorInviteFailed_ScreenLocked";
break;
case Kt.u.k_ERemoteClientLaunchDriversNotInstalled:
e = "#RemotePlay_ErrorInviteFailed_DriversNotInstalled";
break;
case Kt.u.k_ERemoteClientLaunchDisabledRemote:
e = "#RemotePlay_ErrorInviteFailed_Disabled";
break;
case Kt.u.k_ERemoteClientLaunchBroadcasting:
e = "#RemotePlay_ErrorInviteFailed_BroadcastingActive";
break;
case Kt.u.k_ERemoteClientLaunchTransportUnavailable:
e = "#RemotePlay_ErrorInviteFailed_TransportUnavailable";
break;
case Kt.u.k_ERemoteClientLaunchInvisible:
e = "#RemotePlay_ErrorInviteFailed_Invisible";
break;
case Kt.u.k_ERemoteClientLaunchRestrictedCountry:
e = "#RemotePlay_ErrorInviteFailed_RestrictedCountry";
break;
default:
e = "#RemotePlay_ErrorInviteFailed_Failed";
}
this.ShowAlert((0, L.Xx)("#RemotePlay_Error"), (0, L.Xx)(e));
}
}
RemoteClientLaunchFailed(e) {
if (e === Kt.u.k_ERemoteClientLaunchOK);
else {
let t = "";
switch (e) {
case Kt.u.k_ERemoteClientLaunchParentalUnlockFailed:
t = "#RemotePlay_ErrorInviteFailed_ParentalUnlockFailed";
break;
case Kt.u.k_ERemoteClientLaunchScreenLocked:
t = "#RemotePlay_ErrorInviteFailed_ScreenLocked";
break;
case Kt.u.k_ERemoteClientLaunchDriversNotInstalled:
t = "#RemotePlay_ErrorInviteFailed_DriversNotInstalled";
break;
case Kt.u.k_ERemoteClientLaunchDisabledRemote:
t = "#RemotePlay_ErrorInviteFailed_Disabled";
break;
case Kt.u.k_ERemoteClientLaunchBroadcasting:
t = "#RemotePlay_ErrorInviteFailed_BroadcastingActive";
break;
case Kt.u.k_ERemoteClientLaunchTransportUnavailable:
t = "#RemotePlay_ErrorInviteFailed_TransportUnavailable";
break;
case Kt.u.k_ERemoteClientLaunchInvisible:
t = "#RemotePlay_ErrorInviteFailed_Invisible";
break;
case Kt.u.k_ERemoteClientLaunchRestrictedCountry:
t = "#RemotePlay_ErrorInviteFailed_RestrictedCountry";
break;
default:
t = "#RemotePlay_ErrorInviteFailed_Failed";
}
this.ShowAlert((0, L.Xx)("#RemotePlay_Error"), (0, L.Xx)(t));
}
}
ShowAlert(e, t, n) {
return (0, K.kQ)(e, t, n);
}
OpenURLInBrowser(e, t) {
o.De.IN_CLIENT ? SteamClient.WebChat.OpenURLInClient(e, t.m_unPID, !1) : (0, G.b8)(window, e);
}
BIsValidBrowserContext(e) {
return super.BIsValidBrowserContext(e) || this.m_DesktopApp.OverlayStore().HasOverlayInstance(e.m_unPID);
}
ShowCloseActiveVoiceConfirmation(e, t) {
if (!this.m_DesktopApp.UIDisplayPrefs.bDontShowVoiceAlert) {
let e = t.popup;
(0, Vt.Ez)(e.GetWindow());
}
}
OnVoiceChatActiveStateChange(e) {
(0, rn.U5)("Browser.SetBackgroundThrottlingDisabled") && SteamClient.Browser.SetBackgroundThrottlingDisabled(e);
}
SignOutOfFriends(e) {
var t, n;
if (null === (n = (t = this.m_CMInterface).GetShouldChangePersonaStatusOnDisconnect) || void 0 === n ? void 0 : n.call(t)) {
this.m_DesktopApp.SendPersonaUpdateToLibrary(0);
let t = h.Ul.UIStore.GetRootChatPerContextData().friends_list_window && h.Ul.UIStore.GetRootChatPerContextData().friends_list_window.BIsVisible();
window.parent.postMessage({ message: "SignOutRequest", bShowLoaderWindow: t, browserContext: e }, "https://steamloopback.host");
}
this.UIStore.SerializePopupState(), this.UIStore.ResetHasRestoredPopupState();
for (const e of C.AN.GetPopups()) e.GetName().startsWith("chat_") && e.Close();
this.CMInterface.ForceDisconnect();
}
UpdatePersonaState(e) {
this.m_DesktopApp.SendPersonaUpdateToLibrary(e);
}
CreateNewTabFromUniqueID(e, t, n, i) {
let o = t.match(/^br(\d+)$/);
if (o && o[1]) {
let t = parseInt(o[1]);
return new g.v(e, t);
}
return super.CreateNewTabFromUniqueID(e, t, n, i);
}
BShowIncomingChatMessages() {
return !!this.IsLoadedInClientSharedJSContext() || 0 == this.m_DesktopApp.m_eUIMode;
}
StopListening() {
this.m_DesktopApp.RemoveListeners();
const e = this.m_CMInterface.GetShouldChangePersonaStatusOnDisconnect();
this.m_DesktopApp.SetShouldChangePersonaStatusOnDisconnect(!1), this.SignOutOfFriends(void 0), this.m_DesktopApp.SetShouldChangePersonaStatusOnDisconnect(e);
}
Reconnect() {
return (0, i.mG)(this, void 0, void 0, function* () {
this.m_DesktopApp.RemoveListeners(), this.m_DesktopApp.RegisterListeners(), yield Promise.all([this.CMInterface.Connect(), this.UIStore.RestorePopupState()]);
});
}
GetDefaultBrowserContext() {
const e = this.m_BrowserContextDefaultTarget;
return void 0 === e.m_eUIMode || -1 === e.m_eUIMode ? Object.assign(Object.assign({}, e), { m_eUIMode: this.m_DesktopApp.m_eUIMode }) : e;
}
}
(fn.k_pchStartupParamKey = "oFriendsUIStartupParam"), (0, i.gn)([s.ak], fn.prototype, "RemotePlayGroupCreated", null), (0, i.gn)([s.ak], fn.prototype, "RemoteClientStarted", null), (0, i.gn)([s.ak], fn.prototype, "RemoteClientInviteResult", null), (0, i.gn)([s.ak], fn.prototype, "RemoteClientLaunchResult", null), (0, i.gn)([s.ak], fn.prototype, "RemoteClientLaunchFailed", null), (0, i.gn)([s.ak], fn.prototype, "OnVoiceChatActiveStateChange", null);
function vn() {
return (yn = new Cn(new fn(!1), !1)), yn;
}
function Sn(e) {
const t = fn.k_pchStartupParamKey;
window.sessionStorage.setItem(t, JSON.stringify({ command: { command: "ShowWatchBroadcast", steamid: e } }));
}
function bn(e) {
const t = (0, T.useState)(0)[1];
return [
yn.UIDisplayPrefs[e],
(n) => {
yn.SetUIDisplayPref(e, n), t((e) => e + 1);
},
];
}
function In(e, t) {
let n = t;
void 0 === n.m_eUIMode && void 0 !== (null == yn ? void 0 : yn.m_eUIMode) && (n = Object.assign(Object.assign({}, n), { m_eUIMode: yn.m_eUIMode })), (e.__FriendsUIBrowserContext = n);
}
let yn;
C.AN.AddPopupCreatedCallback((e) => {
var t;
In(e.window, null !== (t = e.browser_info) && void 0 !== t ? t : sn.D);
});
},
72746: (e, t, n) => {
"use strict";
n.d(t, { D: () => j.D, ns: () => j.n, cX: () => ce, wZ: () => de, i9: () => me, Ul: () => ne, IN: () => se, R6: () => le, oR: () => ue, E2: () => he });
var i = n(85556),
o = n(19953),
r = n(79588),
a = n(49367),
s = n(1736),
l = n(88991),
c = n(59208);
class m {
constructor() {
(this.m_status = a.m$), (this.m_mapPendingRequests = new r.vP()), (this.m_nRequestID = 1), (this.m_BroadcastDetails = {}), (0, r.rC)(this);
}
Init(e) {
(this.m_CMInterface = e),
this.m_CMInterface.RunWhenLoggedOn(() => {
o.De.IN_CLIENT && (SteamClient && SteamClient.Broadcast && SteamClient.Broadcast.RegisterForBroadcastStatus && SteamClient.Broadcast.RegisterForBroadcastStatus(this.OnBroadcastStatus), SteamClient && SteamClient.Broadcast && SteamClient.Broadcast.RegisterForViewerRequests && SteamClient.Broadcast.RegisterForViewerRequests(this.OnViewerRequest));
});
}
MakeKey(e, t) {
return e + "_" + t;
}
get status() {
return this.m_status;
}
get is_broadcasting() {
return this.m_status.bIsBroadcasting;
}
get broadcastid() {
return this.m_status.broadcastid;
}
get is_broadcast_capable() {
return this.m_status.bBroadcastCapable;
}
OnBroadcastStatus(e) {
((this.m_status.bIsBroadcasting && !e.bIsBroadcasting) || ("0" != this.m_status.broadcastid && "0" == e.broadcastid)) &&
this.m_mapPendingRequests.forEach((e, t, n) => {
e == a.c$.k_EPending && n.delete(t);
}),
(this.m_status = e);
}
OnViewerRequest(e, t, n) {
if (n == a.c$.k_EPending) {
let t = this.m_nRequestID++;
this.m_mapPendingRequests.set(this.MakeKey(e, t), n);
let i = ne.GetDefaultBrowserContext(),
o = ne.ShowFriendChatDialog(i, e);
o && o.ViewerNeedsApproval(t);
} else this.m_mapPendingRequests.set(this.MakeKey(e, t), n);
}
ApproveViewerRequest(e, t) {
let n = l.K.InitFromAccountID(e);
SteamClient.Broadcast.ApproveViewerRequest(n.ConvertTo64BitString(), Number(t));
}
RejectViewerRequest(e, t) {
let n = l.K.InitFromAccountID(e);
SteamClient.Broadcast.RejectViewerRequest(n.ConvertTo64BitString(), Number(t));
}
GetRequestState(e, t) {
return this.m_mapPendingRequests.get(this.MakeKey(e, t));
}
InviteToWatch(e) {
let t = l.K.InitFromAccountID(e);
return SteamClient.Broadcast.InviteToWatch(t.ConvertTo64BitString());
}
SubscribeToBroadcastDetails(e, t) {
if (this.m_BroadcastDetails[e]) 0 === this.m_BroadcastDetails[e].refCount && this.m_BroadcastDetails[e].details.Subscribe(), this.m_BroadcastDetails[e].refCount++;
else {
const n = new d(e, t, this.m_CMInterface.GetServiceTransport());
n.Subscribe(), (this.m_BroadcastDetails[e] = { details: n, refCount: 1 });
}
}
UnsubscribeFromBroadcastDetails(e, t) {
const n = this.m_BroadcastDetails[e];
n && (n.refCount > 1 ? n.refCount-- : (n.details.Unsubscribe(), delete this.m_BroadcastDetails[e]));
}
GetBroadcastDetails(e, t) {
let n = this.m_BroadcastDetails[e];
return n || ((n = { details: new d(e, t, this.m_CMInterface.GetServiceTransport()), refCount: 0 }), (this.m_BroadcastDetails[e] = n)), n.details;
}
}
(0, i.gn)([r.LO], m.prototype, "m_status", void 0), (0, i.gn)([r.LO], m.prototype, "m_mapPendingRequests", void 0), (0, i.gn)([r.Fl], m.prototype, "status", null), (0, i.gn)([r.Fl], m.prototype, "is_broadcasting", null), (0, i.gn)([r.Fl], m.prototype, "broadcastid", null), (0, i.gn)([r.Fl], m.prototype, "is_broadcast_capable", null), (0, i.gn)([r.aD.bound], m.prototype, "OnBroadcastStatus", null), (0, i.gn)([r.aD.bound], m.prototype, "OnViewerRequest", null), (0, i.gn)([r.aD], m.prototype, "ApproveViewerRequest", null), (0, i.gn)([r.aD], m.prototype, "RejectViewerRequest", null), (0, i.gn)([r.aD], m.prototype, "InviteToWatch", null);
class d {
get strThumbnail() {
return this.m_strThumbnail ? `${this.m_strThumbnail}?n=${this.m_nThumbnailCount}` : null;
}
get bExpired() {
return this.m_bExpired;
}
constructor(e, t, n) {
(this.m_bExpired = !1), (this.m_strThumbnail = ""), (this.m_nThumbnailCount = 0), (this.m_nTimeout = 10), (this.m_bSubscribed = !1), (0, r.rC)(this), (this.m_strBroadcastID = e), (this.m_strBroadcasterID = t), (this.m_ServiceTransport = n);
}
Subscribe() {
this.m_bSubscribed || ((this.m_bSubscribed = !0), this.PollForDetails());
}
SchedulePollForDetails() {
const e = this.m_strThumbnail ? this.m_nTimeout : 10;
this.m_nTimer = window.setTimeout(() => {
(this.m_nTimer = void 0), this.m_bSubscribed && this.PollForDetails();
}, 1e3 * e);
}
PollForDetails() {
return (0, i.mG)(this, void 0, void 0, function* () {
if (!this.m_nTimer && !this.m_bExpired) {
if (1 != (yield this.FetchBroadcastStatus()).GetEResult()) this.m_bExpired = !0;
else {
if (this.m_strThumbnail) this.m_nThumbnailCount++;
else {
const e = yield this.FetchBroadcastThumbnail();
1 === e.GetEResult() && ((this.m_strThumbnail = e.Body().thumbnail_url()), (this.m_nTimeout = e.Body().update_interval()));
}
this.SchedulePollForDetails();
}
}
});
}
FetchBroadcastStatus() {
let e = s.gA.Init(c.o7);
return e.Body().set_steamid(this.m_strBroadcasterID), e.Body().set_broadcast_id(this.m_strBroadcastID), c.Mr.GetBroadcastStatus(this.m_ServiceTransport, e);
}
FetchBroadcastThumbnail() {
let e = s.gA.Init(c.qZ);
return e.Body().set_steamid(this.m_strBroadcasterID), e.Body().set_broadcast_id(this.m_strBroadcastID), c.Mr.GetBroadcastThumbnail(this.m_ServiceTransport, e);
}
Unsubscribe() {
(this.m_bSubscribed = !1), this.m_nTimer && (clearTimeout(this.m_nTimer), (this.m_nTimer = void 0));
}
}
(0, i.gn)([r.LO], d.prototype, "m_bExpired", void 0), (0, i.gn)([r.LO], d.prototype, "m_strThumbnail", void 0), (0, i.gn)([r.LO], d.prototype, "m_nThumbnailCount", void 0);
var h = n(67915),
u = n(71240),
p = n(26671);
class _ {
Init(e) {
this.m_CMInterface = e;
}
GetTradeOfferURL() {
if (this.m_strTradeOfferToken) return Promise.resolve(this.GetConstructedTradeOfferURL());
{
let e = s.gA.Init(p.OE);
return p.$n.GetTradeOfferAccessToken(this.m_CMInterface.GetServiceTransport(), e).then((e) => {
if (1 == e.GetEResult()) return (this.m_strTradeOfferToken = e.Body().trade_offer_access_token()), this.GetConstructedTradeOfferURL();
throw new Error("Error getting Trade Offer token");
});
}
}
GetDefaultTradeOfferURLForFriend(e) {
return `${o.De.COMMUNITY_BASE_URL}tradeoffer/new/?partner=${e}`;
}
GetConstructedTradeOfferURL() {
let e = this.m_CMInterface.steamid.GetAccountID();
return `${o.De.COMMUNITY_BASE_URL}tradeoffer/new/?partner=${e}&token=${encodeURIComponent(this.m_strTradeOfferToken)}`;
}
}
var g = n(23346),
C = n(37035),
f = n(69087),
v = n(78654);
const S = { locked: !1 };
var b = n(58227);
class I {
constructor() {
(this.m_ParentalSettings = { is_enabled: !1 }), (this.m_ParentalState = S), (0, r.rC)(this);
}
SetLockState(e) {
this.m_ParentalState.locked = e;
}
Init(e) {
(this.m_CMInterface = e),
this.m_CMInterface.RunWhenLoggedOn(() => {
let e = s.gA.Init(f.RR);
e.Body().set_steamid(this.m_CMInterface.steamid.ConvertTo64BitString()),
o.De.IN_CLIENT
? SteamClient.Parental.RegisterForParentalSettingsChanges((e) => this.UpdateParentalState(e))
: f.pR.GetParentalSettings(this.m_CMInterface.GetServiceTransport(), e).then((e) => {
(this.m_ParentalSettings = e.Body().settings().toObject()),
this.m_ParentalSettings.is_enabled
? this.ValidateWebToken().then((e) => {
this.m_ParentalState = { locked: e };
})
: (this.m_ParentalState = { locked: !1 });
});
}),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandlerAction(f.NW.NotifyLockHandler, (e) => (o.De.SESSIONID == e.Body().sessionid() && this.SetLockState(!0), 1)),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandlerAction(f.NW.NotifyUnlockHandler, (e) => (o.De.SESSIONID == e.Body().sessionid() && this.SetLockState(!1), 1)),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandlerAction(f.NW.NotifySettingsChangeHandler, (e) => 1);
}
UpdateParentalState(e) {
(this.m_ParentalSettings = b.gA.deserializeBinary(e.settings).toObject()), (this.m_ParentalState = e);
}
BIsFeatureBlocked(e) {
return this.m_ParentalState.locked && 0 != e && 0 == (this.m_ParentalSettings.enabled_features & (1 << e));
}
BIsAppBlocked(e) {
if (!this.isLocked) return !1;
if (0 == this.m_ParentalSettings.applist_base_id) return !1;
if (0 == e) return !1;
if (e >= v.RI && e <= v.pv) return !1;
return -1 === [v.p6, v.Mq, v.xM, v.jA, v.us].indexOf(e) && (this.m_ParentalSettings.applist_custom.find((t) => t.appid == e) ? !this.m_ParentalSettings.applist_custom.find((e) => e.appid).is_allowed : !this.m_ParentalSettings.applist_base.find((t) => t.appid == e) || !this.m_ParentalSettings.applist_base.find((t) => t.appid == e).is_allowed);
}
get isEnabled() {
return !!this.m_ParentalSettings.is_enabled;
}
get isLocked() {
return this.m_ParentalState.locked;
}
ValidateWebToken() {
let e = o.De.SESSIONID,
t = document.cookie.match("(^|; )steamparental=([^;]*)");
if (!t || !t[2]) return Promise.resolve(!1);
let n = t[2],
i = n.split("||");
n = 2 == i.length ? i[1] : i[0];
let r = s.gA.Init(f.LD);
return (
r.Body().set_unlock_token(e + "||" + n),
new Promise((e, t) => {
f.pR.ValidateToken(this.m_CMInterface.GetServiceTransport(), r).then((t) => {
1 == t.GetEResult() ? e(!0) : e(!1);
});
})
);
}
get locked() {
return console.log("ParentalState.locked", this.m_ParentalState.locked), this.m_ParentalState.locked;
}
BIsFriendsBlocked() {
return this.BIsFeatureBlocked(4);
}
Unlock(e) {
if (o.De.IN_CLIENT)
return new Promise((t, n) => {
SteamClient.Parental.UnlockParentalLock(e, !1).then((e) => {
t(e);
});
});
{
let t = s.gA.Init(f.DB);
return (
t.Body().set_password(e),
t.Body().set_session(o.De.SESSIONID),
t.Body().set_send_unlock_on_success(!0),
new Promise((e, n) => {
f.pR.ValidatePassword(this.m_CMInterface.GetServiceTransport(), t).then((t) => {
if (1 == t.GetEResult()) {
let e = Date.now().toString() + "||" + t.Body().token();
document.cookie = "steamparental=" + encodeURIComponent(e) + "; path=/";
}
e(t.GetEResult());
});
})
);
}
}
}
(0, i.gn)([r.LO], I.prototype, "m_ParentalSettings", void 0), (0, i.gn)([r.LO], I.prototype, "m_ParentalState", void 0), (0, i.gn)([r.aD], I.prototype, "UpdateParentalState", null), (0, i.gn)([r.Fl], I.prototype, "isEnabled", null), (0, i.gn)([r.Fl], I.prototype, "isLocked", null), (0, i.gn)([r.Fl], I.prototype, "locked", null);
var y = n(39827),
E = n(54054),
D = n(57476),
w = n(2049),
R = n(88669);
const A = new (n(77385).sO)("FriendsUI/RemotePlay");
class M {
constructor() {
(this.m_bEnabled = !1), (this.m_canCreateInviteForGame = r.LO.map()), (this.m_nonGuestSessions = r.LO.map()), (this.m_guestSessions = r.LO.map()), (this.m_controllerSlotPlayers = []), (this.m_bIsShowingPlaceholder = !1), (this.m_unGuestLinkCopied = 0), (this.m_nGameVolume = -1), (this.m_bAllowDesktopStream = !1), (this.m_nHostStreamingQualityOverride = -1), (this.m_nClientStreamingQuality = 2), (this.m_nClientStreamingBitrate = -1), (this.m_bIsHost = !1), (this.m_sessionHost = null), (this.m_strGameID = ""), (this.m_rgDialogCloseHandles = []), (this.m_dialogContext = null), (this.m_unNextGuestID = 1), (this.m_bRegisteredForNetworkUtilizationUpdates = !1), (0, r.rC)(this);
}
Init(e) {
A.Debug("RemotePlayStore Init"),
(this.m_controllerSlotPlayers = new Array(20)),
this.ClearControllerSlotPlayers(),
(this.m_CMInterface = e),
(0, D.U5)("RemotePlay.RegisterForSessionStarted") && SteamClient.RemotePlay.RegisterForSessionStarted((e, t, n) => this.SessionStarted({ steamid: e, guestid: n }, t)),
(0, D.U5)("RemotePlay.RegisterForSessionStopped") && SteamClient.RemotePlay.RegisterForSessionStopped((e, t) => this.SessionStopped({ steamid: e, guestid: t })),
(0, D.U5)("RemotePlay.RegisterForSessionJoined") && SteamClient.RemotePlay.RegisterForSessionJoined((e, t, n) => this.SessionJoined({ steamid: e, guestid: t }, n)),
(0, D.U5)("RemotePlay.RegisterForInputUsed") &&
SteamClient.RemotePlay.RegisterForInputUsed((e, t, n) => {
this.PlayerUsedInput({ steamid: e, guestid: n }, t);
}),
(0, D.U5)("RemotePlay.RegisterForPlayerInputSettingsChanged") &&
SteamClient.RemotePlay.RegisterForPlayerInputSettingsChanged((e, t, n) => {
this.PlayerInputSettingsChanged({ steamid: e, guestid: n }, t);
}),
(0, D.U5)("RemotePlay.RegisterForPlaceholderStateChanged") &&
SteamClient.RemotePlay.RegisterForPlaceholderStateChanged((e) => {
this.m_bIsShowingPlaceholder = e;
}),
(0, D.U5)("RemotePlay.RegisterForClearControllers") &&
SteamClient.RemotePlay.RegisterForClearControllers(() => {
this.ClearControllerSlotPlayers();
}),
(0, D.U5)("RemotePlay.RegisterForControllerIndexSet") &&
SteamClient.RemotePlay.RegisterForControllerIndexSet((e, t, n) => {
this.ControllerIndexSet({ steamid: e, guestid: n }, t);
}),
(0, D.U5)("RemotePlay.RegisterForQualityOverride") && SteamClient.RemotePlay.RegisterForQualityOverride((e) => (this.m_nHostStreamingQualityOverride = e)),
(0, D.U5)("RemotePlay.BEnabled") &&
SteamClient.RemotePlay.BEnabled()
.then((e) => {
this.m_bEnabled = e;
})
.catch(),
(0, D.U5)("RemotePlay.RegisterForInviteResult") ? SteamClient.RemotePlay.RegisterForInviteResult(this.HandleLaunchResult) : (0, D.U5)("RemotePlay.RegisterForRemoteClientLaunchResult") && SteamClient.RemotePlay.RegisterForRemoteClientLaunchResult(this.HandleLaunchResult),
(0, D.U5)("RemotePlay.RegisterForGroupDisbanded") && SteamClient.RemotePlay.RegisterForGroupDisbanded(this.HandleGroupDisbanded),
(0, D.U5)("RemotePlay.RegisterForRemoteClientStopped") && SteamClient.RemotePlay.RegisterForRemoteClientStopped(this.HandleRemoteClientStopped),
(0, r.EH)(() => {
var e, t;
const n = null === (t = null === (e = ne.FriendStore.self) || void 0 === e ? void 0 : e.persona) || void 0 === t ? void 0 : t.m_gameid;
null != n &&
(this.m_canCreateInviteForGame.has(n) ||
this.BCanCreateInviteForGame(n).then((e) => {
this.m_canCreateInviteForGame.set(n, e);
}));
});
}
BEnabled() {
return this.m_bEnabled;
}
BRemotePlayTogetherEnabled() {
return !0;
}
BCanCreateInviteForGame(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
return !!(0, D.U5)("RemotePlay.BCanCreateInviteForGame") && SteamClient.RemotePlay.BCanCreateInviteForGame(e);
});
}
BCanAcceptInviteForGame(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
return (0, D.U5)("RemotePlay.BCanAcceptInviteForGame") ? SteamClient.RemotePlay.BCanAcceptInviteForGame(e, t) : !o.De.COUNTRY || -1 === t.indexOf(o.De.COUNTRY);
});
}
BCanCreateInviteForCurrentGame() {
var e, t;
const n = null === (t = null === (e = ne.FriendStore.self) || void 0 === e ? void 0 : e.persona) || void 0 === t ? void 0 : t.m_gameid;
return this.m_canCreateInviteForGame.get(n);
}
BShowQuickAccessControls() {
return this.BCanCreateInviteForCurrentGame() || this.in_session;
}
BCanHostIsolatedGameAudio() {
return (0, i.mG)(this, void 0, void 0, function* () {
return !!(0, D.U5)("RemotePlay.BCanHostIsolatedGameAudio") && SteamClient.RemotePlay.BCanHostIsolatedGameAudio();
});
}
HasInviteAndSession(e) {
let t = l.K.InitFromAccountID(e).ConvertTo64BitString();
if (this.m_nonGuestSessions.has(t) && this.m_nonGuestSessions.get(t).bSession) return !0;
let n = !1;
return this.m_guestSessions.forEach(({ playerID: { steamid: e } }) => (n = n || t === e)), n;
}
HasInviteAndSessionForGameIDOtherThan(e) {
let t = !1;
return (
this.GetAllSessions().forEach((n) => {
n.bSession && n.gameID !== e && void 0 !== n.gameID && (t = !0);
}),
t
);
}
GetPlayerPropsIndexOf(e) {
return this.GetAllSessions().findIndex((t) => k(e, t.playerID));
}
GetPlayerPropsByIndex(e) {
return this.GetAllSessions()[e];
}
get player_props_count() {
return this.m_nonGuestSessions.size + this.m_guestSessions.size;
}
ClearControllerSlotPlayers() {
for (let e = 0; e < this.m_controllerSlotPlayers.length; ++e) this.m_controllerSlotPlayers[e] = null;
}
ClearControllerSlotsWithPlayer(e) {
for (let t = 0; t < this.m_controllerSlotPlayers.length; ++t) k(e, this.m_controllerSlotPlayers[t]) && (this.m_controllerSlotPlayers[t] = null);
}
SetPlayerInControllerSlot(e, t) {
e < 0 || e >= this.m_controllerSlotPlayers.length || (this.m_controllerSlotPlayers[e] = t);
}
GetPlayerInControllerSlot(e) {
return e < 0 || e >= this.m_controllerSlotPlayers.length ? null : this.m_controllerSlotPlayers[e];
}
GetControllerSlotsForPlayer(e) {
return this.m_controllerSlotPlayers.map((t, n) => (k(t, e) ? n : null)).filter((e) => null !== e);
}
GetControllerType(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
return (0, D.U5)("RemotePlay.GetControllerType") ? SteamClient.RemotePlay.GetControllerType(e) : 0;
});
}
RemoveControllerFromPrioritySlot(e) {
const t = this.m_controllerSlotPlayers.slice(this.priority_controller_slot_count).findIndex((e) => null === e) + this.priority_controller_slot_count;
-1 === t ? (A.Error("[RPT] No empty controller slots found in RemoveControllerFromPrioritySlot. Swapping with another non-priority controller."), this.SwapControllerSlots(e, this.priority_controller_slot_count)) : this.SwapControllerSlots(e, t);
}
SwapControllerSlots(e, t, n = !0) {
return !(e == t || t < 0 || t > this.m_controllerSlotPlayers.length - 1) && ((0, D.U5)("RemotePlay.MoveControllerToSlot") && SteamClient.RemotePlay.MoveControllerToSlot(e, t), n && (this.TriggerControllerRumble(e), this.TriggerControllerRumble(t)), !0);
}
TriggerControllerRumble(e) {
(0, D.U5)("RemotePlay.IdentifyController") && SteamClient.RemotePlay.IdentifyController(e);
}
get priority_controller_slot_count() {
return 4;
}
get bIsShowingPlaceholder() {
return this.m_bIsShowingPlaceholder;
}
CreateInviteAndSession(e, t, n) {
if ((A.Debug(`CreateInviteAndSession for accountid ${e}`), (this.m_dialogContext = n), !e)) return A.Error("RemotePlayStore.CreateInviteAndSession called with invalid accountid. Did you mean to call CreateGuestInviteAndSession?"), this.CreateGuestInviteAndSession(t, n);
const i = l.K.InitFromAccountID(e);
return SteamClient.RemotePlay.CreateInviteAndSession(i.ConvertTo64BitString(), t);
}
GetNextGuestID() {
return this.m_unNextGuestID++;
}
CreateGroup(e, t) {
return (0, D.U5)("RemotePlay.CreateGroup") ? (A.Debug("CreateGroup(", e, ",", t, ")"), (this.m_dialogContext = t), SteamClient.RemotePlay.CreateGroup(e)) : (A.Error("CreateGroup not present on this client. Falling back to CreateGuestInviteAndSession"), this.CreateGuestInviteAndSession(e, t));
}
CreateGuestInviteAndSession(e, t) {
A.Debug("CreateGuestInviteAndSession"), (this.m_dialogContext = t);
const n = l.K.InitFromAccountID(0);
return SteamClient.RemotePlay.CreateInviteAndSessionWithGuestID(n.ConvertTo64BitString(), this.GetNextGuestID(), e);
}
CreateGuestInviteAndCopyLink(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
A.Debug("CreateGuestInviteAndCopyLink"), (this.m_dialogContext = t);
const n = l.K.InitFromAccountID(0),
i = this.GetNextGuestID(),
o = yield SteamClient.RemotePlay.CreateInviteAndSessionWithGuestID(n.ConvertTo64BitString(), i, e);
return 0 != o
? (A.Error(`Failed to create guest invite: ${o}`), o)
: (yield (0, r.gx)(() => {
const e = this.m_guestSessions.get(i);
return e && !!e.strConnectUrl;
}),
this.CopyLink(i),
o);
});
}
CancelInviteAndSession(e) {
A.Debug(`CancelInviteAndSession for accountid ${e}`), e || A.Error("RemotePlayStore.CancelInviteAndSession called with invalid accountid. Did you mean to call CancelGuestInviteAndSession()?");
const t = l.K.InitFromAccountID(e);
return (0, D.U5)("RemotePlay.CancelInviteAndSessionWithGuestID") ? SteamClient.RemotePlay.CancelInviteAndSessionWithGuestID(t.ConvertTo64BitString(), 0) : SteamClient.RemotePlay.CancelInviteAndSession(t.ConvertTo64BitString());
}
CancelGuestInviteAndSession(e, t) {
return A.Debug(`CancelGuestInviteAndSession for guestid ${t}`), SteamClient.RemotePlay.CancelInviteAndSessionWithGuestID(e, t);
}
CancelAllInvitesAndSessions() {
A.Debug("CancelAllInvitesAndSessions"), (0, D.U5)("RemotePlay.CancelInviteAndSessionWithGuestID") ? this.GetAllSessions().forEach((e) => SteamClient.RemotePlay.CancelInviteAndSessionWithGuestID(e.playerID.steamid, e.playerID.guestid)) : this.GetAllSessions().forEach((e) => SteamClient.RemotePlay.CancelInviteAndSession(e.playerID.steamid));
}
StopStreamingClient() {
(0, D.U5)("RemotePlay.StopStreamingClient") && SteamClient.RemotePlay.StopStreamingClient();
}
SetStreamingDesktopToRemotePlayTogetherEnabled(e) {
return (this.m_bAllowDesktopStream = e), SteamClient.RemotePlay.SetStreamingDesktopToRemotePlayTogetherEnabled(e);
}
SetPerUserKeyboardInputEnabled(e, t) {
return (0, D.U5)("RemotePlay.SetPerUserKeyboardInputEnabledWithGuestID") ? SteamClient.RemotePlay.SetPerUserKeyboardInputEnabledWithGuestID(e.steamid, e.guestid, t) : SteamClient.RemotePlay.SetPerUserKeyboardInputEnabled(e.steamid, t);
}
SetPerUserMouseInputEnabled(e, t) {
return (0, D.U5)("RemotePlay.SetPerUserMouseInputEnabledWithGuestID") ? SteamClient.RemotePlay.SetPerUserMouseInputEnabledWithGuestID(e.steamid, e.guestid, t) : SteamClient.RemotePlay.SetPerUserMouseInputEnabled(e.steamid, t);
}
SetPerUserControllerInputEnabled(e, t) {
return (0, D.U5)("RemotePlay.SetPerUserControllerInputEnabledWithGuestID") ? SteamClient.RemotePlay.SetPerUserControllerInputEnabledWithGuestID(e.steamid, e.guestid, t) : SteamClient.RemotePlay.SetPerUserControllerInputEnabled(e.steamid, t);
}
GetPerUserInputSettings(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
return (0, D.U5)("RemotePlay.GetPerUserInputSettingsWithGuestID") ? SteamClient.RemotePlay.GetPerUserInputSettingsWithGuestID(e.steamid, e.guestid) : SteamClient.RemotePlay.GetPerUserInputSettings(e.steamid);
});
}
BHasGuestPlayer() {
if (0 === this.m_guestSessions.size) return !1;
let e = !1;
return this.m_guestSessions.forEach(({ bSession: t }) => (e = e || t)), e;
}
BHasPlayer() {
if (0 === this.m_nonGuestSessions.size && 0 === this.m_guestSessions.size) return !1;
let e = !1;
return this.m_nonGuestSessions.forEach(({ bSession: t }) => (e = e || t)), this.m_guestSessions.forEach(({ bSession: t }) => (e = e || t)), e;
}
BHasJoinedPlayer() {
if (0 === this.m_nonGuestSessions.size && 0 === this.m_guestSessions.size) return !1;
let e = !1;
return this.m_nonGuestSessions.forEach((t) => (e = e || (null == t ? void 0 : t.bJoined))), this.m_guestSessions.forEach((t) => (e = e || (null == t ? void 0 : t.bJoined))), e;
}
OnGroupCreated(e, t, n) {
A.Debug(`OnGroupCreated - ${e.steamid64} - ${n}`), (this.m_sessionHost = e), (this.m_bIsHost = t), (this.m_strGameID = n);
}
SessionStarted(e, t) {
A.Debug(`SessionStarted: ${JSON.stringify(e)}`), "number" == typeof e.guestid && (this.m_unNextGuestID = Math.max(this.m_unNextGuestID, e.guestid + 1));
let n = this.GetSessionForPlayer(e);
if (void 0 === n) {
let i = new l.K(e.steamid).GetAccountID();
const o = !!e.guestid;
(n = { playerID: e, friend: ne.FriendStore.GetPlayer(i), gameID: t, bSession: !0, bJoined: !1, bMobile: !1, bKeyboardEnabled: !0, bMouseEnabled: !0, bControllerEnabled: !0, nKeyboardUsedTime: 0, nMouseUsedTime: 0, nControllerUsedTime: 0, bGuest: o, strConnectUrl: o ? "" : void 0 }),
this.GetPerUserInputSettings(e)
.then((t) => {
this.PlayerInputSettingsChanged(e, t);
})
.catch(),
n.friend.LoadIfNecessary(),
e.guestid ? this.m_guestSessions.set(e.guestid, n) : this.m_nonGuestSessions.set(e.steamid, n);
} else n.bSession = !0;
}
GetSessionForPlayer(e) {
return e.guestid ? this.m_guestSessions.get(e.guestid) : this.m_nonGuestSessions.get(e.steamid);
}
ClearSessionForPlayer(e) {
e.guestid ? this.m_guestSessions.delete(e.guestid) : this.m_nonGuestSessions.delete(e.steamid);
}
GetAllSessions() {
return [...Array.from(this.m_nonGuestSessions.values()), ...Array.from(this.m_guestSessions.values())];
}
SessionStopped(e) {
A.Debug(`SessionStopped: ${JSON.stringify(e)}`), this.GetSessionForPlayer(e) && (this.ClearSessionForPlayer(e), ne.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/steam_rpt_leave.m4a")), this.ClearControllerSlotsWithPlayer(e);
}
SessionJoined(e, t) {
A.Debug(`SessionJoined: ${JSON.stringify(e)} - ${t}`);
let n = this.GetSessionForPlayer(e);
if (void 0 === n) return;
if (!0 === n.bJoined) return;
(n.bJoined = !0), (n.rtJoined = Date.now() / 1e3), (n.strAvatarHash = t), (0, D.U5)("RemotePlay.BRemotePlayTogetherGuestOnPhoneOrTablet") && SteamClient.RemotePlay.BRemotePlayTogetherGuestOnPhoneOrTablet(e.steamid, e.guestid).then((e) => (n.bMobile = e));
let i = new l.K(e.steamid).GetAccountID();
0 != i && (e.guestid && n.playerID.steamid !== e.steamid && ((n.playerID = e), (n.friend = ne.FriendStore.GetPlayer(i))), i !== ne.FriendStore.self.accountid && ne.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/steam_rpt_join.m4a"));
}
PlayerUsedInput(e, t) {
let n = this.GetSessionForPlayer(e);
if (void 0 !== n)
switch (t) {
case y.w8.k_EClientUsedInputTypeKeyboard:
n.nKeyboardUsedTime = Date.now();
break;
case y.w8.k_EClientUsedInputTypeMouse:
n.nMouseUsedTime = Date.now();
break;
case y.w8.k_EClientUsedInputTypeController:
n.nControllerUsedTime = Date.now();
}
}
PlayerInputSettingsChanged(e, t) {
let n = this.GetSessionForPlayer(e);
void 0 !== n && ((n.bKeyboardEnabled = t.bKeyboardEnabled), (n.bMouseEnabled = t.bMouseEnabled), (n.bControllerEnabled = t.bControllerEnabled));
}
ControllerIndexSet(e, t) {
A.Debug(`ControllerIndexSet: ${t} - ${JSON.stringify(e)}`), this.SetPlayerInControllerSlot(t, e);
}
HandleLaunchResult(e, t, n, i, o, r) {
this.m_strGameID = t;
const a = { steamid: e, guestid: r };
if ((A.Debug(`HandleLaunchResult: ${JSON.stringify(a)}`), n === E.u.k_ERemoteClientLaunchOK)) {
if ((this.GetSessionSettings(), a.guestid)) {
const e = this.GetSessionForPlayer(a);
e && e.bGuest ? (e.strConnectUrl = o) : A.Error("Got remote play launch result for unknown guest session!");
}
this.RegisterForNetworkUtilizationUpdates();
} else this.m_unGuestLinkCopied = 0;
}
RegisterForNetworkUtilizationUpdates() {
!this.m_bRegisteredForNetworkUtilizationUpdates && (0, D.U5)("RemotePlay.RegisterForNetworkUtilizationUpdate") && (SteamClient.RemotePlay.RegisterForNetworkUtilizationUpdate(this.OnNetworkUtilizationUpdate), (this.m_bRegisteredForNetworkUtilizationUpdates = !0));
}
OnNetworkUtilizationUpdate(e, t, n, i) {
const o = this.GetSessionForPlayer({ steamid: e, guestid: t });
o && ((o.flNetworkUtilization = n), (o.flNetworkDuration = i));
}
HandleGroupDisbanded() {
A.Debug("HandleGroupDisbanded"), this.Reset();
}
Reset() {
A.Debug("Resetting."), this.CloseRemotePlayTogetherDialogs(), this.m_guestSessions.clear(), this.m_nonGuestSessions.clear(), (this.m_unGuestLinkCopied = 0), (this.m_strGameID = ""), (this.m_sessionHost = null), (this.m_bIsHost = !1), (this.m_unNextGuestID = 1), (this.m_dialogContext = null), (this.m_rgDialogCloseHandles = []);
}
HandleRemoteClientStopped(e, t) {
this.Reset();
}
CloseRemotePlayTogetherDialogs() {
if ((A.Debug("CloseRemotePlayTogetherDialogs. Have any dialog close handles? " + (this.m_rgDialogCloseHandles.length > 0 ? "Yes" : "No")), this.m_rgDialogCloseHandles.length > 0)) {
const e = this.m_rgDialogCloseHandles;
(this.m_rgDialogCloseHandles = []), e.forEach(([e, t]) => t());
}
}
StopRemotePlay() {
return (0, i.mG)(this, void 0, void 0, function* () {
A.Debug("StopRemotePlay"), (0, D.U5)("RemotePlay.CloseGroup") ? yield SteamClient.RemotePlay.CloseGroup() : this.m_bIsHost ? this.CancelAllInvitesAndSessions() : this.StopStreamingClient(), this.Reset();
});
}
CopyLink(e) {
const t = this.m_guestSessions.get(e);
t && t.bGuest ? (R.J$(t.strConnectUrl), (this.m_unGuestLinkCopied = e)) : A.Error("Cannot find guest session for copying link");
}
get link_copied_for_guest() {
return this.m_unGuestLinkCopied;
}
get game_volume() {
return this.m_nGameVolume;
}
SetGameVolume(e) {
(0, D.U5)("RemotePlay.SetGameSystemVolume") && SteamClient.RemotePlay.SetGameSystemVolume(e), (this.m_nGameVolume = e);
}
get client_streaming_quality() {
return this.m_nClientStreamingQuality;
}
get host_streaming_quality_override() {
return this.m_nHostStreamingQualityOverride;
}
SetClientStreamingQuality(e) {
(0, D.U5)("RemotePlay.SetClientStreamingQuality") && SteamClient.RemotePlay.SetClientStreamingQuality(e), (this.m_nClientStreamingQuality = e);
}
get client_streaming_bitrate() {
return this.m_nClientStreamingBitrate;
}
SetClientStreamingBitrate(e) {
(0, D.U5)("RemotePlay.SetClientStreamingBitrate") && SteamClient.RemotePlay.SetClientStreamingBitrate(e), (this.m_nClientStreamingBitrate = e);
}
get allow_desktop_stream() {
return this.m_bAllowDesktopStream;
}
get is_host() {
return this.m_bIsHost;
}
get host() {
return this.m_sessionHost;
}
get in_session() {
return null != this.m_sessionHost;
}
DialogOpened(e, t, n) {
this.m_rgDialogCloseHandles.push([e, t, n]);
}
DialogClosed(e, t) {
this.m_rgDialogCloseHandles = this.m_rgDialogCloseHandles.filter(([n, i, o]) => !(0, j.n)(n, e) || o != t);
}
BDialogOpenInContext(e, t) {
return this.m_rgDialogCloseHandles.some(([n, i, o]) => (0, j.n)(n, e) && (null == t || o == t));
}
get dialog_context() {
return this.m_dialogContext;
}
get game_id() {
return this.m_strGameID;
}
RemoteClientStarted(e, t, n) {
(this.m_sessionHost = e), (this.m_bIsHost = t), (this.m_strGameID = n), this.GetSessionSettings(), this.RegisterForNetworkUtilizationUpdates();
}
GetSessionSettings() {
(0, D.U5)("RemotePlay.GetGameSystemVolume") && SteamClient.RemotePlay.GetGameSystemVolume().then((e) => (this.m_nGameVolume = e)), (0, D.U5)("RemotePlay.GetClientStreamingQuality") && SteamClient.RemotePlay.GetClientStreamingQuality().then((e) => (this.m_nClientStreamingQuality = e)), (0, D.U5)("RemotePlay.GetClientStreamingBitrate") && SteamClient.RemotePlay.GetClientStreamingBitrate().then((e) => (this.m_nClientStreamingBitrate = e));
}
}
function k(e, t) {
return (null == e ? void 0 : e.steamid) === (null == t ? void 0 : t.steamid) && (null == e ? void 0 : e.guestid) === (null == t ? void 0 : t.guestid);
}
(0, i.gn)([r.LO], M.prototype, "m_controllerSlotPlayers", void 0),
(0, i.gn)([r.LO], M.prototype, "m_bIsShowingPlaceholder", void 0),
(0, i.gn)([r.LO], M.prototype, "m_unGuestLinkCopied", void 0),
(0, i.gn)([r.LO], M.prototype, "m_nGameVolume", void 0),
(0, i.gn)([r.LO], M.prototype, "m_bAllowDesktopStream", void 0),
(0, i.gn)([r.LO], M.prototype, "m_nHostStreamingQualityOverride", void 0),
(0, i.gn)([r.LO], M.prototype, "m_nClientStreamingQuality", void 0),
(0, i.gn)([r.LO], M.prototype, "m_nClientStreamingBitrate", void 0),
(0, i.gn)([r.LO], M.prototype, "m_bIsHost", void 0),
(0, i.gn)([r.LO], M.prototype, "m_sessionHost", void 0),
(0, i.gn)([r.LO], M.prototype, "m_strGameID", void 0),
(0, i.gn)([r.aD], M.prototype, "Init", null),
(0, i.gn)([r.Fl], M.prototype, "player_props_count", null),
(0, i.gn)([r.Fl], M.prototype, "bIsShowingPlaceholder", null),
(0, i.gn)([r.aD], M.prototype, "SessionStopped", null),
(0, i.gn)([r.aD], M.prototype, "SessionJoined", null),
(0, i.gn)([r.aD], M.prototype, "PlayerInputSettingsChanged", null),
(0, i.gn)([w.ak], M.prototype, "HandleLaunchResult", null),
(0, i.gn)([w.ak], M.prototype, "OnNetworkUtilizationUpdate", null),
(0, i.gn)([w.ak], M.prototype, "HandleGroupDisbanded", null),
(0, i.gn)([r.aD], M.prototype, "Reset", null),
(0, i.gn)([w.ak], M.prototype, "HandleRemoteClientStopped", null),
(0, i.gn)([w.ak], M.prototype, "SetClientStreamingQuality", null);
var T = n(53971),
L = n(58594),
G = n(3519),
O = n(93635);
class F {
constructor(e) {
(this.m_bReady = !1), (this.m_FriendsSettings = void 0), (this.m_CommunityPreferences = void 0), (this.m_StorePreferences = void 0), (this.m_bSteamIsInTournamentMode = !1), (this.m_unTimerUploadCommunityPreferences = void 0), (this.m_rgOnReadyCallbacks = []), (this.m_bFriendSettingsReady = !1), (0, r.rC)(this), (this.m_Storage = e), o.De.IN_CLIENT ? (this.m_iFriendSettingsStore = new x(this, this.OnFriendSettingsChanged.bind(this))) : (this.m_iFriendSettingsStore = new N(this, this.OnFriendSettingsChanged.bind(this))), (this.m_bSteamIsInTournamentMode = !1), o.De.IN_CLIENT && SteamClient.System.IsSteamInTournamentMode().then((e) => (this.m_bSteamIsInTournamentMode = e));
{
let e = new L.n8();
this.m_CommunityPreferences = { bParenthesizeNicknames: e.parenthesize_nicknames(), eTextFilterSetting: e.text_filter_setting(), bTextFilterIgnoreFriends: e.text_filter_ignore_friends(), content_descriptor_preferences: { content_descriptors_to_exclude: [] } };
}
this.m_ServerCommunityPreferences = void 0;
}
Init(e) {
(this.m_CM = e),
this.m_CM.AddOnLogonCallback(() => {
this.m_bReady || (this.m_iFriendSettingsStore.InternalInit(), this.SetReady());
let e = s.gA.Init(G.Ug);
G.d6.GetStorePreferences(this.m_CM.GetServiceTransport(), e).then((e) => {
this.m_StorePreferences = e.Body();
});
let t = s.gA.Init(L.AP);
return L.lk.GetCommunityPreferences(this.m_CM.GetServiceTransport(), t).then((e) => this.UpdateCommunityPreferences(e.Body().preferences()));
}),
this.m_CM.messageHandlers.RegisterServiceNotificationHandlerAction(L.jj.NotifyCommunityPreferencesChangedHandler, (e) => (this.UpdateCommunityPreferences(e.Body().preferences()), 1));
}
BReady() {
return this.m_bReady;
}
get FriendsSettings() {
return this.m_FriendsSettings;
}
BUpdateFriendsSettings(e) {
return !!this.m_iFriendSettingsStore.BUpdateSettings(e) && ((this.m_FriendsSettings = e), !0);
}
BClientHasFeatureOrOnWeb(e) {
return !o.De.IN_CLIENT || (!!this.BReady() && "object" == typeof this.m_FriendsSettings.featuresEnabled && !!this.m_FriendsSettings.featuresEnabled.hasOwnProperty(e) && this.m_FriendsSettings.featuresEnabled[e]);
}
IsSteamInTournamentMode() {
return this.m_bSteamIsInTournamentMode;
}
BAlwaysShowChatsInNewWindow() {
return this.m_FriendsSettings.bAlwaysNewChatWindow;
}
BSingleWindowModeEnabled() {
return !!this.m_FriendsSettings.bSingleWindowMode;
}
BackfillSingleWindowMode(e) {
void 0 === this.m_FriendsSettings.bSingleWindowMode && (console.log("Performing single window mode backfill", e), this.SetSingleWindowMode(e));
}
SetSingleWindowMode(e) {
(this.m_FriendsSettings.bSingleWindowMode = e), this.BUpdateFriendsSettings(this.m_FriendsSettings);
}
BForceAlphabeticFriendSorting() {
return this.m_FriendsSettings.bForceAlphabeticFriendSorting;
}
RunOnReady(e) {
this.m_bReady ? e() : this.m_rgOnReadyCallbacks.push(e);
}
GetAccountSpecificLocalStorageKey(e) {
return this.m_CM && this.m_CM.steamid && this.m_CM.steamid.BIsValid() ? e + "_" + this.m_CM.steamid.GetAccountID() : null;
}
GetObjectFromLocalStorageWhenReady(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
return yield this.WhenReady(), this.GetObjectFromLocalStorage(e, t);
});
}
GetObjectFromLocalStorage(e, t) {
let n = this.GetAccountSpecificLocalStorageKey(e);
return n
? this.m_Storage.GetObject(n).then((e) => {
let n = Object.assign({}, t, e);
if (t && "object" == typeof t) for (let i in t) "object" == typeof t[i] && e && (n[i] = Object.assign({}, t[i], e[i]));
return n;
})
: Promise.reject("Storage not ready");
}
StoreObjectInLocalStorage(e, t) {
let n = this.GetAccountSpecificLocalStorageKey(e);
return !!n && (this.m_Storage.StoreObject(n, t), !0);
}
GetFlagFromLocalStorageWhenReady(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
return yield this.WhenReady(), this.GetFlagFromLocalStorage(e);
});
}
GetFlagFromLocalStorage(e) {
let t = this.GetAccountSpecificLocalStorageKey(e);
return t ? this.m_Storage.GetString(t).then((e) => "true" === e) : Promise.reject("Storage not ready");
}
SetFlagInLocalStorage(e, t) {
let n = this.GetAccountSpecificLocalStorageKey(e);
return !!n && (t ? this.m_Storage.StoreString(n, "true") : this.m_Storage.RemoveObject(n), !0);
}
BFlagExistsInLocalStorage(e) {
const t = this.GetAccountSpecificLocalStorageKey(e);
return t ? this.m_Storage.GetString(t).then((e) => null !== e) : Promise.reject("Storage not ready");
}
WhenReady() {
return this.m_bReady ? Promise.resolve() : new Promise((e) => this.RunOnReady(e));
}
SetReady() {
if (this.m_bFriendSettingsReady && this.m_CM && this.m_CM.steamid.BIsValid()) {
this.m_bReady = !0;
for (let e of this.m_rgOnReadyCallbacks) e();
this.m_rgOnReadyCallbacks = [];
}
}
OnFriendSettingsChanged(e) {
(this.m_FriendsSettings = e), (this.m_bFriendSettingsReady = !0), this.SetReady();
}
get CommunityPreferences() {
return this.m_CommunityPreferences;
}
UpdateCommunityPreferences(e) {
let t = Object.assign({}, this.m_CommunityPreferences);
void 0 !== e.parenthesize_nicknames() && (t.bParenthesizeNicknames = e.parenthesize_nicknames()), (this.m_ServerCommunityPreferences = Object.assign({}, t)), (this.m_CommunityPreferences = t);
}
CommunityPreferencesToMessage(e) {
let t = new L.n8();
return t.set_parenthesize_nicknames(e.bParenthesizeNicknames), t;
}
SetCommunityPreferences(e) {
(this.m_CommunityPreferences = e),
(0, D.U5)("Messaging.PostMessage") && SteamClient.Messaging.PostMessage("Settings", "CommunityPreferences", JSON.stringify(e)),
this.m_unTimerUploadCommunityPreferences && clearTimeout(this.m_unTimerUploadCommunityPreferences),
(this.m_unTimerUploadCommunityPreferences = SetBackgroundTimeout(() => {
(this.m_unTimerUploadCommunityPreferences = void 0), this.UploadCommunityPreferences();
}, 5e3));
}
UploadCommunityPreferences() {
let e = !1;
if (void 0 === this.m_ServerCommunityPreferences) e = !0;
else
for (let t of Object.keys(this.m_ServerCommunityPreferences))
if (this.m_ServerCommunityPreferences[t] !== this.CommunityPreferences[t]) {
e = !0;
break;
}
if (!e) return;
let t = s.gA.Init(L.FO);
t.Body().set_preferences(this.CommunityPreferencesToMessage(this.CommunityPreferences)), L.lk.SetCommunityPreferences(this.m_CM.GetServiceTransport(), t).then((e) => {});
}
get StorePreferences() {
return this.m_StorePreferences;
}
FillInChatUsabilityMetrics(e) {
let t = e.settings(),
n = this.FriendsSettings;
t.set_notifications_show_ingame(n.bNotifications_ShowIngame),
t.set_notifications_show_online(n.bNotifications_ShowOnline),
t.set_notifications_show_message(n.bNotifications_ShowMessage),
t.set_notifications_events_and_announcements(n.bNotifications_EventsAndAnnouncements),
t.set_sounds_play_ingame(n.bSounds_PlayIngame),
t.set_sounds_play_online(n.bSounds_PlayOnline),
t.set_sounds_play_message(n.bSounds_PlayMessage),
t.set_sounds_events_and_announcements(n.bSounds_EventsAndAnnouncements),
t.set_always_new_chat_window(n.bAlwaysNewChatWindow),
t.set_force_alphabetic_friend_sorting(n.bForceAlphabeticFriendSorting),
t.set_chat_flash_mode(n.nChatFlashMode),
t.set_remember_open_chats(n.bRememberOpenChats),
t.set_compact_quick_access(n.bCompactQuickAccess),
t.set_compact_friends_list(n.bCompactFriendsList),
t.set_notifications_show_chat_room_notification(n.bNotifications_ShowChatRoomNotification),
t.set_sounds_play_chat_room_notification(n.bSounds_PlayChatRoomNotification),
t.set_hide_offline_friends_in_tag_groups(n.bHideOfflineFriendsInTagGroups),
t.set_hide_categorized_friends(n.bHideCategorizedFriends),
t.set_categorize_in_game_friends_by_game(n.bCategorizeInGameFriendsByGame),
t.set_chat_font_size(n.nChatFontSize),
t.set_use24hour_clock(n.b24HourClock),
t.set_do_not_disturb_mode(n.bDoNotDisturbMode),
t.set_disable_embed_inlining(n.bDisableEmbedInlining),
t.set_sign_into_friends(n.bSignIntoFriends),
t.set_animated_avatars(n.bAnimatedAvatars);
}
}
(0, i.gn)([r.LO], F.prototype, "m_bReady", void 0), (0, i.gn)([r.LO], F.prototype, "m_FriendsSettings", void 0), (0, i.gn)([r.LO], F.prototype, "m_CommunityPreferences", void 0), (0, i.gn)([r.LO], F.prototype, "m_StorePreferences", void 0), (0, i.gn)([r.LO], F.prototype, "m_bSteamIsInTournamentMode", void 0), (0, i.gn)([r.aD], F.prototype, "BUpdateFriendsSettings", null), (0, i.gn)([r.aD], F.prototype, "UpdateCommunityPreferences", null), (0, i.gn)([r.aD], F.prototype, "SetCommunityPreferences", null);
class B {
constructor(e, t) {
(this.m_SettingsStore = e), (this.m_fnFriendSettingsChanged = t);
}
}
class x extends B {
constructor(e, t) {
super(e, t), (this.m_bClientInitComplete = !1), this.InternalInit();
}
InternalInit() {
this.m_bClientInitComplete || (SteamClient && SteamClient.FriendSettings && SteamClient.FriendSettings.RegisterForSettingsChanges ? (SteamClient.FriendSettings.RegisterForSettingsChanges(this.OnClientSettingsChange.bind(this)), (this.m_bClientInitComplete = !0)) : (0, O.X)(!1, "Can't initialize settings from client"));
}
OnClientSettingsChange(e) {
let t,
n = T.k();
if ("string" != typeof e) {
if (((t = e.FriendsSettings), SteamClient.FriendSettings && SteamClient.FriendSettings.SetFriendSettings)) return void this.BUpdateSettings(t);
} else t = JSON.parse(e, (e, t) => ("b" == e.substring(0, 1) && "number" == typeof t ? 0 != t : t));
Object.assign(n, t), this.m_fnFriendSettingsChanged(n);
}
BUpdateSettings(e) {
let t = JSON.stringify(e);
return SteamClient.FriendSettings.SetFriendSettings(t), !0;
}
}
class N extends B {
InternalInit() {
this.m_SettingsStore.GetObjectFromLocalStorage(N.k_strLocalStorageKeyPrefix, this.GetDefaultSettings()).then((e) => {
this.m_fnFriendSettingsChanged(e.friendsSettings);
});
}
GetDefaultSettings() {
return { friendsSettings: T.k() };
}
BUpdateSettings(e) {
let t = { friendsSettings: e };
return this.m_SettingsStore.StoreObjectInLocalStorage(N.k_strLocalStorageKeyPrefix, t);
}
}
N.k_strLocalStorageKeyPrefix = "LocalStorageFriendsSettings";
var P = n(96119);
class U {
constructor() {
(this.m_PrivacySettings = { privacy_state: 0, privacy_state_inventory: 0, privacy_state_gifts: 0, privacy_state_ownedgames: 0, privacy_state_playtime: 0, privacy_state_friendslist: 0 }), (0, r.rC)(this);
}
Init(e) {
(this.m_CMInterface = e),
this.m_CMInterface.RunWhenLoggedOn(() =>
(0, i.mG)(this, void 0, void 0, function* () {
let e = s.gA.Init(L.g_),
t = yield L.lk.GetPrivacySettings(this.m_CMInterface.GetServiceTransport(), e);
1 == t.GetEResult() && this.ReadPrivacySettings(t.Body().privacy_settings());
}),
),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandlerAction(L.jj.NotifyPrivacyPrivacySettingsChangedHandler, (e) => (this.ReadPrivacySettings(e.Body().privacy_settings()), 1));
}
get PrivacySettings() {
return this.m_PrivacySettings;
}
ReadPrivacySettings(e) {
Object.assign(this.m_PrivacySettings, e.toObject());
}
}
(0, i.gn)([r.LO], U.prototype, "m_PrivacySettings", void 0);
var V = n(38461),
H = n(50913),
W = n(93354),
X = n(73085),
j = n(33082);
function z(e, t) {
return `${e} - ${(performance.now() - t).toLocaleString()}ms`;
}
var K = n(41370),
q = n(50649),
Z = n(27378),
Q = n(37634),
$ = n(34294),
Y = n(33690),
J = n(24424),
ee = n(31542);
class te {
constructor(e) {
this.m_VoiceChatStore = e;
}
Init(e) {
(this.m_CMInterface = e), o.De.IN_CLIENT && ((this.m_RootElement = document.createElement("div")), document.body.appendChild(this.m_RootElement), Q.s(this.m_RootElement).render(Z.createElement(ie, { voiceChat: this.m_VoiceChatStore })));
}
}
let ne,
ie = (0, q.Pi)((e) => {
const t = e.voiceChat.video_streams;
return Z.createElement(
Z.Fragment,
null,
t.map((e) => Z.createElement(oe, { key: e.unique_id, video: e })),
);
});
function oe(e) {
const t = (0, J.B)("RemoteVideo-" + e.video.unique_id, { browserType: $.i_.EBrowserType_OpenVROverlay, eCreationFlags: Y.eL.None, strVROverlayKey: "valve.steam.friendsui.remotevideo_" + e.video.accountid, title: "FriendsUI - Remote Video - " + e.video.unique_id, dimensions: { width: 1920, height: 1080, left: 0, top: 0 }, replace_existing_popup: !0 }),
{ element: n } = t;
return n ? (0, ee.createPortal)(Z.createElement(re, Object.assign({}, e)), n) : null;
}
function re(e) {
const { video: t } = e,
n = Z.useRef();
return (
Z.useLayoutEffect(() => {
n.current && (n.current.srcObject = t.stream);
}),
Z.createElement("div", null, Z.createElement("video", { className: "remoteVideo", ref: n, autoPlay: !0, playsInline: !0, muted: !0 }))
);
}
function ae(e, t) {
return function (...t) {
ne.ready_to_render
? e.apply(this, t)
: (0, r.gx)(
() => ne.ready_to_render,
() => {
e.apply(this, t);
},
);
};
}
function se(e, t, n) {
return { value: ae(n.value) };
}
function le(e) {
return ae(e, e.name);
}
class ce {}
class me {}
class de {
constructor(e, t = {}) {
(this.m_BrowserContextDefaultTarget = j.D),
(this.m_AppInfoStore = H.Q8),
(this.m_EconomyStore = new _()),
(this.m_UserStore = new U()),
(this.m_ParentalStore = new I()),
(this.m_BroadcastStore = new m()),
(this.m_GroupMemberStore = new C.r$()),
(this.m_RemotePlayStore = new M()),
(this.m_bReadyToRender = !1),
(this.m_bShuttingDown = !1),
(this.m_exportsVoiceInterface = null),
(0, r.rC)(this),
(0, O.X)(!ne, "FriendsUIApp already initialized"),
(ne = this),
(window.g_FriendsUIApp = this),
(this.m_Storage = e),
(this.m_SettingsStore = t.SettingsStore || new F(e)),
(this.m_FriendStore = t.FriendStore || new g.Yp()),
(this.m_ChatStore = t.ChatStore || new h.ic(this.m_FriendStore)),
(this.m_UIStore = t.UIStore || new P.lV(this.m_ChatStore)),
(this.m_VoiceChatStore = new V.Ys(this.m_SettingsStore)),
(this.m_VRPopupManager = new te(this.m_VoiceChatStore)),
(this.m_exportsCurrentUserStatus = {
GetPersonaState: () => (this.FriendStore.self ? this.FriendStore.self.persona.m_ePersonaState : 0),
SetUserOnline: () => this.FriendStore.SetUserPersonaState(1),
SetUserInvisible: () => this.FriendStore.SetUserPersonaState(7),
SetUserAway: () => this.FriendStore.SetUserPersonaState(3),
SetUserOffline: () => {
this.SignOutOfFriends(j.D), this.FriendStore.SetUserPersonaState(0);
},
GetUserDoNotDisturb: () => this.FriendStore.GetUserDoNotDisturb(),
SetUserDoNotDisturb: (e) => this.FriendStore.SetUserDoNotDisturb(e),
}),
(this.m_exportsVoiceInterface = {
IsAnyVoiceActive: () => this.VoiceStore.IsAnyVoiceActive(),
IsMicMuted: () => this.VoiceStore.IsMicMuted(),
IsOutputMuted: () => this.VoiceStore.IsOutputMuted(),
ToggleMicMuting: () => this.VoiceStore.ToggleMicMuting(),
ToggleOutputMuting: () => this.VoiceStore.ToggleOutputMuting(),
EndVoiceChat: () => this.VoiceStore.OnUserEndVoiceChat(),
RegisterForPendingOneOnOneVoiceChatRequests: (e) => this.VoiceStore.RegisterForPendingOneOnOneVoiceChatRequests(e),
RegisterForCurrentUserVoiceLevel: (e) => this.VoiceStore.RegisterForCurrentUserVoiceLevel(e),
IsLocalMicTestActive: () => this.VoiceStore.IsLocalMicTestActive(),
InitiateLocalMicTest: () => this.VoiceStore.InitiateLocalMicTest(),
EndLocalMicTest: () => this.VoiceStore.EndLocalMicTest(),
GetSelectedMic: () => this.VoiceStore.GetSelectedMic(),
GetSelectedOutputDevice: () => this.VoiceStore.GetSelectedOutputDevice(),
SetSelectedMic: (e) => this.VoiceStore.SetSelectedMic(e),
SetSelectedOutput: (e) => this.VoiceStore.SetSelectedOutput(e),
ConvertGainValueToSliderValue: (e, t) => this.VoiceStore.ConvertGainValueToSliderValue(e, t),
ConvertSliderToGainValue: (e, t) => this.VoiceStore.ConvertSliderToGainValue(e, t),
GetVoiceInputGain: () => this.VoiceStore.GetVoiceInputGain(),
GetVoiceOutputGain: () => this.VoiceStore.GetVoiceOutputGain(),
GetMaxInputOutputGain: () => V.Ys.k_MaxInputOutputGainValue,
SetVoiceInputGain: (e) => this.VoiceStore.SetVoiceInputGain(e),
SetVoiceOutputGain: (e) => this.VoiceStore.SetVoiceOutputGain(e),
GetPushToTalkEnabled: () => this.VoiceStore.GetPushToTalkEnabled(),
GetPushToMuteEnabled: () => this.VoiceStore.GetPushToMuteEnabled(),
SetPushToTalkEnabled: (e) => this.VoiceStore.SetPushToTalkEnabled(e),
SetPushToMuteEnabled: (e) => this.VoiceStore.SetPushToMuteEnabled(e),
GetPushToTalkHotKeyDisplayString: () => this.VoiceStore.GetPushToTalkHotKeyDisplayString(),
GetPushToTalkOrMuteSoundsEnabled: () => this.VoiceStore.GetPushToTalkOrMuteSoundsEnabled(),
SetPushToTalkOrMuteSoundsEnabled: (e) => this.VoiceStore.SetPushToTalkOrMuteSoundsEnabled(e),
RefreshPushToTalkKeySettings: () => this.VoiceStore.RefreshPushToTalkKeySettings(),
GetUseNoiseGateLevel: () => this.VoiceStore.GetUseNoiseGateLevel(),
SetUseNoiseGateLevel: (e) => this.VoiceStore.SetUseNoiseGateLevel(e),
GetUseEchoCancellation: () => this.VoiceStore.GetUseEchoCancellation(),
SetUseEchoCancellation: (e) => this.VoiceStore.SetUseEchoCancellation(e),
GetUseNoiseCancellation: () => this.VoiceStore.GetUseNoiseCancellation(),
SetUseNoiseCancellation: (e) => this.VoiceStore.SetUseNoiseCancellation(e),
GetUseAutoGainControl: () => this.VoiceStore.GetUseAutoGainControl(),
SetUseAutoGainControl: (e) => this.VoiceStore.SetUseAutoGainControl(e),
GetVoiceLogs: () => this.VoiceStore.GetVoiceLogs(),
});
}
InitInternal(e, t, n = []) {
(this.m_CMInterface = e), (this.m_NotificationManager = t);
(function (e, t, n = !0) {
return (0, i.mG)(this, void 0, void 0, function* () {
const i = performance.now(),
o = [];
yield Promise.all(
t.map(([t, r]) => {
const a = performance.now();
try {
const l = r();
if ((s = l) && "object" == typeof s && "then" in s && "function" == typeof s.then)
return l.then(
() => n && o.push(z(`async ${t}`, i)),
(n) => console.error(`${e} - ${t} - ERROR`, n),
);
n && o.push(z(t, a));
} catch (n) {
console.error(`${e} - ${t} - ERROR`, n);
}
var s;
return null;
}),
),
n && (console.groupCollapsed(z(e, i)), o.forEach((e) => console.log(e)), console.groupEnd());
});
})("FriendsUI ReadyToRender", [["FriendStore", () => this.m_FriendStore.Init(e)], ["ChatStore", () => this.m_ChatStore.Init(e, this.m_VoiceChatStore)], ["Clock Drift", () => this.InitAdjustClockDriftFromServer()], ["VoiceChatStore", () => this.m_VoiceChatStore.Init(e)], ["VRPopupManager", () => this.m_VRPopupManager.Init(e)], ["SettingsStore", () => this.m_SettingsStore.Init(e)], ["AppInfoStore", () => this.m_AppInfoStore.Init(e)], ["UIStore", () => this.m_UIStore.Init()], ["EconomyStore", () => this.m_EconomyStore.Init(e)], ["ParentalStore", () => this.m_ParentalStore.Init(e)], ["BroadcastStore", () => this.m_BroadcastStore.Init(e)], ["RemotePlayStore", () => this.m_RemotePlayStore.Init(e)], ["GroupMemberStore", () => this.m_GroupMemberStore.Init()], ["UserStore", () => this.m_UserStore.Init(e)], ["CookiePreferenceStore", () => (this.m_CookiePreferenceStore = new X._(e))], ...n]).then(
() => {
console.log("Ready To Render promises succeeded"), this.SetReadyToRender();
},
(e) => {
console.error("Ready To Render promise failed: ", e), this.SetReadyToRender();
},
);
}
GetChatRoomBBCodeParser() {
return this.m_ChatRoomBBCodeParser;
}
GetFriendChatBBCodeParser() {
return this.m_FriendChatBBCodeParser;
}
GetNotificationBBCodeParser() {
return this.m_NotificationBBCodeParser;
}
GetChatRoomEffectSettings() {
return this.m_ChatRoomEffectSettings;
}
get CMInterface() {
return this.m_CMInterface;
}
get FriendStore() {
return this.m_FriendStore;
}
get ChatStore() {
return this.m_ChatStore;
}
get VoiceStore() {
return this.m_VoiceChatStore;
}
get VRPopupManager() {
return this.m_VRPopupManager;
}
get UIStore() {
return this.m_UIStore;
}
get SettingsStore() {
return this.m_SettingsStore;
}
get AppInfoStore() {
return this.m_AppInfoStore;
}
get Storage() {
return this.m_Storage;
}
get NotificationManager() {
return this.m_NotificationManager;
}
get EconomyStore() {
return this.m_EconomyStore;
}
get UserStore() {
return this.m_UserStore;
}
get ParentalStore() {
return this.m_ParentalStore;
}
get BroadcastStore() {
return this.m_BroadcastStore;
}
get RemotePlayStore() {
return this.m_RemotePlayStore;
}
get GroupMemberStore() {
return this.m_GroupMemberStore;
}
get CookiePreferenceStore() {
return this.m_CookiePreferenceStore;
}
SetReadyToRender() {
return (0, i.mG)(this, void 0, void 0, function* () {
if (!this.m_bReadyToRender && (console.log(`FriendsUI ready to render after ${performance.now() - de.sm_msStartup}ms`), (this.m_bReadyToRender = !0), yield this.OnReadyToRender(), this.IsLoadedInClientSharedJSContext())) {
let e = { message: "FriendsUIReady", data: o.De.BUILD_TIMESTAMP };
window.parent.postMessage(e, "https://steamloopback.host");
}
});
}
get ready_to_render() {
return this.m_bReadyToRender;
}
GetStartupTime() {
return de.sm_msStartup;
}
ShowFriendChatDialog(e, t, n = !0) {
return this.UIStore.ShowFriendChatDialog(e, t, n, n);
}
GetDefaultBrowserContext() {
return this.m_BrowserContextDefaultTarget;
}
SetDefaultPopupContext(e) {
console.log("Set default popup context: " + e.m_unPID), (this.m_BrowserContextDefaultTarget = e);
}
CreateNewTabFromUniqueID(e, t, n, i) {
let o = t.match(/^f(\d+)$/);
if (o && o[1]) {
let t = parseInt(o[1]),
n = ne.FriendStore.GetPlayer(t);
if (n && !n.is_blocked) {
let o = this.m_ChatStore.GetFriendChat(t);
if (o) {
const r = new u.ub(e, o);
return !i || n.is_friend || ne.FriendStore.BApprovedNonFriendMessages(t) || o.SetShowNonFriendWarning(!0), r;
}
}
}
let r = t.match(/^cg(\d+)$/);
if (r && r[1]) {
let t = this.m_ChatStore.GetChatRoomGroup(r[1]);
if (t) return this.m_ChatStore.IncRefActiveChatRoomGroup(t.GetGroupID(), !n), new W.we(e, t);
}
return null;
}
InitAdjustClockDriftFromServer() {
return (0, i.mG)(this, void 0, void 0, function* () {
return new Promise((e, t) => {
this.m_CMInterface.RunWhenLoggedOn(() =>
(0, i.mG)(this, void 0, void 0, function* () {
try {
yield (0, r.gx)(() => this.m_CMInterface.BPerformedInitialClockAdjustment(), { timeout: 1e3 }), e();
} catch (e) {
console.warn("Timed out waiting for initial server clock drift adjustment"), t();
}
}),
);
});
});
}
GetServerTimeMS() {
return this.m_CMInterface.GetServerTimeMS();
}
GetServerRTime32() {
return this.m_CMInterface.GetServerRTime32();
}
RTime32ToDate(e) {
return this.m_CMInterface.RTime32ToDate(e);
}
GetLocalMidnightInRTime32(e) {
void 0 === de.sm_tzOffset && ((de.sm_tzOffset = 60 * new Date().getTimezoneOffset()), (0, O.X)(de.sm_tzOffset || 0 === de.sm_tzOffset, `Computed invalid timezone offset ${de.sm_tzOffset}`));
let t = de.sm_tzOffset || 0,
n = (e || this.m_CMInterface.GetServerRTime32()) - t;
return 86400 * Math.floor(n / 86400) + t;
}
IsInBeta() {
return o.De.FRIENDSUI_BETA;
}
BIsValidBrowserContext(e) {
return (0, j.n)(e, j.D);
}
ShowCloseActiveVoiceConfirmation(e, t) {}
UpdatePersonaState(e) {}
BShowChatRoomNotification() {
return !!this.IsGamepadUIActive() || this.SettingsStore.FriendsSettings.bNotifications_ShowChatRoomNotification;
}
BPlayChatRoomNotificationSound() {
return !this.IsGamepadUIActive() && this.SettingsStore.FriendsSettings.bSounds_PlayChatRoomNotification;
}
BShowDirectChatNotification() {
return this.SettingsStore.FriendsSettings.bNotifications_ShowMessage;
}
GetCurrentUserStatusInterface() {
return this.m_exportsCurrentUserStatus;
}
GetVoiceInterface() {
return this.m_exportsVoiceInterface;
}
SetEmoticonTrackerCallback(e) {
this.m_ChatStore.EmoticonStore.SetEmoticonTrackerCallback(e);
}
SetStickerTrackerCallback(e) {
this.m_ChatStore.EmoticonStore.SetStickerTrackerCallback(e);
}
StopListening() {}
Reconnect() {
return (0, i.mG)(this, void 0, void 0, function* () {
yield Promise.all([this.CMInterface.Connect(), this.UIStore.RestorePopupState()]);
});
}
}
function he() {
return (0, K.SZ)(() => ne.RemotePlayStore.host);
}
function ue() {
return (
"0" !=
(0, K.SZ)(() => {
var e, t, n;
return null !== (n = null === (t = null === (e = ne.FriendStore.self) || void 0 === e ? void 0 : e.persona) || void 0 === t ? void 0 : t.m_gameid) && void 0 !== n ? n : "0";
})
);
}
(de.sm_msStartup = performance.now()), (0, i.gn)([r.LO], de.prototype, "m_bReadyToRender", void 0), (0, i.gn)([r.Fl], de.prototype, "ready_to_render", null);
},
37035: (e, t, n) => {
"use strict";
n.d(t, { $x: () => _, TN: () => u, r$: () => C });
var i = n(85556),
o = n(9824),
r = n(2049),
a = n(23346),
s = n(72746),
l = n(84290),
c = n(77385),
m = n(10167),
d = n(79588),
h = n(93635);
const u = -1,
p = -2;
class _ {
constructor(e, t, n) {
(this.m_id = e), (this.m_rgMembers = []), (this.m_fnSort = t), (this.m_fnOnUpdate = n);
}
get id() {
return this.m_id;
}
get name() {
return this.m_id == p ? (1 == this.m_rgMembers.length ? (0, l.Xx)("#FriendGroup_InGame") : (0, l.Xx)("#FriendGroup_InGame_Others")) : 0 == this.m_id ? (0, l.Xx)("#Chat_MemberGroup_Online") : this.m_id == u ? (0, l.Xx)("#Chat_MemberGroup_PartyBeacon") : this.m_strName ? this.m_strName : s.Ul.AppInfoStore.GetAppInfo(this.m_id).is_initialized ? ((this.m_strName = s.Ul.AppInfoStore.GetAppInfo(this.m_id).name), this.m_strName) : (s.Ul.AppInfoStore.RegisterCallbackOnLoad(this.OnAppInfoLoaded), "");
}
OnAppInfoLoaded() {
(this.m_strName = s.Ul.AppInfoStore.GetAppInfo(this.m_id).name), this.m_fnOnUpdate();
}
get member_list() {
return this.m_rgMembers;
}
BReadyToDisplay() {
return !this.BIsGameGroup() || !!this.name;
}
BIsGameGroup() {
return this.m_id > 0;
}
ClearMemberList() {
this.m_rgMembers = [];
}
BHasMember(e) {
return this.m_rgMembers.findIndex((t) => t.accountid === e) >= 0;
}
SetMembers(e) {
(this.m_rgMembers = e), this.Sort();
}
SortedInsert(e) {
(0, h.X)(!this.BHasMember(e.accountid), "Double insert into bucket for accountid", e.accountid), o.DG(this.m_rgMembers, e, this.m_fnSort);
}
Remove(e) {
return o.Qf(this.m_rgMembers, (t) => t.accountid === e);
}
Sort() {
this.m_rgMembers.sort(this.m_fnSort);
}
}
(0, i.gn)([r.ak], _.prototype, "OnAppInfoLoaded", null);
class g {
constructor(e, t) {
(this.rgRegistered = []), (this.bFlatList = void 0), (this.mapBuckets = new Map()), (this.nLastUpdate = 0), (this.msSpentSorting = 0), (this.groupSingletons = new _(p, e, t));
}
}
class C {
constructor() {
(this.m_mapGroupBuckets = new Map()), (this.m_mapGroupBeacons = new Map()), (this.m_bShowMembersInGameGroups = void 0), (this.LOG = new c.sO("GroupMemberStore").Debug);
}
Init() {
(this.m_disposePersonaStateChanged = s.Ul.FriendStore.AddPersonaStateChangedCallback(this.OnPersonaStateChanged)),
(this.m_disposePlayerGameChanged = s.Ul.FriendStore.AddPlayerGameChangedCallback(this.OnPlayerGameChanged)),
s.Ul.SettingsStore.RunOnReady(this.ListenForSettingsChanges),
s.Ul.CMInterface.AddOnDisconnectCallback(() => {
this.Reset();
}, 102);
}
ListenForSettingsChanges() {
(this.m_bShowMembersInGameGroups = s.Ul.SettingsStore.FriendsSettings.bCategorizeInGameFriendsByGame),
(0, d.gx)(
() => s.Ul.SettingsStore.FriendsSettings.bCategorizeInGameFriendsByGame !== this.m_bShowMembersInGameGroups,
() => {
this.Reset(), this.ListenForSettingsChanges();
},
);
}
Reset() {
this.m_mapGroupBuckets.forEach((e, t) => {
(e.bFlatList = void 0), this.PerformInitialPopulate(t), this.FireMemberListChanged(e);
});
}
RegisterForGroupMemberList(e, t) {
return (
this.m_mapGroupBuckets.has(t) ||
(this.m_mapGroupBuckets.set(
t,
new g(this.FriendSortFunc, () => {
this.OnGroupUpdate(t);
}),
),
this.PerformInitialPopulate(t)),
this.m_mapGroupBuckets.get(t).rgRegistered.push(e),
{ unregister: () => this.UnregisterForGroupMemberList(e, t) }
);
}
OnGroupUpdate(e) {
let t = this.m_mapGroupBuckets.get(e);
t && this.FireMemberListChanged(t);
}
UnregisterForGroupMemberList(e, t) {
let n = this.m_mapGroupBuckets.get(t);
n && (o.Zf(n.rgRegistered, e), 0 == n.rgRegistered.length && this.m_mapGroupBuckets.delete(t));
}
GroupSortFunc(e, t) {
return t.id == u && e.id != u ? 1 : e.id == u && t.id != u ? -1 : e.id <= 0 && t.id <= 0 ? e.id - t.id : e.id <= 0 && t.id > 0 ? 1 : t.id <= 0 && e.id > 0 ? -1 : t.member_list.length == e.member_list.length && t.name && e.name ? t.name.localeCompare(e.name) : t.member_list.length - e.member_list.length;
}
GetGroupMemberList(e) {
let t = this.m_mapGroupBuckets.get(e);
if (t.bFlatList) return (0, h.X)(1 == t.mapBuckets.size, "Flat list has too many buckets"), [t.mapBuckets.get(0)];
{
let e = [];
return (
t.mapBuckets.forEach((t) => {
t.BReadyToDisplay() && (t.member_list.length > 1 || !this.BucketCanBeSingleton(t)) && e.push(t);
}),
t.groupSingletons.member_list.length > 0 && (t.groupSingletons.Sort(), e.push(t.groupSingletons)),
e.sort(this.GroupSortFunc)
);
}
}
SetGroupListFlat(e, t) {
let n = this.m_mapGroupBuckets.get(e);
n && n.bFlatList != t && ((n.bFlatList = t), this.PerformInitialPopulate(e), this.FireMemberListChanged(n));
}
ScheduledFireMemberListChanged(e) {
(e.hDelayUpdate = void 0), this.FireMemberListChanged(e);
}
FireMemberListChanged(e) {
if (e.hDelayUpdate) return;
let t = performance.now();
if (t - e.nLastUpdate < 1e3) return (e.hDelayUpdate = SetBackgroundTimeout(() => this.ScheduledFireMemberListChanged(e), 1e3)), void this.LOG("DELAY UPDATE");
e.nLastUpdate = t;
for (let t of e.rgRegistered) t();
}
OnPlayerGameChanged(e, t, n) {
this.m_mapGroupBuckets.forEach((i, o) => {
let r = s.Ul.ChatStore.GetChatRoomGroup(o);
if (!r.GetMemberPartyBeacon(e) && r.BHasMember(e)) {
let r = s.Ul.FriendStore.GetPlayer(e);
if ((r.is_appinfo_ready(), this.LOG("OnPlayerGameChanged", r.display_name, t, n), i.bFlatList)) return i.mapBuckets.get(0).Remove(e), i.mapBuckets.get(0).SortedInsert(s.Ul.FriendStore.GetPlayer(e)), void this.FireMemberListChanged(i);
if (t == n) {
let t = n == m.v5 ? i.groupSingletons : i.mapBuckets.get(n);
if (t && t.BHasMember(e)) return void this.UpdatePersonaForGroup(o, r);
}
this.RemoveMemberFromBucket(i, t, e), this.AddMemberToBucketID(i, n, s.Ul.FriendStore.GetPlayer(e)), this.FireMemberListChanged(i);
}
});
}
OnPersonaStateChanged(e) {
this.m_mapGroupBuckets.forEach((t, n) => {
let i = s.Ul.ChatStore.GetChatRoomGroup(n);
if (i.BHasMember(e.accountid)) {
if ((this.LOG("CGroupMemberStore - persona state", n, e.display_name), t.bReSortPending)) return this.LOG(e.display_name, "not ready"), void e.is_appinfo_ready();
e.is_appinfo_ready() ? this.UpdatePersonaForGroup(i.GetGroupID(), e) : (this.LOG(`Delay sorting player ${e.accountid}`), s.Ul.AppInfoStore.RegisterCallbackOnLoad(this.UpdatePersonaForGroup.bind(this, n, e)));
}
});
}
UpdatePersonaForGroup(e, t) {
let n = this.m_mapGroupBuckets.get(e);
if (!n) return;
let i = performance.now(),
o = !1;
if (n.bFlatList) (0, h.X)(1 == n.mapBuckets.size, "Flat map is too large"), n.mapBuckets.get(0).Remove(t.accountid), n.mapBuckets.get(0).SortedInsert(t), (o = !0);
else {
let e = this.FindCurrentBucketForMember(n, t.accountid);
if (void 0 !== e) {
let i;
e == p ? (i = n.groupSingletons) : ((i = n.mapBuckets.get(e)), 1 == i.member_list.length && this.BucketCanBeSingleton(i) && (i = n.groupSingletons)), (i.member_list.length > 1 || !this.BucketCanBeSingleton(i)) && (this.LOG("Resorting user", t.display_name, "in bucket", e), i.Remove(t.accountid), i.SortedInsert(t), (o = !0));
}
}
let r = performance.now();
(n.msSpentSorting += r - i), this.LOG(`${e}: Resort user ${t.display_name} took ${r - i}ms (total ${n.msSpentSorting}ms)`), o && this.FireMemberListChanged(n);
}
OnPartyBeaconsUpdated(e, t) {
this.m_mapGroupBeacons.set(e, t);
let n = this.m_mapGroupBuckets.get(e),
i = [],
o = !1;
if (!n) return;
for (let e of t) {
i.push(e.account_id);
let t = this.FindCurrentBucketForMember(n, e.account_id);
if (t == u) continue;
let r = s.Ul.FriendStore.GetPlayer(e.account_id);
r.is_appinfo_ready(), (o = !0), this.RemoveMemberFromBucket(n, t, e.account_id), this.AddMemberToBucketID(n, u, r);
}
let r = n.mapBuckets.get(u);
if (r)
for (let t of r.member_list)
if (-1 == i.indexOf(t.accountid)) {
o = !0;
let i = this.GetBucketIdForPlayer(n, t, e);
this.RemoveMemberFromBucket(n, u, t.accountid), this.AddMemberToBucketID(n, i, t);
}
o && this.ReSortGroup(e);
}
ReSortGroup(e) {
let t = this.m_mapGroupBuckets.get(e);
if (t) {
if (t.bFlatList) {
(0, h.X)(1 == t.mapBuckets.size, "Flat list has too many buckets");
let n = performance.now(),
i = t.mapBuckets.get(0);
i.Sort();
let o = performance.now();
(t.msSpentSorting += o - n), this.LOG(`${e}: List ReSort took ${o - n}ms (total ${t.msSpentSorting}ms) for ${i.member_list.length} members`);
} else t.mapBuckets.get(0).Sort(), t.groupSingletons.Sort();
(t.bReSortPending = !1), this.FireMemberListChanged(t);
}
}
FriendSortFunc(e, t) {
let n = a.Xp.FriendSortStatusComparator(e, t);
if (0 != n) return n;
if (e.persona.is_ingame && t.persona.is_ingame) {
if (e.persona.is_in_nonsteam_game) {
if (!t.persona.is_in_nonsteam_game) return 1;
} else if (t.persona.is_in_nonsteam_game) return -1;
const n = e.current_game_name,
i = t.current_game_name;
if (n) {
if (!i) return -1;
if (n != i) return n < i ? -1 : 1;
} else if (i) return 1;
}
return e.display_name.localeCompare(t.display_name);
}
PerformInitialPopulate(e) {
let t = this.m_mapGroupBuckets.get(e);
t.mapBuckets.clear(), t.groupSingletons.ClearMemberList(), (0, h.X)(t, "PerformInitialPopulate didn't find group");
let n = performance.now(),
i = s.Ul.ChatStore.GetChatRoomGroup(e).memberList.member_list_unsorted.slice();
if ((void 0 === t.bFlatList && (t.bFlatList = i.length > 100 || !s.Ul.SettingsStore.FriendsSettings.bCategorizeInGameFriendsByGame), t.bFlatList)) {
i.forEach((e) => {
e.is_appinfo_ready();
});
let e = new _(0, this.FriendSortFunc, () => {
this.FireMemberListChanged(t);
});
e.SetMembers(i), t.mapBuckets.set(0, e);
} else
for (let n of i) {
let i = this.GetBucketIdForPlayer(t, n, e);
this.AddMemberToBucketID(t, i, n);
}
s.Ul.AppInfoStore.BHavePendingAppInfoRequests() && ((t.bReSortPending = !0), s.Ul.AppInfoStore.RegisterCallbackOnLoad(this.ReSortGroup.bind(this, e)));
let o = performance.now();
(t.msSpentSorting += o - n), this.LOG(`List sort took ${o - n} ms for ${i.length} members of group ${e}`);
}
FindCurrentBucketForMember(e, t) {
let n;
return (
e.mapBuckets.forEach((e) => {
e.BHasMember(t) && (n = e.id);
}),
void 0 !== n ? n : e.groupSingletons.BHasMember(t) ? p : void 0
);
}
BIsMemberInAnyBucket(e, t) {
return void 0 !== this.FindCurrentBucketForMember(e, t);
}
AddMemberToBucketID(e, t, n) {
if (((0, h.X)(!this.BIsMemberInAnyBucket(e, n.accountid), "Trying to double add accountid", n.accountid, "which is already in bucket", this.FindCurrentBucketForMember(e, n.accountid)), (0, h.X)(!e.bFlatList || 0 == t, "Trying to add to non-default bucket in flat list"), t != p))
if (e.mapBuckets.has(t)) {
if (!e.bFlatList) {
let n = e.mapBuckets.get(t);
1 == n.member_list.length && this.BucketCanBeSingleton(n) && this.RemoveFromSingletons(e, n.member_list[0].accountid);
}
e.mapBuckets.get(t).SortedInsert(n);
} else {
let i = new _(t, this.FriendSortFunc, () => {
this.FireMemberListChanged(e);
});
i.SortedInsert(n), e.mapBuckets.set(t, i), !e.bFlatList && this.BucketCanBeSingleton(i) && this.AddToSingletons(e, n);
}
else this.AddToSingletons(e, n);
}
BucketCanBeSingleton(e) {
return e.id != u && 0 != e.id;
}
AddToSingletons(e, t) {
(0, h.X)(!e.bFlatList, "Adding to singletons in flat list"), e.groupSingletons.SortedInsert(t);
}
RemoveFromSingletons(e, t) {
return (0, h.X)(!e.bFlatList, "Removing from singletons in flat list"), e.groupSingletons.Remove(t);
}
GetBucketIdForPlayer(e, t, n) {
if (e.bFlatList) return 0;
let i = this.m_mapGroupBeacons.get(n);
if (i) {
if (
i.find(function (e) {
return e.account_id == t.accountid;
})
)
return u;
}
if (t.persona.is_ingame) {
if (t.persona.is_in_nonsteam_game) return p;
return t.persona.m_unGamePlayedAppID;
}
return t.persona.m_broadcastAppId ? t.persona.m_broadcastAppId : 0;
}
RemoveMemberFromBucket(e, t, n) {
if (t == p) return this.RemoveFromSingletons(e, n), !0;
let i = e.mapBuckets.get(t);
return !(!i || !i.Remove(n)) && (0 == i.member_list.length ? (this.RemoveFromSingletons(e, n), this.LOG("Deleting bucket", t), e.mapBuckets.delete(t)) : 1 == i.member_list.length && !e.bFlatList && this.BucketCanBeSingleton(i) && (this.LOG("Removing member, adding", i.member_list[0].accountid, "to singletons"), this.AddToSingletons(e, i.member_list[0])), !0);
}
AddUserAndFireCallback(e, t, n) {
let i = s.Ul.FriendStore.GetPlayer(t),
o = this.GetBucketIdForPlayer(e, i, n);
this.AddMemberToBucketID(e, o, i), this.FireMemberListChanged(e);
}
OnMemberAdded(e, t) {
let n = this.m_mapGroupBuckets.get(e);
n && this.AddUserAndFireCallback(n, t, e);
}
OnMemberRemoved(e, t) {
let n = this.m_mapGroupBuckets.get(e);
if (n) {
for (let e of Array.from(n.mapBuckets.keys())) if (this.RemoveMemberFromBucket(n, e, t)) return void this.FireMemberListChanged(n);
this.RemoveMemberFromBucket(n, p, t) && this.FireMemberListChanged(n);
}
}
}
(0, i.gn)([r.ak], C.prototype, "ListenForSettingsChanges", null), (0, i.gn)([r.ak], C.prototype, "OnPlayerGameChanged", null), (0, i.gn)([r.ak], C.prototype, "OnPersonaStateChanged", null), (0, i.gn)([r.ak], C.prototype, "OnPartyBeaconsUpdated", null);
},
24292: (e, t, n) => {
"use strict";
n.d(t, { NX: () => _, rO: () => g, x5: () => p });
var i = n(85556),
o = n(19411),
r = n(27378),
a = n(79588),
s = n(19953),
l = n(90729),
c = n(2049),
m = n(13106),
d = n(9824),
h = n(37234),
u = n(72746);
class p {
constructor() {
this.m_mapHovers = new WeakMap();
}
GetHover(e) {
let t = this.m_mapHovers.get(e);
return t || ((t = new g(e)), this.m_mapHovers.set(e, t)), t;
}
}
class _ {
constructor() {
(this.visible = void 0), (0, a.rC)(this);
}
}
(0, i.gn)([a.LO], _.prototype, "visible", void 0);
class g {
constructor(e) {
this.m_friend = e;
}
get friend() {
return this.m_friend;
}
get persona() {
return this.m_friend.persona;
}
GetInstance(e, t = !1) {
if (this.m_rgInstances) for (let t of this.m_rgInstances) if (t.m_OwningElement == e) return t;
if (t) {
let t = new _();
return (t.m_OwningElement = e), (t.visible = !1), (t.hover = this), this.m_rgInstances ? this.m_rgInstances.push(t) : (this.m_rgInstances = [t]), t;
}
return null;
}
ShowPopup(e, t, n) {
(t.visible = !0),
t.m_OwningElement.ownerDocument.defaultView.setTimeout(() => {
t.visible && (t.popupWindow || (t.popupWindow = new o.zd(e, t, n)), t.popupWindow.Show());
}, 250),
(t.m_BlurHandler = () => {
this.HideByElement(t.m_OwningElement);
}),
t.m_OwningElement.ownerDocument.defaultView.addEventListener("blur", t.m_BlurHandler),
(t.m_VisibilityHandler = (e) => {
"hidden" === e.target.visibilityState && this.HideByElement(t.m_OwningElement);
}),
t.m_OwningElement.ownerDocument.addEventListener("visibilitychange", t.m_VisibilityHandler);
}
Show(e, t, n) {
let i = e.currentTarget.ownerDocument.defaultView.innerWidth < 500;
if (i && !s.De.IN_CLIENT) return;
if (h.g_FriendsUIDesktopApp.DragDropManager.BInDrag()) return;
this.friend.miniProfileData.EnsureCommunityDataLoaded();
let a = e.currentTarget,
l = (0, h.Um)(null, e),
c = this.GetInstance(a, !0);
c.context = t;
let m = !1;
if (s.De.IN_CLIENT) {
let e = u.Ul.UIStore.GetPerContextChatData(l);
m = e.BUsePopups();
}
if (i && m) this.ShowPopup(a, c, l);
else {
let e = r.createElement(o.yd, {
hoverInstance: c,
target: a,
direction: n,
onNoSpace: () => {
m && this.ShowPopup(a, c, l);
},
});
g.m_embeddedElements.ShowElementDelayed(a.ownerDocument, 250, e, c).then(() => {
c.visible = !0;
});
}
}
Hide(e) {
this.HideByElement(e.currentTarget);
}
HideByElement(e) {
let t = this.GetInstance(e);
if (t) {
if (((t.visible = !1), t.m_BlurHandler && (e.ownerDocument.defaultView.removeEventListener("blur", t.m_BlurHandler), (t.m_BlurHandler = null)), t.m_VisibilityHandler && (e.ownerDocument.removeEventListener("visibilitychange", t.m_VisibilityHandler), (t.m_VisibilityHandler = null)), t.popupWindow && !t.popupWindow.BIsClosed())) {
let n = t.popupWindow,
i = () => {
n.BIsClosed() || n.Close();
};
e.ownerDocument.defaultView.addEventListener("unload", i),
e.ownerDocument.defaultView.setTimeout(() => {
e.ownerDocument.defaultView.removeEventListener("unload", i), i();
}, 100);
} else g.m_embeddedElements.HideElement(t.m_OwningElement.ownerDocument, t, 500);
d.Zf(this.m_rgInstances, t);
}
}
OnContextMenu(e, t) {
let n = (0, m.$W)((0, h.Um)(null, t), e, this.m_friend, t);
return this.Hide(t), n;
}
HideAllInstances() {
if (this.m_rgInstances) for (let e of this.m_rgInstances.slice()) this.HideByElement(e.m_OwningElement);
}
get data_loader() {
return this.m_friend.miniProfileData;
}
}
(g.m_embeddedElements = new l.AN("CFriendHoverContainer")), (0, i.gn)([c.ak], g.prototype, "Show", null), (0, i.gn)([c.ak], g.prototype, "Hide", null), (0, i.gn)([c.ak], g.prototype, "OnContextMenu", null);
},
96119: (e, t, n) => {
"use strict";
n.d(t, { r0: () => I, lV: () => b, ou: () => v, yf: () => S });
var i = n(85556),
o = n(19953),
r = n(72746),
a = n(79588),
s = n(57476),
l = n(9824),
c = n(84290);
let m = 0;
class d {
constructor(e) {
(this.m_id = void 0), (this.m_vecTabs = a.LO.array(null, { deep: !1 })), (this.m_activeTab = void 0), (0, a.rC)(this), (this.m_id = m++), (this.m_browserContext = e), (this.m_activeTab = void 0);
}
GetBrowserContext() {
return this.m_browserContext;
}
GetTitle() {
return this.m_activeTab ? (2 == this.tabCount ? (0, c.Xx)("#WindowTitle_ChatTabTitle", this.m_activeTab.GetTabName()) : this.tabCount > 2 ? (0, c.Xx)("#WindowTitle_ChatTabTitlePlural", this.m_activeTab.GetTabName(), this.tabCount - 1) : this.m_activeTab.GetTabName()) : "";
}
OnWindowFocus() {
this.m_activeTab && this.m_activeTab.OnTabFocus();
}
FocusActiveTab() {
this.m_activeTab && this.m_activeTab.OnTabFocus();
}
get tabs() {
return this.m_vecTabs;
}
get tabCount() {
return this.m_vecTabs.length;
}
get activeTab() {
return this.m_activeTab;
}
GetTabSetIdentifier() {
return this.m_vecTabs.map((e) => e.GetUniqueID()).join("_");
}
GetTabForChat(e) {
for (let t of this.m_vecTabs) if (t.IsTabForChat(e)) return t;
return null;
}
GetTabByUniqueID(e) {
for (let t of this.m_vecTabs) if (t.GetUniqueID() == e) return t;
return null;
}
BHasTab(e) {
return -1 !== this.m_vecTabs.indexOf(e);
}
AddTab(e) {
-1 == this.m_vecTabs.indexOf(e) && (this.m_vecTabs.push(e), !this.m_activeTab && this.m_vecTabs.length > 0 && (this.m_activeTab = this.m_vecTabs[0]));
}
ActivateTab(e) {
-1 != this.m_vecTabs.indexOf(e) ? (this.activeTab && this.activeTab != e && this.activeTab.OnTabDeactivate(), (this.m_activeTab = e), e.OnTabActivate(), this.Focus(), (0, s.U5)("Messaging.RegisterForMessages") && SteamClient.Messaging.PostMessage("FriendsUI", "ChatTabActivated", JSON.stringify({ id: e.GetUniqueID() }))) : console.log("Tab not found");
}
ActivateNextTab() {
let e = this.m_vecTabs.indexOf(this.m_activeTab);
(e = (e + 1) % this.m_vecTabs.length), this.ActivateTab(this.m_vecTabs[e]);
}
ActivatePreviousTab() {
let e = this.m_vecTabs.indexOf(this.m_activeTab);
(e = (e + this.m_vecTabs.length - 1) % this.m_vecTabs.length), this.ActivateTab(this.m_vecTabs[e]);
}
DeactivateTab(e) {
-1 !== this.m_vecTabs.indexOf(e) ? this.activeTab && this.activeTab === e && (e.OnTabDeactivate(), (this.m_activeTab = void 0)) : console.log("Tab not found");
}
RemoveTab(e) {
let t = this.m_vecTabs.indexOf(e);
if (-1 == t) return !1;
let n = e && e == this.m_activeTab;
if ((this.m_vecTabs.splice(t, 1), n))
if (this.m_vecTabs.length) {
let e;
for (let t of this.m_vecTabs) (!e || t.GetTimeLastActivate() > e.GetTimeLastActivate()) && (e = t);
this.m_activeTab = e || this.m_vecTabs[Math.max(t - 1, 0)];
} else this.m_activeTab = void 0;
return 0 == this.m_vecTabs.length && r.Ul.UIStore.CloseTabSet(this), !0;
}
MoveTabAfter(e, t) {
let n = this.m_vecTabs.indexOf(t);
-1 != n && this.MoveTabToIndex(e, n + 1);
}
MoveTabToIndex(e, t) {
let n = this.m_vecTabs.indexOf(e);
-1 != n && l.hV(this.m_vecTabs, n, Math.min(t, this.m_vecTabs.length - 1));
}
Focus() {
r.Ul.UIStore.FocusTabSet(this);
}
OnPopupClosed(e) {
e && r.Ul.UIStore.SetSuppressBrowserContextBroadcasting(!0), this.CloseAllTabs(), r.Ul.UIStore.OnTabSetClosed(this), e && r.Ul.UIStore.SetSuppressBrowserContextBroadcasting(!1);
}
CloseAllTabs() {
this.m_activeTab = void 0;
for (let e of this.m_vecTabs) r.Ul.UIStore.CloseTab(this.m_browserContext, e, !0);
this.m_vecTabs.clear();
}
get is_popup_active() {
return r.Ul.UIStore.BIsTabSetActive(this);
}
get is_popup_visible() {
return r.Ul.UIStore.BIsTabSetVisible(this);
}
get is_popup_focused() {
return r.Ul.UIStore.BIsTabSetFocused(this);
}
Serialize() {
let e = [];
for (let t of this.m_vecTabs) {
t.GetUniqueID().startsWith("br") || e.push(t.GetUniqueID());
}
return { tabs: e, active_tab: this.activeTab && this.activeTab.GetUniqueID() };
}
}
(0, i.gn)([a.LO], d.prototype, "m_id", void 0), (0, i.gn)([a.LO], d.prototype, "m_activeTab", void 0), (0, i.gn)([a.aD], d.prototype, "AddTab", null), (0, i.gn)([a.aD], d.prototype, "ActivateTab", null), (0, i.gn)([a.aD], d.prototype, "ActivateNextTab", null), (0, i.gn)([a.aD], d.prototype, "ActivatePreviousTab", null), (0, i.gn)([a.aD], d.prototype, "DeactivateTab", null), (0, i.gn)([a.aD], d.prototype, "RemoveTab", null), (0, i.gn)([a.aD], d.prototype, "OnPopupClosed", null), (0, i.gn)([a.aD], d.prototype, "CloseAllTabs", null);
var h = n(84446),
u = n(34294),
p = n(93635),
_ = n(22394),
g = n(2049),
C = n(10553);
const f = "ChatStorePopupState";
var v, S;
!(function (e) {
(e[(e.Favorites = 0)] = "Favorites"), (e[(e.FriendsList = 1)] = "FriendsList"), (e[(e.GroupChats = 2)] = "GroupChats"), (e[(e.RecentMessages = 3)] = "RecentMessages"), (e[(e.FirstTab = 0)] = "FirstTab"), (e[(e.MaxTab = 3)] = "MaxTab");
})(v || (v = {}));
class b {
GetRootChatPerContextData() {
return this.GetPerContextChatData(r.D);
}
constructor(e) {
(this.m_bRestoredPopupState = !1), (this.m_vecShowGroupsAfterRestorePopup = []), (this.m_iLastChatPopupID = 0), (this.m_mapChatBrowserContexts = new Map()), (this.m_bSuppressBrowserContextBroadcasting = !1), (this.m_bParentalLocked = void 0), (this.m_stateToRestoreFrom = void 0), (this.m_bRestoringPopups = !1), (this.m_bShuttingDown = !1), (this.m_bTheaterMode = !1), (this.m_mapFriendChatBroadcastVisible = new Map()), (this.m_nTabActivationCount = 0), (this.m_bShowWinterSaleUI = !1), (this.m_eFriendsListSteamDeckActiveTab = v.FriendsList), (this.m_FriendsListSteamDeckActiveTabCallbackList = new _.pB()), (this.m_overlayCreatedCallbackList = new _.pB()), (0, a.rC)(this), (this.m_chatStore = e);
}
Init() {
r.Ul.AddPopupManagerShutdownCallback(() => {
this.SerializePopupState(), (this.m_bShuttingDown = !0);
}),
(0, a.EH)(() => {
let e = r.Ul.ParentalStore.BIsFriendsBlocked() || r.Ul.SettingsStore.IsSteamInTournamentMode();
this.OnFriendsParentalLockChanged(e);
}),
this.StartWinterSaleCountdown();
}
OnFriendsParentalLockChanged(e) {
!1 === this.m_bParentalLocked && e
? (this.SerializePopupState(!0),
this.m_mapChatBrowserContexts.forEach((e) => {
e.CloseAllPopups();
}),
(this.m_bRestoredPopupState = !1))
: !0 !== this.m_bParentalLocked || e || this.RestorePopupState(),
(this.m_bParentalLocked = e);
}
ShowFriendChatDialog(e, t, n = !0, i = !0) {
let o = this.m_chatStore.GetFriendChat(t);
return n && o && this.ShowAndOrActivateChat(e, o, i), o;
}
ShowFriendChatDialogWhenReady(e, t, n = !0, i = !0) {
this.ShowFriendChatDialog(e, t, n, i);
}
ShowFriendChatDialogAndStartVoice(e, t) {
let n = this.ShowFriendChatDialog(e, t, !0, !0);
return n.BVoiceActive() || n.ToggleVoiceChat(), n;
}
ShowAndOrActivateChat(e, t, n) {
if (t instanceof h.K) {
let i = this.m_chatStore.GetChatRoomGroup(t.GetParentGroupID());
if (!i) return (0, p.X)(!1, "Can't find group for chat room "), null;
let o = this.ShowAndOrActivateChatRoomGroup(e, i, n);
return o && o.SelectChat(t.GetRoomID()), o;
}
let i = this.ShowAndOrActivateTabByID(e, t.unique_id, n);
return null == i ? void 0 : i.GetChatView();
}
ShowAndOrActivateChatForTabset(e, t, n) {
let i = e.GetTabForChat(t);
i || this.CreateNewTabFromUniqueID(e, t.unique_id, !1), n && e.ActivateTab(i);
}
IsChatRoomGroupActive(e, t) {
let n = this.GetPerContextChatData(e),
i = this.GetTabSetByUniqueID(n, t.unique_id);
return !!i && i.tabSet.activeTab == i.tab;
}
SetTheaterMode(e) {
this.m_bTheaterMode = e;
}
GetTheaterMode() {
return this.m_bTheaterMode;
}
SetFriendBroadcastVisible(e, t) {
this.m_mapFriendChatBroadcastVisible.set(e, t);
}
IsFriendBroadcastVisible(e) {
return this.m_mapFriendChatBroadcastVisible.get(e);
}
ShowAndOrActivateChatRoomGroup(e, t, n) {
return t.BIsCurrentUserAMember() ? this.ShowAndOrActivateTabByID(e, t.unique_id, n) : (console.log("Failed to activate", t, "- user is not a member."), null);
}
ShowAndOrActivateChatRoomGroupWhenReady(e, t, n) {
this.ShowAndOrActivateChatRoomGroup(e, t, n);
}
ShowUnackedGroup(e) {
var t;
this.m_bRestoredPopupState ? this.ShowAndOrActivateChatRoomGroup(null !== (t = null === r.Ul || void 0 === r.Ul ? void 0 : r.Ul.GetDefaultBrowserContext()) && void 0 !== t ? t : r.D, e, !1) : this.m_vecShowGroupsAfterRestorePopup.push(e);
}
ShowOrActivateBroadcast(e, t, n) {
let i = "br" + t;
return this.ShowAndOrActivateTabByID(e, i, n);
}
CloseTabByID(e, t) {
t
? this.CloseTabByIDInContext(t, e)
: this.m_mapChatBrowserContexts.forEach((t) => {
this.CloseTabByIDInContext(t.browser_context, e);
});
}
ReplaceFriendChatWithGroup(e, t, n) {
let i = this.GetPerContextChatData(e),
o = this.GetTabSetByUniqueID(i, n.unique_id);
o || (this.ShowAndOrActivateChatRoomGroup(e, n, !0), (o = this.GetTabSetByUniqueID(i, n.unique_id))), (0, p.X)(o, "Failed to find group tab");
let r = this.GetTabSetByUniqueID(i, t.chat.unique_id);
if (!r) return;
let a = o.tab,
s = r.tabSet;
o.tabSet != s && (o.tabSet.RemoveTab(a), s.AddTab(a)), s.MoveTabAfter(a, t), this.CloseTab(e, t), this.ShowAndOrActivateChatRoomGroup(e, n, !0);
}
ForEachTabSet(e, t) {
e.IsFriendsListSingleWindow() && e.default_tabset.tabCount > 0 && t(e.default_tabset);
for (let n of Array.from(e.popup_list)) t(n.tab_set);
}
CloseTab(e, t, n = !1) {
let i = this.GetPerContextChatData(e);
this.ForEachTabSet(i, (o) => {
o.BHasTab(t) && (n || o.RemoveTab(t), t.IsVoiceActive() && r.Ul.ShowCloseActiveVoiceConfirmation(e, i.GetPopupForTabSet(o)));
}),
this.BroadcastCloseTabToAllBrowserContexts(e, t.GetUniqueID()),
t.OnTabClosed(),
i.IsFriendsListSingleWindow() && 0 == i.default_tabset.tabCount && (i.responsive_window_state.SetActiveView(S.FriendsList), this.SetTheaterMode(!1), i.SetFriendsListCollapsed(!1)),
r.Ul.UIStore.SerializePopupState();
}
GetResponsiveWindowState(e) {
return this.GetPerContextChatData(e).responsive_window_state;
}
CloseTabByIDInContext(e, t) {
let n = this.GetPerContextChatData(e),
i = this.GetTabSetByUniqueID(n, t);
i && (i.tabSet.RemoveTab(i.tab), i.tab.OnTabClosed(), this.BroadcastCloseTabToAllBrowserContexts(e, t));
}
ShowAndOrActivateTabByID(e, t, n = !0) {
let i,
o = this.GetPerContextChatData(e),
a = this.GetTabSetByUniqueID(o, t);
if (a) n && a.tabSet.ActivateTab(a.tab), (i = a.tab);
else {
let a = r.Ul.SettingsStore.BAlwaysShowChatsInNewWindow();
if (!o.BUsePopups() || (!a && o.default_tabset.is_popup_active)) i = this.CreateNewTabFromUniqueID(o.default_tabset, t, n);
else {
let s;
if (((s = a && 0 != o.default_tabset.tabCount ? new d(e) : o.default_tabset), (i = this.CreateNewTabFromUniqueID(s, t, n)), !i)) return null;
let l = s == o.default_tabset;
if (l && o.IsFriendsListSingleWindow()) r.Ul.ShowPopupFriendsList(e, !n, n);
else if (!l || (!o.IsFriendsListSingleWindow() && !s.is_popup_active)) {
const t = !(0, C.Uy)() && !n;
let i = r.Ul.CreateChatPopup(e, this.GetNextChatPopupID(), s, void 0, void 0, t);
i.Show(n), o.AddPopup(s, i), this.SerializePopupState();
}
}
}
return i && n && o.responsive_window_state.SetActiveView(S.Chat), r.Ul.UIStore.SerializePopupState(), n && this.m_nTabActivationCount++, i;
}
GetTabSetByUniqueID(e, t) {
if (!e) return null;
let n = e.GetTabSetForId(t);
return n ? { tabSet: n, tab: n.GetTabByUniqueID(t) } : null;
}
BIsTabSetActive(e) {
let t = this.GetPerContextChatData(e.GetBrowserContext());
if (t) return t.BIsTabSetActive(e);
}
BIsTabSetVisible(e) {
let t = this.GetPerContextChatData(e.GetBrowserContext());
if (t) return t.BIsTabSetVisible(e);
}
BIsTabSetFocused(e) {
let t = this.GetPerContextChatData(e.GetBrowserContext());
if (t) return t.BIsTabSetFocused(e);
}
GetAppContainerForChat(e) {
let t = this.GetRootChatPerContextData(),
n = null;
if (e instanceof h.K) {
let i = this.m_chatStore.GetChatRoomGroup(e.GetParentGroupID());
i && (n = this.GetTabSetByUniqueID(t, i.unique_id));
} else n = this.GetTabSetByUniqueID(t, e.unique_id);
if (!n || !n.tabSet) return null;
let i = t.GetPopupForTabSet(n.tabSet);
return i ? (i.popup ? i.popup.container : null) : t.IsTabSetInFriendListWindow(n.tabSet) ? t.friends_list_window : null;
}
FlashChatWindow(e, t) {
let n = this.GetAppContainerForChat(e);
n && !n.BIsClosed() && n.FlashWindow(t);
}
IsChatWindowMinimized(e) {
let t = this.GetAppContainerForChat(e);
return !t || t.BIsClosed() ? Promise.resolve(!1) : t.IsMinimized();
}
GetContextKey(e) {
return (0, r.ns)(e, r.D) && 4 !== e.m_eUIMode ? "ROOT" : `${e.m_unPID}/${e.m_eUIMode}`;
}
GetPerContextChatData(e) {
(0, p.X)(r.Ul.ready_to_render || this.m_bRestoringPopups, "GetPerContextChatData called before ready", e);
const t = this.GetContextKey(e);
let n = this.m_mapChatBrowserContexts.get(t);
if (!n) {
let i = r.Ul.BIsValidBrowserContext(e);
(n = new E(e)), i && ((0, p.X)(0 == e.m_unPID || void 0 !== e.m_eUIMode, "GetPerContextChatData - creating context for browser where uimode is undefined! This can cause problems in other places!"), this.m_mapChatBrowserContexts.set(t, n));
}
return n;
}
BHasPerContextChatData(e) {
const t = this.GetContextKey(e);
return this.m_mapChatBrowserContexts.has(t);
}
GetAllBrowserContexts() {
let e = [];
return this.m_mapChatBrowserContexts.forEach((t) => e.push(t.browser_context)), e;
}
GetDefaultTabSetForContext(e) {
return this.GetPerContextChatData(e).default_tabset;
}
OnOverlayBrowserCreated(e, t, n) {
this.m_overlayCreatedCallbackList.Dispatch(e);
let i = this.GetPerContextChatData(e);
if (!i) return;
i.SetScreenInfo(t, n), i.SetFriendsListSingleWindowMode(r.Ul.SettingsStore.BSingleWindowModeEnabled());
let o = this.GetRootChatPerContextData();
o &&
(i.IsFriendsListSingleWindow() ||
this.ForEachTabSet(o, (e) => {
let t = new d(i.browser_context);
e.tabs.forEach((n) => {
let i = e.activeTab == n;
this.CreateNewTabFromUniqueID(t, n.GetUniqueID(), i);
});
let n = r.Ul.CreateChatPopup(i.browser_context, this.GetNextChatPopupID(), t, void 0, void 0, !1);
n.Show(!1), i.AddPopup(t, n);
}));
}
RegisterForOverlayCreated(e) {
const { Unregister: t } = this.m_overlayCreatedCallbackList.Register(e);
return t;
}
OnOverlayBrowserChanged(e, t, n) {
var i;
const o = Object.assign(Object.assign({}, e), { m_eUIMode: null !== (i = e.m_eUIMode) && void 0 !== i ? i : r.Ul.IsGamepadUIActive() ? 4 : 0 });
let a = this.GetPerContextChatData(o);
a && a.SetScreenInfo(t, n);
}
OnOverlayBrowserClosed(e) {
let t = this.GetPerContextChatData(e);
if (!t) return;
(0, p.X)(e.m_nBrowserID == t.browser_context.m_nBrowserID, "Mismatch found in OnOverlayBrowserClosed");
const n = this.GetContextKey(e);
if ((this.m_mapChatBrowserContexts.delete(n), e.m_unPID)) for (const t of this.m_mapChatBrowserContexts.keys()) t.startsWith(e.m_unPID.toString()) && this.m_mapChatBrowserContexts.delete(t);
}
BShouldSuppressBrowserContextBroadcasting(e) {
return !!o.De.IN_CHROMEOS || !!this.m_bSuppressBrowserContextBroadcasting || !this.BHasPerContextChatData(e);
}
SetSuppressBrowserContextBroadcasting(e) {
this.m_bSuppressBrowserContextBroadcasting = e;
}
BroadcastNewTabToAllBrowserContexts(e, t) {
this.BShouldSuppressBrowserContextBroadcasting(e) ||
(this.SetSuppressBrowserContextBroadcasting(!0),
this.m_mapChatBrowserContexts.forEach((n) => {
if ((0, r.ns)(n.browser_context, e)) return;
if (4 == e.m_eUIMode && n.browser_context.m_eUIMode !== e.m_eUIMode) return;
let i = !(0, r.ns)(n.browser_context, r.D);
this.ShowAndOrActivateTabByID(n.browser_context, t, i);
}),
this.SetSuppressBrowserContextBroadcasting(!1));
}
BroadcastCloseTabToAllBrowserContexts(e, t) {
if (this.BShouldSuppressBrowserContextBroadcasting(e)) return;
if ((0, r.ns)(e, r.D)) return void this.BroadcastCloseTabToAllBrowserContexts_Internal(e, t);
let n = this.GetPerContextChatData(e);
n && (0, r.ns)(e, n.browser_context) && this.BroadcastCloseTabToAllBrowserContexts_Internal(e, t);
}
BroadcastCloseTabToAllBrowserContexts_Internal(e, t) {
this.BShouldSuppressBrowserContextBroadcasting(e) ||
(this.SetSuppressBrowserContextBroadcasting(!0),
this.m_mapChatBrowserContexts.forEach((n) => {
(0, r.ns)(n.browser_context, e) || this.CloseTabByIDInContext(n.browser_context, t);
}),
this.SetSuppressBrowserContextBroadcasting(!1));
}
CreateNewTabFromUniqueID(e, t, n, i = !1) {
let o = r.Ul.CreateNewTabFromUniqueID(e, t, this.m_bRestoringPopups, i);
return o ? (e.AddTab(o), this.BroadcastNewTabToAllBrowserContexts(e.GetBrowserContext(), t), n && e.ActivateTab(o), o) : null;
}
GetNextChatPopupID() {
return "ChatWindow_" + this.m_iLastChatPopupID++;
}
BIsFriendsListSingleWindow(e) {
let t = this.GetPerContextChatData(e);
return !t.BUsePopups() || t.IsFriendsListSingleWindow();
}
BIsFriendsListEmbedded(e) {
return this.GetPerContextChatData(e).BIsFriendsListEmbedded();
}
BIsFriendsListCollapsed(e) {
let t = this.GetPerContextChatData(e);
return t.IsFriendsListSingleWindow() && t.IsFriendsListCollapsed();
}
SetFriendsListCollapsed(e, t) {
this.GetPerContextChatData(e).SetFriendsListCollapsed(t);
}
ConvertDefaultTabSetToPopup(e) {
let t = this.GetPerContextChatData(e);
if (t.default_tabset.tabCount) {
let n = t.GetPopupForTabSet(t.default_tabset);
return n || ((n = r.Ul.CreateChatPopup(e, this.GetNextChatPopupID(), t.default_tabset, t.cached_popup_window_restore_details, void 0, !1)), n.Show(!(0, r.ns)(e, r.D)), t.AddPopup(t.default_tabset, n), this.SerializePopupState(), t.friends_list_window && (t.friends_list_window.BringToFront(), (t.friends_list_window.title = (0, c.Xx)("#WindowTitle_FriendsList"))), n);
}
return null;
}
ConvertDefaultTabSetToEmbedded(e) {
let t = this.GetPerContextChatData(e),
n = t.GetPopupForTabSet(t.default_tabset);
n &&
(n.popup.GetWindowRestoreDetails().then((e) => {
t.SetCachedDefaultPopupDimensions(e);
}),
t.RemovePopupForTabSet(t.default_tabset),
this.SerializePopupState(),
n.ClearTabSet(),
n.popup.Close());
}
MergeTabSets(e) {
const t = this.GetPerContextChatData(e);
this.ForEachTabSet(t, (e) => {
e !== t.default_tabset &&
e.tabs.forEach((n) => {
e.RemoveTab(n), t.default_tabset.AddTab(n);
});
});
}
OnTabSetResized(e) {
let t = this.GetPerContextChatData(e.GetBrowserContext());
if (e == t.default_tabset && !t.IsFriendsListSingleWindow()) {
let n = t.GetPopupForTabSet(e);
n &&
n.popup.GetWindowRestoreDetails().then((e) => {
t.SetCachedDefaultPopupDimensions(e);
});
}
}
CloseTabSet(e) {
let t = this.GetPerContextChatData(e.GetBrowserContext()),
n = t.GetPopupForTabSet(e);
n && n.popup.Close(), t.RemovePopupForTabSet(e), this.SerializePopupState();
}
OnTabSetClosed(e) {
this.GetPerContextChatData(e.GetBrowserContext()).RemovePopupForTabSet(e), this.SerializePopupState();
}
FocusTabSet(e) {
let t = this.GetPerContextChatData(e.GetBrowserContext()),
n = t.GetPopupForTabSet(e);
n && n.popup && !n.popup.container.BIsClosed() ? n.popup.container.BringToFront() : t.IsTabSetInFriendListWindow(e) && t.IsFriendsListSingleWindow() && (t.BUsePopups() ? r.Ul.ShowPopupFriendsList(t.browser_context, !1, !0) : t.friends_list_window && t.friends_list_window.BringToFront());
}
MoveTabToNewPopup(e, t, n, i) {
(0, p.X)(e, "browserContext");
let o = this.GetPerContextChatData(e);
this.ForEachTabSet(o, (e) => e.RemoveTab(t));
let a = new d(e);
a.AddTab(t);
let s = r.Ul.CreateChatPopup(e, this.GetNextChatPopupID(), a, i, n, !1);
if ((s.Show(!0), i)) {
let e = s.popup.GetWindow();
try {
e.SteamClient.Window.PositionWindowRelative(i, n.left, n.top, n.width, n.height);
} catch (e) {
console.error(e);
}
}
o.AddPopup(a, s), this.SerializePopupState();
}
SerializePopupState(e = !1) {
if (!this.m_bRestoredPopupState || !r.Ul.SettingsStore.BReady()) return;
if (this.m_bShuttingDown) return;
let t = this.SerializePopupStateToObject(e);
r.Ul.SettingsStore.StoreObjectInLocalStorage(f, t);
}
SerializePopupStateToObject(e) {
let t = this.GetPerContextChatData(r.D),
n = { window_restore_details: t.cached_popup_window_restore_details, defaultTabs: void 0, popupTabs: void 0, bFriendsListVisible: !1, always_restore: e, bFriendsListCollapsed: t.IsFriendsListCollapsed() };
t.default_tabset && t.default_tabset.tabCount > 0 && (n.defaultTabs = t.default_tabset.Serialize());
let i = [];
for (let e of Array.from(t.popup_list)) e.tab_set != t.default_tabset && i.push(e.tab_set.Serialize());
return i.length > 0 && (n.popupTabs = i), (n.bFriendsListVisible = !!t.friends_list_window), n;
}
BRestorePopups() {
return r.Ul.SettingsStore.BAlwaysShowChatsInNewWindow();
}
BRestoreOpenChats() {
return r.Ul.SettingsStore.FriendsSettings.bRememberOpenChats;
}
DeserializeIntoTabSet(e, t) {
if (t.tabs && Array.isArray(t.tabs)) for (let n of t.tabs) n.startsWith("br") || this.CreateNewTabFromUniqueID(e, n, n == t.active_tab, !0);
}
SetStateToRestoreFrom(e) {
this.m_stateToRestoreFrom = e;
}
RestorePopupState() {
return (0, i.mG)(this, void 0, void 0, function* () {
if (r.Ul.IsGamepadUIActive()) return;
if (((0, p.X)(!this.m_bRestoredPopupState, "Second restore popup state"), (0, p.X)(!this.m_bRestoringPopups, "RestorePopupState called while already restoring"), r.Ul.ParentalStore.BIsFriendsBlocked() || r.Ul.SettingsStore.IsSteamInTournamentMode())) return;
if (((this.m_bRestoringPopups = !0), this.m_stateToRestoreFrom)) return this.RestoreFromStateObject(this.m_stateToRestoreFrom, !1), (this.m_stateToRestoreFrom = void 0), void (this.m_bRestoringPopups = !1);
let e = yield r.Ul.SettingsStore.GetObjectFromLocalStorageWhenReady(f),
t = !1;
"undefined" != typeof SteamClient && SteamClient.WebChat && SteamClient.WebChat.BSuppressPopupsInRestore && (t = yield SteamClient.WebChat.BSuppressPopupsInRestore()), this.RestoreFromStateObject(e, t), (this.m_bRestoringPopups = !1);
});
}
RestoreFromStateObject(e, t) {
let n = this.GetPerContextChatData(r.D);
if (((0, p.X)(n.BIsEmpty(), "Restoring to non-empty context", n), n.BIsEmpty())) {
if ((e.window_restore_details && n.SetCachedDefaultPopupDimensions(e.window_restore_details), void 0 !== e.bFriendsListSingleWindow && r.Ul.SettingsStore.BackfillSingleWindowMode(e.bFriendsListSingleWindow), n.SetFriendsListSingleWindowMode(r.Ul.SettingsStore.BSingleWindowModeEnabled()), n.SetFriendsListCollapsed(!!e.bFriendsListCollapsed), !t && (e.always_restore || this.BRestoreOpenChats()))) {
if (e.defaultTabs) {
let t = n.default_tabset;
if ((this.DeserializeIntoTabSet(t, e.defaultTabs), t.tabCount > 0 && !n.IsFriendsListSingleWindow())) {
let e = r.Ul.CreateChatPopup(r.Ul.GetDefaultBrowserContext(), this.GetNextChatPopupID(), t, void 0, void 0, !1);
n.AddPopup(t, e), e.Show(!1);
}
}
if (e.popupTabs)
for (let t of e.popupTabs) {
let e = new d(r.D);
if ((this.DeserializeIntoTabSet(e, t), e.tabCount > 0)) {
let t = r.Ul.CreateChatPopup(r.Ul.GetDefaultBrowserContext(), this.GetNextChatPopupID(), e, void 0, void 0, !1);
n.AddPopup(e, t), t.Show(!1);
}
}
}
if (!t) {
let t = !e || void 0 === e.bFriendsListVisible || e.bFriendsListVisible;
n.BUsePopups() && r.Ul.ShowPopupFriendsListAtStartup(t);
for (let e of this.m_vecShowGroupsAfterRestorePopup) this.ShowAndOrActivateChatRoomGroup(r.D, e, !1);
}
(this.m_vecShowGroupsAfterRestorePopup = []), (this.m_bRestoredPopupState = !0), this.m_chatStore.OnRestorePopupsComplete();
}
}
ResetHasRestoredPopupState() {
return (0, i.mG)(this, void 0, void 0, function* () {
this.m_bRestoredPopupState = !1;
});
}
RestorePopupStateForMobile() {
this.m_bRestoringPopups = !0;
this.GetPerContextChatData(r.D).SetFriendsListSingleWindowMode(!0), (this.m_bRestoringPopups = !1);
}
FillInChatUsabilityMetrics(e) {
let t = this.GetPerContextChatData(r.D);
e.ui_state().set_friends_list_docked(t.IsFriendsListSingleWindow()), e.ui_state().set_friends_list_visible(t.friends_list_window && !t.friends_list_window.BIsClosed()), e.ui_state().set_chat_popups_opened(Array.from(t.popup_list).length), e.ui_state().set_friends_list_collapsed(t.IsFriendsListCollapsed());
let n = 0,
i = 0;
(n += l.W(t.default_tabset.tabs, (e) => e.IsChatRoom())), (i += l.W(t.default_tabset.tabs, (e) => e.IsFriendChat()));
for (let e of Array.from(t.popup_list)) e.tab_set != t.default_tabset && ((n += l.W(e.tab_set.tabs, (e) => e.IsChatRoom())), (i += l.W(e.tab_set.tabs, (e) => e.IsFriendChat())));
e.ui_state().set_group_chat_tabs_opened(n), e.ui_state().set_friend_chat_tabs_opened(i);
}
get show_winter_sale_ui() {
return this.m_bShowWinterSaleUI;
}
StartWinterSaleCountdown() {
const e = 15767784e5;
Date.now() >= e ? (this.m_bShowWinterSaleUI = !0) : setTimeout(() => this.StartWinterSaleCountdown(), e - Date.now());
}
get FriendsListSteamDeckActiveTab() {
return this.m_eFriendsListSteamDeckActiveTab;
}
set FriendsListSteamDeckActiveTab(e) {
if (e == this.m_eFriendsListSteamDeckActiveTab) return;
let t = this.m_eFriendsListSteamDeckActiveTab;
(this.m_eFriendsListSteamDeckActiveTab = e), this.m_FriendsListSteamDeckActiveTabCallbackList.Dispatch(t, e);
}
SelectFriendsListSteamDeckSiblingTab(e) {
let t = this.m_eFriendsListSteamDeckActiveTab + e;
t >= 0 && t <= v.MaxTab && (this.FriendsListSteamDeckActiveTab = t);
}
FriendsListSteamDeckActiveTabCallbackList() {
return this.m_FriendsListSteamDeckActiveTabCallbackList;
}
}
(0, i.gn)([a.LO], b.prototype, "m_bTheaterMode", void 0), (0, i.gn)([a.LO], b.prototype, "m_mapFriendChatBroadcastVisible", void 0), (0, i.gn)([a.LO], b.prototype, "m_nTabActivationCount", void 0), (0, i.gn)([a.LO], b.prototype, "m_bShowWinterSaleUI", void 0), (0, i.gn)([a.aD], b.prototype, "OnFriendsParentalLockChanged", null), (0, i.gn)([r.IN], b.prototype, "ShowFriendChatDialogWhenReady", null), (0, i.gn)([r.IN], b.prototype, "ShowAndOrActivateChatRoomGroupWhenReady", null), (0, i.gn)([g.ak], b.prototype, "SerializePopupState", null);
class I {
constructor(e, t) {
(this.m_bShown = !1), (this.m_popup = e), (this.m_chatPopup = t);
}
Show(e) {
this.m_popup.Show(e), this.m_bShown || (this.m_bShown = !0);
}
get popup() {
return this.m_popup;
}
get tab_set() {
return this.m_chatPopup.tab_set;
}
ClearTabSet() {
this.m_chatPopup.ClearTabSet();
}
IsSameBrowserContext(e) {
let t = this.m_popup.GetBrowserContext() || r.D;
return e.m_nBrowserID == t.m_nBrowserID && e.m_unPID == t.m_unPID;
}
}
!(function (e) {
(e[(e.FriendsList = 0)] = "FriendsList"), (e[(e.Chat = 1)] = "Chat");
})(S || (S = {}));
class y {
constructor() {
(this.m_eActiveView = S.FriendsList), (0, a.rC)(this);
}
GetActiveView() {
return this.m_eActiveView;
}
SetActiveView(e) {
this.m_eActiveView = e;
}
}
(0, i.gn)([a.LO], y.prototype, "m_eActiveView", void 0);
class E {
constructor(e) {
(this.m_DefaultTabSet = void 0), (this.m_bFriendsListSingleWindow = void 0), (this.m_bFriendsListCollapsed = void 0), (0, a.rC)(this), (this.m_browserContext = e), (this.m_DefaultTabSet = new d(e)), (this.m_FriendsListWindow = void 0), (this.m_PopupWindowRestoreDetails = void 0), (this.m_mapTabSetToPopup = new Map()), (this.m_ResponsiveWindowState = new y()), this.SetFriendsListSingleWindowMode(!1), (this.m_bFriendsListCollapsed = o.De.STEAM_TV);
}
BIsEmpty() {
return 0 == this.m_DefaultTabSet.tabCount && (!o.De.IN_CLIENT || null == this.m_FriendsListWindow || r.Ul.IsLoadedInClientSharedJSContext()) && 0 == this.m_mapTabSetToPopup.size;
}
BUsePopups() {
return o.De.USE_POPUPS && 4 !== this.m_browserContext.m_eUIMode && !(0, u.Su)(this.m_browserContext.m_eBrowserType);
}
BIsFriendsListEmbedded() {
return (0, r.ns)(r.D, this.m_browserContext) ? !this.BUsePopups() : 4 === this.m_browserContext.m_eUIMode;
}
IsFriendsListSingleWindow() {
return this.m_bFriendsListSingleWindow;
}
SetFriendsListSingleWindowMode(e) {
this.BUsePopups() ? (this.m_bFriendsListSingleWindow = e) : (this.m_bFriendsListSingleWindow = !0);
}
IsFriendsListCollapsed() {
return this.m_bFriendsListCollapsed;
}
SetFriendsListCollapsed(e) {
this.m_bFriendsListCollapsed = e;
}
get browser_context() {
return this.m_browserContext;
}
get default_tabset() {
return (0, p.X)(this.m_DefaultTabSet, "Context has no default chat target"), this.m_DefaultTabSet;
}
get friends_list_window() {
return this.m_FriendsListWindow;
}
SetFriendsListWindow(e) {
(this.m_FriendsListWindow = e || void 0), !e && this.IsFriendsListSingleWindow() && this.m_DefaultTabSet.CloseAllTabs();
}
get popup_list() {
return this.m_mapTabSetToPopup.values();
}
get responsive_window_state() {
return this.m_ResponsiveWindowState;
}
get cached_popup_window_restore_details() {
return this.m_PopupWindowRestoreDetails;
}
get screen_info() {
return this.m_ScreenInfo;
}
SetScreenInfo(e, t) {
this.m_ScreenInfo = { width: e, height: t };
}
SetCachedDefaultPopupDimensions(e) {
this.m_PopupWindowRestoreDetails = e;
}
GetTabSetForId(e) {
if (this.m_DefaultTabSet.GetTabByUniqueID(e)) return this.m_DefaultTabSet;
for (let t of Array.from(this.m_mapTabSetToPopup.keys())) if (t.GetTabByUniqueID(e)) return t;
return null;
}
RemovePopupForTabSet(e) {
this.m_mapTabSetToPopup.delete(e);
}
AddPopup(e, t) {
(0, p.X)(!this.m_mapTabSetToPopup.has(e), "Added popup for tabset twice"), this.m_mapTabSetToPopup.set(e, t);
}
GetPopupForTabSet(e) {
return this.m_mapTabSetToPopup.get(e);
}
IsTabSetInFriendListWindow(e) {
return e == this.default_tabset && this.IsFriendsListSingleWindow();
}
BIsTabSetActive(e) {
var t;
let n = this.GetPopupForTabSet(e);
return (null === (t = null == n ? void 0 : n.popup) || void 0 === t ? void 0 : t.container) ? !n.popup.container.BIsClosed() : this.IsTabSetInFriendListWindow(e) && this.friends_list_window && !this.friends_list_window.BIsClosed();
}
BIsTabSetVisible(e) {
let t = this.GetPopupForTabSet(e);
return t ? t.popup.container.BIsVisible() : this.IsTabSetInFriendListWindow(e) && this.friends_list_window && this.friends_list_window.BIsVisible();
}
BIsTabSetFocused(e) {
let t = this.GetPopupForTabSet(e);
return t ? t.popup.container.BIsFocused() : this.IsTabSetInFriendListWindow(e) && this.friends_list_window && this.friends_list_window.BIsFocused();
}
CloseAllPopups() {
for (let e of Array.from(this.popup_list)) e.popup.Close();
this.m_mapTabSetToPopup.clear(), this.friends_list_window && this.m_FriendsListWindow.Close(), (this.m_DefaultTabSet = new d(this.m_browserContext));
}
}
(0, i.gn)([a.LO], E.prototype, "m_DefaultTabSet", void 0), (0, i.gn)([a.LO], E.prototype, "m_bFriendsListSingleWindow", void 0), (0, i.gn)([a.LO], E.prototype, "m_bFriendsListCollapsed", void 0);
},
38461: (e, t, n) => {
"use strict";
n.d(t, { Ys: () => j, S7: () => G.S7 });
var i = n(85556),
o = n(19953),
r = n(1736),
a = n(70532),
s = n(2260),
l = n(21701),
c = n(23282),
m = n(22394);
let d = new (class {
constructor() {
(this.m_bClientConnectionFailed = !1), (this.m_bSecurityException = !1), (this.m_bReady = !1), (this.m_mapCallbacks = new Map()), (this.m_ConnectCallbacks = new m.pB()), (this.m_DisconnectCallbacks = new m.pB());
}
IsConnected() {
return this.m_bReady && this.m_socket.readyState == WebSocket.OPEN;
}
WaitUntilConnected() {
return this.IsConnected()
? Promise.resolve()
: new Promise((e) => {
let t = this.m_ConnectCallbacks.Register(() => {
e(), t.Unregister();
});
});
}
RegisterOnDisconnect(e) {
return this.m_DisconnectCallbacks.Register(e);
}
BSendMsg(e, t, n) {
if (!this.IsConnected()) return !1;
try {
let i = new l._5();
i.set_type(e), null != n && i.set_id(n);
let o = i.serializeBinary();
if (o.length > 255) return !1;
let r = t.serializeBinary(),
a = new Uint8Array(1 + o.length + r.length),
s = new c.At(a);
return s.PutUint8(o.length), s.PutBytes(o), s.PutBytes(r), this.m_socket.send(a), !0;
} catch (e) {
return !1;
}
}
RegisterOnMsg(e, t, n) {
var i;
if (!("SteamClient" in window) || null == SteamClient) return;
let o = this.m_mapCallbacks.get(e);
o || ((o = { msgClass: t, list: new m.pB() }), this.m_mapCallbacks.set(e, o));
let r = o.list.Register(n);
return (
!this.m_RegisterForVRModeChangeHandle &&
(null === (i = SteamClient.OpenVR) || void 0 === i ? void 0 : i.RegisterForVRModeChange) &&
(this.m_RegisterForVRModeChangeHandle = SteamClient.OpenVR.RegisterForVRModeChange((e) => {
e ? this.Connect() : this.Disconnect();
})),
{
Unregister: () => {
r.Unregister(), this.BHasCallbacks() || (this.Disconnect(), this.m_RegisterForVRModeChangeHandle && (this.m_RegisterForVRModeChangeHandle.unregister(), (this.m_RegisterForVRModeChangeHandle = void 0)));
},
}
);
}
BHasCallbacks() {
return [...this.m_mapCallbacks.values()].some((e) => e.list.CountRegistered() > 0);
}
OnSocketMessage(e) {
try {
let t = new c.At(e.data),
n = t.GetUint8(),
i = new l._5();
l._5.deserializeBinaryFromReader(i, new s.BinaryReader(t.GetPacket(), t.TellGet(), n)), t.SeekGetCurrent(n);
let o = this.m_mapCallbacks.get(i.type());
if (o) {
let e = new o.msgClass();
o.msgClass.deserializeBinaryFromReader(e, new s.BinaryReader(t.GetPacket(), t.TellGet(), t.GetCountBytesRemaining())), o.list.Dispatch(e, i.id());
}
} catch (e) {
console.error("Exception deserializing protobuf", e);
}
}
Connect() {
if ("SteamClient" in window && null != SteamClient)
return this.IsConnected()
? Promise.resolve()
: (this.m_promiseConnect ||
((this.m_promiseConnect = new Promise((e, t) =>
(0, i.mG)(this, void 0, void 0, function* () {
try {
this.m_socket = new WebSocket(`ws://localhost:27062?secret=${yield SteamClient.OpenVR.GetWebSecret()}`);
} catch (e) {
return (this.m_bSecurityException = !0), void t(e);
}
(this.m_socket.onerror = (e) => {
t();
}),
(this.m_socket.binaryType = "arraybuffer"),
(this.m_socket.onmessage = this.OnSocketMessage.bind(this)),
(this.m_socket.onopen = () => {
this.m_socket.send("steam_connect"), e();
}),
(this.m_socket.onclose = () => {
(this.m_bReady = !1), (this.m_socket = void 0), this.m_DisconnectCallbacks.Dispatch();
});
}),
)),
this.m_promiseConnect
.then(() => {
(this.m_bReady = !0), this.m_ConnectCallbacks.Dispatch();
})
.catch(() => {
this.m_bClientConnectionFailed = !0;
})
.finally(() => {
this.m_promiseConnect = void 0;
})),
this.m_promiseConnect);
}
Disconnect() {
this.m_socket && this.m_socket.close();
}
})();
var h = n(72746),
u = n(88991),
p = n(78013),
_ = n(2049),
g = n(79588);
n(10553);
class C {
constructor() {
(this.m_Disposers = []), (this.m_SteamVRMsgHandlers = []), (this.m_EnableLogging = !1), (0, g.rC)(this);
}
Log(...e) {
this.m_EnableLogging && console.log("[VRVoiceChat]", ...e);
}
SetSession(e) {
this.m_Session && h.Ul.ChatStore.DecRefActiveChatRoomGroup(this.m_Session.groupID), (this.m_Session = e), this.m_Session && h.Ul.ChatStore.IncRefActiveChatRoomGroup(this.m_Session.groupID, !0);
}
SendGroupName(e) {
this.Log("Group: ", e);
let t = new p.cf();
t.set_name(e), d.BSendMsg(32, t);
}
RegisterForNewChatMessages() {
if (!this.m_Session) return void this.Log("RegisterForNewChatMessages: session not set");
let e = h.Ul.ChatStore.GetChatRoomGroup(this.m_Session.groupID);
this.Log("RegisterForNewChatMessages: ", e), (this.m_NewChatMsgAddedHandles = null == e ? void 0 : e.textRoomList.map((e) => e.RegisterOnNewChatMsgAdded(this.OnNewChatMsgAdded))), e && (this.SendGroupName(e.name), (this.m_GroupNameDisposer = (0, g.N7)(e, "name", (e) => this.SendGroupName(e.newValue))));
}
UnregisterForNewChatMessages() {
var e;
this.Log("UnregisterForNewChatMessages: ", this), null === (e = this.m_NewChatMsgAddedHandles) || void 0 === e || e.map((e) => e.Unregister()), (this.m_NewChatMsgAddedHandles = void 0), this.m_GroupNameDisposer && (this.m_GroupNameDisposer(), (this.m_GroupNameDisposer = void 0));
}
ClearCurrentSession() {
var e;
this.Log("ClearCurrentSession: ", this), this.m_Session && (this.SetSession(void 0), null === (e = this.m_Supplier) || void 0 === e || e.OnUserEndVoiceChat());
}
OnDisconnect() {
var e, t;
this.Log("OnDisconnect: ", this), this.ClearCurrentSession(), null === (e = this.m_VoiceChatActiveStateChangedHandle) || void 0 === e || e.Unregister(), (this.m_VoiceChatActiveStateChangedHandle = void 0), null === (t = this.m_ChatGroupAddedHandle) || void 0 === t || t.Unregister(), (this.m_ChatGroupAddedHandle = void 0), this.UnregisterForNewChatMessages();
}
OnInitiateRoomChat(e, t) {
var n, i;
this.ClearCurrentSession();
const o = e.chat_group_id(),
r = e.chat_room_id();
this.SetSession({ groupID: o, roomID: r }), this.Log("OnInitiateRoomChat: ", this.m_Session), this.m_VoiceChatActiveStateChangedHandle || (this.m_VoiceChatActiveStateChangedHandle = null === (n = this.m_Supplier) || void 0 === n ? void 0 : n.RegisterForVoiceChatActiveStateChange(this.OnVoiceChatActiveStateChanged)), null === (i = this.m_Supplier) || void 0 === i || i.InitiateRoomChat(o, r);
let a = new p.kb();
d.BSendMsg(11, a, t);
}
OnExitRoomChat(e, t) {
var n;
this.Log("OnExitRoomChat: ", this), this.m_Session && (this.SetSession(void 0), null === (n = this.m_Supplier) || void 0 === n || n.OnUserEndVoiceChat());
let i = new p.Ix();
d.BSendMsg(13, i, t);
}
OnChatGroupAdded(e) {
this.Log("OnChatGroupAdded: ", e), this.m_Session.groupID == e.GetGroupID() && (this.UnregisterForNewChatMessages(), this.RegisterForNewChatMessages());
}
OnVoiceChatActiveStateChanged(e) {
var t;
if ((this.Log("OnVoiceChatActiveStateChanged: ", e), this.UnregisterForNewChatMessages(), null === (t = this.m_ChatGroupAddedHandle) || void 0 === t || t.Unregister(), (this.m_ChatGroupAddedHandle = void 0), e)) {
this.RegisterForNewChatMessages(), (this.m_ChatGroupAddedHandle = h.Ul.ChatStore.RegisterForGroupAdded(this.OnChatGroupAdded));
let e = new p.cz();
d.BSendMsg(21, e);
} else {
let e = new p.Sh();
d.BSendMsg(22, e);
}
}
OnNewChatMsgAdded(e, t, n, i, o, r) {
this.Log("OnNewChatMsgAdded: ", e, t, n, i, o, r);
let a = new p.O9();
a.set_chat_group_id(e), a.set_chat_room_id(t), a.set_sender_accountid(n), a.set_timestamp(i), a.set_ordinal(o), a.set_message(r), d.BSendMsg(18, a);
}
OnGetAvatarUrl(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
let n = e.profile_steamid(),
i = yield this.Supplier.GetPersonaState(n),
o = "";
switch (e.avatar_type()) {
case 0:
o = null == i ? void 0 : i.avatar_url;
break;
case 1:
o = null == i ? void 0 : i.avatar_url_medium;
break;
case 2:
o = null == i ? void 0 : i.avatar_url_full;
}
let r = new p.Wi();
r.set_profile_avatar_url(o), d.BSendMsg(17, r, t);
});
}
OnSendGroupChatMessage(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
if (this.m_Session) {
const t = h.Ul.ChatStore.GetChatRoomGroup(this.m_Session.groupID);
if (t) {
const n = t.textRoomList;
if (n.length > 0) {
const t = n[0],
i = e.message_with_bbcode();
yield t.SendChatMessage(i);
}
}
}
let n = new p.IP();
d.BSendMsg(20, n, t);
});
}
OnConfigureVideo(e, t) {
var n;
return (0, i.mG)(this, void 0, void 0, function* () {
null === (n = this.m_Supplier) || void 0 === n || n.ConfigureVideo(e.send(), e.receive());
let i = new p.Fv();
d.BSendMsg(24, i, t);
});
}
OnSetPerUserMuting(e, t) {
var n;
null === (n = this.m_Supplier) || void 0 === n || n.SetPerUserMuting(e.accountid(), e.muted());
let i = new p.s7();
d.BSendMsg(30, i, t);
}
OnSetSpatialAudioListener(e) {
0;
}
OnSetSpatialAudioSource(e) {
0;
}
OnAddPerUserGainLevel(e, t) {
let n = new p.SX();
n.set_accountid(e),
n.set_muted(t.muted),
n.set_gain(t.gain),
d.BSendMsg(28, n),
this.m_Disposers.push(
(0, g.U5)(
() => t.muted,
(e) => {
n.set_muted(e), d.BSendMsg(28, n);
},
),
),
this.m_Disposers.push(
(0, g.U5)(
() => t.gain,
(e) => {
n.set_gain(e), d.BSendMsg(28, n);
},
),
);
}
OnAddPerUserVoiceStatus(e, t) {
let n = new p.fU();
n.set_accountid(e),
n.set_mic_muted_locally(t.mic_muted_locally),
n.set_output_muted_locally(t.output_muted_locally),
d.BSendMsg(29, n),
this.m_Disposers.push(
(0, g.U5)(
() => t.mic_muted_locally,
(e) => {
n.set_mic_muted_locally(e), d.BSendMsg(29, n);
},
),
),
this.m_Disposers.push(
(0, g.U5)(
() => t.output_muted_locally,
(e) => {
n.set_output_muted_locally(e), d.BSendMsg(29, n);
},
),
);
}
set Supplier(e) {
this.Log("Supplier: ", e, this),
this.m_Supplier != e &&
((this.m_Supplier = e),
this.m_Disposers.forEach((e) => e()),
(this.m_Disposers.length = 0),
this.m_SteamVRMsgHandlers.forEach((e) => e.Unregister()),
(this.m_SteamVRMsgHandlers.length = 0),
e &&
(this.m_Disposers.push(
(0, g.N7)(e.GetPerUserGainLevels(), (e) => {
"add" === e.type && this.OnAddPerUserGainLevel(e.name, e.newValue);
}),
),
this.m_Disposers.push(
(0, g.N7)(e.GetPerUserVoiceStatus(), (e) => {
"add" === e.type && this.OnAddPerUserVoiceStatus(e.name, e.newValue);
}),
),
e.GetPerUserGainLevels().forEach((e, t) => this.OnAddPerUserGainLevel(t, e)),
e.GetPerUserVoiceStatus().forEach((e, t) => this.OnAddPerUserVoiceStatus(t, e)),
this.m_SteamVRMsgHandlers.push(d.RegisterOnDisconnect(this.OnDisconnect)),
this.m_SteamVRMsgHandlers.push(d.RegisterOnMsg(10, p.Q4, this.OnInitiateRoomChat)),
this.m_SteamVRMsgHandlers.push(d.RegisterOnMsg(12, p.Sb, this.OnExitRoomChat)),
this.m_SteamVRMsgHandlers.push(d.RegisterOnMsg(16, p.U6, this.OnGetAvatarUrl)),
this.m_SteamVRMsgHandlers.push(d.RegisterOnMsg(19, p.$2, this.OnSendGroupChatMessage)),
this.m_SteamVRMsgHandlers.push(d.RegisterOnMsg(23, p.$J, this.OnConfigureVideo)),
this.m_SteamVRMsgHandlers.push(d.RegisterOnMsg(30, p.Gy, this.OnSetPerUserMuting))));
}
get session() {
return this.m_Session;
}
set session(e) {
if ((this.Log("session: ", e, this), e || (e = { groupID: "0", roomID: "0" }), this.m_Session && this.m_Session.groupID == e.groupID && this.m_Session.roomID == e.roomID)) return;
this.SetSession(e);
let t = new p.DX();
t.set_chat_group_id(e.groupID), t.set_chat_room_id(e.roomID), d.BSendMsg(25, t);
}
}
(0, i.gn)([_.ak], C.prototype, "OnDisconnect", null), (0, i.gn)([_.ak], C.prototype, "OnInitiateRoomChat", null), (0, i.gn)([_.ak], C.prototype, "OnExitRoomChat", null), (0, i.gn)([_.ak], C.prototype, "OnChatGroupAdded", null), (0, i.gn)([_.ak], C.prototype, "OnVoiceChatActiveStateChanged", null), (0, i.gn)([_.ak], C.prototype, "OnNewChatMsgAdded", null), (0, i.gn)([_.ak], C.prototype, "OnGetAvatarUrl", null), (0, i.gn)([_.ak], C.prototype, "OnSendGroupChatMessage", null), (0, i.gn)([_.ak], C.prototype, "OnConfigureVideo", null), (0, i.gn)([_.ak], C.prototype, "OnSetPerUserMuting", null), (0, i.gn)([g.aD.bound], C.prototype, "OnSetSpatialAudioListener", null), (0, i.gn)([g.aD.bound], C.prototype, "OnSetSpatialAudioSource", null);
let f = new C();
var v = n(90320);
class S {
constructor() {
(this.m_DataChannels = new Array()), (this.m_OpenChannels = new Map()), (this.m_NextChannelId = 0), (this.m_EnableLogging = !1), (0, g.rC)(this);
}
Log(e) {
this.m_EnableLogging && console.log(e);
}
BSendData(e, t) {
let n = new v.j7();
return n.set_channel_id(e), n.set_data(t), d.BSendMsg(9, n);
}
SetupChannel(e, t, n) {
this.Log(`(WebRTC) OnDataChannel[${t}:${null == e ? void 0 : e.label}]: ${n}`), (e.onopen = () => this.OnDataChannelOpen(e, t)), (e.onclose = () => this.OnDataChannelClose(e, t)), (e.onerror = (n) => this.OnDataChannelError(n.error, e, t)), (e.binaryType = "arraybuffer"), (e.onmessage = (e) => this.BSendData(t, e.data));
}
OnDataChannel(e) {
let t = this.m_NextChannelId++;
const n = e.channel;
let i, o;
this.SetupChannel(n, t, "remote");
let r = n.label.lastIndexOf("[");
-1 != r ? ((o = n.label.slice(0, r)), (i = n.label.slice(r))) : (o = n.label);
let a = new v.NW();
a.set_channel_id(t), a.set_label(o), a.set_source_steamid(u.K.InitFromString(i).ConvertTo64BitString()), d.BSendMsg(5, a);
}
OnDataChannelMessage(e) {
let t = this.m_OpenChannels.get(e.channel_id());
t && "open" == t.readyState && t.send(e.data());
}
OnCloseDataChannel(e, t) {
let n = e.channel_id();
this.m_DataChannels = this.m_DataChannels.filter((e) => {
var t;
return e.id !== n || (null === (t = e.channel) || void 0 === t || t.close(), !1);
});
let i = new v.K3();
d.BSendMsg(4, i, t);
}
OnCreateDataChannel(e, t) {
let n = { id: this.m_NextChannelId++, label: e.label(), options: { ordered: e.ordered(), maxRetransmits: e.max_retransmits(), maxPacketLifeTime: e.max_packet_life_time() } };
this.m_DataChannels.push(n), this.m_PeerConnection && (this.m_Supplier.BSupportsDataChannels() ? this.CreateDataChannel(n) : this.m_Supplier.RenegotiateSDP());
let i = new v.TM();
i.set_channel_id(n.id), d.BSendMsg(2, i, t);
}
OnDataChannelOpen(e, t) {
this.Log(`(WebRTC) OnDataChannelOpen[${t}:${null == e ? void 0 : e.label}]`), this.m_OpenChannels.set(t, e), this.m_DataChannelCloseHandle || (this.m_DataChannelCloseHandle = d.RegisterOnMsg(7, v.iO, () => {}));
let n = new v.Z5();
n.set_channel_id(t), d.BSendMsg(6, n);
}
OnDataChannelClose(e, t) {
this.Log(`(WebRTC) OnDataChannelClose[${t}:${null == e ? void 0 : e.label}]`), this.m_OpenChannels.delete(t);
let n = new v.iO();
n.set_channel_id(t), d.BSendMsg(7, n), 0 == this.m_OpenChannels.size && this.m_DataChannelCloseHandle && (this.m_DataChannelCloseHandle.Unregister(), (this.m_DataChannelCloseHandle = void 0));
}
OnDataChannelError(e, t, n) {
this.Log(`(WebRTC) OnDataChannelError[${n}:${null == t ? void 0 : t.label}]: ${e}`);
const i = `{ message: ${e.message}` + (e.errorDetail ? `, errorDetail: ${e.errorDetail}` : "") + (e.sctpCauseCode ? `, sctpCauseCode: ${e.sctpCauseCode}` : "") + (e.sdpLineNumber ? `, sdpLineNumber: ${e.sdpLineNumber}` : "") + (e.receivedAlert ? `, receivedAlert: ${e.receivedAlert}` : "") + (e.sentAlert ? `, sentAlert: ${e.sentAlert}` : "") + " }";
let o = new v.tV();
o.set_channel_id(n), o.set_reason(i), d.BSendMsg(8, o);
}
OnDisconnect() {
var e;
this.m_DataChannels.forEach((e) => {
var t;
return null === (t = e.channel) || void 0 === t ? void 0 : t.close();
}),
(this.m_DataChannels.length = 0),
(null === (e = this.m_Supplier) || void 0 === e ? void 0 : e.BSupportsDataChannels()) && this.m_Supplier.RenegotiateSDP();
}
CreateDataChannel(e) {
try {
e.channel = this.m_PeerConnection.createDataChannel(e.label, e.options);
} catch (e) {}
this.SetupChannel(e.channel, e.id, "local");
}
SetPeerConnection(e) {
this.m_PeerConnection != e &&
(e ||
((this.m_PeerConnection.ondatachannel = void 0),
this.m_DataChannels.forEach((e) => {
var t;
return null === (t = e.channel) || void 0 === t ? void 0 : t.close();
})),
(this.m_PeerConnection = e),
this.m_PeerConnection && (this.m_DataChannels.forEach((e) => this.CreateDataChannel(e)), (this.m_PeerConnection.ondatachannel = this.OnDataChannel)));
}
set ActiveDataChannelSupplier(e) {
var t, n, i, o;
if (this.m_Supplier != e && (!e || d.IsConnected()))
if (((this.m_Supplier = e), this.m_Disposer && (this.m_Disposer(), (this.m_Disposer = void 0)), null === (t = this.m_DisconnectHandle) || void 0 === t || t.Unregister(), null === (n = this.m_CloseDataChannelHandle) || void 0 === n || n.Unregister(), null === (i = this.m_CreateDataChannelHandle) || void 0 === i || i.Unregister(), null === (o = this.m_DataChannelMessageHandle) || void 0 === o || o.Unregister(), e)) {
(this.m_Disposer = (0, g.N7)(e, "m_PeerConnection", (e) => this.SetPeerConnection(e.newValue))), (this.m_DisconnectHandle = d.RegisterOnDisconnect(this.OnDisconnect)), (this.m_CloseDataChannelHandle = d.RegisterOnMsg(3, v.Tb, this.OnCloseDataChannel)), (this.m_CreateDataChannelHandle = d.RegisterOnMsg(1, v.KX, this.OnCreateDataChannel)), (this.m_DataChannelMessageHandle = d.RegisterOnMsg(9, v.j7, this.OnDataChannelMessage));
let t = new v.Fy();
d.BSendMsg(14, t);
} else {
let e = new v.CO();
d.BSendMsg(15, e), this.SetPeerConnection(void 0), (this.m_DataChannels.length = 0), (this.m_CloseDataChannelHandle = void 0), (this.m_CreateDataChannelHandle = void 0), (this.m_DataChannelMessageHandle = void 0);
}
}
BHasDataChannels() {
return this.m_DataChannels.length > 0;
}
}
(0, i.gn)([g.aD.bound], S.prototype, "OnDataChannel", null), (0, i.gn)([g.aD.bound], S.prototype, "OnDataChannelMessage", null), (0, i.gn)([g.aD.bound], S.prototype, "OnCloseDataChannel", null), (0, i.gn)([g.aD.bound], S.prototype, "OnCreateDataChannel", null), (0, i.gn)([g.aD.bound], S.prototype, "OnDataChannelOpen", null), (0, i.gn)([g.aD.bound], S.prototype, "OnDataChannelClose", null), (0, i.gn)([g.aD.bound], S.prototype, "OnDataChannelError", null), (0, i.gn)([g.aD.bound], S.prototype, "OnDisconnect", null);
let b = new S();
var I = n(4638),
y = n(73409),
E = n(26731);
class D {
constructor(e, t) {
if (!(e instanceof BaseAudioContext)) throw "Not a valid audio context.";
t || (t = {});
const n = t.numberOfChannels || 1;
if (n > 2) throw "The maximum supported number of channels is two.";
this.context_ = e;
const i = t.bufferSize || 0;
(this.attack = t.attack || 0), (this.release = t.release || 0);
let o = void 0 === t.timeConstant ? 0.0025 : t.timeConstant;
(this.threshold = void 0 === t.threshold ? -100 : t.threshold), (this.alpha_ = this.getAlphaFromTimeConstant_(o, this.context_.sampleRate)), (this.noiseGateKernel_ = this.context_.createScriptProcessor(i, n, n)), (this.noiseGateKernel_.onaudioprocess = this.onaudioprocess_.bind(this)), (this.input = new GainNode(this.context_)), (this.output = new GainNode(this.context_)), this.input.connect(this.noiseGateKernel_).connect(this.output), (this.previousLevel_ = 0), (this.previousWeight_ = 1), (this.channel_ = new Float32Array(this.noiseGateKernel_.bufferSize)), (this.envelope_ = new Float32Array(this.noiseGateKernel_.bufferSize)), (this.weights_ = new Float32Array(this.noiseGateKernel_.bufferSize));
}
onaudioprocess_(e) {
let t = e.inputBuffer,
n = t.getChannelData(0);
if (2 === t.numberOfChannels) {
let e = t.getChannelData(1);
for (let t = 0; t < e.length; t++) this.channel_[t] = (n[t] + e[t]) / 2;
} else this.channel_ = n;
let i = this.detectLevel_(this.channel_),
o = this.computeWeights_(i);
for (let n = 0; n < t.numberOfChannels; n++) {
let i = t.getChannelData(n),
r = e.outputBuffer.getChannelData(n);
for (let e = 0; e < i.length; e++) r[e] = o[e] * i[e];
}
}
detectLevel_(e) {
this.envelope_[0] = this.alpha_ * this.previousLevel_ + (1 - this.alpha_) * Math.pow(e[0], 2);
for (let t = 1; t < e.length; t++) this.envelope_[t] = this.alpha_ * this.envelope_[t - 1] + (1 - this.alpha_) * Math.pow(e[t], 2);
return (this.previousLevel_ = this.envelope_[this.envelope_.length - 1]), this.envelope_;
}
computeWeights_(e) {
let t = 1,
n = 1,
i = 1,
o = 1;
this.attack > 0 && ((t = Math.ceil(this.context_.sampleRate * this.attack)), (i = 1 / t)), this.release > 0 && ((n = Math.ceil(this.context_.sampleRate * this.release)), (o = 1 / n));
for (let t = 0; t < e.length; t++) {
if (D.toDecibel(2 * e[t]) < this.threshold) {
const e = this.previousWeight_ - i;
this.weights_[t] = Math.max(e, 0);
} else {
const e = this.previousWeight_ + o;
this.weights_[t] = Math.min(e, 1);
}
this.previousWeight_ = this.weights_[t];
}
return this.weights_;
}
getAlphaFromTimeConstant_(e, t) {
return Math.exp(-1 / (t * e));
}
static toDecibel(e) {
return 10 * Math.log10(e);
}
}
class w {
constructor(e, t) {
(this.m_Analyser = void 0), (this.m_rgInputNode = []), (this.m_hUpdateInterval = 0), (this.m_buffer = void 0), (this.m_lastTimeNonZero = 0), (this.m_flVolume = 0), (this.m_flRoundedVolume = 0), (this.m_flAveraging = 0.6), (0, g.rC)(this), (this.m_Analyser = t.createAnalyser()), (this.m_Analyser.fftSize = 128), (this.m_buffer = new Float32Array(this.m_Analyser.fftSize)), this.m_rgInputNode.push(e), e.connect(this.m_Analyser), this.StartUpdating();
}
GetLastTimeNonZero() {
return this.m_lastTimeNonZero;
}
StartUpdating() {
this.StopUpdating(), (this.m_hUpdateInterval = SetBackgroundInterval(this.UpdateVolume, 60));
}
StopUpdating() {
0 != this.m_hUpdateInterval && ClearBackgroundInterval(this.m_hUpdateInterval), (this.m_hUpdateInterval = 0);
}
UpdateVolume() {
this.m_Analyser.getFloatTimeDomainData(this.m_buffer);
let e = 0;
for (let t = 0; t < this.m_buffer.length; ++t) {
let n = this.m_buffer[t];
e += n * n;
}
let t = Math.sqrt(e / this.m_buffer.length);
this.m_flVolume = 1.2 * Math.max(t, this.m_flVolume * this.m_flAveraging);
let n = Math.round(100 * this.m_flVolume) / 100;
n != this.m_flRoundedVolume && (this.m_flRoundedVolume = n), this.m_flRoundedVolume > 0 && (this.m_lastTimeNonZero = performance.now());
}
stop() {
this.StopUpdating(), this.DisconnectAll();
}
Connect(e) {
this.m_rgInputNode.push(e), null != this.m_Analyser && e.connect(this.m_Analyser);
}
DisconnectAll() {
for (let e = 0; e < this.m_rgInputNode.length; ++e) {
if (this.m_Analyser)
try {
this.m_rgInputNode[e].disconnect(this.m_Analyser);
} catch (e) {}
this.m_rgInputNode[e] = void 0;
}
this.m_rgInputNode = [];
}
get rounded_volume() {
return this.m_flRoundedVolume;
}
}
(0, i.gn)([g.LO], w.prototype, "m_lastTimeNonZero", void 0), (0, i.gn)([g.LO], w.prototype, "m_flVolume", void 0), (0, i.gn)([g.LO], w.prototype, "m_flRoundedVolume", void 0), (0, i.gn)([g.aD.bound], w.prototype, "UpdateVolume", null), (0, i.gn)([g.aD.bound], w.prototype, "stop", null);
var R,
A,
M = n(97063),
k = n(84290),
T = n(82989),
L = n(93635),
G = n(91300);
!(function (e) {
(e[(e.k_EAudioStreamType_Microphone = 1)] = "k_EAudioStreamType_Microphone"), (e[(e.k_EAudioStreamType_IncomingStream = 2)] = "k_EAudioStreamType_IncomingStream");
})(R || (R = {}));
class O {
constructor() {
(this.destination_node = void 0), (this.source_node = void 0), (this.elem = void 0), (this.accountid = void 0), (this.output_gain_node = void 0), (this.muted = !1), (this.volume_meter = void 0), (0, g.rC)(this);
}
}
(0, i.gn)([g.LO], O.prototype, "accountid", void 0), (0, i.gn)([g.LO], O.prototype, "muted", void 0), (0, i.gn)([g.LO], O.prototype, "volume_meter", void 0);
class F {
constructor() {
(this.accountid = void 0), (0, g.rC)(this);
}
}
function B(e) {
switch (e) {
case A.k_EVoiceCallState_None:
return "None";
case A.k_EVoiceCallState_ScheduledInitiate:
return "ScheduledInitiate";
case A.k_EVoiceCallState_RequestedMicAccess:
return "RequestedMicAccess";
case A.k_EVoiceCallState_LocalMicOnly:
return "LocalMicOnly";
case A.k_EVoiceCallState_CreatePeerConnection:
return "CreatePeerConnection";
case A.k_EVoiceCallState_InitatedWebRTCSession:
return "InitiatedWebRTCSession";
case A.k_EVoiceCallState_WebRTCConnectedWaitingOnIceConnected:
return "WaitingOnICEConnected";
case A.k_EVoiceCallState_RequestedPermission:
return "RequestedPermission";
case A.k_EVoiceCallState_NotifyingVoiceChatOfWebRTCSession:
return "NotifyingVoiceChatOfWebRTCSession";
case A.k_EVoiceCallState_Connected:
return "Connected";
}
}
(0, i.gn)([g.LO], F.prototype, "accountid", void 0),
(function (e) {
(e[(e.k_EVoiceCallState_None = 0)] = "k_EVoiceCallState_None"), (e[(e.k_EVoiceCallState_ScheduledInitiate = 1)] = "k_EVoiceCallState_ScheduledInitiate"), (e[(e.k_EVoiceCallState_RequestedMicAccess = 2)] = "k_EVoiceCallState_RequestedMicAccess"), (e[(e.k_EVoiceCallState_LocalMicOnly = 3)] = "k_EVoiceCallState_LocalMicOnly"), (e[(e.k_EVoiceCallState_CreatePeerConnection = 4)] = "k_EVoiceCallState_CreatePeerConnection"), (e[(e.k_EVoiceCallState_InitatedWebRTCSession = 5)] = "k_EVoiceCallState_InitatedWebRTCSession"), (e[(e.k_EVoiceCallState_WebRTCConnectedWaitingOnIceConnected = 6)] = "k_EVoiceCallState_WebRTCConnectedWaitingOnIceConnected"), (e[(e.k_EVoiceCallState_RequestedPermission = 7)] = "k_EVoiceCallState_RequestedPermission"), (e[(e.k_EVoiceCallState_NotifyingVoiceChatOfWebRTCSession = 8)] = "k_EVoiceCallState_NotifyingVoiceChatOfWebRTCSession"), (e[(e.k_EVoiceCallState_Connected = 9)] = "k_EVoiceCallState_Connected");
})(A || (A = {}));
class x {
constructor() {
(this.m_eState = A.k_EVoiceCallState_None), (this.m_targetAccountID = 0), (this.m_bInitiatedOneOnOneCall = !1), (this.m_bWaitingOnOneOnOneRejoin = !1), (this.m_bPostedOneOnOneEndedMsg = !1), (this.m_chatRoom = void 0), (this.m_voiceChatID = ""), (this.m_webRTCConnectedNotification = void 0), (this.m_webRTCServerIP = 0), (this.m_webRTCServerPort = 0), (this.m_webRTCClientIP = 0), (this.m_webRTCClientPort = 0), (this.m_nFailuresThisInitiate = 0), (this.m_bOfferUpdateInProgress = !1), (this.m_msgPendingRemoteDescriptionUpdate = void 0), (this.m_bIsConnectionAttemptOverTwoSeconds = !1), (this.m_nMostRecentRemoteDescriptionVersion = "0"), (0, g.rC)(this);
}
BMatchingCall(e, t) {
return (0 != e && this.m_targetAccountID == e) || !(!this.m_chatRoom || !t || this.m_chatRoom.chatID != t.chatID || this.m_chatRoom.groupID != t.groupID);
}
BCallActiveForGroup(e) {
return this.m_chatRoom && this.m_chatRoom.groupID == e;
}
}
(0, i.gn)([g.LO], x.prototype, "m_eState", void 0), (0, i.gn)([g.LO], x.prototype, "m_targetAccountID", void 0), (0, i.gn)([g.LO], x.prototype, "m_bInitiatedOneOnOneCall", void 0), (0, i.gn)([g.LO], x.prototype, "m_bWaitingOnOneOnOneRejoin", void 0), (0, i.gn)([g.LO], x.prototype, "m_bPostedOneOnOneEndedMsg", void 0), (0, i.gn)([g.LO], x.prototype, "m_chatRoom", void 0), (0, i.gn)([g.LO], x.prototype, "m_voiceChatID", void 0), (0, i.gn)([g.LO], x.prototype, "m_nFailuresThisInitiate", void 0), (0, i.gn)([g.LO], x.prototype, "m_bIsConnectionAttemptOverTwoSeconds", void 0);
class N {
constructor() {
(this.m_SSRC = 0), (this.m_MostRecentDelayEstimateMs = 0), (this.m_MostRecentJitterReceivedMs = 0), (this.m_CurrentJitterBufferMs = 0), (this.m_PacketsReceived = 0), (this.m_PacketsLost = 0), (this.m_PacketsSent = 0), (this.m_BytesSent = 0), (this.m_googRTT = 0), (this.m_BytesReceived = 0), (this.m_DecodingThroughNetEQ = 0), (this.m_DecodingPacketLossCorrection = 0), (this.m_DecodingPacketLossFadeNoiseGeneration = 0), (this.m_DecodingComfortNoiseGeneration = 0), (this.m_DecodingNormal = 0), (this.m_DecodingSilenceGenerator = 0), (this.m_DecodingMuted = 0);
}
}
class P {
constructor() {
(this.m_SSRC = 0), (this.m_MostRecentDelayEstimateMs = 0), (this.m_TargetDelayMs = 0), (this.m_RenderDelayMs = 0), (this.m_MaxInterframeDelay = 0), (this.m_CurrentJitterBufferMs = 0), (this.m_PacketsReceived = 0), (this.m_PacketsLost = 0), (this.m_BytesReceived = 0), (this.m_FramesDecoded = 0), (this.m_DecodeMs = 0), (this.m_MaxDecodeMs = 0), (this.m_FrameWidthReceived = 0), (this.m_FrameHeightRecieved = 0), (this.m_FrameRateReceived = 0), (this.m_FrameRateDecoded = 0), (this.m_FrameRateOutput = 0), (this.m_NacksSent = 0), (this.m_PlisSent = 0);
}
}
const U = "SteamVoiceSettings";
class V {
constructor(e) {
(this.m_VoiceInputGain = 1), (this.m_VoiceOutputGain = 1), (this.m_NoiseGateLevel = G.S7.k_ENoiseGateLevel_Medium), (this.m_VoiceUseEchoCancellation = !0), (this.m_VoiceUseNoiseCancellation = !0), (this.m_VoiceUseAutoGainControl = !0), (this.m_SelectedMicID = "default"), (this.m_SelectedOutputID = "default"), (this.m_bPlayPTTSounds = !0), (this.m_bSettingsLoaded = !1), (this.m_bHasResetOpenMicHotkey = !1), (0, g.rC)(this), (this.m_SettingsStore = e);
}
SaveToLocalStorage() {
this.m_SettingsStore.StoreObjectInLocalStorage(U, { inputGain: this.m_VoiceInputGain, outputGain: this.m_VoiceOutputGain, noiseGateLevel: this.m_NoiseGateLevel, noiseCancellation: this.m_VoiceUseNoiseCancellation, echoCancellation: this.m_VoiceUseEchoCancellation, autoGainControl: this.m_VoiceUseAutoGainControl, selectedMic: this.m_SelectedMicID, selectedOutput: this.m_SelectedOutputID, pttSoundsEnabled: this.m_bPlayPTTSounds, hasResetOpenMicHotKey: this.m_bHasResetOpenMicHotkey });
}
LoadFromLocalStorage(e) {
this.m_SettingsStore.GetObjectFromLocalStorageWhenReady(U, void 0).then((t) => {
null != t && (null != t.inputGain && (this.m_VoiceInputGain = t.inputGain), null != t.outputGain && (this.m_VoiceOutputGain = t.outputGain), null != t.noiseGateLevel && (this.m_NoiseGateLevel = t.noiseGateLevel), null != t.noiseCancellation && (this.m_VoiceUseNoiseCancellation = t.noiseCancellation), null != t.autoGainControl && (this.m_VoiceUseAutoGainControl = t.autoGainControl), null != t.echoCancellation && (this.m_VoiceUseEchoCancellation = t.echoCancellation), null != t.selectedMic && (this.m_SelectedMicID = t.selectedMic), null != t.selectedOutput && (this.m_SelectedOutputID = t.selectedOutput), null != t.pttSoundsEnabled && (this.m_bPlayPTTSounds = t.pttSoundsEnabled), null != t.hasResetOpenMicHotKey && (this.m_bHasResetOpenMicHotkey = t.hasResetOpenMicHotKey)), (this.m_bSettingsLoaded = !0), e.LogMsg("(VoiceChat) Settings loaded from local storage"), e.RefreshPushToTalkKeySettings();
});
}
}
(0, i.gn)([g.LO], V.prototype, "m_VoiceInputGain", void 0), (0, i.gn)([g.LO], V.prototype, "m_VoiceOutputGain", void 0), (0, i.gn)([g.LO], V.prototype, "m_NoiseGateLevel", void 0), (0, i.gn)([g.LO], V.prototype, "m_VoiceUseEchoCancellation", void 0), (0, i.gn)([g.LO], V.prototype, "m_VoiceUseNoiseCancellation", void 0), (0, i.gn)([g.LO], V.prototype, "m_VoiceUseAutoGainControl", void 0), (0, i.gn)([g.LO], V.prototype, "m_SelectedMicID", void 0), (0, i.gn)([g.LO], V.prototype, "m_SelectedOutputID", void 0), (0, i.gn)([g.LO], V.prototype, "m_bPlayPTTSounds", void 0), (0, i.gn)([g.LO], V.prototype, "m_bSettingsLoaded", void 0), (0, i.gn)([g.LO], V.prototype, "m_bHasResetOpenMicHotkey", void 0);
class H {
constructor() {
(this.muted = !1), (this.gain = 1), (0, g.rC)(this);
}
}
(0, i.gn)([g.LO], H.prototype, "muted", void 0), (0, i.gn)([g.LO], H.prototype, "gain", void 0);
class W {
constructor() {
(this.mic_muted_locally = !1), (this.output_muted_locally = !1), (this.has_no_mic_for_session = !1), (0, g.rC)(this);
}
}
(0, i.gn)([g.LO], W.prototype, "mic_muted_locally", void 0), (0, i.gn)([g.LO], W.prototype, "output_muted_locally", void 0), (0, i.gn)([g.LO], W.prototype, "has_no_mic_for_session", void 0);
class X {
constructor() {
(this.partner_accountid = 0), (this.voice_chatid = ""), (this.previously_joined = !1), (this.audio_repeat = 0), (this.audio_buffer = void 0), (0, g.rC)(this);
}
ClearAudioRepeats() {
0 != this.audio_repeat && (ClearBackgroundTimeout(this.audio_repeat), (this.audio_repeat = 0)), null != this.audio_buffer && (this.audio_buffer.StopPlayback(), (this.audio_buffer = void 0));
}
}
(0, i.gn)([g.LO], X.prototype, "partner_accountid", void 0), (0, i.gn)([g.LO], X.prototype, "voice_chatid", void 0), (0, i.gn)([g.LO], X.prototype, "previously_joined", void 0);
class j {
constructor(e) {
(this.m_VoiceCallState = new x()),
(this.m_mapOneOnOneCallsWaitingJoinOrAccept = g.LO.map()),
(this.m_hRegisterForPushToTalkStateChange = null),
(this.m_VoiceChatActiveStateChangeCallbacks = new m.pB()),
(this.m_bPushToTalkEnabled = !1),
(this.m_bPushToMuteEnabled = !1),
(this.m_bVoicePTTStateEnabled = !1),
(this.m_VKPushToTalkHotKey = 0),
(this.m_strPushToTalkDisplayString = ""),
(this.m_hPushToTalkReleaseTimeout = 0),
(this.m_ConnectionCheck = 0),
(this.m_ScheduledInitiate = 0),
(this.m_ScheduledVoiceLogsUpload = 0),
(this.m_bClientSideLogsUploadInProgress = !1),
(this.m_nLastLogLineUploaded = 0),
(this.m_StatsTimeout = 0),
(this.m_bUserHasDeniedMicPermissions = !1),
(this.m_bOutputMuted = !1),
(this.m_AudioContext = void 0),
(this.m_rgAudioStreams = (0, g.LO)([])),
(this.m_MicVolumeMeter = void 0),
(this.m_MicNoiseGate = void 0),
(this.m_MicInputGainNode = void 0),
(this.m_rgVideoStreams = (0, g.LO)([])),
(this.m_bSendVideo = !1),
(this.m_bReceiveVideo = !1),
(this.m_rgLogLines = []),
(this.m_mapSSRCToAccountID = new Map()),
(this.m_mapAccountIDToAudioStats = new Map()),
(this.m_mapAccountIDToVideoStats = new Map()),
(this.m_mapPerUserOutputGain = g.LO.map()),
(this.m_mapUserVoiceStatus = g.LO.map()),
(this.m_PeerConnection = void 0),
(this.m_Settings = void 0),
(this.m_LogVoiceChatDetails = !1),
(this.m_VoiceEchoLocalMic = !1),
(this.m_bLocalMicEchoStateBeforeMicTest = !1),
(this.m_bLocalMicTestActive = !1),
(this.m_bForceConnectingStatus = !1),
(this.m_bForceReconnectingStatus = !1),
(this.m_rgPositions = []),
(this.m_rgFreePositionIndices = []),
(this.m_localPose = void 0),
(this.m_mapRemotePoseForAccountID = new Map()),
(this.m_fnPendingOneOnOneVoiceChatRequestsCallback = null),
(this.m_pendingOneOnOneVoiceChatRequestsAutorunDisposer = null),
(this.m_fnCurrentUserVoiceLevelCallback = null),
(this.m_currentUserVoiceLevelAutorunDisposer = null),
(0, g.rC)(this),
(this.m_Settings = new V(e)),
this.m_Settings.LoadFromLocalStorage(this),
this.DispatchSetVoiceChatActive(!1),
(f.Supplier = this),
this.GenerateVoicePositions();
}
DispatchSetVoiceChatActive(e) {
if ((this.m_VoiceChatActiveStateChangeCallbacks.Dispatch(e), "undefined" != typeof SteamClient && null != SteamClient && null != SteamClient.WebChat && null != SteamClient.WebChat.SetVoiceChatActive))
try {
SteamClient.WebChat.SetVoiceChatActive(e);
} catch (e) {}
}
Init(e) {
(this.m_CMInterface = e),
(window.SetVoiceEchoLocalMic = this.SetVoiceEchoLocalMic),
(window.SetVoiceLogDetails = this.SetVoiceLogDetails),
(window.SetVoiceForceReconnectingStatus = this.ForceReconnectingStatus),
(window.SetVoiceForceConnectingStatus = this.ForceConnectingStatus),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandler(y.q0.NotifyOneOnOneChatRequestedHandler, (e) => {
let t = new u.K(e.Body().steamid_partner()),
n = e.Body().voice_chatid(),
i = h.Ul.FriendStore.GetFriend(t.GetAccountID());
if (null == i || i.is_blocked || h.Ul.FriendStore.BIsInvisibleMode() || h.Ul.FriendStore.GetUserDoNotDisturb()) return this.LogMsg("(VoiceChat) Rejecting one-on-one voice chat request because partner is not a friend, is blocked, we are invisible, or we are DND"), this.OnRejectOneOnOneVoiceChat(t, e.Body().voice_chatid()), 1;
let o = new X();
(o.partner_accountid = this.m_CMInterface.steamid.GetAccountID()), (o.voice_chatid = n), (o.previously_joined = !1);
let r = this;
if (
((o.audio_repeat = SetBackgroundTimeout(function () {
(o.audio_repeat = 0), r.PlayRingSound(t.GetAccountID());
}, 2e4)),
this.m_mapOneOnOneCallsWaitingJoinOrAccept.set(t.GetAccountID(), o),
this.LogMsg("(VoiceChat) voice chat request from " + t.GetAccountID()),
this.LogMsg("(VoiceChat) current state " + this.m_VoiceCallState.m_eState),
this.m_VoiceCallState.m_targetAccountID == t.GetAccountID())
)
return this.LogMsg("(VoiceChat) We are already trying to one on one chat this user, just auto-acceptting to re-sync."), this.OnAcceptOneOnOneVoiceChat(t, n), 1;
h.Ul.NotificationManager.DisplayNotificationFromFriend(i, { title: i.display_name, body: (0, k.Xx)("#Friend_RequestingOneOnOneChat", i.display_name), tag: "state_" + i.accountid, steamid: i.persona.m_steamid.ConvertTo64BitString() });
let a = h.Ul.ChatStore.GetFriendChat(t.GetAccountID(), !0);
return null != a && (a.AddVoiceChannelInviteMsg(t.GetAccountID(), h.Ul.GetServerRTime32(), (0, k.Xx)("#FriendMsg_VoiceChannelInvite", i.display_name, a.self.display_name)), h.Ul.UIStore.ShowAndOrActivateChat(h.Ul.GetDefaultBrowserContext(), a, !1)), this.PlayRingSound(i.accountid), 1;
}),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandler(y.q0.NotifyVoiceChatEndedHandler, (e) => {
let t = e.Body().voice_chatid();
for (let e of Array.from(this.m_mapOneOnOneCallsWaitingJoinOrAccept.keys())) {
let n = this.m_mapOneOnOneCallsWaitingJoinOrAccept.get(e);
if (null != n && n.voice_chatid == t) {
this.LogMsg("(VoiceChat) OneOnOne VoiceChat we were invited too with " + e + " has ended and is no longer joinable."), h.Ul.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/steam_voice_channel_exit.m4a?v=1");
let t = Number(e);
this.DeleteOneOnOneCallWaitingJoinOrAccept(t);
let n = h.Ul.ChatStore.GetFriendChat(t, !1),
i = h.Ul.FriendStore.GetFriend(t);
null != n && (i ? n.AddVoiceChannelInviteMsg(i.accountid, h.Ul.GetServerRTime32(), (0, k.Xx)("#FriendMsg_VoiceChannelEndedExplicit", i.display_name)) : n.AddVoiceChannelInviteMsg(this.m_CMInterface.steamid.GetAccountID(), h.Ul.GetServerRTime32(), (0, k.Xx)("#FriendMsg_VoiceChannelEnded")), this.m_VoiceCallState.m_targetAccountID == Number(e) && (this.m_VoiceCallState.m_bPostedOneOnOneEndedMsg = !0));
}
}
if (t == this.m_VoiceCallState.m_voiceChatID) {
if (0 != this.m_VoiceCallState.m_targetAccountID) {
let e = h.Ul.ChatStore.GetFriendChat(this.m_VoiceCallState.m_targetAccountID, !1);
null == e || this.m_VoiceCallState.m_bPostedOneOnOneEndedMsg || ((this.m_VoiceCallState.m_bPostedOneOnOneEndedMsg = !0), e.AddVoiceChannelInviteMsg(this.m_CMInterface.steamid.GetAccountID(), h.Ul.GetServerRTime32(), (0, k.Xx)("#FriendMsg_VoiceChannelEnded")));
}
0 != this.m_VoiceCallState.m_targetAccountID && this.m_VoiceCallState.m_eState > A.k_EVoiceCallState_RequestedPermission && h.Ul.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/steam_voice_channel_exit.m4a?v=1"), this.LogMsg("(VoiceChat) Got voice chat end notification from server for active chatid"), this.EndVoiceChatInternal(!1);
}
return 1;
}),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandler(y.q0.NotifyUserJoinedVoiceChatHandler, (e) => {
if (e.Body().voice_chatid() == this.m_VoiceCallState.m_voiceChatID) {
let t = new u.K(e.Body().user_steamid());
this.LogMsg("(VoiceChat) User " + t.Render() + " has just JOINED our active voice chat"), 0 != this.m_VoiceCallState.m_targetAccountID && this.m_VoiceCallState.m_targetAccountID == t.GetAccountID() && (this.m_VoiceCallState.m_bWaitingOnOneOnOneRejoin = !1);
}
return 1;
}),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandler(y.q0.NotifyUserLeftVoiceChatHandler, (e) => {
if (e.Body().voice_chatid() == this.m_VoiceCallState.m_voiceChatID) {
let t = new u.K(e.Body().user_steamid());
this.LogMsg("(VoiceChat) User " + t.Render() + " has just LEFT our active voice chat"), 0 != this.m_VoiceCallState.m_targetAccountID && this.m_VoiceCallState.m_targetAccountID == t.GetAccountID() && (this.m_VoiceCallState.m_bWaitingOnOneOnOneRejoin = !0);
}
return 1;
}),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandler(I.ej.NotifyShouldRejoinChatRoomVoiceChatHandler, (e) => {
let t = { groupID: e.Body().chat_group_id(), chatID: e.Body().chat_id() };
return this.m_VoiceCallState.m_eState > A.k_EVoiceCallState_ScheduledInitiate && this.m_VoiceCallState.BMatchingCall(0, t) && (this.LogMsg("(ChatRoom) Notified that we need to rejoin new voicechat session for chat room... doing so now..."), this.EndVoiceChatInternal(!0), this.InitiateVoiceChat(0, t)), 1;
}),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandler(E.dF.NotifyWebRTCUpdateRemoteDescriptionHandler, (e) => (this.m_VoiceCallState.m_eState < A.k_EVoiceCallState_InitatedWebRTCSession ? (this.LogMsg("(WebRTC) Hit NotifyWebRTCUpdateRemoteDescriptionHandler in wrong state " + this.m_VoiceCallState.m_eState), 2) : (this.m_VoiceCallState.m_bOfferUpdateInProgress ? (this.LogMsg("(WebRTC) Hit NotifyWebRTCUpdateRemoteDescriptionHandler while already updating, queing work"), (this.m_VoiceCallState.m_msgPendingRemoteDescriptionUpdate = e.Body())) : this.ProcessUpdatedRemoteDescription(e.Body()), 1))),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandler(E.dF.NotifyWebRTCSessionConnectedHandler, (e) =>
this.m_VoiceCallState.m_eState < A.k_EVoiceCallState_InitatedWebRTCSession
? (this.LogMsg("(WebRTC) Hit NotifyWebRTCSessionConnectedHandler in wrong state " + this.m_VoiceCallState.m_eState), 2)
: ((this.m_VoiceCallState.m_webRTCConnectedNotification = e.Body()),
(this.m_VoiceCallState.m_webRTCServerIP = this.m_VoiceCallState.m_webRTCConnectedNotification.server_ip()),
(this.m_VoiceCallState.m_webRTCServerPort = this.m_VoiceCallState.m_webRTCConnectedNotification.server_port()),
(this.m_VoiceCallState.m_webRTCClientIP = this.m_VoiceCallState.m_webRTCConnectedNotification.client_ip()),
(this.m_VoiceCallState.m_webRTCClientPort = this.m_VoiceCallState.m_webRTCConnectedNotification.client_port()),
"completed" == this.m_PeerConnection.iceConnectionState || "connected" == this.m_PeerConnection.iceConnectionState ? (this.LogMsg("(VoiceChat) ICE state is already connected after successful SetRemoteDescription, joining voice chat immediately"), this.JoinVoiceChatOrAskForOneOnOneChatNow()) : (this.LogMsg("(VoiceChat) ICE state is not connected after successful SetRemoteDescription, waiting for UDP connetivity"), (this.m_VoiceCallState.m_eState = A.k_EVoiceCallState_WebRTCConnectedWaitingOnIceConnected)),
1),
),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandler(y.q0.NotifyAllUsersVoiceStatusHandler, (e) => {
if (this.m_VoiceCallState.m_voiceChatID != e.Body().voice_chatid()) return 1;
for (let t = 0; t < e.Body().users().length; ++t) {
let n = e.Body().users()[t];
this.UpdateUserVoiceStatus(n);
}
return 1;
}),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandler(y.q0.NotifyUserVoiceStatusHandler, (e) => (this.UpdateUserVoiceStatus(e.Body()), 1)),
this.m_CMInterface.messageHandlers.RegisterServiceNotificationHandler(y.q0.NotifyOneOnOneChatResponseHandler, (e) => {
if (this.m_VoiceCallState.m_eState >= A.k_EVoiceCallState_RequestedPermission) {
let t = new u.K(e.Body().steamid_partner());
if (e.Body().voicechat_id() != this.m_VoiceCallState.m_voiceChatID) this.LogMsg("(VoiceChat) Got response from " + t.GetAccountID() + " but for different voice chat than we are in, ignoring. ");
else if (t.GetAccountID() == this.m_VoiceCallState.m_targetAccountID && 1 == e.Body().accepted_request()) this.LogMsg("(VoiceChat) Got acceptance from " + t.GetAccountID() + " " + e.Hdr().steamid()), h.Ul.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/steam_voice_channel_enter.m4a?v=1"), this.OnVoiceChatAccepted(!0);
else {
this.LogMsg("(VoiceChat) Rejected by " + t.GetAccountID());
let e = h.Ul.ChatStore.GetFriendChat(t.GetAccountID(), !1),
n = h.Ul.FriendStore.GetFriend(t.GetAccountID());
null != e && null != n && ((this.m_VoiceCallState.m_bPostedOneOnOneEndedMsg = !0), e.AddVoiceChannelInviteMsg(t.GetAccountID(), h.Ul.GetServerRTime32(), (0, k.Xx)("#FriendMsg_VoiceChannelEndedExplicit", n.display_name))), this.DeleteOneOnOneCallWaitingJoinOrAccept(t.GetAccountID()), h.Ul.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/steam_voice_channel_exit.m4a?v=1"), this.OnVoiceChatAccepted(!1);
}
}
return 1;
});
}
GetLocalAccountID() {
return this.m_CMInterface.steamid.GetAccountID();
}
RefreshPushToTalkKeySettings() {
"undefined" != typeof SteamClient &&
null != SteamClient.WebChat &&
null != SteamClient.WebChat.GetPushToTalkEnabled &&
SteamClient.WebChat.GetPushToTalkEnabled().then((e) => {
(this.m_bPushToTalkEnabled = e.bEnabled), (this.m_VKPushToTalkHotKey = e.vkHotKey), e.bPushToMute && ((this.m_bPushToMuteEnabled = e.bEnabled), (this.m_bPushToTalkEnabled = !1)), (this.m_strPushToTalkDisplayString = e.strKeyName || "None"), this.m_bPushToTalkEnabled || this.m_bPushToMuteEnabled || (null != SteamClient.WebChat && null != SteamClient.WebChat.SetPushToTalkHotKey && ((0, L.X)(this.m_Settings.m_bSettingsLoaded, "Settings not loaded but RefreshPushToTalkKeySettings hit"), this.m_Settings.m_bHasResetOpenMicHotkey || ((this.m_Settings.m_bHasResetOpenMicHotkey = !0), this.m_Settings.SaveToLocalStorage(), console.log("Reset Open Mic hotkey to None on first run of new client in open mic mode"), SteamClient.WebChat.SetPushToTalkHotKey(0), this.RefreshPushToTalkKeySettings())));
}),
"undefined" != typeof SteamClient && null === this.m_hRegisterForPushToTalkStateChange && null != SteamClient && null != SteamClient.WebChat && null != SteamClient.WebChat.RegisterForPushToTalkStateChange && (this.m_hRegisterForPushToTalkStateChange = SteamClient.WebChat.RegisterForPushToTalkStateChange(this.OnPushToTalkStateChange));
}
InitiateFriendChat(e) {
this.BPartnerHasRequestedAndIsInOneOnOneChat(e) ? this.AcceptPartnersOneOnOneChatRequest(e) : (this.InitiateVoiceChat(e, null), h.Ul.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/steam_phonecall.m4a?v=1"));
}
InitiateRoomChat(e, t) {
this.InitiateVoiceChat(0, { groupID: e, chatID: t });
}
RegisterForVoiceChatActiveStateChange(e) {
return this.m_VoiceChatActiveStateChangeCallbacks.Register(e);
}
EndLocalMicTest() {
(this.m_bLocalMicTestActive = !1), this.m_VoiceCallState.m_eState == A.k_EVoiceCallState_LocalMicOnly && this.EndVoiceChatInternal(!1), this.SetVoiceEchoLocalMic(this.m_bLocalMicEchoStateBeforeMicTest);
}
IsLocalMicTestActive() {
return this.m_bLocalMicTestActive;
}
InitiateLocalMicTest() {
(this.m_bLocalMicTestActive = !0), (this.m_bLocalMicEchoStateBeforeMicTest = this.m_VoiceEchoLocalMic), this.SetVoiceEchoLocalMic(!0), this.m_VoiceCallState.m_eState == A.k_EVoiceCallState_None && this.InitiateVoiceChat(0, null);
}
GetOneOnOneCallsWaitingForJoinOrAccept() {
return this.m_mapOneOnOneCallsWaitingJoinOrAccept;
}
AcceptPartnersOneOnOneChatRequest(e) {
let t = this.m_mapOneOnOneCallsWaitingJoinOrAccept.get(e);
if (null == t) return !1;
(this.m_VoiceCallState.m_timeStartedConnecting = void 0), t.ClearAudioRepeats();
let n = u.K.InitFromAccountID(e);
return this.OnAcceptOneOnOneVoiceChat(n, t.voice_chatid), !0;
}
OnRejectOneOnOneVoiceChatForPartner(e) {
let t = this.m_mapOneOnOneCallsWaitingJoinOrAccept.get(e);
if (null == t) return !1;
t.ClearAudioRepeats();
let n = u.K.InitFromAccountID(e);
this.OnRejectOneOnOneVoiceChat(n, t.voice_chatid), this.m_mapOneOnOneCallsWaitingJoinOrAccept.delete(e);
let i = h.Ul.ChatStore.GetFriendChat(e, !1),
o = h.Ul.FriendStore.self;
return null != i && null != o && ((this.m_VoiceCallState.m_targetAccountID == e && this.m_VoiceCallState.m_bPostedOneOnOneEndedMsg) || i.AddVoiceChannelInviteMsg(o.accountid, h.Ul.GetServerRTime32(), (0, k.Xx)("#FriendMsg_VoiceChannelEndedExplicit", o.display_name)), this.m_VoiceCallState.m_targetAccountID == e && (this.m_VoiceCallState.m_bPostedOneOnOneEndedMsg = !0)), !0;
}
OnUserLeaveOneOnOneVoiceChat() {
0 != this.m_VoiceCallState.m_targetAccountID || this.m_VoiceCallState.m_eState == A.k_EVoiceCallState_None ? (this.LogMsg("(VoiceChat) User asking to leave but not end one-on-one chat with: " + this.m_VoiceCallState.m_targetAccountID), this.EndVoiceChatInternal(!1)) : this.LogMsg("(VoiceChat) OnUserLeaveOneOnOneVoiceChat called when in a group not one-on-one chat!");
}
OnUserEndVoiceChat() {
if (this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_None && 0 != this.m_VoiceCallState.m_targetAccountID) {
if (!this.m_VoiceCallState.m_bPostedOneOnOneEndedMsg) {
let e = h.Ul.ChatStore.GetFriendChat(this.m_VoiceCallState.m_targetAccountID, !1),
t = h.Ul.FriendStore.self;
null != e && null != t && ((this.m_VoiceCallState.m_bPostedOneOnOneEndedMsg = !0), e.AddVoiceChannelInviteMsg(h.Ul.CMInterface.steamid.GetAccountID(), h.Ul.GetServerRTime32(), (0, k.Xx)("#FriendMsg_VoiceChannelEndedExplicit", t.display_name)));
}
let e = this.m_VoiceCallState.m_targetAccountID;
this.m_VoiceCallState.m_targetAccountID = 0;
let t = r.gA.Init(y.j5);
t.Body().set_steamid_partner(u.K.InitFromAccountID(e).ConvertTo64BitString()),
this.DeleteOneOnOneCallWaitingJoinOrAccept(e),
y.p3.EndOneOnOneChat(this.m_CMInterface.GetServiceTransport(), t).then((t) => {
1 == t.GetEResult() ? this.LogMsg("(VoiceChat) Ended voice chat with " + e) : this.LogMsg("(VoiceChat) Failed ending voice chat with " + e);
});
}
0 != this.m_VoiceCallState.m_targetAccountID && this.DeleteOneOnOneCallWaitingJoinOrAccept(this.m_VoiceCallState.m_targetAccountID), this.EndVoiceChatInternal(!1);
}
RegisterForPendingOneOnOneVoiceChatRequests(e) {
(this.m_fnPendingOneOnOneVoiceChatRequestsCallback = e),
this.m_pendingOneOnOneVoiceChatRequestsAutorunDisposer && this.m_pendingOneOnOneVoiceChatRequestsAutorunDisposer(),
(this.m_pendingOneOnOneVoiceChatRequestsAutorunDisposer = null),
this.m_fnPendingOneOnOneVoiceChatRequestsCallback &&
(this.m_pendingOneOnOneVoiceChatRequestsAutorunDisposer = (0, g.EH)(() => {
if (!this.m_fnPendingOneOnOneVoiceChatRequestsCallback) return;
let e = Array.from(this.m_mapOneOnOneCallsWaitingJoinOrAccept.keys()).filter((e) => !this.BSelfHadPreviouslyJoinedOneOnOneChat(e) && this.GetActiveOneOnOneVoiceChatAccountID() != e && this.BPartnerHasRequestedAndIsInOneOnOneChat(e));
this.m_fnPendingOneOnOneVoiceChatRequestsCallback(e);
}));
}
RegisterForCurrentUserVoiceLevel(e) {
(this.m_fnCurrentUserVoiceLevelCallback = e),
this.m_currentUserVoiceLevelAutorunDisposer && this.m_currentUserVoiceLevelAutorunDisposer(),
(this.m_currentUserVoiceLevelAutorunDisposer = null),
this.m_fnCurrentUserVoiceLevelCallback &&
(this.m_currentUserVoiceLevelAutorunDisposer = (0, g.EH)(() => {
if (!this.m_fnCurrentUserVoiceLevelCallback) return;
let e = this.get_volume(this.GetLocalAccountID());
this.m_fnCurrentUserVoiceLevelCallback(e);
}));
}
SetSelectedMic(e) {
e != this.m_Settings.m_SelectedMicID && (this.LogMsg("(VoiceChat) Set selected mic " + e), (this.m_Settings.m_SelectedMicID = e), this.m_Settings.SaveToLocalStorage(), this.RestartVoiceChatIfConnected());
}
SetSelectedOutput(e) {
e != this.m_Settings.m_SelectedOutputID && (this.LogMsg("(VoiceChat) Set selected output " + e), (this.m_Settings.m_SelectedOutputID = e), this.m_Settings.SaveToLocalStorage(), this.RestartVoiceChatIfConnected());
}
GetAudioWorkletSupport() {
return h.Ul.AudioPlaybackManager.supports_audio_worklets;
}
GetUserDeniedMicAccess() {
return this.m_bUserHasDeniedMicPermissions;
}
GetSelectedMic() {
return this.m_Settings.m_SelectedMicID;
}
GetSelectedOutputDevice() {
return this.m_Settings.m_SelectedOutputID;
}
SetUseEchoCancellation(e) {
e != this.m_Settings.m_VoiceUseEchoCancellation && ((this.m_Settings.m_VoiceUseEchoCancellation = e), this.m_Settings.SaveToLocalStorage(), this.RestartVoiceChatIfConnected());
}
GetUseEchoCancellation() {
return this.m_Settings.m_VoiceUseEchoCancellation;
}
SetUseNoiseCancellation(e) {
e != this.m_Settings.m_VoiceUseNoiseCancellation && ((this.m_Settings.m_VoiceUseNoiseCancellation = e), this.m_Settings.SaveToLocalStorage(), this.RestartVoiceChatIfConnected());
}
GetUseNoiseCancellation() {
return this.m_Settings.m_VoiceUseNoiseCancellation;
}
SetUseAutoGainControl(e) {
e != this.m_Settings.m_VoiceUseAutoGainControl && ((this.m_Settings.m_VoiceUseAutoGainControl = e), this.m_Settings.SaveToLocalStorage(), this.RestartVoiceChatIfConnected());
}
GetUseAutoGainControl() {
return this.m_Settings.m_VoiceUseAutoGainControl;
}
SetVoiceEchoLocalMic(e) {
(this.m_VoiceEchoLocalMic = e), this.UpdateNoiseGateOnActiveMic();
}
GetVoiceEchoLocalMic() {
return this.m_VoiceEchoLocalMic;
}
GetPushToTalkOrMuteSoundsEnabled() {
return this.m_Settings.m_bPlayPTTSounds;
}
SetPushToTalkOrMuteSoundsEnabled(e) {
this.m_Settings.m_bPlayPTTSounds != e && ((this.m_Settings.m_bPlayPTTSounds = e), this.m_Settings.SaveToLocalStorage());
}
SetPushToTalkEnabled(e) {
(this.m_bPushToTalkEnabled = e), (this.m_bPushToMuteEnabled = !1);
}
GetPushToTalkEnabled() {
return this.m_bPushToTalkEnabled;
}
SetPushToMuteEnabled(e) {
(this.m_bPushToMuteEnabled = e), (this.m_bPushToTalkEnabled = !1);
}
GetPushToMuteEnabled() {
return this.m_bPushToMuteEnabled;
}
GetPushToTalkVoiceStateEnabled() {
return this.m_bVoicePTTStateEnabled;
}
GetPushToTalkHotKeyVK() {
return this.m_VKPushToTalkHotKey;
}
GetPushToTalkHotKeyDisplayString() {
return this.m_strPushToTalkDisplayString;
}
ConfigureVideo(e, t) {
(this.m_bSendVideo = e), (this.m_bReceiveVideo = t);
}
GetPerUserGainLevels() {
return this.m_mapPerUserOutputGain;
}
GetPerUserVoiceStatus() {
return this.m_mapUserVoiceStatus;
}
SetVoiceLogDetails(e) {
this.m_LogVoiceChatDetails = e;
}
GetVoiceLogDetails() {
return this.m_LogVoiceChatDetails;
}
SetUseNoiseGateLevel(e) {
e != this.m_Settings.m_NoiseGateLevel && (this.LogMsg("(VoiceChat) Nose Gate Level: " + e), (this.m_Settings.m_NoiseGateLevel = e), this.m_Settings.SaveToLocalStorage(), this.UpdateNoiseGateOnActiveMic());
}
GetUseNoiseGateLevel() {
return this.m_Settings.m_NoiseGateLevel;
}
SetVoiceInputGain(e) {
if (this.m_Settings.m_VoiceInputGain != e) {
(this.m_Settings.m_VoiceInputGain = Math.max(0, Math.min(e, j.k_MaxInputOutputGainValue))), this.LogMsg("(VoiceChat) New mic Input Gain value is " + this.m_Settings.m_VoiceInputGain), null != this.m_MicInputGainNode && this.m_MicInputGainNode.gain.setValueAtTime(this.GetCurrentVoiceInputGainTarget(), this.m_AudioContext.currentTime);
const t = 0 == this.m_Settings.m_VoiceInputGain && !this.IsMicMuted(),
n = 0 != this.m_Settings.m_VoiceInputGain && this.IsMicMuted();
(t || n) && this.ToggleMicMuting(), this.m_Settings.SaveToLocalStorage();
}
}
GetVoiceInputGain() {
return this.m_Settings.m_VoiceInputGain;
}
SetVoiceOutputGain(e) {
if (this.m_Settings.m_VoiceOutputGain != e) {
(this.m_Settings.m_VoiceOutputGain = Math.max(0, Math.min(e, j.k_MaxInputOutputGainValue))), this.LogMsg("(VoiceChat) New global OutputGain value is " + this.m_Settings.m_VoiceOutputGain);
const t = 0 == this.m_Settings.m_VoiceOutputGain && !this.IsOutputMuted(),
n = 0 != this.m_Settings.m_VoiceOutputGain && this.IsOutputMuted();
(t || n) && this.ToggleOutputMuting(), this.m_Settings.SaveToLocalStorage();
for (let e = 0; e < this.m_rgAudioStreams.length; ++e) {
let t = this.m_rgAudioStreams[e];
t.output_gain_node && (t.type == R.k_EAudioStreamType_Microphone ? t.output_gain_node.gain.setValueAtTime(this.m_Settings.m_VoiceOutputGain, this.m_AudioContext.currentTime) : t.output_gain_node.gain.setValueAtTime(this.m_Settings.m_VoiceOutputGain * this.GetPerUserGainLevel(t.accountid), this.m_AudioContext.currentTime));
}
}
}
BIsAccountFullyConnectedToActiveVoiceChat(e) {
if (e == this.m_CMInterface.steamid.GetAccountID()) return this.m_VoiceCallState.m_eState == A.k_EVoiceCallState_Connected;
if (this.m_VoiceCallState.m_eState < A.k_EVoiceCallState_Connected) return !1;
for (let t = 0; t < this.m_rgAudioStreams.length; ++t) {
let n = this.m_rgAudioStreams[t];
if (n.output_gain_node && n.type == R.k_EAudioStreamType_IncomingStream && n.accountid == e) return !0;
}
return !1;
}
GetVoiceOutputGain() {
return this.m_Settings.m_VoiceOutputGain;
}
GetUserMutedRemotely(e) {
let t = this.m_mapUserVoiceStatus.get(e);
return null == t && ((t = new W()), this.m_mapUserVoiceStatus.set(e, t)), t.mic_muted_locally;
}
GetOutputMutedRemotely(e) {
let t = this.m_mapUserVoiceStatus.get(e);
return null == t && ((t = new W()), this.m_mapUserVoiceStatus.set(e, t)), t.output_muted_locally;
}
GetUserHasNoMicForSession(e) {
let t = this.m_mapUserVoiceStatus.get(e);
return null == t && ((t = new W()), this.m_mapUserVoiceStatus.set(e, t)), t.has_no_mic_for_session;
}
ConvertSliderToGainValue(e, t) {
return (e = e <= 50 ? (e / 50) * 1 : 1 + ((e - 50) / 50) * (t - 1));
}
ConvertGainValueToSliderValue(e, t) {
let n = e;
return (n = e <= 1 ? 50 * e : 50 + ((e - 1) / (t - 1)) * 50), n;
}
ForceReconnectingStatus(e) {
this.m_bForceReconnectingStatus = !0;
}
ForceConnectingStatus(e) {
this.m_bForceConnectingStatus = !0;
}
GetActiveChatRoomGroupID() {
return this.m_VoiceCallState.m_eState == A.k_EVoiceCallState_None ? "" : this.m_VoiceCallState.m_chatRoom ? this.m_VoiceCallState.m_chatRoom.groupID : "";
}
GetActiveVoiceChatID() {
return this.m_VoiceCallState.m_eState == A.k_EVoiceCallState_None ? "" : this.m_VoiceCallState.m_chatRoom ? this.m_VoiceCallState.m_chatRoom.chatID : "";
}
BInitiatedOneOnOneChat(e) {
return this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_None && this.m_VoiceCallState.m_targetAccountID == e && this.m_VoiceCallState.m_bInitiatedOneOnOneCall;
}
ToggleMicMuting() {
for (let e = 0; e < this.m_rgAudioStreams.length; ++e) {
let t = this.m_rgAudioStreams[e];
if (t.type == R.k_EAudioStreamType_Microphone) {
t.muted = !t.muted;
let e = t.stream.getTracks();
for (let n = 0; n < e.length; n++) e[n].enabled = !t.muted;
t.muted ? this.m_MicInputGainNode.gain.setValueAtTime(0, this.m_AudioContext.currentTime + 0.2) : this.m_MicInputGainNode.gain.setValueAtTime(this.GetCurrentVoiceInputGainTarget(), this.m_AudioContext.currentTime);
}
}
this.SendVoiceStatusUpdate();
}
BHasSampleRateTooHighInBrowser() {
return !o.De.IN_CLIENT && h.Ul.AudioPlaybackManager.GetLastObservedSampleRate() > 48e3;
}
BNoMicAvailableForSession() {
if (this.m_VoiceCallState.m_eState <= A.k_EVoiceCallState_RequestedMicAccess) return !1;
if (this.BHasSampleRateTooHighInBrowser()) return !0;
for (let e = 0; e < this.m_rgAudioStreams.length; ++e) if (this.m_rgAudioStreams[e].type == R.k_EAudioStreamType_Microphone) return !1;
return !0;
}
IsMicMuted() {
for (let e = 0; e < this.m_rgAudioStreams.length; ++e) if (this.m_rgAudioStreams[e].type == R.k_EAudioStreamType_Microphone) return this.m_rgAudioStreams[e].muted;
return !1;
}
ToggleOutputMuting() {
this.m_bOutputMuted = !this.m_bOutputMuted;
for (let e = 0; e < this.m_rgAudioStreams.length; ++e) {
let t = this.m_rgAudioStreams[e];
if (t.type == R.k_EAudioStreamType_IncomingStream) {
t.muted = this.m_bOutputMuted || this.GetPerUserMuting(t.accountid);
let e = t.stream.getTracks();
for (let t = 0; t < e.length; t++) e[t].enabled = !this.m_bOutputMuted;
}
}
this.SendVoiceStatusUpdate();
}
IsOutputMuted() {
return this.m_bOutputMuted;
}
GetActiveOneOnOneVoiceChatAccountID() {
return this.m_VoiceCallState.m_eState == A.k_EVoiceCallState_None ? 0 : this.m_VoiceCallState.m_targetAccountID;
}
get audio_streams() {
return this.m_rgAudioStreams;
}
get video_streams() {
return this.m_rgVideoStreams;
}
get mic_volume() {
return this.m_MicVolumeMeter;
}
get_volume(e) {
if (e == this.m_CMInterface.steamid.GetAccountID()) {
if (this.IsMicMuted() || (this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_Connected && this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_LocalMicOnly)) return 0;
} else if (this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_Connected) return 0;
let t = 0;
for (let n = 0; n < this.m_rgAudioStreams.length; ++n) {
let i = this.m_rgAudioStreams[n];
i.accountid == e && null != i.volume_meter && (t = Math.max(t, i.volume_meter.rounded_volume));
}
return t;
}
GetPerUserGainLevel(e) {
let t = this.m_mapPerUserOutputGain.get(e);
return null == t ? 1 : t.gain;
}
GetPerUserMuting(e) {
let t = this.m_mapPerUserOutputGain.get(e);
return null != t && t.muted;
}
SetPerUserMuting(e, t) {
let n = this.m_mapPerUserOutputGain.get(e);
null == n && (n = new H()), (n.muted = t || this.m_bOutputMuted), this.m_mapPerUserOutputGain.set(e, n), this.UpdateStreamsForPerUseGainChange(e);
}
SetPerUserGainLevel(e, t) {
let n = Math.max(0, Math.min(4, t)),
i = this.m_mapPerUserOutputGain.get(e);
null == i && (i = new H()), (i.gain = n), i.gain < 0.001 ? (i.muted = !0) : (i.muted = !1), this.m_mapPerUserOutputGain.set(e, i), this.UpdateStreamsForPerUseGainChange(e);
}
UpdateStreamsForPerUseGainChange(e) {
let t = this.m_mapPerUserOutputGain.get(e);
null == t && (t = new H());
for (let n = 0; n < this.m_rgAudioStreams.length; ++n) {
let i = this.m_rgAudioStreams[n];
if (i.accountid == e && null != i.output_gain_node) {
(i.muted = t.muted), i.output_gain_node.gain.setValueAtTime(this.m_Settings.m_VoiceOutputGain * t.gain, this.m_AudioContext.currentTime);
let e = i.stream.getTracks();
for (let t = 0; t < e.length; t++) e[t].enabled = !i.muted;
}
}
}
OnUserLeftChatRoomVoiceChat(e, t, n, i) {
let o = { groupID: e, chatID: t };
this.m_VoiceCallState.m_eState > A.k_EVoiceCallState_RequestedPermission && this.m_VoiceCallState.BMatchingCall(0, o) && (n != this.m_CMInterface.steamid.GetAccountID() || i || (this.LogMsg("(ChatRoom) We were told that we left chat " + t + " but we hadn't initiated that, trying to reconnect..."), this.RestartVoiceChatIfConnected()));
}
IsMicTestActive() {
return this.m_VoiceCallState.m_eState == A.k_EVoiceCallState_LocalMicOnly;
}
IsAnyVoiceActive() {
return !(this.m_VoiceCallState.m_eState <= A.k_EVoiceCallState_LocalMicOnly && 0 == this.m_VoiceCallState.m_targetAccountID && null == this.m_VoiceCallState.m_chatRoom) && (this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_None || 0 != this.m_ScheduledInitiate);
}
BSelfHasAcceptedOrInitiatedOneOnOneChat(e) {
return this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_None && this.m_VoiceCallState.m_targetAccountID == e && (!!this.m_VoiceCallState.m_bInitiatedOneOnOneCall || this.m_VoiceCallState.m_eState >= A.k_EVoiceCallState_NotifyingVoiceChatOfWebRTCSession);
}
BSelfHadPreviouslyJoinedOneOnOneChat(e) {
let t = this.m_mapOneOnOneCallsWaitingJoinOrAccept.get(e);
if (null == t) return !1;
if (t.partner_accountid != this.m_CMInterface.steamid.GetAccountID()) return !1;
let n = t.voice_chatid;
return t.previously_joined && "" != n;
}
BPartnerHasAcceptedOrInitiatedOneOnOneChat(e) {
return !(this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_None || this.m_VoiceCallState.m_bInitiatedOneOnOneCall || !this.BPartnerHasRequestedAndIsInOneOnOneChat(e)) || (this.m_VoiceCallState.m_eState > A.k_EVoiceCallState_RequestedPermission && !this.m_VoiceCallState.m_bWaitingOnOneOnOneRejoin);
}
BPartnerHasRequestedAndIsInOneOnOneChat(e) {
let t = this.m_mapOneOnOneCallsWaitingJoinOrAccept.get(e);
return null != t && t.partner_accountid == this.m_CMInterface.steamid.GetAccountID() && "" != t.voice_chatid;
}
IsAttemptingInitialConnection() {
return (0 == this.m_VoiceCallState.m_targetAccountID || this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_RequestedPermission) && this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_LocalMicOnly && this.IsAnyVoiceActive() && 0 == this.m_VoiceCallState.m_nFailuresThisInitiate && this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_Connected;
}
HasBeenAttemptingOverTwoSeconds() {
let e = this.m_VoiceCallState.m_bIsConnectionAttemptOverTwoSeconds,
t = this.IsAttemptingInitialConnection();
return !!this.m_bForceConnectingStatus || (e && t);
}
IsAttemptingReconnect() {
let e = this.IsAnyVoiceActive(),
t = this.m_VoiceCallState.m_nFailuresThisInitiate,
n = this.m_VoiceCallState.m_eState;
return !!this.m_bForceReconnectingStatus || (e && t > 0 && n != A.k_EVoiceCallState_Connected);
}
IsVoiceActiveForFriend(e) {
return this.IsVoiceActive(e, null);
}
IsVoiceActiveForRoom(e, t) {
return this.IsVoiceActive(0, { groupID: e, chatID: t });
}
IsVoiceActiveForGroup(e) {
return !!this.m_VoiceCallState.BCallActiveForGroup(e) && this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_None;
}
IsVoiceChatActive() {
return this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_None;
}
LogMsg(e) {
this.m_rgLogLines.push(e), this.m_LogVoiceChatDetails && console.log(e);
}
GetVoiceLogs() {
return this.m_rgLogLines.join("\r\n");
}
OnPushToTalkReleased() {
((this.m_bPushToTalkEnabled && null != this.m_MicInputGainNode && !this.m_bVoicePTTStateEnabled) || (this.m_bPushToMuteEnabled && null != this.m_MicInputGainNode && this.m_bVoicePTTStateEnabled)) && this.m_MicInputGainNode.gain.setValueAtTime(this.GetCurrentVoiceInputGainTarget(), this.m_AudioContext.currentTime + 0.2);
}
DebouncedToggleMicMuting() {
this.ToggleMicMuting(), this.GetPushToTalkOrMuteSoundsEnabled() && (this.IsMicMuted() ? h.Ul.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/steam_ui_ptt_short_02_quiet.m4a") : h.Ul.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/steam_ui_ptt_short_01_quiet.m4a"));
}
OnPushToTalkStateChange(e) {
let t = e,
n = !1;
h.Ul.SettingsStore.BClientHasFeatureOrOnWeb("NewVoiceHotKeyState") && ((n = !0), this.m_bPushToMuteEnabled && (t = !e)),
!n || this.m_bPushToTalkEnabled || this.m_bPushToMuteEnabled
? t != this.m_bVoicePTTStateEnabled &&
((this.m_bVoicePTTStateEnabled = t),
(this.m_bPushToTalkEnabled || this.m_bPushToMuteEnabled) &&
null != this.m_MicInputGainNode &&
(this.m_bVoicePTTStateEnabled
? (this.GetPushToTalkOrMuteSoundsEnabled() && h.Ul.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/steam_ui_ptt_short_01_quiet.m4a"), this.m_bPushToMuteEnabled ? (this.m_hPushToTalkReleaseTimeout = SetBackgroundTimeout(this.OnPushToTalkReleased, 100)) : (this.m_MicInputGainNode.gain.setValueAtTime(this.GetCurrentVoiceInputGainTarget(), this.m_AudioContext.currentTime), 0 != this.m_hPushToTalkReleaseTimeout && ClearBackgroundTimeout(this.m_hPushToTalkReleaseTimeout)))
: (this.GetPushToTalkOrMuteSoundsEnabled() && h.Ul.AudioPlaybackManager.PlayAudioURL(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/steam_ui_ptt_short_02_quiet.m4a"), this.m_bPushToMuteEnabled ? (this.m_MicInputGainNode.gain.setValueAtTime(this.GetCurrentVoiceInputGainTarget(), this.m_AudioContext.currentTime), 0 != this.m_hPushToTalkReleaseTimeout && ClearBackgroundTimeout(this.m_hPushToTalkReleaseTimeout)) : (this.m_hPushToTalkReleaseTimeout = SetBackgroundTimeout(this.OnPushToTalkReleased, 100)))))
: e && null != this.m_MicInputGainNode && this.DebouncedToggleMicMuting();
}
GetCurrentVoiceInputGainTarget() {
return (this.m_bPushToTalkEnabled && !this.m_bVoicePTTStateEnabled) || (this.m_bPushToMuteEnabled && !this.m_bVoicePTTStateEnabled) ? 0 : this.m_Settings.m_VoiceInputGain;
}
RestartVoiceChatIfConnected() {
if (this.m_VoiceCallState.m_eState > A.k_EVoiceCallState_ScheduledInitiate) {
let e = this.m_VoiceCallState.m_targetAccountID,
t = this.m_VoiceCallState.m_chatRoom;
this.LogMsg("(WebRTC) Ending then auto-re-initiating voice chat - without leave of chatroom if joined as attempt is quick rejoin"), this.EndVoiceChatInternal(!0), this.InitiateVoiceChat(e, t);
}
}
GetNoiseGateOptions() {
let e = { attack: 2, release: 0.01, threshold: -80, bufferSize: 1024 };
switch (this.m_Settings.m_NoiseGateLevel) {
case G.S7.k_ENoiseGateLevel_Off:
break;
case G.S7.k_ENoiseGateLevel_Low:
e = { attack: 0.8, release: 0.06, threshold: -48, bufferSize: 1024 };
break;
case G.S7.k_ENoiseGateLevel_Medium:
e = { attack: 0.8, release: 0.06, threshold: -36, bufferSize: 1024 };
break;
case G.S7.k_ENoiseGateLevel_High:
e = { attack: 0.8, release: 0.09, threshold: -22, bufferSize: 1024 };
}
return e;
}
DeleteOneOnOneCallWaitingJoinOrAccept(e) {
let t = this.m_mapOneOnOneCallsWaitingJoinOrAccept.get(e);
null != t && (t.ClearAudioRepeats(), this.m_mapOneOnOneCallsWaitingJoinOrAccept.delete(e));
}
UpdateNoiseGateOnActiveMic() {
if (null != this.m_MicInputGainNode) {
let e;
for (let t = 0; t < this.m_rgAudioStreams.length; ++t) {
let n = this.m_rgAudioStreams[t];
if (n.type == R.k_EAudioStreamType_Microphone) {
e = n;
break;
}
}
if (null != e) {
if (null != this.m_MicNoiseGate) this.m_MicInputGainNode.disconnect(this.m_MicNoiseGate.input), this.m_MicNoiseGate.input ? (this.m_MicNoiseGate.input.disconnect(), this.m_MicNoiseGate.output.disconnect(), this.m_MicNoiseGate.noiseGateKernel_.disconnect()) : this.m_MicNoiseGate.disconnect(), (this.m_MicNoiseGate = void 0);
else {
this.m_MicInputGainNode.disconnect(e.destination_node);
try {
this.m_MicInputGainNode.disconnect(e.output_gain_node);
} catch (e) {}
}
this.m_MicVolumeMeter.stop(), (this.m_MicVolumeMeter = void 0), null != e.volume_meter && (e.volume_meter.stop(), (e.volume_meter = void 0)), this.m_Settings.m_NoiseGateLevel != G.S7.k_ENoiseGateLevel_Off ? this.SetupNoiseGateOnMic(e.destination_node) : this.m_MicInputGainNode.connect(e.destination_node);
let t = e.source_node;
this.m_MicNoiseGate && (t = this.m_MicNoiseGate.output ? this.m_MicNoiseGate.output : this.m_MicNoiseGate), (this.m_MicVolumeMeter = new w(t, this.m_AudioContext)), (e.volume_meter = this.m_MicVolumeMeter), this.m_VoiceEchoLocalMic && null == this.m_MicNoiseGate ? this.m_MicInputGainNode.connect(e.output_gain_node) : this.m_VoiceEchoLocalMic && (this.m_MicNoiseGate.output ? this.m_MicNoiseGate.output.connect(e.output_gain_node) : this.m_MicNoiseGate.connect(e.output_gain_node));
}
}
}
OnAudioContextStateChange() {
null != this.m_AudioContext && this.LogMsg("(WebAudio) Audio context state changed: " + this.m_AudioContext.state);
}
OnIceCandidate(e) {
this.LogMsg("(ICE) Local candidate: " + JSON.stringify(e.candidate));
}
AddRemoteIceCandidate(e, t) {
let n = this.LogMsg;
n("(ICE) Candidate from remote peer: " + JSON.stringify(t)),
e
.addIceCandidate(t)
.then(function () {})
.catch(function (e) {
n("addIceCandidate error: " + e + " " + e.name);
});
}
OnSignalingStateChange(e, t) {
this.LogMsg("(WebRTC) OnSignalingStateChange: " + e.signalingState);
}
OnIceConnectionStateChange(e, t) {
this.LogMsg("(ICE) OnIceConnectionStateChange: " + e.iceConnectionState), "failed" == e.iceConnectionState && this.m_VoiceCallState.m_eState > A.k_EVoiceCallState_CreatePeerConnection ? this.BackOffAndRetryInitiateVoiceChat() : ("completed" != e.iceConnectionState && "connected" != e.iceConnectionState) || this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_WebRTCConnectedWaitingOnIceConnected || (this.LogMsg("(VoiceChat) ICE connection state now 'completed' or 'connected', proceeding to join voice chat"), this.JoinVoiceChatOrAskForOneOnOneChatNow());
}
OnIceGatheringStateChange(e, t) {
this.LogMsg("(ICE) OnIceGatheringStateChange: " + e.iceGatheringState);
}
RemoveStreamToOutput(e) {
this.LogMsg("(WebRTC) RemoveStreamToOutput - " + e.id + " - " + e.getTracks().length);
for (let t = 0; t < this.m_rgAudioStreams.length; ++t) {
let n = this.m_rgAudioStreams[t];
if (n.unique_id == e.id) {
if ((n.elem.pause(), (n.elem.srcObject = void 0), (n.elem.src = void 0), (n.elem = void 0), null != n.volume_meter && (n.volume_meter.stop(), (n.volume_meter = void 0)), null != n.output_gain_node && (n.output_gain_node.disconnect(), (n.output_gain_node = void 0)), null != n.source_node)) {
try {
n.source_node.disconnect();
} catch (e) {}
n.source_node = void 0;
}
return void this.m_rgAudioStreams.splice(t, 1);
}
}
for (let t = 0; t < this.m_rgVideoStreams.length; ++t) {
if (this.m_rgVideoStreams[t].unique_id == e.id) return void this.m_rgVideoStreams.splice(t, 1);
}
}
OnRemoveRemoteStream(e) {
this.RemoveStreamToOutput(e.stream);
}
SetupAudioStreamElementAndCreateSourceNode(e, t) {
let n = -1 != this.m_PeerConnection.localDescription.sdp.indexOf("mozilla...");
null != e.source_node && (e.source_node.disconnect(), (e.source_node = void 0)), null == e.elem ? (e.elem = document.createElement("audio")) : (e.elem.srcObject = void 0), (e.elem.srcObject = t), n ? (e.elem.play(), (e.source_node = this.m_AudioContext.createMediaElementSource(e.elem))) : (e.source_node = this.m_AudioContext.createMediaStreamSource(t));
}
static DistanceBetween(e, t) {
const n = e.x - t.x,
i = e.y - t.y,
o = e.z - t.z;
return Math.sqrt(n * n + i * i + o * o);
}
GenerateVoicePositions() {
const e = [];
for (let t = 0; t < j.k_nMaxPositions; ++t) {
const n = (2 * Math.PI * t) / j.k_nMaxPositions;
e.push({ x: Math.cos(n), y: 0, z: Math.sin(n) });
}
const t = [],
n = new Set();
for (t.push(0), n.add(0); t.length < e.length; ) {
let i = -1,
o = -1;
for (let r = 0; r < e.length; ++r) {
if (n.has(r)) continue;
let a = 1e4;
for (let n = 0; n < t.length; ++n) a = Math.min(a, j.DistanceBetween(e[t[n]], e[r]));
a > o && ((o = a), (i = r));
}
t.push(i), n.add(i);
}
this.m_rgPositions = [];
for (let n = 0; n < t.length; ++n) this.m_rgPositions.push(e[t[n]]);
for (let e = t.length - 1; e >= 0; --e) this.m_rgFreePositionIndices.push(e);
}
GetNextVoiceChatPositionIndex() {
return this.m_rgFreePositionIndices.pop();
}
GetVoiceChatPosition(e) {
if (null == e) return { x: 0, y: 0, z: 0 };
const t = Math.min(e, this.m_rgPositions.length - 1);
return this.m_rgPositions[t];
}
SetLocalHMDPose(e) {
(this.m_localPose = e), this.m_AudioContext.listener.positionX.setValueAtTime(e.position[0], this.m_AudioContext.currentTime), this.m_AudioContext.listener.positionY.setValueAtTime(e.position[1], this.m_AudioContext.currentTime), this.m_AudioContext.listener.positionZ.setValueAtTime(e.position[2], this.m_AudioContext.currentTime), this.m_AudioContext.listener.forwardX.setValueAtTime(e.ahead[0], this.m_AudioContext.currentTime), this.m_AudioContext.listener.forwardY.setValueAtTime(e.ahead[1], this.m_AudioContext.currentTime), this.m_AudioContext.listener.forwardZ.setValueAtTime(e.ahead[2], this.m_AudioContext.currentTime), this.m_AudioContext.listener.upX.setValueAtTime(e.up[0], this.m_AudioContext.currentTime), this.m_AudioContext.listener.upY.setValueAtTime(e.up[1], this.m_AudioContext.currentTime), this.m_AudioContext.listener.upZ.setValueAtTime(e.up[2], this.m_AudioContext.currentTime);
}
SetRemoteHMDPose(e, t) {
var n, i, o;
this.m_mapRemotePoseForAccountID.set(e, t);
for (const r of this.m_rgAudioStreams)
if (r.accountid === e) {
null === (n = r.spatializer_node) || void 0 === n || n.positionX.setValueAtTime(t.position[0], this.m_AudioContext.currentTime), null === (i = r.spatializer_node) || void 0 === i || i.positionY.setValueAtTime(t.position[1], this.m_AudioContext.currentTime), null === (o = r.spatializer_node) || void 0 === o || o.positionZ.setValueAtTime(t.position[2], this.m_AudioContext.currentTime);
break;
}
}
GetLocalHMDPose() {
return this.m_localPose;
}
GetRemoteHMDPose(e) {
return this.m_mapRemotePoseForAccountID.get(e);
}
GetRemoteHMDPoseMap() {
return this.m_mapRemotePoseForAccountID;
}
AddStreamToOutput(e) {
let t = e.id.match(/Peer-(\d+)-(\d+)-/),
n = t && 3 == t.length ? Number(t[2]) : 0;
if (e.getAudioTracks().length > 0) {
let t = new O();
if ((this.SetupAudioStreamElementAndCreateSourceNode(t, e), (t.unique_id = e.id), (t.stream = e), (t.type = R.k_EAudioStreamType_IncomingStream), (t.accountid = n), this.LogMsg("(VoiceChat) AddStreamToOutput (audio) " + t.accountid + " " + t.unique_id), (t.muted = this.m_bOutputMuted || this.GetPerUserMuting(t.accountid)), t.muted)) {
let e = t.stream.getTracks();
for (let n = 0; n < e.length; n++) e[n].enabled = !t.muted;
}
this.m_rgAudioStreams.push(t), (t.output_gain_node = this.m_AudioContext.createGain()), t.output_gain_node.gain.setValueAtTime(this.m_Settings.m_VoiceOutputGain * this.GetPerUserGainLevel(t.accountid), this.m_AudioContext.currentTime), t.source_node.connect(t.output_gain_node), t.output_gain_node.connect(h.Ul.AudioPlaybackManager.GetActiveDestination()), (t.volume_meter = new w(t.source_node, this.m_AudioContext)), t.volume_meter.Connect(t.source_node);
}
if (0 != n && e.getVideoTracks().length > 0) {
let t = new F();
(t.unique_id = e.id), (t.stream = e), (t.accountid = n), this.LogMsg("(VoiceChat) AddStreamToOutput (video) " + t.accountid + " " + t.unique_id), this.m_rgVideoStreams.push(t);
}
}
OnAddTrack(e, t) {
for (let t = 0; t < this.m_rgAudioStreams.length; ++t) {
let n = this.m_rgAudioStreams[t];
if (n.unique_id == e.id && (this.LogMsg("(VoiceChat) OnAddTrack to existing stream " + n.accountid + " " + n.unique_id), n.volume_meter.DisconnectAll(), this.SetupAudioStreamElementAndCreateSourceNode(n, e), n.volume_meter.Connect(n.source_node), n.source_node.connect(n.output_gain_node), n.muted)) {
let e = n.stream.getTracks();
for (let t = 0; t < e.length; t++) e[t].enabled = !n.muted;
}
}
}
OnAddRemoteStream(e) {
if ((this.LogMsg("(WebRTC) OnAddRemoteStream - " + e.stream.id + " - " + e.stream.getTracks().length), null != this.m_AudioContext)) {
if (null != e.stream && null != this.m_AudioContext) {
this.AddStreamToOutput(e.stream);
let t = this;
e.stream.onaddtrack = function (e) {
t.OnAddTrack(this, e);
};
}
} else this.LogMsg("(WebRTC)Got OnAddRemoteStream when we don't have audio context... stopped chat?");
}
ModifyLocalSDPBeforeSetting(e) {
let t = /a=rtpmap:(\d+)\sopus(.*)/,
n = /a=fmtp:(\d+)\s(.*)/,
i = e.sdp.split("\r\n"),
o = -1 != e.sdp.indexOf("mozilla..."),
r = !1;
for (let e = 0; e < i.length; ++e) {
let a = i[e];
if ("m=" == a.substr(0, 2) && e + 1 < i.length) {
let s = "0";
for (let n = e + 1; n < i.length; ++n) {
if (((a = i[n]), "m=" == a.substr(0, 2))) {
e = n - 1;
break;
}
let o = a.match(t);
if (o) {
s = o[1];
break;
}
}
if ("0" != s)
for (let t = e + 1; t < i.length; ++t) {
if (((a = i[t]), "m=" == a.substr(0, 2))) {
e = t - 1;
break;
}
let l = a.match(n);
if (l && l[1] == s) {
o || (i[t] = "a=fmtp:" + l[1] + " minptime=10;useinbandfec=1;usedtx=1"), (r = !0);
break;
}
}
}
}
return r && (e.sdp = i.join("\r\n")), e;
}
OnCreateOfferSuccess(e, t) {
if (this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_CreatePeerConnection) return void this.LogMsg("(WebRTC) Hit OnCreateOfferSuccess in wrong state " + this.m_VoiceCallState.m_eState);
this.LogMsg("(WebRTC) OnCreateOfferSuccess");
let n = this;
(t = this.ModifyLocalSDPBeforeSetting(t)),
e
.setLocalDescription(t)
.then(function () {
let e = r.gA.Init(E.Mm);
e.Body().set_sdp(JSON.stringify(t));
let i = new T.UAParser(navigator.userAgent).getResult();
e.Body().set_browser_name(i.browser.name),
e.Body().set_browser_version(i.browser.version),
n.LogMsg("(WebRTC) Offer (Local Description): " + e.Body().sdp()),
(n.m_VoiceCallState.m_eState = A.k_EVoiceCallState_InitatedWebRTCSession),
E.Kp.InitiateWebRTCConnection(n.m_CMInterface.GetServiceTransport(), e)
.then((e) => {
if (null == n.m_PeerConnection) n.LogMsg("(WebRTC) Got response to InitiateWebRTCConnection with no local peer connection"), n.EndVoiceChatInternal(!1);
else if (1 == e.GetEResult()) {
let t = JSON.parse(e.Body().remote_description());
n.m_PeerConnection
.setRemoteDescription(new RTCSessionDescription(t))
.then(function () {
n.LogMsg("(WebRTC) Remote Description: " + t.sdp), "offer" == t.type ? (n.LogMsg("(WebRTC) !! received 'offer' rather than 'answer' from InitiateWebRTCConnection, unexpected."), n.EndVoiceChatInternal(!1)) : "answer" == t.type && n.LogMsg("(WebRTC) setRemoteDescription success");
})
.catch(function (e) {
n.LogMsg("(WebRTC) setRemoteDescription error: " + e), n.LogMsg("(VoiceChat) Fatal error, ending chat"), n.EndVoiceChatInternal(!1);
});
} else n.LogMsg("(WebRTC) Got failure (" + e.GetEResult() + ") response from InitiateWebRTCConnection"), n.BackOffAndRetryInitiateVoiceChat();
})
.catch((e) => {
n.LogMsg("(WebRTC) Failure in WebRTCClientService.InitiateWebRTCConnection"), n.BackOffAndRetryInitiateVoiceChat();
});
})
.catch(function (e) {
n.LogMsg("(WebRTC) setLocalDescription error: " + e), n.LogMsg("(VoiceChat) Fatal error, ending voice chat"), n.EndVoiceChatInternal(!1);
});
}
OnCreateOfferError(e) {
this.LogMsg("(WebRTC) OnCreateOfferError: " + e), this.LogMsg("(VoiceChat) Fatal Error, ending chat attempt"), this.EndVoiceChatInternal(!1);
}
CreatePeerConnection(e) {
let t = new RTCPeerConnection({ sdpSemantics: "plan-b" });
return (
(t.onicecandidate = (e) => {
this.OnIceCandidate(e);
}),
(t.onaddstream = this.OnAddRemoteStream),
(t.onremovestream = this.OnRemoveRemoteStream),
(t.oniceconnectionstatechange = (e) => {
this.OnIceConnectionStateChange(t, e);
}),
(t.onicegatheringstatechange = (e) => {
this.OnIceGatheringStateChange(t, e);
}),
(t.onsignalingstatechange = (e) => {
this.OnSignalingStateChange(t, e);
}),
null == e || e.getTracks().forEach((n) => t.addTrack(n, e)),
(this.m_PeerConnection = t),
this.m_PeerConnection
);
}
OnMicStreamInactive(e, t) {
this.LogMsg("(WebRTC) Mic Stream went inactive: " + t.type), this.m_VoiceCallState.m_eState > A.k_EVoiceCallState_RequestedMicAccess && (this.LogMsg("(WebRTC) Ending then auto-re-initiating voice chat without mic"), this.RestartVoiceChatIfConnected());
}
OnNoiseGateMessage(e) {
this.LogMsg("(VoiceChat) " + e.data);
}
SetupNoiseGateOnMic(e) {
let t = this.GetNoiseGateOptions(),
n = h.Ul.AudioPlaybackManager.supports_audio_worklets;
if (n) {
this.LogMsg("(VoiceChat) Audio Worklets supported - high performance mic noisegate in use!");
try {
let n = window;
(this.m_MicNoiseGate = new n.AudioWorkletNode(this.m_AudioContext, "noisegate-processor")), (this.m_MicNoiseGate.port.onmessage = this.OnNoiseGateMessage), this.m_MicInputGainNode.connect(this.m_MicNoiseGate).connect(e), this.m_MicNoiseGate.parameters.get("threshold").setValueAtTime(t.threshold, this.m_AudioContext.currentTime), this.m_MicNoiseGate.parameters.get("attack").setValueAtTime(t.attack, this.m_AudioContext.currentTime), this.m_MicNoiseGate.parameters.get("release").setValueAtTime(t.release, this.m_AudioContext.currentTime), this.m_MicNoiseGate.parameters.get("sampleRate").setValueAtTime(this.m_AudioContext.sampleRate, this.m_AudioContext.currentTime);
} catch (e) {
this.LogMsg("(VoiceChat) creating AudioWorkletNode failed: " + e), (n = !1);
}
}
n || (this.LogMsg("(VoiceChat) Browser doesn't support audio worklets, mic perf will suffer and may stutter/echo during repaint/high CPU usage"), (this.m_MicNoiseGate = new D(this.m_AudioContext, t)), this.m_MicInputGainNode.connect(this.m_MicNoiseGate.input), this.m_MicNoiseGate.output.connect(e));
}
OnGetUserMediaSuccess(e) {
if (this.m_VoiceCallState.m_eState == A.k_EVoiceCallState_RequestedMicAccess) {
if (((this.m_VoiceCallState.m_eState = A.k_EVoiceCallState_CreatePeerConnection), (null == e ? void 0 : e.getAudioTracks().length) > 0)) {
e.id;
let t = this.m_AudioContext.createMediaStreamSource(e),
n = this;
(e.oninactive = function (e) {
n.OnMicStreamInactive(this, e);
}),
(this.m_MicInputGainNode = this.m_AudioContext.createGain()),
this.m_MicInputGainNode.gain.setValueAtTime(this.GetCurrentVoiceInputGainTarget(), this.m_AudioContext.currentTime),
t.connect(this.m_MicInputGainNode);
let i = this.m_AudioContext.createMediaStreamDestination();
this.m_Settings.m_NoiseGateLevel != G.S7.k_ENoiseGateLevel_Off ? this.SetupNoiseGateOnMic(i) : this.m_MicInputGainNode.connect(i), e.getVideoTracks().forEach((e) => i.stream.addTrack(e)), (e = i.stream);
let o = new O();
(o.unique_id = e.id), (o.destination_node = i), (o.stream = e), (o.source_node = t), (o.type = R.k_EAudioStreamType_Microphone), (o.accountid = this.m_CMInterface.steamid.GetAccountID()), (o.muted = !1), (o.elem = void 0), (o.output_gain_node = this.m_AudioContext.createGain()), o.output_gain_node.gain.setValueAtTime(this.m_Settings.m_VoiceOutputGain, this.m_AudioContext.currentTime), o.output_gain_node.connect(h.Ul.AudioPlaybackManager.GetActiveDestination()), this.m_rgAudioStreams.push(o);
let r = t;
this.m_MicNoiseGate && (r = null != this.m_MicNoiseGate.output ? this.m_MicNoiseGate.output : this.m_MicNoiseGate), (this.m_MicVolumeMeter = void 0), (this.m_MicVolumeMeter = new w(r, this.m_AudioContext)), (o.volume_meter = this.m_MicVolumeMeter), this.m_VoiceEchoLocalMic && null == this.m_MicNoiseGate ? this.m_MicInputGainNode.connect(o.output_gain_node) : this.m_VoiceEchoLocalMic && (this.m_MicNoiseGate.output ? this.m_MicNoiseGate.output.connect(o.output_gain_node) : this.m_MicNoiseGate.connect(o.output_gain_node));
}
if (0 != this.m_VoiceCallState.m_targetAccountID || null != this.m_VoiceCallState.m_chatRoom) {
let t = { offerToReceiveAudio: 1, offerToReceiveVideo: this.m_bReceiveVideo ? 1 : 0, voiceActivityDetection: !0 },
n = this.CreatePeerConnection(e),
i = this;
n.createOffer(t)
.then(function (e) {
i.OnCreateOfferSuccess(n, e);
})
.catch(function (e) {
i.OnCreateOfferError(e);
});
} else (this.m_VoiceCallState.m_eState = A.k_EVoiceCallState_LocalMicOnly), (this.m_VoiceCallState.m_timeFinishedConnecting = performance.now());
} else {
for (let t of e.getTracks()) t.stop();
this.LogMsg("(VoiceChat) Hit OnGetUserMediaSuccess in wrong state " + this.m_VoiceCallState.m_eState);
}
}
OnGetUserMediaFailure(e) {
if (this.m_VoiceCallState.m_eState <= A.k_EVoiceCallState_ScheduledInitiate) return;
if (this.m_bSendVideo) return this.LogMsg("(VoiceChat) The following error occured getting media stream: " + e.name), this.LogMsg("(VoiceChat) Retrying without video"), (this.m_bSendVideo = !1), (this.m_VoiceCallState.m_eState = A.k_EVoiceCallState_ScheduledInitiate), void this.OnRequestMicrophoneAccess();
let t = this,
n = navigator;
n.permissions &&
n.permissions.query({ name: "microphone" }).then(function (e) {
"granted" == e.state || ("denied" == e.state ? (t.m_bUserHasDeniedMicPermissions = !0) : e.state);
}),
this.LogMsg("(WebAudio) The following error occured getting audio stream: " + e.name),
this.OnGetUserMediaSuccess(void 0);
}
InitiateChatRoomVoice() {
this.m_VoiceCallState.m_eState > A.k_EVoiceCallState_ScheduledInitiate ? this.LogMsg("(VoiceChat) Hit InitiateChatRoomVoice in wrong state " + this.m_VoiceCallState.m_eState) : h.Ul.AudioPlaybackManager.SetVoiceActive(this.OnRequestMicrophoneAccess);
}
JoinVoiceChatOrAskForOneOnOneChatNow() {
if (0 == this.m_VoiceCallState.m_targetAccountID) {
this.m_VoiceCallState.m_eState = A.k_EVoiceCallState_RequestedPermission;
let e = r.gA.Init(I.Qg);
e.Body().set_chat_group_id(this.m_VoiceCallState.m_chatRoom.groupID),
e.Body().set_chat_id(this.m_VoiceCallState.m_chatRoom.chatID),
this.LogMsg("(VoiceChat) InitiateChatRoomVoice request to group: " + this.m_VoiceCallState.m_chatRoom.groupID + ", room: " + this.m_VoiceCallState.m_chatRoom.chatID),
I.Xn.JoinVoiceChat(this.m_CMInterface.GetServiceTransport(), e)
.then((e) => {
1 == e.GetEResult() ? ((this.m_VoiceCallState.m_voiceChatID = e.Body().voice_chatid()), this.OnVoiceChatAccepted(!0)) : 2 == e.GetEResult() ? this.BackOffAndRetryInitiateVoiceChat() : this.OnVoiceChatAccepted(!1);
})
.catch((e) => {
this.BackOffAndRetryInitiateVoiceChat();
});
} else if (((this.m_VoiceCallState.m_eState = A.k_EVoiceCallState_RequestedPermission), "" == this.m_VoiceCallState.m_voiceChatID)) {
let e = r.gA.Init(y.zQ);
e.Body().set_steamid_partner(u.K.InitFromAccountID(this.m_VoiceCallState.m_targetAccountID).ConvertTo64BitString()),
this.LogMsg("(VoiceChat) InitiateOneOnOneVoiceChat request to " + this.m_VoiceCallState.m_targetAccountID),
y.p3.RequestOneOnOneChat(this.m_CMInterface.GetServiceTransport(), e).then((e) => {
if (1 == e.GetEResult()) {
this.LogMsg("(VoiceChat) Waiting on acceptance from " + this.m_VoiceCallState.m_targetAccountID), (this.m_VoiceCallState.m_voiceChatID = e.Body().voice_chatid());
let t = h.Ul.FriendStore.self,
n = h.Ul.ChatStore.GetFriendChat(this.m_VoiceCallState.m_targetAccountID, !1);
null != t && null != n && n.AddVoiceChannelInviteMsg(this.m_CMInterface.steamid.GetAccountID(), h.Ul.GetServerRTime32(), (0, k.Xx)("#FriendMsg_VoiceChannelInvite", t.display_name, n.chat_partner.display_name));
} else this.LogMsg("(VoiceChat) Initiating voice chat to " + this.m_VoiceCallState.m_targetAccountID + " has failed."), this.EndVoiceChatInternal(!1);
});
} else this.OnVoiceChatAccepted(!0);
}
OnVoiceChatAccepted(e) {
this.m_VoiceCallState.m_eState < A.k_EVoiceCallState_RequestedPermission
? this.LogMsg("(VoiceChat) Hit OnVoiceChatAccepted in wrong state " + this.m_VoiceCallState.m_eState)
: null != this.m_VoiceCallState.m_webRTCConnectedNotification
? e
? (this.m_VoiceCallState.m_targetAccountID ? ((this.m_VoiceCallState.m_bIsConnectionAttemptOverTwoSeconds = !1), (this.m_VoiceCallState.m_timeStartedConnecting = performance.now()), this.LogMsg("(VoiceChat) Call accepted to individual " + this.m_VoiceCallState.m_targetAccountID)) : this.m_VoiceCallState.m_chatRoom && this.LogMsg("(VoiceChat) Call accepted to room " + this.m_VoiceCallState.m_chatRoom.chatID), this.OnWebRTCConnectedAndVoiceChatConnected())
: this.m_VoiceCallState.m_targetAccountID
? (this.LogMsg("(VoiceChat) Call rejected to individual " + this.m_VoiceCallState.m_targetAccountID), this.OnUserEndVoiceChat())
: this.m_VoiceCallState.m_chatRoom && (this.LogMsg("(VoiceChat) Call rejected to room " + this.m_VoiceCallState.m_chatRoom.chatID), this.EndVoiceChatInternal(!1))
: this.LogMsg("(VoiceChat) Hit OnVoiceChatAccepted without WebRTC connected");
}
InitiateOneOnOneVoiceChat(e) {
this.m_VoiceCallState.m_eState > A.k_EVoiceCallState_ScheduledInitiate ? this.LogMsg("(VoiceChat) Hit InitiateOneOnOneVoiceChat in wrong state " + this.m_VoiceCallState.m_eState) : (null == this.m_VoiceCallState.m_timeStartedConnecting && (this.m_VoiceCallState.m_timeStartedConnecting = performance.now()), 0 == this.m_ConnectionCheck && (this.m_ConnectionCheck = SetBackgroundInterval(this.CheckConnection, 2e3)), h.Ul.AudioPlaybackManager.SetVoiceActive(this.OnRequestMicrophoneAccess));
}
IPIntToString(e) {
return (e >>> 24) + "." + ((e >> 16) & 255) + "." + ((e >> 8) & 255) + "." + (255 & e);
}
OnSetUpdatedLocalDescriptionSuccess() {
this.LogMsg("(WebRTC) OnSetUpdatedLocalDescriptionSuccess");
let e = r.gA.Init(E.VG);
e.Body().set_ip_webrtc_server(this.m_VoiceCallState.m_webRTCServerIP), e.Body().set_port_webrtc_server(this.m_VoiceCallState.m_webRTCServerPort), e.Body().set_ip_webrtc_session_client(this.m_VoiceCallState.m_webRTCClientIP), e.Body().set_port_webrtc_session_client(this.m_VoiceCallState.m_webRTCClientPort), e.Body().set_remote_description_version(this.m_VoiceCallState.m_nMostRecentRemoteDescriptionVersion), E.Kp.AcknowledgeUpdatedRemoteDescription(this.m_CMInterface.GetServiceTransport(), e).then((e) => {});
}
OnSetUpdatedLocalDescriptionFailure(e) {
this.LogMsg("(WebRTC) OnSetUpdatedLocalDescriptionFailure: " + e), this.EndVoiceChatInternal(!1);
}
OnCreateAnswerSuccess(e) {
this.LogMsg("(WebRTC) OnCreateAnswerSuccess: " + JSON.stringify(e));
let t = this;
if (
(this.m_PeerConnection
.setLocalDescription(e)
.then(function () {
t.OnSetUpdatedLocalDescriptionSuccess();
})
.catch(function (e) {
t.OnSetUpdatedLocalDescriptionFailure(e);
}),
(this.m_VoiceCallState.m_bOfferUpdateInProgress = !1),
null != this.m_VoiceCallState.m_msgPendingRemoteDescriptionUpdate)
) {
let e = this.m_VoiceCallState.m_msgPendingRemoteDescriptionUpdate;
(this.m_VoiceCallState.m_msgPendingRemoteDescriptionUpdate = void 0), this.ProcessUpdatedRemoteDescription(e);
}
}
OnCreateAnswerError(e) {
this.LogMsg("(WebRTC) OnCreateAnswerError: " + e), this.EndVoiceChatInternal(!1);
}
ProcessUpdatedRemoteDescription(e) {
(this.m_VoiceCallState.m_bOfferUpdateInProgress = !0), this.m_mapSSRCToAccountID.clear();
let t = e.ssrcs_to_accountids();
for (let e = 0; e < t.length; ++e) {
let n = t[e];
this.m_mapSSRCToAccountID.set(n.ssrc(), n.accountid());
}
let n = this,
i = JSON.parse(e.remote_description());
return (
this.m_PeerConnection
.setRemoteDescription(new RTCSessionDescription(i))
.then(function () {
n.LogMsg("(WebRTC) Updated Remote Description: " + i.sdp),
"offer" == i.type
? (n.LogMsg("(WebRTC) setRemoteDescription success with new offer"),
n.m_PeerConnection
.createAnswer()
.then(function (e) {
n.OnCreateAnswerSuccess(e);
})
.catch(function (e) {
n.OnCreateAnswerError(e);
}),
(n.m_VoiceCallState.m_nMostRecentRemoteDescriptionVersion = e.remote_description_version()))
: "answer" == i.type && (n.LogMsg("(WebRTC) setRemoteDescription success"), (n.m_VoiceCallState.m_bOfferUpdateInProgress = !1));
})
.catch(function (e) {
n.LogMsg("(WebRTC) setRemoteDescription error: " + e), n.LogMsg("(VoiceChat) Fatal error, ending chat"), n.EndVoiceChatInternal(!1);
}),
1
);
}
SendVoiceStatusUpdate() {
let e = this.IsMicMuted(),
t = this.IsOutputMuted(),
n = r.gA.Init(y.Jv);
n.Body().set_user_steamid(this.m_CMInterface.steamid.ConvertTo64BitString()), n.Body().set_voice_chatid(this.m_VoiceCallState.m_voiceChatID), n.Body().set_user_muted_mic_locally(e), n.Body().set_user_muted_output_locally(t), n.Body().set_user_has_no_mic_for_session(this.BNoMicAvailableForSession()), n.Body().set_user_webaudio_sample_rate(h.Ul.AudioPlaybackManager.GetLastObservedSampleRate()), y.p3.NotifyUserVoiceStatus(this.m_CMInterface.GetServiceTransport(), n), "undefined" != typeof SteamClient && null != SteamClient.WebChat && null != SteamClient.WebChat.SetVoiceChatStatus && SteamClient.WebChat.SetVoiceChatStatus(e, t);
}
UpdateUserVoiceStatus(e) {
if (this.m_VoiceCallState.m_voiceChatID != e.voice_chatid()) return;
let t = new u.K(e.user_steamid()),
n = this.m_mapUserVoiceStatus.get(t.GetAccountID());
null == n && (n = new W()), (n.mic_muted_locally = e.user_muted_mic_locally()), (n.output_muted_locally = e.user_muted_output_locally()), (n.has_no_mic_for_session = e.user_has_no_mic_for_session());
let i = h.Ul.FriendStore.GetPlayerIfCached(t.GetAccountID()),
o = "[U:1:" + t.GetAccountID() + "]",
r = "";
null != i && (r = i.display_name + " ");
let a = "";
(a = n.has_no_mic_for_session ? "nomic" : n.mic_muted_locally ? "muted" : "on"), this.LogMsg("(VoiceChat) User " + r + o + " status now: mic(" + a + ") output(" + (n.output_muted_locally ? "muted" : "on") + ")"), this.m_mapUserVoiceStatus.set(t.GetAccountID(), n);
}
OnWebRTCConnectedAndVoiceChatConnected() {
let e = this.m_VoiceCallState.m_webRTCConnectedNotification;
(this.m_VoiceCallState.m_eState = A.k_EVoiceCallState_NotifyingVoiceChatOfWebRTCSession), this.LogMsg("(WebRTC) WebRTC session connected " + this.IPIntToString(e.client_ip()) + ":" + e.client_port() + " => " + this.IPIntToString(e.server_ip()) + ":" + e.server_port()), "" == this.m_VoiceCallState.m_voiceChatID && (this.LogMsg("(VoiceChat) Reached OnWebRTCConnectedAndVoiceChatConnected without voice chat id? Failing."), this.EndVoiceChatInternal(!1));
let t = r.gA.Init(y.tF);
t.Body().set_voice_chatid(this.m_VoiceCallState.m_voiceChatID),
t.Body().set_ssrc_my_sending_stream(e.ssrc()),
t.Body().set_ip_webrtc_client(e.client_ip()),
t.Body().set_port_webrtc_client(e.client_port()),
t.Body().set_ip_webrtc_server(e.server_ip()),
t.Body().set_port_webrtc_server(e.server_port()),
t.Body().set_has_webrtc_data_channel(this.BSupportsDataChannels()),
t.Body().set_has_audio_worklets_support(h.Ul.AudioPlaybackManager.supports_audio_worklets),
t.Body().set_user_agent(navigator.userAgent),
y.p3
.UpdateVoiceChatWebRTCData(this.m_CMInterface.GetServiceTransport(), t)
.then((e) => {
1 == e.GetEResult() ? ((this.m_VoiceCallState.m_eState = A.k_EVoiceCallState_Connected), (this.m_VoiceCallState.m_timeFinishedConnecting = performance.now()), this.SendVoiceStatusUpdate(), this.LogMsg("(WebRTC) Updated voice session with WebRTC session data " + this.m_VoiceCallState.m_voiceChatID), e.Body().send_client_voice_logs() && this.ScheduleClientVoiceLogsUpload(2), this.CheckConnection(), this.BSupportsDataChannels() != b.BHasDataChannels() && this.RenegotiateSDP()) : (this.LogMsg("(WebRTC) Error updating voice session with WebRTC session data " + this.m_VoiceCallState.m_voiceChatID), this.BackOffAndRetryInitiateVoiceChat());
})
.catch((e) => {
this.LogMsg("(WebRTC) Error updating voice session with WebRTC session data " + this.m_VoiceCallState.m_voiceChatID), this.BackOffAndRetryInitiateVoiceChat();
});
}
OnAcceptOneOnOneVoiceChat(e, t) {
this.m_VoiceCallState.m_targetAccountID != e.GetAccountID() && this.EndVoiceChatInternal(!1), (this.m_VoiceCallState.m_eState = A.k_EVoiceCallState_None), (this.m_VoiceCallState.m_targetAccountID = e.GetAccountID()), (this.m_VoiceCallState.m_bInitiatedOneOnOneCall = !1), (this.m_VoiceCallState.m_bWaitingOnOneOnOneRejoin = !1), (this.m_VoiceCallState.m_bPostedOneOnOneEndedMsg = !1), (this.m_VoiceCallState.m_chatRoom = null), (this.m_VoiceCallState.m_voiceChatID = t);
let n = r.gA.Init(y.MY);
n.Body().set_steamid_partner(e.ConvertTo64BitString()),
n.Body().set_accepted_request(!0),
n.Body().set_voice_chatid(t),
y.p3.AnswerOneOnOneChat(this.m_CMInterface.GetServiceTransport(), n).then((t) => {
1 == t.GetEResult() ? (e.GetAccountID() && this.DispatchSetVoiceChatActive(!0), this.InitiateOneOnOneVoiceChat(e.GetAccountID())) : (this.LogMsg("(VoiceChat) Failed responding to voice chat from " + e.GetAccountID()), this.EndVoiceChatInternal(!1));
});
}
OnRejectOneOnOneVoiceChat(e, t) {
let n = r.gA.Init(y.MY);
n.Body().set_steamid_partner(e.ConvertTo64BitString()),
n.Body().set_accepted_request(!1),
n.Body().set_voice_chatid(t),
y.p3.AnswerOneOnOneChat(this.m_CMInterface.GetServiceTransport(), n).then((t) => {
1 == t.GetEResult() || this.LogMsg("(VoiceChat) Failed responding to voice chat from " + e.GetAccountID());
});
}
PlayRingSound(e) {
this.m_mapOneOnOneCallsWaitingJoinOrAccept.get(e).audio_buffer = h.Ul.AudioPlaybackManager.PlayAudioURLWithRepeats(o.De.COMMUNITY_CDN_URL + "public/sounds/webui/steam_phonecall.m4a?v=1", 1);
}
IsVoiceActive(e, t) {
return !!this.m_VoiceCallState.BMatchingCall(e, t) && this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_None;
}
CheckVoiceSnoozeTiemout() {
if (h.Ul.IdleTracker.GetUserIdleTime() > 3600) {
let e = this.m_MicVolumeMeter.GetLastTimeNonZero();
performance.now() - e > 36e5 &&
(this.OnUserEndVoiceChat(),
h.Ul.ShowAlert((0, k.Xx)("#Voice_LeftIdleVoiceChat_Title"), (0, k.Xx)("#Voice_LeftIdleVoiceChat_Body"), (0, k.Xx)("#Voice_LeftIdleVoiceChat_OK"))
.then(() => {})
.catch(() => !0));
}
}
ProcessStatsReport() {
if ((this.CheckVoiceSnoozeTiemout(), null == this.m_PeerConnection)) return;
if (((this.m_StatsTimeout = SetBackgroundTimeout(this.ProcessStatsReport, 1e4)), o.De.IN_CLIENT && a.F.BClientConnected().then(() => {}), -1 != this.m_PeerConnection.localDescription.sdp.indexOf("mozilla..."))) return;
let e = new Date(),
t = this,
n = this.m_PeerConnection;
t.LogMsg("-----------------------------------------------------------"), t.LogMsg(" Voice Report: " + e.toUTCString()), t.LogMsg("-----------------------------------------------------------");
let i = n.getSenders();
if (i.length > 0) {
this.LogMsg("(WebRTC) " + this.PadOutput("(Sender SSRC)", 40) + " " + this.PadOutput("Packets Sent", 20) + " " + this.PadOutput("Connection State", 20) + " " + this.PadOutput("Writable", 20) + " " + this.PadOutput("Track State", 20) + " " + this.PadOutput("Round Trip MS", 20) + " " + this.PadOutput("Transport Bytes Sent", 24) + " " + this.PadOutput("Transport Bytes Received", 24) + " ");
try {
for (let e = 0; e < i.length; ++e)
i[e].getStats().then(function (e) {
e.forEach((n) => {
if ("outbound-rtp" == n.type) {
let i = n.ssrc,
o = n.packetsSent,
r = "",
a = "",
s = 0,
l = 0,
c = 0,
m = "",
d = e.get(n.trackId);
null != d && "track" == d.type && (m = d.ended && d.detached ? "ended+detached" : d.ended ? "ended" : d.detached ? "detached" : "active");
let h = e.get(n.transportId);
if (null != h && "transport" == h.type) {
let t = e.get(h.selectedCandidatePairId);
null != t && "candidate-pair" == t.type && ((r = t.state), (a = t.writable ? "writable" : "not-writable"), (s = 1e3 * t.currentRoundTripTime)), (l = h.bytesSent), (c = h.bytesReceived);
}
t.LogMsg("(WebRTC) " + t.PadOutput(n.kind + " " + String(i), 40) + " " + t.PadOutput(String(o), 20) + " " + t.PadOutput(r, 20) + " " + t.PadOutput(a, 20) + " " + t.PadOutput(m, 20) + " " + t.PadOutput(String(s), 20) + " " + t.PadOutput(String(l), 24) + " " + t.PadOutput(String(c), 24));
}
});
});
} catch (e) {
t.LogMsg("(WebRTC) Can't log sender stats on this browser");
}
}
SetBackgroundTimeout(this.ProcessReceiverStatsReport, 100);
}
ProcessReceiverStatsReport() {
if (-1 != this.m_PeerConnection.localDescription.sdp.indexOf("mozilla...")) return;
let e = this,
t = this.m_PeerConnection;
try {
t.getStats(function (t) {
t.result().forEach(function (t) {
if ("ssrc" == t.type) {
let n = t.names(),
i = n.indexOf("mediaType"),
o = -1 != i ? t.stat(n[i]) : "unknown";
if ("audio" == o) {
let i = new N();
n.forEach((e) => {
"ssrc" == e
? (i.m_SSRC = Number(t.stat(e)))
: "googCurrentDelayMs" == e
? (i.m_MostRecentDelayEstimateMs = Number(t.stat(e)))
: "packetsLost" == e
? (i.m_PacketsLost = Number(t.stat(e)))
: "packetsReceived" == e
? (i.m_PacketsReceived = Number(t.stat(e)))
: "googJitterReceived" == e
? (i.m_MostRecentJitterReceivedMs = Number(t.stat(e)))
: "googJitterBufferMs" == e
? (i.m_CurrentJitterBufferMs = Number(t.stat(e)))
: "bytesReceived" == e
? (i.m_BytesReceived = Number(t.stat(e)))
: "googDecodingCTN" == e
? (i.m_DecodingThroughNetEQ = Number(t.stat(e)))
: "googDecodingPLC" == e
? (i.m_DecodingPacketLossCorrection = Number(t.stat(e)))
: "googDecodingCNG" == e
? (i.m_DecodingComfortNoiseGeneration = Number(t.stat(e)))
: "googDecodingPLCCNG" == e
? (i.m_DecodingPacketLossFadeNoiseGeneration = Number(t.stat(e)))
: "googDecodingNormal" == e
? (i.m_DecodingNormal = Number(t.stat(e)))
: "googDecodingCTSG" == e
? (i.m_DecodingSilenceGenerator = Number(t.stat(e)))
: "googDecodingMuted" == e && (i.m_DecodingMuted = Number(t.stat(e)));
});
let o = e.m_mapSSRCToAccountID.get(i.m_SSRC);
null != o && e.m_mapAccountIDToAudioStats.set(o, i);
} else if ("video" == o) {
let i = new P();
n.forEach((e) => {
"ssrc" == e
? (i.m_SSRC = Number(t.stat(e)))
: "googCurrentDelayMs" == e
? (i.m_MostRecentDelayEstimateMs = Number(t.stat(e)))
: "googTargetDelayMs" == e
? (i.m_TargetDelayMs = Number(t.stat(e)))
: "googRenderDelayMs" == e
? (i.m_RenderDelayMs = Number(t.stat(e)))
: "googInterframeDelayMax" == e
? (i.m_MaxInterframeDelay = Number(t.stat(e)))
: "googJitterBufferMs" == e
? (i.m_CurrentJitterBufferMs = Number(t.stat(e)))
: "packetsReceived" == e
? (i.m_PacketsReceived = Number(t.stat(e)))
: "packetsLost" == e
? (i.m_PacketsLost = Number(t.stat(e)))
: "bytesReceived" == e
? (i.m_BytesReceived = Number(t.stat(e)))
: "framesDecoded" == e
? (i.m_FramesDecoded = Number(t.stat(e)))
: "googDecodeMs" == e
? (i.m_DecodeMs = Number(t.stat(e)))
: "googMaxDecodeMs" == e
? (i.m_MaxDecodeMs = Number(t.stat(e)))
: "googFrameWidthReceived" == e
? (i.m_FrameWidthReceived = Number(t.stat(e)))
: "googFrameHeightReceived" == e
? (i.m_FrameHeightRecieved = Number(t.stat(e)))
: "googFrameRateReceived" == e
? (i.m_FrameRateReceived = Number(t.stat(e)))
: "googFrameRateDecoded" == e
? (i.m_FrameRateDecoded = Number(t.stat(e)))
: "googFrameRateOutput" == e
? (i.m_FrameRateOutput = Number(t.stat(e)))
: "googNacksSent" == e
? (i.m_NacksSent = Number(t.stat(e)))
: "googPlisSent" == e && (i.m_PlisSent = Number(t.stat(e)));
});
let o = e.m_mapSSRCToAccountID.get(i.m_SSRC);
null != o && e.m_mapAccountIDToVideoStats.set(o, i);
}
}
});
}),
e.LogMsg("-----------------------------------------------------------"),
e.LogMsg("(WebRTC) " + e.PadOutput("(Receiving SSRC)", 40) + " " + e.PadOutput("Packets Received", 20) + " " + e.PadOutput("Est. Delay MS", 20) + " " + e.PadOutput("Packets Lost", 20) + " " + e.PadOutput("Last Jitter MS", 20) + " " + e.PadOutput("Jitter Buffer MS", 20) + " " + e.PadOutput("Decoding Successes", 20) + " " + e.PadOutput("Decoding Errors", 20)),
e.m_mapAccountIDToAudioStats.forEach((t, n) => {
let i = h.Ul.FriendStore.GetPlayerIfCached(n),
o = "[unknown]";
null != i && (o = i.display_name);
let r = String(t.m_SSRC);
(o = o.substring(0, 39 - r.length) + " " + r), e.LogMsg("(WebRTC) " + e.PadOutput(o, 40) + " " + e.PadOutput(String(t.m_PacketsReceived), 20) + " " + e.PadOutput(String(t.m_MostRecentDelayEstimateMs), 20) + " " + e.PadOutput(String(t.m_PacketsLost), 20) + " " + e.PadOutput(String(t.m_MostRecentJitterReceivedMs), 20) + " " + e.PadOutput(String(t.m_CurrentJitterBufferMs), 20) + " " + e.PadOutput(String(t.m_DecodingNormal + t.m_DecodingComfortNoiseGeneration), 20) + " " + e.PadOutput(String(t.m_DecodingPacketLossCorrection + t.m_DecodingPacketLossFadeNoiseGeneration + t.m_DecodingSilenceGenerator), 20));
}),
e.m_mapAccountIDToVideoStats.size > 0 &&
(e.LogMsg("-----------------------------------------------------------"),
e.LogMsg("(WebRTC) " + e.PadOutput("(Receiving SSRC)", 40) + " " + e.PadOutput("Packets Received", 20) + " " + e.PadOutput("Est. Delay MS", 20) + " " + e.PadOutput("Packets Lost", 20) + " " + e.PadOutput("Frame Metrics", 20) + " " + e.PadOutput("FPS Decoded", 20) + " " + e.PadOutput("FPS Output", 20) + " " + e.PadOutput("Decode MS (Max)", 20) + " " + e.PadOutput("NACKs / PLIs Sent", 20)),
e.m_mapAccountIDToVideoStats.forEach((t, n) => {
let i = h.Ul.FriendStore.GetPlayerIfCached(n),
o = "[unknown]";
null != i && (o = i.display_name);
let r = String(t.m_SSRC);
(o = o.substring(0, 39 - r.length) + " " + r), e.LogMsg("(WebRTC) " + e.PadOutput(o, 40) + " " + e.PadOutput(String(t.m_PacketsReceived), 20) + " " + e.PadOutput(String(t.m_MostRecentDelayEstimateMs), 20) + " " + e.PadOutput(String(t.m_PacketsLost), 20) + " " + e.PadOutput(`${t.m_FrameWidthReceived} x ${t.m_FrameHeightRecieved} @ ${t.m_FrameRateReceived}`, 20) + " " + e.PadOutput(String(t.m_FrameRateDecoded), 20) + " " + e.PadOutput(String(t.m_FrameRateOutput), 20) + " " + e.PadOutput(`${t.m_DecodeMs} (${t.m_MaxDecodeMs})`, 20) + " " + e.PadOutput(`${t.m_NacksSent} / ${t.m_PlisSent}`, 20));
})),
e.LogMsg("-----------------------------------------------------------");
} catch (e) {}
}
PadOutput(e, t, n = void 0) {
if (Math.abs(t) <= e.length) return e;
let i = Math.max(Math.abs(t) - e.length || 0, 0),
o = Array(i + 1).join(String(n || " ").charAt(0));
return t < 0 ? o + e : e + o;
}
CheckConnection() {
if (this.m_VoiceCallState.m_eState == A.k_EVoiceCallState_Connected || this.m_VoiceCallState.m_eState == A.k_EVoiceCallState_LocalMicOnly) this.LogMsg("(VoiceChat) Succcess! Voice is fully connected took " + (this.m_VoiceCallState.m_timeFinishedConnecting - this.m_VoiceCallState.m_timeStartedConnecting).toFixed(0) + "ms to complete, " + (this.m_VoiceCallState.m_nFailuresThisInitiate + 1) + " attempts made before success."), ClearBackgroundInterval(this.m_ConnectionCheck), (this.m_ConnectionCheck = 0), (this.m_VoiceCallState.m_nFailuresThisInitiate = 0), (this.m_VoiceCallState.m_bIsConnectionAttemptOverTwoSeconds = !1), (this.m_StatsTimeout = SetBackgroundTimeout(this.ProcessStatsReport, 1e4));
else {
let e = performance.now() - this.m_VoiceCallState.m_timeStartedConnecting;
this.m_VoiceCallState.m_bIsConnectionAttemptOverTwoSeconds = e > 2e3;
let t = 6e4;
0 != this.m_VoiceCallState.m_targetAccountID && this.m_VoiceCallState.m_eState == A.k_EVoiceCallState_RequestedPermission && (t = 3e5), e > t && (this.LogMsg("(VoiceChat) Failure! Gave up after more than one minute trying to connect, last state was " + B(this.m_VoiceCallState.m_eState) + "(" + this.m_VoiceCallState.m_eState + ")"), this.EndVoiceChatInternal(!1)), this.LogMsg("(VoiceChat) Still trying to connect to voice chat/webrtc " + B(this.m_VoiceCallState.m_eState) + "(" + this.m_VoiceCallState.m_eState + ") " + (performance.now() - this.m_VoiceCallState.m_timeStartedConnecting).toFixed(0) + "ms elapsed...");
}
}
BSupportsDataChannels() {
var e;
return -1 != (null === (e = this.m_PeerConnection) || void 0 === e ? void 0 : e.localDescription.sdp.indexOf("webrtc-datachannel"));
}
RenegotiateSDP() {
this.m_VoiceCallState.m_eState == A.k_EVoiceCallState_Connected && this.BackOffAndRetryInitiateVoiceChat();
}
BackOffAndRetryInitiateVoiceChat() {
if (this.m_VoiceCallState.m_eState != A.k_EVoiceCallState_None) {
let e = this.m_VoiceCallState.m_nFailuresThisInitiate,
t = this.m_VoiceCallState.m_targetAccountID,
n = this.m_VoiceCallState.m_chatRoom;
this.EndVoiceChatInternal(!0), (this.m_VoiceCallState.m_eState = A.k_EVoiceCallState_ScheduledInitiate), (this.m_VoiceCallState.m_targetAccountID = t), (this.m_VoiceCallState.m_chatRoom = n), (this.m_VoiceCallState.m_nFailuresThisInitiate = e + 1);
let i = 250;
(i = e < 1 ? 250 : e < 3 ? 1e3 : e < 5 ? 5e3 : e < 10 ? 1e4 : e < 15 ? 3e4 : 6e4),
this.LogMsg("(VoiceChat) Retrying InitiateVoiceChat in " + i.toFixed(0) + " milliseconds..."),
this.m_VoiceCallState.m_bInitiatedOneOnOneCall || 0 == this.m_VoiceCallState.m_targetAccountID
? (this.m_ScheduledInitiate = SetBackgroundTimeout(() => {
this.ScheduledInitiate(t, n);
}, i))
: (this.m_ScheduledInitiate = SetBackgroundTimeout(() => {
this.ScheduledAcceptOneOnOne(t);
}, i));
}
}
ScheduledAcceptOneOnOne(e) {
(this.m_ScheduledInitiate = 0), this.AcceptPartnersOneOnOneChatRequest(e);
}
ScheduledInitiate(e, t) {
(this.m_ScheduledInitiate = 0), this.InitiateVoiceChat(e, t);
}
InitiateVoiceChat(e, t) {
a.F.BClientConnected().then(() => {}), t && ((b.ActiveDataChannelSupplier = this), (f.session = { groupID: t.groupID, roomID: t.chatID }));
let n = new T.UAParser(navigator.userAgent).getResult(),
i = "Chrome" == n.browser.name,
r = "Edge" == n.browser.name && "Blink" == n.engine.name;
if (!i && !r) {
this.LogMsg("(VoiceChat) Voice chat not supported in browser: " + n.browser.name);
const e = (0, k.Xx)(o.De.IN_MOBILE ? "#VoiceChat_Unavailable_NotSupported" : "#Voice_VoiceUnavailableInBrowser_Title"),
t = o.De.IN_MOBILE ? (0, k.Xx)("#VoiceChat_Unavailable_MobileChat") : (0, k.Xx)("#Voice_VoiceUnavailableInBrowser_Body", n.browser.name);
return void h.Ul.ShowAlert(e, t, (0, k.Xx)("#Voice_VoiceUnavailableInBrowser_OK"))
.then(() => {})
.catch(() => !0);
}
if (0 != e && t) return void this.LogMsg("Cant initiate voice chat for both friend & group");
let s = this.m_VoiceCallState.BMatchingCall(e, t);
!this.m_VoiceCallState.BMatchingCall(e, t) && this.m_VoiceCallState.m_eState > A.k_EVoiceCallState_ScheduledInitiate && (this.LogMsg("(VoiceChat) InitiateVoiceChat called for new target account/room while already connected, ending prior session first"), this.EndVoiceChatInternal(!1)), this.m_ScheduledInitiate && (ClearBackgroundTimeout(this.m_ScheduledInitiate), (this.m_ScheduledInitiate = 0));
let l = performance.now();
if (this.m_VoiceCallState.m_eState <= A.k_EVoiceCallState_ScheduledInitiate && 0 != this.m_VoiceCallState.m_timeEndedVoiceChat && l - this.m_VoiceCallState.m_timeEndedVoiceChat < 100) {
(this.m_VoiceCallState.m_eState = A.k_EVoiceCallState_ScheduledInitiate), (this.m_VoiceCallState.m_targetAccountID = e), (this.m_VoiceCallState.m_bInitiatedOneOnOneCall = !0), (this.m_VoiceCallState.m_chatRoom = t);
let n = 100 - (l - this.m_VoiceCallState.m_timeEndedVoiceChat);
return (
this.LogMsg("(VoiceChat) Delaying requested InitiateChat for " + n.toFixed(0) + " milliseconds to let prior EndVoiceChat finish..."),
void (this.m_ScheduledInitiate = SetBackgroundTimeout(() => {
this.ScheduledInitiate(e, t);
}, n))
);
}
(!s || this.m_VoiceCallState.m_eState <= A.k_EVoiceCallState_ScheduledInitiate) &&
(e ? this.LogMsg("Resetting voice chat state and initiating to individual " + e) : t ? this.LogMsg("Resetting voice chat state and initiating to room " + t.chatID) : ((0, L.X)(this.m_VoiceEchoLocalMic, "Shouldn't hit local mic access only without echo local mic on"), this.LogMsg("Resetting voice chat state and initiating local mic access only")),
this.m_VoiceCallState.m_eState <= A.k_EVoiceCallState_ScheduledInitiate && ((0 == e && null == t) || this.DispatchSetVoiceChatActive(!0), (this.m_VoiceCallState.m_targetAccountID = e), (this.m_VoiceCallState.m_bInitiatedOneOnOneCall = !0), (this.m_VoiceCallState.m_chatRoom = t), (this.m_VoiceCallState.m_timeStartedConnecting = performance.now()), (this.m_VoiceCallState.m_nMostRecentRemoteDescriptionVersion = "0"), (this.m_VoiceCallState.m_bIsConnectionAttemptOverTwoSeconds = !1), (this.m_ConnectionCheck = SetBackgroundInterval(this.CheckConnection, 2e3)), 0 != e ? this.InitiateOneOnOneVoiceChat(e) : this.InitiateChatRoomVoice()));
}
OnRequestMicrophoneAccess() {
if (this.m_VoiceCallState.m_eState > A.k_EVoiceCallState_ScheduledInitiate) return this.LogMsg("(VoiceChat) Hit OnRequestMicrophoneAccess in wrong state " + this.m_VoiceCallState.m_eState), void this.EndVoiceChatInternal(!1);
null == this.m_AudioContext && (this.m_AudioContext = h.Ul.AudioPlaybackManager.context);
let e = { optional: [{ echoCancellation: this.m_Settings.m_VoiceUseEchoCancellation }, { googEchoCancellation: this.m_Settings.m_VoiceUseEchoCancellation }, { googEchoCancellation2: this.m_Settings.m_VoiceUseEchoCancellation }, { googNoiseSupression: this.m_Settings.m_VoiceUseNoiseCancellation }, { googNoiseSupression2: this.m_Settings.m_VoiceUseNoiseCancellation }, { mozNoiseSuppression: this.m_Settings.m_VoiceUseNoiseCancellation }, { googAutoGainControl: this.m_Settings.m_VoiceUseAutoGainControl }, { googAutoGainControl2: this.m_Settings.m_VoiceUseAutoGainControl }, { mozAutoGainControl: this.m_Settings.m_VoiceUseAutoGainControl }, { googHighpassFilter: !0 }, { googAudioMirroring: !1 }] };
"default" != this.m_Settings.m_SelectedMicID && e.optional.push({ sourceId: this.m_Settings.m_SelectedMicID }), this.m_VoiceCallState.m_targetAccountID ? this.LogMsg("(VoiceChat) Call to individual " + this.m_VoiceCallState.m_targetAccountID + " now initating getUserMedia/WebRTC") : this.m_VoiceCallState.m_chatRoom && this.LogMsg("(VoiceChat) Call to room " + this.m_VoiceCallState.m_chatRoom.chatID + " now initating getUserMedia/WebRTC"), (this.m_VoiceCallState.m_eState = A.k_EVoiceCallState_RequestedMicAccess);
let t = navigator;
(this.m_bUserHasDeniedMicPermissions = !1),
(t.getUserMedia = t.getUserMedia || t.webkitGetUserMedia || t.mozGetUserMedia || t.msGetUserMedia),
t.getUserMedia(
{ audio: e, video: this.m_bSendVideo },
(e) => {
this.OnGetUserMediaSuccess(e);
},
this.OnGetUserMediaFailure,
);
}
ScheduleClientVoiceLogsUpload(e) {
if ("" == this.m_VoiceCallState.m_voiceChatID) return;
this.m_ScheduledVoiceLogsUpload && (ClearBackgroundTimeout(this.m_ScheduledVoiceLogsUpload), (this.m_ScheduledVoiceLogsUpload = 0));
this.m_ScheduledVoiceLogsUpload = SetBackgroundTimeout(this.UploadClientSideVoiceLogs, 1e3 * e);
}
UploadClientSideVoiceLogs() {
if ("" == this.m_VoiceCallState.m_voiceChatID) return;
if (this.m_bClientSideLogsUploadInProgress) return void this.ScheduleClientVoiceLogsUpload(2);
this.m_bClientSideLogsUploadInProgress = !0;
let e = r.gA.Init(y.R_);
e.Body().set_voice_chatid(this.m_VoiceCallState.m_voiceChatID);
let t = this.m_rgLogLines.slice(this.m_nLastLogLineUploaded);
e.Body().set_client_voice_logs_new_lines(t.join("\r\n"));
let n = t.length;
y.p3
.UploadClientVoiceChatLogs(this.m_CMInterface.GetServiceTransport(), e)
.then((e) => {
1 == e.GetEResult() ? ((this.m_nLastLogLineUploaded += n), this.LogMsg("(VoiceChat) Uploaded " + n + " new lines of voice chat log info to server"), this.ScheduleClientVoiceLogsUpload(20)) : (this.LogMsg("(VoiceChat) Error uploading client side logs to voice chat session, will retry soon"), this.ScheduleClientVoiceLogsUpload(10 + 10 * Math.random())), (this.m_bClientSideLogsUploadInProgress = !1);
})
.catch((e) => {
this.LogMsg("(VoiceChat) Error uploading client side logs to voice chat session, will retry soon"), this.ScheduleClientVoiceLogsUpload(10 + 10 * Math.random()), (this.m_bClientSideLogsUploadInProgress = !1);
});
}
EndVoiceChatInternal(e) {
if ((this.m_ScheduledVoiceLogsUpload && this.UploadClientSideVoiceLogs(), this.m_ScheduledInitiate && (ClearBackgroundTimeout(this.m_ScheduledInitiate), (this.m_ScheduledInitiate = 0)), this.m_StatsTimeout && (ClearBackgroundTimeout(this.m_StatsTimeout), (this.m_StatsTimeout = 0)), this.DispatchSetVoiceChatActive(!1), this.m_VoiceCallState.m_eState == A.k_EVoiceCallState_None)) return;
if (!e) {
if (this.m_VoiceCallState.m_targetAccountID) {
let e = this.m_VoiceCallState.m_targetAccountID;
this.m_VoiceCallState.m_targetAccountID = 0;
let t = this.m_VoiceCallState.m_voiceChatID,
n = r.gA.Init(y.Ky);
n.Body().set_steamid_partner(u.K.InitFromAccountID(e).ConvertTo64BitString()), n.Body().set_voice_chatid(this.m_VoiceCallState.m_voiceChatID);
let i = this.m_VoiceCallState.m_eState;
y.p3.LeaveOneOnOneChat(this.m_CMInterface.GetServiceTransport(), n).then((n) => {
if (1 == n.GetEResult())
if ((this.LogMsg("(VoiceChat) Left voice chat with " + e), i == A.k_EVoiceCallState_Connected)) {
let n = new X();
(n.partner_accountid = this.m_CMInterface.steamid.GetAccountID()), (n.voice_chatid = t), (n.previously_joined = !0), this.m_mapOneOnOneCallsWaitingJoinOrAccept.set(e, n);
} else {
let t = h.Ul.FriendStore.self,
n = h.Ul.ChatStore.GetFriendChat(e, !1);
n && t && n.AddVoiceChannelInviteMsg(h.Ul.CMInterface.steamid.GetAccountID(), h.Ul.GetServerRTime32(), (0, k.Xx)("#FriendMsg_VoiceChannelEndedExplicit", t.display_name));
}
else this.LogMsg("(VoiceChat) Failed leaving voice chat with " + e);
});
} else if (this.m_VoiceCallState.m_chatRoom) {
let e = r.gA.Init(I.zw);
e.Body().set_chat_group_id(this.m_VoiceCallState.m_chatRoom.groupID), e.Body().set_chat_id(this.m_VoiceCallState.m_chatRoom.chatID);
let t = this.m_VoiceCallState.m_chatRoom.chatID;
I.Xn.LeaveVoiceChat(this.m_CMInterface.GetServiceTransport(), e).then((e) => {
1 == e.GetEResult() ? this.LogMsg("(VoiceChat) Left chat room (" + t + ") voice chat") : this.LogMsg("(VoiceChat) Failed leaving chat room (" + t + ") voice chat");
});
}
(b.ActiveDataChannelSupplier = void 0), this.m_mapUserVoiceStatus.clear();
}
this.m_mapSSRCToAccountID.clear(), this.m_mapAccountIDToAudioStats.clear(), this.m_mapAccountIDToVideoStats.clear();
let t = this.m_VoiceCallState.m_eState > A.k_EVoiceCallState_RequestedPermission;
(this.m_VoiceCallState.m_eState = A.k_EVoiceCallState_None), (this.m_VoiceCallState.m_targetAccountID = 0), (this.m_VoiceCallState.m_bInitiatedOneOnOneCall = !1), (this.m_VoiceCallState.m_bPostedOneOnOneEndedMsg = !1), (this.m_VoiceCallState.m_bWaitingOnOneOnOneRejoin = !1), (this.m_VoiceCallState.m_chatRoom = null), (e && t) || (this.m_VoiceCallState.m_voiceChatID = ""), (this.m_VoiceCallState.m_nMostRecentRemoteDescriptionVersion = "0"), (this.m_VoiceCallState.m_nFailuresThisInitiate = 0), (this.m_VoiceCallState.m_timeEndedVoiceChat = performance.now()), (this.m_VoiceCallState.m_webRTCConnectedNotification = void 0), (this.m_VoiceCallState.m_bOfferUpdateInProgress = !1), (this.m_VoiceCallState.m_msgPendingRemoteDescriptionUpdate = void 0), this.m_ConnectionCheck && (ClearBackgroundInterval(this.m_ConnectionCheck), (this.m_ConnectionCheck = 0));
let n = this.m_rgVideoStreams.pop();
for (; null != n; ) n = this.m_rgVideoStreams.pop();
let i = this.m_rgAudioStreams.pop();
for (; null != i; ) {
null != i.elem && (i.elem.pause(), (i.elem.src = void 0), (i.elem.srcObject = void 0), (i.elem = void 0)), null != i.volume_meter && (i.volume_meter.stop(), (i.volume_meter = void 0)), (i.stream.oninactive = void 0);
for (let e of i.stream.getTracks()) e.stop();
if (null != this.m_AudioContext && i.source_node)
try {
if ((i.source_node.disconnect(), i.type == R.k_EAudioStreamType_Microphone && i.source_node instanceof MediaStreamAudioSourceNode)) for (let e of i.source_node.mediaStream.getTracks()) e.stop();
} catch (e) {}
i.output_gain_node && (i.output_gain_node.disconnect(), (i.output_gain_node = void 0)), (i = this.m_rgAudioStreams.pop());
}
null != this.m_MicVolumeMeter && (this.m_MicVolumeMeter.stop(), (this.m_MicVolumeMeter = void 0)), null != this.m_MicNoiseGate && (this.m_MicNoiseGate.input ? (this.m_MicNoiseGate.input.disconnect(), this.m_MicNoiseGate.output.disconnect(), this.m_MicNoiseGate.noiseGateKernel_.disconnect()) : this.m_MicNoiseGate.disconnect(), (this.m_MicNoiseGate = void 0)), null != this.m_MicInputGainNode && (this.m_MicInputGainNode.disconnect(), (this.m_MicInputGainNode = void 0)), null != this.m_AudioContext && (h.Ul.AudioPlaybackManager.SetVoiceNotActive(), (this.m_AudioContext = void 0)), this.m_PeerConnection && ((this.m_PeerConnection.oniceconnectionstatechange = void 0), (this.m_PeerConnection.onicegatheringstatechange = void 0), (this.m_PeerConnection.onsignalingstatechange = void 0), this.m_PeerConnection.close(), (this.m_PeerConnection = void 0));
}
GetPersonaState(e) {
const t = new u.K(e),
n = h.Ul.FriendStore.GetFriend(t.GetAccountID());
return (0, g.gx)(() => n.is_ready, { timeout: 5e3 }).then(() => n.persona);
}
FillInChatUsabilityMetrics(e) {
let t = e.voice_settings();
t.set_voice_input_gain(this.m_Settings.m_VoiceInputGain), t.set_voice_output_gain(this.m_Settings.m_VoiceOutputGain), t.set_noise_gate_level(Math.round(this.m_Settings.m_NoiseGateLevel)), t.set_voice_use_echo_cancellation(this.m_Settings.m_VoiceUseEchoCancellation), t.set_voice_use_noise_cancellation(this.m_Settings.m_VoiceUseNoiseCancellation), t.set_voice_use_auto_gain_control(this.m_Settings.m_VoiceUseAutoGainControl), t.set_selected_non_default_mic("default" !== this.m_Settings.m_SelectedMicID), t.set_selected_non_default_output("default" !== this.m_Settings.m_SelectedOutputID), t.set_push_to_talk_enabled(this.GetPushToTalkEnabled()), t.set_push_to_mute_enabled(this.GetPushToMuteEnabled()), t.set_play_ptt_sounds(this.m_Settings.m_bPlayPTTSounds), this.IsAnyVoiceActive() && (this.m_VoiceCallState.m_targetAccountID ? e.ui_state().set_in_one_on_one_voice_chat(!0) : this.m_VoiceCallState.m_chatRoom && e.ui_state().set_in_group_voice_chat(!0));
}
}
(j.k_MaxPerUserGainMultiplier = 2),
(j.k_MaxInputOutputGainValue = 4),
(j.k_nMaxPositions = 32),
(0, i.gn)([g.LO], j.prototype, "m_VoiceCallState", void 0),
(0, i.gn)([g.LO], j.prototype, "m_bPushToTalkEnabled", void 0),
(0, i.gn)([g.LO], j.prototype, "m_bPushToMuteEnabled", void 0),
(0, i.gn)([g.LO], j.prototype, "m_bVoicePTTStateEnabled", void 0),
(0, i.gn)([g.LO], j.prototype, "m_VKPushToTalkHotKey", void 0),
(0, i.gn)([g.LO], j.prototype, "m_strPushToTalkDisplayString", void 0),
(0, i.gn)([g.LO], j.prototype, "m_bUserHasDeniedMicPermissions", void 0),
(0, i.gn)([g.LO], j.prototype, "m_bOutputMuted", void 0),
(0, i.gn)([g.LO], j.prototype, "m_AudioContext", void 0),
(0, i.gn)([g.LO], j.prototype, "m_rgAudioStreams", void 0),
(0, i.gn)([g.LO], j.prototype, "m_MicVolumeMeter", void 0),
(0, i.gn)([g.LO], j.prototype, "m_MicNoiseGate", void 0),
(0, i.gn)([g.LO], j.prototype, "m_MicInputGainNode", void 0),
(0, i.gn)([g.LO], j.prototype, "m_rgVideoStreams", void 0),
(0, i.gn)([g.LO], j.prototype, "m_bSendVideo", void 0),
(0, i.gn)([g.LO], j.prototype, "m_bReceiveVideo", void 0),
(0, i.gn)([g.LO], j.prototype, "m_PeerConnection", void 0),
(0, i.gn)([g.LO], j.prototype, "m_Settings", void 0),
(0, i.gn)([g.LO], j.prototype, "m_bLocalMicTestActive", void 0),
(0, i.gn)([g.LO], j.prototype, "m_bForceConnectingStatus", void 0),
(0, i.gn)([g.LO], j.prototype, "m_bForceReconnectingStatus", void 0),
(0, i.gn)([g.LO], j.prototype, "m_localPose", void 0),
(0, i.gn)([g.LO], j.prototype, "m_mapRemotePoseForAccountID", void 0),
(0, i.gn)([g.aD.bound], j.prototype, "SetSelectedMic", null),
(0, i.gn)([g.aD.bound], j.prototype, "SetSelectedOutput", null),
(0, i.gn)([g.aD.bound], j.prototype, "SetUseEchoCancellation", null),
(0, i.gn)([g.aD.bound], j.prototype, "SetUseNoiseCancellation", null),
(0, i.gn)([g.aD.bound], j.prototype, "SetUseAutoGainControl", null),
(0, i.gn)([g.aD.bound], j.prototype, "SetVoiceEchoLocalMic", null),
(0, i.gn)([g.aD.bound], j.prototype, "SetVoiceLogDetails", null),
(0, i.gn)([g.aD.bound], j.prototype, "GetVoiceLogDetails", null),
(0, i.gn)([g.aD.bound], j.prototype, "SetUseNoiseGateLevel", null),
(0, i.gn)([g.aD.bound], j.prototype, "SetVoiceInputGain", null),
(0, i.gn)([g.aD.bound], j.prototype, "SetVoiceOutputGain", null),
(0, i.gn)([g.aD.bound], j.prototype, "ForceReconnectingStatus", null),
(0, i.gn)([g.aD.bound], j.prototype, "ForceConnectingStatus", null),
(0, i.gn)([g.aD.bound], j.prototype, "LogMsg", null),
(0, i.gn)([g.aD.bound], j.prototype, "GetVoiceLogs", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnPushToTalkReleased", null),
(0, i.gn)([g.aD.bound, (0, M.D)(150)], j.prototype, "DebouncedToggleMicMuting", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnPushToTalkStateChange", null),
(0, i.gn)([g.aD.bound], j.prototype, "UpdateNoiseGateOnActiveMic", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnAudioContextStateChange", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnIceCandidate", null),
(0, i.gn)([g.aD.bound], j.prototype, "AddRemoteIceCandidate", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnSignalingStateChange", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnIceConnectionStateChange", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnIceGatheringStateChange", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnRemoveRemoteStream", null),
(0, i.gn)([g.aD], j.prototype, "SetLocalHMDPose", null),
(0, i.gn)([g.aD], j.prototype, "SetRemoteHMDPose", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnAddRemoteStream", null),
(0, i.gn)([g.aD.bound], j.prototype, "ModifyLocalSDPBeforeSetting", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnCreateOfferSuccess", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnCreateOfferError", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnNoiseGateMessage", null),
(0, i.gn)([g.aD.bound], j.prototype, "SetupNoiseGateOnMic", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnGetUserMediaSuccess", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnGetUserMediaFailure", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnSetUpdatedLocalDescriptionSuccess", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnSetUpdatedLocalDescriptionFailure", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnCreateAnswerSuccess", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnCreateAnswerError", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnAcceptOneOnOneVoiceChat", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnRejectOneOnOneVoiceChat", null),
(0, i.gn)([g.aD.bound], j.prototype, "PlayRingSound", null),
(0, i.gn)([g.aD.bound], j.prototype, "ProcessStatsReport", null),
(0, i.gn)([g.aD.bound], j.prototype, "ProcessReceiverStatsReport", null),
(0, i.gn)([g.aD.bound], j.prototype, "CheckConnection", null),
(0, i.gn)([g.aD.bound], j.prototype, "ScheduledAcceptOneOnOne", null),
(0, i.gn)([g.aD.bound], j.prototype, "ScheduledInitiate", null),
(0, i.gn)([g.aD.bound], j.prototype, "OnRequestMicrophoneAccess", null),
(0, i.gn)([g.aD.bound], j.prototype, "UploadClientSideVoiceLogs", null);
},
23133: (e, t, n) => {
"use strict";
n.d(t, { G: () => l, R: () => c });
var i = n(85556),
o = n(37234),
r = n(27378),
a = n(83817),
s = n(88669);
const l = r.forwardRef(function (e, t) {
const { rgAcceptedTypes: n, bAcceptsFiles: o, fnDragEnter: a, fnDragLeave: s, fnDragOver: l, fnDrop: c } = e,
d = (0, i._T)(e, ["rgAcceptedTypes", "bAcceptsFiles", "fnDragEnter", "fnDragLeave", "fnDragOver", "fnDrop"]),
h = m({ rgAcceptedTypes: n, bAcceptsFiles: o, fnDragEnter: a, fnDragLeave: s, fnDragOver: l, fnDrop: c });
return r.createElement("div", Object.assign({}, d, h, { className: "DropTarget " + d.className, ref: t }));
}),
c = r.forwardRef(function (e, t) {
const { rgAcceptedTypes: n, bAcceptsFiles: o, fnDragEnter: s, fnDragLeave: l, fnDragOver: c, fnDrop: d } = e,
h = (0, i._T)(e, ["rgAcceptedTypes", "bAcceptsFiles", "fnDragEnter", "fnDragLeave", "fnDragOver", "fnDrop"]),
u = m({ rgAcceptedTypes: n, bAcceptsFiles: o, fnDragEnter: s, fnDragLeave: l, fnDragOver: c, fnDrop: d });
return r.createElement(a.s, Object.assign({}, h, u, { className: "DropTarget " + h.className, ref: t }));
});
function m(e) {
const { rgAcceptedTypes: t, bAcceptsFiles: n, fnDragEnter: i, fnDragLeave: a, fnDragOver: l, fnDrop: c } = e,
m = r.useRef(null),
d = r.useRef(!1),
h = r.useRef([]),
u = r.useCallback(() => {
let e = o.g_FriendsUIDesktopApp.DragDropManager.GetDragData();
if (!e && h.current) {
const t = new Map();
for (const e of h.current) t.set(e, "");
e = { type: "html", mapData: t };
}
return i(e, m.current.bFiles);
}, [i]);
return {
onDragEnter: r.useCallback(
(e) => {
if (!d.current) {
h.current = [];
let r = o.g_FriendsUIDesktopApp.DragDropManager.GetDragData(),
a = n && -1 != e.dataTransfer.types.indexOf("Files");
(r && -1 != t.indexOf(r.type)) || a ? (d.current = !0) : t.filter((t) => e.dataTransfer.types.includes(t)).length > 0 ? ((h.current = t.filter((t) => e.dataTransfer.types.includes(t))), (d.current = !0)) : (d.current = !1), d.current && i && (m.current = { bFiles: a }), d.current && (e.preventDefault(), e.stopPropagation());
}
},
[n, t, i],
),
onDragLeave: r.useCallback(
(e) => {
if (d.current) {
if (!(0, s.H0)(e)) return;
(d.current = !1), e.preventDefault(), e.stopPropagation(), a && a();
}
},
[a],
),
onDragOver: r.useCallback(
(e) => {
if (d.current) {
if (m.current) {
let e = u();
if (((m.current = null), !e)) return void (d.current = !1);
}
e.preventDefault(), e.stopPropagation(), l && l(e);
}
},
[l, u],
),
onDrop: r.useCallback(
(e) => {
if (d.current) {
(d.current = !1), e.preventDefault(), e.stopPropagation();
let i = o.g_FriendsUIDesktopApp.DragDropManager.GetDragData();
if (i && -1 != t.indexOf(i.type)) c && c(i, e);
else if (n && 0 != e.dataTransfer.files.length) c && c(null, e);
else if (!i && h.current.length > 0 && c) {
const t = new Map();
for (const n of h.current) t.set(n, e.dataTransfer.getData(n));
c({ type: "html", mapData: t }, e);
}
}
},
[t, n, c],
),
};
}
},
60176: (e, t, n) => {
"use strict";
n.d(t, { tD: () => he, NS: () => ge, RQ: () => _e, NL: () => Ce, Lx: () => de, ar: () => ae, CT: () => se, uW: () => pe, JS: () => le, R5: () => ue, cl: () => ce });
var i = n(85556),
o = n(19953),
r = n(84446),
a = n(93354),
s = n(23346),
l = n(19339),
c = n(72746),
m = n(37234),
d = n(23133),
h = n(27378),
u = n(29512),
p = n(64179),
_ = n.n(p);
const g = (e) => {
var { message: t, name: n, renderImage: o } = e,
r = (0, i._T)(e, ["message", "name", "renderImage"]);
return h.createElement(u.Z, Object.assign({ key: "inviteDrop", classNames: Object.assign({}, _()), timeout: 300 }, r), h.createElement("div", { className: _().ChatModalCover }, h.createElement("div", { className: _().InviteDropContainer }, h.createElement("span", { className: _().InviteDropImage }, o()), h.createElement("span", { className: _().InviteDropName }, n), h.createElement("span", { className: _().InviteDropMessage }, t), h.createElement("span", { className: _().InviteDropBackground }))));
};
var C = n(618),
f = n(41111),
v = n(97720),
S = n(71357),
b = n(14341),
I = n(50649),
y = n(31542),
E = n(56320),
D = n(29205),
w = n(41758),
R = n(11259),
A = n(38571),
M = n(68816),
k = n(16518),
T = n(93635),
L = n(87018),
G = n(88669),
O = n(84290),
F = n(2049),
B = n(83817),
x = n(31360),
N = n(15152),
P = n(3276),
U = n(13106),
V = n(31695),
H = n(58908),
W = n(88991),
X = n(59702),
j = n(74915),
z = n(97224),
K = n(90406),
q = n(62902),
Z = n(62860),
Q = n(33690);
const $ = h.lazy(() => Promise.all([n.e(5140), n.e(4679)]).then(n.bind(n, 35299)));
let Y = class extends h.Component {
constructor(e) {
super(e), (this.m_fnUnregisterDropComplete = void 0), (this.m_bChatHidden = !1), (this.m_refBroadcastContainer = h.createRef()), (this.state = { dropToInviteFriend: void 0, dropGroupToInviteFriend: void 0, dropClanToInvite: void 0, speakerLabelWidth: 0 }), (this.m_friendSteamId = W.K.InitFromAccountID(e.chatView.chat.accountid_partner).ConvertTo64BitString());
}
OnDragEnter(e, t) {
if ((e ? (0, T.X)("friend" == e.type || "chatroomgroup" == e.type || "clan" == e.type || "html" == e.type, "Invalid data type passed to FriendChatDialog.OnDrop") : (0, T.X)(t, "Invalid data type passed to FriendChatDialog.OnDrop"), !e)) return !0;
let n = "friend" == e.type ? e.friend : void 0;
if (n && n.accountid !== this.props.chatView.chat.accountid_partner) return this.m_fnUnregisterDropComplete || (this.m_fnUnregisterDropComplete = m.g_FriendsUIDesktopApp.DragDropManager.RegisterForDropComplete(this.OnDropComplete)), this.setState({ dropToInviteFriend: n }), !0;
let i = "chatroomgroup" == e.type ? e.group : void 0;
if (i) return this.m_fnUnregisterDropComplete || (this.m_fnUnregisterDropComplete = m.g_FriendsUIDesktopApp.DragDropManager.RegisterForDropComplete(this.OnDropComplete)), this.setState({ dropGroupToInviteFriend: i }), !0;
let o = "clan" == e.type ? e.clan : void 0;
return !o || (this.m_fnUnregisterDropComplete || (this.m_fnUnregisterDropComplete = m.g_FriendsUIDesktopApp.DragDropManager.RegisterForDropComplete(this.OnDropComplete)), this.setState({ dropClanToInvite: o }), !0);
}
OnDragLeave() {
(this.state.dropToInviteFriend || this.state.dropGroupToInviteFriend || this.state.dropClanToInvite) && (this.m_fnUnregisterDropComplete.Unregister(), (this.m_fnUnregisterDropComplete = void 0), this.setState({ dropToInviteFriend: void 0, dropGroupToInviteFriend: void 0, dropClanToInvite: void 0 }));
}
OnDragOver(e) {
e.dataTransfer.dropEffect = "move";
}
OnDrop(e, t) {
e ? (0, T.X)("friend" == e.type || "chatroomgroup" == e.type || "clan" == e.type || "html" == e.type, "Invalid data type passed to FriendChatDialog.OnDrop") : (0, T.X)(0 != t.dataTransfer.files.length, "Invalid data type passed to FriendChatDialog.OnDrop");
let n = this.props.chatView;
if (e) {
let i = t.currentTarget.ownerDocument.defaultView,
o = n.chat.chat_partner,
r = "friend" == e.type ? e.friend : void 0,
a = "chatroomgroup" == e.type ? e.group : void 0,
s = "clan" == e.type ? e.clan : void 0,
l = "html" == e.type ? e.mapData : void 0;
if (r) {
if (o == r) return;
this.state.dropToInviteFriend && (this.m_fnUnregisterDropComplete.Unregister(), (this.m_fnUnregisterDropComplete = void 0), this.setState({ dropToInviteFriend: void 0 })), m.g_FriendsUIDesktopApp.DragDropManager.SetDropConsumed(), ce({ invitee: r, chatview: n, invitedto: o }, (0, m.Um)(this, t), i);
} else a || s ? ((this.state.dropGroupToInviteFriend || this.state.dropClanToInvite) && (this.m_fnUnregisterDropComplete.Unregister(), (this.m_fnUnregisterDropComplete = void 0), this.setState({ dropGroupToInviteFriend: void 0, dropClanToInvite: void 0 })), m.g_FriendsUIDesktopApp.DragDropManager.SetDropConsumed(), s && (a = c.Ul.ChatStore.GetChatRoomGroup(s.GetChatGroupIDIfLoaded())), ce({ invitee: o, invitedto: a }, (0, m.Um)(this, t), i)) : l && l.has("text/plain") && n.SendChatMessage(l.get("text/plain"));
} else if (0 != t.dataTransfer.files.length) {
let e = t.dataTransfer.files[0];
n.SetFileToUpload(e);
}
}
OnDropComplete(e) {
!e && this.state.dropToInviteFriend && ((this.m_fnUnregisterDropComplete = void 0), this.setState({ dropToInviteFriend: void 0 }));
}
OnNameWidthChanged(e) {
this.setState({ speakerLabelWidth: e });
}
componentDidMount() {
window.addEventListener("resize", this.OnLayoutChange);
}
componentWillUnmount() {
window.removeEventListener("resize", this.OnLayoutChange);
}
CalculateBroadcastSectionStyles(e) {
if (this.m_bChatHidden) return { width: "100%", height: "100%" };
const { nWatchPartyBroadcastHeightPercentage: t, nWatchPartyBroadcastWidthPercentage: n } = m.g_FriendsUIDesktopApp.UIDisplayPrefs,
i = {};
if (e) {
const e = t || 66;
if (((i.height = `${e}%`), this.m_elMainContent)) {
const { clientWidth: t, clientHeight: n } = this.m_elMainContent,
o = (9 / 16) * t + 50,
r = (0, X.Lh)(e, 1, (o / n) * 100);
i.height = `${r}%`;
}
} else (i.width = n ? `${n}%` : "66%"), (i.overflowY = "auto");
return i;
}
ShouldShowVerticalBroadcastChat() {
return void 0 !== this.m_bShowVerticalBroadcastChat ? this.m_bShowVerticalBroadcastChat : !!this.m_elMainContent && this.m_elMainContent.clientHeight / this.m_elMainContent.clientWidth > 5 / 7;
}
OnLayoutChange() {
this.forceUpdate();
}
OnGrabberMouseDown(e) {
let t = e.currentTarget.ownerDocument.defaultView;
t.addEventListener("mousemove", this.HandleMouseMove), t.addEventListener("mouseup", this.UnregisterDragEvents);
}
HandleMouseMove(e) {
e.preventDefault(), e.stopPropagation();
let t = this.m_refBroadcastContainer.current.getBoundingClientRect(),
n = this.m_refBroadcastContainer.current.parentElement.getBoundingClientRect();
const i = this.ShouldShowVerticalBroadcastChat(),
o = i ? t.top : t.left,
r = i ? e.clientY : e.clientX,
a = i ? n.height : n.width,
s = (0, X.Lh)(((r - o) / a) * 100, 1, 100),
l = i ? "nWatchPartyBroadcastHeightPercentage" : "nWatchPartyBroadcastWidthPercentage";
m.g_FriendsUIDesktopApp.SetUIDisplayPref(l, s);
}
UnregisterDragEvents(e) {
e.view.removeEventListener("mousemove", this.HandleMouseMove), e.view.removeEventListener("mouseup", this.UnregisterDragEvents);
}
HideChat() {
this.SetChatHidden(!0);
}
ShowChat() {
this.SetChatHidden(!1);
}
SetChatHidden(e) {
(this.m_bChatHidden = e), this.forceUpdate();
}
ShowBroadcast() {
c.Ul.UIStore.SetFriendBroadcastVisible(this.m_friendSteamId, !0),
SetBackgroundTimeout(() => {
this.props.chatView.OnChatFrameChanged();
}, 30);
}
HideBroadcast() {
c.Ul.UIStore.SetFriendBroadcastVisible(this.m_friendSteamId, !1),
c.Ul.UIStore.SetTheaterMode(!1),
SetBackgroundTimeout(() => {
this.props.chatView.OnChatFrameChanged();
}, 30);
}
ToggleVerticalBroadcastChat() {
this.SetVerticalBroadcastChat(!this.ShouldShowVerticalBroadcastChat()), this.SetChatHidden(!1);
}
ToggleTheaterModeBroadcastChat() {
c.Ul.UIStore.SetTheaterMode(!c.Ul.UIStore.GetTheaterMode());
}
SetVerticalBroadcastChat(e) {
this.m_bShowVerticalBroadcastChat = e;
}
SetLocalBroadcastId(e) {
this.m_strLocalBroadcastId = e;
}
SetMainContentRef(e) {
(this.m_elMainContent = e), this.OnLayoutChange();
}
GetTitleBarDragDropProps() {
let e = { rgAcceptedTypes: [], bAcceptsFiles: !0 };
return (e.fnDrop = this.OnDrop), e;
}
GetChatBodyDragDropProps() {
let e = { rgAcceptedTypes: ["friend", "chatroomgroup", "clan", "text/plain"], bAcceptsFiles: !0 };
return (e.fnDragEnter = this.OnDragEnter), (e.fnDragLeave = this.OnDragLeave), (e.fnDragOver = this.OnDragOver), (e.fnDrop = this.OnDrop), e;
}
RenderInnerChatTabs() {
return h.createElement("div", { className: "ChatBodyControls" }, h.createElement("div", { className: "Close", onClick: this.HideChat, title: (0, O.Xx)("#Broadcast_View_HideChat") }, h.createElement(k.QlI, { showChat: !1 })), h.createElement(de, { chatView: this.props.chatView, additionalClasses: "broadcastVisible" }));
}
render() {
var e, t, n, i;
if (!this.props.chatView) return null;
let o = this.props.chatView.chat,
r = c.Ul.VoiceStore.BPartnerHasRequestedAndIsInOneOnOneChat(o.accountid_partner),
a = this.props.chatView.BVoiceActive(),
s = c.Ul.UIStore.IsFriendBroadcastVisible(this.m_friendSteamId),
l = o.GetShowNonFriendWarning();
const { dropToInviteFriend: m, dropGroupToInviteFriend: p, dropClanToInvite: _ } = this.state;
let g;
m ? (g = h.createElement(_e, { chatView: this.props.chatView, friend: this.state.dropToInviteFriend })) : (p || _) && (g = h.createElement(ge, { chatView: this.props.chatView, group: this.state.dropGroupToInviteFriend, clan: this.state.dropClanToInvite }));
let C = !1,
f = null,
v = this.ShouldShowVerticalBroadcastChat(),
S = this.m_bChatHidden;
if (s) {
const e = this.CalculateBroadcastSectionStyles(v);
(f = h.createElement(h.Suspense, { fallback: null }, h.createElement(te, { ref: this.m_refBroadcastContainer, steamID: W.K.InitFromAccountID(o.accountid_partner).ConvertTo64BitString(), localSteamID: this.m_strLocalBroadcastId, watchLocation: 12, bWebRTC: !0, onRequestClose: this.HideBroadcast, actions: [h.createElement("div", { key: "ChatPosToggle", onClick: this.ToggleVerticalBroadcastChat, title: `${v ? (0, O.Xx)("#Broadcast_View_Stack_H") : (0, O.Xx)("#Broadcast_View_Stack_V")}`, className: "BroadcastChatPositionToggle " + (v ? "right" : "bottom") })], style: e, onTheaterMode: this.ToggleTheaterModeBroadcastChat }), !S && h.createElement("div", { className: "BroadcastChatDivider " + (v ? "vertical" : "horizontal"), onMouseDown: this.OnGrabberMouseDown }), S && h.createElement(he, { onClick: this.ShowChat, edge: v ? "bottom" : "right" }))), (C = !0);
} else C = !1;
let b = {};
this.props.isActive || (b.display = "none");
const I = (0, L.Z)("chatWindow", "MultiUserChat", a && "VoiceActive", a && c.Ul.ChatStore.VoiceChat.IsMicMuted() && "MicMuted", r && "VoiceRequested", l && "NotAFriendOrApproved", c.Ul.SettingsStore.FriendsSettings.bCompactFriendsList && "compactView", C && "broadcastVisible"),
y = (0, L.Z)("chatBody", (m || p || _) && "chatRoomActiveDrop"),
E = this.m_bChatHidden && s ? null : h.createElement(Q._9.Consumer, null, (e) => h.createElement(P.$, { key: o.unique_id, chatView: this.props.chatView, isActive: this.props.isActive, disabled: !1, ownerWindow: e.ownerWindow }));
let D = h.createElement(
d.G,
Object.assign({ style: b, className: "chatHistoryAndMembers" }, this.GetChatBodyDragDropProps()),
h.createElement(H.Z, null, g),
h.createElement(
"div",
{ className: "displayColumn fullWidth" },
h.createElement(
B.s,
{ className: "displayRow minHeightZero", "flow-children": "row", navEntryPreferPosition: Z.c4.PREFERRED_CHILD },
l && h.createElement(pe, { chatView: this.props.chatView, friend: o.chat_partner }),
h.createElement("div", { className: "ChatRoomGroupDialog_history" }, c.Ul.UIStore.show_winter_sale_ui && !c.Ul.SettingsStore.FriendsSettings.bDisableRoomEffects && h.createElement(K.x, { effectManager: o.RoomEffectManager() }), h.createElement(j.w, { chatView: this.props.chatView, isActive: this.props.isActive, speakerLabelWidth: this.state.speakerLabelWidth, blockInteraction: l })),
!s && !(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) && h.createElement(de, { chatView: this.props.chatView, additionalClasses: void 0 }),
(null === (t = this.context) || void 0 === t ? void 0 : t.IN_GAMEPADUI) && h.createElement(B.s, { className: "RightSideButtonContainer", "flow-children": "column" }, h.createElement(le, { chatView: this.props.chatView, bSteamDeck: !0 }), !o.chat_partner.is_friend && h.createElement(J, { friend: o.chat_partner }), h.createElement(de, { chatView: this.props.chatView, additionalClasses: void 0 })),
h.createElement("div", { className: "dropTargetBox" }),
),
E,
),
),
w = "chatStack " + (v ? "displayRow" : "displayColumn") + " GroupChatVisible",
R = {};
return (
a && ((R.onSecondaryButton = () => o.ToggleVoiceChat()), (R.onSecondaryActionDescription = (0, O.Xx)("#Friend_Menu_StopVoiceChat"))),
h.createElement(
d.R,
Object.assign({ fnCanTakeFocus: () => this.props.isActive, "data-activechat": this.props.isActive, style: b, className: I }, this.GetTitleBarDragDropProps(), R),
h.createElement("div", { className: "chatHeader" }),
this.props.isActive && h.createElement(ee, { chatView: this.props.chatView, onNameWidthChanged: this.OnNameWidthChanged }),
h.createElement(H.Z, null, (a || r) && !(null === (n = this.context) || void 0 === n ? void 0 : n.IN_GAMEPADUI) && h.createElement(u.Z, { key: "OneOnOneVoiceHeader", classNames: "OneOnOneVoice-anim", timeout: 300 }, h.createElement("div", null, h.createElement(le, { chatView: this.props.chatView })))),
h.createElement("div", { className: "ChatRoomGroupDialog_contents" }, h.createElement("div", { className: "ChatRoomGroup_MainAndChatEntry displayColumn", ref: this.SetMainContentRef }, h.createElement("div", { className: "ChatRoomGroup_Main_ContentAndMembers displayRow" }, h.createElement("div", { className: `ChatRoomGroup_Main_Content ${v ? "Vertical" : "Horizontal"} ${S ? "chatHidden" : ""}` }, f, (!this.m_bChatHidden || !s) && h.createElement("div", { className: y }, (null === (i = this.context) || void 0 === i ? void 0 : i.IN_GAMEPADUI) && h.createElement(V.R, null), s && this.RenderInnerChatTabs(), h.createElement("div", { className: w }, D)))))),
)
);
}
};
function J(e) {
let { friend: t } = e;
const n = h.useCallback(
(e) => {
let n = (0, G.RA)(e);
c.Ul.FriendStore.SendFriendInvite(t).then((e) => {
let { eResult: i, eFriendRelationship: o } = e;
4 == o ? (0, S.zp)(n, (0, O.Xx)("#Friend_Menu_AddToFriendsList"), (0, O.Xx)("#Friend_InviteSent")) : 3 == o ? (0, S.zp)(n, (0, O.Xx)("#Friend_Menu_AddToFriendsList"), (0, O.Xx)("#Friend_MutualInviteSent", t.display_name)) : (0, U.u8)(n, i, o, t.display_name);
});
},
[t],
);
return h.createElement(B.s, { focusable: !0, className: "AddFriendButton", onActivate: n, onOKActionDescription: (0, O.Xx)("#Friend_Menu_AddToFriendsList") }, h.createElement(k.yBp, null));
}
(Y.contextType = o.E_),
(0, i.gn)([F.ak], Y.prototype, "OnDragEnter", null),
(0, i.gn)([F.ak], Y.prototype, "OnDragLeave", null),
(0, i.gn)([F.ak], Y.prototype, "OnDragOver", null),
(0, i.gn)([F.ak], Y.prototype, "OnDrop", null),
(0, i.gn)([F.ak], Y.prototype, "OnDropComplete", null),
(0, i.gn)([F.ak], Y.prototype, "OnNameWidthChanged", null),
(0, i.gn)([F.ak], Y.prototype, "ShouldShowVerticalBroadcastChat", null),
(0, i.gn)([F.ak], Y.prototype, "OnLayoutChange", null),
(0, i.gn)([F.ak], Y.prototype, "OnGrabberMouseDown", null),
(0, i.gn)([F.ak], Y.prototype, "HandleMouseMove", null),
(0, i.gn)([F.ak], Y.prototype, "UnregisterDragEvents", null),
(0, i.gn)([F.ak], Y.prototype, "HideChat", null),
(0, i.gn)([F.ak], Y.prototype, "ShowChat", null),
(0, i.gn)([F.ak], Y.prototype, "SetChatHidden", null),
(0, i.gn)([F.ak], Y.prototype, "ShowBroadcast", null),
(0, i.gn)([F.ak], Y.prototype, "HideBroadcast", null),
(0, i.gn)([F.ak], Y.prototype, "ToggleVerticalBroadcastChat", null),
(0, i.gn)([F.ak], Y.prototype, "ToggleTheaterModeBroadcastChat", null),
(0, i.gn)([F.ak], Y.prototype, "SetVerticalBroadcastChat", null),
(0, i.gn)([F.ak], Y.prototype, "SetLocalBroadcastId", null),
(0, i.gn)([F.ak], Y.prototype, "SetMainContentRef", null),
(Y = (0, i.gn)([I.Pi], Y));
let ee = class extends h.Component {
SpeakerLabel(e) {
e && this.props.onNameWidthChanged(e.clientWidth);
}
render() {
let e = this.props.chatView.chat,
t = c.Ul.SettingsStore.FriendsSettings.nChatFontSize,
n = "speakerLabelWidthContainer";
return t == z.Ao.k_EChatFontSizeSmall ? (n += " smallChatFont") : t == z.Ao.k_EChatFontSizeLarge && (n += " largeChatFont"), e.chat_partner.is_ready && e.self.is_ready ? h.createElement("div", { className: n, ref: this.SpeakerLabel }, h.createElement("div", { className: "nameWidthLabel" }, e.self.display_name + ":"), h.createElement("div", { className: "nameWidthLabel" }, e.chat_partner.display_name + ":")) : null;
}
};
(0, i.gn)([F.ak], ee.prototype, "SpeakerLabel", null), (ee = (0, i.gn)([I.Pi], ee));
const te = h.forwardRef(function ({ steamID: e, localSteamID: t, watchLocation: n, bWebRTC: i, style: o, onRequestClose: r, actions: a, onTheaterMode: s }, l) {
const c = t || e;
return h.createElement("div", { ref: l, style: Object.assign({ display: "flex", flexDirection: "column" }, o) }, h.createElement("div", { className: "BroadcastSection" }, h.createElement($, { key: c, steamIDBroadcast: c, watchLocation: n, bWebRTC: i, onRequestClose: r, actions: a, onTheaterMode: s, onOpenLinkInNewWindow: b.b8 }), h.createElement("div", { className: "videoContainerSizer" })), h.createElement(ne, { steamID: e }));
});
let ne = class extends h.Component {
OnClick(e, t) {
let n = (0, q.FG)(t, "friendbroadcast");
(0, b.b8)(e, n), e.stopPropagation();
}
render() {
let e = new W.K(this.props.steamID),
t = c.Ul.FriendStore.GetPlayer(e.GetAccountID()),
n = t.persona.GetCurrentGameIconURL(),
i = t.persona.GetCurrentGameName(),
o = t.persona.m_unGamePlayedAppID;
return i || n ? h.createElement("div", { className: "FriendChatBroadcastDetails" }, h.createElement("div", { className: "FriendChatBroadcastDetails_PlayingText" }, (0, O.Xx)("#broadcastDetails_Playing")), n && h.createElement("img", { className: "FriendChatBroadcastDetails_Icon", src: n }), h.createElement("div", { className: "FriendChatBroadcastDetails_GameName", onClick: (e) => this.OnClick(e, o) }, i)) : null;
}
};
(0, i.gn)([F.ak], ne.prototype, "OnClick", null), (ne = (0, i.gn)([I.Pi], ne));
var ie = n(46057),
oe = n(7098);
const re = h.lazy(() => Promise.all([n.e(5140), n.e(4679)]).then(n.bind(n, 38096)));
let ae = class extends h.Component {
constructor(e) {
super(e), (this.m_keyEventListener = "keydown"), (this.macUserAgentStrings = /(MacIntel|Macintosh|Mac OS X)/), (this.linuxUserAgentStrings = /(Linux|X11)/), (-1 == navigator.userAgent.search(this.macUserAgentStrings) && -1 == navigator.userAgent.search(this.linuxUserAgentStrings)) || (this.m_keyEventListener = "keyup"), this.props.popup && this.props.popup.addEventListener(this.m_keyEventListener, this.OnHTMLKeyEvent);
}
componentWillUnmount() {
this.props.popup && this.props.popup.removeEventListener(this.m_keyEventListener, this.OnHTMLKeyEvent);
}
OnCopy(e) {
let t = this.props.popup || window;
if (!t) return;
let n = t.getSelection();
if (0 == n.rangeCount) return;
let i = (0, w.bv)(n.getRangeAt(0));
void 0 !== i && ("Win32" == t.navigator.platform && (i = i.replace(/\n/g, "\r\n")), e.clipboardData.setData("text", i), e.preventDefault());
}
OnChatTabRef(e) {
this.m_refChatTabs = e;
}
OnDragEnter(e) {
if (((0, T.X)(e && ("chattab" == e.type || "friend" == e.type || "chatroomgroup" == e.type || "html" == e.type), "Invalid data type passed to MultiChatDialog.OnDragEnter", e.type), "chattab" == e.type)) {
let t = this.props.tabs,
n = e;
(n.tabSet != t || t.tabCount > 1) && (t.Focus(), this.m_refChatTabs && this.m_refChatTabs.GetDragTab() != n.tab && this.m_refChatTabs.SetDragTab(n.tab));
}
return !0;
}
OnDragLeave() {
this.m_refChatTabs && this.m_refChatTabs.SetDragTab(void 0);
}
OnDragOver(e) {
this.m_refChatTabs && this.m_refChatTabs.UpdateDragOffset(e);
}
OnDrop(e, t) {
if (((0, T.X)(e && ("chattab" == e.type || "friend" == e.type || "chatroomgroup" == e.type || "html" == e.type), "Invalid data type passed to MultiChatDialog.OnDrop", e.type), "chattab" == e.type)) {
let t = e,
n = -1;
this.m_refChatTabs && (n = this.m_refChatTabs.state.iDragIndex), m.g_FriendsUIDesktopApp.DragDropManager.SetDropConsumed(), t.tabSet != this.props.tabs && (t.tabSet.RemoveTab(t.tab), this.props.tabs.AddTab(t.tab), m.g_FriendsUIDesktopApp.DragDropManager.EndDrag()), -1 != n && this.props.tabs.MoveTabToIndex(t.tab, n), this.props.tabs.ActivateTab(t.tab), this.setState({ tabDrag: void 0 });
} else if ("friend" == e.type) {
m.g_FriendsUIDesktopApp.DragDropManager.SetDropConsumed(), e.friend.OpenChatDialog((0, m.Um)(this, t));
} else if ("chatroomgroup" == e.type) {
m.g_FriendsUIDesktopApp.DragDropManager.SetDropConsumed();
let t = e;
c.Ul.UIStore.ShowAndOrActivateChatRoomGroup((0, m.Um)(this), t.group, !0);
} else "html" == e.type && e.mapData.has("text/plain") && this.props.tabs.activeTab.GetChatView().SendChatMessage(e.mapData.get("text/plain"));
}
OnHTMLKeyEvent(e) {
if (o.De.IN_CLIENT && e.ctrlKey && !e.altKey) {
if ((!e.shiftKey && 9 == e.keyCode) || 34 == e.keyCode) this.props.tabs.ActivateNextTab();
else if (9 == e.keyCode || 33 == e.keyCode) this.props.tabs.ActivatePreviousTab();
else {
if ("W" != e.key && "w" != e.key) return;
this.props.tabs.RemoveTab(this.props.tabs.activeTab);
}
return e.preventDefault(), void e.stopPropagation();
}
}
OnKeyDown(e) {
let t = this.props.tabs.activeTab;
if (!t) return;
if (e.ctrlKey || e.altKey || e.metaKey || e.key.length > 1) return;
let n = e.target,
i = n && n.tagName ? n.tagName.toLowerCase() : "";
"input" != i && "select" != i && "textarea" != i && t.GetChatView().FocusTextInput();
}
render() {
var e;
let t = this.props.tabs.activeTab;
const n = null === (e = this.m_refChatTabs) || void 0 === e ? void 0 : e.GetDragTab();
n && (t = n);
let i = this.props.tabs.tabs.slice();
n && -1 == i.indexOf(n) && i.push(n), i.sort((e, t) => (e.GetUniqueID() < t.GetUniqueID() ? 1 : -1));
let o = i.map((e) => {
let n = null,
i = e instanceof a.we && e,
o = e.IsBroadcast();
return (n = i ? h.createElement(x.lp, { groupView: i, isActive: e == t, popup: this.props.popup }) : o ? h.createElement(re, { broadcastView: e, isActive: e == t, popup: this.props.popup }) : h.createElement(Y, { chatView: e.GetChatView(), isActive: e == t })), h.createElement(A.SV, { key: e.GetUniqueID() }, h.createElement(h.Suspense, { fallback: null }, n));
});
return h.createElement(d.R, { className: "multiChatDialog", rgAcceptedTypes: ["chattab", "friend", "chatroomgroup", "text/plain"], fnDragEnter: this.OnDragEnter, fnDragOver: this.OnDragOver, fnDragLeave: this.OnDragLeave, fnDrop: this.OnDrop, onKeyDown: this.OnKeyDown, onCopy: this.OnCopy }, h.createElement(N.Le, { tabSet: this.props.tabs, popup: this.props.popup, activeTab: t, ref: this.OnChatTabRef, ResponsiveWindowState: this.props.ResponsiveWindowState, showOpenFriendsList: this.props.showOpenFriendsList }), h.createElement(B.s, { className: "chatDialogs", onMoveUp: () => this.m_refChatTabs.FocusActiveTab() }, 0 == o.length && h.createElement("div", { className: "emptyChatDialogs" }, (0, O.Xx)("#Chat_EmptyDialogsWindowMsg")), o));
}
};
(0, i.gn)([F.ak], ae.prototype, "OnCopy", null), (0, i.gn)([F.ak], ae.prototype, "OnChatTabRef", null), (0, i.gn)([F.ak], ae.prototype, "OnDragEnter", null), (0, i.gn)([F.ak], ae.prototype, "OnDragLeave", null), (0, i.gn)([F.ak], ae.prototype, "OnDragOver", null), (0, i.gn)([F.ak], ae.prototype, "OnDrop", null), (0, i.gn)([F.ak], ae.prototype, "OnHTMLKeyEvent", null), (0, i.gn)([F.ak], ae.prototype, "OnKeyDown", null), (ae = (0, i.gn)([I.Pi], ae));
let se = class extends h.Component {
constructor(e) {
super(e);
}
OnChatTabRef(e) {
this.m_refChatTabs = e;
}
render() {
var e;
let t = this.props.tabs.activeTab;
const n = null === (e = this.m_refChatTabs) || void 0 === e ? void 0 : e.GetDragTab();
n && (t = n);
let i = this.props.tabs.tabs.slice();
n && -1 == i.indexOf(n) && i.push(n), i.sort((e, t) => (e.GetUniqueID() < t.GetUniqueID() ? 1 : -1));
let o = i.map((e) => {
let n = null,
i = e instanceof a.we && e,
o = e.IsBroadcast();
return (n = i ? h.createElement(x.lp, { groupView: i, isActive: e == t, popup: this.props.popup, bSteamDeck: !0 }) : o ? h.createElement(re, { broadcastView: e, isActive: e == t, popup: this.props.popup }) : h.createElement(Y, { chatView: e.GetChatView(), isActive: e == t })), h.createElement(A.SV, { key: e.GetUniqueID() }, h.createElement(h.Suspense, { fallback: null }, n));
});
return h.createElement(B.s, { className: "multiChatDialog GamepadMode" }, t && t.IsFriendChat() && h.createElement(N.lR, { tab: t, active: !0, selectTab: () => {} }), h.createElement(B.s, { className: "chatDialogs" }, 0 == o.length && h.createElement("div", { className: "emptyChatDialogs" }, (0, O.Xx)("#Chat_EmptyDialogsWindowGamePadUIMsg")), o));
}
};
(0, i.gn)([F.ak], se.prototype, "OnChatTabRef", null), (se = (0, i.gn)([I.Pi], se));
let le = class extends h.Component {
constructor(e) {
super(e);
}
InitiateVoiceChat() {
let e = this.props.chatView.chat.accountid_partner;
c.Ul.VoiceStore.InitiateFriendChat(e);
}
VoidOnClick() {}
EndVoiceChat() {
c.Ul.VoiceStore.GetActiveOneOnOneVoiceChatAccountID() == this.props.chatView.chat.accountid_partner && c.Ul.VoiceStore.OnUserEndVoiceChat();
}
OnCloseClick() {
c.Ul.VoiceStore.GetActiveOneOnOneVoiceChatAccountID() == this.props.chatView.chat.accountid_partner ? c.Ul.VoiceStore.OnUserEndVoiceChat() : c.Ul.VoiceStore.OnRejectOneOnOneVoiceChatForPartner(this.props.chatView.chat.accountid_partner);
}
RejectVoiceChatRequest() {
c.Ul.VoiceStore.OnRejectOneOnOneVoiceChatForPartner(this.props.chatView.chat.accountid_partner);
}
OnSettingsClick(e) {
c.Ul.IsDesktopUIActive() ? SteamClient.URL.ExecuteSteamURL("steam://open/settings/voice") : (0, oe.L)((0, m.Um)(this, e), e.currentTarget.ownerDocument.defaultView, "voice");
}
render() {
if (this.props.bSteamDeck) return this.renderSteamDeck();
let e,
t = c.Ul.VoiceStore.BInitiatedOneOnOneChat(this.props.chatView.chat.accountid_partner),
n = c.Ul.CMInterface.steamid.GetAccountID(),
i = this.props.chatView.chat.accountid_partner,
o = c.Ul.FriendStore.GetPlayer(n),
r = c.Ul.VoiceStore.BSelfHasAcceptedOrInitiatedOneOnOneChat(i),
a = c.Ul.VoiceStore.BSelfHadPreviouslyJoinedOneOnOneChat(i),
s = this.props.chatView.chat.chat_partner,
l = c.Ul.VoiceStore.BPartnerHasAcceptedOrInitiatedOneOnOneChat(i),
m = !r && c.Ul.VoiceStore.BPartnerHasRequestedAndIsInOneOnOneChat(s.accountid),
d = !1,
p = !1,
_ = !1;
c.Ul.VoiceStore.GetActiveOneOnOneVoiceChatAccountID() == i && ((d = c.Ul.VoiceStore.HasBeenAttemptingOverTwoSeconds() || c.Ul.VoiceStore.IsAttemptingReconnect()), (p = !c.Ul.VoiceStore.BIsAccountFullyConnectedToActiveVoiceChat(n) || c.Ul.VoiceStore.IsAttemptingReconnect()), (_ = !c.Ul.VoiceStore.BIsAccountFullyConnectedToActiveVoiceChat(i))),
(e = t || r ? h.createElement(u.Z, { key: n, classNames: "friend-anim", timeout: 320 }, h.createElement(ie.mo, { friend: o, key: n, showVoiceLevel: !0, context: { chat: this.props.chatView.chat }, listStatusIndicator: h.createElement("div", { className: "connectionSpinner" }) })) : h.createElement(u.Z, { key: n, classNames: "friend-anim", timeout: 320 }, h.createElement("div", { className: "friend emptyFriend", onClick: !r && this.InitiateVoiceChat }, h.createElement("div", { className: "avatarHolder" }, h.createElement("img", { className: "avatar", src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA", draggable: !1 })))));
let g,
C = [];
t && C.push(e),
l || m ? C.push(h.createElement(u.Z, { key: i, classNames: "friend-anim", timeout: 320 }, h.createElement(ie.mo, { friend: s, key: i, showVoiceLevel: !0, context: { chat: this.props.chatView.chat }, listStatusIndicator: h.createElement("div", { className: "connectionSpinner" }) }))) : C.push(h.createElement(u.Z, { key: i, classNames: "friend-anim", timeout: 320 }, h.createElement("div", { className: "friend emptyFriend", onClick: r ? this.VoidOnClick : this.InitiateVoiceChat }, h.createElement("div", { className: "avatarHolder " }, h.createElement("img", { className: "avatar", src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA", draggable: !1 }))))),
t || C.push(e),
(g = r && l ? h.createElement(E.wl, { className: "inviteButton inviteButtonJoinVoice", onClick: this.EndVoiceChat, onOKActionDescription: (0, O.Xx)("#Voice_StopTalking") }, (0, O.Xx)("#Voice_StopTalking")) : r && !l ? h.createElement(E.wl, { className: "inviteButton inviteButtonJoinVoice", onClick: this.EndVoiceChat, onOKActionDescription: (0, O.Xx)("#Voice_EndVoice") }, (0, O.Xx)("#Voice_EndVoice")) : h.createElement(E.wl, { className: "inviteButton inviteButtonJoinVoice", onClick: this.InitiateVoiceChat, onOKActionDescription: (0, O.Xx)("#Voice_StartTalking") }, (0, O.Xx)("#Voice_StartTalking")));
let f = "",
v = "OneOnOneVoiceRoomControls",
S = !1;
r && !l ? ((f = (0, O.Xx)("#Voice_WaitingForFriendToJoin", s.display_name)), (v += " WaitingForPartner")) : l && !r ? (a ? (f = (0, O.Xx)("#Voice_ChannelRejoinAvailable", s.display_name)) : ((f = (0, O.Xx)("#Voice_ChannelAvailable", s.display_name)), (v += " WaitingForYouFirstTime")), (v += " WaitingForYou")) : ((f = p ? (d ? h.createElement("a", { title: (0, O.Xx)("#VoiceChatConnectingHelp"), className: "connectionStatus", target: "_blank", href: "https://support.steampowered.com/kb_article.php?ref=2598-RTZB-6114" }, (0, O.Xx)("#VoiceChatConnecting")) : "") : !p && _ ? h.createElement("a", { title: (0, O.Xx)("#VoiceChatConnectingHelp"), className: "connectionStatus", target: "_blank", href: "https://support.steampowered.com/kb_article.php?ref=2598-RTZB-6114" }, (0, O.Xx)("#VoiceChatParterConnecting", s.display_name)) : (0, O.Xx)("#Voice_ChannelActive", s.display_name)), (v += " OneOnOneVoiceActive"), (S = !0));
let b = h.createElement("div", { className: "OneOnOneVoiceStatusLabel" }, f),
I = r ? (0, O.Xx)("#Voice_EndVoice") : (0, O.Xx)("#Voice_Decline");
return h.createElement(B.s, { className: v, "flow-children": "row", focusable: !1 }, h.createElement("div", { className: "VoiceToggleIconCtn friendSettingsButton no-drag", onClick: this.OnSettingsClick, title: (0, O.Xx)("#Tooltip_VoiceSettings") }, h.createElement(k.Zrf, null)), h.createElement("div", { className: "OneOnOneVoiceMembers" }, g, !S && !r && h.createElement(E.wl, { className: "inviteButton inviteButtonDeclineVoice", onClick: this.OnCloseClick, onOKActionDescription: I }, I), h.createElement(B.s, { fnCanTakeFocus: () => !1, style: { display: "flex" } }, C), b), !S && h.createElement(B.s, { className: "OneOnOneVoiceClose", focusable: !0, onActivate: this.OnCloseClick, onOKActionDescription: I, title: I }, h.createElement(k.pVO, null)));
}
renderSteamDeck() {
let e = this.props.chatView.chat.accountid_partner,
t = c.Ul.VoiceStore.BSelfHasAcceptedOrInitiatedOneOnOneChat(e),
n = c.Ul.VoiceStore.BSelfHadPreviouslyJoinedOneOnOneChat(e),
i = c.Ul.VoiceStore.BPartnerHasRequestedAndIsInOneOnOneChat(e),
o = this.props.chatView.chat.BIsVoiceAllowed(),
r = "oneOnOneVoiceChatButton",
a = null,
s = { onSecondaryButton: null, onSecondaryActionDescription: null };
if (t && i) (a = h.createElement(k.eNM, null)), (s.onActivate = this.EndVoiceChat), (s.onOKActionDescription = (0, O.Xx)("#Voice_StopTalking"));
else if (t && !i) (a = h.createElement(k.eNM, null)), (s.onActivate = this.EndVoiceChat), (s.onOKActionDescription = (0, O.Xx)("#Voice_EndVoice"));
else if (i && !t && n) (a = h.createElement(k.Yx0, null)), (s.onActivate = this.InitiateVoiceChat), (s.onOKActionDescription = (0, O.Xx)("#Voice_StartTalking")), (s.onSecondaryButton = this.RejectVoiceChatRequest), (s.onSecondaryActionDescription = (0, O.Xx)("#Voice_DeclineVoiceChat"));
else if (i) (a = h.createElement("div", { className: "WaitingForYouFirstTime" }, h.createElement(k.NBO, null), h.createElement("div", { className: "Sonar" }, h.createElement("div", { className: "SonarCircle" })))), (s.onActivate = this.InitiateVoiceChat), (s.onOKActionDescription = (0, O.Xx)("#Voice_StartTalking")), (s.onSecondaryButton = this.RejectVoiceChatRequest), (s.onSecondaryActionDescription = (0, O.Xx)("#Voice_DeclineVoiceChat"));
else {
if (!o) return null;
(r += " NotInVoiceChat"), (a = h.createElement(k.Cq4, null)), (s.onActivate = this.InitiateVoiceChat), (s.onOKActionDescription = (0, O.Xx)("#Voice_StartChat"));
}
return h.createElement(B.s, Object.assign({ className: r, focusable: !0 }, s), a);
}
};
function ce(e, t, n) {
let i,
o = !1,
l = !0;
if (e.invitedto instanceof s.Xp) i = 300;
else if (e.invitedto instanceof a.PR) {
i = 340;
let t = e.invitedto;
t.BCanInvite() || t.BHasMember(e.invitee.accountid) || (l = !1);
} else if (e.invitedto instanceof r.K) {
(o = !0), (i = 340);
let t = e.invitedto.GetGroup();
t.BCanInvite() || t.BHasMember(e.invitee.accountid) || (l = !1);
}
l ? (0, M.BR)(h.createElement(me, Object.assign({}, e)), n, "InviteDialog", { strTitle: o ? (0, O.Xx)("#Chat_Actions_InviteFriend_VoiceChat") : (0, O.Xx)("#Chat_Actions_DropGroupInvite_Title"), popupWidth: 650, popupHeight: i }, (0, m.Og)(n)) : (0, S.zp)(n, (0, O.Xx)("#Chat_Actions_DropGroupInvite_Denied"), (0, O.Xx)("#Chat_Actions_DropGroupInvite_Denied_Description"));
}
(0, i.gn)([F.ak], le.prototype, "InitiateVoiceChat", null), (0, i.gn)([F.ak], le.prototype, "VoidOnClick", null), (0, i.gn)([F.ak], le.prototype, "EndVoiceChat", null), (0, i.gn)([F.ak], le.prototype, "OnCloseClick", null), (0, i.gn)([F.ak], le.prototype, "RejectVoiceChatRequest", null), (0, i.gn)([F.ak], le.prototype, "OnSettingsClick", null), (le = (0, i.gn)([I.Pi], le));
let me = class extends h.Component {
constructor(e) {
super(e), (this.invitee = this.props.invitee);
}
AddMoreFriends(e) {
let t = [],
n = e.currentTarget.ownerDocument.defaultView;
t.push(this.invitee.accountid), this.props.invitedto instanceof s.Xp ? (0, v.bI)((0, m.Um)(this, e), n, this.props.chatview, !0, t) : this.props.invitedto instanceof a.PR ? (0, f.oC)((0, m.Um)(this, e), n, this.props.invitedto, void 0, !0, t) : this.props.invitedto instanceof r.K && (0, f.hg)((0, m.Um)(this, e), n, this.props.invitedto.GetGroup(), this.props.invitedto, t), this.props.closeModal();
}
Cancel() {
this.props.closeModal();
}
componentDidMount() {
let e = y.findDOMNode(this);
if (e) {
let t = e.querySelector("button[type=submit]");
t && t.focus();
}
}
OnInviteClicked(e) {
let t = e.currentTarget.ownerDocument.defaultView;
if (this.props.invitedto instanceof s.Xp) {
this.invitedToPlayer = this.props.invitedto;
let e = [];
e.push(this.invitedToPlayer.persona.m_steamid.ConvertTo64BitString()), e.push(this.invitee.persona.m_steamid.ConvertTo64BitString()), (0, v.l8)(t, this.props.chatview, e);
} else if (this.props.invitedto instanceof a.PR) (this.invitedToGroup = this.props.invitedto), this.invitedToGroup.InviteFriend(this.invitee.accountid);
else if (this.props.invitedto instanceof r.K) {
[].push(this.invitee.accountid), (this.invitedToChatRoom = this.props.invitedto), this.invitedToChatRoom.GetGroup().InviteFriend(this.invitee.accountid, this.invitedToChatRoom);
}
this.props.closeModal();
}
render() {
let e,
t,
n,
i = this.props.invitee,
o = c.Ul.FriendStore.self,
l = !1;
this.props.invitedto instanceof s.Xp ? (e = this.props.invitedto) : this.props.invitedto instanceof a.PR ? (t = this.props.invitedto) : this.props.invitedto instanceof r.K && (n = this.props.invitedto);
let m,
d,
u = "#Chat_Actions_DropGroupInvite_Confirm",
p = !1;
return (
t ? (t.BIsUserGroupMember(i) && (u = "#Chat_Actions_DropGroupInvite_Member_Confirm"), (l = !!t.BIsClanChatRoom() && c.Ul.FriendStore.ClanStore.GetClan(t.GetClanID()).BIsOGG()), (m = t.name), (d = h.createElement(C._P, { group: t, name: t.name })), (p = t.BIsUserGroupMember(i))) : e ? ((u = "#Chat_Actions_DropGroupInvite_1v2_Confirm"), (m = e.display_name), (d = h.createElement("div", { className: "displayRow" }, h.createElement("div", { className: "dropGroupInviteDialog_Friend" }, h.createElement("img", { src: o.persona.avatar_url_medium })), h.createElement("div", { className: "dropGroupInviteDialog_Friend" }, h.createElement("img", { src: e.persona.avatar_url_medium }))))) : n && ((u = "#Chat_Actions_DropVoiceInvite_Confirm"), (m = n.name), (d = h.createElement("div", { className: "displayRow" }, h.createElement(k.Cq4, null)))),
h.createElement(
M.e1,
{ onEscKeypress: this.Cancel },
h.createElement(
R.oX,
{ classNameContent: "GenericConfirmDialog", onSubmit: this.OnInviteClicked, bCenterVertically: !0 },
h.createElement(R.h4, null, n ? (0, O.Xx)("#Chat_Actions_InviteFriend_VoiceChat") : (0, O.Xx)("#Chat_Actions_DropGroupInvite_Title")),
h.createElement(
R.uT,
null,
h.createElement("div", { className: "dropGroupInviteDialog displayColumn" + (t || n ? " groupInviteHeight" : "") }, h.createElement("span", { className: "dropGroupInviteDialog_Desc" }, (0, O.kQ)(u, h.createElement("span", { className: "highlight" }, i.display_name), h.createElement("span", { className: "highlight" }, m), e && h.createElement("span", { className: "highlight" }, (0, O.Xx)("#Chat_You")))), h.createElement("div", { className: "dropGroupInviteDialog_Graphic" + (l ? " isOGGGroup" : "") }, h.createElement("div", { className: "dropGroupInviteDialog_Friend" }, h.createElement("img", { src: i.persona.avatar_url_medium })), h.createElement("div", { className: "movingArrow" }, h.createElement(k.Ehc, { angle: 90 })), d, h.createElement("div", { className: "addMoreFriendsButton", onClick: this.AddMoreFriends }, h.createElement("div", null, (0, O.Xx)("#Chat_Actions_AddMoreFriends")), h.createElement("div", { className: "ExpandArrow" })))),
),
h.createElement(R.$_, null, h.createElement(R.Uq, null, h.createElement(R.KM, { onClick: this.OnInviteClicked }, p ? (0, O.Xx)("#Chat_SendLink") : (0, O.Xx)("#Chat_Invite"), " "), h.createElement(R.zx, { onClick: this.Cancel }, (0, O.Xx)("#Button_Cancel")))),
),
)
);
}
};
(0, i.gn)([F.ak], me.prototype, "AddMoreFriends", null), (0, i.gn)([F.ak], me.prototype, "Cancel", null), (0, i.gn)([F.ak], me.prototype, "OnInviteClicked", null), (me = (0, i.gn)([I.Pi], me));
let de = class extends h.Component {
AddFriendClick(e) {
this.ContinueCreateChat((0, m.Um)(this, e), (0, G.RA)(e));
}
ContinueCreateChat(e, t) {
(0, v.bI)(e, t, this.props.chatView, !0);
}
render() {
this.props.chatView.chat.chat_partner;
let e = "inviteAnotherFriendButton";
return this.props.additionalClasses && (e += " " + this.props.additionalClasses), h.createElement(B.s, { title: (0, O.Xx)("#Chat_AddFriend_Hint"), className: e, onActivate: this.AddFriendClick, onOKActionDescription: (0, O.Xx)("#Chat_CreateChatRoom_InviteFriendsToChat") }, h.createElement(k.Kon, null));
}
};
(0, i.gn)([F.ak], de.prototype, "AddFriendClick", null), (de = (0, i.gn)([I.Pi], de));
const he = ({ onClick: e, edge: t }) => h.createElement("div", { className: (0, L.Z)("BroadcastChatExpander", t), onClick: e, title: (0, O.Xx)("#Broadcast_View_ShowChat") }, h.createElement(k.QlI, { showChat: !0 }));
let ue = class extends h.Component {
OnTextChannelCloseClick(e) {
this.props.groupView.ClosePopoverChat();
}
OnChatHistoryRef(e) {
e && e.Focus();
}
render() {
let e = this.props.groupView.GetPopoverChatView();
return e ? h.createElement(u.Z, { key: "quickChat", classNames: "chatWindow-anim", timeout: 320 }, h.createElement("div", { className: "VoiceRoomChatHistory" }, h.createElement("div", { className: "VoiceRoomChatWindow" }, h.createElement("div", { className: "VoiceRoomChatTitle" }, h.createElement("div", { className: "VoiceRoomTitleLabels" }, h.createElement("div", { className: "VoiceChatTextChannelName" }, (0, O.Xx)("#Chat_Scratch_Pad"))), h.createElement("div", { className: "MinimizeTextChat", onClick: this.OnTextChannelCloseClick }, h.createElement(k.pVO, null))), h.createElement("div", { className: "VoiceChatTextChannelDesc" }, (0, O.Xx)("#Chat_Scratch_Pad_Desc")), h.createElement(j.w, { chatView: e, isActive: !0, ref: this.OnChatHistoryRef })))) : null;
}
};
(0, i.gn)([F.ak], ue.prototype, "OnTextChannelCloseClick", null), (0, i.gn)([F.ak], ue.prototype, "OnChatHistoryRef", null), (ue = (0, i.gn)([I.Pi], ue));
let pe = class extends h.Component {
constructor(e) {
super(e);
}
OnBlock() {
c.Ul.FriendStore.BlockPlayer(this.props.friend, !1), c.Ul.UIStore.CloseTabByID(this.props.chatView.GetUniqueID());
}
OnAllow() {
c.Ul.FriendStore.SetApprovedNonFriendMessages(this.props.friend.accountid);
}
render() {
return h.createElement("div", { className: "NotAFriendMessage" }, h.createElement("div", { className: "NotAFriendBody" }, h.createElement("div", { className: "Exclamation" }, h.createElement(k.ge, null)), h.createElement("div", { className: "Explanation" }, h.createElement("div", { className: "ExplanationHeader" }, (0, O.Xx)("#DirectMessageFromNonFriend")), h.createElement("div", { className: "ExplanationBody" }, (0, O.Xx)("#DirectMessageFromNonFriendNote")), h.createElement(b.ns, { href: "https://support.steampowered.com/kb_article.php?ref=1266-OAFV-8478", className: "ExplanationMoreInfo" }, (0, O.Xx)("#Generic_More_Info"))), h.createElement("div", { className: "Buttons" }, h.createElement("button", { className: "NotAFriendActionButton", onClick: this.OnBlock }, (0, O.Xx)("#NonFriendAction_Block")), h.createElement("button", { className: "NotAFriendActionButton", onClick: this.OnAllow }, (0, O.Xx)("#NonFriendAction_Allow")))));
}
};
(0, i.gn)([F.ak], pe.prototype, "OnBlock", null), (0, i.gn)([F.ak], pe.prototype, "OnAllow", null), (pe = (0, i.gn)([I.Pi], pe));
let _e = class extends h.Component {
render() {
const e = this.props,
{ chatView: t, friend: n } = e,
o = (0, i._T)(e, ["chatView", "friend"]),
a = t.chat instanceof r.K;
return h.createElement(g, Object.assign({ message: a ? (0, O.Xx)("#Chat_DropToInviteGroup") : (0, O.Xx)("#Chat_DropToInvite"), name: n.display_name, renderImage: () => h.createElement(D.vV, { size: "Large", persona: n.persona }) }, o));
}
};
_e = (0, i.gn)([I.Pi], _e);
let ge = class extends h.Component {
render() {
const e = this.props,
{ chatView: t, group: n, clan: o } = e,
r = (0, i._T)(e, ["chatView", "group", "clan"]);
if (!n && !o) return (0, T.X)(!1, "Either a group or clan must be passed to DropGroupToInviteFriendMessage."), null;
const a = (n || o).name;
return h.createElement(g, Object.assign({ message: (0, O.Xx)("#Chat_DropGroupToInviteFriend"), name: a, renderImage: () => (o ? h.createElement(C.hV, { clan: o, size: "large" }) : h.createElement(C._P, { group: n, large: !0 })) }, r));
}
};
ge = (0, i.gn)([I.Pi], ge);
let Ce = class extends h.Component {
render() {
let e = !1;
if (!(this.props.chatView.chat instanceof l.a)) return null;
let t = this.props.chatView.chat;
return t.is_friend_typing && (e = !0), h.createElement("div", { className: "FriendChatTypingNotification" + (e ? " FriendIsTyping" : "") }, (0, O.Xx)("#Friend_Chat_Typing", t.chat_partner.display_name));
}
};
Ce = (0, i.gn)([I.Pi], Ce);
},
3276: (e, t, n) => {
"use strict";
n.d(t, { $: () => ne });
var i = n(85556),
o = n(14206),
r = n.n(o),
a = n(19953),
s = n(46962),
l = n(84446),
c = n(23346),
m = n(19339),
d = n(72746),
h = n(37234),
u = n(50649),
p = n(27378),
_ = n(2049),
g = n(16518),
C = n(11259),
f = n(84290);
let v = class extends p.Component {
render() {
const { fileUploadManager: e } = this.props;
let t = e.file_upload_props.eUploadState;
return 1 == t ? p.createElement(S, { fileUploadManager: e }) : 3 == t || 5 == t || 4 == t ? p.createElement(I, { fileUploadManager: e }) : 0 != t ? p.createElement(b, { fileUploadManager: e }) : null;
}
};
v = (0, i.gn)([u.Pi], v);
class S extends p.Component {
constructor(e) {
super(e), (this.state = { bSpoilerChecked: !1 });
}
OnCancelClick(e) {
this.props.fileUploadManager.Reset();
}
OnUploadClick() {
return (0, i.mG)(this, void 0, void 0, function* () {
yield this.props.fileUploadManager.BeginFileUpload({ bSpoiler: this.state.bSpoilerChecked }), this.props.fileUploadManager.Reset();
});
}
OnDialogChecked() {
this.setState({ bSpoilerChecked: !this.state.bSpoilerChecked });
}
render() {
let e,
t = this.props.fileUploadManager.file;
return -1 != t.type.indexOf("image") ? (e = p.createElement("img", { className: "chatFileUploadPreview", src: this.props.fileUploadManager.file_upload_data_url })) : -1 != t.type.indexOf("video") && (e = p.createElement(g.nkn, null)), p.createElement("div", { className: "chatFileUploadPreviewContainer" }, e, p.createElement("div", { className: "chatFileUploadFileName" }, "'", t.name, "'"), p.createElement("div", { className: "chatFileUploadCancel", onClick: this.OnCancelClick }, p.createElement(g.pVO, null)), p.createElement("button", { className: "DialogButton Primary chatFileUploadBtn", type: "button", onClick: this.OnUploadClick }, (0, f.Xx)("#Chat_Upload")), p.createElement(C.ji, { className: "spoilerCheckBox", label: (0, f.Xx)("#ChatEntry_TagAsSpoiler"), checked: this.state.bSpoilerChecked, onChange: this.OnDialogChecked }));
}
}
(0, i.gn)([_.ak], S.prototype, "OnCancelClick", null), (0, i.gn)([_.ak], S.prototype, "OnUploadClick", null), (0, i.gn)([_.ak], S.prototype, "OnDialogChecked", null);
let b = class extends p.Component {
render() {
let e = this.props.fileUploadManager.file_upload_props,
t = e.file ? (0, f.Xx)("#Chat_Uploading", e.displayFileName) : "",
n = { width: e.uploadProgress + "%" };
return p.createElement("div", { className: "chatFileUploadProgressContainer" }, p.createElement("div", { className: "chatFileUploadProgressName" }, t), p.createElement("div", { className: "chatFileUploadProgressBarContainer DialogProgressBar_ProgressBarContainer" }, p.createElement("div", { className: "DialogProgressBar_Value", style: n })));
}
};
b = (0, i.gn)([u.Pi], b);
let I = class extends p.Component {
ClearErrorState() {
this.props.fileUploadManager.ClearFileUploadError();
}
OnRetryClick() {
return (0, i.mG)(this, void 0, void 0, function* () {
yield this.props.fileUploadManager.RetryFileUpload(), this.props.fileUploadManager.Reset();
});
}
render() {
let e,
t = this.props.fileUploadManager.file_upload_props,
n = t.displayFileName ? (0, f.Xx)("#Chat_Uploading", t.displayFileName) : "",
i = t.strErrorDescription || (0, f.Xx)("#Chat_Settings_Error_Unknown");
return 3 == t.eUploadState && (e = p.createElement(C.KM, { onClick: this.OnRetryClick }, (0, f.Xx)("#Chat_Upload_ErrorAction_Retry"))), p.createElement("div", { className: "chatFileUploadProgressContainer" }, p.createElement("div", { className: "chatFileUploadProgressName" }, n), p.createElement("div", { className: "chatFileUploadErrorDescription" }, i), p.createElement("div", { className: "chatFileUploadActions" }, p.createElement(C.Uq, { className: "DialogLayout_NoMinWidth" }, e, p.createElement(C.zx, { onClick: this.ClearErrorState }, (0, f.Xx)("#Chat_Upload_ErrorAction_Close")))));
}
};
(0, i.gn)([_.ak], I.prototype, "ClearErrorState", null), (0, i.gn)([_.ak], I.prototype, "OnRetryClick", null), (I = (0, i.gn)([u.Pi], I));
var y = n(97224),
E = n(31542),
D = n(11612),
w = n(82909),
R = n(56320),
A = n(83817),
M = n(37153),
k = n(2204),
T = n.n(k),
L = n(61963),
G = n(40643),
O = n(51579),
F = n(79588),
B = n(87805),
x = n.n(B),
N = n(87018);
class P extends p.Component {
constructor(e) {
super(e),
(this.m_rgCurrentMatches = []),
(this.m_mapMatchByKey = new Map()),
(this.m_hMobxSearchDisposer = (0, F.EH)(() =>
(0, i.mG)(this, void 0, void 0, function* () {
yield this.UpdateSearchResults(this.props.strSearch), this.forceUpdate();
}),
)),
(this.state = { selectedIndex: void 0 });
}
OnKeyDown(e) {
this.BHandleKeyPress(e.keyCode) && e.preventDefault();
}
BHandleKeyPress(e) {
switch (e) {
case 38:
this.SetSelectedIndexDelta(-1);
break;
case 40:
this.SetSelectedIndexDelta(1);
break;
case 36:
this.SetSelectedIndex(0);
break;
case 33:
this.SetSelectedIndexDelta(-this.GetPageSize());
break;
case 35:
this.SetSelectedIndex(-1);
break;
case 34:
this.SetSelectedIndexDelta(this.GetPageSize());
break;
case 13:
case 9:
if (void 0 === this.state.selectedIndex) return this.props.onSuggestionSelected(this.props.strSearch), !1;
this.ChooseSuggestion(this.m_rgCurrentMatches[this.state.selectedIndex]);
break;
case 27:
this.props.onSuggestionSelected(this.props.strSearch);
break;
default:
return !1;
}
return !0;
}
GetPageSize() {
let e = E.findDOMNode(this),
t = e && e.firstElementChild,
n = this.m_rgCurrentMatches.length;
if ((n > this.getMaxMatches() && (n = this.getMaxMatches()), t && n)) {
let e = t.scrollHeight / n,
i = t.clientHeight / e;
return Math.max(1, Math.floor(i));
}
return 5;
}
ChooseSuggestion(e) {
this.props.onSuggestionSelected(this.props.strSearch, e ? this.getSelection(e) : void 0);
}
SetSelectedIndexDelta(e) {
void 0 !== this.state.selectedIndex ? this.SetSelectedIndex(this.state.selectedIndex + e) : this.SetSelectedIndex(1 === e ? 0 : e);
}
SetSelectedIndex(e) {
if (!this.m_rgCurrentMatches.length) return;
let t = this.m_rgCurrentMatches.length;
t > this.getMaxMatches() && (t = this.getMaxMatches()), (e %= t) < 0 && (e += t), this.setState({ selectedIndex: e });
}
FindKeyIndex(e) {
if (!this.m_mapMatchByKey.size && this.m_rgCurrentMatches.length) for (let e = 0; e < this.m_rgCurrentMatches.length; e++) this.m_mapMatchByKey.set(this.getKey(this.m_rgCurrentMatches[e]), e);
return this.m_mapMatchByKey.get(e);
}
OnClickSuggestion(e) {
let t = this.FindKeyIndex(e);
void 0 !== t && this.ChooseSuggestion(this.m_rgCurrentMatches[t]);
}
OnMouseOverSuggestion(e) {
let t = this.FindKeyIndex(e);
void 0 !== t && this.SetSelectedIndex(t);
}
BindSelectedElement(e) {
let t = E.findDOMNode(this),
n = E.findDOMNode(e),
i = t && t.firstElementChild;
n && i && (i.scrollTop + i.clientHeight < n.offsetTop || n.offsetTop < i.scrollTop) && n.scrollIntoView();
}
UpdateSearchResults(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
(this.m_rgCurrentMatches = yield this.performSearch(e)), (this.m_strLastSearch = e), this.m_mapMatchByKey.clear(), this.m_rgCurrentMatches.length ? (this.state && void 0 !== this.state.selectedIndex ? this.state.selectedIndex >= this.m_rgCurrentMatches.length && this.setState({ selectedIndex: 0 }) : (void 0 === this.props.nMinimumSearchLengthBeforeAutoSelection || e.length >= this.props.nMinimumSearchLengthBeforeAutoSelection) && this.setState({ selectedIndex: 0 })) : this.state && void 0 !== this.state.selectedIndex && this.setState({ selectedIndex: void 0 });
});
}
componentWillUnmount() {
this.m_hMobxSearchDisposer && (this.m_hMobxSearchDisposer(), (this.m_hMobxSearchDisposer = void 0));
}
componentDidUpdate(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
this.m_strLastSearch != this.props.strSearch && (yield this.UpdateSearchResults(this.props.strSearch), this.forceUpdate());
});
}
render() {
let e = [];
if (this.m_rgCurrentMatches.length) {
let t = this.getMaxMatches();
for (let n = 0; n < Math.min(t, this.m_rgCurrentMatches.length); n++) {
let t = this.m_rgCurrentMatches[n],
i = this.getKey(t),
o = n === this.state.selectedIndex;
e.push(p.createElement(U, { key: i, matchKey: i, fnOnClick: this.OnClickSuggestion, fnOnMouseOver: this.OnMouseOverSuggestion, bIsSelected: o, ref: o ? this.BindSelectedElement : void 0 }, this.renderMatch(t)));
}
this.m_rgCurrentMatches.length > t && e.push(this.renderTooManyMatchesMessage(this.m_rgCurrentMatches.length - t));
} else {
let t = this.renderNoMatchMessage();
if (!t) return null;
e.push(t);
}
return p.createElement("div", { className: x().mentionDialogPosition }, p.createElement("div", { className: x().mentionDialog, tabIndex: 0, onKeyDown: this.OnKeyDown }, this.renderHeader(), e));
}
}
(0, i.gn)([_.ak], P.prototype, "OnKeyDown", null), (0, i.gn)([_.ak], P.prototype, "OnClickSuggestion", null), (0, i.gn)([_.ak], P.prototype, "OnMouseOverSuggestion", null), (0, i.gn)([_.ak], P.prototype, "BindSelectedElement", null);
class U extends p.PureComponent {
OnMouseOver(e) {
this.props.fnOnMouseOver(this.props.matchKey);
}
OnClick(e) {
this.props.fnOnClick(this.props.matchKey);
}
render() {
return p.createElement("div", { className: (0, N.Z)(x().suggestOption, x().mentionSearchOption, this.props.bIsSelected ? x().selected : ""), onMouseEnter: this.OnMouseOver, onClick: this.OnClick }, this.props.children);
}
}
(0, i.gn)([_.ak], U.prototype, "OnMouseOver", null), (0, i.gn)([_.ak], U.prototype, "OnClick", null);
const V = P;
var H = n(95762),
W = n.n(H);
const X = class extends V {
performSearch(e) {
return this.props.emoticonStore.SearchEmoticons(e, 10, !1);
}
getSelection(e) {
return e.name;
}
getKey(e) {
return e.name;
}
renderMatch(e) {
return p.createElement("div", { className: (0, N.Z)(W().EmoticonSuggestion, e.recent ? "Recent" : "") }, p.createElement("div", { className: W().Emoticon }, p.createElement(O.tk, { emoticon: e.name, emoticonHoverStore: this.props.emoticonHoverStore }), e.new && p.createElement(O.D3, null)), ":", e.name, ":");
}
renderNoMatchMessage() {
return null;
}
renderTooManyMatchesMessage(e) {
return null;
}
renderHeader() {
return null;
}
getMaxMatches() {
return Number.MAX_VALUE;
}
};
var j = n(88669),
z = n(21298),
K = n(7098),
q = n(46057),
Z = n(68816),
Q = n(31360),
$ = n(10553),
Y = n(37232),
J = n(62860);
const ee = function (e) {
return p.createElement(p.Fragment, null);
};
function te(e) {
return p.createElement(p.Suspense, { fallback: null }, p.createElement(ee, Object.assign({}, e)));
}
let ne = class extends p.Component {
constructor() {
super(...arguments), (this.m_navRef = (0, R.Hy)()), (this.m_refTextInput = p.createRef()), (this.m_refFileInput = p.createRef()), (this.m_textFocusCallback = null), (this.m_nChatEntryInitialHeight = void 0), (this.m_iSizeChatEntryInterval = void 0), (this.state = { messageInput: "", submitEnabled: !1, mentionSearch: void 0, activeSuggestSearchType: void 0 });
}
BindMentionDialog(e) {
this.m_MentionDialog = e;
}
SetMessageInput(e, t) {
this.setState({ messageInput: e, submitEnabled: e.trim().length > 0 }, t), (this.props.chatView.text_entry = e), e && e.length && this.props.chatView.chat.OnTyping();
}
OnSubmit(e) {
e && e.preventDefault(), this.props.chatView && this.props.chatView.file_upload_manager.file && this.props.chatView.UploadFile(), this.state.messageInput.trim().length && this.props.chatView && (this.props.chatView.SendChatMessage(this.state.messageInput), (this.m_iMentionSearchCancelledOffset = void 0), this.ClearMentionSearchState(), this.setState({ submitEnabled: !1 }), this.SetMessageInput(""), (this.props.chatView.is_scrolled_to_bottom = !0), this.FocusTextInput()), this.SizeChatEntry(this.m_refTextInput.current, !0);
}
OnTextAreaChange(e) {
e.persist(),
this.m_iSizeChatEntryInterval ||
(this.m_iSizeChatEntryInterval = window.setTimeout(() => {
(this.m_iSizeChatEntryInterval = 0), this.SizeChatEntry(e.currentTarget);
}, 1e3)),
this.SetMessageInput(e.target.value);
}
SizeChatEntry(e, t) {
if (!e) return;
let n = d.Ul.SettingsStore.FriendsSettings.bCompactFriendsList ? 12 : 0;
e.style.height = "inherit";
let i = window.getComputedStyle(e),
o = parseInt(i.getPropertyValue("border-top-width"), 10) + parseInt(i.getPropertyValue("padding-top"), 10) + parseInt(i.getPropertyValue("padding-bottom"), 10) + parseInt(i.getPropertyValue("border-bottom-width"), 10);
null == this.m_nChatEntryInitialHeight && (this.m_nChatEntryInitialHeight = e.clientHeight - o - n + "px");
let r = e.scrollHeight - o - n;
t ? ((e.style.height = this.m_nChatEntryInitialHeight), (this.m_nChatEntryInitialHeight = void 0)) : (e.style.height = Math.min(120, r) + "px");
}
OnFocus(e) {
this.UpdateMentionSearchState();
}
OnBlur(e) {
if (!e.relatedTarget || !j.ni(E.findDOMNode(this), e.relatedTarget)) {
if ((0, L.BY)()) return;
(this.m_iMentionSearchCancelledOffset = void 0), this.ClearMentionSearchState();
}
}
OnKeyDown(e) {
if (this.state.activeSuggestSearchType && this.m_MentionDialog && !e.shiftKey && !e.ctrlKey && this.m_MentionDialog.BHandleKeyPress(e.keyCode)) return e.preventDefault(), void e.stopPropagation();
8 == e.keyCode || 46 == e.keyCode ? (this.m_iMentionSearchCancelledOffset = void 0) : 13 != e.keyCode || e.shiftKey || e.ctrlKey ? 13 == e.keyCode && e.ctrlKey && (e.preventDefault(), e.stopPropagation(), this.InsertAtCursor("\n")) : (e.preventDefault(), e.stopPropagation(), this.OnSubmit());
}
OnPaste(e) {
let t = j.bI(e);
t && (this.props.chatView.SetFileToUpload(t), e.preventDefault(), e.stopPropagation());
}
OnFileInputChange(e) {
let t = e.currentTarget;
t.files.length && (this.props.chatView.SetFileToUpload(t.files[0]), (t.value = ""));
}
OnEmbedClick(e) {
(0, w.yV)(p.createElement(se, { chatView: this.props.chatView, refFileInput: this.m_refFileInput.current, fnInsertText: this.InsertAtCursor.bind(this) }), e.currentTarget, { bOverlapHorizontal: !0, bPreferPopLeft: !0, bPreferPopTop: !0 });
}
OnEmoticonSelected(e, t = !1) {
t || this.FocusTextInput(), this.InsertAtCursor(`:${e}:`);
}
InsertAtCursor(e) {
let t = this.m_refTextInput.current,
n = t.value,
i = n.substr(0, t.selectionStart) + e + n.substr(t.selectionEnd),
o = t.selectionStart + e.length;
this.SetMessageInput(i, () => {
t.selectionStart = t.selectionEnd = o;
});
}
OnKeyPress(e) {
this.UpdateMentionSearchState();
}
OnKeyboardFullyVisible() {
this.props.chatView.OnScrollBottomRequest();
}
OnClick(e) {
this.UpdateMentionSearchState();
}
OnContextMenu(e) {
a.De.IN_CLIENT || e.stopPropagation();
}
ClearMentionSearchState() {
(this.m_iMentionSearchStartOffset = void 0), this.state.activeSuggestSearchType && this.setState({ activeSuggestSearchType: void 0, mentionSearch: void 0 });
}
FindMatchOpener(e, t, n) {
for (let i = n - 1; i >= 0; i--) {
if (t[i] == e) return i;
if (" " == t[i]) break;
}
}
UpdateMentionSearchState() {
let e = this.m_refTextInput.current;
if (!e) return;
let t = (this.props.chatView && this.props.chatView.chat) instanceof l.K;
if (e.selectionStart != e.selectionEnd || !e.selectionStart) return void this.ClearMentionSearchState();
let n,
i,
o = e.selectionStart,
r = e.value;
for (let e = o - 1; e >= 0; e--) {
let s = e > 0 ? r[e - 1] : void 0;
if (("@" == r[e] || "@" == r[e]) && t) {
(s && " " != s && "\n" != s) || ((n = e), (i = "Mention"));
break;
}
if (":" == r[e] && o - e > 2) {
(s && " " != s && "\n" != s && ":" != s) || ((n = e), (i = "Emoticon"));
break;
}
if (a.De.EREALM != D.IN.k_ESteamRealmChina && r.startsWith("/store ")) {
(n = 6), (i = "Store");
break;
}
if ("/" == r[e] && 0 == e) {
(n = e), (i = "SlashCommand");
break;
}
if (" " == r[e] || "\n" == r[e]) break;
}
if (void 0 === n || n === this.m_iMentionSearchCancelledOffset) return void this.ClearMentionSearchState();
let s = r.substr(n + 1, o - n - 1);
(this.m_iMentionSearchStartOffset = n), this.setState({ activeSuggestSearchType: i, mentionSearch: s });
}
ReplaceSuggestedText(e, t, n) {
let i = this.m_refTextInput.current.selectionStart,
o = this.m_refTextInput.current.value,
r = this.FindMatchOpener(e, o, i);
if ((void 0 === r && "@" == e && (r = this.FindMatchOpener("@", o, i)), void 0 !== r)) {
let e = o.substr(0, r);
(e += t), (i >= o.length || " " != o[i]) && (e += " ");
let a = e.length;
(e += o.substr(i)), this.SetMessageInput(e, n), (this.m_refTextInput.current.value = e), (this.m_refTextInput.current.selectionStart = this.m_refTextInput.current.selectionEnd = a), this.FocusTextInput();
}
}
OnMentionSuggestionSelected(e, t) {
let n;
if ((t instanceof c.Xp ? (n = t.persona.m_strPlayerName) : t && (n = t), !n)) return (this.m_iMentionSearchCancelledOffset = this.m_iMentionSearchStartOffset), void this.ClearMentionSearchState();
{
let e = n;
-1 !== e.lastIndexOf("#") && (e = e.substr(0, e.lastIndexOf("#"))), this.props.chatView.BIsMemberNameAmbiguous(e) && (t instanceof c.Xp ? (n += "#" + t.accountid.toString(36)) : (n += "#0"));
}
this.ReplaceSuggestedText("@", "@" + n), this.ClearMentionSearchState();
}
OnEmoticonSuggestionSelected(e, t) {
if (!t) return (this.m_iMentionSearchCancelledOffset = this.m_iMentionSearchStartOffset), void this.ClearMentionSearchState();
this.ReplaceSuggestedText(":", ":" + t + ":"), this.ClearMentionSearchState();
}
OnSlashCommandSuggestionSelected(e, t) {
if (!t) return (this.m_iMentionSearchCancelledOffset = this.m_iMentionSearchStartOffset), void this.ClearMentionSearchState();
this.ReplaceSuggestedText("/", t, () => {
0 === (0, s.oT)(t).unExpectedArguments && this.OnSubmit();
}),
this.ClearMentionSearchState();
}
OnStoreSuggestionSelected(e, t) {
if (!t) return (this.m_iMentionSearchCancelledOffset = this.m_iMentionSearchStartOffset), void this.ClearMentionSearchState();
this.SetMessageInput(t, () => {
this.OnSubmit();
}),
this.ClearMentionSearchState();
}
FocusTextInput() {
var e, t;
(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI)
? setTimeout(() => {
var e;
null === (e = this.m_navRef.current) || void 0 === e || e.TakeFocus();
}, 0)
: null === (t = this.m_refTextInput.current) || void 0 === t || t.focus();
}
InitForChatView(e) {
this.m_textFocusCallback && (this.m_textFocusCallback.Unregister(), (this.m_textFocusCallback = null));
let t = e.text_entry;
t != this.state.messageInput && this.setState({ messageInput: t }), (this.m_textFocusCallback = e.RegisterForTextEntryFocus(this.FocusTextInput));
}
componentDidMount() {
this.InitForChatView(this.props.chatView), this.FocusTextInput();
}
componentDidUpdate(e) {
this.props.chatView !== e.chatView && this.InitForChatView(this.props.chatView), this.props.isActive && !e.isActive && setTimeout(() => this.FocusTextInput(), 0);
}
componentWillUnmount() {
this.m_textFocusCallback && this.m_textFocusCallback.Unregister(), (this.m_textFocusCallback = null);
}
OnRoomEffectSelected(e) {
this.props.chatView && this.props.chatView.SendChatMessage(`/roomeffect ${e}`), this.FocusTextInput();
}
OnStickerSelected(e) {
this.props.chatView && this.props.chatView.SendChatMessage(`/sticker ${e}`).then(() => d.Ul.ChatStore.EmoticonStore.TrackStickerUsage(e, Date.now() / 1e3)), this.FocusTextInput();
}
render() {
var e, t;
const { chatView: n, disabled: i, ownerWindow: o } = this.props;
let r,
a = n && n.chat;
switch (this.state.activeSuggestSearchType) {
case "Mention":
r = p.createElement(oe, { chatView: n, strSearch: this.state.mentionSearch, onSuggestionSelected: this.OnMentionSuggestionSelected, ref: this.BindMentionDialog });
break;
case "Emoticon":
r = p.createElement(X, { emoticonStore: d.Ul.ChatStore.EmoticonStore, emoticonHoverStore: M.$, strSearch: this.state.mentionSearch, nMinimumSearchLengthBeforeAutoSelection: 2, onSuggestionSelected: this.OnEmoticonSuggestionSelected, ref: this.BindMentionDialog });
break;
case "SlashCommand":
r = p.createElement(re, { strSearch: this.state.mentionSearch, onSuggestionSelected: this.OnSlashCommandSuggestionSelected, ref: this.BindMentionDialog });
break;
case "Store":
r = p.createElement(ae, { strSearch: this.state.mentionSearch, onSuggestionSelected: this.OnStoreSuggestionSelected, ref: this.BindMentionDialog });
}
let s = d.Ul.SettingsStore.FriendsSettings.bCompactFriendsList,
c = d.Ul.SettingsStore.FriendsSettings.nChatFontSize,
u = "";
c == y.Ao.k_EChatFontSizeSmall ? (u = " smallChatFont") : c == y.Ao.k_EChatFontSizeLarge && (u = " largeChatFont");
let _ = {};
if (
(this.state.submitEnabled &&
((_.onSecondaryButton = () => {
this.SetMessageInput("");
}),
(_.onSecondaryActionDescription = (0, f.Xx)("#ChatEntryButton_Clear"))),
a.BIsVoiceAllowed())
)
if (a instanceof m.a) {
if (!n.BVoiceActive()) {
_.onOptionsButton = () => a.ToggleVoiceChat();
let e = a.accountid_partner,
t = d.Ul.VoiceStore.BPartnerHasRequestedAndIsInOneOnOneChat(e);
_.onOptionsActionDescription = (0, f.Xx)(t ? "#Voice_StartTalking" : "#Friend_Menu_StartVoiceChat");
}
} else if (a instanceof l.K) {
let e = n.GetParentGroupView(),
t = e.GetGroup();
if (t.voiceRoomList.length > 1) {
const t = () => {
(0, Z.AM)(p.createElement(Q.zb, { groupView: e }), o);
};
(_.onOptionsButton = t), (_.onOptionsActionDescription = (0, f.Xx)("#Chat_ChatRoomGroup_ViewVoiceChats"));
} else if (1 != t.voiceRoomList.length || d.Ul.VoiceStore.IsVoiceActiveForGroup(t.GetGroupID()))
0 != t.voiceRoomList.length ||
d.Ul.VoiceStore.IsVoiceChatActive() ||
((_.onOptionsButton = () => {
t.CreateAndJoinTempVoiceRoom();
}),
(_.onOptionsActionDescription = (0, f.Xx)("#Chat_ChatRoomGroup_StartVoiceChat")));
else {
const e = () => {
var e;
null === (e = t.voiceRoomList[0]) || void 0 === e || e.StartVoiceChat();
};
(_.onOptionsButton = e), (_.onOptionsActionDescription = (0, f.Xx)("#Chat_ChatRoomGroup_JoinVoiceChat"));
}
}
return p.createElement(
A.s,
Object.assign({ className: "chatEntry" + (s ? " compactView" : "") + u, "flow-children": "row" }, _, { navEntryPreferPosition: J.c4.PREFERRED_CHILD }),
p.createElement(v, { fileUploadManager: n.file_upload_manager }),
p.createElement(te, {
clipToUpload: n.clip_to_upload,
finishUpload: (e) => {
n.SetClipToUpload(void 0), e && n.SendChatMessage(e);
},
}),
p.createElement(
"form",
{ className: `${T().chatEntryControls}`, onSubmit: this.OnSubmit, onBlur: this.OnBlur },
r,
p.createElement(R.DP, { className: T().chatTextarea, value: this.state.messageInput, preferredFocus: !0, onKeyboardFullyVisible: this.OnKeyboardFullyVisible, onPaste: this.OnPaste, onContextMenu: this.OnContextMenu, ref: this.m_refTextInput, onChange: this.OnTextAreaChange, navRef: this.m_navRef, onKeyDown: this.OnKeyDown, onKeyUp: this.OnKeyPress, onClick: this.OnClick, onFocus: this.OnFocus, disabled: i || d.Ul.CMInterface.BDisconnected(), maxLength: 5e3, spellCheck: !d.Ul.SettingsStore.FriendsSettings.bDisableSpellcheck }),
p.createElement(R.wl, { className: T().chatSubmitButton + (this.state.submitEnabled ? "" : ` ${T().disabled}`), type: "submit", disabled: !this.state.submitEnabled, title: (0, f.Xx)("#ChatEntryButton_Submit"), onOKActionDescription: (0, f.Xx)("#ChatEntryButton_Submit") }, p.createElement(g.k4K, null)),
p.createElement("input", { type: "file", accept: ".jpg,.jpeg,.png,.gif,.webm,.mpg,.mpeg,.ogv", style: { display: "none" }, name: "fileupload", ref: this.m_refFileInput, onChange: this.OnFileInputChange }),
),
p.createElement(
"div",
{ className: `${T().chatEntryActionsContainer} compactableHeight` },
!(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) && p.createElement("div", { className: T().chatEntryActionsGroup }, p.createElement(G.Z, { disabled: i, OnEmoticonSelected: this.OnEmoticonSelected, onRoomEffectSelected: this.OnRoomEffectSelected, roomEffectSettings: d.Ul.GetChatRoomEffectSettings(), onStickerSelected: this.OnStickerSelected, rtLastAckedNewEmoticons: h.g_FriendsUIDesktopApp.UIDisplayPrefs.rtLastAckedNewEmoticons, SetUIDisplayPref: h.g_FriendsUIDesktopApp.SetUIDisplayPref.bind(h.g_FriendsUIDesktopApp), emoticonHoverStore: M.$, emoticonStore: d.Ul.ChatStore.EmoticonStore, bShowChatAddons: !0 }), p.createElement(R.wl, { className: `${T().chatSubmitButton} ${T().EmbedButton}` + (i ? ` ${T().disabled}` : ""), type: "button", onClick: this.OnEmbedClick, title: (0, f.Xx)("#ChatEntryButton_SendEmbed"), disabled: i, onOKActionDescription: (0, f.Xx)("#ChatEntryButton_SendEmbed") }, p.createElement(g.TCU, null))),
!(null === (t = this.context) || void 0 === t ? void 0 : t.IN_GAMEPADUI) && p.createElement(ie, { chat: a }),
),
p.createElement("div", { className: "disconnectBlocker compactableHeight" }),
);
}
};
(ne.contextType = $.E_),
(0, i.gn)([_.ak], ne.prototype, "BindMentionDialog", null),
(0, i.gn)([_.ak], ne.prototype, "OnSubmit", null),
(0, i.gn)([_.ak], ne.prototype, "OnTextAreaChange", null),
(0, i.gn)([_.ak], ne.prototype, "SizeChatEntry", null),
(0, i.gn)([_.ak], ne.prototype, "OnFocus", null),
(0, i.gn)([_.ak], ne.prototype, "OnBlur", null),
(0, i.gn)([_.ak], ne.prototype, "OnKeyDown", null),
(0, i.gn)([_.ak], ne.prototype, "OnPaste", null),
(0, i.gn)([_.ak], ne.prototype, "OnFileInputChange", null),
(0, i.gn)([_.ak], ne.prototype, "OnEmbedClick", null),
(0, i.gn)([_.ak], ne.prototype, "OnEmoticonSelected", null),
(0, i.gn)([_.ak], ne.prototype, "OnKeyPress", null),
(0, i.gn)([_.ak], ne.prototype, "OnKeyboardFullyVisible", null),
(0, i.gn)([_.ak], ne.prototype, "OnClick", null),
(0, i.gn)([_.ak], ne.prototype, "OnContextMenu", null),
(0, i.gn)([_.ak], ne.prototype, "OnMentionSuggestionSelected", null),
(0, i.gn)([_.ak], ne.prototype, "OnEmoticonSuggestionSelected", null),
(0, i.gn)([_.ak], ne.prototype, "OnSlashCommandSuggestionSelected", null),
(0, i.gn)([_.ak], ne.prototype, "OnStoreSuggestionSelected", null),
(0, i.gn)([_.ak], ne.prototype, "FocusTextInput", null),
(0, i.gn)([_.ak], ne.prototype, "OnRoomEffectSelected", null),
(0, i.gn)([_.ak], ne.prototype, "OnStickerSelected", null),
(ne = (0, i.gn)([u.Pi], ne));
let ie = class extends p.Component {
HandleStartVoice(e) {
let t = this.props.chat;
if (t instanceof m.a) return void t.ToggleVoiceChat();
if (this.IsVoiceActiveForButton()) return void d.Ul.VoiceStore.OnUserEndVoiceChat();
if (!(t instanceof l.K)) return;
let n = t.GetGroup();
if (!n) return;
let i = n.voiceRoomList;
if (0 == i.length) return void n.CreateAndJoinTempVoiceRoom();
if (1 == i.length) {
let e = i[0];
return void d.Ul.VoiceStore.InitiateRoomChat(n.GetGroupID(), e.GetRoomID());
}
let o = p.createElement(le, { group: n });
(0, w.yV)(o, e.currentTarget, { bOverlapHorizontal: !0, bPreferPopLeft: !0, bPreferPopTop: !0 });
}
IsVoiceActiveForButton() {
let e = this.props.chat,
t = !1;
if (e instanceof m.a) t = e.BVoiceActive();
else if (e instanceof l.K) {
let n = e.GetGroup();
t = d.Ul.VoiceStore.IsVoiceActiveForGroup(n.GetGroupID());
}
return t;
}
OnSettingsClick(e) {
(0, K.L)((0, h.Um)(this, e), e.currentTarget.ownerDocument.defaultView, "voice");
}
render() {
let e = this.IsVoiceActiveForButton(),
t = ["VoiceToggle"],
n = "",
i = this.props.chat;
e ? (t.push("Active"), d.Ul.VoiceStore.BNoMicAvailableForSession() && t.push("NoMicrophone"), d.Ul.VoiceStore.IsMicMuted() && t.push("MicMuted")) : t.push(" Inactive");
let o = !i.BIsVoiceAllowed();
if (o) t.push(" Disabled"), (n = i.GetVoiceNotAllowedReason());
else if (i instanceof m.a) n = e ? "#Tooltip_VoiceControlButton_1v1_active" : "#Tooltip_VoiceControlButton_1v1_inactive";
else if (i instanceof l.K)
if (this.IsVoiceActiveForButton()) n = "#Tooltip_VoiceControlButton_group_leave";
else {
let e = i.GetGroup();
e && 0 == e.voiceRoomList.length ? (n = "#Tooltip_VoiceControlButton_group_create") : e && 1 == e.voiceRoomList.length ? (n = "#Tooltip_VoiceControlButton_group_joinsingle") : e && (n = "#Tooltip_VoiceControlButton_group_joinmultiple");
}
let r = d.Ul.VoiceStore.GetPushToTalkEnabled(),
a = d.Ul.VoiceStore.GetPushToMuteEnabled(),
s = d.Ul.VoiceStore.GetPushToTalkVoiceStateEnabled(),
c = d.Ul.VoiceStore.GetPushToTalkHotKeyDisplayString(),
h = "";
return (
(r || a) && (h += " pushToTalkEnabled"),
s && (h += " pushToTalkKeyDown"),
p.createElement("div", { className: "ChatMessageEntryVoice" + h + (e ? " Active" : " Inactive") + (o ? " Disabled" : "") }, p.createElement("div", { className: "buttonsContainer" }, p.createElement(R.wl, { disabled: o, className: t.join(" "), onClick: this.HandleStartVoice, onOKActionDescription: (0, f.Xx)(n), title: (0, f.Xx)(n) }, p.createElement("div", { className: "VoiceToggleIconCtn" }, e ? p.createElement(g.xsH, null) : p.createElement(g.Cq4, null))), e && p.createElement("div", { className: "activeVoiceControls" }, p.createElement("div", { className: "activeVoiceFlexBox" }, p.createElement("div", { className: "activeVoiceButtons" }, p.createElement(q.SR, null), p.createElement(q.$J, null))))), (r || a) && this.IsVoiceActiveForButton() && p.createElement("div", { className: "activeVoicePushToTalk" + h, title: (0, f.Xx)(a ? "#ActiveVoicePushToMute" : "#ActiveVoicePushToTalk", c) }, c))
);
}
};
(0, i.gn)([_.ak], ie.prototype, "HandleStartVoice", null), (0, i.gn)([_.ak], ie.prototype, "OnSettingsClick", null), (ie = (0, i.gn)([u.Pi], ie));
class oe extends V {
performSearch(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
return this.props.chatView.SearchMembersForMention(e, Number.MAX_VALUE);
});
}
ChooseSuggestion(e) {
(e && e.strNotSelectable) || super.ChooseSuggestion(e);
}
getSelection(e) {
return e.friend ? e.friend : e.meta_mention;
}
getKey(e) {
return "" + (e.friend ? e.friend.accountid : e.meta_mention);
}
renderMatch(e) {
let t,
n,
{ friend: i, iMatchOffset: o, bNicknameMatch: r } = e,
a = this.props.strSearch.length,
s = null;
return (
i ? ((t = i.persona.m_strPlayerName), (n = i.has_nickname && i.nickname), i.persona.avatar_url_medium && (s = i.persona.avatar_url_medium)) : ((t = "@" + e.meta_mention), (n = null), o++),
r ? p.createElement("span", { className: "mentionSuggestion" }, s && p.createElement("img", { className: "mentionAvatar", src: i.persona.avatar_url_medium, draggable: !1 }), t, p.createElement("span", { className: "nickname" }, " (", n.substr(0, o).replace(/ /g, " "), p.createElement("span", { className: "mentionSearchMatch" }, n.substr(o, a).replace(/ /g, " ")), n.substr(o + a).replace(/ /g, " "), ")")) : p.createElement("span", { className: "mentionSuggestion" }, t.substr(0, o).replace(/ /g, " "), s && p.createElement("img", { className: "mentionAvatar", src: i.persona.avatar_url_medium, draggable: !1 }), p.createElement("span", { className: "mentionSearchMatch" }, t.substr(o, a).replace(/ /g, " ")), t.substr(o + a).replace(/ /g, " "), e.strNotSelectable && p.createElement("span", { className: "notSelectable" }, " ", ": " + e.strNotSelectable, " "), n && p.createElement("span", { className: "nickname" }, " (", n, ")"))
);
}
renderNoMatchMessage() {
return p.createElement("div", { key: "nomatches", className: "suggestOption mentionSearchOption noMatches" }, (0, f.Xx)("#ChatMentionSuggest_NoMatches"));
}
renderTooManyMatchesMessage(e) {
let t = e <= 1 ? "#ChatMentionSuggest_ManyMatches" : "#ChatMentionSuggest_ManyMatchesPlural";
return p.createElement("div", { key: "manymatches", className: "suggestOption mentionSearchOption manyMatches" }, (0, f.Xx)(t, e));
}
renderHeader() {
return p.createElement("div", { className: "mentionSearchText" }, (0, f.Xx)("#ChatMentionSuggest_MembersMatching", this.props.strSearch));
}
getMaxMatches() {
var e;
return (null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) ? 6 : oe.nMaxMatches;
}
}
(oe.contextType = $.E_), (oe.nMaxMatches = 12);
class re extends V {
performSearch(e) {
const t = "/" + e;
return (0, s.VO)().filter((e) => e.startsWith(t));
}
getSelection(e) {
return e;
}
getKey(e) {
return e;
}
renderMatch(e) {
const t = (0, s.oT)(e);
if (!t) return null;
const n = (0, f.Xx)(t.strDescriptionToken);
return p.createElement("span", { className: "SlashCommandSuggestion" }, p.createElement("span", { className: "SlashCommandSuggestion_SlashCommand" }, e), ": ", p.createElement("span", { className: "SlashCommandSuggestion_SlashCommandDescription" }, n));
}
renderNoMatchMessage() {
return null;
}
renderTooManyMatchesMessage(e) {
return null;
}
renderHeader() {
return null;
}
getMaxMatches() {
return Number.MAX_VALUE;
}
}
class ae extends V {
performSearch(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
this.m_mapSuggestions || (this.m_mapSuggestions = new Map());
let t = e.trim();
return this.m_mapSuggestions.has(t) || this.m_mapSuggestions.set(t, this.loadSearchFromStore(t)), this.m_mapSuggestions.get(t);
});
}
loadSearchFromStore(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
const t = { term: e, f: "json", cc: a.De.COUNTRY, l: a.De.LANGUAGE, origin: self.origin };
return (yield r().get(`${a.De.STORE_BASE_URL}search/suggest`, { params: t })).data.filter((e) => "game" === e.type || "software" === e.type) || [];
});
}
getSelection(e) {
return `${a.De.STORE_BASE_URL}app/${e.id}`;
}
getKey(e) {
return String(e.id);
}
renderMatch(e) {
return p.createElement("span", { className: "SlashCommandSuggestion" }, p.createElement("span", { className: "SlashCommandSuggestion_SlashCommand" }, e.name));
}
renderNoMatchMessage() {
return null;
}
renderTooManyMatchesMessage(e) {
return null;
}
renderHeader() {
return null;
}
getMaxMatches() {
return Number.MAX_VALUE;
}
}
function se(e) {
let t = [],
n = "undefined" != typeof SteamClient && void 0 !== SteamClient.Screenshots,
o = (function () {
let e = "undefined" != typeof SteamClient && void 0 !== SteamClient.Screenshots;
const [t, n] = p.useState(null);
return (
p.useEffect(() => {
if (!e) return;
let t = !1;
return (
SteamClient.Screenshots.GetLastScreenshotTaken().then((e) => {
t || n(e);
}),
() => {
t = !0;
}
);
}, [e]),
e ? t : null
);
})();
(0, Y.xB)();
if (
(e.refFileInput &&
t.push(
p.createElement(
L.Zo,
{
key: "upload",
onSelected: () => {
e.refFileInput.click();
},
},
(0, f.Xx)("#ChatEntry_UploadImage"),
),
),
n)
) {
let n = null == o || void 0 === o,
a = null;
!n &&
o &&
(a = () =>
(function (e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
let n = "https://steamloopback.host/" + t,
i = yield r()({ url: n, method: "GET", responseType: "blob" }),
o = z.hj(n, "/"),
a = j.Lh(i.data, o);
e.SetFileToUpload(a);
});
})(e.chatView, o.strUrl)),
t.push(p.createElement(L.Zo, { key: "lastscreenshot", disabled: n, onSelected: a }, (0, f.Xx)("#ChatEntry_UploadLastScreenshot")));
}
return (
t.push(
p.createElement(
L.Zo,
{
key: "tradeoffer",
onSelected: () => {
d.Ul.EconomyStore.GetTradeOfferURL().then((t) => {
e.fnInsertText(t);
});
},
},
(0, f.Xx)("#ChatEntry_SendTradeURL"),
),
),
p.createElement(L.xV, null, t)
);
}
function le(e) {
let t = e.group.GetGroupID(),
n = e.group.voiceRoomList.map((e) =>
p.createElement(
L.Zo,
{
key: e.GetRoomID(),
onSelected: () => {
d.Ul.VoiceStore.InitiateRoomChat(t, e.GetRoomID());
},
},
e.name,
),
);
return p.createElement(L.xV, null, n);
}
},
618: (e, t, n) => {
"use strict";
n.d(t, { UZ: () => G, _P: () => V, hV: () => U, oY: () => T, vT: () => H });
var i = n(85556),
o = n(10237),
r = n.n(o),
a = n(37234),
s = n(88669),
l = n(72746),
c = n(51997),
m = n(34268),
d = n(85516),
h = n(71357),
u = n(50649),
p = n(27378),
_ = n(16518),
g = n(84290),
C = n(2049),
f = n(21298),
v = n(41111),
S = n(90656),
b = n(66156),
I = n(87018),
y = n(88991),
E = n(61963),
D = n(82909),
w = n(83817),
R = n(68816),
A = n(31360),
M = n(14341);
const k = ["148618792083695825", "76561197960266962"];
let T = class extends p.Component {
InviteFriend(e) {
(0, v.hg)((0, a.Um)(this, e), (0, s.RA)(e), this.props.groupView.GetGroup());
}
OpenSettings(e) {
(0, m.n)((0, s.RA)(e), this.props.groupView);
}
OpenNotificationPreferences(e) {
(0, d.Uu)((0, s.RA)(e), this.props.groupView);
}
OnContextMenu(e) {
(0, c.bU)(e, this.props.groupView.GetGroup(), { is_chat_window: !0 });
}
render() {
let e = this.props.groupView,
t = e.GetGroup(),
n = t.name,
i = t.tagline,
o = !1;
t.readyToRender && (o = t.BCanInvite());
const r = e.GetGroup().watching_broadcast_steamid;
return p.createElement(
"div",
{ className: "chatRoomHeader" },
p.createElement(
w.s,
{ "flow-children": "row", className: "chatRoomGroupHeader" + (r ? " notifyBroadcast" : ""), onContextMenu: this.OnContextMenu, onMenuButton: this.OnContextMenu },
p.createElement(V, { group: t }),
p.createElement("div", { className: "chatRoomGroupHeaderNameandTag" }, p.createElement("div", { className: "chatRoomGroupHeaderName" }, n), p.createElement(L, { strTagline: i })),
p.createElement("div", { className: "chatRoomGroupSpacer" }),
t.readyToRender &&
p.createElement(
p.Fragment,
null,
r && p.createElement(O, { groupView: e }),
p.createElement(
"div",
{ className: "chatRoomGroupControls" },
p.createElement("div", { className: "chatRoomOptions" }, p.createElement(w.s, { className: "chatRoomButton ManageNotifications", onActivate: this.OpenNotificationPreferences, title: (0, g.Xx)("#Tooltip_NotificationSettings") }, p.createElement(_.Uos, null)), o && p.createElement(w.s, { className: "chatRoomButton InviteToGroupChat", onActivate: this.InviteFriend, title: (0, g.Xx)("#Tooltip_InviteToGroup") }, p.createElement(_.Kon, null)), !o && p.createElement("div", { className: "chatRoomButton InviteToGroupChat Disabled", onClick: (e) => {}, title: (0, g.Xx)("#Tooltip_InviteToGroup_Denied") }, p.createElement(_.Kon, null)), p.createElement(w.s, { className: "chatRoomButton GroupChatSettings", onActivate: this.OpenSettings, title: (0, g.Xx)("#Tooltip_GroupChatSettings") }, p.createElement(_.lVV, null))),
p.createElement("div", { className: "chatRoomGroupStats" }, p.createElement(x, { groupView: e }), p.createElement(P, { groupView: e }), p.createElement(N, { groupView: e })),
),
),
),
);
}
};
function L(e) {
const { strTagline: t } = e,
n = t.toLowerCase();
return (!n.startsWith("https://") && !n.startsWith("http://")) || t.includes(" ") ? p.createElement("div", { className: "chatRoomGroupHeaderTagline" }, e.strTagline) : p.createElement(M.ns, { href: t, className: "chatRoomGroupHeaderTagline", bUseLinkFilter: !0 }, t);
}
(0, i.gn)([C.ak], T.prototype, "InviteFriend", null), (0, i.gn)([C.ak], T.prototype, "OpenSettings", null), (0, i.gn)([C.ak], T.prototype, "OpenNotificationPreferences", null), (0, i.gn)([C.ak], T.prototype, "OnContextMenu", null), (T = (0, i.gn)([u.Pi], T));
let G = class extends p.Component {
fnShowTextChannelsDialog(e) {
(0, R.AM)(p.createElement(A.Yq, { groupView: this.props.groupView }), (0, s.RA)(e));
}
render() {
var e, t;
let n = this.props.groupView,
i = n.GetGroup(),
o = i.name,
r = i.tagline,
a = !1;
i.readyToRender && (a = i.BCanInvite());
const s = n.GetGroup().watching_broadcast_steamid,
l = null === (e = n.GetActiveChatView()) || void 0 === e ? void 0 : e.chat.GetVoiceAllowed();
let c = null === (t = n.GetActiveChatView()) || void 0 === t ? void 0 : t.GetTabName();
return (
l && (c = (0, g.Xx)("#GroupSettings_Channels_VoiceQuickChatRoom", c)),
p.createElement(
"div",
{ className: "chatRoomHeader" },
p.createElement(
w.s,
{ focusable: !1, fnCanTakeFocus: () => !0, "flow-children": "row", className: "chatRoomGroupHeader" + (s ? " notifyBroadcast" : "") },
p.createElement(V, { group: i }),
p.createElement("div", { className: "chatRoomGroupHeaderNameandTag" }, p.createElement("div", { className: "chatRoomGroupHeaderName" }, o, p.createElement(L, { strTagline: r })), p.createElement(w.s, { className: "chatRoomGroupActiveChat " + (l ? "voiceRoom" : ""), focusable: !0, fnCanTakeFocus: () => !0, onActivate: this.fnShowTextChannelsDialog, onOKActionDescription: (0, g.Xx)("#GroupSettings_Channels_TextChannels") }, p.createElement(_.MFo, null), c)),
p.createElement("div", { className: "chatRoomGroupSpacer" }),
i.readyToRender && p.createElement(p.Fragment, null, s && p.createElement(O, { groupView: n }), p.createElement("div", { className: "chatRoomGroupControls" }, p.createElement("div", { className: "chatRoomGroupStats" }, p.createElement(x, { groupView: n }), p.createElement(P, { groupView: n }), p.createElement(N, { groupView: n })))),
),
)
);
}
};
(0, i.gn)([C.ak], G.prototype, "fnShowTextChannelsDialog", null), (G = (0, i.gn)([u.Pi], G));
let O = class extends p.Component {
constructor(e) {
super(e);
let t = this.GetBroadcastID(e.groupView);
this.state = { info: S.BroadcastWatchStore.StartInfo(t) };
}
GetBroadcastID(e) {
return e.GetGroup().watching_broadcast_steamid.ConvertTo64BitString();
}
componentWillUnmount() {
S.BroadcastWatchStore.StopInfo(this.state.info);
}
OnRemoveBroadcast(e) {
e.stopPropagation();
const t = this.props.groupView.GetGroup();
if (!t.BCanIAssociateBroadcast()) return;
const n = (0, s.RA)(e);
(0, h.p3)(n, (0, g.Xx)("#Broadcast_EndWatchParty"), (0, g.Xx)("#Broadcast_EndWatchPartyPrompt"), (0, g.Xx)("#Broadcast_EndWatchParty")).then(() => t.SetChatRoomGroupWatchingBroadcast(void 0));
}
OnToggleBroadcast(e) {
let t = this.props.groupView;
t.isBroadcastShown ? t.HideBroadcast() : t.ShowBroadcast();
}
render() {
const {
info: { m_strAppTitle: e, m_strThumbnailUrl: t, m_strTitle: n },
} = this.state,
i = this.props.groupView,
o = i.GetGroup(),
r = this.GetBroadcastID(this.props.groupView),
a = i.isBroadcastShown;
if (k.indexOf(r) >= 0) return p.createElement(F, { groupView: i, onClick: this.OnToggleBroadcast, onRemoveBroadcast: this.OnRemoveBroadcast, watchingBroadcast: a });
if (a) return null;
let s = new y.K(r),
c = n;
return n || (c = (0, g.Xx)("#PersonaStateWatchingBroadcast_Player", l.Ul.FriendStore.GetPlayer(s.GetAccountID()).display_name)), p.createElement("div", { className: "broadcastInfoContainer", onClick: this.OnToggleBroadcast }, p.createElement("div", { className: "broadcastDetails" }, p.createElement("div", { className: "nowWatching" }, (0, g.Xx)("#Broadcast_NowWatching")), p.createElement("div", { className: "gameTitle" }, e), p.createElement("div", { className: "broadcastTitle" }, c)), p.createElement("div", { className: "thumbnail" }, t && p.createElement(b.m, { className: "thumbnailImg", src: t, duration: 2500 })), o.BCanIAssociateBroadcast() && p.createElement("div", { className: "actions", onClick: this.OnRemoveBroadcast }, p.createElement(_.X, null)));
}
};
(0, i.gn)([C.ak], O.prototype, "OnRemoveBroadcast", null), (0, i.gn)([C.ak], O.prototype, "OnToggleBroadcast", null), (O = (0, i.gn)([u.Pi], O));
class F extends p.Component {
OnContextMenu(e) {
this.props.groupView.GetGroup().BCanIAssociateBroadcast() &&
(function (e, t) {
(0, D.yV)(p.createElement(B, { onRemoveBroadcast: t }), e);
})(e, this.props.onRemoveBroadcast);
}
render() {
let e = this.props.watchingBroadcast,
t = (0, I.Z)(r().YuleLog, e && r().Watching);
return p.createElement("div", { className: t, onClick: this.props.onClick, onContextMenu: this.OnContextMenu });
}
}
(0, i.gn)([C.ak], F.prototype, "OnContextMenu", null);
class B extends p.Component {
render() {
return p.createElement(E.xV, { className: "chatRoomListItemContextMenu" }, p.createElement(E.Zo, { key: "removebroadcast", onSelected: this.props.onRemoveBroadcast }, (0, g.Xx)("#Chat_Actions_RemoveRoom_Action")));
}
}
let x = (0, u.Pi)((e) => {
const { groupView: t } = e;
return p.createElement("div", { className: "statMemberStat statMembersTotal" }, p.createElement("div", { className: "statCircle" }), (0, g.kb)("#Chat_Members", t.GetMemberCountTotal()));
}),
N = (0, u.Pi)((e) => {
const { groupView: t } = e;
let n = t.GetMemberCountInGame();
return 0 == n ? null : p.createElement("div", { className: "statMemberStat statMembersInGame", title: (0, g.kb)("#Chat_Members_InGame_Tooltip", n) }, p.createElement("div", { className: "statCircle" }), n);
}),
P = (0, u.Pi)((e) => {
const { groupView: t } = e;
let n = t.GetMemberCountOnline();
return 0 == n ? null : p.createElement("div", { className: "statMemberStat statMembersOnline", title: (0, g.kb)("#Chat_Members_Online_Tooltip", n) }, p.createElement("div", { className: "statCircle" }), n);
}),
U = (0, u.Pi)((e) => {
let t = e.size;
if (("large" == t || "medium" == t) && e.clan.BIsOGG() && e.clan.GetOGGAppID()) {
let t = l.Ul.AppInfoStore.GetAppInfo(e.clan.GetOGGAppID());
return p.createElement("div", { className: "ChatRoomGroupOGGAvatar Large" }, p.createElement("img", { className: "OGGAvatar", src: t.header_image_url }));
}
let n = "";
"micro" == t ? (n = "Micro") : "smallish" == t ? (n = "Small Smallish") : "smaller" == t ? (n = "Smaller") : "small" == t ? (n = "Small") : "large" == t && (n = "Large");
let i = "large" == t ? e.clan.avatar_url_full : e.clan.avatar_url_medium;
return p.createElement("div", { className: "ChatRoomGroupAvatar " + n }, p.createElement("img", { className: "ChatRoomGroupAvatar_Avatar", src: i }));
}),
V = class extends p.Component {
render() {
let e = this.props.group;
if (e && e.BIsClanChatRoom()) {
let t = l.Ul.FriendStore.ClanStore.GetClan(e.GetClanID()),
n = "medium";
return this.props.micro ? (n = "micro") : this.props.small ? (n = "small") : this.props.smallish ? (n = "smallish") : this.props.smaller ? (n = "smaller") : this.props.large && (n = "large"), p.createElement(U, { clan: t, size: n });
}
let t = "";
if ((this.props.micro ? (t = "Micro") : this.props.small ? (t = "Small") : this.props.smallish ? (t = "Small Smallish") : this.props.smaller ? (t = "Smaller") : this.props.large && (t = "Large"), e && !e.IsNamedGroupChat())) {
let n = e.members_to_highlight,
i = n.members,
o = n.remaining_count;
if (i.length) {
let e = i.length + (o ? 1 : 0);
return p.createElement(
"div",
{ className: "ChatRoomMultiFriendAvatar With" + e + "Items " + t },
i.map((e, t) => p.createElement("img", { src: this.props.large ? e.persona.avatar_url_medium : e.persona.avatar_url, key: t, className: "MultiAvatar Index" + t })),
o > 0 && p.createElement("div", { className: "ChatRoomMultiFriendMore MultiAvatar Index3" }, "+", o),
);
}
}
if (e && e.hasIcon) return p.createElement("div", { className: "ChatRoomGroupAvatar HasAvatar " + t }, p.createElement("img", { className: "ChatRoomGroupAvatar_Avatar", src: e.avatar_url_full }));
{
let n = "";
e ? (n = e.name) : this.props.name && (n = this.props.name);
let i = (0, f.Gt)(n),
o = "ChatRoomGroupAvatar " + t;
return f.CR(i) && (o += " EmojiInitials"), p.createElement("div", { className: o }, p.createElement("div", { className: "ChatRoomGroupAvatar_initials" }, i));
}
}
};
function H(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
let n = (0, a.rb)(e),
i = t.BIsClanChatRoom() ? "#Chat_Actions_LeaveChatRoomGroup_ClanConfirm" : t.BIsAccountIDOwner(l.Ul.CMInterface.steamid.GetAccountID()) ? "#Chat_Actions_OwnerLeaveChatRoomGroup_Confirm" : "#Chat_Actions_LeaveChatRoomGroup_Confirm";
(yield (0, h.V3)(e, (0, g.Xx)("#Chat_Actions_LeaveChatRoomGroup"), (0, g.Xx)(i, t.name), (0, g.Xx)("#Chat_Actions_LeaveChatRoomGroup"))) && t.LeaveChatRoomGroup(n);
});
}
V = (0, i.gn)([u.Pi], V);
},
31360: (e, t, n) => {
"use strict";
n.d(t, { lp: () => _e, Yq: () => Ce, zb: () => fe });
var i = n(85556),
o = n(11259),
r = n(68816),
a = n(65204),
s = n(99165),
l = n(19953),
c = n(84446),
m = n(72746),
d = n(37234),
h = n(23133),
u = n(27378),
p = n(16518),
_ = n(50649),
g = n(23346),
C = n(2049),
f = n(46057),
v = n(70008),
S = n(7597),
b = n(37035);
class I extends u.Component {
constructor(e) {
super(e), (this.m_elContainer = null), (this.m_resizeObserver = null), (this.state = { nWidth: 0, nHeight: 0 });
}
componentWillUnmount() {
this.m_resizeObserver && this.m_resizeObserver.disconnect();
}
BindContainerRef(e) {
this.m_resizeObserver && (this.m_resizeObserver.disconnect(), (this.m_resizeObserver = null)), (this.m_elContainer = e), this.m_elContainer && ((this.m_resizeObserver = (0, C.it)(this.m_elContainer, this.OnResize)), this.UpdateDimensions(this.m_elContainer.clientWidth, this.m_elContainer.clientHeight)), this.props.refToDiv && this.props.refToDiv(e);
}
UpdateDimensions(e, t) {
(this.state.nWidth == e && this.state.nHeight == t) || this.setState({ nWidth: e, nHeight: t });
}
OnResize(e, t) {
let n = 0,
i = 0;
if (e.length > 0) {
let t = e[0].contentRect;
(n = t.width), (i = t.height);
}
this.UpdateDimensions(n, i);
}
render() {
const e = this.props,
{ bUseRelativePosition: t, className: n, refToDiv: o } = e,
r = (0, i._T)(e, ["bUseRelativePosition", "className", "refToDiv"]),
a = t ? { position: "relative" } : { position: "absolute", top: 0, right: 0, bottom: 0, left: 0 },
s = { width: this.state.nWidth, height: this.state.nHeight },
l = this.props.children(s);
return u.createElement("div", Object.assign({ className: n, style: a, ref: this.BindContainerRef }, r), l);
}
}
(0, i.gn)([C.ak], I.prototype, "BindContainerRef", null), (0, i.gn)([C.ak], I.prototype, "OnResize", null);
var y = n(84290),
E = n(87018),
D = n(83817),
w = n(56320),
R = n(8070);
const A = (e) => (l.De.IN_CLIENT ? u.createElement(I, Object.assign({}, e)) : u.createElement(v.ZP, Object.assign({}, e)));
let M = class extends u.Component {
GetFriendRenderContext() {
let e = this.props.groupView.GetGroup();
return (this.m_renderContext && this.m_renderContext.group == e) || (this.m_renderContext = { group: e, chatContext: "chatmemberlist" }), this.m_renderContext;
}
GetMembersMatchingSearch(e) {
let t = N(this.props.groupView.GetGroup().memberList.member_list, e);
return t.sort(g.Xp.DefaultFriendSortComparator), t;
}
OnMemberListToggleViewClick() {
this.props.groupView.SetMemberListCollapsed(this.props.groupView.isMemberListExpanded);
}
OnSearchInput(e) {
this.props.groupView.UpdateMemberSearch(e.currentTarget.value);
}
OnSearchSubmit(e) {
e.preventDefault();
let t = this.props.groupView,
n = t.normalizedMemberSearch;
if (n && n.length) {
let t = this.GetMembersMatchingSearch(n);
t.length && t[0].OpenChatDialog((0, d.Um)(this, e));
}
t.ClearMemberSearch();
}
OnSearchKeyDown(e) {
27 == e.keyCode && (e.preventDefault(), e.currentTarget.blur(), this.props.groupView.ClearMemberSearch());
}
OnClearSearch() {
this.props.groupView.ClearMemberSearch();
}
OnSearchFocus() {
this.props.groupView.UpdateMemberSearch(this.props.groupView.GetMemberSearch());
}
OnSearchBlur() {
0 == this.props.groupView.GetMemberSearch().length && this.props.groupView.ClearMemberSearch();
}
render() {
let e = this.props.groupView,
t = e.isMemberListExpanded,
n = e.GetMemberSearch(),
i = "MemberListColumn",
o = (0, y.Xx)("#Tooltip_MemberCollapse");
t || ((i += " MemberListViewCompact"), (o = (0, y.Xx)("#Tooltip_MemberExpand")));
let r = "MemberListOptionsContainer";
return (
e.IsMemberSearchActive() && (r += " SearchActive"),
u.createElement(
D.s,
{ className: i },
u.createElement(
"div",
{ className: r },
u.createElement("div", { className: "MemberListOption ToggleMemberListView" + (n.length > 0 ? " SearchActive" : ""), onClick: this.OnMemberListToggleViewClick, title: o }, u.createElement(p.NP6, null)),
u.createElement("form", { className: "socialInputContainer", name: "friendSearchForm", onSubmit: this.OnSearchSubmit }, u.createElement("div", { className: "inputContainer no-drag" }, u.createElement("input", { className: "friendSearchInput", type: "text", name: "memberlistSearch", placeholder: (0, y.Xx)("#SearchByName"), value: n, onChange: this.OnSearchInput, onKeyDown: this.OnSearchKeyDown, onFocus: this.OnSearchFocus, onBlur: this.OnSearchBlur, autoComplete: "off" }), e.has_search_error ? u.createElement("div", { className: "friendSearchError", title: (0, y.Xx)("#SearchError") }, u.createElement(p.ge, { color: "red" })) : u.createElement("div", { className: "friendSearchClear", onClick: this.OnClearSearch }, u.createElement(p.pVO, null)))),
),
u.createElement(D.s, { style: { display: "flex", flex: 1, position: "relative" }, "flow-children": "column" }, e.GetGroup().BIsMemberListVirtualized() ? u.createElement(G, { groupView: this.props.groupView, inactive: this.props.inactive, context: this.GetFriendRenderContext() }) : u.createElement(P, { groupView: this.props.groupView, inactive: this.props.inactive, context: this.GetFriendRenderContext() })),
u.createElement("div", { className: "disconnectBlocker" }),
)
);
}
};
(0, i.gn)([C.ak], M.prototype, "OnMemberListToggleViewClick", null), (0, i.gn)([C.ak], M.prototype, "OnSearchInput", null), (0, i.gn)([C.ak], M.prototype, "OnSearchSubmit", null), (0, i.gn)([C.ak], M.prototype, "OnSearchKeyDown", null), (0, i.gn)([C.ak], M.prototype, "OnClearSearch", null), (0, i.gn)([C.ak], M.prototype, "OnSearchFocus", null), (0, i.gn)([C.ak], M.prototype, "OnSearchBlur", null), (M = (0, i.gn)([_.Pi], M));
let k = class extends u.Component {
GetFriendRenderContext() {
let e = this.props.groupView.GetGroup();
return (this.m_renderContext && this.m_renderContext.group == e) || (this.m_renderContext = { group: e, chatContext: "chatmemberlistselection" }), this.m_renderContext;
}
GetMembersMatchingSearch(e) {
let t = N(this.props.groupView.GetGroup().memberList.member_list, e);
return t.sort(g.Xp.DefaultFriendSortComparator), t;
}
OnSearchInput(e) {
this.props.groupView.UpdateMemberSearch(e.currentTarget.value);
}
OnSearchSubmit(e) {
e.preventDefault();
let t = this.props.groupView,
n = t.normalizedMemberSearch;
if (n && n.length) {
let t = this.GetMembersMatchingSearch(n);
t.length && t[0].OpenChatDialog((0, d.Um)(this, e));
}
t.ClearMemberSearch();
}
OnSearchKeyDown(e) {
27 == e.keyCode && (e.preventDefault(), e.currentTarget.blur(), this.props.groupView.ClearMemberSearch());
}
OnClearSearch() {
this.props.groupView.ClearMemberSearch();
}
OnSearchFocus() {
this.props.groupView.UpdateMemberSearch(this.props.groupView.GetMemberSearch());
}
OnSearchBlur() {
0 == this.props.groupView.GetMemberSearch().length && this.props.groupView.ClearMemberSearch();
}
render() {
let e = this.props.groupView,
t = e.GetMemberSearch(),
n = "MemberListOptionsContainer";
e.IsMemberSearchActive() && (n += " SearchActive");
const i = (e) => ({
onActivate: (t) => {
e.OpenChatDialog((0, d.Um)(null, t)), this.props.onAction();
},
onOKActionDescription: (0, y.Xx)("#Friend_Menu_SendMessage"),
});
return u.createElement(
D.s,
{ className: "GamepadMode MemberListColumn", "flow-children": "column" },
u.createElement(
R.e,
null,
u.createElement("div", { className: n }, u.createElement("form", { className: "socialInputContainer", name: "friendSearchForm", onSubmit: this.OnSearchSubmit }, u.createElement(D.s, { className: "inputContainer no-drag", "flow-children": "row" }, u.createElement(w.bX, { className: "friendSearchInput", type: "text", name: "memberlistSearch", placeholder: (0, y.Xx)("#SearchByName"), value: t, onChange: this.OnSearchInput, onKeyDown: this.OnSearchKeyDown, onFocus: this.OnSearchFocus, onBlur: this.OnSearchBlur, autoComplete: "off" }), e.has_search_error ? u.createElement("div", { className: "friendSearchError", title: (0, y.Xx)("#SearchError") }, u.createElement(p.ge, { color: "red" })) : u.createElement(D.s, { className: "friendSearchClear", onActivate: this.OnClearSearch }, u.createElement(p.pVO, null))))),
u.createElement(D.s, { style: { display: "flex", flex: 1, position: "relative", minHeight: "300px" }, "flow-children": "column" }, e.GetGroup().BIsMemberListVirtualized() ? u.createElement(G, { groupView: this.props.groupView, inactive: this.props.inactive, context: this.GetFriendRenderContext(), fnGetPanelProps: i }) : u.createElement(P, { groupView: this.props.groupView, inactive: this.props.inactive, context: this.GetFriendRenderContext(), fnGetPanelProps: i })),
u.createElement("div", { className: "disconnectBlocker" }),
),
);
}
};
function T(e) {
return e ? 36 : 28;
}
function L(e) {
return e ? 44 : 36;
}
(0, i.gn)([C.ak], k.prototype, "OnSearchInput", null), (0, i.gn)([C.ak], k.prototype, "OnSearchSubmit", null), (0, i.gn)([C.ak], k.prototype, "OnSearchKeyDown", null), (0, i.gn)([C.ak], k.prototype, "OnClearSearch", null), (0, i.gn)([C.ak], k.prototype, "OnSearchFocus", null), (0, i.gn)([C.ak], k.prototype, "OnSearchBlur", null), (k = (0, i.gn)([_.Pi], k));
let G = class extends u.Component {
render() {
const { groupView: e } = this.props,
t = e.IsMemberSearchActive() && void 0 !== e.search_results;
return u.createElement(A, null, ({ height: e, width: n }) => (t ? u.createElement(F, Object.assign({}, this.props, { width: n, height: e })) : u.createElement(O, Object.assign({}, this.props, { width: n, height: e }))));
}
};
G = (0, i.gn)([_.Pi], G);
let O = class extends u.Component {
render() {
var e;
const { width: t, height: n, groupView: i, context: o, fnGetPanelProps: r } = this.props,
a = i.GetGroup().memberCountTotal;
let s = this.props.groupView.GetVirtualizedMemberListView();
return s.GetViewChangenumber(), u.createElement(S.t7, { width: t, height: n, itemCount: a, itemSize: L(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI), overscanCount: 10, onItemsRendered: this.OnItemsRendered, itemKey: (e) => s.GetAccountIDAt(e) || e, style: { overflowX: "hidden" } }, (e) => u.createElement(B, Object.assign({}, e, { virtualizer: s, groupView: i, context: o, fnGetPanelProps: r })));
}
OnItemsRendered(e) {
this.props.groupView.GetVirtualizedMemberListView().SetViewExtents(e.visibleStartIndex, e.visibleStopIndex);
}
};
(O.contextType = l.E_), (0, i.gn)([C.ak], O.prototype, "OnItemsRendered", null), (O = (0, i.gn)([_.Pi], O));
let F = class extends u.Component {
render() {
var e;
const { width: t, height: n, groupView: i, context: o, fnGetPanelProps: r } = this.props,
a = i.search_results.length;
return u.createElement(S.t7, { width: t, height: n, itemCount: a, itemSize: L(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI), overscanCount: 10, itemKey: (e) => i.search_results[e].friend.accountid, style: { overflowX: "hidden" } }, (e) => u.createElement(x, Object.assign({}, e, { player: i.search_results[e.index].friend, groupView: i, context: o, fnGetPanelProps: r })));
}
};
(F.contextType = l.E_), (F = (0, i.gn)([_.Pi], F));
class B extends u.Component {
render() {
const { index: e, style: t, virtualizer: n, groupView: i, context: o, fnGetPanelProps: r } = this.props,
a = n.GetAccountIDAt(e);
if (!a) return null;
const s = n.GetMember(a);
return s ? u.createElement(x, { player: s, groupView: i, style: t, context: o, fnGetPanelProps: r }) : null;
}
}
const x = ({ style: e, player: t, groupView: n, className: i, bHideGameName: o, context: r, fnGetPanelProps: a }) => {
let s = (0, l.id)(),
c = a ? a(t) : {};
return u.createElement(D.s, Object.assign({ style: Object.assign(Object.assign({}, e), { height: `${L(s)}px` }) }, c, { className: i }), u.createElement(V, { friend: t, bHideGameName: o, groupView: n, context: r }));
};
function N(e, t) {
return e.filter((e) => e.BMatchesSearchString(t, !1));
}
let P = class extends u.Component {
constructor(e) {
super(e), (this.state = { collapsedBuckets: {} }), (this.m_disposeGetMemberList = m.Ul.GroupMemberStore.RegisterForGroupMemberList(this.OnMemberListChanged, e.groupView.GetGroup().GetGroupID()));
}
OnMemberListChanged() {
this.forceUpdate();
}
componentWillUnmount() {
this.m_disposeGetMemberList.unregister();
}
SortedPlayerSortFunc(e, t) {
return e.display_name.localeCompare(t.display_name);
}
BuildFilteredBuckets(e, t) {
let n = [];
for (let i of e) {
let e = N(i.member_list, t);
if (e.length > 0) {
let t = new b.$x(i.id, this.SortedPlayerSortFunc, () => {});
t.SetMembers(e), n.push(t);
}
}
return n;
}
render() {
var e;
const { inactive: t, groupView: n, context: i, fnGetPanelProps: o } = this.props,
{ collapsedBuckets: r } = this.state;
if (t) return null;
let a = m.Ul.GroupMemberStore.GetGroupMemberList(n.GetGroup().GetGroupID());
if (0 == a.length) return null;
let s = n.normalizedMemberSearch;
s.length > 0 && (a = this.BuildFilteredBuckets(a, s));
const l = (e, t, r) => {
const s = a[e],
l = s.id === b.TN ? "partybeacon" : "regular";
return u.createElement(x, { style: r, className: `chatroomBucket_${l}`, bHideGameName: s.BIsGameGroup(), groupView: n, player: s.member_list[t], context: i, fnGetPanelProps: o });
},
c = (e, t) => {
const n = a[e],
i = r[n.id];
return u.createElement(U, { collapsible: a.length > 1, collapsed: i, memberCount: n.member_list.length, name: n.name, onCollapseChanged: () => this.setState({ collapsedBuckets: Object.assign(Object.assign({}, r), { [n.id]: !i }) }), style: t });
},
d = null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI;
return u.createElement(
"div",
{ className: (0, E.Z)(!d && "CompactFriendsList", "chatRoomMembers", "groupMemberList") },
u.createElement(
"div",
{ className: "friendGroup", style: { width: "100%", height: "100%" } },
u.createElement(
"div",
{ className: "ChatRoomMemberScrollList_List", style: { width: "100%", height: "100%", boxSizing: "border-box" } },
u.createElement(A, null, ({ width: e, height: t }) => u.createElement(H, { width: e, height: t, buckets: a.map((e) => (r[e.id] ? [] : e.member_list)), itemSize: L(d), estimatedItemSize: L(d), renderBucketHeader: c, bucketHeaderSize: T(d), itemKey: (e, t) => a[e].member_list[t].accountid }, l)),
),
),
);
}
};
(P.contextType = l.E_), (0, i.gn)([C.ak], P.prototype, "OnMemberListChanged", null), (P = (0, i.gn)([_.Pi], P));
class U extends u.PureComponent {
render() {
const { collapsed: e, collapsible: t, onCollapseChanged: n, style: i, memberCount: o, name: r } = this.props;
return u.createElement("div", { className: (0, E.Z)("groupName", e && "Collapsed"), onClick: () => t && n(), style: i }, u.createElement("div", { className: "groupIcon" }, u.createElement(p.ZAu, null)), t && u.createElement("div", { className: "ExpandPlusMinus" }, u.createElement(p.FUf, null)), u.createElement("span", { className: "groupCountCollapsed" }, o), u.createElement("div", { className: "groupLabelsContainer" }, u.createElement("span", { className: "groupNameLabel" }, r), u.createElement("span", { className: "groupCount" }, "(", o, ")")));
}
}
let V = class extends u.Component {
OnFriendSelected(e, t) {
this.props.friend.OpenChatDialog((0, d.Um)(null, t)), this.props.groupView.ClearMemberSearch();
}
render() {
const { friend: e, groupView: t, context: n, bHideGameName: i } = this.props;
let o = [],
r = "",
a = t.GetGroup(),
s = t.isMemberListExpanded,
c = a.GetMemberRank(e.accountid),
m = e.efriendrelationship;
switch (c) {
default:
break;
case 30:
r = "Moderator";
break;
case 40:
r = "Officer";
break;
case 50:
(r = "Owner"), a.BIsClanChatRoom() || o.push(u.createElement("div", { key: "rankIcon", className: "rankIcon rankOwner" + (e.is_friend ? " isFriend" : "") }, u.createElement(p._OD, null)));
}
switch ((a.BIsClanChatRoom() && (c >= 40 ? o.push(u.createElement("div", { key: "rankIcon", className: "rankIcon rankOwner" }, u.createElement("img", { src: l.De.COMMUNITY_CDN_URL + "public/images/skin_1/comment_modindicator_officer.png" }))) : c >= 30 && o.push(u.createElement("div", { key: "rankIcon", className: "rankIcon rankOwner" }, u.createElement("img", { src: l.De.COMMUNITY_CDN_URL + "public/images/skin_1/comment_modindicator_moderator.png" })))), m)) {
case 3:
case 6:
o.push(u.createElement("div", { key: "friendIcon", className: "chatMemberFriendIcon" }, u.createElement(p.Fsn, null)));
break;
case 2:
o.push(u.createElement("div", { key: "friendIcon", className: "chatMemberFriendIcon" }, u.createElement(p.Fsn, { bPending: !0 })));
}
a.GetMemberPartyBeacon(e.accountid) && o.push(u.createElement("div", { key: "playIcon", className: "chatMemberPartyBeaconIcon" }, u.createElement(p.shV, null)));
let d = { friend: e, context: n, className: r, action: this.OnFriendSelected, bHideGameName: i, noActions: "chatmemberlistselection" == n.chatContext };
return s ? u.createElement(f.mo, Object.assign({}, d, { listStatusIndicatorLeft: o })) : u.createElement(f.o2, Object.assign({}, d), o);
}
};
(0, i.gn)([C.ak], V.prototype, "OnFriendSelected", null), (V = (0, i.gn)([_.Pi], V));
class H extends u.Component {
constructor() {
super(...arguments), (this.m_memoizedIndices = {}), (this.m_ref = u.createRef());
}
componentDidUpdate(e) {
var t;
const { renderBucketFooter: n, renderBucketHeader: i } = this.props,
o = n || i;
e.buckets.length != this.props.buckets.length && (null === (t = this.m_ref) || void 0 === t ? void 0 : t.current) && o && this.m_ref.current.resetAfterIndex(0, !0);
}
render() {
this.m_memoizedIndices = {};
const { width: e, height: t, children: n, renderBucketFooter: i, renderBucketHeader: o, buckets: r } = this.props;
let a = r.reduce((e, t) => e + t.length, 0);
return (
o && (a += r.length),
i && (a += r.length),
u.createElement(S.S_, { width: e, height: t, itemCount: a, itemSize: this.CalculateItemHeight, itemKey: this.ItemKey, ref: this.m_ref, style: { overflowX: "hidden" } }, (e) => {
const { bucket: t, item: r } = this.RawToRelativeIndex(e.index);
return "header" === r ? o(t, e.style) : "footer" === r ? i(t, e.style) : n(t, r, e.style);
})
);
}
ItemKey(e) {
const { itemKey: t } = this.props,
{ bucket: n, item: i } = this.RawToRelativeIndex(e);
return "header" === i || "footer" === i ? `${n}_${i}_${e}` : t(n, i);
}
CalculateItemHeight(e) {
const { bucket: t, item: n } = this.RawToRelativeIndex(e),
{ bucketHeaderSize: i, bucketFooterSize: o, itemSize: r } = this.props;
return "header" === n ? ("function" == typeof i ? i(t) : "number" == typeof i ? i : (console.warn("[VirtualizedBucketList]: Header found but no header size provided!"), 0)) : "footer" === n ? ("function" == typeof o ? o(t) : "number" == typeof o ? o : (console.warn("[VirtualizedBucketList]: Footer found but no footer size provided!"), 0)) : "function" == typeof r ? r(t, n) : r;
}
RawToRelativeIndex(e) {
if (this.m_memoizedIndices[e]) return this.m_memoizedIndices[e];
if (this.m_memoizedIndices[e - 1]) {
const t = this.CalculateNextRelativeIndex(this.m_memoizedIndices[e - 1]);
return (this.m_memoizedIndices[e] = t), t;
}
return (this.m_memoizedIndices[e] = this.InternalRawToRelativeIndex(e)), this.m_memoizedIndices[e];
}
InternalRawToRelativeIndex(e) {
const { buckets: t, renderBucketHeader: n, renderBucketFooter: i } = this.props;
let o = 0,
r = n ? -1 : 0;
for (; e > 0; ) {
if (!(e > t[o].length + (i ? 1 : 0))) {
r += e;
break;
}
(e -= t[o].length + (i ? 1 : 0) + (n ? 1 : 0)), o++;
}
return -1 === r ? { bucket: o, item: "header" } : r === t[o].length ? { bucket: o, item: "footer" } : { bucket: o, item: r };
}
CalculateNextRelativeIndex(e) {
const { buckets: t, renderBucketFooter: n, renderBucketHeader: i } = this.props,
{ bucket: o, item: r } = e,
a = !!i,
s = !!n;
return "header" === r ? (t[o].length ? { bucket: o, item: 0 } : s ? { bucket: o, item: "footer" } : { bucket: o + 1, item: "header" }) : "footer" === r ? { bucket: o + 1, item: a ? "header" : 0 } : r < t[o].length - 1 ? { bucket: o, item: r + 1 } : s ? { bucket: o, item: "footer" } : { bucket: o + 1, item: a ? "header" : 0 };
}
}
(0, i.gn)([C.ak], H.prototype, "ItemKey", null), (0, i.gn)([C.ak], H.prototype, "CalculateItemHeight", null);
var W = n(3276),
X = n(31695),
j = n(618),
z = n(71061),
K = n(41370),
q = n(58908),
Z = n(46421),
Q = n(88669),
$ = n(93635),
Y = n(59702),
J = n(90406),
ee = n(60176),
te = n(68730),
ne = n(74915),
ie = n(41111),
oe = n(34268),
re = n(85516),
ae = n(10237),
se = n.n(ae),
le = n(31075),
ce = n(62860),
me = n(10553),
de = n(33690);
const he = u.lazy(() => Promise.all([n.e(5140), n.e(4679)]).then(n.bind(n, 32611))),
ue = 1e4,
pe = 6e4;
let _e = class extends u.Component {
constructor(e) {
super(e), (this.m_msWentInactive = 0), (this.m_bShownTabIsGroupChat = !0), (this.m_keyEventListener = "keydown"), (this.m_refBroadcastContainer = u.createRef()), (this.state = { dropToInviteFriend: void 0, bShowBothChats: !1 }), this.props.popup && this.props.popup.addEventListener(this.m_keyEventListener, this.OnHTMLKeyEvent);
}
OnDragEnter(e, t) {
if (((0, $.X)((e && "friend" == e.type) || t, "Invalid data type passed to ChatRoomGroupDialog.OnDragEnter"), e)) {
let t = e;
t.friend && t.sourceContext.group != this.props.groupView.GetGroup() && this.setState({ dropToInviteFriend: t.friend });
}
return !0;
}
OnDragLeave() {
this.state.dropToInviteFriend && this.setState({ dropToInviteFriend: void 0 });
}
OnDragOver(e) {
e.dataTransfer.dropEffect = "move";
}
OnDrop(e, t) {
(0, $.X)((e && "friend" == e.type) || 0 != t.dataTransfer.files.length, "Invalid data type passed to ChatRoomGroupDialog.OnDrop");
let n = this.props.groupView.GetChatView();
if (e && "friend" == e.type) {
let n = e;
if (n.friend) {
this.state.dropToInviteFriend && this.setState({ dropToInviteFriend: void 0 }), d.g_FriendsUIDesktopApp.DragDropManager.SetDropConsumed();
let e = t.currentTarget.ownerDocument.defaultView;
n.sourceContext.group != this.props.groupView.GetGroup() && (0, ee.cl)({ invitee: n.friend, chatview: null, invitedto: this.props.groupView.GetGroup() }, (0, d.Um)(this, t), e);
}
} else if (0 != t.dataTransfer.files.length) {
let e = t.dataTransfer.files[0];
n.SetFileToUpload(e);
}
}
componentDidUpdate(e) {
e.isActive && !this.props.isActive ? this.OnBecameInactive() : this.props.isActive && this.OnBecameActive();
}
OnBecameInactive() {
(this.m_msWentInactive = performance.now()), (this.m_iIntervalInactive = SetBackgroundTimeout(this.forceUpdate.bind(this), 10100)), (this.m_iIntervalVeryInactive = SetBackgroundTimeout(this.forceUpdate.bind(this), 60100));
}
OnBecameActive() {
(this.m_msWentInactive = 0), this.ClearIntervals();
}
GetTitleBarDragDropProps() {
let e = { rgAcceptedTypes: [], bAcceptsFiles: !0 };
return (e.fnDrop = this.OnDrop), e;
}
GetChatBodyDragDropProps() {
let e = { rgAcceptedTypes: ["friend"], bAcceptsFiles: !0 };
return (e.fnDragEnter = this.OnDragEnter), (e.fnDragLeave = this.OnDragLeave), (e.fnDragOver = this.OnDragOver), (e.fnDrop = this.OnDrop), e;
}
ClearIntervals() {
this.m_iIntervalInactive && (ClearBackgroundTimeout(this.m_iIntervalInactive), (this.m_iIntervalInactive = void 0)), this.m_iIntervalVeryInactive && (ClearBackgroundTimeout(this.m_iIntervalVeryInactive), (this.m_iIntervalVeryInactive = void 0));
}
OnHTMLKeyEvent(e) {
if (l.De.IN_CLIENT && this.props.isActive && e.altKey && !e.ctrlKey && !e.shiftKey) {
const { groupView: t } = this.props;
if (!t) return;
38 === e.keyCode && t.SelectPreviousChannel(), 40 === e.keyCode && t.SelectNextChannel();
}
}
componentDidMount() {
(this.props.popup ? this.props.popup : window).addEventListener("resize", this.OnLayoutChange);
}
componentWillUnmount() {
this.ClearIntervals(), this.props.popup && this.props.popup.removeEventListener(this.m_keyEventListener, this.OnHTMLKeyEvent);
(this.props.popup ? this.props.popup : window).removeEventListener("resize", this.OnLayoutChange);
}
CalculateBroadcastSectionStyles(e) {
if (this.props.groupView.m_bChatHidden) return { width: "100%", height: "100%" };
const { nWatchPartyBroadcastHeightPercentage: t, nWatchPartyBroadcastWidthPercentage: n } = d.g_FriendsUIDesktopApp.UIDisplayPrefs,
i = {};
if (e) {
const e = t || 66;
if (((i.height = `${e}%`), this.m_elMainContent)) {
const { clientWidth: t, clientHeight: n } = this.m_elMainContent,
o = (9 / 16) * t + 50,
r = (0, Y.Lh)(e, 1, (o / n) * 100);
i.height = `${r}%`;
}
} else (i.width = n ? `${n}%` : "66%"), (i.overflowY = "auto");
return i;
}
ShouldShowVerticalBroadcastChat() {
return void 0 !== this.props.groupView.m_bShowVerticalBroadcastChat ? this.props.groupView.m_bShowVerticalBroadcastChat : !!this.m_elMainContent && this.m_elMainContent.clientHeight / this.m_elMainContent.clientWidth > 5 / 7;
}
OnLayoutChange() {
this.forceUpdate();
}
OnGrabberMouseDown(e) {
let t = e.currentTarget.ownerDocument.defaultView;
t.addEventListener("mousemove", this.HandleMouseMove), t.addEventListener("mouseup", this.UnregisterDragEvents), this.setState({ bDraggingChatGrabber: !0 });
}
HandleMouseMove(e) {
e.preventDefault(), e.stopPropagation();
let t = this.m_refBroadcastContainer.current.getBoundingClientRect(),
n = this.m_refBroadcastContainer.current.parentElement.getBoundingClientRect();
const i = this.ShouldShowVerticalBroadcastChat(),
o = i ? t.top : t.left,
r = i ? e.clientY : e.clientX,
a = i ? n.height : n.width,
s = (0, Y.Lh)(((r - o) / a) * 100, 1, 100),
l = i ? "nWatchPartyBroadcastHeightPercentage" : "nWatchPartyBroadcastWidthPercentage";
d.g_FriendsUIDesktopApp.SetUIDisplayPref(l, s);
}
UnregisterDragEvents(e) {
e.view.removeEventListener("mousemove", this.HandleMouseMove), e.view.removeEventListener("mouseup", this.UnregisterDragEvents), this.setState({ bDraggingChatGrabber: !1 });
}
OnLocalStreamChange(e) {
this.props.groupView.SetLocalBroadcastId(e);
}
HideChat() {
this.props.groupView.SetChatHidden(!0);
}
ShowChat() {
this.props.groupView.SetChatHidden(!1);
}
ToggleVerticalBroadcastChat() {
this.props.groupView.SetVerticalBroadcastChat(!this.ShouldShowVerticalBroadcastChat()), this.props.groupView.SetChatHidden(!1);
}
SetMainContentRef(e) {
(this.m_elMainContent = e), this.OnLayoutChange();
}
ToggleShowBothChats() {
this.state.bShowBothChats ? this.m_bShownTabIsGroupChat && this.state.bShowBothChats && this.props.groupView.SetGlobalBroadcastChatShown(!1) : ((this.m_bShownTabIsGroupChat = !this.props.groupView.m_bShowGlobalChat), this.props.groupView.SetGlobalBroadcastChatShown(!0)), this.setState({ bShowBothChats: !this.state.bShowBothChats });
}
ToggleVoiceChat() {
let e = this.props.groupView,
t = e.GetGroup(),
n = e.GetSelectedChatView().chat;
m.Ul.VoiceStore.IsVoiceActiveForGroup(t.GetGroupID()) ? m.Ul.VoiceStore.OnUserEndVoiceChat() : n.BIsVoiceAllowed() && (0, r.AM)(u.createElement(fe, { groupView: e }), this.props.popup);
}
RenderInnerChatTabs() {
const e = this.props.groupView,
t = e.GetGroup();
return u.createElement(
"div",
{ className: "ChatBodyControls" },
u.createElement("div", { className: "Close", onClick: this.HideChat, title: (0, y.Xx)("#Broadcast_View_HideChat") }, u.createElement(p.QlI, { showChat: !1 })),
u.createElement("div", { className: "InnerChatTabs" }, u.createElement("div", { className: (0, E.Z)("InnerChatTab", !e.m_bShowGlobalChat && "Active"), onClick: () => e.SetGlobalBroadcastChatShown(!1) }, u.createElement(z.TJ, { group: t }), u.createElement(j._P, { group: t, micro: !0 }), u.createElement("span", { className: "InnerChatTabLabel" }, (0, y.Xx)("#Broadcast_Chat_GroupChatTab", t.name))), (!this.state.bShowBothChats || (this.state.bShowBothChats && this.ShouldShowVerticalBroadcastChat())) && u.createElement("div", { className: (0, E.Z)("InnerChatTab", e.m_bShowGlobalChat && "Active"), onClick: () => e.SetGlobalBroadcastChatShown(!0) }, u.createElement(p.THo, null), u.createElement("span", { className: "InnerChatTabLabel" }, (0, y.Xx)("#Broadcast_Chat_PublicChatTab")))),
u.createElement("div", { className: "showBothTabs", onClick: this.ToggleShowBothChats, title: (0, y.Xx)(this.state.bShowBothChats ? "#Broadcast_View_ShowSingleChats" : "#Broadcast_View_ShowBothChats") }, u.createElement(p.chI, null)),
);
}
render() {
var e;
if (this.props.bSteamDeck) return this.renderSteamDeck();
if (!this.props.groupView || !this.props.groupView.GetChatView()) return null;
let t = this.props.groupView.GetGroup(),
n = this.props.groupView,
i = n.GetSelectedChatView(),
o = n.GetPopoverChatView(),
r = i.chat,
a = this.state.bShowBothChats && n.isBroadcastShown,
s = n.m_bShowGlobalChat,
c = (s && a) || (!s && !a),
d = (a && n.isBroadcastShown) || (!a && s),
_ = this.state.dropToInviteFriend ? u.createElement(ee.RQ, { chatView: i, friend: this.state.dropToInviteFriend }) : null,
g = !1,
C = null,
f = this.ShouldShowVerticalBroadcastChat(),
v = n.m_bChatHidden,
S = 4;
if ((l.De.STEAM_TV && (S = 2), t.watching_broadcast_steamid && n.isBroadcastShown)) {
const e = this.CalculateBroadcastSectionStyles(f),
i = u.createElement(he, { ref: this.m_refBroadcastContainer, steamID: t.watching_broadcast_steamid.ConvertTo64BitString(), localSteamID: n.m_strLocalBroadcastId, watchLocation: S, bWebRTC: !1, onRequestClose: n.HideBroadcast, onLocalStreamChange: this.OnLocalStreamChange, actions: [u.createElement("div", { key: "ChatPosToggle", onClick: this.ToggleVerticalBroadcastChat, title: `${f ? (0, y.Xx)("#Broadcast_View_Stack_H") : (0, y.Xx)("#Broadcast_View_Stack_V")}`, className: "BroadcastChatPositionToggle " + (f ? "right" : "bottom") })], style: e, onTheaterMode: n.ToggleTheaterModeBroadcastChat, bVerticalBroadcastChat: !f });
(C = u.createElement(u.Fragment, null, i, !v && u.createElement("div", { className: "BroadcastChatDivider " + (f ? "vertical" : "horizontal"), onMouseDown: this.OnGrabberMouseDown }), v && u.createElement(ee.tD, { onClick: this.ShowChat, edge: f ? "bottom" : "right" }))), (g = !0);
} else g = !1;
let b = !1,
I = !1,
E = {};
if (!this.props.isActive) {
E.display = "none";
let e = this.m_msWentInactive ? performance.now() - this.m_msWentInactive : pe;
e >= ue && (b = !0), e >= pe && !C && (I = !0);
}
let w = "chatWindow MultiUserChat",
R = "ChatRoomGroupDialog_contents";
o && (R += " InsetWindowOpen"), a && (R += " BothChatsDisplayed"), t.IsNamedGroupChat() && (w += " namedGroup");
let A = "chatBody";
this.state.dropToInviteFriend && (A = "chatBody chatRoomActiveDrop"), m.Ul.SettingsStore.FriendsSettings.bCompactFriendsList && (w += " compactView"), g && (w += " broadcastVisible");
let k = null;
this.props.bHideMemberList || (k = u.createElement(M, { groupView: this.props.groupView, inactive: b }));
const T = this.props.bHideMessageInput || (n.isBroadcastShown && ((!a && n.m_bShowGlobalChat) || v)) ? null : u.createElement(de._9.Consumer, null, (e) => u.createElement(W.$, { key: r.unique_id, chatView: n.GetActiveChatView(), isActive: this.props.isActive, disabled: !1, ownerWindow: e.ownerWindow }));
let L,
G = u.createElement(h.R, Object.assign({ "flow-children": "column", style: E, className: "chatHistoryAndMembers" }, this.GetChatBodyDragDropProps()), u.createElement(q.Z, null, _), u.createElement("div", { className: "displayColumn fullWidth" }, u.createElement(D.s, { "flow-children": "row", className: "displayRow minHeightZero", navEntryPreferPosition: ce.c4.PREFERRED_CHILD }, u.createElement("div", { className: "ChatRoomGroupDialog_history" }, m.Ul.UIStore.show_winter_sale_ui && !m.Ul.SettingsStore.FriendsSettings.bDisableRoomEffects && u.createElement(J.x, { effectManager: r.RoomEffectManager() }), u.createElement(ne.w, { chatView: i, isActive: this.props.isActive }), u.createElement(q.Z, null, u.createElement(ee.R5, { groupView: n }))), u.createElement("div", { className: "dropTargetBox" }), k), T));
if (t.watching_broadcast_steamid && n.isBroadcastShown) {
const e = u.createElement(Z.c, { emoticonStore: m.Ul.ChatStore.EmoticonStore, steamID: t.watching_broadcast_steamid.ConvertTo64BitString(), broadcastID: "0", watchLocation: S, hidden: !n.m_bShowGlobalChat, className: this.state.bDraggingChatGrabber ? "avoidEvents" : void 0 });
L = u.createElement(u.Fragment, null, e);
}
let O = "chatStack " + (f ? "displayRow" : "displayColumn");
return (
d && (O += " GlobalChatVisible"),
c && (O += " GroupChatVisible"),
u.createElement(
h.R,
Object.assign({ fnCanTakeFocus: () => this.props.isActive, "flow-children": "column", "data-activechat": this.props.isActive, style: E, className: w }, this.GetTitleBarDragDropProps()),
!I && !this.props.bHideHeader && !(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) && u.createElement("div", { className: "chatHeader titleBarContainer" }, u.createElement("div", { className: "chatHeaderGradient" }), u.createElement(j.oY, { groupView: n }), u.createElement("div", { className: "disconnectBlocker" })),
!I &&
u.createElement(
Se,
{ className: R, readyToRender: t.readyToRender },
u.createElement(te.T, { groupView: n, inactive: b }),
u.createElement("div", { className: "ChatRoomGroup_MainAndChatEntry displayColumn", ref: this.SetMainContentRef }, u.createElement("div", { className: "ChatRoomGroup_Main_ContentAndMembers displayRow" }, u.createElement("div", { className: `ChatRoomGroup_Main_Content ${f ? "Vertical" : "Horizontal"} ${v ? "chatHidden" : ""}` }, C, (!n.m_bChatHidden || !n.isBroadcastShown) && u.createElement("div", { className: A }, n.isBroadcastShown && this.RenderInnerChatTabs(), u.createElement("div", { className: O }, G, a && u.createElement("div", { className: "BothChatsSeperator" }), a && !this.ShouldShowVerticalBroadcastChat() && u.createElement("div", { className: "InnerChatTab", onClick: () => n.SetGlobalBroadcastChatShown(!0) }, u.createElement(p.THo, null), u.createElement("span", { className: "InnerChatTabLabel" }, (0, y.Xx)("#Broadcast_Chat_PublicChatTab"))), L), !c && n.isBroadcastShown && T)))),
),
)
);
}
renderSteamDeck() {
var e;
if (!this.props.groupView || !this.props.groupView.GetChatView()) return null;
let t = this.props.groupView.GetGroup(),
n = this.props.groupView,
i = n.GetSelectedChatView(),
o = n.GetPopoverChatView(),
r = i.chat,
a = this.state.bShowBothChats && n.isBroadcastShown,
s = n.m_bShowGlobalChat,
c = (s && a) || (!s && !a),
d = (a && n.isBroadcastShown) || (!a && s),
_ = this.state.dropToInviteFriend ? u.createElement(ee.RQ, { chatView: i, friend: this.state.dropToInviteFriend }) : null,
g = !1,
C = null,
f = this.ShouldShowVerticalBroadcastChat(),
v = n.m_bChatHidden,
S = 4;
if ((l.De.STEAM_TV && (S = 2), t.watching_broadcast_steamid && n.isBroadcastShown)) {
const e = this.CalculateBroadcastSectionStyles(f),
i = u.createElement(he, { ref: this.m_refBroadcastContainer, steamID: t.watching_broadcast_steamid.ConvertTo64BitString(), localSteamID: n.m_strLocalBroadcastId, watchLocation: S, bWebRTC: !1, onRequestClose: n.HideBroadcast, onLocalStreamChange: this.OnLocalStreamChange, actions: [u.createElement("div", { key: "ChatPosToggle", onClick: this.ToggleVerticalBroadcastChat, title: `${f ? (0, y.Xx)("#Broadcast_View_Stack_H") : (0, y.Xx)("#Broadcast_View_Stack_V")}`, className: "BroadcastChatPositionToggle " + (f ? "right" : "bottom") })], style: e, onTheaterMode: n.ToggleTheaterModeBroadcastChat, bVerticalBroadcastChat: !f });
(C = u.createElement(u.Fragment, null, i, !v && u.createElement("div", { className: "BroadcastChatDivider " + (f ? "vertical" : "horizontal"), onMouseDown: this.OnGrabberMouseDown }), v && u.createElement(ee.tD, { onClick: this.ShowChat, edge: f ? "bottom" : "right" }))), (g = !0);
} else g = !1;
let b = !1,
I = !1,
E = {};
if (!this.props.isActive) {
E.display = "none";
let e = this.m_msWentInactive ? performance.now() - this.m_msWentInactive : pe;
e >= ue && (b = !0), e >= pe && !C && (I = !0);
}
let w = "chatWindow MultiUserChat";
i.IsFriendChat() || (w += " GroupChat");
let R = "ChatRoomGroupDialog_contents";
o && (R += " InsetWindowOpen"), a && (R += " BothChatsDisplayed"), t.IsNamedGroupChat() && (w += " namedGroup");
let A = "chatBody";
this.state.dropToInviteFriend && (A = "chatBody chatRoomActiveDrop"), m.Ul.SettingsStore.FriendsSettings.bCompactFriendsList && (w += " compactView"), g && (w += " broadcastVisible");
const M = this.props.bHideMessageInput || (n.isBroadcastShown && ((!a && n.m_bShowGlobalChat) || v)) ? null : u.createElement(de._9.Consumer, null, (e) => u.createElement(W.$, { key: r.unique_id, chatView: n.GetActiveChatView(), isActive: this.props.isActive, disabled: !1, ownerWindow: e.ownerWindow }));
let k,
T = u.createElement(D.s, { "flow-children": "column", style: E, className: "chatHistoryAndMembers" }, u.createElement(q.Z, null, _), u.createElement("div", { className: "displayColumn fullWidth" }, u.createElement(D.s, { "flow-children": "row", className: "displayRow minHeightZero", navEntryPreferPosition: ce.c4.PREFERRED_CHILD }, u.createElement("div", { className: "ChatRoomGroupDialog_history " + (r.GetVoiceAllowed() ? "voiceRoom" : "") }, m.Ul.UIStore.show_winter_sale_ui && !m.Ul.SettingsStore.FriendsSettings.bDisableRoomEffects && u.createElement(J.x, { effectManager: r.RoomEffectManager() }), u.createElement(ne.w, { chatView: i, isActive: this.props.isActive }), u.createElement(q.Z, null, u.createElement(ee.R5, { groupView: n }))), u.createElement(ve, { groupView: n })), M));
if (t.watching_broadcast_steamid && n.isBroadcastShown) {
const e = u.createElement(Z.c, { emoticonStore: m.Ul.ChatStore.EmoticonStore, steamID: t.watching_broadcast_steamid.ConvertTo64BitString(), broadcastID: "0", watchLocation: S, hidden: !n.m_bShowGlobalChat, className: this.state.bDraggingChatGrabber ? "avoidEvents" : void 0 });
k = u.createElement(u.Fragment, null, e);
}
let L = "chatStack " + (f ? "displayRow" : "displayColumn");
d && (L += " GlobalChatVisible"), c && (L += " GroupChatVisible");
let G = {};
m.Ul.VoiceStore.IsVoiceActiveForGroup(t.GetGroupID()) && ((G.onSecondaryButton = () => this.ToggleVoiceChat()), (G.onSecondaryActionDescription = (0, y.Xx)("#Chat_ChatRoomGroup_EndVoiceChat")));
return u.createElement(
h.R,
Object.assign({ fnCanTakeFocus: () => this.props.isActive, "flow-children": "row", "data-activechat": this.props.isActive, style: E, className: w }, this.GetTitleBarDragDropProps(), G),
u.createElement(
D.s,
{ "flow-children": "column", style: { display: "flex", flexDirection: "column", flex: 1 } },
!I && u.createElement("div", { className: "chatHeader titleBarContainer" }, u.createElement("div", { className: "chatHeaderGradient" }), u.createElement(j.UZ, { groupView: n }), u.createElement("div", { className: "disconnectBlocker" })),
!I &&
u.createElement(
Se,
{ className: R, readyToRender: t.readyToRender },
!1,
u.createElement(
"div",
{ className: "ChatRoomGroup_MainAndChatEntry displayColumn", ref: this.SetMainContentRef },
u.createElement("div", { className: "ChatRoomGroup_Main_ContentAndMembers displayRow" }, u.createElement(D.s, { className: `ChatRoomGroup_Main_Content ${f ? "Vertical" : "Horizontal"} ${v ? "chatHidden" : ""}`, "flow-children": "row" }, C, (!n.m_bChatHidden || !n.isBroadcastShown) && u.createElement("div", { className: A }, (null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) && u.createElement(X.R, null), n.isBroadcastShown && this.RenderInnerChatTabs(), u.createElement("div", { className: L }, T, a && u.createElement("div", { className: "BothChatsSeperator" }), a && !this.ShouldShowVerticalBroadcastChat() && u.createElement("div", { className: "InnerChatTab", onClick: () => n.SetGlobalBroadcastChatShown(!0) }, u.createElement(p.THo, null), u.createElement("span", { className: "InnerChatTabLabel" }, (0, y.Xx)("#Broadcast_Chat_PublicChatTab"))), k), !c && n.isBroadcastShown && M))),
),
),
),
);
}
};
(_e.contextType = me.E_),
(0, i.gn)([C.ak], _e.prototype, "OnDragEnter", null),
(0, i.gn)([C.ak], _e.prototype, "OnDragLeave", null),
(0, i.gn)([C.ak], _e.prototype, "OnDragOver", null),
(0, i.gn)([C.ak], _e.prototype, "OnDrop", null),
(0, i.gn)([C.ak], _e.prototype, "OnHTMLKeyEvent", null),
(0, i.gn)([C.ak], _e.prototype, "ShouldShowVerticalBroadcastChat", null),
(0, i.gn)([C.ak], _e.prototype, "OnLayoutChange", null),
(0, i.gn)([C.ak], _e.prototype, "OnGrabberMouseDown", null),
(0, i.gn)([C.ak], _e.prototype, "HandleMouseMove", null),
(0, i.gn)([C.ak], _e.prototype, "UnregisterDragEvents", null),
(0, i.gn)([C.ak], _e.prototype, "OnLocalStreamChange", null),
(0, i.gn)([C.ak], _e.prototype, "HideChat", null),
(0, i.gn)([C.ak], _e.prototype, "ShowChat", null),
(0, i.gn)([C.ak], _e.prototype, "ToggleVerticalBroadcastChat", null),
(0, i.gn)([C.ak], _e.prototype, "SetMainContentRef", null),
(0, i.gn)([C.ak], _e.prototype, "ToggleShowBothChats", null),
(0, i.gn)([C.ak], _e.prototype, "ToggleVoiceChat", null),
(_e = (0, i.gn)([_.Pi], _e));
const ge = (e) => {
let { groupView: t, className: n } = e,
r = (0, i._T)(e, ["groupView", "className"]);
u.useEffect(() => {
t.SetMemberListCollapsed(!1, !1);
});
let s = u.createElement(k, { groupView: t, inactive: !1, onAction: e.closeModal });
return u.createElement(a.RG, Object.assign({ className: se().GroupMemberListDialog }, r), u.createElement(o.h4, null, (0, y.Xx)("#Chat_MemberGroup_Online")), s, u.createElement(be, { closeModal: e.closeModal }));
},
Ce = (e) => {
let t,
{ groupView: n } = e,
r = (0, i._T)(e, ["groupView"]),
s = n.GetGroup(),
l = (s.IsNamedGroupChat(), n.GetGroup().textRoomList),
d = n.GetGroup().BCanAdminChannel(),
[h, p] = u.useState(n.GetActiveChatView().chat.GetRoomID()),
_ = m.Ul.ChatStore.GetActiveVoiceChat();
if (_ && _ instanceof c.K) {
let e = _;
e.GetParentGroupID() == s.GetGroupID() && (t = u.createElement(D.s, { className: se().VoiceChatQuickChatChannelOption }, (0, y.Xx)("#Chat_Scratch_Pad"), ":", u.createElement(te.MF, { key: _.unique_id, chat: _, bRenameActive: !1, bActiveChat: _ == n.GetActiveChatView().chat, bDefaultRoom: _ == n.GetGroup().GetDefaultChatRoom(), onFocus: () => p(e.GetRoomID()) })));
}
let g = l.map((e) => u.createElement(te.MF, { key: e.unique_id, chat: e, bRenameActive: n.IsRoomRenameActive(e.GetRoomID()), bActiveChat: e == n.GetActiveChatView().chat, bDefaultRoom: e == n.GetGroup().GetDefaultChatRoom(), onFocus: () => p(e.GetRoomID()) }));
const C = () => {
n.SelectChat(h), e.closeModal();
};
let f = { onOKButton: C };
return (
d &&
((f.onOptionsButton = (t) => {
(0, te.aP)((0, Q.RA)(t), n, !1), e.closeModal();
}),
(f.onOptionsActionDescription = (0, y.Xx)("#Chat_AddTextChat"))),
u.createElement(a.RG, Object.assign({ className: (0, E.Z)(se().ManageTextChannelsModal, "friendsui-container") }, r, { onOK: C }), u.createElement(R.e, null, u.createElement(o.h4, null, (0, y.Xx)("#GroupSettings_Channels_TextChannels")), u.createElement(D.s, Object.assign({ focusable: !1 }, f), t, g), u.createElement(be, { closeModal: e.closeModal })))
);
},
fe = (e) => {
let { groupView: t } = e,
n = (0, i._T)(e, ["groupView"]),
r = t.GetGroup(),
s = t.GetGroup().voiceRoomList,
l = (0, me.id)(),
[c, d] = u.useState(t.GetActiveChatView().chat),
h = s.filter((e) => 0 != e.voice_active_member_list.member_count),
_ = s.filter((e) => 0 == e.voice_active_member_list.member_count);
const g = null != m.Ul.ChatStore.GetActiveVoiceChat(),
C = (0, K.SZ)(() => m.Ul.ChatStore.VoiceChat.GetActiveVoiceChatID()),
f = () => {
C == c.GetRoomID() || (t.ClosePopoverChat(), c.StartVoiceChat()), l || e.closeModal();
};
let v = h.map((n) => {
const i = C == c.GetRoomID(),
o = (t) => {
e.closeModal(), (0, ie.oC)(m.D, t.currentTarget.ownerDocument.defaultView, r, n, !1);
};
let a;
return g && !i ? (a = (0, y.Xx)("#VoiceChat_Switch")) : i || (a = (0, y.Xx)("#VoiceChat_Join")), l ? u.createElement(le.J, { key: n.unique_id, context: m.D, chatRoom: n, fnOKButton: i ? void 0 : f, fnSecondaryButton: i ? () => m.Ul.ChatStore.VoiceChat.OnUserEndVoiceChat() : void 0, fnOptionsButton: i ? o : void 0, fnOnFocus: () => d(n), fnCloseModal: e.closeModal, strOKActionDescription: a, strSecondaryActionDescription: i ? (0, y.Xx)("#VoiceChat_Leave") : void 0, strOptionsActionDescription: i ? (0, y.Xx)("#VoiceChat_InviteOthers") : void 0 }) : u.createElement(te.Cq, { key: n.unique_id, chat: n, bRenameActive: t.IsRoomRenameActive(n.GetRoomID()), onSelect: f, onFocus: () => d(n) });
}),
S = _.map((e) => (l ? u.createElement(le.J, { key: e.unique_id, context: m.D, chatRoom: e, fnOKButton: f, fnOnFocus: () => d(e), strOKActionDescription: (0, y.Xx)("#VoiceChat_Join") }) : u.createElement(te.Cq, { key: e.unique_id, chat: e, bRenameActive: t.IsRoomRenameActive(e.GetRoomID()), onSelect: f, onFocus: () => d(e) }))),
b = null;
if (!m.Ul.VoiceStore.IsVoiceActiveForGroup(r.GetGroupID())) {
const t = () => {
r.CreateAndJoinTempVoiceRoom(), l || e.closeModal();
};
b = u.createElement(u.Fragment, null, 0 == s.length && u.createElement(D.s, null, (0, y.Xx)("#GroupSettings_Channels_NoVoiceChannels")), u.createElement(D.s, { className: se().AddVoiceChannelBtn, onActivate: t }, u.createElement(p.hxK, null), (0, y.Xx)("#Chat_AddVoiceChat")));
}
return u.createElement(a.RG, Object.assign({ className: (0, E.Z)(se().ManageVoiceChannelsModal, "friendsui-container") }, n, { onOK: f }), u.createElement(R.e, null, u.createElement(o.h4, null, (0, y.Xx)("#GroupSettings_Channels_VoiceChannels")), u.createElement(D.s, { className: se().ManageVoiceChannels, focusable: !1, onOKButton: f }, b, 0 != v.length && u.createElement("div", { className: se().ChannelStatusLabel }, (0, y.Xx)("#GroupSettings_Channels_ActiveVoiceChannels")), 0 != v.length && u.createElement(D.s, { className: se().VoiceChannels }, v), 0 != S.length && u.createElement("div", { className: se().ChannelStatusLabel }, (0, y.Xx)("#GroupSettings_Channels_InactiveVoiceChannels")), 0 != S.length && u.createElement(D.s, { className: se().VoiceChannels }, S)), u.createElement(be, { closeModal: e.closeModal })));
},
ve = (0, _.Pi)((e) => {
let { groupView: t } = e;
const n = (0, de.Wy)();
let i = 0,
o = !1;
for (let e of t.GetGroup().voiceRoomList) 0 != e.voice_active_member_list.member_count && i++, e.BVoiceActive() && (o = !0);
let a = !1;
for (let e of t.GetGroup().textRoomList)
if (e.has_any_unread_messages) {
a = !0;
break;
}
return u.createElement(
D.s,
{ className: se().ChatRoomGroupControlsSteamDeck, "flow-children": "column" },
u.createElement(
D.s,
{
focusable: !0,
onActivate: (e) => {
(0, r.AM)(u.createElement(ge, { groupView: t }), (0, Q.RA)(e));
},
onOKActionDescription: (0, y.Xx)("#Chat_MemberGroup_Online"),
},
u.createElement(p.ZAu, null),
),
u.createElement(
D.s,
{
focusable: !0,
onActivate: (e) => {
(0, r.AM)(u.createElement(Ce, { groupView: t }), (0, Q.RA)(e));
},
onOKActionDescription: (0, y.Xx)("#GroupSettings_Channels_TextChannels"),
},
u.createElement(p.xg, { className: "SVGIcon_Button SVGIcon_CommentThread" }),
u.createElement("div", { className: se().TextChannelCount }, t.GetGroup().textRoomList.length),
u.createElement(z.TJ, { className: a && se().UnreadTextChannel }),
),
u.createElement(
D.s,
{
focusable: !0,
className: o && se().currentUserInVoiceChannel,
onActivate: () => {
(0, r.AM)(u.createElement(fe, { groupView: t }), n.ownerWindow);
},
onOKActionDescription: (0, y.Xx)("#GroupSettings_Channels_VoiceChannels"),
},
u.createElement(p.Cq4, null),
u.createElement("div", { className: se().VoiceChannelCount }, u.createElement("span", { className: i > 0 ? se().HasActiveVoiceRoom : se().NoActiveVoiceRoom }, i), " / ", t.GetGroup().voiceRoomList.length),
),
u.createElement(
D.s,
{
focusable: !0,
onActivate: (t) => {
let n = (0, Q.RA)(t),
i = (0, d.rb)(n);
(0, ie.hg)(i, n, e.groupView.GetGroup());
},
onOKActionDescription: (0, y.Xx)("#Chat_Actions_InviteFriendtoGroupChat"),
},
u.createElement(p.Kon, null),
),
u.createElement(
D.s,
{
focusable: !0,
onActivate: (t) => {
(0, re.Uu)((0, Q.RA)(t), e.groupView);
},
onOKActionDescription: (0, y.Xx)("#NotificationSettings_Title"),
},
u.createElement(p.Uos, null),
),
u.createElement(
D.s,
{
focusable: !0,
onActivate: (t) => {
(0, oe.n)((0, Q.RA)(t), e.groupView);
},
onOKActionDescription: (0, y.Xx)("#GroupSettings"),
},
u.createElement(p.lVV, null),
),
);
}),
Se = ({ className: e, readyToRender: t, children: n }) => {
const i = u.createElement(s.V, { position: "center", string: (0, y.Xx)("#Chat_ChatRoomGroup_Requesting") });
return u.createElement(D.s, { className: e }, u.createElement(u.Suspense, { fallback: i }, t ? n : i));
},
be = (e) => u.createElement(o.$_, null, u.createElement(D.s, { className: "_DialogColLayout", "flow-children": "row" }, u.createElement(o.KM, { onClick: e.closeModal }, (0, y.Xx)("#Button_Close"))));
},
68730: (e, t, n) => {
"use strict";
n.d(t, { Cq: () => B, MF: () => O, Pd: () => T, T: () => k, aP: () => L });
var i = n(85556),
o = n(27378),
r = n(29512),
a = n(58908),
s = n(11259),
l = n(16518),
c = n(37234),
m = n(72746),
d = n(23133),
h = n(51997),
u = n(71357),
p = n(68816),
_ = n(83817),
g = n(79588),
C = n(50649),
f = n(82909),
v = n(61963),
S = n(84290),
b = n(2049),
I = n(46057),
y = n(71061),
E = n(60176),
D = n(88669),
w = n(41111),
R = n(93635),
A = n(22394),
M = n(10553);
let k = class extends o.Component {
constructor(e) {
super(e), (this.m_schHoverDelay = new A.Ar()), (this.state = { bCollapsed: !1, bMouseHover: !1 });
}
OnRoomsContextMenu(e) {
if (this.props.groupView.GetGroup().BCanAdminChannel()) {
let t = e.currentTarget.ownerDocument.defaultView;
(0, f.yV)(
o.createElement(
v.xV,
null,
o.createElement(
v.Zo,
{
onSelected: () => {
this.CreateTextChannel(t);
},
},
(0, S.Xx)("#GroupSettings_Channels_CreateText"),
),
o.createElement(
v.Zo,
{
onSelected: () => {
this.CreateVoiceChannel(t);
},
},
(0, S.Xx)("#GroupSettings_Channels_CreateVoice"),
),
),
e,
);
}
}
CreateTextChannel(e) {
(0, p.BR)(o.createElement(T, { ownerWin: e, groupView: this.props.groupView, bVoiceChannel: !1, bJoinChannel: !0 }), e);
}
CreateVoiceChannel(e) {
(0, p.BR)(o.createElement(T, { ownerWin: e, groupView: this.props.groupView, bVoiceChannel: !0, bJoinChannel: !0 }), e);
}
OnMouseEnter(e) {
this.m_schHoverDelay.Schedule(400, () => {
this.setState({ bMouseHover: !0 });
});
}
OnMouseLeave(e) {
this.setState({ bMouseHover: !1 }), this.m_schHoverDelay.Cancel();
}
ToggleCollapseExpand() {
const { groupView: e } = this.props;
e.SetChannelListCollapsed(!e.isChannelListCollapsed);
}
render() {
let e = this.props.groupView.GetGroup(),
t = e.IsNamedGroupChat(),
n = !1,
i = "chatRoomGroupNavColumn",
r = this.props.groupView.isChannelListCollapsed;
return 0 != e.voiceRoomList.length || t ? r && !this.state.bMouseHover && (i += " chatRoomGroupNavCollapsed") : ((n = !0), (i += " defaultChatOnly")), this.props.inactive || n ? o.createElement("div", { className: i }) : o.createElement("div", { className: i, onMouseEnter: this.OnMouseEnter, onMouseLeave: this.OnMouseLeave }, o.createElement("div", { className: "chatRoomChannelGroups", onContextMenu: this.OnRoomsContextMenu }, t && o.createElement(G, { groupView: this.props.groupView }), o.createElement(F, { groupView: this.props.groupView }), (!r || this.state.bMouseHover) && o.createElement("div", { className: "chatRoomGroupNavCollapseExpand", title: (0, S.Xx)(r ? "#Tooltip_PinChannelList" : "#Tooltip_UnpinChannelList"), onClick: this.ToggleCollapseExpand }, o.createElement(l.lO8, { bPinned: !r }))), o.createElement("div", { className: "disconnectBlocker" }));
}
};
(0, i.gn)([b.ak], k.prototype, "OnRoomsContextMenu", null), (0, i.gn)([b.ak], k.prototype, "OnMouseEnter", null), (0, i.gn)([b.ak], k.prototype, "OnMouseLeave", null), (0, i.gn)([b.ak], k.prototype, "ToggleCollapseExpand", null), (k = (0, i.gn)([C.Pi], k));
class T extends o.Component {
OnSubmit() {
let e = this.m_refInput && this.m_refInput.value;
e &&
this.props.groupView
.GetGroup()
.CreateChatRoom(e, this.props.bVoiceChannel)
.then((e) => {
e && (this.props.closeModal(), this.props.bJoinChannel && (this.props.bVoiceChannel ? e.StartVoiceChat() : this.props.groupView.SelectChat(e.GetRoomID())));
})
.catch((e) => {
(0, u.zp)(this.props.ownerWin, (0, S.Xx)("#Generic_Error"), (0, S.Xx)("#Chat_CreateChatRoom_GenericError")), this.props.closeModal();
});
}
render() {
return o.createElement(
p.e1,
{ onEscKeypress: this.props.closeModal },
o.createElement(
s.oX,
{ classNameContent: "CreateChatChannelDialog", onSubmit: this.OnSubmit },
o.createElement(s.h4, null, (0, S.Xx)(this.props.bVoiceChannel ? "#GroupSettings_Channels_CreateVoice" : "#GroupSettings_Channels_CreateText")),
o.createElement(
s.uT,
null,
o.createElement(s.II, {
ref: (e) => {
this.m_refInput = e;
},
autoFocus: !0,
label: (0, S.Xx)("#Chat_SaveVoiceRoom_Name"),
}),
),
o.createElement(s.$_, null, o.createElement(s.o9, { onCancel: this.props.closeModal })),
),
);
}
}
function L(e, t, n) {
(0, p.BR)(o.createElement(T, { ownerWin: e, groupView: t, bVoiceChannel: n, bJoinChannel: !0 }), e, "CreateChatChannelDialog", { strTitle: (0, S.Xx)("#GroupSettings_Channels_CreateText"), popupWidth: 800, popupHeight: 400 }, (0, c.Og)(e));
}
(0, i.gn)([b.ak], T.prototype, "OnSubmit", null);
let G = class extends o.Component {
OnCreateNewTextChannel(e) {
let t = (0, D.RA)(e);
this.props.groupView.GetGroup().BCanAdminChannel() && L(t, this.props.groupView, !1);
}
OnStartChannelRename(e) {
this.props.groupView.StartRoomRename(e);
}
OnChannelRename(e, t) {
this.props.groupView.GetGroup().RenameRoom(e, t);
}
OnEndChannelRename() {
this.props.groupView.EndRoomRename();
}
render() {
let e = this.props.groupView,
t = e.GetGroup().textRoomList,
n = e.GetGroup().BCanAdminChannel();
e.isChannelListCollapsed;
return o.createElement(
"div",
{ className: "chatRoomTextChannelsGroup" },
o.createElement("div", { className: "ChannelTypeTitle", title: (0, S.Xx)("#Tooltip_TextChannel"), onClick: this.OnCreateNewTextChannel }, o.createElement("div", { className: "ChannelTypeLabel" + (n ? "" : " NoPermission"), title: n ? (0, S.Xx)("#Tooltip_TextChannelCreate") : (0, S.Xx)("#Tooltip_NoPermissionChannelCreate") }, n ? (0, S.Xx)("#Chat_AddTextChat") : (0, S.Xx)("#Chat_CreateTextChannel_DefaultName")), o.createElement("div", { className: "ChatRoomAddRoomBtn", title: (0, S.Xx)("#Tooltip_TextChannelCreate") }, o.createElement(l.FUf, null))),
t.map((t) => o.createElement(O, { key: t.unique_id, chat: t, bRenameActive: e.IsRoomRenameActive(t.GetRoomID()), bActiveChat: t == e.GetActiveChatView().chat, bDefaultRoom: t == e.GetGroup().GetDefaultChatRoom(), onStartRename: this.OnStartChannelRename, onRename: this.OnChannelRename, onEndRename: this.OnEndChannelRename })),
);
}
};
(0, i.gn)([b.ak], G.prototype, "OnCreateNewTextChannel", null), (0, i.gn)([b.ak], G.prototype, "OnStartChannelRename", null), (0, i.gn)([b.ak], G.prototype, "OnChannelRename", null), (0, i.gn)([b.ak], G.prototype, "OnEndChannelRename", null), (G = (0, i.gn)([C.Pi], G));
let O = class extends o.Component {
ToggleTextChat() {
if (this.props.bRenameActive) return;
let e = m.Ul.UIStore.IsChatRoomGroupActive((0, c.Um)(this), this.props.chat.GetGroup()),
t = m.Ul.UIStore.ShowAndOrActivateChatRoomGroup((0, c.Um)(this), this.props.chat.GetGroup(), !1),
n = t.GetPopoverChatView();
e && n && n.chat && n.chat == this.props.chat ? t.ClosePopoverChat() : t.SelectChat(this.props.chat.GetRoomID());
}
OnContextMenu(e) {
this.props.bRenameActive || (0, h._k)((0, c.Um)(this, e), this.props.chat.GetGroup(), this.props.chat.GetRoomID(), e, this.props.onStartRename);
}
render() {
let e = this.props.chat,
t = "chatRoomTextChannel";
this.props.bActiveChat && (t += " ActiveTextChannel");
let n = "chatRoomTextChannelName";
this.props.bDefaultRoom && (n += " IsCommonsChannel");
let i = this.props.bRenameActive && !this.props.chat.GetVoiceAllowed(),
r = e.GetGroup().GetDefaultChatID() != e.GetRoomID(),
a = m.Ul.ChatStore.VoiceChat.GetActiveVoiceChatID() == this.props.chat.GetRoomID();
return o.createElement(_.s, { focusable: !0, className: t, onClick: this.ToggleTextChat, onGamepadFocus: this.props.onFocus, onMenuButton: r ? this.OnContextMenu : void 0, onMenuActionDescription: r ? (0, S.Xx)("#Chat_ChatRoomGroup_Options") : void 0, onContextMenu: this.OnContextMenu }, o.createElement(y.TJ, { chat: e }), o.createElement("div", { className: "chatRoomTextChannelIcon" }, a ? o.createElement(l.M9_, null) : o.createElement(l.MFo, null)), !i && o.createElement("div", { className: n }, e.BIsDefaultRoom() ? (0, S.Xx)("#Chat_DefaultChannelName") : e.name), !this.props.bDefaultRoom && i && o.createElement(x, { chat: this.props.chat, onRename: this.props.onRename, onEndRename: this.props.onEndRename }));
}
};
(0, i.gn)([b.ak], O.prototype, "ToggleTextChat", null), (0, i.gn)([b.ak], O.prototype, "OnContextMenu", null), (O = (0, i.gn)([C.Pi], O));
let F = class extends o.Component {
CreateVoiceRoom() {
this.props.groupView.GetGroup().CreateAndJoinTempVoiceRoom();
}
OnVoiceRoomSelected(e) {
if (!(this.props.groupView.GetRenameRoomID() == e.GetRoomID())) {
m.Ul.ChatStore.VoiceChat.GetActiveVoiceChatID() == e.GetRoomID() || (this.props.groupView.ClosePopoverChat(), e.StartVoiceChat());
}
}
OnStartChannelRename(e) {
this.props.groupView.StartRoomRename(e);
}
OnChannelRename(e, t) {
this.props.groupView.GetGroup().RenameRoom(e, t);
}
OnEndChannelRename() {
this.props.groupView.EndRoomRename();
}
render() {
let e = this.props.groupView,
t = e.GetGroup().voiceRoomList;
return o.createElement(
"div",
{ className: "chatRoomVoiceChannelsGroup" },
o.createElement("div", { className: "ChannelTypeTitle", title: (0, S.Xx)("#Tooltip_VoiceChannelCreate"), onClick: this.CreateVoiceRoom }, o.createElement("div", { className: "ChannelTypeLabel" }, (0, S.Xx)("#Chat_AddVoiceChat")), o.createElement("div", { className: "ChatRoomAddRoomBtn", title: (0, S.Xx)("#Tooltip_VoiceChannelCreate") }, o.createElement(l.FUf, null))),
t.map((t) =>
o.createElement(B, {
key: t.unique_id,
context: "VoiceRoomsGroup",
chat: t,
bRenameActive: e.GetRenameRoomID() == t.GetRoomID(),
onSelect: () => {
this.OnVoiceRoomSelected(t);
},
onStartRename: this.OnStartChannelRename,
onRename: this.OnChannelRename,
onEndRename: this.OnEndChannelRename,
}),
),
);
}
};
(0, i.gn)([b.ak], F.prototype, "CreateVoiceRoom", null), (0, i.gn)([b.ak], F.prototype, "OnVoiceRoomSelected", null), (0, i.gn)([b.ak], F.prototype, "OnStartChannelRename", null), (0, i.gn)([b.ak], F.prototype, "OnChannelRename", null), (0, i.gn)([b.ak], F.prototype, "OnEndChannelRename", null), (F = (0, i.gn)([C.Pi], F));
let B = class extends o.Component {
constructor(e) {
super(e), (this.state = { dropToInviteFriend: void 0, bDropConfirmationNotice: !1 });
}
OnContextMenu(e) {
this.props.bRenameActive || (0, h._k)((0, c.Um)(this, e), this.props.chat.GetGroup(), this.props.chat.GetRoomID(), e, this.props.onStartRename), e.preventDefault(), e.stopPropagation();
}
InviteToChat(e) {
(0, w.hg)((0, c.Um)(this, e), e.currentTarget.ownerDocument.defaultView, this.props.chat.GetGroup(), this.props.chat), e.stopPropagation();
}
OnDragEnter(e, t) {
if (((0, R.X)(e && "friend" == e.type, "Invalid type passed to VoiceRoom.OnDragEnter"), e)) {
let t = e;
t.friend && this.setState({ dropToInviteFriend: t.friend });
}
return !0;
}
OnDragLeave() {
this.state.dropToInviteFriend && this.setState({ dropToInviteFriend: void 0 });
}
OnDragOver(e) {
e.dataTransfer.dropEffect = "move";
}
OnDrop(e, t) {
if (((0, R.X)(e && "friend" == e.type, "Invalid data type passed to ChatRoomGroupDialog.OnDrop"), e && "friend" == e.type)) {
let n = e;
if (n.friend && n.friend != m.Ul.FriendStore.self) {
this.state.dropToInviteFriend && this.setState({ dropToInviteFriend: void 0 }), c.g_FriendsUIDesktopApp.DragDropManager.SetDropConsumed();
let e = t.currentTarget.ownerDocument.defaultView;
this.props.chat.GetGroup().BIsUserGroupMember(n.friend)
? (this.props.chat.GetGroup().InviteFriend(n.friend.accountid, this.props.chat),
this.setState({ bDropConfirmationNotice: !0 }),
(this.m_dropInviteInvitee = n.friend),
(this.m_dropConfirmationInterval = window.setInterval(() => {
this.setState({ bDropConfirmationNotice: !1 }), window.clearInterval(this.m_dropConfirmationInterval);
}, 1200)))
: (0, E.cl)({ invitee: n.friend, chatview: null, invitedto: this.props.chat }, (0, c.Um)(this, t), e);
}
}
}
GetDragDropProps() {
let e = { rgAcceptedTypes: ["friend"] };
return (e.fnDragEnter = this.OnDragEnter), (e.fnDragOver = this.OnDragOver), (e.fnDragLeave = this.OnDragLeave), (e.fnDrop = this.OnDrop), e;
}
GetFriendContext() {
let e = this.props.chat && this.props.chat.GetGroup().readyToRender ? this.props.chat : null;
return (this.m_FriendContext && this.m_FriendContext.chat == e) || (this.m_FriendContext = { chat: e }), this.m_FriendContext;
}
render() {
var e, t;
let n = this.props.chat.GetGroup(),
i = this.props.chat == n.GetDefaultChatRoom(),
s = m.Ul.ChatStore.VoiceChat.GetActiveVoiceChatID() == this.props.chat.GetRoomID(),
c = m.Ul.CMInterface.steamid.GetAccountID(),
h = m.Ul.FriendStore.GetPlayer(c),
u = this.props.chat.voice_active_contains_only_self,
p = "emptyChannelNotice",
_ = this.props.chat.voice_active_member_list.member_list.map((e) => o.createElement(r.Z, { key: e.accountid, classNames: "friend-anim", timeout: 320 }, o.createElement(I.mo, { friend: e, key: e.accountid, context: this.GetFriendContext(), showVoiceLevel: !0, bInVoiceList: !0 }))),
g = this.props.chat.voice_active_contains_friends;
s && !this.props.chat.voice_active_contains_self && (0 == _.length && (u = !0), (g = !0), _.push(o.createElement(r.Z, { key: c, classNames: "friend-anim", timeout: 320 }, o.createElement(I.mo, { friend: h, key: c, context: this.GetFriendContext(), showVoiceLevel: !0 }))));
let C = ["chatRoomVoiceChannel"];
s && C.push("ActiveVoiceChannel"), g || "ChatRoomList" != this.props.context || C.push("MinimizeMemberList"), this.state.dropToInviteFriend && C.push("voiceRoomActiveDrop"), s && u && (p += " Visible");
let f = this.props.chat.IsUnsavedVoiceChannel(),
v = this.props.chat.name;
return o.createElement(
d.R,
Object.assign({ focusable: !0, className: C.join(" "), onClick: this.props.onSelect, onGamepadFocus: this.props.onFocus }, this.GetDragDropProps()),
o.createElement("div", { className: "chatRoomVoiceChannelIconGlow" }),
o.createElement("div", { className: "chatRoomVoiceChannelNameContainer", onContextMenu: this.OnContextMenu }, o.createElement("div", { className: "chatRoomVoiceChannelIcon" }, o.createElement(l.Cq4, null)), !this.props.bRenameActive && o.createElement("div", { className: "chatRoomVoiceChannelName" + (f ? " unsavedVoiceChannel" : "") }, v), this.props.bRenameActive && o.createElement(x, { chat: this.props.chat, onRename: this.props.onRename, onEndRename: this.props.onEndRename }), !this.props.bRenameActive && !(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) && o.createElement(o.Fragment, null, o.createElement("div", { onContextMenu: this.OnContextMenu, onClick: this.OnContextMenu, className: "VoiceControlPanelButton chatPinRoom", title: (0, S.Xx)("#Chat_ChannelOptions") }, o.createElement(l.$gZ, null)))),
o.createElement("div", { className: "VoiceChannelParticipants CompactFriendsList" }, !g && _, g && o.createElement(a.Z, { enter: !0, exit: !0 }, _)),
o.createElement("div", { className: p }, (0, S.Xx)("#Chat_VoiceEmptyChannel")),
!(null === (t = this.context) || void 0 === t ? void 0 : t.IN_GAMEPADUI) && o.createElement(I.qe, { name: v, chat: this.props.chat, nostatus: !0 }),
!i && o.createElement(O, { chat: this.props.chat, bRenameActive: !1, bActiveChat: !1, bDefaultRoom: !1 }),
o.createElement("div", { className: "ScratchPadConnect" }),
this.state.bDropConfirmationNotice && o.createElement("div", { className: "dropConfirmationNotice" + (this.state.bDropConfirmationNotice ? " Active" : "") }, o.createElement("div", { className: "dropConfirmationLabel" }, o.createElement("img", { className: "avatar", src: this.m_dropInviteInvitee.persona.avatar_url_medium }))),
o.createElement("div", { className: "dropTargetBox" }),
);
}
};
(B.contextType = M.E_), (0, i.gn)([b.ak], B.prototype, "OnContextMenu", null), (0, i.gn)([b.ak], B.prototype, "InviteToChat", null), (0, i.gn)([b.ak], B.prototype, "OnDragEnter", null), (0, i.gn)([b.ak], B.prototype, "OnDragLeave", null), (0, i.gn)([b.ak], B.prototype, "OnDragOver", null), (0, i.gn)([b.ak], B.prototype, "OnDrop", null), (B = (0, i.gn)([C.Pi], B));
let x = class extends o.Component {
constructor(e) {
super(e), (this.m_strValue = ""), (0, g.rC)(this), (this.m_strValue = this.props.chat.name);
}
componentDidUpdate(e) {
e.chat !== this.props.chat && (this.m_strValue = this.props.chat.name);
}
componentDidMount() {
window.addEventListener("keydown", this.OnGlobalKeyDown, !1);
}
componentWillUnmount() {
window.removeEventListener("keydown", this.OnGlobalKeyDown, !1);
}
BindInputRef(e) {
e && e.focus();
}
OnChange(e) {
this.m_strValue = e.target.value;
}
OnSubmit(e) {
this.SubmitAndClose(), e.preventDefault();
}
OnGlobalKeyDown(e) {
27 == e.keyCode && this.Close();
}
OnBlur(e) {
this.SubmitAndClose();
}
SubmitAndClose() {
this.props.onRename(this.props.chat.GetRoomID(), this.m_strValue), this.Close();
}
Close() {
this.props.onEndRename();
}
render() {
return o.createElement("form", { className: "RenameChatRoomInline", onSubmit: this.OnSubmit }, o.createElement("input", { ref: this.BindInputRef, type: "text", value: this.m_strValue, onChange: this.OnChange, onBlur: this.OnBlur }));
}
};
(0, i.gn)([g.LO], x.prototype, "m_strValue", void 0), (0, i.gn)([b.ak], x.prototype, "BindInputRef", null), (0, i.gn)([b.ak], x.prototype, "OnChange", null), (0, i.gn)([b.ak], x.prototype, "OnSubmit", null), (0, i.gn)([b.ak], x.prototype, "OnGlobalKeyDown", null), (0, i.gn)([b.ak], x.prototype, "OnBlur", null), (x = (0, i.gn)([C.Pi], x));
},
71061: (e, t, n) => {
"use strict";
n.d(t, { FL: () => T, TJ: () => F, wm: () => L });
var i = n(85556),
o = n(11612),
r = n(19953),
a = n(23346),
s = n(37234),
l = n(72746),
c = n(618),
m = n(68730),
d = n(51997),
h = n(14341),
u = n(92883),
p = n(50649),
_ = n(27378),
g = n(29512),
C = n(58908),
f = n(70756),
v = n(83817),
S = n(88991),
b = n(90656),
I = n(11259),
y = n(16518),
E = n(87018),
D = n(88669),
w = n(84290),
R = n(2049),
A = n(10553),
M = n(97720),
k = n(46057);
let T = class extends _.Component {
constructor(e) {
super(e), (this.state = { ulSelectedGroupID: "" });
}
BindDiv(e) {
this.m_elDiv = e;
}
get div() {
return this.m_elDiv;
}
get recommendedHeight() {
return this.m_elDiv.clientHeight;
}
get maximumHeight() {
return this.recommendedHeight;
}
get minimumHeight() {
return 0;
}
OnGroupSelected(e) {
e == this.state.ulSelectedGroupID ? this.setState({ ulSelectedGroupID: "" }) : this.setState({ ulSelectedGroupID: e });
}
render() {
var e, t;
let n = this.props.chats.currentChatRoomGroups.sort((e, t) => t.time_last_activity - e.time_last_activity);
const i = (0, o.e7)(r.De.EREALM);
return _.createElement(
"div",
{ className: "ChatRoomList CompactFriendsList", ref: this.BindDiv },
0 == n.length &&
_.createElement(
"div",
{ className: "ChatRoomList_Empty" },
(0, w.Xx)("#Chat_ChatRoomList_Empty"),
_.createElement("br", null),
_.createElement("br", null),
!i && !(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) && (0, w.kQ)("#Chat_ChatRoomList_Empty_How", _.createElement(h.ns, { href: r.De.COMMUNITY_BASE_URL + "my/groups/" }, (0, w.Xx)("#Chat_ChatRoomList_Empty_HowLink"))),
!i &&
(null === (t = this.context) || void 0 === t ? void 0 : t.IN_GAMEPADUI) &&
_.createElement(
_.Fragment,
null,
_.createElement("div", { className: "ChatRoomList_Empty_Description" }, (0, w.Xx)("#Chat_ChatRoomList_Empty_SteamDeck")),
_.createElement(
I.zx,
{
onClick: (e) => {
let t = (0, D.RA)(e);
(0, M.bI)((0, s.rb)(t), t);
},
},
(0, w.Xx)("#Chat_ChatRoomList_Empty_StartNew_SteamDeck"),
),
),
),
n.map((e) => _.createElement(L, { key: e.GetGroupID(), group: e })),
_.createElement("div", { className: "disconnectBlocker" }),
);
}
};
(T.contextType = A.E_), (0, i.gn)([R.ak], T.prototype, "BindDiv", null), (0, i.gn)([R.ak], T.prototype, "OnGroupSelected", null), (T = (0, i.gn)([p.Pi], T));
const L = (0, p.Pi)(function (e) {
const { group: t, bShowLastChat: n, bHideUnreadMention: i, additionalElements: o } = e,
r = (0, A.id)(),
[a, m] = _.useState(!1),
[h, u] = _.useState(!1),
[p, g] = _.useState(!1),
C = _.useCallback(() => g(!0), []),
S = _.useCallback(() => g(!1), []),
b = _.useCallback(
(e) => {
const i = t.room_with_last_message;
if (n && i) {
l.Ul.UIStore.ShowAndOrActivateChatRoomGroup((0, s.Um)(null, e), t, !0).SelectChat(i.GetRoomID());
} else l.Ul.UIStore.ShowAndOrActivateChatRoomGroup((0, s.Um)(null, e), t, !0);
},
[n, t],
),
I = _.useCallback((e) => {
m((e) => !e), e.stopPropagation();
}, []),
R = _.useCallback(
(e) => {
(0, d.bU)(e, t);
},
[t],
),
M = _.useCallback(() => u(!0), []),
k = _.useCallback(() => u(!1), []);
const T = (function (e, t = !0) {
const [n, i] = _.useState(void 0),
o = _.useRef(!1),
r = _.useCallback(
(t) => {
if (e.BIsClanChatRoom()) {
let t = l.Ul.FriendStore.ClanStore.GetClan(e.GetClanID());
s.g_FriendsUIDesktopApp.DragDropManager.StartDrag({ type: "clan", clan: t });
} else s.g_FriendsUIDesktopApp.DragDropManager.StartDrag({ type: "chatroomgroup", group: e });
},
[e],
),
a = _.useCallback((e) => {
s.g_FriendsUIDesktopApp.DragDropManager.EndDrag();
}, []),
c = _.useCallback((e) => {
let t = s.g_FriendsUIDesktopApp.DragDropManager.GetDragData();
if (t && "friend" == t.type) {
let n = t.friend;
(o.current = !0), e.preventDefault(), i(n);
} else o.current = !1;
e && (e.preventDefault(), o.current && e.stopPropagation());
}, []),
m = _.useCallback((e) => {
o.current && (e.preventDefault(), e.stopPropagation());
}, []),
d = _.useCallback((e) => {
(0, D.H0)(e) && ((o.current = !1), i(void 0));
}, []),
h = _.useCallback(
(t) => {
let n = s.g_FriendsUIDesktopApp.DragDropManager.GetDragData();
if (n && "friend" == n.type) {
t.preventDefault(), t.stopPropagation();
let o = e.memberList.member_list.slice(),
r = n;
if (null != r.friend && -1 != o.indexOf(r.friend)) return;
s.g_FriendsUIDesktopApp.DragDropManager.SetDropConsumed(), e.InviteFriend(r.friend.accountid), i(void 0);
}
},
[e],
);
let u = {};
return t && ((u.onDragEnter = c), (u.onDragOver = m), (u.onDragLeave = d), (u.onDrop = h)), (u.draggable = !0), (u.onDragStart = r), (u.onDragEnd = a), u;
})(t, !0);
let L = null !== t.watching_broadcast_steamid,
P = t.hasVoiceRoom;
const U = (0, E.Z)(e.className, "ChatRoomListGroupItem", !t.hasVoiceRoom && "NoChannels", a && "ShowAllChannels", h && "NonGroupHovered", L && "HasLinkedBroadcast");
return _.createElement(
f.h,
{ onEnter: C, onLeave: S, topOffset: "-300px", bottomOffset: "-200px" },
_.createElement(
v.s,
Object.assign({ className: U }, T, { focusable: !0, onOKButton: b, onMenuButton: R, onMenuActionDescription: (0, w.Xx)("#Chat_ChatRoomGroup_Options") }),
_.createElement("div", { className: "ChatRoomListGroupItem_header", onClick: b, onContextMenu: R }, _.createElement(c._P, { group: p ? t : void 0, small: !0 }), p && _.createElement(_.Fragment, null, !r && L && _.createElement(G, { group: t }), _.createElement("div", { className: "groupNameStatusContainer" }, _.createElement("div", { className: "displayRow" }, _.createElement("div", { className: "chatRoomName" }, t.name), !r && _.createElement("div", { className: "ContextMenuButton", onClick: R, onMouseEnter: M, onMouseLeave: k }, _.createElement(y.$gZ, null))), !r && !a && P && _.createElement(N, { group: t }), n && _.createElement(O, { group: t })), !i && _.createElement(F, { group: t })), !r && P && _.createElement("div", { onMouseEnter: M, onMouseLeave: k }, _.createElement(B, { expanded: a, onClick: I })), o),
!r && P && _.createElement("div", { className: "detailsView" }, _.createElement("div", { className: "ChatRoomListGroupItemChatRooms" }, _.createElement(x, { group: t, expanded: a }))),
),
);
}),
G = (0, p.Pi)(function (e) {
const { group: t } = e;
let n = new S.K(t.watching_broadcast_steamid);
const i = (function (e) {
const [t, n] = _.useState();
return (
_.useEffect(() => {
if (!e) return void n(void 0);
const t = b.BroadcastWatchStore.StartInfo(e);
return n(t), () => b.BroadcastWatchStore.StopInfo(t);
}, [e]),
t && t.m_steamIDBroadcast === e ? t : null
);
})(n && n.ConvertTo64BitString());
let o = (null == i ? void 0 : i.m_bInitialized) ? i.m_strTitle || i.m_strAppTitle || (0, w.Xx)("#PersonaStateWatchingBroadcast_Player", l.Ul.FriendStore.GetPlayer(n.GetAccountID()).display_name) : void 0;
return _.createElement("div", { className: "steamTVSubtitle" }, _.createElement(y.hLd, null), ": ", o, " ");
}),
O = (0, p.Pi)(function (e) {
const { group: t } = e,
n = t.room_with_last_message;
if (!n) return null;
const i = l.Ul.ChatStore.NotificationBBCodeParser.ParseBBCode(n.GetLastMessage(), { chat: n, unAccountIDSender: n.accountid_last_message, key: n.GetLastMessage(), rtTimestamp: n.time_last_message, onLoad: () => {} }),
o = l.Ul.FriendStore.GetPlayer(n.accountid_last_message),
r = (i && i.body) || (0, u.p8)(n.GetLastMessage());
return _.createElement("div", { className: "lastChatMessage" }, _.createElement("div", null, o.display_name + " : ", r));
});
let F = class extends _.Component {
render() {
let e = this.props.group,
t = this.props.chat;
if ((e && !e.hasUnreadChatMessage) || (t && !t.has_any_unread_messages)) return null;
let n = (this.props.className || "") + " ChatUnreadMessageIndicator";
return ((e && e.HasUnreadMention) || (t && t.has_unread_mention)) && (n += " UnreadMention"), _.createElement("div", { className: n }, _.createElement("div", { className: "chatUnreadCircle" }, "@"));
}
};
function B(e) {
let t = e.expanded ? (0, w.Xx)("#Chat_ChatRoomListO_OpenGroupCollapse") : (0, w.Xx)("#Chat_ChatRoomListO_OpenGroupExpand");
return _.createElement("div", { className: "openGroupButton", title: t, onClick: e.onClick }, _.createElement(y.NP6, null));
}
F = (0, i.gn)([p.Pi], F);
let x = (0, p.Pi)((e) => {
let t = [];
for (let n of e.group.voiceRoomList) (e.expanded || n.voice_active_contains_self) && t.push(n);
let n = null;
return t && (n = t.map((e) => _.createElement(g.Z, { classNames: "heightcollapseandfade-anim", timeout: 300, key: e.unique_id }, _.createElement(m.Cq, { key: e.unique_id, chat: e, bRenameActive: !1, context: "ChatRoomList", onSelect: e.StartVoiceChat })))), _.createElement(C.Z, null, n);
}),
N = (0, p.Pi)((e) => {
let t = [];
for (let n of e.group.voiceRoomList) {
if (n.voice_active_contains_self) continue;
let e = n.voice_active_member_list;
if (0 == e.member_count) continue;
let i = e.member_list.filter((e) => e.is_friend);
0 != i.length && ((i = e.member_list.slice()), i.sort(a.Xp.FriendSortByFriendOrNotComparator), t.push({ ulRoomID: n.unique_id, rgFriends: i }));
}
return t && 0 != t.length
? _.createElement(
"div",
{ className: "membersInVoice" },
_.createElement("div", { className: "voiceChannelIcon" }, _.createElement(y.Cq4, null)),
t.map((e) => _.createElement(P, { key: e.ulRoomID, friendsInRoom: e })),
)
: null;
}),
P = class extends _.Component {
render() {
let e = this.props.friendsInRoom;
return _.createElement(
"span",
{ className: "voiceChatGroup" },
e.rgFriends.map((e) => _.createElement(k.yd, { key: e.accountid, friend: e, context: {}, disableContextMenu: !1 }, _.createElement("img", { className: "voiceFriendAvatar" + (e.is_friend ? "" : " isNotFriend"), src: e.persona.avatar_url, draggable: !1 }))),
);
}
};
P = (0, i.gn)([p.Pi], P);
},
51997: (e, t, n) => {
"use strict";
n.d(t, { _k: () => T, bU: () => w, ip: () => R });
var i = n(85556),
o = n(19953),
r = n(37234),
a = n(88669),
s = n(72746),
l = n(618),
c = n(71357),
m = n(13106),
d = n(68816),
h = n(14341),
u = n(50649),
p = n(27378),
_ = n(82909),
g = n(61963),
C = n(11259),
f = n(84290),
v = n(2049),
S = n(16518),
b = n(41111),
I = n(47109),
y = n.n(I),
E = n(14593),
D = n(10553);
function w(e, t, n) {
let i,
o = (0, r.Um)(null, e);
return t.BIsClanChatRoom() && (i = s.Ul.FriendStore.ClanStore.GetClan(t.GetClanID())), (0, _.yV)(p.createElement(k, { browserContext: o, group: t, clan: i, context: n, ownerWindow: (0, a.RA)(e) }), e);
}
function R(e, t, n) {
let i,
o = (0, r.Um)(null, e);
return t.GetChatGroupIDIfLoaded() && (i = s.Ul.ChatStore.GetChatRoomGroup(t.GetChatGroupIDIfLoaded())), (0, _.yV)(p.createElement(k, { browserContext: o, group: i, clan: t, context: n, ownerWindow: (0, a.RA)(e) }), e);
}
function A(e, t) {
(0, E.I)("FindGamesToPlayWithFriends/ChatRoom"), e.stopPropagation(), (0, m.D4)(t, (0, r.Um)(null, e));
}
function M(e, t, n, i, r) {
if (o.De.IN_CLIENT && s.Ul.SettingsStore.BClientHasFeatureOrOnWeb("FriendsFilter")) {
let o = e < 2 || e > 8;
return p.createElement(g.Zo, { disabled: o, key: i, onSelected: r, className: y().ChatroomContextMenuDisableableItem }, t, o && p.createElement("div", { className: y().DisabledDescriptor }, (0, f.Xx)(n, 2, 8)));
}
return null;
}
class k extends p.Component {
OpenChatWindow(e) {
this.props.group ? s.Ul.UIStore.ShowAndOrActivateChatRoomGroup(this.props.browserContext, this.props.group, !0) : this.props.clan.OpenChatDialog(this.props.browserContext, !0);
}
ShowClanProfile(e) {
let t;
if (this.props.clan.BIsOGG()) t = `${o.De.COMMUNITY_BASE_URL}app/${this.props.clan.GetOGGAppID()}`;
else {
let e = this.props.clan.steamid;
t = `${o.De.COMMUNITY_BASE_URL}gid/${e.ConvertTo64BitString()}`;
}
(0, h.b8)(e, t), e.stopPropagation();
}
FindGamesToPlay(e) {
A(
e,
this.props.group.memberList.member_list.map((e) => e.accountid),
);
}
LeaveChatRoomGroup(e) {
(0, l.vT)(e.currentTarget.ownerDocument.defaultView, this.props.group);
}
render() {
var e;
let t = [],
n = this.props.group,
i = this.props.clan,
o = this.props.context || {},
r = s.Ul.FriendStore.FavoritesStore,
a = this.props.group.memberList.member_list.length;
if (
(o.tab
? t.push(
p.createElement(
g.Zo,
{
key: "closetab",
onSelected: () => {
s.Ul.UIStore.CloseTab(this.props.browserContext, o.tab);
},
},
(0, f.Xx)((null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) ? "#Chat_CloseTabAction_SteamDeck" : "#Chat_CloseTabAction"),
),
)
: o.is_chat_window || t.push(p.createElement(g.Zo, { key: "opentab", onSelected: this.OpenChatWindow }, (0, f.Xx)("#Chat_Actions_OpenChat"))),
i && !i.BIsOGG() && t.push(p.createElement(g.Zo, { key: "viewprofile", onSelected: this.ShowClanProfile }, (0, f.Xx)("#Friend_Menu_ViewProfile"))),
this.props.group.readyToRender)
) {
const e = M(a, (0, f.Xx)("#Chat_Actions_FindGamesToPlay"), "#Chat_Tooltip_FindGamesToPlay_UserCountRestriction_ChatGroup", "findgamestoplay", this.FindGamesToPlay);
e && t.push(e);
}
t.push(p.createElement(g.Zo, { key: "leavechatroom", onSelected: this.LeaveChatRoomGroup }, (0, f.Xx)(i ? "#Chat_Actions_LeaveChatRoom" : "#Chat_Actions_LeaveChatRoomGroup")));
let l = i ? { clan: i } : { chat: n };
return (
s.Ul.FriendStore.FavoritesStore.BIsFavorited(l)
? o.is_favorites &&
t.push(
p.createElement(
g.Zo,
{
key: "quickaccess",
onSelected: () => {
r.RemoveFromFavorites(l);
},
},
(0, f.Xx)("#Friend_Menu_RemoveFromQuickAccess"),
),
)
: t.push(
p.createElement(
g.Zo,
{
key: "quickaccess",
onSelected: () => {
r.AddToFavorites(l);
},
},
(0, f.Xx)("#Friend_Menu_AddToQuickAccess"),
),
),
i && i.BIsOGG() && t.push(p.createElement(m.rb, { unAppID: i.GetOGGAppID(), strGameName: i.name })),
p.createElement(g.xV, { className: "chatRoomListItemContextMenu", label: n.name }, t)
);
}
}
function T(e, t, n, i, o) {
if (t.GetDefaultChatID() == n) return null;
if (L.BIsMenuEmpty(t, n, !!o)) return null;
let r = (0, a.RA)(i);
return (0, _.yV)(p.createElement(L, { browserContext: e, group: t, roomID: n, ownerWindow: r, onStartRoomRename: o }), i);
}
(k.contextType = D.E_), (0, i.gn)([v.ak], k.prototype, "OpenChatWindow", null), (0, i.gn)([v.ak], k.prototype, "ShowClanProfile", null), (0, i.gn)([v.ak], k.prototype, "FindGamesToPlay", null), (0, i.gn)([v.ak], k.prototype, "LeaveChatRoomGroup", null);
class L extends p.PureComponent {
ShowInviteDialog() {
let e = this.props.group.GetChatRoom(this.props.roomID);
(0, b.hg)(this.props.browserContext, this.props.ownerWindow, this.props.group, e);
}
FindGamesToPlayInChannel(e) {
A(
e,
this.props.group.GetChatRoom(this.props.roomID).voice_active_member_list.member_list.map((e) => e.accountid),
);
}
SaveVoiceRoom(e) {
let t = (0, a.RA)(e);
var n, i, o;
(n = t), (i = this.props.group), (o = this.props.roomID), (0, d.BR)(p.createElement(G, { group: i, roomID: o }), n, "SaveVoiceRoomDialog", { strTitle: (0, f.Xx)("#Chat_SaveVoiceRoom"), popupWidth: 664, popupHeight: 380 }, (0, r.Og)(n));
}
RemoveRoom() {
(0, c.p3)(this.props.ownerWindow, (0, f.Xx)("#Chat_Actions_RemoveRoom"), (0, f.Xx)("#Chat_Actions_RemoveRoom_Confirm"), (0, f.Xx)("#Chat_Actions_RemoveRoom_Action"))
.then(() => {
let e = this.props.group,
t = this.props.roomID;
e.DeleteChatRoom(t);
})
.catch(() => {});
}
ChangeRoomName() {
this.props.onStartRoomRename(this.props.roomID);
}
static BIsMenuEmpty(e, t, n) {
let i = e.GetDefaultChatID() == t,
o = e.BIsTempVoiceChannel(t),
r = e.BCanAdminChannel();
return !e.BIsVoiceChannel(t) && (!o || !r) && !(n && !i && !o && r) && !(!i && r);
}
render() {
let e = [],
t = this.props.group,
n = this.props.roomID,
i = this.props.group.GetChatRoom(this.props.roomID),
o = t.GetDefaultChatID() == n,
r = t.BIsTempVoiceChannel(n),
a = t.BCanAdminChannel(),
s = (t.BCanInvite(), i.voice_active_member_list.member_count);
e.push(p.createElement(g.Zo, { key: "invitefriend", onSelected: this.ShowInviteDialog }, (0, f.Xx)("#Chat_Actions_InviteFriendtoVoice")));
const l = M(s, (0, f.Xx)("#Chat_Actions_FindGamesToPlay"), "#Chat_Tooltip_FindGamesToPlay_UserCountRestriction_Channel", "findgamestoplayinchannel", this.FindGamesToPlayInChannel);
return l && e.push(l), r && e.push(p.createElement(g.Zo, { key: "savechannel", className: a ? "" : y().ChatRoomContextNoPermission, onSelected: this.SaveVoiceRoom }, !a && p.createElement(S.HEZ, null), (0, f.Xx)("#Chat_Actions_SaveChannel"))), this.props.onStartRoomRename && !o && !r && a && e.push(p.createElement(g.Zo, { key: "renameroom", onSelected: this.ChangeRoomName }, (0, f.Xx)("#Chat_Actions_ChangeRoomName"))), !o && a && e.push(p.createElement(g.Zo, { key: "removeroom", onSelected: this.RemoveRoom }, (0, f.Xx)("#Chat_Actions_RemoveRoom"))), e.length < 1 ? (console.log("warning: empty context menu. Did someone not update BIsMenuEmpty?"), null) : p.createElement(g.xV, { className: "friendsContextMenu", label: t.name }, e);
}
}
(0, i.gn)([v.ak], L.prototype, "ShowInviteDialog", null), (0, i.gn)([v.ak], L.prototype, "FindGamesToPlayInChannel", null), (0, i.gn)([v.ak], L.prototype, "SaveVoiceRoom", null), (0, i.gn)([v.ak], L.prototype, "RemoveRoom", null), (0, i.gn)([v.ak], L.prototype, "ChangeRoomName", null);
let G = class extends p.Component {
constructor(e) {
super(e), (this.state = { strName: "", strError: void 0 });
}
HandleTextEntry(e) {
this.setState({ strName: e.target.value });
}
HandleSubmit(e) {
e && e.preventDefault();
let t = this.state.strName;
0 != t.length ? (this.props.group.RenameRoom(this.props.roomID, t), this.props.closeModal()) : this.setState({ strError: (0, f.Xx)("#Chat_SaveVoiceRoom_Error_EmptyName") });
}
render() {
return p.createElement(d.e1, { onEscKeypress: this.props.closeModal }, p.createElement(C.oX, { classNameContent: "SaveVoiceRoomDialog", onSubmit: this.HandleSubmit }, p.createElement(C.h4, null, (0, f.Xx)("#Chat_SaveVoiceRoom")), p.createElement(C.uT, null, this.state.strError && p.createElement(C.Ac, { className: "nicknameError" }, this.state.strError), p.createElement(C.Ac, null, (0, f.Xx)("#Chat_SaveVoiceRoom_Description")), p.createElement(C.II, { type: "text", label: (0, f.Xx)("#Chat_SaveVoiceRoom_Name"), className: "nicknameInput", value: this.state.strName, onChange: this.HandleTextEntry, autoFocus: !0 })), p.createElement(C.$_, null, p.createElement(C.o9, { onCancel: this.props.closeModal }))));
}
};
(0, i.gn)([v.ak], G.prototype, "HandleTextEntry", null), (0, i.gn)([v.ak], G.prototype, "HandleSubmit", null), (G = (0, i.gn)([u.Pi], G));
},
15152: (e, t, n) => {
"use strict";
n.d(t, { lR: () => U, Le: () => N, Ez: () => j });
var i = n(85556),
o = n(19953),
r = n(84446),
a = n(93354),
s = n(19339),
l = n(72746),
c = n(37234),
m = n(96119),
d = n(618),
h = n(51997),
u = n(13106),
p = n(79588),
_ = n(50649),
g = n(27378),
C = n(58908),
f = n(29512),
v = n(66035),
S = n(82909),
b = n(83817),
I = n(61963),
y = n(11259),
E = n(38571),
D = n(2049),
w = n(54530);
class R extends g.Component {
constructor(e) {
super(e), (this.state = { nCalculatedHeightPx: void 0, bLeftSliderVisible: !1, bRightSliderVisible: !1 });
}
OnRef(e) {
this.UnbindWindowHandlers(), e && ((this.m_elScroll = e), e.ownerDocument.defaultView && this.m_elScroll.ownerDocument.defaultView.addEventListener("resize", this.CheckScrollPosition), this.CheckScrollPosition());
}
CheckScrollPosition() {
if (!this.m_elScroll || (this.m_animation && this.m_animation.BIsActive())) return;
let e = 0;
for (let t = this.m_elScroll.firstElementChild; t; t = t.nextElementSibling) e = Math.max(e, t.getBoundingClientRect().height);
e != this.state.nCalculatedHeightPx && this.setState({ nCalculatedHeightPx: e }), this.UpdateSliderControlsForScrollOffset(this.m_elScroll.scrollLeft);
}
UpdateSliderControlsForScrollOffset(e) {
let t = e > 1,
n = e + this.m_elScroll.getBoundingClientRect().width < this.m_elScroll.scrollWidth - 1;
t != this.state.bLeftSliderVisible && this.setState({ bLeftSliderVisible: t }), n != this.state.bRightSliderVisible && this.setState({ bRightSliderVisible: n });
}
AnimateScrollLeftTo(e) {
this.m_animation && this.m_animation.Cancel(), (this.m_animation = new w.jg(this.m_elScroll, { scrollLeft: e }, { msDuration: 500, onComplete: this.CheckScrollPosition, timing: "cubic-in-out" })), this.m_animation.Start(), this.UpdateSliderControlsForScrollOffset(e);
}
OnSlideLeftClick() {
(this.m_animation && this.m_animation.BIsActive()) || (this.m_elScroll && this.AnimateScrollLeftTo(Math.max(0, this.m_elScroll.scrollLeft - this.m_elScroll.getBoundingClientRect().width)));
}
OnSlideRightClick() {
(this.m_animation && this.m_animation.BIsActive()) || (this.m_elScroll && this.AnimateScrollLeftTo(Math.min(this.m_elScroll.scrollWidth - this.m_elScroll.getBoundingClientRect().width, this.m_elScroll.scrollLeft + this.m_elScroll.getBoundingClientRect().width)));
}
OnWheel(e) {
e && e.nativeEvent && (e.nativeEvent.deltaY < 0 ? this.OnSlideLeftClick() : this.OnSlideRightClick());
}
GetScrollRef() {
return this.m_elScroll;
}
componentWillUnmount() {
this.UnbindWindowHandlers(), this.m_animation && this.m_animation.Cancel();
}
componentDidUpdate() {
this.CheckScrollPosition();
}
UnbindWindowHandlers() {
this.m_elScroll && (this.m_elScroll.ownerDocument.defaultView && this.m_elScroll.ownerDocument.defaultView.removeEventListener("resize", this.CheckScrollPosition), (this.m_elScroll = void 0));
}
render() {
let e = "auto";
return this.state.nCalculatedHeightPx && (e = this.state.nCalculatedHeightPx + "px"), g.createElement("div", { onWheel: this.OnWheel, className: "HorizontalMiniSlider", style: { height: e } }, g.createElement("div", { className: "HorizontalMiniSliderScroll " + this.props.className, onScroll: this.CheckScrollPosition, ref: this.OnRef }, this.props.children));
}
}
(0, i.gn)([D.ak], R.prototype, "OnRef", null), (0, i.gn)([D.ak], R.prototype, "CheckScrollPosition", null), (0, i.gn)([D.ak], R.prototype, "OnSlideLeftClick", null), (0, i.gn)([D.ak], R.prototype, "OnSlideRightClick", null), (0, i.gn)([D.ak], R.prototype, "OnWheel", null);
var A = n(68816),
M = n(16518),
k = n(55948),
T = n(9824),
L = n(87018),
G = n(84290),
O = n(89911),
F = n.n(O),
B = n(46057),
x = n(10553);
let N = class extends g.Component {
constructor(e) {
super(e), (this.m_mapTabs = new Map()), (this.m_rgOrderedRenderedTabs = []), (this.m_bUsePopups = !1), (this.m_nInitialTabDragOffset = -1), (this.m_nTheaterTopHoverHeight = 12), (this.m_fnUnregisterDropComplete = void 0), (this.m_tabDrag = void 0), (0, p.rC)(this), (this.state = { iDragIndex: 0, windowWidth: 0, bTheaterModeTopHovered: !1 });
}
componentDidUpdate() {
this.FixScrollLocation();
}
componentDidMount() {
let e = this.props.popup ? this.props.popup.window : window;
e && e.addEventListener("resize", this.OnWindowResizeEvent), this.m_elchatTabDiv && (this.setState({ windowWidth: this.m_elchatTabDiv.clientWidth }), this.UpdateWindowIcon());
}
componentWillUnmount() {
let e = this.props.popup ? this.props.popup.window : window;
e && e.removeEventListener("resize", this.OnWindowResizeEvent);
}
OnWindowResizeEvent() {
this.m_elchatTabDiv && this.setState({ windowWidth: this.m_elchatTabDiv.clientWidth });
}
FocusActiveTab() {
let e = this.m_mapTabs.get(this.props.activeTab.GetUniqueID());
if (!e) return !1;
let t = e.GetChatTabRef();
return !!t && (t.focus(), !0);
}
SetDragTab(e) {
void 0 !== e ? (this.m_fnUnregisterDropComplete = c.g_FriendsUIDesktopApp.DragDropManager.RegisterForDropComplete(this.HandleDropComplete)) : this.m_fnUnregisterDropComplete && (this.m_fnUnregisterDropComplete.Unregister(), (this.m_fnUnregisterDropComplete = void 0)), (this.m_tabDrag = e), (this.m_nInitialTabDragOffset = -1);
}
GetDragTab() {
return this.m_tabDrag;
}
HandleDropComplete(e) {
(this.m_fnUnregisterDropComplete = void 0), (this.m_tabDrag = void 0);
}
FixScrollLocation() {
if (!this.m_elScroll) return;
if (!this.props.activeTab) return;
let e = this.m_mapTabs.get(this.props.activeTab.GetUniqueID());
if (!e) return;
let t = e.GetChatTabRef();
if (!t) return;
let n = t.offsetLeft,
i = t.offsetLeft + t.offsetWidth,
o = Math.ceil(this.m_elScroll.scrollLeft + this.m_elScroll.clientWidth);
if (n < o && i > o) {
let e = i - Math.floor(this.m_elScroll.clientWidth) + 40;
this.SetScrollLeft(e);
} else if (n < this.m_elScroll.scrollLeft + 40 || i > o) {
let e = n;
0 != e && (e -= 40), this.SetScrollLeft(e);
}
}
SetScrollLeft(e) {
this.m_elScroll.scrollLeft != e && (this.m_animation && this.m_animation.Cancel(), (this.m_animation = new w.jg(this.m_elScroll, { scrollLeft: e }, { msDuration: 300, timing: "sine", onComplete: () => {} })), this.m_animation.Start());
}
UpdateDragOffset(e) {
let t,
n = e.clientX;
for (t = 0; t < this.m_rgOrderedRenderedTabs.length; t++) {
let e = this.m_rgOrderedRenderedTabs[t],
i = this.m_mapTabs.get(e.GetUniqueID()),
o = i && i.GetBoundingClientRect();
if (i && o && n - o.left < o.width && (this.m_nInitialTabDragOffset < 0 && (this.m_nInitialTabDragOffset = n - o.left), n - this.m_nInitialTabDragOffset < o.left + o.width / 2)) break;
}
this.state.iDragIndex != t && this.setState({ iDragIndex: t });
}
OnTabRef(e, t) {
t ? this.m_mapTabs.set(e, t) : this.m_mapTabs.delete(e), this.UpdateWindowIcon();
}
OnScrollRef(e) {
this.m_elScroll = e ? e.GetScrollRef() : null;
}
SelectTab(e) {
this.props.tabSet.ActivateTab(e);
}
OnDragStart(e) {
let t = c.g_FriendsUIDesktopApp.DragDropManager.GetDragData();
t && "chattab" == t.type && (t.tabSet = this.props.tabSet);
}
OnChatTabContianerRef(e) {
this.m_elchatTabDiv = e;
}
OnDragEnd() {
this.m_tabDrag = void 0;
}
OnBackClick(e) {
this.props.ResponsiveWindowState.SetActiveView(m.yf.FriendsList);
}
ShowFriendsList(e) {
l.Ul.UIStore.SetTheaterMode(!1), l.Ul.UIStore.SetFriendsListCollapsed((0, c.Um)(this, e), !1);
}
StartTopbarEventListener() {
this.m_elchatTabDiv.ownerDocument.defaultView.addEventListener("mousemove", this.OnTopbarHovered);
}
OnTopbarHovered(e) {
let t = e.clientY;
l.Ul.UIStore.GetTheaterMode() || this.m_elchatTabDiv.ownerDocument.defaultView.removeEventListener("mousemove", this.OnTopbarHovered), t > this.m_nTheaterTopHoverHeight ? this.state.bTheaterModeTopHovered && (this.setState({ bTheaterModeTopHovered: !1 }), (this.m_nTheaterTopHoverHeight = 12)) : this.state.bTheaterModeTopHovered || ((this.m_nTheaterTopHoverHeight = 50), this.setState({ bTheaterModeTopHovered: !0 }));
}
OnTabSelectorClick(e) {
let t = 33 * this.m_mapTabs.size + (e.currentTarget.offsetTop + e.currentTarget.clientHeight) + 16 > e.currentTarget.ownerDocument.defaultView.innerHeight;
(0, S.yV)(g.createElement(P, { tabSet: this.props.tabSet }), e.currentTarget, { bOverlapHorizontal: !0, bPreferPopLeft: !1, bPreferPopTop: !1, bForcePopup: t });
}
UpdateWindowIcon() {
try {
if (this.props.popup && this.props.popup.window && void 0 !== this.props.popup.window.SteamClient) {
let e = !1,
t = !1,
n = this.props.tabSet.tabs;
for (let i of n) i.GetUnreadMessageCount() > 0 && (e = !0), i.IsVoiceActive() && (t = !0);
t ? this.props.popup.window.SteamClient.Window.SetWindowIcon("voice") : e ? this.props.popup.window.SteamClient.Window.SetWindowIcon("messages") : this.props.popup.window.SteamClient.Window.SetWindowIcon("steam");
}
} catch (e) {}
}
render() {
var e, t;
let n = l.Ul.UIStore.GetTheaterMode();
if ((this.UpdateWindowIcon(), this.props.tabSet.tabCount <= 0 && !this.props.popup)) return null;
let i,
r = this.props.tabSet.tabs,
s = this.props.activeTab,
m = !1,
d = !1;
if (s instanceof a.we) {
m = s.isBroadcastShown;
} else s && s.IsBroadcast && s.IsBroadcast() && (m = !0);
for (let e of r)
if (e.GetUnreadMessageCount() > 0) {
d = !0;
break;
}
if (this.m_tabDrag) {
let e = r.indexOf(this.m_tabDrag);
-1 != e ? e != this.state.iDragIndex && ((i = r.slice()), (0, T.hV)(i, e, Math.min(this.state.iDragIndex, r.length - 1))) : this.state.iDragIndex < r.length ? ((i = r.slice()), i.splice(this.state.iDragIndex, 0, this.m_tabDrag)) : (i = r.concat(this.m_tabDrag));
}
(r = i || r), (this.m_rgOrderedRenderedTabs = r);
let h,
u = "ChatTabs titleBarContainer";
this.props.popup && (u += " HasWindowControls"), 1 == r.length ? (u += " OneTab") : this.state.windowWidth < 180 * r.length + 180 && (u += " HasTabs"), l.Ul.SettingsStore.FriendsSettings.bCompactFriendsList && (u += " compactView"), this.state.bTheaterModeTopHovered && (u += " TheaterTopHovered"), (0, x.Uy)() && (u += " OSX"), this.props.ResponsiveWindowState && (h = g.createElement("div", { className: "ChatTabsBackButton", onClick: this.OnBackClick }, "<<")), m && (u += " activeTabHasBroadcast");
let p,
_ = !1,
v = !0;
this.props.popup && ((p = (0, c.rb)(this.props.popup)), (v = l.Ul.UIStore.BIsFriendsListSingleWindow(p)), (_ = !(0, l.ns)(p, l.D))), n && this.m_elchatTabDiv && this.StartTopbarEventListener();
const S = (this.m_elchatTabDiv && 180 * this.props.tabSet.tabCount + (o.De.IN_CLIENT ? 168 : 48) > this.m_elchatTabDiv.clientWidth) || !1,
I = _;
return g.createElement(
b.s,
{ "flow-children": "row", className: (0, L.Z)(u, this.props.showOpenFriendsList && "friendsListCollapsed"), onDragStart: this.OnDragStart, ref: this.OnChatTabContianerRef },
this.props.popup && g.createElement(k.T, { hideMin: I, hideMax: I, popup: this.props.popup, className: "chatTitleBar" }),
h,
((n && v) || this.props.showOpenFriendsList) && g.createElement("div", { className: "chatTabOpenFriendsList", onClick: this.ShowFriendsList }, g.createElement(M.ZAu, null), (0, G.Xx)("#FriendsList_ExpandButton")),
this.props.tabSet.tabCount > 0 &&
g.createElement(
"div",
{ className: (0, L.Z)("chatTabSetContainer", (null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) && "gamepadui", o.De.IN_CLIENT && "inclient") },
g.createElement(
R,
{ className: "chatTabList", ref: this.OnScrollRef },
g.createElement(
C.Z,
{ className: F().ChatTabTransitionGroup },
r.map((e, t) => {
let n = this.props.activeTab == e,
i = { enter: F().ChatTabTransition_Enter, enterActive: F().ChatTabTransition_EnterActive, exit: F().ChatTabTransition_Exit, exitActive: F().ChatTabTransition_ExitActive };
return g.createElement(f.Z, { className: "ChatTabTranstionContainer", classNames: i, key: e.GetUniqueID(), timeout: 350 }, g.createElement(U, { tab: e, active: n, selectTab: this.SelectTab, ref: (t) => this.OnTabRef(e.GetUniqueID(), t), fnOnDragEnd: this.OnDragEnd }));
}),
),
),
S && !(null === (t = this.context) || void 0 === t ? void 0 : t.IN_GAMEPADUI) && g.createElement("div", { className: "chatTabSelector" + (d ? " UnreadMessages" : ""), onClick: this.OnTabSelectorClick }, g.createElement(M.$gZ, null), d && g.createElement("div", { className: "ChatUnreadMessageIndicator" })),
),
g.createElement("div", { className: "dropTargetBox" }),
n && g.createElement("div", { className: "theaterModeHoverSpace" + (d ? " hasUnreadMessages" : "") }, d && g.createElement("div", { className: "ChatUnreadMessageIndicator" }, g.createElement("div", { className: "chatUnreadCircle" }))),
);
}
};
(N.contextType = x.E_), (0, i.gn)([p.LO], N.prototype, "m_nTheaterTopHoverHeight", void 0), (0, i.gn)([p.LO], N.prototype, "m_tabDrag", void 0), (0, i.gn)([D.ak], N.prototype, "OnWindowResizeEvent", null), (0, i.gn)([D.ak], N.prototype, "HandleDropComplete", null), (0, i.gn)([D.ak], N.prototype, "OnTabRef", null), (0, i.gn)([D.ak], N.prototype, "OnScrollRef", null), (0, i.gn)([D.ak], N.prototype, "SelectTab", null), (0, i.gn)([D.ak], N.prototype, "OnDragStart", null), (0, i.gn)([D.ak], N.prototype, "OnChatTabContianerRef", null), (0, i.gn)([D.ak], N.prototype, "OnDragEnd", null), (0, i.gn)([D.ak], N.prototype, "OnBackClick", null), (0, i.gn)([D.ak], N.prototype, "ShowFriendsList", null), (0, i.gn)([D.ak], N.prototype, "StartTopbarEventListener", null), (0, i.gn)([D.ak], N.prototype, "OnTopbarHovered", null), (0, i.gn)([D.ak], N.prototype, "OnTabSelectorClick", null), (N = (0, i.gn)([_.Pi], N));
let P = class extends g.Component {
SelectTab(e) {
this.props.tabSet.ActivateTab(e);
}
render() {
let e = [],
t = this.props.tabSet.tabs;
for (let n of t) {
let t = g.createElement(U, { tab: n, active: !0, selectTab: this.SelectTab, fnOnDragEnd: null, bDisableContextMenu: !0 });
e.push(g.createElement(I.Zo, { key: n.GetUniqueID(), className: "ChatTabContextMenuItem", onSelected: null }, t));
}
return g.createElement(I.xV, { className: "ChatTabs ChatTabsContextMenu compactView CompactFriendsList" }, e);
}
};
(0, i.gn)([D.ak], P.prototype, "SelectTab", null), (P = (0, i.gn)([_.Pi], P));
let U = class extends g.Component {
constructor() {
super(...arguments), (this.m_bMiddleMouseDown = !1);
}
BindChatTab(e) {
this.m_elChatTab = e;
}
GetBoundingClientRect() {
return this.m_elChatTab ? this.m_elChatTab.getBoundingClientRect() : void 0;
}
GetChatTabRef() {
return this.m_elChatTab;
}
OnDragStart(e) {
let t = e.clientX - e.currentTarget.getBoundingClientRect().left,
n = e.clientY - e.currentTarget.getBoundingClientRect().top;
c.g_FriendsUIDesktopApp.DragDropManager.StartDrag({ type: "chattab", tab: this.props.tab, offsetX: t, offsetY: n });
}
OnDragEnd(e) {
let t = c.g_FriendsUIDesktopApp.DragDropManager.GetDragData();
if (t && "chattab" == t.type) {
let n = t,
i = !1;
if (n.tabSet) {
i = l.Ul.UIStore.GetPerContextChatData(n.tabSet.GetBrowserContext()).BUsePopups();
}
if (!c.g_FriendsUIDesktopApp.DragDropManager.BWasDropConsumed() && n.tabSet && n.tabSet.tabCount > 1 && i) {
let t = e.currentTarget.getBoundingClientRect();
const o = 100;
let r = t.left - e.clientX,
a = t.top - e.clientY;
if (r * r + a * a > o * o) {
let t = e.currentTarget.ownerDocument.defaultView,
o = { left: Math.max(0, e.screenX - n.offsetX), top: Math.max(0, e.screenY - n.offsetY), width: t.innerWidth, height: t.innerHeight };
if ((this.props.fnOnDragEnd(), i)) {
let t = (0, c.Um)(this, e);
e.currentTarget.ownerDocument.defaultView.SteamClient.Window.GetMousePositionDetails().then((e) => {
e && ((o.left = -n.offsetX), (o.top = -n.offsetY)), l.Ul.UIStore.MoveTabToNewPopup(t, n.tab, o, e);
});
} else l.Ul.UIStore.MoveTabToNewPopup((0, c.Um)(this, e), n.tab, o);
}
}
}
c.g_FriendsUIDesktopApp.DragDropManager.EndDrag();
}
OnMouseDown(e) {
0 == e.button ? this.props.selectTab(this.props.tab) : 1 == e.button && (e.preventDefault(), (this.m_bMiddleMouseDown = !0));
}
OnOKButton(e) {
this.props.selectTab(this.props.tab);
}
OnMouseUp(e) {
1 == e.button && this.m_bMiddleMouseDown && (l.Ul.UIStore.CloseTab((0, c.Um)(this, e), this.props.tab), e.preventDefault(), (this.m_bMiddleMouseDown = !1));
}
OnMouseLeave(e) {
this.m_bMiddleMouseDown = !1;
}
OnCloseMouseDown(e) {
e.stopPropagation();
}
OnCloseClick(e) {
l.Ul.UIStore.CloseTab((0, c.Um)(this, e), this.props.tab), e.stopPropagation();
}
OnContextMenu(e) {
if (this.props.bDisableContextMenu) return;
let t = this.props.tab;
if (t.IsChatRoom()) {
if (t instanceof a.we) {
let n = t;
(0, h.bU)(e, n.GetGroup(), { tab: t });
}
} else {
let t = this.props.tab.GetChatView();
(0, u.$W)((0, c.Um)(this, e), { tab: this.props.tab }, t.chat.chat_partner, e);
}
}
render() {
var e, t, n;
let i, o;
(null === (e = this.props.tab.GetChatView()) || void 0 === e ? void 0 : e.IsFriendChat()) && ((i = this.props.tab.GetChatView()), (o = i.chat.accountid_partner));
let r = null != o && l.Ul.VoiceStore.BSelfHasAcceptedOrInitiatedOneOnOneChat(o),
a = null != o && l.Ul.VoiceStore.BPartnerHasAcceptedOrInitiatedOneOnOneChat(o),
s = r && !a,
c = l.Ul.ChatStore.VoiceChat.IsMicMuted(),
m = this.props.tab,
d = m.IsVoiceActive(),
h = (0, L.Z)(F().ChatTab, "no-drag", this.props.active && F().Active, d && F().VoiceActive, d && c && F().MicMuted);
return g.createElement(
b.s,
{ className: h, ref: this.BindChatTab, focusable: null != this.props.selectTab, draggable: !0, onSecondaryButton: this.OnCloseClick, onSecondaryActionDescription: (0, G.Xx)("#Chat_CloseTabAction_SteamDeck"), onOKButton: this.OnOKButton, onMenuButton: this.OnContextMenu, onMouseDown: this.OnMouseDown, onMouseUp: this.OnMouseUp, onMouseLeave: this.OnMouseLeave, onDragStart: this.OnDragStart, onDragEnd: this.OnDragEnd, onContextMenu: this.OnContextMenu, onOKActionDescription: null, onMenuActionDescription: (0, G.Xx)("#Chat_Tab_ContextMenu") },
g.createElement(
H,
{ tab: this.props.tab, active: this.props.active },
g.createElement(
"div",
{ className: F().ChatTabRow },
m.IsVoiceActive() && g.createElement("div", { className: F().MicStatus, title: c ? (0, G.Xx)("#Tooltip_MicStatus_Muted") : (0, G.Xx)("#Tooltip_MicStatus_Active") }, (null === (t = this.context) || void 0 === t ? void 0 : t.IN_GAMEPADUI) ? (s ? g.createElement(M.NN7, null) : g.createElement(M.Cq4, null)) : g.createElement(M.JgI, { off: c })),
g.createElement(E.SV, null, g.createElement(X, { tab: this.props.tab })),
g.createElement(
E.SV,
null,
(null === (n = this.context) || void 0 === n ? void 0 : n.IN_GAMEPADUI) &&
(function (e) {
if (!e) return null;
let t = e.chat.accountid_partner,
n = l.Ul.VoiceStore.BSelfHasAcceptedOrInitiatedOneOnOneChat(t),
i = l.Ul.VoiceStore.BPartnerHasAcceptedOrInitiatedOneOnOneChat(t);
if (!i && !n) return null;
let o = "",
r = l.Ul.VoiceStore.BSelfHadPreviouslyJoinedOneOnOneChat(t),
a = e.chat.chat_partner,
s = l.Ul.CMInterface.steamid.GetAccountID(),
c = !1,
m = !1,
d = !1;
l.Ul.VoiceStore.GetActiveOneOnOneVoiceChatAccountID() == t && ((c = l.Ul.VoiceStore.HasBeenAttemptingOverTwoSeconds() || l.Ul.VoiceStore.IsAttemptingReconnect()), (m = !l.Ul.VoiceStore.BIsAccountFullyConnectedToActiveVoiceChat(s) || l.Ul.VoiceStore.IsAttemptingReconnect()), (d = !l.Ul.VoiceStore.BIsAccountFullyConnectedToActiveVoiceChat(t)));
o = n && !i ? (0, G.Xx)("#Voice_WaitingForFriendToJoin", a.display_name) : i && !n ? (r ? (0, G.Xx)("#Voice_ChannelRejoinAvailable", a.display_name) : (0, G.Xx)("#Voice_ChannelAvailable", a.display_name)) : m ? (c ? (0, G.Xx)("#VoiceChatConnecting") : "") : !m && d ? (0, G.Xx)("#VoiceChatParterConnecting", a.display_name) : (0, G.Xx)("#Voice_ChannelActive", a.display_name);
return g.createElement("div", { className: F().VoiceStatusMessage }, o);
})(i),
),
g.createElement(V, { onClick: this.OnCloseClick, onMouseDown: this.OnCloseMouseDown }),
g.createElement(W, { tab: this.props.tab }),
),
),
);
}
};
function V(e) {
return g.createElement("div", { title: (0, G.Xx)("#Chat_CloseTooltip"), className: F().CloseButton, onClick: e.onClick, onMouseDown: e.onMouseDown }, g.createElement(M.pVO, null));
}
(U.contextType = x.E_), (0, i.gn)([D.ak], U.prototype, "BindChatTab", null), (0, i.gn)([D.ak], U.prototype, "OnDragStart", null), (0, i.gn)([D.ak], U.prototype, "OnDragEnd", null), (0, i.gn)([D.ak], U.prototype, "OnMouseDown", null), (0, i.gn)([D.ak], U.prototype, "OnOKButton", null), (0, i.gn)([D.ak], U.prototype, "OnMouseUp", null), (0, i.gn)([D.ak], U.prototype, "OnMouseLeave", null), (0, i.gn)([D.ak], U.prototype, "OnCloseMouseDown", null), (0, i.gn)([D.ak], U.prototype, "OnCloseClick", null), (0, i.gn)([D.ak], U.prototype, "OnContextMenu", null), (U = (0, i.gn)([_.Pi], U));
class H extends g.Component {
constructor() {
super(...arguments), (this.m_refFriendHover = g.createRef());
}
componentDidUpdate(e) {
!e.active && this.props.active && this.m_refFriendHover.current && this.m_refFriendHover.current.Hide();
}
render() {
let e = this.props,
t = e.tab.GetChatView();
if (t && t.chat instanceof s.a) {
let n = t.chat.chat_partner;
return g.createElement(B.yd, { key: n.accountid, ref: this.m_refFriendHover, friend: n, context: {}, disableContextMenu: !0, direction: "bottom" }, e.children);
}
return e.children;
}
}
let W = class extends g.Component {
render() {
const { tab: e } = this.props;
if (e.IsChatRoom() && e instanceof a.we) {
if (!e.GetGroup().hasUnreadChatMessage) return null;
} else if (!e.GetUnreadMessageCount()) return null;
return g.createElement("div", { className: F().UnreadGlow }, g.createElement("div", { className: F().UnreadCircle }));
}
};
W = (0, i.gn)([_.Pi], W);
let X = class extends g.Component {
render() {
var e, t, n, i;
let o = this.props.tab.GetChatView();
if (o && o.chat instanceof s.a) {
let r = o.chat.chat_partner,
a = r.persona.is_ingame || (null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI),
s = (null === (t = this.context) || void 0 === t ? void 0 : t.IN_GAMEPADUI) ? "Medium" : "X-Small";
return g.createElement("div", { className: F().ChatTabContent_Friend }, g.createElement(B.mo, { friend: o.chat.chat_partner, noActions: !0, context: { chat: o.chat }, bHideGameName: !a, bHideEnhancedRichPresenceLabel: !(null === (n = this.context) || void 0 === n ? void 0 : n.IN_GAMEPADUI), bHidePersona: !a, bHideSnooze: !1, avatarSize: s }), (null === (i = this.context) || void 0 === i ? void 0 : i.IN_GAMEPADUI) && !r.is_friend && g.createElement("div", { className: F().IsNotFriendLabel }, (0, G.Xx)("#Friend_Menu_NotAFriendLabel"), " "));
}
if (o && o.chat instanceof r.K) {
let e = this.props.tab.GetGroup(),
t = !0;
return g.createElement("div", { className: F().ChatTabContent_ChatRoom }, g.createElement(d._P, { group: e, smaller: t, smallish: !t }), g.createElement("div", { className: F().ChatTabContent_ChatRoomName }, this.props.tab.GetTabName()));
}
if (this.props.tab.IsBroadcast()) {
let e = this.props.tab.GetTabName();
return g.createElement("div", { className: F().ChatTabContent_ChatRoom }, g.createElement("div", { className: "ChatRoomGroupAvatar HasAvatar Smaller" }, g.createElement("img", { className: "ChatRoomGroupAvatar_Avatar", src: v.rr.tabIcon })), g.createElement("div", { className: F().ChatTabContent_ChatRoomName }, e));
}
return null;
}
};
function j(e) {
c.g_FriendsUIDesktopApp.UIDisplayPrefs.bDontShowVoiceAlert || (e && (0, A.BR)(g.createElement(z, null), e, "ActiveVoiceAlert", { strTitle: (0, G.Xx)("#Chat_StillInVoiceDialog_Title"), popupWidth: 650, popupHeight: 340 }, (0, c.Og)(e)));
}
(X.contextType = x.E_), (X = (0, i.gn)([_.Pi], X));
let z = class extends g.Component {
constructor(e) {
super(e), (this.state = { bDontShowChecked: !1, strChatName: "" }), (this.m_strChannelName = "");
}
DismissDialog() {
this.props.closeModal();
}
OnSubmit() {
c.g_FriendsUIDesktopApp.SetUIDisplayPref("bDontShowVoiceAlert", this.state.bDontShowChecked), this.props.closeModal();
}
OnDialogChecked() {
this.setState({ bDontShowChecked: !this.state.bDontShowChecked });
}
OnManualVoiceChatExit() {
l.Ul.VoiceStore.OnUserEndVoiceChat(), this.OnSubmit();
}
componentDidMount() {
this.setState({ strChatName: l.Ul.ChatStore.GetActiveVoiceChat().name });
}
render() {
return g.createElement(
A.e1,
{ onEscKeypress: this.DismissDialog },
g.createElement(
y.oX,
{ classNameContent: "CloseActiveVoiceWindowConfirmation", onSubmit: this.OnSubmit },
g.createElement(y.h4, null, g.createElement("div", null, (0, G.Xx)("#Chat_StillInVoiceDialog_Title"))),
g.createElement(y.uT, null, g.createElement("div", { className: "activeVoiceDetails" }, (0, G.Xx)("#Chat_StillInVoiceDialog_Desc1")), g.createElement("div", { className: "activeVoiceDetails" }, (0, G.Xx)("#Chat_StillInVoiceDialog_Desc2")), g.createElement("div", { className: "voiceControlsExample" }, g.createElement(B.qe, { name: this.state.strChatName, chat: l.Ul.ChatStore.GetActiveVoiceChat(), nostatus: !0 }), g.createElement("div", { className: "circleHighlight voiceExit" })), !1),
g.createElement(y.$_, null, g.createElement("div", { className: "_DialogColLayout" }, g.createElement(y.KM, { onClick: this.OnSubmit }, (0, G.Xx)("#Chat_StillInVoiceDialog_KeepChatting"))), g.createElement("div", { className: "dontShowConfirmation", onClick: this.OnDialogChecked }, g.createElement(y.ji, { checked: this.state.bDontShowChecked, onChange: this.OnDialogChecked }), (0, G.Xx)("#Dialog_DontShowMeAgain"))),
),
);
}
};
(0, i.gn)([D.ak], z.prototype, "DismissDialog", null), (0, i.gn)([D.ak], z.prototype, "OnSubmit", null), (0, i.gn)([D.ak], z.prototype, "OnDialogChecked", null), (0, i.gn)([D.ak], z.prototype, "OnManualVoiceChatExit", null), (z = (0, i.gn)([_.Pi], z));
},
41111: (e, t, n) => {
"use strict";
n.d(t, { hg: () => b, oC: () => I, t4: () => y });
var i = n(85556),
o = n(10553),
r = n(37234),
a = n(72746),
s = n(23133),
l = n(618),
c = n(94623),
m = n(46057),
d = n(68816),
h = n(50649),
u = n(27378),
p = n(11259),
_ = n(16518),
g = n(84290),
C = n(2049),
f = n(93635),
v = n(83817),
S = n(8070);
function b(e, t, n, i, o) {
I(e, t, n, i, !1, o);
}
function I(e, t, n, i, o, a) {
(0, d.BR)(u.createElement(D, { browserContext: e, chatRoomGroup: n, chatRoom: i, bIsDropInvite: o, vecInvitePlayers: a }), t, "ChatRoomGroupInviteDialog", { strTitle: (0, g.Xx)("#Chat_CreateChatRoom"), popupWidth: 664, popupHeight: 680 }, (0, r.Og)(t));
}
let y = class extends u.Component {
constructor(e) {
super(e);
}
componentDidMount() {
let e = this.props.chat.lastChatLinkInfo;
(!e || Date.now() >= e.rtExpires) && this.GenerateLink(86400);
}
GenerateLink(e) {
this.props.chat.CreateInviteLink(e);
}
OnFocus(e) {
e.target.select();
}
render() {
let e = this.props.chat.lastChatLinkInfo,
t = (0, g.Xx)("#Chat_Invite_Loading");
return this.props.disabled && ((e = void 0), (t = "")), u.createElement(u.Fragment, null, u.createElement(p.II, { label: (0, g.Xx)("#Chat_Invite_Linkheader"), className: "InviteFriendToChatDialog_LinkInput", type: "text", value: e ? e.strInviteURL : t, readOnly: !0, bShowCopyAction: !!e, onFocus: this.OnFocus, onClick: this.OnFocus }), !this.props.disabled && u.createElement(E, { onGenerate: this.GenerateLink, chat: this.props.chat }));
}
};
(0, i.gn)([C.ak], y.prototype, "GenerateLink", null), (0, i.gn)([C.ak], y.prototype, "OnFocus", null), (y = (0, i.gn)([h.Pi], y));
let E = class extends u.Component {
constructor(e) {
super(e);
}
OnDropDownChange(e, t) {
this.props.onGenerate(e.data), t.SetSelectedOption(void 0);
}
CreateExpiresText(e) {
if (0 == e) return (0, g.Xx)("#InviteLink_ExpiresNever_Short");
return e - a.Ul.GetServerRTime32() > 3600 ? (0, g.Xx)("#InviteLink_ExpiresDay_Short") : (0, g.Xx)("#InviteLink_ExpiresHour_Short");
}
render() {
let e = this.props.chat.lastChatLinkInfo,
t = [
{ label: (0, g.Xx)("#InviteLink_ExpiresHour_Short"), data: 3600 },
{ label: (0, g.Xx)("#InviteLink_ExpiresDay_Short"), data: 86400 },
{ label: (0, g.Xx)("#InviteLink_ExpiresNever_Short"), data: 0 },
];
return u.createElement("div", { className: "expireLinkInContainer" }, u.createElement(p.__, null, (0, g.Xx)("#InviteLink_ExpireDropDownLabel")), u.createElement(p.ry, { strClassName: "inviteLinkDropDown", rgOptions: t, strDefaultLabel: e ? this.CreateExpiresText(e.rtExpires) : u.createElement("span", null, " "), onChange: this.OnDropDownChange, selectedOption: void 0 }));
}
};
(0, i.gn)([C.ak], E.prototype, "OnDropDownChange", null), (E = (0, i.gn)([h.Pi], E));
class D extends u.PureComponent {
constructor(e) {
super(e), (this.state = { dropToInviteFriend: void 0, rgPickedFriends: [] }), this.BuildMemberOfGroupSet(e);
}
componentDidUpdate(e) {
e.chatRoomGroup !== this.props.chatRoomGroup && this.BuildMemberOfGroupSet(this.props);
}
BuildMemberOfGroupSet(e) {
let t = e.chatRoomGroup;
(this.m_setMembersOfGroup = t.memberList.GetCurrentMemberSet()), this.forceUpdate();
}
DismissDialog() {
this.props.closeModal();
}
OnSubmit() {
for (let e of this.state.rgPickedFriends) this.props.chatRoomGroup.InviteFriend(e.accountid, this.props.chatRoom);
this.props.closeModal();
}
OnDragEnter(e, t) {
if (((0, f.X)((e && "friend" == e.type) || t, "Invalid data type passed to ChatRoomGroupDialog.OnDragEnter"), e)) {
let t = e;
t.friend && this.setState({ rgPickedFriends: this.state.rgPickedFriends.concat(t.friend) });
}
return !0;
}
OnDragLeave() {
const { dropToInviteFriend: e, rgPickedFriends: t } = this.state;
if (e) {
const n = t.findIndex((t) => t.accountid === e.accountid);
this.setState({ dropToInviteFriend: void 0, rgPickedFriends: t.slice(0, n).concat(t.slice(n + 1)) });
}
}
OnDrop(e, t) {
if (((0, f.X)(e && "friend" == e.type, "Invalid data type passed to ChatRoomGroupDialog.OnDrop"), e && "friend" == e.type)) {
let t = e;
if (t.friend) {
r.g_FriendsUIDesktopApp.DragDropManager.SetDropConsumed();
this.state.rgPickedFriends.findIndex((e) => e.accountid === t.friend.accountid) > -1 ? this.setState({ dropToInviteFriend: void 0, rgPickedFriends: this.state.rgPickedFriends.concat(t.friend) }) : this.state.dropToInviteFriend && this.setState({ dropToInviteFriend: void 0 });
}
}
}
GetDragDropProps() {
let e = { rgAcceptedTypes: ["friend"] };
return (e.fnDragEnter = this.OnDragEnter), (e.fnDragLeave = this.OnDragLeave), (e.fnDrop = this.OnDrop), e;
}
render() {
var e, t;
let n = this.props.chatRoomGroup.GetDefaultChatRoom();
this.props.chatRoom && (n = this.props.chatRoom);
let i,
o = this.props.chatRoomGroup.name,
r = null != this.props.chatRoom,
m = new Set([]),
h = this.props.chatRoomGroup.BCanInvite();
h
? this.props.chatRoom || (m = this.m_setMembersOfGroup)
: this.props.chatRoom
? a.Ul.FriendStore.all_friends.forEach((e) => {
this.props.chatRoomGroup.BHasMember(e.accountid) || m.add(e.accountid);
})
: (0, f.X)(!1, "User should not be able to invite to the group"),
(i = this.props.bIsDropInvite ? (0, g.Xx)("#Chat_InviteFriends_DropInvite_Pre") : h ? (0, g.Xx)("#Chat_InviteFriends") : (0, g.Xx)("#Chat_InviteGroupMembers"));
let _ = "ChatRoomGroupInviteDialog" + (this.props.bIsDropInvite ? " IsDropInvite" : "");
(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) && (_ += " GamepadMode");
return u.createElement(
d.e1,
{ onEscKeypress: this.DismissDialog },
u.createElement(
p.oX,
{ classNameContent: _, onSubmit: this.OnSubmit },
u.createElement(p.h4, null, r ? u.createElement("div", { className: "InviteToVoiceHeader" }, (0, g.Xx)("#Chat_Actions_InviteFriend_VoiceChat"), u.createElement("div", { className: "DialogHeaderSubtitle DialogHighlight" }, '"', this.props.chatRoom.name, '"')) : (0, g.Xx)("#Chat_Actions_InviteFriend"), u.createElement("div", { className: "displayRow" }, u.createElement(l._P, { group: this.props.chatRoomGroup, small: !0 }), u.createElement("div", { className: "DialogHeaderSubtitle DialogHighlight" }, o))),
u.createElement(p.uT, null, u.createElement(S.e, null, !this.props.bIsDropInvite && h && !(null === (t = this.context) || void 0 === t ? void 0 : t.IN_GAMEPADUI) && u.createElement(u.Fragment, null, u.createElement("div", { className: "inviteLinkContainer" }, u.createElement(y, { chat: n, disabled: !1 })), u.createElement("div", { className: "OrSeparator" }, u.createElement("div", { className: "HBar" }), u.createElement("div", { className: "OrSeparatorLabel" }, (0, g.Xx)("#Chat_InviteFriends_OR_Separator")), u.createElement("div", { className: "HBar" }))), u.createElement(s.G, Object.assign({ className: "" }, this.GetDragDropProps()), u.createElement(c.B, { label: i, eSort: 0, rgPickedFriends: this.state.rgPickedFriends, bDropInvite: this.props.bIsDropInvite, renderChosenFriend: w, onChange: (e) => this.setState({ rgPickedFriends: e }), excludeFriend: (e) => m.has(e.accountid) })))),
u.createElement(p.$_, null, u.createElement(v.s, { className: "DialogTwoColLayout _DialogColLayout", "flow-children": "row" }, u.createElement(p.KM, { disabled: 0 === this.state.rgPickedFriends.length }, (0, g.Xx)("#Chat_Invite")), u.createElement(p.zx, { onClick: this.DismissDialog }, (0, g.Xx)("#Button_Close")))),
),
);
}
}
(D.contextType = o.E_), (0, i.gn)([C.ak], D.prototype, "DismissDialog", null), (0, i.gn)([C.ak], D.prototype, "OnSubmit", null), (0, i.gn)([C.ak], D.prototype, "OnDragEnter", null), (0, i.gn)([C.ak], D.prototype, "OnDragLeave", null), (0, i.gn)([C.ak], D.prototype, "OnDrop", null);
let w = (0, h.Pi)((e) =>
u.createElement(
u.Fragment,
null,
u.createElement(
m.yd,
{ friend: e.friend, context: null },
u.createElement(
v.s,
{
className: "FriendPicker_ChosenFriend",
onActivate: () => {
e.onClick(e.friend);
},
},
u.createElement("span", null, e.friend.display_name),
u.createElement(_.pVO, null),
),
),
),
);
},
34268: (e, t, n) => {
"use strict";
n.d(t, { n: () => H });
var i = n(85556),
o = n(14206),
r = n.n(o),
a = n(19953),
s = n(93354),
l = n(37234),
c = n(72746),
m = n(68730),
d = n(41111),
h = n(71357),
u = n(46057),
p = n(68816),
_ = n(83817),
g = n(79588),
C = n(50649),
f = n(27378),
v = n(11259),
S = n(16518),
b = n(99165),
I = n(88669),
y = n(9824),
E = n(84290),
D = n(2049),
w = n(51075),
R = n(14341),
A = n(88991),
M = n(93635),
k = n(51630),
T = n.n(k),
L = n(87018);
function G(e) {
const { title: t, pages: n, children: i, initialActivePage: o, renderNavFooter: r } = e,
[a, s] = (0, f.useState)(o || n[0]);
return f.createElement(
_.s,
{ className: T().Container, "flow-children": "row" },
f.createElement(
_.s,
{ className: T().Nav, "flow-children": "column" },
f.createElement("span", { className: T().NavTitle }, t),
f.createElement(
_.s,
{ className: T().NavItems, "flow-children": "column" },
n.map((e) => f.createElement(O, { key: e, active: e === a, onClick: () => s(e) }, e)),
),
r && r(),
),
f.createElement("div", { className: T().Content }, i(a)),
);
}
const O = (e) => {
const { active: t, onClick: n } = e,
o = (0, i._T)(e, ["active", "onClick"]);
return f.createElement(_.s, Object.assign({}, o, { focusable: !0, onActivate: n, className: (0, L.Z)(T().NavItem, t && T().Active) }));
};
var F = n(98865),
B = n.n(F);
const x = (e) => {
const { className: t } = e,
n = (0, i._T)(e, ["className"]);
return f.createElement("div", Object.assign({ className: (0, L.Z)(B().DialogTitle, t) }, n));
},
N = (e) => {
const { className: t } = e,
n = (0, i._T)(e, ["className"]);
return f.createElement("div", Object.assign({ className: (0, L.Z)(B().DialogContent, t) }, n));
};
var P = n(21658),
U = n.n(P),
V = n(10553);
function H(e, t) {
(0, p.BR)(f.createElement(W, { groupView: t }), e, "ChatRoomGroupSettings", { strTitle: (0, E.Xx)("#GroupSettings"), popupWidth: 842, popupHeight: 600 }, (0, l.Og)(e), { nDragAreaHeight: 32 });
}
let W = class extends f.Component {
constructor(e) {
super(e), (this.m_inviteLinks = { loadingState: "pending", rgInviteLinks: null }), (this.m_bans = new s.Xc()), (this.m_invitedUsers = { loadingState: "pending", rgInvitedUsers: null }), (0, g.rC)(this), (this.state = { strRoomName: this.props.groupView.GetGroup().name });
}
DismissDialog() {
this.props.closeModal();
}
CloseDialog() {
this.props.closeModal();
}
OnLeave(e) {
let t = (0, I.RA)(e),
n = (0, l.Um)(null, e),
i = this.props.groupView.GetGroup(),
o = i.BIsClanChatRoom() ? "#Chat_Actions_LeaveChatRoomGroup_ClanConfirm" : i.BIsAccountIDOwner(c.Ul.CMInterface.steamid.GetAccountID()) ? "#Chat_Actions_OwnerLeaveChatRoomGroup_Confirm" : "#Chat_Actions_LeaveChatRoomGroup_Confirm";
(0, h.p3)(t, (0, E.Xx)("#GroupSettings_Leave_Section"), (0, E.Xx)(o, i.name), (0, E.Xx)("#GroupSettings_Leave_Button"))
.then(() => {
i.LeaveChatRoomGroup(n);
})
.then(() => {
this.props.closeModal();
})
.catch(() => {});
}
GetNamedGroupPageList() {
var e;
const t = this.props.groupView.GetGroup();
return (null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI)
? [
{ title: (0, E.Xx)("#GroupSettings_General_Section"), render: () => f.createElement(z, { group: t }) },
{ title: (0, E.Xx)("#GroupSettings_InvitedUsers_Section"), render: () => f.createElement(te, { group: t, invitedUsers: this.m_invitedUsers }) },
{ title: (0, E.Xx)("#GroupSettings_Bans_Section"), render: () => f.createElement(ne, { group: t, bans: this.m_bans }) },
]
: [
{ title: (0, E.Xx)("#GroupSettings_General_Section"), render: () => f.createElement(z, { group: t }) },
{ title: (0, E.Xx)("#GroupSettings_Channels_Section"), render: () => f.createElement(Z, { groupView: this.props.groupView }) },
{ title: (0, E.Xx)("#GroupSettings_Permissions_Section"), render: () => f.createElement($, { group: t }) },
{ title: (0, E.Xx)("#GroupSettings_Invite_Section"), render: () => f.createElement(ee, { group: t, inviteLinks: this.m_inviteLinks }) },
{ title: (0, E.Xx)("#GroupSettings_InvitedUsers_Section"), render: () => f.createElement(te, { group: t, invitedUsers: this.m_invitedUsers }) },
{ title: (0, E.Xx)("#GroupSettings_Bans_Section"), render: () => f.createElement(ne, { group: t, bans: this.m_bans }) },
];
}
GetNonNamedGroupPageList() {
var e;
const t = this.props.groupView.GetGroup();
return (null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI)
? [
{ title: (0, E.Xx)("#GroupSettings_Save_Section"), render: () => f.createElement(j, { group: t }) },
{ title: (0, E.Xx)("#GroupSettings_Leave_Section"), render: () => f.createElement(K, { group: t }) },
]
: [
{ title: (0, E.Xx)("#GroupSettings_Save_Section"), render: () => f.createElement(j, { group: t }) },
{ title: (0, E.Xx)("#GroupSettings_Invite_Section"), render: () => f.createElement(ee, { group: t, inviteLinks: this.m_inviteLinks }) },
{ title: (0, E.Xx)("#GroupSettings_Leave_Section"), render: () => f.createElement(K, { group: t }) },
];
}
GetPageList() {
return this.props.groupView.GetGroup().IsNamedGroupChat() ? this.GetNamedGroupPageList() : this.GetNonNamedGroupPageList();
}
render() {
let e = this.GetPageList();
const { groupView: t } = this.props,
n = t.GetGroup(),
i = `${n.unique_id}_${n.IsNamedGroupChat()}`;
return f.createElement(
p.e1,
{ onEscKeypress: this.DismissDialog },
f.createElement(G, { title: (0, E.Xx)("#GroupSettings"), pages: e.map(({ title: e }) => e), renderNavFooter: () => f.createElement(X, { onActivate: this.OnLeave }), key: i }, (t) => {
const n = e.find((e) => e.title === t),
i = n ? n.render() : null;
return f.createElement(N, { style: { flexDirection: "column" }, key: t }, i);
}),
);
}
};
(W.contextType = V.E_), (0, i.gn)([g.LO], W.prototype, "m_inviteLinks", void 0), (0, i.gn)([g.LO], W.prototype, "m_invitedUsers", void 0), (0, i.gn)([D.ak], W.prototype, "DismissDialog", null), (0, i.gn)([D.ak], W.prototype, "CloseDialog", null), (0, i.gn)([D.ak], W.prototype, "OnLeave", null), (W = (0, i.gn)([C.Pi], W));
const X = (e) => f.createElement(_.s, Object.assign({ className: U().LeaveButton }, e), f.createElement(S.iz5, null), (0, E.Xx)("#GroupSettings_Leave_Section"));
let j = class extends f.Component {
constructor(e) {
super(e), (this.m_bSaving = !1), (this.m_strError = ""), (0, g.rC)(this);
}
BindInputRef(e) {
this.m_refInput = e;
}
AnimateUpgrade_In() {
document.getElementById("animUp");
}
AnimateUpgrade_Out() {
document.getElementById("animDown");
}
SaveGroup() {
let e = this.props.group;
(this.m_bSaving = !1),
(this.m_strError = ""),
e.SaveChatRoomGroup(this.m_refInput.value).catch((e) => {
(this.m_bSaving = !1), (this.m_strError = 12 == e ? (0, E.Xx)("#GroupSettings_Save_NameError") : (0, E.Xx)("#GroupSettings_Save_GenericError"));
});
}
render() {
let e = this.m_bSaving,
t = this.m_strError;
return f.createElement(v.l0, { className: "DialogBody", onSubmit: this.SaveGroup }, f.createElement(v.Ac, null, (0, E.Xx)("#GroupSettings_Save_Desc"), f.createElement("div", null, f.createElement("ul", null, f.createElement("li", null, (0, E.Xx)("#GroupSettings_Save_Feature_1")), f.createElement("li", null, (0, E.Xx)("#GroupSettings_Save_Feature_2")), f.createElement("li", null, (0, E.Xx)("#GroupSettings_Save_Feature_3")), f.createElement("li", null, (0, E.Xx)("#GroupSettings_Save_Feature_4"))))), f.createElement(v.II, { ref: this.BindInputRef, autoFocus: !0, label: (0, E.Xx)("#GroupSettings_Save_NameGroup"), disabled: e }), !e && f.createElement(f.Fragment, null, t.length > 0 && f.createElement("div", { className: "ErrorWhileSaving" }, t), f.createElement(v.KM, { className: "_FixedHeight" }, (0, E.Xx)("#GroupSettings_Save_Section"))), e && f.createElement(b.V, null));
}
};
(0, i.gn)([g.LO], j.prototype, "m_bSaving", void 0), (0, i.gn)([g.LO], j.prototype, "m_strError", void 0), (0, i.gn)([D.ak], j.prototype, "BindInputRef", null), (0, i.gn)([D.ak], j.prototype, "AnimateUpgrade_In", null), (0, i.gn)([D.ak], j.prototype, "AnimateUpgrade_Out", null), (0, i.gn)([D.ak], j.prototype, "SaveGroup", null), (j = (0, i.gn)([C.Pi], j));
let z = class extends f.Component {
constructor(e) {
super(e), (this.m_strRoomName = void 0), (this.m_strTagLine = void 0), (0, g.rC)(this), (this.m_strRoomName = this.props.group.IsNamedGroupChat() ? this.props.group.name : ""), (this.m_strTagLine = this.props.group.tagline), (this.state = { bNameSubmitted: !1, bTaglineSubmitted: !1 });
}
AvatarUploadEResultToString(e) {
let t = "#Chat_Settings_Error_Unknown";
switch (e) {
case 21:
t = "#Chat_Settings_Error_NotLoggedOn";
break;
case 112:
t = "#Chat_Settings_Error_LimitedUser";
break;
case 15:
t = "#Chat_Settings_Error_AccessDenied";
break;
case 2:
t = "#Chat_Settings_Error_FailedToUpload";
break;
case 25:
t = "#Chat_Settings_Error_FileTooLarge";
break;
case 8:
t = "#Chat_Settings_Error_InvalidImage";
break;
case 37:
t = "#Chat_Settings_Error_ServerError";
}
return (0, E.Xx)(t);
}
SetChatRoomGroupAvatarEResultToString(e) {
let t = "#Chat_Settings_Error_Unknown";
switch (e) {
case 10:
case 8:
case 32:
t = "#Chat_Settings_Error_ServerError";
break;
case 15:
t = "#Chat_Settings_Error_NotAdmin";
}
return (0, E.Xx)(t);
}
OnFileChange(e) {
let t = e.target.files[0],
n = this.props.group;
e.preventDefault();
let i = new FormData();
i.set("sessionid", a.De.SESSIONID), i.set("avatar", t);
r()
.post(a.De.CHAT_BASE_URL + "chat/avatarfileupload/", i, { headers: { "content-type": "multipart/form-data" } })
.then((e) => {
1 == e.data.success &&
n.SetChatRoomGroupAvatar(e.data.sha).catch((e) => {
let t = this.SetChatRoomGroupAvatarEResultToString(e);
(0, h.kQ)((0, E.Xx)("#Generic_Error"), t);
});
})
.catch((e) => {
let t = this.AvatarUploadEResultToString(e.response.data.success);
(0, h.kQ)((0, E.Xx)("#Generic_Error"), t), console.log(e.response);
});
}
bindFileUploadControl(e) {
this.m_fileInput = e;
}
OnNameChange(e) {
(this.m_strRoomName = e.target.value), this.setState({ bNameSubmitted: !1 });
}
OnAvatarChange() {
this.m_fileInput.click();
}
OnTagLineChange(e) {
(this.m_strTagLine = e.target.value), this.setState({ bTaglineSubmitted: !1 });
}
OnNameBlur() {
let e = this.props.group;
if (!e.IsNamedGroupChat() && !this.m_strRoomName) return;
if (e.IsNamedGroupChat() && e.name === this.m_strRoomName) return;
const t = () => (this.m_strRoomName = this.props.group.name);
e.RenameChatRoomGroup(this.m_strRoomName).then(t, t);
let n = document.getElementById("b1");
n && n.blur(), this.setState({ bNameSubmitted: !0 });
}
OnTagLineBlur() {
let e = this.props.group;
if (e.tagline != this.m_strTagLine) {
e.SetChatRoomGroupTagline(this.m_strTagLine), this.setState({ bTaglineSubmitted: !0 });
let t = document.getElementById("b2");
t && t.blur();
}
}
OnSubmitSent() {
this.OnTagLineBlur(), this.OnNameBlur();
}
render() {
var e;
const { group: t } = this.props,
n = t.BCanAdminGroup();
let i;
if (t.BIsClanChatRoom()) i = f.createElement("div", null);
else {
if (null == t.GetOwnerAccountID()) i = f.createElement("div", null, " ", (0, E.Xx)("#Chat_Settings_No_Owner"), " ");
else {
let e = c.Ul.FriendStore.GetPlayer(t.GetOwnerAccountID());
i = f.createElement(_.s, { focusable: !1, fnCanTakeFocus: () => !1 }, f.createElement(v.__, null, " ", (0, E.Xx)("#Chat_Settings_General_Owner")), f.createElement(u.mo, { className: "groupOwnerFriend", friend: e, context: null }));
}
}
return f.createElement(
f.Fragment,
null,
f.createElement(x, null, (0, E.Xx)("#GroupSettings_General_Section")),
!n && f.createElement(ie, null),
f.createElement(
v.l0,
{ onSubmit: this.OnSubmitSent, className: (0, L.Z)("DialogBody", U().General) },
f.createElement(
v.Uq,
null,
f.createElement("div", { className: U().AvatarAndUser }, f.createElement(v.__, null, (0, E.Xx)("#Chat_Settings_General_Icon")), f.createElement("img", { className: (0, L.Z)(U().Avatar, "no-drag"), src: t.hasIcon ? t.avatar_url_full : "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" }), !t.hasIcon && f.createElement("div", { className: U().NoIconLabel }, (0, E.Xx)("#Chat_Settings_General_NoIcon")), f.createElement("input", { type: "file", style: { display: "none" }, name: "fileupload", accept: ".png, .jpg, .jpeg, .gif", ref: this.bindFileUploadControl, onChange: this.OnFileChange }), !(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) && f.createElement(v.zx, { onClick: this.OnAvatarChange, disabled: !n }, (0, E.Xx)(t.hasIcon ? "#Chat_Settings_General_ChangeIcon" : "#Chat_Settings_General_AddIcon"))),
f.createElement("div", { className: "GeneralChatSettings" }, f.createElement(v.II, { autoComplete: "off", id: "b1", className: "groupChatName", label: (0, E.Xx)("#Chat_Settings_General_Chat_Name"), type: "text", value: this.m_strRoomName, onChange: this.OnNameChange, onBlur: this.OnNameBlur, autoFocus: !0, disabled: !n }), f.createElement("input", { type: "submit", style: { display: "none" } }), f.createElement(v.II, { autoComplete: "off", id: "b2", className: "groupChatTag", label: (0, E.Xx)("#Chat_Settings_General_Tagline"), type: "text", value: this.m_strTagLine, onChange: this.OnTagLineChange, onBlur: this.OnTagLineBlur, disabled: !n }), i),
),
),
);
}
};
(z.contextType = V.E_), (0, i.gn)([g.LO], z.prototype, "m_strRoomName", void 0), (0, i.gn)([g.LO], z.prototype, "m_strTagLine", void 0), (0, i.gn)([D.ak], z.prototype, "OnFileChange", null), (0, i.gn)([D.ak], z.prototype, "bindFileUploadControl", null), (0, i.gn)([D.ak], z.prototype, "OnNameChange", null), (0, i.gn)([D.ak], z.prototype, "OnAvatarChange", null), (0, i.gn)([D.ak], z.prototype, "OnTagLineChange", null), (0, i.gn)([D.ak], z.prototype, "OnNameBlur", null), (0, i.gn)([D.ak], z.prototype, "OnTagLineBlur", null), (0, i.gn)([D.ak], z.prototype, "OnSubmitSent", null), (z = (0, i.gn)([C.Pi], z));
let K = class extends f.Component {
OnLeave(e) {
let t = e.currentTarget.ownerDocument.defaultView,
n = (0, l.Um)(null, e),
i = this.props.group.BIsClanChatRoom() ? "#Chat_Actions_LeaveChatRoomGroup_ClanConfirm" : this.props.group.BIsAccountIDOwner(c.Ul.CMInterface.steamid.GetAccountID()) ? "#Chat_Actions_OwnerLeaveChatRoomGroup_Confirm" : "#Chat_Actions_LeaveChatRoomGroup_Confirm";
(0, h.p3)(t, (0, E.Xx)("#GroupSettings_Leave_Section"), (0, E.Xx)(i, this.props.group.name), (0, E.Xx)("#GroupSettings_Leave_Button"))
.then(() => {
this.props.group.LeaveChatRoomGroup(n);
})
.catch(() => {});
}
render() {
return f.createElement("div", null, (0, E.Xx)("#GroupSettings_Leave_Confirm"), f.createElement(v.zx, { onClick: this.OnLeave }, (0, E.Xx)("#GroupSettings_Leave_Button")));
}
};
(0, i.gn)([D.ak], K.prototype, "OnLeave", null), (K = (0, i.gn)([C.Pi], K));
let q = class extends f.Component {
render() {
let e = this.props.roomList.indexOf(this.props.room);
(0, M.X)(-1 !== e, "Couldn't find CChatRoom inside of its list?");
let t = e - 1,
n = () => {
this.props.room.GetGroup().ReorderRoom(this.props.roomList[t].GetRoomID(), this.props.room.GetRoomID());
},
i = e + 1,
o = () => {
this.props.room.GetGroup().ReorderRoom(this.props.room.GetRoomID(), this.props.roomList[i].GetRoomID());
};
return (t < 0 || this.props.roomList[t].BIsDefaultRoom()) && (n = void 0), i >= this.props.roomList.length && (o = void 0), this.props.room.BIsDefaultRoom() && ((n = void 0), (o = void 0)), this.props.enabled || ((n = void 0), (o = void 0)), void 0 === n && void 0 === o ? null : f.createElement("div", { className: "rolePriorityContainer" }, f.createElement("div", { className: "rolePriorityButton roleUp" + (void 0 === n ? " Disabled" : ""), onClick: n }, f.createElement(S.V7n, { angle: 0 })), f.createElement("div", { className: "rolePriorityButton roleDown" + (void 0 === o ? " Disabled" : ""), onClick: o }, f.createElement(S.V7n, { angle: 180 })));
}
};
q = (0, i.gn)([C.Pi], q);
let Z = class extends f.Component {
OnCreateNewTextChannel(e) {
let t = e.currentTarget.ownerDocument.defaultView;
(0, p.BR)(f.createElement(m.Pd, { ownerWin: t, groupView: this.props.groupView, bVoiceChannel: !1, bJoinChannel: !1 }), t);
}
OnCreateNewVoiceChannel(e) {
let t = e.currentTarget.ownerDocument.defaultView;
(0, p.BR)(f.createElement(m.Pd, { ownerWin: t, groupView: this.props.groupView, bVoiceChannel: !0, bJoinChannel: !1 }), t);
}
OnDeleteChannel(e, t) {
let n = e.currentTarget.ownerDocument.defaultView;
(0, h.p3)(n, (0, E.Xx)("#GroupSettings_Channels_DeleteChannel"), (0, E.Xx)("#GroupSettings_Channels_DeleteConfirm"), (0, E.Xx)("#GroupSettings_Channels_DeleteButtonLabel"), (0, E.Xx)("#Button_Cancel"), !0)
.then(() => {
let e = t.GetGroup(),
n = t.GetRoomID();
e.DeleteChatRoom(n);
})
.catch(() => {});
}
render() {
const { groupView: e } = this.props;
let t = e.GetGroup().BCanAdminChannel();
const n = e.GetGroup().textRoomList,
i = e.GetGroup().voiceRoomList;
let o = (e, o, r) => f.createElement("div", { key: e.GetRoomID(), className: "ChatGroupSettingsChannels_Row" }, f.createElement("div", { className: "_DialogRow _DialogRowBackground" }, f.createElement("div", { className: "_DialogRowLabel" }, r ? f.createElement(S.Cq4, null) : f.createElement(S.MFo, null), f.createElement("div", { className: e.IsDefaultRoomForGroup() ? "HomeChannel" : "", style: { alignSelf: "center" } }, e.BIsDefaultRoom() ? (0, E.Xx)("#Chat_DefaultChannelName") : e.name)), e.IsDefaultRoomForGroup() && f.createElement("div", { className: "_DialogRowSecondaryLabel" }, (0, E.Xx)("#GroupSettings_Channels_HomeChannelDeleteLabel")), !e.IsDefaultRoomForGroup() && t && f.createElement("div", { className: "ChannelDeleteButton", onClick: (t) => this.OnDeleteChannel(t, e) }, (0, E.Xx)("#GroupSettings_Channels_Delete"))), f.createElement(q, { room: e, roomList: r ? i : n, enabled: t })),
r = n.map((e) => o(e, 0, !1)),
a = i.map((e) => o(e, 0, !0));
return f.createElement(
f.Fragment,
null,
f.createElement(x, null, (0, E.Xx)("#GroupSettings_Channels_Section")),
!t && f.createElement(ie, null),
f.createElement(v.l0, { className: "DialogBody" }, f.createElement(v.Uq, { className: U().ChannelsButtons }, f.createElement(v.zx, { className: "DialogButtonTall", svgicon: S.MFo, onClick: this.OnCreateNewTextChannel, disabled: !t }, " ", (0, E.Xx)("#GroupSettings_Channels_CreateText"), " "), f.createElement(v.zx, { className: "DialogButtonTall", svgicon: () => S.Cq4({}), onClick: this.OnCreateNewVoiceChannel, disabled: !t }, " ", (0, E.Xx)("#GroupSettings_Channels_CreateVoice"), " ")), f.createElement(v.HV, null, 0 != r.length && f.createElement("div", { className: "displayColumn flexShrinkNone", style: { marginBottom: "32px" } }, f.createElement(v.__, null, (0, E.Xx)("#GroupSettings_Channels_TextChannels")), f.createElement(v.tr, null), r), 0 != a.length && f.createElement("div", { className: "displayColumn flexShrinkNone" }, f.createElement(v.__, null, (0, E.Xx)("#GroupSettings_Channels_VoiceChannels")), f.createElement(v.tr, null), a))),
);
}
};
(0, i.gn)([D.ak], Z.prototype, "OnCreateNewTextChannel", null), (0, i.gn)([D.ak], Z.prototype, "OnCreateNewVoiceChannel", null), (0, i.gn)([D.ak], Z.prototype, "OnDeleteChannel", null), (Z = (0, i.gn)([C.Pi], Z));
class Q extends f.Component {
constructor() {
super(...arguments), (this.state = { strRoleName: "" });
}
OnSubmit() {
let e = this.m_refInput && this.m_refInput.value.trim();
e &&
0 != e.length &&
(this.props.closeModal(),
this.props.group.CreateRole(e).catch(() => {
(0, h.zp)(this.props.ownerWin, (0, E.Xx)("#Generic_Error"), (0, E.Xx)("#GroupSettings_CreateRole_GenericError")), this.props.closeModal();
}));
}
HandleTextEntry(e) {
this.setState({ strRoleName: e.target.value });
}
render() {
let e = this.state.strRoleName.length > 0;
return f.createElement(
p.e1,
{ onEscKeypress: this.props.closeModal },
f.createElement(
v.oX,
{ classNameContent: "CreateChatChannelDialog", onSubmit: this.OnSubmit },
f.createElement(v.h4, null, (0, E.Xx)("#GroupSettings_CreateRole_Title")),
f.createElement(
v.uT,
null,
f.createElement(v.II, {
ref: (e) => {
this.m_refInput = e;
},
autoFocus: !0,
label: (0, E.Xx)("#GroupSettings_CreateRole_Description"),
value: this.state.strRoleName,
onChange: this.HandleTextEntry,
}),
),
f.createElement(v.$_, null, f.createElement(v.o9, { onCancel: this.props.closeModal, bOKDisabled: !e })),
),
);
}
}
(0, i.gn)([D.ak], Q.prototype, "OnSubmit", null), (0, i.gn)([D.ak], Q.prototype, "HandleTextEntry", null);
let $ = class extends f.Component {
constructor() {
super(...arguments), (this.state = {}), (this.m_topRef = f.createRef());
}
OnCreateRole(e) {
let t = e.currentTarget.ownerDocument.defaultView;
(0, p.BR)(f.createElement(Q, { ownerWin: t, group: this.props.group }), t);
}
BCanLocalUserEditRole(e) {
return this.props.group.BCanIModifyRole(e);
}
BCanLocalUserAssignRole() {
return this.props.group.BCanIAssignRoles();
}
EditRole(e) {
let t = this.props.group.GetRoleName(e),
n = this.props.group.GetRoleActions(e);
t && n && this.setState({ editRoleID: e, editRoleName: t, editRoleActions: n });
}
DoesRoleGrantPermission(e, t) {
return !0;
}
OnSettingToggled(e, t) {
this.props.group.SetRoleAction(this.state.editRoleID, e, t);
}
MoveRoleUp(e) {
let t = this.props.group.GetRoleOrdinal(e),
n = Math.max(0, t - 1);
this.props.group.ReorderRole(e, n).then((e) => {
this.forceUpdate();
});
}
MoveRoleDown(e) {
let t = this.props.group.GetRoleOrdinal(e) + 1;
this.props.group.ReorderRole(e, t).then((e) => {
this.forceUpdate();
});
}
componentDidUpdate(e, t) {
if (this.state.editRoleID !== t.editRoleID && this.m_topRef && this.m_topRef.current) {
let e = this.m_topRef.current.parentElement;
for (; e; ) {
if (e.scrollHeight > e.clientHeight) return void (e.scrollTop = 0);
e = e.parentElement;
}
}
}
render() {
const { group: e } = this.props,
{ editRoleID: t } = this.state,
n = e.BIsAccountIDOwner(c.Ul.CMInterface.steamid.GetAccountID());
let i = e.BIsClanChatRoom();
if (t) return f.createElement("div", { ref: this.m_topRef }, f.createElement(J, { group: e, roleID: t, onRequestClose: () => this.setState({ editRoleID: void 0 }) }));
let o = e.DefaultRoleID(),
r = e
.GetRoles()
.slice()
.sort((e, t) => (e.role_id == o ? 1 : t.role_id == o ? -1 : e.ordinal - t.ordinal)),
s = e.GetHighestRankRoleIDForPermission(c.Ul.FriendStore.self.accountid, 8),
l = s ? e.GetRoleOrdinal(s) : Number.MAX_VALUE - 1,
m = e.BIsAccountIDOwner(c.Ul.FriendStore.self.accountid),
d = !1,
h = this.BCanLocalUserAssignRole(),
u = r.map((t, n) => {
let a = !1,
s = this.BCanLocalUserEditRole(t.role_id),
h = s && (m || t.ordinal > l + 1) && t.ordinal > 0,
u = s && n < r.length - 2;
return (
s && (d = !0),
t.role_id == o ? ((a = !0), (h = !1), (u = !1)) : e.BMemberHasRole(c.Ul.FriendStore.self.accountid, t.role_id) && (a = !0),
f.createElement(
"div",
{ className: "roleRow", key: t.role_id },
f.createElement(
v.zx,
{
className: "roleButton" + (a && !m ? " currentUserRole" : ""),
onClick: (e) => {
this.EditRole(t.role_id);
},
},
f.createElement(S.mKE, null),
(0, E.Xx)(t.name),
f.createElement("span", { className: "roleSubtitle" }, s ? (0, E.Xx)("#Generic_Edit") : (0, E.Xx)("#Generic_View")),
),
!i &&
d &&
r.length > 2 &&
(h || u) &&
f.createElement(
"div",
{ className: "rolePriorityContainer" },
f.createElement(
"div",
{
className: "rolePriorityButton roleUp" + (h ? "" : " Disabled"),
onClick: (e) => {
this.MoveRoleUp(t.role_id), e.stopPropagation();
},
},
f.createElement(S.V7n, { angle: 0 }),
),
f.createElement(
"div",
{
className: "rolePriorityButton roleDown" + (u ? "" : " Disabled"),
onClick: (e) => {
this.MoveRoleDown(t.role_id), e.stopPropagation();
},
},
f.createElement(S.V7n, { angle: 180 }),
),
),
)
);
}),
p = (0, E.Xx)("#ChatRoomRole_Description_NoEdit");
if (i) {
let t = A.K.InitFromClanID(e.GetClanID()),
n = `${a.De.COMMUNITY_BASE_URL}gid/${t.ConvertTo64BitString()}/membersManage`;
p = (0, E.kQ)("#ChatRoomRole_Description_Clan", f.createElement(R.ns, { href: n }, (0, E.Xx)("#ChatRoomRole_Description_ClanLink")));
} else d && !m ? (p = (0, E.Xx)("#ChatRoomRole_Description")) : (h || m) && (p = (0, E.Xx)("#ChatRoomRole_Description_NoEditCanAssign"));
return f.createElement(
f.Fragment,
null,
f.createElement("div", { ref: this.m_topRef }),
f.createElement(x, null, (0, E.Xx)("#GroupSettings_Permissions_Section")),
!n && !d && f.createElement(ie, null, (0, E.Xx)("#Chat_Settings_Permission_Denied_Permissions")),
f.createElement(
"div",
{ className: "roleList" },
f.createElement(v.Ac, { className: U().PermissionsDescription }, p),
f.createElement("div", { className: U().RoleNameHeader }, f.createElement(v.__, null, (0, E.Xx)("#GroupSettings_Permissions_RolesTitle"), " "), !m && f.createElement(v.__, { className: "meKey" }, f.createElement(S.mKE, null), (0, E.Xx)("#GroupSettings_meKey_Desc")), m && f.createElement(v.__, { className: "meKey" }, f.createElement(S._OD, null), (0, E.Xx)("#GroupSettings_meKey_Desc_Owner"))),
f.createElement(v.l0, { className: "DialogBody" }, f.createElement(v.zx, { disabled: !0, className: "roleButton owner", svgicon: S._OD, onClick: () => {} }, (0, E.Xx)("#ChatRoomRole_Owner"), f.createElement("span", { className: "roleSubtitle" }, (0, E.Xx)("#ChatRoomRole_OwnerSubtitle"))), u),
!i && f.createElement(v.KM, { className: "createNewRoleButton", svgicon: () => S.FUf({ minus: !1, nocircle: !1 }), onClick: this.OnCreateRole, disabled: !e.BCanICreateRoles() }, (0, E.Xx)("#GroupSettings_Permissions_CreateNew")),
),
);
}
};
(0, i.gn)([D.ak], $.prototype, "OnCreateRole", null), (0, i.gn)([D.ak], $.prototype, "EditRole", null), (0, i.gn)([D.ak], $.prototype, "OnSettingToggled", null), (0, i.gn)([D.ak], $.prototype, "MoveRoleUp", null), (0, i.gn)([D.ak], $.prototype, "MoveRoleDown", null), ($ = (0, i.gn)([C.Pi], $));
const Y = (e) => {
const { eAction: t, strLabel: n, disabled: i, group: o, roleID: r } = e,
a = o.GetRoleActions(r),
s = a && a.BCanPerformAction(t),
[l, c] = f.useState(0);
return f.createElement(v.nf, {
onChange: (e) => {
o.SetRoleAction(r, t, e), c(l + 1);
},
label: n,
value: s,
disabled: i,
className: U().PermissionToggle,
});
};
let J = class extends f.Component {
constructor(e) {
super(e), (this.state = { editRoleName: e.group.GetRoleName(e.roleID) });
}
OnEditRoleNameChange(e) {
this.setState({ editRoleName: e.target.value });
}
OnEditRoleNameBlur() {
this.RenameRole();
let e = document.getElementById("b1");
e && e.blur();
}
RenameRole() {
const { roleID: e } = this.props,
t = this.state.editRoleName;
this.props.group.RenameRole(e, t).catch(() => {
this.setState({ editRoleName: this.props.group.GetRoleName(e) });
});
}
DeleteRole(e, t) {
let n = e.currentTarget.ownerDocument.defaultView;
if (t == this.props.group.DefaultRoleID()) return;
let i = this.props.group.GetRoleName(t),
o = f.createElement("div", { style: { marginTop: "8px", color: "white" } }, i);
(0, h.p3)(n, (0, E.Xx)("#GroupSettings_Permissions_ConfirmDeleteTitle"), (0, E.Xx)("#GroupSettings_Permissions_ConfirmDelete"), (0, E.Xx)("#GroupSettings_Permissions_ConfirmDeleteButton"), (0, E.Xx)("#Button_Cancel"), !0, o)
.then(() => this.props.group.DeleteRole(t))
.then(() => this.props.onRequestClose())
.catch((e) => {
null != e && (0, h.zp)(n, (0, E.Xx)("#Generic_Error"), (0, E.Xx)("#GroupSettings_DeleteRole_GenericError"));
});
}
render() {
const { group: e, roleID: t, onRequestClose: n } = this.props;
if (!e.GetRoleActions(t)) return null;
let i = e.BIsClanChatRoom(),
o = t == e.DefaultRoleID(),
r = o && !i ? (0, E.Xx)("#ChatRoomRole_Member") : this.state.editRoleName,
a = e.BCanIModifyRole(t);
const s = { disabled: !a, group: e, roleID: t },
l = i || !a ? f.createElement("div", { className: (0, L.Z)(U().RoleNameHeader, U().FixedRoleName) }, (0, E.Xx)(r)) : f.createElement("div", { className: U().RoleNameHeader }, f.createElement(v.II, { autoComplete: "off", id: "b1", className: "editRoleName", label: (0, E.Xx)("#GroupSettings_Permissions_RoleName"), type: "text", value: r, disabled: o || !a, onChange: this.OnEditRoleNameChange, onBlur: this.OnEditRoleNameBlur }));
return f.createElement(
v.l0,
{ onSubmit: this.OnEditRoleNameBlur, className: U().PermissionsEdit },
f.createElement("div", { className: U().Back, onClick: () => n() }, f.createElement(S.G$j, null), (0, E.Xx)("#GroupSettings_Permissions_BackButton")),
!a && f.createElement(ie, null, (0, E.Xx)("#Chat_Settings_Permission_Denied")),
l,
f.createElement(
v.uT,
null,
f.createElement("div", { className: (0, L.Z)("SettingsGroup", U().PermissionsGroup) }, f.createElement(v.__, { className: "PermissionsSectionHeader" }, (0, E.Xx)("#GroupSettings_Permissions_Heading_General")), f.createElement(Y, Object.assign({}, s, { eAction: 6, strLabel: (0, E.Xx)("#GroupSettings_Permissions_Chat") })), f.createElement(Y, Object.assign({}, s, { eAction: 10, strLabel: (0, E.Xx)("#GroupSettings_Permissions_MentionAll") })), f.createElement(Y, Object.assign({}, s, { eAction: 11, strLabel: (0, E.Xx)("#GroupSettings_Permissions_SetWatchingBroadcast") }))),
f.createElement("div", { className: (0, L.Z)("SettingsGroup", U().PermissionsGroup) }, f.createElement(v.__, { className: "PermissionsSectionHeader" }, (0, E.Xx)("#GroupSettings_Permissions_Heading_MembersAndRoles")), f.createElement(Y, Object.assign({}, s, { eAction: 2, strLabel: (0, E.Xx)("#GroupSettings_Permissions_Kick") })), f.createElement(Y, Object.assign({}, s, { eAction: 3, strLabel: (0, E.Xx)("#GroupSettings_Permissions_Ban") })), f.createElement(Y, Object.assign({}, s, { eAction: 4, strLabel: (0, E.Xx)("#GroupSettings_Permissions_Invite") })), f.createElement(Y, Object.assign({}, s, { eAction: 8, strLabel: (0, E.Xx)("#GroupSettings_Permissions_ChangeGroupRoles"), disabled: s.disabled || o })), !i && f.createElement(Y, Object.assign({}, s, { eAction: 9, strLabel: (0, E.Xx)("#GroupSettings_Permissions_ChangeUserRoles"), disabled: s.disabled || o }))),
f.createElement("div", { className: (0, L.Z)("SettingsGroup", U().PermissionsGroup) }, f.createElement(v.__, { className: "PermissionsSectionHeader" }, (0, E.Xx)("#GroupSettings_Permissions_Heading_RoomManagement")), f.createElement(Y, Object.assign({}, s, { eAction: 5, strLabel: (0, E.Xx)("#GroupSettings_Permissions_ChangeTaglineAvatarName") })), f.createElement(Y, Object.assign({}, s, { eAction: 1, strLabel: (0, E.Xx)("#GroupSettings_Permissions_CreateRenameDeleteChannel") }))),
),
f.createElement(
v.$_,
null,
!i &&
!o &&
a &&
f.createElement(
v.zx,
{
className: "deleteButton",
onClick: (e) => {
this.DeleteRole(e, t);
},
},
(0, E.Xx)("#GroupSettings_Permissions_DeleteRoleButton"),
),
),
);
}
};
(0, i.gn)([D.ak], J.prototype, "OnEditRoleNameChange", null), (0, i.gn)([D.ak], J.prototype, "OnEditRoleNameBlur", null), (0, i.gn)([D.ak], J.prototype, "RenameRole", null), (0, i.gn)([D.ak], J.prototype, "DeleteRole", null), (J = (0, i.gn)([C.Pi], J));
let ee = class extends f.Component {
componentDidMount() {
const { group: e, inviteLinks: t } = this.props;
if ("loaded" == t.loadingState) return;
e.BCanInvite() && "pending" == t.loadingState
? e.GetInviteLinksForGroup().then((e) => {
setTimeout(() => {
"loaded" == e.loadingState && (t.rgInviteLinks = e.rgInviteLinks.sort((e, t) => e.time_expires() - t.time_expires())), (t.loadingState = e.loadingState);
}, 500);
})
: (t.loadingState = "denied");
}
OnDeleteLink(e) {
let t = this.props.inviteLinks,
n = f.createElement("div", { style: { marginTop: "5px", color: "#dee2e5" } }, (0, w.V)(e.invite_code()));
(0, h.MS)((0, E.Xx)("#GroupSettings_Invite_ConfirmDeleteTitle"), (0, E.Xx)("#GroupSettings_Invite_ConfirmDelete"), (0, E.Xx)("#GroupSettings_Invite_ConfirmDeleteButton"), (0, E.Xx)("#Button_Cancel"), !0, n)
.then(() => {
this.props.group.DeleteInviteLink(e.invite_code()).then((n) => {
(0, M.X)("loaded" == t.loadingState, "somehow got a valid link to delete without links being loaded");
let i = t.rgInviteLinks.findIndex((t) => t.invite_code() == e.invite_code());
i >= 0 && (t.rgInviteLinks.splice(i, 1), console.log("removed link", t.rgInviteLinks));
});
})
.then(() => {})
.catch(() => {});
}
FormatExpires(e) {
if (e > 2145916800) return (0, E.Xx)("#GroupSettings_Invite_NeverExpires");
return c.Ul.RTime32ToDate(e).toLocaleString([], { year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric" });
}
HandleFocus(e) {
e.target.select();
}
render() {
const { inviteLinks: e, group: t } = this.props;
let n;
const i = t.BCanInvite();
if ("pending" == e.loadingState) n = f.createElement("div", null, f.createElement(b.V, null));
else if ("denied" == e.loadingState) n = f.createElement("div", null, (0, E.Xx)("#GroupSettings_Invite_Denied"));
else if ("failed" == e.loadingState) n = f.createElement("div", null, (0, E.Xx)("#GroupSettings_Invite_Failed"));
else if ("loaded" == e.loadingState) {
let t = [];
(t = e.rgInviteLinks.map((e) => f.createElement("tr", { key: e.invite_code() }, f.createElement("td", null, " ", f.createElement(v.II, { className: "inviteURLLink", value: (0, w.V)(e.invite_code()), readOnly: !0, onClick: this.HandleFocus, onFocus: this.HandleFocus }), " "), f.createElement("td", { className: "dateCell allCaps" }, " ", this.FormatExpires(e.time_expires()), " "), f.createElement("td", { className: "buttonCell" }, f.createElement(v.zx, { onClick: (t) => this.OnDeleteLink(e), disabled: !i }, (0, E.Xx)("#GroupSettings_Invite_Delete")))))),
(n = 0 == t.length ? f.createElement("div", null, (0, E.Xx)("#GroupSettings_Invite_NoInvites")) : f.createElement("table", { className: "DialogSpanningTable InviteLinksTable" }, f.createElement("thead", null, f.createElement("tr", null, f.createElement("th", { className: "inviteCodeColumn" }, " ", (0, E.Xx)("#GroupSettings_Invite_Code"), " "), f.createElement("th", { className: "dateColumn" }, " ", (0, E.Xx)("#GroupSettings_Invite_Expiration"), " "), f.createElement("th", { className: "buttonColumn" }, " "))), f.createElement("tbody", null, t)));
}
return f.createElement(f.Fragment, null, f.createElement(x, null, (0, E.Xx)("#GroupSettings_Invite_Section")), !i && f.createElement(ie, null), f.createElement(v.l0, { className: "DialogBody" }, i && f.createElement("div", { className: "inviteLinkContainer" }, f.createElement(d.t4, { chat: t.GetDefaultChatRoom(), disabled: !i })), i && f.createElement("div", { className: "OrSeparator" }, f.createElement(v.tr, null)), n));
}
};
(0, i.gn)([D.ak], ee.prototype, "OnDeleteLink", null), (0, i.gn)([D.ak], ee.prototype, "HandleFocus", null), (ee = (0, i.gn)([C.Pi], ee));
let te = class extends f.Component {
componentDidMount() {
let e = this.props.invitedUsers;
if ("loaded" == e.loadingState) return;
let t = this.props.group;
"pending" == e.loadingState &&
t.GetInvitedUsersForGroup().then((t) => {
setTimeout(() => {
"loaded" == t.loadingState && (e.rgInvitedUsers = t.rgInvitedUsers.sort((e, t) => e.time_invited() - t.time_invited())), (e.loadingState = t.loadingState);
}, 500);
});
}
RevokeInvite(e, t) {
let n = c.Ul.FriendStore.GetPlayer(t),
i = e.currentTarget.ownerDocument.defaultView,
o = f.createElement(u.mo, { className: "friend", friend: n, context: null, disableContextMenu: !0 });
(0, h.p3)(i, (0, E.Xx)("#GroupSettings_InvitedUsers_RevokeTitle"), (0, E.Xx)("#GroupSettings_InvitedUsers_RevokeBody"), (0, E.Xx)("#GroupSettings_InvitedUsers_RevokeConfirm"), (0, E.Xx)("#Button_Cancel"), !0, o)
.then(() => {
this.props.group
.RevokeInvite(t)
.then(() => {
y.Qf(this.props.invitedUsers.rgInvitedUsers, (e) => e.accountid() === t);
})
.catch((e) => {
(0, h.zp)(i, (0, E.Xx)("#Generic_Error"), (0, E.Xx)("#GroupSettings_InvitedUsers_RevokeGenericError"));
});
})
.catch(() => {});
}
FormatDate(e) {
return c.Ul.RTime32ToDate(e).toLocaleString([], { year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric" });
}
RenderContent() {
const { invitedUsers: e, group: t } = this.props,
n = t.BCanInvite();
if ("loaded" == e.loadingState) {
if (!e.rgInvitedUsers || 0 == e.rgInvitedUsers.length) return f.createElement(v.l0, null, (0, E.Xx)("#GroupSettings_InvitedUsers_Noone"));
let t = e.rgInvitedUsers.map((e) => {
var t;
let i = { friend: c.Ul.FriendStore.GetPlayer(e.accountid()), bHideGameName: !0, bHidePersona: !0, noActions: null === (t = this.context) || void 0 === t ? void 0 : t.IN_GAMEPADUI, context: null };
return f.createElement("tr", { className: "hoverRow", key: e.accountid() }, f.createElement("td", { className: "friendCell" }, " ", f.createElement(u.mo, Object.assign({}, i)), " "), f.createElement("td", { className: "dateCell" }, " ", this.FormatDate(e.time_invited()), " "), f.createElement("td", { className: "buttonCell" }, f.createElement(v.zx, { onClick: (t) => this.RevokeInvite(t, e.accountid()), disabled: !n }, (0, E.Xx)("#GroupSettings_InvitedUsers_RevokeInvite"))));
});
return f.createElement(v.l0, { className: "DialogBody" }, f.createElement(_.s, { "flow-children": "grid" }, f.createElement("table", { className: "DialogSpanningTable InvitedUsersTable" }, f.createElement("thead", null, f.createElement("tr", { className: "headerRow" }, f.createElement("th", { className: "friendColumn" }, (0, E.Xx)("#GroupSettings_InvitedUsers_InvitedHeader"), " "), f.createElement("th", { className: "dateColumn" }, " ", (0, E.Xx)("#GroupSettings_InvitedUsers_InvitedDate"), " "), f.createElement("th", { className: "buttonColumn" }, " "))), f.createElement("tbody", null, t))));
}
return f.createElement(v.l0, null, "pending" == e.loadingState ? f.createElement(b.V, { size: "medium" }) : (0, E.Xx)("#GroupSettings_InvitedUsers_Failed"));
}
render() {
const { group: e } = this.props,
t = e.BCanInvite();
return f.createElement(f.Fragment, null, f.createElement(x, null, (0, E.Xx)("#GroupSettings_InvitedUsers_Section")), !t && f.createElement(ie, null), this.RenderContent());
}
};
(te.contextType = V.E_), (0, i.gn)([D.ak], te.prototype, "RevokeInvite", null), (te = (0, i.gn)([C.Pi], te));
let ne = class extends f.Component {
componentDidMount() {
let e = this.props.group,
t = this.props.bans;
"pending" == t.loadingState &&
e.GetBanList().then((e) => {
setTimeout(() => {
(t.rgBans = e.rgBans), (t.loadingState = e.loadingState);
}, 500);
});
}
OnClickUnban(e, t) {
let n = c.Ul.FriendStore.GetPlayer(t),
i = e.currentTarget.ownerDocument.defaultView,
o = f.createElement(u.mo, { className: "friend", friend: n, context: null, disableContextMenu: !0 });
(0, h.p3)(i, (0, E.Xx)("#GroupSettings_Bans_UnbanTitle"), (0, E.Xx)("#GroupSettings_Bans_UnbanBody", n.display_name), (0, E.Xx)("#GroupSettings_Bans_UnbanConfirm"), (0, E.Xx)("#Button_Cancel"), !0, o)
.then(() => {
this.props.group
.SetUserBanState(t, !1)
.then(() => {
y.Qf(this.props.bans.rgBans, (e) => e.accountid() === t);
})
.catch((e) => {
(0, h.zp)(i, (0, E.Xx)("#Generic_Error"), (0, E.Xx)("#GroupSettings_Bans_UnbanGenericError"));
});
})
.catch(() => {});
}
FormatDate(e) {
return c.Ul.RTime32ToDate(e).toLocaleString([], { year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric" });
}
RenderContent() {
const { bans: e } = this.props;
let t;
if ("loaded" == e.loadingState)
return 0 == e.rgBans.length
? f.createElement(v.l0, null, (0, E.Xx)("#GroupSettings_Bans_NoOneBanned"))
: ((t = e.rgBans.map((e) => {
var t;
let n = { friend: c.Ul.FriendStore.GetPlayer(e.accountid()), noActions: null === (t = this.context) || void 0 === t ? void 0 : t.IN_GAMEPADUI, context: null };
return f.createElement("tr", { className: "hoverRow", key: e.accountid() }, f.createElement("td", { className: "friendCell" }, " ", f.createElement(u.mo, Object.assign({}, n)), " "), f.createElement("td", { className: "dateCell" }, " ", this.FormatDate(e.time_banned()), " "), f.createElement("td", { className: "buttonCell" }, " ", f.createElement(v.zx, { onClick: (t) => this.OnClickUnban(t, e.accountid()) }, (0, E.Xx)("#GroupSettings_Bans_RevokeBan"))));
})),
f.createElement(v.l0, { className: "DialogBody" }, f.createElement("table", { className: "DialogSpanningTable BannedUsersTable" }, f.createElement("thead", null, f.createElement("tr", { className: "headerRow" }, f.createElement("th", { className: "friendColumn" }, (0, E.Xx)("#GroupSettings_Bans_InvitedHeader"), " "), f.createElement("th", { className: "dateColumn" }, " ", (0, E.Xx)("#GroupSettings_Bans_BannedDate"), " "), f.createElement("th", { className: "buttonColumn" }, " "))), f.createElement("tbody", null, t))));
{
let t;
return (t = "pending" == e.loadingState ? f.createElement(b.V, { size: "medium" }) : "denied" == e.loadingState ? (0, E.Xx)("#GroupSettings_Bans_AccessDenied") : (0, E.Xx)("#GroupSettings_Bans_Failed")), f.createElement(v.l0, { className: "DialogBody" }, t);
}
}
render() {
const { group: e } = this.props,
t = e.BCanBan();
return f.createElement(f.Fragment, null, f.createElement(x, null, (0, E.Xx)("#GroupSettings_Bans_Section")), !t && f.createElement(ie, null), this.RenderContent());
}
};
(ne.contextType = V.E_), (0, i.gn)([D.ak], ne.prototype, "OnClickUnban", null), (ne = (0, i.gn)([C.Pi], ne));
const ie = (e) => f.createElement("div", { className: U().Notification }, f.createElement(S.HEZ, null), e.children || (0, E.Xx)("#Chat_Settings_Permission_Denied"));
},
85516: (e, t, n) => {
"use strict";
n.d(t, { Uu: () => f, nP: () => v });
var i = n(85556),
o = n(27378),
r = n(19953),
a = n(11259),
s = n(37234),
l = n(68816),
c = n(83817),
m = n(84290),
d = n(2049),
h = n(72746),
u = n(50649),
p = n(7098),
_ = n(93635),
g = n(65040),
C = n.n(g);
function f(e, t) {
let n = t.GetGroup().textRoomList.length;
n > 7 && (n = 7);
let i = 60 * n;
n < 2 && (i -= 32), (0, l.BR)(o.createElement(S, { group: t.GetGroup() }), e, "ChatRoomGroupNotificationSettings", { strTitle: (0, m.Xx)("#NotificationSettings_Title"), popupWidth: 600, popupHeight: 348 + i }, (0, s.Og)(e));
}
function v(e = !0) {
let t = [];
return (
e && (t = t.concat([{ label: o.createElement("span", { className: "ChannelSpecificNotificationSettings_Inherit" }, (0, m.Xx)("#NotificationSetting_Inherit")), data: 0 }])),
(t = t.concat([
{ label: (0, m.Xx)("#NotificationSetting_AllMessages"), data: 4 },
{ label: (0, m.Xx)("#NotificationSetting_AnyMention", h.Ul.FriendStore.self.display_name), data: 3 },
{ label: (0, m.Xx)("#NotificationSetting_DirectMention", h.Ul.FriendStore.self.display_name), data: 2 },
{ label: (0, m.Xx)("#NotificationSetting_None"), data: 1 },
])),
t
);
}
let S = class extends o.Component {
constructor(e) {
super(e), (this.m_rgSelectOptions = v(!1)), (this.state = { cSavesInFlight: 0 });
}
IncrementSavesInFlight() {
this.setState((e) => ({ cSavesInFlight: e.cSavesInFlight + 1 }));
}
DecrementSavesInFlight() {
this.setState((e) => ((0, _.X)(e.cSavesInFlight > 0, `expected ${e.cSavesInFlight} > 0`), { cSavesInFlight: e.cSavesInFlight - 1 }));
}
WrapSavePromise(e) {
this.IncrementSavesInFlight(), e.then(this.DecrementSavesInFlight, this.DecrementSavesInFlight);
}
OnGroupNotificationLevelChanged(e) {
this.WrapSavePromise(this.props.group.SetNotificationPreferences(e));
}
OnShowUnreadIndicatorChanged(e) {
this.WrapSavePromise(this.props.group.SetNotificationPreferences(void 0, void 0, e));
}
DismissDialog() {
this.props.closeModal();
}
OnFriendsSettingsClicked(e) {
(0, p.L)((0, s.Um)(this, e), e.currentTarget.ownerDocument.defaultView);
}
render() {
var e;
let t,
n = this.props.group,
i = n.chatRoomList.filter((e) => e.BShouldTrackUnreadMessages()),
r = i.length > 0;
if ((1 == i.length && 0 == i[0].GetDesktopNotificationLevelSetting() && 0 == i[0].GetMobileNotificationLevelsetting() && (r = !1), r)) {
let e = i.map((e) => o.createElement(b, { fnHandleSave: this.WrapSavePromise, group: n, chat: e, key: e.unique_id }));
t = o.createElement(o.Fragment, null, o.createElement("div", { className: "notificationsChannelListContainer" }, e));
}
return o.createElement(
l.e1,
{ onEscKeypress: this.DismissDialog },
o.createElement(
a.oX,
{ classNameContent: "ChatRoomNotificationSettingsDialog" },
o.createElement(a.h4, null, (0, m.Xx)("#NotificationSettings_Title")),
o.createElement(a.__, null, (0, m.kQ)("#NotificationSettings_SubTitle", o.createElement("span", { className: "whiteText" }, n.name))),
o.createElement(a.uT, null, o.createElement(a.__, { className: "NotificationSettingsSavingIndicator " + (this.state.cSavesInFlight ? "Saving" : "") }, (0, m.Xx)("#GroupSettings_Permissions_Saving"), "..."), o.createElement(I, { drop_down_options: this.m_rgSelectOptions, get_notification_level: (e) => n.GetDesktopNotificationLevel(e), set_notification_level: this.OnGroupNotificationLevelChanged, get_muted: () => n.BIsUnreadIndicatorMuted(), set_muted: this.OnShowUnreadIndicatorChanged }), r && o.createElement(o.Fragment, null, o.createElement(a.tr, null), o.createElement(a.Uq, { className: "notificationsChannelHeader" }, o.createElement(a.__, { className: "NotificationChannelNameLabel" }, (0, m.Xx)("#GroupSettings_Channels_TextChannels")), o.createElement(a.__, { className: "OverrideChannelLabel" }, (0, m.Xx)("#NotificationSetting_ShortLabel"))), o.createElement(a.HV, { className: C().scrollMaskVertical }, t))),
o.createElement(a.$_, null, !(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) && (0, m.kQ)("#NotificationSetting_Footer_Desc2", o.createElement("span", { className: "textLink", onClick: this.OnFriendsSettingsClicked }, (0, m.Xx)("#Settings"))), o.createElement(c.s, { className: "_DialogColLayout", "flow-children": "row" }, o.createElement(a.KM, { onClick: this.props.closeModal }, (0, m.Xx)("#Button_Close")))),
),
);
}
};
(S.contextType = r.E_), (0, i.gn)([d.ak], S.prototype, "IncrementSavesInFlight", null), (0, i.gn)([d.ak], S.prototype, "DecrementSavesInFlight", null), (0, i.gn)([d.ak], S.prototype, "WrapSavePromise", null), (0, i.gn)([d.ak], S.prototype, "OnGroupNotificationLevelChanged", null), (0, i.gn)([d.ak], S.prototype, "OnShowUnreadIndicatorChanged", null), (0, i.gn)([d.ak], S.prototype, "DismissDialog", null), (0, i.gn)([d.ak], S.prototype, "OnFriendsSettingsClicked", null), (S = (0, i.gn)([u.Pi], S));
let b = class extends o.Component {
constructor() {
super(...arguments), (this.m_rgSelectOptions = v());
}
OnChatNotificationLevelChanged(e) {
this.props.fnHandleSave(this.props.chat.SetNotificationPreferences(e.data));
}
render() {
var e;
let t = this.props.chat;
t.GetDesktopNotificationLevelSetting();
return (null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) ? o.createElement(c.s, { className: "notificationsChannel", "flow-children": "column" }, o.createElement(a.ry, { layout: "inline", label: t.name, rgOptions: this.m_rgSelectOptions, selectedOption: t.GetDesktopNotificationLevelSetting(), onChange: this.OnChatNotificationLevelChanged })) : o.createElement(a.Uq, { className: "notificationsChannel" }, o.createElement("div", { className: "NotificationChannelName" }, t.name), o.createElement(a.ry, { rgOptions: this.m_rgSelectOptions, selectedOption: t.GetDesktopNotificationLevelSetting(), onChange: this.OnChatNotificationLevelChanged }));
}
};
(b.contextType = r.E_), (0, i.gn)([d.ak], b.prototype, "OnChatNotificationLevelChanged", null), (b = (0, i.gn)([u.Pi], b));
let I = class extends o.Component {
OnNotificationLevelChanged(e) {
this.props.set_notification_level(e.data);
}
OnShowUnreadIndicatorChanged(e) {
this.props.set_muted(!e);
}
render() {
let e = this.props.get_notification_level(!0);
this.props.bIsDefault && 0 == e && (e = 4);
let t = this.props.get_notification_level();
return (
this.props.bIsDefault && 0 == t && (t = 4),
o.createElement(
"div",
{ className: "ChatRoomNotificationSettingsDialog" },
o.createElement("div", { className: "notificationGeneralHeader" + (this.props.bIsDefault ? " isDefault" : "") }, o.createElement(a.__, null, this.props.bIsDefault ? (0, m.Xx)("#NotificationSetting_DefaultLabel") : (0, m.Xx)("#NotificationSetting_Label"))),
o.createElement("div", { style: { marginBottom: 16 } }, o.createElement("div", { className: "notificationRow" }, o.createElement(a.ry, { rgOptions: this.props.drop_down_options, selectedOption: e, onChange: this.OnNotificationLevelChanged })), 4 != t && o.createElement("div", { className: "indicatorOptionContainer" }, o.createElement(a.gE, { className: "indicatorOption", label: (0, m.Xx)("#NotificationSetting_Indicator"), onChange: this.OnShowUnreadIndicatorChanged, checked: !this.props.get_muted() }), o.createElement("div", { className: "ChatUnreadMessageIndicator" + (this.props.get_muted() ? " Hidden" : "") }, o.createElement("div", { className: "chatUnreadCircle" })))),
)
);
}
};
(0, i.gn)([d.ak], I.prototype, "OnNotificationLevelChanged", null), (0, i.gn)([d.ak], I.prototype, "OnShowUnreadIndicatorChanged", null), (I = (0, i.gn)([u.Pi], I));
},
97720: (e, t, n) => {
"use strict";
n.d(t, { KG: () => b, bI: () => v, l8: () => S });
var i = n(85556),
o = n(72746),
r = n(50649),
a = n(68816),
s = n(27378),
l = n(23346),
c = n(2049),
m = n(84290),
d = n(11259),
h = n(83817),
u = n(94623),
p = n(37234),
_ = n(88669),
g = n(46057),
C = n(16518),
f = n(71357);
function v(e, t, n, i = !1, o) {
(0, a.BR)(s.createElement(b, { browserContext: e, chatViewToReplace: n, bHideChatNameEntry: i, vecInvitePlayers: o }), t, "CreateChatDialog", { strTitle: (0, m.Xx)("#Chat_CreateChatRoom"), popupWidth: 664, popupHeight: 580 }, (0, p.Og)(t));
}
function S(e, t, n, i) {
let r = (0, p.rb)(e),
a = o.Ul.ChatStore.FindNamelessChatGroupWithFriends(n);
a
? o.Ul.UIStore.ReplaceFriendChatWithGroup(r, t, a)
: o.Ul.ChatStore.CreateChatRoomGroup(r, "", n, i)
.then((e) => {
o.Ul.UIStore.GetPerContextChatData(r);
let n = o.Ul.ChatStore.GetChatRoomGroup(e);
n && o.Ul.UIStore.ReplaceFriendChatWithGroup(r, t, n);
})
.catch(() => {
(0, f.zp)(e, (0, m.Xx)("#Generic_Error"), (0, m.Xx)("#Chat_CreateChatRoom_GenericError"));
});
}
let b = class extends s.Component {
constructor(e) {
super(e);
const t = e.vecInvitePlayers ? e.vecInvitePlayers.map((e) => o.Ul.FriendStore.GetPlayer(e)) : [];
this.state = { strCurrentNameEntry: "", strError: void 0, bCreateInFlight: !1, rgSelectedFriends: t };
}
HandleTextEntry(e) {
this.setState({ strCurrentNameEntry: e.target.value });
}
HandleSubmit(e) {
if ((e && e.preventDefault(), this.state.bCreateInFlight)) return;
let t = (0, _.RA)(e);
this.setState((e) => (e.bCreateInFlight || this.InternalDoSubmit(t), { bCreateInFlight: !0 }));
}
InternalDoSubmit(e) {
const t = this.state.rgSelectedFriends.map((e) => e.persona.m_steamid.ConvertTo64BitString());
let n = this.props.chatViewToReplace;
if (n) {
let i = new l.Xp(this.props.chatViewToReplace.chat.accountid_partner);
return t.push(i.persona.m_steamid.ConvertTo64BitString()), S(e, n, t), void this.props.closeModal();
}
let i = this.props.bHideChatNameEntry ? "" : this.state.strCurrentNameEntry;
o.Ul.ChatStore.CreateChatRoomGroup(this.props.browserContext, i, t, this.props.creationOptions)
.then((e) => {
this.props.closeModal();
})
.catch(() => {
this.setState({ strError: (0, m.Xx)("#Chat_CreateChatRoom_GenericError"), bCreateInFlight: !1 });
});
}
IsChatRoomNameValid() {
return this.state.strCurrentNameEntry.length > 0;
}
render() {
let e = this.props.chatViewToReplace ? this.props.chatViewToReplace.chat.chat_partner : null,
t = (0, m.Xx)("#Chat_CreateChatRoom_Button");
const n = this.state.rgSelectedFriends.length > 0;
let i = new Set();
this.props.chatViewToReplace && i.add(this.props.chatViewToReplace.chat.accountid_partner);
let o = !1;
this.state.bCreateInFlight ? ((o = !1), (t = (0, m.Xx)("#GroupSettings_Permissions_Saving"))) : e ? (o = this.state.rgSelectedFriends.length > 0) : ((o = this.IsChatRoomNameValid() || n), this.IsChatRoomNameValid() && !n ? (t = (0, m.Xx)("#Chat_CreateChatRoom_Button")) : n && !this.IsChatRoomNameValid() ? (t = (0, m.Xx)("#Chat_CreateChatRoom_InviteFriends")) : n && this.IsChatRoomNameValid() && (t = (0, m.Xx)("#Chat_CreateChatRoom_Button_wFriends")));
const r = this.props.strTitle || (e ? (0, m.Xx)("#Chat_CreateChatRoom_InviteFriends") : (0, m.Xx)("#Chat_CreateChatRoom"));
return s.createElement(
a.e1,
{ onEscKeypress: this.props.closeModal },
s.createElement(
d.oX,
{ classNameContent: "CreateChatDialog", onSubmit: this.HandleSubmit },
s.createElement(d.h4, null, r),
s.createElement(
d.uT,
null,
e && s.createElement(d.Ac, null, s.createElement("span", null, (0, m.Xx)("#Chat_CreateChatRoom_With"), s.createElement("span", { className: "DialogHighlight" }, (0, m.Xx)("#Chat_CreateChatRoom_You")), (0, m.Xx)("#Chat_CreateChatRoom_And"), s.createElement("span", { className: "DialogHighlight" }, e.display_name))),
this.state.strError && s.createElement(d.Ac, { className: "nicknameError" }, this.state.strError),
!this.props.bHideChatNameEntry && s.createElement(d.II, { type: "text", label: (0, m.Xx)("#Chat_Settings_Room_Name"), className: "nicknameInput", value: this.state.strCurrentNameEntry, onChange: this.HandleTextEntry, autoFocus: !0 }),
s.createElement(u.B, { label: (0, m.Xx)("#Chat_DropToInviteGroup"), eSort: 1, autoFocus: this.props.bHideChatNameEntry, renderChosenFriend: I, excludeFriend: (e) => i.has(e.accountid), onChange: (e) => this.setState({ rgSelectedFriends: e }), rgPickedFriends: this.state.rgSelectedFriends }),
),
s.createElement(d.$_, null, s.createElement(d.o9, { strOKText: t, onCancel: this.props.closeModal, bOKDisabled: !o })),
),
);
}
};
(0, i.gn)([c.ak], b.prototype, "HandleTextEntry", null), (0, i.gn)([c.ak], b.prototype, "HandleSubmit", null), (b = (0, i.gn)([r.Pi], b));
let I = (0, r.Pi)((e) =>
s.createElement(
s.Fragment,
null,
s.createElement(
g.yd,
{ friend: e.friend, context: null },
s.createElement(
h.s,
{
className: "FriendPicker_ChosenFriend",
onClick: () => {
e.onClick(e.friend);
},
},
s.createElement("span", null, e.friend.display_name),
s.createElement(C.pVO, null),
),
),
),
);
},
94623: (e, t, n) => {
"use strict";
n.d(t, { B: () => S });
var i = n(27378),
o = n(83817),
r = n(56666),
a = n(23346),
s = n(72746),
l = n(46057),
c = n(11259),
m = n(84290),
d = n(16518),
h = n(87018),
u = n(5651),
p = n(8070),
_ = n(10553),
g = n(2049),
C = n(62860),
f = n(52112),
v = n.n(f);
const S = (e) => {
const { label: t, eSort: n, onChange: d, rgPickedFriends: f, excludeFriend: S, autoFocus: I, bDropInvite: y, renderChosenFriend: E } = e,
D = (0, _.id)(),
[w, R] = (0, i.useState)(""),
[A, M] = (0, i.useState)(null),
k = (t) => {
e.onFriendPicked && e.onFriendPicked(t), d && d(f.concat(t)), R("");
},
T = (t) => {
if ((e.onFriendUnpicked && e.onFriendUnpicked(t), d)) {
const e = f.findIndex((e) => e.accountid === t.accountid);
-1 !== e && d(f.slice(0, e).concat(f.slice(e + 1)));
}
},
L = (0, i.useMemo)(() => {
const e = s.Ul.FriendStore.all_friends.filter((e) => (!S || !S(e)) && !f.some((t) => t.accountid === e.accountid)),
t = s.Ul.ChatStore.FriendChatStore;
if (0 === n)
e.sort((e, n) => {
let i = t.GetFriendLastChatTime(n.accountid) - t.GetFriendLastChatTime(e.accountid);
return 0 !== i ? i : a.Xp.DefaultFriendSortComparator(e, n);
});
else e.sort((e, t) => e.display_name.localeCompare(t.display_name));
return e;
}, [S, n, f]),
G = (0, i.useMemo)(() => {
const e = w && w.trim().toLocaleLowerCase(),
t = [];
for (let n = 0; n < L.length && t.length < 500; n++) {
const i = L[n];
(e && !i.BMatchesSearchString(e, !1)) || t.push(i);
}
return t;
}, [w, L]);
i.useEffect(() => {
M(G.length > 0 && w.length > 0 ? G[0] : null);
}, [G]);
const O = (0, i.useCallback)(
(e) => {
e && !D && e.scrollIntoView({ behavior: "auto", block: "nearest" });
},
[D],
),
F = () => {
const e = f[f.length - 1];
e && T(e);
},
B = f.length > 0,
[x, N] = i.useState(!1),
P = (0, h.Z)("FriendPicker", B && "FriendPicker_FriendsChosen", x && "FriendPicker_Focus"),
U = E || b,
V = f.map((e) => i.createElement(U, { friend: e, key: e.accountid, onClick: () => T(e) })),
H = i.useRef(),
W = G.map((e, t) => {
const n = !D && e == A,
r = (0, h.Z)("FriendPicker_SuggestedFriend", n && "Focus");
return i.createElement(
o.s,
{
className: r,
onActivate: () => k(e),
onMouseUp: () => {
var t;
M(e), null === (t = H.current) || void 0 === t || t.Focus();
},
key: e.accountid,
"data-index": t,
ref: n ? O : void 0,
},
i.createElement(l.mo, { noActions: !0, friend: e, context: null }),
);
}),
X = i.useRef();
i.useLayoutEffect(() => {
var e;
null === (e = X.current) || void 0 === e || e.scrollTo({ top: 0, behavior: "auto" });
}, [G]);
const j = (function () {
const e = i.useRef(),
[t, n] = i.useState(!0),
[o, r] = i.useState(!1),
a = () => {
const i = e.current,
a = null == i || i.scrollTop <= 1;
a != t && n(a);
const s = null == i || i.scrollHeight - i.scrollTop <= i.clientHeight + 1;
s != o && r(s);
},
s = (0, h.Z)(v().ScrollFade, t && v().ScrolledToTop, o && v().ScrolledToBottom);
return i.useLayoutEffect(a), { refForScrollable: e, strClassNamesForScrollable: s, fnOnScroll: a };
})(),
{ strMinHeightStyle: z, refForResizeObserver: K } = (0, g.$T)(),
q = (0, g.BE)(X, j.refForScrollable);
return i.createElement(
o.s,
{ className: P, onSecondaryButton: F },
i.createElement(
c.Uo,
{
onChange: ({ currentTarget: { value: e } }) => R(e),
onKeyDown: (e) => {
if (13 === e.keyCode) ((!D && e.currentTarget.value.trim().length) || null != A) && (e.preventDefault(), A && k(A));
else if (8 === e.keyCode && 0 === e.currentTarget.selectionEnd && f.length > 0) e.preventDefault(), F();
else if (!D && (38 == e.keyCode || 40 == e.keyCode || 34 == e.keyCode || 33 == e.keyCode) && G.length > 0) {
e.preventDefault();
const t = G.findIndex((e) => e == A);
let n;
38 == e.keyCode ? (n = t - 1) : 33 == e.keyCode ? (n = Math.max(0, t - 5)) : 34 == e.keyCode ? (n = Math.min(G.length - 1, t + 5)) : 40 == e.keyCode && (n = t + 1), n < 0 ? (n = 0) : n > G.length - 1 && (n = G.length - 1), M(G[n]);
}
},
onFocus: () => N(!0),
onBlur: () => N(!1),
label: t,
value: w,
placeholder: B ? "" : (0, m.Xx)("#FriendPicker_StartTyping"),
autoFocus: I,
focusOnMount: !D && I,
ref: H,
},
V,
),
y && i.createElement("div", { className: "DialogLabel" }, (0, m.Xx)("#Chat_InviteFriends_DropInvite")),
i.createElement(r.eh, { className: "FriendPickerFriendList", style: { minHeight: D ? void 0 : z }, ref: K }, i.createElement("div", { className: "insetShadow verticalInsetShadow" }), i.createElement(u.P8, { ref: q, onGamepadDirection: (e) => e.detail.is_repeat, onScroll: j.fnOnScroll, className: (0, h.Z)("FriendPickerScrollPanel", j.strClassNamesForScrollable), scrollIntoViewType: C.mz.NoTransform }, i.createElement(p.e, null, W))),
);
},
b = (e) =>
i.createElement(
l.yd,
{ friend: e.friend, context: null },
i.createElement(
o.s,
{
className: "FriendPicker_ChosenFriend",
onActivate: () => {
e.onClick(e.friend);
},
},
i.createElement("span", null, e.friend.display_name),
i.createElement(d.pVO, null),
),
);
},
97224: (e, t, n) => {
"use strict";
n.d(t, { Ao: () => i, UD: () => b, a$: () => I, fR: () => S, gy: () => f });
var i,
o = n(85556),
r = n(27378),
a = n(11259),
s = n(19953),
l = n(50649),
c = n(2049),
m = n(84290),
d = n(70215),
h = n(29205),
u = n(3571),
p = n(88991),
_ = n(37234),
g = n(72746),
C = n(14341);
class f extends r.Component {
constructor(e) {
super(e), (this.m_bSettingsChanged = !1), (this.m_bCommunityPreferencesChanged = !1), (this.state = { friendSettings: Object.assign({}, e.friendsSettingsInitial), communityPreferences: Object.assign({}, e.communityPreferencesInitial) });
}
componentDidUpdate(e) {
let t = {};
const { friendsSettingsInitial: n, communityPreferencesInitial: i } = this.props;
for (let i of Object.keys(n)) n[i] != e.friendsSettingsInitial[i] && (t[i] = n[i]);
let o = {};
for (let t of Object.keys(i)) i[t] != e.communityPreferencesInitial[t] && (o[t] = i[t]);
Object.keys(t).length && this.setState({ friendSettings: Object.assign(Object.assign({}, this.state.friendSettings), t) }), Object.keys(o).length && this.setState({ communityPreferences: Object.assign(Object.assign({}, this.state.communityPreferences), o) }), this.props.bSubmitImmediate && (this.m_bSettingsChanged || this.m_bCommunityPreferencesChanged) && this.props.onSubmit(this.state.friendSettings, this.state.communityPreferences), (this.m_bSettingsChanged = !1), (this.m_bCommunityPreferencesChanged = !1);
}
OnSubmit() {
this.props.onSubmit(this.state.friendSettings, this.state.communityPreferences), (this.m_bSettingsChanged = !1), (this.m_bCommunityPreferencesChanged = !1);
}
HandleRadioChange(e) {
this.setState({ friendSettings: Object.assign(Object.assign({}, this.state.friendSettings), { nChatFlashMode: parseInt(e.currentTarget.value) }) }), (this.m_bSettingsChanged = !0);
}
OnSettingToggled(e, t) {
this.setState({ friendSettings: Object.assign(Object.assign({}, this.state.friendSettings), { [e]: t }) }), (this.m_bSettingsChanged = !0);
}
OnCommunityPreferenceToggled(e, t) {
this.setState({ communityPreferences: Object.assign(Object.assign({}, this.state.communityPreferences), { [e]: t }) }), (this.m_bCommunityPreferencesChanged = !0);
}
FriendsSettingsToggleRow(e) {
return r.createElement(a.gE, {
key: e.strName,
onChange: (t) => {
this.OnSettingToggled(e.strName, t);
},
label: e.strLabel,
checked: !!this.state.friendSettings[e.strName],
description: e.strDesc ? e.strDesc : "",
});
}
FriendsSettingsCheckbox(e) {
return r.createElement(a.ji, {
key: e.strName,
onChange: (t) => {
this.OnSettingToggled(e.strName, t);
},
checked: !!this.state.friendSettings[e.strName],
});
}
FriendsSettingsCommunityPreferenceToggleRow(e) {
return r.createElement(
a.gE,
{
key: "CommunityPreference" + e.strName,
onChange: (t) => {
this.OnCommunityPreferenceToggled(e.strName, t);
},
label: e.strLabel,
checked: !!this.state.communityPreferences[e.strName],
description: e.strDesc ? e.strDesc : "",
},
e.children,
);
}
SettingLink(e) {
return r.createElement("div", { className: "_DialogInputContainer _DialogLayout" }, r.createElement("div", { className: "displayColumn alignSelfCenter" }, r.createElement("div", { className: "DialogToggle_Label" }, r.createElement(C.ns, { href: e.strLink }, e.strLabel)), e.strDesc && r.createElement("div", { className: "DialogToggle_Description" }, e.strDesc), this.props.children));
}
}
(0, o.gn)([c.ak], f.prototype, "OnSubmit", null),
(0, o.gn)([c.ak], f.prototype, "HandleRadioChange", null),
(0, o.gn)([c.ak], f.prototype, "OnSettingToggled", null),
(0, o.gn)([c.ak], f.prototype, "OnCommunityPreferenceToggled", null),
(0, o.gn)([c.ak], f.prototype, "FriendsSettingsToggleRow", null),
(0, o.gn)([c.ak], f.prototype, "FriendsSettingsCheckbox", null),
(0, o.gn)([c.ak], f.prototype, "FriendsSettingsCommunityPreferenceToggleRow", null),
(0, o.gn)([c.ak], f.prototype, "SettingLink", null),
(function (e) {
(e[(e.k_EChatFontSizeSmall = 1)] = "k_EChatFontSizeSmall"), (e[(e.k_EChatFontSizeDefault = 2)] = "k_EChatFontSizeDefault"), (e[(e.k_EChatFontSizeLarge = 3)] = "k_EChatFontSizeLarge");
})(i || (i = {}));
class v extends r.Component {
render() {
let e = this.props.bParenthesizeNicknames,
t = (0, m.Xx)("#FriendSettings_ExampleFriend"),
n = (0, m.Xx)("#FriendSettings_ExampleNickname"),
i = new d.Pv(new p.K());
return (i.m_strPlayerName = t), (i.m_ePersonaState = 1), (i.m_strAvatarHash = d.WV), r.createElement("div", { className: "friend online friendSettingsFakeFriend" }, r.createElement(h.vV, { className: "fakeFriendAvatar", persona: i, statusPosition: "right" }), r.createElement(u.o, { className: "labelHolder", persona: i, eFriendRelationship: 3, bIsSelf: !1, strNickname: n, bParenthesizeNicknames: e, bCompactView: !1 }));
}
}
let S = class extends f {
constructor(e) {
super(e);
}
SetChatFontSize(e) {
this.setState({ friendSettings: Object.assign(Object.assign({}, this.state.friendSettings), { nChatFontSize: e }) }), (this.m_bSettingsChanged = !0);
}
render() {
let e = this.FriendsSettingsToggleRow,
t = this.state.friendSettings.nChatFontSize;
return r.createElement(
a.l0,
{ className: "DialogBody", onSubmit: this.OnSubmit },
r.createElement(
"div",
{ className: "SettingsGroup" },
r.createElement(e, { strName: "bCompactFriendsList", strLabel: (0, m.Xx)("#FriendSettings_CompactFriendsAndChat") }),
r.createElement(e, { strName: "bCompactQuickAccess", strLabel: (0, m.Xx)("#FriendSettings_CompactQuickAccess") }),
r.createElement(a.__, { className: "friendSettingsSubheader" }, (0, m.Xx)("#FriendSettings_ChatFontSize")),
r.createElement(a.FT, { className: "FriendsSettingsChatFontSizeSection_ButtonRow" }, r.createElement(a.zx, { className: "smallFontSetting " + (t == i.k_EChatFontSizeSmall ? "Primary" : "Off"), onClick: () => this.SetChatFontSize(i.k_EChatFontSizeSmall) }, (0, m.Xx)("#FriendSetting_ChatFontSmall")), r.createElement(a.zx, { className: "defaultFontSetting " + (t == i.k_EChatFontSizeDefault ? "Primary" : "Off"), onClick: () => this.SetChatFontSize(i.k_EChatFontSizeDefault) }, (0, m.Xx)("#FriendSetting_ChatFontDefault")), r.createElement(a.zx, { className: "largeFontSetting " + (t == i.k_EChatFontSizeLarge ? "Primary" : "Off"), onClick: () => this.SetChatFontSize(i.k_EChatFontSizeLarge) }, (0, m.Xx)("#FriendSetting_ChatFontLarge"))),
),
!this.props.bSubmitImmediate && r.createElement(a.o9, { onCancel: this.props.onCancel }),
);
}
};
(0, o.gn)([c.ak], S.prototype, "SetChatFontSize", null), (S = (0, o.gn)([l.Pi], S));
let b = class extends f {
render() {
let e = this.FriendsSettingsToggleRow,
t = s.De.IN_CLIENT ? "#FriendSettings_RememberOpenChats_DescClient" : "#FriendSettings_RememberOpenChats_Desc",
n = this.SettingLink;
return r.createElement(
a.l0,
{ className: "DialogBody", onSubmit: this.OnSubmit },
r.createElement(
"div",
{ className: "SettingsGroup" },
this.props.bShowPopupOpts && r.createElement(r.Fragment, null, r.createElement(a.gE, { onChange: (e) => _.g_FriendsUIDesktopApp.ToggleSingleWindowMode(e), label: (0, m.Xx)("#FriendSettings_DockChats"), checked: g.Ul.SettingsStore.BSingleWindowModeEnabled() }), r.createElement(e, { strName: "bAlwaysNewChatWindow", strLabel: (0, m.Xx)("#FriendSettings_AlwaysNewChatWindow") })),
r.createElement(e, { strName: "bDisableEmbedInlining", strLabel: (0, m.Xx)("#FriendSettings_DisableEmbedInlining") }),
r.createElement(e, { strName: "bRememberOpenChats", strLabel: (0, m.Xx)("#FriendSettings_RememberOpenChats"), strDesc: (0, m.Xx)(t) }),
r.createElement(e, { strName: "b24HourClock", strLabel: (0, m.Xx)("#FriendSettings_AlwaysUse24HourClock") }),
r.createElement(e, { strName: "bDisableSpellcheck", strLabel: (0, m.Xx)("#FriendSettings_DisableSpellcheck") }),
g.Ul.UIStore.show_winter_sale_ui && r.createElement(e, { strName: "bDisableRoomEffects", strLabel: (0, m.Xx)("#FriendSettings_DisableRoomEffects") }),
r.createElement(n, { strLabel: (0, m.Xx)("#TextFilterStatus_ChangeSettings"), strLink: g.Ul.ChatStore.GetTextFilterSettingsURL(), strDesc: g.Ul.ChatStore.GetTextFilterStatus() }),
),
);
}
};
b = (0, o.gn)([l.Pi], b);
let I = class extends f {
constructor(e) {
super(e);
}
render() {
let e = this.FriendsSettingsToggleRow,
t = this.FriendsSettingsCommunityPreferenceToggleRow;
return r.createElement(
a.l0,
{ className: "DialogBody", onSubmit: this.OnSubmit },
r.createElement(
"div",
{ className: "SettingsGroup" },
r.createElement(t, { strName: "bParenthesizeNicknames", strLabel: (0, m.Xx)("#FriendSettings_ParenthesizeNicknames") }, r.createElement(v, { bParenthesizeNicknames: this.state.communityPreferences.bParenthesizeNicknames })),
r.createElement(e, { strName: "bCategorizeInGameFriendsByGame", strLabel: (0, m.Xx)("#FriendSettings_CategorizeInGameFriendsByGame") }),
r.createElement(e, { strName: "bHideOfflineFriendsInTagGroups", strLabel: (0, m.Xx)("#FriendSettings_HideOfflineFriendsInCategories") }),
r.createElement(e, { strName: "bHideCategorizedFriends", strLabel: (0, m.Xx)("#FriendSettings_HideCategorizedFriends") }),
r.createElement(e, { strName: "bForceAlphabeticFriendSorting", strLabel: (0, m.Xx)("#FriendSettings_SortFriendsByStatus") }),
this.props.bDoNotDisturbSupported && r.createElement(e, { strName: "bSignIntoFriends", strLabel: (0, m.Xx)("#FriendSettings_SignInToFriends") }),
r.createElement(e, { strName: "bAnimatedAvatars", strLabel: (0, m.Xx)("#FriendSettings_AnimatedAvatars") }),
),
);
}
};
I = (0, o.gn)([l.Pi], I);
},
69807: (e, t, n) => {
"use strict";
n.d(t, { aO: () => it, Gs: () => q, Q$: () => j });
var i = n(85556),
o = n(27378),
r = n(41370),
a = n(50649),
s = n(72746),
l = n(11259),
c = n(83666),
m = n(68816),
d = n(87018),
h = n(84290),
u = n(49269),
p = n.n(u),
_ = n(37091);
function g(e) {
const { title: t, children: n } = e;
return o.createElement("div", { className: p().PanelSection }, t && o.createElement("div", { className: p().PanelSectionTitle }, o.createElement("div", { className: p().Text }, t), e.spinner && o.createElement(c.$jN, null)), n);
}
(0, a.Pi)((e) => {
const { checked: t, onChange: n, icon: i, children: r } = e;
return o.createElement(l.fp, { label: r, onChange: n, checked: t instanceof Function ? t() : t, padding: "compact", icon: i });
}),
(0, a.Pi)((e) => {
const t = e.value;
return o.createElement(l.z2, Object.assign({ layout: "inline" }, e, { value: t instanceof Function ? t() : t }));
});
const C = (0, _.Sb)(p().PanelSectionRow);
var f = n(36226),
v = n(38461),
S = n(16518),
b = n(37234),
I = n(70215),
y = n(23133),
E = n(10553),
D = n(50913),
w = n(14341),
R = n(5651),
A = n(82909),
M = n(61963),
k = n(2049),
T = n(65204),
L = n(83817),
G = n(55981),
O = n(22820),
F = n.n(O),
B = n(62860),
x = n(70283),
N = n(71224);
function P(e) {
var t;
const [n, i] = o.useState(void 0),
r = (function () {
const e = o.useRef(new Map());
return o.useCallback((t) => (e.current.has(t) || e.current.set(t, o.createRef()), e.current.get(t)), []);
})(),
a = null != n,
s = (e) => {
i(null == e ? void 0 : e.key);
},
l = (t) => {
if (a) {
let i;
switch (t.detail.button) {
case G.eV.DIR_UP:
i = -1;
break;
case G.eV.DIR_DOWN:
i = 1;
break;
default:
return !1;
}
return (
((t) => {
const i = e.items.find((e) => e.key == n);
try {
return null != e.onMoveRelative && null != i && e.onMoveRelative(i.index, t);
} catch (e) {
return console.error("Failed to reorder item:", e), !1;
}
})(i)
? x.LT.PlayNavSound(i > 0 ? x.qr.SliderUp : x.qr.SliderDown)
: x.LT.PlayNavSound(x.qr.FailedNav),
!0
);
}
return !1;
},
c = [{ name: void 0, label: void 0 }, ...(null !== (t = e.sections) && void 0 !== t ? t : [])].map((t, i) => {
var a;
return { strLabel: t.label, key: null !== (a = t.label) && void 0 !== a ? a : i, rgItems: e.items.filter((e) => e.sectionName == t.name).map((t, i) => o.createElement(U, { key: t.key, detail: t, onSelect: () => s(t), onDone: () => s(void 0), selected: n == t.key, navRef: r(t.key), bottomSeparator: i < e.items.length - 1, onGamepadDirection: l, onReorderActionDescription: e.onReorderActionDescription, onStopReorderActionDescription: e.onStopReorderActionDescription })) };
}),
m = o.useRef();
return (
o.useEffect(() => {
var e, t;
if (a && (null === (e = m.current) || void 0 === e ? void 0 : e.BFocusWithin())) {
const e = r(n).current;
e && !e.BHasFocus() && e.TakeFocus();
} else 0 == (null === (t = m.current) || void 0 === t ? void 0 : t.BFocusWithin()) && m.current.TakeFocus();
}),
o.createElement(
L.s,
{ retainFocus: !0, navRef: m, navEntryPreferPosition: a ? B.c4.PREFERRED_CHILD : B.c4.MAINTAIN_Y },
c.map(({ strLabel: e, key: t, rgItems: n }) => (0 == n.length ? null : o.createElement(o.Fragment, { key: t }, e && o.createElement(N.dQ, null, e), n))),
)
);
}
function U(e) {
var t, n, i;
const r = null !== (t = e.onReorderActionDescription) && void 0 !== t ? t : (0, h.Xx)("#ActionButtonLabelReorder"),
a = null !== (n = e.onStopReorderActionDescription) && void 0 !== n ? n : (0, h.Xx)("#ActionButtonLabelDone"),
s = null !== (i = e.detail.disabled) && void 0 !== i && i,
m = void 0 === e.detail.displayedIndex ? e.detail.index : e.detail.displayedIndex;
return o.createElement(l.gN, {
focusable: !s,
icon: o.createElement("div", { className: F().ReorderableListIconIndexCtr }, o.createElement("div", { className: (0, d.Z)(F().ReorderableListIndexCtr, e.selected && F().Selected) }, o.createElement(c.$nC, { direction: "up", className: F().ReorderArrow }), o.createElement("div", { className: F().ReorderableListIndex, style: { backgroundColor: e.detail.indexColor } }, m), o.createElement(c.$nC, { direction: "down", className: F().ReorderArrow })), e.detail.icon),
label: o.createElement("div", { className: F().ReorderableListItemLabel }, e.detail.label),
className: (0, d.Z)(F().ReorderableListItem, e.selected && F().Selected, s && F().Disabled),
disabled: s,
highlightOnFocus: !e.selected,
bottomSeparator: e.bottomSeparator && !e.selected ? "standard" : "none",
onClick: e.detail.disabled ? null : e.selected ? e.onDone : e.onSelect,
onCancel: e.selected ? e.onDone : void 0,
onOKActionDescription: e.selected ? a : r,
onCancelActionDescription: e.selected ? null : void 0,
onOptionsButton: e.detail.onOptionsButton,
onOptionsActionDescription: e.detail.onOptionsActionDescription,
onSecondaryButton: e.detail.onSecondaryButton,
onSecondaryActionDescription: e.detail.onSecondaryActionDescription,
onGamepadDirection: e.onGamepadDirection,
navRef: e.navRef,
navKey: e.detail.key,
preferredFocus: e.selected,
});
}
function V(e) {
const { closeModal: t, title: n, className: r } = e,
a = (0, i._T)(e, ["closeModal", "title", "className"]);
return o.createElement(T.RG, { className: (0, d.Z)(F().ReorderableListDialog, r), onCancel: t }, o.createElement(L.s, { onCancel: t }, o.createElement("div", { className: F().ModalHeader }, o.createElement(l.h4, null, n), o.createElement(L.s, { focusable: !0, className: F().CloseButtonContainer, onActivate: t }, o.createElement(c.x8P, { className: F().CloseButton }))), o.createElement(l.uT, null, o.createElement(l.Ac, null, o.createElement(P, Object.assign({}, a))))));
}
var H = n(57476),
W = n(94623),
X = n(88669);
function j(e, t, n, r, a) {
return (0, i.mG)(this, void 0, void 0, function* () {
if (!s.Ul.RemotePlayStore.BDialogOpenInContext(e, "rpt")) {
const i = () => s.Ul.RemotePlayStore.StopRemotePlay(),
a = yield (0, m.BR)(o.createElement(z, { streamHost: t, uiMode: n }), r, (0, h.Xx)("#Friend_Menu_RemotePlay"), { strTitle: (0, h.Xx)("#Friend_Menu_RemotePlay"), popupWidth: 512, popupHeight: 834, fnOnClose: i }, e, { bHideActions: !0 });
s.Ul.RemotePlayStore.DialogOpened(e, () => a.Close(), "rpt");
}
});
}
function z(e) {
const { streamHost: t, uiMode: n } = e;
return o.createElement(Ze.Provider, { value: { streamHost: t } }, o.createElement(E.fI, { IN_DESKTOPUI: 7 == n, IN_GAMEPADUI: 4 == n, IN_VR: !1 }, o.createElement(m.e1, { className: (0, d.Z)(f.ModalPosition), bHideCloseIcon: !0 }, o.createElement(Z, null))));
}
function K(e) {
(0, s.E2)();
const { hostPlayer: t, bAmHost: n, rgPlayers: i } = Qe(),
a = null != t,
c = (0, s.oR)(),
m = (0, r.SZ)(() => {
var e;
return null === (e = s.Ul.FriendStore.self) || void 0 === e ? void 0 : e.current_game_name;
}),
d = (0, o.useContext)(Ze),
u = (0, o.useContext)(E.E_);
return c
? o.createElement(
o.Fragment,
null,
o.createElement(g, { title: m }, o.createElement(ce, { browserContext: e.browserContext })),
a &&
o.createElement(
g,
{ title: (0, h.Xx)("#RemotePlay_Players") },
[t, ...i].filter((e) => e.bSession).map((e) => o.createElement(ee, { player: e, key: `${e.playerID.steamid}_${e.playerID.guestid}`, quickaccess: !0 })),
n && o.createElement(C, null, o.createElement(l.gN, { childrenLayout: "below" }, o.createElement(L.s, { className: f.InviteFriendGuestButtons }, o.createElement(l.zx, { className: f.InlineInviteButton, onClick: (e) => gt(d, u, (0, X.RA)(e)) }, (0, h.Xx)("#RemotePlay_InviteFriend")), o.createElement(l.zx, { className: f.InlineInviteButton, onClick: () => we(e.browserContext) }, (0, h.Xx)("#RemotePlay_InviteGuest"))))),
),
a && o.createElement(g, null, o.createElement(Fe, null), o.createElement(he, null)),
)
: o.createElement(g, { title: (0, h.Xx)("#RemotePlay_NoGameRunning") });
}
function q(e) {
const t = (0, s.E2)();
return o.createElement(Ze.Provider, { value: { streamHost: t } }, o.createElement("div", { className: f.QuickAccessContainer }, o.createElement("div", { className: f.QuickAccessTitle }, (0, h.Xx)("#RemotePlayTogether_QuickAccessTitle")), o.createElement(R.P8, { className: f.QuickAccessScrollPanel }, o.createElement(K, { browserContext: e.browserContext }))));
}
const Z = () => o.createElement(l.oX, { classNameContent: f.ContentForm }, o.createElement(Q, null), o.createElement($, null), o.createElement(Ge, { showVolume: !0 })),
Q = (0, a.Pi)(function () {
const e = s.Ul.RemotePlayStore.bIsShowingPlaceholder,
t = parseInt(s.Ul.RemotePlayStore.game_id);
let n = null;
if (!isNaN(t)) {
const e = D.Q8.GetAppInfo(t).name;
n = o.createElement("div", { className: f.GameName, onClick: (e) => (0, w.b8)(e, `${E.De.STORE_BASE_URL}app/${t}`) }, e);
}
return o.createElement(l.h4, { className: f.DialogHeader }, (0, h.Xx)("#Friend_Menu_RemotePlay"), o.createElement("div", { className: f.StreamPausedNote, style: e ? void 0 : { visibility: "hidden" } }, (0, h.Xx)("#RemotePlay_StreamPaused")), o.createElement("div", { className: f.HeaderActions }, o.createElement("div", { className: f.GameInfo }, n), o.createElement("div", { className: f.HeaderActionsButtons }, o.createElement(de, null), o.createElement(le, null))));
}),
$ = () => o.createElement(l.uT, { className: f.MediaBoxBody }, o.createElement(Y, null), o.createElement(J, null)),
Y = () => {
const { hostPlayer: e } = Qe();
return o.createElement(He, { title: (0, h.Xx)("#RemotePlay_Host") }, o.createElement(ee, { player: e, quickaccess: !1 }));
},
J = (0, a.Pi)(function () {
const { bAmHost: e, rgPlayers: t } = Qe();
(0, o.useContext)(Ze);
return o.createElement(
He,
{ title: (0, h.Xx)("#RemotePlay_Players") },
t.map((e, t) => (e.bSession ? o.createElement(ee, { player: e, key: `${e.playerID.steamid}_${e.playerID.guestid}`, quickaccess: !1 }) : null)),
e && o.createElement(Re, null),
e && o.createElement(Ae, null),
);
}),
ee = (0, a.Pi)(function (e) {
const { player: t } = e;
return t.playerID.guestid && !t.friend.accountid ? (t.bJoined ? o.createElement(re, Object.assign({}, e)) : o.createElement(ae, Object.assign({}, e))) : o.createElement(oe, Object.assign({}, e));
});
function te(e) {
var t;
return (null === (t = e.friend) || void 0 === t ? void 0 : t.accountid) ? e.friend.display_name : (0, h.Xx)("#RemotePlay_NumberedGuest", e.playerID.guestid);
}
function ne(e) {
const { bAmHost: t } = Qe(),
n = s.Ul.RemotePlayStore.GetControllerSlotsForPlayer(e.playerID),
i = !(e.bKeyboardEnabled || e.bMouseEnabled || (e.bControllerEnabled && 0 !== n.length)),
o = e.rtJoined + 5,
r = t && i && e.bJoined && o < Date.now() / 1e3;
return ue(1e3 * o), r;
}
function ie(e, t) {
const n = ne(e);
return e.bJoined ? (t && n ? (0, h.Xx)("#RemotePlay_PlayerNoInputWarning_Concise") : void 0) : (0, h.Xx)("#RemotePlay_Player_Invited");
}
const oe = (0, a.Pi)(function (e) {
const { player: t, quickaccess: n } = e,
{ friend: i } = t,
{ bAmHost: r } = Qe(),
a = i.persona.avatar_url_full,
l = i.accountid === s.Ul.FriendStore.self.accountid,
c = r && !l,
m = r && !l && void 0 !== t.flNetworkDuration,
u = () => (t.playerID.guestid ? s.Ul.RemotePlayStore.CancelGuestInviteAndSession(t.playerID.steamid, t.playerID.guestid) : s.Ul.RemotePlayStore.CancelInviteAndSession(i.accountid)),
p = (e) => (0, w.b8)(e, i.GetCommunityProfileURL()),
_ = n ? (0, h.Xx)("#RemotePlay_CancelInvite") : (0, h.Xx)("#Button_Cancel"),
g = t.bJoined ? (0, h.Xx)("#RemotePlay_Kick") : _,
C = te(t),
v = ie(t, n),
S = _e(t);
return o.createElement(ze, {
quickaccess: n,
icon: o.createElement(Le, { src: a, onClick: n ? void 0 : p, className: f.PersonaAvatar }),
statusIcon: m && o.createElement("div", { title: (0, h.Xx)("#Tooltip_RemotePlay_ConnectionQuality"), style: { display: "flex" } }, o.createElement(at, { className: (0, d.Z)(f.PlayerBitRate, n && f.QuickAccess), quality: st(t.flNetworkDuration) })),
title: o.createElement("div", { className: f.PersonaName }, o.createElement("span", { onClick: n ? void 0 : p, className: f.PersonaNameName }, C), t.bMobile && o.createElement(rt, null)),
volumeControls: o.createElement(ye, { player: t }),
statusText: v,
desktopButtons: c && o.createElement(qe, { onClick: u }, g),
onSecondaryButton: c ? u : void 0,
onSecondaryActionDescription: c ? g : void 0,
playerControls: (!n || l || t.bJoined) && o.createElement(ge, { player: t, quickaccess: n }),
contextMenu: o.createElement(M.xV, { label: C }, o.createElement(M.Zo, { onSelected: p }, (0, h.Xx)("#RemotePlay_ShowProfile")), c && o.createElement(M.Zo, { onSelected: u }, g), S.length > 0 && o.createElement(M.uP, null), S),
});
}),
re = (0, a.Pi)(function (e) {
const { player: t, quickaccess: n } = e,
{ bAmHost: i } = Qe(),
r = (0, I.U0)(t.strAvatarHash, "full"),
a = i,
l = i && void 0 !== t.flNetworkDuration,
c = () => s.Ul.RemotePlayStore.CancelGuestInviteAndSession(t.playerID.steamid, t.playerID.guestid),
m = te(t),
d = o.createElement("div", { className: f.GuestTitle }, m, t.bMobile && o.createElement(rt, null)),
u = ie(t, n),
p = _e(t);
return o.createElement(ze, { quickaccess: n, icon: o.createElement(Le, { src: r }), statusIcon: l && o.createElement("div", { title: n ? void 0 : (0, h.Xx)("#Tooltip_RemotePlay_ConnectionQuality"), style: { display: "flex" } }, o.createElement(at, { className: f.PlayerBitRate, quality: st(t.flNetworkDuration) })), statusText: u, title: d, desktopButtons: a && o.createElement(qe, { onClick: c }, (0, h.Xx)("#RemotePlay_Kick")), onSecondaryButton: a ? c : void 0, onSecondaryActionDescription: (0, h.Xx)("#RemotePlay_Kick"), playerControls: (!n || t.bJoined) && o.createElement(ge, { player: t, quickaccess: n }), contextMenu: (a || p.length > 0) && o.createElement(M.xV, { label: m }, a && o.createElement(M.Zo, { onSelected: c }, (0, h.Xx)("#RemotePlay_Kick")), p.length > 0 && o.createElement(M.uP, null), p) });
}),
ae = (0, a.Pi)(function (e) {
const { player: t, quickaccess: n } = e,
[i, r] = $e(),
a = () => {
s.Ul.RemotePlayStore.CopyLink(t.playerID.guestid), r();
},
l = () => {
s.Ul.RemotePlayStore.CancelGuestInviteAndSession(t.playerID.steamid, t.playerID.guestid);
},
m = te(t);
return o.createElement(ze, {
quickaccess: n,
icon: n ? o.createElement(c.n5m, null) : o.createElement(se, null),
title: m,
clipboardStatus: (0, h.Xx)(i ? "#RemotePlay_Guest_CopyHint_Copied" : "#RemotePlay_Guest_CopyHint"),
desktopButtons: o.createElement(
qe,
{
onClick: (e) => {
e.stopPropagation(), l();
},
},
(0, h.Xx)("#Button_Cancel"),
),
className: f.InvitedGuestBox,
onClick: a,
onClickDescription: (0, h.Xx)("#RemotePlay_LinkCopy_Button"),
contextMenu: o.createElement(M.xV, { label: m }, o.createElement(M.Zo, { onSelected: a }, (0, h.Xx)("#RemotePlay_LinkCopy_Button")), o.createElement(M.Zo, { onSelected: l }, (0, h.Xx)("#RemotePlay_CancelInvite"))),
connectURL: t.strConnectUrl,
});
});
function se() {
return o.createElement(Te, { label: (0, h.Xx)("#RemotePlay_CopyLink_ButtonText") }, o.createElement(nt, { color: "white" }));
}
const le = (e) => {
const { bAmHost: t } = Qe();
return o.createElement(qe, { style: "dark", onClick: () => s.Ul.RemotePlayStore.StopRemotePlay(), className: f.HeaderButton }, (0, h.Xx)(t ? "#RemotePlay_EndStream" : "#RemotePlay_LeaveStream"));
},
ce = (e) => {
const { hostPlayer: t, bAmHost: n } = Qe(),
a = (0, r.SZ)(() => s.Ul.RemotePlayStore.BCanCreateInviteForCurrentGame());
let c, m;
if (t) (c = () => s.Ul.RemotePlayStore.StopRemotePlay()), (m = (0, h.Xx)(n ? "#RemotePlay_EndSession" : "#RemotePlay_LeaveStream"));
else {
if (!a) return null;
(c = () => {
s.Ul.RemotePlayStore.StopRemotePlay(),
(function (e) {
(0, i.mG)(this, void 0, void 0, function* () {
try {
return s.Ul.RemotePlayStore.CreateGroup(s.Ul.FriendStore.self.persona.m_gameid, e);
} catch (e) {
throw (console.error(`RemotePlayStore.CreateGroup caught: ${e}`), e);
}
});
})(e.browserContext);
}),
(m = (0, h.Xx)("#RemotePlay_CreateSession"));
}
return o.createElement(C, null, o.createElement(l.sT, { layout: "below", onClick: c, onOKActionDescription: m, bottomSeparator: "none" }, m));
};
function me(e) {
switch (e) {
case 3:
return (0, h.Xx)("#RemotePlay_ClientQualityName_Beautiful");
case 2:
return (0, h.Xx)("#RemotePlay_ClientQualityName_Balanced");
case 1:
return (0, h.Xx)("#RemotePlay_ClientQualityName_Fast");
default:
return (0, h.Xx)("#RemotePlay_ClientQualityName_Automatic");
}
}
const de = (0, a.Pi)(function () {
const e = s.Ul.RemotePlayStore.client_streaming_quality,
t = (0, h.Xx)("#RemotePlay_ClientQuality_WithValue", me(e)),
n = s.Ul.RemotePlayStore.GetSessionForPlayer({ steamid: s.Ul.FriendStore.self.steamid64, guestid: 0 }),
i = n && void 0 !== n.flNetworkDuration,
{ hostPlayer: r } = Qe();
return r
? o.createElement(
"div",
{ className: f.ClientQualityContainer },
i && o.createElement(at, { className: f.HeaderBitrate, quality: st(n.flNetworkDuration) }),
o.createElement(
qe,
{
onClick: () => {
let e = s.Ul.RemotePlayStore.client_streaming_quality;
(e += 1), 0 == e && (e = 1), e > 3 && (e = s.Ul.RemotePlayStore.is_host ? -1 : 1), s.Ul.RemotePlayStore.SetClientStreamingQuality(e);
},
style: "dark",
className: f.HeaderButton,
},
t,
),
)
: null;
}),
he = (0, a.Pi)(function (e) {
const t = s.Ul.RemotePlayStore.client_streaming_quality,
{ bAmHost: n } = Qe(),
i = [
{ data: 1, label: me(1) },
{ data: 2, label: me(2) },
{ data: 3, label: me(3) },
];
n && i.unshift({ data: -1, label: me(-1) });
const r = s.Ul.RemotePlayStore.GetSessionForPlayer({ steamid: s.Ul.FriendStore.self.steamid64, guestid: 0 }),
a = r && void 0 !== r.flNetworkDuration,
c = s.Ul.RemotePlayStore.host_streaming_quality_override,
m = !n && -1 != c,
d = s.Ul.RemotePlayStore.in_session && s.Ul.RemotePlayStore.BHasJoinedPlayer() && !m;
return o.createElement(
C,
null,
o.createElement(
l.gN,
{ label: (0, h.Xx)("#RemotePlay_ClientQuality"), icon: a && o.createElement(at, { className: f.HeaderBitrate, quality: st(r.flNetworkDuration) }), childrenLayout: "inline", bottomSeparator: e.bottomSeparator, description: m ? (0, h.Xx)("#RemotePlay_ClientQuality_HostOverride") : void 0 },
o.createElement(l.TW, {
rgOptions: i,
selectedOption: m ? c : t,
onChange: (e) => {
s.Ul.RemotePlayStore.SetClientStreamingQuality(e.data);
},
disabled: !d,
}),
),
);
});
function ue(e) {
const [t, n] = (0, o.useState)(0),
i = () => n((e) => e + 1);
(0, o.useEffect)(() => {
const t = Date.now();
if (t < e) {
const n = window.setTimeout(i, e - t);
return () => window.clearTimeout(n);
}
return () => {};
}, [e]);
}
function pe(e) {
const { bAmHost: t } = Qe(),
n = e.playerID.steamid === s.Ul.FriendStore.self.steamid64,
i = t && !n,
r = e.playerID.steamid === s.Ul.FriendStore.self.steamid64,
a = s.Ul.RemotePlayStore.GetControllerSlotsForPlayer(e.playerID);
return {
fnToggleKeyboard: o.useCallback(() => {
i && s.Ul.RemotePlayStore.SetPerUserKeyboardInputEnabled(e.playerID, !e.bKeyboardEnabled);
}, [i, e]),
fnToggleMouse: o.useCallback(() => {
i && s.Ul.RemotePlayStore.SetPerUserMouseInputEnabled(e.playerID, !e.bMouseEnabled);
}, [i, e]),
fnTogglePlayersControllers: o.useCallback(() => {
i && (a.forEach((e) => s.Ul.RemotePlayStore.TriggerControllerRumble(e)), s.Ul.RemotePlayStore.SetPerUserControllerInputEnabled(e.playerID, !e.bControllerEnabled));
}, [i, e.bControllerEnabled, e.playerID, a]),
fnIdentifyController: o.useCallback(
(e) => {
r && s.Ul.RemotePlayStore.TriggerControllerRumble(e);
},
[r],
),
};
}
function _e(e) {
var t;
const { fnToggleKeyboard: n, fnToggleMouse: i, fnTogglePlayersControllers: r } = pe(e),
{ bAmHost: a } = Qe(),
l = (null === (t = e.friend) || void 0 === t ? void 0 : t.accountid) === s.Ul.FriendStore.self.accountid;
if (!a || l || !e.bJoined) return [];
const c = [];
return null != n && c.push(o.createElement(M.Zo, { key: "kb", onSelected: n }, e.bKeyboardEnabled ? (0, h.Xx)("#Tooltip_RemotePlay_DisableKeyboard") : (0, h.Xx)("#Tooltip_RemotePlay_EnableKeyboard"))), null != i && c.push(o.createElement(M.Zo, { key: "mouse", onSelected: i }, e.bMouseEnabled ? (0, h.Xx)("#Tooltip_RemotePlay_DisableMouse") : (0, h.Xx)("#Tooltip_RemotePlay_EnableMouse"))), null != r && c.push(o.createElement(M.Zo, { key: "controllers", onSelected: r }, e.bControllerEnabled ? (0, h.Xx)("#Tooltip_RemotePlay_DisableControllers_Standalone") : (0, h.Xx)("#Tooltip_RemotePlay_EnableControllers_Standalone"))), c;
}
const ge = (0, a.Pi)(function (e) {
const { player: t, quickaccess: n } = e,
{ fnToggleKeyboard: i, fnToggleMouse: r, fnTogglePlayersControllers: a, fnIdentifyController: l } = pe(t),
m = ne(t),
u = s.Ul.RemotePlayStore.GetControllerSlotsForPlayer(t.playerID),
p = null != a ? a : l;
return o.createElement(
"div",
{ className: (0, d.Z)(n && f.QuickAccessPlayerControlsContainer, f.PlayerControlsContainer) },
o.createElement(
"div",
{ className: f.PlayerControls },
o.createElement(Ie, { enabled: t.bKeyboardEnabled, onClick: i, icon: n ? c.N1d : et, title: n ? void 0 : fe(t.bKeyboardEnabled, null != i), lastUsedTime: t.nKeyboardUsedTime, quickaccess: n, className: f.Keyboard }),
o.createElement(Ie, { enabled: t.bMouseEnabled, onClick: r, icon: n ? c.TKz : Je, title: n ? void 0 : Ce(t.bMouseEnabled, null != r), lastUsedTime: t.nMouseUsedTime, quickaccess: n, className: f.Mouse }),
u.map((e, i) => o.createElement(be, { key: `${e}_${i}`, enabled: t.bControllerEnabled, onClick: () => p(e), slot: e, title: n ? void 0 : ve(t.bControllerEnabled, null != a), interactable: null != p, lastUsedTime: t.nControllerUsedTime, quickaccess: n })),
m && !n && o.createElement("div", { className: f.NoInputWarning, title: (0, h.Xx)("#RemotePlay_PlayerNoInputWarning") }, o.createElement(ot, { className: f.WarningIcon })),
),
);
});
function Ce(e, t) {
return t ? (e ? (0, h.Xx)("#Tooltip_RemotePlay_DisableMouse") : (0, h.Xx)("#Tooltip_RemotePlay_EnableMouse")) : e ? (0, h.Xx)("#Tooltip_RemotePlay_MouseEnabled") : (0, h.Xx)("#Tooltip_RemotePlay_MouseDisabled");
}
function fe(e, t) {
return t ? (e ? (0, h.Xx)("#Tooltip_RemotePlay_DisableKeyboard") : (0, h.Xx)("#Tooltip_RemotePlay_EnableKeyboard")) : e ? (0, h.Xx)("#Tooltip_RemotePlay_KeyboardEnabled") : (0, h.Xx)("#Tooltip_RemotePlay_KeyboardDisabled");
}
function ve(e, t) {
return t ? (e ? (0, h.Xx)("#Tooltip_RemotePlay_DisableControllers") : (0, h.Xx)("#Tooltip_RemotePlay_EnableControllers")) : e ? (0, h.Xx)("#Tooltip_RemotePlay_ControllersEnabled") : (0, h.Xx)("#Tooltip_RemotePlay_ControllersDisabled");
}
function Se(e) {
const { controllerType: t, mobile: n, className: i } = e;
return n ? o.createElement(c.ij_, { className: i }) : o.createElement(c.CtA, { controllerType: t, className: i });
}
function be(e) {
const { slot: t, enabled: n, onClick: i, title: r, interactable: a, lastUsedTime: l, quickaccess: m } = e,
h = t < s.Ul.RemotePlayStore.priority_controller_slot_count,
u = l + 1e3,
p = u > Date.now();
ue(u);
const _ = Pe(t),
{ bAmHost: g } = Qe(),
C = !m && g,
v = (0, k.fJ)(() => s.Ul.RemotePlayStore.GetControllerType(t), [t], 0),
S = o.createElement("div", { className: (0, d.Z)(f.PlayerController, m && f.QuickAccessPlayerController, n && f.Enabled, !m && a && f.InteractableController, C && f.Grabbable), onClick: i, title: m ? void 0 : r }, o.createElement("div", { className: (0, d.Z)(f.PlayerControllerNumber, !h && f.Hidden), style: { backgroundColor: ct(t) } }, t + 1), o.createElement(c.CtA, { className: (0, d.Z)(f.PlayerControllerIcon, p && f.Wiggle), controllerType: v }));
return !g || m ? S : o.createElement(y.G, Object.assign({}, _), S);
}
function Ie(e) {
const { enabled: t, onClick: n, icon: i, title: r, lastUsedTime: a, className: s, quickaccess: l } = e,
c = a + 1e3,
m = c > Date.now();
ue(c);
const h = i,
u = o.createElement(h, { className: (0, d.Z)(f.PlayerControl, l && f.QuickAccess, t ? f.ControlEnabled : f.ControlDisabled, m && f.Wiggle) }),
p = !l && null != n;
return o.createElement("div", { onClick: p ? n : void 0, className: (0, d.Z)(s, p && f.InteractableControl, l && f.QuickAccessControlIcon), title: l ? void 0 : r }, u);
}
const ye = (0, a.Pi)(function (e) {
return e.player.playerID.steamid === s.Ul.FriendStore.self.steamid64 ? o.createElement(De, Object.assign({}, e)) : o.createElement(Ee, Object.assign({}, e));
}),
Ee = (0, a.Pi)(function (e) {
var t;
const { player: n } = e,
i = null === (t = null == n ? void 0 : n.friend) || void 0 === t ? void 0 : t.accountid;
if (!s.Ul.VoiceStore.IsAnyVoiceActive() || !i || !s.Ul.VoiceStore.IsVoiceActiveForFriend(i)) return null;
let r = s.Ul.VoiceStore.ConvertGainValueToSliderValue(s.Ul.VoiceStore.GetPerUserGainLevel(i), v.Ys.k_MaxPerUserGainMultiplier);
s.Ul.VoiceStore.GetPerUserMuting(i);
return o.createElement(Ye, { min: 0, max: 100, onChange: (e) => s.Ul.VoiceStore.SetPerUserGainLevel(i, s.Ul.VoiceStore.ConvertSliderToGainValue(e, v.Ys.k_MaxPerUserGainMultiplier)), value: r, icon: tt, onIconClick: () => s.Ul.VoiceStore.SetPerUserMuting(i, !s.Ul.VoiceStore.GetPerUserMuting(i)) });
}),
De = (0, a.Pi)(function (e) {
if (!s.Ul.VoiceStore.IsAnyVoiceActive()) return null;
return o.createElement(Ye, {
min: 0,
max: 100,
onChange: (e) => s.Ul.VoiceStore.SetVoiceInputGain(s.Ul.VoiceStore.ConvertSliderToGainValue(e, v.Ys.k_MaxInputOutputGainValue)),
value: s.Ul.VoiceStore.ConvertGainValueToSliderValue(s.Ul.VoiceStore.GetVoiceInputGain(), v.Ys.k_MaxInputOutputGainValue),
icon: ({ className: e }) => o.createElement(S.PjE, { className: (0, d.Z)(e, f.MicFillOverride) }),
onIconClick: () => {
s.Ul.VoiceStore.IsMicMuted() && s.Ul.VoiceStore.IsOutputMuted() && s.Ul.VoiceStore.ToggleOutputMuting(), s.Ul.VoiceStore.ToggleMicMuting();
},
});
});
function we(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
try {
return s.Ul.RemotePlayStore.CreateGuestInviteAndSession(s.Ul.FriendStore.self.persona.m_gameid, e);
} catch (e) {
throw (console.error(`RemotePlayStore.CreateGuestInviteAndCopyLink caught: ${e}`), e);
}
});
}
function Re(e) {
const t = (0, o.useContext)(Ze),
n = (0, o.useContext)(E.E_);
return o.createElement(ze, { quickaccess: !1, icon: o.createElement(Me, null), title: (0, h.Xx)("#RemotePlay_InviteFriend_Verbose"), description: (0, h.Xx)("#RemotePlay_InviteFriend_ShortDescription"), className: f.AddGuestBox, onClick: (e) => gt(t, n, (0, X.RA)(e)) });
}
function Ae(e) {
return o.createElement(ze, { quickaccess: !1, icon: o.createElement(ke, null), title: (0, h.Xx)("#RemotePlay_InviteGuest_Verbose"), description: (0, h.Xx)("#RemotePlay_LinkCopy_ShortDescription"), className: f.AddGuestBox, onClick: (e) => we((0, b.Um)(null, e)) });
}
function Me() {
return o.createElement(Te, { label: (0, h.Xx)("#RemotePlay_AddGuest_ButtonText") }, o.createElement("svg", { width: "19", height: "19", viewBox: "0 0 19 19" }, o.createElement("path", { d: "M15.9747 12.5368H12.5368V15.9976C12.5368 17.6707 11.1846 19.0229 9.51146 19.0229C7.83836 19.0229 6.48613 17.6707 6.48613 15.9976V12.5368H3.02533C1.35223 12.5368 0 11.1846 0 9.51146C0 7.83836 1.35223 6.48613 3.02533 6.48613H6.48613V3.02533C6.48613 1.35223 7.83836 0 9.51146 0C11.1846 0 12.5368 1.35223 12.5368 3.02533V6.48613H15.9976C17.6707 6.48613 19.0229 7.83836 19.0229 9.51146C19 11.1846 17.6478 12.5368 15.9747 12.5368Z", fill: "#F9FDFF" })));
}
function ke() {
return o.createElement(Te, { label: (0, h.Xx)("#RemotePlay_AddGuest_ButtonText") }, o.createElement(nt, { color: "white" }));
}
function Te(e) {
const { onClick: t, children: n, label: i } = e,
[r, a] = $e();
return o.createElement(
"div",
{
className: f.MediaButton,
onClick: () => {
a(), t && t();
},
},
o.createElement("div", { className: (0, d.Z)(f.ButtonContent, r && f.RecentlyInteracted) }, n, o.createElement("div", { className: f.MediaButtonLabel }, i)),
);
}
function Le(e) {
const { className: t } = e,
n = (0, i._T)(e, ["className"]);
return o.createElement("img", Object.assign({ className: (0, d.Z)(f.MediaImage, t) }, n));
}
const Ge = (0, a.Pi)(function (e) {
return o.createElement(l.$_, { className: f.Footer }, o.createElement(He, { title: (0, h.Xx)("#RemotePlay_GameSettings"), className: f.NoMarginTop }, o.createElement(Ke, { className: f.GameSettingsBox }, o.createElement(Oe, null), e.showVolume && o.createElement(Ve, null))));
}),
Oe = (0, a.Pi)(function () {
const { bAmHost: e, hostPlayer: t } = Qe(),
n = [];
for (let e = 0; e < s.Ul.RemotePlayStore.priority_controller_slot_count; e++) {
const i = mt(e, t);
n.push(o.createElement(Be, { index: e, key: e, player: i }));
}
return o.createElement("div", { className: f.ControllerDropSlotsContainer }, o.createElement("div", { className: f.ControllerDropSlots }, n, e && o.createElement("div", { className: f.HowToHint, title: (0, h.Xx)("#Tooltip_RemotePlayControllerAssignments") }, "?")), e && o.createElement(Ne, null));
}),
Fe = (0, a.Pi)(function () {
const { bAmHost: e, hostPlayer: t } = Qe(),
n = [];
for (let e = 0; e < s.Ul.RemotePlayStore.priority_controller_slot_count; e++) {
const i = mt(e, t);
n.push(o.createElement(xe, { index: e, key: e, player: i }));
}
const i = (0, o.useContext)(Ze),
r = (0, o.useContext)(E.E_);
return o.createElement(
C,
null,
o.createElement(
l.gN,
{
label: (0, h.Xx)("#RemotePlay_Controllers"),
childrenLayout: "below",
focusable: e,
onClick: e
? (e) =>
(function (e, t, n) {
const i = o.createElement(pt, { context: e, configContext: t }, (e) => o.createElement(ut, { closeModal: e }));
(0, m.AM)(i, n);
})(i, r, (0, X.RA)(e))
: void 0,
onOKActionDescription: e ? (0, h.Xx)("#RemotePlay_ChangeControllerOrder") : null,
},
o.createElement(
"div",
{ className: f.QuickAccessControllerOrderContainer },
n.map((e, t) => o.createElement(o.Fragment, { key: t }, t > 0 && o.createElement("div", { className: f.Divider }), e)),
),
),
);
}),
Be = (0, a.Pi)(function ({ index: e, player: t }) {
const n = !!t;
let i;
if (n) {
const e = t.friend.accountid ? t.friend.display_name : (0, h.Xx)("#RemotePlay_NumberedGuest", t.playerID.guestid);
i = (0, h.Xx)("#Tooltip_RemotePlayOtherController", e);
}
const { bDragHovered: r, dropTargetProps: a } = (function (e, t) {
const [n, i] = (0, o.useState)(!1),
r = Pe(e);
return {
bDragHovered: n,
dropTargetProps: Object.assign(Object.assign({}, t ? r : {}), {
rgAcceptedTypes: ["rptcontroller"],
fnDrop: (t) => {
i(!1), Ue(t) && t.controllerID !== e && (s.Ul.RemotePlayStore.SwapControllerSlots(t.controllerID, e), b.g_FriendsUIDesktopApp.DragDropManager.SetDropConsumed());
},
fnDragEnter: (t) => (Ue(t) ? (t.controllerID !== e && i(!0), !0) : (console.error("Drag event received invalid data type."), !1)),
fnDragLeave: () => {
i(!1);
},
}),
};
})(e, n),
{ bAmHost: l } = Qe(),
c = (0, d.Z)(f.ControllerDropSlot, { [f.WithMargin]: e > 0, [f.DragHovered]: r, [f.CanGrab]: l && n, [f.Interactable]: l && n }),
m = (0, k.fJ)(() => s.Ul.RemotePlayStore.GetControllerType(e), [e, t], 0),
u = o.createElement(
"div",
{
className: c,
title: i,
onClick: () => {
t && (t.playerID.steamid === s.Ul.FriendStore.self.steamid64 || l) && s.Ul.RemotePlayStore.TriggerControllerRumble(e);
},
},
o.createElement(Se, { controllerType: m, mobile: null == t ? void 0 : t.bMobile, className: (0, d.Z)(f.Controller, n && f.SlotFilled) }),
o.createElement("div", { className: f.DropSlotNumber, style: { backgroundColor: ct(e) } }, e + 1),
);
return l ? o.createElement(y.G, Object.assign({}, a), u) : u;
}),
xe = (0, a.Pi)(function (e) {
const { index: t, player: n } = e,
i = !!n,
r = (0, k.fJ)(() => s.Ul.RemotePlayStore.GetControllerType(t), [t, n], 0);
return o.createElement("div", { className: (0, d.Z)(f.QuickAccessControllerOrderSlot, i && f.SlotFilled) }, o.createElement("div", { className: f.DropSlotNumber, style: { backgroundColor: ct(t) } }, t + 1), i && o.createElement(Se, { controllerType: r, mobile: null == n ? void 0 : n.bMobile, className: (0, d.Z)(f.Controller, i && f.SlotFilled) }), !i && o.createElement(c.X7U, { none: !0 }));
}),
Ne = (0, a.Pi)(function () {
const { bDragHovered: e, dropTargetProps: t } = (function () {
const [e, t] = (0, o.useState)(!1);
return {
bDragHovered: e,
dropTargetProps: {
rgAcceptedTypes: ["rptcontroller"],
fnDrop: (e) => {
t(!1), Ue(e) && e.controllerID < s.Ul.RemotePlayStore.priority_controller_slot_count && (s.Ul.RemotePlayStore.RemoveControllerFromPrioritySlot(e.controllerID), b.g_FriendsUIDesktopApp.DragDropManager.SetDropConsumed());
},
fnDragEnter: (e) => (Ue(e) ? (e.controllerID < s.Ul.RemotePlayStore.priority_controller_slot_count && t(!0), !0) : (console.error("Drag event received invalid data type."), !1)),
fnDragLeave: () => {
t(!1);
},
},
};
})();
return o.createElement(y.G, Object.assign({}, t), o.createElement("div", { className: (0, d.Z)(f.ControllerClearDropSlot, e && f.DragHovered) }, o.createElement(S.X, { className: f.ClearDropSlotIcon })));
});
function Pe(e) {
(0, o.useRef)();
return {
rgAcceptedTypes: [],
onDragStart: (t) => {
b.g_FriendsUIDesktopApp.DragDropManager.StartDrag({ type: "rptcontroller", controllerID: e }), t.dataTransfer.setDragImage(t.currentTarget, 0, 0);
},
onDragEnd: () => {
b.g_FriendsUIDesktopApp.DragDropManager.EndDrag();
},
draggable: !0,
};
}
function Ue(e) {
return e && "rptcontroller" === e.type;
}
const Ve = (0, a.Pi)(function () {
return o.createElement(Ye, { min: 0, max: 100, onChange: (e) => s.Ul.RemotePlayStore.SetGameVolume(e), value: s.Ul.RemotePlayStore.game_volume, icon: tt, title: (0, h.Xx)("#RemotePlay_GameMasterVolume") });
}),
He =
((0, a.Pi)(function () {
const e = s.Ul.RemotePlayStore.game_volume;
return o.createElement(C, null, o.createElement(l.z2, { min: 0, max: 100, onChange: (e) => s.Ul.RemotePlayStore.SetGameVolume(e), value: s.Ul.RemotePlayStore.game_volume, icon: o.createElement(c.A6J, { flVolume: e / 100 }), label: (0, h.Xx)("#RemotePlay_GameMasterVolume"), layout: "inline" }));
}),
(e) => {
const { title: t, children: n, className: i } = e;
return o.createElement(
"div",
{ className: (0, d.Z)(f.Section, i) },
o.createElement(We, null, t),
o.Children.map(n, (e, t) => o.createElement("div", { className: t > 0 ? f.SectionItemMargin : void 0 }, e)),
);
}),
We = (e) => o.createElement("div", Object.assign({ className: f.SectionTitle }, e)),
Xe = (e) => {
const { title: t, description: n, statusText: i, statusIcon: r, clipboardStatus: a, contextMenu: s, onClick: c, onClickDescription: m, onSecondaryButton: u, onSecondaryActionDescription: p, icon: _, connectURL: g, playerControls: v } = e,
S = (e) => {
s && (0, A.yV)(s, e);
};
return o.createElement(
C,
null,
o.createElement(
l.gN,
{ label: o.createElement("div", { className: (0, d.Z)(f.QuickAccessMediaBoxTitleRow, a && f.Wrap) }, o.createElement("div", { className: f.QuickAccessMediaBoxTitle }, t), r && o.createElement("div", null, r), a && o.createElement("div", { className: f.QuickAccessClipboardStatus }, a)), description: n, icon: o.createElement("div", { className: f.QuickAccessIconContainer }, _), focusable: !0, onClick: S, onOKActionDescription: s ? (0, h.Xx)("#RemotePlay_Options") : null, onContextMenu: S, onMenuButton: S, childrenLayout: "inline", verticalAlignment: "top", onSecondaryButton: u, onSecondaryActionDescription: p, onOptionsButton: c, onOptionsActionDescription: m },
o.createElement("div", { className: f.QuickAccessMediaBoxChildrenContainer }, v && o.createElement("div", { className: f.QuickAccessPlayerControlsContainer }, v), g && o.createElement("div", { className: f.QuickAccessConnectURL }, g), i && o.createElement("div", { className: f.QuickAccessStatusText }, i)),
),
);
},
je = (e) => {
const { title: t, description: n, statusText: i, desktopButtons: r, icon: a, clipboardStatus: s, statusIcon: l, connectURL: c, className: m, onClick: h, contextMenu: u, volumeControls: p, playerControls: _ } = e;
return o.createElement(
Ke,
{
className: (0, d.Z)(f.MediaBox, m),
onClick: h,
interactable: null != h,
onContextMenu: (e) => {
o.Children.count(u) > 0 && (0, A.yV)(u, e);
},
},
o.createElement("div", { className: f.Media }, a),
o.createElement("div", { className: f.Content }, o.createElement("div", { className: f.Top }, o.createElement("div", { className: f.MediaBoxTitle }, o.createElement("div", { className: f.TitleText }, t), i && o.createElement(o.Fragment, null, o.createElement("div", { className: f.TitleStatusDivider }), o.createElement("div", { className: f.TitleStatus }, i)), s && o.createElement(o.Fragment, null, o.createElement("div", { className: f.TitleStatusDivider }), o.createElement("div", { className: f.TitleStatus }, s))), o.createElement("div", { className: f.DesktopButtons }, l, r)), o.createElement("div", { className: f.Bottom }, n && o.createElement("div", { className: f.MediaBoxDescription }, n), _ && o.createElement("div", { className: f.MediaBoxPlayerControls }, _), p && o.createElement("div", { className: f.MediaBoxVolumeControls }, p), c && o.createElement("div", { className: f.LinkContainer, onClick: (e) => e.stopPropagation() }, c))),
);
},
ze = (e) => {
const { quickaccess: t } = e,
n = (0, i._T)(e, ["quickaccess"]);
return t ? o.createElement(Xe, Object.assign({}, n)) : o.createElement(je, Object.assign({}, n));
},
Ke = (e) => {
var { className: t, interactable: n } = e,
r = (0, i._T)(e, ["className", "interactable"]);
return o.createElement("div", Object.assign({ className: (0, d.Z)(t, f.ContentBox, n && f.Interactable) }, r));
};
function qe(e) {
const { children: t, className: n, onClick: i, style: r = "light" } = e;
return o.createElement("div", { className: (0, d.Z)(f.BoxButton, "light" === r ? f.Light : f.Dark, n), onClick: i }, t);
}
const Ze = (0, o.createContext)({ streamHost: null });
function Qe() {
const e = s.Ul.RemotePlayStore;
let { streamHost: t } = (0, o.useContext)(Ze);
return (0, r.SZ)(() => {
var n, i;
if (!t) return { bAmHost: !1, hostPlayer: null, rgPlayers: [] };
const o = { playerID: { steamid: null !== (n = null == t ? void 0 : t.steamid64) && void 0 !== n ? n : "", guestid: 0 }, friend: s.Ul.FriendStore.GetPlayer(null !== (i = null == t ? void 0 : t.accountid) && void 0 !== i ? i : 0), gameID: "0", bSession: !0, bJoined: !0, bMobile: !1, bKeyboardEnabled: !0, bMouseEnabled: !0, bControllerEnabled: !0, nKeyboardUsedTime: 0, nMouseUsedTime: 0, nControllerUsedTime: 0, bGuest: !1 },
r = e.is_host,
a = e.GetAllSessions().filter((e) => r || e.bJoined);
return { bAmHost: r, hostPlayer: o, rgPlayers: a };
});
}
function $e(e = 2e3) {
const [t, n] = (0, o.useState)(!1),
i = (0, o.useRef)(null);
return [
t,
() => {
n(!0), clearTimeout(i.current), (i.current = window.setTimeout(() => n(!1), e));
},
];
}
function Ye(e) {
const { icon: t, onIconClick: n, value: i, onChange: r, min: a, max: s, title: c } = e,
m = t,
h = !!n;
return o.createElement("div", { className: f.SliderControlContainer, title: c }, o.createElement("div", { className: f.SliderIconContainer, onClick: n }, o.createElement(m, { className: (0, d.Z)(f.SliderIcon, h && 0 == i && f.Disabled) })), o.createElement("div", { className: f.SliderContainer }, o.createElement(l.CB, { min: a, max: s, value: i, onChange: r, className: f.Slider })));
}
function Je(e) {
const { className: t, color: n } = e;
return o.createElement("svg", { x: "0px", y: "0px", viewBox: "0 0 720 720", className: t, style: { fill: "currentcolor", color: n } }, o.createElement("g", null, o.createElement("path", { d: "M443.5,118.5H375v179.6c53.16-2.78,102.48-20.26,144-48.41V194C519,152.3,485.2,118.5,443.5,118.5z" }), o.createElement("path", { d: "M345,118.5h-68.5c-41.7,0-75.5,33.8-75.5,75.5v55.69c41.52,28.16,90.84,45.63,144,48.41V118.5z" }), o.createElement("path", { d: "M201,285.4v157.1c0,87.81,71.19,159,159,159h0c87.81,0,159-71.19,159-159V285.4\n\t\t\t\t\tc-47.69,28.1-102.19,43.1-159,43.1C303.19,328.5,248.69,313.5,201,285.4z" })));
}
function et(e) {
const { className: t, color: n } = e;
return o.createElement(
"svg",
{ x: "0px", y: "0px", viewBox: "0 0 720 720", className: t, style: { fill: "currentcolor", color: n } },
o.createElement(
"g",
null,
o.createElement("path", {
d: "M584.73,164.47H121.94c-55.71,0-100.87,45.16-100.87,100.87v146.51c0,55.71,45.16,100.87,100.87,100.87h462.79\n\t\t\t\tc55.71,0,100.87-45.16,100.87-100.87V265.34C685.6,209.63,640.44,164.47,584.73,164.47z M452.42,256.94\n\t\t\t\tc0-18.46,14.97-33.43,33.43-33.43h0c18.46,0,33.43,14.97,33.43,33.43v0c0,18.46-14.97,33.43-33.43,33.43h0\n\t\t\t\tC467.38,290.37,452.42,275.4,452.42,256.94L452.42,256.94z M442.1,305.16c18.46,0,33.43,14.97,33.43,33.43v0\n\t\t\t\tc0,18.46-14.97,33.43-33.43,33.43h0c-18.46,0-33.43-14.97-33.43-33.43v0C408.67,320.13,423.63,305.16,442.1,305.16L442.1,305.16z\n\t\t\t\tM364.92,256.94c0-18.46,14.97-33.43,33.43-33.43h0c18.46,0,33.43,14.97,33.43,33.43v0c0,18.46-14.97,33.43-33.43,33.43h0\n\t\t\t\tC379.88,290.37,364.92,275.4,364.92,256.94L364.92,256.94z M354.45,305.16c18.46,0,33.43,14.97,33.43,33.43v0\n\t\t\t\tc0,18.46-14.97,33.43-33.43,33.43h0c-18.46,0-33.43-14.97-33.43-33.43v0C321.02,320.13,335.99,305.16,354.45,305.16L354.45,305.16z\n\t\t\t\tM277.42,256.94c0-18.46,14.97-33.43,33.43-33.43h0c18.46,0,33.43,14.97,33.43,33.43v0c0,18.46-14.97,33.43-33.43,33.43h0\n\t\t\t\tC292.38,290.37,277.42,275.4,277.42,256.94L277.42,256.94z M266.81,305.16c18.46,0,33.43,14.97,33.43,33.43v0\n\t\t\t\tc0,18.46-14.97,33.43-33.43,33.43h0c-18.46,0-33.43-14.97-33.43-33.43v0C233.38,320.13,248.34,305.16,266.81,305.16L266.81,305.16z\n\t\t\t\tM189.92,256.94c0-18.46,14.97-33.43,33.43-33.43h0c18.46,0,33.43,14.97,33.43,33.43v0c0,18.46-14.97,33.43-33.43,33.43h0\n\t\t\t\tC204.88,290.37,189.92,275.4,189.92,256.94L189.92,256.94z M102.42,256.94c0-18.46,14.97-33.43,33.43-33.43h0\n\t\t\t\tc18.46,0,33.43,14.97,33.43,33.43v0c0,18.46-14.97,33.43-33.43,33.43h0C117.38,290.37,102.42,275.4,102.42,256.94L102.42,256.94z\n\t\t\t\tM166.76,420.25c0,18.46-14.97,33.43-33.43,33.43h0c-18.46,0-33.43-14.97-33.43-33.43v0c0-18.46,14.97-33.43,33.43-33.43h0\n\t\t\t\tC151.79,386.82,166.76,401.78,166.76,420.25L166.76,420.25z M212.59,338.59c0,18.46-14.97,33.43-33.43,33.43h0\n\t\t\t\tc-18.46,0-33.43-14.97-33.43-33.43v0c0-18.46,14.97-33.43,33.43-33.43h0C197.62,305.16,212.59,320.13,212.59,338.59L212.59,338.59z\n\t\t\t\tM498.64,420.25c0,18.46-14.97,33.43-33.43,33.43H250.09c-18.46,0-33.43-14.97-33.43-33.43v0c0-18.46,14.97-33.43,33.43-33.43\n\t\t\t\th215.12C483.67,386.82,498.64,401.78,498.64,420.25L498.64,420.25z M529.74,372.02c-18.46,0-33.43-14.97-33.43-33.43v0\n\t\t\t\tc0-18.46,14.97-33.43,33.43-33.43h0c18.46,0,33.43,14.97,33.43,33.43v0C563.17,357.06,548.21,372.02,529.74,372.02L529.74,372.02z\n\t\t\t\tM606.78,420.25c0,18.46-14.97,33.43-33.43,33.43h0c-18.46,0-33.43-14.97-33.43-33.43v0c0-18.46,14.97-33.43,33.43-33.43h0\n\t\t\t\tC591.81,386.82,606.78,401.78,606.78,420.25L606.78,420.25z M606.78,256.94c0,18.46-14.97,33.43-33.43,33.43h0\n\t\t\t\tc-18.46,0-33.43-14.97-33.43-33.43v0c0-18.46,14.97-33.43,33.43-33.43h0C591.81,223.51,606.78,238.48,606.78,256.94L606.78,256.94z",
}),
),
);
}
function tt(e) {
const { className: t, color: n } = e;
return o.createElement(
"svg",
{ x: "0px", y: "0px", viewBox: "0 0 720 720", className: t, style: { fill: "currentcolor", color: n } },
o.createElement("path", { d: "M189.54,272.79h-64.83c-21.35,0-38.66,17.31-38.66,38.66v97.09c0,21.35,17.31,38.66,38.66,38.66h64.83\n\t\t\t\tl137.79,77.33V195.46L189.54,272.79z" }),
o.createElement(
"g",
null,
o.createElement("path", { d: "M515.5,606.28c-5.35,0-10.69-2.14-14.63-6.36c-7.53-8.08-7.09-20.74,0.99-28.27\n\t\t\t\t\tc58.53-54.56,92.1-131.7,92.1-211.65s-33.57-157.09-92.1-211.65c-8.08-7.53-8.52-20.19-0.99-28.27\n\t\t\t\t\tc7.53-8.08,20.19-8.52,28.27-0.99c32.72,30.5,58.49,66.61,76.58,107.32c18.74,42.16,28.24,87.1,28.24,133.59\n\t\t\t\t\ts-9.5,91.43-28.24,133.59c-18.09,40.71-43.86,76.81-76.58,107.32C525.27,604.5,520.38,606.28,515.5,606.28z" }),
o.createElement("path", { d: "M449.63,538.52c-5.42,0-10.82-2.19-14.76-6.5c-7.46-8.15-6.9-20.8,1.25-28.26\n\t\t\t\t\tc40.26-36.84,63.35-89.24,63.35-143.77c0-54.52-23.09-106.93-63.35-143.77c-8.15-7.46-8.71-20.11-1.25-28.26\n\t\t\t\t\tc7.46-8.15,20.11-8.71,28.26-1.25c23.8,21.78,42.56,47.69,55.76,77c13.66,30.35,20.59,62.75,20.59,96.28\n\t\t\t\t\tc0,33.53-6.93,65.92-20.59,96.28c-13.19,29.31-31.95,55.21-55.76,77C459.29,536.79,454.46,538.52,449.63,538.52z" }),
o.createElement("path", { d: "M383.73,470.72c-5.58,0-11.13-2.32-15.08-6.85c-7.26-8.32-6.4-20.96,1.92-28.22\n\t\t\t\t\tC392.45,416.57,405,388.99,405,360c0-28.99-12.55-56.57-34.42-75.65c-8.32-7.26-9.18-19.9-1.92-28.22\n\t\t\t\t\tc7.26-8.32,19.9-9.19,28.22-1.92C427.46,280.89,445,319.45,445,360c0,40.55-17.54,79.11-48.13,105.79\n\t\t\t\t\tC393.08,469.1,388.4,470.72,383.73,470.72z" }),
),
);
}
function nt(e) {
const { className: t, color: n } = e;
return o.createElement(
"svg",
{ width: "19", height: "19", viewBox: "0 0 19 19", className: t, style: { fill: "currentcolor", color: n } },
o.createElement("path", { d: "M14.8406 11.2028L17.5123 8.53059C19.4614 6.58196 19.4614 3.41057 17.5123 1.46194C15.5635 -0.487315 12.3923 -0.487315 10.4435 1.46194L6.58776 5.31766C4.63871 7.26629 4.63871 10.4377 6.58776 12.3863C6.87553 12.6743 7.1905 12.9184 7.52381 13.1212L9.58797 11.0569C9.19479 10.9628 8.82184 10.7645 8.51573 10.4586C7.62985 9.57268 7.62985 8.13108 8.51573 7.24542L12.3714 3.3897C13.2573 2.50383 14.6989 2.50383 15.5846 3.3897C16.4705 4.27557 16.4705 5.71696 15.5846 6.60283L14.4518 7.73579C14.9186 8.83438 15.0476 10.0426 14.8406 11.2028Z" }),
o.createElement("path", { d: "M4.13369 7.77151L1.46194 10.4435C-0.487315 12.3923 -0.487315 15.5635 1.46194 17.5123C3.41057 19.4614 6.58196 19.4614 8.5308 17.5123L12.3863 13.6566C14.3354 11.7078 14.3351 8.53658 12.3863 6.58795C12.0987 6.29997 11.7838 6.05584 11.4505 5.85303L9.38632 7.91739C9.77929 8.01163 10.1522 8.20959 10.4586 8.51571C11.3444 9.40158 11.3444 10.843 10.4586 11.7288L6.60262 15.5846C5.71675 16.4704 4.27536 16.4704 3.38949 15.5846C2.50361 14.6987 2.50361 13.2573 3.38949 12.3714L4.52244 11.2387C4.05547 10.1401 3.92645 8.93166 4.13369 7.77151Z" }),
);
}
function it(e) {
const { className: t, color: n } = e;
return o.createElement(
"svg",
{ viewBox: "0 0 24 14", className: t, style: { fill: "currentcolor", color: n } },
o.createElement("path", { d: "M4.10365 8.93815C4.15279 8.97501 4.20193 9.00572 4.24494 9.04258C4.20193 9.00572 4.15279 8.96886 4.10365 8.93815Z" }),
o.createElement("path", { d: "M5.52267 10.5845L5.52837 10.5902C5.52267 10.5902 5.52267 10.5845 5.52267 10.5845Z" }),
o.createElement("path", {
d: "M23.5218 9.9886L21.4209 2.00264C21.169 0.608173 19.492 -0.251853 17.6675 0.0737279C16.8443 0.221161 16.1379 0.589744 15.628 1.0689H9.95182C9.44194 0.583601 8.73549 0.221161 7.91233 0.0737279C6.09398 -0.251853 4.41079 0.608173 4.15893 2.00264L3.19447 5.6639C4.93295 6.19834 6.44414 7.26109 7.42703 8.74156L7.43317 8.74771C8.87678 9.27601 10.7381 9.59545 12.7653 9.59545C14.811 9.59545 16.6846 9.26987 18.1344 8.72928L19.2401 10.5783C19.9466 11.6902 20.6837 12.0711 21.7895 11.8684C22.8952 11.6779 23.6692 10.8302 23.5218 9.9886ZM9.56481 5.55947H8.63721V6.48707C8.63721 6.93551 8.27477 7.29795 7.82632 7.29795C7.37788 7.29795 7.01544 6.93551 7.01544 6.48707V5.55947H6.09398C5.64554 5.55947 5.2831 5.19703 5.2831 4.74859C5.2831 4.30014 5.64554 3.9377 6.09398 3.9377H7.02158V3.01625C7.02158 2.5678 7.38402 2.20536 7.83247 2.20536C8.28091 2.20536 8.64335 2.5678 8.64335 3.01625V3.94385H9.57095C10.0194 3.94385 10.3818 4.30629 10.3818 4.75473C10.3757 5.19703 10.0132 5.55947 9.56481 5.55947ZM15.8799 6.54235C15.327 6.54235 14.8724 6.09391 14.8785 5.54104C14.8785 4.98816 15.327 4.53358 15.8799 4.53358C16.4327 4.53358 16.8873 4.98202 16.8873 5.54104C16.8873 6.09391 16.4327 6.54235 15.8799 6.54235ZM17.7781 4.19571C17.2252 4.19571 16.7706 3.74727 16.7706 3.19439C16.7706 2.64152 17.219 2.18694 17.7781 2.18694C18.3309 2.18694 18.7855 2.63538 18.7855 3.19439C18.7855 3.74727 18.3309 4.19571 17.7781 4.19571ZM19.1725 6.88636C18.6197 6.85565 18.1958 6.37649 18.2265 5.82362C18.2572 5.27074 18.7364 4.84687 19.2892 4.87759C19.8421 4.9083 20.266 5.38746 20.2353 5.94034C20.2046 6.49321 19.7315 6.91708 19.1725 6.88636Z",
}),
o.createElement("path", { d: "M1.81836 12.7038C1.77536 12.5933 1.70164 12.4827 1.6095 12.3905C1.51735 12.2984 1.41292 12.2308 1.2962 12.1817C1.2532 12.1633 1.20406 12.1633 1.16105 12.1571C1.08734 12.1387 1.01976 12.1141 0.946047 12.1141C0.866188 12.1141 0.792471 12.1387 0.712611 12.1571C0.66961 12.1694 0.626609 12.1633 0.589751 12.1817C0.516034 12.2124 0.448461 12.2677 0.380887 12.3168C0.350172 12.3414 0.307171 12.3537 0.276455 12.3844C0.18431 12.4765 0.116736 12.581 0.0675918 12.6977C-0.0675552 13.0356 1.83284e-05 13.441 0.276455 13.7174C0.368601 13.8096 0.473033 13.8772 0.589751 13.9263C0.638895 13.9447 0.694182 13.9447 0.743327 13.957C0.8109 13.9693 0.872331 13.9939 0.939904 13.9939C1.17948 13.9939 1.41906 13.9017 1.60335 13.7174C1.6955 13.6253 1.76307 13.5209 1.81222 13.4041C1.91051 13.1891 1.91051 12.9311 1.81836 12.7038Z" }),
o.createElement("path", {
d: "M4.52137 12.4151C4.49065 12.2492 4.44151 12.0834 4.38622 11.9237C4.36165 11.8561 4.34322 11.7885 4.3125 11.7209C4.17121 11.3831 3.98692 11.0698 3.74734 10.7872C3.66749 10.6889 3.58763 10.6029 3.49548 10.5108C3.14533 10.1606 2.73374 9.88417 2.2853 9.69987C2.2423 9.68144 2.19315 9.66916 2.14401 9.65073C1.84914 9.54016 1.54199 9.46644 1.22255 9.43572C1.09969 9.42344 0.976832 9.41729 0.853971 9.41729C0.700395 9.41729 0.552962 9.47872 0.442387 9.5893C0.331812 9.69987 0.276524 9.84731 0.270381 10.0009C0.270381 10.1606 0.331812 10.3019 0.442387 10.4125C0.552962 10.523 0.700395 10.5845 0.853971 10.5845H0.860114C0.958402 10.5845 1.05055 10.6029 1.14884 10.6152C1.22255 10.6213 1.29013 10.6213 1.36384 10.6336C1.46828 10.652 1.56656 10.695 1.66485 10.7258C1.72014 10.7442 1.78157 10.7565 1.843 10.781C1.94129 10.8241 2.03344 10.8793 2.13172 10.9346C2.18087 10.9653 2.23616 10.9838 2.2853 11.0206C2.31602 11.0391 2.34059 11.0698 2.3713 11.0882C2.47573 11.1681 2.58631 11.2479 2.67846 11.3401C2.72146 11.3831 2.75831 11.4384 2.80132 11.4875C3.20676 11.9544 3.43405 12.538 3.43405 13.1584C3.43405 13.3181 3.50162 13.4656 3.60605 13.57C3.61834 13.5823 3.63677 13.5884 3.64906 13.6007C3.69206 13.6376 3.73506 13.6744 3.79035 13.6929C3.80263 13.699 3.81492 13.699 3.8272 13.699C3.88863 13.7236 3.95007 13.7359 4.01764 13.7359C4.07907 13.7359 4.13436 13.7174 4.1835 13.7051C4.20193 13.699 4.22036 13.699 4.23879 13.6929C4.30636 13.6621 4.37394 13.6191 4.42922 13.57C4.5398 13.4594 4.60123 13.3181 4.59509 13.1584C4.59509 12.8943 4.57051 12.6547 4.52137 12.4151Z",
}),
o.createElement("path", {
d: "M7.40247 12.3107C7.36561 12.0281 7.31032 11.7455 7.24275 11.4752C7.11374 10.9592 6.92331 10.4739 6.67759 10.0132C6.08786 8.91358 5.19706 8.0044 4.10974 7.39623C4.07903 7.3778 4.05446 7.35938 4.02374 7.34095C3.69202 7.1628 3.34191 7.01538 2.97948 6.89252C2.94262 6.88023 2.9119 6.86795 2.87504 6.85566C2.86276 6.84952 2.85661 6.84952 2.84433 6.84338C2.50646 6.73894 2.16245 6.66523 1.80615 6.61608C1.72629 6.6038 1.65258 6.58537 1.57272 6.57922C1.49286 6.57308 1.40686 6.57308 1.32085 6.56694C1.17956 6.5608 1.04442 6.54851 0.903126 6.54851C0.817124 6.54851 0.731121 6.56694 0.651261 6.59765C0.595974 6.62223 0.540687 6.65294 0.491542 6.69594C0.393254 6.7758 0.32568 6.88023 0.282679 7.00309C0.26425 7.06453 0.251964 7.12596 0.251964 7.19353C0.251964 7.28567 0.270393 7.36553 0.301108 7.44539C0.313394 7.46997 0.331823 7.49454 0.350252 7.51911C0.380968 7.56825 0.40554 7.6174 0.442398 7.65426C0.460827 7.67269 0.491542 7.68497 0.516114 7.7034C0.559116 7.73412 0.602117 7.77098 0.651261 7.79555C0.675834 7.80783 0.706549 7.80783 0.737264 7.81398C0.792552 7.82626 0.841696 7.84469 0.903126 7.84469C1.26557 7.84469 1.61572 7.88155 1.95973 7.94912C2.02116 7.96141 2.08259 7.97984 2.14402 7.99827C2.2546 8.02284 2.35903 8.04741 2.46346 8.07813C2.49417 8.08427 2.51875 8.09656 2.54332 8.10884C2.57403 8.12113 2.60475 8.13342 2.63546 8.1457C2.7399 8.18256 2.83819 8.21327 2.94262 8.25628C3.02248 8.29313 3.09619 8.32999 3.17605 8.36685C3.24977 8.40371 3.32963 8.43442 3.40335 8.47743C3.47706 8.52043 3.54464 8.56343 3.61835 8.60643C3.69207 8.64943 3.76578 8.69243 3.83336 8.74158C3.9255 8.80301 4.01151 8.87058 4.09751 8.93815C4.14665 8.97501 4.1958 9.00573 4.2388 9.04259C4.75482 9.46646 5.19097 9.99476 5.51041 10.5845L5.51655 10.5906C5.63327 10.7995 5.72542 11.0268 5.81142 11.2541C5.88514 11.4445 5.94657 11.6411 5.99571 11.8438C6.04485 12.0465 6.08171 12.2493 6.10628 12.4643C6.13086 12.6731 6.14929 12.882 6.14929 13.097C6.14929 13.2751 6.223 13.4349 6.33972 13.5516C6.45644 13.6683 6.61616 13.742 6.80045 13.742C6.88645 13.742 6.97245 13.7236 7.05231 13.6929C7.20589 13.6253 7.32875 13.5024 7.39632 13.3489C7.42704 13.269 7.44547 13.1891 7.44547 13.097C7.45161 12.8267 7.43318 12.5687 7.40247 12.3107Z",
}),
);
}
function ot(e) {
const { className: t } = e;
return o.createElement("svg", { width: "16", height: "16", viewBox: "0 0 23 24", fill: "none", className: t }, o.createElement("circle", { cx: "11.3115", cy: "12.247", r: "11.3115", fill: "#FFC82C" }), o.createElement("path", { d: "M9.61534 5.7H13.0733L12.5223 14.649H10.1473L9.61534 5.7ZM11.3253 15.96C11.8067 15.96 12.193 16.1057 12.4843 16.397C12.7883 16.6883 12.9403 17.081 12.9403 17.575C12.9403 18.069 12.7883 18.468 12.4843 18.772C12.193 19.076 11.8067 19.228 11.3253 19.228C10.8567 19.228 10.4767 19.076 10.1853 18.772C9.89401 18.468 9.74834 18.069 9.74834 17.575C9.74834 17.081 9.88768 16.6883 10.1663 16.397C10.4577 16.1057 10.844 15.96 11.3253 15.96Z", fill: "#1E2834" }));
}
function rt() {
return o.createElement(S.MrB, { className: f.IconMobile });
}
function at(e) {
const { className: t, quality: n = 4 } = e;
return o.createElement("svg", { width: "64", height: "64", viewBox: "0 0 64 64", fill: "none", className: (0, d.Z)(t, f[`BitRateQuality_${n}`]) }, o.createElement("g", null, o.createElement("rect", { x: "0", y: "49", width: "13", height: "15", fill: "currentColor" }), o.createElement("rect", { x: "18.5", y: "36", width: "10", height: "26.5", fill: n >= 2 ? "currentColor" : "transparent", strokeWidth: "3", stroke: "currentColor" }), o.createElement("rect", { x: "35.5", y: "22", width: "10", height: "40.5", fill: n >= 3 ? "currentColor" : "transparent", strokeWidth: "3", stroke: "currentColor" }), o.createElement("rect", { x: "52.5", y: "1.5", width: "10", height: "61", fill: 4 == n ? "currentColor" : "transparent", strokeWidth: "3", stroke: "currentColor" })));
}
function st(e) {
return e > 200 ? 1 : e > 66 ? 2 : e > 33 ? 3 : 4;
}
const lt = { 0: "#0056D6", 1: "#236C39", 2: "#B72828", 3: "#D0722D" };
function ct(e) {
return lt[e];
}
function mt(e, t) {
const n = s.Ul.RemotePlayStore.GetPlayerInControllerSlot(e);
let i = n ? s.Ul.RemotePlayStore.GetSessionForPlayer(n) : void 0;
return !i && n && t && n.steamid === t.playerID.steamid && (i = t), i;
}
function dt() {
const { hostPlayer: e, rgPlayers: t } = Qe(),
n = new Map(),
i = (function () {
const [e, t] = o.useState([]);
return o.useEffect(() => ((0, H.U5)("Input.RegisterForControllerListChanges") ? SteamClient.Input.RegisterForControllerListChanges(t).unregister : () => {}), []), e;
})();
for (const e of i) {
const t = e.nXInputIndex;
n.has(t) || n.set(t, { nSlot: t }), (n.get(t).details = e);
}
const r = [e, ...t];
for (const e of r) {
const t = s.Ul.RemotePlayStore.GetControllerSlotsForPlayer(e.playerID);
for (const i of t) n.has(i) || n.set(i, { nSlot: i }), (n.get(i).player = e);
}
const a = Array.from(n.values()),
l = o.useRef([]);
return !a.some((e) => null == e.details || null == e.player) && (l.current = a), l.current;
}
function ht(e) {
return { nSlot: e.nSlot, details: null == e.details ? void 0 : Object.assign({}, e.details), player: null == e.player ? void 0 : Object.assign({}, e.player) };
}
const ut = (0, a.Pi)(function (e) {
var t, n, i, r, a;
const l = dt(),
[m, d] = (0, k.rA)(l, null, 400);
let u = null;
const p = [];
for (let e = 0; e < s.Ul.RemotePlayStore.priority_controller_slot_count; e++) m.find((t) => t.nSlot == e) || (null === u && (u = e), p.push({ label: (0, h.Xx)("#RemotePlay_ControllerSlot_Empty"), icon: o.createElement(c.X7U, { none: !0 }), key: `empty-${e}`, index: e, displayedIndex: e + 1, indexColor: ct(e), disabled: !0 }));
for (const e of m) {
const l = e.nSlot >= s.Ul.RemotePlayStore.priority_controller_slot_count,
c = (null === (t = e.player) || void 0 === t ? void 0 : t.bGuest) ? (0, I.U0)(null === (n = e.player) || void 0 === n ? void 0 : n.strAvatarHash, "full") : null === (r = null === (i = e.player) || void 0 === i ? void 0 : i.friend) || void 0 === r ? void 0 : r.persona.avatar_url_full,
d = 4 != e.details.eControllerType,
_ = !l && m.length > 1,
g = l && null !== u;
let C, v;
_ ? ((C = () => s.Ul.RemotePlayStore.RemoveControllerFromPrioritySlot(e.nSlot)), (v = (0, h.Xx)("#RemotePlay_DeactivateController"))) : g && ((C = () => s.Ul.RemotePlayStore.SwapControllerSlots(e.nSlot, u, !1)), (v = (0, h.Xx)("#RemotePlay_ReactivateController"))),
p.push({ label: o.createElement(o.Fragment, null, o.createElement("div", { className: f.ReorderLabelName }, te(e.player)), c && o.createElement(Le, { src: c, className: f.ReorderLabelPersonaAvatar })), icon: o.createElement(Se, { controllerType: e.details.eControllerType, mobile: null === (a = e.player) || void 0 === a ? void 0 : a.bMobile }), key: e.details.nControllerIndex.toString(), index: e.nSlot, displayedIndex: e.details.nXInputIndex + 1, indexColor: l ? void 0 : ct(e.details.nXInputIndex), sectionName: l ? "inactive" : void 0, onOptionsButton: d ? () => s.Ul.RemotePlayStore.TriggerControllerRumble(e.nSlot) : void 0, onOptionsActionDescription: d ? (0, h.Xx)("#RemotePlay_IdentifyController") : void 0, onSecondaryButton: C, onSecondaryActionDescription: v });
}
p.sort((e, t) => e.index - t.index);
return o.createElement(V, {
title: (0, h.Xx)("#RemotePlay_ControllerOrder"),
items: p,
sections: [{ name: "inactive", label: (0, h.Xx)("#RemotePlay_InactiveControllers") }],
onMoveRelative: (e, t) => {
const n = e + t,
i = s.Ul.RemotePlayStore.SwapControllerSlots(e, n, !1);
return (
i &&
d(
(function (e, t, n) {
const i = e.map(ht),
o = i.find((e) => e.nSlot == t),
r = i.find((e) => e.nSlot == n);
if (o && r) {
const e = o.nSlot;
(o.nSlot = r.nSlot), (r.nSlot = e);
} else o && (o.nSlot = n);
return (null == o ? void 0 : o.details) && (o.details.nXInputIndex = o.nSlot), (null == r ? void 0 : r.details) && (r.details.nXInputIndex = r.nSlot), i;
})(m, e, n),
),
i
);
},
closeModal: e.closeModal,
});
});
function pt(e) {
return o.createElement(Ze.Provider, { value: e.context }, o.createElement(E.fI, Object.assign({}, e.configContext), e.children(e.closeModal)));
}
function _t(e) {
const [t, n] = o.useState([]);
return o.createElement(
m.e1,
{ onEscKeypress: e.closeModal },
o.createElement(
l.oX,
{
onSubmit: () => {
for (const n of t) {
if (s.Ul.FriendStore.self === n) return;
s.Ul.RemotePlayStore.CreateInviteAndSession(n.accountid, s.Ul.FriendStore.self.persona.m_gameid, e.browserContext);
}
e.closeModal && e.closeModal();
},
className: "friendsui-container",
},
o.createElement(l.h4, null, (0, h.Xx)("#RemotePlay_InviteFriend_Verbose")),
o.createElement(l.uT, null, o.createElement(W.B, { label: (0, h.Xx)("#RemotePlay_FriendsToInvite"), eSort: 2, rgPickedFriends: t, onChange: n, autoFocus: !0 })),
o.createElement(l.$_, null, o.createElement(l.o9, { onCancel: e.closeModal })),
),
);
}
function gt(e, t, n) {
return (0, i.mG)(this, void 0, void 0, function* () {
n = null != n ? n : window;
const i = (0, b.rb)(n),
r = "addfriend";
if (!s.Ul.RemotePlayStore.BDialogOpenInContext(i, r)) {
const a = o.createElement(pt, { context: e, configContext: t }, (e) => o.createElement(_t, { closeModal: e, browserContext: i })),
l = () => {
s.Ul.RemotePlayStore.DialogClosed(i, r);
},
c = s.Ul.IsGamepadUIActive() ? void 0 : 664,
d = s.Ul.IsGamepadUIActive() ? void 0 : 580,
u = yield (0, m.AM)(a, n, { fnOnClose: l, popupWidth: c, popupHeight: d, strTitle: (0, h.Xx)("#RemotePlay_InviteFriend_Verbose"), bHideMainWindowForPopouts: !1, browserContext: i });
s.Ul.RemotePlayStore.DialogOpened(i, () => u.Close(), r);
}
});
}
},
7098: (e, t, n) => {
"use strict";
n.d(t, { L: () => E });
var i = n(85556),
o = n(72746),
r = n(37234),
a = n(19953),
s = n(68816),
l = n(27378),
c = n(50649),
m = n(97224),
d = n(2049),
h = n(84290),
u = n(11259),
p = n(38461),
_ = n(46057),
g = n(16518),
C = n(43965),
f = n.n(C),
v = n(87018);
let S = class extends l.Component {
constructor(e) {
super(e), (this.m_rgMicOptions = [{ label: "Default", data: "default" }]), (this.m_rgOutputOptions = [{ label: "Default", data: "default" }]), (this.state = { showAdvanced: !1, micOptionsReady: !1, outputOptionsReady: !1, hotkeyCapturing: !1 }), navigator.mediaDevices.enumerateDevices().then(this.gotMediaDevices).catch(this.gotMediaDevicesError);
}
gotMediaDevices(e) {
for (let t = 0; t < e.length; ++t) {
let n = e[t];
if ("audioinput" == n.kind) {
if ("default" != n.deviceId) {
let e = n.label;
"communications" == n.deviceId && (e = (0, h.Xx)("#Voice_DefaultCommunicationsDefault")), this.m_rgMicOptions.push({ label: e, data: n.deviceId });
}
} else if ("audiooutput" == n.kind && "default" != n.deviceId) {
let e = n.label;
"communications" == n.deviceId && (e = (0, h.Xx)("#Voice_DefaultCommunicationsDefault")), this.m_rgOutputOptions.push({ label: e, data: n.deviceId });
}
}
this.setState({ micOptionsReady: !0 }), this.setState({ outputOptionsReady: !0 });
}
gotMediaDevicesError() {
this.setState({ micOptionsReady: !0 }), this.setState({ outputOptionsReady: !0 });
}
onSubmit() {
return !1;
}
VoiceSettingsRefMarker(e) {
e && e.ownerDocument && ((this.m_elVoiceSettingsMarkerScroll = e), (this.m_window = e.ownerDocument.defaultView));
}
OnShowAdvancedSettings() {
this.setState({ showAdvanced: !this.state.showAdvanced }),
(this.m_iTimeOutVoiceSettingsScroll = this.m_window.setTimeout(() => {
this.m_elVoiceSettingsMarkerScroll && this.state.showAdvanced && this.m_elVoiceSettingsMarkerScroll.scrollIntoView({ behavior: "smooth" }), this.m_window.clearTimeout(this.m_iTimeOutVoiceSettingsScroll);
}, 200));
}
OnMicDropdownChanged(e) {
this.props.voiceStore.SetSelectedMic(e.data);
}
OnOutputDeviceDropdownChanged(e) {
this.props.voiceStore.SetSelectedOutput(e.data);
}
OnInputGainChanged(e) {
this.props.voiceStore.SetVoiceInputGain(this.props.voiceStore.ConvertSliderToGainValue(e, p.Ys.k_MaxInputOutputGainValue));
}
OnOutputGainChanged(e) {
this.props.voiceStore.SetVoiceOutputGain(this.props.voiceStore.ConvertSliderToGainValue(e, p.Ys.k_MaxInputOutputGainValue));
}
SetHotKeyCaptureState(e) {
0 == e ? (null != SteamClient.WebChat && null != SteamClient.WebChat.UnregisterForMouseXButtonDown && SteamClient.WebChat.UnregisterForMouseXButtonDown(), this.setState({ hotkeyCapturing: !1 })) : (this.setState({ hotkeyCapturing: !0 }), null != SteamClient.WebChat && null != SteamClient.WebChat.RegisterForMouseXButtonDown && SteamClient.WebChat.RegisterForMouseXButtonDown(this.OnXButtonDown));
}
OnXButtonDown(e) {
e > 0 && this.state.hotkeyCapturing && (null != SteamClient.WebChat && null != SteamClient.WebChat.SetPushToTalkMouseButton && (SteamClient.WebChat.SetPushToTalkMouseButton(e), o.Ul.VoiceStore.RefreshPushToTalkKeySettings()), this.SetHotKeyCaptureState(!1));
}
OnTogglePushToTalk() {
if ("undefined" != typeof SteamClient && null != SteamClient.WebChat && null != SteamClient.WebChat.SetPushToTalkEnabled) {
let e = o.Ul.VoiceStore.GetPushToTalkEnabled();
SteamClient.WebChat.SetPushToTalkEnabled(!e), o.Ul.VoiceStore.SetPushToTalkEnabled(!e);
}
}
AssignHotkey() {
0 == this.state.hotkeyCapturing && this.SetHotKeyCaptureState(!0);
}
ClearHotKey() {
"undefined" != typeof SteamClient && null != SteamClient.WebChat && null != SteamClient.WebChat.SetPushToTalkHotKey && (SteamClient.WebChat.SetPushToTalkHotKey(0), o.Ul.VoiceStore.RefreshPushToTalkKeySettings());
}
OnTransmissionTypeChange(e) {
if ("undefined" != typeof SteamClient && SteamClient.WebChat)
if ("pushtomute" === e) SteamClient.WebChat.SetPushToMuteEnabled && (SteamClient.WebChat.SetPushToMuteEnabled(!0), o.Ul.VoiceStore.SetPushToMuteEnabled(!0));
else if ("openmic" === e || "pushtotalk" === e) {
const t = "pushtotalk" === e;
SteamClient.WebChat.SetPushToTalkEnabled && (SteamClient.WebChat.SetPushToTalkEnabled(t), o.Ul.VoiceStore.SetPushToTalkEnabled(t));
}
}
onMouseDown(e) {
0 != this.state.hotkeyCapturing && 0 != e.button && this.onClick(e);
}
onClick(e) {
0 != this.state.hotkeyCapturing && (null != SteamClient.WebChat && null != SteamClient.WebChat.SetPushToTalkMouseButton && (SteamClient.WebChat.SetPushToTalkMouseButton(e.button), o.Ul.VoiceStore.RefreshPushToTalkKeySettings()), this.SetHotKeyCaptureState(!1), e.preventDefault(), e.stopPropagation());
}
onContextMenu(e) {
e.preventDefault(), e.stopPropagation();
}
onKeyDown(e) {
0 != this.state.hotkeyCapturing && (null != SteamClient.WebChat && null != SteamClient.WebChat.SetPushToTalkHotKey && (SteamClient.WebChat.SetPushToTalkHotKey(e.keyCode), o.Ul.VoiceStore.RefreshPushToTalkKeySettings()), this.SetHotKeyCaptureState(!1), e.preventDefault(), e.stopPropagation());
}
OnPPTSoundChecked(e) {
o.Ul.VoiceStore.SetPushToTalkOrMuteSoundsEnabled(e);
}
componentWillUnmount() {
o.Ul.VoiceStore.IsLocalMicTestActive() && o.Ul.VoiceStore.EndLocalMicTest();
}
OnStartLocalMicTest() {
o.Ul.VoiceStore.InitiateLocalMicTest();
}
OnStopLocalMicTest() {
o.Ul.VoiceStore.EndLocalMicTest();
}
render() {
let e = o.Ul.VoiceStore.GetPushToTalkEnabled(),
t = o.Ul.VoiceStore.GetPushToMuteEnabled(),
n = !1,
i = o.Ul.VoiceStore.GetPushToTalkHotKeyDisplayString(),
r = (0, h.Xx)("#VoicePushToTalkAssigned"),
a = (0, h.Xx)("#VoicePushToMuteAssigned"),
s = (0, h.Xx)("#VoiceMuteToggleAssigned"),
c = o.Ul.VoiceStore.GetPushToTalkOrMuteSoundsEnabled(),
m = (o.Ul.SettingsStore.BClientHasFeatureOrOnWeb("NewVoiceHotKeyState"), o.Ul.VoiceStore.IsLocalMicTestActive()),
d = o.Ul.FriendStore.self;
"undefined" != typeof SteamClient && null != SteamClient.WebChat && null != SteamClient.WebChat.GetPushToTalkEnabled && (n = !0), this.state.hotkeyCapturing && (r = (0, h.Xx)("#VoicePushToTalkPressHotKey"));
const C = t ? "pushtomute" : e ? "pushtotalk" : "openmic";
return l.createElement(
u.l0,
{ className: (0, v.Z)("DialogBody", "VoiceSettings", f().VoiceSettings), onContextMenu: this.onContextMenu, onSubmit: this.onSubmit, onMouseDown: this.onMouseDown, onClick: this.onClick, onKeyDown: this.onKeyDown },
l.createElement(
"div",
{ className: "_FixedHeight" },
l.createElement("div", { className: "voiceSelfHeader" }, l.createElement("div", { className: "DialogLabel" }, (0, h.Xx)("#VoiceSetupHeader")), l.createElement("div", { className: "voiceMicTestContainer" }, l.createElement("div", { className: "voiceSelfDirections", title: (0, h.Xx)("#VoiceWhenMicIsWorking") }, l.createElement(_.mo, { friend: d, key: d.accountid, showVoiceLevel: !0, context: void 0, noActions: !0, listStatusIndicator: l.createElement("div", { className: "connectionSpinner" }) }), l.createElement(u.zx, { className: "LocalMicTestButton " + (m ? "Primary" : "Off"), onClick: m ? this.OnStopLocalMicTest : this.OnStartLocalMicTest }, m ? (0, h.Xx)("#VoiceStopLocalMicTest") : (0, h.Xx)("#VoiceStartLocalMicTest"))))),
this.state.micOptionsReady && l.createElement(u.ry, { strClassName: "InputDevice", label: (0, h.Xx)("#VoiceDevice"), rgOptions: this.m_rgMicOptions, strDefaultLabel: (0, h.Xx)("#DefaultMic"), selectedOption: this.props.voiceStore.GetSelectedMic(), onChange: this.OnMicDropdownChanged }),
!this.state.micOptionsReady && l.createElement(u.ry, { label: (0, h.Xx)("#VoiceDevice"), rgOptions: this.m_rgMicOptions, strDefaultLabel: (0, h.Xx)("#MicLoading...") }),
this.state.outputOptionsReady && l.createElement(u.ry, { label: (0, h.Xx)("#VoiceOutputDevice"), rgOptions: this.m_rgOutputOptions, strDefaultLabel: (0, h.Xx)("#DefaultOutputDevice"), selectedOption: this.props.voiceStore.GetSelectedOutputDevice(), onChange: this.OnOutputDeviceDropdownChanged }),
!this.state.outputOptionsReady && l.createElement(u.ry, { label: (0, h.Xx)("#VoiceOutputDevice"), rgOptions: this.m_rgOutputOptions, strDefaultLabel: (0, h.Xx)("#OutputDeviceLoading...") }),
l.createElement(u.__, null, (0, h.Xx)("#VoiceVolume")),
l.createElement(u.Uq, { className: "DialogLabelStrong" }, l.createElement(u.DS, { min: 0, max: 100, label: (0, h.Xx)("#VoiceInputGain"), description: (0, h.Xx)("#VoiceInputGainExplainer"), value: this.props.voiceStore.ConvertGainValueToSliderValue(this.props.voiceStore.GetVoiceInputGain(), p.Ys.k_MaxInputOutputGainValue), onChange: this.OnInputGainChanged }), l.createElement(u.DS, { min: 0, max: 100, label: (0, h.Xx)("#VoiceOutputGain"), description: (0, h.Xx)("#VoiceOutputGainExplainer"), value: this.props.voiceStore.ConvertGainValueToSliderValue(this.props.voiceStore.GetVoiceOutputGain(), p.Ys.k_MaxInputOutputGainValue), onChange: this.OnOutputGainChanged })),
"undefined" != typeof SteamClient && null != SteamClient.WebChat && null != SteamClient.WebChat.SetPushToMuteEnabled
? l.createElement(
"div",
{ className: "_DialogSection pushToTalkSection" + (n ? "" : " disabled") },
l.createElement(u.__, null, (0, h.Xx)("#VoiceTransmissionType_Label"), !n && l.createElement("span", { className: "disabledNotice" }, " (", (0, h.Xx)("#VoiceTransmissionType_Disabled"), ") ")),
l.createElement(
"div",
{ className: f().TransmissionTypeSettings },
l.createElement(u.SY, { value: C, onChange: this.OnTransmissionTypeChange }, l.createElement(u.EU, { value: "openmic" }, (0, h.Xx)("#VoiceTransmissionType_OpenMic")), l.createElement(u.EU, { value: "pushtotalk" }, (0, h.Xx)("#VoiceTransmissionType_PushToTalk")), l.createElement(u.EU, { value: "pushtomute" }, (0, h.Xx)("#VoiceTransmissionType_PushToMute"))),
l.createElement("div", { className: f().HotkeySettingRow }, l.createElement("div", { className: f().HotkeySettingDescription }, e ? r : t ? a : s), l.createElement(u.zx, { disabled: !n, className: (0, v.Z)(f().HotkeyButton, this.state.hotkeyCapturing && f().Capturing), onClick: this.AssignHotkey }, i), !e && !t && l.createElement(u.zx, { className: f().HotkeyClearButton, onClick: this.ClearHotKey, title: (0, h.Xx)("#VoiceClearHotKeyTooltip") }, l.createElement(g.pVO, null))),
l.createElement("div", { className: f().HotkeySettingRow }, l.createElement("span", { className: f().HotkeySettingDescription }, (0, h.Xx)("#VoicePushToSomethingSoundOption")), l.createElement(u.hp, { value: c, onChange: (e) => this.OnPPTSoundChecked(e) })),
),
)
: l.createElement("div", { className: "_DialogSection pushToTalkSection" + (n ? "" : " disabled") }, l.createElement(u.__, null, (0, h.Xx)("#VoiceTransmissionType"), !n && l.createElement("span", { className: "disabledNotice" }, " (", (0, h.Xx)("#g_DisabledOnWeb"), ") ")), l.createElement(u.nf, { disabled: !n, label: (0, h.Xx)("#VoiceTransmissionTypeExplainer"), value: e, onChange: this.OnTogglePushToTalk }), e && l.createElement("div", { className: "pushtoTalkKeyAssignContainer displayRow" }, l.createElement(u.__, { className: "DialogLabelExplainer" }, r), l.createElement(u.zx, { disabled: !n, className: this.state.hotkeyCapturing && "capturingKey", onClick: this.AssignHotkey }, i))),
l.createElement(b, { voiceStore: this.props.voiceStore }),
l.createElement(u.zx, { className: (0, v.Z)("advancedSettingsButton", f().AdvancedSettingsButton), onClick: this.OnShowAdvancedSettings }, this.state.showAdvanced ? (0, h.Xx)("#VoiceHideAdvancedSettings") : (0, h.Xx)("#VoiceShowAdvancedSettings"), l.createElement(g.$gZ, null)),
l.createElement(I, { voiceStore: this.props.voiceStore, visible: this.state.showAdvanced }),
l.createElement("div", { className: "scrollToRef", ref: this.VoiceSettingsRefMarker }),
),
);
}
};
(0, i.gn)([d.ak], S.prototype, "gotMediaDevices", null),
(0, i.gn)([d.ak], S.prototype, "gotMediaDevicesError", null),
(0, i.gn)([d.ak], S.prototype, "onSubmit", null),
(0, i.gn)([d.ak], S.prototype, "VoiceSettingsRefMarker", null),
(0, i.gn)([d.ak], S.prototype, "OnShowAdvancedSettings", null),
(0, i.gn)([d.ak], S.prototype, "OnMicDropdownChanged", null),
(0, i.gn)([d.ak], S.prototype, "OnOutputDeviceDropdownChanged", null),
(0, i.gn)([d.ak], S.prototype, "OnInputGainChanged", null),
(0, i.gn)([d.ak], S.prototype, "OnOutputGainChanged", null),
(0, i.gn)([d.ak], S.prototype, "OnXButtonDown", null),
(0, i.gn)([d.ak], S.prototype, "OnTogglePushToTalk", null),
(0, i.gn)([d.ak], S.prototype, "AssignHotkey", null),
(0, i.gn)([d.ak], S.prototype, "ClearHotKey", null),
(0, i.gn)([d.ak], S.prototype, "OnTransmissionTypeChange", null),
(0, i.gn)([d.ak], S.prototype, "onMouseDown", null),
(0, i.gn)([d.ak], S.prototype, "onClick", null),
(0, i.gn)([d.ak], S.prototype, "onContextMenu", null),
(0, i.gn)([d.ak], S.prototype, "onKeyDown", null),
(0, i.gn)([d.ak], S.prototype, "OnPPTSoundChecked", null),
(0, i.gn)([d.ak], S.prototype, "OnStartLocalMicTest", null),
(0, i.gn)([d.ak], S.prototype, "OnStopLocalMicTest", null),
(S = (0, i.gn)([c.Pi], S));
const b = (0, c.Pi)((e) => {
const { voiceStore: t } = e,
n = t.GetUseNoiseGateLevel(),
i = n === p.S7.k_ENoiseGateLevel_Low ? p.S7.k_ENoiseGateLevel_Off : n;
return l.createElement("div", { className: "_DialogSection" }, l.createElement(u.__, null, (0, h.Xx)("#VoiceTransmisionThreshold")), l.createElement(u.__, { className: "DialogLabelStrong" }, (0, h.Xx)("#VoiceTransmissionThresholdExplainer")), l.createElement(u.SY, { value: i, onChange: (e) => t.SetUseNoiseGateLevel(e) }, l.createElement(u.EU, { value: p.S7.k_ENoiseGateLevel_Off }, (0, h.Xx)("#VoiceTransmissionThresholdOff")), l.createElement(u.EU, { value: p.S7.k_ENoiseGateLevel_Medium }, (0, h.Xx)("#VoiceTransmissionThresholdMedium"), l.createElement("span", { className: f().RecommendedNote }, (0, h.Xx)("#VoiceTransmissionThresholdRecommended"))), l.createElement(u.EU, { value: p.S7.k_ENoiseGateLevel_High }, (0, h.Xx)("#VoiceTransmissionThresholdHigh"))));
});
const I = (0, c.Pi)((e) => {
const { voiceStore: t, visible: n } = e;
return l.createElement(
"div",
{ className: "advancedSettings" + (n ? " showAdvanced" : "") },
l.createElement(u.__, null, (0, h.Xx)("#VoiceAdvancedSettings")),
l.createElement(u.__, { className: "DialogLabelExplainer Left" }, (0, h.Xx)("#VoiceAdvancedSettingsExplainer")),
l.createElement(u.nf, { className: f().ToggleRow, label: (0, h.Xx)("#VoiceEchoCancellation"), value: t.GetUseEchoCancellation(), onChange: (e) => t.SetUseEchoCancellation(e) }),
l.createElement(u.nf, { className: f().ToggleRow, label: (0, h.Xx)("#VoiceNoiseCancellation"), value: t.GetUseNoiseCancellation(), onChange: (e) => t.SetUseNoiseCancellation(e) }),
l.createElement(u.nf, { className: f().ToggleRow, label: (0, h.Xx)("#VoiceAutoGainControl"), value: t.GetUseAutoGainControl(), onChange: (e) => t.SetUseAutoGainControl(e) }),
l.createElement(
u.zx,
{
className: "copyVoiceLogsButton",
onClick: () =>
(function (e) {
const t = e.GetVoiceLogs(),
n = document.createElement("textarea");
(n.textContent = t), (n.style.position = "fixed"), document.body.appendChild(n), n.select();
try {
document.execCommand("copy");
} catch (e) {
console.warn("Copy voice logs to clipboard failed.", e);
} finally {
document.body.removeChild(n);
}
})(t),
},
(0, h.Xx)("#CopyVoiceChatLogs"),
),
);
});
var y = n(85516);
function E(e, t, n) {
(0, s.BR)(l.createElement(D, { browserContext: e, startingPage: n }), t, (0, h.Xx)("#FriendSettings_Title"), { strTitle: (0, h.Xx)("#FriendSettings_Title"), popupWidth: 842, popupHeight: 720 }, (0, r.Og)(t));
}
let D = class extends l.Component {
constructor(e) {
super(e, (0, h.Xx)("#Settings"));
}
SaveFriendSettings(e, t) {
o.Ul.SettingsStore.BUpdateFriendsSettings(e), o.Ul.SettingsStore.SetCommunityPreferences(t);
}
render() {
let e = o.Ul.UIStore.GetPerContextChatData(this.props.browserContext),
t = { friendsSettingsInitial: o.Ul.SettingsStore.FriendsSettings, communityPreferencesInitial: o.Ul.SettingsStore.CommunityPreferences, onCancel: this.props.closeModal, onSubmit: this.SaveFriendSettings, bShowClientOpts: a.De.IN_CLIENT, bShowPopupOpts: e.BUsePopups(), bShowGroupOpts: !0, bSubmitImmediate: !0, bDoNotDisturbSupported: a.De.IN_CLIENT && o.Ul.SettingsStore.BClientHasFeatureOrOnWeb("DoNotDisturb") },
n = {
title: (0, h.Xx)("#FriendSettings_Title"),
className: "FriendSettingsContainer",
pages: [
{ title: (0, h.Xx)("#FriendSettings_Friends"), identifier: "friends", content: l.createElement(m.a$, Object.assign({}, t)) },
{ title: (0, h.Xx)("#FriendSettings_Chat"), identifier: "chat", content: l.createElement(m.UD, Object.assign({}, t)) },
{ title: (0, h.Xx)("#FriendSettings_SizeAndScaling"), identifier: "sizeAndScaling", content: l.createElement(m.fR, Object.assign({}, t)) },
{ title: (0, h.Xx)("#FriendSettings_Notifications"), identifier: "notifications", content: l.createElement(w, Object.assign({}, t)) },
{ title: (0, h.Xx)("#FriendSettings_Voice"), identifier: "voice", content: l.createElement(S, { onCancel: this.props.closeModal, voiceStore: o.Ul.ChatStore.VoiceChat }) },
],
startingPage: this.props.startingPage,
};
return l.createElement(s.e1, { onEscKeypress: this.props.closeModal }, l.createElement(u.TI, Object.assign({}, n)));
}
};
D = (0, i.gn)([c.Pi], D);
let w = class extends m.gy {
constructor(e) {
super(e), (this.m_rgOptions = (0, y.nP)(!1));
}
FriendsSettingsNotificationRow(e) {
let t = this.FriendsSettingsCheckbox;
return l.createElement("div", null, l.createElement("div", { className: "FriendsSettingsNotificationRow" }, l.createElement("div", { className: "FriendsSettingsNotificationRow_Label" }, e.strLabel), l.createElement("div", { className: "FriendsSettingsNotificationRow_Checkbox" }, l.createElement(t, { strName: e.strNameShow })), l.createElement("div", { className: "FriendsSettingsNotificationRow_Checkbox" }, l.createElement(t, { strName: e.strNameSound }))));
}
render() {
let e = this.state.friendSettings,
t = this.FriendsSettingsNotificationRow;
return l.createElement(
u.l0,
{ className: "DialogBody", onSubmit: this.OnSubmit },
l.createElement(
"div",
{ className: "SettingsGroup" },
l.createElement("div", { className: "FriendsSettingsNotificationRow FriendsSettingsNotificationRow_Header" }, l.createElement("div", { className: "FriendsSettingsNotificationRow_Label" }, (0, h.Xx)("#FriendSettings_Notification_Table_Label")), l.createElement("div", { className: "FriendsSettingsNotificationRow_Checkbox" }, (0, h.Xx)("#FriendSettings_Notification_Table_Show")), l.createElement("div", { className: "FriendsSettingsNotificationRow_Checkbox" }, (0, h.Xx)("#FriendSettings_Notification_Table_Play"))),
l.createElement(t, { strLabel: (0, h.Xx)("#FriendSettings_Notification_FriendJoins"), strNameShow: "bNotifications_ShowIngame", strNameSound: "bSounds_PlayIngame" }),
l.createElement(t, { strLabel: (0, h.Xx)("#FriendSettings_Notification_FriendOnline"), strNameShow: "bNotifications_ShowOnline", strNameSound: "bSounds_PlayOnline" }),
l.createElement(t, { strLabel: (0, h.Xx)("#FriendSettings_Notification_ChatMessage"), strNameShow: "bNotifications_ShowMessage", strNameSound: "bSounds_PlayMessage" }),
l.createElement(t, { strLabel: (0, h.Xx)("#FriendSettings_Notification_ChatRoomNotification"), strNameShow: "bNotifications_ShowChatRoomNotification", strNameSound: "bSounds_PlayChatRoomNotification" }),
this.props.bShowGroupOpts && l.createElement(t, { strLabel: (0, h.Xx)("#FriendSettings_Notification_GroupEvent"), strNameShow: "bNotifications_EventsAndAnnouncements", strNameSound: "bSounds_EventsAndAnnouncements" }),
),
this.props.bShowPopupOpts && this.props.bShowClientOpts && l.createElement("div", { className: "SettingsGroup" }, l.createElement("div", { className: "FriendsSettingsFlashSection" }, l.createElement(u.__, { className: "FriendsSettingsFlashSection_Header" }, (0, h.Xx)("#FriendSettings_Flash_Header")), l.createElement(u.FT, { className: "FriendsSettingsFlashSection_ButtonRow" }, l.createElement(u.zx, { className: 0 == e.nChatFlashMode ? "Primary" : "Off", value: 0, onClick: this.HandleRadioChange }, (0, h.Xx)("#FriendSettings_Flash_Always")), l.createElement(u.zx, { className: 1 == e.nChatFlashMode ? "Primary" : "Off", value: 1, onClick: this.HandleRadioChange }, (0, h.Xx)("#FriendSettings_Flash_Minimized")), l.createElement(u.zx, { className: 2 == e.nChatFlashMode ? "Primary" : "Off", value: 2, onClick: this.HandleRadioChange }, (0, h.Xx)("#FriendSettings_Flash_Never"))))),
!this.props.bSubmitImmediate && l.createElement(u.o9, { onCancel: this.props.onCancel }),
);
}
};
(0, i.gn)([d.ak], w.prototype, "FriendsSettingsNotificationRow", null), (w = (0, i.gn)([c.Pi], w));
},
71357: (e, t, n) => {
"use strict";
n.d(t, { MS: () => c, Tt: () => u, V3: () => m, kQ: () => h, p3: () => l, zp: () => d });
var i = n(68816),
o = n(37234),
r = n(72746),
a = n(84290),
s = n(65204);
function l(e, t, n, r, l = (0, a.Xx)("#Button_Cancel"), c, m, d) {
return (0, s.SQ)(
(n) => {
let r = u(e, t, d);
(0, i.BR)(n, e, "alertdialog", r, d || (0, o.Og)(e));
},
t,
n,
r,
l,
c,
m,
);
}
function c(e, t, n, i = (0, a.Xx)("#Button_Cancel"), o, s) {
const c = r.Ul.GetDefaultBrowserContext();
return l(window, e, t, n, i, o, s, c);
}
function m(e, t, n, i, o = (0, a.Xx)("#Button_Cancel"), r, s) {
return l(e, t, n, i, o, r, s)
.then(() => Promise.resolve(!0))
.catch(() => Promise.resolve(!1));
}
function d(e, t, n, r = (0, a.Xx)("#Button_OK"), l, c, m) {
return (0, s.E_)(
(n) => {
let r = u(e, t, c, m);
(0, i.BR)(n, e, "alertdialog", r, c || (0, o.Og)(e));
},
t,
n,
r,
l,
);
}
function h(e, t, n = (0, a.Xx)("#Button_OK"), i) {
var o, s;
const l = r.Ul.GetDefaultBrowserContext(),
c = r.Ul.UIStore.GetPerContextChatData(l),
m = null !== (s = null === (o = null == c ? void 0 : c.friends_list_window) || void 0 === o ? void 0 : o.GetWindow()) && void 0 !== s ? s : window;
return d(window, e, t, n, i, l, m);
}
function u(e, t, n, i) {
return r.Ul.UIStore.GetPerContextChatData(n || (0, o.rb)(e)).BUsePopups() && e.innerWidth < 600 ? { strTitle: t, popupWidth: 638, popupHeight: 300, openerWindow: i } : null;
}
},
19411: (e, t, n) => {
"use strict";
n.d(t, { zd: () => B, yd: () => T, Q5: () => O });
var i = n(85556),
o = n(10167),
r = n(50649),
a = n(27378),
s = n(37634),
l = n(33690),
c = n(88669),
m = n(84290),
d = n(2049),
h = n(72746),
u = n(90656),
p = n(88991),
_ = n(66156),
g = n(66508),
C = n(87018),
f = n(58046),
v = n(49361),
S = n.n(v),
b = n(70215),
I = n(29205);
n(38060);
let y = class extends a.Component {
render() {
const { community_data: e } = this.props;
let t = e && e.favorite_badge;
return t ? a.createElement("div", { className: (0, C.Z)(S().miniProfileFeaturedContainer, this.props.className) }, a.createElement("div", { className: S().favoriteBadgeIcon }, a.createElement("img", { src: t.icon, className: S().badgeIcon })), a.createElement("div", { className: (0, C.Z)(S().featuredLabels, S().favoriteBadgeDescription) }, a.createElement("div", { className: S().featuredTitle }, t.name), a.createElement("div", { className: S().featuredSubTitle }, (0, m.Xx)("#Hover_BadgeXP", t.xp)))) : null;
}
};
y = (0, i.gn)([r.Pi], y);
let E = class extends a.Component {
render() {
const { community_data: e, className: t } = this.props;
return e ? a.createElement("div", { className: (0, C.Z)(S().miniProfileFeaturedContainer, t) }, a.createElement("div", { className: e.level_class }, a.createElement("span", { className: S().friendPlayerLevelNum }, e.level)), a.createElement("div", { className: S().featuredLabels }, a.createElement("div", { className: S().featuredTitle }, (0, m.Xx)("#Hover_SteamLevel") + " "))) : null;
}
};
E = (0, i.gn)([r.Pi], E);
let D = class extends a.Component {
render() {
let e = this.props.persona;
return a.createElement("div", { className: (0, C.Z)(S().miniProfileGameContainer, this.props.className) }, this.props.persona.GetCurrentGameLogoURL() && a.createElement("img", { className: S().gameLogo, src: this.props.persona.GetCurrentGameLogoURL() }), a.createElement("div", { className: (0, C.Z)(S().gameContent, S().persona, S().ingame, S().ellipsis) }, a.createElement("div", { className: S().gameState }, (0, m.Xx)(e.is_in_nonsteam_game ? "#PersonaStateInNonSteamGame" : "#PersonaStateInGame")), this.props.persona.GetCurrentGameName(), this.props.persona.HasCurrentGameRichPresence() && a.createElement("div", { className: S().richPresence }, this.props.persona.GetCurrentGameRichPresence()), this.props.in_game_section_additional));
}
};
D = (0, i.gn)([r.Pi], D);
let w = class extends a.Component {
render() {
let e,
t,
n = this.props.broadcast_description;
return n && ((e = (0, m.Xx)("#PersonaStateWatchingBroadcast")), (t = n)), a.createElement("div", { className: (0, C.Z)(S().miniProfileGameContainer, this.props.className) }, this.props.persona.GetBroadcastGameLogoURL() && a.createElement("img", { className: S().gameLogo, src: this.props.persona.GetBroadcastGameLogoURL() }), a.createElement("div", { className: (0, C.Z)(S().gameContent, S().persona, S().watchingbroadcast, S().ellipsis) }, a.createElement("div", { className: S().gameState }, e), t && a.createElement("div", { className: S().richPresence }, t), a.createElement("div", { className: S().watchingbroadcastThumbnail }, this.props.broadcast_thumbnail)));
}
};
w = (0, i.gn)([r.Pi], w);
let R = class extends a.Component {
render() {
const e = this.props,
{ className: t, persona: n, data_loader: o, community_data_override: r, nickname: s, is_friend: l, is_blocked: c, friend_relationship: d, broadcast_description: h, broadcast_thumbnail: u, mutual_friends: p, in_game_section_additional: _, bottom_section_additional: v } = e,
I = (0, i._T)(e, ["className", "persona", "data_loader", "community_data_override", "nickname", "is_friend", "is_blocked", "friend_relationship", "broadcast_description", "broadcast_thumbnail", "mutual_friends", "in_game_section_additional", "bottom_section_additional"]);
let R = o.community_data;
r && (R = Object.assign(Object.assign({}, R), r));
const k = Object.keys((R && R.profile_background) || {}).length > 0;
let T,
L = S().miniProfileContent;
n.is_ingame ? (T = a.createElement(D, Object.assign({}, this.props, { className: k ? S().miniProfileBackdropBlur : void 0 }))) : n.is_watchingbroadcast ? (T = a.createElement(w, Object.assign({}, this.props, { className: k ? S().miniProfileBackdropBlur : void 0 }))) : (L += " " + S().notInOrWatchingGame);
let G = !0,
O = !1,
F = !1;
l || ((L += " " + S().notFriends), (G = !1)), c && ((L += " " + S().communicationBlocked), (F = !0));
let B,
x = void 0 !== s,
N = n.is_awayOrSnooze;
return (
(B = x ? a.createElement("div", null, a.createElement("div", { className: S().personaAndIcons }, a.createElement("div", { className: (0, C.Z)(S().personaName, S().nickName) }, a.createElement("div", { className: S().personaNameLabel }, this.props.nickname), a.createElement("div", { className: S().playerNicknameBracket, title: (0, m.Xx)("#isNickname") }, "*")), a.createElement(g._, { persona: n })), a.createElement("div", { className: (0, C.Z)(S().personaName, S().hasNickname) }, "(", a.createElement("div", { className: S().personaNameLabel }, n.m_strPlayerName), ")")) : a.createElement("div", { className: S().personaAndIcons }, a.createElement("div", { className: S().personaName }, a.createElement("div", { className: S().personaNameLabel }, n.m_strPlayerName)), a.createElement(g._, { persona: n }))),
2 == this.props.friend_relationship && (O = !0),
a.createElement(
a.Fragment,
null,
a.createElement(
"div",
Object.assign({ key: n.GetAccountID(), className: (0, C.Z)(this.props.className, S().miniProfile) }, I),
a.createElement(
"div",
{ className: L },
a.createElement(A, { community_data: R, persona: n }),
a.createElement(
"div",
{ className: S().miniProfileHeader },
a.createElement(
"div",
{ className: (0, C.Z)(S().miniProfilePlayer, n.online_state, N && S().isAway, (0, b.sB)(n)) },
a.createElement(M, { persona: this.props.persona, community_data: R }),
N && a.createElement(f.a, { persona: n, animating: !0, className: S().SnoozeContainer, size: "large" }),
a.createElement("div", { className: S().playerContent }, a.createElement("div", { className: S().playerName }, a.createElement("div", { className: S().persona }, B, N && a.createElement("div", { className: S().awayStatusLabel }, (0, m.Xx)("#PersonaStateAway")), !n.is_online && a.createElement("div", { className: S().awayStatusLabel }, this.props.persona.GetLocalizedOnlineStatus()), "online" == n.online_state && !N && a.createElement("div", { className: S().awayStatusLabel }, (0, m.Xx)("#PersonaStateOnline")), !G && a.createElement("div", { className: S().miniProfileNotFriends }, O ? (0, m.Xx)("#Friend_Menu_NotAFriendRequesting") : (0, m.Xx)("#Friend_Menu_NotAFriendLabel")), F && a.createElement("div", { className: S().miniProfileBlocked }, (0, m.Xx)("#PersonaStateBlocked"))))),
),
),
T,
a.createElement("div", { className: (0, C.Z)(S().miniProfileBottom, k && S().miniProfileBackdropBlur) }, a.createElement(y, { community_data: R }), a.createElement(E, { community_data: R })),
v,
a.createElement("div", { className: S().mutualFriends }, this.props.mutual_friends),
),
),
)
);
}
};
R = (0, i.gn)([r.Pi], R);
const A = ({ community_data: e, persona: t }) => {
if (e && e.profile_background) {
const t = e.profile_background,
{ image: n } = t,
o = (0, i._T)(t, ["image"]);
if (Object.keys(o).length)
return a.createElement(
"div",
{ className: S().miniProfileVideoBackgroundContainer, key: o["video/webm"] || o["video/mp4"] || "image" },
a.createElement(
"video",
{ className: S().miniProfileVideoBackground, playsInline: !0, muted: !0, autoPlay: !0, loop: !0, poster: n },
Object.keys(o).map((e) => a.createElement("source", { key: e, src: o[e], type: e })),
),
);
if (n) return a.createElement("div", { className: S().miniProfileVideoBackgroundContainer }, a.createElement("img", { className: S().miniProfileVideoBackground, src: n }));
}
return a.createElement("div", { className: S().miniProfileBackground }, a.createElement("img", { className: S().miniProfileBackgroundBlur, src: t.avatar_url }));
},
M = (e) => {
const { persona: t, community_data: n, size: o } = e,
r = (0, i._T)(e, ["persona", "community_data", "size"]),
s = n && n.avatar_frame && a.createElement("img", { src: n.avatar_frame, className: S().Frame }),
l = n && n.animated_avatar,
c = { size: o || "X-Large", statusPosition: "bottom", className: S().playerAvatar };
return l ? a.createElement(I.o, Object.assign({}, r, { strAvatarURL: l }, c), s) : a.createElement(I.vV, Object.assign({ persona: t }, r, c), s);
};
var k = n(28413);
function T(e) {
return a.createElement(k.T, { target: e.target, className: "friendHover miniProfileHover", visibilityObserver: e.hoverInstance, onNoSpace: e.onNoSpace, direction: e.direction }, a.createElement(O, { hoverInstance: e.hoverInstance }));
}
let L = class extends a.Component {
constructor(e) {
super(e);
const t = this.props.broadcastAccountID && p.K.InitFromAccountID(this.props.broadcastAccountID);
this.state = { broadcastInfo: t && u.BroadcastWatchStore.StartInfo(t.ConvertTo64BitString()) };
}
componentDidUpdate(e) {
if (this.props.broadcastAccountID !== e.broadcastAccountID) {
this.state.broadcastInfo && u.BroadcastWatchStore.StopInfo(this.state.broadcastInfo);
const e = this.props.broadcastAccountID && p.K.InitFromAccountID(this.props.broadcastAccountID);
this.setState({ broadcastInfo: e && u.BroadcastWatchStore.StartInfo(e.ConvertTo64BitString()) });
}
}
componentWillUnmount() {
this.state.broadcastInfo && u.BroadcastWatchStore.StopInfo(this.state.broadcastInfo);
}
render() {
return this.state.broadcastInfo ? a.createElement(_.m, { src: this.state.broadcastInfo.m_strThumbnailUrl }) : null;
}
};
L = (0, i.gn)([r.Pi], L);
class G extends a.Component {
render() {
let e = h.Ul.FriendStore.FriendGroupStore.incoming_invites_group.map_steamid_to_mutual_friends.get(this.props.friend.steamid64);
if (null != e) {
let t = 10,
n = a.createElement("div", { className: "mutualFriendTitle" }, " ", (0, m.Xx)("#FriendGroup_MutualFriends_Title"), " "),
i = [],
o = Array.from(e);
for (let e = 0; e < o.length && e < t; e++) {
let t = h.Ul.FriendStore.GetFriend(o[e]);
i.push(a.createElement("div", { className: "mutualFriend", key: t.steamid64 }, a.createElement("img", { className: "mutualFriendAvatar", src: t.persona.avatar_url_medium }), a.createElement("div", { className: "mutualFriendLabel" }, t.display_name)));
}
return o.length >= t && i.push(a.createElement("div", { className: "mutualFriend" }, a.createElement("div", { className: "mutualFriendLabel plusOthersLabel" }, (0, m.kb)("#FriendGroup_MutualFriends_Others", o.length - t)))), a.createElement("div", { className: "mutualFriendsContainer" }, " ", n, " ", a.createElement("div", null, " ", i, " "), " ");
}
return a.createElement("div", null);
}
}
let O = class extends a.Component {
constructor(e) {
super(e);
}
render() {
let e = this.props.hoverInstance.hover,
t = e.persona,
n = { className: "miniProfileHoverInner", persona: e.persona, data_loader: e.data_loader };
t.is_watchingbroadcast && ((n.broadcast_description = e.friend.GetBroadcastDescription()), (n.broadcast_thumbnail = a.createElement("div", { className: "watchingbroadcastThumbnail" }, a.createElement(L, { broadcastAccountID: t.m_broadcastAccountId })))), e.friend.has_nickname && (n.nickname = e.friend.nickname), (n.is_friend = e.friend.is_friend || e.friend == h.Ul.FriendStore.self), (n.is_blocked = e.friend.is_blocked), (n.friend_relationship = e.friend.efriendrelationship);
let i = a.createElement("div", null),
r = this.props.hoverInstance.context;
return r && r.friendGroup && r.friendGroup.m_eDisplayType == o.h1.eIncomingInvites && (i = a.createElement(G, { friend: e.friend })), (n.mutual_friends = i), a.createElement(R, Object.assign({}, n));
}
};
O = (0, i.gn)([r.Pi], O);
class F extends l.K3 {
constructor(e, t) {
var n;
super("hoverpopup", { title: "hover", html_class: "friendsui-container HoverPopup client_chat_frame", body_class: "HoverPopupBody Hover" + e.className, replace_existing_popup: !0, target_browser: t, window_opener_id: null === (n = e.target.ownerDocument.defaultView) || void 0 === n ? void 0 : n.SteamClient.Browser.GetBrowserID(), eCreationFlags: (0, l.sB)(l.iJ.Tooltip) }), (this.m_hoverProps = e);
}
UpdateParamsBeforeShow(e) {
let t = c.sH(this.m_hoverProps.target.ownerDocument.defaultView, this.m_hoverProps.target.getBoundingClientRect());
return (e.dimensions = { left: t.right, top: t.top, width: 1, height: 1 }), (e.availscreenwidth = this.m_hoverProps.target.ownerDocument.defaultView.screen.availWidth), (e.availscreenheight = this.m_hoverProps.target.ownerDocument.defaultView.screen.availHeight), e;
}
Render(e, t) {
let n = this.InternalRender();
(this.m_reactRoot = s.s(t)), this.m_reactRoot.render(a.createElement(x, Object.assign({}, this.m_hoverProps, { popup: e }), n));
}
OnClose() {
this.m_reactRoot.unmount();
}
}
class B extends F {
constructor(e, t, n) {
super({ target: e, visibilityObserver: t, className: "friendHover miniProfileHover" }, n), (this.m_instance = t);
}
OnLoad() {}
OnResize() {}
InternalRender() {
return a.createElement(O, { hoverInstance: this.m_instance });
}
}
let x = class extends a.Component {
constructor() {
super(...arguments), (this.m_bNoSpace = !1), (this.state = { x: void 0, y: void 0, width: void 0, height: void 0, hoverPositionReady: !1 });
}
bindHover(e) {
(this.m_elHover = e || void 0), this.positionHover();
}
componentDidUpdate() {
this.positionHover();
}
render() {
return (
void 0 !== this.state.x &&
this.props.target.ownerDocument.defaultView.SteamClient.Window.GetWindowRestoreDetails().then((e) => {
const t = this.state.x - this.props.target.ownerDocument.defaultView.screenX,
n = this.state.y - this.props.target.ownerDocument.defaultView.screenY;
try {
this.props.popup.SteamClient.Window.PositionWindowRelative(e, t, n, this.state.width, this.state.height);
} catch (e) {
console.error(e);
}
}),
a.createElement("div", { className: "HoverPositionPopup", ref: this.bindHover }, this.props.children)
);
}
positionHover() {
let e = this.m_elHover,
t = this.props.target;
if (!e || !t) return;
if (this.state.hoverPositionReady && this.props.visibilityObserver && !this.props.visibilityObserver.visible) return;
let n = this.props.popup,
i = t.ownerDocument.defaultView;
if (!n || n.closed) return;
let o = c.sH(i, t.getBoundingClientRect()),
r = c.sH(n, e.getBoundingClientRect()),
a = o.left,
s = o.top;
let l = n.screen,
m = 0;
l.availLeft && (m = l.availLeft);
let d = o.right + c.PT(r) + 2,
h = n.screen.availWidth + m - d,
u = o.left - c.PT(r) - m;
a = h < 2 && u > h ? o.left - c.PT(r) - 3 + 3 : o.left + c.PT(o) - -3;
let p = 0;
c.BJ(o) < 48 && (p = Math.floor(c.BJ(o) / 2) - 24), (s = o.top - 15 + p);
if (o.top + c.BJ(r) + 0 > n.screen.availHeight) {
let t = c.BJ(r) + 0 - (n.screen.availHeight - o.top),
i = null != e.querySelector(".miniprofile_ingame") ? 78 : 24;
(t = Math.min(c.BJ(r) - i, t)), (s = o.top - t);
}
(a = Math.floor(a)), (s = Math.floor(s));
let _ = Math.ceil(c.PT(r)),
g = Math.ceil(c.BJ(r));
a != this.state.x && this.setState({ x: a }), s != this.state.y && this.setState({ y: s }), _ != this.state.width && this.setState({ width: _ }), g != this.state.height && this.setState({ height: g }), this.state.hoverPositionReady || this.setState({ hoverPositionReady: !0 });
}
};
(0, i.gn)([d.ak], x.prototype, "bindHover", null), (x = (0, i.gn)([r.Pi], x));
},
13106: (e, t, n) => {
"use strict";
n.d(t, { kR: () => _e, $W: () => $, WK: () => ue, rb: () => ce, wd: () => Y, u8: () => te, D4: () => ne });
var i = n(85556),
o = n(72746),
r = n(37234),
a = n(50649),
s = n(68816),
l = n(27378),
c = n(2049),
m = n(84290),
d = n(11259);
function h(e, t, n) {
(0, s.BR)(l.createElement(u, { player: t }), n, "NicknameDialog", { strTitle: (0, m.Xx)("#Friend_Menu_AddNickname"), popupWidth: 640, popupHeight: 400 }, (0, r.Og)(n));
}
let u = class extends l.Component {
constructor(e) {
super(e), (this.state = { strCurrentNameEntry: this.props.player.nickname || "" });
}
HandleTextEntry(e) {
this.setState({ strCurrentNameEntry: e.currentTarget.value });
}
HandleSubmit(e) {
o.Ul.FriendStore.SetPlayerNickname(this.props.player, this.state.strCurrentNameEntry).then((e) => {
1 == e && this.props.closeModal && this.props.closeModal();
});
}
componentDidUpdate(e) {
e.player !== this.props.player && this.setState({ strCurrentNameEntry: this.props.player.nickname });
}
render() {
let e = "friend editNickname",
t = this.props.player.has_nickname;
return (
this.props.player.persona.is_ingame ? (e += " ingame") : this.props.player.persona.is_online && (e += " online"),
t && (e += " nickNamed"),
l.createElement(
s.e1,
{ className: "Dialog_EditNickName", onEscKeypress: this.props.closeModal },
l.createElement(
d.oX,
{ classNameContent: "NicknameDialog", onSubmit: this.HandleSubmit },
l.createElement(d.h4, null, t ? (0, m.Xx)("#Friend_Menu_ChangeNickname") : (0, m.Xx)("#Friend_Menu_AddNickname")),
l.createElement(d.uT, null, l.createElement(d.Ac, null, t ? (0, m.Xx)("#Nickname_EditNickname") : (0, m.Xx)("#Nickname_AddANickname")), l.createElement(d.Ac, null, l.createElement("div", { className: e }, l.createElement("img", { className: "avatarMedium", src: this.props.player.persona.avatar_url_full }), l.createElement("div", { className: "labelHolder" }, l.createElement("div", { className: "mediumName" }, this.props.player.secondary_display_name), l.createElement("div", { className: "nickNamedAs" }, (0, m.Xx)("#Nickname_NickNameAsDialog")), l.createElement("div", { className: "mediumName asNickName" }, l.createElement(d.II, { placeholder: t ? (0, m.Xx)("#Nickname_PlaceHolderNickName") : (0, m.Xx)("#Nickname_PlaceHolderNickNameFresh"), className: "nicknameInput", value: this.state.strCurrentNameEntry, onChange: this.HandleTextEntry, autoFocus: !0, bShowClearAction: !0 })))))),
l.createElement(d.$_, null, l.createElement(d.o9, { onCancel: this.props.closeModal })),
),
)
);
}
};
(0, i.gn)([c.ak], u.prototype, "HandleTextEntry", null), (0, i.gn)([c.ak], u.prototype, "HandleSubmit", null), (u = (0, i.gn)([a.Pi], u));
var p = n(94623),
_ = n(88991),
g = n(88669),
C = n(46057),
f = n(79588);
function v(e, t, n) {
let i = n ? [n.accountid] : [];
(0, s.BR)(l.createElement(S, { browserContext: e, rgPreSelectedFriends: i }), t, "CreateFriendCategoryDialog", { strTitle: (0, m.Xx)("#FriendGroup_Menu_CreateGroup"), popupWidth: 664, popupHeight: 700 }, (0, r.Og)(t));
}
class S extends l.Component {
constructor(e) {
super(e), (this.state = { strNameEntry: e.group ? e.group.name : "", strError: null, rgPickedFriends: e.rgPreSelectedFriends.map((e) => o.Ul.FriendStore.GetPlayer(e)) });
}
HandleTextEntry(e) {
this.setState({ strNameEntry: e.target.value, strError: null });
}
HandleSubmit() {
const e = this.state.rgPickedFriends,
t = this.state.strNameEntry;
if (this.props.group) {
let n = new Set(this.props.group.GetCurrentMemberSet()),
i = [],
r = [];
for (let t of e) {
n.has(t.accountid) ? n.delete(t.accountid) : i.push(t.persona.m_steamid.ConvertTo64BitString());
}
n.forEach((e) => {
r.push(_.K.InitFromAccountID(e).ConvertTo64BitString());
}),
o.Ul.FriendStore.FriendGroupStore.ManageGroup(this.props.group, t, i, r).then((e) => {
e ? this.props.closeModal && this.props.closeModal() : this.setState({ strError: (0, m.Xx)("#FriendGroup_ManageGroup_ErrorFailed") });
});
} else {
if (!t) return void this.setState({ strError: (0, m.Xx)("#FriendGroup_CreateGroup_ErrorNeedName") });
let n = e.map((e) => e.persona.m_steamid.ConvertTo64BitString());
o.Ul.FriendStore.FriendGroupStore.CreateGroup(t, n).then((e) => {
e ? this.props.closeModal && this.props.closeModal() : this.setState({ strError: (0, m.Xx)("#FriendGroup_CreateGroup_ErrorFailed") });
});
}
}
render() {
return l.createElement(s.e1, { onEscKeypress: this.props.closeModal }, l.createElement(d.oX, { classNameContent: "ManageGroupDialog", onSubmit: this.HandleSubmit }, l.createElement(d.h4, null, this.props.group ? (0, m.Xx)("#FriendGroup_Menu_Manage") : (0, m.Xx)("#FriendGroup_Menu_CreateGroup")), l.createElement(d.uT, null, this.state.strError && l.createElement(d.Ac, { className: "nicknameError" }, this.state.strError), l.createElement(d.II, { type: "text", label: (0, m.Xx)("#FriendGroup_CategoryName"), className: "nicknameInput", value: this.state.strNameEntry, onChange: this.HandleTextEntry, autoFocus: !0 }), l.createElement(p.B, { label: (0, m.Xx)("#FriendGroup_CategoryMembers"), eSort: 1, rgPickedFriends: this.state.rgPickedFriends, onChange: (e) => this.setState({ rgPickedFriends: e }) })), l.createElement(d.$_, null, l.createElement(d.o9, { onCancel: this.props.closeModal }))));
}
}
(0, i.gn)([c.ak], S.prototype, "HandleTextEntry", null), (0, i.gn)([c.ak], S.prototype, "HandleSubmit", null);
class b extends l.Component {
constructor() {
super(...arguments), (this.m_mapCategoryChecks = f.LO.map()), (this.state = { strError: null });
}
componentDidUpdate(e) {
e.friend !== this.props.friend && this.m_mapCategoryChecks.clear();
}
HandleSubmit() {
let e = [];
o.Ul.FriendStore.FriendGroupStore.user_groups.forEach((t) => {
if (this.m_mapCategoryChecks.has(t.unique_id)) {
let n, i;
this.m_mapCategoryChecks.get(t.unique_id) ? (i = t) : (n = t), e.push(o.Ul.FriendStore.FriendGroupStore.TransferFriendFromToGroup(this.props.friend, n, i));
}
}),
Promise.all(e).then((e) => {
let t = !1;
for (let n of e) for (let e of n) e || (t = !0);
t ? this.setState({ strError: (0, m.Xx)("#FriendGroup_ManageGroup_ErrorFailed") }) : this.props.closeModal();
});
}
CreateNew(e) {
v((0, r.Um)(this, e), (0, g.RA)(e), this.props.friend);
}
render() {
return l.createElement(s.e1, { onEscKeypress: this.props.closeModal }, l.createElement(d.oX, { classNameContent: "AssignCategoriesDialog", onSubmit: this.HandleSubmit }, l.createElement(d.h4, null, (0, m.Xx)("#FriendGroup_Categorize_Title")), l.createElement(d.uT, null, this.state.strError && l.createElement(d.Ac, { className: "nicknameError" }, this.state.strError), l.createElement(d.Uq, null, l.createElement(d.sg, null, l.createElement(C.mo, { friend: this.props.friend, className: "AssignCategoriesDialog_Friend", noActions: !0, context: null }))), l.createElement(I, { friend: this.props.friend, mapChecks: this.m_mapCategoryChecks }), l.createElement(d.Uq, { className: "AssignCategoriesDialog_AddNewButton" }, l.createElement(d.zx, { onClick: this.CreateNew }, (0, m.Xx)("#FriendGroup_Categorize_AddNew")))), l.createElement(d.$_, null, l.createElement(d.o9, { onCancel: this.props.closeModal }))));
}
}
(0, i.gn)([c.ak], b.prototype, "HandleSubmit", null), (0, i.gn)([c.ak], b.prototype, "CreateNew", null);
let I = class extends l.Component {
render() {
let e = o.Ul.FriendStore.FriendGroupStore.user_groups.map((e) => l.createElement(y, { friend: this.props.friend, group: e, key: e.unique_id, mapChecks: this.props.mapChecks }));
return l.createElement(l.Fragment, null, l.createElement(d.__, null, (0, m.Xx)("#FriendGroup_Categorize_Categories")), l.createElement("div", { className: "FriendCategoryCheckboxes_List" }, e));
}
};
I = (0, i.gn)([a.Pi], I);
let y = class extends l.Component {
OnToggle(e) {
e != this.props.group.HasMember(this.props.friend.accountid) ? this.props.mapChecks.set(this.props.group.unique_id, e) : this.props.mapChecks.delete(this.props.group.unique_id);
}
OnContextMenu(e) {
ue((0, r.Um)(this, e), this.props.group, e);
}
render() {
let e,
t = this.props.group,
n = this.props.friend;
return (e = this.props.mapChecks.has(t.unique_id) ? this.props.mapChecks.get(t.unique_id) : t.HasMember(n.accountid)), l.createElement("div", { onContextMenu: this.OnContextMenu }, l.createElement(d.ji, { label: t.name, checked: e, onChange: this.OnToggle }));
}
};
(0, i.gn)([c.ak], y.prototype, "OnToggle", null), (0, i.gn)([c.ak], y.prototype, "OnContextMenu", null), (y = (0, i.gn)([a.Pi], y));
var E = n(82909),
D = n(61963),
w = n(23346),
R = n(19339),
A = n(84446),
M = n(19953),
k = n(14341),
T = n(11612),
L = n(71357),
G = n(16518),
O = n(38461),
F = n(70532),
B = n(14206),
x = n.n(B);
let N = class extends l.Component {
constructor(e) {
super(e);
let t = o.Ul.FriendStore.self;
this.state = { strCurrentNameEntry: t.primary_display_name, strError: "" };
}
HandleTextEntry(e) {
this.setState({ strCurrentNameEntry: e.currentTarget.value, strError: "" });
}
HandleSubmit(e) {
this.SetPersonaName(this.state.strCurrentNameEntry);
}
DisplayError(e) {
this.setState({ strError: e });
}
SetPersonaName(e) {
if ((this.setState({ strError: "" }), M.De.IN_CLIENT && null != SteamClient.WebChat.SetPersonaName))
SteamClient.WebChat.SetPersonaName(this.state.strCurrentNameEntry).then((e) => {
this.props.eResultCallback && this.props.eResultCallback(e.eResult), 22 === e.eResult ? this.props.closeModal && this.props.closeModal() : e.strMessageToken ? this.DisplayError((0, m.Xx)(e.strMessageToken)) : this.props.closeModal && this.props.closeModal();
});
else {
let t = new FormData();
t.append("sessionid", M.De.SESSIONID), t.append("persona", e);
let n = o.Ul.FriendStore.self,
i = M.De.CHAT_BASE_URL + "profiles/" + n.steamid64 + "/ajaxsetpersonaname/";
x()
.post(i, t)
.then((e) => {
let t = e.data;
if (t.success) this.props.closeModal && this.props.closeModal();
else {
let e = t.message.replace("
", "");
this.DisplayError(e);
}
})
.catch((e) => {
this.DisplayError((0, m.Xx)("#Friends_NameChangeFailed_Info"));
});
}
}
render() {
let e = o.Ul.FriendStore.self,
t = "friend changePersonaName";
e.persona.is_ingame ? (t += " ingame") : e.persona.is_online && (t += " online");
let n = !1;
return (
this.state.strError && (n = !0),
l.createElement(
s.e1,
{ className: "Dialog_ChangePersonaName", onEscKeypress: this.props.closeModal },
l.createElement(
d.oX,
{ classNameContent: "ChangePersonaNameDialog", onSubmit: this.HandleSubmit },
l.createElement(d.h4, null, (0, m.Xx)("#ChangePersona_Title")),
l.createElement(d.uT, null, l.createElement(d.Ac, null, (0, m.Xx)("#ChangePersona_Description")), l.createElement(d.Ac, null, l.createElement("div", { className: t }, l.createElement("img", { className: "avatarMedium", src: e.persona.avatar_url_full }), l.createElement("div", { className: "labelHolder" }, n && l.createElement("div", { className: "error" }, this.state.strError), l.createElement("div", null, l.createElement("div", null, (0, m.Xx)("#ChangePersona_Change")), l.createElement("div", { className: "mediumName" }, l.createElement(d.II, { placeholder: (0, m.Xx)("#ChangePersona_PlaceHolder"), className: "changePersonaInput", value: this.state.strCurrentNameEntry, onChange: this.HandleTextEntry, autoFocus: !0 }))))))),
l.createElement(d.$_, null, l.createElement(d.o9, { onCancel: this.props.closeModal })),
),
)
);
}
};
(0, i.gn)([c.ak], N.prototype, "HandleTextEntry", null), (0, i.gn)([c.ak], N.prototype, "HandleSubmit", null), (N = (0, i.gn)([a.Pi], N));
var P = n(60176),
U = n(53971),
V = n(70215),
H = n(29205);
let W = class extends l.Component {
constructor(e) {
super(e), (this.state = this.ComputeStateFromNotificationSettings(this.props.player.notification_settings));
}
ConvertENotificationSettingToBoolean(e) {
return 1 == e;
}
ComputeStateFromNotificationSettings(e) {
let t,
n = !1,
i = !1;
for (const t in e) {
if (0 != e[t]) {
i = !0;
break;
}
}
return i ? ((t = U.k()), (t.bNotifications_ShowIngame = this.ConvertENotificationSettingToBoolean(e.Notifications_ShowInGame)), (t.bNotifications_ShowMessage = this.ConvertENotificationSettingToBoolean(e.Notifications_ShowMessage)), (t.bNotifications_ShowOnline = this.ConvertENotificationSettingToBoolean(e.Notifications_ShowOnline)), (t.bSounds_PlayIngame = this.ConvertENotificationSettingToBoolean(e.Sounds_PlayInGame)), (t.bSounds_PlayMessage = this.ConvertENotificationSettingToBoolean(e.Sounds_PlayMessage)), (t.bSounds_PlayOnline = this.ConvertENotificationSettingToBoolean(e.Sounds_PlayOnline))) : ((n = !0), (t = o.Ul.SettingsStore.FriendsSettings)), { settings: t, bUseDefaults: n };
}
ConvertBooleanToENotificationSetting(e) {
return e ? 1 : 2;
}
FriendSettingsToNotificationSettings(e) {
let t = new w.Ev();
return (t.Notifications_SendMobile = this.props.player.notification_settings.Notifications_SendMobile), this.state.bUseDefaults || ((t.Notifications_ShowInGame = this.ConvertBooleanToENotificationSetting(this.state.settings.bNotifications_ShowIngame)), (t.Notifications_ShowMessage = this.ConvertBooleanToENotificationSetting(this.state.settings.bNotifications_ShowMessage)), (t.Notifications_ShowOnline = this.ConvertBooleanToENotificationSetting(this.state.settings.bNotifications_ShowOnline)), (t.Sounds_PlayInGame = this.ConvertBooleanToENotificationSetting(this.state.settings.bSounds_PlayIngame)), (t.Sounds_PlayMessage = this.ConvertBooleanToENotificationSetting(this.state.settings.bSounds_PlayMessage)), (t.Sounds_PlayOnline = this.ConvertBooleanToENotificationSetting(this.state.settings.bSounds_PlayOnline))), t;
}
HandleSubmit() {
o.Ul.FriendStore.SetPlayerNotificationSettings(this.props.player, this.FriendSettingsToNotificationSettings(this.state.settings)).then((e) => {
1 == e && this.props.closeModal && this.props.closeModal();
});
}
componentDidUpdate(e) {
e.player !== this.props.player && this.setState(this.ComputeStateFromNotificationSettings(this.props.player.notification_settings));
}
OnSettingToggled(e, t) {
this.setState({ settings: Object.assign(Object.assign({}, this.state.settings), { [e]: t }) });
}
FriendsSettingsCheckbox(e) {
return l.createElement(d.ji, {
key: e.strName,
disabled: this.state.bUseDefaults,
onChange: (t) => {
this.OnSettingToggled(e.strName, t);
},
checked: !!this.state.settings[e.strName],
});
}
NotificationRow(e) {
let t = this.FriendsSettingsCheckbox;
return l.createElement("div", null, l.createElement("div", { className: "FriendsSettingsNotificationRow" }, l.createElement("div", { className: "FriendsSettingsNotificationRow_Label" }, e.strLabel), l.createElement("div", { className: "FriendsSettingsNotificationRow_Checkbox" }, l.createElement(t, { strName: e.strNameShow })), l.createElement("div", { className: "FriendsSettingsNotificationRow_Checkbox" }, l.createElement(t, { strName: e.strNameSound }))));
}
OnDefaultToggled(e) {
e ? this.setState({ settings: o.Ul.SettingsStore.FriendsSettings, bUseDefaults: !0 }) : this.setState({ bUseDefaults: !1 });
}
render() {
let e = this.NotificationRow,
t = this.state.bUseDefaults,
n = "friend editFriendNotifications";
return (
(n += (0, V.sB)(this.props.player.persona)),
l.createElement(
s.e1,
{ className: "Dialog_FriendNotifications", onEscKeypress: this.props.closeModal },
l.createElement(
d.oX,
{ classNameContent: "FriendNotificationsDialog", onSubmit: this.HandleSubmit },
l.createElement(d.h4, null, (0, m.Xx)("#Friend_Menu_NotificationsTitle")),
l.createElement(
d.uT,
{ className: t ? "useDefaults" : "" },
l.createElement(d.Ac, null, (0, m.Xx)("#FriendNotifications_Instructions", this.props.player.display_name)),
l.createElement(d.Ac, null, l.createElement("div", { className: n }, l.createElement(H.vV, { persona: this.props.player.persona, size: "Large" }), l.createElement("div", { className: "labelHolder" }, this.props.player.primary_display_name, !this.props.player.is_display_name_nickname && this.props.player.has_secondary_display_name && l.createElement("span", { className: "playerNickname" }, " (", this.props.player.secondary_display_name, ")"), this.props.player.is_display_name_nickname && l.createElement("span", { className: "playerNicknameBracket", title: (0, m.Xx)("#isNickname") }, "*")))),
l.createElement(d.ji, {
className: "useDefaultsCheckBox",
label: (0, m.Xx)("#FriendNotifications_UseDefaults"),
onChange: (e) => {
this.OnDefaultToggled(e);
},
checked: this.state.bUseDefaults,
}),
l.createElement(
"div",
{ className: "SettingsGroup" },
l.createElement("div", { className: "FriendsSettingsNotificationRow FriendsSettingsNotificationRow_Header" }, l.createElement("div", { className: "FriendsSettingsNotificationRow_Label" }, (0, m.Xx)("#FriendSettings_Notification_Table_Label")), l.createElement("div", { className: "FriendsSettingsNotificationRow_Checkbox" }, (0, m.Xx)("#FriendSettings_Notification_Table_Show")), l.createElement("div", { className: "FriendsSettingsNotificationRow_Checkbox" }, (0, m.Xx)("#FriendSettings_Notification_Table_Play"))),
l.createElement(e, { strLabel: (0, m.Xx)("#FriendSettings_FriendNotification_FriendJoins"), strNameShow: "bNotifications_ShowIngame", strNameSound: "bSounds_PlayIngame" }),
l.createElement(e, { strLabel: (0, m.Xx)("#FriendSettings_FriendNotification_FriendOnline"), strNameShow: "bNotifications_ShowOnline", strNameSound: "bSounds_PlayOnline" }),
l.createElement(e, { strLabel: (0, m.Xx)("#FriendSettings_Notification_ChatMessage"), strNameShow: "bNotifications_ShowMessage", strNameSound: "bSounds_PlayMessage" }),
),
),
l.createElement(d.$_, null, l.createElement(d.o9, { onCancel: this.props.closeModal })),
),
)
);
}
};
(0, i.gn)([c.ak], W.prototype, "HandleSubmit", null), (0, i.gn)([c.ak], W.prototype, "OnSettingToggled", null), (0, i.gn)([c.ak], W.prototype, "FriendsSettingsCheckbox", null), (0, i.gn)([c.ak], W.prototype, "NotificationRow", null), (0, i.gn)([c.ak], W.prototype, "OnDefaultToggled", null), (W = (0, i.gn)([a.Pi], W));
var X = n(37091),
j = n(62902),
z = n(14593),
K = n(13114),
q = n(65204),
Z = n(99165),
Q = n(57476);
function $(e, t, n, i) {
return (0, E.yV)(l.createElement(ie, { browserContext: e, context: t, friend: n, ownerWindow: (0, g.RA)(i) }), i, { bForcePopup: M.De.IN_STEAMUI });
}
function Y(e, t, n, i) {
return l.createElement(ie, { browserContext: e, context: t, friend: n, ownerWindow: i });
}
let J = (0, a.Pi)(function (e) {
let t = e.friend,
n = [],
i = t.persona_name_history,
o = t.persona_name_history_loaded;
if (o && i.length > 0) {
let e = 0;
for (let t of i) n.push(l.createElement("div", { className: "recentName", key: "name_history_" + e }, t)), e++;
} else o ? n.push(l.createElement("div", { className: "recentName", key: "name_history_none" }, (0, m.Xx)("#Friend_Menu_RecentAliases_None"))) : n.push(l.createElement("div", { className: "recentName", key: "name_history_loading" }, (0, m.Xx)("#Friend_Menu_RecentAliases_Loading")));
return l.createElement(l.Fragment, null, l.createElement(D.D1, { label: (0, m.Xx)("#Friend_Menu_RecentAliases") }, n));
}),
ee = class extends l.Component {
OnToggle(e) {
this.props.group.ToggleMemberRoleState(this.props.friend.accountid, e);
}
render() {
let e = this.props.group.DefaultRoleID(),
t = this.props.group.GetMemberRoleIDs(this.props.friend.accountid),
n = this.props.group.BIsAccountIDOwner(this.props.friend.accountid),
i = this.props.group.BCanEditRoles(),
o = this.props.group
.GetRoles()
.slice()
.sort((t, n) => (t.role_id == e ? 1 : n.role_id == e ? -1 : parseInt(t.role_id) - parseInt(n.role_id)))
.map((n) => {
let o = -1 != t.findIndex((e) => e == n.role_id);
if (!o && !i) return null;
let r = n.name,
a = this.props.group.BCanIAssignRole(n.role_id);
return n.role_id == e ? (r = (0, m.Xx)("#ChatRoomRole_Member")) : r.startsWith("#ChatRoomRole_") && (r = (0, m.Xx)(r)), l.createElement(re, { key: n.role_id, friend: this.props.friend, group: this.props.group, roleName: r, roleID: n.role_id, bHasRole: o, bEditable: a });
}),
r = i && !n ? (0, m.Xx)("#Friend_Menu_EditRoles") : (0, m.Xx)("#Friend_Menu_ViewRoles");
return l.createElement(l.Fragment, null, l.createElement(D.D1, { label: r }, n ? l.createElement(D.Zo, { className: "FriendMenuRoleCheckbox disabled", key: "role", onSelected: () => {}, bInteractableItem: !0 }, l.createElement(G._OD, null), (0, m.Xx)("#ChatRoomRole_Owner")) : o));
}
};
function te(e, t, n, i) {
let o = (0, w.ji)(t);
if (1 != t)
if (24 == t) {
let t = l.createElement(X.ns, { style: { color: "white" }, href: M.De.HELP_BASE_URL + "wizard/HelpWithLimitedAccount" }, (0, m.Xx)("#Friend_InviteError_VisitSteamSupport"));
(0, L.zp)(e, (0, m.Xx)("#Friend_Menu_AddToFriendsList"), (0, m.Xx)("#Friend_Menu_AddToFriendsList"), (0, m.Xx)("#Button_OK"), (0, m.kQ)("#Friend_InviteError_LimitedUserLink", t));
} else (0, L.zp)(e, (0, m.Xx)("#Friend_Menu_AddToFriendsList"), (0, m.Xx)(o, i));
else (0, L.zp)(e, (0, m.Xx)("#Friend_Menu_AddToFriendsList"), (0, m.Xx)("#Friend_InviteError", i));
}
function ne(e, t) {
const n = "steam://open/library/shared-apps/" + JSON.stringify(e);
SteamClient.WebChat.OpenURLInClient(n, t.m_unPID, !1);
}
(0, i.gn)([c.ak], ee.prototype, "OnToggle", null), (ee = (0, i.gn)([a.Pi], ee));
let ie = class extends l.PureComponent {
constructor() {
super(...arguments), (this.state = { bCanCreateRemotePlayInvite: !1, strConnectPrivate: "" });
}
componentDidMount() {
return (0, i.mG)(this, void 0, void 0, function* () {
const e = yield o.Ul.RemotePlayStore.BCanCreateInviteForGame(o.Ul.FriendStore.self.persona.m_gameid),
t = o.Ul.FriendStore.self.persona.m_unGamePlayedAppID;
let n = "";
M.De.IN_CLIENT && t && (0, Q.U5)("WebChat.GetPrivateConnectString") && (n = yield SteamClient.WebChat.GetPrivateConnectString(t));
let i = { bCanCreateRemotePlayInvite: e, strConnectPrivate: n };
(i.bCanCreateRemotePlayInvite == this.state.bCanCreateRemotePlayInvite && i.strConnectPrivate == this.state.strConnectPrivate) || this.setState(i);
});
}
ShowFriendProfile(e) {
let t = this.props.friend.GetCommunityProfileURL();
(0, k.b8)(e, t), e.stopPropagation();
}
ShowFriendFiltereredLibrary(e) {
const t = [this.props.friend.accountid];
(0, z.I)("FindGamesToPlayWithFriends/FriendsMenu"), e.stopPropagation();
ne(t, (0, r.Um)(this, e));
}
InviteFriend() {
return (0, i.mG)(this, void 0, void 0, function* () {
let { eResult: e, eFriendRelationship: t } = yield o.Ul.FriendStore.SendFriendInvite(this.props.friend);
4 == t ? (0, L.zp)(this.props.ownerWindow, (0, m.Xx)("#Friend_Menu_AddToFriendsList"), (0, m.Xx)("#Friend_InviteSent")) : 3 == t ? (0, L.zp)(this.props.ownerWindow, (0, m.Xx)("#Friend_Menu_AddToFriendsList"), (0, m.Xx)("#Friend_MutualInviteSent", this.props.friend.display_name)) : te(this.props.ownerWindow, e, 0, this.props.friend.display_name);
});
}
AcceptIncomingInvite() {
return (0, i.mG)(this, void 0, void 0, function* () {
let { eResult: e, eFriendRelationship: t } = yield o.Ul.FriendStore.SendFriendInvite(this.props.friend);
3 == t ? (0, L.zp)(this.props.ownerWindow, (0, m.Xx)("#Friend_Menu_AddToFriendsList"), (0, m.Xx)("#Friend_MutualInviteSent", this.props.friend.display_name)) : te(this.props.ownerWindow, e, 0, this.props.friend.display_name);
});
}
IgnoreIncomingInvite() {
o.Ul.FriendStore.RemoveFriend(this.props.friend).then((e) => {
1 == e ? (0, L.zp)(this.props.ownerWindow, (0, m.Xx)("#Friend_Menu_IgnoreIncomingInvite"), (0, m.Xx)("#Friend_IgnoreIncomingInvite_Success", this.props.friend.display_name)) : (0, L.zp)(this.props.ownerWindow, (0, m.Xx)("#Friend_Menu_IgnoreIncomingInvite"), (0, m.Xx)("#Friend_IgnoreIncomingInvite_Error", this.props.friend.display_name));
});
}
RemoveFriend() {
let e = 4 == this.props.friend.efriendrelationship,
t = (0, m.Xx)(e ? "#Friend_Menu_CancelInvitation" : "#Friend_Menu_RemoveFromFriendsList"),
n = (0, m.Xx)(e ? "#Friend_CancelInvitation_Confirm" : "#Friend_RemoveFromFriendsList_Confirm", this.props.friend.display_name),
i = (0, m.Xx)(e ? "#Button_Confirm" : "#Friend_Menu_RemoveFromFriendsList"),
r = (0, m.Xx)(e ? "#Friend_CancelInvitation_Error" : "#Friend_RemoveFromFriendsList_Error");
(0, L.p3)(this.props.ownerWindow, t, n, i, (0, m.Xx)("#Button_Cancel"), !0)
.then(() => {
o.Ul.FriendStore.RemoveFriend(this.props.friend).then((e) => {
(3 != e && 6 != e) || (0, L.zp)(this.props.ownerWindow, t, r);
});
})
.catch(() => {});
}
BlockFriend() {
(0, L.p3)(this.props.ownerWindow, (0, m.Xx)("#Friend_Menu_BlockAllCommunication"), (0, m.Xx)("#Friend_Block_Confirm", this.props.friend.display_name), (0, m.Xx)("#Friend_Menu_BlockAllCommunication"))
.then(() => {
o.Ul.FriendStore.BlockPlayer(this.props.friend);
})
.catch(() => {});
}
UnblockFriend() {
(0, L.p3)(this.props.ownerWindow, (0, m.Xx)("#Friend_Menu_UnblockAllCommunication"), (0, m.Xx)("#Friend_Unblock_Confirm", this.props.friend.display_name), (0, m.Xx)("#Friend_Menu_UnblockAllCommunication"))
.then(() => {
o.Ul.FriendStore.BlockPlayer(this.props.friend, !0);
})
.catch(() => {});
}
InviteToGame(e, t) {
o.Ul.FriendStore.InviteToGame(this.props.friend, e, t);
}
InviteToLobby(e, t) {
o.Ul.FriendStore.InviteToLobby(this.props.friend, e, t);
}
InviteToWatch() {
o.Ul.FriendStore.InviteToWatch(this.props.friend);
}
InviteToRemotePlay() {
let e = this.props.friend;
o.Ul.FriendStore.self !== e && o.Ul.RemotePlayStore.CreateInviteAndSession(e.accountid, o.Ul.FriendStore.self.persona.m_gameid, this.props.browserContext);
}
CancelRemotePlay() {
let e = this.props.friend;
o.Ul.RemotePlayStore.CancelInviteAndSession(e.accountid);
}
CancelAllRemotePlay() {
o.Ul.RemotePlayStore.CancelAllInvitesAndSessions();
}
InviteToVoice(e, t) {
(0, P.cl)({ invitee: this.props.friend, invitedto: e }, null, this.props.ownerWindow);
}
render() {
var e, t, n;
let i,
a,
c = this.props,
d = c.context || {},
u = [],
p = [],
_ = c.friend,
g = o.Ul.FriendStore.FavoritesStore,
C = o.Ul.FriendStore.self == _,
f = "favorites" == d.chatContext,
S = d.group;
!S && d.chat instanceof A.K && (S = d.chat.GetGroup());
let I = !1,
y = _.is_friend,
E = 2 == _.efriendrelationship,
w = 4 == _.efriendrelationship,
k = E || 4 == _.efriendrelationship,
L = o.Ul.FriendStore.self.persona.m_unGamePlayedAppID;
_.persona.m_unGamePlayedAppID;
d.chat && (d.chat instanceof R.a ? ((i = d.chat), i.BVoiceActive() && (I = !0)) : d.chat instanceof A.K && ((a = d.chat), a.BVoiceActive() && (I = !0))),
y || E || C || u.push(l.createElement("div", { className: "contextMenuLabel contextMenuNotAFriend", key: "header" }, (0, m.Xx)("#Friend_Menu_NotAFriendLabel"))),
!I || C || (null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) || u.push(l.createElement(oe, { friend: this.props.friend })),
d.tab &&
u.push(
l.createElement(
D.Zo,
{
key: "closetab",
onSelected: () => {
o.Ul.UIStore.CloseTab(c.browserContext, d.tab);
},
},
(0, m.Xx)((null === (t = this.context) || void 0 === t ? void 0 : t.IN_GAMEPADUI) ? "#Chat_CloseTabAction_SteamDeck" : "#Chat_CloseTabAction"),
),
),
i ||
d.tab ||
E ||
w ||
C ||
_.is_blocked ||
u.push(
l.createElement(
D.Zo,
{
key: "chat",
className: y ? "" : "SendMessageContextNotFriends",
onSelected: () => {
c.friend.OpenChatDialog(c.browserContext);
},
},
(0, m.Xx)("#Friend_Menu_SendMessage"),
),
);
let O = o.Ul.ChatStore.BIsEligibleForVoiceChat(_, i),
F = o.Ul.ChatStore.GetActiveVoiceChat();
F && F instanceof R.a && F.accountid_partner == _.accountid
? u.push(
l.createElement(
D.Zo,
{
key: "voicechat",
onSelected: () => {
F.ToggleVoiceChat();
},
},
(0, m.Xx)("#Friend_Menu_StopVoiceChat"),
),
)
: O &&
(F instanceof A.K
? F.GetMember(_.accountid) ||
u.push(
l.createElement(
D.Zo,
{
key: "voicechat",
className: "contextVoiceInvite",
onSelected: () => {
this.InviteToVoice(F, d);
},
},
l.createElement(G.Cq4, null),
(0, m.Xx)("#Chat_Actions_InviteFriend_VoiceChat"),
),
)
: u.push(
l.createElement(
D.Zo,
{
key: "voicechat",
onSelected: () => {
o.Ul.UIStore.ShowFriendChatDialogAndStartVoice(c.browserContext, _.accountid);
},
},
(0, m.Xx)("#Friend_Menu_StartVoiceChat"),
),
)),
u.length > 0 && u.push(l.createElement(D.uP, { key: "separator" })),
u.push(l.createElement(D.Zo, { key: "viewprofile", onSelected: this.ShowFriendProfile }, (0, m.Xx)("#Friend_Menu_ViewProfile"))),
M.De.IN_CLIENT && o.Ul.SettingsStore.BClientHasFeatureOrOnWeb("FriendsFilter") && !C && u.push(l.createElement(D.Zo, { key: "findgamestoplay", onSelected: this.ShowFriendFiltereredLibrary }, (0, m.Xx)("#Friend_Menu_GamesToPlayTogether"))),
S && u.push(l.createElement(le, { key: "moderationoptions", friend: _, bIsSelf: C, group: S, ownerWindow: c.ownerWindow }));
let B = [];
const x = !!_.persona.m_unGamePlayedAppID && !C;
if (!C) {
if (y) {
if (
(p.push(
l.createElement(
D.Zo,
{
key: "setnickname",
onSelected: () => {
h(c.browserContext, c.friend, c.ownerWindow);
},
},
(0, m.Xx)(c.friend.has_nickname ? "#Friend_Menu_ChangeNickname" : "#Friend_Menu_AddNickname"),
),
),
g.BIsFavorited({ friend: _ }))
) {
(f ? u : p).push(l.createElement(D.Zo, { key: "quickaccess", onSelected: he.bind(null, _) }, (0, m.Xx)("#Friend_Menu_RemoveFromQuickAccess")));
} else p.push(l.createElement(D.Zo, { key: "quickaccess", onSelected: de.bind(null, _) }, (0, m.Xx)("#Friend_Menu_AddToQuickAccess")));
if (
(p.push(
l.createElement(
D.Zo,
{
key: "managecategories",
onSelected: () => {
!(function (e, t, n) {
0 == o.Ul.FriendStore.FriendGroupStore.user_groups.length ? v(e, t, n) : (0, s.BR)(l.createElement(b, { browserContext: e, friend: n }), t, "AssignFriendCategoryDialog", { strTitle: (0, m.Xx)("#FriendGroup_Menu_CreateGroup"), popupWidth: 664, popupHeight: 580 }, (0, r.Og)(t));
})(c.browserContext, c.ownerWindow, c.friend);
},
},
(0, m.Xx)("#FriendGroup_Menu_Categorize"),
),
),
p.push(
l.createElement(
D.Zo,
{
key: "notifications",
onSelected: () => {
return c.browserContext, (e = c.friend), (t = c.ownerWindow), void (0, s.BR)(l.createElement(W, { player: e }), t, "FriendNotificationsDialog", { strTitle: (0, m.Xx)("#Friend_Menu_Notifications"), popupWidth: 640, popupHeight: 520 }, (0, r.Og)(t));
var e, t;
},
},
(0, m.Xx)("#Friend_Menu_Notifications"),
),
),
f || p.push(l.createElement(D.Zo, { key: "removefriend", onSelected: this.RemoveFriend }, (0, m.Xx)("#Friend_Menu_RemoveFromFriendsList"))),
p.push(l.createElement(J, { key: "aliases", friend: _ })),
o.Ul.FriendStore.self.persona.is_ingame &&
o.Ul.BroadcastStore.is_broadcast_capable &&
B.push(
l.createElement(
D.Zo,
{
className: "contextMenuGameOptions",
key: "invitetowatch",
onSelected: () => {
this.InviteToWatch();
},
},
(0, m.Xx)("#Friend_Menu_InviteToWatch"),
),
),
0 != L && "0" != o.Ul.FriendStore.self.persona.m_game_lobby_id)
)
B.push(
l.createElement(
D.Zo,
{
className: "contextMenuGameOptions",
key: "lobbyinvite",
onSelected: () => {
this.InviteToLobby(L, o.Ul.FriendStore.self.persona.m_game_lobby_id);
},
},
(0, m.Xx)("#Friend_Menu_InviteToLobby"),
),
);
else if (0 != (null === (n = this.state.strConnectPrivate) || void 0 === n ? void 0 : n.length)) {
const e = this.state.strConnectPrivate;
B.push(
l.createElement(
D.Zo,
{
className: "contextMenuGameOptions",
key: "gameinvite",
onSelected: () => {
this.InviteToGame(L, e);
},
},
(0, m.Xx)("#Friend_Menu_InviteToGame"),
),
);
} else if (o.Ul.FriendStore.self.persona.connect_string) {
const e = o.Ul.FriendStore.self.persona.connect_string;
B.push(
l.createElement(
D.Zo,
{
className: "contextMenuGameOptions",
key: "gameinvite",
onSelected: () => {
this.InviteToGame(L, e);
},
},
(0, m.Xx)("#Friend_Menu_InviteToGame"),
),
);
}
if (o.Ul.RemotePlayStore.BEnabled()) {
let e = this.props.friend;
o.Ul.RemotePlayStore.HasInviteAndSession(e.accountid)
? B.push(
l.createElement(
D.Zo,
{
className: "contextMenuGameOptions",
key: "cancelremoteplay",
onSelected: () => {
this.CancelRemotePlay();
},
},
(0, m.Xx)("#Friend_Menu_CancelRemotePlay"),
),
)
: o.Ul.RemotePlayStore.HasInviteAndSessionForGameIDOtherThan(String(L))
? B.push(
l.createElement(
D.Zo,
{
className: "contextMenuGameOptions",
key: "cancelallremoteplay",
onSelected: () => {
this.CancelAllRemotePlay();
},
},
(0, m.Xx)("#Friend_Menu_CancelAllRemotePlay"),
),
)
: this.state.bCanCreateRemotePlayInvite &&
o.Ul.RemotePlayStore.BRemotePlayTogetherEnabled() &&
B.push(
l.createElement(
D.Zo,
{
className: "contextMenuGameOptions",
key: "invitetoremoteplay",
onSelected: () => {
this.InviteToRemotePlay();
},
},
(0, m.Xx)("#Friend_Menu_InviteToRemotePlay"),
),
);
}
M.De.EREALM !== T.IN.k_ESteamRealmChina && u.push(l.createElement(ae, { key: "trading", friend: _ }));
} else E ? (u.push(l.createElement(D.Zo, { key: "acceptincominginvite", onSelected: this.AcceptIncomingInvite }, (0, m.Xx)("#Friend_Menu_AcceptIncomingInvite"))), u.push(l.createElement(D.Zo, { key: "ignoreincominginvite", onSelected: this.IgnoreIncomingInvite }, (0, m.Xx)("#Friend_Menu_IgnoreIncomingInvite"))), u.push(l.createElement(J, { key: "aliases", friend: _ }))) : w ? u.push(l.createElement(D.Zo, { key: "remove", onSelected: this.RemoveFriend }, (0, m.Xx)("#Friend_Menu_CancelInvitation"))) : u.push(l.createElement(D.Zo, { key: "invite", onSelected: this.InviteFriend }, (0, m.Xx)("#Friend_Menu_AddToFriendsList")));
k &&
u.push(
l.createElement(
D.Zo,
{
key: "setnickname",
onSelected: () => {
h(c.browserContext, c.friend, c.ownerWindow);
},
},
(0, m.Xx)(c.friend.has_nickname ? "#Friend_Menu_ChangeNickname" : "#Friend_Menu_AddNickname"),
),
),
(f && !_.is_blocked) || p.push(l.createElement(D.Zo, { key: "block", onSelected: _.is_blocked ? this.UnblockFriend : this.BlockFriend }, (0, m.Xx)(_.is_blocked ? "#Friend_Menu_UnblockAllCommunication" : "#Friend_Menu_BlockAllCommunication")));
}
if (!u) return null;
let N, P;
if ((this.props.context && this.props.context.group && (N = this.props.context.group.GetMemberPartyBeacon(this.props.friend.accountid)), B.length > 0 && (!x || _.persona.m_unGamePlayedAppID != L))) {
let e;
if (0 == L) e = l.createElement("div", { className: "contextMenuGameItem" }, l.createElement("div", { className: "contextMenuGameName" }, o.Ul.FriendStore.self.current_game_name));
else {
let t = o.Ul.AppInfoStore.GetAppInfo(L);
e = l.createElement("div", { className: "contextMenuGameItem" }, l.createElement("div", { className: "contextMenuGameIcon" }, l.createElement("img", { className: "GameIcon", src: t.icon_url })), l.createElement("div", { className: "contextMenuGameName" }, t.name));
}
(P = l.createElement(l.Fragment, { key: "mygame" }, l.createElement(D.Zo, { className: "contextMenuGameTitle contextMenuUnselectable", onSelected: null, disabled: !0 }, l.createElement("div", { className: "contextMenuGameTitleBlurCropContainer" }, e)), l.createElement("div", { className: "contextMenuSectionContent" }, B))), (B = []);
}
return l.createElement(D.xV, { className: "friendsContextMenu", label: _.display_name }, u, 1 == p.length && p, p.length > 1 && l.createElement(D.D1, { label: (0, m.Xx)("#Friend_Menu_Manage") }, p), !!_.persona.m_broadcastAccountId && !C && l.createElement(me, { friend: _, ownerWindow: c.ownerWindow, browserContext: c.browserContext }), P, !!P && x && l.createElement(D.uP, null), x && l.createElement(ce, { unAppID: _.persona.m_unGamePlayedAppID, strGameName: _.current_game_name, ulGameID: _.persona.m_gameid, friend: _, partyBeacon: N, ownerWindow: c.ownerWindow, browserContext: c.browserContext, extraItems: B, localAppID: L }));
}
};
(ie.contextType = M.E_), (0, i.gn)([c.ak], ie.prototype, "ShowFriendProfile", null), (0, i.gn)([c.ak], ie.prototype, "ShowFriendFiltereredLibrary", null), (0, i.gn)([c.ak], ie.prototype, "InviteFriend", null), (0, i.gn)([c.ak], ie.prototype, "AcceptIncomingInvite", null), (0, i.gn)([c.ak], ie.prototype, "IgnoreIncomingInvite", null), (0, i.gn)([c.ak], ie.prototype, "RemoveFriend", null), (0, i.gn)([c.ak], ie.prototype, "BlockFriend", null), (0, i.gn)([c.ak], ie.prototype, "UnblockFriend", null), (0, i.gn)([c.ak], ie.prototype, "InviteToGame", null), (0, i.gn)([c.ak], ie.prototype, "InviteToLobby", null), (0, i.gn)([c.ak], ie.prototype, "InviteToWatch", null), (0, i.gn)([c.ak], ie.prototype, "InviteToRemotePlay", null), (0, i.gn)([c.ak], ie.prototype, "CancelRemotePlay", null), (0, i.gn)([c.ak], ie.prototype, "CancelAllRemotePlay", null), (0, i.gn)([c.ak], ie.prototype, "InviteToVoice", null), (ie = (0, i.gn)([a.Pi], ie));
let oe = class extends l.Component {
constructor(e) {
super(e);
let t = o.Ul.VoiceStore.ConvertGainValueToSliderValue(o.Ul.VoiceStore.GetPerUserGainLevel(this.props.friend.accountid), O.Ys.k_MaxPerUserGainMultiplier);
this.state = { volumeNumber: t };
}
OnFriendVolumeChanged(e) {
o.Ul.VoiceStore.SetPerUserGainLevel(this.props.friend.accountid, o.Ul.VoiceStore.ConvertSliderToGainValue(e, O.Ys.k_MaxPerUserGainMultiplier)), this.setState({ volumeNumber: e });
}
OnMutingClick(e) {
let t = o.Ul.VoiceStore.GetPerUserMuting(this.props.friend.accountid);
o.Ul.VoiceStore.SetPerUserMuting(this.props.friend.accountid, !t), this.forceUpdate();
}
OnInlineVolumeClick(e) {
this.forceUpdate();
}
render() {
let e = this.state.volumeNumber,
t = "VolumeIcon",
n = o.Ul.VoiceStore.GetPerUserMuting(this.props.friend.accountid);
return e > 65 ? (t += " HighestVolume") : e > 45 ? (t += " HighVolume") : e < 46 && e > 24 ? (t += " MedVolume") : e < 25 && (t += " LowVolume"), l.createElement(D.Zo, { key: "volume", onSelected: () => {}, bInteractableItem: !0 }, l.createElement("div", { className: "InlineVolume" + (n ? " Muted" : ""), onClick: this.OnInlineVolumeClick }, l.createElement("button", { className: t, onClick: this.OnMutingClick }, l.createElement(G.ffh, null)), l.createElement(d.DS, { min: 0, max: 100, label: "", value: e, onChange: this.OnFriendVolumeChanged }), l.createElement("div", { className: "volumePercentage" }, 2 * e, "%")));
}
};
(0, i.gn)([c.ak], oe.prototype, "OnFriendVolumeChanged", null), (0, i.gn)([c.ak], oe.prototype, "OnMutingClick", null), (0, i.gn)([c.ak], oe.prototype, "OnInlineVolumeClick", null), (oe = (0, i.gn)([a.Pi], oe));
let re = class extends l.Component {
OnChange(e) {
this.props.group.SetMemberRoleState(this.props.friend.accountid, this.props.roleID, e);
}
render() {
return l.createElement(D.Zo, { className: "FriendMenuRoleCheckbox" + (this.props.bEditable ? "" : " disabled"), key: "role", onSelected: () => {}, bInteractableItem: !0 }, l.createElement(d.ji, { label: this.props.roleName, checked: this.props.bHasRole, onChange: this.OnChange, disabled: !this.props.bEditable }));
}
};
(0, i.gn)([c.ak], re.prototype, "OnChange", null), (re = (0, i.gn)([a.Pi], re));
class ae extends l.Component {
SendTradeOffer(e) {
let t = "NewTradeOffer" + this.props.friend.accountid,
n = (0, g.RA)(e).open(o.Ul.EconomyStore.GetDefaultTradeOfferURLForFriend(this.props.friend.accountid), t, "height=1120,width=1028,resize=yes,scrollbars=yes");
n && n.focus();
}
render() {
let e = this.props.friend;
return l.createElement(D.D1, { label: (0, m.Xx)("#FriendMenu_Trading") }, l.createElement(se, { friend: e }), l.createElement(D.Zo, { onSelected: this.SendTradeOffer }, (0, m.Xx)("#FriendMenu_SendTradeOffer")));
}
}
function se(e) {
return l.createElement(
D.Zo,
{
onSelected: (t) => {
(0, k.b8)(t, e.friend.GetCommunityProfileURL() + "inventory/");
},
},
(0, m.Xx)("#FriendMenu_ViewInventory"),
);
}
(0, i.gn)([c.ak], ae.prototype, "SendTradeOffer", null);
class le extends l.Component {
BanFriend() {
return (0, i.mG)(this, void 0, void 0, function* () {
(yield (0, L.V3)(this.props.ownerWindow, (0, m.Xx)("#Friend_Ban"), (0, m.Xx)("#Friend_Ban_Confirm", this.props.friend.display_name), (0, m.Xx)("#Friend_Ban_Button"), (0, m.Xx)("#Button_Cancel"), !0)) && this.props.group.SetUserBanState(this.props.friend.accountid, !0);
});
}
OnKickFriend() {
let e = this.props.group,
t = Ce,
n = this.props.ownerWindow;
new Promise((e, i) => {
let o = (0, L.Tt)(n, (0, m.Xx)("#Friend_Kick", this.props.friend.display_name));
(0, s.BR)(
l.createElement(fe, {
OnOK: e,
OnCancel: i,
OnSet: (e) => {
t = e;
},
}),
n,
"alertdialog",
o,
(0, r.Og)(n),
);
})
.then(() => e.KickUser(this.props.friend.accountid, Math.floor(Date.now() / 1e3 + t)))
.catch(() => {});
}
render() {
let e = [],
t = this.props.friend,
n = this.props.group;
return n.BHasMember(t.accountid) ? (!this.props.bIsSelf && n.BCanKick() && e.push(l.createElement(D.Zo, { disabled: !n.BCanKickMember(t.accountid), key: "kick", onSelected: this.OnKickFriend }, (0, m.Xx)("#Friend_Menu_KickFromChatRoom"))), !this.props.bIsSelf && n.BCanBan() && e.push(l.createElement(D.Zo, { disabled: !n.BCanBanMember(t.accountid), key: "ban", onSelected: this.BanFriend }, (0, m.Xx)("#Friend_Menu_Ban"))), n && e.push(l.createElement(ee, { key: "editroles", friend: t, group: n, bEditable: n.BCanEditRoles() }))) : e.push(l.createElement(D.Zo, { disabled: !0, key: "notmember", onSelected: null }, (0, m.Xx)("#Friend_Menu_HasLeftChat"))), e;
}
}
(0, i.gn)([c.ak], le.prototype, "BanFriend", null), (0, i.gn)([c.ak], le.prototype, "OnKickFriend", null);
let ce = class extends l.Component {
constructor(e) {
super(e),
(this.state = { bIsSubscribedToApp: void 0 }),
F.F.BIsSubscribedApp(this.props.unAppID).then((e) => {
this.setState({ bIsSubscribedToApp: e });
});
}
ShowStorePage(e) {
let t = (0, j.FG)(this.props.unAppID, "friendcontextmenu");
(0, k.b8)(e, t), e.stopPropagation();
}
ShowCommunityHub(e) {
let t = `${M.De.COMMUNITY_BASE_URL}app/${this.props.unAppID}`;
(0, k.b8)(e, t), e.stopPropagation();
}
LaunchGame(e) {
let t = "steam://rungameid/" + (this.props.ulGameID || this.props.unAppID);
(0, k.b8)(e, t), e.stopPropagation();
}
WatchGame(e) {
o.Ul.UIStore.SetFriendBroadcastVisible(this.props.friend.steamid64, !0), this.props.friend.OpenChatDialog((0, r.Um)(this, e));
}
JoinGame(e) {
const t = this.props.friend;
if (!t.persona.has_joinable_game_flag || (t.persona.connect_string && 0 != t.persona.connect_string.length)) {
const n = (0, K.gh)(t.persona.GetAccountID(), t.persona.m_unGamePlayedAppID, t.persona.connect_string, null, t.persona.is_in_valid_lobby && t.persona.m_game_lobby_id);
(0, k.b8)(e, n);
} else {
let e = this.props.ownerWindow;
(0, s.AM)(l.createElement(ve, { friend: t, ownerWindow: e }), e, { browserContext: this.props.browserContext });
}
e.stopPropagation();
}
ViewGameInfo(e) {
if (M.De.IN_CLIENT && (0, Q.U5)("ServerBrowser.CreateFriendGameInfoDialog")) {
const e = this.props.browserContext.m_unPID;
SteamClient.ServerBrowser.CreateFriendGameInfoDialog(e, this.props.friend.steamid64);
} else {
const t = `steam://viewfriendsgame/${this.props.friend.steamid64}`;
(0, k.b8)(e, t);
}
e.stopPropagation();
}
ShowInSteam(e) {
let t = `steam://store/${this.props.unAppID}`;
(0, k.b8)(e, t), e.stopPropagation();
}
JoinPartyBeacon(e) {
let t = `steam://joinparty/${this.props.unAppID}/${this.props.partyBeacon.beacon_id}`;
(0, k.b8)(e, t), e.stopPropagation();
}
render() {
var e, t, n, i, r;
if (!this.props.unAppID) return null;
let a,
s = [],
c = this.props.friend,
d = o.Ul.AppInfoStore.GetAppInfo(this.props.unAppID);
if (!d.is_valid) return null;
if (d.is_initialized)
if (this.props.bShowLargeHeader) a = l.createElement("div", { className: "contextMenuGameHeader" }, l.createElement("img", { className: "GameHeader", src: d.logo_url }));
else {
let e = l.createElement("span", { className: "contextMenuGameName" }, (0, m.Xx)("#Friend_Menu_ViewGameStorePageGameName", this.props.strGameName || d.name));
a = l.createElement("div", { className: "contextMenuGameItem" }, l.createElement("div", { className: "contextMenuGameIcon" }, l.createElement("img", { className: "GameIcon", src: d.icon_url })), e);
}
const h = this.props.localAppID == this.props.unAppID;
void 0 === this.state.bIsSubscribedToApp
? s.push(l.createElement(D.Zo, { className: "contextMenuGameOptions contextMenuPlayButton", key: "showinsteam", onSelected: this.ShowInSteam }, l.createElement(G.shV, null), (0, m.Xx)("#Friend_Menu_ShowInSteam")))
: this.state.bIsSubscribedToApp && (this.props.partyBeacon ? s.push(l.createElement(D.Zo, { className: "contextMenuGameOptions contextMenuPlayButton contextMenuPartyBeacon", key: "joinparty", onSelected: this.JoinPartyBeacon }, l.createElement(G.shV, null), (0, m.Xx)("#Friend_Menu_JoinFriendPartyBeacon"))) : c && c.persona.is_in_joinable_game && s.push(l.createElement(D.Zo, { className: "contextMenuGameOptions contextMenuPlayButton", key: "joingame", onSelected: this.JoinGame }, l.createElement(G.shV, null), (0, m.Xx)("#Friend_Menu_JoinFriendGame"))), h || s.push(l.createElement(D.Zo, { className: "contextMenuGameOptions contextMenuPlayButton", key: "launchgame", onSelected: this.LaunchGame }, l.createElement(G.shV, null), (0, m.Xx)("#Friend_Menu_LaunchFriendGame")))),
c && s.push(l.createElement(D.Zo, { className: "contextMenuGameOptions", key: "watchgame", onSelected: this.WatchGame }, (0, m.Xx)("#Friend_Menu_WatchFriendGame")));
let u = null !== (e = null == c ? void 0 : c.persona.has_server_ip) && void 0 !== e && e,
p = null !== (n = null === (t = null == c ? void 0 : c.persona) || void 0 === t ? void 0 : t.HasRichPresenceForViewGameInfo()) && void 0 !== n && n;
return (
c && (u || p) && !(null === (i = this.context) || void 0 === i ? void 0 : i.IN_GAMEPADUI) && s.push(l.createElement(D.Zo, { className: "contextMenuGameOptions", key: "viewgameinfo", onSelected: this.ViewGameInfo }, (0, m.Xx)("#Friend_Menu_ViewGameInfo"))),
h || s.push(l.createElement(D.Zo, { className: "contextMenuGameOptions", key: "viewstorepage", onSelected: this.ShowStorePage }, (0, m.Xx)("#Friend_Menu_ViewGameStorePage"))),
(null === (r = this.context) || void 0 === r ? void 0 : r.IN_GAMEPADUI) || s.push(l.createElement(D.Zo, { className: "contextMenuGameOptions", key: "viewcommunityhub", onSelected: this.ShowCommunityHub }, (0, m.Xx)("#Friend_Menu_ViewCommunityHub"))),
l.createElement(l.Fragment, null, l.createElement(D.Zo, { className: "contextMenuGameTitle contextMenuUnselectable", onSelected: null, disabled: !0 }, l.createElement("div", { className: "contextMenuGameTitleBlurCropContainer" }, a)), l.createElement("div", { className: "contextMenuSectionContent" }, s, this.props.extraItems))
);
}
};
(ce.contextType = M.E_), (0, i.gn)([c.ak], ce.prototype, "ShowStorePage", null), (0, i.gn)([c.ak], ce.prototype, "ShowCommunityHub", null), (0, i.gn)([c.ak], ce.prototype, "LaunchGame", null), (0, i.gn)([c.ak], ce.prototype, "WatchGame", null), (0, i.gn)([c.ak], ce.prototype, "JoinGame", null), (0, i.gn)([c.ak], ce.prototype, "ViewGameInfo", null), (0, i.gn)([c.ak], ce.prototype, "ShowInSteam", null), (0, i.gn)([c.ak], ce.prototype, "JoinPartyBeacon", null), (ce = (0, i.gn)([a.Pi], ce));
let me = class extends l.Component {
WatchStream() {
let e = this.props.browserContext,
t = this.props.friend;
const n = t.persona.m_broadcastAccountId;
o.Ul.UIStore.ShowOrActivateBroadcast(e, n, !0).ShowWatchPromptDialog(t);
}
render() {
let e = this.props.friend;
return l.createElement(l.Fragment, null, l.createElement(D.Zo, { className: "contextMenuBroadcast contextMenuUnselectable", onSelected: null, disabled: !0 }, l.createElement("div", { className: "contextMenuBroadcastTitle" }, (0, m.Xx)("#Broadcast_Watching")), l.createElement("div", { className: "contextMenuBroadcastSubtitle" }, e.GetBroadcastDescription())), l.createElement("div", { className: "contextMenuSectionContent" }, l.createElement(D.Zo, { className: "contextMenuGameOptions", onSelected: this.WatchStream }, (0, m.Xx)("#Broadcast_WatchStream"))));
}
};
function de(e) {
o.Ul.FriendStore.FavoritesStore.AddToFavorites({ friend: e });
}
function he(e) {
o.Ul.FriendStore.FavoritesStore.RemoveFromFavorites({ friend: e });
}
function ue(e, t, n) {
return (0, E.yV)(l.createElement(pe, { browserContext: e, group: t, ownerWindow: (0, g.RA)(n) }), n);
}
function pe(e) {
var t;
let n = [];
return (
e.group &&
e.group.modifiable &&
(n.push(
l.createElement(
D.Zo,
{
key: "managegroup",
onSelected: () => {
var t, n, i;
(t = e.browserContext), (n = e.group), (i = e.ownerWindow), (0, s.BR)(l.createElement(S, { browserContext: t, group: n, rgPreSelectedFriends: n.member_accountid_list }), i, "CreateFriendCategoryDialog", { strTitle: (0, m.Xx)("#FriendGroup_Menu_Manage"), popupWidth: 664, popupHeight: 700 }, (0, r.Og)(i));
},
},
(0, m.Xx)("#FriendGroup_Menu_Manage"),
),
),
n.push(
l.createElement(
D.Zo,
{
key: "removegroup",
onSelected: () => {
o.Ul.FriendStore.FriendGroupStore.RemoveGroup(e.group);
},
},
(0, m.Xx)("#FriendGroup_Menu_Remove"),
),
)),
l.createElement(
D.xV,
{ className: "friendsContextMenu", label: null === (t = e.group) || void 0 === t ? void 0 : t.name },
n,
l.createElement(
D.Zo,
{
key: "creategroup",
onSelected: () => {
v(e.browserContext, e.ownerWindow);
},
},
(0, m.Xx)("#FriendGroup_Menu_CreateGroup"),
),
)
);
}
function _e(e, t, n) {
return (0, E.yV)(l.createElement(ge, { browserContext: e, ownerWindow: t.currentTarget.ownerDocument.defaultView, setPersonaNameEresultCallback: n }), t);
}
(0, i.gn)([c.ak], me.prototype, "WatchStream", null), (me = (0, i.gn)([a.Pi], me));
class ge extends l.PureComponent {
constructor(e) {
super(e);
}
SetUserOnline() {
o.Ul.FriendStore.SetUserPersonaState(1);
}
SetUserInvisible() {
o.Ul.FriendStore.SetUserPersonaState(7);
}
SetUserAway() {
o.Ul.FriendStore.SetUserPersonaState(3);
}
SetUserOffline() {
o.Ul.SignOutOfFriends(this.props.browserContext), o.Ul.FriendStore.SetUserPersonaState(0, !1);
}
ToggleUserDND() {
o.Ul.FriendStore.SetUserDoNotDisturb(!o.Ul.FriendStore.GetUserDoNotDisturb());
}
ShowUserProfile(e) {
let t = o.Ul.FriendStore.self.GetCommunityProfileURL();
(0, k.b8)(e, t), e.stopPropagation();
}
EditProfile(e) {
let t = `${o.Ul.FriendStore.self.GetCommunityProfileURL()}edit`;
(0, k.b8)(e, t), e.stopPropagation();
}
EditName(e) {
var t, n;
this.props.browserContext, (t = this.props.ownerWindow), (n = this.props.setPersonaNameEresultCallback), (0, s.BR)(l.createElement(N, { eResultCallback: n }), t, "ChangePersonaDialog", { strTitle: (0, m.Xx)("#Friend_Menu_AddNickname"), popupWidth: 640, popupHeight: 400 }, (0, r.Og)(t));
}
render() {
let e = [],
t = [],
n = 1 == o.Ul.FriendStore.self.persona.m_ePersonaState;
e.push(l.createElement(D.Td, { key: "state_online", bChecked: n, onSelected: this.SetUserOnline }, (0, m.Xx)("#PersonaStateOnline")));
let i = 3 == o.Ul.FriendStore.self.persona.m_ePersonaState;
e.push(l.createElement(D.Td, { key: "state_away", bChecked: i, onSelected: this.SetUserAway }, (0, m.Xx)("#PersonaStateAway")));
let r = 7 == o.Ul.FriendStore.self.persona.m_ePersonaState;
if ((e.push(l.createElement(D.Td, { key: "state_invisible", className: "personaContextMenuItem", bChecked: r, onSelected: this.SetUserInvisible }, (0, m.Xx)("#PersonaStateInvisible"), l.createElement("div", { className: "persona_menu_descriptor" }, (0, m.Xx)("#PersonaStateInvisibleDescriptor")))), M.De.IN_CLIENT && o.Ul.SettingsStore.BClientHasFeatureOrOnWeb("DoNotDisturb"))) {
let t = 0 == o.Ul.FriendStore.self.persona.m_ePersonaState;
e.push(l.createElement(D.Td, { key: "state_offline", className: "personaContextMenuItem", bChecked: t, onSelected: this.SetUserOffline }, (0, m.Xx)("#PersonaStateOffline"), l.createElement("div", { className: "persona_menu_descriptor" }, (0, m.Xx)("#PersonaStateOfflineDescriptor"))));
}
if (o.Ul.SettingsStore.BClientHasFeatureOrOnWeb("DoNotDisturb")) {
let e = o.Ul.FriendStore.GetUserDoNotDisturb();
t.push(l.createElement(D.Td, { key: "do_not_disturb", className: "personaContextMenuItem", bChecked: !1, onSelected: this.ToggleUserDND }, l.createElement(d.ji, { key: "dnd_checkbox", className: "DNDCheckBox", checked: e, label: (0, m.Xx)("#User_ToggleDoNotDisturb") }), l.createElement("div", { className: "persona_menu_dnd_descriptor" }, (0, m.Xx)("#PersonaStateDoNotDisturbDescriptor"))));
}
return t.push(l.createElement(D.Zo, { key: "editname", onSelected: this.EditName }, (0, m.Xx)("#Friend_Menu_ChangeMyName"))), t ? l.createElement(D.xV, { className: "friendsContextMenu currentUserContextMenu", label: o.Ul.FriendStore.self.display_name }, l.createElement("div", { className: "contextMenuSectionContent" }, e), t) : null;
}
}
(0, i.gn)([c.ak], ge.prototype, "SetUserOnline", null), (0, i.gn)([c.ak], ge.prototype, "SetUserInvisible", null), (0, i.gn)([c.ak], ge.prototype, "SetUserAway", null), (0, i.gn)([c.ak], ge.prototype, "SetUserOffline", null), (0, i.gn)([c.ak], ge.prototype, "ToggleUserDND", null), (0, i.gn)([c.ak], ge.prototype, "ShowUserProfile", null), (0, i.gn)([c.ak], ge.prototype, "EditProfile", null), (0, i.gn)([c.ak], ge.prototype, "EditName", null);
const Ce = 3600;
class fe extends l.Component {
OnCancel() {
this.props.OnCancel(), this.props.closeModal();
}
OnOK() {
this.props.OnOK(), this.props.closeModal();
}
OnDropDownChange(e, t) {
this.props.OnSet(e.data);
}
render() {
let e = [
{ label: (0, m.Xx)("#Friend_Kick_Hour"), data: Ce },
{ label: (0, m.Xx)("#Friend_Kick_Day"), data: 86400 },
{ label: (0, m.Xx)("#Friend_Kick_Week"), data: 604800 },
];
return l.createElement(s.e1, { onEscKeypress: this.OnCancel }, l.createElement(d.oX, { classNameContent: "KickUserDialog", onSubmit: this.OnOK, bCenterVertically: !0 }, l.createElement(d.h4, null, " ", (0, m.Xx)("#Friend_Kick"), " "), l.createElement(d.uT, null, l.createElement(d.Ac, null, (0, m.Xx)("#Friend_Kick_How_Long")), l.createElement(d.ry, { strDefaultLabel: (0, m.Xx)("#Friend_Kick_Hour"), rgOptions: e, onChange: this.OnDropDownChange, selectedOption: void 0 })), l.createElement(d.$_, null, l.createElement(d.o9, { onCancel: this.OnCancel, strOKText: (0, m.Xx)("#Friend_Kick_Button"), strCancelText: (0, m.Xx)("#Button_Cancel") }))));
}
}
(0, i.gn)([c.ak], fe.prototype, "OnCancel", null), (0, i.gn)([c.ak], fe.prototype, "OnOK", null), (0, i.gn)([c.ak], fe.prototype, "OnDropDownChange", null);
const ve = (0, a.Pi)((e) => {
const { friend: t, ownerWindow: n, closeModal: i } = e,
o = t.persona.connect_string;
return (
l.useEffect(() => {
if (0 != o.length) {
const e = (0, K.gh)(t.persona.GetAccountID(), t.persona.m_unGamePlayedAppID, t.persona.connect_string, null, t.persona.is_in_valid_lobby && t.persona.m_game_lobby_id);
(0, k.b8)(n, e), i && i();
}
}, [o]),
l.createElement(q.uH, { bAlertDialog: !0, strTitle: (0, m.Xx)("#Friend_JoinGameWait_Title"), strDescription: (0, m.Xx)("#Friend_JoinGameWait_Desc"), strOKButtonText: (0, m.Xx)("#Friend_JoinGameWait_Cancel"), onOK: i, onCancel: i, closeModal: i }, l.createElement("div", { style: { display: "flex", justifyContent: "center", marginTop: "20px" } }, l.createElement(Z.V, null)))
);
});
},
46057: (e, t, n) => {
"use strict";
n.d(t, { qe: () => Pe, HR: () => dt, mo: () => gt, o2: () => bt, yd: () => _t, $g: () => Ye, J9: () => $e, ZY: () => Qe, SR: () => Ue, $J: () => Ve });
var i = n(85556),
o = n(19953),
r = n(93354),
a = n(84446),
s = n(23346),
l = n(19339),
c = n(10167),
m = n(37234),
d = n(72746),
h = n(23133),
u = n(71357),
p = n(13106),
_ = n(32572),
g = n(618),
C = n(71061),
f = n(51997),
v = n(79588),
S = n(50649),
b = n(41370),
I = n(27378),
y = n(31542),
E = n(83817),
D = n(58046),
w = n(29205),
R = n(88669),
A = n(84290),
M = n(2049),
k = n(33690),
T = n(33082);
let L = class extends I.Component {
constructor(e) {
super(e), (this.m_rgFavoriteElementRefs = []);
}
render() {
let e = this.props.FavoritesStore.favorites.map((e, t) => {
let n;
if (e.friend) n = "f" + e.friend.accountid;
else if (e.clan) n = "cl" + e.clan.clanid;
else {
if (!e.chat) return null;
n = "cg" + e.chat.GetGroupID();
}
return I.createElement(O, { favorite: e, index: t, friendRenderContext: this.GetFriendRenderContext(), key: n, bIsDragGhost: !1, bIsDragOutGhost: !1, ref: this.OnFavoriteElementRef.bind(this, t) });
});
return I.createElement(E.s, { "flow-children": "column" }, e);
}
OnFavoriteElementRef(e, t) {
this.m_rgFavoriteElementRefs[e] = t;
}
GetFriendRenderContext() {
return this.m_FriendRenderContext || (this.m_FriendRenderContext = { chatContext: "friendslist" }), this.m_FriendRenderContext;
}
};
L = (0, i.gn)([S.Pi], L);
let G = class extends I.Component {
constructor(e) {
super(e), (this.m_iActiveDragIndex = void 0), (this.m_ActiveDrag = void 0), (this.m_ActiveDragOut = void 0), (this.m_bGhostIsDupe = !1), (this.m_rgFavoriteElementRefs = []), (this.m_bAcceptDrag = !1), (0, v.rC)(this), (this.state = { bHintDismissed: m.g_FriendsUIDesktopApp.UIDisplayPrefs.bFavoritesHintDismissed });
}
DismissFavoritesHint() {
this.setState({ bHintDismissed: !0 }), m.g_FriendsUIDesktopApp.SetUIDisplayPref("bFavoritesHintDismissed", !0);
}
render() {
let e = this.props.FavoritesStore.favorites,
t = this.m_ActiveDrag,
n = "quickAccessFriends emptyQuickAccess";
if ((this.state.bHintDismissed && (n += " hintDismissed"), e.length || t)) {
let n = e,
i = d.Ul.SettingsStore.FriendsSettings.bCompactQuickAccess;
if (t) {
let e;
if ((this.m_bGhostIsDupe && (e = n.findIndex((e) => (0, _.j)(e, t))), void 0 === this.m_iActiveDragIndex || this.m_iActiveDragIndex >= n.length)) n = [...n, Object.assign({ isActiveDrag: !0 }, t)];
else {
this.m_iActiveDragIndex;
n = [...n.slice(0, this.m_iActiveDragIndex), Object.assign({ isActiveDrag: !0 }, t), ...n.slice(this.m_iActiveDragIndex)];
}
}
let o = n.map((e, n) => {
let i;
if (e.friend) i = "f" + e.friend.accountid;
else if (e.clan) i = "cl" + e.clan.clanid;
else {
if (!e.chat) return null;
i = "cg" + e.chat.GetGroupID();
}
let o = this.m_bGhostIsDupe && !e.isActiveDrag && (0, _.j)(t, e),
r = e.isActiveDrag;
return r && (i += "dragGhost"), I.createElement(O, { favorite: e, index: n, friendRenderContext: this.GetFriendRenderContext(), key: i, bIsDragGhost: r, bIsDragOutGhost: o, ref: this.OnFavoriteElementRef.bind(this, n) });
}),
r = "quickAccessFriends";
return i && (r += " compactQuickAccess"), I.createElement(h.R, Object.assign({ className: r }, this.GetDragDropProps(), { "flow-children": "grid" }), o, I.createElement("div", { className: "dropTargetBox" }));
}
return I.createElement(h.G, Object.assign({ className: n }, this.GetDragDropProps()), I.createElement("div", { className: "quickAccessFriendsMessage" }, (0, A.Xx)("#FriendsList_Favorites_Hint")), !this.state.bHintDismissed && I.createElement("div", { className: "quickAccessFriendsMessageDismiss", onClick: this.DismissFavoritesHint }, (0, A.Xx)("#Generic_Got_It")), I.createElement("div", { className: "dropTargetBox" }));
}
OnFavoriteElementRef(e, t) {
this.m_rgFavoriteElementRefs[e] = t;
}
GetFriendRenderContext() {
return this.m_FriendRenderContext || (this.m_FriendRenderContext = { chatContext: "friendslist" }), this.m_FriendRenderContext;
}
GetDragDropProps() {
let e = { rgAcceptedTypes: ["friend", "chattab", "chatroomgroup", "clan"] };
return (e.fnDragEnter = this.OnDragEnter), (e.fnDragOver = this.OnDragOver), (e.fnDragLeave = this.OnDragLeave), (e.fnDrop = this.OnDrop), (e.onDragStart = this.OnDragStart), (e.onDragEndCapture = this.OnDragEnd), e;
}
OnDragStart(e) {
let t = m.g_FriendsUIDesktopApp.DragDropManager.GetDragData();
!t || ("friend" != t.type && "chatroomgroup" != t.type && "clan" != t.type) || ((t.is_favorite = !0), (this.m_ActiveDragOut = this.FindItemFromDrag(t)));
}
OnDragEnd(e) {
let t = m.g_FriendsUIDesktopApp.DragDropManager.GetDragData(),
n = this.FindItemFromDrag(t);
if (n && "is_favorite" in t && t.is_favorite && !m.g_FriendsUIDesktopApp.DragDropManager.BWasDropConsumed()) {
let t = e.currentTarget.getBoundingClientRect();
const i = 100;
(0, R.H2)(t, e.clientX, e.clientY) > i && (this.props.FavoritesStore.RemoveFromFavorites(n), m.g_FriendsUIDesktopApp.DragDropManager.EndDrag());
}
this.m_ActiveDragOut = void 0;
}
FindItemFromDrag(e) {
let t, n, i, o;
if ("friend" == e.type) n = e.friend;
else if ("chattab" == e.type) {
let t = e.tab;
if (t instanceof r.we) {
let e = t.GetGroup();
e.BIsClanChatRoom() && (i = d.Ul.FriendStore.ClanStore.GetClan(e.GetClanID())), (o = e);
} else {
n = t.GetChatView().chat.chat_partner;
}
} else "chatroomgroup" == e.type ? (o = e.group) : "clan" == e.type && (i = e.clan);
return n ? n.is_friend && (t = { friend: n }) : i ? (t = { clan: i }) : o && (t = { chat: o }), t;
}
OnDragEnter(e, t) {
let n = this.FindItemFromDrag(e);
return n && !(0, _.j)(this.m_ActiveDrag, n) && ((this.m_ActiveDrag = n), (this.m_bGhostIsDupe = this.props.FavoritesStore.BIsFavorited(n))), !0;
}
OnDragOver(e) {
let t, n;
for (let i of this.m_rgFavoriteElementRefs) {
let o = i && i.GetBoundingClientRect();
if (o) {
let r = (0, R.H2)(o, e.clientX, e.clientY);
(void 0 === n || r < n) && ((n = r), (t = i));
}
}
t && (this.m_iActiveDragIndex = t.props.index), (e.dataTransfer.dropEffect = "copy");
}
ResetDragState() {
(this.m_ActiveDrag = void 0), (this.m_ActiveDragOut = void 0), (this.m_iActiveDragIndex = void 0);
}
OnDragLeave() {
this.m_ActiveDrag && this.ResetDragState();
}
OnDrop(e, t) {
let n = this.FindItemFromDrag(e);
this.m_ActiveDrag;
n ? (m.g_FriendsUIDesktopApp.DragDropManager.SetDropConsumed(), this.props.FavoritesStore.AddToFavorites(n, this.m_iActiveDragIndex), n.friend && n.friend.LoadEquippedProfileItems(), this.ResetDragState()) : this.m_ActiveDrag && this.ResetDragState();
}
};
(0, i.gn)([v.LO], G.prototype, "m_iActiveDragIndex", void 0), (0, i.gn)([v.LO], G.prototype, "m_ActiveDrag", void 0), (0, i.gn)([v.LO], G.prototype, "m_ActiveDragOut", void 0), (0, i.gn)([M.ak], G.prototype, "DismissFavoritesHint", null), (0, i.gn)([M.ak], G.prototype, "OnDragStart", null), (0, i.gn)([M.ak], G.prototype, "OnDragEnd", null), (0, i.gn)([M.ak], G.prototype, "OnDragEnter", null), (0, i.gn)([M.ak], G.prototype, "OnDragOver", null), (0, i.gn)([M.ak], G.prototype, "OnDragLeave", null), (0, i.gn)([M.ak], G.prototype, "OnDrop", null), (G = (0, i.gn)([S.Pi], G));
class O extends I.Component {
GetBoundingClientRect() {
let e = y.findDOMNode(this);
return e ? e.getBoundingClientRect() : null;
}
onFavoriteElementClick(e) {
let t = this.props.favorite;
if (t.friend) this.props.favorite.friend.OpenChatDialog((0, m.Um)(null, e));
else if (t.clan) t.clan.OpenChatDialog((0, m.Um)(this, e));
else {
if (!t.chat) return;
d.Ul.UIStore.ShowAndOrActivateChatRoomGroup((0, m.Um)(this, e), t.chat, !0);
}
e.stopPropagation();
}
OnFavoriteElementContextMenu(e) {
let t = this.props.favorite;
if (t.friend) (0, p.$W)((0, m.Um)(this, e), this.props.friendRenderContext, t.friend, e);
else if (t.clan) (0, f.ip)(e, t.clan, { is_favorites: !0 });
else {
if (!t.chat) return;
(0, f.bU)(e, t.chat, { is_favorites: !0 });
}
e.stopPropagation();
}
render() {
let e,
t,
n = "quickAccessFriend",
i = this.props.favorite;
this.props.bIsDragGhost ? (n += " dropGhost") : this.props.bIsDragOutGhost && (n += " dragOriginGhost"), this.props.bIsDragOutGhost && (e = { display: "none" }), (t = i.friend ? I.createElement(F, { key: i.friend.accountid, friend: i.friend, friendRenderContext: this.props.friendRenderContext, className: n }) : i.clan ? I.createElement(B, { key: i.clan.clanid, clan: i.clan, className: n }) : i.chat ? I.createElement(x, { key: i.chat.GetGroupID(), chat: i.chat, className: n }) : null);
let o = I.createElement(E.s, { style: e, className: "favoriteElement", onActivate: this.onFavoriteElementClick, onOKActionDescription: (0, A.Xx)("#Friend_Menu_SendMessage"), onMenuActionDescription: (0, A.Xx)("#Friend_Menu_Open"), onContextMenu: this.OnFavoriteElementContextMenu, onMenuButton: this.OnFavoriteElementContextMenu }, t);
return i.friend ? I.createElement(_t, { friend: i.friend, context: this.props.friendRenderContext }, o) : o;
}
}
(0, i.gn)([M.ak], O.prototype, "onFavoriteElementClick", null), (0, i.gn)([M.ak], O.prototype, "OnFavoriteElementContextMenu", null);
let F = (0, S.Pi)(function (e) {
let t = (0, o.id)(),
n = e.friend,
i = !t && d.Ul.SettingsStore.FriendsSettings.bCompactQuickAccess,
r = null;
const a = (0, k.Wy)(),
s = (0, m.rb)(a.ownerWindow),
l = !(0, T.n)(s, T.D);
let c,
h = d.Ul.CMInterface.logged_on;
if (
(I.useEffect(() => {
d.Ul.CMInterface.logged_on && n.LoadEquippedProfileItems();
}, [h, n]),
n.persona.is_awayOrSnooze && (r = I.createElement(D.a, { persona: n.persona, className: "SnoozeContainer", size: "medium", dim: !0 })),
n.persona.is_ingame)
) {
let e = n.persona.m_unGamePlayedAppID && d.Ul.AppInfoStore.GetAppInfo(n.persona.m_unGamePlayedAppID);
(null == e ? void 0 : e.is_valid) && (c = I.createElement("div", { className: "FavoriteFriend_GameIcon" }, I.createElement("img", { className: "gameIcon", src: e.icon_url, draggable: !1 })));
}
let u = d.Ul.ChatStore.FriendChatStore.GetUnfilteredFriendsWithUnreadMessages(),
p = !1;
for (let e of u)
if (e.accountid_partner == n.accountid) {
p = !0;
break;
}
let _ = null;
p && (_ = I.createElement("div", { className: "ChatUnreadMessageIndicator" }, I.createElement("div", { className: "chatUnreadCircle" })));
let g = null,
C = null,
f = d.Ul.SettingsStore.FriendsSettings.bAnimatedAvatars && n.persona.is_online;
if ((0, b.SZ)(() => n.BLoadedEquippedItems())) {
let e = n.GetEquippedProfileItems();
e && ((g = e.animated_avatar), (C = e.avatar_frame));
}
return I.createElement(gt, { friend: n, key: n.accountid, className: e.className, context: e.friendRenderContext, bFriendsListEntry: !0, bSingleClickActivate: !0 }, !t && I.createElement("div", null, I.createElement(w._1, { key: `${n.persona.GetAccountID()}_${n.persona.is_online}`, loopDuration: f ? "Medium" : "None", persona: n.persona, animatedAvatar: g, avatarFrame: C, size: "Medium", bLimitProfileFrameAnimationTime: !f || l }, c, r), !i && I.createElement("div", { className: "playerNameQuickAccessContainer" }, I.createElement("div", { className: "playerName" }, n.display_name), n.is_display_name_nickname && I.createElement("span", { className: "playerNicknameBracket", title: (0, A.Xx)("#isNickname") }, "*")), _));
}),
B = class extends I.Component {
OnDragStart(e) {
m.g_FriendsUIDesktopApp.DragDropManager.StartDrag({ type: "clan", clan: this.props.clan });
}
OnDragEnd(e) {
m.g_FriendsUIDesktopApp.DragDropManager.EndDrag();
}
render() {
var e;
let t = "QuickAccessFriend QuickAccessClan",
n = !(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) && d.Ul.SettingsStore.FriendsSettings.bCompactQuickAccess;
this.props.className && (t += " " + this.props.className);
let i = null,
o = this.props.clan.GetChatGroupIDIfLoaded();
if (o) {
let e = d.Ul.ChatStore.GetChatRoomGroup(o);
e && (i = I.createElement(C.TJ, { group: e }));
}
return I.createElement("div", { className: t, draggable: !0, onDragStart: this.OnDragStart, onDragEnd: this.OnDragEnd }, I.createElement(g.hV, { clan: this.props.clan, size: "small" }), !n && I.createElement("div", { className: "clanName" }, this.props.clan.name), i);
}
};
(B.contextType = o.E_), (0, i.gn)([M.ak], B.prototype, "OnDragStart", null), (0, i.gn)([M.ak], B.prototype, "OnDragEnd", null), (B = (0, i.gn)([S.Pi], B));
let x = class extends I.Component {
OnDragStart(e) {
m.g_FriendsUIDesktopApp.DragDropManager.StartDrag({ type: "chatroomgroup", group: this.props.chat });
}
OnDragEnd(e) {
m.g_FriendsUIDesktopApp.DragDropManager.EndDrag();
}
render() {
var e;
let t = "QuickAccessChat",
n = null,
i = !(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) && d.Ul.SettingsStore.FriendsSettings.bCompactQuickAccess;
return this.props.chat.hasUnreadChatMessage && (n = I.createElement(C.TJ, { group: this.props.chat })), this.props.className && (t += " " + this.props.className), I.createElement("div", { className: t, draggable: !0, onDragStart: this.OnDragStart, onDragEnd: this.OnDragEnd }, I.createElement(g._P, { group: this.props.chat }), !i && I.createElement("div", { className: "clanName" }, this.props.chat.name), n);
}
};
(x.contextType = o.E_), (0, i.gn)([M.ak], x.prototype, "OnDragStart", null), (0, i.gn)([M.ak], x.prototype, "OnDragEnd", null), (x = (0, i.gn)([S.Pi], x));
var N = n(60176),
P = n(14341),
U = n(58908),
V = n(29512),
H = n(82909),
W = n(61963),
X = n(16518),
j = n(83666),
z = n(39353),
K = n(59702),
q = n(97720),
Z = n(7098),
Q = n(68816),
$ = n(11259),
Y = n(9824);
const J = "DEBUG_LogCMTraffic";
var ee = n(99165),
te = n(19411),
ne = n(24292),
ie = (n(77385), n(65204), n(94729), n(70349));
I.Component;
class oe extends I.Component {
constructor(e) {
super(e),
(this.m_rgSelectOptions = [
{ label: "Option #1", data: 1 },
{ label: "Option #2", data: 2 },
{ label: I.createElement("span", null, "Option ", I.createElement("u", null, "#3")), data: 3 },
]),
(this.state = { inputText: "Input text", checkboxChecked: !0, selectedOption: void 0 });
}
OnInputChanged(e) {
this.setState({ inputText: e.currentTarget.value });
}
OnToggled(e) {
this.setState({ checkboxChecked: e });
}
OnSelectDropDownChanged(e) {
this.setState({ selectedOption: e.data });
}
OnSubmit() {
alert(JSON.stringify(this.state));
}
render() {
return I.createElement(
I.Fragment,
null,
I.createElement(
$.l0,
{ className: "DialogBody", onSubmit: this.OnSubmit },
I.createElement(
"div",
{ className: "_FixedHeight" },
I.createElement($.Ac, null, "Text input"),
I.createElement($.II, { label: "INPUT TITLE", value: this.state.inputText, onChange: this.OnInputChanged }),
I.createElement($.II, { label: "READ ONLY", value: "You can't change this", disabled: !0 }),
I.createElement($.ry, { label: "Drop down", rgOptions: this.m_rgSelectOptions, strDefaultLabel: "Select one...", selectedOption: this.state.selectedOption, onChange: this.OnSelectDropDownChanged }),
I.createElement($.gE, { label: "On Off Toggle", checked: this.state.checkboxChecked, onChange: this.OnToggled }),
I.createElement("div", { style: { marginBottom: "20px" } }, I.createElement("span", null, "Checkbox:"), I.createElement("div", { style: { display: "inline-block", marginLeft: "20px", verticalAlign: "middle" } }, I.createElement($.ji, null))),
I.createElement("div", { style: { marginBottom: "20px" } }, I.createElement("span", null, "Round checkbox:"), I.createElement("div", { style: { display: "inline-block", marginLeft: "20px", verticalAlign: "middle" } }, I.createElement($.BQ, null))),
I.createElement($.DS, { min: 0, max: 100, value: 25 }),
I.createElement("div", { style: { marginBottom: "20px" } }, I.createElement($.FT, null, I.createElement($.KM, null, "PrimaryButton"), I.createElement($.Av, null, "TextButton"), I.createElement($.zx, { svgicon: X._OD }, "Button w/ Icon"))),
I.createElement($.Uq, null, I.createElement($.II, { label: "Left input", placeholder: "Placeholder" }), I.createElement($.II, { label: "Right input", placeholder: "Placeholder" })),
I.createElement($.gE, { label: "Another toggle", description: "This one has a longer description with more details." }),
),
),
I.createElement($.$_, null, I.createElement($.o9, { onCancel: this.props.onCancel })),
);
}
}
(0, i.gn)([M.ak], oe.prototype, "OnInputChanged", null), (0, i.gn)([M.ak], oe.prototype, "OnToggled", null), (0, i.gn)([M.ak], oe.prototype, "OnSelectDropDownChanged", null), (0, i.gn)([M.ak], oe.prototype, "OnSubmit", null);
class re extends I.Component {
constructor() {
super(...arguments), (this.rgDragDropOptions = [I.createElement($.HC, { key: "key1", id: "key1" }, I.createElement($.gE, { label: "Draggable toggle #1" })), I.createElement($.HC, { key: "key2", id: "key2" }, I.createElement($.gE, { label: "Draggable toggle #2" })), I.createElement($.HC, { key: "key3", id: "key3" }, I.createElement($.gE, { label: "Draggable toggle #3" })), I.createElement($.HC, { key: "keyz", id: "keyz" }, I.createElement(ae, { ref: this.RefTest })), I.createElement($.HC, { key: "key4", id: "key4" }, I.createElement($.gE, { label: "Draggable toggle #4" }))]);
}
OnSubmit() {
alert(JSON.stringify(this.state));
}
RefTest(e) {
console.log("Got ref", e);
}
OnListReordered(e, t) {
Y.hV(this.rgDragDropOptions, e, t), this.forceUpdate();
}
render() {
return I.createElement($.l0, { className: "DialogBody", onSubmit: this.OnSubmit }, I.createElement($.RW, { onReorder: this.OnListReordered }, this.rgDragDropOptions));
}
}
(0, i.gn)([M.ak], re.prototype, "OnSubmit", null), (0, i.gn)([M.ak], re.prototype, "RefTest", null), (0, i.gn)([M.ak], re.prototype, "OnListReordered", null);
class ae extends I.Component {
constructor(e) {
super(e), (this.state = { cSeconds: 0 });
}
componentDidMount() {
this.m_iInterval = window.setInterval(() => {
this.setState((e) => ({ cSeconds: e.cSeconds + 1 }));
}, 1e3);
}
componentWillUnmount() {
window.clearInterval(this.m_iInterval);
}
render() {
return I.createElement($.II, { value: this.state.cSeconds, disabled: !0, label: "COUNTER" });
}
}
class se extends I.Component {
OnCMToggled(e) {
e ? window.localStorage.setItem(J, "true") : window.localStorage.removeItem(J), this.forceUpdate();
}
OnStickyContextMenuToggle(e) {
(0, W.kl)(e), this.forceUpdate();
}
render() {
return I.createElement(I.Fragment, null, I.createElement($.uT, null, I.createElement($.gE, { label: '"Sticky" Context Menus', description: "Context menus will stay open to allow inspecting CSS", checked: (0, W.BY)(), onChange: this.OnStickyContextMenuToggle }), I.createElement($.gE, { label: "Log all CM Traffic", description: "All messages to and from the steam servers will be logged to the browser console (F12)", checked: window.localStorage && "true" == window.localStorage.getItem(J), onChange: this.OnCMToggled })));
}
}
(0, i.gn)([M.ak], se.prototype, "OnCMToggled", null), (0, i.gn)([M.ak], se.prototype, "OnStickyContextMenuToggle", null);
class le extends I.Component {
constructor(e) {
super(e), (this.state = { searchString: "" });
}
OnSearchInput(e) {
e.currentTarget.value != this.state.searchString && this.setState({ searchString: e.currentTarget.value });
}
render() {
let e,
t = new ne.NX();
e = "" == this.state.searchString ? d.Ul.FriendStore.self.steamid.GetAccountID() : this.state.searchString;
let n = new ne.rO(d.Ul.FriendStore.GetPlayer(+e));
return (
(t.hover = n),
(t.visible = !0),
n.data_loader.EnsureCommunityDataLoaded(),
I.createElement(
$.l0,
{ className: "DialogBody" },
I.createElement($.Uq, null, I.createElement("div", { style: { flex: 1 } }, I.createElement($.__, null, "Old Throbber"), I.createElement("div", { className: "LoadingWrapper" }, I.createElement("div", { className: "LoadingThrobber" }, I.createElement("div", { className: "Bar Bar1" }), I.createElement("div", { className: "Bar Bar2" }), I.createElement("div", { className: "Bar Bar3" })), I.createElement("div", { className: "LoadingText" }))), I.createElement("div", { style: { flex: 2 } }, I.createElement($.__, null, "New Throbber (W.I.P.)"), I.createElement("div", { className: "displayRow" }, I.createElement(ee.V, { size: "xlarge", string: "X-Large" }), I.createElement(ee.V, { size: "large", string: "Large" }), I.createElement(ee.V, { size: "medium", string: "Medium" }), I.createElement(ee.V, { size: "small", string: "Small" })))),
I.createElement($.uT, null, I.createElement($.__, null, "Miniprofile Tester:"), I.createElement("form", null, I.createElement("input", { className: "friendSearchInput", type: "text", name: "memberlistSearch", placeholder: "Enter SteamID", value: this.state.searchString, onInput: this.OnSearchInput, autoComplete: "off" })), I.createElement("div", { className: "fakeMiniProfile", style: { zIndex: 5 } }, I.createElement(te.Q5, { hoverInstance: t })), I.createElement(gt, { friend: d.Ul.FriendStore.GetPlayer(+e), context: null })),
)
);
}
}
(0, i.gn)([M.ak], le.prototype, "OnSearchInput", null);
var ce = n(70215),
me = n(55948),
de = n(88991),
he = n(62902);
class ue extends I.Component {
constructor(e) {
super(e);
}
static Posts() {
return [
{ date: "2019-05-17", content: I.createElement("div", { className: "changeLogDescription" }, I.createElement("div", { className: "changeLogItem" }, (0, A.kQ)("#changeLog_UpdateItem77", I.createElement("a", { target: "_blank", href: "https://play.google.com/store/apps/details?id=com.valvesoftware.android.steam.friendsui" }, "Android"), I.createElement("a", { target: "_blank", href: "https://itunes.apple.com/app/steam-chat/id1434890245" }, "iOS")))) },
{ date: "2019-05-01", content: I.createElement("div", { className: "changeLogDescription" }, I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem76"))) },
{ date: "2019-04-24", content: I.createElement("div", { className: "changeLogDescription" }, I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem75"))) },
{ date: "2019-04-17", content: I.createElement("div", { className: "changeLogDescription" }, I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem72")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem73")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem74"))) },
{ date: 1532044800, content: I.createElement("div", { className: "changeLogDescription" }, I.createElement("div", { className: "changeLogItem" }, (0, A.kQ)("#changeLog_UpdateItem71", I.createElement("b", null, (0, A.Xx)("#changeLog_Note"))))) },
{ date: 1531443600, content: I.createElement("div", { className: "changeLogDescription" }, I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem68")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem69")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem70"))) },
{
date: 1531263600,
content: I.createElement(
"div",
{ className: "changeLogDescription" },
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem47")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem58")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem59")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem60")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem48")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem49")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem63")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem50")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem51")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem53")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem52")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem61")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem62")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem64")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem65")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem66")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem67")),
),
},
{ date: 1531162800, content: I.createElement("div", { className: "changeLogDescription" }, I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem54")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem55"))) },
{ date: 1530298800, content: I.createElement("div", { className: "changeLogDescription" }, I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem56")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem57"))) },
{
date: 1530126e3,
content: I.createElement(
"div",
{ className: "changeLogDescription" },
I.createElement("div", { className: "changeLogItemSubHeader" }, (0, A.Xx)("#changeLog_UpdateItem_Permissions")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem39")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem40")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem41")),
I.createElement("div", { className: "changeLogItemSubHeader" }, (0, A.Xx)("#changeLog_UpdateSubHeader_General")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem45")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem30"), I.createElement("div", { style: { marginTop: "4px" } }, I.createElement("span", { style: { fontWeight: "bold", fontStyle: "italic" } }, (0, A.Xx)("#changeLog_Note")), I.createElement("span", { style: { fontStyle: "italic" } }, (0, A.Xx)("#changeLog_UpdateItem30_Note")))),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem29")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem25")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem26")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem38")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem31")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem42")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem28")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem27")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem33")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem32")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem34"), I.createElement("div", { style: { marginTop: "4px" } }, I.createElement("span", { style: { fontWeight: "bold", fontStyle: "italic" } }, (0, A.Xx)("#changeLog_Note")), I.createElement("span", { style: { fontStyle: "italic" } }, (0, A.Xx)("#changeLog_UpdateItem34_Note")))),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem35")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem36")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem37")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem43")),
I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem44")),
),
},
{ date: 1529528400, content: I.createElement("div", { className: "changeLogDescription" }, I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem20")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem21")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem22")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem23")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem24"))) },
{ date: 1529456400, content: I.createElement("div", { className: "changeLogDescription" }, I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem17")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem18")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem15")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem16")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem12")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem13")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem14")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem19"))) },
{ date: 1529017200, content: I.createElement("div", { className: "changeLogDescription" }, I.createElement("div", { className: "changeLogItemSubHeader" }, (0, A.Xx)("#changeLog_UpdateSubHeader_General")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem11")), I.createElement("div", { className: "changeLogItemSubHeader" }, (0, A.Xx)("#changeLog_UpdateSubHeader_Linux")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem10")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem09"))) },
{ date: 1528938e3, content: I.createElement("div", null, I.createElement("div", { className: "changeLogExtra" }, (0, A.Xx)("#changeLog_UpdateExtraInfo01")), I.createElement("div", { className: "changeLogDescription" }, I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem02")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem03")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem04")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem05")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem06")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem07")), I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem08")))) },
{ date: 1528923600, content: I.createElement("div", { className: "changeLogDescription" }, I.createElement("div", { className: "changeLogItem" }, (0, A.Xx)("#changeLog_UpdateItem01"))) },
];
}
PostDate(e) {
let t, n;
t = "string" == typeof e ? new Date(e) : d.Ul.RTime32ToDate(e);
return (n = t.toLocaleDateString(A.Yt.GetPreferredLocales(), { weekday: "long", year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric" })), n;
}
render() {
return I.createElement(
I.Fragment,
null,
ue.Posts().map((e) => I.createElement("div", { key: e.date }, I.createElement("div", { className: "changeLogTitle" }, (0, A.Xx)("#changeLog_GenericUpdateTitle")), I.createElement("div", { className: "changeLogDate" }, this.PostDate(e.date)), e.content)),
);
}
}
(0, i.gn)([M.ak], ue.prototype, "PostDate", null);
class pe extends I.Component {
constructor(e) {
super(e);
}
render() {
return I.createElement(Q.e1, { onEscKeypress: this.props.closeModal }, I.createElement($.VY, { className: "changeLogPage" }, I.createElement($.h4, null, (0, A.Xx)("#changeLog_Title")), I.createElement($.uT, null, I.createElement($.Ac, null, (0, A.Xx)("#changeLog_SubTitle")), I.createElement($.HV, { className: "changeLogDetails" }, I.createElement(ue, null))), I.createElement($.$_, null, I.createElement($.KM, { onClick: this.props.closeModal }, (0, A.Xx)("#Button_Close")))));
}
}
var _e = n(93635),
ge = n(3571),
Ce = n(87018),
fe = n(31695),
ve = n(94357),
Se = n(69807),
be = n(70532),
Ie = n(56320),
ye = n(62860),
Ee = n(55981),
De = n(46313),
we = n(55937),
Re = n(96119),
Ae = n(6708),
Me = n(89554);
let ke = class extends I.Component {
render() {
const e = d.Ul.ChatStore.GetRecentChats(),
t = { bGranularToday: !0, bGranularYesterday: !0, bGranularTodayTimeOnly: !0, bGranularWeek: !0, bAbbreviateDayOfWeek: !0, bForce24HourClock: d.Ul.SettingsStore.FriendsSettings.b24HourClock };
return I.createElement(
"div",
{ className: Ae.RecentChatsList },
e.map((e, n) => {
if (e instanceof l.a) {
const i = e,
o = i.GetMember(i.accountid_partner);
let r;
i.unread_message_count > 0 && (r = I.createElement("div", { key: "FriendMessageCount", className: "FriendMessageCount" }, i.unread_message_count));
let a = I.createElement("div", { key: "RecentTime", className: Ae.Time }, (0, Me.jr)(i.time_last_message, t));
return I.createElement(gt, { friend: o, key: n, className: (0, Ce.Z)(Ae.RecentChatElement, i.unread_message_count > 0 && "unreadFriend"), context: { chat: i, chatContext: "recentchats" }, bHideStatus: !0, bHideGameName: !0, bInGameIcon: !0, lastChat: i, statusPosition: "right", listStatusIndicator: [r, a] });
}
{
const i = e,
o = i.GetRoomWithLastMessageForUser();
let r;
i.hasUnreadChatMessage && (r = I.createElement("div", { key: "FriendMessageCount", className: (0, Ce.Z)("FriendMessageCount", i.HasUnreadMention && "HasUnreadMention") }, i.HasUnreadMention ? "@" : "!"));
let a = o ? I.createElement("div", { key: "RecentTime", className: Ae.Time }, (0, Me.jr)(o.time_last_message, t)) : void 0;
return I.createElement(C.wm, { key: n, className: Ae.RecentChatElement, group: i, bShowLastChat: !0, bHideUnreadMention: !0, additionalElements: [a, r] });
}
}),
);
}
};
ke = (0, i.gn)([S.Pi], ke);
var Te = n(92883),
Le = n(70756);
var Ge,
Oe = n(10553),
Fe = n(89051),
Be = n(99643);
let xe = class extends I.Component {
constructor(e) {
super(e);
}
render() {
let e = this.props.chat.VoiceChatStore.HasBeenAttemptingOverTwoSeconds(),
t = this.props.chat.VoiceChatStore.IsAttemptingReconnect();
return I.createElement("div", { className: "connectionStatusLabels" }, e && I.createElement("div", { className: "connectionStatus" }, I.createElement("a", { title: (0, A.Xx)("#VoiceChatConnectingHelp"), className: "connectionStatus", target: "_blank", href: "https://support.steampowered.com/kb_article.php?ref=2598-RTZB-6114" }, (0, A.Xx)("#VoiceChatConnecting"))), t && I.createElement("div", { className: "connectionStatus" }, I.createElement("a", { className: "connectionStatus", target: "_blank", href: "https://support.steampowered.com/kb_article.php?ref=2598-RTZB-6114" }, (0, A.Xx)("#VoiceChatReconnecting"))));
}
};
xe = (0, i.gn)([S.Pi], xe);
let Ne = class extends I.Component {
render() {
let e = this.props.chats.GetActiveVoiceChat();
return this.props.chats.VoiceChat.IsAnyVoiceActive() && e ? I.createElement(Pe, { chat: e, name: this.props.chats.GetActiveVoiceChannelName(), nostatus: !1 }) : I.createElement("div", { className: "activeVoiceControls" }, I.createElement("div", { className: "buttonsContainer" }, I.createElement("div", { className: "activeVoiceFlexBox" }, I.createElement("div", { className: "activeVoiceLabels" }, I.createElement("div", { className: "activeVoiceHeader" }, (0, A.Xx)("#ActiveVoiceChat")), I.createElement("div", { className: "activeVoiceName" })), I.createElement(E.s, { className: "activeVoiceButtons", "flow-children": "row" }, I.createElement(Ue, null), I.createElement(Ve, null), I.createElement("div", { className: "activeVoiceButtonsSpacer" }), I.createElement(He, null), I.createElement("div", { className: "activeVoiceButtonsSpacerAfter" })))));
}
};
Ne = (0, i.gn)([S.Pi], Ne);
let Pe = class extends I.Component {
constructor(e) {
super(e);
}
ActivateActiveVoiceChat(e) {
if (this.props.chat instanceof a.K) {
let t = d.Ul.ChatStore.GetChatRoomGroup(this.props.chat.GetParentGroupID());
if (t) return void d.Ul.UIStore.ShowAndOrActivateChatRoomGroup((0, m.Um)(this, e), t, !0);
}
d.Ul.UIStore.ShowAndOrActivateChat((0, m.Um)(this, e), this.props.chat, !0);
}
render() {
let e = d.Ul.VoiceStore.GetPushToTalkEnabled(),
t = d.Ul.VoiceStore.GetPushToMuteEnabled(),
n = d.Ul.VoiceStore.GetPushToTalkVoiceStateEnabled(),
i = d.Ul.VoiceStore.GetPushToTalkHotKeyDisplayString(),
o = "";
return (
(e || t) && (o += " pushToTalkEnabled"),
n && (o += " pushToTalkKeyDown"),
I.createElement(
"div",
{ className: "activeVoiceControls" + o },
I.createElement("div", { className: "buttonsContainer" }, I.createElement("div", { className: "activeVoiceFlexBox" }, I.createElement("div", { className: "activeVoiceLabels" }, I.createElement("div", { className: "activeVoiceHeader" }, (0, A.Xx)("#ActiveVoiceChat")), I.createElement("div", { className: "activeVoiceName", onClick: this.ActivateActiveVoiceChat }, this.props.name)), I.createElement(E.s, { className: "activeVoiceButtons", "flow-children": "row" }, I.createElement(Ue, null), I.createElement(Ve, null), I.createElement("div", { className: "activeVoiceButtonsSpacer" }), I.createElement(He, null), I.createElement("div", { className: "activeVoiceButtonsSpacerAfter" }))), !this.props.nostatus && I.createElement(xe, { chat: this.props.chat })),
(e || t) && I.createElement("div", { className: "activeVoicePushToTalk" + o }, (0, A.Xx)(t ? "#ActiveVoicePushToMute" : "#ActiveVoicePushToTalk", i)),
)
);
}
};
(0, i.gn)([M.ak], Pe.prototype, "ActivateActiveVoiceChat", null), (Pe = (0, i.gn)([S.Pi], Pe));
let Ue = class extends I.Component {
ToggleMicrophone(e) {
d.Ul.VoiceStore.IsMicMuted() && d.Ul.VoiceStore.IsOutputMuted() && d.Ul.VoiceStore.ToggleOutputMuting(), d.Ul.VoiceStore.ToggleMicMuting(), e.stopPropagation();
}
render() {
let e = d.Ul.VoiceStore.BNoMicAvailableForSession(),
t = d.Ul.VoiceStore.BHasSampleRateTooHighInBrowser(),
n = d.Ul.VoiceStore.IsMicMuted(),
i = "VoiceControlPanelButton ToggleMicrophoneButton",
o = "";
return (o = n ? (0, A.Xx)("#VoiceChat_UnmuteMic") : (0, A.Xx)("#VoiceChat_MuteMic")), e && ((i += " NoMicrophone"), (o = t ? (0, A.Xx)("#VoiceChat_ChromeSampleRateTooHighMicExplainer") : (0, A.Xx)("#VoiceChat_DeniedMicrophoneAccess"))), n && (i += " disabled"), I.createElement(Ie.wl, { className: i, onClick: this.ToggleMicrophone, onOKActionDescription: o, title: o }, I.createElement("div", { className: "VoiceIconCtn" }, n || e ? I.createElement(X.JgI, { off: !0 }) : I.createElement(X.JgI, null)));
}
};
(0, i.gn)([M.ak], Ue.prototype, "ToggleMicrophone", null), (Ue = (0, i.gn)([S.Pi], Ue));
let Ve = class extends I.Component {
ToggleVoiceOutput(e) {
d.Ul.VoiceStore.IsOutputMuted() == d.Ul.VoiceStore.IsMicMuted() && d.Ul.VoiceStore.ToggleMicMuting(), d.Ul.VoiceStore.ToggleOutputMuting(), e.stopPropagation();
}
render() {
let e = d.Ul.VoiceStore.IsOutputMuted(),
t = "VoiceControlPanelButton ToggleVoiceOutputButton";
e && (t += " disabled");
let n = "";
return (n = e ? (0, A.Xx)("#VoiceChat_UnmuteSpeaker") : (0, A.Xx)("#VoiceChat_MuteSpeaker")), I.createElement(Ie.wl, { className: t, onClick: this.ToggleVoiceOutput, onOKActionDescription: n, title: n }, I.createElement("div", { className: "VoiceIconCtn" }, e ? I.createElement(X.bpe, { off: !0 }) : I.createElement(X.bpe, null), " "));
}
};
(0, i.gn)([M.ak], Ve.prototype, "ToggleVoiceOutput", null), (Ve = (0, i.gn)([S.Pi], Ve));
let He = class extends I.Component {
EndVoiceChat(e) {
d.Ul.VoiceStore.OnUserEndVoiceChat(), e.stopPropagation();
}
render() {
return I.createElement(Ie.wl, { className: "VoiceControlPanelButton chatEndVoiceChat", onClick: this.EndVoiceChat, title: (0, A.Xx)("#VoiceChat_Leave"), onOKActionDescription: (0, A.Xx)("#VoiceChat_Leave") }, I.createElement("div", { className: "VoiceIconCtn" }, I.createElement(X.xsH, null)));
}
};
(He.contextType = o.E_), (0, i.gn)([M.ak], He.prototype, "EndVoiceChat", null), (He = (0, i.gn)([S.Pi], He));
class We extends I.Component {
constructor(e) {
super(e);
}
GetNormalizedSearchString() {
return this.state.searchString && this.state.searchString.trim().toLocaleLowerCase();
}
}
const Xe = (e) => {
e.fnOnToggleViewingIncomingInvites;
let [t, n] = I.useState(d.Ul.UIStore.FriendsListSteamDeckActiveTab),
i = I.useRef(d.Ul.UIStore.FriendsListSteamDeckActiveTab),
[o] = I.useState(new Map());
I.useEffect(() => {
e.rgTabs.forEach((e) => {
o.set(e.eTab, I.createRef());
});
}, [e, o]),
I.useEffect(() => {
var e;
if (t != i.current) {
let n = o.get(i.current),
r = o.get(t);
(null === (e = n.current) || void 0 === e ? void 0 : e.BFocusWithin()) && r.current && r.current.TakeFocus(), (i.current = t);
}
}, [t, o]);
const r = I.useCallback(
(e, t) => {
n(t), (i.current = e);
},
[n, i],
);
(0, M.Qg)(d.Ul.UIStore.FriendsListSteamDeckActiveTabCallbackList(), r);
const a = I.useCallback((e) => {
d.Ul.UIStore.FriendsListSteamDeckActiveTab = e;
}, []),
s = (e) => {
d.Ul.UIStore.SelectFriendsListSteamDeckSiblingTab(e);
};
let l = (0, b.SZ)(() => d.Ul.FriendStore.GetPendingInviteCount());
const c = () => {
SteamClient.Messaging.PostMessage("FriendsUI", "NavigateToInvites", "{}");
};
return I.createElement(
I.Fragment,
null,
I.createElement(
"div",
{ className: "FriendsListSteamDeckTopSection" },
I.createElement(
"div",
{ className: "TabPanelHeader" },
e.rgTabs[t].strTabContentTitle,
t == Re.ou.FriendsList && I.createElement(E.s, { className: "FriendActionsContainer" }, l > 0 && I.createElement(E.s, { onActivate: c, onOKActionDescription: (0, A.Xx)("#Menu_FriendInvites"), focusable: !0, className: "FriendsInvitesButton" }, I.createElement(X.Fsn, { bShowArm: !0 }), I.createElement("div", { className: "PendingInviteCount" }, l)), I.createElement(E.s, { onActivate: c, onOKActionDescription: (0, A.Xx)("#FriendInviteLink_AddFriend"), focusable: !0, className: "friendListButton AddFriendButton" }, I.createElement(X.yBp, null))),
t == Re.ou.GroupChats &&
I.createElement(
E.s,
{ className: "FriendActionsContainer" },
I.createElement(
E.s,
{
onActivate: (e) => {
let t = R.RA(e);
(0, q.bI)((0, m.rb)(t), t);
},
onOKActionDescription: (0, A.Xx)("#Chat_CreateGroupChat"),
focusable: !0,
className: "NewChatGroupButton",
},
I.createElement(X.hxK, null),
),
),
),
I.createElement(
E.s,
{ className: "FriendsListSteamDeckTabs", "flow-children": "row", navEntryPreferPosition: ye.c4.PREFERRED_CHILD },
I.createElement(E.s, { className: (0, Ce.Z)(ve.TabBumper, ve.Previous), onActivate: () => s(-1), focusable: !1 }, I.createElement(we.VC, { button: De.FX.LeftBumper, type: we.yV.Dark })),
e.rgTabs.map((e, n) => I.createElement(Ke, { key: n, navRef: o.get(e.eTab), tab: e.eTab, activeTab: t, preferredFocus: e.eTab == t, onFocus: () => a(e.eTab), fnSetActiveTab: a }, e.tabElement)),
I.createElement(E.s, { className: (0, Ce.Z)(ve.TabBumper, ve.Next), onActivate: () => s(1), focusable: !1 }, I.createElement(we.VC, { button: De.FX.RightBumper, type: we.yV.Dark })),
),
),
I.createElement(ze, { rgTabs: e.rgTabs, activeTab: t }),
);
},
je = (e, t) => {
let n;
switch (e) {
case Re.ou.Favorites:
n = "FavoritesTabList";
break;
case Re.ou.FriendsList:
n = "FriendsTabList";
break;
case Re.ou.GroupChats:
n = "GroupsTabList";
break;
case Re.ou.RecentMessages:
n = "RecentMessagesTabList";
break;
default:
n = "TabList";
}
return (0, Ce.Z)(n, e < t ? "beforeActiveTab" : e == t ? "" : "afterActiveTab");
};
function ze(e) {
const { rgTabs: t, activeTab: n } = e,
i = I.useRef(n),
o = (0, $.Do)().bQuickAccessMenu,
r = I.useRef(),
a = I.useRef();
return (
(0, I.useEffect)(() => {
var e;
i.current !== n && (null === (e = r.current) || void 0 === e ? void 0 : e.BFocusWithin()) && a.current && a.current.TakeFocus(), (i.current = n);
}, [n]),
I.createElement(
E.s,
{ className: (0, Ce.Z)("FriendsListTabPanelContainer", o && "QuickAccess"), fnScrollIntoViewHandler: () => null },
t.map((e) => {
const t = e.eTab === n,
o = e.eTab === i.current,
s = t ? a : o ? r : null;
return I.createElement(qe, { className: je(e.eTab, n), key: e.eTab, navRef: s, bActiveTab: t }, e.tabContentElement);
}),
)
);
}
const Ke = I.forwardRef(function (e, t) {
let { tab: n, activeTab: o, fnSetActiveTab: r } = e,
a = (0, i._T)(e, ["tab", "activeTab", "fnSetActiveTab"]);
const s = n == o;
return I.createElement(
E.s,
Object.assign(
{
focusable: !0,
onActivate: () => {
s || r(n);
},
className: (0, Ce.Z)("FriendsListTab", s && "Active"),
},
a,
{ ref: t },
),
);
}),
qe = I.forwardRef(function (e, t) {
let { bActiveTab: n, className: o, navRef: r, children: a } = e,
s = (0, i._T)(e, ["bActiveTab", "className", "navRef", "children"]);
const { refNav: l, bShouldMount: c } = (function (e, t) {
const n = I.useRef(),
i = I.useRef(),
o = I.useRef(),
r = I.useRef(),
a = (0, ie.B)(e, t);
return (
I.useEffect(() => {
if (!e && a) n.current && (o.current = { scrollTop: n.current.scrollTop, scrollLeft: n.current.scrollLeft }), i.current && (r.current = i.current.GetFocusSnapshot());
else if (e && !a) {
if (n.current && o.current) {
const { scrollTop: e, scrollLeft: t } = o.current;
(o.current = void 0),
window.setTimeout(() => {
(n.current.scrollTop = e), (n.current.scrollLeft = t);
}, 1);
}
i.current && r.current && (i.current.RestoreFocusSnapshot(r.current, 2), (r.current = void 0));
}
}, [e, a]),
{ bShouldMount: a || e, refNav: i, refScroll: n }
);
})(!0, 3e5),
m = (0, M.BE)(l, r);
return I.createElement(E.s, Object.assign({ navRef: m, className: (0, Ce.Z)(o, "FriendsListTabPanel", n && "Active"), fnCanTakeFocus: () => n }, s, { ref: t }), c && a);
});
function Ze() {
let e = !1,
t = (0, b.SZ)(() => {
let t = 0;
const n = d.Ul.ChatStore.GetRecentChats();
for (const i of n)
if (i instanceof l.a) {
const e = i;
e.unread_message_count > 0 && (t += e.unread_message_count);
} else if (i instanceof r.PR) {
e || (e = i.HasUnreadMention);
i.hasUnreadChatMessage && t++;
}
return t;
}),
n = 1 == t && e,
i = t < 100 && !(e && 1 == t),
o = n ? "@" : "!";
return I.createElement("div", { className: (0, Ce.Z)(ve.RecentChatIcon, n && ve.NotificationUnreadMention) }, I.createElement(X.fHW, null), t > 0 && I.createElement("div", { className: ve.UnreadAlert }, i ? t : o));
}
let Qe = class extends We {
constructor(e) {
super(e), (this.m_navRef = null), (this.state = { searchString: "", bFriendTabSearch: !1, bViewingIncomingInvites: !1, tabLabelWidth: 0 }), (this.m_navRef = I.createRef());
}
componentDidMount() {
const e = this.props.friends.FavoritesStore.favorites;
(d.Ul.UIStore.FriendsListSteamDeckActiveTab = e.length ? Re.ou.Favorites : Re.ou.FriendsList), (this.m_fnUnregisterMessages = SteamClient.Messaging.RegisterForMessages("FriendsList", this.OnMessage));
}
componentWillUnmount() {
this.m_fnUnregisterMessages && this.m_fnUnregisterMessages.unregister();
}
OnMessage(e, t, n) {
"FriendsList" == e && "ShowInvitesList" == t && ((d.Ul.UIStore.FriendsListSteamDeckActiveTab = Re.ou.FriendsList), this.SetInviteListVisibility(!0));
}
OnSearchSelection() {
this.setState({ searchString: "" });
}
StartSearchOnKeyPress(e) {}
SetInviteListVisibility(e) {
this.setState({ bViewingIncomingInvites: e }, () => {
this.state.bViewingIncomingInvites && (d.Ul.FriendStore.FriendGroupStore.EnsureMutualFriendsForIncomingInvites(), d.Ul.FriendStore.ClanStore.EnsureInitialStateForClanInvites());
});
}
ToggleViewingIncomingInvites() {
this.SetInviteListVisibility(!this.state.bViewingIncomingInvites);
}
TakeFocus() {
this.m_navRef.current.TakeFocus();
}
render() {
let e = this.GetNormalizedSearchString(),
t = "friendRequestButton";
this.state.bViewingIncomingInvites;
let n = "friendTab socialListTab activeTab";
this.state.bFriendTabSearch;
this.state.tabLabelWidth > 0 && this.state.tabLabelWidth;
let i = !1;
if (this.props.popup) {
let e = (0, m.rb)(this.props.popup);
i = !(0, d.ns)(e, d.D);
}
let o = !1,
r = 0,
a = !1,
s = "friendListButton friendSettingsButton friendsListNeedsUpdate no-drag";
null != m.g_FriendsUIDesktopApp && ((o = m.g_FriendsUIDesktopApp.BNeedsUpdate()), (r = m.g_FriendsUIDesktopApp.GetSecondsOutOfDate()), r < 432e3 ? (o = !1) : r > 604800 && ((s += " friendsListVeryOutOfDate"), (a = !0)));
let l = "friendlist GamepadMode";
this.props.bQuickAccess || (l += " FriendsListAnchored"), this.state.bViewingIncomingInvites && (l += " FriendRequestViewActive");
const c = [
{ eTab: Re.ou.Favorites, strTabContentTitle: (0, A.Xx)("#FriendGroup_Favorites"), tabElement: I.createElement(X.Fyr, null), tabContentElement: I.createElement(L, { FavoritesStore: this.props.friends.FavoritesStore }) },
{ eTab: Re.ou.FriendsList, strTabContentTitle: (0, A.Xx)("#Label_Friends"), tabElement: I.createElement(X.Fsn, { bShowArm: this.state.bViewingIncomingInvites }), tabContentElement: I.createElement(rt, { friends: this.props.friends, chats: this.props.chats, searchString: e, fnOnSearchSelection: this.OnSearchSelection, onStartSearch: this.StartSearchOnKeyPress, browserContext: this.props.browserContext, bViewingIncomingInvites: this.state.bViewingIncomingInvites, bHideGroupChats: !0, onClose: this.ToggleViewingIncomingInvites }) },
{ eTab: Re.ou.GroupChats, strTabContentTitle: (0, A.Xx)("#Label_Groups"), tabElement: I.createElement(X.ZAu, null), tabContentElement: I.createElement(at, { friends: this.props.friends, chats: this.props.chats }) },
{ eTab: Re.ou.RecentMessages, strTabContentTitle: (0, A.Xx)("#FriendGroup_Recent"), tabElement: I.createElement(Ze, null), tabContentElement: I.createElement(ke, null) },
];
return I.createElement(
E.s,
{
className: l,
"flow-children": "column",
onButtonDown: (e) => {
const t = e.detail.button;
t == Ee.eV.BUMPER_LEFT ? (d.Ul.UIStore.SelectFriendsListSteamDeckSiblingTab(-1), e.stopPropagation()) : t == Ee.eV.BUMPER_RIGHT && (d.Ul.UIStore.SelectFriendsListSteamDeckSiblingTab(1), e.stopPropagation());
},
navRef: this.m_navRef,
},
I.createElement("div", { className: (0, Ce.Z)("friendListHeaderContainer", "titleBarContainer", (0, Oe.Uy)() && "OSX") }, I.createElement("div", { className: "disconnectBlocker" })),
I.createElement(Xe, { friends: this.props.friends, rgTabs: c, fnOnToggleViewingIncomingInvites: this.ToggleViewingIncomingInvites }),
);
}
};
(0, i.gn)([M.ak], Qe.prototype, "OnMessage", null), (0, i.gn)([M.ak], Qe.prototype, "OnSearchSelection", null), (0, i.gn)([M.ak], Qe.prototype, "StartSearchOnKeyPress", null), (0, i.gn)([M.ak], Qe.prototype, "SetInviteListVisibility", null), (0, i.gn)([M.ak], Qe.prototype, "ToggleViewingIncomingInvites", null), (Qe = (0, i.gn)([S.Pi], Qe));
class $e extends I.Component {
constructor(e) {
super(e), (this.m_friendsListRef = null), (this.m_friendsListRef = I.createRef());
}
render() {
let e = d.Ul.UIStore.GetDefaultTabSetForContext(this.props.browserContext);
return I.createElement(
E.s,
{
className: "FriendsListAndChatsSteamDeck",
"flow-children": "row",
onButtonDown: (e) => {
const t = e.detail.button;
t == Ee.eV.BUMPER_LEFT ? (d.Ul.UIStore.SelectFriendsListSteamDeckSiblingTab(-1), e.stopPropagation()) : t == Ee.eV.BUMPER_RIGHT && (d.Ul.UIStore.SelectFriendsListSteamDeckSiblingTab(1), e.stopPropagation());
},
},
I.createElement(Qe, { ref: this.m_friendsListRef, bQuickAccess: !1, friends: this.props.friends, chats: this.props.chats, browserContext: this.props.browserContext, collapsed: !1 }),
I.createElement(E.s, { className: "SteamDeckChats" }, I.createElement(N.CT, { tabs: e, ResponsiveWindowState: null })),
d.Ul.CMInterface.BDisconnected() && I.createElement("div", { className: "FriendsDataOutofDate" }, I.createElement("div", null, I.createElement(j.$jN, null), (0, A.Xx)("#Friends_Reconnecting_Msg"))),
);
}
}
let Ye = class extends We {
constructor(e) {
super(e), (this.state = { searchString: "", bFriendTabSearch: !1, bViewingIncomingInvites: !1, tabLabelWidth: 0 }), (this.m_tabLabelWidth = -1);
}
OnSearchInputRef(e) {
this.m_refSearchInput = e;
}
StartSearchOnKeyPress(e) {
let t = this.state.bFriendTabSearch;
this.setState({ bFriendTabSearch: !0 }), t && this.m_refSearchInput && this.m_refSearchInput.focus();
}
OnSearchInput(e) {
e.currentTarget.value != this.state.searchString && this.setState({ searchString: e.currentTarget.value });
}
OnSearchSubmit(e) {
e.preventDefault();
let t = this.GetNormalizedSearchString();
if (t && t.length) {
let n = this.props.friends.FriendGroupStore.all_friends.GetMembersMatchingSearch(t);
n.length && n[0].OpenChatDialog((0, m.Um)(this, e));
}
this.setState({ searchString: "" });
}
OnSearchSelection() {
this.setState({ searchString: "" });
}
OnSearchKeyDown(e) {
27 == e.keyCode && (this.setState({ searchString: "" }), e.preventDefault(), e.currentTarget.blur(), this.setState({ bFriendTabSearch: !1 }), this.CollapseTabLabel());
}
OnClearSearch() {
this.setState({ searchString: "" }), this.OnTabSearchClick();
}
OnSettingsClick(e) {
d.Ul.IsDesktopUIActive() ? SteamClient.URL.ExecuteSteamURL("steam://open/settings/friends") : (0, Z.L)((0, m.Um)(this, e), e.currentTarget.ownerDocument.defaultView);
}
ToggleCollapseExpand(e) {
d.Ul.UIStore.SetFriendsListCollapsed((0, m.Um)(this, e), !this.props.collapsed);
}
OnDoFriendsListUpdate(e) {
let t = e.currentTarget.ownerDocument.defaultView,
n = m.g_FriendsUIDesktopApp.GetSecondsOutOfDate(),
i = (0, A.yW)(n, !0);
(0, u.p3)(t, (0, A.Xx)("#Friends_ConfirmUpdate_Title"), (0, A.Xx)("#Friends_ConfirmUpdate_Body", i), (0, A.Xx)("#Friends_ConfirmUpdate_Ok"))
.then(() => {
m.g_FriendsUIDesktopApp.PerformFriendsUIUpdate();
})
.catch(() => {});
}
BindTabLabel(e) {
(this.m_elTabLabel = e), this.UpdateWindowIcon();
}
UpdateWindowIcon() {
if (this.m_elTabLabel && void 0 !== this.m_elTabLabel.ownerDocument.defaultView.SteamClient) {
let e = !1;
this.props.chats.VoiceChat.IsAnyVoiceActive() && (e = !0);
let t = this.props.chats.FriendChatStore.GetFriendsWithUnreadMessages(this.props.browserContext).length > 0;
try {
this.m_elTabLabel && null != this.m_elTabLabel.ownerDocument.defaultView.SteamClient.Window.SetWindowIcon && (e ? this.m_elTabLabel.ownerDocument.defaultView.SteamClient.Window.SetWindowIcon("voice") : t ? this.m_elTabLabel.ownerDocument.defaultView.SteamClient.Window.SetWindowIcon("messages") : this.m_elTabLabel.ownerDocument.defaultView.SteamClient.Window.SetWindowIcon("steam"));
} catch (e) {}
}
}
CollapseTabLabel() {
if ((this.m_animationTabLabelCollapse && this.m_animationTabLabelCollapse.Cancel(), this.state.bFriendTabSearch)) {
let e = 1,
t = this.m_tabLabelWidth;
this.setState({ tabLabelWidth: e }, () => {
(this.m_animationTabLabelCollapse = new z.P(this, { tabLabelWidth: t }, { msDuration: 300, timing: "sine" })), this.m_animationTabLabelCollapse.Start();
});
} else {
let e = this.m_tabLabelWidth,
t = 1;
this.setState({ tabLabelWidth: e }, () => {
(this.m_animationTabLabelCollapse = new z.P(this, { tabLabelWidth: t }, { msDuration: 300, timing: "sine" })), this.m_animationTabLabelCollapse.Start();
});
}
}
OnTabSearchClick() {
this.m_tabLabelWidth < 0 && (this.m_tabLabelWidth = this.m_elTabLabel.clientWidth), this.setState({ bFriendTabSearch: !this.state.bFriendTabSearch }), this.CollapseTabLabel();
}
ToggleViewingIncomingInvites() {
this.setState({ bViewingIncomingInvites: !this.state.bViewingIncomingInvites }, () => {
this.state.bViewingIncomingInvites && (d.Ul.FriendStore.FriendGroupStore.EnsureMutualFriendsForIncomingInvites(), d.Ul.FriendStore.ClanStore.EnsureInitialStateForClanInvites());
});
}
SignIn() {
window.parent.postMessage({ message: "SignInRequest", state: void 0 }, "https://steamloopback.host");
}
componentDidUpdate() {
if (this.state.bViewingIncomingInvites) {
let e = d.Ul.FriendStore.GetFriendInviteCount() > 0,
t = d.Ul.FriendStore.GetClanInviteCount() > 0,
n = d.Ul.FriendStore.GetOutgoingFriendRequestCount() > 0;
e || t || n || this.setState({ bViewingIncomingInvites: !1 });
}
}
render() {
let e = this.props.friends.self,
t = this.GetNormalizedSearchString(),
n = this.state.bFriendTabSearch,
i = "friendTab socialListTab activeTab";
n && (i += " TabSearchActive");
let r = {};
this.state.tabLabelWidth > 0 && (r.width = this.state.tabLabelWidth + "px");
let a = !1;
if (this.props.popup) {
let e = (0, m.rb)(this.props.popup);
a = !(0, d.ns)(e, d.D);
}
let s = !1,
l = 0,
c = !1,
h = "friendListButton friendSettingsButton friendsListNeedsUpdate no-drag";
null != m.g_FriendsUIDesktopApp && ((s = m.g_FriendsUIDesktopApp.BNeedsUpdate()), (l = m.g_FriendsUIDesktopApp.GetSecondsOutOfDate()), l < 432e3 ? (s = !1) : l > 604800 && ((h += " friendsListVeryOutOfDate"), (c = !0)));
let u = this.props.chats.GetActiveVoiceChat(),
p = !1;
(this.props.chats.VoiceChat.IsAnyVoiceActive() || u) && (p = !0), this.UpdateWindowIcon();
let _ = d.Ul.SettingsStore.FriendsSettings.bCompactFriendsList,
g = this.props.collapsed,
C = "friendlist",
f = m.g_FriendsUIDesktopApp && m.g_FriendsUIDesktopApp.IsDesktopUIActive();
_ && (C += " compactView"), s && (C += " needsUpdate"), g && this.props.collapsible && (C += " collapsed");
const v = d.Ul.FriendStore.BIsOfflineMode(),
S = a;
return I.createElement(
"div",
{ className: C },
I.createElement(
"div",
{ className: (0, Ce.Z)("friendListHeaderContainer", "titleBarContainer", (0, Oe.Uy)() && "OSX") },
this.props.popup && o.De.IN_CLIENT && I.createElement(me.T, { hideMin: S, hideMax: S, popup: this.props.popup, className: "chatTitleBar" }),
this.props.collapsible && I.createElement("div", { className: "friendListCollapse no-drag" }, I.createElement("div", { className: "friendListButton friendCollapseButton no-drag " + (g ? "Collapsed" : ""), onClick: this.ToggleCollapseExpand }, I.createElement(X.NP6, null))),
I.createElement(ot, { popup: this.props.popup && this.props.popup, currentUser: e }),
I.createElement("div", { className: "friendListButtons" }, s && I.createElement("div", { className: h, onClick: this.OnDoFriendsListUpdate, title: c ? (0, A.Xx)("#Tooltip_FriendsListUpdate_VeryOld") : (0, A.Xx)("#Tooltip_FriendsListUpdate") }, I.createElement(X.Lao, null)), !f && I.createElement("div", { className: "friendListButton friendSettingsButton no-drag", onClick: this.OnSettingsClick, title: (0, A.Xx)("#Tooltip_Settings") }, I.createElement(X.Zrf, null))),
!v &&
I.createElement(
I.Fragment,
null,
I.createElement(U.Z, null, p && I.createElement(V.Z, { key: "activeVoiceControls1", classNames: "activevoice-anim", timeout: 500 }, I.createElement(Ne, { chats: this.props.chats }))),
I.createElement(it, { browserContext: this.props.browserContext }),
I.createElement(G, { FavoritesStore: this.props.friends.FavoritesStore, bInOverlay: a }),
I.createElement(
"div",
{ className: "socialTabSearchContainer" },
I.createElement(
"div",
{ className: "socialTabContainer" },
I.createElement(
"div",
{ className: i },
I.createElement("div", { className: "tabLabel", style: r, ref: this.BindTabLabel, onClick: n ? void 0 : this.OnTabSearchClick }, (0, A.Xx)("#tab_friends")),
I.createElement(
"div",
{ className: "friendsTabButtonsContainer" },
I.createElement(
"div",
{ className: "TabSearchButton", onClick: n ? null : this.OnTabSearchClick },
I.createElement(U.Z, { className: "tabSearchTransitionGroup" }, n && I.createElement(V.Z, { className: "tabSearchTransition", key: "tabSearch", classNames: "tab-search-anim", timeout: 500 }, I.createElement("div", { className: "socialSearchContainer" }, I.createElement("form", { className: "socialInputContainer" + (n ? " SearchActive" : ""), name: "friendSearchForm", onSubmit: this.OnSearchSubmit }, I.createElement("div", { className: "inputContainer no-drag" }, I.createElement("input", { id: "friendSearchInputID", className: "friendSearchInput", autoFocus: !0, type: "text", name: "friendSearch", placeholder: (0, A.Xx)("#SearchFriends"), value: this.state.searchString, onInput: this.OnSearchInput, onKeyDown: this.OnSearchKeyDown, autoComplete: "off", ref: this.OnSearchInputRef }), I.createElement("div", { className: "friendSearchClear", onClick: this.OnClearSearch }, I.createElement(X.pVO, null))))))),
I.createElement("div", { className: "searchIconButton", onClick: this.OnTabSearchClick, title: (0, A.Xx)("#Tooltip_SearchFriends") }, I.createElement(X.YtI, null)),
),
I.createElement(Je, { fnToggleViewingIncomingInvites: this.ToggleViewingIncomingInvites, bViewingIncomingInvites: this.state.bViewingIncomingInvites }),
I.createElement(P.ns, { href: o.De.COMMUNITY_BASE_URL + "friends/add" }, I.createElement("div", { className: "friendListButton addFriendButton no-drag", title: (0, A.Xx)("#Tooltip_AddFriend") }, I.createElement(X.yBp, null))),
),
),
),
),
),
I.createElement("div", { className: "disconnectBlocker" }),
),
v ? I.createElement("div", { className: ve.OfflineContainer }, I.createElement("div", { className: ve.OfflineMessage }, I.createElement("div", { className: ve.summaryText }, (0, A.Xx)("#FriendsList_SignedOut")), I.createElement("div", { className: ve.detailText }, (0, A.Xx)("#FriendsList_SignedOut_Detail")), I.createElement("div", null, I.createElement("button", { className: ve.retryButton, onClick: this.SignIn }, (0, A.Xx)("#Friends_SignIn"))))) : I.createElement(rt, { friends: this.props.friends, chats: this.props.chats, searchString: t, fnOnSearchSelection: this.OnSearchSelection, onStartSearch: this.StartSearchOnKeyPress, browserContext: this.props.browserContext, bViewingIncomingInvites: this.state.bViewingIncomingInvites, onClose: this.ToggleViewingIncomingInvites }),
I.createElement("div", { className: "friendListFooter" }, I.createElement(nt, null)),
);
}
};
(0, i.gn)([M.ak], Ye.prototype, "OnSearchInputRef", null), (0, i.gn)([M.ak], Ye.prototype, "StartSearchOnKeyPress", null), (0, i.gn)([M.ak], Ye.prototype, "OnSearchInput", null), (0, i.gn)([M.ak], Ye.prototype, "OnSearchSubmit", null), (0, i.gn)([M.ak], Ye.prototype, "OnSearchSelection", null), (0, i.gn)([M.ak], Ye.prototype, "OnSearchKeyDown", null), (0, i.gn)([M.ak], Ye.prototype, "OnClearSearch", null), (0, i.gn)([M.ak], Ye.prototype, "OnSettingsClick", null), (0, i.gn)([M.ak], Ye.prototype, "ToggleCollapseExpand", null), (0, i.gn)([M.ak], Ye.prototype, "OnDoFriendsListUpdate", null), (0, i.gn)([M.ak], Ye.prototype, "BindTabLabel", null), (0, i.gn)([M.ak], Ye.prototype, "CollapseTabLabel", null), (0, i.gn)([M.ak], Ye.prototype, "OnTabSearchClick", null), (0, i.gn)([M.ak], Ye.prototype, "ToggleViewingIncomingInvites", null), (0, i.gn)([M.ak], Ye.prototype, "SignIn", null), (Ye = (0, i.gn)([S.Pi], Ye));
const Je = (0, S.Pi)(function (e) {
const { fnToggleViewingIncomingInvites: t, bViewingIncomingInvites: n } = e,
[i, o] = (0, I.useState)(!1);
(i || n) && (d.Ul.FriendStore.FriendGroupStore.incoming_invites_group.member_list, d.Ul.FriendStore.ClanStore.clan_invites);
const r = d.Ul.FriendStore.GetClanInviteCount(),
a = d.Ul.FriendStore.GetFriendInviteCount();
let s = d.Ul.FriendStore.GetOutgoingFriendRequestCount() > 0,
l = a + r,
c = "friendRequestButton";
return n && (c += " friendRequestViewActive"), s && 0 == l && (c += " friendRequestOutgoingOnly"), a > 0 || r > 0 || s ? I.createElement("div", { className: c, onClick: t, title: (0, A.kb)("#Tooltip_FriendRequest", l), onMouseEnter: () => o(!0), onMouseLeave: () => o(!1) }, I.createElement(X.pUF, null), l > 0 && I.createElement("div", { className: "requestsNumber" }, l)) : null;
});
class et extends I.Component {
render() {
let e = o.De.COMMUNITY_BASE_URL + "groups/SteamClientBeta/discussions/3/";
return d.Ul.IsInBeta() ? I.createElement("div", { className: "betaFeedbackLabel" }, (0, A.kQ)("#GiveFeedbackToSteam_Desc", I.createElement(P.ns, { href: e, className: "betaFeedbackAnchor" }, " ", (0, A.Xx)("#GiveFeedbackToSteam_URL"), " "))) : null;
}
}
class tt extends I.Component {
constructor(e) {
super(e), (this.state = { bShowChangeLogViolator: m.g_FriendsUIDesktopApp.UIDisplayPrefs.nChangeLogDismissed < ue.Posts().length });
}
OpenChangeLog(e) {
var t;
m.g_FriendsUIDesktopApp.SetUIDisplayPref("nChangeLogDismissed", ue.Posts().length), this.setState({ bShowChangeLogViolator: !1 }), (t = e.currentTarget.ownerDocument.defaultView), (0, Q.BR)(I.createElement(pe, null), t, "ChangeLog", { strTitle: (0, A.Xx)("#changeLog_Title"), popupWidth: 640, popupHeight: 680 }, (0, m.Og)(t));
}
render() {
let e = this.state.bShowChangeLogViolator,
t = 0;
return e && (t = ue.Posts().length - (m.g_FriendsUIDesktopApp.UIDisplayPrefs.nChangeLogDismissed || 7)), ue.Posts().length && Date.now() - Number(new Date(ue.Posts()[0].date)) > 36288e5 ? null : I.createElement("div", { className: "changeLog" + (e ? " showViolator" : ""), onClick: this.OpenChangeLog, title: e ? (0, A.Xx)("#changeLog_Value_Button", t) : (0, A.Xx)("#changeLog_Button") }, I.createElement(X.Xsu, null), e && I.createElement("div", { className: "changeLogViolator" }, t));
}
}
(0, i.gn)([M.ak], tt.prototype, "OpenChangeLog", null);
let nt = class extends I.Component {
constructor(e) {
super(e);
}
OnSettingsZooClick(e) {
0;
}
render() {
return I.createElement(I.Fragment, null, I.createElement("div", { className: "flexRowCentered" }, !1, I.createElement(et, null), I.createElement(tt, null)));
}
};
(0, i.gn)([M.ak], nt.prototype, "OnSettingsZooClick", null), (nt = (0, i.gn)([S.Pi], nt));
const it = (0, S.Pi)((e) => {
const { browserContext: t } = e,
n = (function () {
const [e, t] = (0, I.useState)(!1),
n = (0, b.SZ)(() => d.Ul.FriendStore.self.persona.m_gameid);
return (
(0, I.useEffect)(() => {
if (!d.Ul.RemotePlayStore.BEnabled() || !d.Ul.RemotePlayStore.BRemotePlayTogetherEnabled()) return;
let e = !0;
return (
d.Ul.RemotePlayStore.BCanCreateInviteForGame(n).then((n) => {
e && t(n);
}),
() => {
e = !1;
}
);
}, [n]),
e
);
})(),
[i, o] = (0, m.pF)("bRemotePlayLinkHintDismissed"),
[r, a] = (0, Fe.y)();
if (!n) return null;
const s = (0, A.Xx)("#RemotePlay_LinkCopyTitle");
return I.createElement(
"div",
{ className: ve.RemotePlayInviteLinkSection },
I.createElement(
"div",
{
className: ve.LinkRow,
onClick: () => {
d.Ul.RemotePlayStore.CreateGroup(d.Ul.FriendStore.self.persona.m_gameid, t).catch((e) => console.log(`RemotePlayStore.CreateGroup caught: ${e}`));
},
},
I.createElement("div", { className: ve.LinkRowText }, s),
I.createElement("div", { title: (0, A.Xx)("#Tooltip_RemotePlay_CreateInvite"), className: ve.LinkRowIconContainer }, I.createElement(Se.aO, { className: ve.LinkRowIcon })),
),
!i && I.createElement("div", { className: ve.LinkExplanation }, I.createElement("div", { className: ve.ExplanationText }, (0, A.kQ)("#RemotePlay_LinkCopyExplanation", I.createElement("span", { className: ve.Strong }, (0, A.Xx)("#RemotePlay_LinkCopyExplanation_Anyone")))), I.createElement("div", { className: ve.GotItButton, onClick: () => o(!0) }, (0, A.Xx)("#Generic_Got_It")), I.createElement("svg", { className: ve.AccentChevron, width: "30px", height: "15px", viewBox: "0 0 64 32" }, I.createElement("defs", null, I.createElement("linearGradient", { id: r, x1: "0%", y1: "0%", x2: "0%", y2: "100%" }, I.createElement("stop", { offset: "0%", style: { stopColor: "rgb(24, 92, 108)", stopOpacity: 1 } }), I.createElement("stop", { offset: "100%", style: { stopColor: "rgb(24, 92, 108)", stopOpacity: 1 } }))), I.createElement("path", { d: "M 0 0 L 64 0 L 32 32 z", stroke: "colourname", fill: a }))),
);
}),
ot = (0, S.Pi)(function (e) {
const { currentUser: t, popup: n } = e,
i = (0, Oe.id)(),
o = (0, Be.CQ)(t.persona.m_unGamePlayedAppID);
(0, I.useEffect)(() => {
t.LoadEquippedProfileItems();
});
const r = I.useCallback((e) => (0, p.kR)((0, m.Um)(null, e), e), []),
a = I.useCallback(
(e) => {
let n = t.GetCommunityProfileURL();
(0, P.b8)(e, n), e.stopPropagation();
},
[t],
);
let s = "currentUserContainer " + (0, ce.sB)(t.persona);
2 == t.persona.m_ePersonaState && (s += " userDoNotDisturb");
let l = null;
d.Ul.FriendStore.BIsInvisibleMode() && (l = () => (0, A.Xx)("#PersonaStateInvisible"));
let c = null;
t.persona.HasCurrentGameRichPresence() ? (c = () => t.persona.GetCurrentGameRichPresence()) : t.persona.m_broadcastAccountId && (c = () => t.GetBroadcastDescription());
let h = t.persona.is_ingame && (1 == d.Ul.UserStore.PrivacySettings.privacy_state_ownedgames || o),
u = null,
_ = null,
g = !i && d.Ul.SettingsStore.FriendsSettings.bAnimatedAvatars;
if (t.BLoadedEquippedItems()) {
let e = t.GetEquippedProfileItems();
e && ((u = e.animated_avatar), (_ = e.avatar_frame));
}
let C = !1;
if (n) {
let e = (0, m.rb)(n);
C = !(0, d.ns)(e, d.D);
}
const f = C ? "Medium" : "Infinite";
let v = I.createElement("div", { className: "currentUserAvatar" }, I.createElement(w._1, { loopDuration: g ? f : "None", bLimitProfileFrameAnimationTime: !g || C, size: "Medium", persona: t.persona, animatedAvatar: u, avatarFrame: _, onClick: a }));
return I.createElement(
"div",
{ className: s },
I.createElement("svg", { className: "statusHeaderGlow", width: "100%", height: "132", xmlns: "http://www.w3.org/2000/svg" }, I.createElement("defs", null, I.createElement("radialGradient", { id: "exampleGradient", cx: "50%", cy: "50%", r: "50%", fx: "35%", fy: "30%" }, I.createElement("stop", { offset: "10%", stopColor: "gold" }), I.createElement("stop", { offset: "95%", stopColor: "green" }))), I.createElement("ellipse", { cx: "5%", cy: "28%", rx: "65%", ry: "60%", fill: "url(#exampleGradient)" })),
I.createElement("div", { className: "AvatarAndUser", onContextMenu: r }, I.createElement(_t, { friend: t, context: { chatContext: "friendslist" }, onContextMenu: r }, v), I.createElement(ge.o, { className: "labelHolder", persona: t.persona, bIsSelf: !0, eFriendRelationship: t.efriendrelationship, strNickname: t.nickname, bParenthesizeNicknames: d.Ul.SettingsStore.CommunityPreferences.bParenthesizeNicknames, bCompactView: d.Ul.SettingsStore.FriendsSettings.bCompactFriendsList, bHideSnooze: !0, renderStatus: l, renderRichPresence: c, onContextMenu: r, bDNDSet: d.Ul.FriendStore.GetUserDoNotDisturb(), bHasGamePrivacy: h })),
);
});
let rt = class extends I.Component {
constructor(e) {
super(e), (this.state = { bScrolledFromTop: !1 });
}
get frame() {
return this.m_elFriendsListContent;
}
OnContextMenu(e) {
let t = this.props.searchString && this.props.searchString.length > 0;
this.props.bViewingIncomingInvites || t || (0, p.WK)((0, m.Um)(this, e), null, e);
}
BindFriendsListContent(e) {
this.m_elFriendsListContent = e;
}
OnFriendsListKeyDown(e) {
e.ctrlKey || e.altKey || e.metaKey || e.key.length > 1 || (this.props.onStartSearch && this.props.onStartSearch(e));
}
OnFriendsListScrollRef(e) {
this.m_elFriendsListScroll = e;
}
ScrollToTop() {
this.m_elFriendsListScroll && (this.m_elFriendsListScroll.scrollTop = 0);
}
OnScrollFriendsList(e) {
let t = e.currentTarget.scrollTop > 10;
t != this.state.bScrolledFromTop && this.setState({ bScrolledFromTop: t });
}
OnAcceptClanInvite(e, t) {
let n = e.currentTarget.ownerDocument.defaultView;
d.Ul.FriendStore.ClanStore.RespondToClanInvite(t, !0).then((e) => {
e || (0, u.zp)(n, (0, A.Xx)("#Friend_AcceptClanInvite"), (0, A.Xx)("#Friend_AcceptClanInvite_Error"));
});
}
OnDeclineClanInvite(e, t) {
let n = e.currentTarget.ownerDocument.defaultView;
d.Ul.FriendStore.ClanStore.RespondToClanInvite(t, !1).then((e) => {
e || (0, u.zp)(n, (0, A.Xx)("#Friend_DeclineClanInvite"), (0, A.Xx)("#Friend_DeclineClanInvite_Error"));
});
}
render() {
var e, t;
let n,
i = this.props.searchString && this.props.searchString.length > 0,
{ bViewingIncomingInvites: r, bHideGroupChats: a } = this.props;
const s = this.props.browserContext.m_unAppID && 0 != this.props.browserContext.m_unAppID;
let l = { searchString: this.props.searchString, fnOnSearchSelection: this.props.fnOnSearchSelection };
if (this.props.friends.self.is_ready)
if (r) {
let e = d.Ul.FriendStore.ClanStore.clan_invites.length,
t = (de.K.InitFromAccountID(d.Ul.FriendStore.self.accountid), []);
if (e)
for (let e of d.Ul.FriendStore.ClanStore.clan_invites) {
const n = e.steamid;
let i;
(i = e.BIsOGG() ? `${o.De.COMMUNITY_BASE_URL}app/${e.GetOGGAppID()}` : `${o.De.COMMUNITY_BASE_URL}gid/${n.ConvertTo64BitString()}`),
t.push(
I.createElement(
"div",
{ className: "clanInviteContainer", key: "clan_invite_" + n.GetAccountID() },
I.createElement(P.ns, { href: i }, I.createElement("div", { className: "clanAvatar" }, I.createElement("img", { className: "clanAvatarIcon", src: e.avatar_url_medium })), I.createElement("div", { className: "clanName" }, e.name, I.createElement("div", { className: "clanDetails displayRow" }, I.createElement("div", { className: "displayRow statMembersTotal" }, I.createElement("div", { className: "statCircle" }), e.member_count, " Members"), e.users_online > 0 && I.createElement("div", { className: "displayRow statMembersOnline", title: (0, A.kb)("#Chat_Members_Online_Tooltip", e.users_online) }, I.createElement("div", { className: "statCircle" }), e.users_online), e.users_ingame > 0 && I.createElement("div", { className: "displayRow statMembersInGame", title: (0, A.kb)("#Chat_Members_InGame_Tooltip", e.users_ingame) }, I.createElement("div", { className: "statCircle" }), e.users_ingame)))),
I.createElement(
"div",
{ className: "clanActionButtons" },
I.createElement(
"div",
{ className: "displayColumn", title: (0, A.Xx)("#FriendGroup_Tip_Accept_Invite") },
I.createElement(
$.Av,
{
onClick: (e) => {
this.OnAcceptClanInvite(e, n);
},
},
(0, A.Xx)("#Button_Accept"),
),
),
I.createElement(
"div",
{ className: "displayColumn", title: (0, A.Xx)("#FriendGroup_Tip_Decline_Invite") },
I.createElement(
$.Av,
{
onClick: (e) => {
this.OnDeclineClanInvite(e, n);
},
},
(0, A.Xx)("#Button_Decline"),
),
),
),
),
);
}
n = I.createElement(I.Fragment, null, e > 0 && !i && I.createElement(I.Fragment, null, I.createElement("div", { className: "clanInvitesGroupContainer" }, I.createElement("div", { className: "clanInviteTitle" }, (0, A.Xx)("#Friend_PendingClanInvites")), t)), I.createElement(mt, Object.assign({ group: this.props.friends.FriendGroupStore.incoming_invites_group, collapsed: !1 }, l, { onClose: this.props.onClose, bInOverlay: s })), I.createElement(mt, Object.assign({ group: this.props.friends.FriendGroupStore.outgoing_invites_group, collapsed: !1 }, l, { onClose: this.props.onClose, bInOverlay: s })));
} else if (i) n = I.createElement(mt, Object.assign({ group: this.props.friends.FriendGroupStore.all_friends, collapsed: !1, bInOverlay: s }, l));
else {
let t = this.props.friends.FriendGroupStore.user_groups.map((e) => I.createElement(mt, Object.assign({ group: e, key: e.id, groupDisplayPrefs: this.props.friends.FriendGroupStore.groupDisplayPrefs, bInOverlay: s }, l))),
i = this.props.friends.FriendGroupStore.default_groups.map((e) => I.createElement(mt, Object.assign({ group: e, key: e.id, groupDisplayPrefs: this.props.friends.FriendGroupStore.groupDisplayPrefs, bInOverlay: s }, l))),
o = !1;
this.props.chats.FriendChatStore.GetFriendsWithUnreadMessages(this.props.browserContext).length && (o = !0), (n = I.createElement(I.Fragment, null, o && !(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) && I.createElement("div", { className: "recentChatsGroup unreadChatsGroup" }, I.createElement(yt, { friendChatStore: this.props.chats.FriendChatStore, browserContext: this.props.browserContext })), I.createElement(ct, { bInOverlay: s }), t, i));
}
else n = void 0;
let c = d.Ul.SettingsStore.FriendsSettings.bCompactFriendsList;
return I.createElement(
E.s,
{ className: "FriendsListContent" + (c ? " CompactFriendsList" : ""), ref: this.BindFriendsListContent, retainFocus: !0, "flow-children": "column" },
I.createElement(fe.R, null),
!(null === (t = this.context) || void 0 === t ? void 0 : t.IN_GAMEPADUI) && I.createElement(It, { browserContext: this.props.browserContext, bScrolledFromTop: this.state.bScrolledFromTop && !i, onClick: this.ScrollToTop }),
I.createElement("div", { className: "friendlistListContainer", onContextMenu: this.OnContextMenu, tabIndex: 0, onKeyDown: this.OnFriendsListKeyDown, ref: this.OnFriendsListScrollRef, onScroll: this.OnScrollFriendsList }, I.createElement($.zx, { focusable: r, onClick: this.props.onClose, className: "BackToFriendsListButton" }, (0, A.Xx)("#FriendGroup_CloseGamepadUI")), I.createElement("div", { className: "listContentContainer" }, n, I.createElement("div", { className: "disconnectBlocker" }))),
I.createElement(fe.Q, null),
!a && I.createElement(st, { friends: this.props.friends, chats: this.props.chats, parent: this }),
);
}
};
(rt.contextType = o.E_), (0, i.gn)([M.ak], rt.prototype, "OnContextMenu", null), (0, i.gn)([M.ak], rt.prototype, "BindFriendsListContent", null), (0, i.gn)([M.ak], rt.prototype, "OnFriendsListKeyDown", null), (0, i.gn)([M.ak], rt.prototype, "OnFriendsListScrollRef", null), (0, i.gn)([M.ak], rt.prototype, "ScrollToTop", null), (0, i.gn)([M.ak], rt.prototype, "OnScrollFriendsList", null), (rt = (0, i.gn)([S.Pi], rt));
class at extends I.Component {
constructor(e) {
super(e);
}
render() {
return I.createElement("div", { className: "GroupChats" }, I.createElement(C.FL, { friends: this.props.friends, chats: this.props.chats }));
}
}
let st = (Ge = class extends I.Component {
constructor(e) {
super(e), (this.m_bMouseOver = !1), (this.state = { nChatRoomListContainerHeight: m.g_FriendsUIDesktopApp.UIDisplayPrefs.nChatRoomListHeightPx, nChatRoomListContainerMaxHeight: m.g_FriendsUIDesktopApp.UIDisplayPrefs.nChatRoomListHeightPx, bChatRoomListCollapsed: m.g_FriendsUIDesktopApp.UIDisplayPrefs.bChatRoomListCollapsed, nChatRoomListPreCollapseHeight: m.g_FriendsUIDesktopApp.UIDisplayPrefs.nChatRoomListHeightPx, bChatRoomListResizing: !1 });
}
UpdateChatSectionSize() {
if (((0, _e.X)(this.m_elChatSection, "m_elChatRoomListContainer not set"), this.m_bMouseOver))
return (
this.m_iTimeoutUpdateChatSectionSize && this.m_window.clearTimeout(this.m_iTimeoutUpdateChatSectionSize),
void (this.m_iTimeoutUpdateChatSectionSize = this.m_window.setTimeout(() => {
(this.m_iTimeoutUpdateChatSectionSize = void 0), this.UpdateChatSectionSize();
}, 500))
);
let e = this.m_elChatSection.maximumHeight,
t = this.m_elChatSection.minimumHeight;
if (((this.m_elChatRoomListContainer.style.minHeight = t + "px"), this.state.nChatRoomListContainerMaxHeight > e)) {
this.m_animationChatSectionShrink && this.m_animationChatSectionShrink.Cancel();
let n = this.state.nChatRoomListContainerMaxHeight,
i = e;
this.setState({ nChatRoomListContainerMaxHeight: n }, () => {
(this.m_animationChatSectionShrink = new z.P(this, { nChatRoomListContainerHeight: (0, K.Lh)(this.state.nChatRoomListContainerHeight, t, e), nChatRoomListContainerMaxHeight: i }, { msDuration: 300, timing: "sine" })), this.m_animationChatSectionShrink.Start();
});
} else this.setState({ nChatRoomListContainerMaxHeight: e });
}
OnChatSectionMutation(e, t) {
this.m_iTimeoutUpdateChatSectionSize && this.m_window.clearTimeout(this.m_iTimeoutUpdateChatSectionSize),
(this.m_iTimeoutUpdateChatSectionSize = this.m_window.setTimeout(() => {
(this.m_iTimeoutUpdateChatSectionSize = void 0), this.UpdateChatSectionSize();
}, 1e3));
}
BindChatRoomTitleContainer(e) {
this.m_elChatRoomTitleContainer = e;
}
BindChatRoomListContainer(e) {
e && ((this.m_elChatRoomListContainer = e), this.UpdateChatSectionSize());
}
BindChatSection(e) {
this.m_observerChatSection && (this.m_observerChatSection.disconnect(), (this.m_observerChatSection = null)), e && ((this.m_elChatSection = e), (this.m_window = e.div.ownerDocument.defaultView), (this.m_observerChatSection = new MutationObserver(this.OnChatSectionMutation)), this.m_observerChatSection.observe(e.div, { childList: !0, subtree: !0 }));
}
OnGrabberMouseDown(e) {
let t = e.currentTarget.ownerDocument.defaultView;
(this.m_iGrabberBarInitialGrabOffset = e.clientY - this.m_elChatRoomTitleContainer.getBoundingClientRect().top), this.setState({ nChatRoomListPreCollapseHeight: m.g_FriendsUIDesktopApp.UIDisplayPrefs.nChatRoomListHeightPx }), t.addEventListener("mousemove", this.HandleMouseMove), t.addEventListener("mouseup", this.UnregisterChatRoomListDragEvents);
}
OnGrabberTouchStart(e) {
let t = e.currentTarget.ownerDocument.defaultView;
(this.m_iGrabberBarInitialGrabOffset = e.touches[0].clientY - this.m_elChatRoomTitleContainer.getBoundingClientRect().top), t.addEventListener("touchmove", this.HandleTouchMove), t.addEventListener("touchend", this.UnregisterChatRoomListDragEvents);
}
HandleTouchMove(e) {
e.touches.length >= 1 && this.InternalAdjustChatRoomListContainerOnDrag(e.touches[0].clientY);
}
HandleMouseMove(e) {
this.InternalAdjustChatRoomListContainerOnDrag(e.clientY);
}
OnMouseEnter(e) {
this.m_bMouseOver = !0;
}
OnMouseLeave(e) {
this.m_bMouseOver = !1;
}
InternalAdjustChatRoomListContainerOnDrag(e) {
if (!this.props.parent || !this.props.parent.frame) return;
let t = this.props.parent.frame.getBoundingClientRect(),
n = t.top,
i = this.m_iGrabberBarInitialGrabOffset,
o = t.height - (this.m_elChatRoomTitleContainer.getBoundingClientRect().height - i),
r = e - n;
r < 0 ? (r = 0) : r > o && (r = o);
let a = o - r;
(a = (0, K.Lh)(a, this.m_elChatSection.minimumHeight, this.m_elChatSection.maximumHeight)), this.setState({ nChatRoomListContainerHeight: a }), this.setState({ bChatRoomListCollapsed: !(this.state.nChatRoomListContainerHeight > 0) }), m.g_FriendsUIDesktopApp.SetUIDisplayPref("bChatRoomListCollapsed", !(this.state.nChatRoomListContainerHeight > 0)), this.setState({ bChatRoomListResizing: !0 });
}
ToggleChatsList() {
this.state.bChatRoomListCollapsed && this.setState({ nChatRoomListContainerHeight: this.state.nChatRoomListPreCollapseHeight }), this.setState({ bChatRoomListCollapsed: !this.state.bChatRoomListCollapsed }), m.g_FriendsUIDesktopApp.SetUIDisplayPref("bChatRoomListCollapsed", !this.state.bChatRoomListCollapsed);
}
UnregisterChatRoomListDragEvents(e) {
e.view.removeEventListener("mousemove", this.HandleMouseMove), e.view.removeEventListener("touchmove", this.HandleTouchMove), e.view.removeEventListener("mouseup", this.UnregisterChatRoomListDragEvents), e.view.removeEventListener("touchend", this.UnregisterChatRoomListDragEvents), this.state.nChatRoomListContainerHeight < Ge.s_pxGroupChatsAutoCollapseThreshold ? (m.g_FriendsUIDesktopApp.SetUIDisplayPref("nChatRoomListHeightPx", this.state.nChatRoomListPreCollapseHeight), this.setState({ bChatRoomListCollapsed: !0 })) : (this.setState({ nChatRoomListPreCollapseHeight: this.state.nChatRoomListContainerHeight }), m.g_FriendsUIDesktopApp.SetUIDisplayPref("nChatRoomListHeightPx", this.state.nChatRoomListContainerHeight)), (this.m_iGrabberBarInitialGrabOffset = null), this.setState({ bChatRoomListResizing: !1 });
}
OnCreateChatRoom(e) {
(0, q.bI)((0, m.Um)(this, e), e.currentTarget.ownerDocument.defaultView);
}
render() {
let e = { height: this.state.bChatRoomListCollapsed ? 0 : this.state.nChatRoomListContainerHeight + "px", maxHeight: this.state.bChatRoomListCollapsed ? 0 : this.state.nChatRoomListContainerMaxHeight + "px" },
t = this.props.chats.currentChatRoomGroups,
n = !1,
i = "FriendsListChatSection ChatRoomListContainerParent";
if (this.props.chats.chat_group_list_ready) for (let e of t) e.hasUnreadChatMessage && (n = !0);
return (
this.state.bChatRoomListCollapsed && (i += " Collapsed"),
this.state.bChatRoomListResizing && (i += " ChatListResizing"),
n && (i += " HasUnreadChats"),
I.createElement(
"div",
{ className: i, onMouseEnter: this.OnMouseEnter, onMouseLeave: this.OnMouseLeave },
I.createElement("div", { className: "friendsListSectionTitle chatSectionTitle", ref: this.BindChatRoomTitleContainer }, this.state.bChatRoomListCollapsed && n && I.createElement(C.TJ, null), I.createElement("div", { className: "ToggleGroupChatList", onClick: this.ToggleChatsList, title: this.state.bChatRoomListCollapsed ? (0, A.Xx)("#Tooltip_ChatsExpand") : (0, A.Xx)("#Tooltip_ChatsCollapse") }, I.createElement(X.NP6, { angle: -90 })), I.createElement("div", { className: "voiceRoomDragBar", onMouseDown: this.OnGrabberMouseDown, onTouchStart: this.OnGrabberTouchStart }, I.createElement("div", { className: "groupChatSectionTitle" }, (0, A.Xx)("#tab_chats"))), I.createElement("button", { className: "createChatRoomButton", onClick: this.OnCreateChatRoom, title: (0, A.Xx)("#Tooltip_CreateGroupChat") }, I.createElement(X.k4w, null)), I.createElement("div", { className: "disconnectBlocker" })),
I.createElement(fe.R, null),
I.createElement("div", { className: "chatRoomListContainer", style: e, ref: this.BindChatRoomListContainer }, I.createElement(C.FL, { friends: this.props.friends, chats: this.props.chats, ref: this.BindChatSection })),
I.createElement(fe.Q, null),
)
);
}
});
(st.s_pxGroupChatsAutoCollapseThreshold = 45), (0, i.gn)([M.ak], st.prototype, "UpdateChatSectionSize", null), (0, i.gn)([M.ak], st.prototype, "OnChatSectionMutation", null), (0, i.gn)([M.ak], st.prototype, "BindChatRoomTitleContainer", null), (0, i.gn)([M.ak], st.prototype, "BindChatRoomListContainer", null), (0, i.gn)([M.ak], st.prototype, "BindChatSection", null), (0, i.gn)([M.ak], st.prototype, "OnGrabberMouseDown", null), (0, i.gn)([M.ak], st.prototype, "OnGrabberTouchStart", null), (0, i.gn)([M.ak], st.prototype, "HandleTouchMove", null), (0, i.gn)([M.ak], st.prototype, "HandleMouseMove", null), (0, i.gn)([M.ak], st.prototype, "OnMouseEnter", null), (0, i.gn)([M.ak], st.prototype, "OnMouseLeave", null), (0, i.gn)([M.ak], st.prototype, "ToggleChatsList", null), (0, i.gn)([M.ak], st.prototype, "UnregisterChatRoomListDragEvents", null), (0, i.gn)([M.ak], st.prototype, "OnCreateChatRoom", null), (st = Ge = (0, i.gn)([S.Pi], st));
class lt extends I.Component {
GetDragDropProps(e = !0) {
let t = { rgAcceptedTypes: [] };
return e && ((t.fnDragEnter = this.OnDragEnter), (t.fnDragLeave = this.OnDragLeave), (t.fnDrop = this.OnDrop), (t.rgAcceptedTypes = ["friend"])), (t.onDragStart = this.OnDragStart), (t.onDragEnd = this.OnDragEnd), t;
}
OnDragStart(e) {
let t = m.g_FriendsUIDesktopApp.DragDropManager.GetDragData();
if (t && "friend" == t.type) {
let e = t;
(e.group = this.GetGroup()), this.setState({ friendDraggedOut: e.friend });
}
}
OnDragEnd(e) {
this.state.friendDraggedOut && this.setState({ friendDraggedOut: null });
}
OnDragEnter(e, t) {
(0, _e.X)(e && "friend" == e.type, "Invalid data type passed to FriendGroupDragDrop.OnDragEnter");
let n = e,
i = n.friend,
o = n.group,
r = this.GetGroup();
return (!r || o == r || !this.GetGroup().HasMember(i.accountid) || n.is_favorite || (this.GetGroup().accepts_group_removals && o.modifiable)) && i.is_friend && this.state.friendDrag != i && this.setState({ friendDrag: i }), !0;
}
ResetDragState() {
this.setState({ friendDrag: null });
}
OnDragLeave() {
this.state.friendDrag && this.ResetDragState();
}
OnDrop(e, t) {
(0, _e.X)(e && "friend" == e.type, "Invalid data type passed to FriendGroupDragDrop.OnDrop");
let n = e;
if (n.group == this.GetGroup()) this.setState({ friendDraggedOut: null });
else {
let e = this.state.friendDrag,
t = () => {
this.state.friendDrag && this.state.friendDrag == e && this.ResetDragState();
};
this.PerformDropAction(n).then(t).catch(t);
}
}
}
(0, i.gn)([M.ak], lt.prototype, "OnDragStart", null), (0, i.gn)([M.ak], lt.prototype, "OnDragEnd", null), (0, i.gn)([M.ak], lt.prototype, "OnDragEnter", null), (0, i.gn)([M.ak], lt.prototype, "OnDragLeave", null), (0, i.gn)([M.ak], lt.prototype, "OnDrop", null);
const ct = (0, S.Pi)((e) => {
if (!d.Ul.SettingsStore.FriendsSettings.bCategorizeInGameFriendsByGame) return null;
let t = d.Ul.FriendStore.FriendGroupStore.game_groups,
n = t.map((t) => I.createElement(ut, { key: t.id, group: t, bSingletonGroup: !1, bOtherGroups: !0, groupDisplayPrefs: d.Ul.FriendStore.FriendGroupStore.groupDisplayPrefs, bInOverlay: e.bInOverlay })),
i = d.Ul.FriendStore.FriendGroupStore.singleton_game_group;
return i && n.push(I.createElement(ut, { key: "singleton", group: i, bSingletonGroup: !0, bOtherGroups: t.length > 0, groupDisplayPrefs: d.Ul.FriendStore.FriendGroupStore.groupDisplayPrefs, bInOverlay: e.bInOverlay })), I.createElement(I.Fragment, null, n);
});
let mt = class extends lt {
constructor(e) {
super(e), (this.m_actions = v.LO.map()), (this.state = { bLocalCollapsed: this.props.collapsed, bSortOfflineByRecent: !1 });
}
GetGroup() {
return this.props.group;
}
PerformDropAction(e) {
let t = e.friend,
n = e.group,
i = this.props.group;
return e.is_favorite || m.g_FriendsUIDesktopApp.DragDropManager.SetDropConsumed(), d.Ul.FriendStore.FriendGroupStore.TransferFriendFromToGroup(t, n, i);
}
ToggleCollapsed() {
this.props.groupDisplayPrefs ? this.props.groupDisplayPrefs.ToggleUserGroupCollapsed(this.props.group.unique_id) : this.setState({ bLocalCollapsed: !this.state.bLocalCollapsed });
}
IsCollapsed() {
return this.props.groupDisplayPrefs ? this.props.groupDisplayPrefs.GetUserGroupCollapsed(this.props.group.unique_id) : this.state.bLocalCollapsed;
}
IsInviteGroup() {
return this.props.group.m_eDisplayType == c.h1.eIncomingInvites;
}
IsOutGoingInviteGroup() {
return this.props.group.m_eDisplayType == c.h1.eOutgoingInvites;
}
OnContextMenu(e) {
(this.props.group.modifiable || this.props.group.accepts_group_removals) && (0, p.WK)((0, m.Um)(this, e), this.props.group, e);
}
OnFriendSelected(e) {
this.props.friendSelectAction ? this.props.friendSelectAction(e) : (e.OpenChatDialog((0, m.Um)(this)), this.props.fnOnSearchSelection && this.props.fnOnSearchSelection());
}
OnAcceptInvite(e) {
(0, _e.X)(this.IsInviteGroup(), "accept invite on non-invite group");
let t = this.m_actions.get(e.accountid);
t && "accept" == t.action ? this.m_actions.delete(e.accountid) : this.m_actions.set(e.accountid, { friend: e, action: "accept" });
}
OnDeclineInvite(e) {
(0, _e.X)(this.IsInviteGroup(), "decline invite on non-invite group");
let t = this.m_actions.get(e.accountid);
!t || ("decline" != t.action && "block" != t.action) ? this.m_actions.set(e.accountid, { friend: e, action: "decline" }) : this.m_actions.delete(e.accountid);
}
OnBlockInvite(e, t) {
(0, _e.X)(this.IsInviteGroup(), "block invite on non-invite group"), e ? this.m_actions.set(t.accountid, { friend: t, action: "block" }) : this.m_actions.set(t.accountid, { friend: t, action: "decline" });
}
AcceptInvite(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
let { eResult: n, eFriendRelationship: i } = yield d.Ul.FriendStore.SendFriendInvite(t);
3 != i && (0, p.u8)(e, n, i, t.display_name);
});
}
DeclineInvite(e, t) {
d.Ul.FriendStore.RemoveFriend(t).then((n) => {
1 != n && (0, u.zp)(e, (0, A.Xx)("#Friend_Menu_IgnoreIncomingInvite"), (0, A.Xx)("#Friend_IgnoreIncomingInvite_Error", t.display_name));
});
}
BlockInvite(e, t) {
d.Ul.FriendStore.BlockPlayer(t).then((n) => {
5 != n && (0, u.zp)(e, (0, A.Xx)("#Friend_Menu_BlockIncomingInvite"), (0, A.Xx)("#Friend_BlockIncomingInvite_Error", t.display_name));
});
}
OnConfirmChanges(e) {
(0, _e.X)(this.IsInviteGroup(), "confirm changes on non-invite group");
let t = e.currentTarget.ownerDocument.defaultView;
this.m_actions.forEach((e) => {
"accept" == e.action ? this.AcceptInvite(t, e.friend) : "decline" == e.action ? this.DeclineInvite(t, e.friend) : "block" == e.action ? this.BlockInvite(t, e.friend) : console.log(`unknown action ${e.action}`);
});
}
OnIgnoreAllInvites(e) {
(0, _e.X)(this.IsInviteGroup(), "ignore all invites on non-invite group");
let t = e.currentTarget.ownerDocument.defaultView;
(0, u.p3)(t, (0, A.Xx)("#FriendGroup_ConfirmAllIgnore_Title"), (0, A.Xx)("#FriendGroup_ConfirmAllIgnore_Body"), (0, A.Xx)("#FriendGroup_ConfirmAllIgnore_OK"))
.then(() => {
let e = this.props.group.member_list;
for (let n of e) this.DeclineInvite(t, n);
})
.catch(() => {});
}
OnCloseInvites() {
(0, _e.X)(this.IsInviteGroup(), "close invites on non-invite group"), this.props.onClose();
}
ToggleOfflineSortMethod() {
this.setState({ bSortOfflineByRecent: !this.state.bSortOfflineByRecent });
}
GetFriendRenderContext() {
return (this.m_FriendRenderContext && this.m_FriendRenderContext.friendGroup == this.props.group) || (this.m_FriendRenderContext = { friendGroup: this.props.group, chatContext: "friendslist" }), this.m_FriendRenderContext;
}
render() {
var e, t, n, i, r, a, l;
let m = this.props.searchString && this.props.searchString.length > 0,
u = m,
p = this.IsCollapsed() && !m && !this.state.friendDrag,
_ = [],
g = this.IsInviteGroup(),
C = this.props.group.m_eDisplayType == c.h1.eOfflineOnly,
f = !1;
if (!p) {
let o,
l = !1;
if (((o = this.props.searchString && this.props.searchString.length ? this.props.group.GetMembersMatchingSearch(this.props.searchString) : this.props.group.member_list), this.state.friendDrag && (this.props.group.HasMember(this.state.friendDrag.accountid) ? (l = !0) : (o = o.concat(this.state.friendDrag).sort(s.Xp.DefaultFriendSortComparator))), C && this.state.bSortOfflineByRecent && ((o = this.props.group.member_list_unsorted.slice().sort(s.Xp.FriendSortByLastSeenComparator)), (f = !0)), g)) {
let e = d.Ul.FriendStore.FriendGroupStore.incoming_invites_group;
o = o.slice().sort((t, n) => {
let i = e.map_steamid_to_mutual_friends.get(t.steamid64),
o = e.map_steamid_to_mutual_friends.get(n.steamid64),
r = (i ? i.size : 0) - (o ? o.size : 0);
return r > 0 || (0 == r && t.accountid > n.accountid) ? -1 : 1;
});
}
let c = null;
!m && this.props.group.should_filter_categorized_friends && (c = d.Ul.FriendStore.FriendGroupStore.categorized_friend_set);
for (let s of o) {
if (this.props.setExcludedFriends && this.props.setExcludedFriends.has(s.accountid)) continue;
if (c && c.has(s.accountid)) continue;
let o,
m,
d,
h = 4 == s.efriendrelationship,
u = this.state.friendDrag != s || l ? "" : "dropGhost";
this.state.friendDraggedOut == s && this.state.friendDrag != s && (u += " dragOriginGhost");
let p = null !== (e = this.props.gamepadEventOverrides) && void 0 !== e ? e : {};
if (g) {
let e = this.m_actions.get(s.accountid);
(o = e && "accept" == e.action ? "bright" : "dim"),
(m = !e || ("decline" != e.action && "block" != e.action) ? "dim" : "bright"),
(d = !e || ("decline" != e.action && "block" != e.action) ? "" : " declined"),
e && "accept" == e.action ? (u += "bright") : !e || ("decline" != e.action && "block" != e.action) || (u += "dim"),
(null === (t = this.context) || void 0 === t ? void 0 : t.IN_GAMEPADUI) &&
((p.onOKButton = (e) => {
let t = R.RA(e);
this.AcceptInvite(t, s);
}),
(p.onOKActionDescription = (0, A.Xx)("#FriendGroup_Tip_Accept")),
(p.onSecondaryButton = (e) => {
let t = R.RA(e);
this.BlockInvite(t, s);
}),
(p.onSecondaryActionDescription = (0, A.Xx)("#Button_Block")),
(p.onOptionsButton = (e) => {
let t = R.RA(e);
this.DeclineInvite(t, s);
}),
(p.onOptionsActionDescription = (0, A.Xx)("#FriendGroup_Tip_Decline")));
}
_.push(
I.createElement(
V.Z,
{ className: g ? "friendInviteContainer" + d : "friendCategoryContainer", key: s.accountid, classNames: "friend-anim", timeout: 320 },
I.createElement(
"div",
null,
I.createElement(gt, Object.assign({ friend: s, key: s.accountid, className: u, context: this.GetFriendRenderContext(), bInOverlay: this.props.bInOverlay, noActions: g && (null === (n = this.context) || void 0 === n ? void 0 : n.IN_GAMEPADUI), action: h || (g && (null === (i = this.context) || void 0 === i ? void 0 : i.IN_GAMEPADUI)) ? () => {} : this.OnFriendSelected }, this.props.friendProps, { gamepadEventOverrides: p, bFriendsListEntry: !0 })),
g && !(null === (r = this.context) || void 0 === r ? void 0 : r.IN_GAMEPADUI) && I.createElement("div", { className: "friendInviteButtons" }, I.createElement("div", { className: "friendInviteButton acceptFriendInvite " + o, onClick: () => this.OnAcceptInvite(s), title: (0, A.Xx)("#FriendGroup_Tip_Accept") }, I.createElement(X.JrY, null)), I.createElement("div", { className: "friendInviteButton declineFriendInvite " + m, onClick: () => this.OnDeclineInvite(s), title: (0, A.Xx)("#FriendGroup_Tip_Decline") }, I.createElement(X.pVO, null))),
g && !(null === (a = this.context) || void 0 === a ? void 0 : a.IN_GAMEPADUI) && I.createElement("div", { className: "friendInviteBlockContainer" }, I.createElement($.ji, { onChange: (e) => this.OnBlockInvite(e, s) }), I.createElement("div", { className: "displayColumn" }, I.createElement("div", { className: "blockCommunicationLabel" }, (0, A.Xx)("#FriendGroup_IncomingInvites_Block")), I.createElement("div", { className: "blockCommunicationLabel subtitle" }, (0, A.Xx)("#FriendGroup_IncomingInvites_Block_desc")))),
),
),
);
}
}
let v = "friendGroup",
S = !1,
b = !1,
y = !1;
if ((u && (v += " noTransitions"), this.props.group.modifiable ? ((v += " taggedGroup "), (S = !0)) : this.props.group.m_eDisplayType == c.h1.eOnlineOnlyNotInGame ? ((v += " onlineFriends "), (b = !0)) : this.props.group.m_eDisplayType == c.h1.eOfflineOnly ? ((v += " offlineFriends "), (y = !0)) : this.IsInviteGroup() ? (v += " friendRequests ") : this.IsOutGoingInviteGroup() && (v += " friendOutgoingRequests "), m && (!_ || !_.length))) return I.createElement("div", { className: "friendSearchNoResultsContainer" }, I.createElement("div", null, (0, A.Xx)("#FriendGroup_Search_NoResults", this.props.searchString)), I.createElement("div", { className: "searchSteamSuggestion" }, (0, A.Xx)("#FriendGroup_Search_CantFind")), I.createElement(P.ns, { href: o.De.COMMUNITY_BASE_URL + "search/users" }, (0, A.Xx)("#FriendGroup_Search_Link")));
if (0 == _.length && !this.IsCollapsed()) return null;
let D = 0 != this.m_actions.size,
w = "SortByRecent";
f && (w += " Recent"), p && (w += " Collapsed");
let M = !this.IsInviteGroup() && !this.IsOutGoingInviteGroup(),
k = { onActivate: this.ToggleCollapsed, onOKActionDescription: (0, A.Xx)(p ? "#FriendGroup_Expand" : "#FriendGroup_Collapse"), onContextMenu: this.OnContextMenu, onMenuButton: M && this.OnContextMenu, onMenuActionDescription: M ? (0, A.Xx)("#FriendGroup_Options") : void 0 };
return I.createElement(
h.G,
Object.assign({ className: v }, this.GetDragDropProps(this.props.group.modifiable || this.props.group.accepts_group_removals)),
I.createElement(E.s, { className: "groupHeaderContainer", "flow-children": "row", focusable: !1 }, !m && I.createElement(E.s, Object.assign({ className: "groupName" + (p ? " Collapsed" : "") }, k), I.createElement("div", { className: "ExpandPlusMinus" }, I.createElement(X.FUf, null)), this.props.group.icon_url && I.createElement("img", { className: "groupIcon", src: this.props.group.icon_url }), this.props.group.name, !m && I.createElement("span", { className: this.IsCollapsed() ? "groupCount collapsed" : "groupCount" }, "(", this.props.group.member_count, ")"), S && I.createElement("hr", null)), y && I.createElement(E.s, { className: w, focusable: !0, onActivate: this.ToggleOfflineSortMethod, title: f ? (0, A.Xx)("#FriendGroup_Tip_SortByRecent") : (0, A.Xx)("#FriendGroup_Tip_SortByAlphabet"), onOKActionDescription: (0, A.Xx)("#FriendGroup_ChangeSort") }, I.createElement(X.hnm, null))),
I.createElement(
U.Z,
{ className: "groupList", enter: !u, exit: !u },
_,
g &&
!(null === (l = this.context) || void 0 === l ? void 0 : l.IN_GAMEPADUI) &&
I.createElement(V.Z, { key: "inviteButtons", classNames: "opacityfade-anim", timeout: 320 }, I.createElement("div", { className: "confirmInviteRequestContainer" }, I.createElement("div", { className: "confirmInviteRequestActions" }, D ? I.createElement("div", { className: "confirmInviteButton confirmInvites", onClick: this.OnConfirmChanges }, (0, A.Xx)("#FriendGroup_ConfirmInvites")) : I.createElement("div", { className: "confirmInviteButton confirmInvites dim" }, (0, A.Xx)("#FriendGroup_ConfirmInvites")), I.createElement("div", { className: "confirmInviteButton ignoreAllRequests", onClick: this.OnIgnoreAllInvites }, (0, A.Xx)("#FriendGroup_AllIgnore"))), I.createElement(E.s, { className: "cancelAddFriends", onActivate: this.OnCloseInvites, onOKActionDescription: (0, A.Xx)("#FriendGroup_Close"), title: (0, A.Xx)("#FriendGroup_Close") }, I.createElement(X.Ehc, { angle: -90 })))),
),
S && I.createElement("div", { className: "dropTargetBox" }),
);
}
};
function dt(e, t, n) {
return (0, H.yV)(I.createElement(ht, { browserContext: e, appid: t, ownerWindow: n.currentTarget.ownerDocument.defaultView }), n);
}
(mt.contextType = o.E_), (0, i.gn)([M.ak], mt.prototype, "ToggleCollapsed", null), (0, i.gn)([M.ak], mt.prototype, "OnContextMenu", null), (0, i.gn)([M.ak], mt.prototype, "OnFriendSelected", null), (0, i.gn)([M.ak], mt.prototype, "OnAcceptInvite", null), (0, i.gn)([M.ak], mt.prototype, "OnDeclineInvite", null), (0, i.gn)([M.ak], mt.prototype, "OnBlockInvite", null), (0, i.gn)([M.ak], mt.prototype, "OnConfirmChanges", null), (0, i.gn)([M.ak], mt.prototype, "OnIgnoreAllInvites", null), (0, i.gn)([M.ak], mt.prototype, "OnCloseInvites", null), (0, i.gn)([M.ak], mt.prototype, "ToggleOfflineSortMethod", null), (mt = (0, i.gn)([S.Pi], mt));
class ht extends I.PureComponent {
render() {
return I.createElement(W.xV, null, I.createElement(p.rb, { unAppID: this.props.appid, bShowLargeHeader: !0 }));
}
}
let ut = class extends lt {
constructor(e) {
super(e),
(this.state = { bLocalCollapsed: this.props.collapsed, bIsSubscribedToApp: !1 }),
be.F.BIsSubscribedApp(this.props.group.id).then((e) => {
this.setState({ bIsSubscribedToApp: e });
});
}
GetGroup() {
return this.props.group;
}
PerformDropAction(e) {
return Promise.reject("FriendGameGroups do not accept drops");
}
ToggleCollapsed() {
this.props.groupDisplayPrefs ? this.props.groupDisplayPrefs.ToggleUserGroupCollapsed(this.props.group.unique_id) : this.setState({ bLocalCollapsed: !this.state.bLocalCollapsed });
}
IsCollapsed() {
return this.props.groupDisplayPrefs ? this.props.groupDisplayPrefs.GetUserGroupCollapsed(this.props.group.unique_id) : this.state.bLocalCollapsed;
}
GetFriendRenderContext() {
return (this.m_FriendRenderContext && this.m_FriendRenderContext.friendGroup == this.props.group) || (this.m_FriendRenderContext = { friendGroup: this.props.group, chatContext: "friendslist" }), this.m_FriendRenderContext;
}
OnShowHeaderContextMenu(e) {
let t = this.props.group.id;
if (t) {
d.Ul.AppInfoStore.GetAppInfo(t).is_valid && dt((0, m.Um)(this, e), t, e);
}
}
render() {
if (this.props.bSingletonGroup && 0 == this.props.group.unfiltered_count) return null;
const e = this.IsCollapsed();
let t = [];
if (!e) {
let e = this.props.group.member_list,
n = new Map(),
i = new Map(),
o = new Map();
if (!this.props.bSingletonGroup) {
let t = "",
r = null;
for (let a of e) r && a.persona.player_group != t && n.set(r.accountid, "lastInGroup"), a.persona.player_group && (o.set(a.persona.player_group, a.persona.player_group_size), i.has(a.persona.player_group) ? i.set(a.persona.player_group, i.get(a.persona.player_group) + 1) : i.set(a.persona.player_group, 1), a.persona.player_group != t ? (n.set(a.accountid, "firstInGroup"), (t = a.persona.player_group), (r = a)) : (n.set(a.accountid, "inGroup"), (r = a)));
r && n.set(r.accountid, "lastInGroup");
}
let r = !this.props.bSingletonGroup && this.props.group.id != c.v5,
a = null;
for (let s of e) {
let e = "";
this.state.friendDraggedOut == s && this.state.friendDrag != s && (e += " dragOriginGhost");
let l,
c = !1;
if (n.has(s.accountid)) {
c = !0;
let t = n.get(s.accountid);
if ("lastInGroup" == t) {
let e = i.get(s.persona.player_group),
n = o.get(s.persona.player_group);
if (n <= 1 && 1 == e) t = "";
else if (n && e < n) {
let i = !1;
d.Ul.FriendStore.self.persona.player_group == s.persona.player_group && (i = !0);
let o = n - e,
r = n - e - (i ? 1 : 0),
l = "oneDigit";
o >= 10 && o < 100 ? (l = "twoDigits") : o >= 100 && (l = "manyDigits");
let c = 1 == r ? "#FriendGroup_PlayerGroupFooter_Label_Singular" : "#FriendGroup_PlayerGroupFooter_Label";
i && (c = 0 == r ? "#FriendGroup_PlayerGroupFooter_Label_PlusYouOnly" : 1 == r ? "#FriendGroup_PlayerGroupFooter_Label_PlusYou_Singular" : "#FriendGroup_PlayerGroupFooter_Label_PlusYou"), (t = 1 == e ? "firstInGroup" : "inGroup"), (a = I.createElement(V.Z, { key: s.persona.player_group + "_footer", classNames: "friend-anim", timeout: 320 }, I.createElement("div", { className: "SteamPlayerGroupFooter lastInGroup", draggable: !1 }, I.createElement("div", { className: "SteamPlayerGroupLines" }), I.createElement("div", { className: "SteamPlayerGroupFooterCount " + l }, I.createElement("div", { className: "count" }, "+", o)), I.createElement("div", { className: "SteamPlayerGroupFooterLabel" }, (0, A.Xx)(c, r)))));
}
}
e += " " + t;
}
this.props.bSingletonGroup && (l = I.createElement(pt, { appid: s.persona.m_unGamePlayedAppID })), (e += " " + D.a.hoverClass), t.push(I.createElement(V.Z, { key: s.accountid, classNames: "friend-anim", timeout: 320 }, I.createElement(gt, { friend: s, key: s.accountid, bHideGameName: r, className: e, context: this.GetFriendRenderContext(), bInGroup: c, bFriendsListEntry: !0, listStatusIndicatorLeft: l, bInOverlay: this.props.bInOverlay }))), a && t.push(a);
}
}
let n = "friendGroup gameGroup",
i = this.props.group.name,
o = null;
this.props.bSingletonGroup && ((n += " OtherGamesGroup"), (o = this.props.bOtherGroups ? (0, A.Xx)("#FriendGroup_InGame_Others") : (0, A.Xx)("#FriendGroup_InGame")));
let r = { onActivate: this.ToggleCollapsed, onOKActionDescription: (0, A.Xx)(e ? "#FriendGroup_Expand" : "#FriendGroup_Collapse") };
return (
this.props.bSingletonGroup ||
this.props.group.id == c.v5 ||
(this.state.bIsSubscribedToApp
? ((r.onOptionsButton = () => {
let e = "steam://open/library/details/" + this.props.group.id;
d.Ul.OpenURLInBrowser(e, d.D);
}),
(r.onOptionsActionDescription = (0, A.Xx)("#Friend_Menu_ViewGameInLibrary")))
: ((r.onOptionsButton = () => {
let e = (0, he.FG)(this.props.group.id, "friendcontextmenu");
d.Ul.OpenURLInBrowser(e, d.D);
}),
(r.onOptionsActionDescription = (0, A.Xx)("#Friend_Menu_ViewGameStorePage")))),
I.createElement(h.G, Object.assign({ className: n }, this.GetDragDropProps(this.props.group.modifiable || this.props.group.accepts_group_removals)), I.createElement(E.s, Object.assign({ className: "groupName" + (e ? " Collapsed" : ""), onContextMenu: this.OnShowHeaderContextMenu }, r), I.createElement("div", { className: "gameGroupContainer" }, I.createElement("div", { className: "ExpandPlusMinus" }, I.createElement(X.FUf, null)), o, this.props.group.icon_url && I.createElement("img", { className: "groupIcon", src: this.props.group.icon_url })), i, I.createElement("span", { className: this.IsCollapsed() ? "groupCount collapsed" : "groupCount" }, "(", this.props.group.member_count, ")"), I.createElement("hr", null)), I.createElement(U.Z, { className: this.IsCollapsed() ? "friendsContainer groupCollapsed" : "friendsContainer" }, t))
);
}
};
(0, i.gn)([M.ak], ut.prototype, "ToggleCollapsed", null), (0, i.gn)([M.ak], ut.prototype, "OnShowHeaderContextMenu", null), (ut = (0, i.gn)([S.Pi], ut));
let pt = class extends I.Component {
OnShowGameIconContextMenu(e) {
dt((0, m.Um)(this, e), this.props.appid, e);
}
render() {
let e = 0 != this.props.appid ? d.Ul.AppInfoStore.GetAppInfo(this.props.appid) : null;
return e && e.is_valid ? I.createElement("div", { className: "FriendInGameIcon", onContextMenu: this.OnShowGameIconContextMenu }, I.createElement("img", { className: "gameIcon", alt: "", src: e.icon_url })) : I.createElement("div", { className: "FriendInGameIcon" }, I.createElement("div", { className: "FriendInGameIcon_NA" }, "N/A"));
}
};
(0, i.gn)([M.ak], pt.prototype, "OnShowGameIconContextMenu", null), (pt = (0, i.gn)([S.Pi], pt));
class _t extends I.Component {
OnContextMenu(e) {
if (this.props.disableContextMenu) return;
let t;
if (this.props.onContextMenu) t = this.props.onContextMenu(e);
else {
t = m.g_FriendsUIDesktopApp.FriendHoverStore.GetHover(this.props.friend).OnContextMenu(this.props.context, e);
}
t && this.props.onContextMenuShown && this.props.onContextMenuShown(t);
}
componentWillUnmount() {
this.Hide();
}
Hide() {
m.g_FriendsUIDesktopApp.FriendHoverStore.GetHover(this.props.friend).HideByElement(y.findDOMNode(this));
}
render() {
let e = I.Children.only(this.props.children);
if (e) {
let t = this.props,
n = m.g_FriendsUIDesktopApp.FriendHoverStore.GetHover(t.friend);
return I.cloneElement(e, { onMouseEnter: (e) => n.Show(e, t.context, t.direction), onMouseLeave: n.Hide, onContextMenu: this.OnContextMenu });
}
return this.props.children;
}
}
(0, i.gn)([M.ak], _t.prototype, "OnContextMenu", null);
const gt = (0, S.Pi)((e) => {
const t = (0, k.Wy)(),
n = (0, m.rb)(t.ownerWindow),
i = !(0, d.ns)(n, d.D);
return I.createElement(Ct, Object.assign({ bInOverlay: i }, e));
});
let Ct = class extends I.Component {
constructor(e) {
super(e), (this.state = { bActive: !1, bVisible: !1, bHovered: !1 });
}
OnWaypointEnter() {
this.setState({ bVisible: !0 });
}
OnWaypointLeave() {
this.setState({ bVisible: !1 });
}
OnMouseEnter() {
this.setState({ bHovered: !0 });
}
OnMouseLeave() {
this.setState({ bHovered: !1 });
}
OnDoubleClick(e) {
this.RunAction(!0, e);
}
OnClick(e) {
this.RunAction(!1, e);
}
OnOKButton(e) {
this.RunAction(!0, e);
}
RunAction(e, t) {
!this.props.bSingleClickActivate == e && (this.props.action ? this.props.action(this.props.friend, t) : this.props.noActions || this.props.friend.OpenChatDialog((0, m.Um)(this, t)));
}
OnDragStart(e) {
e.dataTransfer.setData("text/plain", this.props.friend.persona.m_strPlayerName), e.dataTransfer.setData("text/steamid", this.props.friend.persona.m_steamid.ConvertTo64BitString()), this.props.friend.is_friend ? m.g_FriendsUIDesktopApp.DragDropManager.StartDrag({ type: "friend", source: this.props.context.chatContext, friend: this.props.friend, sourceContext: this.props.context }) : m.g_FriendsUIDesktopApp.DragDropManager.StartDrag({ type: "nonfriend", source: this.props.context.chatContext, friend: this.props.friend, sourceContext: this.props.context }), m.g_FriendsUIDesktopApp.FriendHoverStore.GetHover(this.props.friend).HideAllInstances();
}
OnDragEnd(e) {
m.g_FriendsUIDesktopApp.DragDropManager.EndDrag();
}
OnShowContextMenu(e) {
let t = (0, p.$W)((0, m.Um)(this, e), this.props.context, this.props.friend, e);
t && this.OnContextMenuShown(t);
}
OnContextMenuShown(e) {
this.setState({ bActive: !0 }),
e.SetOnHideCallback(() => {
this.setState({ bActive: !1 });
});
}
render() {
var e, t, n;
const o = this.props,
{ friend: r, showVoiceLevel: a, bHideGameName: s, bHideEnhancedRichPresenceLabel: l, context: c, action: m, noActions: h, notDraggable: u, disableContextMenu: p, className: _, bInVoiceList: g, listStatusIndicator: C, listStatusIndicatorLeft: f, bInGroup: v, bFriendsListEntry: S, bForcePersonaNameDisplay: b, bSingleClickActivate: y, avatarSize: D = "Medium", bHidePersona: R, bHideSnooze: M, bHideStatus: k, bHideStatusInfo: T, bInGameIcon: L, statusPosition: G, lastChat: O, gamepadEventOverrides: F, children: B, bInOverlay: x } = o,
N = (0, i._T)(o, ["friend", "showVoiceLevel", "bHideGameName", "bHideEnhancedRichPresenceLabel", "context", "action", "noActions", "notDraggable", "disableContextMenu", "className", "bInVoiceList", "listStatusIndicator", "listStatusIndicatorLeft", "bInGroup", "bFriendsListEntry", "bForcePersonaNameDisplay", "bSingleClickActivate", "avatarSize", "bHidePersona", "bHideSnooze", "bHideStatus", "bHideStatusInfo", "bInGameIcon", "statusPosition", "lastChat", "gamepadEventOverrides", "children", "bInOverlay"]);
if ((r.LoadIfNecessary(), !r.is_ready)) return I.createElement("div", null);
let P = d.Ul.CMInterface.steamid.GetAccountID() == r.accountid,
U = null,
V = 0;
this.props.showVoiceLevel && (V = d.Ul.VoiceStore.get_volume(r.accountid));
let H,
W = Object.assign(Object.assign({}, N), { className: "friend " + (0, ce.sB)(r.persona) });
if ((_ && (W.className += " " + _), S && (W.className += " friendStatusHover"), P)) {
let e = d.Ul.VoiceStore.IsAttemptingInitialConnection(),
t = d.Ul.VoiceStore.HasBeenAttemptingOverTwoSeconds(),
n = d.Ul.VoiceStore.IsAttemptingReconnect(),
i = "https://support.steampowered.com/kb_article.php?ref=2598-RTZB-6114",
o = (0, A.Xx)("#VoiceChatConnectingHelp"),
r = null;
t ? (r = (0, A.Xx)("#VoiceChatConnecting")) : n && (r = (0, A.Xx)("#VoiceChatReconnecting")), r && (U = P ? () => I.createElement("a", { target: "_blank", title: o, href: i }, r) : () => r);
let a = "";
e && (a += " connecting"), t && (a += " slowconnecting"), n && (a += " reconnecting"), (W.className += a);
}
if (((h && !m) || ((W.onDoubleClick = this.OnDoubleClick), (W.onClick = this.OnClick), (W.onOKButton = this.OnOKButton)), h || p || !(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) || ((W.onContextMenu = this.OnShowContextMenu), (W.onMenuButton = this.OnShowContextMenu), (W.onOKActionDescription = (0, A.Xx)("#Friend_Menu_SendMessage")), (W.onMenuActionDescription = (0, A.Xx)("#Friend_Menu_Open"))), h || u || ((W.onDragStart = this.OnDragStart), (W.onDragEnd = this.OnDragEnd), (W.draggable = !0)), F && (W = Object.assign(Object.assign({}, W), F)), B)) H = I.createElement(E.s, Object.assign({}, W), B);
else {
let e,
i = 100,
o = {};
if (a && 1 != V) {
let e = 3.2,
t = Math.min(V * e, 1),
n = Math.max(0, i * t);
(n = Math.round(10 * n) / 10), (o.height = n + "%"), (o.top = "auto"), n > 1 && (W.className += " speaking");
}
c && c.group && ((e = c.group.GetMemberPartyBeacon(r.accountid)), e && (W.className += " partyBeacon")), this.state.bActive && (W.className += " Friend_ContextMenuActive");
let m,
u = d.Ul.VoiceStore.GetPerUserMuting(r.accountid),
_ = null,
S = null,
b = this.state.bVisible && !(null === (t = this.context) || void 0 === t ? void 0 : t.IN_GAMEPADUI) && d.Ul.SettingsStore.FriendsSettings.bAnimatedAvatars && r.persona.is_online;
if (r.BLoadedEquippedItems()) {
let e = r.GetEquippedProfileItems();
e && ((_ = e.animated_avatar), (S = e.avatar_frame));
}
if (L && r.persona.is_ingame) {
let e = d.Ul.AppInfoStore.GetAppInfo(r.persona.m_unGamePlayedAppID);
e.is_valid && (m = I.createElement("div", { className: "FavoriteFriend_GameIcon" }, I.createElement("img", { className: "gameIcon", src: e.icon_url, draggable: !1 })));
}
let y = I.createElement(w._1, { key: `${r.persona.GetAccountID()}_${r.persona.is_online}`, loopDuration: b ? "Medium" : "None", persona: r.persona, animatedAvatar: _, avatarFrame: S, size: D, statusStyle: o, statusPosition: G, bParentHovered: r.persona.is_online && this.state.bHovered, bLimitProfileFrameAnimationTime: !b || x }, g && u && I.createElement(X.ffh, null), m);
h || (y = I.createElement(_t, { friend: r, context: c, disableContextMenu: p, onContextMenuShown: this.OnContextMenuShown }, y));
let A = c && "chatmemberlist" == c.chatContext,
F = "";
2 != r.efriendrelationship || A || (void 0 === d.Ul.FriendStore.FriendGroupStore.incoming_invites_group.map_steamid_to_mutual_friends.get(r.steamid64) && (F = "noMutualFriends"), (U = () => I.createElement(ft, { friend: r })));
let B = null;
if (O && O.GetLastMessage()) {
const e = d.Ul.ChatStore.NotificationBBCodeParser.ParseBBCode(O.GetLastMessage(), { chat: O, unAccountIDSender: O.accountid_last_message, key: O.GetLastMessage(), rtTimestamp: O.time_last_message, onLoad: () => {} });
B = () => I.createElement("div", { className: ve.LastMessage }, `${(e && e.body) || (0, Te.p8)(O.GetLastMessage())}`);
} else r.persona.HasCurrentGameRichPresence() ? (B = () => r.persona.GetCurrentGameRichPresence()) : r.persona.m_broadcastAccountId && (B = () => r.GetBroadcastDescription());
H = I.createElement(
E.s,
Object.assign({ onMouseEnter: this.OnMouseEnter, onMouseLeave: this.OnMouseLeave }, W),
I.createElement(Le.h, { onEnter: this.OnWaypointEnter, onLeave: this.OnWaypointLeave }),
I.createElement(vt, { friend: r }),
v && I.createElement("div", { className: "SteamPlayerGroupLines" }),
g && I.createElement(St, { friend: r }),
f,
y,
!T && I.createElement(ge.o, { className: (0, Ce.Z)("labelHolder", F), persona: r.persona, eFriendRelationship: r.efriendrelationship, bIsSelf: d.Ul.FriendStore.self == r, strNickname: r.nickname, bParenthesizeNicknames: d.Ul.SettingsStore.CommunityPreferences.bParenthesizeNicknames, renderStatus: U, renderRichPresence: B, bHideGameName: s, bHideStatus: k, bHideEnhancedRichPresenceLabel: l, bHidePersona: R, bHideSnooze: M, bCompactView: d.Ul.SettingsStore.FriendsSettings.bCompactFriendsList, onContextMenu: (null === (n = this.context) || void 0 === n ? void 0 : n.IN_GAMEPADUI) || h || p ? void 0 : this.OnShowContextMenu, bHasPartyBeacon: void 0 !== e }),
C,
);
}
return H;
}
};
(Ct.contextType = o.E_), (0, i.gn)([M.ak], Ct.prototype, "OnWaypointEnter", null), (0, i.gn)([M.ak], Ct.prototype, "OnWaypointLeave", null), (0, i.gn)([M.ak], Ct.prototype, "OnMouseEnter", null), (0, i.gn)([M.ak], Ct.prototype, "OnMouseLeave", null), (0, i.gn)([M.ak], Ct.prototype, "OnDoubleClick", null), (0, i.gn)([M.ak], Ct.prototype, "OnClick", null), (0, i.gn)([M.ak], Ct.prototype, "OnOKButton", null), (0, i.gn)([M.ak], Ct.prototype, "OnDragStart", null), (0, i.gn)([M.ak], Ct.prototype, "OnDragEnd", null), (0, i.gn)([M.ak], Ct.prototype, "OnShowContextMenu", null), (0, i.gn)([M.ak], Ct.prototype, "OnContextMenuShown", null), (Ct = (0, i.gn)([S.Pi], Ct));
const ft = (0, S.Pi)(function (e) {
const { friend: t } = e;
let n,
i,
o = d.Ul.FriendStore.FriendGroupStore.incoming_invites_group.map_steamid_to_mutual_friends.get(t.steamid64);
return (
(0, I.useEffect)(() => {
void 0 === o && d.Ul.FriendStore.FriendGroupStore.EnsureMutualFriendsForIncomingInvites();
}, [o]),
void 0 === o ? (i = (0, A.Xx)("#FriendGroup_NoMutualFriends")) : ((i = (0, A.kb)("#FriendGroup_YesMutualFriends", o.size)), (n = o.size)),
I.createElement("span", { className: "inviteLabel" }, I.createElement("span", { className: "mutualFriendNumber" }, n && n + " "), i)
);
}),
vt = (0, S.Pi)((e) => {
const { friend: t } = e,
n = I.useCallback(() => t.LoadEquippedProfileItems(), [t]);
return !t.BLoadedEquippedItems() && t.persona.is_online && d.Ul.SettingsStore.FriendsSettings.bAnimatedAvatars ? I.createElement(Le.h, { onEnter: n, topOffset: "-500px" }) : null;
});
let St = class extends I.Component {
render() {
let e = this.props.friend,
t = d.Ul.CMInterface.steamid.GetAccountID() == e.accountid,
n = "voiceStatusIconsContainer",
i = "",
o = "",
r = !1,
a = !1,
s = !1,
l = d.Ul.VoiceStore.GetPerUserMuting(e.accountid),
c = d.Ul.VoiceStore.GetUserMutedRemotely(e.accountid),
m = d.Ul.VoiceStore.GetOutputMutedRemotely(e.accountid);
return (
t ? ((r = d.Ul.VoiceStore.IsMicMuted()), (a = d.Ul.VoiceStore.IsOutputMuted()), (s = d.Ul.VoiceStore.BNoMicAvailableForSession()), r && (n += " mic_muted_self"), a && (n += " output_muted_self")) : (s = d.Ul.VoiceStore.GetUserHasNoMicForSession(e.accountid)),
l && (n += " muted_locally"),
c && (n += " mic_muted_remotely"),
m && (n += " output_muted_remotely"),
s && (n += " no_mic_for_session"),
s ? (i = (0, A.Xx)("#Tooltip_MicStatus_NoMic")) : c ? (i = (0, A.Xx)("#Tooltip_RemoteMicStatus_Muted")) : r && (i = (0, A.Xx)("#Tooltip_YourMicStatus_Muted")),
m ? (o = (0, A.Xx)("#Tooltip_RemoteOutputStatus_Muted")) : a && (o = (0, A.Xx)("#Tooltip_YourOutputStatus_Muted")),
I.createElement("div", { className: n }, I.createElement("div", { className: "voicestatusIcon voiceStatusMic disabled", title: i }, I.createElement(X.JgI, { off: !0 })), I.createElement("div", { className: "voicestatusIcon voiceStatusOutput disabled", title: o }, I.createElement(X.bpe, { off: !0 })))
);
}
};
St = (0, i.gn)([S.Pi], St);
let bt = class extends I.Component {
render() {
const { friend: e, bLarge: t, className: n, context: i, children: o } = this.props;
return I.createElement(_t, { friend: e, context: i }, I.createElement("div", { className: (0, Ce.Z)("friend", "FriendAvatar", (0, ce.sB)(e.persona), n) }, I.createElement(w.vV, { persona: e.persona, size: t ? "Large" : "Medium", className: n }, o)));
}
};
bt = (0, i.gn)([S.Pi], bt);
let It = class extends I.Component {
render() {
let e,
t = d.Ul.ChatStore.FriendChatStore.GetUnreadFriendMessageCount(this.props.browserContext);
return this.props.bScrolledFromTop && t > 0 && (e = I.createElement(V.Z, { classNames: "unread-messages-anim", timeout: 320 }, I.createElement("div", { className: "unreadMessageViolator", onClick: this.props.onClick }, 1 == t && (0, A.Xx)("#FriendGroup_UnreadMessagesViolator"), t > 1 && (0, A.Xx)("#FriendGroup_UnreadMessagesViolatorPlural", t)))), I.createElement(U.Z, null, e);
}
};
It = (0, i.gn)([S.Pi], It);
let yt = class extends I.Component {
constructor(e) {
super(e), (this.state = { collapsed: !1 });
}
OnHeaderClick(e) {
this.setState({ collapsed: !this.state.collapsed });
}
render() {
let e = this.props.friendChatStore.GetFriendsWithUnreadMessages(this.props.browserContext);
if (!e.length) return null;
let t = this.state.collapsed,
n = t
? null
: e.map((e) => {
let t = e.unread_message_count,
n = e.chat_partner,
i = I.createElement("div", { className: "FriendMessageCount" }, t);
return I.createElement(V.Z, { key: n.accountid, classNames: "friend-anim", timeout: 320 }, I.createElement("div", { className: "unreadFriend" }, I.createElement(gt, { friend: n, key: n.accountid, context: { chat: e }, bFriendsListEntry: !0, listStatusIndicator: i, bInOverlay: this.props.browserContext.m_unAppID && 0 != this.props.browserContext.m_unAppID })));
});
return I.createElement("div", { className: "friendGroup" }, I.createElement("div", { className: "groupName" + (t ? " Collapsed" : ""), onClick: this.OnHeaderClick }, I.createElement("div", { className: "ExpandPlusMinus" }, I.createElement(X.FUf, null)), (0, A.Xx)("#FriendGroup_UnreadMessages"), I.createElement("span", { className: "groupCount" }, "(", e.length, ")"), I.createElement("hr", null)), I.createElement(U.Z, null, n));
}
};
(0, i.gn)([M.ak], yt.prototype, "OnHeaderClick", null), (yt = (0, i.gn)([S.Pi], yt));
},
31075: (e, t, n) => {
"use strict";
n.d(t, { J: () => w, m: () => M });
var i = n(85556),
o = n(84446),
r = n(19339),
a = n(50649),
s = n(27378),
l = n(83817),
c = n(87018),
m = n(84290),
d = n(46057),
h = n(20850),
u = n.n(h),
p = n(16518),
_ = n(618),
g = n(72746),
C = n(37234),
f = n(56666),
v = n(11259),
S = n(2049),
b = n(38461),
I = n(71357),
y = n(88669),
E = n(68816);
const D = (e) => {
const t = s.useRef();
return s.createElement(
E.e1,
{ onEscKeypress: e.closeModal },
s.createElement(
v.oX,
{
classNameContent: "CreateChatChannelDialog",
onSubmit: () => {
e.onResult(t.current.value), e.closeModal();
},
},
s.createElement(v.h4, null, (0, m.Xx)(e.title)),
s.createElement(v.uT, null, s.createElement(v.II, { ref: t, autoFocus: !0 })),
s.createElement(v.$_, null, s.createElement(v.o9, { onCancel: e.closeModal })),
),
);
},
w = (0, a.Pi)((e) => {
var t;
const n = null != e.fnOKButton,
i = e.chatRoom.GetGroup().BCanAdminChannel(),
o = e.chatRoom.IsTempVoiceRoom();
let r = e.chatRoom.BVoiceActive(),
a = e.chatRoom.voice_active_member_list.member_list.length > 0;
return s.createElement(
f.eh,
{ focusable: !0, className: (0, c.Z)(u().GroupRoomContainer, r && u().UserInRoom, a && u().ActiveVoiceRoom), onOKButton: e.fnOKButton, onOKActionDescription: null !== (t = e.strOKActionDescription) && void 0 !== t ? t : (0, m.Xx)("#VoiceChat_ManageRoom"), onSecondaryButton: e.fnSecondaryButton, onSecondaryActionDescription: e.strSecondaryActionDescription, onOptionsButton: e.fnOptionsButton, onOptionsActionDescription: e.strOptionsActionDescription, onGamepadFocus: e.fnOnFocus },
s.createElement(
l.s,
{
focusable: !n,
className: u().RoomHeader,
onOKButton: n
? void 0
: () => {
g.Ul.UIStore.ShowAndOrActivateChatRoomGroup(e.context, e.chatRoom.GetGroup(), !0).SelectChat(e.chatRoom.GetRoomID()), e.fnCloseModal && e.fnCloseModal();
},
onOKActionDescription: (0, m.Xx)("#VoiceChat_ViewQuickChat"),
onSecondaryButton: i
? (t) => {
(0, I.p3)((0, y.RA)(t), (0, m.Xx)("#Chat_Actions_RemoveRoom"), (0, m.Xx)("#Chat_Actions_RemoveRoom_Confirm"), (0, m.Xx)("#Chat_Actions_RemoveRoom_Action")).then(() => {
e.chatRoom.GetGroup().DeleteChatRoom(e.chatRoom.GetRoomID());
});
}
: void 0,
onSecondaryActionDescription: i ? (0, m.Xx)("#Chat_Actions_RemoveRoom") : void 0,
onOptionsButton: i
? (t) => {
(0, E.BR)(s.createElement(D, { title: (0, m.Xx)("#Chat_Actions_ChangeRoomName"), description: void 0, onResult: (t) => e.chatRoom.GetGroup().RenameRoom(e.chatRoom.GetRoomID(), t) }), (0, y.RA)(t));
}
: void 0,
onOptionsActionDescription: i ? (o ? (0, m.Xx)("#Chat_Actions_SaveChannel") : (0, m.Xx)("#Chat_Actions_ChangeRoomName")) : void 0,
},
s.createElement(p.Cq4, null),
s.createElement("div", { className: u().RoomTitle }, e.chatRoom.name),
),
e.chatRoom.voice_active_member_list.member_list.map((t) => {
const i = t.accountid != g.Ul.ChatStore.VoiceChat.GetLocalAccountID(),
o = t.accountid != g.Ul.ChatStore.VoiceChat.GetLocalAccountID(),
r = g.Ul.ChatStore.VoiceChat.GetPerUserMuting(t.accountid),
a = g.Ul.ChatStore.VoiceChat.GetUserMutedRemotely(t.accountid),
l = g.Ul.ChatStore.VoiceChat.GetOutputMutedRemotely(t.accountid);
let h = [];
r && h.push(s.createElement("div", { className: u().MicMutedLocally }, s.createElement(p.ffh, { muted: !0 }))), a && h.push(s.createElement("div", { className: u().MicMutedRemotely }, s.createElement(p.JgI, { off: !0 }))), l && h.push(s.createElement("div", { className: u().OutputMutedRemotely }, s.createElement(p.bpe, { off: !0 })));
const _ = i ? (r ? (0, m.Xx)("#VoiceChat_Unmute") : (0, m.Xx)("#VoiceChat_Mute")) : null;
return s.createElement(d.mo, {
key: t.accountid,
noActions: n,
friend: t,
className: (0, c.Z)(u().GroupVoiceChatFriend),
context: { chat: e.chatRoom, chatContext: "friendslist" },
avatarSize: "Medium",
statusPosition: "right",
showVoiceLevel: !0,
gamepadEventOverrides: n
? void 0
: {
onOKButton: () => {
o && (t.OpenChatDialog(e.context), e.fnCloseModal && e.fnCloseModal());
},
onOKActionDescription: o ? (0, m.Xx)("#Friend_Menu_SendMessage") : null,
onSecondaryButton: () => {
i && g.Ul.ChatStore.VoiceChat.SetPerUserMuting(t.accountid, !r);
},
onSecondaryActionDescription: _,
onOptionsButton: () => {},
onOptionsActionDescription: null,
},
listStatusIndicator: h,
});
}),
);
});
function R(e) {
let { chat: t, onHold: n } = e;
return s.createElement(
l.s,
{ className: u().PendingVoiceChatRequest },
s.createElement(d.mo, { noActions: !0, friend: t.chat_partner, className: (0, c.Z)(u().FriendVoiceChat, t.unread_message_count > 0 && "unreadFriend"), context: { chat: t, chatContext: "friendslist" }, avatarSize: "Large", statusPosition: "right" }),
s.createElement(
v.zx,
{
onClick: () => {
g.Ul.VoiceStore.InitiateFriendChat(t.accountid_partner);
},
},
n ? (0, m.Xx)("#Voice_Resume") : (0, m.Xx)("#Voice_Accept"),
),
s.createElement(
v.zx,
{
onClick: () => {
g.Ul.VoiceStore.OnRejectOneOnOneVoiceChatForPartner(t.accountid_partner);
},
},
n ? (0, m.Xx)("#Voice_End") : (0, m.Xx)("#Voice_Decline"),
),
);
}
function A(e) {
let { vecPendingChats: t } = e;
if (0 == t.length) return null;
let n = !1;
return (
t.forEach((e) => {
n || (n = g.Ul.VoiceStore.BSelfHadPreviouslyJoinedOneOnOneChat(null == e ? void 0 : e.accountid_partner));
}),
s.createElement(
s.Fragment,
null,
s.createElement("div", { className: (0, c.Z)(u().Title, u().PendingVoiceChats) }, n ? (0, m.Xx)("#VoiceChat_CallOnHold") : (0, m.Xx)("#VoiceChat_PendingRequests")),
s.createElement(
l.s,
{ className: u().PendingVoiceChatsList },
t.map((e) => s.createElement(R, { key: e.unique_id, chat: e, onHold: n })),
),
)
);
}
let M = class extends s.Component {
constructor(e) {
super(e);
}
componentDidMount() {
this.m_BrowserContext = (0, C.Um)(this);
}
OnInputGainChanged(e) {
this.props.chats.VoiceChat.IsMicMuted() && this.props.chats.VoiceChat.ToggleMicMuting(), this.props.chats.VoiceChat.SetVoiceInputGain(this.props.chats.VoiceChat.ConvertSliderToGainValue(e, b.Ys.k_MaxInputOutputGainValue));
}
OnOutputGainChanged(e) {
this.props.chats.VoiceChat.IsOutputMuted() && this.props.chats.VoiceChat.ToggleOutputMuting(), this.props.chats.VoiceChat.SetVoiceOutputGain(this.props.chats.VoiceChat.ConvertSliderToGainValue(e, b.Ys.k_MaxInputOutputGainValue));
}
render() {
let e = this.props.chats.GetActiveVoiceChat();
const t = e instanceof r.a ? e : void 0,
n = e instanceof o.K ? e : void 0,
i = this.props.chats.FriendChatStore.GetAllChats().filter((e) => {
let n = g.Ul.VoiceStore.BPartnerHasRequestedAndIsInOneOnOneChat(e.accountid_partner);
return (null == t ? void 0 : t.accountid_partner) == e.accountid_partner && (n = !1), n;
});
if (!this.props.chats.VoiceChat.IsAnyVoiceActive() || !e) return 0 != i.length ? s.createElement(A, { vecPendingChats: i }) : s.createElement("div", { className: u().Title }, (0, m.Xx)("#VoiceChat_NoneActive"));
const a = null == t ? void 0 : t.GetMember(t.accountid_partner);
let h;
(null == t ? void 0 : t.unread_message_count) > 0 && (h = s.createElement("div", { className: "FriendMessageCount" }, t.unread_message_count));
const C = () => {
SteamClient.URL.ExecuteSteamURL("steam://open/settings/audio"), window.parent.postMessage({ message: "CloseSideMenus" }, "https://steamloopback.host");
},
f = this.props.chats.VoiceChat.IsOutputMuted() ? 0 : this.props.chats.VoiceChat.ConvertGainValueToSliderValue(this.props.chats.VoiceChat.GetVoiceOutputGain(), b.Ys.k_MaxInputOutputGainValue),
S = this.props.chats.VoiceChat.IsMicMuted() ? 0 : this.props.chats.VoiceChat.ConvertGainValueToSliderValue(this.props.chats.VoiceChat.GetVoiceInputGain(), b.Ys.k_MaxInputOutputGainValue),
I = this.props.chats.VoiceChat.GetVoiceInputGain() > 0,
y = this.props.chats.VoiceChat.GetVoiceOutputGain() > 0;
return s.createElement(
s.Fragment,
null,
s.createElement(A, { vecPendingChats: i }),
s.createElement("div", { className: u().Title }, (0, m.Xx)("#VoiceChat_InVoiceChat")),
s.createElement(
"div",
{ className: u().VoiceChatList },
s.createElement(l.s, { className: (0, c.Z)(u().FriendVoiceChatSliderContainer, 0 == S && "MicMuted"), onOKActionDescription: (0, m.Xx)("#VoiceChat_AdjustMicVolume"), onSecondaryButton: I ? () => this.props.chats.VoiceChat.ToggleMicMuting() : void 0, onSecondaryActionDescription: I ? (this.props.chats.VoiceChat.IsMicMuted() ? (0, m.Xx)("#VoiceChat_UnmuteMic_Deck") : (0, m.Xx)("#VoiceChat_MuteMic_Deck")) : void 0, onMenuButton: C, onMenuActionDescription: (0, m.Xx)("#VoiceChat_GoToAudioSettings") }, s.createElement(v.z2, { min: 0, max: 100, value: S, onChange: this.OnInputGainChanged, icon: s.createElement(p.JgI, { off: 0 == S, onClick: () => this.props.chats.VoiceChat.ToggleMicMuting() }), className: u().SliderPadding })),
s.createElement(l.s, { className: u().FriendVoiceChatSliderContainer, onOKActionDescription: (0, m.Xx)("#VoiceChat_AdjustVoiceVolume"), onSecondaryButton: y ? () => this.props.chats.VoiceChat.ToggleOutputMuting() : void 0, onSecondaryActionDescription: y ? (this.props.chats.VoiceChat.IsOutputMuted() ? (0, m.Xx)("#VoiceChat_UnmuteVoice_Deck") : (0, m.Xx)("#VoiceChat_MuteVoice_Deck")) : void 0, onMenuButton: C, onMenuActionDescription: (0, m.Xx)("#VoiceChat_GoToAudioSettings") }, s.createElement(v.z2, { min: 0, max: 100, value: f, onChange: this.OnOutputGainChanged, icon: s.createElement(p.bpe, { off: 0 == f, onClick: () => this.props.chats.VoiceChat.ToggleOutputMuting() }), className: u().SliderPadding })),
t && s.createElement(l.s, { className: (0, c.Z)(u().FriendVoiceChatContainer, "FriendVoiceChatContainer") }, s.createElement(d.mo, { friend: a, className: (0, c.Z)(u().FriendVoiceChat, t.unread_message_count > 0 && "unreadFriend"), context: { chat: t, chatContext: "friendslist" }, avatarSize: "Medium", statusPosition: "right", listStatusIndicator: h }), s.createElement(l.s, { focusable: !0, className: u().LeaveVoiceChat, onActivate: () => this.props.chats.VoiceChat.OnUserEndVoiceChat() }, s.createElement(p.eNM, null), (0, m.Xx)("#VoiceChat_Leave"))),
n &&
s.createElement(
l.s,
{ className: u().GroupVoiceChatContainer },
s.createElement(
l.s,
{
focusable: !0,
className: u().GroupContainer,
onOKButton: () => {
g.Ul.UIStore.ShowAndOrActivateChatRoomGroup(this.m_BrowserContext, n.GetGroup(), !0);
},
onOKActionDescription: (0, m.Xx)("#ChatRoom_Invite_Accept_Inviter"),
},
s.createElement(_._P, { group: n.GetGroup(), small: !0 }),
s.createElement("div", { className: u().GroupTitle }, n.GetGroup().name),
),
s.createElement(w, { context: this.m_BrowserContext, chatRoom: n }),
s.createElement(l.s, { focusable: !0, className: u().LeaveVoiceChat, onActivate: () => this.props.chats.VoiceChat.OnUserEndVoiceChat() }, s.createElement(p.eNM, null), (0, m.Xx)("#VoiceChat_Leave")),
),
),
);
}
};
(0, i.gn)([S.ak], M.prototype, "OnInputGainChanged", null), (0, i.gn)([S.ak], M.prototype, "OnOutputGainChanged", null), (M = (0, i.gn)([a.Pi], M));
},
74915: (e, t, n) => {
"use strict";
n.d(t, { w: () => Pe });
var i = n(85556),
o = n(27378),
r = n(2049),
a = n(79588),
s = n(50649),
l = n(77385),
c = n(54530),
m = n(10553),
d = n(72746),
h = n(97224),
u = n(60176),
p = n(16518),
_ = n(78654),
g = n(84290),
C = n(67915),
f = n(84446),
v = n(46962),
S = n(88669),
b = n(21298),
I = n(83817),
y = n(14341),
E = n(19953),
D = n(92883),
w = n(23346),
R = n(46057),
A = n(41758),
M = n(24780);
var k = n(87018),
T = n(22982),
L = n.n(T),
G = n(29205),
O = n(31542),
F = n(41370),
B = n(28413),
x = n(91867),
N = n(82909),
P = n(51579),
U = n(37153),
V = n(94207),
H = n(36175);
const W = (0, s.Pi)((e) => {
const { msg: t, chat: n } = e,
{ showPicker: i } = Z(n, t);
if (0 === t.reactions.length) return null;
return o.createElement(
"div",
{ className: V.MessageReactions },
t.reactions.map((e) => o.createElement(X, { key: e.strReaction, chat: n, msg: t, reaction: e, onClick: () => ((e) => n.UpdateMessageReaction(t, e.eReactionType, e.strReaction, !e.bUserReacted))(e) })),
o.createElement($, { className: V.OpenPickerButton, onClick: i }),
);
});
const X = (0, s.Pi)((e) => {
const {
onClick: t,
reaction: { bUserReacted: n, cReactors: i },
chat: r,
msg: a,
} = e,
[s, l] = (function (e = 400) {
const [t, n] = (0, o.useState)(!1),
i = (0, o.useRef)();
return (
(0, o.useEffect)(() => () => clearTimeout(i.current), []),
[
t,
(o) => {
o && !t && void 0 === i.current
? (i.current = window.setTimeout(() => {
(i.current = void 0), n(!0);
}, e))
: o || (window.clearTimeout(i.current), (i.current = void 0), t && n(o));
},
]
);
})(),
c = (0, o.useRef)(),
m = { borderColor: n ? "#8D8E94" : "#1B1C20" };
return o.createElement("div", { onClick: t, style: m, className: V.MessageReaction, onMouseEnter: () => l(!0), onMouseLeave: () => l(!1), ref: c }, o.createElement(j, { reaction: e.reaction }), o.createElement("div", { className: V.ReactionCount }, i), s && o.createElement(q, { target: c.current, reaction: e.reaction, chat: r, msg: a }));
});
function j(e) {
switch (e.reaction.eReactionType) {
case 1:
return o.createElement(z, Object.assign({}, e));
case 2:
return o.createElement(K, Object.assign({}, e));
default:
return console.error(`Unknown message reaction type: ${e.reaction.eReactionType}`), null;
}
}
function z(e) {
const { reaction: t, large: n } = e;
return o.createElement("img", { className: (0, k.Z)(V.EmoticonReaction, n && V.Large), src: x.u.GetEmoticonURL(t.strReaction, e.large) });
}
function K(e) {
const {
reaction: { strReaction: t },
large: n,
} = e,
i = (0, H.a)(E.De.COMMUNITY_CDN_URL, t);
return o.createElement("img", { className: (0, k.Z)(V.StickerReaction, n && V.Large), src: i });
}
const q = (0, s.Pi)((e) => {
const { target: t, reaction: n, chat: i, msg: r } = e,
{ strReaction: a, cReactors: s } = n,
l = i.GetMessageReactionReactors(r, n, 3);
let c = (function (e, t, n) {
const i = d.Ul.FriendStore.self;
if (0 === t.length) return 1 === n ? (0, g.kQ)("#MessageReaction_DescriptionCountOnly", e) : (0, g.kQ)("#MessageReaction_DescriptionCountOnly_Plural", n, e);
const r = t.filter((e) => e !== i.accountid),
a = r.length != t.length;
return t.length < n
? t.length >= 2
? (0, g.kQ)(
"#MessageReaction_DescriptionMany" + (a ? "You" : ""),
r.slice(0, a ? 1 : 2).map((e) => o.createElement(Y, { key: e.toString(), accountid: e })),
n - 2,
e,
)
: a
? (0, g.kQ)("#MessageReaction_DescriptionYouAndCount" + (n - 1 == 1 ? "" : "_Plural"), n - 1, e)
: 1 === n
? (0, g.kQ)("#MessageReaction_DescriptionCountOnly", e)
: (0, g.kQ)("#MessageReaction_DescriptionCountOnly_Plural", n, e)
: (0, g.kQ)(`#MessageReaction_Description${n}${a ? "You" : ""}`, ...r.map((e) => o.createElement(Y, { key: e.toString(), accountid: e })), e);
})(o.createElement("span", { className: V.ReactionName }, a), l, s);
return (0, O.createPortal)(o.createElement(B.T, { direction: "top", target: t, className: V.ReactionHover }, o.createElement(j, { reaction: n, large: !0 }), o.createElement("div", { className: V.HoverDescription }, c)), t.ownerDocument.body);
});
function Z(e, t) {
const [n, i] = (0, o.useState)(null);
return {
bOpen: !!n,
showPicker: (r) => {
if (n) return;
const a = { bOverlapHorizontal: !0, strClassName: V.ManageAppFiltersPopupContextMenu },
s = (0, N.yV)(o.createElement(Q, { chat: e, msg: t, onRequestClose: () => s && s.Hide() }), r, a);
s.SetOnHideCallback(() => i(null)), i(s);
},
};
}
function Q(e) {
const { msg: t, chat: n, onRequestClose: i } = e,
r = (e, o) => {
const r = 1 == e ? `:${o}:` : o,
a = t.reactions.find((e) => e.strReaction === r),
s = !a || !a.bUserReacted;
n.UpdateMessageReaction(t, e, r, s), i();
};
return o.createElement(P.jk, { emoticonHoverStore: U.$, emoticonStore: d.Ul.ChatStore.EmoticonStore, onEmoticonSelected: (e) => r(1, e), onStickerSelected: (e) => r(2, e), strFlairGroupID: "" });
}
function $(e) {
const { className: t } = e,
n = (0, i._T)(e, ["className"]);
return o.createElement("svg", Object.assign({ width: 30, height: 25, viewBox: "-2 0 30 25", fill: "none", className: (0, k.Z)(t, V.AddReactionIcon) }, n), o.createElement("path", { d: "M24.354 12.427A11.927 11.927 0 1115.571.922M18.431 14.148a6.246 6.246 0 01-11.917.292" }), o.createElement("ellipse", { cx: 8.877, cy: 9.019, rx: 1.065, ry: 1.775, fill: "#8492A4" }), o.createElement("ellipse", { cx: 15.978, cy: 9.018, rx: 1.065, ry: 1.775, fill: "#8492A4" }), o.createElement("path", { fill: "#8492A4", d: "M27.024 3.76v1h-8.522v-1z" }), o.createElement("path", { fill: "#8492A4", d: "M23.264 8.521h-1V-.001h1z" }));
}
function Y(e) {
const t = (0, F.SZ)(() => d.Ul.FriendStore.GetPlayer(e.accountid).display_name);
return o.createElement("span", { className: V.ReactorName }, t);
}
var J = n(71357),
ee = n(61963),
te = n(33082),
ne = n(37234),
ie = n(33690);
function oe(e) {
const { reason: t } = e;
let n;
return (n = 2 == t ? (0, g.Xx)("#Friend_Chat_CommunityBanned") : (0, g.Xx)("#Friend_Chat_Blocked")), o.createElement("div", { className: "msg" }, o.createElement("div", { className: "msgText MessageFromBlockedUser" }, n));
}
let re = (0, s.Pi)((e) => o.createElement(R.yd, { friend: e.player, context: e.context }, o.createElement("span", null, e.player.display_name))),
ae = class extends o.Component {
render() {
let e = this.props.messages,
t = this.props.friendRenderContext;
if (0 == e.length) return null;
let n = [],
i = [],
r = !0;
for (let a of e) {
if (-1 != i.indexOf(a.unServerMsgParamAccountID)) continue;
n.length > 0 && n.push(", ");
let e = d.Ul.FriendStore.GetPlayer(a.unServerMsgParamAccountID);
n.push(o.createElement(re, { context: t, player: e })), i.push(a.unServerMsgParamAccountID), e.is_ready || (e.LoadIfNecessary(), (r = !1));
}
let a = d.Ul.FriendStore.GetPlayer(e[0].unAccountID);
a.is_ready || (a.LoadIfNecessary(), (r = !1));
let s = o.createElement(re, { context: t, player: a }),
l = "";
if (n.length > 1) {
let e = o.createElement(o.Fragment, null, ...n);
l = (0, g.kQ)("#ChatRoom_ServerMessage_Invited_Multiple", e, s);
} else l = (0, g.kQ)("#ChatRoom_ServerMessage_Invited", n[0], s);
return o.createElement(A.v$, { style: "server" }, o.createElement("div", { className: "msg serverMsg" }, o.createElement("div", { className: "msgText" }, r ? l : " ")));
}
};
ae = (0, i.gn)([s.Pi], ae);
let se = class extends o.Component {
render() {
let e = this.props.messages,
t = this.props.friendRenderContext;
if (0 == e.length) return null;
let n = [],
i = [],
r = !0;
for (let a of e) {
if (-1 != i.indexOf(a.unServerMsgParamAccountID)) continue;
n.length > 0 && n.push((0, g.Xx)("#ChatRoom_ServerMessageMultiple_Separator"));
let e = d.Ul.FriendStore.GetPlayer(a.unServerMsgParamAccountID);
n.push(o.createElement(re, { context: t, player: e })), i.push(a.unServerMsgParamAccountID), e.is_ready || (e.LoadIfNecessary(), (r = !1));
}
let a = "";
if (n.length > 1) {
let e = n.pop();
2 == n.length && n.pop();
let t = o.createElement(o.Fragment, null, ...n);
a = (0, g.kQ)(this.props.tokenPrefix + "_Multiple", t, e);
} else a = (0, g.kQ)(this.props.tokenPrefix, n[0]);
return o.createElement(le, null, r ? a : " ");
}
};
se = (0, i.gn)([s.Pi], se);
const le = ({ children: e }) => o.createElement(A.v$, { style: "server" }, o.createElement("div", { className: "msg serverMsg" }, o.createElement("div", { className: "msgText" }, e)));
function ce(e, t, n) {
return (0, i.mG)(this, void 0, void 0, function* () {
if (0 == n.length) return;
const i = n.length > 1;
let o = n[0].unAccountID,
r = d.Ul.FriendStore.GetPlayer(o).primary_display_name,
a = (0, g.Xx)(i ? "#Chat_Actions_DeleteChatMessages" : "#Chat_Actions_DeleteChatMessage"),
s = (0, g.Xx)(i ? "#Chat_Actions_DeleteChatMessages_Confirm" : "#Chat_Actions_DeleteChatMessage_Confirm", r),
l = (0, g.Xx)("#Chat_Actions_Delete");
if (!(yield (0, J.V3)(e, a, s, l))) return;
let c = yield t.DeleteChatMessages(n);
if (1 == c) return;
let m = 15 == c ? "#Chat_Actions_DeleteChatMessage_FailAccess" : "#Chat_Actions_DeleteChatMessage_Fail";
(s = (0, g.Xx)(m, r)), (0, J.zp)(e, a, s);
});
}
const me = (0, s.Pi)((e) => {
const { msg: t, speakerWidth: n, chatView: i, onUpdate: r, children: a, extraClassName: s } = e,
l = (0, E.id)(),
c = (0, o.useRef)(0),
m = c.current,
[h, u] = o.useState(!1),
_ = (0, o.useRef)(),
C = o.useRef(),
{ showPicker: w } = Z(i.chat, t),
R = (n, i) => {
let r,
a = e.msg.unAccountID;
e.chatView.chat instanceof f.K && (r = e.chatView.chat);
const s = [],
l = (0, S.RA)(n),
c = l.getSelection(),
m = c && c.rangeCount > 0 && c.toString().length > 0;
let d;
(d =
document.queryCommandEnabled("copy") || m
? () => {
l.document.execCommand("copy");
}
: () => (0, A.Em)(_.current)),
s.push(o.createElement(ee.Zo, { key: "copy", onSelected: d }, (0, g.Xx)("#ContextMenu_Copy"))),
s.push(o.createElement(ee.Zo, { key: "select", onSelected: () => l.getSelection().selectAllChildren(_.current) }, (0, g.Xx)("#Chat_Actions_Select_Message"))),
s.push(o.createElement(ee.D1, { key: "react", label: (0, g.Xx)("#Chat_Actions_React") }, o.createElement(Q, { chat: T, msg: t, onRequestClose: () => u && u.Hide() }))),
r && r.BCanDeleteMemberMessages(a) && s.push(o.createElement(ee.Zo, { key: "delete", onSelected: () => ce(l, r, [e.msg]) }, (0, g.Xx)("#Chat_Actions_Delete")));
let h = o.createElement(ee.xV, null, " ", s, " ");
const u = (0, N.yV)(h, n, i);
return u;
};
let M = (e) => R(e, { bOverlapHorizontal: !0, bOverlapVertical: !1 });
const T = i.chat;
let G = t.strMessage;
const O = e.hideTimeStamp || i.IsChatRoom(),
F = !O && d.Ul.FriendStore.GetPlayer(t.unAccountID),
B = (0, b.hs)(G);
let x, P;
if (t.eErrorSending != v.p.None)
switch (t.eErrorSending) {
case v.p.NotFriends:
(P = "ChatMessageErrorSending"), (x = o.createElement("div", { className: "ChatMessageErrorSendingAlert" }, (0, g.Xx)("#Chat_ErrorSending_NotFriends")));
break;
case v.p.RateLimitExceeded:
(P = "ChatMessageErrorSending"), (x = o.createElement("div", { className: "ChatMessageErrorSendingAlert" }, (0, g.Xx)("#Chat_ErrorSending_RateLimitExceeded")));
break;
case v.p.NoChatPermissionInGroup:
(P = "ChatMessageErrorSendingPermissionDenied"), (x = o.createElement("div", { className: "ChatMessageErrorPermissionDeniedAlert" }, o.createElement(p.HEZ, null), (0, g.Xx)("#Chat_ErrorPermissionDenied")));
break;
case v.p.Generic:
default:
(P = "ChatMessageErrorSending"), (x = o.createElement("div", { className: "ChatMessageErrorSendingAlert" }, (0, g.Xx)("#Chat_ErrorSending")));
}
const U = (0, k.Z)("msg", L().MsgWithAddons, s, P, { isCurrentUser: T.self.accountid === t.unAccountID, HasTimeStamp: !O, EmojiOnly: b.CR(G) }, h && "RevealSpoiler"),
V = { width: n ? `${n}px` : void 0 },
H = {
chat: T,
unAccountIDSender: t.unAccountID,
rtTimestamp: t.rtTimestamp,
key: t.UniqueKey(),
onLoad: r,
bUseLargeEmoticons: (0, b.hs)(G),
bAnimate: t.eAnimationState === v.P9.Animating,
onAnimationStart: () => c.current++,
onAnimationEnd: () => {
m && c.current--, c.current || e.msg.OnAnimationEnd();
},
};
G = T.ChatStore.TextFilterStore.FilterText(t.unAccountID, G);
const X = G.includes("[spoiler]"),
j = a || o.createElement(D.xU, { bbcode: G, context: H, parser: T.GetBBCodeParser() }),
z = (0, k.Z)("msgText", { MsgNoUserContent: !t.HasUserContent(), EmoticonOnly: B });
let K,
q = {
onMenuButton: (e) => {
M(e);
},
onMenuActionDescription: (0, g.Xx)("#Chat_MessageContextMenu"),
};
return (
l || (q = Object.assign(Object.assign({}, q), { onOKButton: (e) => w(e), onOKActionDescription: (0, g.Xx)("#Chat_Actions_React") })),
e.chatView.chat instanceof f.K && (K = e.chatView.chat),
K &&
K.BCanDeleteMemberMessages(e.msg.unAccountID) &&
((q.onSecondaryButton = (t) => {
ce((0, S.RA)(t), K, [e.msg]);
}),
(q.onSecondaryActionDescription = (0, g.Xx)("#Chat_Actions_Delete"))),
o.createElement(I.s, Object.assign({ className: U, navRef: C, focusableIfNoChildren: !0, onContextMenu: R, onSecondaryButton: X ? () => u(!h) : void 0, onSecondaryActionDescription: X ? (0, g.Xx)(h ? "#Hide_Spoiler" : "#Reveal_Spoiler") : void 0 }, q), !O && o.createElement(pe, { className: "FriendChatTimeStamp", friend: F, style: V }, o.createElement(y.tS, { rtime: t.rtTimestamp, bTimeOnly: !0 })), x, o.createElement(A.v$, null, o.createElement("div", { className: z, ref: _ }, j)), o.createElement(W, { msg: t, chat: T }), o.createElement(de, { msg: t, chat: T, onShowContextMenu: M }))
);
}),
de = (0, s.Pi)((e) => {
const { msg: t, chat: n } = e,
{ bOpen: i, showPicker: r } = Z(n, t),
{ bOpen: a, showContextMenu: s } = (function (e) {
const [t, n] = (0, o.useState)(null),
i = (i) => {
if (t) return;
let o = e(i);
o.SetOnHideCallback(() => n(null)), n(o);
};
return { bOpen: !!t, showContextMenu: i };
})(e.onShowContextMenu);
let l,
c = i || a;
n instanceof f.K && (l = n);
let m = null;
return (
l &&
l.BCanDeleteMemberMessages(t.unAccountID) &&
(m = (t) => {
ce((0, S.RA)(t), l, [e.msg]);
}),
o.createElement("div", { className: (0, k.Z)(L().Addons, c && L().Open) }, o.createElement($, { className: L().Emoticon, onClick: r }), m && o.createElement(he, { className: L().Emoticon, onClick: m }), o.createElement(ue, { className: L().Emoticon, onShowContextMenu: s }))
);
});
function he(e) {
const { className: t, onClick: n } = e;
(0, i._T)(e, ["className", "onClick"]);
return o.createElement("div", { className: t, onClick: n }, o.createElement(p.ZNm, null));
}
function ue(e) {
const { className: t } = e;
(0, i._T)(e, ["className"]);
return o.createElement("div", { className: t, onClick: e.onShowContextMenu }, o.createElement(p.AlT, null));
}
let pe = (0, s.Pi)((e) => {
const t = e.friend.persona;
let n = !1;
t.m_broadcastAccountId && (n = !0);
const i = (0, k.Z)(e.className, (t.is_ingame ? "ingame" : t.is_online && "online") || "offline", { away: t.is_awayOrSnooze, watchingbroadcast: n });
return o.createElement("div", { className: i, style: e.style }, e.children);
});
const _e = (e) => {
const t = (0, ie.Wy)(),
n = (0, ne.rb)(t.ownerWindow),
i = !(0, te.n)(n, te.D);
return o.createElement(ge, Object.assign({ bInOverlay: i }, e));
};
let ge = class extends o.Component {
GetChatRoomSpeakerClass(e) {
let t = e.persona;
return t.is_ingame ? L().SpeakerName_InGame : t.m_broadcastAccountId ? L().SpeakerName_WatchingBroadcast : t.is_online ? L().SpeakerName_Online : L().SpeakerName_Default;
}
render() {
let e,
t = this.props.friend,
n = "",
i = "";
if (this.props.chatView.IsChatRoom()) {
let i,
r = this.props.chatView.chat;
switch ((r.GetMember(t.accountid) && (i = r.GetGroup().GetMemberRank(t.accountid)), i)) {
default:
break;
case 30:
n = "Moderator";
break;
case 40:
n = "Officer";
break;
case 50:
(n = "Owner"), r.GetGroup().BIsClanChatRoom() || (e = o.createElement("div", { className: "rankIcon rankOwner" }, o.createElement(p._OD, null)));
}
r.GetGroup().BIsClanChatRoom() && (i >= 40 ? (e = o.createElement("div", { className: "rankIcon rankOwner" }, o.createElement("img", { src: E.De.COMMUNITY_CDN_URL + "public/images/skin_1/comment_modindicator_officer.png" }))) : i >= 30 && (e = o.createElement("div", { className: "rankIcon rankOwner" }, o.createElement("img", { src: E.De.COMMUNITY_CDN_URL + "public/images/skin_1/comment_modindicator_moderator.png" }))));
} else n = "";
i = "speakerName " + this.GetChatRoomSpeakerClass(t);
let r = "avatar speakerAvatar",
a = null,
s = null;
if (t.BLoadedEquippedItems()) {
let e = t.GetEquippedProfileItems();
e && ((a = e.animated_avatar), (s = e.avatar_frame), s && s.image_small && s.image_small.length > 0 && (r += " hasAvatarFrame"));
}
let l = d.Ul.SettingsStore.FriendsSettings.bAnimatedAvatars && t.persona.is_online && !this.props.bInOverlay,
c = d.Ul.GetServerRTime32() - this.props.msg.rtTimestamp < 60;
return o.createElement(
A.v$,
{ style: "speaker allow-embedded-newlines", text: [`[${(0, M.y)(this.props.msg.rtTimestamp, { bIncludeWeekday: !1 })}]`, `${t.primary_display_name}:`] },
o.createElement(
"div",
{ className: "ChatSpeaker ChatRoomSpeaker SpeakerLineBreak" + (t.accountid == this.props.chatView.chat.self.accountid ? " isCurrentUser" : "") },
o.createElement(pe, { friend: t, className: "speaker" }, o.createElement(R.yd, { friend: t, context: this.props.friendRenderContext }, o.createElement("div", { className: "speakerHoverArea " + n }, e, o.createElement(G._1, { loopDuration: l && c ? "Medium" : "None", className: r, persona: t.persona, animatedAvatar: a, avatarFrame: s, size: "Small", bLimitProfileFrameAnimationTime: !l || !c }), o.createElement("div", { className: "speakerStatus" }), o.createElement("div", { className: i }, t.primary_display_name, !t.is_display_name_nickname && t.has_secondary_display_name && o.createElement("span", { className: "playerNickname" }, " (", t.secondary_display_name, ")"), t.is_display_name_nickname && o.createElement("span", { className: "playerNicknameBracket", title: (0, g.Xx)("#isNickname") }, "*")))), o.createElement("div", { className: "speakerTimeStamp" }, o.createElement(y.tS, { rtime: this.props.msg.rtTimestamp, bTimeOnly: !1 }))),
),
);
}
};
ge = (0, i.gn)([s.Pi], ge);
let Ce = class extends o.Component {
OnUpdate() {
this.props.onUpdate("ChatMessageSlashEmote " + this.props.msg.UniqueKey());
}
render() {
let e = this.props.msg,
t = this.props.chatView.chat,
n = d.Ul.FriendStore.GetPlayer(e.unAccountID);
const i = e.strMessage.slice(e.strMessage.search(/\s/g) + 1),
r = (0, k.Z)("speaker", n.persona.is_ingame ? "ingame" : n.persona.is_online ? "online" : "offline"),
a = { width: this.props.speakerWidth ? `${this.props.speakerWidth}px` : void 0 },
s = (0, k.Z)("msg", "ChatMsgSlashEmote", "ChatRoomSlashEmote", { isCurrentUser: t.self.accountid === e.unAccountID, ChatMessageErrorSending: e.eErrorSending != v.p.None });
return o.createElement(
"div",
{ className: s },
e.eErrorSending != v.p.None && o.createElement("div", { className: "ChatMessageErrorSendingAlert" }, (0, g.Xx)("#Chat_ErrorSending")),
o.createElement(
"div",
{ className: "SpeakerLineBreak" + (e.unAccountID == t.self.accountid ? " isCurrentUser" : "") },
o.createElement(
"div",
{ className: r },
o.createElement(R.yd, { friend: n, context: { chat: t, chatContext: "message" } }, o.createElement(A.v$, { style: "speaker allow-embedded-newlines", text: [`[${(0, M.y)(this.props.msg.rtTimestamp, { bIncludeWeekday: !1 })}]`, `${n.display_name}:`] }, o.createElement("div", { className: "speakerHoverArea" }, o.createElement("img", { className: "avatar speakerAvatar", src: n.persona.avatar_url, onLoad: this.OnUpdate }), o.createElement("div", { className: "speakerStatus" }), o.createElement("div", { className: "speakerName", style: a }, n.display_name)))),
o.createElement(A.v$, { style: "force-display append-innertext", text: "/me" }, o.createElement("div", { className: "msgText" }, o.createElement(D.xU, { bbcode: i, context: { chat: t, unAccountIDSender: e.unAccountID, rtTimestamp: e.rtTimestamp, onUpdate: this.props.onUpdate }, parser: t.GetBBCodeParser() }))),
o.createElement("div", { className: "speakerTimeStamp" }, o.createElement(y.tS, { rtime: e.rtTimestamp, bTimeOnly: !1 })),
),
),
);
}
};
(0, i.gn)([r.ak], Ce.prototype, "OnUpdate", null), (Ce = (0, i.gn)([s.Pi], Ce));
let fe = class extends o.Component {
render() {
return o.createElement(me, Object.assign({}, this.props, { extraClassName: "ChatMessageDeleted" }), o.createElement("div", { className: "msgText" }, o.createElement("span", { className: "filteredURL bb_removedlink" }, (0, g.Xx)("#Chat_MessageDeleted"))));
}
};
fe = (0, i.gn)([s.Pi], fe);
let ve = class extends o.Component {
render() {
let e = this.props.msg,
t = this.props.friendRenderContext;
if (11 == e.eServerMsgType) {
const n = { unAccountIDSender: 0, chat: t.chat, rtTimestamp: e.rtTimestamp, key: e.UniqueKey(), onLoad: void 0 };
return o.createElement(le, null, o.createElement(D.xU, { bbcode: this.props.msg.strServerMsgAppCustomLocalized, context: n, parser: t.chat.GetBBCodeParser() }));
}
{
const n = (function (e) {
switch (e.eServerMsgType) {
case 1: {
let t = d.Ul.FriendStore.GetPlayer(e.unAccountID);
return { strToken: "#ChatRoom_ServerMessage_RenameChatRoom", parts: [e.strServerMsgParam, t] };
}
case 2:
return { strToken: "#ChatRoom_ServerMessage_Joined", parts: [d.Ul.FriendStore.GetPlayer(e.unServerMsgParamAccountID)] };
case 3:
return { strToken: "#ChatRoom_ServerMessage_Parted", parts: [d.Ul.FriendStore.GetPlayer(e.unServerMsgParamAccountID)] };
case 4: {
let t = d.Ul.FriendStore.GetPlayer(e.unAccountID);
return { strToken: "#ChatRoom_ServerMessage_Kicked", parts: [d.Ul.FriendStore.GetPlayer(e.unServerMsgParamAccountID), t] };
}
case 9: {
let t = d.Ul.FriendStore.GetPlayer(e.unAccountID);
return e.strServerMsgParam.length ? { strToken: "#ChatRoom_ServerMessage_ChatRoomTaglineChanged", parts: [e.strServerMsgParam, t] } : { strToken: "#ChatRoom_ServerMessage_ChatRoomTaglineRemoved", parts: [t] };
}
case 10:
return { strToken: "#ChatRoom_ServerMessage_ChatRoomAvatarChanged", parts: [d.Ul.FriendStore.GetPlayer(e.unAccountID)] };
case 5:
return { strToken: "#ChatRoom_ServerMessage_Invited", parts: [d.Ul.FriendStore.GetPlayer(e.unServerMsgParamAccountID), d.Ul.FriendStore.GetPlayer(e.unAccountID)] };
default:
return { strToken: "#ChatRoom_ServerMessage_Unhandled", parts: [] };
}
})(e),
i = n.parts.length
? (function (e, t, ...n) {
let i = [];
for (let t of n) t instanceof w.Xp ? i.push(o.createElement(re, { context: e, player: t })) : i.push(t);
return (0, g.kQ)(t, ...i);
})(t, n.strToken, ...n.parts)
: (0, g.Xx)(n.strToken);
return o.createElement(le, null, i);
}
}
};
ve = (0, i.gn)([s.Pi], ve);
let Se = class extends o.Component {
render() {
let e = this.props.msg,
t = this.props.friendRenderContext;
const n = { unAccountIDSender: 0, chat: t.chat, rtTimestamp: e.rtTimestamp, key: e.UniqueKey(), onLoad: void 0 };
return o.createElement(le, null, o.createElement(D.xU, { bbcode: e.strMessage, context: n, parser: t.chat.GetBBCodeParser() }));
}
};
Se = (0, i.gn)([s.Pi], Se);
let be = class extends o.Component {
render() {
return o.createElement(A.v$, { style: "invite", text: this.props.msg.strMessage }, o.createElement("div", { className: "msg" }, o.createElement("div", { className: "msg voiceChannelInvite" }, this.props.msg.strMessage), o.createElement("div", { className: "msg voiceChannelInviteClear" })));
}
};
be = (0, i.gn)([s.Pi], be);
var Ie = n(93635);
let ye = class extends o.Component {
componentDidUpdate() {
this.props.onUpdate("ChatMessageBlocks " + this.props.chatView.GetUniqueID());
}
renderBlock(e) {
const t = this.props,
{ chatView: n } = this.props,
i = n.chat.chat_message_blocks,
r = !n.IsChatRoom() && i.time_passes_index,
a = n.IsChatRoom() ? n.chat.first_unread_msg_time : _.r7,
s = i.message_blocks[e],
l = 0 == e ? _.r7 : i.message_blocks[e - 1].GetRTimeLastMessage();
if (a && l <= a && s.GetRTimeLastMessage() > a) {
let n,
i = s;
a > s.GetRTimeFirstMessage() && (([n, i] = s.CreateVirtualSplitOnTimestamp(a)), (0, Ie.X)(n.messages.length, "No messages in prefix"));
let l = a;
return o.createElement(o.Fragment, { key: s.UniqueKey() }, n && o.createElement(Ee, Object.assign({}, t, { block: n, bIsInitialBlock: 0 === e, bShowTimePasses: e === r })), o.createElement(Ae, { rtTimestamp: l, bUnread: !0 }), i.messages.length > 0 && o.createElement(Ee, Object.assign({}, t, { block: i, bIsInitialBlock: !1, bShowTimePasses: !1 })));
}
return o.createElement(Ee, Object.assign({}, t, { key: s.UniqueKey(), block: s, bIsInitialBlock: 0 === e, bShowTimePasses: e === r }));
}
render() {
this.props;
const { chatView: e } = this.props;
return e.chat.chat_message_blocks.message_blocks.map((e, t) => this.renderBlock(t));
}
};
ye = (0, i.gn)([s.Pi], ye);
let Ee = class extends o.Component {
componentDidUpdate() {
this.props.block.is_last_block && this.props.onUpdate("ChatMessageBlock " + this.props.block.UniqueKey());
}
render() {
let e,
t,
n = this.props,
{ block: r, bIsInitialBlock: a, bShowTimePasses: s } = n,
l = (0, i._T)(n, ["block", "bIsInitialBlock", "bShowTimePasses"]),
c = l.friendRenderContext,
m = r.messages;
if ((r.BIsInvite() ? (e = o.createElement(ae, { messages: m, friendRenderContext: c })) : r.BIsServerMsg() ? (e = o.createElement(Me, { block: r, friendRenderContext: c })) : r.BIsLocalMsg() ? (e = o.createElement(ke, { block: r, friendRenderContext: c })) : m.length && (e = o.createElement(we, Object.assign({}, l, { messages: m, bLastMessageBlock: r.is_last_block }))), r.is_last_block)) {
let e = d.Ul.GetLocalMidnightInRTime32();
r.GetRTimeMidnightBeforeBlock() != e && (t = o.createElement(Ae, { rtTimestamp: e }));
} else r.GetRTimeMidnightBeforeBlock() != r.GetRTimeMidnightBeforeNextBlock() && (t = o.createElement(Ae, { rtTimestamp: r.GetRTimeMidnightBeforeNextBlock() }));
return o.createElement(o.Fragment, null, a && m.length > 0 && o.createElement(De, { msg: m[0] }), s && o.createElement(Ae, { rtTimestamp: m[0].rtTimestamp, bTimePassesLine: !0 }), e, t);
}
};
function De(e) {
return e.msg.rtTimestamp < d.Ul.GetLocalMidnightInRTime32() ? o.createElement(Ae, { rtTimestamp: e.msg.rtTimestamp }) : null;
}
Ee = (0, i.gn)([s.Pi], Ee);
let we = class extends o.Component {
constructor(e) {
super(e), (this.m_element = o.createRef()), (this.state = { bHoveringDelete: !1 });
}
OnHoverDelete(e) {
this.setState({ bHoveringDelete: e });
}
CopyMessage() {
(0, A.Em)(this.m_element.current);
}
SelectMessage(e) {
e.getSelection().selectAllChildren(this.m_element.current);
}
OnMessageBlockContextMenu(e) {
let t,
n = this.props.messages[0].unAccountID;
this.props.chatView.chat instanceof f.K && (t = this.props.chatView.chat);
const i = [],
r = (0, S.RA)(e),
a = r.getSelection(),
s = a && a.rangeCount > 0 && a.toString().length > 0;
let l;
return (
(l =
document.queryCommandEnabled("copy") || s
? () => {
r.document.execCommand("copy");
}
: this.CopyMessage),
i.push(o.createElement(ee.Zo, { key: "copy", onSelected: l }, (0, g.Xx)("#ContextMenu_Copy"))),
i.push(
o.createElement(
ee.Zo,
{
key: "select",
onSelected: () => {
this.SelectMessage(r);
},
},
(0, g.Xx)("#Chat_Actions_Select_Message"),
),
),
t &&
t.BCanDeleteMemberMessages(n) &&
i.push(
o.createElement(
ee.Zo,
{
key: "delete",
onSelected: () => {
ce(r, t, this.props.messages);
},
},
(0, g.Xx)("#Chat_Actions_Delete"),
),
),
i.length ? (0, N.yV)(o.createElement(ee.xV, null, i), e) : null
);
}
componentDidMount() {
const { chatView: e } = this.props,
t = this.props.messages[0].unAccountID;
e instanceof C.R5 && e.virtualizer && e.virtualizer.SubscribeToPersona(t);
}
componentDidUpdate(e) {
const { chatView: t } = this.props;
e.messages[0].unAccountID !== this.props.messages[0].unAccountID && t instanceof C.R5 && t.virtualizer && (t.virtualizer.UnsubscribeFromPersona(e.messages[0].unAccountID), t.virtualizer.SubscribeToPersona(this.props.messages[0].unAccountID));
}
componentWillUnmount() {
const { chatView: e } = this.props;
e instanceof C.R5 && e.virtualizer && e.virtualizer.UnsubscribeFromPersona(this.props.messages[0].unAccountID);
}
render() {
let e = !0,
t = !1,
n = this.props.bLastMessageBlock,
i = this.props.messages[0].unAccountID,
r = d.Ul.FriendStore.GetPlayer(i),
a = this.props.chatView.IsChatRoom() ? this.props.chatView.chat : null,
s = "ChatMessageBlock",
l = 0;
a && r.is_blocked ? (l = 1) : a && r.persona.m_bCommunityBanned && (l = 2);
let c = [];
if (0 == l) {
this.props.messages.length && "/me" === this.props.messages[0].GetSlashCommand() && (e = !1);
let i = 0;
for (let r = 0; r < this.props.messages.length; r++) {
let s = this.props.messages[r],
l = !0;
if (!a) {
let e = Math.floor(s.rtTimestamp / 60);
i && e != i ? ((l = !1), (t = !0)) : n && t && r == this.props.messages.length - 1 && (l = !1), (i = e);
}
let m = { msg: s, key: s.UniqueKey(), chatView: this.props.chatView, hideTimeStamp: l, onUpdate: this.props.onUpdate };
s.eDeleteState != v.im.Deleting && s.eDeleteState != v.im.Deleted && ("/me" === s.GetSlashCommand() ? c.push(o.createElement(Ce, Object.assign({}, m))) : s instanceof v.Ok ? ((e = !1), c.push(o.createElement(be, Object.assign({}, m)))) : c.push(o.createElement(me, Object.assign({}, m, { speakerWidth: this.props.speakerWidth }))));
}
} else c.push(o.createElement(oe, { reason: l, key: "blocked" })), (s += " ChatMessageBlock_BlockedSender");
return n && ((s += " LastMessageBlock"), t && (s += " HasInternalTimeStamp")), 1 != c.length || a || (s += " SingletonMsg"), 0 == c.length ? null : o.createElement(A.v$, null, o.createElement("div", { ref: this.m_element, className: s, onContextMenu: this.OnMessageBlockContextMenu }, e && o.createElement(_e, { friend: r, chatView: this.props.chatView, msg: this.props.messages[0], friendRenderContext: this.props.friendRenderContext, key: "speaker", speakerWidth: this.props.speakerWidth, onUpdate: this.props.onUpdate }), false, c));
}
};
(0, i.gn)([r.ak], we.prototype, "OnHoverDelete", null), (0, i.gn)([r.ak], we.prototype, "CopyMessage", null), (0, i.gn)([r.ak], we.prototype, "SelectMessage", null), (0, i.gn)([r.ak], we.prototype, "OnMessageBlockContextMenu", null), (we = (0, i.gn)([s.Pi], we));
class Re extends o.Component {
OnMouseEnter() {
this.props.onHover(!0);
}
OnMouseLeave() {
this.props.onHover(!1);
}
OnDeleteMessages(e) {
ce((0, S.RA)(e), this.props.chatRoom, this.props.messages);
}
render() {
return o.createElement("div", { className: "ChatMessageBlockDelete", onMouseEnter: this.OnMouseEnter, onMouseLeave: this.OnMouseLeave, onClick: this.OnDeleteMessages, title: (0, g.Xx)("#Chat_Actions_Delete") }, o.createElement(p.rFk, null));
}
}
(0, i.gn)([r.ak], Re.prototype, "OnMouseEnter", null), (0, i.gn)([r.ak], Re.prototype, "OnMouseLeave", null), (0, i.gn)([r.ak], Re.prototype, "OnDeleteMessages", null);
class Ae extends o.Component {
shouldComponentUpdate(e) {
return e.rtTimestamp !== this.props.rtTimestamp || e.bUnread !== this.props.bUnread || e.bTimePassesLine !== this.props.bTimePassesLine;
}
render() {
let e,
t = d.Ul.RTime32ToDate(this.props.rtTimestamp),
n = ["msg", "timeDivision"];
if (this.props.bUnread) {
let i = { weekday: "long", year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric" };
(e = (0, g.Xx)("#ChatRoom_New_Messages", t.toLocaleDateString(g.Yt.GetPreferredLocales(), i))), n.push("new_messages");
} else if (this.props.bTimePassesLine) (e = ""), n.push("time_passes");
else {
let n = { weekday: "long", year: "numeric", month: "long", day: "numeric" };
e = t.toLocaleDateString(g.Yt.GetPreferredLocales(), n);
}
return o.createElement(A.v$, { style: "timestamp", text: e }, o.createElement("div", { className: n.join(" ") }, o.createElement("div", { className: "preHorizDivider" }), e, o.createElement("div", { className: "horizDivider" })));
}
}
const Me = (e) => {
const { block: t, friendRenderContext: n } = e,
i = t.messages.reduce((e, t) => {
if (!e.length) return e.push([t]), e;
const n = e[e.length - 1],
i = n[0],
o = Te(i),
r = Te(t);
return o && r ? (n.push(t), e) : (e.push([t]), e);
}, []);
return o.createElement(
o.Fragment,
null,
i.map((e) => (Te(e[0]) ? o.createElement(Le, { key: e[0].UniqueKey(), messages: e, friendRenderContext: n }) : e.map((e) => o.createElement(ve, { msg: e, key: e.UniqueKey(), friendRenderContext: n })))),
);
},
ke = (e) => {
const { block: t, friendRenderContext: n } = e;
return o.createElement(
o.Fragment,
null,
t.messages.map((e) => o.createElement(Se, { msg: e, key: e.UniqueKey(), friendRenderContext: n })),
);
},
Te = (e) => 2 === e.eServerMsgType || 3 === e.eServerMsgType,
Le = (e) => {
const { messages: t, friendRenderContext: n } = e,
{ rgLeavers: i, rgJoiners: r } = t.reduce((e, t) => (2 === t.eServerMsgType && e.rgJoiners.push(t.unAccountID), 3 === t.eServerMsgType && e.rgLeavers.push(t.unAccountID), e), { rgLeavers: [], rgJoiners: [] });
if (!i.length && !r.length) return null;
let a;
return (
(a =
0 === i.length
? r.length > 2
? (0, g.kQ)("#ChatRoom_ServerMessage_Joined_Number", o.createElement(Oe, { accountids: r }))
: 2 === r.length
? (0, g.kQ)("#ChatRoom_ServerMessage_Joined_Multiple", o.createElement(Ge, { context: n, accountid: r[0] }), o.createElement(Ge, { context: n, accountid: r[1] }))
: (0, g.kQ)("#ChatRoom_ServerMessage_Joined", o.createElement(Ge, { context: n, accountid: r[0] }))
: 0 === r.length
? i.length > 2
? (0, g.kQ)("#ChatRoom_ServerMessage_Parted_Number", o.createElement(Oe, { accountids: i }))
: 2 === i.length
? (0, g.kQ)("#ChatRoom_ServerMessage_Parted_Multiple", o.createElement(Ge, { context: n, accountid: i[0] }), o.createElement(Ge, { context: n, accountid: i[1] }))
: (0, g.kQ)("#ChatRoom_ServerMessage_Parted", o.createElement(Ge, { context: n, accountid: i[0] }))
: 1 === i.length && 1 === r.length
? (0, g.kQ)("#ChatRoom_ServerMessage_SingleJoined_SingleParted", o.createElement(Ge, { context: n, accountid: r[0] }), o.createElement(Ge, { context: n, accountid: i[0] }))
: 1 === i.length
? (0, g.kQ)("#ChatRoom_ServerMessage_MultipleJoined_SingleParted", o.createElement(Oe, { accountids: r }), o.createElement(Ge, { context: n, accountid: i[0] }))
: 1 === r.length
? (0, g.kQ)("#ChatRoom_ServerMessage_SingleJoined_MultipleParted", o.createElement(Ge, { context: n, accountid: r[0] }), o.createElement(Oe, { accountids: i }))
: (0, g.kQ)("#ChatRoom_ServerMessage_MultipleJoined_MultipleParted", o.createElement(Oe, { accountids: r }), o.createElement(Oe, { accountids: i }))),
o.createElement(le, null, a)
);
},
Ge = (0, s.Pi)((e) => {
const { context: t, accountid: n } = e,
i = d.Ul.FriendStore.GetPlayer(n);
return o.createElement(R.yd, { friend: i, context: t }, o.createElement("span", null, i.display_name));
}),
Oe = (0, s.Pi)((e) => {
const { accountids: t } = e,
n = t.map((e) => d.Ul.FriendStore.GetPlayer(e));
return o.createElement("span", { title: n.map((e) => e.display_name).join(", ") }, n.length);
});
var Fe = n(31695),
Be = n(62860),
xe = n(56666),
Ne = n(56973);
let Pe = class extends o.Component {
constructor(e) {
super(e), (this.state = { chatSubscribed: null }), (this.LOG = new l.sO("ChatHistory", () => this.props.chatView.GetUniqueID()).Debug), (this.m_bLoadHistoryInProgress = !1), (this.m_bLoadingOperationInProgress = !1), (this.m_bHasPendedLoadOlder = !1), (this.m_nIgnoreScrollUpUntilTime = 0), (0, a.rC)(this);
}
GetScrollTop() {
return this.LOG("scrollTop is", this.m_elHistoryScroll.scrollTop, "returning", Math.ceil(this.m_elHistoryScroll.scrollTop)), Math.ceil(this.m_elHistoryScroll.scrollTop);
}
GetScrollInfo() {
if (this.m_elHistoryScroll) {
const { scrollHeight: e, clientHeight: t } = this.m_elHistoryScroll;
return { scrollTop: this.GetScrollTop(), scrollHeight: e, clientHeight: t };
}
return { scrollTop: 0, scrollHeight: 0, clientHeight: 0 };
}
LogScrollInfo(e) {
if (!l.cH.Get().IsDebugLogEnabled("ChatHistory")) return;
const { scrollTop: t, scrollHeight: n, clientHeight: i } = this.GetScrollInfo();
let { lastScrollTop: o, lastScrollHeight: r, lastClientHeight: a } = this.props.chatView;
this.LOG(`${e}: scrolltop ${t} scrollHeight ${n} clientHeight ${i}, was scrollTop ${o} scrollHeight ${r} clientHeight ${a} `);
}
DumpChildSizes() {
if (!l.cH.Get().IsDebugLogEnabled("ChatHistory")) return;
let e = this.m_elHistoryScroll.children[0],
t = e.children.length;
if (t < 0) {
let n = 0;
this.LOG("History has", t, "children");
for (let i = 0; i < t; i++) {
let t = e.children[i];
(n += t.clientHeight), this.LOG("Child", i, "height", t.clientHeight, t);
}
this.LOG("Total height:", n);
}
}
OnHistoryScrollRef(e) {
this.m_elHistoryScroll && this.m_window && this.m_window.removeEventListener("resize", this.OnResize), (this.m_elHistoryScroll = e), e && ((this.m_window = e.ownerDocument.defaultView), this.m_window.addEventListener("resize", this.OnResize));
}
OnScrollEvent(e) {
this.LogScrollInfo("*** OnScrollEvent"), this.OnScroll();
}
OnScroll() {
const e = this.props.chatView,
{ scrollTop: t, scrollHeight: n, clientHeight: i } = this.GetScrollInfo();
let { lastScrollTop: o, lastScrollHeight: r, lastClientHeight: a } = e;
if ((this.LogScrollInfo("OnScroll"), 0 == i)) return void this.LOG("Onscroll zero clientHeight, ignoring");
let s = n - t <= i,
l = r - o <= a;
(0, Ie.X)(l == e.is_scrolled_to_bottom, `${e.GetUniqueID()}: computed and stored at bottom don't match`), this.LOG("bAtBottom", s, "bWasAtBottom", l);
let c = t;
l && o - c == 1 && (this.LOG("*** Scroll position off by one while pinned, ignoring and setting scrollTop to", o), (c = o)),
s || (l && n != r) || (c < o && l && Date.now() < this.m_nIgnoreScrollUpUntilTime) ? (this.LogScrollInfo("At bottom"), c < o && l && Date.now() < this.m_nIgnoreScrollUpUntilTime && this.LOG("**** IGNORING APPARENT SCROLL UP WHILE PINNED TO BOTTOM IN LAYOUT"), (c = n - i), (0, Ie.X)(c >= 0, `${e.GetUniqueID()}: Onscroll client height bigger than scroll height`), (e.is_scrolled_to_bottom = !0), c != t && (this.LOG("Setting scrollTop to", c), (this.m_elHistoryScroll.scrollTop = c))) : i < a && l ? (this.LogScrollInfo("Shrinking window while pinned to bottom"), (c = n - i), (e.is_scrolled_to_bottom = !0), c != t && (this.LOG("Setting scrollTop to", c), (this.m_elHistoryScroll.scrollTop = c))) : c < o ? (this.LogScrollInfo("Detected scroll up"), (e.is_scrolled_to_bottom = s)) : c != o && (this.LogScrollInfo("Detected scroll down but not to bottom"), (e.is_scrolled_to_bottom = !1)),
(e.lastScrollTop = c),
(e.lastScrollHeight = n),
(e.lastClientHeight = i);
let m = !(e.is_scrolled_to_bottom == e.lastScrollHeight - e.lastScrollTop <= e.lastClientHeight);
m && ((0, Ie.X)(!m, `${e.GetUniqueID()}: setting mismatched computed and stored`), this.LOG(e.lastScrollTop, e.lastScrollHeight, e.lastClientHeight, e.is_scrolled_to_bottom)), c < 10 && this.LoadOlderMessages();
}
OnRequestScrollToBottom() {
this.ScrollToBottom();
}
ScrollToBottom() {
const { scrollHeight: e, clientHeight: t } = this.GetScrollInfo();
this.LogScrollInfo("ScrollToBottom");
const n = e - t;
(0, Ie.X)(n >= 0, `${this.props.chatView.GetUniqueID()}: ScrollToBottom client height bigger than scroll height`), this.m_animation && this.m_animation.Cancel(), (this.m_animation = new c.jg(this.m_elHistoryScroll, { scrollTop: n }, { msDuration: 300, timing: "sine", onComplete: () => {} })), this.m_animation.Start();
}
LoadOlderMessages() {
const { chatView: e } = this.props,
t = e.chat;
if (!t.IsMoreHistoryAvailable()) return;
if (this.m_bLoadingOperationInProgress) return this.LOG("noting pended load"), void (this.m_bHasPendedLoadOlder = !0);
let n = () =>
t.LoadMoreHistory().then((t) => {
const { scrollHeight: i } = this.GetScrollInfo(),
{ lastScrollTop: o, lastScrollHeight: r } = e,
a = o + i - r;
return this.LogScrollInfo("LoadOlderMessags"), (this.m_elHistoryScroll.scrollTop = a), this.m_bHasPendedLoadOlder ? (this.LOG("LoadOlderMessages starting pended"), (this.m_bHasPendedLoadOlder = !1), n()) : ((this.m_bLoadingOperationInProgress = !1), t);
});
this.LOG("LoadOlderMessages starting"),
(this.m_bLoadHistoryInProgress = !0),
(this.m_bLoadingOperationInProgress = !0),
this.DoAndDelay(this.m_window, n, 500).then((e) => {
this.LOG("loading over"), (this.m_bLoadHistoryInProgress = !1);
});
}
DoAndDelay(e, t, n) {
const i = performance.now();
return t().then((t) => {
const o = performance.now() - i;
return o < n ? new Promise((i) => e.setTimeout(i.bind(null, t), n - o)) : t;
});
}
Focus() {
this.m_elHistoryScroll && this.m_elHistoryScroll.focus();
}
componentDidMount() {
if ((this.LOG("ComponentDidMount"), this.UpdateChatViewCallback(), this.m_elHistoryScroll && this.props.chatView.is_scrolled_to_bottom)) {
let { chatView: e } = this.props,
{ scrollHeight: t, clientHeight: n } = this.GetScrollInfo();
(e.lastScrollTop = t - n), (e.lastScrollHeight = t), (e.lastClientHeight = n), (this.m_elHistoryScroll.scrollTop = e.lastScrollTop), (0, Ie.X)(e.is_scrolled_to_bottom == e.lastScrollHeight - e.lastScrollTop <= e.lastClientHeight, `${e.GetUniqueID()}: setting mismatched computed and stored`);
}
}
componentDidUpdate() {
const { chatView: e } = this.props;
this.UpdateChatViewCallback();
const { scrollTop: t, scrollHeight: n, clientHeight: i } = this.GetScrollInfo(),
{ lastScrollTop: o, lastScrollHeight: r } = e;
if (0 == i) return void this.LOG("componentDidUpdate clientHeight == 0, ignoring");
let a = t;
n == r ? (a = o) : n - t <= i && (a = n - i), this.LogScrollInfo("componentDidUpdate"), this.DelayedScrollTo(a);
}
UpdateChatViewCallback() {
let e = this.state.chatSubscribed;
this.props.chatView != e && (this.props.chatView.RemoveOnChatFrameChangedCallback(this.OnFrameChanged), this.props.chatView.RemoveOnChatRequestScrollBottomCallback(this.OnRequestScrollToBottom), (e = null)), !e && this.props.isActive && (this.props.chatView.AddOnChatFrameChangedCallback(this.OnFrameChanged), this.props.chatView.AddOnChatRequestScrollBottomCallback(this.OnRequestScrollToBottom), (e = this.props.chatView)), this.state.chatSubscribed != e && this.setState({ chatSubscribed: e });
}
componentWillUnmount() {
this.m_window && (this.m_window.removeEventListener("resize", this.OnResize), (this.m_window = void 0)), this.props.chatView.RemoveOnChatFrameChangedCallback(this.OnFrameChanged);
}
GetFriendRenderContext() {
return (this.m_FriendRenderContext && this.m_FriendRenderContext.chat == this.props.chatView.chat) || (this.m_FriendRenderContext = { chatContext: "message", chat: this.props.chatView.chat }), this.m_FriendRenderContext;
}
OnFrameChanged() {
const e = this.props.chatView,
{ scrollHeight: t, clientHeight: n } = this.GetScrollInfo(),
{ lastScrollTop: i, lastScrollHeight: o, lastClientHeight: r } = e;
let a;
this.LogScrollInfo("OnFrameChanged"), (this.m_nIgnoreScrollUpUntilTime = Date.now() + 300), e.is_scrolled_to_bottom ? (this.LOG("OnFrameChanged scrolling to bottom"), (a = t - n)) : (this.LOG("OnFrameChanged preserving bottom"), (a = i + r + t - o - n)), this.LOG("OnFrameChanged setting scrollTop to", a), this.DelayedScrollTo(a);
}
DelayedScrollTo(e) {
this.LOG("DelayedScrollTo", e),
(this.m_elHistoryScroll.scrollTop = e),
this.m_window.setTimeout(() => {
this.LOG("DelayedOnScroll firing", e), this.OnScroll();
}, 150);
}
OnUpdate(e) {
const t = this.props.chatView,
{ scrollHeight: n, clientHeight: i } = this.GetScrollInfo();
if ((this.LogScrollInfo("OnUpdate for " + e), this.LOG("Scrolled to bottom is", t.is_scrolled_to_bottom), 0 == n)) this.LOG("OnUpdate zero scroll height");
else if (t.is_scrolled_to_bottom) {
this.LogScrollInfo("OnUpdate currently scrolled to bottom");
const e = n - i;
this.DelayedScrollTo(e);
} else if (t.chat.BIsPrepend) {
t.chat.ResetPrepended();
const { lastScrollTop: e, lastScrollHeight: o, lastClientHeight: r } = t;
this.LogScrollInfo("OnUpdate prepended messages");
const a = e + r + n - o - i;
this.DelayedScrollTo(a);
} else this.LogScrollInfo("OnUpdate content updated, doing nothing");
}
OnResize() {
const { scrollTop: e, scrollHeight: t, clientHeight: n } = this.GetScrollInfo();
this.LogScrollInfo("OnResize");
let i = e;
t - e <= n && (i = t - n), this.DelayedScrollTo(i);
}
Swallow(e) {
e.stopPropagation(), e.preventDefault();
}
render() {
var e, t, n, i;
let { chatView: r, speakerLabelWidth: a, blockInteraction: s } = this.props;
if (!r || r != this.state.chatSubscribed) return null;
let l = r.chat,
c = this.GetFriendRenderContext(),
m = a && Math.max(Math.min(a, 120), 50);
this.LOG("Render"), l.LoadChatLogs();
let p = d.Ul.SettingsStore.FriendsSettings.nChatFontSize,
_ = "ChatHistoryContainer";
return (
p == h.Ao.k_EChatFontSizeSmall ? (_ += " smallChatFont") : p == h.Ao.k_EChatFontSizeLarge && (_ += " largeChatFont"),
o.createElement(
xe.eh,
{ className: _, navEntryPreferPosition: Be.c4.LAST, preferredFocus: !0, onGamepadDirection: (0, Ne.oQ)({ bPreventMovementUp: !0 }), onOKActionDescription: (0, g.Xx)("#Chat_SelectChatWindow") },
s && o.createElement("div", { className: "interactionBlocker", onClick: this.Swallow }),
!(null === (e = this.context) || void 0 === e ? void 0 : e.IN_GAMEPADUI) && o.createElement(Fe.R, null),
(null === (t = this.context) || void 0 === t ? void 0 : t.IN_GAMEPADUI) && o.createElement("div", { className: "ChatHistorySelector" }),
o.createElement(Ue, { chatHistory: this, chatView: r }),
o.createElement("div", { className: "chatHistoryScroll", ref: this.OnHistoryScrollRef, onScroll: this.OnScrollEvent, tabIndex: 0 }, o.createElement("div", { className: "chatHistory" }, o.createElement(ye, { chatView: r, friendRenderContext: c, onUpdate: this.OnUpdate, speakerWidth: m }), o.createElement("div", { className: "disconnectBlocker" }))),
o.createElement(u.NL, { chatView: r }),
!(null === (n = this.context) || void 0 === n ? void 0 : n.IN_GAMEPADUI) && o.createElement(Ve, { chatView: r, action: this.ScrollToBottom }),
!(null === (i = this.context) || void 0 === i ? void 0 : i.IN_GAMEPADUI) && o.createElement(Fe.Q, null),
)
);
}
};
(Pe.contextType = m.E_), (0, i.gn)([a.LO], Pe.prototype, "m_bLoadHistoryInProgress", void 0), (0, i.gn)([r.ak], Pe.prototype, "DumpChildSizes", null), (0, i.gn)([r.ak], Pe.prototype, "OnHistoryScrollRef", null), (0, i.gn)([r.ak], Pe.prototype, "OnScrollEvent", null), (0, i.gn)([r.ak], Pe.prototype, "OnScroll", null), (0, i.gn)([r.ak], Pe.prototype, "OnRequestScrollToBottom", null), (0, i.gn)([r.ak], Pe.prototype, "ScrollToBottom", null), (0, i.gn)([r.ak], Pe.prototype, "LoadOlderMessages", null), (0, i.gn)([r.ak], Pe.prototype, "OnFrameChanged", null), (0, i.gn)([r.ak], Pe.prototype, "OnUpdate", null), (0, i.gn)([r.ak], Pe.prototype, "OnResize", null), (0, i.gn)([r.ak], Pe.prototype, "Swallow", null), (Pe = (0, i.gn)([s.Pi], Pe));
let Ue = class extends o.Component {
render() {
let e = "LoadingOlderMessages";
return this.props.chatHistory.m_bLoadHistoryInProgress || (e += " Hidden"), o.createElement("div", { className: e }, o.createElement("span", null, (0, g.Xx)("#Chat_Loading")));
}
};
Ue = (0, i.gn)([s.Pi], Ue);
let Ve = class extends o.Component {
render() {
let { chatView: e, action: t } = this.props,
n = "ScrollToBottomButton";
e.is_scrolled_to_bottom && (n += " Hidden");
let i = (0, g.Xx)("#Chat_ScrollToBottom");
return e.chat.unread_message_count > 0 && ((i = (0, g.kb)("#Chat_UnreadMessages", e.chat.unread_message_count)), (n += " UnreadMessages")), o.createElement("div", { className: n, onClick: t }, o.createElement("span", null, i));
}
};
Ve = (0, i.gn)([s.Pi], Ve);
},
63036: (e, t, n) => {
"use strict";
n.d(t, { a1: () => ct, wV: () => rt, r0: () => je, Sd: () => Ve, IU: () => We, nY: () => Xe, E6: () => He, cc: () => Ke, bI: () => Ue, Li: () => Pe, GR: () => ze, g5: () => Qe, _l: () => qe, dS: () => Ze, wE: () => it, Cs: () => nt, o2: () => ot });
var i = n(85556),
o = n(19953),
r = n(72746),
a = n(37234),
s = n(96119),
l = n(23133),
c = n(60176),
m = n(69807),
d = n(27378),
h = n(50649),
u = n(88669),
p = n(14206),
_ = n.n(p),
g = n(79588),
C = n(22103),
f = n(88991),
v = n(93635),
S = n(52705),
b = n(10553);
class I {
constructor() {
(this.m_mapProfiles = new Map()), (this.m_mapProfilesLoading = new Map()), (0, g.rC)(this);
}
LoadProfiles(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
(0, v.X)(e.length <= 500, "Check LoadProfiles, requesting too many steam IDs");
let n = e.filter((e) => !this.m_mapProfiles.has(e) && !this.m_mapProfilesLoading.has(e));
if (0 == n.length) return this.m_mapProfilesLoading.get(e[0]);
let i = b.De.COMMUNITY_BASE_URL + "actions/ajaxresolveusers",
o = _().get(i, { params: { steamids: n.join(",") }, withCredentials: !0, cancelToken: null == t ? void 0 : t.token });
n.forEach((e) => this.m_mapProfilesLoading.set(e, o));
let r = yield o;
r.data &&
200 == r.status &&
r.data.forEach((e) => {
(e.avatar_hash = e.avatar_url), (e.avatar_url_medium = (0, C.U)(e.avatar_url, "medium")), (e.avatar_url_full = (0, C.U)(e.avatar_url, "full")), (e.avatar_url = (0, C.U)(e.avatar_url)), this.m_mapProfiles.set(e.steamid, e), this.m_mapProfilesLoading.delete(e.steamid);
});
});
}
GetProfile(e) {
return this.m_mapProfiles.get(e);
}
GetProfileByAccountID(e) {
return this.m_mapProfiles.get(f.K.InitFromAccountID(e).ConvertTo64BitString());
}
GetProfileBySteamID(e) {
return this.m_mapProfiles.get(e.ConvertTo64BitString());
}
BHasProfile(e) {
return this.m_mapProfiles.has(e);
}
BHasProfileByAccountID(e) {
return this.m_mapProfiles.has(f.K.InitFromAccountID(e).ConvertTo64BitString());
}
BHasProfileBySteamID(e) {
return this.m_mapProfiles.has(e.ConvertTo64BitString());
}
BHasAllProfilesBySteamID(e) {
return !e.some((e) => !this.BHasProfileBySteamID(e));
}
GetProfileURLBySteamID(e) {
const t = this.GetProfileBySteamID(e);
return t && t.profile_url ? b.De.COMMUNITY_BASE_URL + "id/" + t.profile_url : b.De.COMMUNITY_BASE_URL + "profiles/" + e.ConvertTo64BitString();
}
GetPersonaNameBySteamID(e) {
const t = this.GetProfileBySteamID(e);
return t && t.persona_name ? t.persona_name : "";
}
}
(0, i.gn)([g.LO], I.prototype, "m_mapProfiles", void 0);
const y = new I();
function E(e) {
return (function (e) {
const t = d.useMemo(() => (e ? ("string" == typeof e ? new f.K(e) : e) : null), [e]),
[n, i] = (0, d.useState)(!!t && !y.BHasProfileBySteamID(t));
return (
(0, d.useEffect)(() => {
const e = _().CancelToken.source();
return (
t &&
!y.BHasProfileBySteamID(t) &&
y
.LoadProfiles([t.ConvertTo64BitString()])
.catch((e) => {
const n = (0, S.l)(e);
console.error("useUserProfile failed to load profile for " + t.ConvertTo64BitString() + ": " + n.strErrorMsg, n);
})
.finally(() => {
e.token.reason || i(!1);
}),
() => e.cancel("unmounting useUserProfile")
);
}, [e]),
[n, !!t && y.GetProfileBySteamID(t)]
);
})(d.useMemo(() => (e ? f.K.InitFromAccountID(e) : null), [e]));
}
var D = n(2049),
w = n(11259),
R = n(84290),
A = n(3987),
M = n.n(A),
k = n(16518),
T = n(56320);
class L extends d.Component {
constructor() {
super(...arguments), (this.state = { invite_token: "", input_search: "", friend_code_copied: !1, invite_copied: !1 });
}
componentDidMount() {
return (0, i.mG)(this, void 0, void 0, function* () {
const e = yield _().get(b.De.COMMUNITY_BASE_URL + "invites/ajaxgetall", { params: { sessionid: b.De.SESSIONID } });
if (e && e.data && e.data.tokens) {
const t = e.data.tokens.filter((e) => e.valid);
t.length ? this.setState({ invite_token: t[0].invite_token }) : this.OnCreateInviteLink();
} else this.OnCreateInviteLink();
});
}
OnCreateInviteLink() {
return (0, i.mG)(this, void 0, void 0, function* () {
const e = new FormData();
e.append("sessionid", b.De.SESSIONID), e.append("steamid_user", b.L7.steamid), e.append("duration", (2592e3).toString());
const t = yield _().post(b.De.COMMUNITY_BASE_URL + "invites/ajaxcreate", e);
t && t.data && t.data.invite && this.setState({ invite_token: t.data.invite.invite_token });
});
}
OnCopy(e, t) {
"friend_code" === e && (this.setState({ friend_code_copied: !0 }), setTimeout(() => this.setState({ friend_code_copied: !1 }), 1e3)), "invite" === e && (this.setState({ invite_copied: !0 }), setTimeout(() => this.setState({ invite_copied: !1 }), 1e3)), (0, u.Ei)(t);
}
OnAddFriend(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
const t = new FormData();
t.append("sessionID", b.De.SESSIONID), t.append("steamid", e), t.append("accept_invite", "0");
try {
const e = yield _().post(b.De.COMMUNITY_BASE_URL + "actions/AddFriendAjax", t);
return e && e.data && 1 == e.data.success;
} catch (e) {
return !1;
}
});
}
OnSearchChange(e) {
this.setState({ input_search: e.target.value });
}
OnSearchKeyDown(e) {
13 === e.keyCode && this.OnSearchSubmit();
}
OnSearchSubmit() {
window.open(b.De.COMMUNITY_BASE_URL + "search/users/#text=" + encodeURIComponent(this.state.input_search), "_self");
}
render() {
const e = b.L7.short_url + "/" + this.state.invite_token;
return d.createElement(
"div",
null,
d.createElement("div", { className: M().HeaderBlock }, (0, R.Xx)("#ManageFriends_AddAFriend")),
d.createElement("div", { className: M().Background }, d.createElement("h1", { className: M().Heading }, (0, R.Xx)("#ManageFriends_YourFriendCode")), d.createElement("div", { className: M().CopyContainer }, d.createElement("h1", { className: M().Text }, b.L7.accountid), d.createElement(w.KM, { autoFocus: !0, className: M().Button, onClick: () => this.OnCopy("friend_code", String(b.L7.accountid)) }, this.state.friend_code_copied ? (0, R.Xx)("#ManageFriends_Copied") : (0, R.Xx)("#ManageFriends_Copy"))), d.createElement("p", { className: M().Body }, (0, R.Xx)("#ManageFriends_EnterFriendCode")), d.createElement(G, { onButtonClick: this.OnAddFriend, buttonText: (0, R.Xx)("#ManageFriends_SendInvite"), bDisableForSelf: !0, bDisableForFriends: !0, bShowStatus: !0 })),
d.createElement("div", { className: M().DimBackground }, d.createElement("h1", { className: M().Heading }, (0, R.Xx)("#ManageFriends_OrSendQuickInvite")), d.createElement("p", { className: M().Body }, (0, R.Xx)("#ManageFriends_QuickInviteDescription")), d.createElement("p", { className: M().Body }, (0, R.Xx)("#ManageFriends_QuickInviteNote")), d.createElement("div", { className: M().CopyContainer }, Boolean(this.state.invite_token) && d.createElement("div", { className: M().Link }, e), d.createElement(w.KM, { className: M().Button, onClick: () => this.OnCopy("invite", e) }, this.state.invite_copied ? (0, R.Xx)("#ManageFriends_Copied") : (0, R.Xx)("#ManageFriends_Copy"))), d.createElement(w.zx, { className: M().GenerateLinkButton, onClick: this.OnCreateInviteLink }, (0, R.Xx)("#ManageFriends_CreateInviteLink"))),
d.createElement("div", { className: M().Background }, d.createElement("h1", { className: M().Heading }, (0, R.Xx)("#ManageFriends_OrSearch")), d.createElement("br", null), d.createElement("div", { style: { display: "flex", alignItems: "center", maxWidth: "598px", position: "relative" } }, d.createElement("div", { style: { width: "100%" } }, d.createElement(w.II, { className: M().Input, onKeyDown: this.OnSearchKeyDown, value: this.state.input_search, onChange: this.OnSearchChange, placeholder: (0, R.Xx)("#ManageFriends_EnterProfileName") })), d.createElement("div", { id: "searchIcon", style: { position: "absolute", right: "10px", cursor: "pointer" }, onClick: this.OnSearchSubmit }, d.createElement(k.YtI, null)))),
);
}
}
(0, i.gn)([D.ak], L.prototype, "OnCreateInviteLink", null), (0, i.gn)([D.ak], L.prototype, "OnCopy", null), (0, i.gn)([D.ak], L.prototype, "OnAddFriend", null), (0, i.gn)([D.ak], L.prototype, "OnSearchChange", null), (0, i.gn)([D.ak], L.prototype, "OnSearchKeyDown", null), (0, i.gn)([D.ak], L.prototype, "OnSearchSubmit", null);
class G extends d.Component {
constructor() {
super(...arguments), (this.state = { input_friend_code: "", disable_send_invite: !1, searchResult: null, invite_status: "pending" }), (this.m_currentRequest = 0);
}
OnFriendCodeChange(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
const t = e.target.value.split(",")[0];
this.setState({ input_friend_code: t, invite_status: "pending" }), window.clearTimeout(this.m_currentRequest), (this.m_currentRequest = window.setTimeout(() => this.LoadProfile(t), 500));
});
}
LoadProfile(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
if (e) {
const t = f.K.InitFromAccountID(Number(e));
yield y.LoadProfiles([t.ConvertTo64BitString()]);
const n = y.GetProfile(t.ConvertTo64BitString());
n ? this.setState({ searchResult: n, disable_send_invite: b.L7.is_limited || (this.props.bDisableForFriends && n.is_friend) || (this.props.bDisableForSelf && n.steamid === b.L7.steamid) }) : this.setState({ searchResult: null });
} else this.setState({ searchResult: null });
});
}
OnActionClick(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
const t = new FormData();
t.append("sessionID", b.De.SESSIONID), t.append("steamid", e), t.append("accept_invite", "0"), this.setState({ disable_send_invite: !0 });
(yield this.props.onButtonClick(e)) ? (this.setState({ input_friend_code: "", invite_status: "success" }), setTimeout(() => this.setState({ searchResult: null }), 3e3)) : this.setState({ invite_status: "failure", disable_send_invite: !1 });
});
}
render() {
return d.createElement("div", { className: M().FriendCodeSelector }, d.createElement(w.II, { className: M().Input, value: this.state.input_friend_code, onChange: this.OnFriendCodeChange, placeholder: (0, R.Xx)("#ManageFriends_EnterFriendCodePlaceholder") }), d.createElement(O, { searchResult: this.state.searchResult, invite_status: this.state.invite_status, bShowStatus: this.props.bShowStatus }, d.createElement(w.KM, { className: M().SendInviteButton, onClick: () => this.OnActionClick(this.state.searchResult.steamid), disabled: this.state.disable_send_invite }, this.props.buttonText)));
}
}
(0, i.gn)([D.ak], G.prototype, "OnFriendCodeChange", null), (0, i.gn)([D.ak], G.prototype, "LoadProfile", null), (0, i.gn)([D.ak], G.prototype, "OnActionClick", null);
const O = (e) => {
const { searchResult: t, invite_status: n, bShowStatus: i, children: o } = e,
r = (0, b.id)();
return Boolean(t)
? d.createElement(
"div",
{ className: M().ProfileCard },
d.createElement("div", { className: M().UserContainer }, d.createElement("div", { className: M().Image }, d.createElement("img", { style: { width: "100%", height: "100%" }, src: t.avatar_url_full })), d.createElement("div", { className: M().ProfileContent }, d.createElement("h1", { className: M().Heading }, t.persona_name), d.createElement("div", { className: M().ProfileLink }, d.createElement(T.IS, { target: r ? void 0 : "_blank", href: b.De.COMMUNITY_BASE_URL + "profiles/" + t.steamid }, (0, R.Xx)("#ManageFriends_ProfileLink")), d.createElement("br", null), d.createElement("span", { className: M().Body }, t.real_name, d.createElement("br", null), `${t.city}${t.city ? "," : ""} ${t.state}${t.state ? "," : ""} ${t.country}`))), o),
d.createElement("div", { className: M().ProfileLink }, t.is_friend && d.createElement("div", null, (0, R.Xx)("#ManageFriends_IsFriend")), 0 != t.friends_in_common && d.createElement("div", null, d.createElement(T.IS, { target: r ? void 0 : "_blank", href: b.De.COMMUNITY_BASE_URL + "profiles/" + t.steamid + "/friendscommon" }, 1 === t.friends_in_common ? (0, R.Xx)("#ManageFriends_FriendsInCommonSingular", t.friends_in_common) : (0, R.Xx)("#ManageFriends_FriendsInCommon", t.friends_in_common))), i && "failure" === n && d.createElement("div", { className: M().Failure }, (0, R.Xx)("#ManageFriends_InviteFailure")), i && "success" === n && d.createElement("div", { className: M().Success }, (0, R.Xx)("#ManageFriends_InviteSuccess", t.persona_name))),
)
: null;
};
var F = n(71357),
B = n(13106),
x = n(65204),
N = n(99165),
P = n(83817),
U = n(46057),
V = n(21298),
H = n(68816),
W = n(14341),
X = n(33613);
function j(e, t, n, i) {
(0, B.$W)(e, { friendGroup: t }, n, i);
}
function z(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
return 1 == (yield e.RemoveFriend(t));
});
}
const K = (e) => {
const { friendGroup: t, friend: n } = e;
return d.createElement(U.mo, { className: X.InvitesFriend, focusable: !1, childFocusDisabled: !0, friend: n, context: { friendGroup: t } });
},
q = (e) => {
const { friends: t, children: n } = e;
return d.createElement("div", { className: X.InvitesSectionHeader }, d.createElement("div", { className: X.Text }, t.name, " (", t.member_list.length, ")"), n);
},
Z = (e) => {
const { friendStore: t, setMutualFriends: n, closeModal: i } = e,
o = Array.from(n.values()).map((e) => t.GetFriend(e)),
r = d.useCallback(
(e, t) => {
let n = t.GetCommunityProfileURL();
(0, W.b8)(u.RA(e), n), i();
},
[i],
),
a = o.map((e) => d.createElement(P.s, { key: e.accountid, className: X.MutualFriendRow, noFocusRing: !0, onActivate: (t) => r(t, e), onOKActionDescription: (0, R.Xx)("#Friend_Menu_ViewProfile") }, d.createElement(U.mo, { className: X.InvitesFriend, focusable: !1, friend: e, context: {} })));
return d.createElement(x.uH, { className: "friendsui-container", strTitle: (0, R.Xx)("#Friend_Invites_MutualFriends"), onOK: i, onCancel: i, bAlertDialog: !0 }, d.createElement(w.uT, null, a));
};
const Q = (0, h.Pi)((e) => {
const { friendStore: t, context: n, friends: o } = e,
r = d.useCallback(
(e, t) => {
var n, i;
const r = (null === (n = o.map_steamid_to_mutual_friends.get(e.steamid64)) || void 0 === n ? void 0 : n.size) || 0;
return ((null === (i = o.map_steamid_to_mutual_friends.get(t.steamid64)) || void 0 === i ? void 0 : i.size) || 0) - r || (0, V.tN)(e.display_name, t.display_name);
},
[o],
);
if (0 == o.member_count) return null;
const a = o.member_list
.slice()
.sort(r)
.map((e, r) => {
(0, v.X)(2 == e.efriendrelationship, "Incorrect friend type in IncomingInvites");
const a = o.map_steamid_to_mutual_friends.get(e.steamid64),
s = (null == a ? void 0 : a.size)
? {
onOptionsActionDescription: (0, R.Xx)("#Friend_Invites_ViewMutual"),
onOptionsButton: (e) => {
!(function (e, t, n) {
(0, i.mG)(this, void 0, void 0, function* () {
const i = u.RA(n);
(0, H.AM)(d.createElement(Z, { friendStore: e, setMutualFriends: t }), i);
});
})(t, a, e);
},
}
: void 0;
return d.createElement(
P.s,
Object.assign({ key: e.accountid, className: X.InvitesRow }, s, { onMenuButton: (t) => j(n, o, e, t), onMenuActionDescription: (0, R.Xx)("#Friend_Menu_Open") }),
d.createElement(K, { friendGroup: o, friend: e }),
d.createElement(
w.zx,
{
onClick: (n) =>
(function (e, t, n) {
return (0, i.mG)(this, void 0, void 0, function* () {
const i = u.RA(n);
(yield (0, F.V3)(i, (0, R.Xx)("#Friend_Menu_BlockAllCommunication"), (0, R.Xx)("#Friend_Block_Confirm", t.display_name), (0, R.Xx)("#Button_Confirm"))) && 5 != (yield e.BlockPlayer(t)) && (0, F.zp)(i, (0, R.Xx)("#Friend_Menu_BlockIncomingInvite"), (0, R.Xx)("#Friend_BlockIncomingInvite_Error", t.display_name));
});
})(t, e, n),
},
(0, R.Xx)("#Button_Block"),
),
d.createElement(
w.zx,
{
onClick: (n) =>
(function (e, t, n) {
return (0, i.mG)(this, void 0, void 0, function* () {
let { eResult: i, eFriendRelationship: o } = yield e.SendFriendInvite(t);
if (3 != o) {
const e = u.RA(n);
(0, B.u8)(e, i, o, t.display_name);
}
});
})(t, e, n),
},
(0, R.Xx)("#Button_Accept"),
),
d.createElement(
w.zx,
{
onClick: (n) =>
(function (e, t, n) {
return (0, i.mG)(this, void 0, void 0, function* () {
if (!(yield z(e, t))) {
const e = u.RA(n);
(0, F.zp)(e, (0, R.Xx)("#Friend_Menu_IgnoreIncomingInvite"), (0, R.Xx)("#Friend_IgnoreIncomingInvite_Error", t.display_name));
}
});
})(t, e, n),
},
(0, R.Xx)("#Button_Ignore"),
),
);
});
return d.createElement(
P.s,
{ className: X.IncomingInvites, "flow-children": "grid", retainFocus: !0 },
d.createElement(w.tr, { className: X.Divider }),
d.createElement(
q,
{ friends: o },
o.member_list.length > 1 &&
d.createElement(
w.zx,
{
onClick: (e) =>
(function (e, t, n) {
return (0, i.mG)(this, void 0, void 0, function* () {
const i = u.RA(n);
if (!(yield (0, F.V3)(i, (0, R.Xx)("#Friend_Invites_IgnoreAllTitle"), (0, R.Xx)("#Friend_Invites_IgnoreAllDescription", t.length), (0, R.Xx)("#Button_Confirm")))) return;
const o = t.map((t) => z(e, t));
let r = 0;
(yield Promise.all(o)).forEach((e) => {
!e && r++;
}),
r > 0 && (0, F.zp)(i, (0, R.Xx)("#Error_Generic"), (0, R.kb)("#Friend_Invites_FailedToDecline", r));
});
})(t, o.member_list, e),
},
(0, R.Xx)("#FriendGroup_AllIgnore"),
),
),
a,
);
}),
$ = (0, h.Pi)((e) => {
const { friendStore: t, context: n, friends: o } = e;
if (0 == o.member_count) return null;
const r = o.member_list.map(
(e, r) => (
(0, v.X)(4 == e.efriendrelationship, "Incorrect friend type in OutgoingInvites"),
d.createElement(
P.s,
{ key: e.accountid, className: X.InvitesRow, onMenuButton: (t) => j(n, o, e, t), onMenuActionDescription: (0, R.Xx)("#Friend_Menu_Open") },
d.createElement(K, { friendGroup: o, friend: e }),
d.createElement(
w.zx,
{
onClick: (n) =>
(function (e, t, n) {
return (0, i.mG)(this, void 0, void 0, function* () {
const i = u.RA(n);
if (!(yield (0, F.V3)(i, (0, R.Xx)("#Friend_Invites_CancelInvite"), (0, R.Xx)("#Friend_CancelInvitation_Confirm", t.display_name), (0, R.Xx)("#Button_Confirm")))) return;
const o = yield e.RemoveFriend(t);
(3 != o && 6 != o) || (0, F.zp)(i, (0, R.Xx)("#Friend_Menu_CancelInvitation"), (0, R.Xx)("#Friend_CancelInvitation_Error", t.display_name));
});
})(t, e, n),
},
(0, R.Xx)("#Friend_Invites_CancelInvite"),
),
)
),
);
return d.createElement(P.s, { className: X.OutgoingInvites, "flow-children": "grid", retainFocus: !0 }, d.createElement(w.tr, { className: X.Divider }), d.createElement(q, { friends: o }), r);
}),
Y = (e) => {
const { friendStore: t } = e;
return d.createElement("div", { className: X.FriendCodeSection }, d.createElement("div", { className: X.FriendCode }, d.createElement("div", { className: X.Code }, t.self.persona.GetAccountID())), d.createElement("div", { className: X.Caption }, (0, R.Xx)("#FriendInvites_YourFriendCode")));
},
J = (e) => {
const { friendStore: t } = e,
n = d.useRef(),
i = d.useCallback(
(e) => {
var i;
let o = u.RA(e);
e.preventDefault();
const r = parseInt(null === (i = n.current) || void 0 === i ? void 0 : i.value);
return r && (0, H.AM)(d.createElement(ee, { friendStore: t, accountID: r, ownerWindow: o }), o), !0;
},
[t],
);
return d.createElement("div", { className: X.AddFriendSection }, d.createElement("div", { className: X.Title }, (0, R.Xx)("#FriendInvites_AddFriend_Title")), d.createElement("div", { className: X.Description }, (0, R.Xx)("#FriendInvites_AddFriend_Description")), d.createElement("form", { className: X.InputForm, onSubmit: i }, d.createElement(w.II, { autoFocus: !0, ref: n, className: X.Input, placeholder: (0, R.Xx)("#FriendInvites_AddFriend_Placeholder") }), d.createElement(w.zx, { className: X.SubmitButton, type: "submit" }, (0, R.Xx)("#Button_OK"))));
},
ee = (0, h.Pi)((e) => {
const { friendStore: t, accountID: n, ownerWindow: o, closeModal: r } = e,
[a, s] = E(n),
l = d.useCallback(
() =>
(0, i.mG)(void 0, void 0, void 0, function* () {
const { eResult: e, eFriendRelationship: i } = yield t.SendFriendInviteBySteamID(f.K.InitFromAccountID(n));
1 == e ? (4 == i ? (0, F.zp)(o, (0, R.Xx)("#Friend_Menu_AddToFriendsList"), (0, R.Xx)("#Friend_InviteSent")) : 3 == i && (0, F.zp)(o, (0, R.Xx)("#Friend_Menu_AddToFriendsList"), (0, R.Xx)("#Friend_MutualInviteSent", s.persona_name))) : (0, B.u8)(o, e, i, s.persona_name), r();
}),
[n, s, r, o, t],
);
let c = d.createElement(N.V, null),
m = !1;
return a || (s ? ((c = d.createElement(O, { searchResult: s, bShowStatus: !1 })), (m = !s.is_friend && s.accountid != t.self.steamid.GetAccountID())) : (c = d.createElement("div", { className: X.SearchError }, (0, R.Xx)("#Friend_Invites_NotFound")))), d.createElement(x.uH, { className: "friendsui-container", strTitle: (0, R.Xx)("#Friend_Invites_SearchTitle", n), onOK: l, onCancel: r, strOKButtonText: (0, R.Xx)("#ManageFriends_SendInvite"), strCancelButtonText: (0, R.Xx)("#Button_Close"), bOKDisabled: !m }, d.createElement(w.uT, null, c));
}),
te = (e) => {
const { friendStore: t, scrollableElement: n } = e,
i = d.useCallback(
(e) => {
var t;
e && (null === (t = n.current) || void 0 === t || t.scrollTo({ top: 0, behavior: "smooth" }));
},
[n],
);
return d.createElement(P.s, { className: X.TopSection, onFocusWithin: i }, d.createElement(J, { friendStore: t }), d.createElement(Y, { friendStore: t }));
},
ne = (0, h.Pi)((e) => {
const { friends: t, browserContext: n } = e,
i = d.useRef(),
o = t.FriendGroupStore.incoming_invites_group,
r = t.FriendGroupStore.outgoing_invites_group;
return (
d.useEffect(() => {
t.FriendGroupStore.EnsureMutualFriendsForIncomingInvites(), t.ClanStore.EnsureInitialStateForClanInvites();
}, [t]),
d.createElement(P.s, { ref: i, className: X.InvitesList, "flow-children": "grid" }, d.createElement(te, { friendStore: t, scrollableElement: i }), d.createElement(Q, { friendStore: t, context: n, friends: o }), d.createElement($, { friendStore: t, context: n, friends: r }))
);
});
var ie = n(31075),
oe = n(41370),
re = n(87018),
ae = n(5395),
se = n(93354),
le = n(19339),
ce = n(58118);
function me(e) {
let { chats: t, onActivate: n } = e,
o = (0, i._T)(e, ["chats", "onActivate"]),
a = (0, oe.SZ)(() => {
let e = 0,
t = r.Ul.GetServerRTime32() - 2 * ae._H.PerWeek;
const n = r.Ul.ChatStore.GetRecentChats();
for (const i of n)
if (i instanceof le.a) {
e += i.unread_message_count;
} else if (i instanceof se.PR) {
i.chatRoomList.forEach((n) => {
if (n.has_unread_messages && n.time_last_ack > t) {
let t = n.unread_message_count;
t > 0 && (e += t);
}
});
}
return e;
});
if (0 == a) return null;
return d.createElement(
P.s,
Object.assign(
{
className: (0, re.Z)(ce.NotificationUnreadMentionContainer, a > 0 && ce.HasMessages),
onActivate: (e) => {
n && n(e), (r.Ul.UIStore.FriendsListSteamDeckActiveTab = s.ou.RecentMessages);
},
},
o,
),
d.createElement(k.foH, null),
d.createElement("div", { className: ce.Header_NotificationUnreadMention }, a),
);
}
var de = n(84446),
he = n(618),
ue = n(43825);
function pe(e) {
let { chats: t, className: n } = e,
o = (0, i._T)(e, ["chats", "className"]),
a = (0, oe.SZ)(() => t.GetActiveVoiceChat());
const s = a instanceof le.a ? a : void 0,
l = null == s ? void 0 : s.GetMember(s.accountid_partner),
c = a instanceof de.K ? a : void 0,
m = (0, oe.SZ)(() => t.VoiceChat.IsMicMuted() || 0 == t.VoiceChat.GetVoiceInputGain()),
h = (0, oe.SZ)(() => t.VoiceChat.IsOutputMuted() || 0 == t.VoiceChat.GetVoiceOutputGain()),
u = (0, oe.SZ)(() => t.FriendChatStore.GetAllChats());
let p = !1;
const _ = (0, oe.SZ)(() =>
u.filter((e) => {
let t = r.Ul.VoiceStore.BPartnerHasRequestedAndIsInOneOnOneChat(e.accountid_partner);
return (null == s ? void 0 : s.accountid_partner) == e.accountid_partner && (t = !1), t;
}),
);
if (
(_.forEach((e) => {
p || (p = r.Ul.VoiceStore.BSelfHadPreviouslyJoinedOneOnOneChat(null == e ? void 0 : e.accountid_partner));
}),
!t.VoiceChat.IsAnyVoiceActive() && !a && 0 == _.length)
)
return null;
const g = null != s,
C = null != c,
f = 0 != _.length,
v = (0, re.Z)(n, ue.VoiceChatHeader, a && ue.ActiveCall, g && ue.FriendVoice, C && ue.GroupVoice, f && ue.IncomingCall, p && ue.CallOnHold);
let S = {};
if (g) (S.onSecondaryButton = () => t.VoiceChat.OnUserEndVoiceChat()), (S.onSecondaryActionDescription = (0, R.Xx)("#VoiceChat_Leave"));
else if (C) (S.onSecondaryButton = () => t.VoiceChat.OnUserEndVoiceChat()), (S.onSecondaryActionDescription = (0, R.Xx)("#VoiceChat_LeaveVoiceRoom"));
else if (f) {
let e = _[0];
(S.onSecondaryButton = () => r.Ul.VoiceStore.OnRejectOneOnOneVoiceChatForPartner(e.accountid_partner)), (S.onSecondaryActionDescription = (0, R.Xx)("#Voice_DeclineVoiceChat"));
}
return d.createElement(
P.s,
Object.assign({ className: v }, o, S),
d.createElement("div", { className: ue.VoiceChatStatusBackground }),
_.map((e) => {
let t = e.chat_partner;
return d.createElement(U.mo, { key: e.unique_id, noActions: !0, bHideGameName: !0, bHidePersona: !0, bHideStatusInfo: !0, showVoiceLevel: !0, friend: t, context: { chat: e, chatContext: "friendslist" }, avatarSize: "Medium", statusPosition: "right" });
}),
0 != _.length && d.createElement("div", { className: "WaitingForYouFirstTime" }, p ? d.createElement(k.Yx0, null) : d.createElement(k.NBO, null), !p && d.createElement("div", { className: "Sonar" }, d.createElement("div", { className: "SonarCircle" }))),
s && d.createElement(U.mo, { noActions: !0, bHideGameName: !0, bHidePersona: !0, bHideStatusInfo: !0, showVoiceLevel: !0, friend: l, context: { chat: s, chatContext: "friendslist" }, avatarSize: "Medium", statusPosition: "right" }),
c && d.createElement(he._P, { group: c.GetGroup(), small: !0 }),
(s || c) && d.createElement(k.bpe, { off: h, className: h ? "Muted" : void 0 }),
(s || c) && d.createElement(k.JgI, { off: m, className: m ? "Muted" : void 0 }),
);
}
class _e extends d.Component {
constructor(e) {
super(e), (this.m_refTextInput = null), (this.state = { error: 1, strPIN: "" });
}
componentDidMount() {
this.m_refTextInput.focus();
}
BindTextInput(e) {
this.m_refTextInput = e;
}
OnPINInput(e) {
this.setState({ strPIN: e.target.value });
}
onOK(e) {
return (
e.preventDefault(),
r.Ul.ParentalStore.Unlock(this.state.strPIN).then((e) => {
1 != e && this.setState({ error: e });
}),
!0
);
}
render() {
let e = "";
switch (this.state.error) {
case 1:
break;
case 25:
e = (0, R.Xx)("#FamilyView_TooManyAttempts");
break;
default:
e = (0, R.Xx)("#FamilyView_BadPIN");
}
return d.createElement("div", null, d.createElement("div", { className: "FamilyViewTitle" }, (0, R.Xx)("#FamilyView_Title")), d.createElement("div", { className: "FamilyViewInstructions" }, (0, R.Xx)("#FamilyView_Unlock_Instructions")), d.createElement("form", { onSubmit: this.onOK }, d.createElement("input", { type: "password", maxLength: 4, className: "pinInput", ref: this.BindTextInput, value: this.state.strPIN, onChange: this.OnPINInput }), d.createElement("button", { type: "submit" }, (0, R.Xx)("#Button_OK"))), e && d.createElement("p", { className: "error_text" }, e));
}
}
(0, i.gn)([D.ak], _e.prototype, "BindTextInput", null), (0, i.gn)([D.ak], _e.prototype, "OnPINInput", null), (0, i.gn)([D.ak], _e.prototype, "onOK", null);
var ge = n(37634),
Ce = n(29512),
fe = n(58908),
ve = n(34294),
Se = n(11612),
be = n(86374),
Ie = n(99627),
ye = n(33690),
Ee = n(21569),
De = n(61963),
we = n(38571),
Re = n(76135),
Ae = n(55948),
Me = n(59192),
ke = n(59702),
Te = n(92117),
Le = n(62210),
Ge = n.n(Le),
Oe = n(96127),
Fe = n(56552);
var Be = n(99643);
const xe = d.memo(function () {
const e = (0, Fe.useQueryClient)();
return (
(function (e, t) {
const n = (0, be.rK)();
(0, d.useEffect)(() => {
if (n) return n.messageHandlers.RegisterServiceNotificationHandler(e, t).unregister;
}, [n, e, t]);
})(
Oe.oD.NotifyPrivateAppListChangedHandler,
d.useCallback((t) => ((0, Be.z3)(e, t.Body().private_apps().appids()), 1), [e]),
),
null
);
});
function Ne() {
const e = (0, a.rb)((0, ye.Wy)().ownerWindow);
return void 0 === e.m_eUIMode ? Object.assign(Object.assign({}, e), { m_eUIMode: 4 }) : e;
}
function Pe(e, t, n) {
const i = window,
o = (0, a.rb)(i);
ge.s(n).render(d.createElement($e, { ownerWindow: i }, d.createElement(Ye, null), d.createElement(Je, { friends: e, chats: t, browserContext: o, elTarget: n })));
}
function Ue(e, t, n) {
const i = window,
o = (0, a.rb)(i);
ge.s(n).render(d.createElement($e, { ownerWindow: i }, d.createElement(Re.Y0, { browserInfo: o }, " ")));
}
function Ve(e, t, n) {
const i = (0, oe.SZ)(() => r.Ul.ready_to_render),
o = Ne();
return d.createElement(b.fI, { IN_GAMEPADUI: !0 }, d.createElement(et, { key: "throbber", fadeOut: i, className: Ge().throbberContainerSteamDeckFriendsQuickAccess }), i ? d.createElement(U.ZY, { bQuickAccess: !0, friends: e, chats: t, browserContext: o, collapsed: !1 }) : null);
}
function He(e, t) {
const n = (0, oe.SZ)(() => r.Ul.ready_to_render),
i = Ne();
return d.createElement(b.fI, { IN_GAMEPADUI: !0 }, d.createElement(et, { key: "throbber", fadeOut: n, className: Ge().throbberContainerSteamDeckFriendsQuickAccess }), n ? d.createElement(ne, { friends: e, browserContext: i }) : null);
}
function We(e, t, n) {
const i = (0, oe.SZ)(() => r.Ul.ready_to_render),
o = Ne();
return d.createElement(b.fI, { IN_GAMEPADUI: !0 }, d.createElement(et, { key: "throbber", fadeOut: i, className: Ge().throbberContainerSteamDeckFriends }), i ? d.createElement(U.ZY, { bQuickAccess: !1, friends: e, chats: t, browserContext: o, collapsed: !1 }) : null);
}
function Xe(e, t, n) {
const i = (0, oe.SZ)(() => r.Ul.ready_to_render);
return d.createElement(b.fI, { IN_GAMEPADUI: !0 }, d.createElement(et, { key: "throbber", fadeOut: i, className: Ge().throbberContainerSteamDeckFriendsQuickAccess }), i ? d.createElement("div", null, "(out of date client)") : null);
}
function je(e, t, n) {
const i = (0, oe.SZ)(() => r.Ul.ready_to_render),
o = Ne();
return d.createElement(b.fI, { IN_GAMEPADUI: !0 }, d.createElement(et, { key: "throbber", fadeOut: i, className: Ge().throbberContainerSteamDeckFriends }), i ? d.createElement(U.J9, { children: n.children, friends: e, chats: t, browserContext: o }) : null);
}
function ze(e) {
const t = Ne();
let n = r.Ul.UIStore.GetDefaultTabSetForContext(t);
return d.createElement(b.fI, { IN_GAMEPADUI: !0 }, d.createElement(c.ar, { tabs: n, ResponsiveWindowState: null }));
}
function Ke(e, t) {
const n = Ne();
return d.createElement(b.fI, { IN_GAMEPADUI: !0 }, d.createElement(m.Gs, { browserContext: n }));
}
function qe(e, t) {
return d.createElement(b.fI, { IN_GAMEPADUI: !0 }, d.createElement(ie.m, { chats: e }));
}
function Ze(e, t) {
return d.createElement(b.fI, { IN_GAMEPADUI: !0 }, d.createElement(pe, Object.assign({ chats: e }, t)));
}
function Qe(e, t) {
return d.createElement(b.fI, { IN_GAMEPADUI: !0 }, d.createElement(me, Object.assign({ chats: e }, t)));
}
function $e(e) {
const { ownerWindow: t, children: n } = e,
i = d.useCallback(() => (null === r.Ul || void 0 === r.Ul ? void 0 : r.Ul.CMInterface), []),
o = (0, D.kD)(d.useCallback(() => new Ie.Z(), []));
return d.createElement(Te.R, null, d.createElement(b.fI, { IN_GAMEPADUI: !1 }, d.createElement(ye.Rt, { ownerWindow: t }, d.createElement(Ee.F, { body_class: "friendsui-container" }, d.createElement(be.Ub, { useActiveCMInterface: i, useStorage: o }, n)))));
}
function Ye() {
return d.createElement(we.DT, null, d.createElement(xe, null));
}
let Je = class extends d.Component {
render() {
const { browserContext: e, friends: t, chats: n, elTarget: i } = this.props;
let o = new a.i5(i.ownerDocument.defaultView),
s = null,
l = null,
c = r.Ul.ready_to_render;
return c && ((s = r.Ul.UIStore.GetDefaultTabSetForContext(e)), (l = r.Ul.UIStore.GetPerContextChatData(e)), l.SetFriendsListWindow(o)), d.createElement(d.Fragment, null, d.createElement(et, { fadeOut: c }), c && d.createElement(at, { friends: t, chats: n, tabset: s, container: o }));
}
};
function et(e) {
const { fadeOut: t, className: n } = e,
[i, o] = d.useState(t),
r = d.useCallback(
(e) => {
e.target == e.currentTarget && t && "opacity" == e.propertyName && o(!0);
},
[t],
);
if (i) return null;
let a = Ge().throbberContainer;
return t && (a += ` ${Ge()["throbberContainer-exit-active"]}`), d.createElement("div", { className: (0, re.Z)(a, n), onTransitionEnd: r }, d.createElement("div", { className: "WaitingForInterFaceReadyContainer" }, d.createElement("div", { className: "WaitingForInterFaceReadyThrobber" }, d.createElement(N.V, { className: "Throbber_Blur", size: "xlarge" }), d.createElement(N.V, { size: "xlarge" }))));
}
Je = (0, i.gn)([h.Pi], Je);
class tt extends ye.x1 {
constructor(e, t, n, i) {
super(e, t, n, i);
}
GetSavedDimensionsKey() {
if (this.BIsInOverlay()) {
let e = r.Ul.UIStore.GetPerContextChatData(this.m_rgParams.target_browser).screen_info;
return "Overlay_" + (e && e.width && e.height ? e.width + "x" + e.height + "_" : "") + this.m_strSavedDimensionsKey;
}
return this.m_strSavedDimensionsKey;
}
}
const nt = 226,
it = 400,
ot = 3 * nt;
class rt extends tt {
constructor(e, t, n, i, o) {
let r = ye.eL.Resizable;
i && !(0, b.Uy)() && (r |= ye.eL.Minimized);
let s = 300,
l = 650,
c = !1;
o && (o.width && ((s = o.width), (c = !0)), o.height && ((l = o.height), (c = !0))), super("friendslist", "PopupFriendsListDimensions", { dimensions: { width: s, height: l }, minWidth: nt, minHeight: it, title: (0, R.Xx)("#WindowTitle_FriendsList"), html_class: "friendsui-container client_chat_frame fullheight SavedDimensionsPopup", body_class: "fullheight", target_browser: n, eCreationFlags: r, bIgnoreSavedDimensions: c }, !1), (this.m_friends = e), (this.m_chats = t), a.g_FriendsUIDesktopApp.m_strLoaderWindowRestoreDetails && (this.SaveWindowPosition(a.g_FriendsUIDesktopApp.m_strLoaderWindowRestoreDetails), (a.g_FriendsUIDesktopApp.m_strLoaderWindowRestoreDetails = void 0));
}
Render(e, t) {
t.setAttribute("class", "fullheight popup_chat_frame");
let n = new a.i5(e),
i = this.browser_info || r.Ul.GetDefaultBrowserContext(),
o = r.Ul.UIStore.GetDefaultTabSetForContext(i);
(this.m_browserContext = i), r.Ul.UIStore.BIsFriendsListSingleWindow(i) && e.SteamClient.Window.SetMinSize && e.SteamClient.Window.SetMinSize(ot, it), (this.m_reactRoot = ge.s(t)), this.m_reactRoot.render(d.createElement($e, { ownerWindow: this.window }, d.createElement(at, { popup: this, friends: this.m_friends, chats: this.m_chats, tabset: o, container: n })));
}
OnResizeComplete(e) {
super.OnResizeComplete(e), window.parent.postMessage({ message: "FriendsListRestoreDetailsChanged", data: e }, "https://steamloopback.host");
}
OnClose() {
super.OnClose(), this.m_reactRoot.unmount(), window.parent.postMessage({ message: "FriendsListRestoreDetailsChanged", data: this.m_rgParams.strRestoreDetails }, "https://steamloopback.host"), this.m_browserContext && r.Ul.OnFriendsListClosed(this.m_browserContext), this.m_fnOnClose && this.m_fnOnClose();
}
SetOnClose(e) {
this.m_fnOnClose = e;
}
}
let at = class extends d.Component {
constructor(e) {
super(e), (this.m_bUsePopups = !1), (this.m_nWindowTitleUnreadCycleCount = 0), (this.m_refChatDialog = d.createRef()), (this.m_refRoot = d.createRef()), (this.m_lastFocusElement = null), (0, g.rC)(this);
this.m_browserContext = this.props.popup && this.props.popup.browser_info ? this.props.popup.browser_info : r.Ul.GetDefaultBrowserContext();
let t = r.Ul.UIStore.GetPerContextChatData(this.m_browserContext);
(this.m_bUsePopups = t.BUsePopups()), this.m_bUsePopups ? (this.m_nInlineChatWidth = 640) : ((this.m_nInlineChatWidth = 530), (this.m_ResponsiveWindowState = r.Ul.UIStore.GetResponsiveWindowState(this.m_browserContext))), (this.state = { bIsResizingWindow: !1 });
}
OnCopy(e) {
this.m_refChatDialog && this.m_refChatDialog.current && this.m_refChatDialog.current.OnCopy(e);
}
BindWindowHandlers() {
const e = this.props.container,
t = this.props.tabset;
(this.m_popupActionDisposer = (0, g.EH)(() => {
if (!o.De.IN_CLIENT) {
let t = r.Ul.ChatStore.FriendChatStore.GetUnfilteredFriendsWithUnreadMessages();
t.length && void 0 === this.m_unTimerWindowTitleUnreadCycle
? (this.m_unTimerWindowTitleUnreadCycle = window.setInterval(() => {
this.m_nWindowTitleUnreadCycleCount = (this.m_nWindowTitleUnreadCycleCount + 1) % 1e3;
}, 2e3))
: t.length || void 0 === this.m_unTimerWindowTitleUnreadCycle || (window.clearInterval(this.m_unTimerWindowTitleUnreadCycle), (this.m_unTimerWindowTitleUnreadCycle = void 0));
let n = 1 + t.length,
i = this.m_nWindowTitleUnreadCycleCount % n;
if (i > 0) {
let n = t[i - 1];
return void (e.title = (0, R.Xx)("#WindowTitle_UnreadMessage", n.name));
}
}
r.Ul.UIStore.BIsFriendsListSingleWindow(this.m_browserContext) && t.GetTitle() ? (o.De.IN_CLIENT ? (e.title = (0, R.Xx)("#WindowTitle_FriendsList") + " - " + t.GetTitle()) : (e.title = t.GetTitle())) : (e.title = (0, R.Xx)("#WindowTitle_FriendsList"));
})),
(this.m_popupFocusDisposer = e.OnFocus(() => {
r.Ul.UIStore.BIsFriendsListSingleWindow(this.m_browserContext) && this.props.tabset.OnWindowFocus();
}));
}
UnbindWindowHandlers() {
this.m_popupActionDisposer && (this.m_popupActionDisposer(), (this.m_popupActionDisposer = void 0)), this.m_popupFocusDisposer && (this.m_popupFocusDisposer.unregister(), (this.m_popupFocusDisposer = void 0));
}
componentWillUnmount() {
this.UnbindWindowHandlers();
}
componentDidMount() {
this.BindWindowHandlers(), (this.m_browserContext.m_eBrowserType != ve.i_.EBrowserType_OpenVROverlay && this.m_browserContext.m_eBrowserType != ve.i_.EBrowserType_OpenVROverlay_Dashboard) || (this.m_refRoot.current.addEventListener("focusin", this.OnFocusIn), this.m_refRoot.current.addEventListener("focusout", this.OnFocusOut));
}
OnFocusIn(e) {
let t = !1;
switch (e.target.tagName) {
case "TEXTAREA":
t = !0;
break;
case "INPUT":
t = "text" == e.target.type;
}
if (t) {
e.currentTarget.ownerDocument.defaultView.SteamClient.OpenVR.ShowKeyboard(), console.log("Showing VR Keyboard"), (this.m_lastFocusElement = e.target), this.m_lastFocusElement.addEventListener("click", this.OnTextInputClick);
}
}
OnFocusOut(e) {
if (e.target == this.m_lastFocusElement) {
e.currentTarget.ownerDocument.defaultView.SteamClient.OpenVR.HideKeyboard(), this.m_lastFocusElement.removeEventListener("click", this.OnTextInputClick), (this.m_lastFocusElement = null), console.log("Hiding VR Keyboard");
}
}
OnTextInputClick(e) {
e.currentTarget.ownerDocument.defaultView.SteamClient.OpenVR.ShowKeyboard();
}
BindFriendsListContainer(e) {
this.m_elFriendsListContainer = e;
}
OnGrabberMouseDown(e) {
let t = e.currentTarget.ownerDocument.defaultView;
this.setState({ bIsResizingWindow: !0 }), t.addEventListener("mousemove", this.HandleMouseMove), t.addEventListener("mouseup", this.UnregisterFriendsListDragEvents);
}
OnGrabberTouchStart(e) {
let t = e.currentTarget.ownerDocument.defaultView;
t.addEventListener("touchmove", this.HandleTouchMove), t.addEventListener("touchend", this.UnregisterFriendsListDragEvents);
}
HandleTouchMove(e) {
e.touches.length >= 1 && this.InternalAdjustFriendsListContainerOnDrag(e.touches[0].clientX);
}
HandleMouseMove(e) {
this.InternalAdjustFriendsListContainerOnDrag(e.clientX);
}
InternalAdjustFriendsListContainerOnDrag(e) {
if (!this.m_elFriendsListContainer) return;
let t = this.m_elFriendsListContainer.getBoundingClientRect().left;
this.SetFriendsListSingleWindowWidth(e - t);
}
SetFriendsListSingleWindowWidth(e) {
let t = (this.props.popup ? this.props.popup.window : window).innerWidth,
n = (0, ke.Lh)(t - 400, 200, 440);
(e = (0, ke.Lh)(e, 200, n)), a.g_FriendsUIDesktopApp.SetUIDisplayPref("nFriendsListSingleWindowWidthPx", e);
}
UnregisterFriendsListDragEvents(e) {
this.setState({ bIsResizingWindow: !1 }), e.view.removeEventListener("mousemove", this.HandleMouseMove), e.view.removeEventListener("touchmove", this.HandleTouchMove), e.view.removeEventListener("mouseup", this.UnregisterFriendsListDragEvents), e.view.removeEventListener("touchend", this.UnregisterFriendsListDragEvents);
}
render() {
let e = !0,
t = !0,
n = r.Ul.UIStore.BIsFriendsListSingleWindow(this.m_browserContext),
i = r.Ul.UIStore.GetPerContextChatData(this.m_browserContext),
m = !1,
h = !1;
if (!n)
if (this.m_ResponsiveWindowState) {
let n = this.m_ResponsiveWindowState.GetActiveView();
(e = n == s.yf.FriendsList), (t = n == s.yf.Chat);
} else t = !1;
let u = r.Ul.UIStore.GetTheaterMode(),
p = !(o.De.IN_CLIENT || u || o.De.IN_TENFOOT || window.__bHideHeader),
_ = "chat_main fullheight",
g = null;
e && t ? (this.props.tabset.tabCount > 0 && ((h = !0), (m = r.Ul.UIStore.BIsFriendsListCollapsed(this.m_browserContext))), (_ += " singlewindow"), (g = d.createElement("div", { className: "singleWindowDivider" + (m ? " friendsListCollapsed" : ""), onMouseDown: this.OnGrabberMouseDown, onTouchStart: this.OnGrabberTouchStart }))) : e ? (_ += " responsive_friends") : t && (_ += " responsive_chats"), this.state.bIsResizingWindow && (_ += " resizingSingleWindow"), u && (_ += " TheaterMode"), this.props.popup && this.props.popup.focused && (_ += " focused"), r.Ul.CMInterface.BDisconnected() && !r.Ul.FriendStore.BIsOfflineMode() && (_ += " errorDisconnected");
let C = this.props.popup && this.props.popup.window,
f = m ? { width: 0, transition: "width 0.32s ease-in-out, opacity 0.32s ease-in-out" } : { width: a.g_FriendsUIDesktopApp.UIDisplayPrefs.nFriendsListSingleWindowWidthPx + "px" };
return r.Ul.SettingsStore.IsSteamInTournamentMode()
? d.createElement("div", { className: _, ref: this.m_refRoot }, d.createElement(we.SV, null, d.createElement(dt, { popup: this.props.popup ? this.props.popup.window : void 0 })))
: r.Ul.ParentalStore.BIsFriendsBlocked()
? o.De.IN_CLIENT
? d.createElement("div", { className: _ }, d.createElement(_e, null))
: (location.reload(), d.createElement("div", null))
: d.createElement(
"div",
{ className: _, onContextMenu: De.T, ref: this.m_refRoot },
d.createElement(we.SV, null, d.createElement(dt, { popup: this.props.popup ? this.props.popup.window : void 0 })),
p && d.createElement(st, { friends: this.props.friends }),
d.createElement(P.s, { className: "chat_main_flex displayRow", onCopy: this.OnCopy }, r.Ul.ready_to_render && d.createElement(we.SV, null, d.createElement(Re.Y0, { browserInfo: this.m_browserContext, bUsePopups: i.BUsePopups() }, e && d.createElement(l.R, { className: "friendsListContainer fullheight " + (m ? "collapsed" : ""), style: t ? f : null, ref: this.BindFriendsListContainer, rgAcceptedTypes: [], bAcceptsFiles: !0 }, d.createElement(U.$g, { friends: this.props.friends, chats: this.props.chats, popup: C, browserContext: this.m_browserContext, collapsible: h, collapsed: m })), g, t && d.createElement(c.ar, { tabs: this.props.tabset, popup: C, ref: this.m_refChatDialog, ResponsiveWindowState: e ? null : this.m_ResponsiveWindowState, showOpenFriendsList: h && m }), this.props.popup && o.De.IN_CLIENT && d.createElement(Me.f, { popup: C }), d.createElement("div", { className: "singleWindowFocusBar chatSingleWindowFocusBar" })))),
);
}
};
(0, i.gn)([g.LO], at.prototype, "m_nWindowTitleUnreadCycleCount", void 0), (0, i.gn)([D.ak], at.prototype, "OnCopy", null), (0, i.gn)([D.ak], at.prototype, "OnFocusIn", null), (0, i.gn)([D.ak], at.prototype, "OnFocusOut", null), (0, i.gn)([D.ak], at.prototype, "OnTextInputClick", null), (0, i.gn)([D.ak], at.prototype, "BindFriendsListContainer", null), (0, i.gn)([D.ak], at.prototype, "OnGrabberMouseDown", null), (0, i.gn)([D.ak], at.prototype, "OnGrabberTouchStart", null), (0, i.gn)([D.ak], at.prototype, "HandleTouchMove", null), (0, i.gn)([D.ak], at.prototype, "HandleMouseMove", null), (0, i.gn)([D.ak], at.prototype, "UnregisterFriendsListDragEvents", null), (at = (0, i.gn)([h.Pi], at));
let st = class extends d.Component {
render() {
let e = this.props.friends.self,
t = o.De.EREALM === Se.IN.k_ESteamRealmChina;
return d.createElement("div", { className: Ge().SteamPageHeader }, d.createElement("a", { href: `${o.De.STORE_BASE_URL}` }, d.createElement("div", { className: (0, re.Z)(Ge().SteamPageHeaderShortLogo, o.De.EREALM == Se.IN.k_ESteamRealmChina ? Ge().LogoChina : Ge().LogoGlobal) })), d.createElement(lt, { text: (0, R.Xx)("#StoreLink_Label"), href: `${o.De.STORE_BASE_URL}` }), !t && d.createElement(lt, { text: (0, R.Xx)("#CommunityLink_Label"), href: `${o.De.COMMUNITY_BASE_URL}` }), d.createElement(lt, { text: e.primary_display_name, href: e.GetCommunityProfileURL() }), d.createElement(lt, { text: (0, R.Xx)("#SupportLink_Label"), href: `${o.De.HELP_BASE_URL}` }));
}
};
function lt(e) {
return d.createElement("a", { className: Ge().SteamPageHeaderTopLink, href: e.href }, e.text);
}
st = (0, i.gn)([h.Pi], st);
class ct extends tt {
constructor(e, t, n, i, o, r, a) {
let s = { title: "", html_class: "friendsui-container client_chat_frame fullheight ChatPopup", body_class: "fullheight", minWidth: 400, minHeight: 400, strRestoreDetails: o, dimensions: { width: 740, height: 650 }, target_browser: e, eCreationFlags: ye.eL.Resizable };
a && (s.eCreationFlags |= ye.eL.Minimized), r && (Object.assign(s.dimensions, r), (s.bIgnoreSavedDimensions = !0)), super("chat_" + t, n.GetTabSetIdentifier(), s, !0), (this.m_tabSet = n), (this.m_chats = i);
}
SetTitle() {
if (this.m_popup && this.m_popup.document && this.m_tabSet) {
let e = this.m_tabSet.GetTitle();
this.m_popup.document.title = e;
}
}
OnFocus() {
this.m_tabSet.OnWindowFocus();
}
BindWindowHandlers() {
this.m_popupActionDisposer || (this.m_popupActionDisposer = (0, g.EH)(this.SetTitle));
}
UnbindWindowHandlers() {
this.m_popupActionDisposer && (this.m_popupActionDisposer(), (this.m_popupActionDisposer = void 0));
}
get tab_set() {
return this.m_tabSet;
}
ClearTabSet() {
this.m_tabSet = void 0;
}
OnResize() {
r.Ul.UIStore.OnTabSetResized(this.m_tabSet), super.OnResize();
}
OnBeforeUnload() {
this.m_tabSet && super.SetSavedDimensionsKey(this.m_tabSet.GetTabSetIdentifier()), super.OnBeforeUnload();
}
OnClose() {
if (this.m_tabSet) {
let e = !1;
null != this.m_popup.window && this.m_popup.window.SteamClient && this.m_popup.window.SteamClient.Window && this.m_popup.window.SteamClient.Window.ProcessShuttingDown && (e = this.m_popup.window.SteamClient.Window.ProcessShuttingDown()), this.m_tabSet.OnPopupClosed(e);
}
this.UnbindWindowHandlers(), this.m_reactRoot.unmount();
}
Render(e, t) {
t.setAttribute("class", "fullheight popup_chat_frame"), this.BindWindowHandlers(), (this.m_reactRoot = ge.s(t)), this.m_reactRoot.render(d.createElement(mt, { popup: this, chatTabs: this.m_tabSet }));
}
}
(0, i.gn)([D.ak], ct.prototype, "SetTitle", null);
let mt = class extends d.Component {
render() {
let e = this.props.popup.window,
t = this.props.chatTabs,
n = "popup_chat_frame fullheight";
return this.props.popup.focused && (n += " focused"), r.Ul.UIStore.GetTheaterMode() && (n += " TheaterMode"), r.Ul.CMInterface.BDisconnected() && (n += " errorDisconnected"), d.createElement($e, { ownerWindow: e }, d.createElement("div", { className: n, onContextMenu: De.T }, d.createElement(dt, { popup: this.props.popup.window }), d.createElement(Re.Y0, { browserInfo: this.props.popup.browser_info }, d.createElement(c.ar, { tabs: t, popup: e, ResponsiveWindowState: null })), o.De.IN_CLIENT && d.createElement(Me.f, { popup: e })));
}
};
mt = (0, i.gn)([h.Pi], mt);
let dt = class extends d.Component {
OnKeyDown(e) {
e.preventDefault(), e.stopPropagation();
}
render() {
return o.De.IN_CLIENT ? (r.Ul.CMInterface.BDisconnected() && !r.Ul.FriendStore.BIsOfflineMode() ? d.createElement("div", { className: "ConnectionTrouble", tabIndex: 0, onKeyDown: this.OnKeyDown }, d.createElement("div", { className: "ConnectionTroubleContent" }, d.createElement(Ae.T, { hideMin: !0, hideMax: !0, popup: this.props.popup }), d.createElement("div", { className: "ConnectionTroubleMessage" }, (0, R.Xx)("#ConnectionTrouble_CurrentlyDisconnected")))) : null) : d.createElement(ht, null);
}
};
(0, i.gn)([D.ak], dt.prototype, "OnKeyDown", null), (dt = (0, i.gn)([h.Pi], dt));
let ht = class extends d.Component {
constructor(e) {
super(e), (this.m_bRequestingNotificationPermission = !1), (this.state = { bShouldRequestNotificationPermission: !0, bShowStartupDelayMessage: !1, bShowReconnectWaitMessage: !1, cReconnectWaitSeconds: 0 });
}
componentDidMount() {
if (!r.Ul.ready_to_render) {
let e = performance.now() - r.Ul.GetStartupTime();
this.m_iIntervalDelayedStartup = window.setTimeout(() => {
this.setState({ bShowStartupDelayMessage: !0 }), (this.m_iIntervalDelayedStartup = void 0);
}, 1500 - e);
}
}
componentWillUnmount() {
this.m_iIntervalDelayedStartup && (window.clearTimeout(this.m_iIntervalDelayedStartup), (this.m_iIntervalDelayedStartup = void 0)), this.m_iIntervalUpdateReconnectStatus && (window.clearInterval(this.m_iIntervalUpdateReconnectStatus), (this.m_iIntervalUpdateReconnectStatus = void 0));
}
IntervalUpdateReconnectWaitStatus() {
let e = a.g_FriendsUIDesktopApp.WebLogonManager;
if (e.BIsWaitingToReconnect()) {
let t = Math.ceil(e.GetMSUntilNextReconnectAttempt() / 1e3);
t != this.state.cReconnectWaitSeconds && this.setState({ bShowReconnectWaitMessage: !0, cReconnectWaitSeconds: t });
} else window.clearInterval(this.m_iIntervalUpdateReconnectStatus), (this.m_iIntervalUpdateReconnectStatus = void 0), this.setState({ bShowReconnectWaitMessage: !1, cReconnectWaitSeconds: 0 });
}
StartReconnectUpdateInterval() {
this.m_iIntervalUpdateReconnectStatus || (this.m_iIntervalUpdateReconnectStatus = window.setInterval(this.IntervalUpdateReconnectWaitStatus, 250));
}
OnReconnectNowClick() {
a.g_FriendsUIDesktopApp.WebLogonManager.ReconnectNow();
}
OnLoginClick() {
window.location.href = window.location.href;
}
render() {
let e = a.g_FriendsUIDesktopApp.WebLogonManager;
if (((0, v.X)(e, "No WebLogonManager in WebConnectionTroubleOverlay"), !e)) return null;
let t = null,
n = e.web_logon_state,
i = !r.Ul.NotificationManager.BNotificationsPermitted() && this.state.bShouldRequestNotificationPermission;
if (9 != n || i) {
let o,
a = "",
s = !1,
l = !1;
if (9 != n)
if (r.Ul.ready_to_render || this.state.bShowStartupDelayMessage || !e.BIsInInitialConnect())
switch (n) {
case 1:
case 3:
(o = (0, R.Xx)("#ConnectionTrouble_Connecting")), (l = !0);
break;
case 5:
case 7:
(o = (0, R.Xx)("#ConnectionTrouble_LoggingIn")), (l = !0);
break;
case 11:
(o = (0, R.Xx)("#ConnectionTrouble_RetrievingLogin")), (l = !0);
break;
case 2:
case 4:
case 12:
o = (0, R.Xx)("#ConnectionTrouble_FailedToConnect");
break;
case 8:
case 6:
o = (0, R.Xx)("#ConnectionTrouble_FailedToLogIn");
break;
case 10:
o = (0, R.Xx)("#ConnectionTrouble_DisconnectedFinal");
break;
case 13:
(o = (0, R.Xx)("#ConnectionTrouble_LoginLost")), (s = !0);
break;
case 14:
(o = (0, R.Xx)("#ConnectionTrouble_LoginChanged")), (s = !0);
break;
case 15:
o = (0, R.Xx)("#ConnectionTrouble_LoggedOnElsewhere");
break;
default:
(0, v.X)(!1, `No message for trouble state ${n}`);
}
else a = "InitialConnect";
else
i &&
(this.m_bRequestingNotificationPermission ||
(r.Ul.NotificationManager.RequestNotificationPermission().then(() => {
(this.m_bRequestingNotificationPermission = !1), this.setState({ bShouldRequestNotificationPermission: !1 });
}),
(this.m_bRequestingNotificationPermission = !0)),
(a = "NotificationBrowserWarning"),
(o = (0, R.Xx)("#NotificationBrowserWarning")));
let c = e.BIsWaitingToReconnect(),
m = e.BWillAutoReconnect();
!this.state.bShowReconnectWaitMessage && m && this.StartReconnectUpdateInterval(),
(!o && r.Ul.ready_to_render) ||
(t = d.createElement(
Ce.Z,
{ classNames: "modalbg-anim", timeout: 300 },
d.createElement(
"div",
{ className: "ConnectionTrouble WebConnectionTrouble" + (r.Ul.ready_to_render ? "" : " NotReadyToRender") },
d.createElement("div", { className: "" + a }),
d.createElement(
"div",
{ className: "ConnectionTroubleContent" },
d.createElement(
"div",
{ className: "ConnectionTroubleMessage " + a },
d.createElement("div", { className: "errorMessageContainer" }, d.createElement("div", { className: "connectionThrobber" + (l ? " showThrobber" : "") }, l && d.createElement(N.V, { size: "small" }), " "), d.createElement("div", null, r.Ul.ready_to_render ? o : (0, R.Xx)("#ConnectionTrouble_Connecting"))),
c && m && d.createElement("div", { className: "ReconnectWaitMessage" }, (0, R.kb)("#ConnectionTrouble_ReconnectingInSeconds", Math.ceil(e.GetMSUntilNextReconnectAttempt() / 1e3))),
c && d.createElement("div", { className: "ConnectionTroubleReconnectMessage" }, d.createElement("div", { className: "ReconnectNow" }, d.createElement("button", { type: "button", className: "DialogButton Primary", onClick: this.OnReconnectNowClick }, (0, R.Xx)("#ConnectionTrouble_ReconnectNow")))),
s && d.createElement("div", { className: "ConnectionTroubleReconnectMessage" }, d.createElement("div", { className: "ReconnectNow" }, d.createElement("button", { type: "button", className: "DialogButton Primary", onClick: this.OnLoginClick }, (0, R.Xx)(14 != n ? "#ConnectionTrouble_LoginAgain" : "#ConnectionTrouble_LoginChanged_Reload")))),
),
),
),
));
}
return d.createElement(fe.Z, null, t);
}
};
(0, i.gn)([D.ak], ht.prototype, "IntervalUpdateReconnectWaitStatus", null), (0, i.gn)([D.ak], ht.prototype, "OnReconnectNowClick", null), (0, i.gn)([D.ak], ht.prototype, "OnLoginClick", null), (ht = (0, i.gn)([h.Pi], ht));
},
14341: (e, t, n) => {
"use strict";
n.d(t, { VK: () => c.VK, b8: () => _, mO: () => p, ns: () => h, tS: () => g });
var i = n(85556),
o = n(37234),
r = n(24780),
a = n(50649),
s = n(27378),
l = n(5997),
c = n(37091);
function m(e) {
return "currentTarget" in e ? e.currentTarget.ownerDocument.defaultView : e;
}
function d(e) {
if ("undefined" != typeof SteamClient && void 0 !== SteamClient.SharedConnection) {
return (0, o.rb)(m(e)).m_unPID;
}
return 0;
}
function h(e) {
let { bUseLinkFilter: t, href: n, bForceExternal: i } = e;
return t && n && ((n = (0, l.d)(n)), (i = !0)), s.createElement(c.ns, Object.assign({}, e, { href: n, bForceExternal: i, bUseLinkFilter: !1, getPIDFromEvent: d, onContextMenu: u }));
}
function u(e) {
let t = (0, o.Um)(null, e);
return (0, c.k0)(e, t.m_unPID);
}
function p(e, t) {
let n = (0, o.Um)(null, e);
return (0, c.mO)(e, t, n.m_unPID);
}
function _(e, t, n = !1) {
let i = { bForceExternal: n, unPID: d(e) };
return (0, c.b8)(m(e), t, i);
}
let g = class extends s.Component {
render() {
return s.createElement(s.Fragment, null, (0, r.y)(this.props.rtime, { bTimeOnly: this.props.bTimeOnly, bIncludeSeconds: this.props.bIncludeSeconds }));
}
};
g = (0, i.gn)([a.Pi], g);
},
92883: (e, t, n) => {
"use strict";
n.d(t, { AZ: () => u, Ao: () => _, So: () => h, YO: () => m, fb: () => r, jr: () => l, p8: () => g, xU: () => a });
var i = n(27378),
o = n(93635);
class r extends i.Component {
GetArgument(e, t = !1) {
return !e || (t && void 0 === this.props.args[e]) ? this.props.args[""] : this.props.args[e];
}
}
class a extends i.PureComponent {
constructor(e) {
super(e), (this.state = { failedToRender: !1 });
}
componentDidCatch(e, t) {
this.setState({ failedToRender: !0 });
}
render() {
if (this.state.failedToRender) return this.props.bbcode;
{
let e = this.props.bbcode;
return !0 !== this.props.bSkipTrimInput && (e = e.trim()), this.props.parser.ParseBBCode(e, this.props.context);
}
}
}
function s(e, t, n = 0) {
if (2 == t.type) {
let e = t.text.indexOf("="),
n = t.text.indexOf(" ");
if ((-1 != n && (-1 == e || n < e) && (e = n), e > 0)) {
t.tag = t.text.substr(0, e);
let n = t.text.substr(e);
t.args = (function (e) {
if (!e || e.length < 1) return {};
let t = {},
n = "",
i = "",
r = 0,
a = 0;
"=" == e[0] && (r = 2);
let s = !1;
for (a++; a < e.length; a++) {
let l = e[a],
c = !0,
m = !1;
switch (r) {
case 0:
if ("=" == l) return {};
if (" " == l) continue;
r = 1;
break;
case 1:
("=" != l && " " != l) || s || ((r = " " == l ? 0 : 2), (c = !1));
break;
case 2:
" " == l ? ((r = 0), (c = !1), (m = !0)) : '"' == l ? ((r = 4), (c = !1)) : (r = 3);
break;
case 3:
case 4:
((" " == l && 4 != r && !s) || ('"' == l && 4 == r && !s)) && ((r = 0), (c = !1), (m = !0));
}
c && ("\\" != l || s ? ((s = !1), 1 == r ? (n += l) : 3 == r || 4 == r ? (i += l) : (0, o.X)(!1, "Not expecting to accumulate buffer in state %u", r)) : (s = !0)), m && ((t[n] = i), (n = ""), (i = ""));
}
0 != r && (t[n] = i);
return t;
})(n);
} else (t.args = {}), (t.tag = t.text);
}
e.push(t);
let i = new p();
return (i.type = n), i;
}
function l(e) {
let t = [],
n = new p(),
i = !1,
o = !1;
for (let r = 0; r < e.length; r++) {
let a = e[r];
switch (n.type) {
case 0:
"[" == a ? ((n.type = 2), (o = !0)) : ((n.type = 1), "\\" == a ? (i = !i) : (n.text += a));
break;
case 2:
case 3:
"/" == a && o ? ((n.type = 3), (n.text = ""), (o = !1)) : "[" != a || i ? ("]" != a || i ? ("\\" == a ? ((n.text += a), (i = !i), (o = !1)) : ((n.text += a), (i = !1), (o = !1))) : (o && n.ConvertMalformedNodeToText(), (n = s(t, n)), (o = !1))) : (n.ConvertMalformedNodeToText(), (n = s(t, n, 2)), (o = !0));
break;
case 1:
"[" != a || i ? ("\\" == a ? (i && (n.text += a), (i = !i)) : ((n.text += a), (i = !1))) : ((n = s(t, n, 2)), (o = !0));
}
}
return 0 != n.type && ((2 != n.type && 3 != n.type) || n.ConvertMalformedNodeToText(), t.push(n)), t;
}
class c {
constructor(e) {
this.m_dictComponents = e;
}
dictComponents() {
return this.m_dictComponents;
}
}
class m extends c {
constructor(e) {
super(e);
}
ParseBBCode(e, t) {
let n = l(e);
return this.Parse_NotificationHandlers(n, t);
}
Parse_NotificationHandlers(e, t) {
let n,
i,
o = this.dictComponents(),
r = "";
for (let t of e)
if (2 == t.type) n || (n = []), n.push(t);
else if (3 == t.type) {
const e = n && n.pop();
0 === n.length && e && e.tag == t.text && o[e.tag] && (i = e);
} else 1 == t.type && (r += t.text);
if (i) return o[i.tag]({ context: t, tagname: i.tag, args: i.args, text: r });
}
}
class d {
constructor() {
this.m_rctElements = [];
}
AppendText(e, t, n) {
e.length && (t ? this.m_rctElements.push(i.createElement("span", { "data-copytext": "", "data-copystyle": "merge-adjacent", "bbcode-text": e }, e)) : this.m_rctElements.push(e));
}
AppendNode(e, t) {
this.m_rctElements.push(e);
}
GetElements(e) {
return this.m_rctElements;
}
}
class h extends d {
AppendText(e, t, n) {
let o = e,
r = [];
for (let e = o.indexOf("\n"); -1 !== e; e = o.indexOf("\n")) r.push(o.substr(0, e)), r.push(i.createElement("br")), (o = o.substr(e + 1));
o.length && r.push(o), t ? this.m_rctElements.push(i.createElement("span", { "data-copytext": "", "data-copystyle": "merge-adjacent", "bbcode-text": e }, ...r)) : this.m_rctElements.push(e);
}
}
class u extends c {
constructor(e, t = d) {
super(e), (this.m_accumulatorType = t);
}
ParseBBCode(e, t) {
if (e.startsWith("[pre]")) return i.createElement(this.dictComponents().pre, null, g(e));
if (e.startsWith("[code]")) return i.createElement(this.dictComponents().code, null, g(e));
let n = l(e);
return this.Parse_BuildReactComponents(n, t);
}
Parse_BuildReactComponents(e, t) {
let n,
o = new this.m_accumulatorType(),
r = this.dictComponents();
for (
e.forEach((e, a) => {
if (1 == e.type) o.AppendText(e.text, !n || 0 == n.length, t);
else if (2 == e.type) n || (n = []), n.push({ accumulator: o, node: e }), (o = new this.m_accumulatorType());
else if (3 == e.type) {
let s = n && n.pop();
if (s && s.node.tag === e.text && r.hasOwnProperty(s.node.tag) && r[s.node.tag]) {
const l = r[s.node.tag],
c = n.map((e) => e.node.tag),
m = { context: t, parentTags: c, tagname: s.node.tag, args: s.node.args, key: `${e.tag}_${a}` },
d = i.createElement(l, m, ...o.GetElements(e));
(o = s.accumulator), o.AppendNode(d, e);
} else if (s) {
let n = s.accumulator;
n.AppendText("[" + s.node.text + "]", !1, t), o.GetElements(e).forEach((e) => n.AppendNode(e)), n.AppendText("[/" + e.text + "]", !1, t), (o = n);
}
}
});
n && n.length;
) {
let e = n.pop(),
i = e.accumulator;
i.AppendText("[" + e.node.text + "]", !1, t), o.GetElements().forEach((e) => i.AppendNode(e)), (o = i);
}
let a = o.GetElements();
return a.length > 1 ? i.createElement(i.Fragment, null, ...a) : 1 == a.length ? a[0] : null;
}
}
class p {
constructor() {
(this.type = 0), (this.text = "");
}
ConvertMalformedNodeToText() {
3 == this.type ? (this.text = "[/" + this.text) : 2 == this.type && (this.text = "[" + this.text), (this.type = 1);
}
}
function _(e) {
return e.replace(/[\[\\]/g, "\\$&");
}
function g(e) {
let t = "",
n = l(e.trim());
for (let e of n) 1 == e.type && (t += e.text);
return t;
}
},
24780: (e, t, n) => {
"use strict";
n.d(t, { y: () => s });
var i = n(72746),
o = n(84290);
let r = { TimeOfDay: new Intl.DateTimeFormat(o.Yt.GetPreferredLocales(), { hour: "numeric", minute: "numeric" }), TimeOfDayWithSecs: new Intl.DateTimeFormat(o.Yt.GetPreferredLocales(), { hour: "numeric", minute: "numeric", second: "numeric" }), TimeInWeek: Intl.DateTimeFormat(o.Yt.GetPreferredLocales(), { weekday: "long", hour: "numeric", minute: "numeric" }), FullTimestamp: Intl.DateTimeFormat(o.Yt.GetPreferredLocales(), { weekday: "long", year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric" }), FullTimestampNoWeekday: Intl.DateTimeFormat(o.Yt.GetPreferredLocales(), { year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric" }) },
a = { TimeOfDay: new Intl.DateTimeFormat(o.Yt.GetPreferredLocales(), { hour: "numeric", minute: "numeric", hourCycle: "h23" }), TimeOfDayWithSecs: new Intl.DateTimeFormat(o.Yt.GetPreferredLocales(), { hour: "numeric", minute: "numeric", second: "numeric", hourCycle: "h23" }), TimeInWeek: Intl.DateTimeFormat(o.Yt.GetPreferredLocales(), { weekday: "long", hour: "numeric", minute: "numeric", hourCycle: "h23" }), FullTimestamp: Intl.DateTimeFormat(o.Yt.GetPreferredLocales(), { weekday: "long", year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", hourCycle: "h23" }), FullTimestampNoWeekday: Intl.DateTimeFormat(o.Yt.GetPreferredLocales(), { year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", hourCycle: "h23" }) };
function s(e, t) {
null == t.bIncludeWeekday && (t.bIncludeWeekday = !0), null == t.bRelativeDate && (t.bRelativeDate = !0);
let n,
s = i.Ul.RTime32ToDate(e),
l = i.Ul.GetLocalMidnightInRTime32(),
c = 86400,
m = i.Ul.SettingsStore.FriendsSettings.b24HourClock ? a : r,
d = t.Format;
null == d && (d = t.bTimeOnly || e >= l - c ? (t.bIncludeSeconds ? m.TimeOfDayWithSecs : m.TimeOfDay) : t.bRelativeDate && e >= l - 432e3 ? m.TimeInWeek : t.bIncludeWeekday ? m.FullTimestamp : m.FullTimestampNoWeekday);
try {
n = d.format(s);
} catch (e) {
n = (0, o.Xx)("#ChatRoom_Timestamp_InvalidDate");
}
return !t.bTimeOnly && t.bRelativeDate && e >= l - c && e < l && (n = (0, o.Xx)("#ChatRoom_Timestamp_Yesterday", n)), n;
}
},
11612: (e, t, n) => {
"use strict";
var i;
function o(e) {
return e === i.k_ESteamRealmChina;
}
n.d(t, { IN: () => i, e7: () => o }),
(function (e) {
(e[(e.k_ESteamRealmUnknown = 0)] = "k_ESteamRealmUnknown"), (e[(e.k_ESteamRealmGlobal = 1)] = "k_ESteamRealmGlobal"), (e[(e.k_ESteamRealmChina = 2)] = "k_ESteamRealmChina");
})(i || (i = {}));
},
78654: (e, t, n) => {
"use strict";
function i(e) {
return 3 == e || 6 == e;
}
function o(e) {
return 5 == e || 6 == e;
}
n.d(t, { IF: () => N, Mq: () => m, QS: () => r, RI: () => l, YO: () => a, Z3: () => p, dt: () => C, eV: () => f, fk: () => o, g1: () => g, gg: () => k, hz: () => b, jA: () => h, jM: () => S, j_: () => v, my: () => i, p6: () => s, pv: () => c, px: () => I, r7: () => _, us: () => u, xM: () => d });
const r = 1,
a = 4,
s = 7,
l = 750,
c = 799,
m = 250820,
d = 330050,
h = 358510,
u = 366490;
const p = "18446744073709551615",
_ = 0,
g = 2147483647;
function C(e, t = "en") {
switch (e) {
case 0:
return "en";
case 1:
return "de";
case 2:
return "fr";
case 3:
return "it";
case 4:
return "ko";
case 5:
return "es";
case 6:
return "zh-cn";
case 7:
return "zh-tw";
case 8:
return "ru";
case 9:
return "th";
case 10:
return "ja";
case 11:
return "pt";
case 12:
return "pl";
case 13:
return "da";
case 14:
return "nl";
case 15:
return "fi";
case 16:
return "no";
case 17:
return "sv";
case 18:
return "hu";
case 19:
return "cs";
case 20:
return "ro";
case 21:
return "tr";
case 25:
return "ar";
case 22:
return "pt-br";
case 23:
return "bg";
case 24:
return "el";
case 26:
return "uk";
case 27:
return "es-419";
case 28:
return "vi";
case 29:
return "sc-sc";
case 30:
return "id";
default:
return t;
}
}
const f = (e) => ("koreana" === e ? "korean" : e);
function v(e, t = "") {
switch (e) {
case 0:
return "english";
case 1:
return "german";
case 2:
return "french";
case 3:
return "italian";
case 4:
return "koreana";
case 5:
return "spanish";
case 6:
return "schinese";
case 7:
return "tchinese";
case 8:
return "russian";
case 9:
return "thai";
case 10:
return "japanese";
case 11:
return "portuguese";
case 12:
return "polish";
case 13:
return "danish";
case 14:
return "dutch";
case 15:
return "finnish";
case 16:
return "norwegian";
case 17:
return "swedish";
case 18:
return "hungarian";
case 19:
return "czech";
case 20:
return "romanian";
case 21:
return "turkish";
case 25:
return "arabic";
case 22:
return "brazilian";
case 23:
return "bulgarian";
case 24:
return "greek";
case 26:
return "ukrainian";
case 27:
return "latam";
case 28:
return "vietnamese";
case 29:
return "sc_schinese";
case 30:
return "indonesian";
default:
return t;
}
}
function S(e, t = 0) {
switch (e) {
case "english":
return 0;
case "german":
return 1;
case "french":
return 2;
case "italian":
return 3;
case "korean":
case "koreana":
return 4;
case "spanish":
return 5;
case "schinese":
return 6;
case "tchinese":
return 7;
case "russian":
return 8;
case "thai":
return 9;
case "japanese":
return 10;
case "portuguese":
return 11;
case "polish":
return 12;
case "danish":
return 13;
case "dutch":
return 14;
case "finnish":
return 15;
case "norwegian":
return 16;
case "swedish":
return 17;
case "hungarian":
return 18;
case "czech":
return 19;
case "romanian":
return 20;
case "turkish":
return 21;
case "arabic":
return 25;
case "brazilian":
return 22;
case "bulgarian":
return 23;
case "greek":
return 24;
case "ukrainian":
return 26;
case "latam":
return 27;
case "vietnamese":
return 28;
case "sc_schinese":
return 29;
case "indonesian":
return 30;
default:
return t;
}
}
function b(e) {
switch (e) {
default:
break;
case 4:
case 1:
case 7:
case 8:
return !0;
}
return !1;
}
function I(e) {
switch (e) {
default:
break;
case 4:
case 1:
case 8:
return !0;
}
return !1;
}
var y, E, D, w, R, A, M, k, T, L, G, O, F, B, x, N;
!(function (e) {
(e[(e.k_EConnectivityTestResult_Unknown = 0)] = "k_EConnectivityTestResult_Unknown"), (e[(e.k_EConnectivityTestResult_Connected = 1)] = "k_EConnectivityTestResult_Connected"), (e[(e.k_EConnectivityTestResult_CaptivePortal = 2)] = "k_EConnectivityTestResult_CaptivePortal"), (e[(e.k_EConnectivityTestResult_TimedOut = 3)] = "k_EConnectivityTestResult_TimedOut"), (e[(e.k_EConnectivityTestResult_Failed = 4)] = "k_EConnectivityTestResult_Failed"), (e[(e.k_EConnectivityTestResult_WifiDisabled = 5)] = "k_EConnectivityTestResult_WifiDisabled"), (e[(e.k_EConnectivityTestResult_NoLAN = 6)] = "k_EConnectivityTestResult_NoLAN");
})(y || (y = {})),
(function (e) {
(e[(e.k_ENetFakeLocalSystemState_Normal = 0)] = "k_ENetFakeLocalSystemState_Normal"), (e[(e.k_ENetFakeLocalSystemState_NoLAN = 1)] = "k_ENetFakeLocalSystemState_NoLAN"), (e[(e.k_ENetFakeLocalSystemState_CaptivePortal_Redirected = 2)] = "k_ENetFakeLocalSystemState_CaptivePortal_Redirected"), (e[(e.k_ENetFakeLocalSystemState_CaptivePortal_InPlace = 3)] = "k_ENetFakeLocalSystemState_CaptivePortal_InPlace"), (e[(e.k_ENetFakeLocalSystemState_NoInternet = 4)] = "k_ENetFakeLocalSystemState_NoInternet"), (e[(e.k_ENetFakeLocalSystemState_NoSteam = 5)] = "k_ENetFakeLocalSystemState_NoSteam");
})(E || (E = {})),
(function (e) {
(e[(e.k_ESuspendResumeProgressState_Invalid = 0)] = "k_ESuspendResumeProgressState_Invalid"), (e[(e.k_ESuspendResumeProgressState_Complete = 1)] = "k_ESuspendResumeProgressState_Complete"), (e[(e.k_ESuspendResumeProgressState_CloudSync = 2)] = "k_ESuspendResumeProgressState_CloudSync"), (e[(e.k_ESuspendResumeProgressState_LoggingIn = 3)] = "k_ESuspendResumeProgressState_LoggingIn"), (e[(e.k_ESuspendResumeProgressState_WaitingForApp = 4)] = "k_ESuspendResumeProgressState_WaitingForApp"), (e[(e.k_ESuspendResumeProgressState_Working = 5)] = "k_ESuspendResumeProgressState_Working");
})(D || (D = {})),
(function (e) {
(e[(e.k_EFloatingGamepadTextInputModeModeSingleLine = 0)] = "k_EFloatingGamepadTextInputModeModeSingleLine"), (e[(e.k_EFloatingGamepadTextInputModeModeMultipleLines = 1)] = "k_EFloatingGamepadTextInputModeModeMultipleLines"), (e[(e.k_EFloatingGamepadTextInputModeModeEmail = 2)] = "k_EFloatingGamepadTextInputModeModeEmail"), (e[(e.k_EFloatingGamepadTextInputModeModeNumeric = 3)] = "k_EFloatingGamepadTextInputModeModeNumeric");
})(w || (w = {})),
(function (e) {
(e[(e.k_EAppUpdateContentType_Content = 0)] = "k_EAppUpdateContentType_Content"), (e[(e.k_EAppUpdateContentType_Workshop = 1)] = "k_EAppUpdateContentType_Workshop"), (e[(e.k_EAppUpdateContentType_Shader = 2)] = "k_EAppUpdateContentType_Shader"), (e[(e.k_EAppUpdateContentType_Max = 3)] = "k_EAppUpdateContentType_Max");
})(R || (R = {})),
(function (e) {
(e[(e.k_EOverlayToStoreFlag_None = 0)] = "k_EOverlayToStoreFlag_None"), (e[(e.k_EOverlayToStoreFlag_AddToCart = 1)] = "k_EOverlayToStoreFlag_AddToCart"), (e[(e.k_EOverlayToStoreFlag_AddToCartAndShow = 2)] = "k_EOverlayToStoreFlag_AddToCartAndShow");
})(A || (A = {})),
(function (e) {
(e[(e.k_EActivateGameOverlayToWebPageMode_Default = 0)] = "k_EActivateGameOverlayToWebPageMode_Default"), (e[(e.k_EActivateGameOverlayToWebPageMode_Modal = 1)] = "k_EActivateGameOverlayToWebPageMode_Modal");
})(M || (M = {})),
(function (e) {
(e[(e.k_EGamingDeviceType_Unknown = 0)] = "k_EGamingDeviceType_Unknown"), (e[(e.k_EGamingDeviceType_StandardPC = 1)] = "k_EGamingDeviceType_StandardPC"), (e[(e.k_EGamingDeviceType_Console = 256)] = "k_EGamingDeviceType_Console"), (e[(e.k_EGamingDeviceType_PS3 = 272)] = "k_EGamingDeviceType_PS3"), (e[(e.k_EGamingDeviceType_Steambox = 288)] = "k_EGamingDeviceType_Steambox"), (e[(e.k_EGamingDeviceType_Handheld = 512)] = "k_EGamingDeviceType_Handheld"), (e[(e.k_EGamingDeviceType_Phone = 528)] = "k_EGamingDeviceType_Phone"), (e[(e.k_EGamingDeviceType_SteamDeck = 544)] = "k_EGamingDeviceType_SteamDeck");
})(k || (k = {})),
(function (e) {
(e[(e.k_ELoginUIStyleOld = 0)] = "k_ELoginUIStyleOld"), (e[(e.k_ELoginUIStyleNewWithoutQRCode = 1)] = "k_ELoginUIStyleNewWithoutQRCode"), (e[(e.k_ELoginUIStyleNew = 2)] = "k_ELoginUIStyleNew");
})(T || (T = {})),
(function (e) {
(e[(e.k_ECommunityProfileItemProperty_ImageSmall = 0)] = "k_ECommunityProfileItemProperty_ImageSmall"),
(e[(e.k_ECommunityProfileItemProperty_ImageLarge = 1)] = "k_ECommunityProfileItemProperty_ImageLarge"),
(e[(e.k_ECommunityProfileItemProperty_InternalName = 2)] = "k_ECommunityProfileItemProperty_InternalName"),
(e[(e.k_ECommunityProfileItemProperty_Title = 3)] = "k_ECommunityProfileItemProperty_Title"),
(e[(e.k_ECommunityProfileItemProperty_Description = 4)] = "k_ECommunityProfileItemProperty_Description"),
(e[(e.k_ECommunityProfileItemProperty_AppID = 5)] = "k_ECommunityProfileItemProperty_AppID"),
(e[(e.k_ECommunityProfileItemProperty_TypeID = 6)] = "k_ECommunityProfileItemProperty_TypeID"),
(e[(e.k_ECommunityProfileItemProperty_Class = 7)] = "k_ECommunityProfileItemProperty_Class"),
(e[(e.k_ECommunityProfileItemProperty_MovieWebM = 8)] = "k_ECommunityProfileItemProperty_MovieWebM"),
(e[(e.k_ECommunityProfileItemProperty_MovieMP4 = 9)] = "k_ECommunityProfileItemProperty_MovieMP4"),
(e[(e.k_ECommunityProfileItemProperty_MovieWebMSmall = 10)] = "k_ECommunityProfileItemProperty_MovieWebMSmall"),
(e[(e.k_ECommunityProfileItemProperty_MovieMP4Small = 11)] = "k_ECommunityProfileItemProperty_MovieMP4Small");
})(L || (L = {})),
(function (e) {
(e[(e.k_ERaiseGameWindowResult_NotRunning = 1)] = "k_ERaiseGameWindowResult_NotRunning"), (e[(e.k_ERaiseGameWindowResult_Success = 2)] = "k_ERaiseGameWindowResult_Success"), (e[(e.k_ERaiseGameWindowResult_Failure = 3)] = "k_ERaiseGameWindowResult_Failure");
})(G || (G = {})),
(function (e) {
(e[(e.k_EPositionInvalid = -1)] = "k_EPositionInvalid"), (e[(e.k_EPositionTopLeft = 0)] = "k_EPositionTopLeft"), (e[(e.k_EPositionTopRight = 1)] = "k_EPositionTopRight"), (e[(e.k_EPositionBottomLeft = 2)] = "k_EPositionBottomLeft"), (e[(e.k_EPositionBottomRight = 3)] = "k_EPositionBottomRight");
})(O || (O = {})),
(function (e) {
(e[(e.k_EAppReleaseState_Unknown = 0)] = "k_EAppReleaseState_Unknown"), (e[(e.k_EAppReleaseState_Unavailable = 1)] = "k_EAppReleaseState_Unavailable"), (e[(e.k_EAppReleaseState_Prerelease = 2)] = "k_EAppReleaseState_Prerelease"), (e[(e.k_EAppReleaseState_PreloadOnly = 3)] = "k_EAppReleaseState_PreloadOnly"), (e[(e.k_EAppReleaseState_Released = 4)] = "k_EAppReleaseState_Released"), (e[(e.k_EAppReleaseState_Disabled = 5)] = "k_EAppReleaseState_Disabled");
})(F || (F = {})),
(function (e) {
(e[(e.k_EGameIDTypeApp = 0)] = "k_EGameIDTypeApp"), (e[(e.k_EGameIDTypeGameMod = 1)] = "k_EGameIDTypeGameMod"), (e[(e.k_EGameIDTypeShortcut = 2)] = "k_EGameIDTypeShortcut"), (e[(e.k_EGameIDTypeP2P = 3)] = "k_EGameIDTypeP2P");
})(B || (B = {})),
(function (e) {
(e[(e.k_EInstallMgrStateNone = 0)] = "k_EInstallMgrStateNone"),
(e[(e.k_EInstallMgrStateSetup = 1)] = "k_EInstallMgrStateSetup"),
(e[(e.k_EInstallMgrStateWaitLicense = 2)] = "k_EInstallMgrStateWaitLicense"),
(e[(e.k_EInstallMgrStateFreeLicense = 3)] = "k_EInstallMgrStateFreeLicense"),
(e[(e.k_EInstallMgrStateShowCDKey = 4)] = "k_EInstallMgrStateShowCDKey"),
(e[(e.k_EInstallMgrStateWaitAppInfo = 5)] = "k_EInstallMgrStateWaitAppInfo"),
(e[(e.k_EInstallMgrStateShowPassword = 6)] = "k_EInstallMgrStateShowPassword"),
(e[(e.k_EInstallMgrStateShowConfig = 7)] = "k_EInstallMgrStateShowConfig"),
(e[(e.k_EInstallMgrStateShowEULAs = 8)] = "k_EInstallMgrStateShowEULAs"),
(e[(e.k_EInstallMgrStateCreateApps = 9)] = "k_EInstallMgrStateCreateApps"),
(e[(e.k_EInstallMgrStateReadFromMedia = 10)] = "k_EInstallMgrStateReadFromMedia"),
(e[(e.k_EInstallMgrStateShowChangeMedia = 11)] = "k_EInstallMgrStateShowChangeMedia"),
(e[(e.k_EInstallMgrStateWaitLegacyCDKeys = 12)] = "k_EInstallMgrStateWaitLegacyCDKeys"),
(e[(e.k_EInstallMgrStateShowSignup = 13)] = "k_EInstallMgrStateShowSignup"),
(e[(e.k_EInstallMgrStateComplete = 14)] = "k_EInstallMgrStateComplete"),
(e[(e.k_EInstallMgrStateFailed = 15)] = "k_EInstallMgrStateFailed"),
(e[(e.k_EInstallMgrStateCanceled = 16)] = "k_EInstallMgrStateCanceled");
})(x || (x = {})),
(function (e) {
(e[(e.k_EWindowBringToFrontInvalid = 0)] = "k_EWindowBringToFrontInvalid"), (e[(e.k_EWindowBringToFrontAndForceOS = 1)] = "k_EWindowBringToFrontAndForceOS"), (e[(e.k_EWindowBringToFrontWithoutForcingOS = 2)] = "k_EWindowBringToFrontWithoutForcingOS");
})(N || (N = {}));
},
34294: (e, t, n) => {
"use strict";
n.d(t, { Su: () => s, Xg: () => o, i_: () => i });
var i, o, r, a;
function s(e) {
return e == i.EBrowserType_OpenVROverlay || e == i.EBrowserType_OpenVROverlay_Dashboard || e == i.EBrowserType_OpenVROverlay_Subview;
}
!(function (e) {
(e[(e.EBrowserType_OffScreen = 0)] = "EBrowserType_OffScreen"),
(e[(e.EBrowserType_OpenVROverlay = 1)] = "EBrowserType_OpenVROverlay"),
(e[(e.EBrowserType_OpenVROverlay_Dashboard = 2)] = "EBrowserType_OpenVROverlay_Dashboard"),
(e[(e.EBrowserType_DirectHWND = 3)] = "EBrowserType_DirectHWND"),
(e[(e.EBrowserType_DirectHWND_Borderless = 4)] = "EBrowserType_DirectHWND_Borderless"),
(e[(e.EBrowserType_DirectHWND_Hidden = 5)] = "EBrowserType_DirectHWND_Hidden"),
(e[(e.EBrowserType_ChildHWNDNative = 6)] = "EBrowserType_ChildHWNDNative"),
(e[(e.EBrowserType_Transparent_Toplevel = 7)] = "EBrowserType_Transparent_Toplevel"),
(e[(e.EBrowserType_OffScreen_SharedTexture = 8)] = "EBrowserType_OffScreen_SharedTexture"),
(e[(e.EBrowserType_OffScreen_GameOverlay = 9)] = "EBrowserType_OffScreen_GameOverlay"),
(e[(e.EBrowserType_OffScreen_GameOverlay_SharedTexture = 10)] = "EBrowserType_OffScreen_GameOverlay_SharedTexture"),
(e[(e.EBrowserType_Offscreen_FriendsUI = 11)] = "EBrowserType_Offscreen_FriendsUI"),
(e[(e.EBrowserType_Offscreen_SteamUI = 12)] = "EBrowserType_Offscreen_SteamUI"),
(e[(e.EBrowserType_OpenVROverlay_Subview = 13)] = "EBrowserType_OpenVROverlay_Subview");
})(i || (i = {})),
(function (e) {
(e[(e.SystemKey0 = 0)] = "SystemKey0"), (e[(e.SystemKey1 = 1)] = "SystemKey1");
})(o || (o = {})),
(function (e) {
(e[(e.Hidden = 0)] = "Hidden"), (e[(e.Notification = 1)] = "Notification"), (e[(e.Overlay = 2)] = "Overlay"), (e[(e.Opaque = 3)] = "Opaque"), (e[(e.OverlayKeyboard = 4)] = "OverlayKeyboard");
})(r || (r = {})),
(function (e) {
(e[(e.MainGamepadUI = 0)] = "MainGamepadUI"), (e[(e.OverlayGamepadUI = 1)] = "OverlayGamepadUI"), (e[(e.Keyboard = 2)] = "Keyboard"), (e[(e.ControllerConfigurator = 3)] = "ControllerConfigurator"), (e[(e.VR = 4)] = "VR"), (e[(e.MainDesktopUI = 5)] = "MainDesktopUI"), (e[(e.DesktopLogin = 6)] = "DesktopLogin"), (e[(e.OverlayDesktopUI = 7)] = "OverlayDesktopUI"), (e[(e.SteamChinaReviewLauncher = 8)] = "SteamChinaReviewLauncher");
})(a || (a = {}));
},
49367: (e, t, n) => {
"use strict";
n.d(t, { c$: () => o, m$: () => i });
const i = { broadcastid: "0", nViewers: 0, nRequests: 0, bIsBroadcasting: !1, bIsRecordingDesktop: !1, bBroadcastCapable: !1 };
var o;
!(function (e) {
(e[(e.k_EPending = 0)] = "k_EPending"), (e[(e.k_EAccepted = 1)] = "k_EAccepted"), (e[(e.k_ERejected = 2)] = "k_ERejected");
})(o || (o = {}));
},
54054: (e, t, n) => {
"use strict";
var i;
n.d(t, { u: () => i }),
(function (e) {
(e[(e.k_ERemoteClientLaunchOK = 1)] = "k_ERemoteClientLaunchOK"),
(e[(e.k_ERemoteClientLaunchFail = 2)] = "k_ERemoteClientLaunchFail"),
(e[(e.k_ERemoteClientLaunchRequiresUI = 3)] = "k_ERemoteClientLaunchRequiresUI"),
(e[(e.k_ERemoteClientLaunchRequiresLaunchOption = 4)] = "k_ERemoteClientLaunchRequiresLaunchOption"),
(e[(e.k_ERemoteClientLaunchRequiresEULA = 5)] = "k_ERemoteClientLaunchRequiresEULA"),
(e[(e.k_ERemoteClientLaunchTimeout = 6)] = "k_ERemoteClientLaunchTimeout"),
(e[(e.k_ERemoteClientLaunchStreamTimeout = 7)] = "k_ERemoteClientLaunchStreamTimeout"),
(e[(e.k_ERemoteClientLaunchStreamClientFail = 8)] = "k_ERemoteClientLaunchStreamClientFail"),
(e[(e.k_ERemoteClientLaunchOtherGameRunning = 9)] = "k_ERemoteClientLaunchOtherGameRunning"),
(e[(e.k_ERemoteClientLaunchDownloadStarted = 10)] = "k_ERemoteClientLaunchDownloadStarted"),
(e[(e.k_ERemoteClientLaunchDownloadNoSpace = 11)] = "k_ERemoteClientLaunchDownloadNoSpace"),
(e[(e.k_ERemoteClientLaunchDownloadFiltered = 12)] = "k_ERemoteClientLaunchDownloadFiltered"),
(e[(e.k_ERemoteClientLaunchDownloadRequiresUI = 13)] = "k_ERemoteClientLaunchDownloadRequiresUI"),
(e[(e.k_ERemoteClientLaunchAccessDenied = 14)] = "k_ERemoteClientLaunchAccessDenied"),
(e[(e.k_ERemoteClientLaunchNetworkError = 15)] = "k_ERemoteClientLaunchNetworkError"),
(e[(e.k_ERemoteClientLaunchProgress = 16)] = "k_ERemoteClientLaunchProgress"),
(e[(e.k_ERemoteClientLaunchParentalUnlockFailed = 17)] = "k_ERemoteClientLaunchParentalUnlockFailed"),
(e[(e.k_ERemoteClientLaunchScreenLocked = 18)] = "k_ERemoteClientLaunchScreenLocked"),
(e[(e.k_ERemoteClientLaunchUnsupported = 19)] = "k_ERemoteClientLaunchUnsupported"),
(e[(e.k_ERemoteClientLaunchDisabledLocal = 20)] = "k_ERemoteClientLaunchDisabledLocal"),
(e[(e.k_ERemoteClientLaunchDisabledRemote = 21)] = "k_ERemoteClientLaunchDisabledRemote"),
(e[(e.k_ERemoteClientLaunchBroadcasting = 22)] = "k_ERemoteClientLaunchBroadcasting"),
(e[(e.k_ERemoteClientLaunchBusy = 23)] = "k_ERemoteClientLaunchBusy"),
(e[(e.k_ERemoteClientLaunchDriversNotInstalled = 24)] = "k_ERemoteClientLaunchDriversNotInstalled"),
(e[(e.k_ERemoteClientLaunchTransportUnavailable = 25)] = "k_ERemoteClientLaunchTransportUnavailable"),
(e[(e.k_ERemoteClientLaunchCanceled = 26)] = "k_ERemoteClientLaunchCanceled"),
(e[(e.k_ERemoteClientLaunchInvisible = 27)] = "k_ERemoteClientLaunchInvisible"),
(e[(e.k_ERemoteClientLaunchRestrictedCountry = 28)] = "k_ERemoteClientLaunchRestrictedCountry");
})(i || (i = {}));
},
53971: (e, t, n) => {
"use strict";
n.d(t, { k: () => i });
function i() {
return { bNotifications_ShowIngame: !0, bNotifications_ShowOnline: !1, bNotifications_ShowMessage: !0, bNotifications_EventsAndAnnouncements: !0, bSounds_PlayIngame: !1, bSounds_PlayOnline: !1, bSounds_PlayMessage: !0, bSounds_EventsAndAnnouncements: !1, bAlwaysNewChatWindow: !1, bForceAlphabeticFriendSorting: !1, nChatFlashMode: 0, bRememberOpenChats: !0, bCompactQuickAccess: !1, bCompactFriendsList: !1, bNotifications_ShowChatRoomNotification: !0, bSounds_PlayChatRoomNotification: !0, bHideOfflineFriendsInTagGroups: !1, bHideCategorizedFriends: !1, bCategorizeInGameFriendsByGame: !0, nChatFontSize: 2, b24HourClock: !1, bDoNotDisturbMode: !1, bDisableEmbedInlining: !1, bSignIntoFriends: !0, bDisableSpellcheck: !1, bDisableRoomEffects: !1, bAnimatedAvatars: !0, featuresEnabled: {} };
}
},
39827: (e, t, n) => {
"use strict";
var i;
n.d(t, { c4: () => o, w8: () => r }),
(function (e) {
(e[(e.k_ELaunchOptionType_None = 0)] = "k_ELaunchOptionType_None"),
(e[(e.k_ELaunchOptionType_Default = 1)] = "k_ELaunchOptionType_Default"),
(e[(e.k_ELaunchOptionType_SafeMode = 2)] = "k_ELaunchOptionType_SafeMode"),
(e[(e.k_ELaunchOptionType_Multiplayer = 3)] = "k_ELaunchOptionType_Multiplayer"),
(e[(e.k_ELaunchOptionType_Config = 4)] = "k_ELaunchOptionType_Config"),
(e[(e.k_ELaunchOptionType_OpenVR = 5)] = "k_ELaunchOptionType_OpenVR"),
(e[(e.k_ELaunchOptionType_Server = 6)] = "k_ELaunchOptionType_Server"),
(e[(e.k_ELaunchOptionType_Editor = 7)] = "k_ELaunchOptionType_Editor"),
(e[(e.k_ELaunchOptionType_Manual = 8)] = "k_ELaunchOptionType_Manual"),
(e[(e.k_ELaunchOptionType_Benchmark = 9)] = "k_ELaunchOptionType_Benchmark"),
(e[(e.k_ELaunchOptionType_Option1 = 10)] = "k_ELaunchOptionType_Option1"),
(e[(e.k_ELaunchOptionType_Option2 = 11)] = "k_ELaunchOptionType_Option2"),
(e[(e.k_ELaunchOptionType_Option3 = 12)] = "k_ELaunchOptionType_Option3"),
(e[(e.k_ELaunchOptionType_OculusVR = 13)] = "k_ELaunchOptionType_OculusVR"),
(e[(e.k_ELaunchOptionType_OpenVROverlay = 14)] = "k_ELaunchOptionType_OpenVROverlay"),
(e[(e.k_ELaunchOptionType_OSVR = 15)] = "k_ELaunchOptionType_OSVR"),
(e[(e.k_ELaunchOptionType_OpenXR = 16)] = "k_ELaunchOptionType_OpenXR"),
(e[(e.k_ELaunchOptionType_Dialog = 1e3)] = "k_ELaunchOptionType_Dialog");
})(i || (i = {}));
var o, r;
!(function (e) {
(e[(e.k_EComputerActiveStateInvalid = 0)] = "k_EComputerActiveStateInvalid"), (e[(e.k_EComputerActiveStateActive = 1)] = "k_EComputerActiveStateActive"), (e[(e.k_EComputerActiveStateIdle = 2)] = "k_EComputerActiveStateIdle");
})(o || (o = {})),
(function (e) {
(e[(e.k_EClientUsedInputTypeKeyboard = 0)] = "k_EClientUsedInputTypeKeyboard"), (e[(e.k_EClientUsedInputTypeMouse = 1)] = "k_EClientUsedInputTypeMouse"), (e[(e.k_EClientUsedInputTypeController = 2)] = "k_EClientUsedInputTypeController"), (e[(e.k_EClientUsedInputTypeMax = 3)] = "k_EClientUsedInputTypeMax");
})(r || (r = {}));
},
45193: (e, t, n) => {
"use strict";
var i, o, r, a, s, l;
n.d(t, { $6: () => s, sH: () => r, vS: () => a }),
(function (e) {
(e[(e.Invalid = 0)] = "Invalid"),
(e[(e.TrackingSystemName_String = 1e3)] = "TrackingSystemName_String"),
(e[(e.ModelNumber_String = 1001)] = "ModelNumber_String"),
(e[(e.SerialNumber_String = 1002)] = "SerialNumber_String"),
(e[(e.RenderModelName_String = 1003)] = "RenderModelName_String"),
(e[(e.WillDriftInYaw_Bool = 1004)] = "WillDriftInYaw_Bool"),
(e[(e.ManufacturerName_String = 1005)] = "ManufacturerName_String"),
(e[(e.TrackingFirmwareVersion_String = 1006)] = "TrackingFirmwareVersion_String"),
(e[(e.HardwareRevision_String = 1007)] = "HardwareRevision_String"),
(e[(e.AllWirelessDongleDescriptions_String = 1008)] = "AllWirelessDongleDescriptions_String"),
(e[(e.ConnectedWirelessDongle_String = 1009)] = "ConnectedWirelessDongle_String"),
(e[(e.DeviceIsWireless_Bool = 1010)] = "DeviceIsWireless_Bool"),
(e[(e.DeviceIsCharging_Bool = 1011)] = "DeviceIsCharging_Bool"),
(e[(e.DeviceBatteryPercentage_Float = 1012)] = "DeviceBatteryPercentage_Float"),
(e[(e.StatusDisplayTransform_Matrix34 = 1013)] = "StatusDisplayTransform_Matrix34"),
(e[(e.Firmware_UpdateAvailable_Bool = 1014)] = "Firmware_UpdateAvailable_Bool"),
(e[(e.Firmware_ManualUpdate_Bool = 1015)] = "Firmware_ManualUpdate_Bool"),
(e[(e.Firmware_ManualUpdateURL_String = 1016)] = "Firmware_ManualUpdateURL_String"),
(e[(e.HardwareRevision_Uint64 = 1017)] = "HardwareRevision_Uint64"),
(e[(e.FirmwareVersion_Uint64 = 1018)] = "FirmwareVersion_Uint64"),
(e[(e.FPGAVersion_Uint64 = 1019)] = "FPGAVersion_Uint64"),
(e[(e.VRCVersion_Uint64 = 1020)] = "VRCVersion_Uint64"),
(e[(e.RadioVersion_Uint64 = 1021)] = "RadioVersion_Uint64"),
(e[(e.DongleVersion_Uint64 = 1022)] = "DongleVersion_Uint64"),
(e[(e.BlockServerShutdown_Bool = 1023)] = "BlockServerShutdown_Bool"),
(e[(e.CanUnifyCoordinateSystemWithHmd_Bool = 1024)] = "CanUnifyCoordinateSystemWithHmd_Bool"),
(e[(e.ContainsProximitySensor_Bool = 1025)] = "ContainsProximitySensor_Bool"),
(e[(e.DeviceProvidesBatteryStatus_Bool = 1026)] = "DeviceProvidesBatteryStatus_Bool"),
(e[(e.DeviceCanPowerOff_Bool = 1027)] = "DeviceCanPowerOff_Bool"),
(e[(e.Firmware_ProgrammingTarget_String = 1028)] = "Firmware_ProgrammingTarget_String"),
(e[(e.DeviceClass_Int32 = 1029)] = "DeviceClass_Int32"),
(e[(e.HasCamera_Bool = 1030)] = "HasCamera_Bool"),
(e[(e.DriverVersion_String = 1031)] = "DriverVersion_String"),
(e[(e.Firmware_ForceUpdateRequired_Bool = 1032)] = "Firmware_ForceUpdateRequired_Bool"),
(e[(e.ViveSystemButtonFixRequired_Bool = 1033)] = "ViveSystemButtonFixRequired_Bool"),
(e[(e.ParentDriver_Uint64 = 1034)] = "ParentDriver_Uint64"),
(e[(e.ResourceRoot_String = 1035)] = "ResourceRoot_String"),
(e[(e.RegisteredDeviceType_String = 1036)] = "RegisteredDeviceType_String"),
(e[(e.InputProfilePath_String = 1037)] = "InputProfilePath_String"),
(e[(e.NeverTracked_Bool = 1038)] = "NeverTracked_Bool"),
(e[(e.NumCameras_Int32 = 1039)] = "NumCameras_Int32"),
(e[(e.CameraFrameLayout_Int32 = 1040)] = "CameraFrameLayout_Int32"),
(e[(e.CameraStreamFormat_Int32 = 1041)] = "CameraStreamFormat_Int32"),
(e[(e.AdditionalDeviceSettingsPath_String = 1042)] = "AdditionalDeviceSettingsPath_String"),
(e[(e.DevicePowerUsage_Float = 1052)] = "DevicePowerUsage_Float"),
(e[(e.ActualTrackingSystemName_String = 1054)] = "ActualTrackingSystemName_String"),
(e[(e.ReportsTimeSinceVSync_Bool = 2e3)] = "ReportsTimeSinceVSync_Bool"),
(e[(e.SecondsFromVsyncToPhotons_Float = 2001)] = "SecondsFromVsyncToPhotons_Float"),
(e[(e.DisplayFrequency_Float = 2002)] = "DisplayFrequency_Float"),
(e[(e.UserIpdMeters_Float = 2003)] = "UserIpdMeters_Float"),
(e[(e.CurrentUniverseId_Uint64 = 2004)] = "CurrentUniverseId_Uint64"),
(e[(e.PreviousUniverseId_Uint64 = 2005)] = "PreviousUniverseId_Uint64"),
(e[(e.DisplayFirmwareVersion_Uint64 = 2006)] = "DisplayFirmwareVersion_Uint64"),
(e[(e.IsOnDesktop_Bool = 2007)] = "IsOnDesktop_Bool"),
(e[(e.DisplayMCType_Int32 = 2008)] = "DisplayMCType_Int32"),
(e[(e.DisplayMCOffset_Float = 2009)] = "DisplayMCOffset_Float"),
(e[(e.DisplayMCScale_Float = 2010)] = "DisplayMCScale_Float"),
(e[(e.EdidVendorID_Int32 = 2011)] = "EdidVendorID_Int32"),
(e[(e.DisplayMCImageLeft_String = 2012)] = "DisplayMCImageLeft_String"),
(e[(e.DisplayMCImageRight_String = 2013)] = "DisplayMCImageRight_String"),
(e[(e.DisplayGCBlackClamp_Float = 2014)] = "DisplayGCBlackClamp_Float"),
(e[(e.EdidProductID_Int32 = 2015)] = "EdidProductID_Int32"),
(e[(e.CameraToHeadTransform_Matrix34 = 2016)] = "CameraToHeadTransform_Matrix34"),
(e[(e.DisplayGCType_Int32 = 2017)] = "DisplayGCType_Int32"),
(e[(e.DisplayGCOffset_Float = 2018)] = "DisplayGCOffset_Float"),
(e[(e.DisplayGCScale_Float = 2019)] = "DisplayGCScale_Float"),
(e[(e.DisplayGCPrescale_Float = 2020)] = "DisplayGCPrescale_Float"),
(e[(e.DisplayGCImage_String = 2021)] = "DisplayGCImage_String"),
(e[(e.LensCenterLeftU_Float = 2022)] = "LensCenterLeftU_Float"),
(e[(e.LensCenterLeftV_Float = 2023)] = "LensCenterLeftV_Float"),
(e[(e.LensCenterRightU_Float = 2024)] = "LensCenterRightU_Float"),
(e[(e.LensCenterRightV_Float = 2025)] = "LensCenterRightV_Float"),
(e[(e.UserHeadToEyeDepthMeters_Float = 2026)] = "UserHeadToEyeDepthMeters_Float"),
(e[(e.CameraFirmwareVersion_Uint64 = 2027)] = "CameraFirmwareVersion_Uint64"),
(e[(e.CameraFirmwareDescription_String = 2028)] = "CameraFirmwareDescription_String"),
(e[(e.DisplayFPGAVersion_Uint64 = 2029)] = "DisplayFPGAVersion_Uint64"),
(e[(e.DisplayBootloaderVersion_Uint64 = 2030)] = "DisplayBootloaderVersion_Uint64"),
(e[(e.DisplayHardwareVersion_Uint64 = 2031)] = "DisplayHardwareVersion_Uint64"),
(e[(e.AudioFirmwareVersion_Uint64 = 2032)] = "AudioFirmwareVersion_Uint64"),
(e[(e.CameraCompatibilityMode_Int32 = 2033)] = "CameraCompatibilityMode_Int32"),
(e[(e.ScreenshotHorizontalFieldOfViewDegrees_Float = 2034)] = "ScreenshotHorizontalFieldOfViewDegrees_Float"),
(e[(e.ScreenshotVerticalFieldOfViewDegrees_Float = 2035)] = "ScreenshotVerticalFieldOfViewDegrees_Float"),
(e[(e.DisplaySuppressed_Bool = 2036)] = "DisplaySuppressed_Bool"),
(e[(e.DisplayAllowNightMode_Bool = 2037)] = "DisplayAllowNightMode_Bool"),
(e[(e.DisplayMCImageWidth_Int32 = 2038)] = "DisplayMCImageWidth_Int32"),
(e[(e.DisplayMCImageHeight_Int32 = 2039)] = "DisplayMCImageHeight_Int32"),
(e[(e.DisplayMCImageNumChannels_Int32 = 2040)] = "DisplayMCImageNumChannels_Int32"),
(e[(e.DisplayMCImageData_Binary = 2041)] = "DisplayMCImageData_Binary"),
(e[(e.SecondsFromPhotonsToVblank_Float = 2042)] = "SecondsFromPhotonsToVblank_Float"),
(e[(e.DriverDirectModeSendsVsyncEvents_Bool = 2043)] = "DriverDirectModeSendsVsyncEvents_Bool"),
(e[(e.DisplayDebugMode_Bool = 2044)] = "DisplayDebugMode_Bool"),
(e[(e.GraphicsAdapterLuid_Uint64 = 2045)] = "GraphicsAdapterLuid_Uint64"),
(e[(e.DriverProvidedChaperonePath_String = 2048)] = "DriverProvidedChaperonePath_String"),
(e[(e.ExpectedTrackingReferenceCount_Int32 = 2049)] = "ExpectedTrackingReferenceCount_Int32"),
(e[(e.ExpectedControllerCount_Int32 = 2050)] = "ExpectedControllerCount_Int32"),
(e[(e.NamedIconPathControllerLeftDeviceOff_String = 2051)] = "NamedIconPathControllerLeftDeviceOff_String"),
(e[(e.NamedIconPathControllerRightDeviceOff_String = 2052)] = "NamedIconPathControllerRightDeviceOff_String"),
(e[(e.NamedIconPathTrackingReferenceDeviceOff_String = 2053)] = "NamedIconPathTrackingReferenceDeviceOff_String"),
(e[(e.DoNotApplyPrediction_Bool = 2054)] = "DoNotApplyPrediction_Bool"),
(e[(e.CameraToHeadTransforms_Matrix34_Array = 2055)] = "CameraToHeadTransforms_Matrix34_Array"),
(e[(e.DistortionMeshResolution_Int32 = 2056)] = "DistortionMeshResolution_Int32"),
(e[(e.DriverIsDrawingControllers_Bool = 2057)] = "DriverIsDrawingControllers_Bool"),
(e[(e.DriverRequestsApplicationPause_Bool = 2058)] = "DriverRequestsApplicationPause_Bool"),
(e[(e.DriverRequestsReducedRendering_Bool = 2059)] = "DriverRequestsReducedRendering_Bool"),
(e[(e.MinimumIpdStepMeters_Float = 2060)] = "MinimumIpdStepMeters_Float"),
(e[(e.AudioBridgeFirmwareVersion_Uint64 = 2061)] = "AudioBridgeFirmwareVersion_Uint64"),
(e[(e.ImageBridgeFirmwareVersion_Uint64 = 2062)] = "ImageBridgeFirmwareVersion_Uint64"),
(e[(e.ImuToHeadTransform_Matrix34 = 2063)] = "ImuToHeadTransform_Matrix34"),
(e[(e.ImuFactoryGyroBias_Vector3 = 2064)] = "ImuFactoryGyroBias_Vector3"),
(e[(e.ImuFactoryGyroScale_Vector3 = 2065)] = "ImuFactoryGyroScale_Vector3"),
(e[(e.ImuFactoryAccelerometerBias_Vector3 = 2066)] = "ImuFactoryAccelerometerBias_Vector3"),
(e[(e.ImuFactoryAccelerometerScale_Vector3 = 2067)] = "ImuFactoryAccelerometerScale_Vector3"),
(e[(e.ConfigurationIncludesLighthouse20Features_Bool = 2069)] = "ConfigurationIncludesLighthouse20Features_Bool"),
(e[(e.Prop_AdditionalRadioFeatures_Uint64 = 2070)] = "Prop_AdditionalRadioFeatures_Uint64"),
(e[(e.Prop_CameraWhiteBalance_Vector4_Array = 2071)] = "Prop_CameraWhiteBalance_Vector4_Array"),
(e[(e.Prop_CameraDistortionFunction_Int32_Array = 2072)] = "Prop_CameraDistortionFunction_Int32_Array"),
(e[(e.Prop_CameraDistortionCoefficients_Float_Array = 2073)] = "Prop_CameraDistortionCoefficients_Float_Array"),
(e[(e.Prop_ExpectedControllerType_String = 2074)] = "Prop_ExpectedControllerType_String"),
(e[(e.HmdTrackingStyle_Int32 = 2075)] = "HmdTrackingStyle_Int32"),
(e[(e.DriverProvidedChaperoneVisibility_Bool = 2076)] = "DriverProvidedChaperoneVisibility_Bool"),
(e[(e.HmdColumnCorrectionSettingPrefix_String = 2077)] = "HmdColumnCorrectionSettingPrefix_String"),
(e[(e.CameraSupportsCompatibilityModes_Bool = 2078)] = "CameraSupportsCompatibilityModes_Bool"),
(e[(e.SupportsRoomViewDepthProjection_Bool = 2079)] = "SupportsRoomViewDepthProjection_Bool"),
(e[(e.DisplayAvailableFrameRates_Float_Array = 2080)] = "DisplayAvailableFrameRates_Float_Array"),
(e[(e.DisplaySupportsRuntimeFramerateChange_Bool = 2084)] = "DisplaySupportsRuntimeFramerateChange_Bool"),
(e[(e.DisplaySupportsAnalogGain_Bool = 2085)] = "DisplaySupportsAnalogGain_Bool"),
(e[(e.DisplayMinAnalogGain_Float = 2086)] = "DisplayMinAnalogGain_Float"),
(e[(e.DisplayMaxAnalogGain_Float = 2087)] = "DisplayMaxAnalogGain_Float"),
(e[(e.DashboardScale_Float = 2091)] = "DashboardScale_Float"),
(e[(e.PeerButtonInfo_String = 2092)] = "PeerButtonInfo_String"),
(e[(e.IpdUIRangeMinMeters_Float = 2100)] = "IpdUIRangeMinMeters_Float"),
(e[(e.IpdUIRangeMaxMeters_Float = 2101)] = "IpdUIRangeMaxMeters_Float"),
(e[(e.Hmd_SupportsHDCP14LegacyCompat_Bool = 2102)] = "Hmd_SupportsHDCP14LegacyCompat_Bool"),
(e[(e.Hmd_SupportsMicMonitoring_Bool = 2103)] = "Hmd_SupportsMicMonitoring_Bool"),
(e[(e.Hmd_SupportsDisplayPortTrainingMode_Bool = 2104)] = "Hmd_SupportsDisplayPortTrainingMode_Bool"),
(e[(e.Hmd_SupportsRoomViewDirect_Bool = 2105)] = "Hmd_SupportsRoomViewDirect_Bool"),
(e[(e.Hmd_SupportsAppThrottling_Bool = 2106)] = "Hmd_SupportsAppThrottling_Bool"),
(e[(e.Hmd_SupportsGpuBusMonitoring_Bool = 2107)] = "Hmd_SupportsGpuBusMonitoring_Bool"),
(e[(e.DriverProvidedIPDVisibility_Bool = 2108)] = "DriverProvidedIPDVisibility_Bool"),
(e[(e.Prop_Driver_Reserved_01 = 2109)] = "Prop_Driver_Reserved_01"),
(e[(e.DriverRequestedMuraCorrectionMode_Int32 = 2200)] = "DriverRequestedMuraCorrectionMode_Int32"),
(e[(e.DriverRequestedMuraFeather_InnerLeft_Int32 = 2201)] = "DriverRequestedMuraFeather_InnerLeft_Int32"),
(e[(e.DriverRequestedMuraFeather_InnerRight_Int32 = 2202)] = "DriverRequestedMuraFeather_InnerRight_Int32"),
(e[(e.DriverRequestedMuraFeather_InnerTop_Int32 = 2203)] = "DriverRequestedMuraFeather_InnerTop_Int32"),
(e[(e.DriverRequestedMuraFeather_InnerBottom_Int32 = 2204)] = "DriverRequestedMuraFeather_InnerBottom_Int32"),
(e[(e.DriverRequestedMuraFeather_OuterLeft_Int32 = 2205)] = "DriverRequestedMuraFeather_OuterLeft_Int32"),
(e[(e.DriverRequestedMuraFeather_OuterRight_Int32 = 2206)] = "DriverRequestedMuraFeather_OuterRight_Int32"),
(e[(e.DriverRequestedMuraFeather_OuterTop_Int32 = 2207)] = "DriverRequestedMuraFeather_OuterTop_Int32"),
(e[(e.DriverRequestedMuraFeather_OuterBottom_Int32 = 2208)] = "DriverRequestedMuraFeather_OuterBottom_Int32"),
(e[(e.Audio_SupportsDualSpeakerAndJackOutput_Bool = 2303)] = "Audio_SupportsDualSpeakerAndJackOutput_Bool"),
(e[(e.AttachedDeviceId_String = 3e3)] = "AttachedDeviceId_String"),
(e[(e.SupportedButtons_Uint64 = 3001)] = "SupportedButtons_Uint64"),
(e[(e.Axis0Type_Int32 = 3002)] = "Axis0Type_Int32"),
(e[(e.Axis1Type_Int32 = 3003)] = "Axis1Type_Int32"),
(e[(e.Axis2Type_Int32 = 3004)] = "Axis2Type_Int32"),
(e[(e.Axis3Type_Int32 = 3005)] = "Axis3Type_Int32"),
(e[(e.Axis4Type_Int32 = 3006)] = "Axis4Type_Int32"),
(e[(e.ControllerRoleHint_Int32 = 3007)] = "ControllerRoleHint_Int32"),
(e[(e.FieldOfViewLeftDegrees_Float = 4e3)] = "FieldOfViewLeftDegrees_Float"),
(e[(e.FieldOfViewRightDegrees_Float = 4001)] = "FieldOfViewRightDegrees_Float"),
(e[(e.FieldOfViewTopDegrees_Float = 4002)] = "FieldOfViewTopDegrees_Float"),
(e[(e.FieldOfViewBottomDegrees_Float = 4003)] = "FieldOfViewBottomDegrees_Float"),
(e[(e.TrackingRangeMinimumMeters_Float = 4004)] = "TrackingRangeMinimumMeters_Float"),
(e[(e.TrackingRangeMaximumMeters_Float = 4005)] = "TrackingRangeMaximumMeters_Float"),
(e[(e.ModeLabel_String = 4006)] = "ModeLabel_String"),
(e[(e.IconPathName_String = 5e3)] = "IconPathName_String"),
(e[(e.NamedIconPathDeviceOff_String = 5001)] = "NamedIconPathDeviceOff_String"),
(e[(e.NamedIconPathDeviceSearching_String = 5002)] = "NamedIconPathDeviceSearching_String"),
(e[(e.NamedIconPathDeviceSearchingAlert_String = 5003)] = "NamedIconPathDeviceSearchingAlert_String"),
(e[(e.NamedIconPathDeviceReady_String = 5004)] = "NamedIconPathDeviceReady_String"),
(e[(e.NamedIconPathDeviceReadyAlert_String = 5005)] = "NamedIconPathDeviceReadyAlert_String"),
(e[(e.NamedIconPathDeviceNotReady_String = 5006)] = "NamedIconPathDeviceNotReady_String"),
(e[(e.NamedIconPathDeviceStandby_String = 5007)] = "NamedIconPathDeviceStandby_String"),
(e[(e.NamedIconPathDeviceAlertLow_String = 5008)] = "NamedIconPathDeviceAlertLow_String"),
(e[(e.DisplayHiddenArea_Binary_Start = 5100)] = "DisplayHiddenArea_Binary_Start"),
(e[(e.DisplayHiddenArea_Binary_End = 5150)] = "DisplayHiddenArea_Binary_End"),
(e[(e.ParentContainer = 5151)] = "ParentContainer"),
(e[(e.UserConfigPath_String = 6e3)] = "UserConfigPath_String"),
(e[(e.InstallPath_String = 6001)] = "InstallPath_String"),
(e[(e.HasDisplayComponent_Bool = 6002)] = "HasDisplayComponent_Bool"),
(e[(e.HasControllerComponent_Bool = 6003)] = "HasControllerComponent_Bool"),
(e[(e.HasCameraComponent_Bool = 6004)] = "HasCameraComponent_Bool"),
(e[(e.HasDriverDirectModeComponent_Bool = 6005)] = "HasDriverDirectModeComponent_Bool"),
(e[(e.HasVirtualDisplayComponent_Bool = 6006)] = "HasVirtualDisplayComponent_Bool"),
(e[(e.HasSpatialAnchorsSupport_Bool = 6007)] = "HasSpatialAnchorsSupport_Bool"),
(e[(e.ControllerType_String = 7e3)] = "ControllerType_String"),
(e[(e.LegacyInputProfile_String = 7001)] = "LegacyInputProfile_String"),
(e[(e.VendorSpecific_Reserved_Start = 1e4)] = "VendorSpecific_Reserved_Start"),
(e[(e.VendorSpecific_Reserved_End = 10999)] = "VendorSpecific_Reserved_End"),
(e[(e.TrackedDeviceProperty_Max = 1e6)] = "TrackedDeviceProperty_Max");
})(i || (i = {})),
(function (e) {
(e[(e.k_EButton_System = 0)] = "k_EButton_System"),
(e[(e.k_EButton_ApplicationMenu = 1)] = "k_EButton_ApplicationMenu"),
(e[(e.k_EButton_Grip = 2)] = "k_EButton_Grip"),
(e[(e.k_EButton_DPad_Left = 3)] = "k_EButton_DPad_Left"),
(e[(e.k_EButton_DPad_Up = 4)] = "k_EButton_DPad_Up"),
(e[(e.k_EButton_DPad_Right = 5)] = "k_EButton_DPad_Right"),
(e[(e.k_EButton_DPad_Down = 6)] = "k_EButton_DPad_Down"),
(e[(e.k_EButton_A = 7)] = "k_EButton_A"),
(e[(e.k_EButton_ProximitySensor = 31)] = "k_EButton_ProximitySensor"),
(e[(e.k_EButton_Axis0 = 32)] = "k_EButton_Axis0"),
(e[(e.k_EButton_Axis1 = 33)] = "k_EButton_Axis1"),
(e[(e.k_EButton_Axis2 = 34)] = "k_EButton_Axis2"),
(e[(e.k_EButton_Axis3 = 35)] = "k_EButton_Axis3"),
(e[(e.k_EButton_Axis4 = 36)] = "k_EButton_Axis4"),
(e[(e.k_EButton_SteamVR_Touchpad = 32)] = "k_EButton_SteamVR_Touchpad"),
(e[(e.k_EButton_SteamVR_Trigger = 33)] = "k_EButton_SteamVR_Trigger"),
(e[(e.k_EButton_Dashboard_Back = 2)] = "k_EButton_Dashboard_Back"),
(e[(e.k_EButton_IndexController_A = 2)] = "k_EButton_IndexController_A"),
(e[(e.k_EButton_IndexController_B = 1)] = "k_EButton_IndexController_B"),
(e[(e.k_EButton_IndexController_JoyStick = 35)] = "k_EButton_IndexController_JoyStick"),
(e[(e.k_EButton_Reserved0 = 50)] = "k_EButton_Reserved0"),
(e[(e.k_EButton_Reserved1 = 51)] = "k_EButton_Reserved1"),
(e[(e.k_EButton_Max = 64)] = "k_EButton_Max");
})(o || (o = {})),
(function (e) {
(e[(e.None = 0)] = "None"), (e[(e.ButtonEnter = 1)] = "ButtonEnter"), (e[(e.ButtonLeave = 2)] = "ButtonLeave"), (e[(e.Snap = 3)] = "Snap"), (e[(e.Sliding = 4)] = "Sliding"), (e[(e.SlidingEdge = 5)] = "SlidingEdge");
})(r || (r = {})),
(function (e) {
(e[(e.Minimal = 1)] = "Minimal"), (e[(e.Modal = 2)] = "Modal"), (e[(e.ShowArrowKeys = 4)] = "ShowArrowKeys"), (e[(e.HideDoneKey = 8)] = "HideDoneKey");
})(a || (a = {})),
(function (e) {
(e[(e.Unknown = -1)] = "Unknown"), (e[(e.Idle = 0)] = "Idle"), (e[(e.UserInteraction = 1)] = "UserInteraction"), (e[(e.UserInteraction_Timeout = 2)] = "UserInteraction_Timeout"), (e[(e.Standby = 3)] = "Standby"), (e[(e.Idle_Timeout = 4)] = "Idle_Timeout");
})(s || (s = {})),
(function (e) {
(e[(e.Notification_Shown = 600)] = "Notification_Shown"), (e[(e.Notification_Hidden = 601)] = "Notification_Hidden"), (e[(e.Notification_BeginInteraction = 602)] = "Notification_BeginInteraction"), (e[(e.Notification_Destroyed = 603)] = "Notification_Destroyed");
})(l || (l = {}));
},
37232: (e, t, n) => {
"use strict";
n.d(t, { Vj: () => r, xB: () => a });
var i = n(85556),
o = (n(27378), n(41370));
function r(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
0;
});
}
function a() {
return (0, o.SZ)(() => {
0;
});
}
},
1736: (e, t, n) => {
"use strict";
n.d(t, { MD: () => l, gA: () => s, lq: () => a });
var i = n(2260),
o = (n(6181), n(27918)),
r = n(23282);
n(1687);
class a {
static InstallErrorReportingStore(e) {
this.sm_ErrorReportingStore = e;
}
static InitHeaderFromPacket(e) {
return new a(void 0, e);
}
constructor(e, t, n, r, a, s) {
if (r) (this.m_eMsg = r.m_eMsg), (this.m_bValid = r.m_bValid), this.m_bValid && ((this.m_netPacket = r.m_netPacket), (this.m_cubHeader = r.m_cubHeader), (this.m_header = r.m_header), this.InitForType(n));
else {
if (((this.m_header = new o.Cu(null)), (this.m_bValid = !0), t))
if (((this.m_netPacket = t), this.m_netPacket.SeekGetHead(), (this.m_eMsg = this.m_netPacket.GetUint32()), 2147483648 & this.m_eMsg)) {
(this.m_eMsg = 2147483647 & this.m_eMsg), (this.m_cubHeader = this.m_netPacket.GetUint32());
try {
o.Cu.deserializeBinaryFromReader(this.m_header, new i.BinaryReader(this.m_netPacket.GetPacket(), this.m_netPacket.TellGet(), this.m_cubHeader)), this.m_netPacket.SeekGetCurrent(this.m_cubHeader), n && this.InitForType(n);
} catch (e) {
console.error("Exception deserializing protobuf", e), (this.m_bValid = !1);
}
} else this.m_bValid = !1;
else e && (this.m_eMsg = e), s && n ? (this.m_body = n.fromObject(s)) : n && (this.m_body = new n());
a && this.m_header.set_jobid_target(a.Hdr().jobid_target());
}
}
InitForType(e) {
(this.m_body = new e()), this.m_netPacket && (this.m_netPacket.SeekGetHead(8 + this.m_cubHeader), this.ReadBodyFromBuffer(e, this.m_netPacket));
}
ReadBodyFromBuffer(e, t) {
try {
e.deserializeBinaryFromReader(this.m_body, new i.BinaryReader(t.GetPacket(), t.TellGet(), t.GetCountBytesRemaining()));
} catch (e) {
this.m_bValid = !1;
const t = a.sm_ErrorReportingStore,
n = `Exception parsing protobuf message body of type ${this.m_eMsg}. Definitions may be out of sync with server version.`;
t && t.ReportError(new Error(n), { bIncludeMessageInIdentifier: !0 }), console.warn(n), console.log(e.stack || e);
}
}
BIsValid() {
return this.m_bValid;
}
Body() {
return this.m_body;
}
SetBodyJSON(e) {
(e.toObject = () => e), (this.m_body = e);
}
Hdr() {
return this.m_header;
}
GetEMsg() {
return this.m_eMsg;
}
SetEMsg(e) {
this.m_eMsg = e;
}
GetEResult() {
return this.Hdr().eresult();
}
BSuccess() {
return 1 == this.Hdr().eresult();
}
GetErrorMessage() {
return this.Hdr().error_message() ? this.Hdr().error_message() : `eresult ${this.Hdr().eresult()}`;
}
Serialize() {
const e = this.m_header.serializeBinary(),
t = this.m_body.serializeBinary(),
n = 2147483648 | this.m_eMsg,
i = new Uint8Array(8 + e.length + t.length),
o = new r.At(i);
return o.PutUint32(n), o.PutUint32(e.length), o.PutBytes(e), o.PutBytes(t), i;
}
SerializeBody() {
const e = this.m_body.serializeBinary(),
t = new Uint8Array(e.length);
return new r.At(t).PutBytes(e), t;
}
DEBUG_ToObject() {
return {};
}
DEBUG_LogToConsole() {
0;
}
}
class s extends a {
constructor(e, t = 0, n, i, o) {
super(t, n, e, i, void 0, o);
}
static InitFromPacket(e, t) {
return new s(e, 0, t);
}
static InitFromMsg(e, t) {
return new s(e, void 0, void 0, t);
}
static Init(e, t) {
return new s(e, t);
}
static InitFromObject(e, t) {
return new s(e, void 0, void 0, void 0, t);
}
Body() {
return super.Body();
}
SetBodyFields(e) {
for (const t in e)
Array.isArray(e[t])
? this.Body()[`add_${t}`] &&
e[t].forEach((e) => {
this.Body()[`add_${t}`](e);
})
: this.Body()[`set_${t}`] && this.Body()[`set_${t}`](e[t]);
}
}
function l(e, t) {
return t instanceof s ? t : s.InitFromObject(e, t);
}
},
4073: (e, t, n) => {
"use strict";
n.d(t, { Bh: () => a, F: () => c, FE: () => o, TA: () => l, Xc: () => r, aD: () => s, aR: () => d, l2: () => m });
var i = n(2260);
const o = i.BinaryReader.prototype,
r = i.BinaryWriter.prototype;
function a(e) {
const t = {},
{ fields: n } = e;
for (const e in n) {
const i = n[e];
t[i.n] = i;
}
return t;
}
function s(e, t) {
const { proto: n, fields: o } = e,
r = new n();
if (null == t) return r;
for (const e in o) {
const { n, c: a, r: s, d: l, q: c } = o[e];
if (!Object.prototype.hasOwnProperty.call(t, e)) continue;
const m = t[e];
a ? (s ? i.Message.setRepeatedWrapperField(r, n, Array.isArray(m) ? m.map((e) => a.fromObject(e)) : []) : i.Message.setWrapperField(r, n, a.fromObject(m))) : i.Message.setField(r, n, m);
}
return r;
}
function l(e, t, n) {
const { proto: o, fields: r } = e,
a = {};
for (const e in r) {
const { n: o, c: s, r: l, d: c, q: m } = r[e];
if (s)
if (l) a[e] = i.Message.toObjectList(i.Message.getRepeatedWrapperField(n, s, o), s.toObject, t);
else {
const r = i.Message.getWrapperField(n, s, o, m ? 1 : 0);
r && (a[e] = s.toObject(t, r));
}
else {
const t = i.Message.getFieldWithDefault(n, o, void 0 !== c ? c : null);
(null !== t || m) && (a[e] = t);
}
}
return t && (a.$jspbMessageInstance = n), a;
}
function c(e, t, n) {
for (; n.nextField() && !n.isEndGroup(); ) {
const o = e[n.getFieldNumber()];
if (o) {
const { n: e, c: r, r: a, d: s, q: l, br: c } = o;
if (r) {
const o = new r();
n.readMessage(o, r.deserializeBinaryFromReader), a ? i.Message.addToRepeatedWrapperField(t, e, o, r) : i.Message.setWrapperField(t, e, o);
} else if (c) {
const o = c.call(n);
a ? i.Message.addToRepeatedField(t, e, o) : i.Message.setField(t, e, o);
} else console.assert(!!c, `Reader func not set for field number ${e} in class ${r}`), n.skipField();
} else n.skipField();
}
return t;
}
function m(e, t, n) {
const { fields: o } = e;
for (const e in o) {
const { n: r, c: a, r: s, d: l, q: c, bw: m } = o[e];
if (a)
if (s) {
const e = i.Message.getRepeatedWrapperField(t, a, r);
((e && e.length) || c) && n.writeRepeatedMessage(r, e, a.serializeBinaryToWriter);
} else {
const e = i.Message.getWrapperField(t, a, r, c ? 1 : 0);
e && n.writeMessage(r, e, a.serializeBinaryToWriter);
}
else if (m) {
const e = i.Message.getField(t, r);
void 0 !== e && m.call(n, r, e);
} else console.assert(!!m, `Writer func not set for field number ${r} in class ${a}`);
}
}
function d(e) {
const t = e.proto;
for (const n in e.fields) {
const o = e.fields[n],
{ n: r, c: a, r: s, d: l, q: c } = o;
Object.prototype.hasOwnProperty.call(o, "d") ? (t.prototype[n] = h(i.Message.getFieldWithDefault, r, l)) : (t.prototype[n] = a ? (s ? h(i.Message.getRepeatedWrapperField, a, r) : u(a, r)) : h(i.Message.getField, r)), (t.prototype[`set_${n}`] = p(a ? (s ? i.Message.setRepeatedWrapperField : i.Message.setWrapperField) : i.Message.setField, r)), s && (t.prototype[`add_${n}`] = _(r, a));
}
}
function h(e, ...t) {
return function () {
return e(this, ...t);
};
}
function u(e, t) {
return function (n = !0) {
return i.Message.getWrapperField(this, e, t, n ? 1 : 0);
};
}
function p(e, t) {
return function (n) {
return e(this, t, n);
};
}
function _(e, t) {
return t
? function (n, o) {
return i.Message.addToRepeatedWrapperField(this, e, n, t, o);
}
: function (t, n) {
i.Message.addToRepeatedField(this, e, t, n);
};
}
},
23282: (e, t, n) => {
"use strict";
n.d(t, { $x: () => a, At: () => i, BH: () => r });
class i {
constructor(e, t = 0, n) {
(this.m_nOffset = t || 0), e instanceof Uint8Array || e instanceof DataView ? ((this.m_nLength = n || e.byteLength - this.m_nOffset), (this.m_nOffset += e.byteOffset), (this.m_viewPacket = new DataView(e.buffer, this.m_nOffset, this.m_nLength))) : ((this.m_nLength = n || e.byteLength - this.m_nOffset), (this.m_viewPacket = new DataView(e, this.m_nOffset, this.m_nLength))), (this.m_rgubPacket = new Uint8Array(this.m_viewPacket.buffer, this.m_viewPacket.byteOffset, this.m_viewPacket.byteLength)), (this.m_iGet = 0), (this.m_iPut = 0);
}
TellGet() {
return this.m_iGet + this.m_viewPacket.byteOffset;
}
GetPacket() {
return this.m_viewPacket.buffer;
}
GetUint8() {
return this.m_viewPacket.getUint8(this.m_iGet++);
}
GetUint32(e = !0) {
const t = this.m_viewPacket.getUint32(this.m_iGet, e);
return (this.m_iGet += 4), t;
}
SeekGetHead(e = 0) {
this.m_iGet = e || 0;
}
SeekGetCurrent(e) {
this.m_iGet += e;
}
TellPut() {
return this.m_iPut + this.m_viewPacket.byteOffset;
}
TellMaxPut() {
return this.m_viewPacket.byteLength;
}
PutUint8(e) {
this.m_viewPacket.setUint8(this.m_iPut++, e);
}
PutUint32(e, t = !0) {
this.m_viewPacket.setUint32(this.m_iPut, e, t), (this.m_iPut += 4);
}
PutBytes(e) {
this.m_rgubPacket.set(e, this.m_iPut), (this.m_iPut += e.length);
}
SeekPut(e) {
this.m_iPut += e;
}
GetCountBytesRemaining() {
return this.m_viewPacket.byteLength - this.m_iGet;
}
}
const o = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
function r(e) {
let t = "";
for (let n = 0; n < e.length; n++) {
const i = e[n];
t += o[i >>> 4] + o[15 & i];
}
return t;
}
function a(e) {
const t = new Uint8Array(e.length / 2);
for (let n = 0; n < e.length - 1; n += 2) t[n / 2] = parseInt(e.substr(n, 2), 16);
return t;
}
},
72086: (e, t, n) => {
"use strict";
n.d(t, { SM: () => o });
const i = new (class {
constructor() {
(this.m_transport = null), (this.m_registry = null);
}
SetDefaultTransport(e) {
null != this.m_transport && console.error("Multiple attempts to set a default WebUI transport: overriding previous"), (this.m_transport = e);
}
GetDefaultTransport() {
return this.m_transport;
}
SetDefaultHandlerRegistry(e) {
null != this.m_registry && console.error("Multiple attempts to set a default WebUI message handler registry: overriding previous"), (this.m_registry = e);
}
GetDefaultHandlerRegistry() {
return this.m_registry;
}
})();
function o() {
return i;
}
},
1687: (e, t, n) => {
"use strict";
var i;
!(function (e) {
(e[(e.k_EAccountFlagNormalUser = 0)] = "k_EAccountFlagNormalUser"),
(e[(e.k_EAccountFlagPersonaNameSet = 1)] = "k_EAccountFlagPersonaNameSet"),
(e[(e.k_EAccountFlagUnbannable = 2)] = "k_EAccountFlagUnbannable"),
(e[(e.k_EAccountFlagPasswordSet = 4)] = "k_EAccountFlagPasswordSet"),
(e[(e.k_EAccountFlagSupport = 8)] = "k_EAccountFlagSupport"),
(e[(e.k_EAccountFlagAdmin = 16)] = "k_EAccountFlagAdmin"),
(e[(e.k_EAccountFlagSupervisor = 32)] = "k_EAccountFlagSupervisor"),
(e[(e.k_EAccountFlagAppEditor = 64)] = "k_EAccountFlagAppEditor"),
(e[(e.k_EAccountFlagHWIDSet = 128)] = "k_EAccountFlagHWIDSet"),
(e[(e.k_EAccountFlagVacBeta = 512)] = "k_EAccountFlagVacBeta"),
(e[(e.k_EAccountFlagDebug = 1024)] = "k_EAccountFlagDebug"),
(e[(e.k_EAccountFlagDisabled = 2048)] = "k_EAccountFlagDisabled"),
(e[(e.k_EAccountFlagLimitedUser = 4096)] = "k_EAccountFlagLimitedUser"),
(e[(e.k_EAccountFlagLimitedUserForce = 8192)] = "k_EAccountFlagLimitedUserForce"),
(e[(e.k_EAccountFlagEmailValidated = 16384)] = "k_EAccountFlagEmailValidated"),
(e[(e.k_EAccountFlagForcePasswordChange = 131072)] = "k_EAccountFlagForcePasswordChange"),
(e[(e.k_EAccountFlagLogonExtraSecurity = 524288)] = "k_EAccountFlagLogonExtraSecurity"),
(e[(e.k_EAccountFlagLogonExtraSecurityDisabled = 1048576)] = "k_EAccountFlagLogonExtraSecurityDisabled"),
(e[(e.k_EAccountFlagSteam2MigrationComplete = 2097152)] = "k_EAccountFlagSteam2MigrationComplete"),
(e[(e.k_EAccountFlagNeedLogs = 4194304)] = "k_EAccountFlagNeedLogs"),
(e[(e.k_EAccountFlagLockdown = 8388608)] = "k_EAccountFlagLockdown"),
(e[(e.k_EAccountFlagMasterAppEditor = 16777216)] = "k_EAccountFlagMasterAppEditor"),
(e[(e.k_EAccountFlagBannedFromWebAPI = 33554432)] = "k_EAccountFlagBannedFromWebAPI"),
(e[(e.k_EAccountFlagPartnerMember = 67108864)] = "k_EAccountFlagPartnerMember"),
(e[(e.k_EAccountFlagGlobalModerator = 134217728)] = "k_EAccountFlagGlobalModerator"),
(e[(e.k_EAccountFlagParentalSettings = 268435456)] = "k_EAccountFlagParentalSettings"),
(e[(e.k_EAccountFlagThirdPartySupport = 536870912)] = "k_EAccountFlagThirdPartySupport"),
(e[(e.k_EAccountFlagNeedsSSANextSteamLogon = 1073741824)] = "k_EAccountFlagNeedsSSANextSteamLogon");
})(i || (i = {}));
i.k_EAccountFlagAdmin, i.k_EAccountFlagSupervisor, i.k_EAccountFlagSupport, i.k_EAccountFlagAdmin, i.k_EAccountFlagSupervisor;
n(72080);
},
71129: (e, t, n) => {
"use strict";
n.d(t, { Z6: () => m, p8: () => _, NO: () => g, UC: () => p, A1: () => u });
var i = n(27378),
o = n(78654),
r = n(10553),
a = n(60439);
class s {
constructor() {
(this.type = 0), (this.text = "");
}
ConvertMalformedNodeToText() {
3 == this.type ? (this.text = "[/" + this.text) : 2 == this.type && (this.text = "[" + this.text), (this.type = 1);
}
}
class l {
constructor(e, t) {
(this.m_dictComponents = void 0), (this.m_dictComponents = e), (this.m_fnAccumulatorFactory = t);
}
Parse(e, t, n = !1) {
const i = (function (e, t) {
const n = [];
let i = new s(),
o = !1,
r = !1,
a = !1;
for (let s = 0; s < e.length; s++) {
let l = e[s];
switch (i.type) {
case 0:
"[" == l ? ((i.type = 2), (r = !0)) : ((i.type = 1), "\\" == l && t ? (o = !o) : (i.text += l));
break;
case 2:
case 3:
if ("/" == l && r) (i.type = 3), (i.text = ""), (r = !1);
else if ("[" != l || o)
if ("]" != l || o) "\\" == l && t ? ((i.text += l), (o = !o), (r = !1)) : ((i.text += l), (o = !1), (r = !1));
else {
const e = 2 == i.type && "noparse" == i.text.toLocaleLowerCase(),
t = 3 == i.type && "noparse" == i.text.toLocaleLowerCase();
r || (a && !t) ? (i.ConvertMalformedNodeToText(), (i.text += l)) : e ? (a = !0) : t && (a = !1), (i = c(n, i)), (r = !1);
}
else i.ConvertMalformedNodeToText(), (i = c(n, i, 2)), (r = !0);
break;
case 1:
"[" != l || o ? ("\\" == l && t ? (o && (i.text += l), (o = !o)) : ((i.text += l), (o = !1))) : ((i = c(n, i, 2)), (r = !0));
}
}
0 != i.type && ((2 != i.type && 3 != i.type) || i.ConvertMalformedNodeToText(), n.push(i));
return n;
})(e, n);
return this.Parse_BuildElements(i, t);
}
Parse_BuildElements(e, t) {
let n = this.m_fnAccumulatorFactory(void 0),
i = [],
o = function () {
return i.length < 1 ? void 0 : i[i.length - 1];
},
r = this.m_dictComponents,
a = !1,
s = !0,
l = function (e, o, l) {
if (e && e.node.tag === o.text && (null == r ? void 0 : r.get(e.node.tag))) {
const o = r.get(e.node.tag),
l = i.map((e) => e.node.tag),
c = { parentTags: l, tagname: e.node.tag, args: e.node.args },
m = t(o.Constructor, c, ...n.GetElements());
(n = e.accumulator), n.AppendNode(m), (a = !!o.skipFollowingNewline), (s = e.bWrapTextForCopying);
} else if (e) {
let t = e.accumulator;
t.AppendText("[" + e.node.text + "]", !1), n.GetElements().forEach((e) => t.AppendNode(e)), t.AppendText("[/" + o.text + "]", !1), (n = t), (s = e.bWrapTextForCopying);
}
};
for (
e.forEach((e, t) => {
var c, m, d;
if (1 == e.type) {
const t = a ? e.text.replace(/^[\t\r ]*\n/g, "") : e.text;
n.AppendText(t, s), (a = !1);
} else if (2 == e.type) {
const t = null == r ? void 0 : r.get(e.tag);
if (t) {
const m = o();
if (void 0 !== m) {
const t = null == r ? void 0 : r.get(m.node.tag);
t && t.autocloses && e.tag === m.node.tag && l(i.pop(), m.node);
}
i.push({ accumulator: n, node: e, bWrapTextForCopying: s }), (n = this.m_fnAccumulatorFactory(e)), (a = !!t.skipInternalNewline), (s = null !== (c = t.allowWrapTextForCopying) && void 0 !== c && c);
} else n.AppendText("[" + e.text + "]", 0 == i.length);
} else if (3 == e.type) {
for (; o() && o().node.tag !== e.text && (null == r ? void 0 : r.get(o().node.tag)) && (null === (m = null == r ? void 0 : r.get(o().node.tag)) || void 0 === m ? void 0 : m.autocloses); ) {
const e = i.pop();
l(e, e.node);
}
if ((null === (d = o()) || void 0 === d ? void 0 : d.node.tag) == e.text) {
const t = i.pop();
l(t, e);
} else n.AppendText("[/" + e.text + "]", 0 == i.length);
}
});
i.length > 0;
) {
let e = i.pop(),
t = e.accumulator;
t.AppendText("[" + e.node.text + "]", !1), n.GetElements().forEach((e) => t.AppendNode(e)), (n = t);
}
return n.GetElements();
}
}
function c(e, t, n = 0) {
if (2 == t.type) {
let e = t.text.indexOf("="),
n = t.text.indexOf(" ");
if ((-1 != n && (-1 == e || n < e) && (e = n), e > 0)) {
t.tag = t.text.substr(0, e).toLocaleLowerCase();
let n = t.text.substr(e);
t.args = (function (e) {
if (!e || e.length < 1) return {};
let t = {},
n = "",
i = "",
o = 0,
r = 0;
"=" == e[0] && (o = 2);
let a = !1;
for (r++; r < e.length; r++) {
let s = e[r],
l = !0,
c = !1;
switch (o) {
case 0:
if ("=" == s) return {};
if (" " == s) continue;
o = 1;
break;
case 1:
("=" != s && " " != s) || a || (" " == s ? ((o = 0), (c = !0)) : (o = 2), (l = !1));
break;
case 2:
" " == s ? ((o = 0), (l = !1), (c = !0)) : '"' == s ? ((o = 4), (l = !1)) : (o = 3);
break;
case 3:
case 4:
((" " == s && 4 != o && !a) || ('"' == s && 4 == o && !a)) && ((o = 0), (l = !1), (c = !0));
}
if (l)
if ("\\" != s || a)
if (((a = !1), 1 == o)) n += s;
else {
if (3 != o && 4 != o) throw new Error("Not expecting to accumulate buffer in state " + o);
i += s;
}
else a = !0;
c && ((t[n] = i), (n = ""), (i = ""));
}
0 != o && (t[n] = i);
return t;
})(n);
} else (t.args = {}), (t.tag = t.text.toLocaleLowerCase());
}
e.push(t);
let i = new s();
return (i.type = n), i;
}
class m extends l {
constructor(e, t, n) {
super(e, null != t ? t : () => new a.LT()), (this.m_renderingLanguage = n || (0, o.jM)(r.De.LANGUAGE));
}
UpdateOverrideLanguage(e) {
this.m_renderingLanguage = e || (0, o.jM)(r.De.LANGUAGE);
}
ParseBBCode(e, t, n = !1) {
let o = 0;
const r = this.Parse(e, (e, n, ...r) => i.createElement(e, Object.assign(Object.assign({}, n), { context: t, language: this.m_renderingLanguage, key: "bbnode_" + o++ }), ...r), n);
return r.length > 1 ? i.createElement(i.Fragment, null, ...r) : 1 == r.length ? r[0] : null;
}
}
const d = ["h1", "h2", "h3", "h4", "h5", "smalltext", "b", "u", "hr", "i", "img", "strike", "spoiler", "noparse", "url", "list", "olist", "quote", "pullquote", "code", "table", "tr", "td", "th", "previewyoutube", "looping_media", "roomeffect", "sticker", "price", "pricesavings", "trailer", "speaker", "doclink", "video", "vod", "youtubeorvideo", "giveawayeligible", "claimitem", "packagepurchaseable", "actiondialog", "uploadfilebutton", "docimg"],
h = ["img", "previewyoutube", "looping_media", "roomeffect", "video", "vod", "trailer", "youtubeorvideo", "docimg"],
u = (d.filter((e) => -1 == h.indexOf(e)), "{STEAM_CLAN_IMAGE}"),
p = "{STEAM_CLAN_LOC_IMAGE}";
function _(e, t = null, n = " ") {
let i = null == t ? void 0 : t.join("|");
i || (i = d.join("|") + "|\\*");
let o = new RegExp("\\[(" + i + ")\\b[^\\]]*\\].*?\\[/\\1\\]", "gi");
return e.replace(o, n);
}
function g(e, t = null, n = "") {
let i = null == t ? void 0 : t.join("|");
i || (i = d.join("|") + "|\\*");
let o = "\\[\\/?(?:" + i + "){1,}.*?]";
return e.replace(new RegExp(o, "gi"), n);
}
},
60439: (e, t, n) => {
"use strict";
n.d(t, { LT: () => r, So: () => s });
var i = n(27378),
o = n(93635);
class r {
constructor() {
this.reactNodes = [];
}
AppendText(e, t = !1) {
e.length && (t ? this.reactNodes.push(i.createElement("span", { "data-copytext": "", "data-copystyle": "merge-adjacent", "bbcode-text": e }, e)) : this.reactNodes.push(e));
}
AppendNode(e) {
this.reactNodes.push(e);
}
GetElements() {
return this.reactNodes;
}
}
class a {
constructor(e) {
(0, o.X)(e, "decorated accumulator cannot be null"), (this.m_decoratedAccumulator = e);
}
AppendText(e, t = !1) {
this.m_decoratedAccumulator.AppendText(e, t);
}
AppendNode(e) {
this.m_decoratedAccumulator.AppendNode(e);
}
GetElements() {
return this.m_decoratedAccumulator.GetElements();
}
}
class s extends a {
constructor(e, t, n) {
super(e), (this.m_nStartCursor = 1), (this.m_nStartCursor = void 0 !== t ? t : 1);
}
AppendText(e) {
let t = e,
n = [];
for (let e = t.indexOf("\n", this.m_nStartCursor); -1 !== e; e = t.indexOf("\n")) n.push(t.substr(0, e)), n.push(i.createElement("br")), (t = t.substr(e + 1));
t.length && n.push(t),
n.forEach((e) => {
super.AppendNode(e);
});
}
}
},
46421: (e, t, n) => {
"use strict";
n.d(t, { c: () => It });
var i = n(85556),
o = n(79588),
r = n(50649),
a = n(41370),
s = n(27378),
l = n(82909),
c = n(14206),
m = n.n(c),
d = n(84678),
h = n(1736),
u = n(99627),
p = n(54521),
_ = n(88991),
g = n(59208),
C = n(28428),
f = n(8568),
v = n(22394),
S = n(84290),
b = n(10553),
I = n(9612);
class y {
GetChat(e, t) {
return this.m_mapChats.get(e) || this.m_mapChats.get(t);
}
GetOrCreateChat(e, t) {
let n = this.GetChat(e, t);
return n || ((n = new E()), this.m_mapChats.set(e || t, n)), n;
}
static Get() {
return y.s_Singleton || ((y.s_Singleton = new y()), "dev" == b.De.WEB_UNIVERSE && (window.g_BroadcastChatStore = y.s_Singleton)), y.s_Singleton;
}
constructor() {
(this.m_mapChats = new Map()), (0, o.rC)(this);
}
}
(0, i.gn)([o.LO], y.prototype, "m_mapChats", void 0);
class E {
constructor() {
(this.m_ulBroadcastChannelID = ""),
(this.m_ulChatID = ""),
(this.m_strFlairGroupID = ""),
(this.m_bAutoScroll = !0),
(this.m_ulBroadcastID = ""),
(this.m_ulBroadcastSteamID = ""),
(this.m_tsFirstRequest = null),
(this.m_nFromFirstRequestMS = 0),
(this.m_nNextChatTS = 0),
(this.m_cConsecutiveErrors = 0),
(this.m_nNudgeFactorMS = 0),
(this.m_nLastSleepMS = 0),
(this.m_bReconnecting = !1),
(this.m_unInstanceID = Math.floor(4294967296 * Math.random())),
(this.m_strUserSteamID = ""),
(this.m_regexUserEmoticons = null),
(this.m_chatScheduledFunc = null),
(this.m_webAPIInterface = null),
(this.m_textFilterStore = null),
(this.m_bHasAddedWelcomeChat = !1),
(this.m_mapMutedUsers = {}),
(this.m_mapChannelModeratorUsers = new Map()),
(this.m_mapBroadcastModeratorUsers = new Map()),
(this.m_nRateLimitSeconds = 0),
(this.m_bRateLimited = !1),
(this.m_rgChatMessages = []),
(this.m_rgAnnouncements = []),
(this.m_latestAnnouncement = null),
(0, o.rC)(this),
(this.m_webAPIInterface = new p.J(b.De.WEBAPI_BASE_URL, b.L7.webapi_token));
}
InitTextFilter() {
this.m_textFilterStore = new I.l({ BIsFriend: (0, I.V)() });
let e = 0;
if ("" !== b.L7.steamid) {
e = new _.K(b.L7.steamid).GetAccountID();
}
this.m_textFilterStore.Init(e, null, new u.Z());
}
get TextFilterStore() {
return this.m_textFilterStore;
}
GetBroadcastSteamID() {
return this.m_ulBroadcastSteamID;
}
GetUserSteamID() {
return this.m_strUserSteamID;
}
StartForSteamID(e, t) {
(this.m_webAPIInterface = new p.J(b.De.WEBAPI_BASE_URL, b.L7.webapi_token)), (this.m_ulBroadcastSteamID = e), (this.m_ulBroadcastID = t), this.InitTextFilter(), this.RequestChatInfo();
}
StartForChannel(e) {
(this.m_webAPIInterface = new p.J(b.De.WEBAPI_BASE_URL, b.L7.webapi_token)), (this.m_ulBroadcastChannelID = e), (this.m_strUserSteamID = b.L7.steamid), this.InitTextFilter(), this.JoinChannelChat();
}
Stop() {
this.m_chatScheduledFunc && this.m_chatScheduledFunc.Cancel();
}
SendMessage(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
const t = e.trim();
if (0 != t.length)
try {
let e, n, i;
if (this.m_webApiToken) {
const e = new FormData();
e.append("chat_id", this.m_ulChatID), e.append("message", t), e.append("instance_id", this.m_unInstanceID.toString()), (n = yield m().post(`${b.De.WEBAPI_BASE_URL}IBroadcastService/PostChatMessage/v0001?access_token=${this.m_webApiToken}`, e)), (i = n.data && n.data.response);
} else {
const n = h.gA.Init(g.Q3);
n.SetBodyFields({ chat_id: this.m_ulChatID, message: t, instance_id: this.m_unInstanceID.toString() }), (e = yield g.Mr.PostChatMessage(this.m_webAPIInterface.GetServiceTransport(), n)), (i = { result: e.GetEResult(), cooldown_time_seconds: e.Body().cooldown_time_seconds(), in_game: e.Body().in_game(), persona_name: e.Body().persona_name() });
}
if (i && i.result && 1 != i.result) {
let e = "";
return (e = 17 == i.result ? (0, S.Xx)("#BroadcastChat_YouMuted") : 84 == i.result ? (0, S.Xx)("#BroadcastChat_Cooldown", i.cooldown_time_seconds) : (0, S.Xx)("#BroadcastChat_FailedToSendMsg", t)), void this.m_rgChatMessages.push({ type: d.gK.Error, msg: e, client_ts: Number(new Date()), instance_id: this.m_unInstanceID, in_game: i.in_game, persona_name: i.persona_name, steamid: "" });
}
this.m_nRateLimitSeconds || (this.m_nRateLimitSeconds = i.cooldown_time_seconds), this.m_nRateLimitSeconds && ((this.m_bRateLimited = !0), setTimeout(() => (this.m_bRateLimited = !1), 1e3 * this.m_nRateLimitSeconds));
} catch (e) {
this.m_rgChatMessages.push({ type: d.gK.Error, msg: (0, S.Xx)("#BroadcastChat_FailedToSendMsg", t), client_ts: Number(new Date()), instance_id: this.m_unInstanceID, in_game: !1, persona_name: "", steamid: "" });
}
});
}
RequestChatInfo(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
(this.m_cConsecutiveErrors = 0), (this.m_bReconnecting = !1);
try {
const t = { steamid: this.m_ulBroadcastSteamID, broadcastid: this.m_ulBroadcastID, sessionid: b.De.SESSIONID },
n = yield m().get(`${b.De.CHAT_BASE_URL}broadcast/getchatinfo`, { params: t, withCredentials: !0, cancelToken: null == e ? void 0 : e.token });
(e && e.token.reason) ||
(0, o.z)(() => {
const e = n.data;
(this.m_strChatURL = e.view_url_template), (this.m_ulChatID = e.chat_id), (this.m_strFlairGroupID = e.flair_group_ids && e.flair_group_ids[0]), e.blocked && console.log("User is blocked from chat"), e.steamid && (this.m_strUserSteamID = e.steamid), e.token && (this.m_webApiToken = e.token), e.emoticons && this.SetOwnedEmoticons(e.emoticons), this.m_bHasAddedWelcomeChat || (this.m_rgChatMessages.push({ type: d.gK.Notification, msg: (0, S.Xx)("#BroadcastChat_DefaultMessage"), client_ts: Number(new Date()), instance_id: this.m_unInstanceID, in_game: !1, persona_name: "", steamid: "" }), (this.m_bHasAddedWelcomeChat = !0)), this.m_mapBroadcastModeratorUsers.clear(), e.moderators_steamid && e.moderators_steamid.forEach((e) => this.m_mapBroadcastModeratorUsers.set(e, !0)), (this.m_chatScheduledFunc = new v.Ar()), this.m_chatScheduledFunc.Schedule(0, this.RequestLoop);
});
} catch (e) {
console.error(e), console.log("Failed to get chat info!");
}
});
}
JoinChannelChat() {
return (0, i.mG)(this, void 0, void 0, function* () {
try {
const e = h.gA.Init(C.q5);
e.SetBodyFields({ broadcast_channel_id: this.m_ulBroadcastChannelID });
let t = yield C.Ly.JoinChat(this.m_webAPIInterface.GetServiceTransport(), e);
if (!t.Body().chat_id || !t.Body().view_url_template) return void console.log("Failed to join channel chat");
(this.m_strChatURL = t.Body().view_url_template()), (this.m_ulChatID = t.Body().chat_id()), (this.m_strFlairGroupID = t.Body().flair_group_ids() && t.Body().flair_group_ids()[0]), this.FetchChatModerators(), (this.m_rgChatMessages = []), this.m_rgChatMessages.push({ type: d.gK.Notification, msg: (0, S.Xx)("#BroadcastChat_DefaultMessage"), client_ts: Number(new Date()), instance_id: this.m_unInstanceID, in_game: !1, persona_name: "", steamid: "" }), (this.m_bHasAddedWelcomeChat = !0), (this.m_chatScheduledFunc = new v.Ar()), this.m_chatScheduledFunc.Schedule(0, this.RequestLoop);
} catch (e) {
console.error(e), console.log("Failed to join chat!");
}
});
}
FetchChatModerators() {
return (0, i.mG)(this, void 0, void 0, function* () {
const e = h.gA.Init(C.kX);
e.SetBodyFields({ broadcast_channel_id: this.m_ulBroadcastChannelID });
const t = (yield C.Ly.GetChatModerators(this.m_webAPIInterface.GetServiceTransport(), e)).Body().results(),
n = new Map();
t.forEach((e) => {
n.set(e.steamid(), !0);
}),
(this.m_mapChannelModeratorUsers = n);
});
}
ReplaceChatAnnouncementIfAny(e) {
var t;
(null === (t = e.announcements) || void 0 === t ? void 0 : t.length) > 0 ? ((this.m_rgAnnouncements = e.announcements.reverse()), (this.m_latestAnnouncement && JSON.stringify(this.m_latestAnnouncement) == JSON.stringify(this.m_rgAnnouncements[this.m_rgAnnouncements.length - 1])) || (this.m_latestAnnouncement = this.m_rgAnnouncements[this.m_rgAnnouncements.length - 1])) : this.m_rgAnnouncements.length > 0 && ((this.m_rgAnnouncements = []), (this.m_latestAnnouncement = null));
}
RequestLoop() {
return (0, i.mG)(this, void 0, void 0, function* () {
const e = {},
t = this.m_strChatURL.replace("{0}", this.m_nNextChatTS.toString());
t == this.m_strChatURL && this.m_nNextChatTS > 0 && (e.t = this.m_nNextChatTS);
try {
const n = (yield m().get(t, { params: e })).data;
this.m_cConsecutiveErrors = 0;
const i = n.messages.map((e) => Object.assign(Object.assign({}, e), { type: d.gK.Chat, client_ts: Number(new Date()) })).filter((e) => !this.IsUserMutedLocally(e.steamid));
this.m_rgChatMessages.push(...i), this.ReplaceChatAnnouncementIfAny(n);
const o = this.m_bAutoScroll ? 150 : 300;
if ((this.m_rgChatMessages.length > o && this.m_rgChatMessages.splice(0, this.m_rgChatMessages.length - o), n.muted))
for (const e of n.muted) {
const t = e.muted == this.m_strUserSteamID ? (0, S.Xx)("#BroadcastChat_YouMuted", e.persona_name) : (0, S.Xx)("#BroadcastChat_UserMuted", e.persona_name);
this.m_rgChatMessages.push({ type: d.gK.Notification, msg: t, client_ts: Number(new Date()), instance_id: this.m_unInstanceID, in_game: !1, persona_name: "", steamid: "" });
}
if (n.remove_msgs) for (const e of n.remove_msgs) this.RemoveUserMessagesLocal(e.steamid);
let r = 0;
if (null == this.m_tsFirstRequest || 0 == this.m_nNextChatTS || n.initial_delay) {
if ("undefined" === n.initial_delay) return void console.log("Need initial_delay to know when to request first chat message");
(this.m_tsFirstRequest = performance.now() + n.initial_delay), (this.m_nFromFirstRequestMS = 0), (this.m_nNextChatTS = n.next_request), (r = n.initial_delay);
} else {
if (n.next_request < this.m_nNextChatTS) return void console.log("Next request in past");
(this.m_nFromFirstRequestMS += n.next_request - this.m_nNextChatTS), (this.m_nNextChatTS = n.next_request), (r = this.m_tsFirstRequest + this.m_nFromFirstRequestMS - performance.now() + this.m_nNudgeFactorMS);
}
this.m_bReconnecting && (this.m_bReconnecting = !1), (this.m_nLastSleepMS = r), r < 0 && (r = 0), this.m_chatScheduledFunc.Schedule(r, this.RequestLoop);
} catch (e) {
if ((console.log("Failed to get chat messages. Previous sleep set to: " + this.m_nLastSleepMS + " firstReq: " + this.m_tsFirstRequest + " firstFromRequest: " + this.m_nFromFirstRequestMS + " nudge: " + this.m_nNudgeFactorMS), this.m_cConsecutiveErrors++, (this.m_nNudgeFactorMS += 10), this.m_cConsecutiveErrors >= 4)) {
if (null == this.m_tsFirstRequest) return void this.m_rgChatMessages.push({ type: d.gK.Error, msg: (0, S.Xx)("#BroadcastChat_UnableToJoinChat"), client_ts: Number(new Date()), instance_id: this.m_unInstanceID, in_game: !1, persona_name: "", steamid: "" });
(this.m_cConsecutiveErrors = 0), (this.m_bReconnecting = !0), this.SyncChat();
}
this.m_chatScheduledFunc.Schedule(500, this.RequestLoop);
}
});
}
GetUserEmoticons() {
return this.m_regexUserEmoticons;
}
SetOwnedEmoticons(e) {
let t = [];
for (let n = 0; n < e.length; n++) {
let i = e[n];
i.length >= 2 && ":" == i[0] ? t.push(i.substr(1, i.length - 2)) : t.push(i);
}
let n = ":(" + t.join("|") + "):";
this.m_regexUserEmoticons = new RegExp(n, "g");
}
UpdateBroadcastChatModerator(e, t, n) {
return (0, i.mG)(this, void 0, void 0, function* () {
{
const i = new FormData();
i.append("broadcaststeamid", this.m_ulBroadcastSteamID), i.append("moderatorsteamid", e), i.append("bAdd", t ? "1" : "0"), i.append("sessionid", b.De.SESSIONID);
try {
yield m().post(`${b.De.CHAT_BASE_URL}broadcast/ajaxupdatechannelmod`, i), this.m_mapBroadcastModeratorUsers.set(e, t);
const o = (0, S.Xx)(t ? "#BroadcastChat_AddedModerator" : "#BroadcastChat_RemovedModerator", n);
this.m_rgChatMessages.push({ type: d.gK.Notification, msg: o });
} catch (e) {
const i = (0, S.Xx)(t ? "#BroadcastChat_AddModeratorFailed" : "#BroadcastChat_RemoveModeratorFailed", n);
this.m_rgChatMessages.push({ type: d.gK.Error, msg: i });
}
}
});
}
UpdateUserChatBan(e, t, n, o, r, a) {
return (0, i.mG)(this, void 0, void 0, function* () {
const i = this.m_ulBroadcastSteamID,
s = this.m_strUserSteamID;
if (this.m_ulBroadcastChannelID) {
const t = h.gA.Init(C.mm);
t.SetBodyFields({ broadcast_channel_id: this.m_ulBroadcastChannelID, chatter_steamid: e, duration: 3600 * n, permanent: o, undo: a }), yield C.Ly.AddChatBan(this.m_webAPIInterface.GetServiceTransport(), t);
} else {
const a = new FormData();
a.append("broadcaststeamid", i), a.append("issuersteamid", s), a.append("chattersteamid", e), a.append("bantype", t), a.append("duration", n.toString()), a.append("perm", o ? "1" : "0"), a.append("sessionid", b.De.SESSIONID);
try {
yield m().post(`${b.De.CHAT_BASE_URL}broadcast/ajaxupdateusermute`, a), 0 == t ? delete this.m_mapMutedUsers[e] : (this.m_mapMutedUsers[e] = r);
} catch (e) {
console.log("Failed to update mute for " + r);
}
}
});
}
MuteUserForSession(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
if (e == this.m_strUserSteamID) return;
if (this.m_ulBroadcastSteamID == e) return;
let n = this.m_ulBroadcastSteamID == this.m_strUserSteamID;
if (!this.m_mapMutedUsers[e]) {
this.m_mapMutedUsers[e] = t;
try {
if (this.m_webApiToken) {
const t = new FormData();
t.append("chat_id", this.m_ulChatID), t.append("user_steamid", e), t.append("muted", "1"), yield m().post(`${b.De.WEBAPI_BASE_URL}IBroadcastService/MuteBroadcastChatUser/v0001/?access_token=${this.m_webApiToken}`, t);
} else {
const t = h.gA.Init(g.$m);
t.SetBodyFields({ chat_id: this.m_ulChatID, user_steamid: e, muted: !0 }), yield g.Mr.MuteBroadcastChatUser(this.m_webAPIInterface.GetServiceTransport(), t);
}
} catch (i) {
n && (this.m_rgChatMessages.push({ type: d.gK.Error, msg: (0, S.Xx)("#BroadcastChat_UserMuteFailed", t), client_ts: Number(new Date()), instance_id: this.m_unInstanceID, in_game: !1, persona_name: "", steamid: "" }), delete this.m_mapMutedUsers[e]);
}
}
n || this.m_rgChatMessages.push({ type: d.gK.Notification, msg: (0, S.Xx)("#BroadcastChat_UserMutedLocal", t), client_ts: Number(new Date()), instance_id: this.m_unInstanceID, in_game: !1, persona_name: "", steamid: "" });
});
}
UnmuteUserForSession(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
if (e == this.m_strUserSteamID) return;
if ((this.m_mapMutedUsers[e] && delete this.m_mapMutedUsers[e], this.m_ulBroadcastSteamID == this.m_strUserSteamID))
try {
if (this.m_webApiToken) {
const t = new FormData();
t.append("chat_id", this.m_ulChatID), t.append("user_steamid", e), t.append("muted", "0"), yield m().post(`${b.De.WEBAPI_BASE_URL}IBroadcastService/MuteBroadcastChatUser/v0001/?access_token=${this.m_webApiToken}`, t);
} else {
const t = h.gA.Init(g.$m);
t.SetBodyFields({ chat_id: this.m_ulChatID, user_steamid: e, muted: !1 }), yield g.Mr.MuteBroadcastChatUser(this.m_webAPIInterface.GetServiceTransport(), t);
}
this.m_rgChatMessages.push({ type: d.gK.Notification, msg: (0, S.Xx)("#BroadcastChat_UserUnmutedLocal", t), client_ts: Number(new Date()), instance_id: this.m_unInstanceID, in_game: !1, persona_name: "", steamid: "" });
} catch (e) {
this.m_rgChatMessages.push({ type: d.gK.Error, msg: (0, S.Xx)("#BroadcastChat_UserUnmuteFailed", t), client_ts: Number(new Date()), instance_id: this.m_unInstanceID, in_game: !1, persona_name: "", steamid: "" });
}
else this.m_rgChatMessages.push({ type: d.gK.Notification, msg: (0, S.Xx)("#BroadcastChat_UserUnmutedLocal", t), client_ts: Number(new Date()), instance_id: this.m_unInstanceID, in_game: !1, persona_name: "", steamid: "" });
});
}
RemoveUserMessagesLocal(e) {
this.m_rgChatMessages = this.m_rgChatMessages.filter((t) => t.steamid !== e);
}
RemoveUserMessagesServer(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
if (e != this.m_strUserSteamID)
try {
if (this.m_webApiToken) {
const t = new FormData();
t.append("chat_id", this.m_ulChatID), t.append("user_steamid", e), yield m().post(`${b.De.WEBAPI_BASE_URL}IBroadcastService/RemoveUserChatText/v0001/?access_token=${this.m_webApiToken}`, t);
} else {
const t = h.gA.Init(g.mn);
t.SetBodyFields({ chat_id: this.m_ulChatID, user_steamid: e }), yield g.Mr.RemoveUserChatText(this.m_webAPIInterface.GetServiceTransport(), t);
}
} catch (e) {
this.m_rgChatMessages.push({ type: d.gK.Error, msg: (0, S.Xx)("#BroadcastChat_RemoveMessagesFailed", t), client_ts: Number(new Date()), instance_id: this.m_unInstanceID, in_game: !1, persona_name: "", steamid: "" });
}
});
}
UpdateChatMessageFlair(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
if (this.m_webApiToken) {
const t = new FormData();
t.append("chat_id", this.m_ulChatID), t.append("flair", `^${this.m_strFlairGroupID}^:${e}:`), yield m().post(`${b.De.WEBAPI_BASE_URL}IBroadcastService/UpdateChatMessageFlair/v0001/?access_token=${this.m_webApiToken}`, t);
} else {
const t = h.gA.Init(g.kY);
t.SetBodyFields({ chat_id: this.m_ulChatID, flair: `^${this.m_strFlairGroupID}^:${e}:` }), yield g.Mr.UpdateChatMessageFlair(this.m_webAPIInterface.GetServiceTransport(), t);
}
});
}
IsUserMutedLocally(e) {
return Boolean(this.m_mapMutedUsers[e]);
}
BIsUserBroadcastModerator(e) {
return this.m_mapBroadcastModeratorUsers.has(e);
}
IsUserBroadcaster(e) {
return e === this.m_ulBroadcastSteamID;
}
SyncChat() {
(this.m_tsFirstRequest = null), (this.m_nFromFirstRequestMS = 0), (this.m_nNextChatTS = 0), (this.m_rgChatMessages = []);
}
}
(0, i.gn)([o.LO], E.prototype, "m_mapChannelModeratorUsers", void 0), (0, i.gn)([o.LO], E.prototype, "m_mapBroadcastModeratorUsers", void 0), (0, i.gn)([o.LO], E.prototype, "m_nRateLimitSeconds", void 0), (0, i.gn)([o.LO], E.prototype, "m_bRateLimited", void 0), (0, i.gn)([o.LO], E.prototype, "m_rgChatMessages", void 0), (0, i.gn)([o.LO], E.prototype, "m_latestAnnouncement", void 0), (0, i.gn)([f.a], E.prototype, "FetchChatModerators", null), (0, i.gn)([f.a], E.prototype, "RequestLoop", null), (0, i.gn)([f.a], E.prototype, "MuteUserForSession", null);
var D = n(2028),
w = n(65213);
class R {
constructor() {
(this.m_mapBroadcasterSteamIDToEvents = new Map()), (this.m_mapBroadcasterSteamIDData = new Map()), (0, o.rC)(this);
}
static GetBBCodeParam(e, t, n = "") {
const i = new RegExp(`\\W${t}\\W*=\\W*\\"(.*?)\\"`, "gmi").exec(e);
return i ? i[1] : n;
}
static ParseCalendarEventPresentersFromText(e) {
const t = /\[\W*speaker(\W[\s\S]*?)\]([\s\S]*?)\[\W*\/speaker\W*\]/gi,
n = new Array();
for (;;) {
const i = t.exec(e);
if (null === i) break;
const o = i[1],
r = i[2],
a = R.GetBBCodeParam(o, "steamid"),
s = { steamID: a ? new _.K(a) : void 0, name: R.GetBBCodeParam(o, "name"), title: R.GetBBCodeParam(o, "title"), company: R.GetBBCodeParam(o, "company"), photo: R.GetBBCodeParam(o, "photo"), bio: r };
n.push(s);
}
return n;
}
static ParseEventModelPresenters(e, t) {
const n = e.GetDescriptionWithFallback(t);
return R.ParseCalendarEventPresentersFromText(n);
}
static ParseEventAppReferencesFromText(e) {
const t = /\/\/store\.steampowered\.com\/app\/(\d+)/gi,
n = new Set();
for (;;) {
const i = t.exec(e);
if (null === i) break;
const o = i[1];
n.add(Number(o));
}
return n;
}
static ParseEventModelAppReferences(e, t) {
var n;
const i = e.GetDescriptionWithFallback(t),
o = R.ParseEventAppReferencesFromText(i);
if (null === (n = e.jsondata) || void 0 === n ? void 0 : n.referenced_appids) for (const t of e.jsondata.referenced_appids) o.add(t);
return o;
}
BuildBroadcasterSteamIDToActiveEventMap(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
const t = D.JW.GetTimeNowWithOverride(),
n = e.GetCalendarItemsInTimeRange(t - 3600, t);
for (const e of n.rgCalendarItems) w.j1.QueueLoadPartnerEvent(e.clanid, e.unique_id);
const i = n.rgCalendarItems.map((e) => w.j1.LoadPartnerEventFromClanEventGIDAndClanSteamID(_.K.InitFromClanID(e.clanid), e.unique_id, 0)),
o = yield Promise.all(i),
r = new Map();
for (const e of o) if (e && !(e.endTime && e.endTime < t)) for (const t of e.GetBroadcastWhitelistAsSteamIDs()) r.has(t) ? r.get(t).push(e) : r.set(t, [e]);
return r;
});
}
IsBroadcasterAlreadyBound(e, t) {
const n = this.m_mapBroadcasterSteamIDToEvents.get(e),
i = n ? n.length : 0;
if ((t ? t.length : 0) != i) return !1;
for (let e = 0; e < i; e++) if (n[e] != t[e].GID) return !1;
return !0;
}
static BuildSteamIDToPresenterMapFromEventList(e, t) {
let n = new Map();
for (const i of e) {
if (!i) continue;
const e = R.ParseEventModelPresenters(i, t);
for (const t of e) t.steamID && n.set(t.steamID.ConvertTo64BitString(), t);
}
return n;
}
RemoveCachedDataIfNotInMap(e) {
const t = new Array();
this.m_mapBroadcasterSteamIDToEvents.forEach((n, i) => {
e.has(i) || t.push(i);
}),
t.forEach((e) => {
this.m_mapBroadcasterSteamIDData.delete(e), this.m_mapBroadcasterSteamIDToEvents.delete(e);
});
}
static BuildAppIDRefsForEventList(e, t) {
const n = new Set();
for (const i of e) {
R.ParseEventModelAppReferences(i, t).forEach((e) => n.add(e));
}
return Array.from(n);
}
UpdateCachedDataFromEvents(e, t) {
e.forEach((e, n) => {
if (this.IsBroadcasterAlreadyBound(n, e)) return;
const i = { m_mapPresenters: R.BuildSteamIDToPresenterMapFromEventList(e, t), m_rgAppIDs: R.BuildAppIDRefsForEventList(e, t) };
this.m_mapBroadcasterSteamIDData.set(n, i),
this.m_mapBroadcasterSteamIDToEvents.set(
n,
e.map((e) => e.GID),
);
});
}
SynchronizeEventsWithBroadcasts(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
const n = yield this.BuildBroadcasterSteamIDToActiveEventMap(e);
this.RemoveCachedDataIfNotInMap(n), this.UpdateCachedDataFromEvents(n, t);
});
}
GetPresenterMapForBroadcasterSteamID(e) {
var t;
return null === (t = this.m_mapBroadcasterSteamIDData.get(e)) || void 0 === t ? void 0 : t.m_mapPresenters;
}
GetAppIDListForBroadcasterSteamID(e) {
var t;
return null === (t = this.m_mapBroadcasterSteamIDData.get(e)) || void 0 === t ? void 0 : t.m_rgAppIDs;
}
}
(0, i.gn)([o.LO], R.prototype, "m_mapBroadcasterSteamIDData", void 0);
const A = new R();
var M = n(37153),
k = n(2204),
T = n.n(k),
L = n(61963),
G = n(11259),
O = n(51579),
F = n(40643),
B = n(15293),
x = n(78654),
N = n(56320),
P = n(83817),
U = n(62902),
V = n(88024),
H = n(92324);
class W {
constructor() {
(this.m_mapYouTubeVideo = new Map()), (this.m_mapSharedFile = new Map()), (0, o.rC)(this);
}
LoadYouTubeDynamicData(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
let n = new Array(),
i = "";
if (
(e.forEach((e, t) => {
this.m_mapYouTubeVideo.has(e) ? n.push(this.m_mapYouTubeVideo.get(e)) : (i.length > 0 && (i += ","), (i += e));
}),
0 == i.length)
)
return n;
let r = { youtubevideoids: i },
a = null;
return (
(a = yield m().get(b.De.STORE_BASE_URL + "/events/ajaxgetdynamiceventmetadata", { params: r, cancelToken: t.token })),
a &&
a.data &&
a.data.youtube &&
(0, o.z)(() => {
a.data.youtube.forEach((e, t) => {
this.m_mapYouTubeVideo.set(e.videoid, e), n.push(e);
});
}),
n
);
});
}
LoadSharedFileDynamicData(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
let n = new Array(),
i = "";
if (
(e.forEach((e, t) => {
this.m_mapSharedFile.has(e) ? n.push(this.m_mapSharedFile.get(e)) : (i.length > 0 && (i += ","), (i += e));
}),
0 == i.length)
)
return n;
let r = { sharedfileids: i },
a = null;
return (
(a = yield m().get(b.De.STORE_BASE_URL + "/events/ajaxgetdynamiceventmetadata", { params: r, cancelToken: t.token })),
a &&
a.data &&
a.data.sharedfiles &&
(0, o.z)(() => {
a.data.sharedfiles.forEach((e, t) => {
this.m_mapSharedFile.set(e.sharedfileid, e), n.push(e);
});
}),
n
);
});
}
}
(0, i.gn)([o.LO], W.prototype, "m_mapYouTubeVideo", void 0), (0, i.gn)([o.LO], W.prototype, "m_mapSharedFile", void 0);
const X = new W();
var j = n(99165),
z = n(54701),
K = n(52705),
q = n(87018),
Z = n(23556),
Q = n(18608),
$ = n(28464),
Y = n.n($);
function J(e) {
const { videoID: t, bShowVideoImmediately: n, bAutoPlay: i, nStartSeconds: o, classNameSize: r, classNameAlign: a } = e,
[l, c] = (0, s.useState)(!n),
[m, d] = (0, s.useState)(!1),
h = (0, z.T)("YouTubeInlineSnippet"),
[u, p] = (0, s.useState)({ title: (0, S.Xx)("#Loading"), description: "", videoid: t, views: "0" });
(0, s.useEffect)(() => {
l &&
X.LoadYouTubeDynamicData([t], h)
.then((e) => {
!h.token.reason && e.length > 0 && (p(e[0]), d(!0));
})
.catch((e) => console.error("YouTubeInlineSnippet: " + (0, K.l)(e).strErrorMsg));
}, [l, h, t]);
const _ = !1;
if (
(s.useEffect(() => {
n && (0, Q.m)(() => {});
}, [n, _]),
l)
) {
const e = u.title,
n = u.views,
i = u.description;
return s.createElement("div", { className: Y().DynamicLinkBox, onClick: () => c(!1) }, s.createElement("img", { className: Y().DynamicLink_Preview, src: "https://img.youtube.com/vi/" + t + "/0.jpg" }), s.createElement("div", { className: Y().DynamicLink_Content }, s.createElement("div", { className: Y().DynamicLink_Name }, (0, S.Xx)("#EventEditor_YouTubeVideoTitle", e)), s.createElement("div", { className: Y().DynamicLink_YoutubeViews }, (0, S.Xx)("#EventEditor_YouTubeVideoViews", (0, Z.AV)(Number(n)))), s.createElement("div", { className: Y().Dynamiclink_Content }, m && i, !m && s.createElement(j.V, { size: "medium" }))));
}
return s.createElement("div", { className: (0, q.Z)(Y().PreviewYouTubeVideo, r, a), id: t }, s.createElement("img", { src: b.De.COMMUNITY_CDN_URL + "public/shared/images/responsive/youtube_16x9_placeholder.gif" }), s.createElement(Q.e, { video: t, autoplay: null != i && i, startSeconds: o, controls: !0, playsInline: !0, autopause: !0, showFullscreenBtn: !0 }));
}
var ee = n(61320),
te = n(582),
ne = n(45912),
ie = n(66954),
oe = n(87634),
re = n(85177);
class ae {
constructor() {
(this.m_bValidatedEmail = !1), (this.m_nMobileDeviceCount = 0), (this.m_bIsLoaded = !1), (this.m_bLoadedFromConfig = !1), (0, o.rC)(this);
}
LazyInit() {
if (!this.m_bLoadedFromConfig) {
let e = (0, b.ip)("notificationstore", "application_config");
this.ValidateStoreDefault(e) &&
(0, o.z)(() => {
(this.m_bIsLoaded = !0), (this.m_bValidatedEmail = e.email_validated), (this.m_nMobileDeviceCount = e.mobile_device_count);
}),
(this.m_bLoadedFromConfig = !0);
}
}
ValidateStoreDefault(e) {
return e && "object" == typeof e && "number" == typeof e.mobile_device_count;
}
BIsLoaded() {
return this.m_bIsLoaded;
}
BHasValidatedEmail() {
return this.m_bValidatedEmail;
}
BHasPushNotification() {
return this.m_nMobileDeviceCount > 0;
}
HintLoad() {
return (0, i.mG)(this, void 0, void 0, function* () {
return this.LazyInit(), this.m_bIsLoaded ? 1 : b.L7.logged_in ? (this.m_promise || (this.m_promise = this.InternalLoad()), this.m_promise) : 1;
});
}
InternalLoad() {
return (0, i.mG)(this, void 0, void 0, function* () {
const e = b.De.STORE_BASE_URL + "notification/ajaxusersettings",
t = yield m().get(e, { withCredentials: !0 });
return (
1 == t.data.success &&
(0, o.z)(() => {
(this.m_bIsLoaded = !0), (this.m_bValidatedEmail = t.data.email_validated), (this.m_nMobileDeviceCount = t.data.mobile_device_count);
}),
t.data.success
);
});
}
}
(0, i.gn)([o.LO], ae.prototype, "m_bValidatedEmail", void 0), (0, i.gn)([o.LO], ae.prototype, "m_nMobileDeviceCount", void 0);
let se = new ae();
var le = n(97841),
ce = n(45788),
me = n(5395),
de = n(8314),
he = n.n(de);
const ue = n(51154);
function pe(e, t) {
const n = ue.tz.guess(),
i = ue.unix(e).tz(n),
o = (0, S.CE)();
return o && i.locale(o), s.createElement(s.Fragment, null, i.format("LT"), t ? s.createElement("span", { "data-tooltip-text": i.format("Z") + ", " + n }, " ", i.zoneAbbr()) : null);
}
const _e = (0, r.Pi)((e) => {
const { dateAndTime: t, bSingleLine: n, bOnlyTime: i, bOnlyDate: o } = e,
r = !i && Boolean(t),
a = !o && Boolean(t),
l = r && (0, S.$1)(t),
c = e.stylesmodule ? Object.assign(Object.assign({}, he()), e.stylesmodule) : he();
return n ? s.createElement("span", { className: i || o ? c.DateAndTimeInline : c.DateAndTime }, r && l, s.createElement("span", null, " "), Boolean(t && a) && pe(t, !0)) : s.createElement("div", { className: c.DateAndTime }, r && s.createElement(s.Fragment, null, s.createElement("div", { className: c.LocalizedDate }, l), " ", s.createElement("span", { className: c.At }, "@")), s.createElement("div", { className: c.LocalizedTime }, Boolean(t && a) && pe(t, !0)));
}),
ge = (e) => {
const t = s.createElement("div", { className: e.stylesmodule.DateToolTip }, s.createElement(_e, { dateAndTime: e.rtFullDate, bSingleLine: !0, stylesmodule: e.stylesmodule }));
return s.createElement(ce.HP, { toolTipContent: t, direction: "top", className: e.className, bTopmost: !0 }, e.children);
};
let Ce = class extends s.Component {
render() {
const { startDateAndTime: e, endDateAndTime: t } = this.props,
n = this.props.stylesmodule ? Object.assign(Object.assign({}, he()), this.props.stylesmodule) : he();
let i = this.props.bHideEndTime || null == this.props.endDateAndTime || this.props.endDateAndTime < 1;
if (null == e || 0 == e) return s.createElement("div", { className: n.DateAndTime }, s.createElement("span", { className: n.RightSideTitles }, (0, S.Xx)("#EventDisplay_TimeRange")), (0, S.Xx)("#EventDisplay_TimeDisplayNone"));
let o = D.JW.GetTimeNowWithOverride();
if (i) return s.createElement("div", { className: n.StartDate }, s.createElement("div", { className: n.RightSideTitles }, (0, S.Xx)(e < o ? "#EventDisplay_TimeInPast" : "#EventDisplay_TimeUpcoming"), " "), s.createElement(_e, { stylesmodule: n, dateAndTime: e }));
let r = e <= o && o <= t;
const a = (0, me.yK)(new Date(1e3 * e), new Date(1e3 * t));
return s.createElement("div", { className: n.MultiDateAndTime }, s.createElement("div", { className: n.StartDate }, s.createElement("span", { className: n.RightSideTitles }, (0, S.Xx)(e >= o ? "#EventDisplay_TimeBeginsOn" : t >= o ? "#EventDisplay_TimeBeginsOn_Past" : "#EventDisplay_TimeBeginsOn_StartAndEnd_Past")), s.createElement(_e, { stylesmodule: n, bSingleLine: !0, dateAndTime: e })), s.createElement("div", { className: n.EndDate }, s.createElement("span", { className: n.RightSideTitles }, (0, S.Xx)(t < o ? "#EventDisplay_TimeEndsOn_Past" : "#EventDisplay_TimeEndsOn")), s.createElement(_e, { stylesmodule: n, bSingleLine: !0, bOnlyTime: a, dateAndTime: t })), r && s.createElement("span", { className: n.ActiveEvent }, s.createElement("span", { className: (0, q.Z)(n.RightSideTitles, n.ActiveEventCallOut) }, (0, S.Xx)("#Time_Now"))));
}
};
Ce = (0, i.gn)([r.Pi], Ce);
let fe = class extends s.Component {
render() {
const { startDateAndTime: e, endDateAndTime: t, bHideEndTime: n } = this.props,
i = this.props.stylesmodule ? Object.assign(Object.assign({}, he()), this.props.stylesmodule) : he();
if (null == e || 0 == e) return s.createElement("div", { className: i.DateAndTime }, s.createElement("span", { className: i.RightSideTitles }, (0, S.Xx)("#EventDisplay_TimeRange")), (0, S.Xx)("#EventDisplay_TimeDisplayNone"));
const o = D.JW.GetTimeNowWithOverrideAsDate(),
r = D.JW.GetTimeNowWithOverride(),
a = (0, me.U8)(new Date(1e3 * e), o),
l = s.createElement("div", { className: i.ShortDateAndTime }, (0, S.$1)(e, a));
let c = s.createElement(ge, { rtFullDate: e, stylesmodule: i }, s.createElement("div", { className: i.RightSideTitles }, (0, S.Xx)(e < r ? "#EventDisplay_TimeInPast" : "#EventDisplay_TimeUpcoming")), l);
if ((r < e && e < r + me._H.PerWeek && (c = s.createElement(ge, { rtFullDate: e, stylesmodule: i }, s.createElement("div", { className: i.RightSideTitles }, (0, S.kQ)("#EventDisplay_EventUpcoming_WithDateAndTime", l, s.createElement("div", { className: i.ShortDateAndTime }, pe(e), " "))))), n || null == t || t < 1)) return c;
const m = e <= r && r <= t;
m && (c = s.createElement(ge, { rtFullDate: e, className: i.ActiveEvent, stylesmodule: i }, s.createElement("span", { className: i.ActiveEventCallOut }, (0, S.Xx)("#Time_Now"))));
let d = null;
const h = m ? t - r : t - e;
if (h <= me._H.PerDay) {
const e = s.createElement("div", { className: i.ShortDateAndTime }, (0, S.yW)(h, !0));
d = t < r ? s.createElement("div", { className: i.RightSideTitles }, (0, S.Xx)("#EventDisplay_TimeEndsOn_Ran"), e) : s.createElement("div", { className: i.RightSideTitles }, (0, S.kQ)(m ? "#EventDisplay_TimeLeft" : "#EventDisplay_RunsForDuration", e));
} else {
const e = o.getFullYear() == new Date(1e3 * t).getFullYear();
d = s.createElement(s.Fragment, null, s.createElement("div", { className: i.RightSideTitles }, (0, S.Xx)(t < r ? "#EventDisplay_TimeEndsOn_Past" : "#EventDisplay_TimeEndsOn")), s.createElement("div", { className: i.ShortDateAndTime }, (0, S.$1)(t, e)));
}
const u = s.createElement(ge, { rtFullDate: t, stylesmodule: i }, d);
return s.createElement("div", { className: i.ShortDateRange }, c, u);
}
};
fe = (0, i.gn)([r.Pi], fe);
var ve = n(65204),
Se = n(68816),
be = n(16518),
Ie = n(2049),
ye = n(61752),
Ee = n(29324),
De = n.n(Ee),
we = n(12086),
Re = n(47013),
Ae = n(70404),
Me = n(71411);
let ke = class extends s.Component {
constructor() {
super(...arguments), (this.m_elDropDownRef = s.createRef()), (this.m_bLoadWasCancelled = !1), (this.state = { bIsOpen: !1, bIsLoadingNotificationSettings: !se.BIsLoaded() });
}
componentDidMount() {
this.state.bIsLoadingNotificationSettings &&
se
.HintLoad()
.catch((e) => (console.error("EventReminderWidget load fail: " + (0, K.l)(e).strErrorMsg), 2))
.then((e) => {
1 != e || this.m_bLoadWasCancelled || this.setState({ bIsLoadingNotificationSettings: !1 });
}),
!this.props.eventModel.appid && this.props.eventModel.clanSteamID && ie.sV.LoadClanInfoForClanSteamID(this.props.eventModel.clanSteamID);
}
componentWillUnmount() {
this.m_bLoadWasCancelled = !0;
}
ToggleMenu(e) {
const t = re.cb.Get().BIsUserLoggedIn();
t || b.De.IN_CLIENT ? (!t && b.De.IN_CLIENT && console.log("EventReminderWidget: In Client: Cannot use login widget. We expect to be already logged in."), this.state.bIsOpen ? this.HideMenu() : this.ShowMenu(), e.stopPropagation(), e.preventDefault()) : (0, Se.AM)(s.createElement(ve.uH, { strTitle: (0, S.Xx)("#EventDisplay_Share_NotLoggedIn"), strDescription: (0, S.Xx)("#EventDisplay_Share_NotLoggedIn_Description"), strOKButtonText: (0, S.Xx)("#MobileLogin_SignIn"), onOK: () => (0, B.Xt)() }), window);
}
ShowMenu() {
if (this.m_iMenuInstance) this.m_iMenuInstance.Show();
else {
let e = s.createElement(Ge, Object.assign({}, this.props, { fnHasReminderSet: () => this.BHasSomeNotificationSetting(), fnHidePanel: this.HideMenu })),
t = { bOverlapHorizontal: !0, bOverlapVertical: !0, bDisablePopTop: !0, bMatchWidth: !0, strClassName: (0, q.Z)(Re.ReminderDialog, Re.ReminderOptions, le.contextMenu) };
(this.m_iMenuInstance = (0, l.yV)(e, this.m_elDropDownRef.current, t)), this.m_iMenuInstance.SetOnHideCallback(this.HideMenu);
}
this.setState({ bIsOpen: !0 }), oe.Y.RecordAppInteractionEvent(this.props.eventModel.appid, oe.g.k_eReminder_Opened);
}
HideMenu() {
this.m_iMenuInstance && this.m_iMenuInstance.Hide(), this.setState({ bIsOpen: !1 });
}
BHasSomeNotificationSetting() {
const { eventModel: e } = this.props,
t = e.GID;
return (se.BHasValidatedEmail() && re.cb.Get().BFollowsEventAndNotifiedBy(e.clanSteamID, t, re.rE.k_ENotifyFlagByEmail)) || (se.BHasPushNotification() && re.cb.Get().BFollowsEventAndNotifiedBy(e.clanSteamID, t, re.rE.k_ENotifyFlagByPush));
}
render() {
const e = this.props.bOnlyShowIcon && !this.state.bIsOpen,
t = this.BHasSomeNotificationSetting();
return s.createElement("div", { className: (0, q.Z)({ [Re.ReminderCheckBox]: !0, [De().ReminderCtn]: !0, [Re.IconMode]: e, [Re.TextMode]: !e, ReminderSet: t, RemindMeWidget: !0 }), onClick: this.ToggleMenu, ref: this.m_elDropDownRef }, t && s.createElement("div", { className: Re.RemindCheck }, s.createElement(be.JrY, null)), e && s.createElement("div", { className: Re.RemindBell }, s.createElement(be.Uos, null)), s.createElement("div", { className: Re.ReminderDefault }, (0, S.Xx)("#EventDisplay_Reminder_SetReminder")), s.createElement("div", { className: Re.ReminderOptions }));
}
};
function Te(e) {
const { bPreviewMode: t, eventGID: n } = e,
o = (0, i._T)(e, ["bPreviewMode", "eventGID"]),
r = (0, ne.XC)(n);
if (!r) return t ? s.createElement("div", { className: Me.ErrorDiv }, (0, S.Xx)("#EventDidplay_Reminder_EventNotVisible", n)) : null;
const a = (0, x.jM)(b.De.LANGUAGE);
return s.createElement(ke, Object.assign({ lang: a }, o, { eventModel: r }));
}
function Le(e) {
return ee.unix(e).utc().format("YYYYMMDD[T]HHmmss[Z]");
}
(0, i.gn)([Ie.ak], ke.prototype, "ToggleMenu", null), (0, i.gn)([Ie.ak], ke.prototype, "ShowMenu", null), (0, i.gn)([Ie.ak], ke.prototype, "HideMenu", null), (ke = (0, i.gn)([r.Pi], ke));
let Ge = class extends s.Component {
constructor() {
super(...arguments), (this.state = { bIsRequestInFlight: !1 });
}
OnChangeFollowOrIgnore(e, t, n) {
return (0, i.mG)(this, void 0, void 0, function* () {
const { eventModel: i } = this.props,
o = null == i ? void 0 : i.GID;
if (o && o != x.Z3) {
this.setState({ bIsRequestInFlight: !0 });
try {
yield re.cb.Get().SetFollowOrUnfollowEvent(!e, t, i.clanSteamID, o, n), e && (n === re.rE.k_ENotifyFlagByEmail ? this.TrackEventAction(oe.g.k_eReminder_Email) : n === re.rE.k_ENotifyFlagByPush && this.TrackEventAction(oe.g.k_eReminder_MobilePush));
} catch (e) {
(0, Se.BR)(s.createElement(ve.JX, { strTitle: (0, S.Xx)(t ? "#EventDisplay_Reminder_IgnoreEvent_Error" : "#EventDisplay_Reminder_FollowEvent_Error"), strDescription: (0, S.Xx)(t ? "#EventDisplay_Reminder_IgnoreEvent_ErrorDesc" : "#EventDisplay_Reminder_FollowEvent_ErrorDesc") }, (0, K.l)(e).strErrorMsg), window);
}
this.setState({ bIsRequestInFlight: !1 });
}
});
}
OnChangeFollowByEmail(e) {
this.OnChangeFollowOrIgnore(e, !1, re.rE.k_ENotifyFlagByEmail);
}
OnChangeFollowByPush(e) {
this.OnChangeFollowOrIgnore(e, !1, re.rE.k_ENotifyFlagByPush);
}
GetExternalCalendarEventTitle() {
const { eventModel: e, lang: t } = this.props,
n = e.GetNameWithFallback(t);
if (te.xM.BHasEntityNameForID(e.appid, e.clanSteamID.GetAccountID())) {
return `${te.xM.GetEntityNameForID(e.appid, e.clanSteamID.GetAccountID())}: ${n}`;
}
return n;
}
TrackEventAction(e) {
const { eventModel: t } = this.props;
oe.Y.RecordAppInteractionEvent(t.appid, e);
}
GetExternalCalendarEventBody() {
const { eventModel: e, lang: t } = this.props;
let n = e.GetSubTitleWithLanguageFallback(t);
n = n ? `${n}\n\n\n` : "";
const i = e.GetSummaryWithFallback(t),
o = e.jsondata.bSaleEnabled ? we.Ue.k_eStoreSalePage : we.Ue.k_eStoreView;
return `${n}${i}\n\n${(0, we.q)(e, o, "forceAbsolute")}`;
}
GetGoogleCalendarLink() {
const { eventModel: e } = this.props,
t = encodeURIComponent(this.GetExternalCalendarEventTitle()),
n = encodeURIComponent(this.GetExternalCalendarEventBody()),
i = e.GetStartTimeAndDateUnixSeconds(),
o = Le(i),
r = Le(e.GetEndTimeAndDateUnixSeconds() || i + me._H.PerHour),
a = (b.De.IN_CLIENT ? "steam://openurl_external/" : "") + `https://calendar.google.com/calendar/r/eventedit?text=${t}&details=${n}&dates=${o}/${r}`;
return (0, ye.OL)(a);
}
GetICSDownloadLink(e) {
const { eventModel: t, lang: n } = this.props,
i = t.appid ? "app/" + t.appid : "group/" + t.clanSteamID.GetAccountID(),
o = "l=" + (0, x.j_)(n);
return `${b.De.STORE_BASE_URL}${(0, we.x3)()}/download/${i}/${e}/${t.GID}?${o}`;
}
render() {
const { eventModel: e, bShowStartTime: t, bExpandLeft: n, bOnlyShowIcon: i, fnHasReminderSet: o, fnHidePanel: r } = this.props,
a = se.BHasValidatedEmail(),
l = se.BHasPushNotification(),
c = t && e.GetStartTimeAndDateUnixSeconds();
return s.createElement(
"div",
null,
s.createElement("div", { className: (0, q.Z)(Re.ReminderCheckBox, i ? Re.IconMode : Re.TextMode, "RemindMeWidget"), onClick: r }, o() && s.createElement("div", { className: Re.RemindCheck }, s.createElement(be.JrY, null)), i && s.createElement("div", { className: Re.RemindBell }, s.createElement(be.Uos, null)), s.createElement("div", { className: Re.ReminderDefault }, (0, S.Xx)("#EventDisplay_Reminder_SetReminder")), s.createElement("div", { className: Re.ReminderOpennedOptions })),
s.createElement(
"div",
{ className: (0, q.Z)(Re.FlexColumnContainer, Re.ReminderBackground, n && Re.ReminderExpandsLeft) },
this.state.bIsRequestInFlight && s.createElement(j.V, { className: Re.RpcThrobber, size: "xlarge", position: "center" }),
c && s.createElement("div", { className: Re.FullStartTime }, (0, S.kQ)("#EventDisplay_EventUpcoming_WithDateAndTime", (0, S.$1)(c, (0, me.U8)(new Date(1e3 * c), D.JW.GetTimeNowWithOverrideAsDate())), pe(c, !0))),
s.createElement("div", { className: Re.ReminderOptionsHeader }, (0, S.Xx)("#EventDisplay_Reminder_GetNotification_Via")),
s.createElement("div", { className: (0, q.Z)(Re.ReminderOption, !a && Re.Unverified) }, s.createElement(ce.HP, { className: Re.CheckboxWrapper, bTopmost: !0, toolTipContent: (0, S.Xx)(a ? "#EventReminder_NotifyByEmail_ttip" : "#EventReminder_NotifyByEmail_Missing") }, s.createElement(G.ji, { label: (0, S.Xx)("#EventDisplay_Reminder_ViaEmail"), disabled: !a, checked: re.cb.Get().BFollowsEventAndNotifiedBy(e.clanSteamID, e.GID, re.rE.k_ENotifyFlagByEmail), onChange: this.OnChangeFollowByEmail })), !a && s.createElement("div", { className: Ae.FlexColumnContainer }, s.createElement("a", { href: b.De.STORE_BASE_URL + "account/", target: b.De.IN_CLIENT ? void 0 : "_blank", onClick: () => this.TrackEventAction(oe.g.k_eReminder_EmailUnverified) }, (0, S.Xx)("#EventReminder_NotifyByEmail_Missing_Add")))),
s.createElement("div", { className: (0, q.Z)(Re.ReminderOption, !l && Re.Unverified) }, s.createElement(ce.HP, { className: Re.CheckboxWrapper, bTopmost: !0, toolTipContent: (0, S.Xx)(l ? "#EventReminder_NotifyByMobile_ttip" : "#EventReminder_NotifyByMobile_Missing") }, s.createElement(G.ji, { label: (0, S.Xx)("#EventDisplay_Reminder_ViaMobileApp"), disabled: !l, checked: re.cb.Get().BFollowsEventAndNotifiedBy(e.clanSteamID, e.GID, re.rE.k_ENotifyFlagByPush), onChange: this.OnChangeFollowByPush })), !l && s.createElement("div", { className: Ae.FlexColumnContainer }, s.createElement("a", { href: b.De.STORE_BASE_URL + "mobile/?show=steamapp", target: b.De.IN_CLIENT ? void 0 : "_blank", onClick: () => this.TrackEventAction(oe.g.k_eReminder_MobilePushMissing) }, (0, S.Xx)("#EventReminder_NotifyByMobile_Install")))),
s.createElement(s.Fragment, null, s.createElement("div", { className: Re.ReminderOptionsHeader }, (0, S.Xx)("#EventDisplay_Reminder_AddToCalendar")), s.createElement("div", { className: Re.ReminderCalendarOptions }, s.createElement("a", { className: Re.ReminderOption, href: this.GetICSDownloadLink("ics"), onClick: () => this.TrackEventAction(oe.g.k_eReminder_CalendarApple) }, (0, S.Xx)("#EventDisplay_Reminder_AppleCalendar_Short")), s.createElement("a", { className: Re.ReminderOption, target: b.De.IN_CLIENT ? void 0 : "_blank", href: this.GetGoogleCalendarLink(), onClick: () => this.TrackEventAction(oe.g.k_eReminder_CalendarGoogle) }, (0, S.Xx)("#EventDisplay_Reminder_GoogleCalendar_Short")), s.createElement("a", { className: Re.ReminderOption, href: this.GetICSDownloadLink("outlook"), onClick: () => this.TrackEventAction(oe.g.k_eReminder_CalendarOutlook) }, (0, S.Xx)("#EventDisplay_Reminder_OutlookCalendar_Short")))),
!1,
),
);
}
};
(0, i.gn)([Ie.ak], Ge.prototype, "OnChangeFollowByEmail", null), (0, i.gn)([Ie.ak], Ge.prototype, "OnChangeFollowByPush", null), (0, i.gn)([Ie.ak], Ge.prototype, "TrackEventAction", null), (Ge = (0, i.gn)([r.Pi], Ge));
var Oe = n(11612);
class Fe {
constructor() {
(this.m_bUserHasVolumePreference = !1), (this.m_flVolumePreference = 0);
}
BUserHasVolumePreference() {
return this.m_bUserHasVolumePreference;
}
SetVolumePreference(e) {
(this.m_flVolumePreference = e), (this.m_bUserHasVolumePreference = !0);
}
GetVolumePreference() {
return this.m_flVolumePreference;
}
BVolumePreferenceMuted() {
return this.m_flVolumePreference < 0.001;
}
static Get() {
return Fe.s_Singleton || (Fe.s_Singleton = new Fe()), Fe.s_Singleton;
}
}
(0, i.gn)([Ie.ak], Fe.prototype, "BUserHasVolumePreference", null), (0, i.gn)([Ie.ak], Fe.prototype, "SetVolumePreference", null);
const Be = (e) => {
const { video: t, bAutoPlay: n, bControls: i, bLoop: o, bMuted: r } = e,
a = (0, s.useMemo)(() => {
var e;
return Boolean(null === (e = t.rgVideoTracks) || void 0 === e ? void 0 : e.some((e) => "subtitles" == e.sKind || "captions" == e.sKind));
}, [t.rgVideoTracks]),
[l, c] = s.useState(!1);
if (!t.rgVideoSources || !t.rgVideoSources.length) return null;
const m = (e) => {
const t = new URL(e);
return (t.search = (t.search ? t.search + "&" : "?") + "origin=" + (0, b.Kc)()), t.toString();
},
d = t.rgVideoSources.filter((e) => Boolean(e.sURL)).map((e) => s.createElement("source", { key: e.sURL, src: m(e.sURL), type: e.sFormat })),
h = t.rgVideoTracks
? t.rgVideoTracks.map((e) => {
let n = e.eLanguage;
if ((0, b.h4)())
if (S.LJ.IsELanguageValidInRealm(n, Oe.IN.k_ESteamRealmChina)) n = S.LJ.GetELanguageFallback(n);
else {
if (6 !== n) return null;
if (t.rgVideoTracks.find((e) => S.LJ.GetELanguageFallback(e.eLanguage) === n)) return null;
}
else if (!S.LJ.IsELanguageValidInRealm(n, Oe.IN.k_ESteamRealmGlobal)) return null;
return s.createElement("track", { key: e.sURL + n, src: m(e.sURL), kind: e.sKind, default: e.bDefault, srcLang: (0, x.dt)(n), label: (0, S.Xx)("#language_selection_" + (0, x.j_)(n)) });
})
: null,
u = (function (e) {
return !(!(0, ye.dK)(e.sPoster) || (e.rgVideoSources && e.rgVideoSources.some((e) => !(0, ye.dK)(e.sURL))) || (e.rgVideoTracks && e.rgVideoTracks.some((e) => !(0, ye.dK)(e.sURL))));
})(t);
let p;
(!u || (a && "public" == b.De.WEB_UNIVERSE)) && (p = "anonymous");
const _ = r || (n && Fe.Get().BVolumePreferenceMuted()),
g = t.sPoster ? m(t.sPoster) : "";
return s.createElement(
"video",
{
width: "100%",
height: "auto",
autoPlay: n,
muted: _,
playsInline: !0,
controls: i,
poster: g,
loop: o,
crossOrigin: p,
onVolumeChange: (e) => {
const t = e.target,
n = t.muted ? 0 : t.volume;
l && Fe.Get().SetVolumePreference(n);
},
onPlay: (e) => {
const t = e.target,
i = 0 == t.currentTime,
o = Fe.Get().BUserHasVolumePreference();
if ((c(!0), i))
if (o || n) o && ((t.volume = Fe.Get().GetVolumePreference()), (t.muted = Fe.Get().BVolumePreferenceMuted()));
else {
const e = t.muted ? 0 : t.volume;
Fe.Get().SetVolumePreference(e);
}
},
},
d,
h,
);
};
var xe = n(60194),
Ne = n(71129),
Pe = n(57428),
Ue = n.n(Pe),
Ve = n(5997);
const He = new Map([
[
"b",
{
Constructor: function (e) {
return s.createElement("div", { className: Ue().Bold }, e.children);
},
autocloses: !1,
},
],
[
"i",
{
Constructor: function (e) {
return s.createElement("div", { className: (0, q.Z)(Ue().Italic, "BB_Italic") }, e.children);
},
autocloses: !1,
},
],
[
"h1",
{
Constructor: function (e) {
return je(e, (0, q.Z)(Ue().Header1, "BB_Header1"));
},
autocloses: !1,
skipFollowingNewline: !0,
},
],
[
"h2",
{
Constructor: function (e) {
return je(e, (0, q.Z)(Ue().Header2, "BB_Header2"));
},
autocloses: !1,
skipFollowingNewline: !0,
},
],
[
"h3",
{
Constructor: function (e) {
return je(e, (0, q.Z)(Ue().Header3, "BB_Header3"));
},
autocloses: !1,
skipFollowingNewline: !0,
},
],
[
"h4",
{
Constructor: function (e) {
return je(e, (0, q.Z)(Ue().Header4, "BB_Header4"));
},
autocloses: !1,
skipFollowingNewline: !0,
},
],
[
"h5",
{
Constructor: function (e) {
return je(e, (0, q.Z)(Ue().Header5, "BB_Header5"));
},
autocloses: !1,
skipFollowingNewline: !0,
},
],
[
"center",
{
Constructor: function (e) {
let t = Xe(e.args, "id");
t && "string" == typeof t && t.length > 0 && "#" === t[0] && (t = t.substring(1));
return s.createElement("span", { id: t || void 0, className: (0, q.Z)(Ue().CenterSpan, "BB_Center") }, e.children);
},
autocloses: !1,
},
],
[
"smalltext",
{
Constructor: function (e) {
return je(e, (0, q.Z)(Ue().SmallText, "BB_SmallText"));
},
autocloses: !1,
skipFollowingNewline: !0,
},
],
[
"u",
{
Constructor: function (e) {
return s.createElement("div", { className: Ue().Underline }, e.children);
},
autocloses: !1,
},
],
[
"strike",
{
Constructor: function (e) {
return s.createElement("div", { className: Ue().Strike }, e.children);
},
autocloses: !1,
},
],
[
"spoiler",
{
Constructor: function (e) {
let [t, n] = s.useState(!1),
i = s.useCallback(() => {
n(!t);
}, [t]);
return s.createElement(P.s, { className: (0, q.Z)(Ue().Spoiler, t && Ue().Revealed), focusable: !0, onActivate: i, onOKActionDescription: (0, S.Xx)(t ? "#Bbcode_Spoiler_Hide" : "#Bbcode_Spoiler_Show") }, s.createElement("span", { className: Ue().SpoilerText }, e.children));
},
autocloses: !1,
},
],
[
"hr",
{
Constructor: function (e) {
return s.createElement("div", { className: Ue().HR });
},
autocloses: !1,
},
],
[
"noparse",
{
Constructor: function (e) {
return e.children;
},
autocloses: !1,
},
],
[
"url",
{
Constructor: function (e) {
let t = Xe(e.args);
if (!t) {
const n = e.children;
"string" == typeof n && (n.startsWith("http://") || n.startsWith("https://")) && (t = n);
}
const n = "button" == Xe(e.args, "style") ? Ue().LinkButton : null;
let i = Xe(e.args, "id");
i && "string" == typeof i && i.length > 0 && "#" === i[0] && (i = i.substring(1));
if (void 0 === t && !i) return e.children || "";
if (void 0 === t || ("string" == typeof t && t.length > 0 && "#" == t[0])) return s.createElement("a", { href: null != t ? t : null, id: i }, e.children);
return s.createElement(ze, { className: n, href: t, id: i }, e.children);
},
autocloses: !1,
},
],
[
"quote",
{
Constructor: function (e) {
const t = Xe(e.args, "author");
return s.createElement("blockquote", { className: (0, q.Z)(Ue().BlockQuote, e.className) }, !!t && s.createElement("div", { className: Ue().QuoteAuthor }, (0, S.Xx)("#Bbcode_Originally_Posted_By") + " ", " ", s.createElement("b", null, t + ":")), e.children);
},
autocloses: !1,
},
],
[
"pullquote",
{
Constructor: function (e) {
return s.createElement("div", { className: Ue().PullQuote }, e.children);
},
autocloses: !1,
},
],
[
"code",
{
Constructor: function (e) {
return s.createElement("div", { className: Ue().CodeBlock }, e.children);
},
autocloses: !1,
},
],
[
"c",
{
Constructor: function (e) {
return s.createElement("code", { className: Ue().Code }, e.children);
},
autocloses: !1,
},
],
[
"list",
{
Constructor: function (e) {
return s.createElement("ul", { className: (0, q.Z)(Ue().List, "bullets") }, e.children);
},
autocloses: !1,
skipInternalNewline: !0,
},
],
[
"olist",
{
Constructor: function (e) {
return s.createElement("ol", { className: Ue().OrderedList }, e.children);
},
autocloses: !1,
skipInternalNewline: !0,
},
],
[
"*",
{
Constructor: function (e) {
let t = Xe(e.args, "id");
t && "string" == typeof t && t.length > 0 && "#" === t[0] && (t = t.substring(1));
return s.createElement("li", { className: Ue().ListItem, id: t || void 0 }, e.children);
},
autocloses: !0,
skipInternalNewline: !0,
},
],
[
"table",
{
Constructor: function (e) {
const t = Xe(e.args, "noborder"),
n = Xe(e.args, "equalcells");
return s.createElement("div", { className: (0, q.Z)(Ue().Table, "BB_Table", t && Ue().NoBorder, n && Ue().EqualCells) }, e.children);
},
autocloses: !1,
skipInternalNewline: !0,
},
],
[
"tr",
{
Constructor: function (e) {
return s.createElement("div", { className: (0, q.Z)(Ue().TableRow, "BB_TableRow") }, e.children);
},
autocloses: !1,
skipInternalNewline: !0,
skipFollowingNewline: !0,
},
],
[
"th",
{
Constructor: function (e) {
return s.createElement("div", { className: Ue().TableHeader }, e.children);
},
autocloses: !1,
skipInternalNewline: !0,
skipFollowingNewline: !0,
},
],
[
"td",
{
Constructor: function (e) {
const t = Xe(e.args, "width");
return s.createElement("div", { className: (0, q.Z)(Ue().TableData, "BB_TableData"), style: t && { width: t } }, e.children);
},
autocloses: !1,
skipInternalNewline: !0,
skipFollowingNewline: !0,
},
],
[
"expand",
{
Constructor: function (e) {
const t = Boolean(Xe(e.args, "expanded")),
[n, i] = s.useState(t),
o = (function (e, t) {
switch (e) {
case "details":
return { collapsed: "#Bbcode_Expand_Details_Collapsed", expanded: "#Bbcode_Expand_Details_Expanded", style: Ue().ExpandSection_Details };
case "spoiler":
return { collapsed: "#Bbcode_Expand_Spoiler_Collapsed", expanded: "#Bbcode_Expand_Spoiler_Expanded", style: Ue().ExpandSection_Spoiler };
case "title":
return { collapsed: t || "#Bbcode_Expand_ShowMore_Collapsed", expanded: t || "#Bbcode_Expand_ShowMore_Expanded", style: Ue().ExpandSection_WithTitle };
default:
return { collapsed: "#Bbcode_Expand_ShowMore_Collapsed", expanded: "#Bbcode_Expand_ShowMore_Expanded", style: Ue().ExpandSection_ShowMore };
}
})(Xe(e.args, "type"), Xe(e.args, "title"));
return s.createElement("div", { className: (0, q.Z)(Ue().ExpandSectionBlock, o.style, n ? Ue().ExpandSectionExpanded : Ue().ExpandSectionCollapsed) }, s.createElement("div", { className: Ue().ExpandSectionHeader, onClick: () => i(!n) }, (0, S.Xx)(n ? o.expanded : o.collapsed), s.createElement("div", { className: Ue().EmbedArrow }, s.createElement(be.ret, { angle: n ? 180 : 0 }))), n && s.createElement("div", { className: Ue().ExpandSectionBody }, e.children));
},
autocloses: !1,
skipInternalNewline: !0,
allowWrapTextForCopying: !0,
},
],
[
"remindme",
{
Constructor: function (e) {
const { event: t, showErrorInfo: n } = e.context,
i = Xe(e.args);
if (i) return s.createElement(Te, { eventGID: i, bPreviewMode: n });
if (t) {
const e = (0, x.jM)(b.De.LANGUAGE);
return s.createElement(ke, { eventModel: t, lang: e });
}
return null;
},
autocloses: !1,
},
],
[
"doclink",
{
Constructor: function (e) {
const t = Xe(e.args),
n = "button" == Xe(e.args, "style") ? Ue().LinkButton : null;
return s.createElement(ze, { className: n, href: `${b.De.PARTNER_BASE_URL}doc/${t}` }, e.children);
},
autocloses: !1,
},
],
[
"color",
{
Constructor: function (e) {
const t = Xe(e.args);
return s.createElement("span", { style: { color: t } }, e.children);
},
autocloses: !1,
},
],
]);
new Map([
[
"looping_media",
{
Constructor: function (e) {
const t = Ke(e);
return s.createElement(Be, { video: t, bAutoPlay: !0, bControls: !1, bLoop: !0 });
},
autocloses: !1,
},
],
["video", { Constructor: qe, autocloses: !1 }],
[
"youtubeorvideo",
{
Constructor: function (e) {
if ((0, b.h4)() || "CN" == b.De.COUNTRY.toLocaleUpperCase()) return qe(e);
const t = Xe(e.args, "youtubeid"),
n = Xe(e.args, "size"),
i = Xe(e.args, "seconds");
let o = "full" == n ? $.sizeFull : $.sizeThumb,
r = "full" == n ? "" : "leftthumb" == n ? $.floatLeft : $.floatRight;
return s.createElement(J, { videoID: t, nStartSeconds: i ? Number.parseInt(i) : void 0, classNameAlign: r, classNameSize: o, bShowVideoImmediately: !0 });
},
autocloses: !1,
},
],
[
"previewyoutube",
{
Constructor: function (e) {
if ((0, b.h4)()) return null;
let t = Xe(e.args);
if (t) {
let e = t.split(";");
if (2 == e.length) {
let t = e[0],
n = e[1].toLocaleLowerCase(),
i = "full" == n ? $.sizeFull : $.sizeThumb,
o = "full" == n ? "" : "leftthumb" == n ? $.floatLeft : $.floatRight;
return s.createElement(J, { videoID: t, classNameAlign: o, classNameSize: i, bShowVideoImmediately: !0 });
}
}
return s.createElement(s.Fragment, null);
},
autocloses: !1,
},
],
]);
function We(e, t, n = 0) {
if (null == e ? void 0 : e.startsWith(Ne.A1)) return (0, V.pd)(e);
if (null == e ? void 0 : e.startsWith(Ne.UC)) {
const i = new Array(),
o = (0, V.OL)(),
r = e.substring(Ne.UC.length + 1),
a = H.aN.GetHashFromHashAndExt(r),
s = H.aN.GetExtensionStringFromHashAndExt(r);
if (null != t) {
let e = (0, x.j_)(t);
i.push(o + a + "/" + e + s + "?t=" + n), 4 == t && ((e = (0, x.eV)((0, x.j_)(t))), i.push(o + a + "/" + e + s + "?t=" + n));
}
return i.push(o + r), i;
}
return e;
}
function Xe(e, t) {
return void 0 === t ? e[""] : e[t];
}
function je(e, t) {
let n = Xe(e.args, "id");
return n || (n = Xe(e.args)), n && "string" == typeof n && n.length > 0 && "#" === n[0] && (n = n.substring(1)), s.createElement("div", { id: n || void 0, className: (0, q.Z)(t, e.className) }, e.children);
}
const ze = (e) => {
const { href: t } = e,
n = (0, i._T)(e, ["href"]),
o = (0, xe.bJ)();
let r,
a = (0, U.B1)(t, o);
(0, Ve.A)(a) ? ((a = (b.De.IN_CLIENT ? "steam://openurl_external/" : "") + (0, Ve.d)(a)), (r = "noopener nofollow")) : (a = (0, ye.bk)(a));
const l = "string" == typeof e.children && e.children.length > 0 && t && !t.startsWith("steam://") ? (0, ye.XW)(t) : void 0;
return s.createElement(N.IS, Object.assign({}, n, { href: a, rel: r }), s.createElement("span", { "data-tooltip-text": l }, e.children));
};
function Ke(e) {
let t = Xe(e.args, "poster");
t && (t = (0, ye.et)(t));
const n = new Array();
{
const t = Xe(e.args, "mp4");
t && n.push({ sURL: (0, ye.et)(t), sFormat: "video/mp4" });
const i = Xe(e.args, "webm");
i && n.push({ sURL: (0, ye.et)(i), sFormat: "video/webm" });
}
const i = (0, x.jM)(b.De.LANGUAGE),
o = 0 != i,
r = new Array();
for (let t = 0; t < 31; t++) {
const n = Xe(e.args, "sub_" + (0, x.dt)(t));
n && r.push({ sURL: (0, ye.et)(n), eLanguage: t, sKind: "subtitles", bDefault: o && t == i });
const a = Xe(e.args, "cap_" + (0, x.dt)(t));
a && r.push({ sURL: (0, ye.et)(a), eLanguage: t, sKind: "captions", bDefault: o && t == i });
}
return { sPoster: t, rgVideoSources: n, rgVideoTracks: r };
}
function qe(e) {
const t = Ke(e),
n = e.children ? e.children.toString() : void 0;
n && n.startsWith("http") && t.rgVideoSources.push({ sURL: (0, ye.et)(n), sFormat: "video/webm" });
const i = Xe(e.args, "autoplay"),
o = "0" !== i && "off" !== i && "false" !== i,
r = Xe(e.args, "controls"),
a = "0" !== r && "off" !== r && "false" !== r,
l = Xe(e.args, "loop"),
c = "0" !== r && "off" !== r && "false" !== r;
return s.createElement(Be, { video: t, bAutoPlay: o, bControls: a, bLoop: l ? c : o });
}
var Ze = n(90729),
Qe = n(28413),
$e = n(60439);
function Ye(e) {
return new $e.So(new $e.LT(), 0);
}
function Je(e) {
const { text: t, languageOverride: n } = e,
[i] = (0, s.useState)(new Ne.Z6(new Map([...Array.from(He.entries())]), Ye, n));
return s.createElement(s.Fragment, null, i.ParseBBCode(t, {}));
}
var et = n(44864),
tt = n.n(et);
const nt = (0, r.Pi)((e) => {
const t = e.photo ? We(e.photo, (0, x.jM)(b.De.LANGUAGE)) : null,
n = e.photo ? ("string" == typeof t ? t : t[1]) : null,
i = Boolean(e.title),
o = Boolean(e.company);
return s.createElement("div", { className: tt().SpeakerPopup, onMouseLeave: e.fnClose }, s.createElement("div", { className: tt().SpeakerInfoOuter }, e.photo && s.createElement("img", { src: n }), s.createElement("div", { className: tt().SpeakerInfoInner }, s.createElement("div", null, e.name), (i || o) && s.createElement("div", null, i && s.createElement("span", { className: tt().SpeakerTitle }, e.title), i && o && s.createElement("span", null, ", "), o && s.createElement("span", null, e.company)))), e.bio && s.createElement("div", { className: tt().SpeakerBio }, e.bio, e.bioString && s.createElement(Je, { text: e.bioString })));
});
class it extends s.Component {
constructor() {
super(...arguments), (this.m_refAnchor = s.createRef());
}
ClosePopup() {
this.m_fnHidePopup && (this.m_fnHidePopup(), (this.m_fnHidePopup = null), window.removeEventListener("scroll", this.OnScroll));
}
componentWillUnmount() {
this.ClosePopup();
}
OnScroll() {
Math.abs(window.scrollY - this.m_nScrollPosAtHoverStart) > 50 && this.ClosePopup();
}
OnHover(e) {
const t = this.m_refAnchor.current;
if (!t) return;
const n = { direction: "right", bEnablePointerEvents: !0, style: { maxWidth: 640, minHeight: t.clientHeight }, target: t },
i = "presenter-hover-" + Math.floor(1e8 * Math.random());
(this.m_fnHidePopup = () => it.sm_embeddedElements.HideElement(t.ownerDocument, i)), window.addEventListener("scroll", this.OnScroll), (this.m_nScrollPosAtHoverStart = window.scrollY);
it.sm_embeddedElements.ShowElementDelayed(t.ownerDocument, 150, s.createElement(Qe.T, Object.assign({}, n), s.createElement(nt, Object.assign({}, this.props, { fnClose: this.OnLeave }))), i);
}
OnLeave(e) {
this.ClosePopup();
}
render() {
return s.createElement("div", { className: tt().SpeakerHover, ref: this.m_refAnchor, onMouseEnter: this.OnHover, onFocus: this.OnHover, onMouseLeave: this.OnLeave, onBlur: this.OnLeave }, this.props.children);
}
}
(it.sm_embeddedElements = new Ze.AN("presenter-hover-source-elements")), (0, i.gn)([Ie.ak], it.prototype, "ClosePopup", null), (0, i.gn)([Ie.ak], it.prototype, "OnScroll", null), (0, i.gn)([Ie.ak], it.prototype, "OnHover", null), (0, i.gn)([Ie.ak], it.prototype, "OnLeave", null);
s.Component;
var ot = n(31695),
rt = n(20698),
at = n.n(rt);
n(90656);
class st {
constructor() {
(this.giveaway_id = void 0), (this.seconds_until_drawing = void 0), (this.rtime_start = void 0), (this.rtime_end = void 0), (this.closed = void 0), (this.winner_count = void 0), (0, o.rC)(this);
}
BIsValid() {
return void 0 !== this.giveaway_id && null !== this.giveaway_id;
}
BStarted() {
return this.BIsValid() && (this.seconds_until_drawing >= 0 || this.winner_count > 0);
}
clone() {
const e = new st();
return (e.giveaway_id = this.giveaway_id), (e.seconds_until_drawing = this.seconds_until_drawing), (e.rtime_start = this.rtime_start), (e.rtime_end = this.rtime_end), (e.closed = this.closed), (e.winner_count = this.winner_count), e;
}
}
(0, i.gn)([o.LO], st.prototype, "giveaway_id", void 0), (0, i.gn)([o.LO], st.prototype, "seconds_until_drawing", void 0), (0, i.gn)([o.LO], st.prototype, "rtime_start", void 0), (0, i.gn)([o.LO], st.prototype, "rtime_end", void 0), (0, i.gn)([o.LO], st.prototype, "closed", void 0), (0, i.gn)([o.LO], st.prototype, "winner_count", void 0);
class lt {
constructor() {
(this.m_mapGiveawayIDToNextDrawInfo = new Map()), (this.m_mapGiveawayIDAndInstanceToNextDrawInfo = new Map()), (this.m_bLoadedFromConfig = !1), (this.m_mapNextDrawChangeCallback = new Map()), (0, o.rC)(this);
}
GetKey(e, t) {
return e + "_" + t;
}
GetInfoByInstance(e, t) {
return this.m_mapGiveawayIDAndInstanceToNextDrawInfo.get(this.GetKey(e, t));
}
GetNextDrawChangeCallback(e) {
return this.m_mapNextDrawChangeCallback.has(e) || this.m_mapNextDrawChangeCallback.set(e, new v.pB()), this.m_mapNextDrawChangeCallback.get(e);
}
CopyToGiveaway(e, t) {
t.closed != e.closed && (t.closed = e.closed), t.giveaway_id != e.giveaway_id && (t.giveaway_id = e.giveaway_id), t.rtime_start != e.rtime_start && (t.rtime_start = e.rtime_start), t.rtime_end != e.rtime_end && (t.rtime_end = e.rtime_end), t.winner_count != e.winner_count && (t.winner_count = e.winner_count), t.seconds_until_drawing != e.seconds_until_drawing && (t.seconds_until_drawing = e.seconds_until_drawing);
}
ReloadGiveaway(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
if (!e) return null;
let n = b.De.STORE_BASE_URL + "prizes/nextdraw/" + e,
i = null,
r = { origin: self.origin };
return (
(i = yield m().get(n, { params: r })),
(0, o.z)(() => {
if ((this.m_mapGiveawayIDToNextDrawInfo.has(e) || this.m_mapGiveawayIDToNextDrawInfo.set(e, new st()), this.CopyToGiveaway(i.data, this.m_mapGiveawayIDToNextDrawInfo.get(e)), void 0 !== t)) {
const n = this.GetKey(e, t);
this.m_mapGiveawayIDAndInstanceToNextDrawInfo.has(n) || this.m_mapGiveawayIDAndInstanceToNextDrawInfo.set(n, new st()), this.CopyToGiveaway(i.data, this.m_mapGiveawayIDAndInstanceToNextDrawInfo.get(n));
}
}),
this.GetNextDrawChangeCallback(e).Dispatch(this.m_mapGiveawayIDToNextDrawInfo.get(e)),
this.m_mapGiveawayIDToNextDrawInfo.get(e)
);
});
}
static Get() {
return lt.s_Singleton || ((lt.s_Singleton = new lt()), lt.s_Singleton.Init(), "dev" == b.De.WEB_UNIVERSE && (window.g_GiveawayStore = lt.s_Singleton)), lt.s_Singleton;
}
Init() {
if (!this.m_bLoadedFromConfig) {
let e = (0, b.kQ)("giveawaynextdraw", "application_config");
if (e && e.giveaway_id) {
let t = new st();
this.CopyToGiveaway(e, t), this.m_mapGiveawayIDToNextDrawInfo.set(e.giveaway_id, t);
}
this.m_bLoadedFromConfig = !0;
}
}
}
(0, i.gn)([o.LO], lt.prototype, "m_mapGiveawayIDToNextDrawInfo", void 0), (0, i.gn)([o.aD], lt.prototype, "CopyToGiveaway", null);
class ct {
constructor() {
(this.m_myInstanceNumber = 0), (this.m_myInstanceNumber = ct.s_GlobalInstance), (ct.s_GlobalInstance += 1);
}
ClearRefreshInterval() {
this.m_intervalID && (window.clearInterval(this.m_intervalID), (this.m_intervalID = void 0));
}
ClearCountDown() {
this.m_intervalCountDownID && (window.clearInterval(this.m_intervalCountDownID), (this.m_intervalCountDownID = void 0));
}
SetupRefreshDataInterval(e, t) {
if ((this.ClearRefreshInterval(), !e.closed)) {
let n = e.seconds_until_drawing <= 0 && 0 == e.winner_count ? 6e4 : 5e3;
this.m_intervalID = window.setInterval(t, n);
}
}
SetupCountDown(e, t) {
e > 0 && (this.m_intervalCountDownID = window.setInterval(t, 1e3));
}
}
function mt(e, t) {
const n = lt.Get().GetInfoByInstance(e, t.m_myInstanceNumber);
(n.seconds_until_drawing -= 1), 0 == n.seconds_until_drawing && t.ClearCountDown();
}
function dt(e) {
const [t] = (0, s.useState)(new ct()),
n = (0, Ie.NW)();
(0, s.useEffect)(
() => (
lt
.Get()
.ReloadGiveaway(e, t.m_myInstanceNumber)
.then((i) => {
t.SetupRefreshDataInterval(i, () =>
(function (e, t) {
const n = lt.Get().GetInfoByInstance(e, t.m_myInstanceNumber);
n &&
n.BIsValid() &&
n.seconds_until_drawing <= 0 &&
!n.closed &&
(t.ClearCountDown(),
lt
.Get()
.ReloadGiveaway(e, t.m_myInstanceNumber)
.then((n) => {
t.SetupCountDown(n.seconds_until_drawing, () => mt(e, t));
}));
})(e, t),
),
t.SetupCountDown(i.seconds_until_drawing, () => mt(e, t)),
n();
}),
() => {
t.ClearRefreshInterval(), t.ClearCountDown();
}
),
[t, e, n],
);
const i = lt.Get().GetInfoByInstance(e, t.m_myInstanceNumber),
[o, r, l] = (0, a.SZ)(() => [null == i ? void 0 : i.winner_count, null == i ? void 0 : i.closed, null == i ? void 0 : i.seconds_until_drawing]);
return { bLoadingGiveawayInfo: !i || null == i.giveaway_id || !i.BStarted() || void 0 === o, winner_count: o, closed: r, seconds_until_drawing: l };
}
(ct.s_GlobalInstance = 0), (0, i.gn)([f.a], ct.prototype, "ClearRefreshInterval", null), (0, i.gn)([f.a], ct.prototype, "ClearCountDown", null), (0, i.gn)([f.a], ct.prototype, "SetupRefreshDataInterval", null), (0, i.gn)([f.a], ct.prototype, "SetupCountDown", null);
class ht {
GetRegistration(e) {
return this.m_mapRegistrations.get(e);
}
GetRegistrationChangeCallback(e) {
return this.m_listChangeCallback.has(e) || this.m_listChangeCallback.set(e, new v.pB()), this.m_listChangeCallback.get(e);
}
LoadRegistration(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
return this.m_mapLoadPromises.has(e) || this.m_mapLoadPromises.set(e, this.InternalLoadRegistration(e)), this.m_mapLoadPromises.get(e);
});
}
InternalLoadRegistration(e) {
var t, n, o, r, a;
return (0, i.mG)(this, void 0, void 0, function* () {
let i = null;
try {
const s = b.De.STORE_BASE_URL + "saleaction/ajaxgetusergiveawayregistration",
l = { giveaway_name: e, sessionid: b.De.SESSIONID },
c = yield m().get(s, { params: l, withCredentials: !0 });
if (200 == (null == c ? void 0 : c.status) && 1 == (null === (t = null == c ? void 0 : c.data) || void 0 === t ? void 0 : t.success) && (null === (n = null == c ? void 0 : c.data) || void 0 === n ? void 0 : n.registration)) return this.m_mapRegistrations.set(e, null === (o = null == c ? void 0 : c.data) || void 0 === o ? void 0 : o.registration), this.GetRegistrationChangeCallback(e).Dispatch(null === (r = null == c ? void 0 : c.data) || void 0 === r ? void 0 : r.registration), null === (a = null == c ? void 0 : c.data) || void 0 === a ? void 0 : a.registration;
i = (0, K.l)(c);
} catch (e) {
i = (0, K.l)(e);
}
return console.error("CGiveawayRegistrationStore.InternalLoadRegistration failed: on giveawayName " + e + " error: " + (null == i ? void 0 : i.strErrorMsg), i), { registered: !1 };
});
}
CreateRegistration(e) {
return this.m_mapCreatePromises.has(e) || this.m_mapCreatePromises.set(e, this.InternalCreateRegistration(e)), this.m_mapCreatePromises.get(e);
}
InternalCreateRegistration(e) {
var t, n, o, r, a;
return (0, i.mG)(this, void 0, void 0, function* () {
let i = null;
try {
const s = b.De.STORE_BASE_URL + "saleaction/ajaxupdateusergiveawayregistration",
l = { giveaway_name: e, sessionid: b.De.SESSIONID },
c = yield m().get(s, { params: l, withCredentials: !0 });
if (200 == (null == c ? void 0 : c.status) && 1 == (null === (t = null == c ? void 0 : c.data) || void 0 === t ? void 0 : t.success) && (null === (n = null == c ? void 0 : c.data) || void 0 === n ? void 0 : n.registration)) return this.m_mapRegistrations.set(e, null === (o = null == c ? void 0 : c.data) || void 0 === o ? void 0 : o.registration), this.GetRegistrationChangeCallback(e).Dispatch(null === (r = null == c ? void 0 : c.data) || void 0 === r ? void 0 : r.registration), null === (a = null == c ? void 0 : c.data) || void 0 === a ? void 0 : a.registration;
i = (0, K.l)(c);
} catch (e) {
i = (0, K.l)(e);
}
return console.error("CGiveawayRegistrationStore.InternalCreateRegistration failed: on giveawayName " + e + " error: " + (null == i ? void 0 : i.strErrorMsg), i), { registered: !1 };
});
}
static Get() {
return ht.s_Singleton || ((ht.s_Singleton = new ht()), ht.s_Singleton.Init(), "dev" == b.De.WEB_UNIVERSE && (window.g_SaleMiniGameItemDefStore = ht.s_Singleton)), ht.s_Singleton;
}
constructor() {
(this.m_mapRegistrations = new Map()), (this.m_mapLoadPromises = new Map()), (this.m_mapCreatePromises = new Map()), (this.m_listChangeCallback = new Map());
}
Init() {}
}
(0, i.gn)([Ie.ak], ht.prototype, "CreateRegistration", null);
var ut = n(37091),
pt = n(93628),
_t = n.n(pt);
function gt(e) {
const { latestAnnouncement: t } = e;
return "giveaway_draw" == (null == t ? void 0 : t.type) ? s.createElement(Ct, { latestWinner: t }) : null;
}
function Ct(e) {
var t, n;
const { latestWinner: i, className: o, strActionButton: r, strActionClassname: a } = e,
l = (null === (t = i.winners_info) || void 0 === t ? void 0 : t.length) > 0 ? i.winners_info[0].accountid : 0,
[c, m] = s.useState(l),
d = (0, ye.et)(`${(0, V.OL)()}4/080b1f163b02a9810fa78f0b32b9396fab012aef.gif`),
h = (0, ye.et)(`${(0, V.OL)()}4/56521811317a8298a7aff4a914be964b67dd0325.png`),
u = dt(i.giveaway_gid);
let p = u.bLoadingGiveawayInfo || u.closed ? null : u.seconds_until_drawing;
const _ = l === b.L7.accountid;
s.useEffect(() => {
c != l && setTimeout(() => m(l), 1500);
}, [l, c]);
const g = (null === (n = i.winners_info) || void 0 === n ? void 0 : n.length) > 0 && Boolean(i.winners_info[0].persona) ? i.winners_info[0].persona : (0, S.Xx)("#GA2022_UnknownPersonaName");
return s.createElement(
ut.ns,
{ href: "https://store.steampowered.com/sale/thegameawardssteamdeckdrop2022", className: o },
s.createElement(
"div",
{ className: (0, q.Z)({ [_t().GiveawayWinnerBox]: !0, [_t().GiveawayWinnerAnnounced]: c === l }) },
s.createElement("div", { className: _t().GiveawayWinnerBoxLeft }, s.createElement("img", { className: _t().GiveawayWinnerArt, src: d })),
s.createElement("div", { className: _t().GiveawayWinnerBoxRight }, Boolean(c !== l) && s.createElement("div", { className: (0, q.Z)(_t().GiveawayWinnerText) }, (0, S.kQ)("#GA2022_Congrats_Deck_Unknown", s.createElement("br", null))), Boolean(c === l) && s.createElement("div", { className: (0, q.Z)(_t().GiveawayWinnerText, _t().GiveawayWinnerAnnounced) }, (0, S.kQ)(_ ? "#GA2022_Congrats_Deck_Me" : "#GA2022_Congrats_Deck_OTher", g, s.createElement("br", null))), Boolean(p > 0) && s.createElement("div", { className: _t().GiveawayWinnerCountdown }, (0, S.kQ)("#GA2022_Congrats_NextDraw", p))),
s.createElement("img", { className: _t().GiveawayWinnerQuestion, src: h }),
Boolean(r) && s.createElement("div", { className: a }, _ ? (0, S.Xx)("#GA2022_YouWonNextSteps") : r),
),
);
}
const ft = new RegExp("ː([^ː]*)ː", "g"),
vt = new RegExp("^https?://(?:[^/?#]+?\\.)?(?:valvesoftware|steamcommunity|steampowered)\\.com(?:/?#|$)", "i");
const St = (e) => {
const { userType: t, msg: n, presenterInfo: i } = e;
if ("presenter" === t) return s.createElement("span", null, s.createElement(it, { name: i.name, title: i.title, photo: i.photo, company: i.company, bioString: i.bio }, s.createElement("a", { className: (0, q.Z)(at().MessageName, at().MessagePresenter), href: b.De.COMMUNITY_BASE_URL + "profiles/" + n.steamid, target: "_blank", rel: "noopener noreferrer" }, n.persona_name)));
{
let e = null;
return "broadcaster" === t ? (e = at().MessageBroadcaster) : "moderator" === t && (e = at().MessageModerator), s.createElement("span", null, s.createElement("a", { className: (0, q.Z)(at().MessageName, e), href: b.De.COMMUNITY_BASE_URL + "profiles/" + n.steamid, "data-miniprofile": "s" + n.steamid, target: "_blank", rel: "noopener noreferrer" }, n.persona_name));
}
},
bt = (e) => {
switch (e.userType) {
case "presenter":
return s.createElement("span", { className: at().RoleFlairContainer, "data-tooltip-text": (0, S.Xx)("#BroadcastChat_Role_Presenter_ttip") }, s.createElement(be.x0L, null));
case "moderator":
return s.createElement("span", { className: at().RoleFlairContainer, "data-tooltip-text": (0, S.Xx)("#BroadcastChat_Role_Moderatorr_ttip") }, s.createElement(be.yTr, null));
case "broadcaster":
return s.createElement("span", { className: at().RoleFlairContainer, "data-tooltip-text": (0, S.Xx)("#BroadcastChat_Role_Broadcaster_ttip") }, s.createElement(be.miF, null));
default:
return null;
}
};
let It = class extends s.Component {
constructor(e) {
super(e), (this.m_chat = null), (this.messagesContainer = s.createRef()), (0, o.rC)(this);
}
componentDidMount() {
this.StartChat();
}
componentDidUpdate(e) {
this.m_chat && this.m_chat.m_bAutoScroll && this.ScrollToNewestMessages(), (this.props.steamID === e.steamID && this.props.broadcastID === e.broadcastID && this.props.broadcastChannelID === e.broadcastChannelID) || this.StartChat();
}
componentWillUnmount() {
this.m_chat && this.m_chat.Stop();
}
StartChat() {
if ((this.m_chat && this.m_chat.Stop(), (this.m_chat = y.Get().GetOrCreateChat(this.props.broadcastChannelID, this.props.steamID)), this.props.broadcastChannelID)) this.m_chat.StartForChannel(this.props.broadcastChannelID);
else if (this.props.steamID && this.props.steamID && (this.props.broadcastID || this.props.globalChat)) {
let e = this.props.broadcastID || "0";
this.m_chat.StartForSteamID(this.props.steamID, e), this.ScrollToNewestMessages();
}
}
IsTrustedDomain(e) {
return !!e.match(vt);
}
AddLinksEmoticons(e, t) {
let n = ft;
t && (n = this.m_chat.GetUserEmoticons());
let i = e.split(ft);
const o = [];
for (let e = 0; e < i.length; e += 1) e % 2 == 1 ? o.push(s.createElement(O.tk, { emoticonHoverStore: M.$, key: e, emoticon: i[e], large: !0 })) : o.push(i[e]);
return o;
}
HandleScroll(e) {
const t = this.props.bInvertLayout ? e.currentTarget.scrollTop < 6 : e.currentTarget.scrollTop + e.currentTarget.clientHeight >= e.currentTarget.scrollHeight - 6;
this.m_chat && (this.m_chat.m_bAutoScroll = t);
}
ScrollToNewestMessages() {
this.messagesContainer && this.messagesContainer.current && (this.messagesContainer.current.scrollTop = this.props.bInvertLayout ? 0 : this.messagesContainer.current.scrollHeight);
}
OnContextMenu(e, t) {
if (t.type !== d.gK.Chat) return null;
const n = [],
i = this.m_chat.IsUserBroadcaster(this.m_chat.GetUserSteamID()),
o = this.m_chat.BIsUserBroadcastModerator(this.m_chat.GetUserSteamID());
if (
((b.L7 && b.L7.is_support) || i || o
? n.push(
s.createElement(L.Zo, { key: "remove", onSelected: () => this.m_chat.RemoveUserMessagesServer(t.steamid, t.persona_name) }, (0, S.Xx)("#BroadcastChat_RemoveMessages")),
s.createElement(L.Zo, { key: "updatebanh", onSelected: () => this.m_chat.UpdateUserChatBan(t.steamid, 1, 12, !1, t.persona_name) }, (0, S.Xx)("#BroadcastChat_half_Mute")),
s.createElement(L.Zo, { key: "updateband", onSelected: () => this.m_chat.UpdateUserChatBan(t.steamid, 1, 24, !1, t.persona_name) }, (0, S.Xx)("#BroadcastChat_day_Mute")),
s.createElement(L.Zo, { key: "updatebanw", onSelected: () => this.m_chat.UpdateUserChatBan(t.steamid, 1, 168, !1, t.persona_name) }, (0, S.Xx)("#BroadcastChat_week_Mute")),
s.createElement(L.Zo, { key: "updatebanp", onSelected: () => this.m_chat.UpdateUserChatBan(t.steamid, 1, 0, !0, t.persona_name) }, (0, S.Xx)("#BroadcastChat_perm_Mute")),
s.createElement(L.Zo, { key: "removeban", onSelected: () => this.m_chat.UpdateUserChatBan(t.steamid, 0, 0, !1, t.persona_name, !0) }, (0, S.Xx)("#BroadcastChat_Unmute")),
)
: this.m_chat.IsUserMutedLocally(t.steamid)
? n.push(s.createElement(L.Zo, { key: "unmuteuser", onSelected: () => this.m_chat.UnmuteUserForSession(t.steamid, t.persona_name) }, (0, S.Xx)("#BroadcastChat_UnmuteLocal")))
: n.push(s.createElement(L.Zo, { key: "muteuser", onSelected: () => this.m_chat.MuteUserForSession(t.steamid, t.persona_name) }, (0, S.Xx)("#BroadcastChat_MuteLocal"))),
((b.L7 && b.L7.is_support) || this.m_chat.IsUserBroadcaster(this.m_chat.GetUserSteamID())) && t.steamid)
) {
this.m_chat.BIsUserBroadcastModerator(t.steamid) ? n.push(s.createElement(L.Zo, { key: "removemod", onSelected: () => this.m_chat.UpdateBroadcastChatModerator(t.steamid, !1, t.persona_name) }, (0, S.Xx)("#BroadcastChat_Remove_Moderator"))) : n.push(s.createElement(L.Zo, { key: "addmod", onSelected: () => this.m_chat.UpdateBroadcastChatModerator(t.steamid, !0, t.persona_name) }, (0, S.Xx)("#BroadcastChat_Add_Moderator")));
}
return n.length ? (0, l.yV)(s.createElement(L.xV, null, s.createElement("div", { className: at().SelectedUserNameCtn }, (0, S.Xx)("#BroadcastChat_User"), s.createElement("br", null), s.createElement("span", { className: at().SelectedUserName }, t.persona_name)), n), e) : null;
}
GetTypeClassName(e) {
return e.type === d.gK.Notification ? at().MessageNotification : e.type === d.gK.Error ? at().MessageError : at().MessageChat;
}
FormatMessage(e, t) {
if (e.type === d.gK.Chat) {
let n = t ? t.FilterText(e.steamid, e.msg) : e.msg;
return this.AddLinksEmoticons(n, !1);
}
return e.msg;
}
RenderUserChatLine(e, t, n) {
let i = n ? n.get(e.steamid) : void 0;
const o =
e.type === d.gK.Chat
? (function (e, t, n) {
return n ? "presenter" : t.GetBroadcastSteamID() === e ? "broadcaster" : t.BIsUserBroadcastModerator(e) ? "moderator" : "";
})(e.steamid, this.m_chat, i)
: "";
return s.createElement(
"div",
{ key: e.instance_id + "_" + e.client_ts + "_" + t, className: this.GetTypeClassName(e), onContextMenu: (t) => this.OnContextMenu(t, e) },
e.type === d.gK.Chat && s.createElement(bt, { userType: o }),
e.flair && s.createElement("span", { className: at().FlairContainer }, this.AddLinksEmoticons(e.flair, !1)),
e.type === d.gK.Chat && s.createElement(St, { userType: o, msg: e, presenterInfo: i }),
e.type === d.gK.Chat && this.m_chat.GetBroadcastSteamID() === e.steamid && s.createElement("span", { className: `${at().MessageNotification} ${at().MessageContents}` }, ` (${(0, S.Xx)("#BroadcastChat_Broadcaster")})`),
e.type === d.gK.Chat && this.m_chat.m_mapChannelModeratorUsers.get(e.steamid) && s.createElement("span", { className: `${at().MessageNotification} ${at().MessageContents}` }, ` (${(0, S.Xx)("#BroadcastChat_Moderator")})`),
s.createElement("span", { className: `${at().MessageContents} ${this.AddLinksEmoticons(e.msg, !1).filter((e) => e && "string" == typeof e).length ? "" : at().EmoticonsOnly}` }, e.type === d.gK.Chat ? " : " : "", this.FormatMessage(e, this.m_chat.TextFilterStore)),
);
}
render() {
const { hidden: e, bPartnerMemberOnlyChat: t, bInvertLayout: n } = this.props,
i = this.m_chat ? this.m_chat.m_rgChatMessages : [],
o = n ? i.reverse() : i,
r = this.m_chat ? A.GetPresenterMapForBroadcasterSteamID(this.m_chat.GetBroadcastSteamID()) : void 0,
a = this.m_chat ? this.m_chat.m_latestAnnouncement : null;
return s.createElement(
"div",
{ className: (0, q.Z)(at().ChatPanel, "ChatPanel"), style: e ? { display: "none" } : void 0 },
s.createElement(gt, { latestAnnouncement: a }),
n && !!this.m_chat && s.createElement(yt, { oChat: this.m_chat, emoticonStore: this.props.emoticonStore, bPartnerMemberOnlyChat: t }),
s.createElement(ot.R, null),
s.createElement(
"div",
{ className: (0, q.Z)(`${at().ChatMessages} ${T().minHeightZero}`, "ChatMessages"), onScroll: this.HandleScroll, ref: this.messagesContainer },
o.map((e, t) => this.RenderUserChatLine(e, t, r)),
),
s.createElement(ot.Q, null),
!n && !!this.m_chat && s.createElement(yt, { oChat: this.m_chat, emoticonStore: this.props.emoticonStore, bPartnerMemberOnlyChat: t }),
);
}
};
function yt(e) {
const { oChat: t, emoticonStore: n, bPartnerMemberOnlyChat: i } = e;
return !i || ((null === b.L7 || void 0 === b.L7 ? void 0 : b.L7.logged_in) && (null === b.L7 || void 0 === b.L7 ? void 0 : b.L7.is_partner_member)) ? ((null === b.L7 || void 0 === b.L7 ? void 0 : b.L7.logged_in) ? s.createElement(Et, { oChat: t, emoticonStore: n }) : null) : s.createElement(Rt, null);
}
function Et(e) {
const { oChat: t, emoticonStore: n } = e,
[i, o] = s.useState(""),
r = s.useRef(),
l = (0, a.SZ)(() => t.m_bRateLimited),
c = s.useCallback(
(e) => {
!!e.shiftKey || 13 !== e.charCode || (t.m_bRateLimited || (t.SendMessage(i), o("")), e.preventDefault());
},
[t, i],
),
m = s.useCallback(
(e, t = !1) => {
o(i + `ː${e}ː`), (null == r ? void 0 : r.current) && r.current.focus();
},
[i, r],
);
let d = l || 0 == i.trim().length,
h = (0, q.Z)(T().chatSubmitButton, 0 == i.length && T().disabled);
return s.createElement(
"div",
{ className: (0, q.Z)(at().ChatEntryCtn, "ChatEntryCtn") },
s.createElement(
"div",
{ className: (0, q.Z)(at().ChatEntry, "ChatEntry") },
s.createElement(
"form",
{ className: `${T().chatEntryControls}` },
s.createElement("textarea", { className: T().chatTextarea, placeholder: (0, S.Xx)("#BroadcastChat_EnterResponse"), onKeyPress: c, onChange: (e) => o(e.target.value), value: i, ref: r }),
l && s.createElement(wt, { nSeconds: t.m_nRateLimitSeconds, bRateLimited: t.m_bRateLimited }),
s.createElement(
"button",
{
className: h,
title: (0, S.Xx)("#ChatEntryButton_Submit"),
disabled: d,
onClick: () => {
t.SendMessage(i), o("");
},
},
s.createElement(be.k4K, null),
),
),
s.createElement("div", { style: { height: "50px" }, className: `${T().chatEntryActionsContainer}` }, s.createElement("div", { className: T().chatEntryActionsGroup }, s.createElement(F.Z, { disabled: !1, OnEmoticonSelected: m, rtLastAckedNewEmoticons: Number.MAX_VALUE, emoticonStore: n, emoticonHoverStore: M.$ }), s.createElement(Dt, Object.assign({}, e, { textInputRef: r })))),
),
);
}
function Dt(e) {
var t;
const { oChat: n, emoticonStore: i, textInputRef: o } = e;
return n.m_strFlairGroupID && i.flair_list && (null === (t = i.GetFlairListByGroupID(n.m_strFlairGroupID)) || void 0 === t ? void 0 : t.length)
? s.createElement(F.Z, {
disabled: !1,
OnEmoticonSelected: (e) => {
n.UpdateChatMessageFlair(e), (null == o ? void 0 : o.current) && o.current.focus();
},
rtLastAckedNewEmoticons: Number.MAX_VALUE,
emoticonStore: i,
emoticonHoverStore: M.$,
strFlairGroupID: n.m_strFlairGroupID,
title: (0, S.Xx)("#ChatEntryButton_Flair"),
buttonIcon: s.createElement(be.yVt, null),
})
: null;
}
(0, i.gn)([o.LO], It.prototype, "m_chat", void 0), (0, i.gn)([Ie.ak], It.prototype, "StartChat", null), (0, i.gn)([Ie.ak], It.prototype, "HandleScroll", null), (0, i.gn)([Ie.ak], It.prototype, "OnContextMenu", null), (0, i.gn)([Ie.ak], It.prototype, "RenderUserChatLine", null), (It = (0, i.gn)([r.Pi], It));
class wt extends s.Component {
render() {
return s.createElement("div", { className: at().TimedProgressBarContainer }, s.createElement("div", { className: at().wrapper }, s.createElement("div", { className: `${at().spinner} ${at().pie}`, style: { animationDuration: `${this.props.nSeconds || 0}s` } }), s.createElement("div", { className: `${at().filler} ${at().pie}`, style: { animationDuration: `${this.props.nSeconds || 0}s` } }), s.createElement("div", { className: at().mask, style: { animationDuration: `${this.props.nSeconds || 0}s` } })));
}
}
function Rt(e) {
return s.createElement("div", { className: at().Description }, s.createElement("div", { className: at().LogInPrompt }, (0, S.Xx)("#Broadcast_PartnerChat_Login")), !b.L7.logged_in && s.createElement(G.zx, { onClick: B.Xt, className: (0, q.Z)(at().SignInButton) }, (0, S.Xx)("#Login_SignIn")));
}
},
66035: (e, t, n) => {
"use strict";
n.d(t, { G$: () => m, rr: () => c });
var i = n(85556),
o = n(79588),
r = n(10553);
const a = r.De.CHAT_BASE_URL + "public/images/broadcast/cs2_major2024_cph_icon.png",
s = (r.De.CHAT_BASE_URL, r.De.CHAT_BASE_URL + "public/images/broadcast/yule_30x30.png");
class l {
constructor(e) {
(this.bValid = !1), (this.stream = { 0: "#Broadcast_EnglishMain" }), (this.name = ""), (this.appName = ""), (this.appID = 0), (this.link = ""), (this.linkName = ""), (this.tabIcon = ""), (this.offlineImage = ""), (this.gidEvent = ""), (0, o.rC)(this), this.init(e);
}
init(e) {
(this.bValid = e.bValid), (this.stream = e.stream), (this.name = e.name), (this.appName = e.appName), (this.appID = e.appID), (this.link = e.link), (this.linkName = e.linkName), (this.tabIcon = e.tabIcon), (this.offlineImage = e.offlineImage), (this.gidEvent = e.gidEvent);
}
}
(0, i.gn)([o.LO], l.prototype, "bValid", void 0), (0, i.gn)([o.LO], l.prototype, "stream", void 0), (0, i.gn)([o.LO], l.prototype, "name", void 0), (0, i.gn)([o.LO], l.prototype, "appName", void 0), (0, i.gn)([o.LO], l.prototype, "appID", void 0), (0, i.gn)([o.LO], l.prototype, "link", void 0), (0, i.gn)([o.LO], l.prototype, "linkName", void 0), (0, i.gn)([o.LO], l.prototype, "tabIcon", void 0), (0, i.gn)([o.LO], l.prototype, "offlineImage", void 0), (0, i.gn)([o.LO], l.prototype, "gidEvent", void 0);
let c = new l({ bValid: !1, stream: { 0: "#Broadcast_EnglishMain" }, name: "", appName: "", appID: 0, link: "", linkName: "", tabIcon: "", offlineImage: "" });
function m(e) {
("76561198115731852" != e && "76561198115800463" != e) || c.init({ bValid: !0, stream: { "76561198115731852": "#Broadcast_Stream1", "76561198115800463": "#Broadcast_Stream2" }, name: "Counter-Strike 2 Copenhagen Major 2024", appID: 730, link: "https://store.steampowered.com/app/730/CounterStrike_2/", linkName: "Counter-Strike 2 on Steam", tabIcon: a, offlineImage: "public/images/broadcast/cs2_major2024_cph.png" }), "76561197960266962" == e && c.init({ bValid: !0, stream: {}, appName: "Winter Sale 2019", name: "Yule Log", appID: 0, link: "https://store.steampowered.com/", linkName: "View Sale Info Here!", tabIcon: s, offlineImage: "public/images/broadcast/winter_sale_2019.png" });
}
},
84678: (e, t, n) => {
"use strict";
var i, o;
n.d(t, { C7: () => r, gK: () => o }),
(function (e) {
(e[(e.Hover = 0)] = "Hover"), (e[(e.ClickPopup = 1)] = "ClickPopup"), (e[(e.ClickSurroundingRegion = 2)] = "ClickSurroundingRegion");
})(i || (i = {})),
(function (e) {
(e[(e.Chat = 0)] = "Chat"), (e[(e.Notification = 1)] = "Notification"), (e[(e.Error = 2)] = "Error");
})(o || (o = {}));
class r {}
},
84750: (e, t, n) => {
"use strict";
n.d(t, { Pw: () => s, c8: () => a, hB: () => o, zB: () => r });
const i = new (n(77385).sO)("video"),
o = (i.Info, i.Debug);
i.Error, i.Warning;
function r(e) {
let t = Math.floor(e / 3600),
n = Math.floor(e / 60) % 60,
i = Math.floor(e) % 60,
o = i.toString();
i < 10 && (o = "0" + o);
let r = n.toString();
return n < 10 && t > 0 && (r = "0" + r), (t > 0 ? t + ":" : "") + r + ":" + o;
}
function a() {
let e = !1;
try {
e = MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d4032,mp4a.40.2"');
} catch (e) {}
return e;
}
function s() {
let e = document.createElement("video").canPlayType('application/vnd.apple.mpegurl;codecs="avc1.64001f,mp4a.40.02"');
return "probably" === e || "maybe" === e;
}
},
86374: (e, t, n) => {
"use strict";
n.d(t, { Ub: () => l, bY: () => c, be: () => m, lS: () => h, rK: () => u, y$: () => d });
var i = n(27378),
o = n(93635);
const r = i.createContext(void 0),
a = r.Provider,
s = () => {
const e = i.useContext(r);
if (!e) throw new Error("called useActiveServiceTransportContext outside of ServiceTransportProvider");
return e;
};
function l(e) {
const { useStorage: t, children: n } = e;
let r, s;
"useActiveCMInterface" in e ? (s = r = e.useActiveCMInterface) : "useActiveSteamInterface" in e ? (s = e.useActiveSteamInterface) : (0, o.Z)(e, "neither useActiveCMInterface nor useActiveSteamInterface were provided");
const l = i.useMemo(() => ({ useActiveSteamInterface: s, useActiveCMInterface: r, useStorage: t }), [s, r, t]);
return i.createElement(a, { value: l }, n);
}
const c = () => s().useActiveSteamInterface().GetServiceTransport(),
m = () => s().useActiveSteamInterface().GetAnonymousServiceTransport(),
d = () => s().useStorage(),
h = () => s().useActiveSteamInterface(),
u = () => {
var e, t;
const n = null === (t = null === (e = s()) || void 0 === e ? void 0 : e.useActiveCMInterface) || void 0 === t ? void 0 : t.call(e);
if (!n) throw new Error("called useActiveCMInterface outside of ServiceTransportRoot");
return n;
};
},
24110: (e, t, n) => {
"use strict";
n.d(t, { L: () => o });
var i = n(85556);
class o {
GetObject(e) {
return (0, i.mG)(this, void 0, void 0, function* () {
try {
const t = yield this.GetString(e);
return t ? JSON.parse(t) : null;
} catch (e) {
return null;
}
});
}
StoreObject(e, t) {
return (0, i.mG)(this, void 0, void 0, function* () {
return this.StoreString(e, JSON.stringify(t));
});
}
}
},
99627: (e, t, n) => {
"use strict";
n.d(t, { Z: () => o });
var i = n(24110);
class o extends i.L {
GetString(e) {
return Promise.resolve(localStorage.getItem(e));
}
StoreString(e, t) {
return localStorage.setItem(e, t), Promise.resolve();
}
RemoveObject(e) {
return localStorage.removeItem(e), Promise.resolve();
}
}
},
82909: (e, t, n) => {
"use strict";
n.d(t, { Oo: () => s, Xh: () => c, yV: () => l });
n(95957);
var i = n(78482),
o = n(91300),
r = n(93635);
class a {
constructor() {
this.m_mapManagers = new WeakMap();
}
GetContextMenuManagerFromWindow(e) {
var t;
let n = (null === (t = null == e ? void 0 : e.ownerDocument) || void 0 === t ? void 0 : t.defaultView) || window;
return this.GetContextMenuManager(n);
}
GetContextMenuManager(e) {
let t = this.m_mapManagers.get(e);
if (!t) {
let n = e;
for (; !t && n.opener; ) (n = n.opener), (t = this.m_mapManagers.get(n));
}
return t || ((t = new i.u()), this.m_mapManagers.set(e, t)), t;
}
SetMenuManager(e, t) {
(0, r.X)(void 0 === this.m_mapManagers.get(e) || !t || e == window, `Stomping CContextMenuManager for ${e.document.title}!`), this.m_mapManagers.set(e, t);
}
RegisterChildWindow(e, t) {
return this.m_mapManagers.set(t, this.GetContextMenuManager(e)), () => this.m_mapManagers.delete(t);
}
}
const s = (0, o.Yt)("ContextMenuFactory", () => new a());
function l(e, t, n) {
let i,
o,
r,
a = t;
if ((null == a ? void 0 : a.preventDefault) && (null == a ? void 0 : a.stopPropagation)) {
if (a.shiftKey || (a.altKey && !(null == n ? void 0 : n.bRootContextMenu))) return null;
a.preventDefault(), a.stopPropagation(), (r = a.currentTarget), (i = a.clientX), (o = a.clientY);
} else r = t;
let l = s.GetContextMenuManagerFromWindow(r).CreateContextMenuInstance(e, r, i, o, n);
return l.Show(), (null == n ? void 0 : n.bCreateHidden) && l.Hide(), l;
}
function c(e, t, n, i) {
let o = s.GetContextMenuManagerFromWindow(t).CreateContextMenuInstance(e, t, n, i, { bForcePopup: !0, bScreenCoordinates: !0 });
return o.Show(), o;
}
},
95957: (e, t, n) => {
"use strict";
n.d(t, { $Y: () => l });
var i = n(85556),
o = n(79588),
r = n(88669),
a = (n(61963), n(78654));
class s {
constructor(e, t) {
(this.m_nKey = null), (this.m_bVisible = !1), (this.m_rctLabel = void 0), (this.m_timerHideMenu = 0), (this.m_elSubmenuItem = null), (this.m_timerHideSubMenu = 0), (0, o.rC)(this), (this.m_ContextMenuManager = e), (this.m_rctElement = t);
}
get Manager() {
return this.m_ContextMenuManager;
}
get key() {
return null == this.m_nKey && ((this.m_nKey = s.s_nNextKeyValue), s.s_nNextKeyValue++), this.m_nKey;
}
SetElement(e) {
this.m_element = e;
}
SetPopup(e) {
this.m_popupContextMenu = e;
}
get ReactElement() {
return this.m_rctElement;
}
get label() {
return this.m_rctLabel;
}
get submenu() {
return this.m_submenu;
}
get visible() {
return this.m_bVisible;
}
get options() {
return this.m_options;
}
get position() {
return this.m_position;
}
SetOnHideCallback(e) {
this.m_fnOnHideCallback = e;
}
Show() {
this.CancelHideMenuTimer(), (this.m_bVisible = !0), this.m_ContextMenuManager.ShowMenu(this);
}
OnCancel() {
var e;
(null === (e = this.options) || void 0 === e ? void 0 : e.onCancel) && this.options.onCancel(), this.Hide();
}
Hide(e = 0) {
e > 0
? (this.m_timerHideMenu = window.setTimeout(() => {
(this.m_timerHideMenu = 0), this.InternalHide();
}, e))
: this.InternalHide();
}
CancelHideMenuTimer() {
this.m_timerHideMenu > 0 && (clearTimeout(this.m_timerHideMenu), (this.m_timerHideMenu = 0));
}
SetPosition(e, t, n) {
(this.m_options = Object.assign(Object.assign({}, this.m_options), n)), (this.m_position.clientX = e), (this.m_position.clientY = t), (this.m_position.options = this.m_options);
}
ForceHide() {
this.InternalHide();
}
HideIfNotInFocus() {
this.BHasFocus() || this.BIsFocusInChildHierarchy() || this.Hide();
}
InternalHide() {
this.CancelHideMenuTimer(), this.m_bVisible && ((this.m_bVisible = !1), this.InternalHideSubMenu(), this.m_fnOnHideCallback && this.m_fnOnHideCallback(), this.m_ContextMenuManager.HideMenu(this));
}
SetTakeFocus(e) {
this.m_fnTakeFocus = e;
}
ShowSubMenu(e, t) {
var n;
return this.m_elSubmenuItem == e ? (this.CancelHideSubMenuTimer(), null === (n = this.m_submenu) || void 0 === n || n.TakeFocus(), null) : (this.InternalHideSubMenu(), (this.m_elSubmenuItem = e), (this.m_submenu = new c(this, t(), e, this.m_options.bForcePopup)), this.m_submenu.Show(), this.m_submenu);
}
CancelHideSubMenuTimer() {
this.m_timerHideSubMenu > 0 && (clearTimeout(this.m_timerHideSubMenu), (this.m_timerHideSubMenu = 0));
}
HideSubMenu() {
if (!this.m_submenu) return void this.CancelHideSubMenuTimer();
if (this.m_timerHideSubMenu > 0) return;
this.m_timerHideSubMenu = window.setTimeout(() => {
this.InternalHideSubMenu(), (this.m_timerHideSubMenu = 0);
}, 150);
}
OnSubMenuDismissed(e) {
this.m_submenu == e && this.InternalHideSubMenu();
}
HideSelf() {
this.m_parentInstance ? this.m_parentInstance.OnSubMenuDismissed(this) : this.InternalHide();
}
InternalHideSubMenu() {
this.CancelHideSubMenuTimer(), this.m_submenu && (this.m_submenu.m_element && this.BIsFocusInChildHierarchy() && this.TakeFocus(a.IF.k_EWindowBringToFrontAndForceOS), (this.m_elSubmenuItem = null), this.m_submenu.InternalHide(), (this.m_submenu = void 0));
}
TakeFocus(e = a.IF.k_EWindowBringToFrontAndForceOS) {
this.m_popupContextMenu && this.m_popupContextMenu.Focus(e), this.m_fnTakeFocus && this.m_fnTakeFocus();
}
BInternalElementInParentHierarchy(e) {
return null != this.m_parentInstance && (this.m_parentInstance.BIsChildElement(e) || this.m_parentInstance.BInternalElementInParentHierarchy(e));
}
BInternalElementInChildHierarchy(e) {
return null != this.m_submenu && (this.m_submenu.BIsChildElement(e) || this.m_submenu.BInternalElementInChildHierarchy(e));
}
BIsChildElement(e) {
var t;
return this.m_element ? r.ni(this.m_element, e) : r.ni(null === (t = this.m_popupContextMenu) || void 0 === t ? void 0 : t.root_element, e);
}
BHasFocus() {
var e;
return this.m_popupContextMenu ? this.m_popupContextMenu.focused : r.ni(this.m_element, null === (e = this.m_element) || void 0 === e ? void 0 : e.ownerDocument.activeElement);
}
BIsFocusInChildHierarchy() {
return null != this.m_submenu && (this.m_submenu.BHasFocus() || this.m_submenu.BIsFocusInChildHierarchy());
}
BIsElementInMenuHierarchy(e) {
return this.BInternalElementInParentHierarchy(e) || this.BInternalElementInChildHierarchy(e);
}
BIsSubMenuVisible() {
return !!this.m_submenu;
}
SetLabel(e) {
this.m_rctLabel = e;
}
}
(s.s_nNextKeyValue = 1), (0, i.gn)([o.LO], s.prototype, "m_bVisible", void 0), (0, i.gn)([o.LO.ref], s.prototype, "m_rctLabel", void 0);
class l extends s {
constructor(e, t, n, i, o, r) {
super(e, t),
(this.m_options = r || {}),
(this.m_position = {
element: n,
clientX: i,
clientY: o,
instance: this,
options: this.m_options,
fnOnMenuItemSelected: () => {
this.Hide();
},
});
}
Show() {
super.Show();
}
Hide(e = 0) {
super.Hide(e);
}
ForceHide() {
super.ForceHide();
}
BIsSubMenu() {
return !1;
}
}
class c extends s {
constructor(e, t, n, i) {
super(e.Manager, t),
(this.m_parentInstance = e),
(this.m_options = { bOverlapVertical: !0, strClassName: e.options.strClassName, bFitToWindow: e.options.bFitToWindow, bShiftToFitWindow: e.options.bShiftToFitWindow, bForcePopup: i }),
(this.m_position = {
element: n,
clientX: void 0,
clientY: void 0,
instance: this,
options: this.m_options,
fnOnMenuItemSelected: () => {
this.Hide();
},
bSubmenu: !0,
});
}
Hide() {
var e;
this.m_popupContextMenu
? window.setTimeout(() => {
var e;
null === (e = this.m_parentInstance) || void 0 === e || e.HideIfNotInFocus();
}, 10)
: null === (e = this.m_parentInstance) || void 0 === e || e.Hide();
}
ForceHide() {
var e;
null === (e = this.m_parentInstance) || void 0 === e || e.ForceHide();
}
BIsSubMenu() {
return !0;
}
}
},
78482: (e, t, n) => {
"use strict";
n.d(t, { u: () => s });
var i = n(95957),
o = n(93635),
r = n(22394),
a = n(9824);
class s {
constructor() {
(this.m_callbacksMenusChanged = new r.pB()), (this.m_rgActiveSubmenus = []), (this.m_setHiddenMenus = new Set());
}
CreateContextMenuInstance(e, t, n, o, r) {
const a = new i.$Y(this, e, t, n, o, r);
return (null == r ? void 0 : r.bCreateHidden) && (this.m_setHiddenMenus.add(a), this.m_callbacksMenusChanged.Dispatch()), a;
}
get OnMenusChanged() {
return this.m_callbacksMenusChanged;
}
HideActiveMenu() {
var e;
(null === (e = this.m_ActiveMenu) || void 0 === e ? void 0 : e.options.bRetainOnHide) ? this.m_setHiddenMenus.add(this.m_ActiveMenu) : this.m_rgActiveSubmenus.length && (this.m_rgActiveSubmenus = []), (this.m_ActiveMenu = void 0);
}
get ActiveMenu() {
return this.m_ActiveMenu;
}
GetVisibleMenus() {
return this.m_ActiveMenu ? [this.m_ActiveMenu, ...this.m_rgActiveSubmenus] : [];
}
GetHiddenMenus() {
return Array.from(this.m_setHiddenMenus);
}
GetAllMenus() {
let e;
return (e = this.m_ActiveMenu ? [this.m_ActiveMenu, ...this.m_rgActiveSubmenus, ...Array.from(this.m_setHiddenMenus)] : [...this.m_rgActiveSubmenus, ...Array.from(this.m_setHiddenMenus)]), e.sort((e, t) => e.key - t.key);
}
BShouldRenderMouseOverlay() {
return this.m_ActiveMenu && !this.m_ActiveMenu.options.bDisableMouseOverlay;
}
ShowMenu(e) {
if (e.BIsSubMenu()) this.m_rgActiveSubmenus.push(e);
else {
if (e == this.m_ActiveMenu) return;
this.m_ActiveMenu && (this.m_ActiveMenu.options.bRetainOnHide && this.m_setHiddenMenus.add(this.m_ActiveMenu), this.m_ActiveMenu.Hide()), (this.m_ActiveMenu = e), this.m_setHiddenMenus.delete(e);
}
this.m_callbacksMenusChanged.Dispatch();
}
HideMenu(e) {
e.BIsSubMenu() ? a.Zf(this.m_rgActiveSubmenus, e) && this.m_callbacksMenusChanged.Dispatch() : ((0, o.X)(e == this.m_ActiveMenu, "Call to hide inactive menu"), e == this.m_ActiveMenu && (this.HideActiveMenu(), this.m_callbacksMenusChanged.Dispatch()));
}
ReleaseHiddenMenu(e) {
this.m_setHiddenMenus.delete(e);
}
}
},
90729: (e, t, n) => {
"use strict";
n.d(t, { AN: () => s });
var i = n(37634),
o = n(88669);
class r {
constructor(e) {
this.instance = new a(e, !1);
}
}
class a {
constructor(e, t = !0) {
(this.m_container = null), (this.m_parent = e), (this.m_window = e.ownerDocument.defaultView), (this.m_bRemoveOnHide = t);
}
Show(e, t) {
return (
this.CancelShowInterval(),
t
? new Promise((n, i) => {
this.iIntervalShow = this.m_window.setTimeout(() => {
let t = this.m_parent.ownerDocument;
t.defaultView && !t.defaultView.closed && (this.InternalShow(e), n());
}, t);
})
: (this.InternalShow(e), Promise.resolve())
);
}
InternalShow(e) {
this.m_container || ((this.m_container = this.m_parent.ownerDocument.createElement("div")), this.m_parent.appendChild(this.m_container)), this.m_reactRoot || (this.m_reactRoot = i.s(this.m_container)), this.m_reactRoot.render(e);
}
Hide(e) {
this.CancelShowInterval(),
e
? (this.iIntervalShow = this.m_window.setTimeout(() => {
this.InternalHide();
}, e))
: this.InternalHide();
}
InternalHide() {
this.m_reactRoot && (this.m_reactRoot.unmount(), (this.m_reactRoot = void 0)), this.m_container && this.m_bRemoveOnHide && (this.m_parent.removeChild(this.m_container), (this.m_container = null));
}
CancelShowInterval() {
void 0 !== this.iIntervalShow && (this.m_window.clearInterval(this.iIntervalShow), (this.iIntervalShow = void 0));
}
BIsChildElement(e) {
return this.m_container && o.ni(this.m_container, e);
}
}
class s {
constructor(e) {
(this.m_mapEmbeddedHovers = new WeakMap()), (this.m_strUniqueID = e);
}
ShowElementDelayed(e, t, n, i) {
let o = this.GetEmbeddedElement(e);
return (o.activeObject = i), o.instance.Show(n, t);
}
ShowElement(e, t, n) {
let i = this.GetEmbeddedElement(e);
(i.activeObject = n), i.instance.Show(t);
}
HideElement(e, t, n) {
let i = this.GetEmbeddedElement(e);
i.activeObject == t && ((i.activeObject = void 0), i.instance.Hide(n));
}
GetEmbeddedElement(e) {
let t = this.m_mapEmbeddedHovers.get(e);
return t || ((t = new r(e.body)), this.m_mapEmbeddedHovers.set(e, t)), t;
}
}
},
33690: (e, t, n) => {
"use strict";
n.d(t, { _9: () => I, Rt: () => E, K3: () => D, x1: () => w, eL: () => g, iJ: () => C, sB: () => b, AN: () => A, Wy: () => y });
var i = n(85556),
o = n(79588),
r = n(27378),
a = n(88669),
s = n(97063),
l = n(8568),
c = n(78654),
m = n(34294),
d = n(84290),
h = n(10553),
u = n(93635),
p = n(9824);
class _ {
constructor(e, t, n) {
if (((this.m_rgLoadingLinks = []), (this.m_rgLoadingLinks = []), n)) for (let e = 0; e < n.length; e++) this.AddLink(n[e], !0);
else {
let t = e.getElementsByTagName("link");
for (let e = 0; e < t.length; e++) {
let n = t[e];
this.AddLink(n, !1);
}
}
}
AddLink(e, t) {
if (t) {
let t = !1;
try {
(e.sheet && e.sheet.cssRules && 0 != e.sheet.cssRules.length) || (t = !0);
} catch (e) {}
t && (e.addEventListener("load", this.OnLinkLoad), this.m_rgLoadingLinks.push(e));
} else e.addEventListener("load", this.OnLinkLoad), this.m_rgLoadingLinks.push(e);
}
SetTarget(e) {
(this.m_fnRender = e), 0 == this.m_rgLoadingLinks.length && (this.m_fnRender(), (this.m_fnRender = void 0));
}
OnLinkLoad(e) {
var t;
e.currentTarget.removeEventListener("load", this.OnLinkLoad), p.Zf(this.m_rgLoadingLinks, e.currentTarget), 0 == this.m_rgLoadingLinks.length && (null === (t = this.m_fnRender) || void 0 === t || t.call(this), (this.m_fnRender = void 0));
}
}
(0, i.gn)([l.a], _.prototype, "OnLinkLoad", null);
var g,
C,
f = n(91300),
v = n(57476);
function S() {
return (0, h.Me)() ? g.BackgroundTransparent : g.None;
}
function b(e) {
let t = g.None;
switch (e) {
case C.Overlay:
return (t |= g.AlwaysOnTop), (t |= g.NoTaskbarIcon), (t |= g.NotFocusable), t;
case C.Notification:
return (t |= b(C.Overlay)), (t |= g.NoWindowShadow), (t |= g.NoRoundedCorners), (t |= g.OverrideRedirect), t;
case C.Tooltip:
return (t |= b(C.Overlay)), (t |= g.NoRoundedCorners), (t |= g.NoWindowShadow), (t |= g.TooltipHint), (t |= S()), t;
case C.PopupContextMenu:
return (t |= g.NoTaskbarIcon), (t |= g.NoRoundedCorners), (t |= g.NoWindowShadow), (t |= g.PopUpMenuHint), (t |= S()), t;
case C.StandaloneContextMenu:
return (t = g.NoTaskbarIcon), (t |= g.NoRoundedCorners), (t |= g.NoWindowShadow), (t |= g.OverrideRedirect), (t |= S()), t;
}
}
!(function (e) {
(e[(e.None = 0)] = "None"),
(e[(e.Minimized = 1)] = "Minimized"),
(e[(e.Hidden = 2)] = "Hidden"),
(e[(e.TooltipHint = 4)] = "TooltipHint"),
(e[(e.NoTaskbarIcon = 8)] = "NoTaskbarIcon"),
(e[(e.Resizable = 16)] = "Resizable"),
(e[(e.ScalePosition = 32)] = "ScalePosition"),
(e[(e.ScaleSize = 64)] = "ScaleSize"),
(e[(e.Maximized = 128)] = "Maximized"),
(e[(e.BackgroundTransparent = 256)] = "BackgroundTransparent"),
(e[(e.NotFocusable = 512)] = "NotFocusable"),
(e[(e.FullScreen = 1024)] = "FullScreen"),
(e[(e.Fullscreen_Exclusive = 2048)] = "Fullscreen_Exclusive"),
(e[(e.ApplyBrowserScaleToDimensions = 4096)] = "ApplyBrowserScaleToDimensions"),
(e[(e.AlwaysOnTop = 8192)] = "AlwaysOnTop"),
(e[(e.NoWindowShadow = 16384)] = "NoWindowShadow"),
(e[(e.NoMinimize = 32768)] = "NoMinimize"),
(e[(e.PopUpMenuHint = 65536)] = "PopUpMenuHint"),
(e[(e.IgnoreSavedSize = 131072)] = "IgnoreSavedSize"),
(e[(e.NoRoundedCorners = 262144)] = "NoRoundedCorners"),
(e[(e.ForceRoundedCorners = 524288)] = "ForceRoundedCorners"),
(e[(e.OverrideRedirect = 1048576)] = "OverrideRedirect"),
(e[(e.IgnoreSteamDisplayScale = 2097152)] = "IgnoreSteamDisplayScale");
})(g || (g = {})),
(function (e) {
(e[(e.Overlay = 0)] = "Overlay"), (e[(e.Notification = 1)] = "Notification"), (e[(e.Tooltip = 2)] = "Tooltip"), (e[(e.PopupContextMenu = 3)] = "PopupContextMenu"), (e[(e.StandaloneContextMenu = 4)] = "StandaloneContextMenu");
})(C || (C = {}));
const I = r.createContext({ ownerWindow: window }),
y = () => r.useContext(I);
function E(e) {
const { ownerWindow: t, children: n } = e,
i = r.useMemo(() => ({ ownerWindow: t }), [t]);
return r.createElement(I.Provider, { value: i }, n);
}
class D {
constructor(e, t) {
(this.m_bCreated = !1), (this.m_onCreateRender = null), (this.m_bFocused = !1), (0, o.rC)(this), (0, u.X)(e, "Name is required. This is an internal name, different from title."), (this.m_strName = e);
const { title: n, eCreationFlags: r } = t,
a = (0, i._T)(t, ["title", "eCreationFlags"]);
(this.m_rgParams = Object.assign(Object.assign({}, a), { eCreationFlags: null != r ? r : 0 })), this.m_rgParams.target_browser && (this.m_strName += "_uid" + this.m_rgParams.target_browser.m_unPID), (this.m_bCreateHidden = !!(this.m_rgParams.eCreationFlags & g.Hidden)), (this.m_strTitle = n);
}
UpdateParamsBeforeShow(e) {
return e;
}
OnDrop(e) {
console.log("Ignoring drop onto toplevel window", e), e.preventDefault(), e.stopPropagation();
}
OnDragOver(e) {
e.preventDefault(), (e.dataTransfer.dropEffect = "none"), e.stopPropagation();
}
OnMessage(e) {
"window_moved" == e.data && this.OnResize(), "popup-created" == e.data && this.OnCreateInternal();
}
Show(e = c.IF.k_EWindowBringToFrontAndForceOS) {
var t, n;
let i;
(i = "boolean" == typeof e ? (e ? c.IF.k_EWindowBringToFrontAndForceOS : c.IF.k_EWindowBringToFrontInvalid) : e), window.SteamClient && (this.m_rgParams.eCreationFlags |= g.Hidden), this.m_rgParams.eCreationFlags & g.NotFocusable && (i = c.IF.k_EWindowBringToFrontInvalid), this.BIsValid() && (this.BIsClosed() ? ((this.m_popup = void 0), (this.m_element = void 0)) : i != c.IF.k_EWindowBringToFrontInvalid && this.Focus(i));
let o,
r,
a,
s = A.GetExistingPopup(this.m_strName);
(s && !this.m_rgParams.replace_existing_popup) ||
((this.m_rgParams = this.UpdateParamsBeforeShow(this.m_rgParams)),
s ? ((r = s.m_element), (o = s.m_popup), s.ReleasePopup(), (a = s.m_renderWhenReady), A.RemoveTrackedPopup(s), null == o || o.removeEventListener("beforeunload", s.OnBeforeUnloadEvent), null == o || o.removeEventListener("unload", s.OnUnload), null == o || o.removeEventListener("resize", s.OnResizeEvent), null == o || o.removeEventListener("focus", this.OnFocusInternal), null == o || o.removeEventListener("blur", this.OnBlurInternal), null == o || o.removeEventListener("drop", s.OnDrop), null == o || o.removeEventListener("dragover", s.OnDragOver), null == o || o.removeEventListener("message", this.OnMessage)) : (({ popup: o, element: r } = R.CreatePopup(this.m_strName, Object.assign(Object.assign({}, this.m_rgParams), { title: this.m_strTitle }))), (a = new _(o.document, r))),
o && r && ((o.document.title = this.m_strTitle), o.addEventListener("beforeunload", this.OnBeforeUnloadEvent), o.addEventListener("unload", this.OnUnload), o.addEventListener("resize", this.OnResizeEvent), o.addEventListener("focus", this.OnFocusInternal), o.addEventListener("blur", this.OnBlurInternal), o.addEventListener("drop", this.OnDrop), o.addEventListener("dragover", this.OnDragOver), o.addEventListener("message", this.OnMessage), h.De.LANGUAGE && o.document.documentElement.setAttribute("lang", null !== (t = (0, d.CE)()) && void 0 !== t ? t : ""), (this.m_popup = o), (this.m_element = r), (this.m_renderWhenReady = a), null === (n = this.m_renderWhenReady) || void 0 === n || n.SetTarget(() => this.RenderInternal(this.m_popup, this.m_element, i))),
A.AddTrackedPopup(this),
s && (this.OnCreateInternal(), i != c.IF.k_EWindowBringToFrontInvalid && this.Focus(i)));
}
RemoveEventListeners() {
var e, t, n, i, o, r, a, s;
null === (e = this.window) || void 0 === e || e.removeEventListener("beforeunload", this.OnBeforeUnloadEvent), null === (t = this.window) || void 0 === t || t.removeEventListener("unload", this.OnUnload), null === (n = this.window) || void 0 === n || n.removeEventListener("resize", this.OnResizeEvent), null === (i = this.window) || void 0 === i || i.removeEventListener("focus", this.OnFocusInternal), null === (o = this.window) || void 0 === o || o.removeEventListener("blur", this.OnBlurInternal), null === (r = this.window) || void 0 === r || r.removeEventListener("drop", this.OnDrop), null === (a = this.window) || void 0 === a || a.removeEventListener("dragover", this.OnDragOver), null === (s = this.window) || void 0 === s || s.removeEventListener("message", this.OnMessage);
}
RenderInternal(e, t, n) {
this.m_bCreated ? (this.browser_info && (0, m.Su)(this.browser_info.m_eBrowserType) && (t.ownerDocument.body.className += " VR"), this.Render(e, t), this.OnLoad(), e.SteamClient && !this.m_bCreateHidden && (n != c.IF.k_EWindowBringToFrontInvalid ? e.SteamClient.Window.BringToFront(n) : e.SteamClient.Window.ShowWindow())) : (this.m_onCreateRender = () => this.RenderInternal(e, t, n));
}
OnCreateInternal() {
this.m_bCreated || ((this.m_bCreated = !0), this.OnCreate(), this.m_onCreateRender && (this.m_onCreateRender(), (this.m_onCreateRender = null)));
}
OnCreate() {}
OnResizeEvent() {
this.OnResize();
}
OnBeforeUnloadEvent() {
this.OnBeforeUnload();
}
OnUnload(e) {
this.RemoveEventListeners(), A.RemoveTrackedPopup(this), this.OnClose(), (this.m_popup = void 0);
}
get browser_info() {
return this.m_rgParams.target_browser;
}
get window() {
return this.m_popup;
}
get root_element() {
return this.m_element;
}
get title() {
return this.m_strTitle;
}
set title(e) {
(this.m_strTitle = e), this.m_popup && (this.m_popup.document.title = this.m_strTitle);
}
get params() {
return this.m_rgParams;
}
Focus(e = c.IF.k_EWindowBringToFrontAndForceOS) {
e != c.IF.k_EWindowBringToFrontInvalid && (this.m_popup && void 0 !== this.m_popup.SteamClient && void 0 !== this.m_popup.SteamClient.Window ? this.m_popup.SteamClient.Window.BringToFront(e) : this.m_popup && this.m_popup.focus());
}
Close() {
this.m_popup && ((0, v.w3)(this.m_popup.window, "Window.Close") ? this.m_popup.window.SteamClient.Window.Close() : this.m_popup.window.close());
}
GetName() {
return this.m_strName;
}
BIsValid() {
return !!this.m_popup;
}
BIsClosed() {
return !this.m_popup || this.m_popup.closed;
}
BIsVisible() {
return !(!this.m_popup || this.m_popup.closed || "visible" != this.m_popup.document.visibilityState);
}
BIsFocused() {
var e;
return this.BIsVisible() && !!(null === (e = this.m_popup) || void 0 === e ? void 0 : e.document.hasFocus());
}
OnFocusInternal() {
this.m_popup && this.m_popup.document.body.classList.add("WindowFocus"), (this.m_bFocused = !0), this.OnFocus();
}
OnBlurInternal() {
this.m_popup && this.m_popup.document.body.classList.remove("WindowFocus"), (this.m_bFocused = !1), this.OnBlur();
}
get focused() {
return this.m_bFocused;
}
GetWindowRestoreDetails() {
return (0, v.w3)(this.m_popup, "Window.GetWindowRestoreDetails") && !this.m_popup.closed ? this.m_popup.SteamClient.Window.GetWindowRestoreDetails() : Promise.resolve("");
}
IsMinimized() {
return (0, v.w3)(this.m_popup, "Window.IsWindowMinimized") && !this.m_popup.closed ? this.m_popup.SteamClient.Window.IsWindowMinimized() : Promise.resolve(!1);
}
IsMaximized() {
return (0, v.w3)(this.m_popup, "Window.IsWindowMaximized") && !this.m_popup.closed ? this.m_popup.SteamClient.Window.IsWindowMaximized() : Promise.resolve(!1);
}
ReleasePopup() {
this.OnClose(), (this.m_popup = null);
}
OnResize() {
this.IsMaximized().then((e) => {
var t, n;
e ? null === (t = this.m_popup) || void 0 === t || t.document.body.classList.add("Maximized") : null === (n = this.m_popup) || void 0 === n || n.document.body.classList.remove("Maximized");
});
}
OnBeforeUnload() {}
OnFocus() {}
OnBlur() {}
}
(0, i.gn)([o.LO], D.prototype, "m_bFocused", void 0), (0, i.gn)([l.a], D.prototype, "OnMessage", null), (0, i.gn)([l.a], D.prototype, "RenderInternal", null), (0, i.gn)([l.a], D.prototype, "OnCreateInternal", null), (0, i.gn)([l.a], D.prototype, "OnResizeEvent", null), (0, i.gn)([l.a], D.prototype, "OnBeforeUnloadEvent", null), (0, i.gn)([l.a], D.prototype, "OnUnload", null), (0, i.gn)([l.a], D.prototype, "OnFocusInternal", null), (0, i.gn)([l.a], D.prototype, "OnBlurInternal", null);
class w extends D {
constructor(e, t, n, i) {
super(e, n), this.SetSavedDimensionsKey(t), (this.m_bExpires = i);
}
BIsInOverlay() {
return this.browser_info && 0 != this.browser_info.m_unPID && -1 != this.browser_info.m_nBrowserID;
}
SetSavedDimensionsKey(e) {
this.m_strSavedDimensionsKey = e;
}
UpdateParamsBeforeShow(e) {
return !this.m_strSavedDimensionsKey || e.bIgnoreSavedDimensions || e.strRestoreDetails ? e.strRestoreDetails && ((this.m_strInitialSavedDimensionsKey = this.GetSavedDimensionsKey()), A.SetRestoreDetails(this.m_strInitialSavedDimensionsKey, e.strRestoreDetails, this.m_bExpires)) : ((this.m_strInitialSavedDimensionsKey = this.GetSavedDimensionsKey()), (e.strRestoreDetails = A.GetRestoreDetails(this.m_strInitialSavedDimensionsKey))), e;
}
OnLoad() {
this.GetWindowRestoreDetails().then((e) => {
(this.m_strInitialRestoreDetails = e), this.OnResizeComplete(e);
});
}
OnResize() {
super.OnResize(), this.QueryAndStoreWindowPosition();
}
OnResizeComplete(e) {}
QueryAndStoreWindowPosition() {
var e;
if (this.m_strInitialRestoreDetails) {
let t = this.GetSavedDimensionsKey();
null === (e = this.m_popup) ||
void 0 === e ||
e.setTimeout(() => {
this.GetWindowRestoreDetails().then((e) => {
let n = this.m_rgParams.strRestoreDetails == e && t == this.m_strInitialSavedDimensionsKey;
this.m_popup && this.m_strSavedDimensionsKey && e && !n && (A.SetRestoreDetails(t, e, this.m_bExpires), (this.m_rgParams.strRestoreDetails = e), (this.m_strInitialSavedDimensionsKey = t), this.OnResizeComplete(e));
});
}, 30);
}
}
OnBeforeUnload() {
this.QueryAndStoreWindowPosition(), super.OnBeforeUnload();
}
OnClose() {}
SaveWindowPosition(e) {
A.SetRestoreDetails(this.GetSavedDimensionsKey(), e, !1), (this.m_rgParams.strRestoreDetails = e);
}
}
(0, i.gn)([l.a], w.prototype, "QueryAndStoreWindowPosition", null);
class R {
constructor() {
if (((this.m_bShuttingDown = !1), (this.m_mapPopups = o.LO.map([], { deep: !1 })), (this.m_rgShutdownCallbacks = []), (this.m_rgPopupCreatedCallbacks = []), (this.m_unCurrentAccountID = 0), (this.m_mapRestoreDetails = new Map()), (this.m_bSaveRequired = !1), !{ NODE_ENV: "production", STEAM_BUILD: "buildbot", VALVE_BUILD: "false" }.MOBILE_BUILD && "addEventListener" in window)) {
window.addEventListener("beforeunload", (e) => {
var t, n, i, o;
this.m_bShuttingDown = !0;
for (let e of this.m_rgShutdownCallbacks) e();
let r = [];
this.m_mapPopups.forEach((e) => {
e.BIsValid() && !e.BIsClosed() && r.push(e);
});
for (let e of r) (null === (n = null === (t = e.window) || void 0 === t ? void 0 : t.SteamClient.Browser) || void 0 === n ? void 0 : n.SetShouldExitSteamOnBrowserClosed) && e.window.SteamClient.Browser.SetShouldExitSteamOnBrowserClosed(!1), (null === (i = e.window) || void 0 === i ? void 0 : i.SteamClient.Window.SetHideOnClose) && (null === (o = e.window) || void 0 === o || o.SteamClient.Window.SetHideOnClose(!1)), e.Close();
this.m_bSaveRequired && this.SaveSavedDimensionStore(), this.m_mapPopups.clear();
});
let e = document.querySelector("head");
(0, u.X)(e, "Couldn't find head element"),
e &&
((this.m_DynamicCSSObserver = new MutationObserver(() => {
const e = a.Mv();
this.m_mapPopups.forEach((t) => {
a.b$(t.window.document, e, !1);
});
})),
this.m_DynamicCSSObserver.observe(e, { childList: !0 }));
}
}
BAnyPopupHasFocus() {
for (const e of this.m_mapPopups.values()) if (e.focused) return !0;
return !1;
}
BAnyMenuHasFocus() {
var e;
for (const t of this.m_mapPopups.values()) if (t.focused && (null !== (e = t.params.eCreationFlags) && void 0 !== e ? e : 0) & g.NoTaskbarIcon) return !0;
return !1;
}
SetCurrentLoggedInAccountID(e) {
this.m_unCurrentAccountID != e && ((this.m_unCurrentAccountID = e), e ? this.LoadSavedDimensionStore() : this.ClearSavedDimensionStore());
}
AddShutdownCallback(e) {
this.m_rgShutdownCallbacks.push(e);
}
AddPopupCreatedCallback(e) {
this.m_rgPopupCreatedCallbacks.push(e);
}
AddTrackedPopup(e) {
this.m_mapPopups.set(e.GetName(), e);
for (let t of this.m_rgPopupCreatedCallbacks) t(e);
}
RemoveTrackedPopup(e) {
this.m_mapPopups.delete(e.GetName());
}
GetExistingPopup(e) {
return this.m_mapPopups.get(e);
}
GetPopups() {
return this.m_mapPopups.values();
}
GetPopupForWindow(e) {
for (const t of this.m_mapPopups.values()) if (t.window === e) return t;
}
ClosePopupsOwnedByBrowser(e) {
this.m_mapPopups.forEach((t) => {
t.browser_info && t.browser_info.m_nBrowserID == e.m_nBrowserID && t.browser_info.m_unPID == e.m_unPID && t.Close();
});
}
static CreatePopup(e, t) {
let n = t.dimensions || {},
i = n.width || 300,
o = n.height || 300,
r = t.title,
s = "width=" + i + ",height=" + o;
void 0 !== n.left && (s += ",left=" + n.left), void 0 !== n.top && (s += ",top=" + n.top), (s += ",resizeable,status=0,toolbar=0,menubar=0,location=0");
let l = "about:blank",
c = [];
c.push("createflags=" + t.eCreationFlags),
t.minWidth && c.push("minwidth=" + t.minWidth),
t.minHeight && c.push("minheight=" + t.minHeight),
t.maxWidth && t.maxWidth != 1 / 0 && c.push("maxwidth=" + t.maxWidth),
t.maxHeight && t.maxHeight != 1 / 0 && c.push("maxheight=" + t.maxHeight),
t.target_browser ? (c.push("pid=" + t.target_browser.m_unPID), c.push("browser=" + t.target_browser.m_nBrowserID), t.target_browser.m_eBrowserType ? c.push("browserType=" + t.target_browser.m_eBrowserType) : t.browserType && c.push("browserType=" + t.browserType), t.availscreenwidth && t.availscreenheight && (c.push("screenavailwidth=" + t.availscreenwidth), c.push("screenavailheight=" + t.availscreenheight))) : t.browserType && c.push("browserType=" + t.browserType),
t.strVROverlayKey && c.push("vrOverlayKey=" + t.strVROverlayKey),
t.strRestoreDetails && c.push("restoredetails=" + t.strRestoreDetails),
t.window_opener_id && c.push("openerid=" + t.window_opener_id),
t.parent_container_popup_id && c.push("parentcontainerpopupid=" + t.parent_container_popup_id),
t.center_on_window && void 0 === n.left && void 0 === n.top && c.push("centerOnBrowserID=" + t.center_on_window.SteamClient.Browser.GetBrowserID()),
t.strUserAgent && c.push("useragent=" + t.strUserAgent),
t.hwndParent && c.push("hwndParent=" + t.hwndParent),
t.bPinned && c.push("pinned=true"),
t.bModal && c.push("modal=true"),
c && (l += "?" + c.join("&"));
let m = (t.owner_window || window).open(l, e, s);
if (!m) return console.error(`Failed to create popup, browser/CEF may be blocking popups for "${window.location.origin}"`), {};
let d = "";
t.html_class && (d = `class="${t.html_class}"`);
let h = "";
t.body_class && (h = `class="${t.body_class}"`);
let u = "";
t.popup_class && (u = `class="${t.popup_class}"`);
let p = `