@qooxdoo/framework
Version:
The JS Framework for Coders
1,390 lines (1,372 loc) • 165 kB
JavaScript
/* @preserve
* The MIT License (MIT)
*
* Copyright (c) 2013-2018 Petka Antonov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
/**
* bluebird build version 3.5.5
* Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each
*/
!(function (t) {
if ("object" == typeof exports && "undefined" != typeof module)
module.exports = t();
else if ("function" == typeof define && define.amd) define([], t);
else {
var e;
"undefined" != typeof window
? (e = window)
: "undefined" != typeof global
? (e = global)
: "undefined" != typeof self && (e = self),
(e.Promise = t());
}
})(function () {
var t, e, n;
return (function r(t, e, n) {
function i(s, a) {
if (!e[s]) {
if (!t[s]) {
var c = "function" == typeof _dereq_ && _dereq_;
if (!a && c) return c(s, !0);
if (o) return o(s, !0);
var l = new Error("Cannot find module '" + s + "'");
throw ((l.code = "MODULE_NOT_FOUND"), l);
}
var u = (e[s] = { exports: {} });
t[s][0].call(
u.exports,
function (e) {
var n = t[s][1][e];
return i(n ? n : e);
},
u,
u.exports,
r,
t,
e,
n
);
}
return e[s].exports;
}
for (
var o = "function" == typeof _dereq_ && _dereq_, s = 0;
s < n.length;
s++
)
i(n[s]);
return i;
})(
{
1: [
function (t, e, n) {
"use strict";
e.exports = function (t) {
function e(t) {
var e = new n(t),
r = e.promise();
return e.setHowMany(1), e.setUnwrap(), e.init(), r;
}
var n = t._SomePromiseArray;
(t.any = function (t) {
return e(t);
}),
(t.prototype.any = function () {
return e(this);
});
};
},
{}
],
2: [
function (t, e, n) {
"use strict";
function r() {
(this._customScheduler = !1),
(this._isTickUsed = !1),
(this._lateQueue = new h(16)),
(this._normalQueue = new h(16)),
(this._haveDrainedQueues = !1),
(this._trampolineEnabled = !0);
var t = this;
(this.drainQueues = function () {
t._drainQueues();
}),
(this._schedule = p);
}
function i(t, e, n) {
this._lateQueue.push(t, e, n), this._queueTick();
}
function o(t, e, n) {
this._normalQueue.push(t, e, n), this._queueTick();
}
function s(t) {
this._normalQueue._pushOne(t), this._queueTick();
}
function a(t) {
for (; t.length() > 0; ) c(t);
}
function c(t) {
var e = t.shift();
if ("function" != typeof e) e._settlePromises();
else {
var n = t.shift(),
r = t.shift();
e.call(n, r);
}
}
var l;
try {
throw new Error();
} catch (u) {
l = u;
}
var p = t("./schedule"),
h = t("./queue"),
f = t("./util");
(r.prototype.setScheduler = function (t) {
var e = this._schedule;
return (this._schedule = t), (this._customScheduler = !0), e;
}),
(r.prototype.hasCustomScheduler = function () {
return this._customScheduler;
}),
(r.prototype.enableTrampoline = function () {
this._trampolineEnabled = !0;
}),
(r.prototype.disableTrampolineIfNecessary = function () {
f.hasDevTools && (this._trampolineEnabled = !1);
}),
(r.prototype.haveItemsQueued = function () {
return this._isTickUsed || this._haveDrainedQueues;
}),
(r.prototype.fatalError = function (t, e) {
e
? (process.stderr.write(
"Fatal " + (t instanceof Error ? t.stack : t) + "\n"
),
process.exit(2))
: this.throwLater(t);
}),
(r.prototype.throwLater = function (t, e) {
if (
(1 === arguments.length &&
((e = t),
(t = function () {
throw e;
})),
"undefined" != typeof setTimeout)
)
setTimeout(function () {
t(e);
}, 0);
else
try {
this._schedule(function () {
t(e);
});
} catch (n) {
throw new Error(
"No async scheduler available\n\n See http://goo.gl/MqrFmX\n"
);
}
}),
f.hasDevTools
? ((r.prototype.invokeLater = function (t, e, n) {
this._trampolineEnabled
? i.call(this, t, e, n)
: this._schedule(function () {
setTimeout(function () {
t.call(e, n);
}, 100);
});
}),
(r.prototype.invoke = function (t, e, n) {
this._trampolineEnabled
? o.call(this, t, e, n)
: this._schedule(function () {
t.call(e, n);
});
}),
(r.prototype.settlePromises = function (t) {
this._trampolineEnabled
? s.call(this, t)
: this._schedule(function () {
t._settlePromises();
});
}))
: ((r.prototype.invokeLater = i),
(r.prototype.invoke = o),
(r.prototype.settlePromises = s)),
(r.prototype._drainQueues = function () {
a(this._normalQueue),
this._reset(),
(this._haveDrainedQueues = !0),
a(this._lateQueue);
}),
(r.prototype._queueTick = function () {
this._isTickUsed ||
((this._isTickUsed = !0), this._schedule(this.drainQueues));
}),
(r.prototype._reset = function () {
this._isTickUsed = !1;
}),
(e.exports = r),
(e.exports.firstLineError = l);
},
{ "./queue": 26, "./schedule": 29, "./util": 36 }
],
3: [
function (t, e, n) {
"use strict";
e.exports = function (t, e, n, r) {
var i = !1,
o = function (t, e) {
this._reject(e);
},
s = function (t, e) {
(e.promiseRejectionQueued = !0),
e.bindingPromise._then(o, o, null, this, t);
},
a = function (t, e) {
0 === (50397184 & this._bitField) &&
this._resolveCallback(e.target);
},
c = function (t, e) {
e.promiseRejectionQueued || this._reject(t);
};
(t.prototype.bind = function (o) {
i ||
((i = !0),
(t.prototype._propagateFrom = r.propagateFromFunction()),
(t.prototype._boundValue = r.boundValueFunction()));
var l = n(o),
u = new t(e);
u._propagateFrom(this, 1);
var p = this._target();
if ((u._setBoundTo(l), l instanceof t)) {
var h = {
promiseRejectionQueued: !1,
promise: u,
target: p,
bindingPromise: l
};
p._then(e, s, void 0, u, h),
l._then(a, c, void 0, u, h),
u._setOnCancel(l);
} else u._resolveCallback(p);
return u;
}),
(t.prototype._setBoundTo = function (t) {
void 0 !== t
? ((this._bitField = 2097152 | this._bitField),
(this._boundTo = t))
: (this._bitField = -2097153 & this._bitField);
}),
(t.prototype._isBound = function () {
return 2097152 === (2097152 & this._bitField);
}),
(t.bind = function (e, n) {
return t.resolve(n).bind(e);
});
};
},
{}
],
4: [
function (t, e, n) {
"use strict";
function r() {
try {
Promise === o && (Promise = i);
} catch (t) {}
return o;
}
var i;
"undefined" != typeof Promise && (i = Promise);
var o = t("./promise")();
(o.noConflict = r), (e.exports = o);
},
{ "./promise": 22 }
],
5: [
function (t, e, n) {
"use strict";
var r = Object.create;
if (r) {
var i = r(null),
o = r(null);
i[" size"] = o[" size"] = 0;
}
e.exports = function (e) {
function n(t, n) {
var r;
if ((null != t && (r = t[n]), "function" != typeof r)) {
var i =
"Object " +
a.classString(t) +
" has no method '" +
a.toString(n) +
"'";
throw new e.TypeError(i);
}
return r;
}
function r(t) {
var e = this.pop(),
r = n(t, e);
return r.apply(t, this);
}
function i(t) {
return t[this];
}
function o(t) {
var e = +this;
return 0 > e && (e = Math.max(0, e + t.length)), t[e];
}
var s,
a = t("./util"),
c = a.canEvaluate;
a.isIdentifier;
(e.prototype.call = function (t) {
var e = [].slice.call(arguments, 1);
return e.push(t), this._then(r, void 0, void 0, e, void 0);
}),
(e.prototype.get = function (t) {
var e,
n = "number" == typeof t;
if (n) e = o;
else if (c) {
var r = s(t);
e = null !== r ? r : i;
} else e = i;
return this._then(e, void 0, void 0, t, void 0);
});
};
},
{ "./util": 36 }
],
6: [
function (t, e, n) {
"use strict";
e.exports = function (e, n, r, i) {
var o = t("./util"),
s = o.tryCatch,
a = o.errorObj,
c = e._async;
(e.prototype["break"] = e.prototype.cancel =
function () {
if (!i.cancellation())
return this._warn("cancellation is disabled");
for (var t = this, e = t; t._isCancellable(); ) {
if (!t._cancelBy(e)) {
e._isFollowing()
? e._followee().cancel()
: e._cancelBranched();
break;
}
var n = t._cancellationParent;
if (null == n || !n._isCancellable()) {
t._isFollowing()
? t._followee().cancel()
: t._cancelBranched();
break;
}
t._isFollowing() && t._followee().cancel(),
t._setWillBeCancelled(),
(e = t),
(t = n);
}
}),
(e.prototype._branchHasCancelled = function () {
this._branchesRemainingToCancel--;
}),
(e.prototype._enoughBranchesHaveCancelled = function () {
return (
void 0 === this._branchesRemainingToCancel ||
this._branchesRemainingToCancel <= 0
);
}),
(e.prototype._cancelBy = function (t) {
return t === this
? ((this._branchesRemainingToCancel = 0),
this._invokeOnCancel(),
!0)
: (this._branchHasCancelled(),
this._enoughBranchesHaveCancelled()
? (this._invokeOnCancel(), !0)
: !1);
}),
(e.prototype._cancelBranched = function () {
this._enoughBranchesHaveCancelled() && this._cancel();
}),
(e.prototype._cancel = function () {
this._isCancellable() &&
(this._setCancelled(),
c.invoke(this._cancelPromises, this, void 0));
}),
(e.prototype._cancelPromises = function () {
this._length() > 0 && this._settlePromises();
}),
(e.prototype._unsetOnCancel = function () {
this._onCancelField = void 0;
}),
(e.prototype._isCancellable = function () {
return this.isPending() && !this._isCancelled();
}),
(e.prototype.isCancellable = function () {
return this.isPending() && !this.isCancelled();
}),
(e.prototype._doInvokeOnCancel = function (t, e) {
if (o.isArray(t))
for (var n = 0; n < t.length; ++n)
this._doInvokeOnCancel(t[n], e);
else if (void 0 !== t)
if ("function" == typeof t) {
if (!e) {
var r = s(t).call(this._boundValue());
r === a &&
(this._attachExtraTrace(r.e), c.throwLater(r.e));
}
} else t._resultCancelled(this);
}),
(e.prototype._invokeOnCancel = function () {
var t = this._onCancel();
this._unsetOnCancel(),
c.invoke(this._doInvokeOnCancel, this, t);
}),
(e.prototype._invokeInternalOnCancel = function () {
this._isCancellable() &&
(this._doInvokeOnCancel(this._onCancel(), !0),
this._unsetOnCancel());
}),
(e.prototype._resultCancelled = function () {
this.cancel();
});
};
},
{ "./util": 36 }
],
7: [
function (t, e, n) {
"use strict";
e.exports = function (e) {
function n(t, n, a) {
return function (c) {
var l = a._boundValue();
t: for (var u = 0; u < t.length; ++u) {
var p = t[u];
if (
p === Error ||
(null != p && p.prototype instanceof Error)
) {
if (c instanceof p) return o(n).call(l, c);
} else if ("function" == typeof p) {
var h = o(p).call(l, c);
if (h === s) return h;
if (h) return o(n).call(l, c);
} else if (r.isObject(c)) {
for (var f = i(p), _ = 0; _ < f.length; ++_) {
var d = f[_];
if (p[d] != c[d]) continue t;
}
return o(n).call(l, c);
}
}
return e;
};
}
var r = t("./util"),
i = t("./es5").keys,
o = r.tryCatch,
s = r.errorObj;
return n;
};
},
{ "./es5": 13, "./util": 36 }
],
8: [
function (t, e, n) {
"use strict";
e.exports = function (t) {
function e() {
this._trace = new e.CapturedTrace(r());
}
function n() {
return i ? new e() : void 0;
}
function r() {
var t = o.length - 1;
return t >= 0 ? o[t] : void 0;
}
var i = !1,
o = [];
return (
(t.prototype._promiseCreated = function () {}),
(t.prototype._pushContext = function () {}),
(t.prototype._popContext = function () {
return null;
}),
(t._peekContext = t.prototype._peekContext = function () {}),
(e.prototype._pushContext = function () {
void 0 !== this._trace &&
((this._trace._promiseCreated = null), o.push(this._trace));
}),
(e.prototype._popContext = function () {
if (void 0 !== this._trace) {
var t = o.pop(),
e = t._promiseCreated;
return (t._promiseCreated = null), e;
}
return null;
}),
(e.CapturedTrace = null),
(e.create = n),
(e.deactivateLongStackTraces = function () {}),
(e.activateLongStackTraces = function () {
var n = t.prototype._pushContext,
o = t.prototype._popContext,
s = t._peekContext,
a = t.prototype._peekContext,
c = t.prototype._promiseCreated;
(e.deactivateLongStackTraces = function () {
(t.prototype._pushContext = n),
(t.prototype._popContext = o),
(t._peekContext = s),
(t.prototype._peekContext = a),
(t.prototype._promiseCreated = c),
(i = !1);
}),
(i = !0),
(t.prototype._pushContext = e.prototype._pushContext),
(t.prototype._popContext = e.prototype._popContext),
(t._peekContext = t.prototype._peekContext = r),
(t.prototype._promiseCreated = function () {
var t = this._peekContext();
t &&
null == t._promiseCreated &&
(t._promiseCreated = this);
});
}),
e
);
};
},
{}
],
9: [
function (t, e, n) {
"use strict";
e.exports = function (e, n) {
function r(t, e) {
return { promise: e };
}
function i() {
return !1;
}
function o(t, e, n) {
var r = this;
try {
t(e, n, function (t) {
if ("function" != typeof t)
throw new TypeError(
"onCancel must be a function, got: " + H.toString(t)
);
r._attachCancellationCallback(t);
});
} catch (i) {
return i;
}
}
function s(t) {
if (!this._isCancellable()) return this;
var e = this._onCancel();
void 0 !== e
? H.isArray(e)
? e.push(t)
: this._setOnCancel([e, t])
: this._setOnCancel(t);
}
function a() {
return this._onCancelField;
}
function c(t) {
this._onCancelField = t;
}
function l() {
(this._cancellationParent = void 0),
(this._onCancelField = void 0);
}
function u(t, e) {
if (0 !== (1 & e)) {
this._cancellationParent = t;
var n = t._branchesRemainingToCancel;
void 0 === n && (n = 0), (t._branchesRemainingToCancel = n + 1);
}
0 !== (2 & e) && t._isBound() && this._setBoundTo(t._boundTo);
}
function p(t, e) {
0 !== (2 & e) && t._isBound() && this._setBoundTo(t._boundTo);
}
function h() {
var t = this._boundTo;
return void 0 !== t && t instanceof e
? t.isFulfilled()
? t.value()
: void 0
: t;
}
function f() {
this._trace = new O(this._peekContext());
}
function _(t, e) {
if (U(t)) {
var n = this._trace;
if ((void 0 !== n && e && (n = n._parent), void 0 !== n))
n.attachExtraTrace(t);
else if (!t.__stackCleaned__) {
var r = E(t);
H.notEnumerableProp(
t,
"stack",
r.message + "\n" + r.stack.join("\n")
),
H.notEnumerableProp(t, "__stackCleaned__", !0);
}
}
}
function d() {
this._trace = void 0;
}
function v(t, e, n, r, i) {
if (void 0 === t && null !== e && J) {
if (void 0 !== i && i._returnedNonUndefined()) return;
if (0 === (65535 & r._bitField)) return;
n && (n += " ");
var o = "",
s = "";
if (e._trace) {
for (
var a = e._trace.stack.split("\n"),
c = C(a),
l = c.length - 1;
l >= 0;
--l
) {
var u = c[l];
if (!q.test(u)) {
var p = u.match($);
p && (o = "at " + p[1] + ":" + p[2] + ":" + p[3] + " ");
break;
}
}
if (c.length > 0)
for (var h = c[0], l = 0; l < a.length; ++l)
if (a[l] === h) {
l > 0 && (s = "\n" + a[l - 1]);
break;
}
}
var f =
"a promise was created in a " +
n +
"handler " +
o +
"but was not returned from it, see http://goo.gl/rRqMUw" +
s;
r._warn(f, !0, e);
}
}
function y(t, e) {
var n =
t + " is deprecated and will be removed in a future version.";
return e && (n += " Use " + e + " instead."), m(n);
}
function m(t, n, r) {
if (at.warnings) {
var i,
o = new N(t);
if (n) r._attachExtraTrace(o);
else if (at.longStackTraces && (i = e._peekContext()))
i.attachExtraTrace(o);
else {
var s = E(o);
o.stack = s.message + "\n" + s.stack.join("\n");
}
nt("warning", o) || k(o, "", !0);
}
}
function g(t, e) {
for (var n = 0; n < e.length - 1; ++n)
e[n].push("From previous event:"), (e[n] = e[n].join("\n"));
return (
n < e.length && (e[n] = e[n].join("\n")),
t + "\n" + e.join("\n")
);
}
function b(t) {
for (var e = 0; e < t.length; ++e)
(0 === t[e].length ||
(e + 1 < t.length && t[e][0] === t[e + 1][0])) &&
(t.splice(e, 1), e--);
}
function w(t) {
for (var e = t[0], n = 1; n < t.length; ++n) {
for (
var r = t[n],
i = e.length - 1,
o = e[i],
s = -1,
a = r.length - 1;
a >= 0;
--a
)
if (r[a] === o) {
s = a;
break;
}
for (var a = s; a >= 0; --a) {
var c = r[a];
if (e[i] !== c) break;
e.pop(), i--;
}
e = r;
}
}
function C(t) {
for (var e = [], n = 0; n < t.length; ++n) {
var r = t[n],
i = " (No stack trace)" === r || Q.test(r),
o = i && it(r);
i &&
!o &&
(z && " " !== r.charAt(0) && (r = " " + r), e.push(r));
}
return e;
}
function j(t) {
for (
var e = t.stack.replace(/\s+$/g, "").split("\n"), n = 0;
n < e.length;
++n
) {
var r = e[n];
if (" (No stack trace)" === r || Q.test(r)) break;
}
return n > 0 && "SyntaxError" != t.name && (e = e.slice(n)), e;
}
function E(t) {
var e = t.stack,
n = t.toString();
return (
(e =
"string" == typeof e && e.length > 0
? j(t)
: [" (No stack trace)"]),
{ message: n, stack: "SyntaxError" == t.name ? e : C(e) }
);
}
function k(t, e, n) {
if ("undefined" != typeof console) {
var r;
if (H.isObject(t)) {
var i = t.stack;
r = e + G(i, t);
} else r = e + String(t);
"function" == typeof V
? V(r, n)
: ("function" == typeof console.log ||
"object" == typeof console.log) &&
console.log(r);
}
}
function F(t, e, n, r) {
var i = !1;
try {
"function" == typeof e &&
((i = !0), "rejectionHandled" === t ? e(r) : e(n, r));
} catch (o) {
L.throwLater(o);
}
"unhandledRejection" === t
? nt(t, n, r) || i || k(n, "Unhandled rejection ")
: nt(t, r);
}
function T(t) {
var e;
if ("function" == typeof t)
e = "[function " + (t.name || "anonymous") + "]";
else {
e =
t && "function" == typeof t.toString
? t.toString()
: H.toString(t);
var n = /\[object [a-zA-Z0-9$_]+\]/;
if (n.test(e))
try {
var r = JSON.stringify(t);
e = r;
} catch (i) {}
0 === e.length && (e = "(empty array)");
}
return "(<" + x(e) + ">, no stack trace)";
}
function x(t) {
var e = 41;
return t.length < e ? t : t.substr(0, e - 3) + "...";
}
function P() {
return "function" == typeof st;
}
function S(t) {
var e = t.match(ot);
return e ? { fileName: e[1], line: parseInt(e[2], 10) } : void 0;
}
function R(t, e) {
if (P()) {
for (
var n,
r,
i = (t.stack || "").split("\n"),
o = (e.stack || "").split("\n"),
s = -1,
a = -1,
c = 0;
c < i.length;
++c
) {
var l = S(i[c]);
if (l) {
(n = l.fileName), (s = l.line);
break;
}
}
for (var c = 0; c < o.length; ++c) {
var l = S(o[c]);
if (l) {
(r = l.fileName), (a = l.line);
break;
}
}
0 > s ||
0 > a ||
!n ||
!r ||
n !== r ||
s >= a ||
(it = function (t) {
if (M.test(t)) return !0;
var e = S(t);
return e && e.fileName === n && s <= e.line && e.line <= a
? !0
: !1;
});
}
}
function O(t) {
(this._parent = t), (this._promisesCreated = 0);
var e = (this._length = 1 + (void 0 === t ? 0 : t._length));
st(this, O), e > 32 && this.uncycle();
}
var A,
D,
V,
I = e._getDomain,
L = e._async,
N = t("./errors").Warning,
H = t("./util"),
B = t("./es5"),
U = H.canAttachTrace,
M = /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,
q = /\((?:timers\.js):\d+:\d+\)/,
$ = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,
Q = null,
G = null,
z = !1,
X = !(
0 == H.env("BLUEBIRD_DEBUG") ||
(!H.env("BLUEBIRD_DEBUG") &&
"development" !== H.env("NODE_ENV"))
),
W = !(
0 == H.env("BLUEBIRD_WARNINGS") ||
(!X && !H.env("BLUEBIRD_WARNINGS"))
),
K = !(
0 == H.env("BLUEBIRD_LONG_STACK_TRACES") ||
(!X && !H.env("BLUEBIRD_LONG_STACK_TRACES"))
),
J =
0 != H.env("BLUEBIRD_W_FORGOTTEN_RETURN") &&
(W || !!H.env("BLUEBIRD_W_FORGOTTEN_RETURN"));
(e.prototype.suppressUnhandledRejections = function () {
var t = this._target();
t._bitField = (-1048577 & t._bitField) | 524288;
}),
(e.prototype._ensurePossibleRejectionHandled = function () {
if (0 === (524288 & this._bitField)) {
this._setRejectionIsUnhandled();
var t = this;
setTimeout(function () {
t._notifyUnhandledRejection();
}, 1);
}
}),
(e.prototype._notifyUnhandledRejectionIsHandled = function () {
F("rejectionHandled", A, void 0, this);
}),
(e.prototype._setReturnedNonUndefined = function () {
this._bitField = 268435456 | this._bitField;
}),
(e.prototype._returnedNonUndefined = function () {
return 0 !== (268435456 & this._bitField);
}),
(e.prototype._notifyUnhandledRejection = function () {
if (this._isRejectionUnhandled()) {
var t = this._settledValue();
this._setUnhandledRejectionIsNotified(),
F("unhandledRejection", D, t, this);
}
}),
(e.prototype._setUnhandledRejectionIsNotified = function () {
this._bitField = 262144 | this._bitField;
}),
(e.prototype._unsetUnhandledRejectionIsNotified = function () {
this._bitField = -262145 & this._bitField;
}),
(e.prototype._isUnhandledRejectionNotified = function () {
return (262144 & this._bitField) > 0;
}),
(e.prototype._setRejectionIsUnhandled = function () {
this._bitField = 1048576 | this._bitField;
}),
(e.prototype._unsetRejectionIsUnhandled = function () {
(this._bitField = -1048577 & this._bitField),
this._isUnhandledRejectionNotified() &&
(this._unsetUnhandledRejectionIsNotified(),
this._notifyUnhandledRejectionIsHandled());
}),
(e.prototype._isRejectionUnhandled = function () {
return (1048576 & this._bitField) > 0;
}),
(e.prototype._warn = function (t, e, n) {
return m(t, e, n || this);
}),
(e.onPossiblyUnhandledRejection = function (t) {
var e = I();
D =
"function" == typeof t
? null === e
? t
: H.domainBind(e, t)
: void 0;
}),
(e.onUnhandledRejectionHandled = function (t) {
var e = I();
A =
"function" == typeof t
? null === e
? t
: H.domainBind(e, t)
: void 0;
});
var Y = function () {};
(e.longStackTraces = function () {
if (L.haveItemsQueued() && !at.longStackTraces)
throw new Error(
"cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n"
);
if (!at.longStackTraces && P()) {
var t = e.prototype._captureStackTrace,
r = e.prototype._attachExtraTrace,
i = e.prototype._dereferenceTrace;
(at.longStackTraces = !0),
(Y = function () {
if (L.haveItemsQueued() && !at.longStackTraces)
throw new Error(
"cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n"
);
(e.prototype._captureStackTrace = t),
(e.prototype._attachExtraTrace = r),
(e.prototype._dereferenceTrace = i),
n.deactivateLongStackTraces(),
L.enableTrampoline(),
(at.longStackTraces = !1);
}),
(e.prototype._captureStackTrace = f),
(e.prototype._attachExtraTrace = _),
(e.prototype._dereferenceTrace = d),
n.activateLongStackTraces(),
L.disableTrampolineIfNecessary();
}
}),
(e.hasLongStackTraces = function () {
return at.longStackTraces && P();
});
var Z = (function () {
try {
if ("function" == typeof CustomEvent) {
var t = new CustomEvent("CustomEvent");
return (
H.global.dispatchEvent(t),
function (t, e) {
var n = { detail: e, cancelable: !0 };
B.defineProperty(n, "promise", { value: e.promise }),
B.defineProperty(n, "reason", { value: e.reason });
var r = new CustomEvent(t.toLowerCase(), n);
return !H.global.dispatchEvent(r);
}
);
}
if ("function" == typeof Event) {
var t = new Event("CustomEvent");
return (
H.global.dispatchEvent(t),
function (t, e) {
var n = new Event(t.toLowerCase(), { cancelable: !0 });
return (
(n.detail = e),
B.defineProperty(n, "promise", { value: e.promise }),
B.defineProperty(n, "reason", { value: e.reason }),
!H.global.dispatchEvent(n)
);
}
);
}
var t = document.createEvent("CustomEvent");
return (
t.initCustomEvent("testingtheevent", !1, !0, {}),
H.global.dispatchEvent(t),
function (t, e) {
var n = document.createEvent("CustomEvent");
return (
n.initCustomEvent(t.toLowerCase(), !1, !0, e),
!H.global.dispatchEvent(n)
);
}
);
} catch (e) {}
return function () {
return !1;
};
})(),
tt = (function () {
return H.isNode
? function () {
return process.emit.apply(process, arguments);
}
: H.global
? function (t) {
var e = "on" + t.toLowerCase(),
n = H.global[e];
return n
? (n.apply(H.global, [].slice.call(arguments, 1)), !0)
: !1;
}
: function () {
return !1;
};
})(),
et = {
promiseCreated: r,
promiseFulfilled: r,
promiseRejected: r,
promiseResolved: r,
promiseCancelled: r,
promiseChained(t, e, n) {
return { promise: e, child: n };
},
warning(t, e) {
return { warning: e };
},
unhandledRejection(t, e, n) {
return { reason: e, promise: n };
},
rejectionHandled: r
},
nt = function (t) {
var e = !1;
try {
e = tt.apply(null, arguments);
} catch (n) {
L.throwLater(n), (e = !0);
}
var r = !1;
try {
r = Z(t, et[t].apply(null, arguments));
} catch (n) {
L.throwLater(n), (r = !0);
}
return r || e;
};
(e.config = function (t) {
if (
((t = Object(t)),
"longStackTraces" in t &&
(t.longStackTraces
? e.longStackTraces()
: !t.longStackTraces && e.hasLongStackTraces() && Y()),
"warnings" in t)
) {
var n = t.warnings;
(at.warnings = !!n),
(J = at.warnings),
H.isObject(n) &&
"wForgottenReturn" in n &&
(J = !!n.wForgottenReturn);
}
if ("cancellation" in t && t.cancellation && !at.cancellation) {
if (L.haveItemsQueued())
throw new Error(
"cannot enable cancellation after promises are in use"
);
(e.prototype._clearCancellationData = l),
(e.prototype._propagateFrom = u),
(e.prototype._onCancel = a),
(e.prototype._setOnCancel = c),
(e.prototype._attachCancellationCallback = s),
(e.prototype._execute = o),
(rt = u),
(at.cancellation = !0);
}
return (
"monitoring" in t &&
(t.monitoring && !at.monitoring
? ((at.monitoring = !0), (e.prototype._fireEvent = nt))
: !t.monitoring &&
at.monitoring &&
((at.monitoring = !1), (e.prototype._fireEvent = i))),
e
);
}),
(e.prototype._fireEvent = i),
(e.prototype._execute = function (t, e, n) {
try {
t(e, n);
} catch (r) {
return r;
}
}),
(e.prototype._onCancel = function () {}),
(e.prototype._setOnCancel = function (t) {}),
(e.prototype._attachCancellationCallback = function (t) {}),
(e.prototype._captureStackTrace = function () {}),
(e.prototype._attachExtraTrace = function () {}),
(e.prototype._dereferenceTrace = function () {}),
(e.prototype._clearCancellationData = function () {}),
(e.prototype._propagateFrom = function (t, e) {});
var rt = p,
it = function () {
return !1;
},
ot = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;
H.inherits(O, Error),
(n.CapturedTrace = O),
(O.prototype.uncycle = function () {
var t = this._length;
if (!(2 > t)) {
for (var e = [], n = {}, r = 0, i = this; void 0 !== i; ++r)
e.push(i), (i = i._parent);
t = this._length = r;
for (var r = t - 1; r >= 0; --r) {
var o = e[r].stack;
void 0 === n[o] && (n[o] = r);
}
for (var r = 0; t > r; ++r) {
var s = e[r].stack,
a = n[s];
if (void 0 !== a && a !== r) {
a > 0 &&
((e[a - 1]._parent = void 0), (e[a - 1]._length = 1)),
(e[r]._parent = void 0),
(e[r]._length = 1);
var c = r > 0 ? e[r - 1] : this;
t - 1 > a
? ((c._parent = e[a + 1]),
c._parent.uncycle(),
(c._length = c._parent._length + 1))
: ((c._parent = void 0), (c._length = 1));
for (var l = c._length + 1, u = r - 2; u >= 0; --u)
(e[u]._length = l), l++;
return;
}
}
}
}),
(O.prototype.attachExtraTrace = function (t) {
if (!t.__stackCleaned__) {
this.uncycle();
for (
var e = E(t), n = e.message, r = [e.stack], i = this;
void 0 !== i;
)
r.push(C(i.stack.split("\n"))), (i = i._parent);
w(r),
b(r),
H.notEnumerableProp(t, "stack", g(n, r)),
H.notEnumerableProp(t, "__stackCleaned__", !0);
}
});
var st = (function () {
var t = /^\s*at\s*/,
e = function (t, e) {
return "string" == typeof t
? t
: void 0 !== e.name && void 0 !== e.message
? e.toString()
: T(e);
};
if (
"number" == typeof Error.stackTraceLimit &&
"function" == typeof Error.captureStackTrace
) {
(Error.stackTraceLimit += 6), (Q = t), (G = e);
var n = Error.captureStackTrace;
return (
(it = function (t) {
return M.test(t);
}),
function (t, e) {
(Error.stackTraceLimit += 6),
n(t, e),
(Error.stackTraceLimit -= 6);
}
);
}
var r = new Error();
if (
"string" == typeof r.stack &&
r.stack.split("\n")[0].indexOf("stackDetection@") >= 0
)
return (
(Q = /@/),
(G = e),
(z = !0),
function (t) {
t.stack = new Error().stack;
}
);
var i;
try {
throw new Error();
} catch (o) {
i = "stack" in o;
}
return "stack" in r ||
!i ||
"number" != typeof Error.stackTraceLimit
? ((G = function (t, e) {
return "string" == typeof t
? t
: ("object" != typeof e && "function" != typeof e) ||
void 0 === e.name ||
void 0 === e.message
? T(e)
: e.toString();
}),
null)
: ((Q = t),
(G = e),
function (t) {
Error.stackTraceLimit += 6;
try {
throw new Error();
} catch (e) {
t.stack = e.stack;
}
Error.stackTraceLimit -= 6;
});
})([]);
"undefined" != typeof console &&
"undefined" != typeof console.warn &&
((V = function (t) {
console.warn(t);
}),
H.isNode && process.stderr.isTTY
? (V = function (t, e) {
var n = e ? "[33m" : "[31m";
console.warn(n + t + "[0m\n");
})
: H.isNode ||
"string" != typeof new Error().stack ||
(V = function (t, e) {
console.warn(
"%c" + t,
e ? "color: darkorange" : "color: red"
);
}));
var at = {
warnings: W,
longStackTraces: !1,
cancellation: !1,
monitoring: !1
};
return (
K && e.longStackTraces(),
{
longStackTraces() {
return at.longStackTraces;
},
warnings() {
return at.warnings;
},
cancellation() {
return at.cancellation;
},
monitoring() {
return at.monitoring;
},
propagateFromFunction() {
return rt;
},
boundValueFunction() {
return h;
},
checkForgottenReturns: v,
setBounds: R,
warn: m,
deprecated: y,
CapturedTrace: O,
fireDomEvent: Z,
fireGlobalEvent: tt
}
);
};
},
{ "./errors": 12, "./es5": 13, "./util": 36 }
],
10: [
function (t, e, n) {
"use strict";
e.exports = function (t) {
function e() {
return this.value;
}
function n() {
throw this.reason;
}
(t.prototype["return"] = t.prototype.thenReturn =
function (n) {
return (
n instanceof t && n.suppressUnhandledRejections(),
this._then(e, void 0, void 0, { value: n }, void 0)
);