salesforce-mc-connector
Version:
Biblioteca genérica para integração com Data Extensions do Salesforce Marketing Cloud
861 lines (857 loc) • 634 kB
JavaScript
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function getDefaultExportFromCjs (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
var src = {exports: {}};
(function (module, exports) {
!function (e, p) {
module.exports = p() ;
}(commonjsGlobal, function () {
var e = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof commonjsGlobal ? commonjsGlobal : "undefined" != typeof self ? self : {};
function p(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var a = {
exports: {}
};
return function (p) {
p.exports = function () {
var p = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : void 0 !== e ? e : "undefined" != typeof self ? self : {};
function a(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var d = {
exports: {}
};
return function (e) {
e.exports = function () {
var e = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : void 0 !== p ? p : "undefined" != typeof self ? self : {};
function a(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var d = {
exports: {}
};
return function (p) {
p.exports = function () {
var p = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : void 0 !== e ? e : "undefined" != typeof self ? self : {};
function a(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
function d(e) {
if (e.__esModule) return e;
var p = e.default;
if ("function" == typeof p) {
var a = function e() {
return this instanceof e ? Reflect.construct(p, arguments, this.constructor) : p.apply(this, arguments);
};
a.prototype = p.prototype;
} else a = {};
return Object.defineProperty(a, "__esModule", {
value: true
}), Object.keys(e).forEach(function (p) {
var d = Object.getOwnPropertyDescriptor(e, p);
Object.defineProperty(a, p, d.get ? d : {
enumerable: true,
get: function () {
return e[p];
}
});
}), a;
}
var t,
i = {
exports: {}
};
function r() {}
function l() {
l.init.call(this);
}
function m(e) {
return void 0 === e._maxListeners ? l.defaultMaxListeners : e._maxListeners;
}
function n(e, p, a, d) {
var t, i, l, n;
if ("function" != typeof a) throw new TypeError('"listener" argument must be a function');
if ((i = e._events) ? (i.newListener && (e.emit("newListener", p, a.listener ? a.listener : a), i = e._events), l = i[p]) : (i = e._events = new r(), e._eventsCount = 0), l) {
if ("function" == typeof l ? l = i[p] = d ? [a, l] : [l, a] : d ? l.unshift(a) : l.push(a), !l.warned && (t = m(e)) && t > 0 && l.length > t) {
l.warned = true;
var o = new Error("Possible EventEmitter memory leak detected. " + l.length + " " + p + " listeners added. Use emitter.setMaxListeners() to increase limit");
o.name = "MaxListenersExceededWarning", o.emitter = e, o.type = p, o.count = l.length, n = o, "function" == typeof console.warn ? console.warn(n) : console.log(n);
}
} else l = i[p] = a, ++e._eventsCount;
return e;
}
function o(e, p, a) {
var d = false;
function t() {
e.removeListener(p, t), d || (d = true, a.apply(e, arguments));
}
return t.listener = a, t;
}
function s(e) {
var p = this._events;
if (p) {
var a = p[e];
if ("function" == typeof a) return 1;
if (a) return a.length;
}
return 0;
}
function u(e, p) {
for (var a = new Array(p); p--;) a[p] = e[p];
return a;
}
r.prototype = Object.create(null), l.EventEmitter = l, l.usingDomains = false, l.prototype.domain = void 0, l.prototype._events = void 0, l.prototype._maxListeners = void 0, l.defaultMaxListeners = 10, l.init = function () {
this.domain = null, l.usingDomains && (!t.active || this instanceof t.Domain || (this.domain = t.active)), this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = new r(), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
}, l.prototype.setMaxListeners = function (e) {
if ("number" != typeof e || e < 0 || isNaN(e)) throw new TypeError('"n" argument must be a positive number');
return this._maxListeners = e, this;
}, l.prototype.getMaxListeners = function () {
return m(this);
}, l.prototype.emit = function (e) {
var p,
a,
d,
t,
i,
r,
l,
m = "error" === e;
if (r = this._events) m = m && null == r.error;else if (!m) return false;
if (l = this.domain, m) {
if (p = arguments[1], !l) {
if (p instanceof Error) throw p;
var n = new Error('Uncaught, unspecified "error" event. (' + p + ")");
throw n.context = p, n;
}
return p || (p = new Error('Uncaught, unspecified "error" event')), p.domainEmitter = this, p.domain = l, p.domainThrown = false, l.emit("error", p), false;
}
if (!(a = r[e])) return false;
var o = "function" == typeof a;
switch (d = arguments.length) {
case 1:
!function (e, p, a) {
if (p) e.call(a);else for (var d = e.length, t = u(e, d), i = 0; i < d; ++i) t[i].call(a);
}(a, o, this);
break;
case 2:
!function (e, p, a, d) {
if (p) e.call(a, d);else for (var t = e.length, i = u(e, t), r = 0; r < t; ++r) i[r].call(a, d);
}(a, o, this, arguments[1]);
break;
case 3:
!function (e, p, a, d, t) {
if (p) e.call(a, d, t);else for (var i = e.length, r = u(e, i), l = 0; l < i; ++l) r[l].call(a, d, t);
}(a, o, this, arguments[1], arguments[2]);
break;
case 4:
!function (e, p, a, d, t, i) {
if (p) e.call(a, d, t, i);else for (var r = e.length, l = u(e, r), m = 0; m < r; ++m) l[m].call(a, d, t, i);
}(a, o, this, arguments[1], arguments[2], arguments[3]);
break;
default:
for (t = new Array(d - 1), i = 1; i < d; i++) t[i - 1] = arguments[i];
!function (e, p, a, d) {
if (p) e.apply(a, d);else for (var t = e.length, i = u(e, t), r = 0; r < t; ++r) i[r].apply(a, d);
}(a, o, this, t);
}
return true;
}, l.prototype.addListener = function (e, p) {
return n(this, e, p, false);
}, l.prototype.on = l.prototype.addListener, l.prototype.prependListener = function (e, p) {
return n(this, e, p, true);
}, l.prototype.once = function (e, p) {
if ("function" != typeof p) throw new TypeError('"listener" argument must be a function');
return this.on(e, o(this, e, p)), this;
}, l.prototype.prependOnceListener = function (e, p) {
if ("function" != typeof p) throw new TypeError('"listener" argument must be a function');
return this.prependListener(e, o(this, e, p)), this;
}, l.prototype.removeListener = function (e, p) {
var a, d, t, i, l;
if ("function" != typeof p) throw new TypeError('"listener" argument must be a function');
if (!(d = this._events)) return this;
if (!(a = d[e])) return this;
if (a === p || a.listener && a.listener === p) 0 == --this._eventsCount ? this._events = new r() : (delete d[e], d.removeListener && this.emit("removeListener", e, a.listener || p));else if ("function" != typeof a) {
for (t = -1, i = a.length; i-- > 0;) if (a[i] === p || a[i].listener && a[i].listener === p) {
l = a[i].listener, t = i;
break;
}
if (t < 0) return this;
if (1 === a.length) {
if (a[0] = void 0, 0 == --this._eventsCount) return this._events = new r(), this;
delete d[e];
} else !function (e, p) {
for (var a = p, d = a + 1, t = e.length; d < t; a += 1, d += 1) e[a] = e[d];
e.pop();
}(a, t);
d.removeListener && this.emit("removeListener", e, l || p);
}
return this;
}, l.prototype.off = function (e, p) {
return this.removeListener(e, p);
}, l.prototype.removeAllListeners = function (e) {
var p, a;
if (!(a = this._events)) return this;
if (!a.removeListener) return 0 === arguments.length ? (this._events = new r(), this._eventsCount = 0) : a[e] && (0 == --this._eventsCount ? this._events = new r() : delete a[e]), this;
if (0 === arguments.length) {
for (var d, t = Object.keys(a), i = 0; i < t.length; ++i) "removeListener" !== (d = t[i]) && this.removeAllListeners(d);
return this.removeAllListeners("removeListener"), this._events = new r(), this._eventsCount = 0, this;
}
if ("function" == typeof (p = a[e])) this.removeListener(e, p);else if (p) do {
this.removeListener(e, p[p.length - 1]);
} while (p[0]);
return this;
}, l.prototype.listeners = function (e) {
var p,
a = this._events;
return a && (p = a[e]) ? "function" == typeof p ? [p.listener || p] : function (e) {
for (var p = new Array(e.length), a = 0; a < p.length; ++a) p[a] = e[a].listener || e[a];
return p;
}(p) : [];
}, l.listenerCount = function (e, p) {
return "function" == typeof e.listenerCount ? e.listenerCount(p) : s.call(e, p);
}, l.prototype.listenerCount = s, l.prototype.eventNames = function () {
return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
};
var h = void 0 !== e ? e : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {},
f = [],
c = [],
v = "undefined" != typeof Uint8Array ? Uint8Array : Array,
w = false;
function _() {
w = true;
for (var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0; p < 64; ++p) f[p] = e[p], c[e.charCodeAt(p)] = p;
c["-".charCodeAt(0)] = 62, c["_".charCodeAt(0)] = 63;
}
function g(e, p, a) {
for (var d, t, i = [], r = p; r < a; r += 3) d = (e[r] << 16) + (e[r + 1] << 8) + e[r + 2], i.push(f[(t = d) >> 18 & 63] + f[t >> 12 & 63] + f[t >> 6 & 63] + f[63 & t]);
return i.join("");
}
function b(e) {
var p;
w || _();
for (var a = e.length, d = a % 3, t = "", i = [], r = 16383, l = 0, m = a - d; l < m; l += r) i.push(g(e, l, l + r > m ? m : l + r));
return 1 === d ? (p = e[a - 1], t += f[p >> 2], t += f[p << 4 & 63], t += "==") : 2 === d && (p = (e[a - 2] << 8) + e[a - 1], t += f[p >> 10], t += f[p >> 4 & 63], t += f[p << 2 & 63], t += "="), i.push(t), i.join("");
}
function y(e, p, a, d, t) {
var i,
r,
l = 8 * t - d - 1,
m = (1 << l) - 1,
n = m >> 1,
o = -7,
s = a ? t - 1 : 0,
u = a ? -1 : 1,
h = e[p + s];
for (s += u, i = h & (1 << -o) - 1, h >>= -o, o += l; o > 0; i = 256 * i + e[p + s], s += u, o -= 8);
for (r = i & (1 << -o) - 1, i >>= -o, o += d; o > 0; r = 256 * r + e[p + s], s += u, o -= 8);
if (0 === i) i = 1 - n;else {
if (i === m) return r ? NaN : 1 / 0 * (h ? -1 : 1);
r += Math.pow(2, d), i -= n;
}
return (h ? -1 : 1) * r * Math.pow(2, i - d);
}
function N(e, p, a, d, t, i) {
var r,
l,
m,
n = 8 * i - t - 1,
o = (1 << n) - 1,
s = o >> 1,
u = 23 === t ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
h = d ? 0 : i - 1,
f = d ? 1 : -1,
c = p < 0 || 0 === p && 1 / p < 0 ? 1 : 0;
for (p = Math.abs(p), isNaN(p) || p === 1 / 0 ? (l = isNaN(p) ? 1 : 0, r = o) : (r = Math.floor(Math.log(p) / Math.LN2), p * (m = Math.pow(2, -r)) < 1 && (r--, m *= 2), (p += r + s >= 1 ? u / m : u * Math.pow(2, 1 - s)) * m >= 2 && (r++, m /= 2), r + s >= o ? (l = 0, r = o) : r + s >= 1 ? (l = (p * m - 1) * Math.pow(2, t), r += s) : (l = p * Math.pow(2, s - 1) * Math.pow(2, t), r = 0)); t >= 8; e[a + h] = 255 & l, h += f, l /= 256, t -= 8);
for (r = r << t | l, n += t; n > 0; e[a + h] = 255 & r, h += f, r /= 256, n -= 8);
e[a + h - f] |= 128 * c;
}
var S = {}.toString,
D = Array.isArray || function (e) {
return "[object Array]" == S.call(e);
};
function T() {
return V.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
}
function E(e, p) {
if (T() < p) throw new RangeError("Invalid typed array length");
return V.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(p)).__proto__ = V.prototype : (null === e && (e = new V(p)), e.length = p), e;
}
function V(e, p, a) {
if (!(V.TYPED_ARRAY_SUPPORT || this instanceof V)) return new V(e, p, a);
if ("number" == typeof e) {
if ("string" == typeof p) throw new Error("If encoding is specified then the first argument must be a string");
return R(this, e);
}
return A(this, e, p, a);
}
function A(e, p, a, d) {
if ("number" == typeof p) throw new TypeError('"value" argument must not be a number');
return "undefined" != typeof ArrayBuffer && p instanceof ArrayBuffer ? function (e, p, a, d) {
if (p.byteLength, a < 0 || p.byteLength < a) throw new RangeError("'offset' is out of bounds");
if (p.byteLength < a + (d || 0)) throw new RangeError("'length' is out of bounds");
return p = void 0 === a && void 0 === d ? new Uint8Array(p) : void 0 === d ? new Uint8Array(p, a) : new Uint8Array(p, a, d), V.TYPED_ARRAY_SUPPORT ? (e = p).__proto__ = V.prototype : e = x(e, p), e;
}(e, p, a, d) : "string" == typeof p ? function (e, p, a) {
if ("string" == typeof a && "" !== a || (a = "utf8"), !V.isEncoding(a)) throw new TypeError('"encoding" must be a valid string encoding');
var d = 0 | L(p, a),
t = (e = E(e, d)).write(p, a);
return t !== d && (e = e.slice(0, t)), e;
}(e, p, a) : function (e, p) {
if (O(p)) {
var a = 0 | C(p.length);
return 0 === (e = E(e, a)).length || p.copy(e, 0, 0, a), e;
}
if (p) {
if ("undefined" != typeof ArrayBuffer && p.buffer instanceof ArrayBuffer || "length" in p) return "number" != typeof p.length || (d = p.length) != d ? E(e, 0) : x(e, p);
if ("Buffer" === p.type && D(p.data)) return x(e, p.data);
}
var d;
throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
}(e, p);
}
function k(e) {
if ("number" != typeof e) throw new TypeError('"size" argument must be a number');
if (e < 0) throw new RangeError('"size" argument must not be negative');
}
function R(e, p) {
if (k(p), e = E(e, p < 0 ? 0 : 0 | C(p)), !V.TYPED_ARRAY_SUPPORT) for (var a = 0; a < p; ++a) e[a] = 0;
return e;
}
function x(e, p) {
var a = p.length < 0 ? 0 : 0 | C(p.length);
e = E(e, a);
for (var d = 0; d < a; d += 1) e[d] = 255 & p[d];
return e;
}
function C(e) {
if (e >= T()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + T().toString(16) + " bytes");
return 0 | e;
}
function O(e) {
return !(null == e || !e._isBuffer);
}
function L(e, p) {
if (O(e)) return e.length;
if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)) return e.byteLength;
"string" != typeof e && (e = "" + e);
var a = e.length;
if (0 === a) return 0;
for (var d = false;;) switch (p) {
case "ascii":
case "latin1":
case "binary":
return a;
case "utf8":
case "utf-8":
case void 0:
return le(e).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return 2 * a;
case "hex":
return a >>> 1;
case "base64":
return me(e).length;
default:
if (d) return le(e).length;
p = ("" + p).toLowerCase(), d = true;
}
}
function B(e, p, a) {
var d = false;
if ((void 0 === p || p < 0) && (p = 0), p > this.length) return "";
if ((void 0 === a || a > this.length) && (a = this.length), a <= 0) return "";
if ((a >>>= 0) <= (p >>>= 0)) return "";
for (e || (e = "utf8");;) switch (e) {
case "hex":
return G(this, p, a);
case "utf8":
case "utf-8":
return $(this, p, a);
case "ascii":
return K(this, p, a);
case "latin1":
case "binary":
return W(this, p, a);
case "base64":
return H(this, p, a);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return X(this, p, a);
default:
if (d) throw new TypeError("Unknown encoding: " + e);
e = (e + "").toLowerCase(), d = true;
}
}
function U(e, p, a) {
var d = e[p];
e[p] = e[a], e[a] = d;
}
function P(e, p, a, d, t) {
if (0 === e.length) return -1;
if ("string" == typeof a ? (d = a, a = 0) : a > 2147483647 ? a = 2147483647 : a < -2147483648 && (a = -2147483648), a = +a, isNaN(a) && (a = t ? 0 : e.length - 1), a < 0 && (a = e.length + a), a >= e.length) {
if (t) return -1;
a = e.length - 1;
} else if (a < 0) {
if (!t) return -1;
a = 0;
}
if ("string" == typeof p && (p = V.from(p, d)), O(p)) return 0 === p.length ? -1 : z(e, p, a, d, t);
if ("number" == typeof p) return p &= 255, V.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? t ? Uint8Array.prototype.indexOf.call(e, p, a) : Uint8Array.prototype.lastIndexOf.call(e, p, a) : z(e, [p], a, d, t);
throw new TypeError("val must be string, number or Buffer");
}
function z(e, p, a, d, t) {
var i,
r = 1,
l = e.length,
m = p.length;
if (void 0 !== d && ("ucs2" === (d = String(d).toLowerCase()) || "ucs-2" === d || "utf16le" === d || "utf-16le" === d)) {
if (e.length < 2 || p.length < 2) return -1;
r = 2, l /= 2, m /= 2, a /= 2;
}
function n(e, p) {
return 1 === r ? e[p] : e.readUInt16BE(p * r);
}
if (t) {
var o = -1;
for (i = a; i < l; i++) if (n(e, i) === n(p, -1 === o ? 0 : i - o)) {
if (-1 === o && (o = i), i - o + 1 === m) return o * r;
} else -1 !== o && (i -= i - o), o = -1;
} else for (a + m > l && (a = l - m), i = a; i >= 0; i--) {
for (var s = true, u = 0; u < m; u++) if (n(e, i + u) !== n(p, u)) {
s = false;
break;
}
if (s) return i;
}
return -1;
}
function F(e, p, a, d) {
a = Number(a) || 0;
var t = e.length - a;
d ? (d = Number(d)) > t && (d = t) : d = t;
var i = p.length;
if (i % 2 != 0) throw new TypeError("Invalid hex string");
d > i / 2 && (d = i / 2);
for (var r = 0; r < d; ++r) {
var l = parseInt(p.substr(2 * r, 2), 16);
if (isNaN(l)) return r;
e[a + r] = l;
}
return r;
}
function I(e, p, a, d) {
return ne(le(p, e.length - a), e, a, d);
}
function M(e, p, a, d) {
return ne(function (e) {
for (var p = [], a = 0; a < e.length; ++a) p.push(255 & e.charCodeAt(a));
return p;
}(p), e, a, d);
}
function j(e, p, a, d) {
return M(e, p, a, d);
}
function q(e, p, a, d) {
return ne(me(p), e, a, d);
}
function Z(e, p, a, d) {
return ne(function (e, p) {
for (var a, d, t, i = [], r = 0; r < e.length && !((p -= 2) < 0); ++r) d = (a = e.charCodeAt(r)) >> 8, t = a % 256, i.push(t), i.push(d);
return i;
}(p, e.length - a), e, a, d);
}
function H(e, p, a) {
return 0 === p && a === e.length ? b(e) : b(e.slice(p, a));
}
function $(e, p, a) {
a = Math.min(e.length, a);
for (var d = [], t = p; t < a;) {
var i,
r,
l,
m,
n = e[t],
o = null,
s = n > 239 ? 4 : n > 223 ? 3 : n > 191 ? 2 : 1;
if (t + s <= a) switch (s) {
case 1:
n < 128 && (o = n);
break;
case 2:
128 == (192 & (i = e[t + 1])) && (m = (31 & n) << 6 | 63 & i) > 127 && (o = m);
break;
case 3:
i = e[t + 1], r = e[t + 2], 128 == (192 & i) && 128 == (192 & r) && (m = (15 & n) << 12 | (63 & i) << 6 | 63 & r) > 2047 && (m < 55296 || m > 57343) && (o = m);
break;
case 4:
i = e[t + 1], r = e[t + 2], l = e[t + 3], 128 == (192 & i) && 128 == (192 & r) && 128 == (192 & l) && (m = (15 & n) << 18 | (63 & i) << 12 | (63 & r) << 6 | 63 & l) > 65535 && m < 1114112 && (o = m);
}
null === o ? (o = 65533, s = 1) : o > 65535 && (o -= 65536, d.push(o >>> 10 & 1023 | 55296), o = 56320 | 1023 & o), d.push(o), t += s;
}
return function (e) {
var p = e.length;
if (p <= Y) return String.fromCharCode.apply(String, e);
for (var a = "", d = 0; d < p;) a += String.fromCharCode.apply(String, e.slice(d, d += Y));
return a;
}(d);
}
V.TYPED_ARRAY_SUPPORT = void 0 === h.TYPED_ARRAY_SUPPORT || h.TYPED_ARRAY_SUPPORT, T(), V.poolSize = 8192, V._augment = function (e) {
return e.__proto__ = V.prototype, e;
}, V.from = function (e, p, a) {
return A(null, e, p, a);
}, V.TYPED_ARRAY_SUPPORT && (V.prototype.__proto__ = Uint8Array.prototype, V.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && V[Symbol.species]), V.alloc = function (e, p, a) {
return function (e, p, a, d) {
return k(p), p <= 0 ? E(e, p) : void 0 !== a ? "string" == typeof d ? E(e, p).fill(a, d) : E(e, p).fill(a) : E(e, p);
}(null, e, p, a);
}, V.allocUnsafe = function (e) {
return R(null, e);
}, V.allocUnsafeSlow = function (e) {
return R(null, e);
}, V.isBuffer = oe, V.compare = function (e, p) {
if (!O(e) || !O(p)) throw new TypeError("Arguments must be Buffers");
if (e === p) return 0;
for (var a = e.length, d = p.length, t = 0, i = Math.min(a, d); t < i; ++t) if (e[t] !== p[t]) {
a = e[t], d = p[t];
break;
}
return a < d ? -1 : d < a ? 1 : 0;
}, V.isEncoding = function (e) {
switch (String(e).toLowerCase()) {
case "hex":
case "utf8":
case "utf-8":
case "ascii":
case "latin1":
case "binary":
case "base64":
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return true;
default:
return false;
}
}, V.concat = function (e, p) {
if (!D(e)) throw new TypeError('"list" argument must be an Array of Buffers');
if (0 === e.length) return V.alloc(0);
var a;
if (void 0 === p) for (p = 0, a = 0; a < e.length; ++a) p += e[a].length;
var d = V.allocUnsafe(p),
t = 0;
for (a = 0; a < e.length; ++a) {
var i = e[a];
if (!O(i)) throw new TypeError('"list" argument must be an Array of Buffers');
i.copy(d, t), t += i.length;
}
return d;
}, V.byteLength = L, V.prototype._isBuffer = true, V.prototype.swap16 = function () {
var e = this.length;
if (e % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
for (var p = 0; p < e; p += 2) U(this, p, p + 1);
return this;
}, V.prototype.swap32 = function () {
var e = this.length;
if (e % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
for (var p = 0; p < e; p += 4) U(this, p, p + 3), U(this, p + 1, p + 2);
return this;
}, V.prototype.swap64 = function () {
var e = this.length;
if (e % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
for (var p = 0; p < e; p += 8) U(this, p, p + 7), U(this, p + 1, p + 6), U(this, p + 2, p + 5), U(this, p + 3, p + 4);
return this;
}, V.prototype.toString = function () {
var e = 0 | this.length;
return 0 === e ? "" : 0 === arguments.length ? $(this, 0, e) : B.apply(this, arguments);
}, V.prototype.equals = function (e) {
if (!O(e)) throw new TypeError("Argument must be a Buffer");
return this === e || 0 === V.compare(this, e);
}, V.prototype.inspect = function () {
var e = "";
return this.length > 0 && (e = this.toString("hex", 0, 50).match(/.{2}/g).join(" "), this.length > 50 && (e += " ... ")), "<Buffer " + e + ">";
}, V.prototype.compare = function (e, p, a, d, t) {
if (!O(e)) throw new TypeError("Argument must be a Buffer");
if (void 0 === p && (p = 0), void 0 === a && (a = e ? e.length : 0), void 0 === d && (d = 0), void 0 === t && (t = this.length), p < 0 || a > e.length || d < 0 || t > this.length) throw new RangeError("out of range index");
if (d >= t && p >= a) return 0;
if (d >= t) return -1;
if (p >= a) return 1;
if (this === e) return 0;
for (var i = (t >>>= 0) - (d >>>= 0), r = (a >>>= 0) - (p >>>= 0), l = Math.min(i, r), m = this.slice(d, t), n = e.slice(p, a), o = 0; o < l; ++o) if (m[o] !== n[o]) {
i = m[o], r = n[o];
break;
}
return i < r ? -1 : r < i ? 1 : 0;
}, V.prototype.includes = function (e, p, a) {
return -1 !== this.indexOf(e, p, a);
}, V.prototype.indexOf = function (e, p, a) {
return P(this, e, p, a, true);
}, V.prototype.lastIndexOf = function (e, p, a) {
return P(this, e, p, a, false);
}, V.prototype.write = function (e, p, a, d) {
if (void 0 === p) d = "utf8", a = this.length, p = 0;else if (void 0 === a && "string" == typeof p) d = p, a = this.length, p = 0;else {
if (!isFinite(p)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
p |= 0, isFinite(a) ? (a |= 0, void 0 === d && (d = "utf8")) : (d = a, a = void 0);
}
var t = this.length - p;
if ((void 0 === a || a > t) && (a = t), e.length > 0 && (a < 0 || p < 0) || p > this.length) throw new RangeError("Attempt to write outside buffer bounds");
d || (d = "utf8");
for (var i = false;;) switch (d) {
case "hex":
return F(this, e, p, a);
case "utf8":
case "utf-8":
return I(this, e, p, a);
case "ascii":
return M(this, e, p, a);
case "latin1":
case "binary":
return j(this, e, p, a);
case "base64":
return q(this, e, p, a);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return Z(this, e, p, a);
default:
if (i) throw new TypeError("Unknown encoding: " + d);
d = ("" + d).toLowerCase(), i = true;
}
}, V.prototype.toJSON = function () {
return {
type: "Buffer",
data: Array.prototype.slice.call(this._arr || this, 0)
};
};
var Y = 4096;
function K(e, p, a) {
var d = "";
a = Math.min(e.length, a);
for (var t = p; t < a; ++t) d += String.fromCharCode(127 & e[t]);
return d;
}
function W(e, p, a) {
var d = "";
a = Math.min(e.length, a);
for (var t = p; t < a; ++t) d += String.fromCharCode(e[t]);
return d;
}
function G(e, p, a) {
var d = e.length;
(!p || p < 0) && (p = 0), (!a || a < 0 || a > d) && (a = d);
for (var t = "", i = p; i < a; ++i) t += re(e[i]);
return t;
}
function X(e, p, a) {
for (var d = e.slice(p, a), t = "", i = 0; i < d.length; i += 2) t += String.fromCharCode(d[i] + 256 * d[i + 1]);
return t;
}
function J(e, p, a) {
if (e % 1 != 0 || e < 0) throw new RangeError("offset is not uint");
if (e + p > a) throw new RangeError("Trying to access beyond buffer length");
}
function Q(e, p, a, d, t, i) {
if (!O(e)) throw new TypeError('"buffer" argument must be a Buffer instance');
if (p > t || p < i) throw new RangeError('"value" argument is out of bounds');
if (a + d > e.length) throw new RangeError("Index out of range");
}
function ee(e, p, a, d) {
p < 0 && (p = 65535 + p + 1);
for (var t = 0, i = Math.min(e.length - a, 2); t < i; ++t) e[a + t] = (p & 255 << 8 * (d ? t : 1 - t)) >>> 8 * (d ? t : 1 - t);
}
function pe(e, p, a, d) {
p < 0 && (p = 4294967295 + p + 1);
for (var t = 0, i = Math.min(e.length - a, 4); t < i; ++t) e[a + t] = p >>> 8 * (d ? t : 3 - t) & 255;
}
function ae(e, p, a, d, t, i) {
if (a + d > e.length) throw new RangeError("Index out of range");
if (a < 0) throw new RangeError("Index out of range");
}
function de(e, p, a, d, t) {
return t || ae(e, 0, a, 4), N(e, p, a, d, 23, 4), a + 4;
}
function te(e, p, a, d, t) {
return t || ae(e, 0, a, 8), N(e, p, a, d, 52, 8), a + 8;
}
V.prototype.slice = function (e, p) {
var a,
d = this.length;
if ((e = ~~e) < 0 ? (e += d) < 0 && (e = 0) : e > d && (e = d), (p = void 0 === p ? d : ~~p) < 0 ? (p += d) < 0 && (p = 0) : p > d && (p = d), p < e && (p = e), V.TYPED_ARRAY_SUPPORT) (a = this.subarray(e, p)).__proto__ = V.prototype;else {
var t = p - e;
a = new V(t, void 0);
for (var i = 0; i < t; ++i) a[i] = this[i + e];
}
return a;
}, V.prototype.readUIntLE = function (e, p, a) {
e |= 0, p |= 0, a || J(e, p, this.length);
for (var d = this[e], t = 1, i = 0; ++i < p && (t *= 256);) d += this[e + i] * t;
return d;
}, V.prototype.readUIntBE = function (e, p, a) {
e |= 0, p |= 0, a || J(e, p, this.length);
for (var d = this[e + --p], t = 1; p > 0 && (t *= 256);) d += this[e + --p] * t;
return d;
}, V.prototype.readUInt8 = function (e, p) {
return p || J(e, 1, this.length), this[e];
}, V.prototype.readUInt16LE = function (e, p) {
return p || J(e, 2, this.length), this[e] | this[e + 1] << 8;
}, V.prototype.readUInt16BE = function (e, p) {
return p || J(e, 2, this.length), this[e] << 8 | this[e + 1];
}, V.prototype.readUInt32LE = function (e, p) {
return p || J(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3];
}, V.prototype.readUInt32BE = function (e, p) {
return p || J(e, 4, this.length), 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
}, V.prototype.readIntLE = function (e, p, a) {
e |= 0, p |= 0, a || J(e, p, this.length);
for (var d = this[e], t = 1, i = 0; ++i < p && (t *= 256);) d += this[e + i] * t;
return d >= (t *= 128) && (d -= Math.pow(2, 8 * p)), d;
}, V.prototype.readIntBE = function (e, p, a) {
e |= 0, p |= 0, a || J(e, p, this.length);
for (var d = p, t = 1, i = this[e + --d]; d > 0 && (t *= 256);) i += this[e + --d] * t;
return i >= (t *= 128) && (i -= Math.pow(2, 8 * p)), i;
}, V.prototype.readInt8 = function (e, p) {
return p || J(e, 1, this.length), 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e];
}, V.prototype.readInt16LE = function (e, p) {
p || J(e, 2, this.length);
var a = this[e] | this[e + 1] << 8;
return 32768 & a ? 4294901760 | a : a;
}, V.prototype.readInt16BE = function (e, p) {
p || J(e, 2, this.length);
var a = this[e + 1] | this[e] << 8;
return 32768 & a ? 4294901760 | a : a;
}, V.prototype.readInt32LE = function (e, p) {
return p || J(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
}, V.prototype.readInt32BE = function (e, p) {
return p || J(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
}, V.prototype.readFloatLE = function (e, p) {
return p || J(e, 4, this.length), y(this, e, true, 23, 4);
}, V.prototype.readFloatBE = function (e, p) {
return p || J(e, 4, this.length), y(this, e, false, 23, 4);
}, V.prototype.readDoubleLE = function (e, p) {
return p || J(e, 8, this.length), y(this, e, true, 52, 8);
}, V.prototype.readDoubleBE = function (e, p) {
return p || J(e, 8, this.length), y(this, e, false, 52, 8);
}, V.prototype.writeUIntLE = function (e, p, a, d) {
e = +e, p |= 0, a |= 0, d || Q(this, e, p, a, Math.pow(2, 8 * a) - 1, 0);
var t = 1,
i = 0;
for (this[p] = 255 & e; ++i < a && (t *= 256);) this[p + i] = e / t & 255;
return p + a;
}, V.prototype.writeUIntBE = function (e, p, a, d) {
e = +e, p |= 0, a |= 0, d || Q(this, e, p, a, Math.pow(2, 8 * a) - 1, 0);
var t = a - 1,
i = 1;
for (this[p + t] = 255 & e; --t >= 0 && (i *= 256);) this[p + t] = e / i & 255;
return p + a;
}, V.prototype.writeUInt8 = function (e, p, a) {
return e = +e, p |= 0, a || Q(this, e, p, 1, 255, 0), V.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), this[p] = 255 & e, p + 1;
}, V.prototype.writeUInt16LE = function (e, p, a) {
return e = +e, p |= 0, a || Q(this, e, p, 2, 65535, 0), V.TYPED_ARRAY_SUPPORT ? (this[p] = 255 & e, this[p + 1] = e >>> 8) : ee(this, e, p, true), p + 2;
}, V.prototype.writeUInt16BE = function (e, p, a) {
return e = +e, p |= 0, a || Q(this, e, p, 2, 65535, 0), V.TYPED_ARRAY_SUPPORT ? (this[p] = e >>> 8, this[p + 1] = 255 & e) : ee(this, e, p, false), p + 2;
}, V.prototype.writeUInt32LE = function (e, p, a) {
return e = +e, p |= 0, a || Q(this, e, p, 4, 4294967295, 0), V.TYPED_ARRAY_SUPPORT ? (this[p + 3] = e >>> 24, this[p + 2] = e >>> 16, this[p + 1] = e >>> 8, this[p] = 255 & e) : pe(this, e, p, true), p + 4;
}, V.prototype.writeUInt32BE = function (e, p, a) {
return e = +e, p |= 0, a || Q(this, e, p, 4, 4294967295, 0), V.TYPED_ARRAY_SUPPORT ? (this[p] = e >>> 24, this[p + 1] = e >>> 16, this[p + 2] = e >>> 8, this[p + 3] = 255 & e) : pe(this, e, p, false), p + 4;
}, V.prototype.writeIntLE = function (e, p, a, d) {
if (e = +e, p |= 0, !d) {
var t = Math.pow(2, 8 * a - 1);
Q(this, e, p, a, t - 1, -t);
}
var i = 0,
r = 1,
l = 0;
for (this[p] = 255 & e; ++i < a && (r *= 256);) e < 0 && 0 === l && 0 !== this[p + i - 1] && (l = 1), this[p + i] = (e / r | 0) - l & 255;
return p + a;
}, V.prototype.writeIntBE = function (e, p, a, d) {
if (e = +e, p |= 0, !d) {
var t = Math.pow(2, 8 * a - 1);
Q(this, e, p, a, t - 1, -t);
}
var i = a - 1,
r = 1,
l = 0;
for (this[p + i] = 255 & e; --i >= 0 && (r *= 256);) e < 0 && 0 === l && 0 !== this[p + i + 1] && (l = 1), this[p + i] = (e / r | 0) - l & 255;
return p + a;
}, V.prototype.writeInt8 = function (e, p, a) {
return e = +e, p |= 0, a || Q(this, e, p, 1, 127, -128), V.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), e < 0 && (e = 255 + e + 1), this[p] = 255 & e, p + 1;
}, V.prototype.writeInt16LE = function (e, p, a) {
return e = +e, p |= 0, a || Q(this, e, p, 2, 32767, -32768), V.TYPED_ARRAY_SUPPORT ? (this[p] = 255 & e, this[p + 1] = e >>> 8) : ee(this, e, p, true), p + 2;
}, V.prototype.writeInt16BE = function (e, p, a) {
return e = +e, p |= 0, a || Q(this, e, p, 2, 32767, -32768), V.TYPED_ARRAY_SUPPORT ? (this[p] = e >>> 8, this[p + 1] = 255 & e) : ee(this, e, p, false), p + 2;
}, V.prototype.writeInt32LE = function (e, p, a) {
return e = +e, p |= 0, a || Q(this, e, p, 4, 2147483647, -2147483648), V.TYPED_ARRAY_SUPPORT ? (this[p] = 255 & e, this[p + 1] = e >>> 8, this[p + 2] = e >>> 16, this[p + 3] = e >>> 24) : pe(this, e, p, true), p + 4;
}, V.prototype.writeInt32BE = function (e, p, a) {
return e = +e, p |= 0, a || Q(this, e, p, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), V.TYPED_ARRAY_SUPPORT ? (this[p] = e >>> 24, this[p + 1] = e >>> 16, this[p + 2] = e >>> 8, this[p + 3] = 255 & e) : pe(this, e, p, false), p + 4;
}, V.prototype.writeFloatLE = function (e, p, a) {
return de(this, e, p, true, a);
}, V.prototype.writeFloatBE = function (e, p, a) {
return de(this, e, p, false, a);
}, V.prototype.writeDoubleLE = function (e, p, a) {
return te(this, e, p, true, a);
}, V.prototype.writeDoubleBE = function (e, p, a) {
return te(this, e, p, false, a);
}, V.prototype.copy = function (e, p, a, d) {
if (a || (a = 0), d || 0 === d || (d = this.length), p >= e.length && (p = e.length), p || (p = 0), d > 0 && d < a && (d = a), d === a) return 0;
if (0 === e.length || 0 === this.length) return 0;
if (p < 0) throw new RangeError("targetStart out of bounds");
if (a < 0 || a >= this.length) throw new RangeError("sourceStart out of bounds");
if (d < 0) throw new RangeError("sourceEnd out of bounds");
d > this.length && (d = this.length), e.length - p < d - a && (d = e.length - p + a);
var t,
i = d - a;
if (this === e && a < p && p < d) for (t = i - 1; t >= 0; --t) e[t + p] = this[t + a];else if (i < 1e3 || !V.TYPED_ARRAY_SUPPORT) for (t = 0; t < i; ++t) e[t + p] = this[t + a];else Uint8Array.prototype.set.call(e, this.subarray(a, a + i), p);
return i;
}, V.prototype.fill = function (e, p, a, d) {
if ("string" == typeof e) {
if ("string" == typeof p ? (d = p, p = 0, a = this.length) : "string" == typeof a && (d = a, a = this.length), 1 === e.length) {
var t = e.charCodeAt(0);
t < 256 && (e = t);
}
if (void 0 !== d && "string" != typeof d) throw new TypeError("encoding must be a string");
if ("string" == typeof d && !V.isEncoding(d)) throw new TypeError("Unknown encoding: " + d);
} else "number" == typeof e && (e &= 255);
if (p < 0 || this.length < p || this.length < a) throw new RangeError("Out of range index");
if (a <= p) return this;
var i;
if (p >>>= 0, a = void 0 === a ? this.length : a >>> 0, e || (e = 0), "number" == typeof e) for (i = p; i < a; ++i) this[i] = e;else {
var r = O(e) ? e : le(new V(e, d).toString()),
l = r.length;
for (i = 0; i < a - p; ++i) this[i + p] = r[i % l];
}
return this;
};
var ie = /[^+\/0-9A-Za-z-_]/g;
function re(e) {
return e < 16 ? "0" + e.toString(16) : e.toString(16);
}
function le(e, p) {
var a;
p = p || 1 / 0;
for (var d = e.length, t = null, i = [], r = 0; r < d; ++r) {
if ((a = e.charCodeAt(r)) > 55295 && a < 57344) {
if (!t) {
if (a > 56319) {
(p -= 3) > -1 && i.push(239, 191, 189);
continue;
}
if (r + 1 === d) {
(p -= 3) > -1 && i.push(239, 191, 189);
continue;
}
t = a;
continue;
}
if (a < 56320) {
(p -= 3) > -1 && i.push(239, 191, 189), t = a;
continue;
}
a = 65536 + (t - 55296 << 10 | a - 56320);
} else t && (p -= 3) > -1 && i.push(239, 191, 189);
if (t = null, a < 128) {
if ((p -= 1) < 0