Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
n; function i(t) { var n; ..
Decoded Output download
<? n;
function i(t) {
var n;
return (n = e.call(this, t) || this).createButtonClickHandler = function(e) {
return function() {
(0, l.L9)(332, {
element: e ? 67 : 629,
parent_element: 1273
}),
p.Z.updatePrivateDetectorStatus(n.props.chatInstanceId, e).then((function() {
n.setState({
isVisible: !1
})
}))
}
}, n.state = {
isVisible: !0
}, n
}
return n = e, (t = i).prototype = Object.create(n.prototype), t.prototype.constructor = t, Fc(t, n), i.prototype.render = function() {
return (0, _.jsx)(Nn.Z, {
isVisible: this.state.isVisible,
isDismissible: !1,
onAnimationOutComplete: this.props.onAnimationOutComplete,
isPadded: !0,
hasDefaultDismissButton: !1,
children: (0, _.jsx)(Bc, {
headerText: g.ZP.get(4),
text: g.ZP.get(3, {
name: this.props.name
}),
acceptButtonText: g.ZP.get(1),
cancelButtonText: g.ZP.get(2),
onAcceptButtonClick: this.createButtonClickHandler(!0),
onCancelButtonClick: this.createButtonClickHandler(!1)
})
})
}, i
}(i.Component),
Vc = n(60823),
qc = function(e) {
var t = e.headerText,
n = e.text,
i = e.additionalText,
o = e.betweenButtonsText,
r = e.mediaImageSrc,
s = e.primaryButton,
a = e.secondaryButton,
c = e.dismissButton,
l = e.isLoading;
return (0, _.jsxs)(xo.Z, {
isCompact: !0,
align: "start",
dataQA: {
"data-qa": "read_receipts_modal"
},
children: [(0, _.jsx)(So.Z, {
children: (0, _.jsx)(ei.Z, {
badge: {
icon: {
name: "badge-feature-read-receipt"
}
},
image: {
src: r
},
shape: "circle",
size: "md"
})
}), (0, _.jsx)(_o.Z, {
text: t,
tag: "h2"
}), (0, _.jsx)(Co.Z, {
text: n
}), (0, _.jsxs)(jo.Z, {
children: [(0, _.jsx)(ko.Z, {
text: s.buttonText,
onClick: s.onClick,
styling: "revenue",
isLoading: l,
isDisabled: l,
dataQA: s.dataQA,
semantic: o ? "secondary" : "primary"
}), o ? (0, _.jsx)(Da.Z, {
text: o
}) : null, a ? (0, _.jsx)(ko.Z, {
text: a.buttonText,
icon: a.icon,
styling: a.styling,
onClick: a.onClick,
dataQA: a.dataQA
}) : null, (0, _.jsx)(ko.Z, {
text: c.buttonText,
icon: c.icon,
styling: c.styling,
semantic: "tertiary",
onClick: c.onClick,
dataQA: c.dataQA
})]
}), i ? (0, _.jsx)(xa.Z, {
children: (0, _.jsx)(Sa.Z, {
children: i
})
}) : null]
})
};
function Hc(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function Yc(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? Hc(Object(n), !0).forEach((function(t) {
Qc(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Hc(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function Qc(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
function Wc(e, t, n) {
void 0 === n && (n = {}),
new Ee.ZP(278, {
promo_banner_stats: Yc({
event: e,
context: t.context,
promo_block_type: t.promo_block_type,
promo_block_position: t.promo_block_position
}, n)
}).request()
}
var zc = function(e) {
return (0, i.useEffect)((function() {
var t;
-1 !== (null == e || null == (t = e.stats_required) ? void 0 : t.indexOf(2)) && Wc(2, e)
}), [e]), {
trackShow: function() {
var t;
-1 !== (null == e || null == (t = e.stats_required) ? void 0 : t.indexOf(2)) && Wc(2, e)
},
trackDismiss: function() {
var t;
-1 !== (null == e || null == (t = e.stats_required) ? void 0 : t.indexOf(4)) && Wc(4, e)
},
trackClick: function(t) {
var n;
-1 !== (null == e || null == (n = e.stats_required) ? void 0 : n.indexOf(1)) && Wc(1, e, t)
}
}
};
function Kc(e, t) {
var n;
return {
buttonText: e.text,
icon: 75 === (null == (n = e.icon) ? void 0 : n.badge_type) ? "generic-premium-plus" : void 0,
dataQA: 47 === e.product_type ? {
"data-qa": "premium-plus-button"
} : void 0,
onClick: t
}
}
var Jc = function(e) {
var t,
n,
o,
r,
s,
c = e.promo,
u = e.chatUser,
d = e.chatInstanceId,
p = e.onAnimationOutComplete,
h = e.onPaymentSuccess,
m = (0, i.useState)(!0),
f = m[0],
g = m[1],
v = (0, i.useState)(!1),
b = v[0],
x = v[1],
S = zc(c),
C = S.trackDismiss,
j = S.trackClick;
(0, i.useEffect)((function() {
f && (0, l.L9)(138, {
banner_id: 463,
position_id: 18,
context: 10
})
}), [f]);
var P = null == (t = c.buttons) ? void 0 : t.find((function(e) {
return 1 === e.type
})),
k = null == (n = c.buttons) ? void 0 : n.find((function(e) {
return 2 === e.type
})),
Z = null == (o = c.buttons) ? void 0 : o.find((function(e) {
return 4 === e.type
}));
463 === c.promo_block_type && (Z = k, k = void 0);
var E = null == (r = c.extra_texts) || null == (r = r.find((function(e) {
return 11 === e.type
}))) ? void 0 : r.text;
return (0, _.jsx)(Nn.Z, {
isVisible: f,
isDismissible: !1,
onAnimationOutComplete: p,
isPadded: !0,
children: (0, _.jsx)(qc, {
headerText: c.header,
text: c.mssg,
additionalText: c.credits_cost,
betweenButtonsText: E,
mediaImageSrc: y.Z.getImageUrlForSize(null == (s = u.profile_photo) ? void 0 : s.large_url, 100, 100),
primaryButton: {
buttonText: null == P ? void 0 : P.text,
onClick: function() {
x(!0),
j(),
(0, l.L9)(139, {
banner_id: c.promo_block_type,
position_id: c.promo_block_position,
context: 10,
call_to_action_type: 1
}),
za.Z.purchase({
back: a.Z.getUrl(),
cost: c.payment_amount,
hotPanelData: {
activationPlace: 11,
bannerId: 463,
product: 47,
cost: c.payment_amount
},
productType: c.ok_payment_product_type,
purchaseTransactionSetup: {
promoBlockType: c.promo_block_type
},
userId: d,
success: h,
error: function(e) {
M.Z.showNotification({
text: e,
type: M.Z.TYPES.ERROR
}),
g(!1),
x(!1)
}
})
},
dataQA: {
"data-qa": "accept-button"
}
},
secondaryButton: k ? Kc(k, (function() {
var e;
j(),
(0, l.L9)(139, {
banner_id: c.promo_block_type,
position_id: c.promo_block_position,
context: 10,
call_to_action_type: 2
}),
Ps.Z.navigateToPayment({
back: a.Z.getUrl(),
hotPanelData: {
activationPlace: 11,
promoBlockType: c.promo_block_type
},
productToActivate: c.ok_payment_product_type,
productType: null == (e = k) ? void 0 : e.product_type,
promoBlockType: c.promo_block_type,
userId: u.user_id
})
})) : void 0,
dismissButton: {
buttonText: Z.text,
onClick: function() {
var e;
C(),
(0, l.L9)(139, {
banner_id: c.promo_block_type,
position_id: c.promo_block_position,
context: 10,
call_to_action_type: null == (e = Z) ? void 0 : e.type
}),
g(!1)
},
dataQA: {
"data-qa": "decline-button"
}
},
isLoading: b
})
})
},
Xc = n(35988),
$c = n(27503),
el = function(e) {
var t = e.question,
n = e.onClickGetQuestion,
o = e.onClickSendQuestion,
r = e.onClickClose,
s = e.onAnimationInComplete,
a = e.onAnimationOutComplete,
c = (0, i.useState)(!0),
l = c[0],
u = c[1];
return (0, _.jsx)(Nn.Z, {
isVisible: l,
onDismiss: r,
onAnimationInComplete: s,
onAnimationOutComplete: a,
hasDefaultDismissButton: !1,
children: (0, _.jsxs)("div", {
className: "questions-game",
children: [(0, _.jsx)("div", {
className: "questions-game__header",
children: (0, _.jsx)(Ge.P2, {
align: "center",
color: "black",
children: g.ZP.get(115)
})
}), (0, _.jsx)("div", {
className: "questions-game__question",
children: (0, _.jsx)(Ge.R6, {
align: "center",
color: "black",
dangerous: !0,
children: t
})
}), (0, _.jsx)("div", {
className: "questions-game__button",
children: (0, _.jsxs)(Ea.Z, {
children: [(0, _.jsx)($c.Z, {
icon: "generic-spinning-arrows",
text: g.ZP.get(113),
styling: "transparent",
onClick: n
}), (0, _.jsx)(ko.Z, {
icon: "generic-send",
text: g.ZP.get(114),
onClick: function() {
o(),
u(!1)
},
dataQA: {
"data-qa": "action-send"
}
}), (0, _.jsx)(ko.Z, {
text: g.ZP.get(247),
onClick: function() {
r(),
u(!1)
},
semantic: "tertiary",
dataQA: {
"data-qa": "modal-close"
}
})]
})
})]
})
})
},
tl = function(e) {
var t,
n,
o,
r,
s = e.userGender,
a = e.chatUserGender,
c = e.chatUserName,
l = e.isReceiver,
u = e.onClose,
d = e.onAnimationInComplete,
p = (0, i.useState)(!0),
h = p[0],
m = p[1],
f = (0, i.useState)("close"),
v = f[0],
b = f[1],
y = function(e) {
e && b("continue"),
m(!1)
};
return l ? (t = g.ZP.get(111, {
str: c
}), n = g.ZP.get(109, {
me: Oe.N5.for("me", s),
other_user: Oe.N5.for("other_user", a)
}), o = g.ZP.get(107), r = y) : (t = g.ZP.get(112), n = g.ZP.get(110, {
name: c
}), o = g.ZP.get(108), r = function() {
return y(!0)
}), (0, _.jsx)(Nn.Z, {
isVisible: h,
onAnimationInComplete: d,
onAnimationOutComplete: function() {
return u(v)
},
isPadded: !0,
children: (0, _.jsxs)(xo.Z, {
isCompact: !0,
align: "start",
children: [(0, _.jsx)(So.Z, {
size: "icon",
children: (0, _.jsx)(Ye.Z, {
name: "badge-feature-questions-game"
})
}), (0, _.jsx)(_o.Z, {
text: t,
tag: "h2"
}), (0, _.jsx)(Co.Z, {
text: n
}), (0, _.jsx)(jo.Z, {
children: (0, _.jsx)(ko.Z, {
narrow: !0,
text: o,
onClick: r
})
})]
})
})
},
nl = n(73541),
il = n(365),
ol = n(79429),
rl = n(29977),
sl = function(e) {
var t,
n = e.chatUserName,
o = e.chatUserGender,
r = e.question,
s = e.altNavigation,
a = e.isInstant,
c = e.isMessageFromCurrentUser,
l = e.onFocusInput,
u = e.onBlurInput,
d = e.onClickClose,
p = e.onClickSend,
h = e.onAnimationInComplete,
m = e.onAnimationOutComplete,
f = e.appear,
v = void 0 === f || f,
b = (0, i.useRef)(null),
y = g.ZP.get(98),
x = g.ZP.get(97),
C = (0, i.useRef)(new nl.Z),
j = (0, i.useRef)(null),
P = (0, i.useState)(!0),
k = P[0],
Z = P[1],
E = (0, i.useState)(!1),
O = E[0],
T = E[1],
I = (0, i.useState)(""),
w = I[0],
A = I[1],
N = (0, i.useState)(""),
R = N[0],
M = N[1];
t = c ? a ? g.ZP.get(103) : g.ZP.get(102) : g.ZP.get(101, {
name: Oe.N5.for(n, o)
});
var L = (0, i.useCallback)((function() {
d(),
Z(!1)
}), [d]),
U = function() {
var e;
O ? (p(w), Z(!1)) : (M(g.ZP.get(99)), null == b || null == (e = b.current) || e.focus())
},
D = function(e) {
var t = e.target.value;
T(t.length > 0),
A(t)
},
B = [{
type: S.Us.CLOSE,
onClick: L
}];
s && B.push({
type: S.df.BUTTON,
text: y,
onClick: U
}),
(0, i.useEffect)((function() {
var e = C.current;
return e && null != j && j.current && (e.update({
onDismiss: L,
contentWrapper: j.current
}), e.modalize(), e.updateFocusableElements(), e.toggleFocusTrap(!0)), function() {
null == e || e.unmount()
}
}), [L, C]);
return (0, _.jsx)(il.Z, {
children: (0, _.jsx)(Ne.Z, {
appear: v,
in: k,
timeout: 300,
classNames: k ? "forward" : "backward",
mountOnEnter: !0,
unmountOnExit: !0,
onEntered: function() {
var e;
null == b || null == (e = b.current) || e.focus(),
h && h()
},
onExited: m,
children: function() {
return (0, _.jsx)("div", {
className: "page-container",
id: "page-container",
children: (0, _.jsx)("div", {
className: "page overlay-page questions-game-answer",
ref: j,
role: "dialog",
"aria-modal": !0,
tabIndex: -1,
"aria-label": t,
children: (0, _.jsxs)(Ns.Z, {
children: [(0, _.jsx)(Ls.Z, {
children: (0, _.jsx)(S.ZP, {
actions: B,
position: "absolute",
transparent: !0
})
}), (0, _.jsxs)(Rs.Z, {
vpadded: !0,
align: "stretch",
hpadded: !0,
children: [(0, _.jsx)("div", {
className: "questions-game-answer-title",
children: (0, _.jsx)(Ge.P1, {
align: "center",
color: "black",
tag: "h2",
children: t
})
}), (0, _.jsx)("div", {
className: "questions-game-answer-question",
children: (0, _.jsx)(Ge.R6, {
align: "center",
color: "black",
children: r
})
}), (0, _.jsx)("div", {
className: "questions-game-answer-input",
children: (0, _.jsxs)(Zo.Z, {
onSubmit: function(e) {
return (0, yo.dd)(e, U)
},
isFixed: !0,
children: [(0, _.jsx)(ol.Z, {
label: g.ZP.get(100),
onChange: D,
onFocus: l,
onBlur: u,
autoResize: !0,
value: w,
fieldId: "feedback-input",
textareaRef: b,
maxHeight: 200,
errorMessage: R,
a11y: {
ariaRequired: !0
}
}), s ? null : (0, _.jsx)(rl.Z, {
children: (0, _.jsx)(ko.Z, {
buttonAttrs: {
type: "submit"
},
text: x
})
})]
})
})]
})]
})
})
})
}
})
})
},
al = function() {
(0, l.L9)(258, {
element: 1381
})
},
cl = function() {
(0, l.L9)(258, {
element: 1382
})
},
ll = function() {
(0, l.L9)(258, {
element: 1377
})
},
ul = {
send: 253,
question: 1360,
close: 51
},
dl = function(e) {
(0, l.L9)(332, {
element: ul[e],
parent_element: 1377
})
},
pl = function() {
(0, l.L9)(258, {
element: 1289
})
},
hl = function(e) {
(0, l.L9)(332, {
element: "close" === e ? 51 : 253,
parent_element: 1289
})
},
ml = J.Z.getLogger("Questions Game"),
fl = function(e) {
var t = e.message,
n = e.chatUser,
o = e.isAnswer,
r = e.isAnswerInstant,
s = e.isOnboarding,
a = e.isOnboardingReceiver,
c = e.onDismissOnboarding,
u = e.onShowAnswer,
d = e.onCloseAnswer,
h = e.onClose,
m = (0, i.useState)({
text: "
"
}),
f = m[0],
v = m[1],
b = (0, i.useState)(s),
y = b[0],
x = b[1],
S = (0, i.useRef)([]),
C = pe.Z.getUser(),
j = (0, g.Ro)(C.gender),
P = (0, g.Ro)(n.getGender()),
k = n.getName(),
Z = (0, i.useCallback)((function() {
var e = S.current.length - 1,
t = S.current.findIndex((function(e) {
return e.id === f.id
}));
-1 !== t && t < e ? v(S.current[t + 1]) : t === e && v(S.current[0]),
dl("question")
}), [f.id]),
E = function() {
return (null == t ? void 0 : t.fromPersonId) === C.user_id
};
(0, i.useEffect)((function() {
new Ee.ZP(537, {
context: 264,
other_user_id: n.getUserId()
}).onResponse(538, (function(e) {
Array.isArray(e.questions) && e.questions.length && (S.current = e.questions, v(e.questions[0]))
})).onError((function(e) {
(0, X.Z)(e) && ml.error("Error while getting questions", {
error: e
})
})).request()
}), []);
var O = (0, _.jsx)(el, {
question: f.text,
onClickGetQuestion: Z,
onClickSendQuestion: function() {
var e = new B.ZP({
messageType: 50,
question: {
id: f.id
}
}, n);
p.Z.send(n.getUserId(), e).then((function(e) {
setTimeout((function() {
u(e, !0)
}), 400)
})).catch((function(e) {
(0, X.Z)(e) && ml.error("Error while sending questions game message", {
error: e
})
})),
dl("send")
},
onClickClose: function() {
return dl("close")
},
onAnimationInComplete: ll,
onAnimationOutComplete: h
});
return y && (O = (0, _.jsx)(tl, {
userGender: j,
chatUserGender: P,
chatUserName: k,
isReceiver: a,
onClose: function(e) {
"continue" === e ? (x(!1), c()) : h(),
a ? function(e) {
(0, l.L9)(332, {
element: "continue" === e ? 395 : 51,
parent_element: 1382
})
}(e) : function(e) {
(0, l.L9)(332, {
element: "continue" === e ? 395 : 51,
parent_element: 1381
})
}(e)
},
onAnimationInComplete: a ? cl : al
})), t && o && (O = (0, _.jsx)(sl, {
question: t.question.text,
chatUserName: k,
chatUserGender: P,
altNavigation: ue.Z.isIOs,
isInstant: r,
isMessageFromCurrentUser: E(),
onFocusInput: function() {
setTimeout((function() {
(0, N.Z)(".page.questions-game-answer").addClass("not-stretched-layout")
}))
},
onBlurInput: function() {
setTimeout((function() {
(0, N.Z)(".page.questions-game-answer").removeClass("not-stretched-layout")
}))
},
onClickClose: function() {
hl("close")
},
onClickSend: function(e) {
p.Z.sendQuestionsGameAnswer(t, e, E()),
hl("send")
},
onAnimationInComplete: pl,
onAnimationOutComplete: d
})), O
},
gl = n(16666);
function vl(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function bl(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? vl(Object(n), !0).forEach((function(t) {
yl(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : vl(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function yl(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
var xl = J.Z.getLogger("Chat"),
Sl = (0, ae.Z)(11);
function _l(e) {
return 3 === (null == e ? void 0 : e.getType())
}
function Cl(e) {
var t = ne(e);
return 19 === e.initialScreenType || 472 === (null == t ? void 0 : t.promo_block_type)
}
function jl(e) {
var t = (null == e ? void 0 : e.getAlbums([])) || [];
return t.length > 0 && !!t[0].getPhotos() && !_l(e)
}
function Pl(e, t) {
var n = null == t ? void 0 : t.some((function(e) {
return 10017 === e.getPromoBlockType()
}));
return _l(e) || ue.Z.isTWA() || ue.Z.isHuaweiQuickApp() || !n
}
var kl = function(e) {
var t,
n,
o = e.user,
r = e.chatUserId,
v = e.folderId,
y = e.streamId,
x = e.userSubstitute,
S = e.hotPanelData,
C = e.clientSource,
j = e.activationPlace,
P = e.screenName,
O = e.wasBack,
w = e.notificationPermissionController,
N = e.scrollableElement,
R = e.onboardingTipsController,
L = e.onPreventNotifications,
U = e.onAllowNotifications,
D = e.jinba,
B = e.scrollPosition,
F = e.navigatedBack,
G = (0, i.useState)(!1),
V = G[0],
q = G[1],
H = (0, i.useState)(!1),
Y = H[0],
Q = H[1],
W = (0, i.useState)(!1),
K = W[0],
J = W[1],
$ = (0, i.useState)(!0),
te = $[0],
ae = $[1],
pe = (0, i.useState)(!1),
fe = pe[0],
Pe = pe[1],
Ee = (0, i.useState)(!0),
Oe = Ee[0],
Te = Ee[1],
Ie = (0, i.useState)([]),
we = Ie[0],
Ae = Ie[1],
Ne = (0, i.useState)([]),
Re = Ne[0],
Me = Ne[1],
Le = (0, i.useState)(),
Ue = Le[0],
De = Le[1],
Be = (0, i.useState)(),
Fe = Be[0],
Ge = Be[1],
Ve = (0, i.useState)(!0),
qe = Ve[0],
He = Ve[1],
Ye = (0, i.useState)(o),
Qe = Ye[0],
We = Ye[1],
ze = (0, i.useState)(!1),
Ke = ze[0],
Je = ze[1],
Xe = (0, i.useState)(""),
$e = Xe[0],
et = Xe[1],
nt = (0, i.useState)(),
it = nt[0],
ot = nt[1],
rt = (0, i.useState)(!1),
st = rt[0],
at = rt[1],
ct = (0, i.useState)(j),
lt = ct[0],
ut = ct[1],
dt = (0, i.useState)({}),
pt = dt[0],
ht = dt[1],
mt = (0, i.useState)(),
ft = mt[0],
gt = mt[1],
vt = (0, i.useState)(!1),
bt = vt[0],
yt = vt[1],
xt = (0, i.useState)(),
St = xt[0],
_t = xt[1],
Ct = (0, i.useState)(!1),
jt = Ct[0],
Pt = Ct[1],
kt = (0, i.useState)(!1),
Zt = kt[0],
Et = kt[1],
Ot = (0, i.useState)(!1),
Tt = Ot[0],
It = Ot[1],
wt = (0, i.useState)(!1),
At = wt[0],
Nt = wt[1],
Rt = (0, i.useState)(!1),
Mt = Rt[0],
Lt = Rt[1],
Ut = (0, i.useState)(!1),
Dt = Ut[0],
Bt = Ut[1],
Ft = (0, i.useState)(!1),
Gt = Ft[0],
Vt = Ft[1],
qt = (0, i.useState)(),
Ht = qt[0],
Yt = qt[1],
Qt = (0, i.useState)(!1),
Wt = Qt[0],
zt = Qt[1],
Kt = (0, i.useState)(!1),
Jt = Kt[0],
Xt = Kt[1],
$t = (0, i.useRef)(""),
en = (0, i.useRef)(0),
tn = (0, i.useRef)(0),
nn = (0, i.useRef)(0),
on = (0, i.useRef)(),
rn = (0, i.useRef)(null),
sn = (0, i.useRef)(!1),
an = (0, i.useRef)(!1),
cn = (0, i.useRef)(null),
ln = (0, i.useRef)(null),
un = (0, i.useRef)(!1),
dn = (0, i.useRef)(!1),
pn = (0, i.useRef)(!1),
hn = (0, i.useCallback)((function(e) {
var t,
n,
i,
o,
s,
a,
c,
l,
u,
d,
h,
m = e.messages,
f = p.Z.isUserReported(e.chatInstanceId),
g = m.some((function(e) {
return e.isYours() || p.Z.isYours(e)
})),
v = bl(bl({}, e), {}, {
context: C,
streamId: y,
chatBlockedGiftPromo: (i = e.promoBanners, i.find((function(e) {
return 24 === e.getPromoBlockType() && 6 === e.getPromoBlockPosition()
})) || (null == Fe ? void 0 : Fe.chatBlockedGiftPromo)),
gender: (0, b.gp)(e.gender),
hasReceivedMessage: m.some((function(e) {
return !e.isYours() || !p.Z.isYours(e)
})),
initialScreen: f ? void 0 : e.initialScreen,
sourceOfMessage: (0, Vs.RD)(e),
isSelectable: K,
dismissInitialScreen: !1,
isShowingCrushAnimation: !g && e.isShowingCrushAnimation,
feedbackPromo: (t = e.promoBanners, n = t.find((function(e) {
return 575 === e.getPromoBlockType()
})), null == n ? void 0 : n.toJSON())
});
if (r) {
var x = I(r);
x && (v.replyToMessage = x)
}
return v.initialScreen || (v.dismissInitialScreen = !0), v.isChatBlocked = (c = (o = v).initialScreenType, l = !(null == (s = o.initialScreen) || !s.blockingFeature), u = null == (a = o.initialScreen) ? void 0 : a.promo, d = Ze.includes(null == u ? void 0 : u.getPromoBlockType()), h = o.initialScreen && o.messages.length > 0, (0 === o.maxUnansweredMessages && o.chatBlockedGiftPromo || l || h || d) && !(7 === c)), v
}), [r, C, K, null == Fe ? void 0 : Fe.chatBlockedGiftPromo, y]),
mn = function() {
var e = p.Z.getCachedClientOpenChat(r);
Ge(hn(e))
},
fn = (0, i.useCallback)((function(e) {
var t = hn(e),
n = e.counter > e.messages.length,
i = !pn.current && !t.isChatBlocked && !!e.isShowingOffensiveMessagesPrompt;
($t.current = e.chatInstanceId.toString(), i && (pn.current = !0), dn.current) && (e.messages.some((function(e) {
return 50 === e.messageType
})) && (Nt(!0), setTimeout((function() {
Lt(!0)
}), 400)));
We(e.chatUser),
Ae(e.messages),
Me(e.promoBanners),
Pe(e.chatUser.getIsFavourite()),
Ge(t),
zt(i),
n && (Te(!1), ae(!1)),
null == D || D.stop({
nameOverride: t.initialScreen ? "Chat/InitialScreen" : "Chat",
hotpanelTimerOverride: t.initialScreen ? 3 : 2
})
}), [hn, D]),
gn = function() {
gt(void 0),
a.Z.updateLocation(c.x.MESSAGES, {
id: r
})
},
vn = function() {
gn(),
a.Z.back()
},
bn = function(e) {
e && We(e)
},
yn = function(e) {
e && (We(e), Pe(e.getIsFavourite()))
},
xn = (0, i.useCallback)((function() {
var e = p.Z.getCachedClientOpenChat(r);
e.dummy && Qe && (e.chatUser = Qe),
fn(e)
}), [Qe, r, fn]),
Sn = function(e, t) {
!function(e, t) {
if (void 0 === t && (t = xe.MESSAGE), !Boolean(e.serverErrorMessage) || (0, X.Z)(e))
if (e instanceof Se.lt)
je.error("Rpc error on send chat message", {
error: e,
errorSource: t,
RPCErrorType: Ce[e.getType()] || Ce[0]
});
else if (e.serverErrorMessage) {
var n = "toJSON" in e.serverErrorMessage ? e.serverErrorMessage.toJSON() : e.serverErrorMessage;
je.error("Server error on send chat message", {
error: JSON.stringify(n),
errorSource: t
})
} else
je.error("Unknown error on send chat message", {
error: e,
errorSource: t
})
}(e, t),
function(e) {
if (e instanceof Error) {
var t = "" + e.message;
(0, l.L9)(125, {
event_type: 1,
error_type: 12,
error_message: "string" == typeof e ? e : t
})
} else if (e instanceof he.kE7) {
var n = e.getErrorMessage();
(0, l.L9)(125, {
event_type: 1,
error_type: me.Z.getType(e.getType()),
error_message: n
})
}
}(e),
xn()
},
_n = (0, i.useCallback)((function(e, t) {
if (!(e instanceof Error)) {
var n = null == e ? void 0 : e.getType();
return 14 === n || 42 === n ? (O || _e(e.getErrorMessage()), void a.Z.back()) : 82 === n ? (O || _e(function(e, t) {
var n = e.getErrorMessage();
if (!n) {
var i = t.getName();
i && (n = 2 === t.getGender() ? g.ZP.get(460, {
str: i
}) : g.ZP.get(461, {
str: i
}))
}
return n
}(e, Qe)), void a.Z.back()) : void de.Z.handleError({
error: e,
screenName: ye(K, P, r),
navigationBar: {
logo: !0,
actions: {}
}
}, t)
}
(0, X.Z)(e) && xl.error(e.message)
}), [Qe, r, K, P, O]),
Cn = (0, i.useCallback)((function(e) {
void 0 === e && (e = {
allowConsumeChatUnblocker: !1
});
var t = {
allowConsumeChatUnblocker: e.allowConsumeChatUnblocker,
context: C,
folderId: v,
streamId: y,
user: x ? 3 : void 0
};
return p.Z.getCachedClientOpenChat(r).dummy && q(!0), cn.current = (0, re.Z)(p.Z.getClientOpenChat(r, t)), cn.current.then((function(e) {
un.current = !!R.getTooltipByType(46),
dn.current = !!R.getTooltipByType(53),
fn(e),
q(!1)
})).catch((function(e) {
e instanceof re.t || _n(e, Cn)
})), cn.current
}), [C, v, y, x, r, R, fn, _n]),
jn = function() {
Cc.Z.getInstance().invalidate(),
Z.Z.removeMessage(r),
A(r.toString()),
mn()
},
Pn = function(e) {
var t = le.Z.encodeRoute(a.Z.getUrl(), {
paymentFlow: "2"
});
return e.context = C, e.streamId = y, e.repliedMessage = I(r.toString()), ln.current = (0, re.Z)(p.Z.send(r, e, t)), ln.current.then(jn).catch((function(e) {
return e instanceof re.t || Sn(e), e
})), ln.current
},
kn = function() {
var e;
x ? e = Promise.resolve(x) : (q(!0), e = h.Z.getInstance().get({
id: r
}).then((function(e) {
var t = e[0];
return q(!1), new ce.Z({
userSubstitute: t.getUserSubstitute()
})
}))),
e.then((function(e) {
a.Z.navigate(c.x.PROMO_CARDS_GALLERY, {
userSubstitute: e,
context: 26
})
})).catch((function() {
q(!1),
_e()
}))
},
Zn = (0, i.useCallback)((function() {
if (p.Z.getCachedClientOpenChat(r).messages.some((function(e) {
return e.allowLike
})) && !Wt) {
var e = R.getTooltipByType(46).text;
L(),
ht({
isActive: !0,
text: e
})
}
}), [r, L, Wt, R]),
En = (0, i.useCallback)((function() {
m.Z.getUserById({
id: r,
clientSource: 10,
folderType: 0
}).then((function(e) {
setTimeout(gt, 100, e)
})).catch((function(e) {
(0, X.Z)(e) && xl.error("Failed to get user by id", e),
M.Z.showNotification({
type: M.Z.TYPES.ERROR
})
})),
a.Z.updateLocation(c.x.CHAT_PROFILE, {
id: r
})
}), [r]),
On = function() {
null != Fe && Fe.deletedMember || (_l(Qe) ? kn() : (p.Z.hasInitialChatScreen(r) && p.Z.invalidate(r), En()))
},
Tn = function(e) {
J(e),
e && (0, l.L9)(49, {})
},
In = function() {
(0, l.L9)(425, {
activation_place: lt,
encrypted_user_id: r
}),
a.Z.back()
},
wn = function() {
f.Z.getInstance().removeUserFromFolder({
folder: 56,
uid: r
}).then((function() {
a.Z.navigate(c.x.CONNECTIONS)
}))
};
(0, i.useEffect)((function() {
return function() {
var e;
null == (e = rn.current) || null == e.dismiss || e.dismiss(),
tn.current && s.Z.clearTimeout(tn.current),
nn.current && s.Z.clearTimeout(nn.current),
en.current && s.Z.clearTimeout(en.current)
}
}), []),
(0, i.useEffect)((function() {
(!r || r.length < 20) && (xl.error("Cannot load chat page without a valid id", {
id: r
}), _e(), a.Z.back())
}), [r]),
(0, i.useEffect)((function() {
if (!j) {
var e = {
id: r,
clientSource: C,
streamId: y,
folderId: v,
userSubstitute: x,
activationPlace: null != S && S.inappId ? 165 : 1
};
a.Z.updateLocation(c.x.MESSAGES, e)
}
}), [j, C, v, null == S ? void 0 : S.inappId, y, x, r]),
(0, i.useEffect)((function() {
ut(function(e, t) {
return 4 === e ? 5 : 9 === e ? 10 : 94 === e ? 165 : 26 === e ? 191 : t
}(C, j))
}), [C, j]),
(0, i.useEffect)((function() {
var e = function(e, t, n) {
jl(Qe) && ae(n >= t)
},
t = function(e) {
e.toPersonId && ![r, $t.current].includes(e.toPersonId.toString()) || ((r ? I(r) : null) && ((0, l.L9)(332, {
element: 288,
parent_element: 289
}), r && A(r)), jl(Qe) || e !== we[0] || Te(!0), e.isTemporary() || function(e, t, n) {
var i,
o;
(0, l.L9)(8, {
activation_place: t,
encrypted_user_id: null == (i = e.toPersonId) ? void 0 : i.toString(),
length: 1 === e.messageType && (null == (o = e.message) ? void 0 : o.length) || 0,
message_first: 1 === n.length,
message_first_replied: n.length > 1 && 1 === ve(n),
send_giphy: 36 === e.messageType,
send_heart: "ANIMATED_XP" === e.messageType,
send_location: !1,
send_photo: 19 === e.messageType,
send_smile: 22 === e.messageType,
send_sticker: 23 === e.messageType
})
}(e, lt, we), xn())
},
n = function(e) {
e.fromPersonId && ![r, $t.current].includes(e.fromPersonId.toString()) || (42 === e.messageType && yt(!0), e.isLikelyOffensive && null != Fe && Fe.isShowingOffensiveMessagesPrompt && zt(!0), xn())
},
i = function(e) {
46 !== e.type && 49 !== e.type || Cn()
};
return oe.Z.getInstance().on(oe.Z.Type.NOTIFICATION, i), p.Z.on(p.Z.EVENTS.FLUSH, Cn).on(p.Z.EVENTS.HISTORY_UPDATED, e).on(p.Z.EVENTS.MESSAGE_FROM_ME, t).on(p.Z.EVENTS.MESSAGE_FROM_USER, n).on(p.Z.EVENTS.CHAT_PROMO_HANDLED, xn).on(p.Z.EVENTS.SETTINGS_UPDATED, (function(e) {
e.show_offensive_messages_prompt && zt(!0)
})), function() {
p.Z.off(p.Z.EVENTS.FLUSH, Cn).off(p.Z.EVENTS.HISTORY_UPDATED, e).off(p.Z.EVENTS.MESSAGE_FROM_ME, t).off(p.Z.EVENTS.MESSAGE_FROM_USER, n).off(p.Z.EVENTS.CHAT_PROMO_HANDLED, xn),
oe.Z.getInstance().off(oe.Z.Type.NOTIFICATION, i)
}
}), [lt, Qe, r, Cn, we, xn, U, R]),
(0, i.useEffect)((function() {
var e,
t;
return on.current = (e = {
getClientSource: function() {
return C
},
getStreamId: function() {
return y
},
onSendMessage: function(e) {
e && !e.isCanceled && Sn(e, xe.MULTIMEDIA)
}
}, t = T || z(e), document.getElementById("photo-form") || document.body.appendChild(t.zepto[0]), t), (0, d.GE)((function() {
var e,
t = p.Z.getCachedClientOpenChat(r),
n = (0, u.Z)(a.Z.getHistory()),
i = n && [c.x.GIFT, c.x.MULTIMEDIA].includes(n.routeName),
o = t && !t.dummy && O && i;
xn(),
function() {
var e = a.Z.getLocation(),
t = e.routeName,
n = e.parameters;
if ("2" === (null == n ? void 0 : n.paymentFlow)) {
var i = bl({}, n);
delete i.paymentFlow,
a.Z.updateLocation(t, i),
jn()
}
}(),
function() {
var e = a.Z.getLocation(),
t = e.routeName,
n = e.parameters;
if ("1" === (null == n ? void 0 : n.paymentFlow) || "3" === (null == n ? void 0 : n.paymentFlow)) {
if (!st) {
var i = bl({}, n);
delete i.paymentFlow,
a.Z.updateLocation(t, i)
}
} else
q(!1)
}();
var l,
d = I(r.toString());
if (null == (e = on.current) || e.checkPendingMultimedia({
replyToUid: null == d ? void 0 : d.id,
replyToMessage: d
}), ie.Z.getInstance().getBackAction() === be && (ie.Z.getInstance().getResult() === ie.Z.RESULTS.PENDING && (q(!0), s.Z.setTimeout(Cn, 4e4), l = !0), ie.Z.getInstance().clear()), !l) {
var h = {
forceTrack: !0,
id: r,
activationPlace: j,
clientSource: C,
isUserSubstitute: _l(Qe)
};
o ? ge(h) : Cn().then((function() {
return ge(h)
})).catch((function(e) {
e instanceof re.t || (0, X.Z)(e) && xl.error("Error calling getClientOpenChat", {
error: e
})
}))
}
})), function() {
var e,
t;
null == (e = cn.current) || e.cancel(),
null == (t = ln.current) || t.cancel()
}
}), []),
(0, i.useEffect)((function() {
null != Fe && Fe.isShowingCrushAnimation && !sn.current && ((0, l.L9)(258, {
element: 1711
}), sn.current = !0)
}), [null == Fe ? void 0 : Fe.isShowingCrushAnimation]),
(0, i.useEffect)((function() {
!V && Fe && (!ke.has(Fe.chatInstanceId) || Fe.isChatBlocked || Cl(Fe) ? Cl(Fe) && ke.add(Fe.chatInstanceId) : ke.remove(null == Fe ? void 0 : Fe.chatInstanceId))
}), [Fe, V]),
(0, i.useEffect)((function() {
var e = null == Fe ? void 0 : Fe.inputSettingsItems;
if (null != e && e.length) {
var t = e.findIndex((function(e) {
return 13 === e.type
}));
It(-1 !== t && !!Fe && !Cl(Fe))
}
}), [Fe]),
(0, i.useEffect)((function() {
var e = !Fe || Boolean(Fe.initialScreen) && 0 !== Fe.maxUnansweredMessages;
un.current && !e && (Zn(), un.current = !1)
}), [Fe, Zn]),
(0, i.useEffect)((function() {
a.Z.getLocation().routeName === c.x.CHAT_PROFILE && En()
}), [En]),
(0, i.useEffect)((function() {
return E.Z.on(E.Z.USER_BLOCKED, vn), E.Z.on(E.Z.USER_UNBLOCKED, bn), E.Z.on(E.Z.USER_REPORTED, bn), E.Z.on(E.Z.USER_FAVOURITED, yn), E.Z.on(E.Z.USER_QUICK_MESSAGE_SENT, bn), function() {
E.Z.off(E.Z.USER_BLOCKED, vn),
E.Z.off(E.Z.USER_UNBLOCKED, bn),
E.Z.off(E.Z.USER_REPORTED, bn),
E.Z.off(E.Z.USER_FAVOURITED, yn),
E.Z.off(E.Z.USER_QUICK_MESSAGE_SENT, bn)
}
}));
var An = ye(K, P, r),
Nn = Fe ? ne(Fe) : void 0,
Rn = Fe ? function(e) {
var t,
n = (null == e ? void 0 : e.promoBanners) || [],
i = e.dismissedPromoBanners || [],
o = n.find((function(e) {
return ee.includes(e.getPromoBlockType())
}));
return o && !i.includes(o.getPromoBlockType()) && (t = o.toJSON()), t
}(Fe) : void 0,
Mn = (null == Fe ? void 0 : Fe.dismissedPromoBanners) || [],
Ln = Re.filter((function(e) {
return -1 === Mn.indexOf(e.getPromoBlockType())
})),
Un = bt || (null == Fe ? void 0 : Fe.isNotInterested),
Dn = (null == Qe ? void 0 : Qe.getName()) || "";
function Bn() {
Pt(!1)
}
var Fn = function() {
dn.current = !1,
R.dismissTooltip(10, 53)
},
Gn = function() {
void 0 !== typeof Qe && Lt(!0)
},
Vn = function(e, t) {
Yt(e),
Bt(!0),
Vt(Boolean(t)),
Lt(!0)
};
return (0, _.jsxs)(i.Fragment, {
children: [Fe && Qe ? (0, _.jsx)(Us, {
navigation: (0, _.jsx)(k, {
user: Qe,
promos: Re,
clientSource: C,
isHeaderProfileHidden: Oe && jl(Qe),
isHidingVideoCall: Pl(Qe, Re),
isFavourite: fe,
isSelectable: K,
isUserSubstitute: _l(Qe),
isShowingBlockingTip: Jt,
onDeleteChat: wn,
onFavouriteUser: function() {
Pe(!fe)
},
onOpenProfile: On,
onToggleReport: Tn,
scrollRef: N
}),
miniProfile: te && jl(Qe) && !Fe.deletedMember ? (0, _.jsx)(tt.Z, {
onChange: function(e) {
Te(e.isIntersecting)
},
children: (0, _.jsx)(ba, {
user: Qe,
screenName: An,
activationPlace: lt,
onProfileClick: On,
sourceOfMessage: Fe.sourceOfMessage
})
}) : null,
messages: (0, _.jsx)(Xo, {
chatInstanceId: Fe.chatInstanceId,
otherUserId: r,
chatUser: Qe,
counter: Fe.counter,
isSelectable: K,
isAllowUrlParsing: Fe.isAllowUrlParsing,
isUserSubstitute: _l(Qe),
isDummy: Fe.dummy,
messageLikeOnboarding: pt,
messages: we,
promoBanners: Ln,
dismissedPromoBanners: Mn,
scrollingContainerRef: N,
scroller: it,
oldScrollPosition: F ? B : void 0,
isShowingOffensiveMessagesPrompt: !pt.isActive && Wt,
onTogglePd: Q,
onToggleReport: Tn,
onShowPromoCards: kn,
onClickReadReceiptsPromoLink: function(e) {
De(e),
(0, l.L9)(332, {
element: 1350
})
},
onUpdateInput: mn,
onUpdateChat: xn,
onConfirmResendInappropriate: Pn,
onNewMessageNotification: function(e, t) {
Je(e),
t && et(t)
},
onSetScroller: ot,
onUserBlocked: In,
onQuestionsGameStart: Gn,
onQuestionsGameAnswer: Vn,
onDismissOffensiveMessagesModal: function(e) {
zt(!1),
p.Z.setShowLikelyOffensivePrompt(r, !1),
e && Xt(!0)
}
}),
chatNudgePromo: Un ? (0, _.jsx)(Uc, {
chatUser: Qe,
onDelete: wn
}) : !Boolean(Fe.initialScreen) && (0, _.jsx)(Mc, {
promoBlock: Nn,
chatInstanceId: Fe.chatInstanceId,
feedbackPromo: Fe.feedbackPromo,
chatUser: Qe,
clientSource: C,
isBlocker: !Boolean(Fe.inputSettingsItems),
onClickQuestionsGame: Gn,
onCloseQuestionsGame: function() {
if (dn.current) {
var e = R.getTooltipByType(53).text;
_t(e),
Et(!0)
}
},
onReloadClientOpenChat: Cn,
onCloseChat: a.Z.back
}),
newMessageNotification: (0, _.jsx)($o, {
text: $e,
isActive: Ke,
onClick: function() {
null == it || it.scrollToBottom(!0),
Je(!1)
}
}),
input: Fe.isChatBlocked || Fe.deletedMember || K || Un || null == (t = Fe.inputSettingsItems) || !t.length ? null : (0, _.jsx)(Es, {
context: Fe.context,
streamId: Fe.streamId,
otherUserId: r,
inputFeatures: Fe.inputFeatures,
inputSettingsItems: Fe.inputSettingsItems,
replyToMessage: Fe.replyToMessage,
isMessageFirst: !(null != (n = Fe.messages) && n.length),
hasReceivedMessage: Fe.hasReceivedMessage,
scroller: it,
chatUser: Qe,
notificationPermissionController: w,
activationPlace: lt,
questionsGameTooltipText: St,
showQuestionsGameTooltip: Zt,
showQuestionsGameButton: Tt,
onHideAddBanner: function(e) {
en.current && (s.Z.clearTimeout(en.current), en.current = 0),
"focus" === e.type && He(!1)
},
onBlurInput: function() {
en.current = s.Z.setTimeout((function() {
return He(!0)
}), 1e3),
tn.current = s.Z.setTimeout((function() {
an.current = !1
}), 700)
},
onFocusInput: function() {
an.current = !0
},
onUpdateInput: mn,
onClickCamera: function() {
nn.current = s.Z.setTimeout((function() {
var e;
rn.current = (null == (e = on.current) ? void 0 : e.uploadMultimedia(r)) || null,
rn.current && Pt(!0)
}), ue.Z.isIphoneContextualMenu && an.current ? 700 : 0)
},
onClickQuestionsGameButton: Gn,
onClickQuestionsGameTooltip: function() {
Et(!1),
Fn()
},
onToggleLoading: q,
onSendMessage: Pn,
onChatRefresh: Cn,
onToggleTopup: at,
onUploadAudio: function(e) {
var t;
null == (t = on.current) || t.uploadAudio(r, e)
}
}),
ads: (0, _.jsx)(Is, {
isEnabled: qe
}),
initialScreen: Fe && Boolean(Fe.initialScreen) || Fe.isChatBlocked ? (0, _.jsx)(sc, {
openChatData: Fe,
otherUserId: r,
clientSource: C,
log: xl,
messages: we,
streamId: y,
chatUser: Qe,
onDismiss: function() {
xn(),
jl(Qe) || Te(!0)
},
onChatRefresh: Cn,
onSendMessage: Pn,
onUserBlocked: In
}) : void 0,
scrollingContainerRef: N,
isLoading: V,
isHidingMessages: Boolean(Fe.initialScreen) && 0 !== Fe.maxUnansweredMessages,
isShowingCrushAnimation: Fe.isShowingCrushAnimation,
onDismissOnboarding: function() {
U(),
ht({
isActive: !1
}),
R.dismissTooltip(10, 46)
},
isOnboarding: pt.isActive || Wt
}) : null, (0, _.jsx)(Dc, {
isOpen: jt,
onCaptureClick: function() {
var e;
null == (e = rn.current) || e.onCaptureOptionClick(),
Bn()
},
onChooseClick: function() {
var e;
null == (e = rn.current) || e.onChooseOptionClick(),
Bn()
},
onCancelClick: Bn
}), Y ? (0, _.jsx)(Gc, {
chatInstanceId: r,
name: Dn,
onAnimationOutComplete: function() {
return Q(!1)
}
}) : null, Ue && Rn ? (0, _.jsx)(Jc, {
promo: Rn,
chatUser: null == Qe ? void 0 : Qe.toJSON(),
chatInstanceId: r,
onAnimationOutComplete: function() {
return De(void 0)
},
onPaymentSuccess: function() {
Ue && (Ue.setStatus(Ue.statusType), p.Z.markChatPromoHandled(r, 463))
}
}) : null, ft ? (0, _.jsx)(Vc.Z, {
user: ft,
mode: Xc.N.CHAT,
onVoteYes: function() {
if (ft) {
var e = {
user: ft,
voteType: 2
};
Sl.handleVote(e).then((function() {
m.Z.getUserById({
id: ft.getUserId(),
clientSource: 10,
folderType: 0
}).then(gt).catch((function(e) {
return (0, se.WG)("Failed to get user by id", e)
}))
})).catch((function(e) {
gl.ZP
}))
}
},
onSmile: function() {
Sl.handleSmileSendChatMessage(ft).then(gt).catch((function(e) {
return (0, se.WG)("Error when sending smile from Chat Profile", e)
}))
},
onChat: gn,
onClose: gn
}) : null, Mt ? (0, _.jsx)(fl, {
message: Ht,
chatUser: Qe,
isAnswer: Dt,
isAnswerInstant: Gt,
isOnboarding: dn.current,
isOnboardingReceiver: At,
onDismissOnboarding: Fn,
onShowAnswer: Vn,
onCloseAnswer: function() {
Lt(!1),
Bt(!1),
Vt(!1),
Yt(void 0)
},
onClose: function() {
Lt(!1)
}
}) : null]
})
},
Zl = n(63119),
El = n(43949);
function Ol(e, t) {
return Ol = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, Ol(e, t)
}
var Tl = function(e) {
var t,
n;
function r(t) {
var n;
return (n = e.call(this, t) || this).screenName = 20, n.activationPlace = 11, n.notificationPermissionController = new Zl.Z({
place: Pc.Z.PLACE_CHAT,
activationPlace: 11
}), n.onboardingTipsController = El.Z.getInstance(), n.scrollableElement = void 0, n.preventNotifications = function() {
n.notificationScreenAccess = 3
}, n.allowNotifications = function() {
n.notificationScreenAccess = 1
}, n.jinba = new D.Z("Chat", 2), n.notificationPermissionController.start(), n.scrollableElement = (0, i.createRef)(), n
}
n = e,
(t = r).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
Ol(t, n);
var s = r.prototype;
return s.componentDidMount = function() {
e.prototype.componentDidMount.call(this),
this.onboardingTipsController.start(),
this.onboardingTipsController.setContext(this.clientSource)
}, s.componentWillUnmount = function() {
this.onboardingTipsController.stop(),
this.scrollableElement.current && this.props.saveScrollPosition(this.scrollableElement.current.scrollTop)
}, s.getClientSource = function() {
var e = 6 === Number(this.getParameter("folderId")),
t = !0 === o.Z.getSync(163).enabled;
return e && t ? 127 : Number(this.getParameter("context")) || 10
}, s.render = function() {
var e = this.getParameters(),
t = e.folderId,
n = e.streamId,
i = e.userSubstitute,
o = e.id,
r = e.hotPanelData,
s = e.chatUser,
a = this.props,
c = a.scrollPosition,
l = a.navigatedBack;
return this.addPageWrapper((0, _.jsx)(kl, {
scrollPosition: c,
navigatedBack: l,
user: s,
chatUserId: o || "",
folderId: Number(t) || 0,
streamId: n,
userSubstitute: i,
hotPanelData: r,
clientSource: this.getClientSource(),
activationPlace: this.activationPlace,
screenName: this.screenName,
wasBack: this.wasBack(),
notificationPermissionController: this.notificationPermissionController,
scrollableElement: this.scrollableElement,
onboardingTipsController: this.onboardingTipsController,
onPreventNotifications: this.preventNotifications,
onAllowNotifications: this.allowNotifications,
jinba: this.jinba
}), "chat")
}, r
}(r.Z);
Tl.transition = !1,
Tl.notificationScreenAccess = void 0;
var Il = Tl
},
99836: function(e, t, n) {
n.r(t),
n.d(t, {
default: function() {
return Pi
}
});
n(68304),
n(96649),
n(96078),
n(82526),
n(41817),
n(69070),
n(38880),
n(49337),
n(33321),
n(89554),
n(41539),
n(54747),
n(82772),
n(9653),
n(69826),
n(47941),
n(34553),
n(21249),
n(26699),
n(32023),
n(57327),
n(5735),
n(83753),
n(2707),
n(66992),
n(88674),
n(78783),
n(33948),
n(5212),
n(92222);
var i = n(67294),
o = n(99111),
r = n(73234),
s = n(111),
a = n(77004),
c = n(93517),
l = n(46356),
u = n(94184),
d = n.n(u),
p = n(28223),
h = n(34969),
m = n(44887),
f = n(85893),
g = function(e) {
var t = e.isVisible,
n = e.isFixed,
i = e.fixedHeight,
o = e.onClick,
r = d()({
"connections-update-button": !0,
"is-hidden": !t,
"is-fixed": n
}),
s = n ? {
top: i
} : void 0;
return (0, f.jsx)("div", {
className: r,
style: s,
children: (0, f.jsx)("div", {
className: "connections-update-button__snackpill",
children: (0, f.jsx)(m.Z, {
icon: "generic-chevron-down",
text: h.ZP.get(444),
onClick: o
})
})
})
};
function v(e, t) {
return v = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, v(e, t)
}
var b = function(e) {
var t,
n;
function i(t) {
var n;
return (n = e.call(this, t) || this).state = {
isFixed: !1
}, n.onScroll = n.onScroll.bind(function(e) {
if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}(n)), n
}
n = e,
(t = i).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
v(t, n);
var o = i.prototype;
return o.getSnapshotBeforeUpdate = function(e) {
return !e.isVisible && this.props.isVisible ? this.getButtonPosition() : null
}, o.componentDidUpdate = function(e, t, n) {
!e.isVisible && this.props.isVisible ? (null !== n && this.updatePosition(n), a.Z.addEventListener("scroll", this.onScroll)) : !this.props.isVisible && e.isVisible && a.Z.removeEventListener("scroll", this.onScroll)
}, o.componentWillUnmount = function() {
a.Z.removeEventListener("scroll", this.onScroll)
}, o.onScroll = function() {
this.updatePosition(this.getButtonPosition())
}, o.getButtonPosition = function() {
return (0, p.Z)(this.props.containerRef.current).offset().top - a.Z.scrollY
}, o.updatePosition = function(e) {
var t = e <= this.props.fixedHeight;
this.setState({
isFixed: t
})
}, o.render = function() {
return (0, f.jsx)(g, {
isVisible: this.props.isVisible,
isFixed: this.state.isFixed,
fixedHeight: this.props.fixedHeight,
onClick: this.props.onClick
})
}, i
}(i.Component),
y = n(58509),
x = n(66515),
S = n(42308),
_ = n(97381),
C = n(83900),
j = n(99935),
P = function(e) {
var t = d()({
"chat-connections-fader": !0,
"is-dark": e.isDark
}),
n = e.onClick ? "button" : "div";
return (0, f.jsx)(n, {
className: t,
onClick: e.onClick
})
},
k = function(e) {
var t,
n = e.emptyPromo,
o = e.showFullscreenPromo,
r = e.deleteButton,
s = e.hasUsers,
a = e.isLoading,
c = e.isEditing,
l = e.isFrozen,
u = e.hasMatchBarStories,
p = e.matchBar,
m = e.connectionsList,
g = e.containerRef,
v = e.screenRef,
k = e.onClickNewActivityButton,
Z = e.navigation,
E = e.sortOptionsButton,
O = e.securityWalkthroughModal,
T = e.currentTab,
I = e.modalRef,
w = e.isReporting,
A = e.reportingId,
N = e.onReportingClose,
R = e.onReportingSuccess,
M = (0, i.useRef)(null),
L = (0, i.useRef)(null),
U = !s && n;
return (0, f.jsxs)("div", {
ref: g,
children: [w ? (0, f.jsx)(y.Z, {
clientSource: 253,
otherUserId: A,
onClose: N,
onReport: R,
onBlock: R
}) : null, (0, f.jsx)("div", {
role: c ? "dialog" : void 0,
"aria-modal": c,
"aria-label": h.ZP.get(418),
ref: I,
tabIndex: -1,
children: (0, f.jsxs)(S.Z, {
innerRef: v,
children: [(0, f.jsx)(C.Z, {
isSticky: !0,
children: (0, f.jsxs)("div", {
ref: M,
children: [Z, o ? null : (0, f.jsx)(i.Fragment, {
children: (0, f.jsxs)("div", {
className: d()("connections__match-bar", {
"connections__match-bar--stories": u
}),
inert: c ? "" : void 0,
children: [p, c ? (0, f.jsx)(P, {}) : null]
})
})]
})
}), (0, f.jsxs)(_.Z, {
align: "stretch",
children: [n && U ? (0, f.jsx)("div", {
className: "connections-empty-container",
"data-qa": "connections-empty",
id: T + "_TABPANEL",
tabIndex: -1,
role: "tabpanel",
"aria-labelledby": T + "_TAB",
children: (0, f.jsxs)("div", {
style: {
margin: "auto 0"
},
children: [(0, f.jsx)(j.Z, {
top: "md",
right: "gap",
bottom: "md",
left: "gap",
children: n
}), (0, f.jsx)("div", {
className: "connections-gap"
})]
})
}) : null, a ? (0, f.jsx)("div", {
className: "connections__loader",
children: (0, f.jsx)("div", {
style: {
width: 46,
height: 46
},
children: (0, f.jsx)(x.Z, {})
})
}) : null, U ? null : (0, f.jsxs)("div", {
className: "connections__content",
id: T + "_TABPANEL",
tabIndex: -1,
role: "tabpanel",
"aria-labelledby": T + "_TAB",
children: [E, (0, f.jsxs)("div", {
className: "connections__items",
children: [(0, f.jsx)("div", {
ref: L,
children: (0, f.jsx)(b, {
isVisible: l,
fixedHeight: null == (t = M.current) ? void 0 : t.clientHeight,
onClick: k,
containerRef: L
})
}), (0, f.jsx)("div", {
className: "connections-items",
children: m
})]
}), (0, f.jsx)("div", {
className: "connections-gap"
})]
}), r]
})]
})
}), O]
})
},
Z = (n(85827), n(19601), n(8657)),
E = n(230),
O = n(48978),
T = n(82362),
I = n(7234),
w = n(48360),
A = n(80374),
N = n(8290),
R = n(93830),
M = n(91016),
L = n(60371),
U = n(2215),
D = n(57871),
B = n(77226),
F = n(2213),
G = n(71030),
V = n(81714),
q = n(34018),
H = {
CLICK: "CLICK"
},
Y = F.Z.extend({
events: {
"click .js-click-action": "onClick_"
},
update: function(e) {
if (Y._super.update.apply(this, arguments), (0, B.Z)(e.picture))
if (e.externalAd) {
var t = M.Z.create(M.Z.placements.CONNECTIONS);
this._reactViewId = this.renderReactView((0, f.jsx)(q.Z, {
adSlot: t,
dataQa: "connections",
innerRef: this.renderExternalAds
}), this.el)
} else
this.render({
picture: e.picture,
icon: e.icon,
titleText: e.title,
descriptionText: e.text,
badgeType: e.badgeType,
mark: e.mark,
ready: e.ready,
isGift: e.isGift,
processing: e.processing
})
},
render: function(e) {
this.$el.html((0, G.Z)("PeopleNearbyFeatureCard", V.Z).render(e))
},
onClick_: function() {
this.trigger(H.CLICK)
},
reset: function() {
return this.reactViewId_ && this.removeReactView(this.reactViewId_), Y._super.reset.apply(this, arguments)
},
renderExternalAds: function(e) {
e && M.Z.render()
}
}, "SimplePromoBlockView");
Y.EVENTS = H;
var Q = Y,
W = n(1165),
z = Q.EVENTS,
K = {
MAIN: "main"
},
J = I.Z.extend({
construct: function(e, t) {
J._super.construct.call(this),
this.name = e,
this.data_ = t;
var n = new Q;
n.on(Q.EVENTS.CLICK, this.onClick_, this),
this.registerView(K.MAIN, n),
this.render()
},
getPromoBlock: function() {
return this.data_.promoBlock
},
isExternalAd: function() {
return this.data_.externalAd
},
render: function() {
var e = Object.assign({}, this.data_, {
processing: this.processing_
});
this.updateView(K.MAIN, e)
},
setParent: function(e) {
this.parent = e,
this.getView(K.MAIN).appendTo(e)
},
onClick_: function() {
this.processing_ || (W.Z.generate(), this.trigger(z.CLICK, this.getPromoBlock()))
},
setProcessing: function(e) {
this.processing_ = e,
this.render()
}
}, "SimplePromoBlockController");
J.EVENTS = z,
J.VIEWS = K;
var X,
$ = J,
ee = n(52861);
function te(e, t) {
return te = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, te(e, t)
}
var ne = [131, 129, 130, 326, 346],
ie = ((X = {})[U.Z.TYPES.MESSAGES] = 26, X[U.Z.TYPES.FAVOURITES] = 23, X[U.Z.TYPES.WANT_TO_MEET_YOU] = 6, X[U.Z.TYPES.VISITORS] = 22, X),
oe = function(e) {
var t,
n;
function i(t) {
var n,
i = t.onPromoClick,
r = t.getActivationPlace,
s = t.getElementType,
a = t.getFolderType,
c = t.setIsShowingSecurityWalkthrough;
return (n = e.call(this, {}) || this).onPromoClick = void 0, n.getActivationPlace = void 0, n.getElementType = void 0, n.getFolderType = void 0, n.setIsShowingSecurityWalkthrough = void 0, n.nextPromoControllerId = 0, n.nextPromoIndex = 0, n.batchedActivities = {}, n.promos = [], n.resetPromoBlockControllers = !0, n.shouldResetShownBlocks = !1, n.usersBeforeNextPromo = 2, n.invisiblePromo = void 0, n.onPromoClick = i, n.getActivationPlace = r, n.getElementType = s, n.getFolderType = a, n.setIsShowingSecurityWalkthrough = c, n._onPromoClick = (0, o.Z)(n._onPromoClick, 500, {
leading: !0,
trailing: !1
}), n
}
n = e,
(t = i).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
te(t, n),
i.sendStatisticsOnBannerPushed_ = function(e) {
if (ae(e)) {
var t = {
variantId: e.variant_id,
event: 2,
context: 127,
promoBlockPosition: 1
};
R.Z.sendProfileQuestionsBannerStats(t)
}
};
var r = i.prototype;
return r.reset = function() {
this.batchedActivities = {},
this.promos = [],
this.nextPromoIndex = 0,
this.usersBeforeNextPromo = 2,
this.resetPromoBlockControllers = !0
}, r.getInvisiblePromo = function() {
return this.invisiblePromo
}, r.getShownPromoBlocks = function() {
return this.shouldResetShownBlocks && (this.promos = [], this.nextPromoIndex = 0, this.shouldResetShownBlocks = !1), l.ZP.getControllers().filter((function(e) {
return e.object.getPromoBlock()
})).map((function(e) {
return e.object.getPromoBlock().promo_block_type
}))
}, r.setPromoBlocks = function(e) {
var t = e.promos;
null != t && t.length && this.setPromos(t)
}, r.process = function(e) {
var t,
n = this,
i = e.items,
o = e.clientUserList,
r = e.isUpdates,
s = o.getPromoBlockResponseParams();
null != s && null != (t = s[0]) && t.getResetShownPromoBlocks() && (this.shouldResetShownBlocks = !0);
var a = o.toJSON().promo_banners;
if (null != a && a.length) {
var c = a.find((function(e) {
return 4 === e.promo_block_position
}));
c && (r && l.ZP.hasTopMostPromo() ? l.ZP.replaceTopMostPromo(c) : this.addPromoBlock(i, c)),
r || a.forEach((function(e) {
var t = e.promo_block_type;
ne.includes(t) && n.addPromoBlock(i, e)
}));
var u = a.find((function(e) {
return 37 === e.promo_block_type
}));
this.invisiblePromo = u || this.invisiblePromo
}
}, r.processUsers = function(e) {
var t = this,
n = e.items;
e.users.forEach((function(e) {
n.push(e),
t.batchedActivities[e.user_id] && n.push(t.batchedActivities[e.user_id])
}))
}, r.prependBanner = function(e) {
var t = l.ZP.getControllers()[0];
if (!t)
return e;
var n = l.ZP.findIndex(t.object);
if (n + e.length > 9) {
var i = n + e.length - 9;
e = [].concat(e.slice(0, i), [this.registerPromoController(this.getNextPromo())], e.slice(i))
}
return e
}, r.appendBanners = function() {
var e = this;
this.nextPromoIndex = 0,
this.usersBeforeNextPromo = 2;
var t = this.resetPromoBlockControllers ? [] : l.ZP.getControllers().map((function(e) {
return e.object
}));
this.resetPromoBlockControllers = !1;
var n = l.ZP.getItems().reduce((function(n, i) {
return i.object instanceof I.Z || (n.push(i.object), e.insertBannerIfNecessary(n, t)), n
}), []);
l.ZP.addPage(n, !0)
}, r.insertBannerIfNecessary = function(e, t) {
var n,
i = e[e.length - 1];
if (i && (i.user_id || (n = i).promo_block_position && 1 === n.promo_block_position && 326 === n.promo_block_type) && this.usersBeforeNextPromo--, this.usersBeforeNextPromo <= 0) {
if (this.promos) {
var o = this.getNextPromo();
if (o)
if (t.length) {
var r = t.shift();
e.push(r),
null == r || r.start()
} else
e.push(this.registerPromoController(o))
}
this.usersBeforeNextPromo = 9
}
}, r.addPromoBlock = function(e, t) {
if (t.place_after_user)
this.batchedActivities[t.place_after_user] = t;
else {
var n = function(e, t) {
var n = !ae(t);
if (!n) {
n = !e.some((function(e) {
return 346 === e.promo_block_type
}))
}
return n
}(e, t);
n && (i.sendStatisticsOnBannerPushed_(t), e.push(t)),
this.usersBeforeNextPromo--
}
var o,
r;
(r = function(e) {
switch (e.promo_block_type) {
case 131:
return 10;
case 129:
return 100;
case 130:
return 101;
case 165:
return 14
}
return null
}(o = t)) && ((0, ee.L9)(258, {
element: r
}), (0, ee.L9)(333, {
element: r,
count: re(o)
}))
}, r.setPromos = function(e) {
var t = e.filter((function(e) {
return 1 === e.promo_block_position && !ne.includes(e.promo_block_type)
}));
this.promos = M.Z.isEnabled() ? [{
externalAd: !0
}] : this.promos.concat(t)
}, r.getNextPromo = function() {
var e;
return this.promos && (e = this.promos[this.nextPromoIndex++], this.nextPromoIndex === this.promos.length && (this.nextPromoIndex = 0)), e
}, r.registerPromoController = function(e) {
var t,
n = O.Z.getUser(),
i = n ? n.gender : 3;
t = e && "externalAd" in e ? {
externalAd: !0,
picture: {}
} : function(e, t) {
var n = e.promo_block_type,
i = function(e) {
var t = e.credits_cost,
n = t || e.mssg,
i = e.header || t && n;
return {
title: i,
text: n
}
}(e),
o = Object.assign({
promoBlock: e,
isGift: 5 === e.ok_payment_product_type,
mark: se(e),
badgeType: A.Z.getBadgeTypeForPromoBlock(n)
}, i),
r = A.Z.getPictureForPromoBlockTS(e, {
gender: t
});
r.type === w.Z.IMAGE_TYPE.URL && (o.picture = {
url: r.value,
disableMasking: r.disableMasking
});
r.type === w.Z.IMAGE_TYPE.SYMBOL && (o.icon = r.value);
return o.gender = t, o
}(e, i);
var o = "promo-" + this.nextPromoControllerId++,
r = new $(o, t);
return r.on($.EVENTS.CLICK, this._onPromoClick.bind(this, r)), this.registerController(o, r), r.start(), r
}, r._onPromoClick = function(e, t, n) {
if (t) {
switch (this.onPromoClick(), e.setProcessing(!0), this.trackClickBannerEvent(t), t.promo_block_type) {
case 65:
(0, ee.L9)(332, {
element: 547
}),
E.Z.navigate(T.x.SPP_TRIAL, !1, {
returnTo: E.Z.getUrl(),
context: 26,
activationPlace: 191,
fromBanner: !0
});
break;
case 195:
this.setIsShowingSecurityWalkthrough();
break;
default:
(0, ee.L9)(332, {
element: 95,
parent_element: this.getElementType()
}),
this.performAction(t.ok_action, t, n)
}
var i = (0, Z.Z)(this.rotatePromoControllers.bind(this, e));
A.Z.once(A.Z.EVENTS.END_PAYMENT, i)
}
}, r.performAction = function(e, t, n) {
switch (e) {
case 9:
case 4:
case 2:
A.Z.handlePromoSelected({
action: e,
activationPlace: this.getActivationPlace(),
banner: t.promo_block_type,
cost: t.payment_amount,
productType: t.ok_payment_product_type
}, {
from: E.Z.getUrl()
});
break;
case 6:
this.navigateToSppPayment(t, n);
break;
default:
D.Z.showNotification({
type: D.Z.TYPES.ERROR
})
}
}, r.navigateToSppPayment = function(e, t) {
var n = e.ok_payment_product_type,
i = e.promo_block_type,
o = {
activationPlace: this.getActivationPlace(),
bannerId: e.promo_block_type
},
r = {
back: E.Z.getUrl(),
hotPanelData: o,
productType: n,
promoBlockType: i
};
null != t && t.userId && (r.userId = t.userId),
N.Z.navigateToPayment(r)
}, r.rotatePromoControllers = function(e) {
var t = this;
e.setProcessing(!1);
var n = l.ZP.findIndex(e);
this.fetch({
shownPromoBlocks: this.getShownPromoBlocks(),
excludePromoBlocks: [e.getPromoBlock().promo_block_type],
count: l.ZP.getControllers().length
}).then((function(e) {
var i = e[0].toJSON().promo_blocks;
if (i) {
var o = l.ZP.getControllers().map((function(e) {
return l.ZP.findIndex(e.object)
}));
o = [].concat(o.slice(o.indexOf(n)), o.slice(0, o.indexOf(n))).slice(0, i.length),
i.forEach((function(e, n) {
if (void 0 !== o[n]) {
var i = t.registerPromoController(e);
l.ZP.replaceItem({
object: i,
key: "promoController" + n
}, o[n])
}
}))
}
}))
}, r.fetch = function(e) {
var t = e.shownPromoBlocks,
n = e.excludePromoBlocks,
i = e.count;
return L.Z.getInstance().get({
context: this.getClientSource(),
position: 1,
shownPromoBlocks: t,
excludePromoBlocks: n,
count: i || 4
})
}, r.getClientSource = function() {
return ie[this.getFolderType()] || 127
}, r.trackClickBannerEvent = function(e) {
var t = {
banner_id: e.promo_block_type,
position_id: e.promo_block_position,
context: this.getClientSource()
},
n = e.stats_variation_id;
n && (t.variation_id = n),
(0, ee.L9)(139, t)
}, i
}(I.Z);
function re(e) {
var t = e.pictures,
n = null == t ? void 0 : t.find((function(e) {
return 2 === e.badge_type
}));
return n && Number(n.badge_text) || 0
}
function se(e) {
var t,
n = null == (t = e.pictures) ? void 0 : t[0],
i = e.counter || (null == n ? void 0 : n.badge_text);
return i ? {
text: i,
type: 41 === e.promo_block_type ? "double-credits-badge" : null
} : null
}
function ae(e) {
return 346 === e.promo_block_type
}
var ce = oe,
le = n(24953),
ue = n(12462),
de = n(68091),
pe = n(83167),
he = n(6662),
me = n(18987),
fe = n(42174);
function ge(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function ve(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? ge(Object(n), !0).forEach((function(t) {
be(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ge(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function be(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
var ye = function(e) {
var t,
n,
o,
r,
s = e.promoBlock,
a = e.onClick,
c = e.sendTrackingOnMount;
(0, i.useEffect)((function() {
c()
}), []);
var l,
u = null == (t = s.pictures) ? void 0 : t[0].badge_type;
u && (r = 7 === u ? "badge-feature-extra-shows" : void 0),
20 === s.promo_block_position && (r = 12 === s.promo_block_type ? "badge-add-photos" : "badge-email");
var d,
p = null == (n = s.buttons) ? void 0 : n[0];
p && (l = {
text: p.text,
onClick: function() {
return a(s, 0)
},
dataQA: {
"data-qa": "continue-button"
}
});
var h = null == (o = s.buttons) ? void 0 : o[1];
return h && (d = {
semantic: "tertiary",
text: h.text,
onClick: function() {
return a(s, 1)
},
dataQA: {
"data-qa": "continue-secondary-button"
}
}), (0, f.jsxs)(le.Z, {
align: "start",
children: [r ? (0, f.jsx)(ue.Z, {
size: "icon",
children: (0, f.jsx)(fe.Z, {
name: r
})
}) : null, (0, f.jsx)(pe.Z, {
text: s.header
}), (0, f.jsx)(he.Z, {
text: s.mssg
}), (0, f.jsxs)(de.Z, {
children: [l ? (0, f.jsx)(me.Z, ve({}, l)) : null, d ? (0, f.jsx)(me.Z, ve({}, d)) : null]
})]
})
},
xe = n(45752);
function Se(e, t) {
return Se = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, Se(e, t)
}
var _e = function(e) {
var t,
n;
function o(t) {
var n;
return (n = e.call(this, t) || this).scrollsSkipped_ = 0, n.hasStarted = !1, n.onScroll = (0, s.Z)(n.onScroll.bind(function(e) {
if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}(n)), 250), n
}
n = e,
(t = o).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
Se(t, n);
var r = o.prototype;
return r.componentDidMount = function() {
a.Z.addEventListener("scroll", this.onScroll, !1)
}, r.componentWillUnmount = function() {
clearTimeout(this.scrollHandlerTimeout_),
a.Z.removeEventListener("scroll", this.onScroll, !1)
}, r.componentDidUpdate = function() {
if (!this.hasStarted && this.props.items.length > 0) {
this.hasStarted = !0;
var e = a.Z.document.body.pageYOffset || (0, xe.Z)().scrollTop;
this.props.scrollHandler(e)
}
}, r.onScroll = function() {
var e = this,
t = a.Z.document.body.pageYOffset || (0, xe.Z)().scrollTop,
n = a.Z.document.body.innerHeight || a.Z.document.body.clientHeight,
i = (0, xe.Z)().scrollHeight - n - .5 * n;
t >= i && this.props.fetchNewPage(),
clearTimeout(this.scrollHandlerTimeout_),
this.scrollsSkipped_ += 1,
this.props.scrollHandler && this.scrollsSkipped_ > 5 ? (this.scrollsSkipped_ = 0, this.props.scrollHandler(t)) : this.scrollHandlerTimeout_ = setTimeout((function() {
e.props.scrollHandler(t)
}), 500)
}, r.render = function() {
return i.Children.only(this.props.children)
}, o
}(i.Component),
Ce = n(43018),
je = (n(91058), n(86273)),
Pe = n(57896),
ke = n(94273),
Ze = n(27503),
Ee = n(67047),
Oe = n(90794),
Te = n(60822),
Ie = n(29160),
we = n(92823),
Ae = n(40559),
Ne = n(77110),
Re = n(57384),
Me = function(e) {
var t,
n = e.user,
o = e.badge,
r = e.mediaOverlay,
s = e.halo,
a = e.tag,
c = e.moodStatus,
l = e.lastMessageStatus,
u = e.message,
p = e.isChecked,
h = e.isLocked,
m = e.isDisabled,
g = e.isDeleting,
v = e.isFavouriteAllowed,
b = e.onClick,
y = e.onFavourite,
x = e.userRef,
S = e.isAddedHACK,
_ = e.a11y,
C = d()({
"csms-connections-item": !0,
"csms-connections-item--user": !0,
"csms-connections-item--disabled": m,
"js-mw-connections-item": !0,
"js-mw-connections-item--is-checked": !m && p,
"mw-connections-item--is-added-hack": S,
"is-deleted": g
}),
j = d()({
"csms-connections-item__favourite": !0,
"csms-is-active": n.isFavourite
});
(p || r) && (t = {
children: (0, f.jsxs)(i.Fragment, {
children: [p ? (0, f.jsx)("span", {
className: "csms-connections-item__media-icon",
children: (0, f.jsx)(fe.Z, {
name: "generic-check"
})
}) : null, r]
}),
background: p ? "primary" : "transparent"
});
var P = "user" + n.id,
k = (0, f.jsxs)(i.Fragment, {
children: [(0, f.jsx)("span", {
className: "csms-connections-item__profile",
children: (0, f.jsx)(Re.BB, {
color: "black",
children: (0, f.jsx)(Te.Z, {
name: n.name,
age: n.age,
status: n.status,
a11y: {
label: null == _ ? void 0 : _.profileInfoLabel
}
})
})
}), c ? (0, f.jsx)("span", {
className: "csms-connections-item__mood-status",
"aria-hidden": !0,
children: (0, f.jsx)(Oe.Z, {
size: "16px",
text: c,
visuallyCorrected: !0
})
}) : null, a ? (0, f.jsxs)("span", {
className: "csms-connections-item__tag",
children: [(0, f.jsx)(ke.Z, {
children: ","
}), (0, f.jsx)(Ze.Z, {
text: a.text,
size: "small",
styling: a.styling
})]
}) : null]
});
return (0, f.jsx)("div", {
className: C,
"data-qa": "connections-item",
"data-qa-connections-item-type": "user",
"data-qa-blocking-promo": h ? "locked" : null,
"aria-hidden": m,
children: (0, f.jsxs)(Ie.Z, {
children: [(0, f.jsx)(Ne.Z, {
children: (0, f.jsx)("div", {
className: "csms-connections-item__media",
children: (0, f.jsx)(Ee.Z, {
size: "sm",
user: n,
badge: o,
halo: s,
overlay: t
})
})
}), (0, f.jsxs)(we.Z, {
children: ["toggle" !== (null == _ ? void 0 : _.role) ? (0, f.jsx)("button", {
className: "csms-connections-item__user",
onClick: b,
disabled: m,
"data-qa": "connections-item-content",
ref: x,
"aria-describedby": u ? P : void 0,
children: k
}) : (0, f.jsxs)("label", {
className: "csms-connections-item__user",
"data-qa": "connections-item-content",
ref: x,
children: [k, (0, f.jsx)("input", {
className: "csms-connections-item__checkbox",
type: "checkbox",
defaultChecked: p,
onChange: function(e) {
null == b || b()
},
"aria-label": null == _ ? void 0 : _.profileInfoLabel
})]
}), u ? (0, f.jsxs)("div", {
className: "csms-connections-item__message",
"data-qa": "csms-connections-item__message",
id: P,
children: [l ? (0, f.jsx)("div", {
className: "csms-connections-item__message-read-receipt-status",
"aria-hidden": !0,
children: (0, f.jsx)(fe.Z, {
name: "generic-read-receipt",
color: "seen" === l ? "feature-revenue" : "gray-30"
})
}) : null, (0, f.jsx)(Re.P2, {
ellipsis: !0,
dangerous: !0,
children: u
}), (0, f.jsx)(ke.Z, {
children: null == _ ? void 0 : _.messageStatusLabel
})]
}) : null]
}), v ? (0, f.jsx)(Ae.Z, {
children: (0, f.jsx)("button", {
className: j,
onClick: y,
"data-qa": "favourite",
"data-qa-favourited": n.isFavourite ? "true" : "false",
"aria-pressed": n.isFavourite,
children: (0, f.jsx)(fe.Z, {
name: n.isFavourite ? "generic-star" : "generic-star-outlined",
a11y: {
label: null == _ ? void 0 : _.favouriteLabel
}
})
})
}) : null]
})
})
};
Me.defaultProps = {
isFavouriteAllowed: !0
};
var Le = Me,
Ue = function(e) {
var t,
n = e.image,
o = e.icon,
r = e.user,
s = e.badge,
a = e.mediaOverlay,
c = e.title,
l = e.message,
u = e.action,
p = e.isProcessing,
h = e.isDisabled,
m = e.onClick,
g = e.innerRef,
v = e.isAddedHACK,
b = d()({
"csms-connections-item": !0,
"csms-connections-item--promo": !0,
"csms-connections-item--disabled": h,
"js-mw-connections-item": !0,
"mw-connections-item--is-added-hack": v
});
return (p || a) && (t = {
children: (0, f.jsxs)(i.Fragment, {
children: [p ? (0, f.jsx)("span", {
className: "csms-connections-item__loader-wrapper",
children: (0, f.jsx)(x.Z, {})
}) : null, a]
}),
background: p ? "dark" : "transparent"
}), (0, f.jsx)("button", {
className: b,
onClick: m,
"data-qa": "connections-item",
"data-qa-connections-item-type": "promo",
ref: g,
disabled: h,
"aria-hidden": h,
children: (0, f.jsxs)(Ie.Z, {
tag: "span",
children: [(0, f.jsx)(Ne.Z, {
tag: "span",
children: (0, f.jsx)("span", {
className: "csms-connections-item__media",
children: (0, f.jsx)(Ee.Z, {
size: "sm",
image: n,
icon: o,
user: r,
badge: s,
overlay: t
})
})
}), (0, f.jsxs)(we.Z, {
tag: "span",
children: [c ? (0, f.jsx)("span", {
className: "csms-connections-item__title",
children: (0, f.jsx)(Re.P2, {
dangerous: !0,
children: c
})
}) : null, l ? (0, f.jsx)("span", {
className: "csms-connections-item__message",
"data-qa": "csms-connections-item__message",
children: (0, f.jsx)(Re.P2, {
dangerous: !0,
children: l
})
}) : null, u ? (0, f.jsx)("span", {
className: "csms-connections-item__action",
children: (0, f.jsx)(Re.P2, {
children: u
})
}) : null]
})]
})
})
},
De = function(e) {
var t = e.icon,
n = e.title,
i = e.onClick,
o = d()({
"csms-connections-item": !0,
"csms-connections-item--promo-video": !0
});
return (0, f.jsx)("button", {
className: o,
"data-qa": "connections-item",
"data-qa-connections-item-type": "promo-video",
"data-qa-feature-card": !0,
onClick: i,
children: (0, f.jsxs)(Ie.Z, {
tag: "span",
children: [(0, f.jsx)(Ne.Z, {
tag: "span",
children: (0, f.jsx)("span", {
className: "liked-you-media",
children: (0, f.jsx)(Ee.Z, {
size: "sm",
icon: t
})
})
}), (0, f.jsx)(we.Z, {
tag: "span",
children: (0, f.jsx)("span", {
"data-qa": "connections-item__title",
children: (0, f.jsx)(Re.P1, {
color: "black",
dangerous: !0,
tag: "span",
children: n
})
})
})]
})
})
},
Be = (n(39714), n(52306)),
Fe = function(e) {
var t = e.images,
n = e.counter,
i = e.title,
o = e.isDisabled,
r = e.onClick,
s = d()({
"csms-connections-item": !0,
"csms-connections-item--disabled": o
}),
a = d()({
"liked-you-media__image": !0,
"liked-you-media__image--multiple": t.length > 3
}),
c = t.length > 3 ? t.map((function(e) {
return "url(" + e + ")"
})).toString() : "url(" + t[0] + ")";
return (0, f.jsx)("button", {
className: s,
"data-qa": "connections-item",
"data-qa-connections-item-type": "liked-you",
"data-qa-feature-card": !0,
onClick: r,
disabled: o,
"aria-hidden": o,
children: (0, f.jsxs)(Ie.Z, {
tag: "span",
children: [(0, f.jsx)(Ne.Z, {
tag: "span",
children: (0, f.jsxs)("div", {
className: "liked-you-media",
children: [(0, f.jsx)("span", {
className: a,
style: {
backgroundImage: c
}
}), (0, f.jsx)("span", {
className: "liked-you-media__badge",
children: (0, f.jsx)(Be.Z, {
icon: "generic-heart",
text: n,
styling: "liked-you",
shadow: !0
})
})]
})
}), (0, f.jsx)(we.Z, {
tag: "span",
children: (0, f.jsx)("span", {
"data-qa": "connections-item__title",
children: (0, f.jsx)(Re.P1, {
color: "black",
dangerous: !0,
tag: "span",
children: i
})
})
})]
})
})
},
Ge = function(e) {
var t,
n = e.position,
i = void 0 === n ? "tr" : n,
o = e.children,
r = d()(((t = {
petal: !0
})["petal--" + i] = !0, t));
return (0, f.jsx)("div", {
className: r,
children: o
})
},
Ve = (n(74916), n(2025)),
qe = n(96437),
He = n(2568),
Ye = n.n(He),
Qe = ["", Ve.jr.CHATS, Ve.jr.CONVERSATIONS, Ve.jr.UNREPLIED, Ve.jr.FAVOURITES, Ve.jr.ONLINE];
function We(e) {
switch (e.connection_status_indicator) {
case 2:
return {
text: h.ZP.get(463).toUpperCase(),
styling: "selected"
};
case 4:
return {
text: h.ZP.get(143).toUpperCase(),
styling: "default"
};
default:
return
}
}
function ze(e) {
switch (e.last_message_status) {
case 1:
return "delivered";
case 2:
return "seen";
default:
return
}
}
function Ke(e) {
var t,
n = e.item,
i = e.isEditing,
o = e.isUpdate,
r = n.promo_block_type || n.experimentType,
s = n.pictures,
a = s ? s[0].badge_text : null,
c = s ? s[0].display_images : null;
a && (t = Number(a.replace(/\D/g, "")) <= 99 ? a : "99+");
var l = n.header,
u = n.mssg;
return 346 === r && (l = u), {
imgSrc: c,
counter: t,
title: l,
message: u,
isDisabled: i,
isAddedHACK: o
}
}
function Je(e) {
return e.is_conversation || e.unread_messages_count > 0 ? 15 : e.is_match ? 11 : e.is_crush ? 22 : 2 === e.their_vote ? 4 : e.favourited_you ? 23 : e.is_favourite ? 24 : e.is_visitor ? 25 : void 0
}
function Xe(e, t) {
var n = e.is_crush;
if (n && t.param === Ve.jr.FAVOURITES)
return 1;
var i = e.is_unread,
o = e.unread_messages_count || 0,
r = o > 0 && Qe.indexOf(t.param) > -1,
s = !r && !n && i && e.is_match;
return s || n || !r ? s || n || !i ? 0 : 1 : o
}
function $e(e) {
switch (e) {
case 21:
return "generic-play-circle-hollow";
case 346:
return "badge-feature-icebreaker";
default:
return "badge-feature-liked-you"
}
}
var et = n(21346),
tt = n(45450),
nt = n(42345);
function it(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function ot(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? it(Object(n), !0).forEach((function(t) {
rt(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : it(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function rt(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
function st(e) {
if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}
function at(e, t) {
return at = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, at(e, t)
}
var ct = je.Z.getLogger("ConnectionsItemContainer"),
lt = function(e) {
var t,
n;
function i(t) {
var n;
return (n = e.call(this, t) || this).handleClick = function() {
var e = n.props;
(0, e.onClick)(e.item)
}, n.handleLikedYouClick = function(e) {
return function() {
var t;
n.handleClick(),
t = parseInt(e, 10),
(0, ee.L9)(333, {
element: 5,
count: t
})
}
}, n.handleClick = n.handleClick.bind(st(n)), n.handleLikedYouClick = n.handleLikedYouClick.bind(st(n)), n.handleFavourite = n.handleFavourite.bind(st(n)), n.state = i.getState(t), n
}
n = e,
(t = i).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
at(t, n),
i.getState = function(e) {
var t = (e || {}).item,
n = (0, l.NU)(t),
i = (0, l.$Y)(t) && 1 === t.promo_block_position && 2 === t.stats_variation_id,
o = (0, l.$Y)(t) && 1 === t.promo_block_position && 326 === t.promo_block_type,
r = (0, l.$Y)(t) && 20 === t.promo_block_position && 326 === t.promo_block_type,
s = (0, l.$Y)(t) && 4 === t.promo_block_position && 21 === t.promo_block_type,
a = (0, l.$Y)(t) && 1 === t.promo_block_position && 346 === t.promo_block_type;
return {
isUser: n,
isLikedYou: i,
isMoreLikesPromo: o,
isVideoPromo: s,
isPromo: o || s || a,
isConnectionItem: (0, l.$Y)(t) && !r
}
};
var o = i.prototype;
return o.handleFavourite = function(e) {
e.stopPropagation();
var t = this.props;
(0, t.onFavourite)(t.item)
}, o.renderUser = function() {
var e,
t = this,
n = function(e) {
var t,
n,
i,
o,
r = e.item,
s = e.isChecked,
a = e.isEditing,
c = e.isUpdate,
l = r,
u = (null == (t = l.profile_photo) ? void 0 : t.large_url) && w.Z.getImageUrlForSize(null == (n = l.profile_photo) ? void 0 : n.large_url, 70),
d = l.is_deleted,
p = l.is_invisible,
h = l.is_unread,
m = !p && 30 !== l.access_level,
f = parseInt(Ye()(l.user_id), 16),
g = String(f % 9 + 1),
v = u || d ? null : {
letter: l.name ? l.name.charAt(0) : "",
variant: g
};
return d ? o = "deleted" : p && (o = "invisible"), {
user: {
name: l.name,
age: l.age,
gender: (0, qe.gp)(l.gender),
isFavourite: l.is_favourite,
disguise: o,
photo: u ? {
src: u
} : null,
placeholder: v,
status: {
online: (0, qe.GA)(l.online_status)
},
moodStatusEmoji: null == (i = l.mood_status) ? void 0 : i.emoji,
id: l.user_id
},
connectionStatusIndicator: We(l),
message: l.display_message,
lastMessageStatus: ze(l),
isChecked: s,
isLocked: !!l.profile_blocker_promo,
isDisabled: a && !m || l.is_not_interested,
isFavouriteAllowed: !a && l.allow_add_to_favourites,
isAddedHACK: c,
isNew: h
}
}(this.props),
i = n.user,
o = n.message,
r = n.lastMessageStatus,
s = n.isChecked,
a = n.isLocked,
c = n.isDisabled,
l = n.isFavouriteAllowed,
u = n.isAddedHACK,
d = n.connectionStatusIndicator,
p = n.isNew;
return (0, f.jsx)(Pe.Z, {
src: null == (e = i.photo) ? void 0 : e.src,
render: function(e) {
var n,
m = e.src,
g = ot(ot({}, i), {}, {
id: (0, tt.xY)(i.id),
photo: m ? {
src: m
} : null
}),
v = [i.age ? h.ZP.get(807, {
name: i.name,
age: i.age
}) : i.name, "online" === (null == (n = i.status) ? void 0 : n.online) ? h.ZP.get(847) : void 0];
return (0, f.jsx)(Le, {
user: g,
message: o,
lastMessageStatus: r,
isChecked: s,
isLocked: a,
isDisabled: c,
isDeleting: t.props.isDeleting,
isFavouriteAllowed: l,
onClick: t.handleClick,
onFavourite: t.handleFavourite,
tag: d,
moodStatus: (0, et.lM)() ? i.moodStatusEmoji : void 0,
isAddedHACK: u,
mediaOverlay: p ? (0, f.jsx)(Ge, {
children: (0, f.jsx)("div", {
className: "connections-dot-counter-notification"
})
}) : void 0,
a11y: {
favouriteLabel: h.ZP.get(144) + ", " + g.name,
role: t.props.isEditing ? "toggle" : "cta",
profileInfoLabel: (0, nt.s)(v)
}
})
}
})
}, o.renderLikedYou = function() {
var e,
t = this.props.item,
n = Ke(this.props),
i = n.title,
o = n.isDisabled,
r = null == (e = t.extra_texts) ? void 0 : e[0].text,
s = t.pictures.map((function(e) {
return e.display_images
}));
return (0, f.jsx)(Fe, {
counter: r,
title: i,
images: s,
isDisabled: o,
onClick: this.handleLikedYouClick(r)
})
}, o.renderPromo = function() {
var e,
t = this.props.item,
n = Ke(this.props),
i = n.title,
o = n.isDisabled,
r = t.promo_block_type,
s = 21 === r,
a = 346 === r,
c = {
name: $e(r)
},
l = s || a ? void 0 : {
mark: {
text: null == (e = t.extra_texts) ? void 0 : e[0].text
}
},
u = s ? De : Ue;
return (0, f.jsx)(u, {
icon: c,
badge: l,
title: i,
isDisabled: o,
onClick: this.handleClick
})
}, o.renderConnectionItem = function() {
var e = Ke(this.props),
t = e.imgSrc,
n = e.counter,
i = e.title,
o = e.message,
r = e.isDisabled,
s = e.isAddedHACK;
return (0, f.jsx)(Ue, {
image: {
src: t
},
title: i,
message: o,
isDisabled: r,
isAddedHACK: s,
onClick: this.handleClick,
mediaOverlay: Boolean(n) ? (0, f.jsx)(Ge, {
children: (0, f.jsx)("div", {
className: "connections-dot-counter-notification"
})
}) : void 0
})
}, o.render = function() {
var e = this.state,
t = e.isUser,
n = e.isLikedYou,
i = e.isPromo,
o = e.isConnectionItem;
return t ? this.renderUser() : n ? this.renderLikedYou() : i ? this.renderPromo() : o ? this.renderConnectionItem() : (ct.error("Connections - trying to render an unexpected item: " + this.props.item), null)
}, i
}(i.Component),
ut = lt,
dt = function(e) {
var t = e.children;
return (0, f.jsx)("ul", {
className: "csms-connections-list",
children: i.Children.map(t, (function(e) {
return (0, f.jsx)("li", {
className: "csms-connections-list__item",
"data-qa": "connections-list-item",
children: e
})
}))
})
};
function pt(e, t) {
return pt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, pt(e, t)
}
var ht = function(e) {
var t,
n;
function i() {
for (var t, n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return (t = e.call.apply(e, [this].concat(i)) || this).element = null, t
}
n = e,
(t = i).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
pt(t, n);
var o = i.prototype;
return o.componentDidMount = function() {
this.props.controller.setParent((0, p.Z)(this.element))
}, o.render = function() {
var e = this,
t = this.props.controller.isExternalAd(),
n = d()({
"chat-connections-list-banner": !0,
"is-external-ad": t
});
return (0, f.jsxs)("div", {
className: n,
"data-qa": "connections-item",
"data-qa-connections-item-type": "promo",
ref: function(t) {
e.element = t
},
"aria-hidden": this.props.isEditing,
inert: this.props.isEditing ? "" : void 0,
children: [this.props.isEditing ? (0, f.jsx)(P, {}) : null, (0, f.jsx)("div", {
className: "b-link"
})]
})
}, i
}(i.Component),
mt = ht,
ft = n(49952),
gt = je.Z.getLogger("ConnectionsList"),
vt = function(e) {
var t = e.containerRef,
n = e.items,
i = e.currentFilter,
o = e.isEditing,
r = e.isLoading,
s = e.onSelectItem,
a = e.onFavouriteItem,
c = e.onItemVisible,
u = e.onBannerVisible,
d = e.getUserSubstitute;
if (!n)
return null;
var p = function(e) {
if (e instanceof I.Z && u(e), (0, l.NU)(e)) {
var t = e;
if (3 === t.type)
!function(e) {
if (e) {
var t = e.connectionPromoCard;
(0, ee.L9)(138, {
banner_id: null == t ? void 0 : t.hotpanelData.bannerId,
context: 127
})
}
}(d(t.user_id));
else {
var n = i;
(0, ee.L9)(623, {
encrypted_user_id: t.user_id,
activation_place: n.activationPlace || 1,
badge_count: Xe(t, n),
connection_status: Je(t)
})
}
var o = e.is_unread,
r = !0 === e.is_visitor;
o && r && c(e)
} else
(0, l.$Y)(e) && u && u(e)
},
h = function(e) {
var t = e.object,
n = e.isUpdate,
i = e.isChecked,
r = e.isDeleting,
c = void 0 !== r && r,
u = t instanceof I.Z,
d = (0, l.NU)(t) || (0, l.$Y)(t);
return u ? (0, f.jsx)(mt, {
controller: t,
isEditing: o
}) : d ? (0, f.jsx)(ut, {
item: t,
isChecked: i,
isEditing: o,
isUpdate: n,
isDeleting: c,
onClick: s,
onFavourite: a
}) : (gt.error("Connections - trying to render an unexpected item: " + t), null)
};
return (0, f.jsxs)("div", {
ref: t,
children: [(0, f.jsx)(dt, {
children: n.map((function(e) {
return (0, f.jsx)(ft.Z, {
onIntersect: function() {
return p(e.object)
},
children: h(e)
}, e.key)
}))
}), r ? (0, f.jsx)(Ce.ZP, {
relative: !0,
size: Ce.Xt.SMALL,
color: Ce.IX.DARK,
extraClass: "js-loader"
}) : null]
})
};
function bt(e, t) {
return bt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, bt(e, t)
}
var yt,
xt = function(e) {
var t,
n;
function o(t) {
var n;
return (n = e.call(this, t) || this).divContainer = void 0, n.lastVisibleElement = void 0, n.handleSelectItem = function(e) {
var t = l.ZP.findIndex(e),
i = l.ZP.get(t);
if (void 0 !== i) {
if (n.props.isEditing) {
if (!(0, l.NU)(i.object) || i.object.is_invisible || 30 === i.object.access_level)
return;
i.isChecked = !i.isChecked,
l.ZP.replaceItem(i, t),
n.setState({
items: l.ZP.getItems(n.props.currentTab, n.props.currentPromoContext, n.props.currentSortOption)
})
} else
i.isChecked || n.props.onSelectItem(e, t);
return !1
}
}, n.handleScroll = function(e) {
var t = n.calculateLastVisibleItemIndex(e);
t > -1 && n.props.onTrackScroll(t)
}, n.divContainer = (0, i.createRef)(), n.state = {
markedUserIds: [],
items: l.ZP.getItems(n.props.currentTab, n.props.currentPromoContext, n.props.currentSortOption)
}, n
}
n = e,
(t = o).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
bt(t, n);
var r = o.prototype;
return r.componentDidUpdate = function() {
(0, qe.co)((0, p.Z)(this.divContainer.current).find(".js-mw-connections-item.mw-connections-item--is-added-hack"), (function() {
l.ZP.removeUpdatedFlags()
}))
}, r.calculateLastVisibleItemIndex = function(e) {
var t,
n = this.lastVisibleElement || (0, p.Z)(this.divContainer.current).children().first();
if (null == (t = n) || !t.length)
return -1;
for (e += a.Z.document.documentElement.offsetHeight; null != (i = n) && i.length;) {
var i,
o = n.next();
if (o.index() < 0 || (0, p.Z)(o).hasClass("js-loader"))
break;
var r = o.offset();
if (r.top + r.height > e)
break;
n = o
}
return this.lastVisibleElement = n, n.index()
}, r.render = function() {
var e = l.ZP.getItems(this.props.currentTab, this.props.currentPromoContext, this.props.currentSortOption);
return (0, f.jsx)(_e, {
items: e,
scrollHandler: this.handleScroll,
fetchNewPage: this.props.onNeedPage,
children: (0, f.jsx)(vt, {
containerRef: this.divContainer,
items: e,
currentFilter: this.props.currentFilter,
isLoading: this.props.isLoading,
isEditing: this.props.isEditing,
onSelectItem: this.handleSelectItem,
onFavouriteItem: this.props.onFavouriteItem,
onItemVisible: this.props.onItemVisible,
onBannerVisible: this.props.onBannerVisible,
getUserSubstitute: this.props.getUserSubstitute
})
})
}, o
}(i.Component),
St = n(88179),
_t = n(27966),
Ct = function(e) {
var t = e.header,
n = e.subHeader,
i = e.popularityLevel,
o = void 0 === i ? St.V7.VERY_LOW : i,
r = e.hasUsers,
s = e.showFullscreenPromo,
a = e.isEditButtonHidden,
c = e.isEditing,
l = e.onClickEdit,
u = e.onClickPopularity,
d = e.onClickNotifications,
p = [{
type: _t.tg.POPULARITY,
level: o,
onClick: u
}, {
type: _t.Us.NOTIFICATION,
onClick: d,
dataQA: {
"data-qa": "activity-inbox"
}
}];
return s || a || !r || null == p || p.unshift({
type: _t.df.BUTTON,
text: c ? h.ZP.get(438) : h.ZP.get(439),
onClick: l
}), (0, f.jsx)(_t.ZP, {
actions: p,
title: {
text: t,
variant: "primary"
},
subTitle: n,
isBalanced: !1
})
},
jt = n(2818),
Pt = n(57376),
kt = n(97481),
Zt = n(31060),
Et = n(12666),
Ot = n(99565),
Tt = n(76812),
It = n(5229),
wt = n(68938);
function At(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function Nt(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? At(Object(n), !0).forEach((function(t) {
Rt(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : At(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function Rt(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
!function(e) {
e[e.CONTROL = 0] = "CONTROL",
e[e.STORIES = 1] = "STORIES"
}(yt || (yt = {}));
var Mt = "sm",
Lt = 70,
Ut = function(e) {
var t = e.pictures;
return (0, f.jsx)("div", {
className: "match-bar-banner-likes-container",
children: (0, f.jsx)("div", {
className: "match-bar-banner-likes",
"data-qa": "match-bar-likes",
children: null == t ? void 0 : t.map((function(e, t) {
var n = {
width: 0,
transition: "width 300ms ease-in-out 0s"
},
i = {
entered: {
width: Lt
}
};
return (0, f.jsx)(Et.ZP, {
appear: !0,
in: !0,
timeout: 300,
children: function(t) {
return (0, f.jsx)("div", {
"data-qa": "match-bar-banner-likes__item",
className: "match-bar-banner-likes__item",
style: Nt(Nt({}, n), i[t]),
children: (0, f.jsx)("img", {
src: w.Z.getImageUrlForSize(e.src, Lt),
alt: "",
width: Lt,
height: Lt
})
})
}
}, "match-bar-likes-item-" + (e.index || t))
}))
})
})
},
Dt = function(e) {
var t,
n,
i,
o,
r = e.pictures,
s = e.message,
a = e.text,
c = e.mode,
l = e.showIcon,
u = e.onClick;
return r && !l && (t = (0, f.jsx)(Ut, {
pictures: r
}), n = a ? {
mark: {
icon: "generic-heart",
text: a,
styling: "liked-you"
}
} : void 0, i = {
position: "outside",
color: "liked-you"
}), r && !l || (o = {
name: "badge-feature-liked-you"
}), (0, f.jsxs)(Tt.Z, {
dataQA: {
"data-qa": "match-bar-banner"
},
children: [(0, f.jsx)(It.Z, {
children: (0, f.jsx)(Ee.Z, {
size: Mt,
icon: o,
content: t,
badge: n,
halo: i,
onClick: u,
a11y: {
actionLabel: a ? h.ZP.get(610, {
num: Number(a) || 0
}) : void 0
}
})
}), c === yt.CONTROL ? (0, f.jsx)(wt.Z, {
children: (0, f.jsx)("div", {
style: {
width: Lt
},
children: (0, f.jsx)(Re.P3, {
color: "black",
ellipsis: !0,
children: s
})
})
}) : null]
})
},
Bt = function(e) {
var t = e.name,
n = e.photo,
i = e.gender,
o = e.isCrush,
r = e.isNew,
s = e.mode,
a = e.onClick,
c = e.onView,
l = e.index,
u = {
gender: i
};
n && (u.photo = {
src: w.Z.getImageUrlForSize(n, Lt)
});
var d = {};
return r && (s === yt.CONTROL ? d.overlay = {
children: (0, f.jsx)(Ge, {
children: (0, f.jsx)("div", {
className: "match-bar-dot-counter-notification"
})
})
} : d.halo = {
position: "inside",
color: "primary"
}), (0, f.jsx)(ft.Z, {
onIntersect: c ? c(!!r, !!o, l) : function() {},
children: (0, f.jsxs)(Tt.Z, {
dataQA: {
"data-qa": "match-bar-user"
},
children: [(0, f.jsx)(It.Z, {
children: (0, f.jsx)(Ee.Z, Nt({
size: Mt,
user: u,
onClick: a
}, d))
}), s === yt.CONTROL ? (0, f.jsx)(wt.Z, {
children: (0, f.jsx)("div", {
style: {
width: Lt
},
children: (0, f.jsx)(Re.P3, {
color: "black",
ellipsis: !0,
children: t
})
})
}) : null]
})
})
},
Ft = function(e) {
var t = e.mode;
return (0, f.jsxs)(Tt.Z, {
children: [(0, f.jsx)(It.Z, {
children: (0, f.jsx)(Ee.Z, {
size: Mt,
content: (0, f.jsx)("div", {
className: "match-bar-placeholder"
})
})
}), t === yt.CONTROL ? (0, f.jsx)(wt.Z, {
children: (0, f.jsx)(Re.P3, {
color: "black",
children: ""
})
}) : null]
})
},
Gt = function(e) {
var t = e.title,
n = void 0 === t ? "" : t,
o = e.banner,
r = e.users,
s = e.mode,
a = void 0 === s ? yt.CONTROL : s,
c = e.isEmpty,
l = e.isSkeleton,
u = e.onScroll,
d = e.onItemViewed;
return c ? (0, f.jsxs)(j.Z, {
top: "md",
bottom: "md",
children: [(0, f.jsx)(j.Z, {
bottom: "lg",
right: "gap",
left: "gap",
children: (0, f.jsx)(Re.kY, {
color: "black",
children: n
})
}), (0, f.jsxs)(Ot.Z, {
spacing: "xlg",
hpadded: !0,
vpadded: !0,
children: [(0, f.jsx)(Dt, Nt(Nt({}, o), {}, {
showIcon: !0,
mode: a
})), [].concat(new Array(3)).map((function(e, t) {
return (0, f.jsx)(Ft, {
mode: a
}, "match-bar-placeholder-" + t)
}))]
})]
}) : l ? (0, f.jsxs)(j.Z, {
top: "md",
bottom: "md",
children: [(0, f.jsx)(j.Z, {
bottom: "lg",
right: "gap",
left: "gap",
children: (0, f.jsx)(Re.kY, {
color: "black",
children: n
})
}), (0, f.jsx)(Ot.Z, {
spacing: "xlg",
hpadded: !0,
vpadded: !0,
children: [].concat(new Array(4)).map((function(e, t) {
return (0, f.jsx)(Ft, {
mode: a
}, "match-bar-placeholder-" + t)
}))
})]
}) : (0, f.jsxs)(j.Z, {
top: "md",
bottom: "md",
children: [(0, f.jsx)(j.Z, {
bottom: "lg",
right: "gap",
left: "gap",
children: (0, f.jsx)(Re.kY, {
color: "black",
children: n
})
}), (0, f.jsxs)(Ot.Z, {
spacing: "xlg",
hpadded: !0,
vpadded: !0,
onScroll: u,
children: [(0, f.jsx)(Dt, Nt(Nt({}, o), {}, {
mode: a
})), null == r ? void 0 : r.map((function(e, t) {
return (0, i.createElement)(Bt, Nt(Nt({}, e), {}, {
mode: a,
onView: d,
index: t,
key: "match-bar-user-" + t
}))
}))]
})]
})
},
Vt = n(49941);
function qt(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function Ht(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? qt(Object(n), !0).forEach((function(t) {
Yt(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : qt(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function Yt(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
var Qt = je.Z.getLogger("MatchBarContainer");
function Wt() {
(0, ee.L9)(195, {
element: 1252,
direction: 6
})
}
var zt,
Kt,
Jt,
Xt = function(e) {
var t = e.hasMatchBarStories,
n = (0, i.useState)(!0),
o = n[0],
r = n[1],
c = (0, i.useState)([]),
l = c[0],
u = c[1],
d = (0, i.useState)(),
p = d[0],
m = d[1],
g = (0, i.useState)(0),
v = g[0],
b = g[1],
y = (0, i.useRef)(l),
x = (0, i.useRef)(v),
S = (0, i.useRef)(),
_ = (0, i.useRef)(null),
C = (0, i.useRef)(""),
j = (0, i.useRef)(!0),
P = (0, i.useRef)(!1),
k = (0, i.useRef)(!1),
Z = (0, i.useRef)(!1),
O = (0, i.useCallback)((function(e) {
var t = {};
return (y.current || []).forEach((function(e) {
t[e.getUserId()] = e
})), e.forEach((function(e) {
var n = e.getUserId();
e.getIsRemoved() ? delete t[n] : t[n] = e
})), Object.keys(t).map((function(e) {
return t[e]
}))
}), [y]),
I = (0, i.useCallback)((function() {
var e = {
clientSource: 127,
sectionRequests: [Ht({
type: 1
}, C && {
pageToken: C.current
})],
folderId: 49,
userFieldFilter: (new Vt.Cxj).setProjection([280, 200, 583, 580, 340, 230, 810, 830]),
preferredCount: 50,
direction: 1
};
return _.current = (0, kt.Z)(U.Z.getInstance().fetch(e, !0, !0)), _.current.then((function(e) {
var n = e[0];
if (!n)
return Qt.error("Server returned no data for match bar"), [null, null];
var i = function(e) {
var t = ((null == e ? void 0 : e.getSection()) || [])[0];
return j.current = null == t ? void 0 : t.getLastBlock(), {
users: (null == t ? void 0 : t.getUsers()) || [],
pageToken: (null == t ? void 0 : t.getPageToken()) || ""
}
}(n),
o = function(e) {
var t = (null == e ? void 0 : e.getPromoBanners()) || [];
if (!t.length)
return;
var n = t[0],
i = n.getPromoBlockType(),
o = n.getPromoBlockPosition(),
r = n.getContext(),
s = n.getMssg();
return 129 === i ? {
type: i,
message: s,
pictures: n.getPictures().map((function(e) {
return e.getDisplayImages()
})),
variation: n.getStatsVariationId(),
text: n.getExtraTexts()[0].getText(),
position: o,
context: r
} : 326 === i ? {
type: i,
position: o,
context: r,
message: s
} : void 0
}(n),
r = i.users;
return null != C && C.current && (r = O(i.users)), r = t ? r.sort((function(e, t) {
var n = e.getSortTimestamp() + (e.getIsUnread() ? 1e8 : 0);
return t.getSortTimestamp() + (t.getIsUnread() ? 1e8 : 0) - n
})) : r.sort((function(e, t) {
return t.getSortTimestamp() - e.getSortTimestamp()
})), u(r), o && m(o), C.current = i.pageToken, j.current || I(), [r, o]
})).catch((function(e) {
return (0, Zt.Z)(e) && Qt.error("Error requesting match bar folder", {
error: e
}), [null, null]
}))
}), [C, O, j, t]);
(0, i.useEffect)((function() {
y.current = l
}), [l]),
(0, i.useEffect)((function() {
var e;
p && ((0, ee.L9)(333, {
element: 1253,
count: (null == p || null == (e = p.pictures) ? void 0 : e.length) || 0
}), (0, ee.L9)(138, {
banner_id: p.type,
position_id: p.position,
context: p.context,
variation_id: p.variation
}))
}), [p]),
(0, i.useEffect)((function() {
var e = _.current;
return function() {
return null == e ? void 0 : e.cancel()
}
}), []),
(0, i.useEffect)((function() {
var e = function() {
r(jt.Z.getSync(268).enabled)
},
t = function(e) {
var t;
21 === e.id && null != (t = e.folders) && t.includes(49) && I()
},
n = function(e) {
49 === e.folder && I()
},
i = function(e) {
var t = e.from_person_id,
n = e.to_person_id;
if (l.length) {
var i = l.findIndex((function(e) {
return [t, n].includes(e.getUserId())
}));
i > -1 && u([].concat(l.slice(0, i), l.slice(i + 1)))
}
};
return jt.Z.on(jt.Z.EVENTS.UPDATE, e), Pt.NT.onResponse(361, t), Pt.NT.onResponse(138, n), Pt.NT.onResponse(105, i), o && I().then((function(e) {
var t,
n;
e && (e[1] && 129 === e[1].type && e[1].pictures && (n = e[1].pictures.length, S.current = a.Z.setInterval((function() {
10 === x.current || n - 1 === x.current ? a.Z.clearInterval(S.current) : (x.current = x.current + 1, b(x.current))
}), 3e3)), (0, ee.L9)(258, {
element: 1252,
count: (null == (t = e[0]) ? void 0 : t.length) || 0
}))
})), function() {
jt.Z.off(jt.Z.EVENTS.UPDATE, e),
Pt.NT.offResponse(361, t),
Pt.NT.offResponse(138, n),
Pt.NT.offResponse(105, i),
S.current && a.Z.clearInterval(S.current)
}
}), [o]);
var w = function() {
p && (E.Z.navigate(T.x.LIKED_YOU, !1, {
activationPlace: 401
}), (0, ee.L9)(139, {
banner_id: p.type,
position_id: p.position,
context: p.context,
variation_id: p.variation
}))
},
A = function(e, n) {
return function() {
if (function(e, t) {
var n;
n = e.getIsMatch() ? e.getIsUnread() ? 1255 : 1254 : 1256;
(0, ee.L9)(332, {
element: n,
parent_element: 1252,
position: t
})
}(e, n), t) {
var i = l.map((function(e) {
return e.getUserId()
}));
E.Z.navigate(T.x.MATCH_STORIES, {
matchId: e.getUserId(),
matchIds: i
})
} else
E.Z.navigate(T.x.MESSAGES, {
id: e.getUserId(),
userInitiated: !0,
folderId: 49,
context: 127,
activationPlace: 401
})
}
},
N = (0, i.useCallback)((function(e, t, n) {
return function() {
var i = 1254;
P.current && k.current && Z.current || (t ? (i = 1256, Z.current = !0) : e ? (i = 1255, k.current = !0) : P.current = !0, (0, ee.L9)(258, {
element: i,
position: n
}))
}
}), [P, k, Z]),
R = (0, i.useCallback)((function() {
if (l.length) {
var e = l.filter((function(e) {
return !e.getIsCrush()
})),
t = e.filter((function(e) {
return e.getIsUnread()
}));
return t.length ? h.ZP.get(616, {
num: t.length
}) : h.ZP.get(615, {
num: e.length
})
}
return h.ZP.get(617)
}), [l]);
return o ? (0, f.jsx)("div", {
"data-qa": "match-bar",
children: (0, f.jsx)(Gt, Ht(Ht({
title: R()
}, p ? 129 === p.type ? {
banner: {
pictures: p.pictures ? p.pictures.slice(0, v + 1).map((function(e, t) {
return {
src: e,
index: t
}
})) : void 0,
message: p.message || "",
text: p.text || 0,
onClick: w
}
} : {
banner: {
message: p.message || "",
onClick: w
},
isEmpty: !l.length
} : null), {}, {
users: l.length ? l.map((function(e, t) {
var n;
return {
id: e.getUserId(),
name: e.getName(),
photo: null == (n = e.getProfilePhoto()) ? void 0 : n.getLargeUrl(),
gender: (0, qe.gp)(e.getGender()),
isCrush: e.getIsCrush(),
isNew: e.getIsUnread(),
onClick: A(e, t)
}
})) : void 0,
mode: t ? yt.STORIES : yt.CONTROL,
isSkeleton: !l.length && !p,
onScroll: (0, s.Z)(Wt, 300),
onItemViewed: l.length ? N : void 0
}))
}) : null
},
$t = n(29697),
en = function(e) {
var t = e.isActive,
n = e.onClick,
o = (0, i.useRef)(null),
r = (0, i.useState)({}),
s = r[0],
a = r[1];
return (0, f.jsx)($t.Z, {
in: t,
timeout: 300,
mountOnEnter: !0,
unmountOnExit: !0,
onEntering: function() {
o.current && a({
width: o.current.offsetWidth,
height: o.current.offsetHeight
})
},
children: function(e) {
var t = d()({
"floating-action": !0,
"js-connections-actions-edit": !0,
"is-inactive": "entered" !== e
});
return (0, f.jsxs)(i.Fragment, {
children: [(0, f.jsx)("div", {
className: t,
ref: o,
children: (0, f.jsx)("div", {
className: "floating-action__button",
children: (0, f.jsx)(me.Z, {
text: h.ZP.get(472),
onClick: n,
dataQA: {
"data-qa": "connections-button-remove"
}
})
})
}), (0, f.jsx)("div", {
className: "fake",
style: s
})]
})
}
})
},
tn = n(21483),
nn = n(28480),
on = function(e) {
var t = e.header,
n = e.text,
i = e.onReport,
o = e.onDelete,
r = e.onCancel;
return (0, f.jsxs)(tn.Z, {
wrapperType: tn.N.ACTION_SHEET,
header: {
title: t,
text: n
},
onDismiss: r,
children: [(0, f.jsx)(nn.Z, {
text: h.ZP.get(131),
type: "destructive",
onClick: i
}), (0, f.jsx)(nn.Z, {
text: h.ZP.get(140),
onClick: o
})]
})
},
rn = ((Jt = {})[Ve.ph.ALL_MESSAGES] = ((zt = {})[Ve.xL.RECENT] = 1388, zt[Ve.xL.UNREAD] = 224, zt[Ve.xL.CHAT_REQUEST] = 1385, zt[Ve.xL.ONLINE] = 406, zt[Ve.xL.MY_FAVOURITES] = 1390, zt), Jt[Ve.ph.ACTIVITY] = ((Kt = {})[Ve.xL.RECENT] = 1389, Kt[Ve.xL.UNREAD] = 224, Kt[Ve.xL.MATCH] = 354, Kt[Ve.xL.VISIT] = 6, Kt[Ve.xL.FAVOURITED_YOU] = 9, Kt[Ve.xL.MY_FAVOURITES] = 1391, Kt), Jt);
function sn() {
(0, ee.L9)(258, {
element: 1386
})
}
var an = function(e) {
var t = e.text,
n = e.onClick;
return (0, f.jsxs)("button", {
className: "connections-sort-options",
onClick: n,
"data-qa": "connections-sort-options-button",
children: [(0, f.jsx)("span", {
className: "connections-sort-options__icon",
children: (0, f.jsx)(fe.Z, {
name: "generic-filter",
size: "md",
color: "black"
})
}), (0, f.jsx)("span", {
className: "connections-sort-options__text",
children: (0, f.jsx)(Re.aU, {
tag: "span",
children: t
})
})]
})
},
cn = function(e) {
var t = e.currentTab,
n = e.currentSortOption,
i = e.onClick;
return (0, f.jsx)(an, {
text: n.name,
onClick: function() {
var e,
o;
i(),
e = t.type,
o = n.variant,
(0, ee.L9)(332, {
element: 1132,
parent_element: rn[e][o]
})
}
})
},
ln = n(59380),
un = function(e) {
var t = e.options;
return (0, f.jsx)(ln.Z, {
options: t
})
},
dn = function(e) {
var t = e.currentTab,
n = e.onSelectOption,
o = e.hideSortOptions,
r = (0, i.useState)(!0),
s = r[0],
a = r[1],
c = function(e) {
n(e),
function(e, t) {
(0, ee.L9)(332, {
element: rn[e][t],
parent_element: 1386
})
}(t.type, e),
setTimeout((function() {
a(!1)
}), 300)
},
l = t.sortOptions.map((function(e) {
return {
label: e.name,
name: e.variant,
value: e.id.toString(),
isChecked: e.isCurrent,
onChange: function() {
return c(e.variant)
},
onClick: function() {
return t = e.isCurrent, void a(!t);
var t
},
dataQA: {
"data-qa-connections-sort-option": e.variant.toString()
}
}
}));
return (0, f.jsx)(tn.Z, {
isVisible: s,
onAnimationInComplete: sn,
onAnimationOutComplete: o,
isPadded: !0,
children: (0, f.jsx)(un, {
options: l
})
})
},
pn = n(38819),
hn = n(46813),
mn = n(32211),
fn = n(90976),
gn = n(68068),
vn = n(85761),
bn = n(12137),
yn = n(75727),
xn = n(87019),
Sn = n(45318),
_n = n(74837),
Cn = n(27181),
jn = n(73701),
Pn = n(55703),
kn = n(98889),
Zn = n(44991),
En = n(39467),
On = (0, n(36004).yM)(),
Tn = {
update: function(e, t) {
On.trigger(e, t)
},
subscribe: On.subscribe,
unsubscribe: On.unsubscribe
},
In = n(21585),
wn = n(77847),
An = n(92307),
Nn = n(77208),
Rn = n(40053),
Mn = n(34855),
Ln = n(98222),
Un = n(6120),
Dn = n(5971),
Bn = n(73935),
Fn = n(33696),
Gn = n(365),
Vn = function(e) {
var t = e.connectionsList,
n = e.emptyPromo,
o = e.matchBar,
r = e.sortOptionsButton,
s = e.deleteButton,
a = e.hasUsers,
c = e.hasMatchBarStories,
l = e.showFullscreenPromo,
u = e.isLoading,
p = e.isEditButtonHidden,
m = e.isEditing,
g = e.onBackClick,
v = e.onEditButtonClick,
b = (0, i.useState)(!0),
y = b[0],
k = b[1],
Z = [{
type: _t.Us.BACK,
onClick: function() {
k(!1)
}
}];
l || p || !a || null == Z || Z.unshift({
type: _t.df.BUTTON,
text: m ? h.ZP.get(438) : h.ZP.get(439),
onClick: v
});
var E = !a && n;
return (0, f.jsx)(Gn.Z, {
children: (0, f.jsx)($t.Z, {
appear: !0,
in: y,
timeout: 300,
classNames: y ? "forward" : "backward",
mountOnEnter: !0,
unmountOnExit: !0,
onExited: function() {
g()
},
children: function() {
return (0, f.jsx)("div", {
className: "page-container",
id: "activity-inbox",
children: (0, f.jsx)("div", {
className: "page",
children: (0, f.jsxs)(S.Z, {
children: [(0, f.jsxs)(C.Z, {
children: [(0, f.jsx)(_t.ZP, {
actions: Z,
title: h.ZP.get(142),
position: "sticky",
hasShadow: !0
}), l ? null : (0, f.jsxs)("div", {
className: d()("connections__match-bar", {
"connections__match-bar--stories": c
}),
inert: m ? "" : void 0,
children: [o, m ? (0, f.jsx)(P, {}) : null]
})]
}), (0, f.jsxs)(_.Z, {
align: "stretch",
children: [n && E ? (0, f.jsx)("div", {
className: "connections-empty-container",
"data-qa": "connections-empty",
children: (0, f.jsxs)("div", {
style: {
margin: "auto 0"
},
children: [(0, f.jsx)(j.Z, {
top: "md",
right: "gap",
bottom: "md",
left: "gap",
children: n
}), (0, f.jsx)("div", {
className: "connections-gap"
})]
})
}) : null, u ? (0, f.jsx)("div", {
className: "connections__loader",
children: (0, f.jsx)("div", {
style: {
width: 46,
height: 46
},
children: (0, f.jsx)(x.Z, {})
})
}) : null, E ? null : (0, f.jsxs)("div", {
className: "connections__content",
children: [r, (0, f.jsx)("div", {
className: "connections__items",
children: (0, f.jsx)("div", {
className: "connections-items",
children: t
})
}), (0, f.jsx)("div", {
className: "connections-gap"
})]
}), s]
})]
})
})
})
}
})
})
},
qn = ["isVisible"];
function Hn(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function Yn(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
var Qn,
Wn,
zn,
Kn,
Jn = function(e) {
var t = (0, i.useContext)(Fn.ZP).appRef,
n = null == t ? void 0 : t.current,
o = e.isVisible,
r = function(e, t) {
if (null == e)
return {};
var n,
i,
o = {},
r = Object.keys(e);
for (i = 0; i < r.length; i++)
n = r[i],
t.indexOf(n) >= 0 || (o[n] = e[n]);
return o
}(e, qn);
return (0, i.useEffect)((function() {
var e = a.Z.document.getElementById("page-container");
o ? setTimeout((function() {
(0, p.Z)(e).hide()
}), 300) : (0, p.Z)(e).show()
}), [o]), n && o ? Bn.createPortal((0, f.jsx)(Vn, function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? Hn(Object(n), !0).forEach((function(t) {
Yn(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Hn(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}({}, r)), n) : null
},
Xn = n(73541),
$n = n(12470),
ei = n(80031);
function ti(e, t) {
(0, ee.L9)(332, {
element: e,
parent_element: t
})
}
function ni(e) {
(0, ee.L9)(258, {
element: e
})
}
function ii(e, t) {
(0, ee.L9)(139, {
banner_id: e.promo_block_type,
position_id: e.promo_block_position,
context: 127,
call_to_action_type: t
})
}
function oi(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function ri(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? oi(Object(n), !0).forEach((function(t) {
si(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : oi(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function si(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
function ai(e) {
if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}
function ci(e, t) {
return ci = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, ci(e, t)
}
var li = {
clientSource: 127,
preferredCount: 36,
userFieldFilter: (new Vt.Cxj).setProjection([200, 230, 700, 340, 650, 640, 280, 583, 580, 250, 610, 560, 611, 759, 630, 270, 330, 871, 920, 820, 830, 1120, 1423, 1436, 643, 1435, 1434])
},
ui = [U.Z.TYPES.VISITORS, U.Z.TYPES.MESSAGES, U.Z.TYPES.WANT_TO_MEET_YOU, U.Z.TYPES.FAVOURITES],
di = ((Qn = {})[8] = 187, Qn[6] = 188, Qn[4] = 190, Qn[0] = 189, Qn),
pi = ((Wn = {})[31] = 245, Wn[4] = 249, Wn[8] = 247, Wn[6] = 248, Wn[0] = 246, Wn),
hi = [57, 1, 10, 56],
mi = ((zn = {})[12] = 68, zn[61] = 57, zn[66] = 56, zn[88] = 63, zn[8] = 130, zn),
fi = ((Kn = {})[U.Z.TYPES.MESSAGES] = 26, Kn[U.Z.TYPES.FAVOURITES] = 23, Kn[U.Z.TYPES.WANT_TO_MEET_YOU] = 3, Kn[U.Z.TYPES.VISITORS] = 22, Kn),
gi = [1, 2],
vi = 0,
bi = [],
yi = {},
xi = function(e) {
var t,
n;
function c(t) {
var n;
(n = e.call(this, t) || this).activationPlace = 191,
n.screenName = 243,
n.clientSource = 127,
n.containerRef = void 0,
n.modalRef = void 0,
n.timeoutId = void 0,
n.modally = void 0,
n.screenRef = void 0,
n.log = je.Z.getLogger("ConnectionsPage"),
n.resetCount = (0, o.Z)(ji, 1e4),
n.previousFilter = void 0,
n.selectedFilter = Ve.jr.ALL,
n.readItems = [],
n.hasSpp = !1,
n.hasPhoto = null,
n.hasMatchBar = null,
n.hasMatchBarStories = !1,
n.isLoading = !1,
n.isStarted = !1,
n.isFinished = !1,
n.mostRecentSortTimestamp = void 0,
n.forceFetch = !1,
n.visibleUserIds = {},
n.userIds = {},
n.usersToRemove = [],
n.userSubstitutes = {},
n.folderSyncActive = !1,
n.lastBlock = !1,
n.pageToken = null,
n.syncToken = null,
n.savedRemoveUserIds = [],
n.banners = void 0,
n.deletingUserGender = void 0,
n.deletingIds = [],
n.handleAdsEnabledChange = function() {
O.Z.isLoggedIn() && n.fetchFolder()
},
n.handleItem = function(e) {
(0, l.NU)(e) && n.handleUserItem(e),
(0, l.$Y)(e) && n.handlePromoBlockItem(e)
},
n.handleNavigation = function(e) {
if (n.isStarted) {
var t = n.props.saveScrollPosition;
t && !e.backInHistory && t()
}
},
n.handlePromoButtonClick = function(e, t) {
var i = n.getSelectedFilter();
n.trackBlockingScreenClick(e, t || 0, null == i ? void 0 : i.folderType),
n.applyServerActionHelper(e, t || 0)
},
n.handleDismissModally = function() {
var e;
n.enableFolderSync(),
null == (e = n.modally) || e.unmount(),
n.setState({
isEditing: !1
})
},
n.turnDeleteModeOff = function() {
var e;
null == (e = n.modally) || e.unmount()
},
n.handleEditModeToggle = function(e, t) {
var i;
null == (i = n.modally) || i.update({
onDismiss: n.handleDismissModally,
contentWrapper: n.modalRef.current
});
var o = n.state.isEditing;
if (o ? (l.ZP.getItems().forEach((function(e) {
Object.prototype.hasOwnProperty.call(e, "isChecked") && delete e.isChecked
})), n.enableFolderSync()) : n.disableFolderSync(), n.setState({
isEditing: !e && !o
}, t), o || e)
a.Z.clearTimeout(n.timeoutId),
n.turnDeleteModeOff();
else {
var r,
s;
null == (r = n.modally) || r.modalize(),
null == (s = n.modally) || s.focusWrapper();
var c = ai(n);
n.timeoutId = a.Z.setTimeout((function() {
var e,
t;
null == (e = c.modally) || e.updateFocusableElements(c.modalRef.current),
null == (t = c.modally) || t.toggleFocusTrap(!0)
}), 500)
}
},
n.handleDelete = function() {
n.setState({
isShowingDeleteModal: !1
}),
a.Z.setTimeout((function() {
n.onRemoveUsers(n.deletingIds),
n.turnDeleteModeOff()
}), 500)
},
n.handleClickDelete = function() {
var e = Ln.Z.isActive();
n.deletingIds = [],
l.ZP.getItems().forEach((function(e) {
e.isChecked && (n.deletingIds.push(e.object.user_id), n.deletingUserGender = (0, h.Ro)(e.object.gender))
})),
Ln.Z.hit(),
e && n.deletingIds.length > 1 && l.ZP.getItems().forEach((function(e) {
Object.prototype.hasOwnProperty.call(e, "isChecked") && (e.isDeleting = !0)
})),
e && 1 === n.deletingIds.length ? (ni(649), n.setState({
isShowingDeleteModal: !0
})) : n.handleDelete()
},
n.handleClickPopularity = function() {
n.handleEditModeToggle(!0, (function() {
ti(63),
E.Z.navigate(T.x.POPULARITY)
}))
},
n.handleClickNewActivityButton = function() {
n.unfreeze(),
n.fetchFolder(),
(0, ee.L9)(332, {
element: pi[n.getSelectedFilter().folderType]
})
},
n.handleItemVisible = function(e) {
var t = e.origin_folder;
n.visibleUserIds[t] || (n.visibleUserIds[t] = []),
-1 === n.visibleUserIds[t].indexOf(e.user_id) && n.visibleUserIds[t].push(e.user_id),
n.readItems.push(e)
},
n.handleBannerVisible = function(e) {
!function(e) {
if (e) {
var t = e.promo_block_type,
n = e.promo_block_position,
i = function(e) {
var t = e.promo_block_type,
n = e.context;
return n || 21 !== t || (n = 127), n
}(e);
t && (0, ee.L9)(138, {
banner_id: t,
position_id: n,
context: i
})
}
}(e.getPromoBlock ? e.getPromoBlock() : e)
},
n.handleSuperPowersEnabledChange = function(e) {
n.hasSpp = e,
n.fetchFolder()
},
n.handleUserItem = function(e) {
var t = e.user_id,
i = n.userSubstitutes[t];
if (i) {
var o;
if (function(e) {
if (!e)
return;
(0, ee.L9)(139, ri(ri({}, e.hotpanelData), {}, {
context: 127
}))
}(i.connectionPromoCard), null != (o = i.connectionPromoCard) && o.showOnTap)
return void E.Z.navigate(T.x.PROMO_CARDS_GALLERY, {
userSubstitute: i,
context: 26
})
} else {
var r = 4 === e.connection_status_indicator;
(0, ee.L9)(197, {
activation_place: n.getActivationPlace_(),
encrypted_user_id: t,
is_chat_request: r,
has_mood_status: Boolean(e.mood_status),
has_read_receipt: Boolean(1 === e.last_message_status || 2 === e.last_message_status)
})
}
if (e.is_invisible)
E.Z.navigate(T.x.INVISIBLE_EXPLANATION, {
promoBlock: n.banners.getInvisiblePromo(),
activationPlace: 106
});
else if (e.profile_blocker_promo) {
var s = e.profile_blocker_promo;
120 === s.ok_action ? n.revealUser(e) : n.applyServerActionHelper(s)
} else
n.chatWithUser(e)
},
n.handlePromoBlockItem = function(e) {
!function(e, t) {
var n = function(e) {
switch (e.promo_block_type) {
case 131:
return 10;
case 129:
return 100;
case 130:
return 101;
case 165:
return 14
}
return null
}(e);
n && (0, ee.L9)(332, {
element: n,
parent_element: t || 97
})
}(e, n.getElementType());
var t = function(e) {
var t = e.buttons || [];
return (t[0] || {}).type || 1
}(e);
ii(e, t);
var i = e.promo_block_type,
o = e.promo_block_position,
r = e.stats_variation_id,
s = 326 === i && 1 === o,
a = 346 === i && 1 === o;
if (129 === i && 1 === o && 2 === r)
E.Z.navigate(T.x.LIKED_YOU);
else if (s)
wn.Z.getInstance().getProductExplanation({
productType: e.ok_payment_product_type,
userId: O.Z.getUserId(),
clientSource: n.clientSource,
promoBlockType: i
}).then((function(e) {
E.Z.navigate(T.x.GET_MORE_LIKES, {
promoBlock: e.promo,
resolve: function() {
return n.fetchFolder({
preventLoading: !0
})
}
})
})).catch((function(e) {
e && (0, Zt.Z)(e) && n.log.error("Error retrieving product explanation in connections", {
error: e
})
}));
else {
if (a) {
var c = {
variantId: e.variant_id,
event: 2,
context: 127,
promoBlockPosition: o
};
return R.Z.sendProfileQuestionsBannerStats(c), void E.Z.navigate(T.x.PROFILE_QUESTIONS, {
redirectTo: T.x.OWN_PROFILE_EDIT,
preloadQuestions: !0
})
}
if (e.redirect_page) {
var l = e.redirect_page.redirect_page,
u = Number(Object.keys(fi).find((function(e) {
return fi[Number(e)] === l
}))),
d = Ve.Oq.findIndex((function(e) {
return e.folderType === u
}));
-1 !== d && (n.setFilter(Ve.Oq[d].param), n.fetchFolder())
}
n.applyServerActionHelper(e)
}
},
n.handleSelectTab = function(e) {
n.handleEditModeToggle(!0, (function() {
e === Ve.ph.ALL_MESSAGES ? Mn.Z.show() : Mn.Z.hide(),
n.setCurrentTab(e)
}))
},
n.setIsShowingSecurityWalkthrough = function(e) {
n.setState({
isShowingSecurityWalkthroughModal: e
})
},
n.onAdsEnabledChange = function() {
O.Z.isLoggedIn() && n.fetchFolder()
},
n.onBackOnline = function(e) {
n.resendStoredRequests(),
n.folderSyncActive && e && e.then(n.fetchFolderUpdates.bind(ai(n)))
},
n.onBadgeChanged = function(e) {
var t = Ci([e]);
if (n.state.emptyPromo.length && n.fetchFolder({
preventLoading: !0
}), t) {
var i,
o = (null == (i = n.state.badgeUpdates) ? void 0 : i.map((function(e) {
return t.find((function(t) {
return t.folder === e.folder
})) || e
}))) || [];
t.forEach((function(e) {
null != o && o.find((function(t) {
return t.folder === e.folder
})) || o.push(e)
})),
n.setState({
badgeUpdates: o
})
}
},
n.onBadgeInvalidated = function() {
vn.Z.fetch()
},
n.onPushChatMessage = function(e) {
var t = (0, Nn.Z)(e, Vt.JaH),
i = t.getFromUser(),
o = new pn.ZP(t),
r = !o.isRead;
n.onChatMessage({
chatUser: i,
userId: o.fromPersonId,
id: o.id,
displayMessage: o.displayMessage,
increaseUnreadMessages: r,
showYourMoveBadge: o.isRead
})
},
n.onChatMessageFromMe = function(e) {
n.onChatMessage({
userId: String(e.toPersonId),
id: e.id,
displayMessage: e.displayMessage,
increaseUnreadMessages: !1,
showYourMoveBadge: !1
})
},
n.onChatMessage = function(e) {
var t = e.userId,
i = e.id,
o = e.displayMessage,
r = e.increaseUnreadMessages,
s = e.chatUser,
a = e.showYourMoveBadge;
if (l.ZP.updateYourMoveBadge(t, a), s && (a ? s.setConnectionStatusIndicator(2) : s.setConnectionStatusIndicator(0)), l.ZP.findIndex(t) > -1)
n.updateUser(r, t, o);
else {
if (i) {
if (bi.includes(i))
return;
bi.push(i)
}
n.tryFreezeOrUpdate([0, 41])
}
},
n.onPersonNotice = function(e) {
var t = e.folder,
i = e.int_value;
1 === e.type && void 0 !== t && -1 !== ui.indexOf(t) && (void 0 === yi[t] && (yi[t] = 0), void 0 !== i && (yi[t] < i && n.tryFreezeOrUpdate([t]), yi[t] = i))
},
n.onNewMessageRead = function(e, t) {
if (e !== O.Z.getUserId()) {
var i = t.isRead ? "" : t.displayMessage;
n.onChatMessage({
userId: e,
id: t.id,
displayMessage: i,
increaseUnreadMessages: !1,
showYourMoveBadge: Boolean(t.isRead)
})
}
},
n.handleFavouriteItem = function(e) {
var t = l.ZP.findIndex(e),
i = n.isRemoveFromFolderAction(e);
En.Z.toggleFavouriteStatus(e, (function() {
i && n.removeUser(e.user_id)
})),
(0, ee.L9)(123, {
action_type: e.is_favourite ? 6 : 7,
activation_place: n.getActivationPlace_(),
encrypted_user_id: e.user_id
}),
(0, ee.L9)(332, {
element: e.is_favourite ? 85 : 86,
parent_element: n.getElementType(),
position: t
})
},
n.onFavoriteStateChange = function(e, t) {
if (!n.isStarted) {
var i = l.ZP.findIndex(e);
if (-1 !== i)
if (n.getSelectedFilter().folderType !== U.Z.TYPES.FAVOURITES || t)
l.ZP.get(i).object.is_favourite = t,
n.setState({});
else
n.removeUserWhenOpened(e)
}
},
n.onFeatureUpdate = function(e) {
19 === e.feature && n.fetchFolderUpdates()
},
n.onFolderResult = function(e) {
var t = e.previousFilter,
i = e.clientUserList,
o = e.shouldGetNextPage,
r = void 0 !== o && o,
s = e.isUpdates,
c = void 0 !== s && s;
if (n.isStarted) {
if (!n.isFinished && !n.state.isFrozen && t === n.selectedFilter) {
var u = n.getSelectedFilter();
r || c || (n.userIds = {}, (0, ee.L9)(258, {
element: n.getElementType()
}), u && u.folderType === U.Z.TYPES.COMBINED_CONNECTIONS_ALL && function(e) {
var t = e.toJSON().section || [],
n = 0,
i = 0;
t.forEach((function(e) {
(e.users || []).forEach((function(e) {
e.is_removed || 2 !== (e.last_message_status || 0) || n++,
e.is_not_interested && i++
}))
})),
(0, ee.L9)(29, {
num_admirers_unread: _i(6),
num_favourited_you_unread: _i(4),
num_matches_unread: _i(15),
num_visited_you_unread: _i(8),
num_with_read_receipts: n,
num_letdowns: i,
total_unread: _i(0)
})
}(i));
var d = [];
n.banners.process({
items: d,
clientUserList: i,
isUpdates: c
}),
i.getSection([]).forEach((function(e) {
n.addUserSubstitutes_(e.getUserSubstitutes([]));
var t = e.getUsers([]).filter((function(e) {
return !n.userIds[e.getUserId()] && !e.getIsRemoved()
})).map((function(e) {
return e.toJSON()
}));
if (t.sort((function(e, t) {
return t.sort_timestamp - e.sort_timestamp
})), c) {
t = t.filter((function(e) {
return e.sort_timestamp >= n.mostRecentSortTimestamp
}));
var i = e.getUsers([]).filter((function(e) {
return n.userIds[e.getUserId()]
})).map((function(e) {
return e.toJSON()
})),
o = i.filter((function(e) {
return e.is_removed && e.user_id
}));
n.removeUsers(o);
var r = i.filter((function(e) {
return !e.is_removed
}));
l.ZP.getItems().length > 0 && l.ZP.updateUsers(r)
}
t.forEach((function(e) {
n.setTimestamps(e),
n.userIds[e.user_id] = !0
})),
n.banners.processUsers({
items: d,
users: t
}),
c || (n.lastBlock = e.getLastBlock())
})),
c || (n.pageToken = i.getPageToken(), n.syncToken = i.getSyncToken());
var p = i.toJSON().promo_banners,
h = [];
p && !r && (h = p.filter((function(e) {
var t = e.promo_block_position;
return 13 === t || 20 === t
}))),
h && n.setState({
emptyPromo: h
}),
c ? l.ZP.addUpdates(n.banners.prependBanner(d)) : (l.ZP.addPage(d, !r), n.banners.appendBanners()),
n.jinba.stop();
var m = n.props,
f = m.navigatedBack,
g = m.scrollPosition;
n.setState({
isLoading: !1
}, (function() {
var e;
f && g && (0, In.X)(a.Z, g),
null == (e = n.modally) || e.updateFocusableElements(n.modalRef.current)
})),
n.isLoading = !1,
(0, Pn.Z)("Connections interactive", 5)
}
} else
n.isLoading = !1
},
n.onFolderError = function(e) {
n.setState({
isLoading: !1
}),
n.isLoading = !1,
n.isStarted && (e && (0, r.Z)(e.getType) && e.getType() === Rn.Qc.OFFLINE || fn.Z.handleError({
error: e,
screenName: n.getScreenName()
}))
},
n.onNewOfflineMessage = function(e, t) {
var i = l.ZP.findIndex(t.getUserId());
l.ZP.get(i).object.display_message = e,
n.setState({})
},
n.onRemoveUsers = function(e) {
var t,
i;
if (null != e && e.length) {
n.removeUsers(e),
n.setState({
isEditing: !1
});
var o,
r = null == (t = n.getSelectedFilter()) ? void 0 : t.activationPlace;
if (e.forEach((function(e) {
(0, ee.L9)(580, {
encrypted_user_id: e,
activation_place: r,
mode_connection: 6
})
})), !_n.Z.isOnline())
(o = n.savedRemoveUserIds).push.apply(o, e);
var s = n.getCurrentTab().context,
a = [U.Z.getInstance().removeUsers({
activationPlace: r,
folderId: 56,
ids: e,
context: s
})];
(null == (i = n.getSelectedFilter()) ? void 0 : i.folderType) === U.Z.TYPES.FAVOURITES && a.push(U.Z.getInstance().removeUsers({
activationPlace: r,
folderId: 4,
ids: e,
avoidHotpanelTracking: !0,
context: s
})),
Promise.all(a).then(n.updateFolderIfEmpty.bind(ai(n)))
}
},
n.handleSelectItem = function(e, t) {
var i = 99;
(0, l.NU)(e) && (e.is_conversation ? i = 11 : e.is_crush ? i = 18 : e.favourited_you ? i = 9 : e.is_invisible ? i = 93 : 6 === e.origin_folder ? i = 5 : e.is_match ? i = 354 : e.is_visitor ? i = 6 : e.is_favourite && (i = 13)),
W.Z.generate(),
(0, ee.L9)(332, {
element: i,
parent_element: n.getElementType(),
position: t
}),
n.handleItem(e)
},
n.handleTrackScroll = function(e) {
var t = l.ZP.getItems();
(0, ee.L9)(195, {
direction: 5,
element: n.getElementType(),
reached_end: e > t.length - 1,
position: e
})
},
n.handleNeedPage = function() {
n.isLoading || n.lastBlock || n.fetchFolder({
shouldGetNextPage: !0
})
},
n.onSystemNotification = function(e) {
var t = e.id;
21 === t ? n.fetchFolderUpdates() : 25 === t && n.onUserIdExchanged(e.previous_id, e.current_id)
},
n.onUserIdExchanged = function(e, t) {
if (void 0 !== n.userIds[e]) {
n.userIds[t] = n.userIds[e],
delete n.userIds[e];
var i = l.ZP.findIndex(e);
if (-1 === i)
return;
l.ZP.get(i).object.user_id = t,
n.isStarted && n.setState({})
}
},
n.tryFreezeOrUpdate = function(e) {
var t,
i;
0 !== n.getCurrentTab().connectionTypes.filter((function(t) {
return e.includes(t)
})).length && (vi += 1, t = a.Z.innerHeight || (0, xe.Z)().clientHeight, i = (0, xe.Z)().scrollHeight > t, vi > 3 && i ? n.freeze() : n.folderSyncActive && n.fetchFolderUpdates(), n.resetCount())
},
n.freeze = function() {
n.setState({
isFrozen: !0
}),
n.disableFolderSync()
},
n.unfreeze = function() {
n.setState({
isFrozen: !1
}),
n.enableFolderSync()
},
n.handleModalReport = function() {
ti(87, 649),
n.setState({
isReporting: !0,
isShowingDeleteModal: !1
})
},
n.handleModalDelete = function() {
ti(106, 649),
n.handleDelete()
},
n.renderDeleteModal = function() {
return n.state.isShowingDeleteModal ? (0, f.jsx)(on, {
header: h.ZP.get(141),
text: h.ZP.get(363, {
other_user: mn.N5.for("other_user", n.deletingUserGender)
}),
onReport: n.handleModalReport,
onDelete: n.handleModalDelete,
onCancel: function() {
n.setState({
isShowingDeleteModal: !1
})
}
}) : null
},
n.handleReportingSuccess = function() {
n.setState({
isReporting: !1,
isShowingDeleteModal: !1,
isEditing: !1
}),
n.removeUser(n.deletingIds[0])
},
n.handleSelectSortOption = function(e) {
n.setCurrentSortOption(e)
},
n.handleToggleSortOptionsModal = function() {
n.setState({
isShowingSortOptionsModal: !n.state.isShowingSortOptionsModal
})
},
n.renderSortOptionsModal = function() {
return n.state.isShowingSortOptionsModal ? (0, f.jsx)(dn, {
currentTab: n.getCurrentTab(),
onSelectOption: n.handleSelectSortOption,
hideSortOptions: n.handleToggleSortOptionsModal
}) : null
},
n.renderSortOptionsButton = function() {
return (0, f.jsx)(cn, {
currentTab: n.getCurrentTab(),
currentSortOption: n.getCurrentSortOption(),
onClick: n.handleToggleSortOptionsModal
})
},
n.getEmptyPromoFlags = function(e) {
var t = n.getTab(e);
return {
hasUsers: l.ZP.getUsers(t.connectionTypes).length > 0,
showFullscreenPromo: n.state.emptyPromo.some((function(e) {
return 20 === e.promo_block_position
})),
isEditButtonHidden: n.state.emptyPromo.some((function(e) {
return e.context === t.context && 13 === e.promo_block_position
}))
}
},
n.renderEmptyPromo = function(e) {
var t,
i = n.getTab(e),
o = n.state.emptyPromo.filter((function(e) {
return e.context === i.context
})),
r = [],
s = [];
if (null == (t = o) || t.forEach((function(e) {
20 === e.promo_block_position ? r.push(e) : s.push(e)
})), (o = [].concat(r, s)).length) {
var a = o[0];
return (0, f.jsx)(ye, {
promoBlock: a,
onClick: n.handlePromoButtonClick,
sendTrackingOnMount: function() {
n.trackBlockingScreenView(a, i.type)
}
})
}
},
n.getTab = function(e) {
return n.state.tabConfig.find((function(t) {
return t.type === e
}))
},
n.getCurrentTab = function() {
return n.state.tabConfig.find((function(e) {
return e.isCurrent
}))
},
n.setCurrentTab = function(e) {
var t = n.state.tabConfig.map((function(t) {
return ri(ri({}, t), {}, {
isCurrent: t.type === e
})
})),
i = t.find((function(e) {
return e.isCurrent
}));
n.setState({
tabConfig: t,
currentTab: e
}),
E.Z.navigate(T.x.CONNECTIONS, !0, {
filter: i.route
})
},
n.getCurrentSortOption = function() {
return n.getCurrentTab().sortOptions.find((function(e) {
return e.isCurrent
}))
},
n.setCurrentSortOption = function(e) {
var t = n.getCurrentTab().type,
i = n.state.tabConfig.map((function(n) {
if (n.type === t) {
var i = n.sortOptions.map((function(t) {
return ri(ri({}, t), {}, {
isCurrent: t.variant === e
})
}));
return ri(ri({}, n), {}, {
sortOptions: i
})
}
return n
}));
n.setState({
tabConfig: i,
currentSortOption: e
})
};
var c = t.parameters.filter ? t.parameters.filter : Ve.jr.ALL;
Ve.Oq.some((function(e) {
return e.param === c
})) || (c = Ve.jr.ALL);
var u = gn.Z.getSettings(),
d = (0, ei.JM)(u, t.parameters.filter),
p = d.find((function(e) {
return e.isCurrent
})),
m = p.sortOptions.find((function(e) {
return e.isCurrent
}));
return n.state = {
tabConfig: d,
currentTab: p.type,
currentSortOption: m.variant,
currentFilter: c,
isEditing: !1,
isLoading: !1,
isFrozen: !1,
isShowingSortOptionsModal: !1,
isShowingDeleteModal: !1,
isReporting: !1,
emptyPromo: [],
isShowingSecurityWalkthroughModal: !1
}, n.fetchFolderUpdates = (0, s.Z)(n.fetchFolderUpdates, 1e3, {
leading: !0
}), jn.Z.getInstance().on(jn.Z.Type.PERSON_NOTICE, n.onPersonNotice, ai(n)).on(jn.Z.Type.CHAT_MESSAGE, n.onPushChatMessage, ai(n)), bn.Z.on(bn.Z.EVENTS.MESSAGE_FROM_ME, n.onChatMessageFromMe, ai(n)).on(bn.Z.EVENTS.NEW_MESSAGE_READ, n.onNewMessageRead, ai(n)), n.banners = new ce({
onPromoClick: n.unfreeze,
getActivationPlace: n.getActivationPlace_.bind(ai(n)),
getElementType: n.getElementType.bind(ai(n)),
getFolderType: function() {
var e;
return null == (e = n.getSelectedFilter()) ? void 0 : e.folderType
},
setIsShowingSecurityWalkthrough: function() {
n.setIsShowingSecurityWalkthrough(!0)
}
}), n.hasMatchBarStories = jt.Z.getSync(333).enabled && Un.Z.isActive(), n.containerRef = (0, i.createRef)(), n.screenRef = (0, i.createRef)(), n.modalRef = (0, i.createRef)(), n.modally = new Xn.Z, n
}
n = e,
(t = c).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
ci(t, n);
var u = c.prototype;
return u.componentDidMount = function() {
var t = this;
e.prototype.componentDidMount.call(this),
this.isStarted = !0,
Zn.Z.onFavoriteStateChange(this.onFavoriteStateChange),
En.Z.on(En.Z.EVENTS.USER_CHANGED_TS, this.updateCurrentUser, this).on(En.Z.EVENTS.ONLINE, this.onBackOnline, this),
Tn.subscribe(this.onUserIdExchanged, this),
bn.Z.on(bn.Z.EVENTS.NEW_OFFLINE_MESSAGE, this.onNewOfflineMessage, this),
this.jinba = new Cn.Z("CombinedConnections", 4),
hn.Z.on(hn.Z.USER_BLOCKED, (function(e) {
return t.removeBlockedUser(e)
})).on(hn.Z.VOTED_NO, (function(e) {
return t.removeUserWhenOpened(e)
})).on(hn.Z.USER_CONVERSATION_DELETED, (function(e) {
var n,
i = null == (n = t.getSelectedFilter()) ? void 0 : n.param;
i && i !== Ve.jr.CHATS || t.removeUserWhenOpened(e)
})),
E.Z.navigationEvent.subscribe(this.handleNavigation, this),
vn.Z.on(vn.Z.EVENTS.CHANGE, this.onBadgeChanged, this).on(vn.Z.EVENTS.INVALIDATED, this.onBadgeInvalidated, this);
var n = this.getParameter("filter");
n || (n = Ve.Oq[0].param);
var i = Boolean(An.O.value),
o = jt.Z.getSync(1).enabled,
r = jt.Z.getSync(268).enabled,
s = !this.forceFetch && i === this.hasSpp && o === this.hasPhoto && r === this.hasMatchBar && (n === this.selectedFilter || this.wasBack() && this.previousFilter);
this.hasSpp = i,
this.hasPhoto = o,
this.forceFetch = !1,
this.hasMatchBar = r,
s || this.previousFilter && (this.previousFilter = void 0),
this.fetchPopularity();
var a = this.usersToRemove.splice(0);
this.shouldFetchOnStart(Boolean(s)) ? (this.setFilter(n), this.fetchFolder()) : (a.forEach((function(e) {
return t.removeUser(e)
})), this.wasBack() && !this.state.isFrozen && (ji(), this.fetchFolderUpdates())),
this.readItems.length > 0 && (this.readItems.forEach((function(e) {
e.is_unread = !1,
e.unread_messages_count = 0
})), this.readItems = []),
vn.Z.trackNext().get().then(this.setBadgeCounters.bind(this)),
An.O.changeEvent.subscribe(this.handleSuperPowersEnabledChange, this),
this.enableFolderSync(),
Un.Z.hit(),
M.Z.enabledChangeEvent.subscribe(this.handleAdsEnabledChange),
this.selectedFilter !== this.state.currentFilter && this.setFilter(this.state.currentFilter)
}, u.componentWillUnmount = function() {
e.prototype.componentWillUnmount.call(this),
this.isFinished = !0,
this.resetCount.cancel(),
E.Z.navigationEvent.unsubscribe(this.handleNavigation, this),
this.markPeopleViewed(),
vn.Z.off(vn.Z.EVENTS.CHANGE, this.onBadgeChanged, this).off(vn.Z.EVENTS.INVALIDATED, this.onBadgeInvalidated, this),
An.O.changeEvent.unsubscribe(this.handleSuperPowersEnabledChange, this),
this.folderSyncActive && this.disableFolderSync(),
M.Z.enabledChangeEvent.unsubscribe(this.handleAdsEnabledChange),
M.Z.destroy(M.Z.placements.CONNECTIONS),
jn.Z.getInstance().off(jn.Z.Type.PERSON_NOTICE, this.onPersonNotice, this).off(jn.Z.Type.CHAT_MESSAGE, this.onPushChatMessage, this),
bn.Z.off(bn.Z.EVENTS.MESSAGE_FROM_ME, this.onChatMessageFromMe, this).off(bn.Z.EVENTS.NEW_MESSAGE_READ, this.onNewMessageRead, this)
}, u.getElementType = function() {
var e;
return null == (e = this.getSelectedFilter()) ? void 0 : e.elementType
}, u.getActivationPlace_ = function() {
return this.getSelectedFilter().activationPlace
}, u.getSelectedFilter = function() {
var e = this;
return Ve.Oq.find((function(t) {
return t.param === e.selectedFilter
}))
}, u.setFilter = function(e) {
if (e !== this.selectedFilter) {
var t = Ve.Oq.find((function(t) {
return t.param === e
}));
t && (this.selectedFilter = e, this.activationPlace = t.activationPlace, this.setState({
currentFilter: e
}), this.enableFolderSync())
}
}, u.isRemoveFromFolderAction = function(e) {
var t = this.getSelectedFilter();
return t && t.folderType === U.Z.TYPES.FAVOURITES && !e.favourited_you
}, u.applyServerActionHelper = function(e, t) {
var n,
i = this;
void 0 === t && (t = 0),
e.promo_block_type || this.log.error("I cannot handle the promo block after block action because promo_block_type does not exist", {
typeOfPromoBlock: typeof e,
promoBlock: e
}),
this.unfreeze();
var o,
r = null == (n = e.buttons) ? void 0 : n[t],
s = r ? r.action : e.ok_action,
a = r ? r.redirect_page : e.redirect_page;
a && (a = (new Vt.Z$B).setRedirectPage(null == (o = a) ? void 0 : o.redirect_page));
var c = e.promo_block_type;
this.forceFetch = 165 === c;
var l = (new xn.Z).setAction(s).setRedirectPage(a).setProductType(e.ok_payment_product_type).setPromoBlockType(c).setPromoBlock(e).setBack(E.Z.getUrl()).setHotPanelData({
activationPlace: this.getActivationPlace_()
});
12 === c && l.setCallback(this.fetchFolder.bind(this)),
kn.Z.handleAction(l).then((function() {
418 === c && i.fetchFolder({
preventLoading: !0
})
}))
}, u.clearFolderSyncVariables = function() {
this.mostRecentSortTimestamp = void 0
}, u.chatWithUser = function(e) {
var t = e.origin_folder,
n = fi[t];
e.is_unread = !1,
e.unread_messages_count = 0,
this.setState({
isEditing: !1
});
var i = e.user_id,
o = this.userSubstitutes[i];
!Number(i) && i.length < 20 && this.log.error("WRONG USER ID: " + i + " from chatWithUser_"),
E.Z.navigate(T.x.MESSAGES, {
id: i,
folderId: t,
context: 26,
clientSource: n,
toClientSource: n,
fromConnectionsList: !0,
userSubstitute: o
})
}, u.markPeopleViewed = function() {
var e = this;
Object.keys(this.visibleUserIds).forEach((function(t) {
var n = e.visibleUserIds[t];
U.Z.getInstance().markPeopleViewed({
context: 22,
folderId: Number(t),
peopleIds: n
}, !0)
})),
this.visibleUserIds = {}
}, u.removeUser = function(e) {
-1 !== l.ZP.findIndex(e) ? (this.userIds[e] = !1, l.ZP.removeItem(e), this.setState({
isLoading: !1
}), this.updateFolderIfEmpty()) : this.log.error("Connections - Removing a user which doesnt exist in our connections (userIds value is " + this.userIds[e] + ")")
}, u.removeUsers = function(e) {
var t = this;
e.forEach((function(e) {
t.userIds[e] = !1,
l.ZP.removeItem(e),
bn.Z.invalidate(e),
t.userSubstitutes[e] && Sn.Z.reportEventDismiss({
promoCard: t.userSubstitutes[e].contentModePromoCards[0],
context: 26
})
}))
}, u.removeBlockedUser = function(e) {
-1 !== l.ZP.findIndex(e) && this.removeUserWhenOpened(e)
}, u.removeUserWhenOpened = function(e) {
this.isStarted ? this.removeUser(e) : this.usersToRemove.push(e)
}, u.resendStoredRequests = function() {
this.savedRemoveUserIds.length > 0 && (this.onRemoveUsers(this.savedRemoveUserIds.concat([])), this.savedRemoveUserIds = [])
}, u.revealUser = function(e) {
var t,
n = this,
i = null == e ? void 0 : e.user_id;
U.Z.getInstance().revealUser({
personId: i,
folderId: null == (t = this.getSelectedFilter()) ? void 0 : t.folderType
}).then((function(e) {
var t = e[0],
o = null == t ? void 0 : t.getSection();
if (o) {
var r = o[0],
s = ((null == r ? void 0 : r.getUsers()) || [])[0];
n.replaceRevealedUser(i, null == s ? void 0 : s.getUserId())
} else
n.log.error("Error revealing user: Server did not return any sections")
})).catch((function(e) {
n.log.error("Error revealing user:", e),
D.Z.showNotification({
type: D.Z.TYPES.ERROR
})
}))
}, u.replaceRevealedUser = function(e, t) {
var n = this;
return this.fetchFolderRequest().then((function(i) {
var o = i[0],
r = ((null == o ? void 0 : o.getSection()) || [])[0],
s = null == r ? void 0 : r.getUsers(),
a = null == s ? void 0 : s.find((function(e) {
return e.getUserId() === t
}));
if (a) {
var c = l.ZP.findIndex(e),
u = l.ZP.get(c);
u && (u.object = a, l.ZP.replaceItem(u, c), n.setState({
isLoading: !1
}))
}
}))
}, u.setBadgeCounters = function(e) {
if (e) {
var t = e.notices,
n = e.values,
i = Ci(t);
yi = n,
this.setState({
badgeUpdates: i
})
}
}, u.shouldFetchOnStart = function(e) {
var t = !(this.wasBack() && e || this.previousFilter),
n = 0 === l.ZP.getItems().length && !this.state.emptyPromo.length && !this.isLoading;
return t || n
}, u.trackBlockingScreenView = function(e, t) {
var n;
(e.promo_block_type || this.log.error("I cannot track ViewElement event after block show because getPromoBlockType is not a function", {
typeOfPromoBlock: typeof e,
promoBlock: e
}), 418 === e.promo_block_type) && (t === Ve.ph.ALL_MESSAGES ? n = 189 : t === Ve.ph.ACTIVITY && (n = 1387), n && ni(n))
}, u.trackBlockingScreenClick = function(e, t, n) {
var i;
e.promo_block_type || this.log.error("I cannot track Click event after block action because getPromoBlockType is not a function", {
typeOfPromoBlock: typeof e,
promoBlock: e
});
var o = e.promo_block_type;
hi.includes(o) && 2 === (null == (i = e.buttons) ? void 0 : i.length) && void 0 !== t && gi[t] && ii(e, gi[t]);
var r = mi[o];
if (r) {
var s = function(e, t) {
if (12 === e)
return 41;
if (t && di[t])
return di[t];
return 71
}(o, n);
ti(r, s)
}
}, u.addUserSubstitutes_ = function(e) {
var t = this;
e.forEach((function(e) {
t.userSubstitutes[e.getId()] = new Sn.Z({
userSubstitute: e
})
}))
}, u.getUserSubstitute = function(e) {
return this.userSubstitutes[e]
}, u.updateCurrentUser = function(e) {
this.isRemoveFromFolderAction(e) || this.setState({
isLoading: !1
})
}, u.updateUser = function(e, t, n) {
var i = l.ZP.findIndex(t);
if (i > -1) {
var o = l.ZP.get(i),
r = o.object;
n && (r.display_message = n),
e && (r.unread_messages_count = (r.unread_messages_count || 0) + 1),
o.object = r;
var s = l.ZP.hasTopMostPromo(),
a = 0 === i || 1 === i && s;
this.state.isFrozen || a ? l.ZP.replaceItem(o, i) : (o.isUpdate = !0, l.ZP.moveItemToTop(o, i)),
this.setState({})
}
}, u.updateFolderIfEmpty = function() {
var e = this.getCurrentTab();
l.ZP.getUsers(e.connectionTypes).length > 0 || this.fetchFolder()
}, u.enableFolderSync = function() {
this.folderSyncActive || (this.folderSyncActive = !0, jn.Z.getInstance().on(jn.Z.Type.SYSTEM_NOTIFICATION, this.onSystemNotification, this), jt.Z.on(jt.Z.EVENTS.UPDATE, this.onFeatureUpdate, this))
}, u.disableFolderSync = function() {
this.folderSyncActive && (this.folderSyncActive = !1, jn.Z.getInstance().off(jn.Z.Type.SYSTEM_NOTIFICATION, this.onSystemNotification, this), jt.Z.off(jt.Z.EVENTS.UPDATE, this.onFeatureUpdate, this))
}, u.fetchFolder = function(e) {
var t = this;
void 0 === e && (e = {});
var n = e.shouldGetNextPage;
this.isLoading = !0,
e.preventLoading || n || this.setState({
isLoading: !0
}),
this.fetchFolderRequest(n).then((function(e) {
var i = e[0];
t.onFolderResult({
shouldGetNextPage: n,
previousFilter: t.selectedFilter,
clientUserList: i
})
})).catch(this.onFolderError),
this.fetchBanners()
}, u.fetchBanners = function() {
var e = this,
t = this.banners.getShownPromoBlocks();
this.banners.fetch({
shownPromoBlocks: t
}).then((function(t) {
var n = t[0];
e.banners.setPromoBlocks({
promos: n.toJSON().promo_blocks || []
}),
e.banners.appendBanners()
}))
}, u.fetchFolderRequest = function(e) {
e || (this.clearFolderSyncVariables(), this.setState({
emptyPromo: []
}), this.banners.reset(), M.Z.destroy(M.Z.placements.CONNECTIONS));
var t = {
promoBlockRequestParams: [{
shownPromoBlocks: this.banners.getShownPromoBlocks(),
position: 1,
count: 2
}, !e && {
position: 8,
count: 1
}].filter(Boolean)
};
e && (t.pageToken = this.pageToken),
t.direction = 1;
var n = ri(ri(ri({}, t), li), {
folderId: U.Z.TYPES.MESSAGES_AND_ACTIVITY
});
return U.Z.getInstance().fetch(n, !0, !0)
}, u.fetchFolderUpdates = function() {
var e = this;
if (!this.isLoading && !this.state.isFrozen)
if (this.syncToken) {
this.isLoading = !0;
var t = ri(ri(ri({}, {
direction: 2,
includeTransient: !1,
syncToken: this.syncToken
}), li), {
folderId: U.Z.TYPES.MESSAGES_AND_ACTIVITY
});
U.Z.getInstance().fetch(t, !0, !0).then((function(t) {
var n = t[0];
e.state.isFrozen || e.onFolderResult({
previousFilter: e.selectedFilter,
clientUserList: n,
isUpdates: !0
})
})).catch(this.onFolderError)
} else
this.fetchFolder()
}, u.fetchPopularity = function() {
var e = this;
yn.Z.getInstance().get({
id: O.Z.getUserId(),
clientSource: 127,
requestedFields: [690]
}).then((function(t) {
e.setState({
popularityLevel: Si(t.getPopularityLevel())
})
}))
}, u.setTimestamps = function(e) {
var t = e.sort_timestamp;
(!this.mostRecentSortTimestamp || t > this.mostRecentSortTimestamp) && (this.mostRecentSortTimestamp = t)
}, u.renderNavigation = function() {
var e = this,
t = (0, $n.Z)(253),
n = t.header_text,
i = t.subheader_text;
return (0, f.jsx)(Ct, ri({
header: n,
subHeader: i,
popularityLevel: this.state.popularityLevel,
isEditing: this.state.isEditing,
onClickEdit: function() {
return e.handleEditModeToggle()
},
onClickPopularity: this.handleClickPopularity,
onClickNotifications: function() {
return e.handleSelectTab(Ve.ph.ACTIVITY)
}
}, this.getEmptyPromoFlags(Ve.ph.ALL_MESSAGES)))
}, u.renderMatchBar = function() {
return (0, f.jsx)(Xt, {
hasMatchBarStories: this.hasMatchBarStories
})
}, u.renderSecurityWalkthroughModal = function() {
var e = this;
return (0, f.jsx)(Dn.Z, {
onDismissModal: function() {
e.setIsShowingSecurityWalkthrough(!1)
},
context: 127
})
}, u.renderConnectionsList = function(e) {
var t = this.getTab(e);
return (0, f.jsx)(xt, {
currentFilter: this.getSelectedFilter(),
currentTab: t.connectionTypes,
currentPromoContext: t.context,
currentSortOption: this.getCurrentSortOption().variant,
isLoading: this.state.isLoading,
isEditing: this.state.isEditing,
getUserSubstitute: this.getUserSubstitute.bind(this),
onSelectItem: this.handleSelectItem,
onFavouriteItem: this.handleFavouriteItem,
onTrackScroll: this.handleTrackScroll,
onItemVisible: this.handleItemVisible,
onBannerVisible: this.handleBannerVisible,
onNeedPage: this.handleNeedPage
})
}, u.renderDeleteButton = function() {
return (0, f.jsx)(en, {
isActive: this.state.isEditing,
onClick: this.handleClickDelete
})
}, u.render = function() {
var e = this,
t = (0, f.jsx)(k, ri({
emptyPromo: this.renderEmptyPromo(Ve.ph.ALL_MESSAGES),
navigation: this.renderNavigation(),
matchBar: this.renderMatchBar(),
connectionsList: this.renderConnectionsList(Ve.ph.ALL_MESSAGES),
deleteButton: this.renderDeleteButton(),
isLoading: this.state.isLoading,
isEditing: this.state.isEditing,
isFrozen: this.state.isFrozen,
hasMatchBarStories: this.hasMatchBarStories,
containerRef: this.containerRef,
screenRef: this.screenRef,
onClickNewActivityButton: this.handleClickNewActivityButton,
sortOptionsButton: this.renderSortOptionsButton(),
securityWalkthroughModal: this.state.isShowingSecurityWalkthroughModal ? this.renderSecurityWalkthroughModal() : void 0,
currentTab: this.state.currentTab,
modalRef: this.modalRef,
isReporting: this.state.isReporting,
onReportingClose: function() {
return e.setState({
isReporting: !1
})
},
onReportingSuccess: this.handleReportingSuccess,
reportingId: this.deletingIds[0]
}, this.getEmptyPromoFlags(Ve.ph.ALL_MESSAGES))),
n = (0, f.jsx)(Jn, ri({
connectionsList: this.renderConnectionsList(Ve.ph.ACTIVITY),
emptyPromo: this.renderEmptyPromo(Ve.ph.ACTIVITY),
matchBar: this.renderMatchBar(),
sortOptionsButton: this.renderSortOptionsButton(),
deleteButton: this.renderDeleteButton(),
hasMatchBarStories: this.hasMatchBarStories,
isLoading: !1,
isEditing: this.state.isEditing,
isVisible: this.state.currentTab === Ve.ph.ACTIVITY,
onBackClick: function() {
return e.handleSelectTab(Ve.ph.ALL_MESSAGES)
},
onEditButtonClick: function() {
return e.handleEditModeToggle()
}
}, this.getEmptyPromoFlags(Ve.ph.ACTIVITY)));
return this.addPageWrapper((0, f.jsxs)(i.Fragment, {
children: [t, n, this.renderSortOptionsModal(), this.renderDeleteModal()]
}), "connections")
}, c
}(c.Z);
function Si(e) {
switch (e) {
case 10:
default:
return St.V7.VERY_LOW;
case 20:
return St.V7.LOW;
case 30:
return St.V7.AVERAGE;
case 40:
return St.V7.HIGH;
case 50:
return St.V7.VERY_HIGH
}
}
function _i(e) {
return vn.Z.getCached().values[e] || 0
}
function Ci(e) {
var t = [];
return e.forEach((function(e) {
if (e) {
var n = e.filter_display_values;
n && n.forEach((function(n) {
t.push({
folder: e.folder,
value: n.int_value,
filter: n.filter
})
})),
t.push({
folder: e.folder,
value: e.int_value
})
}
})), t
}
function ji() {
vi = 0,
bi = []
}
xi.hasTabBar = !0,
xi.transition = !1;
var Pi = xi
},
13706: function(e, t, n) {
n.d(t, {
ZP: function() {
return I
},
LP: function() {
return T
},
e5: function() {
return O
}
});
n(9653);
var i = n(67294),
o = n(46813),
r = n(77004),
s = n(230),
a = n(34969),
c = n(12137),
l = n(96437),
u = n(41896),
d = n(86273),
p = n(30664),
h = n(57871),
m = n(98380),
f = n(27966),
g = n(42308),
v = n(83900),
b = n(97381),
y = n(10109),
x = n(35702),
S = n(17527),
_ = n(81873),
C = n(85893),
j = function(e) {
var t = e.viewType,
n = e.imageSrc,
i = e.showDelete,
o = e.mediaContainerRef,
r = e.mediaRef,
s = e.onClose,
c = e.onSend,
l = e.onDelete,
u = e.a11y,
d = [{
type: f.Us.CLOSE,
onClick: s
}];
return t === m.Y.SHARE && d.push({
type: f.df.BUTTON,
text: a.ZP.get(451),
onClick: function() {
return c(n)
}
}), (0, C.jsxs)(g.Z, {
dataQA: {
"data-qa-page": "overlay-page"
},
children: [(0, C.jsx)(v.Z, {
children: (0, C.jsx)(f.ZP, {
actions: d,
position: "fixed"
})
}), (0, C.jsx)(b.Z, {
align: "stretch",
children: (0, C.jsxs)(y.ZP, {
background: y.z4.BLACK,
containerRef: o,
dataQa: "multimedia-page-media",
children: [(0, C.jsx)(x.ZP, {
src: n,
isCustom: !0,
mediaRef: r,
fit: x.DW.CONTAIN,
a11y: {
label: null == u ? void 0 : u.imageLabel
}
}), i ? (0, C.jsx)(_.ZP, {
children: (0, C.jsx)(S.Z, {
type: S.w.DELETE,
onClick: l
})
}) : null]
})
})]
})
},
P = n(30374),
k = n(65701),
Z = d.Z.getLogger("MultimediaPage"),
E = u.Z.getInstance("Multimedia"),
O = function() {
E.invalidate("multimedia")
},
T = function() {
return E.get("multimedia")
},
I = function(e) {
var t = e.viewType,
n = e.multimediaVisibility,
u = e.chatUserId,
d = e.chatUserName,
f = e.id,
g = e.imageSrc,
v = void 0 === g ? "" : g,
b = (0, i.useState)(""),
y = b[0],
x = b[1],
S = (0, i.useState)(!1),
_ = S[0],
O = S[1],
T = (0, i.useState)(!0),
I = T[0],
w = T[1],
A = (0, i.useRef)(0),
N = (0, i.useRef)(0),
R = (0, i.useRef)(null),
M = (0, i.useRef)(null),
L = (0, i.useRef)(null),
U = function(e) {
e && c.Z.deleteChatMessage(u, f, 0).catch((function(e) {
Z.error(e),
h.Z.showNotification({
type: h.Z.TYPES.ERROR
})
})),
O(!1),
s.Z.back()
},
D = function() {
var e,
t;
if (R.current && M.current) {
var n = null == (e = R.current) ? void 0 : e.clientWidth,
i = null == (t = R.current) ? void 0 : t.clientHeight,
o = A.current,
r = N.current,
s = n / (o >= r ? 100 : 100 * o / r),
a = i / (r >= o ? 100 : 100 * r / o),
c = "";
c += "scale(" + Math.min(s, a) + ")",
M.current.style.transform = c,
M.current.style.webkitTransform = c
}
},
B = (0, i.useCallback)((function() {
r.Z.setTimeout((function() {
return D()
}), 100)
}), []),
F = function(e) {
w(!(1 !== e))
};
(0, i.useEffect)((function() {
if (f && v.length)
return (0, l.pt)(v).then((function(e) {
var t = e[0],
n = e[1],
i = e[2];
A.current = n,
N.current = i,
D(),
x(t)
})).catch((function(e) {
return (0, P.hI)(e, "Multimedia container image preload")
})), o.Z.on(o.Z.ORIENTATION_CHANGE, B), L.current = (new p.Z).on(p.Z.EVENTS.ZOOM, F).enable(), function() {
var e;
o.Z.off(o.Z.ORIENTATION_CHANGE, B),
null == (e = L.current) || e.disable()
};
s.Z.back()
}), [f, v, B]);
var G = d ? a.ZP.get(634, {
name: d
}) : a.ZP.get(635);
return (0, C.jsxs)(i.Fragment, {
children: [(0, C.jsx)(j, {
viewType: t,
imageSrc: y,
showDelete: I && t === m.Y.VIEW && 4 === Number(n),
mediaContainerRef: R,
mediaRef: M,
onClose: function() {
s.Z.back()
},
onSend: function(e) {
(0, l.pt)(e).then((function(e) {
var t = e[0],
n = e[1],
i = e[2];
E.put("multimedia", {
height: i,
src: t,
visibility: 4,
width: n
}, {
ttl: 1e4
}),
s.Z.back()
})).catch((function(e) {
return (0, P.hI)(e, "Multimedia container image sent preload")
}))
},
onDelete: function() {
O(!0)
},
a11y: {
imageLabel: G || ""
}
}), (0, C.jsx)(k.Z, {
header: a.ZP.get(436),
message: a.ZP.get(539),
confirmLabel: a.ZP.get(350),
cancelLabel: a.ZP.get(429),
isOpen: _,
onConfirm: function() {
return U(!0)
},
onCancel: U
})]
})
}
},
98380: function(e, t, n) {
var i;
n.d(t, {
Y: function() {
return i
}
}),
function(e) {
e.VIEW = "VIEW",
e.SHARE = "SHARE"
}(i || (i = {}))
},
34018: function(e, t, n) {
n(96649),
n(96078),
n(82526),
n(41817),
n(41539),
n(9653),
n(69070),
n(47941),
n(57327),
n(38880),
n(89554),
n(54747),
n(49337),
n(33321);
var i = n(67294),
o = n(46813),
r = n(45292),
s = n(85893);
function a(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function c(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? a(Object(n), !0).forEach((function(t) {
l(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : a(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function l(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
t.Z = function(e) {
var t = (0, i.useState)(!1),
n = t[0],
a = t[1];
function l() {
a(!0)
}
function u() {
a(!1)
}
return (0, i.useEffect)((function() {
return o.Z.on(o.Z.SHOW_MODAL, l), o.Z.on(o.Z.HIDE_MODAL, u), function() {
o.Z.off(o.Z.SHOW_MODAL, l),
o.Z.off(o.Z.HIDE_MODAL, u)
}
}), []), (0, s.jsx)(r.Z, c(c({}, e), {}, {
disabled: n
}))
}
},
45292: function(e, t, n) {
n.d(t, {
F: function() {
return o
}
});
var i,
o,
r = n(94184),
s = n.n(r),
a = n(85893);
!function(e) {
e.DEFAULT = "DEFAULT",
e.SQUARE = "SQUARE"
}(o || (o = {}));
var c = ((i = {})[o.DEFAULT] = "", i[o.SQUARE] = "external-ads-banner--square", i);
t.Z = function(e) {
var t,
n = e.adSlot,
i = e.dataQa,
r = e.type,
l = void 0 === r ? o.DEFAULT : r,
u = e.innerRef,
d = e.disabled,
p = s()(((t = {
"external-ads-banner": !0
})[c[l]] = !0, t["external-ads-banner--no-events"] = d, t));
return (0, a.jsx)("div", {
className: p,
children: (0, a.jsx)("div", {
id: n,
"data-qa-ads": i,
ref: u
})
})
}
},
44991: function(e, t, n) {
var i = n(2215),
o = n(36004),
r = n(75727),
s = (0, o.yM)(),
a = i.Z.EVENTS,
c = a.USER_ADDED,
l = a.USER_REMOVED,
u = i.Z.TYPES.FAVOURITES,
d = i.Z.getInstance();
function p(e, t) {
r.Z.getInstance().updateCache(e, "isFavourite", t),
s.trigger(e, t)
}
function h(e) {
var t = e.uid;
e.folder === u && p(t, !0)
}
function m(e) {
var t = e.uid;
e.folder === u && p(t, !1)
}
t.Z = {
start: function() {
d.on(c, h),
d.on(l, m)
},
stop: function() {
d.off(c, h),
d.off(l, m)
},
onFavoriteStateChange: s.subscribe
}
},
68341: function(e, t, n) {
n.d(t, {
Z: function() {
return i
}
});
n(69826),
n(41539),
n(74916);
function i(e, t) {
var n,
i = ((null == e ? void 0 : e.external_endpoints) || []).find((function(e) {
return e.type === t
}));
return null == i || null == (n = i.url) ? void 0 : n.replace("http://", "https://")
}
},
12470: function(e, t, n) {
n.d(t, {
Z: function() {
return c
}
});
n(69826),
n(41539),
n(96649),
n(96078),
n(82526),
n(41817),
n(9653),
n(69070),
n(47941),
n(57327),
n(38880),
n(89554),
n(54747),
n(49337),
n(33321);
var i = n(57376),
o = n(68068);
function r(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function s(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? r(Object(n), !0).forEach((function(t) {
a(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : r(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function a(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
function c(e) {
var t,
n = s({}, null == (t = o.Z.getSettings()) || null == (t = t.header_configs) ? void 0 : t.find((function(t) {
return t.context === e
})));
return n.subheader_text && function(e) {
new i.ZP(278, {
common_stats: {
event: 2,
source: 21,
context: e
}
}).request()
}(e), s(s({}, {
context: 0,
header_text: "",
subheader_text: ""
}), n)
}
},
67729: function(e, t, n) {
n(89554),
n(41539),
n(5212);
var i,
o = n(67294),
r = n(77004),
s = n(28223),
a = n(96437);
!function(e) {
e.FORWARD = "forward",
e.BACKWARD = "backward",
e.NONE = "none"
}(i || (i = {}));
t.Z = function(e, t, n) {
void 0 === n && (n = {});
var c = (0, o.useRef)(!1);
(0, o.useEffect)((function() {
if (e) {
var o = e.current,
l = n.activeIndex || 0,
u = n.activeIndex || 0,
d = [],
p = {},
h = 0,
m = 0,
f = 0,
g = 0,
v = 0,
b = 0,
y = null,
x = null,
S = !1,
_ = !1,
C = !1,
j = !1,
P = 0,
k = "rtl" === r.Z.language_direction,
Z = function() {
null != o && o.offsetWidth && (P = o.children[e.current.children.length - 1].offsetLeft, Array.prototype.forEach.call(o.children, (function(e, t) {
d[t] || (d[t] = {});
var n = e.getAttribute("data-id");
p[n] = t;
var i = d[t],
o = e.offsetLeft;
i.el = e,
i.id = n,
i.index = t,
i.position = o,
i.width = e.offsetWidth
})))
},
E = function() {
return 1 === d.length || d.some((function(e) {
return 0 !== e.position
}))
},
O = function(e) {
var t = function(e) {
var t = e < 0,
n = "rtl" === r.Z.language_direction;
return t && e < -50 ? n ? i.BACKWARD : i.FORWARD : !t && e > 50 ? n ? i.FORWARD : i.BACKWARD : i.NONE
}(e);
if (t === i.BACKWARD) {
for (var n = e, s = l - 1; s >= 0 && !((n -= (null == o ? void 0 : o.children[s]).offsetWidth) < 50);)
s--;
return Math.max(s, 0)
}
if (t === i.FORWARD) {
for (var a = -e, c = l + 1; c < d.length && !((a -= (null == o ? void 0 : o.children[c]).offsetWidth) - 50 < 50);)
c++;
return Math.min(c, d.length - 1)
}
return l
},
T = function(e) {
var t = b > 0;
return t && (k ? e < 0 : e > 0) ? e = 0 : !t && (k ? e <= P : e <= -P) && (e = -P), !!o && (o.style.transform = "translate3d(" + e + "px, 0, 0)", v = e, !0)
},
I = function(e, n) {
y = e,
l = e.index,
n && (null == o || o.classList.add("is-animated")),
T(-e.position),
n ? (0, a.co)((0, s.Z)(o), (function() {
return null == o || o.classList.remove("is-animated"), t && y && t(y.index), void (_ = !1)
})) : _ = !1
},
w = function(e) {
if (E() || Z(), !(d.length < 2 || _)) {
var t = e.touches[0];
S = !1,
h = m = 0,
f = t.pageX,
g = t.pageY,
y && (u = y.index),
C = !0
}
},
A = function(e) {
if (!(d.length < 2 || S || _)) {
if (!C)
return C = !1, void w(e);
var t = e.touches[0],
i = t.pageX - f,
o = t.pageY - g;
m += i,
f = t.pageX,
g = t.pageY;
var r = m - h;
j || (j = Math.abs(i) > Math.abs(o)),
j ? (e.preventDefault(), b = i, T(v + i)) : S = !0;
var s,
a = O(r) || l;
s = d[a],
x !== s && n.activeClassName && (x && x.el.classList.remove(n.activeClassName), s && (s.el.classList.add(n.activeClassName), x = s))
}
},
N = function() {
if (!(d.length < 2 || !j || _)) {
_ = !0,
C = !1;
var e = O(m - h),
t = d[e];
I(t, !0),
j = !1
}
};
return Z(), E() && (I(d[u], c.current), c.current = !0), null == o || o.addEventListener("touchstart", w), null == o || o.addEventListener("touchmove", A), null == o || o.addEventListener("touchend", N), function() {
null == o || o.removeEventListener("touchstart", w),
null == o || o.removeEventListener("touchmove", A),
null == o || o.removeEventListener("touchend", N)
}
}
}), [e, t, n])
}
},
39467: function(e, t, n) {
n(66992),
n(41539),
n(88674),
n(78783),
n(33948),
n(68304);
var i = n(74837),
o = n(2215);
function r(e, t) {
return r = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, r(e, t)
}
var s = function(e) {
var t,
n;
function o() {
var t;
return (t = e.call(this) || this).EVENTS = {
USER_CHANGED: "change",
USER_CHANGED_TS: "change_ts",
ONLINE: "online"
}, t.savedUsersToChangeFavourite = {}, i.Z.on(i.Z.EVENTS.ONLINE, t.backOnline, function(e) {
if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}(t)), t
}
n = e,
(t = o).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
r(t, n);
var s = o.prototype;
return s.backOnline = function() {
var e = [];
for (var t in this.savedUsersToChangeFavourite) {
var n = this.savedUsersToChangeFavourite[t];
e.push(a(n.user, n.callback))
}
this.savedUsersToChangeFavourite = {},
this.trigger(this.EVENTS.ONLINE, Promise.all(e))
}, s.saveUser = function(e, t) {
this.savedUsersToChangeFavourite[e.user_id] = {
user: e,
callback: t
}
}, s.toggleFavouriteStatus = function(e, t) {
e.is_favourite = !e.is_favourite,
this.trigger(this.EVENTS.USER_CHANGED_TS, e),
i.Z.isOnline() ? a(e, t) : this.saveUser(e, t)
}, o
}(n(36004).zW);
function a(e, t) {
var n = {
uid: e.user_id,
folder: o.Z.TYPES.FAVOURITES
},
i = null;
return !0 === e.is_favourite ? i = o.Z.getInstance().addUserToFolder(n) : (i = o.Z.getInstance().removeUserFromFolder(n), t && i.then(t)), i
}
t.Z = new s
},
64935: function(e, t, n) {
n.d(t, {
e: function() {
return s
}
});
n(69826),
n(41539);
var i = n(38146),
o = n(88906),
r = n(5646);
function s(e, t) {
var n = ((null == e ? void 0 : e.user_field_errors) || []).find((function(e) {
return e.user_field === t
}));
return n ? {
errorMessage: n.error_message,
errorType: i.Z.getErrorFromFieldErrorType(n.error_type),
errorField: r.r[t],
isInvalid: !0
} : (0, o.B)()
}
},
5646: function(e, t, n) {
var i;
n.d(t, {
r: function() {
return o
}
});
var o = ((i = {})[200] = 39, i[220] = 8, i[10] = 7, i[230] = 9, i[20] = 12, i)
}
}]);
?>
Did this file decode correctly?
Original Code
n;
function i(t) {
var n;
return (n = e.call(this, t) || this).createButtonClickHandler = function(e) {
return function() {
(0, l.L9)(332, {
element: e ? 67 : 629,
parent_element: 1273
}),
p.Z.updatePrivateDetectorStatus(n.props.chatInstanceId, e).then((function() {
n.setState({
isVisible: !1
})
}))
}
}, n.state = {
isVisible: !0
}, n
}
return n = e, (t = i).prototype = Object.create(n.prototype), t.prototype.constructor = t, Fc(t, n), i.prototype.render = function() {
return (0, _.jsx)(Nn.Z, {
isVisible: this.state.isVisible,
isDismissible: !1,
onAnimationOutComplete: this.props.onAnimationOutComplete,
isPadded: !0,
hasDefaultDismissButton: !1,
children: (0, _.jsx)(Bc, {
headerText: g.ZP.get(4),
text: g.ZP.get(3, {
name: this.props.name
}),
acceptButtonText: g.ZP.get(1),
cancelButtonText: g.ZP.get(2),
onAcceptButtonClick: this.createButtonClickHandler(!0),
onCancelButtonClick: this.createButtonClickHandler(!1)
})
})
}, i
}(i.Component),
Vc = n(60823),
qc = function(e) {
var t = e.headerText,
n = e.text,
i = e.additionalText,
o = e.betweenButtonsText,
r = e.mediaImageSrc,
s = e.primaryButton,
a = e.secondaryButton,
c = e.dismissButton,
l = e.isLoading;
return (0, _.jsxs)(xo.Z, {
isCompact: !0,
align: "start",
dataQA: {
"data-qa": "read_receipts_modal"
},
children: [(0, _.jsx)(So.Z, {
children: (0, _.jsx)(ei.Z, {
badge: {
icon: {
name: "badge-feature-read-receipt"
}
},
image: {
src: r
},
shape: "circle",
size: "md"
})
}), (0, _.jsx)(_o.Z, {
text: t,
tag: "h2"
}), (0, _.jsx)(Co.Z, {
text: n
}), (0, _.jsxs)(jo.Z, {
children: [(0, _.jsx)(ko.Z, {
text: s.buttonText,
onClick: s.onClick,
styling: "revenue",
isLoading: l,
isDisabled: l,
dataQA: s.dataQA,
semantic: o ? "secondary" : "primary"
}), o ? (0, _.jsx)(Da.Z, {
text: o
}) : null, a ? (0, _.jsx)(ko.Z, {
text: a.buttonText,
icon: a.icon,
styling: a.styling,
onClick: a.onClick,
dataQA: a.dataQA
}) : null, (0, _.jsx)(ko.Z, {
text: c.buttonText,
icon: c.icon,
styling: c.styling,
semantic: "tertiary",
onClick: c.onClick,
dataQA: c.dataQA
})]
}), i ? (0, _.jsx)(xa.Z, {
children: (0, _.jsx)(Sa.Z, {
children: i
})
}) : null]
})
};
function Hc(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function Yc(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? Hc(Object(n), !0).forEach((function(t) {
Qc(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Hc(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function Qc(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
function Wc(e, t, n) {
void 0 === n && (n = {}),
new Ee.ZP(278, {
promo_banner_stats: Yc({
event: e,
context: t.context,
promo_block_type: t.promo_block_type,
promo_block_position: t.promo_block_position
}, n)
}).request()
}
var zc = function(e) {
return (0, i.useEffect)((function() {
var t;
-1 !== (null == e || null == (t = e.stats_required) ? void 0 : t.indexOf(2)) && Wc(2, e)
}), [e]), {
trackShow: function() {
var t;
-1 !== (null == e || null == (t = e.stats_required) ? void 0 : t.indexOf(2)) && Wc(2, e)
},
trackDismiss: function() {
var t;
-1 !== (null == e || null == (t = e.stats_required) ? void 0 : t.indexOf(4)) && Wc(4, e)
},
trackClick: function(t) {
var n;
-1 !== (null == e || null == (n = e.stats_required) ? void 0 : n.indexOf(1)) && Wc(1, e, t)
}
}
};
function Kc(e, t) {
var n;
return {
buttonText: e.text,
icon: 75 === (null == (n = e.icon) ? void 0 : n.badge_type) ? "generic-premium-plus" : void 0,
dataQA: 47 === e.product_type ? {
"data-qa": "premium-plus-button"
} : void 0,
onClick: t
}
}
var Jc = function(e) {
var t,
n,
o,
r,
s,
c = e.promo,
u = e.chatUser,
d = e.chatInstanceId,
p = e.onAnimationOutComplete,
h = e.onPaymentSuccess,
m = (0, i.useState)(!0),
f = m[0],
g = m[1],
v = (0, i.useState)(!1),
b = v[0],
x = v[1],
S = zc(c),
C = S.trackDismiss,
j = S.trackClick;
(0, i.useEffect)((function() {
f && (0, l.L9)(138, {
banner_id: 463,
position_id: 18,
context: 10
})
}), [f]);
var P = null == (t = c.buttons) ? void 0 : t.find((function(e) {
return 1 === e.type
})),
k = null == (n = c.buttons) ? void 0 : n.find((function(e) {
return 2 === e.type
})),
Z = null == (o = c.buttons) ? void 0 : o.find((function(e) {
return 4 === e.type
}));
463 === c.promo_block_type && (Z = k, k = void 0);
var E = null == (r = c.extra_texts) || null == (r = r.find((function(e) {
return 11 === e.type
}))) ? void 0 : r.text;
return (0, _.jsx)(Nn.Z, {
isVisible: f,
isDismissible: !1,
onAnimationOutComplete: p,
isPadded: !0,
children: (0, _.jsx)(qc, {
headerText: c.header,
text: c.mssg,
additionalText: c.credits_cost,
betweenButtonsText: E,
mediaImageSrc: y.Z.getImageUrlForSize(null == (s = u.profile_photo) ? void 0 : s.large_url, 100, 100),
primaryButton: {
buttonText: null == P ? void 0 : P.text,
onClick: function() {
x(!0),
j(),
(0, l.L9)(139, {
banner_id: c.promo_block_type,
position_id: c.promo_block_position,
context: 10,
call_to_action_type: 1
}),
za.Z.purchase({
back: a.Z.getUrl(),
cost: c.payment_amount,
hotPanelData: {
activationPlace: 11,
bannerId: 463,
product: 47,
cost: c.payment_amount
},
productType: c.ok_payment_product_type,
purchaseTransactionSetup: {
promoBlockType: c.promo_block_type
},
userId: d,
success: h,
error: function(e) {
M.Z.showNotification({
text: e,
type: M.Z.TYPES.ERROR
}),
g(!1),
x(!1)
}
})
},
dataQA: {
"data-qa": "accept-button"
}
},
secondaryButton: k ? Kc(k, (function() {
var e;
j(),
(0, l.L9)(139, {
banner_id: c.promo_block_type,
position_id: c.promo_block_position,
context: 10,
call_to_action_type: 2
}),
Ps.Z.navigateToPayment({
back: a.Z.getUrl(),
hotPanelData: {
activationPlace: 11,
promoBlockType: c.promo_block_type
},
productToActivate: c.ok_payment_product_type,
productType: null == (e = k) ? void 0 : e.product_type,
promoBlockType: c.promo_block_type,
userId: u.user_id
})
})) : void 0,
dismissButton: {
buttonText: Z.text,
onClick: function() {
var e;
C(),
(0, l.L9)(139, {
banner_id: c.promo_block_type,
position_id: c.promo_block_position,
context: 10,
call_to_action_type: null == (e = Z) ? void 0 : e.type
}),
g(!1)
},
dataQA: {
"data-qa": "decline-button"
}
},
isLoading: b
})
})
},
Xc = n(35988),
$c = n(27503),
el = function(e) {
var t = e.question,
n = e.onClickGetQuestion,
o = e.onClickSendQuestion,
r = e.onClickClose,
s = e.onAnimationInComplete,
a = e.onAnimationOutComplete,
c = (0, i.useState)(!0),
l = c[0],
u = c[1];
return (0, _.jsx)(Nn.Z, {
isVisible: l,
onDismiss: r,
onAnimationInComplete: s,
onAnimationOutComplete: a,
hasDefaultDismissButton: !1,
children: (0, _.jsxs)("div", {
className: "questions-game",
children: [(0, _.jsx)("div", {
className: "questions-game__header",
children: (0, _.jsx)(Ge.P2, {
align: "center",
color: "black",
children: g.ZP.get(115)
})
}), (0, _.jsx)("div", {
className: "questions-game__question",
children: (0, _.jsx)(Ge.R6, {
align: "center",
color: "black",
dangerous: !0,
children: t
})
}), (0, _.jsx)("div", {
className: "questions-game__button",
children: (0, _.jsxs)(Ea.Z, {
children: [(0, _.jsx)($c.Z, {
icon: "generic-spinning-arrows",
text: g.ZP.get(113),
styling: "transparent",
onClick: n
}), (0, _.jsx)(ko.Z, {
icon: "generic-send",
text: g.ZP.get(114),
onClick: function() {
o(),
u(!1)
},
dataQA: {
"data-qa": "action-send"
}
}), (0, _.jsx)(ko.Z, {
text: g.ZP.get(247),
onClick: function() {
r(),
u(!1)
},
semantic: "tertiary",
dataQA: {
"data-qa": "modal-close"
}
})]
})
})]
})
})
},
tl = function(e) {
var t,
n,
o,
r,
s = e.userGender,
a = e.chatUserGender,
c = e.chatUserName,
l = e.isReceiver,
u = e.onClose,
d = e.onAnimationInComplete,
p = (0, i.useState)(!0),
h = p[0],
m = p[1],
f = (0, i.useState)("close"),
v = f[0],
b = f[1],
y = function(e) {
e && b("continue"),
m(!1)
};
return l ? (t = g.ZP.get(111, {
str: c
}), n = g.ZP.get(109, {
me: Oe.N5.for("me", s),
other_user: Oe.N5.for("other_user", a)
}), o = g.ZP.get(107), r = y) : (t = g.ZP.get(112), n = g.ZP.get(110, {
name: c
}), o = g.ZP.get(108), r = function() {
return y(!0)
}), (0, _.jsx)(Nn.Z, {
isVisible: h,
onAnimationInComplete: d,
onAnimationOutComplete: function() {
return u(v)
},
isPadded: !0,
children: (0, _.jsxs)(xo.Z, {
isCompact: !0,
align: "start",
children: [(0, _.jsx)(So.Z, {
size: "icon",
children: (0, _.jsx)(Ye.Z, {
name: "badge-feature-questions-game"
})
}), (0, _.jsx)(_o.Z, {
text: t,
tag: "h2"
}), (0, _.jsx)(Co.Z, {
text: n
}), (0, _.jsx)(jo.Z, {
children: (0, _.jsx)(ko.Z, {
narrow: !0,
text: o,
onClick: r
})
})]
})
})
},
nl = n(73541),
il = n(365),
ol = n(79429),
rl = n(29977),
sl = function(e) {
var t,
n = e.chatUserName,
o = e.chatUserGender,
r = e.question,
s = e.altNavigation,
a = e.isInstant,
c = e.isMessageFromCurrentUser,
l = e.onFocusInput,
u = e.onBlurInput,
d = e.onClickClose,
p = e.onClickSend,
h = e.onAnimationInComplete,
m = e.onAnimationOutComplete,
f = e.appear,
v = void 0 === f || f,
b = (0, i.useRef)(null),
y = g.ZP.get(98),
x = g.ZP.get(97),
C = (0, i.useRef)(new nl.Z),
j = (0, i.useRef)(null),
P = (0, i.useState)(!0),
k = P[0],
Z = P[1],
E = (0, i.useState)(!1),
O = E[0],
T = E[1],
I = (0, i.useState)(""),
w = I[0],
A = I[1],
N = (0, i.useState)(""),
R = N[0],
M = N[1];
t = c ? a ? g.ZP.get(103) : g.ZP.get(102) : g.ZP.get(101, {
name: Oe.N5.for(n, o)
});
var L = (0, i.useCallback)((function() {
d(),
Z(!1)
}), [d]),
U = function() {
var e;
O ? (p(w), Z(!1)) : (M(g.ZP.get(99)), null == b || null == (e = b.current) || e.focus())
},
D = function(e) {
var t = e.target.value;
T(t.length > 0),
A(t)
},
B = [{
type: S.Us.CLOSE,
onClick: L
}];
s && B.push({
type: S.df.BUTTON,
text: y,
onClick: U
}),
(0, i.useEffect)((function() {
var e = C.current;
return e && null != j && j.current && (e.update({
onDismiss: L,
contentWrapper: j.current
}), e.modalize(), e.updateFocusableElements(), e.toggleFocusTrap(!0)), function() {
null == e || e.unmount()
}
}), [L, C]);
return (0, _.jsx)(il.Z, {
children: (0, _.jsx)(Ne.Z, {
appear: v,
in: k,
timeout: 300,
classNames: k ? "forward" : "backward",
mountOnEnter: !0,
unmountOnExit: !0,
onEntered: function() {
var e;
null == b || null == (e = b.current) || e.focus(),
h && h()
},
onExited: m,
children: function() {
return (0, _.jsx)("div", {
className: "page-container",
id: "page-container",
children: (0, _.jsx)("div", {
className: "page overlay-page questions-game-answer",
ref: j,
role: "dialog",
"aria-modal": !0,
tabIndex: -1,
"aria-label": t,
children: (0, _.jsxs)(Ns.Z, {
children: [(0, _.jsx)(Ls.Z, {
children: (0, _.jsx)(S.ZP, {
actions: B,
position: "absolute",
transparent: !0
})
}), (0, _.jsxs)(Rs.Z, {
vpadded: !0,
align: "stretch",
hpadded: !0,
children: [(0, _.jsx)("div", {
className: "questions-game-answer-title",
children: (0, _.jsx)(Ge.P1, {
align: "center",
color: "black",
tag: "h2",
children: t
})
}), (0, _.jsx)("div", {
className: "questions-game-answer-question",
children: (0, _.jsx)(Ge.R6, {
align: "center",
color: "black",
children: r
})
}), (0, _.jsx)("div", {
className: "questions-game-answer-input",
children: (0, _.jsxs)(Zo.Z, {
onSubmit: function(e) {
return (0, yo.dd)(e, U)
},
isFixed: !0,
children: [(0, _.jsx)(ol.Z, {
label: g.ZP.get(100),
onChange: D,
onFocus: l,
onBlur: u,
autoResize: !0,
value: w,
fieldId: "feedback-input",
textareaRef: b,
maxHeight: 200,
errorMessage: R,
a11y: {
ariaRequired: !0
}
}), s ? null : (0, _.jsx)(rl.Z, {
children: (0, _.jsx)(ko.Z, {
buttonAttrs: {
type: "submit"
},
text: x
})
})]
})
})]
})]
})
})
})
}
})
})
},
al = function() {
(0, l.L9)(258, {
element: 1381
})
},
cl = function() {
(0, l.L9)(258, {
element: 1382
})
},
ll = function() {
(0, l.L9)(258, {
element: 1377
})
},
ul = {
send: 253,
question: 1360,
close: 51
},
dl = function(e) {
(0, l.L9)(332, {
element: ul[e],
parent_element: 1377
})
},
pl = function() {
(0, l.L9)(258, {
element: 1289
})
},
hl = function(e) {
(0, l.L9)(332, {
element: "close" === e ? 51 : 253,
parent_element: 1289
})
},
ml = J.Z.getLogger("Questions Game"),
fl = function(e) {
var t = e.message,
n = e.chatUser,
o = e.isAnswer,
r = e.isAnswerInstant,
s = e.isOnboarding,
a = e.isOnboardingReceiver,
c = e.onDismissOnboarding,
u = e.onShowAnswer,
d = e.onCloseAnswer,
h = e.onClose,
m = (0, i.useState)({
text: "\n"
}),
f = m[0],
v = m[1],
b = (0, i.useState)(s),
y = b[0],
x = b[1],
S = (0, i.useRef)([]),
C = pe.Z.getUser(),
j = (0, g.Ro)(C.gender),
P = (0, g.Ro)(n.getGender()),
k = n.getName(),
Z = (0, i.useCallback)((function() {
var e = S.current.length - 1,
t = S.current.findIndex((function(e) {
return e.id === f.id
}));
-1 !== t && t < e ? v(S.current[t + 1]) : t === e && v(S.current[0]),
dl("question")
}), [f.id]),
E = function() {
return (null == t ? void 0 : t.fromPersonId) === C.user_id
};
(0, i.useEffect)((function() {
new Ee.ZP(537, {
context: 264,
other_user_id: n.getUserId()
}).onResponse(538, (function(e) {
Array.isArray(e.questions) && e.questions.length && (S.current = e.questions, v(e.questions[0]))
})).onError((function(e) {
(0, X.Z)(e) && ml.error("Error while getting questions", {
error: e
})
})).request()
}), []);
var O = (0, _.jsx)(el, {
question: f.text,
onClickGetQuestion: Z,
onClickSendQuestion: function() {
var e = new B.ZP({
messageType: 50,
question: {
id: f.id
}
}, n);
p.Z.send(n.getUserId(), e).then((function(e) {
setTimeout((function() {
u(e, !0)
}), 400)
})).catch((function(e) {
(0, X.Z)(e) && ml.error("Error while sending questions game message", {
error: e
})
})),
dl("send")
},
onClickClose: function() {
return dl("close")
},
onAnimationInComplete: ll,
onAnimationOutComplete: h
});
return y && (O = (0, _.jsx)(tl, {
userGender: j,
chatUserGender: P,
chatUserName: k,
isReceiver: a,
onClose: function(e) {
"continue" === e ? (x(!1), c()) : h(),
a ? function(e) {
(0, l.L9)(332, {
element: "continue" === e ? 395 : 51,
parent_element: 1382
})
}(e) : function(e) {
(0, l.L9)(332, {
element: "continue" === e ? 395 : 51,
parent_element: 1381
})
}(e)
},
onAnimationInComplete: a ? cl : al
})), t && o && (O = (0, _.jsx)(sl, {
question: t.question.text,
chatUserName: k,
chatUserGender: P,
altNavigation: ue.Z.isIOs,
isInstant: r,
isMessageFromCurrentUser: E(),
onFocusInput: function() {
setTimeout((function() {
(0, N.Z)(".page.questions-game-answer").addClass("not-stretched-layout")
}))
},
onBlurInput: function() {
setTimeout((function() {
(0, N.Z)(".page.questions-game-answer").removeClass("not-stretched-layout")
}))
},
onClickClose: function() {
hl("close")
},
onClickSend: function(e) {
p.Z.sendQuestionsGameAnswer(t, e, E()),
hl("send")
},
onAnimationInComplete: pl,
onAnimationOutComplete: d
})), O
},
gl = n(16666);
function vl(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function bl(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? vl(Object(n), !0).forEach((function(t) {
yl(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : vl(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function yl(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
var xl = J.Z.getLogger("Chat"),
Sl = (0, ae.Z)(11);
function _l(e) {
return 3 === (null == e ? void 0 : e.getType())
}
function Cl(e) {
var t = ne(e);
return 19 === e.initialScreenType || 472 === (null == t ? void 0 : t.promo_block_type)
}
function jl(e) {
var t = (null == e ? void 0 : e.getAlbums([])) || [];
return t.length > 0 && !!t[0].getPhotos() && !_l(e)
}
function Pl(e, t) {
var n = null == t ? void 0 : t.some((function(e) {
return 10017 === e.getPromoBlockType()
}));
return _l(e) || ue.Z.isTWA() || ue.Z.isHuaweiQuickApp() || !n
}
var kl = function(e) {
var t,
n,
o = e.user,
r = e.chatUserId,
v = e.folderId,
y = e.streamId,
x = e.userSubstitute,
S = e.hotPanelData,
C = e.clientSource,
j = e.activationPlace,
P = e.screenName,
O = e.wasBack,
w = e.notificationPermissionController,
N = e.scrollableElement,
R = e.onboardingTipsController,
L = e.onPreventNotifications,
U = e.onAllowNotifications,
D = e.jinba,
B = e.scrollPosition,
F = e.navigatedBack,
G = (0, i.useState)(!1),
V = G[0],
q = G[1],
H = (0, i.useState)(!1),
Y = H[0],
Q = H[1],
W = (0, i.useState)(!1),
K = W[0],
J = W[1],
$ = (0, i.useState)(!0),
te = $[0],
ae = $[1],
pe = (0, i.useState)(!1),
fe = pe[0],
Pe = pe[1],
Ee = (0, i.useState)(!0),
Oe = Ee[0],
Te = Ee[1],
Ie = (0, i.useState)([]),
we = Ie[0],
Ae = Ie[1],
Ne = (0, i.useState)([]),
Re = Ne[0],
Me = Ne[1],
Le = (0, i.useState)(),
Ue = Le[0],
De = Le[1],
Be = (0, i.useState)(),
Fe = Be[0],
Ge = Be[1],
Ve = (0, i.useState)(!0),
qe = Ve[0],
He = Ve[1],
Ye = (0, i.useState)(o),
Qe = Ye[0],
We = Ye[1],
ze = (0, i.useState)(!1),
Ke = ze[0],
Je = ze[1],
Xe = (0, i.useState)(""),
$e = Xe[0],
et = Xe[1],
nt = (0, i.useState)(),
it = nt[0],
ot = nt[1],
rt = (0, i.useState)(!1),
st = rt[0],
at = rt[1],
ct = (0, i.useState)(j),
lt = ct[0],
ut = ct[1],
dt = (0, i.useState)({}),
pt = dt[0],
ht = dt[1],
mt = (0, i.useState)(),
ft = mt[0],
gt = mt[1],
vt = (0, i.useState)(!1),
bt = vt[0],
yt = vt[1],
xt = (0, i.useState)(),
St = xt[0],
_t = xt[1],
Ct = (0, i.useState)(!1),
jt = Ct[0],
Pt = Ct[1],
kt = (0, i.useState)(!1),
Zt = kt[0],
Et = kt[1],
Ot = (0, i.useState)(!1),
Tt = Ot[0],
It = Ot[1],
wt = (0, i.useState)(!1),
At = wt[0],
Nt = wt[1],
Rt = (0, i.useState)(!1),
Mt = Rt[0],
Lt = Rt[1],
Ut = (0, i.useState)(!1),
Dt = Ut[0],
Bt = Ut[1],
Ft = (0, i.useState)(!1),
Gt = Ft[0],
Vt = Ft[1],
qt = (0, i.useState)(),
Ht = qt[0],
Yt = qt[1],
Qt = (0, i.useState)(!1),
Wt = Qt[0],
zt = Qt[1],
Kt = (0, i.useState)(!1),
Jt = Kt[0],
Xt = Kt[1],
$t = (0, i.useRef)(""),
en = (0, i.useRef)(0),
tn = (0, i.useRef)(0),
nn = (0, i.useRef)(0),
on = (0, i.useRef)(),
rn = (0, i.useRef)(null),
sn = (0, i.useRef)(!1),
an = (0, i.useRef)(!1),
cn = (0, i.useRef)(null),
ln = (0, i.useRef)(null),
un = (0, i.useRef)(!1),
dn = (0, i.useRef)(!1),
pn = (0, i.useRef)(!1),
hn = (0, i.useCallback)((function(e) {
var t,
n,
i,
o,
s,
a,
c,
l,
u,
d,
h,
m = e.messages,
f = p.Z.isUserReported(e.chatInstanceId),
g = m.some((function(e) {
return e.isYours() || p.Z.isYours(e)
})),
v = bl(bl({}, e), {}, {
context: C,
streamId: y,
chatBlockedGiftPromo: (i = e.promoBanners, i.find((function(e) {
return 24 === e.getPromoBlockType() && 6 === e.getPromoBlockPosition()
})) || (null == Fe ? void 0 : Fe.chatBlockedGiftPromo)),
gender: (0, b.gp)(e.gender),
hasReceivedMessage: m.some((function(e) {
return !e.isYours() || !p.Z.isYours(e)
})),
initialScreen: f ? void 0 : e.initialScreen,
sourceOfMessage: (0, Vs.RD)(e),
isSelectable: K,
dismissInitialScreen: !1,
isShowingCrushAnimation: !g && e.isShowingCrushAnimation,
feedbackPromo: (t = e.promoBanners, n = t.find((function(e) {
return 575 === e.getPromoBlockType()
})), null == n ? void 0 : n.toJSON())
});
if (r) {
var x = I(r);
x && (v.replyToMessage = x)
}
return v.initialScreen || (v.dismissInitialScreen = !0), v.isChatBlocked = (c = (o = v).initialScreenType, l = !(null == (s = o.initialScreen) || !s.blockingFeature), u = null == (a = o.initialScreen) ? void 0 : a.promo, d = Ze.includes(null == u ? void 0 : u.getPromoBlockType()), h = o.initialScreen && o.messages.length > 0, (0 === o.maxUnansweredMessages && o.chatBlockedGiftPromo || l || h || d) && !(7 === c)), v
}), [r, C, K, null == Fe ? void 0 : Fe.chatBlockedGiftPromo, y]),
mn = function() {
var e = p.Z.getCachedClientOpenChat(r);
Ge(hn(e))
},
fn = (0, i.useCallback)((function(e) {
var t = hn(e),
n = e.counter > e.messages.length,
i = !pn.current && !t.isChatBlocked && !!e.isShowingOffensiveMessagesPrompt;
($t.current = e.chatInstanceId.toString(), i && (pn.current = !0), dn.current) && (e.messages.some((function(e) {
return 50 === e.messageType
})) && (Nt(!0), setTimeout((function() {
Lt(!0)
}), 400)));
We(e.chatUser),
Ae(e.messages),
Me(e.promoBanners),
Pe(e.chatUser.getIsFavourite()),
Ge(t),
zt(i),
n && (Te(!1), ae(!1)),
null == D || D.stop({
nameOverride: t.initialScreen ? "Chat/InitialScreen" : "Chat",
hotpanelTimerOverride: t.initialScreen ? 3 : 2
})
}), [hn, D]),
gn = function() {
gt(void 0),
a.Z.updateLocation(c.x.MESSAGES, {
id: r
})
},
vn = function() {
gn(),
a.Z.back()
},
bn = function(e) {
e && We(e)
},
yn = function(e) {
e && (We(e), Pe(e.getIsFavourite()))
},
xn = (0, i.useCallback)((function() {
var e = p.Z.getCachedClientOpenChat(r);
e.dummy && Qe && (e.chatUser = Qe),
fn(e)
}), [Qe, r, fn]),
Sn = function(e, t) {
!function(e, t) {
if (void 0 === t && (t = xe.MESSAGE), !Boolean(e.serverErrorMessage) || (0, X.Z)(e))
if (e instanceof Se.lt)
je.error("Rpc error on send chat message", {
error: e,
errorSource: t,
RPCErrorType: Ce[e.getType()] || Ce[0]
});
else if (e.serverErrorMessage) {
var n = "toJSON" in e.serverErrorMessage ? e.serverErrorMessage.toJSON() : e.serverErrorMessage;
je.error("Server error on send chat message", {
error: JSON.stringify(n),
errorSource: t
})
} else
je.error("Unknown error on send chat message", {
error: e,
errorSource: t
})
}(e, t),
function(e) {
if (e instanceof Error) {
var t = "" + e.message;
(0, l.L9)(125, {
event_type: 1,
error_type: 12,
error_message: "string" == typeof e ? e : t
})
} else if (e instanceof he.kE7) {
var n = e.getErrorMessage();
(0, l.L9)(125, {
event_type: 1,
error_type: me.Z.getType(e.getType()),
error_message: n
})
}
}(e),
xn()
},
_n = (0, i.useCallback)((function(e, t) {
if (!(e instanceof Error)) {
var n = null == e ? void 0 : e.getType();
return 14 === n || 42 === n ? (O || _e(e.getErrorMessage()), void a.Z.back()) : 82 === n ? (O || _e(function(e, t) {
var n = e.getErrorMessage();
if (!n) {
var i = t.getName();
i && (n = 2 === t.getGender() ? g.ZP.get(460, {
str: i
}) : g.ZP.get(461, {
str: i
}))
}
return n
}(e, Qe)), void a.Z.back()) : void de.Z.handleError({
error: e,
screenName: ye(K, P, r),
navigationBar: {
logo: !0,
actions: {}
}
}, t)
}
(0, X.Z)(e) && xl.error(e.message)
}), [Qe, r, K, P, O]),
Cn = (0, i.useCallback)((function(e) {
void 0 === e && (e = {
allowConsumeChatUnblocker: !1
});
var t = {
allowConsumeChatUnblocker: e.allowConsumeChatUnblocker,
context: C,
folderId: v,
streamId: y,
user: x ? 3 : void 0
};
return p.Z.getCachedClientOpenChat(r).dummy && q(!0), cn.current = (0, re.Z)(p.Z.getClientOpenChat(r, t)), cn.current.then((function(e) {
un.current = !!R.getTooltipByType(46),
dn.current = !!R.getTooltipByType(53),
fn(e),
q(!1)
})).catch((function(e) {
e instanceof re.t || _n(e, Cn)
})), cn.current
}), [C, v, y, x, r, R, fn, _n]),
jn = function() {
Cc.Z.getInstance().invalidate(),
Z.Z.removeMessage(r),
A(r.toString()),
mn()
},
Pn = function(e) {
var t = le.Z.encodeRoute(a.Z.getUrl(), {
paymentFlow: "2"
});
return e.context = C, e.streamId = y, e.repliedMessage = I(r.toString()), ln.current = (0, re.Z)(p.Z.send(r, e, t)), ln.current.then(jn).catch((function(e) {
return e instanceof re.t || Sn(e), e
})), ln.current
},
kn = function() {
var e;
x ? e = Promise.resolve(x) : (q(!0), e = h.Z.getInstance().get({
id: r
}).then((function(e) {
var t = e[0];
return q(!1), new ce.Z({
userSubstitute: t.getUserSubstitute()
})
}))),
e.then((function(e) {
a.Z.navigate(c.x.PROMO_CARDS_GALLERY, {
userSubstitute: e,
context: 26
})
})).catch((function() {
q(!1),
_e()
}))
},
Zn = (0, i.useCallback)((function() {
if (p.Z.getCachedClientOpenChat(r).messages.some((function(e) {
return e.allowLike
})) && !Wt) {
var e = R.getTooltipByType(46).text;
L(),
ht({
isActive: !0,
text: e
})
}
}), [r, L, Wt, R]),
En = (0, i.useCallback)((function() {
m.Z.getUserById({
id: r,
clientSource: 10,
folderType: 0
}).then((function(e) {
setTimeout(gt, 100, e)
})).catch((function(e) {
(0, X.Z)(e) && xl.error("Failed to get user by id", e),
M.Z.showNotification({
type: M.Z.TYPES.ERROR
})
})),
a.Z.updateLocation(c.x.CHAT_PROFILE, {
id: r
})
}), [r]),
On = function() {
null != Fe && Fe.deletedMember || (_l(Qe) ? kn() : (p.Z.hasInitialChatScreen(r) && p.Z.invalidate(r), En()))
},
Tn = function(e) {
J(e),
e && (0, l.L9)(49, {})
},
In = function() {
(0, l.L9)(425, {
activation_place: lt,
encrypted_user_id: r
}),
a.Z.back()
},
wn = function() {
f.Z.getInstance().removeUserFromFolder({
folder: 56,
uid: r
}).then((function() {
a.Z.navigate(c.x.CONNECTIONS)
}))
};
(0, i.useEffect)((function() {
return function() {
var e;
null == (e = rn.current) || null == e.dismiss || e.dismiss(),
tn.current && s.Z.clearTimeout(tn.current),
nn.current && s.Z.clearTimeout(nn.current),
en.current && s.Z.clearTimeout(en.current)
}
}), []),
(0, i.useEffect)((function() {
(!r || r.length < 20) && (xl.error("Cannot load chat page without a valid id", {
id: r
}), _e(), a.Z.back())
}), [r]),
(0, i.useEffect)((function() {
if (!j) {
var e = {
id: r,
clientSource: C,
streamId: y,
folderId: v,
userSubstitute: x,
activationPlace: null != S && S.inappId ? 165 : 1
};
a.Z.updateLocation(c.x.MESSAGES, e)
}
}), [j, C, v, null == S ? void 0 : S.inappId, y, x, r]),
(0, i.useEffect)((function() {
ut(function(e, t) {
return 4 === e ? 5 : 9 === e ? 10 : 94 === e ? 165 : 26 === e ? 191 : t
}(C, j))
}), [C, j]),
(0, i.useEffect)((function() {
var e = function(e, t, n) {
jl(Qe) && ae(n >= t)
},
t = function(e) {
e.toPersonId && ![r, $t.current].includes(e.toPersonId.toString()) || ((r ? I(r) : null) && ((0, l.L9)(332, {
element: 288,
parent_element: 289
}), r && A(r)), jl(Qe) || e !== we[0] || Te(!0), e.isTemporary() || function(e, t, n) {
var i,
o;
(0, l.L9)(8, {
activation_place: t,
encrypted_user_id: null == (i = e.toPersonId) ? void 0 : i.toString(),
length: 1 === e.messageType && (null == (o = e.message) ? void 0 : o.length) || 0,
message_first: 1 === n.length,
message_first_replied: n.length > 1 && 1 === ve(n),
send_giphy: 36 === e.messageType,
send_heart: "ANIMATED_XP" === e.messageType,
send_location: !1,
send_photo: 19 === e.messageType,
send_smile: 22 === e.messageType,
send_sticker: 23 === e.messageType
})
}(e, lt, we), xn())
},
n = function(e) {
e.fromPersonId && ![r, $t.current].includes(e.fromPersonId.toString()) || (42 === e.messageType && yt(!0), e.isLikelyOffensive && null != Fe && Fe.isShowingOffensiveMessagesPrompt && zt(!0), xn())
},
i = function(e) {
46 !== e.type && 49 !== e.type || Cn()
};
return oe.Z.getInstance().on(oe.Z.Type.NOTIFICATION, i), p.Z.on(p.Z.EVENTS.FLUSH, Cn).on(p.Z.EVENTS.HISTORY_UPDATED, e).on(p.Z.EVENTS.MESSAGE_FROM_ME, t).on(p.Z.EVENTS.MESSAGE_FROM_USER, n).on(p.Z.EVENTS.CHAT_PROMO_HANDLED, xn).on(p.Z.EVENTS.SETTINGS_UPDATED, (function(e) {
e.show_offensive_messages_prompt && zt(!0)
})), function() {
p.Z.off(p.Z.EVENTS.FLUSH, Cn).off(p.Z.EVENTS.HISTORY_UPDATED, e).off(p.Z.EVENTS.MESSAGE_FROM_ME, t).off(p.Z.EVENTS.MESSAGE_FROM_USER, n).off(p.Z.EVENTS.CHAT_PROMO_HANDLED, xn),
oe.Z.getInstance().off(oe.Z.Type.NOTIFICATION, i)
}
}), [lt, Qe, r, Cn, we, xn, U, R]),
(0, i.useEffect)((function() {
var e,
t;
return on.current = (e = {
getClientSource: function() {
return C
},
getStreamId: function() {
return y
},
onSendMessage: function(e) {
e && !e.isCanceled && Sn(e, xe.MULTIMEDIA)
}
}, t = T || z(e), document.getElementById("photo-form") || document.body.appendChild(t.zepto[0]), t), (0, d.GE)((function() {
var e,
t = p.Z.getCachedClientOpenChat(r),
n = (0, u.Z)(a.Z.getHistory()),
i = n && [c.x.GIFT, c.x.MULTIMEDIA].includes(n.routeName),
o = t && !t.dummy && O && i;
xn(),
function() {
var e = a.Z.getLocation(),
t = e.routeName,
n = e.parameters;
if ("2" === (null == n ? void 0 : n.paymentFlow)) {
var i = bl({}, n);
delete i.paymentFlow,
a.Z.updateLocation(t, i),
jn()
}
}(),
function() {
var e = a.Z.getLocation(),
t = e.routeName,
n = e.parameters;
if ("1" === (null == n ? void 0 : n.paymentFlow) || "3" === (null == n ? void 0 : n.paymentFlow)) {
if (!st) {
var i = bl({}, n);
delete i.paymentFlow,
a.Z.updateLocation(t, i)
}
} else
q(!1)
}();
var l,
d = I(r.toString());
if (null == (e = on.current) || e.checkPendingMultimedia({
replyToUid: null == d ? void 0 : d.id,
replyToMessage: d
}), ie.Z.getInstance().getBackAction() === be && (ie.Z.getInstance().getResult() === ie.Z.RESULTS.PENDING && (q(!0), s.Z.setTimeout(Cn, 4e4), l = !0), ie.Z.getInstance().clear()), !l) {
var h = {
forceTrack: !0,
id: r,
activationPlace: j,
clientSource: C,
isUserSubstitute: _l(Qe)
};
o ? ge(h) : Cn().then((function() {
return ge(h)
})).catch((function(e) {
e instanceof re.t || (0, X.Z)(e) && xl.error("Error calling getClientOpenChat", {
error: e
})
}))
}
})), function() {
var e,
t;
null == (e = cn.current) || e.cancel(),
null == (t = ln.current) || t.cancel()
}
}), []),
(0, i.useEffect)((function() {
null != Fe && Fe.isShowingCrushAnimation && !sn.current && ((0, l.L9)(258, {
element: 1711
}), sn.current = !0)
}), [null == Fe ? void 0 : Fe.isShowingCrushAnimation]),
(0, i.useEffect)((function() {
!V && Fe && (!ke.has(Fe.chatInstanceId) || Fe.isChatBlocked || Cl(Fe) ? Cl(Fe) && ke.add(Fe.chatInstanceId) : ke.remove(null == Fe ? void 0 : Fe.chatInstanceId))
}), [Fe, V]),
(0, i.useEffect)((function() {
var e = null == Fe ? void 0 : Fe.inputSettingsItems;
if (null != e && e.length) {
var t = e.findIndex((function(e) {
return 13 === e.type
}));
It(-1 !== t && !!Fe && !Cl(Fe))
}
}), [Fe]),
(0, i.useEffect)((function() {
var e = !Fe || Boolean(Fe.initialScreen) && 0 !== Fe.maxUnansweredMessages;
un.current && !e && (Zn(), un.current = !1)
}), [Fe, Zn]),
(0, i.useEffect)((function() {
a.Z.getLocation().routeName === c.x.CHAT_PROFILE && En()
}), [En]),
(0, i.useEffect)((function() {
return E.Z.on(E.Z.USER_BLOCKED, vn), E.Z.on(E.Z.USER_UNBLOCKED, bn), E.Z.on(E.Z.USER_REPORTED, bn), E.Z.on(E.Z.USER_FAVOURITED, yn), E.Z.on(E.Z.USER_QUICK_MESSAGE_SENT, bn), function() {
E.Z.off(E.Z.USER_BLOCKED, vn),
E.Z.off(E.Z.USER_UNBLOCKED, bn),
E.Z.off(E.Z.USER_REPORTED, bn),
E.Z.off(E.Z.USER_FAVOURITED, yn),
E.Z.off(E.Z.USER_QUICK_MESSAGE_SENT, bn)
}
}));
var An = ye(K, P, r),
Nn = Fe ? ne(Fe) : void 0,
Rn = Fe ? function(e) {
var t,
n = (null == e ? void 0 : e.promoBanners) || [],
i = e.dismissedPromoBanners || [],
o = n.find((function(e) {
return ee.includes(e.getPromoBlockType())
}));
return o && !i.includes(o.getPromoBlockType()) && (t = o.toJSON()), t
}(Fe) : void 0,
Mn = (null == Fe ? void 0 : Fe.dismissedPromoBanners) || [],
Ln = Re.filter((function(e) {
return -1 === Mn.indexOf(e.getPromoBlockType())
})),
Un = bt || (null == Fe ? void 0 : Fe.isNotInterested),
Dn = (null == Qe ? void 0 : Qe.getName()) || "";
function Bn() {
Pt(!1)
}
var Fn = function() {
dn.current = !1,
R.dismissTooltip(10, 53)
},
Gn = function() {
void 0 !== typeof Qe && Lt(!0)
},
Vn = function(e, t) {
Yt(e),
Bt(!0),
Vt(Boolean(t)),
Lt(!0)
};
return (0, _.jsxs)(i.Fragment, {
children: [Fe && Qe ? (0, _.jsx)(Us, {
navigation: (0, _.jsx)(k, {
user: Qe,
promos: Re,
clientSource: C,
isHeaderProfileHidden: Oe && jl(Qe),
isHidingVideoCall: Pl(Qe, Re),
isFavourite: fe,
isSelectable: K,
isUserSubstitute: _l(Qe),
isShowingBlockingTip: Jt,
onDeleteChat: wn,
onFavouriteUser: function() {
Pe(!fe)
},
onOpenProfile: On,
onToggleReport: Tn,
scrollRef: N
}),
miniProfile: te && jl(Qe) && !Fe.deletedMember ? (0, _.jsx)(tt.Z, {
onChange: function(e) {
Te(e.isIntersecting)
},
children: (0, _.jsx)(ba, {
user: Qe,
screenName: An,
activationPlace: lt,
onProfileClick: On,
sourceOfMessage: Fe.sourceOfMessage
})
}) : null,
messages: (0, _.jsx)(Xo, {
chatInstanceId: Fe.chatInstanceId,
otherUserId: r,
chatUser: Qe,
counter: Fe.counter,
isSelectable: K,
isAllowUrlParsing: Fe.isAllowUrlParsing,
isUserSubstitute: _l(Qe),
isDummy: Fe.dummy,
messageLikeOnboarding: pt,
messages: we,
promoBanners: Ln,
dismissedPromoBanners: Mn,
scrollingContainerRef: N,
scroller: it,
oldScrollPosition: F ? B : void 0,
isShowingOffensiveMessagesPrompt: !pt.isActive && Wt,
onTogglePd: Q,
onToggleReport: Tn,
onShowPromoCards: kn,
onClickReadReceiptsPromoLink: function(e) {
De(e),
(0, l.L9)(332, {
element: 1350
})
},
onUpdateInput: mn,
onUpdateChat: xn,
onConfirmResendInappropriate: Pn,
onNewMessageNotification: function(e, t) {
Je(e),
t && et(t)
},
onSetScroller: ot,
onUserBlocked: In,
onQuestionsGameStart: Gn,
onQuestionsGameAnswer: Vn,
onDismissOffensiveMessagesModal: function(e) {
zt(!1),
p.Z.setShowLikelyOffensivePrompt(r, !1),
e && Xt(!0)
}
}),
chatNudgePromo: Un ? (0, _.jsx)(Uc, {
chatUser: Qe,
onDelete: wn
}) : !Boolean(Fe.initialScreen) && (0, _.jsx)(Mc, {
promoBlock: Nn,
chatInstanceId: Fe.chatInstanceId,
feedbackPromo: Fe.feedbackPromo,
chatUser: Qe,
clientSource: C,
isBlocker: !Boolean(Fe.inputSettingsItems),
onClickQuestionsGame: Gn,
onCloseQuestionsGame: function() {
if (dn.current) {
var e = R.getTooltipByType(53).text;
_t(e),
Et(!0)
}
},
onReloadClientOpenChat: Cn,
onCloseChat: a.Z.back
}),
newMessageNotification: (0, _.jsx)($o, {
text: $e,
isActive: Ke,
onClick: function() {
null == it || it.scrollToBottom(!0),
Je(!1)
}
}),
input: Fe.isChatBlocked || Fe.deletedMember || K || Un || null == (t = Fe.inputSettingsItems) || !t.length ? null : (0, _.jsx)(Es, {
context: Fe.context,
streamId: Fe.streamId,
otherUserId: r,
inputFeatures: Fe.inputFeatures,
inputSettingsItems: Fe.inputSettingsItems,
replyToMessage: Fe.replyToMessage,
isMessageFirst: !(null != (n = Fe.messages) && n.length),
hasReceivedMessage: Fe.hasReceivedMessage,
scroller: it,
chatUser: Qe,
notificationPermissionController: w,
activationPlace: lt,
questionsGameTooltipText: St,
showQuestionsGameTooltip: Zt,
showQuestionsGameButton: Tt,
onHideAddBanner: function(e) {
en.current && (s.Z.clearTimeout(en.current), en.current = 0),
"focus" === e.type && He(!1)
},
onBlurInput: function() {
en.current = s.Z.setTimeout((function() {
return He(!0)
}), 1e3),
tn.current = s.Z.setTimeout((function() {
an.current = !1
}), 700)
},
onFocusInput: function() {
an.current = !0
},
onUpdateInput: mn,
onClickCamera: function() {
nn.current = s.Z.setTimeout((function() {
var e;
rn.current = (null == (e = on.current) ? void 0 : e.uploadMultimedia(r)) || null,
rn.current && Pt(!0)
}), ue.Z.isIphoneContextualMenu && an.current ? 700 : 0)
},
onClickQuestionsGameButton: Gn,
onClickQuestionsGameTooltip: function() {
Et(!1),
Fn()
},
onToggleLoading: q,
onSendMessage: Pn,
onChatRefresh: Cn,
onToggleTopup: at,
onUploadAudio: function(e) {
var t;
null == (t = on.current) || t.uploadAudio(r, e)
}
}),
ads: (0, _.jsx)(Is, {
isEnabled: qe
}),
initialScreen: Fe && Boolean(Fe.initialScreen) || Fe.isChatBlocked ? (0, _.jsx)(sc, {
openChatData: Fe,
otherUserId: r,
clientSource: C,
log: xl,
messages: we,
streamId: y,
chatUser: Qe,
onDismiss: function() {
xn(),
jl(Qe) || Te(!0)
},
onChatRefresh: Cn,
onSendMessage: Pn,
onUserBlocked: In
}) : void 0,
scrollingContainerRef: N,
isLoading: V,
isHidingMessages: Boolean(Fe.initialScreen) && 0 !== Fe.maxUnansweredMessages,
isShowingCrushAnimation: Fe.isShowingCrushAnimation,
onDismissOnboarding: function() {
U(),
ht({
isActive: !1
}),
R.dismissTooltip(10, 46)
},
isOnboarding: pt.isActive || Wt
}) : null, (0, _.jsx)(Dc, {
isOpen: jt,
onCaptureClick: function() {
var e;
null == (e = rn.current) || e.onCaptureOptionClick(),
Bn()
},
onChooseClick: function() {
var e;
null == (e = rn.current) || e.onChooseOptionClick(),
Bn()
},
onCancelClick: Bn
}), Y ? (0, _.jsx)(Gc, {
chatInstanceId: r,
name: Dn,
onAnimationOutComplete: function() {
return Q(!1)
}
}) : null, Ue && Rn ? (0, _.jsx)(Jc, {
promo: Rn,
chatUser: null == Qe ? void 0 : Qe.toJSON(),
chatInstanceId: r,
onAnimationOutComplete: function() {
return De(void 0)
},
onPaymentSuccess: function() {
Ue && (Ue.setStatus(Ue.statusType), p.Z.markChatPromoHandled(r, 463))
}
}) : null, ft ? (0, _.jsx)(Vc.Z, {
user: ft,
mode: Xc.N.CHAT,
onVoteYes: function() {
if (ft) {
var e = {
user: ft,
voteType: 2
};
Sl.handleVote(e).then((function() {
m.Z.getUserById({
id: ft.getUserId(),
clientSource: 10,
folderType: 0
}).then(gt).catch((function(e) {
return (0, se.WG)("Failed to get user by id", e)
}))
})).catch((function(e) {
gl.ZP
}))
}
},
onSmile: function() {
Sl.handleSmileSendChatMessage(ft).then(gt).catch((function(e) {
return (0, se.WG)("Error when sending smile from Chat Profile", e)
}))
},
onChat: gn,
onClose: gn
}) : null, Mt ? (0, _.jsx)(fl, {
message: Ht,
chatUser: Qe,
isAnswer: Dt,
isAnswerInstant: Gt,
isOnboarding: dn.current,
isOnboardingReceiver: At,
onDismissOnboarding: Fn,
onShowAnswer: Vn,
onCloseAnswer: function() {
Lt(!1),
Bt(!1),
Vt(!1),
Yt(void 0)
},
onClose: function() {
Lt(!1)
}
}) : null]
})
},
Zl = n(63119),
El = n(43949);
function Ol(e, t) {
return Ol = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, Ol(e, t)
}
var Tl = function(e) {
var t,
n;
function r(t) {
var n;
return (n = e.call(this, t) || this).screenName = 20, n.activationPlace = 11, n.notificationPermissionController = new Zl.Z({
place: Pc.Z.PLACE_CHAT,
activationPlace: 11
}), n.onboardingTipsController = El.Z.getInstance(), n.scrollableElement = void 0, n.preventNotifications = function() {
n.notificationScreenAccess = 3
}, n.allowNotifications = function() {
n.notificationScreenAccess = 1
}, n.jinba = new D.Z("Chat", 2), n.notificationPermissionController.start(), n.scrollableElement = (0, i.createRef)(), n
}
n = e,
(t = r).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
Ol(t, n);
var s = r.prototype;
return s.componentDidMount = function() {
e.prototype.componentDidMount.call(this),
this.onboardingTipsController.start(),
this.onboardingTipsController.setContext(this.clientSource)
}, s.componentWillUnmount = function() {
this.onboardingTipsController.stop(),
this.scrollableElement.current && this.props.saveScrollPosition(this.scrollableElement.current.scrollTop)
}, s.getClientSource = function() {
var e = 6 === Number(this.getParameter("folderId")),
t = !0 === o.Z.getSync(163).enabled;
return e && t ? 127 : Number(this.getParameter("context")) || 10
}, s.render = function() {
var e = this.getParameters(),
t = e.folderId,
n = e.streamId,
i = e.userSubstitute,
o = e.id,
r = e.hotPanelData,
s = e.chatUser,
a = this.props,
c = a.scrollPosition,
l = a.navigatedBack;
return this.addPageWrapper((0, _.jsx)(kl, {
scrollPosition: c,
navigatedBack: l,
user: s,
chatUserId: o || "",
folderId: Number(t) || 0,
streamId: n,
userSubstitute: i,
hotPanelData: r,
clientSource: this.getClientSource(),
activationPlace: this.activationPlace,
screenName: this.screenName,
wasBack: this.wasBack(),
notificationPermissionController: this.notificationPermissionController,
scrollableElement: this.scrollableElement,
onboardingTipsController: this.onboardingTipsController,
onPreventNotifications: this.preventNotifications,
onAllowNotifications: this.allowNotifications,
jinba: this.jinba
}), "chat")
}, r
}(r.Z);
Tl.transition = !1,
Tl.notificationScreenAccess = void 0;
var Il = Tl
},
99836: function(e, t, n) {
n.r(t),
n.d(t, {
default: function() {
return Pi
}
});
n(68304),
n(96649),
n(96078),
n(82526),
n(41817),
n(69070),
n(38880),
n(49337),
n(33321),
n(89554),
n(41539),
n(54747),
n(82772),
n(9653),
n(69826),
n(47941),
n(34553),
n(21249),
n(26699),
n(32023),
n(57327),
n(5735),
n(83753),
n(2707),
n(66992),
n(88674),
n(78783),
n(33948),
n(5212),
n(92222);
var i = n(67294),
o = n(99111),
r = n(73234),
s = n(111),
a = n(77004),
c = n(93517),
l = n(46356),
u = n(94184),
d = n.n(u),
p = n(28223),
h = n(34969),
m = n(44887),
f = n(85893),
g = function(e) {
var t = e.isVisible,
n = e.isFixed,
i = e.fixedHeight,
o = e.onClick,
r = d()({
"connections-update-button": !0,
"is-hidden": !t,
"is-fixed": n
}),
s = n ? {
top: i
} : void 0;
return (0, f.jsx)("div", {
className: r,
style: s,
children: (0, f.jsx)("div", {
className: "connections-update-button__snackpill",
children: (0, f.jsx)(m.Z, {
icon: "generic-chevron-down",
text: h.ZP.get(444),
onClick: o
})
})
})
};
function v(e, t) {
return v = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, v(e, t)
}
var b = function(e) {
var t,
n;
function i(t) {
var n;
return (n = e.call(this, t) || this).state = {
isFixed: !1
}, n.onScroll = n.onScroll.bind(function(e) {
if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}(n)), n
}
n = e,
(t = i).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
v(t, n);
var o = i.prototype;
return o.getSnapshotBeforeUpdate = function(e) {
return !e.isVisible && this.props.isVisible ? this.getButtonPosition() : null
}, o.componentDidUpdate = function(e, t, n) {
!e.isVisible && this.props.isVisible ? (null !== n && this.updatePosition(n), a.Z.addEventListener("scroll", this.onScroll)) : !this.props.isVisible && e.isVisible && a.Z.removeEventListener("scroll", this.onScroll)
}, o.componentWillUnmount = function() {
a.Z.removeEventListener("scroll", this.onScroll)
}, o.onScroll = function() {
this.updatePosition(this.getButtonPosition())
}, o.getButtonPosition = function() {
return (0, p.Z)(this.props.containerRef.current).offset().top - a.Z.scrollY
}, o.updatePosition = function(e) {
var t = e <= this.props.fixedHeight;
this.setState({
isFixed: t
})
}, o.render = function() {
return (0, f.jsx)(g, {
isVisible: this.props.isVisible,
isFixed: this.state.isFixed,
fixedHeight: this.props.fixedHeight,
onClick: this.props.onClick
})
}, i
}(i.Component),
y = n(58509),
x = n(66515),
S = n(42308),
_ = n(97381),
C = n(83900),
j = n(99935),
P = function(e) {
var t = d()({
"chat-connections-fader": !0,
"is-dark": e.isDark
}),
n = e.onClick ? "button" : "div";
return (0, f.jsx)(n, {
className: t,
onClick: e.onClick
})
},
k = function(e) {
var t,
n = e.emptyPromo,
o = e.showFullscreenPromo,
r = e.deleteButton,
s = e.hasUsers,
a = e.isLoading,
c = e.isEditing,
l = e.isFrozen,
u = e.hasMatchBarStories,
p = e.matchBar,
m = e.connectionsList,
g = e.containerRef,
v = e.screenRef,
k = e.onClickNewActivityButton,
Z = e.navigation,
E = e.sortOptionsButton,
O = e.securityWalkthroughModal,
T = e.currentTab,
I = e.modalRef,
w = e.isReporting,
A = e.reportingId,
N = e.onReportingClose,
R = e.onReportingSuccess,
M = (0, i.useRef)(null),
L = (0, i.useRef)(null),
U = !s && n;
return (0, f.jsxs)("div", {
ref: g,
children: [w ? (0, f.jsx)(y.Z, {
clientSource: 253,
otherUserId: A,
onClose: N,
onReport: R,
onBlock: R
}) : null, (0, f.jsx)("div", {
role: c ? "dialog" : void 0,
"aria-modal": c,
"aria-label": h.ZP.get(418),
ref: I,
tabIndex: -1,
children: (0, f.jsxs)(S.Z, {
innerRef: v,
children: [(0, f.jsx)(C.Z, {
isSticky: !0,
children: (0, f.jsxs)("div", {
ref: M,
children: [Z, o ? null : (0, f.jsx)(i.Fragment, {
children: (0, f.jsxs)("div", {
className: d()("connections__match-bar", {
"connections__match-bar--stories": u
}),
inert: c ? "" : void 0,
children: [p, c ? (0, f.jsx)(P, {}) : null]
})
})]
})
}), (0, f.jsxs)(_.Z, {
align: "stretch",
children: [n && U ? (0, f.jsx)("div", {
className: "connections-empty-container",
"data-qa": "connections-empty",
id: T + "_TABPANEL",
tabIndex: -1,
role: "tabpanel",
"aria-labelledby": T + "_TAB",
children: (0, f.jsxs)("div", {
style: {
margin: "auto 0"
},
children: [(0, f.jsx)(j.Z, {
top: "md",
right: "gap",
bottom: "md",
left: "gap",
children: n
}), (0, f.jsx)("div", {
className: "connections-gap"
})]
})
}) : null, a ? (0, f.jsx)("div", {
className: "connections__loader",
children: (0, f.jsx)("div", {
style: {
width: 46,
height: 46
},
children: (0, f.jsx)(x.Z, {})
})
}) : null, U ? null : (0, f.jsxs)("div", {
className: "connections__content",
id: T + "_TABPANEL",
tabIndex: -1,
role: "tabpanel",
"aria-labelledby": T + "_TAB",
children: [E, (0, f.jsxs)("div", {
className: "connections__items",
children: [(0, f.jsx)("div", {
ref: L,
children: (0, f.jsx)(b, {
isVisible: l,
fixedHeight: null == (t = M.current) ? void 0 : t.clientHeight,
onClick: k,
containerRef: L
})
}), (0, f.jsx)("div", {
className: "connections-items",
children: m
})]
}), (0, f.jsx)("div", {
className: "connections-gap"
})]
}), r]
})]
})
}), O]
})
},
Z = (n(85827), n(19601), n(8657)),
E = n(230),
O = n(48978),
T = n(82362),
I = n(7234),
w = n(48360),
A = n(80374),
N = n(8290),
R = n(93830),
M = n(91016),
L = n(60371),
U = n(2215),
D = n(57871),
B = n(77226),
F = n(2213),
G = n(71030),
V = n(81714),
q = n(34018),
H = {
CLICK: "CLICK"
},
Y = F.Z.extend({
events: {
"click .js-click-action": "onClick_"
},
update: function(e) {
if (Y._super.update.apply(this, arguments), (0, B.Z)(e.picture))
if (e.externalAd) {
var t = M.Z.create(M.Z.placements.CONNECTIONS);
this._reactViewId = this.renderReactView((0, f.jsx)(q.Z, {
adSlot: t,
dataQa: "connections",
innerRef: this.renderExternalAds
}), this.el)
} else
this.render({
picture: e.picture,
icon: e.icon,
titleText: e.title,
descriptionText: e.text,
badgeType: e.badgeType,
mark: e.mark,
ready: e.ready,
isGift: e.isGift,
processing: e.processing
})
},
render: function(e) {
this.$el.html((0, G.Z)("PeopleNearbyFeatureCard", V.Z).render(e))
},
onClick_: function() {
this.trigger(H.CLICK)
},
reset: function() {
return this.reactViewId_ && this.removeReactView(this.reactViewId_), Y._super.reset.apply(this, arguments)
},
renderExternalAds: function(e) {
e && M.Z.render()
}
}, "SimplePromoBlockView");
Y.EVENTS = H;
var Q = Y,
W = n(1165),
z = Q.EVENTS,
K = {
MAIN: "main"
},
J = I.Z.extend({
construct: function(e, t) {
J._super.construct.call(this),
this.name = e,
this.data_ = t;
var n = new Q;
n.on(Q.EVENTS.CLICK, this.onClick_, this),
this.registerView(K.MAIN, n),
this.render()
},
getPromoBlock: function() {
return this.data_.promoBlock
},
isExternalAd: function() {
return this.data_.externalAd
},
render: function() {
var e = Object.assign({}, this.data_, {
processing: this.processing_
});
this.updateView(K.MAIN, e)
},
setParent: function(e) {
this.parent = e,
this.getView(K.MAIN).appendTo(e)
},
onClick_: function() {
this.processing_ || (W.Z.generate(), this.trigger(z.CLICK, this.getPromoBlock()))
},
setProcessing: function(e) {
this.processing_ = e,
this.render()
}
}, "SimplePromoBlockController");
J.EVENTS = z,
J.VIEWS = K;
var X,
$ = J,
ee = n(52861);
function te(e, t) {
return te = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, te(e, t)
}
var ne = [131, 129, 130, 326, 346],
ie = ((X = {})[U.Z.TYPES.MESSAGES] = 26, X[U.Z.TYPES.FAVOURITES] = 23, X[U.Z.TYPES.WANT_TO_MEET_YOU] = 6, X[U.Z.TYPES.VISITORS] = 22, X),
oe = function(e) {
var t,
n;
function i(t) {
var n,
i = t.onPromoClick,
r = t.getActivationPlace,
s = t.getElementType,
a = t.getFolderType,
c = t.setIsShowingSecurityWalkthrough;
return (n = e.call(this, {}) || this).onPromoClick = void 0, n.getActivationPlace = void 0, n.getElementType = void 0, n.getFolderType = void 0, n.setIsShowingSecurityWalkthrough = void 0, n.nextPromoControllerId = 0, n.nextPromoIndex = 0, n.batchedActivities = {}, n.promos = [], n.resetPromoBlockControllers = !0, n.shouldResetShownBlocks = !1, n.usersBeforeNextPromo = 2, n.invisiblePromo = void 0, n.onPromoClick = i, n.getActivationPlace = r, n.getElementType = s, n.getFolderType = a, n.setIsShowingSecurityWalkthrough = c, n._onPromoClick = (0, o.Z)(n._onPromoClick, 500, {
leading: !0,
trailing: !1
}), n
}
n = e,
(t = i).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
te(t, n),
i.sendStatisticsOnBannerPushed_ = function(e) {
if (ae(e)) {
var t = {
variantId: e.variant_id,
event: 2,
context: 127,
promoBlockPosition: 1
};
R.Z.sendProfileQuestionsBannerStats(t)
}
};
var r = i.prototype;
return r.reset = function() {
this.batchedActivities = {},
this.promos = [],
this.nextPromoIndex = 0,
this.usersBeforeNextPromo = 2,
this.resetPromoBlockControllers = !0
}, r.getInvisiblePromo = function() {
return this.invisiblePromo
}, r.getShownPromoBlocks = function() {
return this.shouldResetShownBlocks && (this.promos = [], this.nextPromoIndex = 0, this.shouldResetShownBlocks = !1), l.ZP.getControllers().filter((function(e) {
return e.object.getPromoBlock()
})).map((function(e) {
return e.object.getPromoBlock().promo_block_type
}))
}, r.setPromoBlocks = function(e) {
var t = e.promos;
null != t && t.length && this.setPromos(t)
}, r.process = function(e) {
var t,
n = this,
i = e.items,
o = e.clientUserList,
r = e.isUpdates,
s = o.getPromoBlockResponseParams();
null != s && null != (t = s[0]) && t.getResetShownPromoBlocks() && (this.shouldResetShownBlocks = !0);
var a = o.toJSON().promo_banners;
if (null != a && a.length) {
var c = a.find((function(e) {
return 4 === e.promo_block_position
}));
c && (r && l.ZP.hasTopMostPromo() ? l.ZP.replaceTopMostPromo(c) : this.addPromoBlock(i, c)),
r || a.forEach((function(e) {
var t = e.promo_block_type;
ne.includes(t) && n.addPromoBlock(i, e)
}));
var u = a.find((function(e) {
return 37 === e.promo_block_type
}));
this.invisiblePromo = u || this.invisiblePromo
}
}, r.processUsers = function(e) {
var t = this,
n = e.items;
e.users.forEach((function(e) {
n.push(e),
t.batchedActivities[e.user_id] && n.push(t.batchedActivities[e.user_id])
}))
}, r.prependBanner = function(e) {
var t = l.ZP.getControllers()[0];
if (!t)
return e;
var n = l.ZP.findIndex(t.object);
if (n + e.length > 9) {
var i = n + e.length - 9;
e = [].concat(e.slice(0, i), [this.registerPromoController(this.getNextPromo())], e.slice(i))
}
return e
}, r.appendBanners = function() {
var e = this;
this.nextPromoIndex = 0,
this.usersBeforeNextPromo = 2;
var t = this.resetPromoBlockControllers ? [] : l.ZP.getControllers().map((function(e) {
return e.object
}));
this.resetPromoBlockControllers = !1;
var n = l.ZP.getItems().reduce((function(n, i) {
return i.object instanceof I.Z || (n.push(i.object), e.insertBannerIfNecessary(n, t)), n
}), []);
l.ZP.addPage(n, !0)
}, r.insertBannerIfNecessary = function(e, t) {
var n,
i = e[e.length - 1];
if (i && (i.user_id || (n = i).promo_block_position && 1 === n.promo_block_position && 326 === n.promo_block_type) && this.usersBeforeNextPromo--, this.usersBeforeNextPromo <= 0) {
if (this.promos) {
var o = this.getNextPromo();
if (o)
if (t.length) {
var r = t.shift();
e.push(r),
null == r || r.start()
} else
e.push(this.registerPromoController(o))
}
this.usersBeforeNextPromo = 9
}
}, r.addPromoBlock = function(e, t) {
if (t.place_after_user)
this.batchedActivities[t.place_after_user] = t;
else {
var n = function(e, t) {
var n = !ae(t);
if (!n) {
n = !e.some((function(e) {
return 346 === e.promo_block_type
}))
}
return n
}(e, t);
n && (i.sendStatisticsOnBannerPushed_(t), e.push(t)),
this.usersBeforeNextPromo--
}
var o,
r;
(r = function(e) {
switch (e.promo_block_type) {
case 131:
return 10;
case 129:
return 100;
case 130:
return 101;
case 165:
return 14
}
return null
}(o = t)) && ((0, ee.L9)(258, {
element: r
}), (0, ee.L9)(333, {
element: r,
count: re(o)
}))
}, r.setPromos = function(e) {
var t = e.filter((function(e) {
return 1 === e.promo_block_position && !ne.includes(e.promo_block_type)
}));
this.promos = M.Z.isEnabled() ? [{
externalAd: !0
}] : this.promos.concat(t)
}, r.getNextPromo = function() {
var e;
return this.promos && (e = this.promos[this.nextPromoIndex++], this.nextPromoIndex === this.promos.length && (this.nextPromoIndex = 0)), e
}, r.registerPromoController = function(e) {
var t,
n = O.Z.getUser(),
i = n ? n.gender : 3;
t = e && "externalAd" in e ? {
externalAd: !0,
picture: {}
} : function(e, t) {
var n = e.promo_block_type,
i = function(e) {
var t = e.credits_cost,
n = t || e.mssg,
i = e.header || t && n;
return {
title: i,
text: n
}
}(e),
o = Object.assign({
promoBlock: e,
isGift: 5 === e.ok_payment_product_type,
mark: se(e),
badgeType: A.Z.getBadgeTypeForPromoBlock(n)
}, i),
r = A.Z.getPictureForPromoBlockTS(e, {
gender: t
});
r.type === w.Z.IMAGE_TYPE.URL && (o.picture = {
url: r.value,
disableMasking: r.disableMasking
});
r.type === w.Z.IMAGE_TYPE.SYMBOL && (o.icon = r.value);
return o.gender = t, o
}(e, i);
var o = "promo-" + this.nextPromoControllerId++,
r = new $(o, t);
return r.on($.EVENTS.CLICK, this._onPromoClick.bind(this, r)), this.registerController(o, r), r.start(), r
}, r._onPromoClick = function(e, t, n) {
if (t) {
switch (this.onPromoClick(), e.setProcessing(!0), this.trackClickBannerEvent(t), t.promo_block_type) {
case 65:
(0, ee.L9)(332, {
element: 547
}),
E.Z.navigate(T.x.SPP_TRIAL, !1, {
returnTo: E.Z.getUrl(),
context: 26,
activationPlace: 191,
fromBanner: !0
});
break;
case 195:
this.setIsShowingSecurityWalkthrough();
break;
default:
(0, ee.L9)(332, {
element: 95,
parent_element: this.getElementType()
}),
this.performAction(t.ok_action, t, n)
}
var i = (0, Z.Z)(this.rotatePromoControllers.bind(this, e));
A.Z.once(A.Z.EVENTS.END_PAYMENT, i)
}
}, r.performAction = function(e, t, n) {
switch (e) {
case 9:
case 4:
case 2:
A.Z.handlePromoSelected({
action: e,
activationPlace: this.getActivationPlace(),
banner: t.promo_block_type,
cost: t.payment_amount,
productType: t.ok_payment_product_type
}, {
from: E.Z.getUrl()
});
break;
case 6:
this.navigateToSppPayment(t, n);
break;
default:
D.Z.showNotification({
type: D.Z.TYPES.ERROR
})
}
}, r.navigateToSppPayment = function(e, t) {
var n = e.ok_payment_product_type,
i = e.promo_block_type,
o = {
activationPlace: this.getActivationPlace(),
bannerId: e.promo_block_type
},
r = {
back: E.Z.getUrl(),
hotPanelData: o,
productType: n,
promoBlockType: i
};
null != t && t.userId && (r.userId = t.userId),
N.Z.navigateToPayment(r)
}, r.rotatePromoControllers = function(e) {
var t = this;
e.setProcessing(!1);
var n = l.ZP.findIndex(e);
this.fetch({
shownPromoBlocks: this.getShownPromoBlocks(),
excludePromoBlocks: [e.getPromoBlock().promo_block_type],
count: l.ZP.getControllers().length
}).then((function(e) {
var i = e[0].toJSON().promo_blocks;
if (i) {
var o = l.ZP.getControllers().map((function(e) {
return l.ZP.findIndex(e.object)
}));
o = [].concat(o.slice(o.indexOf(n)), o.slice(0, o.indexOf(n))).slice(0, i.length),
i.forEach((function(e, n) {
if (void 0 !== o[n]) {
var i = t.registerPromoController(e);
l.ZP.replaceItem({
object: i,
key: "promoController" + n
}, o[n])
}
}))
}
}))
}, r.fetch = function(e) {
var t = e.shownPromoBlocks,
n = e.excludePromoBlocks,
i = e.count;
return L.Z.getInstance().get({
context: this.getClientSource(),
position: 1,
shownPromoBlocks: t,
excludePromoBlocks: n,
count: i || 4
})
}, r.getClientSource = function() {
return ie[this.getFolderType()] || 127
}, r.trackClickBannerEvent = function(e) {
var t = {
banner_id: e.promo_block_type,
position_id: e.promo_block_position,
context: this.getClientSource()
},
n = e.stats_variation_id;
n && (t.variation_id = n),
(0, ee.L9)(139, t)
}, i
}(I.Z);
function re(e) {
var t = e.pictures,
n = null == t ? void 0 : t.find((function(e) {
return 2 === e.badge_type
}));
return n && Number(n.badge_text) || 0
}
function se(e) {
var t,
n = null == (t = e.pictures) ? void 0 : t[0],
i = e.counter || (null == n ? void 0 : n.badge_text);
return i ? {
text: i,
type: 41 === e.promo_block_type ? "double-credits-badge" : null
} : null
}
function ae(e) {
return 346 === e.promo_block_type
}
var ce = oe,
le = n(24953),
ue = n(12462),
de = n(68091),
pe = n(83167),
he = n(6662),
me = n(18987),
fe = n(42174);
function ge(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function ve(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? ge(Object(n), !0).forEach((function(t) {
be(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ge(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function be(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
var ye = function(e) {
var t,
n,
o,
r,
s = e.promoBlock,
a = e.onClick,
c = e.sendTrackingOnMount;
(0, i.useEffect)((function() {
c()
}), []);
var l,
u = null == (t = s.pictures) ? void 0 : t[0].badge_type;
u && (r = 7 === u ? "badge-feature-extra-shows" : void 0),
20 === s.promo_block_position && (r = 12 === s.promo_block_type ? "badge-add-photos" : "badge-email");
var d,
p = null == (n = s.buttons) ? void 0 : n[0];
p && (l = {
text: p.text,
onClick: function() {
return a(s, 0)
},
dataQA: {
"data-qa": "continue-button"
}
});
var h = null == (o = s.buttons) ? void 0 : o[1];
return h && (d = {
semantic: "tertiary",
text: h.text,
onClick: function() {
return a(s, 1)
},
dataQA: {
"data-qa": "continue-secondary-button"
}
}), (0, f.jsxs)(le.Z, {
align: "start",
children: [r ? (0, f.jsx)(ue.Z, {
size: "icon",
children: (0, f.jsx)(fe.Z, {
name: r
})
}) : null, (0, f.jsx)(pe.Z, {
text: s.header
}), (0, f.jsx)(he.Z, {
text: s.mssg
}), (0, f.jsxs)(de.Z, {
children: [l ? (0, f.jsx)(me.Z, ve({}, l)) : null, d ? (0, f.jsx)(me.Z, ve({}, d)) : null]
})]
})
},
xe = n(45752);
function Se(e, t) {
return Se = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, Se(e, t)
}
var _e = function(e) {
var t,
n;
function o(t) {
var n;
return (n = e.call(this, t) || this).scrollsSkipped_ = 0, n.hasStarted = !1, n.onScroll = (0, s.Z)(n.onScroll.bind(function(e) {
if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}(n)), 250), n
}
n = e,
(t = o).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
Se(t, n);
var r = o.prototype;
return r.componentDidMount = function() {
a.Z.addEventListener("scroll", this.onScroll, !1)
}, r.componentWillUnmount = function() {
clearTimeout(this.scrollHandlerTimeout_),
a.Z.removeEventListener("scroll", this.onScroll, !1)
}, r.componentDidUpdate = function() {
if (!this.hasStarted && this.props.items.length > 0) {
this.hasStarted = !0;
var e = a.Z.document.body.pageYOffset || (0, xe.Z)().scrollTop;
this.props.scrollHandler(e)
}
}, r.onScroll = function() {
var e = this,
t = a.Z.document.body.pageYOffset || (0, xe.Z)().scrollTop,
n = a.Z.document.body.innerHeight || a.Z.document.body.clientHeight,
i = (0, xe.Z)().scrollHeight - n - .5 * n;
t >= i && this.props.fetchNewPage(),
clearTimeout(this.scrollHandlerTimeout_),
this.scrollsSkipped_ += 1,
this.props.scrollHandler && this.scrollsSkipped_ > 5 ? (this.scrollsSkipped_ = 0, this.props.scrollHandler(t)) : this.scrollHandlerTimeout_ = setTimeout((function() {
e.props.scrollHandler(t)
}), 500)
}, r.render = function() {
return i.Children.only(this.props.children)
}, o
}(i.Component),
Ce = n(43018),
je = (n(91058), n(86273)),
Pe = n(57896),
ke = n(94273),
Ze = n(27503),
Ee = n(67047),
Oe = n(90794),
Te = n(60822),
Ie = n(29160),
we = n(92823),
Ae = n(40559),
Ne = n(77110),
Re = n(57384),
Me = function(e) {
var t,
n = e.user,
o = e.badge,
r = e.mediaOverlay,
s = e.halo,
a = e.tag,
c = e.moodStatus,
l = e.lastMessageStatus,
u = e.message,
p = e.isChecked,
h = e.isLocked,
m = e.isDisabled,
g = e.isDeleting,
v = e.isFavouriteAllowed,
b = e.onClick,
y = e.onFavourite,
x = e.userRef,
S = e.isAddedHACK,
_ = e.a11y,
C = d()({
"csms-connections-item": !0,
"csms-connections-item--user": !0,
"csms-connections-item--disabled": m,
"js-mw-connections-item": !0,
"js-mw-connections-item--is-checked": !m && p,
"mw-connections-item--is-added-hack": S,
"is-deleted": g
}),
j = d()({
"csms-connections-item__favourite": !0,
"csms-is-active": n.isFavourite
});
(p || r) && (t = {
children: (0, f.jsxs)(i.Fragment, {
children: [p ? (0, f.jsx)("span", {
className: "csms-connections-item__media-icon",
children: (0, f.jsx)(fe.Z, {
name: "generic-check"
})
}) : null, r]
}),
background: p ? "primary" : "transparent"
});
var P = "user" + n.id,
k = (0, f.jsxs)(i.Fragment, {
children: [(0, f.jsx)("span", {
className: "csms-connections-item__profile",
children: (0, f.jsx)(Re.BB, {
color: "black",
children: (0, f.jsx)(Te.Z, {
name: n.name,
age: n.age,
status: n.status,
a11y: {
label: null == _ ? void 0 : _.profileInfoLabel
}
})
})
}), c ? (0, f.jsx)("span", {
className: "csms-connections-item__mood-status",
"aria-hidden": !0,
children: (0, f.jsx)(Oe.Z, {
size: "16px",
text: c,
visuallyCorrected: !0
})
}) : null, a ? (0, f.jsxs)("span", {
className: "csms-connections-item__tag",
children: [(0, f.jsx)(ke.Z, {
children: ","
}), (0, f.jsx)(Ze.Z, {
text: a.text,
size: "small",
styling: a.styling
})]
}) : null]
});
return (0, f.jsx)("div", {
className: C,
"data-qa": "connections-item",
"data-qa-connections-item-type": "user",
"data-qa-blocking-promo": h ? "locked" : null,
"aria-hidden": m,
children: (0, f.jsxs)(Ie.Z, {
children: [(0, f.jsx)(Ne.Z, {
children: (0, f.jsx)("div", {
className: "csms-connections-item__media",
children: (0, f.jsx)(Ee.Z, {
size: "sm",
user: n,
badge: o,
halo: s,
overlay: t
})
})
}), (0, f.jsxs)(we.Z, {
children: ["toggle" !== (null == _ ? void 0 : _.role) ? (0, f.jsx)("button", {
className: "csms-connections-item__user",
onClick: b,
disabled: m,
"data-qa": "connections-item-content",
ref: x,
"aria-describedby": u ? P : void 0,
children: k
}) : (0, f.jsxs)("label", {
className: "csms-connections-item__user",
"data-qa": "connections-item-content",
ref: x,
children: [k, (0, f.jsx)("input", {
className: "csms-connections-item__checkbox",
type: "checkbox",
defaultChecked: p,
onChange: function(e) {
null == b || b()
},
"aria-label": null == _ ? void 0 : _.profileInfoLabel
})]
}), u ? (0, f.jsxs)("div", {
className: "csms-connections-item__message",
"data-qa": "csms-connections-item__message",
id: P,
children: [l ? (0, f.jsx)("div", {
className: "csms-connections-item__message-read-receipt-status",
"aria-hidden": !0,
children: (0, f.jsx)(fe.Z, {
name: "generic-read-receipt",
color: "seen" === l ? "feature-revenue" : "gray-30"
})
}) : null, (0, f.jsx)(Re.P2, {
ellipsis: !0,
dangerous: !0,
children: u
}), (0, f.jsx)(ke.Z, {
children: null == _ ? void 0 : _.messageStatusLabel
})]
}) : null]
}), v ? (0, f.jsx)(Ae.Z, {
children: (0, f.jsx)("button", {
className: j,
onClick: y,
"data-qa": "favourite",
"data-qa-favourited": n.isFavourite ? "true" : "false",
"aria-pressed": n.isFavourite,
children: (0, f.jsx)(fe.Z, {
name: n.isFavourite ? "generic-star" : "generic-star-outlined",
a11y: {
label: null == _ ? void 0 : _.favouriteLabel
}
})
})
}) : null]
})
})
};
Me.defaultProps = {
isFavouriteAllowed: !0
};
var Le = Me,
Ue = function(e) {
var t,
n = e.image,
o = e.icon,
r = e.user,
s = e.badge,
a = e.mediaOverlay,
c = e.title,
l = e.message,
u = e.action,
p = e.isProcessing,
h = e.isDisabled,
m = e.onClick,
g = e.innerRef,
v = e.isAddedHACK,
b = d()({
"csms-connections-item": !0,
"csms-connections-item--promo": !0,
"csms-connections-item--disabled": h,
"js-mw-connections-item": !0,
"mw-connections-item--is-added-hack": v
});
return (p || a) && (t = {
children: (0, f.jsxs)(i.Fragment, {
children: [p ? (0, f.jsx)("span", {
className: "csms-connections-item__loader-wrapper",
children: (0, f.jsx)(x.Z, {})
}) : null, a]
}),
background: p ? "dark" : "transparent"
}), (0, f.jsx)("button", {
className: b,
onClick: m,
"data-qa": "connections-item",
"data-qa-connections-item-type": "promo",
ref: g,
disabled: h,
"aria-hidden": h,
children: (0, f.jsxs)(Ie.Z, {
tag: "span",
children: [(0, f.jsx)(Ne.Z, {
tag: "span",
children: (0, f.jsx)("span", {
className: "csms-connections-item__media",
children: (0, f.jsx)(Ee.Z, {
size: "sm",
image: n,
icon: o,
user: r,
badge: s,
overlay: t
})
})
}), (0, f.jsxs)(we.Z, {
tag: "span",
children: [c ? (0, f.jsx)("span", {
className: "csms-connections-item__title",
children: (0, f.jsx)(Re.P2, {
dangerous: !0,
children: c
})
}) : null, l ? (0, f.jsx)("span", {
className: "csms-connections-item__message",
"data-qa": "csms-connections-item__message",
children: (0, f.jsx)(Re.P2, {
dangerous: !0,
children: l
})
}) : null, u ? (0, f.jsx)("span", {
className: "csms-connections-item__action",
children: (0, f.jsx)(Re.P2, {
children: u
})
}) : null]
})]
})
})
},
De = function(e) {
var t = e.icon,
n = e.title,
i = e.onClick,
o = d()({
"csms-connections-item": !0,
"csms-connections-item--promo-video": !0
});
return (0, f.jsx)("button", {
className: o,
"data-qa": "connections-item",
"data-qa-connections-item-type": "promo-video",
"data-qa-feature-card": !0,
onClick: i,
children: (0, f.jsxs)(Ie.Z, {
tag: "span",
children: [(0, f.jsx)(Ne.Z, {
tag: "span",
children: (0, f.jsx)("span", {
className: "liked-you-media",
children: (0, f.jsx)(Ee.Z, {
size: "sm",
icon: t
})
})
}), (0, f.jsx)(we.Z, {
tag: "span",
children: (0, f.jsx)("span", {
"data-qa": "connections-item__title",
children: (0, f.jsx)(Re.P1, {
color: "black",
dangerous: !0,
tag: "span",
children: n
})
})
})]
})
})
},
Be = (n(39714), n(52306)),
Fe = function(e) {
var t = e.images,
n = e.counter,
i = e.title,
o = e.isDisabled,
r = e.onClick,
s = d()({
"csms-connections-item": !0,
"csms-connections-item--disabled": o
}),
a = d()({
"liked-you-media__image": !0,
"liked-you-media__image--multiple": t.length > 3
}),
c = t.length > 3 ? t.map((function(e) {
return "url(" + e + ")"
})).toString() : "url(" + t[0] + ")";
return (0, f.jsx)("button", {
className: s,
"data-qa": "connections-item",
"data-qa-connections-item-type": "liked-you",
"data-qa-feature-card": !0,
onClick: r,
disabled: o,
"aria-hidden": o,
children: (0, f.jsxs)(Ie.Z, {
tag: "span",
children: [(0, f.jsx)(Ne.Z, {
tag: "span",
children: (0, f.jsxs)("div", {
className: "liked-you-media",
children: [(0, f.jsx)("span", {
className: a,
style: {
backgroundImage: c
}
}), (0, f.jsx)("span", {
className: "liked-you-media__badge",
children: (0, f.jsx)(Be.Z, {
icon: "generic-heart",
text: n,
styling: "liked-you",
shadow: !0
})
})]
})
}), (0, f.jsx)(we.Z, {
tag: "span",
children: (0, f.jsx)("span", {
"data-qa": "connections-item__title",
children: (0, f.jsx)(Re.P1, {
color: "black",
dangerous: !0,
tag: "span",
children: i
})
})
})]
})
})
},
Ge = function(e) {
var t,
n = e.position,
i = void 0 === n ? "tr" : n,
o = e.children,
r = d()(((t = {
petal: !0
})["petal--" + i] = !0, t));
return (0, f.jsx)("div", {
className: r,
children: o
})
},
Ve = (n(74916), n(2025)),
qe = n(96437),
He = n(2568),
Ye = n.n(He),
Qe = ["", Ve.jr.CHATS, Ve.jr.CONVERSATIONS, Ve.jr.UNREPLIED, Ve.jr.FAVOURITES, Ve.jr.ONLINE];
function We(e) {
switch (e.connection_status_indicator) {
case 2:
return {
text: h.ZP.get(463).toUpperCase(),
styling: "selected"
};
case 4:
return {
text: h.ZP.get(143).toUpperCase(),
styling: "default"
};
default:
return
}
}
function ze(e) {
switch (e.last_message_status) {
case 1:
return "delivered";
case 2:
return "seen";
default:
return
}
}
function Ke(e) {
var t,
n = e.item,
i = e.isEditing,
o = e.isUpdate,
r = n.promo_block_type || n.experimentType,
s = n.pictures,
a = s ? s[0].badge_text : null,
c = s ? s[0].display_images : null;
a && (t = Number(a.replace(/\D/g, "")) <= 99 ? a : "99+");
var l = n.header,
u = n.mssg;
return 346 === r && (l = u), {
imgSrc: c,
counter: t,
title: l,
message: u,
isDisabled: i,
isAddedHACK: o
}
}
function Je(e) {
return e.is_conversation || e.unread_messages_count > 0 ? 15 : e.is_match ? 11 : e.is_crush ? 22 : 2 === e.their_vote ? 4 : e.favourited_you ? 23 : e.is_favourite ? 24 : e.is_visitor ? 25 : void 0
}
function Xe(e, t) {
var n = e.is_crush;
if (n && t.param === Ve.jr.FAVOURITES)
return 1;
var i = e.is_unread,
o = e.unread_messages_count || 0,
r = o > 0 && Qe.indexOf(t.param) > -1,
s = !r && !n && i && e.is_match;
return s || n || !r ? s || n || !i ? 0 : 1 : o
}
function $e(e) {
switch (e) {
case 21:
return "generic-play-circle-hollow";
case 346:
return "badge-feature-icebreaker";
default:
return "badge-feature-liked-you"
}
}
var et = n(21346),
tt = n(45450),
nt = n(42345);
function it(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function ot(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? it(Object(n), !0).forEach((function(t) {
rt(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : it(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function rt(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
function st(e) {
if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}
function at(e, t) {
return at = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, at(e, t)
}
var ct = je.Z.getLogger("ConnectionsItemContainer"),
lt = function(e) {
var t,
n;
function i(t) {
var n;
return (n = e.call(this, t) || this).handleClick = function() {
var e = n.props;
(0, e.onClick)(e.item)
}, n.handleLikedYouClick = function(e) {
return function() {
var t;
n.handleClick(),
t = parseInt(e, 10),
(0, ee.L9)(333, {
element: 5,
count: t
})
}
}, n.handleClick = n.handleClick.bind(st(n)), n.handleLikedYouClick = n.handleLikedYouClick.bind(st(n)), n.handleFavourite = n.handleFavourite.bind(st(n)), n.state = i.getState(t), n
}
n = e,
(t = i).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
at(t, n),
i.getState = function(e) {
var t = (e || {}).item,
n = (0, l.NU)(t),
i = (0, l.$Y)(t) && 1 === t.promo_block_position && 2 === t.stats_variation_id,
o = (0, l.$Y)(t) && 1 === t.promo_block_position && 326 === t.promo_block_type,
r = (0, l.$Y)(t) && 20 === t.promo_block_position && 326 === t.promo_block_type,
s = (0, l.$Y)(t) && 4 === t.promo_block_position && 21 === t.promo_block_type,
a = (0, l.$Y)(t) && 1 === t.promo_block_position && 346 === t.promo_block_type;
return {
isUser: n,
isLikedYou: i,
isMoreLikesPromo: o,
isVideoPromo: s,
isPromo: o || s || a,
isConnectionItem: (0, l.$Y)(t) && !r
}
};
var o = i.prototype;
return o.handleFavourite = function(e) {
e.stopPropagation();
var t = this.props;
(0, t.onFavourite)(t.item)
}, o.renderUser = function() {
var e,
t = this,
n = function(e) {
var t,
n,
i,
o,
r = e.item,
s = e.isChecked,
a = e.isEditing,
c = e.isUpdate,
l = r,
u = (null == (t = l.profile_photo) ? void 0 : t.large_url) && w.Z.getImageUrlForSize(null == (n = l.profile_photo) ? void 0 : n.large_url, 70),
d = l.is_deleted,
p = l.is_invisible,
h = l.is_unread,
m = !p && 30 !== l.access_level,
f = parseInt(Ye()(l.user_id), 16),
g = String(f % 9 + 1),
v = u || d ? null : {
letter: l.name ? l.name.charAt(0) : "",
variant: g
};
return d ? o = "deleted" : p && (o = "invisible"), {
user: {
name: l.name,
age: l.age,
gender: (0, qe.gp)(l.gender),
isFavourite: l.is_favourite,
disguise: o,
photo: u ? {
src: u
} : null,
placeholder: v,
status: {
online: (0, qe.GA)(l.online_status)
},
moodStatusEmoji: null == (i = l.mood_status) ? void 0 : i.emoji,
id: l.user_id
},
connectionStatusIndicator: We(l),
message: l.display_message,
lastMessageStatus: ze(l),
isChecked: s,
isLocked: !!l.profile_blocker_promo,
isDisabled: a && !m || l.is_not_interested,
isFavouriteAllowed: !a && l.allow_add_to_favourites,
isAddedHACK: c,
isNew: h
}
}(this.props),
i = n.user,
o = n.message,
r = n.lastMessageStatus,
s = n.isChecked,
a = n.isLocked,
c = n.isDisabled,
l = n.isFavouriteAllowed,
u = n.isAddedHACK,
d = n.connectionStatusIndicator,
p = n.isNew;
return (0, f.jsx)(Pe.Z, {
src: null == (e = i.photo) ? void 0 : e.src,
render: function(e) {
var n,
m = e.src,
g = ot(ot({}, i), {}, {
id: (0, tt.xY)(i.id),
photo: m ? {
src: m
} : null
}),
v = [i.age ? h.ZP.get(807, {
name: i.name,
age: i.age
}) : i.name, "online" === (null == (n = i.status) ? void 0 : n.online) ? h.ZP.get(847) : void 0];
return (0, f.jsx)(Le, {
user: g,
message: o,
lastMessageStatus: r,
isChecked: s,
isLocked: a,
isDisabled: c,
isDeleting: t.props.isDeleting,
isFavouriteAllowed: l,
onClick: t.handleClick,
onFavourite: t.handleFavourite,
tag: d,
moodStatus: (0, et.lM)() ? i.moodStatusEmoji : void 0,
isAddedHACK: u,
mediaOverlay: p ? (0, f.jsx)(Ge, {
children: (0, f.jsx)("div", {
className: "connections-dot-counter-notification"
})
}) : void 0,
a11y: {
favouriteLabel: h.ZP.get(144) + ", " + g.name,
role: t.props.isEditing ? "toggle" : "cta",
profileInfoLabel: (0, nt.s)(v)
}
})
}
})
}, o.renderLikedYou = function() {
var e,
t = this.props.item,
n = Ke(this.props),
i = n.title,
o = n.isDisabled,
r = null == (e = t.extra_texts) ? void 0 : e[0].text,
s = t.pictures.map((function(e) {
return e.display_images
}));
return (0, f.jsx)(Fe, {
counter: r,
title: i,
images: s,
isDisabled: o,
onClick: this.handleLikedYouClick(r)
})
}, o.renderPromo = function() {
var e,
t = this.props.item,
n = Ke(this.props),
i = n.title,
o = n.isDisabled,
r = t.promo_block_type,
s = 21 === r,
a = 346 === r,
c = {
name: $e(r)
},
l = s || a ? void 0 : {
mark: {
text: null == (e = t.extra_texts) ? void 0 : e[0].text
}
},
u = s ? De : Ue;
return (0, f.jsx)(u, {
icon: c,
badge: l,
title: i,
isDisabled: o,
onClick: this.handleClick
})
}, o.renderConnectionItem = function() {
var e = Ke(this.props),
t = e.imgSrc,
n = e.counter,
i = e.title,
o = e.message,
r = e.isDisabled,
s = e.isAddedHACK;
return (0, f.jsx)(Ue, {
image: {
src: t
},
title: i,
message: o,
isDisabled: r,
isAddedHACK: s,
onClick: this.handleClick,
mediaOverlay: Boolean(n) ? (0, f.jsx)(Ge, {
children: (0, f.jsx)("div", {
className: "connections-dot-counter-notification"
})
}) : void 0
})
}, o.render = function() {
var e = this.state,
t = e.isUser,
n = e.isLikedYou,
i = e.isPromo,
o = e.isConnectionItem;
return t ? this.renderUser() : n ? this.renderLikedYou() : i ? this.renderPromo() : o ? this.renderConnectionItem() : (ct.error("Connections - trying to render an unexpected item: " + this.props.item), null)
}, i
}(i.Component),
ut = lt,
dt = function(e) {
var t = e.children;
return (0, f.jsx)("ul", {
className: "csms-connections-list",
children: i.Children.map(t, (function(e) {
return (0, f.jsx)("li", {
className: "csms-connections-list__item",
"data-qa": "connections-list-item",
children: e
})
}))
})
};
function pt(e, t) {
return pt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, pt(e, t)
}
var ht = function(e) {
var t,
n;
function i() {
for (var t, n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return (t = e.call.apply(e, [this].concat(i)) || this).element = null, t
}
n = e,
(t = i).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
pt(t, n);
var o = i.prototype;
return o.componentDidMount = function() {
this.props.controller.setParent((0, p.Z)(this.element))
}, o.render = function() {
var e = this,
t = this.props.controller.isExternalAd(),
n = d()({
"chat-connections-list-banner": !0,
"is-external-ad": t
});
return (0, f.jsxs)("div", {
className: n,
"data-qa": "connections-item",
"data-qa-connections-item-type": "promo",
ref: function(t) {
e.element = t
},
"aria-hidden": this.props.isEditing,
inert: this.props.isEditing ? "" : void 0,
children: [this.props.isEditing ? (0, f.jsx)(P, {}) : null, (0, f.jsx)("div", {
className: "b-link"
})]
})
}, i
}(i.Component),
mt = ht,
ft = n(49952),
gt = je.Z.getLogger("ConnectionsList"),
vt = function(e) {
var t = e.containerRef,
n = e.items,
i = e.currentFilter,
o = e.isEditing,
r = e.isLoading,
s = e.onSelectItem,
a = e.onFavouriteItem,
c = e.onItemVisible,
u = e.onBannerVisible,
d = e.getUserSubstitute;
if (!n)
return null;
var p = function(e) {
if (e instanceof I.Z && u(e), (0, l.NU)(e)) {
var t = e;
if (3 === t.type)
!function(e) {
if (e) {
var t = e.connectionPromoCard;
(0, ee.L9)(138, {
banner_id: null == t ? void 0 : t.hotpanelData.bannerId,
context: 127
})
}
}(d(t.user_id));
else {
var n = i;
(0, ee.L9)(623, {
encrypted_user_id: t.user_id,
activation_place: n.activationPlace || 1,
badge_count: Xe(t, n),
connection_status: Je(t)
})
}
var o = e.is_unread,
r = !0 === e.is_visitor;
o && r && c(e)
} else
(0, l.$Y)(e) && u && u(e)
},
h = function(e) {
var t = e.object,
n = e.isUpdate,
i = e.isChecked,
r = e.isDeleting,
c = void 0 !== r && r,
u = t instanceof I.Z,
d = (0, l.NU)(t) || (0, l.$Y)(t);
return u ? (0, f.jsx)(mt, {
controller: t,
isEditing: o
}) : d ? (0, f.jsx)(ut, {
item: t,
isChecked: i,
isEditing: o,
isUpdate: n,
isDeleting: c,
onClick: s,
onFavourite: a
}) : (gt.error("Connections - trying to render an unexpected item: " + t), null)
};
return (0, f.jsxs)("div", {
ref: t,
children: [(0, f.jsx)(dt, {
children: n.map((function(e) {
return (0, f.jsx)(ft.Z, {
onIntersect: function() {
return p(e.object)
},
children: h(e)
}, e.key)
}))
}), r ? (0, f.jsx)(Ce.ZP, {
relative: !0,
size: Ce.Xt.SMALL,
color: Ce.IX.DARK,
extraClass: "js-loader"
}) : null]
})
};
function bt(e, t) {
return bt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, bt(e, t)
}
var yt,
xt = function(e) {
var t,
n;
function o(t) {
var n;
return (n = e.call(this, t) || this).divContainer = void 0, n.lastVisibleElement = void 0, n.handleSelectItem = function(e) {
var t = l.ZP.findIndex(e),
i = l.ZP.get(t);
if (void 0 !== i) {
if (n.props.isEditing) {
if (!(0, l.NU)(i.object) || i.object.is_invisible || 30 === i.object.access_level)
return;
i.isChecked = !i.isChecked,
l.ZP.replaceItem(i, t),
n.setState({
items: l.ZP.getItems(n.props.currentTab, n.props.currentPromoContext, n.props.currentSortOption)
})
} else
i.isChecked || n.props.onSelectItem(e, t);
return !1
}
}, n.handleScroll = function(e) {
var t = n.calculateLastVisibleItemIndex(e);
t > -1 && n.props.onTrackScroll(t)
}, n.divContainer = (0, i.createRef)(), n.state = {
markedUserIds: [],
items: l.ZP.getItems(n.props.currentTab, n.props.currentPromoContext, n.props.currentSortOption)
}, n
}
n = e,
(t = o).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
bt(t, n);
var r = o.prototype;
return r.componentDidUpdate = function() {
(0, qe.co)((0, p.Z)(this.divContainer.current).find(".js-mw-connections-item.mw-connections-item--is-added-hack"), (function() {
l.ZP.removeUpdatedFlags()
}))
}, r.calculateLastVisibleItemIndex = function(e) {
var t,
n = this.lastVisibleElement || (0, p.Z)(this.divContainer.current).children().first();
if (null == (t = n) || !t.length)
return -1;
for (e += a.Z.document.documentElement.offsetHeight; null != (i = n) && i.length;) {
var i,
o = n.next();
if (o.index() < 0 || (0, p.Z)(o).hasClass("js-loader"))
break;
var r = o.offset();
if (r.top + r.height > e)
break;
n = o
}
return this.lastVisibleElement = n, n.index()
}, r.render = function() {
var e = l.ZP.getItems(this.props.currentTab, this.props.currentPromoContext, this.props.currentSortOption);
return (0, f.jsx)(_e, {
items: e,
scrollHandler: this.handleScroll,
fetchNewPage: this.props.onNeedPage,
children: (0, f.jsx)(vt, {
containerRef: this.divContainer,
items: e,
currentFilter: this.props.currentFilter,
isLoading: this.props.isLoading,
isEditing: this.props.isEditing,
onSelectItem: this.handleSelectItem,
onFavouriteItem: this.props.onFavouriteItem,
onItemVisible: this.props.onItemVisible,
onBannerVisible: this.props.onBannerVisible,
getUserSubstitute: this.props.getUserSubstitute
})
})
}, o
}(i.Component),
St = n(88179),
_t = n(27966),
Ct = function(e) {
var t = e.header,
n = e.subHeader,
i = e.popularityLevel,
o = void 0 === i ? St.V7.VERY_LOW : i,
r = e.hasUsers,
s = e.showFullscreenPromo,
a = e.isEditButtonHidden,
c = e.isEditing,
l = e.onClickEdit,
u = e.onClickPopularity,
d = e.onClickNotifications,
p = [{
type: _t.tg.POPULARITY,
level: o,
onClick: u
}, {
type: _t.Us.NOTIFICATION,
onClick: d,
dataQA: {
"data-qa": "activity-inbox"
}
}];
return s || a || !r || null == p || p.unshift({
type: _t.df.BUTTON,
text: c ? h.ZP.get(438) : h.ZP.get(439),
onClick: l
}), (0, f.jsx)(_t.ZP, {
actions: p,
title: {
text: t,
variant: "primary"
},
subTitle: n,
isBalanced: !1
})
},
jt = n(2818),
Pt = n(57376),
kt = n(97481),
Zt = n(31060),
Et = n(12666),
Ot = n(99565),
Tt = n(76812),
It = n(5229),
wt = n(68938);
function At(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function Nt(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? At(Object(n), !0).forEach((function(t) {
Rt(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : At(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function Rt(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
!function(e) {
e[e.CONTROL = 0] = "CONTROL",
e[e.STORIES = 1] = "STORIES"
}(yt || (yt = {}));
var Mt = "sm",
Lt = 70,
Ut = function(e) {
var t = e.pictures;
return (0, f.jsx)("div", {
className: "match-bar-banner-likes-container",
children: (0, f.jsx)("div", {
className: "match-bar-banner-likes",
"data-qa": "match-bar-likes",
children: null == t ? void 0 : t.map((function(e, t) {
var n = {
width: 0,
transition: "width 300ms ease-in-out 0s"
},
i = {
entered: {
width: Lt
}
};
return (0, f.jsx)(Et.ZP, {
appear: !0,
in: !0,
timeout: 300,
children: function(t) {
return (0, f.jsx)("div", {
"data-qa": "match-bar-banner-likes__item",
className: "match-bar-banner-likes__item",
style: Nt(Nt({}, n), i[t]),
children: (0, f.jsx)("img", {
src: w.Z.getImageUrlForSize(e.src, Lt),
alt: "",
width: Lt,
height: Lt
})
})
}
}, "match-bar-likes-item-" + (e.index || t))
}))
})
})
},
Dt = function(e) {
var t,
n,
i,
o,
r = e.pictures,
s = e.message,
a = e.text,
c = e.mode,
l = e.showIcon,
u = e.onClick;
return r && !l && (t = (0, f.jsx)(Ut, {
pictures: r
}), n = a ? {
mark: {
icon: "generic-heart",
text: a,
styling: "liked-you"
}
} : void 0, i = {
position: "outside",
color: "liked-you"
}), r && !l || (o = {
name: "badge-feature-liked-you"
}), (0, f.jsxs)(Tt.Z, {
dataQA: {
"data-qa": "match-bar-banner"
},
children: [(0, f.jsx)(It.Z, {
children: (0, f.jsx)(Ee.Z, {
size: Mt,
icon: o,
content: t,
badge: n,
halo: i,
onClick: u,
a11y: {
actionLabel: a ? h.ZP.get(610, {
num: Number(a) || 0
}) : void 0
}
})
}), c === yt.CONTROL ? (0, f.jsx)(wt.Z, {
children: (0, f.jsx)("div", {
style: {
width: Lt
},
children: (0, f.jsx)(Re.P3, {
color: "black",
ellipsis: !0,
children: s
})
})
}) : null]
})
},
Bt = function(e) {
var t = e.name,
n = e.photo,
i = e.gender,
o = e.isCrush,
r = e.isNew,
s = e.mode,
a = e.onClick,
c = e.onView,
l = e.index,
u = {
gender: i
};
n && (u.photo = {
src: w.Z.getImageUrlForSize(n, Lt)
});
var d = {};
return r && (s === yt.CONTROL ? d.overlay = {
children: (0, f.jsx)(Ge, {
children: (0, f.jsx)("div", {
className: "match-bar-dot-counter-notification"
})
})
} : d.halo = {
position: "inside",
color: "primary"
}), (0, f.jsx)(ft.Z, {
onIntersect: c ? c(!!r, !!o, l) : function() {},
children: (0, f.jsxs)(Tt.Z, {
dataQA: {
"data-qa": "match-bar-user"
},
children: [(0, f.jsx)(It.Z, {
children: (0, f.jsx)(Ee.Z, Nt({
size: Mt,
user: u,
onClick: a
}, d))
}), s === yt.CONTROL ? (0, f.jsx)(wt.Z, {
children: (0, f.jsx)("div", {
style: {
width: Lt
},
children: (0, f.jsx)(Re.P3, {
color: "black",
ellipsis: !0,
children: t
})
})
}) : null]
})
})
},
Ft = function(e) {
var t = e.mode;
return (0, f.jsxs)(Tt.Z, {
children: [(0, f.jsx)(It.Z, {
children: (0, f.jsx)(Ee.Z, {
size: Mt,
content: (0, f.jsx)("div", {
className: "match-bar-placeholder"
})
})
}), t === yt.CONTROL ? (0, f.jsx)(wt.Z, {
children: (0, f.jsx)(Re.P3, {
color: "black",
children: ""
})
}) : null]
})
},
Gt = function(e) {
var t = e.title,
n = void 0 === t ? "" : t,
o = e.banner,
r = e.users,
s = e.mode,
a = void 0 === s ? yt.CONTROL : s,
c = e.isEmpty,
l = e.isSkeleton,
u = e.onScroll,
d = e.onItemViewed;
return c ? (0, f.jsxs)(j.Z, {
top: "md",
bottom: "md",
children: [(0, f.jsx)(j.Z, {
bottom: "lg",
right: "gap",
left: "gap",
children: (0, f.jsx)(Re.kY, {
color: "black",
children: n
})
}), (0, f.jsxs)(Ot.Z, {
spacing: "xlg",
hpadded: !0,
vpadded: !0,
children: [(0, f.jsx)(Dt, Nt(Nt({}, o), {}, {
showIcon: !0,
mode: a
})), [].concat(new Array(3)).map((function(e, t) {
return (0, f.jsx)(Ft, {
mode: a
}, "match-bar-placeholder-" + t)
}))]
})]
}) : l ? (0, f.jsxs)(j.Z, {
top: "md",
bottom: "md",
children: [(0, f.jsx)(j.Z, {
bottom: "lg",
right: "gap",
left: "gap",
children: (0, f.jsx)(Re.kY, {
color: "black",
children: n
})
}), (0, f.jsx)(Ot.Z, {
spacing: "xlg",
hpadded: !0,
vpadded: !0,
children: [].concat(new Array(4)).map((function(e, t) {
return (0, f.jsx)(Ft, {
mode: a
}, "match-bar-placeholder-" + t)
}))
})]
}) : (0, f.jsxs)(j.Z, {
top: "md",
bottom: "md",
children: [(0, f.jsx)(j.Z, {
bottom: "lg",
right: "gap",
left: "gap",
children: (0, f.jsx)(Re.kY, {
color: "black",
children: n
})
}), (0, f.jsxs)(Ot.Z, {
spacing: "xlg",
hpadded: !0,
vpadded: !0,
onScroll: u,
children: [(0, f.jsx)(Dt, Nt(Nt({}, o), {}, {
mode: a
})), null == r ? void 0 : r.map((function(e, t) {
return (0, i.createElement)(Bt, Nt(Nt({}, e), {}, {
mode: a,
onView: d,
index: t,
key: "match-bar-user-" + t
}))
}))]
})]
})
},
Vt = n(49941);
function qt(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function Ht(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? qt(Object(n), !0).forEach((function(t) {
Yt(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : qt(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function Yt(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
var Qt = je.Z.getLogger("MatchBarContainer");
function Wt() {
(0, ee.L9)(195, {
element: 1252,
direction: 6
})
}
var zt,
Kt,
Jt,
Xt = function(e) {
var t = e.hasMatchBarStories,
n = (0, i.useState)(!0),
o = n[0],
r = n[1],
c = (0, i.useState)([]),
l = c[0],
u = c[1],
d = (0, i.useState)(),
p = d[0],
m = d[1],
g = (0, i.useState)(0),
v = g[0],
b = g[1],
y = (0, i.useRef)(l),
x = (0, i.useRef)(v),
S = (0, i.useRef)(),
_ = (0, i.useRef)(null),
C = (0, i.useRef)(""),
j = (0, i.useRef)(!0),
P = (0, i.useRef)(!1),
k = (0, i.useRef)(!1),
Z = (0, i.useRef)(!1),
O = (0, i.useCallback)((function(e) {
var t = {};
return (y.current || []).forEach((function(e) {
t[e.getUserId()] = e
})), e.forEach((function(e) {
var n = e.getUserId();
e.getIsRemoved() ? delete t[n] : t[n] = e
})), Object.keys(t).map((function(e) {
return t[e]
}))
}), [y]),
I = (0, i.useCallback)((function() {
var e = {
clientSource: 127,
sectionRequests: [Ht({
type: 1
}, C && {
pageToken: C.current
})],
folderId: 49,
userFieldFilter: (new Vt.Cxj).setProjection([280, 200, 583, 580, 340, 230, 810, 830]),
preferredCount: 50,
direction: 1
};
return _.current = (0, kt.Z)(U.Z.getInstance().fetch(e, !0, !0)), _.current.then((function(e) {
var n = e[0];
if (!n)
return Qt.error("Server returned no data for match bar"), [null, null];
var i = function(e) {
var t = ((null == e ? void 0 : e.getSection()) || [])[0];
return j.current = null == t ? void 0 : t.getLastBlock(), {
users: (null == t ? void 0 : t.getUsers()) || [],
pageToken: (null == t ? void 0 : t.getPageToken()) || ""
}
}(n),
o = function(e) {
var t = (null == e ? void 0 : e.getPromoBanners()) || [];
if (!t.length)
return;
var n = t[0],
i = n.getPromoBlockType(),
o = n.getPromoBlockPosition(),
r = n.getContext(),
s = n.getMssg();
return 129 === i ? {
type: i,
message: s,
pictures: n.getPictures().map((function(e) {
return e.getDisplayImages()
})),
variation: n.getStatsVariationId(),
text: n.getExtraTexts()[0].getText(),
position: o,
context: r
} : 326 === i ? {
type: i,
position: o,
context: r,
message: s
} : void 0
}(n),
r = i.users;
return null != C && C.current && (r = O(i.users)), r = t ? r.sort((function(e, t) {
var n = e.getSortTimestamp() + (e.getIsUnread() ? 1e8 : 0);
return t.getSortTimestamp() + (t.getIsUnread() ? 1e8 : 0) - n
})) : r.sort((function(e, t) {
return t.getSortTimestamp() - e.getSortTimestamp()
})), u(r), o && m(o), C.current = i.pageToken, j.current || I(), [r, o]
})).catch((function(e) {
return (0, Zt.Z)(e) && Qt.error("Error requesting match bar folder", {
error: e
}), [null, null]
}))
}), [C, O, j, t]);
(0, i.useEffect)((function() {
y.current = l
}), [l]),
(0, i.useEffect)((function() {
var e;
p && ((0, ee.L9)(333, {
element: 1253,
count: (null == p || null == (e = p.pictures) ? void 0 : e.length) || 0
}), (0, ee.L9)(138, {
banner_id: p.type,
position_id: p.position,
context: p.context,
variation_id: p.variation
}))
}), [p]),
(0, i.useEffect)((function() {
var e = _.current;
return function() {
return null == e ? void 0 : e.cancel()
}
}), []),
(0, i.useEffect)((function() {
var e = function() {
r(jt.Z.getSync(268).enabled)
},
t = function(e) {
var t;
21 === e.id && null != (t = e.folders) && t.includes(49) && I()
},
n = function(e) {
49 === e.folder && I()
},
i = function(e) {
var t = e.from_person_id,
n = e.to_person_id;
if (l.length) {
var i = l.findIndex((function(e) {
return [t, n].includes(e.getUserId())
}));
i > -1 && u([].concat(l.slice(0, i), l.slice(i + 1)))
}
};
return jt.Z.on(jt.Z.EVENTS.UPDATE, e), Pt.NT.onResponse(361, t), Pt.NT.onResponse(138, n), Pt.NT.onResponse(105, i), o && I().then((function(e) {
var t,
n;
e && (e[1] && 129 === e[1].type && e[1].pictures && (n = e[1].pictures.length, S.current = a.Z.setInterval((function() {
10 === x.current || n - 1 === x.current ? a.Z.clearInterval(S.current) : (x.current = x.current + 1, b(x.current))
}), 3e3)), (0, ee.L9)(258, {
element: 1252,
count: (null == (t = e[0]) ? void 0 : t.length) || 0
}))
})), function() {
jt.Z.off(jt.Z.EVENTS.UPDATE, e),
Pt.NT.offResponse(361, t),
Pt.NT.offResponse(138, n),
Pt.NT.offResponse(105, i),
S.current && a.Z.clearInterval(S.current)
}
}), [o]);
var w = function() {
p && (E.Z.navigate(T.x.LIKED_YOU, !1, {
activationPlace: 401
}), (0, ee.L9)(139, {
banner_id: p.type,
position_id: p.position,
context: p.context,
variation_id: p.variation
}))
},
A = function(e, n) {
return function() {
if (function(e, t) {
var n;
n = e.getIsMatch() ? e.getIsUnread() ? 1255 : 1254 : 1256;
(0, ee.L9)(332, {
element: n,
parent_element: 1252,
position: t
})
}(e, n), t) {
var i = l.map((function(e) {
return e.getUserId()
}));
E.Z.navigate(T.x.MATCH_STORIES, {
matchId: e.getUserId(),
matchIds: i
})
} else
E.Z.navigate(T.x.MESSAGES, {
id: e.getUserId(),
userInitiated: !0,
folderId: 49,
context: 127,
activationPlace: 401
})
}
},
N = (0, i.useCallback)((function(e, t, n) {
return function() {
var i = 1254;
P.current && k.current && Z.current || (t ? (i = 1256, Z.current = !0) : e ? (i = 1255, k.current = !0) : P.current = !0, (0, ee.L9)(258, {
element: i,
position: n
}))
}
}), [P, k, Z]),
R = (0, i.useCallback)((function() {
if (l.length) {
var e = l.filter((function(e) {
return !e.getIsCrush()
})),
t = e.filter((function(e) {
return e.getIsUnread()
}));
return t.length ? h.ZP.get(616, {
num: t.length
}) : h.ZP.get(615, {
num: e.length
})
}
return h.ZP.get(617)
}), [l]);
return o ? (0, f.jsx)("div", {
"data-qa": "match-bar",
children: (0, f.jsx)(Gt, Ht(Ht({
title: R()
}, p ? 129 === p.type ? {
banner: {
pictures: p.pictures ? p.pictures.slice(0, v + 1).map((function(e, t) {
return {
src: e,
index: t
}
})) : void 0,
message: p.message || "",
text: p.text || 0,
onClick: w
}
} : {
banner: {
message: p.message || "",
onClick: w
},
isEmpty: !l.length
} : null), {}, {
users: l.length ? l.map((function(e, t) {
var n;
return {
id: e.getUserId(),
name: e.getName(),
photo: null == (n = e.getProfilePhoto()) ? void 0 : n.getLargeUrl(),
gender: (0, qe.gp)(e.getGender()),
isCrush: e.getIsCrush(),
isNew: e.getIsUnread(),
onClick: A(e, t)
}
})) : void 0,
mode: t ? yt.STORIES : yt.CONTROL,
isSkeleton: !l.length && !p,
onScroll: (0, s.Z)(Wt, 300),
onItemViewed: l.length ? N : void 0
}))
}) : null
},
$t = n(29697),
en = function(e) {
var t = e.isActive,
n = e.onClick,
o = (0, i.useRef)(null),
r = (0, i.useState)({}),
s = r[0],
a = r[1];
return (0, f.jsx)($t.Z, {
in: t,
timeout: 300,
mountOnEnter: !0,
unmountOnExit: !0,
onEntering: function() {
o.current && a({
width: o.current.offsetWidth,
height: o.current.offsetHeight
})
},
children: function(e) {
var t = d()({
"floating-action": !0,
"js-connections-actions-edit": !0,
"is-inactive": "entered" !== e
});
return (0, f.jsxs)(i.Fragment, {
children: [(0, f.jsx)("div", {
className: t,
ref: o,
children: (0, f.jsx)("div", {
className: "floating-action__button",
children: (0, f.jsx)(me.Z, {
text: h.ZP.get(472),
onClick: n,
dataQA: {
"data-qa": "connections-button-remove"
}
})
})
}), (0, f.jsx)("div", {
className: "fake",
style: s
})]
})
}
})
},
tn = n(21483),
nn = n(28480),
on = function(e) {
var t = e.header,
n = e.text,
i = e.onReport,
o = e.onDelete,
r = e.onCancel;
return (0, f.jsxs)(tn.Z, {
wrapperType: tn.N.ACTION_SHEET,
header: {
title: t,
text: n
},
onDismiss: r,
children: [(0, f.jsx)(nn.Z, {
text: h.ZP.get(131),
type: "destructive",
onClick: i
}), (0, f.jsx)(nn.Z, {
text: h.ZP.get(140),
onClick: o
})]
})
},
rn = ((Jt = {})[Ve.ph.ALL_MESSAGES] = ((zt = {})[Ve.xL.RECENT] = 1388, zt[Ve.xL.UNREAD] = 224, zt[Ve.xL.CHAT_REQUEST] = 1385, zt[Ve.xL.ONLINE] = 406, zt[Ve.xL.MY_FAVOURITES] = 1390, zt), Jt[Ve.ph.ACTIVITY] = ((Kt = {})[Ve.xL.RECENT] = 1389, Kt[Ve.xL.UNREAD] = 224, Kt[Ve.xL.MATCH] = 354, Kt[Ve.xL.VISIT] = 6, Kt[Ve.xL.FAVOURITED_YOU] = 9, Kt[Ve.xL.MY_FAVOURITES] = 1391, Kt), Jt);
function sn() {
(0, ee.L9)(258, {
element: 1386
})
}
var an = function(e) {
var t = e.text,
n = e.onClick;
return (0, f.jsxs)("button", {
className: "connections-sort-options",
onClick: n,
"data-qa": "connections-sort-options-button",
children: [(0, f.jsx)("span", {
className: "connections-sort-options__icon",
children: (0, f.jsx)(fe.Z, {
name: "generic-filter",
size: "md",
color: "black"
})
}), (0, f.jsx)("span", {
className: "connections-sort-options__text",
children: (0, f.jsx)(Re.aU, {
tag: "span",
children: t
})
})]
})
},
cn = function(e) {
var t = e.currentTab,
n = e.currentSortOption,
i = e.onClick;
return (0, f.jsx)(an, {
text: n.name,
onClick: function() {
var e,
o;
i(),
e = t.type,
o = n.variant,
(0, ee.L9)(332, {
element: 1132,
parent_element: rn[e][o]
})
}
})
},
ln = n(59380),
un = function(e) {
var t = e.options;
return (0, f.jsx)(ln.Z, {
options: t
})
},
dn = function(e) {
var t = e.currentTab,
n = e.onSelectOption,
o = e.hideSortOptions,
r = (0, i.useState)(!0),
s = r[0],
a = r[1],
c = function(e) {
n(e),
function(e, t) {
(0, ee.L9)(332, {
element: rn[e][t],
parent_element: 1386
})
}(t.type, e),
setTimeout((function() {
a(!1)
}), 300)
},
l = t.sortOptions.map((function(e) {
return {
label: e.name,
name: e.variant,
value: e.id.toString(),
isChecked: e.isCurrent,
onChange: function() {
return c(e.variant)
},
onClick: function() {
return t = e.isCurrent, void a(!t);
var t
},
dataQA: {
"data-qa-connections-sort-option": e.variant.toString()
}
}
}));
return (0, f.jsx)(tn.Z, {
isVisible: s,
onAnimationInComplete: sn,
onAnimationOutComplete: o,
isPadded: !0,
children: (0, f.jsx)(un, {
options: l
})
})
},
pn = n(38819),
hn = n(46813),
mn = n(32211),
fn = n(90976),
gn = n(68068),
vn = n(85761),
bn = n(12137),
yn = n(75727),
xn = n(87019),
Sn = n(45318),
_n = n(74837),
Cn = n(27181),
jn = n(73701),
Pn = n(55703),
kn = n(98889),
Zn = n(44991),
En = n(39467),
On = (0, n(36004).yM)(),
Tn = {
update: function(e, t) {
On.trigger(e, t)
},
subscribe: On.subscribe,
unsubscribe: On.unsubscribe
},
In = n(21585),
wn = n(77847),
An = n(92307),
Nn = n(77208),
Rn = n(40053),
Mn = n(34855),
Ln = n(98222),
Un = n(6120),
Dn = n(5971),
Bn = n(73935),
Fn = n(33696),
Gn = n(365),
Vn = function(e) {
var t = e.connectionsList,
n = e.emptyPromo,
o = e.matchBar,
r = e.sortOptionsButton,
s = e.deleteButton,
a = e.hasUsers,
c = e.hasMatchBarStories,
l = e.showFullscreenPromo,
u = e.isLoading,
p = e.isEditButtonHidden,
m = e.isEditing,
g = e.onBackClick,
v = e.onEditButtonClick,
b = (0, i.useState)(!0),
y = b[0],
k = b[1],
Z = [{
type: _t.Us.BACK,
onClick: function() {
k(!1)
}
}];
l || p || !a || null == Z || Z.unshift({
type: _t.df.BUTTON,
text: m ? h.ZP.get(438) : h.ZP.get(439),
onClick: v
});
var E = !a && n;
return (0, f.jsx)(Gn.Z, {
children: (0, f.jsx)($t.Z, {
appear: !0,
in: y,
timeout: 300,
classNames: y ? "forward" : "backward",
mountOnEnter: !0,
unmountOnExit: !0,
onExited: function() {
g()
},
children: function() {
return (0, f.jsx)("div", {
className: "page-container",
id: "activity-inbox",
children: (0, f.jsx)("div", {
className: "page",
children: (0, f.jsxs)(S.Z, {
children: [(0, f.jsxs)(C.Z, {
children: [(0, f.jsx)(_t.ZP, {
actions: Z,
title: h.ZP.get(142),
position: "sticky",
hasShadow: !0
}), l ? null : (0, f.jsxs)("div", {
className: d()("connections__match-bar", {
"connections__match-bar--stories": c
}),
inert: m ? "" : void 0,
children: [o, m ? (0, f.jsx)(P, {}) : null]
})]
}), (0, f.jsxs)(_.Z, {
align: "stretch",
children: [n && E ? (0, f.jsx)("div", {
className: "connections-empty-container",
"data-qa": "connections-empty",
children: (0, f.jsxs)("div", {
style: {
margin: "auto 0"
},
children: [(0, f.jsx)(j.Z, {
top: "md",
right: "gap",
bottom: "md",
left: "gap",
children: n
}), (0, f.jsx)("div", {
className: "connections-gap"
})]
})
}) : null, u ? (0, f.jsx)("div", {
className: "connections__loader",
children: (0, f.jsx)("div", {
style: {
width: 46,
height: 46
},
children: (0, f.jsx)(x.Z, {})
})
}) : null, E ? null : (0, f.jsxs)("div", {
className: "connections__content",
children: [r, (0, f.jsx)("div", {
className: "connections__items",
children: (0, f.jsx)("div", {
className: "connections-items",
children: t
})
}), (0, f.jsx)("div", {
className: "connections-gap"
})]
}), s]
})]
})
})
})
}
})
})
},
qn = ["isVisible"];
function Hn(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function Yn(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
var Qn,
Wn,
zn,
Kn,
Jn = function(e) {
var t = (0, i.useContext)(Fn.ZP).appRef,
n = null == t ? void 0 : t.current,
o = e.isVisible,
r = function(e, t) {
if (null == e)
return {};
var n,
i,
o = {},
r = Object.keys(e);
for (i = 0; i < r.length; i++)
n = r[i],
t.indexOf(n) >= 0 || (o[n] = e[n]);
return o
}(e, qn);
return (0, i.useEffect)((function() {
var e = a.Z.document.getElementById("page-container");
o ? setTimeout((function() {
(0, p.Z)(e).hide()
}), 300) : (0, p.Z)(e).show()
}), [o]), n && o ? Bn.createPortal((0, f.jsx)(Vn, function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? Hn(Object(n), !0).forEach((function(t) {
Yn(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Hn(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}({}, r)), n) : null
},
Xn = n(73541),
$n = n(12470),
ei = n(80031);
function ti(e, t) {
(0, ee.L9)(332, {
element: e,
parent_element: t
})
}
function ni(e) {
(0, ee.L9)(258, {
element: e
})
}
function ii(e, t) {
(0, ee.L9)(139, {
banner_id: e.promo_block_type,
position_id: e.promo_block_position,
context: 127,
call_to_action_type: t
})
}
function oi(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function ri(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? oi(Object(n), !0).forEach((function(t) {
si(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : oi(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function si(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
function ai(e) {
if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}
function ci(e, t) {
return ci = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, ci(e, t)
}
var li = {
clientSource: 127,
preferredCount: 36,
userFieldFilter: (new Vt.Cxj).setProjection([200, 230, 700, 340, 650, 640, 280, 583, 580, 250, 610, 560, 611, 759, 630, 270, 330, 871, 920, 820, 830, 1120, 1423, 1436, 643, 1435, 1434])
},
ui = [U.Z.TYPES.VISITORS, U.Z.TYPES.MESSAGES, U.Z.TYPES.WANT_TO_MEET_YOU, U.Z.TYPES.FAVOURITES],
di = ((Qn = {})[8] = 187, Qn[6] = 188, Qn[4] = 190, Qn[0] = 189, Qn),
pi = ((Wn = {})[31] = 245, Wn[4] = 249, Wn[8] = 247, Wn[6] = 248, Wn[0] = 246, Wn),
hi = [57, 1, 10, 56],
mi = ((zn = {})[12] = 68, zn[61] = 57, zn[66] = 56, zn[88] = 63, zn[8] = 130, zn),
fi = ((Kn = {})[U.Z.TYPES.MESSAGES] = 26, Kn[U.Z.TYPES.FAVOURITES] = 23, Kn[U.Z.TYPES.WANT_TO_MEET_YOU] = 3, Kn[U.Z.TYPES.VISITORS] = 22, Kn),
gi = [1, 2],
vi = 0,
bi = [],
yi = {},
xi = function(e) {
var t,
n;
function c(t) {
var n;
(n = e.call(this, t) || this).activationPlace = 191,
n.screenName = 243,
n.clientSource = 127,
n.containerRef = void 0,
n.modalRef = void 0,
n.timeoutId = void 0,
n.modally = void 0,
n.screenRef = void 0,
n.log = je.Z.getLogger("ConnectionsPage"),
n.resetCount = (0, o.Z)(ji, 1e4),
n.previousFilter = void 0,
n.selectedFilter = Ve.jr.ALL,
n.readItems = [],
n.hasSpp = !1,
n.hasPhoto = null,
n.hasMatchBar = null,
n.hasMatchBarStories = !1,
n.isLoading = !1,
n.isStarted = !1,
n.isFinished = !1,
n.mostRecentSortTimestamp = void 0,
n.forceFetch = !1,
n.visibleUserIds = {},
n.userIds = {},
n.usersToRemove = [],
n.userSubstitutes = {},
n.folderSyncActive = !1,
n.lastBlock = !1,
n.pageToken = null,
n.syncToken = null,
n.savedRemoveUserIds = [],
n.banners = void 0,
n.deletingUserGender = void 0,
n.deletingIds = [],
n.handleAdsEnabledChange = function() {
O.Z.isLoggedIn() && n.fetchFolder()
},
n.handleItem = function(e) {
(0, l.NU)(e) && n.handleUserItem(e),
(0, l.$Y)(e) && n.handlePromoBlockItem(e)
},
n.handleNavigation = function(e) {
if (n.isStarted) {
var t = n.props.saveScrollPosition;
t && !e.backInHistory && t()
}
},
n.handlePromoButtonClick = function(e, t) {
var i = n.getSelectedFilter();
n.trackBlockingScreenClick(e, t || 0, null == i ? void 0 : i.folderType),
n.applyServerActionHelper(e, t || 0)
},
n.handleDismissModally = function() {
var e;
n.enableFolderSync(),
null == (e = n.modally) || e.unmount(),
n.setState({
isEditing: !1
})
},
n.turnDeleteModeOff = function() {
var e;
null == (e = n.modally) || e.unmount()
},
n.handleEditModeToggle = function(e, t) {
var i;
null == (i = n.modally) || i.update({
onDismiss: n.handleDismissModally,
contentWrapper: n.modalRef.current
});
var o = n.state.isEditing;
if (o ? (l.ZP.getItems().forEach((function(e) {
Object.prototype.hasOwnProperty.call(e, "isChecked") && delete e.isChecked
})), n.enableFolderSync()) : n.disableFolderSync(), n.setState({
isEditing: !e && !o
}, t), o || e)
a.Z.clearTimeout(n.timeoutId),
n.turnDeleteModeOff();
else {
var r,
s;
null == (r = n.modally) || r.modalize(),
null == (s = n.modally) || s.focusWrapper();
var c = ai(n);
n.timeoutId = a.Z.setTimeout((function() {
var e,
t;
null == (e = c.modally) || e.updateFocusableElements(c.modalRef.current),
null == (t = c.modally) || t.toggleFocusTrap(!0)
}), 500)
}
},
n.handleDelete = function() {
n.setState({
isShowingDeleteModal: !1
}),
a.Z.setTimeout((function() {
n.onRemoveUsers(n.deletingIds),
n.turnDeleteModeOff()
}), 500)
},
n.handleClickDelete = function() {
var e = Ln.Z.isActive();
n.deletingIds = [],
l.ZP.getItems().forEach((function(e) {
e.isChecked && (n.deletingIds.push(e.object.user_id), n.deletingUserGender = (0, h.Ro)(e.object.gender))
})),
Ln.Z.hit(),
e && n.deletingIds.length > 1 && l.ZP.getItems().forEach((function(e) {
Object.prototype.hasOwnProperty.call(e, "isChecked") && (e.isDeleting = !0)
})),
e && 1 === n.deletingIds.length ? (ni(649), n.setState({
isShowingDeleteModal: !0
})) : n.handleDelete()
},
n.handleClickPopularity = function() {
n.handleEditModeToggle(!0, (function() {
ti(63),
E.Z.navigate(T.x.POPULARITY)
}))
},
n.handleClickNewActivityButton = function() {
n.unfreeze(),
n.fetchFolder(),
(0, ee.L9)(332, {
element: pi[n.getSelectedFilter().folderType]
})
},
n.handleItemVisible = function(e) {
var t = e.origin_folder;
n.visibleUserIds[t] || (n.visibleUserIds[t] = []),
-1 === n.visibleUserIds[t].indexOf(e.user_id) && n.visibleUserIds[t].push(e.user_id),
n.readItems.push(e)
},
n.handleBannerVisible = function(e) {
!function(e) {
if (e) {
var t = e.promo_block_type,
n = e.promo_block_position,
i = function(e) {
var t = e.promo_block_type,
n = e.context;
return n || 21 !== t || (n = 127), n
}(e);
t && (0, ee.L9)(138, {
banner_id: t,
position_id: n,
context: i
})
}
}(e.getPromoBlock ? e.getPromoBlock() : e)
},
n.handleSuperPowersEnabledChange = function(e) {
n.hasSpp = e,
n.fetchFolder()
},
n.handleUserItem = function(e) {
var t = e.user_id,
i = n.userSubstitutes[t];
if (i) {
var o;
if (function(e) {
if (!e)
return;
(0, ee.L9)(139, ri(ri({}, e.hotpanelData), {}, {
context: 127
}))
}(i.connectionPromoCard), null != (o = i.connectionPromoCard) && o.showOnTap)
return void E.Z.navigate(T.x.PROMO_CARDS_GALLERY, {
userSubstitute: i,
context: 26
})
} else {
var r = 4 === e.connection_status_indicator;
(0, ee.L9)(197, {
activation_place: n.getActivationPlace_(),
encrypted_user_id: t,
is_chat_request: r,
has_mood_status: Boolean(e.mood_status),
has_read_receipt: Boolean(1 === e.last_message_status || 2 === e.last_message_status)
})
}
if (e.is_invisible)
E.Z.navigate(T.x.INVISIBLE_EXPLANATION, {
promoBlock: n.banners.getInvisiblePromo(),
activationPlace: 106
});
else if (e.profile_blocker_promo) {
var s = e.profile_blocker_promo;
120 === s.ok_action ? n.revealUser(e) : n.applyServerActionHelper(s)
} else
n.chatWithUser(e)
},
n.handlePromoBlockItem = function(e) {
!function(e, t) {
var n = function(e) {
switch (e.promo_block_type) {
case 131:
return 10;
case 129:
return 100;
case 130:
return 101;
case 165:
return 14
}
return null
}(e);
n && (0, ee.L9)(332, {
element: n,
parent_element: t || 97
})
}(e, n.getElementType());
var t = function(e) {
var t = e.buttons || [];
return (t[0] || {}).type || 1
}(e);
ii(e, t);
var i = e.promo_block_type,
o = e.promo_block_position,
r = e.stats_variation_id,
s = 326 === i && 1 === o,
a = 346 === i && 1 === o;
if (129 === i && 1 === o && 2 === r)
E.Z.navigate(T.x.LIKED_YOU);
else if (s)
wn.Z.getInstance().getProductExplanation({
productType: e.ok_payment_product_type,
userId: O.Z.getUserId(),
clientSource: n.clientSource,
promoBlockType: i
}).then((function(e) {
E.Z.navigate(T.x.GET_MORE_LIKES, {
promoBlock: e.promo,
resolve: function() {
return n.fetchFolder({
preventLoading: !0
})
}
})
})).catch((function(e) {
e && (0, Zt.Z)(e) && n.log.error("Error retrieving product explanation in connections", {
error: e
})
}));
else {
if (a) {
var c = {
variantId: e.variant_id,
event: 2,
context: 127,
promoBlockPosition: o
};
return R.Z.sendProfileQuestionsBannerStats(c), void E.Z.navigate(T.x.PROFILE_QUESTIONS, {
redirectTo: T.x.OWN_PROFILE_EDIT,
preloadQuestions: !0
})
}
if (e.redirect_page) {
var l = e.redirect_page.redirect_page,
u = Number(Object.keys(fi).find((function(e) {
return fi[Number(e)] === l
}))),
d = Ve.Oq.findIndex((function(e) {
return e.folderType === u
}));
-1 !== d && (n.setFilter(Ve.Oq[d].param), n.fetchFolder())
}
n.applyServerActionHelper(e)
}
},
n.handleSelectTab = function(e) {
n.handleEditModeToggle(!0, (function() {
e === Ve.ph.ALL_MESSAGES ? Mn.Z.show() : Mn.Z.hide(),
n.setCurrentTab(e)
}))
},
n.setIsShowingSecurityWalkthrough = function(e) {
n.setState({
isShowingSecurityWalkthroughModal: e
})
},
n.onAdsEnabledChange = function() {
O.Z.isLoggedIn() && n.fetchFolder()
},
n.onBackOnline = function(e) {
n.resendStoredRequests(),
n.folderSyncActive && e && e.then(n.fetchFolderUpdates.bind(ai(n)))
},
n.onBadgeChanged = function(e) {
var t = Ci([e]);
if (n.state.emptyPromo.length && n.fetchFolder({
preventLoading: !0
}), t) {
var i,
o = (null == (i = n.state.badgeUpdates) ? void 0 : i.map((function(e) {
return t.find((function(t) {
return t.folder === e.folder
})) || e
}))) || [];
t.forEach((function(e) {
null != o && o.find((function(t) {
return t.folder === e.folder
})) || o.push(e)
})),
n.setState({
badgeUpdates: o
})
}
},
n.onBadgeInvalidated = function() {
vn.Z.fetch()
},
n.onPushChatMessage = function(e) {
var t = (0, Nn.Z)(e, Vt.JaH),
i = t.getFromUser(),
o = new pn.ZP(t),
r = !o.isRead;
n.onChatMessage({
chatUser: i,
userId: o.fromPersonId,
id: o.id,
displayMessage: o.displayMessage,
increaseUnreadMessages: r,
showYourMoveBadge: o.isRead
})
},
n.onChatMessageFromMe = function(e) {
n.onChatMessage({
userId: String(e.toPersonId),
id: e.id,
displayMessage: e.displayMessage,
increaseUnreadMessages: !1,
showYourMoveBadge: !1
})
},
n.onChatMessage = function(e) {
var t = e.userId,
i = e.id,
o = e.displayMessage,
r = e.increaseUnreadMessages,
s = e.chatUser,
a = e.showYourMoveBadge;
if (l.ZP.updateYourMoveBadge(t, a), s && (a ? s.setConnectionStatusIndicator(2) : s.setConnectionStatusIndicator(0)), l.ZP.findIndex(t) > -1)
n.updateUser(r, t, o);
else {
if (i) {
if (bi.includes(i))
return;
bi.push(i)
}
n.tryFreezeOrUpdate([0, 41])
}
},
n.onPersonNotice = function(e) {
var t = e.folder,
i = e.int_value;
1 === e.type && void 0 !== t && -1 !== ui.indexOf(t) && (void 0 === yi[t] && (yi[t] = 0), void 0 !== i && (yi[t] < i && n.tryFreezeOrUpdate([t]), yi[t] = i))
},
n.onNewMessageRead = function(e, t) {
if (e !== O.Z.getUserId()) {
var i = t.isRead ? "" : t.displayMessage;
n.onChatMessage({
userId: e,
id: t.id,
displayMessage: i,
increaseUnreadMessages: !1,
showYourMoveBadge: Boolean(t.isRead)
})
}
},
n.handleFavouriteItem = function(e) {
var t = l.ZP.findIndex(e),
i = n.isRemoveFromFolderAction(e);
En.Z.toggleFavouriteStatus(e, (function() {
i && n.removeUser(e.user_id)
})),
(0, ee.L9)(123, {
action_type: e.is_favourite ? 6 : 7,
activation_place: n.getActivationPlace_(),
encrypted_user_id: e.user_id
}),
(0, ee.L9)(332, {
element: e.is_favourite ? 85 : 86,
parent_element: n.getElementType(),
position: t
})
},
n.onFavoriteStateChange = function(e, t) {
if (!n.isStarted) {
var i = l.ZP.findIndex(e);
if (-1 !== i)
if (n.getSelectedFilter().folderType !== U.Z.TYPES.FAVOURITES || t)
l.ZP.get(i).object.is_favourite = t,
n.setState({});
else
n.removeUserWhenOpened(e)
}
},
n.onFeatureUpdate = function(e) {
19 === e.feature && n.fetchFolderUpdates()
},
n.onFolderResult = function(e) {
var t = e.previousFilter,
i = e.clientUserList,
o = e.shouldGetNextPage,
r = void 0 !== o && o,
s = e.isUpdates,
c = void 0 !== s && s;
if (n.isStarted) {
if (!n.isFinished && !n.state.isFrozen && t === n.selectedFilter) {
var u = n.getSelectedFilter();
r || c || (n.userIds = {}, (0, ee.L9)(258, {
element: n.getElementType()
}), u && u.folderType === U.Z.TYPES.COMBINED_CONNECTIONS_ALL && function(e) {
var t = e.toJSON().section || [],
n = 0,
i = 0;
t.forEach((function(e) {
(e.users || []).forEach((function(e) {
e.is_removed || 2 !== (e.last_message_status || 0) || n++,
e.is_not_interested && i++
}))
})),
(0, ee.L9)(29, {
num_admirers_unread: _i(6),
num_favourited_you_unread: _i(4),
num_matches_unread: _i(15),
num_visited_you_unread: _i(8),
num_with_read_receipts: n,
num_letdowns: i,
total_unread: _i(0)
})
}(i));
var d = [];
n.banners.process({
items: d,
clientUserList: i,
isUpdates: c
}),
i.getSection([]).forEach((function(e) {
n.addUserSubstitutes_(e.getUserSubstitutes([]));
var t = e.getUsers([]).filter((function(e) {
return !n.userIds[e.getUserId()] && !e.getIsRemoved()
})).map((function(e) {
return e.toJSON()
}));
if (t.sort((function(e, t) {
return t.sort_timestamp - e.sort_timestamp
})), c) {
t = t.filter((function(e) {
return e.sort_timestamp >= n.mostRecentSortTimestamp
}));
var i = e.getUsers([]).filter((function(e) {
return n.userIds[e.getUserId()]
})).map((function(e) {
return e.toJSON()
})),
o = i.filter((function(e) {
return e.is_removed && e.user_id
}));
n.removeUsers(o);
var r = i.filter((function(e) {
return !e.is_removed
}));
l.ZP.getItems().length > 0 && l.ZP.updateUsers(r)
}
t.forEach((function(e) {
n.setTimestamps(e),
n.userIds[e.user_id] = !0
})),
n.banners.processUsers({
items: d,
users: t
}),
c || (n.lastBlock = e.getLastBlock())
})),
c || (n.pageToken = i.getPageToken(), n.syncToken = i.getSyncToken());
var p = i.toJSON().promo_banners,
h = [];
p && !r && (h = p.filter((function(e) {
var t = e.promo_block_position;
return 13 === t || 20 === t
}))),
h && n.setState({
emptyPromo: h
}),
c ? l.ZP.addUpdates(n.banners.prependBanner(d)) : (l.ZP.addPage(d, !r), n.banners.appendBanners()),
n.jinba.stop();
var m = n.props,
f = m.navigatedBack,
g = m.scrollPosition;
n.setState({
isLoading: !1
}, (function() {
var e;
f && g && (0, In.X)(a.Z, g),
null == (e = n.modally) || e.updateFocusableElements(n.modalRef.current)
})),
n.isLoading = !1,
(0, Pn.Z)("Connections interactive", 5)
}
} else
n.isLoading = !1
},
n.onFolderError = function(e) {
n.setState({
isLoading: !1
}),
n.isLoading = !1,
n.isStarted && (e && (0, r.Z)(e.getType) && e.getType() === Rn.Qc.OFFLINE || fn.Z.handleError({
error: e,
screenName: n.getScreenName()
}))
},
n.onNewOfflineMessage = function(e, t) {
var i = l.ZP.findIndex(t.getUserId());
l.ZP.get(i).object.display_message = e,
n.setState({})
},
n.onRemoveUsers = function(e) {
var t,
i;
if (null != e && e.length) {
n.removeUsers(e),
n.setState({
isEditing: !1
});
var o,
r = null == (t = n.getSelectedFilter()) ? void 0 : t.activationPlace;
if (e.forEach((function(e) {
(0, ee.L9)(580, {
encrypted_user_id: e,
activation_place: r,
mode_connection: 6
})
})), !_n.Z.isOnline())
(o = n.savedRemoveUserIds).push.apply(o, e);
var s = n.getCurrentTab().context,
a = [U.Z.getInstance().removeUsers({
activationPlace: r,
folderId: 56,
ids: e,
context: s
})];
(null == (i = n.getSelectedFilter()) ? void 0 : i.folderType) === U.Z.TYPES.FAVOURITES && a.push(U.Z.getInstance().removeUsers({
activationPlace: r,
folderId: 4,
ids: e,
avoidHotpanelTracking: !0,
context: s
})),
Promise.all(a).then(n.updateFolderIfEmpty.bind(ai(n)))
}
},
n.handleSelectItem = function(e, t) {
var i = 99;
(0, l.NU)(e) && (e.is_conversation ? i = 11 : e.is_crush ? i = 18 : e.favourited_you ? i = 9 : e.is_invisible ? i = 93 : 6 === e.origin_folder ? i = 5 : e.is_match ? i = 354 : e.is_visitor ? i = 6 : e.is_favourite && (i = 13)),
W.Z.generate(),
(0, ee.L9)(332, {
element: i,
parent_element: n.getElementType(),
position: t
}),
n.handleItem(e)
},
n.handleTrackScroll = function(e) {
var t = l.ZP.getItems();
(0, ee.L9)(195, {
direction: 5,
element: n.getElementType(),
reached_end: e > t.length - 1,
position: e
})
},
n.handleNeedPage = function() {
n.isLoading || n.lastBlock || n.fetchFolder({
shouldGetNextPage: !0
})
},
n.onSystemNotification = function(e) {
var t = e.id;
21 === t ? n.fetchFolderUpdates() : 25 === t && n.onUserIdExchanged(e.previous_id, e.current_id)
},
n.onUserIdExchanged = function(e, t) {
if (void 0 !== n.userIds[e]) {
n.userIds[t] = n.userIds[e],
delete n.userIds[e];
var i = l.ZP.findIndex(e);
if (-1 === i)
return;
l.ZP.get(i).object.user_id = t,
n.isStarted && n.setState({})
}
},
n.tryFreezeOrUpdate = function(e) {
var t,
i;
0 !== n.getCurrentTab().connectionTypes.filter((function(t) {
return e.includes(t)
})).length && (vi += 1, t = a.Z.innerHeight || (0, xe.Z)().clientHeight, i = (0, xe.Z)().scrollHeight > t, vi > 3 && i ? n.freeze() : n.folderSyncActive && n.fetchFolderUpdates(), n.resetCount())
},
n.freeze = function() {
n.setState({
isFrozen: !0
}),
n.disableFolderSync()
},
n.unfreeze = function() {
n.setState({
isFrozen: !1
}),
n.enableFolderSync()
},
n.handleModalReport = function() {
ti(87, 649),
n.setState({
isReporting: !0,
isShowingDeleteModal: !1
})
},
n.handleModalDelete = function() {
ti(106, 649),
n.handleDelete()
},
n.renderDeleteModal = function() {
return n.state.isShowingDeleteModal ? (0, f.jsx)(on, {
header: h.ZP.get(141),
text: h.ZP.get(363, {
other_user: mn.N5.for("other_user", n.deletingUserGender)
}),
onReport: n.handleModalReport,
onDelete: n.handleModalDelete,
onCancel: function() {
n.setState({
isShowingDeleteModal: !1
})
}
}) : null
},
n.handleReportingSuccess = function() {
n.setState({
isReporting: !1,
isShowingDeleteModal: !1,
isEditing: !1
}),
n.removeUser(n.deletingIds[0])
},
n.handleSelectSortOption = function(e) {
n.setCurrentSortOption(e)
},
n.handleToggleSortOptionsModal = function() {
n.setState({
isShowingSortOptionsModal: !n.state.isShowingSortOptionsModal
})
},
n.renderSortOptionsModal = function() {
return n.state.isShowingSortOptionsModal ? (0, f.jsx)(dn, {
currentTab: n.getCurrentTab(),
onSelectOption: n.handleSelectSortOption,
hideSortOptions: n.handleToggleSortOptionsModal
}) : null
},
n.renderSortOptionsButton = function() {
return (0, f.jsx)(cn, {
currentTab: n.getCurrentTab(),
currentSortOption: n.getCurrentSortOption(),
onClick: n.handleToggleSortOptionsModal
})
},
n.getEmptyPromoFlags = function(e) {
var t = n.getTab(e);
return {
hasUsers: l.ZP.getUsers(t.connectionTypes).length > 0,
showFullscreenPromo: n.state.emptyPromo.some((function(e) {
return 20 === e.promo_block_position
})),
isEditButtonHidden: n.state.emptyPromo.some((function(e) {
return e.context === t.context && 13 === e.promo_block_position
}))
}
},
n.renderEmptyPromo = function(e) {
var t,
i = n.getTab(e),
o = n.state.emptyPromo.filter((function(e) {
return e.context === i.context
})),
r = [],
s = [];
if (null == (t = o) || t.forEach((function(e) {
20 === e.promo_block_position ? r.push(e) : s.push(e)
})), (o = [].concat(r, s)).length) {
var a = o[0];
return (0, f.jsx)(ye, {
promoBlock: a,
onClick: n.handlePromoButtonClick,
sendTrackingOnMount: function() {
n.trackBlockingScreenView(a, i.type)
}
})
}
},
n.getTab = function(e) {
return n.state.tabConfig.find((function(t) {
return t.type === e
}))
},
n.getCurrentTab = function() {
return n.state.tabConfig.find((function(e) {
return e.isCurrent
}))
},
n.setCurrentTab = function(e) {
var t = n.state.tabConfig.map((function(t) {
return ri(ri({}, t), {}, {
isCurrent: t.type === e
})
})),
i = t.find((function(e) {
return e.isCurrent
}));
n.setState({
tabConfig: t,
currentTab: e
}),
E.Z.navigate(T.x.CONNECTIONS, !0, {
filter: i.route
})
},
n.getCurrentSortOption = function() {
return n.getCurrentTab().sortOptions.find((function(e) {
return e.isCurrent
}))
},
n.setCurrentSortOption = function(e) {
var t = n.getCurrentTab().type,
i = n.state.tabConfig.map((function(n) {
if (n.type === t) {
var i = n.sortOptions.map((function(t) {
return ri(ri({}, t), {}, {
isCurrent: t.variant === e
})
}));
return ri(ri({}, n), {}, {
sortOptions: i
})
}
return n
}));
n.setState({
tabConfig: i,
currentSortOption: e
})
};
var c = t.parameters.filter ? t.parameters.filter : Ve.jr.ALL;
Ve.Oq.some((function(e) {
return e.param === c
})) || (c = Ve.jr.ALL);
var u = gn.Z.getSettings(),
d = (0, ei.JM)(u, t.parameters.filter),
p = d.find((function(e) {
return e.isCurrent
})),
m = p.sortOptions.find((function(e) {
return e.isCurrent
}));
return n.state = {
tabConfig: d,
currentTab: p.type,
currentSortOption: m.variant,
currentFilter: c,
isEditing: !1,
isLoading: !1,
isFrozen: !1,
isShowingSortOptionsModal: !1,
isShowingDeleteModal: !1,
isReporting: !1,
emptyPromo: [],
isShowingSecurityWalkthroughModal: !1
}, n.fetchFolderUpdates = (0, s.Z)(n.fetchFolderUpdates, 1e3, {
leading: !0
}), jn.Z.getInstance().on(jn.Z.Type.PERSON_NOTICE, n.onPersonNotice, ai(n)).on(jn.Z.Type.CHAT_MESSAGE, n.onPushChatMessage, ai(n)), bn.Z.on(bn.Z.EVENTS.MESSAGE_FROM_ME, n.onChatMessageFromMe, ai(n)).on(bn.Z.EVENTS.NEW_MESSAGE_READ, n.onNewMessageRead, ai(n)), n.banners = new ce({
onPromoClick: n.unfreeze,
getActivationPlace: n.getActivationPlace_.bind(ai(n)),
getElementType: n.getElementType.bind(ai(n)),
getFolderType: function() {
var e;
return null == (e = n.getSelectedFilter()) ? void 0 : e.folderType
},
setIsShowingSecurityWalkthrough: function() {
n.setIsShowingSecurityWalkthrough(!0)
}
}), n.hasMatchBarStories = jt.Z.getSync(333).enabled && Un.Z.isActive(), n.containerRef = (0, i.createRef)(), n.screenRef = (0, i.createRef)(), n.modalRef = (0, i.createRef)(), n.modally = new Xn.Z, n
}
n = e,
(t = c).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
ci(t, n);
var u = c.prototype;
return u.componentDidMount = function() {
var t = this;
e.prototype.componentDidMount.call(this),
this.isStarted = !0,
Zn.Z.onFavoriteStateChange(this.onFavoriteStateChange),
En.Z.on(En.Z.EVENTS.USER_CHANGED_TS, this.updateCurrentUser, this).on(En.Z.EVENTS.ONLINE, this.onBackOnline, this),
Tn.subscribe(this.onUserIdExchanged, this),
bn.Z.on(bn.Z.EVENTS.NEW_OFFLINE_MESSAGE, this.onNewOfflineMessage, this),
this.jinba = new Cn.Z("CombinedConnections", 4),
hn.Z.on(hn.Z.USER_BLOCKED, (function(e) {
return t.removeBlockedUser(e)
})).on(hn.Z.VOTED_NO, (function(e) {
return t.removeUserWhenOpened(e)
})).on(hn.Z.USER_CONVERSATION_DELETED, (function(e) {
var n,
i = null == (n = t.getSelectedFilter()) ? void 0 : n.param;
i && i !== Ve.jr.CHATS || t.removeUserWhenOpened(e)
})),
E.Z.navigationEvent.subscribe(this.handleNavigation, this),
vn.Z.on(vn.Z.EVENTS.CHANGE, this.onBadgeChanged, this).on(vn.Z.EVENTS.INVALIDATED, this.onBadgeInvalidated, this);
var n = this.getParameter("filter");
n || (n = Ve.Oq[0].param);
var i = Boolean(An.O.value),
o = jt.Z.getSync(1).enabled,
r = jt.Z.getSync(268).enabled,
s = !this.forceFetch && i === this.hasSpp && o === this.hasPhoto && r === this.hasMatchBar && (n === this.selectedFilter || this.wasBack() && this.previousFilter);
this.hasSpp = i,
this.hasPhoto = o,
this.forceFetch = !1,
this.hasMatchBar = r,
s || this.previousFilter && (this.previousFilter = void 0),
this.fetchPopularity();
var a = this.usersToRemove.splice(0);
this.shouldFetchOnStart(Boolean(s)) ? (this.setFilter(n), this.fetchFolder()) : (a.forEach((function(e) {
return t.removeUser(e)
})), this.wasBack() && !this.state.isFrozen && (ji(), this.fetchFolderUpdates())),
this.readItems.length > 0 && (this.readItems.forEach((function(e) {
e.is_unread = !1,
e.unread_messages_count = 0
})), this.readItems = []),
vn.Z.trackNext().get().then(this.setBadgeCounters.bind(this)),
An.O.changeEvent.subscribe(this.handleSuperPowersEnabledChange, this),
this.enableFolderSync(),
Un.Z.hit(),
M.Z.enabledChangeEvent.subscribe(this.handleAdsEnabledChange),
this.selectedFilter !== this.state.currentFilter && this.setFilter(this.state.currentFilter)
}, u.componentWillUnmount = function() {
e.prototype.componentWillUnmount.call(this),
this.isFinished = !0,
this.resetCount.cancel(),
E.Z.navigationEvent.unsubscribe(this.handleNavigation, this),
this.markPeopleViewed(),
vn.Z.off(vn.Z.EVENTS.CHANGE, this.onBadgeChanged, this).off(vn.Z.EVENTS.INVALIDATED, this.onBadgeInvalidated, this),
An.O.changeEvent.unsubscribe(this.handleSuperPowersEnabledChange, this),
this.folderSyncActive && this.disableFolderSync(),
M.Z.enabledChangeEvent.unsubscribe(this.handleAdsEnabledChange),
M.Z.destroy(M.Z.placements.CONNECTIONS),
jn.Z.getInstance().off(jn.Z.Type.PERSON_NOTICE, this.onPersonNotice, this).off(jn.Z.Type.CHAT_MESSAGE, this.onPushChatMessage, this),
bn.Z.off(bn.Z.EVENTS.MESSAGE_FROM_ME, this.onChatMessageFromMe, this).off(bn.Z.EVENTS.NEW_MESSAGE_READ, this.onNewMessageRead, this)
}, u.getElementType = function() {
var e;
return null == (e = this.getSelectedFilter()) ? void 0 : e.elementType
}, u.getActivationPlace_ = function() {
return this.getSelectedFilter().activationPlace
}, u.getSelectedFilter = function() {
var e = this;
return Ve.Oq.find((function(t) {
return t.param === e.selectedFilter
}))
}, u.setFilter = function(e) {
if (e !== this.selectedFilter) {
var t = Ve.Oq.find((function(t) {
return t.param === e
}));
t && (this.selectedFilter = e, this.activationPlace = t.activationPlace, this.setState({
currentFilter: e
}), this.enableFolderSync())
}
}, u.isRemoveFromFolderAction = function(e) {
var t = this.getSelectedFilter();
return t && t.folderType === U.Z.TYPES.FAVOURITES && !e.favourited_you
}, u.applyServerActionHelper = function(e, t) {
var n,
i = this;
void 0 === t && (t = 0),
e.promo_block_type || this.log.error("I cannot handle the promo block after block action because promo_block_type does not exist", {
typeOfPromoBlock: typeof e,
promoBlock: e
}),
this.unfreeze();
var o,
r = null == (n = e.buttons) ? void 0 : n[t],
s = r ? r.action : e.ok_action,
a = r ? r.redirect_page : e.redirect_page;
a && (a = (new Vt.Z$B).setRedirectPage(null == (o = a) ? void 0 : o.redirect_page));
var c = e.promo_block_type;
this.forceFetch = 165 === c;
var l = (new xn.Z).setAction(s).setRedirectPage(a).setProductType(e.ok_payment_product_type).setPromoBlockType(c).setPromoBlock(e).setBack(E.Z.getUrl()).setHotPanelData({
activationPlace: this.getActivationPlace_()
});
12 === c && l.setCallback(this.fetchFolder.bind(this)),
kn.Z.handleAction(l).then((function() {
418 === c && i.fetchFolder({
preventLoading: !0
})
}))
}, u.clearFolderSyncVariables = function() {
this.mostRecentSortTimestamp = void 0
}, u.chatWithUser = function(e) {
var t = e.origin_folder,
n = fi[t];
e.is_unread = !1,
e.unread_messages_count = 0,
this.setState({
isEditing: !1
});
var i = e.user_id,
o = this.userSubstitutes[i];
!Number(i) && i.length < 20 && this.log.error("WRONG USER ID: " + i + " from chatWithUser_"),
E.Z.navigate(T.x.MESSAGES, {
id: i,
folderId: t,
context: 26,
clientSource: n,
toClientSource: n,
fromConnectionsList: !0,
userSubstitute: o
})
}, u.markPeopleViewed = function() {
var e = this;
Object.keys(this.visibleUserIds).forEach((function(t) {
var n = e.visibleUserIds[t];
U.Z.getInstance().markPeopleViewed({
context: 22,
folderId: Number(t),
peopleIds: n
}, !0)
})),
this.visibleUserIds = {}
}, u.removeUser = function(e) {
-1 !== l.ZP.findIndex(e) ? (this.userIds[e] = !1, l.ZP.removeItem(e), this.setState({
isLoading: !1
}), this.updateFolderIfEmpty()) : this.log.error("Connections - Removing a user which doesnt exist in our connections (userIds value is " + this.userIds[e] + ")")
}, u.removeUsers = function(e) {
var t = this;
e.forEach((function(e) {
t.userIds[e] = !1,
l.ZP.removeItem(e),
bn.Z.invalidate(e),
t.userSubstitutes[e] && Sn.Z.reportEventDismiss({
promoCard: t.userSubstitutes[e].contentModePromoCards[0],
context: 26
})
}))
}, u.removeBlockedUser = function(e) {
-1 !== l.ZP.findIndex(e) && this.removeUserWhenOpened(e)
}, u.removeUserWhenOpened = function(e) {
this.isStarted ? this.removeUser(e) : this.usersToRemove.push(e)
}, u.resendStoredRequests = function() {
this.savedRemoveUserIds.length > 0 && (this.onRemoveUsers(this.savedRemoveUserIds.concat([])), this.savedRemoveUserIds = [])
}, u.revealUser = function(e) {
var t,
n = this,
i = null == e ? void 0 : e.user_id;
U.Z.getInstance().revealUser({
personId: i,
folderId: null == (t = this.getSelectedFilter()) ? void 0 : t.folderType
}).then((function(e) {
var t = e[0],
o = null == t ? void 0 : t.getSection();
if (o) {
var r = o[0],
s = ((null == r ? void 0 : r.getUsers()) || [])[0];
n.replaceRevealedUser(i, null == s ? void 0 : s.getUserId())
} else
n.log.error("Error revealing user: Server did not return any sections")
})).catch((function(e) {
n.log.error("Error revealing user:", e),
D.Z.showNotification({
type: D.Z.TYPES.ERROR
})
}))
}, u.replaceRevealedUser = function(e, t) {
var n = this;
return this.fetchFolderRequest().then((function(i) {
var o = i[0],
r = ((null == o ? void 0 : o.getSection()) || [])[0],
s = null == r ? void 0 : r.getUsers(),
a = null == s ? void 0 : s.find((function(e) {
return e.getUserId() === t
}));
if (a) {
var c = l.ZP.findIndex(e),
u = l.ZP.get(c);
u && (u.object = a, l.ZP.replaceItem(u, c), n.setState({
isLoading: !1
}))
}
}))
}, u.setBadgeCounters = function(e) {
if (e) {
var t = e.notices,
n = e.values,
i = Ci(t);
yi = n,
this.setState({
badgeUpdates: i
})
}
}, u.shouldFetchOnStart = function(e) {
var t = !(this.wasBack() && e || this.previousFilter),
n = 0 === l.ZP.getItems().length && !this.state.emptyPromo.length && !this.isLoading;
return t || n
}, u.trackBlockingScreenView = function(e, t) {
var n;
(e.promo_block_type || this.log.error("I cannot track ViewElement event after block show because getPromoBlockType is not a function", {
typeOfPromoBlock: typeof e,
promoBlock: e
}), 418 === e.promo_block_type) && (t === Ve.ph.ALL_MESSAGES ? n = 189 : t === Ve.ph.ACTIVITY && (n = 1387), n && ni(n))
}, u.trackBlockingScreenClick = function(e, t, n) {
var i;
e.promo_block_type || this.log.error("I cannot track Click event after block action because getPromoBlockType is not a function", {
typeOfPromoBlock: typeof e,
promoBlock: e
});
var o = e.promo_block_type;
hi.includes(o) && 2 === (null == (i = e.buttons) ? void 0 : i.length) && void 0 !== t && gi[t] && ii(e, gi[t]);
var r = mi[o];
if (r) {
var s = function(e, t) {
if (12 === e)
return 41;
if (t && di[t])
return di[t];
return 71
}(o, n);
ti(r, s)
}
}, u.addUserSubstitutes_ = function(e) {
var t = this;
e.forEach((function(e) {
t.userSubstitutes[e.getId()] = new Sn.Z({
userSubstitute: e
})
}))
}, u.getUserSubstitute = function(e) {
return this.userSubstitutes[e]
}, u.updateCurrentUser = function(e) {
this.isRemoveFromFolderAction(e) || this.setState({
isLoading: !1
})
}, u.updateUser = function(e, t, n) {
var i = l.ZP.findIndex(t);
if (i > -1) {
var o = l.ZP.get(i),
r = o.object;
n && (r.display_message = n),
e && (r.unread_messages_count = (r.unread_messages_count || 0) + 1),
o.object = r;
var s = l.ZP.hasTopMostPromo(),
a = 0 === i || 1 === i && s;
this.state.isFrozen || a ? l.ZP.replaceItem(o, i) : (o.isUpdate = !0, l.ZP.moveItemToTop(o, i)),
this.setState({})
}
}, u.updateFolderIfEmpty = function() {
var e = this.getCurrentTab();
l.ZP.getUsers(e.connectionTypes).length > 0 || this.fetchFolder()
}, u.enableFolderSync = function() {
this.folderSyncActive || (this.folderSyncActive = !0, jn.Z.getInstance().on(jn.Z.Type.SYSTEM_NOTIFICATION, this.onSystemNotification, this), jt.Z.on(jt.Z.EVENTS.UPDATE, this.onFeatureUpdate, this))
}, u.disableFolderSync = function() {
this.folderSyncActive && (this.folderSyncActive = !1, jn.Z.getInstance().off(jn.Z.Type.SYSTEM_NOTIFICATION, this.onSystemNotification, this), jt.Z.off(jt.Z.EVENTS.UPDATE, this.onFeatureUpdate, this))
}, u.fetchFolder = function(e) {
var t = this;
void 0 === e && (e = {});
var n = e.shouldGetNextPage;
this.isLoading = !0,
e.preventLoading || n || this.setState({
isLoading: !0
}),
this.fetchFolderRequest(n).then((function(e) {
var i = e[0];
t.onFolderResult({
shouldGetNextPage: n,
previousFilter: t.selectedFilter,
clientUserList: i
})
})).catch(this.onFolderError),
this.fetchBanners()
}, u.fetchBanners = function() {
var e = this,
t = this.banners.getShownPromoBlocks();
this.banners.fetch({
shownPromoBlocks: t
}).then((function(t) {
var n = t[0];
e.banners.setPromoBlocks({
promos: n.toJSON().promo_blocks || []
}),
e.banners.appendBanners()
}))
}, u.fetchFolderRequest = function(e) {
e || (this.clearFolderSyncVariables(), this.setState({
emptyPromo: []
}), this.banners.reset(), M.Z.destroy(M.Z.placements.CONNECTIONS));
var t = {
promoBlockRequestParams: [{
shownPromoBlocks: this.banners.getShownPromoBlocks(),
position: 1,
count: 2
}, !e && {
position: 8,
count: 1
}].filter(Boolean)
};
e && (t.pageToken = this.pageToken),
t.direction = 1;
var n = ri(ri(ri({}, t), li), {
folderId: U.Z.TYPES.MESSAGES_AND_ACTIVITY
});
return U.Z.getInstance().fetch(n, !0, !0)
}, u.fetchFolderUpdates = function() {
var e = this;
if (!this.isLoading && !this.state.isFrozen)
if (this.syncToken) {
this.isLoading = !0;
var t = ri(ri(ri({}, {
direction: 2,
includeTransient: !1,
syncToken: this.syncToken
}), li), {
folderId: U.Z.TYPES.MESSAGES_AND_ACTIVITY
});
U.Z.getInstance().fetch(t, !0, !0).then((function(t) {
var n = t[0];
e.state.isFrozen || e.onFolderResult({
previousFilter: e.selectedFilter,
clientUserList: n,
isUpdates: !0
})
})).catch(this.onFolderError)
} else
this.fetchFolder()
}, u.fetchPopularity = function() {
var e = this;
yn.Z.getInstance().get({
id: O.Z.getUserId(),
clientSource: 127,
requestedFields: [690]
}).then((function(t) {
e.setState({
popularityLevel: Si(t.getPopularityLevel())
})
}))
}, u.setTimestamps = function(e) {
var t = e.sort_timestamp;
(!this.mostRecentSortTimestamp || t > this.mostRecentSortTimestamp) && (this.mostRecentSortTimestamp = t)
}, u.renderNavigation = function() {
var e = this,
t = (0, $n.Z)(253),
n = t.header_text,
i = t.subheader_text;
return (0, f.jsx)(Ct, ri({
header: n,
subHeader: i,
popularityLevel: this.state.popularityLevel,
isEditing: this.state.isEditing,
onClickEdit: function() {
return e.handleEditModeToggle()
},
onClickPopularity: this.handleClickPopularity,
onClickNotifications: function() {
return e.handleSelectTab(Ve.ph.ACTIVITY)
}
}, this.getEmptyPromoFlags(Ve.ph.ALL_MESSAGES)))
}, u.renderMatchBar = function() {
return (0, f.jsx)(Xt, {
hasMatchBarStories: this.hasMatchBarStories
})
}, u.renderSecurityWalkthroughModal = function() {
var e = this;
return (0, f.jsx)(Dn.Z, {
onDismissModal: function() {
e.setIsShowingSecurityWalkthrough(!1)
},
context: 127
})
}, u.renderConnectionsList = function(e) {
var t = this.getTab(e);
return (0, f.jsx)(xt, {
currentFilter: this.getSelectedFilter(),
currentTab: t.connectionTypes,
currentPromoContext: t.context,
currentSortOption: this.getCurrentSortOption().variant,
isLoading: this.state.isLoading,
isEditing: this.state.isEditing,
getUserSubstitute: this.getUserSubstitute.bind(this),
onSelectItem: this.handleSelectItem,
onFavouriteItem: this.handleFavouriteItem,
onTrackScroll: this.handleTrackScroll,
onItemVisible: this.handleItemVisible,
onBannerVisible: this.handleBannerVisible,
onNeedPage: this.handleNeedPage
})
}, u.renderDeleteButton = function() {
return (0, f.jsx)(en, {
isActive: this.state.isEditing,
onClick: this.handleClickDelete
})
}, u.render = function() {
var e = this,
t = (0, f.jsx)(k, ri({
emptyPromo: this.renderEmptyPromo(Ve.ph.ALL_MESSAGES),
navigation: this.renderNavigation(),
matchBar: this.renderMatchBar(),
connectionsList: this.renderConnectionsList(Ve.ph.ALL_MESSAGES),
deleteButton: this.renderDeleteButton(),
isLoading: this.state.isLoading,
isEditing: this.state.isEditing,
isFrozen: this.state.isFrozen,
hasMatchBarStories: this.hasMatchBarStories,
containerRef: this.containerRef,
screenRef: this.screenRef,
onClickNewActivityButton: this.handleClickNewActivityButton,
sortOptionsButton: this.renderSortOptionsButton(),
securityWalkthroughModal: this.state.isShowingSecurityWalkthroughModal ? this.renderSecurityWalkthroughModal() : void 0,
currentTab: this.state.currentTab,
modalRef: this.modalRef,
isReporting: this.state.isReporting,
onReportingClose: function() {
return e.setState({
isReporting: !1
})
},
onReportingSuccess: this.handleReportingSuccess,
reportingId: this.deletingIds[0]
}, this.getEmptyPromoFlags(Ve.ph.ALL_MESSAGES))),
n = (0, f.jsx)(Jn, ri({
connectionsList: this.renderConnectionsList(Ve.ph.ACTIVITY),
emptyPromo: this.renderEmptyPromo(Ve.ph.ACTIVITY),
matchBar: this.renderMatchBar(),
sortOptionsButton: this.renderSortOptionsButton(),
deleteButton: this.renderDeleteButton(),
hasMatchBarStories: this.hasMatchBarStories,
isLoading: !1,
isEditing: this.state.isEditing,
isVisible: this.state.currentTab === Ve.ph.ACTIVITY,
onBackClick: function() {
return e.handleSelectTab(Ve.ph.ALL_MESSAGES)
},
onEditButtonClick: function() {
return e.handleEditModeToggle()
}
}, this.getEmptyPromoFlags(Ve.ph.ACTIVITY)));
return this.addPageWrapper((0, f.jsxs)(i.Fragment, {
children: [t, n, this.renderSortOptionsModal(), this.renderDeleteModal()]
}), "connections")
}, c
}(c.Z);
function Si(e) {
switch (e) {
case 10:
default:
return St.V7.VERY_LOW;
case 20:
return St.V7.LOW;
case 30:
return St.V7.AVERAGE;
case 40:
return St.V7.HIGH;
case 50:
return St.V7.VERY_HIGH
}
}
function _i(e) {
return vn.Z.getCached().values[e] || 0
}
function Ci(e) {
var t = [];
return e.forEach((function(e) {
if (e) {
var n = e.filter_display_values;
n && n.forEach((function(n) {
t.push({
folder: e.folder,
value: n.int_value,
filter: n.filter
})
})),
t.push({
folder: e.folder,
value: e.int_value
})
}
})), t
}
function ji() {
vi = 0,
bi = []
}
xi.hasTabBar = !0,
xi.transition = !1;
var Pi = xi
},
13706: function(e, t, n) {
n.d(t, {
ZP: function() {
return I
},
LP: function() {
return T
},
e5: function() {
return O
}
});
n(9653);
var i = n(67294),
o = n(46813),
r = n(77004),
s = n(230),
a = n(34969),
c = n(12137),
l = n(96437),
u = n(41896),
d = n(86273),
p = n(30664),
h = n(57871),
m = n(98380),
f = n(27966),
g = n(42308),
v = n(83900),
b = n(97381),
y = n(10109),
x = n(35702),
S = n(17527),
_ = n(81873),
C = n(85893),
j = function(e) {
var t = e.viewType,
n = e.imageSrc,
i = e.showDelete,
o = e.mediaContainerRef,
r = e.mediaRef,
s = e.onClose,
c = e.onSend,
l = e.onDelete,
u = e.a11y,
d = [{
type: f.Us.CLOSE,
onClick: s
}];
return t === m.Y.SHARE && d.push({
type: f.df.BUTTON,
text: a.ZP.get(451),
onClick: function() {
return c(n)
}
}), (0, C.jsxs)(g.Z, {
dataQA: {
"data-qa-page": "overlay-page"
},
children: [(0, C.jsx)(v.Z, {
children: (0, C.jsx)(f.ZP, {
actions: d,
position: "fixed"
})
}), (0, C.jsx)(b.Z, {
align: "stretch",
children: (0, C.jsxs)(y.ZP, {
background: y.z4.BLACK,
containerRef: o,
dataQa: "multimedia-page-media",
children: [(0, C.jsx)(x.ZP, {
src: n,
isCustom: !0,
mediaRef: r,
fit: x.DW.CONTAIN,
a11y: {
label: null == u ? void 0 : u.imageLabel
}
}), i ? (0, C.jsx)(_.ZP, {
children: (0, C.jsx)(S.Z, {
type: S.w.DELETE,
onClick: l
})
}) : null]
})
})]
})
},
P = n(30374),
k = n(65701),
Z = d.Z.getLogger("MultimediaPage"),
E = u.Z.getInstance("Multimedia"),
O = function() {
E.invalidate("multimedia")
},
T = function() {
return E.get("multimedia")
},
I = function(e) {
var t = e.viewType,
n = e.multimediaVisibility,
u = e.chatUserId,
d = e.chatUserName,
f = e.id,
g = e.imageSrc,
v = void 0 === g ? "" : g,
b = (0, i.useState)(""),
y = b[0],
x = b[1],
S = (0, i.useState)(!1),
_ = S[0],
O = S[1],
T = (0, i.useState)(!0),
I = T[0],
w = T[1],
A = (0, i.useRef)(0),
N = (0, i.useRef)(0),
R = (0, i.useRef)(null),
M = (0, i.useRef)(null),
L = (0, i.useRef)(null),
U = function(e) {
e && c.Z.deleteChatMessage(u, f, 0).catch((function(e) {
Z.error(e),
h.Z.showNotification({
type: h.Z.TYPES.ERROR
})
})),
O(!1),
s.Z.back()
},
D = function() {
var e,
t;
if (R.current && M.current) {
var n = null == (e = R.current) ? void 0 : e.clientWidth,
i = null == (t = R.current) ? void 0 : t.clientHeight,
o = A.current,
r = N.current,
s = n / (o >= r ? 100 : 100 * o / r),
a = i / (r >= o ? 100 : 100 * r / o),
c = "";
c += "scale(" + Math.min(s, a) + ")",
M.current.style.transform = c,
M.current.style.webkitTransform = c
}
},
B = (0, i.useCallback)((function() {
r.Z.setTimeout((function() {
return D()
}), 100)
}), []),
F = function(e) {
w(!(1 !== e))
};
(0, i.useEffect)((function() {
if (f && v.length)
return (0, l.pt)(v).then((function(e) {
var t = e[0],
n = e[1],
i = e[2];
A.current = n,
N.current = i,
D(),
x(t)
})).catch((function(e) {
return (0, P.hI)(e, "Multimedia container image preload")
})), o.Z.on(o.Z.ORIENTATION_CHANGE, B), L.current = (new p.Z).on(p.Z.EVENTS.ZOOM, F).enable(), function() {
var e;
o.Z.off(o.Z.ORIENTATION_CHANGE, B),
null == (e = L.current) || e.disable()
};
s.Z.back()
}), [f, v, B]);
var G = d ? a.ZP.get(634, {
name: d
}) : a.ZP.get(635);
return (0, C.jsxs)(i.Fragment, {
children: [(0, C.jsx)(j, {
viewType: t,
imageSrc: y,
showDelete: I && t === m.Y.VIEW && 4 === Number(n),
mediaContainerRef: R,
mediaRef: M,
onClose: function() {
s.Z.back()
},
onSend: function(e) {
(0, l.pt)(e).then((function(e) {
var t = e[0],
n = e[1],
i = e[2];
E.put("multimedia", {
height: i,
src: t,
visibility: 4,
width: n
}, {
ttl: 1e4
}),
s.Z.back()
})).catch((function(e) {
return (0, P.hI)(e, "Multimedia container image sent preload")
}))
},
onDelete: function() {
O(!0)
},
a11y: {
imageLabel: G || ""
}
}), (0, C.jsx)(k.Z, {
header: a.ZP.get(436),
message: a.ZP.get(539),
confirmLabel: a.ZP.get(350),
cancelLabel: a.ZP.get(429),
isOpen: _,
onConfirm: function() {
return U(!0)
},
onCancel: U
})]
})
}
},
98380: function(e, t, n) {
var i;
n.d(t, {
Y: function() {
return i
}
}),
function(e) {
e.VIEW = "VIEW",
e.SHARE = "SHARE"
}(i || (i = {}))
},
34018: function(e, t, n) {
n(96649),
n(96078),
n(82526),
n(41817),
n(41539),
n(9653),
n(69070),
n(47941),
n(57327),
n(38880),
n(89554),
n(54747),
n(49337),
n(33321);
var i = n(67294),
o = n(46813),
r = n(45292),
s = n(85893);
function a(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function c(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? a(Object(n), !0).forEach((function(t) {
l(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : a(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function l(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
t.Z = function(e) {
var t = (0, i.useState)(!1),
n = t[0],
a = t[1];
function l() {
a(!0)
}
function u() {
a(!1)
}
return (0, i.useEffect)((function() {
return o.Z.on(o.Z.SHOW_MODAL, l), o.Z.on(o.Z.HIDE_MODAL, u), function() {
o.Z.off(o.Z.SHOW_MODAL, l),
o.Z.off(o.Z.HIDE_MODAL, u)
}
}), []), (0, s.jsx)(r.Z, c(c({}, e), {}, {
disabled: n
}))
}
},
45292: function(e, t, n) {
n.d(t, {
F: function() {
return o
}
});
var i,
o,
r = n(94184),
s = n.n(r),
a = n(85893);
!function(e) {
e.DEFAULT = "DEFAULT",
e.SQUARE = "SQUARE"
}(o || (o = {}));
var c = ((i = {})[o.DEFAULT] = "", i[o.SQUARE] = "external-ads-banner--square", i);
t.Z = function(e) {
var t,
n = e.adSlot,
i = e.dataQa,
r = e.type,
l = void 0 === r ? o.DEFAULT : r,
u = e.innerRef,
d = e.disabled,
p = s()(((t = {
"external-ads-banner": !0
})[c[l]] = !0, t["external-ads-banner--no-events"] = d, t));
return (0, a.jsx)("div", {
className: p,
children: (0, a.jsx)("div", {
id: n,
"data-qa-ads": i,
ref: u
})
})
}
},
44991: function(e, t, n) {
var i = n(2215),
o = n(36004),
r = n(75727),
s = (0, o.yM)(),
a = i.Z.EVENTS,
c = a.USER_ADDED,
l = a.USER_REMOVED,
u = i.Z.TYPES.FAVOURITES,
d = i.Z.getInstance();
function p(e, t) {
r.Z.getInstance().updateCache(e, "isFavourite", t),
s.trigger(e, t)
}
function h(e) {
var t = e.uid;
e.folder === u && p(t, !0)
}
function m(e) {
var t = e.uid;
e.folder === u && p(t, !1)
}
t.Z = {
start: function() {
d.on(c, h),
d.on(l, m)
},
stop: function() {
d.off(c, h),
d.off(l, m)
},
onFavoriteStateChange: s.subscribe
}
},
68341: function(e, t, n) {
n.d(t, {
Z: function() {
return i
}
});
n(69826),
n(41539),
n(74916);
function i(e, t) {
var n,
i = ((null == e ? void 0 : e.external_endpoints) || []).find((function(e) {
return e.type === t
}));
return null == i || null == (n = i.url) ? void 0 : n.replace("http://", "https://")
}
},
12470: function(e, t, n) {
n.d(t, {
Z: function() {
return c
}
});
n(69826),
n(41539),
n(96649),
n(96078),
n(82526),
n(41817),
n(9653),
n(69070),
n(47941),
n(57327),
n(38880),
n(89554),
n(54747),
n(49337),
n(33321);
var i = n(57376),
o = n(68068);
function r(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
t && (i = i.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}))),
n.push.apply(n, i)
}
return n
}
function s(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? r(Object(n), !0).forEach((function(t) {
a(e, t, n[t])
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : r(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}))
}
return e
}
function a(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var i = n.call(e, t || "default");
if ("object" != typeof i)
return i;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
function c(e) {
var t,
n = s({}, null == (t = o.Z.getSettings()) || null == (t = t.header_configs) ? void 0 : t.find((function(t) {
return t.context === e
})));
return n.subheader_text && function(e) {
new i.ZP(278, {
common_stats: {
event: 2,
source: 21,
context: e
}
}).request()
}(e), s(s({}, {
context: 0,
header_text: "",
subheader_text: ""
}), n)
}
},
67729: function(e, t, n) {
n(89554),
n(41539),
n(5212);
var i,
o = n(67294),
r = n(77004),
s = n(28223),
a = n(96437);
!function(e) {
e.FORWARD = "forward",
e.BACKWARD = "backward",
e.NONE = "none"
}(i || (i = {}));
t.Z = function(e, t, n) {
void 0 === n && (n = {});
var c = (0, o.useRef)(!1);
(0, o.useEffect)((function() {
if (e) {
var o = e.current,
l = n.activeIndex || 0,
u = n.activeIndex || 0,
d = [],
p = {},
h = 0,
m = 0,
f = 0,
g = 0,
v = 0,
b = 0,
y = null,
x = null,
S = !1,
_ = !1,
C = !1,
j = !1,
P = 0,
k = "rtl" === r.Z.language_direction,
Z = function() {
null != o && o.offsetWidth && (P = o.children[e.current.children.length - 1].offsetLeft, Array.prototype.forEach.call(o.children, (function(e, t) {
d[t] || (d[t] = {});
var n = e.getAttribute("data-id");
p[n] = t;
var i = d[t],
o = e.offsetLeft;
i.el = e,
i.id = n,
i.index = t,
i.position = o,
i.width = e.offsetWidth
})))
},
E = function() {
return 1 === d.length || d.some((function(e) {
return 0 !== e.position
}))
},
O = function(e) {
var t = function(e) {
var t = e < 0,
n = "rtl" === r.Z.language_direction;
return t && e < -50 ? n ? i.BACKWARD : i.FORWARD : !t && e > 50 ? n ? i.FORWARD : i.BACKWARD : i.NONE
}(e);
if (t === i.BACKWARD) {
for (var n = e, s = l - 1; s >= 0 && !((n -= (null == o ? void 0 : o.children[s]).offsetWidth) < 50);)
s--;
return Math.max(s, 0)
}
if (t === i.FORWARD) {
for (var a = -e, c = l + 1; c < d.length && !((a -= (null == o ? void 0 : o.children[c]).offsetWidth) - 50 < 50);)
c++;
return Math.min(c, d.length - 1)
}
return l
},
T = function(e) {
var t = b > 0;
return t && (k ? e < 0 : e > 0) ? e = 0 : !t && (k ? e <= P : e <= -P) && (e = -P), !!o && (o.style.transform = "translate3d(" + e + "px, 0, 0)", v = e, !0)
},
I = function(e, n) {
y = e,
l = e.index,
n && (null == o || o.classList.add("is-animated")),
T(-e.position),
n ? (0, a.co)((0, s.Z)(o), (function() {
return null == o || o.classList.remove("is-animated"), t && y && t(y.index), void (_ = !1)
})) : _ = !1
},
w = function(e) {
if (E() || Z(), !(d.length < 2 || _)) {
var t = e.touches[0];
S = !1,
h = m = 0,
f = t.pageX,
g = t.pageY,
y && (u = y.index),
C = !0
}
},
A = function(e) {
if (!(d.length < 2 || S || _)) {
if (!C)
return C = !1, void w(e);
var t = e.touches[0],
i = t.pageX - f,
o = t.pageY - g;
m += i,
f = t.pageX,
g = t.pageY;
var r = m - h;
j || (j = Math.abs(i) > Math.abs(o)),
j ? (e.preventDefault(), b = i, T(v + i)) : S = !0;
var s,
a = O(r) || l;
s = d[a],
x !== s && n.activeClassName && (x && x.el.classList.remove(n.activeClassName), s && (s.el.classList.add(n.activeClassName), x = s))
}
},
N = function() {
if (!(d.length < 2 || !j || _)) {
_ = !0,
C = !1;
var e = O(m - h),
t = d[e];
I(t, !0),
j = !1
}
};
return Z(), E() && (I(d[u], c.current), c.current = !0), null == o || o.addEventListener("touchstart", w), null == o || o.addEventListener("touchmove", A), null == o || o.addEventListener("touchend", N), function() {
null == o || o.removeEventListener("touchstart", w),
null == o || o.removeEventListener("touchmove", A),
null == o || o.removeEventListener("touchend", N)
}
}
}), [e, t, n])
}
},
39467: function(e, t, n) {
n(66992),
n(41539),
n(88674),
n(78783),
n(33948),
n(68304);
var i = n(74837),
o = n(2215);
function r(e, t) {
return r = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
}, r(e, t)
}
var s = function(e) {
var t,
n;
function o() {
var t;
return (t = e.call(this) || this).EVENTS = {
USER_CHANGED: "change",
USER_CHANGED_TS: "change_ts",
ONLINE: "online"
}, t.savedUsersToChangeFavourite = {}, i.Z.on(i.Z.EVENTS.ONLINE, t.backOnline, function(e) {
if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}(t)), t
}
n = e,
(t = o).prototype = Object.create(n.prototype),
t.prototype.constructor = t,
r(t, n);
var s = o.prototype;
return s.backOnline = function() {
var e = [];
for (var t in this.savedUsersToChangeFavourite) {
var n = this.savedUsersToChangeFavourite[t];
e.push(a(n.user, n.callback))
}
this.savedUsersToChangeFavourite = {},
this.trigger(this.EVENTS.ONLINE, Promise.all(e))
}, s.saveUser = function(e, t) {
this.savedUsersToChangeFavourite[e.user_id] = {
user: e,
callback: t
}
}, s.toggleFavouriteStatus = function(e, t) {
e.is_favourite = !e.is_favourite,
this.trigger(this.EVENTS.USER_CHANGED_TS, e),
i.Z.isOnline() ? a(e, t) : this.saveUser(e, t)
}, o
}(n(36004).zW);
function a(e, t) {
var n = {
uid: e.user_id,
folder: o.Z.TYPES.FAVOURITES
},
i = null;
return !0 === e.is_favourite ? i = o.Z.getInstance().addUserToFolder(n) : (i = o.Z.getInstance().removeUserFromFolder(n), t && i.then(t)), i
}
t.Z = new s
},
64935: function(e, t, n) {
n.d(t, {
e: function() {
return s
}
});
n(69826),
n(41539);
var i = n(38146),
o = n(88906),
r = n(5646);
function s(e, t) {
var n = ((null == e ? void 0 : e.user_field_errors) || []).find((function(e) {
return e.user_field === t
}));
return n ? {
errorMessage: n.error_message,
errorType: i.Z.getErrorFromFieldErrorType(n.error_type),
errorField: r.r[t],
isInvalid: !0
} : (0, o.B)()
}
},
5646: function(e, t, n) {
var i;
n.d(t, {
r: function() {
return o
}
});
var o = ((i = {})[200] = 39, i[220] = 8, i[10] = 7, i[230] = 9, i[20] = 12, i)
}
}]);
Function Calls
None |
Stats
MD5 | e7677053796c51a342fbc2db21fd07d0 |
Eval Count | 0 |
Decode Time | 701 ms |