Skip to content

Instantly share code, notes, and snippets.

@mickeypash
Created May 7, 2016 21:35
Show Gist options
  • Save mickeypash/1ae5a651ac4ea0b19abef7256d4e2cba to your computer and use it in GitHub Desktop.
Save mickeypash/1ae5a651ac4ea0b19abef7256d4e2cba to your computer and use it in GitHub Desktop.
This is the javascript process running the web client for whatsapp
This file has been truncated, but you can view the full file.
/*! Copyright (c) 2015 WhatsApp Inc. All Rights Reserved. */
webpackJsonp([84], [, function(e, t, r) {
"use strict";
function n() {
return u[Math.round(Math.random() * (u.length - 1))]
}
function o() {
this.logs = [], this.localCursor = 0, this.pending = void 0, this.timer = new d(this, this.persistIdb)
}
function i(e) {
return this.writeLine(e, !1), _.noop
}
function a(e) {
return this.writeLine(e, !0), _.noop
}
var s = r(6),
d = r(54),
c = 250,
u = "LTSXOo+_*-=.<^!#?".split(""),
l = n() + n() + n() + n();
o.prototype.writeLine = function(e, t) {
e = t ? e : e ? e.toString().substring(0, c) : e;
var r = l + " " + moment().locale("en").format("YYYY-MM-DD HH:mm:ss: ") + e;
this.persist(r)
}, o.prototype.logColor = function(e, t) {
return i.call(this, t)
}, o.prototype.log = i, o.prototype.logVerbose = a, o.prototype.info = i, o.prototype.infoVerbose = a, o.prototype.warn = i, o.prototype.warnVerbose = a, o.prototype.error = i, o.prototype.errorVerbose = a, o.prototype.trace = function(e) {
var t = new Error(e);
return this.errorVerbose(t.stack)(t), e
}, o.prototype.persist = function(e) {
this.logs.push(e), this.logs.length > s.LOG_SIZE && (this.logs.shift(), this.localCursor--), this.timer.debounceAndCap(250, 1e3)
}, o.prototype.persistIdb = function() {
var e = this,
t = r(26),
n = this.logs.slice(Math.max(this.localCursor, 0), this.logs.length);
n.length && (this.pending = t.idb().then(function(t) {
return t.transaction("rw", t.logs, function() {
var r = void 0,
o = e.getCursor();
return _.forEach(n, function(e, n) {
r = (o + n) % s.LOG_SIZE, t.logs.put({
line: r,
log: e
})
}), r
})
}).then(function(t) {
e.localCursor += n.length, e.setCursor(t)
})["catch"](function(e) {})["finally"](function() {
e.pending = void 0
}))
}, o.prototype.clearLogs = function() {
var e = r(26);
e.idb().then(function(e) {
e.logs["delete"]()
})["catch"](_.noop), this.setCursor(0), this.localCursor = 0, this.logs = []
}, o.prototype.getLogs = function() {
var e = this,
t = r(26),
n = [this.pending];
return 0 !== this.timer.ts && (this.timer.trigger(), n.push(this.pending)), Promise.all(n).then(function() {
return t.idb()
}).then(function(e) {
return e.logs.orderBy("line").toArray()
}).then(function(t) {
var r = e.getCursor(),
n = r < t.length - 1 ? t.slice(r, t.length) : [],
o = t.slice(0, r);
return _.pluck(n.concat(o), "log")
})["catch"](function() {
return e.logs
})
}, o.prototype.getCursor = function() {
var e = r(26);
try {
return JSON.parse(e.permanentStorage.getItem(s.KEY_LOG_CURSOR)) || Math.max(this.localCursor, 0)
} catch (t) {
return Math.max(this.localCursor, 0)
}
}, o.prototype.setCursor = function(e) {
var t = r(26);
return t.permanentStorage.setItem(s.KEY_LOG_CURSOR, e)
}, o.prototype.exportToWindow = function(e, t) {}, o.prototype.assert = function(e, t, r) {
if (e) return _.noop;
var n = new Error("AssertError " + t + ": " + r);
return _.defer(function() {
throw n
}), this.error("Assertion Failed! " + t + " (" + e + " not truthy): " + r)
}, e.exports = new o
}, , , , , function(e, t, r) {
"use strict";
var n = r(367);
["webkitGetUserMedia"].forEach(function(e) {
var t = Object.getPrototypeOf(navigator)[e];
t && navigator[e] !== t && (navigator[e] = t)
}), window.URL = window.URL || window.webkitURL, window.AudioContext = window.AudioContext || window.webkitAudioContext, navigator.getUserMedia = navigator.getUserMedia || navigator.mozGetUserMedia || navigator.webkitGetUserMedia, window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
var o = {
MAX_GROUP_SIZE: 101,
MAX_SUBJECT_LENGTH: 25,
IMG_MAX_EDGE: 1600,
IMG_MAX_BYTES: 5242880,
IMG_THUMB_MAX_EDGE: 100,
MAX_MEDIA_UPLOAD_SIZE: 16777216,
BROWSER_CAPABILITY: {
getRandomValues: !(!window.crypto || !window.crypto.getRandomValues),
localstorage: !!window.localStorage,
sessionstorage: !!window.sessionStorage,
indexeddb: !!window.indexedDB,
url: !!window.URL,
websocket: !!window.WebSocket,
worker: !!window.Worker
},
BROWSER_TYPE: {
CHROME: "chrome",
CHROMIUM: "chromium",
FIREFOX: "firefox",
SAFARI: "safari",
IE: "ie",
OPERA: "opera",
EDGE: "edge"
},
BROWSER_LINK: {
CHROME: '<a href="https://www.google.com/chrome">Google Chrome</a>',
FIREFOX: '<a href="http://www.firefox.com">Mozilla Firefox</a>',
OPERA: '<a href="http://www.opera.com">Opera</a>'
},
OS_TYPE: {
WINDOWS: "windows",
MAC: "mac os",
CHROMEOS: "chromium os"
},
LATEST_HASH: "0bd93306a9783f3c8d64b619572ec8e89b1ec84f",
VERSION: {
p: 0,
s: 2,
t: 532
},
VERSION_BASE: "0.2.532",
VERSION_STR: "0.2.532",
CLB_URL: "https://web-crashlog.whatsapp.net/upload.php",
PREVIEW_WINDOW: "preview-window",
UPLOAD_SELECT: "upload-select",
CURRENT_LOCATION_ICON: "https://maps.gstatic.com/mapfiles/ms2/micons/blue-dot.png",
CURRENT_LOCATION_SHADOW: "https://maps.gstatic.com/mapfiles/ms2/micons/msmarker.shadow.png",
GROUP_DEFAULT_ICON: r(452),
USER_DEFAULT_ICON: r(453),
NOTIFICATION_PROMPT_DELAY: 1e4,
NOTIFICATION_TIMEOUT: 5e3,
CALL_NOTIFICATION_TIMEOUT: 45e3,
NOTIFICATION_TONE_PATH: "/assets/notification.mp3",
IDLE_TIMEOUT: 6e4,
IDLE_TIMEOUT_WAIT: 78e4,
PING_INTERVAL: 24e4,
ACK_TIMEOUT: 8e3,
RETRY_TIMESTEP: 20500,
SEND_UNAVAILABLE_WAIT: 15e3,
SEND_PAUSED_WAIT: 2500,
CLEAR_CHAT_DIRTY_WAIT: 2500,
MAX_RETRY_GENERATION: 4,
GIVE_UP_WAIT: 12e4,
LOG_UPLOAD_INTERVAL: 36e5,
EMOJI_SYNC_DELAY: 3e4,
MAX_TXT_MSG_SIZE: 65536,
DRAG_TYPE_FILE: "Files",
DRAG_TYPE_LOCAL_IMAGE: "drag_type_local_image",
NUM_COLORS: 20,
KEY_STORAGE_TEST: "storage_test",
KEY_CLIENT_TOKEN: "WAToken1",
KEY_SERVER_TOKEN: "WAToken2",
KEY_SECRET: "WASecretKey",
KEY_SECRET_BUNDLE: "WASecretBundle",
KEY_BROWSER_ID: "WABrowserId",
KEY_GEOCODER_LOCATION: "WAGeocoderLocation",
KEY_GROUP_ASSIGNED_COLOR: "WAGroupAssignedColor",
KEY_GMAPS_OVER_LIMIT: "WAGmapsOverLimit",
KEY_GLOBAL_MUTE_SOUNDS: "WAGlobalSounds",
KEY_GLOBAL_MUTE_NOTIFICATIONS: "WAGlobalNotifications",
KEY_GLOBAL_MUTE_PREVIEWS: "WAGlobalPreviews",
KEY_LANG: "WALangPref",
KEY_LAST_ACTIVE_EMOJI_TAB: "WALastActiveEmojiTab",
KEY_UNKNOWN_ID: "WAUnknownID",
KEY_VERSION: "WAVersion",
KEY_LOAD_RETRY_GENERATION: "WALoadRetryGeneration",
KEY_REMEMBER_ME: "remember-me",
KEY_LOGOUT_TOKEN: "logout-token",
KEY_OLD_LOGOUT_CREDS: "old-logout-cred",
KEY_NO_TAKEOVER: "no-takeover",
KEY_WHATSAPP_MUTEX: "whatsapp-mutex",
KEY_WHATSAPP_LS_VERSION: "ver",
KEY_LOCAL_TAKEOVER_OK: "local-takeover-ok",
KEY_WAM_BUFFER: "wam-buffer",
KEY_WAM_INFO: "wam-info",
COOKIE_REF: "ref",
COOKIE_TOK: "tok",
PAGE_SIZE: 50,
MSG_PRELOAD_THRESHOLD: 20,
SCROLL_FUDGE: 100,
MIN_PIC_SIDE: 192,
MAX_PIC_SIDE: 640,
PROF_PIC_THUMB_SIDE: 96,
MAX_CAPTION_LENGTH: 1024,
MAX_VCARD_PHOTO_SIDE: 64,
EMOJI_PANEL_HEIGHT: 222,
GROUP_SET_PIC_CONTEXT: "group",
GROUP_CREATE_PIC_CONTEXT: "create_group",
PROFILE_PIC_CONTEXT: "profile",
PERMISSION_ALLOWED: "granted",
PERMISSION_DEFAULT: "default",
PERMISSION_DENIED: "denied",
PRESENCE_COMPOSING_TIMEOUT: 25e3,
PRESENCE_RESEND_WAIT: 1e4,
PTT_CANCEL_AREA: 300,
PTT_TIME_CHECK: 1,
PTT_TIME_CANCEL: .75,
CANCEL_ANIMATION_DURATION: 2700,
MIMETYPE_OGG: "audio/ogg",
IMAGE_MIMES: "image/*",
VIDEO_MIMES: "video/*",
DOC_MIMES: "application/pdf",
SEARCH_ANIMATION_DURATION: 150,
SLIDEDOWN_DURATION: 100,
CSS_TRANSITION_DURATION: 1,
EARTH_RADIUS: 6378137,
LOG_SIZE: 4999,
KEY_LOG_CURSOR: "debugCursor",
MAX_STATUS_LENGTH: 139,
QR_EDGE: 240,
FILE_ERROR_MISSING: "File missing.",
FILE_ERROR_SIZE: "File size is too large.",
FILE_ERROR_TYPE: "File type is invalid.",
FILE_ERROR_MIN_DIM: "File dimensions are too small.",
DISP_TYPE: {
CONVERSATION: "conversation",
MSG_INFO: "msg_info",
STARRED_MSGS: "starred_msgs"
},
GMAPS_OVER_LIMIT_DURATION: 14400,
ACK_ERROR: -1,
ACK_PENDING: 0,
ACK_SERVER: 1,
ACK_DEVICE: 2,
ACK_READ: 3,
ACK_PLAYED: 4,
BATTERY_LOW_THRESHOLD_1: 15,
BATTERY_LOW_THRESHOLD_2: 5,
BATTERY_DELAY: 1e4,
WAM_MAX_BUFFER_SIZE: 5e4,
NUX: {
SAFARI_LIMITED_SUPPORT: "safari_limited_support"
},
COLLECTION_HAS_SYNCED: "collection_has_synced",
DIAGNOSTIC_DELAY: 18e3,
ONE_BY_ONE_TRANS_GIF: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
};
for (var i in n) n.hasOwnProperty(i) && (o[i] = n[i]);
e.exports = o
}, function(e, t, r) {
(function(e) {
/**
* @license ByteBuffer.js (c) 2013-2014 Daniel Wirtz <dcode@dcode.io>
* This version of ByteBuffer.js uses an ArrayBuffer (AB) as its backing buffer and is compatible with modern browsers.
* Released under the Apache License, Version 2.0
* see: https://github.com/dcodeIO/ByteBuffer.js for details
*/
! function(t) {
"use strict";
function n(e) {
var t = function(e, n, o) {
if ("undefined" == typeof e && (e = t.DEFAULT_CAPACITY), "undefined" == typeof n && (n = t.DEFAULT_ENDIAN), "undefined" == typeof o && (o = t.DEFAULT_NOASSERT), !o) {
if (e = 0 | e, 0 > e) throw new RangeError("Illegal capacity: 0 <= " + e);
if ("boolean" != typeof n) throw new TypeError("Illegal littleEndian: Not a boolean");
if ("boolean" != typeof o) throw new TypeError("Illegal noAssert: Not a boolean")
}
this.buffer = 0 === e ? r : new ArrayBuffer(e), this.view = 0 === e ? null : new DataView(this.buffer), this.offset = 0, this.markedOffset = -1, this.limit = e, this.littleEndian = "undefined" != typeof n ? !!n : !1, this.noAssert = !!o
};
t.VERSION = "3.1.0", t.LITTLE_ENDIAN = !0, t.BIG_ENDIAN = !1, t.DEFAULT_CAPACITY = 16, t.DEFAULT_ENDIAN = t.BIG_ENDIAN, t.DEFAULT_NOASSERT = !1, t.Long = e || null;
var r = new ArrayBuffer(0);
t.allocate = function(e, r, n) {
return new t(e, r, n)
}, t.concat = function(e, r, n, o) {
"boolean" != typeof r && "string" == typeof r || (o = n, n = r, r = void 0);
for (var i, a = 0, s = 0, d = e.length; d > s; ++s) t.isByteBuffer(e[s]) || (e[s] = t.wrap(e[s], r)), i = e[s].limit - e[s].offset, i > 0 && (a += i);
if (0 === a) return new t(0, n, o);
var c, u = new t(a, n, o),
l = new Uint8Array(u.buffer);
for (s = 0; d > s;) c = e[s++], i = c.limit - c.offset, 0 >= i || (l.set(new Uint8Array(c.buffer).subarray(c.offset, c.limit), u.offset), u.offset += i);
return u.limit = u.offset, u.offset = 0, u
}, t.isByteBuffer = function(e) {
return e && e instanceof t
}, t.type = function() {
return ArrayBuffer
}, t.wrap = function(e, r, n, o) {
if ("string" != typeof r && (o = n, n = r, r = void 0), "string" == typeof e) switch ("undefined" == typeof r && (r = "utf8"), r) {
case "base64":
return t.fromBase64(e, n);
case "hex":
return t.fromHex(e, n);
case "binary":
return t.fromBinary(e, n);
case "utf8":
return t.fromUTF8(e, n);
case "debug":
return t.fromDebug(e, n);
default:
throw new TypeError("Unsupported encoding: " + r)
}
if (null === e || "object" != typeof e) throw new TypeError("Illegal buffer: null or non-object");
var a;
if (t.isByteBuffer(e)) return a = t.prototype.clone.call(e), a.markedOffset = -1, a;
if (e instanceof Uint8Array) a = new t(0, n, o), e.length > 0 && (a.buffer = e.buffer, a.offset = e.byteOffset, a.limit = e.byteOffset + e.length, a.view = e.length > 0 ? new DataView(e.buffer) : null);
else if (e instanceof ArrayBuffer) a = new t(0, n, o), e.byteLength > 0 && (a.buffer = e, a.offset = 0, a.limit = e.byteLength, a.view = e.byteLength > 0 ? new DataView(e) : null);
else {
if ("[object Array]" !== Object.prototype.toString.call(e)) throw new TypeError("Illegal buffer");
for (a = new t(e.length, n, o), a.limit = e.length, i = 0; i < e.length; ++i) a.view.setUint8(i, e[i])
}
return a
}, t.prototype.writeInt8 = function(e, t) {
var r = "undefined" == typeof t;
if (r && (t = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal value: " + e + " (not an integer)");
if (e |= 0, "number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal offset: " + t + " (not an integer)");
if (t >>>= 0, 0 > t || t + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
}
t += 1;
var n = this.buffer.byteLength;
return t > n && this.resize((n *= 2) > t ? n : t), t -= 1, this.view.setInt8(t, e), r && (this.offset += 1), this
}, t.prototype.writeByte = t.prototype.writeInt8, t.prototype.readInt8 = function(e) {
var t = "undefined" == typeof e;
if (t && (e = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal offset: " + e + " (not an integer)");
if (e >>>= 0, 0 > e || e + 1 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
}
var r = this.view.getInt8(e);
return t && (this.offset += 1), r
}, t.prototype.readByte = t.prototype.readInt8, t.prototype.writeUint8 = function(e, t) {
var r = "undefined" == typeof t;
if (r && (t = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal value: " + e + " (not an integer)");
if (e >>>= 0, "number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal offset: " + t + " (not an integer)");
if (t >>>= 0, 0 > t || t + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
}
t += 1;
var n = this.buffer.byteLength;
return t > n && this.resize((n *= 2) > t ? n : t), t -= 1, this.view.setUint8(t, e), r && (this.offset += 1), this
}, t.prototype.readUint8 = function(e) {
var t = "undefined" == typeof e;
if (t && (e = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal offset: " + e + " (not an integer)");
if (e >>>= 0, 0 > e || e + 1 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
}
var r = this.view.getUint8(e);
return t && (this.offset += 1), r
}, t.prototype.writeInt16 = function(e, t) {
var r = "undefined" == typeof t;
if (r && (t = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal value: " + e + " (not an integer)");
if (e |= 0, "number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal offset: " + t + " (not an integer)");
if (t >>>= 0, 0 > t || t + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
}
t += 2;
var n = this.buffer.byteLength;
return t > n && this.resize((n *= 2) > t ? n : t), t -= 2, this.view.setInt16(t, e, this.littleEndian), r && (this.offset += 2), this
}, t.prototype.writeShort = t.prototype.writeInt16, t.prototype.readInt16 = function(e) {
var t = "undefined" == typeof e;
if (t && (e = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal offset: " + e + " (not an integer)");
if (e >>>= 0, 0 > e || e + 2 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
}
var r = this.view.getInt16(e, this.littleEndian);
return t && (this.offset += 2), r
}, t.prototype.readShort = t.prototype.readInt16, t.prototype.writeUint16 = function(e, t) {
var r = "undefined" == typeof t;
if (r && (t = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal value: " + e + " (not an integer)");
if (e >>>= 0, "number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal offset: " + t + " (not an integer)");
if (t >>>= 0, 0 > t || t + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
}
t += 2;
var n = this.buffer.byteLength;
return t > n && this.resize((n *= 2) > t ? n : t), t -= 2, this.view.setUint16(t, e, this.littleEndian), r && (this.offset += 2), this
}, t.prototype.readUint16 = function(e) {
var t = "undefined" == typeof e;
if (t && (e = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal offset: " + e + " (not an integer)");
if (e >>>= 0, 0 > e || e + 2 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
}
var r = this.view.getUint16(e, this.littleEndian);
return t && (this.offset += 2), r
}, t.prototype.writeInt32 = function(e, t) {
var r = "undefined" == typeof t;
if (r && (t = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal value: " + e + " (not an integer)");
if (e |= 0, "number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal offset: " + t + " (not an integer)");
if (t >>>= 0, 0 > t || t + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
}
t += 4;
var n = this.buffer.byteLength;
return t > n && this.resize((n *= 2) > t ? n : t), t -= 4, this.view.setInt32(t, e, this.littleEndian), r && (this.offset += 4), this
}, t.prototype.writeInt = t.prototype.writeInt32, t.prototype.readInt32 = function(e) {
var t = "undefined" == typeof e;
if (t && (e = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal offset: " + e + " (not an integer)");
if (e >>>= 0, 0 > e || e + 4 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
}
var r = this.view.getInt32(e, this.littleEndian);
return t && (this.offset += 4), r
}, t.prototype.readInt = t.prototype.readInt32, t.prototype.writeUint32 = function(e, t) {
var r = "undefined" == typeof t;
if (r && (t = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal value: " + e + " (not an integer)");
if (e >>>= 0, "number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal offset: " + t + " (not an integer)");
if (t >>>= 0, 0 > t || t + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
}
t += 4;
var n = this.buffer.byteLength;
return t > n && this.resize((n *= 2) > t ? n : t), t -= 4, this.view.setUint32(t, e, this.littleEndian), r && (this.offset += 4), this
}, t.prototype.readUint32 = function(e) {
var t = "undefined" == typeof e;
if (t && (e = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal offset: " + e + " (not an integer)");
if (e >>>= 0, 0 > e || e + 4 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
}
var r = this.view.getUint32(e, this.littleEndian);
return t && (this.offset += 4), r
}, e && (t.prototype.writeInt64 = function(t, r) {
var n = "undefined" == typeof r;
if (n && (r = this.offset), !this.noAssert) {
if ("number" == typeof t) t = e.fromNumber(t);
else if (!(t && t instanceof e)) throw new TypeError("Illegal value: " + t + " (not an integer or Long)");
if ("number" != typeof r || r % 1 !== 0) throw new TypeError("Illegal offset: " + r + " (not an integer)");
if (r >>>= 0, 0 > r || r + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + r + " (+0) <= " + this.buffer.byteLength)
}
"number" == typeof t && (t = e.fromNumber(t)), r += 8;
var o = this.buffer.byteLength;
return r > o && this.resize((o *= 2) > r ? o : r), r -= 8, this.littleEndian ? (this.view.setInt32(r, t.low, !0), this.view.setInt32(r + 4, t.high, !0)) : (this.view.setInt32(r, t.high, !1), this.view.setInt32(r + 4, t.low, !1)), n && (this.offset += 8), this
}, t.prototype.writeLong = t.prototype.writeInt64, t.prototype.readInt64 = function(t) {
var r = "undefined" == typeof t;
if (r && (t = this.offset), !this.noAssert) {
if ("number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal offset: " + t + " (not an integer)");
if (t >>>= 0, 0 > t || t + 8 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
}
var n = this.littleEndian ? new e(this.view.getInt32(t, !0), this.view.getInt32(t + 4, !0), !1) : new e(this.view.getInt32(t + 4, !1), this.view.getInt32(t, !1), !1);
return r && (this.offset += 8), n
}, t.prototype.readLong = t.prototype.readInt64, t.prototype.writeUint64 = function(t, r) {
var n = "undefined" == typeof r;
if (n && (r = this.offset), !this.noAssert) {
if ("number" == typeof t) t = e.fromNumber(t);
else if (!(t && t instanceof e)) throw new TypeError("Illegal value: " + t + " (not an integer or Long)");
if ("number" != typeof r || r % 1 !== 0) throw new TypeError("Illegal offset: " + r + " (not an integer)");
if (r >>>= 0, 0 > r || r + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + r + " (+0) <= " + this.buffer.byteLength)
}
"number" == typeof t && (t = e.fromNumber(t)), r += 8;
var o = this.buffer.byteLength;
return r > o && this.resize((o *= 2) > r ? o : r), r -= 8, this.littleEndian ? (this.view.setInt32(r, t.low, !0), this.view.setInt32(r + 4, t.high, !0)) : (this.view.setInt32(r, t.high, !1), this.view.setInt32(r + 4, t.low, !1)), n && (this.offset += 8), this
}, t.prototype.readUint64 = function(t) {
var r = "undefined" == typeof t;
if (r && (t = this.offset), !this.noAssert) {
if ("number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal offset: " + t + " (not an integer)");
if (t >>>= 0, 0 > t || t + 8 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
}
var n = this.littleEndian ? new e(this.view.getInt32(t, !0), this.view.getInt32(t + 4, !0), !0) : new e(this.view.getInt32(t + 4, !1), this.view.getInt32(t, !1), !0);
return r && (this.offset += 8), n
}), t.prototype.writeFloat32 = function(e, t) {
var r = "undefined" == typeof t;
if (r && (t = this.offset), !this.noAssert) {
if ("number" != typeof e) throw new TypeError("Illegal value: " + e + " (not a number)");
if ("number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal offset: " + t + " (not an integer)");
if (t >>>= 0, 0 > t || t + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
}
t += 4;
var n = this.buffer.byteLength;
return t > n && this.resize((n *= 2) > t ? n : t), t -= 4, this.view.setFloat32(t, e, this.littleEndian), r && (this.offset += 4), this
}, t.prototype.writeFloat = t.prototype.writeFloat32, t.prototype.readFloat32 = function(e) {
var t = "undefined" == typeof e;
if (t && (e = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal offset: " + e + " (not an integer)");
if (e >>>= 0, 0 > e || e + 4 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
}
var r = this.view.getFloat32(e, this.littleEndian);
return t && (this.offset += 4), r
}, t.prototype.readFloat = t.prototype.readFloat32, t.prototype.writeFloat64 = function(e, t) {
var r = "undefined" == typeof t;
if (r && (t = this.offset), !this.noAssert) {
if ("number" != typeof e) throw new TypeError("Illegal value: " + e + " (not a number)");
if ("number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal offset: " + t + " (not an integer)");
if (t >>>= 0, 0 > t || t + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
}
t += 8;
var n = this.buffer.byteLength;
return t > n && this.resize((n *= 2) > t ? n : t), t -= 8, this.view.setFloat64(t, e, this.littleEndian), r && (this.offset += 8), this
}, t.prototype.writeDouble = t.prototype.writeFloat64, t.prototype.readFloat64 = function(e) {
var t = "undefined" == typeof e;
if (t && (e = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal offset: " + e + " (not an integer)");
if (e >>>= 0, 0 > e || e + 8 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
}
var r = this.view.getFloat64(e, this.littleEndian);
return t && (this.offset += 8), r
}, t.prototype.readDouble = t.prototype.readFloat64, t.MAX_VARINT32_BYTES = 5, t.calculateVarint32 = function(e) {
return e >>>= 0, 128 > e ? 1 : 16384 > e ? 2 : 1 << 21 > e ? 3 : 1 << 28 > e ? 4 : 5
}, t.zigZagEncode32 = function(e) {
return ((e |= 0) << 1 ^ e >> 31) >>> 0
}, t.zigZagDecode32 = function(e) {
return e >>> 1 ^ -(1 & e) | 0
}, t.prototype.writeVarint32 = function(e, r) {
var n = "undefined" == typeof r;
if (n && (r = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal value: " + e + " (not an integer)");
if (e |= 0, "number" != typeof r || r % 1 !== 0) throw new TypeError("Illegal offset: " + r + " (not an integer)");
if (r >>>= 0, 0 > r || r + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + r + " (+0) <= " + this.buffer.byteLength)
}
var o, i = t.calculateVarint32(e);
r += i;
var a = this.buffer.byteLength;
return r > a && this.resize((a *= 2) > r ? a : r), r -= i, this.view.setUint8(r, o = 128 | e), e >>>= 0, e >= 128 ? (o = e >> 7 | 128, this.view.setUint8(r + 1, o), e >= 16384 ? (o = e >> 14 | 128, this.view.setUint8(r + 2, o), e >= 1 << 21 ? (o = e >> 21 | 128, this.view.setUint8(r + 3, o), e >= 1 << 28 ? (this.view.setUint8(r + 4, e >> 28 & 15), i = 5) : (this.view.setUint8(r + 3, 127 & o), i = 4)) : (this.view.setUint8(r + 2, 127 & o), i = 3)) : (this.view.setUint8(r + 1, 127 & o), i = 2)) : (this.view.setUint8(r, 127 & o), i = 1), n ? (this.offset += i, this) : i
}, t.prototype.writeVarint32ZigZag = function(e, r) {
return this.writeVarint32(t.zigZagEncode32(e), r)
}, t.prototype.readVarint32 = function(e) {
var t = "undefined" == typeof e;
if (t && (e = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal offset: " + e + " (not an integer)");
if (e >>>= 0, 0 > e || e + 1 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
}
var r, n = 0,
o = 0;
do r = this.view.getUint8(e + n), 5 > n && (o |= (127 & r) << 7 * n >>> 0), ++n; while (128 === (128 & r));
return o = 0 | o, t ? (this.offset += n, o) : {
value: o,
length: n
}
}, t.prototype.readVarint32ZigZag = function(e) {
var r = this.readVarint32(e);
return "object" == typeof r ? r.value = t.zigZagDecode32(r.value) : r = t.zigZagDecode32(r), r
}, e && (t.MAX_VARINT64_BYTES = 10, t.calculateVarint64 = function(t) {
"number" == typeof t && (t = e.fromNumber(t));
var r = t.toInt() >>> 0,
n = t.shiftRightUnsigned(28).toInt() >>> 0,
o = t.shiftRightUnsigned(56).toInt() >>> 0;
return 0 == o ? 0 == n ? 16384 > r ? 128 > r ? 1 : 2 : 1 << 21 > r ? 3 : 4 : 16384 > n ? 128 > n ? 5 : 6 : 1 << 21 > n ? 7 : 8 : 128 > o ? 9 : 10
}, t.zigZagEncode64 = function(t) {
return "number" == typeof t ? t = e.fromNumber(t, !1) : t.unsigned !== !1 && (t = t.toSigned()), t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
}, t.zigZagDecode64 = function(t) {
return "number" == typeof t ? t = e.fromNumber(t, !1) : t.unsigned !== !1 && (t = t.toSigned()), t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
}, t.prototype.writeVarint64 = function(r, n) {
var o = "undefined" == typeof n;
if (o && (n = this.offset), !this.noAssert) {
if ("number" == typeof r) r = e.fromNumber(r);
else if (!(r && r instanceof e)) throw new TypeError("Illegal value: " + r + " (not an integer or Long)");
if ("number" != typeof n || n % 1 !== 0) throw new TypeError("Illegal offset: " + n + " (not an integer)");
if (n >>>= 0, 0 > n || n + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
}
"number" == typeof r ? r = e.fromNumber(r, !1) : r.unsigned !== !1 && (r = r.toSigned());
var i = t.calculateVarint64(r),
a = r.toInt() >>> 0,
s = r.shiftRightUnsigned(28).toInt() >>> 0,
d = r.shiftRightUnsigned(56).toInt() >>> 0;
n += i;
var c = this.buffer.byteLength;
switch (n > c && this.resize((c *= 2) > n ? c : n), n -= i, i) {
case 10:
this.view.setUint8(n + 9, d >>> 7 & 1);
case 9:
this.view.setUint8(n + 8, 9 !== i ? 128 | d : 127 & d);
case 8:
this.view.setUint8(n + 7, 8 !== i ? s >>> 21 | 128 : s >>> 21 & 127);
case 7:
this.view.setUint8(n + 6, 7 !== i ? s >>> 14 | 128 : s >>> 14 & 127);
case 6:
this.view.setUint8(n + 5, 6 !== i ? s >>> 7 | 128 : s >>> 7 & 127);
case 5:
this.view.setUint8(n + 4, 5 !== i ? 128 | s : 127 & s);
case 4:
this.view.setUint8(n + 3, 4 !== i ? a >>> 21 | 128 : a >>> 21 & 127);
case 3:
this.view.setUint8(n + 2, 3 !== i ? a >>> 14 | 128 : a >>> 14 & 127);
case 2:
this.view.setUint8(n + 1, 2 !== i ? a >>> 7 | 128 : a >>> 7 & 127);
case 1:
this.view.setUint8(n, 1 !== i ? 128 | a : 127 & a)
}
return o ? (this.offset += i, this) : i
}, t.prototype.writeVarint64ZigZag = function(e, r) {
return this.writeVarint64(t.zigZagEncode64(e), r)
}, t.prototype.readVarint64 = function(t) {
var r = "undefined" == typeof t;
if (r && (t = this.offset), !this.noAssert) {
if ("number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal offset: " + t + " (not an integer)");
if (t >>>= 0, 0 > t || t + 1 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
}
var n = t,
o = 0,
i = 0,
a = 0,
s = 0;
if (s = this.view.getUint8(t++), o = 127 & s, 128 & s && (s = this.view.getUint8(t++), o |= (127 & s) << 7, 128 & s && (s = this.view.getUint8(t++), o |= (127 & s) << 14, 128 & s && (s = this.view.getUint8(t++), o |= (127 & s) << 21, 128 & s && (s = this.view.getUint8(t++), i = 127 & s, 128 & s && (s = this.view.getUint8(t++), i |= (127 & s) << 7, 128 & s && (s = this.view.getUint8(t++), i |= (127 & s) << 14, 128 & s && (s = this.view.getUint8(t++), i |= (127 & s) << 21, 128 & s && (s = this.view.getUint8(t++), a = 127 & s, 128 & s && (s = this.view.getUint8(t++), a |= (127 & s) << 7, 128 & s)))))))))) throw new Error("Data must be corrupt: Buffer overrun");
var d = e.from28Bits(o, i, a, !1);
return r ? (this.offset = t, d) : {
value: d,
length: t - n
}
}, t.prototype.readVarint64ZigZag = function(r) {
var n = this.readVarint64(r);
return n && n.value instanceof e ? n.value = t.zigZagDecode64(n.value) : n = t.zigZagDecode64(n), n
}), t.prototype.writeCString = function(e, t) {
var r = "undefined" == typeof t;
r && (t = this.offset);
var n, i = e.length;
if (!this.noAssert) {
if ("string" != typeof e) throw new TypeError("Illegal str: Not a string");
for (n = 0; i > n; ++n)
if (0 === e.charCodeAt(n)) throw new RangeError("Illegal str: Contains NULL-characters");
if ("number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal offset: " + t + " (not an integer)");
if (t >>>= 0, 0 > t || t + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
}
var a = t;
i = o.calculateUTF16asUTF8(o.stringSource(e))[1], t += i + 1;
var s = this.buffer.byteLength;
return t > s && this.resize((s *= 2) > t ? s : t), t -= i + 1, o.encodeUTF16toUTF8(o.stringSource(e), function(e) {
this.view.setUint8(t++, e)
}.bind(this)), this.view.setUint8(t++, 0), r ? (this.offset = t - a, this) : i
}, t.prototype.readCString = function(e) {
var t = "undefined" == typeof e;
if (t && (e = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal offset: " + e + " (not an integer)");
if (e >>>= 0, 0 > e || e + 1 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
}
var r, n = e,
i = -1;
return o.decodeUTF8toUTF16(function() {
if (0 === i) return null;
if (e >= this.limit) throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
return 0 === (i = this.view.getUint8(e++)) ? null : i
}.bind(this), r = o.stringDestination(), !0), t ? (this.offset = e, r()) : {
string: r(),
length: e - n
}
}, t.prototype.writeIString = function(e, t) {
var r = "undefined" == typeof t;
if (r && (t = this.offset), !this.noAssert) {
if ("string" != typeof e) throw new TypeError("Illegal str: Not a string");
if ("number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal offset: " + t + " (not an integer)");
if (t >>>= 0, 0 > t || t + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
}
var n, i = t;
n = o.calculateUTF16asUTF8(o.stringSource(e), this.noAssert)[1], t += 4 + n;
var a = this.buffer.byteLength;
if (t > a && this.resize((a *= 2) > t ? a : t), t -= 4 + n, this.view.setUint32(t, n, this.littleEndian), t += 4, o.encodeUTF16toUTF8(o.stringSource(e), function(e) {
this.view.setUint8(t++, e)
}.bind(this)), t !== i + 4 + n) throw new RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
return r ? (this.offset = t, this) : t - i
}, t.prototype.readIString = function(e) {
var t = "undefined" == typeof e;
if (t && (e = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal offset: " + e + " (not an integer)");
if (e >>>= 0, 0 > e || e + 4 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
}
var r, n = 0,
i = e;
n = this.view.getUint32(e, this.littleEndian), e += 4;
var a, s = e + n;
return o.decodeUTF8toUTF16(function() {
return s > e ? this.view.getUint8(e++) : null
}.bind(this), a = o.stringDestination(), this.noAssert), r = a(), t ? (this.offset = e, r) : {
string: r,
length: e - i
}
}, t.METRICS_CHARS = "c", t.METRICS_BYTES = "b", t.prototype.writeUTF8String = function(e, t) {
var r = "undefined" == typeof t;
if (r && (t = this.offset), !this.noAssert) {
if ("number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal offset: " + t + " (not an integer)");
if (t >>>= 0, 0 > t || t + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
}
var n, i = t;
n = o.calculateUTF16asUTF8(o.stringSource(e))[1], t += n;
var a = this.buffer.byteLength;
return t > a && this.resize((a *= 2) > t ? a : t), t -= n, o.encodeUTF16toUTF8(o.stringSource(e), function(e) {
this.view.setUint8(t++, e)
}.bind(this)), r ? (this.offset = t, this) : t - i
}, t.prototype.writeString = t.prototype.writeUTF8String, t.calculateUTF8Chars = function(e) {
return o.calculateUTF16asUTF8(o.stringSource(e))[0]
}, t.calculateUTF8Bytes = function(e) {
return o.calculateUTF16asUTF8(o.stringSource(e))[1]
}, t.prototype.readUTF8String = function(e, r, n) {
"number" == typeof r && (n = r, r = void 0);
var i = "undefined" == typeof n;
if (i && (n = this.offset), "undefined" == typeof r && (r = t.METRICS_CHARS), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal length: " + e + " (not an integer)");
if (e |= 0, "number" != typeof n || n % 1 !== 0) throw new TypeError("Illegal offset: " + n + " (not an integer)");
if (n >>>= 0, 0 > n || n + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
}
var a, s = 0,
d = n;
if (r === t.METRICS_CHARS) {
if (a = o.stringDestination(), o.decodeUTF8(function() {
return e > s && n < this.limit ? this.view.getUint8(n++) : null
}.bind(this), function(e) {
++s, o.UTF8toUTF16(e, a)
}.bind(this)), s !== e) throw new RangeError("Illegal range: Truncated data, " + s + " == " + e);
return i ? (this.offset = n, a()) : {
string: a(),
length: n - d
}
}
if (r === t.METRICS_BYTES) {
if (!this.noAssert) {
if ("number" != typeof n || n % 1 !== 0) throw new TypeError("Illegal offset: " + n + " (not an integer)");
if (n >>>= 0, 0 > n || n + e > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
}
var c = n + e;
if (o.decodeUTF8toUTF16(function() {
return c > n ? this.view.getUint8(n++) : null
}.bind(this), a = o.stringDestination(), this.noAssert), n !== c) throw new RangeError("Illegal range: Truncated data, " + n + " == " + c);
return i ? (this.offset = n, a()) : {
string: a(),
length: n - d
}
}
throw new TypeError("Unsupported metrics: " + r)
}, t.prototype.readString = t.prototype.readUTF8String, t.prototype.writeVString = function(e, r) {
var n = "undefined" == typeof r;
if (n && (r = this.offset), !this.noAssert) {
if ("string" != typeof e) throw new TypeError("Illegal str: Not a string");
if ("number" != typeof r || r % 1 !== 0) throw new TypeError("Illegal offset: " + r + " (not an integer)");
if (r >>>= 0, 0 > r || r + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + r + " (+0) <= " + this.buffer.byteLength)
}
var i, a, s = r;
i = o.calculateUTF16asUTF8(o.stringSource(e), this.noAssert)[1], a = t.calculateVarint32(i), r += a + i;
var d = this.buffer.byteLength;
if (r > d && this.resize((d *= 2) > r ? d : r), r -= a + i, r += this.writeVarint32(i, r), o.encodeUTF16toUTF8(o.stringSource(e), function(e) {
this.view.setUint8(r++, e)
}.bind(this)), r !== s + i + a) throw new RangeError("Illegal range: Truncated data, " + r + " == " + (r + i + a));
return n ? (this.offset = r, this) : r - s
}, t.prototype.readVString = function(e) {
var t = "undefined" == typeof e;
if (t && (e = this.offset), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal offset: " + e + " (not an integer)");
if (e >>>= 0, 0 > e || e + 1 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
}
var r, n = this.readVarint32(e),
i = e;
e += n.length, n = n.value;
var a = e + n,
s = o.stringDestination();
return o.decodeUTF8toUTF16(function() {
return a > e ? this.view.getUint8(e++) : null
}.bind(this), s, this.noAssert), r = s(), t ? (this.offset = e, r) : {
string: r,
length: e - i
}
}, t.prototype.append = function(e, r, n) {
"number" != typeof r && "string" == typeof r || (n = r, r = void 0);
var o = "undefined" == typeof n;
if (o && (n = this.offset), !this.noAssert) {
if ("number" != typeof n || n % 1 !== 0) throw new TypeError("Illegal offset: " + n + " (not an integer)");
if (n >>>= 0, 0 > n || n + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
}
e instanceof t || (e = t.wrap(e, r));
var i = e.limit - e.offset;
if (0 >= i) return this;
n += i;
var a = this.buffer.byteLength;
return n > a && this.resize((a *= 2) > n ? a : n), n -= i, new Uint8Array(this.buffer, n).set(new Uint8Array(e.buffer).subarray(e.offset, e.limit)), e.offset += i, o && (this.offset += i), this
}, t.prototype.appendTo = function(e, t) {
return e.append(this, t), this
}, t.prototype.assert = function(e) {
return this.noAssert = !e, this
}, t.prototype.capacity = function() {
return this.buffer.byteLength
}, t.prototype.clear = function() {
return this.offset = 0, this.limit = this.buffer.byteLength, this.markedOffset = -1, this
}, t.prototype.clone = function(e) {
var r = new t(0, this.littleEndian, this.noAssert);
if (e) {
var n = new ArrayBuffer(this.buffer.byteLength);
new Uint8Array(n).set(this.buffer), r.buffer = n, r.view = new DataView(n)
} else r.buffer = this.buffer, r.view = this.view;
return r.offset = this.offset, r.markedOffset = this.markedOffset, r.limit = this.limit, r
}, t.prototype.compact = function(e, t) {
if ("undefined" == typeof e && (e = this.offset), "undefined" == typeof t && (t = this.limit), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal begin: Not an integer");
if (e >>>= 0, "number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal end: Not an integer");
if (t >>>= 0, 0 > e || e > t || t > this.buffer.byteLength) throw new RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
}
if (0 === e && t === this.buffer.byteLength) return this;
var n = t - e;
if (0 === n) return this.buffer = r, this.view = null, this.markedOffset >= 0 && (this.markedOffset -= e), this.offset = 0, this.limit = 0, this;
var o = new ArrayBuffer(n);
return new Uint8Array(o).set(new Uint8Array(this.buffer).subarray(e, t)), this.buffer = o, this.view = new DataView(o), this.markedOffset >= 0 && (this.markedOffset -= e), this.offset = 0, this.limit = n, this
}, t.prototype.copy = function(e, r) {
if ("undefined" == typeof e && (e = this.offset), "undefined" == typeof r && (r = this.limit), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal begin: Not an integer");
if (e >>>= 0, "number" != typeof r || r % 1 !== 0) throw new TypeError("Illegal end: Not an integer");
if (r >>>= 0, 0 > e || e > r || r > this.buffer.byteLength) throw new RangeError("Illegal range: 0 <= " + e + " <= " + r + " <= " + this.buffer.byteLength)
}
if (e === r) return new t(0, this.littleEndian, this.noAssert);
var n = r - e,
o = new t(n, this.littleEndian, this.noAssert);
return o.offset = 0, o.limit = n, o.markedOffset >= 0 && (o.markedOffset -= e), this.copyTo(o, 0, e, r), o
}, t.prototype.copyTo = function(e, r, n, o) {
var i, a;
if (!this.noAssert && !t.isByteBuffer(e)) throw new TypeError("Illegal target: Not a ByteBuffer");
if (r = (a = "undefined" == typeof r) ? e.offset : 0 | r, n = (i = "undefined" == typeof n) ? this.offset : 0 | n, o = "undefined" == typeof o ? this.limit : 0 | o, 0 > r || r > e.buffer.byteLength) throw new RangeError("Illegal target range: 0 <= " + r + " <= " + e.buffer.byteLength);
if (0 > n || o > this.buffer.byteLength) throw new RangeError("Illegal source range: 0 <= " + n + " <= " + this.buffer.byteLength);
var s = o - n;
return 0 === s ? e : (e.ensureCapacity(r + s), new Uint8Array(e.buffer).set(new Uint8Array(this.buffer).subarray(n, o), r), i && (this.offset += s), a && (e.offset += s), this)
}, t.prototype.ensureCapacity = function(e) {
var t = this.buffer.byteLength;
return e > t ? this.resize((t *= 2) > e ? t : e) : this
}, t.prototype.fill = function(e, t, r) {
var n = "undefined" == typeof t;
if (n && (t = this.offset), "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)), "undefined" == typeof t && (t = this.offset), "undefined" == typeof r && (r = this.limit), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal value: " + e + " (not an integer)");
if (e |= 0, "number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal begin: Not an integer");
if (t >>>= 0, "number" != typeof r || r % 1 !== 0) throw new TypeError("Illegal end: Not an integer");
if (r >>>= 0, 0 > t || t > r || r > this.buffer.byteLength) throw new RangeError("Illegal range: 0 <= " + t + " <= " + r + " <= " + this.buffer.byteLength)
}
if (t >= r) return this;
for (; r > t;) this.view.setUint8(t++, e);
return n && (this.offset = t), this
}, t.prototype.flip = function() {
return this.limit = this.offset, this.offset = 0, this
}, t.prototype.mark = function(e) {
if (e = "undefined" == typeof e ? this.offset : e, !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal offset: " + e + " (not an integer)");
if (e >>>= 0, 0 > e || e + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
}
return this.markedOffset = e, this
}, t.prototype.order = function(e) {
if (!this.noAssert && "boolean" != typeof e) throw new TypeError("Illegal littleEndian: Not a boolean");
return this.littleEndian = !!e, this
}, t.prototype.LE = function(e) {
return this.littleEndian = "undefined" != typeof e ? !!e : !0, this
}, t.prototype.BE = function(e) {
return this.littleEndian = "undefined" != typeof e ? !e : !1, this
}, t.prototype.prepend = function(e, r, n) {
"number" != typeof r && "string" == typeof r || (n = r, r = void 0);
var o = "undefined" == typeof n;
if (o && (n = this.offset), !this.noAssert) {
if ("number" != typeof n || n % 1 !== 0) throw new TypeError("Illegal offset: " + n + " (not an integer)");
if (n >>>= 0, 0 > n || n + 0 > this.buffer.byteLength) throw new RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
}
e instanceof t || (e = t.wrap(e, r));
var i = e.limit - e.offset;
if (0 >= i) return this;
var a, s = i - n;
if (s > 0) {
var d = new ArrayBuffer(this.buffer.byteLength + s);
a = new Uint8Array(d), a.set(new Uint8Array(this.buffer).subarray(n, this.buffer.byteLength), i), this.buffer = d, this.view = new DataView(d), this.offset += s, this.markedOffset >= 0 && (this.markedOffset += s), this.limit += s, n += s
} else a = new Uint8Array(this.buffer);
return a.set(new Uint8Array(e.buffer).subarray(e.offset, e.limit), n - i), e.offset = e.limit, o && (this.offset -= i), this
}, t.prototype.prependTo = function(e, t) {
return e.prepend(this, t), this
}, t.prototype.printDebug = function(e) {
"function" != typeof e && (e = console.log.bind(console)), e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
}, t.prototype.remaining = function() {
return this.limit - this.offset
}, t.prototype.reset = function() {
return this.markedOffset >= 0 ? (this.offset = this.markedOffset, this.markedOffset = -1) : this.offset = 0, this
}, t.prototype.resize = function(e) {
if (!this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal capacity: " + e + " (not an integer)");
if (e |= 0, 0 > e) throw new RangeError("Illegal capacity: 0 <= " + e)
}
if (this.buffer.byteLength < e) {
var t = new ArrayBuffer(e);
new Uint8Array(t).set(new Uint8Array(this.buffer)), this.buffer = t, this.view = new DataView(t)
}
return this
}, t.prototype.reverse = function(e, t) {
if ("undefined" == typeof e && (e = this.offset), "undefined" == typeof t && (t = this.limit), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal begin: Not an integer");
if (e >>>= 0, "number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal end: Not an integer");
if (t >>>= 0, 0 > e || e > t || t > this.buffer.byteLength) throw new RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
}
return e === t ? this : (Array.prototype.reverse.call(new Uint8Array(this.buffer).subarray(e, t)), this.view = new DataView(this.buffer), this)
}, t.prototype.skip = function(e) {
if (!this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal length: " + e + " (not an integer)");
e |= 0
}
var t = this.offset + e;
if (!this.noAssert && (0 > t || t > this.buffer.byteLength)) throw new RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
return this.offset = t, this
}, t.prototype.slice = function(e, t) {
if ("undefined" == typeof e && (e = this.offset), "undefined" == typeof t && (t = this.limit), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal begin: Not an integer");
if (e >>>= 0, "number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal end: Not an integer");
if (t >>>= 0, 0 > e || e > t || t > this.buffer.byteLength) throw new RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
}
var r = this.clone();
return r.offset = e, r.limit = t, r
}, t.prototype.toBuffer = function(e) {
var t = this.offset,
n = this.limit;
if (t > n) {
var o = t;
t = n, n = o
}
if (!this.noAssert) {
if ("number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal offset: Not an integer");
if (t >>>= 0, "number" != typeof n || n % 1 !== 0) throw new TypeError("Illegal limit: Not an integer");
if (n >>>= 0, 0 > t || t > n || n > this.buffer.byteLength) throw new RangeError("Illegal range: 0 <= " + t + " <= " + n + " <= " + this.buffer.byteLength)
}
if (!e && 0 === t && n === this.buffer.byteLength) return this.buffer;
if (t === n) return r;
var i = new ArrayBuffer(n - t);
return new Uint8Array(i).set(new Uint8Array(this.buffer).subarray(t, n), 0), i
}, t.prototype.toArrayBuffer = t.prototype.toBuffer, t.prototype.toString = function(e) {
if ("undefined" == typeof e) return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
switch (e) {
case "utf8":
return this.toUTF8();
case "base64":
return this.toBase64();
case "hex":
return this.toHex();
case "binary":
return this.toBinary();
case "debug":
return this.toDebug();
case "columns":
return this.toColumns();
default:
throw new Error("Unsupported encoding: " + e)
}
};
var n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
n += "", t.prototype.toBase64 = function(e, t) {
if ("undefined" == typeof e && (e = this.offset), "undefined" == typeof t && (t = this.limit), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal begin: Not an integer");
if (e >>>= 0, "number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal end: Not an integer");
if (t >>>= 0, 0 > e || e > t || t > this.buffer.byteLength) throw new RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
}
if (e === t) return "";
for (var r, o, i, a, s, d, c, u, l, f = ""; t > e;) r = this.view.getUint8(e++), o = (a = t > e) ? this.view.getUint8(e++) : 0, i = (s = t > e) ? this.view.getUint8(e++) : 0, d = r >> 2, c = (3 & r) << 4 | o >> 4, u = (15 & o) << 2 | i >> 6, l = 63 & i, s || (l = 64, a || (u = 64)), f += n.charAt(d) + n.charAt(c) + n.charAt(u) + n.charAt(l);
return f
}, t.fromBase64 = function(e, r, o) {
if (!o) {
if ("string" != typeof e) throw new TypeError("Illegal str: Not a string");
if (e.length % 4 !== 0) throw new TypeError("Illegal str: Length not a multiple of 4")
}
var i, a, s = e.length,
d = 0;
for (i = e.length - 1; i >= 0 && "=" === e.charAt(i); --i) d++;
if (d > 2) throw new TypeError("Illegal str: Suffix is too large");
if (0 === s) return new t(0, r, o);
var c, u, l, f, h, p, m, g = new t(s / 4 * 3 - d, r, o);
for (i = 0, a = 0; s > i;) {
if (c = n.indexOf(e.charAt(i++)), u = (h = s > i) ? n.indexOf(e.charAt(i++)) : 0, l = (p = s > i) ? n.indexOf(e.charAt(i++)) : 0, f = (m = s > i) ? n.indexOf(e.charAt(i++)) : 0, !o && (0 > c || 0 > u || 0 > l || 0 > f)) throw new TypeError("Illegal str: Contains non-base64 characters");
g.view.setUint8(a++, c << 2 | u >> 4), 64 !== l && (g.view.setUint8(a++, u << 4 & 240 | l >> 2, a), 64 !== f && g.view.setUint8(a++, l << 6 & 192 | f))
}
return g.limit = a, g
}, t.btoa = function(e) {
return t.fromBinary(e).toBase64()
}, t.atob = function(e) {
return t.fromBase64(e).toBinary()
}, t.prototype.toBinary = function(e, t) {
if (e = "undefined" == typeof e ? this.offset : e, t = "undefined" == typeof t ? this.limit : t, !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal begin: Not an integer");
if (e >>>= 0, "number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal end: Not an integer");
if (t >>>= 0, 0 > e || e > t || t > this.buffer.byteLength) throw new RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
}
if (e === t) return "";
for (var r = []; t > e;) r.push(this.view.getUint8(e++));
return String.fromCharCode.apply(String, r)
}, t.fromBinary = function(e, r, n) {
if (!n && "string" != typeof e) throw new TypeError("Illegal str: Not a string");
for (var o, i = 0, a = e.length, s = new t(a, r, n); a > i;) {
if (o = e.charCodeAt(i), !n && o > 255) throw new TypeError("Illegal charCode at " + i + ": 0 <= " + o + " <= 255");
s.view.setUint8(i++, o)
}
return s.limit = a, s
}, t.prototype.toDebug = function(e) {
for (var t, r = -1, n = this.buffer.byteLength, o = "", i = "", a = ""; n > r;) {
if (-1 !== r && (t = this.view.getUint8(r), o += 16 > t ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(), e && (i += t > 32 && 127 > t ? String.fromCharCode(t) : ".")), ++r, e && r > 0 && r % 16 === 0 && r !== n) {
for (; o.length < 51;) o += " ";
a += o + i + "\n", o = i = ""
}
o += r === this.offset && r === this.limit ? r === this.markedOffset ? "!" : "|" : r === this.offset ? r === this.markedOffset ? "[" : "<" : r === this.limit ? r === this.markedOffset ? "]" : ">" : r === this.markedOffset ? "'" : e || 0 !== r && r !== n ? " " : ""
}
if (e && " " !== o) {
for (; o.length < 51;) o += " ";
a += o + i + "\n"
}
return e ? a : o
}, t.fromDebug = function(e, r, n) {
for (var o, i, a = e.length, s = new t((a + 1) / 3 | 0, r, n), d = 0, c = 0, u = !1, l = !1, f = !1, h = !1, p = !1; a > d;) {
switch (o = e.charAt(d++)) {
case "!":
if (!n) {
if (l || f || h) {
p = !0;
break
}
l = f = h = !0
}
s.offset = s.markedOffset = s.limit = c, u = !1;
break;
case "|":
if (!n) {
if (l || h) {
p = !0;
break
}
l = h = !0
}
s.offset = s.limit = c, u = !1;
break;
case "[":
if (!n) {
if (l || f) {
p = !0;
break
}
l = f = !0
}
s.offset = s.markedOffset = c, u = !1;
break;
case "<":
if (!n) {
if (l) {
p = !0;
break
}
l = !0
}
s.offset = c, u = !1;
break;
case "]":
if (!n) {
if (h || f) {
p = !0;
break
}
h = f = !0
}
s.limit = s.markedOffset = c, u = !1;
break;
case ">":
if (!n) {
if (h) {
p = !0;
break
}
h = !0
}
s.limit = c, u = !1;
break;
case "'":
if (!n) {
if (f) {
p = !0;
break
}
f = !0
}
s.markedOffset = c, u = !1;
break;
case " ":
u = !1;
break;
default:
if (!n && u) {
p = !0;
break
}
if (i = parseInt(o + e.charAt(d++), 16), !n && (isNaN(i) || 0 > i || i > 255)) throw new TypeError("Illegal str: Not a debug encoded string");
s.view.setUint8(c++, i), u = !0
}
if (p) throw new TypeError("Illegal str: Invalid symbol at " + d)
}
if (!n) {
if (!l || !h) throw new TypeError("Illegal str: Missing offset or limit");
if (c < s.buffer.byteLength) throw new TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
}
return s
}, t.prototype.toHex = function(e, t) {
if (e = "undefined" == typeof e ? this.offset : e, t = "undefined" == typeof t ? this.limit : t, !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal begin: Not an integer");
if (e >>>= 0, "number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal end: Not an integer");
if (t >>>= 0, 0 > e || e > t || t > this.buffer.byteLength) throw new RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
}
for (var r, n = new Array(t - e); t > e;) r = this.view.getUint8(e++), 16 > r ? n.push("0", r.toString(16)) : n.push(r.toString(16));
return n.join("")
}, t.fromHex = function(e, r, n) {
if (!n) {
if ("string" != typeof e) throw new TypeError("Illegal str: Not a string");
if (e.length % 2 !== 0) throw new TypeError("Illegal str: Length not a multiple of 2")
}
for (var o, i = e.length, a = new t(i / 2 | 0, r), s = 0, d = 0; i > s; s += 2) {
if (o = parseInt(e.substring(s, s + 2), 16), !n && (!isFinite(o) || 0 > o || o > 255)) throw new TypeError("Illegal str: Contains non-hex characters");
a.view.setUint8(d++, o)
}
return a.limit = d, a
};
var o = function() {
var e = {};
return e.encodeUTF8 = function(e, t) {
var r = null;
for ("number" == typeof e && (r = e, e = function() {
return null
}); null !== r || null !== (r = e());) 128 > r ? t(127 & r) : 2048 > r ? (t(r >> 6 & 31 | 192), t(63 & r | 128)) : 65536 > r ? (t(r >> 12 & 15 | 224), t(r >> 6 & 63 | 128), t(63 & r | 128)) : (t(r >> 18 & 7 | 240), t(r >> 12 & 63 | 128), t(r >> 6 & 63 | 128), t(63 & r | 128)), r = null
}, e.decodeUTF8 = function(e, t) {
for (var r, n, o, i, a = function(e) {
e = e.slice(0, e.indexOf(null));
var t = Error(e.toString());
throw t.name = "TruncatedError", t.bytes = e, t
}; null !== (r = e());)
if (0 === (128 & r)) t(r);
else if (192 === (224 & r)) null === (n = e()) && a([r, n]), t((31 & r) << 6 | 63 & n);
else if (224 === (240 & r))(null === (n = e()) || null === (o = e())) && a([r, n, o]), t((15 & r) << 12 | (63 & n) << 6 | 63 & o);
else {
if (240 !== (248 & r)) throw RangeError("Illegal starting byte: " + r);
(null === (n = e()) || null === (o = e()) || null === (i = e())) && a([r, n, o, i]), t((7 & r) << 18 | (63 & n) << 12 | (63 & o) << 6 | 63 & i)
}
}, e.UTF16toUTF8 = function(e, t) {
for (var r, n = null;;) {
if (null === (r = null !== n ? n : e())) break;
r >= 55296 && 57343 >= r && null !== (n = e()) && n >= 56320 && 57343 >= n ? (t(1024 * (r - 55296) + n - 56320 + 65536), n = null) : t(r)
}
null !== n && t(n)
}, e.UTF8toUTF16 = function(e, t) {
var r = null;
for ("number" == typeof e && (r = e, e = function() {
return null
}); null !== r || null !== (r = e());) 65535 >= r ? t(r) : (r -= 65536, t((r >> 10) + 55296), t(r % 1024 + 56320)), r = null
}, e.encodeUTF16toUTF8 = function(t, r) {
e.UTF16toUTF8(t, function(t) {
e.encodeUTF8(t, r)
})
}, e.decodeUTF8toUTF16 = function(t, r) {
e.decodeUTF8(t, function(t) {
e.UTF8toUTF16(t, r)
})
}, e.assertByte = function(e) {
if ("number" != typeof e || e !== e) throw TypeError("Illegal byte: " + typeof e);
if (-128 > e || e > 255) throw RangeError("Illegal byte: " + e);
return e
}, e.assertCharCode = function(e) {
if ("number" != typeof e || e !== e) throw TypeError("Illegal char code: " + typeof e);
if (0 > e || e > 65535) throw RangeError("Illegal char code: " + e);
return e
}, e.assertCodePoint = function(e) {
if ("number" != typeof e || e !== e) throw TypeError("Illegal code point: " + typeof e);
if (0 > e || e > 1114111) throw RangeError("Illegal code point: " + e);
return e
}, e.calculateCodePoint = function(e) {
return 128 > e ? 1 : 2048 > e ? 2 : 65536 > e ? 3 : 4
}, e.calculateUTF8 = function(t) {
for (var r, n = 0; null !== (r = t());) n += e.calculateCodePoint(r);
return n
}, e.calculateUTF16asUTF8 = function(t) {
var r = 0,
n = 0;
return e.UTF16toUTF8(t, function(t) {
++r, n += e.calculateCodePoint(t)
}), [r, n]
}, e
}(),
a = String.fromCharCode;
return o.stringSource = function(e) {
var t = 0;
return function() {
return t < e.length ? e.charCodeAt(t++) : null
}
}, o.stringDestination = function() {
var e = [],
t = [];
return function() {
return 0 === arguments.length ? t.join("") + a.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(a.apply(String, e)), e.length = 0), void Array.prototype.push.apply(e, arguments))
}
}, t.prototype.toUTF8 = function(e, t) {
if ("undefined" == typeof e && (e = this.offset), "undefined" == typeof t && (t = this.limit), !this.noAssert) {
if ("number" != typeof e || e % 1 !== 0) throw new TypeError("Illegal begin: Not an integer");
if (e >>>= 0, "number" != typeof t || t % 1 !== 0) throw new TypeError("Illegal end: Not an integer");
if (t >>>= 0, 0 > e || e > t || t > this.buffer.byteLength) throw new RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
}
var r, n = this;
try {
o.decodeUTF8toUTF16(function() {
return t > e ? n.view.getUint8(e++) : null
}, r = o.stringDestination())
} catch (i) {
if (e !== t) throw new RangeError("Illegal range: Truncated data, " + e + " != " + t)
}
return r()
}, t.fromUTF8 = function(e, r, n) {
if (!n && "string" != typeof e) throw new TypeError("Illegal str: Not a string");
var i = new t(o.calculateUTF16asUTF8(o.stringSource(e), !0)[1], r, n),
a = 0;
return o.encodeUTF16toUTF8(o.stringSource(e), function(e) {
i.view.setUint8(a++, e)
}), i.limit = a, i
}, t
}
e.exports = n(r(339))
}(this)
}).call(t, r(50)(e))
}, function(e, t, r) {
"use strict";
var n = r(1),
o = r(42),
i = r(75),
a = {
isMainLoaded: !1,
uiBusy: 0,
mainLoaded: function() {
this.isMainLoaded = !0, this.trigger("main_loaded")
},
incrementProgress: function() {
n.log("Cmd: incrementProgress")(), this.trigger("increment_progress")
},
logSocketSummary: function() {
this.trigger("log_socket_summary")
},
muteChat: function(e, t, r) {
this.trigger("mute_chat", e, t, r)
},
deleteOrExitChat: function(e, t) {
this.trigger("delete_or_exit_chat", e, t)
},
clearChatMsgs: function(e, t) {
this.trigger("clear_chat_msgs", e, t)
},
archiveChat: function(e, t) {
this.trigger("archive_chat", e, t)
},
markChatUnread: function(e, t) {
this.trigger("mark_chat_unread", e, t)
},
msgInfoDrawer: function(e) {
this.trigger("msg_info_drawer", e)
},
groupInfoDrawer: function(e) {
this.trigger("group_info_drawer", e)
},
broadcastInfoDrawer: function(e) {
this.trigger("broadcast_info_drawer", e)
},
contactInfoDrawer: function(e) {
this.trigger("contact_info_drawer", e)
},
openChat: function(e, t) {
var r = arguments.length <= 2 || void 0 === arguments[2] ? !0 : arguments[2],
n = arguments.length <= 3 || void 0 === arguments[3] ? !0 : arguments[3];
this.closeDrawer(), !t && e && e.unreadMsgAnchor && (t = {
collection: e.unreadMsgAnchor.msgChunk,
promise: Promise.resolve(),
msg: e.unreadMsgAnchor,
isUnreadDivider: !0,
highlightMsg: !1
}), this.trigger("open_chat", e, t, r, n)
},
clearChat: function(e) {
this.trigger("clear_chat", e)
},
focusChatTextInput: function(e) {
e ? this.trigger("focus_chat_text_input_" + e.id) : this.trigger("focus_chat_text_input")
},
focusShowMsg: function(e) {
this.trigger("focus_show_msg", e)
},
enterChatTextInput: function(e) {
this.trigger("enter_chat_text_input_" + e.id)
},
focusNextChat: function(e) {
this.trigger("focus_next_chat", e)
},
focusPrevChat: function(e) {
this.trigger("focus_prev_chat", e)
},
focusChatList: function() {
this.trigger("focus_chat_list")
},
focusChatSearch: function() {
this.trigger("focus_chat_search")
},
pasteChatTextInput: function(e, t) {
this.trigger("paste_chat_text_input_" + e.id, t)
},
composeHeightChange: function(e, t) {
this.trigger("compose_height_change", e, t)
},
isMsgVisible: function(e, t) {
this.trigger("is_msg_visible", e, t)
},
jsHaltDetected: function(e) {
this.trigger("js_halt_detected", e)
},
login: function(e) {
this.trigger("login", e)
},
openContextMenu: function(e, t) {
this.trigger("open_context_menu", e, t)
},
openTooltip: function(e, t) {
this.trigger("open_tooltip", e, t)
},
openToast: function(e) {
this.trigger("open_toast", e)
},
closeToast: function(e) {
this.trigger("close_toast", e)
},
alertNewMsg: function(e) {
this.trigger("alert_new_msg", e)
},
alertCall: function(e, t) {
this.trigger("alert_call", e, t)
},
cancelCall: function(e) {
this.trigger("cancel_call", e)
},
windowError: function(e) {},
error2412: function(e) {},
sentPing: function(e) {},
openModal: function(e, t, r, n) {
this.trigger("open_modal", e, t, r, n)
},
closeModal: function() {
this.trigger("close_modal")
},
openModalMedia: function(e, t, r, n) {
this.trigger("open_modal_media", e, t, r, n)
},
closeModalMedia: function() {
this.trigger("close_modal_media")
},
openDrawer: function(e, t, r) {
this.trigger("open_drawer", e, t, r)
},
closeDrawer: function(e) {
this.trigger("close_drawer", e)
},
mediaPlaying: function(e) {
this.trigger("mediaPlaying", e)
},
uiResize: function() {
this.trigger("resize")
},
localeChange: function() {
this.trigger("locale_change")
},
clearUiBusy: _.debounce(function() {
this.uiBusy && (n.log("cmd:clearUIBusy uibusy timeout")(), this.uiBusy = 0, this.trigger("ui_idle"))
}, 1e3, {
maxWait: 5e3
}),
setUiBusy: function(e) {
var t = this.uiBusy || 0;
e ? (++t, this.clearUiBusy()) : t && --t, this.uiBusy = t, 0 === t && (this.clearUiBusy.cancel(), this.trigger("ui_idle"))
},
windowMouseDown: function(e) {
this.trigger("window_mousedown", e)
},
windowClick: function(e) {
this.trigger("window_click", e)
},
midnight: function() {
this.trigger("midnight")
}
};
_.extend(a, o, i), n.exportToWindow("Cmd", a), e.exports = a
}, function(e, t, r) {
"use strict";
function n() {
var e = r(14),
t = e.info();
if (t) {
var n = "WhatsApp/" + s.VERSION_STR,
o = "Web/" + t.ua,
i = "Device/" + t.os;
return n + " " + o + " " + i
}
}
function o(e, t, r) {
function h() {
l = setTimeout(function() {
var e = f;
l = 0, f = void 0, "undefined" != typeof e && o(e ? "delayed-" + e : "delayed")
}, s.LOG_UPLOAD_INTERVAL)
}
d.logSocketSummary(), i.log("==================================================")(), i.log("wa:uploadLogs ref: " + (Store.Conn.ref || "no conn"))(), i.log("wa:uploadLogs hash: " + s.LATEST_HASH)(), i.log("wa:uploadLogs version: " + s.VERSION_STR)(), i.log("wa:uploadLogs userAgent: " + navigator.userAgent)(), i.log("wa:uploadLogs platform: " + (Store.Conn.platform || "no platform"))(), i.log("wa:uploadLogs url: " + location.href)();
var p;
"undefined" == typeof e ? (i.log("reason for logs: manual-upload")(), p = !0) : e && i.log("reason for logs: " + e)(), i.log("==================================================")();
var m = Store.Conn.me,
g = m ? u.user(m) : c.getUnknownId(),
v = n();
if (!p && !r) {
if (!(Math.random() < s.UPLOAD_TO_CLB)) return i.log("wa:uploadLogs squelched logs")(), Promise.resolve("deferred");
if (l) return i.log("wa:uploadLogs delayed logs")(), "undefined" == typeof f && (f = e), Promise.resolve("deferred")
}
var y = (t ? Promise.resolve(i.getLogs()) : Promise.delay(500).then(i.getLogs.bind(i))).bind(this).then(function(e) {
e = e.join("\n");
var t = new FormData,
r = new Blob([e], {
type: "text/plain"
});
return t.append("from", g), t.append("agent", v), t.append("file", r, "logs.txt"), a.post(s.CLB_URL, t)["catch"](_.noop)
});
return r || h(), y
}
var i = r(1),
a = r(95),
s = r(6),
d = r(8),
c = r(13),
u = r(19),
l = 0,
f = void 0;
e.exports = {
upload: o
}
}, function(e, t, r) {
"use strict";
function n(e) {
return e instanceof v
}
function o(e) {
var t = c.getOldLogoutCreds();
c.setOldLogoutCreds(_.filter(t, _.negate(_.matches(e))))
}
var i = r(1),
a = r(9),
s = r(43),
d = r(6),
c = r(13),
u = r(8),
l = r(170),
f = r(97),
h = r(153),
p = r(25),
m = r(18),
g = r(151),
v = r(7),
y = r(34),
b = r(45),
w = r(374),
E = r(96),
S = r(14),
N = r(74),
T = r(134),
$ = {
OPENING: "OPENING",
PAIRING: "PAIRING",
UNPAIRED: "UNPAIRED",
UNPAIRED_IDLE: "UNPAIRED_IDLE",
CONNECTED: "CONNECTED",
TIMEOUT: "TIMEOUT",
CONFLICT: "CONFLICT",
UNLAUNCHED: "UNLAUNCHED",
PROXYBLOCK: "PROXYBLOCK",
TOS_BLOCK: "TOS_BLOCK"
},
C = {
DISCONNECTED: "DISCONNECTED",
SYNCING: "SYNCING",
RESUMING: "RESUMING",
CONNECTED: "CONNECTED"
},
A = {
NEW: "new",
SENT: "sent",
WEBDACKED: "webdacked",
WILL_RETRY: "will_retry"
},
I = m.defineAll(["SendCalledWhileDisconnected", "ExternalPoke", "MustExitLoop", "Denied401Failed", "Denied409Conflict", "DeniedTOS", "DeniedUnknown", "ForcedRefresh", "TooManyRefRequest", "UILogout", "WindowOffline", "PhoneFailedPing", "AssertionFailed", "TakeoverRequested", "PhoneReplacedClient", "NoSecretBundle", "PhoneKickedClient"]),
O = {
SYNC_INFO: ["Conn", g.OBJECT],
CHALLENGE: ["Cmd", {
type: "challenge",
challenge: g.STRING
}],
DISCONNECT: ["Cmd", {
type: "disconnect",
kind: _
}],
HARD_REFRESH: ["Cmd", {
type: "update"
}],
PONG: ["Pong", g.BOOLEAN]
},
k = {
TAG: function(e) {
return new g({
tag: e,
data: g.ANY
})
},
SYNC_INFO: new g({
tag: g.ANY,
data: O.SYNC_INFO
}),
CHALLENGE: new g({
tag: g.ANY,
data: O.CHALLENGE
}),
DISCONNECT: new g({
tag: g.ANY,
data: O.DISCONNECT
}),
HARD_REFRESH: new g({
tag: g.ANY,
data: O.HARD_REFRESH
}),
PONG: new g({
tag: g.ANY,
data: O.PONG
})
},
P = new g({
status: function(e) {
return "number" == typeof e && e >= 500
},
_: _
}),
R = 5,
M = 6e4,
L = 5,
D = 500,
U = 3e3,
B = 3e3,
x = 36e5,
j = 120,
W = 40,
Y = s.extend({
extraProperties: "reject",
props: {
data: "any",
tag: "string",
state: {
type: "string",
values: _.values(A),
"default": A.NEW
},
ephemeral: "boolean",
ignore: "boolean",
clientCacheable: "boolean",
onSend: "function",
onDrop: "function",
age: {
type: "number",
"default": 0
},
resends: {
type: "number",
"default": 0
},
resendTimer: {
type: "number",
"default": 0
},
binaryOpts: "object"
},
derived: {
likelyDead: {
deps: ["age"],
fn: function() {
return this.age >= W
}
},
isToPhone: {
deps: ["data"],
fn: function() {
return this.data instanceof ArrayBuffer
}
}
},
getTag: function() {
return this.tag || (this.onSend ? this.onSend.tag : void 0)
},
toString: function() {
return this.binaryOpts ? this.binaryOpts.debugString : !_.isArray(this.data) || "query" !== this.data[0] && "action" !== this.data[0] ? _.isArray(this.data) ? "[" + this.data[0] + (this.data.length > 1 ? ", ...]" : "]") : _.isObject(this.data) ? "{...}" : this.data + "" : "[" + this.data[0] + ", " + this.data[1] + (this.data.length > 2 ? ", ...]" : "]")
},
serialize: function() {
var e = this.tag;
if (this.binaryOpts) {
var t = this.binaryOpts,
r = v.calculateUTF8Bytes(e) + 3,
n = new v(r, !1),
o = t.metric ? t.metric : 0,
i = (this.ignore ? 0 : 1) << 7 | (!this.ignore && t.ackRequest ? 1 : 0) << 6 | (t.available === !0 ? 1 : 0) << 5 | (t.available === !1 ? 1 : 0) << 4 | (t.expires ? 1 : 0) << 3 | (t.skipOffline ? 1 : 0) << 2;
return n.writeString(e), n.writeString(","), n.writeByte(o), n.writeByte(i), n.reset(), v.concat([n, this.data]).toBuffer()
}
var a = _.isString(this.data) ? this.data : JSON.stringify(this.data);
return e + ",," + a
}
}),
F = s.extend({
extraProperties: "reject",
session: {
socketPreload: "object",
socket: "object",
launchGeneration: {
type: "number",
"default": 0
},
backoffGeneration: {
type: "number",
"default": 0
},
hasSynced: "boolean",
state: {
type: "string",
values: _.keys($),
"default": $.UNLAUNCHED
},
stream: {
type: "string",
values: _.keys(C),
"default": C.DISCONNECTED
},
canSend: "boolean",
sendQueue: "array",
sendHash: "object",
sequence: {
type: "number",
"default": 0
},
shortTagBase: "string",
socketWatcher: "object",
refWatcher: "object",
phoneWatchdog: "object",
pendingPhoneReqs: {
type: "number",
"default": 0
},
isIncognito: "boolean",
runPromise: "object",
streamPromise: "object",
logoutMutex: {
type: "number",
"default": 0
},
retryTimestamp: "number",
pokeable: "object",
conflictPromise: "object",
launched: "boolean",
mustExitLoop: "boolean",
syncTag: "string",
lastPhoneMessage: "number"
},
initialize: function() {
this.sendQueue = [], this.sendHash = {}, this.phoneWatchdog = new h({
waitAlgorithm: h.FIBONACCI(U, B, x),
onTimeout: this.phoneTimedOut.bind(this),
onActivated: this.onPhoneWatchdogActivated.bind(this),
onFed: this.onPhoneWatchdogFed.bind(this),
onDeactivated: this.onPhoneWatchdogDeactivated.bind(this)
}), this.listenTo(this, "change:state", this.onStateChange.bind(this)), this.listenTo(this, "change:stream", this.onStreamChange.bind(this)), Promise.delay(0).then(p.determineIncognito).bind(this).then(function(e) {
this.isIncognito = e
}), this.listenTo(u, "log_socket_summary", this.summary)
},
STATE: $,
STREAM: C,
preload: function(e) {
this.socketPreload = e || new w
},
send: function(e) {
var t = new Y(e);
this.sendQueue.push(t), this.flushQueue()
},
shortTag: function() {
return this.shortTagBase || (this.shortTagBase = (moment().unix() % 1e3).toString()), this.shortTagBase + ".--" + this.sequence++
},
tag: function(e) {
var t = moment().unix() + ".--" + this.sequence++;
return e && d.FLAVOR_TAGS ? t + "-" + e : t
},
launch: function(e, t) {
function r() {
i.log("ws2:socket loop closed")(), this.socketPreload && this.socketPreload.deactivate(), this.clearState(), this.set({
state: $.UNLAUNCHED,
mustExitLoop: !1,
launched: !1,
socketPreload: null
})
}
i.log("ws2:Launch gen" + this.launchGeneration + " (backoff gen" + this.backoffGeneration + ")")(), t = t || 0;
var n = Date.now() + 300 * N.expBackoff(this.backoffGeneration, 100),
o = n + M;
if (this.launched) {
var s = new Error("Redundant Launch");
return i.error("ws2:launch redundantly called!")(), i.errorVerbose(s.stack)(), void a.upload("redundant-launch")
}
this.mustExitLoop ? r.call(this) : (this.launched = !0, this.run(t, e).then(function(e) {
return [e, !1]
}).bind(this)["catch"](I.MustExitLoop, function() {
return this.mustExitLoop = !0, [!1, !1]
})["catch"](I.TakeoverRequested, function() {
return [!1, !0]
})["catch"](function(e) {
return i.error("ws2:run error unknown!")(e), i.errorVerbose(e.stack)(), a.upload("unknown-error-in-ws-loop"), this.clearState(), [!0, !1]
}).spread(function(e, t) {
if (this.mustExitLoop) r.call(this);
else {
var i = Date.now();
this.launchGeneration++, this.backoffGeneration = e && o > i ? this.backoffGeneration + 1 : 0, this.launched = !1, this.launch(t, n > i ? n - i : 0)
}
}))
},
poke: function() {
this.pokeable ? this.pokeable.poke() : this.phoneWatchdog.forceTimeout()
},
takeover: function() {
if (!this.conflictPromise) throw "Takeover called without conflict!";
this.conflictPromise.cancel(new I.TakeoverRequested)
},
exitLoop: function() {
this.mustExitLoop = !0, this.runPromise && this.runPromise.cancel(new I.MustExitLoop)
},
logout: function(e) {
var t = this.runPromise;
i.info("ws2:user logged out")(), this.stream === C.DISCONNECTED || e ? this.sendCurrentLogout() : this.sendCurrentLogout(this.socket), this.clearCredentials(), t && t.cancel(new I.UILogout), this.state === $.OPENING && this.trigger("change:state")
},
summary: function() {
i.log("ws:summary --------------------------------")(), i.log("ws state " + this.state)(), i.log("wd online: " + navigator.onLine)(), i.log("ws socket id: " + (this.socket ? this.socket.id : "n/a"))(), i.log("ws queue:")(), _.isEmpty(this.sendQueue) || l.printArray(_.map(this.sendQueue, function(e) {
var t = _.pick(e, "tag", "state", "age", "ephemeral", "isToPhone");
return e && e.toString && (t.debug = e.toString()), t
})).split(/\n/).forEach(function(e) {
i.log(e)()
}), i.log("ws hash:")(), _.isEmpty(this.sendHash) || l.printArray(_.map(this.sendHash, function(e) {
var t = _.pick(e, "tag", "state", "age", "ephemeral", "isToPhone");
return e && e.toString && (t.debug = e.toString()), t
})).split(/\n/).forEach(function(e) {
i.log(e)()
})
},
onStateChange: function() {
i.log("ws2:state change: " + this.state)()
},
onStreamChange: function() {
i.log("ws2:stream change: " + this.stream)(), this.stream === C.DISCONNECTED && this.onRefCycle()
},
onRefCycle: function() {
i.log("ws2:onRefCycle")(), this.sendQueue.forEach(function(e) {
e.state = A.NEW, e.age = 0
}), this.clearSendHash()
},
onActivity: function(e) {
if (e) {
var t = e.data;
if (k.HARD_REFRESH.test(e)) i.error("ws2:hard refresh!")(), E.update(0);
else if (t) {
var r = _.isArray(t) ? " [" + t[0] + ", ...]" : "";
i.logColor("green", " recv: " + e.tag + r, t)()
} else i.logColor("#669999", " ack: " + e.tag)()
} else T.setSkew(this.socket.timeSkew || 0);
this.sendRemainingLogouts()
},
onPhoneWatchdogActivated: function() {},
onPhoneWatchdogFed: function() {
this.state = $.CONNECTED
},
onPhoneWatchdogDeactivated: function() {},
flushQueue: function() {
if (this.canSend && this.sendQueue.length) {
var e = _.where(this.sendQueue, {
state: A.NEW
}),
t = T.localUnixTime(),
r = _.partition(e, function(e) {
return e.binaryOpts && e.binaryOpts.expires ? t - e.binaryOpts.expires > j : !1
}),
n = r[0],
o = r[1];
this.sendQueue = _.difference(this.sendQueue, n), n.forEach(function(e) {
delete this.sendHash[e.tag], e.onSend({
status: 408
})
}, this), o.length && o.forEach(this._send, this)
}
},
phoneTimedOut: function() {
var e = this.phoneWatchdog.failGeneration;
if (1 === e) {
i.warn("ws2:Phone timed out")();
var t = _.pluck(this.sendHash, "tag");
i.warn("ws2:Outstanding Reqs: " + t.join(","))()
}
u.sentPing(e);
var r = this.phoneWatchdog.waitAlgorithm(this.phoneWatchdog);
return this.set({
state: $.TIMEOUT,
retryTimestamp: Date.now() + r
}), this._basicSend({
tag: this.tag("ping"),
data: ["admin", "test"]
}, "ping"), !0
},
clearSendHash: function(e) {
if (e) _.each(this.sendHash, function(e) {
e.resendTimer && clearTimeout(e.resendTimer), e.onDrop(new m.LogoutDrop(e.toString()))
});
else {
var t = _.filter(this.sendHash, "ephemeral");
i.warn("Ephemeral Drop: " + _.pluck(t, "tag").join(","))(), t.forEach(function(e) {
e.resendTimer && clearTimeout(e.resendTimer), e.onDrop(new m.EphemeralDrop(e.toString()))
})
}
this.sendHash = {}, this.pendingPhoneReqs = 0, this.phoneWatchdog.deactivate()
},
_basicSend: function(e, t) {
i.logColor("blue", "low-send: " + t + " " + e.tag, e.data)(), this.socket.cast(e.tag + "," + JSON.stringify(e.data))
},
_send: function(e) {
e.tag = e.getTag() || this.shortTag(), this.sendHash[e.tag] = e;
var t = e.binaryOpts ? e.binaryOpts.debugObj : e.data;
i.logColor("blue", " send: " + e.tag + ", " + e.toString(), t)(), this.socket.send(e.serialize()), e.isToPhone && (this.pendingPhoneReqs++, this.phoneWatchdog.activate()), e.state = A.SENT
},
sendBasic: function(e) {
return this.socket ? (e.tag = this.tag(), this._basicSend(e, "external"), this.socket.nextMessage(k.TAG(e.tag))) : Promise.reject("socket not open")
},
sendEphemeral: function(e) {
e.ephemeral = !0;
var t = new Y(e);
this.canSend ? this._send(t) : t.onDrop(new m.EphemeralDrop(t.toString()))
},
sendEphemeralIgnore: function(e) {
e.ephemeral = !0, e.ignore = !0, e.tag = this.tag();
var t = new Y(e);
if (this.canSend) {
var r = t.serialize();
this.socket.send(r), i.logColor("blue", "sending: " + t.tag + ", " + t.toString(), t.data)()
} else t.onDrop(new m.EphemeralDrop(t.toString()))
},
onMessage: function(e) {
var t = e.tag,
r = e.data;
if (n(r) && (this.lastPhoneMessage = moment().unix()), k.PONG.test(e))
if (r[1]) {
var o = 0,
s = !1;
_.each(this.sendHash, function(e) {
if (e.isToPhone) {
var t = e.likelyDead;
e.age++, e.likelyDead && !t ? (s = !0, i.error(e.tag + " likely dead: " + e.toString(), e)(), u.error2412("(" + e.tag + ") " + e.toString()), Store.Wap.error2412()) : e.likelyDead || o++
}
}), this.pendingPhoneReqs = o, this.phoneWatchdog.feed(), 0 === o && this.phoneWatchdog.deactivate(), s && a.upload("error-2412")
} else this.state !== $.TIMEOUT ? i.error("ws2:Pang while not timed-out")() : this.runPromise.cancel(new I.PhoneFailedPing);
else {
var d = this.sendHash[t];
if (d) {
if (!r) return void(d.state = A.WEBDACKED);
var c;
try {
c = d.onSend(r)
} catch (l) {
if (l instanceof m.E401) return void this.logout();
i.error("ws2:onMessage error")(l), d.onDrop(l)
}
P.test(c) ? (i.error("ws2:onMessage 5xx error " + d.tag, c)(), d.resends >= R ? (i.error("ws2:onMessage dropping " + d.tag)(), d.onDrop(new m.Server5xxDrop), delete this.sendHash[t], this.sendQueue = _.without(this.sendQueue, d)) : this.resendRequestEventually(d)) : (delete this.sendHash[t], this.sendQueue = _.without(this.sendQueue, d), d.isToPhone && (d.likelyDead || this.pendingPhoneReqs--, this.phoneWatchdog.feed(), 0 === this.pendingPhoneReqs && this.phoneWatchdog.deactivate()))
} else if (r) {
var f;
if (v.isByteBuffer(r)) f = Store.Wap;
else {
var h = _.isFunction(r.shift) ? r.shift() : r;
f = Store[h]
}
f ? f.handle(r, this, t) : i.error("ws2: Invalid type received", r)(), n(r) && this.phoneWatchdog.feed()
}
}
},
run: function(e, t) {
return this.runPromise = y.resolve(e).bind(this).cancellable().then(function(e) {
if (this.state = $.OPENING, u.incrementProgress(), e > 0) {
i.log("ws2:Run Backoff " + e + "ms")();
var t = y.delay(e).cancellable()["catch"](I.ExternalPoke, _.noop);
return this.setPokeable(t, Date.now() + e), t
}
})["finally"](function() {
this.unset("pokeable"), this.unset("retryTimestamp")
}).then(function() {
return u.incrementProgress(), i.log("ws2:Running")(), this.openSocket()
}).then(function(e) {
return u.incrementProgress(), e.onactivity = this.onActivity.bind(this), this.socket = e, this.socketWatcher = p.attachWatcher(this.runPromise, this.throwOnClose()), this.state = $.PAIRING, "undefined" == typeof this.isIncognito ? p.waitForBBEvent(this, "change:isIncognito") : void 0
}).then(function() {
var e = this;
u.incrementProgress(), this.shortTagBase = (moment().unix() % 1e3).toString();
var r = this.initConn();
if (!c.knowsPhone()) return r.bind(this).then(function() {
this.set({
state: $.UNPAIRED,
refWatcher: p.attachWatcher(this.runPromise, this.manageRef())
})
});
var n = function() {
var n = e.requestSync(t);
return {
v: Promise.all([r, n])["finally"](function() {
r.cancel(), n.cancel()
})
}
}();
return "object" == typeof n ? n.v : void 0
}).then(this.waitForSyncInfo)["finally"](function() {
this.refWatcher && (this.refWatcher.cancel(), this.unset("refWatcher"))
}).then(function(e) {
return u.incrementProgress(), i.log("ws2:completed " + (this.hasSynced ? "re-auth" : "auth"))(), this.state = $.CONNECTED, p.waitForMain()["return"](e)
}).then(function(e) {
i.log("ws2:main loaded")(), e.initial = !0, Store.Conn.handle([e]);
var t = this.openStream();
return this.streamPromise = t, t
}).then(function() {
return new y
})["catch"](m.SocketClosed, function(e) {
throw e.event instanceof I.UILogout ? e.event : e
})["catch"](function(e) {
i.warn("ws2:run loop interrupt: " + e)(e), this.set({
canSend: !1,
stream: C.DISCONNECTED,
runPromise: null
}), this.phoneWatchdog.deactivate(), this.streamPromise && (this.streamPromise.cancel(), this.unset("streamPromise")), this.socketWatcher && (this.socketWatcher.cancel(), this.unset("socketWatcher"));
var t = this.socket;
return t && "closed" !== t.state && (t.detachCallbacks(), t.close(!0, e)), this.unset("socket"), Promise.reject(e)
})["catch"](m.E401, I.PhoneFailedPing, function() {
return !1
})["catch"](I.ForcedRefresh, function() {
return this.clearState(), !1
})["catch"](m.SocketClosed, m.SocketError, function() {
return !0
})["catch"](I.DeniedUnknown, function(e) {
return i.error("ws2:sync rejected, logging out")(), this.sendCurrentLogout(), this.clearCredentials(), !1
})["catch"](I.Denied401Failed, I.PhoneKickedClient, function(e) {
return i.log("ws2:phone disassociated via " + e)(), this.clearCredentials(), !1
})["catch"](I.NoSecretBundle, function() {
return i.error("ws2:No secret bundle!")(), this.clearCredentials(), a.upload("no-secret-bundle"), !1
})["catch"](I.TooManyRefRequest, function() {
return this.state = $.UNPAIRED_IDLE, this.setPokeable(p.waitForOfflineNaive()["throw"](new I.WindowOffline)["catch"](I.ExternalPoke, _.constant(!1)))
})["catch"](m.BlockedByProxy, function() {
return S.promptUnloadGuards++, this.state = $.PROXYBLOCK, this.setPokeable((new y)["catch"](I.ExternalPoke, _.constant(!1))["finally"](function() {
S.promptUnloadGuards--
}))
})["catch"](I.DeniedTOS, function() {
i.log("ws2:denied tos")();
var e = this.setPokeable((new y).cancellable()["catch"](I.ExternalPoke, _.constant(!1))).cancellable();
return this.clearState(), this.set({
state: $.TOS_BLOCK,
runPromise: e
}), e
})["catch"](I.Denied409Conflict, I.PhoneReplacedClient, function(e) {
e instanceof I.Denied409Conflict ? i.log("ws2:phone denied (conflict)")() : i.log("ws2:phone replaced")(), this.clearState();
var t = (new y).cancellable();
return this.set({
state: $.CONFLICT,
conflictPromise: t,
runPromise: t
}), t
})["finally"](function() {
this.conflictPromise && this.conflictPromise.cancel()
})["catch"](I.UILogout, I.WindowOffline, function() {
return !1
})
},
openSocket: function() {
var e = this,
t = this.socketPreload;
if (this.socketPreload = null, t && t.socket && "open" === t.socket.state) return Promise.resolve(t.socket);
t && t.active || (t = new w);
var r = function() {
e.retryTimestamp = t.retryTimestamp
};
t.on("change:retryTimestamp", r), this.pokeable = t;
var n = p.waitForBBEvent(t, "change:socket").cancellable().then(function() {
return t.socket
})["finally"](function() {
t.off("change:retryTimestamp", r), t.onerror = null, t.deactivate(), e.pokeable = null
});
return t.onerror = function(e) {
n.cancel(e)
}, n
},
initConn: function() {
return new Promise(function(e, t) {
var r = d.VERSION,
n = this.tag("init"),
o = S.info();
return this._basicSend({
tag: n,
data: ["admin", "init", [r.p, r.s, r.t],
[o.os || "Unknown", o.name || "Unknown"], S.id(), !this.isIncognito && !!c.getRememberMe()
]
}, "init"), this.socket.nextMessage(k.TAG(n)).get("data")["catch"](t).then(e)
}.bind(this)).then(function(e) {
E.update(e.update, e.curr), T.setSkew(Date.now() - e.time), Store.Conn.handle([{
id: 1,
ref: e.ref,
refTTL: e.ttl
}])
})
},
manageRef: function() {
var e = this;
return p.loopOnError(m.ShouldLoop, function(t) {
var r = Store.Conn.refExpiry - Date.now() - D;
return Promise.delay(Math.max(r, 0)).cancellable().then(function() {
if (t >= L) throw new I.TooManyRefRequest;
i.log("ws2:Requesting Ref Update")();
var r = e.tag("qr" + t);
return e._basicSend({
tag: r,
data: ["admin", "Conn", "reref"]
}, "reref"), e.socket.nextMessage(k.TAG(r))
}).then(function(e) {
var t = e.data;
switch (t.status) {
case 200:
throw i.log("ws2:Updating Ref")(), Store.Conn.handle([{
ref: t.ref,
refTTL: t.ttl
}]), new m.ShouldLoop;
case 304:
return void i.log("ws2:Keeping Ref")();
case 429:
throw i.log("ws2:Server denied new ref")(), new I.TooManyRefRequest;
default:
throw i.error("ws2:Bad Ref Response!", t)(), new I.AssertionFailed("unrecognized ref request status (" + t.status + ")")
}
})
}).cancellable()
},
requestSync: function(e) {
var t = this;
if (this.syncTag = this.tag("sync"), !b.load()) throw new I.NoSecretBundle;
var r = c.getLoginTokens(),
n = r.client,
o = r.server,
s = ["admin", "login", n, o, S.id()];
e ? s.push("takeover") : this.hasSynced && (s.push("reconnect"), s.push(Store.Conn.me));
var d = function() {
return t._basicSend({
tag: t.syncTag,
data: s
}, "sync"), !0
},
u = new h({
waitAlgorithm: h.FIBONACCI(0, 8500, 6e4),
onTimeout: d
});
u.on("change:ts", function() {
t.retryTimestamp = u.ts
}), this.pokeable = u, u.activate(), d();
var l = this.socket.nextMessage(k.TAG(this.syncTag)),
f = this.lookForAndHandleChallenge()["catch"](Promise.CancellationError, _.noop)["catch"](l.cancel.bind(l));
return l.then(function(e) {
i.log("ws2:login", e)();
var t = e.data;
switch (t.status) {
case 200:
return e;
case 401:
return Promise.reject(new I.Denied401Failed);
case 403:
return Promise.reject(t.tos >= 2 ? new I.DeniedTOS : new I.DeniedUnknown);
case 405:
return i.error("ws2:Already authorized!")(), a.upload("already-authorized"), Promise.reject(new I.ForcedRefresh);
case 409:
return Promise.reject(new I.Denied409Conflict);
default:
return i.error("ws2:unknown error! status:" + t.status, e)(), Promise.reject(new I.DeniedUnknown)
}
})["finally"](function() {
f.cancel(), u.deactivate(), t.unset("pokeable"), t.unset("retryTimestamp")
})
},
waitForSyncInfo: function() {
return this.socket.nextMessage(k.SYNC_INFO).then(function(e) {
return e.data[1]
})
},
lookForAndHandleChallenge: function() {
return this.socket.nextMessage(k.CHALLENGE).bind(this).then(function(e) {
i.log("ws2:challenged!")();
var t = CryptoJS.enc.Base64.parse(e.data[1].challenge),
r = b.getSecurityToken(t),
n = c.getLoginTokens(),
o = n ? n.server : void 0;
if (!o) return i.error("ws2:handleChallenge no server token!", n)(), Promise.reject(new Error("Handle challenge no server token"));
var a = this.tag("challenge");
return this._basicSend({
tag: a,
data: ["admin", "challenge", r, o, S.id()]
}, "challenge"), this.socket.nextMessage(k.TAG(a))
}).then(function(e) {
return e.data.status >= 400 ? (i.error("ws2:handleChallenge failed challenge!", e.data)(), Promise.reject(new I.Denied401Failed)) : void i.log("ws2:handleChallenge passed challenge")()
})
},
throwOnClose: function() {
return this.socket.nextMessage(k.DISCONNECT).then(function(e) {
var t = e.data[1];
throw "replaced" === t.kind ? new I.PhoneReplacedClient : new I.PhoneKickedClient
})
},
openStream: function() {
this.canSend = !0;
var e, t;
return this.hasSynced ? e = Promise.all([this.queryReceivedActions(), Store.Chat.resyncMessages(), Store.Msg.resyncReceipts()]).bind(this).then(function() {
this.flushQueue(), this.stream = C.CONNECTED
})["catch"](m.EphemeralDrop, Promise.CancellationError, function() {
this.stream = C.DISCONNECTED
})["catch"](function(e) {
throw i.error("ws2:error during resume, resyncing: " + e)(e), i.errorVerbose(e.stack)(), a.upload("error-on-resume"), this.stream = C.DISCONNECTED, new I.ForcedRefresh
}) : (t = Store.Chat.sync().cancellable().bind(this).then(function() {
this.set({
hasSynced: !0,
stream: C.CONNECTED
})
})["catch"](Promise.CancellationError, _.noop), e = Promise.all([t, Store.Contact.sync()]).bind(this)["catch"](function(e) {
return t.cancel(), this.set({
hasSynced: !1,
stream: C.DISCONNECTED
}), Promise.reject(e)
})["catch"](Promise.CancellationError, _.noop)), Promise.resolve().cancellable().bind(this).then(function() {
return this.stream = this.hasSynced ? C.RESUMING : C.SYNCING, this.socket.onmessage = this.onMessage.bind(this), this.socket.releaseMessages(), e
})["catch"](Promise.CancellationError, function() {
e.cancel()
})
},
queryReceivedActions: function() {
var e = this,
t = _.filter(this.sendQueue, "clientCacheable", !0),
r = _.pluck(t, "tag").filter(function(e) {
return e
});
return i.log("ws2:queryReceivedActions")(), 0 === r.length ? Promise.resolve() : Store.Wap.queryReceivedActions(r).then(function(r) {
_.isArray(r) ? r.forEach(function(t) {
var r = _.find(e.sendQueue, "tag", t.id);
if (r)
if (i.log("ws2:queryReceivedActions found dup: " + t.id + "," + t.code)(), delete e.sendHash[t.id], e.sendQueue = _.without(e.sendQueue, r), r.onSend) {
var n = r.onSend({
status: t.code,
_duplicate: !0
});
P.test(n) && r.onDrop(new m.Server5xxDrop)
} else i.error("ws2:queryReceivedActions onSendDup undefined; should be defined: " + t.id)(), r.onDrop(new m.ConventionViolationDrop);
else i.error("ws2:queryReceivedActions unknown tag in response: " + t.id)()
}) : "replaced" === r ? (t.forEach(function(e) {
e.onDrop(new m.BrowserReplacedDrop)
}), e.sendQueue = _.difference(e.sendQueue, t)) : i.error("ws2:queryReceivedActions error", r)()
})
},
setPokeable: function(e) {
var t = arguments.length <= 1 || void 0 === arguments[1] ? this.retryTimestamp : arguments[1];
return this.set({
pokeable: {
poke: function() {
e.cancel(new I.ExternalPoke)
}
},
retryTimestamp: t
}), e
},
clearCredentials: function() {
this.clearState(), c.setBrowserId(), c.setUnknownId(), c.clearTokens(), c.clearAllLocalState(), b.clear()
},
clearState: function() {
this.sendQueue = [], this.clearSendHash(!0), this.unset("hasSynced"), _.each(Store, function(e) {
_.isFunction(e["delete"]) && e["delete"]()
})
},
resendRequestEventually: function(e) {
var t = this,
r = 300 * N.expBackoff(e.resends, 100);
i.log("ws2:Resending " + e.toString() + " in " + r + "ms")();
var n = _.delay(function() {
e.resends++, e.resendTimer = 0, t.sendHash[e.tag] === e && t._send(e)
}, r);
e.set({
resendTimer: n,
state: A.WILL_RETRY
})
},
sendCurrentLogout: function(e) {
if (b.load()) {
var t = {
t: c.getLogoutToken(),
m: Store.Wap.logoutToken()
},
r = c.getOldLogoutCreds();
r.push(t), c.setOldLogoutCreds(r)
}
if (e && e.state === f.STATE.OPEN) {
var n = this.logoutMutex;
this.logoutMutex = 0 >= n ? n = 1 : ++n, i.info("ws2:logout through socket")(), e.partingSend(new I.UILogout, 'goodbye,,["admin","Conn","disconnect"]', _.matches("goodbye,")).bind(this).then(function(e) {
e ? (i.log("ws2:logout through socket success")(), o(t)) : i.warn("ws2:logout through socket failure, will POST")()
})["finally"](function() {
this.logoutMutex === n && (this.logoutMutex = 0)
})
} else this.logoutMutex < 0 && (this.logoutMutex = 0), this.sendRemainingLogouts()
},
sendRemainingLogouts: function() {
var e = this.logoutMutex;
if (0 === e) {
var t = r(95),
n = c.getOldLogoutCreds();
if (0 === n.length) return void(this.logoutMutex = -1);
this.logoutMutex = e = 1, Promise.all(_.map(n, function(e) {
return i.info("ws2:POST logout")(), t.post(d.LOGOUT_URL, e).then(function() {
o(e)
})["catch"](function(e) {
i.warn("ws2:POST logout failure")()
})
})).bind(this)["finally"](function() {
e === this.logoutMutex && (this.logoutMutex = 0)
})
}
}
}),
G = new F;
i.exportToWindow("WS", G), e.exports = G
}, , , function(e, t, r) {
"use strict";
var n = r(6),
o = r(26),
i = r(1),
a = r(334),
s = r(379),
d = [n.KEY_LOGOUT_TOKEN, n.KEY_CLIENT_TOKEN, n.KEY_SERVER_TOKEN, n.KEY_SECRET_BUNDLE],
c = [n.KEY_LOG_CURSOR, n.KEY_WHATSAPP_MUTEX, n.KEY_REMEMBER_ME, n.KEY_WHATSAPP_LS_VERSION],
u = [n.KEY_WHATSAPP_MUTEX, n.KEY_REMEMBER_ME, n.KEY_OLD_LOGOUT_CREDS],
l = [n.KEY_VERSION],
f = 1,
h = {
v0: function() {
var e = localStorage.getItem(n.KEY_SECRET_BUNDLE);
e && (e = JSON.parse(e), e = _.isObject(e) ? JSON.stringify(e) : e, localStorage.setItem(n.KEY_SECRET_BUNDLE, e)), this._setLSVersion(1)
}
},
p = "x" + Math.round(1e9 * Math.random()),
m = function(e) {
if (e.key !== n.KEY_WHATSAPP_MUTEX) return !1;
var t = e.newValue || "";
return -1 === t.indexOf(p)
},
g = function(e) {
if (e.key !== n.KEY_LOCAL_TAKEOVER_OK) return !1;
var t = e.newValue || "";
return -1 === t.indexOf(p)
},
v = {
thisTabId: p,
getRememberMe: function() {
var e = this._getPS(n.KEY_REMEMBER_ME);
return _.isNull(e) && (e = !0, this._setPS(n.KEY_REMEMBER_ME, !0)), e
},
setRememberMe: function(e) {
if (e = !!e, e !== this.getRememberMe()) {
i.log("UserPrefs:setRememberMe: " + e)();
var t, r;
if (t = this._storage(), this._setPS(n.KEY_REMEMBER_ME, e), r = this._storage(), t !== r) {
var o = _.difference(_.keys(t), c, u);
o.forEach(function(e) {
_.isFunction(t[e]) || (r[e] = t[e], t.removeItem(e))
})
}
e || i.clearLogs()
}
},
_storage: function() {
return this.getRememberMe() ? o.permanentStorage : o.temporaryStorage
},
clear: function() {
var e = this._getPreservedKeys();
this._storage().clear(), this._setPreservedKeys(e)
},
_getKeys: function(e, t) {
return _.object(t, t.map(function(t) {
return e.getItem(t)
}))
},
_setKeys: function(e, t) {
_.each(t, function(t, r) {
e.setItem(r, t)
})
},
_getPreservedKeys: function() {
return this._getKeys(o.permanentStorage, u)
},
_setPreservedKeys: function(e) {
return this._setKeys(o.permanentStorage, e)
},
_getAllKeyValues: function() {
var e = this._storage();
return _.object(_.keys(e).map(function(t) {
return [t, e.getItem(t)]
}))
},
_setAllKeyValues: function(e) {
var t = this._storage();
_.keys(e).forEach(function(r) {
t.setItem(r, e[r])
})
},
_getPS: function(e) {
return this._get(e, o.permanentStorage)
},
_setPS: function(e, t) {
return this._set(e, t, o.permanentStorage)
},
_getTS: function(e) {
return this._get(e, o.temporaryStorage)
},
_setTS: function(e, t) {
return this._set(e, t, o.temporaryStorage)
},
_get: function(e, t, n) {
if (_.isUndefined(e)) throw new Error("_get called with no key");
t = t || this._storage();
var o = t.getItem(e);
if (n || _.isUndefined(o)) return o;
try {
return JSON.parse(o)
} catch (a) {
i.log("userPrefs:_get(" + e + ") '" + a + "' " + o)();
var s = r(9);
return s.upload("userprefs-parse-error"), void t.removeItem(e)
}
},
_set: function(e, t, r, n) {
if (_.isUndefined(e)) throw new Error("_set called with no key");
r = r || this._storage(), _.isUndefined(t) ? r.removeItem(e) : r.setItem(e, n ? t : JSON.stringify(t))
},
_getUser: function(e) {
if (!Store.Conn.me) return i.error("userPrefs: Me has not loaded yet.")(), null;
var t = a([Store.Conn.me, e].join(":"));
return this._get(t)
},
_setUser: function(e, t) {
if (!Store.Conn.me) return i.error("userPrefs: Me has not loaded yet.")(), null;
var r = a([Store.Conn.me, e].join(":"));
return this._set(r, t)
},
getLoginTokens: function() {
return {
client: this._get(n.KEY_CLIENT_TOKEN),
server: this._get(n.KEY_SERVER_TOKEN)
}
},
setLoginTokens: function(e) {
var t = e.client,
r = e.server;
t && r && !_.isUndefined(t) && (i.log("UserPrefs:setLoginTokens")(), this._set(n.KEY_CLIENT_TOKEN, t), this._set(n.KEY_SERVER_TOKEN, r))
},
knowsPhone: function() {
var e = this.getLoginTokens();
return !(!e.client || !e.server)
},
setRefTokCookies: function(e, t) {
v.clearCookies(), v.clearDeprecatedKeys(), s.setCookie({
name: n.COOKIE_REF,
value: e,
path: n.PP_REF,
domain: n.COOKIE_DOMAIN,
secure: !0
});
var r = {
name: n.COOKIE_TOK,
value: t,
path: n.PP_TOK,
domain: n.COOKIE_DOMAIN,
secure: !0
};
s.setCookie(r)
},
clearCookies: function() {
s.setCookie({
name: n.COOKIE_REF,
expirationDate: 0,
domain: n.COOKIE_DOMAIN,
path: n.PP_REF
}), s.setCookie({
name: n.COOKIE_TOK,
expirationDate: 0,
domain: n.COOKIE_DOMAIN,
path: n.PP_TOK
})
},
clearDeprecatedKeys: function() {
l.forEach(function(e) {
o.permanentStorage.removeItem(e)
})
},
getSecretBundle: function() {
var e = this._get(n.KEY_SECRET_BUNDLE);
return e ? _.object(_.map(e, function(e, t) {
return [t, CryptoJS.enc.Base64.parse(e)]
})) : (i.error("UserPrefs:Attempted to load non-existent secret bundle!", e)(), null)
},
setSecretBundle: function(e) {
return this._set(n.KEY_SECRET_BUNDLE, _.object(_.map(e, function(e, t) {
return [t, CryptoJS.enc.Base64.stringify(e)]
})))
},
clearTokens: function() {
d.forEach(function(e) {
this._set(e)
}, this)
},
getNUX: function(e) {
return this._getUser(e)
},
setNUX: function(e, t) {
return this._setUser(e, t)
},
getUnknownId: function() {
var e = this._get(n.KEY_UNKNOWN_ID);
return e || (e = "unknown" + Math.floor(1e10 * Math.random()), this.setUnknownId(e)), e
},
setUnknownId: function(e) {
return this._set(n.KEY_UNKNOWN_ID, e)
},
getBrowserId: function() {
return this._get(n.KEY_BROWSER_ID)
},
setBrowserId: function(e) {
this._set(n.KEY_BROWSER_ID, e)
},
setLastEmojiTab: function(e) {
return this._setUser(n.KEY_LAST_ACTIVE_EMOJI_TAB, e)
},
getLastEmojiTab: function() {
return this._getUser(n.KEY_LAST_ACTIVE_EMOJI_TAB)
},
getCollection: function(e) {
return this._getUser(e)
},
setCollection: function(e, t) {
return this._setUser(e, t)
},
getGlobalSounds: function() {
return !this._getUser(n.KEY_GLOBAL_MUTE_SOUNDS)
},
setGlobalSounds: function(e) {
return this._setUser(n.KEY_GLOBAL_MUTE_SOUNDS, !e)
},
getGlobalNotifications: function() {
return !this._getUser(n.KEY_GLOBAL_MUTE_NOTIFICATIONS)
},
setGlobalNotifications: function(e) {
return this._setUser(n.KEY_GLOBAL_MUTE_NOTIFICATIONS, !e)
},
getGlobalPreviews: function() {
return !this._getUser(n.KEY_GLOBAL_MUTE_PREVIEWS)
},
setGlobalPreviews: function(e) {
return this._setUser(n.KEY_GLOBAL_MUTE_PREVIEWS, !e)
},
getGeocoderLocation: function() {
return this._getUser(n.KEY_GEOCODER_LOCATION)
},
setGeocoderLocation: function(e) {
this._setUser(n.KEY_GEOCODER_LOCATION, e)
},
getMapsOverQuota: function() {
return this._get(n.KEY_GMAPS_OVER_LIMIT)
},
setMapsOverQuota: function(e) {
return this._set(n.KEY_GMAPS_OVER_LIMIT, e)
},
getGroupParticipantAssignedColor: function(e) {
return this._getUser(n.KEY_GROUP_ASSIGNED_COLOR + "-" + e)
},
setGroupParticipantAssignedColor: function(e, t) {
this._setUser(n.KEY_GROUP_ASSIGNED_COLOR + "-" + e, t)
},
getMutex: function() {
return this._getPS(n.KEY_WHATSAPP_MUTEX)
},
setMutex: function(e) {
var t = e ? p + ":" + e : e;
return this._setPS(n.KEY_WHATSAPP_MUTEX, t)
},
removeMutex: function() {
return this._setPS(n.KEY_WHATSAPP_MUTEX)
},
parseMutex: function(e) {
return e = e ? JSON.parse(e) : "", e ? e.toString().split(/:/).pop() : e
},
mutexFilter: m,
localTakeoverSuccess: function() {
var e = this.getRememberMe() ? {} : _.omit(this._getAllKeyValues(), c);
e.wa_tab_src = p, this._setPS(n.KEY_LOCAL_TAKEOVER_OK, e), this._setPS(n.KEY_LOCAL_TAKEOVER_OK)
},
parseTakeover: function(e) {
return e = e ? JSON.parse(e) : {}, _.isObject(e) ? (delete e.wa_tab_src, e) : {}
},
takeoverFilter: g,
getLangPref: function() {
return this._get(n.KEY_LANG)
},
setLangPref: function(e) {
return this._set(n.KEY_LANG, e)
},
getLogoutToken: function() {
return this._getPS(n.KEY_LOGOUT_TOKEN)
},
setLogoutToken: function(e) {
return this._setPS(n.KEY_LOGOUT_TOKEN, e)
},
getOldLogoutCreds: function() {
return this._getPS(n.KEY_OLD_LOGOUT_CREDS) || []
},
setOldLogoutCreds: function(e) {
return this._setPS(n.KEY_OLD_LOGOUT_CREDS, e)
},
setLogCursor: function(e) {
e %= n.LOG_SIZE, this._setPS(n.KEY_LOG_CURSOR, e)
},
_getLSVersion: function() {
return this._getPS(n.KEY_WHATSAPP_LS_VERSION) || 0
},
_setLSVersion: function(e) {
return this._setPS(n.KEY_WHATSAPP_LS_VERSION, e)
},
_version: function() {
return f
},
compareVersion: function() {
var e = this._getLSVersion();
return f - e
},
_migrate: function(e) {
if (e > 5) throw new Error("too many migrations");
var t = this.compareVersion();
if (0 !== t) {
var r, n = this._getLSVersion();
if (!(t > 0)) throw new Error("downgrades not supported");
if (r = h["v" + n], !r) throw new Error("no migration for: " + n);
i.log("userPrefs:migrate from: " + n + " towards: " + f)(), r.call(this), this._migrate(e + 1)
}
},
maybeMigrate: function() {
if (!_.isEmpty(localStorage) || !_.isEmpty(sessionStorage)) {
var e = _.flatten([d, n.KEY_BROWSER_ID, n.KEY_LOG_CURSOR]),
t = _.pick(localStorage, e);
try {
this._migrate(0)
} catch (r) {
i.error("userPrefs:error migrating")(r), this.clear(), this._setAllKeyValues(t), this._setLSVersion(f)
}
}
},
clearAllLocalState: function() {
var e = this._getPreservedKeys();
localStorage.clear(), this._setPreservedKeys(e), sessionStorage.clear(), this.clearCookies(), i.clearLogs()
},
setNoTakeover: function(e) {
return this._setTS(n.KEY_NO_TAKEOVER, e)
},
getNoTakeover: function() {
return this._getTS(n.KEY_NO_TAKEOVER)
},
getWamBuffer: function() {
return this._get(n.KEY_WAM_BUFFER, void 0, !0)
},
setWamBuffer: function(e) {
this._set(n.KEY_WAM_BUFFER, e, void 0, !0)
},
getWamInfo: function() {
return this._get(n.KEY_WAM_INFO)
},
setWamInfo: function(e) {
return this._set(n.KEY_WAM_INFO, e)
},
getWamOldBuffer: function() {
return this._get(n.KEY_WAM_OLD_BUFFER)
},
setWamOldBuffer: function(e) {
this._set(n.KEY_WAM_OLD_BUFFER, e)
},
clearWamBuffer_old: function() {
this._set("WaWamBuffer", void 0)
},
clearWamStatus_old: function() {
this._set("WAWamStatus", void 0)
},
clearWamLastRotate_old: function() {
this._set("WAWamLastRotate", void 0)
},
clearWamDimensionCache_old: function() {
this._set("WAWamDimensionCache", void 0)
}
};
e.exports = v
}, function(e, t, r) {
"use strict";
var n = r(40),
o = !1,
i = _.debounce(function() {
return o = !1
}, 500);
e.exports = {
id: function a() {
var e = r(13),
a = e.getBrowserId();
if (a) return a;
var t = new Uint32Array(4);
window.crypto.getRandomValues(t);
var n = CryptoJS.lib.WordArray.create(t);
return a = CryptoJS.enc.Base64.stringify(n), e.setBrowserId(a), a
},
info: function() {
var e = n.parser.getResult();
return {
os: e.os.name + (e.os.version ? " " + e.os.version : ""),
name: e.browser.name,
ua: e.browser.name + " " + e.browser.version
}
},
hardRefresh: function(e) {
var t = arguments.length <= 1 || void 0 === arguments[1] ? !0 : arguments[1];
if (this.promptUnloadGuards++, e) {
var n = r(13);
n.setNoTakeover(!0)
}
location.reload(t)
},
startDownloading: function() {
o = !0, i()
},
clearDownloading: function() {
o = !1
},
isDownloading: function() {
return o
},
promptUnloadGuards: 0
}
}, , , , function(e, t) {
"use strict";
function r(e, t, r, n) {
function o(e) {
_.isFunction(t) ? this.message = t.apply(this, arguments) : arguments.length > 0 ? this.message = "" + e : t ? this.message = t : this.message = this.name;
var r = this.message !== this.name ? this.name + ": " + this.message : this.name,
o = new Error(r).stack;
if (!o) try {
throw new Error(r)
} catch (i) {
o = i.stack, o || (o = "Error: " + r + "\n at (unspecified)")
}
this.stack = o, _.isFunction(n) && n.apply(this, _.rest(arguments))
}
return r = r || Error, o.prototype = Object.create(r.prototype), o.prototype.name = e, o
}
function n(e, t) {
return _.reduce(e, function(e, n, o) {
var i, a;
return _.isString(o) ? (i = o, a = n) : i = n, e[i] = r(i, a, t), e
}, {})
}
function o(e) {
this.event = e;
try {
return JSON.stringify(e)
} catch (t) {
return "" + e
}
}
var i = r("WAPStatusCode"),
a = r("401", null, i),
s = r("404", null, i),
d = r("500", null, i),
c = r("WapDrop"),
u = r("EphemeralDrop", null, c),
l = r("EphemeralDrop", null, c),
f = r("Server5xxDrop", null, c),
h = r("ConventionViolationDrop", null, c),
p = r("BrowserReplacedDrop", null, c),
m = r("ShouldLoop"),
g = r("GaveUpRetry"),
v = r("GUMError"),
y = n({
NotSupportedError: "The operation is not supported.",
PermissionDeniedError: "The user did not grant permission for the operation",
ConstraintNotSatisfiedError: "One of the mandatory Constraints could not be satisfied.",
OverconstrainedError: "Due to changes in the environment, one or more mandatory constraints can no longer be satisfied.",
NotFoundError: "The object can not be found here.",
AbortError: "The operation was aborted.",
SourceUnavailableError: "The source of the MediaStream could not be accessed due to a hardware error (e.g. lock from another process)."
}, v),
b = r("MediaFileError"),
w = r("InvalidMediaFileType", null, b),
E = r("MediaFileTooLarge", null, b),
S = r("MediaEncryptionError", null, b),
N = r("ImageError", "Image failed to load.", null, function(e) {
this.src = e, this.target = {
src: e
}
}),
T = r("ContactBlocked", "Contact is blocked", null, function(e) {
this.contact = e
}),
$ = r("CapabilityError"),
C = r("CapabilityUnsupported", null, $, function(e) {
this.jidCapabilities = e
}),
A = r("CapabilityInvalid", null, $),
I = r("CapabilityUnknown", null, $),
O = r("MediaMissing", "Media is no longer available on your phone"),
k = r("MediaLoadError", null, null, function(e) {
this.src = e
}),
P = r("SocketError", o),
R = r("SocketClosed", o),
M = r("SocketNotOpen", function(e) {
return "socket not open, is " + e
}),
L = r("BlockedByProxy");
e.exports = {
define: r,
defineAll: n,
QueryDrop: r("QueryDrop"),
WapDrop: c,
EphemeralDrop: u,
LogoutDrop: l,
Server5xxDrop: f,
ConventionViolationDrop: h,
BrowserReplacedDrop: p,
ShouldLoop: m,
GaveUpRetry: g,
MediaFileError: b,
InvalidMediaFileType: w,
MediaFileTooLarge: E,
MediaEncryptionError: S,
WAPStatusCode: i,
E401: a,
E404: s,
E500: d,
SocketError: P,
SocketClosed: R,
SocketNotOpen: M,
BlockedByProxy: L,
ImageError: N,
ContactBlocked: T,
MediaMissing: O,
MediaLoadError: k,
CapabilityError: $,
CapabilityUnsupported: C,
CapabilityInvalid: A,
CapabilityUnknown: I,
ActionError: r("ActionError", "Could not perform action."),
GUM: _.defaults(y, {
GUMError: v,
PERMISSION_DENIED: y.PermissionDeniedError,
NOT_SUPPORTED_ERROR: y.ConstraintNotSatisfiedError,
MANDATORY_UNSATISFIED_ERROR: y.NotFoundError
})
}
}, function(e, t, r) {
"use strict";
function n(e, t) {
return _.isString(t) ? t.split("@")[1] === e : ("undefined" != typeof t && i.log("wid:isXWid called on nonstring: " + t)(), !1)
}
function o(e) {
return _.isString(e) ? e.split("@")[0] : void 0
}
var i = r(1),
a = r(366),
s = ["c.us", "g.us", "broadcast"],
d = _.memoize(function(e) {
return "Server" === e ? e : a.format(e)
});
e.exports = {
userToLegacy: function(e) {
if (_.isString(e)) {
var t = e.split("@");
if (2 === t.length && "c.us" === t[1]) return t[0] + "@s.whatsapp.net"
}
return e
},
isUser: function(e) {
return n("c.us", e)
},
isBroadcast: function(e) {
return n("broadcast", e)
},
isGroup: function(e) {
return n("g.us", e)
},
isWid: function(e) {
return _.isString(e) ? _.contains(s, e.split("@")[1]) : !1
},
user: o,
formattedUser: function(e) {
if (e) {
var t = o(e);
if (t) return l10n.numAndPunc(d(t))
}
return ""
}
}
}, , , , function(e, t, r) {
var n = r(406)("wks"),
o = r(413),
i = r(31).Symbol;
e.exports = function(e) {
return n[e] || (n[e] = i && i[e] || (i || o)("Symbol." + e))
}
}, , function(e, t, r) {
"use strict";
function n() {
function e(e) {
var s = Promise.resolve([a++, e]).cancellable().spread(o).then(function() {
return r.apply(void 0, arguments)
});
t = s["catch"].apply(s, i)["catch"](function() {
return n.apply(void 0, arguments)
})
}
var t, r, n, o = _.last(arguments),
i = _.initial(arguments),
a = 0;
return i.push(e), Promise.resolve().then(function() {
return new Promise(function(t, o) {
r = t, n = o, e()
}).cancellable()["catch"](function(e) {
if (t && t.isPending()) return new Promise(function(o, i) {
r = o, n = i, t.cancel(e)
});
throw e
})
})
}
function o(e, t) {
var r = arguments.length <= 2 || void 0 === arguments[2] ? "GET" : arguments[2];
return new Promise(function(n) {
function o() {
n(i.status && i.status < 12e3 ? i : null)
}
var i = new XMLHttpRequest;
t && (i.responseType = t), i.onload = o, i.onreadystatechange = function() {
4 === i.readyState ? o() : 0 === i.readyState && n(null)
}, i.onerror = n.bind(void 0, null), i.ontimeout = n.bind(void 0, null), i.open(r, e, !0), i.send()
})
}
function i(e, t) {
return t["catch"](Promise.CancellationError, _.noop)["catch"](function(t) {
e.cancel(t)
}), t
}
function a() {
return d(window, "offline")
}
function s() {
var e, t;
return new Promise(function(r) {
function n() {
t && t + 1e4 < Date.now() ? r(!0) : (t = Date.now(), e = _.delay(n, 1e3))
}
n()
}).cancellable()["finally"](function() {
clearTimeout(e)
})
}
function d(e, t, r) {
var n;
return new Promise(function(o) {
n = r ? function() {
r.apply(this, arguments) && o.apply(this, arguments)
} : o, e.addEventListener(t, n)
}).cancellable()["finally"](function() {
e.removeEventListener(t, n)
})
}
function c(e, t, r) {
var n;
return new Promise(function(o) {
n = r ? function() {
r.apply(this, arguments) && o(arguments)
} : function() {
o(arguments)
}, e.on(t, n)
}).cancellable()["finally"](function() {
e.off(t, n)
})
}
function u() {
return p.isMainLoaded ? Promise.resolve() : c(p, "main_loaded")
}
function l() {
return new Promise(function(e, t) {
function r() {
e(!1)
}
if (window.requestFileSystem) window.requestFileSystem(window.TEMPORARY, 1, r, function(t) {
e("SecurityError" === t.name)
});
else if (window.indexedDB) {
var n = window.indexedDB.open("pb_detect");
n ? (n.onsuccess = r, n.onerror = function(t) {
t.preventDefault(), e(!0)
}) : r()
} else r()
}).then(function(e) {
if (!window.localStorage) return !0;
if (e) return e;
try {
return window.localStorage.setItem("INCOG", 0), window.localStorage.removeItem("INCOG"), !1
} catch (t) {
return "QuotaExceededError" === t.name ? !0 : Promise.reject(t)
}
}).timeout(100, "detectIncognitoTimeout")["catch"](Promise.TimeoutError, function() {
return !1
})["catch"](function(e) {
return f.error("promiseUtil:determineIncognito failed check: " + e)(e), h.upload("incog-throw"), !1
})
}
var f = r(1),
h = r(9),
p = r(8);
e.exports = {
loopOnError: n,
attachWatcher: i,
getResponseIfOnline: o,
waitForOfflineNaive: a,
waitForEvent: d,
waitForBBEvent: c,
determineIncognito: l,
waitForSkip: s,
waitForMain: u
}
}, function(e, t, r) {
"use strict";
function n() {
this.initializeStorage(), this._dbName = "wawc", this._db = new i(this._dbName), this._db.version(1).stores({
logs: "line,log"
}), this._db.version(2).stores({
logs: "line,log",
assets: "key,hash,data"
}), this._db.version(3).stores({
logs: "line,log",
assets: "key,hash,data",
wam: ",buffer,prevValues,lastSend"
}), this.openAttempt = 0, this.openDB(), this._dbState = u.OPENING, this.deleteLegacyDBs()
}
var o = r(6),
i = r(426),
a = r(1),
s = r(40),
d = r(41),
c = "WA",
u = {
ERROR: "error",
OPENING: "opening",
BLOCKED: "blocked",
OPEN: "open",
CLOSED: "closed"
};
n.prototype.initializeStorage = function() {
var e = window.localStorage,
t = window.sessionStorage,
r = {
setItem: function(e, t) {
this[e] = t
},
getItem: function(e, t) {
return this[e]
},
removeItem: function(e) {
delete this[e]
},
clear: function() {
for (var e in this) this.hasOwnProperty(e) && "function" != typeof e && delete this[e]
}
};
this.permanentStorage = this._hasLocalStorage() ? e : r, this.temporaryStorage = this._hasSessionStorage() ? t : r
}, n.prototype._hasLocalStorage = function() {
try {
return localStorage.setItem(o.KEY_STORAGE_TEST, o.KEY_STORAGE_TEST), !0
} catch (e) {
return !1
}
}, n.prototype._hasSessionStorage = function() {
try {
return sessionStorage.setItem(o.KEY_STORAGE_TEST, o.KEY_STORAGE_TEST), !0
} catch (e) {
return !1
}
}, n.prototype.openDB = function() {
var e = new d.WebcIdbOpen;
this._openDB().then(function() {
e.markWebcIdbOpenT(), e.webcIdbOpenSuccess = !0, e.commit()
})["catch"](function() {
e.markWebcIdbOpenT(), e.webcIdbOpenSuccess = !1, e.commit()
})
}, n.prototype._openDB = function() {
var e = this;
this._db.isOpen() && this._db.close();
var t = Promise.resolve(this._db.open()).bind(this).timeout(1e4).then(function() {
return a.info("db: Successfully opened db")(), e._dbState = u.OPEN, u.OPEN
})["catch"](Promise.TimeoutError, function(t) {
return a.info("db:openDB blocked"), e._dbState = u.BLOCKED, u.BLOCKED
})["catch"](function(t) {
return a.error("db:openDB:Error " + t)(), e.openAttempt > 1 || s.isSafari ? (e.opening = void 0, e._dbState = u.ERROR, Promise.reject(u.ERROR)) : (e.openAttempt += 1, e._db["delete"]().then(function() {
return e.openDB()
}))
}).then(function(t) {
return e.opening = void 0, t === u.BLOCKED ? Promise.reject(u.BLOCKED) : e._db
});
return this.opening || (this.opening = t), t
}, n.prototype.idb = function() {
return this._db.isOpen() ? Promise.resolve(this._db) : this._db.hasFailed() ? Promise.reject(u.FAILED) : this._dbState === u.BLOCKED ? Promise.reject(u.BLOCKED) : this.opening ? this.opening : Promise.reject(u.CLOSED)
}, n.prototype.deleteLegacyDBs = function() {
return i.getDatabaseNames().then(function(e) {
e.forEach(function(e) {
e === c && (localStorage.setItem(o.KEY_LOG_CURSOR, 0), i["delete"](e))
})
})
}, n.prototype.State = u;
var l = new n;
a.exportToWindow("DB", l), a.exportToWindow("Dexie", i), e.exports = l
}, , , , function(e, t, r) {
"use strict";
function n(e) {
return function(t) {
return "number" == typeof t.status && t.status >= 500 ? t : void e(t)
}
}
function o(e) {
return CryptoJS.lib.WordArray.create(new Uint8Array(e))
}
var i, a = r(1),
s = r(9),
d = r(45),
c = r(10),
u = r(146),
l = r(336),
f = r(152),
h = r(14),
p = r(19),
m = r(155),
g = r(156),
_ = r(157),
v = r(158),
y = r(159),
b = r(386),
w = {
setVersion: function(e, t) {
var r = e[0],
n = e[1];
switch (a.log("wap:setVersion " + [r, n, t].join("."))(), r) {
case 0:
switch (n) {
case 2:
m.setSubProtocol(1), i = m;
break;
case 3:
m.setSubProtocol(n), i = m;
break;
case 4:
g.setSubProtocol(n), i = g;
break;
case 5:
case 6:
_.setSubProtocol(n), i = _;
break;
case 7:
v.setSubProtocol(t), i = v;
break;
case 8:
y.setSubProtocol(t), i = y;
break;
case 9:
b.setSubProtocol(t), i = b
}
}
i || (a.error("wap:setVersion unknown version. attempting to update")(), s.upload("wap_unknown_version", !0)["finally"](function() {
return h.hardRefresh()
}))
},
"delete": function() {
return i ? i["delete"].apply(i, arguments) : void 0
},
error2412: function() {
return i.error2412.apply(i, arguments)
},
setSharedSecret: function(e) {
a.log("Wap:saveSharedSecret start")();
var t = u.decode(e, !0),
r = t.slice(0, 32),
n = u.encode(t.slice(32, 64)),
i = t.slice(64),
s = o(r.concat(i)),
c = d.get().keyPair.privKey,
h = f.sharedSecret(r, c),
p = l.extractAndExpand(h, void 0, "", 80, !0),
m = o(p.slice(0, 32)),
g = o(p.slice(32, 64)),
_ = o(p.slice(64, 80)),
v = CryptoJS.HmacSHA256(s, g),
y = v.toString(CryptoJS.enc.Base64);
if (n !== y) return void a.error("Wap:saveSharedSecret hmac mismatch " + n + " " + y)();
var b = CryptoJS.AES.decrypt({
ciphertext: o(i),
salt: void 0
}, m, {
iv: _,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
}),
w = u.decode(b.toString(CryptoJS.enc.Base64), !0),
E = o(w.slice(0, 32)),
S = o(w.slice(32, 64));
d.setSecretKeys("0.1", E, S), a.log("Wap:saveSharedSecret done")()
},
dispatch: function(e, t, r) {
var n = i[e];
return "function" != typeof n ? r ? Promise.resolve(r) : Promise.reject("wap:" + e + ":unsupported") : n.apply(i, t)
},
handle: function() {
return i.handle.apply(i, arguments)
},
queryServerProps: function() {
return new Promise(function(e, t) {
c.sendEphemeral({
data: ["query", "props"],
onSend: e,
onDrop: t
})
})
},
resyncPictures: function(e) {
return new Promise(function(t, r) {
c.sendEphemeral({
data: ["query", "resumePic", e],
onSend: n(t),
onDrop: r
})
})
},
setRememberMe: function(e) {
return c.sendBasic({
data: ["admin", "remember", !!e]
})
},
getPlaintextMediaInfo: function(e) {
return new Promise(function(t, r) {
var o = e.map(function(e) {
return [e.clientUrl, e.from.split("@")[0], e.to.split("@")[0], e.t]
});
c.send({
data: ["query", "refreshMedia", o],
onSend: n(t),
onDrop: r
})
})
},
requestMediaUpload: function(e, t, r) {
return new Promise(function(o, i) {
var a = function(e) {
switch (e.status) {
case 200:
o({
result: "ok",
data: e.url,
size: r
});
break;
case 299:
o({
result: "duplicate",
data: e.params,
size: r
});
break;
default:
i({
size: r
})
}
};
c.send({
data: ["action", "upload", e, t, r.toString()],
onSend: n(a),
onDrop: i
})
})
},
requestEncryptedMediaUpload: function(e, t) {
return new Promise(function(r, o) {
var i = function(e) {
switch (e.status) {
case 200:
r({
result: "ok",
data: e.url
});
break;
default:
o()
}
};
c.send({
data: ["action", "encr_upload", e, t],
onSend: n(i),
onDrop: o
})
})
},
contactFindBroadcast: function(e) {
return new Promise(function(t, r) {
c.send({
data: ["query", "contact", e],
onSend: n(t),
onDrop: r
})
})
},
commonGroupsFind: function(e) {
return new Promise(function(t, r) {
c.send({
data: ["query", "group", "common", e],
onSend: t,
onDrop: r
})
})
},
getCapabilities: function(e) {
return new Promise(function(t, r) {
c.send({
data: ["query", "caps", e.filter(p.isUser)],
onSend: n(t),
onDrop: r
})
})
},
addContact: function(e) {
return this.dispatch("addContact", arguments)
},
groupMetadataFind: function(e) {
return new Promise(function(t, r) {
c.sendEphemeral({
data: ["query", "GroupMetadata", e],
onSend: n(t),
onDrop: r
})
})
},
groupMetadataFindFromPhone: function(e) {
return i.groupMetadataFindFromPhone.apply(i, arguments)
},
lastseenFind: function(e) {
return new Promise(function(t, r) {
c.sendEphemeral({
data: ["query", "Presence", "lastseen", e],
onSend: n(t),
onDrop: r
})
})
},
profilePicFind: function(e, t) {
return "ProfilePicThumb" === e ? new Promise(function(r, o) {
c.sendEphemeral({
data: ["query", e, t],
onSend: n(r),
onDrop: o
})
}) : void 0
},
profilePicFindThumbFromPhone: function(e, t) {
return i.profilePicFindThumbFromPhone.apply(i, arguments)
},
statusFind: function(e) {
return new Promise(function(t, r) {
c.sendEphemeral({
data: ["query", "Status", e],
onSend: n(t),
onDrop: r
})
})
},
sendPing: function(e) {
return new Promise(function(e, t) {
c.send({
data: ["admin", "test"],
onSend: n(e),
onDrop: t
})
})
},
requestDeviceUploadLogs: function() {
return this.dispatch("requestDeviceUploadLogs", arguments)
},
resyncMessages: function() {
return this.dispatch("resyncMessages", arguments)
},
resyncReceipts: function() {
return this.dispatch("resyncReceipts", arguments)
},
queryReceivedActions: function() {
return this.dispatch("queryReceivedActions", arguments, [])
},
addParticipant: function() {
return this.dispatch("addParticipant", arguments)
},
changeSubject: function() {
return this.dispatch("changeSubject", arguments)
},
createGroup: function() {
return this.dispatch("createGroup", arguments)
},
leaveGroup: function() {
return this.dispatch("leaveGroup", arguments)
},
removeParticipant: function() {
return this.dispatch("removeParticipant", arguments)
},
promoteParticipant: function() {
return this.dispatch("promoteParticipant", arguments)
},
requestMediaReupload: function() {
return this.dispatch("requestMediaReupload", arguments)
},
sendMedia: function() {
return this.dispatch("sendMedia", arguments)
},
sendConversationSeen: function() {
return this.dispatch("sendConversationSeen", arguments)
},
sendConversationUnseen: function() {
return this.dispatch("sendConversationUnseen", arguments)
},
sendConversationClear: function() {
return this.dispatch("sendConversationClear", arguments)
},
sendConversationDelete: function() {
return this.dispatch("sendConversationDelete", arguments)
},
sendConversationArchive: function() {
return this.dispatch("sendConversationArchive", arguments)
},
sendConversationMute: function() {
return this.dispatch("sendConversationMute", arguments)
},
sendConversationNotSpam: function() {
return this.dispatch("sendConversationNotSpam", arguments)
},
sendMessagePlayed: function() {
return this.dispatch("sendMessagePlayed", arguments)
},
sendMessageDelete: function() {
return this.dispatch("sendMessageDelete", arguments)
},
sendMessageStarred: function() {
return this.dispatch("sendMessageStarred", arguments)
},
sendUnstarAll: function() {
return this.dispatch("sendUnstarAll", arguments)
},
sendPresenceAvailable: function() {
return this.dispatch("sendPresenceUpdate", ["available"])
},
sendPresenceUnavailable: function() {
return this.dispatch("sendPresenceUpdate", ["unavailable"])
},
sendChatstateComposing: function(e) {
return this.dispatch("sendChatstateUpdate", ["composing", e])
},
sendChatstatePaused: function(e) {
return this.dispatch("sendChatstateUpdate", ["paused", e])
},
sendChatstateRecording: function(e) {
return this.dispatch("sendChatstateUpdate", ["recording", e])
},
sendSetPicture: function() {
return this.dispatch("sendSetPicture", arguments)
},
deletePicture: function() {
return this.dispatch("deletePicture", arguments)
},
sendSetStatus: function() {
return this.dispatch("sendSetStatus", arguments)
},
setPushname: function() {
return this.dispatch("setPushname", arguments)
},
sendSetBlock: function() {
return this.dispatch("sendSetBlock", arguments)
},
sendSpamReport: function() {
return this.dispatch("sendSpamReport", arguments)
},
chatFindQuery: function() {
return this.dispatch("chatFindQuery", arguments)
},
contactFindQuery: function() {
return this.dispatch("contactFindQuery", arguments)
},
queryIdentity: function() {
return this.dispatch("queryIdentity", arguments)
},
msgCreateRecord: function() {
return this.dispatch("msgCreateRecord", arguments)
},
msgFindQuery: function() {
return this.dispatch("msgFindQuery", arguments)
},
queryLinkPreview: function() {
return this.dispatch("queryLinkPreview", arguments)
},
queryMsgInfo: function() {
return this.dispatch("queryMsgInfo", arguments)
},
presenceSubscribe: function() {
return this.dispatch("presenceSubscribe", arguments)
},
recentEmojiQuery: function() {
return this.dispatch("recentEmojiQuery", arguments)
},
logoutToken: function() {
var e = d.get().encKey.toString(CryptoJS.enc.Base64),
t = d.get().macKey.toString(CryptoJS.enc.Base64),
r = CryptoJS.enc.Base64.parse(e),
n = CryptoJS.enc.Base64.parse(t);
return CryptoJS.HmacSHA256(r, n).toString(CryptoJS.enc.Base64)
}
};
e.exports = w
}, function(e, t) {
var r = e.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")();
"number" == typeof __g && (__g = r)
}, , , function(e, t) {
"use strict";
function r() {
this._parent = null, this._subs = [], this._catchTypes = null, this._onResolve = null, this._onReject = null, this.type = s.ROOT, this.state = d.PENDING, this.value = void 0, this._forceable = !1, this._cancellable = !1;
var e, t;
switch (arguments.length) {
case 0:
break;
case 1:
e = arguments[0];
break;
case 2:
t = arguments[0], e = arguments[1];
break;
default:
throw new Error("TightPromise constructor with " + arguments.length + " arguments")
}
if (this.context = t, arguments.length > 0) try {
e.call(t, n.bind(this), o.bind(this))
} catch (r) {
o.call(this, r)
}
}
function n(e) {
this.state === d.PENDING && (i(e) ? e.then(n.bind(this), o.bind(this)) : (this.value = e, this.state = d.FULFILLED, this._notifySubs()))
}
function o(e) {
this.state === d.PENDING && (this.value = e, this.state = d.REJECTED, this._notifySubs())
}
function i(e) {
return ("object" == typeof e || "function" == typeof e) && "function" == typeof e.then
}
function a(e) {
setTimeout(function(e) {
throw e
}, 0, e)
}
var s = {
ROOT: 1,
THENABLE: 2,
FINALLY: 3,
META: 4
},
d = {
PENDING: 1,
FULFILLED: 2,
REJECTED: 3
};
r.STATE = d, r.TYPE = s, r.prototype = {
isPending: function() {
return this.state === d.PENDING
},
then: function(e, t) {
if (!e && !t) return this;
var n = new r;
return n.type = s.THENABLE, n._onResolve = e || null, n._onReject = t || null, this._addChild(n), n
},
"catch": function() {
var e = new r;
return e.type = s.THENABLE, e._onReject = arguments[arguments.length - 1], arguments.length > 1 && (e._catchTypes = Array.prototype.slice.call(arguments, 0, arguments.length - 1), e._catchTypes.forEach(function(e) {
if ("function" != typeof e) throw new Error("expected type, got " + e)
})), this._addChild(e), e
},
"finally": function(e) {
var t = new r;
return t.type = s.FINALLY, t._onResolve = e, this._addChild(t), t
},
bind: function(e) {
var t = new r;
return t.type = s.META, this._addChild(t), t.context = e, t
},
spread: function(e) {
return this.then(function(t) {
e.apply(this, t)
})
},
get: function(e) {
return this.then(function(t) {
return t[e]
})
},
forceable: function() {
var e = new r;
return e.context = this.context, e.type = s.META, this._addChild(e), e._forceable = !0, e
},
cancellable: function() {
var e = new r;
return e.context = this.context, e.type = s.META, this._addChild(e), e._cancellable = !0, e
},
force: function(e) {
if (this._forceable) {
for (var t = this; t.type === s.META;) {
var r = t._parent;
if (!r || !r._forceable || r.state !== d.PENDING) break;
t = r
}
n.call(this, e)
}
},
cancel: function(e) {
if (this._cancellable) {
e = e || new Promise.CancellationError;
var t = this,
r = !1;
do {
var n = t._parent;
n && n._cancellable && n.state === d.PENDING ? t = n : r = !0
} while (!r);
o.call(t, e)
}
},
timeout: function(e, t) {
var n = new r;
return n.type = s.META, this._addChild(n), n.state === d.PENDING && setTimeout(o.bind(n, new Promise.TimeoutError(t)), e), n
},
loosen: function() {
return Promise.resolve(this)
},
_run: function(e, t) {
var r;
try {
r = e.call(this.context, t)
} catch (i) {
return void o.call(this, i)
}
n.call(this, r)
},
_handle: function() {
if (this.state === d.PENDING) {
var e = this._parent;
switch (this.type) {
case s.THENABLE:
if (e.state === d.FULFILLED) {
var t = this._onResolve;
t ? this._run(t, e.value) : n.call(this, e.value)
} else if (this._onReject) {
var r = this._catchTypes,
i = r ? r.length : 0,
c = e.value;
if (0 === i) return void this._run(this._onReject, c);
for (var u = 0; i > u; u++)
if (c instanceof r[u]) return void this._run(this._onReject, c);
o.call(this, c)
} else o.call(this, e.value);
return;
case s.FINALLY:
try {
this._onResolve.call(this.context)
} catch (l) {
a(l)
}
default:
e.state === d.FULFILLED ? n.call(this, e.value) : o.call(this, e.value)
}
}
},
_addChild: function(e) {
e._parent = this, e.context = this.context, e._cancellable = this._cancellable, e.type === s.META && (e._forceable = this._forceable), this.state === d.PENDING ? this._subs.push(e) : e._handle()
},
_notifySubs: function() {
this._subs.forEach(function(e) {
e._handle()
})
}
}, r.delay = function() {
var e, t;
switch (arguments.length) {
case 0:
e = 0;
break;
case 1:
e = arguments[0];
break;
default:
e = arguments[1], t = arguments[0]
}
return new r(function(r) {
setTimeout(r.bind(null, t), e)
})
}, r.resolve = function(e) {
var t = new r;
return n.call(t, e), t
}, r.reject = function(e) {
var t = new r;
return o.call(t, e), t
}, e.exports = r
}, function(e, t) {
var r = Object;
e.exports = {
create: r.create,
getProto: r.getPrototypeOf,
isEnum: {}.propertyIsEnumerable,
getDesc: r.getOwnPropertyDescriptor,
setDesc: r.defineProperty,
setDescs: r.defineProperties,
getKeys: r.keys,
getNames: r.getOwnPropertyNames,
getSymbols: r.getOwnPropertySymbols,
each: [].forEach
}
}, , , , , function(e, t, r) {
"use strict";
function n(e, t) {
var r, n, o, i = /(\.0)+[^\.]*$/;
for (e = (e + "").replace(i, "").split("."), t = (t + "").replace(i, "").split("."), o = Math.min(e.length, t.length), r = 0; o > r; r++)
if (n = parseInt(e[r], 10) - parseInt(t[r], 10), 0 !== n) return n;
return e.length - t.length
}
function o(e, t) {
return n(e, t) >= 0
}
var i, a = r(589),
s = window.navigator.userAgent;
i = new a, i.setUA(s);
var d = (i.getBrowser().name || "").toUpperCase(),
c = i.getBrowser().version || "0.0.0",
u = (i.getEngine().name || "").toUpperCase(),
l = (i.getOS().name || "").toUpperCase(),
f = i.getOS().version || "0.0.0",
h = !u || "WEBKIT" === u,
p = "SAFARI" === d,
m = "CHROME" === d,
g = "TRIDENT" === u || "EDGEHTML" === u,
_ = "GECKO" === u,
v = !1;
switch (l) {
case "MAC OS":
m ? v = o(f, "10.10") && o(c, "41.0.0") : o(f, "10.7") && (v = !0);
break;
case "WINDOWS":
o(f, "8.1") && (_ ? v = !0 : m && o(c, "41.0.0") && (v = !0))
}
e.exports = {
isWebkit: h,
isGecko: _,
isTrident: g,
isSafari: p,
hasEmoji: v,
os: l.toLowerCase(),
browser: d.toLowerCase(),
parser: i
}
}, function(e, t, r) {
"use strict";
function n(e) {
return "number" == typeof e && e === Math.floor(e)
}
function o(e, t, r) {
var o = this;
this.name = e, this.id = t, this.type = r, _.isObject(r) ? ! function() {
var e = _.invert(r);
o.validator = function(t) {
return t in e
}
}() : r === g || r === b ? this.validator = n : this.validator = r
}
function i(e, t, r) {
return w[e] ? w[e] : w[e] = new o(e, t, r)
}
function a(e, t, r) {
var n = {
id: t
},
o = {};
for (var a in r) {
var s = r[a];
s[1] === b && (n["mark" + _.capitalize(a)] = c(a));
var d = i(a, s[0], s[1]);
o[a] = d.validator
}
var l = h.define(e, o, u);
_.extend(l.prototype, n), E[e] = l
}
function s(e) {
for (var t in e) {
var r = e[t];
a(t, r[0], r[1])
}
}
function d(e) {
var t = {},
r = function(r) {
var n = e[r],
o = i(r, n[0], n[1]);
t[r] = {
type: o.validator,
allowNull: !0,
set: function(e) {
this.commitOnSet && p.set(o, e)
}
}
};
for (var n in e) r(n);
var o = h.define("Global", t, l);
f = new o
}
function c(e) {
return function() {
this[e] = Date.now() - this.eventTime
}
}
function u() {
this.eventTime = Date.now(), this.commitTime = void 0
}
function l() {
this.commitOnSet = !0
}
var f, h = r(387),
p = r(154),
m = "boolean",
g = "integer",
v = "number",
y = "string",
b = "timer",
w = {},
E = {};
u.prototype = _.extend(Object.create(h.prototype), {
commit: function() {
p.commit(this)
},
setTime: function(e) {
this.eventTime = e || Date.now()
}
});
var S = {
IPHONE: 1,
ANDROID: 2,
BB: 3,
BBX: 7,
S40: 4,
SYMBIAN: 5,
WP: 6,
WEBCLIENT: 8,
OSMETA: 11,
TEST: 9,
UNKNOWN: 10
},
N = {
UNCACHED: 0,
IDLE: 1,
CHECKING: 2,
DOWNLOADING: 3,
UPDATEREADY: 4,
OBSOLETE: 5
},
T = {
PROD: 0,
INTERN: 1,
DEV: 2
},
$ = {
NAVIGATE_NEXT: 0,
RELOAD: 1,
BACK_FORWARD: 2,
UNDEFINED: 255
},
C = {
OFFLINE: 0,
OPENING: 1,
PAIRING: 2,
SYNCING: 3,
RESUMING: 4,
CONNECTING: 5,
NORMAL: 6,
TIMEOUT: 7
},
A = {
QR: 0,
MAIN: 1,
SYNCING: 2,
OFFLINE: 3,
CONFLICT: 4,
PROXYBLOCK: 5
},
I = {
WEB: 1,
WIN32: 2,
DARWIN: 3
};
l.prototype = Object.create(h.prototype), d({
appIsBetaRelease: [21, m],
appVersion: [17, y],
browser: [779, y],
browserVersion: [295, y],
deviceName: [13, y],
mcc: [5, g],
mnc: [3, g],
platform: [11, S],
webcBucket: [875, y],
webcEnv: [633, T],
webcPhoneCharging: [783, m],
webcPhoneDeviceManufacturer: [829, y],
webcPhoneDeviceModel: [831, y],
webcPhoneOsBuildNumber: [833, y],
webcPhoneOsVersion: [835, y],
webcPhonePlatform: [707, S],
webcWebPlatform: [899, I]
}), s({
WebcAvailableChange: [772, {
webcAvailable: [645, m],
webcAvailableDuration: [776, b]
}],
WebcChatOpen: [864, {
webcUnreadCount: [866, v],
webcChatOpenT: [868, b]
}],
WebcIdbOpen: [874, {
webcIdbOpenT: [876, b],
webcIdbOpenSuccess: [781, m]
}],
WebcManualWebsocketAttempt: [896, {
webcManualWebsocketAttemptSuccessful: [811, m]
}],
WebcMediaAnalyzed: [912, {
webcMediaSupported: [863, m],
webcMediaExtensions: [865, y],
webcMediaAnalyzeT: [914, b]
}],
WebcNotificationSet: [830, {
webcNotificationOn: [709, m]
}],
WebcPageLoad: [642, {
webcUnloadEventStart: [648, b],
webcUnloadEventEnd: [650, b],
webcRedirectStart: [652, b],
webcRedirectEnd: [654, b],
webcFetchStart: [656, b],
webcDomainLookupStart: [658, b],
webcDomainLookupEnd: [660, b],
webcConnectStart: [662, b],
webcConnectEnd: [664, b],
webcSecureConnectionStart: [666, b],
webcRequestStart: [668, b],
webcResponseStart: [670, b],
webcResponseEnd: [672, b],
webcDomLoading: [674, b],
webcDomInteractive: [676, b],
webcDomContentLoadedEventStart: [678, b],
webcDomContentLoadedEventEnd: [680, b],
webcDomComplete: [682, b],
webcLoadEventStart: [684, b],
webcLoadEventEnd: [686, b],
webcExeStart: [760, b],
webcExeDone: [756, b],
webcWsOpening: [704, b],
webcWsPairing: [706, b],
webcWsSyncing: [708, b],
webcWsNormal: [710, b],
webcWsAttempts: [712, v],
webcAppcacheStatus: [629, N],
webcCached: [565, m],
webcQrCode: [601, m],
webcNavigation: [591, $],
webcRedirectCount: [700, v],
webcPageLoadT: [644, b]
}],
WebcPageResume: [884, {
webcResumeCount: [785, g]
}],
WebcPhoneDisconnected: [878, {
webcPhoneDisconnectedT: [880, b],
webcPhoneBbarShownT: [882, b]
}],
WebcResourceLoad: [688, {
webcResourceName: [567, y],
webcResourceDuration: [690, b],
webcResourceCached: [569, m]
}],
WebcStreamInfoChange: [768, {
webcStreamInfo: [641, C],
webcStreamInfoDuration: [774, b]
}],
WebcStreamModeChange: [770, {
webcStreamMode: [643, A]
}],
WebcWamUpload: [916, {
webcTotalT: [918, b],
webcAvailableTp: [920, v],
webcAvailableBbarTp: [922, v],
webcAvailableNormalTp: [924, v],
webcUnavailableTp: [926, v],
webcUnavailableBbarTp: [928, v],
webcUnavailableNormalTp: [930, v]
}],
WebcWsOpen: [740, {
webcWsOpenT: [738, b]
}],
WebcWsTimeout: [742, {
webcWsTimeoutT: [744, b]
}]
}), e.exports = _.defaults({}, E, {
METRICS: w,
Global: f,
WamEvent: u,
PLATFORM_TYPE: S,
WEBC_APPCACHE_STATUS_CODE: N,
WEBC_ENV_CODE: T,
WEBC_NAVIGATION_TYPE: $,
WEBC_STREAM_INFO_CODE: C,
WEBC_STREAM_MODE_CODE: A,
WEBC_WEB_PLATFORM_TYPE: I
})
}, , , function(e, t, r) {
"use strict";
var n = r(5),
o = n.createClass({
displayName: "ErrorDialog",
propTypes: {
title: n.PropTypes.node,
body: n.PropTypes.node.isRequired,
tip: n.PropTypes.node,
cancelLabel: n.PropTypes.node,
onCancel: n.PropTypes.func,
defaultLabel: n.PropTypes.node,
onDefault: n.PropTypes.func
},
render: function() {
var e = this.props.tip ? n.createElement("div", {
className: "popup-contents"
}, this.props.body, n.createElement("hr", null), n.createElement("div", {
className: "text text-tip"
}, this.props.tip)) : n.createElement("div", {
className: "popup-contents"
}, this.props.body),
t = this.props.title ? n.createElement("div", {
className: "popup-title",
dir: "auto"
}, this.props.title) : null,
r = [];
return this.props.onCancel && this.props.cancelLabel && r.push(n.createElement("button", {
className: "btn-plain popup-controls-item",
onClick: this.props.onCancel,
key: "secondary"
}, this.props.cancelLabel)), this.props.onDefault && this.props.defaultLabel && r.push(n.createElement("button", {
className: "btn-plain btn-default popup-controls-item",
onClick: this.props.onDefault,
key: "primary"
}, this.props.defaultLabel)), r.length && (r = n.createElement("div", {
className: "popup-controls"
}, r)), n.createElement("div", null, n.createElement("div", {
className: "backdrop backdrop-transparent"
}, n.createElement("div", {
className: "popup-container"
}, n.createElement("div", {
className: "popup"
}, n.createElement("div", {
className: "popup-body"
}, t, e), r))))
}
});
e.exports = o
}, function(e, t, r) {
"use strict";
function n(e) {
p = e
}
function o() {
p = void 0
}
function i() {
return p
}
function a() {
if (!p) return v.log("secret_bundle:getSecurityToken: no secret bundle!")(), "nosecretbundle!";
var e = l(_.toArray(arguments));
return e.toString(CryptoJS.enc.Base64)
}
function s(e, t, r) {
"0.1" === e ? t && r ? (p.encKey = t, p.macKey = r, p.key = r) : v.error("secret_bundle:setSecretKeys v" + e + " " + t + " " + r)() : v.log("secret_bundle:setSecretKeys unknown version: v" + e)()
}
function d() {
if (p && p.key && p.keyPair) return p.key.toString(CryptoJS.enc.Base64);
var e = g.keyPair(),
t = CryptoJS.lib.WordArray.create(e.pubKey),
r = CryptoJS.enc.Base64.stringify(t),
o = {
key: CryptoJS.enc.Base64.parse(r),
keyPair: e
};
return n(o), r
}
function c() {
var e = y.getSecretBundle();
return e ? (n(e), e) : (v.log("secret_bundle:load: attempted to load non-existent secret bundle!")(), null)
}
function u() {
return p ? (delete p.keyPair, void y.setSecretBundle(p)) : void v.log("secret_bundle:save: trying to save empty secret bundle!")()
}
function l(e) {
for (var t = p.key.toString(CryptoJS.enc.Base64), r = f(e), n = [], o = 0; o < r.length; o++) {
var i = CryptoJS.enc.Base64.parse(t);
n.push(CryptoJS.HmacSHA256(r[o], i))
}
return n.reduce(h)
}
function f(e) {
var t = [];
if (null === e || "undefined" == typeof e) return [];
if (_.isArray(e))
for (var r = 0; r < e.length; r++) t = t.concat(f(e[r]));
else if ("object" == typeof e)
if ("undefined" != typeof e.words && "undefined" != typeof e.sigBytes) t.push(e);
else
for (var n in e) {
var o = e[n];
o && (t = t.concat(f(o)))
} else t.push(m.userToLegacy(e.toString()));
return t
}
function h(e, t) {
var r, n;
e.sigBytes > t.sigBytes ? (n = e, r = t) : (n = t, r = e);
for (var o = r.words.length, i = 0; o > i; i++) n.words[i] = r.words[i] ^ n.words[i];
return n
}
var p, m = r(19),
g = r(152),
v = r(1),
y = r(13);
e.exports = {
set: n,
get: i,
clear: o,
getOrGenerate: d,
load: c,
save: u,
getSecurityToken: a,
setSecretKeys: s
}
}, , , , , , function(e, t) {
"use strict";
var r, n = {
build: function(e, t) {
return t && (t = _.chain(t).map(function(e, t) {
return e ? encodeURIComponent(t) + "=" + encodeURIComponent(e) : null
}).compact().join("&").value()), t ? e + "?" + t : e
},
relToAbs: function(e) {
return r || (r = document.createElement("a")), r.href = e, r.href
},
hostname: _.memoize(function(e) {
return r || (r = document.createElement("a")), r.href = this.isHttp(e) ? e : "http://" + e, r.hostname
}),
isHttp: function(e) {
return e && ("https://" === e.toLowerCase().substring(0, 8) || "http://" === e.toLowerCase().substring(0, 7))
},
isBlob: function(e) {
return _.isString(e) && "blob:" === e.substring(0, 5)
},
isEncryptedMedia: function(e) {
return e && _.isString(e) && _.endsWith(e, ".enc")
},
parseDataURL: function(e) {
var t = e.indexOf(":"),
r = e.indexOf(";"),
n = e.indexOf(",");
return {
mimetype: e.substring(t + 1, r),
data: e.substring(n + 1)
}
}
};
e.exports = n
}, function(e, t, r) {
"use strict";
var n = r(1),
o = r(43),
i = r(75),
a = o.extend(i, {
extraProperties: "allow",
session: {
_uiObservers: {
type: "number",
"default": 0
},
_promises: {
type: "array",
"default": function() {
return []
}
},
stale: "boolean"
},
derived: {
isObserved: {
deps: ["_uiObservers"],
fn: function() {
return this._uiObservers > 0
}
}
},
update: function() {
return this.getCollection().update(this.id)
},
find: function() {
return this.getCollection().find(this.id)
},
getCollection: function() {
return this.Collection ? Store[this.Collection] : n.error("baseState:getCollection Attempting to get a non existing collection")()
},
getp: function(e) {
if (_.isString(e)) {
for (var t = e.split("."), r = this, n = 0; n < t.length; n++) {
if (!r) throw Error("Path: " + e + " is not defined");
r = r.get(t[n])
}
return r
}
},
regCancellablePromise: function(e) {
var t = this;
return this._promises.push(e), e.cancellable()["finally"](function() {
t._promises = _.without(t._promises, e)
})
},
hasPendingPromises: function() {
return this._promises && this._promises.length > 0
},
cancelPendingPromises: function() {
this.hasPendingPromises() && (this._promises.forEach(function(e) {
e.cancel()
}), this._promises = [])
},
set: function(e, t) {
return t && t.merge && _.isObject(e) ? o.prototype.set.call(this, _.omit(e, _.isUndefined), t) : o.prototype.set.call(this, e, t)
},
"delete": function() {
this.stopListening()
}
});
e.exports = a
}, function(e, t, r) {
"use strict";
function n() {
switch (f.state) {
case f.STATE.TIMEOUT:
return b.TIMEOUT;
case f.STATE.OPENING:
return l.online ? b.OPENING : b.OFFLINE;
case f.STATE.PAIRING:
return f.hasSynced ? b.RESUMING : b.PAIRING;
case f.STATE.CONNECTED:
return f.stream !== f.STREAM.CONNECTED ? f.hasSynced ? b.NORMAL : b.SYNCING : b.NORMAL;
case f.STATE.UNLAUNCHED:
case f.STATE.PROXYBLOCK:
default:
return b.NORMAL
}
}
function o() {
if (!v.knowsPhone() && f.state !== f.STATE.PROXYBLOCK) return w.QR;
var e = f.hasSynced;
switch (f.state) {
case f.STATE.PROXYBLOCK:
return w.PROXYBLOCK;
case f.STATE.CONFLICT:
return w.CONFLICT;
case f.STATE.TOS_BLOCK:
return w.TOS_BLOCK;
case f.STATE.UNLAUNCHED:
return w.SYNCING;
case f.STATE.UNPAIRED_IDLE:
case f.STATE.UNPAIRED:
return w.QR;
case f.STATE.OPENING:
if (!l.online && !f.hasSynced) return w.OFFLINE;
default:
return e || f.stream === f.STREAM.CONNECTED ? w.MAIN : w.SYNCING
}
}
function i(e, t) {
switch (t) {
case E.SHOW:
return e;
case E.HIDE:
return f.hasSynced ? b.NORMAL : b.CONNECTING;
case E.OBSCURE:
switch (e) {
case b.OPENING:
case b.PAIRING:
case b.SYNCING:
case b.RESUMING:
return b.CONNECTING;
default:
return e
}
}
}
var a = r(6),
s = r(1),
d = r(52),
c = r(41),
u = r(89),
l = r(98),
f = r(10),
h = r(18),
p = r(30),
m = r(96),
g = r(54),
v = r(13),
y = r(97),
b = {
OFFLINE: "OFFLINE",
OPENING: "OPENING",
PAIRING: "PAIRING",
SYNCING: "SYNCING",
RESUMING: "RESUMING",
CONNECTING: "CONNECTING",
NORMAL: "NORMAL",
TIMEOUT: "TIMEOUT"
},
w = {
QR: "QR",
MAIN: "MAIN",
SYNCING: "SYNCING",
OFFLINE: "OFFLINE",
CONFLICT: "CONFLICT",
PROXYBLOCK: "PROXYBLOCK",
TOS_BLOCK: "TOS_BLOCK"
},
E = {
SHOW: "SHOW",
OBSCURE: "OBSCURE",
HIDE: "HIDE"
},
S = 3e3,
N = d.extend({
extraProperties: "reject",
session: {
info: {
type: "string",
values: _.values(b),
"default": b.NORMAL
},
obscurity: {
type: "string",
values: _.values(E),
"default": E.HIDE
},
mode: {
type: "string",
values: _.values(w),
"default": w.SYNCING
},
needsUpdate: "boolean",
couldForce: "boolean",
uiActive: "boolean",
available: ["boolean", !1, !0],
unavailableShiftTimer: "object",
unavailableLogoutTimer: "object",
unobscureShiftTimer: "object",
timeoutEvent: "object",
resumeCount: {
type: "number",
"default": 0
},
phoneActive: "boolean",
phoneAuthed: ["boolean", !1, !1]
},
derived: {
displayInfo: {
deps: ["info", "obscurity"],
fn: function() {
return i(this.info, this.obscurity)
}
}
},
initialize: function() {
this.unavailableShiftTimer = new g(this, this.markUnavailable), this.unobscureShiftTimer = new g(this, this.unobscure), this.unavailableLogoutTimer = new g(function() {
v.getRememberMe() || (s.log("Stream:unavailableLogoutTimer logout due to inactivity")(), f.logout())
}), this.listenTo(f, "change:state change:stream change:hasSynced", this.onSocketUpdate), this.listenTo(l, "change:online", this.onSocketUpdate), this.listenTo(this, "change:available", this.onAvailableUpdate), this.listenTo(this, "change:phoneAuthed", this.onPhoneAuthedUpdate), this.listenTo(this, "change:info change:displayInfo change:mode", _.debounce(this.onSelfUpdate)), this.listenTo(this, "change:info", this.logPageResume), this.listenTo(this, "change:info", this.updateWamLog), this.listenTo(this, "change:available change:uiActive", this.updateCouldForce.bind(this, !1)), document.addEventListener("visibilitychange", this.updateCouldForce.bind(this, !1)), this.updateCouldForce(!1)
},
"delete": function() {},
INFO: b,
MODE: w,
handle: function(e) {
switch (e[0]) {
case "awake":
this.phoneActive = !1, this.phoneActive = !0;
break;
case "asleep":
this.phoneActive = !1;
break;
case "update":
m.update(e[1], e[2]);
break;
case "killsw":
m.killServiceWorker();
break;
case "update_desktop":
m.updateDesktop(e[1], e[2], e[3]);
break;
case "desktop_manual_download":
Store.Stream.needsManualDownload = e[1];
break;
default:
s.error("Stream:handle unknown cmd " + e[0], e)()
}
},
markAvailable: function() {
this.unavailableShiftTimer.cancel(), this.available = !0, u.monitor(!0, this.displayInfo === b.TIMEOUT)
},
markUnavailable: function(e) {
e ? this.unavailableShiftTimer.before(e) : (this.unavailableShiftTimer.cancel(), this.available = !1, u.monitor(!1, this.displayInfo === b.TIMEOUT))
},
onSelfUpdate: function() {
var e = this.timeoutEvent;
this.info === b.TIMEOUT ? (e || (this.timeoutEvent = e = new c.WebcPhoneDisconnected), this.displayInfo !== b.TIMEOUT || e._bbarTime || (e._bbarTime = Date.now())) : e && (e.markWebcPhoneDisconnectedT(), e._bbarTime && (e.webcPhoneBbarShownT = Date.now() - e._bbarTime), e.commit(), this.timeoutEvent = null), s.log("Stream:onSelfUpdate mode:" + this.mode + (" info:" + this.info + " view:" + this.displayInfo))()
},
onSocketUpdate: function() {
var e = {},
t = f.previousAttributes();
t.stream !== f.stream && f.stream === f.STREAM.DISCONNECTED && (e.phoneActive = !1);
var r = n();
if (e.info = r, e.mode = o(), e.phoneAuthed = f.stream !== f.STREAM.DISCONNECTED, r === b.NORMAL) this.unobscureShiftTimer.cancel(), e.obscurity = E.HIDE;
else if (r === b.OFFLINE) this.unobscureShiftTimer.cancel(), e.obscurity = E.OBSCURE;
else switch (this.obscurity) {
case E.HIDE:
this.unobscureShiftTimer.before(a.DIAGNOSTIC_DELAY);
break;
case E.OBSCURE:
this.unobscureShiftTimer.before(S);
break;
case E.SHOW:
}
this.set(e)
},
unobscure: function() {
this.obscurity = E.SHOW
},
onPhoneAuthedUpdate: function() {
this.phoneAuthed && (this.sendAvailability(!0), Store.RecentEmoji.sync())
},
onAvailableUpdate: function() {
var e = this.available;
s.log("Stream:onAvailableUpdate user " + (e ? "available" : "unavailable"))(), e || v.getRememberMe() ? this.unavailableLogoutTimer.cancel() : this.unavailableLogoutTimer.before(a.IDLE_TIMEOUT), this.sendAvailability(!1)
},
sendAvailability: function(e) {
(e || this.uiActive) && (this.available ? p.sendPresenceAvailable()["catch"](h.WapDrop, _.noop) : p.sendPresenceUnavailable()["catch"](h.WapDrop, _.noop))
},
updateCouldForce: function() {
this.couldForce = !this.uiActive || !this.available && document.hidden
},
logPageResume: function() {
this.info === b.RESUMING && (this.resumeCount++, new c.WebcPageResume({
webcResumeCount: this.resumeCount
}).commit())
},
updateWamLog: function() {
var e = this.info === b.NORMAL;
u.streamInfoChange(this.info, y.numSocketsAttempted, e), e && this.stopListening(null, "change:info", this.updateWamLog)
}
});
e.exports = new N
}, function(e, t) {
"use strict";
function r() {
this.cancel(), this.foo.apply(this.context, arguments)
}
var n = function() {
1 === arguments.length ? (this.context = null, this.foo = arguments[0]) : (this.context = arguments[0], this.foo = arguments[1]), this.timer = 0, this.ts = 0, this._before = 0, this._after = 0, this.trigger = r.bind(this)
};
n.prototype = {
before: function(e) {
var t = e + Date.now(),
r = this.ts;
return this._before && this._before < t ? r : this._after && t < this._after ? r : (this._before = t, (!r || r > t) && (arguments[0] = t, r = this.set.apply(this, arguments)), r)
},
after: function(e) {
var t = e + Date.now(),
r = this.ts;
return this._after && this._after > t ? r : this._before && t > this._before ? r : (this._after = t, (!r || r > t) && (arguments[0] = t, r = this.set.apply(this, arguments)), r)
},
debounce: function(e) {
return arguments[0] = e + Date.now(), this.set.apply(this, arguments)
},
debounceAndCap: function(e, t) {
if (arguments.length <= 2) this.debounce(e), this.before(t);
else {
for (var r = new Array(arguments.length - 1), n = 2; n < arguments.length; n++) r[n - 1] = arguments[n];
r[0] = e, this.debounce.apply(this, r), r[0] = t, this.before.apply(this, r)
}
},
set: function(e) {
for (var t = this, n = arguments.length, o = Array(n > 1 ? n - 1 : 0), i = 1; n > i; i++) o[i - 1] = arguments[i];
var a = Date.now();
if (e = Math.max(e, a), this._before && this._before < e || this._after && this._after > e) return this.ts;
this.timer && clearTimeout(this.timer);
var s = e - a;
return this.timer = o.length > 0 ? setTimeout(function() {
r.apply(t, o)
}, s) : setTimeout(this.trigger, s), this.ts = e
},
cancel: function() {
this.timer && (clearTimeout(this.timer), this.timer = 0, this.ts = 0, this._before = 0, this._after = 0)
}
}, e.exports = n
}, function(e, t, r) {
"use strict";
function n(e) {
"number" == typeof e && (e = "v" + e);
var t = m[e];
t || (o.error("binaryProtocol unknown version: " + e)(), a.upload("bp_unknown_version", !0)["finally"](function() {
return i.hardRefresh()
}));
var r = t.OutputStream,
n = new t.Writer(t.Dictionary),
s = t.InputStream,
d = new t.Reader(t.Dictionary),
c = t.Crypto;
this.Node = t.Node, this.read = function(e) {
var t;
try {
var r = new s(c.decrypt(e));
t = d.readNode(r)
} catch (n) {
o.errorVerbose("binaryProtocol:read error " + n.stack)()
}
return t
}, this.write = function(e) {
var t;
try {
var i = new r;
n.writeNode(i, e), t = c.encrypt(i.toBuffer())
} catch (a) {
o.errorVerbose("binaryProtocol:write error " + a.stack)()
}
return t
}
}
var o = r(1),
i = r(14),
a = r(9),
s = {
OutputStream: r(347),
Writer: r(349),
InputStream: r(345),
Reader: r(348),
Dictionary: r(344),
Node: r(346),
Crypto: r(343)
},
d = {
OutputStream: r(354),
Writer: r(356),
InputStream: r(352),
Reader: r(355),
Dictionary: r(351),
Node: r(353),
Crypto: r(350)
},
c = _.defaults({
Dictionary: r(357)
}, d),
u = _.defaults({
Dictionary: r(358)
}, c),
l = _.defaults({
Writer: r(360),
Reader: r(359)
}, u),
f = _.defaults({
Dictionary: r(361)
}, l),
h = _.defaults({
Dictionary: r(362)
}, f),
p = _.defaults({
Dictionary: r(363)
}, h),
m = {
"01": s,
"03": d,
"04": c,
"05": u,
"06": l,
v1: u,
v2: l,
v3: f,
v4: h,
v5: p
};
e.exports = n
}, function(e, t, r) {
var n = r(77);
e.exports = function(e) {
if (!n(e)) throw TypeError(e + " is not an object!");
return e
}
}, function(e, t) {
var r = e.exports = {
version: "1.2.6"
};
"number" == typeof __e && (__e = r)
}, function(e, t, r) {
var n = r(100);
e.exports = function(e, t, r) {
if (n(e), void 0 === t) return e;
switch (r) {
case 1:
return function(r) {
return e.call(t, r)
};
case 2:
return function(r, n) {
return e.call(t, r, n)
};
case 3:
return function(r, n, o) {
return e.call(t, r, n, o)
}
}
return function() {
return e.apply(t, arguments)
}
}
}, function(e, t) {
e.exports = {}
}, , , , , , , , , , , function(e, t, r) {
"use strict";
function n(e) {
return e && _.isFunction(e.isMounted) && e.isMounted() ? i.findDOMNode(e) : null
}
function o(e, t) {
var r;
return e && t && (r = n(e.component)) && r.contains(t)
}
var i = r(24),
a = r(8),
s = r(40),
d = r(1),
c = {
TOOLTIP: "tooltip",
MENU: "menu",
MODAL: "modal",
MODAL_MEDIA: "modal_media",
EMOJI: "emoji",
DRAWER_LEFT: "drawer_left",
DRAWER_MID: "drawer_mid",
DRAWER_RIGHT: "drawer_right",
PTT: "ptt_recorder",
MAIN: "main",
CONVERSATION_FOOTER: "conversation_footer",
MEDIA_VIEWER: "media_viewer",
STATUS_INPUT: "status_input",
ADVANCED_INPUT: "advanced_input",
SUBJECT_INPUT: "subject_input",
COMPOSE_INPUT: "compose_input",
CAPTION_INPUT: "caption_input",
CONTACT_SEARCH: "contact_search",
CHAT_SEARCH: "chat_search",
CHATLIST_PANEL: "chatlist_panel",
SETTINGS_DRAWER: "settings_drawer",
BLOCKED_DRAWER: "blocked_drawer",
IGNORE_ANY: "any",
IGNORE_CONTEXT: "contextmenu",
_stack: [],
_base: null,
_events: !1,
push: function(e, t) {
var r, n = arguments.length <= 2 || void 0 === arguments[2] ? {} : arguments[2];
(r = this.find(t)) && (this._stack = _.without(this._stack, r)), r = {
component: e,
type: t,
popable: !!n.popable,
escapable: !!n.escapable || !!n.popable,
maintainFocus: !!n.maintainFocus,
parent: n.parent
}, this._stack.push(r), this._listeners(), this._focus()
},
pop: function(e, t) {
if (this._stack.length) {
var r;
if (e ? r = this.find(e) : (r = _.last(this._stack), r = r.popable ? r : null), r) {
var n = this._deps(r.component);
n.push(r), this._close(n, t)
}
}
},
popDependents: function(e) {
this._close(this._deps(e))
},
stealFocus: function(e) {
for (var t, r = function(t) {
return t.maintainFocus && t.type !== e
}; t = _.find(this._stack, r);) {
var n = this._deps(t.component);
n.push(t), this._close(n)
}
},
_close: function(e, t) {
var r = this;
if (!_.isEmpty(e)) {
var i = this._stack;
e.forEach(function(e) {
e.index = _.findIndex(i, e)
}), e = e.sort(function(e, t) {
return t.index - e.index
});
var a = _.findLast(e, "parent"),
s = document.activeElement;
e.forEach(function(e) {
r.unregBubbleTrap(e), i = _.without(i, e), o(e, s) && _.isFunction(s.blur) && r.blurNode(s), _.isFunction(e.component.uimClose) && e.component.uimClose(e.type, t)
}), this._stack = i, this._listeners(), document.activeElement === document.body && (a ? this.focusNodeOrParent(n(a.parent)) : this._focus(t))
}
},
focusNodeOrParent: function(e) {
for (; e && _.isFunction(e.focus);) {
if (this.focusNode(e), document.activeElement === e) return;
e = e.parentNode
}
},
_deps: function(e) {
var t = this,
r = _.filter(this._stack, {
parent: e
});
return _.flatten(r, _.chain(r).pluck("component").map(function(e) {
return t._deps(e)
}).value())
},
top: function() {
return _.last(this._stack) || this._base
},
find: function(e) {
return _.find(this._stack, {
type: e
})
},
_listeners: function() {
var e = this.top();
e && e.popable ? this.regListeners() : this.unregListeners()
},
_focus: function(e) {
var t = this.top();
t && _.isFunction(t.component.uimFocus) && t.component.isMounted() && t.component.uimFocus(t.type, e)
},
regListeners: function() {
this._events || (window.addEventListener("DOMMouseScroll", this.maybePreventDefault, !0), window.addEventListener("mousewheel", this.maybePreventDefault, !0), a.on("window_mousedown", this.onMouseDown), window.addEventListener("resize", this.onResize, !0), this._events = !0)
},
unregListeners: function() {
this._events && (window.removeEventListener("DOMMouseScroll", this.maybePreventDefault, !0), window.removeEventListener("mousewheel", this.maybePreventDefault, !0), a.off("window_mousedown", this.onMouseDown), window.removeEventListener("resize", this.onResize, !0), this._events = !1)
},
regBubbleTrap: function(e) {
var t = n(e.parent);
t && (t.addEventListener("click", this.stopEvent), t.addEventListener("contextmenu", this.stopEvent))
},
unregBubbleTrap: function(e) {
var t = n(e.parent);
t && (t.removeEventListener("click", this.stopEvent), t.removeEventListener("contextmenu", this.stopEvent))
},
stopEvent: function(e) {
e.preventDefault(), e.stopPropagation()
},
maybePreventDefault: function(e) {
return o(this.top(), e.target) ? !0 : (e.preventDefault(), void e.stopPropagation())
},
maintainFocus: function(e) {
var t = _.findLast(this._stack, "maintainFocus");
t && t.component.uimFocus && (o(t, e.target) || (e.preventDefault(), t.component.uimFocus()))
},
onMouseDown: function(e) {
this.unregEatClick();
var t = e.target,
r = _.last(this._stack);
if (o(r, t)) return void this.maintainFocus(e);
var n = "click";
e.button > 0 && (n = "contextmenu");
for (var i = !0; t !== document;) {
var a = t.getAttribute("data-ignore-capture");
if (a) {
if (a === c.IGNORE_ANY || a === n) {
i = !1;
break
}
break
}
t = t.parentNode
}
this.pop(), this.maintainFocus(e), i && this.regEatClick()
},
regEatClick: function() {
a.on("window_click", this.onClick), a.on("window_mousedown", this.unregEatClick)
},
unregEatClick: function() {
a.off("window_click", this.onClick), a.off("window_mousedown", this.unregEatClick)
},
onClick: function(e) {
s.isGecko && "click" === e.type && e.button > 0 || (this.unregEatClick(), e.defaultPrevented || (e.preventDefault(), e.stopPropagation()))
},
onResize: function(e) {
for (var t = this.top(); t && t.popable;) this.pop(), t = this.top()
},
focusNode: function(e) {
e.focus()
},
blurNode: function(e) {
e.blur()
}
};
"maybePreventDefault stopEvent onMouseDown regEatClick unregEatClick onClick onResize".split(/ /).forEach(function(e) {
c[e] = c[e].bind(c)
}), window.addEventListener("keydown", function(e) {
if (27 === e.keyCode) {
e.stopPropagation(), e.preventDefault();
var t = _.last(c._stack);
t && t.escapable && c.pop(t.type)
}
}), d.exportToWindow("UIM", c), e.exports = c
}, function(e, t, r) {
"use strict";
function n() {
this.proto = [0, 0], this.F = _(a).flatten().map(_.keys).flatten().concat(_.keys(s)).uniq().map(function(e) {
return [e, e]
}).zipObject().value()
}
var o = !0,
i = r(1),
a = [
[{
RESEND_ICON: !1
}, {}, {}, {
FORWARD_MESSAGE: !0
}, {
SET_STATUS: !0,
SET_PROFILE_PIC: !0,
SET_BLOCK: !0,
MUTE: !0,
ARCHIVE: !0,
ARCHIVE_BROADCAST: !0,
DELETE: !0,
GROUP_CREATE: !0,
GROUP_EXIT: !0,
GROUP_SET_SUBJECT: !0,
GROUP_SET_PIC: !0,
GROUP_ADD_PARTICIPANT: !0,
GROUP_REMOVE_PARTICIPANT: !0,
GROUP_PROMOTE_PARTICIPANT: !0
}, {
RECENT_EMOJI_SYNC: !0,
MESSAGE_DELETE: !0,
MESSAGE_INFO: !0,
CHAT_MARK_UNSEEN: !0,
CHAT_CLEAR: !0
}, {}, {
MUTE_1_1: !0,
MEDIA_RETRY: !0,
STARRED: !o
}, {
SPAM: !0,
FULL_TEXT_SEARCH: !o
}]
],
s = {
KEY_PARTICIPANT: !1,
MEDIA_RETRY: !1,
STARRED: !1,
DOCUMENT: !1,
URL: !1,
CHAT_CLEAR_STARRED: !1,
ENC_IMAGE: !1,
ENC_AUDIO: !1,
ENC_VIDEO: !1,
ENC_DOC: !1,
RICH_TEXT: !o
};
n.prototype = {
setVersion: function(e) {
if (this.proto.length !== e.length || this.proto[0] !== e[0] || this.proto[1] !== e[1]) {
this.proto = e;
var t = a.slice(0, e[0] + 1),
r = a.slice(e[0] + 1, a.length),
n = t[e[0]],
o = n.slice(0, e[1] + 1),
i = n.slice(e[1] + 1, n.length);
t[e[0]] = o, r.unshift(i), this.features = _.merge(_.omit(_.merge.apply(_, [{}].concat(_.flatten(t))), function(e) {
return !e
}), this.features || {});
var s = _.merge.apply(_, [{}].concat(_.flatten(r)));
this.features = _.omit(this.features, function(e, t) {
return !!s[t]
}), this.VF = _(_.keys(_.merge.apply(_, [{}].concat(_.flatten(t))))).map(function(e) {
return [e, e]
}).zipObject().value()
}
},
setPlatform: function(e) {
switch (e) {
case "iphone":
this.features.RECENT_EMOJI_SYNC = !1, this.features.ARCHIVE_BROADCAST = !1, this.features.RESEND_ICON = !0;
break;
case "symbian":
case "s40":
case "bb":
this.features.CHAT_MARK_UNSEEN = !1
}
},
setFeature: function(e, t) {
var r = this.features[e] !== t;
return this.features[e] = t, r
},
setFeatures: function(e) {
var t = {},
r = _.merge({}, s, e);
for (var n in r) n in this.VF || (t[n] = this.setFeature(n, !!r[n]));
return t
},
supportsFeature: function(e) {
return !!this.features[e]
},
lt: function(e) {
var t = this.proto;
return e[0] > t[0] || e[0] === t[0] && e[1] > t[1]
},
lte: function(e) {
var t = this.proto;
return e[0] > t[0] || e[0] === t[0] && e[1] >= t[1]
},
gt: function(e) {
var t = this.proto;
return e[0] < t[0] || e[0] === t[0] && e[1] < t[1]
},
gte: function(e) {
var t = this.proto;
return e[0] < t[0] || e[0] === t[0] && e[1] <= t[1]
}
};
var d = new n;
i.exportToWindow("GateKeeper", d), e.exports = d
}, function(e, t, r) {
"use strict";
var n = r(8),
o = {
getCmds: function() {
return this._cmds || (this._cmds = []), this._cmds
},
regCmd: function(e, t) {
if (!_.isFunction(t)) throw Error("handler is not a function");
this.getCmds().push({
cmd: e,
handler: t
}), this.isMounted() && n.on(e, t)
},
unregCmd: function(e, t) {
n.off(e, t), this._cmds = _.reject(this._cmds, _.matches({
cmd: e,
handler: t
}))
},
registerCmds: function() {
this._cmds && this.getCmds().forEach(function(e) {
n.on(e.cmd, e.handler)
})
},
unregisterCmds: function() {
this._cmds && (this.getCmds().forEach(function(e) {
n.off(e.cmd, e.handler)
}), delete this._cmds)
},
componentDidMount: function() {
this.registerCmds()
},
componentWillUnmount: function() {
this.unregisterCmds()
}
};
e.exports = o
}, function(e, t, r) {
"use strict";
function n(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var o = r(5),
i = r(8),
a = r(135),
s = r(39),
d = 3e3,
c = function l(e, t, r) {
if (n(this, l), !e) throw new Error("ActionType must have text!");
if (t && !r || r && !t) throw new Error("ActionType must have an action and a handler or have neither.");
this.text = e, this.action = t, this.handler = r
},
u = o.createClass({
displayName: "ActionToast",
mixins: [a],
propTypes: {
id: o.PropTypes.string.isRequired,
initialAction: o.PropTypes.instanceOf(c).isRequired,
pendingAction: o.PropTypes.instanceOf(Promise).isRequired
},
statics: {
genId: function(e) {
return _.uniqueId(e || "action_toast")
}
},
getInitialState: function() {
return {
actionType: this.props.initialAction,
pending: !0
}
},
componentWillReceiveProps: function(e) {
this.actionPromise && this.actionPromise.control.cancel(), this.setState({
actionType: e.initialAction,
pending: !0
}), this.runAction(e.pendingAction)
},
componentWillMount: function() {
this.runAction(this.props.pendingAction)
},
runAction: function(e) {
var t = this,
r = {};
this.actionPromise = e.bind(this).addRejectControl("cancel", function() {
return r
}).then(function(e) {
this.setState({
actionType: e,
pending: !1
})
})["catch"](function(e) {
return e !== r
}, function(e) {
this.setState({
actionType: e,
pending: !1
})
}).delay(d).addRejectControl("cancel", function() {
return r
}).then(function() {
t.isMounted() && i.closeToast(t)
})["catch"](function(e) {
return e === r
}, _.noop).endWithControls("cancel")
},
onAction: function() {
this.state.actionType.handler()["catch"](_.noop)
},
onDismiss: function() {
i.closeToast(this)
},
render: function() {
var e = this.state.actionType,
t = void 0,
r = void 0;
return e.action && e.handler && (r = o.createElement("button", {
className: "action",
onClick: this.onAction
}, e.action)), this.state.pending || (t = o.createElement("button", {
className: "icon icon-x-alt",
onClick: this.onDismiss
})), o.createElement("div", {
className: s("toast", this.props.className)
}, o.createElement("span", null, e.text), r, t)
}
});
e.exports = {
ActionToast: u,
ActionType: c
}
}, function(e, t) {
"use strict";
function r(e, t, r, n) {
var o;
return o = 0 === e ? r || 0 : Math.pow(2, e), _.isFinite(t) && o > t && (o = t), _.isFinite(r) && r > o && (o = r), n && (o *= 1 + n * Math.random()), o
}
e.exports = {
expBackoff: r
}
}, function(e, t, r) {
"use strict";
var n = r(42),
o = {
listenTo: function(e, t, r) {
if (!_.isObject(e)) throw Error("obj is not an object");
if (_.isObject(t));
else if (!_.isFunction(r)) throw Error("callback is not a function");
n.listenTo.apply(this, arguments)
},
listenToOnce: function(e, t, r) {
if (!_.isObject(e)) throw Error("obj is not an object");
if (_.isObject(t));
else if (!_.isFunction(r)) throw Error("callback is not a function");
n.listenToOnce.apply(this, arguments)
}
};
e.exports = o
}, function(e, t) {
var r = {}.toString;
e.exports = function(e) {
return r.call(e).slice(8, -1)
}
}, function(e, t) {
e.exports = function(e) {
return "object" == typeof e ? null !== e : "function" == typeof e
}
}, , , , , , , , , , , , function(e, t, r) {
"use strict";
function n(e, t, r) {
var n = Math.floor(window.performance.now());
m[e] = n, r && (m.socketSequence = t, o(), i(), h.resumeJobs())
}
function o() {
function e(e) {
var r = 0 | t[e];
return r && r - n
}
if (!(window.performance && window.performance.timing && window.performance.navigation)) return void l.log("MetricReporter:logPageLoad metrics not provided by browser!", "red")();
var t = window.performance.timing,
r = window.performance.navigation,
n = 0 | t.navigationStart,
i = (0 | t.loadEventEnd) - n;
return 0 >= i ? (l.log("MetricReporter:logPageLoad delayed", "blue")(), void _.delay(o, 1e4)) : (p.set({
webcPageLoadT: i,
webcUnloadEventStart: e("unloadEventStart"),
webcUnloadEventEnd: e("unloadEventEnd"),
webcRedirectStart: e("redirectStart"),
webcRedirectEnd: e("redirectEnd"),
webcFetchStart: e("fetchStart"),
webcDomainLookupStart: e("domainLookupStart"),
webcDomainLookupEnd: e("domainLookupEnd"),
webcConnectStart: e("connectStart"),
webcConnectEnd: e("connectEnd"),
webcSecureConnectionStart: e("secureConnectionStart"),
webcRequestStart: e("requestStart"),
webcResponseStart: e("responseStart"),
webcResponseEnd: e("responseEnd"),
webcDomLoading: e("domLoading"),
webcDomInteractive: e("domInteractive"),
webcDomContentLoadedEventStart: e("domContentLoadedEventStart"),
webcDomContentLoadedEventEnd: e("domContentLoadedEventEnd"),
webcDomComplete: e("domComplete"),
webcLoadEventStart: e("loadEventStart"),
webcLoadEventEnd: e("loadEventEnd"),
webcAppcacheStatus: window.applicationCache ? window.applicationCache.status : void 0,
webcCached: t.fetchStart === t.domainLookupEnd,
webcNavigation: r.type,
webcRedirectCount: r.redirectCount,
webcWsOpening: m.OPENING,
webcWsPairing: m.PAIRING,
webcWsSyncing: m.SYNCING,
webcWsNormal: m.NORMAL,
webcWsAttempts: m.socketSequence,
webcQrCode: !m.SYNCING
}), p.commit(), void(p = null))
}
function i() {
if (window.performance.getEntriesByType) {
var e, t = window.performance.getEntriesByType("resource"),
r = document.createElement("a");
t.forEach(function(t) {
r.href = t.name, e = r.pathname + r.search + r.hash, new f.WebcResourceLoad({
webcResourceName: e,
webcResourceDuration: Math.round(t.duration),
webcResourceCached: t.domainLookupEnd === t.fetchStart
}).commit()
})
}
}
function a(e) {
v = Date.now(), y = e, g = {
total: 0,
ab: 0,
an: 0,
ub: 0,
un: 0
}
}
function s(e, t) {
var r = e ? t ? "ab" : "an" : t ? "ub" : "un";
d(r)
}
function d(e) {
if (g) {
var t = Date.now(),
n = Math.max(t - v, 0);
g.total += n, g[e] += n, v = t, y = e
} else a(e), r(8).on("js_halt_detected", c)
}
function c(e) {
Date.now() - e > v ? v += e : g[y] -= e
}
function u() {
var e = new f.WebcWamUpload;
if (g) {
d(y);
var t = g.total;
if (t > 0) {
var r = g.an + g.ab,
n = g.un + g.ub;
e.set({
webcTotalT: Math.ceil(g.total),
webcAvailableTp: r / t,
webcAvailableNormalTp: r ? g.an / r : void 0,
webcAvailableBbarTp: r ? g.ab / r : void 0,
webcUnavailableTp: n / t,
webcUnavailableNormalTp: n ? g.un / n : void 0,
webcUnavailableBbarTp: n ? g.ub / n : void 0
})
}
a(y)
}
return e
}
var l = r(1),
f = r(41),
h = r(154),
p = new f.WebcPageLoad,
m = {},
g = void 0,
v = void 0,
y = void 0;
e.exports = {
monitor: s,
PageLoad: p,
streamInfoChange: n,
uploadEvent: u
}
}, , function(e, t, r) {
"use strict";
var n = r(42),
o = {
getInitialState: function() {
return {
_observedStateIndex: 0
}
},
addObserver: function(e, t, r) {
if (!this._isObservable(e)) throw Error("Attempting to observe non-observable object");
this._observer || (this._observer = n.createEmitter()), this._observer.listenTo(e, t, this._cbWrapper(r)), e.isState && e._uiObservers++
},
addObserverAndRun: function(e, t, r) {
this.addObserver(e, t, r);
var n = this._cbWrapper(r);
n(e, t)
},
removeObserver: function(e, t) {
if (!this._isObservable(e)) throw Error("Attempting to unobserve non-observable object");
this._observer && (this._observer.stopListening(e, t), e.isState && e._uiObservers--)
},
_cbWrapper: function(e) {
var t = this;
return _.isFunction(e) ? function() {
if (t.isMounted()) {
for (var r = arguments.length, n = Array(r), o = 0; r > o; o++) n[o] = arguments[o];
return e.apply(t, n)
}
} : function() {
return t.isMounted() ? t.setState({
_observedStateIndex: t.state._observedStateIndex + 1
}) : void 0
}
},
_isObservable: function(e) {
return e ? _.isFunction(e.trigger) : !1
},
componentWillUnmount: function() {
if (this._observer) {
var e = this._observer._listeningTo;
for (var t in e) {
var r = e[t];
r.isState && r._uiObservers--
}
this._observer.stopListening()
}
}
};
e.exports = o
}, function(e, t, r) {
"use strict";
var n = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var r = arguments[t];
for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n])
}
return e
},
o = r(24),
i = r(5),
a = r(1),
s = r(385),
d = r(8),
c = r(528),
u = i.createClass({
displayName: "VelocityTransitionGroupChild",
propTypes: {
transitionName: i.PropTypes.string.isRequired,
delay: i.PropTypes.number,
onAnimationComplete: i.PropTypes.func
},
_getTransition: function() {
return s[this.props.transitionName] || a.log("TransitionName " + this.props.transitionName + " wasn't found in VelocityTransitionGroupChild transitions.")(), s[this.props.transitionName] || s["default"]
},
componentWillEnter: function(e) {
var t = this._getTransition();
this.animateTransitions(t.enter)["finally"](this._cbWrapper(e))
},
componentWillLeave: function(e) {
var t = this._getTransition();
this.animateTransitions(t.leave)["finally"](this._cbWrapper(e))
},
_cbWrapper: function(e) {
var t = this;
return function() {
return t.isMounted() && _.isFunction(e) ? e() : void 0
}
},
animateTransitions: function(e) {
var t = this,
r = this._getTransition();
if (!r || !e) return Promise.resolve();
var n = o.findDOMNode(this),
s = this.props.delay,
c = _.omit(r, "leave", "enter"),
u = {},
l = i.Children.only(this.props.children);
return e = _.filter(_.forceArray(e), function(e) {
if (_.isString(e.selector) || u[e.selector]) {
var t = n.querySelectorAll(e.selector);
if (!t.length) return !1;
u[e.selector] = t
}
return !0
}), l.props.staggerDelay || s || _.forEach(e, function(e) {
if (!e.delay && !c.delay) {
var t = e.selector ? u[e.selector] : n;
_.forEach(e.props, function(e, r) {
_.isArray(e) && Velocity.hook(t, r, e[1])
})
}
}), d.setUiBusy(!0), Promise.map(e, function(e) {
var r = e.selector ? u[e.selector] : n,
o = Velocity(r, e.props, {
easing: e.easing || c.easing || "easeInSine",
duration: e.duration || c.duration || 0,
delay: l.props.staggerDelay || s || e.delay || c.delay || 0,
queue: c.queue || !1,
stagger: e.stagger || !1,
drag: e.drag || !1
});
return o ? o.then(function() {
c.cleanOnComplete && (_.isArray(r) ? _.forEach(r, function(e) {
e.removeAttribute("style")
}) : r.removeAttribute("style"))
}) : (a.log("VelocityTransitionGroup:animationTransitions:error " + t.props.transitionName)(), Promise.resolve())
})["finally"](function() {
t.props.onAnimationComplete && t.props.onAnimationComplete(), d.setUiBusy(!1)
})
},
componentWillUnmount: function() {
var e = o.findDOMNode(this);
Velocity(e, "stop")
},
render: function() {
return i.Children.only(this.props.children)
}
}),
l = i.createClass({
displayName: "VelocityTransitionGroup",
propTypes: {
transitionName: i.PropTypes.string.isRequired,
delay: i.PropTypes.number,
onAnimationComplete: i.PropTypes.func
},
_wrapChild: function(e) {
return i.createElement(u, this.props, e)
},
render: function() {
return i.createElement(c, n({
childFactory: this._wrapChild
}, this.props))
}
});
e.exports = l
}, function(e, t, r) {
"use strict";
var n = r(1),
o = r(141),
i = {
_nativeEventSafeIsMounted: function() {
return this.isMounted() && "UNMOUNTING" !== this._compositeLifeCycleState
},
getEvents: function() {
return this._events || (this._events = []), this._events
},
regNativeListener: function(e, t, r, n) {
if (!_.isFunction(r)) throw Error("handler is not a function");
t = o.prefix(t, e);
var i = this,
a = function() {
return i._nativeEventSafeIsMounted() ? r.apply(null, arguments) : void 0
};
this.getEvents().push({
src: e,
evnt: t,
handler: r,
fn: a,
capture: n
}), this.isMounted() && e.addEventListener(t, a, n)
},
unregNativeListener: function(e, t, r, i) {
t = o.prefix(t, e);
var a = _.matches({
src: e,
evnt: t,
handler: r,
capture: i
}),
s = _.find(this.getEvents(), a);
s ? (this._events = _.without(this._events, s), s.src.removeEventListener(s.evnt, s.fn, s.capture)) : n.error("nativeEventMixin:unregNativeListener unreg could not find event:" + t)()
},
unregisterListeners: function() {
this._events && (this.getEvents().forEach(function(e) {
e.src.removeEventListener(e.evnt, e.fn, e.capture)
}), delete this._events)
},
componentDidMount: function() {
this._events && this.getEvents().forEach(function(e) {
e.src.addEventListener(e.evnt, e.fn, e.capture)
})
},
componentWillUnmount: function() {
this.unregisterListeners()
}
};
e.exports = i
}, function(e, t, r) {
"use strict";
function n(e, t, r, n, s) {
this._from = e, this._to = t, this._id = r, this._participant = n, this._selfDir = s;
var d, c;
if (!(e && t && r && Store.Conn.me)) throw new Error("MsgKey error: " + [e, t, r, Store.Conn.me].join());
s = e === t ? s : void 0, e === t && e === Store.Conn.me ? (d = "out" === s, c = Store.Conn.me) : e === Store.Conn.me ? (d = !0, c = t) : t === Store.Conn.me ? (d = !1, c = e) : e === t && (i.isGroup(e) || i.isBroadcast(e)) ? (d = !0, c = e) : o.error("MsgKey case error: " + [e, t, r, Store.Conn.me].join())(), this.fromMe = d, this.remote = c, this.id = r;
var u = [this.fromMe, this.remote, this.id];
"undefined" != typeof s && (this.self = s, u.push(this.self)), a.gte([0, 5]) && a.supportsFeature(a.F.KEY_PARTICIPANT) && "undefined" != typeof n && (this.participant = n, u.push(this.participant)), this._serialized = u.join("_")
}
var o = r(1),
i = r(19),
a = r(71);
n.prototype = {
toString: function() {
return this._serialized
},
clone: function() {
return new n(this._from, this._to, this._id, this._participant, this._selfDir)
}
}, e.exports = n
}, function(e, t, r) {
"use strict";
function n(e, t, r, n, o) {
var i = new XMLHttpRequest,
a = new Promise(function(a, s) {
i.onload = function(e) {
4 === i.readyState ? a(i) : s(e)
}, i.onerror = s, i.ontimeout = s, i.onprogress = o, i.onabort = s, r instanceof FormData ? (i.open(t || u.POST, e, !0), n && (i.responseType = n), i.send(r)) : r instanceof Object ? (e = d.build(e, r), i.open(t || u.GET, e, !0), n && (i.responseType = n), i.send()) : (i.open(t || u.GET, e, !0), n && (i.responseType = n), i.send())
});
return a.cancellable()["catch"](Promise.CancellationError, function(e) {
return i.abort(), Promise.reject(e)
})
}
function o(e, t) {
return n(e, u.GET, null, t)
}
function i(e, t) {
return n(e, u.POST, t)
}
function a(e) {
return n(e, u.HEAD)
}
function s(e) {
return window.jsonp || (window.jsonp = {}), new Promise(function(t, r) {
var n = _.uniqueId("jsonp_");
e += "&JsonType=callback&JsonCallback=" + n;
var o = document.createElement("script");
o.type = "text/javascript", o.src = e, o.onerror = function(e) {
delete window.jsonp[n], document.head.removeChild(o), r(e)
}, window.jsonp[n] = function(e) {
delete window.jsonp[n], document.head.removeChild(o), t(e)
}, document.head.appendChild(o)
})
}
var d = r(51),
c = r(1),
u = {
GET: "GET",
POST: "POST",
HEAD: "HEAD",
PUT: "PUT"
},
l = {
BLOB: "blob",
ARRAY_BUFFER: "arraybuffer"
};
e.exports = {
head: a,
get: o,
post: i,
request: n,
jsonp: s,
VERB: u,
RESP_TYPE: l
}, c.exportToWindow("XHR", e.exports)
}, function(e, t, r) {
"use strict";
function n() {
this.Type = u, this.Mode = l, this.pendingUpdate = void 0, this.pendingHardRefreshTimer = void 0, this.mode = l.IDLE, this.version = i.VERSION_BASE
}
var o = r(140),
i = r(6),
a = r(1),
s = r(42),
d = r(75),
c = r(99),
u = {
SILENT: "silent",
SOFT: "soft",
HARD: "hard"
},
l = {
IDLE: "idle",
REFRESHING: "refreshing",
PENDING_REFRESH: "pending_refresh"
};
n.prototype.update = function(e, t) {
var n = this;
a.log("AppUpdate:update: " + e + " current: " + this.version + " latest: " + t)();
var i = void 0;
if (_.isNumber(e)) i = u.HARD;
else if (e) i = u.SOFT;
else {
if (this.version === t) return;
i = u.SILENT
}
var s = i === u.HARD ? Date.now() + e : void 0;
return this.clearHardRefresh(), i === u.HARD && this.setMode(l.REFRESHING), this._update(t).then(function(e) {
var t = r(14);
i !== u.SILENT && (Store.Stream.needsUpdate = e), i === u.HARD && (n.setMode(l.PENDING_REFRESH), n.pendingHardRefreshTimer = o.setTimeout(function() {
t.hardRefresh(!0), n.clearHardRefresh()
}, s), n.listenTo(Store.Stream, "change:couldForce", function() {
t.hardRefresh(!0), n.clearHardRefresh()
}))
})
}, n.prototype.setMode = function(e) {
this.mode = e, this.trigger("change:mode", e)
}, n.prototype._update = function(e) {
if (this.version !== e) {
if (c && navigator.serviceWorker.controller) return this._swUpdate(e);
if (window.applicationCache && window.applicationCache.status !== window.applicationCache.UNCACHED) return this._appcacheUpdate(e)
}
return Promise.resolve(this.version !== e)
}, n.prototype.killServiceWorker = function() {
return c && navigator.serviceWorker.controller ? (a.info("Killing service worker")(), navigator.serviceWorker.ready.then(function(e) {
return e.unregister()
}).then(function(e) {
return a.log("Service worker unregistration status: " + e)(), e
})) : Promise.resolve()
}, n.prototype._swUpdate = function(e) {
return navigator.serviceWorker.ready.then(function(t) {
return new Promise(function(r, n) {
function o(t) {
s(), a.error("Unable to update service worker to version " + e + ". Error: " + t)()
}
function i(e) {
s(), r(!0)
}
function s() {
navigator.serviceWorker.removeEventListener("error", o), navigator.serviceWorker.removeEventListener("controllerchange", i)
}
navigator.serviceWorker.addEventListener("error", o), navigator.serviceWorker.addEventListener("controllerchange", i), t.update().then(function() {
t.installing || r(!0)
})["catch"](function(e) {
o(e), r(!1)
})
})
})["catch"](function(e) {
return a.error("Unable to update serviceworker, error: " + e)(), !1
})
};
var f = r(25),
h = r(18),
p = r(74);
n.prototype._appcacheUpdate = function(e) {
return this.pendingUpdate || this.fetch(e).then(function() {
return window.applicationCache.status === window.applicationCache.UPDATEREADY ? (a.info("Updater:handleUpdate:ApplicationCacheSuccess")(), !0) : (a.log("Updater:handleUpdate:ApplicationNoUpdate")(), !1)
})["catch"](function(e) {
return a.error("Updater:handleUpdate:ApplicationCacheError " + e)(e), r(9).upload("appcache-error"), !1
})
}, n.prototype.fetch = function(e) {
var t = this;
return this.pendingUpdate = f.loopOnError(h.ShouldLoop, function(r) {
return Promise.delay(1e3 * p.expBackoff(r, 120, 1, .1)).then(function() {
return new Promise(function(r, n) {
function o() {
window.applicationCache.removeEventListener("updateready", a), window.applicationCache.removeEventListener("error", s), window.applicationCache.removeEventListener("noupdate", i)
}
function i() {
o(), d.version = e, r()
}
function a() {
o(), d.version = e, r()
}
function s(e) {
o(), n(new h.ShouldLoop("AppCache Error. Retrying..."))
}
var d = t;
window.applicationCache.addEventListener("updateready", a), window.applicationCache.addEventListener("error", s), window.applicationCache.addEventListener("noupdate", i), window.applicationCache.status !== window.applicationCache.IDLE && window.applicationCache.status !== window.applicationCache.UPDATEREADY || window.applicationCache.update()
})
})
})["finally"](function() {
t.pendingUpdate = void 0
})
}, n.prototype.clearHardRefresh = function() {
this.setMode(l.IDLE), this.pendingHardRefreshTimer && (o.clearTimeout(this.pendingHardRefreshTimer), this.pendingHardRefreshTimer = void 0), this.stopListening(Store.Stream, "change:couldForce")
}, n.prototype.restart = function() {
var e = r(14);
e.hardRefresh(void 0, !1)
}, e.exports = new n, _.extend(e.exports, s, d)
}, function(e, t, r) {
"use strict";
function n(e, t) {
var r = -1,
n = _.find(e, function(e) {
return r++, t(e)
});
return void 0 === n ? void 0 : {
index: r,
value: n
}
}
function o(e) {
var t, r;
try {
t = new S(e)
} catch (n) {
return s.error("WatchedSocket error constructing: " + n)(n), m.reject(n)
}
return new m(t, function(e, t) {
this.id = S.numSocketsAttempted++, s.log("WatchedSocket opening socket " + this.id)(), r = new f.WebcWsOpen;
var n = new WebSocket(this.url);
n.binaryType = "arraybuffer", n.onopen = e, n.onclose = n.onerror = function(e) {
t(new l.SocketError(e))
}, this.socket = n
}).cancellable()["catch"](function(e) {
if (s.error("WatchedSocket error on open of " + this.id + ": " + e, e)(), this.socket) {
var t = this.socket;
switch (t.readyState) {
case WebSocket.OPENING:
t.onopen = null;
case WebSocket.OPEN:
t.onerror = null, t.onclose = null, t.close();
break;
case WebSocket.CLOSING:
case WebSocket.CLOSED:
t.onerror = null, t.onclose = null
}
}
throw e
}).then(function(e) {
s.log("WatchedSocket opened socket " + this.id)(), r.markWebcWsOpenT(), r.commit();
var t = this.socket;
return t.onmessage = this._onMessage.bind(this, !0), t.onerror = this._onCloseOrError.bind(this, !0), t.onclose = this._onCloseOrError.bind(this, !1), this._offlineListener = u.waitForOfflineNaive().then(this.close.bind(this, !1, "offline"))["catch"](Promise.CancellationError, _.noop), this._pingTimer.after(i()), this.state = E.OPEN, this
})
}
function i() {
return Math.random() * (y - v) + v
}
function a() {
return Math.random() * (w - b) + b
}
var s = r(1),
d = r(9),
c = r(43),
u = r(25),
l = r(18),
f = r(41),
h = r(151),
p = r(54),
m = r(34),
g = 2e4,
v = 1e4,
y = 3e4,
b = 2e4,
w = 9e4,
E = {
OPEN: "open",
CLOSED: "closed"
},
S = c.extend({
extraProperties: "reject",
session: {
id: "number",
url: {
type: "string",
required: !0,
allowNull: !1
},
onmessage: "function",
onactivity: "function",
timeSkew: "number",
msgParser: "function",
state: {
type: "string",
values: [E.OPEN, E.CLOSED]
},
error: "any",
socket: "object",
isQueueing: {
type: "boolean",
"default": !0
},
maxQueueSize: "number",
messageQueue: "array",
_offlineListener: "object",
_msgListeners: "array",
_pingTimer: "object",
_killTimer: "object"
},
initialize: function() {
this._msgListeners = [], this.messageQueue = [], this._pingTimer = new p(this, this._ping), this._killTimer = new p(this, this._killSocket)
},
_ping: function() {
this.send("?,,"), this._killTimer.after(a())
},
_killSocket: function() {
s.warn("WatchedSocket " + this.id + " Timeout!")(), this.close(!0, "stale")
},
detachCallbacks: function() {
this.set({
onactivity: void 0,
onmessage: void 0
})
},
send: function(e) {
if ("open" !== this.state) throw new l.SocketNotOpen(this.state);
try {
this.socket.send(e)
} catch (t) {
s.error("exception sending: " + t)(t), s.error("" + t.stack)(), d.upload("send-exception"), this.close(!0, t)
}
},
cast: function(e) {
this.send(e)
},
partingSend: function(e, t, r) {
var n = this,
o = this.socket;
return new Promise(function(i) {
function a() {
i(void 0)
}
o.onclose = a, o.onerror = a, o.onmessage = function(e) {
var t = e.data;
r && !r(t) || i(t)
}, n.send(t), n._onCloseOrError(!1, e)
}).timeout(g, "paringSendTimeout")["catch"](_.noop)["finally"](function() {
o.onclose = void 0, o.onerror = void 0, o.onmessage = void 0, o.readyState === WebSocket.OPEN && o.close()
})
},
close: function(e, t) {
var r, n = this.socket;
if (this._onCloseOrError(!!e, t || "unspecified"), n && (r = n.readyState, r === WebSocket.OPENING || r === WebSocket.OPEN)) try {
n.close()
} catch (o) {
s.error("WatchedSocket:exception closing: " + o)(o), s.error("" + o.stack)()
}
},
_onMessage: function(e, t) {
if (e) {
this._pingTimer.after(i()), this._killTimer.cancel();
var r = t.data;
if ("string" == typeof r && "!" === r.charAt(0)) {
var o = parseInt(t.data.slice(1), 10);
return o === o && (this.timeSkew = Date.now() - o), void(this.onactivity && this.onactivity())
}
this.msgParser && (t = this.msgParser(t)), this.onactivity && this.onactivity(t)
}
var a = n(this._msgListeners, function(e) {
return !e.filter || e.filter(t)
});
a ? (this._msgListeners.splice(a.index, 1), a.value.removed = !0, a.value.promise.force(t)) : this.isQueueing ? (s.warn("watchedSocket:enqueued", t)(), this.messageQueue.push(t), void 0 !== this.maxQueueSize && this.messageQueue.length > this.maxQueueSize && this.close(!0, "Queue Overflow")) : this.onmessage ? this.onmessage(t) : s.error("watchedSocket:dropped!", t)()
},
_onCloseOrError: function(e, t) {
if ("closed" !== this.state) {
this.socket && (this.socket.onclose = void 0, this.socket.onerror = void 0, this.socket.onmessage = void 0), this._offlineListener && this._offlineListener.cancel(), s.warn("Socket " + this.id + " closing: " + t)(), this._pingTimer.cancel(), this._killTimer.cancel(), this.set({
state: "closed",
error: e ? t : void 0
});
var r = this._msgListeners,
n = e ? new l.SocketError(t) : new l.SocketClosed(t);
this._msgListeners = [], _.forEach(r, function(e) {
e.removed = !0, e.promise.cancel(n)
})
}
},
holdMessages: function(e) {
var t = this.isQueueing && void 0 !== e && this.messageQueue > e;
this.set({
isQueueing: !0,
messageQueue: this.messageQueue || [],
maxQueueSize: e
}), t && this.close(!0, "Queue Overflow")
},
releaseMessages: function(e) {
if (!this.isQueueing) return void s.error("WatchedSocket:releaseMessages not queued!")();
var t = this.messageQueue;
this.set({
isQueueing: !1,
messageQueue: void 0
}), e ? t.length > 0 && s.error("WatchedSocket:releaseMessages dropping " + t.length + " messages.")() : _.forEach(t, function(e) {
this._onMessage(!1, e)
}, this)
},
nextMessage: function(e) {
if ("open" !== this.state && "opening" !== this.state) return m.reject(new l.SocketNotOpen(this.state)).cancellable();
if (e instanceof h && (e = e.test.bind(e)), this.isQueueing) {
var t;
if (e) {
var r = n(this.messageQueue, e);
r && (t = r.value, this.messageQueue.splice(r.index, 1))
} else this.messageQueue.length > 0 && (t = this.messageQueue.shift());
if (t) return m.resolve(t).cancellable()
}
var o = (new m).cancellable().forceable(),
i = {
removed: !1,
filter: e,
promise: o
};
return this._msgListeners.push(i), o.bind(this)["catch"](function() {
i.removed || (this._msgListeners = _.without(this._msgListeners, i))
}), o
}
});
S.STATE = E, S.open = o, S.numSocketsAttempted = 0, e.exports = S
}, function(e, t, r) {
"use strict";
var n = r(43),
o = r(6),
i = r(1),
a = r(25),
s = n.extend({
session: {
online: {
type: "boolean",
"default": !0
},
_onlineCheck: "object",
waitForOnline: "object",
_waitForOnlinePromiseResolver: "function"
},
initialize: function() {
this.listenTo(this, "change:online", function() {
var e = this,
t = this.online;
if (i.log("NetworkStatus " + (t ? "online" : "offline"))(), t) {
this.waitForOnline = Promise.resolve();
var r = this._waitForOnlinePromiseResolver;
r && (this._waitForOnlinePromiseResolver = void 0, r())
} else this._waitForOnlinePromiseResolver || (this.waitForOnline = new Promise(function(t) {
e._waitForOnlinePromiseResolver = t
}))
})
},
checkOnline: function() {
return this._onlineCheck && this._onlineCheck.isPending() ? this._onlineCheck : (i.log("NetworkStatus:checkOnline checking")(), this._onlineCheck = a.getResponseIfOnline(o.STATUS_URL).bind(this).then(function(e) {
var t = !!e;
i.log("NetworkStatus:checkOnline response " + t)(), this.online = t, this._onlineCheck = null
})["catch"](function(e) {
i.error("NetworkStatus:checkOnline errored! " + e)(e), this._onlineCheck = null
}), this._onlineCheck)
}
});
e.exports = new s
}, , function(e, t) {
e.exports = function(e) {
if ("function" != typeof e) throw TypeError(e + " is not a function!");
return e
}
}, function(e, t, r) {
e.exports = !r(391)(function() {
return 7 != Object.defineProperty({}, "a", {
get: function() {
return 7
}
}).a
})
}, function(e, t, r) {
var n = r(35),
o = r(166);
e.exports = r(101) ? function(e, t, r) {
return n.setDesc(e, t, o(1, r))
} : function(e, t, r) {
return e[t] = r, e
}
}, function(e, t, r) {
var n = r(35).setDesc,
o = r(163),
i = r(23)("toStringTag");
e.exports = function(e, t, r) {
e && !o(e = r ? e : e.prototype, i) && n(e, i, {
configurable: !0,
value: t
})
}
}, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , function(e, t) {
"use strict";
function r(e) {
_ = e
}
function n(e) {
v = e, y = Math.round(e / 1e3)
}
function o(e) {
return void 0 !== e ? e + y : Math.floor(Date.now() / 1e3)
}
function i(e) {
return void 0 !== e ? e - y : Math.floor((Date.now() - v) / 1e3)
}
function a(e) {
return moment.unix(e).format(_ ? "HH:mm" : "LT")
}
function s(e) {
return moment.unix(e).format("l")
}
function d(e, t) {
var r = moment().startOf("day"),
n = moment.unix(e).startOf("day"),
o = r.diff(n, "days"),
i = t && a(e);
if (0 === o) return t ? l10n.t("web_today_at", {
time: i
}) : l10n.t("web_today");
if (1 === o) return t ? l10n.t("web_yesterday_at", {
time: i
}) : l10n.t("web_yesterday");
if (!t && 6 > o) return moment.unix(e).format("dddd");
var d = s(e);
return t ? l10n.t("web_time_at", {
date: d,
time: i
}) : d
}
function c(e) {
var t = e + y;
return t >= moment().startOf("day").unix() ? a(t) : d(t, !1)
}
function u(e) {
return d(e + y, !1)
}
function l(e) {
return d(e + y, !0)
}
function f(e) {
return moment.unix(e + y).format(_ ? "HH:mm, l" : "LT, l")
}
function h(e) {
return a(e + y)
}
function p(e) {
var t = e + y,
r = a(t),
n = moment.unix(t).startOf("day"),
o = moment().startOf("day").diff(n, "days");
if (0 === o) return l10n.t("web_conversation_last_seen_today", {
time: r
});
if (1 === o) return l10n.t("web_conversation_last_seen_yesterday", {
time: r
});
if (6 > o) {
var i = d(t, !1);
return l10n.t("web_conversation_last_seen_weekday", {
date: i,
time: r
})
}
var s = d(t, !1);
return l10n.t("web_conversation_last_seen_date", {
date: s,
time: r
})
}
function m(e) {
var t = moment.utc(1e3 * e);
return t.isValid() ? t.format("m:ss") : ""
}
function g(e) {
var t = e.startOfDaySkew;
return void 0 !== t && t > y - 30 && y + 30 > t ? e.startOfDay : (e.startOfDaySkew = y, e.startOfDay = moment.unix(e.t + y).startOf("day").unix())
}
var _ = !1,
v = 0,
y = 0;
e.exports = {
setIs24Hour: r,
setSkew: n,
localUnixTime: o,
globalUnixTime: i,
relativeStr: c,
relativeDateStr: u,
relativeDateAndTimeStr: l,
timeStr: f,
timestampStr: h,
lastSeenStr: p,
durationStr: m,
dayOfMsg: g
}
}, function(e, t) {
"use strict";
var r = {
getInitialState: function() {
return this._timer_mixin_timers = {}, this._timer_mixin_seq = 0, {}
},
componentWillUnmount: function() {
var e = this._timer_mixin_timers;
e && _.values(e).forEach(function(e) {
e()
})
},
safeIsMounted: function() {
return this.isMounted() && "UNMOUNTING" !== this._compositeLifeCycleState
},
safeInterval: function(e, t) {
e = e.bind === Object.getPrototypeOf(e).bind ? e.bind(this) : e;
var r = setInterval(e, t);
return this._regTimer(clearInterval.bind(void 0, r))
},
safeDelay: function() {
var e, t = _.toArray(arguments),
r = t.shift(),
n = t.shift(),
o = _.delay(function(n) {
delete n._timer_mixin_timers[e], r.apply(n, t)
}, n, this);
return e = this._regTimer(clearTimeout.bind(void 0, o))
},
safeDefer: function() {
var e, t = _.toArray(arguments),
r = t.shift(),
n = _.defer(function(n) {
delete n._timer_mixin_timers[e], r.apply(n, t)
}, this);
return e = this._regTimer(clearTimeout.bind(void 0, n))
},
safeDebounce: function(e, t, r) {
var n, o = this,
i = this._timer_mixin_timers,
a = function() {
delete i[n], e()
},
s = _.debounce(a, t, r);
return function() {
n && delete i[n], s(), n = o._regTimer(s.cancel)
}
},
clearSafeTimeout: function(e) {
var t = this._timer_mixin_timers[e];
t && t()
},
clearSafeInterval: function(e) {
return this.clearSafeTimeout(e)
},
_regTimer: function(e) {
var t = this._timer_mixin_timers,
r = ++this._timer_mixin_seq;
return t[r] = function() {
delete t[r], e()
}, r
}
};
e.exports = r
}, , function(e, t, r) {
"use strict";
function n(e, t) {
var r = {};
for (var n in e) t.indexOf(n) >= 0 || Object.prototype.hasOwnProperty.call(e, n) && (r[n] = e[n]);
return r
}
var o = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var r = arguments[t];
for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n])
}
return e
},
i = r(5),
a = r(39),
s = 20,
d = i.createClass({
displayName: "Spinner",
propTypes: {
size: i.PropTypes.number.isRequired,
stroke: i.PropTypes.number.isRequired
},
getDefaultProps: function() {
return {
size: 65,
stroke: 4
}
},
shouldComponentUpdate: function(e, t) {
return !1
},
render: function() {
var e = this.props,
t = e.size,
r = e.stroke,
d = e.className,
c = n(e, ["size", "stroke", "className"]),
u = {
width: t,
height: t
},
l = 2 * s + r,
f = "0 0 " + l + " " + l;
return i.createElement("svg", o({
className: a("spinner-container", d),
style: u,
viewBox: f
}, c), i.createElement("circle", {
className: "path",
cx: l / 2,
cy: l / 2,
r: s,
fill: "none",
strokeWidth: r
}))
}
});
e.exports = d
}, function(e, t, r) {
"use strict";
var n = r(5),
o = r(1),
i = r(19),
a = r(145),
s = r(52),
d = r(30),
c = r(333),
u = r(335),
l = r(8),
f = r(71),
h = r(18),
p = r(73).ActionToast,
m = r(73).ActionType,
g = {
ptt: 0,
audio: 0,
image: 1,
location: 2,
url: 3,
video: 4,
document: 5
},
v = {
NONE: 0,
ALLOW: 1,
DISABLE: 2,
UPGRADE: 3,
FORWARD: 4
},
y = s.extend({
Collection: "Contact",
props: {
id: "string",
name: "string",
shortName: "string",
type: {
type: "string",
values: ["in", "out"],
"default": "in"
},
plaintextDisabled: "boolean"
},
session: {
pendingAction: "number",
checked: "boolean",
notifyName: {
type: "any",
"default": null
},
_capabilities: "object",
_capabilitiesPromise: "object"
},
derived: {
userid: {
fn: function() {
return this.isUser ? i.user(this.id) : null
}
},
searchName: {
deps: ["name"],
fn: function() {
return this.name ? l10n.accentFold(this.name) : null
}
},
header: {
deps: ["name"],
fn: function() {
if (this.name) {
var e = this.name.charAt(0).toLowerCase();
if (a.alpha.test(e)) {
var t = l10n.removeAccents(e);
return y.Collator.compare(t, e) ? e : t
}
return "#"
}
}
},
isMe: {
fn: function() {
return Store.Conn.me === this.id
}
},
isUser: {
fn: function() {
return i.isUser(this.id)
}
},
isGroup: {
fn: function() {
return i.isGroup(this.id)
}
},
isBroadcast: {
fn: function() {
return i.isBroadcast(this.id)
}
},
formattedShortNameWithNonBreakingSpaces: {
deps: ["shortName", "formattedName", "id"],
fn: function() {
return this.id ? this.isMe ? l10n.t("web_you") : this.shortName || this.formattedName.replace(/\s/g, " ") : void 0
}
},
formattedShortName: {
deps: ["shortName", "formattedName", "id"],
fn: function() {
return this.id ? this.isMe ? l10n.t("web_you") : this.shortName || this.formattedName : void 0
}
},
formattedName: {
deps: ["name", "id"],
fn: function() {
if (this.id) {
if (this.isMe) return l10n.t("web_you");
var e;
return this.name || (e = l10n.isRTL() ? l10n.embedLTR(i.formattedUser(this.id)) : i.formattedUser(this.id)), this.name || e
}
}
},
formattedUser: {
deps: ["name", "id"],
fn: function() {
return this.id ? this.name ? this.name : l10n.isRTL() ? l10n.embedLTR(i.formattedUser(this.id)) : i.formattedUser(this.id) : void 0
}
},
isWAContact: {
deps: ["type"],
fn: function() {
return this.isUser && "in" === this.type;
}
},
isMyContact: {
deps: ["name"],
fn: function() {
return !!(this.isUser && this.name && this.name.length)
}
},
capabilities: {
cache: !1,
fn: function() {
var e = this;
return _.isObject(this._capabilities) ? Promise.resolve(this._capabilities) : this._capabilitiesPromise ? this._capabilitiesPromise : this.isUser ? this._capabilitiesPromise = d.getCapabilities([this.id]).then(function(t) {
if (200 === t.status) {
var r = e._capabilities = t[e.id];
return r ? (r.jid = e.id, r) : Promise.reject(new h.CapabilityUnknown(e.id))
}
return Promise.reject(new h.CapabilityUnknown(e.id + " status:" + t.status))
})["finally"](function() {
return e._capabilitiesPromise = void 0
}) : this.isGroup || this.isBroadcast ? this._capabilitiesPromise = Store.GroupMetadata.find(this.id).then(function(e) {
return e.participants.map(function(e) {
return e.id
})
}).then(function(t) {
return t.filter(i.isUser).length === t.length ? Promise.all(t.map(function(e) {
return Store.Contact.get(e).capabilities
})).then(function(t) {
return e._capabilities = t
}) : Promise.reject(new h.CapabilityInvalid("assertion fail: not all users: " + e.id))
})["finally"](function() {
return e._capabilitiesPromise = void 0
}) : Promise.reject(new h.CapabilityInvalid("unknown contact type: " + this.id))
}
}
},
children: {
status: c,
profilePicThumb: u
},
initialize: function() {
this.id && (this.status = Store.Status.gadd(this.id), this.listenTo(this.status, "all", this._getEventBubblingHandler("status")), this.listenTo(l, "locale_change", function() {
this.trigger("change:name", this, this.name)
}), this.profilePicThumb = Store.ProfilePicThumb.gadd(this.id), this.listenTo(this.profilePicThumb, "all", this._getEventBubblingHandler("profilePicThumb")), this.pendingAction = 0, this.listenTo(this, "change:pendingAction", this.onPendingActionUpdate))
},
onPendingActionUpdate: function() {
this.pendingAction < 0 && (o.log("contact:onPendingActionUpdate pendingAction value is invalid")(), this.pendingAction = 0)
},
canBlock: function() {
return f.supportsFeature(f.F.SET_BLOCK)
},
setBlock: function(e, t) {
var r = this;
if (e && Store.Blocklist.get(this.id)) return Promise.resolve();
if (!e && !Store.Blocklist.get(this.id)) return Promise.resolve();
var i = d.sendSetBlock(e, [{
jid: this.id
}]),
a = new m(e ? l10n.t("action_blocking", {
participant: this.formattedName
}) : l10n.t("action_unblocking", {
participant: this.formattedName
}));
t = t || p.genId();
var s = i.bind(this)["catch"](function(n) {
o.error("models:contact:setBlock dropped")(n);
var i = new m(e ? l10n.t("action_block_failed", {
participant: r.formattedName
}) : l10n.t("action_unblock_failed", {
participant: r.formattedName
}), l10n.t("action_try_again"), r.setBlock.bind(r, e, t));
return Promise.reject(i)
}).then(function(n) {
if (200 === n.status) {
var o = e ? l10n.t("action_blocked", {
participant: r.formattedName
}) : l10n.t("action_unblocked", {
participant: r.formattedName
});
return new m(o, l10n.t("action_undo"), r.setBlock.bind(r, !e, t))
}
if (n.status >= 400) {
var i = new m(e ? l10n.t("action_block_failed", {
participant: r.formattedName
}) : l10n.t("action_unblock_failed", {
participant: r.formattedName
}));
return Promise.reject(i)
}
});
return l.openToast(n.createElement(p, {
id: t,
initialAction: a,
pendingAction: s
})), i.bind(this).then(function(t) {
200 !== t.status || t._duplicate || (e ? Store.Blocklist.add({
id: r.id
}) : Store.Blocklist.remove(r.id))
})
},
isBlocked: function() {
return !!Store.Blocklist.get(this.id)
},
findCommonGroups: function() {
var e = this.id;
return new Promise(function(t, r) {
d.commonGroupsFind(e).then(function(e) {
if (200 === e.status) {
var n = e.groups.map(function(e) {
return Store.Chat.get(e)
});
t(n)
} else o.error("models:Contact:findCommonGroups error: " + e.status)(), r(new Error("models:Contact:findCommonGroups error: " + e.status))
})
})
},
searchMatch: function(e) {
return this.searchName ? this.searchName.indexOf(e) > -1 : e && this.userid ? this.userid.indexOf(e) > -1 : !1
},
canSendEncryptedMedia: function(e, t) {
var r = this,
n = g[e];
return "undefined" != typeof n ? this.capabilities.then(function(e) {
return _.flatten([e])
}).then(function(o) {
return o.length > 0 ? o.reduce(function(e, t) {
return e && t[n] === v.ALLOW
}, !0) || Promise.reject(new h.CapabilityUnsupported(r.id + " " + e, t ? _.zipObject(o.filter(function(e) {
return e[n] !== v.ALLOW
}).map(function(e) {
return [e.jid, e[n]]
})) : void 0)) : Promise.reject(new h.CapabilityUnknown("no caps"))
}) : Promise.reject(new h.CapabilityInvalid(e))
}
});
y.setCollator = function(e) {
y.Collator = window.Intl ? window.Intl.Collator([e], {
sensitivity: "base"
}) : {
compare: function(e, t) {
return e.localeCompare(t)
}
}
}, y.Comparator = function(e, t) {
var r = e.id,
n = t.id;
if (r === Store.Conn.me) return 1;
if (n === Store.Conn.me) return -1;
var o = e.name,
i = t.name;
if (!o && i) return 1;
if (o && !i) return -1;
if (o && i) {
var a = y.Collator.compare(e.header, t.header);
return 0 === a ? y.Collator.compare(o, i) : a
}
return r && n ? r.localeCompare(n) : -1
}, e.exports = y
}, function(e, t, r) {
"use strict";
var n = r(70),
o = {
uimPush: function(e, t, r) {
n.push(e, t, r), this._uim = this._uim || [], this._uim.push({
component: e,
type: t
})
},
uimPop: function(e) {
n.pop(e), this._uim && (this._uim = _.reject(this._uim, {
type: e
}))
},
componentWillUnmount: function() {
if (this._uim)
for (var e; e = this._uim.shift();) n.pop(e.type), n.popDependents(e.component)
}
};
e.exports = o
}, function(e, t, r) {
"use strict";
function n(e) {
this._alarms = {}, this._initialize(e)
}
var o = r(1),
i = 1e4,
a = 3e3,
s = Math.pow(2, 31) - 1,
d = r(8);
n.prototype._initialize = function(e) {
var t, r, n, i = this;
t = window.performance.now(), window.setInterval(function() {
r = window.performance.now(), n = Math.abs(r - t - e), n > a && (_.isEmpty(i._alarms) || i._validateTimeouts(), o.log("Alarm:validate js halt detected.")(), d.jsHaltDetected(n)), t = r
}, e)
}, n.prototype._validateTimeouts = function() {
var e = this;
_.forEach(_.keys(this._alarms), function(t) {
var r = e._alarms[t];
r && (r.expiration < Date.now() ? (e.clearTimeout(t), r.fn()) : e.setTimeout(r.fn, r.expiration, t, !0))
})
}, n.prototype.setTimeout = function(e, t, r, n) {
var i = this;
r && this.clearTimeout(r), r = r || _.uniqueId("alarm_timer_");
var d = t - Date.now(),
c = Math.min(d, s);
if (0 > d) return o.log("Alarm:setTimeout:Cannot set alarm in the past.")(), e(), r;
var u = window.setTimeout(function() {
t - Date.now() < a ? (delete i._alarms[r], e()) : i.setTimeout(e, t, r)
}, c);
return this._alarms[r] = {
fn: e,
expiration: t,
timeoutId: u
}, n || o.log("Alarm:setTimeout:" + r + " set", this._alarms[r])(), r
}, n.prototype.clearTimeout = function(e) {
var t = this._alarms[e];
t && (window.clearTimeout(t.timeoutId), delete this._alarms[e])
};
var c = new n(i);
o.exportToWindow("Alarm", c), e.exports = c
}, function(e, t) {
"use strict";
var r = "animation",
n = "transition",
o = {
_normalize: function(e, t, r) {
var n = e.toLowerCase().indexOf(t),
o = e.slice(0, n).toLowerCase();
return 0 === e.indexOf(t) ? o + e.slice(n) + r.toLowerCase() : o + e.slice(n) + r
},
prefix: function(e, t) {
var o;
return 0 === e.indexOf(r) ? (o = e.substring(r.length), this._normalize(window.Modernizr.prefixed(r), r, o)) : 0 === e.indexOf(n) ? (o = e.substring(n.length), this._normalize(window.Modernizr.prefixed(n), n, o)) : window.Modernizr.prefixed(e, t, !1) || e
}
};
e.exports = o
}, , function(e, t, r) {
"use strict";
function n() {
var e = this.phone || {};
e.mcc && "string" == typeof e.mcc && (e.mcc = parseInt(e.mcc, 10)), e.mnc && "string" == typeof e.mnc && (e.mnc = parseInt(e.mnc, 10)), a.Global.set({
mcc: e.mcc || null,
mnc: e.mnc || null,
webcPhoneDeviceManufacturer: e.device_manufacturer || null,
webcPhoneDeviceModel: e.device_model || null,
webcPhoneOsBuildNumber: e.os_build_number || null,
webcPhoneOsVersion: e.os_version || null
})
}
var o = r(52),
i = r(13),
a = r(41),
s = r(1),
d = r(45),
c = r(30),
u = r(71),
l = r(134),
f = r(14),
h = {
ANDROID: "android",
BB: "bb",
BBX: "bbx",
IPAD: "ipad",
IPHONE: "iphone",
IPOD: "ipod",
S40: "s40",
SYMBIAN: "symbian",
WP7: "wp7"
},
p = o.extend({
props: {
id: "number",
ref: "string",
refTTL: "number",
refId: "number",
wid: "string",
connected: "boolean",
me: "string",
clientToken: "string",
serverToken: "string",
secret: "string",
isResponse: "string",
battery: "number",
plugged: "boolean",
lc: "string",
lg: "string",
is24h: "boolean",
platform: "string",
phone: "object",
tos: "number",
pushname: "string"
},
derived: {
refExpiry: {
deps: ["ref", "refTTL"],
fn: function() {
return Date.now() + this.refTTL
}
},
locale: {
deps: ["lg", "lc"],
fn: function() {
return this.lg ? this.lc ? this.lg + "-" + this.lc : this.lg : null
}
},
platformField: {
deps: ["platform"],
fn: function() {
return "wp7" === this.platform ? a.PLATFORM_TYPE.WP : this.platform ? a.PLATFORM_TYPE[this.platform.toUpperCase()] || a.PLATFORM_TYPE.UNKNOWN : a.PLATFORM_TYPE.UNKNOWN
}
},
tosShowCallNotification: {
deps: ["tos"],
fn: function() {
return this.tos < 2
}
}
},
initialize: function() {
var e = this;
this.listenTo(this, "change:locale", function(e, t) {
i.setLangPref(t), l10n.init(t)
}), this.listenTo(this, "change:plugged", _.debounce(function() {
a.Global.webcPhoneCharging = e.plugged
}, 5e3, {
leading: !0
})), this.listenTo(this, "change:phone", n)
},
"delete": function() {
this.clear()
},
handle: function(e) {
var t, r = e.shift();
if (r.id = 1, r.protoVersion) {
u.setVersion(r.protoVersion);
var n = r.features || {},
o = u.setFeatures(n);
t = !!o.KEY_PARTICIPANT, c.setVersion(r.protoVersion, r.binVersion), Store.Stream.handle(["awake"])
}
if (r.initial) {
u.setPlatform(r.platform), i.setLogoutToken(r.browserToken), r.hasOwnProperty("is24h") && l.setIs24Hour(r.is24h);
var a = r.ref,
h = r.serverToken,
p = r.clientToken,
m = r.connected;
a && m && h && i.setRefTokCookies(a, h), i.setLoginTokens({
client: p,
server: h
}), r.secret && c.setSharedSecret(r.secret), "true" !== r.isResponse && d.save(), "iw" === r.lg && (r.lg = "he"), r.wid && (this.me = r.wid, Store.Contact.gadd(r.wid))
} else this.connected && t && (s.log("models:Conn:participantChange:to:" + u.supportsFeature(u.F.KEY_PARTICIPANT))(), f.hardRefresh());
this.set(r)
}
}),
m = new p({
id: 1
});
m.PLATFORMS = h, e.exports = m
}, function(e, t) {
"use strict";
e.exports = {
ring: function(e, t) {
return e > t.length - 1 ? 0 : 0 > e ? t.length - 1 : e
}
}
}, function(e, t) {
"use strict";
e.exports = {
alpha: new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),
mark: new RegExp("[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕౖౢౣಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣംഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈᧉᨗ-ᨛᩕ-ᩞ᩠-᩿᩼ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-ᮭ᯦-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ-᳴᷀-ᷦ᷼-᷿⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꨩ-ꨶꩃꩌꩍꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭ﬞ︀-️︠-︦]", "g"),
arabic: "[؀-؄؆-؋؍-ؚ؞ؠ-ؿف-يٖ-ٞ٪-ٯٱ-ۜ۞-ۿݐ-ݿࢠࢢ-ࢬࣤ-ࣾﭐ-﯁ﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼ﹰ-ﹴﹶ-ﻼ]"
}
}, function(e, t) {
"use strict";
function r(e) {
"string" == typeof e ? e = e.split("") : "undefined" == typeof e.length && (e = new Uint8Array(e));
for (var t = Math.ceil(4 * e.length / 3), r = 4 * Math.ceil(e.length / 3), n = new Array(r), o = 0, i = 0; r > o; o += 4, i += 3) {
var a = e[i] << 16 | e[i + 1] << 8 | e[i + 2];
n[o] = a >> 18, n[o + 1] = a >> 12 & 63, n[o + 2] = a >> 6 & 63, n[o + 3] = 63 & a
}
for (var s = 0; t > s; s++) {
var d = n[s];
if (0 > d || d >= 64) return null;
26 > d ? n[s] = 65 + d : 52 > d ? n[s] = 71 + d : 62 > d ? n[s] = d - 4 : 62 === d ? n[s] = 43 : n[s] = 47
}
for (var c = t; r > c; c++) n[c] = 61;
return String.fromCharCode.apply(String, n)
}
function n(e, t) {
for (var r = e.length, n = new Int32Array(r + r % 4), o = 0; r > o; o++) {
var i = e.charCodeAt(o);
if (i >= 65 && 90 >= i) n[o] = i - 65;
else if (i >= 97 && 122 >= i) n[o] = i - 71;
else if (i >= 48 && 57 >= i) n[o] = i + 4;
else if (43 === i) n[o] = 62;
else {
if (47 !== i) {
if (61 === i) {
r = o;
break
}
return null
}
n[o] = 63
}
}
for (var a = n.length / 4, s = 0, d = 0; a > s; s++, d += 4) n[s] = n[d] << 18 | n[d + 1] << 12 | n[d + 2] << 6 | n[d + 3];
for (var c = Math.floor(3 * r / 4), u = new Uint8Array(c), l = 0, f = 0; c >= f + 3; l++, f += 3) {
var h = n[l];
u[f] = h >> 16, u[f + 1] = h >> 8 & 255, u[f + 2] = 255 & h
}
switch (c - f) {
case 2:
u[f] = n[l] >> 16, u[f + 1] = n[l] >> 8 & 255;
break;
case 1:
u[f] = n[l] >> 16
}
return t ? Array.prototype.slice.call(u) : u
}
function o(e) {
return e.replace(/\+/g, "-").replace(/\//g, "_")
}
e.exports = {
encode: r,
decode: n,
urlSafe: o
}
}, function(e, t, r) {
"use strict";
function n() {
var e = this;
this.assetStyle = new c("asset-style"), this.assets = {}, window.addEventListener("dpichange", function() {
return e.loadAssets(e.assets)
})
}
var o = r(1),
i = r(25),
a = r(18),
s = r(53),
d = r(26),
c = r(381),
u = r(380),
l = {
DEFAULT: "default",
WEBP: "webp"
},
f = {
sprite: {
"class": ".icon, .icon-s, .icon-l, .icon-xl",
low: {
"default": r(177)
},
high: {
"default": r(177)
}
},
"bg-chat": {
"class": ".pane-chat-tile",
low: {
"default": r(176)
},
high: {
"default": r(176)
}
},
"emoji-small": {
"class": ".emoji",
low: {
"default": r(445),
webp: r(446)
},
high: {
"default": r(448),
webp: r(449)
}
},
"emoji-large": {
"class": ".emojik",
low: {
"default": r(447)
},
high: {
"default": r(450),
webp: r(451)
}
},
"intro-connection": {
"class": ".intro-image",
low: {
"default": r(455)
},
high: {
"default": r(454)
}
}
};
n.prototype.loadInitialAssets = function(e) {
return this.loadAssets(f)
}, n.prototype.loadAssets = function(e) {
return Promise.all(_.map(e, this.loadAsset.bind(this)))
}, n.prototype._supportsWebp = new Promise(function(e, t) {
Modernizr.on("webp", function(t) {
e(t && t.valueOf() ? !0 : !1)
})
}).timeout(500)["catch"](Promise.TimeoutError, function(e) {
return !1
}), n.prototype.loadAsset = function(e, t) {
var r, n, i = this,
a = u.currentRes,
s = t + "-" + a;
return r = window.performance.now(), this.unloadAsset(t), this.assets[t] = e, this.assets[t].promise = this._supportsWebp.then(function(t) {
return t && e[a][l.WEBP] ? l.WEBP : l.DEFAULT
}).then(function(t) {
return d.idb().then(function(e) {
return e.assets.get(s)
})["catch"](function(e) {
o.warn('Failed to "get" asset: ' + s)(e)
}).then(function(r) {
var n = _.last(e[a][t].split("/"));
return r && r.hash === n ? i.loadBlob(URL.createObjectURL(r.data)) : Promise.reject("No result")
})["catch"](function() {
return i.loadAndCacheData(e[a][t], s).then(function(e) {
return URL.createObjectURL(e)
})
}).then(function(t) {
return e["class"] && i.assetStyle.setRule("" + e["class"], {
"background-image": "url('" + t + "')"
}), n = window.performance.now(), o.log("Asset: " + s + " loaded: " + (n - r).toFixed(2) + "ms")(), e.onSet && e.onSet(t), t
})
})
}, n.prototype.unloadAsset = function(e) {
var t = this.assets[e];
t && t.promise && t.promise.isFulfilled() && URL.revokeObjectURL(t.promise.value()), delete this.assets[e]
}, n.prototype.loadAndCacheData = function(e, t) {
var r, n = _.last(e.split("/"));
return this.loadData(e).then(function(e) {
return r = e, d.idb().then(function(r) {
return r.assets.put({
key: t,
hash: n,
data: e
})
})
})["catch"](function(e) {
o.warn('Failed to "put" asset: ' + t)(e)
}).then(function(e) {
return r
})
}, n.prototype.loadBlob = function(e) {
return new Promise(function(t, r) {
var n = new XMLHttpRequest;
n.onload = function() {
200 === n.status ? t(e) : (o.warn("Blob: " + e + " failed. Refetching asset")(), r(e))
}, n.onerror = function() {
return r(e)
}, n.open("GET", e, !0), n.send()
})
}, n.prototype.loadData = function(e) {
return i.loopOnError(a.ShouldLoop, function(t) {
var r;
return r = s.info === s.INFO.OFFLINE ? i.waitForBBEvent(s, "change:info", function(e) {
return e.info !== s.INFO.OFFLINE
}) : Promise.delay(5e3 * (t > 0 ? 1 : 0)), r.then(function() {
return new Promise(function(t, r) {
var n = new XMLHttpRequest;
n.onload = function(i) {
200 === n.status ? t(n.response) : (o.warn("Asset: " + _.last(e.split("/")) + " failed. Retrying...")(i), r(new a.ShouldLoop("Asset failed to load. Retrying...")))
}, n.onerror = function(t) {
o.warn("Asset: " + _.last(e.split("/")) + " failed. Retrying...")(t), r(new a.ShouldLoop("Asset failed to load. Retrying..."))
}, n.open("GET", e, !0), n.responseType = "blob", n.send()
})
})
})
}, n.prototype.loadImage = function(e) {
return i.loopOnError(a.ShouldLoop, function(t) {
var r;
return r = s.info === s.INFO.OFFLINE ? i.waitForBBEvent(s, "change:info", function(e) {
return e.info !== s.INFO.OFFLINE
}) : Promise.delay(5e3 * (t > 0 ? 1 : 0)), r.bind(this).then(function() {
return new Promise(function(t, r) {
var n = new Image;
n.onload = function() {
t(e)
}, n.onerror = function() {
o.warn("Asset: " + _.last(e.split("/")) + " failed. Retrying...")(), r(new a.ShouldLoop("Asset failed to load. Retrying..."))
}, n.src = e
})
})
})
}, e.exports = new n
}, function(e, t) {
"use strict";
var r = {
STREAM_END: 2,
LIST_EMPTY: 0,
DICTIONARY_0: 236,
DICTIONARY_1: 237,
DICTIONARY_2: 238,
DICTIONARY_3: 239,
LIST_8: 248,
LIST_16: 249,
JID_PAIR: 250,
BINARY_8: 252,
BINARY_20: 253,
SINGLE_BYTE_MAX: 256
};
e.exports = r
}, function(e, t) {
"use strict";
var r = {
STREAM_END: 2,
LIST_EMPTY: 0,
DICTIONARY_0: 236,
DICTIONARY_1: 237,
DICTIONARY_2: 238,
DICTIONARY_3: 239,
LIST_8: 248,
LIST_16: 249,
JID_PAIR: 250,
BINARY_8: 252,
BINARY_20: 253,
BINARY_32: 254,
NIBBLE_8: 255,
SINGLE_BYTE_MAX: 256,
NIBBLE_MAX: 254
};
e.exports = r
}, function(e, t) {
"use strict";
var r = {
STREAM_END: 2,
LIST_EMPTY: 0,
DICTIONARY_0: 236,
DICTIONARY_1: 237,
DICTIONARY_2: 238,
DICTIONARY_3: 239,
LIST_8: 248,
LIST_16: 249,
JID_PAIR: 250,
HEX_8: 251,
BINARY_8: 252,
BINARY_20: 253,
BINARY_32: 254,
NIBBLE_8: 255,
SINGLE_BYTE_MAX: 256,
PACKED_MAX: 254
};
e.exports = r
}, function(e, t) {
"use strict";
function r(e) {
var t = [],
r = !1,
o = 0;
_.each(e, function(e, i) {
function a(e) {
return e.hasOwnProperty(i) && s(e[i])
}
if (e === _) return void(r = !0);
o++;
var s = n(e);
t.push(a)
});
var i = _.reduceRight(t, function(e, t) {
return e ? function(r) {
return t(r) && e(r)
} : t
});
return function(e) {
if ("object" != typeof e) return !1;
var t = _.keys(e).length;
return o > t ? !1 : !r && t > o ? !1 : i(e)
}
}
function n(e) {
switch (typeof e) {
case "object":
return r(e);
case "function":
return e;
case "boolean":
case "null":
case "undefined":
case "number":
case "string":
return function(t) {
return t === e
}
}
}
function o(e) {
this.predicate = n(e)
}
o.ANY = _.constant(!0), o.OBJECT = _.isObject, o.STRING = _.isString, o.BOOLEAN = _.isBoolean, o.prototype = {
test: function(e) {
return this.predicate(e)
}
}, e.exports = o
}, function(e, t, r) {
"use strict";
function n() {
c || (c = r(592))
}
function o(e) {
var t = void 0;
return void 0 === e ? (t = new Uint8Array(32), window.crypto.getRandomValues(t)) : t = new Uint8Array(e), t[0] &= 248, t[31] &= 127, t[31] |= 64, d({
pubKey: 32,
privKey: t,
basepoint: u
}, function(e) {
var r = c._curve25519_donna(e.pubKey, e.privKey, e.basepoint);
if (r) throw new Error("Curve25519:keyPair Error Code " + r);
return {
pubKey: s(e.pubKey, 32),
privKey: t.buffer
}
})
}
function i(e, t) {
return d({
sharedKey: 32,
pubKey: e,
privKey: t
}, function(e) {
var t = c._curve25519_donna(e.sharedKey, e.privKey, e.pubKey);
if (t) throw new Error("Curve25519:sharedSecret Error Code " + t);
return s(e.sharedKey, 32)
})
}
function a(e) {
if ("number" == typeof e) return c._malloc(e);
var t = new Uint8Array(e.buffer || e),
r = c._malloc(t.length);
return c.HEAPU8.set(t, r), r
}
function s(e, t) {
var r = new Uint8Array(t);
return r.set(c.HEAPU8.subarray(e, e + t)), r.buffer
}
function d(e, t) {
n();
var r = {};
try {
for (var o in e) r[o] = a(e[o]);
return t(r)
} finally {
for (var i in r) c._free(r[i])
}
}
var c, u = new Uint8Array(32);
u[0] = 9, e.exports = {
keyPair: o,
sharedSecret: i
}
}, function(e, t, r) {
"use strict";
function n() {
var e = this.onTimeout;
return e ? (this.failGeneration++, void(e(this) && this._run(!1))) : (i.error("Watchdog timed-out without handler!")(), void a.upload("watchdog-no-handler"))
}
function o(e, t, r) {
return "number" == typeof r ? function(n) {
switch (n.failGeneration) {
case 0:
return Math.min(r, t);
case 1:
return Math.min(r, e + t);
default:
return Math.min(r, n.waitDuration + n.prevWaitDuration)
}
} : function(r) {
switch (r.failGeneration) {
case 0:
return t;
case 1:
return e + t;
default:
return r.waitDuration + r.prevWaitDuration
}
}
}
var i = r(1),
a = r(9),
s = r(43),
d = r(54),
c = s.extend({
session: {
failGeneration: {
type: "number",
allowNull: !1,
"default": 0
},
ts: "number",
waitDuration: {
type: "number",
allowNull: !1,
"default": 0
},
prevWaitDuration: {
type: "number",
allowNull: !1,
"default": 0
},
jitter: {
type: "number",
"default": 0
},
shiftTimer: "object",
waitAlgorithm: {
type: "function",
required: !0,
allowNull: !1
},
onActivated: "function",
onDeactivated: "function",
onFed: "function",
onTimeout: "function"
},
initialize: function() {
this.shiftTimer = new d(this, n)
},
activate: function() {
this.shiftTimer.ts || (this._run(!0), this.onActivated && this.onActivated(this))
},
deactivate: function() {
this.shiftTimer.ts && (this.shiftTimer.cancel(), this.onDeactivated && this.onDeactivated(this))
},
feed: function() {
this.shiftTimer.ts && (this._run(!0), this.onFed && this.onFed(this))
},
forceTimeout: function(e) {
this.shiftTimer.ts ? e ? this.ts = this.shiftTimer.before(e) : this.shiftTimer.trigger() : i.error("forced non-running watchdog!")()
},
poke: function() {
this.forceTimeout.apply(this, arguments)
},
_run: function(e) {
e && (this.failGeneration = 0);
var t = this.waitAlgorithm(this),
r = this.jitter * Math.random() * t;
this.set({
ts: this.shiftTimer.debounce(t + r),
waitDuration: t,
prevWaitDuration: this.waitDuration
})
}
});
c.FIBONACCI = o, e.exports = c
}, function(e, t, r) {
"use strict";
function n(e) {
return function() {
if (R) return e.apply(void 0, arguments);
P || (P = [], window.setTimeout(function() {
b = r(14), w = r(7), E = r(9), S = r(6), N = r(26), T = r(1), $ = r(41), C = r(89), A = r(54), I = r(13), O = new A(c);
for (var e = 0; e < P.length; e++) P[e]();
P = null, R = !0
}, 0));
var t = Array.prototype.slice.call(arguments);
P.push(e.apply.bind(e, void 0, t))
}
}
function o(e) {
e.commitTime ? T.error("wam:commit redundant commit! " + e.$className)() : (T.log("wam:commit " + e.$className, e.all)(), e.commitTime = y(), a([!0, e]))
}
function i(e, t) {
T.log("wam:set " + e.name + " = " + t)(), a([!1, e, t])
}
function a(e) {
D.push(e), U && O.before(B)
}
function s() {
T.log("wam pause processing")(), U = !1, O.cancel()
}
function d() {
T.log("wam enable processing")(), U = !0, D.length > 0 && O.before(B)
}
function c() {
s(), Promise.resolve(D).then(function(e) {
if (!j) {
var t = b.info();
j = {
appVersion: S.VERSION_BASE,
platform: $.PLATFORM_TYPE.WEBCLIENT,
browser: t.name || null,
browserVersion: t.ua || null,
deviceName: t.os || null,
webcPhonePlatform: Store.Conn.platformField || null,
webcEnv: $.WEBC_ENV_CODE.PROD,
webcWebPlatform: $.WEBC_WEB_PLATFORM_TYPE["web".toUpperCase()]
}, T.log("wam:executePending initializing", j)(), $.Global.commitOnSet = !1, $.Global.set(j), $.Global.commitOnSet = !0, I.clearWamBuffer_old(), I.clearWamStatus_old(), I.clearWamLastRotate_old(), I.clearWamDimensionCache_old()
}
T.log("wam:executePending " + e.length + " jobs")(), k || (k = new u(j));
for (var r = 0; r < e.length; r++) {
var n = e[r];
if (n[0]) k.write(n[1]);
else {
var o = n[1],
i = n[2];
j[o.name] = i, k.set(-o.id, i)
}
}
var a = y();
if (k.bufferLength > 0 && (k.bufferLength > S.WAM_MAX_BUFFER_SIZE || a > L + S.WAM_ROTATE_INTERVAL || !x)) {
if (!I.getLoginTokens().server) return T.log("wam:executePending wam unauthed, didn't send")(), k.bufferLength > S.WAM_MAX_BUFFER_SIZE ? (k = null, T.log("wam:executePending abandoned current buffer")(), Promise.resolve()) : m();
var s = C.uploadEvent();
return s.commitTime = a, T.log("wam:executePending commit upload", s.all)(), k.write(s), g()
}
return m()
})["catch"](function(e) {
T.error("wam:executePending error " + (e && e.stack ? e.stack : e))(e), E.upload("wam-error"), k = null
}).then(d, d), D = []
}
function u(e) {
this.buffer = [], this.bufferLength = 0, this.prevValues = {}, this.dirtyGlobals = null, this.unsavedPortion = null, this.saveKey = 1e9 * Math.random() | 0, e && this.setAll(e)
}
function l(e) {
var t = new w(10 + e.length, !0);
t.writeString("WASTATS");
for (var r = JSON.parse("[" + e + "]"), n = 0; n < r.length; n++) {
var o = r[n],
i = o[0];
i > 0 ? f(t, i, o[1]) : h(t, -i, o[1], W)
}
return t
}
function f(e, t, r) {
for (var n = 0; n < r.length; n++) {
var o = r[n];
h(e, o[0], o[1], F)
}
h(e, t, r.length, Y)
}
function h(e, t, r, n) {
if (null === r && n === W) p(e, t, n);
else if (r === (0 | r)) 0 === r ? p(e, t, 16 | n) : 1 === r ? p(e, t, 32 | n) : r >= -128 && 128 > r ? (p(e, t, 48 | n), e.writeInt8(r)) : r >= -32768 && 32768 > r ? (p(e, t, 64 | n), e.writeInt16(r)) : (p(e, t, 80 | n), e.writeInt32(r));
else if ("number" == typeof r) p(e, t, 112 | n), e.writeFloat64(r);
else if ("string" == typeof r) {
for (var o = 0, i = 0; i < r.length; i++) {
var a = r.charCodeAt(i);
a >= 55296 && 56320 > a && (a = ((1023 & a) << 10 | 1023 & r.charCodeAt(++i)) + 65536), 128 > a ? o++ : o += 2048 > a ? 2 : 65536 > a ? 3 : 4
}
256 > o ? (p(e, t, 128 | n), e.writeUint8(o)) : 65536 > o ? (p(e, t, 144 | n), e.writeUint16(o)) : (p(e, t, 160 | n), e.writeUint32(o)), e.writeString(r)
} else null === r && p(e, t, 176 | n)
}
function p(e, t, r) {
256 > t ? (e.writeUint8(r), e.writeUint8(t)) : (e.writeUint8(4 | r), e.writeUint16(t))
}
function m() {
var e = k.stringBuffer();
if (!e) return Promise.resolve();
var t = k.unsavedPortion;
if (t && 0 === t.bufferLength) return Promise.resolve();
var r = k.saveKey,
n = {
buffer: e,
lastSend: r
},
o = void 0;
return o = t ? N.idb().then(function(e) {
return e.wam.update(r, n)
}).then(function(e) {
return 0 === e ? (k = k.unsavedPortion, T.log("wam:save other tab claimed buffer, cutting head")(), m()) : (T.log("wam:save successfully updated " + r)(), void(k.unsavedPortion = new u(j)))
}) : N.idb().then(function(e) {
return e.wam.add(n, r)
}).then(function() {
T.log("wam:save successfully saved new entry " + r)(), k.unsavedPortion = new u(j)
}), o["catch"](function(e) {
T.warn("wam:save indexeddb failed to save " + e)(e)
})
}
function g() {
var e = {};
return N.idb().then(function(t) {
return t.wam.toCollection().modify(function(t) {
e[t.lastSend] = t.buffer, delete this.value
})
})["catch"](function(e) {
T.warn("wam:sendAllLogs failed to read because " + e)(e)
}).then(function() {
return k && (!k.unsavedPortion || k.saveKey in e || (k = k.unsavedPortion), e[k.saveKey] = k.stringBuffer()), Promise.all(_.map(e, v))
}).then(function(t) {
var r = _.filter(t);
if (r.length !== t.length && (L = y(), x = !0), k && -1 === _.indexOf(r, k.saveKey) && (k = null), 0 === r.length) return Promise.resolve();
var n = _.reduce(r, function(t, r) {
return t + e[r].length
}, 0);
return n < S.WAM_MAX_BUFFER_SIZE ? N.idb().then(function(t) {
return Promise.all(_.map(r, function(r) {
return t.wam.add({
buffer: e[r],
lastSend: r
}, r).then(_.noop, _.noop)
}))
}) : (k = null, void T.error("wam dropped " + r.length + " buffers! (" + n + " bytes)", e)())
})
}
function v(e, t) {
if ("" === e) return Promise.resolve(void 0);
var n = r(95),
o = l(e).flip().toBase64();
T.log("wam:sendLogs { strlen:" + e.length + ", b64len:" + o.length + " }")();
var i = new FormData;
return i.append("t", "" + y()), i.append("v", S.VERSION_BASE), i.append("tok", I.getLoginTokens().server), i.append("buffer", o), n.post(S.WAM_URL, i).uncancellable().then(function(e) {
if (e.status >= 500) throw e.status + " response";
return e
})["catch"](function(e) {
return T.error("wam:sendLogs retry on error: " + e)(e), n.post(S.WAM_URL, i)
}).then(function(e) {
return 200 === e.status ? void T.log("wam:sendLogs success")() : (T.error("wam:sendLogs failure code: " + e.status)(), t)
})["catch"](function(e) {
return T.error("wam:sendLogs failure error: " + e)(e), t
})
}
function y() {
return Math.floor(Date.now() / 1e3)
}
var b, w, E, S, N, T, $, C, A, I, O, k, P = null,
R = !1,
M = -47,
L = 0,
D = [],
U = !1,
B = 1e4,
x = !1,
j = null;
u.prototype = {
setAll: function(e) {
for (var t in e) {
var r = e[t];
void 0 !== r && this.set(-$.METRICS[t].id, r)
}
},
set: function(e, t) {
this.dirtyGlobals || (this.dirtyGlobals = {}), this.dirtyGlobals[e] = t, this.unsavedPortion && this.unsavedPortion.set(e, t)
},
flushGlobals: function() {
if (this.dirtyGlobals) {
var e = this.dirtyGlobals,
t = this.prevValues;
for (var r in e) {
var n = 0 | r,
o = e[n];
if ("boolean" == typeof o ? o = o ? 1 : 0 : void 0 === o && (o = null), o === t[n]) return;
t[n] = o, this.appendToBuffer(JSON.stringify([n, o]))
}
this.dirtyGlobals = null
}
},
write: function(e) {
var t = this.prevValues;
this.appendToBuffer(JSON.stringify([M, e.commitTime])), this.flushGlobals();
var r = e.all,
n = [];
for (var o in r) {
var i = $.METRICS[o].id,
a = r[o];
null !== a && void 0 !== a && ("boolean" == typeof a && (a = a ? 1 : 0), 0 !== a && 1 !== a && a === t[i] ? n.push([i, null]) : (t[i] = a, n.push([i, a])))
}
this.appendToBuffer(JSON.stringify([e.id, n])), this.unsavedPortion && this.unsavedPortion.write(e)
},
appendToBuffer: function(e) {
this.buffer.push(e), this.buffer.length > 1 ? this.bufferLength += 1 + e.length : this.bufferLength += e.length
},
stringBuffer: function() {
var e = this.buffer.join(",");
return this.buffer.length > 1 && (this.buffer = [e]), this.bufferLength = e.length, e
}
};
var W = 0,
Y = 1,
F = 2;
e.exports = _.mapValues({
commit: o,
set: i,
resumeJobs: d
}, n)
}, function(e, t, r) {
"use strict";
function n(e) {
return function(t) {
return "number" == typeof t.status && t.status >= 500 ? t : void e(t)
}
}
var o = r(1),
i = r(18),
a = r(10),
s = r(7),
d = r(34),
c = r(19),
u = r(51),
l = r(55),
f = r(94),
h = {
BinaryProtocol: null,
N: null,
M: {
DEBUG_LOG: 1,
QUERY_RESUME: 2,
QUERY_RECEIPT: 3,
QUERY_MEDIA: 4,
QUERY_CHAT: 5,
QUERY_CONTACTS: 6,
QUERY_MESSAGES: 7,
PRESENCE: 8,
PRESENCE_SUBSCRIBE: 9,
GROUP: 10,
READ: 11,
CHAT: 12,
RECEIVED: 13,
PIC: 14,
STATUS: 15,
MESSAGE: 16
},
isRequestingDeviceUploadLogsMutex: 0,
wrap: n,
wrap02: n,
binWrap: function(e, t) {
return function(r) {
if ("object" == typeof r && "number" == typeof r.status) {
if (401 === r.status) throw new i.E401;
if (r.status >= 500) return r;
t(r)
} else e(r)
}
},
actionNode: function(e, t) {
return ["action", {
type: e
}, t]
},
queryNode: function(e, t) {
return ["query", e, t]
},
dropIfConditionMet: function(e, t) {
return e.reduce(function(e, t) {
return e || t
}, !1) ? void 0 : t
},
actionGetMeta: function(e) {
var t = {};
if ("action" !== this.N.tag(e)) return t;
var r = this.N.attr("add", e),
n = this.N.attr("missing", e),
o = this.N.attr("checksum", e);
switch (r) {
case "unread":
t.unreadId = this.N.attr("index", e), t.unreadFromMe = "true" === this.N.attr("owner", e), t.unreadParticipant = this.N.attr("participant", e);
case "after":
case "before":
case "last":
t.pendingMsgsDone = "true" === this.N.attr("last", e), t.resume = "true" === this.N.attr("resume", e);
case "relay":
case "update":
t.add = r
}
switch (n) {
case "remove":
t.missing = n
}
return o && (t.checksum = o), t
},
groupActionsByType: function(e) {
var t = {};
if (!_.isArray(e)) return t;
var r, n, i = e.length;
for (n = 0; i > n; n++) switch (r = e[n], this.N.tag(r)) {
case "broadcast":
switch (this.N.attr("type", r)) {
case "create":
case "add":
case "remove":
t.msg || (t.msg = []), t.msg.push(r);
break;
case "modify":
t.bcUpdate || (t.bcUpdate = []), t.bcUpdate.push(r)
}
break;
case "message":
case "groups_v2":
case "notification":
case "call_log":
case "security":
t.msg || (t.msg = []), t.msg.push(r);
break;
case "read":
case "log":
case "identity":
t.cmd || (t.cmd = []), t.cmd.push(r);
break;
case "received":
t.ack || (t.ack = []), t.ack.push(r);
break;
case "user":
t.contact || (t.contact = []), t.contact.push(r);
break;
case "chat":
switch (this.N.attr("type", r)) {
case "mute":
t.mute || (t.mute = []), t.mute.push(r);
break;
default:
t.chat || (t.chat = []), t.chat.push(r)
}
break;
case "battery":
t.battery || (t.battery = []), t.battery.push(r);
break;
default:
o.errorVerbose("Wap:groupActionsByType unknown action: " + this.N.toString(r), r)()
}
return t
},
safeParseInt: function(e, t) {
var r = parseInt(this.N.attr(t, e), 10);
return _.isNaN(r) ? void 0 : r
},
parseChat: function(e) {
if ("chat" === this.N.tag(e)) {
var t = this.N.attr("jid", e),
r = parseInt(this.N.attr("t", e), 10) || void 0,
n = this.N.attr("type", e),
o = parseInt(this.N.attr("mute", e), 10) || void 0,
i = parseInt(this.N.attr("before", e), 10) || void 0,
a = "true" === this.N.attr("archive", e),
s = "true" === this.N.attr("read_only", e),
d = parseInt(this.N.attr("modify_tag", e), 10) || void 0,
c = this.N.attr("name", e) || void 0,
u = this.safeParseInt(e, "count"),
l = "true" === this.N.attr("message", e);
"ahead" === n && (n = "clear");
var f, h = this.N.children(e);
if (_.isArray(h)) {
f = [];
var p, m, g = h.length;
for (p = 0; g > p; p++)
if (m = h[p], "item" === this.N.tag(m)) {
var v = this.N.attr("index", m);
v && f.push([v, "true" === this.N.attr("owner", m)])
}
}
var y = {
id: t,
t: r,
type: n,
keys: f,
before: i,
archive: a,
isReadOnly: s,
unreadCount: u,
muteExpiration: o,
modifyTag: d,
name: c,
pendingMsgs: l
},
b = [n && "delete" !== n && "clear" !== n && "archive" !== n && "unarchive" !== n && "mute" !== n && "modify_tag" !== n, !n && !t, a && n && "clear" !== n, "clear" !== n && i && i > 0, "clear" !== n && f && f.length > 0];
return this.dropIfConditionMet(b, y)
}
},
parseContact: function(e) {
if ("user" === this.N.tag(e)) {
var t = this.N.attr("jid", e),
r = this.N.attr("name", e),
n = this.N.attr("short", e) || void 0,
o = this.N.attr("type", e) || "in",
i = "true" === this.N.attr("plaintext_disabled", e),
a = {
id: t,
name: r,
type: o,
shortName: n,
plaintextDisabled: i
},
s = [!t, "in" !== o && "out" !== o && !!o];
return this.dropIfConditionMet(s, a)
}
},
parseCmd: function(e) {
if ("read" === this.N.tag(e)) {
var t = this.N.attr("jid", e),
r = {
type: "read",
jid: t
},
n = [!t];
return this.dropIfConditionMet(n, r)
}
},
parseAck: function(e) {
if ("received" === this.N.tag(e)) {
var t, r = this.N.attr("type", e),
n = this.N.attr("id", e),
o = this.N.attr("to", e);
switch (r) {
case "message":
t = 2;
break;
case "read":
t = 3;
break;
case "played":
t = 4;
break;
case "error":
t = -1;
break;
case "pending":
default:
t = 0
}
var i = {
cmd: "ack",
id: n,
ack: t,
from: Store.Conn.me,
to: o
},
a = [!n, !o, "message" !== r && "read" !== r && "played" !== r && "error" !== r && "pending" !== r];
return this.dropIfConditionMet(a, i)
}
},
parseBCUpdate: function(e) {
if ("broadcast" === this.N.tag(e) && "modify" === this.N.attr("type", e)) {
var t = this.N.attr("jid", e),
r = this.N.children(e),
n = [];
if (_.isArray(r)) {
var o, i, a, s = r.length;
for (o = 0; s > o; o++) i = r[o], a = this.N.attr("jid", i), "recipient" === this.N.tag(i) && a && 2 === a.split("@").length && "c.us" === a.split("@")[1] && n.push({
id: a
})
}
var d = {
id: t,
participants: n
},
c = [!t, "broadcast" !== t.split("@")[1], 0 === n.length];
return this.dropIfConditionMet(c, d)
}
},
parseBattery: function(e) {
if ("battery" === this.N.tag(e)) {
var t = Math.min(parseInt(this.N.attr("value", e), 10) || -1, 100),
r = this.N.attr("live", e),
n = {
battery: 0 > t ? void 0 : t,
plugged: r ? "true" === r : void 0
},
o = [0 > t && !r];
return this.dropIfConditionMet(o, n)
}
},
msgGetTarget: function(e) {
return e.from === Store.Conn.me ? e.to : e.from
},
parseMsg: function(e, t) {
switch (this.N.tag(e)) {
case "message":
return this.parseMsgMessage(e, t);
case "groups_v2":
return this.parseMsgGp2(e);
case "broadcast":
return this.parseMsgBroadcast(e);
case "notification":
return this.parseMsgNotification(e);
case "call_log":
return this.parseMsgCallLog(e);
case "security":
return this.parseMsgSecurity(e);
default:
return
}
},
parseMsgMessage: function(e, t) {
if ("message" === this.N.tag(e)) {
var r;
this.N.attr("from", e) !== Store.Conn.me || this.N.attr("to", e) ? this.N.attr("to", e) !== Store.Conn.me || this.N.attr("from", e) || (r = "out") : r = "in";
var n, i = this.N.attr("id", e),
a = parseInt(this.N.attr("t", e), 10) || 0,
s = this.N.attr("to", e) || Store.Conn.me,
d = this.N.attr("from", e) || Store.Conn.me,
c = "broadcast" === d.split("@")[1],
u = this.N.attr("participant", e),
l = c ? u : d,
f = c ? void 0 : u,
h = c ? !1 : this.N.child("broadcast", e) && d === Store.Conn.me,
p = "invis" === this.N.attr("web", e),
m = this.N.attr("notify", e) || "",
g = parseInt(this.N.attr("status", e)) || 0,
v = [],
y = this.N.child("broadcast", e);
if ("broadcast" !== s) {
switch (t) {
case "fresh":
n = 1;
break;
default:
n = g >= -1 && 4 >= g ? g : 1
}
if (_.isArray(y)) {
var b, w = y.length;
for (b = 0; w > b; b++) {
var E = y[b],
S = this.N.attr("jid", E);
"to" === this.N.tag(E) && S && v.push(S)
}
}
var N, T = [],
$ = this.N.attr("type", e);
switch ($) {
case "ciphertext":
case "text":
var C = this.N.dataStr(this.N.child("body", e)) || "";
N = {
id: i,
body: "text" === $ ? C : void 0,
type: "text" === $ ? "chat" : "ciphertext",
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
invis: p,
ack: n,
broadcast: h,
recipients: v
}, T = [!i, !a, !l, !s];
break;
case "media":
var A, I, O, k, P, R = this.N.child("media", e),
M = this.N.attr("type", R),
L = this.N.attr("media_key", R),
D = this.N.attr("mimetype", R);
if ("retry" === this.N.attr("reason", R)) return;
switch (M) {
case "image":
case "video":
var U = this.N.attr("caption", R);
A = this.thumbFromMediaXml(R), I = this.N.attr("url", R), I = _.isString(I) && I.indexOf("/u/") > 0 ? void 0 : I, O = this.N.attr("filehash", R), k = parseInt(this.N.attr("size", R), 10) || 0, P = this.N.attr("seconds", R), N = {
id: i,
body: A,
type: M,
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
invis: p,
ack: n,
clientUrl: I,
duration: P,
broadcast: h,
recipients: v,
filehash: O,
size: k,
caption: U,
mediaKey: L,
mimetype: D
}, T = [!i, !a, !l, !s];
break;
case "location":
var B = this.N.attr("latitude", R),
x = this.N.attr("longitude", R),
j = this.N.attr("name", R);
A = this.thumbFromMediaXml(R), I = this.N.attr("url", R), N = {
id: i,
body: A,
type: M,
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
invis: p,
ack: n,
clientUrl: I,
loc: j,
lat: B,
lng: x,
broadcast: h,
recipients: v
}, T = [!i, !a, !l, !s, !B || !x];
break;
case "audio":
var W = "live" === this.N.attr("origin", R) ? "ptt" : M;
I = this.N.attr("url", R), I = _.isString(I) && I.indexOf("/u/") > 0 ? void 0 : I, O = this.N.attr("filehash", R), k = parseInt(this.N.attr("size", R), 10) || 0, P = this.N.attr("seconds", R), N = {
id: i,
type: W,
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
invis: p,
ack: n,
clientUrl: I,
duration: P,
broadcast: h,
recipients: v,
filehash: O,
size: k,
mediaKey: L,
mimetype: D
}, T = [!i, !a, !l, !s];
break;
case "vcard":
var Y = this.N.child("vcard", R),
F = this.N.dataStr(Y),
G = this.N.attr("name", Y);
N = {
id: i,
body: F,
type: M,
subtype: G,
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
invis: p,
ack: n,
broadcast: h,
recipients: v
}, T = [!i, !a, !l, !s, !F, !G];
break;
default:
o.error("wap:parseMsgMessage: unknown media type: " + this.N.toString(e), e)()
}
break;
default:
o.error("wap:parseMsgMessage: unknown message type: " + this.N.toString(e), e)()
}
return this.dropIfConditionMet(T, N)
}
}
},
thumbFromMediaXml: function(e) {
return "raw" === this.N.attr("encoding", e) ? s.isByteBuffer(this.N.children(e)) ? this.N.children(e).toBase64() : "" : this.N.dataStr(e)
},
parseMsgGp2: function(e) {
if ("groups_v2" === this.N.tag(e)) {
var t, r = parseInt(this.N.attr("t", e), 10) || 0,
n = this.N.attr("id", e),
o = this.N.attr("jid", e),
i = "invis" === this.N.attr("web", e),
a = this.N.attr("type", e),
s = this.N.attr("author", e),
d = this.N.children(e),
c = [];
switch (a) {
case "create":
t = this.N.attr("subject", e);
break;
case "subject":
t = this.N.attr("subject", e);
break;
case "picture":
t = this.N.attr("picture", e)
}
if (_.isArray(d)) {
var u, l = d.length;
for (u = 0; l > u; u++) {
var f = d[u],
h = this.N.attr("jid", f);
"participant" === this.N.tag(f) && h && c.push(h)
}
}
var p = _.isString(s) ? s.indexOf("s.whatsapp.net") : -1;
p > -1 && (s = s.slice(0, p) + "c.us");
var m = {
t: r,
id: n,
to: o,
from: o,
author: s,
body: t ? t.toString() : void 0,
type: "gp2",
subtype: a,
invis: i,
recipients: c
},
g = [!n, !r, "subject" !== a && "add" !== a && "remove" !== a && "leave" !== a && "picture" !== a && "modify" !== a && "create" !== a && "delete" !== a && "promote" !== a && "demote" !== a, "subject" === a && !t, ("add" === a || "remove" === a || "leave" === a || "promote" === a || "demote" === a || "modify" === a) && 0 === c.length, !o, "string" == typeof o && "g.us" !== o.split("@")[1]];
return this.dropIfConditionMet(g, m)
}
},
parseMsgBroadcast: function(e) {
if ("broadcast" === this.N.tag(e)) {
var t, r = this.N.attr("type", e),
n = this.N.attr("id", e),
o = parseInt(this.N.attr("t", e), 10) || 0,
i = this.N.attr("jid", e);
switch (r) {
case "create":
t = parseInt(this.N.attr("count", e), 10) || 0;
break;
case "add":
case "remove":
t = this.N.attr("participant", e)
}
var a = {
id: n,
t: o,
type: "broadcast_notification",
subtype: r,
from: i,
to: i,
body: t ? t.toString() : void 0
},
s = [!n, !o, !i, "string" == typeof i && "broadcast" !== i.split("@")[1], "create" !== r && "add" !== r && "remove" !== r, ("add" === r || "remove" === r) && 2 !== t.split("@").length];
return this.dropIfConditionMet(s, a)
}
},
parseMsgNotification: function(e) {
if ("notification" === this.N.tag(e)) {
var t = this.N.attr("id", e),
r = parseInt(this.N.attr("t", e), 10) || 0,
n = this.N.attr("jid", e),
o = "invis" === this.N.attr("web", e),
i = this.N.dataStr(e),
a = "true" === this.N.attr("owner", e) ? Store.Conn.me : n,
s = "true" === this.N.attr("owner", e) ? n : Store.Conn.me,
d = {
id: t,
type: "notification",
t: r,
invis: o,
from: a,
to: s,
body: i
},
c = [!t, !r, !n, 2 !== n.split("@").length];
return this.dropIfConditionMet(c, d)
}
},
"delete": _.noop,
error2412: _.noop,
setSubProtocol: function(e) {
1 === e ? (this.BinaryProtocol = new l("01"), this.N = this.BinaryProtocol.Node) : (this.BinaryProtocol = new l("03"), this.N = this.BinaryProtocol.Node)
},
handle: function(e, t, r) {
var n, i, a, s, d, c, u, l, f = this.BinaryProtocol.read(e);
switch (this.N.tag(f)) {
case "response":
if (0 === r.indexOf("preempt")) switch (this.N.attr("type", f)) {
case "chat":
if (o.logColor("green", "bin-recv: " + r + ",response,chat", f)(), i = this.N.children(f) || [], _.isArray(i)) {
for (s = i.length, n = [], a = 0; s > a; a++) u = this.parseChat(i[a]), u && n.push(u);
Store.Chat.handle([{
cmd: "preempt",
response: n
}], t)
}
break;
case "contacts":
if (o.logColor("green", "bin-recv: " + r + ",response,contact", f)(), i = this.N.children(f), _.isArray(i)) {
for (s = i.length, n = [], a = 0; s > a; a++) d = this.parseContact(i[a]), d && n.push(d);
Store.Contact.handle([{
cmd: "preempt",
checksum: this.N.attr("checksum", f),
response: n
}], t)
}
break;
default:
o.error("Wap:handle unknown response type: " + this.N.toString(f, !0), f)()
} else o.error("Wap:handle non-preemptive response: " + this.N.toString(f, !0), f)();
break;
case "action":
var h = this.actionGetMeta(f),
p = this.groupActionsByType(this.N.children(f)),
m = Object.keys(p);
if (_.isArray(m)) {
var g, v, y, b, w = m.length;
if (0 === w && "last" === h.add) Store.Msg.handle([{
recent: !0,
meta: h
}]);
else
for (a = 0; w > a; a++) {
v = m[a], g = p[v];
var E, S = g.length;
switch (v) {
case "msg":
var N;
switch (h.add) {
case "relay":
case "update":
N = this.parseMsg(g[0], "relay"), 1 !== S && o.error("Wap:handle action msg relay length not 1", f)(), N ? (o.logColor("green", "bin-recv: " + [r, "action", "msg", h.add, N.type, N.from, N.to, N.id].join(","), f)(), b = this.msgGetTarget(N), Store.Msg.handle([{
meta: {
add: h.add
},
chat: b,
msg: N
}])) : o.error("Wap:handle action msg relay dropped", g[0])();
break;
case "last":
for (o.logColor("green", "bin-recv: " + [r, "action", "msg", "last", g.length].join(","), f)(), y = [], E = 0; S > E; E++) N = this.parseMsg(g[E], "last"), N ? y.push(N) : o.error("Wap:handle action msg last dropped", g[E])();
if (y.length > 0) {
for (var T = {
recent: !0,
meta: h
}, $ = 0; $ < y.length; $++) T[this.msgGetTarget(y[$])] = y[$];
Store.Msg.handle([T])
} else o.error("Wap:handle action msg last dropped to 0")();
break;
case "before":
case "after":
case "unread":
if (S > 0) {
for (y = [], E = 0; S > E; E++) N = this.parseMsg(g[E], h.add), N ? y.push(N) : o.error("Wap:handle action msg before/after dropped", g[E])();
o.logColor("green", "bin-recv: " + [r, "action", "msg", h.add, y.length].join(","), f)(), y.length > 0 ? (b = this.msgGetTarget(y[0]), Store.Msg.handle([{
meta: h,
chat: b,
msgs: y
}])) : o.error("Wap:handle action msg before/after droppped to 0")()
} else o.error("Wap:handle action msg before/after 0 msgs")();
break;
default:
o.error("Wap:handle action msg no meta.add", f)()
}
break;
case "cmd":
for (E = 0; S > E; E++) {
var C = this.parseCmd(g[E]);
if (C) {
var A = _.values(C).join(",");
o.logColor("green", "bin-recv: " + [r, "action", "cmd", A].join(","), f)(), Store.Cmd.handle([C], t)
} else o.error("Wap:handle action cmd invalid", f)()
}
break;
case "bcUpdate":
var I = [];
for (E = 0; S > E; E++) {
var O = this.parseBCUpdate(g[E]);
O ? I.push(O) : o.error("Wap:handle action bc update invalid", g[E])()
}
o.logColor("green", "bin-recv: " + [r, "action", "bcUpdate", I.length].join(","), f)(), I.length > 0 && Store.GroupMetadata.handle(I, t);
break;
case "ack":
for (E = 0; S > E; E++) {
var k = this.parseAck(g[E]);
k ? (o.logColor("green", "bin-recv: " + [r, "action", "ack", k.to, k.id, k.ack].join(","), f)(), Store.Msg.handle([k], t)) : o.error("Wap:handle action ack invalid", f)()
}
break;
case "contact":
for (c = [], E = 0; S > E; E++) d = this.parseContact(g[E]), d ? c.push(d) : o.error("Wap:handle action contact dropped", g[E])();
if (o.logColor("green", "bin-recv: " + [r, "action", "contact", c.length, h.missing].join(","), f)(), c.length > 0) {
var P = [c];
(h.missing || h.checksum) && P.push(h), Store.Contact.handle(P, t)
}
break;
case "chat":
for (l = [], E = 0; S > E; E++) u = this.parseChat(g[E]), u ? l.push(u) : o.error("Wap:handle action chat dropped", g[E])();
o.logColor("green", "bin-recv: " + [r, "action", "chat", l.length].join(","), f)(), l.length > 0 && Store.Chat.handle([l], t);
break;
case "battery":
var R = this.parseBattery(g[0]);
R ? (o.logColor("green", "bin-recv: " + [r, "action", "battery", R.battery, R.plugged].join(","), f)(), Store.Conn.handle([R], t)) : o.error("Wap:handle action battery dropped", g[0])();
break;
case "mute":
for (l = [], E = 0; S > E; E++) u = this.parseChat(g[E]), u ? l.push(u) : o.error("Wap:handle action mute dropped", g[E])();
o.logColor("green", "bin-recv: " + [r, "action", "mute", l.length].join(","), f)(), l.length > 0 && Store.Mute.handle(l, t);
break;
default:
o.error("Wap:handle action unknown " + v, f)()
}
}
}
break;
default:
o.errorVerbose("TODO " + this.N.toString(f, !0), f)()
}
return !0
},
requestDeviceUploadLogs: function() {
var e, t = this;
return new Promise(function(r, n) {
if (t.isRequestingDeviceUploadLogsMutex) return void r();
e = ++t.isRequestingDeviceUploadLogsMutex;
var o = t.actionNode("debug", [
["log", void 0, void 0]
]),
i = r;
i.drop = !0, a.send({
data: t.BinaryProtocol.write(o),
onSend: i,
onDrop: n,
binaryOpts: {
debugString: "debug,log",
debugObj: o,
metric: t.M.DEBUG_LOG,
ackRequest: !0
}
})
})["finally"](function() {
e === t.isRequestingDeviceUploadLogsMutex && (t.isRequestingDeviceUploadLogsMutex = 0)
})
},
resyncMessages: function(e) {
var t = this;
return new d(function(r, n) {
var i = function(e) {
var n = [],
i = t.BinaryProtocol.read(e),
a = t.N.children(i);
if (o.logColor("green", "bin-recv: response,resume", i)(), "response" === t.N.tag(i) && "resume" === t.N.attr("type", i) && _.isArray(a)) {
var s, d = a.length;
for (s = 0; d > s; s++) {
var c = t.parseChat(a[s]);
c && n.push(c)
}
}
r({
checksum: t.N.attr("checksum", i),
data: n
})
},
s = e.map(function(e) {
var t = {
jid: e.wid,
index: e.id,
owner: e.fromMe,
archive: (!!e.archive).toString()
};
return e.mute && (t.mute = e.mute.toString()), e.active && (t.active = "true"), c.isGroup(e.wid) && (t.read_only = (!!e.isReadOnly).toString()), e.modifyTag && (t.modify_tag = e.modifyTag.toString()), e.unreadCount && (t.count = e.unreadCount.toString()), ["last", t, void 0]
}),
d = t.queryNode({
type: "resume"
}, s);
a.sendEphemeral({
data: t.BinaryProtocol.write(d),
onSend: t.binWrap(i, r),
onDrop: n,
binaryOpts: {
debugString: "query,resume",
debugObj: d,
metric: t.M.QUERY_RESUME,
ackRequest: !1
}
})
})
},
resyncReceipts: function(e) {
var t = this;
return new Promise(function(r, n) {
var i = function(e) {
var n = [],
i = t.BinaryProtocol.read(e),
a = t.N.children(i);
if (o.logColor("green", "bin-recv: response,receipt", i)(), "response" === t.N.tag(i) && "receipt" === t.N.attr("type", i) && _.isArray(a)) {
var s, d, c, u = a.length;
for (s = 0; u > s; s++) {
d = a[s], c = t.N.children(d);
var l = t.N.attr("jid", d),
f = t.N.attr("t", d);
if ("receipt" === t.N.tag(d) && l && f && _.isArray(c)) {
var h, p = [],
m = c.length;
for (h = 0; m > h; h++) {
var g = c[h];
if ("item" === t.N.tag(g)) {
var v = t.N.attr("index", g),
y = parseInt(t.N.attr("status", g), 10) || 0;
v && 0 !== y && 4 >= y && p.push([v, !0, void 0, y])
}
}
p.length > 0 && n.push({
id: l,
t: parseInt(f, 10),
acks: p
})
}
}
}
r(n)
},
s = e.map(function(e) {
return ["last", {
jid: e.remote,
index: e.id,
t: e.t.toString()
}, void 0]
}),
d = t.queryNode({
type: "receipt"
}, s);
a.sendEphemeral({
data: t.BinaryProtocol.write(d),
onSend: t.binWrap(i, r),
onDrop: n,
binaryOpts: {
debugString: "query,receipt",
debugObj: d,
metric: t.M.QUERY_RECEIPT,
ackRequest: !1
}
})
})
},
addParticipant: function(e, t) {
var r = this;
return new Promise(function(n, o) {
var i = a.tag(),
s = r.wrap(n);
s.tag = i;
var d = ["participant", {
jid: t
}, void 0],
c = ["group", {
id: i,
jid: e,
type: "add",
author: Store.Conn.me
},
[d]
],
u = r.actionNode("set", [c]);
a.send({
data: r.BinaryProtocol.write(u),
onSend: s,
onDrop: o,
binaryOpts: {
debugString: "action,group,add_participant",
debugObj: u,
metric: r.M.GROUP,
ackRequest: !1
}
})
})
},
changeSubject: function(e, t) {
var r = this;
return new Promise(function(n, o) {
var i = a.tag(),
s = r.wrap(n);
s.tag = i;
var d = ["group", {
id: i,
jid: e,
type: "subject",
author: Store.Conn.me,
subject: t
}, void 0],
c = r.actionNode("set", [d]);
a.send({
data: r.BinaryProtocol.write(c),
onSend: s,
onDrop: o,
binaryOpts: {
debugString: "action,group,subject",
debugObj: c,
metric: r.M.GROUP,
ackRequest: !1
}
})
})
},
createGroup: function(e, t) {
var r = this;
return new Promise(function(n, i) {
var s = a.tag(),
d = r.wrap(n);
d.tag = s;
var c = t.map(function(e) {
return ["participant", {
jid: e
}, void 0]
});
o.log("create group tag", s)();
var u = ["group", {
id: s,
type: "create",
author: Store.Conn.me,
subject: e
}, c],
l = r.actionNode("set", [u]);
a.send({
data: r.BinaryProtocol.write(l),
onSend: d,
onDrop: i,
binaryOpts: {
debugString: "action,group,create",
debugObj: l,
metric: r.M.GROUP,
ackRequest: !1
}
})
})
},
leaveGroup: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = a.tag(),
i = t.wrap(r);
i.tag = o;
var s = ["group", {
id: o,
jid: e,
type: "leave",
author: Store.Conn.me
}, void 0],
d = t.actionNode("set", [s]);
a.send({
data: t.BinaryProtocol.write(d),
onSend: i,
onDrop: n,
binaryOpts: {
debugString: "action,group,delete",
debugObj: d,
metric: t.M.GROUP,
ackRequest: !1
}
})
})
},
removeParticipant: function(e, t) {
var r = this;
return new Promise(function(n, o) {
var i = a.tag(),
s = r.wrap(n);
s.tag = i;
var d = ["participant", {
jid: t
}, void 0],
c = ["group", {
id: i,
jid: e,
type: "remove",
author: Store.Conn.me
},
[d]
],
u = r.actionNode("set", [c]);
a.send({
data: r.BinaryProtocol.write(u),
onSend: s,
onDrop: o,
binaryOpts: {
debugString: "action,group,rem_participant",
debugObj: u,
metric: r.M.GROUP,
ackRequest: !1
}
})
})
},
requestMediaReupload: function(e) {
var t = this;
return new Promise(function(r, n) {
var i = e.id,
s = function(e) {
var n, i = t.BinaryProtocol.read(e);
if ("response" === t.N.tag(i) && "media" === t.N.attr("type", i)) {
var a = parseInt(t.N.attr("code", i)) || 400,
s = t.N.attr("url", i);
a >= 500 && 502 !== a ? (o.error("wap:requestMediaReupload:error " + a)(), n = {
status: a
}) : 200 === a && s ? n = {
status: 200,
url: s,
mediaKey: t.N.attr("media_key", i)
} : 200 !== a || s ? (o.error("wap:requestMediaReupload:error " + a)(), n = {
status: a
}) : n = {
status: 400
}
} else o.error("wap:requestMediaReupload:malformed")(), n = {
status: 400
};
r(n)
},
d = i,
c = t.queryNode({
type: "media",
index: d.id,
jid: d.remote,
owner: d.fromMe.toString()
}, void 0);
a.sendEphemeral({
data: t.BinaryProtocol.write(c),
onSend: t.binWrap(s, r),
onDrop: n,
binaryOpts: {
debugString: "query,media",
debugObj: c,
metric: t.M.QUERY_MEDIA,
ackRequest: !1
}
})
})
},
sendConversationSeen: function(e, t, r) {
var n = this;
return new Promise(function(o, i) {
var s = o,
d = n.actionNode("set", [
["read", {
jid: e,
index: t ? t.id : void 0,
owner: t ? t.fromMe.toString() : void 0,
count: r && t ? r.toString() : void 0
}, void 0]
]);
a.sendEphemeral({
data: n.BinaryProtocol.write(d),
onSend: s,
onDrop: i,
binaryOpts: {
debugString: "action,chat,read, " + JSON.stringify(t) + ", " + r,
debugObj: d,
metric: n.M.READ,
ackRequest: !0
}
})
})
},
sendConversationDelete: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = r,
i = t.actionNode("set", [
["chat", {
type: "delete",
jid: e
}, void 0]
]);
a.send({
data: t.BinaryProtocol.write(i),
onSend: o,
onDrop: n,
binaryOpts: {
debugString: "action,chat,delete",
debugObj: i,
metric: t.M.CHAT,
ackRequest: !0
}
})
})
},
sendConversationArchive: function(e, t) {
var r = this;
return new Promise(function(n, o) {
var i = n,
s = t ? "archive" : "unarchive",
d = r.actionNode("set", [
["chat", {
type: s,
jid: e
}, void 0]
]);
a.send({
data: r.BinaryProtocol.write(d),
onSend: i,
onDrop: o,
binaryOpts: {
debugString: "action,chat, " + s,
debugObj: d,
metric: r.M.CHAT,
ackRequest: !0
}
})
})
},
sendConversationMute: function(e, t) {
var r = this;
return new Promise(function(n, o) {
var i = n,
s = t ? t.toString() : void 0,
d = r.actionNode("set", [
["chat", {
type: "mute",
mute: s,
jid: e
}, void 0]
]);
a.send({
data: r.BinaryProtocol.write(d),
onSend: i,
onDrop: o,
binaryOpts: {
debugString: "action,chat, " + e + ", " + (s ? "mute, " + s : "unmute"),
debugObj: d,
metric: r.M.CHAT,
ackRequest: !0
}
})
})
},
sendMessagePlayed: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = r,
i = e.remote,
s = e.id,
d = t.actionNode("set", [
["received", {
type: "played",
index: s,
from: i
}, void 0]
]);
a.send({
data: t.BinaryProtocol.write(d),
onSend: o,
onDrop: n,
binaryOpts: {
debugString: "action,played, " + i + "_" + s,
debugObj: d,
metric: t.M.RECEIVED,
ackRequest: !0
}
})
})
},
profilePicFindThumbFromPhone: function(e, t) {
var r = this;
return new Promise(function(n, o) {
var i = function(i) {
var a = r.BinaryProtocol.read(i);
"response" === r.N.tag(a) && "preview" === r.N.attr("type", a) || o();
var s = r.N.children(a),
d = s && s[0];
if (d || o(), "missing" === r.N.attr("type", d)) n({
id: e,
tag: void 0,
raw: void 0
});
else {
var c, u = r.N.attr("id", d);
if (t && u === t.tag && t.raw) c = t.raw;
else {
var l = r.N.children(d);
c = l ? l.toBase64() : void 0
}
n({
id: e,
tag: u,
raw: c
})
}
},
s = {
type: "preview",
jid: e
};
t && t.tag && (s.id = t.tag);
var d = r.queryNode(s, []);
a.sendEphemeral({
data: r.BinaryProtocol.write(d),
onSend: r.binWrap(i, n),
onDrop: o,
binaryOpts: {
debugString: "query,thumb, " + e,
debugObj: d,
ackRequest: !1
}
})
})
},
groupMetadataFindFromPhone: function(e, t) {
var r = this;
return new Promise(function(t, n) {
var o = function(n) {
var o = r.BinaryProtocol.read(n);
if ("response" !== r.N.tag(o) || "group" !== r.N.attr("type", o)) return void t({
status: "error",
info: "bad format: response incorrect"
});
var i = r.N.children(o),
a = i && i[0];
if (!a) return void t({
status: "error",
info: "bad format: no group node"
});
if ("missing" === r.N.attr("type")) return void t({
status: "missing"
});
var s = _.map(r.N.children(a), function(e) {
return {
id: r.N.attr("jid", e),
isAdmin: "admin" === r.N.attr("type", e)
}
});
t({
status: "ok",
data: {
id: e,
owner: r.N.attr("creator", a),
creation: parseInt(r.N.attr("create", a), 10) || void 0,
participants: s,
stale: !1
}
})
},
i = r.queryNode({
type: "group",
jid: e
}, []);
a.sendEphemeral({
data: r.BinaryProtocol.write(i),
onSend: r.binWrap(o, t),
onDrop: n,
binaryOpts: {
debugString: "query,group, " + e,
debugObj: i,
ackRequest: !1
}
})
})
},
sendPresenceUpdate: function(e) {
var t = this;
return ["available", "unavailable"].indexOf(e) > -1 ? new Promise(function(r, n) {
var o = r,
i = t.actionNode("set", [
["presence", {
type: e
}, void 0]
]),
s = {
data: t.BinaryProtocol.write(i),
onSend: o,
onDrop: n,
binaryOpts: {
debugString: "action,presence, " + e,
debugObj: i,
metric: t.M.PRESENCE,
available: "available" === e,
ackRequest: "available" === e
}
};
"available" === e ? a.sendEphemeral(s) : a.sendEphemeralIgnore(s)
}) : void 0
},
sendChatstateUpdate: function(e, t) {
var r = this;
return ["composing", "paused", "recording"].indexOf(e) > -1 ? new Promise(function(n, o) {
var i = n,
s = r.actionNode("set", [
["presence", {
type: e,
to: t
}, void 0]
]);
a.sendEphemeralIgnore({
data: r.BinaryProtocol.write(s),
onSend: i,
onDrop: o,
binaryOpts: {
debugString: "action,chatstate, " + e,
debugObj: s,
metric: r.M.PRESENCE,
skipOffline: !0,
ackRequest: !1
}
}, !0)
}) : void 0
},
sendSetPicture: function(e, t, r) {
var n = this;
return new Promise(function(o, i) {
var d = u.parseDataURL(t).data,
c = u.parseDataURL(r).data,
l = s.fromBase64(d, !1),
f = s.fromBase64(c, !1),
h = a.tag(),
p = n.wrap(o);
p.tag = h;
var m = ["picture", {
id: h,
jid: e,
type: "set"
},
[
["image", void 0, f],
["preview", void 0, l]
]
],
g = n.actionNode("set", [m]);
a.send({
data: n.BinaryProtocol.write(g),
onSend: p,
onDrop: i,
binaryOpts: {
debugString: "action,set_pic, " + e,
debugObj: g,
metric: n.M.PIC,
ackRequest: !1
}
})
})
},
deletePicture: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = a.tag(),
i = t.wrap(r);
i.tag = o;
var s = ["picture", {
id: o,
jid: e,
type: "delete"
}, void 0],
d = t.actionNode("set", [s]);
a.send({
data: t.BinaryProtocol.write(d),
onSend: i,
onDrop: n,
binaryOpts: {
debugString: "action,delete_pic, " + e,
debugObj: d,
metric: t.M.PIC,
ackRequest: !1
}
})
})
},
sendSetStatus: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = a.tag(),
i = t.wrap(r);
i.tag = o;
var s = t.actionNode("set", [
["status", void 0, e]
]);
a.send({
data: t.BinaryProtocol.write(s),
onSend: i,
onDrop: n,
binaryOpts: {
debugString: "action,status,set",
debugObj: s,
metric: t.M.STATUS,
ackRequest: !1
}
})
})
},
chatFindQuery: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = function(e) {
var n = [],
o = t.BinaryProtocol.read(e),
i = t.N.children(o);
if ("response" === t.N.tag(o) && "chat" === t.N.attr("type", o))
if ("true" === t.N.attr("duplicate", o)) n = "preempted";
else if (_.isArray(i)) {
var a, s = i.length;
for (a = 0; s > a; a++) {
var d = t.parseChat(i[a]);
d && n.push(d)
}
}
r(n)
},
i = t.queryNode({
type: "chat",
kind: e ? "retry" : void 0
}, void 0);
a.sendEphemeral({
data: t.BinaryProtocol.write(i),
onSend: t.binWrap(o, r),
onDrop: n,
binaryOpts: {
debugString: "query,chat, " + e,
debugObj: i,
metric: t.M.QUERY_CHAT,
ackRequest: !1
}
})
})
},
contactFindQuery: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = function(e) {
var n = [],
o = t.BinaryProtocol.read(e),
i = t.N.children(o);
if ("response" === t.N.tag(o) && "contacts" === t.N.attr("type", o))
if ("true" === t.N.attr("duplicate", o)) n = "preempted";
else if (_.isArray(i)) {
var a, s = i.length;
for (a = 0; s > a; a++) {
var d = t.parseContact(i[a]);
d && n.push(d)
}
}
r({
checksum: t.N.attr("checksum", o),
data: n
})
},
i = t.queryNode({
type: "contacts",
kind: e ? "retry" : void 0
}, void 0);
a.send({
data: t.BinaryProtocol.write(i),
onSend: t.binWrap(o, r),
onDrop: n,
binaryOpts: {
debugString: "query,contacts, " + e,
debugObj: i,
metric: t.M.QUERY_CONTACTS,
ackRequest: !1
}
})
})
},
msgCreateRecord: function(e, t) {
var r = this;
return new Promise(function(n, i) {
var d, c, u = e.id;
if ("chat" === e.type) c = Promise.resolve(["message", {
type: "text",
to: e.to,
id: e.id,
t: e.t.toString()
},
[
["body", void 0, e.body]
]
]);
else if ("location" === e.type) d = e.body ? s.fromBase64(e.body, !1) : void 0, c = Promise.resolve(["message", {
type: "media",
to: e.to,
id: e.id,
t: e.t.toString()
},
[
["media", {
type: "location",
latitude: e.lat || void 0,
longitude: e.lng || void 0,
name: e.loc && e.url ? e.loc : void 0,
url: e.loc && e.url ? e.url : void 0,
encoding: e.body ? "raw" : void 0
}, d]
]
]);
else if ("vcard" === e.type) {
var l = ["vcard", {
name: e.subtype
}, e.body];
c = Promise.resolve(["message", {
type: "media",
to: e.to,
id: e.id,
t: e.t.toString()
},
[
["media", {
type: "vcard"
},
[l]
]
]
])
} else {
var h = e.mediaKey;
d = e.body ? s.fromBase64(e.body, !1) : void 0, c = (t && !h ? r.sendMedia(e.avparams) : Promise.resolve(_.merge({
status: 200
}, e.avparams))).then(function(t) {
return 200 === t.status ? Promise.resolve(["message", {
type: "media",
to: e.to,
id: e.id,
t: e.t.toString()
},
[
["media", {
encoding: e.body ? "raw" : void 0,
origin: "ptt" === e.type ? "live" : void 0,
seconds: "ptt" === e.type && e.duration ? e.duration.toString() : void 0,
type: t.type,
mimetype: e.mimetype || t.mimetype || void 0,
size: e.size ? e.size.toString() : void 0,
filehash: t.filehash,
url: t.url,
duration: t.duration ? t.duration.toString() : void 0,
vcodec: t.vcodec || void 0,
width: t.width ? t.width.toString() : void 0,
height: t.height ? t.height.toString() : void 0,
fps: t.fps ? t.fps.toString() : void 0,
vbitrate: t.vbitrate ? t.vbitrate.toString() : void 0,
acodec: t.acodec || void 0,
asampfreq: t.asampfreq ? t.asampfreq.toString() : void 0,
asampfmt: t.asampfmt || void 0,
abitrate: t.abitrate ? t.abitrate.toString() : void 0,
caption: "video" !== e.type && "image" !== e.type || !e.caption ? void 0 : e.caption,
page_count: "number" != typeof e.pageCount || isNaN(e.pageCount) ? void 0 : e.pageCount.toString(),
media_key: h,
filename: t.filename
}, d]
]
]) : (o.error("wap:msgCreateRecord:sendMedia error " + t.status)(), Promise.reject())
})["catch"](function() {
return o.error("wap:msgCreateRecord:sendMedia dropped")(), Promise.reject()
})
}
c.then(function(t) {
var o = r.actionNode("relay", [t]),
s = r.wrap(n);
s.tag = u, s.meta = {
type: "message",
key: new f(e.from, e.to, e.id)
}, a.send({
data: r.BinaryProtocol.write(o),
onSend: s,
onDrop: i,
binaryOpts: {
debugString: "action,message, " + e.type,
debugObj: o,
metric: r.M.MESSAGE,
ackRequest: !1
}
})
})["catch"](function() {
o.error("wap:msgCreateRecord mPromise error")(), i()
})
})
},
msgFindQuery: function(e, t) {
var r = this;
return "before" !== e ? Promise.reject("wap:msgFindQuery:unsupported:" + e) : new Promise(function(e, n) {
var o = function(t) {
var n = [],
o = r.BinaryProtocol.read(t),
i = r.N.children(o);
if ("response" === r.N.tag(o) && "message" === r.N.attr("type", o) && _.isArray(i)) {
var a, s = i.length;
for (a = 0; s > a; a++) {
var d = r.parseMsg(i[a], "response");
d && n.push(d)
}
}
e(n)
},
i = r.queryNode({
type: "message",
jid: t.remote,
count: t.count.toString(),
index: t.id,
owner: "undefined" == typeof t.fromMe ? void 0 : t.fromMe.toString()
}, void 0);
a.sendEphemeral({
data: r.BinaryProtocol.write(i),
onSend: r.binWrap(o, e),
onDrop: n,
binaryOpts: {
debugString: "query,message, " + t.remote + "_" + t.id + "_" + t.fromMe + "_" + t.count,
debugObj: i,
metric: r.M.QUERY_MESSAGES,
ackRequest: !1
}
})
})
},
presenceSubscribe: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = r,
i = t.actionNode("set", [
["presence", {
type: "subscribe",
to: e
}, void 0]
]);
a.sendEphemeral({
data: t.BinaryProtocol.write(i),
onSend: o,
onDrop: n,
binaryOpts: {
debugString: "action,presence,subscribe, " + e,
debugObj: i,
metric: t.M.PRESENCE_SUBSCRIBE,
ackRequest: !0
}
})
})
},
sendMedia: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = _.clone(e),
i = function(e) {
r(_.merge(o, e))
};
a.send({
data: ["query", "sendMedia", o.url],
onSend: t.wrap02(i),
onDrop: n
})
})
}
};
e.exports = h
}, function(e, t, r) {
"use strict";
var n = r(1),
o = r(18),
i = r(10),
a = r(7),
s = r(34),
d = r(19),
c = r(51),
u = r(55),
l = r(94),
f = r(155),
h = {
BinaryProtocol: null,
N: null,
M: {
DEBUG_LOG: 1,
QUERY_RESUME: 2,
QUERY_RECEIPT: 3,
QUERY_MEDIA: 4,
QUERY_CHAT: 5,
QUERY_CONTACTS: 6,
QUERY_MESSAGES: 7,
PRESENCE: 8,
PRESENCE_SUBSCRIBE: 9,
GROUP: 10,
READ: 11,
CHAT: 12,
RECEIVED: 13,
PIC: 14,
STATUS: 15,
MESSAGE: 16,
QUERY_ACTIONS: 17,
BLOCK: 18,
QUERY_GROUP: 19,
QUERY_PREVIEW: 20
},
epochCount: 0,
epoch: 0,
isRequestingDeviceUploadLogsMutex: 0,
epochSend: function(e) {
return 0 === this.epochCount && this.epoch++, e || this.epochCount++, n.log("wap:epochCount: " + this.epochCount + " epoch: " + this.epoch)(), this.epoch.toString()
},
epochRecv: function() {
this.epochCount > 0 ? this.epochCount-- : n.error("wap:epochRecv: NEGATIVE")(), n.log("wap:epochCount: " + this.epochCount + " epoch: " + this.epoch)()
},
wrap: function(e) {
var t = this;
return function(r) {
return r && "number" == typeof r.status && r.status >= 500 ? r : (t.epochRecv(), void e(r))
}
},
binWrap: function(e, t) {
var r = this;
return function(n) {
if ("object" == typeof n && "number" == typeof n.status) {
if (401 === n.status) throw r.epochRecv(), new o.E401;
if (n.status >= 500) return n;
r.epochRecv(), t(n)
} else r.epochRecv(), e(n)
}
},
actionNode: function(e, t, r) {
return ["action", {
type: e,
epoch: this.epochSend(r)
}, t]
},
queryNode: function(e, t) {
return e.epoch = this.epochSend(), ["query", e, t]
},
parseMsgMessage: function(e, t) {
if ("message" === this.N.tag(e)) {
var r;
this.N.attr("from", e) !== Store.Conn.me || this.N.attr("to", e) ? this.N.attr("to", e) !== Store.Conn.me || this.N.attr("from", e) || (r = "out") : r = "in";
var o, i = this.N.attr("id", e),
a = parseInt(this.N.attr("t", e), 10) || 0,
s = this.N.attr("to", e) || Store.Conn.me,
d = this.N.attr("from", e) || Store.Conn.me,
c = "broadcast" === d.split("@")[1],
u = this.N.attr("participant", e),
l = c ? u : d,
f = c ? void 0 : u,
h = c ? !1 : this.N.child("broadcast", e) && d === Store.Conn.me,
p = "invis" === this.N.attr("web", e),
m = this.N.attr("notify", e) || "",
g = parseInt(this.N.attr("status", e)) || 0,
v = [],
y = this.N.child("broadcast", e);
if ("broadcast" !== s) {
switch (t) {
case "fresh":
o = 1;
break;
default:
o = g >= -1 && 4 >= g ? g : 1
}
if (_.isArray(y)) {
var b, w = y.length;
for (b = 0; w > b; b++) {
var E = y[b],
S = this.N.attr("jid", E);
"to" === this.N.tag(E) && S && v.push(S)
}
}
var N, T = [],
$ = this.N.attr("type", e);
switch ($) {
case "ciphertext":
case "text":
var C = this.N.dataStr(this.N.child("body", e)) || "";
N = {
id: i,
body: "text" === $ ? C : void 0,
type: "text" === $ ? "chat" : "ciphertext",
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
invis: p,
ack: o,
broadcast: h,
recipients: v
}, T = [!i, !a, !l, !s];
break;
case "media":
var A, I, O, k, P, R = this.N.child("media", e),
M = this.N.attr("type", R),
L = this.N.attr("media_key", R),
D = this.N.attr("mimetype", R);
if ("retry" === this.N.attr("reason", R)) return;
switch (M) {
case "image":
case "video":
var U = this.N.attr("caption", R);
A = this.thumbFromMediaXml(R), I = this.N.attr("url", R), I = _.isString(I) && I.indexOf("/u/") > 0 ? void 0 : I, O = this.N.attr("filehash", R), k = parseInt(this.N.attr("size", R), 10) || 0, P = this.N.attr("seconds", R), N = {
id: i,
body: A,
type: M,
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
invis: p,
ack: o,
clientUrl: I,
duration: P,
broadcast: h,
recipients: v,
filehash: O,
size: k,
caption: U,
mediaKey: L,
mimetype: D
}, T = [!i, !a, !l, !s];
break;
case "location":
var B = this.N.attr("latitude", R),
x = this.N.attr("longitude", R),
j = this.N.attr("name", R);
A = this.thumbFromMediaXml(R), I = this.N.attr("url", R), N = {
id: i,
body: A,
type: M,
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
invis: p,
ack: o,
clientUrl: I,
loc: j,
lat: B,
lng: x,
broadcast: h,
recipients: v
}, T = [!i, !a, !l, !s, !B || !x];
break;
case "audio":
var W = "live" === this.N.attr("origin", R) ? "ptt" : M;
I = this.N.attr("url", R), I = _.isString(I) && I.indexOf("/u/") > 0 ? void 0 : I, O = this.N.attr("filehash", R), k = parseInt(this.N.attr("size", R), 10) || 0, P = this.N.attr("seconds", R), N = {
id: i,
type: W,
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
invis: p,
ack: o,
clientUrl: I,
duration: P,
broadcast: h,
recipients: v,
filehash: O,
size: k,
mediaKey: L,
mimetype: D
}, T = [!i, !a, !l, !s];
break;
case "vcard":
var Y = this.N.child("vcard", R),
F = this.N.dataStr(Y),
G = this.N.attr("name", Y);
N = {
id: i,
body: F,
type: M,
subtype: G,
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
invis: p,
ack: o,
broadcast: h,
recipients: v
}, T = [!i, !a, !l, !s, !F, !G];
break;
default:
n.error("wap:parseMsgMessage unknown media type: " + this.N.toString(e), e)()
}
break;
default:
n.error("wap:parseMsgMessage unknown message type: " + this.N.toString(e), e)()
}
return this.dropIfConditionMet(T, N)
}
}
},
parseMsgGp2: function(e) {
if ("groups_v2" === this.N.tag(e)) {
var t, r = parseInt(this.N.attr("t", e), 10) || 0,
n = this.N.attr("id", e),
o = this.N.attr("jid", e),
i = "invis" === this.N.attr("web", e),
a = this.N.attr("type", e),
s = this.N.attr("author", e),
d = this.N.children(e),
c = [];
switch (a) {
case "create":
t = this.N.attr("subject", e);
break;
case "subject":
t = this.N.attr("subject", e);
break;
case "picture":
t = this.N.attr("picture", e)
}
if (_.isArray(d)) {
var u, l = d.length;
for (u = 0; l > u; u++) {
var f = d[u],
h = this.N.attr("jid", f);
"participant" === this.N.tag(f) && h && c.push(h)
}
}
var p = {
t: r,
id: n,
to: o,
from: o,
author: s,
body: t ? t.toString() : void 0,
type: "gp2",
subtype: a,
invis: i,
recipients: c
},
m = [!n, !r, "subject" !== a && "add" !== a && "remove" !== a && "leave" !== a && "picture" !== a && "modify" !== a && "create" !== a && "delete" !== a && "promote" !== a && "demote" !== a, "subject" === a && !t, ("add" === a || "remove" === a || "leave" === a || "promote" === a || "demote" === a || "modify" === a) && 0 === c.length, !o, "string" == typeof o && "g.us" !== o.split("@")[1]];
return this.dropIfConditionMet(m, p)
}
},
setGroupParticipant: function(e, t, r) {
var n = this;
return new Promise(function(o, a) {
var s = i.tag(),
d = n.wrap(o),
c = ["participant", {
jid: r
}, void 0],
u = ["group", {
id: s,
jid: t,
type: e,
author: Store.Conn.me
},
[c]
],
l = n.actionNode("set", [u]);
i.send({
tag: s,
data: n.BinaryProtocol.write(l),
clientCacheable: !0,
onSend: d,
onDrop: n.wrap(a),
binaryOpts: {
debugString: "action,group,participant," + [e, t, r].join(","),
debugObj: l,
metric: n.M.GROUP,
ackRequest: !1,
expires: moment().unix()
}
})
})
},
"delete": function() {
this.epochCount = 0, this.epoch = 0
},
error2412: function() {
this.epochRecv()
},
setSubProtocol: function(e) {
4 === e ? (this.BinaryProtocol = new u("04"), this.N = this.BinaryProtocol.Node) : (n.error("Wap:setSubProtocol unknown " + e)(), this.BinaryProtocol = new u("04"), this.N = this.BinaryProtocol.Node)
},
requestDeviceUploadLogs: function() {
var e, t = this;
return new Promise(function(r, n) {
if (t.isRequestingDeviceUploadLogsMutex) return void r();
e = ++t.isRequestingDeviceUploadLogsMutex;
var o = t.actionNode("debug", [
["log", void 0, void 0]
]),
a = t.wrap(r);
a.drop = !0, i.send({
data: t.BinaryProtocol.write(o),
clientCacheable: !0,
onSend: a,
onDrop: n,
binaryOpts: {
debugString: "debug,log",
debugObj: o,
metric: t.M.DEBUG_LOG,
ackRequest: !0
}
})
})["finally"](function() {
e === t.isRequestingDeviceUploadLogsMutex && (t.isRequestingDeviceUploadLogsMutex = 0)
})
},
resyncMessages: function(e) {
var t = this;
return new s(function(r, o) {
var a = function(e) {
var o = [],
i = t.BinaryProtocol.read(e),
a = t.N.children(i);
if (n.logColor("green", "bin-recv: response,resume", i)(), "response" === t.N.tag(i) && "resume" === t.N.attr("type", i) && _.isArray(a)) {
var s, d = a.length;
for (s = 0; d > s; s++) {
var c = t.parseChat(a[s]);
c && o.push(c)
}
}
r({
checksum: t.N.attr("checksum", i),
data: o
})
},
s = e.map(function(e) {
var t = {
jid: e.wid,
index: e.id,
owner: e.fromMe,
archive: (!!e.archive).toString()
};
return e.mute && (t.mute = e.mute.toString()), e.active && (t.active = "true"),
d.isGroup(e.wid) && (t.read_only = (!!e.isReadOnly).toString()), e.modifyTag && (t.modify_tag = e.modifyTag.toString()), e.unreadCount && (t.count = e.unreadCount.toString()), ["last", t, void 0]
}),
c = t.queryNode({
type: "resume"
}, s);
i.sendEphemeral({
data: t.BinaryProtocol.write(c),
onSend: t.binWrap(a, r),
onDrop: t.wrap(o),
binaryOpts: {
debugString: "query,resume",
debugObj: c,
metric: t.M.QUERY_RESUME,
ackRequest: !1
}
})
})
},
resyncReceipts: function(e) {
var t = this;
return new Promise(function(r, o) {
var a = function(e) {
var o = [],
i = t.BinaryProtocol.read(e),
a = t.N.children(i);
if (n.logColor("green", "bin-recv: response,receipt", i)(), "response" === t.N.tag(i) && "receipt" === t.N.attr("type", i) && _.isArray(a)) {
var s, d, c, u = a.length;
for (s = 0; u > s; s++) {
d = a[s], c = t.N.children(d);
var l = t.N.attr("jid", d),
f = t.N.attr("t", d);
if ("receipt" === t.N.tag(d) && l && f && _.isArray(c)) {
var h, p = [],
m = c.length;
for (h = 0; m > h; h++) {
var g = c[h];
if ("item" === t.N.tag(g)) {
var v = t.N.attr("index", g),
y = parseInt(t.N.attr("status", g), 10) || 0;
v && 0 !== y && 4 >= y && p.push([v, !0, void 0, y])
}
}
p.length > 0 && o.push({
id: l,
t: parseInt(f, 10),
acks: p
})
}
}
}
r(o)
},
s = e.map(function(e) {
return ["last", {
jid: e.remote,
index: e.id,
t: e.t.toString()
}, void 0]
}),
d = t.queryNode({
type: "receipt"
}, s);
i.sendEphemeral({
data: t.BinaryProtocol.write(d),
onSend: t.binWrap(a, r),
onDrop: t.wrap(o),
binaryOpts: {
debugString: "query,receipt",
debugObj: d,
metric: t.M.QUERY_RECEIPT,
ackRequest: !1
}
})
})
},
queryReceivedActions: function(e) {
var t = this;
return new Promise(function(r, o) {
var a = function(e) {
var o = [],
i = t.BinaryProtocol.read(e),
a = t.N.children(i);
if (n.logColor("green", "bin-recv: response,actions", i)(), "response" === t.N.tag(i) && "action" === t.N.attr("type", i))
if (_.isArray(a)) {
var s, d = a.length;
for (s = 0; d > s; s++) {
var c = a[s],
u = t.N.attr("id", c),
l = parseInt(t.N.attr("code", c), 10) || 0;
"item" === t.N.tag(c) && u && 0 !== l && o.push({
id: u,
code: l
})
}
} else "true" === t.N.attr("replaced", i) && (o = "replaced");
r(o)
},
s = e.map(function(e) {
return ["item", {
id: e
}, void 0]
}),
d = t.queryNode({
type: "action"
}, s);
i.sendEphemeral({
data: t.BinaryProtocol.write(d),
onSend: t.binWrap(a, r),
onDrop: t.wrap(o),
binaryOpts: {
debugString: "query,actions",
debugObj: d,
metric: t.M.QUERY_ACTIONS,
ackRequest: !1
}
})
})
},
changeSubject: function(e, t) {
var r = this;
return new Promise(function(n, o) {
var a = i.tag(),
s = r.wrap(n);
s.tag = a;
var d = ["group", {
id: a,
jid: e,
type: "subject",
author: Store.Conn.me,
subject: t
}, void 0],
c = r.actionNode("set", [d]);
i.send({
data: r.BinaryProtocol.write(c),
clientCacheable: !0,
onSend: s,
onDrop: r.wrap(o),
binaryOpts: {
debugString: "action,group,subject",
debugObj: c,
metric: r.M.GROUP,
ackRequest: !1,
expires: moment().unix()
}
})
})
},
createGroup: function(e, t) {
var r = this;
return new Promise(function(o, a) {
var s = i.tag(),
d = r.wrap(o);
d.tag = s;
var c = t.map(function(e) {
return ["participant", {
jid: e
}, void 0]
});
n.log("create group tag", s)();
var u = ["group", {
id: s,
type: "create",
author: Store.Conn.me,
subject: e
}, c],
l = r.actionNode("set", [u]);
i.send({
data: r.BinaryProtocol.write(l),
clientCacheable: !0,
onSend: d,
onDrop: r.wrap(a),
binaryOpts: {
debugString: "action,group,create",
debugObj: l,
metric: r.M.GROUP,
ackRequest: !1,
expires: moment().unix()
}
})
})
},
leaveGroup: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = i.tag(),
a = t.wrap(r);
a.tag = o;
var s = ["group", {
id: o,
jid: e,
type: "leave",
author: Store.Conn.me
}, void 0],
d = t.actionNode("set", [s]);
i.send({
data: t.BinaryProtocol.write(d),
clientCacheable: !0,
onSend: a,
onDrop: t.wrap(n),
binaryOpts: {
debugString: "action,group,delete",
debugObj: d,
metric: t.M.GROUP,
ackRequest: !1,
expires: moment().unix()
}
})
})
},
addParticipant: function(e, t) {
return this.setGroupParticipant("add", e, t)
},
removeParticipant: function(e, t) {
return this.setGroupParticipant("remove", e, t)
},
promoteParticipant: function(e, t) {
return this.setGroupParticipant("promote", e, t)
},
requestMediaReupload: function(e) {
var t = this;
return new Promise(function(r, o) {
var a = e.id,
s = function(e) {
var o, i = t.BinaryProtocol.read(e);
if ("response" === t.N.tag(i) && "media" === t.N.attr("type", i)) {
var a = parseInt(t.N.attr("code", i)) || 400,
s = t.N.attr("url", i);
a >= 500 && 502 !== a ? (n.error("wap:requestMediaReupload:error " + a)(), o = {
status: a
}) : 200 === a && s ? o = {
status: 200,
url: s,
mediaKey: t.N.attr("media_key", i)
} : 200 !== a || s ? (n.error("wap:requestMediaReupload:error " + a)(), o = {
status: a
}) : o = {
status: 400
}
} else n.error("wap:requestMediaReupload:malformed")(), o = {
status: 400
};
r(o)
},
d = a,
c = t.queryNode({
type: "media",
index: d.id,
jid: d.remote,
owner: d.fromMe.toString()
}, void 0);
i.sendEphemeral({
data: t.BinaryProtocol.write(c),
onSend: t.binWrap(s, r),
onDrop: t.wrap(o),
binaryOpts: {
debugString: "query,media",
debugObj: c,
metric: t.M.QUERY_MEDIA,
ackRequest: !1
}
})
})
},
sendConversationSeen: function(e, t, r) {
var n = this;
return new Promise(function(o, a) {
var s = n.actionNode("set", [
["read", {
jid: e,
index: t ? t.id : void 0,
owner: t ? t.fromMe.toString() : void 0,
count: r && t ? r.toString() : void 0
}, void 0]
]);
i.send({
data: n.BinaryProtocol.write(s),
clientCacheable: !0,
onSend: n.wrap(o),
onDrop: n.wrap(a),
binaryOpts: {
debugString: "action,chat,read," + JSON.stringify(t) + "," + r,
debugObj: s,
metric: n.M.READ,
ackRequest: !0
}
})
})
},
sendConversationDelete: function(e, t) {
var r = this;
return new Promise(function(n, o) {
var a = r.actionNode("set", [
["chat", {
type: "delete",
jid: e,
index: t ? t.id : void 0,
owner: t ? t.fromMe.toString() : void 0
}, void 0]
]);
i.send({
data: r.BinaryProtocol.write(a),
clientCacheable: !0,
onSend: r.wrap(n),
onDrop: r.wrap(o),
binaryOpts: {
debugString: "action,chat,delete",
debugObj: a,
metric: r.M.CHAT,
ackRequest: !0
}
})
})
},
sendConversationArchive: function(e, t, r) {
var n = this;
return new Promise(function(o, a) {
var s = t ? "archive" : "unarchive",
d = n.actionNode("set", [
["chat", {
type: s,
jid: e,
index: r ? r.id : void 0,
owner: r ? r.fromMe.toString() : void 0
}, void 0]
]);
i.send({
data: n.BinaryProtocol.write(d),
clientCacheable: !0,
onSend: n.wrap(o),
onDrop: n.wrap(a),
binaryOpts: {
debugString: "action,chat," + s,
debugObj: d,
metric: n.M.CHAT,
ackRequest: !0
}
})
})
},
sendConversationMute: function(e, t, r) {
var n = this;
return new Promise(function(o, a) {
var s = t ? t.toString() : void 0,
d = r ? r.toString() : void 0,
c = n.actionNode("set", [
["chat", {
type: "mute",
mute: s,
previous: d,
jid: e
}, void 0]
]);
i.send({
data: n.BinaryProtocol.write(c),
clientCacheable: !0,
onSend: n.wrap(o),
onDrop: n.wrap(a),
binaryOpts: {
debugString: "action,chat," + e + ", " + (s ? "mute," + s : "unmute"),
debugObj: c,
metric: n.M.CHAT,
ackRequest: !0
}
})
})
},
sendMessagePlayed: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = t.wrap(r),
a = e.remote,
s = e.id,
d = t.actionNode("set", [
["received", {
type: "played",
index: s,
from: a
}, void 0]
]);
i.send({
data: t.BinaryProtocol.write(d),
onSend: o,
onDrop: t.wrap(n),
binaryOpts: {
debugString: "action,played," + a + "_" + s,
debugObj: d,
metric: t.M.RECEIVED,
ackRequest: !0
}
})
})
},
profilePicFindThumbFromPhone: function(e, t) {
var r = this;
return new Promise(function(n, o) {
var a = function(i) {
var a = r.BinaryProtocol.read(i);
"response" === r.N.tag(a) && "preview" === r.N.attr("type", a) || o();
var s = r.N.children(a),
d = s && s[0];
if (d || o(), "missing" === r.N.attr("type", d)) n({
id: e,
tag: void 0,
raw: void 0
});
else {
var c, u = r.N.attr("id", d);
if (t && u === t.tag && t.raw) c = t.raw;
else {
var l = r.N.children(d);
c = l ? l.toBase64() : void 0
}
n({
id: e,
tag: u,
raw: c
})
}
},
s = {
type: "preview",
jid: e
};
t && t.tag && (s.id = t.tag);
var d = r.queryNode(s, []);
i.sendEphemeral({
data: r.BinaryProtocol.write(d),
onSend: r.binWrap(a, n),
onDrop: r.wrap(o),
binaryOpts: {
debugString: "query,thumb," + e,
debugObj: d,
metric: r.M.QUERY_PREVIEW,
ackRequest: !1
}
})
})
},
groupMetadataFindFromPhone: function(e, t) {
var r = this;
return new Promise(function(t, n) {
var o = function(n) {
var o = r.BinaryProtocol.read(n);
if ("response" !== r.N.tag(o) || "group" !== r.N.attr("type", o)) return void t({
status: "error",
info: "bad format: response incorrect"
});
var i = r.N.children(o),
a = i && i[0];
if (!a) return void t({
status: "error",
info: "bad format: no group node"
});
if ("missing" === r.N.attr("type")) return void t({
status: "missing"
});
var s = _.map(r.N.children(a), function(e) {
return {
id: r.N.attr("jid", e),
isAdmin: "admin" === r.N.attr("type", e)
}
});
t({
status: "ok",
data: {
id: e,
owner: r.N.attr("creator", a),
creation: parseInt(r.N.attr("create", a), 10) || void 0,
participants: s,
stale: !1
}
})
},
a = r.queryNode({
type: "group",
jid: e
}, []);
i.sendEphemeral({
data: r.BinaryProtocol.write(a),
onSend: r.binWrap(o, t),
onDrop: r.wrap(n),
binaryOpts: {
debugString: "query,group," + e,
debugObj: a,
metric: r.M.QUERY_GROUP,
ackRequest: !1
}
})
})
},
sendPresenceUpdate: function(e) {
var t = this;
return ["available", "unavailable"].indexOf(e) > -1 ? new Promise(function(r, n) {
var o = "available" === e,
a = t.actionNode("set", [
["presence", {
type: e
}, void 0]
], !o),
s = {
data: t.BinaryProtocol.write(a),
onSend: o ? t.wrap(r) : r,
onDrop: o ? t.wrap(n) : r,
binaryOpts: {
debugString: "action,presence," + e,
debugObj: a,
metric: t.M.PRESENCE,
available: "available" === e,
ackRequest: o
}
};
o ? i.sendEphemeral(s) : i.sendEphemeralIgnore(s)
}) : void 0
},
sendChatstateUpdate: function(e, t) {
var r = this;
return ["composing", "paused", "recording"].indexOf(e) > -1 ? new Promise(function(n, o) {
var a = n,
s = r.actionNode("set", [
["presence", {
type: e,
to: t
}, void 0]
], !0);
i.sendEphemeralIgnore({
data: r.BinaryProtocol.write(s),
onSend: a,
onDrop: o,
binaryOpts: {
debugString: "action,chatstate," + e,
debugObj: s,
metric: r.M.PRESENCE,
skipOffline: !0,
ackRequest: !1
}
}, !0)
}) : void 0
},
sendSetPicture: function(e, t, r) {
var n = this;
return new Promise(function(o, s) {
var d = c.parseDataURL(t).data,
u = c.parseDataURL(r).data,
l = a.fromBase64(d, !1),
f = a.fromBase64(u, !1),
h = i.tag(),
p = n.wrap(o);
p.tag = h;
var m = ["picture", {
id: h,
jid: e,
type: "set"
},
[
["image", void 0, f],
["preview", void 0, l]
]
],
g = n.actionNode("set", [m]);
i.send({
data: n.BinaryProtocol.write(g),
clientCacheable: !0,
onSend: p,
onDrop: n.wrap(s),
binaryOpts: {
debugString: "action,set_pic," + e,
debugObj: g,
metric: n.M.PIC,
ackRequest: !1,
expires: moment().unix()
}
})
})
},
deletePicture: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = i.tag(),
a = t.wrap(r);
a.tag = o;
var s = ["picture", {
id: o,
jid: e,
type: "delete"
}, void 0],
d = t.actionNode("set", [s]);
i.send({
data: t.BinaryProtocol.write(d),
clientCacheable: !0,
onSend: a,
onDrop: t.wrap(n),
binaryOpts: {
debugString: "action,delete_pic," + e,
debugObj: d,
metric: t.M.PIC,
ackRequest: !1,
expires: moment().unix()
}
})
})
},
sendSetStatus: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = t.wrap(r),
a = t.actionNode("set", [
["status", void 0, e]
]);
i.send({
data: t.BinaryProtocol.write(a),
clientCacheable: !0,
onSend: o,
onDrop: t.wrap(n),
binaryOpts: {
debugString: "action,status,set",
debugObj: a,
metric: t.M.STATUS,
ackRequest: !1,
expires: moment().unix()
}
})
})
},
sendSetBlock: function(e, t) {
var r = this;
return new Promise(function(n, o) {
var a = t.map(function(t) {
return ["user", {
jid: t.jid,
reason: e && t.spam ? "spam" : void 0
}, void 0]
}),
s = ["block", {
type: e ? "add" : "remove"
}, a],
d = r.actionNode("set", [s]);
i.send({
data: r.BinaryProtocol.write(d),
clientCacheable: !0,
onSend: r.wrap(n),
onDrop: r.wrap(o),
binaryOpts: {
debugString: "action,block," + e + "," + _.pluck(t, "jid").join(","),
debugObj: d,
metric: r.M.BLOCK,
ackRequest: !1,
expires: moment().unix()
}
})
})
},
chatFindQuery: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = function(e) {
var n = [],
o = t.BinaryProtocol.read(e),
i = t.N.children(o);
if ("response" === t.N.tag(o) && "chat" === t.N.attr("type", o))
if ("true" === t.N.attr("duplicate", o)) n = "preempted";
else if (_.isArray(i)) {
var a, s = i.length;
for (a = 0; s > a; a++) {
var d = t.parseChat(i[a]);
d && n.push(d)
}
}
r(n)
},
a = t.queryNode({
type: "chat",
kind: e ? "retry" : void 0
}, void 0);
i.sendEphemeral({
data: t.BinaryProtocol.write(a),
onSend: t.binWrap(o, r),
onDrop: t.wrap(n),
binaryOpts: {
debugString: "query,chat," + e,
debugObj: a,
metric: t.M.QUERY_CHAT,
ackRequest: !1
}
})
})
},
contactFindQuery: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = function(e) {
var n = [],
o = t.BinaryProtocol.read(e),
i = t.N.children(o);
if ("response" === t.N.tag(o) && "contacts" === t.N.attr("type", o))
if ("true" === t.N.attr("duplicate", o)) n = "preempted";
else if (_.isArray(i)) {
var a, s = i.length;
for (a = 0; s > a; a++) {
var d = t.parseContact(i[a]);
d && n.push(d)
}
}
r({
checksum: t.N.attr("checksum", o),
data: n
})
},
a = t.queryNode({
type: "contacts",
kind: e ? "retry" : void 0
}, void 0);
i.send({
data: t.BinaryProtocol.write(a),
onSend: t.binWrap(o, r),
onDrop: t.wrap(n),
binaryOpts: {
debugString: "query,contacts, " + e,
debugObj: a,
metric: t.M.QUERY_CONTACTS,
ackRequest: !1
}
})
})
},
msgCreateRecord: function(e, t) {
var r = this;
return new Promise(function(o, s) {
var d, c, u = e.id;
if ("chat" === e.type) c = Promise.resolve(["message", {
type: "text",
to: e.to,
id: e.id,
t: e.t.toString()
},
[
["body", void 0, e.body]
]
]);
else if ("location" === e.type) d = e.body ? a.fromBase64(e.body, !1) : void 0, c = Promise.resolve(["message", {
type: "media",
to: e.to,
id: e.id,
t: e.t.toString()
},
[
["media", {
type: "location",
latitude: e.lat || void 0,
longitude: e.lng || void 0,
name: e.loc && e.url ? e.loc : void 0,
url: e.loc && e.url ? e.url : void 0,
encoding: e.body ? "raw" : void 0
}, d]
]
]);
else if ("vcard" === e.type) {
var f = ["vcard", {
name: e.subtype
}, e.body];
c = Promise.resolve(["message", {
type: "media",
to: e.to,
id: e.id,
t: e.t.toString()
},
[
["media", {
type: "vcard"
},
[f]
]
]
])
} else {
var h = e.mediaKey;
d = e.body ? a.fromBase64(e.body, !1) : void 0, c = (t && !h ? r.sendMedia(e.avparams) : Promise.resolve(_.merge({
status: 200
}, e.avparams))).then(function(t) {
return 200 === t.status ? Promise.resolve(["message", {
type: "media",
to: e.to,
id: e.id,
t: e.t.toString()
},
[
["media", {
encoding: e.body ? "raw" : void 0,
origin: "ptt" === e.type ? "live" : void 0,
seconds: "ptt" === e.type && e.duration ? e.duration.toString() : void 0,
type: t.type,
mimetype: e.mimetype || t.mimetype || void 0,
size: e.size ? e.size.toString() : void 0,
filehash: t.filehash,
url: t.url,
duration: t.duration ? t.duration.toString() : void 0,
vcodec: t.vcodec || void 0,
width: t.width ? t.width.toString() : void 0,
height: t.height ? t.height.toString() : void 0,
fps: t.fps ? t.fps.toString() : void 0,
vbitrate: t.vbitrate ? t.vbitrate.toString() : void 0,
acodec: t.acodec || void 0,
asampfreq: t.asampfreq ? t.asampfreq.toString() : void 0,
asampfmt: t.asampfmt || void 0,
abitrate: t.abitrate ? t.abitrate.toString() : void 0,
caption: "video" !== e.type && "image" !== e.type || !e.caption ? void 0 : e.caption,
page_count: "number" != typeof e.pageCount || isNaN(e.pageCount) ? void 0 : e.pageCount.toString(),
media_key: h,
filename: t.filename
}, d]
]
]) : (n.error("wap:msgCreateRecord:sendMedia error " + t.status)(), Promise.reject())
})["catch"](function() {
return n.error("wap:msgCreateRecord:sendMedia dropped")(), Promise.reject()
})
}
c.then(function(t) {
var n = r.actionNode("relay", [t]),
a = r.wrap(o);
a.tag = u, a.meta = {
type: "message",
key: new l(e.from, e.to, e.id)
}, i.send({
data: r.BinaryProtocol.write(n),
onSend: a,
onDrop: r.wrap(s),
binaryOpts: {
debugString: "action,message, " + e.type,
debugObj: n,
metric: r.M.MESSAGE,
ackRequest: !1
}
})
})["catch"](function() {
n.error("wap:msgCreateRecord mPromise error")(), s()
})
})
},
msgFindQuery: function(e, t) {
var r = this;
return "before" !== e ? Promise.reject("wap:msgFindQuery:unsupported:" + e) : new Promise(function(e, n) {
var o = function(t) {
var n = [],
o = r.BinaryProtocol.read(t),
i = r.N.children(o);
if ("response" === r.N.tag(o) && "message" === r.N.attr("type", o) && _.isArray(i)) {
var a, s = i.length;
for (a = 0; s > a; a++) {
var d = r.parseMsg(i[a], "response");
d && n.push(d)
}
}
e(n)
},
a = r.queryNode({
type: "message",
jid: t.remote,
count: t.count.toString(),
index: t.id,
owner: "undefined" == typeof t.fromMe ? void 0 : t.fromMe.toString()
}, void 0);
i.sendEphemeral({
data: r.BinaryProtocol.write(a),
onSend: r.binWrap(o, e),
onDrop: r.wrap(n),
binaryOpts: {
debugString: "query,message," + t.remote + "_" + t.id + "_" + t.fromMe + "_" + t.count,
debugObj: a,
metric: r.M.QUERY_MESSAGES,
ackRequest: !1
}
})
})
},
presenceSubscribe: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = t.wrap(r),
a = t.actionNode("set", [
["presence", {
type: "subscribe",
to: e
}, void 0]
]);
i.sendEphemeral({
data: t.BinaryProtocol.write(a),
onSend: o,
onDrop: t.wrap(n),
binaryOpts: {
debugString: "action,presence,subscribe," + e,
debugObj: a,
metric: t.M.PRESENCE_SUBSCRIBE,
ackRequest: !0
}
})
})
}
};
e.exports = _.defaults(h, f)
}, function(e, t, r) {
"use strict";
var n = r(1),
o = r(10),
i = r(34),
a = r(19),
s = r(55),
d = r(156),
c = {
BinaryProtocol: null,
N: null,
M: {
DEBUG_LOG: 1,
QUERY_RESUME: 2,
QUERY_RECEIPT: 3,
QUERY_MEDIA: 4,
QUERY_CHAT: 5,
QUERY_CONTACTS: 6,
QUERY_MESSAGES: 7,
PRESENCE: 8,
PRESENCE_SUBSCRIBE: 9,
GROUP: 10,
READ: 11,
CHAT: 12,
RECEIVED: 13,
PIC: 14,
STATUS: 15,
MESSAGE: 16,
QUERY_ACTIONS: 17,
BLOCK: 18,
QUERY_GROUP: 19,
QUERY_PREVIEW: 20,
QUERY_EMOJI: 21,
QUERY_MESSAGE_INFO: 22
},
epochCount: 0,
epoch: 0,
isRequestingDeviceUploadLogsMutex: 0,
parseChat: function(e) {
if ("chat" === this.N.tag(e)) {
var t = this.N.attr("jid", e),
r = parseInt(this.N.attr("t", e), 10) || void 0,
n = this.N.attr("type", e),
o = parseInt(this.N.attr("mute", e), 10) || void 0,
i = parseInt(this.N.attr("before", e), 10) || void 0,
a = "true" === this.N.attr("archive", e),
s = "true" === this.N.attr("read_only", e),
d = parseInt(this.N.attr("modify_tag", e), 10) || void 0,
c = this.N.attr("name", e) || void 0,
u = this.safeParseInt(e, "count"),
l = "true" === this.N.attr("message", e);
"ahead" === n && (n = "clear");
var f, h = this.N.children(e);
if (_.isArray(h)) {
f = [];
var p, m, g = h.length;
for (p = 0; g > p; p++)
if (m = h[p], "item" === this.N.tag(m)) {
var v = this.N.attr("index", m);
v && f.push([v, "true" === this.N.attr("owner", m), this.N.attr("participant", m)])
}
}
var y = {
id: t,
t: r,
type: n,
keys: f,
before: i,
archive: a,
isReadOnly: s,
unreadCount: u,
muteExpiration: o,
modifyTag: d,
name: c,
pendingMsgs: l
},
b = [n && "delete" !== n && "clear" !== n && "archive" !== n && "unarchive" !== n && "mute" !== n && "modify_tag" !== n, !n && !t, a && n && "clear" !== n, "clear" !== n && i && i > 0, "clear" !== n && f && f.length > 0];
return this.dropIfConditionMet(b, y)
}
},
parseCmd: function(e) {
if ("read" === this.N.tag(e)) {
var t = this.N.attr("jid", e),
r = "false" === this.N.attr("type", e),
n = {
type: r ? "unread" : "read",
jid: t
},
o = [!t];
return this.dropIfConditionMet(o, n)
}
},
parseMsgMessage: function(e, t) {
if ("message" === this.N.tag(e)) {
var r;
this.N.attr("from", e) !== Store.Conn.me || this.N.attr("to", e) ? this.N.attr("to", e) !== Store.Conn.me || this.N.attr("from", e) || (r = "out") : r = "in";
var o, i = this.N.attr("id", e),
a = parseInt(this.N.attr("t", e), 10) || 0,
s = this.N.attr("to", e) || Store.Conn.me,
d = this.N.attr("from", e) || Store.Conn.me,
c = "broadcast" === d.split("@")[1],
u = this.N.attr("participant", e),
l = c ? u : d,
f = c ? void 0 : u,
h = c ? !1 : this.N.child("broadcast", e) && d === Store.Conn.me,
p = "invis" === this.N.attr("web", e),
m = this.N.attr("notify", e) || "",
g = parseInt(this.N.attr("status", e)) || 0,
v = [],
y = this.N.child("broadcast", e);
if ("broadcast" !== s) {
switch (t) {
case "fresh":
o = 1;
break;
default:
o = g >= -1 && 4 >= g ? g : 1
}
if (_.isArray(y)) {
var b, w = y.length;
for (b = 0; w > b; b++) {
var E = y[b],
S = this.N.attr("jid", E);
"to" === this.N.tag(E) && S && v.push(S)
}
}
var N, T = [],
$ = this.N.attr("type", e);
switch ($) {
case "ciphertext":
case "text":
var C = this.N.dataStr(this.N.child("body", e)) || "";
N = {
id: i,
body: "text" === $ ? C : void 0,
type: "text" === $ ? "chat" : "ciphertext",
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
participant: u,
invis: p,
ack: o,
broadcast: h,
recipients: v
}, T = [!i, !a, !l, !s];
break;
case "media":
var A, I, O, k, P, R, M = this.N.child("media", e),
L = this.N.attr("type", M),
D = this.N.attr("media_key", M),
U = this.N.attr("mimetype", M);
if ("retry" === this.N.attr("reason", M)) return;
switch (L) {
case "image":
case "video":
case "document":
var B = parseInt(this.N.attr("page_count", M), 10) || 0,
x = this.N.attr("filename", M);
R = this.N.attr("caption", M), A = this.thumbFromMediaXml(M), I = this.N.attr("url", M), I = _.isString(I) && I.indexOf("/u/") > 0 ? void 0 : I, O = this.N.attr("filehash", M), k = parseInt(this.N.attr("size", M), 10) || 0, P = this.N.attr("seconds", M), N = {
id: i,
body: A,
type: L,
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
participant: u,
invis: p,
ack: o,
clientUrl: I,
duration: P,
broadcast: h,
recipients: v,
filehash: O,
size: k,
caption: R,
mediaKey: D,
pageCount: B,
mimetype: U,
filename: x
}, T = [!i, !a, !l, !s];
break;
case "location":
var j = this.N.attr("latitude", M),
W = this.N.attr("longitude", M),
Y = this.N.attr("name", M);
A = this.thumbFromMediaXml(M), I = this.N.attr("url", M), N = {
id: i,
body: A,
type: L,
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
participant: u,
invis: p,
ack: o,
clientUrl: I,
loc: Y,
lat: j,
lng: W,
broadcast: h,
recipients: v
}, T = [!i, !a, !l, !s, !j || !W];
break;
case "audio":
var F = "live" === this.N.attr("origin", M) ? "ptt" : L;
I = this.N.attr("url", M), I = _.isString(I) && I.indexOf("/u/") > 0 ? void 0 : I, O = this.N.attr("filehash", M), k = parseInt(this.N.attr("size", M), 10) || 0, P = this.N.attr("seconds", M), N = {
id: i,
type: F,
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
participant: u,
invis: p,
ack: o,
clientUrl: I,
duration: P,
broadcast: h,
recipients: v,
filehash: O,
size: k,
mediaKey: D,
mimetype: U
}, T = [!i, !a, !l, !s];
break;
case "vcard":
var G = this.N.child("vcard", M),
q = this.N.dataStr(G),
K = this.N.attr("name", G);
N = {
id: i,
body: q,
type: L,
subtype: K,
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
participant: u,
invis: p,
ack: o,
broadcast: h,
recipients: v
}, T = [!i, !a, !l, !s, !q, !K];
break;
default:
n.error("wap:parseMsgMessage unknown media type: " + this.N.toString(e), e)()
}
break;
default:
n.error("wap:parseMsgMessage unknown message type: " + this.N.toString(e), e)()
}
return this.dropIfConditionMet(T, N)
}
}
},
parseMsgGp2: function(e) {
if ("groups_v2" === this.N.tag(e)) {
var t, r = parseInt(this.N.attr("t", e), 10) || 0,
n = this.N.attr("id", e),
o = this.N.attr("jid", e),
i = "invis" === this.N.attr("web", e),
a = "true" === this.N.attr("owner", e),
s = this.N.attr("type", e),
d = this.N.attr("author", e),
c = this.N.children(e),
u = this.N.attr("participant", e),
l = [];
switch (s) {
case "create":
t = this.N.attr("subject", e);
break;
case "subject":
t = this.N.attr("subject", e);
break;
case "picture":
t = this.N.attr("picture", e)
}
if (_.isArray(c)) {
var f, h = c.length;
for (f = 0; h > f; f++) {
var p = c[f],
m = this.N.attr("jid", p);
"participant" === this.N.tag(p) && m && l.push(m)
}
}
var g = {
t: r,
id: n,
to: a ? o : Store.Conn.me,
from: a ? Store.Conn.me : o,
author: d,
participant: u,
body: t ? t.toString() : void 0,
type: "gp2",
subtype: s,
invis: i,
recipients: l
},
v = [!n, !r, "subject" !== s && "add" !== s && "remove" !== s && "leave" !== s && "picture" !== s && "modify" !== s && "create" !== s && "delete" !== s && "promote" !== s && "demote" !== s, "subject" === s && !t, ("add" === s || "remove" === s || "leave" === s || "promote" === s || "demote" === s || "modify" === s) && 0 === l.length, !o, "string" == typeof o && "g.us" !== o.split("@")[1]];
return this.dropIfConditionMet(v, g)
}
},
parseMsgBroadcast: function(e) {
if ("broadcast" === this.N.tag(e)) {
var t, r, n = this.N.attr("type", e),
o = this.N.attr("id", e),
i = parseInt(this.N.attr("t", e), 10) || 0,
a = this.N.attr("jid", e),
s = "true" === this.N.attr("owner", e),
d = this.N.attr("participant", e);
switch (n) {
case "create":
t = parseInt(this.N.attr("count", e), 10) || 0;
break;
case "add":
case "remove":
r = this.N.child("participant", e), r && (t = this.N.attr("jid", r))
}
var c = {
id: o,
t: i,
participant: d,
type: "broadcast_notification",
subtype: n,
from: s ? Store.Conn.me : a,
to: s ? a : Store.Conn.me,
body: t ? t.toString() : void 0
},
u = [!o, !i, !a, "string" == typeof a && "broadcast" !== a.split("@")[1], "create" !== n && "add" !== n && "remove" !== n, ("add" === n || "remove" === n) && 2 !== t.split("@").length];
return this.dropIfConditionMet(u, c)
}
},
parseMsgNotification: function(e) {
if ("notification" === this.N.tag(e)) {
var t = this.N.attr("id", e),
r = parseInt(this.N.attr("t", e), 10) || 0,
n = this.N.attr("jid", e),
o = this.N.attr("participant", e),
i = "invis" === this.N.attr("web", e),
a = this.N.dataStr(e),
s = "true" === this.N.attr("owner", e) ? Store.Conn.me : n,
d = "true" === this.N.attr("owner", e) ? n : Store.Conn.me,
c = {
id: t,
type: "notification",
t: r,
invis: i,
from: s,
to: d,
participant: o,
body: a
},
u = [!t, !r, !n, 2 !== n.split("@").length];
return this.dropIfConditionMet(u, c)
}
},
sendConversationOpWithKey: function(e, t, r) {
var n = this;
return new Promise(function(i, a) {
var s = n.actionNode("set", [
["chat", {
type: e,
jid: t,
index: r ? r.id : void 0,
owner: r ? r.fromMe.toString() : void 0,
participant: r ? r.participant : void 0
}, void 0]
]);
o.send({
data: n.BinaryProtocol.write(s),
clientCacheable: !0,
onSend: n.wrap(i),
onDrop: n.wrap(a),
binaryOpts: {
debugString: "action,chat," + [e, (r || "no_msg_key").toString()].join(),
debugObj: s,
metric: n.M.CHAT,
ackRequest: !0
}
})
})
},
setSubProtocol: function(e) {
5 === e ? (this.BinaryProtocol = new s("05"), this.N = this.BinaryProtocol.Node) : 6 === e ? (this.BinaryProtocol = new s("06"), this.N = this.BinaryProtocol.Node) : (n.error("Wap:setSubProtocol unknown " + e)(), this.BinaryProtocol = new s("05"), this.N = this.BinaryProtocol.Node)
},
resyncMessages: function(e) {
var t = this;
return new i(function(r, i) {
var s = function(e) {
var o = [],
i = t.BinaryProtocol.read(e),
a = t.N.children(i);
if (n.logColor("green", "bin-recv: response,resume", i)(), "response" === t.N.tag(i) && "resume" === t.N.attr("type", i) && _.isArray(a)) {
var s, d = a.length;
for (s = 0; d > s; s++) {
var c = t.parseChat(a[s]);
c && o.push(c)
}
}
r({
checksum: t.N.attr("checksum", i),
data: o
})
},
d = e.map(function(e) {
var t = {
jid: e.wid,
index: e.id,
owner: e.fromMe,
participant: e.participant,
archive: (!!e.archive).toString()
};
return e.mute && (t.mute = e.mute.toString()), e.active && (t.active = "true"), a.isGroup(e.wid) && (t.read_only = (!!e.isReadOnly).toString()), e.modifyTag && (t.modify_tag = e.modifyTag.toString()), e.unreadCount && (t.count = e.unreadCount.toString()), ["last", t, void 0]
}),
c = t.queryNode({
type: "resume"
}, d);
o.sendEphemeral({
data: t.BinaryProtocol.write(c),
onSend: t.binWrap(s, r),
onDrop: t.wrap(i),
binaryOpts: {
debugString: "query,resume",
debugObj: c,
metric: t.M.QUERY_RESUME,
ackRequest: !1
}
})
})
},
resyncReceipts: function(e) {
var t = this;
return new Promise(function(r, i) {
var a = function(e) {
var o = [],
i = t.BinaryProtocol.read(e),
a = t.N.children(i);
if (n.logColor("green", "bin-recv: response,receipt", i)(), "response" === t.N.tag(i) && "receipt" === t.N.attr("type", i) && _.isArray(a)) {
var s, d, c, u = a.length;
for (s = 0; u > s; s++) {
d = a[s], c = t.N.children(d);
var l = t.N.attr("jid", d),
f = t.N.attr("t", d);
if ("receipt" === t.N.tag(d) && l && f && _.isArray(c)) {
var h, p = [],
m = c.length;
for (h = 0; m > h; h++) {
var g = c[h];
if ("item" === t.N.tag(g)) {
var v = t.N.attr("index", g),
y = "true" === t.N.attr("owner", g),
b = parseInt(t.N.attr("status", g), 10) || 0,
w = t.N.attr("participant", g);
v && 0 !== b && 4 >= b && p.push([v, y, w, b])
}
}
p.length > 0 && o.push({
id: l,
t: parseInt(f, 10),
acks: p
})
}
}
}
r(o)
},
s = e.map(function(e) {
return ["last", {
jid: e.remote,
index: e.id,
owner: e.fromMe.toString(),
participant: e.participant,
t: e.t.toString()
}, void 0]
}),
d = t.queryNode({
type: "receipt"
}, s);
o.sendEphemeral({
data: t.BinaryProtocol.write(d),
onSend: t.binWrap(a, r),
onDrop: t.wrap(i),
binaryOpts: {
debugString: "query,receipt",
debugObj: d,
metric: t.M.QUERY_RECEIPT,
ackRequest: !1
}
})
})
},
recentEmojiQuery: function(e) {
var t = this;
return new Promise(function(r, i) {
var a = function(e) {
var o = [],
i = t.BinaryProtocol.read(e),
a = t.N.children(i);
if (n.logColor("green", "bin-recv: response,emoji", i)(), "response" === t.N.tag(i) && "emoji" === t.N.attr("type", i) && _.isArray(a)) {
var s, d = a.length;
for (s = 0; d > s; s++) {
var c = a[s],
u = t.N.attr("code", c),
l = parseFloat(t.N.attr("value", c)) || 0;
"item" === t.N.tag(c) && u && l && !isNaN(l) && o.push({
"char": u,
weight: l
})
}
}
r(o)
},
s = _.isArray(e) ? e.map(function(e) {
return ["item", {
code: e["char"],
value: e.weight.toString()
}, void 0]
}) : void 0,
d = t.queryNode({
type: "emoji"
}, s);
o.sendEphemeral({
data: t.BinaryProtocol.write(d),
onSend: t.binWrap(a, r),
onDrop: t.wrap(i),
binaryOpts: {
debugString: "query,emoji",
debugObj: d,
metric: t.M.QUERY_EMOJI,
ackRequest: !1
}
})
})
},
queryMsgInfo: function(e) {
var t = this,
r = function(e) {
var r, n, o = [];
if (_.isArray(e)) {
r = e.length;
for (var i = 0; r > i; i++) n = e[i], "item" === t.N.tag(n) && t.N.attr("jid", n) && t.N.attr("t", n) && o.push({
id: t.N.attr("jid", n),
t: parseInt(t.N.attr("t", n), 10) || 0
})
}
return o
};
return new Promise(function(i, a) {
var s = function(e) {
var o = t.BinaryProtocol.read(e),
a = {
played: [],
playedRemaining: 0,
read: [],
readRemaining: 0,
delivery: [],
deliveryRemaining: 0
};
if (n.logColor("green", "bin-recv: response,msg,info", o)(), "response" === t.N.tag(o) && "message_info" === t.N.attr("type", o)) {
var s = t.N.child("played", o),
d = t.N.child("read", o),
c = t.N.child("delivery", o),
u = t.N.children(s),
l = t.N.children(d),
f = t.N.children(c),
h = parseInt(t.N.attr("count", o), 10) || 0;
a.played = r(u), a.read = r(l), a.delivery = r(f);
var p = h - a.played.length,
m = h - a.played.length - a.read.length,
g = h - a.played.length - a.read.length - a.delivery.length;
a.playedRemaining = 0 > p ? 0 : p, a.readRemaining = 0 > m ? 0 : m, a.deliveryRemaining = 0 > g ? 0 : g
}
i(a)
},
d = t.queryNode({
type: "message_info",
index: e.id,
jid: e.remote
}, void 0);
o.sendEphemeral({
data: t.BinaryProtocol.write(d),
onSend: t.binWrap(s, i),
onDrop: t.wrap(a),
binaryOpts: {
debugString: ["query,msg,info", e.id, e.remote, e.fromMe].join(),
debugObj: d,
metric: t.M.QUERY_MESSAGE_INFO,
ackRequest: !1
}
})
})
},
requestMediaReupload: function(e) {
var t = this;
return new Promise(function(r, i) {
var a = e.id,
s = function(e) {
var o, i = t.BinaryProtocol.read(e);
if ("response" === t.N.tag(i) && "media" === t.N.attr("type", i)) {
var a = parseInt(t.N.attr("code", i)) || 400,
s = t.N.attr("url", i);
a >= 500 && 502 !== a ? (n.error("wap:requestMediaReupload:error " + a)(), o = {
status: a
}) : 200 === a && s ? o = {
status: 200,
url: s,
mediaKey: t.N.attr("media_key", i)
} : 200 !== a || s ? (n.error("wap:requestMediaReupload:error " + a)(), o = {
status: a
}) : o = {
status: 400
}
} else n.error("wap:requestMediaReupload:malformed")(), o = {
status: 400
};
r(o)
},
d = a,
c = t.queryNode({
type: "media",
index: d.id,
jid: d.remote,
owner: d.fromMe.toString(),
participant: d.participant
}, void 0);
o.sendEphemeral({
data: t.BinaryProtocol.write(c),
onSend: t.binWrap(s, r),
onDrop: t.wrap(i),
binaryOpts: {
debugString: "query,media",
debugObj: c,
metric: t.M.QUERY_MEDIA,
ackRequest: !1
}
})
})
},
sendConversationSeen: function(e, t, r) {
var n = this;
return new Promise(function(i, a) {
var s = n.actionNode("set", [
["read", {
jid: e,
index: t ? t.id : void 0,
owner: t ? t.fromMe.toString() : void 0,
participant: t ? t.participant : void 0,
count: r && t ? r.toString() : void 0
}, void 0]
]);
o.send({
data: n.BinaryProtocol.write(s),
clientCacheable: !0,
onSend: n.wrap(i),
onDrop: n.wrap(a),
binaryOpts: {
debugString: "action,chat,read," + JSON.stringify(t) + "," + r,
debugObj: s,
metric: n.M.READ,
ackRequest: !0
}
})
})
},
sendConversationUnseen: function(e, t) {
return this.sendConversationSeen(e, t, -2)
},
sendConversationClear: function(e, t) {
return this.sendConversationOpWithKey("clear", e, t)
},
sendConversationDelete: function(e, t) {
return this.sendConversationOpWithKey("delete", e, t)
},
sendConversationArchive: function(e, t, r) {
return this.sendConversationOpWithKey(t ? "archive" : "unarchive", e, r)
},
sendMessagePlayed: function(e) {
var t = this;
return new Promise(function(r, n) {
var i = t.wrap(r),
a = t.actionNode("set", [
["received", {
type: "played",
index: e.id,
from: e.remote,
participant: e.participant
}, void 0]
]);
o.send({
data: t.BinaryProtocol.write(a),
onSend: i,
onDrop: t.wrap(n),
binaryOpts: {
debugString: "action,played," + e.toString(),
debugObj: a,
metric: t.M.RECEIVED,
ackRequest: !0
}
})
})
},
sendMessageDelete: function(e, t, r) {
var n = this;
return new Promise(function(i, a) {
var s = t.map(function(e) {
return ["item", {
index: e.id,
owner: e.fromMe.toString(),
participant: e.participant
}, void 0]
}),
d = n.actionNode("set", [
["chat", {
type: "clear",
jid: e,
media: r.toString()
}, s]
]);
o.send({
data: n.BinaryProtocol.write(d),
clientCacheable: !0,
onSend: n.wrap(i),
onDrop: n.wrap(a),
binaryOpts: {
debugString: "action,msgs,delete," + [e, r, t.length].join(),
debugObj: d,
metric: n.M.CHAT,
ackRequest: !0
}
})
})
},
msgFindQuery: function(e, t) {
var r = this;
return "before" !== e ? Promise.reject("wap:msgFindQuery:unsupported:" + e) : new Promise(function(e, n) {
var i = function(t) {
var n = [],
o = r.BinaryProtocol.read(t),
i = r.N.children(o);
if ("response" === r.N.tag(o) && "message" === r.N.attr("type", o) && _.isArray(i)) {
var a, s = i.length;
for (a = 0; s > a; a++) {
var d = r.parseMsg(i[a], "response");
d && n.push(d)
}
}
e(n)
},
a = r.queryNode({
type: "message",
jid: t.remote,
count: t.count.toString(),
index: t.id,
owner: "undefined" == typeof t.fromMe ? void 0 : t.fromMe.toString(),
participant: t.participant
}, void 0);
o.sendEphemeral({
data: r.BinaryProtocol.write(a),
onSend: r.binWrap(i, e),
onDrop: r.wrap(n),
binaryOpts: {
debugString: "query,message," + [t.toString(), t.count].join(),
debugObj: a,
metric: r.M.QUERY_MESSAGES,
ackRequest: !1
}
})
})
}
};
e.exports = _.defaults(c, d)
}, function(e, t, r) {
"use strict";
var n = r(1),
o = r(9),
i = r(10),
a = r(7),
s = r(55),
d = r(94),
c = r(14),
u = r(157),
l = {
BinaryProtocol: null,
N: null,
M: {
DEBUG_LOG: 1,
QUERY_RESUME: 2,
QUERY_RECEIPT: 3,
QUERY_MEDIA: 4,
QUERY_CHAT: 5,
QUERY_CONTACTS: 6,
QUERY_MESSAGES: 7,
PRESENCE: 8,
PRESENCE_SUBSCRIBE: 9,
GROUP: 10,
READ: 11,
CHAT: 12,
RECEIVED: 13,
PIC: 14,
STATUS: 15,
MESSAGE: 16,
QUERY_ACTIONS: 17,
BLOCK: 18,
QUERY_GROUP: 19,
QUERY_PREVIEW: 20,
QUERY_EMOJI: 21,
QUERY_MESSAGE_INFO: 22,
SPAM: 23
},
epochCount: 0,
epoch: 0,
isRequestingDeviceUploadLogsMutex: 0,
parseChat: function(e) {
if ("chat" === this.N.tag(e)) {
var t = this.N.attr("jid", e),
r = parseInt(this.N.attr("t", e), 10) || void 0,
n = this.N.attr("type", e),
o = parseInt(this.N.attr("mute", e), 10) || void 0,
i = parseInt(this.N.attr("before", e), 10) || void 0,
a = "true" === this.N.attr("archive", e),
s = "true" === this.N.attr("read_only", e),
d = parseInt(this.N.attr("modify_tag", e), 10) || void 0,
c = this.N.attr("name", e) || void 0,
u = this.safeParseInt(e, "count"),
l = "true" === this.N.attr("message", e),
f = "true" === this.N.attr("star", e);
"ahead" === n && (n = "clear");
var h, p = this.N.children(e);
if (_.isArray(p)) {
h = [];
var m, g, v = p.length;
for (m = 0; v > m; m++)
if (g = p[m], "item" === this.N.tag(g)) {
var y = this.N.attr("index", g);
y && h.push([y, "true" === this.N.attr("owner", g), this.N.attr("participant", g)])
}
}
var b = {
id: t,
t: r,
type: n,
keys: h,
before: i,
archive: a,
isReadOnly: s,
unreadCount: u,
muteExpiration: o,
modifyTag: d,
name: c,
pendingMsgs: l,
star: f
},
w = [n && "delete" !== n && "clear" !== n && "archive" !== n && "unarchive" !== n && "mute" !== n && "star" !== n && "unstar" !== n && "modify_tag" !== n, !n && !t, a && n && "clear" !== n, "clear" !== n && i && i > 0, "clear" !== n && "star" !== n && "unstar" !== n && h && h.length > 0];
return this.dropIfConditionMet(w, b)
}
},
parseMsgMessage: function(e, t) {
if ("message" === this.N.tag(e)) {
var r;
this.N.attr("from", e) !== Store.Conn.me || this.N.attr("to", e) ? this.N.attr("to", e) !== Store.Conn.me || this.N.attr("from", e) || (r = "out") : r = "in";
var o, i = this.N.attr("id", e),
a = parseInt(this.N.attr("t", e), 10) || 0,
s = this.N.attr("to", e) || Store.Conn.me,
d = this.N.attr("from", e) || Store.Conn.me,
c = "broadcast" === d.split("@")[1],
u = this.N.attr("participant", e),
l = c ? u : d,
f = c ? void 0 : u,
h = c ? !1 : this.N.child("broadcast", e) && d === Store.Conn.me,
p = "invis" === this.N.attr("web", e),
m = this.N.attr("notify", e) || "",
g = parseInt(this.N.attr("status", e)) || 0,
v = [],
y = this.N.child("broadcast", e),
b = "true" === this.N.attr("star", e);
if ("broadcast" !== s) {
switch (t) {
case "fresh":
o = 1;
break;
default:
o = g >= -1 && 4 >= g ? g : 1
}
if (_.isArray(y)) {
var w, E = y.length;
for (w = 0; E > w; w++) {
var S = y[w],
N = this.N.attr("jid", S);
"to" === this.N.tag(S) && N && v.push(N)
}
}
var T, $ = [],
C = this.N.attr("type", e);
switch (C) {
case "ciphertext":
case "text":
var A = this.N.dataStr(this.N.child("body", e)) || "";
T = {
id: i,
body: "text" === C ? A : void 0,
type: "text" === C ? "chat" : "ciphertext",
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
participant: u,
invis: p,
ack: o,
broadcast: h,
recipients: v,
star: b
};
var I = this.N.child("media", e);
I && "url" === this.N.attr("type", I) && _.merge(T, {
subtype: "url",
title: this.N.attr("title", I),
description: this.N.attr("description", I),
canonicalUrl: this.N.attr("canonical-url", I),
matchedText: this.N.attr("matched-text", I),
thumbnail: this.thumbFromMediaXml(I)
}), $ = [!i, !a, !l, !s];
break;
case "media":
var O, k, P, R, M, L, D = this.N.child("media", e),
U = this.N.attr("type", D),
B = this.N.attr("media_key", D),
x = this.N.attr("mimetype", D);
if ("retry" === this.N.attr("reason", D)) return;
switch (U) {
case "image":
case "video":
case "document":
var j = parseInt(this.N.attr("page_count", D), 10) || 0,
W = this.N.attr("filename", D);
L = this.N.attr("caption", D), O = this.thumbFromMediaXml(D), k = this.N.attr("url", D), k = _.isString(k) && k.indexOf("/u/") > 0 ? void 0 : k, P = this.N.attr("filehash", D), R = parseInt(this.N.attr("size", D), 10) || 0, M = this.N.attr("seconds", D), T = {
id: i,
body: O,
type: U,
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
participant: u,
invis: p,
ack: o,
clientUrl: k,
duration: M,
broadcast: h,
recipients: v,
filehash: P,
size: R,
caption: L,
mediaKey: B,
star: b,
pageCount: j,
mimetype: x,
filename: W
}, $ = [!i, !a, !l, !s];
break;
case "location":
var Y = this.N.attr("latitude", D),
F = this.N.attr("longitude", D),
G = this.N.attr("name", D);
O = this.thumbFromMediaXml(D), k = this.N.attr("url", D), T = {
id: i,
body: O,
type: U,
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
participant: u,
invis: p,
ack: o,
clientUrl: k,
loc: G,
lat: Y,
lng: F,
broadcast: h,
recipients: v,
star: b
}, $ = [!i, !a, !l, !s, !Y || !F];
break;
case "audio":
var q = "live" === this.N.attr("origin", D) ? "ptt" : U;
k = this.N.attr("url", D), k = _.isString(k) && k.indexOf("/u/") > 0 ? void 0 : k, P = this.N.attr("filehash", D), R = parseInt(this.N.attr("size", D), 10) || 0, M = this.N.attr("seconds", D), T = {
id: i,
type: q,
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
participant: u,
invis: p,
ack: o,
clientUrl: k,
duration: M,
broadcast: h,
recipients: v,
filehash: P,
size: R,
star: b,
mediaKey: B,
mimetype: x
}, $ = [!i, !a, !l, !s];
break;
case "vcard":
var K = this.N.child("vcard", D),
H = this.N.dataStr(K),
V = this.N.attr("name", K);
T = {
id: i,
body: H,
type: U,
subtype: V,
t: a,
notifyName: m,
from: l,
to: s,
self: r,
author: f,
participant: u,
invis: p,
ack: o,
broadcast: h,
recipients: v,
star: b
}, $ = [!i, !a, !l, !s, !H, !V];
break;
default:
n.error("wap:parseMsgMessage unknown media type: " + this.N.toString(e), e)()
}
break;
default:
n.error("wap:parseMsgMessage unknown message type: " + this.N.toString(e), e)()
}
return this.dropIfConditionMet($, T)
}
}
},
sendConversationOpWithKey: function(e, t, r, n) {
var o = this;
return new Promise(function(a, s) {
var d;
switch (e) {
case "clear":
d = (!!n).toString()
}
var c = o.actionNode("set", [
["chat", {
type: e,
jid: t,
index: r ? r.id : void 0,
owner: r ? r.fromMe.toString() : void 0,
participant: r ? r.participant : void 0,
star: "undefined" != typeof d ? d : void 0
}, void 0]
]);
i.send({
data: o.BinaryProtocol.write(c),
clientCacheable: !0,
onSend: o.wrap(a),
onDrop: o.wrap(s),
binaryOpts: {
debugString: "action,chat," + [e, r, n].join(),
debugObj: c,
metric: o.M.CHAT,
ackRequest: !0
}
})
})
},
setSubProtocol: function(e) {
e ? (this.BinaryProtocol = new s(e), this.N = this.BinaryProtocol.Node) : (n.error("Wap:setSubProtocol unknown " + e)(), o.upload("07_unknown_version", !0)["finally"](function() {
return c.hardRefresh()
}))
},
sendConversationClear: function(e, t, r) {
return this.sendConversationOpWithKey("clear", e, t, r)
},
sendMessageStarred: function(e, t, r) {
var n = this;
return new Promise(function(o, a) {
var s = t.map(function(e) {
return ["item", {
index: e.id,
owner: e.fromMe.toString(),
participant: e.participant
}, void 0]
}),
d = n.actionNode("set", [
["chat", {
type: r ? "star" : "unstar",
jid: e
}, s]
]);
i.send({
data: n.BinaryProtocol.write(d),
clientCacheable: !0,
onSend: n.wrap(o),
onDrop: n.wrap(a),
binaryOpts: {
debugString: "action,msgs,star," + [e, r, t.length].join(),
debugObj: d,
metrics: n.M.CHAT,
ackRequest: !0
}
})
})
},
sendUnstarAll: function() {
var e = this;
return new Promise(function(t, r) {
var n = e.actionNode("set", [
["chat", {
type: "unstar"
}, void 0]
]);
i.send({
data: e.BinaryProtocol.write(n),
clientCacheable: !0,
onSend: e.wrap(t),
onDrop: e.wrap(r),
binaryOpts: {
debugString: "action,unstar,all",
debugObj: n,
metrics: e.M.CHAT,
ackRequest: !0,
expires: moment().unix()
}
})
})
},
sendSetBlock: function(e, t) {
var r = this;
return new Promise(function(n, o) {
var a = t.map(function(e) {
return ["user", {
jid: e.jid
}, void 0]
}),
s = ["block", {
type: e ? "add" : "remove"
}, a],
d = r.actionNode("set", [s]);
i.send({
data: r.BinaryProtocol.write(d),
clientCacheable: !0,
onSend: r.wrap(n),
onDrop: r.wrap(o),
binaryOpts: {
debugString: "action,block," + e + "," + _.pluck(t, "jid").join(","),
debugObj: d,
metric: r.M.BLOCK,
ackRequest: !1,
expires: moment().unix()
}
})
})
},
sendSpamReport: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = t.actionNode("set", [
["spam", {
jid: e
}, void 0]
]);
i.send({
data: t.BinaryProtocol.write(o),
onSend: t.wrap(r),
onDrop: t.wrap(n),
binaryOpts: {
debugString: "action,spam," + e,
debugObj: o,
metric: t.M.SPAM,
ackRequest: !1,
expires: moment().unix()
}
})
})
},
chatFindQuery: function(e) {
var t = this;
return new Promise(function(r, n) {
var o = function(e) {
var n = [],
o = t.BinaryProtocol.read(e),
i = t.N.children(o);
if ("response" === t.N.tag(o) && "chat" === t.N.attr("type", o))
if ("true" === t.N.attr("duplicate", o)) n = "preempted";
else if (_.isArray(i)) {
var a, s = i.length;
for (a = 0; s > a; a++) {
var d = t.parseChat(i[a]);
d && n.push(d)
}
}
r(n)
},
a = {
type: "chat"
};
"boolean" == typeof e && e ? a.kind = "retry" : "string" == typeof e && (a.jid = e);
var s = t.queryNode(a, void 0);
i.sendEphemeral({
data: t.BinaryProtocol.write(s),
onSend: t.binWrap(o, r),
onDrop: t.wrap(n),
binaryOpts: {
debugString: ["query", "chat", e].join(),
debugObj: s,
metric: t.M.QUERY_CHAT,
ackRequest: !1
}
})
})
},
msgCreateRecord: function(e, t) {
var r = this;
return new Promise(function(o, s) {
var c, u, l = e.id;
if ("chat" === e.type) {
var f = [
["body", void 0, e.body]
];
"url" === e.subtype && f.push(["media", {
type: "url",
title: e.title,
description: e.description,
"canonical-url": e.canonicalUrl,
"matched-text": e.matchedText,
encoding: "raw"
}, e.thumbnail ? a.fromBase64(e.thumbnail, !1) : void 0]), u = Promise.resolve(["message", {
type: "text",
to: e.to,
id: e.id,
t: e.t.toString()
}, f])
} else if ("location" === e.type) c = e.body ? a.fromBase64(e.body, !1) : void 0, u = Promise.resolve(["message", {
type: "media",
to: e.to,
id: e.id,
t: e.t.toString()
},
[
["media", {
type: "location",
latitude: e.lat || void 0,
longitude: e.lng || void 0,
name: e.loc && e.url ? e.loc : void 0,
url: e.loc && e.url ? e.url : void 0,
encoding: e.body ? "raw" : void 0
}, c]
]
]);
else if ("vcard" === e.type) {
var h = ["vcard", {
name: e.subtype
}, e.body];
u = Promise.resolve(["message", {
type: "media",
to: e.to,
id: e.id,
t: e.t.toString()
},
[
["media", {
type: "vcard"
},
[h]
]
]
])
} else {
var p = e.mediaKey;
c = e.body ? a.fromBase64(e.body, !1) : void 0;
var m = "ptt" === e.type ? "audio" : e.type;
u = (t && !p ? r.sendMedia(e.avparams) : Promise.resolve(_.merge({
status: 200,
type: m
}, e.avparams))).then(function(t) {
return 200 === t.status ? Promise.resolve(["message", {
type: "media",
to: e.to,
id: e.id,
t: e.t.toString()
},
[
["media", {
encoding: e.body ? "raw" : void 0,
origin: "ptt" === e.type ? "live" : void 0,
seconds: "ptt" === e.type && e.duration ? e.duration.toString() : void 0,
type: t.type,
mimetype: e.mimetype || t.mimetype || void 0,
size: e.size ? e.size.toString() : void 0,
filehash: t.filehash,
url: t.url,
duration: t.duration ? t.duration.toString() : void 0,
vcodec: t.vcodec || void 0,
width: t.width ? t.width.toString() : void 0,
height: t.height ? t.height.toString() : void 0,
fps: t.fps ? t.fps.toString() : void 0,
vbitrate: t.vbitrate ? t.vbitrate.toString() : void 0,
acodec: t.acodec || void 0,
asampfreq: t.asampfreq ? t.asampfreq.toString() : void 0,
asampfmt: t.asampfmt || void 0,
abitrate: t.abitrate ? t.abitrate.toString() : void 0,
caption: "video" !== e.type && "image" !== e.type && "document" !== e.type || !e.caption ? void 0 : e.caption,
page_count: "number" != typeof e.pageCount || isNaN(e.pageCount) ? void 0 : e.pageCount.toString(),
media_key: p,
filename: t.filename
}, c]
]
]) : (n.error("wap:msgCreateRecord:sendMedia error " + t.status)(), Promise.reject())
})["catch"](function() {
return n.error("wap:msgCreateRecord:sendMedia dropped")(), Promise.reject()
})
}
u.then(function(t) {
var n = r.actionNode("relay", [t]),
a = r.wrap(o);
a.tag = l, a.meta = {
type: "message",
key: new d(e.from, e.to, e.id)
}, i.send({
data: r.BinaryProtocol.write(n),
onSend: a,
onDrop: r.wrap(s),
binaryOpts: {
debugString: ["action", "message", e.type, e.subtype].join(),
debugObj: n,
metric: r.M.MESSAGE,
ackRequest: !1
}
})
})["catch"](function() {
n.error("wap:msgCreateRecord mPromise error")(), s()
})
})
},
msgFindQuery: function(e, t) {
var r = this;
return "before" !== e ? Promise.reject("wap:msgFindQuery:unsupported:" + e) : new Promise(function(e, n) {
var o = function(t) {
var n = [],
o = r.BinaryProtocol.read(t),
i = r.N.children(o);
if ("response" === r.N.tag(o) && ("message" === r.N.attr("type", o) || "star" === r.N.attr("type", o) || "search" === r.N.attr("type", o)) && _.isArray(i)) {
var a, s = i.length;
for (a = 0; s > a; a++) {
var d = r.parseMsg(i[a], "response");
d && n.push(d)
}
}
e(n)
},
a = r.queryNode({
type: "message",
jid: t.remote,
count: t.count.toString(),
index: t.id,
owner: "undefined" == typeof t.fromMe ? void 0 : t.fromMe.toString(),
participant: t.participant
}, void 0);
i.sendEphemeral({
data: r.BinaryProtocol.write(a),
onSend: r.binWrap(o, e),
onDrop: r.wrap(n),
binaryOpts: {
debugString: "query,message," + [t.toString(), t.count].join(),
debugObj: a,
metric: r.M.QUERY_MESSAGES,
ackRequest: !1
}
})
})
}
};
e.exports = _.defaults(l, u)
}, function(e, t, r) {
"use strict";
var n = r(1),
o = r(9),
i = r(10),
a = r(34),
s = r(19),
d = r(55),
c = r(14),
u = r(158),
l = {
version: "08",
BinaryProtocol: null,
N: null,
M: {
DEBUG_LOG: 1,
QUERY_RESUME: 2,
QUERY_RECEIPT: 3,
QUERY_MEDIA: 4,
QUERY_CHAT: 5,
QUERY_CONTACTS: 6,
QUERY_MESSAGES: 7,
PRESENCE: 8,
PRESENCE_SUBSCRIBE: 9,
GROUP: 10,
READ: 11,
CHAT: 12,
RECEIVED: 13,
PIC: 14,
STATUS: 15,
MESSAGE: 16,
QUERY_ACTIONS: 17,
BLOCK: 18,
QUERY_GROUP: 19,
QUERY_PREVIEW: 20,
QUERY_EMOJI: 21,
QUERY_MESSAGE_INFO: 22,
SPAM: 23,
QUERY_SEARCH: 24
},
epochCount: 0,
epoch: 0,
isRequestingDeviceUploadLogsMutex: 0,
parseChat: function(e) {
if ("chat" === this.N.tag(e)) {
var t = this.N.attr("jid", e),
r = parseInt(this.N.attr("t", e), 10) || void 0,
n = this.N.attr("type", e),
o = parseInt(this.N.attr("mute", e), 10) || void 0,
i = parseInt(this.N.attr("before", e), 10) || void 0,
a = "true" === this.N.attr("archive", e),
s = "true" === this.N.attr("read_only", e),
d = parseInt(this.N.attr("modify_tag", e), 10) || void 0,
c = this.N.attr("name", e) || void 0,
u = this.safeParseInt(e, "count"),
l = "true" === this.N.attr("message", e),
f = "true" === this.N.attr("star", e),
h = "false" === this.N.attr("spam", e);
"ahead" === n && (n = "clear");
var p, m = this.N.children(e);
if (_.isArray(m)) {
p = [];
var g, v, y = m.length;
for (g = 0; y > g; g++)
if (v = m[g], "item" === this.N.tag(v)) {
var b = this.N.attr("index", v);
b && p.push([b, "true" === this.N.attr("owner", v), this.N.attr("participant", v)])
}
}
var w = {
id: t,
t: r,
type: n,
keys: p,
before: i,
archive: a,
isReadOnly: s,
unreadCount: u,
muteExpiration: o,
modifyTag: d,
name: c,
pendingMsgs: l,
star: f,
notSpam: h
},
E = [n && "delete" !== n && "clear" !== n && "archive" !== n && "unarchive" !== n && "mute" !== n && "star" !== n && "unstar" !== n && "spam" !== n && "modify_tag" !== n, !n && !t, a && n && "clear" !== n, "clear" !== n && i && i > 0, "clear" !== n && "star" !== n && "unstar" !== n && p && p.length > 0];
return this.dropIfConditionMet(E, w)
}
},
sendConversationOpWithKey: function(e, t, r, n) {
var o = this;
return new Promise(function(a, s) {
var d, c;
switch (e) {
case "clear":
d = (!!n).toString();
break;
case "spam":
c = (!!n).toString()
}
var u = o.actionNode("set", [
["chat", {
type: e,
jid: t,
index: r ? r.id : void 0,
owner: r ? r.fromMe.toString() : void 0,
participant: r ? r.participant : void 0,
star: "undefined" != typeof d ? d : void 0,
spam: "undefined" != typeof c ? c : void 0
}, void 0]
]);
i.send({
data: o.BinaryProtocol.write(u),
clientCacheable: !0,
onSend: o.wrap(a),
onDrop: o.wrap(s),
binaryOpts: {
debugString: "action,chat," + [e, r, n].join(),
debugObj: u,
metric: o.M.CHAT,
ackRequest: !0
}
})
})
},
setSubProtocol: function(e) {
e ? (this.BinaryProtocol = new d(e), this.N = this.BinaryProtocol.Node) : (n.error("Wap:setSubProtocol unknown " + e)(), o.upload(this.version + "_unknown_version", !0)["finally"](function() {
return c.hardRefresh()
}))
},
resyncMessages: function(e) {
var t = this;
return new a(function(r, o) {
var a = function(e) {
var o = [],
i = t.BinaryProtocol.read(e),
a = t.N.children(i);
if (n.logColor("green", "bin-recv: response,resume", i)(), "response" === t.N.tag(i) && "resume" === t.N.attr("type", i) && _.isArray(a)) {
var s, d = a.length;
for (s = 0; d > s; s++) {
var c = t.parseChat(a[s]);
c && o.push(c)
}
}
r({
checksum: t.N.attr("checksum", i),
data: o
})
},
d = e.map(function(e) {
var t = {
jid: e.wid,
index: e.id,
owner: e.fromMe,
participant: e.participant,
archive: (!!e.archive).toString(),
spam: (!e.notSpam).toString()
};
return e.mute && (t.mute = e.mute.toString()), e.active && (t.active = "true"), s.isGroup(e.wid) && (t.read_only = (!!e.isReadOnly).toString()), e.modifyTag && (t.modify_tag = e.modifyTag.toString()), e.unreadCount && (t.count = e.unreadCount.toString()), ["last", t, void 0]
}),
c = t.queryNode({
type: "resume"
}, d);
i.sendEphemeral({
data: t.BinaryProtocol.write(c),
onSend: t.binWrap(a, r),
onDrop: t.wrap(o),
binaryOpts: {
debugString: "query,resume",
debugObj: c,
metric: t.M.QUERY_RESUME,
ackRequest: !1
}
})
})
},
requestMediaReupload: function(e) {
var t = this;
return new Promise(function(r, o) {
var a = e.id,
s = function(e) {
var o, i = t.BinaryProtocol.read(e);
if (n.logColor("green", "bin-recv: response,media", i)(), "response" === t.N.tag(i) && "media" === t.N.attr("type", i)) {
var a = parseInt(t.N.attr("code", i)) || 400,
s = t.N.attr("url", i);
a >= 500 && 502 !== a ? (n.error("wap:requestMediaReupload:error " + a)(), o = {
status: a
}) : 200 === a && s ? o = {
status: 200,
url: s,
mediaKey: t.N.attr("media_key", i)
} : 200 !== a || s ? (n.error("wap:requestMediaReupload:error " + a)(), o = {
status: a
}) : o = {
status: 400
}
} else n.error("wap:requestMediaReupload:malformed")(), o = {
status: 400
};
r(o)
},
d = a,
c = t.queryNode({
type: "media",
index: d.id,
jid: d.remote,
owner: d.fromMe.toString(),
participant: d.participant
}, void 0);
i.sendEphemeral({
data: t.BinaryProtocol.write(c),
onSend: t.binWrap(s, r),
onDrop: t.wrap(o),
binaryOpts: {
debugString: "query,media",
debugObj: c,
metric: t.M.QUERY_MEDIA,
ackRequest: !1
}
})
})
},
sendConversationUnseen: function(e, t) {
return this.sendConversationSeen(e, t, -2)
},
sendConversationNotSpam: function(e) {
return this.sendConversationOpWithKey("spam", e, void 0, !1)
},
msgFindQuery: function(e, t) {
var r = this;
return new Promise(function(o, a) {
var s, d = function(e) {
var t = [],
i = r.BinaryProtocol.read(e),
a = r.N.children(i);
if (n.logColor("green", "bin-recv: response,msg", i)(), "response" === r.N.tag(i) && ("message" === r.N.attr("type", i) || "star" === r.N.attr("type", i) || "search" === r.N.attr("type", i)) && _.isArray(a)) {
var s, d = a.length;
for (s = 0; d > s; s++) {
var c = r.parseMsg(a[s], "response");
c && t.push(c)
}
}
o(t)
},
c = "";
switch (e) {
case "after":
t.id || (e = "before");
case "before":
s = {
type: "message",
kind: e,
jid: t.remote,
count: t.count.toString(),
index: t.id,
owner: "undefined" == typeof t.fromMe ? void 0 : t.fromMe.toString(),
participant: t.participant
}, c = [t.toString(), t.count].join();
break;
case "search":
s = {
type: "search",
search: t.searchTerm
}, c = "search," + t.searchTerm;
break;
case "star":
s = {
type: "star"
}, c = "starred"
}
var u = r.queryNode(s, void 0);
i.sendEphemeral({
data: r.BinaryProtocol.write(u),
onSend: r.binWrap(d, o),
onDrop: r.wrap(a),
binaryOpts: {
debugString: "query,message," + c,
debugObj: u,
metric: r.M.QUERY_SEARCH,
ackRequest: !1
}
})
})
}
};
e.exports = _.defaults(l, u)
}, function(e, t, r) {
var n = r(76),
o = r(23)("toStringTag"),
i = "Arguments" == n(function() {
return arguments
}());
e.exports = function(e) {
var t, r, a;
return void 0 === e ? "Undefined" : null === e ? "Null" : "string" == typeof(r = (t = Object(e))[o]) ? r : i ? n(t) : "Object" == (a = n(t)) && "function" == typeof t.callee ? "Arguments" : a
}
}, function(e, t) {
e.exports = function(e) {
if (void 0 == e) throw TypeError("Can't call method on " + e);
return e
}
}, function(e, t, r) {
var n = r(31),
o = r(57),
i = r(58),
a = "prototype",
s = function(e, t, r) {
var d, c, u, l = e & s.F,
f = e & s.G,
h = e & s.S,
p = e & s.P,
m = e & s.B,
g = e & s.W,
_ = f ? o : o[t] || (o[t] = {}),
v = f ? n : h ? n[t] : (n[t] || {})[a];
f && (r = t);
for (d in r) c = !l && v && d in v, c && d in _ || (u = c ? v[d] : r[d], _[d] = f && "function" != typeof v[d] ? r[d] : m && c ? i(u, n) : g && v[d] == u ? function(e) {
var t = function(t) {
return this instanceof e ? new e(t) : e(t)
};
return t[a] = e[a], t
}(u) : p && "function" == typeof u ? i(Function.call, u) : u, p && ((_[a] || (_[a] = {}))[d] = u))
};
s.F = 1, s.G = 2, s.S = 4, s.P = 8, s.B = 16, s.W = 32, e.exports = s
}, function(e, t) {
var r = {}.hasOwnProperty;
e.exports = function(e, t) {
return r.call(e, t)
}
}, function(e, t, r) {
"use strict";
var n = r(165),
o = r(162),
i = r(167),
a = r(102),
s = r(163),
d = r(59),
c = r(398),
u = r(103),
l = r(35).getProto,
f = r(23)("iterator"),
h = !([].keys && "next" in [].keys()),
p = "@@iterator",
m = "keys",
g = "values",
_ = function() {
return this
};
e.exports = function(e, t, r, v, y, b, w) {
c(r, t, v);
var E, S, N = function(e) {
if (!h && e in A) return A[e];
switch (e) {
case m:
return function() {
return new r(this, e)
};
case g:
return function() {
return new r(this, e)
}
}
return function() {
return new r(this, e)
}
},
T = t + " Iterator",
$ = y == g,
C = !1,
A = e.prototype,
I = A[f] || A[p] || y && A[y],
O = I || N(y);
if (I) {
var k = l(O.call(new e));
u(k, T, !0), !n && s(A, p) && a(k, f, _), $ && I.name !== g && (C = !0, O = function() {
return I.call(this)
})
}
if (n && !w || !h && !C && A[f] || a(A, f, O), d[t] = O, d[T] = _, y)
if (E = {
values: $ ? O : N(g),
keys: b ? O : N(m),
entries: $ ? N("entries") : O
}, w)
for (S in E) S in A || i(A, S, E[S]);
else o(o.P + o.F * (h || C), t, E);
return E
}
}, function(e, t) {
e.exports = !0
}, function(e, t) {
e.exports = function(e, t) {
return {
enumerable: !(1 & e),
configurable: !(2 & e),
writable: !(4 & e),
value: t
}
}
}, function(e, t, r) {
e.exports = r(102)
}, function(e, t) {
var r = Math.ceil,
n = Math.floor;
e.exports = function(e) {
return isNaN(e = +e) ? 0 : (e > 0 ? n : r)(e)
}
}, , , , , , , , function(e, t, r) {
e.exports = r.p + "img/23de3746eb94b2e205186a6486cca7f1.png"
}, function(e, t, r) {
e.exports = r.p + "img/3c01a611ce9ae52843e8da979486ecb4.svg"
}, function(e, t) {
e.exports = {
action_undo: "Undo",
action_try_again: "Try again.",
action_profile_setting: "Setting profile photo",
action_profile_set: "Profile photo set",
action_profile_set_failed: "Couldn't set profile photo.",
action_status_setting: "Changing status",
action_status_set: "Status changed",
action_status_set_failed: "Couldn't change status.",
action_status_empty: "Status can't be empty",
action_profile_removing: "Removing profile photo",
action_profile_removed: "Profile photo removed",
action_profile_remove_failed: "Couldn't remove profile photo.",
action_chat_deleting: "Deleting chat",
action_chat_deleted: "Chat deleted",
action_chat_delete_failed: "Couldn't delete chat.",
action_chat_archiving: "Archiving chat",
action_chat_archived: "Chat archived",
action_chat_archive_failed: "Couldn't archive chat.",
action_chat_unarchiving: "Unarchiving chat",
action_chat_unarchived: "Chat unarchived",
action_chat_unarchive_failed: "Couldn't unarchive chat.",
action_chat_marking_read: "Marking as read",
action_chat_marked_read: "Marked as read",
action_chat_mark_read_failed: "Couldn't mark chat as read.",
action_chat_marking_unread: "Marking as unread",
action_chat_marked_unread: "Marked as unread",
action_chat_mark_unread_failed: "Couldn't mark chat as unread.",
action_chat_clearing: "Clearing chat",
action_chat_cleared: "Chat cleared",
action_chat_clear_failed: "Couldn't clear chat.",
action_group_deleting: "Deleting group",
action_group_deleted: "Group deleted",
action_group_delete_failed: "Couldn't delete group.",
action_mark_as_not_spam: "Marking as not spam",
action_marked_as_not_spam: "Marked as not spam",
action_mark_as_not_spam_failed: "Couldn't mark as not spam",
action_spam_report: "Reporting spam",
action_spam_reported: "Reported spam",
action_spam_report_failed: "Couldn't report spam",
action_broadcast_deleting: "Deleting broadcast list",
action_broadcast_deleted: "Broadcast list deleted",
action_broadcast_delete_failed: "Couldn't delete broadcast list.",
action_participant_adding: "Adding __participant__",
action_participant_added: "__participant__ added",
action_participant_add_failed: "Couldn't add __participant__.",
action_participant_removing: "Removing __participant__",
action_participant_removed: "__participant__ removed",
action_participant_remove_failed: "Couldn't remove __participant__.",
action_participant_promoting: "Making __participant__ a group admin",
action_participant_promoted: "__participant__ is now a group admin",
action_participant_promote_failed: "Couldn't make __participant__ an admin.",
action_blocking: "Blocking __participant__",
action_blocked: "__participant__ blocked",
action_block_failed: "Couldn't block __participant__",
action_unblocking: "Unblocking __participant__",
action_unblocked: "__participant__ unblocked",
action_unblock_failed: "Couldn't unblock __participant__",
action_participant_failed_already_added: "__participant__ is already a participant.",
action_participant_failed_401: "You're not an admin.",
action_participant_failed_403: "You're not a participant.",
action_participant_failed_404: "This group has ended.",
action_group_creating: "Creating group",
action_group_created: "Created group",
action_group_create_failed: "Couldn't create group.",
action_group_create_failed_406: "Please enter a shorter subject.",
action_group_create_failed_participant: "Can't add more than __max__ participants",
action_group_subject_empty: "Group subject can't be empty",
action_group_icon_setting: "Setting group icon",
action_group_icon_set: "Group icon set",
action_group_icon_set_failed: "Couldn't set group icon.",
action_group_icon_removing: "Removing group icon",
action_group_icon_removed: "Group icon removed",
action_group_icon_remove_failed: "Couldn't remove group icon.",
action_group_exiting: "Exiting group",
action_group_exited: "Exited group",
action_group_exit_failed: "Couldn't exit group.",
action_group_renaming: "Renaming group",
action_group_renamed: "Group renamed to __subject__",
action_group_rename_failed: "Couldn't rename group.",
action_group_muting: "Muting group",
action_group_muted: "Group muted",
action_group_mute_failed: "Couldn't mute group.",
action_group_unmuting: "Unmuting group",
action_group_unmuted: "Group unmuted",
action_group_unmute_failed: "Couldn't unmute group.",
action_chat_muting: "Muting chat",
action_chat_muted: "Chat muted",
action_chat_mute_failed: "Couldn't mute chat.",
action_chat_unmuting: "Unmuting chat",
action_chat_unmuted: "Chat unmuted",
action_chat_unmute_failed: "Couldn't unmute chat.",
action_message_deleting: "Deleting message",
action_message_deleting_plural: "Deleting messages",
action_message_deleted: "Message deleted",
action_message_deleted_plural: "__count__ messages deleted",
action_message_delete_failed: "Couldn't delete message",
action_message_delete_failed_plural: "Couldn't delete messages",
delete_message: "Delete message",
delete_message_plural: "Delete messages",
action_message_starring: "Starring message",
action_message_starring_plural: "Starring messages",
action_message_starred: "Message starred",
action_message_starred_plural: "__count__ messages starred",
action_message_star_failed: "Couldn't star message",
action_message_star_failed_plural: "Couldn't star messages",
action_message_unstarring: "Unstarring message",
action_message_unstarring_plural: "Unstarring messages",
action_message_unstarred: "Message unstarred",
action_message_unstarred_plural: "__count__ messages starred",
action_message_unstar_failed: "Couldn't unstar message",
action_message_unstar_failed_plural: "Couldn't unstar messages",
star_message: "Star message",
star_message_plural: "Star messages",
unstar_message: "Unstar message",
unstar_message_plural: "Unstar messages",
msg_info_failed: "To view message info, update WhatsApp on your phone.",
intro_title: "Keep your phone connected",
intro_connection: "WhatsApp Web connects to your phone to sync messages. To reduce data usage, connect your phone to Wi-Fi.",
add_contact_to_group: "Add to a group",
enumeration_comma: ", ",
archive_chat: "Archive chat",
unarchive_chat: "Unarchive chat",
mark_unread_chat: "Mark as unread",
mark_read_chat: "Mark as read",
forward: "Forward",
selected_count: "__count__ selected",
selected_count_plural: "__count__ selected",
forward_message: "Forward message",
forward_message_plural: "Forward messages",
forward_message_to: "Forward message to",
forward_message_to_plural: "Forward messages to",
confirm_forward_to_group: "Forward to “__chat__”?",
confirm_forward_to_contact: "Forward to __chat__?",
confirm_unblock_contact_and_forward: "Unblock __chat__ and forward messages?",
confirm_unblock_contact_and_forward_text: "Blocked. Click to unblock and send.",
message_author: "Message __author__",
message: "Message",
message_info: "Message info",
hidden_group_message_text: "New Message",
hidden_group_message_text_with_author: "Message from __author__",
hidden_message_text: "__unreadCount__ New Message",
hidden_message_text_plural: "__unreadCount__ New Messages",
message_info_played_by: "Played by",
message_info_played: "Played",
message_info_read_by: "Read by",
message_info_read: "Read",
message_info_seen_by: "Seen by",
message_info_seen: "Seen",
message_info_delivered_to: "Delivered to",
message_info_delivered: "Delivered",
message_info_remaining: "__count__ remaining",
message_info_remaining_plural: "__count__ remaining",
copy_text: "Copy text",
web_archive_broadcast: "Archive broadcast list",
web_unarchive_broadcast: "Unarchive broadcast list",
conversation_archived: "Chat archived",
broadcast_archived: "Broadcast list archived",
group_archived: "Group archived",
web_undo: "undo",
web_menuitem_groupchat: "New group",
web_menuitem_new: "New chat",
menuitem_profile_status: "Profile & status",
menuitem_send_logs: "Send logs",
send_logs_confirm: "send",
describe_logs: "Enter log issue",
menuitem_help: "Help",
menuitem_keep_me_signed_in: "Keep me signed in",
menuitem_notification_sounds: "Notification sounds",
menuitem_notifications: "Notifications",
menuitem_blocked: "Blocked",
menuitem_archived: "Archived",
menuitem_settings: "Settings",
menuitem_starred: "Starred",
menuitem_logout: "Log out",
menuitem_remove: "Remove",
menuitem_make_group_admin: "Make group admin",
menutitle_attach: "Attach",
menutitle_menu: "Menu",
web_settings_faq: "FAQ",
if_unchecked_you_will_be_logged_out_afterawhile: "You'll be logged out after several minutes of inactivity",
change_group_icon: "Change group icon",
add_group_icon: "Add group icon",
change_profile_photo: "Change profile photo",
add_profile_photo: "Add profile photo",
adjust_image: "Drag the image to adjust",
done_adjusting: "Done",
remove_profile_photo: "Remove your profile photo?",
remove_group_icon: "Remove this group's icon?",
delete_message_confirmation: "Delete message?",
delete_message_confirmation_plural: "Delete messages?",
confirm_remove_group_participant: "Remove __participant__ from “__subject__” group?",
confirm_add_group_participant: "Add __participant__ to “__subject__” group?",
confirm_promote_group_participant: "Make __participant__ an admin for “__subject__” group?",
remove: "Remove",
conversation_unarchived: "Chat unarchived",
conversation_archive_failed: "Couldn't archive chat.",
conversation_unarchive_failed: "Couldn't unarchive chat.",
web_status: "Status",
web_delete: "Delete",
web_exit: "Exit",
subject: "Subject",
group_subject: "Group Subject",
web_contact_phone: "Phone",
web_group_creation_time: "Created __when__",
group_participant_hint: "Type contact name",
participant_already_blocked: "Already blocked",
chat_not_an_admin: "You are not an admin",
new_chat_flow_title: "New chat",
new_group_flow_title: "New group",
add_group_participants_title: "Add group participants",
add_group_participant: "Add participant",
already_added_to_group: "Already added to group",
web_contact_info: "Contact info",
broadcast_list_info: "Broadcast list info",
web_group_info: "Group info",
web_groups_participation_you_and_name: "Groups in common",
web_participants_title: "Participants",
web_recipients_title: "Recipients",
web_participants_count: "__count__ of __max__",
blocked_flow_title: "Blocked contacts",
add_blocked_title: "Add blocked contact",
add_blocked_hint: "Type contact name",
blocked_description: "List of contacts that you have blocked",
add_blocked_description: "Blocked contacts will no longer be able to call you or send you messages",
add_blocked_instructions: "Click __icon__ button below to select a contact to block",
blocked_empty: "No blocked contacts yet",
unblock_button: "Unblock",
unblock_confirmation: "Unblock __contact__?",
settings_flow_title: "Settings",
archived_flow_title: "Archived chats",
archived_empty: "No archived chats",
starred_flow_title: "Starred messages",
starred_empty: "No starred messages",
cant_load_whatsapp: "Can't Load WhatsApp Web",
computer_behind_proxy: "Your computer is connected to a network that prevents WhatsApp Web from working correctly",
missing_photo_title: "Photo Unavailable",
missing_photo_text: "Can’t view this photo because it's no longer on your phone.",
missing_photo_forward_text: "Can’t forward this photo because it's no longer on your phone.",
missing_video_title: "Video Unavailable",
missing_video_text: "Can’t play this video because it's no longer on your phone.",
missing_video_forward_text: "Can’t forward this video because it's no longer on your phone.",
missing_audio_title: "Voice Message Unavailable",
missing_audio_text: "Can’t play this Voice Message because it's no longer on your phone.",
missing_audio_forward_text: "Can’t forward this Voice Message because it's no longer on your phone.",
missing_media_title: "Media Message Unavailable",
missing_media_forward_text: "Can't forward this media message because it's no longer on your phone",
missing_media_forward_text_plural: "Can't forward some media messages because they are no longer on your phone",
err_unsent_forward_title: "Can’t Forward",
err_unsent_forward_text: "Wait until your message finishes sending and displays a checkmark before forwarding.",
err_unsent_forward_text_plural: "Wait until each of your messages finishes sending and displays a checkmark before forwarding.",
confirm_forward_partial_messages_title: "Can't forward all messages",
confirm_forward_partial_messages_text: "Some messages have not been sent, do you want to forward rest of the messages?",
retry_upload_photo_title: "Couldn’t Send Photo",
retry_upload_photo_text: "Open WhatsApp on your phone and resend this photo",
retry_upload_video_title: "Couldn’t Send Video",
retry_upload_video_text: "Open WhatsApp on your phone and resend this video",
retry_upload_audio_title: "Couldn’t Send Voice Message",
retry_upload_audio_text: "Open WhatsApp on your phone and resend this Voice Message",
guide_desktop_notifications_title: "Allow notifications",
guide_desktop_notifications_description: "To get notifications for new messages, click “Allow” above.",
guide_desktop_notifications_description_firefox: "To get notifications for new messages, select “Always show notifications” from the prompt below the URL bar.",
guide_desktop_camera_title: "Allow camera",
guide_desktop_camera_description: "To take photos, click “Allow” above to give WhatsApp Web access to your computer's camera.",
guide_desktop_camera_description_firefox: "To take photos, WhatsApp Web needs access to your computer’s camera. Select “Always share” from the prompt below the URL bar.",
guide_desktop_camera_description_edge: "To take photos, click “Yes” below to give WhatsApp Web access to your computer's camera.",
guide_desktop_mic_title: "Allow microphone",
guide_desktop_mic_description: "To record Voice Messages, click “Allow” above to give WhatsApp Web access to your computer's microphone.",
guide_desktop_mic_description_firefox: "To record Voice Messages, WhatsApp Web needs access to your computer’s microphone. Select “Always share” from the prompt below the URL bar. Note: selecting “Share selected device” won’t let you record Voice Messages.",
guide_desktop_mic_description_edge: "To record Voice Messages, click “Yes” below to give WhatsApp Web access to your computer's microphone.",
guide_desktop_camera_fail_description: "To take photos, WhatsApp Web needs access to your computer's camera. Click __chrome_media_error__ in the URL bar and choose “Always allow web.whatsapp.com to access your camera.”",
guide_desktop_camera_fail_description_firefox: "To take photos, WhatsApp Web needs access to your computer’s camera. Click __firefox_lock__ in the URL bar and set “Use the Camera” to “Allow.”",
guide_desktop_camera_fail_description_opera: "To take photos, WhatsApp Web needs access to your computer’s camera. Click __opera_media__ in the URL bar and click “Clear This Setting and Reload.”",
guide_desktop_camera_fail_description_edge: "To take photos, WhatsApp Web needs access to your computer’s camera. Refresh the page, try sending a camera image, and select “Yes” from the menu that appears.",
guide_desktop_mic_fail_description: "To record Voice Messages, WhatsApp Web needs access to your microphone. Click __chrome_media_error__ in the URL bar and choose “Always allow web.whatsapp.com to access your microphone.”",
guide_desktop_mic_fail_description_firefox: "To record Voice Messages, WhatsApp Web needs access to your computer’s microphone. Click __firefox_lock__ in the URL bar and set “Use the Microphone” to “Allow.”",
guide_desktop_mic_fail_description_opera: "To record Voice Messages, WhatsApp Web needs access to your computer’s microphone. Click __opera_media__ in the URL bar and click “Clear This Setting and Reload.”",
guide_desktop_mic_fail_description_edge: "To record Voice Messages, WhatsApp Web needs access to your computer’s microphone. Refresh the page, try sending a Voice Message, and select “Yes” from the menu that appears.",
guide_desktop_camera_missing_title: "Camera Not Found",
guide_desktop_camera_missing_description: "You can’t take a photo because it looks like your computer doesn’t have a camera. Try connecting one or if you have one connected, try restarting your browser.",
guide_desktop_mic_missing_title: "Microphone Not Found",
guide_desktop_mic_missing_description: "You can’t record a Voice Message because it looks like your computer doesn’t have a microphone. Try connecting one or if you have one connected, try restarting your browser.",
attach_media: "Photos & Videos",
attach_capture: "Camera",
attach_location: "Location",
attach_vcard: "Contact",
attach_document: "Document",
guide_help_title: "Help",
guide_help_faq: "Click FAQ for help using WhatsApp Web.",
guide_help_description_android: "To contact support, open WhatsApp on your phone and tap Menu – Settings – Help – Contact us.",
guide_help_description_symbian: "To contact support, open WhatsApp on your phone and select Options – About – Contact support.",
guide_help_description_bb: "To contact support, open WhatsApp on your phone and tap Settings – About – Contact support.",
guide_help_description_bbx: "To contact support, open WhatsApp on your phone and swipe down from the top of the screen – Settings – Contact support.",
guide_help_description_wp7: "To contact support, open WhatsApp on your phone and tap menu (three dots at the bottom of the screen) – Settings – About – Contact support.",
guide_help_description_s40: "To contact support, open WhatsApp on your phone – swipe up from bottom – Settings – About – Options – Contact support.",
guide_help_description_iphone: "To contact support, open WhatsApp on your phone and tap Settings – About – Contact Us.",
turn_off_all_desktop_notifications_for: "Turn off all desktop notifications for:",
learn_more: "Learn more",
ok_got_it: "OK, got it",
login: "Log in",
web_view: "View",
web_preview_msg: "Preview",
add_a_caption: "Add a caption…",
add_media: "Add media",
drag_media_here: "Drag media here",
view_photo: "View photo",
take_photo: "Take photo",
remove_photo: "Remove photo",
upload_photo: "Upload photo",
invalid_media_files: "WhatsApp Web doesn't support the type of image or video you tried adding. Try adding a different one.",
image_too_big: "The image you tried adding is larger than the 16MB limit. Try adding a different one.",
video_too_big: "The video you tried adding is larger than the 16MB limit. Try adding a different one.",
option_select_mute: "Turn off alerts and sounds for…",
option_desktop_notifications: "Desktop Alerts",
option_sounds: "Sounds",
option_msg_previews: "Show Previews",
option_msg_previews_hint_text: "Display message text in desktop alerts",
web_menuitem_mute_off: "Cancel mute",
web_menuitem_mute: "Mute",
group_muted: "Group muted",
web_mute_time: "Mute group for…",
web_mute_time_chat: "Mute chat for…",
web_list_info: "Broadcast list info",
click_here_for_group_info: "click here for group info",
click_here_for_user_info: "click here for contact info",
web_delete_contact_dialog_title: "Delete chat with “__name__”?",
clear_button: "Clear",
clear_chat_chat: "Clear chat with “__name__”?",
clear_chat_group: "Clear “__name__” group?",
clear_chat_broadcast: "Clear broadcast list?",
keep_starred: "Keep starred messages",
web_delete_group_dialog_title: "Delete “__groupName__” group?",
web_exit_group_dialog_title: "Exit “__groupName__” group?",
delete_chat_dialog_title: "Delete chat with “__name__”?",
delete_list_dialog_title: "Delete broadcast list?",
are_you_sure: "Are you sure?",
next_button: "Next",
previous_button: "Previous",
save_button: "Save",
edit_button: "Edit",
clear_chat: "Clear messages",
web_exit_group: "Exit group",
web_delete_group: "Delete group",
delete_chat: "Delete chat",
web_delete_list: "Delete broadcast list",
web_select_messages: "Select messages",
conversation_deleted: "Chat deleted",
broadcast_deleted: "Broadcast list deleted",
group_deleted: "Group deleted",
report_spam: "Report spam",
report_group_spam_ack: "Are you sure you want to report spam and leave this group?",
report_spam_ack: "Are you sure you want to report spam and block this contact?",
report_group_spam: "Report spam and leave group",
block: "Block",
block_ack: "Are you sure you want to block this contact?",
not_spam: "Not spam",
group_admin_not_a_contact: "You were added by someone who's not in your contacts",
sender_not_a_contact: "The sender is not in your contact list",
unread_message_count: "__count__ unread message",
unread_message_count_plural: "__count__ unread messages",
web_chats: "Chats",
web_recent_chats: "Chats",
web_groups: "Groups",
web_contacts: "Contacts",
web_messages: "Messages",
web_starred_messages: "Starred Messages",
web_conversation_is_composing: "typing…",
web_conversation_is_recording: "recording audio…",
web_conversation_contact_online: "online",
web_conversation_name_is_composing: "__participant__ is typing…",
web_conversation_name_is_recording: "__participant__ is recording audio…",
web_conversations_most_recent_image: "Photo",
web_conversations_most_recent_audio: "Audio",
web_conversations_most_recent_voice: "Voice message",
web_conversations_most_recent_video: "Video",
web_conversations_most_recent_contact: "Contact",
web_conversations_most_recent_location: "Location",
web_conversations_most_recent_file: "Document",
web_conversations_most_recent_document: "__count__ page",
web_conversations_most_recent_document_plural: "__count__ pages",
untitled_document: "Untitled",
search_no_chats_or_contacts: "No chats or contacts found",
search_no_contacts: "No contacts found",
search_no_groups: "No groups found",
no_chats: "No chats",
no_contacts: "No contacts",
no_groups: "No groups",
chat_archived: "Archived",
all_chats_archived: "All chats are archived",
no_starred_messages: "No starred messages",
see_archived: "See __count__ archived chat",
see_archived_plural: "See __count__ archived chats",
web_group_admin: "Group Admin",
contact_status_loading: "Loading status…",
retry_now: "Retry Now",
retake: "Retake",
web_cancel: "Cancel",
web_ok: "OK",
web_close: "Close",
web_share: "Share",
web_button_download: "Download",
trying_to_reach_phone: "Trying to reach phone",
connecting_to_whatsapp: "Connecting to WhatsApp",
connecting_to_whatsapp_or_phone: "Connecting",
connecting: "Connecting…",
updating_whatsapp_web_title: "Updating",
updating_whatsapp_web: "WhatsApp Web is out of date. Updating now…",
retrying: "Retrying…",
retrying_in: "Retrying in __duration__…",
loading_messages: "loading messages…",
load_earlier_messages: "load earlier messages…",
load_recent_messages: "load recent messages…",
resend_message: "Click to resend",
click_to_save_esc_to_cancel: "Click to save, ESC to cancel",
web_today_at: "today at __time__",
web_yesterday_at: "yesterday at __time__",
web_time_at: "__date__ at __time__",
web_conversation_last_seen_today: "last seen today at __time__",
web_conversation_last_seen_yesterday: "last seen yesterday at __time__",
web_conversation_last_seen_date: "last seen __date__ at __time__",
web_conversation_last_seen_weekday: "last seen __date__ at __time__",
web_you: "You",
web_today: "today",
web_yesterday: "yesterday",
retrying_in_some_seconds: "Retrying in __number__ second…",
retrying_in_some_seconds_plural: "Retrying in __number__ seconds…",
web_you_created_list_unnamed: "You created a broadcast list with __count__ recipient",
web_you_created_list_unnamed_plural: "You created a broadcast list with __count__ recipients",
web_list_recipient_added: "__name__ added to the list",
web_list_recipient_removed: "__name__ removed from the list",
web_group_subject_changed_by_you: "You changed the subject to “__subject__”",
web_group_subject_changed_by_name: "__name__ changed the subject to “__subject__”",
web_group_participant_added_name: "__name__ was added",
web_group_participant_added_you: "You were added",
web_group_participant_removed_name: "__name__ was removed",
web_group_participant_removed_you: "You were removed",
web_group_participant_left_name: "__name__ left",
web_group_participant_left_you: "You left",
web_group_participant_changed_number: "__name__ changed from __old_number__ to __new_number__",
web_group_participant_changed_number_unknown_name: "__name__ changed to __new_number__",
web_group_participants_name_added_names: "__name__ added __participants__",
web_group_participants_you_added_names: "You added __participants__",
web_group_participants_name_removed_names: "__name__ removed __participants__",
web_group_participants_you_removed_names: "You removed __participants__",
web_group_participants_name_added_you: "__name__ added you",
web_group_participants_name_removed_you: "__name__ removed you",
web_group_participant_promoted_names: "__participants__ is now an admin",
web_group_participant_promoted_names_plural: "__participants__ are now admins",
web_group_participant_demoted_names: "__participants__ is no longer an admin",
web_group_participant_demoted_names_plural: "__participants__ are no longer admins",
web_group_participant_promoted_you: "You're now an admin",
web_group_participant_demoted_you: "You're no longer an admin",
web_group_created_by_you: "You created group “__subject__”",
web_group_created_by_name: "__name__ created group “__subject__”",
web_group_created_by_you_no_subject: "You created this group",
web_group_created_by_name_no_subject: "__name__ created this group",
web_group_ended_you: "You ended this group",
web_group_ended_name: "__name__ ended this group",
web_photo_changed_by: "__name__ changed this group's icon",
web_photo_removed_by: "__name__ deleted this group's icon",
web_photo_changed_by_you: "You changed this group's icon",
web_photo_removed_by_you: "You deleted this group's icon",
web_mute_8hours: "8 Hours",
web_mute_1week: "1 Week",
web_mute_1year: "1 Year",
mute_1hour: "1 Hour",
mute_1day: "1 Day",
mute_1week: "1 Week",
global_muted: "Alerts and sounds off",
global_muted_1hour: "Alerts and sounds off for 1 hour",
global_muted_1day: "Alerts and sounds off for 1 day",
global_muted_1week: "Alerts and sounds off for 1 week",
global_notification_sounds_on: "Notification sounds on",
global_notification_sounds_off: "Notification sounds off",
global_unmuted: "Notifications enabled",
global_unmute: "Alerts and sounds off. Click to restore.",
web_cannot_send_not_a_group_participant: "You can't send messages to this group because you're no longer a participant.",
web_cannot_send_to_blocked_contact_1: "Can't send a message to blocked contact __contact__.",
cannot_send_document_to_contact_unsupported: "Can't send documents to __contact__ because __contact__ is on a version of WhatsApp that doesn't support them.",
cannot_send_document_to_group_unsupported: "Can't send documents to __group__ because some members are on a version of WhatsApp that doesn't support them.",
type_a_message: "Type a message",
whatsapp_web: "WhatsApp Web",
whatsapp: "WhatsApp",
default_group_message_notification_title: "WhatsApp group message",
incoming_call_notification_title: "WhatsApp Call from __name__",
incoming_call_notification_text: "Check your phone to answer",
default_contact_message_notification_title: "WhatsApp message",
search_or_start_new_chat: "Search or start new chat",
search_contacts: "Search contacts",
search: "Search…",
search_groups: "Search groups",
update_available: "Update Available",
click_to_update_whatsapp_web: "Click to update WhatsApp Web",
desktop_client_update_required: "To continue using WhatsApp, update to the latest version.",
desktop_client_update_available: "New version available",
click_to_download_desktop_client: "Update WhatsApp",
desktop_client_updating: "WhatsApp is updating",
phone_battery_low: "Phone Battery Low",
charge_phone_description: "Charge your phone to keep using WhatsApp Web",
computer_not_connected: "Computer Not Connected",
make_sure_computer_active_internet_connection: "Make sure your computer has an active Internet connection.",
check_internet_connection: "No Internet connection",
reconnect: "Reconnect",
phone_not_connected: "Phone Not Connected",
make_sure_phone_active_internet_connection: "Make sure your phone has an active Internet connection.",
enable_desktop_notifications: "Turn on desktop notifications",
get_notified_of_new_messages: "Get Notified of New Messages",
phone_has_another_active_webclient_session: "WhatsApp Web is open on another computer or browser. Click “Use Here” to use WhatsApp Web in this window.",
whatsapp_web_is_open_in_another_window: "WhatsApp Web is open in another window. Click “Use Here” to use WhatsApp Web in this window.",
button_use_here: "Use Here",
open_whatsapp: "Open WhatsApp",
click_to_reload_qr_code: "Click to reload QR code",
scan_code_with_phone_to_login: "Use WhatsApp on your phone to scan the code",
reduce_data_usage_connect_phone_to_wifi: "To reduce mobile data usage, connect your phone to Wi-Fi",
android: "Android",
android_login_path: "Open WhatsApp — Menu — WhatsApp Web",
blackberry: "BlackBerry",
blackberry_login_path: "Open WhatsApp — Chats — Menu key — WhatsApp Web",
windows_phone: "Windows Phone",
windows_phone_login_path: "Open WhatsApp — Menu — WhatsApp Web",
nokia_symbian_s60: "Nokia S60",
nokia_symbian_s60_login_path: "Open WhatsApp — Menu — WhatsApp Web",
bb10: "BlackBerry 10",
bb10_login_path: "Open WhatsApp — Swipe down from top of screen — WhatsApp Web",
iphone: "iPhone",
iphone_login_path: "Open WhatsApp — Settings — WhatsApp Web",
message_too_large_title: "Message Too Long",
message_too_large_text: "The message you’re pasting is too long. Try shortening it or sending it in multiple parts.",
video_playback_not_supported: "Your browser doesn’t support video playback.",
audio_playback_not_supported: "Your browser doesn’t support audio playback.",
whatsapp_web_meta_description: "Quickly send and receive WhatsApp messages right from your computer.",
whatsapp_web_description: "Send and receive WhatsApp messages right from your computer.",
whatsapp_web_requirements: "We recommend using WhatsApp Web with one of the following browsers:",
whatsapp_web_supports: "WhatsApp Web also supports:",
update_safari: "Update Safari",
get_safari: "Safari (MacOS 10.8+ Only)",
get_google_chrome: "Google Chrome",
update_google_chrome: "Update Google Chrome",
get_mozilla_firefox: "Mozilla Firefox",
update_mozilla_firefox: "Update Mozilla Firefox",
get_opera: "Opera",
get_edge: "Microsoft Edge",
whatsapp_edge_version: "WhatsApp Web works with Microsoft Edge 13+",
whatsapp_edge_instructions: "To use WhatsApp Web, update Windows 10 to get Microsoft Edge 13+, or use __chrome_homepage__, __firefox_homepage__, or __opera_homepage__.",
update_edge: "Download latest Windows 10",
whatsapp_safari_version: "WhatsApp Web works with Safari 7.1+",
whatsapp_safari_instructions: "To use WhatsApp Web, update Safari or use __chrome_homepage__, __firefox_homepage__, or __opera_homepage__.",
whatsapp_safari_limited_title: "Using Safari",
whatsapp_safari_limited: "To use all of WhatsApp Web's features like photo capturing and Voice Message recording, we recommend using __chrome_homepage__, __firefox_homepage__ or __opera_homepage__.",
whatsapp_firefox_version: "WhatsApp Web works with Mozilla Firefox 30+",
whatsapp_firefox_instructions: "To use WhatsApp Web, update Firefox or use __chrome_homepage__, __safari_homepage__, or __opera_homepage__.",
whatsapp_chrome_version: "WhatsApp Web works with Google Chrome 36+",
whatsapp_chrome_instructions: "To use WhatsApp Web, update Chrome or use __firefox_homepage__, __safari_homepage__, or __opera_homepage__.",
filesize_byte: "B",
filesize_kilobyte: "kB",
filesize_megabyte: "MB",
filesize_gigabyte: "GB",
confirm_closing_webclient: "You are closing WhatsApp Web.",
confirm_logout: "Log out?",
some_of_your_messages_are_still_sending: "Some of your messages are still sending.",
terms_and_privacy_link: "Terms and Privacy Policy",
web_terms_of_service_1: "WhatsApp is updating our Terms and Privacy Policy to reflect new features like WhatsApp Calling. Open WhatsApp on your phone to read our Terms and Privacy Policy and learn more about the choices you have.",
web_terms_of_service_2: "WhatsApp is updating our Terms and Privacy Policy to reflect new features like WhatsApp Calling. Open WhatsApp on your phone to read our Terms and Privacy Policy and learn more about the choices you have.",
web_terms_of_service_login_block: 'WhatsApp is updating our Terms and Privacy Policy to reflect new features like WhatsApp Calling. Open WhatsApp on your phone to read our Terms and Privacy Policy and learn more about the choices you have. If you have accepted the Terms and Privacy Policy, click \\"LOG IN\\" to continue using WhatsApp Web.',
web_security_code_change: "__name__'s security code changed. Click for more info.",
web_individual_chat_encryption_state_change: "Messages you send to this chat and calls are now secured with end-to-end encryption. Click for more info.",
web_group_encryption_state_change: "Messages you send to this group are now secured with end-to-end encryption. Click for more info.",
web_broadcast_encryption_state_change: "Messages you send to this broadcast list are now secured with end-to-end encryption. Click for more info.",
web_contact_info_encrypted: "Messages you send to this chat and calls are now secured with end-to-end encryption.",
web_contact_info_encrypted_verify: "Messages you send to this chat and calls are now secured with end-to-end encryption. Click to verify.",
web_group_info_encrypted: "Messages you send to this group are secured with end-to-end encryption. Click for more info.",
web_broadcast_info_encrypted: "Messages you send to this broadcast list are secured with end-to-end encryption. Click for more info.",
web_group_info_encrypted_description: "Messages you send to this group are secured with end-to-end encryption, which means WhatsApp and third parties can't read them.",
web_broadcast_info_encrypted_description: "Messages you send to this broadcast list are secured with end-to-end encryption, which means WhatsApp and third parties can't read them.",
web_security_code_change_description: "__name__'s security code changed, likely because __name__ reinstalled WhatsApp or switched phones.",
web_security_code_change_description_verify: '__name__\'s security code changed, likely because __name__ reinstalled WhatsApp or switched phones. Click \\"verify\\" to confirm the new security code.',
web_individual_chat_encryption_state_change_description: "Messages you send to this chat and calls are now secured with end-to-end encryption, which means WhatsApp and third parties can't read or listen to them.",
web_group_encryption_state_change_description: "Messages you send to this group are now secured with end-to-end encryption, which means WhatsApp and third parties can't read them.",
web_broadcast_encryption_state_change_description: "Messages you send to this broadcast list are now secured with end-to-end encryption, which means WhatsApp and third parties can't read them.",
web_missed_call_system_message: "Missed call at __time__"
}
}, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , function(e, t, r) {
"use strict";
function n() {
return _.filter(_.keys(v.BROWSER_CAPABILITY), function(e) {
return !v.BROWSER_CAPABILITY[e]
})
}
function o() {
return T.loopOnError(function(e) {
return Promise.delay(P.expBackoff(e, 12e4, 1e3, .1)).then(function() {
return r.e(0).then(function(e) {
s = r(672)
}.bind(null, r))["catch"](function(e) {
r.oe(e)
})
})
})
}
function i() {
return _.isFunction(String.prototype.normalize) ? Promise.resolve() : T.loopOnError(function(e) {
return Promise.delay(P.expBackoff(e, 12e4, 1e3, .1)).then(function() {
return r.e(5).then(function(e) {
r(751)
}.bind(null, r))["catch"](function(e) {
r.oe(e)
})
})
})
}
var a, s, d = r(5),
c = r(1),
u = r(373),
l = r(375),
f = r(371),
h = r(372),
p = r(364),
m = r(377),
g = r(44),
v = r(6),
y = r(8),
b = r(39),
w = r(370),
E = r(365),
S = r(10),
N = r(53),
T = r(25),
$ = r(72),
C = r(91),
A = r(93),
I = r(13),
O = r(147),
k = r(26),
P = r(74),
R = r(140),
M = r(96),
L = {
INIT: "init",
PING: "ping",
PONG: "pong",
TAKEOVER: "local-takeover"
},
D = 6e5,
U = r(99),
B = r(376),
x = r(9);
U && ! function() {
var e = function() {
B.send(navigator.serviceWorker.controller, "setl10n", {
isRTL: l10n.isRTL(),
lng: l10n.lng()
})
},
t = function() {
try {
navigator.serviceWorker.controller && navigator.serviceWorker.controller.addEventListener("error", function(e) {
S.state !== S.STATE.UNLAUNCHED && c.error("ServiceWorker controller error: " + e.error)()
})
} catch (e) {
c.error('Unable to add "error" event listener to service worker, error: ' + e)()
}
};
try {
navigator.serviceWorker.addEventListener("controllerchange", function(r) {
t(), S.state === S.STATE.UNLAUNCHED ? Store.Stream.needsUpdate = !0 : e()
})
} catch (r) {
c.error('Unable to add "controllerchange" event listener to service worker container, error: ' + r)()
}
try {
navigator.serviceWorker.addEventListener("error", function(e) {
S.state !== S.STATE.UNLAUNCHED && c.error("ServiceWorker container error: " + e.error)()
})
} catch (r) {
c.error('Unable to add "error" event listener to service worker container, error: ' + r)()
}
t();
var n = function(e, t) {
e.buffer.forEach(function(e) {
e.message[0] = "ServiceWorker(" + t + "): " + e.message[0], c[e.level].apply(c, e.message)()
})
};
B.on("log", function(e, t, r) {
S.state !== S.STATE.UNLAUNCHED && n(e, r)
}), B.on("uploadLogs", function(e, t, r) {
e && n(e, r), x.upload("Requested by Service Worker")
}), y.on("locale_change", function() {
navigator.serviceWorker.ready.then(function() {
e()
})
})
}();
var j = d.createClass({
displayName: "App",
mixins: [$, C, A],
statics: {
hasPending: function() {
return !!s && s.hasPending()
}
},
getInitialState: function() {
return {
mode: N.mode,
updating: !1,
anotherSession: !1,
takingOver: !1,
locale: _.first(l10n._locales)
}
},
clearMutexTimer: function() {
this.updateMutexTimerID && R.clearTimeout(this.updateMutexTimerID)
},
updateMutex: function() {
this.clearMutexTimer();
var e = Date.now();
I.setMutex(this.ourMutex = L.INIT + "_" + e), this.updateMutexTimerID = R.setTimeout(this.updateMutex, e + D)
},
unloadMutex: function() {
var e = I.getMutex();
e && this.ourMutex && e.indexOf(this.ourMutex) > -1 && I.removeMutex()
},
componentWillUpdate: function(e, t) {
this.state.anotherSession === !0 && t.anotherSession === !1 ? k.openDB() : this.state.anotherSession === !1 && t.anotherSession === !0 && k.idb().then(function(e) {
return e.close()
})["catch"](_.noop)
},
componentWillMount: function() {
var e = this;
Promise.all([o(), i()]).then(function() {
return y.mainLoaded()
});
var t = n();
if (t.length > 0) {
var r = v.CAPABILITY_URL + "?missing=" + t.join(",");
window.location.replace ? window.location.replace(r) : window.location.href = r
}
this.regNativeListener(window, "beforeunload", this.unloadMutex), this.regNativeListener(window, "unload", this.unloadMutex), this.regNativeListener(window, "storage", this.storagePong), this.addObserver(M, "change:mode", this.onUpdaterModeChange), this.addObserver(N, "change:mode", this.onStreamModeChange);
var a = this;
this.regCmd("locale_change", function() {
c.log("App:componentWillMount:rerenderUI locale change")(), a.setState({
locale: _.first(l10n._locales)
})
}), O.loadInitialAssets().then(function() {
c.log("App:componentWillMount:loadInitialAssets")()
}), this.registerYesterdayTimer(), c.log("App:componentWillMount:visibilityState: " + document.visibilityState)(), "prerender" === document.visibilityState ? T.waitForEvent(document, "visibilitychange").timeout(5e3).then(function() {
return e.init(0)
})["catch"](function() {
return e.init(0)
}) : this.init(0)
},
registerYesterdayTimer: function() {
var e = this;
R.setTimeout(function() {
c.log("App:registerYesterdayTimer:rerenderUI relative timestamps")(), y.midnight(), e.registerYesterdayTimer()
}, moment().endOf("day").valueOf())
},
onStreamModeChange: function() {
this.setState({
mode: N.mode
})
},
onUpdaterModeChange: function() {
M.mode !== M.Mode.PENDING_REFRESH && M.mode !== M.Mode.REFRESHING || S.hasSynced || this.setState({
updating: !0
})
},
init: function() {
var e = arguments.length <= 0 || void 0 === arguments[0] ? 0 : arguments[0],
t = this;
if (e += 1, e > 3) return void this.setState({
takingOver: !1,
anotherSession: !0
});
var r = I.getNoTakeover();
I.setNoTakeover(), S.preload(), this.pingForOtherLocalSession().then(function(n) {
n ? (I.maybeMigrate(), t.updateMutex(), S.launch(!r), t.setState({
takingOver: !1,
anotherSession: !1
})) : r ? t.setState({
takingOver: !1,
anotherSession: !0
}) : t.takeoverLocal(e)
})
},
pingForOtherLocalSession: function() {
var e = I.getMutex();
if (e) {
e += "";
var t = 1e4;
if (e.indexOf("_") > 0 && (e = parseInt(_.last(e.split("_")), 10), _.isFinite(e))) {
var r = Date.now() - 1.5 * D;
r > e && (c.log("app:pingForOtherLocalSession stale mutex")(), t = 1e3)
}
var n = T.waitForEvent(window, "storage", I.mutexFilter).timeout(t, "waitForOtherLocalSessionTimeout")["return"](!1)["catch"](Promise.TimeoutError, function(e) {
return c.error("app:pingForOtherLocalSession mutex timeout")(), !0
});
return I.setMutex(L.PING + Math.random()), n
}
return Promise.resolve(!0)
},
storagePong: function(e) {
if (I.mutexFilter(e)) {
var t = I.parseMutex(e.newValue);
t && (t === L.TAKEOVER ? (this.clearMutexTimer(), S.exitLoop(), I.localTakeoverSuccess(), this.setState({
takingOver: !1,
anotherSession: !0
})) : 0 === t.indexOf(L.PING) && I.setMutex(L.PONG + Math.random()))
}
},
takeoverLocal: function(e) {
if (I.compareVersion() < 0 || Store.Stream.needsUpdate) return c.log("app:takeoverLocal stale client: " + I._version() + " ls: " + I._getLSVersion())(), document.location.reload(!0);
if (I.getMutex()) {
this.setState({
takingOver: !0
});
var t = this;
T.waitForEvent(window, "storage", I.takeoverFilter).timeout(3e4, "takeoverLocalTimeout").then(function(r) {
var n = I.parseTakeover(r.newValue);
I.getRememberMe() || I._setAllKeyValues(n), S.mustExitLoop = !1, I.removeMutex(), t.init(e)
})["catch"](Promise.TimeoutError, function(r) {
c.error("app:takeoverLocal timeout")(), S.mustExitLoop = !1, I.removeMutex(), t.init(e)
}), I.setMutex(L.TAKEOVER)
} else this.init(e)
},
onMouseDown: function(e) {
y.windowMouseDown(e)
},
onClick: function(e) {
y.windowClick(e)
},
render: function() {
var e, t = b("app-wrapper", {
"app-wrapper-web": !0
});
if (this.state.desktopClientExpired) {
var r, n, o;
M.mode === M.Mode.DOWNLOADING || M.mode === M.Mode.CHECKING ? o = l10n.t("desktop_client_updating") : (r = l10n.t("click_to_download_desktop_client"), n = function() {
M.manualDownload()
}, o = l10n.t("desktop_client_update_required")), e = d.createElement(g, {
title: l10n.t("click_to_download_desktop_client"),
body: o,
defaultLabel: r,
onDefault: n
})
} else if (this.state.updating) e = d.createElement(g, {
body: l10n.t("updating_whatsapp_web"),
title: l10n.t("updating_whatsapp_web_title")
});
else if (this.state.anotherSession) {
var i, v;
if (this.state.takingOver) i = _.noop, v = l10n.t("connecting");
else {
var y = this;
i = function() {
y.takeoverLocal(0)
}, v = l10n.t("button_use_here")
}
e = d.createElement(g, {
body: l10n.t("whatsapp_web_is_open_in_another_window"),
cancelLabel: l10n.t("web_close"),
onCancel: window.open.bind(window, "http://www.whatsapp.com/", "_self"),
defaultLabel: v,
onDefault: i
})
} else switch (this.state.mode) {
case N.MODE.QR:
e = [d.createElement(w, {
type: "main",
key: "modal-manager"
}), d.createElement(u, {
key: "qr-code"
})];
break;
case N.MODE.SYNCING:
e = d.createElement(l, null);
break;
case N.MODE.OFFLINE:
e = d.createElement(f, null);
break;
case N.MODE.PROXYBLOCK:
e = d.createElement(h, null);
break;
case N.MODE.CONFLICT:
e = d.createElement(p, null);
break;
case N.MODE.TOS_BLOCK:
e = d.createElement(m, null);
break;
case N.MODE.MAIN:
e = [d.createElement(w, {
type: "media",
key: "media-modal-manager"
}), d.createElement(w, {
type: "main",
key: "main-modal-manager"
}), d.createElement(E, {
type: "menu",
key: "context-menu-manager"
}), d.createElement(E, {
type: "tooltip",
key: "tooltip-manager"
}), d.createElement(s, {
key: "main",
conn: Store.Conn
})], t += " app-wrapper-main";
break;
default:
c.log("app:render Error invalid App state", this.state.mode)()
}
return d.createElement("div", {
className: t,
onMouseDownCapture: this.onMouseDown,
onClickCapture: this.onClick,
key: this.state.locale
}, e, a ? d.createElement(a, null) : null)
}
});
e.exports = j
}, function(e, t, r) {
"use strict";
var n = r(6),
o = r(1),
i = r(327),
a = r(138),
s = r(25),
d = r(19),
c = r(30),
u = r(8),
l = r(18),
f = r(10),
h = i.extend({
model: a,
comparator: a.Comparator,
_sort: _.debounce(function() {
return i.prototype.sort.call(this)
}, 1e3),
_silentSort: _.debounce(function() {
return i.prototype.sort.call(this, {
silent: !0
})
}, 1e3),
sort: function(e) {
return e && e.slient ? this._silentSort() : this._sort()
},
initialize: function() {
i.prototype.initialize.call(this, {
CachePolicy: {
id: "contact_collection",
policy: i.CACHE_POLICY.NONE
}
}), this.checksum = void 0, this.listenTo(u, "locale_change", this.sort), this.listenTo(this, "change:name", this.sort), this.listenTo(f, "change:stream", function() {
f.stream === f.STREAM.DISCONNECTED && this.forEach(function(e) {
return e.unset("_capabilities")
})
})
},
"delete": function() {
i.prototype["delete"].call(this), delete this.checksum
},
isFilteredContact: function(e) {
return e.name && !e.isMe && e.isWAContact
},
getFilteredContacts: function() {
return this.filter(function(e) {
return e.name && !e.isMe && e.isWAContact
})
},
_find: function(e) {
var t = this.get(e);
return t ? Promise.resolve(t) : Promise.resolve({
id: e
})
},
_findQuery: function(e) {
var t = this;
return c.contactFindQuery(e.retry).then(function(e) {
return "preempted" === e ? Promise.reject("contacts preempted") : (t.trigger(n.COLLECTION_HAS_SYNCED), e.checksum && (t.checksum = e.checksum, o.log("Store:Contact:query update checksum " + e.checksum)()), Promise.resolve(e.data))
})
},
handle: function(e) {
var t = this,
r = function(e) {
t.add(e, {
merge: !0
});
var r = t.get(e.id);
e.name || (r.unset("name"), r.unset("shortName"))
},
i = e.shift();
if (_.isArray(i)) {
var a = e.shift();
if (a && "remove" === a.missing) {
var s = {};
i.forEach(function(e) {
s[e.id] = !0
}), this.forEach(function(e) {
var t = e.get("id");
d.isUser(t) && !s[t] && (e.unset("name"), e.unset("shortName"))
})
}
a && a.checksum && (this.checksum = a.checksum, o.log("Store:Contact:handle update checksum " + a.checksum)()), i.forEach(r)
} else if ("preempt" === i.cmd) this.add(i.response, {
merge: !0
}), i.checksum && (this.checksum = i.checksum, o.log("Store:Contact:handle update checksum " + i.checksum)()), this.trigger(n.COLLECTION_HAS_SYNCED);
else if ("caps" === i.type) {
var c = this.get(i.jid);
if (c && c.isUser && c._capabilities && _.isObject(i.data))
for (var u in i.data) c._capabilities[u] = i.data[u]
} else o.error("Store:Contact:handle unknown: " + JSON.stringify(i))()
},
sync: function() {
return this.findQuery({})["catch"](l.WapDrop, _.noop), s.waitForBBEvent(this, n.COLLECTION_HAS_SYNCED)
},
resyncContacts: function(e) {
"undefined" != typeof this.checksum && "undefined" != typeof e && (this.checksum !== e ? this.findQuery({
retry: !0
}).then(function(e) {
if (_.isArray(e)) {
o.log("Store:Contact:resync success")();
var t, r, n = {};
for (r = 0; r < e.length; r++) t = e[r], n[t.id] = t;
for (r = 0; r < this.length; r++) t = this.at(r), n[t.id] || t.unset("name")
} else o.error("Store.Contact.resync error " + JSON.stringify(e), e)()
})["catch"](l.WapDrop, _.noop) : o.log("Store:Contact:resync checksum match")())
}
});
e.exports = new h
}, function(e, t, r) {
"use strict";
function n(e) {
o.log("Application Cache " + e.type + " event")(e)
}
var o = r(1);
applicationCache.addEventListener("cached", n), applicationCache.addEventListener("checking", n), applicationCache.addEventListener("downloading", n), applicationCache.addEventListener("error", n), applicationCache.addEventListener("noupdate", n), applicationCache.addEventListener("obsolete", n), applicationCache.addEventListener("progress", n), applicationCache.addEventListener("updateready", n)
}, function(e, t) {
"use strict";
! function(e) {
var t = e.HTMLCanvasElement && e.HTMLCanvasElement.prototype,
r = e.Blob && function() {
try {
return Boolean(new Blob)
} catch (e) {
return !1
}
}(),
n = r && e.Uint8Array && function() {
try {
return 100 === new Blob([new Uint8Array(100)]).size
} catch (e) {
return !1
}
}(),
o = e.BlobBuilder || e.WebKitBlobBuilder || e.MozBlobBuilder || e.MSBlobBuilder,
i = /^data:((.*?)(;charset=.*?)?)(;base64)?,/,
a = (r || o) && e.atob && e.ArrayBuffer && e.Uint8Array && function(e) {
var t, a, s, d, c, u, l, f, h;
if (t = e.match(i), !t) throw new Error("invalid data URI");
for (a = t[2] ? t[1] : "text/plain" + (t[3] || ";charset=US-ASCII"), s = !!t[4],
d = e.slice(t[0].length), c = s ? atob(d) : decodeURIComponent(d), u = new ArrayBuffer(c.length), l = new Uint8Array(u), f = 0; f < c.length; f += 1) l[f] = c.charCodeAt(f);
return r ? new Blob([n ? l : u], {
type: a
}) : (h = new o, h.append(u), h.getBlob(a))
};
e.HTMLCanvasElement && !t.toBlob && (t.mozGetAsFile ? t.toBlob = function(e, r, n) {
e(n && t.toDataURL && a ? a(this.toDataURL(r, n)) : this.mozGetAsFile("blob", r))
} : t.toDataURL && a && (t.toBlob = function(e, t, r) {
e(a(this.toDataURL(t, r)))
})), e.dataURLtoBlob = a
}(window)
}, function(e, t, r) {
"use strict";
function n(e) {
return C[parseInt(e, 10)]
}
function o() {
var e = m || window.location.href || "",
t = e.split("/%F0%9F%8C%90/");
return t.length > 1 ? _.first(t[1].split("/")) : void 0
}
var i = r(1),
a = r(40),
s = r(138),
d = r(456),
c = r(384),
u = r(8),
l = r(145),
f = r(25),
h = r(463),
p = r(74),
m = window.location.href,
g = window.history && window.history.pushState && window.location;
g && m && m.indexOf("/%F0%9F%8C%90/") > -1 && window.history.replaceState({}, "", "/");
var v = "en",
y = "en-GB",
b = document.documentElement.getAttribute("dir"),
w = document.getElementById("style").getAttribute("href"),
E = {
en: r(178)
},
S = {
LTR: "ltr",
RTL: "rtl"
},
N = r(461),
T = ["ar", "fa", "ur", "he", "dv", "ku"],
$ = ["ar", "fa"],
C = "٠١٢٣٤٥٦٧٨٩".split("");
s.setCollator(v), e.exports = {
_locales: [v],
init: function(e) {
this.initPromise && this.initPromise.cancel();
var t = [];
if (this._addLocale(e, t), this._addLocale(o(), t), navigator.languages) {
var n = this;
_.forEach(navigator.languages, function(e) {
n._addLocale(e, t)
})
}
this._addLocale(navigator.language, t), this._addLocale(v, t);
var a = t.filter(function(e) {
return !E[e]
}),
d = a.map(function(e) {
return e = N[e], e ? f.loopOnError(function(t) {
return Promise.delay(p.expBackoff(t, 12e4, 1e3, .1)).then(function() {
return r(340)("./" + e + "/translation.json")()
})
}).cancellable()["catch"](Promise.CancellationError, _.noop) : Promise.reject("Non-existent language requested.")
}),
c = this.curDir();
return this.initPromise = Promise.all(d).bind(this).cancellable()["finally"](function() {
return _.forEach(d, function(e) {
return e.cancel()
})
}).then(function(r) {
a.forEach(function(e, t) {
E[e] = r[t]
}), this._locales = t;
var n = _.first(this._locales).replace("_", "-").toLowerCase();
s.setCollator(n);
var o = [e, _.first(this._locales), y].filter(function(e) {
return !!e
});
moment.locale(o), this.customizeMomentLocale(moment.locale());
var d = T.indexOf(_.first(this._locales)) > -1 ? S.RTL : S.LTR;
if (d !== b) {
if (this._loadedStyle && c === b) return this._switchStyleDir(c, d), u.localeChange(), i.log("i10n:init Locale Updated: " + this._locales.join(":"))(), this._locales;
var l = window.performance.now();
return this._loadStyle().bind(this).then(function(e) {
this._loadedStyle = e;
var t = window.performance.now();
this._switchStyleDir(c, d);
var r = window.performance.now();
return i.log("i10n:init style fetching:" + (t - l) + "ms")(), i.log("i10n:init style executing:" + (r - t) + "ms")(), u.localeChange(), i.log("i10n:init Locale Updated: " + this._locales.join(":"))(), this._locales
})
}
return this._switchStyleDir(c, d), u.localeChange(), i.log("i10n:init Locale Updated: " + this._locales.join(":"))(), this._locales
})["catch"](Promise.CancellationError, _.noop)["catch"](function() {
this._locales = [v], s.setCollator(v);
var r = [e, _.first(this._locales), y].filter(function(e) {
return !!e
});
return moment.locale(r), this.customizeMomentLocale(moment.locale()), this._switchStyleDir(c, S.LTR), u.localeChange(), i.error("i10n:init Failed to fetch locales", t)(), this._locales
})
},
_switchStyleDir: function(e, t) {
if (e !== t) {
var r = document.getElementById("style");
t === b ? (e !== b && this._loadedStyle && (this._loadedStyle.unuse(), a.isGecko && r.setAttribute("href", w)), r.removeAttribute("disabled"), document.documentElement.setAttribute("dir", t)) : (a.isGecko && r.setAttribute("href", ""), r.setAttribute("disabled", "true"), document.documentElement.setAttribute("dir", t), this._loadedStyle.use())
}
},
_loadRTL: function() {
return f.loopOnError(function(e) {
return Promise.delay(p.expBackoff(e, 12e4, 1e3, .1)).then(function() {
return r.e(1).then(function(e) {
return r(674)
}.bind(null, r))["catch"](function(e) {
r.oe(e)
})
})
})
},
_loadLTR: function() {
return f.loopOnError(function(e) {
return Promise.delay(p.expBackoff(e, 12e4, 1e3, .1)).then(function() {
return r.e(2).then(function(e) {
return r(673)
}.bind(null, r))["catch"](function(e) {
r.oe(e)
})
})
})
},
_loadStyle: function() {
return b === S.RTL ? this._loadLTR() : this._loadRTL()
},
_addLocale: function(e, t) {
if (e) {
var r = e.replace("-", "_").toLowerCase();
N[r] && (r = N[r], r = r.replace("-", "_").toLowerCase());
var n = t.indexOf(r);
0 > n && this.isLocaleSupported(e) && t.push(r);
var o = r.split("_");
if (!(o.length < 0)) {
var i = _.first(o),
a = t.indexOf(i);
0 > a && this.isLocaleSupported(i) && t.push(i)
}
}
},
isLocaleSupported: function(e) {
try {
return !!e && (!window.Intl || _.isArray(window.Intl.Collator.supportedLocalesOf([e]))) && !!N[e.replace("-", "_").toLowerCase()]
} catch (t) {
return !1
}
},
lng: function() {
var e = _.first(this._locales);
return N[e] || e
},
isRTL: function() {
return T.indexOf(_.first(this._locales)) >= 0
},
LR: function(e, t) {
return this.isRTL() ? t : e
},
curDir: function() {
return document.documentElement.getAttribute("dir") === S.RTL ? S.RTL : S.LTR
},
embedDir: function(e) {
var t = arguments.length <= 1 || void 0 === arguments[1] ? this.isRTL() : arguments[1];
return t ? this.embedRTL(e) : this.embedLTR(e)
},
forceDir: function(e) {
var t = arguments.length <= 1 || void 0 === arguments[1] ? this.isRTL() : arguments[1];
return t ? this.forceRTL(e) : this.forceLTR(e)
},
embedLTR: function(e) {
return "‪" + e + "‬"
},
embedRTL: function(e) {
return "‫" + e + "‬"
},
forceLTR: function(e) {
return "‎" + e
},
forceRTL: function(e) {
return "‏" + e
},
hasT: function(e, t) {
for (var r, n, o = t && t._plural ? t._plural : void 0, i = 0; i < this._locales.length; i++)
if (r = e + this.getPluralExt(this._locales[i], o), n = E[this._locales[i]], n[r]) return !0;
return !1
},
t: function(e, t) {
for (var r, n, o = "", i = t && t._plural ? t._plural : void 0, a = 0; a < this._locales.length && (r = e + this.getPluralExt(n = this._locales[a], i), !(o = E[n][r])); a++);
for (r in t) {
if (!t.hasOwnProperty(r)) return;
var s = new RegExp("__" + r + "__", "g"),
d = this.n(t[r], n);
o = o.replace(s, d)
}
return o
},
isHindiNumerals: function(e) {
return $.indexOf(e || this._locales[0]) > -1
},
n: function(e, t) {
return this.isHindiNumerals(t) ? e.toString().replace(/[0-9]/g, n) : e
},
numAndPunc: function(e) {
return this.isHindiNumerals() ? this.embedLTR(this.n(e).replace(/./g, this.forceLTR)) : e
},
filesize: function(e) {
return this.n(d(e, {
round: 0,
suffixes: {
B: this.t("filesize_byte"),
kB: this.t("filesize_kilobyte"),
MB: this.t("filesize_megabyte"),
GB: this.t("filesize_gigabyte")
}
}))
},
getPluralExt: function(e, t) {
if (!t) return "";
var r = c[e];
if (!r) return "";
var n = r.plurals(t),
o = r.numbers[n];
return 1 === o ? "" : 2 === r.numbers.length && 2 === o ? "_plural" : "_plural_" + o
},
removeAccents: function() {
var e = arguments.length <= 0 || void 0 === arguments[0] ? "" : arguments[0];
return h(e.normalize("NFKD").replace(l.mark, ""))
},
accentFold: function(e) {
return this.removeAccents(e).toLowerCase()
},
customizeMomentLocale: function() {
var e = {
"zh-tw": {
longDateFormat: {
LT: "Ah:mm",
LTS: "Ah:m:s",
L: "YYYY年MMMD日",
LL: "YYYY年MMMD日",
LLL: "YYYY年MMMD日LT",
LLLL: "YYYY年MMMD日ddddLT",
l: "YYYY年MMMD日",
ll: "YYYY年MMMD日",
lll: "YYYY年MMMD日LT",
llll: "YYYY年MMMD日ddddLT"
}
},
"zh-cn": {
longDateFormat: {
LT: "Ah:mm",
LTS: "Ah:m:s",
L: "YYYY-MM-DD",
LL: "YYYY年MMMD日",
LLL: "YYYY年MMMD日LT",
LLLL: "YYYY年MMMD日ddddLT",
l: "YYYY年MMMD日",
ll: "YYYY年MMMD日",
lll: "YYYY年MMMD日LT",
llll: "YYYY年MMMD日ddddLT"
}
},
ar: {
longDateFormat: {
LT: "HH:mm",
LTS: "HH:mm:ss",
L: "YYYY/MM/DD",
LL: "D MMMM YYYY",
LLL: "D MMMM YYYY LT",
LLLL: "dddd D MMMM YYYY LT"
}
}
};
return function(t) {
var r = e[t];
r && moment.locale(t, r)
}
}()
}
}, function(e, t) {
"use strict";
_.mixin({
forceArray: function(e) {
return _.isArray(e) ? e : [e]
}
})
}, function(e, t) {
"use strict";
! function() {
if ("performance" in window == !1 && (window.performance = {}), !("now" in window.performance)) {
var e = window.performance,
t = e.timing && e.timing.navigationStart ? e.timing.navigationStart : Date.now();
e.now = function() {
return Date.now() - t
}
}
}()
}, function(e, t, r) {
(function(t) {
"use strict";
function r(e, t) {
var r = this;
this._flags = 0, this._value = void 0, this._onFulfilled = void 0, this._onRejected = void 0, this._context = void 0, this._resolveLevel = 0, this._control = void 0, this.x = void 0, this._parent = void 0, this._child = void 0, this._children = void 0, this.control = void 0, t && (this._context = t["this"]), "function" == typeof e && (this._onFulfilled = e, this._flags |= Q, this._flags |= re, P(e, this._context, function(e) {
return S(r, 0, !0, !1, e)
}, function(e) {
return S(r, 0, !1, !1, e)
}))
}
function n(e) {
if (void 0 === e) return se;
if (w(e)) return e;
var t = new r;
return S(t, 0, !0, !1, e), t._flags |= ne, t
}
function o(e) {
var t = new r;
return t._value = e, t._flags |= z | ne, q.push(t), t
}
function i(e) {
return new r(function(t, r) {
function n(e) {
if (0 === --o) {
for (var r = [], n = 0; n < i.length; n++) {
var a = i[n];
r.push(a && a._flags & ie ? a._value : e)
}
t(r)
}
return e
}
var o = e.length;
if (0 === o) return void t([]);
for (var i = new Array(e.length), a = 0; a < e.length; a++) i[a] = E(e[a], n, r)
})
}
function a(e, t) {
this.errors = e || [], this.message = t || this.errors.length + " errors"
}
function s(e) {
var t = "";
if (e._flags & te) {
var r = e._onFulfilled || e._onRejected;
t = r.call(e._context, Y)
} else if (e._control) t = ".addRawControl(" + e._control.name + ", " + e._control.foo + ")";
else if (e._flags & J) t = ".endWithControls(" + Object.keys(e.control) + ")";
else if (e._flags & ne) t = e._flags & V ? "Promise.resolve(" + (void 0 === e._value ? "" : e._value) + ")" : "Promise.reject(" + (void 0 === e._value ? "" : e._value) + ")";
else if (e._flags & re) switch (e._flags & ie) {
case z:
t = "new Promise(" + e._onFulfilled + ")";
break;
case ae:
t = "new Promise(" + e._onFulfilled + ")";
break;
case V:
t = "new Promise(" + e._onFulfilled + ")"
} else e._onFulfilled && e._onRejected ? t = ".then(" + e._onFulfilled + ", " + e._onRejected + ")" : e._onFulfilled ? t = ".then(" + e._onFulfilled + ")" : e._onRejected && (t = ".catch(" + e._onRejected + ")");
return t
}
function d(e, t) {
return new r(function(r) {
var n = b(t);
w(n) && (n._flags |= X), setTimeout(r, e, n)
})
}
function c(e) {
this.message = e || "StackPromise timed out"
}
function u(e, t) {
var n = void 0;
if (arguments.length > 2) {
n = new Array(arguments.length - 2);
for (var o = 2; o < arguments.length; o++) n[o - 2] = arguments[o]
}
return new r(function(r) {
r(e.apply(t, n))
})
}
function l(e, t, r, n) {
this.name = e, this.foo = t, this.lightning = !!r, this.canRunMultipleTimes = !!n
}
function f(e, t) {
function n() {
for (var n = void 0, o = e._parent; o && !(o._flags & ie) && !(o._flags & J); o = o._parent) !o._control || o._control.name !== t || o._flags & Q || (n = o);
if (!n) return r.NO_ACTIVE_CONTROL;
n._control.canRunMultipleTimes || (n._flags |= Q);
var i = void 0;
if (arguments.length > 0) {
i = new Array(arguments.length);
for (var a = 0; a < arguments.length; a++) i[a] = arguments[a]
}
return n._control.foo.call(n._context, function(e) {
return N(n, n._resolveLevel, !0, !1, e)
}, function(e) {
return N(n, n._resolveLevel, !1, !1, e)
}, n._parent, i)
}
return n
}
function h(e) {
this.message = e, this.stack = new Error(e || this.name).stack
}
function p(e, t, r, n) {
t(new h(n && n[0]))
}
function m() {
0 === D && (B.length || q.length) && (D = 1, ce || (ce = g()), ce())
}
function g() {
var e = void 0,
r = void 0;
return "undefined" == typeof MutationObserver || window && window.navigator && window.navigator.standalone ? "function" == typeof t ? function() {
t(k)
} : function() {
setTimeout(k, 0)
} : (e = document.createElement("div"), r = new MutationObserver(k), r.observe(e, {
attributes: !0
}), function() {
e.setAttribute("tick", 1 & L)
})
}
function _(e) {
return e === Y ? ".tap()" : j
}
function v(e, t) {
e._flags |= X, t._parent = e, e._children ? e._children.push(t) : e._child ? (e._children = [e._child, t], e._child = void 0) : e._child = t
}
function y(e) {
if (e && ("object" == typeof e || "function" == typeof e)) {
var t = void 0;
try {
t = e.then
} catch (r) {
return G = r, F
}
if ("function" == typeof t) return t
}
}
function b(e) {
if (!e || w(e)) return e;
var t = y(e);
return t === F ? o(G) : t ? new r(function(r, n) {
t.call(e, r, n)
}) : e
}
function w(e) {
return e instanceof r
}
function E(e, t, r) {
e = b(e);
var i = w(e),
a = void 0,
s = void 0,
d = !1,
c = void 0;
if (i) {
if (!(e._flags & ie)) {
var u = e.then(t, r);
return u._synchronous |= Z, u
}
e._flags |= X, d = !!(e._flags & ee), c = e._context, a = e._flags & V ? t : r, s = e._value
} else a = t, s = e;
if (!a) return n(e).then();
s = M(a, c, s, !0);
var l = void 0;
if (s === F) l = o(G);
else {
if (s === W) return n(e).then(t, r);
if (s === j) return i ? e.then() : n(e);
l = n(s)
}
return d && (l = l.cancellable()), void 0 !== c && (l = l.bind(c)), l
}
function S(e, t, r, n, o) {
if (t === e._resolveLevel) {
var i = ++e._resolveLevel;
if (e._flags |= Q, !r) return void A(e, !1, n, o);
if (o === e) e._parent = void 0, A(e, !1, n, new TypeError("promise resolved to itself"));
else if (w(o)) {
var a = o._flags & ie;
a === ae ? v(o, e) : (e._parent = o, e._flags |= oe, o._flags |= X, A(e, a === V, n, o._value))
} else {
var s = y(o);
s === F ? (e._parent = void 0, A(e, !1, n, G)) : s ? (e._parent = void 0, P(s, o, function(t) {
return S(e, i, !0, !1, t)
}, function(t) {
return S(e, i, !1, !1, t)
})) : A(e, !0, n, o)
}
}
}
function N(e, t, r, n, o) {
if (t === e._resolveLevel) {
if (e._parent) {
var i = e._parent;
if (e._parent = void 0, i._child === e) i._child = void 0;
else if (i._children) {
for (var a = i._children, s = 0; s < a.length; s++)
if (a[s] === e) {
a.splice(s, 1);
break
}
0 === a.length && (i._children = void 0)
}
}
S(e, t, r, n, o)
}
}
function T(e) {
if (null === e || void 0 === e) throw new Error("Invalid .catch guard " + e);
if ("function" == typeof e) return e;
if ("object" == typeof e) throw new Error("Object guards in .catch are currently unsupported");
return function(t) {
return t === e
}
}
function $(e, t) {
for (var r = 0; r < e.length; r++) {
var n = e[r];
if (n === Error || n.prototype instanceof Error) {
if (t instanceof n) return !0
} else if (n(t)) return !0
}
return !1
}
function C(e, t) {
function r(r, n) {
return r === Y ? ".catch(..., " + t + ")" : e && !$(e, r) ? j : n ? W : t.call(this, r)
}
return r
}
function A(e, t, r, n) {
if (e._flags |= t ? V : z, e._flags |= Q, e._value = n, e._child) I(e._child, t, r, n, e), e._child = void 0;
else if (e._children) {
var o = e._children;
e._children = void 0;
for (var i = 0; i < o.length; i++) I(o[i], t, r, n, e)
} else t || e._flags & X || q.push(e)
}
function I(e, t, r, n, o) {
e._resolveLevel++;
var i = R(e, t);
if (i && e._flags & Z) {
e._flags |= Q;
var a = M(i, e._context, n, !0);
if (a !== W) return void(a === F ? (e._parent = void 0, A(e, !1, r, G)) : a === j ? A(e, t, r, n) : (e._parent = void 0, S(e, e._resolveLevel, !0, r, a)));
e._flags &= ~Q
}
i ? ((r ? x : B).push(e), m()) : A(e, t, r, n)
}
function O(e, t) {
for (; 0 !== e.length;) t.push(e.pop())
}
function k() {
for (; 0 !== U.length || 0 !== B.length;) {
0 === U.length && O(B, U);
var e = U.pop(),
t = e._parent,
n = !!(t && t._flags & V),
o = t && t._value,
i = R(e, n);
if (e._flags |= Q, i) {
var a = void 0;
do a = M(i, e._context, o, !1); while (a === W);
a === F ? (o = G, n = !1, e._parent = void 0) : a !== j && (o = a, n = !0, e._parent = void 0)
}
e._flags & ie || (S(e, e._resolveLevel, n, !0, o), O(x, U))
}
for (D--, L++; 0 !== q.length;) {
var s = q.pop();
s._flags & X || H.push(s)
}
for (; 0 !== K.length;) {
var d = K.pop();
d._flags & X || r.onPossiblyUnhandledRejection(d._value, d)
}
var c = K;
K = H, H = c
}
function P(e, t, r, n) {
try {
e.call(t, r, n)
} catch (o) {
n(o)
}
}
function R(e, t) {
return e._flags & Q ? void 0 : t ? e._onFulfilled : e._onRejected
}
function M(e, t, r, n) {
try {
return n ? e.call(t, r, !0) : e.call(t, r)
} catch (o) {
return G = o, F
}
}
var L = 0,
D = 0,
U = [],
B = [],
x = [],
j = {
sentinel: "CONTINUE_AS_IF_NO_HANDLER"
},
W = {
sentinel: "RETRY_ASYNCHRONOUSLY"
},
Y = {
sentinel: "TO_STRING"
},
F = {
sentinel: "DID_ERROR"
},
G = null,
q = [],
K = [],
H = [],
V = 1,
z = 2,
Q = 4,
X = 8,
J = 16,
Z = 32,
ee = 64,
te = 128,
re = 256,
ne = 512,
oe = 1024,
ie = V | z,
ae = 0,
se = void 0;
r.resolve = n, r.reject = o, r.prototype.then = function(e, t) {
"function" != typeof e && (e = void 0), "function" != typeof t && (t = void 0);
var n = new r;
n._onFulfilled = e, n._onRejected = t, n._context = this._context, this._flags & ee && (n._flags |= ee);
var o = this._flags & ie;
return o === ae ? v(this, n) : (this._flags |= X, (o === V ? e : t) ? (n._parent = this, B.push(n), m()) : (n._parent = this, n._flags |= o, n._value = this._value, o === z && q.push(n))), n
}, r.prototype["catch"] = function(e) {
var t = arguments.length - 1;
if (0 === t) return this.then(void 0, e);
for (var r = new Array(t), n = 0; t > n; n++) r[n] = T(arguments[n]);
var o = C(r, arguments[t]),
i = E(this, void 0, o);
return i._onRejected && (i._flags |= te), i
}, r.prototype.bind = function(e) {
var t = this.then();
return t._context = e, t
}, r.prototype.end = function(e) {
var t = this.then();
if (t._flags |= J, t.control = {}, t._context = void 0, e) {
var r = e.controls;
if (r)
for (var n = 0; n < r.length; n++) {
var o = r[n];
t.control[o] = f(t, o)
}
return t
}
}, r.prototype.endWithControls = function() {
var e = this.then();
e._flags |= J, e.control = {}, e._context = void 0;
for (var t = 0; t < arguments.length; t++) {
var r = arguments[t];
e.control[r] = f(e, r)
}
return e
}, r.all = i, r.any = function(e) {
return new r(function(t, r) {
function n(e) {
if (0 === --o) {
for (var t = [], n = 0; n < i.length; n++) {
var s = i[n];
t.push(s && s._flags & ie ? s._value : e)
}
r(new a(t))
}
return e
}
var o = e.length;
0 === o && r(new a([], "StackPromise.any called with []"));
for (var i = new Array(e.length), s = 0; s < e.length; s++) i[s] = E(e[s], t, n)
})
}, r.props = function(e) {
function t(e) {
for (var t = {}, r = 0; r < e.length; r++) t[n[r]] = e[r];
return t
}
var n = Object.keys(e),
o = r.all(n.map(function(t) {
return e[t]
}));
switch (o._flags & ie) {
case z:
return o;
case ae:
return o = o.then(t), o._flags |= Z, o;
case V:
return o._value = t(o._value), o
}
}, r.map = function(e, t) {
function r(e) {
return function(r) {
return o && t(r, e)
}
}
var o = !0,
a = i(e.map(function(e, t) {
return n(e).then(r(t))
}));
switch (a._flags & ie) {
case z:
o = !1;
break;
case ae:
a = a["catch"](function() {
return o = !1, j
}), a._flags |= Z;
break;
case V:
}
return a
}, r.reduce = function(e, t, r) {
return n(e).reduce(t, r)
}, r.prototype.reduce = function(e, t) {
return t = b(t), E(this, function(r, n) {
function o() {
for (var r = i.length;;) {
var n = c,
a = i[n];
if (w(a)) switch (a._flags & ie) {
case z:
return a;
case ae:
return a.then(o);
case V:
a = a._value
}
if (w(t)) switch (t._flags & ie) {
case z:
return t;
case ae:
return t.then(o);
case V:
t = t._value
}
var s = e.call(d, t, a, n, r);
if (++c === r) return s;
if (s = b(s), w(s)) switch (s._flags & ie) {
case z:
return s;
case ae:
return t = s, s.then(o);
case V:
s._flags |= X, t = s._value
} else t = s
}
}
if (0 === r.length) return t;
if (n) return W;
for (var i = new Array(r.length), a = 0; a < r.length; a++) {
var s = i[a] = b(r[a]);
w(s) && (s._flags |= X)
}
var d = this,
c = 0;
return o()
})
}, r.each = function(e, t) {
return n(e).each(t)
}, r.prototype.each = function(e) {
function t(t, n, o, i) {
return r.push(n), e.call(this, n, o, i)
}
var r = [];
return this.reduce(t)["return"](r)
}, r.mapSeries = function(e, t) {
return n(e).mapSeries(t)
}, r.prototype.mapSeries = function(e) {
function t(t, r, n, o) {
var i = b(e.call(this, r, n, o));
return w(i) ? i.then(function(e) {
return t.push(e), t
}) : (t.push(i), t)
}
return this.reduce(t, [])
}, r.race = function(e) {
var t = b(e);
if (w(t)) {
var n = t.then(function(e) {
return r.race(e)
});
return n._context = void 0, n._flags &= ~ee, n
}
return new r(function(e, r) {
for (var n = 0; n < t.length; n++) {
var o = b(t[n]);
if (!w(o) || o._flags & ie)
for (e(o), n++; n < t.length; n++) {
var i = t[n];
w(i) && (i._flags |= X)
} else o.then(e, r)
}
})
}, a.prototype = Object.create(Error.prototype, {
name: {
value: "AggregateError"
}
}), r.AggregateError = a, r.onPossiblyUnhandledRejection = function(e, t) {
console.error("StackPromise did not catch " + e, t, e)
}, r.prototype.toString = function() {
for (var e = [], t = void 0, r = this, n = !1; r; r = r._parent) {
t = r, !n && r._flags & ie && (n = !0, r._flags & ne || (r._flags & V ? e.push("[resolved value: " + r._value + "]") : e.push("[rejected reason: " + r._value + "]")));
var o = s(r);
r._flags & oe && (o = "~" + o), e.push(o)
}
return e.reverse(), t._flags & (ne | re) || (e[0] = "[Promise]" + e[0]), e.join("\n")
}, r.delay = d, r.prototype.delay = function(e) {
return this.then(function(t) {
return d(e, t)
})
}, r.prototype.timeout = function(e, t) {
function r(r) {
return r === Y ? ".timeout(" + e + ", " + t + ")" : (clearTimeout(n), j)
}
if ((this._flags & ie) !== ae) return this.then();
var n = void 0,
o = this.then(r, r);
return o._flags |= Z | te, n = setTimeout(function(e, t) {
if (!(e._flags & ie)) {
var r = t instanceof Error ? t : new c(t);
N(e, 0, !1, !1, r)
}
}, e, o, t), o
}, c.prototype = Object.create(Error.prototype, {
name: {
value: "TimeoutError"
}
}), r.TimeoutError = c, r.prototype.isFulfilled = function() {
return !!(this._flags & V)
}, r.prototype.isRejected = function() {
return !!(this._flags & z)
}, r.prototype.isPending = function() {
return !(this._flags & ie)
}, r.prototype.value = function() {
if (this._flags & V) return this._value;
throw new Error(this._flags & z ? "value() called on StackPromise that was rejected" : "value() called on StackPromise that is pending")
}, r.prototype.reason = function() {
if (this._flags & z) return this._value;
throw new Error(this._flags & V ? "reason() called on StackPromise that was fulfilled, not rejected" : "reason() called on StackPromise that is pending")
}, r.callSynchronously = u, r.wrap = function(e) {
return function() {
var t = this,
r = void 0;
if (arguments.length > 0) {
r = new Array(arguments.length);
for (var o = 0; o < arguments.length; o++) r[o] = arguments[o]
}
var i = function(n) {
return n === Y ? ".wrap(" + e + ").apply(" + t + ", [" + r + "])" : e.apply(t, r)
},
a = n().then(i);
return a._flags |= te, a
}
}, r.loop = function(e, t) {
return n(t).loop(e)
}, r.prototype.loop = function(e) {
var t = E(this.then(function(r) {
function n(r) {
return u(e, o, a, r, i++).then(function(e) {
return t._flags & ie ? void 0 : n(e)
})
}
var o = this,
i = 0,
a = function(e) {
return N(t, 0, !0, !1, e)
};
return n(r)
}), function(t) {
return t === Y ? ".loop(" + e + ")" : j
});
return t._flags |= te, t
}, r.prototype.checkpoint = function(e) {
return e = n(e), this.then(function(t) {
return e._flags & z ? e : t
})
}, r.prototype["finally"] = function(e) {
function t(t) {
return t === Y ? ".finally(" + e + ")" : (e.call(this, t), j)
}
var r = this.then(t, t);
return r._flags |= te, r
}, r.prototype.get = function(e) {
var t = this.then(function(t) {
return t === Y ? ".get('" + e + "')" : t[e]
});
return t._flags |= te, t
}, r.prototype.tap = function(e) {
function t(t) {
return t === Y ? ".tap(" + e + ")" : (e.call(this, t), j)
}
if ("function" != typeof e) {
var r = this.then(_);
return r._flags |= te, r
}
var n = this.then(t);
return n._flags |= te, n
}, r.prototype.spread = function(e) {
var t = this.then(function(t) {
return t === Y ? ".spread(" + e + ")" : e.apply(this, t)
});
return t._flags |= te, t
}, r.prototype["return"] = function(e) {
switch (this._flags & ie) {
case z:
return this.then();
case ae:
case V:
e = b(e), w(e) && (e._flags |= X);
var t = E(this, function(t) {
return t === Y ? ".return(" + e + ")" : e
});
return t._flags |= te, t
}
}, r.prototype["throw"] = function(e) {
return this["return"](o(e))
}, r.Control = l, r.NO_ACTIVE_CONTROL = new Error("No active control was found."), r.prototype.addControl = function(e) {
if (!(e instanceof l)) throw new Error("addControl must be given Control, but got " + e);
var t = this.then(e.lightning ? void 0 : _);
return t._control = e, t
}, r.prototype.addRawControl = function(e, t, r, n) {
return this.addControl(new l(e, t, r, n))
}, r.prototype.addResolveControl = function(e, t, r, n) {
function o(e, r, n, o) {
try {
e(t.apply(this, o))
} catch (i) {
r(i)
}
}
return this.addControl(new l(e, o, r, n))
}, r.prototype.addRejectControl = function(e, t, r, n) {
function o(e, r, n, o) {
try {
r(t.apply(this, o))
} catch (i) {
r(i)
}
}
return this.addControl(new l(e, o, r, n))
}, h.prototype = Object.create(Error.prototype, {
name: {
value: "CancellationError"
}
}), r.CancellationError = h;
var de = new l("cancel", p, !1, !1);
r.prototype.addCancelControl = function() {
var e = this.addControl(de);
return e._flags |= ee, e
}, r.sit = function(e, t) {
var n = new r;
return n._control = new l(e, function(e, r, n, o) {
e(t ? t.apply(void 0, o) : o && o[0])
}), n
}, r.prototype.cancellable = function() {
var e = this.then();
return e._flags |= ee, e
}, r.prototype.uncancellable = function() {
var e = this.then();
return e._flags &= ~ee, e
}, r.prototype.cancel = function(e) {
for (var t = void 0, r = this; r && !(r._flags & ie); r = r._parent) r._flags & ee && (t = r);
t && (void 0 === e && (e = new h), N(t, t._resolveLevel, !1, !1, e))
};
var ce = void 0;
se = new r, S(se, 0, !0, !1, void 0), e.exports = r
}).call(t, r(88).setImmediate)
}, function(e, t, r) {
e.exports = {
"default": r(388),
__esModule: !0
}
}, , , , , , , , , function(e, t, r) {
"use strict";
var n = r(5),
o = r(328),
i = r(93),
a = n.createClass({
displayName: "ConfirmPopup",
mixins: [i],
propTypes: {
classes: n.PropTypes.string,
onCancel: n.PropTypes.func,
cancelText: n.PropTypes.string,
onOK: n.PropTypes.func,
okText: n.PropTypes.string,
children: n.PropTypes.node.isRequired,
title: n.PropTypes.node,
a8n: n.PropTypes.string
},
getDefaultProps: function() {
return {
classes: "",
cancelText: l10n.t("web_cancel"),
okText: l10n.t("web_ok")
}
},
onOK: function(e) {
this.actionTriggered || (this.props.onOK(e), this.actionTriggered = !0)
},
onCancel: function(e) {
this.actionTriggered || (this.props.onCancel(e), this.actionTriggered = !0)
},
componentDidMount: function() {
if (this.props.onOK) {
var e = this;
this.regNativeListener(window, "keydown", function(t) {
13 === t.keyCode && (t.stopPropagation(), t.preventDefault(), e.props.onOK())
})
}
},
render: function() {
var e = this.props.onOK ? n.createElement("button", {
"data-a8n": o.key("popup-controls-ok"),
className: "btn-plain btn-default popup-controls-item",
onClick: this.onOK
}, this.props.okText) : null,
t = this.props.onCancel ? n.createElement("button", {
className: "btn-plain popup-controls-item",
onClick: this.onCancel
}, this.props.cancelText) : null,
r = this.props.title ? n.createElement("div", {
"data-a8n": o.key("popup-title"),
className: "popup-title"
}, this.props.title) : null;
return n.createElement("div", {
className: "backdrop"
}, n.createElement("div", {
className: "popup-container"
}, n.createElement("div", {
className: "popup " + this.props.classes
}, n.createElement("div", {
className: "popup-body"
}, r, n.createElement("div", {
"data-a8n": o.key("popup-contents"),
className: "popup-contents"
}, this.props.children)), n.createElement("div", {
className: "popup-controls"
}, t, e))))
}
});
e.exports = a
}, function(e, t, r) {
"use strict";
var n = r(1),
o = r(9),
i = r(332),
a = r(75),
s = r(331),
d = r(10),
c = r(18),
u = r(13),
l = {
QUERY: "QUERY",
FIND: "FIND",
UPDATE: "UPDATE"
},
f = {
NONE: "NONE",
LOAD: "LOAD"
},
h = s.extend(i, a, {
listenTo: function(e, t, r) {
if (!_.isObject(e) || _.isEmpty(t) || !_.isFunction(r)) {
var n = [];
throw _.isObject(e) || n.push("obj parameter is not an object"), _.isEmpty(t) && n.push("event is empty string"), _.isFunction(r) || n.push("callback is not a function"), new Error(n.join(", "))
}
s.prototype.listenTo.apply(this, arguments)
},
initialize: function(e) {
this._config = _.extend({
CachePolicy: {
id: void 0,
policy: f.NONE,
delay: 0
},
staleCollection: !1
}, e), this._inflight = {}, this.listenTo(this, "add remove reset sort", function() {
var e = this._last,
t = this.last();
(!e && t || e !== t) && (this._last = t, this.trigger("change:last", t));
var r = this._first,
n = this.first();
(!r && n || r !== n) && (this._first = n, this.trigger("change:first", n))
}), this._initializeFromCache(), this._config.staleCollection && this._initializeStaleCollection()
},
_initializeFromCache: function(e) {
var t = this._config.CachePolicy,
r = t.id,
o = t.policy,
i = t.delay,
a = t.trigger || "all";
this.listenTo(d, "change:stream", function() {
if (d.stream === d.STREAM.SYNCING) {
if (o === f.NONE) return void(_.isUndefined(r) || u.setCollection(r));
if (n.log("baseCollection:initFromCache load: " + r)(), this.add(u.getCollection(r)), !_.isNumber(i)) return;
this._saveToCache = _.debounce(this.saveToCache, i), this.listenTo(this, a, this._saveToCache), this.initializeFromCache()
}
})
},
initializeFromCache: function() {},
saveToCache: function() {
if (Store.Conn.me) {
var e = this._config.CachePolicy.id;
n.log("baseCollection:saveToCache save: " + e)(), u.setCollection(e, this.toJSON())
}
},
_initializeStaleCollection: function() {
var e = this;
this.listenTo(d, "change:stream", function() {
switch (d.stream) {
case d.STREAM.DISCONNECTED:
e.invoke("set", "stale", !0);
break;
case d.STREAM.RESUMING:
case d.STREAM.SYNCING:
break;
case d.STREAM.CONNECTED:
d.previousAttributes().stream === d.STREAM.RESUMING && _.isFunction(e.onResume) && e.onResume()
}
})
},
_query: function(e, t) {
var r = _.isString(t) ? t : JSON.stringify(t),
o = e === l.QUERY ? void 0 : this.get(t),
i = "force-" + r;
return (this._inflight[i] && e === l.FIND || e === l.UPDATE) && (r = i), this._inflight[r] ? o && e === l.FIND ? Promise.resolve(o) : this._inflight[r] : !o || o && o.stale || e === l.UPDATE ? this._inflight[r] = this._serverQuery(e, t).bind(this)["finally"](function() {
delete this._inflight[r]
})["catch"](c.WapDrop, function(e) {
throw n.warn(e.toString())(), e
})["catch"](_.isString, function(e) {
n.log("baseCollection:query query promise rejected: " + e)()
}) : Promise.resolve(o)
},
_serverQuery: function(e, t) {
var r;
r = e === l.UPDATE ? this._update(t) : e === l.FIND ? this._find(t) : this._findQuery(t);
var n = this;
return r.then(function(e) {
return n._config.staleCollection && _.each(_.compact(_.forceArray(e)), function(e) {
"undefined" == typeof e.stale && (e.stale = !1)
}), n.add(e, {
merge: !0
})
})
},
findQuery: function(e) {
return this._query(l.QUERY, e)
},
find: function(e) {
return e ? this._query(l.FIND, e) : (o.upload(n.trace("Called find without an id")), Promise.resolve())
},
update: function(e) {
return e ? this._query(l.UPDATE, e) : (o.upload(n.trace("Called update without an id")), Promise.resolve())
},
_update: function(e) {
return this._find(e)
},
handle: function(e) {
var t = this._handle(e.shift());
this._config.staleCollection && _.each(_.compact(_.forceArray(t)), function(e) {
e.stale = !1
}), this.add(t, {
merge: !0
})
},
gadd: function(e) {
if (_.isString(e) || _.isNumber(e)) {
var t = {};
return t[this.mainIndex] = e, this.get(e) || this.add(t, {
merge: !0
})
}
if (e && e[this.mainIndex]) return this.add(e, {
merge: !0
});
var r = _.findKey(Store, this) || "unknown";
throw new Error(r + ".gadd called without an id attr (" + this.mainIndex + ")")
},
"delete": function() {
this.stopListening(this, "all", this._saveToCache), _.invoke(this.models, "stopListening"), _.invoke(this.models, "cancelPendingPromises"), this._inflight = {}, this.reset()
},
isStateStale: function(e) {
var t = this.get(e);
return t && t.stale
}
});
h.CACHE_POLICY = f, e.exports = h
}, function(e, t) {
"use strict";
e.exports = {
key: function(e) {
var t = !1;
return t ? e : void 0
}
}
}, function(e, t, r) {
"use strict";
function n(e) {
var t = {};
return e.forEach(function(e) {
var r = e.split(""),
n = _.initial(r).join(""),
o = _.last(r);
(t[n] || (t[n] = {}))[o] = 1
}), _.keys(t).forEach(function(e) {
t[e] = i(_.keys(t[e]))
}), o(t)
}
function o(e) {
return _.map(_.keys(e).sort(function(e, t) {
return t.length - e.length
}), function(t) {
return _.escapeRegExp(t) + e[t]
}).join("|")
}
function i(e) {
if (1 === e.length) return _.escapeRegExp(e[0]);
e = e.sort();
for (var t = [], r = 0, n = e[r], o = e.length, i = 0; o >= i; i++) {
var a = e[i];
if (!a || a.charCodeAt(0) !== n.charCodeAt(0) + (i - r)) {
var s = e[i - 1];
s === n ? t.push(s) : t.push(n + "-" + s), r = i, n = a
}
}
return "[" + _.escapeRegExp(t.join("")) + "]"
}
function a() {
var e = Object.keys(T).concat(Object.keys(y), w);
try {
return new RegExp("(" + n(e) + ")", "g")
} catch (t) {
f.log("createRegexp Failed", e)()
}
}
function s() {
var e = Object.keys(T).concat(Object.keys(y), w);
try {
return new RegExp("(" + n(e) + ")")
} catch (t) {
f.log("createSingleRegexp Failed", e)()
}
}
var d = r(383),
c = r(382),
u = r(6),
l = r(39),
f = r(1),
h = null,
p = null,
m = {},
g = "□",
v = "🏻 🏼 🏽 🏾 🏿".split(/ /),
y = {
"︀": !0,
"︁": !0,
"︂": !0,
"︃": !0,
"︄": !0,
"︅": !0,
"︆": !0,
"︇": !0,
"︈": !0,
"︉": !0,
"︊": !0,
"︋": !0,
"︌": !0,
"︍": !0,
"︎": !0,
"️": !0
},
b = ["🇦", "🇧", "🇨", "🇩", "🇪", "🇫", "🇬", "🇭", "🇮", "🇯", "🇰", "🇱", "🇲", "🇳", "🇴", "🇵", "🇶", "🇷", "🇸", "🇹", "🇺", "🇻", "🇼", "🇽", "🇾", "🇿"],
w = [];
b.forEach(function(e) {
b.forEach(function(t) {
w.push(e + t)
})
});
var E = function(e, t) {
for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]);
return e
},
S = function(e) {
var t = {};
for (var r in e) e.hasOwnProperty(r) && (t[e[r]] = r);
return t
},
N = S(d),
T = E(E({}, c), d),
$ = {},
C = v[0];
_.keys(d).forEach(function(e) {
d[e + C] && ($[e] = e, v.map(function(t) {
$[e + t] = e
}))
});
var A = {
emojiIndex: _.memoize(function(e) {
return p || (p = s()), p.exec(e)
}),
containsEmoji: _.memoize(function(e) {
return h || (h = a()), h.test(e)
}),
normalizeEmoji: _.memoize(function(e) {
return h || (h = a()), e ? e.replace(h, function(e, t) {
if (y[t]) return "";
var r = T[t];
return N[r] || g
}) : ""
}),
codeToEmoji: S(T),
emojiToImage: _.memoize(function(e, t, r) {
r = r || "small";
var n = "small" === r ? "emoji" : "emojik";
if (y[e]) return null;
var o = m[e];
if (o) return o;
var i, a = T[e];
if (a) {
var s = N[a] || g,
d = document.createElement("img");
return d.alt = s, d.draggable = !1, d.className = l(n, "emoji" + a, t), d.src = u.ONE_BY_ONE_TRANS_GIF, d
}
return i = g, m[e] = i
}, function(e, t, r) {
return "t:" + (e || "") + "c:" + (t || "") + "s:" + (r || "small")
}),
emojiToHTML: _.memoize(function(e, t, r) {
h || (h = a()), r = r || "small";
var n = "small" === r ? "emoji" : "emojik";
return e ? e.replace(h, function(e, r) {
if (y[r]) return "";
var o = m[r];
if (o) return o;
var i, a = T[r];
if (a) {
var s = N[a] || g,
d = document.createElement("img");
return d.alt = s, d.draggable = !1, d.className = l(n, "emoji" + a, t), d.src = u.ONE_BY_ONE_TRANS_GIF, d.outerHTML
}
return i = g, m[r] = i
}) : ""
}, function(e, t, r) {
return "t:" + (e || "") + "c:" + (t || "") + "s:" + (r || "small")
}),
NodeToEmoji: function(e) {
for (var t = [""], r = 0, n = e.firstChild; null !== n;) {
if (1 === n.nodeType) switch (n.tagName) {
case "P":
case "PRE":
case "DIV":
t.push(""), r++;
break;
case "IMG":
t[r] += n.getAttribute("alt");
break;
case "BR":
t[r] += "\n"
} else 3 === n.nodeType && (t[r] += n.nodeValue);
if (n.hasChildNodes()) n = n.firstChild;
else {
for (; null === n.nextSibling;) {
if (n = n.parentNode, n === e) return t.join("\n");
switch (n.tagName) {
case "P":
case "PRE":
case "DIV":
t.push(""), r++
}
}
n = n.nextSibling
}
}
return t.join("\n")
},
emojiMap: T,
skinToneEmojis: $,
skinToneVariations: v
};
e.exports = A
}, function(e, t, r) {
"use strict";
var n = r(5),
o = r(24),
i = r(141),
a = r(144),
s = r(93),
d = r(39),
c = r(70),
u = r(136),
l = u.HotKeys,
f = {
X: {
LEFT: "left",
RIGHT: "right"
},
Y: {
TOP: "top",
BOTTOM: "bottom"
}
},
h = {
DROPDOWN: "dropdown",
DROPDOWN_MENU: "dropdown_menu",
MENU: "menu",
PICKER: "picker",
EMOJI_PICKER: "emoji_picker"
},
p = n.createClass({
displayName: "Menu",
mixins: [s],
propTypes: {
children: n.PropTypes.node.isRequired,
origin: n.PropTypes.shape({
x: n.PropTypes.number,
y: n.PropTypes.number
}),
type: n.PropTypes.oneOf(_.values(h)).isRequired,
direction: n.PropTypes.shape({
x: n.PropTypes.oneOf(_.values(f.X)),
y: n.PropTypes.oneOf(_.values(f.Y))
}).isRequired,
flipOnRTL: n.PropTypes.bool,
classes: n.PropTypes.string,
onDefault: n.PropTypes.func
},
statics: {
Direction: f,
Type: h
},
getDefaultProps: function() {
return {
type: h.DROPDOWN,
direction: {
x: f.X.RIGHT,
y: f.Y.BOTTOM
}
}
},
getInitialState: function() {
return {
hasKeyboard: !_.contains([h.MENU, h.EMOJI_PICKER], this.props.type),
showShortcuts: !1,
keyboard: !1,
selected: void 0
}
},
componentDidMount: function() {
this.state.hasKeyboard && c.focusNode(o.findDOMNode(this))
},
onMouseMove: function(e) {
c.focusNode(o.findDOMNode(this)), this.setState({
keyboard: !1
})
},
getStyle: function() {
var e = this.props,
t = {},
r = e.direction.x,
n = e.direction.y;
this.props.flipOnRTL && l10n.isRTL() && (r = r === f.X.LEFT ? f.X.RIGHT : f.X.LEFT);
var o = r === f.X.RIGHT ? f.X.LEFT : f.X.RIGHT,
a = n === f.Y.TOP ? f.Y.BOTTOM : f.Y.TOP;
return t[i.prefix("transformOrigin")] = a + " " + o, e.origin ? (r === f.X.RIGHT ? t.left = e.origin.x : t.right = window.innerWidth - e.origin.x, n === f.Y.BOTTOM ? t.top = e.origin.y : t.bottom = window.innerHeight - e.origin.y, _.merge(t, e.style)) : _.merge(t, e.style)
},
onKeyDown: function(e) {
e.metaKey && this.setState({
showShortcuts: !0
})
},
onKeyUp: function(e) {
this.state.showShortcuts && !e.metaKey && this.setState({
showShortcuts: !1
})
},
up: function(e) {
e.preventDefault(), e.stopPropagation();
var t = _.toArray(this.props.children),
r = a.ring(_.indexOf(t, this.state.selected) - 1, t);
c.focusNode(o.findDOMNode(this.refs.list).children[r]), this.setState({
keyboard: !0,
selected: t[r]
})
},
down: function(e) {
e.preventDefault(), e.stopPropagation();
var t = _.toArray(this.props.children),
r = a.ring(_.indexOf(t, this.state.selected) + 1, t);
c.focusNode(o.findDOMNode(this.refs.list).children[r]), this.setState({
keyboard: !0,
selected: t[r]
})
},
close: function(e) {
e.preventDefault(), c.pop()
},
"default": function(e) {
this.props.onDefault && (l.flashFocus = Date.now(), c.pop(c.MENU), this.props.onDefault(e))
},
render: function() {
var e = this.props,
t = d(e.classes, {
dropdown: e.type === h.DROPDOWN,
"dropdown dropdown-right": e.type === h.DROPDOWN_MENU,
"menu menu-icons": e.type === h.MENU,
"dropdown-picker k context-menu": e.type === h.PICKER,
"dropdown dropdown-emoji": e.type === h.EMOJI_PICKER,
inverse: (e.type === h.PICKER || e.type === h.EMOJI_PICKER) && e.direction.x === f.X.LEFT,
"inverse-vertical": e.type === h.EMOJI_PICKER && e.direction.y === f.Y.TOP,
"shortcut-active": this.state.showShortcuts
}),
r = this.state.hasKeyboard ? n.createElement("ul", {
ref: "list"
}, e.children) : e.children,
o = _.contains([h.PICKER, h.EMOJI_PICKER], e.type) ? n.createElement("div", {
className: "nib"
}) : null;
if (this.state.hasKeyboard) {
var i = {
up: this.up,
down: this.down,
enter: this["default"]
};
return i[l10n.LR("left", "right")] = this.close, i[l10n.LR("right", "left")] = this["default"], n.createElement(l, {
handlers: i,
className: t,
style: this.getStyle(),
onMouseMove: this.state.keyboard ? this.onMouseMove : null
}, r, o)
}
return n.createElement("div", {
className: t,
style: this.getStyle()
}, r, o)
}
});
e.exports = p
}, , function(e, t) {
"use strict";
var r = [].slice,
n = {},
o = ["first", "last", "partition", "contains", "toArray", "invoke", "pluck", "filter", "any"];
_.each(o, function(e) {
if (!_[e]) throw new Error("attempt to reference non-existant _ method: " + e);
n[e] = function() {
var t = r.call(arguments);
return t.unshift(this.models), _[e].apply(_, t)
}
});
var i = ["groupBy", "countBy", "sortBy", "indexBy"];
_.each(i, function(e) {
if (!_[e]) throw new Error("attempt to reference non-existant _ method: " + e);
n[e] = function(t, r) {
var n = _.isFunction(t) ? t : function(e) {
return e.get ? e.get(t) : e[t]
};
return _[e](this.models, n, r)
}
}), n.where = function(e, t) {
return _.isEmpty(e) ? t ? void 0 : [] : this[t ? "find" : "filter"](function(t) {
var r;
for (var n in e)
if (r = t.get ? t.get(n) : t[n], e[n] !== r) return !1;
return !0
})
}, n.findWhere = function(e) {
return this.where(e, !0)
}, e.exports = n
}, function(e, t, r) {
"use strict";
var n = r(52),
o = n.extend({
Collection: "Status",
props: {
id: "string",
status: "string"
},
session: {
stale: ["boolean", !1, !0]
}
});
e.exports = o
}, function(e, t) {
"use strict";
e.exports = _.memoize(function(e) {
return CryptoJS.MD5(e).toString(CryptoJS.enc.Base64)
})
}, function(e, t, r) {
"use strict";
var n = r(5),
o = r(6),
i = r(1),
a = r(30),
s = r(52),
d = r(71),
c = r(18),
u = r(51),
l = r(19),
f = r(8),
h = r(73).ActionToast,
p = r(73).ActionType,
m = s.extend({
Collection: "ProfilePicThumb",
props: {
id: "string",
tag: "string",
raw: "string"
},
session: {
stale: ["boolean", !1, !0]
},
derived: {
img: {
deps: ["tag", "raw", "stale"],
fn: function() {
if (this.raw) return "data:image/jpeg;base64," + this.raw;
if (!this.tag && this.stale) return null;
if (this.tag) return u.build(o.PP_URL, {
t: "s",
u: this.id,
i: this.tag
})
}
},
imgFull: {
deps: ["tag", "raw", "stale"],
fn: function() {
if ((this.raw || !this.tag) && this.stale) return null;
if (!this.raw && this.tag) return u.build(o.PP_URL, {
t: "l",
u: this.id,
i: this.tag
})
}
}
},
canSet: function() {
return l.isGroup(this.id) && d.supportsFeature(d.F.GROUP_SET_PIC) ? !0 : !(!l.isUser(this.id) || this.id !== Store.Conn.me || !d.supportsFeature(d.F.SET_PROFILE_PIC))
},
setPicture: function(e, t, r) {
var o = this;
if (!this.canSet()) return Promise.reject(new c.ActionError);
var s = a.sendSetPicture(this.id, e, t),
d = new p(this.id === Store.Conn.me ? l10n.t("action_profile_setting") : l10n.t("action_group_icon_setting"));
r = r || h.genId();
var u = s["catch"](function(e) {
throw i.error("models:ProfilePicThumb:setPicture dropped")(e), new p(o.id === Store.Conn.me ? l10n.t("action_profile_set_failed") : l10n.t("action_group_icon_set_failed"))
}).then(function(n) {
if (200 === n.status) return new p(o.id === Store.Conn.me ? l10n.t("action_profile_set") : l10n.t("action_group_icon_set"));
if (n.status >= 400) {
var i = o.id === Store.Conn.me ? l10n.t("action_profile_set_failed") : l10n.t("action_group_icon_set_failed");
return new p(i, l10n.t("action_try_again"), o.setPicture.bind(o, e, t, r))
}
});
return f.openToast(n.createElement(h, {
id: r,
initialAction: d,
pendingAction: u
})), s.bind(this).then(function(e) {
200 !== e.status || e._duplicate || (this.tag = e.tag)
})
},
canDelete: function() {
return l.isGroup(this.id) && d.supportsFeature(d.F.GROUP_SET_PIC) && this.tag ? !0 : !!(l.isUser(this.id) && this.id === Store.Conn.me && d.supportsFeature(d.F.SET_PROFILE_PIC) && this.tag)
},
deletePicture: function(e) {
var t = this;
if (!this.canDelete()) return Promise.reject(new c.ActionError);
var r = a.deletePicture(this.id),
o = new p(this.id === Store.Conn.me ? l10n.t("action_profile_removing") : l10n.t("action_group_icon_removing"));
e = e || h.genId();
var s = r["catch"](function(e) {
throw i.error("models:ProfilePicThumb:deletePicture dropped")(e), new p(t.id === Store.Conn.me ? l10n.t("action_profile_remove_failed") : l10n.t("action_group_icon_remove_failed"))
}).then(function(r) {
if (200 === r.status) return new p(t.id === Store.Conn.me ? l10n.t("action_profile_removed") : l10n.t("action_group_icon_removed"));
if (r.status >= 400) {
var n = t.id === Store.Conn.me ? l10n.t("action_profile_remove_failed") : l10n.t("action_group_icon_remove_failed");
return new p(n, l10n.t("action_try_again"), t.deletePicture.bind(t, e))
}
});
return f.openToast(n.createElement(h, {
id: e,
initialAction: o,
pendingAction: s
})), r.bind(this).then(function(e) {
200 !== e.status || e._duplicate || (this.tag = void 0)
})
}
});
e.exports = m
}, function(e, t, r) {
"use strict";
function n(e) {
return "string" == typeof e ? e : CryptoJS.lib.WordArray.create(new Uint8Array(e))
}
function o(e, t) {
return d.decode(e.toString(CryptoJS.enc.Base64), !!t)
}
function i(e) {
var t = arguments.length <= 1 || void 0 === arguments[1] ? new Uint8Array(c) : arguments[1],
r = arguments[2];
return o(CryptoJS.HmacSHA256(n(e), n(t)), r)
}
function a(e, t, r, i) {
if (0 > r || r > 255 * c) return null;
var a = n(e),
s = n(t),
d = Math.ceil(r / c),
u = new Array(d + 1);
u[0] = "";
for (var l = new Uint8Array(1), f = 0; d > f; f++) {
l[0] = f + 1;
var h = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, a);
h.update(u[f]), h.update(s), h.update(n(l)), u[f + 1] = h.finalize()
}
for (var p = new Uint8Array(r), m = 0, g = 0; d > m; m++)
for (var _ = o(u[m + 1]), v = 0; c > v && r > g; v++, g++) p[g] = _[v];
return i ? Array.prototype.slice.call(p) : p
}
function s(e, t, r, n, o) {
return a(i(e, t), r, n, o)
}
var d = r(146),
c = 32;
e.exports = {
extract: i,
expand: a,
extractAndExpand: s
}
}, function(e, t, r) {
"use strict";
function n(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
function o(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}
function i(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
var a = function() {
function e(e, t) {
for (var r = 0; r < t.length; r++) {
var n = t[r];
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n)
}
}
return function(t, r, n) {
return r && e(t.prototype, r), n && e(t, n), t
}
}(),
s = function g(e, t, r) {
null === e && (e = Function.prototype);
var n = Object.getOwnPropertyDescriptor(e, t);
if (void 0 === n) {
var o = Object.getPrototypeOf(e);
return null === o ? void 0 : g(o, t, r)
}
if ("value" in n) return n.value;
var i = n.get;
if (void 0 !== i) return i.call(r)
},
d = r(1),
c = r(147),
u = r(6),
l = r(329),
f = r(378),
h = r(51),
p = r(8),
m = function(e) {
function t() {
var e;
n(this, t);
for (var r = arguments.length, i = Array(r), a = 0; r > a; a++) i[a] = arguments[a];
return o(this, (e = Object.getPrototypeOf(t)).call.apply(e, [this].concat(i)))
}
return i(t, e), a(t, [{
key: "setTitleAndIcon",
value: function(e) {
switch (e) {
case -1:
case 0:
document.title = l10n.t("whatsapp_web");
break;
default:
document.title = "(" + l10n.n(e) + ") " + l10n.t("whatsapp_web")
}
this.setIcon(e)
}
}, {
key: "setIcon",
value: function(e) {
var t;
t = -1 === e ? "favicon-error2" : 0 === e ? "favicon" : 10 > e ? "f0" + e : 100 > e ? "f" + e : "f00";
var r = "/img/favicon/1x/" + t + ".png",
n = "/img/favicon/2x/" + t + ".png",
o = {
low: {
"default": r
},
high: {
"default": n
},
onSet: function(e) {
var t = document.getElementById("favicon");
t || (t = document.createElement("link"), t.id = "favicon", t.rel = "shortcut icon", document.head.appendChild(t)), t.href = e, t.type = "image/png"
}
};
c.loadAsset(o, t).then(function() {
d.log("Favicon updated: " + t)()
})
}
}, {
key: "showNotification",
value: function(e, r, n, o, i, a) {
var c, f = this;
try {
c = new window.Notification(l.normalizeEmoji(n), {
body: l.normalizeEmoji(o),
tag: a ? r : e,
icon: h.relToAbs(i),
dir: "auto",
lang: l10n.lng(),
silent: !0
})
} catch (m) {
window.Notification = void 0
}
if (!c) return void d.log("notificationManager:showDesktopNotification: could not create Notification")();
s(Object.getPrototypeOf(t.prototype), "showNotification", this).call(this, e, r, c);
var g = function v() {
window.removeEventListener("unload", v), f.closeNotification(r)
};
c.onclick = function() {
window.focus(), Store.Chat.find(e).then(function(e) {
p.openChat(e, void 0, !0)
}), g()
}, c.onclose = g, c.onshow = function() {
_.delay(g, a ? u.CALL_NOTIFICATION_TIMEOUT : u.NOTIFICATION_TIMEOUT)
}, _.delay(g, a ? u.CALL_NOTIFICATION_TIMEOUT : 5 * u.NOTIFICATION_TIMEOUT), window.addEventListener("unload", g)
}
}]), t
}(f);
e.exports = new m
}, , function(e, t, r) {
var n, o;
(function(e) {
/**
* @license Long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
* Released under the Apache License, Version 2.0
* Derived from goog.math.Long from the Closure Library
* see: https://github.com/dcodeIO/Long.js for details
*/
! function(i) {
"use strict";
var a = function(e, t, r) {
e && "object" == typeof e && (t = e.high, r = e.unsigned, e = e.low), this.low = 0 | e, this.high = 0 | t, this.unsigned = !!r
},
s = {},
d = {};
a.fromInt = function(e, t) {
var r, n;
return t ? (e >>>= 0, e >= 0 && 256 > e && (n = d[e]) ? n : (r = new a(e, 0 > (0 | e) ? -1 : 0, !0), e >= 0 && 256 > e && (d[e] = r), r)) : (e = 0 | e, e >= -128 && 128 > e && (n = s[e]) ? n : (r = new a(e, 0 > e ? -1 : 0, !1), e >= -128 && 128 > e && (s[e] = r), r))
}, a.fromNumber = function(e, t) {
return t = !!t, isNaN(e) || !isFinite(e) ? a.ZERO : !t && -f >= e ? a.MIN_SIGNED_VALUE : t && 0 >= e ? a.MIN_UNSIGNED_VALUE : !t && e + 1 >= f ? a.MAX_SIGNED_VALUE : t && e >= l ? a.MAX_UNSIGNED_VALUE : 0 > e ? a.fromNumber(-e, !1).negate() : new a(e % u | 0, e / u | 0, t)
}, a.fromBits = function(e, t, r) {
return new a(e, t, r)
}, a.from28Bits = function(e, t, r, n) {
return a.fromBits(e | t << 28, t >>> 4 | r << 24, n)
}, a.fromString = function(e, t, r) {
if (0 == e.length) throw new Error("number format error: empty string");
if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e) return a.ZERO;
if ("number" == typeof t && (r = t, t = !1), r = r || 10, 2 > r || r > 36) throw new Error("radix out of range: " + r);
if ("-" == e.charAt(0)) return a.fromString(e.substring(1), t, r).negate();
if (e.indexOf("-") >= 0) throw new Error('number format error: interior "-" character: ' + e);
for (var n = a.fromNumber(Math.pow(r, 8)), o = a.ZERO, i = 0; i < e.length; i += 8) {
var s = Math.min(8, e.length - i),
d = parseInt(e.substring(i, i + s), r);
if (8 > s) {
var c = a.fromNumber(Math.pow(r, s));
o = o.multiply(c).add(a.fromNumber(d))
} else o = o.multiply(n), o = o.add(a.fromNumber(d))
}
return o.unsigned = t, o
};
var c = 65536,
u = c * c,
l = u * u,
f = l / 2,
h = a.fromInt(1 << 24);
a.ZERO = a.fromInt(0), a.UZERO = a.fromInt(0, !0), a.ONE = a.fromInt(1), a.UONE = a.fromInt(1, !0), a.NEG_ONE = a.fromInt(-1), a.MAX_SIGNED_VALUE = a.fromBits(-1, 2147483647, !1), a.MAX_UNSIGNED_VALUE = a.fromBits(-1, -1, !0), a.MAX_VALUE = a.MAX_SIGNED_VALUE, a.MIN_SIGNED_VALUE = a.fromBits(0, -2147483648, !1), a.MIN_UNSIGNED_VALUE = a.fromBits(0, 0, !0), a.MIN_VALUE = a.MIN_SIGNED_VALUE, a.prototype.toInt = function() {
return this.unsigned ? this.low >>> 0 : this.low
}, a.prototype.toNumber = function() {
return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
}, a.prototype.toString = function(e) {
if (e = e || 10, 2 > e || e > 36) throw new Error("radix out of range: " + e);
if (this.isZero()) return "0";
var t;
if (this.isNegative()) {
if (this.equals(a.MIN_SIGNED_VALUE)) {
var r = a.fromNumber(e),
n = this.div(r);
return t = n.multiply(r).subtract(this), n.toString(e) + t.toInt().toString(e)
}
return "-" + this.negate().toString(e)
}
var o = a.fromNumber(Math.pow(e, 6));
t = this;
for (var i = "";;) {
var s = t.div(o),
d = t.subtract(s.multiply(o)).toInt(),
c = d.toString(e);
if (t = s, t.isZero()) return c + i;
for (; c.length < 6;) c = "0" + c;
i = "" + c + i
}
}, a.prototype.getHighBits = function() {
return this.high
}, a.prototype.getHighBitsUnsigned = function() {
return this.high >>> 0
}, a.prototype.getLowBits = function() {
return this.low
}, a.prototype.getLowBitsUnsigned = function() {
return this.low >>> 0
}, a.prototype.getNumBitsAbs = function() {
if (this.isNegative()) return this.equals(a.MIN_SIGNED_VALUE) ? 64 : this.negate().getNumBitsAbs();
for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--);
return 0 != this.high ? t + 33 : t + 1
}, a.prototype.isZero = function() {
return 0 == this.high && 0 == this.low
}, a.prototype.isNegative = function() {
return !this.unsigned && this.high < 0
}, a.prototype.isOdd = function() {
return 1 == (1 & this.low)
}, a.prototype.isEven = function() {
return 0 == (1 & this.low)
}, a.prototype.equals = function(e) {
return this.unsigned != e.unsigned && this.high >>> 31 != e.high >>> 31 ? !1 : this.high == e.high && this.low == e.low
}, a.prototype.notEquals = function(e) {
return !this.equals(e)
}, a.prototype.lessThan = function(e) {
return this.compare(e) < 0
}, a.prototype.lessThanOrEqual = function(e) {
return this.compare(e) <= 0
}, a.prototype.greaterThan = function(e) {
return this.compare(e) > 0
}, a.prototype.greaterThanOrEqual = function(e) {
return this.compare(e) >= 0
}, a.prototype.compare = function(e) {
if (this.equals(e)) return 0;
var t = this.isNegative(),
r = e.isNegative();
return t && !r ? -1 : !t && r ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high == this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.subtract(e).isNegative() ? -1 : 1
}, a.prototype.negate = function() {
return !this.unsigned && this.equals(a.MIN_SIGNED_VALUE) ? a.MIN_SIGNED_VALUE : this.not().add(a.ONE)
}, a.prototype.add = function(e) {
var t = this.high >>> 16,
r = 65535 & this.high,
n = this.low >>> 16,
o = 65535 & this.low,
i = e.high >>> 16,
s = 65535 & e.high,
d = e.low >>> 16,
c = 65535 & e.low,
u = 0,
l = 0,
f = 0,
h = 0;
return h += o + c, f += h >>> 16, h &= 65535, f += n + d, l += f >>> 16, f &= 65535, l += r + s, u += l >>> 16, l &= 65535, u += t + i, u &= 65535, a.fromBits(f << 16 | h, u << 16 | l, this.unsigned)
}, a.prototype.subtract = function(e) {
return this.add(e.negate())
}, a.prototype.multiply = function(e) {
if (this.isZero()) return a.ZERO;
if (e.isZero()) return a.ZERO;
if (this.equals(a.MIN_VALUE)) return e.isOdd() ? a.MIN_VALUE : a.ZERO;
if (e.equals(a.MIN_VALUE)) return this.isOdd() ? a.MIN_VALUE : a.ZERO;
if (this.isNegative()) return e.isNegative() ? this.negate().multiply(e.negate()) : this.negate().multiply(e).negate();
if (e.isNegative()) return this.multiply(e.negate()).negate();
if (this.lessThan(h) && e.lessThan(h)) return a.fromNumber(this.toNumber() * e.toNumber(), this.unsigned);
var t = this.high >>> 16,
r = 65535 & this.high,
n = this.low >>> 16,
o = 65535 & this.low,
i = e.high >>> 16,
s = 65535 & e.high,
d = e.low >>> 16,
c = 65535 & e.low,
u = 0,
l = 0,
f = 0,
p = 0;
return p += o * c, f += p >>> 16, p &= 65535, f += n * c, l += f >>> 16, f &= 65535, f += o * d, l += f >>> 16, f &= 65535, l += r * c, u += l >>> 16, l &= 65535, l += n * d, u += l >>> 16, l &= 65535, l += o * s, u += l >>> 16, l &= 65535, u += t * c + r * d + n * s + o * i, u &= 65535, a.fromBits(f << 16 | p, u << 16 | l, this.unsigned)
}, a.prototype.div = function(e) {
if (e.isZero()) throw new Error("division by zero");
if (this.isZero()) return this.unsigned ? a.UZERO : a.ZERO;
var t, r, n;
if (this.equals(a.MIN_SIGNED_VALUE)) {
if (e.equals(a.ONE) || e.equals(a.NEG_ONE)) return a.MIN_SIGNED_VALUE;
if (e.equals(a.MIN_SIGNED_VALUE)) return a.ONE;
var o = this.shiftRight(1);
return t = o.div(e).shiftLeft(1), t.equals(a.ZERO) ? e.isNegative() ? a.ONE : a.NEG_ONE : (r = this.subtract(e.multiply(t)), n = t.add(r.div(e)))
}
if (e.equals(a.MIN_SIGNED_VALUE)) return this.unsigned ? a.UZERO : a.ZERO;
if (this.isNegative()) return e.isNegative() ? this.negate().div(e.negate()) : this.negate().div(e).negate();
if (e.isNegative()) return this.div(e.negate()).negate();
for (n = a.ZERO, r = this; r.greaterThanOrEqual(e);) {
t = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
for (var i = Math.ceil(Math.log(t) / Math.LN2), s = 48 >= i ? 1 : Math.pow(2, i - 48), d = a.fromNumber(t, this.unsigned), c = d.multiply(e); c.isNegative() || c.greaterThan(r);) t -= s, d = a.fromNumber(t, this.unsigned), c = d.multiply(e);
d.isZero() && (d = a.ONE), n = n.add(d), r = r.subtract(c)
}
return n
}, a.prototype.modulo = function(e) {
return this.subtract(this.div(e).multiply(e))
}, a.prototype.not = function() {
return a.fromBits(~this.low, ~this.high, this.unsigned)
}, a.prototype.and = function(e) {
return a.fromBits(this.low & e.low, this.high & e.high, this.unsigned)
}, a.prototype.or = function(e) {
return a.fromBits(this.low | e.low, this.high | e.high, this.unsigned)
}, a.prototype.xor = function(e) {
return a.fromBits(this.low ^ e.low, this.high ^ e.high, this.unsigned)
}, a.prototype.shiftLeft = function(e) {
if (e &= 63, 0 == e) return this;
var t = this.low;
if (32 > e) {
var r = this.high;
return a.fromBits(t << e, r << e | t >>> 32 - e, this.unsigned)
}
return a.fromBits(0, t << e - 32, this.unsigned)
}, a.prototype.shiftRight = function(e) {
if (e &= 63, 0 == e) return this;
var t = this.high;
if (32 > e) {
var r = this.low;
return a.fromBits(r >>> e | t << 32 - e, t >> e, this.unsigned)
}
return a.fromBits(t >> e - 32, t >= 0 ? 0 : -1, this.unsigned)
}, a.prototype.shiftRightUnsigned = function(e) {
if (e &= 63, 0 == e) return this;
var t = this.high;
if (32 > e) {
var r = this.low;
return a.fromBits(r >>> e | t << 32 - e, t >>> e, this.unsigned)
}
return 32 == e ? a.fromBits(t, 0, this.unsigned) : a.fromBits(t >>> e - 32, 0, this.unsigned)
}, a.prototype.toSigned = function() {
var e = this.clone();
return e.unsigned = !1, e
}, a.prototype.toUnsigned = function() {
var e = this.clone();
return e.unsigned = !0, e
}, a.prototype.clone = function() {
return new a(this.low, this.high, this.unsigned)
}, "undefined" != typeof e && e.exports ? e.exports = a : r(590).amd ? (n = [], o = function() {
return a
}.apply(t, n), !(void 0 !== o && (e.exports = o))) : (i.dcodeIO || (i.dcodeIO = {}), i.dcodeIO.Long = a)
}(this)
}).call(t, r(50)(e))
}, function(e, t, r) {
function n(e) {
return r(o(e))
}
function o(e) {
var t = i[e];
if (!(t + 1)) throw new Error("Cannot find module '" + e + "'.");
return t
}
var i = {
"./af/translation.json": 593,
"./ak/translation.json": 594,
"./ar/translation.json": 595,
"./az/translation.json": 596,
"./be/translation.json": 597,
"./bg/translation.json": 598,
"./bn/translation.json": 599,
"./bs/translation.json": 600,
"./ca/translation.json": 601,
"./cs/translation.json": 602,
"./da/translation.json": 603,
"./de/translation.json": 604,
"./el/translation.json": 605,
"./en/translation.json": 606,
"./es/translation.json": 607,
"./et/translation.json": 608,
"./eu/translation.json": 609,
"./fa/translation.json": 610,
"./fi/translation.json": 611,
"./fil/translation.json": 612,
"./fr/translation.json": 613,
"./gl/translation.json": 614,
"./gu/translation.json": 615,
"./ha/translation.json": 616,
"./he/translation.json": 617,
"./hi/translation.json": 618,
"./hr/translation.json": 619,
"./hu/translation.json": 620,
"./id/translation.json": 621,
"./is/translation.json": 622,
"./it/translation.json": 623,
"./ja/translation.json": 624,
"./ka/translation.json": 625,
"./kk/translation.json": 626,
"./km/translation.json": 627,
"./kn/translation.json": 628,
"./ko/translation.json": 629,
"./ky/translation.json": 630,
"./lo/translation.json": 631,
"./lt/translation.json": 632,
"./lv/translation.json": 633,
"./mk/translation.json": 634,
"./ml/translation.json": 635,
"./mr/translation.json": 636,
"./ms/translation.json": 637,
"./my/translation.json": 638,
"./nb/translation.json": 639,
"./ne/translation.json": 640,
"./nl/translation.json": 641,
"./nn/translation.json": 642,
"./pa/translation.json": 643,
"./pl/translation.json": 644,
"./ps/translation.json": 645,
"./pt-BR/translation.json": 646,
"./pt-ZZ/translation.json": 647,
"./pt/translation.json": 648,
"./ro/translation.json": 649,
"./ru/translation.json": 650,
"./si/translation.json": 651,
"./sk/translation.json": 652,
"./sl/translation.json": 653,
"./sq/translation.json": 654,
"./sr/translation.json": 655,
"./sv/translation.json": 656,
"./sw/translation.json": 657,
"./ta/translation.json": 658,
"./te/translation.json": 659,
"./th/translation.json": 660,
"./tr/translation.json": 661,
"./uk/translation.json": 662,
"./ur/translation.json": 663,
"./uz/translation.json": 664,
"./vi/translation.json": 665,
"./zh-CN/translation.json": 666,
"./zh-TW/translation.json": 667,
"./zu/translation.json": 668
};
n.keys = function() {
return Object.keys(i)
}, n.resolve = o, e.exports = n, n.id = 340
}, , , function(e, t, r) {
"use strict";
var n = r(1),
o = r(45),
i = r(7),
a = {
getKeys: function() {
var e = o.get().encKey.toString(CryptoJS.enc.Base64),
t = o.get().macKey.toString(CryptoJS.enc.Base64);
return {
enc: CryptoJS.enc.Base64.parse(e),
mac: CryptoJS.enc.Base64.parse(t)
}
},
encrypt: function(e) {
var t = CryptoJS.lib.WordArray.create(e),
r = new Uint32Array(4),
n = this.getKeys();
window.crypto.getRandomValues(r);
var o = CryptoJS.AES.encrypt(t, n.enc, {
iv: CryptoJS.lib.WordArray.create(r),
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
}),
a = o.iv.concat(o.ciphertext),
s = CryptoJS.HmacSHA256(a, n.mac),
d = s.concat(a);
return i.fromBase64(d.toString(CryptoJS.enc.Base64)).toBuffer()
},
decrypt: function(e) {
var t = i.wrap(e),
r = t.slice(t.offset, t.offset + 32).toBase64(),
o = t.slice(t.offset + 32).toBuffer(),
a = this.getKeys(),
s = CryptoJS.lib.WordArray.create(o),
d = CryptoJS.HmacSHA256(s, a.mac).toString(CryptoJS.enc.Base64);
if (r !== d) throw n.error("bp:01:decrypt hmac dont match " + r + " " + d)(), new Error("hmac mismatch");
var c = t.slice(t.offset + 32, t.offset + 48).toBuffer(),
u = t.slice(t.offset + 48).toBuffer(),
l = CryptoJS.AES.decrypt({
ciphertext: CryptoJS.lib.WordArray.create(u),
salt: void 0
}, a.enc, {
iv: CryptoJS.lib.WordArray.create(c),
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
});
return i.fromBase64(l.toString(CryptoJS.enc.Base64)).toBuffer()
}
};
e.exports = a
}, function(e, t) {
"use strict";
var r = {
singleByte: [void 0, void 0, void 0, "200", "400", "404", "500", "501", "502", "action", "add", "after", "archive", "author", "available", "battery", "before", "body", "broadcast", "chat", "clear", "code", "composing", "contacts", "count", "create", "debug", "delete", "demote", "duplicate", "encoding", "error", "false", "filehash", "from", "g.us", "group", "groups_v2", "height", "id", "image", "in", "index", "invis", "item", "jid", "kind", "last", "leave", "live", "log", "media", "message", "mimetype", "missing", "modify", "name", "notification", "notify", "out", "owner", "participant", "paused", "picture", "played", "presence", "preview", "promote", "query", "raw", "read", "receipt", "received", "recipient", "recording", "relay", "remove", "response", "resume", "retry", "s.whatsapp.net", "seconds", "set", "size", "status", "subject", "subscribe", "t", "text", "to", "true", "type", "unarchive", "unavailable", "url", "user", "value", "web", "width", "mute", "read_only", "admin", "creator", "short", "update", "powersave"],
doubleByte: []
};
e.exports = r
}, function(e, t, r) {
"use strict";
function n(e) {
var t = !1,
r = o.wrap(e, void 0, t);
this.readByte = function() {
return r.readUint8()
}, this.readInt16 = function() {
return r.readUint16()
}, this.readInt20 = function() {
var e = 15 & r.readUint8(),
t = r.readUint8(),
n = r.readUint8();
return (e << 16) + (t << 8) + n
}, this.readString = function(e) {
return r.readString(e, o.METRICS_BYTES)
}, this.readBytes = function(e) {
var t = r.copy(r.offset, r.offset + e);
return r.offset += e, t
}, this.debugInfo = function() {
return "offset: " + r.offset + " byte: " + r.readUint8(r.offset)
}
}
var o = r(7);
e.exports = n
}, function(e, t, r) {
"use strict";
function n(e, t) {
if (!e) return "undefined";
var r = o(e[1], t),
n = i(e[2], t);
return "<" + e[0] + r + (n ? ">\n" + n + "\n</" + e[0] + ">" : "/>")
}
function o(e, t) {
if (e) {
var r = "";
for (var n in e) {
var o = "string" == typeof e[n] ? t ? "..." : '"' + e[n] + '"' : e[n];
r += " " + n + "=" + o
}
return r
}
return ""
}
function i(e, t) {
return a.isByteBuffer(e) ? "<<bin:" + e.limit + ">>" : "string" == typeof e ? t ? "<<string:" + e.length + ">>" : e : _.isArray(e) ? e.map(_.partial(n, _, t)).join("\n") : void 0
}
var a = r(7),
s = {
tag: function(e) {
return e && e[0]
},
attr: function(e, t) {
return t && t[1] ? t[1][e] : void 0
},
attrs: function(e) {
return e[1]
},
child: function d(e, t) {
var r = t[2];
if (_.isArray(r))
for (var n = r.length, o = 0; n > o; o++) {
var d = r[o];
if (_.isArray(d) && d[0] === e) return d
}
},
children: function(e) {
return e && e[2]
},
dataStr: function(e) {
if (!e) return "";
var t = e[2];
return "string" == typeof t ? t : a.isByteBuffer(t) ? t.readString(t.limit, a.METRICS_BYTES, 0).string : void 0
},
toString: n
};
e.exports = s
}, function(e, t, r) {
"use strict";
function n() {
function e(e) {
r++, n.push(e)
}
var t = !1,
r = 0,
n = [];
this.pushInt16 = function(t) {
if ("number" != typeof t) throw new Error("invalid int16");
e((65280 & t) >> 8), e((255 & t) >> 0)
}, this.pushInt20 = function(t) {
if ("number" != typeof t) throw new Error("invalid int20");
e((983040 & t) >> 16), e((65280 & t) >> 8), e((255 & t) >> 0)
}, this.pushByte = function(t) {
if ("number" != typeof t || 0 > t || t > 255) throw new Error("invalid byte value: " + t);
e(t)
}, this.pushBytes = function(e) {
if (!o.isByteBuffer(e)) throw new Error("invalid byte buffer");
r += e.limit, n.push(e)
}, this.pushString = function(e) {
if ("string" != typeof e) throw new Error("invalid string");
r += o.calculateUTF8Bytes(e), n.push(e)
}, this.toBuffer = function() {
for (var e = new o(r, t), i = n.length, a = 0; i > a; a++) {
var s = n[a];
"string" == typeof s ? e.writeString(s) : o.isByteBuffer(s) ? (s.reset(), e.append(s)) : e.writeByte(s)
}
return e.reset(), e.toBuffer(!0)
}
}
var o = r(7);
e.exports = n
}, function(e, t, r) {
"use strict";
function n(e) {
var t = e.singleByte,
r = e.doubleByte;
this.readNode = function(e) {
var t = e.readByte(),
r = this.readListSize(e, t);
if (t = e.readByte(), t === o.STREAM_END) throw new Error("unexpected stream end " + e.debugInfo());
var n = this.readString(e, t);
if (0 === r || !n) throw new Error("invalid node. 0 list or empty tag" + e.debugInfo());
var i = r - 2 + r % 2 >> 1,
a = this.readAttributes(e, i);
if (r % 2 === 1) return [n, a, void 0];
var s;
if (t = e.readByte(), this.isListTag(t)) s = this.readList(e, t);
else if (t === o.BINARY_8) {
var d = e.readByte();
s = e.readBytes(d)
} else if (t === o.BINARY_20) {
var c = e.readInt20();
s = e.readBytes(c)
} else s = this.readString(t);
return [n, a, s]
}, this.isListTag = function(e) {
return e === o.LIST_EMPTY || e === o.LIST_8 || e === o.LIST_16
}, this.readListSize = function(e, t) {
if (t === o.LIST_EMPTY) return 0;
if (t === o.LIST_8) return e.readByte();
if (t === o.LIST_16) return e.readInt16();
throw new Error("invalid list size " + e.debugInfo())
}, this.readString = function(e, t) {
if (-1 === t) throw new Error("invalid start token readString" + e.debugInfo());
if (t > 2 && 236 > t) {
var r = this.getToken(t);
return "s.whatsapp.net" === r && (r = "c.us"), r
}
switch (t) {
case o.DICTIONARY_0:
case o.DICTIONARY_1:
case o.DICTIONARY_2:
case o.DICTIONARY_3:
var n = e.readByte();
return this.getTokenDouble(t - o.DICTIONARY_0, n);
case o.LIST_EMPTY:
return;
case o.BINARY_8:
var i = e.readByte();
return e.readString(i);
case o.BINARY_20:
var a = e.readInt20();
return e.readString(a);
case o.JID_PAIR:
var s = this.readString(e, e.readByte()),
d = this.readString(e, e.readByte());
if ("undefined" != typeof s && "undefined" != typeof d) return s + "@" + d;
if ("undefined" != typeof d) return d;
throw new Error("invalid jid " + s + "," + d + " " + e.debugInfo());
default:
throw new Error("invalid string " + e.debugInfo())
}
}, this.getToken = function(e) {
var r;
if (e >= 0 && e < t.length && (r = t[e]), "undefined" == typeof r) throw new Error("invalid token " + e);
return r
}, this.getTokenDouble = function(e, t) {
var n, o = 256 * e + t;
if (o >= 0 && o < r.length && (n = r[o]), "undefined" == typeof n) throw new Error("invalid double byte token " + e + " " + t);
return n
}, this.readAttributes = function(e, t) {
for (var r, n, o = t ? {} : void 0, i = 0; t > i; i++) r = this.readString(e, e.readByte()), n = this.readString(e, e.readByte()), o[r] = n;
return o
}, this.readList = function(e, t) {
for (var r = [], n = this.readListSize(e, t), o = 0; n > o; o++) r.push(this.readNode(e));
return r
}
}
var o = r(148);
e.exports = n
}, function(e, t, r) {
"use strict";
function n(e) {
var t, r = {};
for (t = 0; t < e.singleByte.length; t++) e.singleByte[t] && (r[e.singleByte[t]] = t);
for (t = 0; t < e.doubleByte.length; t++) e.doubleByte[t] && (r[e.doubleByte[t]] = t + i.SINGLE_BYTE_MAX);
this.writeNode = function(e, t) {
if (t) {
if (3 !== t.length) throw new Error("invalid node");
var r = t[1] ? 2 * Object.keys(t[1]).filter(function(e) {
return !!t[1][e]
}).length : 0;
this.writeListStart(e, 1 + r + (t[2] ? 1 : 0)), this.writeString(e, t[0]), this.writeAttributes(e, t[1]), this.writeChildren(e, t[2])
}
}, this.writeString = function(e, t) {
if ("string" != typeof t) throw new Error("invalid string");
var n, o, a = r[t];
if ("undefined" == typeof a) {
var s = t.indexOf("@");
if (1 > s) this.writeStringRaw(e, t);
else {
var d = t.substring(0, s),
c = t.substring(s + 1);
this.writeJid(e, d, c)
}
} else {
if (a < i.SINGLE_BYTE_MAX) this.writeToken(e, a);
else {
var u = a - i.SINGLE_BYTE_MAX,
l = u >> 8;
switch (o = u % 256, l) {
case 0:
n = i.DICTIONARY_0;
break;
case 1:
n = i.DICTIONARY_1;
break;
case 2:
n = i.DICTIONARY_2;
break;
case 3:
n = i.DICTIONARY_3;
break;
default:
throw new Error("double byte dictionary token out of range: " + t + " " + a)
}
}
this.writeToken(e, n), this.writeToken(e, o)
}
}, this.writeStringRaw = function(e, t) {
var r = o.calculateUTF8Bytes(t);
r >= 256 ? (e.pushByte(i.BINARY_20), e.pushInt20(r)) : (e.pushByte(i.BINARY_8), e.pushByte(r)), e.pushString(t)
}, this.writeJid = function(e, t, r) {
e.pushByte(i.JID_PAIR), t ? this.writeString(e, t) : this.writeToken(e, i.LIST_EMPTY), "c.us" === r && (r = "s.whatsapp.net"), this.writeString(e, r)
}, this.writeToken = function(e, t) {
if (245 > t) e.pushByte(t);
else if (500 >= t) throw new Error("invalid token")
}, this.writeAttributes = function(e, t) {
if (t)
for (var r in t) t[r] && (this.writeString(e, r), this.writeString(e, t[r]))
}, this.writeChildren = function(e, t) {
var r;
if (t)
if ("string" == typeof t) this.writeString(e, t);
else if (o.isByteBuffer(t)) r = t.limit, r >= 256 ? (e.pushByte(i.BINARY_20), e.pushInt20(r)) : (e.pushByte(i.BINARY_8), e.pushByte(r)), e.pushBytes(t);
else {
if (!_.isArray(t)) throw new Error("invalid children");
r = t.length, this.writeListStart(e, r);
for (var n = 0; r > n; n++) this.writeNode(e, t[n])
}
}, this.writeListStart = function(e, t) {
0 === t ? e.pushByte(i.LIST_EMPTY) : 256 > t ? (e.pushByte(i.LIST_8), e.pushByte(t)) : (e.pushByte(i.LIST_16), e.pushInt16(t))
}
}
var o = r(7),
i = r(148);
e.exports = n
}, function(e, t, r) {
"use strict";
var n = r(1),
o = r(45),
i = r(7),
a = {
getKeys: function() {
var e = o.get().encKey.toString(CryptoJS.enc.Base64),
t = o.get().macKey.toString(CryptoJS.enc.Base64);
return {
enc: CryptoJS.enc.Base64.parse(e),
mac: CryptoJS.enc.Base64.parse(t)
}
},
encrypt: function(e) {
var t = CryptoJS.lib.WordArray.create(e),
r = new Uint32Array(4),
n = this.getKeys();
window.crypto.getRandomValues(r);
var o = CryptoJS.AES.encrypt(t, n.enc, {
iv: CryptoJS.lib.WordArray.create(r),
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
}),
a = o.iv.concat(o.ciphertext),
s = CryptoJS.HmacSHA256(a, n.mac),
d = s.concat(a);
return i.fromBase64(d.toString(CryptoJS.enc.Base64)).toBuffer()
},
decrypt: function(e) {
var t = i.wrap(e),
r = t.slice(t.offset, t.offset + 32).toBase64(),
o = t.slice(t.offset + 32).toBuffer(),
a = this.getKeys(),
s = CryptoJS.lib.WordArray.create(o),
d = CryptoJS.HmacSHA256(s, a.mac).toString(CryptoJS.enc.Base64);
if (r !== d) throw n.error("bp:03:decrypt hmac dont match " + r + " " + d)(), new Error("hmac mismatch");
var c = t.slice(t.offset + 32, t.offset + 48).toBuffer(),
u = t.slice(t.offset + 48).toBuffer(),
l = CryptoJS.AES.decrypt({
ciphertext: CryptoJS.lib.WordArray.create(u),
salt: void 0
}, a.enc, {
iv: CryptoJS.lib.WordArray.create(c),
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
});
return i.fromBase64(l.toString(CryptoJS.enc.Base64)).toBuffer()
}
};
e.exports = a
}, function(e, t) {
"use strict";
var r = {
singleByte: [void 0, void 0, void 0, "200", "400", "404", "500", "501", "502", "action", "add", "after", "archive", "author", "available", "battery", "before", "body", "broadcast", "chat", "clear", "code", "composing", "contacts", "count", "create", "debug", "delete", "demote", "duplicate", "encoding", "error", "false", "filehash", "from", "g.us", "group", "groups_v2", "height", "id", "image", "in", "index", "invis", "item", "jid", "kind", "last", "leave", "live", "log", "media", "message", "mimetype", "missing", "modify", "name", "notification", "notify", "out", "owner", "participant", "paused", "picture", "played", "presence", "preview", "promote", "query", "raw", "read", "receipt", "received", "recipient", "recording", "relay", "remove", "response", "resume", "retry", "s.whatsapp.net", "seconds", "set", "size", "status", "subject", "subscribe", "t", "text", "to", "true", "type", "unarchive", "unavailable", "url", "user", "value", "web", "width", "mute", "read_only", "admin", "creator", "short", "update", "powersave"],
doubleByte: [],
nibbleEncode: {
0: 0,
1: 1,
2: 2,
3: 3,
4: 4,
5: 5,
6: 6,
7: 7,
8: 8,
9: 9,
"-": 10,
".": 11,
"\x00": 15
},
nibbleDecode: {
0: "0",
1: "1",
2: "2",
3: "3",
4: "4",
5: "5",
6: "6",
7: "7",
8: "8",
9: "9",
10: "-",
11: ".",
15: "\x00"
}
};
e.exports = r
}, function(e, t, r) {
"use strict";
function n(e) {
var t = !1,
r = o.wrap(e, void 0, t);
this.readByte = function() {
return r.readUint8()
}, this.readInt16 = function() {
return r.readUint16()
}, this.readInt20 = function() {
var e = 15 & r.readUint8(),
t = r.readUint8(),
n = r.readUint8();
return (e << 16) + (t << 8) + n
}, this.readInt32 = function() {
return r.readUint32()
}, this.readString = function(e) {
return r.readString(e, o.METRICS_BYTES)
}, this.readBytes = function(e) {
var t = r.copy(r.offset, r.offset + e);
return r.offset += e, t
}, this.debugInfo = function() {
return "offset: " + r.offset + " byte: " + r.readUint8(r.offset)
}
}
var o = r(7);
e.exports = n
}, function(e, t, r) {
"use strict";
function n(e, t) {
if (!e) return "undefined";
var r = o(e[1], t),
n = i(e[2], t);
return "<" + e[0] + r + (n ? ">\n" + n + "\n</" + e[0] + ">" : "/>")
}
function o(e, t) {
if (e) {
var r = "";
for (var n in e) {
var o = "string" == typeof e[n] ? t ? "..." : '"' + e[n] + '"' : e[n];
r += " " + n + "=" + o
}
return r
}
return ""
}
function i(e, t) {
return a.isByteBuffer(e) ? "<<bin:" + e.limit + ">>" : "string" == typeof e ? t ? "<<string:" + e.length + ">>" : e : _.isArray(e) ? e.map(_.partial(n, _, t)).join("\n") : void 0
}
var a = r(7),
s = {
tag: function(e) {
return e && e[0]
},
attr: function(e, t) {
return t && t[1] ? t[1][e] : void 0
},
attrs: function(e) {
return e[1]
},
child: function d(e, t) {
var r = t[2];
if (_.isArray(r))
for (var n = r.length, o = 0; n > o; o++) {
var d = r[o];
if (_.isArray(d) && d[0] === e) return d
}
},
children: function(e) {
return e && e[2]
},
dataStr: function(e) {
if (!e) return "";
var t = e[2];
return "string" == typeof t ? t : a.isByteBuffer(t) ? t.readString(t.limit, a.METRICS_BYTES, 0).string : void 0
},
toString: n
};
e.exports = s
}, function(e, t, r) {
"use strict";
function n() {
function e(e) {
r++, n.push(e)
}
var t = !1,
r = 0,
n = [];
this.pushInt16 = function(t) {
if ("number" != typeof t) throw new Error("invalid int16");
e((65280 & t) >> 8), e((255 & t) >> 0)
}, this.pushInt20 = function(t) {
if ("number" != typeof t) throw new Error("invalid int20");
e((983040 & t) >> 16), e((65280 & t) >> 8), e((255 & t) >> 0)
}, this.pushInt32 = function(t) {
if ("number" != typeof t) throw new Error("invalid int32");
e((4278190080 & t) >> 24), e((16711680 & t) >> 16), e((65280 & t) >> 8), e((255 & t) >> 0)
}, this.pushByte = function(t) {
if ("number" != typeof t || 0 > t || t > 255) throw new Error("invalid byte value: " + t);
e(t)
}, this.pushBytes = function(e) {
if (!o.isByteBuffer(e)) throw new Error("invalid byte buffer");
r += e.limit, n.push(e)
}, this.pushUint8Array = function(e) {
if ("[object Uint8Array]" !== Object.prototype.toString.call(e)) throw new Error("invalid Uint8Array");
r += e.length;
for (var t = 0; t < e.length; t++) n.push(e[t])
}, this.pushString = function(e) {
if ("string" != typeof e) throw new Error("invalid string");
r += o.calculateUTF8Bytes(e), n.push(e)
}, this.toBuffer = function() {
for (var e = new o(r, t), i = n.length, a = 0; i > a; a++) {
var s = n[a];
"string" == typeof s ? e.writeString(s) : o.isByteBuffer(s) ? (s.reset(), e.append(s)) : e.writeByte(s)
}
return e.reset(), e.toBuffer(!0)
}
}
var o = r(7);
e.exports = n
}, function(e, t, r) {
"use strict";
function n(e) {
var t = e.singleByte,
r = e.doubleByte,
n = e.nibbleDecode;
this.readNode = function(e) {
var t = e.readByte(),
r = this.readListSize(e, t);
if (t = e.readByte(), t === o.STREAM_END) throw new Error("unexpected stream end " + e.debugInfo());
var n = this.readString(e, t);
if (0 === r || !n) throw new Error("invalid node. 0 list or empty tag" + e.debugInfo());
var i = r - 2 + r % 2 >> 1,
a = this.readAttributes(e, i);
if (r % 2 === 1) return [n, a, void 0];
var s;
if (t = e.readByte(), this.isListTag(t)) s = this.readList(e, t);
else if (t === o.BINARY_8) {
var d = e.readByte();
s = e.readBytes(d)
} else if (t === o.BINARY_20) {
var c = e.readInt20();
s = e.readBytes(c)
} else if (t === o.BINARY_32) {
var u = e.readInt32();
s = e.readBytes(u)
} else s = this.readString(e, t);
return [n, a, s]
}, this.isListTag = function(e) {
return e === o.LIST_EMPTY || e === o.LIST_8 || e === o.LIST_16
}, this.readListSize = function(e, t) {
if (t === o.LIST_EMPTY) return 0;
if (t === o.LIST_8) return e.readByte();
if (t === o.LIST_16) return e.readInt16();
throw new Error("invalid list size " + e.debugInfo())
}, this.readString = function(e, t) {
if (-1 === t) throw new Error("invalid start token readString" + e.debugInfo());
if (t > 2 && 236 > t) {
var r = this.getToken(t);
return "s.whatsapp.net" === r && (r = "c.us"), r
}
switch (t) {
case o.DICTIONARY_0:
case o.DICTIONARY_1:
case o.DICTIONARY_2:
case o.DICTIONARY_3:
var n = e.readByte();
return this.getTokenDouble(t - o.DICTIONARY_0, n);
case o.LIST_EMPTY:
return;
case o.BINARY_8:
return e.readString(e.readByte());
case o.BINARY_20:
return e.readString(e.readInt20());
case o.BINARY_32:
return e.readString(e.readInt32());
case o.JID_PAIR:
var i = this.readString(e, e.readByte()),
a = this.readString(e, e.readByte());
if ("undefined" != typeof i && "undefined" != typeof a) return i + "@" + a;
if ("undefined" != typeof a) return a;
throw new Error("invalid jid " + i + "," + a + " " + e.debugInfo());
case o.NIBBLE_8:
return this.nibblesToBytes(e);
default:
throw new Error("invalid string " + e.debugInfo())
}
}, this.getToken = function(e) {
var r;
if (e >= 0 && e < t.length && (r = t[e]), "undefined" == typeof r) throw new Error("invalid token " + e);
return r
}, this.getTokenDouble = function(e, t) {
var n, o = 256 * e + t;
if (o >= 0 && o < r.length && (n = r[o]), "undefined" == typeof n) throw new Error("invalid double byte token " + e + " " + t);
return n
}, this.readAttributes = function(e, t) {
for (var r, n, o = t ? {} : void 0, i = 0; t > i; i++) r = this.readString(e, e.readByte()), n = this.readString(e, e.readByte()), o[r] = n;
return o
}, this.readList = function(e, t) {
for (var r = [], n = this.readListSize(e, t), o = 0; n > o; o++) r.push(this.readNode(e));
return r
}, this.nibblesToBytes = function(e) {
for (var t = e.readByte(), r = t >> 7, n = 127 & t, o = "", i = 0; n > i; i++) {
var a = e.readByte(),
s = this.unpackBytePair(a);
o += s[0], o += s[1]
}
return r && (o = o.substring(0, o.length - 1)), o
}, this.unpackBytePair = function(e) {
var t = (240 & e) >> 4,
r = 15 & e;
if (!n.hasOwnProperty(t)) throw new Error("invalid nibble to unpack: " + t);
if (!n.hasOwnProperty(r)) throw new Error("invalid nibble to unpack: " + r);
var o = n[t],
i = n[r];
return [o, i]
}, this.bytesToString = function(e) {
for (var t = "", r = 0; r < e.length; r++) t += String.fromCharCode(e[r]);
return t
}
}
var o = r(149);
e.exports = n
}, function(e, t, r) {
"use strict";
function n(e) {
var t, r = {},
n = e.nibbleEncode;
for (t = 0; t < e.singleByte.length; t++) e.singleByte[t] && (r[e.singleByte[t]] = t);
for (t = 0; t < e.doubleByte.length; t++) e.doubleByte[t] && (r[e.doubleByte[t]] = t + a.SINGLE_BYTE_MAX);
this.writeNode = function(e, t) {
if (t) {
if (3 !== t.length) throw new Error("invalid node");
var r = t[1] ? 2 * Object.keys(t[1]).filter(function(e) {
return !!t[1][e]
}).length : 0;
this.writeListStart(e, 1 + r + (t[2] ? 1 : 0)), this.writeString(e, t[0]), this.writeAttributes(e, t[1]), this.writeChildren(e, t[2])
}
}, this.writeString = function(e, t, n) {
if ("string" != typeof t) throw new Error("invalid string");
var o, i, s = r[t];
if ("c.us" !== t || n)
if ("undefined" == typeof s) {
var d = t.indexOf("@");
if (1 > d) this.writeStringRaw(e, t);
else {
var c = t.substring(0, d),
u = t.substring(d + 1);
this.writeJid(e, c, u)
}
} else {
if (s < a.SINGLE_BYTE_MAX) this.writeToken(e, s);
else {
var l = s - a.SINGLE_BYTE_MAX,
f = l >> 8;
switch (i = l % 256, f) {
case 0:
o = a.DICTIONARY_0;
break;
case 1:
o = a.DICTIONARY_1;
break;
case 2:
o = a.DICTIONARY_2;
break;
case 3:
o = a.DICTIONARY_3;
break;
default:
throw new Error("double byte dictionary token out of range: " + t + " " + s)
}
}
this.writeToken(e, o), this.writeToken(e, i)
}
else this.writeToken(e, r["s.whatsapp.net"])
}, this.writeStringRaw = function(e, t) {
var r = i.calculateUTF8Bytes(t);
if (r >= 4294967296) throw new Error("string too large to encode (len = " + r + "): " + t);
r >= 1 << 20 ? (e.pushByte(a.BINARY_32), e.pushInt32(r)) : r >= 256 ? (e.pushByte(a.BINARY_20), e.pushInt20(r)) : (e.pushByte(a.BINARY_8), e.pushByte(r)), e.pushString(t)
}, this.writeJid = function(e, t, r) {
if (e.pushByte(a.JID_PAIR), t) try {
this.writeNibbles(e, t)
} catch (n) {
o.warnVerbose("writer:encode-fallback " + n.message, t)(), this.writeString(e, t)
} else this.writeToken(e, a.LIST_EMPTY);
this.writeString(e, r)
}, this.writeToken = function(e, t) {
if (245 > t) e.pushByte(t);
else if (500 >= t) throw new Error("invalid token")
}, this.writeAttributes = function(e, t) {
if (t)
for (var r in t) t[r] && (this.writeString(e, r), this.writeString(e, t[r]))
}, this.writeChildren = function(e, t) {
var r;
if (t)
if ("string" == typeof t) this.writeString(e, t, !0);
else if (i.isByteBuffer(t)) {
if (r = t.limit, r >= 4294967296) throw new Error("invalid children; too long (len = " + r);
r >= 1 << 20 ? (e.pushByte(a.BINARY_32), e.pushInt32(r)) : r >= 256 ? (e.pushByte(a.BINARY_20), e.pushInt20(r)) : (e.pushByte(a.BINARY_8), e.pushByte(r)), e.pushBytes(t)
} else {
if (!_.isArray(t)) throw new Error("invalid children");
r = t.length, this.writeListStart(e, r);
for (var n = 0; r > n; n++) this.writeNode(e, t[n])
}
}, this.writeListStart = function(e, t) {
0 === t ? e.pushByte(a.LIST_EMPTY) : 256 > t ? (e.pushByte(a.LIST_8), e.pushByte(t)) : (e.pushByte(a.LIST_16), e.pushInt16(t))
}, this.writeNibbles = function(e, t) {
var r = i.calculateUTF8Bytes(t);
if (r > a.NIBBLE_MAX) throw new Error("too many bytes to nibble-encode: len = " + r);
var n, o = Math.ceil(r / 2),
s = [],
d = 0;
r % 2 > 0 && (d = 128);
var c = d | o;
s.push(a.NIBBLE_8), s.push(c);
for (var u = Math.floor(r / 2), l = 0; u > l; l++) n = this.packBytePair(t[2 * l], t[2 * l + 1]), s.push(n);
d > 0 && (n = this.packBytePair(t[r - 1], "\x00"), s.push(n));
var f = new Uint8Array(s);
e.pushUint8Array(f)
}, this.packBytePair = function(e, t) {
if (!n.hasOwnProperty(e)) throw new Error("invalid byte to nibble-pack: " + e);
if (!n.hasOwnProperty(t)) throw new Error("invalid byte to nibble-pack: " + t);
var r = n[e],
o = n[t];
return r << 4 | o
}
}
var o = r(1),
i = r(7),
a = r(149);
e.exports = n
}, function(e, t) {
"use strict";
var r = {
singleByte: [void 0, void 0, void 0, "200", "400", "404", "500", "501", "502", "action", "add", "after", "archive", "author", "available", "battery", "before", "body", "broadcast", "chat", "clear", "code", "composing", "contacts", "count", "create", "debug", "delete", "demote", "duplicate", "encoding", "error", "false", "filehash", "from", "g.us", "group", "groups_v2", "height", "id", "image", "in", "index", "invis", "item", "jid", "kind", "last", "leave", "live", "log", "media", "message", "mimetype", "missing", "modify", "name", "notification", "notify", "out", "owner", "participant", "paused", "picture", "played", "presence", "preview", "promote", "query", "raw", "read", "receipt", "received", "recipient", "recording", "relay", "remove", "response", "resume", "retry", "s.whatsapp.net", "seconds", "set", "size", "status", "subject", "subscribe", "t", "text", "to", "true", "type", "unarchive", "unavailable", "url", "user", "value", "web", "width", "mute", "read_only", "admin", "creator", "short", "update", "powersave", "checksum", "epoch", "block", "previous", "409", "replaced", "reason", "spam", "modify_tag"],
doubleByte: [],
nibbleEncode: {
0: 0,
1: 1,
2: 2,
3: 3,
4: 4,
5: 5,
6: 6,
7: 7,
8: 8,
9: 9,
"-": 10,
".": 11,
"\x00": 15
},
nibbleDecode: {
0: "0",
1: "1",
2: "2",
3: "3",
4: "4",
5: "5",
6: "6",
7: "7",
8: "8",
9: "9",
10: "-",
11: ".",
15: "\x00"
}
};
e.exports = r;
}, function(e, t) {
"use strict";
var r = {
singleByte: [void 0, void 0, void 0, "200", "400", "404", "500", "501", "502", "action", "add", "after", "archive", "author", "available", "battery", "before", "body", "broadcast", "chat", "clear", "code", "composing", "contacts", "count", "create", "debug", "delete", "demote", "duplicate", "encoding", "error", "false", "filehash", "from", "g.us", "group", "groups_v2", "height", "id", "image", "in", "index", "invis", "item", "jid", "kind", "last", "leave", "live", "log", "media", "message", "mimetype", "missing", "modify", "name", "notification", "notify", "out", "owner", "participant", "paused", "picture", "played", "presence", "preview", "promote", "query", "raw", "read", "receipt", "received", "recipient", "recording", "relay", "remove", "response", "resume", "retry", "s.whatsapp.net", "seconds", "set", "size", "status", "subject", "subscribe", "t", "text", "to", "true", "type", "unarchive", "unavailable", "url", "user", "value", "web", "width", "mute", "read_only", "admin", "creator", "short", "update", "powersave", "checksum", "epoch", "block", "previous", "409", "replaced", "reason", "spam", "modify_tag", "message_info", "delivery", "emoji"],
doubleByte: [],
nibbleEncode: {
0: 0,
1: 1,
2: 2,
3: 3,
4: 4,
5: 5,
6: 6,
7: 7,
8: 8,
9: 9,
"-": 10,
".": 11,
"\x00": 15
},
nibbleDecode: {
0: "0",
1: "1",
2: "2",
3: "3",
4: "4",
5: "5",
6: "6",
7: "7",
8: "8",
9: "9",
10: "-",
11: ".",
15: "\x00"
}
};
e.exports = r
}, function(e, t, r) {
"use strict";
function n(e) {
var t = e.singleByte,
r = e.doubleByte,
n = e.nibbleDecode;
this.readNode = function(e) {
var t = e.readByte(),
r = this.readListSize(e, t);
if (t = e.readByte(), t === o.STREAM_END) throw new Error("unexpected stream end " + e.debugInfo());
var n = this.readString(e, t);
if (0 === r || !n) throw new Error("invalid node. 0 list or empty tag" + e.debugInfo());
var i = r - 2 + r % 2 >> 1,
a = this.readAttributes(e, i);
if (r % 2 === 1) return [n, a, void 0];
var s;
if (t = e.readByte(), this.isListTag(t)) s = this.readList(e, t);
else if (t === o.BINARY_8) {
var d = e.readByte();
s = e.readBytes(d)
} else if (t === o.BINARY_20) {
var c = e.readInt20();
s = e.readBytes(c)
} else if (t === o.BINARY_32) {
var u = e.readInt32();
s = e.readBytes(u)
} else s = this.readString(e, t);
return [n, a, s]
}, this.isListTag = function(e) {
return e === o.LIST_EMPTY || e === o.LIST_8 || e === o.LIST_16
}, this.readListSize = function(e, t) {
if (t === o.LIST_EMPTY) return 0;
if (t === o.LIST_8) return e.readByte();
if (t === o.LIST_16) return e.readInt16();
throw new Error("invalid list size " + e.debugInfo())
}, this.readString = function(e, t) {
if (-1 === t) throw new Error("invalid start token readString" + e.debugInfo());
if (t > 2 && 236 > t) {
var r = this.getToken(t);
return "s.whatsapp.net" === r && (r = "c.us"), r
}
switch (t) {
case o.DICTIONARY_0:
case o.DICTIONARY_1:
case o.DICTIONARY_2:
case o.DICTIONARY_3:
var n = e.readByte();
return this.getTokenDouble(t - o.DICTIONARY_0, n);
case o.LIST_EMPTY:
return;
case o.BINARY_8:
return e.readString(e.readByte());
case o.BINARY_20:
return e.readString(e.readInt20());
case o.BINARY_32:
return e.readString(e.readInt32());
case o.JID_PAIR:
var i = this.readString(e, e.readByte()),
a = this.readString(e, e.readByte());
if ("undefined" != typeof i && "undefined" != typeof a) return i + "@" + a;
if ("undefined" != typeof a) return a;
throw new Error("invalid jid " + i + "," + a + " " + e.debugInfo());
case o.NIBBLE_8:
case o.HEX_8:
return this.readPacked8(t, e);
default:
throw new Error("invalid string " + e.debugInfo())
}
}, this.getToken = function(e) {
var r;
if (e >= 0 && e < t.length && (r = t[e]), "undefined" == typeof r) throw new Error("invalid token " + e);
return r
}, this.getTokenDouble = function(e, t) {
var n, o = 256 * e + t;
if (o >= 0 && o < r.length && (n = r[o]), "undefined" == typeof n) throw new Error("invalid double byte token " + e + " " + t);
return n
}, this.readAttributes = function(e, t) {
for (var r, n, o = t ? {} : void 0, i = 0; t > i; i++) r = this.readString(e, e.readByte()), n = this.readString(e, e.readByte()), o[r] = n;
return o
}, this.readList = function(e, t) {
for (var r = [], n = this.readListSize(e, t), o = 0; n > o; o++) r.push(this.readNode(e));
return r
}, this.readPacked8 = function(e, t) {
for (var r = t.readByte(), n = r >> 7, o = 127 & r, i = "", a = 0; o > a; a++) {
var s = t.readByte();
i += this.unpackByte(e, (240 & s) >> 4), i += this.unpackByte(e, 15 & s)
}
return n && (i = i.substring(0, i.length - 1)), i
}, this.unpackByte = function(e, t) {
switch (e) {
case o.NIBBLE_8:
return this.unpackNibble(t);
case o.HEX_8:
return this.unpackHex(t);
default:
throw new Error("unpack non-nibble/hex type: " + e)
}
}, this.unpackNibble = function(e) {
if (!n.hasOwnProperty(e)) throw new Error("invalid nibble to unpack: " + e);
return n[e]
}, this.unpackHex = function(e) {
if (e >= 0 && 15 >= e) return e.toString(16).toUpperCase();
throw new Error("invalid hex to unpack: " + e)
}
}
var o = r(150);
e.exports = n
}, function(e, t, r) {
"use strict";
function n(e) {
var t, r = {},
n = e.nibbleEncode;
for (t = 0; t < e.singleByte.length; t++) e.singleByte[t] && (r[e.singleByte[t]] = t);
for (t = 0; t < e.doubleByte.length; t++) e.doubleByte[t] && (r[e.doubleByte[t]] = t + a.SINGLE_BYTE_MAX);
this.writeNode = function(e, t) {
if (t) {
if (3 !== t.length) throw new Error("invalid node");
var r = t[1] ? 2 * Object.keys(t[1]).filter(function(e) {
return !!t[1][e]
}).length : 0;
this.writeListStart(e, 1 + r + (t[2] ? 1 : 0)), this.writeString(e, t[0]), this.writeAttributes(e, t[1]), this.writeChildren(e, t[2])
}
}, this.writeString = function(e, t, n) {
if ("string" != typeof t) throw new Error("invalid string");
var o, i, s = r[t];
if ("c.us" !== t || n)
if ("undefined" == typeof s) {
var d = t.indexOf("@");
if (1 > d) this.writeStringRaw(e, t);
else {
var c = t.substring(0, d),
u = t.substring(d + 1);
this.writeJid(e, c, u)
}
} else {
if (s < a.SINGLE_BYTE_MAX) this.writeToken(e, s);
else {
var l = s - a.SINGLE_BYTE_MAX,
f = l >> 8;
switch (i = l % 256, f) {
case 0:
o = a.DICTIONARY_0;
break;
case 1:
o = a.DICTIONARY_1;
break;
case 2:
o = a.DICTIONARY_2;
break;
case 3:
o = a.DICTIONARY_3;
break;
default:
throw new Error("double byte dictionary token out of range: " + t + " " + s)
}
}
this.writeToken(e, o), this.writeToken(e, i)
}
else this.writeToken(e, r["s.whatsapp.net"])
}, this.writeStringRaw = function(e, t) {
var r = i.calculateUTF8Bytes(t);
if (r >= 4294967296) throw new Error("string too large to encode (len = " + r + "): " + t);
r >= 1 << 20 ? (e.pushByte(a.BINARY_32), e.pushInt32(r)) : r >= 256 ? (e.pushByte(a.BINARY_20), e.pushInt20(r)) : (e.pushByte(a.BINARY_8), e.pushByte(r)), e.pushString(t)
}, this.writeJid = function(e, t, r) {
if (e.pushByte(a.JID_PAIR), t) try {
this.writePackedBytes(e, t)
} catch (n) {
o.warnVerbose("writer:encode-fallback " + n.message, t)(), this.writeString(e, t)
} else this.writeToken(e, a.LIST_EMPTY);
this.writeString(e, r)
}, this.writeToken = function(e, t) {
if (245 > t) e.pushByte(t);
else if (500 >= t) throw new Error("invalid token")
}, this.writeAttributes = function(e, t) {
if (t)
for (var r in t) t[r] && (this.writeString(e, r), this.writeString(e, t[r]))
}, this.writeChildren = function(e, t) {
var r;
if (t)
if ("string" == typeof t) this.writeString(e, t, !0);
else if (i.isByteBuffer(t)) {
if (r = t.limit, r >= 4294967296) throw new Error("invalid children; too long (len = " + r);
r >= 1 << 20 ? (e.pushByte(a.BINARY_32), e.pushInt32(r)) : r >= 256 ? (e.pushByte(a.BINARY_20), e.pushInt20(r)) : (e.pushByte(a.BINARY_8), e.pushByte(r)), e.pushBytes(t)
} else {
if (!_.isArray(t)) throw new Error("invalid children");
r = t.length, this.writeListStart(e, r);
for (var n = 0; r > n; n++) this.writeNode(e, t[n])
}
}, this.writeListStart = function(e, t) {
0 === t ? e.pushByte(a.LIST_EMPTY) : 256 > t ? (e.pushByte(a.LIST_8), e.pushByte(t)) : (e.pushByte(a.LIST_16), e.pushInt16(t))
}, this.writePackedBytes = function(e, t) {
try {
this.writePackedBytesImpl(e, t, a.NIBBLE_8)
} catch (r) {
o.warn("writer:enc nib fail, try hex " + r.message, t)(), this.writePackedBytesImpl(e, t, a.HEX_8)
}
}, this.writePackedBytesImpl = function(e, t, r) {
var n = i.calculateUTF8Bytes(t);
if (n > a.PACKED_MAX) throw new Error("too many bytes to nibble-encode: len = " + n);
var o, s = Math.ceil(n / 2),
d = [],
c = 0;
n % 2 > 0 && (c = 128);
var u = c | s;
d.push(r), d.push(u);
for (var l = Math.floor(n / 2), f = 0; l > f; f++) o = this.packBytePair(r, t[2 * f], t[2 * f + 1]), d.push(o);
c > 0 && (o = this.packBytePair(r, t[n - 1], "\x00"), d.push(o));
var h = new Uint8Array(d);
e.pushUint8Array(h)
}, this.packBytePair = function(e, t, r) {
var n, o;
switch (e) {
case a.NIBBLE_8:
n = this.packNibble(t), o = this.packNibble(r);
break;
case a.HEX_8:
n = this.packHex(t), o = this.packHex(r);
break;
default:
throw new Error("invalid byte pack type: " + e)
}
return n << 4 | o
}, this.packNibble = function(e) {
if (!n.hasOwnProperty(e)) throw new Error("invalid byte to nibble-pack: " + e);
return n[e]
}, this.packHex = function(e) {
switch (e) {
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "A":
case "B":
case "C":
case "D":
case "E":
case "F":
return parseInt(e, 16);
case "\x00":
return 15;
default:
throw new Error("packHex:invalid byte: " + e)
}
}
}
var o = r(1),
i = r(7),
a = r(150);
e.exports = n
}, function(e, t) {
"use strict";
var r = {
singleByte: [void 0, void 0, void 0, "200", "400", "404", "500", "501", "502", "action", "add", "after", "archive", "author", "available", "battery", "before", "body", "broadcast", "chat", "clear", "code", "composing", "contacts", "count", "create", "debug", "delete", "demote", "duplicate", "encoding", "error", "false", "filehash", "from", "g.us", "group", "groups_v2", "height", "id", "image", "in", "index", "invis", "item", "jid", "kind", "last", "leave", "live", "log", "media", "message", "mimetype", "missing", "modify", "name", "notification", "notify", "out", "owner", "participant", "paused", "picture", "played", "presence", "preview", "promote", "query", "raw", "read", "receipt", "received", "recipient", "recording", "relay", "remove", "response", "resume", "retry", "s.whatsapp.net", "seconds", "set", "size", "status", "subject", "subscribe", "t", "text", "to", "true", "type", "unarchive", "unavailable", "url", "user", "value", "web", "width", "mute", "read_only", "admin", "creator", "short", "update", "powersave", "checksum", "epoch", "block", "previous", "409", "replaced", "reason", "spam", "modify_tag", "message_info", "delivery", "emoji", "title", "description", "canonical-url", "matched-text", "star", "unstar"],
doubleByte: [],
nibbleEncode: {
0: 0,
1: 1,
2: 2,
3: 3,
4: 4,
5: 5,
6: 6,
7: 7,
8: 8,
9: 9,
"-": 10,
".": 11,
"\x00": 15
},
nibbleDecode: {
0: "0",
1: "1",
2: "2",
3: "3",
4: "4",
5: "5",
6: "6",
7: "7",
8: "8",
9: "9",
10: "-",
11: ".",
15: "\x00"
}
};
e.exports = r
}, function(e, t) {
"use strict";
var r = {
singleByte: [void 0, void 0, void 0, "200", "400", "404", "500", "501", "502", "action", "add", "after", "archive", "author", "available", "battery", "before", "body", "broadcast", "chat", "clear", "code", "composing", "contacts", "count", "create", "debug", "delete", "demote", "duplicate", "encoding", "error", "false", "filehash", "from", "g.us", "group", "groups_v2", "height", "id", "image", "in", "index", "invis", "item", "jid", "kind", "last", "leave", "live", "log", "media", "message", "mimetype", "missing", "modify", "name", "notification", "notify", "out", "owner", "participant", "paused", "picture", "played", "presence", "preview", "promote", "query", "raw", "read", "receipt", "received", "recipient", "recording", "relay", "remove", "response", "resume", "retry", "s.whatsapp.net", "seconds", "set", "size", "status", "subject", "subscribe", "t", "text", "to", "true", "type", "unarchive", "unavailable", "url", "user", "value", "web", "width", "mute", "read_only", "admin", "creator", "short", "update", "powersave", "checksum", "epoch", "block", "previous", "409", "replaced", "reason", "spam", "modify_tag", "message_info", "delivery", "emoji", "title", "description", "canonical-url", "matched-text", "star", "unstar", "media_key"],
doubleByte: [],
nibbleEncode: {
0: 0,
1: 1,
2: 2,
3: 3,
4: 4,
5: 5,
6: 6,
7: 7,
8: 8,
9: 9,
"-": 10,
".": 11,
"\x00": 15
},
nibbleDecode: {
0: "0",
1: "1",
2: "2",
3: "3",
4: "4",
5: "5",
6: "6",
7: "7",
8: "8",
9: "9",
10: "-",
11: ".",
15: "\x00"
}
};
e.exports = r
}, function(e, t) {
"use strict";
var r = {
singleByte: [void 0, void 0, void 0, "200", "400", "404", "500", "501", "502", "action", "add", "after", "archive", "author", "available", "battery", "before", "body", "broadcast", "chat", "clear", "code", "composing", "contacts", "count", "create", "debug", "delete", "demote", "duplicate", "encoding", "error", "false", "filehash", "from", "g.us", "group", "groups_v2", "height", "id", "image", "in", "index", "invis", "item", "jid", "kind", "last", "leave", "live", "log", "media", "message", "mimetype", "missing", "modify", "name", "notification", "notify", "out", "owner", "participant", "paused", "picture", "played", "presence", "preview", "promote", "query", "raw", "read", "receipt", "received", "recipient", "recording", "relay", "remove", "response", "resume", "retry", "s.whatsapp.net", "seconds", "set", "size", "status", "subject", "subscribe", "t", "text", "to", "true", "type", "unarchive", "unavailable", "url", "user", "value", "web", "width", "mute", "read_only", "admin", "creator", "short", "update", "powersave", "checksum", "epoch", "block", "previous", "409", "replaced", "reason", "spam", "modify_tag", "message_info", "delivery", "emoji", "title", "description", "canonical-url", "matched-text", "star", "unstar", "media_key", "filename", "identity", "unread", "page", "page_count", "search", "media_message", "security", "call_log", "profile"],
doubleByte: [],
nibbleEncode: {
0: 0,
1: 1,
2: 2,
3: 3,
4: 4,
5: 5,
6: 6,
7: 7,
8: 8,
9: 9,
"-": 10,
".": 11,
"\x00": 15
},
nibbleDecode: {
0: "0",
1: "1",
2: "2",
3: "3",
4: "4",
5: "5",
6: "6",
7: "7",
8: "8",
9: "9",
10: "-",
11: ".",
15: "\x00"
}
};
e.exports = r
}, function(e, t, r) {
"use strict";
var n = r(5),
o = r(10),
i = r(44),
a = r(337),
s = n.createClass({
displayName: "Conflict",
componentWillMount: function() {
a.setTitleAndIcon(-1)
},
render: function() {
return n.createElement(i, {
body: l10n.t("phone_has_another_active_webclient_session"),
cancelLabel: l10n.t("menuitem_logout"),
onCancel: o.logout.bind(o),
defaultLabel: l10n.t("button_use_here"),
onDefault: o.takeover.bind(o)
})
}
});
e.exports = s
}, function(e, t, r) {
"use strict";
var n = r(5),
o = r(24),
i = r(72),
a = r(70),
s = r(139),
d = r(330),
c = r(92),
u = {
menu: null,
origin: {
x: 0,
y: 0
},
anchor: null,
event: null,
menuDirection: {
x: d.Direction.X.RIGHT,
y: d.Direction.Y.BOTTOM
},
originPosition: {
x: d.Direction.X.LEFT,
y: d.Direction.Y.BOTTOM
},
originOffset: {
x: 0,
y: 0
},
onOpen: _.noop,
onClose: _.noop,
onDefault: _.noop,
classes: null
},
l = {
MENU: "menu",
TOOLTIP: "tooltip"
},
f = n.createClass({
displayName: "ContextMenuManager",
mixins: [i, s],
propTypes: {
type: n.PropTypes.oneOf(_.values(l)).isRequired
},
getDefaultProps: function() {
return {
type: l.MENU
}
},
getInitialState: function() {
return u
},
componentWillMount: function() {
var e = this.props.type === l.MENU ? "open_context_menu" : "open_tooltip";
this.regCmd(e, this.open)
},
open: function(e, t) {
this.state.menu && a.pop(this.props.type), t = _.merge(_.clone(u, !0), t), t.event && (t.origin = {
x: t.event.clientX,
y: t.event.clientY
}, t.originOffset = {
x: 10,
y: 10
}, t.event.stopPropagation()), t.key = Math.random(), t.menu = e, this.replaceState(t, function() {
this.setDirection()
}), this.uimPush(this, this.props.type, {
popable: !0,
parent: t.parent
})
},
uimClose: function() {
_.isFunction(this.state.onClose) && this.state.onClose(), this.setState(u)
},
setDirection: function() {
var e = o.findDOMNode(this.refs.menu);
if (!e) return null;
var t = e.clientWidth,
r = e.clientHeight,
n = window.innerWidth,
i = window.innerHeight,
a = _.clone(this.state.menuDirection),
s = _.clone(this.state.origin),
c = s.x,
u = s.x,
l = s.y,
f = s.y;
if (this.state.anchor) {
var h = this.state.anchor,
p = h.getBoundingClientRect();
c = p.left, u = p.right, l = p.top, f = p.bottom
}
var m = a.x;
m === d.Direction.X.RIGHT && c + t > n && u - t > 0 ? m = d.Direction.X.LEFT : m === d.Direction.X.LEFT && 0 > u - t && n > c + t && (m = d.Direction.X.RIGHT);
var g = a.y;
g === d.Direction.Y.BOTTOM && f + r > i && l - r > 0 ? g = d.Direction.Y.TOP : g === d.Direction.Y.TOP && 0 > l - r && i > f + r && (g = d.Direction.Y.BOTTOM);
var v = m === d.Direction.X.RIGHT ? c : u,
y = g === d.Direction.Y.TOP ? l : f;
this.setState({
menuDirection: {
x: m,
y: g
},
origin: {
x: v,
y: y
}
})
},
render: function() {
var e;
if (this.state.menu) {
var t = {
x: this.state.origin.x + this.state.originOffset.x,
y: this.state.origin.y + this.state.originOffset.y
};
e = n.createElement(d, {
origin: t,
ref: "menu",
onDefault: this.state.onDefault,
classes: this.state.classes,
type: this.state.type,
key: "key-" + this.state.key,
direction: this.state.menuDirection
}, this.state.menu)
}
var r = this.state.type === d.Type.PICKER ? "dropdown-picker" : "dropdown";
return n.createElement(c, {
transitionName: r
}, e)
}
});
e.exports = f
}, function(e, t, r) {
"use strict";
function n(e) {
this.regex = new RegExp("^" + e[0] + "$"), this.formatString = e[1], this.leadins = _.map(e[2], function(e) {
return new RegExp("^(?:" + e + ")")
})
}
function o(e) {
var t = s[e];
return t ? c[e] = {
lengths: t[0],
formats: t[1].map(function(e) {
return new n(e)
})
} : null
}
function i(e) {
var t = e.match(d);
return t ? t[0] : e.length >= 3 ? e.substring(0, 3) : e
}
function a(e) {
var t = i(e);
if (!t) return e;
var r = e.substring(t.length),
n = c[t] || o(t);
if (!n) return "+" + t + " " + r;
for (var a = n.formats, s = 0; s < a.length; s++) {
var d = a[s].testAndFormat(r);
if (d) return "+" + t + " " + d
}
return "+" + t + " " + r
}
var s = r(460),
d = /^(1|2[07]|3[0-469]|4[013-9]|5[1-8]|6[0-6]|7|8[1246]|9[0-58])/,
c = {};
n.prototype = {
testAndFormat: function(e) {
return this.regex.test(e) && this.checkLeadins(e) && e.replace(this.regex, this.formatString)
},
checkLeadins: function(e) {
return 0 === this.leadins.length || _.any(this.leadins, function(t) {
return t.test(e)
})
}
}, e.exports = {
findCC: i,
format: a
}
}, function(e, t) {
"use strict";
var r = {
CAPABILITY_URL: "https://web.whatsapp.com/browsers.html",
PP_URL: "https://dyn.web.whatsapp.com/pp",
LOGOUT_URL: "https://dyn.web.whatsapp.com/logout",
STATUS_URL: "https://web.whatsapp.com/status.json",
WAM_URL: "https://dyn.web.whatsapp.com/wam",
COOKIE_DOMAIN: ".web.whatsapp.com",
PP_TOK: "/pp",
PP_REF: "/pp",
UPLOAD_TO_CLB: 1,
FLAVOR_TAGS: !1,
WAM_ROTATE_INTERVAL: 3600,
SOCKETS: ["wss://w1.web.whatsapp.com/ws", "wss://w2.web.whatsapp.com/ws", "wss://w3.web.whatsapp.com/ws", "wss://w4.web.whatsapp.com/ws", "wss://w5.web.whatsapp.com/ws", "wss://w6.web.whatsapp.com/ws", "wss://w7.web.whatsapp.com/ws", "wss://w8.web.whatsapp.com/ws"]
};
e.exports = r
}, function(e, t, r) {
"use strict";
var n = function() {
window.Promise = r(317)["default"] = r(316), r(308), window.moment = r(0), window._ = r(142), window.Velocity = r(323), r(324), window.WebFont = r(325), window.CryptoJS = r(17), r(320), r(133), r(319), r(318), r(315);
var e = window.performance.now();
r(312), window.applicationCache && r(311), r(314), ["getSelection", "open", "focus"].forEach(function(e) {
var t = Object.getPrototypeOf(window)[e];
_.isFunction(t) && window[e] !== t && (window[e] = t)
}), window.Store = {
Conn: r(143),
Contact: r(310),
Stream: r(53),
Wap: r(30)
};
var t = r(40),
n = r(9);
window.Debug || (window.Debug = {}), window.Debug.uploadLogs = n.upload.bind(n), t.isGecko || WebFont.load({
google: {
families: ["Open Sans:400,600", "Roboto:300,400,500"]
}
}), window.l10n = r(313), l10n.init(r(13).getLangPref());
var o = r(1);
window.onerror = function(e, t, r, i, a) {
var s = void 0;
return s = t && "number" == typeof r ? " (" + t + ":" + r + ":" + i + ")" : t ? " (" + t + ")" : "", o.error("exe:onerror" + s + " " + e)(a), "Script error." !== e || a ? (a instanceof Error && a.stack ? (o.errorVerbose("exe:unhandled error: " + a.stack)(), n.upload(null)) : (o.error("exe:unhandled error: " + (e || "Given: " + a))(), n.upload(null)), !0) : (t && n.upload("script-error"), !1)
}, Promise.onPossiblyUnhandledRejection = function(e, t) {
o.error("exe:unhandled rejection: " + e)(), e && e.stack && o.error("exe:unhandled stack: " + e.stack)(), o.error("exe:unhandled promise: " + t)(t), e instanceof Error && e.stack ? (o.errorVerbose(e.stack)(), n.upload(null)) : n.upload("unhandled-rejection")
};
var i = r(309),
a = r(6);
window.Debug.VERSION = a.VERSION_STR;
var s = r(14);
window.onbeforeunload = function(e) {
return s.isDownloading() ? void s.clearDownloading() : (o.log("webclient close/reload triggered")(), o.log("latest hash: " + a.LATEST_HASH)(), o.log("version: " + a.VERSION_STR)(), s.promptUnloadGuards > 0 ? void 0 : i.hasPending() ? l10n.t("confirm_closing_webclient") : void 0)
}, window.addEventListener("dragover", function(e) {
e.preventDefault()
}), window.addEventListener("drop", function(e) {
e.preventDefault()
});
var d = r(24),
c = r(5);
d.render(c.createElement(i, null), document.getElementById("app"));
try {
r(89).PageLoad.set({
webcExeStart: 0 | e,
webcExeDone: 0 | window.performance.now()
})
} catch (u) {}
};
window.Exe = n, r(90)
}, , function(e, t, r) {
"use strict";
var n = r(5),
o = r(24),
i = r(72),
a = r(70),
s = r(139),
d = r(144),
c = r(136),
u = c.HotKeys,
l = r(92),
f = {
MEDIA: "media",
MAIN: "main"
},
h = n.createClass({
displayName: "ModalManager",
mixins: [i, s],
propTypes: {
type: n.PropTypes.oneOf(_.values(f)).isRequired
},
statics: {
DEFAULT_TRANSITION: "modal"
},
getInitialState: function() {
return {
flow: null
}
},
componentWillMount: function() {
this.props.type === f.MAIN ? (this.regCmd("open_modal", this.openFlow), this.regCmd("close_modal", this.closeFlow)) : (this.regCmd("open_modal_media", this.openFlow), this.regCmd("close_modal_media", this.closeFlow))
},
openFlow: function(e, t, r, n) {
this.uimPush(this, this.props.type === f.MAIN ? a.MODAL : a.MODAL_MEDIA, {
escapable: !n,
parent: r,
maintainFocus: !0
}), this.setState({
flow: e,
transition: t
}, this.focus)
},
focus: function() {
var e = o.findDOMNode(this);
e.contains(document.activeElement) || a.focusNode(e)
},
closeFlow: function() {
this.uimPop(this.props.type === f.MAIN ? a.MODAL : a.MODAL_MEDIA)
},
uimClose: function() {
this.setState({
flow: null,
transition: this.state.transition
})
},
uimFocus: function() {
this.focus()
},
onKeyPress: function(e) {
if (!e.metaKey && !e.ctrlKey) {
var t = o.findDOMNode(this);
if (t === document.activeElement) {
var r = _.toArray(t.querySelectorAll("input[data-tab]"));
if (r.length) {
var n = _.first(r);
u.flashFocus = Date.now(), n.restoreFocus ? n.restoreFocus() : a.focusNode(n)
}
}
}
},
onRotateFocus: function(e) {
var t = 1;
e && (e.stopPropagation(), e.preventDefault(), t = e.shiftKey ? -1 : 1, u.flashFocus = Date.now());
var r = _.toArray(o.findDOMNode(this).querySelectorAll("[data-tab]"));
if (r.length) {
r = _.sortBy(r, function(e) {
return parseInt(e.getAttribute("data-tab"), 10) || 0
});
var n = 0,
i = document.activeElement;
i && (n = d.ring(_.findIndex(r, function(e) {
return e.contains(i)
}) + t, r));
var s = r[n];
u.flashFocus = Date.now(), s.restoreFocus ? s.restoreFocus() : a.focusNode(s)
}
},
render: function() {
var e, t, r = this.state.transition;
r = _.isBoolean(r) && !r ? void 0 : r || h.DEFAULT_TRANSITION, this.state.flow && (r ? t = this.state.flow : e = this.state.flow);
var o = {
tab: this.onRotateFocus,
"shift+tab": this.onRotateFocus
};
return n.createElement(u, {
handlers: o,
onKeyPress: this.onKeyPress
}, e, n.createElement(l, {
transitionName: r
}, t))
}
});
e.exports = h
}, function(e, t, r) {
"use strict";
var n = r(5),
o = r(44),
i = n.createClass({
displayName: "Offline",
render: function() {
return n.createElement(o, {
title: l10n.t("computer_not_connected"),
body: l10n.t("make_sure_computer_active_internet_connection")
})
}
});
e.exports = i
}, function(e, t, r) {
"use strict";
function n() {
window.open("https://www.whatsapp.com/faq/web/28080002#proxies", "_blank")
}
var o = r(5),
i = r(44),
a = o.createClass({
displayName: "Proxied",
render: function() {
return o.createElement(i, {
title: l10n.t("cant_load_whatsapp"),
body: l10n.t("computer_behind_proxy"),
defaultLabel: l10n.t("learn_more"),
onDefault: n
})
}
});
e.exports = a
}, function(e, t, r) {
"use strict";
var n = r(5),
o = r(24),
i = r(10),
a = r(13),
s = r(91),
d = r(30),
c = r(137),
u = r(6),
l = r(8),
f = r(326),
h = r(98),
p = r(34),
m = r(45),
g = r(14),
v = r(39),
y = r(92),
b = r(338),
w = n.createClass({
displayName: "QRCode",
mixins: [s],
getInitialState: function() {
return {
rememberMe: a.getRememberMe(),
expired: i.state === i.STATE.UNPAIRED_IDLE,
offline: !h.online,
refValid: i.state === i.STATE.UNPAIRED
}
},
componentDidMount: function() {
this.addObserver(i, "change:state change:online", this.onStateChange)
},
onStateChange: function() {
this.setState({
offline: !h.online,
expired: i.state === i.STATE.UNPAIRED_IDLE,
refValid: i.state === i.STATE.UNPAIRED
})
},
onQRExpiry: function() {
this.setState({
ref: void 0
}), i.poke()
},
onRememberMeChange: function(e) {
i.isIncognito || d.setRememberMe(e.target.checked)["catch"](_.noop), a.setRememberMe(e.target.checked), this.setState({
rememberMe: a.getRememberMe()
})
},
render: function() {
var e = void 0;
e = this.state.offline ? n.createElement(E, null, n.createElement("button", {
className: "qr-button",
key: "expiry"
}, n.createElement("div", {
className: "icon icon-connection-l-light"
}), l10n.t("check_internet_connection"))) : this.state.expired ? n.createElement(E, null, n.createElement("button", {
className: "qr-button",
key: "expiry",
onClick: this.onQRExpiry
}, n.createElement("div", {
className: "qr-container"
}, n.createElement("div", {
className: "icon icon-refresh-l-light"
}), l10n.t("click_to_reload_qr_code")))) : this.state.refValid ? n.createElement(E, null) : n.createElement("div", {
className: "qrcode"
}, n.createElement(c, null));
var t = this.state.rememberMe ? null : n.createElement("div", {
className: "remember-me-tip"
}, l10n.t("if_unchecked_you_will_be_logged_out_afterawhile"));
return n.createElement("div", {
id: "wrapper"
}, n.createElement("div", {
id: "window"
}, n.createElement("div", {
className: "entry-main"
}, e, n.createElement("div", {
className: "entry-text"
}, n.createElement("div", {
className: "entry-title"
}, l10n.t("whatsapp_web")), n.createElement("div", {
className: "entry-subtitle"
}, l10n.t("scan_code_with_phone_to_login")), n.createElement("div", {
className: "entry-controls"
}, n.createElement("div", {
className: "toggle"
}, n.createElement(y, {
transitionName: "fade_sifo"
}, t), n.createElement("label", null, n.createElement("input", {
type: "checkbox",
name: "rememberMe",
checked: this.state.rememberMe,
onChange: this.onRememberMeChange
}), l10n.t("menuitem_keep_me_signed_in"))), n.createElement("div", {
className: "hint"
}, l10n.t("reduce_data_usage_connect_phone_to_wifi"))))), n.createElement("div", {
id: "platforms"
}, n.createElement("ul", {
className: "list entry-platforms"
}, n.createElement(S, {
platform: "android",
path: l10n.t("android_login_path"),
name: l10n.t("android")
}), n.createElement(S, {
platform: "iphone",
path: l10n.t("iphone_login_path"),
name: l10n.t("iphone")
}), n.createElement(S, {
platform: "wp",
path: l10n.t("windows_phone_login_path"),
name: l10n.t("windows_phone")
}), n.createElement(S, {
platform: "bb",
path: l10n.t("blackberry_login_path"),
name: l10n.t("blackberry")
}), n.createElement(S, {
platform: "bb10",
path: l10n.t("bb10_login_path"),
name: l10n.t("bb10")
}), n.createElement(S, {
platform: "s60",
path: l10n.t("nokia_symbian_s60_login_path"),
name: l10n.t("nokia_symbian_s60")
})))))
}
}),
E = n.createClass({
displayName: "QR",
mixins: [s],
propTypes: {
children: n.PropTypes.element
},
getInitialState: function() {
return {
disableCursor: !1
}
},
componentDidMount: function() {
this.addObserverAndRun(Store.Conn, "change:ref", this.genQR)
},
genQR: function() {
var e = this.getData();
if (e) {
var t = o.findDOMNode(this);
this.qr ? this.qr.makeCode(e) : this.qr = new b(t, {
text: e,
colorDark: "#122e31",
width: u.QR_EDGE,
height: u.QR_EDGE,
correctLevel: b.CorrectLevel.L
}), t.removeAttribute("title"), t.setAttribute("data-ref", e)
}
},
getData: function() {
if (!Store.Conn.connected) {
var e = Store.Conn.ref,
t = m.getOrGenerate(),
r = g.id();
return e + "," + t + "," + r
}
},
copy: function() {
var e = window.getSelection();
e.selectAllChildren(document.getElementById("qr-code-copy")), document.execCommand("copy"), l.closeModal()
},
onMouseMove: function(e) {
var t = this;
this.state.disableCursor && this.setState({
disableCursor: !1
}), this.disableCursorPromise && this.disableCursorPromise.cancel(), this.disableCursorPromise = p.delay(1e3).cancellable().then(function(e) {
t.isMounted() && t.setState({
disableCursor: !0
})
})["finally"](function() {
t.isMounted() && (t.disableCursorPromise = void 0)
})["catch"](Promise.CancellationError, _.noop)
},
onMouseLeave: function(e) {
this.disableCursorPromise && this.disableCursorPromise.cancel()
},
onContextMenu: function(e) {
e.stopPropagation(), e.preventDefault(), l.openModal(n.createElement(f, {
onOK: this.copy,
okText: "Copy to Clibboard"
}, n.createElement("span", {
id: "qr-code-copy"
}, this.state.data)))
},
render: function() {
var e = this.props.children,
t = v("qrcode", {
idle: !!e
}),
r = {};
this.state.disableCursor && !e && (r.cursor = "none");
var o = null;
return n.createElement("div", {
className: t,
onContextMenu: o,
style: r,
onMouseMove: this.onMouseMove,
onMouseLeave: this.onMouseLeave
}, n.createElement(y, {
transitionName: "scale"
}, e), n.createElement("span", {
className: "icon icon-logo"
}))
}
}),
S = n.createClass({
displayName: "LoginPlatform",
propTypes: {
platform: n.PropTypes.oneOf(["android", "iphone", "bb", "wp", "bb10", "s60"]).isRequired,
name: n.PropTypes.string.isRequired,
path: n.PropTypes.string.isRequired
},
render: function() {
var e = "icon icon-platform icon-platform-" + this.props.platform;
return n.createElement("li", {
className: "list-item entry-platform"
}, n.createElement("span", {
className: e,
title: this.props.name
}), n.createElement("div", null, n.createElement("div", {
className: "entry-platform-title"
}, this.props.name), n.createElement("div", {
className: "entry-platform-text"
}, this.props.path)))
}
});
e.exports = w
}, function(e, t, r) {
"use strict";
function n(e, t) {
return Promise.any(t).cancellable().then(function() {
e.forceTimeout()
})["finally"](function() {
t.forEach(function(e) {
e.cancel()
})
})["catch"](Promise.CancellationError, _.noop)
}
function o() {
return m.waitForEvent(window, "online").then(function() {
return Promise.delay(y)
})
}
function i(e) {
var t, r, n = e.data;
if (n instanceof ArrayBuffer) {
for (var o, i = [], a = u.wrap(n); 44 !== (o = a.readByte());) i.push(o);
t = String.fromCharCode.apply(String, i), r = a
} else {
var s = n.indexOf(",");
t = n.slice(0, s), r = n.slice(s + 1), r = r ? JSON.parse(r) : r
}
return {
tag: t,
data: r
}
}
var a, s, d = r(6),
c = r(43),
u = r(7),
l = r(98),
f = r(8),
h = r(1),
p = r(9),
m = r(25),
g = r(153),
v = r(97),
y = 100,
b = 3e5,
w = 6e3,
E = 2,
S = .2,
N = g.FIBONACCI(8e3, 4e3, 3e5),
T = c.extend({
props: {
active: {
type: "boolean",
"default": !0
},
socket: "object",
sockets: "object",
attempts: {
type: "number",
"default": 0
},
startId: {
type: "number",
"default": 0
},
controller: "object",
retryTimestamp: "number",
tsListener: "function",
onerror: "function",
_resolve: "function",
_reject: "function"
},
initialize: function() {
var e = this;
"undefined" == typeof a && (a = d.SOCKETS, s = Date.now() % a.length), this.sockets = [], new Promise(function(t, r) {
e._resolve = t, e._reject = r
}).then(function(t) {
h.log("SocketOpener set to socket " + t.id)(), e.set({
active: !1,
socket: t
}), l.online = !0
})["finally"](function() {
e.stopListening(), h.log("SocketOpener closing socket opener")(), e.active = !1, _.forEach(e.sockets, function(e) {
e.cancel()
});
var t = e.controller;
t && (t.deactivate(), e.controller = null)
})["catch"](Promise.CancellationError, _.noop)["catch"](function(t) {
return h.error("SocketOpener deadly error! " + t)(t), e.onerror ? void e.onerror(t) : Promise.reject(t)
}), this.tsListener = function(t) {
e.retryTimestamp = t.ts
}, this.listenTo(l, "change:online", this.onOnlineChange), this.onOnlineChange()
},
attemptOpen: function() {
if (!this.active) return h.log("attemptOpen called while not active!")(), void p.upload("rogue-opener");
var e = v.numSocketsAttempted,
t = v.open({
url: a[(e + s) % a.length],
msgParser: i
});
this.attempts = this.sockets.push(t);
var r = _.once(function() {
l.checkOnline()
}),
n = _.delay(r, 6e3);
t.then(this._resolve)["finally"](function() {
return clearTimeout(n)
})["catch"](Promise.CancellationError, _.noop)["catch"](r)
},
poke: function() {
this.controller && this.controller.forceTimeout()
},
onOnlineChange: function() {
if (this.active) {
var e = this.controller,
t = l.online ? this.onlineController() : this.offlineController();
e && (e.off("change:ts", this.tsListener), e.deactivate()), t.on("change:ts", this.tsListener), t.activate(), this.controller = t
}
},
onlineController: function() {
var e = this;
return h.log("SocketOpener:onlineController activating")(), new g({
waitAlgorithm: N,
jitter: S,
onActivated: function() {
e.attemptOpen()
},
onTimeout: function() {
return e.attemptOpen(), !0
}
})
},
offlineController: function() {
var e = this;
h.log("SocketOpener:offlineController activating")();
var t = 0,
r = void 0,
i = function(e) {
return r && r.cancel(), navigator.onLine ? t++ < E ? (h.log("SocketOpener:offline... quick poll")(), r = null, w) : (h.log("SocketOpener:offline... heuristic poll")(), r = n(e, [o(), m.waitForBBEvent(f, "js_halt_detected"), m.waitForBBEvent(Store.Stream, "change:available")]), b) : (h.log("SocketOpener:offline... wait for navigator")(), t = 0, r = n(e, [o()]), b)
};
return new g({
waitAlgorithm: i,
jitter: S,
onActivated: function() {
0 === e.pendingAttempts() && e.attemptOpen()
},
onDeactivated: function() {
r && r.cancel()
},
onTimeout: function() {
return e.attemptOpen(), !0
}
})
},
deactivate: function() {
this._reject(new Promise.CancellationError)
},
pendingAttempts: function() {
return _.sum(this.sockets, function(e) {
return e.isPending() ? 1 : 0
})
}
});
e.exports = T
}, function(e, t, r) {
"use strict";
var n = r(5),
o = r(137),
i = r(10),
a = r(53),
s = r(135),
d = r(91),
c = r(72),
u = r(44),
l = 80,
f = 5,
h = (100 - l) / f,
p = n.createClass({
displayName: "Startup",
mixins: [s, d, c],
getInitialState: function() {
return {
retriable: !1,
progress: l
}
},
componentWillMount: function() {
var e = this;
this.addObserver(a, "change:displayInfo"), this.addObserver(i, "change:retryTimestamp", this.retried), this.regCmd("increment_progress", function() {
var t = e.state.progress + h;
e.setState({
progress: t
})
})
},
retried: function() {
this.clearSafeTimeout(this.timeout), delete this.timeout, this.clearSafeInterval(this.interval), delete this.interval, this.setState({
retriable: !1
}), this.startTimeout()
},
componentDidMount: function() {
this.startTimeout();
var e = document.getElementById("initial_startup");
e && e.parentNode.removeChild(e)
},
startTimeout: function() {
this.timeout = this.safeDelay(this.allowRetry, 3e3)
},
allowRetry: function() {
this.setState({
retriable: !0
}), this.interval = this.safeInterval(this.forceUpdate, 1e3)
},
retry: function(e) {
i.poke(), this.retried()
},
logout: function(e) {
i.logout()
},
render: function() {
var e, t, r, s, d, c, l = null;
switch (a.displayInfo) {
case a.INFO.OPENING:
e = l10n.t("connecting_to_whatsapp"), t = l10n.t("make_sure_computer_active_internet_connection"), d = this.logout;
break;
case a.INFO.PAIRING:
case a.INFO.TIMEOUT:
e = l10n.t("trying_to_reach_phone");
var f = window.open.bind(window, "http://www.whatsapp.com/faq/web/28080002", "_blank");
t = n.createElement("span", null, l10n.t("make_sure_phone_active_internet_connection"), " ", n.createElement("span", {
className: "action",
onClick: f
}, l10n.t("learn_more"))), d = this.logout;
break;
case a.INFO.SYNCING:
case a.INFO.CONNECTING:
return n.createElement("div", {
id: "startup"
}, n.createElement(o, {
size: 50,
stroke: 4
}), l);
default:
return null
}
if (c = this.state.retriable)
if (r = i.retryTimestamp - Date.now(), 1 > r) s = l10n.t("retrying"), _.defer(function() {
return i.poke()
});
else if (6e4 > r) {
var h = Math.ceil(r / 1e3);
s = l10n.t("retrying_in_some_seconds", {
number: h,
_plural: h
})
} else s = l10n.t("retrying_in", {
duration: moment.duration(r).humanize()
});
else s = l10n.t("retrying");
return n.createElement(u, {
title: e,
body: s,
tip: t,
defaultLabel: l10n.t("retry_now"),
onDefault: c ? this.retry : _.noop,
cancelLabel: d ? l10n.t("menuitem_logout") : null,
onCancel: d
})
}
});
e.exports = p
}, function(e, t) {
"use strict";
function r(e, t) {
d[e] || (d[e] = []), -1 === d[e].indexOf(t) && d[e].push(t)
}
function n(e, t) {
if (d[e]) {
var r = d[e].indexOf(t); - 1 !== r && d[e].splice(r, 1)
}
}
function o(e, t, r, n) {
d[e] && d[e].forEach(function(e) {
return e.call(null, t, r, n)
})
}
function i(e, t, r, n) {
if (e) {
var o = void 0;
if (self.MessageChannel && n) {
var i = new MessageChannel;
i.port1.onmessage = n, o = [i.port2]
}
e.postMessage({
command: t,
message: r,
version: "0.2.532"
}, o)
}
}
function a(e, t, r) {
e.forEach(function(e) {
return i(e, t, r)
})
}
function s(e) {
if (self.window && e.source !== navigator.serviceWorker.controller) o("log", {
buffer: [{
level: "error",
message: ["Invalid message received from a service worker, sw origin: " + e.origin, e.data]
}]
});
else {
var t = e.data.command || "unknown",
r = void 0;
e.ports && 0 !== e.ports.length && (r = function(t) {
e.ports.forEach(function(e) {
return e.postMessage(t)
})
}), o(t, e.data.message, r, e.data.version)
}
}
var d = {
unknown: []
},
c = self.window ? self.navigator.serviceWorker : self;
try {
c.addEventListener("message", s)
} catch (u) {}
e.exports = {
on: r,
off: n,
trigger: o,
send: i,
broadcast: a
}
}, function(e, t, r) {
"use strict";
var n = r(5),
o = r(10),
i = r(44),
a = n.createClass({
displayName: "TOS",
render: function() {
return n.createElement(i, {
body: l10n.t("web_terms_of_service_login_block"),
cancelLabel: l10n.t("menuitem_logout"),
onCancel: o.logout.bind(o, !0),
defaultLabel: l10n.t("login"),
onDefault: o.poke.bind(o)
})
}
});
e.exports = a
}, function(e, t) {
"use strict";
function r(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var n = function() {
function e(e, t) {
for (var r = 0; r < t.length; r++) {
var n = t[r];
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n)
}
}
return function(t, r, n) {
return r && e(t.prototype, r), n && e(t, n), t
}
}(),
o = function() {
function e() {
r(this, e), this.activeNotifications = {}
}
return n(e, [{
key: "showNotification",
value: function(e, t, r) {
this.activeNotifications[e] || (this.activeNotifications[e] = {});
var n = this.activeNotifications[e][t];
n && n.close && n.close(), this.activeNotifications[e][t] = r
}
}, {
key: "closeNotification",
value: function(e) {
var t = _.findKey(this.activeNotifications, function(t) {
return !!t[e]
});
if (t) {
var r = this.activeNotifications[t][e];
r.close && r.close(), delete this.activeNotifications[t][e], _.isEmpty(this.activeNotifications[t]) && delete this.activeNotifications[t]
}
}
}, {
key: "closeChatNotifications",
value: function(e) {
_.forEach(this.activeNotifications[e], function(e, t) {
e && e.close && e.close()
}), delete this.activeNotifications[e]
}
}, {
key: "closeAllNotifications",
value: function() {
_.forEach(this.activeNotifications, function(e, t) {
_.forEach(e, function(e, t) {
e && e.close && e.close()
})
}), this.activeNotifications = {}
}
}]), e
}();
e.exports = o
}, function(e, t) {
"use strict";
e.exports = {
setCookie: function(e, t) {
var r = ["name", "value", "domain", "path", "secure", "session", "expirationDate"];
e.session && delete e.expirationDate;
var n = [];
_.forEach(r, function(t) {
var r = e[t];
if (void 0 !== r && "value" !== t) switch (t) {
case "expirationDate":
var o = new Date(e.expirationDate);
n.push("expires=" + o.toUTCString());
break;
case "secure":
n.push("secure");
break;
case "name":
var i = e.value || "";
n.push(r + "=" + i);
break;
default:
n.push(t + "=" + r)
}
}), document.cookie = n.join(";")
}
}
}, function(e, t) {
"use strict";
var r = {
LOW: "low",
HIGH: "high"
},
n = window.matchMedia("\n only screen and (-webkit-min-device-pixel-ratio: 2),\n only screen and (min-device-pixel-ratio: 2),\n only screen and (min-resolution: 2dppx)\n"),
o = {
RES: r,
currentRes: n.matches ? r.HIGH : r.LOW
},
i = function(e) {
var t = e.matches ? r.HIGH : r.LOW;
if (t !== o.currentRes) {
o.currentRes = t;
var n = document.createEvent("Event");
n.initEvent("dpichange", !0, !0), window.dispatchEvent(n)
}
};
n.addListener(i), e.exports = o
}, function(e, t) {
"use strict";
function r(e) {
this.styleSheet = this.createStyleSheet(e), this.rules = {}
}
r.prototype.createStyleSheet = function(e) {
e = e || _.uniqueId("dynamic-style-");
var t = document.createElement("style");
return t.id = e, t.type = "text/css", document.head.appendChild(t), t = t.sheet
}, r.prototype.addRule = function(e, t) {
var r = this.styleSheet.cssRules.length;
return t = _.map(t, function(e, t) {
return t + ": " + e + ";"
}).join(" "), this.styleSheet.insertRule(e + " { " + t + " }", r), this.rules[e] = this.styleSheet.cssRules[r], this.rules[e]
}, r.prototype.updateRule = function(e, t) {
var r = this.rules[e];
return _.forEach(t, function(e, t) {
r.style[_.camelCase(t)] = e
}), r
}, r.prototype.setRule = function(e, t) {
var r = this.rules[e];
return r ? this.updateRule(e, t) : this.addRule(e, t)
}, e.exports = r
}, function(e, t) {
"use strict";
e.exports = {
"": "ordered0001",
"": "ordered0003",
"": "ordered0004",
"": "ordered0005",
"": "ordered0006",
"": "ordered0007",
"": "ordered0008",
"": "ordered0009",
"": "ordered0010",
"": "ordered0011",
"": "ordered0012",
"": "ordered0013",
"": "ordered0014",
"": "ordered0015",
"": "ordered0016",
"": "ordered0017",
"": "ordered0018",
"": "ordered0019",
"": "ordered0020",
"": "ordered0021",
"": "ordered0022",
"": "ordered0023",
"": "ordered0024",
"": "ordered0025",
"": "ordered0026",
"": "ordered0027",
"": "ordered0028",
"": "ordered0030",
"": "ordered0031",
"": "ordered0032",
"": "ordered0033",
"": "ordered0037",
"": "ordered0040",
"": "ordered0044",
"": "ordered0045",
"": "ordered0046",
"": "ordered0047",
"": "ordered0048",
"": "ordered0049",
"": "ordered0050",
"": "ordered0051",
"": "ordered0052",
"": "ordered0053",
"": "ordered0054",
"": "ordered0058",
"": "ordered0059",
"": "ordered0060",
"": "ordered0061",
"": "ordered0063",
"": "ordered0078",
"": "ordered0079",
"": "ordered0080",
"": "ordered0081",
"": "ordered0082",
"": "ordered0083",
"": "ordered0084",
"": "ordered0085",
"": "ordered0086",
"": "ordered0087",
"": "ordered0088",
"": "ordered0089",
"": "ordered0090",
"": "ordered0091",
"": "ordered0092",
"": "ordered0093",
"": "ordered0094",
"": "ordered0095",
"": "ordered0096",
"": "ordered0097",
"": "ordered0099",
"": "ordered0106",
"": "ordered0107",
"": "ordered0108",
"": "ordered0109",
"": "ordered0112",
"": "ordered0113",
"": "ordered0114",
"": "ordered0115",
"": "ordered0117",
"": "ordered0121",
"": "ordered0123",
"": "ordered0126",
"": "ordered0127",
"": "ordered0129",
"": "ordered0138",
"": "ordered0139",
"": "ordered0140",
"": "ordered0141",
"": "ordered0142",
"": "ordered0143",
"": "ordered0144",
"": "ordered0150",
"": "ordered0156",
"": "ordered0168",
"": "ordered0169",
"": "ordered0170",
"": "ordered0171",
"": "ordered0174",
"": "ordered0175",
"": "ordered0176",
"": "ordered0177",
"": "ordered0178",
"": "ordered0179",
"": "ordered0180",
"": "ordered0181",
"": "ordered0182",
"": "ordered0183",
"": "ordered0184",
"": "ordered0186",
"": "ordered0187",
"": "ordered0188",
"": "ordered0189",
"": "ordered0190",
"": "ordered0191",
"": "ordered0192",
"": "ordered0193",
"": "ordered0194",
"": "ordered0195",
"": "ordered0196",
"": "ordered0197",
"": "ordered0198",
"": "ordered0199",
"": "ordered0200",
"": "ordered0201",
"": "ordered0202",
"": "ordered0203",
"": "ordered0204",
"": "ordered0205",
"": "ordered0206",
"": "ordered0207",
"": "ordered0208",
"": "ordered0209",
"": "ordered0210",
"": "ordered0211",
"": "ordered0212",
"": "ordered0213",
"": "ordered0214",
"": "ordered0215",
"": "ordered0216",
"": "ordered0217",
"": "ordered0218",
"": "ordered0219",
"": "ordered0220",
"": "ordered0221",
"": "ordered0222",
"": "ordered0269",
"": "ordered0278",
"": "ordered0289",
"": "ordered0297",
"": "ordered0299",
"": "ordered0332",
"": "ordered0336",
"": "ordered0344",
"": "ordered0412",
"": "ordered0452",
"": "ordered0470",
"": "ordered0471",
"": "ordered0472",
"": "ordered0473",
"": "ordered0474",
"": "ordered0475",
"": "ordered0476",
"": "ordered0477",
"": "ordered0478",
"": "ordered0479",
"": "ordered0480",
"": "ordered0481",
"": "ordered0482",
"": "ordered0483",
"": "ordered0484",
"": "ordered0485",
"": "ordered0486",
"": "ordered0487",
"": "ordered0488",
"": "ordered0489",
"": "ordered0490",
"": "ordered0491",
"": "ordered0492",
"": "ordered0493",
"": "ordered0494",
"": "ordered0495",
"": "ordered0496",
"": "ordered0497",
"": "ordered0498",
"": "ordered0499",
"": "ordered0500",
"": "ordered0501",
"": "ordered0502",
"": "ordered0503",
"": "ordered0504",
"": "ordered0505",
"": "ordered0506",
"": "ordered0507",
"": "ordered0508",
"": "ordered0509",
"": "ordered0510",
"": "ordered0511",
"": "ordered0512",
"": "ordered0513",
"": "ordered0514",
"": "ordered0515",
"": "ordered0516",
"": "ordered0517",
"": "ordered0531",
"": "ordered0532",
"": "ordered0533",
"": "ordered0534",
"": "ordered0535",
"": "ordered0536",
"": "ordered0538",
"": "ordered0539",
"": "ordered0540",
"": "ordered0541",
"": "ordered0542",
"": "ordered0543",
"": "ordered0544",
"": "ordered0545",
"": "ordered0546",
"": "ordered0547",
"": "ordered0548",
"": "ordered0549",
"": "ordered0550",
"": "ordered0551",
"": "ordered0552",
"": "ordered0553",
"": "ordered0554",
"": "ordered0555",
"": "ordered0556",
"": "ordered0557",
"": "ordered0558",
"": "ordered0559",
"": "ordered0560",
"": "ordered0561",
"": "ordered0562",
"": "ordered0563",
"": "ordered0564",
"": "ordered0565",
"": "ordered0566",
"": "ordered0567",
"": "ordered0568",
"": "ordered0569",
"": "ordered0570",
"": "ordered0571",
"": "ordered0572",
"": "ordered0573",
"": "ordered0574",
"": "ordered0575",
"": "ordered0576",
"": "ordered0577",
"": "ordered0578",
"": "ordered0579",
"": "ordered0580",
"": "ordered0581",
"": "ordered0582",
"": "ordered0583",
"": "ordered0584",
"": "ordered0585",
"": "ordered0586",
"": "ordered0587",
"": "ordered0588",
"": "ordered0589",
"": "ordered0590",
"": "ordered0591",
"": "ordered0592",
"": "ordered0593",
"": "ordered0594",
"": "ordered0595",
"": "ordered0596",
"": "ordered0597",
"": "ordered0598",
"": "ordered0599",
"": "ordered0600",
"": "ordered0601",
"": "ordered0602",
"": "ordered0603",
"": "ordered0604",
"": "ordered0605",
"": "ordered0606",
"": "ordered0607",
"": "ordered0611",
"": "ordered0612",
"": "ordered0613",
"": "ordered0614",
"": "ordered0615",
"": "ordered0616",
"": "ordered0622",
"": "ordered0623",
"": "ordered0624",
"": "ordered0625",
"": "ordered0626",
"": "ordered0627",
"": "ordered0628",
"": "ordered0629",
"": "ordered0630",
"": "ordered0631",
"": "ordered0632",
"": "ordered0633",
"": "ordered0634",
"": "ordered0635",
"": "ordered0643",
"": "ordered0644",
"": "ordered0645",
"": "ordered0646",
"": "ordered0647",
"": "ordered0648",
"": "ordered0649",
"": "ordered0650",
"": "ordered0651",
"": "ordered0652",
"": "ordered0653",
"": "ordered0654",
"": "ordered0655",
"": "ordered0656",
"": "ordered0657",
"": "ordered0658",
"": "ordered0659",
"": "ordered0660",
"": "ordered0661",
"": "ordered0662",
"": "ordered0663",
"": "ordered0664",
"": "ordered0665",
"": "ordered0666",
"": "ordered0667",
"": "ordered0668",
"": "ordered0669",
"": "ordered0670",
"": "ordered0671",
"": "ordered0672",
"": "ordered0673",
"": "ordered0674",
"": "ordered0675",
"": "ordered0676",
"": "ordered0677",
"": "ordered0678",
"": "ordered0684",
"": "ordered0691",
"": "ordered0692",
"": "ordered0698",
"": "ordered0699",
"": "ordered0700",
"": "ordered0732",
"": "ordered0733",
"": "ordered0734",
"": "ordered0735",
"": "ordered0736",
"": "ordered0737",
"": "ordered0738",
"": "ordered0739",
"": "ordered0740",
"": "ordered0741",
"": "ordered0742",
"": "ordered0743",
"": "ordered0744",
"": "ordered0745",
"": "ordered0746",
"": "ordered0747",
"": "ordered0748",
"": "ordered0761",
"": "ordered0762",
"": "ordered0763",
"": "ordered0764",
"": "ordered0765",
"": "ordered0766",
"": "ordered0767",
"": "ordered0768",
"": "ordered0769",
"": "ordered0770",
"": "ordered0771",
"": "ordered0772",
"": "ordered0773",
"": "ordered0774",
"": "ordered0775",
"": "ordered0776",
"": "ordered0777",
"": "ordered0778",
"": "ordered0779",
"": "ordered0780",
"": "ordered0781",
"": "ordered0782",
"": "ordered0783",
"": "ordered0784",
"": "ordered0785",
"": "ordered0786",
"": "ordered0787",
"": "ordered0788",
"": "ordered0789",
"": "ordered0790",
"": "ordered0791",
"": "ordered0792",
"": "ordered0793",
"": "ordered0794",
"": "ordered0795",
"": "ordered0796",
"": "ordered0797",
"": "ordered0798",
"": "ordered0799",
"": "ordered0800",
"": "ordered0801",
"": "ordered0802",
"": "ordered0803",
"": "ordered0804",
"": "ordered0805",
"": "ordered0806",
"": "ordered0807",
"": "ordered0808",
"": "ordered0809",
"": "ordered0810",
"": "ordered0811",
"": "ordered0812",
"": "ordered0813",
"": "ordered0814",
"": "ordered0815",
"": "ordered0816",
"": "ordered0817",
"": "ordered0818",
"": "ordered0819",
"": "ordered0820",
"": "ordered0821",
"": "ordered0822",
"": "ordered0823",
"": "ordered0825",
"": "ordered0828",
"": "ordered0834",
"": "ordered0840",
"": "ordered0841",
"": "ordered0842",
"": "ordered0848",
"": "ordered0854",
"": "ordered0860",
"": "ordered0866",
"": "ordered0872",
"": "ordered0878",
"": "ordered0884",
"": "ordered0890",
"": "ordered0896",
"": "ordered0902",
"": "ordered0908",
"": "ordered0909",
"": "ordered0910",
"": "ordered0911",
"": "ordered0912",
"": "ordered0913",
"": "ordered0914",
"": "ordered0915",
"": "ordered0916",
"": "ordered0917",
"": "ordered0918",
"": "ordered0919",
"": "ordered0920",
"": "ordered0921",
"": "ordered0922",
"": "ordered0923",
"": "ordered0924",
"": "ordered0925",
"": "ordered0926",
"": "ordered0927",
"": "ordered0928",
"": "ordered0929",
"": "ordered0935",
"": "ordered0941",
"": "ordered0947",
"": "ordered0953",
"": "ordered0968",
"": "ordered0969",
"": "ordered0970",
"": "ordered0971",
"": "ordered0977",
"": "ordered0978",
"": "ordered0984",
"": "ordered0990",
"": "ordered0996",
"": "ordered1002",
"": "ordered1008",
"": "ordered1014",
"": "ordered1020",
"": "ordered1026",
"": "ordered1032",
"": "ordered1033",
"": "ordered1034",
"": "ordered1035",
"": "ordered1041",
"": "ordered1042",
"": "ordered1043",
"": "ordered1044",
"": "ordered1045",
"": "ordered1051",
"": "ordered1057",
"": "ordered1063",
"": "ordered1064",
"": "ordered1070",
"": "ordered1076",
"": "ordered1082",
"": "ordered1083",
"": "ordered1084",
"": "ordered1085",
"": "ordered1086",
"": "ordered1087",
"": "ordered1088",
"": "ordered1089",
"": "ordered1092",
"": "ordered1093",
"": "ordered1096",
"": "ordered1097",
"": "ordered1098",
"": "ordered1099",
"": "ordered1100",
"": "ordered1101",
"": "ordered1102",
"": "ordered1103",
"": "ordered1104",
"": "ordered1105",
"": "ordered1106",
"": "ordered1107",
"": "ordered1108",
"": "ordered1109",
"": "ordered1110",
"": "ordered1111",
"": "ordered1112",
"": "ordered1113",
"": "ordered1114",
"": "ordered1115",
"": "ordered1116",
"": "ordered1117",
"": "ordered1118",
"": "ordered1119",
"": "ordered1120",
"": "ordered1126",
"": "ordered1127",
"": "ordered1128",
"": "ordered1129",
"": "ordered1130",
"": "ordered1131",
"": "ordered1132",
"": "ordered1133",
"": "ordered1134",
"": "ordered1135",
"": "ordered1136",
"": "ordered1137",
"": "ordered1138",
"": "ordered1139",
"": "ordered1140",
"": "ordered1141",
"": "ordered1142",
"": "ordered1143",
"": "ordered1144",
"": "ordered1145",
"": "ordered1146",
"": "ordered1147",
"": "ordered1148",
"": "ordered1149",
"": "ordered1150",
"": "ordered1151",
"": "ordered1152",
"": "ordered1153",
"": "ordered1154",
"": "ordered1155",
"": "ordered1156",
"": "ordered1157",
"": "ordered1158",
"": "ordered1159",
"": "ordered1160",
"": "ordered1161",
"": "ordered1162",
"": "ordered1163",
"": "ordered1164",
"": "ordered1165",
"": "ordered1166",
"": "ordered1167",
"": "ordered1168",
"": "ordered1169",
"": "ordered1170",
"": "ordered1171",
"": "ordered1172",
"": "ordered1173",
"": "ordered1174",
"": "ordered1175",
"": "ordered1176",
"": "ordered1177",
"": "ordered1178",
"": "ordered1179",
"": "ordered1180",
"": "ordered1181",
"": "ordered1182",
"": "ordered1183",
"": "ordered1184",
"": "ordered1185",
"": "ordered1186",
"": "ordered1187",
"": "ordered1188",
"": "ordered1189",
"": "ordered1190",
"": "ordered1191",
"": "ordered1192",
"": "ordered1193",
"": "ordered1194",
"": "ordered1195",
"": "ordered1196",
"": "ordered1197",
"": "ordered1198",
"": "ordered1199",
"": "ordered1200",
"": "ordered1201",
"": "ordered1202",
"": "ordered1204",
"": "ordered1205",
"": "ordered1206",
"": "ordered1207",
"": "ordered1210",
"": "ordered1211",
"": "ordered1212",
"": "ordered1213",
"": "ordered1214",
"": "ordered1215",
"": "ordered1216",
"": "ordered1217",
"": "ordered1218",
"": "ordered1219",
"": "ordered1220",
"": "ordered1221",
"": "ordered1222",
"": "ordered1223",
"": "ordered1224",
"": "ordered1225",
"": "ordered1226",
"": "ordered1227",
"": "ordered1228",
"": "ordered1229",
"": "ordered1230",
"": "ordered1231",
"": "ordered1232",
"": "ordered1233",
"": "ordered1234",
"": "ordered1235",
"": "ordered1236",
"": "ordered1237",
"": "ordered1238",
"": "ordered1239",
"": "ordered1240",
"": "ordered1241",
"": "ordered1242",
"": "ordered1243",
"": "ordered1244",
"": "ordered1245",
"": "ordered1246",
"": "ordered1247",
"": "ordered1248",
"": "ordered1249",
"": "ordered1250",
"": "ordered1251",
"": "ordered1252",
"": "ordered1253",
"": "ordered1254",
"": "ordered1255",
"": "ordered1256",
"": "ordered1257",
"": "ordered1258",
"": "ordered1259",
"": "ordered1260",
"": "ordered1261",
"": "ordered1262",
"": "ordered1263",
"": "ordered1264",
"": "ordered1265",
"": "ordered1266",
"": "ordered1267",
"": "ordered1268",
"": "ordered1269",
"": "ordered1270",
"": "ordered1271",
"": "ordered1278",
"": "ordered1279",
"": "ordered1280",
"": "ordered1281",
"": "ordered1282",
"": "ordered1283",
"": "ordered1284",
"": "ordered1285",
"": "ordered1286",
"": "ordered1287",
"": "ordered1288",
"": "ordered1289",
"": "ordered1290",
"": "ordered1291",
"": "ordered1292",
"": "ordered1293",
"": "ordered1294",
"": "ordered1295",
"": "ordered1296",
"": "ordered1297",
"": "ordered1298",
"": "ordered1299",
"": "ordered1300",
"": "ordered1301",
"": "ordered1322",
"": "ordered1328",
"": "ordered1354",
"": "ordered1355",
"": "ordered1356",
"": "ordered1357",
"": "ordered1358",
"": "ordered1359",
"": "ordered1360",
"": "ordered1361",
"": "ordered1362",
"": "ordered1363",
"": "ordered1364",
"": "ordered1365",
"": "ordered1366",
"": "ordered1367",
"": "ordered1368",
"": "ordered1369",
"": "ordered1370",
"": "ordered1371",
"": "ordered1372",
"": "ordered1373",
"": "ordered1374",
"": "ordered1375",
"": "ordered1376",
"": "ordered1377",
"": "ordered1378",
"": "ordered1379",
"": "ordered1380",
"": "ordered1381",
"": "ordered1382",
"": "ordered1383",
"": "ordered1384",
"": "ordered1385",
"": "ordered1386",
"": "ordered1387",
"": "ordered1388",
"": "ordered1389",
"": "ordered1390",
"": "ordered1391",
"": "ordered1392",
"": "ordered1393",
"": "ordered1394",
"": "ordered1395",
"": "ordered1396",
"": "ordered1397",
"": "ordered1398",
"": "ordered1399",
"": "ordered1400",
"": "ordered1401",
"": "ordered1402",
"": "ordered1403",
"": "ordered1404",
"": "ordered1405",
"": "ordered1406",
"": "ordered1407",
"": "ordered1408",
"": "ordered1409",
"": "ordered1410",
"": "ordered1411",
"": "ordered1412",
"": "ordered1413",
"": "ordered1414",
"": "ordered1415",
"": "ordered1416",
"": "ordered1417",
"": "ordered1418",
"": "ordered1419",
"": "ordered1420",
"": "ordered1421",
"": "ordered1422",
"": "ordered1423",
"": "ordered1428",
"": "ordered1434",
"": "ordered1440",
"": "ordered1446",
"": "ordered1447",
"": "ordered1448",
"": "ordered1449",
"": "ordered1455",
"": "ordered1461",
"": "ordered1467",
"": "ordered1473",
"": "ordered1479",
"": "ordered1480",
"": "ordered1481",
"": "ordered1482",
"": "ordered1483",
"": "ordered1484",
"": "ordered1485",
"": "ordered1486",
"": "ordered1487",
"": "ordered1488",
"": "ordered1489",
"": "ordered1490",
"": "ordered1491",
"": "ordered1492",
"": "ordered1493",
"": "ordered1494",
"": "ordered1495",
"": "ordered1496",
"": "ordered1497",
"": "ordered1498",
"": "ordered1499",
"": "ordered1500",
"": "ordered1501",
"": "ordered1502",
"": "ordered1503",
"": "ordered1504",
"": "ordered1505",
"": "ordered1506",
"": "ordered1507",
"": "ordered1508",
"": "ordered1509",
"": "ordered1510",
"": "ordered1511",
"": "ordered1512",
"": "ordered1513",
"": "ordered1514",
"": "ordered1520",
"": "ordered1521",
"": "ordered1522",
"": "ordered1523",
"": "ordered1524",
"": "ordered1525",
"": "ordered1526",
"": "ordered1527",
"": "ordered1528",
"": "ordered1529",
"": "ordered1530",
"": "ordered1531",
"": "ordered1532",
"": "ordered1533",
"": "ordered1534",
"": "ordered1535",
"": "ordered1536",
"": "ordered1542",
"": "ordered1548",
"": "ordered1554",
"": "ordered1555",
"": "ordered1556",
"": "ordered1557",
"": "ordered1558",
"": "ordered1559",
"": "ordered1560",
"": "ordered1561",
"": "ordered1562",
"": "ordered1563",
"": "ordered1569",
"": "ordered1570",
"": "ordered1571",
"": "ordered1572",
"": "ordered1573"
}
}, function(e, t) {
"use strict";
e.exports = {
"#⃣": "ordered0001",
"*⃣": "ordered0002",
"0⃣": "ordered0003",
"1⃣": "ordered0004",
"2⃣": "ordered0005",
"3⃣": "ordered0006",
"4⃣": "ordered0007",
"5⃣": "ordered0008",
"6⃣": "ordered0009",
"7⃣": "ordered0010",
"8⃣": "ordered0011",
"9⃣": "ordered0012",
"©": "ordered0013",
"®": "ordered0014",
"‼": "ordered0015",
"⁉": "ordered0016",
"™": "ordered0017",
"ℹ": "ordered0018",
"↔": "ordered0019",
"↕": "ordered0020",
"↖": "ordered0021",
"↗": "ordered0022",
"↘": "ordered0023",
"↙": "ordered0024",
"↩": "ordered0025",
"↪": "ordered0026",
"⌚": "ordered0027",
"⌛": "ordered0028",
"⌨": "ordered0029",
"⏩": "ordered0030",
"⏪": "ordered0031",
"⏫": "ordered0032",
"⏬": "ordered0033",
"⏭": "ordered0034",
"⏮": "ordered0035",
"⏯": "ordered0036",
"⏰": "ordered0037",
"⏱": "ordered0038",
"⏲": "ordered0039",
"⏳": "ordered0040",
"⏸": "ordered0041",
"⏹": "ordered0042",
"⏺": "ordered0043",
"Ⓜ": "ordered0044",
"▪": "ordered0045",
"▫": "ordered0046",
"▶": "ordered0047",
"◀": "ordered0048",
"◻": "ordered0049",
"◼": "ordered0050",
"◽": "ordered0051",
"◾": "ordered0052",
"☀": "ordered0053",
"☁": "ordered0054",
"☂": "ordered0055",
"☃": "ordered0056",
"☄": "ordered0057",
"☎": "ordered0058",
"☑": "ordered0059",
"☔": "ordered0060",
"☕": "ordered0061",
"☘": "ordered0062",
"☝": "ordered0063",
"☝🏻": "ordered0064",
"☝🏼": "ordered0065",
"☝🏽": "ordered0066",
"☝🏾": "ordered0067",
"☝🏿": "ordered0068",
"☠": "ordered0069",
"☢": "ordered0070",
"☣": "ordered0071",
"☦": "ordered0072",
"☪": "ordered0073",
"☮": "ordered0074",
"☯": "ordered0075",
"☸": "ordered0076",
"☹": "ordered0077",
"☺": "ordered0078",
"♈": "ordered0079",
"♉": "ordered0080",
"♊": "ordered0081",
"♋": "ordered0082",
"♌": "ordered0083",
"♍": "ordered0084",
"♎": "ordered0085",
"♏": "ordered0086",
"♐": "ordered0087",
"♑": "ordered0088",
"♒": "ordered0089",
"♓": "ordered0090",
"♠": "ordered0091",
"♣": "ordered0092",
"♥": "ordered0093",
"♦": "ordered0094",
"♨": "ordered0095",
"♻": "ordered0096",
"♿": "ordered0097",
"⚒": "ordered0098",
"⚓": "ordered0099",
"⚔": "ordered0100",
"⚖": "ordered0101",
"⚗": "ordered0102",
"⚙": "ordered0103",
"⚛": "ordered0104",
"⚜": "ordered0105",
"⚠": "ordered0106",
"⚡": "ordered0107",
"⚪": "ordered0108",
"⚫": "ordered0109",
"⚰": "ordered0110",
"⚱": "ordered0111",
"⚽": "ordered0112",
"⚾": "ordered0113",
"⛄": "ordered0114",
"⛅": "ordered0115",
"⛈": "ordered0116",
"⛎": "ordered0117",
"⛏": "ordered0118",
"⛑": "ordered0119",
"⛓": "ordered0120",
"⛔": "ordered0121",
"⛩": "ordered0122",
"⛪": "ordered0123",
"⛰": "ordered0124",
"⛱": "ordered0125",
"⛲": "ordered0126",
"⛳": "ordered0127",
"⛴": "ordered0128",
"⛵": "ordered0129",
"⛷": "ordered0130",
"⛸": "ordered0131",
"⛹": "ordered0132",
"⛹🏻": "ordered0133",
"⛹🏼": "ordered0134",
"⛹🏽": "ordered0135",
"⛹🏾": "ordered0136",
"⛹🏿": "ordered0137",
"⛺": "ordered0138",
"⛽": "ordered0139",
"✂": "ordered0140",
"✅": "ordered0141",
"✈": "ordered0142",
"✉": "ordered0143",
"✊": "ordered0144",
"✊🏻": "ordered0145",
"✊🏼": "ordered0146",
"✊🏽": "ordered0147",
"✊🏾": "ordered0148",
"✊🏿": "ordered0149",
"✋": "ordered0150",
"✋🏻": "ordered0151",
"✋🏼": "ordered0152",
"✋🏽": "ordered0153",
"✋🏾": "ordered0154",
"✋🏿": "ordered0155",
"✌": "ordered0156",
"✌🏻": "ordered0157",
"✌🏼": "ordered0158",
"✌🏽": "ordered0159",
"✌🏾": "ordered0160",
"✌🏿": "ordered0161",
"✍": "ordered0162",
"✍🏻": "ordered0163",
"✍🏼": "ordered0164",
"✍🏽": "ordered0165",
"✍🏾": "ordered0166",
"✍🏿": "ordered0167",
"✏": "ordered0168",
"✒": "ordered0169",
"✔": "ordered0170",
"✖": "ordered0171",
"✝": "ordered0172",
"✡": "ordered0173",
"✨": "ordered0174",
"✳": "ordered0175",
"✴": "ordered0176",
"❄": "ordered0177",
"❇": "ordered0178",
"❌": "ordered0179",
"❎": "ordered0180",
"❓": "ordered0181",
"❔": "ordered0182",
"❕": "ordered0183",
"❗": "ordered0184",
"❣": "ordered0185",
"❤": "ordered0186",
"➕": "ordered0187",
"➖": "ordered0188",
"➗": "ordered0189",
"➡": "ordered0190",
"➰": "ordered0191",
"➿": "ordered0192",
"⤴": "ordered0193",
"⤵": "ordered0194",
"⬅": "ordered0195",
"⬆": "ordered0196",
"⬇": "ordered0197",
"⬛": "ordered0198",
"⬜": "ordered0199",
"⭐": "ordered0200",
"⭕": "ordered0201",
"〰": "ordered0202",
"〽": "ordered0203",
"㊗": "ordered0204",
"㊙": "ordered0205",
"🀄": "ordered0206",
"🃏": "ordered0207",
"🅰": "ordered0208",
"🅱": "ordered0209",
"🅾": "ordered0210",
"🅿": "ordered0211",
"🆎": "ordered0212",
"🆑": "ordered0213",
"🆒": "ordered0214",
"🆓": "ordered0215",
"🆔": "ordered0216",
"🆕": "ordered0217",
"🆖": "ordered0218",
"🆗": "ordered0219",
"🆘": "ordered0220",
"🆙": "ordered0221",
"🆚": "ordered0222",
"🇦🇩": "ordered0223",
"🇦🇪": "ordered0224",
"🇦🇫": "ordered0225",
"🇦🇬": "ordered0226",
"🇦🇮": "ordered0227",
"🇦🇱": "ordered0228",
"🇦🇲": "ordered0229",
"🇦🇴": "ordered0230",
"🇦🇶": "ordered0231",
"🇦🇷": "ordered0232",
"🇦🇸": "ordered0233",
"🇦🇹": "ordered0234",
"🇦🇺": "ordered0235",
"🇦🇼": "ordered0236",
"🇦🇽": "ordered0237",
"🇦🇿": "ordered0238",
"🇧🇦": "ordered0239",
"🇧🇧": "ordered0240",
"🇧🇩": "ordered0241",
"🇧🇪": "ordered0242",
"🇧🇫": "ordered0243",
"🇧🇬": "ordered0244",
"🇧🇭": "ordered0245",
"🇧🇮": "ordered0246",
"🇧🇯": "ordered0247",
"🇧🇱": "ordered0248",
"🇧🇲": "ordered0249",
"🇧🇳": "ordered0250",
"🇧🇴": "ordered0251",
"🇧🇶": "ordered0252",
"🇧🇷": "ordered0253",
"🇧🇸": "ordered0254",
"🇧🇹": "ordered0255",
"🇧🇼": "ordered0256",
"🇧🇾": "ordered0257",
"🇧🇿": "ordered0258",
"🇨🇦": "ordered0259",
"🇨🇨": "ordered0260",
"🇨🇩": "ordered0261",
"🇨🇫": "ordered0262",
"🇨🇬": "ordered0263",
"🇨🇭": "ordered0264",
"🇨🇮": "ordered0265",
"🇨🇰": "ordered0266",
"🇨🇱": "ordered0267",
"🇨🇲": "ordered0268",
"🇨🇳": "ordered0269",
"🇨🇴": "ordered0270",
"🇨🇷": "ordered0271",
"🇨🇺": "ordered0272",
"🇨🇻": "ordered0273",
"🇨🇼": "ordered0274",
"🇨🇽": "ordered0275",
"🇨🇾": "ordered0276",
"🇨🇿": "ordered0277",
"🇩🇪": "ordered0278",
"🇩🇯": "ordered0279",
"🇩🇰": "ordered0280",
"🇩🇲": "ordered0281",
"🇩🇴": "ordered0282",
"🇩🇿": "ordered0283",
"🇪🇨": "ordered0284",
"🇪🇪": "ordered0285",
"🇪🇬": "ordered0286",
"🇪🇭": "ordered0287",
"🇪🇷": "ordered0288",
"🇪🇸": "ordered0289",
"🇪🇹": "ordered0290",
"🇪🇺": "ordered0291",
"🇫🇮": "ordered0292",
"🇫🇯": "ordered0293",
"🇫🇰": "ordered0294",
"🇫🇲": "ordered0295",
"🇫🇴": "ordered0296",
"🇫🇷": "ordered0297",
"🇬🇦": "ordered0298",
"🇬🇧": "ordered0299",
"🇬🇩": "ordered0300",
"🇬🇪": "ordered0301",
"🇬🇫": "ordered0302",
"🇬🇬": "ordered0303",
"🇬🇭": "ordered0304",
"🇬🇮": "ordered0305",
"🇬🇱": "ordered0306",
"🇬🇲": "ordered0307",
"🇬🇳": "ordered0308",
"🇬🇵": "ordered0309",
"🇬🇶": "ordered0310",
"🇬🇷": "ordered0311",
"🇬🇸": "ordered0312",
"🇬🇹": "ordered0313",
"🇬🇺": "ordered0314",
"🇬🇼": "ordered0315",
"🇬🇾": "ordered0316",
"🇭🇰": "ordered0317",
"🇭🇳": "ordered0318",
"🇭🇷": "ordered0319",
"🇭🇹": "ordered0320",
"🇭🇺": "ordered0321",
"🇮🇨": "ordered0322",
"🇮🇩": "ordered0323",
"🇮🇪": "ordered0324",
"🇮🇱": "ordered0325",
"🇮🇲": "ordered0326",
"🇮🇳": "ordered0327",
"🇮🇴": "ordered0328",
"🇮🇶": "ordered0329",
"🇮🇷": "ordered0330",
"🇮🇸": "ordered0331",
"🇮🇹": "ordered0332",
"🇯🇪": "ordered0333",
"🇯🇲": "ordered0334",
"🇯🇴": "ordered0335",
"🇯🇵": "ordered0336",
"🇰🇪": "ordered0337",
"🇰🇬": "ordered0338",
"🇰🇭": "ordered0339",
"🇰🇮": "ordered0340",
"🇰🇲": "ordered0341",
"🇰🇳": "ordered0342",
"🇰🇵": "ordered0343",
"🇰🇷": "ordered0344",
"🇰🇼": "ordered0345",
"🇰🇾": "ordered0346",
"🇰🇿": "ordered0347",
"🇱🇦": "ordered0348",
"🇱🇧": "ordered0349",
"🇱🇨": "ordered0350",
"🇱🇮": "ordered0351",
"🇱🇰": "ordered0352",
"🇱🇷": "ordered0353",
"🇱🇸": "ordered0354",
"🇱🇹": "ordered0355",
"🇱🇺": "ordered0356",
"🇱🇻": "ordered0357",
"🇱🇾": "ordered0358",
"🇲🇦": "ordered0359",
"🇲🇨": "ordered0360",
"🇲🇩": "ordered0361",
"🇲🇪": "ordered0362",
"🇲🇬": "ordered0363",
"🇲🇭": "ordered0364",
"🇲🇰": "ordered0365",
"🇲🇱": "ordered0366",
"🇲🇲": "ordered0367",
"🇲🇳": "ordered0368",
"🇲🇴": "ordered0369",
"🇲🇵": "ordered0370",
"🇲🇶": "ordered0371",
"🇲🇷": "ordered0372",
"🇲🇸": "ordered0373",
"🇲🇹": "ordered0374",
"🇲🇺": "ordered0375",
"🇲🇻": "ordered0376",
"🇲🇼": "ordered0377",
"🇲🇽": "ordered0378",
"🇲🇾": "ordered0379",
"🇲🇿": "ordered0380",
"🇳🇦": "ordered0381",
"🇳🇨": "ordered0382",
"🇳🇪": "ordered0383",
"🇳🇫": "ordered0384",
"🇳🇬": "ordered0385",
"🇳🇮": "ordered0386",
"🇳🇱": "ordered0387",
"🇳🇴": "ordered0388",
"🇳🇵": "ordered0389",
"🇳🇷": "ordered0390",
"🇳🇺": "ordered0391",
"🇳🇿": "ordered0392",
"🇴🇲": "ordered0393",
"🇵🇦": "ordered0394",
"🇵🇪": "ordered0395",
"🇵🇫": "ordered0396",
"🇵🇬": "ordered0397",
"🇵🇭": "ordered0398",
"🇵🇰": "ordered0399",
"🇵🇱": "ordered0400",
"🇵🇲": "ordered0401",
"🇵🇳": "ordered0402",
"🇵🇷": "ordered0403",
"🇵🇸": "ordered0404",
"🇵🇹": "ordered0405",
"🇵🇼": "ordered0406",
"🇵🇾": "ordered0407",
"🇶🇦": "ordered0408",
"🇷🇪": "ordered0409",
"🇷🇴": "ordered0410",
"🇷🇸": "ordered0411",
"🇷🇺": "ordered0412",
"🇷🇼": "ordered0413",
"🇸🇦": "ordered0414",
"🇸🇧": "ordered0415",
"🇸🇨": "ordered0416",
"🇸🇩": "ordered0417",
"🇸🇪": "ordered0418",
"🇸🇬": "ordered0419",
"🇸🇭": "ordered0420",
"🇸🇮": "ordered0421",
"🇸🇰": "ordered0422",
"🇸🇱": "ordered0423",
"🇸🇲": "ordered0424",
"🇸🇳": "ordered0425",
"🇸🇴": "ordered0426",
"🇸🇷": "ordered0427",
"🇸🇸": "ordered0428",
"🇸🇹": "ordered0429",
"🇸🇻": "ordered0430",
"🇸🇽": "ordered0431",
"🇸🇾": "ordered0432",
"🇸🇿": "ordered0433",
"🇹🇨": "ordered0434",
"🇹🇩": "ordered0435",
"🇹🇫": "ordered0436",
"🇹🇬": "ordered0437",
"🇹🇭": "ordered0438",
"🇹🇯": "ordered0439",
"🇹🇰": "ordered0440",
"🇹🇱": "ordered0441",
"🇹🇲": "ordered0442",
"🇹🇳": "ordered0443",
"🇹🇴": "ordered0444",
"🇹🇷": "ordered0445",
"🇹🇹": "ordered0446",
"🇹🇻": "ordered0447",
"🇹🇼": "ordered0448",
"🇹🇿": "ordered0449",
"🇺🇦": "ordered0450",
"🇺🇬": "ordered0451",
"🇺🇸": "ordered0452",
"🇺🇾": "ordered0453",
"🇺🇿": "ordered0454",
"🇻🇦": "ordered0455",
"🇻🇨": "ordered0456",
"🇻🇪": "ordered0457",
"🇻🇬": "ordered0458",
"🇻🇮": "ordered0459",
"🇻🇳": "ordered0460",
"🇻🇺": "ordered0461",
"🇼🇫": "ordered0462",
"🇼🇸": "ordered0463",
"🇽🇰": "ordered0464",
"🇾🇪": "ordered0465",
"🇾🇹": "ordered0466",
"🇿🇦": "ordered0467",
"🇿🇲": "ordered0468",
"🇿🇼": "ordered0469",
"🈁": "ordered0470",
"🈂": "ordered0471",
"🈚": "ordered0472",
"🈯": "ordered0473",
"🈲": "ordered0474",
"🈳": "ordered0475",
"🈴": "ordered0476",
"🈵": "ordered0477",
"🈶": "ordered0478",
"🈷": "ordered0479",
"🈸": "ordered0480",
"🈹": "ordered0481",
"🈺": "ordered0482",
"🉐": "ordered0483",
"🉑": "ordered0484",
"🌀": "ordered0485",
"🌁": "ordered0486",
"🌂": "ordered0487",
"🌃": "ordered0488",
"🌄": "ordered0489",
"🌅": "ordered0490",
"🌆": "ordered0491",
"🌇": "ordered0492",
"🌈": "ordered0493",
"🌉": "ordered0494",
"🌊": "ordered0495",
"🌋": "ordered0496",
"🌌": "ordered0497",
"🌍": "ordered0498",
"🌎": "ordered0499",
"🌏": "ordered0500",
"🌐": "ordered0501",
"🌑": "ordered0502",
"🌒": "ordered0503",
"🌓": "ordered0504",
"🌔": "ordered0505",
"🌕": "ordered0506",
"🌖": "ordered0507",
"🌗": "ordered0508",
"🌘": "ordered0509",
"🌙": "ordered0510",
"🌚": "ordered0511",
"🌛": "ordered0512",
"🌜": "ordered0513",
"🌝": "ordered0514",
"🌞": "ordered0515",
"🌟": "ordered0516",
"🌠": "ordered0517",
"🌡": "ordered0518",
"🌤": "ordered0519",
"🌥": "ordered0520",
"🌦": "ordered0521",
"🌧": "ordered0522",
"🌨": "ordered0523",
"🌩": "ordered0524",
"🌪": "ordered0525",
"🌫": "ordered0526",
"🌬": "ordered0527",
"🌭": "ordered0528",
"🌮": "ordered0529",
"🌯": "ordered0530",
"🌰": "ordered0531",
"🌱": "ordered0532",
"🌲": "ordered0533",
"🌳": "ordered0534",
"🌴": "ordered0535",
"🌵": "ordered0536",
"🌶": "ordered0537",
"🌷": "ordered0538",
"🌸": "ordered0539",
"🌹": "ordered0540",
"🌺": "ordered0541",
"🌻": "ordered0542",
"🌼": "ordered0543",
"🌽": "ordered0544",
"🌾": "ordered0545",
"🌿": "ordered0546",
"🍀": "ordered0547",
"🍁": "ordered0548",
"🍂": "ordered0549",
"🍃": "ordered0550",
"🍄": "ordered0551",
"🍅": "ordered0552",
"🍆": "ordered0553",
"🍇": "ordered0554",
"🍈": "ordered0555",
"🍉": "ordered0556",
"🍊": "ordered0557",
"🍋": "ordered0558",
"🍌": "ordered0559",
"🍍": "ordered0560",
"🍎": "ordered0561",
"🍏": "ordered0562",
"🍐": "ordered0563",
"🍑": "ordered0564",
"🍒": "ordered0565",
"🍓": "ordered0566",
"🍔": "ordered0567",
"🍕": "ordered0568",
"🍖": "ordered0569",
"🍗": "ordered0570",
"🍘": "ordered0571",
"🍙": "ordered0572",
"🍚": "ordered0573",
"🍛": "ordered0574",
"🍜": "ordered0575",
"🍝": "ordered0576",
"🍞": "ordered0577",
"🍟": "ordered0578",
"🍠": "ordered0579",
"🍡": "ordered0580",
"🍢": "ordered0581",
"🍣": "ordered0582",
"🍤": "ordered0583",
"🍥": "ordered0584",
"🍦": "ordered0585",
"🍧": "ordered0586",
"🍨": "ordered0587",
"🍩": "ordered0588",
"🍪": "ordered0589",
"🍫": "ordered0590",
"🍬": "ordered0591",
"🍭": "ordered0592",
"🍮": "ordered0593",
"🍯": "ordered0594",
"🍰": "ordered0595",
"🍱": "ordered0596",
"🍲": "ordered0597",
"🍳": "ordered0598",
"🍴": "ordered0599",
"🍵": "ordered0600",
"🍶": "ordered0601",
"🍷": "ordered0602",
"🍸": "ordered0603",
"🍹": "ordered0604",
"🍺": "ordered0605",
"🍻": "ordered0606",
"🍼": "ordered0607",
"🍽": "ordered0608",
"🍾": "ordered0609",
"🍿": "ordered0610",
"🎀": "ordered0611",
"🎁": "ordered0612",
"🎂": "ordered0613",
"🎃": "ordered0614",
"🎄": "ordered0615",
"🎅": "ordered0616",
"🎅🏻": "ordered0617",
"🎅🏼": "ordered0618",
"🎅🏽": "ordered0619",
"🎅🏾": "ordered0620",
"🎅🏿": "ordered0621",
"🎆": "ordered0622",
"🎇": "ordered0623",
"🎈": "ordered0624",
"🎉": "ordered0625",
"🎊": "ordered0626",
"🎋": "ordered0627",
"🎌": "ordered0628",
"🎍": "ordered0629",
"🎎": "ordered0630",
"🎏": "ordered0631",
"🎐": "ordered0632",
"🎑": "ordered0633",
"🎒": "ordered0634",
"🎓": "ordered0635",
"🎖": "ordered0636",
"🎗": "ordered0637",
"🎙": "ordered0638",
"🎚": "ordered0639",
"🎛": "ordered0640",
"🎞": "ordered0641",
"🎟": "ordered0642",
"🎠": "ordered0643",
"🎡": "ordered0644",
"🎢": "ordered0645",
"🎣": "ordered0646",
"🎤": "ordered0647",
"🎥": "ordered0648",
"🎦": "ordered0649",
"🎧": "ordered0650",
"🎨": "ordered0651",
"🎩": "ordered0652",
"🎪": "ordered0653",
"🎫": "ordered0654",
"🎬": "ordered0655",
"🎭": "ordered0656",
"🎮": "ordered0657",
"🎯": "ordered0658",
"🎰": "ordered0659",
"🎱": "ordered0660",
"🎲": "ordered0661",
"🎳": "ordered0662",
"🎴": "ordered0663",
"🎵": "ordered0664",
"🎶": "ordered0665",
"🎷": "ordered0666",
"🎸": "ordered0667",
"🎹": "ordered0668",
"🎺": "ordered0669",
"🎻": "ordered0670",
"🎼": "ordered0671",
"🎽": "ordered0672",
"🎾": "ordered0673",
"🎿": "ordered0674",
"🏀": "ordered0675",
"🏁": "ordered0676",
"🏂": "ordered0677",
"🏃": "ordered0678",
"🏃🏻": "ordered0679",
"🏃🏼": "ordered0680",
"🏃🏽": "ordered0681",
"🏃🏾": "ordered0682",
"🏃🏿": "ordered0683",
"🏄": "ordered0684",
"🏄🏻": "ordered0685",
"🏄🏼": "ordered0686",
"🏄🏽": "ordered0687",
"🏄🏾": "ordered0688",
"🏄🏿": "ordered0689",
"🏅": "ordered0690",
"🏆": "ordered0691",
"🏇": "ordered0692",
"🏇🏻": "ordered0693",
"🏇🏼": "ordered0694",
"🏇🏽": "ordered0695",
"🏇🏾": "ordered0696",
"🏇🏿": "ordered0697",
"🏈": "ordered0698",
"🏉": "ordered0699",
"🏊": "ordered0700",
"🏊🏻": "ordered0701",
"🏊🏼": "ordered0702",
"🏊🏽": "ordered0703",
"🏊🏾": "ordered0704",
"🏊🏿": "ordered0705",
"🏋": "ordered0706",
"🏋🏻": "ordered0707",
"🏋🏼": "ordered0708",
"🏋🏽": "ordered0709",
"🏋🏾": "ordered0710",
"🏋🏿": "ordered0711",
"🏌": "ordered0712",
"🏍": "ordered0713",
"🏎": "ordered0714",
"🏏": "ordered0715",
"🏐": "ordered0716",
"🏑": "ordered0717",
"🏒": "ordered0718",
"🏓": "ordered0719",
"🏔": "ordered0720",
"🏕": "ordered0721",
"🏖": "ordered0722",
"🏗": "ordered0723",
"🏘": "ordered0724",
"🏙": "ordered0725",
"🏚": "ordered0726",
"🏛": "ordered0727",
"🏜": "ordered0728",
"🏝": "ordered0729",
"🏞": "ordered0730",
"🏟": "ordered0731",
"🏠": "ordered0732",
"🏡": "ordered0733",
"🏢": "ordered0734",
"🏣": "ordered0735",
"🏤": "ordered0736",
"🏥": "ordered0737",
"🏦": "ordered0738",
"🏧": "ordered0739",
"🏨": "ordered0740",
"🏩": "ordered0741",
"🏪": "ordered0742",
"🏫": "ordered0743",
"🏬": "ordered0744",
"🏭": "ordered0745",
"🏮": "ordered0746",
"🏯": "ordered0747",
"🏰": "ordered0748",
"🏳": "ordered0749",
"🏴": "ordered0750",
"🏵": "ordered0751",
"🏷": "ordered0752",
"🏸": "ordered0753",
"🏹": "ordered0754",
"🏺": "ordered0755",
"🏻": "ordered0756",
"🏼": "ordered0757",
"🏽": "ordered0758",
"🏾": "ordered0759",
"🏿": "ordered0760",
"🐀": "ordered0761",
"🐁": "ordered0762",
"🐂": "ordered0763",
"🐃": "ordered0764",
"🐄": "ordered0765",
"🐅": "ordered0766",
"🐆": "ordered0767",
"🐇": "ordered0768",
"🐈": "ordered0769",
"🐉": "ordered0770",
"🐊": "ordered0771",
"🐋": "ordered0772",
"🐌": "ordered0773",
"🐍": "ordered0774",
"🐎": "ordered0775",
"🐏": "ordered0776",
"🐐": "ordered0777",
"🐑": "ordered0778",
"🐒": "ordered0779",
"🐓": "ordered0780",
"🐔": "ordered0781",
"🐕": "ordered0782",
"🐖": "ordered0783",
"🐗": "ordered0784",
"🐘": "ordered0785",
"🐙": "ordered0786",
"🐚": "ordered0787",
"🐛": "ordered0788",
"🐜": "ordered0789",
"🐝": "ordered0790",
"🐞": "ordered0791",
"🐟": "ordered0792",
"🐠": "ordered0793",
"🐡": "ordered0794",
"🐢": "ordered0795",
"🐣": "ordered0796",
"🐤": "ordered0797",
"🐥": "ordered0798",
"🐦": "ordered0799",
"🐧": "ordered0800",
"🐨": "ordered0801",
"🐩": "ordered0802",
"🐪": "ordered0803",
"🐫": "ordered0804",
"🐬": "ordered0805",
"🐭": "ordered0806",
"🐮": "ordered0807",
"🐯": "ordered0808",
"🐰": "ordered0809",
"🐱": "ordered0810",
"🐲": "ordered0811",
"🐳": "ordered0812",
"🐴": "ordered0813",
"🐵": "ordered0814",
"🐶": "ordered0815",
"🐷": "ordered0816",
"🐸": "ordered0817",
"🐹": "ordered0818",
"🐺": "ordered0819",
"🐻": "ordered0820",
"🐼": "ordered0821",
"🐽": "ordered0822",
"🐾": "ordered0823",
"🐿": "ordered0824",
"👀": "ordered0825",
"👁": "ordered0826",
"👁‍🗨": "ordered0827",
"👂": "ordered0828",
"👂🏻": "ordered0829",
"👂🏼": "ordered0830",
"👂🏽": "ordered0831",
"👂🏾": "ordered0832",
"👂🏿": "ordered0833",
"👃": "ordered0834",
"👃🏻": "ordered0835",
"👃🏼": "ordered0836",
"👃🏽": "ordered0837",
"👃🏾": "ordered0838",
"👃🏿": "ordered0839",
"👄": "ordered0840",
"👅": "ordered0841",
"👆": "ordered0842",
"👆🏻": "ordered0843",
"👆🏼": "ordered0844",
"👆🏽": "ordered0845",
"👆🏾": "ordered0846",
"👆🏿": "ordered0847",
"👇": "ordered0848",
"👇🏻": "ordered0849",
"👇🏼": "ordered0850",
"👇🏽": "ordered0851",
"👇🏾": "ordered0852",
"👇🏿": "ordered0853",
"👈": "ordered0854",
"👈🏻": "ordered0855",
"👈🏼": "ordered0856",
"👈🏽": "ordered0857",
"👈🏾": "ordered0858",
"👈🏿": "ordered0859",
"👉": "ordered0860",
"👉🏻": "ordered0861",
"👉🏼": "ordered0862",
"👉🏽": "ordered0863",
"👉🏾": "ordered0864",
"👉🏿": "ordered0865",
"👊": "ordered0866",
"👊🏻": "ordered0867",
"👊🏼": "ordered0868",
"👊🏽": "ordered0869",
"👊🏾": "ordered0870",
"👊🏿": "ordered0871",
"👋": "ordered0872",
"👋🏻": "ordered0873",
"👋🏼": "ordered0874",
"👋🏽": "ordered0875",
"👋🏾": "ordered0876",
"👋🏿": "ordered0877",
"👌": "ordered0878",
"👌🏻": "ordered0879",
"👌🏼": "ordered0880",
"👌🏽": "ordered0881",
"👌🏾": "ordered0882",
"👌🏿": "ordered0883",
"👍": "ordered0884",
"👍🏻": "ordered0885",
"👍🏼": "ordered0886",
"👍🏽": "ordered0887",
"👍🏾": "ordered0888",
"👍🏿": "ordered0889",
"👎": "ordered0890",
"👎🏻": "ordered0891",
"👎🏼": "ordered0892",
"👎🏽": "ordered0893",
"👎🏾": "ordered0894",
"👎🏿": "ordered0895",
"👏": "ordered0896",
"👏🏻": "ordered0897",
"👏🏼": "ordered0898",
"👏🏽": "ordered0899",
"👏🏾": "ordered0900",
"👏🏿": "ordered0901",
"👐": "ordered0902",
"👐🏻": "ordered0903",
"👐🏼": "ordered0904",
"👐🏽": "ordered0905",
"👐🏾": "ordered0906",
"👐🏿": "ordered0907",
"👑": "ordered0908",
"👒": "ordered0909",
"👓": "ordered0910",
"👔": "ordered0911",
"👕": "ordered0912",
"👖": "ordered0913",
"👗": "ordered0914",
"👘": "ordered0915",
"👙": "ordered0916",
"👚": "ordered0917",
"👛": "ordered0918",
"👜": "ordered0919",
"👝": "ordered0920",
"👞": "ordered0921",
"👟": "ordered0922",
"👠": "ordered0923",
"👡": "ordered0924",
"👢": "ordered0925",
"👣": "ordered0926",
"👤": "ordered0927",
"👥": "ordered0928",
"👦": "ordered0929",
"👦🏻": "ordered0930",
"👦🏼": "ordered0931",
"👦🏽": "ordered0932",
"👦🏾": "ordered0933",
"👦🏿": "ordered0934",
"👧": "ordered0935",
"👧🏻": "ordered0936",
"👧🏼": "ordered0937",
"👧🏽": "ordered0938",
"👧🏾": "ordered0939",
"👧🏿": "ordered0940",
"👨": "ordered0941",
"👨🏻": "ordered0942",
"👨🏼": "ordered0943",
"👨🏽": "ordered0944",
"👨🏾": "ordered0945",
"👨🏿": "ordered0946",
"👩": "ordered0947",
"👩🏻": "ordered0948",
"👩🏼": "ordered0949",
"👩🏽": "ordered0950",
"👩🏾": "ordered0951",
"👩🏿": "ordered0952",
"👪": "ordered0953",
"👨‍👨‍👦": "ordered0954",
"👨‍👨‍👦‍👦": "ordered0955",
"👨‍👨‍👧": "ordered0956",
"👨‍👨‍👧‍👦": "ordered0957",
"👨‍👨‍👧‍👧": "ordered0958",
"👨‍👩‍👦‍👦": "ordered0959",
"👨‍👩‍👧": "ordered0960",
"👨‍👩‍👧‍👦": "ordered0961",
"👨‍👩‍👧‍👧": "ordered0962",
"👩‍👩‍👦": "ordered0963",
"👩‍👩‍👦‍👦": "ordered0964",
"👩‍👩‍👧": "ordered0965",
"👩‍👩‍👧‍👦": "ordered0966",
"👩‍👩‍👧‍👧": "ordered0967",
"👫": "ordered0968",
"👬": "ordered0969",
"👭": "ordered0970",
"👮": "ordered0971",
"👮🏻": "ordered0972",
"👮🏼": "ordered0973",
"👮🏽": "ordered0974",
"👮🏾": "ordered0975",
"👮🏿": "ordered0976",
"👯": "ordered0977",
"👰": "ordered0978",
"👰🏻": "ordered0979",
"👰🏼": "ordered0980",
"👰🏽": "ordered0981",
"👰🏾": "ordered0982",
"👰🏿": "ordered0983",
"👱": "ordered0984",
"👱🏻": "ordered0985",
"👱🏼": "ordered0986",
"👱🏽": "ordered0987",
"👱🏾": "ordered0988",
"👱🏿": "ordered0989",
"👲": "ordered0990",
"👲🏻": "ordered0991",
"👲🏼": "ordered0992",
"👲🏽": "ordered0993",
"👲🏾": "ordered0994",
"👲🏿": "ordered0995",
"👳": "ordered0996",
"👳🏻": "ordered0997",
"👳🏼": "ordered0998",
"👳🏽": "ordered0999",
"👳🏾": "ordered1000",
"👳🏿": "ordered1001",
"👴": "ordered1002",
"👴🏻": "ordered1003",
"👴🏼": "ordered1004",
"👴🏽": "ordered1005",
"👴🏾": "ordered1006",
"👴🏿": "ordered1007",
"👵": "ordered1008",
"👵🏻": "ordered1009",
"👵🏼": "ordered1010",
"👵🏽": "ordered1011",
"👵🏾": "ordered1012",
"👵🏿": "ordered1013",
"👶": "ordered1014",
"👶🏻": "ordered1015",
"👶🏼": "ordered1016",
"👶🏽": "ordered1017",
"👶🏾": "ordered1018",
"👶🏿": "ordered1019",
"👷": "ordered1020",
"👷🏻": "ordered1021",
"👷🏼": "ordered1022",
"👷🏽": "ordered1023",
"👷🏾": "ordered1024",
"👷🏿": "ordered1025",
"👸": "ordered1026",
"👸🏻": "ordered1027",
"👸🏼": "ordered1028",
"👸🏽": "ordered1029",
"👸🏾": "ordered1030",
"👸🏿": "ordered1031",
"👹": "ordered1032",
"👺": "ordered1033",
"👻": "ordered1034",
"👼": "ordered1035",
"👼🏻": "ordered1036",
"👼🏼": "ordered1037",
"👼🏽": "ordered1038",
"👼🏾": "ordered1039",
"👼🏿": "ordered1040",
"👽": "ordered1041",
"👾": "ordered1042",
"👿": "ordered1043",
"💀": "ordered1044",
"💁": "ordered1045",
"💁🏻": "ordered1046",
"💁🏼": "ordered1047",
"💁🏽": "ordered1048",
"💁🏾": "ordered1049",
"💁🏿": "ordered1050",
"💂": "ordered1051",
"💂🏻": "ordered1052",
"💂🏼": "ordered1053",
"💂🏽": "ordered1054",
"💂🏾": "ordered1055",
"💂🏿": "ordered1056",
"💃": "ordered1057",
"💃🏻": "ordered1058",
"💃🏼": "ordered1059",
"💃🏽": "ordered1060",
"💃🏾": "ordered1061",
"💃🏿": "ordered1062",
"💄": "ordered1063",
"💅": "ordered1064",
"💅🏻": "ordered1065",
"💅🏼": "ordered1066",
"💅🏽": "ordered1067",
"💅🏾": "ordered1068",
"💅🏿": "ordered1069",
"💆": "ordered1070",
"💆🏻": "ordered1071",
"💆🏼": "ordered1072",
"💆🏽": "ordered1073",
"💆🏾": "ordered1074",
"💆🏿": "ordered1075",
"💇": "ordered1076",
"💇🏻": "ordered1077",
"💇🏼": "ordered1078",
"💇🏽": "ordered1079",
"💇🏾": "ordered1080",
"💇🏿": "ordered1081",
"💈": "ordered1082",
"💉": "ordered1083",
"💊": "ordered1084",
"💋": "ordered1085",
"💌": "ordered1086",
"💍": "ordered1087",
"💎": "ordered1088",
"💏": "ordered1089",
"👨‍❤️‍💋‍👨": "ordered1090",
"👩‍❤️‍💋‍👩": "ordered1091",
"💐": "ordered1092",
"💑": "ordered1093",
"👨‍❤️‍👨": "ordered1094",
"👩‍❤️‍👩": "ordered1095",
"💒": "ordered1096",
"💓": "ordered1097",
"💔": "ordered1098",
"💕": "ordered1099",
"💖": "ordered1100",
"💗": "ordered1101",
"💘": "ordered1102",
"💙": "ordered1103",
"💚": "ordered1104",
"💛": "ordered1105",
"💜": "ordered1106",
"💝": "ordered1107",
"💞": "ordered1108",
"💟": "ordered1109",
"💠": "ordered1110",
"💡": "ordered1111",
"💢": "ordered1112",
"💣": "ordered1113",
"💤": "ordered1114",
"💥": "ordered1115",
"💦": "ordered1116",
"💧": "ordered1117",
"💨": "ordered1118",
"💩": "ordered1119",
"💪": "ordered1120",
"💪🏻": "ordered1121",
"💪🏼": "ordered1122",
"💪🏽": "ordered1123",
"💪🏾": "ordered1124",
"💪🏿": "ordered1125",
"💫": "ordered1126",
"💬": "ordered1127",
"💭": "ordered1128",
"💮": "ordered1129",
"💯": "ordered1130",
"💰": "ordered1131",
"💱": "ordered1132",
"💲": "ordered1133",
"💳": "ordered1134",
"💴": "ordered1135",
"💵": "ordered1136",
"💶": "ordered1137",
"💷": "ordered1138",
"💸": "ordered1139",
"💹": "ordered1140",
"💺": "ordered1141",
"💻": "ordered1142",
"💼": "ordered1143",
"💽": "ordered1144",
"💾": "ordered1145",
"💿": "ordered1146",
"📀": "ordered1147",
"📁": "ordered1148",
"📂": "ordered1149",
"📃": "ordered1150",
"📄": "ordered1151",
"📅": "ordered1152",
"📆": "ordered1153",
"📇": "ordered1154",
"📈": "ordered1155",
"📉": "ordered1156",
"📊": "ordered1157",
"📋": "ordered1158",
"📌": "ordered1159",
"📍": "ordered1160",
"📎": "ordered1161",
"📏": "ordered1162",
"📐": "ordered1163",
"📑": "ordered1164",
"📒": "ordered1165",
"📓": "ordered1166",
"📔": "ordered1167",
"📕": "ordered1168",
"📖": "ordered1169",
"📗": "ordered1170",
"📘": "ordered1171",
"📙": "ordered1172",
"📚": "ordered1173",
"📛": "ordered1174",
"📜": "ordered1175",
"📝": "ordered1176",
"📞": "ordered1177",
"📟": "ordered1178",
"📠": "ordered1179",
"📡": "ordered1180",
"📢": "ordered1181",
"📣": "ordered1182",
"📤": "ordered1183",
"📥": "ordered1184",
"📦": "ordered1185",
"📧": "ordered1186",
"📨": "ordered1187",
"📩": "ordered1188",
"📪": "ordered1189",
"📫": "ordered1190",
"📬": "ordered1191",
"📭": "ordered1192",
"📮": "ordered1193",
"📯": "ordered1194",
"📰": "ordered1195",
"📱": "ordered1196",
"📲": "ordered1197",
"📳": "ordered1198",
"📴": "ordered1199",
"📵": "ordered1200",
"📶": "ordered1201",
"📷": "ordered1202",
"📸": "ordered1203",
"📹": "ordered1204",
"📺": "ordered1205",
"📻": "ordered1206",
"📼": "ordered1207",
"📽": "ordered1208",
"📿": "ordered1209",
"🔀": "ordered1210",
"🔁": "ordered1211",
"🔂": "ordered1212",
"🔃": "ordered1213",
"🔄": "ordered1214",
"🔅": "ordered1215",
"🔆": "ordered1216",
"🔇": "ordered1217",
"🔈": "ordered1218",
"🔉": "ordered1219",
"🔊": "ordered1220",
"🔋": "ordered1221",
"🔌": "ordered1222",
"🔍": "ordered1223",
"🔎": "ordered1224",
"🔏": "ordered1225",
"🔐": "ordered1226",
"🔑": "ordered1227",
"🔒": "ordered1228",
"🔓": "ordered1229",
"🔔": "ordered1230",
"🔕": "ordered1231",
"🔖": "ordered1232",
"🔗": "ordered1233",
"🔘": "ordered1234",
"🔙": "ordered1235",
"🔚": "ordered1236",
"🔛": "ordered1237",
"🔜": "ordered1238",
"🔝": "ordered1239",
"🔞": "ordered1240",
"🔟": "ordered1241",
"🔠": "ordered1242",
"🔡": "ordered1243",
"🔢": "ordered1244",
"🔣": "ordered1245",
"🔤": "ordered1246",
"🔥": "ordered1247",
"🔦": "ordered1248",
"🔧": "ordered1249",
"🔨": "ordered1250",
"🔩": "ordered1251",
"🔪": "ordered1252",
"🔫": "ordered1253",
"🔬": "ordered1254",
"🔭": "ordered1255",
"🔮": "ordered1256",
"🔯": "ordered1257",
"🔰": "ordered1258",
"🔱": "ordered1259",
"🔲": "ordered1260",
"🔳": "ordered1261",
"🔴": "ordered1262",
"🔵": "ordered1263",
"🔶": "ordered1264",
"🔷": "ordered1265",
"🔸": "ordered1266",
"🔹": "ordered1267",
"🔺": "ordered1268",
"🔻": "ordered1269",
"🔼": "ordered1270",
"🔽": "ordered1271",
"🕉": "ordered1272",
"🕊": "ordered1273",
"🕋": "ordered1274",
"🕌": "ordered1275",
"🕍": "ordered1276",
"🕎": "ordered1277",
"🕐": "ordered1278",
"🕑": "ordered1279",
"🕒": "ordered1280",
"🕓": "ordered1281",
"🕔": "ordered1282",
"🕕": "ordered1283",
"🕖": "ordered1284",
"🕗": "ordered1285",
"🕘": "ordered1286",
"🕙": "ordered1287",
"🕚": "ordered1288",
"🕛": "ordered1289",
"🕜": "ordered1290",
"🕝": "ordered1291",
"🕞": "ordered1292",
"🕟": "ordered1293",
"🕠": "ordered1294",
"🕡": "ordered1295",
"🕢": "ordered1296",
"🕣": "ordered1297",
"🕤": "ordered1298",
"🕥": "ordered1299",
"🕦": "ordered1300",
"🕧": "ordered1301",
"🕯": "ordered1302",
"🕰": "ordered1303",
"🕳": "ordered1304",
"🕴": "ordered1305",
"🕵": "ordered1306",
"🕶": "ordered1307",
"🕷": "ordered1308",
"🕸": "ordered1309",
"🕹": "ordered1310",
"🖇": "ordered1311",
"🖊": "ordered1312",
"🖋": "ordered1313",
"🖌": "ordered1314",
"🖍": "ordered1315",
"🖐": "ordered1316",
"🖐🏻": "ordered1317",
"🖐🏼": "ordered1318",
"🖐🏽": "ordered1319",
"🖐🏾": "ordered1320",
"🖐🏿": "ordered1321",
"🖕": "ordered1322",
"🖕🏻": "ordered1323",
"🖕🏼": "ordered1324",
"🖕🏽": "ordered1325",
"🖕🏾": "ordered1326",
"🖕🏿": "ordered1327",
"🖖": "ordered1328",
"🖖🏻": "ordered1329",
"🖖🏼": "ordered1330",
"🖖🏽": "ordered1331",
"🖖🏾": "ordered1332",
"🖖🏿": "ordered1333",
"🖥": "ordered1334",
"🖨": "ordered1335",
"🖱": "ordered1336",
"🖲": "ordered1337",
"🖼": "ordered1338",
"🗂": "ordered1339",
"🗃": "ordered1340",
"🗄": "ordered1341",
"🗑": "ordered1342",
"🗒": "ordered1343",
"🗓": "ordered1344",
"🗜": "ordered1345",
"🗝": "ordered1346",
"🗞": "ordered1347",
"🗡": "ordered1348",
"🗣": "ordered1349",
"🗨": "ordered1350",
"🗯": "ordered1351",
"🗳": "ordered1352",
"🗺": "ordered1353",
"🗻": "ordered1354",
"🗼": "ordered1355",
"🗽": "ordered1356",
"🗾": "ordered1357",
"🗿": "ordered1358",
"😀": "ordered1359",
"😁": "ordered1360",
"😂": "ordered1361",
"😃": "ordered1362",
"😄": "ordered1363",
"😅": "ordered1364",
"😆": "ordered1365",
"😇": "ordered1366",
"😈": "ordered1367",
"😉": "ordered1368",
"😊": "ordered1369",
"😋": "ordered1370",
"😌": "ordered1371",
"😍": "ordered1372",
"😎": "ordered1373",
"😏": "ordered1374",
"😐": "ordered1375",
"😑": "ordered1376",
"😒": "ordered1377",
"😓": "ordered1378",
"😔": "ordered1379",
"😕": "ordered1380",
"😖": "ordered1381",
"😗": "ordered1382",
"😘": "ordered1383",
"😙": "ordered1384",
"😚": "ordered1385",
"😛": "ordered1386",
"😜": "ordered1387",
"😝": "ordered1388",
"😞": "ordered1389",
"😟": "ordered1390",
"😠": "ordered1391",
"😡": "ordered1392",
"😢": "ordered1393",
"😣": "ordered1394",
"😤": "ordered1395",
"😥": "ordered1396",
"😦": "ordered1397",
"😧": "ordered1398",
"😨": "ordered1399",
"😩": "ordered1400",
"😪": "ordered1401",
"😫": "ordered1402",
"😬": "ordered1403",
"😭": "ordered1404",
"😮": "ordered1405",
"😯": "ordered1406",
"😰": "ordered1407",
"😱": "ordered1408",
"😲": "ordered1409",
"😳": "ordered1410",
"😴": "ordered1411",
"😵": "ordered1412",
"😶": "ordered1413",
"😷": "ordered1414",
"😸": "ordered1415",
"😹": "ordered1416",
"😺": "ordered1417",
"😻": "ordered1418",
"😼": "ordered1419",
"😽": "ordered1420",
"😾": "ordered1421",
"😿": "ordered1422",
"🙀": "ordered1423",
"🙁": "ordered1424",
"🙂": "ordered1425",
"🙃": "ordered1426",
"🙄": "ordered1427",
"🙅": "ordered1428",
"🙅🏻": "ordered1429",
"🙅🏼": "ordered1430",
"🙅🏽": "ordered1431",
"🙅🏾": "ordered1432",
"🙅🏿": "ordered1433",
"🙆": "ordered1434",
"🙆🏻": "ordered1435",
"🙆🏼": "ordered1436",
"🙆🏽": "ordered1437",
"🙆🏾": "ordered1438",
"🙆🏿": "ordered1439",
"🙇": "ordered1440",
"🙇🏻": "ordered1441",
"🙇🏼": "ordered1442",
"🙇🏽": "ordered1443",
"🙇🏾": "ordered1444",
"🙇🏿": "ordered1445",
"🙈": "ordered1446",
"🙉": "ordered1447",
"🙊": "ordered1448",
"🙋": "ordered1449",
"🙋🏻": "ordered1450",
"🙋🏼": "ordered1451",
"🙋🏽": "ordered1452",
"🙋🏾": "ordered1453",
"🙋🏿": "ordered1454",
"🙌": "ordered1455",
"🙌🏻": "ordered1456",
"🙌🏼": "ordered1457",
"🙌🏽": "ordered1458",
"🙌🏾": "ordered1459",
"🙌🏿": "ordered1460",
"🙍": "ordered1461",
"🙍🏻": "ordered1462",
"🙍🏼": "ordered1463",
"🙍🏽": "ordered1464",
"🙍🏾": "ordered1465",
"🙍🏿": "ordered1466",
"🙎": "ordered1467",
"🙎🏻": "ordered1468",
"🙎🏼": "ordered1469",
"🙎🏽": "ordered1470",
"🙎🏾": "ordered1471",
"🙎🏿": "ordered1472",
"🙏": "ordered1473",
"🙏🏻": "ordered1474",
"🙏🏼": "ordered1475",
"🙏🏽": "ordered1476",
"🙏🏾": "ordered1477",
"🙏🏿": "ordered1478",
"🚀": "ordered1479",
"🚁": "ordered1480",
"🚂": "ordered1481",
"🚃": "ordered1482",
"🚄": "ordered1483",
"🚅": "ordered1484",
"🚆": "ordered1485",
"🚇": "ordered1486",
"🚈": "ordered1487",
"🚉": "ordered1488",
"🚊": "ordered1489",
"🚋": "ordered1490",
"🚌": "ordered1491",
"🚍": "ordered1492",
"🚎": "ordered1493",
"🚏": "ordered1494",
"🚐": "ordered1495",
"🚑": "ordered1496",
"🚒": "ordered1497",
"🚓": "ordered1498",
"🚔": "ordered1499",
"🚕": "ordered1500",
"🚖": "ordered1501",
"🚗": "ordered1502",
"🚘": "ordered1503",
"🚙": "ordered1504",
"🚚": "ordered1505",
"🚛": "ordered1506",
"🚜": "ordered1507",
"🚝": "ordered1508",
"🚞": "ordered1509",
"🚟": "ordered1510",
"🚠": "ordered1511",
"🚡": "ordered1512",
"🚢": "ordered1513",
"🚣": "ordered1514",
"🚣🏻": "ordered1515",
"🚣🏼": "ordered1516",
"🚣🏽": "ordered1517",
"🚣🏾": "ordered1518",
"🚣🏿": "ordered1519",
"🚤": "ordered1520",
"🚥": "ordered1521",
"🚦": "ordered1522",
"🚧": "ordered1523",
"🚨": "ordered1524",
"🚩": "ordered1525",
"🚪": "ordered1526",
"🚫": "ordered1527",
"🚬": "ordered1528",
"🚭": "ordered1529",
"🚮": "ordered1530",
"🚯": "ordered1531",
"🚰": "ordered1532",
"🚱": "ordered1533",
"🚲": "ordered1534",
"🚳": "ordered1535",
"🚴": "ordered1536",
"🚴🏻": "ordered1537",
"🚴🏼": "ordered1538",
"🚴🏽": "ordered1539",
"🚴🏾": "ordered1540",
"🚴🏿": "ordered1541",
"🚵": "ordered1542",
"🚵🏻": "ordered1543",
"🚵🏼": "ordered1544",
"🚵🏽": "ordered1545",
"🚵🏾": "ordered1546",
"🚵🏿": "ordered1547",
"🚶": "ordered1548",
"🚶🏻": "ordered1549",
"🚶🏼": "ordered1550",
"🚶🏽": "ordered1551",
"🚶🏾": "ordered1552",
"🚶🏿": "ordered1553",
"🚷": "ordered1554",
"🚸": "ordered1555",
"🚹": "ordered1556",
"🚺": "ordered1557",
"🚻": "ordered1558",
"🚼": "ordered1559",
"🚽": "ordered1560",
"🚾": "ordered1561",
"🚿": "ordered1562",
"🛀": "ordered1563",
"🛀🏻": "ordered1564",
"🛀🏼": "ordered1565",
"🛀🏽": "ordered1566",
"🛀🏾": "ordered1567",
"🛀🏿": "ordered1568",
"🛁": "ordered1569",
"🛂": "ordered1570",
"🛃": "ordered1571",
"🛄": "ordered1572",
"🛅": "ordered1573",
"🛋": "ordered1574",
"🛌": "ordered1575",
"🛍": "ordered1576",
"🛎": "ordered1577",
"🛏": "ordered1578",
"🛐": "ordered1579",
"🛠": "ordered1580",
"🛡": "ordered1581",
"🛢": "ordered1582",
"🛣": "ordered1583",
"🛤": "ordered1584",
"🛥": "ordered1585",
"🛩": "ordered1586",
"🛫": "ordered1587",
"🛬": "ordered1588",
"🛰": "ordered1589",
"🛳": "ordered1590",
"🤐": "ordered1591",
"🤑": "ordered1592",
"🤒": "ordered1593",
"🤓": "ordered1594",
"🤔": "ordered1595",
"🤕": "ordered1596",
"🤖": "ordered1597",
"🤗": "ordered1598",
"🤘": "ordered1599",
"🤘🏻": "ordered1600",
"🤘🏼": "ordered1601",
"🤘🏽": "ordered1602",
"🤘🏾": "ordered1603",
"🤘🏿": "ordered1604",
"🦀": "ordered1605",
"🦁": "ordered1606",
"🦂": "ordered1607",
"🦃": "ordered1608",
"🦄": "ordered1609",
"🧀": "ordered1610",
"🇽🇪": "ordered1611"
}
}, function(e, t) {
"use strict";
e.exports = {
ach: {
name: "Acholi",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
af: {
name: "Afrikaans",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
ak: {
name: "Akan",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
am: {
name: "Amharic",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
an: {
name: "Aragonese",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
ar: {
name: "Arabic",
numbers: [0, 1, 2, 3, 11, 100],
plurals: function(e) {
return Number(0 === e ? 0 : 1 == e ? 1 : 2 == e ? 2 : e % 100 >= 3 && 10 >= e % 100 ? 3 : e % 100 >= 11 ? 4 : 5)
}
},
arn: {
name: "Mapudungun",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
ast: {
name: "Asturian",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
ay: {
name: "Aymará",
numbers: [1],
plurals: function(e) {
return 0
}
},
az: {
name: "Azerbaijani",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
be: {
name: "Belarusian",
numbers: [1, 2, 5],
plurals: function(e) {
return Number(e % 10 == 1 && e % 100 != 11 ? 0 : e % 10 >= 2 && 4 >= e % 10 && (10 > e % 100 || e % 100 >= 20) ? 1 : 2)
}
},
bg: {
name: "Bulgarian",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
bn: {
name: "Bengali",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
bo: {
name: "Tibetan",
numbers: [1],
plurals: function(e) {
return 0
}
},
br: {
name: "Breton",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
bs: {
name: "Bosnian",
numbers: [1, 2, 5],
plurals: function(e) {
return Number(e % 10 == 1 && e % 100 != 11 ? 0 : e % 10 >= 2 && 4 >= e % 10 && (10 > e % 100 || e % 100 >= 20) ? 1 : 2)
}
},
ca: {
name: "Catalan",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
cgg: {
name: "Chiga",
numbers: [1],
plurals: function(e) {
return 0
}
},
cs: {
name: "Czech",
numbers: [1, 2, 5],
plurals: function(e) {
return Number(1 == e ? 0 : e >= 2 && 4 >= e ? 1 : 2)
}
},
csb: {
name: "Kashubian",
numbers: [1, 2, 5],
plurals: function(e) {
return Number(1 == e ? 0 : e % 10 >= 2 && 4 >= e % 10 && (10 > e % 100 || e % 100 >= 20) ? 1 : 2)
}
},
cy: {
name: "Welsh",
numbers: [1, 2, 3, 8],
plurals: function(e) {
return Number(1 == e ? 0 : 2 == e ? 1 : 8 != e && 11 != e ? 2 : 3)
}
},
da: {
name: "Danish",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
de: {
name: "German",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
dz: {
name: "Dzongkha",
numbers: [1],
plurals: function(e) {
return 0
}
},
el: {
name: "Greek",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
en: {
name: "English",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
eo: {
name: "Esperanto",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
es: {
name: "Spanish",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
es_ar: {
name: "Argentinean Spanish",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
et: {
name: "Estonian",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
eu: {
name: "Basque",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
fa: {
name: "Persian",
numbers: [1],
plurals: function(e) {
return 0
}
},
fi: {
name: "Finnish",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
fil: {
name: "Filipino",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
fo: {
name: "Faroese",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
fr: {
name: "French",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
fur: {
name: "Friulian",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
fy: {
name: "Frisian",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
ga: {
name: "Irish",
numbers: [1, 2, 3, 7, 11],
plurals: function(e) {
return Number(1 == e ? 0 : 2 == e ? 1 : 7 > e ? 2 : 11 > e ? 3 : 4)
}
},
gd: {
name: "Scottish Gaelic",
numbers: [1, 2, 3, 20],
plurals: function(e) {
return Number(1 == e || 11 == e ? 0 : 2 == e || 12 == e ? 1 : e > 2 && 20 > e ? 2 : 3)
}
},
gl: {
name: "Galician",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
gu: {
name: "Gujarati",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
gun: {
name: "Gun",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
ha: {
name: "Hausa",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
he: {
name: "Hebrew",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
hi: {
name: "Hindi",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
hr: {
name: "Croatian",
numbers: [1, 2, 5],
plurals: function(e) {
return Number(e % 10 == 1 && e % 100 != 11 ? 0 : e % 10 >= 2 && 4 >= e % 10 && (10 > e % 100 || e % 100 >= 20) ? 1 : 2)
}
},
hu: {
name: "Hungarian",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
hy: {
name: "Armenian",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
ia: {
name: "Interlingua",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
id: {
name: "Indonesian",
numbers: [1],
plurals: function(e) {
return 0
}
},
is: {
name: "Icelandic",
numbers: [1, 2],
plurals: function(e) {
return Number(e % 10 != 1 || e % 100 == 11)
}
},
it: {
name: "Italian",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
ja: {
name: "Japanese",
numbers: [1],
plurals: function(e) {
return 0
}
},
jbo: {
name: "Lojban",
numbers: [1],
plurals: function(e) {
return 0
}
},
jv: {
name: "Javanese",
numbers: [0, 1],
plurals: function(e) {
return Number(0 !== e)
}
},
ka: {
name: "Georgian",
numbers: [1],
plurals: function(e) {
return 0
}
},
kk: {
name: "Kazakh",
numbers: [1],
plurals: function(e) {
return 0
}
},
km: {
name: "Khmer",
numbers: [1],
plurals: function(e) {
return 0
}
},
kn: {
name: "Kannada",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
ko: {
name: "Korean",
numbers: [1],
plurals: function(e) {
return 0
}
},
ku: {
name: "Kurdish",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
kw: {
name: "Cornish",
numbers: [1, 2, 3, 4],
plurals: function(e) {
return Number(1 == e ? 0 : 2 == e ? 1 : 3 == e ? 2 : 3)
}
},
ky: {
name: "Kyrgyz",
numbers: [1],
plurals: function(e) {
return 0
}
},
lb: {
name: "Letzeburgesch",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
ln: {
name: "Lingala",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
lo: {
name: "Lao",
numbers: [1],
plurals: function(e) {
return 0
}
},
lt: {
name: "Lithuanian",
numbers: [1, 2, 10],
plurals: function(e) {
return Number(e % 10 == 1 && e % 100 != 11 ? 0 : e % 10 >= 2 && (10 > e % 100 || e % 100 >= 20) ? 1 : 2)
}
},
lv: {
name: "Latvian",
numbers: [0, 1, 2],
plurals: function(e) {
return Number(e % 10 == 1 && e % 100 != 11 ? 0 : 0 !== e ? 1 : 2)
}
},
mai: {
name: "Maithili",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
mfe: {
name: "Mauritian Creole",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
mg: {
name: "Malagasy",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
mi: {
name: "Maori",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
mk: {
name: "Macedonian",
numbers: [1, 2],
plurals: function(e) {
return Number(1 == e || e % 10 == 1 ? 0 : 1)
}
},
ml: {
name: "Malayalam",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
mn: {
name: "Mongolian",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
mnk: {
name: "Mandinka",
numbers: [0, 1, 2],
plurals: function(e) {
return Number(0 === e ? 0 : 1 == e ? 1 : 2)
}
},
mr: {
name: "Marathi",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
ms: {
name: "Malay",
numbers: [1],
plurals: function(e) {
return 0
}
},
mt: {
name: "Maltese",
numbers: [1, 2, 11, 20],
plurals: function(e) {
return Number(1 == e ? 0 : 0 === e || e % 100 > 1 && 11 > e % 100 ? 1 : e % 100 > 10 && 20 > e % 100 ? 2 : 3)
}
},
nah: {
name: "Nahuatl",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
nap: {
name: "Neapolitan",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
nb: {
name: "Norwegian Bokmal",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
ne: {
name: "Nepali",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
nl: {
name: "Dutch",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
nn: {
name: "Norwegian Nynorsk",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
no: {
name: "Norwegian",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
nso: {
name: "Northern Sotho",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
oc: {
name: "Occitan",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
or: {
name: "Oriya",
numbers: [2, 1],
plurals: function(e) {
return Number(1 != e)
}
},
pa: {
name: "Punjabi",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
pap: {
name: "Papiamento",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
pl: {
name: "Polish",
numbers: [1, 2, 5],
plurals: function(e) {
return Number(1 == e ? 0 : e % 10 >= 2 && 4 >= e % 10 && (10 > e % 100 || e % 100 >= 20) ? 1 : 2)
}
},
pms: {
name: "Piemontese",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
ps: {
name: "Pashto",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
pt: {
name: "Portuguese",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
pt_br: {
name: "Brazilian Portuguese",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
rm: {
name: "Romansh",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
ro: {
name: "Romanian",
numbers: [1, 2, 20],
plurals: function(e) {
return Number(1 == e ? 0 : 0 === e || e % 100 > 0 && 20 > e % 100 ? 1 : 2)
}
},
ru: {
name: "Russian",
numbers: [1, 2, 5],
plurals: function(e) {
return Number(e % 10 == 1 && e % 100 != 11 ? 0 : e % 10 >= 2 && 4 >= e % 10 && (10 > e % 100 || e % 100 >= 20) ? 1 : 2)
}
},
sah: {
name: "Yakut",
numbers: [1],
plurals: function(e) {
return 0
}
},
sco: {
name: "Scots",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
se: {
name: "Northern Sami",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
si: {
name: "Sinhala",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
sk: {
name: "Slovak",
numbers: [1, 2, 5],
plurals: function(e) {
return Number(1 == e ? 0 : e >= 2 && 4 >= e ? 1 : 2)
}
},
sl: {
name: "Slovenian",
numbers: [5, 1, 2, 3],
plurals: function(e) {
return Number(e % 100 == 1 ? 1 : e % 100 == 2 ? 2 : e % 100 == 3 || e % 100 == 4 ? 3 : 0)
}
},
so: {
name: "Somali",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
son: {
name: "Songhay",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
sq: {
name: "Albanian",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
sr: {
name: "Serbian",
numbers: [1, 2, 5],
plurals: function(e) {
return Number(e % 10 == 1 && e % 100 != 11 ? 0 : e % 10 >= 2 && 4 >= e % 10 && (10 > e % 100 || e % 100 >= 20) ? 1 : 2)
}
},
su: {
name: "Sundanese",
numbers: [1],
plurals: function(e) {
return 0
}
},
sv: {
name: "Swedish",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
sw: {
name: "Swahili",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
ta: {
name: "Tamil",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
te: {
name: "Telugu",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
tg: {
name: "Tajik",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
th: {
name: "Thai",
numbers: [1],
plurals: function(e) {
return 0
}
},
ti: {
name: "Tigrinya",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
tk: {
name: "Turkmen",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
tr: {
name: "Turkish",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
tt: {
name: "Tatar",
numbers: [1],
plurals: function(e) {
return 0
}
},
ug: {
name: "Uyghur",
numbers: [1],
plurals: function(e) {
return 0
}
},
uk: {
name: "Ukrainian",
numbers: [1, 2, 5],
plurals: function(e) {
return Number(e % 10 == 1 && e % 100 != 11 ? 0 : e % 10 >= 2 && 4 >= e % 10 && (10 > e % 100 || e % 100 >= 20) ? 1 : 2)
}
},
ur: {
name: "Urdu",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
uz: {
name: "Uzbek",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
vi: {
name: "Vietnamese",
numbers: [1],
plurals: function(e) {
return 0
}
},
wa: {
name: "Walloon",
numbers: [1, 2],
plurals: function(e) {
return Number(e > 1)
}
},
wo: {
name: "Wolof",
numbers: [1],
plurals: function(e) {
return 0
}
},
yo: {
name: "Yoruba",
numbers: [1, 2],
plurals: function(e) {
return Number(1 != e)
}
},
zh: {
name: "Chinese",
numbers: [1],
plurals: function(e) {
return 0
}
}
}
}, function(e, t) {
"use strict";
var r = [.1, .82, .25, 1],
n = [.69, 0, .79, .14],
o = [.84, .07, .93, .46];
Velocity.RegisterEffect("attach.Down", {
defaultDuration: 300,
calls: [
[{
opacity: [1, 0],
translateY: ["0%", "-100%"],
scaleX: [1, .3],
scaleY: [1, .3]
}, 1, {
easing: [300, 22]
}]
]
}), Velocity.RegisterEffect("attach.Up", {
defaultDuration: 200,
easing: n,
calls: [
[{
opacity: [0, 1],
translateY: ["-150%", "0%"],
scaleX: [.3, 1],
scaleY: [.3, 1]
}, 1, {
easing: [.33, 0, .39, .91]
}]
]
}), Velocity.RegisterEffect("dropdown.Down", {
defaultDuration: 200,
easing: r,
calls: [
[{
opacity: [1, 0],
translateY: ["0%", "-15px"]
}, 1, {
easing: r
}]
]
});
var i = {
pop: {
duration: 200,
easing: o,
enter: {
props: {
scaleX: [1, .5],
scaleY: [1, .5],
opacity: [1, 0]
}
},
leave: {
props: {
scaleX: [.5, 1],
scaleY: [.5, 1],
opacity: [0, 1]
}
}
},
slide: {
duration: 200,
eaing: r,
enter: {
props: "slideDown"
},
leave: {
props: "slideUp"
}
},
scaleY: {
duration: 200,
easing: r,
enter: {
props: {
scaleY: [1, 0],
transformOrigin: "center"
}
},
leave: {
props: {
scaleY: [0, 1],
transformOrigin: "center"
}
}
},
scale: {
duration: 500,
easing: r,
enter: {
props: {
scaleX: [1, 0],
scaleY: [1, 0]
}
},
leave: {
props: {
scaleX: [0, 1],
scaleY: [0, 1]
}
}
},
fade: {
duration: 200,
easing: r,
enter: {
props: {
opacity: [1, 0]
}
},
leave: {
props: {
opacity: [0, 1]
}
}
},
"fade-fast": {
easing: "ease",
enter: {
props: {
opacity: [1, 0]
},
duration: 150
},
leave: {
props: {
opacity: [0, 1]
},
duration: 100
}
},
fade_sifo: {
enter: {
props: {
opacity: [1, 0]
},
duration: 250
},
leave: {
props: {
opacity: [0, 1]
},
duration: 100
}
},
capture: {
enter: {
props: {
opacity: [1, 0]
},
duration: 350
},
leave: [{
selector: ".snapshot",
props: "transition.bounceDownOut",
duration: 700
}, {
selector: ".webcam",
props: {
opacity: [0, 1]
},
duration: 100,
easing: "ease"
}]
},
butterbar: {
enter: {
props: "slideDown",
easing: r,
duration: 700
},
leave: {
props: "slideUp",
easing: n,
duration: 350
}
},
modal: {
enter: [{
props: {
opacity: [1, 0]
},
duration: 300,
easing: "easeOut"
}, {
selector: ".popup",
props: {
scaleX: [1, 0],
scaleY: [1, 0],
opacity: [1, 1]
},
easing: [.19, .73, .28, 1],
delay: 180,
duration: 200
}, {
selector: ".popup",
props: {
opacity: [0, 0]
},
duration: 180
}],
leave: [{
props: {
opacity: [0, 1]
},
duration: 300,
easing: n,
delay: 100
}, {
selector: ".popup",
props: {
scaleX: [0, 1],
scaleY: [0, 1]
},
easing: n,
duration: 200
}]
},
"modal-flow": {
enter: [{
selector: ".backdrop",
props: {
opacity: [1, 0]
},
duration: 300,
easing: "easeOut"
}, {
selector: ".popup",
props: {
scaleX: [1, 0],
scaleY: [1, 0],
opacity: [1, 1]
},
easing: [.19, .73, .28, 1],
delay: 180,
duration: 200
}, {
selector: ".popup",
props: {
opacity: [0, 0]
},
duration: 180
}],
leave: [{
selector: ".backdrop",
props: {
opacity: [0, 1]
},
duration: 300,
easing: n,
delay: 100
}, {
selector: ".popup",
props: {
scaleX: [0, 1],
scaleY: [0, 1]
},
easing: n,
duration: 200
}]
},
"flow-transition-modal-push": {
duration: 300,
easing: r,
enter: {
props: {
opacity: [1, 0]
}
},
leave: {
props: {
opacity: [0, 1]
}
}
},
"flow-transition-modal-pop": {
duration: 300,
easing: r,
enter: {
props: {
opacity: [1, 0]
}
},
leave: {
props: {
opacity: [0, 1]
}
}
},
"flow-transition-drawer-push": {
duration: 300,
easing: r,
enter: {
props: {
translateX: ["0%", "100%"]
}
},
leave: {
props: {
translateX: ["-100%", "0%"]
}
}
},
"flow-transition-drawer-pop": {
duration: 300,
easing: r,
enter: {
props: {
translateX: ["0%", "-100%"]
}
},
leave: {
props: {
translateX: ["100%", "0%"]
}
}
},
"drawer-left": {
enter: [{
props: {
translateX: ["0%", "-100%"]
},
duration: 300,
easing: r
}, {
selector: ".drawer-title",
props: {
translateX: [0, -50],
opacity: [1, 0]
},
duration: 500,
easing: "easeOut"
}],
leave: [{
props: {
translateX: ["-100%", "0%"]
},
duration: 300,
easing: n
}]
},
"drawer-left-rtl": {
enter: [{
props: {
translateX: ["0%", "100%"]
},
duration: 300,
easing: r
}, {
selector: ".drawer-title",
props: {
translateX: [0, 50],
opacity: [1, 0]
},
duration: 500,
easing: "easeOut"
}],
leave: [{
props: {
translateX: ["100%", "0%"]
},
duration: 300,
easing: n
}]
},
dropdown: {
duration: 300,
easing: r,
enter: [{
selector: ".menu-item",
props: "dropdown.Down",
delay: 50,
duration: 375,
stagger: 25,
drag: !0
}, {
props: {
scale: [1, 0]
}
}, {
props: {
opacity: [1, 0]
},
duration: 100
}],
leave: {
props: {
scaleX: [0, 1],
scaleY: [0, 1],
opacity: [0, 1]
}
}
},
"dropdown-picker": {
duration: 300,
easing: r,
enter: [{
selector: ".menu-item",
props: {
opacity: [1, 0]
},
delay: 50,
duration: 200
}, {
selector: ".nib",
props: {
opacity: [1, 0],
rotateZ: ["45deg"],
translateY: ["0%", "-100%"]
}
}, {
props: {
scale: [1, 0]
}
}, {
props: {
opacity: [1, 0]
},
duration: 100
}],
leave: [{
selector: ".menu-item",
props: {
opacity: [1, 0]
},
duration: 100
}, {
selector: ".nib",
props: {
opacity: [1, 0]
},
duration: 150
}, {
props: {
scaleX: [0, 1],
scaleY: [0, 1],
opacity: [0, 1]
}
}]
},
"profile-viewer": {
duration: 500,
easing: [.1, 1.03, .28, .99],
leave: [{
delay: 400,
props: {
opacity: [0, 1]
}
}, {
selector: ".profile-viewer",
props: {
borderRadius: ["50%", "0%"]
}
}]
},
"media-viewer": {
duration: 300,
easing: [.1, 1.03, .28, .99],
leave: {
selector: ".media-viewer",
props: {
opacity: [0, 1]
}
}
},
menu: {
enter: {
selector: ".menu-icons-item",
props: "attach.Down",
duration: 700,
stagger: 30,
drag: !0
},
leave: {
selector: ".menu-icons-item",
props: "attach.Up",
stagger: 30
}
},
emoji: {
duration: 300,
easing: r,
enter: {
props: {
height: [234, 0]
}
},
leave: {
props: {
height: [0, 234]
}
}
},
ptt: {
enter: [{
selector: ".btn-border",
easing: "easeInOut",
props: {
scaleX: [1, .5],
scaleY: [1, .5],
opacity: [1, 0]
},
duration: 250,
delay: 100
@ricardoperovano
Copy link

How can I access it and use the methods ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment