- if (self.CavalryLogger) {
- CavalryLogger.start_js(["\/nn2hvs"]);
- }
- __d("TabbableElements", ["Style"], (function (a, b, c, d, e, f) {
- f.find = a;
- f.findFirst = c;
- f.findLast = d;
- f.isTabbable = i;
- f.isVisible = e;
- function g(a) {
- if (a.tabIndex < 0) return !1;
- if (a.tabIndex > 0 || a.tabIndex === 0 && a.getAttribute("tabIndex") !== null) return !0;
- var b = a;
- switch (a.tagName) {
- case "A":
- a = b;
- return !!a.href && a.rel != "ignore";
- case "INPUT":
- a = b;
- return a.type != "hidden" && a.type != "file" && !a.disabled;
- case "BUTTON":
- case "SELECT":
- case "TEXTAREA":
- a = b;
- return !a.disabled
- }
- return !1
- }
- function h(a) {
- a = a;
- while (a && a !== document && b("Style").get(a, "visibility") != "hidden" && b("Style").get(a, "display") != "none") a = a.parentNode;
- return a === document
- }
- function a(a) {
- return Array.from(a.getElementsByTagName("*")).filter(i)
- }
- function c(a) {
- return Array.from(a.getElementsByTagName("*")).find(i)
- }
- function d(a) {
- a = Array.from(a.getElementsByTagName("*"));
- for (var b = a.length - 1; b >= 0; b--)
- if (i(a[b])) return a[b];
- return null
- }
- function i(a) {
- return g(a) && h(a)
- }
- function e(a) {
- return h(a)
- }
- }), null);
- __d("clamp", [], (function (a, b, c, d, e, f) {
- e.exports = a;
- function a(a, b, c) {
- if (a < b) return b;
- return a > c ? c : a
- }
- }), null);
- __d("MFlyout", ["cx", "CSS", "DOM", "Locale", "MContextualThing", "MJSEnvironment", "MLayer", "MLegacyDataStore", "MParent", "MViewport", "Scroll", "Stratcom", "TabbableElements", "Vector", "clamp", "emptyFunction", "mixInEventEmitter"], (function (a, b, c, d, e, f, g) {
- var h = 52,
- i = 26,
- j = 10,
- k = 22,
- l = 20,
- m = 10,
- n = 14,
- o = 44,
- p = 3,
- q = 400,
- r = 320,
- s = ["resize", "m:schedulable:loaded", "m:viewport:orientation-change", "m:orientation-resize:complete", "m:hideout:reflow", "m:landscape-cover-crop:complete"],
- t = "flyout-causal";
- function u() {
- return document.body
- }
- var v = [];
- a = function (a) {
- "use strict";
- babelHelpers.inheritsLoose(c, a);
- function c(b, c) {
- b = a.call(this, b) || this;
- b._contentRoot = null;
- b._overlay = null;
- b._contentWrapper = null;
- b._nubNode = null;
- b._nubAlignment = null;
- b._content = null;
- b._contextNode = null;
- b._parentLayer = null;
- b._parentSubscription = null;
- b._orientation = null;
- b._orientationClass = null;
- b._width = null;
- b._modal = null;
- b._contentPositioner = null;
- b._heightConstraint = null;
- b._autoflipTopOffset = null;
- b._coverZIndex = null;
- b._cover = null;
- b._supportFixedPosition = !1;
- b._contentContainer = null;
- b._useContentAsBounds = !1;
- b._contentAlignLeft = !1;
- b._contentAlignRight = !1;
- b._customMaxWidth = null;
- b.init(c);
- return b
- }
- var d = c.prototype;
- d.configure = function (c, d) {
- a.prototype.configure.call(this, c, d);
- if (c.context) {
- this.setContext(c.context);
- this.setParentSubscription();
- b("Stratcom").addSigil(this.getCausalElement(), t);
- var e = b("MLegacyDataStore").get(this.getCausalElement());
- e.flyout = this
- }
- c.contentAlignLeft ? this.setContentAlignLeft(c.contentAlignLeft) : c.contentAlignRight && this.setContentAlignRight(c.contentAlignRight);
- this.setMargin(c.margin);
- this.setPosition(c.position);
- this.setNubAlign(c.nubalign);
- this.setOffsetY(c.offsetY);
- this._content = d;
- this.setWidth(c.width);
- this.setModal(!!c.modal);
- this.setAutoflipTopOffset(c.autoFlipTopOffset);
- this.setCoverZIndex(c.coverZIndex);
- this.setUseContentAsBounds(c.useContentAsBounds || !1);
- this._supportFixedPosition = c.supportFixedPosition != null ? c.supportFixedPosition : !1;
- this._customMaxWidth = c.customMaxWidth
- };
- d.setCoverZIndex = function (a) {
- this._coverZIndex = a
- };
- d.setWidth = function (a) {
- this._width = a
- };
- d.setModal = function (a) {
- this._modal = a
- };
- d.getModal = function () {
- return this._modal
- };
- d.setAutoflipTopOffset = function (a) {
- this._autoflipTopOffset = a
- };
- d.getAutoflipTopOffset = function () {
- return this._autoflipTopOffset
- };
- d._getLayerParentWidth = function () {
- return b("Vector").getDim(this.getRoot().offsetParent).x
- };
- d.getMaxWidth = function () {
- return Math.min(this._getLayerParentWidth(), b("MJSEnvironment").IS_TABLET ? r : q)
- };
- d._maxWidthIsApplicable = function () {
- return this.getMaxWidth() !== this._getLayerParentWidth()
- };
- d._isCustomWidth = function () {
- return this._width === "auto" || this._maxWidthIsApplicable()
- };
- d.setContentAlignLeft = function (a) {
- this._contentAlignLeft = a
- };
- d.setContentAlignRight = function (a) {
- this._contentAlignRight = a
- };
- d._isContentAlignLeft = function () {
- return this._contentAlignLeft
- };
- d._isContentAlignRight = function () {
- return this._contentAlignRight
- };
- d.getCustomMaxWidth = function () {
- return this._customMaxWidth != null ? this._customMaxWidth : -1
- };
- d.applyWidth = function () {
- var a = this._contentRoot.style;
- a.width = "";
- a.maxWidth = "";
- if (this._maxWidthIsApplicable() && this.getCustomMaxWidth() <= 0) {
- var c = this.getMaxWidth() + "px";
- this._width === "auto" ? a.maxWidth = c : a.width = c
- }
- b("CSS").conditionClass(this._contentRoot, "_556f", this._isCustomWidth());
- b("CSS").conditionClass(this._contentRoot, "_99wx", this._isContentAlignLeft() && this.getCustomMaxWidth() === 50);
- b("CSS").conditionClass(this._contentRoot, "_99wy", this._isContentAlignLeft() && this.getCustomMaxWidth() === 60)
- };
- d.buildWrapper = function (a, c) {
- this._nubNode = (a = b("DOM")).create("div", {
- className: "_5bn_"
- });
- this._backgroundNode = a.create("div", {
- className: "_5c0e"
- }, this._nubNode);
- this._contentContainer = a.create("div", {
- className: "_5c0f"
- }, c);
- this._contentRoot = a.create("div", {
- className: "_5bo0"
- }, [this._backgroundNode, this._contentContainer]);
- b("Locale").isRTL() && (this._contentRoot.style.direction = "rtl");
- this._contentWrapper = b("DOM").create("div", {
- className: "_544k"
- }, this._contentRoot);
- this._contentPositioner = b("DOM").create("div", {
- className: "_544l _7a_1"
- }, this._contentWrapper);
- return this._contentPositioner
- };
- d.setMargin = function (a) {
- b("CSS").conditionClass(this._contentRoot, "_54wl", a === "large"), b("CSS").conditionClass(this._contentRoot, "_55kj", a === "medium")
- };
- d.getInsertParent = function () {
- var c = this.insertParent;
- if (!c) {
- var d = this.getContext();
- d && (c = b("MParent").bySigil(d, "context-layer-root") || u())
- }
- return c || a.prototype.getInsertParent.call(this)
- };
- d.setContent = function (a) {
- this._content = a;
- b("DOM").setContent(this._contentRoot, this._content);
- this.updateIfShown();
- return this
- };
- d.setContext = function (a) {
- this._contextNode = a
- };
- d.getCausalElement = function () {
- return a.prototype.getCausalElement.call(this) || this.getContext()
- };
- d.setParentSubscription = function () {
- var a = this.getContext(),
- c = null,
- d = u().parentNode;
- while (a && a !== d) {
- c = b("MLegacyDataStore").get(a).layer;
- if (c) break;
- a = a.parentNode
- }
- if (c === this._parentLayer) return;
- this._parentLayer && this._parentSubscription && (this._parentSubscription.remove(), this._parentSubscription = null);
- c && (this._parentSubscription = c.subscribe("hide", this.hide.bind(this)));
- this._parentLayer = c
- };
- d.setPosition = function (a) {
- this.getOrientation().setDefaultPosition(a) && (this.getOrientation().setPosition(a), this.updateIfShown());
- return this
- };
- d.setNubAlign = function (a) {
- x(a), this._nubAlignment = a || "center"
- };
- d.setOffsetX = function (a) {
- a = parseInt(a, 10);
- this.getOrientation().setDefaultOffsetX(a) && this.updateIfShown();
- return this
- };
- d.setOffsetY = function (a) {
- a = parseInt(a, 10);
- this.getOrientation().setDefaultOffsetY(a) && this.updateIfShown();
- return this
- };
- d.setUseContentAsBounds = function (a) {
- this._useContentAsBounds = a
- };
- d.getOrientation = function () {
- this._orientation || (this._orientation = new y());
- return this._orientation
- };
- d.getContentRoot = function () {
- return this._contentRoot
- };
- d.getContent = function () {
- return this._content
- };
- d.getContext = function () {
- return this._contextNode
- };
- d.getContextBounds = function () {
- return this.getContext().getBoundingClientRect()
- };
- d.causalClickShow = function () {
- this.getContent() && this.show()
- };
- d.show = function () {
- if (this.isShown()) return this;
- this._cover || (this._cover = b("DOM").create("div", {
- className: "_5so _2wyb",
- style: this._coverZIndex ? {
- zIndex: this._coverZIndex
- } : {}
- }));
- a.prototype.show.call(this);
- this.getModal() && b("DOM").insertAfter(this._contentPositioner, this._cover);
- if (this.isShown()) {
- this.config && this.config.logShown && b("Stratcom").invoke("m:flyout:show", null, {
- type: this.config.logShown
- });
- b("MContextualThing").register(this.getRoot(), this.getContext());
- v.push(this);
- if (!this.resizeListeners) {
- var c = this.updatePosition.bind(this);
- this.resizeListeners = s.map(function (a) {
- return b("Stratcom").listen(a, null, c)
- })
- }
- var d = document.getElementById("viewport"),
- e = this.getContentRoot();
- if (d && e) {
- e = e.parentNode;
- var f = 0,
- g = e;
- while (g && g !== d) f += g.offsetTop, g = g.offsetParent;
- g = f + e.clientHeight;
- this._heightConstraint = b("MViewport").addMinHeightConstraint(g)
- }
- }
- d = b("TabbableElements").findFirst(this._contentContainer);
- d && d.focus();
- return this
- };
- d.finishHide = function () {
- v.splice(v.indexOf(this), 1);
- while (this.resizeListeners && this.resizeListeners.length) this.resizeListeners.pop().remove();
- this.resizeListeners = null;
- b("Stratcom").invoke("m:flyout:close", null, {
- flyout: this
- });
- this.getModal() && this._cover && b("DOM").remove(this._cover);
- this._heightConstraint && (this._heightConstraint.release(), this._heightConstraint = null);
- return a.prototype.finishHide.call(this)
- };
- d.updatePosition = function () {
- var a = this.getContext();
- if (!a) return !1;
- var c = a.offsetParent;
- if (!c && this._supportFixedPosition) {
- var d = getComputedStyle(a);
- d.position === "fixed" && (c = parseInt(d.top, 10))
- }
- if (!c) return !1;
- this.applyWidth();
- this.emit("adjustDimensions");
- d = this.getRoot();
- c = this.getOrientation();
- this.emit("adjust", c.reset());
- var e = d.offsetParent;
- e = e.getBoundingClientRect();
- var f = this.getContextBounds(),
- g = f.left - e.left,
- q = f.right / 3,
- r = f.top - e.top,
- s = window.innerHeight,
- t = this.getContentRoot(),
- u = b("MParent").bySigil(a, "feed-ufi-comments"),
- v = u !== null ? t.clientHeight + k + o + m : t.clientHeight + k + o;
- v = v < f.top;
- var w = u !== null ? t.clientHeight + j + l + (s - u.getBoundingClientRect().bottom) : t.clientHeight + j + l;
- t.clientHeight + j + l;
- var x = s - f.bottom >= w;
- c.getPosition() === "below" && (!u && f.height <= s - w - o || u && f.height <= s - w ? r += f.height : v ? c.setPosition("above") : !x ? r = u !== null ? e.top * -1 + u.clientHeight / 2 : e.top * -1 + s / 2 - o : r += f.height + l);
- this.updateWrapperClass(c);
- w = 0;
- v = c.getOffsetX();
- x = t.clientWidth;
- u = Math.round(x / 2);
- if (this._isCustomWidth()) {
- if (v) w = v - u;
- else if (this._isContentAlignLeft()) w = g;
- else if (this._isContentAlignRight()) w = q;
- else {
- s = g + Math.round(f.width / 2);
- w = s - u
- }
- w = b("clamp")(Math.round(w), 0, this._getLayerParentWidth() - x)
- }
- t.style.left = w + "px";
- v = c.getOffsetY();
- q = 0;
- b("Stratcom").hasSigil(a, "kaios-like-react-trigger") && (c.getPosition() === "above" ? q = n : c.getPosition() === "below" && (q = -n));
- d.style.top = r + v + q + "px";
- s = this._nubAlignment;
- f.width < i && (s = "center");
- x = i / 2;
- a = g;
- d = Math.round(f.width / 2);
- this._useContentAsBounds && (a = w, d = u);
- s === "center" ? a += d : s === "left" ? a += x : a += f.width - x;
- this._isContentAlignRight() && (a = d);
- r = t.getBoundingClientRect();
- v = {
- left: r.left,
- width: r.width
- };
- v.left -= e.left;
- q = p + i / 2;
- a = b("clamp")(a, v.left + q, v.left + v.width - q);
- g = this._isContentAlignLeft() || this._isContentAlignRight() ? a - v.left : a - h / 2 - v.left;
- this._nubNode.style.left = g + "px";
- this.emit("reposition", c);
- return !0
- };
- d.updateNubPosition = function (a) {
- this._nubNode && (this._nubNode.style.left = a + "px")
- };
- d._toggleOrientationClass = function (a, c) {
- b("CSS").conditionClass(this._contentWrapper, c || this._orientationClass, a)
- };
- d.updateWrapperClass = function (a) {
- a = a.getClassName();
- if (a === this._orientationClass) return;
- this._orientationClass && this._toggleOrientationClass(!1);
- this._orientationClass = a;
- this._toggleOrientationClass(!0)
- };
- d.simulateOrientation = function (a, b) {
- a = a.getClassName();
- if (a === this._orientationClass) return b();
- else {
- this._orientationClass && this._toggleOrientationClass(!1);
- this._toggleOrientationClass(!0, a);
- b = b();
- this._toggleOrientationClass(!1, a);
- this._orientationClass && this._toggleOrientationClass(!0);
- return b
- }
- };
- d.destroy = function () {
- a.prototype.destroy.call(this);
- this._contextNode = null;
- this._contextSigil = null;
- this._contentRoot = null;
- this._contentWrapper = null;
- this._contentContainer = null;
- this._content = null;
- this._nubNode = null;
- this._width = null;
- this._cover = null;
- this._overlay = null;
- return this
- };
- d.shouldBlurOnTouchEnd = function () {
- return this.getModal() == null
- };
- return c
- }(b("MLayer"));
- b("mixInEventEmitter")(a, {
- adjustDimensions: !0,
- adjust: !0,
- reposition: !0
- });
- var w = b("emptyFunction").thatReturnsArgument,
- x = b("emptyFunction").thatReturnsArgument,
- y = function () {
- "use strict";
- function a() {
- this._default = {
- _position: "above",
- _offsetX: 0,
- _offsetY: 0
- }, this.reset()
- }
- var b = a.prototype;
- b.setPosition = function (a) {
- this._position = w(a);
- return this
- };
- b.getOppositePosition = function () {
- return a.OPPOSITE[this.getPosition()]
- };
- b.getPosition = function () {
- return this._position || "above"
- };
- b.getOffsetX = function () {
- return this._offsetX || 0
- };
- b.getOffsetY = function () {
- var a = this._offsetY || 0;
- this._position === "above" ? (a -= k, a *= -1) : this._position === "below" && (a -= j);
- return a
- };
- b.getClassName = function () {
- var a = this.getPosition();
- if (a === "below") return "_5bo1";
- else if (a === "above") return "_5bo2"
- };
- b.reset = function () {
- Object.assign(this, this._default);
- return this
- };
- b.setDefaultPosition = function (a) {
- var b = this._default._position;
- this._default._position = w(a);
- return b !== a
- };
- b.setDefaultOffsetX = function (a) {
- var b = this._default._offsetX;
- this._default._offsetX = a;
- return b !== a
- };
- b.setDefaultOffsetY = function (a) {
- var b = this._default._offsetY;
- this._default._offsetY = a;
- return b !== a
- };
- return a
- }();
- y.OPPOSITE = {
- above: "below",
- below: "above"
- };
- b("Stratcom").listen("click", t, function (a) {
- b("MLegacyDataStore").get(a.getNode(t)).flyout.causalClickShow()
- });
- b("Stratcom").listen("click", ["m-layer-root", "mflyout-remove-on-click"], function (a) {
- a = a.getNode("m-layer-root");
- b("MLegacyDataStore").get(a).layer.hide()
- });
- e.exports = a
- }), null);
- __d("MLayerDestroyOnHide", [], (function (a, b, c, d, e, f) {
- a = function () {
- "use strict";
- function a(a) {
- this.$1 = a, this.$2
- }
- var b = a.prototype;
- b.enable = function () {
- this.$2 = this.$1.addListener("hide", this.$1.destroy.bind(this.$1))
- };
- b.disable = function () {
- this.$1 = null, this.$2.remove(), this.$2 = null
- };
- return a
- }();
- e.exports = a
- }), null);
- __d("MUFIActorSelectorBootloader", ["Bootloader", "Event", "MFlyout", "MLayerDestroyOnHide", "MLayerHideOnBlur", "destroyOnUnload"], (function (a, b, c, d, e, f) {
- "use strict";
- var g = {
- _buildLoadingFlyout: function (a, c) {
- return new(b("MFlyout"))({
- position: "below",
- context: a,
- addedBehaviors: [b("MLayerDestroyOnHide"), b("MLayerHideOnBlur")],
- classNames: ["accelerate"],
- margin: "none",
- nubalign: "center",
- offsetY: 0,
- width: "100%"
- }, c)
- },
- initBootloadHook: function (a) {
- var c = b("Event").listen(a.container, "click", function () {
- var d = g._buildLoadingFlyout(a.loadingFlyoutContext, a.loadingFlyoutContent);
- d.show();
- b("Bootloader").loadModules(["MUFIActorSelector.react", "ReactRenderer"], function (b, e) {
- e.constructAndRenderComponentAcrossTransitions(b, a.reactElementProps, a.container), d.destroy(), c.remove()
- }, "MUFIActorSelectorBootloader")
- });
- b("destroyOnUnload")(c.remove)
- }
- };
- e.exports = g
- }), null);
- __d("MCompositionStoreID", [], (function (a, b, c, d, e, f) {
- a = Object.freeze({
- CONFIG: "CONFIG",
- FORMAT: "FORMAT",
- GROUP_SELL: "GROUP_SELL",
- MINUTIAE: "MINUTIAE",
- PHOTO: "PHOTO",
- PLACE: "PLACE",
- PAGE_RECOMMENDATIONS: "PAGE_RECOMMENDATIONS",
- SHARE: "SHARE",
- STATUS: "STATUS",
- WITH_TAGS: "WITH_TAGS",
- PRIVACY: "PRIVACY",
- SLIDESHOW: "SLIDESHOW"
- });
- e.exports = a
- }), null);
- __d("MComposition", ["invariant", "MCompositionStoreID"], (function (a, b, c, d, e, f, g) {
- a = function () {
- "use strict";
- function a(a) {
- a = a || {};
- this.$1 = {};
- for (var b in a) this.setStoreData(b, a[b])
- }
- var c = a.prototype;
- c.serialize = function () {
- return this.$1
- };
- c.$2 = function (a) {
- Object.prototype.hasOwnProperty.call(b("MCompositionStoreID"), a) || g(0, 11921, a)
- };
- c.setStoreData = function (a, b) {
- this.$2(a);
- Object.prototype.hasOwnProperty.call(this.$1, a) && g(0, 11922, a);
- this.$1[a] = b;
- return this
- };
- return a
- }();
- e.exports = a
- }), null);
- __d("MComposerPresence", ["invariant", "$", "DOM", "EventEmitter", "MLegacyDataStore"], (function (a, b, c, d, e, f, g) {
- var h = "REGISTERED",
- i = null,
- j = new(b("EventEmitter"))();
- a = {
- addRegistrationListener: function (a) {
- return j.addListener(h, a)
- },
- hasRegisteredInstance: function () {
- return !!i
- },
- hasLoadedPrivacyValue: function (a) {
- return !this.hasRegisteredInstance() ? !1 : b("DOM").scry(b("DOM").find(b("$")("static_templates"), "div", "composer-main-view"), "tr", "privacy-option").some(function (c) {
- return b("MLegacyDataStore").get(c).value === a
- })
- },
- register: function (a) {
- i && g(0, 5767), i = a, j.emit(h)
- },
- unregister: function (a) {
- i === a || g(0, 5768), i = null
- },
- cleanup: function () {
- i !== null && i.cleanup()
- }
- };
- e.exports = a
- }), null);
- __d("MComposerAsyncLoadRequest", ["MComposerPresence", "MRequest", "Promise"], (function (a, b, c, d, e, f) {
- a = function () {
- "use strict";
- function a() {
- this.$1 = null, this.$2 = null, this.$3 = null
- }
- var c = a.prototype;
- c.$4 = function () {
- this.$1 && (this.$1.remove(), this.$1 = null), this.$3 && (this.$3.abort(), this.$3 = null)
- };
- c.$5 = function (a) {
- var c = this;
- return new(b("Promise"))(function (d, e) {
- c.$1 = b("MComposerPresence").addRegistrationListener(d), c.$3 = new(b("MRequest"))(a), c.$3.setAutoRetry(!1), c.$3.listen("fail", e), c.$3.send()
- })
- };
- c.send = function (a) {
- var b = this;
- this.$2 || (this.$2 = this.$5(a), this.$2["finally"](function () {
- return b.$4()
- }));
- return this.$2
- };
- return a
- }();
- e.exports = a
- }), null);
- __d("XComposerAsyncLoaderController", ["XController"], (function (a, b, c, d, e, f) {
- e.exports = b("XController").create("/composer/async_loader/", {
- targetid: {
- type: "Int"
- },
- photo_url: {
- type: "String"
- },
- video_url: {
- type: "String"
- },
- attachment_id: {
- type: "String"
- }
- })
- }), null);
- __d("MComposerEntry", ["ErrorUtils", "LoadingIndicator", "MComposerAsyncLoadRequest", "MComposerPresence", "MComposition", "MLegacyDataStore", "Promise", "Stratcom", "XComposerAsyncLoaderController"], (function (a, b, c, d, e, f) {
- var g, h = new(b("Promise"))(function (a, b) {
- return b()
- }),
- i = new(b("Promise"))(function (a) {
- return a()
- }),
- j = (g || (g = b("ErrorUtils"))).guard(function (a) {
- if (a) throw a
- }, "MComposerEntry");
- function a(a) {
- if (o) return;
- p.invoke(new(b("MComposition"))(b("MLegacyDataStore").get(a.getNode("composer_entry_trigger")).COMPOSITION))
- }
- function k(a, c, d, e, f) {
- e === void 0 && (e = !0);
- o = !0;
- var g = null;
- b("MComposerPresence").hasRegisteredInstance() ? g = n(a, d) : g = m(a, c, e).then(function () {
- var b = !0;
- f && (b = f());
- if (b) return n(a, d)
- }, j);
- g["finally"](function () {
- return o = !1
- });
- return g
- }
- function l(a, c) {
- return b("MComposerPresence").hasRegisteredInstance() ? i : new(b("MComposerAsyncLoadRequest"))().send(c)
- }
- function m(a, c, d) {
- d === void 0 && (d = !0);
- d && b("LoadingIndicator").show();
- a = l(a, c);
- d && a["finally"](function () {
- return b("LoadingIndicator").hide()
- });
- return a
- }
- function n(a, c) {
- return new(b("Promise"))(function (d, e) {
- var f = {};
- f.COMPOSITION = a.serialize();
- f.ON_CANCEL = e;
- f.ON_SUBMIT = d;
- f.ON_OPEN = c;
- b("Stratcom").invoke("MComposer:entry:js", null, f)
- })
- }
- var o = !1;
- b("XComposerAsyncLoaderController").getURIBuilder().getURI();
- b("Stratcom").listen("click", "composer_entry_trigger", a);
- b("Stratcom").listen("m:page:unload", null, function () {
- o = !1
- });
- var p = {
- invoke: function (a, c, d, e, f) {
- if (o || p.blockNavigateToComposer()) return h;
- c = b("XComposerAsyncLoaderController").getURIBuilder().setInt("targetid", c);
- d !== void 0 && (c = c.setString("photo_url", d));
- e !== void 0 && (c = c.setString("video_url", e));
- f !== void 0 && (c = c.setString("attachment_id", f));
- return k(a || new(b("MComposition"))(), c.getURI())
- },
- invokeOcelot: function (a, c, d, e) {
- if (o || p.blockNavigateToComposer()) return h;
- var f = new(b("MComposition"))();
- return k(f, a, d, c, e)
- },
- blockNavigateToComposer: function () {
- return window.bgUploadInlineComposerCallback ? window.bgUploadInlineComposerCallback() : !1
- }
- };
- e.exports = p
- }), 3);
- __d("XFeedNUXSaveSeenStateController", ["XController"], (function (a, b, c, d, e, f) {
- e.exports = b("XController").create("/feed/nux/seen/save/", {
- link_id: {
- type: "String"
- },
- key: {
- type: "String",
- required: !0
- },
- seen: {
- type: "Bool",
- defaultValue: !1
- },
- env: {
- type: "Enum",
- enumType: 0
- }
- })
- }), null);
- __d("MFeedNUXTooltip", ["DOM", "MRequest", "MViewport", "Stratcom", "SubscriptionsHandler", "XFeedNUXSaveSeenStateController", "destroyOnUnload", "mixInEventEmitter"], (function (a, b, c, d, e, f) {
- var g = {},
- h, i = {},
- j, k = 0,
- l = 100,
- m = 1,
- n = 0;
- function o() {
- h = b("Stratcom").listen("scroll", null, q), b("destroyOnUnload")(p)
- }
- function p() {
- h && h.remove(), h = null, window.clearTimeout(j), j = null
- }
- function q() {
- var a = b("MViewport").getHeight();
- j && (window.clearTimeout(j), j = null);
- for (var c in g) {
- var d = g[c],
- e = d.getNodes(),
- f = d.getHeadRoom();
- for (var h = 0; h < e.length; h++) {
- var i = e[h].getBoundingClientRect();
- if (i.top >= f && i.bottom <= a) {
- r(e[h], d);
- break
- }
- }
- }
- }
- function r(a, b) {
- j = window.setTimeout(function () {
- b.getContext() !== a && (b.setContext(a), b.show())
- }, k)
- }
- a = function () {
- "use strict";
- function a(a, c, d, e) {
- g.length || o();
- if (g[c] || i[c]) {
- d.destroy();
- return
- }
- this.$1 = c;
- this.$2 = b("DOM").scry(document.getElementById("page"), "*", a);
- this.$3 = a;
- this.$4 = n;
- this.$5 = d;
- this.$6 = e === 0 ? 0 : e || l;
- g[c] = this;
- var f = new(b("SubscriptionsHandler"))();
- f.addSubscriptions(this.$5.addListener("show", this.emit.bind(this, "show")), this.$5.addListener("hide", function () {
- this.emit("hide"), f.release()
- }.bind(this)));
- q()
- }
- var c = a.prototype;
- c.destroy = function () {
- delete g[this.$1], Object.keys(g).length || p()
- };
- c.getContext = function () {
- return this.$5.getContext()
- };
- c.getNodes = function () {
- return this.$2
- };
- c.getHeadRoom = function () {
- return this.$6
- };
- c.getIsUnseen = function () {
- return this.$4 === n
- };
- c.setContext = function (a) {
- this.$5 && this.$5.setContext(a)
- };
- c.show = function () {
- if (!this.$5 || this.$4 === m) return;
- i[this.$1] = !0;
- this.$4 = m;
- this.$5.show();
- var a = b("XFeedNUXSaveSeenStateController").getURIBuilder().setString("key", this.$1).setBool("seen", !0);
- new(b("MRequest"))(a.getURI()).setMethod("POST").send();
- this.destroy()
- };
- c.hide = function () {
- this.$5 && this.$5.hide()
- };
- return a
- }();
- b("mixInEventEmitter")(a, {
- show: !0,
- hide: !0
- });
- e.exports = a
- }), null);
- __d("MFeedReactionsNUX", ["BanzaiLogger", "MLegacyDataStore", "MLiveData", "Stratcom", "SubscriptionsHandler", "requestAnimationFrame"], (function (a, b, c, d, e, f) {
- "use strict";
- f.init = a;
- function a(a, c) {
- var d = c && c.isCommentNUX;
- if (a) {
- var e = new(b("SubscriptionsHandler"))();
- e.addSubscriptions(b("Stratcom").listen("click", "like-reaction-flyout", function (c) {
- var f = c.getNode("like-reaction-flyout"),
- h = c.getNode("feed-ufi-comments");
- if (!f || h) return;
- h = b("MLegacyDataStore").get(f);
- if (d && !h.isComment || !d && h.isComment) return;
- var i = h.feedback_target || h.feedbackTarget;
- if (i) {
- var j = b("MLiveData").get(i);
- e.addSubscriptions(j.listen("change", function () {
- j.getData().has_viewer_liked && b("requestAnimationFrame")(function () {
- a.setContext(c.getTarget()), a.show(), g(i)
- })
- }))
- }
- }), a.once("hide", function () {
- e.release()
- }));
- d || e.addSubscriptions(b("Stratcom").listen("click", "reactions-bling-bar", function (c) {
- var d = c.getNode("mufi-inline").querySelector('a[data-sigil*="like-reaction-flyout"]');
- if (d) {
- var e = c.getNode("feed-ufi-metadata");
- e = b("MLegacyDataStore").get(e).feedback_target.toString();
- g(e);
- a.setContext(d);
- a.show();
- c.kill()
- }
- }));
- b("Stratcom").listen("m:page:unload", null, function () {
- b("Stratcom").removeCurrentListener(), e.release()
- })
- }
- }
- function g(a) {
- b("BanzaiLogger").log("WebReactionsNuxLoggerConfig", {
- feedback_id: a,
- "interface": "mTouch"
- })
- }
- }), null);
- __d("NTAnnounceSubscription", ["Stratcom"], (function (a, b, c, d, e, f) {
- "use strict";
- f.subscribe = a;
- function a(a, c) {
- b("Stratcom").listen(a, null, function (a) {
- c(a.getData())
- })
- }
- }), null);
- __d("XUFIReactionController", ["XController"], (function (a, b, c, d, e, f) {
- e.exports = b("XController").create("/ufi/reaction/", {
- client_id: {
- type: "String"
- },
- ft_ent_identifier: {
- type: "String"
- },
- reaction_type: {
- type: "Enum",
- enumType: 0
- },
- story_render_location: {
- type: "Enum",
- enumType: 1
- },
- is_inline: {
- type: "Bool",
- defaultValue: !1
- },
- is_comment: {
- type: "Bool",
- defaultValue: !1
- },
- is_permalink: {
- type: "Bool",
- defaultValue: !1
- },
- action_source: {
- type: "String"
- },
- feedback_source: {
- type: "Int"
- },
- feedback_referrer: {
- type: "String"
- },
- is_sponsored: {
- type: "Bool",
- defaultValue: !1
- },
- basic_origin_uri: {
- type: "String"
- },
- basic_reload: {
- type: "Exists",
- defaultValue: !1
- },
- bgsync_id: {
- type: "String"
- },
- aftercursor: {
- type: "String"
- },
- tab: {
- type: "String"
- },
- _ft_: {
- type: "String"
- }
- })
- }), null);
- __d("MReactionsFlyout", ["cx", "fbt", "ActorURI", "BanzaiLogger", "CSS", "CancelableEventListener", "DOM", "MBlockingTouchable", "MLegacyDataStore", "MLiveData", "MParent", "MUFIConfig", "MUFIReactionsUtils", "MUFIRequest", "Stratcom", "SubscriptionsHandler", "TouchEventType", "URI", "XUFIReactionController", "clearTimeout", "gkx", "setTimeout"], (function (a, b, c, d, e, f, g, h) {
- f.init = a;
- f.addAnchor = c;
- f.initNUX = d;
- var i, j = 17,
- k = "_ft_",
- l = {
- top: .3,
- bottom: .6
- },
- m, n = [],
- o = function () {
- function a(a) {
- var c = this,
- d;
- this.autoHideOnScroll = function (a) {
- a = c.flyout;
- if (!a || !a.isShown()) {
- b("Stratcom").removeCurrentListener();
- return
- }
- var d;
- window.innerHeight ? d = window.innerHeight : document.body && (d = document.body.clientHeight);
- if (!d) return;
- var e = a.getContext().getBoundingClientRect().top,
- f = d * l.top,
- g = d * l.bottom;
- (e < f || e > g) && a.hide()
- };
- this.onUnload = function () {
- c.onHide(), c.pageSubscriptions.release()
- };
- this.onClick = function (a) {
- a = a.getNode("reaction-item");
- a instanceof HTMLElement && c.select(a)
- };
- this.onScreenReaderTrigger = function (a) {
- a = a.getTarget();
- if (!a) return;
- a = a.previousSibling;
- if (!a) return;
- c.flyout.setContext(a);
- c.setSupported();
- c.flyout.show();
- c.flyoutSubscriptions.addSubscriptions(b("Stratcom").listen("click", "reaction-item", c.onClick));
- a = b("MLiveData").get(b("MLegacyDataStore").get(c.flyout.getContext()).feedbackTarget).getData();
- a = a.viewerreaction;
- var d = null;
- for (var e = 0, f = c.reactionElements.length; e < f; e++) {
- var g = b("MLegacyDataStore").get(c.reactionElements[e]);
- g = g.reaction;
- g === a && (d = c.reactionElements[e])
- }
- d || (d = c.reactionElements[0]);
- d.focus()
- };
- this.onClickTrigger = function (a) {
- a = a.getTarget();
- if (!(a instanceof HTMLElement)) return;
- var d = c.flyout;
- if (d.isShown()) {
- d.hide();
- return
- }
- b("Stratcom").hasSigil(a, "like-reaction-flyout") || (a = b("MParent").bySigil(a, "like-reaction-flyout"));
- a && c.setupFlyout(d, a)
- };
- this.onClickCapture = function (a) {
- var d = c.flyout;
- if (d) {
- var e = b("MLegacyDataStore").get(d.getContext());
- e = e.kaiOSReactions;
- if (e && d.isShown()) {
- d.hide();
- return
- }
- }
- a.stop()
- };
- this.onTouchStart = function (a) {
- var d = c.flyout;
- if (!d.isShown()) {
- var e = document;
- e = e.body;
- e && b("CSS").addClass(e, "_70ol");
- c.touchStartX = a.getTouch().clientX;
- c.timing.touchStartTime = Date.now();
- c.preventScrollTimeout = b("setTimeout")(function () {
- c.canScroll = !1
- }, 200);
- c.longpressTimeout = b("setTimeout")(function () {
- c.timing.shownTime = Date.now();
- var e = a.getTarget();
- if (!(e instanceof HTMLElement)) return;
- b("Stratcom").hasSigil(e, "like-reaction-flyout") || (e = b("MParent").bySigil(e, "like-reaction-flyout"));
- e && c.setupFlyout(d, e)
- }, 300)
- }
- };
- this.onTouchMove = function (a) {
- var d = c.flyout,
- e = d.getContext() && b("MLegacyDataStore").get(d.getContext()).isComment;
- c.canScroll || (e ? a.kill() : a.prevent());
- if (!d.isShown()) return;
- a = a.getTouch();
- var f = a.clientX;
- a = a.clientY;
- a = document.elementFromPoint(f, a);
- if (a) {
- var g = a.nodeName === "I" || a.nodeName === "IMG";
- if (!(g || c.canScrub)) {
- c.canScrub = Math.abs(c.touchStartX - f) >= 25;
- return
- }
- d.getContentRoot().setAttribute("data-longpress", !0);
- if (d.getContentRoot().contains(a)) {
- if (g) {
- a = (f = a) != null ? (f = f.parentNode) != null ? f.parentNode : f : f
- }
- c.active !== a && b("MLegacyDataStore").get(a).reaction && (c.isUpdatedDock || e ? c.showOverlay(c.overlay && c.overlay.slide) : c.showOverlay(c.overlay && c.overlay.dots), c.removeActive(), c.active = a, a && a.setAttribute("data-active", "true"))
- } else(!c.overlay || !c.overlay.container.contains(a)) && (c.removeActive(), c.showOverlay(c.overlay && c.overlay.release))
- }
- };
- this.onTouchEnd = function (a) {
- var d = c.active;
- if (d) c.log({
- finalReaction: b("MLegacyDataStore").get(d).reaction,
- viaScrubbing: !0
- }), c.select(d);
- else {
- d = a.getTouch();
- a = d.clientX;
- d = d.clientY;
- a = document.elementFromPoint(a, d);
- d = c.flyout;
- a && !(d.getContentRoot().contains(a) || d.getContext().contains(a) || c.overlay && c.overlay.container.contains(a)) && d.hide()
- }
- };
- this.onWindowClick = function (a) {
- var d;
- a = a.getNode("reaction-item");
- a && (d = b("MLegacyDataStore").get(a).reaction);
- c.log({
- finalReaction: d,
- viaScrubbing: !1
- })
- };
- this.onWindowTouchEnd = function () {
- var a = c.flyout;
- a.isShown() ? (c.timing.touchEndTime = Date.now(), a.getContentRoot().removeAttribute("data-longpress")) : (c.canScroll = !0, b("clearTimeout")(c.longpressTimeout), b("clearTimeout")(c.preventScrollTimeout))
- };
- this.onHide = function () {
- var a = document;
- a = a.body;
- a && b("CSS").addClass(a, "_70ol");
- c.canScroll = !0;
- c.canScrub = !1;
- c.removeActive();
- c.removeUFIOverlay();
- c.flyout.hide();
- c.flyoutSubscriptions.release();
- c.flyoutSubscriptions = new(b("SubscriptionsHandler"))()
- };
- this.onWindowTouchMove = function () {
- c.flyout.isShown() || (c.canScroll = !0, b("clearTimeout")(c.longpressTimeout), b("clearTimeout")(c.preventScrollTimeout))
- };
- this.flyout = a;
- this.active = null;
- this.canScroll = !0;
- this.canScrub = !1;
- this.preventScrollTimeout = null;
- this.longpressTimeout = null;
- this.nuxTooltip = null;
- this.overlay = null;
- this.timing = {
- touchStartTime: null,
- touchEndTime: null,
- shownTime: null
- };
- this.touchStartX = 0;
- this.isUpdatedDock = b("MUFIConfig").hasUpdatedDock;
- this.pageSubscriptions = new(b("SubscriptionsHandler"))();
- this.flyoutSubscriptions = new(b("SubscriptionsHandler"))();
- this.assignFlyoutContent();
- this.pageSubscriptions.addSubscriptions(a.addListener("hide", this.onHide), (d = b("Stratcom")).listen("m:page:unload", null, this.onUnload), d.listen("m:viewport:orientation-change", null, this.onHide), d.listen(b("TouchEventType").END, null, this.onWindowTouchEnd), d.listen("click", "screenreader-reactions-trigger", this.onScreenReaderTrigger), b("CancelableEventListener").listen(a.getContentRoot(), "touchmove", "reaction-item", this.onTouchMove));
- n.forEach(function (a) {
- return c.addAnchor(a)
- });
- m && this.setNUXTooltip(m);
- b("MUFIConfig").hasIEMobileFixes ? this.pageSubscriptions.addSubscriptions(b("Stratcom").listen("touchcancel", null, this.onWindowTouchEnd)) : this.pageSubscriptions.addSubscriptions(b("Stratcom").listen("touchmove", null, this.onWindowTouchMove))
- }
- var c = a.prototype;
- c.addAnchor = function (a) {
- var c = b("Stratcom").hasSigil(a, "kaios-like-react-trigger");
- c ? this.pageSubscriptions.addSubscriptions(b("CancelableEventListener").listen(a, "click", null, this.onClickTrigger)) : this.pageSubscriptions.addSubscriptions(b("CancelableEventListener").listen(a, b("TouchEventType").START, null, this.onTouchStart));
- b("MUFIConfig").hasIEMobileFixes || this.pageSubscriptions.addSubscriptions(b("CancelableEventListener").listen(a, "touchmove", "like-reaction-flyout", this.onTouchMove), b("CancelableEventListener").listen(a, "touchmove", "reaction-item", this.onTouchMove))
- };
- c.assignFlyoutContent = function () {
- (!this.reactionElements || this.reactionElements.length === 0) && (this.reactionElements = document.getElementsByClassName("_1-kd"), Array.prototype.forEach.call(this.reactionElements, function (a) {
- return b("MBlockingTouchable").init(a)
- }))
- };
- c.setupFlyout = function (a, c) {
- var d = b("MLegacyDataStore").get(c);
- a.setContext(c);
- this.setSupported();
- c = this.nuxTooltip;
- c && c.hide();
- c = a.getContentRoot();
- c = b("MParent").bySigil(c, "m-layer-root");
- c && (this.isUpdatedDock && !d.isComment && (this.applyMultilineFlyout(), b("CSS").addClass(c, "_5xt_")), d.isComment && b("CSS").addClass(c, "_31rl"));
- a.show();
- c = b("MLegacyDataStore").get(a.getContext());
- a = c.kaiOSReactions;
- a || this.createUFIOverlay();
- this.isUpdatedDock || d.isComment ? this.showOverlay(this.overlay && this.overlay.tap) : this.showOverlay(this.overlay && this.overlay.dots);
- this.flyoutSubscriptions.addSubscriptions(b("Stratcom").listen("click", "reaction-item", this.onClick), b("Stratcom").listenCapture("click", "like-reaction-flyout", this.onClickCapture), b("Stratcom").listenCapture("click", null, this.onWindowClick));
- a && this.flyoutSubscriptions.addSubscriptions(b("Stratcom").listen("scroll", null, this.autoHideOnScroll));
- b("MUFIConfig").hasIEMobileFixes || this.flyoutSubscriptions.addSubscriptions(b("Stratcom").listen("touchend", "like-reaction-flyout", this.onTouchEnd), b("Stratcom").listen("touchend", "reaction-item", this.onTouchEnd))
- };
- c.select = function (a) {
- var c = this.flyout;
- c.hide();
- if (!a) return;
- a = b("MLegacyDataStore").get(a);
- a = a.reaction;
- c = c.getContext();
- var d = b("MLegacyDataStore").get(c),
- e = d.feedbackTarget;
- d = d.isComment;
- var f = b("MLiveData").get(e).getData();
- if (f.viewerreaction === a) return;
- if (d) {
- d = c.getAttribute("data-uri") || c.getAttribute("href");
- d = b("MUFIRequest").getURI(d);
- d.addQueryData("reaction_comment_id", e.split("_")[1]);
- d.addQueryData("viewer_reaction", a);
- b("MUFIRequest").send(e, b("MUFIReactionsUtils").getReactionDataForComment(f, a), d)
- } else {
- d = f.actor_for_post;
- d !== 0 && !d && (d = null);
- var g = b("MParent").bySigil(c, "story-div"),
- h = null;
- if (g) {
- g = b("MLegacyDataStore").get(g).linkdata;
- if (g && b("gkx")("816008")) {
- var j;
- h = (j = {}, j[k] = g, j)
- }
- }
- j = Object.assign({}, (g = {}, g[b("ActorURI").PARAMETER_ACTOR] = d, g.ft_ent_identifier = e, g.reaction_type = a, g.feedback_source = new(i || (i = b("URI")))(c.getAttribute("data-uri")).getQueryData().feedback_source, g), h);
- b("MUFIRequest").send(e, b("MUFIReactionsUtils").getReactionData(f, a), b("XUFIReactionController").getURIBuilder().getURI(), j, b("MUFIReactionsUtils").getConfigForBackgroundRetry(e))
- }
- };
- c.removeActive = function () {
- var a = this.active;
- if (a) {
- this.active = null;
- a.removeAttribute("data-active");
- a = a.parentElement;
- a && a.classList.remove("mReactionInAnimation")
- }
- };
- c.applyMultilineFlyout = function () {
- var a = this.flyout,
- c = a.getContext();
- c = b("MParent").bySigil(c, "mufi-inline");
- a = a.getContentRoot();
- c = b("DOM").scry(c, "div", "reactions-bling-bar");
- if (c.length == 0) {
- b("CSS").addClass(a, "_5xu1");
- return
- }
- c = c[0].getBoundingClientRect().height;
- c > j ? b("CSS").addClass(a, "_5xu0") : c < j ? b("CSS").addClass(a, "_5xu1") : (b("CSS").removeClass(a, "_5xu0"), b("CSS").removeClass(a, "_5xu1"))
- };
- c.showOverlay = function (a) {
- var c = this.overlay;
- if (c && a) {
- b("CSS").show(a);
- for (var d in c) {
- var e = c[d];
- e != a && e != c.container && b("CSS").hide(e)
- }
- }
- };
- c.log = function (a) {
- var c = b("MLiveData").get(b("MLegacyDataStore").get(this.flyout.getContext()).feedbackTarget).getData(),
- d = c.ft_ent_identifier;
- c = c.viewerreaction;
- var e = this.timing,
- f = e.touchEndTime,
- g = e.touchStartTime;
- e = e.shownTime;
- if (!f || !g || !e) return;
- f = f - g;
- b("BanzaiLogger").log("UserReactionsLoggerConfig", {
- feedback_id: d,
- final_reaction: a.finalReaction || c,
- initial_reaction: c,
- "interface": "mTouch",
- long_press_duration: f > 0 ? f : 0,
- time_spent: Date.now() - e,
- via_scrubbing: a.viaScrubbing
- })
- };
- c.createUFIOverlay = function () {
- var a = this.flyout.getContext(),
- c = b("MLegacyDataStore").get(a),
- d = c.feedbackTarget;
- c = c.isComment;
- d = (d = b("MLiveData").get(d).getData().supportedreactions) != null ? d : this.getSupportedReactions();
- var e = document.createElement("div");
- e.style.display = "none";
- e.className = "_403o";
- d = Math.round(d.length * 1.3);
- for (var f = 0; f < d; ++f) {
- var g = document.createElement("div");
- g.className = "_403p";
- e.appendChild(g).className = "_403p"
- }
- g = document.createElement("div");
- g.style.display = "none";
- g.className = "_5xu2";
- g.textContent = h._("Tap to Pick Your Reaction").toString();
- f = document.createElement("div");
- f.style.display = "none";
- f.className = "_5xu2";
- f.textContent = h._("Slide Finger Across").toString();
- d = document.createElement("div");
- d.style.display = "none";
- d.className = "_5xu2";
- d.textContent = h._("Release to Cancel").toString();
- var i = document.createElement("div");
- i.className = "_403n";
- c && b("CSS").addClass(i, "_31ru");
- i.appendChild(e);
- i.appendChild(d);
- (this.isUpdatedDock || c) && (i.appendChild(g), i.appendChild(f));
- c = b("MParent").bySigil(a, "ufi-inline-actions");
- c || (c = b("MParent").bySigil(a, "ufi-inline-comment-actions"));
- c ? (c.insertBefore(i, c.firstChild), this.overlay = {
- container: i,
- tap: g,
- slide: f,
- release: d,
- dots: e
- }) : this.overlay = null
- };
- c.removeUFIOverlay = function () {
- var a = this.overlay;
- if (a) {
- a = a.container;
- a.parentNode && a.parentNode.removeChild(a);
- this.overlay = null
- }
- };
- c.getSupportedReactions = function () {
- return [1, 2, 4, 3, 7, 8, 16]
- };
- c.setSupported = function () {
- var a = b("MLegacyDataStore").get(this.flyout.getContext());
- a = (a = b("MLiveData").get(a.feedbackTarget).getData().supportedreactions) != null ? a : this.getSupportedReactions();
- var c = this.reactionElements;
- for (var d = 0, e = c.length; d < e; ++d) {
- var f = c[d],
- g = b("MLegacyDataStore").get(f);
- g = g.reaction;
- b("CSS").conditionShow(f, a.indexOf(g) >= 0)
- }
- };
- c.setNUXTooltip = function (a) {
- this.nuxTooltip = a
- };
- return a
- }(),
- p;
- function a(a) {
- p = new o(a)
- }
- function c(a) {
- if (p) {
- p.addAnchor(a);
- return
- }
- n.push(a)
- }
- function d(a) {
- m = a, p && p.setNUXTooltip(a)
- }
- }), null);
- __d("MSiteMessengerDiodeTypedLogger", ["Banzai", "GeneratedLoggerUtils"], (function (a, b, c, d, e, f) {
- "use strict";
- a = function () {
- function a() {
- this.$1 = {}
- }
- var c = a.prototype;
- c.log = function (a) {
- b("GeneratedLoggerUtils").log("logger:MSiteMessengerDiodeLoggerConfig", this.$1, b("Banzai").BASIC, a)
- };
- c.logVital = function (a) {
- b("GeneratedLoggerUtils").log("logger:MSiteMessengerDiodeLoggerConfig", this.$1, b("Banzai").VITAL, a)
- };
- c.logImmediately = function (a) {
- b("GeneratedLoggerUtils").log("logger:MSiteMessengerDiodeLoggerConfig", this.$1, {
- signal: !0
- }, a)
- };
- c.clear = function () {
- this.$1 = {};
- return this
- };
- c.getData = function () {
- return babelHelpers["extends"]({}, this.$1)
- };
- c.updateData = function (a) {
- this.$1 = babelHelpers["extends"]({}, this.$1, a);
- return this
- };
- c.setBadgeCount = function (a) {
- this.$1.badge_count = a;
- return this
- };
- c.setEvent = function (a) {
- this.$1.event = a;
- return this
- };
- c.setMessagingEntryPoint = function (a) {
- this.$1.messaging_entry_point = a;
- return this
- };
- c.setMsiteDiodeStateFromClient = function (a) {
- this.$1.msite_diode_state_from_client = a;
- return this
- };
- return a
- }();
- c = {
- badge_count: !0,
- event: !0,
- messaging_entry_point: !0,
- msite_diode_state_from_client: !0
- };
- e.exports = a
- }), null);
- __d("ShareMenuTypedLogger", ["Banzai", "GeneratedLoggerUtils"], (function (a, b, c, d, e, f) {
- "use strict";
- a = function () {
- function a() {
- this.$1 = {}
- }
- var c = a.prototype;
- c.log = function (a) {
- b("GeneratedLoggerUtils").log("logger:ShareMenuLoggerConfig", this.$1, b("Banzai").BASIC, a)
- };
- c.logVital = function (a) {
- b("GeneratedLoggerUtils").log("logger:ShareMenuLoggerConfig", this.$1, b("Banzai").VITAL, a)
- };
- c.logImmediately = function (a) {
- b("GeneratedLoggerUtils").log("logger:ShareMenuLoggerConfig", this.$1, {
- signal: !0
- }, a)
- };
- c.clear = function () {
- this.$1 = {};
- return this
- };
- c.getData = function () {
- return babelHelpers["extends"]({}, this.$1)
- };
- c.updateData = function (a) {
- this.$1 = babelHelpers["extends"]({}, this.$1, a);
- return this
- };
- c.setAPIError = function (a) {
- this.$1.api_error = a;
- return this
- };
- c.setAppID = function (a) {
- this.$1.appid = a;
- return this
- };
- c.setAppversion = function (a) {
- this.$1.appversion = a;
- return this
- };
- c.setClienttime = function (a) {
- this.$1.clienttime = a;
- return this
- };
- c.setComposerSessionID = function (a) {
- this.$1.composer_session_id = a;
- return this
- };
- c.setCountry = function (a) {
- this.$1.country = a;
- return this
- };
- c.setDeviceid = function (a) {
- this.$1.deviceid = a;
- return this
- };
- c.setErrorCode = function (a) {
- this.$1.error_code = a;
- return this
- };
- c.setErrorMsg = function (a) {
- this.$1.error_msg = a;
- return this
- };
- c.setExtraClientData = function (a) {
- this.$1.extra_client_data = a;
- return this
- };
- c.setFbAudience = function (a) {
- this.$1.fb_audience = a;
- return this
- };
- c.setFbEntryPoint = function (a) {
- this.$1.fb_entry_point = a;
- return this
- };
- c.setFbShareType = function (a) {
- this.$1.fb_share_type = a;
- return this
- };
- c.setFbSignificance = function (a) {
- this.$1.fb_significance = a;
- return this
- };
- c.setName = function (a) {
- this.$1.name = a;
- return this
- };
- c.setOrcaEntryPoint = function (a) {
- this.$1.orca_entry_point = a;
- return this
- };
- c.setOrcaSignificance = function (a) {
- this.$1.orca_significance = a;
- return this
- };
- c.setSessionid = function (a) {
- this.$1.sessionid = a;
- return this
- };
- c.setShareButtonType = function (a) {
- this.$1.share_button_type = a;
- return this
- };
- c.setShareMenuOptionsAvailable = function (a) {
- this.$1.share_menu_options_available = b("GeneratedLoggerUtils").serializeVector(a);
- return this
- };
- c.setShareSourceFeedType = function (a) {
- this.$1.share_source_feed_type = a;
- return this
- };
- c.setShareSuggestionBadgeText = function (a) {
- this.$1.share_suggestion_badge_text = a;
- return this
- };
- c.setShareSuggestionBadgeType = function (a) {
- this.$1.share_suggestion_badge_type = a;
- return this
- };
- c.setShareSuggestionPosition = function (a) {
- this.$1.share_suggestion_position = a;
- return this
- };
- c.setShareSuggestionRecipientID = function (a) {
- this.$1.share_suggestion_recipient_id = a;
- return this
- };
- c.setShareSuggestionThreadID = function (a) {
- this.$1.share_suggestion_thread_id = a;
- return this
- };
- c.setShareSuggestionThreadType = function (a) {
- this.$1.share_suggestion_thread_type = a;
- return this
- };
- c.setShareSuggestionType = function (a) {
- this.$1.share_suggestion_type = a;
- return this
- };
- c.setShareableID = function (a) {
- this.$1.shareable_id = a;
- return this
- };
- c.setStoryID = function (a) {
- this.$1.story_id = a;
- return this
- };
- return a
- }();
- c = {
- api_error: !0,
- appid: !0,
- appversion: !0,
- clienttime: !0,
- composer_session_id: !0,
- country: !0,
- deviceid: !0,
- error_code: !0,
- error_msg: !0,
- extra_client_data: !0,
- fb_audience: !0,
- fb_entry_point: !0,
- fb_share_type: !0,
- fb_significance: !0,
- name: !0,
- orca_entry_point: !0,
- orca_significance: !0,
- sessionid: !0,
- share_button_type: !0,
- share_menu_options_available: !0,
- share_source_feed_type: !0,
- share_suggestion_badge_text: !0,
- share_suggestion_badge_type: !0,
- share_suggestion_position: !0,
- share_suggestion_recipient_id: !0,
- share_suggestion_thread_id: !0,
- share_suggestion_thread_type: !0,
- share_suggestion_type: !0,
- shareable_id: !0,
- story_id: !0
- };
- e.exports = a
- }), null);
- __d("calculateShareSignificance", [], (function (a, b, c, d, e, f) {
- "use strict";
- var g = 5;
- a = function (a) {
- if (!a) return "no_text";
- var b = new Set();
- (a || "").toLowerCase().split(" ").forEach(function (a) {
- return b.add(a)
- });
- return b.size > g ? "significant" : "not_significant"
- };
- b = a;
- e.exports = b
- }), null);
- __d("getShareAudienceFromPrivacyString", [], (function (a, b, c, d, e, f) {
- "use strict";
- a = function (a) {
- switch (a) {
- case null:
- case void 0:
- case "unknown":
- return "unknown";
- case "286958161406148":
- return "self";
- case "300645083384735":
- return "everyone";
- case "368493386561757":
- case "275425949243301":
- return "fof";
- case "123780391104836":
- case "291667064279714":
- return "friends";
- default:
- return "custom"
- }
- };
- b = a;
- e.exports = b
- }), null);
- __d("MFeedShareAnalytics", ["MSiteMessengerDiodeTypedLogger", "MarauderLogger", "ShareMenuTypedLogger", "Stratcom", "calculateShareSignificance", "getShareAudienceFromPrivacyString"], (function (a, b, c, d, e, f) {
- "use strict";
- var g = "feed_share_action";
- a = {
- _listeners: [],
- _initShareMode: null,
- _currentShareMode: null,
- _entryPointFromShareMode: function (a) {
- switch (a) {
- case "friend":
- return "share_to_friend_timeline";
- case "group":
- return "share_to_group";
- case "message":
- return "send_in_message";
- case "oneclick":
- return "share_now";
- case "own":
- case "self":
- return "write_post";
- case "page":
- case "selfpage":
- return "page";
- case "whatsapp_message":
- return "send_in_whatsapp";
- default:
- return "unknown"
- }
- },
- init: function () {
- this._cleanupListeners(), this._registerListeners(), this._initShareMode = null, this._currentShareMode = null
- },
- _onTearDown: function () {
- this._currentShareMode && this.onShareAbandoned()
- },
- _registerListeners: function () {
- var a = this;
- this._listeners.push(b("Stratcom").listen("m:sharemode:selected", null, function (b) {
- b = b.getData();
- b && b.sharemode && (a._currentShareMode = b.sharemode)
- }));
- this._listeners.push(b("Stratcom").listen("m:page:unload", null, function () {
- a._onTearDown()
- }))
- },
- _cleanupListeners: function () {
- this._onTearDown();
- while (this._listeners.length > 0) {
- var a = this._listeners.pop();
- a && a.remove && a.remove()
- }
- },
- onMenuOpened: function () {
- this._initShareMode = null, this._currentShareMode = null, new(b("ShareMenuTypedLogger"))().setName(g).setFbShareType("share_flow_started").log()
- },
- onMenuOptionSelected: function (a, c, d, e) {
- this._initShareMode = a;
- this._currentShareMode = a;
- var f = this._entryPointFromShareMode(a);
- new(b("ShareMenuTypedLogger"))().setName(g).setFbShareType("share_option_selected").setFbEntryPoint(f).log();
- a === "message" && new(b("MSiteMessengerDiodeTypedLogger"))().setMessagingEntryPoint("feed_story_share_as_message").log();
- c === 60 && this._logWatchGrowthOutboundSharing(a, d, e)
- },
- _logWatchGrowthOutboundSharing: function (a, c, d) {
- var e = null;
- switch (a) {
- case "message":
- e = "messenger";
- break;
- case "whatsapp_message":
- e = "whatsapp";
- break;
- case "moreoptions":
- e = "unknown";
- break
- }
- if (e != null) {
- a = c.startsWith("/") ? "https://www.facebook.com" + c : c;
- c = {
- destination: e,
- is_watch_eligible: 1,
- source: "Watch",
- target_id: d,
- target_type: "post",
- url: a
- };
- b("MarauderLogger").log("watch_growth_outbound_share", void 0, c)
- }
- },
- _getShareTextArea: function () {
- var a = document.getElementById("share_msg_input");
- return a instanceof HTMLTextAreaElement ? a : null
- },
- _getAudienceFromCurrentState: function () {
- var a = document.getElementsByName("privacyx")[1];
- if (!a || !(a instanceof HTMLInputElement)) return "unknown";
- switch (this._currentShareMode) {
- case "friend":
- return "friend_timeline";
- case "group":
- return "group";
- case "message":
- return "messenger";
- case "page":
- case "selfpage":
- return "page";
- case "self":
- case "own":
- return b("getShareAudienceFromPrivacyString")(a.value);
- default:
- return "unknown"
- }
- },
- onShareAbandoned: function () {
- var a = null,
- c = null,
- d = null;
- if (this._initShareMode) {
- a = this._entryPointFromShareMode(this._initShareMode);
- var e = this._getShareTextArea();
- e && (c = b("calculateShareSignificance")(e.value));
- d = this._getAudienceFromCurrentState()
- }
- new(b("ShareMenuTypedLogger"))().setName(g).setFbShareType("share_abandoned").setFbEntryPoint(a).setFbAudience(d).setFbSignificance(c).log();
- this._initShareMode = null;
- this._currentShareMode = null
- }
- };
- e.exports = a
- }), null);
- __d("XStoryChevronController", ["XController"], (function (a, b, c, d, e, f) {
- e.exports = b("XController").create("/story_chevron_menu/", {
- feedobjects_identifiers: {
- type: "String"
- },
- feed_context: {
- type: "String"
- },
- chevron_button_id: {
- type: "String"
- },
- story_node_id: {
- type: "String"
- },
- zombie_story: {
- type: "String"
- },
- is_menu_registered: {
- type: "Bool",
- defaultValue: !1
- },
- outer_story_token: {
- type: "String"
- },
- show_report_ad_only: {
- type: "Bool",
- defaultValue: !1
- },
- group_id: {
- type: "Int"
- }
- })
- }), null);
- __d("MAsyncChevronMenu", ["cx", "$", "CSS", "DOM", "MLegacyDataStore", "MParent", "MRequest", "MTouchClick", "ODS", "Stratcom", "SubscriptionsHandler", "XStoryChevronController", "requireWeak"], (function (a, b, c, d, e, f, g) {
- f.init = a;
- f.replaceChevronTrigger = c;
- f.closeLoadingFlyout = d;
- var h = null;
- b("requireWeak")("MHideStoryActions", function (a) {
- return h = a
- });
- var i, j, k, l, m, n, o, p;
- function q(a) {
- a = b("MParent").bySigil(a, "story-popup-metadata");
- return a
- }
- function r() {
- b("ODS").bumpEntityKey(2966, "mtouch_async_chevron", "chevron_clicked");
- var a = this.getCausalElement(),
- c = b("MLegacyDataStore").get(a),
- d = q(a),
- e = b("XStoryChevronController").getURIBuilder().setBool("is_menu_registered", !!(h && h.getActionBubble())).setInt("group_id", p).getURI();
- e = new(b("MRequest"))(e);
- l && b("CSS").show(l);
- m && b("CSS").hide(m);
- n && b("CSS").hide(n);
- i = d;
- e.setMethod("POST");
- e.setData({
- feedobjects_identifiers: c.feedobjectsIdentifiers,
- feed_context: c.feedContext,
- zombie_story: c.zombieStoryURI ? c.zombieStoryURI : "",
- story_node_id: d && d.id,
- chevron_button_id: a.id,
- outer_story_token: c.outerStoryToken ? c.outerStoryToken : "",
- show_report_ad_only: o
- });
- e.listen("error", function (a) {
- b("ODS").bumpEntityKey(2966, "mtouch_async_chevron", "request_failed"), l && b("CSS").hide(l), a == "status=0" ? (b("ODS").bumpEntityKey(2966, "mtouch_async_chevron", "request_failed_no_internet_connection"), m && b("CSS").show(m), n && b("CSS").hide(n)) : (b("ODS").bumpEntityKey(2966, "mtouch_async_chevron", "request_failed_server_side_error"), n && b("CSS").show(n), m && b("CSS").hide(m))
- });
- e.listen("done", function () {
- b("ODS").bumpEntityKey(2966, "mtouch_async_chevron", "request_done")
- });
- e.send()
- }
- function s() {
- k && (k.release(), k = null), j = null, l = null, m = null, n = null
- }
- function t() {
- if (j) {
- var a = j.getContentRoot();
- l = b("DOM").find(a, "div", "loadingWrapper");
- m = b("DOM").find(a, "div", "noConnectionWrapper");
- n = b("DOM").find(a, "div", "requestErrorWrapper")
- }
- }
- function a(a, c, d) {
- j && (j.destroy(), s()), j = a, o = c, p = d, t(), k = new(b("SubscriptionsHandler"))(), k.addSubscriptions(j.addListener("beforeshow", r, j), b("Stratcom").listen("m:page:unload", null, s), b("Stratcom").listen("m:story:action-bubble-initialized", null, function (a) {
- a = a.getData();
- a.menuNubID && u(b("$")(a.menuNubID), a.wasOpen)
- }))
- }
- function u(a, c) {
- if (!j || !(j.isShown() || c)) return;
- if (!h || !h.getActionBubble()) return;
- j.hide();
- c = q(a);
- if (i == c) {
- c = a.getElementsByClassName("_4s19")[0];
- b("MTouchClick").click(c)
- }
- }
- function c(a, c, d, e, f) {
- b("DOM").replace(b("$")(c), a), f || u(a, !1)
- }
- function d(a) {
- (!i || i.id == a) && (j && j.hide(), i = null)
- }
- }), null);
- __d("ExternalShareTrackingEventFalcoEvent", ["FalcoLoggerInternal", "getFalcoLogPolicy_DO_NOT_USE"], (function (a, b, c, d, e, f) {
- "use strict";
- a = b("getFalcoLogPolicy_DO_NOT_USE")("1743606");
- c = b("FalcoLoggerInternal").create("external_share_tracking_event", a);
- e.exports = c
- }), null);
- __d("ExternalShareTracker", ["ExternalShareTrackingConfig", "ExternalShareTrackingEventFalcoEvent", "Random", "gkx"], (function (a, b, c, d, e, f) {
- "use strict";
- f.maybeAppendTrackingParam = a;
- f._shouldAppendExternalShareParam = g;
- f._genExternalTrackingID = h;
- f._logData = i;
- function a(a, c, d, e) {
- if (!g()) return a;
- a = a.addQueryData((a = {}, a[b("ExternalShareTrackingConfig").shareParam] = h(), a));
- i(a, c, d, e);
- return a
- }
- function g() {
- return b("gkx")("1136644")
- }
- function h() {
- var a = "",
- c = b("ExternalShareTrackingConfig").characterSet,
- d = c.length;
- for (var e = 0; e < b("ExternalShareTrackingConfig").idSize; e++) a += c.charAt(b("Random").uint32() % d);
- return a
- }
- function i(a, c, d, e) {
- var f = {
- url: a.toString(),
- entry_point: c,
- content_location: d,
- intent: e
- };
- b("ExternalShareTrackingEventFalcoEvent").log(function () {
- return f
- })
- }
- }), null);
- __d("MCompositionShareFields", [], (function (a, b, c, d, e, f) {
- a = Object.freeze({
- ID: "ID",
- APP_ID: "APP_ID",
- INTERNAL_EXTRA: "INTERNAL_EXTRA",
- FEEDBACK_SOURCE: "FEEDBACK_SOURCE",
- DISABLED_LINKS: "DISABLED_LINKS",
- SHARE_URI: "SHARE_URI",
- LINK_NO_CHANGE: "LINK_NO_CHANGE",
- MSITE_PHOTO_URL: "MSITE_PHOTO_URL",
- MSITE_VIDEO_URL: "MSITE_VIDEO_URL",
- ATTACHMENT_ID: "ATTACHMENT_ID"
- });
- e.exports = a
- }), null);
- __d("MShareToWhatsapp", ["URI", "goURI"], (function (a, b, c, d, e, f) {
- "use strict";
- f.sendToWhatsapp = a;
- var g, h = "https://api.whatsapp.com/send";
- f.WhatsappSendApiString = h;
- var i = "text";
- f.WhatsappSendApiParam = i;
- function a(a) {
- a = new(g || (g = b("URI")))(h).addQueryData(i, a);
- b("goURI")(a)
- }
- }), null);
- __d("XFbWatchShorturlCreateAsyncController", ["XController"], (function (a, b, c, d, e, f) {
- e.exports = b("XController").create("/create_fbwatch_short_url/", {})
- }), null);
- __d("XMessengerMSiteShareDialogController", ["XController"], (function (a, b, c, d, e, f) {
- e.exports = b("XController").create("/share/diode/", {
- feedback_referrer: {
- type: "String"
- },
- feedback_source: {
- type: "Int"
- },
- internal_preview_image_id: {
- type: "Int"
- },
- key_link: {
- type: "String"
- },
- key_mode: {
- type: "String"
- },
- messaging_entry_point: {
- type: "Enum",
- enumType: 1
- },
- post_fbid: {
- type: "Int",
- required: !0
- },
- redirector_fbid: {
- type: "Int"
- }
- })
- }), null);
- __d("MShareFlyout", ["cx", "fbt", "DOM", "ExternalShareTracker", "MComposerEntry", "MComposition", "MCompositionShareFields", "MFeedShareAnalytics", "MLegacyDataStore", "MModalDialog", "MParent", "MRequest", "MShareToWhatsapp", "MViewport", "NTAnnounceSubscription", "Stratcom", "URI", "Vector", "XFbWatchShorturlCreateAsyncController", "XMessengerMSiteShareDialogController", "clearTimeout", "ge", "gkx", "setTimeoutAcrossTransitions"], (function (a, b, c, d, e, f, g, h) {
- "use strict";
- var i, j = "mufi-inline",
- k = "oneClickShareResult",
- l = 6e3,
- m = "page_share_content_action",
- n = "/a/sharer.php",
- o = "/sharer-dialog.php",
- p, q, r, s, t, u, v, w, x = {},
- y = {},
- z = [],
- A, B, C, D, E, F, G, H, I;
- function a(a, c, d, e, f) {
- if (p) return;
- Z();
- A = c;
- p = a;
- q = a.getRoot();
- B = d;
- c = e || {};
- G = c.bluebarNoOverlapBuffer;
- F = e.shareOptionOrder;
- b("MModalDialog").init();
- b("MFeedShareAnalytics").init();
- aa(f)
- }
- function c(a) {
- return
- }
- function J(a, c) {
- c === void 0 && (c = null), b("MFeedShareAnalytics").onMenuOptionSelected(a, u, c, s), H = !0
- }
- function K(a) {
- b("MModalDialog").isOpen() ? b("MModalDialog").load(a) : b("MModalDialog").open(a, L)
- }
- function L(a) {
- !!a && a.canceled && b("MFeedShareAnalytics").onShareAbandoned()
- }
- function M() {
- var a = new(b("MRequest"))(n);
- a.setMethod("POST");
- a.addData({
- m: "oneclick",
- privacyx: A,
- sid: s,
- shareID: s,
- fs: u,
- fr: v,
- internal_preview_image_id: r,
- should_share_post: E,
- direct: !0,
- _ft_: w
- });
- a.send();
- J("oneclick");
- p.hide()
- }
- function N() {
- if (B) {
- var a = {};
- a.ID = s;
- a.FEEDBACK_SOURCE = u;
- a[b("MCompositionShareFields").FEEDBACK_REFERRER] = v;
- var c = {};
- c.composer_type = "share";
- c.composertitle = h._("Share");
- c.contextualmessage = h._("Share on your timeline");
- c.placeholder = h._("Write something...");
- c.disable_photos = !0;
- var d = b("MViewport").getScrollTop();
- b("MComposerEntry").invoke(new(b("MComposition"))().setStoreData("CONFIG", c).setStoreData("SHARE", a))["finally"](function () {
- return b("MViewport").scrollTo(0, d)
- })
- } else K(new(i || (i = b("URI")))(o).setQueryData({
- fs: u,
- fr: v,
- sid: s,
- _ft_: w,
- internal_preview_image_id: r
- }).toString()), J("self"), p.hide()
- }
- function O(a) {
- K(new(i || (i = b("URI")))(o).setQueryData({
- fs: u,
- fr: v,
- m: a,
- sid: s,
- _ft_: w,
- internal_preview_image_id: r,
- selected_page_id: D
- }).toString()), J(a), p.hide()
- }
- function P() {
- var a = b("XMessengerMSiteShareDialogController").getURIBuilder().setString("feedback_referrer", v).setInt("feedback_source", u).setInt("internal_preview_image_id", r).setString("key_link", window.location.href).setString("key_mode", "message").setInt("post_fbid", s).setInt("redirector_fbid", C).setEnum("messaging_entry_point", "feed_story_share_as_message").getURI();
- new(b("MRequest"))(a).send();
- J("message", t);
- p.hide()
- }
- function Q() {
- var a = new(i || (i = b("URI")))(t);
- if (t.startsWith("/")) {
- var c, d = "scmts",
- e = "scwspsdd";
- a = new(i || (i = b("URI")))("https://www.facebook.com" + t).addQueryData((c = {}, c[d] = e, c))
- }
- d = b("ExternalShareTracker").maybeAppendTrackingParam(a, "sdd", u, "share_to_whatsapp").toString();
- u === 60 && b("gkx")("1059928") ? W(t, "w", a.toString(), R) : R(d, a.toString())
- }
- function R(a, c) {
- b("MShareToWhatsapp").sendToWhatsapp(a), J("whatsapp_message", c), p.hide()
- }
- function S(a) {
- if (typeof navigator.share !== "function") {
- p.hide();
- return
- }
- t = U(t);
- u === 60 && b("gkx")("1059928") ? W(t, null, t, T) : T(t, t)
- }
- function T(a, b) {
- a = {
- url: a
- };
- navigator.share(a).then(function () {})["catch"](function (a) {});
- J("moreoptions", b);
- p.hide()
- }
- function U(a) {
- a += a.includes("?") ? "&" : "?";
- a += "sfnsm=mo";
- return a
- }
- function V(a, b) {
- a += a.includes("?") ? "&" : "?";
- a += "vh=e&s=" + C;
- b && (a += "&d=" + b);
- return a
- }
- function W(a, c, d, e) {
- a = V(a, c);
- c = b("XFbWatchShorturlCreateAsyncController").getURIBuilder().getURI();
- a = {
- destination_url: encodeURIComponent(a)
- };
- c = new(b("MRequest"))(c).setMethod("POST");
- c.setData(a);
- c.listen("done", function (a) {
- a = (a = a.payload) != null ? a : d;
- e(a, d)
- });
- c.send()
- }
- function X(a, c) {
- a = c && c.is_comment_share;
- c = ["share-more-options-button", "share-in-a-group-button", "share-to-page-button", "share-with-message-button"];
- a && !x[s] ? (Y("share-one-click-button", !1), Y("share-post-one-click-button", !1)) : E ? (Y("share-one-click-button", !1), c.push("share-post-one-click-button")) : (c.push("share-one-click-button"), Y("share-post-one-click-button", !1));
- a = p.getContext();
- c = a != null ? b("MLegacyDataStore").get(a).is_acting_as_page : I;
- if (c) {
- a = ["share-to-page-button"];
- F.map(function (a) {
- return Y(a, !1)
- });
- a.map(function (a) {
- return Y(a, !0)
- })
- } else F.map(function (a) {
- return Y(a, !0)
- })
- }
- function d(a) {
- var c = p.getContext();
- c != null ? (b("MLegacyDataStore").set(c, {
- is_acting_as_page: a
- }), I = null) : I = a
- }
- function Y(a, b) {
- a = document.getElementById(a);
- a !== null && (a.style.display = b ? "" : "none")
- }
- function aa(a) {
- var c;
- z = [p.addListener("beforeshow", function () {
- if (G != null) {
- var c = b("MViewport").getScrollTop();
- c < G && b("ge")("header") ? p.setAutoflipTopOffset(G - c) : p.setAutoflipTopOffset(0)
- }
- c = p.getContext();
- var d = b("MLegacyDataStore").get(c);
- E = d.reshare_post;
- s = d && d.share_id;
- u = d && d.feedback_source;
- v = d && d.feedback_referrer;
- r = d && d.internal_preview_image_id;
- t = d && d.shareable_uri;
- C = d && d.user_id;
- var e = b("MParent").bySigil(c, "story-div");
- a ? w = a : w = e ? b("MLegacyDataStore").get(e).linkdata : null;
- s && (x[s] = ba(c));
- I != null && (b("MLegacyDataStore").set(c, {
- is_acting_as_page: I
- }), I = null);
- b("MFeedShareAnalytics").onMenuOpened();
- H = !1;
- X(q, d)
- }), p.addListener("hide", function () {
- H || b("MFeedShareAnalytics").onShareAbandoned()
- }), (c = b("Stratcom")).listen("click", "share-one-click-button", M), c.listen("click", "share-post-one-click-button", M), c.listen("click", "share-with-message-button", N), c.listen("click", "share-in-a-private-message-button", P), c.listen("click", "share-to-whatsapp", Q), c.listen("click", "share-to-page-button", function () {
- O("page")
- }), c.listen("click", "share-in-a-group-button", function () {
- O("group")
- }), c.listen("click", "share-more-options-button", function () {
- S(t)
- }), c.listen("m:page:unload", null, Z), b("NTAnnounceSubscription").subscribe(m, function (a) {
- a = JSON.parse(a), s = a.content_id, D = a.page_id, O("page")
- })]
- }
- function Z() {
- p = null;
- for (var a in y) b("clearTimeout")(y[a]);
- y = {};
- while (z.length) {
- var c = z.pop();
- c && c.remove && c.remove()
- }
- }
- function ba(a) {
- if (!a || a === document || a instanceof DocumentFragment) return null;
- return b("Stratcom").hasSigil(a, j) ? a : b("MParent").bySigil(a, j)
- }
- function $(a, c) {
- var d = b("DOM").scry(a, "div", k);
- d[0] && b("DOM").remove(d[0]);
- d = b("DOM").create("div", {
- className: "_4_m7"
- }, c);
- b("Stratcom").addSigil(d, k);
- b("DOM").appendContent(a, d);
- return d
- }
- function f(c, a) {
- var d = x[a];
- delete x[a];
- if (!d) return;
- var e = $(d, c);
- c = b("Vector").getPos(d);
- d = b("Vector").getDim(d).y;
- var f = b("MViewport").getScrollTop(),
- g = b("MViewport").getScrollHeight();
- (c.y < f || c.y + d > f + g) && b("MViewport").scrollTo(c.x, c.y - 250);
- y[a] = b("setTimeoutAcrossTransitions")(function () {
- delete y[a], b("DOM").remove(e)
- }, l)
- }
- function g(c, a) {
- var d = x[a];
- delete x[a];
- if (!d) return;
- if (b("Vector").getPos(d).y >= b("MViewport").getScrollTop()) {
- var e = $(d, c);
- y[a] = b("setTimeoutAcrossTransitions")(function () {
- delete y[a], b("Vector").getPos(d).y >= b("MViewport").getScrollTop() && b("DOM").remove(e)
- }, l)
- }
- }
- a = {
- init: a,
- initMisinfo: c,
- onSuccess: g,
- onFailure: f,
- setIsActingAsPage: d
- };
- e.exports = a
- }), null);
- __d("MLayerDestroyOnTransition", ["Stratcom"], (function (a, b, c, d, e, f) {
- a = function () {
- function a(a) {
- this.$1 = null, this.$2 = a
- }
- var c = a.prototype;
- c.enable = function () {
- this.$1 = b("Stratcom").listen("m:page:unload", null, this.$2.destroy.bind(this.$2))
- };
- c.disable = function () {
- this.$1 && this.$1.remove(), this.$1 = null
- };
- return a
- }();
- e.exports = a
- }), null);
- __d("MLayerHideOnCloseClick", ["DOM"], (function (a, b, c, d, e, f) {
- a = function () {
- "use strict";
- function a(a) {
- this.$1 = null, this.$2 = null, this.$3 = a
- }
- var c = a.prototype;
- c.enable = function () {
- this.$1 = [this.$3.addListener("show", this.$4.bind(this)), this.$3.addListener("hide", this.$5.bind(this))], this.$3.isShown() && this.$4()
- };
- c.disable = function () {
- this.$5();
- while (this.$1.length) this.$1.pop().remove();
- this.$1 = null
- };
- c.$5 = function () {
- this.$2 && this.$2.remove()
- };
- c.$4 = function () {
- this.$2 = b("DOM").listen(this.$3.getRoot(), "click", "mlayer-hide-on-click", this.$3.hide.bind(this.$3))
- };
- return a
- }();
- e.exports = a
- }), null);
- __d("MLayerHideOnTouch", ["CancelableEventListener", "TouchEventType"], (function (a, b, c, d, e, f) {
- a = function () {
- "use strict";
- function a(a) {
- this.$1 = null, this.$2 = a
- }
- var c = a.prototype;
- c.enable = function () {
- this.$1 = [this.$2.addListener("show", this.$3.bind(this)), this.$2.addListener("hide", this.$4.bind(this))], this.$2.isShown() && this.$3()
- };
- c.disable = function () {
- this.$4();
- while (this.$1.length) this.$1.pop().remove();
- this.$1 = null
- };
- c.$4 = function () {
- this.$5 && this.$5.remove(), this.$5 = null
- };
- c.$3 = function () {
- var a = this;
- this.$5 = b("CancelableEventListener").listen(document.body, b("TouchEventType").START, null, function (b) {
- a.$2.getContentRoot().contains(b.getTarget()) || (a.$2.hide(), b.prevent())
- })
- };
- return a
- }();
- e.exports = a
- }), null);
- __d("MUFIComposerFocus", ["DOM", "MLegacyDataStore", "MParent", "Parent", "Stratcom"], (function (a, b, c, d, e, f) {
- "use strict";
- f.isComposerFocusTrigger = a;
- f.init = c;
- var g = "mufi-composer-focus",
- h;
- function i(a) {
- a = a;
- var b = a.parentNode,
- c = [];
- while (b) c.unshift(a), a = b, b = a.parentNode;
- return c
- }
- function j(a, b) {
- var c = Math.min(a.length, b.length) - 1;
- for (var c = c; c >= 0; c--)
- if (a[c] === b[c]) return c;
- return -1
- }
- function k(a) {
- if (!a) return null;
- var c = b("MParent").bySigil(a, "story-div") || b("MParent").bySigil(a, "snowflake-root") || b("MParent").bySigil(a, "notes-root");
- if (!c) return null;
- c = b("DOM").scry(c, "*", "mufi-composer").filter(function (a) {
- return !b("MParent").bySigil(a, "m-inline-reply-composer")
- });
- if (c.length === 1) return c[0];
- var d = i(a);
- a = c.reduce(function (a, b, c) {
- c = i(b);
- c = j(d, c);
- return c >= a[0] ? [c, b] : a
- }, [-1, null]);
- return a[1]
- }
- function l(a) {
- var b = a.getNode(g);
- if (!(b instanceof HTMLElement)) return;
- b = k(b);
- b && (a.prevent(), b.focus())
- }
- function a(a) {
- if (!a || !h) return !1;
- a = b("Stratcom").hasSigil(a, g) ? a : b("MParent").bySigil(a, g);
- return !!k(a)
- }
- function m(a) {
- a = a.getNode(g);
- if (!(a instanceof HTMLElement)) return;
- var c = k(a);
- if (c) {
- var d = b("MParent").bySigil(a, "touchable");
- d && (b("MLegacyDataStore").get(d).nativeClick = !0);
- d = b("Parent").byTag(a, "a");
- d instanceof HTMLAnchorElement && (d.href = "#" + b("DOM").uniqID(c))
- }
- }
- function c() {
- h || (b("Stratcom").listen("touchstart", g, m), b("Stratcom").listen("click", g, l), h = !0)
- }
- d = function () {
- return h
- };
- f.isInitialized = d
- }), null);
- __d("MUFILikeButton", ["cx", "ActorURI", "CSS", "Event", "FBLogger", "MLegacyDataStore", "MLiveData", "MParent", "MUFIReactionsUtils", "MUFIRequest", "Stratcom", "SubscriptionsHandler", "emptyFunction"], (function (a, b, c, d, e, f, g) {
- var h = {
- is_like: 1
- },
- i = {
- is_like: 0
- };
- a = function () {
- function a(a, c, d, e) {
- var f = this;
- this.onChange = function () {
- var a = f.$2.getData();
- if (a.request_id === f.$6) return;
- a = a.has_viewer_liked;
- b("CSS").conditionClass(f.$1, "_77la", a);
- b("Stratcom").removeSigil(f.$1, a ? "like" : "unlike");
- b("Stratcom").addSigil(f.$1, a ? "unlike" : "like")
- };
- this.onKeyPress = function (a) {
- (a.code === "Enter" || a.code === "Space") && f.onClick(a)
- };
- this.onMouseUp = function (a) {
- a.srcElement instanceof HTMLElement && a.srcElement.blur()
- };
- this.onUnload = function () {
- f.$3.release(), f.$3 = null
- };
- this.$1 = a;
- this.$2 = b("MLiveData").get(c);
- this.$4 = c;
- this.$5 = d || {
- log: b("emptyFunction")
- };
- this.$6 = e;
- this.$7 = b("MUFIReactionsUtils").getConfigForBackgroundRetry(c);
- this.$3 = new(b("SubscriptionsHandler"))();
- this.$3.addSubscriptions(b("Event").listen(this.$1, "click", this.onClick.bind(this)), b("Event").listen(this.$1, "keypress", this.onKeyPress.bind(this)), b("Event").listen(this.$1, "mouseup", this.onMouseUp.bind(this)), this.$2.listen("change", this.onChange.bind(this)), b("Stratcom").listen("m:page:unload", null, this.onUnload.bind(this)))
- }
- var c = a.prototype;
- c.getFeedbackData = function () {
- var a = this.$2.getData(),
- b = a.has_viewer_liked,
- c = b ? a.like_count - 1 : a.like_count + 1,
- d = a.reduced_like_count;
- isNaN(d) || (d = c.toString());
- return {
- has_viewer_liked: !b,
- like_count: c,
- like_counts: [a.like_counts[1] || null, a.like_counts[0]],
- like_friend_sentences: [a.like_friend_sentences[1] || null, a.like_friend_sentences[0]],
- like_sentences: [a.like_sentences[1] || null, a.like_sentences[0]],
- reduced_like_count: d
- }
- };
- c.getRequestData = function () {
- return null
- };
- c.onClick = function (a) {
- a.preventDefault();
- a = a.target;
- if (!a || !(a instanceof Element)) return;
- a = b("MUFIRequest").getURI(a.getAttribute("href") || a.getAttribute("data-uri"));
- this.$2.getData().has_viewer_liked ? (a.addQueryData("ul", !0), a.removeQueryData("reaction_type")) : a.removeQueryData(["ul", "reaction_type"]);
- var c = b("MParent").bySigil(this.$1, "feed-ufi-metadata");
- if (c) {
- c = b("MLegacyDataStore").get(c).actor_id;
- c && (a = b("ActorURI").create(a, String(c)))
- } else b("FBLogger")("mobile_web_ufi", "feed_ufi_metadata_missing").warn("Actor ID data store not available. Making request without actor id.");
- b("MUFIRequest").send(this.$4, this.getFeedbackData(), a, this.getRequestData(), this.$7);
- this.$5.log("like", void 0, this.$2.getData().has_viewer_liked ? i : h)
- };
- return a
- }();
- e.exports = a
- }), null);
- __d("XCIXActorFeatureLimitNoticeController", ["XController"], (function (a, b, c, d, e, f) {
- e.exports = b("XController").create("/feature_limit_notice/", {
- sentry_category: {
- type: "Enum",
- required: !0,
- enumType: 1
- }
- })
- }), null);
- __d("MUFIReactionButton", ["cx", "fbt", "CSS", "DOM", "MLiveData", "MPageController", "MUFILikeButton", "MUFIReactionsUtils", "Stratcom", "Style", "UFIReactionIcons", "UFIReactionTypes", "XCIXActorFeatureLimitNoticeController", "createIxElement"], (function (a, b, c, d, e, f, g, h) {
- var i = 1,
- j = 0,
- k = 16;
- a = function (a) {
- babelHelpers.inheritsLoose(c, a);
- function c(c, d, e, f, g, j, l, m) {
- var n;
- n = a.call(this, c, d, e, f) || this;
- n.onChange = function () {
- var a = n.$MUFIReactionButton2.getData();
- if (a.request_id === n.$MUFIReactionButton4) return;
- var c, d;
- a = a.viewerreaction;
- var e = !!a;
- a && !b("UFIReactionTypes").reactions[a] && (a = null);
- if (!a) c = "inherit", d = h._("Like");
- else {
- var f = null;
- if (a !== i) {
- var g = b("UFIReactionIcons")[a][n.$MUFIReactionButton5];
- g || (g = b("UFIReactionIcons")[a][k]);
- f = b("createIxElement")(g);
- b("CSS").addClass(f, "_4h-b")
- }
- c = b("UFIReactionTypes").reactions[a].color;
- g = b("UFIReactionTypes").reactions[a].display_name;
- d = [f, g]
- }
- b("DOM").setContent(n.$MUFIReactionButton1, d);
- n.$MUFIReactionButton1.setAttribute("aria-pressed", e);
- b("CSS").conditionClass(n.$MUFIReactionButton1, "_77ld", e && a !== i);
- b("CSS").conditionClass(n.$MUFIReactionButton1, "_77la", e && a === i);
- b("Style").set(n.$MUFIReactionButton1, "color", c);
- b("Stratcom").removeSigil(n.$MUFIReactionButton1, e ? "like" : "unlike");
- b("Stratcom").addSigil(n.$MUFIReactionButton1, e ? "unlike" : "like");
- b("Stratcom").invoke("ufi/reactionButtonClicked", null, n.getRequestData())
- };
- n.$MUFIReactionButton1 = c;
- n.$MUFIReactionButton2 = b("MLiveData").get(d);
- n.$MUFIReactionButton3 = d;
- n.$MUFIReactionButton4 = f;
- n.$MUFIReactionButton5 = g || k;
- n.$MUFIReactionButton6 = m || {
- has_active_feature_limit_notice: !1
- };
- c.href && c.setAttribute("data-uri", c.href);
- c.removeAttribute("href");
- return n
- }
- var d = c.prototype;
- d.getFeedbackData = function () {
- var a = this.$MUFIReactionButton2.getData();
- return b("MUFIReactionsUtils").getReactionData(a, a.has_viewer_liked || a.viewerreaction ? j : i)
- };
- d.getRequestData = function () {
- var a = this.$MUFIReactionButton2.getData(),
- b = a.has_viewer_liked || a.viewerreaction;
- return {
- reaction_type: b ? j : i,
- ft_ent_identifier: a.ft_ent_identifier
- }
- };
- d.onClick = function (c) {
- if (this.$MUFIReactionButton6.has_active_feature_limit_notice) {
- var d = b("XCIXActorFeatureLimitNoticeController").getURIBuilder().setEnum("sentry_category", "like_add").getURI();
- b("MPageController").load(d);
- return
- }
- if (b("Stratcom").hasSigil(this.$MUFIReactionButton1, "kaios-like-react-trigger")) {
- d = this.$MUFIReactionButton2.getData();
- d.viewerreaction && c.stopPropagation()
- }
- a.prototype.onClick.call(this, c)
- };
- return c
- }(b("MUFILikeButton"));
- e.exports = a
- }), null);
- __d("MFlyoutAutoFlip", ["MParent", "MViewport"], (function (a, b, c, d, e, f) {
- a = function () {
- "use strict";
- function a(a) {
- this.$1 = null, this.$2 = a
- }
- var c = a.prototype;
- c.enable = function () {
- this.$1 = this.$2.addListener("adjust", this.$3.bind(this)), this.$2.isShown() && this.$2.updatePosition()
- };
- c.disable = function () {
- this.$1.remove(), this.$1 = null, this.$2.isShown() && this.$2.updatePosition()
- };
- c.$3 = function (a) {
- var c = this.$4(a),
- d = {
- top: this.$2.getAutoflipTopOffset() || 0,
- bottom: b("MViewport").getUseableHeight()
- },
- e = b("MParent").bySigil(this.$2.getRoot(), "scroll-area");
- if (e) {
- e = e.getBoundingClientRect();
- d = {
- top: Math.max(e.top, d.top),
- bottom: Math.min(e.bottom, d.bottom)
- }
- }
- var f, g, h = this.$2;
- e = h.getContext();
- e = e.getBoundingClientRect();
- for (f = 0; f < c.length; f++) {
- a.setPosition(c[f]);
- g = h.simulateOrientation(a, function () {
- return h.getRoot().firstChild.getBoundingClientRect()
- });
- var i = e.top + a.getOffsetY();
- a.getPosition() === "above" ? i -= g.height : a.getPosition() === "below" && (i += e.height);
- i = {
- top: i,
- bottom: i + g.height
- };
- if (i.top >= d.top && i.bottom <= d.bottom) return
- }
- a.setPosition(c.indexOf("below") > -1 ? "below" : c[0])
- };
- c.$4 = function (a) {
- return [a.getPosition(), a.getOppositePosition()]
- };
- return a
- }();
- e.exports = a
- }), null);
- __d("MFlyoutContextSigil", ["DOM", "MLegacyDataStore", "Stratcom", "err"], (function (a, b, c, d, e, f) {
- var g = {};
- a = function () {
- "use strict";
- function a(a) {
- this.$1 = null, this.$2 = a
- }
- var c = a.prototype;
- c.enable = function () {
- var a = this.$3();
- g[a];
- g[a] = this.$2;
- this.$1 = b("Stratcom").listen("click", this.$3(), this.$4.bind(this))
- };
- c.disable = function () {
- delete g[this.$3()], this.$1.remove(), this.$1 = null, this.$2 = null
- };
- c.$3 = function () {
- var a = this.$2.config;
- return a.causalSigil || a.contextSigil
- };
- c.$4 = function (a) {
- var c = a.getNode(this.$3()),
- d, e = this.$2.config.contextSigil,
- f = this.$2.config.causalSigil;
- if (f && f !== e) {
- f = c;
- while (f && f !== document.body && !d)
- if (b("Stratcom").hasSigil(f, e)) d = f;
- else {
- var g = b("DOM").scry(f, "*", e);
- d = g[0];
- f = f.parentNode
- }
- } else d = c;
- if (this.$2.getContext() !== d && this.$2.isShown()) {
- this.$2.hide();
- if (!this.$2) return
- }
- this.$2.setCausalElement(c);
- this.$2.setContext(d);
- b("MLegacyDataStore").get(c).flyout = this.$2;
- this.$2.isShown() || this.$2.show();
- a.prevent()
- };
- return a
- }();
- e.exports = a
- }), null);
Recent Pastes