Skip to content

Instantly share code, notes, and snippets.

@ZenithRogue
Created March 8, 2019 03:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZenithRogue/4f01b16acc10997650d2d943717aaaca to your computer and use it in GitHub Desktop.
Save ZenithRogue/4f01b16acc10997650d2d943717aaaca to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
! function(e) {
function t(t) {
for (var o, a, r = t[0], s = t[1], l = t[2], c = 0, g = []; c < r.length; c++) a = r[c], n[a] && g.push(n[a][0]), n[a] = 0;
for (o in s) Object.prototype.hasOwnProperty.call(s, o) && (e[o] = s[o]);
for (u && u(t); g.length;) g.shift()();
return i.push.apply(i, l || []), A()
}
function A() {
for (var e, t = 0; t < i.length; t++) {
for (var A = i[t], o = !0, r = 1; r < A.length; r++) {
var s = A[r];
0 !== n[s] && (o = !1)
}
o && (i.splice(t--, 1), e = a(a.s = A[0]))
}
return e
}
var o = {},
n = {
0: 0
},
i = [];
function a(t) {
if (o[t]) return o[t].exports;
var A = o[t] = {
i: t,
l: !1,
exports: {}
};
return e[t].call(A.exports, A, A.exports, a), A.l = !0, A.exports
}
a.e = function(e) {
var t = [],
A = n[e];
if (0 !== A)
if (A) t.push(A[2]);
else {
var o = new Promise(function(t, o) {
A = n[e] = [t, o]
});
t.push(A[2] = o);
var i, r = document.createElement("script");
r.charset = "utf-8", r.timeout = 120, a.nc && r.setAttribute("nonce", a.nc), r.src = function(e) {
return a.p + "chunks/" + ({
3: "es-steps"
}[e] || e) + ".js"
}(e), i = function(t) {
r.onerror = r.onload = null, clearTimeout(s);
var A = n[e];
if (0 !== A) {
if (A) {
var o = t && ("load" === t.type ? "missing" : t.type),
i = t && t.target && t.target.src,
a = new Error("Loading chunk " + e + " failed.\n(" + o + ": " + i + ")");
a.type = o, a.request = i, A[1](a)
}
n[e] = void 0
}
};
var s = setTimeout(function() {
i({
type: "timeout",
target: r
})
}, 12e4);
r.onerror = r.onload = i, document.head.appendChild(r)
}
return Promise.all(t)
}, a.m = e, a.c = o, a.d = function(e, t, A) {
a.o(e, t) || Object.defineProperty(e, t, {
enumerable: !0,
get: A
})
}, a.r = function(e) {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
value: "Module"
}), Object.defineProperty(e, "__esModule", {
value: !0
})
}, a.t = function(e, t) {
if (1 & t && (e = a(e)), 8 & t) return e;
if (4 & t && "object" == typeof e && e && e.__esModule) return e;
var A = Object.create(null);
if (a.r(A), Object.defineProperty(A, "default", {
enumerable: !0,
value: e
}), 2 & t && "string" != typeof e)
for (var o in e) a.d(A, o, function(t) {
return e[t]
}.bind(null, o));
return A
}, a.n = function(e) {
var t = e && e.__esModule ? function() {
return e.default
} : function() {
return e
};
return a.d(t, "a", t), t
}, a.o = function(e, t) {
return Object.prototype.hasOwnProperty.call(e, t)
}, a.p = "", a.oe = function(e) {
throw console.error(e), e
};
var r = window.webpackJsonpGUI = window.webpackJsonpGUI || [],
s = r.push.bind(r);
r.push = t, r = r.slice();
for (var l = 0; l < r.length; l++) t(r[l]);
var u = s;
A()
}([function(e, t, A) {
e.exports = A(828)()
}, function(e, t, A) {
"use strict";
e.exports = A(783)
}, function(e, t, A) {
"use strict";
A.d(t, "c", function() {
return B
}), A.d(t, "f", function() {
return H
}), A.d(t, "e", function() {
return te
}), A.d(t, "d", function() {
return Ae
}), A.d(t, "b", function() {
return pe
}), A.d(t, "a", function() {
return Se
});
var o = A(490),
n = A.n(o),
i = A(148),
a = A.n(i),
r = A(176),
s = A.n(r),
l = A(0),
u = A.n(l),
c = A(1),
g = A.n(c),
d = A(109),
h = A.n(d),
m = A(177),
p = A.n(m),
E = {
locale: "en",
pluralRuleFunction: function(e, t) {
var A = String(e).split("."),
o = !A[1],
n = Number(A[0]) == e,
i = n && A[0].slice(-1),
a = n && A[0].slice(-2);
return t ? 1 == i && 11 != a ? "one" : 2 == i && 12 != a ? "two" : 3 == i && 13 != a ? "few" : "other" : 1 == e && o ? "one" : "other"
},
fields: {
year: {
displayName: "year",
relative: {
0: "this year",
1: "next year",
"-1": "last year"
},
relativeTime: {
future: {
one: "in {0} year",
other: "in {0} years"
},
past: {
one: "{0} year ago",
other: "{0} years ago"
}
}
},
month: {
displayName: "month",
relative: {
0: "this month",
1: "next month",
"-1": "last month"
},
relativeTime: {
future: {
one: "in {0} month",
other: "in {0} months"
},
past: {
one: "{0} month ago",
other: "{0} months ago"
}
}
},
day: {
displayName: "day",
relative: {
0: "today",
1: "tomorrow",
"-1": "yesterday"
},
relativeTime: {
future: {
one: "in {0} day",
other: "in {0} days"
},
past: {
one: "{0} day ago",
other: "{0} days ago"
}
}
},
hour: {
displayName: "hour",
relative: {
0: "this hour"
},
relativeTime: {
future: {
one: "in {0} hour",
other: "in {0} hours"
},
past: {
one: "{0} hour ago",
other: "{0} hours ago"
}
}
},
minute: {
displayName: "minute",
relative: {
0: "this minute"
},
relativeTime: {
future: {
one: "in {0} minute",
other: "in {0} minutes"
},
past: {
one: "{0} minute ago",
other: "{0} minutes ago"
}
}
},
second: {
displayName: "second",
relative: {
0: "now"
},
relativeTime: {
future: {
one: "in {0} second",
other: "in {0} seconds"
},
past: {
one: "{0} second ago",
other: "{0} seconds ago"
}
}
}
}
};
function B() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
(Array.isArray(e) ? e : [e]).forEach(function(e) {
e && e.locale && (a.a.__addLocaleData(e), s.a.__addLocaleData(e))
})
}
function f(e) {
var t = e && e.toLowerCase();
return !(!a.a.__localeData__[t] || !s.a.__localeData__[t])
}
var C = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
},
w = function(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
},
I = function() {
function e(e, t) {
for (var A = 0; A < t.length; A++) {
var o = t[A];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o)
}
}
return function(t, A, o) {
return A && e(t.prototype, A), o && e(t, o), t
}
}(),
y = function(e, t, A) {
return t in e ? Object.defineProperty(e, t, {
value: A,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = A, e
},
b = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var A = arguments[t];
for (var o in A) Object.prototype.hasOwnProperty.call(A, o) && (e[o] = A[o])
}
return e
},
M = function(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)
},
T = function(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
},
S = function(e) {
if (Array.isArray(e)) {
for (var t = 0, A = Array(e.length); t < e.length; t++) A[t] = e[t];
return A
}
return Array.from(e)
},
Q = u.a.bool,
D = u.a.number,
k = u.a.string,
N = u.a.func,
v = u.a.object,
O = u.a.oneOf,
R = u.a.shape,
F = u.a.any,
Y = u.a.oneOfType,
U = O(["best fit", "lookup"]),
L = O(["narrow", "short", "long"]),
G = O(["numeric", "2-digit"]),
x = N.isRequired,
_ = {
locale: k,
formats: v,
messages: v,
textComponent: F,
defaultLocale: k,
defaultFormats: v
},
P = {
formatDate: x,
formatTime: x,
formatRelative: x,
formatNumber: x,
formatPlural: x,
formatMessage: x,
formatHTMLMessage: x
},
H = R(b({}, _, P, {
formatters: v,
now: x
})),
j = (k.isRequired, Y([k, v]), {
localeMatcher: U,
formatMatcher: O(["basic", "best fit"]),
timeZone: k,
hour12: Q,
weekday: L,
era: L,
year: G,
month: O(["numeric", "2-digit", "narrow", "short", "long"]),
day: G,
hour: G,
minute: G,
second: G,
timeZoneName: O(["short", "long"])
}),
z = {
localeMatcher: U,
style: O(["decimal", "currency", "percent"]),
currency: k,
currencyDisplay: O(["symbol", "code", "name"]),
useGrouping: Q,
minimumIntegerDigits: D,
minimumFractionDigits: D,
maximumFractionDigits: D,
minimumSignificantDigits: D,
maximumSignificantDigits: D
},
K = {
style: O(["best fit", "numeric"]),
units: O(["second", "minute", "hour", "day", "month", "year"])
},
J = {
style: O(["cardinal", "ordinal"])
},
V = Object.keys(_),
W = {
"&": "&amp;",
">": "&gt;",
"<": "&lt;",
'"': "&quot;",
"'": "&#x27;"
},
q = /[&><"']/g;
function X(e, t) {
var A = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
return t.reduce(function(t, o) {
return e.hasOwnProperty(o) ? t[o] = e[o] : A.hasOwnProperty(o) && (t[o] = A[o]), t
}, {})
}
function Z() {
var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).intl;
h()(e, "[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")
}
function $(e, t) {
if (e === t) return !0;
if ("object" !== (void 0 === e ? "undefined" : C(e)) || null === e || "object" !== (void 0 === t ? "undefined" : C(t)) || null === t) return !1;
var A = Object.keys(e),
o = Object.keys(t);
if (A.length !== o.length) return !1;
for (var n = Object.prototype.hasOwnProperty.bind(t), i = 0; i < A.length; i++)
if (!n(A[i]) || e[A[i]] !== t[A[i]]) return !1;
return !0
}
function ee(e, t, A) {
var o = e.props,
n = e.state,
i = e.context,
a = void 0 === i ? {} : i,
r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {},
s = a.intl,
l = void 0 === s ? {} : s,
u = r.intl,
c = void 0 === u ? {} : u;
return !$(t, o) || !$(A, n) || !(c === l || $(X(c, V), X(l, V)))
}
function te(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
A = t.intlPropName,
o = void 0 === A ? "intl" : A,
n = t.withRef,
i = void 0 !== n && n,
a = function(t) {
function A(e, t) {
w(this, A);
var o = T(this, (A.__proto__ || Object.getPrototypeOf(A)).call(this, e, t));
return Z(t), o
}
return M(A, t), I(A, [{
key: "getWrappedInstance",
value: function() {
return h()(i, "[React Intl] To access the wrapped instance, the `{withRef: true}` option must be set when calling: `injectIntl()`"), this.refs.wrappedInstance
}
}, {
key: "render",
value: function() {
return g.a.createElement(e, b({}, this.props, y({}, o, this.context.intl), {
ref: i ? "wrappedInstance" : null
}))
}
}]), A
}(c.Component);
return a.displayName = "InjectIntl(" + function(e) {
return e.displayName || e.name || "Component"
}(e) + ")", a.contextTypes = {
intl: H
}, a.WrappedComponent = e, a
}
function Ae(e) {
return e
}
var oe = function e(t) {
var A = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
w(this, e);
var o = "ordinal" === A.style,
n = function(e) {
return a.a.prototype._findPluralRuleFunction(e)
}(function(e) {
return a.a.prototype._resolveLocale(e)
}(t));
this.format = function(e) {
return n(e, o)
}
},
ne = Object.keys(j),
ie = Object.keys(z),
ae = Object.keys(K),
re = Object.keys(J),
se = {
second: 60,
minute: 60,
hour: 24,
day: 30,
month: 12
};
function le(e) {
var t = s.a.thresholds;
t.second = e.second, t.minute = e.minute, t.hour = e.hour, t.day = e.day, t.month = e.month
}
function ue(e, t, A) {
var o = e && e[t] && e[t][A];
if (o) return o
}
function ce(e, t) {
var A = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {},
o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {},
n = e.locale,
i = e.formats,
a = e.messages,
r = e.defaultLocale,
s = e.defaultFormats,
l = A.id,
u = A.defaultMessage;
h()(l, "[React Intl] An `id` must be provided to format a message.");
var c = a && a[l];
if (!(Object.keys(o).length > 0)) return c || u || l;
var g = void 0;
if (c) try {
g = t.getMessageFormat(c, n, i).format(o)
} catch (e) {
0
} else 0;
if (!g && u) try {
g = t.getMessageFormat(u, r, s).format(o)
} catch (e) {
0
}
return g || c || u || l
}
var ge = Object.freeze({
formatDate: function(e, t, A) {
var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {},
n = e.locale,
i = e.formats,
a = o.format,
r = new Date(A),
s = a && ue(i, "date", a),
l = X(o, ne, s);
try {
return t.getDateTimeFormat(n, l).format(r)
} catch (e) {}
return String(r)
},
formatTime: function(e, t, A) {
var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {},
n = e.locale,
i = e.formats,
a = o.format,
r = new Date(A),
s = a && ue(i, "time", a),
l = X(o, ne, s);
l.hour || l.minute || l.second || (l = b({}, l, {
hour: "numeric",
minute: "numeric"
}));
try {
return t.getDateTimeFormat(n, l).format(r)
} catch (e) {}
return String(r)
},
formatRelative: function(e, t, A) {
var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {},
n = e.locale,
i = e.formats,
a = o.format,
r = new Date(A),
l = new Date(o.now),
u = a && ue(i, "relative", a),
c = X(o, ae, u),
g = b({}, s.a.thresholds);
le(se);
try {
return t.getRelativeFormat(n, c).format(r, {
now: isFinite(l) ? l : t.now()
})
} catch (e) {} finally {
le(g)
}
return String(r)
},
formatNumber: function(e, t, A) {
var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {},
n = e.locale,
i = e.formats,
a = o.format,
r = a && ue(i, "number", a),
s = X(o, ie, r);
try {
return t.getNumberFormat(n, s).format(A)
} catch (e) {}
return String(A)
},
formatPlural: function(e, t, A) {
var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {},
n = e.locale,
i = X(o, re);
try {
return t.getPluralFormat(n, i).format(A)
} catch (e) {}
return "other"
},
formatMessage: ce,
formatHTMLMessage: function(e, t, A) {
var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
return ce(e, t, A, Object.keys(o).reduce(function(e, t) {
var A = o[t];
return e[t] = "string" == typeof A ? function(e) {
return ("" + e).replace(q, function(e) {
return W[e]
})
}(A) : A, e
}, {}))
}
}),
de = Object.keys(_),
he = Object.keys(P),
me = {
formats: {},
messages: {},
textComponent: "span",
defaultLocale: "en",
defaultFormats: {}
},
pe = function(e) {
function t(e) {
var A = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
w(this, t);
var o = T(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, A));
h()("undefined" != typeof Intl, "[React Intl] The `Intl` APIs must be available in the runtime, and do not appear to be built-in. An `Intl` polyfill should be loaded.\nSee: http://formatjs.io/guides/runtime-environments/");
var n = A.intl,
i = void 0;
i = isFinite(e.initialNow) ? Number(e.initialNow) : n ? n.now() : Date.now();
var r = (n || {}).formatters,
l = void 0 === r ? {
getDateTimeFormat: p()(Intl.DateTimeFormat),
getNumberFormat: p()(Intl.NumberFormat),
getMessageFormat: p()(a.a),
getRelativeFormat: p()(s.a),
getPluralFormat: p()(oe)
} : r;
return o.state = b({}, l, {
now: function() {
return o._didDisplay ? Date.now() : i
}
}), o
}
return M(t, e), I(t, [{
key: "getConfig",
value: function() {
var e = this.context.intl,
t = X(this.props, de, e);
for (var A in me) void 0 === t[A] && (t[A] = me[A]);
if (! function(e) {
for (var t = (e || "").split("-"); t.length > 0;) {
if (f(t.join("-"))) return !0;
t.pop()
}
return !1
}(t.locale)) {
var o = t,
n = (o.locale, o.defaultLocale),
i = o.defaultFormats;
0, t = b({}, t, {
locale: n,
formats: i,
messages: me.messages
})
}
return t
}
}, {
key: "getBoundFormatFns",
value: function(e, t) {
return he.reduce(function(A, o) {
return A[o] = ge[o].bind(null, e, t), A
}, {})
}
}, {
key: "getChildContext",
value: function() {
var e = this.getConfig(),
t = this.getBoundFormatFns(e, this.state),
A = this.state,
o = A.now,
n = function(e, t) {
var A = {};
for (var o in e) t.indexOf(o) >= 0 || Object.prototype.hasOwnProperty.call(e, o) && (A[o] = e[o]);
return A
}(A, ["now"]);
return {
intl: b({}, e, t, {
formatters: n,
now: o
})
}
}
}, {
key: "shouldComponentUpdate",
value: function() {
for (var e = arguments.length, t = Array(e), A = 0; A < e; A++) t[A] = arguments[A];
return ee.apply(void 0, [this].concat(t))
}
}, {
key: "componentDidMount",
value: function() {
this._didDisplay = !0
}
}, {
key: "render",
value: function() {
return c.Children.only(this.props.children)
}
}]), t
}(c.Component);
pe.displayName = "IntlProvider", pe.contextTypes = {
intl: H
}, pe.childContextTypes = {
intl: H.isRequired
};
var Ee = function(e) {
function t(e, A) {
w(this, t);
var o = T(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, A));
return Z(A), o
}
return M(t, e), I(t, [{
key: "shouldComponentUpdate",
value: function() {
for (var e = arguments.length, t = Array(e), A = 0; A < e; A++) t[A] = arguments[A];
return ee.apply(void 0, [this].concat(t))
}
}, {
key: "render",
value: function() {
var e = this.context.intl,
t = e.formatDate,
A = e.textComponent,
o = this.props,
n = o.value,
i = o.children,
a = t(n, this.props);
return "function" == typeof i ? i(a) : g.a.createElement(A, null, a)
}
}]), t
}(c.Component);
Ee.displayName = "FormattedDate", Ee.contextTypes = {
intl: H
};
var Be = function(e) {
function t(e, A) {
w(this, t);
var o = T(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, A));
return Z(A), o
}
return M(t, e), I(t, [{
key: "shouldComponentUpdate",
value: function() {
for (var e = arguments.length, t = Array(e), A = 0; A < e; A++) t[A] = arguments[A];
return ee.apply(void 0, [this].concat(t))
}
}, {
key: "render",
value: function() {
var e = this.context.intl,
t = e.formatTime,
A = e.textComponent,
o = this.props,
n = o.value,
i = o.children,
a = t(n, this.props);
return "function" == typeof i ? i(a) : g.a.createElement(A, null, a)
}
}]), t
}(c.Component);
Be.displayName = "FormattedTime", Be.contextTypes = {
intl: H
};
var fe = 1e3,
Ce = 6e4,
we = 36e5,
Ie = 864e5,
ye = 2147483647;
var be = function(e) {
function t(e, A) {
w(this, t);
var o = T(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, A));
Z(A);
var n = isFinite(e.initialNow) ? Number(e.initialNow) : A.intl.now();
return o.state = {
now: n
}, o
}
return M(t, e), I(t, [{
key: "scheduleNextUpdate",
value: function(e, t) {
var A = this;
clearTimeout(this._timer);
var o = e.value,
n = e.units,
i = e.updateInterval,
a = new Date(o).getTime();
if (i && isFinite(a)) {
var r = a - t.now,
s = function(e) {
switch (e) {
case "second":
return fe;
case "minute":
return Ce;
case "hour":
return we;
case "day":
return Ie;
default:
return ye
}
}(n || function(e) {
var t = Math.abs(e);
return t < Ce ? "second" : t < we ? "minute" : t < Ie ? "hour" : "day"
}(r)),
l = Math.abs(r % s),
u = r < 0 ? Math.max(i, s - l) : Math.max(i, l);
this._timer = setTimeout(function() {
A.setState({
now: A.context.intl.now()
})
}, u)
}
}
}, {
key: "componentDidMount",
value: function() {
this.scheduleNextUpdate(this.props, this.state)
}
}, {
key: "componentWillReceiveProps",
value: function(e) {
(function(e, t) {
if (e === t) return !0;
var A = new Date(e).getTime(),
o = new Date(t).getTime();
return isFinite(A) && isFinite(o) && A === o
})(e.value, this.props.value) || this.setState({
now: this.context.intl.now()
})
}
}, {
key: "shouldComponentUpdate",
value: function() {
for (var e = arguments.length, t = Array(e), A = 0; A < e; A++) t[A] = arguments[A];
return ee.apply(void 0, [this].concat(t))
}
}, {
key: "componentWillUpdate",
value: function(e, t) {
this.scheduleNextUpdate(e, t)
}
}, {
key: "componentWillUnmount",
value: function() {
clearTimeout(this._timer)
}
}, {
key: "render",
value: function() {
var e = this.context.intl,
t = e.formatRelative,
A = e.textComponent,
o = this.props,
n = o.value,
i = o.children,
a = t(n, b({}, this.props, this.state));
return "function" == typeof i ? i(a) : g.a.createElement(A, null, a)
}
}]), t
}(c.Component);
be.displayName = "FormattedRelative", be.contextTypes = {
intl: H
}, be.defaultProps = {
updateInterval: 1e4
};
var Me = function(e) {
function t(e, A) {
w(this, t);
var o = T(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, A));
return Z(A), o
}
return M(t, e), I(t, [{
key: "shouldComponentUpdate",
value: function() {
for (var e = arguments.length, t = Array(e), A = 0; A < e; A++) t[A] = arguments[A];
return ee.apply(void 0, [this].concat(t))
}
}, {
key: "render",
value: function() {
var e = this.context.intl,
t = e.formatNumber,
A = e.textComponent,
o = this.props,
n = o.value,
i = o.children,
a = t(n, this.props);
return "function" == typeof i ? i(a) : g.a.createElement(A, null, a)
}
}]), t
}(c.Component);
Me.displayName = "FormattedNumber", Me.contextTypes = {
intl: H
};
var Te = function(e) {
function t(e, A) {
w(this, t);
var o = T(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, A));
return Z(A), o
}
return M(t, e), I(t, [{
key: "shouldComponentUpdate",
value: function() {
for (var e = arguments.length, t = Array(e), A = 0; A < e; A++) t[A] = arguments[A];
return ee.apply(void 0, [this].concat(t))
}
}, {
key: "render",
value: function() {
var e = this.context.intl,
t = e.formatPlural,
A = e.textComponent,
o = this.props,
n = o.value,
i = o.other,
a = o.children,
r = t(n, this.props),
s = this.props[r] || i;
return "function" == typeof a ? a(s) : g.a.createElement(A, null, s)
}
}]), t
}(c.Component);
Te.displayName = "FormattedPlural", Te.contextTypes = {
intl: H
}, Te.defaultProps = {
style: "cardinal"
};
var Se = function(e) {
function t(e, A) {
w(this, t);
var o = T(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, A));
return Z(A), o
}
return M(t, e), I(t, [{
key: "shouldComponentUpdate",
value: function(e) {
var t = this.props.values;
if (!$(e.values, t)) return !0;
for (var A = b({}, e, {
values: t
}), o = arguments.length, n = Array(o > 1 ? o - 1 : 0), i = 1; i < o; i++) n[i - 1] = arguments[i];
return ee.apply(void 0, [this, A].concat(n))
}
}, {
key: "render",
value: function() {
var e = this.context.intl,
t = e.formatMessage,
A = e.textComponent,
o = this.props,
n = o.id,
i = o.description,
a = o.defaultMessage,
r = o.values,
s = o.tagName,
l = void 0 === s ? A : s,
u = o.children,
g = void 0,
d = void 0,
h = void 0;
if (r && Object.keys(r).length > 0) {
var m = Math.floor(1099511627776 * Math.random()).toString(16),
p = function() {
var e = 0;
return function() {
return "ELEMENT-" + m + "-" + (e += 1)
}
}();
g = "@__" + m + "__@", d = {}, h = {}, Object.keys(r).forEach(function(e) {
var t = r[e];
if (Object(c.isValidElement)(t)) {
var A = p();
d[e] = g + A + g, h[A] = t
} else d[e] = t
})
}
var E = t({
id: n,
description: i,
defaultMessage: a
}, d || r),
B = void 0;
return B = h && Object.keys(h).length > 0 ? E.split(g).filter(function(e) {
return !!e
}).map(function(e) {
return h[e] || e
}) : [E], "function" == typeof u ? u.apply(void 0, S(B)) : c.createElement.apply(void 0, [l, null].concat(S(B)))
}
}]), t
}(c.Component);
Se.displayName = "FormattedMessage", Se.contextTypes = {
intl: H
}, Se.defaultProps = {
values: {}
};
var Qe = function(e) {
function t(e, A) {
w(this, t);
var o = T(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, A));
return Z(A), o
}
return M(t, e), I(t, [{
key: "shouldComponentUpdate",
value: function(e) {
var t = this.props.values;
if (!$(e.values, t)) return !0;
for (var A = b({}, e, {
values: t
}), o = arguments.length, n = Array(o > 1 ? o - 1 : 0), i = 1; i < o; i++) n[i - 1] = arguments[i];
return ee.apply(void 0, [this, A].concat(n))
}
}, {
key: "render",
value: function() {
var e = this.context.intl,
t = e.formatHTMLMessage,
A = e.textComponent,
o = this.props,
n = o.id,
i = o.description,
a = o.defaultMessage,
r = o.values,
s = o.tagName,
l = void 0 === s ? A : s,
u = o.children,
c = t({
id: n,
description: i,
defaultMessage: a
}, r);
if ("function" == typeof u) return u(c);
var d = {
__html: c
};
return g.a.createElement(l, {
dangerouslySetInnerHTML: d
})
}
}]), t
}(c.Component);
Qe.displayName = "FormattedHTMLMessage", Qe.contextTypes = {
intl: H
}, Qe.defaultProps = {
values: {}
}, B(E), B(n.a)
}, function(e, t, A) {
var o, n, i;
(function(a, r) {
var s = (a = a || A(1129)).window ? a.window : a,
l = a.document,
u = new function() {
var e = /^(statics|enumerable|beans|preserve)$/,
t = [],
A = t.slice,
o = Object.create,
n = Object.getOwnPropertyDescriptor,
i = Object.defineProperty,
a = t.forEach || function(e, t) {
for (var A = 0, o = this.length; A < o; A++) e.call(t, this[A], A, this)
},
s = Object.assign || function(e) {
for (var t = 1, A = arguments.length; t < A; t++) {
var o = arguments[t];
for (var n in o) o.hasOwnProperty(n) && (e[n] = o[n])
}
return e
},
l = function(e, t, A) {
if (e) {
var o = n(e, "length");
(o && "number" == typeof o.value ? a : function(e, t) {
for (var A in this) this.hasOwnProperty(A) && e.call(t, this[A], A, this)
}).call(e, t, A = A || e)
}
return A
};
function u(t, A, o, a, r) {
var s = {};
function l(e, l) {
"string" == typeof(l = l || (l = n(A, e)) && (l.get ? l : l.value)) && "#" === l[0] && (l = t[l.substring(1)] || l);
var u, g = "function" == typeof l,
d = l,
h = r || g && !l.base ? l && l.get ? e in t : t[e] : null;
r && h || (g && h && (l.base = h), g && !1 !== a && (u = e.match(/^([gs]et|is)(([A-Z])(.*))$/)) && (s[u[3].toLowerCase() + u[4]] = u[2]), d && !g && d.get && "function" == typeof d.get && c.isPlainObject(d) || (d = {
value: d,
writable: !0
}), (n(t, e) || {
configurable: !0
}).configurable && (d.configurable = !0, d.enumerable = null != o ? o : !u), i(t, e, d))
}
if (A) {
for (var u in A) A.hasOwnProperty(u) && !e.test(u) && l(u);
for (var u in s) {
var g = s[u],
d = t["set" + g],
h = t["get" + g] || d && t["is" + g];
!h || !0 !== a && 0 !== h.length || l(u, {
get: h,
set: d
})
}
}
return t
}
function c() {
for (var e = 0, t = arguments.length; e < t; e++) {
var A = arguments[e];
A && s(this, A)
}
return this
}
return u(c, {
inject: function(e) {
if (e) {
var t = !0 === e.statics ? e : e.statics,
A = e.beans,
o = e.preserve;
t !== e && u(this.prototype, e, e.enumerable, A, o), u(this, t, null, A, o)
}
for (var n = 1, i = arguments.length; n < i; n++) this.inject(arguments[n]);
return this
},
extend: function() {
for (var e, t, A, n = this, a = 0, r = arguments.length; a < r && (!e || !t); a++) A = arguments[a], e = e || A.initialize, t = t || A.prototype;
return t = (e = e || function() {
n.apply(this, arguments)
}).prototype = t || o(this.prototype), i(t, "constructor", {
value: e,
writable: !0,
configurable: !0
}), u(e, this), arguments.length && this.inject.apply(e, arguments), e.base = n, e
}
}).inject({
enumerable: !1,
initialize: c,
set: c,
inject: function() {
for (var e = 0, t = arguments.length; e < t; e++) {
var A = arguments[e];
A && u(this, A, A.enumerable, A.beans, A.preserve)
}
return this
},
extend: function() {
var e = o(this);
return e.inject.apply(e, arguments)
},
each: function(e, t) {
return l(this, e, t)
},
clone: function() {
return new this.constructor(this)
},
statics: {
set: s,
each: l,
create: o,
define: i,
describe: n,
clone: function(e) {
return s(new e.constructor, e)
},
isPlainObject: function(e) {
var t = null != e && e.constructor;
return t && (t === Object || t === c || "Object" === t.name)
},
pick: function(e, t) {
return e !== r ? e : t
},
slice: function(e, t, o) {
return A.call(e, t, o)
}
}
})
};
e.exports = u, u.inject({
enumerable: !1,
toString: function() {
return null != this._id ? (this._class || "Object") + (this._name ? " '" + this._name + "'" : " @" + this._id) : "{ " + u.each(this, function(e, t) {
if (!/^_/.test(t)) {
var A = typeof e;
this.push(t + ": " + ("number" === A ? h.instance.number(e) : "string" === A ? "'" + e + "'" : e))
}
}, []).join(", ") + " }"
},
getClassName: function() {
return this._class || ""
},
importJSON: function(e) {
return u.importJSON(e, this)
},
exportJSON: function(e) {
return u.exportJSON(this, e)
},
toJSON: function() {
return u.serialize(this)
},
set: function(e, t) {
return e && u.filter(this, e, t, this._prioritize), this
}
}, {
beans: !1,
statics: {
exports: {},
extend: function e() {
var t = e.base.apply(this, arguments),
A = t.prototype._class;
return A && !u.exports[A] && (u.exports[A] = t), t
},
equals: function(e, t) {
if (e === t) return !0;
if (e && e.equals) return e.equals(t);
if (t && t.equals) return t.equals(e);
if (e && t && "object" == typeof e && "object" == typeof t) {
if (Array.isArray(e) && Array.isArray(t)) {
if ((A = e.length) !== t.length) return !1;
for (; A--;)
if (!u.equals(e[A], t[A])) return !1
} else {
var A, o = Object.keys(e);
if ((A = o.length) !== Object.keys(t).length) return !1;
for (; A--;) {
var n = o[A];
if (!t.hasOwnProperty(n) || !u.equals(e[n], t[n])) return !1
}
}
return !0
}
return !1
},
read: function(e, t, A, o) {
if (this === u) {
var n = this.peek(e, t);
return e.__index++, n
}
var i = this.prototype,
a = i._readIndex,
s = t || a && e.__index || 0,
l = e.length,
c = e[s];
if (o = o || l - s, c instanceof this || A && A.readNull && null == c && o <= 1) return a && (e.__index = s + 1), c && A && A.clone ? c.clone() : c;
if (c = u.create(i), a && (c.__read = !0), c = c.initialize.apply(c, s > 0 || s + o < l ? u.slice(e, s, s + o) : e) || c, a) {
e.__index = s + c.__read;
var g = c.__filtered;
g && (e.__filtered = g, c.__filtered = r), c.__read = r
}
return c
},
peek: function(e, t) {
return e[e.__index = t || e.__index || 0]
},
remain: function(e) {
return e.length - (e.__index || 0)
},
readList: function(e, t, A, o) {
for (var n, i = [], a = t || 0, r = o ? a + o : e.length, s = a; s < r; s++) i.push(Array.isArray(n = e[s]) ? this.read(n, 0, A) : this.read(e, s, A, 1));
return i
},
readNamed: function(e, t, A, o, n) {
var i = this.getNamed(e, t),
a = i !== r;
if (a) {
var s = e.__filtered;
s || ((s = e.__filtered = u.create(e[0])).__unfiltered = e[0]), s[t] = r
}
var l = a ? [i] : e;
return this.read(l, A, o, n)
},
getNamed: function(e, t) {
var A = e[0];
if (e._hasObject === r && (e._hasObject = 1 === e.length && u.isPlainObject(A)), e._hasObject) return t ? A[t] : e.__filtered || A
},
hasNamed: function(e, t) {
return !!this.getNamed(e, t)
},
filter: function(e, t, A, o) {
var n;
function i(o) {
if (!(A && o in A || n && o in n)) {
var i = t[o];
i !== r && (e[o] = i)
}
}
if (o) {
for (var a, s = {}, l = 0, u = o.length; l < u; l++)(a = o[l]) in t && (i(a), s[a] = !0);
n = s
}
return Object.keys(t.__unfiltered || t).forEach(i), e
},
isPlainValue: function(e, t) {
return u.isPlainObject(e) || Array.isArray(e) || t && "string" == typeof e
},
serialize: function(e, t, A, o) {
t = t || {};
var n, i = !o;
if (i && (t.formatter = new h(t.precision), o = {
length: 0,
definitions: {},
references: {},
add: function(e, t) {
var A = "#" + e._id,
o = this.references[A];
if (!o) {
this.length++;
var n = t.call(e),
i = e._class;
i && n[0] !== i && n.unshift(i), this.definitions[A] = n, o = this.references[A] = [A]
}
return o
}
}), e && e._serialize) {
n = e._serialize(t, o);
var a = e._class;
!a || e._compactSerialize || !i && A || n[0] === a || n.unshift(a)
} else if (Array.isArray(e)) {
n = [];
for (var r = 0, s = e.length; r < s; r++) n[r] = u.serialize(e[r], t, A, o)
} else if (u.isPlainObject(e)) {
n = {};
var l = Object.keys(e);
for (r = 0, s = l.length; r < s; r++) {
var c = l[r];
n[c] = u.serialize(e[c], t, A, o)
}
} else n = "number" == typeof e ? t.formatter.number(e, t.precision) : e;
return i && o.length > 0 ? [
["dictionary", o.definitions], n
] : n
},
deserialize: function(e, t, A, o, n) {
var i = e,
a = !A,
r = a && e && e.length && "dictionary" === e[0][0];
if (A = A || {}, Array.isArray(e)) {
var s = e[0],
l = "dictionary" === s;
if (1 == e.length && /^#/.test(s)) return A.dictionary[s];
i = [];
for (var c = (s = u.exports[s]) ? 1 : 0, g = e.length; c < g; c++) i.push(u.deserialize(e[c], t, A, l, r));
if (s) {
var d = i;
i = t ? t(s, d, a || n) : new s(d)
}
} else if (u.isPlainObject(e))
for (var h in i = {}, o && (A.dictionary = i), e) i[h] = u.deserialize(e[h], t, A);
return r ? i[1] : i
},
exportJSON: function(e, t) {
var A = u.serialize(e, t);
return t && 0 == t.asString ? A : JSON.stringify(A)
},
importJSON: function(e, t) {
return u.deserialize("string" == typeof e ? JSON.parse(e) : e, function(e, A, o) {
var n = o && t && t.constructor === e,
i = n ? t : u.create(e.prototype);
if (1 === A.length && i instanceof T && (n || !(i instanceof Q))) {
var a = A[0];
u.isPlainObject(a) && (a.insert = !1)
}
return (n ? i.set : e).apply(i, A), n && (t = null), i
})
},
push: function(e, t) {
var A = t.length;
if (A < 4096) e.push.apply(e, t);
else {
var o = e.length;
e.length += A;
for (var n = 0; n < A; n++) e[o + n] = t[n]
}
return e
},
splice: function(e, t, A, o) {
var n = t && t.length,
i = A === r;
(A = i ? e.length : A) > e.length && (A = e.length);
for (var a = 0; a < n; a++) t[a]._index = A + a;
if (i) return u.push(e, t), [];
var s = [A, o];
t && u.push(s, t);
for (var l = e.splice.apply(e, s), c = (a = 0, l.length); a < c; a++) l[a]._index = r;
for (a = A + n, c = e.length; a < c; a++) e[a]._index = a;
return l
},
capitalize: function(e) {
return e.replace(/\b[a-z]/g, function(e) {
return e.toUpperCase()
})
},
camelize: function(e) {
return e.replace(/-(.)/g, function(e, t) {
return t.toUpperCase()
})
},
hyphenate: function(e) {
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()
}
}
});
var c = {
on: function(e, t) {
if ("string" != typeof e) u.each(e, function(e, t) {
this.on(t, e)
}, this);
else {
var A = this._eventTypes,
o = A && A[e],
n = this._callbacks = this._callbacks || {}; - 1 === (n = n[e] = n[e] || []).indexOf(t) && (n.push(t), o && o.install && 1 === n.length && o.install.call(this, e))
}
return this
},
off: function(e, t) {
if ("string" == typeof e) {
var A, o = this._eventTypes,
n = o && o[e],
i = this._callbacks && this._callbacks[e];
return i && (!t || -1 !== (A = i.indexOf(t)) && 1 === i.length ? (n && n.uninstall && n.uninstall.call(this, e), delete this._callbacks[e]) : -1 !== A && i.splice(A, 1)), this
}
u.each(e, function(e, t) {
this.off(t, e)
}, this)
},
once: function(e, t) {
return this.on(e, function() {
t.apply(this, arguments), this.off(e, t)
})
},
emit: function(e, t) {
var A = this._callbacks && this._callbacks[e];
if (!A) return !1;
var o = u.slice(arguments, 1),
n = t && t.target && !t.currentTarget;
A = A.slice(), n && (t.currentTarget = this);
for (var i = 0, a = A.length; i < a; i++)
if (0 == A[i].apply(this, o)) {
t && t.stop && t.stop();
break
}
return n && delete t.currentTarget, !0
},
responds: function(e) {
return !(!this._callbacks || !this._callbacks[e])
},
attach: "#on",
detach: "#off",
fire: "#emit",
_installEvents: function(e) {
var t = this._eventTypes,
A = this._callbacks,
o = e ? "install" : "uninstall";
if (t)
for (var n in A)
if (A[n].length > 0) {
var i = t[n],
a = i && i[o];
a && a.call(this, n)
}
},
statics: {
inject: function e(t) {
var A = t._events;
if (A) {
var o = {};
u.each(A, function(e, A) {
var n = "string" == typeof e,
i = n ? e : A,
a = u.capitalize(i),
r = i.substring(2).toLowerCase();
o[r] = n ? {} : e, i = "_" + i, t["get" + a] = function() {
return this[i]
}, t["set" + a] = function(e) {
var t = this[i];
t && this.off(r, t), e && this.on(r, e), this[i] = e
}
}), t._eventTypes = o
}
return e.base.apply(this, arguments)
}
}
},
g = u.extend({
_class: "PaperScope",
initialize: function e() {
ue = this, this.settings = new u({
applyMatrix: !0,
insertItems: !0,
handleSize: 4,
hitTolerance: 0
}), this.project = null, this.projects = [], this.tools = [], this._id = e._id++, e._scopes[this._id] = this;
var t = e.prototype;
if (!this.support) {
var A = ae.getContext(1, 1) || {};
t.support = {
nativeDash: "setLineDash" in A || "mozDash" in A,
nativeBlendModes: re.nativeModes
}, ae.release(A)
}
if (!this.agent) {
var o = a.navigator.userAgent.toLowerCase(),
n = (/(darwin|win|mac|linux|freebsd|sunos)/.exec(o) || [])[0],
i = "darwin" === n ? "mac" : n,
r = t.agent = t.browser = {
platform: i
};
i && (r[i] = !0), o.replace(/(opera|chrome|safari|webkit|firefox|msie|trident|atom|node)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:v?([.\d]+))?/g, function(e, t, A, o, n) {
if (!r.chrome) {
var i = "opera" === t ? o : /^(node|trident)$/.test(t) ? n : A;
r.version = i, r.versionNumber = parseFloat(i), t = "trident" === t ? "msie" : t, r.name = t, r[t] = !0
}
}), r.chrome && delete r.webkit, r.atom && delete r.chrome
}
},
version: "0.11.8",
getView: function() {
var e = this.project;
return e && e._view
},
getPaper: function() {
return this
},
execute: function(e, t) {
var A = ue.PaperScript.execute(e, this, t);
return X.updateFocus(), A
},
install: function(e) {
var t = this;
for (var A in u.each(["project", "view", "tool"], function(A) {
u.define(e, A, {
configurable: !0,
get: function() {
return t[A]
}
})
}), this) !/^_/.test(A) && this[A] && (e[A] = this[A])
},
setup: function(e) {
return ue = this, this.project = new M(e), this
},
createCanvas: function(e, t) {
return ae.getCanvas(e, t)
},
activate: function() {
ue = this
},
clear: function() {
for (var e = this.projects, t = this.tools, A = e.length - 1; A >= 0; A--) e[A].remove();
for (A = t.length - 1; A >= 0; A--) t[A].remove()
},
remove: function() {
this.clear(), delete g._scopes[this._id]
},
statics: new function() {
function e(e) {
return e += "Attribute",
function(t, A) {
return t[e](A) || t[e]("data-paper-" + A)
}
}
return {
_scopes: {},
_id: 0,
get: function(e) {
return this._scopes[e] || null
},
getAttribute: e("get"),
hasAttribute: e("has")
}
}
}),
d = u.extend(c, {
initialize: function(e) {
this._scope = ue, this._index = this._scope[this._list].push(this) - 1, !e && this._scope[this._reference] || this.activate()
},
activate: function() {
if (!this._scope) return !1;
var e = this._scope[this._reference];
return e && e !== this && e.emit("deactivate"), this._scope[this._reference] = this, this.emit("activate", e), !0
},
isActive: function() {
return this._scope[this._reference] === this
},
remove: function() {
return null != this._index && (u.splice(this._scope[this._list], null, this._index, 1), this._scope[this._reference] == this && (this._scope[this._reference] = null), this._scope = null, !0)
},
getView: function() {
return this._scope.getView()
}
}),
h = u.extend({
initialize: function(e) {
this.precision = u.pick(e, 5), this.multiplier = Math.pow(10, this.precision)
},
number: function(e) {
return this.precision < 16 ? Math.round(e * this.multiplier) / this.multiplier : e
},
pair: function(e, t, A) {
return this.number(e) + (A || ",") + this.number(t)
},
point: function(e, t) {
return this.number(e.x) + (t || ",") + this.number(e.y)
},
size: function(e, t) {
return this.number(e.width) + (t || ",") + this.number(e.height)
},
rectangle: function(e, t) {
return this.point(e, t) + (t || ",") + this.size(e, t)
}
});
h.instance = new h;
var m = new function() {
var e = [
[.5773502691896257],
[0, .7745966692414834],
[.33998104358485626, .8611363115940526],
[0, .5384693101056831, .906179845938664],
[.2386191860831969, .6612093864662645, .932469514203152],
[0, .4058451513773972, .7415311855993945, .9491079123427585],
[.1834346424956498, .525532409916329, .7966664774136267, .9602898564975363],
[0, .3242534234038089, .6133714327005904, .8360311073266358, .9681602395076261],
[.14887433898163122, .4333953941292472, .6794095682990244, .8650633666889845, .9739065285171717],
[0, .26954315595234496, .5190961292068118, .7301520055740494, .8870625997680953, .978228658146057],
[.1252334085114689, .3678314989981802, .5873179542866175, .7699026741943047, .9041172563704749, .9815606342467192],
[0, .2304583159551348, .44849275103644687, .6423493394403402, .8015780907333099, .9175983992229779, .9841830547185881],
[.10805494870734367, .31911236892788974, .5152486363581541, .6872929048116855, .827201315069765, .9284348836635735, .9862838086968123],
[0, .20119409399743451, .3941513470775634, .5709721726085388, .7244177313601701, .8482065834104272, .937273392400706, .9879925180204854],
[.09501250983763744, .2816035507792589, .45801677765722737, .6178762444026438, .755404408355003, .8656312023878318, .9445750230732326, .9894009349916499]
],
t = [
[1],
[.8888888888888888, .5555555555555556],
[.6521451548625461, .34785484513745385],
[.5688888888888889, .47862867049936647, .23692688505618908],
[.46791393457269104, .3607615730481386, .17132449237917036],
[.4179591836734694, .3818300505051189, .27970539148927664, .1294849661688697],
[.362683783378362, .31370664587788727, .22238103445337448, .10122853629037626],
[.3302393550012598, .31234707704000286, .26061069640293544, .1806481606948574, .08127438836157441],
[.29552422471475287, .26926671930999635, .21908636251598204, .1494513491505806, .06667134430868814],
[.2729250867779006, .26280454451024665, .23319376459199048, .18629021092773426, .1255803694649046, .05566856711617366],
[.24914704581340277, .2334925365383548, .20316742672306592, .16007832854334622, .10693932599531843, .04717533638651183],
[.2325515532308739, .22628318026289723, .2078160475368885, .17814598076194574, .13887351021978725, .09212149983772845, .04048400476531588],
[.2152638534631578, .2051984637212956, .18553839747793782, .15720316715819355, .12151857068790319, .08015808715976021, .03511946033175186],
[.2025782419255613, .19843148532711158, .1861610000155622, .16626920581699392, .13957067792615432, .10715922046717194, .07036604748810812, .03075324199611727],
[.1894506104550685, .18260341504492358, .16915651939500254, .14959598881657674, .12462897125553388, .09515851168249279, .062253523938647894, .027152459411754096]
],
A = Math.abs,
o = Math.sqrt,
n = Math.pow,
i = Math.log2 || function(e) {
return Math.log(e) * Math.LOG2E
};
function a(e, t, A) {
return e < t ? t : e > A ? A : e
}
function r(e, t, o) {
function n(e) {
var t = 134217729 * e,
A = e - t + t;
return [A, e - A]
}
var i = t * t - e * o,
a = t * t + e * o;
if (3 * A(i) < a) {
var r = n(e),
s = n(t),
l = n(o),
u = t * t,
c = e * o;
i = u - c + (s[0] * s[0] - u + 2 * s[0] * s[1] + s[1] * s[1] - (r[0] * l[0] - c + r[0] * l[1] + r[1] * l[0] + r[1] * l[1]))
}
return i
}
function s() {
var e = Math.max.apply(Math, arguments);
return e && (e < 1e-8 || e > 1e8) ? n(2, -Math.round(i(e))) : 0
}
return {
EPSILON: 1e-12,
MACHINE_EPSILON: 1.12e-16,
CURVETIME_EPSILON: 1e-8,
GEOMETRIC_EPSILON: 1e-7,
TRIGONOMETRIC_EPSILON: 1e-8,
KAPPA: 4 * (o(2) - 1) / 3,
isZero: function(e) {
return e >= -1e-12 && e <= 1e-12
},
clamp: a,
integrate: function(A, o, n, i) {
for (var a = e[i - 2], r = t[i - 2], s = .5 * (n - o), l = s + o, u = 0, c = i + 1 >> 1, g = 1 & i ? r[u++] * A(l) : 0; u < c;) {
var d = s * a[u];
g += r[u++] * (A(l + d) + A(l - d))
}
return s * g
},
findRoot: function(e, t, o, n, i, r, s) {
for (var l = 0; l < r; l++) {
var u = e(o),
c = u / t(o),
g = o - c;
if (A(c) < s) {
o = g;
break
}
u > 0 ? (i = o, o = g <= n ? .5 * (n + i) : g) : (n = o, o = g >= i ? .5 * (n + i) : g)
}
return a(o, n, i)
},
solveQuadratic: function(e, t, n, i, l, u) {
var c, g = 1 / 0;
if (A(e) < 1e-12) {
if (A(t) < 1e-12) return A(n) < 1e-12 ? -1 : 0;
c = -n / t
} else {
var d = r(e, t *= -.5, n);
if (d && A(d) < 1.12e-16) {
var h = s(A(e), A(t), A(n));
h && (d = r(e *= h, t *= h, n *= h))
}
if (d >= -1.12e-16) {
var m = d < 0 ? 0 : o(d),
p = t + (t < 0 ? -m : m);
0 === p ? g = -(c = n / e) : (c = p / e, g = n / p)
}
}
var E = 0,
B = null == l,
f = l - 1e-12,
C = u + 1e-12;
return isFinite(c) && (B || c > f && c < C) && (i[E++] = B ? c : a(c, l, u)), g !== c && isFinite(g) && (B || g > f && g < C) && (i[E++] = B ? g : a(g, l, u)), E
},
solveCubic: function(e, t, i, r, l, u, c) {
var g, d, h, p, E, B = s(A(e), A(t), A(i), A(r));
function f(A) {
var o = e * (g = A);
p = (o + (d = o + t)) * g + (h = d * g + i), E = h * g + r
}
if (B && (e *= B, t *= B, i *= B, r *= B), A(e) < 1e-12) e = t, d = i, h = r, g = 1 / 0;
else if (A(r) < 1e-12) d = t, h = i, g = 0;
else {
f(-t / e / 3);
var C = E / e,
w = n(A(C), 1 / 3),
I = C < 0 ? -1 : 1,
y = -p / e,
b = y > 0 ? 1.324717957244746 * Math.max(w, o(y)) : w,
M = g - I * b;
if (M !== g) {
do {
f(M), M = 0 === p ? g : g - E / p / (1 + 1.12e-16)
} while (I * M > I * g);
A(e) * g * g > A(r / g) && (d = ((h = -r / g) - i) / g)
}
}
var T = m.solveQuadratic(e, d, h, l, u, c),
S = null == u;
return isFinite(g) && (0 === T || T > 0 && g !== l[0] && g !== l[1]) && (S || g > u - 1e-12 && g < c + 1e-12) && (l[T++] = S ? g : a(g, u, c)), T
}
}
},
p = {
_id: 1,
_pools: {},
get: function(e) {
if (e) {
var t = this._pools[e];
return t || (t = this._pools[e] = {
_id: 1
}), t._id++
}
return this._id++
}
},
E = u.extend({
_class: "Point",
_readIndex: !0,
initialize: function(e, t) {
var A = typeof e,
o = this.__read,
n = 0;
if ("number" === A) {
var i = "number" == typeof t;
this._set(e, i ? t : e), o && (n = i ? 2 : 1)
} else if ("undefined" === A || null === e) this._set(0, 0), o && (n = null === e ? 1 : 0);
else {
var a = "string" === A ? e.split(/[\s,]+/) || [] : e;
n = 1, Array.isArray(a) ? this._set(+a[0], +(a.length > 1 ? a[1] : a[0])) : "x" in a ? this._set(a.x || 0, a.y || 0) : "width" in a ? this._set(a.width || 0, a.height || 0) : "angle" in a ? (this._set(a.length || 0, 0), this.setAngle(a.angle || 0)) : (this._set(0, 0), n = 0)
}
return o && (this.__read = n), this
},
set: "#initialize",
_set: function(e, t) {
return this.x = e, this.y = t, this
},
equals: function(e) {
return this === e || e && (this.x === e.x && this.y === e.y || Array.isArray(e) && this.x === e[0] && this.y === e[1]) || !1
},
clone: function() {
return new E(this.x, this.y)
},
toString: function() {
var e = h.instance;
return "{ x: " + e.number(this.x) + ", y: " + e.number(this.y) + " }"
},
_serialize: function(e) {
var t = e.formatter;
return [t.number(this.x), t.number(this.y)]
},
getLength: function() {
return Math.sqrt(this.x * this.x + this.y * this.y)
},
setLength: function(e) {
if (this.isZero()) {
var t = this._angle || 0;
this._set(Math.cos(t) * e, Math.sin(t) * e)
} else {
var A = e / this.getLength();
m.isZero(A) && this.getAngle(), this._set(this.x * A, this.y * A)
}
},
getAngle: function() {
return 180 * this.getAngleInRadians.apply(this, arguments) / Math.PI
},
setAngle: function(e) {
this.setAngleInRadians.call(this, e * Math.PI / 180)
},
getAngleInDegrees: "#getAngle",
setAngleInDegrees: "#setAngle",
getAngleInRadians: function() {
if (arguments.length) {
var e = E.read(arguments),
t = this.getLength() * e.getLength();
if (m.isZero(t)) return NaN;
var A = this.dot(e) / t;
return Math.acos(A < -1 ? -1 : A > 1 ? 1 : A)
}
return this.isZero() ? this._angle || 0 : this._angle = Math.atan2(this.y, this.x)
},
setAngleInRadians: function(e) {
if (this._angle = e, !this.isZero()) {
var t = this.getLength();
this._set(Math.cos(e) * t, Math.sin(e) * t)
}
},
getQuadrant: function() {
return this.x >= 0 ? this.y >= 0 ? 1 : 4 : this.y >= 0 ? 2 : 3
}
}, {
beans: !1,
getDirectedAngle: function() {
var e = E.read(arguments);
return 180 * Math.atan2(this.cross(e), this.dot(e)) / Math.PI
},
getDistance: function() {
var e = E.read(arguments),
t = e.x - this.x,
A = e.y - this.y,
o = t * t + A * A;
return u.read(arguments) ? o : Math.sqrt(o)
},
normalize: function(e) {
e === r && (e = 1);
var t = this.getLength(),
A = 0 !== t ? e / t : 0,
o = new E(this.x * A, this.y * A);
return A >= 0 && (o._angle = this._angle), o
},
rotate: function(e, t) {
if (0 === e) return this.clone();
e = e * Math.PI / 180;
var A = t ? this.subtract(t) : this,
o = Math.sin(e),
n = Math.cos(e);
return A = new E(A.x * n - A.y * o, A.x * o + A.y * n), t ? A.add(t) : A
},
transform: function(e) {
return e ? e._transformPoint(this) : this
},
add: function() {
var e = E.read(arguments);
return new E(this.x + e.x, this.y + e.y)
},
subtract: function() {
var e = E.read(arguments);
return new E(this.x - e.x, this.y - e.y)
},
multiply: function() {
var e = E.read(arguments);
return new E(this.x * e.x, this.y * e.y)
},
divide: function() {
var e = E.read(arguments);
return new E(this.x / e.x, this.y / e.y)
},
modulo: function() {
var e = E.read(arguments);
return new E(this.x % e.x, this.y % e.y)
},
negate: function() {
return new E(-this.x, -this.y)
},
isInside: function() {
return w.read(arguments).contains(this)
},
isClose: function() {
var e = E.read(arguments),
t = u.read(arguments);
return this.getDistance(e) <= t
},
isCollinear: function() {
var e = E.read(arguments);
return E.isCollinear(this.x, this.y, e.x, e.y)
},
isColinear: "#isCollinear",
isOrthogonal: function() {
var e = E.read(arguments);
return E.isOrthogonal(this.x, this.y, e.x, e.y)
},
isZero: function() {
var e = m.isZero;
return e(this.x) && e(this.y)
},
isNaN: function() {
return isNaN(this.x) || isNaN(this.y)
},
isInQuadrant: function(e) {
return this.x * (e > 1 && e < 4 ? -1 : 1) >= 0 && this.y * (e > 2 ? -1 : 1) >= 0
},
dot: function() {
var e = E.read(arguments);
return this.x * e.x + this.y * e.y
},
cross: function() {
var e = E.read(arguments);
return this.x * e.y - this.y * e.x
},
project: function() {
var e = E.read(arguments),
t = e.isZero() ? 0 : this.dot(e) / e.dot(e);
return new E(e.x * t, e.y * t)
},
statics: {
min: function() {
var e = E.read(arguments),
t = E.read(arguments);
return new E(Math.min(e.x, t.x), Math.min(e.y, t.y))
},
max: function() {
var e = E.read(arguments),
t = E.read(arguments);
return new E(Math.max(e.x, t.x), Math.max(e.y, t.y))
},
random: function() {
return new E(Math.random(), Math.random())
},
isCollinear: function(e, t, A, o) {
return Math.abs(e * o - t * A) <= 1e-8 * Math.sqrt((e * e + t * t) * (A * A + o * o))
},
isOrthogonal: function(e, t, A, o) {
return Math.abs(e * A + t * o) <= 1e-8 * Math.sqrt((e * e + t * t) * (A * A + o * o))
}
}
}, u.each(["round", "ceil", "floor", "abs"], function(e) {
var t = Math[e];
this[e] = function() {
return new E(t(this.x), t(this.y))
}
}, {})),
B = E.extend({
initialize: function(e, t, A, o) {
this._x = e, this._y = t, this._owner = A, this._setter = o
},
_set: function(e, t, A) {
return this._x = e, this._y = t, A || this._owner[this._setter](this), this
},
getX: function() {
return this._x
},
setX: function(e) {
this._x = e, this._owner[this._setter](this)
},
getY: function() {
return this._y
},
setY: function(e) {
this._y = e, this._owner[this._setter](this)
},
isSelected: function() {
return !!(this._owner._selection & this._getSelection())
},
setSelected: function(e) {
this._owner._changeSelection(this._getSelection(), e)
},
_getSelection: function() {
return "setPosition" === this._setter ? 4 : 0
}
}),
f = u.extend({
_class: "Size",
_readIndex: !0,
initialize: function(e, t) {
var A = typeof e,
o = this.__read,
n = 0;
if ("number" === A) {
var i = "number" == typeof t;
this._set(e, i ? t : e), o && (n = i ? 2 : 1)
} else if ("undefined" === A || null === e) this._set(0, 0), o && (n = null === e ? 1 : 0);
else {
var a = "string" === A ? e.split(/[\s,]+/) || [] : e;
n = 1, Array.isArray(a) ? this._set(+a[0], +(a.length > 1 ? a[1] : a[0])) : "width" in a ? this._set(a.width || 0, a.height || 0) : "x" in a ? this._set(a.x || 0, a.y || 0) : (this._set(0, 0), n = 0)
}
return o && (this.__read = n), this
},
set: "#initialize",
_set: function(e, t) {
return this.width = e, this.height = t, this
},
equals: function(e) {
return e === this || e && (this.width === e.width && this.height === e.height || Array.isArray(e) && this.width === e[0] && this.height === e[1]) || !1
},
clone: function() {
return new f(this.width, this.height)
},
toString: function() {
var e = h.instance;
return "{ width: " + e.number(this.width) + ", height: " + e.number(this.height) + " }"
},
_serialize: function(e) {
var t = e.formatter;
return [t.number(this.width), t.number(this.height)]
},
add: function() {
var e = f.read(arguments);
return new f(this.width + e.width, this.height + e.height)
},
subtract: function() {
var e = f.read(arguments);
return new f(this.width - e.width, this.height - e.height)
},
multiply: function() {
var e = f.read(arguments);
return new f(this.width * e.width, this.height * e.height)
},
divide: function() {
var e = f.read(arguments);
return new f(this.width / e.width, this.height / e.height)
},
modulo: function() {
var e = f.read(arguments);
return new f(this.width % e.width, this.height % e.height)
},
negate: function() {
return new f(-this.width, -this.height)
},
isZero: function() {
var e = m.isZero;
return e(this.width) && e(this.height)
},
isNaN: function() {
return isNaN(this.width) || isNaN(this.height)
},
statics: {
min: function(e, t) {
return new f(Math.min(e.width, t.width), Math.min(e.height, t.height))
},
max: function(e, t) {
return new f(Math.max(e.width, t.width), Math.max(e.height, t.height))
},
random: function() {
return new f(Math.random(), Math.random())
}
}
}, u.each(["round", "ceil", "floor", "abs"], function(e) {
var t = Math[e];
this[e] = function() {
return new f(t(this.width), t(this.height))
}
}, {})),
C = f.extend({
initialize: function(e, t, A, o) {
this._width = e, this._height = t, this._owner = A, this._setter = o
},
_set: function(e, t, A) {
return this._width = e, this._height = t, A || this._owner[this._setter](this), this
},
getWidth: function() {
return this._width
},
setWidth: function(e) {
this._width = e, this._owner[this._setter](this)
},
getHeight: function() {
return this._height
},
setHeight: function(e) {
this._height = e, this._owner[this._setter](this)
}
}),
w = u.extend({
_class: "Rectangle",
_readIndex: !0,
beans: !0,
initialize: function(e, t, A, o) {
var n, i = typeof e;
if ("number" === i ? (this._set(e, t, A, o), n = 4) : "undefined" === i || null === e ? (this._set(0, 0, 0, 0), n = null === e ? 1 : 0) : 1 === arguments.length && (Array.isArray(e) ? (this._set.apply(this, e), n = 1) : e.x !== r || e.width !== r ? (this._set(e.x || 0, e.y || 0, e.width || 0, e.height || 0), n = 1) : e.from === r && e.to === r && (this._set(0, 0, 0, 0), u.filter(this, e), n = 1)), n === r) {
var a, s, l = E.readNamed(arguments, "from"),
c = u.peek(arguments),
g = l.x,
d = l.y;
if (c && c.x !== r || u.hasNamed(arguments, "to")) {
var h = E.readNamed(arguments, "to");
a = h.x - g, s = h.y - d, a < 0 && (g = h.x, a = -a), s < 0 && (d = h.y, s = -s)
} else {
var m = f.read(arguments);
a = m.width, s = m.height
}
this._set(g, d, a, s), n = arguments.__index;
var p = arguments.__filtered;
p && (this.__filtered = p)
}
return this.__read && (this.__read = n), this
},
set: "#initialize",
_set: function(e, t, A, o) {
return this.x = e, this.y = t, this.width = A, this.height = o, this
},
clone: function() {
return new w(this.x, this.y, this.width, this.height)
},
equals: function(e) {
var t = u.isPlainValue(e) ? w.read(arguments) : e;
return t === this || t && this.x === t.x && this.y === t.y && this.width === t.width && this.height === t.height || !1
},
toString: function() {
var e = h.instance;
return "{ x: " + e.number(this.x) + ", y: " + e.number(this.y) + ", width: " + e.number(this.width) + ", height: " + e.number(this.height) + " }"
},
_serialize: function(e) {
var t = e.formatter;
return [t.number(this.x), t.number(this.y), t.number(this.width), t.number(this.height)]
},
getPoint: function(e) {
return new(e ? E : B)(this.x, this.y, this, "setPoint")
},
setPoint: function() {
var e = E.read(arguments);
this.x = e.x, this.y = e.y
},
getSize: function(e) {
return new(e ? f : C)(this.width, this.height, this, "setSize")
},
_fw: 1,
_fh: 1,
setSize: function() {
var e = f.read(arguments),
t = this._sx,
A = this._sy,
o = e.width,
n = e.height;
t && (this.x += (this.width - o) * t), A && (this.y += (this.height - n) * A), this.width = o, this.height = n, this._fw = this._fh = 1
},
getLeft: function() {
return this.x
},
setLeft: function(e) {
if (!this._fw) {
var t = e - this.x;
this.width -= .5 === this._sx ? 2 * t : t
}
this.x = e, this._sx = this._fw = 0
},
getTop: function() {
return this.y
},
setTop: function(e) {
if (!this._fh) {
var t = e - this.y;
this.height -= .5 === this._sy ? 2 * t : t
}
this.y = e, this._sy = this._fh = 0
},
getRight: function() {
return this.x + this.width
},
setRight: function(e) {
if (!this._fw) {
var t = e - this.x;
this.width = .5 === this._sx ? 2 * t : t
}
this.x = e - this.width, this._sx = 1, this._fw = 0
},
getBottom: function() {
return this.y + this.height
},
setBottom: function(e) {
if (!this._fh) {
var t = e - this.y;
this.height = .5 === this._sy ? 2 * t : t
}
this.y = e - this.height, this._sy = 1, this._fh = 0
},
getCenterX: function() {
return this.x + this.width / 2
},
setCenterX: function(e) {
this._fw || .5 === this._sx ? this.x = e - this.width / 2 : (this._sx && (this.x += 2 * (e - this.x) * this._sx), this.width = 2 * (e - this.x)), this._sx = .5, this._fw = 0
},
getCenterY: function() {
return this.y + this.height / 2
},
setCenterY: function(e) {
this._fh || .5 === this._sy ? this.y = e - this.height / 2 : (this._sy && (this.y += 2 * (e - this.y) * this._sy), this.height = 2 * (e - this.y)), this._sy = .5, this._fh = 0
},
getCenter: function(e) {
return new(e ? E : B)(this.getCenterX(), this.getCenterY(), this, "setCenter")
},
setCenter: function() {
var e = E.read(arguments);
return this.setCenterX(e.x), this.setCenterY(e.y), this
},
getArea: function() {
return this.width * this.height
},
isEmpty: function() {
return 0 === this.width || 0 === this.height
},
contains: function(e) {
return e && e.width !== r || 4 === (Array.isArray(e) ? e : arguments).length ? this._containsRectangle(w.read(arguments)) : this._containsPoint(E.read(arguments))
},
_containsPoint: function(e) {
var t = e.x,
A = e.y;
return t >= this.x && A >= this.y && t <= this.x + this.width && A <= this.y + this.height
},
_containsRectangle: function(e) {
var t = e.x,
A = e.y;
return t >= this.x && A >= this.y && t + e.width <= this.x + this.width && A + e.height <= this.y + this.height
},
intersects: function() {
var e = w.read(arguments),
t = u.read(arguments) || 0;
return e.x + e.width > this.x - t && e.y + e.height > this.y - t && e.x < this.x + this.width + t && e.y < this.y + this.height + t
},
intersect: function() {
var e = w.read(arguments),
t = Math.max(this.x, e.x),
A = Math.max(this.y, e.y),
o = Math.min(this.x + this.width, e.x + e.width),
n = Math.min(this.y + this.height, e.y + e.height);
return new w(t, A, o - t, n - A)
},
unite: function() {
var e = w.read(arguments),
t = Math.min(this.x, e.x),
A = Math.min(this.y, e.y),
o = Math.max(this.x + this.width, e.x + e.width),
n = Math.max(this.y + this.height, e.y + e.height);
return new w(t, A, o - t, n - A)
},
include: function() {
var e = E.read(arguments),
t = Math.min(this.x, e.x),
A = Math.min(this.y, e.y),
o = Math.max(this.x + this.width, e.x),
n = Math.max(this.y + this.height, e.y);
return new w(t, A, o - t, n - A)
},
expand: function() {
var e = f.read(arguments),
t = e.width,
A = e.height;
return new w(this.x - t / 2, this.y - A / 2, this.width + t, this.height + A)
},
scale: function(e, t) {
return this.expand(this.width * e - this.width, this.height * (t === r ? e : t) - this.height)
}
}, u.each([
["Top", "Left"],
["Top", "Right"],
["Bottom", "Left"],
["Bottom", "Right"],
["Left", "Center"],
["Top", "Center"],
["Right", "Center"],
["Bottom", "Center"]
], function(e, t) {
var A = e.join(""),
o = /^[RL]/.test(A);
t >= 4 && (e[1] += o ? "Y" : "X");
var n = e[o ? 0 : 1],
i = e[o ? 1 : 0],
a = "get" + n,
r = "get" + i,
s = "set" + n,
l = "set" + i,
u = "set" + A;
this["get" + A] = function(e) {
return new(e ? E : B)(this[a](), this[r](), this, u)
}, this[u] = function() {
var e = E.read(arguments);
this[s](e.x), this[l](e.y)
}
}, {
beans: !0
})),
I = w.extend({
initialize: function(e, t, A, o, n, i) {
this._set(e, t, A, o, !0), this._owner = n, this._setter = i
},
_set: function(e, t, A, o, n) {
return this._x = e, this._y = t, this._width = A, this._height = o, n || this._owner[this._setter](this), this
}
}, new function() {
var e = w.prototype;
return u.each(["x", "y", "width", "height"], function(e) {
var t = u.capitalize(e),
A = "_" + e;
this["get" + t] = function() {
return this[A]
}, this["set" + t] = function(e) {
this[A] = e, this._dontNotify || this._owner[this._setter](this)
}
}, u.each(["Point", "Size", "Center", "Left", "Top", "Right", "Bottom", "CenterX", "CenterY", "TopLeft", "TopRight", "BottomLeft", "BottomRight", "LeftCenter", "TopCenter", "RightCenter", "BottomCenter"], function(t) {
var A = "set" + t;
this[A] = function() {
this._dontNotify = !0, e[A].apply(this, arguments), this._dontNotify = !1, this._owner[this._setter](this)
}
}, {
isSelected: function() {
return !!(2 & this._owner._selection)
},
setSelected: function(e) {
var t = this._owner;
t._changeSelection && t._changeSelection(2, e)
}
}))
}),
y = u.extend({
_class: "Matrix",
initialize: function e(t, A) {
var o = arguments.length,
n = !0;
if (o >= 6 ? this._set.apply(this, arguments) : 1 === o || 2 === o ? t instanceof e ? this._set(t._a, t._b, t._c, t._d, t._tx, t._ty, A) : Array.isArray(t) ? this._set.apply(this, A ? t.concat([A]) : t) : n = !1 : o ? n = !1 : this.reset(), !n) throw new Error("Unsupported matrix parameters");
return this
},
set: "#initialize",
_set: function(e, t, A, o, n, i, a) {
return this._a = e, this._b = t, this._c = A, this._d = o, this._tx = n, this._ty = i, a || this._changed(), this
},
_serialize: function(e, t) {
return u.serialize(this.getValues(), e, !0, t)
},
_changed: function() {
var e = this._owner;
e && (e._applyMatrix ? e.transform(null, !0) : e._changed(25))
},
clone: function() {
return new y(this._a, this._b, this._c, this._d, this._tx, this._ty)
},
equals: function(e) {
return e === this || e && this._a === e._a && this._b === e._b && this._c === e._c && this._d === e._d && this._tx === e._tx && this._ty === e._ty
},
toString: function() {
var e = h.instance;
return "[[" + [e.number(this._a), e.number(this._c), e.number(this._tx)].join(", ") + "], [" + [e.number(this._b), e.number(this._d), e.number(this._ty)].join(", ") + "]]"
},
reset: function(e) {
return this._a = this._d = 1, this._b = this._c = this._tx = this._ty = 0, e || this._changed(), this
},
apply: function(e, t) {
var A = this._owner;
return !!A && (A.transform(null, !0, u.pick(e, !0), t), this.isIdentity())
},
translate: function() {
var e = E.read(arguments),
t = e.x,
A = e.y;
return this._tx += t * this._a + A * this._c, this._ty += t * this._b + A * this._d, this._changed(), this
},
scale: function() {
var e = E.read(arguments),
t = E.read(arguments, 0, {
readNull: !0
});
return t && this.translate(t), this._a *= e.x, this._b *= e.x, this._c *= e.y, this._d *= e.y, t && this.translate(t.negate()), this._changed(), this
},
rotate: function(e) {
e *= Math.PI / 180;
var t = E.read(arguments, 1),
A = t.x,
o = t.y,
n = Math.cos(e),
i = Math.sin(e),
a = A - A * n + o * i,
r = o - A * i - o * n,
s = this._a,
l = this._b,
u = this._c,
c = this._d;
return this._a = n * s + i * u, this._b = n * l + i * c, this._c = -i * s + n * u, this._d = -i * l + n * c, this._tx += a * s + r * u, this._ty += a * l + r * c, this._changed(), this
},
shear: function() {
var e = E.read(arguments),
t = E.read(arguments, 0, {
readNull: !0
});
t && this.translate(t);
var A = this._a,
o = this._b;
return this._a += e.y * this._c, this._b += e.y * this._d, this._c += e.x * A, this._d += e.x * o, t && this.translate(t.negate()), this._changed(), this
},
skew: function() {
var e = E.read(arguments),
t = E.read(arguments, 0, {
readNull: !0
}),
A = Math.PI / 180,
o = new E(Math.tan(e.x * A), Math.tan(e.y * A));
return this.shear(o, t)
},
append: function(e, t) {
if (e) {
var A = this._a,
o = this._b,
n = this._c,
i = this._d,
a = e._a,
r = e._c,
s = e._b,
l = e._d,
u = e._tx,
c = e._ty;
this._a = a * A + s * n, this._c = r * A + l * n, this._b = a * o + s * i, this._d = r * o + l * i, this._tx += u * A + c * n, this._ty += u * o + c * i, t || this._changed()
}
return this
},
prepend: function(e, t) {
if (e) {
var A = this._a,
o = this._b,
n = this._c,
i = this._d,
a = this._tx,
r = this._ty,
s = e._a,
l = e._c,
u = e._b,
c = e._d,
g = e._tx,
d = e._ty;
this._a = s * A + l * o, this._c = s * n + l * i, this._b = u * A + c * o, this._d = u * n + c * i, this._tx = s * a + l * r + g, this._ty = u * a + c * r + d, t || this._changed()
}
return this
},
appended: function(e) {
return this.clone().append(e)
},
prepended: function(e) {
return this.clone().prepend(e)
},
invert: function() {
var e = this._a,
t = this._b,
A = this._c,
o = this._d,
n = this._tx,
i = this._ty,
a = e * o - t * A,
r = null;
return a && !isNaN(a) && isFinite(n) && isFinite(i) && (this._a = o / a, this._b = -t / a, this._c = -A / a, this._d = e / a, this._tx = (A * i - o * n) / a, this._ty = (t * n - e * i) / a, r = this), r
},
inverted: function() {
return this.clone().invert()
},
concatenate: "#append",
preConcatenate: "#prepend",
chain: "#appended",
_shiftless: function() {
return new y(this._a, this._b, this._c, this._d, 0, 0)
},
_orNullIfIdentity: function() {
return this.isIdentity() ? null : this
},
isIdentity: function() {
return 1 === this._a && 0 === this._b && 0 === this._c && 1 === this._d && 0 === this._tx && 0 === this._ty
},
isInvertible: function() {
var e = this._a * this._d - this._c * this._b;
return e && !isNaN(e) && isFinite(this._tx) && isFinite(this._ty)
},
isSingular: function() {
return !this.isInvertible()
},
transform: function(e, t, A) {
return arguments.length < 3 ? this._transformPoint(E.read(arguments)) : this._transformCoordinates(e, t, A)
},
_transformPoint: function(e, t, A) {
var o = e.x,
n = e.y;
return t || (t = new E), t._set(o * this._a + n * this._c + this._tx, o * this._b + n * this._d + this._ty, A)
},
_transformCoordinates: function(e, t, A) {
for (var o = 0, n = 2 * A; o < n; o += 2) {
var i = e[o],
a = e[o + 1];
t[o] = i * this._a + a * this._c + this._tx, t[o + 1] = i * this._b + a * this._d + this._ty
}
return t
},
_transformCorners: function(e) {
var t = e.x,
A = e.y,
o = t + e.width,
n = A + e.height,
i = [t, A, o, A, o, n, t, n];
return this._transformCoordinates(i, i, 4)
},
_transformBounds: function(e, t, A) {
for (var o = this._transformCorners(e), n = o.slice(0, 2), i = n.slice(), a = 2; a < 8; a++) {
var r = o[a],
s = 1 & a;
r < n[s] ? n[s] = r : r > i[s] && (i[s] = r)
}
return t || (t = new w), t._set(n[0], n[1], i[0] - n[0], i[1] - n[1], A)
},
inverseTransform: function() {
return this._inverseTransform(E.read(arguments))
},
_inverseTransform: function(e, t, A) {
var o = this._a,
n = this._b,
i = this._c,
a = this._d,
r = this._tx,
s = this._ty,
l = o * a - n * i,
u = null;
if (l && !isNaN(l) && isFinite(r) && isFinite(s)) {
var c = e.x - this._tx,
g = e.y - this._ty;
t || (t = new E), u = t._set((c * a - g * i) / l, (g * o - c * n) / l, A)
}
return u
},
decompose: function() {
var e, t, A, o = this._a,
n = this._b,
i = this._c,
a = this._d,
r = o * a - n * i,
s = Math.sqrt,
l = Math.atan2,
u = 180 / Math.PI;
if (0 !== o || 0 !== n) {
var c = s(o * o + n * n);
e = Math.acos(o / c) * (n > 0 ? 1 : -1), t = [c, r / c], A = [l(o * i + n * a, c * c), 0]
} else if (0 !== i || 0 !== a) {
var g = s(i * i + a * a);
e = Math.asin(i / g) * (a > 0 ? 1 : -1), t = [r / g, g], A = [0, l(o * i + n * a, g * g)]
} else e = 0, A = t = [0, 0];
return {
translation: this.getTranslation(),
rotation: e * u,
scaling: new E(t),
skewing: new E(A[0] * u, A[1] * u)
}
},
getValues: function() {
return [this._a, this._b, this._c, this._d, this._tx, this._ty]
},
getTranslation: function() {
return new E(this._tx, this._ty)
},
getScaling: function() {
return this.decompose().scaling
},
getRotation: function() {
return this.decompose().rotation
},
applyToContext: function(e) {
this.isIdentity() || e.transform(this._a, this._b, this._c, this._d, this._tx, this._ty)
}
}, u.each(["a", "b", "c", "d", "tx", "ty"], function(e) {
var t = u.capitalize(e),
A = "_" + e;
this["get" + t] = function() {
return this[A]
}, this["set" + t] = function(e) {
this[A] = e, this._changed()
}
}, {})),
b = u.extend({
_class: "Line",
initialize: function(e, t, A, o, n) {
var i = !1;
arguments.length >= 4 ? (this._px = e, this._py = t, this._vx = A, this._vy = o, i = n) : (this._px = e.x, this._py = e.y, this._vx = t.x, this._vy = t.y, i = A), i || (this._vx -= this._px, this._vy -= this._py)
},
getPoint: function() {
return new E(this._px, this._py)
},
getVector: function() {
return new E(this._vx, this._vy)
},
getLength: function() {
return this.getVector().getLength()
},
intersect: function(e, t) {
return b.intersect(this._px, this._py, this._vx, this._vy, e._px, e._py, e._vx, e._vy, !0, t)
},
getSide: function(e, t) {
return b.getSide(this._px, this._py, this._vx, this._vy, e.x, e.y, !0, t)
},
getDistance: function(e) {
return Math.abs(this.getSignedDistance(e))
},
getSignedDistance: function(e) {
return b.getSignedDistance(this._px, this._py, this._vx, this._vy, e.x, e.y, !0)
},
isCollinear: function(e) {
return E.isCollinear(this._vx, this._vy, e._vx, e._vy)
},
isOrthogonal: function(e) {
return E.isOrthogonal(this._vx, this._vy, e._vx, e._vy)
},
statics: {
intersect: function(e, t, A, o, n, i, a, r, s, l) {
s || (A -= e, o -= t, a -= n, r -= i);
var u = A * r - o * a;
if (!m.isZero(u)) {
var c = e - n,
g = t - i,
d = (a * g - r * c) / u,
h = (A * g - o * c) / u;
if (l || -1e-12 < d && d < 1 + 1e-12 && -1e-12 < h && h < 1 + 1e-12) return l || (d = d <= 0 ? 0 : d >= 1 ? 1 : d), new E(e + d * A, t + d * o)
}
},
getSide: function(e, t, A, o, n, i, a, r) {
a || (A -= e, o -= t);
var s = n - e,
l = s * o - (i - t) * A;
return !r && m.isZero(l) && (l = (s * A + s * A) / (A * A + o * o)) >= 0 && l <= 1 && (l = 0), l < 0 ? -1 : l > 0 ? 1 : 0
},
getSignedDistance: function(e, t, A, o, n, i, a) {
return a || (A -= e, o -= t), 0 === A ? o > 0 ? n - e : e - n : 0 === o ? A < 0 ? i - t : t - i : ((n - e) * o - (i - t) * A) / Math.sqrt(A * A + o * o)
},
getDistance: function(e, t, A, o, n, i, a) {
return Math.abs(b.getSignedDistance(e, t, A, o, n, i, a))
}
}
}),
M = d.extend({
_class: "Project",
_list: "projects",
_reference: "project",
_compactSerialize: !0,
initialize: function(e) {
d.call(this, !0), this._children = [], this._namedChildren = {}, this._activeLayer = null, this._currentStyle = new V(null, null, this), this._view = X.create(this, e || ae.getCanvas(1, 1)), this._selectionItems = {}, this._selectionCount = 0, this._updateVersion = 0
},
_serialize: function(e, t) {
return u.serialize(this._children, e, !0, t)
},
_changed: function(e, t) {
if (1 & e) {
var A = this._view;
A && (A._needsUpdate = !0, !A._requested && A._autoUpdate && A.requestUpdate())
}
var o = this._changes;
if (o && t) {
var n = this._changesById,
i = t._id,
a = n[i];
a ? a.flags |= e : o.push(n[i] = {
item: t,
flags: e
})
}
},
clear: function() {
for (var e = this._children, t = e.length - 1; t >= 0; t--) e[t].remove()
},
isEmpty: function() {
return !this._children.length
},
remove: function e() {
return !!e.base.call(this) && (this._view && this._view.remove(), !0)
},
getView: function() {
return this._view
},
getCurrentStyle: function() {
return this._currentStyle
},
setCurrentStyle: function(e) {
this._currentStyle.set(e)
},
getIndex: function() {
return this._index
},
getOptions: function() {
return this._scope.settings
},
getLayers: function() {
return this._children
},
getActiveLayer: function() {
return this._activeLayer || new Q({
project: this,
insert: !0
})
},
getSymbolDefinitions: function() {
var e = [],
t = {};
return this.getItems({
class: N,
match: function(A) {
var o = A._definition,
n = o._id;
return t[n] || (t[n] = !0, e.push(o)), !1
}
}), e
},
getSymbols: "getSymbolDefinitions",
getSelectedItems: function() {
var e = this._selectionItems,
t = [];
for (var A in e) {
var o = e[A],
n = o._selection;
1 & n && o.isInserted() ? t.push(o) : n || this._updateSelection(o)
}
return t
},
_updateSelection: function(e) {
var t = e._id,
A = this._selectionItems;
e._selection ? A[t] !== e && (this._selectionCount++, A[t] = e) : A[t] === e && (this._selectionCount--, delete A[t])
},
selectAll: function() {
for (var e = this._children, t = 0, A = e.length; t < A; t++) e[t].setFullySelected(!0)
},
deselectAll: function() {
var e = this._selectionItems;
for (var t in e) e[t].setFullySelected(!1)
},
addLayer: function(e) {
return this.insertLayer(r, e)
},
insertLayer: function(e, t) {
if (t instanceof Q) {
t._remove(!1, !0), u.splice(this._children, [t], e, 0), t._setProject(this, !0);
var A = t._name;
A && t.setName(A), this._changes && t._changed(5), this._activeLayer || (this._activeLayer = t)
} else t = null;
return t
},
_insertItem: function(e, t, A) {
return t = this.insertLayer(e, t) || (this._activeLayer || this._insertItem(r, new Q(T.NO_INSERT), !0)).insertChild(e, t), A && t.activate && t.activate(), t
},
getItems: function(e) {
return T._getItems(this, e)
},
getItem: function(e) {
return T._getItems(this, e, null, null, !0)[0] || null
},
importJSON: function(e) {
this.activate();
var t = this._activeLayer;
return u.importJSON(e, t && t.isEmpty() && t)
},
removeOn: function(e) {
var t = this._removeSets;
if (t) {
"mouseup" === e && (t.mousedrag = null);
var A = t[e];
if (A) {
for (var o in A) {
var n = A[o];
for (var i in t) {
var a = t[i];
a && a != A && delete a[n._id]
}
n.remove()
}
t[e] = null
}
}
},
draw: function(e, t, A) {
this._updateVersion++, e.save(), t.applyToContext(e);
for (var o = this._children, n = new u({
offset: new E(0, 0),
pixelRatio: A,
viewMatrix: t.isIdentity() ? null : t,
matrices: [new y],
updateMatrix: !0
}), i = 0, a = o.length; i < a; i++) o[i].draw(e, n);
if (e.restore(), this._selectionCount > 0) {
e.save(), e.strokeWidth = 1;
var r = this._selectionItems,
s = this._scope.settings.handleSize,
l = this._updateVersion;
for (var c in r) r[c]._drawSelection(e, t, s, r, l);
e.restore()
}
}
}),
T = u.extend(c, {
statics: {
extend: function e(t) {
return t._serializeFields && (t._serializeFields = u.set({}, this.prototype._serializeFields, t._serializeFields)), e.base.apply(this, arguments)
},
NO_INSERT: {
insert: !1
}
},
_class: "Item",
_name: null,
_applyMatrix: !0,
_canApplyMatrix: !0,
_canScaleStroke: !1,
_pivot: null,
_visible: !0,
_blendMode: "normal",
_opacity: 1,
_locked: !1,
_guide: !1,
_clipMask: !1,
_selection: 0,
_selectBounds: !0,
_selectChildren: !1,
_serializeFields: {
name: null,
applyMatrix: null,
matrix: new y,
pivot: null,
visible: !0,
blendMode: "normal",
opacity: 1,
locked: !1,
guide: !1,
clipMask: !1,
selected: !1,
data: {}
},
_prioritize: ["applyMatrix"]
}, new function() {
var e = ["onMouseDown", "onMouseUp", "onMouseDrag", "onClick", "onDoubleClick", "onMouseMove", "onMouseEnter", "onMouseLeave"];
return u.each(e, function(e) {
this._events[e] = {
install: function(e) {
this.getView()._countItemEvent(e, 1)
},
uninstall: function(e) {
this.getView()._countItemEvent(e, -1)
}
}
}, {
_events: {
onFrame: {
install: function() {
this.getView()._animateItem(this, !0)
},
uninstall: function() {
this.getView()._animateItem(this, !1)
}
},
onLoad: {},
onError: {}
},
statics: {
_itemHandlers: e
}
})
}, {
initialize: function() {},
_initialize: function(e, t) {
var A = e && u.isPlainObject(e),
o = A && !0 === e.internal,
n = this._matrix = new y,
i = A && e.project || ue.project,
a = ue.settings;
return this._id = o ? null : p.get(), this._parent = this._index = null, this._applyMatrix = this._canApplyMatrix && a.applyMatrix, t && n.translate(t), n._owner = this, this._style = new V(i._currentStyle, this, i), o || A && 0 == e.insert || !a.insertItems && (!A || !0 !== e.insert) ? this._setProject(i) : (A && e.parent || i)._insertItem(r, this, !0), A && e !== T.NO_INSERT && this.set(e, {
internal: !0,
insert: !0,
project: !0,
parent: !0
}), A
},
_serialize: function(e, t) {
var A = {},
o = this;
function n(n) {
for (var i in n) {
var a = o[i];
u.equals(a, "leading" === i ? 1.2 * n.fontSize : n[i]) || (A[i] = u.serialize(a, e, "data" !== i, t))
}
}
return n(this._serializeFields), this instanceof S || n(this._style._defaults), [this._class, A]
},
_changed: function(e) {
var t = this._symbol,
A = this._parent || t,
o = this._project;
8 & e && (this._bounds = this._position = this._decomposed = r), 16 & e && (this._globalMatrix = r), A && 72 & e && T._clearBoundsCache(A), 2 & e && T._clearBoundsCache(this), o && o._changed(e, this), t && t._changed(e)
},
getId: function() {
return this._id
},
getName: function() {
return this._name
},
setName: function(e) {
if (this._name && this._removeNamed(), e === +e + "") throw new Error("Names consisting only of numbers are not supported.");
var t = this._getOwner();
if (e && t) {
var A = t._children,
o = t._namedChildren;
(o[e] = o[e] || []).push(this), e in A || (A[e] = this)
}
this._name = e || r, this._changed(256)
},
getStyle: function() {
return this._style
},
setStyle: function(e) {
this.getStyle().set(e)
}
}, u.each(["locked", "visible", "blendMode", "opacity", "guide"], function(e) {
var t = u.capitalize(e),
A = "_" + e,
o = {
locked: 256,
visible: 265
};
this["get" + t] = function() {
return this[A]
}, this["set" + t] = function(t) {
t != this[A] && (this[A] = t, this._changed(o[e] || 257))
}
}, {}), {
beans: !0,
getSelection: function() {
return this._selection
},
setSelection: function(e) {
if (e !== this._selection) {
this._selection = e;
var t = this._project;
t && (t._updateSelection(this), this._changed(257))
}
},
_changeSelection: function(e, t) {
var A = this._selection;
this.setSelection(t ? A | e : A & ~e)
},
isSelected: function() {
if (this._selectChildren)
for (var e = this._children, t = 0, A = e.length; t < A; t++)
if (e[t].isSelected()) return !0;
return !!(1 & this._selection)
},
setSelected: function(e) {
if (this._selectChildren)
for (var t = this._children, A = 0, o = t.length; A < o; A++) t[A].setSelected(e);
this._changeSelection(1, e)
},
isFullySelected: function() {
var e = this._children,
t = !!(1 & this._selection);
if (e && t) {
for (var A = 0, o = e.length; A < o; A++)
if (!e[A].isFullySelected()) return !1;
return !0
}
return t
},
setFullySelected: function(e) {
var t = this._children;
if (t)
for (var A = 0, o = t.length; A < o; A++) t[A].setFullySelected(e);
this._changeSelection(1, e)
},
isClipMask: function() {
return this._clipMask
},
setClipMask: function(e) {
this._clipMask != (e = !!e) && (this._clipMask = e, e && (this.setFillColor(null), this.setStrokeColor(null)), this._changed(257), this._parent && this._parent._changed(2048))
},
getData: function() {
return this._data || (this._data = {}), this._data
},
setData: function(e) {
this._data = e
},
getPosition: function(e) {
var t = e ? E : B,
A = this._position || (this._position = this._getPositionFromBounds());
return new t(A.x, A.y, this, "setPosition")
},
setPosition: function() {
this.translate(E.read(arguments).subtract(this.getPosition(!0)))
},
_getPositionFromBounds: function(e) {
return this._pivot ? this._matrix._transformPoint(this._pivot) : (e || this.getBounds()).getCenter(!0)
},
getPivot: function() {
var e = this._pivot;
return e ? new B(e.x, e.y, this, "setPivot") : null
},
setPivot: function() {
this._pivot = E.read(arguments, 0, {
clone: !0,
readNull: !0
}), this._position = r
}
}, u.each({
getStrokeBounds: {
stroke: !0
},
getHandleBounds: {
handle: !0
},
getInternalBounds: {
internal: !0
},
getDrawnBounds: {
stroke: !0,
drawnTextBounds: !0
}
}, function(e, t) {
this[t] = function(t) {
return this.getBounds(t, e)
}
}, {
beans: !0,
getBounds: function(e, t) {
var A = t || e instanceof y,
o = u.set({}, A ? t : e, this._boundsOptions);
o.stroke && !this.getStrokeScaling() || (o.cacheItem = this);
var n = this._getCachedBounds(A && e, o).rect;
return arguments.length ? n : new I(n.x, n.y, n.width, n.height, this, "setBounds")
},
setBounds: function() {
var e = w.read(arguments),
t = this.getBounds(),
A = this._matrix,
o = new y,
n = e.getCenter();
o.translate(n), e.width == t.width && e.height == t.height || (A.isInvertible() || (A.set(A._backup || (new y).translate(A.getTranslation())), t = this.getBounds()), o.scale(0 !== t.width ? e.width / t.width : 0, 0 !== t.height ? e.height / t.height : 0)), n = t.getCenter(), o.translate(-n.x, -n.y), this.transform(o)
},
_getBounds: function(e, t) {
var A = this._children;
return A && A.length ? (T._updateBoundsCache(this, t.cacheItem), T._getBounds(A, e, t)) : new w
},
_getBoundsCacheKey: function(e, t) {
return [e.stroke ? 1 : 0, e.handle ? 1 : 0, e.drawnTextBounds ? 1 : 0, t ? 1 : 0].join("")
},
_getCachedBounds: function(e, t, A) {
e = e && e._orNullIfIdentity();
var o = t.internal && !A,
n = t.cacheItem,
i = o ? null : this._matrix._orNullIfIdentity(),
a = n && (!e || e.equals(i)) && this._getBoundsCacheKey(t, o),
r = this._bounds;
if (T._updateBoundsCache(this._parent || this._symbol, n), a && r && a in r) return {
rect: (g = r[a]).rect.clone(),
nonscaling: g.nonscaling
};
var s = this._getBounds(e || i, t),
l = s.rect || s,
u = this._style,
c = s.nonscaling || u.hasStroke() && !u.getStrokeScaling();
if (a) {
r || (this._bounds = r = {});
var g = r[a] = {
rect: l.clone(),
nonscaling: c,
internal: o
}
}
return {
rect: l,
nonscaling: c
}
},
_getStrokeMatrix: function(e, t) {
var A = this.getStrokeScaling() ? null : t && t.internal ? this : this._parent || this._symbol && this._symbol._item,
o = A ? A.getViewMatrix().invert() : e;
return o && o._shiftless()
},
statics: {
_updateBoundsCache: function(e, t) {
if (e && t) {
var A = t._id,
o = e._boundsCache = e._boundsCache || {
ids: {},
list: []
};
o.ids[A] || (o.list.push(t), o.ids[A] = t)
}
},
_clearBoundsCache: function(e) {
var t = e._boundsCache;
if (t) {
e._bounds = e._position = e._boundsCache = r;
for (var A = 0, o = t.list, n = o.length; A < n; A++) {
var i = o[A];
i !== e && (i._bounds = i._position = r, i._boundsCache && T._clearBoundsCache(i))
}
}
},
_getBounds: function(e, t, A) {
var o = 1 / 0,
n = -o,
i = o,
a = n,
r = !1;
A = A || {};
for (var s = 0, l = e.length; s < l; s++) {
var u = e[s];
if (u._visible && !u.isEmpty()) {
var c = u._getCachedBounds(t && t.appended(u._matrix), A, !0),
g = c.rect;
o = Math.min(g.x, o), i = Math.min(g.y, i), n = Math.max(g.x + g.width, n), a = Math.max(g.y + g.height, a), c.nonscaling && (r = !0)
}
}
return {
rect: isFinite(o) ? new w(o, i, n - o, a - i) : new w,
nonscaling: r
}
}
}
}), {
beans: !0,
_decompose: function() {
return this._applyMatrix ? null : this._decomposed || (this._decomposed = this._matrix.decompose())
},
getRotation: function() {
var e = this._decompose();
return e ? e.rotation : 0
},
setRotation: function(e) {
var t = this.getRotation();
if (null != t && null != e) {
var A = this._decomposed;
this.rotate(e - t), A && (A.rotation = e, this._decomposed = A)
}
},
getScaling: function() {
var e = this._decompose(),
t = e && e.scaling;
return new B(t ? t.x : 1, t ? t.y : 1, this, "setScaling")
},
setScaling: function() {
var e = this.getScaling(),
t = E.read(arguments, 0, {
clone: !0,
readNull: !0
});
if (e && t && !e.equals(t)) {
var A = this.getRotation(),
o = this._decomposed,
n = new y,
i = this.getPosition(!0);
n.translate(i), A && n.rotate(A), n.scale(t.x / e.x, t.y / e.y), A && n.rotate(-A), n.translate(i.negate()), this.transform(n), o && (o.scaling = t, this._decomposed = o)
}
},
getMatrix: function() {
return this._matrix
},
setMatrix: function() {
var e = this._matrix;
e.initialize.apply(e, arguments)
},
getGlobalMatrix: function(e) {
var t = this._globalMatrix;
if (t)
for (var A = this._parent, o = []; A;) {
if (!A._globalMatrix) {
t = null;
for (var n = 0, i = o.length; n < i; n++) o[n]._globalMatrix = null;
break
}
o.push(A), A = A._parent
}
t || (t = this._globalMatrix = this._matrix.clone(), (A = this._parent) && t.prepend(A.getGlobalMatrix(!0)));
return e ? t : t.clone()
},
getViewMatrix: function() {
return this.getGlobalMatrix().prepend(this.getView()._matrix)
},
getApplyMatrix: function() {
return this._applyMatrix
},
setApplyMatrix: function(e) {
(this._applyMatrix = this._canApplyMatrix && !!e) && this.transform(null, !0)
},
getTransformContent: "#getApplyMatrix",
setTransformContent: "#setApplyMatrix"
}, {
getProject: function() {
return this._project
},
_setProject: function(e, t) {
if (this._project !== e) {
this._project && this._installEvents(!1), this._project = e;
for (var A = this._children, o = 0, n = A && A.length; o < n; o++) A[o]._setProject(e);
t = !0
}
t && this._installEvents(!0)
},
getView: function() {
return this._project._view
},
_installEvents: function e(t) {
e.base.call(this, t);
for (var A = this._children, o = 0, n = A && A.length; o < n; o++) A[o]._installEvents(t)
},
getLayer: function() {
for (var e = this; e = e._parent;)
if (e instanceof Q) return e;
return null
},
getParent: function() {
return this._parent
},
setParent: function(e) {
return e.addChild(this)
},
_getOwner: "#getParent",
getChildren: function() {
return this._children
},
setChildren: function(e) {
this.removeChildren(), this.addChildren(e)
},
getFirstChild: function() {
return this._children && this._children[0] || null
},
getLastChild: function() {
return this._children && this._children[this._children.length - 1] || null
},
getNextSibling: function() {
var e = this._getOwner();
return e && e._children[this._index + 1] || null
},
getPreviousSibling: function() {
var e = this._getOwner();
return e && e._children[this._index - 1] || null
},
getIndex: function() {
return this._index
},
equals: function(e) {
return e === this || e && this._class === e._class && this._style.equals(e._style) && this._matrix.equals(e._matrix) && this._locked === e._locked && this._visible === e._visible && this._blendMode === e._blendMode && this._opacity === e._opacity && this._clipMask === e._clipMask && this._guide === e._guide && this._equals(e) || !1
},
_equals: function(e) {
return u.equals(this._children, e._children)
},
clone: function(e) {
var t = new this.constructor(T.NO_INSERT),
A = this._children,
o = u.pick(e ? e.insert : r, e === r || !0 === e),
n = u.pick(e ? e.deep : r, !0);
A && t.copyAttributes(this), A && !n || t.copyContent(this), A || t.copyAttributes(this), o && t.insertAbove(this);
var i = this._name,
a = this._parent;
if (i && a) {
A = a._children;
for (var s = i, l = 1; A[i];) i = s + " " + l++;
i !== s && t.setName(i)
}
return t
},
copyContent: function(e) {
for (var t = e._children, A = 0, o = t && t.length; A < o; A++) this.addChild(t[A].clone(!1), !0)
},
copyAttributes: function(e, t) {
this.setStyle(e._style);
for (var A = ["_locked", "_visible", "_blendMode", "_opacity", "_clipMask", "_guide"], o = 0, n = A.length; o < n; o++) {
var i = A[o];
e.hasOwnProperty(i) && (this[i] = e[i])
}
t || this._matrix.set(e._matrix, !0), this.setApplyMatrix(e._applyMatrix), this.setPivot(e._pivot), this.setSelection(e._selection);
var a = e._data,
r = e._name;
this._data = a ? u.clone(a) : null, r && this.setName(r)
},
rasterize: function(e, t, A) {
var o = A || this.getStrokeBounds(),
n = (e || this.getView().getResolution()) / 72,
i = o.getTopLeft().floor(),
a = o.getBottomRight().ceil(),
s = new f(a.subtract(i)),
l = new k(T.NO_INSERT);
if (!s.isZero()) {
var c = ae.getCanvas(s.multiply(n)),
g = c.getContext("2d"),
d = (new y).scale(n).translate(i.negate());
g.imageSmoothingEnabled = !1, g.save(), d.applyToContext(g), this.draw(g, new u({
matrices: [d]
})), g.restore(), l.setCanvas(c)
}
return l.transform((new y).translate(i.add(s.divide(2))).scale(1 / n)), (t === r || t) && l.insertAbove(this), l
},
contains: function() {
return !!this._contains(this._matrix._inverseTransform(E.read(arguments)))
},
_contains: function(e) {
var t = this._children;
if (t) {
for (var A = t.length - 1; A >= 0; A--)
if (t[A].contains(e)) return !0;
return !1
}
return e.isInside(this.getInternalBounds())
},
isInside: function() {
return w.read(arguments).contains(this.getBounds())
},
_asPathItem: function() {
return new G.Rectangle({
rectangle: this.getInternalBounds(),
matrix: this._matrix,
insert: !1
})
},
intersects: function(e, t) {
return e instanceof T && this._asPathItem().getIntersections(e._asPathItem(), null, t, !0).length > 0
}
}, new function() {
function e() {
return this._hitTest(E.read(arguments), O.getOptions(arguments))
}
function t() {
var e = E.read(arguments),
t = O.getOptions(arguments),
A = [];
return this._hitTest(e, u.set({
all: A
}, t)), A
}
function A(e, t, A, o) {
var n = this._children;
if (n)
for (var i = n.length - 1; i >= 0; i--) {
var a = n[i],
r = a !== o && a._hitTest(e, t, A);
if (r && !t.all) return r
}
return null
}
return M.inject({
hitTest: e,
hitTestAll: t,
_hitTest: A
}), {
hitTest: e,
hitTestAll: t,
_hitTestChildren: A
}
}, {
_hitTest: function(e, t, A) {
if (this._locked || !this._visible || this._guide && !t.guides || this.isEmpty()) return null;
var o = this._matrix,
n = A ? A.appended(o) : this.getGlobalMatrix().prepend(this.getView()._matrix),
i = Math.max(t.tolerance, 1e-12),
a = t._tolerancePadding = new f(G._getStrokePadding(i, o._shiftless().invert()));
if (!(e = o._inverseTransform(e)) || !this._children && !this.getBounds({
internal: !0,
stroke: !0,
handle: !0
}).expand(a.multiply(2))._containsPoint(e)) return null;
var r, s, l = !(t.guides && !this._guide || t.selected && !this.isSelected() || t.type && t.type !== u.hyphenate(this._class) || t.class && !(this instanceof t.class)),
c = t.match,
g = this;
function d(e) {
return e && c && !c(e) && (e = null), e && t.all && t.all.push(e), e
}
function h(t, A) {
var o = A ? r["get" + A]() : g.getPosition();
if (e.subtract(o).divide(a).length <= 1) return new O(t, g, {
name: A ? u.hyphenate(A) : t,
point: o
})
}
var m = t.position,
p = t.center,
E = t.bounds;
if (l && this._parent && (m || p || E)) {
if ((p || E) && (r = this.getInternalBounds()), !(s = m && h("position") || p && h("center", "Center")) && E)
for (var B = ["TopLeft", "TopRight", "BottomLeft", "BottomRight", "LeftCenter", "TopCenter", "RightCenter", "BottomCenter"], C = 0; C < 8 && !s; C++) s = h("bounds", B[C]);
s = d(s)
}
return s || (s = this._hitTestChildren(e, t, n) || l && d(this._hitTestSelf(e, t, n, this.getStrokeScaling() ? null : n._shiftless().invert())) || null), s && s.point && (s.point = o.transform(s.point)), s
},
_hitTestSelf: function(e, t) {
if (t.fill && this.hasFill() && this._contains(e)) return new O("fill", this)
},
matches: function(e, t) {
var A = typeof e;
if ("object" === A) {
for (var o in e)
if (e.hasOwnProperty(o) && !this.matches(o, e[o])) return !1;
return !0
}
if ("function" === A) return e(this);
if ("match" === e) return t(this);
var n = /^(empty|editable)$/.test(e) ? this["is" + u.capitalize(e)]() : "type" === e ? u.hyphenate(this._class) : this[e];
if ("class" === e) {
if ("function" == typeof t) return this instanceof t;
n = this._class
}
if ("function" == typeof t) return !!t(n);
if (t) {
if (t.test) return t.test(n);
if (u.isPlainObject(t)) return function e(t, A) {
for (var o in t)
if (t.hasOwnProperty(o)) {
var n = t[o],
i = A[o];
if (u.isPlainObject(n) && u.isPlainObject(i)) {
if (!e(n, i)) return !1
} else if (!u.equals(n, i)) return !1
}
return !0
}(t, n)
}
return u.equals(n, t)
},
getItems: function(e) {
return T._getItems(this, e, this._matrix)
},
getItem: function(e) {
return T._getItems(this, e, this._matrix, null, !0)[0] || null
},
statics: {
_getItems: function e(t, A, o, n, i) {
if (!n) {
var a = "object" == typeof A && A,
r = a && a.overlapping,
s = a && a.inside,
l = (B = r || s) && w.read([B]);
n = {
items: [],
recursive: a && !1 !== a.recursive,
inside: !!s,
overlapping: !!r,
rect: l,
path: r && new G.Rectangle({
rectangle: l,
insert: !1
})
}, a && (A = u.filter({}, A, {
recursive: !0,
inside: !0,
overlapping: !0
}))
}
var c = t._children,
g = n.items;
o = (l = n.rect) && (o || new y);
for (var d = 0, h = c && c.length; d < h; d++) {
var m = c[d],
p = o && o.appended(m._matrix),
E = !0;
if (l) {
var B = m.getBounds(p);
if (!l.intersects(B)) continue;
l.contains(B) || n.overlapping && (B.contains(l) || n.path.intersects(m, p)) || (E = !1)
}
if (E && m.matches(A) && (g.push(m), i)) break;
if (!1 !== n.recursive && e(m, A, p, n, i), i && g.length > 0) break
}
return g
}
}
}, {
importJSON: function(e) {
var t = u.importJSON(e, this);
return t !== this ? this.addChild(t) : t
},
addChild: function(e) {
return this.insertChild(r, e)
},
insertChild: function(e, t) {
var A = t ? this.insertChildren(e, [t]) : null;
return A && A[0]
},
addChildren: function(e) {
return this.insertChildren(this._children.length, e)
},
insertChildren: function(e, t) {
var A = this._children;
if (A && t && t.length > 0) {
for (var o = {}, n = (t = u.slice(t)).length - 1; n >= 0; n--) {
var i = (l = t[n]) && l._id;
!l || o[i] ? t.splice(n, 1) : (l._remove(!1, !0), o[i] = !0)
}
u.splice(A, t, e, 0);
for (var a = this._project, r = a._changes, s = (n = 0, t.length); n < s; n++) {
var l, c = (l = t[n])._name;
l._parent = this, l._setProject(a, !0), c && l.setName(c), r && l._changed(5)
}
this._changed(11)
} else t = null;
return t
},
_insertItem: "#insertChild",
_insertAt: function(e, t) {
var A = e && e._getOwner(),
o = e !== this && A ? this : null;
return o && (o._remove(!1, !0), A._insertItem(e._index + t, o)), o
},
insertAbove: function(e) {
return this._insertAt(e, 1)
},
insertBelow: function(e) {
return this._insertAt(e, 0)
},
sendToBack: function() {
var e = this._getOwner();
return e ? e._insertItem(0, this) : null
},
bringToFront: function() {
var e = this._getOwner();
return e ? e._insertItem(r, this) : null
},
appendTop: "#addChild",
appendBottom: function(e) {
return this.insertChild(0, e)
},
moveAbove: "#insertAbove",
moveBelow: "#insertBelow",
addTo: function(e) {
return e._insertItem(r, this)
},
copyTo: function(e) {
return this.clone(!1).addTo(e)
},
reduce: function(e) {
var t = this._children;
if (t && 1 === t.length) {
var A = t[0].reduce(e);
return this._parent ? (A.insertAbove(this), this.remove()) : A.remove(), A
}
return this
},
_removeNamed: function() {
var e = this._getOwner();
if (e) {
var t = e._children,
A = e._namedChildren,
o = this._name,
n = A[o],
i = n ? n.indexOf(this) : -1; - 1 !== i && (t[o] == this && delete t[o], n.splice(i, 1), n.length ? t[o] = n[0] : delete A[o])
}
},
_remove: function(e, t) {
var A = this._getOwner(),
o = this._project,
n = this._index;
return this._style && this._style._dispose(), !!A && (this._name && this._removeNamed(), null != n && (o._activeLayer === this && (o._activeLayer = this.getNextSibling() || this.getPreviousSibling()), u.splice(A._children, null, n, 1)), this._installEvents(!1), e && o._changes && this._changed(5), t && A._changed(11, this), this._parent = null, !0)
},
remove: function() {
return this._remove(!0, !0)
},
replaceWith: function(e) {
var t = e && e.insertBelow(this);
return t && this.remove(), t
},
removeChildren: function(e, t) {
if (!this._children) return null;
e = e || 0, t = u.pick(t, this._children.length);
for (var A = u.splice(this._children, null, e, t - e), o = A.length - 1; o >= 0; o--) A[o]._remove(!0, !1);
return A.length > 0 && this._changed(11), A
},
clear: "#removeChildren",
reverseChildren: function() {
if (this._children) {
this._children.reverse();
for (var e = 0, t = this._children.length; e < t; e++) this._children[e]._index = e;
this._changed(11)
}
},
isEmpty: function() {
var e = this._children;
return !e || !e.length
},
isEditable: function() {
for (var e = this; e;) {
if (!e._visible || e._locked) return !1;
e = e._parent
}
return !0
},
hasFill: function() {
return this.getStyle().hasFill()
},
hasStroke: function() {
return this.getStyle().hasStroke()
},
hasShadow: function() {
return this.getStyle().hasShadow()
},
_getOrder: function(e) {
function t(e) {
var t = [];
do {
t.unshift(e)
} while (e = e._parent);
return t
}
for (var A = t(this), o = t(e), n = 0, i = Math.min(A.length, o.length); n < i; n++)
if (A[n] != o[n]) return A[n]._index < o[n]._index ? 1 : -1;
return 0
},
hasChildren: function() {
return this._children && this._children.length > 0
},
isInserted: function() {
return !!this._parent && this._parent.isInserted()
},
isAbove: function(e) {
return -1 === this._getOrder(e)
},
isBelow: function(e) {
return 1 === this._getOrder(e)
},
isParent: function(e) {
return this._parent === e
},
isChild: function(e) {
return e && e._parent === this
},
isDescendant: function(e) {
for (var t = this; t = t._parent;)
if (t === e) return !0;
return !1
},
isAncestor: function(e) {
return !!e && e.isDescendant(this)
},
isSibling: function(e) {
return this._parent === e._parent
},
isGroupedWith: function(e) {
for (var t = this._parent; t;) {
if (t._parent && /^(Group|Layer|CompoundPath)$/.test(t._class) && e.isDescendant(t)) return !0;
t = t._parent
}
return !1
}
}, u.each(["rotate", "scale", "shear", "skew"], function(e) {
var t = "rotate" === e;
this[e] = function() {
var A = (t ? u : E).read(arguments),
o = E.read(arguments, 0, {
readNull: !0
});
return this.transform((new y)[e](A, o || this.getPosition(!0)))
}
}, {
translate: function() {
var e = new y;
return this.transform(e.translate.apply(e, arguments))
},
transform: function(e, t, A, o) {
var n = this._matrix,
i = e && !e.isIdentity(),
a = (t || this._applyMatrix) && (!n.isIdentity() || i || t && A && this._children);
if (!i && !a) return this;
if (i) {
!e.isInvertible() && n.isInvertible() && (n._backup = n.getValues()), n.prepend(e, !0);
var r = this._style,
s = r.getFillColor(!0),
l = r.getStrokeColor(!0);
s && s.transform(e), l && l.transform(e)
}
if (a && (a = this._transformContent(n, A, o))) {
var u = this._pivot;
u && n._transformPoint(u, u, !0), n.reset(!0), o && this._canApplyMatrix && (this._applyMatrix = !0)
}
var c = this._bounds,
g = this._position;
(i || a) && this._changed(25);
var d = i && c && e.decompose();
if (d && d.skewing.isZero() && d.rotation % 90 == 0) {
for (var h in c) {
var m = c[h];
if (m.nonscaling) delete c[h];
else if (a || !m.internal) {
var p = m.rect;
e._transformBounds(p, p)
}
}
this._bounds = c;
var E = c[this._getBoundsCacheKey(this._boundsOptions || {})];
E && (this._position = this._getPositionFromBounds(E.rect))
} else i && g && this._pivot && (this._position = e._transformPoint(g, g));
return this
},
_transformContent: function(e, t, A) {
var o = this._children;
if (o) {
for (var n = 0, i = o.length; n < i; n++) o[n].transform(e, !0, t, A);
return !0
}
},
globalToLocal: function() {
return this.getGlobalMatrix(!0)._inverseTransform(E.read(arguments))
},
localToGlobal: function() {
return this.getGlobalMatrix(!0)._transformPoint(E.read(arguments))
},
parentToLocal: function() {
return this._matrix._inverseTransform(E.read(arguments))
},
localToParent: function() {
return this._matrix._transformPoint(E.read(arguments))
},
fitBounds: function(e, t) {
e = w.read(arguments);
var A = this.getBounds(),
o = A.height / A.width,
n = e.height / e.width,
i = (t ? o > n : o < n) ? e.width / A.width : e.height / A.height,
a = new w(new E, new f(A.width * i, A.height * i));
a.setCenter(e.getCenter()), this.setBounds(a)
}
}), {
_setStyles: function(e, t, A) {
var o = this._style,
n = this._matrix;
if (o.hasFill() && (e.fillStyle = o.getFillColor().toCanvasStyle(e, n)), o.hasStroke()) {
e.strokeStyle = o.getStrokeColor().toCanvasStyle(e, n), e.lineWidth = o.getStrokeWidth();
var i = o.getStrokeJoin(),
a = o.getStrokeCap(),
r = o.getMiterLimit();
if (i && (e.lineJoin = i), a && (e.lineCap = a), r && (e.miterLimit = r), ue.support.nativeDash) {
var s = o.getDashArray(),
l = o.getDashOffset();
s && s.length && ("setLineDash" in e ? (e.setLineDash(s), e.lineDashOffset = l) : (e.mozDash = s, e.mozDashOffset = l))
}
}
if (o.hasShadow()) {
var u = t.pixelRatio || 1,
c = A._shiftless().prepend((new y).scale(u, u)),
g = c.transform(new E(o.getShadowBlur(), 0)),
d = c.transform(this.getShadowOffset());
e.shadowColor = o.getShadowColor().toCanvasStyle(e), e.shadowBlur = g.getLength(), e.shadowOffsetX = d.x, e.shadowOffsetY = d.y
}
},
draw: function(e, t, A) {
this._updateVersion = this._project._updateVersion;
if (this._visible && 0 !== this._opacity) {
var o = t.matrices,
n = t.viewMatrix,
i = this._matrix,
a = o[o.length - 1].appended(i);
if (a.isInvertible()) {
n = n ? n.appended(a) : a, o.push(a), t.updateMatrix && (this._globalMatrix = a);
var r, s, l, u = this._blendMode,
c = this._opacity,
g = "normal" === u,
d = re.nativeModes[u],
h = g && 1 === c || t.dontStart || t.clip || (d || g && c < 1) && this._canComposite(),
m = t.pixelRatio || 1;
if (!h) {
var p = this.getStrokeBounds(n);
if (!p.width || !p.height) return void o.pop();
l = t.offset, s = t.offset = p.getTopLeft().floor(), r = e, e = ae.getContext(p.getSize().ceil().add(1).multiply(m)), 1 !== m && e.scale(m, m)
}
e.save();
var E = A ? A.appended(i) : this._canScaleStroke && !this.getStrokeScaling(!0) && n,
B = !h && t.clipItem,
f = !E || B;
if (h ? (e.globalAlpha = c, d && (e.globalCompositeOperation = u)) : f && e.translate(-s.x, -s.y), f && (h ? i : n).applyToContext(e), B && t.clipItem.draw(e, t.extend({
clip: !0
})), E) {
e.setTransform(m, 0, 0, m, 0, 0);
var C = t.offset;
C && e.translate(-C.x, -C.y)
}
this._draw(e, t, n, E), e.restore(), o.pop(), t.clip && !t.dontFinish && e.clip(), h || (re.process(u, e, r, c, s.subtract(l).multiply(m)), ae.release(e), t.offset = l)
}
}
},
_isUpdated: function(e) {
var t = this._parent;
if (t instanceof x) return t._isUpdated(e);
var A = this._updateVersion === e;
return !A && t && t._visible && t._isUpdated(e) && (this._updateVersion = e, A = !0), A
},
_drawSelection: function(e, t, A, o, n) {
var i = this._selection,
a = 1 & i,
r = 2 & i || a && this._selectBounds,
s = 4 & i;
if (this._drawSelected || (a = !1), (a || r || s) && this._isUpdated(n)) {
var l, u = this.getSelectedColor(!0) || (l = this.getLayer()) && l.getSelectedColor(!0),
c = t.appended(this.getGlobalMatrix(!0)),
g = A / 2;
if (e.strokeStyle = e.fillStyle = u ? u.toCanvasStyle(e) : "#009dec", e.lineWidth = 2.5, a && this._drawSelected(e, c, o), s) {
var d = this.getPosition(!0),
h = this._parent,
m = h ? h.localToGlobal(d) : d,
p = m.x,
E = m.y;
e.beginPath(), e.arc(p, E, g, 0, 2 * Math.PI, !0), e.stroke();
for (var B = [
[0, -1],
[1, 0],
[0, 1],
[-1, 0]
], f = g, C = A + 1, w = 0; w < 4; w++) {
var I = B[w],
y = I[0],
b = I[1];
e.moveTo(p + y * f, E + b * f), e.lineTo(p + y * C, E + b * C), e.stroke()
}
}
if (r) {
var M = c._transformCorners(this.getInternalBounds());
e.beginPath();
for (w = 0; w < 8; w++) e[w ? "lineTo" : "moveTo"](M[w], M[++w]);
e.closePath(), e.stroke();
for (w = 0; w < 8; w++) e.fillRect(M[w] - g, M[++w] - g, A, A)
}
}
},
_canComposite: function() {
return !1
}
}, u.each(["down", "drag", "up", "move"], function(e) {
this["removeOn" + u.capitalize(e)] = function() {
var t = {};
return t[e] = !0, this.removeOn(t)
}
}, {
removeOn: function(e) {
for (var t in e)
if (e[t]) {
var A = "mouse" + t,
o = this._project,
n = o._removeSets = o._removeSets || {};
n[A] = n[A] || {}, n[A][this._id] = this
}
return this
}
})),
S = T.extend({
_class: "Group",
_selectBounds: !1,
_selectChildren: !0,
_serializeFields: {
children: []
},
initialize: function(e) {
this._children = [], this._namedChildren = {}, this._initialize(e) || this.addChildren(Array.isArray(e) ? e : arguments)
},
_changed: function e(t) {
e.base.call(this, t), 2050 & t && (this._clipItem = r)
},
_getClipItem: function() {
var e = this._clipItem;
if (e === r) {
e = null;
for (var t = this._children, A = 0, o = t.length; A < o; A++)
if (t[A]._clipMask) {
e = t[A];
break
}
this._clipItem = e
}
return e
},
isClipped: function() {
return !!this._getClipItem()
},
setClipped: function(e) {
var t = this.getFirstChild();
t && t.setClipMask(e)
},
_getBounds: function e(t, A) {
var o = this._getClipItem();
return o ? o._getCachedBounds(t && t.appended(o._matrix), u.set({}, A, {
stroke: !1
})) : e.base.call(this, t, A)
},
_hitTestChildren: function e(t, A, o) {
var n = this._getClipItem();
return (!n || n.contains(t)) && e.base.call(this, t, A, o, n)
},
_draw: function(e, t) {
var A = t.clip,
o = !A && this._getClipItem();
t = t.extend({
clipItem: o,
clip: !1
}), A ? (e.beginPath(), t.dontStart = t.dontFinish = !0) : o && o.draw(e, t.extend({
clip: !0
}));
for (var n = this._children, i = 0, a = n.length; i < a; i++) {
var r = n[i];
r !== o && r.draw(e, t)
}
}
}),
Q = S.extend({
_class: "Layer",
initialize: function() {
S.apply(this, arguments)
},
_getOwner: function() {
return this._parent || null != this._index && this._project
},
isInserted: function e() {
return this._parent ? e.base.call(this) : null != this._index
},
activate: function() {
this._project._activeLayer = this
},
_hitTestSelf: function() {}
}),
D = T.extend({
_class: "Shape",
_applyMatrix: !1,
_canApplyMatrix: !1,
_canScaleStroke: !0,
_serializeFields: {
type: null,
size: null,
radius: null
},
initialize: function(e, t) {
this._initialize(e, t)
},
_equals: function(e) {
return this._type === e._type && this._size.equals(e._size) && u.equals(this._radius, e._radius)
},
copyContent: function(e) {
this.setType(e._type), this.setSize(e._size), this.setRadius(e._radius)
},
getType: function() {
return this._type
},
setType: function(e) {
this._type = e
},
getShape: "#getType",
setShape: "#setType",
getSize: function() {
var e = this._size;
return new C(e.width, e.height, this, "setSize")
},
setSize: function() {
var e = f.read(arguments);
if (this._size) {
if (!this._size.equals(e)) {
var t = this._type,
A = e.width,
o = e.height;
"rectangle" === t ? this._radius.set(f.min(this._radius, e.divide(2))) : "circle" === t ? (A = o = (A + o) / 2, this._radius = A / 2) : "ellipse" === t && this._radius._set(A / 2, o / 2), this._size._set(A, o), this._changed(9)
}
} else this._size = e.clone()
},
getRadius: function() {
var e = this._radius;
return "circle" === this._type ? e : new C(e.width, e.height, this, "setRadius")
},
setRadius: function(e) {
var t = this._type;
if ("circle" === t) {
if (e === this._radius) return;
var A = 2 * e;
this._radius = e, this._size._set(A, A)
} else if (e = f.read(arguments), this._radius) {
if (this._radius.equals(e)) return;
if (this._radius.set(e), "rectangle" === t) {
A = f.max(this._size, e.multiply(2));
this._size.set(A)
} else "ellipse" === t && this._size._set(2 * e.width, 2 * e.height)
} else this._radius = e.clone();
this._changed(9)
},
isEmpty: function() {
return !1
},
toPath: function(e) {
var t = new(G[u.capitalize(this._type)])({
center: new E,
size: this._size,
radius: this._radius,
insert: !1
});
return t.copyAttributes(this), ue.settings.applyMatrix && t.setApplyMatrix(!0), (e === r || e) && t.insertAbove(this), t
},
toShape: "#clone",
_asPathItem: function() {
return this.toPath(!1)
},
_draw: function(e, t, A, o) {
var n = this._style,
i = n.hasFill(),
a = n.hasStroke(),
r = t.dontFinish || t.clip,
s = !o;
if (i || a || r) {
var l = this._type,
u = this._radius,
c = "circle" === l;
if (t.dontStart || e.beginPath(), s && c) e.arc(0, 0, u, 0, 2 * Math.PI, !0);
else {
var g = c ? u : u.width,
d = c ? u : u.height,
h = this._size,
m = h.width,
p = h.height;
if (s && "rectangle" === l && 0 === g && 0 === d) e.rect(-m / 2, -p / 2, m, p);
else {
var E = m / 2,
B = p / 2,
f = .44771525016920644,
C = g * f,
w = d * f,
I = [-E, -B + d, -E, -B + w, -E + C, -B, -E + g, -B, E - g, -B, E - C, -B, E, -B + w, E, -B + d, E, B - d, E, B - w, E - C, B, E - g, B, -E + g, B, -E + C, B, -E, B - w, -E, B - d];
o && o.transform(I, I, 32), e.moveTo(I[0], I[1]), e.bezierCurveTo(I[2], I[3], I[4], I[5], I[6], I[7]), E !== g && e.lineTo(I[8], I[9]), e.bezierCurveTo(I[10], I[11], I[12], I[13], I[14], I[15]), B !== d && e.lineTo(I[16], I[17]), e.bezierCurveTo(I[18], I[19], I[20], I[21], I[22], I[23]), E !== g && e.lineTo(I[24], I[25]), e.bezierCurveTo(I[26], I[27], I[28], I[29], I[30], I[31])
}
}
e.closePath()
}
r || !i && !a || (this._setStyles(e, t, A), i && (e.fill(n.getFillRule()), e.shadowColor = "rgba(0,0,0,0)"), a && e.stroke())
},
_canComposite: function() {
return !(this.hasFill() && this.hasStroke())
},
_getBounds: function(e, t) {
var A = new w(this._size).setCenter(0, 0),
o = this._style,
n = t.stroke && o.hasStroke() && o.getStrokeWidth();
return e && (A = e._transformBounds(A)), n ? A.expand(G._getStrokePadding(n, this._getStrokeMatrix(e, t))) : A
}
}, new function() {
function e(e, t, A) {
var o = e._radius;
if (!o.isZero())
for (var n = e._size.divide(2), i = 1; i <= 4; i++) {
var a = new E(i > 1 && i < 4 ? -1 : 1, i > 2 ? -1 : 1),
r = a.multiply(n),
s = r.subtract(a.multiply(o));
if (new w(A ? r.add(a.multiply(A)) : r, s).contains(t)) return {
point: s,
quadrant: i
}
}
}
function t(e, t, A, o) {
var n = e.divide(t);
return (!o || n.isInQuadrant(o)) && n.subtract(n.normalize()).multiply(t).divide(A).length <= 1
}
return {
_contains: function t(A) {
if ("rectangle" === this._type) {
var o = e(this, A);
return o ? A.subtract(o.point).divide(this._radius).getLength() <= 1 : t.base.call(this, A)
}
return A.divide(this.size).getLength() <= .5
},
_hitTestSelf: function A(o, n, i, a) {
var r = !1,
s = this._style,
l = n.stroke && s.hasStroke(),
u = n.fill && s.hasFill();
if (l || u) {
var c = this._type,
g = this._radius,
d = l ? s.getStrokeWidth() / 2 : 0,
h = n._tolerancePadding.add(G._getStrokePadding(d, !s.getStrokeScaling() && a));
if ("rectangle" === c) {
var m = h.multiply(2),
p = e(this, o, m);
if (p) r = t(o.subtract(p.point), g, h, p.quadrant);
else {
var E = new w(this._size).setCenter(0, 0),
B = E.expand(m),
f = E.expand(m.negate());
r = B._containsPoint(o) && !f._containsPoint(o)
}
} else r = t(o, g, h)
}
return r ? new O(l ? "stroke" : "fill", this) : A.base.apply(this, arguments)
}
}
}, {
statics: new function() {
function e(e, t, A, o, n) {
var i = new D(u.getNamed(n), t);
return i._type = e, i._size = A, i._radius = o, i
}
return {
Circle: function() {
var t = E.readNamed(arguments, "center"),
A = u.readNamed(arguments, "radius");
return e("circle", t, new f(2 * A), A, arguments)
},
Rectangle: function() {
var t = w.readNamed(arguments, "rectangle"),
A = f.min(f.readNamed(arguments, "radius"), t.getSize(!0).divide(2));
return e("rectangle", t.getCenter(!0), t.getSize(!0), A, arguments)
},
Ellipse: function() {
var t = D._readEllipse(arguments),
A = t.radius;
return e("ellipse", t.center, A.multiply(2), A, arguments)
},
_readEllipse: function(e) {
var t, A;
if (u.hasNamed(e, "radius")) t = E.readNamed(e, "center"), A = f.readNamed(e, "radius");
else {
var o = w.readNamed(e, "rectangle");
t = o.getCenter(!0), A = o.getSize(!0).divide(2)
}
return {
center: t,
radius: A
}
}
}
}
}),
k = T.extend({
_class: "Raster",
_applyMatrix: !1,
_canApplyMatrix: !1,
_boundsOptions: {
stroke: !1,
handle: !1
},
_serializeFields: {
crossOrigin: null,
source: null
},
_prioritize: ["crossOrigin"],
_smoothing: !1,
initialize: function(e, t) {
if (!this._initialize(e, t !== r && E.read(arguments, 1))) {
var A = "string" == typeof e ? l.getElementById(e) : e;
A ? this.setImage(A) : this.setSource(e)
}
this._size || (this._size = new f, this._loaded = !1)
},
_equals: function(e) {
return this.getSource() === e.getSource()
},
copyContent: function(e) {
var t = e._image,
A = e._canvas;
if (t) this._setImage(t);
else if (A) {
var o = ae.getCanvas(e._size);
o.getContext("2d").drawImage(A, 0, 0), this._setImage(o)
}
this._crossOrigin = e._crossOrigin
},
getSize: function() {
var e = this._size;
return new C(e ? e.width : 0, e ? e.height : 0, this, "setSize")
},
setSize: function() {
var e = f.read(arguments);
if (!e.equals(this._size))
if (e.width > 0 && e.height > 0) {
var t = this.getElement();
this._setImage(ae.getCanvas(e)), t && this.getContext(!0).drawImage(t, 0, 0, e.width, e.height)
} else this._canvas && ae.release(this._canvas), this._size = e.clone()
},
getWidth: function() {
return this._size ? this._size.width : 0
},
setWidth: function(e) {
this.setSize(e, this.getHeight())
},
getHeight: function() {
return this._size ? this._size.height : 0
},
setHeight: function(e) {
this.setSize(this.getWidth(), e)
},
getLoaded: function() {
return this._loaded
},
isEmpty: function() {
var e = this._size;
return !e || 0 === e.width && 0 === e.height
},
getResolution: function() {
var e = this._matrix,
t = new E(0, 0).transform(e),
A = new E(1, 0).transform(e).subtract(t),
o = new E(0, 1).transform(e).subtract(t);
return new f(72 / A.getLength(), 72 / o.getLength())
},
getPpi: "#getResolution",
getImage: function() {
return this._image
},
setImage: function(e) {
var t = this;
function A(e) {
var A = t.getView(),
o = e && e.type || "load";
A && t.responds(o) && (ue = A._scope, t.emit(o, new $(e)))
}
this._setImage(e), this._loaded ? setTimeout(A, 0) : e && q.add(e, {
load: function(o) {
t._setImage(e), A(o)
},
error: A
})
},
_setImage: function(e) {
this._canvas && ae.release(this._canvas), e && e.getContext ? (this._image = null, this._canvas = e, this._loaded = !0) : (this._image = e, this._canvas = null, this._loaded = !!(e && e.src && e.complete)), this._size = new f(e ? e.naturalWidth || e.width : 0, e ? e.naturalHeight || e.height : 0), this._context = null, this._changed(1033)
},
getCanvas: function() {
if (!this._canvas) {
var e = ae.getContext(this._size);
try {
this._image && e.drawImage(this._image, 0, 0), this._canvas = e.canvas
} catch (t) {
ae.release(e)
}
}
return this._canvas
},
setCanvas: "#setImage",
getContext: function(e) {
return this._context || (this._context = this.getCanvas().getContext("2d")), e && (this._image = null, this._changed(1025)), this._context
},
setContext: function(e) {
this._context = e
},
getSource: function() {
var e = this._image;
return e && e.src || this.toDataURL()
},
setSource: function(e) {
var t = new a.Image,
A = this._crossOrigin;
A && (t.crossOrigin = A), t.src = e, this.setImage(t)
},
getCrossOrigin: function() {
var e = this._image;
return e && e.crossOrigin || this._crossOrigin || ""
},
setCrossOrigin: function(e) {
this._crossOrigin = e;
var t = this._image;
t && (t.crossOrigin = e)
},
getSmoothing: function() {
return this._smoothing
},
setSmoothing: function(e) {
this._smoothing = e, this._changed(257)
},
getElement: function() {
return this._canvas || this._loaded && this._image
}
}, {
beans: !1,
getSubCanvas: function() {
var e = w.read(arguments),
t = ae.getContext(e.getSize()),
A = Math.max(0, e.x),
o = Math.max(0, e.y),
n = Math.min(this.getCanvas().width, e.x + e.width),
i = Math.min(this.getCanvas().height, e.y + e.height);
return t.drawImage(this.getCanvas(), A, o, n - A, i - o, A - e.x, o - e.y, n - A, i - o), t.canvas
},
getSubRaster: function() {
var e = w.read(arguments),
t = new k(T.NO_INSERT);
return t._setImage(this.getSubCanvas(e)), t.translate(e.getCenter().subtract(this.getSize().divide(2))), t._matrix.prepend(this._matrix), t.insertAbove(this), t
},
toDataURL: function() {
var e = this._image,
t = e && e.src;
if (/^data:/.test(t)) return t;
var A = this.getCanvas();
return A ? A.toDataURL.apply(A, arguments) : null
},
drawImage: function(e) {
var t = E.read(arguments, 1);
this.getContext(!0).drawImage(e, t.x, t.y)
},
getAverageColor: function(e) {
var t, A;
if (e ? e instanceof L ? (A = e, t = e.getBounds()) : "object" == typeof e && ("width" in e ? t = new w(e) : "x" in e && (t = new w(e.x - .5, e.y - .5, 1, 1))) : t = this.getBounds(), !t) return null;
var o = Math.min(t.width, 32),
n = Math.min(t.height, 32),
i = k._sampleContext;
i ? i.clearRect(0, 0, 33, 33) : i = k._sampleContext = ae.getContext(new f(32)), i.save();
var a = (new y).scale(o / t.width, n / t.height).translate(-t.x, -t.y);
a.applyToContext(i), A && A.draw(i, new u({
clip: !0,
matrices: [a]
})), this._matrix.applyToContext(i);
var r = this.getElement(),
s = this._size;
r && i.drawImage(r, -s.width / 2, -s.height / 2), i.restore();
for (var l = i.getImageData(.5, .5, Math.ceil(o), Math.ceil(n)).data, c = [0, 0, 0], g = 0, d = 0, h = l.length; d < h; d += 4) {
var m = l[d + 3];
g += m, m /= 255, c[0] += l[d] * m, c[1] += l[d + 1] * m, c[2] += l[d + 2] * m
}
for (d = 0; d < 3; d++) c[d] /= g;
return g ? z.read(c) : null
},
getPixel: function() {
var e = E.read(arguments),
t = this.getContext().getImageData(e.x, e.y, 1, 1).data;
return new z("rgb", [t[0] / 255, t[1] / 255, t[2] / 255], t[3] / 255)
},
setPixel: function() {
var e = E.read(arguments),
t = z.read(arguments),
A = t._convert("rgb"),
o = t._alpha,
n = this.getContext(!0),
i = n.createImageData(1, 1),
a = i.data;
a[0] = 255 * A[0], a[1] = 255 * A[1], a[2] = 255 * A[2], a[3] = null != o ? 255 * o : 255, n.putImageData(i, e.x, e.y)
},
createImageData: function() {
var e = f.read(arguments);
return this.getContext().createImageData(e.width, e.height)
},
getImageData: function() {
var e = w.read(arguments);
return e.isEmpty() && (e = new w(this._size)), this.getContext().getImageData(e.x, e.y, e.width, e.height)
},
setImageData: function(e) {
var t = E.read(arguments, 1);
this.getContext(!0).putImageData(e, t.x, t.y)
},
_getBounds: function(e, t) {
var A = new w(this._size).setCenter(0, 0);
return e ? e._transformBounds(A) : A
},
_hitTestSelf: function(e) {
if (this._contains(e)) {
var t = this;
return new O("pixel", t, {
offset: e.add(t._size.divide(2)).round(),
color: {
get: function() {
return t.getPixel(this.offset)
}
}
})
}
},
_draw: function(e, t, A) {
var o = this.getElement();
o && (e.globalAlpha = this._opacity, this._setStyles(e, t, A), W.setPrefixed(e, "imageSmoothingEnabled", this._smoothing), e.drawImage(o, -this._size.width / 2, -this._size.height / 2))
},
_canComposite: function() {
return !0
}
}),
N = T.extend({
_class: "SymbolItem",
_applyMatrix: !1,
_canApplyMatrix: !1,
_boundsOptions: {
stroke: !0
},
_serializeFields: {
symbol: null
},
initialize: function(e, t) {
this._initialize(e, t !== r && E.read(arguments, 1)) || this.setDefinition(e instanceof v ? e : new v(e))
},
_equals: function(e) {
return this._definition === e._definition
},
copyContent: function(e) {
this.setDefinition(e._definition)
},
getDefinition: function() {
return this._definition
},
setDefinition: function(e) {
this._definition = e, this._changed(9)
},
getSymbol: "#getDefinition",
setSymbol: "#setDefinition",
isEmpty: function() {
return this._definition._item.isEmpty()
},
_getBounds: function(e, t) {
var A = this._definition._item;
return A._getCachedBounds(A._matrix.prepended(e), t)
},
_hitTestSelf: function(e, t, A) {
var o = this._definition._item._hitTest(e, t, A);
return o && (o.item = this), o
},
_draw: function(e, t) {
this._definition._item.draw(e, t)
}
}),
v = u.extend({
_class: "SymbolDefinition",
initialize: function(e, t) {
this._id = p.get(), this.project = ue.project, e && this.setItem(e, t)
},
_serialize: function(e, t) {
return t.add(this, function() {
return u.serialize([this._class, this._item], e, !1, t)
})
},
_changed: function(e) {
8 & e && T._clearBoundsCache(this), 1 & e && this.project._changed(e)
},
getItem: function() {
return this._item
},
setItem: function(e, t) {
e._symbol && (e = e.clone()), this._item && (this._item._symbol = null), this._item = e, e.remove(), e.setSelected(!1), t || e.setPosition(new E), e._symbol = this, this._changed(9)
},
getDefinition: "#getItem",
setDefinition: "#setItem",
place: function(e) {
return new N(this, e)
},
clone: function() {
return new v(this._item.clone(!1))
},
equals: function(e) {
return e === this || e && this._item.equals(e._item) || !1
}
}),
O = u.extend({
_class: "HitResult",
initialize: function(e, t, A) {
this.type = e, this.item = t, A && this.inject(A)
},
statics: {
getOptions: function(e) {
var t = e && u.read(e);
return u.set({
type: null,
tolerance: ue.settings.hitTolerance,
fill: !t,
stroke: !t,
segments: !t,
handles: !1,
ends: !1,
position: !1,
center: !1,
bounds: !1,
guides: !1,
selected: !1
}, t)
}
}
}),
R = u.extend({
_class: "Segment",
beans: !0,
_selection: 0,
initialize: function(e, t, A, o, n, i) {
var a, s, l, u, c = arguments.length;
c > 0 && (null == e || "object" == typeof e ? 1 === c && e && "point" in e ? (a = e.point, s = e.handleIn, l = e.handleOut, u = e.selection) : (a = e, s = t, l = A, u = o) : (a = [e, t], s = A !== r ? [A, o] : null, l = n !== r ? [n, i] : null)), new F(a, this, "_point"), new F(s, this, "_handleIn"), new F(l, this, "_handleOut"), u && this.setSelection(u)
},
_serialize: function(e, t) {
var A = this._point,
o = this._selection,
n = o || this.hasHandles() ? [A, this._handleIn, this._handleOut] : A;
return o && n.push(o), u.serialize(n, e, !0, t)
},
_changed: function(e) {
var t = this._path;
if (t) {
var A, o = t._curves,
n = this._index;
o && (e && e !== this._point && e !== this._handleIn || !(A = n > 0 ? o[n - 1] : t._closed ? o[o.length - 1] : null) || A._changed(), e && e !== this._point && e !== this._handleOut || !(A = o[n]) || A._changed()), t._changed(41)
}
},
getPoint: function() {
return this._point
},
setPoint: function() {
this._point.set(E.read(arguments))
},
getHandleIn: function() {
return this._handleIn
},
setHandleIn: function() {
this._handleIn.set(E.read(arguments))
},
getHandleOut: function() {
return this._handleOut
},
setHandleOut: function() {
this._handleOut.set(E.read(arguments))
},
hasHandles: function() {
return !this._handleIn.isZero() || !this._handleOut.isZero()
},
isSmooth: function() {
var e = this._handleIn,
t = this._handleOut;
return !e.isZero() && !t.isZero() && e.isCollinear(t)
},
clearHandles: function() {
this._handleIn._set(0, 0), this._handleOut._set(0, 0)
},
getSelection: function() {
return this._selection
},
setSelection: function(e) {
var t = this._selection,
A = this._path;
this._selection = e = e || 0, A && e !== t && (A._updateSelection(this, t, e), A._changed(257))
},
_changeSelection: function(e, t) {
var A = this._selection;
this.setSelection(t ? A | e : A & ~e)
},
isSelected: function() {
return !!(7 & this._selection)
},
setSelected: function(e) {
this._changeSelection(7, e)
},
getIndex: function() {
return this._index !== r ? this._index : null
},
getPath: function() {
return this._path || null
},
getCurve: function() {
var e = this._path,
t = this._index;
return e ? (t > 0 && !e._closed && t === e._segments.length - 1 && t--, e.getCurves()[t] || null) : null
},
getLocation: function() {
var e = this.getCurve();
return e ? new U(e, this === e._segment1 ? 0 : 1) : null
},
getNext: function() {
var e = this._path && this._path._segments;
return e && (e[this._index + 1] || this._path._closed && e[0]) || null
},
smooth: function(e, t, A) {
var o = e || {},
n = o.type,
i = o.factor,
a = this.getPrevious(),
s = this.getNext(),
l = (a || this)._point,
u = this._point,
c = (s || this)._point,
g = l.getDistance(u),
d = u.getDistance(c);
if (n && "catmull-rom" !== n) {
if ("geometric" !== n) throw new Error("Smoothing method '" + n + "' not supported.");
if (a && s) {
var h = l.subtract(c),
m = i === r ? .4 : i,
p = m * g / (g + d);
t || this.setHandleIn(h.multiply(p)), A || this.setHandleOut(h.multiply(p - m))
}
} else {
var B = i === r ? .5 : i,
f = Math.pow(g, B),
C = f * f,
w = Math.pow(d, B),
I = w * w;
if (!t && a) {
var y = 2 * I + 3 * w * f + C,
b = 3 * w * (w + f);
this.setHandleIn(0 !== b ? new E((I * l._x + y * u._x - C * c._x) / b - u._x, (I * l._y + y * u._y - C * c._y) / b - u._y) : new E)
}
if (!A && s) {
y = 2 * C + 3 * f * w + I, b = 3 * f * (f + w);
this.setHandleOut(0 !== b ? new E((C * c._x + y * u._x - I * l._x) / b - u._x, (C * c._y + y * u._y - I * l._y) / b - u._y) : new E)
}
}
},
getPrevious: function() {
var e = this._path && this._path._segments;
return e && (e[this._index - 1] || this._path._closed && e[e.length - 1]) || null
},
isFirst: function() {
return !this._index
},
isLast: function() {
var e = this._path;
return e && this._index === e._segments.length - 1 || !1
},
reverse: function() {
var e = this._handleIn,
t = this._handleOut,
A = e.clone();
e.set(t), t.set(A)
},
reversed: function() {
return new R(this._point, this._handleOut, this._handleIn)
},
remove: function() {
return !!this._path && !!this._path.removeSegment(this._index)
},
clone: function() {
return new R(this._point, this._handleIn, this._handleOut)
},
equals: function(e) {
return e === this || e && this._class === e._class && this._point.equals(e._point) && this._handleIn.equals(e._handleIn) && this._handleOut.equals(e._handleOut) || !1
},
toString: function() {
var e = ["point: " + this._point];
return this._handleIn.isZero() || e.push("handleIn: " + this._handleIn), this._handleOut.isZero() || e.push("handleOut: " + this._handleOut), "{ " + e.join(", ") + " }"
},
transform: function(e) {
this._transformCoordinates(e, new Array(6), !0), this._changed()
},
interpolate: function(e, t, A) {
var o = 1 - A,
n = A,
i = e._point,
a = t._point,
r = e._handleIn,
s = t._handleIn,
l = t._handleOut,
u = e._handleOut;
this._point._set(o * i._x + n * a._x, o * i._y + n * a._y, !0), this._handleIn._set(o * r._x + n * s._x, o * r._y + n * s._y, !0), this._handleOut._set(o * u._x + n * l._x, o * u._y + n * l._y, !0), this._changed()
},
_transformCoordinates: function(e, t, A) {
var o = this._point,
n = A && this._handleIn.isZero() ? null : this._handleIn,
i = A && this._handleOut.isZero() ? null : this._handleOut,
a = o._x,
r = o._y,
s = 2;
return t[0] = a, t[1] = r, n && (t[s++] = n._x + a, t[s++] = n._y + r), i && (t[s++] = i._x + a, t[s++] = i._y + r), e && (e._transformCoordinates(t, t, s / 2), a = t[0], r = t[1], A ? (o._x = a, o._y = r, s = 2, n && (n._x = t[s++] - a, n._y = t[s++] - r), i && (i._x = t[s++] - a, i._y = t[s++] - r)) : (n || (t[s++] = a, t[s++] = r), i || (t[s++] = a, t[s++] = r))), t
}
}),
F = E.extend({
initialize: function(e, t, A) {
var o, n, i;
if (e)
if ((o = e[0]) !== r) n = e[1];
else {
var a = e;
(o = a.x) === r && (o = (a = E.read(arguments)).x), n = a.y, i = a.selected
} else o = n = 0;
this._x = o, this._y = n, this._owner = t, t[A] = this, i && this.setSelected(!0)
},
_set: function(e, t) {
return this._x = e, this._y = t, this._owner._changed(this), this
},
getX: function() {
return this._x
},
setX: function(e) {
this._x = e, this._owner._changed(this)
},
getY: function() {
return this._y
},
setY: function(e) {
this._y = e, this._owner._changed(this)
},
isZero: function() {
var e = m.isZero;
return e(this._x) && e(this._y)
},
isSelected: function() {
return !!(this._owner._selection & this._getSelection())
},
setSelected: function(e) {
this._owner._changeSelection(this._getSelection(), e)
},
_getSelection: function() {
var e = this._owner;
return this === e._point ? 1 : this === e._handleIn ? 2 : this === e._handleOut ? 4 : 0
}
}),
Y = u.extend({
_class: "Curve",
beans: !0,
initialize: function(e, t, A, o, n, i, a, r) {
var s, l, u, c, g, d, h = arguments.length;
3 === h ? (this._path = e, s = t, l = A) : h ? 1 === h ? "segment1" in e ? (s = new R(e.segment1), l = new R(e.segment2)) : "point1" in e ? (u = e.point1, g = e.handle1, d = e.handle2, c = e.point2) : Array.isArray(e) && (u = [e[0], e[1]], c = [e[6], e[7]], g = [e[2] - e[0], e[3] - e[1]], d = [e[4] - e[6], e[5] - e[7]]) : 2 === h ? (s = new R(e), l = new R(t)) : 4 === h ? (u = e, g = t, d = A, c = o) : 8 === h && (u = [e, t], c = [a, r], g = [A - e, o - t], d = [n - a, i - r]) : (s = new R, l = new R), this._segment1 = s || new R(u, null, g), this._segment2 = l || new R(c, d, null)
},
_serialize: function(e, t) {
return u.serialize(this.hasHandles() ? [this.getPoint1(), this.getHandle1(), this.getHandle2(), this.getPoint2()] : [this.getPoint1(), this.getPoint2()], e, !0, t)
},
_changed: function() {
this._length = this._bounds = r
},
clone: function() {
return new Y(this._segment1, this._segment2)
},
toString: function() {
var e = ["point1: " + this._segment1._point];
return this._segment1._handleOut.isZero() || e.push("handle1: " + this._segment1._handleOut), this._segment2._handleIn.isZero() || e.push("handle2: " + this._segment2._handleIn), e.push("point2: " + this._segment2._point), "{ " + e.join(", ") + " }"
},
classify: function() {
return Y.classify(this.getValues())
},
remove: function() {
var e = !1;
if (this._path) {
var t = this._segment2,
A = t._handleOut;
(e = t.remove()) && this._segment1._handleOut.set(A)
}
return e
},
getPoint1: function() {
return this._segment1._point
},
setPoint1: function() {
this._segment1._point.set(E.read(arguments))
},
getPoint2: function() {
return this._segment2._point
},
setPoint2: function() {
this._segment2._point.set(E.read(arguments))
},
getHandle1: function() {
return this._segment1._handleOut
},
setHandle1: function() {
this._segment1._handleOut.set(E.read(arguments))
},
getHandle2: function() {
return this._segment2._handleIn
},
setHandle2: function() {
this._segment2._handleIn.set(E.read(arguments))
},
getSegment1: function() {
return this._segment1
},
getSegment2: function() {
return this._segment2
},
getPath: function() {
return this._path
},
getIndex: function() {
return this._segment1._index
},
getNext: function() {
var e = this._path && this._path._curves;
return e && (e[this._segment1._index + 1] || this._path._closed && e[0]) || null
},
getPrevious: function() {
var e = this._path && this._path._curves;
return e && (e[this._segment1._index - 1] || this._path._closed && e[e.length - 1]) || null
},
isFirst: function() {
return !this._segment1._index
},
isLast: function() {
var e = this._path;
return e && this._segment1._index === e._curves.length - 1 || !1
},
isSelected: function() {
return this.getPoint1().isSelected() && this.getHandle1().isSelected() && this.getHandle2().isSelected() && this.getPoint2().isSelected()
},
setSelected: function(e) {
this.getPoint1().setSelected(e), this.getHandle1().setSelected(e), this.getHandle2().setSelected(e), this.getPoint2().setSelected(e)
},
getValues: function(e) {
return Y.getValues(this._segment1, this._segment2, e)
},
getPoints: function() {
for (var e = this.getValues(), t = [], A = 0; A < 8; A += 2) t.push(new E(e[A], e[A + 1]));
return t
}
}, {
getLength: function() {
return null == this._length && (this._length = Y.getLength(this.getValues(), 0, 1)), this._length
},
getArea: function() {
return Y.getArea(this.getValues())
},
getLine: function() {
return new b(this._segment1._point, this._segment2._point)
},
getPart: function(e, t) {
return new Y(Y.getPart(this.getValues(), e, t))
},
getPartLength: function(e, t) {
return Y.getLength(this.getValues(), e, t)
},
divideAt: function(e) {
return this.divideAtTime(e && e.curve === this ? e.time : this.getTimeAt(e))
},
divideAtTime: function(e, t) {
var A = null;
if (e >= 1e-8 && e <= 1 - 1e-8) {
var o = Y.subdivide(this.getValues(), e),
n = o[0],
i = o[1],
a = t || this.hasHandles(),
r = this._segment1,
s = this._segment2,
l = this._path;
a && (r._handleOut._set(n[2] - n[0], n[3] - n[1]), s._handleIn._set(i[4] - i[6], i[5] - i[7]));
var u = n[6],
c = n[7],
g = new R(new E(u, c), a && new E(n[4] - u, n[5] - c), a && new E(i[2] - u, i[3] - c));
l ? (l.insert(r._index + 1, g), A = this.getNext()) : (this._segment2 = g, this._changed(), A = new Y(g, s))
}
return A
},
splitAt: function(e) {
var t = this._path;
return t ? t.splitAt(e) : null
},
splitAtTime: function(e) {
return this.splitAt(this.getLocationAtTime(e))
},
divide: function(e, t) {
return this.divideAtTime(e === r ? .5 : t ? e : this.getTimeAt(e))
},
split: function(e, t) {
return this.splitAtTime(e === r ? .5 : t ? e : this.getTimeAt(e))
},
reversed: function() {
return new Y(this._segment2.reversed(), this._segment1.reversed())
},
clearHandles: function() {
this._segment1._handleOut._set(0, 0), this._segment2._handleIn._set(0, 0)
},
statics: {
getValues: function(e, t, A, o) {
var n = e._point,
i = e._handleOut,
a = t._handleIn,
r = t._point,
s = n.x,
l = n.y,
u = r.x,
c = r.y,
g = o ? [s, l, s, l, u, c, u, c] : [s, l, s + i._x, l + i._y, u + a._x, c + a._y, u, c];
return A && A._transformCoordinates(g, g, 4), g
},
subdivide: function(e, t) {
var A = e[0],
o = e[1],
n = e[2],
i = e[3],
a = e[4],
s = e[5],
l = e[6],
u = e[7];
t === r && (t = .5);
var c = 1 - t,
g = c * A + t * n,
d = c * o + t * i,
h = c * n + t * a,
m = c * i + t * s,
p = c * a + t * l,
E = c * s + t * u,
B = c * g + t * h,
f = c * d + t * m,
C = c * h + t * p,
w = c * m + t * E,
I = c * B + t * C,
y = c * f + t * w;
return [
[A, o, g, d, B, f, I, y],
[I, y, C, w, p, E, l, u]
]
},
getMonoCurves: function(e, t) {
var A = [],
o = t ? 0 : 1,
n = e[o + 0],
i = e[o + 2],
a = e[o + 4],
r = e[o + 6];
if (n >= i == i >= a && i >= a == a >= r || Y.isStraight(e)) A.push(e);
else {
var s = 3 * (i - a) - n + r,
l = 2 * (n + a) - 4 * i,
u = i - n,
c = [],
g = m.solveQuadratic(s, l, u, c, 1e-8, 1 - 1e-8);
if (g) {
c.sort();
var d = c[0],
h = Y.subdivide(e, d);
A.push(h[0]), g > 1 && (d = (c[1] - d) / (1 - d), h = Y.subdivide(h[1], d), A.push(h[0])), A.push(h[1])
} else A.push(e)
}
return A
},
solveCubic: function(e, t, A, o, n, i) {
var a = e[t],
r = e[t + 2],
s = e[t + 4],
l = e[t + 6],
u = 0;
if (!(a < A && l < A && r < A && s < A || a > A && l > A && r > A && s > A)) {
var c = 3 * (r - a),
g = 3 * (s - r) - c,
d = l - a - c - g;
u = m.solveCubic(d, g, c, a - A, o, n, i)
}
return u
},
getTimeOf: function(e, t) {
var A = new E(e[0], e[1]),
o = new E(e[6], e[7]);
if (null === (t.isClose(A, 1e-12) ? 0 : t.isClose(o, 1e-12) ? 1 : null))
for (var n = [t.x, t.y], i = [], a = 0; a < 2; a++)
for (var r = Y.solveCubic(e, a, n[a], i, 0, 1), s = 0; s < r; s++) {
var l = i[s];
if (t.isClose(Y.getPoint(e, l), 1e-7)) return l
}
return t.isClose(A, 1e-7) ? 0 : t.isClose(o, 1e-7) ? 1 : null
},
getNearestTime: function(e, t) {
if (Y.isStraight(e)) {
var A = e[0],
o = e[1],
n = e[6] - A,
i = e[7] - o,
a = n * n + i * i;
if (0 === a) return 0;
var r = ((t.x - A) * n + (t.y - o) * i) / a;
return r < 1e-12 ? 0 : r > .999999999999 ? 1 : Y.getTimeOf(e, new E(A + r * n, o + r * i))
}
var s = 1 / 0,
l = 0;
function u(A) {
if (A >= 0 && A <= 1) {
var o = t.getDistance(Y.getPoint(e, A), !0);
if (o < s) return s = o, l = A, !0
}
}
for (var c = 0; c <= 100; c++) u(c / 100);
for (var g = .005; g > 1e-8;) u(l - g) || u(l + g) || (g /= 2);
return l
},
getPart: function(e, t, A) {
var o = t > A;
if (o) {
var n = t;
t = A, A = n
}
return t > 0 && (e = Y.subdivide(e, t)[1]), A < 1 && (e = Y.subdivide(e, (A - t) / (1 - t))[0]), o ? [e[6], e[7], e[4], e[5], e[2], e[3], e[0], e[1]] : e
},
isFlatEnough: function(e, t) {
var A = e[0],
o = e[1],
n = e[2],
i = e[3],
a = e[4],
r = e[5],
s = e[6],
l = e[7],
u = 3 * n - 2 * A - s,
c = 3 * i - 2 * o - l,
g = 3 * a - 2 * s - A,
d = 3 * r - 2 * l - o;
return Math.max(u * u, g * g) + Math.max(c * c, d * d) <= 16 * t * t
},
getArea: function(e) {
var t = e[0],
A = e[1],
o = e[2],
n = e[3],
i = e[4],
a = e[5],
r = e[6],
s = e[7];
return 3 * ((s - A) * (o + i) - (r - t) * (n + a) + n * (t - i) - o * (A - a) + s * (i + t / 3) - r * (a + A / 3)) / 20
},
getBounds: function(e) {
for (var t = e.slice(0, 2), A = t.slice(), o = [0, 0], n = 0; n < 2; n++) Y._addBounds(e[n], e[n + 2], e[n + 4], e[n + 6], n, 0, t, A, o);
return new w(t[0], t[1], A[0] - t[0], A[1] - t[1])
},
_addBounds: function(e, t, A, o, n, i, a, r, s) {
function l(e, t) {
var A = e - t,
o = e + t;
A < a[n] && (a[n] = A), o > r[n] && (r[n] = o)
}
i /= 2;
var u = a[n] - i,
c = r[n] + i;
if (e < u || t < u || A < u || o < u || e > c || t > c || A > c || o > c)
if (t < e != t < o && A < e != A < o) l(e, i), l(o, i);
else {
var g = 3 * (t - A) - e + o,
d = 2 * (e + A) - 4 * t,
h = t - e,
p = m.solveQuadratic(g, d, h, s);
l(o, 0);
for (var E = 0; E < p; E++) {
var B = s[E],
f = 1 - B;
1e-8 <= B && B <= 1 - 1e-8 && l(f * f * f * e + 3 * f * f * B * t + 3 * f * B * B * A + B * B * B * o, i)
}
}
}
}
}, u.each(["getBounds", "getStrokeBounds", "getHandleBounds"], function(e) {
this[e] = function() {
this._bounds || (this._bounds = {});
var t = this._bounds[e];
return t || (t = this._bounds[e] = G[e]([this._segment1, this._segment2], !1, this._path)), t.clone()
}
}, {}), u.each({
isStraight: function(e, t, A, o) {
if (t.isZero() && A.isZero()) return !0;
var n = o.subtract(e);
if (n.isZero()) return !1;
if (n.isCollinear(t) && n.isCollinear(A)) {
var i = new b(e, o);
if (i.getDistance(e.add(t)) < 1e-7 && i.getDistance(o.add(A)) < 1e-7) {
var a = n.dot(n),
r = n.dot(t) / a,
s = n.dot(A) / a;
return r >= 0 && r <= 1 && s <= 0 && s >= -1
}
}
return !1
},
isLinear: function(e, t, A, o) {
var n = o.subtract(e).divide(3);
return t.equals(n) && A.negate().equals(n)
}
}, function(e, t) {
this[t] = function(t) {
var A = this._segment1,
o = this._segment2;
return e(A._point, A._handleOut, o._handleIn, o._point, t)
}, this.statics[t] = function(t, A) {
var o = t[0],
n = t[1],
i = t[6],
a = t[7];
return e(new E(o, n), new E(t[2] - o, t[3] - n), new E(t[4] - i, t[5] - a), new E(i, a), A)
}
}, {
statics: {},
hasHandles: function() {
return !this._segment1._handleOut.isZero() || !this._segment2._handleIn.isZero()
},
hasLength: function(e) {
return (!this.getPoint1().equals(this.getPoint2()) || this.hasHandles()) && this.getLength() > (e || 0)
},
isCollinear: function(e) {
return e && this.isStraight() && e.isStraight() && this.getLine().isCollinear(e.getLine())
},
isHorizontal: function() {
return this.isStraight() && Math.abs(this.getTangentAtTime(.5).y) < 1e-8
},
isVertical: function() {
return this.isStraight() && Math.abs(this.getTangentAtTime(.5).x) < 1e-8
}
}), {
beans: !1,
getLocationAt: function(e, t) {
return this.getLocationAtTime(t ? e : this.getTimeAt(e))
},
getLocationAtTime: function(e) {
return null != e && e >= 0 && e <= 1 ? new U(this, e) : null
},
getTimeAt: function(e, t) {
return Y.getTimeAt(this.getValues(), e, t)
},
getParameterAt: "#getTimeAt",
getTimesWithTangent: function() {
var e = E.read(arguments);
return e.isZero() ? [] : Y.getTimesWithTangent(this.getValues(), e)
},
getOffsetAtTime: function(e) {
return this.getPartLength(0, e)
},
getLocationOf: function() {
return this.getLocationAtTime(this.getTimeOf(E.read(arguments)))
},
getOffsetOf: function() {
var e = this.getLocationOf.apply(this, arguments);
return e ? e.getOffset() : null
},
getTimeOf: function() {
return Y.getTimeOf(this.getValues(), E.read(arguments))
},
getParameterOf: "#getTimeOf",
getNearestLocation: function() {
var e = E.read(arguments),
t = this.getValues(),
A = Y.getNearestTime(t, e),
o = Y.getPoint(t, A);
return new U(this, A, o, null, e.getDistance(o))
},
getNearestPoint: function() {
var e = this.getNearestLocation.apply(this, arguments);
return e ? e.getPoint() : e
}
}, new function() {
var e = ["getPoint", "getTangent", "getNormal", "getWeightedTangent", "getWeightedNormal", "getCurvature"];
return u.each(e, function(e) {
this[e + "At"] = function(t, A) {
var o = this.getValues();
return Y[e](o, A ? t : Y.getTimeAt(o, t))
}, this[e + "AtTime"] = function(t) {
return Y[e](this.getValues(), t)
}
}, {
statics: {
_evaluateMethods: e
}
})
}, new function() {
function e(e) {
var t = e[0],
A = e[1],
o = e[2],
n = e[3],
i = e[4],
a = e[5],
r = 9 * (o - i) + 3 * (e[6] - t),
s = 6 * (t + i) - 12 * o,
l = 3 * (o - t),
u = 9 * (n - a) + 3 * (e[7] - A),
c = 6 * (A + a) - 12 * n,
g = 3 * (n - A);
return function(e) {
var t = (r * e + s) * e + l,
A = (u * e + c) * e + g;
return Math.sqrt(t * t + A * A)
}
}
function t(e, t) {
return Math.max(2, Math.min(16, Math.ceil(32 * Math.abs(t - e))))
}
function A(e, t, A, o) {
if (null == t || t < 0 || t > 1) return null;
var n = e[0],
i = e[1],
a = e[2],
r = e[3],
s = e[4],
l = e[5],
u = e[6],
c = e[7],
g = m.isZero;
g(a - n) && g(r - i) && (a = n, r = i), g(s - u) && g(l - c) && (s = u, l = c);
var d, h, p = 3 * (a - n),
B = 3 * (s - a) - p,
f = u - n - p - B,
C = 3 * (r - i),
w = 3 * (l - r) - C,
I = c - i - C - w;
if (0 === A) d = 0 === t ? n : 1 === t ? u : ((f * t + B) * t + p) * t + n, h = 0 === t ? i : 1 === t ? c : ((I * t + w) * t + C) * t + i;
else {
if (t < 1e-8 ? (d = p, h = C) : t > 1 - 1e-8 ? (d = 3 * (u - s), h = 3 * (c - l)) : (d = (3 * f * t + 2 * B) * t + p, h = (3 * I * t + 2 * w) * t + C), o) {
0 === d && 0 === h && (t < 1e-8 || t > 1 - 1e-8) && (d = s - a, h = l - r);
var y = Math.sqrt(d * d + h * h);
y && (d /= y, h /= y)
}
if (3 === A) {
s = 6 * f * t + 2 * B, l = 6 * I * t + 2 * w;
var b = Math.pow(d * d + h * h, 1.5);
d = 0 !== b ? (d * l - h * s) / b : 0, h = 0
}
}
return 2 === A ? new E(h, -d) : new E(d, h)
}
return {
statics: {
classify: function(e) {
var t = e[0],
A = e[1],
o = e[2],
n = e[3],
i = e[4],
a = e[5],
s = e[6],
l = e[7],
u = o * (A - l) + n * (s - t) + t * l - A * s,
c = 3 * (i * (n - A) + a * (t - o) + o * A - n * t),
g = c - u,
d = g - u + (t * (l - a) + A * (i - s) + s * a - l * i),
h = Math.sqrt(d * d + g * g + c * c),
p = 0 !== h ? 1 / h : 0,
E = m.isZero;
function B(e, t, A) {
var o = t !== r,
n = o && t > 0 && t < 1,
i = o && A > 0 && A < 1;
return !o || (n || i) && ("loop" !== e || n && i) || (e = "arch", n = i = !1), {
type: e,
roots: n || i ? n && i ? t < A ? [t, A] : [A, t] : [n ? t : A] : null
}
}
if (g *= p, c *= p, E(d *= p)) return E(g) ? B(E(c) ? "line" : "quadratic") : B("serpentine", c / (3 * g));
var f = 3 * g * g - 4 * d * c;
if (E(f)) return B("cusp", g / (2 * d));
var C = f > 0 ? Math.sqrt(f / 3) : Math.sqrt(-f),
w = 2 * d;
return B(f > 0 ? "serpentine" : "loop", (g + C) / w, (g - C) / w)
},
getLength: function(A, o, n, i) {
if (o === r && (o = 0), n === r && (n = 1), Y.isStraight(A)) {
var a = A;
n < 1 && (a = Y.subdivide(a, n)[0], o /= n), o > 0 && (a = Y.subdivide(a, o)[1]);
var s = a[6] - a[0],
l = a[7] - a[1];
return Math.sqrt(s * s + l * l)
}
return m.integrate(i || e(A), o, n, t(o, n))
},
getTimeAt: function(A, o, n) {
if (n === r && (n = o < 0 ? 1 : 0), 0 === o) return n;
var i = Math.abs,
a = o > 0,
s = a ? n : 0,
l = a ? 1 : n,
u = e(A),
c = Y.getLength(A, s, l, u),
g = i(o) - c;
if (i(g) < 1e-12) return a ? l : s;
if (g > 1e-12) return null;
var d = o / c,
h = 0;
return m.findRoot(function(e) {
return h += m.integrate(u, n, e, t(n, e)), n = e, h - o
}, u, n + d, s, l, 32, 1e-12)
},
getPoint: function(e, t) {
return A(e, t, 0, !1)
},
getTangent: function(e, t) {
return A(e, t, 1, !0)
},
getWeightedTangent: function(e, t) {
return A(e, t, 1, !1)
},
getNormal: function(e, t) {
return A(e, t, 2, !0)
},
getWeightedNormal: function(e, t) {
return A(e, t, 2, !1)
},
getCurvature: function(e, t) {
return A(e, t, 3, !1).x
},
getPeaks: function(e) {
var t = e[0],
A = e[1],
o = e[2],
n = e[3],
i = e[4],
a = e[5],
r = 3 * o - t - 3 * i + e[6],
s = 3 * t - 6 * o + 3 * i,
l = -3 * t + 3 * o,
u = 3 * n - A - 3 * a + e[7],
c = 3 * A - 6 * n + 3 * a,
g = -3 * A + 3 * n,
d = [];
return m.solveCubic(9 * (r * r + u * u), 9 * (r * s + c * u), 2 * (s * s + c * c) + 3 * (l * r + g * u), l * s + c * g, d, 1e-8, 1 - 1e-8), d.sort()
}
}
}
}, new function() {
function e(e, t, A, o, n, i, a) {
var r = !a && A.getPrevious() === n,
s = !a && A !== n && A.getNext() === n;
if (null !== o && o >= (r ? 1e-8 : 0) && o <= (s ? 1 - 1e-8 : 1) && null !== i && i >= (s ? 1e-8 : 0) && i <= (r ? 1 - 1e-8 : 1)) {
var l = new U(A, o, null, a),
u = new U(n, i, null, a);
l._intersection = u, u._intersection = l, t && !t(l) || U.insert(e, l, !0)
}
}
function t(e, t, o, n) {
return e[0][1] < o ? A(e, !0, o) : t[0][1] > n ? A(t, !1, n) : e[0][0]
}
function A(e, t, A) {
for (var o = e[0][0], n = e[0][1], i = 1, a = e.length; i < a; i++) {
var r = e[i][0],
s = e[i][1];
if (t ? s >= A : s <= A) return s === A ? r : o + (A - n) * (r - o) / (s - n);
o = r, n = s
}
return null
}
function o(e, t, A, o, n) {
var i = m.isZero;
if (i(o) && i(n)) {
var a = Y.getTimeOf(e, new E(t, A));
return null === a ? [] : [a]
}
for (var r = Math.atan2(-n, o), s = Math.sin(r), l = Math.cos(r), u = [], c = [], g = 0; g < 8; g += 2) {
var d = e[g] - t,
h = e[g + 1] - A;
u.push(d * l - h * s, d * s + h * l)
}
return Y.solveCubic(u, 1, 0, c, 0, 1), c
}
function n(A, n, i, r, s, l) {
var u = Math.min,
c = Math.max;
if (c(A[0], A[2], A[4], A[6]) + 1e-12 > u(n[0], n[2], n[4], n[6]) && u(A[0], A[2], A[4], A[6]) - 1e-12 < c(n[0], n[2], n[4], n[6]) && c(A[1], A[3], A[5], A[7]) + 1e-12 > u(n[1], n[3], n[5], n[7]) && u(A[1], A[3], A[5], A[7]) - 1e-12 < c(n[1], n[3], n[5], n[7])) {
var g = a(A, n);
if (g)
for (var d = 0; d < 2; d++) {
var h = g[d];
e(s, l, i, h[0], r, h[1], !0)
} else {
var m = Y.isStraight(A),
p = Y.isStraight(n),
B = m && p,
f = m && !p,
C = s.length;
if ((B ? function(t, A, o, n, i, a) {
var r = b.intersect(t[0], t[1], t[6], t[7], A[0], A[1], A[6], A[7]);
r && e(i, a, o, Y.getTimeOf(t, r), n, Y.getTimeOf(A, r))
} : m || p ? function(t, A, n, i, a, r, s) {
for (var l = A[0], u = A[1], c = o(t, l, u, A[6] - l, A[7] - u), g = 0, d = c.length; g < d; g++) {
var h = c[g],
m = Y.getPoint(t, h),
p = Y.getTimeOf(A, m);
null !== p && e(a, r, s ? i : n, s ? p : h, s ? n : i, s ? h : p)
}
} : function A(o, n, i, a, r, s, l, u, c, g, d, h, m) {
if (++c >= 4096 || ++u >= 40) return c;
var p, E, B = n[0],
f = n[1],
C = n[6],
w = n[7],
I = b.getSignedDistance,
y = I(B, f, C, w, n[2], n[3]),
M = I(B, f, C, w, n[4], n[5]),
T = y * M > 0 ? .75 : 4 / 9,
S = T * Math.min(0, y, M),
Q = T * Math.max(0, y, M),
D = I(B, f, C, w, o[0], o[1]),
k = I(B, f, C, w, o[2], o[3]),
N = I(B, f, C, w, o[4], o[5]),
v = I(B, f, C, w, o[6], o[7]),
O = function(e, t, A, o) {
var n, i = [0, e],
a = [1 / 3, t],
r = [2 / 3, A],
s = [1, o],
l = t - (2 * e + o) / 3,
u = A - (e + 2 * o) / 3;
if (l * u < 0) n = [
[i, a, s],
[i, r, s]
];
else {
var c = l / u;
n = [c >= 2 ? [i, a, s] : c <= .5 ? [i, r, s] : [i, a, r, s],
[i, s]
]
}
return (l || u) < 0 ? n.reverse() : n
}(D, k, N, v),
R = O[0],
F = O[1];
if (0 === y && 0 === M && 0 === D && 0 === k && 0 === N && 0 === v || null == (p = t(R, F, S, Q)) || null == (E = t(R.reverse(), F.reverse(), S, Q))) return c;
var U = g + (d - g) * p,
L = g + (d - g) * E;
if (Math.max(m - h, L - U) < 1e-9) {
var G = (U + L) / 2,
x = (h + m) / 2;
e(r, s, l ? a : i, l ? x : G, l ? i : a, l ? G : x)
} else if (o = Y.getPart(o, p, E), E - p > .8)
if (L - U > m - h) G = (U + L) / 2, c = A(n, (_ = Y.subdivide(o, .5))[0], a, i, r, s, !l, u, c, h, m, U, G), c = A(n, _[1], a, i, r, s, !l, u, c, h, m, G, L);
else {
var _;
x = (h + m) / 2, c = A((_ = Y.subdivide(n, .5))[0], o, a, i, r, s, !l, u, c, h, x, U, L), c = A(_[1], o, a, i, r, s, !l, u, c, x, m, U, L)
} else c = m - h >= 1e-9 ? A(n, o, a, i, r, s, !l, u, c, h, m, U, L) : A(o, n, i, a, r, s, l, u, c, U, L, h, m);
return c
})(f ? n : A, f ? A : n, f ? r : i, f ? i : r, s, l, f, 0, 0, 0, 1, 0, 1), !B || s.length === C)
for (d = 0; d < 4; d++) {
var w = d >> 1,
I = 1 & d,
y = 6 * w,
M = 6 * I,
T = new E(A[y], A[y + 1]),
S = new E(n[M], n[M + 1]);
T.isClose(S, 1e-12) && e(s, l, i, w, r, I)
}
}
}
return s
}
function i(t, A, o, n) {
var i = Y.classify(t);
if ("loop" === i.type) {
var a = i.roots;
e(o, n, A, a[0], A, a[1])
}
return o
}
function a(e, t) {
function A(e) {
var t = e[6] - e[0],
A = e[7] - e[1];
return t * t + A * A
}
var o = Math.abs,
n = b.getDistance,
i = Y.isStraight(e),
a = Y.isStraight(t),
r = i && a,
s = A(e) < A(t),
l = s ? t : e,
u = s ? e : t,
c = l[0],
g = l[1],
d = l[6] - c,
h = l[7] - g;
if (n(c, g, d, h, u[0], u[1], !0) < 1e-7 && n(c, g, d, h, u[6], u[7], !0) < 1e-7) !r && n(c, g, d, h, l[2], l[3], !0) < 1e-7 && n(c, g, d, h, l[4], l[5], !0) < 1e-7 && n(c, g, d, h, u[2], u[3], !0) < 1e-7 && n(c, g, d, h, u[4], u[5], !0) < 1e-7 && (i = a = r = !0);
else if (r) return null;
if (i ^ a) return null;
for (var m = [e, t], p = [], B = 0; B < 4 && p.length < 2; B++) {
var f = 1 & B,
C = 1 ^ f,
w = B >> 1,
I = Y.getTimeOf(m[f], new E(m[C][w ? 6 : 0], m[C][w ? 7 : 1]));
if (null != I) {
var y = f ? [w, I] : [I, w];
(!p.length || o(y[0] - p[0][0]) > 1e-8 && o(y[1] - p[0][1]) > 1e-8) && p.push(y)
}
if (B > 2 && !p.length) break
}
if (2 !== p.length) p = null;
else if (!r) {
var M = Y.getPart(e, p[0][0], p[1][0]),
T = Y.getPart(t, p[0][1], p[1][1]);
(o(T[2] - M[2]) > 1e-7 || o(T[3] - M[3]) > 1e-7 || o(T[4] - M[4]) > 1e-7 || o(T[5] - M[5]) > 1e-7) && (p = null)
}
return p
}
return {
getIntersections: function(e) {
var t = this.getValues(),
A = e && e !== this && e.getValues();
return A ? n(t, A, this, e, []) : i(t, this, [])
},
statics: {
getOverlaps: a,
getIntersections: function(e, t, A, o, a, r) {
var s = !t;
s && (t = e);
for (var l, c, g = e.length, d = t.length, h = [], m = [], p = 0; p < d; p++) h[p] = t[p].getValues(a);
for (p = 0; p < g; p++) {
var E = e[p],
B = s ? h[p] : E.getValues(o),
f = E.getPath();
f !== c && (c = f, l = [], m.push(l)), s && i(B, E, l, A);
for (var C = s ? p + 1 : 0; C < d; C++) {
if (r && l.length) return l;
n(B, h[C], E, t[C], l, A)
}
}
l = [], p = 0;
for (var w = m.length; p < w; p++) u.push(l, m[p]);
return l
},
getCurveLineIntersections: o,
getTimesWithTangent: function(e, t) {
var A = e[0],
o = e[1],
n = e[2],
i = e[3],
a = e[4],
r = e[5],
s = e[6],
l = e[7],
u = t.normalize(),
c = u.x,
g = u.y,
d = 3 * s - 9 * a + 9 * n - 3 * A,
h = 3 * l - 9 * r + 9 * i - 3 * o,
p = 6 * a - 12 * n + 6 * A,
E = 6 * r - 12 * i + 6 * o,
B = 3 * n - 3 * A,
f = 3 * i - 3 * o,
C = 2 * d * g - 2 * h * c,
w = [];
if (Math.abs(C) < m.CURVETIME_EPSILON) {
if (0 != (C = d * E - h * p)) {
var I = -(d * f - h * B) / C;
I >= 0 && I <= 1 && w.push(I)
}
} else {
var y = (p * p - 4 * d * B) * g * g + (-2 * p * E + 4 * h * B + 4 * d * f) * c * g + (E * E - 4 * h * f) * c * c,
b = p * g - E * c;
if (y >= 0 && 0 != C) {
var M = Math.sqrt(y),
T = -(b + M) / C,
S = (-b + M) / C;
T >= 0 && T <= 1 && w.push(T), S >= 0 && S <= 1 && w.push(S)
}
}
return w
}
}
}
}),
U = u.extend({
_class: "CurveLocation",
initialize: function(e, t, A, o, n) {
if (t >= .99999999) {
var i = e.getNext();
i && (t = 0, e = i)
}
this._setCurve(e), this._time = t, this._point = A || e.getPointAtTime(t), this._overlap = o, this._distance = n, this._intersection = this._next = this._previous = null
},
_setCurve: function(e) {
var t = e._path;
this._path = t, this._version = t ? t._version : 0, this._curve = e, this._segment = null, this._segment1 = e._segment1, this._segment2 = e._segment2
},
_setSegment: function(e) {
this._setCurve(e.getCurve()), this._segment = e, this._time = e === this._segment1 ? 0 : 1, this._point = e._point.clone()
},
getSegment: function() {
var e = this._segment;
if (!e) {
var t = this.getCurve(),
A = this.getTime();
0 === A ? e = t._segment1 : 1 === A ? e = t._segment2 : null != A && (e = t.getPartLength(0, A) < t.getPartLength(A, 1) ? t._segment1 : t._segment2), this._segment = e
}
return e
},
getCurve: function() {
var e = this._path,
t = this;
function A(e) {
var A = e && e.getCurve();
if (A && null != (t._time = A.getTimeOf(t._point))) return t._setCurve(A), A
}
return e && e._version !== this._version && (this._time = this._offset = this._curveOffset = this._curve = null), this._curve || A(this._segment) || A(this._segment1) || A(this._segment2.getPrevious())
},
getPath: function() {
var e = this.getCurve();
return e && e._path
},
getIndex: function() {
var e = this.getCurve();
return e && e.getIndex()
},
getTime: function() {
var e = this.getCurve(),
t = this._time;
return e && null == t ? this._time = e.getTimeOf(this._point) : t
},
getParameter: "#getTime",
getPoint: function() {
return this._point
},
getOffset: function() {
var e = this._offset;
if (null == e) {
e = 0;
var t = this.getPath(),
A = this.getIndex();
if (t && null != A)
for (var o = t.getCurves(), n = 0; n < A; n++) e += o[n].getLength();
this._offset = e += this.getCurveOffset()
}
return e
},
getCurveOffset: function() {
var e = this._curveOffset;
if (null == e) {
var t = this.getCurve(),
A = this.getTime();
this._curveOffset = e = null != A && t && t.getPartLength(0, A)
}
return e
},
getIntersection: function() {
return this._intersection
},
getDistance: function() {
return this._distance
},
divide: function() {
var e = this.getCurve(),
t = e && e.divideAtTime(this.getTime());
return t && this._setSegment(t._segment1), t
},
split: function() {
var e = this.getCurve(),
t = e._path,
A = e && e.splitAtTime(this.getTime());
return A && this._setSegment(t.getLastSegment()), A
},
equals: function(e, t) {
var A = this === e;
if (!A && e instanceof U) {
var o = this.getCurve(),
n = e.getCurve(),
i = o._path;
if (i === n._path) {
var a = Math.abs,
r = a(this.getOffset() - e.getOffset()),
s = !t && this._intersection,
l = !t && e._intersection;
A = (r < 1e-7 || i && a(i.getLength() - r) < 1e-7) && (!s && !l || s && l && s.equals(l, !0))
}
}
return A
},
toString: function() {
var e = [],
t = this.getPoint(),
A = h.instance;
t && e.push("point: " + t);
var o = this.getIndex();
null != o && e.push("index: " + o);
var n = this.getTime();
return null != n && e.push("time: " + A.number(n)), null != this._distance && e.push("distance: " + A.number(this._distance)), "{ " + e.join(", ") + " }"
},
isTouching: function() {
var e = this._intersection;
if (e && this.getTangent().isCollinear(e.getTangent())) {
var t = this.getCurve(),
A = e.getCurve();
return !(t.isStraight() && A.isStraight() && t.getLine().intersect(A.getLine()))
}
return !1
},
isCrossing: function() {
var e = this._intersection;
if (!e) return !1;
var t = this.getTime(),
A = e.getTime(),
o = t >= 1e-8 && t <= 1 - 1e-8,
n = A >= 1e-8 && A <= 1 - 1e-8;
if (o && n) return !this.isTouching();
var i = this.getCurve(),
a = t < 1e-8 ? i.getPrevious() : i,
r = e.getCurve(),
s = A < 1e-8 ? r.getPrevious() : r;
if (t > 1 - 1e-8 && (i = i.getNext()), A > 1 - 1e-8 && (r = r.getNext()), !(a && i && s && r)) return !1;
var l = [];
function u(e, t) {
var A = e.getValues(),
o = Y.classify(A).roots || Y.getPeaks(A),
n = o.length,
i = t && n > 1 ? o[n - 1] : n > 0 ? o[0] : .5;
l.push(Y.getLength(A, t ? i : 0, t ? 1 : i) / 2)
}
function c(e, t, A) {
return t < A ? e > t && e < A : e > t || e < A
}
o || (u(a, !0), u(i, !1)), n || (u(s, !0), u(r, !1));
var g = this.getPoint(),
d = Math.min.apply(Math, l),
h = o ? i.getTangentAtTime(t) : i.getPointAt(d).subtract(g),
m = o ? h.negate() : a.getPointAt(-d).subtract(g),
p = n ? r.getTangentAtTime(A) : r.getPointAt(d).subtract(g),
E = n ? p.negate() : s.getPointAt(-d).subtract(g),
B = m.getAngle(),
f = h.getAngle(),
C = E.getAngle(),
w = p.getAngle();
return !!(o ? c(B, C, w) ^ c(f, C, w) && c(B, w, C) ^ c(f, w, C) : c(C, B, f) ^ c(w, B, f) && c(C, f, B) ^ c(w, f, B))
},
hasOverlap: function() {
return !!this._overlap
}
}, u.each(Y._evaluateMethods, function(e) {
var t = e + "At";
this[e] = function() {
var e = this.getCurve(),
A = this.getTime();
return null != A && e && e[t](A, !0)
}
}, {
preserve: !0
}), new function() {
function e(e, t, A) {
var o = e.length,
n = 0,
i = o - 1;
function a(A, n) {
for (var i = A + n; i >= -1 && i <= o; i += n) {
var a = e[(i % o + o) % o];
if (!t.getPoint().isClose(a.getPoint(), 1e-7)) break;
if (t.equals(a)) return a
}
return null
}
for (; n <= i;) {
var r, s = n + i >>> 1,
l = e[s];
if (A && (r = t.equals(l) ? l : a(s, -1) || a(s, 1))) return t._overlap && (r._overlap = r._intersection._overlap = !0), r;
var u = t.getPath(),
c = l.getPath();
(u !== c ? u._id - c._id : t.getIndex() + t.getTime() - (l.getIndex() + l.getTime())) < 0 ? i = s - 1 : n = s + 1
}
return e.splice(n, 0, t), t
}
return {
statics: {
insert: e,
expand: function(t) {
for (var A = t.slice(), o = t.length - 1; o >= 0; o--) e(A, t[o]._intersection, !1);
return A
}
}
}
}),
L = T.extend({
_class: "PathItem",
_selectBounds: !1,
_canScaleStroke: !0,
beans: !0,
initialize: function() {},
statics: {
create: function(e) {
var t, A, o;
if (u.isPlainObject(e) ? (A = e.segments, t = e.pathData) : Array.isArray(e) ? A = e : "string" == typeof e && (t = e), A) {
var n = A[0];
o = n && Array.isArray(n[0])
} else t && (o = (t.match(/m/gi) || []).length > 1 || /z\s*\S+/i.test(t));
return new(o ? x : G)(e)
}
},
_asPathItem: function() {
return this
},
isClockwise: function() {
return this.getArea() >= 0
},
setClockwise: function(e) {
this.isClockwise() != (e = !!e) && this.reverse()
},
setPathData: function(e) {
var t, A, o, n = e && e.match(/[mlhvcsqtaz][^mlhvcsqtaz]*/gi),
i = !1,
a = new E,
r = new E;
function s(e, A) {
var o = +t[e];
return i && (o += a[A]), o
}
function l(e) {
return new E(s(e, "x"), s(e + 1, "y"))
}
this.clear();
for (var u = 0, c = n && n.length; u < c; u++) {
var g = n[u],
d = g[0],
h = d.toLowerCase(),
m = (t = g.match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g)) && t.length;
switch (i = d === h, "z" !== A || /[mz]/.test(h) || this.moveTo(a), h) {
case "m":
case "l":
for (var p = "m" === h, B = 0; B < m; B += 2) this[p ? "moveTo" : "lineTo"](a = l(B)), p && (r = a, p = !1);
o = a;
break;
case "h":
case "v":
var C = "h" === h ? "x" : "y";
a = a.clone();
for (B = 0; B < m; B++) a[C] = s(B, C), this.lineTo(a);
o = a;
break;
case "c":
for (B = 0; B < m; B += 6) this.cubicCurveTo(l(B), o = l(B + 2), a = l(B + 4));
break;
case "s":
for (B = 0; B < m; B += 4) this.cubicCurveTo(/[cs]/.test(A) ? a.multiply(2).subtract(o) : a, o = l(B), a = l(B + 2)), A = h;
break;
case "q":
for (B = 0; B < m; B += 4) this.quadraticCurveTo(o = l(B), a = l(B + 2));
break;
case "t":
for (B = 0; B < m; B += 2) this.quadraticCurveTo(o = /[qt]/.test(A) ? a.multiply(2).subtract(o) : a, a = l(B)), A = h;
break;
case "a":
for (B = 0; B < m; B += 7) this.arcTo(a = l(B + 5), new f(+t[B], +t[B + 1]), +t[B + 2], +t[B + 4], +t[B + 3]);
break;
case "z":
this.closePath(1e-12), a = r
}
A = h
}
},
_canComposite: function() {
return !(this.hasFill() && this.hasStroke())
},
_contains: function(e) {
var t = e.isInside(this.getBounds({
internal: !0,
handle: !0
})) ? this._getWinding(e) : {};
return t.onPath || !!("evenodd" === this.getFillRule() ? 1 & t.windingL || 1 & t.windingR : t.winding)
},
getIntersections: function(e, t, A, o) {
var n = this === e || !e,
i = this._matrix._orNullIfIdentity(),
a = n ? i : (A || e._matrix)._orNullIfIdentity();
return n || this.getBounds(i).intersects(e.getBounds(a), 1e-12) ? Y.getIntersections(this.getCurves(), !n && e.getCurves(), t, i, a, o) : []
},
getCrossings: function(e) {
return this.getIntersections(e, function(e) {
return e.hasOverlap() || e.isCrossing()
})
},
getNearestLocation: function() {
for (var e = E.read(arguments), t = this.getCurves(), A = 1 / 0, o = null, n = 0, i = t.length; n < i; n++) {
var a = t[n].getNearestLocation(e);
a._distance < A && (A = a._distance, o = a)
}
return o
},
getNearestPoint: function() {
var e = this.getNearestLocation.apply(this, arguments);
return e ? e.getPoint() : e
},
interpolate: function(e, t, A) {
var o = !this._children,
n = o ? "_segments" : "_children",
i = e[n],
a = t[n],
r = this[n];
if (!i || !a || i.length !== a.length) throw new Error("Invalid operands in interpolate() call: " + e + ", " + t);
var s = r.length,
l = a.length;
if (s < l)
for (var u = o ? R : G, c = s; c < l; c++) this.add(new u);
else s > l && this[o ? "removeSegments" : "removeChildren"](l, s);
for (c = 0; c < l; c++) r[c].interpolate(i[c], a[c], A);
o && (this.setClosed(e._closed), this._changed(9))
},
compare: function(e) {
var t = !1;
if (e) {
var A = this._children || [this],
o = e._children ? e._children.slice() : [e],
n = A.length,
i = o.length,
a = [],
r = 0;
t = !0;
for (var s = n - 1; s >= 0 && t; s--) {
var l = A[s];
t = !1;
for (var u = i - 1; u >= 0 && !t; u--) l.compare(o[u]) && (a[u] || (a[u] = !0, r++), t = !0)
}
t = t && r === i
}
return t
}
}),
G = L.extend({
_class: "Path",
_serializeFields: {
segments: [],
closed: !1
},
initialize: function(e) {
this._closed = !1, this._segments = [], this._version = 0;
var t = Array.isArray(e) ? "object" == typeof e[0] ? e : arguments : !e || e.size !== r || e.x === r && e.point === r ? null : arguments;
t && t.length > 0 ? this.setSegments(t) : (this._curves = r, this._segmentSelection = 0, t || "string" != typeof e || (this.setPathData(e), e = null)), this._initialize(!t && e)
},
_equals: function(e) {
return this._closed === e._closed && u.equals(this._segments, e._segments)
},
copyContent: function(e) {
this.setSegments(e._segments), this._closed = e._closed
},
_changed: function e(t) {
if (e.base.call(this, t), 8 & t) {
if (this._length = this._area = r, 32 & t) this._version++;
else if (this._curves)
for (var A = 0, o = this._curves.length; A < o; A++) this._curves[A]._changed()
} else 64 & t && (this._bounds = r)
},
getStyle: function() {
var e = this._parent;
return (e instanceof x ? e : this)._style
},
getSegments: function() {
return this._segments
},
setSegments: function(e) {
var t = this.isFullySelected(),
A = e && e.length;
if (this._segments.length = 0, this._segmentSelection = 0, this._curves = r, A) {
var o = e[A - 1];
"boolean" == typeof o && (this.setClosed(o), A--), this._add(R.readList(e, 0, {}, A))
}
t && this.setFullySelected(!0)
},
getFirstSegment: function() {
return this._segments[0]
},
getLastSegment: function() {
return this._segments[this._segments.length - 1]
},
getCurves: function() {
var e = this._curves,
t = this._segments;
if (!e) {
var A = this._countCurves();
e = this._curves = new Array(A);
for (var o = 0; o < A; o++) e[o] = new Y(this, t[o], t[o + 1] || t[0])
}
return e
},
getFirstCurve: function() {
return this.getCurves()[0]
},
getLastCurve: function() {
var e = this.getCurves();
return e[e.length - 1]
},
isClosed: function() {
return this._closed
},
setClosed: function(e) {
if (this._closed != (e = !!e)) {
if (this._closed = e, this._curves) {
var t = this._curves.length = this._countCurves();
e && (this._curves[t - 1] = new Y(this, this._segments[t - 1], this._segments[0]))
}
this._changed(41)
}
}
}, {
beans: !0,
getPathData: function(e, t) {
var A, o, n, i, a, r, s, l, u = this._segments,
c = u.length,
g = new h(t),
d = new Array(6),
m = !0,
p = [];
function E(t, u) {
if (t._transformCoordinates(e, d), A = d[0], o = d[1], m) p.push("M" + g.pair(A, o)), m = !1;
else if (a = d[2], r = d[3], a === A && r === o && s === n && l === i) {
if (!u) {
var c = A - n,
h = o - i;
p.push(0 === c ? "v" + g.number(h) : 0 === h ? "h" + g.number(c) : "l" + g.pair(c, h))
}
} else p.push("c" + g.pair(s - n, l - i) + " " + g.pair(a - n, r - i) + " " + g.pair(A - n, o - i));
n = A, i = o, s = d[4], l = d[5]
}
if (!c) return "";
for (var B = 0; B < c; B++) E(u[B]);
return this._closed && c > 0 && (E(u[0], !0), p.push("z")), p.join("")
},
isEmpty: function() {
return !this._segments.length
},
_transformContent: function(e) {
for (var t = this._segments, A = new Array(6), o = 0, n = t.length; o < n; o++) t[o]._transformCoordinates(e, A, !0);
return !0
},
_add: function(e, t) {
for (var A = this._segments, o = this._curves, n = e.length, i = null == t, a = (t = i ? A.length : t, 0); a < n; a++) {
var r = e[a];
r._path && (r = e[a] = r.clone()), r._path = this, r._index = t + a, r._selection && this._updateSelection(r, 0, r._selection)
}
if (i) u.push(A, e);
else {
A.splice.apply(A, [t, 0].concat(e));
a = t + n;
for (var s = A.length; a < s; a++) A[a]._index = a
}
if (o) {
var l = this._countCurves(),
c = t > 0 && t + n - 1 === l ? t - 1 : t,
g = c,
d = Math.min(c + n, l);
e._curves && (o.splice.apply(o, [c, 0].concat(e._curves)), g += e._curves.length);
for (a = g; a < d; a++) o.splice(a, 0, new Y(this, null, null));
this._adjustCurves(c, d)
}
return this._changed(41), e
},
_adjustCurves: function(e, t) {
for (var A, o = this._segments, n = this._curves, i = e; i < t; i++)(A = n[i])._path = this, A._segment1 = o[i], A._segment2 = o[i + 1] || o[0], A._changed();
(A = n[this._closed && !e ? o.length - 1 : e - 1]) && (A._segment2 = o[e] || o[0], A._changed()), (A = n[t]) && (A._segment1 = o[t], A._changed())
},
_countCurves: function() {
var e = this._segments.length;
return !this._closed && e > 0 ? e - 1 : e
},
add: function(e) {
return arguments.length > 1 && "number" != typeof e ? this._add(R.readList(arguments)) : this._add([R.read(arguments)])[0]
},
insert: function(e, t) {
return arguments.length > 2 && "number" != typeof t ? this._add(R.readList(arguments, 1), e) : this._add([R.read(arguments, 1)], e)[0]
},
addSegment: function() {
return this._add([R.read(arguments)])[0]
},
insertSegment: function(e) {
return this._add([R.read(arguments, 1)], e)[0]
},
addSegments: function(e) {
return this._add(R.readList(e))
},
insertSegments: function(e, t) {
return this._add(R.readList(t), e)
},
removeSegment: function(e) {
return this.removeSegments(e, e + 1)[0] || null
},
removeSegments: function(e, t, A) {
e = e || 0, t = u.pick(t, this._segments.length);
var o = this._segments,
n = this._curves,
i = o.length,
a = o.splice(e, t - e),
r = a.length;
if (!r) return a;
for (var s = 0; s < r; s++) {
var l = a[s];
l._selection && this._updateSelection(l, l._selection, 0), l._index = l._path = null
}
s = e;
for (var c = o.length; s < c; s++) o[s]._index = s;
if (n) {
var g = e > 0 && t === i + (this._closed ? 1 : 0) ? e - 1 : e;
for (s = (n = n.splice(g, r)).length - 1; s >= 0; s--) n[s]._path = null;
A && (a._curves = n.slice(1)), this._adjustCurves(g, g)
}
return this._changed(41), a
},
clear: "#removeSegments",
hasHandles: function() {
for (var e = this._segments, t = 0, A = e.length; t < A; t++)
if (e[t].hasHandles()) return !0;
return !1
},
clearHandles: function() {
for (var e = this._segments, t = 0, A = e.length; t < A; t++) e[t].clearHandles()
},
getLength: function() {
if (null == this._length) {
for (var e = this.getCurves(), t = 0, A = 0, o = e.length; A < o; A++) t += e[A].getLength();
this._length = t
}
return this._length
},
getArea: function() {
var e = this._area;
if (null == e) {
var t = this._segments,
A = this._closed;
e = 0;
for (var o = 0, n = t.length; o < n; o++) {
var i = o + 1 === n;
e += Y.getArea(Y.getValues(t[o], t[i ? 0 : o + 1], null, i && !A))
}
this._area = e
}
return e
},
isFullySelected: function() {
var e = this._segments.length;
return this.isSelected() && e > 0 && this._segmentSelection === 7 * e
},
setFullySelected: function(e) {
e && this._selectSegments(!0), this.setSelected(e)
},
setSelection: function e(t) {
1 & t || this._selectSegments(!1), e.base.call(this, t)
},
_selectSegments: function(e) {
var t = this._segments,
A = t.length,
o = e ? 7 : 0;
this._segmentSelection = o * A;
for (var n = 0; n < A; n++) t[n]._selection = o
},
_updateSelection: function(e, t, A) {
e._selection = A, (this._segmentSelection += A - t) > 0 && this.setSelected(!0)
},
divideAt: function(e) {
var t, A = this.getLocationAt(e);
return A && (t = A.getCurve().divideAt(A.getCurveOffset())) ? t._segment1 : null
},
splitAt: function(e) {
var t = this.getLocationAt(e),
A = t && t.index,
o = t && t.time;
o > 1 - 1e-8 && (A++, o = 0);
var n = this.getCurves();
if (A >= 0 && A < n.length) {
o >= 1e-8 && n[A++].divideAtTime(o);
var i, a = this.removeSegments(A, this._segments.length, !0);
return this._closed ? (this.setClosed(!1), i = this) : ((i = new G(T.NO_INSERT)).insertAbove(this), i.copyAttributes(this)), i._add(a, 0), this.addSegment(a[0]), i
}
return null
},
split: function(e, t) {
var A, o = t === r ? e : (A = this.getCurves()[e]) && A.getLocationAtTime(t);
return null != o ? this.splitAt(o) : null
},
join: function(e, t) {
var A = t || 0;
if (e && e !== this) {
var o = e._segments,
n = this.getLastSegment(),
i = e.getLastSegment();
if (!i) return this;
n && n._point.isClose(i._point, A) && e.reverse();
var a = e.getFirstSegment();
if (n && n._point.isClose(a._point, A)) n.setHandleOut(a._handleOut), this._add(o.slice(1));
else {
var r = this.getFirstSegment();
r && r._point.isClose(a._point, A) && e.reverse(), i = e.getLastSegment(), r && r._point.isClose(i._point, A) ? (r.setHandleIn(i._handleIn), this._add(o.slice(0, o.length - 1), 0)) : this._add(o.slice())
}
e._closed && this._add([o[0]]), e.remove()
}
var s = this.getFirstSegment(),
l = this.getLastSegment();
return s !== l && s._point.isClose(l._point, A) && (s.setHandleIn(l._handleIn), l.remove(), this.setClosed(!0)), this
},
reduce: function(e) {
for (var t = this.getCurves(), A = e && e.simplify, o = A ? 1e-7 : 0, n = t.length - 1; n >= 0; n--) {
var i = t[n];
!i.hasHandles() && (!i.hasLength(o) || A && i.isCollinear(i.getNext())) && i.remove()
}
return this
},
reverse: function() {
this._segments.reverse();
for (var e = 0, t = this._segments.length; e < t; e++) {
var A = this._segments[e],
o = A._handleIn;
A._handleIn = A._handleOut, A._handleOut = o, A._index = e
}
this._curves = null, this._changed(9)
},
flatten: function(e) {
for (var t = new _(this, e || .25, 256, !0).parts, A = t.length, o = [], n = 0; n < A; n++) o.push(new R(t[n].curve.slice(0, 2)));
!this._closed && A > 0 && o.push(new R(t[A - 1].curve.slice(6))), this.setSegments(o)
},
simplify: function(e) {
var t = new P(this).fit(e || 2.5);
return t && this.setSegments(t), !!t
},
smooth: function(e) {
var t = this,
A = e || {},
o = A.type || "asymmetric",
n = this._segments,
i = n.length,
a = this._closed;
function s(e, A) {
var o = e && e.index;
if (null != o) {
var n = e.path;
if (n && n !== t) throw new Error(e._class + " " + o + " of " + n + " is not part of " + t);
A && e instanceof Y && o++
} else o = "number" == typeof e ? e : A;
return Math.min(o < 0 && a ? o % i : o < 0 ? o + i : o, i - 1)
}
var l = a && A.from === r && A.to === r,
u = s(A.from, 0),
c = s(A.to, i - 1);
if (u > c)
if (a) u -= i;
else {
var g = u;
u = c, c = g
}
if (/^(?:asymmetric|continuous)$/.test(o)) {
var d = "asymmetric" === o,
h = Math.min,
m = c - u + 1,
p = m - 1,
E = l ? h(m, 4) : 1,
B = E,
f = E,
C = [];
if (a || (B = h(1, u), f = h(1, i - c - 1)), (p += B + f) <= 1) return;
for (var w = 0, I = u - B; w <= p; w++, I++) C[w] = n[(I < 0 ? I + i : I) % i]._point;
var y = C[0]._x + 2 * C[1]._x,
b = C[0]._y + 2 * C[1]._y,
M = 2,
T = p - 1,
S = [y],
Q = [b],
D = [M],
k = [],
N = [];
for (w = 1; w < p; w++) {
var v = w < T,
O = v ? 4 : d ? 2 : 7,
R = v ? 4 : d ? 3 : 8,
F = v ? 2 : d ? 0 : 1,
U = (v ? 1 : d ? 1 : 2) / M;
M = D[w] = O - U, y = S[w] = R * C[w]._x + F * C[w + 1]._x - U * y, b = Q[w] = R * C[w]._y + F * C[w + 1]._y - U * b
}
k[T] = S[T] / D[T], N[T] = Q[T] / D[T];
for (w = p - 2; w >= 0; w--) k[w] = (S[w] - k[w + 1]) / D[w], N[w] = (Q[w] - N[w + 1]) / D[w];
k[p] = (3 * C[p]._x - k[T]) / 2, N[p] = (3 * C[p]._y - N[T]) / 2;
w = B;
var L = p - f;
for (I = u; w <= L; w++, I++) {
var G = n[I < 0 ? I + i : I],
x = G._point,
_ = k[w] - x._x,
P = N[w] - x._y;
(l || w < L) && G.setHandleOut(_, P), (l || w > B) && G.setHandleIn(-_, -P)
}
} else
for (w = u; w <= c; w++) n[w < 0 ? w + i : w].smooth(A, !l && w === u, !l && w === c)
},
toShape: function(e) {
if (!this._closed) return null;
var t, A, o, n, i = this._segments;
function a(e, t) {
var A = i[e],
o = A.getNext(),
n = i[t],
a = n.getNext();
return A._handleOut.isZero() && o._handleIn.isZero() && n._handleOut.isZero() && a._handleIn.isZero() && o._point.subtract(A._point).isCollinear(a._point.subtract(n._point))
}
function s(e) {
var t = i[e],
A = t.getNext(),
o = t._handleOut,
n = A._handleIn;
if (o.isOrthogonal(n)) {
var a = t._point,
r = A._point,
s = new b(a, o, !0).intersect(new b(r, n, !0), !0);
return s && m.isZero(o.getLength() / s.subtract(a).getLength() - .5522847498307936) && m.isZero(n.getLength() / s.subtract(r).getLength() - .5522847498307936)
}
return !1
}
function l(e, t) {
return i[e]._point.getDistance(i[t]._point)
}
if (!this.hasHandles() && 4 === i.length && a(0, 2) && a(1, 3) && function(e) {
var t = i[e],
A = t.getPrevious(),
o = t.getNext();
return A._handleOut.isZero() && t._handleIn.isZero() && t._handleOut.isZero() && o._handleIn.isZero() && t._point.subtract(A._point).isOrthogonal(o._point.subtract(t._point))
}(1) ? (t = D.Rectangle, A = new f(l(0, 3), l(0, 1)), n = i[1]._point.add(i[2]._point).divide(2)) : 8 === i.length && s(0) && s(2) && s(4) && s(6) && a(1, 5) && a(3, 7) ? (t = D.Rectangle, o = (A = new f(l(1, 6), l(0, 3))).subtract(new f(l(0, 7), l(1, 2))).divide(2), n = i[3]._point.add(i[4]._point).divide(2)) : 4 === i.length && s(0) && s(1) && s(2) && s(3) && (m.isZero(l(0, 2) - l(1, 3)) ? (t = D.Circle, o = l(0, 2) / 2) : (t = D.Ellipse, o = new f(l(2, 0) / 2, l(3, 1) / 2)), n = i[1]._point), t) {
var u = this.getPosition(!0),
c = new t({
center: u,
size: A,
radius: o,
insert: !1
});
return c.copyAttributes(this, !0), c._matrix.prepend(this._matrix), c.rotate(n.subtract(u).getAngle() + 90), (e === r || e) && c.insertAbove(this), c
}
return null
},
toPath: "#clone",
compare: function e(t) {
if (!t || t instanceof x) return e.base.call(this, t);
var A = this.getCurves(),
o = t.getCurves(),
n = A.length,
i = o.length;
if (!n || !i) return n == i;
for (var a, r, s = A[0].getValues(), l = [], u = 0, c = 0, g = 0; g < i; g++) {
var d = o[g].getValues();
if (l.push(d), p = Y.getOverlaps(s, d)) {
a = !g && p[0][0] > 0 ? i - 1 : g, r = p[0][1];
break
}
}
var h, m = Math.abs;
for (d = l[a]; s && d;) {
var p;
if (p = Y.getOverlaps(s, d))
if (m(p[0][0] - c) < 1e-8) {
1 === (c = p[1][0]) && (s = ++u < n ? A[u].getValues() : null, c = 0);
var E = p[0][1];
if (m(E - r) < 1e-8) {
if (h || (h = [a, E]), 1 === (r = p[1][1]) && (++a >= i && (a = 0), d = l[a] || o[a].getValues(), r = 0), !s) return h[0] === a && h[1] === r;
continue
}
}
break
}
return !1
},
_hitTestSelf: function(e, t, A, o) {
var n, i, a, r, s, l, u = this,
c = this.getStyle(),
g = this._segments,
d = g.length,
h = this._closed,
m = t._tolerancePadding,
p = m,
E = t.stroke && c.hasStroke(),
B = t.hitUnfilledPaths ? t.fill : t.fill && c.hasFill(),
f = t.curves,
C = E ? c.getStrokeWidth() / 2 : B && t.tolerance > 0 || f ? 0 : null;
function w(t, A) {
return e.subtract(t).divide(A).length <= 1
}
function I(e, A, o) {
if (!t.selected || A.isSelected()) {
var n = e._point;
if (A !== n && (A = A.add(n)), w(A, p)) return new O(o, u, {
segment: e,
point: A
})
}
}
function y(e, A) {
return (A || t.segments) && I(e, e._point, "segment") || !A && t.handles && (I(e, e._handleIn, "handle-in") || I(e, e._handleOut, "handle-out"))
}
function b(e) {
r.add(e)
}
function M(t) {
var A, s = h || t._index > 0 && t._index < d - 1;
return "round" === (s ? n : i) ? w(t._point, p) : (r = new G({
internal: !0,
closed: !0
}), s ? t.isSmooth() || G._addBevelJoin(t, n, C, a, null, o, b, !0) : "square" === i && G._addSquareCap(t, i, C, null, o, b, !0), r.isEmpty() ? void 0 : r.contains(e) || (A = r.getNearestLocation(e)) && w(A.getPoint(), m))
}
if (null !== C && (C > 0 ? (n = c.getStrokeJoin(), i = c.getStrokeCap(), a = c.getMiterLimit(), p = p.add(G._getStrokePadding(C, o))) : n = i = "round"), !t.ends || t.segments || h) {
if (t.segments || t.handles)
for (var T = 0; T < d; T++)
if (l = y(g[T])) return l
} else if (l = y(g[0], !0) || y(g[d - 1], !0)) return l;
if (null !== C) {
if (s = this.getNearestLocation(e)) {
var S = s.getTime();
0 === S || 1 === S && d > 1 ? M(s.getSegment()) || (s = null) : w(s.getPoint(), p) || (s = null)
}
if (!s && "miter" === n && d > 1)
for (T = 0; T < d; T++) {
var Q = g[T];
if (e.getDistance(Q._point) <= a * C && M(Q)) {
s = Q.getLocation();
break
}
}
}
return !s && B && this._contains(e) || s && !E && !f ? new O("fill", this) : s ? new O(E ? "stroke" : "curve", this, {
location: s,
point: s.getPoint()
}) : null
}
}, u.each(Y._evaluateMethods, function(e) {
this[e + "At"] = function(t) {
var A = this.getLocationAt(t);
return A && A[e]()
}
}, {
beans: !1,
getLocationOf: function() {
for (var e = E.read(arguments), t = this.getCurves(), A = 0, o = t.length; A < o; A++) {
var n = t[A].getLocationOf(e);
if (n) return n
}
return null
},
getOffsetOf: function() {
var e = this.getLocationOf.apply(this, arguments);
return e ? e.getOffset() : null
},
getLocationAt: function(e) {
if ("number" == typeof e) {
for (var t = this.getCurves(), A = 0, o = 0, n = t.length; o < n; o++) {
var i = A,
a = t[o];
if ((A += a.getLength()) > e) return a.getLocationAt(e - i)
}
if (t.length > 0 && e <= this.getLength()) return new U(t[t.length - 1], 1)
} else if (e && e.getPath && e.getPath() === this) return e;
return null
},
getOffsetsWithTangent: function() {
var e = E.read(arguments);
if (e.isZero()) return [];
for (var t = [], A = 0, o = this.getCurves(), n = 0, i = o.length; n < i; n++) {
for (var a = o[n], r = a.getTimesWithTangent(e), s = 0, l = r.length; s < l; s++) {
var u = A + a.getOffsetAtTime(r[s]);
t.indexOf(u) < 0 && t.push(u)
}
A += a.length
}
return t
}
}), new function() {
function e(e, t, A) {
var o, n, i, a, r, s, l, u, c = t._segments,
g = c.length,
d = new Array(6),
h = !0;
function m(t) {
if (A) t._transformCoordinates(A, d), o = d[0], n = d[1];
else {
var c = t._point;
o = c._x, n = c._y
}
if (h) e.moveTo(o, n), h = !1;
else {
if (A) r = d[2], s = d[3];
else {
var g = t._handleIn;
r = o + g._x, s = n + g._y
}
r === o && s === n && l === i && u === a ? e.lineTo(o, n) : e.bezierCurveTo(l, u, r, s, o, n)
}
if (i = o, a = n, A) l = d[4], u = d[5];
else {
g = t._handleOut;
l = i + g._x, u = a + g._y
}
}
for (var p = 0; p < g; p++) m(c[p]);
t._closed && g > 0 && m(c[0])
}
return {
_draw: function(t, A, o, n) {
var i = A.dontStart,
a = A.dontFinish || A.clip,
r = this.getStyle(),
s = r.hasFill(),
l = r.hasStroke(),
u = r.getDashArray(),
c = !ue.support.nativeDash && l && u && u.length;
function g(e) {
return u[(e % c + c) % c]
}
if (i || t.beginPath(), (s || l && !c || a) && (e(t, this, n), this._closed && t.closePath()), !a && (s || l) && (this._setStyles(t, A, o), s && (t.fill(r.getFillRule()), t.shadowColor = "rgba(0,0,0,0)"), l)) {
if (c) {
i || t.beginPath();
var d, h = new _(this, .25, 32, !1, n),
m = h.length,
p = -r.getDashOffset(),
E = 0;
for (p %= m; p > 0;) p -= g(E--) + g(E--);
for (; p < m;) d = p + g(E++), (p > 0 || d > 0) && h.drawPart(t, Math.max(p, 0), Math.max(d, 0)), p = d + g(E++)
}
t.stroke()
}
},
_drawSelected: function(t, A) {
t.beginPath(), e(t, this, A), t.stroke(),
function(e, t, A, o, n) {
if (0 !== o)
for (var i, a, r = o / 2, s = new Array(6), l = 0, u = t.length; l < u; l++) {
var c = t[l],
g = c._selection;
c._transformCoordinates(A, s), i = s[0], a = s[1], 2 & g && !n && h(2), 4 & g && !n && h(4), e.beginPath(), e.arc(i, a, r, 0, 2 * Math.PI, !0), e.stroke();
var d = e.fillStyle;
1 & g || (e.fillStyle = "rgba(255, 255, 255, 0.5)"), e.fill(), e.fillStyle = d
}
function h(t) {
var A = s[t],
o = s[t + 1];
i == A && a == o || (e.beginPath(), e.moveTo(i, a), e.lineTo(A, o), e.moveTo(A - r, o), e.lineTo(A, o + r), e.lineTo(A + r, o), e.lineTo(A, o - r), e.closePath(), e.stroke())
}
}(t, this._segments, A, ue.settings.handleSize, this.isFullySelected())
}
}
}, new function() {
function e(e) {
var t = e._segments;
if (!t.length) throw new Error("Use a moveTo() command first");
return t[t.length - 1]
}
return {
moveTo: function() {
var e = this._segments;
1 === e.length && this.removeSegment(0), e.length || this._add([new R(E.read(arguments))])
},
moveBy: function() {
throw new Error("moveBy() is unsupported on Path items.")
},
lineTo: function() {
this._add([new R(E.read(arguments))])
},
cubicCurveTo: function() {
var t = E.read(arguments),
A = E.read(arguments),
o = E.read(arguments),
n = e(this);
n.setHandleOut(t.subtract(n._point)), this._add([new R(o, A.subtract(o))])
},
quadraticCurveTo: function() {
var t = E.read(arguments),
A = E.read(arguments),
o = e(this)._point;
this.cubicCurveTo(t.add(o.subtract(t).multiply(1 / 3)), t.add(A.subtract(t).multiply(1 / 3)), A)
},
curveTo: function() {
var t = E.read(arguments),
A = E.read(arguments),
o = u.pick(u.read(arguments), .5),
n = 1 - o,
i = e(this)._point,
a = t.subtract(i.multiply(n * n)).subtract(A.multiply(o * o)).divide(2 * o * n);
if (a.isNaN()) throw new Error("Cannot put a curve through points with parameter = " + o);
this.quadraticCurveTo(a, A)
},
arcTo: function() {
var t, A, o, n, i = Math.abs,
a = Math.sqrt,
r = e(this),
s = r._point,
l = E.read(arguments),
c = u.peek(arguments);
if ("boolean" == typeof(B = u.pick(c, !0))) var g = (w = s.add(l).divide(2)).add(w.subtract(s).rotate(B ? -90 : 90));
else if (u.remain(arguments) <= 2) g = l, l = E.read(arguments);
else {
var d = f.read(arguments),
h = m.isZero;
if (h(d.width) || h(d.height)) return this.lineTo(l);
var p = u.read(arguments),
B = !!u.read(arguments),
C = !!u.read(arguments),
w = s.add(l).divide(2),
I = (K = s.subtract(w).rotate(-p)).x,
M = K.y,
T = i(d.width),
S = i(d.height),
Q = T * T,
D = S * S,
k = I * I,
N = M * M,
v = a(k / Q + N / D);
if (v > 1 && (Q = (T *= v) * T, D = (S *= v) * S), i(v = (Q * D - Q * N - D * k) / (Q * N + D * k)) < 1e-12 && (v = 0), v < 0) throw new Error("Cannot create an arc with the given arguments");
t = new E(T * M / S, -S * I / T).multiply((C === B ? -1 : 1) * a(v)).rotate(p).add(w), A = (o = (n = (new y).translate(t).rotate(p).scale(T, S))._inverseTransform(s)).getDirectedAngle(n._inverseTransform(l)), !B && A > 0 ? A -= 360 : B && A < 0 && (A += 360)
}
if (g) {
var O = new b(s.add(g).divide(2), g.subtract(s).rotate(90), !0),
F = new b(g.add(l).divide(2), l.subtract(g).rotate(90), !0),
Y = new b(s, l),
U = Y.getSide(g);
if (!(t = O.intersect(F, !0))) {
if (!U) return this.lineTo(l);
throw new Error("Cannot create an arc with the given arguments")
}
A = (o = s.subtract(t)).getDirectedAngle(l.subtract(t));
var L = Y.getSide(t, !0);
0 === L ? A = U * i(A) : U === L && (A += A < 0 ? 360 : -360)
}
for (var G = i(A), x = G >= 360 ? 4 : Math.ceil((G - 1e-7) / 90), _ = A / x, P = _ * Math.PI / 360, H = 4 / 3 * Math.sin(P) / (1 + Math.cos(P)), j = [], z = 0; z <= x; z++) {
var K = l,
J = null;
if (z < x && (J = o.rotate(90).multiply(H), n ? (K = n._transformPoint(o), J = n._transformPoint(o.add(J)).subtract(K)) : K = t.add(o)), z) {
var V = o.rotate(-90).multiply(H);
n && (V = n._transformPoint(o.add(V)).subtract(K)), j.push(new R(K, V, J))
} else r.setHandleOut(J);
o = o.rotate(_)
}
this._add(j)
},
lineBy: function() {
var t = E.read(arguments),
A = e(this)._point;
this.lineTo(A.add(t))
},
curveBy: function() {
var t = E.read(arguments),
A = E.read(arguments),
o = u.read(arguments),
n = e(this)._point;
this.curveTo(n.add(t), n.add(A), o)
},
cubicCurveBy: function() {
var t = E.read(arguments),
A = E.read(arguments),
o = E.read(arguments),
n = e(this)._point;
this.cubicCurveTo(n.add(t), n.add(A), n.add(o))
},
quadraticCurveBy: function() {
var t = E.read(arguments),
A = E.read(arguments),
o = e(this)._point;
this.quadraticCurveTo(o.add(t), o.add(A))
},
arcBy: function() {
var t = e(this)._point,
A = t.add(E.read(arguments)),
o = u.pick(u.peek(arguments), !0);
"boolean" == typeof o ? this.arcTo(A, o) : this.arcTo(A, t.add(E.read(arguments)))
},
closePath: function(e) {
this.setClosed(!0), this.join(this, e)
}
}
}, {
_getBounds: function(e, t) {
var A = t.handle ? "getHandleBounds" : t.stroke ? "getStrokeBounds" : "getBounds";
return G[A](this._segments, this._closed, this, e, t)
},
statics: {
getBounds: function(e, t, A, o, n, i) {
var a = e[0];
if (!a) return new w;
var r = new Array(6),
s = a._transformCoordinates(o, new Array(6)),
l = s.slice(0, 2),
u = l.slice(),
c = new Array(2);
function g(e) {
e._transformCoordinates(o, r);
for (var t = 0; t < 2; t++) Y._addBounds(s[t], s[t + 4], r[t + 2], r[t], t, i ? i[t] : 0, l, u, c);
var A = s;
s = r, r = A
}
for (var d = 1, h = e.length; d < h; d++) g(e[d]);
return t && g(a), new w(l[0], l[1], u[0] - l[0], u[1] - l[1])
},
getStrokeBounds: function(e, t, A, o, n) {
var i = A.getStyle(),
a = i.hasStroke(),
r = i.getStrokeWidth(),
s = a && A._getStrokeMatrix(o, n),
l = a && G._getStrokePadding(r, s),
u = G.getBounds(e, t, A, o, n, l);
if (!a) return u;
var c = r / 2,
g = i.getStrokeJoin(),
d = i.getStrokeCap(),
h = i.getMiterLimit(),
m = new w(new f(l));
function p(e) {
u = u.include(e)
}
function E(e) {
u = u.unite(m.setCenter(e._point.transform(o)))
}
function B(e, t) {
"round" === t || e.isSmooth() ? E(e) : G._addBevelJoin(e, t, c, h, o, s, p)
}
function C(e, t) {
"round" === t ? E(e) : G._addSquareCap(e, t, c, o, s, p)
}
for (var I = e.length - (t ? 0 : 1), y = 1; y < I; y++) B(e[y], g);
return t ? B(e[0], g) : I > 0 && (C(e[0], d), C(e[e.length - 1], d)), u
},
_getStrokePadding: function(e, t) {
if (!t) return [e, e];
var A = new E(e, 0).transform(t),
o = new E(0, e).transform(t),
n = A.getAngleInRadians(),
i = A.getLength(),
a = o.getLength(),
r = Math.sin(n),
s = Math.cos(n),
l = Math.tan(n),
u = Math.atan2(a * l, i),
c = Math.atan2(a, l * i);
return [Math.abs(i * Math.cos(u) * s + a * Math.sin(u) * r), Math.abs(a * Math.sin(c) * s + i * Math.cos(c) * r)]
},
_addBevelJoin: function(e, t, A, o, n, i, a, r) {
var s = e.getCurve(),
l = s.getPrevious(),
u = s.getPoint1().transform(n),
c = l.getNormalAtTime(1).multiply(A).transform(i),
g = s.getNormalAtTime(0).multiply(A).transform(i);
if (c.getDirectedAngle(g) < 0 && (c = c.negate(), g = g.negate()), r && a(u), a(u.add(c)), "miter" === t) {
var d = new b(u.add(c), new E(-c.y, c.x), !0).intersect(new b(u.add(g), new E(-g.y, g.x), !0), !0);
d && u.getDistance(d) <= o * A && a(d)
}
a(u.add(g))
},
_addSquareCap: function(e, t, A, o, n, i, a) {
var r = e._point.transform(o),
s = e.getLocation(),
l = s.getNormal().multiply(0 === s.getTime() ? A : -A).transform(n);
"square" === t && (a && (i(r.subtract(l)), i(r.add(l))), r = r.add(l.rotate(-90))), i(r.add(l)), i(r.subtract(l))
},
getHandleBounds: function(e, t, A, o, n) {
var i, a, r = A.getStyle();
if (n.stroke && r.hasStroke()) {
var s = A._getStrokeMatrix(o, n),
l = r.getStrokeWidth() / 2,
u = l;
"miter" === r.getStrokeJoin() && (u = l * r.getMiterLimit()), "square" === r.getStrokeCap() && (u = Math.max(u, l * Math.SQRT2)), i = G._getStrokePadding(l, s), a = G._getStrokePadding(u, s)
}
for (var c = new Array(6), g = 1 / 0, d = -g, h = g, m = d, p = 0, E = e.length; p < E; p++) {
e[p]._transformCoordinates(o, c);
for (var B = 0; B < 6; B += 2) {
var f = B ? i : a,
C = f ? f[0] : 0,
I = f ? f[1] : 0,
y = c[B],
b = c[B + 1],
M = y - C,
T = y + C,
S = b - I,
Q = b + I;
M < g && (g = M), T > d && (d = T), S < h && (h = S), Q > m && (m = Q)
}
}
return new w(g, h, d - g, m - h)
}
}
});
G.inject({
statics: new function() {
var e = .5522847498307936,
t = [new R([-1, 0], [0, e], [0, -e]), new R([0, -1], [-e, 0], [e, 0]), new R([1, 0], [0, -e], [0, e]), new R([0, 1], [e, 0], [-e, 0])];
function A(e, t, A) {
var o = u.getNamed(A),
n = new G(o && 0 == o.insert && T.NO_INSERT);
return n._add(e), n._closed = t, n.set(o, {
insert: !0
})
}
function o(e, o, n) {
for (var i = new Array(4), a = 0; a < 4; a++) {
var r = t[a];
i[a] = new R(r._point.multiply(o).add(e), r._handleIn.multiply(o), r._handleOut.multiply(o))
}
return A(i, !0, n)
}
return {
Line: function() {
return A([new R(E.readNamed(arguments, "from")), new R(E.readNamed(arguments, "to"))], !1, arguments)
},
Circle: function() {
var e = E.readNamed(arguments, "center"),
t = u.readNamed(arguments, "radius");
return o(e, new f(t), arguments)
},
Rectangle: function() {
var t, o = w.readNamed(arguments, "rectangle"),
n = f.readNamed(arguments, "radius", 0, {
readNull: !0
}),
i = o.getBottomLeft(!0),
a = o.getTopLeft(!0),
r = o.getTopRight(!0),
s = o.getBottomRight(!0);
if (!n || n.isZero()) t = [new R(i), new R(a), new R(r), new R(s)];
else {
var l = (n = f.min(n, o.getSize(!0).divide(2))).width,
u = n.height,
c = l * e,
g = u * e;
t = [new R(i.add(l, 0), null, [-c, 0]), new R(i.subtract(0, u), [0, g]), new R(a.add(0, u), null, [0, -g]), new R(a.add(l, 0), [-c, 0], null), new R(r.subtract(l, 0), null, [c, 0]), new R(r.add(0, u), [0, -g], null), new R(s.subtract(0, u), null, [0, g]), new R(s.subtract(l, 0), [c, 0])]
}
return A(t, !0, arguments)
},
RoundRectangle: "#Rectangle",
Ellipse: function() {
var e = D._readEllipse(arguments);
return o(e.center, e.radius, arguments)
},
Oval: "#Ellipse",
Arc: function() {
var e = E.readNamed(arguments, "from"),
t = E.readNamed(arguments, "through"),
A = E.readNamed(arguments, "to"),
o = u.getNamed(arguments),
n = new G(o && 0 == o.insert && T.NO_INSERT);
return n.moveTo(e), n.arcTo(t, A), n.set(o)
},
RegularPolygon: function() {
for (var e = E.readNamed(arguments, "center"), t = u.readNamed(arguments, "sides"), o = u.readNamed(arguments, "radius"), n = 360 / t, i = t % 3 == 0, a = new E(0, i ? -o : o), r = i ? -1 : .5, s = new Array(t), l = 0; l < t; l++) s[l] = new R(e.add(a.rotate((l + r) * n)));
return A(s, !0, arguments)
},
Star: function() {
for (var e = E.readNamed(arguments, "center"), t = 2 * u.readNamed(arguments, "points"), o = u.readNamed(arguments, "radius1"), n = u.readNamed(arguments, "radius2"), i = 360 / t, a = new E(0, -1), r = new Array(t), s = 0; s < t; s++) r[s] = new R(e.add(a.rotate(i * s).multiply(s % 2 ? n : o)));
return A(r, !0, arguments)
}
}
}
});
var x = L.extend({
_class: "CompoundPath",
_serializeFields: {
children: []
},
beans: !0,
initialize: function(e) {
this._children = [], this._namedChildren = {}, this._initialize(e) || ("string" == typeof e ? this.setPathData(e) : this.addChildren(Array.isArray(e) ? e : arguments))
},
insertChildren: function e(t, A) {
var o = A,
n = o[0];
n && "number" == typeof n[0] && (o = [o]);
for (var i = A.length - 1; i >= 0; i--) {
var a = o[i];
o !== A || a instanceof G || (o = u.slice(o)), Array.isArray(a) ? o[i] = new G({
segments: a,
insert: !1
}) : a instanceof x && (o.splice.apply(o, [i, 1].concat(a.removeChildren())), a.remove())
}
return e.base.call(this, t, o)
},
reduce: function e(t) {
for (var A = this._children, o = A.length - 1; o >= 0; o--) {
var n;
(n = A[o].reduce(t)).isEmpty() && n.remove()
}
return A.length ? e.base.call(this) : ((n = new G(T.NO_INSERT)).copyAttributes(this), n.insertAbove(this), this.remove(), n)
},
isClosed: function() {
for (var e = this._children, t = 0, A = e.length; t < A; t++)
if (!e[t]._closed) return !1;
return !0
},
setClosed: function(e) {
for (var t = this._children, A = 0, o = t.length; A < o; A++) t[A].setClosed(e)
},
getFirstSegment: function() {
var e = this.getFirstChild();
return e && e.getFirstSegment()
},
getLastSegment: function() {
var e = this.getLastChild();
return e && e.getLastSegment()
},
getCurves: function() {
for (var e = this._children, t = [], A = 0, o = e.length; A < o; A++) u.push(t, e[A].getCurves());
return t
},
getFirstCurve: function() {
var e = this.getFirstChild();
return e && e.getFirstCurve()
},
getLastCurve: function() {
var e = this.getLastChild();
return e && e.getLastCurve()
},
getArea: function() {
for (var e = this._children, t = 0, A = 0, o = e.length; A < o; A++) t += e[A].getArea();
return t
},
getLength: function() {
for (var e = this._children, t = 0, A = 0, o = e.length; A < o; A++) t += e[A].getLength();
return t
},
getPathData: function(e, t) {
for (var A = this._children, o = [], n = 0, i = A.length; n < i; n++) {
var a = A[n],
r = a._matrix;
o.push(a.getPathData(e && !r.isIdentity() ? e.appended(r) : e, t))
}
return o.join("")
},
_hitTestChildren: function e(t, A, o) {
return e.base.call(this, t, A.class === G || "path" === A.type || A.hitUnfilledPaths ? A : u.set({}, A, {
fill: !1
}), o)
},
_draw: function(e, t, A, o) {
var n = this._children;
if (n.length) {
t = t.extend({
dontStart: !0,
dontFinish: !0
}), e.beginPath();
for (var i = 0, a = n.length; i < a; i++) n[i].draw(e, t, o);
if (!t.clip) {
this._setStyles(e, t, A);
var r = this._style;
r.hasFill() && (e.fill(r.getFillRule()), e.shadowColor = "rgba(0,0,0,0)"), r.hasStroke() && e.stroke()
}
}
},
_drawSelected: function(e, t, A) {
for (var o = this._children, n = 0, i = o.length; n < i; n++) {
var a = o[n],
r = a._matrix;
A[a._id] || a._drawSelected(e, r.isIdentity() ? t : t.appended(r))
}
}
}, new function() {
function e(e, t) {
var A = e._children;
if (t && !A.length) throw new Error("Use a moveTo() command first");
return A[A.length - 1]
}
return u.each(["lineTo", "cubicCurveTo", "quadraticCurveTo", "curveTo", "arcTo", "lineBy", "cubicCurveBy", "quadraticCurveBy", "curveBy", "arcBy"], function(t) {
this[t] = function() {
var A = e(this, !0);
A[t].apply(A, arguments)
}
}, {
moveTo: function() {
var t = e(this),
A = t && t.isEmpty() ? t : new G(T.NO_INSERT);
A !== t && this.addChild(A), A.moveTo.apply(A, arguments)
},
moveBy: function() {
var t = e(this, !0),
A = t && t.getLastSegment(),
o = E.read(arguments);
this.moveTo(A ? o.add(A._point) : o)
},
closePath: function(t) {
e(this, !0).closePath(t)
}
})
}, u.each(["reverse", "flatten", "simplify", "smooth"], function(e) {
this[e] = function(t) {
for (var A, o = this._children, n = 0, i = o.length; n < i; n++) A = o[n][e](t) || A;
return A
}
}, {}));
L.inject(new function() {
var e = Math.min,
t = Math.max,
A = Math.abs,
o = {
unite: {
1: !0,
2: !0
},
intersect: {
2: !0
},
subtract: {
1: !0
},
exclude: {
1: !0,
"-1": !0
}
};
function n(e, t) {
var A = e.clone(!1).reduce({
simplify: !0
}).transform(null, !0, !0);
return t ? A.resolveCrossings().reorient("nonzero" === A.getFillRule(), !0) : A
}
function i(e, t, A, o, n) {
var i = new x(T.NO_INSERT);
return i.addChildren(e, !0), i = i.reduce({
simplify: t
}), n && 0 == n.insert || i.insertAbove(o && A.isSibling(o) && A.getIndex() < o.getIndex() ? o : A), i.copyAttributes(A, !0), i
}
function a(e, t, A, a) {
if (a && (0 == a.trace || a.stroke) && /^(subtract|intersect)$/.test(A)) return s(e, t, A);
var r = n(e, !0),
l = t && e !== t && n(t, !0),
c = o[A];
c[A] = !0, l && (c.subtract || c.exclude) ^ l.isClockwise() ^ r.isClockwise() && l.reverse();
var h, m = d(U.expand(r.getCrossings(l))),
B = r._children || [r],
f = l && (l._children || [l]),
C = [],
w = [];
function I(e) {
for (var t = 0, A = e.length; t < A; t++) {
var o = e[t];
u.push(C, o._segments), u.push(w, o.getCurves()), o._overlapsOnly = !0
}
}
if (m.length) {
I(B), f && I(f);
for (var y = 0, b = m.length; y < b; y++) p(m[y]._segment, r, l, w, c);
for (y = 0, b = C.length; y < b; y++) {
var M = C[y],
T = M._intersection;
M._winding || p(M, r, l, w, c), T && T._overlap || (M._path._overlapsOnly = !1)
}
h = E(C, c)
} else h = g(f ? B.concat(f) : B.slice(), function(e) {
return !!c[e]
});
return i(h, !0, e, t, a)
}
function s(e, t, A) {
var o = n(e),
a = n(t),
r = o.getCrossings(a),
s = "subtract" === A,
l = "divide" === A,
u = {},
c = [];
function g(e) {
if (!u[e._id] && (l || a.contains(e.getPointAt(e.getLength() / 2)) ^ s)) return c.unshift(e), u[e._id] = !0
}
for (var d = r.length - 1; d >= 0; d--) {
var h = r[d].split();
h && (g(h) && h.getFirstSegment().setHandleIn(0, 0), o.getLastSegment().setHandleOut(0, 0))
}
return g(o), i(c, !1, e, t)
}
function l(e, t) {
for (var A = e; A;) {
if (A === t) return;
A = A._previous
}
for (; e._next && e._next !== t;) e = e._next;
if (!e._next) {
for (; t._previous;) t = t._previous;
e._next = t, t._previous = e
}
}
function c(e) {
for (var t = e.length - 1; t >= 0; t--) e[t].clearHandles()
}
function g(e, t, o) {
var n = e && e.length;
if (n) {
var i = u.each(e, function(e, t) {
this[e._id] = {
container: null,
winding: e.isClockwise() ? 1 : -1,
index: t
}
}, {}),
a = e.slice().sort(function(e, t) {
return A(t.getArea()) - A(e.getArea())
}),
r = a[0];
null == o && (o = r.isClockwise());
for (var s = 0; s < n; s++) {
for (var l = a[s], c = i[l._id], g = l.getInteriorPoint(), d = 0, h = s - 1; h >= 0; h--) {
var m = a[h];
if (m.contains(g)) {
var p = i[m._id];
d = p.winding, c.winding += d, c.container = p.exclude ? p.container : m;
break
}
}
if (t(c.winding) === t(d)) c.exclude = !0, e[c.index] = null;
else {
var E = c.container;
l.setClockwise(E ? !E.isClockwise() : o)
}
}
}
return e
}
function d(e, t, A) {
var o, n, i, a = t && [],
r = !1,
s = A || [],
u = A && {};
function g(e) {
return e._path._id + "." + e._segment1._index
}
for (var d = (A && A.length) - 1; d >= 0; d--) {
(h = A[d])._path && (u[g(h)] = !0)
}
for (d = e.length - 1; d >= 0; d--) {
var h, m, p = e[d],
E = p._time,
B = E,
f = t && !t(p);
if ((h = p._curve) && (h !== n ? (r = !h.hasHandles() || u && u[g(h)], o = [], i = null, n = h) : i >= 1e-8 && (E /= i)), f) o && o.push(p);
else {
if (t && a.unshift(p), i = B, E < 1e-8) m = h._segment1;
else if (E > 1 - 1e-8) m = h._segment2;
else {
var C = h.divideAtTime(E, !0);
r && s.push(h, C), m = C._segment1;
for (var w = o.length - 1; w >= 0; w--) {
var I = o[w];
I._time = (I._time - E) / (1 - E)
}
}
p._setSegment(m);
var y = m._intersection,
b = p._intersection;
if (y) {
l(y, b);
for (var M = y; M;) l(M._intersection, y), M = M._next
} else m._intersection = b
}
}
return A || c(s), a || e
}
function h(o, n, i, a, r) {
var s, l, u = i ? 1 : 0,
c = 1 ^ u,
g = [o.x, o.y],
d = g[u],
m = g[c],
p = 1e-6,
E = d - 1e-9,
B = d + 1e-9,
f = 0,
C = 0,
w = 0,
I = 0,
y = !1,
b = !1,
M = 1,
T = [];
function S(A) {
var l = A[c + 0],
g = A[c + 6];
if (!(m < e(l, g) || m > t(l, g))) {
var f = A[u + 0],
C = A[u + 2],
b = A[u + 4],
S = A[u + 6];
if (l !== g) {
var Q = m === l ? 0 : m === g ? 1 : E > t(f, C, b, S) || B < e(f, C, b, S) ? 1 : Y.solveCubic(A, c, m, T, 0, 1) > 0 ? T[0] : 1,
D = 0 === Q ? f : 1 === Q ? S : Y.getPoint(A, Q)[i ? "y" : "x"],
k = l > g ? 1 : -1,
N = s[c] > s[c + 6] ? 1 : -1,
v = s[u + 6];
return m !== l ? (D < E ? w += k : D > B ? I += k : y = !0, D > d - p && D < d + p && (M /= 2)) : (k !== N ? f < E ? w += k : f > B && (I += k) : f != v && (v < B && D > B ? (I += k, y = !0) : v > E && D < E && (w += k, y = !0)), M = 0), s = A, !r && D > E && D < B && 0 === Y.getTangent(A, Q)[i ? "x" : "y"] && h(o, n, !i, a, !0)
}(f < B && S > E || S < B && f > E) && (y = !0)
}
}
function Q(A) {
var o = A[c + 0],
n = A[c + 2],
a = A[c + 4],
r = A[c + 6];
if (m <= t(o, n, a, r) && m >= e(o, n, a, r))
for (var s, l = A[u + 0], g = A[u + 2], d = A[u + 4], h = A[u + 6], p = E > t(l, g, d, h) || B < e(l, g, d, h) ? [A] : Y.getMonoCurves(A, i), f = 0, C = p.length; f < C; f++)
if (s = S(p[f])) return s
}
for (var D = 0, k = n.length; D < k; D++) {
var N, v = n[D],
O = v._path,
R = v.getValues();
if (!(D && n[D - 1]._path === O || (s = null, O._closed || (l = Y.getValues(O.getLastCurve().getSegment2(), v.getSegment1(), null, !a))[c] !== l[c + 6] && (s = l), s))) {
s = R;
for (var F = O.getLastCurve(); F && F !== v;) {
var U = F.getValues();
if (U[c] !== U[c + 6]) {
s = U;
break
}
F = F.getPrevious()
}
}
if (N = Q(R)) return N;
if (D + 1 === k || n[D + 1]._path !== O) {
if (l && (N = Q(l))) return N;
!y || w || I || (w = I = O.isClockwise(a) ^ i ? 1 : -1), f += w, C += I, w = I = 0, y && (b = !0, y = !1), l = null
}
}
return f = A(f), C = A(C), {
winding: t(f, C),
windingL: f,
windingR: C,
quality: M,
onPath: b
}
}
function p(e, t, o, n, i) {
var a = [],
r = e,
s = 0;
do {
var l = (f = e.getCurve()).getLength();
a.push({
segment: e,
curve: f,
length: l
}), s += l, e = e.getNext()
} while (e && !e._intersection && e !== r);
for (var u = [.5, .25, .75], c = {
winding: 0,
quality: -1
}, g = 0; g < u.length && c.quality < .5; g++) {
l = s * u[g];
for (var d = 0, p = a.length; d < p; d++) {
var E = a[d],
B = E.length;
if (l <= B) {
var f, C = (f = E.curve)._path,
w = C._parent,
I = w instanceof x ? w : C,
y = m.clamp(f.getTimeAt(l), 1e-8, 1 - 1e-8),
b = f.getPointAtTime(y),
M = A(f.getTangentAtTime(y).y) < Math.SQRT1_2,
T = null;
if (i.subtract && o) {
var S = I === t ? o._getWinding(b, M, !0) : t._getWinding(b, M, !0);
if (I === t && S.winding || I === o && !S.winding) {
if (S.quality < 1) continue;
T = {
winding: 0,
quality: 1
}
}
}(T = T || h(b, n, M, !0)).quality > c.quality && (c = T);
break
}
l -= B
}
}
for (d = a.length - 1; d >= 0; d--) a[d].segment._winding = c
}
function E(e, t) {
var A, o = [];
function n(e) {
var A;
return !(!e || e._visited || t && (!t[(A = e._winding || {}).winding] || t.unite && 2 === A.winding && A.windingL && A.windingR))
}
function i(e) {
if (e)
for (var t = 0, o = A.length; t < o; t++)
if (e === A[t]) return !0;
return !1
}
function a(e) {
for (var t = e._segments, A = 0, o = t.length; A < o; A++) t[A]._visited = !0
}
function r(e, t) {
var o = e._intersection,
a = o,
r = [];
function s(o, a) {
for (; o && o !== a;) {
var s = o._segment,
l = s && s._path;
if (l) {
var u = s.getNext() || l.getFirstSegment(),
c = u._intersection;
s !== e && (i(s) || i(u) || u && n(s) && (n(u) || c && n(c._segment))) && r.push(s), t && A.push(s)
}
o = o._next
}
}
if (t && (A = [e]), o) {
for (s(o); o && o._prev;) o = o._prev;
s(o, a)
}
return r
}
e.sort(function(e, t) {
var A = e._intersection,
o = t._intersection,
n = !(!A || !A._overlap),
i = !(!o || !o._overlap),
a = e._path,
r = t._path;
return n ^ i ? n ? 1 : -1 : !A ^ !o ? A ? 1 : -1 : a !== r ? a._id - r._id : e._index - t._index
});
for (var s = 0, l = e.length; s < l; s++) {
var u, c, g, d = e[s],
h = n(d),
m = null,
p = !1,
E = !0,
B = [];
if (h && d._path._overlapsOnly) {
var f = d._path,
C = d._intersection._segment._path;
f.compare(C) && (f.getArea() && o.push(f.clone(!1)), a(f), a(C), h = !1)
}
for (; h;) {
var w = !m,
I = r(d, w),
y = I.shift(),
b = !(p = !w && (i(d) || i(y))) && y;
if (w && (m = new G(T.NO_INSERT), u = null), p) {
(d.isFirst() || d.isLast()) && (E = d._path._closed), d._visited = !0;
break
}
if (b && u && (B.push(u), u = null), u || (b && I.push(d), u = {
start: m._segments.length,
crossings: I,
visited: c = [],
handleIn: g
}), b && (d = y), !n(d)) {
m.removeSegments(u.start);
for (var M = 0, S = c.length; M < S; M++) c[M]._visited = !1;
c.length = 0;
do {
(d = u && u.crossings.shift()) && d._path || (d = null, (u = B.pop()) && (c = u.visited, g = u.handleIn))
} while (u && !n(d));
if (!d) break
}
var Q = d.getNext();
m.add(new R(d._point, g, Q && d._handleOut)), d._visited = !0, c.push(d), d = Q || d._path.getFirstSegment(), g = Q && Q._handleIn
}
p && (E && (m.getFirstSegment().setHandleIn(g), m.setClosed(E)), 0 !== m.getArea() && o.push(m))
}
return o
}
return {
_getWinding: function(e, t, A) {
return h(e, this.getCurves(), t, A)
},
unite: function(e, t) {
return a(this, e, "unite", t)
},
intersect: function(e, t) {
return a(this, e, "intersect", t)
},
subtract: function(e, t) {
return a(this, e, "subtract", t)
},
exclude: function(e, t) {
return a(this, e, "exclude", t)
},
divide: function(e, t) {
return t && (0 == t.trace || t.stroke) ? s(this, e, "divide") : i([this.subtract(e, t), this.intersect(e, t)], !0, this, e, t)
},
resolveCrossings: function() {
var e = this._children,
t = e || [this];
function A(e, t) {
var A = e && e._intersection;
return A && A._overlap && A._path === t
}
var o = !1,
n = !1,
i = this.getIntersections(null, function(e) {
return e.hasOverlap() && (o = !0) || e.isCrossing() && (n = !0)
}),
a = o && n && [];
if (i = U.expand(i), o)
for (var r = d(i, function(e) {
return e.hasOverlap()
}, a), s = r.length - 1; s >= 0; s--) {
var l = r[s],
g = l._path,
h = l._segment,
m = h.getPrevious(),
p = h.getNext();
A(m, g) && A(p, g) && (h.remove(), m._handleOut._set(0, 0), p._handleIn._set(0, 0), m === h || m.getCurve().hasLength() || (p._handleIn.set(m._handleIn), m.remove()))
}
n && (d(i, o && function(e) {
var t = e.getCurve(),
A = e.getSegment(),
o = e._intersection,
n = o._curve,
i = o._segment;
if (t && n && t._path && n._path) return !0;
A && (A._intersection = null), i && (i._intersection = null)
}, a), a && c(a), t = E(u.each(t, function(e) {
u.push(this, e._segments)
}, [])));
var B, f = t.length;
return f > 1 && e ? (t !== e && this.setChildren(t), B = this) : 1 !== f || e || (t[0] !== this && this.setSegments(t[0].removeSegments()), B = this), B || ((B = new x(T.NO_INSERT)).addChildren(t), (B = B.reduce()).copyAttributes(this), this.replaceWith(B)), B
},
reorient: function(e, t) {
var A = this._children;
return A && A.length ? this.setChildren(g(this.removeChildren(), function(t) {
return !!(e ? t : 1 & t)
}, t)) : t !== r && this.setClockwise(t), this
},
getInteriorPoint: function() {
var A = this.getBounds().getCenter(!0);
if (!this.contains(A)) {
for (var o = this.getCurves(), n = A.y, i = [], a = [], r = 0, s = o.length; r < s; r++) {
var l = o[r].getValues(),
u = l[1],
c = l[3],
g = l[5],
d = l[7];
if (n >= e(u, c, g, d) && n <= t(u, c, g, d))
for (var h = Y.getMonoCurves(l), m = 0, p = h.length; m < p; m++) {
var E = h[m],
B = E[1],
f = E[7];
if (B !== f && (n >= B && n <= f || n >= f && n <= B)) {
var C = n === B ? E[0] : n === f ? E[6] : 1 === Y.solveCubic(E, 1, n, a, 0, 1) ? Y.getPoint(E, a[0]).x : (E[0] + E[6]) / 2;
i.push(C)
}
}
}
i.length > 1 && (i.sort(function(e, t) {
return e - t
}), A.x = (i[0] + i[1]) / 2)
}
return A
}
}
});
var _ = u.extend({
_class: "PathFlattener",
initialize: function(e, t, A, o, n) {
var i, a = [],
r = [],
s = 0,
l = 1 / (A || 32),
u = e._segments,
c = u[0];
function g(e, A) {
var i = Y.getValues(e, A, n);
a.push(i),
function e(A, n, i, a) {
if (!(a - i > l) || o && Y.isStraight(A) || Y.isFlatEnough(A, t || .25)) {
var u = A[6] - A[0],
c = A[7] - A[1],
g = Math.sqrt(u * u + c * c);
g > 0 && (s += g, r.push({
offset: s,
curve: A,
index: n,
time: a
}))
} else {
var d = Y.subdivide(A, .5),
h = (i + a) / 2;
e(d[0], n, i, h), e(d[1], n, h, a)
}
}(i, e._index, 0, 1)
}
for (var d = 1, h = u.length; d < h; d++) g(c, i = u[d]), c = i;
e._closed && g(i || c, u[0]), this.curves = a, this.parts = r, this.length = s, this.index = 0
},
_get: function(e) {
for (var t, A = this.parts, o = A.length, n = this.index; t = n, n && !(A[--n].offset < e););
for (; t < o; t++) {
var i = A[t];
if (i.offset >= e) {
this.index = t;
var a = A[t - 1],
r = a && a.index === i.index ? a.time : 0,
s = a ? a.offset : 0;
return {
index: i.index,
time: r + (i.time - r) * (e - s) / (i.offset - s)
}
}
}
return {
index: A[o - 1].index,
time: 1
}
},
drawPart: function(e, t, A) {
for (var o = this._get(t), n = this._get(A), i = o.index, a = n.index; i <= a; i++) {
var r = Y.getPart(this.curves[i], i === o.index ? o.time : 0, i === n.index ? n.time : 1);
i === o.index && e.moveTo(r[0], r[1]), e.bezierCurveTo.apply(e, r.slice(2))
}
}
}, u.each(Y._evaluateMethods, function(e) {
this[e + "At"] = function(t) {
var A = this._get(t);
return Y[e](this.curves[A.index], A.time)
}
}, {})),
P = u.extend({
initialize: function(e) {
for (var t, A = this.points = [], o = e._segments, n = e._closed, i = 0, a = o.length; i < a; i++) {
var r = o[i].point;
t && t.equals(r) || A.push(t = r.clone())
}
n && (A.unshift(A[A.length - 1]), A.push(A[1])), this.closed = n
},
fit: function(e) {
var t = this.points,
A = t.length,
o = null;
return A > 0 && (o = [new R(t[0])], A > 1 && (this.fitCubic(o, e, 0, A - 1, t[1].subtract(t[0]), t[A - 2].subtract(t[A - 1])), this.closed && (o.shift(), o.pop()))), o
},
fitCubic: function(e, t, A, o, n, i) {
var a = this.points;
if (o - A != 1) {
for (var r, s = this.chordLengthParameterize(A, o), l = Math.max(t, t * t), u = !0, c = 0; c <= 4; c++) {
var g = this.generateBezier(A, o, s, n, i),
d = this.findMaxError(A, o, g, s);
if (d.error < t && u) return void this.addCurve(e, g);
if (r = d.index, d.error >= l) break;
u = this.reparameterize(A, o, s, g), l = d.error
}
var h = a[r - 1].subtract(a[r + 1]);
this.fitCubic(e, t, A, r, n, h), this.fitCubic(e, t, r, o, h.negate(), i)
} else {
var m = a[A],
p = a[o],
E = m.getDistance(p) / 3;
this.addCurve(e, [m, m.add(n.normalize(E)), p.add(i.normalize(E)), p])
}
},
addCurve: function(e, t) {
e[e.length - 1].setHandleOut(t[1].subtract(t[0])), e.push(new R(t[3], t[2].subtract(t[3])))
},
generateBezier: function(e, t, A, o, n) {
for (var i = Math.abs, a = this.points, r = a[e], s = a[t], l = [
[0, 0],
[0, 0]
], u = [0, 0], c = 0, g = t - e + 1; c < g; c++) {
var d = A[c],
h = 1 - d,
m = 3 * d * h,
p = h * h * h,
E = m * h,
B = m * d,
f = d * d * d,
C = o.normalize(E),
w = n.normalize(B),
I = a[e + c].subtract(r.multiply(p + E)).subtract(s.multiply(B + f));
l[0][0] += C.dot(C), l[0][1] += C.dot(w), l[1][0] = l[0][1], l[1][1] += w.dot(w), u[0] += C.dot(I), u[1] += w.dot(I)
}
var y, b, M = l[0][0] * l[1][1] - l[1][0] * l[0][1];
if (i(M) > 1e-12) {
var T = l[0][0] * u[1] - l[1][0] * u[0];
y = (u[0] * l[1][1] - u[1] * l[0][1]) / M, b = T / M
} else {
var S = l[0][0] + l[0][1],
Q = l[1][0] + l[1][1];
y = b = i(S) > 1e-12 ? u[0] / S : i(Q) > 1e-12 ? u[1] / Q : 0
}
var D, k, N = s.getDistance(r),
v = 1e-12 * N;
if (y < v || b < v) y = b = N / 3;
else {
var O = s.subtract(r);
D = o.normalize(y), k = n.normalize(b), D.dot(O) - k.dot(O) > N * N && (y = b = N / 3, D = k = null)
}
return [r, r.add(D || o.normalize(y)), s.add(k || n.normalize(b)), s]
},
reparameterize: function(e, t, A, o) {
for (var n = e; n <= t; n++) A[n - e] = this.findRoot(o, this.points[n], A[n - e]);
n = 1;
for (var i = A.length; n < i; n++)
if (A[n] <= A[n - 1]) return !1;
return !0
},
findRoot: function(e, t, A) {
for (var o = [], n = [], i = 0; i <= 2; i++) o[i] = e[i + 1].subtract(e[i]).multiply(3);
for (i = 0; i <= 1; i++) n[i] = o[i + 1].subtract(o[i]).multiply(2);
var a = this.evaluate(3, e, A),
r = this.evaluate(2, o, A),
s = this.evaluate(1, n, A),
l = a.subtract(t),
u = r.dot(r) + l.dot(s);
return m.isZero(u) ? A : A - l.dot(r) / u
},
evaluate: function(e, t, A) {
for (var o = t.slice(), n = 1; n <= e; n++)
for (var i = 0; i <= e - n; i++) o[i] = o[i].multiply(1 - A).add(o[i + 1].multiply(A));
return o[0]
},
chordLengthParameterize: function(e, t) {
for (var A = [0], o = e + 1; o <= t; o++) A[o - e] = A[o - e - 1] + this.points[o].getDistance(this.points[o - 1]);
o = 1;
for (var n = t - e; o <= n; o++) A[o] /= A[n];
return A
},
findMaxError: function(e, t, A, o) {
for (var n = Math.floor((t - e + 1) / 2), i = 0, a = e + 1; a < t; a++) {
var r = this.evaluate(3, A, o[a - e]).subtract(this.points[a]),
s = r.x * r.x + r.y * r.y;
s >= i && (i = s, n = a)
}
return {
error: i,
index: n
}
}
}),
H = T.extend({
_class: "TextItem",
_applyMatrix: !1,
_canApplyMatrix: !1,
_serializeFields: {
content: null
},
_boundsOptions: {
stroke: !1,
handle: !1
},
initialize: function(e) {
this._content = "", this._lines = [];
var t = e && u.isPlainObject(e) && e.x === r && e.y === r;
this._initialize(t && e, !t && E.read(arguments))
},
_equals: function(e) {
return this._content === e._content
},
copyContent: function(e) {
this.setContent(e._content)
},
getContent: function() {
return this._content
},
setContent: function(e) {
this._content = "" + e, this._lines = this._content.split(/\r\n|\n|\r/gm), this._changed(521)
},
isEmpty: function() {
return !this._content
},
getCharacterStyle: "#getStyle",
setCharacterStyle: "#setStyle",
getParagraphStyle: "#getStyle",
setParagraphStyle: "#setStyle"
}),
j = H.extend({
_class: "PointText",
initialize: function() {
H.apply(this, arguments)
},
getPoint: function() {
var e = this._matrix.getTranslation();
return new B(e.x, e.y, this, "setPoint")
},
setPoint: function() {
var e = E.read(arguments);
this.translate(e.subtract(this._matrix.getTranslation()))
},
_draw: function(e, t, A) {
if (this._content) {
this._setStyles(e, t, A);
var o = this._lines,
n = this._style,
i = n.hasFill(),
a = n.hasStroke(),
r = n.getLeading(),
s = e.shadowColor;
e.font = n.getFontStyle(), e.textAlign = n.getJustification();
for (var l = 0, u = o.length; l < u; l++) {
e.shadowColor = s;
var c = o[l];
i && (e.fillText(c, 0, 0), e.shadowColor = "rgba(0,0,0,0)"), a && e.strokeText(c, 0, 0), e.translate(0, r)
}
}
},
_getBounds: function(e, t) {
var A = t.drawnTextBounds ? this._getDrawnTextSize() : this._getMeasuredTextSize();
return e ? e._transformBounds(A, A) : A
},
_getMeasuredTextSize: function() {
var e = this._style,
t = this._lines,
A = t.length,
o = e.getJustification(),
n = e.getLeading(),
i = this.getView().getTextWidth(e.getFontStyle(), t),
a = 0;
return "left" !== o && (a -= i / ("center" === o ? 2 : 1)), new w(a, A ? -.75 * n : 0, i, A * n)
},
_getDrawnTextSize: function() {
var e = this._style,
t = this._lines,
A = t.length,
o = e.getLeading(),
n = e.getJustification(),
i = se.create("svg", {
version: "1.1",
xmlns: se.svg
}),
a = se.create("text");
a.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), i.appendChild(a);
for (var r = 0; r < A; r++) {
var s = se.create("tspan", {
x: "0",
dy: 0 === r ? "0" : o + "px"
});
s.textContent = this._lines[r], a.appendChild(s)
}
var u, c = l.createElement("span");
c.style.visibility = "hidden", c.style.whiteSpace = "pre", c.style.fontSize = this.fontSize + "px", c.style.fontFamily = this.font, c.style.lineHeight = this.leading / this.fontSize;
try {
c.appendChild(i), l.body.appendChild(c), u = i.getBBox()
} finally {
l.body.removeChild(c)
}
var g = this.strokeWidth / 2,
d = u.width + 2 * g,
h = u.height + 2 * g,
m = u.x - g,
p = u.y - g;
"left" !== n && (m -= this.getView().getTextWidth(e.getFontStyle(), t) / ("center" === n ? 2 : 1));
return new w(m, p, d + 1, Math.max(h, A * o))
},
_hitTestSelf: function(e, t) {
if (t.fill && (this.hasFill() || t.hitUnfilledPaths) && this._contains(e)) return new O("fill", this)
}
}),
z = u.extend(new function() {
var e, t = {
gray: ["gray"],
rgb: ["red", "green", "blue"],
hsb: ["hue", "saturation", "brightness"],
hsl: ["hue", "saturation", "lightness"],
gradient: ["gradient", "origin", "destination", "highlight"]
},
A = {},
o = {
transparent: [0, 0, 0, 0]
};
var n = [
[0, 3, 1],
[2, 0, 1],
[1, 0, 3],
[1, 2, 0],
[3, 1, 0],
[0, 1, 2]
],
i = {
"rgb-hsb": function(e, t, A) {
var o = Math.max(e, t, A),
n = o - Math.min(e, t, A);
return [0 === n ? 0 : 60 * (o == e ? (t - A) / n + (t < A ? 6 : 0) : o == t ? (A - e) / n + 2 : (e - t) / n + 4), 0 === o ? 0 : n / o, o]
},
"hsb-rgb": function(e, t, A) {
var o, i = (e = (e / 60 % 6 + 6) % 6) - (o = Math.floor(e)),
a = [A, A * (1 - t), A * (1 - t * i), A * (1 - t * (1 - i))];
return [a[(o = n[o])[0]], a[o[1]], a[o[2]]]
},
"rgb-hsl": function(e, t, A) {
var o = Math.max(e, t, A),
n = Math.min(e, t, A),
i = o - n,
a = 0 === i,
r = (o + n) / 2;
return [a ? 0 : 60 * (o == e ? (t - A) / i + (t < A ? 6 : 0) : o == t ? (A - e) / i + 2 : (e - t) / i + 4), a ? 0 : r < .5 ? i / (o + n) : i / (2 - o - n), r]
},
"hsl-rgb": function(e, t, A) {
if (e = (e / 360 % 1 + 1) % 1, 0 === t) return [A, A, A];
for (var o = [e + 1 / 3, e, e - 1 / 3], n = A < .5 ? A * (1 + t) : A + t - A * t, i = 2 * A - n, a = [], r = 0; r < 3; r++) {
var s = o[r];
s < 0 && (s += 1), s > 1 && (s -= 1), a[r] = 6 * s < 1 ? i + 6 * (n - i) * s : 2 * s < 1 ? n : 3 * s < 2 ? i + (n - i) * (2 / 3 - s) * 6 : i
}
return a
},
"rgb-gray": function(e, t, A) {
return [.2989 * e + .587 * t + .114 * A]
},
"gray-rgb": function(e) {
return [e, e, e]
},
"gray-hsb": function(e) {
return [0, 0, e]
},
"gray-hsl": function(e) {
return [0, 0, e]
},
"gradient-rgb": function() {
return []
},
"rgb-gradient": function() {
return []
}
};
return u.each(t, function(e, o) {
A[o] = [], u.each(e, function(e, n) {
var i = u.capitalize(e),
a = /^(hue|saturation)$/.test(e),
r = A[o][n] = "gradient" === o ? "gradient" === e ? function(e) {
var t = this._components[0];
return t !== (e = K.read(Array.isArray(e) ? e : arguments, 0, {
readNull: !0
})) && (t && t._removeOwner(this), e && e._addOwner(this)), e
} : function() {
return E.read(arguments, 0, {
readNull: "highlight" === e,
clone: !0
})
} : function(e) {
return null == e || isNaN(e) ? 0 : +e
};
this["get" + i] = function() {
return this._type === o || a && /^hs[bl]$/.test(this._type) ? this._components[n] : this._convert(o)[n]
}, this["set" + i] = function(e) {
this._type === o || a && /^hs[bl]$/.test(this._type) || (this._components = this._convert(o), this._properties = t[o], this._type = o), this._components[n] = r.call(this, e), this._changed()
}
}, this)
}, {
_class: "Color",
_readIndex: !0,
initialize: function n(i) {
var a, r, l, c, g = arguments,
d = this.__read,
h = 0;
Array.isArray(i) && (i = (g = i)[0]);
var m = null != i && typeof i;
if ("string" === m && i in t && (a = i, i = g[1], Array.isArray(i) ? (r = i, l = g[2]) : (d && (h = 1), g = u.slice(g, 1), m = typeof i)), !r) {
if (c = "number" === m ? g : "object" === m && null != i.length ? i : null) {
a || (a = c.length >= 3 ? "rgb" : "gray");
var p = t[a].length;
l = c[p], d && (h += c === arguments ? p + (null != l ? 1 : 0) : 1), c.length > p && (c = u.slice(c, 0, p))
} else if ("string" === m) {
var E = function(t) {
var A, n = t.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})([\da-f]{2})?$/i) || t.match(/^#([\da-f])([\da-f])([\da-f])([\da-f])?$/i),
i = "rgb";
if (n) {
var a = n[4] ? 4 : 3;
A = new Array(a);
for (var r = 0; r < a; r++) {
var l = n[r + 1];
A[r] = parseInt(1 == l.length ? l + l : l, 16) / 255
}
} else if (n = t.match(/^(rgb|hsl)a?\((.*)\)$/)) {
i = n[1], A = n[2].split(/[,\s]+/g);
for (var u = "hsl" === i, c = (r = 0, Math.min(A.length, 4)); r < c; r++) {
var g = A[r];
if (l = parseFloat(g), u)
if (0 === r) {
var d = g.match(/([a-z]*)$/)[1];
l *= {
turn: 360,
rad: 180 / Math.PI,
grad: .9
}[d] || 1
} else r < 3 && (l /= 100);
else r < 3 && (l /= 255);
A[r] = l
}
} else {
var h = o[t];
if (!h)
if (s) {
e || ((e = ae.getContext(1, 1)).globalCompositeOperation = "copy"), e.fillStyle = "rgba(0,0,0,0)", e.fillStyle = t, e.fillRect(0, 0, 1, 1);
var m = e.getImageData(0, 0, 1, 1).data;
h = o[t] = [m[0] / 255, m[1] / 255, m[2] / 255]
} else h = [0, 0, 0];
A = h.slice()
}
return [i, A]
}(i);
a = E[0], 4 === (r = E[1]).length && (l = r[3], r.length--)
} else if ("object" === m)
if (i.constructor === n) {
if (a = i._type, r = i._components.slice(), l = i._alpha, "gradient" === a)
for (var B = 1, f = r.length; B < f; B++) {
var C = r[B];
C && (r[B] = C.clone())
}
} else if (i.constructor === K) a = "gradient", c = g;
else {
var w = t[a = "hue" in i ? "lightness" in i ? "hsl" : "hsb" : "gradient" in i || "stops" in i || "radial" in i ? "gradient" : "gray" in i ? "gray" : "rgb"],
I = A[a];
this._components = r = [];
for (B = 0, f = w.length; B < f; B++) {
null == (y = i[w[B]]) && !B && "gradient" === a && "stops" in i && (y = {
stops: i.stops,
radial: i.radial
}), null != (y = I[B].call(this, y)) && (r[B] = y)
}
l = i.alpha
}
d && a && (h = 1)
}
if (this._type = a || "rgb", !r) {
this._components = r = [];
for (B = 0, f = (I = A[this._type]).length; B < f; B++) {
var y;
null != (y = I[B].call(this, c && c[B])) && (r[B] = y)
}
}
return this._components = r, this._properties = t[this._type], this._alpha = l, d && (this.__read = h), this
},
set: "#initialize",
_serialize: function(e, t) {
var A = this.getComponents();
return u.serialize(/^(gray|rgb)$/.test(this._type) ? A : [this._type].concat(A), e, !0, t)
},
_changed: function() {
this._canvasStyle = null, this._owner && this._owner._changed(129)
},
_convert: function(e) {
var t;
return this._type === e ? this._components.slice() : (t = i[this._type + "-" + e]) ? t.apply(this, this._components) : i["rgb-" + e].apply(this, i[this._type + "-rgb"].apply(this, this._components))
},
convert: function(e) {
return new z(e, this._convert(e), this._alpha)
},
getType: function() {
return this._type
},
setType: function(e) {
this._components = this._convert(e), this._properties = t[e], this._type = e
},
getComponents: function() {
var e = this._components.slice();
return null != this._alpha && e.push(this._alpha), e
},
getAlpha: function() {
return null != this._alpha ? this._alpha : 1
},
setAlpha: function(e) {
this._alpha = null == e ? null : Math.min(Math.max(e, 0), 1), this._changed()
},
hasAlpha: function() {
return null != this._alpha
},
equals: function(e) {
var t = u.isPlainValue(e, !0) ? z.read(arguments) : e;
return t === this || t && this._class === t._class && this._type === t._type && this.getAlpha() === t.getAlpha() && u.equals(this._components, t._components) || !1
},
toString: function() {
for (var e = this._properties, t = [], A = "gradient" === this._type, o = h.instance, n = 0, i = e.length; n < i; n++) {
var a = this._components[n];
null != a && t.push(e[n] + ": " + (A ? a : o.number(a)))
}
return null != this._alpha && t.push("alpha: " + o.number(this._alpha)), "{ " + t.join(", ") + " }"
},
toCSS: function(e) {
var t = this._convert("rgb"),
A = e || null == this._alpha ? 1 : this._alpha;
function o(e) {
return Math.round(255 * (e < 0 ? 0 : e > 1 ? 1 : e))
}
return t = [o(t[0]), o(t[1]), o(t[2])], A < 1 && t.push(A < 0 ? 0 : A), e ? "#" + ((1 << 24) + (t[0] << 16) + (t[1] << 8) + t[2]).toString(16).slice(1) : (4 == t.length ? "rgba(" : "rgb(") + t.join(",") + ")"
},
toCanvasStyle: function(e, t) {
if (this._canvasStyle) return this._canvasStyle;
if ("gradient" !== this._type) return this._canvasStyle = this.toCSS();
var A, o = this._components,
n = o[0],
i = n._stops,
a = o[1],
r = o[2],
s = o[3],
l = t && t.inverted();
if (l && (a = l._transformPoint(a), r = l._transformPoint(r), s && (s = l._transformPoint(s))), n._radial) {
var u = r.getDistance(a);
if (s) {
var c = s.subtract(a);
c.getLength() > u && (s = a.add(c.normalize(u - .1)))
}
var g = s || a;
A = e.createRadialGradient(g.x, g.y, 0, a.x, a.y, u)
} else A = e.createLinearGradient(a.x, a.y, r.x, r.y);
for (var d = 0, h = i.length; d < h; d++) {
var m = i[d],
p = m._offset;
A.addColorStop(null == p ? d / (h - 1) : p, m._color.toCanvasStyle())
}
return this._canvasStyle = A
},
transform: function(e) {
if ("gradient" === this._type) {
for (var t = this._components, A = 1, o = t.length; A < o; A++) {
var n = t[A];
e._transformPoint(n, n, !0)
}
this._changed()
}
},
statics: {
_types: t,
random: function() {
var e = Math.random;
return new z(e(), e(), e())
}
}
})
}, new function() {
return u.each({
add: function(e, t) {
return e + t
},
subtract: function(e, t) {
return e - t
},
multiply: function(e, t) {
return e * t
},
divide: function(e, t) {
return e / t
}
}, function(e, t) {
this[t] = function(t) {
t = z.read(arguments);
for (var A = this._type, o = this._components, n = t._convert(A), i = 0, a = o.length; i < a; i++) n[i] = e(o[i], n[i]);
return new z(A, n, null != this._alpha ? e(this._alpha, t.getAlpha()) : null)
}
}, {})
}),
K = u.extend({
_class: "Gradient",
initialize: function(e, t) {
this._id = p.get(), e && u.isPlainObject(e) && (this.set(e), e = t = null), null == this._stops && this.setStops(e || ["white", "black"]), null == this._radial && this.setRadial("string" == typeof t && "radial" === t || t || !1)
},
_serialize: function(e, t) {
return t.add(this, function() {
return u.serialize([this._stops, this._radial], e, !0, t)
})
},
_changed: function() {
for (var e = 0, t = this._owners && this._owners.length; e < t; e++) this._owners[e]._changed()
},
_addOwner: function(e) {
this._owners || (this._owners = []), this._owners.push(e)
},
_removeOwner: function(e) {
var t = this._owners ? this._owners.indexOf(e) : -1; - 1 != t && (this._owners.splice(t, 1), this._owners.length || (this._owners = r))
},
clone: function() {
for (var e = [], t = 0, A = this._stops.length; t < A; t++) e[t] = this._stops[t].clone();
return new K(e, this._radial)
},
getStops: function() {
return this._stops
},
setStops: function(e) {
if (e.length < 2) throw new Error("Gradient stop list needs to contain at least two stops.");
var t = this._stops;
if (t)
for (var A = 0, o = t.length; A < o; A++) t[A]._owner = r;
for (A = 0, o = (t = this._stops = J.readList(e, 0, {
clone: !0
})).length; A < o; A++) t[A]._owner = this;
this._changed()
},
getRadial: function() {
return this._radial
},
setRadial: function(e) {
this._radial = e, this._changed()
},
equals: function(e) {
if (e === this) return !0;
if (e && this._class === e._class) {
var t = this._stops,
A = e._stops,
o = t.length;
if (o === A.length) {
for (var n = 0; n < o; n++)
if (!t[n].equals(A[n])) return !1;
return !0
}
}
return !1
}
}),
J = u.extend({
_class: "GradientStop",
initialize: function(e, t) {
var A = e,
o = t;
"object" == typeof e && t === r && (Array.isArray(e) && "number" != typeof e[0] ? (A = e[0], o = e[1]) : ("color" in e || "offset" in e || "rampPoint" in e) && (A = e.color, o = e.offset || e.rampPoint || 0)), this.setColor(A), this.setOffset(o)
},
clone: function() {
return new J(this._color.clone(), this._offset)
},
_serialize: function(e, t) {
var A = this._color,
o = this._offset;
return u.serialize(null == o ? [A] : [A, o], e, !0, t)
},
_changed: function() {
this._owner && this._owner._changed(129)
},
getOffset: function() {
return this._offset
},
setOffset: function(e) {
this._offset = e, this._changed()
},
getRampPoint: "#getOffset",
setRampPoint: "#setOffset",
getColor: function() {
return this._color
},
setColor: function() {
var e = z.read(arguments, 0, {
clone: !0
});
e && (e._owner = this), this._color = e, this._changed()
},
equals: function(e) {
return e === this || e && this._class === e._class && this._color.equals(e._color) && this._offset == e._offset || !1
}
}),
V = u.extend(new function() {
var e = {
fillColor: null,
fillRule: "nonzero",
strokeColor: null,
strokeWidth: 1,
strokeCap: "butt",
strokeJoin: "miter",
strokeScaling: !0,
miterLimit: 10,
dashOffset: 0,
dashArray: [],
shadowColor: null,
shadowBlur: 0,
shadowOffset: new E,
selectedColor: null
},
t = u.set({}, e, {
fontFamily: "sans-serif",
fontWeight: "normal",
fontSize: 12,
leading: null,
justification: "left"
}),
A = u.set({}, t, {
fillColor: new z
}),
o = {
strokeWidth: 193,
strokeCap: 193,
strokeJoin: 193,
strokeScaling: 201,
miterLimit: 193,
fontFamily: 9,
fontWeight: 9,
fontSize: 9,
font: 9,
leading: 9,
justification: 9
},
n = {
beans: !0
},
i = {
_class: "Style",
beans: !0,
initialize: function(o, n, i) {
this._values = {}, this._owner = n, this._project = n && n._project || i || ue.project, this._defaults = !n || n instanceof S ? t : n instanceof H ? A : e, o && this.set(o)
}
};
return u.each(t, function(e, t) {
var A = /Color$/.test(t),
a = "shadowOffset" === t,
s = u.capitalize(t),
l = o[t],
c = "set" + s,
g = "get" + s;
i[c] = function(e) {
var o = this._owner,
n = o && o._children;
if (n && n.length > 0 && !(o instanceof x))
for (var i = 0, a = n.length; i < a; i++) n[i]._style[c](e);
else if (t in this._defaults) {
var s = this._values[t];
s !== e && (A && (s && s._owner !== r && (s._owner = r, s._canvasStyle = null), e && e.constructor === z && (e._owner && (e = e.clone()), e._owner = o)), this._values[t] = e, o && o._changed(l || 129))
}
}, i[g] = function(e) {
var o, n = this._owner,
i = n && n._children;
if (t in this._defaults && (!i || !i.length || e || n instanceof x))
if ((o = this._values[t]) === r)(o = this._defaults[t]) && o.clone && (o = o.clone());
else {
var s = A ? z : a ? E : null;
!s || o && o.constructor === s || (this._values[t] = o = s.read([o], 0, {
readNull: !0,
clone: !0
}), o && A && (o._owner = n))
} else if (i)
for (var l = 0, c = i.length; l < c; l++) {
var d = i[l]._style[g]();
if (l) {
if (!u.equals(o, d)) return r
} else o = d
}
return o
}, n[g] = function(e) {
return this._style[g](e)
}, n[c] = function(e) {
this._style[c](e)
}
}), u.each({
Font: "FontFamily",
WindingRule: "FillRule"
}, function(e, t) {
var A = "get" + t,
o = "set" + t;
i[A] = n[A] = "#get" + e, i[o] = n[o] = "#set" + e
}), T.inject(n), i
}, {
set: function(e) {
var t = e instanceof V,
A = t ? e._values : e;
if (A)
for (var o in A)
if (o in this._defaults) {
var n = A[o];
this[o] = n && t && n.clone ? n.clone() : n
}
},
equals: function(e) {
function t(e, t, A) {
var o = e._values,
n = t._values,
i = t._defaults;
for (var a in o) {
var s = o[a],
l = n[a];
if (!(A && a in n || u.equals(s, l === r ? i[a] : l))) return !1
}
return !0
}
return e === this || e && this._class === e._class && t(this, e) && t(e, this, !0) || !1
},
_dispose: function() {
var e;
(e = this.getFillColor()) && (e._canvasStyle = null), (e = this.getStrokeColor()) && (e._canvasStyle = null), (e = this.getShadowColor()) && (e._canvasStyle = null)
},
hasFill: function() {
var e = this.getFillColor();
return !!e && e.alpha > 0
},
hasStroke: function() {
var e = this.getStrokeColor();
return !!e && e.alpha > 0 && this.getStrokeWidth() > 0
},
hasShadow: function() {
var e = this.getShadowColor();
return !!e && e.alpha > 0 && (this.getShadowBlur() > 0 || !this.getShadowOffset().isZero())
},
getView: function() {
return this._project._view
},
getFontStyle: function() {
var e = this.getFontSize();
return this.getFontWeight() + " " + e + (/[a-z]/i.test(e + "") ? " " : "px ") + this.getFontFamily()
},
getFont: "#getFontFamily",
setFont: "#setFontFamily",
getLeading: function e() {
var t = e.base.call(this),
A = this.getFontSize();
return /pt|em|%|px/.test(A) && (A = this.getView().getPixelSize(A)), null != t ? t : 1.2 * A
}
}),
W = new function() {
function e(e, t, A, o) {
for (var n = ["", "webkit", "moz", "Moz", "ms", "o"], i = t[0].toUpperCase() + t.substring(1), a = 0; a < 6; a++) {
var r = n[a],
s = r ? r + i : t;
if (s in e) {
if (!A) return e[s];
e[s] = o;
break
}
}
}
return {
getStyles: function(e) {
var t = e && 9 !== e.nodeType ? e.ownerDocument : e,
A = t && t.defaultView;
return A && A.getComputedStyle(e, "")
},
getBounds: function(e, t) {
var A, o = e.ownerDocument,
n = o.body,
i = o.documentElement;
try {
A = e.getBoundingClientRect()
} catch (e) {
A = {
left: 0,
top: 0,
width: 0,
height: 0
}
}
var a = A.left - (i.clientLeft || n.clientLeft || 0),
r = A.top - (i.clientTop || n.clientTop || 0);
if (!t) {
var s = o.defaultView;
a += s.pageXOffset || i.scrollLeft || n.scrollLeft, r += s.pageYOffset || i.scrollTop || n.scrollTop
}
return new w(a, r, A.width, A.height)
},
getViewportBounds: function(e) {
var t = e.ownerDocument,
A = t.defaultView,
o = t.documentElement;
return new w(0, 0, A.innerWidth || o.clientWidth, A.innerHeight || o.clientHeight)
},
getOffset: function(e, t) {
return W.getBounds(e, t).getPoint()
},
getSize: function(e) {
return W.getBounds(e, !0).getSize()
},
isInvisible: function(e) {
return W.getSize(e).equals(new f(0, 0))
},
isInView: function(e) {
return !W.isInvisible(e) && W.getViewportBounds(e).intersects(W.getBounds(e, !0))
},
isInserted: function(e) {
return l.body.contains(e)
},
getPrefixed: function(t, A) {
return t && e(t, A)
},
setPrefixed: function(t, A, o) {
if ("object" == typeof A)
for (var n in A) e(t, n, !0, A[n]);
else e(t, A, !0, o)
}
}
},
q = {
add: function(e, t) {
if (e)
for (var A in t)
for (var o = t[A], n = A.split(/[\s,]+/g), i = 0, a = n.length; i < a; i++) {
var r = n[i],
s = e === l && ("touchstart" === r || "touchmove" === r) && {
passive: !1
};
e.addEventListener(r, o, s)
}
},
remove: function(e, t) {
if (e)
for (var A in t)
for (var o = t[A], n = A.split(/[\s,]+/g), i = 0, a = n.length; i < a; i++) e.removeEventListener(n[i], o, !1)
},
getPoint: function(e) {
var t = e.targetTouches ? e.targetTouches.length ? e.targetTouches[0] : e.changedTouches[0] : e;
return new E(t.pageX || t.clientX + l.documentElement.scrollLeft, t.pageY || t.clientY + l.documentElement.scrollTop)
},
getTarget: function(e) {
return e.target || e.srcElement
},
getRelatedTarget: function(e) {
return e.relatedTarget || e.toElement
},
getOffset: function(e, t) {
return q.getPoint(e).subtract(W.getOffset(t || q.getTarget(e)))
}
};
q.requestAnimationFrame = new function() {
var e, t = W.getPrefixed(s, "requestAnimationFrame"),
A = !1,
o = [];
function n() {
var e = o;
o = [];
for (var i = 0, a = e.length; i < a; i++) e[i]();
(A = t && o.length) && t(n)
}
return function(i) {
o.push(i), t ? A || (t(n), A = !0) : e || (e = setInterval(n, 1e3 / 60))
}
};
var X = u.extend(c, {
_class: "View",
initialize: function e(t, A) {
function o(e) {
return A[e] || parseInt(A.getAttribute(e), 10)
}
function n() {
var e = W.getSize(A);
return e.isNaN() || e.isZero() ? new f(o("width"), o("height")) : e
}
var i;
if (s && A) {
this._id = A.getAttribute("id"), null == this._id && A.setAttribute("id", this._id = "view-" + e._id++), q.add(A, this._viewEvents);
if (W.setPrefixed(A.style, {
userDrag: "none",
userSelect: "none",
touchCallout: "none",
contentZooming: "none",
tapHighlightColor: "rgba(0,0,0,0)"
}), g.hasAttribute(A, "resize")) {
var a = this;
q.add(s, this._windowEvents = {
resize: function() {
a.setViewSize(n())
}
})
}
if (i = n(), g.hasAttribute(A, "stats") && "undefined" != typeof Stats) {
this._stats = new Stats;
var r = this._stats.domElement,
u = r.style,
c = W.getOffset(A);
u.position = "absolute", u.left = c.x + "px", u.top = c.y + "px", l.body.appendChild(r)
}
} else i = new f(A), A = null;
this._project = t, this._scope = t._scope, this._element = A, this._pixelRatio || (this._pixelRatio = s && s.devicePixelRatio || 1), this._setElementSize(i.width, i.height), this._viewSize = i, e._views.push(this), e._viewsById[this._id] = this, (this._matrix = new y)._owner = this, e._focused || (e._focused = this), this._frameItems = {}, this._frameItemCount = 0, this._itemEvents = {
native: {},
virtual: {}
}, this._autoUpdate = !ue.agent.node, this._needsUpdate = !1
},
remove: function() {
if (!this._project) return !1;
X._focused === this && (X._focused = null), X._views.splice(X._views.indexOf(this), 1), delete X._viewsById[this._id];
var e = this._project;
return e._view === this && (e._view = null), q.remove(this._element, this._viewEvents), q.remove(s, this._windowEvents), this._element = this._project = null, this.off("frame"), this._animate = !1, this._frameItems = {}, !0
},
_events: u.each(T._itemHandlers.concat(["onResize", "onKeyDown", "onKeyUp"]), function(e) {
this[e] = {}
}, {
onFrame: {
install: function() {
this.play()
},
uninstall: function() {
this.pause()
}
}
}),
_animate: !1,
_time: 0,
_count: 0,
getAutoUpdate: function() {
return this._autoUpdate
},
setAutoUpdate: function(e) {
this._autoUpdate = e, e && this.requestUpdate()
},
update: function() {},
draw: function() {
this.update()
},
requestUpdate: function() {
if (!this._requested) {
var e = this;
q.requestAnimationFrame(function() {
if (e._requested = !1, e._animate) {
e.requestUpdate();
var t = e._element;
W.getPrefixed(l, "hidden") && "true" !== g.getAttribute(t, "keepalive") || !W.isInView(t) || e._handleFrame()
}
e._autoUpdate && e.update()
}), this._requested = !0
}
},
play: function() {
this._animate = !0, this.requestUpdate()
},
pause: function() {
this._animate = !1
},
_handleFrame: function() {
ue = this._scope;
var e = Date.now() / 1e3,
t = this._last ? e - this._last : 0;
this._last = e, this.emit("frame", new u({
delta: t,
time: this._time += t,
count: this._count++
})), this._stats && this._stats.update()
},
_animateItem: function(e, t) {
var A = this._frameItems;
t ? (A[e._id] = {
item: e,
time: 0,
count: 0
}, 1 == ++this._frameItemCount && this.on("frame", this._handleFrameItems)) : (delete A[e._id], 0 == --this._frameItemCount && this.off("frame", this._handleFrameItems))
},
_handleFrameItems: function(e) {
for (var t in this._frameItems) {
var A = this._frameItems[t];
A.item.emit("frame", new u(e, {
time: A.time += e.delta,
count: A.count++
}))
}
},
_changed: function() {
this._project._changed(4097), this._bounds = this._decomposed = r
},
getElement: function() {
return this._element
},
getPixelRatio: function() {
return this._pixelRatio
},
getResolution: function() {
return 72 * this._pixelRatio
},
getViewSize: function() {
var e = this._viewSize;
return new C(e.width, e.height, this, "setViewSize")
},
setViewSize: function() {
var e = f.read(arguments),
t = e.subtract(this._viewSize);
t.isZero() || (this._setElementSize(e.width, e.height), this._viewSize.set(e), this._changed(), this.emit("resize", {
size: e,
delta: t
}), this._autoUpdate && this.update())
},
_setElementSize: function(e, t) {
var A = this._element;
A && (A.width !== e && (A.width = e), A.height !== t && (A.height = t))
},
getBounds: function() {
return this._bounds || (this._bounds = this._matrix.inverted()._transformBounds(new w(new E, this._viewSize))), this._bounds
},
getSize: function() {
return this.getBounds().getSize()
},
isVisible: function() {
return W.isInView(this._element)
},
isInserted: function() {
return W.isInserted(this._element)
},
getPixelSize: function(e) {
var t, A = this._element;
if (A) {
var o = A.parentNode,
n = l.createElement("div");
n.style.fontSize = e, o.appendChild(n), t = parseFloat(W.getStyles(n).fontSize), o.removeChild(n)
} else t = parseFloat(t);
return t
},
getTextWidth: function(e, t) {
return 0
}
}, u.each(["rotate", "scale", "shear", "skew"], function(e) {
var t = "rotate" === e;
this[e] = function() {
var A = (t ? u : E).read(arguments),
o = E.read(arguments, 0, {
readNull: !0
});
return this.transform((new y)[e](A, o || this.getCenter(!0)))
}
}, {
_decompose: function() {
return this._decomposed || (this._decomposed = this._matrix.decompose())
},
translate: function() {
var e = new y;
return this.transform(e.translate.apply(e, arguments))
},
getCenter: function() {
return this.getBounds().getCenter()
},
setCenter: function() {
var e = E.read(arguments);
this.translate(this.getCenter().subtract(e))
},
getZoom: function() {
var e = this._decompose().scaling;
return (e.x + e.y) / 2
},
setZoom: function(e) {
this.transform((new y).scale(e / this.getZoom(), this.getCenter()))
},
getRotation: function() {
return this._decompose().rotation
},
setRotation: function(e) {
var t = this.getRotation();
null != t && null != e && this.rotate(e - t)
},
getScaling: function() {
var e = this._decompose().scaling;
return new B(e.x, e.y, this, "setScaling")
},
setScaling: function() {
var e = this.getScaling(),
t = E.read(arguments, 0, {
clone: !0,
readNull: !0
});
e && t && this.scale(t.x / e.x, t.y / e.y)
},
getMatrix: function() {
return this._matrix
},
setMatrix: function() {
var e = this._matrix;
e.initialize.apply(e, arguments)
},
transform: function(e) {
this._matrix.append(e)
},
scrollBy: function() {
this.translate(E.read(arguments).negate())
}
}), {
projectToView: function() {
return this._matrix._transformPoint(E.read(arguments))
},
viewToProject: function() {
return this._matrix._inverseTransform(E.read(arguments))
},
getEventPoint: function(e) {
return this.viewToProject(q.getOffset(e, this._element))
}
}, {
statics: {
_views: [],
_viewsById: {},
_id: 0,
create: function(e, t) {
return l && "string" == typeof t && (t = l.getElementById(t)), new(s ? Z : X)(e, t)
}
}
}, new function() {
if (s) {
var e, t, A, o, n, i = !1,
a = !1,
r = s.navigator;
r.pointerEnabled || r.msPointerEnabled ? (A = "pointerdown MSPointerDown", o = "pointermove MSPointerMove", n = "pointerup pointercancel MSPointerUp MSPointerCancel") : (A = "touchstart", o = "touchmove", n = "touchend touchcancel", "ontouchstart" in s && r.userAgent.match(/mobile|tablet|ip(ad|hone|od)|android|silk/i) || (A += " mousedown", o += " mousemove", n += " mouseup"));
var u = {},
c = {
mouseout: function(e) {
var t = X._focused,
A = q.getRelatedTarget(e);
if (t && (!A || "HTML" === A.nodeName)) {
var o = q.getOffset(e, t._element),
n = o.x,
i = Math.abs,
a = i(n),
r = a - (1 << 25);
o.x = i(r) < a ? r * (n < 0 ? -1 : 1) : n, S(t, e, t.viewToProject(o))
}
},
scroll: T
};
u[A] = function(e) {
var t = X._focused = M(e);
i || (i = !0, t._handleMouseEvent("mousedown", e))
}, c[o] = function(A) {
var o = X._focused;
if (!a) {
var n = M(A);
n ? o !== n && (o && S(o, A), e || (e = o), o = X._focused = t = n) : t && t === o && (e && !e.isInserted() && (e = null), o = X._focused = e, e = null, T())
}
o && S(o, A)
}, c[A] = function() {
a = !0
}, c[n] = function(e) {
var t = X._focused;
t && i && t._handleMouseEvent("mouseup", e), a = i = !1
}, q.add(l, c), q.add(s, {
load: T
});
var g, d, h, m, p, E, B, f, C = !1,
w = !1,
I = {
doubleclick: "click",
mousedrag: "mousemove"
},
y = !1,
b = {
mousedown: {
mousedown: 1,
mousedrag: 1,
click: 1,
doubleclick: 1
},
mouseup: {
mouseup: 1,
mousedrag: 1,
click: 1,
doubleclick: 1
},
mousemove: {
mousedrag: 1,
mousemove: 1,
mouseenter: 1,
mouseleave: 1
}
};
return {
_viewEvents: u,
_handleMouseEvent: function(e, t, A) {
var o = this._itemEvents,
n = o.native[e],
a = "mousemove" === e,
r = this._scope.tool,
s = this;
function l(e) {
return o.virtual[e] || s.responds(e) || r && r.responds(e)
}
a && i && l("mousedrag") && (e = "mousedrag"), A || (A = this.getEventPoint(t));
var u = this.getBounds().contains(A),
c = n && u && s._project.hitTest(A, {
tolerance: 0,
fill: !0,
stroke: !0
}),
I = c && c.item || null,
b = !1,
M = {};
if (M[e.substr(5)] = !0, n && I !== m && (m && Q(m, null, "mouseleave", t, A), I && Q(I, null, "mouseenter", t, A), m = I), y ^ u && (Q(this, null, u ? "mouseenter" : "mouseleave", t, A), u ? this : null, b = !0), !u && !M.drag || A.equals(d) || (D(this, I, a ? e : "mousemove", t, A, d), b = !0), y = u, M.down && u || M.up && g) {
if (D(this, I, e, t, A, g), M.down) {
if (f = I === E && Date.now() - B < 300, h = E = I, !w && I) {
for (var T = I; T && !T.responds("mousedrag");) T = T._parent;
T && (p = I)
}
g = A
} else M.up && (w || I !== h || (B = Date.now(), D(this, I, f ? "doubleclick" : "click", t, A, g), f = !1), h = p = null);
y = !1, b = !0
}
d = A, b && r && (C = r._handleMouseEvent(e, t, A, M) || C), !1 !== t.cancelable && (C && !M.move || M.down && l("mouseup")) && t.preventDefault()
},
_handleKeyEvent: function(e, t, A, o) {
var n, i = this._scope,
a = i.tool;
function r(a) {
a.responds(e) && (ue = i, a.emit(e, n = n || new ee(e, t, A, o)))
}
this.isVisible() && (r(this), a && a.responds(e) && r(a))
},
_countItemEvent: function(e, t) {
var A = this._itemEvents,
o = A.native,
n = A.virtual;
for (var i in b) o[i] = (o[i] || 0) + (b[i][e] || 0) * t;
n[e] = (n[e] || 0) + t
},
statics: {
updateFocus: T,
_resetState: function() {
i = a = C = y = !1, e = t = g = d = h = m = p = E = B = f = null
}
}
}
}
function M(e) {
var t = q.getTarget(e);
return t.getAttribute && X._viewsById[t.getAttribute("id")]
}
function T() {
var e = X._focused;
if (!e || !e.isVisible())
for (var A = 0, o = X._views.length; A < o; A++)
if ((e = X._views[A]).isVisible()) {
X._focused = t = e;
break
}
}
function S(e, t, A) {
e._handleMouseEvent("mousemove", t, A)
}
function Q(e, t, A, o, n, i, a) {
var r, s = !1;
function l(e, A) {
if (e.responds(A)) {
if (r || (r = new Ae(A, o, n, t || e, i ? n.subtract(i) : null)), e.emit(A, r) && (C = !0, r.prevented && (w = !0), r.stopped)) return s = !0
} else {
var a = I[A];
if (a) return l(e, a)
}
}
for (; e && e !== a && !l(e, A);) e = e._parent;
return s
}
function D(e, t, A, o, n, i) {
return e._project.removeOn(A), w = C = !1, p && Q(p, null, A, o, n, i) || t && t !== p && !t.isDescendant(p) && Q(t, null, "mousedrag" === A ? "mousemove" : A, o, n, i, p) || Q(e, p || t || e, A, o, n, i)
}
}),
Z = X.extend({
_class: "CanvasView",
initialize: function(e, t) {
if (!(t instanceof s.HTMLCanvasElement)) {
var A = f.read(arguments, 1);
if (A.isZero()) throw new Error("Cannot create CanvasView with the provided argument: " + u.slice(arguments, 1));
t = ae.getCanvas(A)
}
var o = this._context = t.getContext("2d");
if (o.save(), this._pixelRatio = 1, !/^off|false$/.test(g.getAttribute(t, "hidpi"))) {
var n = s.devicePixelRatio || 1,
i = W.getPrefixed(o, "backingStorePixelRatio") || 1;
this._pixelRatio = n / i
}
X.call(this, e, t), this._needsUpdate = !0
},
remove: function e() {
return this._context.restore(), e.base.call(this)
},
_setElementSize: function e(t, A) {
var o = this._pixelRatio;
if (e.base.call(this, t * o, A * o), 1 !== o) {
var n = this._element,
i = this._context;
if (!g.hasAttribute(n, "resize")) {
var a = n.style;
a.width = t + "px", a.height = A + "px"
}
i.restore(), i.save(), i.scale(o, o)
}
},
getPixelSize: function e(t) {
var A, o = ue.agent;
if (o && o.firefox) A = e.base.call(this, t);
else {
var n = this._context,
i = n.font;
n.font = t + " serif", A = parseFloat(n.font), n.font = i
}
return A
},
getTextWidth: function(e, t) {
var A = this._context,
o = A.font,
n = 0;
A.font = e;
for (var i = 0, a = t.length; i < a; i++) n = Math.max(n, A.measureText(t[i]).width);
return A.font = o, n
},
update: function() {
if (!this._needsUpdate) return !1;
var e = this._project,
t = this._context,
A = this._viewSize;
return t.clearRect(0, 0, A.width + 1, A.height + 1), e && e.draw(t, this._matrix, this._pixelRatio), this._needsUpdate = !1, !0
}
}),
$ = u.extend({
_class: "Event",
initialize: function(e) {
this.event = e, this.type = e && e.type
},
prevented: !1,
stopped: !1,
preventDefault: function() {
this.prevented = !0, this.event.preventDefault()
},
stopPropagation: function() {
this.stopped = !0, this.event.stopPropagation()
},
stop: function() {
this.stopPropagation(), this.preventDefault()
},
getTimeStamp: function() {
return this.event.timeStamp
},
getModifiers: function() {
return te.modifiers
}
}),
ee = $.extend({
_class: "KeyEvent",
initialize: function(e, t, A, o) {
this.type = e, this.event = t, this.key = A, this.character = o
},
toString: function() {
return "{ type: '" + this.type + "', key: '" + this.key + "', character: '" + this.character + "', modifiers: " + this.getModifiers() + " }"
}
}),
te = new function() {
var e, t, A = {
"\t": "tab",
" ": "space",
"\b": "backspace",
"": "delete",
Spacebar: "space",
Del: "delete",
Win: "meta",
Esc: "escape"
},
o = {
tab: "\t",
space: " ",
enter: "\r"
},
n = {},
i = {},
a = new u({
shift: !1,
control: !1,
alt: !1,
meta: !1,
capsLock: !1,
space: !1
}).inject({
option: {
get: function() {
return this.alt
}
},
command: {
get: function() {
var e = ue && ue.agent;
return e && e.mac ? this.meta : this.control
}
}
});
function c(e) {
var t = e.key || e.keyIdentifier;
return t = /^U\+/.test(t) ? String.fromCharCode(parseInt(t.substr(2), 16)) : /^Arrow[A-Z]/.test(t) ? t.substr(5) : "Unidentified" === t || t === r ? String.fromCharCode(e.keyCode) : t, A[t] || (t.length > 1 ? u.hyphenate(t) : t.toLowerCase())
}
function g(t, A, o, r) {
var s, l = X._focused;
if (n[A] = t, t ? i[A] = o : delete i[A], A.length > 1 && (s = u.camelize(A)) in a) {
a[s] = t;
var c = ue && ue.agent;
if ("meta" === s && c && c.mac)
if (t) e = {};
else {
for (var d in e) d in i && g(!1, d, e[d], r);
e = null
}
} else t && e && (e[A] = o);
l && l._handleKeyEvent(t ? "keydown" : "keyup", r, A, o)
}
return q.add(l, {
keydown: function(e) {
var A = c(e),
n = ue && ue.agent;
A.length > 1 || n && n.chrome && (e.altKey || n.mac && e.metaKey || !n.mac && e.ctrlKey) ? g(!0, A, o[A] || (A.length > 1 ? "" : A), e) : t = A
},
keypress: function(e) {
if (t) {
var A = c(e),
o = e.charCode,
n = o >= 32 ? String.fromCharCode(o) : A.length > 1 ? "" : A;
A !== t && (A = n.toLowerCase()), g(!0, A, n, e), t = null
}
},
keyup: function(e) {
var t = c(e);
t in i && g(!1, t, i[t], e)
}
}), q.add(s, {
blur: function(e) {
for (var t in i) g(!1, t, i[t], e)
}
}), {
modifiers: a,
isDown: function(e) {
return !!n[e]
}
}
},
Ae = $.extend({
_class: "MouseEvent",
initialize: function(e, t, A, o, n) {
this.type = e, this.event = t, this.point = A, this.target = o, this.delta = n
},
toString: function() {
return "{ type: '" + this.type + "', point: " + this.point + ", target: " + this.target + (this.delta ? ", delta: " + this.delta : "") + ", modifiers: " + this.getModifiers() + " }"
}
}),
oe = $.extend({
_class: "ToolEvent",
_item: null,
initialize: function(e, t, A) {
this.tool = e, this.type = t, this.event = A
},
_choosePoint: function(e, t) {
return e || (t ? t.clone() : null)
},
getPoint: function() {
return this._choosePoint(this._point, this.tool._point)
},
setPoint: function(e) {
this._point = e
},
getLastPoint: function() {
return this._choosePoint(this._lastPoint, this.tool._lastPoint)
},
setLastPoint: function(e) {
this._lastPoint = e
},
getDownPoint: function() {
return this._choosePoint(this._downPoint, this.tool._downPoint)
},
setDownPoint: function(e) {
this._downPoint = e
},
getMiddlePoint: function() {
return !this._middlePoint && this.tool._lastPoint ? this.tool._point.add(this.tool._lastPoint).divide(2) : this._middlePoint
},
setMiddlePoint: function(e) {
this._middlePoint = e
},
getDelta: function() {
return !this._delta && this.tool._lastPoint ? this.tool._point.subtract(this.tool._lastPoint) : this._delta
},
setDelta: function(e) {
this._delta = e
},
getCount: function() {
return this.tool[/^mouse(down|up)$/.test(this.type) ? "_downCount" : "_moveCount"]
},
setCount: function(e) {
this.tool[/^mouse(down|up)$/.test(this.type) ? "downCount" : "count"] = e
},
getItem: function() {
if (!this._item) {
var e = this.tool._scope.project.hitTest(this.getPoint());
if (e) {
for (var t = e.item, A = t._parent;
/^(Group|CompoundPath)$/.test(A._class);) t = A, A = A._parent;
this._item = t
}
}
return this._item
},
setItem: function(e) {
this._item = e
},
toString: function() {
return "{ type: " + this.type + ", point: " + this.getPoint() + ", count: " + this.getCount() + ", modifiers: " + this.getModifiers() + " }"
}
}),
ne = d.extend({
_class: "Tool",
_list: "tools",
_reference: "tool",
_events: ["onMouseDown", "onMouseUp", "onMouseDrag", "onMouseMove", "onActivate", "onDeactivate", "onEditOptions", "onKeyDown", "onKeyUp"],
initialize: function(e) {
d.call(this), this._moveCount = -1, this._downCount = -1, this.set(e)
},
getMinDistance: function() {
return this._minDistance
},
setMinDistance: function(e) {
this._minDistance = e, null != e && null != this._maxDistance && e > this._maxDistance && (this._maxDistance = e)
},
getMaxDistance: function() {
return this._maxDistance
},
setMaxDistance: function(e) {
this._maxDistance = e, null != this._minDistance && null != e && e < this._minDistance && (this._minDistance = e)
},
getFixedDistance: function() {
return this._minDistance == this._maxDistance ? this._minDistance : null
},
setFixedDistance: function(e) {
this._minDistance = this._maxDistance = e
},
_handleMouseEvent: function(e, t, A, o) {
ue = this._scope, o.drag && !this.responds(e) && (e = "mousemove");
var n = o.move || o.drag,
i = this.responds(e),
a = this.minDistance,
r = this.maxDistance,
s = !1,
l = this;
function u(e, t) {
var i = A,
a = n ? l._point : l._downPoint || i;
if (n) {
if (l._moveCount >= 0 && i.equals(a)) return !1;
if (a && (null != e || null != t)) {
var r = i.subtract(a),
s = r.getLength();
if (s < (e || 0)) return !1;
t && (i = a.add(r.normalize(Math.min(s, t))))
}
l._moveCount++
}
return l._point = i, l._lastPoint = a || i, o.down && (l._moveCount = -1, l._downPoint = i, l._downCount++), !0
}
function c() {
i && (s = l.emit(e, new oe(l, e, t)) || s)
}
if (o.down) u(), c();
else if (o.up) u(null, r), c();
else if (i)
for (; u(a, r);) c();
return s
}
}),
ie = {
request: function(e) {
var t = new a.XMLHttpRequest;
return t.open((e.method || "get").toUpperCase(), e.url, u.pick(e.async, !0)), e.mimeType && t.overrideMimeType(e.mimeType), t.onload = function() {
var A = t.status;
0 === A || 200 === A ? e.onLoad && e.onLoad.call(t, t.responseText) : t.onerror()
}, t.onerror = function() {
var A = t.status,
o = 'Could not load "' + e.url + '" (Status: ' + A + ")";
if (!e.onError) throw new Error(o);
e.onError(o, A)
}, t.send(null)
}
},
ae = {
canvases: [],
getCanvas: function(e, t) {
if (!s) return null;
var A, o = !0;
"object" == typeof e && (t = e.height, e = e.width), this.canvases.length ? A = this.canvases.pop() : (A = l.createElement("canvas"), o = !1);
var n = A.getContext("2d");
if (!n) throw new Error("Canvas " + A + " is unable to provide a 2D context.");
return A.width === e && A.height === t ? o && n.clearRect(0, 0, e + 1, t + 1) : (A.width = e, A.height = t), n.save(), A
},
getContext: function(e, t) {
var A = this.getCanvas(e, t);
return A ? A.getContext("2d") : null
},
release: function(e) {
var t = e && e.canvas ? e.canvas : e;
t && t.getContext && (t.getContext("2d").restore(), this.canvases.push(t))
}
},
re = new function() {
var e, t, A, o, n, i, a, r, s, l, c, g = Math.min,
d = Math.max,
h = Math.abs;
function m(e, t, A) {
return .2989 * e + .587 * t + .114 * A
}
function p(e, t, A, o) {
var n = o - m(e, t, A),
i = (o = m(s = e + n, l = t + n, c = A + n), g(s, l, c)),
a = d(s, l, c);
if (i < 0) {
var r = o - i;
s = o + (s - o) * o / r, l = o + (l - o) * o / r, c = o + (c - o) * o / r
}
if (a > 255) {
var u = 255 - o,
h = a - o;
s = o + (s - o) * u / h, l = o + (l - o) * u / h, c = o + (c - o) * u / h
}
}
function E(e, t, A) {
return d(e, t, A) - g(e, t, A)
}
function B(e, t, A, o) {
var n, i = [e, t, A],
a = d(e, t, A),
r = g(e, t, A);
n = 0 === g(r = r === e ? 0 : r === t ? 1 : 2, a = a === e ? 0 : a === t ? 1 : 2) ? 1 === d(r, a) ? 2 : 1 : 0, i[a] > i[r] ? (i[n] = (i[n] - i[r]) * o / (i[a] - i[r]), i[a] = o) : i[n] = i[a] = 0, i[r] = 0, s = i[0], l = i[1], c = i[2]
}
var f = {
multiply: function() {
s = n * e / 255, l = i * t / 255, c = a * A / 255
},
screen: function() {
s = n + e - n * e / 255, l = i + t - i * t / 255, c = a + A - a * A / 255
},
overlay: function() {
s = n < 128 ? 2 * n * e / 255 : 255 - 2 * (255 - n) * (255 - e) / 255, l = i < 128 ? 2 * i * t / 255 : 255 - 2 * (255 - i) * (255 - t) / 255, c = a < 128 ? 2 * a * A / 255 : 255 - 2 * (255 - a) * (255 - A) / 255
},
"soft-light": function() {
var o = e * n / 255;
s = o + n * (255 - (255 - n) * (255 - e) / 255 - o) / 255, l = (o = t * i / 255) + i * (255 - (255 - i) * (255 - t) / 255 - o) / 255, c = (o = A * a / 255) + a * (255 - (255 - a) * (255 - A) / 255 - o) / 255
},
"hard-light": function() {
s = e < 128 ? 2 * e * n / 255 : 255 - 2 * (255 - e) * (255 - n) / 255, l = t < 128 ? 2 * t * i / 255 : 255 - 2 * (255 - t) * (255 - i) / 255, c = A < 128 ? 2 * A * a / 255 : 255 - 2 * (255 - A) * (255 - a) / 255
},
"color-dodge": function() {
s = 0 === n ? 0 : 255 === e ? 255 : g(255, 255 * n / (255 - e)), l = 0 === i ? 0 : 255 === t ? 255 : g(255, 255 * i / (255 - t)), c = 0 === a ? 0 : 255 === A ? 255 : g(255, 255 * a / (255 - A))
},
"color-burn": function() {
s = 255 === n ? 255 : 0 === e ? 0 : d(0, 255 - 255 * (255 - n) / e), l = 255 === i ? 255 : 0 === t ? 0 : d(0, 255 - 255 * (255 - i) / t), c = 255 === a ? 255 : 0 === A ? 0 : d(0, 255 - 255 * (255 - a) / A)
},
darken: function() {
s = n < e ? n : e, l = i < t ? i : t, c = a < A ? a : A
},
lighten: function() {
s = n > e ? n : e, l = i > t ? i : t, c = a > A ? a : A
},
difference: function() {
(s = n - e) < 0 && (s = -s), (l = i - t) < 0 && (l = -l), (c = a - A) < 0 && (c = -c)
},
exclusion: function() {
s = n + e * (255 - n - n) / 255, l = i + t * (255 - i - i) / 255, c = a + A * (255 - a - a) / 255
},
hue: function() {
B(e, t, A, E(n, i, a)), p(s, l, c, m(n, i, a))
},
saturation: function() {
B(n, i, a, E(e, t, A)), p(s, l, c, m(n, i, a))
},
luminosity: function() {
p(n, i, a, m(e, t, A))
},
color: function() {
p(e, t, A, m(n, i, a))
},
add: function() {
s = g(n + e, 255), l = g(i + t, 255), c = g(a + A, 255)
},
subtract: function() {
s = d(n - e, 0), l = d(i - t, 0), c = d(a - A, 0)
},
average: function() {
s = (n + e) / 2, l = (i + t) / 2, c = (a + A) / 2
},
negation: function() {
s = 255 - h(255 - e - n), l = 255 - h(255 - t - i), c = 255 - h(255 - A - a)
}
},
C = this.nativeModes = u.each(["source-over", "source-in", "source-out", "source-atop", "destination-over", "destination-in", "destination-out", "destination-atop", "lighter", "darker", "copy", "xor"], function(e) {
this[e] = !0
}, {}),
w = ae.getContext(1, 1);
w && (u.each(f, function(e, t) {
var A = "darken" === t,
o = !1;
w.save();
try {
w.fillStyle = A ? "#300" : "#a00", w.fillRect(0, 0, 1, 1), w.globalCompositeOperation = t, w.globalCompositeOperation === t && (w.fillStyle = A ? "#a00" : "#300", w.fillRect(0, 0, 1, 1), o = w.getImageData(0, 0, 1, 1).data[0] !== A ? 170 : 51)
} catch (e) {}
w.restore(), C[t] = o
}), ae.release(w)), this.process = function(u, g, d, h, m) {
var p = g.canvas,
E = "normal" === u;
if (E || C[u]) d.save(), d.setTransform(1, 0, 0, 1, 0, 0), d.globalAlpha = h, E || (d.globalCompositeOperation = u), d.drawImage(p, m.x, m.y), d.restore();
else {
var B = f[u];
if (!B) return;
for (var w = d.getImageData(m.x, m.y, p.width, p.height), I = w.data, y = g.getImageData(0, 0, p.width, p.height).data, b = 0, M = I.length; b < M; b += 4) {
e = y[b], n = I[b], t = y[b + 1], i = I[b + 1], A = y[b + 2], a = I[b + 2], o = y[b + 3], r = I[b + 3], B();
var T = o * h / 255,
S = 1 - T;
I[b] = T * s + S * n, I[b + 1] = T * l + S * i, I[b + 2] = T * c + S * a, I[b + 3] = o * h + S * r
}
d.putImageData(w, m.x, m.y)
}
}
},
se = new function() {
var e = "http://www.w3.org/2000/svg",
t = "http://www.w3.org/2000/xmlns",
A = "http://www.w3.org/1999/xlink",
o = {
href: A,
xlink: t,
xmlns: t + "/",
"xmlns:xlink": t + "/"
};
function n(e, t, A) {
for (var n in t) {
var i = t[n],
a = o[n];
"number" == typeof i && A && (i = A.number(i)), a ? e.setAttributeNS(a, n, i) : e.setAttribute(n, i)
}
return e
}
return {
svg: e,
xmlns: t,
xlink: A,
create: function(t, A, o) {
return n(l.createElementNS(e, t), A, o)
},
get: function(e, t) {
var A = o[t],
n = A ? e.getAttributeNS(A, t) : e.getAttribute(t);
return "null" === n ? null : n
},
set: n
}
},
le = u.each({
fillColor: ["fill", "color"],
fillRule: ["fill-rule", "string"],
strokeColor: ["stroke", "color"],
strokeWidth: ["stroke-width", "number"],
strokeCap: ["stroke-linecap", "string"],
strokeJoin: ["stroke-linejoin", "string"],
strokeScaling: ["vector-effect", "lookup", {
true: "none",
false: "non-scaling-stroke"
}, function(e, t) {
return !t && (e instanceof L || e instanceof D || e instanceof H)
}],
miterLimit: ["stroke-miterlimit", "number"],
dashArray: ["stroke-dasharray", "array"],
dashOffset: ["stroke-dashoffset", "number"],
fontFamily: ["font-family", "string"],
fontWeight: ["font-weight", "string"],
fontSize: ["font-size", "number"],
justification: ["text-anchor", "lookup", {
left: "start",
center: "middle",
right: "end"
}],
opacity: ["opacity", "number"],
blendMode: ["mix-blend-mode", "style"]
}, function(e, t) {
var A = u.capitalize(t),
o = e[2];
this[t] = {
type: e[1],
property: t,
attribute: e[0],
toSVG: o,
fromSVG: o && u.each(o, function(e, t) {
this[e] = t
}, {}),
exportFilter: e[3],
get: "get" + A,
set: "set" + A
}
}, {});
new function() {
var e;
function t(t, A, o) {
var n = new u,
i = t.getTranslation();
if (A) {
var a = (t = t._shiftless())._inverseTransform(i);
n[o ? "cx" : "x"] = a.x, n[o ? "cy" : "y"] = a.y, i = null
}
if (!t.isIdentity()) {
var r = t.decompose();
if (r) {
var s = [],
l = r.rotation,
c = r.scaling,
g = r.skewing;
i && !i.isZero() && s.push("translate(" + e.point(i) + ")"), l && s.push("rotate(" + e.number(l) + ")"), m.isZero(c.x - 1) && m.isZero(c.y - 1) || s.push("scale(" + e.point(c) + ")"), g.x && s.push("skewX(" + e.number(g.x) + ")"), g.y && s.push("skewY(" + e.number(g.y) + ")"), n.transform = s.join(" ")
} else n.transform = "matrix(" + t.getValues().join(",") + ")"
}
return n
}
function A(A, o) {
for (var n = t(A._matrix), i = A._children, a = se.create("g", n, e), r = 0, s = i.length; r < s; r++) {
var u = i[r],
c = g(u, o);
if (c)
if (u.isClipMask()) {
var d = se.create("clipPath");
d.appendChild(c), l(u, d, "clip"), se.set(a, {
"clip-path": "url(#" + d.id + ")"
})
} else a.appendChild(c)
}
return a
}
function o(A) {
var o = A._type,
n = A._radius,
i = t(A._matrix, !0, "rectangle" !== o);
if ("rectangle" === o) {
o = "rect";
var a = A._size,
r = a.width,
s = a.height;
i.x -= r / 2, i.y -= s / 2, i.width = r, i.height = s, n.isZero() && (n = null)
}
return n && ("circle" === o ? i.r = n : (i.rx = n.width, i.ry = n.height)), se.create(o, i, e)
}
var n, i = {
Group: A,
Layer: A,
Raster: function(A, o) {
var n = t(A._matrix, !0),
i = A.getSize(),
a = A.getImage();
return n.x -= i.width / 2, n.y -= i.height / 2, n.width = i.width, n.height = i.height, n.href = 0 == o.embedImages && a && a.src || A.toDataURL(), se.create("image", n, e)
},
Path: function(A, n) {
var i = n.matchShapes;
if (i) {
var a = A.toShape(!1);
if (a) return o(a)
}
var r, s = A._segments,
l = s.length,
u = t(A._matrix);
if (i && l >= 2 && !A.hasHandles())
if (l > 2) {
r = A._closed ? "polygon" : "polyline";
for (var c = [], g = 0; g < l; g++) c.push(e.point(s[g]._point));
u.points = c.join(" ")
} else {
r = "line";
var d = s[0]._point,
h = s[1]._point;
u.set({
x1: d.x,
y1: d.y,
x2: h.x,
y2: h.y
})
} else r = "path", u.d = A.getPathData(null, n.precision);
return se.create(r, u, e)
},
Shape: o,
CompoundPath: function(A, o) {
var n = t(A._matrix),
i = A.getPathData(null, o.precision);
return i && (n.d = i), se.create("path", n, e)
},
SymbolItem: function(A, o) {
var n = t(A._matrix, !0),
i = A._definition,
a = s(i, "symbol"),
r = i._item,
u = r.getBounds();
return a || ((a = se.create("symbol", {
viewBox: e.rectangle(u)
})).appendChild(g(r, o)), l(i, a, "symbol")), n.href = "#" + a.id, n.x += u.x, n.y += u.y, n.width = u.width, n.height = u.height, n.overflow = "visible", se.create("use", n, e)
},
PointText: function(A) {
var o = se.create("text", t(A._matrix, !1), e);
o.setAttribute("font-size", A.fontSize), o.setAttribute("xml:space", "preserve");
for (var n = 0; n < A._lines.length; n++) {
var i = se.create("tspan", {
x: "0",
dy: 0 === n ? "0" : A.getLeading() + "px"
}, e);
i.textContent = A._lines[n] ? A._lines[n] : " ", o.appendChild(i)
}
return o
}
};
function r(A, o, n) {
var i = {},
a = !n && A.getParent(),
r = [];
return null != A._name && (i.id = A._name), u.each(le, function(o) {
var n = o.get,
c = o.type,
g = A[n]();
if (o.exportFilter ? o.exportFilter(A, g) : !a || !u.equals(a[n](), g) || A instanceof ue.PointText) {
if ("color" === c && null != g) {
var d = g.getAlpha();
d < 1 && (i[o.attribute + "-opacity"] = d)
}
"style" === c ? r.push(o.attribute + ": " + g) : i[o.attribute] = null == g ? "none" : "color" === c ? g.gradient ? function(A, o) {
var n = s(A, "color");
if (!n) {
var i, a = A.getGradient(),
r = a._radial,
u = A.getOrigin(),
c = A.getDestination();
if (r) {
i = {
cx: u.x,
cy: u.y,
r: u.getDistance(c)
};
var g = A.getHighlight();
g && (i.fx = g.x, i.fy = g.y)
} else i = {
x1: u.x,
y1: u.y,
x2: c.x,
y2: c.y
};
o instanceof ue.PointText && (i.gradientTransform = t(o._matrix.clone().invert(), !1, e).transform), i.gradientUnits = "userSpaceOnUse", n = se.create((r ? "radial" : "linear") + "Gradient", i, e);
for (var d = a._stops, h = 0, m = d.length; h < m; h++) {
var p = d[h],
E = p._color,
B = E.getAlpha(),
f = p._offset;
i = {
offset: null == f ? h / (m - 1) : f
}, E && (i["stop-color"] = E.toCSS(!0)), B < 1 && (i["stop-opacity"] = B), n.appendChild(se.create("stop", i, e))
}
l(A, n, "color")
}
return "url(#" + n.id + ")"
}(g, A) : g.toCSS(!0) : "array" === c ? g.join(",") : "lookup" === c ? o.toSVG[g] : g
}
}), r.length && (i.style = r.join(";")), 1 === i.opacity && delete i.opacity, A._visible || (i.visibility = "hidden"), se.set(o, i, e)
}
function s(e, t) {
return n || (n = {
ids: {},
svgs: {}
}), e && n.svgs[t + "-" + (e._id || e.__id || (e.__id = p.get("svg")))]
}
function l(e, t, A) {
n || s();
var o = n.ids[A] = (n.ids[A] || 0) + 1;
t.id = A + "-" + o, n.svgs[A + "-" + (e._id || e.__id)] = t
}
function c(e, t) {
var A = e,
o = null;
if (n) {
for (var i in A = "svg" === e.nodeName.toLowerCase() && e, n.svgs) o || (A || (A = se.create("svg")).appendChild(e), o = A.insertBefore(se.create("defs"), A.firstChild)), o.appendChild(n.svgs[i]);
n = null
}
return t.asString ? (new a.XMLSerializer).serializeToString(A) : A
}
function g(e, t, A) {
var o = i[e._class],
n = o && o(e, t);
if (n) {
var a = t.onExport;
a && (n = a(e, n, t) || n);
var s = JSON.stringify(e._data);
s && "{}" !== s && "null" !== s && n.setAttribute("data-paper-data", s)
}
return n && r(e, n, A)
}
function d(t) {
return t || (t = {}), e = new h(t.precision), t
}
T.inject({
exportSVG: function(e) {
return c(g(this, e = d(e), !0), e)
}
}), M.inject({
exportSVG: function(A) {
A = d(A);
var o = this._children,
n = this.getView(),
i = u.pick(A.bounds, "view"),
a = A.matrix || "view" === i && n._matrix,
r = a && y.read([a]),
s = "view" === i ? new w([0, 0], n.getViewSize()) : "content" === i ? T._getBounds(o, r, {
stroke: !0,
drawnTextBounds: !0
}).rect : w.read([i], 0, {
readNull: !0
}),
l = {
version: "1.1",
xmlns: se.svg,
"xmlns:xlink": se.xlink
};
s && (l.width = s.width, l.height = s.height, (s.x || s.y) && (l.viewBox = e.rectangle(s)));
var h = se.create("svg", l, e),
m = h;
r && !r.isIdentity() && (m = h.appendChild(se.create("g", t(r), e)));
for (var p = 0, E = o.length; p < E; p++) m.appendChild(g(o[p], A, !0));
return c(h, A)
}
})
}, new function() {
var e, t = {};
function A(t, A, o, n, i) {
var a = se.get(t, A),
r = null == a ? n ? null : o ? "" : 0 : o ? a : parseFloat(a);
return /%\s*$/.test(a) ? r / 100 * (i ? 1 : e[/x|^width/.test(A) ? "width" : "height"]) : r
}
function o(e, t, o, n, i) {
return t = A(e, t || "x", !1, n, i), o = A(e, o || "y", !1, n, i), !n || null != t && null != o ? new E(t, o) : null
}
function n(e, t, o, n, i) {
return t = A(e, t || "width", !1, n, i), o = A(e, o || "height", !1, n, i), !n || null != t && null != o ? new f(t, o) : null
}
function i(e, t, A) {
return "none" === e ? null : "number" === t ? parseFloat(e) : "array" === t ? e ? e.split(/[\s,]+/g).map(parseFloat) : [] : "color" === t ? b(e) || e : "lookup" === t ? A[e] : e
}
function c(e, t, A, o) {
var n = e.childNodes,
i = "clippath" === t,
a = "defs" === t,
r = new S,
s = r._project,
l = s._currentStyle,
u = [];
if (i || a || (r = I(r, e, o), s._currentStyle = r._style.clone()), o)
for (var c = e.querySelectorAll("defs"), g = 0, d = c.length; g < d; g++) Q(c[g], A, !1);
for (g = 0, d = n.length; g < d; g++) {
var h, m = n[g];
1 !== m.nodeType || /^defs$/i.test(m.nodeName) || !(h = Q(m, A, !1)) || h instanceof v || u.push(h)
}
return r.addChildren(u), i && (r = I(r.reduce(), e, o)), s._currentStyle = l, (i || a) && (r.remove(), r = null), r
}
function g(e, t) {
for (var A = e.getAttribute("points").match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g), o = [], n = 0, i = A.length; n < i; n += 2) o.push(new E(parseFloat(A[n]), parseFloat(A[n + 1])));
var a = new G(o);
return "polygon" === t && a.closePath(), a
}
function d(e, n) {
var i, a = (A(e, "href", !0) || "").substring(1),
r = "radialgradient" === n;
if (a)(i = t[a].getGradient())._radial ^ r && ((i = i.clone())._radial = r);
else {
for (var s = e.childNodes, l = [], u = 0, c = s.length; u < c; u++) {
var g = s[u];
1 === g.nodeType && l.push(I(new J, g))
}
i = new K(l, r)
}
var d, h, m, p = "userSpaceOnUse" !== A(e, "gradientUnits", !0);
return r ? (h = (d = o(e, "cx", "cy", !1, p)).add(A(e, "r", !1, !1, p), 0), m = o(e, "fx", "fy", !0, p)) : (d = o(e, "x1", "y1", !1, p), h = o(e, "x2", "y2", !1, p)), I(new z(i, d, h, m), e)._scaleToBounds = p, null
}
var h = {
"#document": function(e, t, A, o) {
for (var n = e.childNodes, i = 0, a = n.length; i < a; i++) {
var r = n[i];
if (1 === r.nodeType) return Q(r, A, o)
}
},
g: c,
svg: c,
clippath: c,
polygon: g,
polyline: g,
path: function(e) {
return L.create(e.getAttribute("d"))
},
lineargradient: d,
radialgradient: d,
image: function(e) {
var t = new k(A(e, "href", !0));
return t.on("load", function() {
var t = n(e);
this.setSize(t);
var A = o(e).add(t.divide(2));
this._matrix.append((new y).translate(A))
}), t
},
symbol: function(e, t, A, o) {
return new v(c(e, t, A, o), !0)
},
defs: c,
use: function(e) {
var n = (A(e, "href", !0) || "").substring(1),
i = t[n],
a = o(e);
return i ? i instanceof v ? i.place(a) : i.clone().translate(a) : null
},
circle: function(e) {
return new D.Circle(o(e, "cx", "cy"), A(e, "r"))
},
ellipse: function(e) {
return new D.Ellipse({
center: o(e, "cx", "cy"),
radius: n(e, "rx", "ry")
})
},
rect: function(e) {
return new D.Rectangle(new w(o(e), n(e)), n(e, "rx", "ry"))
},
line: function(e) {
return new G.Line(o(e, "x1", "y1"), o(e, "x2", "y2"))
},
text: function(e) {
var t = parseFloat(e.getAttribute("font-size")),
A = e.getAttribute("alignment-baseline");
if (0 === e.childElementCount) return (l = new j).setContent(e.textContent.trim() || ""), l.translate(0, l._style.getLeading()), isNaN(t) || l.setFontSize(t), l;
for (var o = [], n = 1.2, i = 0; i < e.childNodes.length; i++) {
var a = e.childNodes[i];
o.push(a.textContent);
var r = a.getAttribute("dy");
if (r) {
var s = parseFloat(r);
isNaN(s) || (r.endsWith("em") ? n = s : r.endsWith("px") && !isNaN(t) && (n = s / t))
}
}
var l = new j;
return isNaN(t) || l.setFontSize(t), l.setLeading(l.fontSize * n), "text-before-edge" === A && (l.setContent(" "), l.translate(0, l.bounds.height)), l.setContent(o.join("\n")), l
}
};
function m(e, t, A, o) {
if (e.transform) {
for (var n = (o.getAttribute(A) || "").split(/\)\s*/g), i = new y, a = 0, r = n.length; a < r; a++) {
var s = n[a];
if (!s) break;
for (var l = s.split(/\(\s*/), u = l[0], c = l[1].split(/[\s,]+/g), g = 0, d = c.length; g < d; g++) c[g] = parseFloat(c[g]);
switch (u) {
case "matrix":
i.append(new y(c[0], c[1], c[2], c[3], c[4], c[5]));
break;
case "rotate":
i.rotate(c[0], c[1] || 0, c[2] || 0);
break;
case "translate":
i.translate(c[0], c[1] || 0);
break;
case "scale":
i.scale(c);
break;
case "skewX":
i.skew(c[0], 0);
break;
case "skewY":
i.skew(0, c[0])
}
}
e.transform(i)
}
}
function p(e, t, A) {
var o = "fill-opacity" === A ? "getFillColor" : "getStrokeColor",
n = e[o] && e[o]();
n && n.setAlpha(parseFloat(t))
}
var B = u.set(u.each(le, function(e) {
this[e.attribute] = function(t, A) {
if (t[e.set] && (t[e.set](i(A, e.type, e.fromSVG)), "color" === e.type)) {
var o = t[e.get]();
if (o && o._scaleToBounds) {
var n = t.getBounds();
o.transform((new y).translate(n.getPoint()).scale(n.getSize()))
}
}
}
}, {}), {
id: function(e, A) {
t[A] = e, e.setName && e.setName(A)
},
"clip-path": function(e, t) {
var A = b(t);
if (A) {
if ((A = A.clone()).setClipMask(!0), !(e instanceof S)) return new S(A, e);
e.insertChild(0, A)
}
},
gradientTransform: m,
transform: m,
"fill-opacity": p,
"stroke-opacity": p,
visibility: function(e, t) {
e.setVisible && e.setVisible("visible" === t)
},
display: function(e, t) {
e.setVisible && e.setVisible(null !== t)
},
"stop-color": function(e, t) {
e.setColor && e.setColor(t)
},
"stop-opacity": function(e, t) {
e._color && e._color.setAlpha(parseFloat(t))
},
offset: function(e, t) {
if (e.setOffset) {
var A = t.match(/(.*)%$/);
e.setOffset(A ? A[1] / 100 : parseFloat(t))
}
},
viewBox: function(e, t, A, o, a) {
var r, s = new w(i(t, "array")),
l = n(o, null, null, !0);
if (e instanceof S) {
var u = l ? l.divide(s.getSize()) : 1,
c = (new y).scale(u).translate(s.getPoint().negate());
r = e
} else e instanceof v && (l && s.setSize(l), r = e._item);
if (r) {
if ("visible" !== C(o, "overflow", a)) {
var g = new D.Rectangle(s);
g.setClipMask(!0), r.addChild(g)
}
c && r.transform(c)
}
}
});
function C(e, t, A) {
var o = e.attributes[t],
n = o && o.value;
if (!n && e.style) {
var i = u.camelize(t);
(n = e.style[i]) || A.node[i] === A.parent[i] || (n = A.node[i])
}
return n ? "none" === n ? null : n : r
}
function I(e, t, A) {
var o = t.parentNode,
n = {
node: W.getStyles(t) || {},
parent: !A && !/^defs$/i.test(o.tagName) && W.getStyles(o) || {}
};
return u.each(B, function(A, o) {
var i = C(t, o, n);
e = i !== r && A(e, i, o, t, n) || e
}), e
}
function b(e) {
var A = e && e.match(/\((?:["'#]*)([^"')]+)/),
o = A && A[1],
n = o && t[s ? o.replace(s.location.href.split("#")[0] + "#", "") : o];
return n && n._scaleToBounds && ((n = n.clone())._scaleToBounds = !0), n
}
function Q(A, o, i) {
var a, r, s, c = A.nodeName.toLowerCase(),
g = "#document" !== c,
d = l.body;
i && g && (e = ue.getView().getSize(), e = n(A, null, null, !0) || e, a = se.create("svg", {
style: "stroke-width: 1px; stroke-miterlimit: 10"
}), r = A.parentNode, s = A.nextSibling, a.appendChild(A), d.appendChild(a));
var m = ue.settings,
p = m.applyMatrix,
E = m.insertItems;
m.applyMatrix = !1, m.insertItems = !1;
var B = h[c],
f = B && B(A, c, o, i) || null;
if (m.insertItems = E, m.applyMatrix = p, f) {
!g || f instanceof S || (f = I(f, A, i));
var C = o.onImport,
w = g && A.getAttribute("data-paper-data");
C && (f = C(A, f, o) || f), o.expandShapes && f instanceof D && (f.remove(), f = f.toPath()), w && (f._data = JSON.parse(w))
}
return a && (d.removeChild(a), r && (s ? r.insertBefore(A, s) : r.appendChild(A))), i && (t = {}, f && u.pick(o.applyMatrix, p) && f.matrix.apply(!0, !0)), f
}
function N(e, t, A) {
if (!e) return null;
t = "function" == typeof t ? {
onLoad: t
} : t || {};
var o = ue,
n = null;
function i(i) {
try {
var l = "object" == typeof i ? i : (new a.DOMParser).parseFromString(i, "image/svg+xml");
if (!l.nodeName) throw l = null, new Error("Unsupported SVG source: " + e);
ue = o, n = Q(l, t, !0), t && !1 === t.insert || A._insertItem(r, n);
var u = t.onLoad;
u && u(n, i)
} catch (e) {
s(e)
}
}
function s(e, A) {
var o = t.onError;
if (!o) throw new Error(e);
o(e, A)
}
if ("string" != typeof e || /^.*</.test(e)) {
if ("undefined" != typeof File && e instanceof File) {
var u = new FileReader;
return u.onload = function() {
i(u.result)
}, u.onerror = function() {
s(u.error)
}, u.readAsText(e)
}
i(e)
} else {
var c = l.getElementById(e);
c ? i(c) : ie.request({
url: e,
async: !0,
onLoad: i,
onError: s
})
}
return n
}
T.inject({
importSVG: function(e, t) {
return N(e, t, this)
}
}), M.inject({
importSVG: function(e, t) {
return this.activate(), N(e, t, this)
}
})
}, u.exports.PaperScript = function() {
var e, t, c = this,
d = c.acorn;
if (!d) try {
d = A(1130)
} catch (e) {}
d || (d = e = t = {}, function(A, a) {
"object" == typeof e && "object" == typeof t ? a(e) : (o = [e], (i = "function" == typeof(n = a) ? n.apply(e, o) : n) !== r && (t.exports = i))
}(0, function(e) {
"use strict";
var t, A, o, n;
e.version = "0.5.0", e.parse = function(e, n) {
return A = String(e), o = A.length, a(n), Ke(),
function(e) {
E = B = r, t.locations && (f = new ze);
C = I = null, w = [], Ze();
var A = e || ut(),
o = !0;
e || (A.body = []);
for (; g !== k;) {
var n = It();
A.body.push(n), o && dt(n) && rt(!0), o = !1
}
return gt(A, "Program")
}(t.program)
};
var i = e.defaultOptions = {
ecmaVersion: 5,
strictSemicolons: !1,
allowTrailingCommas: !0,
forbidReserved: !1,
allowReturnOutsideFunction: !1,
locations: !1,
onComment: null,
ranges: !1,
program: null,
sourceFile: null,
directSourceFile: null
};
function a(e) {
for (var A in t = e || {}, i) Object.prototype.hasOwnProperty.call(t, A) || (t[A] = i[A]);
n = t.sourceFile || null
}
var r, s, l, u, c, g, d, h, m, p, E, B, f, C, w, I, y = e.getLineInfo = function(e, t) {
for (var A = 1, o = 0;;) {
Pe.lastIndex = o;
var n = Pe.exec(e);
if (!(n && n.index < t)) break;
++A, o = n.index + n[0].length
}
return {
line: A,
column: t - o
}
};
function b(e, t) {
var o = y(A, e);
t += " (" + o.line + ":" + o.column + ")";
var n = new SyntaxError(t);
throw n.pos = e, n.loc = o, n.raisedAt = r, n
}
e.tokenize = function(e, n) {
A = String(e), o = A.length, a(n), Ke();
var i = {};
function E(e) {
return B = l, Ze(e), i.start = s, i.end = l, i.startLoc = u, i.endLoc = c, i.type = g, i.value = d, i
}
return E.jumpTo = function(e, o) {
var n;
if (r = e, t.locations)
for (m = 1, p = Pe.lastIndex = 0;
(n = Pe.exec(A)) && n.index < e;) ++m, p = n.index + n[0].length;
h = o, qe()
}, E
};
var M = [],
T = {
type: "num"
},
S = {
type: "regexp"
},
Q = {
type: "string"
},
D = {
type: "name"
},
k = {
type: "eof"
},
N = {
keyword: "break"
},
v = {
keyword: "case",
beforeExpr: !0
},
O = {
keyword: "catch"
},
R = {
keyword: "continue"
},
F = {
keyword: "debugger"
},
Y = {
keyword: "default"
},
U = {
keyword: "do",
isLoop: !0
},
L = {
keyword: "else",
beforeExpr: !0
},
G = {
keyword: "finally"
},
x = {
keyword: "for",
isLoop: !0
},
_ = {
keyword: "function"
},
P = {
keyword: "if"
},
H = {
keyword: "return",
beforeExpr: !0
},
j = {
keyword: "switch"
},
z = {
keyword: "throw",
beforeExpr: !0
},
K = {
keyword: "try"
},
J = {
keyword: "var"
},
V = {
keyword: "while",
isLoop: !0
},
W = {
keyword: "with"
},
q = {
keyword: "new",
beforeExpr: !0
},
X = {
keyword: "this"
},
Z = {
keyword: "null",
atomValue: null
},
$ = {
keyword: "true",
atomValue: !0
},
ee = {
keyword: "false",
atomValue: !1
},
te = {
keyword: "in",
binop: 7,
beforeExpr: !0
},
Ae = {
break: N,
case: v,
catch: O,
continue: R,
debugger: F,
default: Y,
do: U,
else: L,
finally: G,
for: x,
function: _,
if: P,
return: H,
switch: j,
throw: z,
try: K,
var: J,
while: V,
with: W,
null: Z,
true: $,
false: ee,
new: q,
in : te,
instanceof: {
keyword: "instanceof",
binop: 7,
beforeExpr: !0
},
this: X,
typeof: {
keyword: "typeof",
prefix: !0,
beforeExpr: !0
},
void: {
keyword: "void",
prefix: !0,
beforeExpr: !0
},
delete: {
keyword: "delete",
prefix: !0,
beforeExpr: !0
}
},
oe = {
type: "[",
beforeExpr: !0
},
ne = {
type: "]"
},
ie = {
type: "{",
beforeExpr: !0
},
ae = {
type: "}"
},
re = {
type: "(",
beforeExpr: !0
},
se = {
type: ")"
},
le = {
type: ",",
beforeExpr: !0
},
ue = {
type: ";",
beforeExpr: !0
},
ce = {
type: ":",
beforeExpr: !0
},
ge = {
type: "."
},
de = {
type: "?",
beforeExpr: !0
},
he = {
binop: 10,
beforeExpr: !0
},
me = {
isAssign: !0,
beforeExpr: !0
},
pe = {
isAssign: !0,
beforeExpr: !0
},
Ee = {
postfix: !0,
prefix: !0,
isUpdate: !0
},
Be = {
prefix: !0,
beforeExpr: !0
},
fe = {
binop: 1,
beforeExpr: !0
},
Ce = {
binop: 2,
beforeExpr: !0
},
we = {
binop: 3,
beforeExpr: !0
},
Ie = {
binop: 4,
beforeExpr: !0
},
ye = {
binop: 5,
beforeExpr: !0
},
be = {
binop: 6,
beforeExpr: !0
},
Me = {
binop: 7,
beforeExpr: !0
},
Te = {
binop: 8,
beforeExpr: !0
},
Se = {
binop: 9,
prefix: !0,
beforeExpr: !0
},
Qe = {
binop: 10,
beforeExpr: !0
};
for (var De in e.tokTypes = {
bracketL: oe,
bracketR: ne,
braceL: ie,
braceR: ae,
parenL: re,
parenR: se,
comma: le,
semi: ue,
colon: ce,
dot: ge,
question: de,
slash: he,
eq: me,
name: D,
eof: k,
num: T,
regexp: S,
string: Q
}, Ae) e.tokTypes["_" + De] = Ae[De];
function ke(e) {
e = e.split(" ");
var t = "",
A = [];
e: for (var o = 0; o < e.length; ++o) {
for (var n = 0; n < A.length; ++n)
if (A[n][0].length == e[o].length) {
A[n].push(e[o]);
continue e
}
A.push([e[o]])
}
function i(e) {
if (1 == e.length) return t += "return str === " + JSON.stringify(e[0]) + ";";
t += "switch(str){";
for (var A = 0; A < e.length; ++A) t += "case " + JSON.stringify(e[A]) + ":";
t += "return true}return false;"
}
if (A.length > 3) {
A.sort(function(e, t) {
return t.length - e.length
}), t += "switch(str.length){";
for (o = 0; o < A.length; ++o) {
var a = A[o];
t += "case " + a[0].length + ":", i(a)
}
t += "}"
} else i(e);
return new Function("str", t)
}
var Ne, ve = ke("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile"),
Oe = ke("class enum extends super const export import"),
Re = ke("implements interface let package private protected public static yield"),
Fe = ke("eval arguments"),
Ye = ke("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"),
Ue = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,
Le = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",
Ge = new RegExp("[" + Le + "]"),
xe = new RegExp("[" + Le + "̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‌‍‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_]"),
_e = /[\n\r\u2028\u2029]/,
Pe = /\r\n|[\n\r\u2028\u2029]/g,
He = e.isIdentifierStart = function(e) {
return e < 65 ? 36 === e : e < 91 || (e < 97 ? 95 === e : e < 123 || e >= 170 && Ge.test(String.fromCharCode(e)))
},
je = e.isIdentifierChar = function(e) {
return e < 48 ? 36 === e : e < 58 || !(e < 65) && (e < 91 || (e < 97 ? 95 === e : e < 123 || e >= 170 && xe.test(String.fromCharCode(e))))
};
function ze() {
this.line = m, this.column = r - p
}
function Ke() {
m = 1, r = p = 0, h = !0, qe()
}
function Je(e, A) {
l = r, t.locations && (c = new ze), g = e, qe(), d = A, h = e.beforeExpr
}
function Ve() {
var e, o = t.onComment && t.locations && new ze,
n = r,
i = A.indexOf("*/", r += 2);
if (-1 === i && b(r - 2, "Unterminated comment"), r = i + 2, t.locations)
for (Pe.lastIndex = n;
(e = Pe.exec(A)) && e.index < r;) ++m, p = e.index + e[0].length;
t.onComment && t.onComment(!0, A.slice(n + 2, i), n, r, o, t.locations && new ze)
}
function We() {
for (var e = r, n = t.onComment && t.locations && new ze, i = A.charCodeAt(r += 2); r < o && 10 !== i && 13 !== i && 8232 !== i && 8233 !== i;) ++r, i = A.charCodeAt(r);
t.onComment && t.onComment(!1, A.slice(e + 2, r), e, r, n, t.locations && new ze)
}
function qe() {
for (; r < o;) {
var e = A.charCodeAt(r);
if (32 === e) ++r;
else if (13 === e) {
++r, 10 === (n = A.charCodeAt(r)) && ++r, t.locations && (++m, p = r)
} else if (10 === e || 8232 === e || 8233 === e) ++r, t.locations && (++m, p = r);
else if (e > 8 && e < 14) ++r;
else if (47 === e) {
var n;
if (42 === (n = A.charCodeAt(r + 1))) Ve();
else {
if (47 !== n) break;
We()
}
} else if (160 === e) ++r;
else {
if (!(e >= 5760 && Ue.test(String.fromCharCode(e)))) break;
++r
}
}
}
function Xe(e) {
switch (e) {
case 46:
return function() {
var e = A.charCodeAt(r + 1);
return e >= 48 && e <= 57 ? At(!0) : (++r, Je(ge))
}();
case 40:
return ++r, Je(re);
case 41:
return ++r, Je(se);
case 59:
return ++r, Je(ue);
case 44:
return ++r, Je(le);
case 91:
return ++r, Je(oe);
case 93:
return ++r, Je(ne);
case 123:
return ++r, Je(ie);
case 125:
return ++r, Je(ae);
case 58:
return ++r, Je(ce);
case 63:
return ++r, Je(de);
case 48:
var n = A.charCodeAt(r + 1);
if (120 === n || 88 === n) return function() {
r += 2;
var e = tt(16);
null == e && b(s + 2, "Expected hexadecimal number");
He(A.charCodeAt(r)) && b(r, "Identifier directly after number");
return Je(T, e)
}();
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
return At(!1);
case 34:
case 39:
return function(e) {
r++;
for (var n = "";;) {
r >= o && b(s, "Unterminated string constant");
var i = A.charCodeAt(r);
if (i === e) return ++r, Je(Q, n);
if (92 === i) {
i = A.charCodeAt(++r);
var a = /^[0-7]+/.exec(A.slice(r, r + 3));
for (a && (a = a[0]); a && parseInt(a, 8) > 255;) a = a.slice(0, -1);
if ("0" === a && (a = null), ++r, a) I && b(r - 2, "Octal literal in strict mode"), n += String.fromCharCode(parseInt(a, 8)), r += a.length - 1;
else switch (i) {
case 110:
n += "\n";
break;
case 114:
n += "\r";
break;
case 120:
n += String.fromCharCode(ot(2));
break;
case 117:
n += String.fromCharCode(ot(4));
break;
case 85:
n += String.fromCharCode(ot(8));
break;
case 116:
n += "\t";
break;
case 98:
n += "\b";
break;
case 118:
n += "\v";
break;
case 102:
n += "\f";
break;
case 48:
n += "\0";
break;
case 13:
10 === A.charCodeAt(r) && ++r;
case 10:
t.locations && (p = r, ++m);
break;
default:
n += String.fromCharCode(i)
}
} else 13 !== i && 10 !== i && 8232 !== i && 8233 !== i || b(s, "Unterminated string constant"), n += String.fromCharCode(i), ++r
}
}(e);
case 47:
return function() {
var e = A.charCodeAt(r + 1);
return h ? (++r, et()) : 61 === e ? $e(pe, 2) : $e(he, 1)
}();
case 37:
case 42:
return 61 === A.charCodeAt(r + 1) ? $e(pe, 2) : $e(Qe, 1);
case 124:
case 38:
return function(e) {
var t = A.charCodeAt(r + 1);
return t === e ? $e(124 === e ? fe : Ce, 2) : 61 === t ? $e(pe, 2) : $e(124 === e ? we : ye, 1)
}(e);
case 94:
return 61 === A.charCodeAt(r + 1) ? $e(pe, 2) : $e(Ie, 1);
case 43:
case 45:
return function(e) {
var t = A.charCodeAt(r + 1);
return t === e ? 45 == t && 62 == A.charCodeAt(r + 2) && _e.test(A.slice(B, r)) ? (r += 3, We(), qe(), Ze()) : $e(Ee, 2) : 61 === t ? $e(pe, 2) : $e(Se, 1)
}(e);
case 60:
case 62:
return function(e) {
var t = A.charCodeAt(r + 1),
o = 1;
return t === e ? (o = 62 === e && 62 === A.charCodeAt(r + 2) ? 3 : 2, 61 === A.charCodeAt(r + o) ? $e(pe, o + 1) : $e(Te, o)) : 33 == t && 60 == e && 45 == A.charCodeAt(r + 2) && 45 == A.charCodeAt(r + 3) ? (r += 4, We(), qe(), Ze()) : (61 === t && (o = 61 === A.charCodeAt(r + 2) ? 3 : 2), $e(Me, o))
}(e);
case 61:
case 33:
return function(e) {
return 61 === A.charCodeAt(r + 1) ? $e(be, 61 === A.charCodeAt(r + 2) ? 3 : 2) : $e(61 === e ? me : Be, 1)
}(e);
case 126:
return $e(Be, 1)
}
return !1
}
function Ze(e) {
if (e ? r = s + 1 : s = r, t.locations && (u = new ze), e) return et();
if (r >= o) return Je(k);
var n = A.charCodeAt(r);
if (He(n) || 92 === n) return it();
var i = Xe(n);
if (!1 === i) {
var a = String.fromCharCode(n);
if ("\\" === a || Ge.test(a)) return it();
b(r, "Unexpected character '" + a + "'")
}
return i
}
function $e(e, t) {
var o = A.slice(r, r + t);
r += t, Je(e, o)
}
function et() {
for (var e, t, n = r;;) {
r >= o && b(n, "Unterminated regular expression");
var i = A.charAt(r);
if (_e.test(i) && b(n, "Unterminated regular expression"), e) e = !1;
else {
if ("[" === i) t = !0;
else if ("]" === i && t) t = !1;
else if ("/" === i && !t) break;
e = "\\" === i
}++r
}
var a = A.slice(n, r);
++r;
var s = nt();
s && !/^[gmsiy]*$/.test(s) && b(n, "Invalid regexp flag");
try {
var l = new RegExp(a, s)
} catch (e) {
e instanceof SyntaxError && b(n, e.message), b(e)
}
return Je(S, l)
}
function tt(e, t) {
for (var o = r, n = 0, i = 0, a = null == t ? 1 / 0 : t; i < a; ++i) {
var s, l = A.charCodeAt(r);
if ((s = l >= 97 ? l - 97 + 10 : l >= 65 ? l - 65 + 10 : l >= 48 && l <= 57 ? l - 48 : 1 / 0) >= e) break;
++r, n = n * e + s
}
return r === o || null != t && r - o !== t ? null : n
}
function At(e) {
var t = r,
o = !1,
n = 48 === A.charCodeAt(r);
e || null !== tt(10) || b(t, "Invalid number"), 46 === A.charCodeAt(r) && (++r, tt(10), o = !0);
var i = A.charCodeAt(r);
69 !== i && 101 !== i || (43 !== (i = A.charCodeAt(++r)) && 45 !== i || ++r, null === tt(10) && b(t, "Invalid number"), o = !0), He(A.charCodeAt(r)) && b(r, "Identifier directly after number");
var a, s = A.slice(t, r);
return o ? a = parseFloat(s) : n && 1 !== s.length ? /[89]/.test(s) || I ? b(t, "Invalid number") : a = parseInt(s, 8) : a = parseInt(s, 10), Je(T, a)
}
function ot(e) {
var t = tt(16, e);
return null === t && b(s, "Bad character escape sequence"), t
}
function nt() {
Ne = !1;
for (var e, t = !0, o = r;;) {
var n = A.charCodeAt(r);
if (je(n)) Ne && (e += A.charAt(r)), ++r;
else {
if (92 !== n) break;
Ne || (e = A.slice(o, r)), Ne = !0, 117 != A.charCodeAt(++r) && b(r, "Expecting Unicode escape sequence \\uXXXX"), ++r;
var i = ot(4),
a = String.fromCharCode(i);
a || b(r - 1, "Invalid Unicode escape"), (t ? He(i) : je(i)) || b(r - 4, "Invalid Unicode escape"), e += a
}
t = !1
}
return Ne ? e : A.slice(o, r)
}
function it() {
var e = nt(),
t = D;
return !Ne && Ye(e) && (t = Ae[e]), Je(t, e)
}
function at() {
E = s, B = l, f = c, Ze()
}
function rt(e) {
if (I = e, r = s, t.locations)
for (; r < p;) p = A.lastIndexOf("\n", p - 2) + 1, --m;
qe(), Ze()
}
function st() {
this.type = null, this.start = s, this.end = null
}
function lt() {
this.start = u, this.end = null, null !== n && (this.source = n)
}
function ut() {
var e = new st;
return t.locations && (e.loc = new lt), t.directSourceFile && (e.sourceFile = t.directSourceFile), t.ranges && (e.range = [s, 0]), e
}
function ct(e) {
var A = new st;
return A.start = e.start, t.locations && (A.loc = new lt, A.loc.start = e.loc.start), t.ranges && (A.range = [e.range[0], 0]), A
}
function gt(e, A) {
return e.type = A, e.end = B, t.locations && (e.loc.end = f), t.ranges && (e.range[1] = B), e
}
function dt(e) {
return t.ecmaVersion >= 5 && "ExpressionStatement" === e.type && "Literal" === e.expression.type && "use strict" === e.expression.value
}
function ht(e) {
if (g === e) return at(), !0
}
function mt() {
return !t.strictSemicolons && (g === k || g === ae || _e.test(A.slice(B, s)))
}
function pt() {
ht(ue) || mt() || Bt()
}
function Et(e) {
g === e ? at() : Bt()
}
function Bt() {
b(s, "Unexpected token")
}
function ft(e) {
"Identifier" !== e.type && "MemberExpression" !== e.type && b(e.start, "Assigning to rvalue"), I && "Identifier" === e.type && Fe(e.name) && b(e.start, "Assigning to " + e.name + " in strict mode")
}
var Ct = {
kind: "loop"
},
wt = {
kind: "switch"
};
function It() {
(g === he || g === pe && "/=" == d) && Ze(!0);
var e = g,
o = ut();
switch (e) {
case N:
case R:
at();
var n = e === N;
ht(ue) || mt() ? o.label = null : g !== D ? Bt() : (o.label = Yt(), pt());
for (var i = 0; i < w.length; ++i) {
var a = w[i];
if (null == o.label || a.name === o.label.name) {
if (null != a.kind && (n || "loop" === a.kind)) break;
if (o.label && n) break
}
}
return i === w.length && b(o.start, "Unsyntactic " + e.keyword), gt(o, n ? "BreakStatement" : "ContinueStatement");
case F:
return at(), pt(), gt(o, "DebuggerStatement");
case U:
return at(), w.push(Ct), o.body = It(), w.pop(), Et(V), o.test = yt(), pt(), gt(o, "DoWhileStatement");
case x:
if (at(), w.push(Ct), Et(re), g === ue) return Mt(o, null);
if (g === J) {
var r = ut();
return at(), St(r, !0), gt(r, "VariableDeclaration"), 1 === r.declarations.length && ht(te) ? Tt(o, r) : Mt(o, r)
}
r = Qt(!1, !0);
return ht(te) ? (ft(r), Tt(o, r)) : Mt(o, r);
case _:
return at(), Rt(o, !0);
case P:
return at(), o.test = yt(), o.consequent = It(), o.alternate = ht(L) ? It() : null, gt(o, "IfStatement");
case H:
return C || t.allowReturnOutsideFunction || b(s, "'return' outside of function"), at(), ht(ue) || mt() ? o.argument = null : (o.argument = Qt(), pt()), gt(o, "ReturnStatement");
case j:
at(), o.discriminant = yt(), o.cases = [], Et(ie), w.push(wt);
for (var l, u; g != ae;)
if (g === v || g === Y) {
var c = g === v;
l && gt(l, "SwitchCase"), o.cases.push(l = ut()), l.consequent = [], at(), c ? l.test = Qt() : (u && b(E, "Multiple default clauses"), u = !0, l.test = null), Et(ce)
} else l || Bt(), l.consequent.push(It());
return l && gt(l, "SwitchCase"), at(), w.pop(), gt(o, "SwitchStatement");
case z:
return at(), _e.test(A.slice(B, s)) && b(B, "Illegal newline after throw"), o.argument = Qt(), pt(), gt(o, "ThrowStatement");
case K:
if (at(), o.block = bt(), o.handler = null, g === O) {
var h = ut();
at(), Et(re), h.param = Yt(), I && Fe(h.param.name) && b(h.param.start, "Binding " + h.param.name + " in strict mode"), Et(se), h.guard = null, h.body = bt(), o.handler = gt(h, "CatchClause")
}
return o.guardedHandlers = M, o.finalizer = ht(G) ? bt() : null, o.handler || o.finalizer || b(o.start, "Missing catch or finally clause"), gt(o, "TryStatement");
case J:
return at(), St(o), pt(), gt(o, "VariableDeclaration");
case V:
return at(), o.test = yt(), w.push(Ct), o.body = It(), w.pop(), gt(o, "WhileStatement");
case W:
return I && b(s, "'with' in strict mode"), at(), o.object = yt(), o.body = It(), gt(o, "WithStatement");
case ie:
return bt();
case ue:
return at(), gt(o, "EmptyStatement");
default:
var m = d,
p = Qt();
if (e === D && "Identifier" === p.type && ht(ce)) {
for (i = 0; i < w.length; ++i) w[i].name === m && b(p.start, "Label '" + m + "' is already declared");
var f = g.isLoop ? "loop" : g === j ? "switch" : null;
return w.push({
name: m,
kind: f
}), o.body = It(), w.pop(), o.label = p, gt(o, "LabeledStatement")
}
return o.expression = p, pt(), gt(o, "ExpressionStatement")
}
}
function yt() {
Et(re);
var e = Qt();
return Et(se), e
}
function bt(e) {
var t, A = ut(),
o = !0,
n = !1;
for (A.body = [], Et(ie); !ht(ae);) {
var i = It();
A.body.push(i), o && e && dt(i) && (t = n, rt(n = !0)), o = !1
}
return n && !t && rt(!1), gt(A, "BlockStatement")
}
function Mt(e, t) {
return e.init = t, Et(ue), e.test = g === ue ? null : Qt(), Et(ue), e.update = g === se ? null : Qt(), Et(se), e.body = It(), w.pop(), gt(e, "ForStatement")
}
function Tt(e, t) {
return e.left = t, e.right = Qt(), Et(se), e.body = It(), w.pop(), gt(e, "ForInStatement")
}
function St(e, t) {
for (e.declarations = [], e.kind = "var";;) {
var A = ut();
if (A.id = Yt(), I && Fe(A.id.name) && b(A.id.start, "Binding " + A.id.name + " in strict mode"), A.init = ht(me) ? Qt(!0, t) : null, e.declarations.push(gt(A, "VariableDeclarator")), !ht(le)) break
}
return e
}
function Qt(e, t) {
var A = Dt(t);
if (!e && g === le) {
var o = ct(A);
for (o.expressions = [A]; ht(le);) o.expressions.push(Dt(t));
return gt(o, "SequenceExpression")
}
return A
}
function Dt(e) {
var t = function(e) {
var t = function(e) {
return function e(t, A, o) {
var n = g.binop;
if (null != n && (!o || g !== te) && n > A) {
var i = ct(t);
i.left = t, i.operator = d;
var a = g;
at(), i.right = e(kt(), n, o);
var r = gt(i, a === fe || a === Ce ? "LogicalExpression" : "BinaryExpression");
return e(r, A, o)
}
return t
}(kt(), -1, e)
}(e);
if (ht(de)) {
var A = ct(t);
return A.test = t, A.consequent = Qt(!0), Et(ce), A.alternate = Qt(!0, e), gt(A, "ConditionalExpression")
}
return t
}(e);
if (g.isAssign) {
var A = ct(t);
return A.operator = d, A.left = t, at(), A.right = Dt(e), ft(t), gt(A, "AssignmentExpression")
}
return t
}
function kt() {
if (g.prefix) {
var e = ut(),
t = g.isUpdate;
return e.operator = d, e.prefix = !0, h = !0, at(), e.argument = kt(), t ? ft(e.argument) : I && "delete" === e.operator && "Identifier" === e.argument.type && b(e.start, "Deleting local variable in strict mode"), gt(e, t ? "UpdateExpression" : "UnaryExpression")
}
for (var A = Nt(vt()); g.postfix && !mt();) {
(e = ct(A)).operator = d, e.prefix = !1, e.argument = A, ft(A), at(), A = gt(e, "UpdateExpression")
}
return A
}
function Nt(e, t) {
var A;
return ht(ge) ? ((A = ct(e)).object = e, A.property = Yt(!0), A.computed = !1, Nt(gt(A, "MemberExpression"), t)) : ht(oe) ? ((A = ct(e)).object = e, A.property = Qt(), A.computed = !0, Et(ne), Nt(gt(A, "MemberExpression"), t)) : !t && ht(re) ? ((A = ct(e)).callee = e, A.arguments = Ft(se, !1), Nt(gt(A, "CallExpression"), t)) : e
}
function vt() {
switch (g) {
case X:
var e = ut();
return at(), gt(e, "ThisExpression");
case D:
return Yt();
case T:
case Q:
case S:
return (e = ut()).value = d, e.raw = A.slice(s, l), at(), gt(e, "Literal");
case Z:
case $:
case ee:
return (e = ut()).value = g.atomValue, e.raw = g.keyword, at(), gt(e, "Literal");
case re:
var o = u,
n = s;
at();
var i = Qt();
return i.start = n, i.end = l, t.locations && (i.loc.start = o, i.loc.end = c), t.ranges && (i.range = [n, l]), Et(se), i;
case oe:
e = ut();
return at(), e.elements = Ft(ne, !0, !0), gt(e, "ArrayExpression");
case ie:
return function() {
var e = ut(),
A = !0,
o = !1;
e.properties = [], at();
for (; !ht(ae);) {
if (A) A = !1;
else if (Et(le), t.allowTrailingCommas && ht(ae)) break;
var n, i = {
key: Ot()
},
a = !1;
if (ht(ce) ? (i.value = Qt(!0), n = i.kind = "init") : t.ecmaVersion >= 5 && "Identifier" === i.key.type && ("get" === i.key.name || "set" === i.key.name) ? (a = o = !0, n = i.kind = i.key.name, i.key = Ot(), g !== re && Bt(), i.value = Rt(ut(), !1)) : Bt(), "Identifier" === i.key.type && (I || o))
for (var r = 0; r < e.properties.length; ++r) {
var s = e.properties[r];
if (s.key.name === i.key.name) {
var l = n == s.kind || a && "init" === s.kind || "init" === n && ("get" === s.kind || "set" === s.kind);
l && !I && "init" === n && "init" === s.kind && (l = !1), l && b(i.key.start, "Redefinition of property")
}
}
e.properties.push(i)
}
return gt(e, "ObjectExpression")
}();
case _:
e = ut();
return at(), Rt(e, !1);
case q:
return function() {
var e = ut();
at(), e.callee = Nt(vt(), !0), ht(re) ? e.arguments = Ft(se, !1) : e.arguments = M;
return gt(e, "NewExpression")
}();
default:
Bt()
}
}
function Ot() {
return g === T || g === Q ? vt() : Yt(!0)
}
function Rt(e, t) {
g === D ? e.id = Yt() : t ? Bt() : e.id = null, e.params = [];
var A = !0;
for (Et(re); !ht(se);) A ? A = !1 : Et(le), e.params.push(Yt());
var o = C,
n = w;
if (C = !0, w = [], e.body = bt(!0), C = o, w = n, I || e.body.body.length && dt(e.body.body[0]))
for (var i = e.id ? -1 : 0; i < e.params.length; ++i) {
var a = i < 0 ? e.id : e.params[i];
if ((Re(a.name) || Fe(a.name)) && b(a.start, "Defining '" + a.name + "' in strict mode"), i >= 0)
for (var r = 0; r < i; ++r) a.name === e.params[r].name && b(a.start, "Argument name clash in strict mode")
}
return gt(e, t ? "FunctionDeclaration" : "FunctionExpression")
}
function Ft(e, A, o) {
for (var n = [], i = !0; !ht(e);) {
if (i) i = !1;
else if (Et(le), A && t.allowTrailingCommas && ht(e)) break;
o && g === le ? n.push(null) : n.push(Qt(!0))
}
return n
}
function Yt(e) {
var o = ut();
return e && "everywhere" == t.forbidReserved && (e = !1), g === D ? (!e && (t.forbidReserved && (3 === t.ecmaVersion ? ve : Oe)(d) || I && Re(d)) && -1 == A.slice(s, l).indexOf("\\") && b(s, "The keyword '" + d + "' is reserved"), o.name = d) : e && g.keyword ? o.name = g.keyword : Bt(), h = !1, at(), gt(o, "Identifier")
}
}), d.version || (d = null));
function h(e, t) {
return (c.acorn || d).parse(e, t)
}
var m = {
"+": "__add",
"-": "__subtract",
"*": "__multiply",
"/": "__divide",
"%": "__modulo",
"==": "__equals",
"!=": "__equals"
},
p = {
"-": "__negate",
"+": "__self"
},
B = u.each(["add", "subtract", "multiply", "divide", "modulo", "equals", "negate"], function(e) {
this["__" + e] = "#" + e
}, {
__self: function() {
return this
}
});
function C(e, t, A) {
var o = m[t];
if (e && e[o]) {
var n = e[o](A);
return "!=" === t ? !n : n
}
switch (t) {
case "+":
return e + A;
case "-":
return e - A;
case "*":
return e * A;
case "/":
return e / A;
case "%":
return e % A;
case "==":
return e == A;
case "!=":
return e != A
}
}
function w(e, t) {
var A = p[e];
if (t && t[A]) return t[A]();
switch (e) {
case "+":
return +t;
case "-":
return -t
}
}
function I(e, t) {
if (!e) return "";
var A = [];
function o(e) {
for (var t = 0, o = A.length; t < o; t++) {
var n = A[t];
if (n[0] >= e) break;
e += n[1]
}
return e
}
function n(t) {
return e.substring(o(t.range[0]), o(t.range[1]))
}
function i(t, n) {
for (var i = o(t.range[0]), a = o(t.range[1]), r = 0, s = A.length - 1; s >= 0; s--)
if (i > A[s][0]) {
r = s + 1;
break
}
A.splice(r, 0, [i, n.length - a + i]), e = e.substring(0, i) + n + e.substring(a)
}
var r, u = (t = t || {}).url || "",
c = ue.agent,
g = c.versionNumber,
d = !1,
E = t.sourceMaps,
B = t.source || e,
f = /\r\n|\n|\r/gm,
C = t.offset || 0;
if (E && (c.chrome && g >= 30 || c.webkit && g >= 537.76 || c.firefox && g >= 23 || c.node)) {
if (c.node) C -= 2;
else if (s && u && !s.location.href.indexOf(u)) {
var w = l.getElementsByTagName("html")[0].innerHTML;
C = w.substr(0, w.indexOf(e) + 1).match(f).length + 1
}
var I = ["AA" + function(e) {
var t = "";
for (e = (Math.abs(e) << 1) + (e < 0 ? 1 : 0); e || !t;) {
var A = 31 & e;
(e >>= 5) && (A |= 32), t += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" [A]
}
return t
}((d = C > 0 && !(c.chrome && g >= 36 || c.safari && g >= 600 || c.firefox && g >= 40 || c.node)) ? 0 : C) + "A"];
I.length = (e.match(f) || []).length + 1 + (d ? C : 0), r = {
version: 3,
file: u,
names: [],
mappings: I.join(";AACA"),
sourceRoot: "",
sources: [u],
sourcesContent: [B]
}
}
return function t(A, a) {
if (A) {
for (var r in A)
if ("range" !== r && "loc" !== r) {
var s = A[r];
if (Array.isArray(s))
for (var l = 0, u = s.length; l < u; l++) t(s[l], A);
else s && "object" == typeof s && t(s, A)
}
switch (A.type) {
case "UnaryExpression":
if (A.operator in p && "Literal" !== A.argument.type) {
var c = n(A.argument);
i(A, '$__("' + A.operator + '", ' + c + ")")
}
break;
case "BinaryExpression":
if (A.operator in m && "Literal" !== A.left.type) {
var g = n(A.left),
d = n(A.right),
h = function(t, A) {
return e.substring(o(t.range[1]), o(A.range[0]))
}(A.left, A.right),
E = A.operator;
i(A, "__$__(" + g + "," + h.replace(new RegExp("\\" + E), '"' + E + '"') + ", " + d + ")")
}
break;
case "UpdateExpression":
case "AssignmentExpression":
var B = a && a.type;
if (!("ForStatement" === B || "BinaryExpression" === B && /^[=!<>]/.test(a.operator) || "MemberExpression" === B && a.computed))
if ("UpdateExpression" === A.type) {
var f = (c = n(A.argument)) + " = " + (C = "__$__(" + c + ', "' + A.operator[0] + '", 1)');
A.prefix || "AssignmentExpression" !== B && "VariableDeclarator" !== B || (n(a.left || a.id) === c && (f = C), f = c + "; " + f), i(A, f)
} else if (/^.=$/.test(A.operator) && "Literal" !== A.left.type) {
g = n(A.left), d = n(A.right);
var C = g + " = __$__(" + g + ', "' + A.operator[0] + '", ' + d + ")";
i(A, /^\(.*\)$/.test(n(A)) ? "(" + C + ")" : C)
}
break;
case "ExportDefaultDeclaration":
i({
range: [A.start, A.declaration.start]
}, "module.exports = ");
break;
case "ExportNamedDeclaration":
var w = A.declaration,
I = A.specifiers;
if (w) {
var y = w.declarations;
y && (y.forEach(function(e) {
i(e, "module.exports." + n(e))
}), i({
range: [A.start, w.start + w.kind.length]
}, ""))
} else if (I) {
var b = I.map(function(e) {
var t = n(e);
return "module.exports." + t + " = " + t + "; "
}).join("");
b && i(A, b)
}
}
}
}(h(e, {
ranges: !0,
preserveParens: !0,
sourceType: "module"
})), r && (d && (e = new Array(C + 1).join("\n") + e), /^(inline|both)$/.test(E) && (e += "\n//# sourceMappingURL=data:application/json;base64," + a.btoa(unescape(encodeURIComponent(JSON.stringify(r))))), e += "\n//# sourceURL=" + (u || "paperscript")), {
url: u,
source: B,
code: e,
map: r
}
}
function y(e, t, A) {
ue = t;
var o, n = t.getView(),
i = /\btool\.\w+|\s+on(?:Key|Mouse)(?:Up|Down|Move|Drag)\b/.test(e) && !/\bnew\s+Tool\b/.test(e) ? new ne : null,
a = i ? i._events : [],
r = ["onFrame", "onResize"].concat(a),
s = [],
c = [],
g = "object" == typeof e ? e : I(e, A);
function d(t, A) {
for (var o in t) !A && /^_/.test(o) || !new RegExp("([\\b\\s\\W]|^)" + o.replace(/\$/g, "\\$") + "\\b").test(e) || (s.push(o), c.push(t[o]))
}
e = g.code, d({
__$__: C,
$__: w,
paper: t,
view: n,
tool: i
}, !0), d(t), e = "var module = { exports: {} }; " + e, (B = u.each(r, function(t) {
new RegExp("\\s+" + t + "\\b").test(e) && (s.push(t), this.push("module.exports." + t + " = " + t + ";"))
}, []).join("\n")) && (e += "\n" + B), e += "\nreturn module.exports;";
var h = ue.agent;
if (l && (h.chrome || h.firefox && h.versionNumber < 40)) {
var m = l.createElement("script"),
p = l.head || l.getElementsByTagName("head")[0];
h.firefox && (e = "\n" + e), m.appendChild(l.createTextNode("document.__paperscript__ = function(" + s + ") {" + e + "\n}")), p.appendChild(m), o = l.__paperscript__, delete l.__paperscript__, p.removeChild(m)
} else o = Function(s, e);
var B, f = (B = o && o.apply(t, c)) || {};
return u.each(a, function(e) {
var t = f[e];
t && (i[e] = t)
}), n && (f.onResize && n.setOnResize(f.onResize), n.emit("resize", {
size: n.size,
delta: new E
}), f.onFrame && n.setOnFrame(f.onFrame), n.requestUpdate()), B
}
function b(e) {
if (/^text\/(?:x-|)paperscript$/.test(e.type) && "true" !== g.getAttribute(e, "ignore")) {
var t = g.getAttribute(e, "canvas"),
A = l.getElementById(t),
o = e.src || e.getAttribute("data-src"),
n = g.hasAttribute(e, "async");
if (!A) throw new Error('Unable to find canvas with id "' + t + '"');
var i = g.get(A.getAttribute("data-paper-scope")) || (new g).setup(A);
return A.setAttribute("data-paper-scope", i._id), o ? ie.request({
url: o,
async: n,
mimeType: "text/plain",
onLoad: function(e) {
y(e, i, o)
}
}) : y(e.innerHTML, i, e.baseURI), e.setAttribute("data-paper-ignore", "true"), i
}
}
function M() {
u.each(l && l.getElementsByTagName("script"), b)
}
return E.inject(B), f.inject(B), z.inject(B), s && ("complete" === l.readyState ? setTimeout(M) : q.add(s, {
load: M
})), {
compile: I,
execute: y,
load: function(e) {
return e ? b(e) : M()
},
parse: h
}
}.call(this);
var ue = new(g.inject(u.exports, {
Base: u,
Numerical: m,
Key: te,
DomEvent: q,
DomElement: W,
document: l,
window: s,
Symbol: v,
PlacedSymbol: N
}));
return ue.agent.node && A(1131)(ue), (i = "function" == typeof(n = ue) ? n.call(t, A, t, e) : n) === r || (e.exports = i), ue
}).call(this, "object" == typeof self ? self : null)
}, function(e, t, A) {
var o;
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
! function() {
"use strict";
var A = {}.hasOwnProperty;
function n() {
for (var e = [], t = 0; t < arguments.length; t++) {
var o = arguments[t];
if (o) {
var i = typeof o;
if ("string" === i || "number" === i) e.push(o);
else if (Array.isArray(o) && o.length) {
var a = n.apply(null, o);
a && e.push(a)
} else if ("object" === i)
for (var r in o) A.call(o, r) && o[r] && e.push(r)
}
}
return e.join(" ")
}
e.exports ? (n.default = n, e.exports = n) : void 0 === (o = function() {
return n
}.apply(t, [])) || (e.exports = o)
}()
}, function(e, t, A) {
(function(t) {
var A = "Expected a function",
o = "__lodash_placeholder__",
n = 1,
i = 2,
a = 4,
r = 8,
s = 16,
l = 32,
u = 64,
c = 128,
g = 512,
d = 1 / 0,
h = 9007199254740991,
m = 1.7976931348623157e308,
p = NaN,
E = [
["ary", c],
["bind", n],
["bindKey", i],
["curry", r],
["curryRight", s],
["flip", g],
["partial", l],
["partialRight", u],
["rearg", 256]
],
B = "[object Arguments]",
f = "[object Function]",
C = "[object GeneratorFunction]",
w = "[object Symbol]",
I = /^\s+|\s+$/g,
y = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
b = /\{\n\/\* \[wrapped with (.+)\] \*/,
M = /,? & /,
T = /^[-+]0x[0-9a-f]+$/i,
S = /^0b[01]+$/i,
Q = /^\[object .+?Constructor\]$/,
D = /^0o[0-7]+$/i,
k = /^(?:0|[1-9]\d*)$/,
N = parseInt,
v = "object" == typeof t && t && t.Object === Object && t,
O = "object" == typeof self && self && self.Object === Object && self,
R = v || O || Function("return this")();
function F(e, t, A) {
switch (A.length) {
case 0:
return e.call(t);
case 1:
return e.call(t, A[0]);
case 2:
return e.call(t, A[0], A[1]);
case 3:
return e.call(t, A[0], A[1], A[2])
}
return e.apply(t, A)
}
function Y(e, t) {
for (var A = -1, o = e ? e.length : 0; ++A < o && !1 !== t(e[A], A, e););
return e
}
function U(e, t) {
return !!(e ? e.length : 0) && function(e, t, A) {
if (t != t) return function(e, t, A, o) {
var n = e.length,
i = A + (o ? 1 : -1);
for (; o ? i-- : ++i < n;)
if (t(e[i], i, e)) return i;
return -1
}(e, G, A);
var o = A - 1,
n = e.length;
for (; ++o < n;)
if (e[o] === t) return o;
return -1
}(e, t, 0) > -1
}
function L(e, t) {
for (var A = -1, o = t.length, n = e.length; ++A < o;) e[n + A] = t[A];
return e
}
function G(e) {
return e != e
}
function x(e, t) {
for (var A = -1, n = e.length, i = 0, a = []; ++A < n;) {
var r = e[A];
r !== t && r !== o || (e[A] = o, a[i++] = A)
}
return a
}
var _ = Function.prototype,
P = Object.prototype,
H = R["__core-js_shared__"],
j = function() {
var e = /[^.]+$/.exec(H && H.keys && H.keys.IE_PROTO || "");
return e ? "Symbol(src)_1." + e : ""
}(),
z = _.toString,
K = P.hasOwnProperty,
J = P.toString,
V = RegExp("^" + z.call(K).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"),
W = R.Symbol,
q = Object.create,
X = P.propertyIsEnumerable,
Z = W ? W.isConcatSpreadable : void 0,
$ = Math.max,
ee = Math.min,
te = function() {
var e = le(Object, "defineProperty"),
t = le.name;
return t && t.length > 2 ? e : void 0
}();
function Ae(e) {
return !(!pe(e) || function(e) {
return !!j && j in e
}(e)) && (me(e) || function(e) {
var t = !1;
if (null != e && "function" != typeof e.toString) try {
t = !!(e + "")
} catch (e) {}
return t
}(e) ? V : Q).test(function(e) {
if (null != e) {
try {
return z.call(e)
} catch (e) {}
try {
return e + ""
} catch (e) {}
}
return ""
}(e))
}
function oe(e, t) {
return t = $(void 0 === t ? e.length - 1 : t, 0),
function() {
for (var A = arguments, o = -1, n = $(A.length - t, 0), i = Array(n); ++o < n;) i[o] = A[t + o];
o = -1;
for (var a = Array(t + 1); ++o < t;) a[o] = A[o];
return a[t] = i, F(e, this, a)
}
}
function ne(e) {
return function() {
var t = arguments;
switch (t.length) {
case 0:
return new e;
case 1:
return new e(t[0]);
case 2:
return new e(t[0], t[1]);
case 3:
return new e(t[0], t[1], t[2]);
case 4:
return new e(t[0], t[1], t[2], t[3]);
case 5:
return new e(t[0], t[1], t[2], t[3], t[4]);
case 6:
return new e(t[0], t[1], t[2], t[3], t[4], t[5]);
case 7:
return new e(t[0], t[1], t[2], t[3], t[4], t[5], t[6])
}
var A = function(e) {
return pe(e) ? q(e) : {}
}(e.prototype),
o = e.apply(A, t);
return pe(o) ? o : A
}
}
function ie(e, t, A, o, a, l, u, d, h, m) {
var p = t & c,
E = t & n,
B = t & i,
f = t & (r | s),
C = t & g,
w = B ? void 0 : ne(e);
return function n() {
for (var i = arguments.length, r = Array(i), s = i; s--;) r[s] = arguments[s];
if (f) var c = se(n),
g = function(e, t) {
for (var A = e.length, o = 0; A--;) e[A] === t && o++;
return o
}(r, c);
if (o && (r = function(e, t, A, o) {
for (var n = -1, i = e.length, a = A.length, r = -1, s = t.length, l = $(i - a, 0), u = Array(s + l), c = !o; ++r < s;) u[r] = t[r];
for (; ++n < a;)(c || n < i) && (u[A[n]] = e[n]);
for (; l--;) u[r++] = e[n++];
return u
}(r, o, a, f)), l && (r = function(e, t, A, o) {
for (var n = -1, i = e.length, a = -1, r = A.length, s = -1, l = t.length, u = $(i - r, 0), c = Array(u + l), g = !o; ++n < u;) c[n] = e[n];
for (var d = n; ++s < l;) c[d + s] = t[s];
for (; ++a < r;)(g || n < i) && (c[d + A[a]] = e[n++]);
return c
}(r, l, u, f)), i -= g, f && i < m) {
var I = x(r, c);
return ae(e, t, ie, n.placeholder, A, r, I, d, h, m - i)
}
var y = E ? A : this,
b = B ? y[e] : e;
return i = r.length, d ? r = function(e, t) {
for (var A = e.length, o = ee(t.length, A), n = function(e, t) {
var A = -1,
o = e.length;
for (t || (t = Array(o)); ++A < o;) t[A] = e[A];
return t
}(e); o--;) {
var i = t[o];
e[o] = ce(i, A) ? n[i] : void 0
}
return e
}(r, d) : C && i > 1 && r.reverse(), p && h < i && (r.length = h), this && this !== R && this instanceof n && (b = w || ne(b)), b.apply(y, r)
}
}
function ae(e, t, A, o, s, c, g, d, h, m) {
var p = t & r;
t |= p ? l : u, (t &= ~(p ? u : l)) & a || (t &= ~(n | i));
var E = A(e, t, s, p ? c : void 0, p ? g : void 0, p ? void 0 : c, p ? void 0 : g, d, h, m);
return E.placeholder = o, ge(E, e, t)
}
function re(e, t, o, a, c, g, d, h) {
var m = t & i;
if (!m && "function" != typeof e) throw new TypeError(A);
var p = a ? a.length : 0;
if (p || (t &= ~(l | u), a = c = void 0), d = void 0 === d ? d : $(Ce(d), 0), h = void 0 === h ? h : Ce(h), p -= c ? c.length : 0, t & u) {
var E = a,
B = c;
a = c = void 0
}
var f = [e, t, o, a, c, E, B, g, d, h];
if (e = f[0], t = f[1], o = f[2], a = f[3], c = f[4], !(h = f[9] = null == f[9] ? m ? 0 : e.length : $(f[9] - p, 0)) && t & (r | s) && (t &= ~(r | s)), t && t != n) C = t == r || t == s ? function(e, t, A) {
var o = ne(e);
return function n() {
for (var i = arguments.length, a = Array(i), r = i, s = se(n); r--;) a[r] = arguments[r];
var l = i < 3 && a[0] !== s && a[i - 1] !== s ? [] : x(a, s);
return (i -= l.length) < A ? ae(e, t, ie, n.placeholder, void 0, a, l, void 0, void 0, A - i) : F(this && this !== R && this instanceof n ? o : e, this, a)
}
}(e, t, h) : t != l && t != (n | l) || c.length ? ie.apply(void 0, f) : function(e, t, A, o) {
var i = t & n,
a = ne(e);
return function t() {
for (var n = -1, r = arguments.length, s = -1, l = o.length, u = Array(l + r), c = this && this !== R && this instanceof t ? a : e; ++s < l;) u[s] = o[s];
for (; r--;) u[s++] = arguments[++n];
return F(c, i ? A : this, u)
}
}(e, t, o, a);
else var C = function(e, t, A) {
var o = t & n,
i = ne(e);
return function t() {
return (this && this !== R && this instanceof t ? i : e).apply(o ? A : this, arguments)
}
}(e, t, o);
return ge(C, e, t)
}
function se(e) {
return e.placeholder
}
function le(e, t) {
var A = function(e, t) {
return null == e ? void 0 : e[t]
}(e, t);
return Ae(A) ? A : void 0
}
function ue(e) {
return he(e) || function(e) {
return function(e) {
return Ee(e) && function(e) {
return null != e && function(e) {
return "number" == typeof e && e > -1 && e % 1 == 0 && e <= h
}(e.length) && !me(e)
}(e)
}(e) && K.call(e, "callee") && (!X.call(e, "callee") || J.call(e) == B)
}(e) || !!(Z && e && e[Z])
}
function ce(e, t) {
return !!(t = null == t ? h : t) && ("number" == typeof e || k.test(e)) && e > -1 && e % 1 == 0 && e < t
}
var ge = te ? function(e, t, A) {
var o = t + "";
return te(e, "toString", {
configurable: !0,
enumerable: !1,
value: function(e) {
return function() {
return e
}
}(function(e, t) {
var A = t.length,
o = A - 1;
return t[o] = (A > 1 ? "& " : "") + t[o], t = t.join(A > 2 ? ", " : " "), e.replace(y, "{\n/* [wrapped with " + t + "] */\n")
}(o, function(e, t) {
return Y(E, function(A) {
var o = "_." + A[0];
t & A[1] && !U(e, o) && e.push(o)
}), e.sort()
}(function(e) {
var t = e.match(b);
return t ? t[1].split(M) : []
}(o), A)))
})
} : function(e) {
return e
};
var de = oe(function(e, t, A) {
var o = n;
if (A.length) {
var i = x(A, se(de));
o |= l
}
return re(e, o, t, A, i)
});
var he = Array.isArray;
function me(e) {
var t = pe(e) ? J.call(e) : "";
return t == f || t == C
}
function pe(e) {
var t = typeof e;
return !!e && ("object" == t || "function" == t)
}
function Ee(e) {
return !!e && "object" == typeof e
}
function Be(e) {
return "symbol" == typeof e || Ee(e) && J.call(e) == w
}
function fe(e) {
return e ? (e = function(e) {
if ("number" == typeof e) return e;
if (Be(e)) return p;
if (pe(e)) {
var t = "function" == typeof e.valueOf ? e.valueOf() : e;
e = pe(t) ? t + "" : t
}
if ("string" != typeof e) return 0 === e ? e : +e;
e = e.replace(I, "");
var A = S.test(e);
return A || D.test(e) ? N(e.slice(2), A ? 2 : 8) : T.test(e) ? p : +e
}(e)) === d || e === -d ? (e < 0 ? -1 : 1) * m : e == e ? e : 0 : 0 === e ? e : 0
}
function Ce(e) {
var t = fe(e),
A = t % 1;
return t == t ? A ? t - A : t : 0
}
var we = oe(function(e, t) {
return Y(function e(t, A, o, n, i) {
var a = -1,
r = t.length;
for (o || (o = ue), i || (i = []); ++a < r;) {
var s = t[a];
A > 0 && o(s) ? A > 1 ? e(s, A - 1, o, n, i) : L(i, s) : n || (i[i.length] = s)
}
return i
}(t, 1), function(t) {
t = function(e) {
if ("string" == typeof e || Be(e)) return e;
var t = e + "";
return "0" == t && 1 / e == -d ? "-0" : t
}(t), e[t] = de(e[t], e)
}), e
});
de.placeholder = {}, e.exports = we
}).call(this, A(45))
}, function(e, t, A) {
"use strict";
var o = A(1),
n = A(0),
i = A.n(n),
a = i.a.shape({
trySubscribe: i.a.func.isRequired,
tryUnsubscribe: i.a.func.isRequired,
notifyNestedSubs: i.a.func.isRequired,
isSubscribed: i.a.func.isRequired
}),
r = i.a.shape({
subscribe: i.a.func.isRequired,
dispatch: i.a.func.isRequired,
getState: i.a.func.isRequired
});
var s = function() {
var e, t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "store",
A = arguments[1] || t + "Subscription",
n = function(e) {
function n(A, o) {
! function(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, n);
var i = function(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
}(this, e.call(this, A, o));
return i[t] = A.store, i
}
return function(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)
}(n, e), n.prototype.getChildContext = function() {
var e;
return (e = {})[t] = this[t], e[A] = null, e
}, n.prototype.render = function() {
return o.Children.only(this.props.children)
}, n
}(o.Component);
return n.propTypes = {
store: r.isRequired,
children: i.a.element.isRequired
}, n.childContextTypes = ((e = {})[t] = r.isRequired, e[A] = a, e), n
}(),
l = A(487),
u = A.n(l),
c = A(109),
g = A.n(c);
var d = null,
h = {
notify: function() {}
};
var m = function() {
function e(t, A, o) {
! function(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.store = t, this.parentSub = A, this.onStateChange = o, this.unsubscribe = null, this.listeners = h
}
return e.prototype.addNestedSub = function(e) {
return this.trySubscribe(), this.listeners.subscribe(e)
}, e.prototype.notifyNestedSubs = function() {
this.listeners.notify()
}, e.prototype.isSubscribed = function() {
return Boolean(this.unsubscribe)
}, e.prototype.trySubscribe = function() {
this.unsubscribe || (this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange), this.listeners = function() {
var e = [],
t = [];
return {
clear: function() {
t = d, e = d
},
notify: function() {
for (var A = e = t, o = 0; o < A.length; o++) A[o]()
},
get: function() {
return t
},
subscribe: function(A) {
var o = !0;
return t === e && (t = e.slice()), t.push(A),
function() {
o && e !== d && (o = !1, t === e && (t = e.slice()), t.splice(t.indexOf(A), 1))
}
}
}
}())
}, e.prototype.tryUnsubscribe = function() {
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = null, this.listeners.clear(), this.listeners = h)
}, e
}(),
p = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var A = arguments[t];
for (var o in A) Object.prototype.hasOwnProperty.call(A, o) && (e[o] = A[o])
}
return e
};
var E = 0,
B = {};
function f() {}
function C(e) {
var t, A, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
i = n.getDisplayName,
s = void 0 === i ? function(e) {
return "ConnectAdvanced(" + e + ")"
} : i,
l = n.methodName,
c = void 0 === l ? "connectAdvanced" : l,
d = n.renderCountProp,
h = void 0 === d ? void 0 : d,
C = n.shouldHandleStateChanges,
w = void 0 === C || C,
I = n.storeKey,
y = void 0 === I ? "store" : I,
b = n.withRef,
M = void 0 !== b && b,
T = function(e, t) {
var A = {};
for (var o in e) t.indexOf(o) >= 0 || Object.prototype.hasOwnProperty.call(e, o) && (A[o] = e[o]);
return A
}(n, ["getDisplayName", "methodName", "renderCountProp", "shouldHandleStateChanges", "storeKey", "withRef"]),
S = y + "Subscription",
Q = E++,
D = ((t = {})[y] = r, t[S] = a, t),
k = ((A = {})[S] = a, A);
return function(t) {
g()("function" == typeof t, "You must pass a component to the function returned by " + c + ". Instead received " + JSON.stringify(t));
var A = t.displayName || t.name || "Component",
n = s(A),
i = p({}, T, {
getDisplayName: s,
methodName: c,
renderCountProp: h,
shouldHandleStateChanges: w,
storeKey: y,
withRef: M,
displayName: n,
wrappedComponentName: A,
WrappedComponent: t
}),
a = function(A) {
function a(e, t) {
! function(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, a);
var o = function(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
}(this, A.call(this, e, t));
return o.version = Q, o.state = {}, o.renderCount = 0, o.store = e[y] || t[y], o.propsMode = Boolean(e[y]), o.setWrappedInstance = o.setWrappedInstance.bind(o), g()(o.store, 'Could not find "' + y + '" in either the context or props of "' + n + '". Either wrap the root component in a <Provider>, or explicitly pass "' + y + '" as a prop to "' + n + '".'), o.initSelector(), o.initSubscription(), o
}
return function(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)
}(a, A), a.prototype.getChildContext = function() {
var e, t = this.propsMode ? null : this.subscription;
return (e = {})[S] = t || this.context[S], e
}, a.prototype.componentDidMount = function() {
w && (this.subscription.trySubscribe(), this.selector.run(this.props), this.selector.shouldComponentUpdate && this.forceUpdate())
}, a.prototype.componentWillReceiveProps = function(e) {
this.selector.run(e)
}, a.prototype.shouldComponentUpdate = function() {
return this.selector.shouldComponentUpdate
}, a.prototype.componentWillUnmount = function() {
this.subscription && this.subscription.tryUnsubscribe(), this.subscription = null, this.notifyNestedSubs = f, this.store = null, this.selector.run = f, this.selector.shouldComponentUpdate = !1
}, a.prototype.getWrappedInstance = function() {
return g()(M, "To access the wrapped instance, you need to specify { withRef: true } in the options argument of the " + c + "() call."), this.wrappedInstance
}, a.prototype.setWrappedInstance = function(e) {
this.wrappedInstance = e
}, a.prototype.initSelector = function() {
var t = e(this.store.dispatch, i);
this.selector = function(e, t) {
var A = {
run: function(o) {
try {
var n = e(t.getState(), o);
(n !== A.props || A.error) && (A.shouldComponentUpdate = !0, A.props = n, A.error = null)
} catch (e) {
A.shouldComponentUpdate = !0, A.error = e
}
}
};
return A
}(t, this.store), this.selector.run(this.props)
}, a.prototype.initSubscription = function() {
if (w) {
var e = (this.propsMode ? this.props : this.context)[S];
this.subscription = new m(this.store, e, this.onStateChange.bind(this)), this.notifyNestedSubs = this.subscription.notifyNestedSubs.bind(this.subscription)
}
}, a.prototype.onStateChange = function() {
this.selector.run(this.props), this.selector.shouldComponentUpdate ? (this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate, this.setState(B)) : this.notifyNestedSubs()
}, a.prototype.notifyNestedSubsOnComponentDidUpdate = function() {
this.componentDidUpdate = void 0, this.notifyNestedSubs()
}, a.prototype.isSubscribed = function() {
return Boolean(this.subscription) && this.subscription.isSubscribed()
}, a.prototype.addExtraProps = function(e) {
if (!(M || h || this.propsMode && this.subscription)) return e;
var t = p({}, e);
return M && (t.ref = this.setWrappedInstance), h && (t[h] = this.renderCount++), this.propsMode && this.subscription && (t[S] = this.subscription), t
}, a.prototype.render = function() {
var e = this.selector;
if (e.shouldComponentUpdate = !1, e.error) throw e.error;
return Object(o.createElement)(t, this.addExtraProps(e.props))
}, a
}(o.Component);
return a.WrappedComponent = t, a.displayName = n, a.childContextTypes = k, a.contextTypes = D, a.propTypes = D, u()(a, t)
}
}
var w = Object.prototype.hasOwnProperty;
function I(e, t) {
return e === t ? 0 !== e || 0 !== t || 1 / e == 1 / t : e != e && t != t
}
function y(e, t) {
if (I(e, t)) return !0;
if ("object" != typeof e || null === e || "object" != typeof t || null === t) return !1;
var A = Object.keys(e),
o = Object.keys(t);
if (A.length !== o.length) return !1;
for (var n = 0; n < A.length; n++)
if (!w.call(t, A[n]) || !I(e[A[n]], t[A[n]])) return !1;
return !0
}
var b = A(47);
A(172);
function M(e) {
return function(t, A) {
var o = e(t, A);
function n() {
return o
}
return n.dependsOnOwnProps = !1, n
}
}
function T(e) {
return null !== e.dependsOnOwnProps && void 0 !== e.dependsOnOwnProps ? Boolean(e.dependsOnOwnProps) : 1 !== e.length
}
function S(e, t) {
return function(t, A) {
A.displayName;
var o = function(e, t) {
return o.dependsOnOwnProps ? o.mapToProps(e, t) : o.mapToProps(e)
};
return o.dependsOnOwnProps = !0, o.mapToProps = function(t, A) {
o.mapToProps = e, o.dependsOnOwnProps = T(e);
var n = o(t, A);
return "function" == typeof n && (o.mapToProps = n, o.dependsOnOwnProps = T(n), n = o(t, A)), n
}, o
}
}
var Q = [function(e) {
return "function" == typeof e ? S(e) : void 0
}, function(e) {
return e ? void 0 : M(function(e) {
return {
dispatch: e
}
})
}, function(e) {
return e && "object" == typeof e ? M(function(t) {
return Object(b.b)(e, t)
}) : void 0
}];
var D = [function(e) {
return "function" == typeof e ? S(e) : void 0
}, function(e) {
return e ? void 0 : M(function() {
return {}
})
}],
k = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var A = arguments[t];
for (var o in A) Object.prototype.hasOwnProperty.call(A, o) && (e[o] = A[o])
}
return e
};
function N(e, t, A) {
return k({}, A, e, t)
}
var v = [function(e) {
return "function" == typeof e ? function(e) {
return function(t, A) {
A.displayName;
var o = A.pure,
n = A.areMergedPropsEqual,
i = !1,
a = void 0;
return function(t, A, r) {
var s = e(t, A, r);
return i ? o && n(s, a) || (a = s) : (i = !0, a = s), a
}
}
}(e) : void 0
}, function(e) {
return e ? void 0 : function() {
return N
}
}];
function O(e, t, A, o) {
return function(n, i) {
return A(e(n, i), t(o, i), i)
}
}
function R(e, t, A, o, n) {
var i = n.areStatesEqual,
a = n.areOwnPropsEqual,
r = n.areStatePropsEqual,
s = !1,
l = void 0,
u = void 0,
c = void 0,
g = void 0,
d = void 0;
function h(n, s) {
var h = !a(s, u),
m = !i(n, l);
return l = n, u = s, h && m ? (c = e(l, u), t.dependsOnOwnProps && (g = t(o, u)), d = A(c, g, u)) : h ? (e.dependsOnOwnProps && (c = e(l, u)), t.dependsOnOwnProps && (g = t(o, u)), d = A(c, g, u)) : m ? function() {
var t = e(l, u),
o = !r(t, c);
return c = t, o && (d = A(c, g, u)), d
}() : d
}
return function(n, i) {
return s ? h(n, i) : function(n, i) {
return c = e(l = n, u = i), g = t(o, u), d = A(c, g, u), s = !0, d
}(n, i)
}
}
function F(e, t) {
var A = t.initMapStateToProps,
o = t.initMapDispatchToProps,
n = t.initMergeProps,
i = function(e, t) {
var A = {};
for (var o in e) t.indexOf(o) >= 0 || Object.prototype.hasOwnProperty.call(e, o) && (A[o] = e[o]);
return A
}(t, ["initMapStateToProps", "initMapDispatchToProps", "initMergeProps"]),
a = A(e, i),
r = o(e, i),
s = n(e, i);
return (i.pure ? R : O)(a, r, s, e, i)
}
var Y = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var A = arguments[t];
for (var o in A) Object.prototype.hasOwnProperty.call(A, o) && (e[o] = A[o])
}
return e
};
function U(e, t, A) {
for (var o = t.length - 1; o >= 0; o--) {
var n = t[o](e);
if (n) return n
}
return function(t, o) {
throw new Error("Invalid value of type " + typeof e + " for " + A + " argument when connecting component " + o.wrappedComponentName + ".")
}
}
function L(e, t) {
return e === t
}
var G = function() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
t = e.connectHOC,
A = void 0 === t ? C : t,
o = e.mapStateToPropsFactories,
n = void 0 === o ? D : o,
i = e.mapDispatchToPropsFactories,
a = void 0 === i ? Q : i,
r = e.mergePropsFactories,
s = void 0 === r ? v : r,
l = e.selectorFactory,
u = void 0 === l ? F : l;
return function(e, t, o) {
var i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {},
r = i.pure,
l = void 0 === r || r,
c = i.areStatesEqual,
g = void 0 === c ? L : c,
d = i.areOwnPropsEqual,
h = void 0 === d ? y : d,
m = i.areStatePropsEqual,
p = void 0 === m ? y : m,
E = i.areMergedPropsEqual,
B = void 0 === E ? y : E,
f = function(e, t) {
var A = {};
for (var o in e) t.indexOf(o) >= 0 || Object.prototype.hasOwnProperty.call(e, o) && (A[o] = e[o]);
return A
}(i, ["pure", "areStatesEqual", "areOwnPropsEqual", "areStatePropsEqual", "areMergedPropsEqual"]),
C = U(e, n, "mapStateToProps"),
w = U(t, a, "mapDispatchToProps"),
I = U(o, s, "mergeProps");
return A(u, Y({
methodName: "connect",
getDisplayName: function(e) {
return "Connect(" + e + ")"
},
shouldHandleStateChanges: Boolean(e),
initMapStateToProps: C,
initMapDispatchToProps: w,
initMergeProps: I,
pure: l,
areStatesEqual: g,
areOwnPropsEqual: h,
areStatePropsEqual: p,
areMergedPropsEqual: B
}, f))
}
}();
A.d(t, "a", function() {
return s
}), A.d(t, "b", function() {
return G
})
}, function(e, t, A) {
"use strict";
var o = A(4),
n = A.n(o),
i = A(0),
a = A.n(i),
r = A(1),
s = A.n(r),
l = A(167),
u = A.n(l),
c = A(625),
g = A.n(c);
function d(e, t, A) {
return t in e ? Object.defineProperty(e, t, {
value: A,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = A, e
}
function h(e, t) {
if (null == e) return {};
var A, o, n = function(e, t) {
if (null == e) return {};
var A, o, n = {},
i = Object.keys(e);
for (o = 0; o < i.length; o++) A = i[o], t.indexOf(A) >= 0 || (n[A] = e[A]);
return n
}(e, t);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
for (o = 0; o < i.length; o++) A = i[o], t.indexOf(A) >= 0 || Object.prototype.propertyIsEnumerable.call(e, A) && (n[A] = e[A])
}
return n
}! function() {
var e = function(e) {
var t = 601,
A = 987654321,
o = 4294967295;
return function() {
var e = ((A = 36969 * (65535 & A) + (A >> 16) & o) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & o) & o;
return (e /= 4294967296) + 1
}
}()
}();
var m = function(e) {
var t = e.alignContent,
A = e.alignItems,
o = e.alignSelf,
i = e.basis,
a = e.children,
r = e.className,
l = e.componentRef,
u = e.direction,
c = e.element,
m = e.grow,
p = e.height,
E = e.justifyContent,
B = e.width,
f = e.wrap,
C = e.shrink,
w = e.style,
I = h(e, ["alignContent", "alignItems", "alignSelf", "basis", "children", "className", "componentRef", "direction", "element", "grow", "height", "justifyContent", "width", "wrap", "shrink", "style"]);
return s.a.createElement(c, function(e) {
for (var t = 1; t < arguments.length; t++) {
var A = null != arguments[t] ? arguments[t] : {},
o = Object.keys(A);
"function" == typeof Object.getOwnPropertySymbols && (o = o.concat(Object.getOwnPropertySymbols(A).filter(function(e) {
return Object.getOwnPropertyDescriptor(A, e).enumerable
}))), o.forEach(function(t) {
d(e, t, A[t])
})
}
return e
}({
className: n()(r, g.a.box),
ref: l,
style: Object.assign({
alignContent: t,
alignItems: A,
alignSelf: o,
flexBasis: i,
flexDirection: u,
flexGrow: m,
flexShrink: C,
flexWrap: f,
justifyContent: E,
width: B,
height: p
}, {}, w)
}, I), a)
};
m.propTypes = {
alignContent: a.a.oneOf(["flex-start", "flex-end", "center", "space-between", "space-around", "stretch"]),
alignItems: a.a.oneOf(["flex-start", "flex-end", "center", "baseline", "stretch"]),
alignSelf: a.a.oneOf(["auto", "flex-start", "flex-end", "center", "baseline", "stretch"]),
basis: a.a.oneOfType([a.a.number, a.a.oneOf(["auto"])]),
children: a.a.node,
className: a.a.string,
componentRef: a.a.func,
direction: a.a.oneOf(["row", "row-reverse", "column", "column-reverse"]),
element: a.a.string,
grow: a.a.number,
height: a.a.oneOfType([a.a.number, a.a.string]),
justifyContent: a.a.oneOf(["flex-start", "flex-end", "center", "space-between", "space-around"]),
shrink: a.a.number,
style: u.a,
width: a.a.oneOfType([a.a.number, a.a.string]),
wrap: a.a.oneOf(["nowrap", "wrap", "wrap-reverse"])
}, m.defaultProps = {
element: "div",
style: {}
}, t.a = m
}, function(e, t, A) {
var o = A(1385);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t) {
e.exports = function(e) {
var t = [];
return t.toString = function() {
return this.map(function(t) {
var A = function(e, t) {
var A = e[1] || "",
o = e[3];
if (!o) return A;
if (t && "function" == typeof btoa) {
var n = function(e) {
return "/*# sourceMappingURL=data:application/json;charset=utf-8;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(e)))) + " */"
}(o),
i = o.sources.map(function(e) {
return "/*# sourceURL=" + o.sourceRoot + e + " */"
});
return [A].concat(i).concat([n]).join("\n")
}
return [A].join("\n")
}(t, e);
return t[2] ? "@media " + t[2] + "{" + A + "}" : A
}).join("")
}, t.i = function(e, A) {
"string" == typeof e && (e = [
[null, e, ""]
]);
for (var o = {}, n = 0; n < this.length; n++) {
var i = this[n][0];
"number" == typeof i && (o[i] = !0)
}
for (n = 0; n < e.length; n++) {
var a = e[n];
"number" == typeof a[0] && o[a[0]] || (A && !a[2] ? a[2] = A : A && (a[2] = "(" + a[2] + ") and (" + A + ")"), t.push(a))
}
}, t
}
}, function(e, t, A) {
var o = {},
n = function(e) {
var t;
return function() {
return void 0 === t && (t = e.apply(this, arguments)), t
}
}(function() {
return window && document && document.all && !window.atob
}),
i = function(e) {
var t = {};
return function(e, A) {
if ("function" == typeof e) return e();
if (void 0 === t[e]) {
var o = function(e, t) {
return t ? t.querySelector(e) : document.querySelector(e)
}.call(this, e, A);
if (window.HTMLIFrameElement && o instanceof window.HTMLIFrameElement) try {
o = o.contentDocument.head
} catch (e) {
o = null
}
t[e] = o
}
return t[e]
}
}(),
a = null,
r = 0,
s = [],
l = A(1145);
function u(e, t) {
for (var A = 0; A < e.length; A++) {
var n = e[A],
i = o[n.id];
if (i) {
i.refs++;
for (var a = 0; a < i.parts.length; a++) i.parts[a](n.parts[a]);
for (; a < n.parts.length; a++) i.parts.push(p(n.parts[a], t))
} else {
var r = [];
for (a = 0; a < n.parts.length; a++) r.push(p(n.parts[a], t));
o[n.id] = {
id: n.id,
refs: 1,
parts: r
}
}
}
}
function c(e, t) {
for (var A = [], o = {}, n = 0; n < e.length; n++) {
var i = e[n],
a = t.base ? i[0] + t.base : i[0],
r = {
css: i[1],
media: i[2],
sourceMap: i[3]
};
o[a] ? o[a].parts.push(r) : A.push(o[a] = {
id: a,
parts: [r]
})
}
return A
}
function g(e, t) {
var A = i(e.insertInto);
if (!A) throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
var o = s[s.length - 1];
if ("top" === e.insertAt) o ? o.nextSibling ? A.insertBefore(t, o.nextSibling) : A.appendChild(t) : A.insertBefore(t, A.firstChild), s.push(t);
else if ("bottom" === e.insertAt) A.appendChild(t);
else {
if ("object" != typeof e.insertAt || !e.insertAt.before) throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");
var n = i(e.insertAt.before, A);
A.insertBefore(t, n)
}
}
function d(e) {
if (null === e.parentNode) return !1;
e.parentNode.removeChild(e);
var t = s.indexOf(e);
t >= 0 && s.splice(t, 1)
}
function h(e) {
var t = document.createElement("style");
if (void 0 === e.attrs.type && (e.attrs.type = "text/css"), void 0 === e.attrs.nonce) {
var o = function() {
0;
return A.nc
}();
o && (e.attrs.nonce = o)
}
return m(t, e.attrs), g(e, t), t
}
function m(e, t) {
Object.keys(t).forEach(function(A) {
e.setAttribute(A, t[A])
})
}
function p(e, t) {
var A, o, n, i;
if (t.transform && e.css) {
if (!(i = "function" == typeof t.transform ? t.transform(e.css) : t.transform.default(e.css))) return function() {};
e.css = i
}
if (t.singleton) {
var s = r++;
A = a || (a = h(t)), o = B.bind(null, A, s, !1), n = B.bind(null, A, s, !0)
} else e.sourceMap && "function" == typeof URL && "function" == typeof URL.createObjectURL && "function" == typeof URL.revokeObjectURL && "function" == typeof Blob && "function" == typeof btoa ? (A = function(e) {
var t = document.createElement("link");
return void 0 === e.attrs.type && (e.attrs.type = "text/css"), e.attrs.rel = "stylesheet", m(t, e.attrs), g(e, t), t
}(t), o = function(e, t, A) {
var o = A.css,
n = A.sourceMap,
i = void 0 === t.convertToAbsoluteUrls && n;
(t.convertToAbsoluteUrls || i) && (o = l(o));
n && (o += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(n)))) + " */");
var a = new Blob([o], {
type: "text/css"
}),
r = e.href;
e.href = URL.createObjectURL(a), r && URL.revokeObjectURL(r)
}.bind(null, A, t), n = function() {
d(A), A.href && URL.revokeObjectURL(A.href)
}) : (A = h(t), o = function(e, t) {
var A = t.css,
o = t.media;
o && e.setAttribute("media", o);
if (e.styleSheet) e.styleSheet.cssText = A;
else {
for (; e.firstChild;) e.removeChild(e.firstChild);
e.appendChild(document.createTextNode(A))
}
}.bind(null, A), n = function() {
d(A)
});
return o(e),
function(t) {
if (t) {
if (t.css === e.css && t.media === e.media && t.sourceMap === e.sourceMap) return;
o(e = t)
} else n()
}
}
e.exports = function(e, t) {
if ("undefined" != typeof DEBUG && DEBUG && "object" != typeof document) throw new Error("The style-loader cannot be used in a non-browser environment");
(t = t || {}).attrs = "object" == typeof t.attrs ? t.attrs : {}, t.singleton || "boolean" == typeof t.singleton || (t.singleton = n()), t.insertInto || (t.insertInto = "head"), t.insertAt || (t.insertAt = "bottom");
var A = c(e, t);
return u(A, t),
function(e) {
for (var n = [], i = 0; i < A.length; i++) {
var a = A[i];
(r = o[a.id]).refs--, n.push(r)
}
e && u(c(e, t), t);
for (i = 0; i < n.length; i++) {
var r;
if (0 === (r = n[i]).refs) {
for (var s = 0; s < r.parts.length; s++) r.parts[s]();
delete o[r.id]
}
}
}
};
var E = function() {
var e = [];
return function(t, A) {
return e[t] = A, e.filter(Boolean).join("\n")
}
}();
function B(e, t, A, o) {
var n = A ? "" : o.css;
if (e.styleSheet) e.styleSheet.cssText = E(t, n);
else {
var i = document.createTextNode(n),
a = e.childNodes;
a[t] && e.removeChild(a[t]), a.length ? e.insertBefore(i, a[t]) : e.appendChild(i)
}
}
}, function(e, t, A) {
var o = A(1376);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
var o = A(867);
e.exports = o
}, function(e, t, A) {
e.exports = A(858)
}, function(e, t, A) {
"use strict";
(function(t) {
e.exports = function(e) {
for (var A = "undefined" != typeof window && "function" == typeof window.atob ? window.atob(e) : t.from(e, "base64").toString("binary"), o = new Uint8Array(A.length), n = 0; n < A.length; ++n) o[n] = A.charCodeAt(n);
return o.buffer
}
}).call(this, A(64).Buffer)
}, function(e, t, A) {
var o;
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
! function() {
"use strict";
var A = {}.hasOwnProperty;
function n() {
for (var e = [], t = 0; t < arguments.length; t++) {
var o = arguments[t];
if (o) {
var i = typeof o;
if ("string" === i || "number" === i) e.push(o);
else if (Array.isArray(o)) e.push(n.apply(null, o));
else if ("object" === i)
for (var a in o) A.call(o, a) && o[a] && e.push(a)
}
}
return e.join(" ")
}
e.exports ? e.exports = n : void 0 === (o = function() {
return n
}.apply(t, [])) || (e.exports = o)
}()
}, function(e, t, A) {
"use strict";
A.d(t, "d", function() {
return M
}), A.d(t, "A", function() {
return b
}), A.d(t, "a", function() {
return s
}), A.d(t, "b", function() {
return F
}), A.d(t, "c", function() {
return T
}), A.d(t, "e", function() {
return a
}), A.d(t, "f", function() {
return S
}), A.d(t, "g", function() {
return k
}), A.d(t, "h", function() {
return m
}), A.d(t, "i", function() {
return p
}), A.d(t, "j", function() {
return h
}), A.d(t, "k", function() {
return y
}), A.d(t, "l", function() {
return u
}), A.d(t, "m", function() {
return l
}), A.d(t, "n", function() {
return g
}), A.d(t, "p", function() {
return c
}), A.d(t, "o", function() {
return d
}), A.d(t, "q", function() {
return E
}), A.d(t, "r", function() {
return B
}), A.d(t, "s", function() {
return C
}), A.d(t, "t", function() {
return w
}), A.d(t, "u", function() {
return I
}), A.d(t, "v", function() {
return f
}), A.d(t, "w", function() {
return Y
}), A.d(t, "x", function() {
return Q
}), A.d(t, "y", function() {
return D
}), A.d(t, "z", function() {
return N
}), A.d(t, "B", function() {
return L
}), A.d(t, "C", function() {
return O
}), A.d(t, "D", function() {
return R
}), A.d(t, "E", function() {
return U
}), A.d(t, "F", function() {
return v
});
var o = A(46),
n = "scratch-gui/project-state/DONE_LOADING_VM_WITHOUT_ID",
i = "scratch-gui/project-state/START_ERROR",
a = "0",
r = A.n(o)()({
NOT_LOADED: null,
ERROR: null,
AUTO_UPDATING: null,
CREATING_COPY: null,
CREATING_NEW: null,
FETCHING_NEW_DEFAULT: null,
FETCHING_WITH_ID: null,
LOADING_VM_FILE_UPLOAD: null,
LOADING_VM_NEW_DEFAULT: null,
LOADING_VM_WITH_ID: null,
MANUAL_UPDATING: null,
REMIXING: null,
SHOWING_WITH_ID: null,
SHOWING_WITHOUT_ID: null,
UPDATING_BEFORE_COPY: null,
UPDATING_BEFORE_FILE_UPLOAD: null,
UPDATING_BEFORE_NEW: null
}),
s = Object.keys(r),
l = function(e) {
return e === r.LOADING_VM_FILE_UPLOAD || e === r.FETCHING_NEW_DEFAULT
},
u = function(e) {
return e === r.FETCHING_WITH_ID || e === r.FETCHING_NEW_DEFAULT
},
c = function(e) {
return e === r.LOADING_VM_WITH_ID || e === r.LOADING_VM_NEW_DEFAULT
},
g = function(e) {
return e === r.LOADING_VM_FILE_UPLOAD || e === r.LOADING_VM_WITH_ID || e === r.LOADING_VM_NEW_DEFAULT
},
d = function(e) {
return e === r.LOADING_VM_FILE_UPLOAD
},
h = function(e) {
return e === r.CREATING_NEW
},
m = function(e) {
return e === r.FETCHING_NEW_DEFAULT || e === r.LOADING_VM_NEW_DEFAULT || e === r.CREATING_NEW
},
p = function(e) {
return e === r.CREATING_COPY
},
E = function(e) {
return e === r.MANUAL_UPDATING
},
B = function(e) {
return e === r.REMIXING
},
f = function(e) {
return e === r.AUTO_UPDATING || e === r.MANUAL_UPDATING || e === r.UPDATING_BEFORE_COPY || e === r.UPDATING_BEFORE_FILE_UPLOAD || e === r.UPDATING_BEFORE_NEW
},
C = function(e) {
return e === r.SHOWING_WITH_ID || e === r.SHOWING_WITHOUT_ID
},
w = function(e) {
return e === r.SHOWING_WITH_ID
},
I = function(e) {
return e === r.SHOWING_WITHOUT_ID
},
y = function(e) {
return e === r.ERROR
},
b = {
error: null,
projectData: null,
projectId: null,
loadingState: r.NOT_LOADED
},
M = function(e, t) {
switch (void 0 === e && (e = b), t.type) {
case "scratch-gui/project-state/DONE_CREATING_NEW":
return e.loadingState === r.CREATING_NEW ? Object.assign({}, e, {
loadingState: r.SHOWING_WITH_ID,
projectId: t.projectId
}) : e;
case "scratch-gui/project-state/DONE_FETCHING_WITH_ID":
return e.loadingState === r.FETCHING_WITH_ID ? Object.assign({}, e, {
loadingState: r.LOADING_VM_WITH_ID,
projectData: t.projectData
}) : e;
case "scratch-gui/project-state/DONE_FETCHING_DEFAULT":
return e.loadingState === r.FETCHING_NEW_DEFAULT ? Object.assign({}, e, {
loadingState: r.LOADING_VM_NEW_DEFAULT,
projectData: t.projectData
}) : e;
case n:
return e.loadingState === r.LOADING_VM_FILE_UPLOAD || e.loadingState === r.LOADING_VM_NEW_DEFAULT ? Object.assign({}, e, {
loadingState: r.SHOWING_WITHOUT_ID,
projectId: a
}) : e;
case "scratch-gui/project-state/DONE_LOADING_VM_WITH_ID":
return e.loadingState === r.LOADING_VM_WITH_ID ? Object.assign({}, e, {
loadingState: r.SHOWING_WITH_ID
}) : e;
case "scratch-gui/project-state/DONE_LOADING_VM_TO_SAVE":
return e.loadingState === r.LOADING_VM_FILE_UPLOAD ? Object.assign({}, e, {
loadingState: r.AUTO_UPDATING
}) : e;
case "scratch-gui/project-state/DONE_REMIXING":
return e.loadingState === r.REMIXING ? Object.assign({}, e, {
loadingState: r.SHOWING_WITH_ID,
projectId: t.projectId
}) : e;
case "scratch-gui/project-state/DONE_CREATING_COPY":
return e.loadingState === r.CREATING_COPY ? Object.assign({}, e, {
loadingState: r.SHOWING_WITH_ID,
projectId: t.projectId
}) : e;
case "scratch-gui/project-state/DONE_UPDATING":
return e.loadingState === r.AUTO_UPDATING || e.loadingState === r.MANUAL_UPDATING ? Object.assign({}, e, {
loadingState: r.SHOWING_WITH_ID
}) : e;
case "scratch-gui/project-state/DONE_UPDATING_BEFORE_COPY":
return e.loadingState === r.UPDATING_BEFORE_COPY ? Object.assign({}, e, {
loadingState: r.CREATING_COPY
}) : e;
case "scratch-gui/project-state/DONE_UPDATING_BEFORE_FILE_UPLOAD":
return e.loadingState === r.UPDATING_BEFORE_FILE_UPLOAD ? Object.assign({}, e, {
loadingState: r.LOADING_VM_FILE_UPLOAD
}) : e;
case "scratch-gui/project-state/DONE_UPDATING_BEFORE_NEW":
return e.loadingState === r.UPDATING_BEFORE_NEW ? Object.assign({}, e, {
loadingState: r.FETCHING_NEW_DEFAULT,
projectId: a
}) : e;
case "scratch-gui/project-state/RETURN_TO_SHOWING":
return null === e.projectId || e.projectId === a ? Object.assign({}, e, {
loadingState: r.SHOWING_WITHOUT_ID,
projectId: a
}) : Object.assign({}, e, {
loadingState: r.SHOWING_WITH_ID
});
case "scratch-gui/project-state/SET_PROJECT_ID":
return e.projectId === t.projectId ? e : e.loadingState === r.SHOWING_WITH_ID ? t.projectId === a || null === t.projectId ? Object.assign({}, e, {
loadingState: r.FETCHING_NEW_DEFAULT,
projectId: a
}) : Object.assign({}, e, {
loadingState: r.FETCHING_WITH_ID,
projectId: t.projectId
}) : e.loadingState !== r.SHOWING_WITHOUT_ID ? t.projectId === a || null === t.projectId ? Object.assign({}, e, {
loadingState: r.FETCHING_NEW_DEFAULT,
projectId: a
}) : Object.assign({}, e, {
loadingState: r.FETCHING_WITH_ID,
projectId: t.projectId
}) : t.projectId !== a && null !== t.projectId ? Object.assign({}, e, {
loadingState: r.FETCHING_WITH_ID,
projectId: t.projectId
}) : e;
case "scratch-gui/project-state/START_AUTO_UPDATING":
return e.loadingState === r.SHOWING_WITH_ID ? Object.assign({}, e, {
loadingState: r.AUTO_UPDATING
}) : e;
case "scratch-gui/project-state/START_CREATING_NEW":
return e.loadingState === r.SHOWING_WITHOUT_ID ? Object.assign({}, e, {
loadingState: r.CREATING_NEW
}) : e;
case "scratch-gui/project-state/START_FETCHING_NEW":
return [r.SHOWING_WITH_ID, r.SHOWING_WITHOUT_ID].includes(e.loadingState) ? Object.assign({}, e, {
loadingState: r.FETCHING_NEW_DEFAULT,
projectId: a
}) : e;
case "scratch-gui/project-state/START_LOADING_FILE_UPLOAD":
return [r.NOT_LOADED, r.SHOWING_WITH_ID, r.SHOWING_WITHOUT_ID].includes(e.loadingState) ? Object.assign({}, e, {
loadingState: r.LOADING_VM_FILE_UPLOAD
}) : e;
case "scratch-gui/project-state/START_MANUAL_UPDATING":
return e.loadingState === r.SHOWING_WITH_ID ? Object.assign({}, e, {
loadingState: r.MANUAL_UPDATING
}) : e;
case "scratch-gui/project-state/START_REMIXING":
return e.loadingState === r.SHOWING_WITH_ID ? Object.assign({}, e, {
loadingState: r.REMIXING
}) : e;
case "scratch-gui/project-state/START_UPDATING_BEFORE_CREATING_COPY":
return e.loadingState === r.SHOWING_WITH_ID ? Object.assign({}, e, {
loadingState: r.UPDATING_BEFORE_COPY
}) : e;
case "scratch-gui/project-state/START_UPDATING_BEFORE_CREATING_NEW":
return e.loadingState === r.SHOWING_WITH_ID ? Object.assign({}, e, {
loadingState: r.UPDATING_BEFORE_NEW
}) : e;
case "scratch-gui/project-state/START_UPDATING_BEFORE_FILE_UPLOAD":
return e.loadingState === r.SHOWING_WITH_ID ? Object.assign({}, e, {
loadingState: r.UPDATING_BEFORE_FILE_UPLOAD
}) : e;
case i:
return [r.FETCHING_NEW_DEFAULT, r.FETCHING_WITH_ID, r.LOADING_VM_NEW_DEFAULT, r.LOADING_VM_WITH_ID].includes(e.loadingState) ? Object.assign({}, e, {
loadingState: r.ERROR,
error: t.error
}) : [r.AUTO_UPDATING, r.CREATING_COPY, r.MANUAL_UPDATING, r.REMIXING, r.UPDATING_BEFORE_COPY, r.UPDATING_BEFORE_FILE_UPLOAD, r.UPDATING_BEFORE_NEW].includes(e.loadingState) ? Object.assign({}, e, {
loadingState: r.SHOWING_WITH_ID,
error: t.error
}) : e.loadingState === r.CREATING_NEW ? e.projectId === a || null === e.projectId ? Object.assign({}, e, {
loadingState: r.SHOWING_WITHOUT_ID,
error: t.error
}) : Object.assign({}, e, {
loadingState: r.SHOWING_WITH_ID,
error: t.error
}) : e;
default:
return e
}
},
T = function() {
return {
type: "scratch-gui/project-state/START_CREATING_NEW"
}
},
S = function(e, t) {
switch (t) {
case r.CREATING_NEW:
return {
type: "scratch-gui/project-state/DONE_CREATING_NEW",
projectId: e
};
case r.CREATING_COPY:
return {
type: "scratch-gui/project-state/DONE_CREATING_COPY",
projectId: e
};
case r.REMIXING:
return {
type: "scratch-gui/project-state/DONE_REMIXING",
projectId: e
}
}
},
Q = function(e, t) {
switch (t) {
case r.FETCHING_WITH_ID:
return {
type: "scratch-gui/project-state/DONE_FETCHING_WITH_ID",
projectData: e
};
case r.FETCHING_NEW_DEFAULT:
return {
type: "scratch-gui/project-state/DONE_FETCHING_DEFAULT",
projectData: e
}
}
},
D = function(e, t, A) {
if (A) switch (e) {
case r.LOADING_VM_WITH_ID:
return {
type: "scratch-gui/project-state/DONE_LOADING_VM_WITH_ID"
};
case r.LOADING_VM_FILE_UPLOAD:
return t ? {
type: "scratch-gui/project-state/DONE_LOADING_VM_TO_SAVE"
} : {
type: n
};
case r.LOADING_VM_NEW_DEFAULT:
return {
type: n
};
default:
return
}
return {
type: "scratch-gui/project-state/RETURN_TO_SHOWING"
}
},
k = function(e) {
switch (e) {
case r.AUTO_UPDATING:
case r.MANUAL_UPDATING:
return {
type: "scratch-gui/project-state/DONE_UPDATING"
};
case r.UPDATING_BEFORE_COPY:
return {
type: "scratch-gui/project-state/DONE_UPDATING_BEFORE_COPY"
};
case r.UPDATING_BEFORE_FILE_UPLOAD:
return {
type: "scratch-gui/project-state/DONE_UPDATING_BEFORE_FILE_UPLOAD"
};
case r.UPDATING_BEFORE_NEW:
return {
type: "scratch-gui/project-state/DONE_UPDATING_BEFORE_NEW"
}
}
},
N = function(e) {
return {
type: i,
error: e
}
},
v = function(e) {
return {
type: "scratch-gui/project-state/SET_PROJECT_ID",
projectId: e
}
},
O = function(e) {
return e ? {
type: "scratch-gui/project-state/START_UPDATING_BEFORE_CREATING_NEW"
} : {
type: "scratch-gui/project-state/START_FETCHING_NEW"
}
},
R = function(e) {
switch (e) {
case r.SHOWING_WITH_ID:
return {
type: "scratch-gui/project-state/START_UPDATING_BEFORE_FILE_UPLOAD"
};
case r.NOT_LOADED:
case r.SHOWING_WITHOUT_ID:
return {
type: "scratch-gui/project-state/START_LOADING_FILE_UPLOAD"
}
}
},
F = function() {
return {
type: "scratch-gui/project-state/START_AUTO_UPDATING"
}
},
Y = function() {
return {
type: "scratch-gui/project-state/START_MANUAL_UPDATING"
}
},
U = function() {
return {
type: "scratch-gui/project-state/START_UPDATING_BEFORE_CREATING_COPY"
}
},
L = function() {
return {
type: "scratch-gui/project-state/START_REMIXING"
}
}
}, function(e, t, A) {
"use strict";
t.a = {
SOUND: "SOUND",
COSTUME: "COSTUME",
SPRITE: "SPRITE",
CODE: "CODE",
BACKPACK_SOUND: "BACKPACK_SOUND",
BACKPACK_COSTUME: "BACKPACK_COSTUME",
BACKPACK_SPRITE: "BACKPACK_SPRITE",
BACKPACK_CODE: "BACKPACK_CODE"
}
}, function(e, t, A) {
var o = A(1170);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
"use strict";
t.__esModule = !0;
var o = function(e) {
return e && e.__esModule ? e : {
default: e
}
}(A(271));
t.default = o.default || function(e) {
for (var t = 1; t < arguments.length; t++) {
var A = arguments[t];
for (var o in A) Object.prototype.hasOwnProperty.call(A, o) && (e[o] = A[o])
}
return e
}
}, function(e, t, A) {
"use strict";
var o;
function n(e, t, A) {
return t in e ? Object.defineProperty(e, t, {
value: A,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = A, e
}
A.d(t, "l", function() {
return a
}), A.d(t, "m", function() {
return i
}), A.d(t, "n", function() {
return l
}), A.d(t, "o", function() {
return u
}), A.d(t, "q", function() {
return c
}), A.d(t, "r", function() {
return g
}), A.d(t, "s", function() {
return d
}), A.d(t, "t", function() {
return h
}), A.d(t, "v", function() {
return m
}), A.d(t, "u", function() {
return p
}), A.d(t, "w", function() {
return B
}), A.d(t, "p", function() {
return E
}), A.d(t, "a", function() {
return f
}), A.d(t, "b", function() {
return C
}), A.d(t, "d", function() {
return w
}), A.d(t, "e", function() {
return I
}), A.d(t, "f", function() {
return y
}), A.d(t, "i", function() {
return M
}), A.d(t, "g", function() {
return T
}), A.d(t, "h", function() {
return S
}), A.d(t, "j", function() {
return b
}), A.d(t, "k", function() {
return Q
}), A.d(t, "c", function() {
return D
});
var i = (n(o = {}, "backdropLibrary", !1), n(o, "cameraCapture", !1), n(o, "costumeLibrary", !1), n(o, "extensionLibrary", !1), n(o, "loadingProject", !1), n(o, "telemetryModal", !1), n(o, "soundLibrary", !1), n(o, "spriteLibrary", !1), n(o, "soundRecorder", !1), n(o, "connectionModal", !1), n(o, "tipsLibrary", !1), o),
a = function(e, t) {
switch (void 0 === e && (e = i), t.type) {
case "scratch-gui/modals/OPEN_MODAL":
return Object.assign({}, e, n({}, t.modal, !0));
case "scratch-gui/modals/CLOSE_MODAL":
return Object.assign({}, e, n({}, t.modal, !1));
default:
return e
}
},
r = function(e) {
return {
type: "scratch-gui/modals/OPEN_MODAL",
modal: e
}
},
s = function(e) {
return {
type: "scratch-gui/modals/CLOSE_MODAL",
modal: e
}
},
l = function() {
return r("backdropLibrary")
},
u = function() {
return r("cameraCapture")
},
c = function() {
return r("costumeLibrary")
},
g = function() {
return r("extensionLibrary")
},
d = function() {
return r("loadingProject")
},
h = function() {
return r("soundLibrary")
},
m = function() {
return r("spriteLibrary")
},
p = function() {
return r("soundRecorder")
},
E = function() {
return r("connectionModal")
},
B = function() {
return r("tipsLibrary")
},
f = function() {
return s("backdropLibrary")
},
C = function() {
return s("cameraCapture")
},
w = function() {
return s("costumeLibrary")
},
I = function() {
return s("extensionLibrary")
},
y = function() {
return s("loadingProject")
},
b = function() {
return s("telemetryModal")
},
M = function() {
return s("spriteLibrary")
},
T = function() {
return s("soundLibrary")
},
S = function() {
return s("soundRecorder")
},
Q = function() {
return s("tipsLibrary")
},
D = function() {
return s("connectionModal")
}
}, function(e, t, A) {
"use strict";
t.__esModule = !0, t.default = function(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
}, function(e, t, A) {
"use strict";
A.d(t, "a", function() {
return r
}), A.d(t, "b", function() {
return a
}), A.d(t, "c", function() {
return i
});
var o = A(46),
n = A.n(o),
i = n()({
large: null,
small: null
}),
a = n()({
large: null,
largeConstrained: null,
small: null
}),
r = {};
r[a.large] = 1, r[a.largeConstrained] = .85, r[a.small] = .5, t.d = {
standardStageWidth: 480,
standardStageHeight: 360,
fullSizeMinWidth: 1096,
fullSizePaintMinWidth: 1250
}
}, function(e, t, A) {
"use strict";
t.__esModule = !0;
var o = function(e) {
return e && e.__esModule ? e : {
default: e
}
}(A(471));
t.default = function() {
function e(e, t) {
for (var A = 0; A < t.length; A++) {
var n = t[A];
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), (0, o.default)(e, n.key, n)
}
}
return function(t, A, o) {
return A && e(t.prototype, A), o && e(t, o), t
}
}()
}, function(e, t, A) {
var o = A(1272);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
"use strict";
var o = A(71),
n = A.n(o);
n.a.enable(), t.a = n()("gui")
}, function(e, t, A) {
"use strict";
t.__esModule = !0;
var o = function(e) {
return e && e.__esModule ? e : {
default: e
}
}(A(472));
t.default = function(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== (void 0 === t ? "undefined" : (0, o.default)(t)) && "function" != typeof t ? e : t
}
}, function(e, t, A) {
var o = A(1297);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
var o = A(1179);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
"use strict";
A.d(t, "d", function() {
return s
}), A.d(t, "a", function() {
return i
}), A.d(t, "b", function() {
return l
}), A.d(t, "c", function() {
return u
}), A.d(t, "e", function() {
return r
}), A.d(t, "f", function() {
return a
}), A.d(t, "g", function() {
return d
}), A.d(t, "h", function() {
return g
}), A.d(t, "i", function() {
return c
});
var o = A(58),
n = A(124),
i = {
visible: !0,
alertsList: []
},
a = function(e) {
return e.filter(function(e) {
return e.alertType === o.b.STANDARD || e.alertType === o.b.EXTENSION
})
},
r = function(e) {
return e.filter(function(e) {
return e.alertType === o.b.INLINE
})
},
s = function(e, t) {
switch (void 0 === e && (e = i), t.type) {
case "scratch-gui/alerts/SHOW_ALERT":
var A = t.alertId;
if (A) {
var a = {
alertId: A,
level: o.a.WARN
},
r = o.c.find(function(e) {
return e.alertId === A
});
if (r) {
var s = e.alertsList.filter(function(e) {
return !r.clearList || -1 === r.clearList.indexOf(e.alertId)
});
return t.data && t.data.message && (a.message = t.data.message), a.alertType = r.alertType || o.b.STANDARD, a.closeButton = r.closeButton, a.content = r.content, a.iconURL = r.iconURL, a.iconSpinner = r.iconSpinner, a.level = r.level, a.showDownload = r.showDownload, a.showSaveNow = r.showSaveNow, s.push(a), Object.assign({}, e, {
alertsList: s
})
}
}
return e;
case "scratch-gui/alerts/SHOW_EXTENSION_ALERT":
var l = t.data.extensionId;
if (l) {
var u = n.a.find(function(e) {
return e.extensionId === l
});
if (u) {
var c = e.alertsList.slice(),
g = {
alertType: o.b.EXTENSION,
closeButton: !0,
extensionId: l,
extensionName: u.name,
iconURL: u.smallPeripheralImage,
level: o.a.WARN,
showReconnect: !0
};
return c.push(g), Object.assign({}, e, {
alertsList: c
})
}
}
return e;
case "scratch-gui/alerts/CLOSE_ALERT_WITH_ID":
case "scratch-gui/alerts/CLOSE_ALERT":
if (t.alertId && (t.index = e.alertsList.findIndex(function(e) {
return e.alertId === t.alertId
}), -1 === t.index)) return e;
var d = e.alertsList.slice();
return d.splice(t.index, 1), Object.assign({}, e, {
alertsList: d
});
case "scratch-gui/alerts/CLOSE_ALERTS_WITH_ID":
return Object.assign({}, e, {
alertsList: e.alertsList.filter(function(e) {
return e.alertId !== t.alertId
})
});
default:
return e
}
},
l = function(e) {
return {
type: "scratch-gui/alerts/CLOSE_ALERT",
index: e
}
},
u = function(e) {
return {
type: "scratch-gui/alerts/CLOSE_ALERT_WITH_ID",
alertId: e
}
},
c = function(e) {
return {
type: "scratch-gui/alerts/SHOW_ALERT",
alertId: e
}
},
g = function(e) {
return {
type: "scratch-gui/alerts/SHOW_EXTENSION_ALERT",
data: e
}
},
d = function(e, t) {
var A = o.c.find(function(e) {
return e.alertId === t
});
A && (e(c(t)), A.maxDisplaySecs && setTimeout(function() {
e(function(e) {
return {
type: "scratch-gui/alerts/CLOSE_ALERTS_WITH_ID",
alertId: e
}
}(t))
}, 1e3 * A.maxDisplaySecs))
}
}, function(e, t, A) {
var o = A(1177);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
var o = A(1381);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
"use strict";
A.d(t, "e", function() {
return r
}), A.d(t, "f", function() {
return a
}), A.d(t, "d", function() {
return s
}), A.d(t, "a", function() {
return o
}), A.d(t, "b", function() {
return n
}), A.d(t, "c", function() {
return i
});
var o = 0,
n = 1,
i = 2,
a = {
activeTabIndex: o
},
r = function(e, t) {
switch (void 0 === e && (e = a), t.type) {
case "scratch-gui/navigation/ACTIVATE_TAB":
return Object.assign({}, e, {
activeTabIndex: t.activeTabIndex
});
default:
return e
}
},
s = function(e) {
return {
type: "scratch-gui/navigation/ACTIVATE_TAB",
activeTabIndex: e
}
}
}, function(e, t, A) {
var o = A(1280);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
e.exports = {
default: A(1298),
__esModule: !0
}
}, function(e, t, A) {
"use strict";
t.__esModule = !0;
var o = a(A(1321)),
n = a(A(1325)),
i = a(A(472));
function a(e) {
return e && e.__esModule ? e : {
default: e
}
}
t.default = function(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (void 0 === t ? "undefined" : (0, i.default)(t)));
e.prototype = (0, n.default)(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (o.default ? (0, o.default)(e, t) : e.__proto__ = t)
}
}, function(e, t, A) {
"use strict";
var o = A(351),
n = A.n(o);
n.a.initialize("UA-30688952-6", {
debug: !1,
titleCase: !0,
sampleRate: 100,
forceSSL: !0
}), t.a = n.a
}, function(e, t, A) {
"use strict";
var o = A(580),
n = A.n(o),
i = A(2),
a = A(68);
function r(e, t, A) {
return t in e ? Object.defineProperty(e, t, {
value: A,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = A, e
}
var s = Object(i.d)({
meow: {
id: "gui.defaultProject.meow",
defaultMessage: "Meow"
},
variable: {
id: "gui.defaultProject.variable",
defaultMessage: "my variable"
}
});
s = function(e) {
for (var t = 1; t < arguments.length; t++) {
var A = null != arguments[t] ? arguments[t] : {},
o = Object.keys(A);
"function" == typeof Object.getOwnPropertySymbols && (o = o.concat(Object.getOwnPropertySymbols(A).filter(function(e) {
return Object.getOwnPropertyDescriptor(A, e).enumerable
}))), o.forEach(function(t) {
r(e, t, A[t])
})
}
return e
}({}, s, a.a);
var l = function(e) {
return e.defaultMessage
},
u = function(e) {
var t = e || l;
return {
targets: [{
isStage: !0,
name: "Stage",
variables: {
"`jEk@4|i[#Fk?(8x)AV.-my variable": [t(s.variable), 0]
},
lists: {},
broadcasts: {},
blocks: {},
currentCostume: 0,
costumes: [{
assetId: "cd21514d0531fdffb22204e0ec5ed84a",
name: t(s.backdrop, {
index: 1
}),
md5ext: "cd21514d0531fdffb22204e0ec5ed84a.svg",
dataFormat: "svg",
rotationCenterX: 240,
rotationCenterY: 180
}],
sounds: [{
assetId: "83a9787d4cb6f3b7632b4ddfebf74367",
name: t(s.pop),
dataFormat: "wav",
format: "",
rate: 11025,
sampleCount: 258,
md5ext: "83a9787d4cb6f3b7632b4ddfebf74367.wav"
}],
volume: 100
}, {
isStage: !1,
name: t(s.sprite, {
index: 1
}),
variables: {},
lists: {},
broadcasts: {},
blocks: {},
currentCostume: 0,
costumes: [{
assetId: "b7853f557e4426412e64bb3da6531a99",
name: t(s.costume, {
index: 1
}),
bitmapResolution: 1,
md5ext: "b7853f557e4426412e64bb3da6531a99.svg",
dataFormat: "svg",
rotationCenterX: 48,
rotationCenterY: 50
}, {
assetId: "e6ddc55a6ddd9cc9d84fe0b4c21e016f",
name: t(s.costume, {
index: 2
}),
bitmapResolution: 1,
md5ext: "e6ddc55a6ddd9cc9d84fe0b4c21e016f.svg",
dataFormat: "svg",
rotationCenterX: 46,
rotationCenterY: 53
}],
sounds: [{
assetId: "83c36d806dc92327b9e7049a565c6bff",
name: t(s.meow),
dataFormat: "wav",
format: "",
rate: 22050,
sampleCount: 18688,
md5ext: "83c36d806dc92327b9e7049a565c6bff.wav"
}],
volume: 100,
visible: !0,
x: 0,
y: 0,
size: 100,
direction: 90,
draggable: !1,
rotationStyle: "all around"
}],
meta: {
semver: "3.0.0",
vm: "0.1.0",
agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"
}
}
},
c = A(581),
g = A.n(c),
d = A(582),
h = A.n(d),
m = A(583),
p = A.n(m),
E = A(584),
B = A.n(E),
f = A(585),
C = A.n(f),
w = function(e) {
var t = new("undefined" == typeof TextEncoder ? A(193).TextEncoder : TextEncoder),
o = u(e);
return [{
id: 0,
assetType: "Project",
dataFormat: "JSON",
data: JSON.stringify(o)
}, {
id: "83a9787d4cb6f3b7632b4ddfebf74367",
assetType: "Sound",
dataFormat: "WAV",
data: new Uint8Array(g.a)
}, {
id: "83c36d806dc92327b9e7049a565c6bff",
assetType: "Sound",
dataFormat: "WAV",
data: new Uint8Array(h.a)
}, {
id: "cd21514d0531fdffb22204e0ec5ed84a",
assetType: "ImageVector",
dataFormat: "SVG",
data: t.encode(p.a)
}, {
id: "09dc888b0b7df19f70d81588ae73420e",
assetType: "ImageVector",
dataFormat: "SVG",
data: t.encode(B.a)
}, {
id: "3696356a03a8d938318876a593572843",
assetType: "ImageVector",
dataFormat: "SVG",
data: t.encode(C.a)
}]
};
function I(e) {
return (I = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
})(e)
}
function y(e, t) {
for (var A = 0; A < t.length; A++) {
var o = t[A];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o)
}
}
function b(e, t) {
return !t || "object" !== I(t) && "function" != typeof t ? function(e) {
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}(e) : t
}
function M(e) {
return (M = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
return e.__proto__ || Object.getPrototypeOf(e)
})(e)
}
function T(e, t) {
return (T = Object.setPrototypeOf || function(e, t) {
return e.__proto__ = t, e
})(e, t)
}
var S = new(function(e) {
function t() {
var e;
return function(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, t), (e = b(this, M(t).call(this))).cacheDefaultProject(), e
}
return function(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
writable: !0,
configurable: !0
}
}), t && T(e, t)
}(t, n.a),
function(e, t, A) {
t && y(e.prototype, t), A && y(e, A)
}(t, [{
key: "addOfficialScratchWebStores",
value: function() {
this.addWebStore([this.AssetType.Project], this.getProjectGetConfig.bind(this), this.getProjectCreateConfig.bind(this), this.getProjectUpdateConfig.bind(this)), this.addWebStore([this.AssetType.ImageVector, this.AssetType.ImageBitmap, this.AssetType.Sound], this.getAssetGetConfig.bind(this), this.getAssetCreateConfig.bind(this), this.getAssetCreateConfig.bind(this)), this.addWebStore([this.AssetType.Sound], function(e) {
return "static/extension-assets/scratch3_music/".concat(e.assetId, ".").concat(e.dataFormat)
})
}
}, {
key: "setProjectHost",
value: function(e) {
this.projectHost = e
}
}, {
key: "getProjectGetConfig",
value: function(e) {
return "".concat(this.projectHost, "/").concat(e.assetId)
}
}, {
key: "getProjectCreateConfig",
value: function() {
return {
url: "".concat(this.projectHost, "/"),
withCredentials: !0
}
}
}, {
key: "getProjectUpdateConfig",
value: function(e) {
return {
url: "".concat(this.projectHost, "/").concat(e.assetId),
withCredentials: !0
}
}
}, {
key: "setAssetHost",
value: function(e) {
this.assetHost = e
}
}, {
key: "getAssetGetConfig",
value: function(e) {
return "".concat(this.assetHost, "/internalapi/asset/").concat(e.assetId, ".").concat(e.dataFormat, "/get/")
}
}, {
key: "getAssetCreateConfig",
value: function(e) {
return {
method: "post",
url: "".concat(this.assetHost, "/").concat(e.assetId, ".").concat(e.dataFormat),
withCredentials: !0
}
}
}, {
key: "setTranslatorFunction",
value: function(e) {
this.translator = e, this.cacheDefaultProject()
}
}, {
key: "cacheDefaultProject",
value: function() {
var e = this;
w(this.translator).forEach(function(t) {
return e.builtinHelper._store(e.AssetType[t.assetType], e.DataFormat[t.dataFormat], t.data, t.id)
})
}
}]), t
}());
t.a = S
}, function(e, t, A) {
var o = A(1240);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
var o = A(1282);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
var o = A(1278);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
var o = A(71);
o.enable(), e.exports = o("vm")
}, function(e, t, A) {
"use strict";
var o = A(115),
n = A(397),
i = A(226),
a = A(884),
r = A(186);
function s(e) {
return e
}
function l(e, t) {
for (var A = 0; A < e.length; ++A) t[A] = 255 & e.charCodeAt(A);
return t
}
t.newBlob = function(e, A) {
t.checkSupport("blob");
try {
return new Blob([e], {
type: A
})
} catch (t) {
try {
var o = new(self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder);
return o.append(e), o.getBlob(A)
} catch (e) {
throw new Error("Bug : can't construct the Blob.")
}
}
};
var u = {
stringifyByChunk: function(e, t, A) {
var o = [],
n = 0,
i = e.length;
if (i <= A) return String.fromCharCode.apply(null, e);
for (; n < i;) "array" === t || "nodebuffer" === t ? o.push(String.fromCharCode.apply(null, e.slice(n, Math.min(n + A, i)))) : o.push(String.fromCharCode.apply(null, e.subarray(n, Math.min(n + A, i)))), n += A;
return o.join("")
},
stringifyByChar: function(e) {
for (var t = "", A = 0; A < e.length; A++) t += String.fromCharCode(e[A]);
return t
},
applyCanBeUsed: {
uint8array: function() {
try {
return o.uint8array && 1 === String.fromCharCode.apply(null, new Uint8Array(1)).length
} catch (e) {
return !1
}
}(),
nodebuffer: function() {
try {
return o.nodebuffer && 1 === String.fromCharCode.apply(null, i.allocBuffer(1)).length
} catch (e) {
return !1
}
}()
}
};
function c(e) {
var A = 65536,
o = t.getTypeOf(e),
n = !0;
if ("uint8array" === o ? n = u.applyCanBeUsed.uint8array : "nodebuffer" === o && (n = u.applyCanBeUsed.nodebuffer), n)
for (; A > 1;) try {
return u.stringifyByChunk(e, o, A)
} catch (e) {
A = Math.floor(A / 2)
}
return u.stringifyByChar(e)
}
function g(e, t) {
for (var A = 0; A < e.length; A++) t[A] = e[A];
return t
}
t.applyFromCharCode = c;
var d = {};
d.string = {
string: s,
array: function(e) {
return l(e, new Array(e.length))
},
arraybuffer: function(e) {
return d.string.uint8array(e).buffer
},
uint8array: function(e) {
return l(e, new Uint8Array(e.length))
},
nodebuffer: function(e) {
return l(e, i.allocBuffer(e.length))
}
}, d.array = {
string: c,
array: s,
arraybuffer: function(e) {
return new Uint8Array(e).buffer
},
uint8array: function(e) {
return new Uint8Array(e)
},
nodebuffer: function(e) {
return i.newBufferFrom(e)
}
}, d.arraybuffer = {
string: function(e) {
return c(new Uint8Array(e))
},
array: function(e) {
return g(new Uint8Array(e), new Array(e.byteLength))
},
arraybuffer: s,
uint8array: function(e) {
return new Uint8Array(e)
},
nodebuffer: function(e) {
return i.newBufferFrom(new Uint8Array(e))
}
}, d.uint8array = {
string: c,
array: function(e) {
return g(e, new Array(e.length))
},
arraybuffer: function(e) {
return e.buffer
},
uint8array: s,
nodebuffer: function(e) {
return i.newBufferFrom(e)
}
}, d.nodebuffer = {
string: c,
array: function(e) {
return g(e, new Array(e.length))
},
arraybuffer: function(e) {
return d.nodebuffer.uint8array(e).buffer
},
uint8array: function(e) {
return g(e, new Uint8Array(e.length))
},
nodebuffer: s
}, t.transformTo = function(e, A) {
if (A || (A = ""), !e) return A;
t.checkSupport(e);
var o = t.getTypeOf(A);
return d[o][e](A)
}, t.getTypeOf = function(e) {
return "string" == typeof e ? "string" : "[object Array]" === Object.prototype.toString.call(e) ? "array" : o.nodebuffer && i.isBuffer(e) ? "nodebuffer" : o.uint8array && e instanceof Uint8Array ? "uint8array" : o.arraybuffer && e instanceof ArrayBuffer ? "arraybuffer" : void 0
}, t.checkSupport = function(e) {
if (!o[e.toLowerCase()]) throw new Error(e + " is not supported by this platform")
}, t.MAX_VALUE_16BITS = 65535, t.MAX_VALUE_32BITS = -1, t.pretty = function(e) {
var t, A, o = "";
for (A = 0; A < (e || "").length; A++) o += "\\x" + ((t = e.charCodeAt(A)) < 16 ? "0" : "") + t.toString(16).toUpperCase();
return o
}, t.delay = function(e, t, A) {
a(function() {
e.apply(A || null, t || [])
})
}, t.inherits = function(e, t) {
var A = function() {};
A.prototype = t.prototype, e.prototype = new A
}, t.extend = function() {
var e, t, A = {};
for (e = 0; e < arguments.length; e++)
for (t in arguments[e]) arguments[e].hasOwnProperty(t) && void 0 === A[t] && (A[t] = arguments[e][t]);
return A
}, t.prepareContent = function(e, A, i, a, s) {
return r.Promise.resolve(A).then(function(e) {
return o.blob && (e instanceof Blob || -1 !== ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(e))) && "undefined" != typeof FileReader ? new r.Promise(function(t, A) {
var o = new FileReader;
o.onload = function(e) {
t(e.target.result)
}, o.onerror = function(e) {
A(e.target.error)
}, o.readAsArrayBuffer(e)
}) : e
}).then(function(A) {
var u = t.getTypeOf(A);
return u ? ("arraybuffer" === u ? A = t.transformTo("uint8array", A) : "string" === u && (s ? A = n.decode(A) : i && !0 !== a && (A = function(e) {
return l(e, o.uint8array ? new Uint8Array(e.length) : new Array(e.length))
}(A))), A) : r.Promise.reject(new Error("Can't read the data of '" + e + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))
})
}
}, function(e, t, A) {
"use strict";
! function e() {
if ("undefined" != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE) try {
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)
} catch (e) {
console.error(e)
}
}(), e.exports = A(784)
}, function(e, t, A) {
"use strict";
var o;
function n(e, t, A) {
return t in e ? Object.defineProperty(e, t, {
value: A,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = A, e
}
A.d(t, "g", function() {
return a
}), A.d(t, "l", function() {
return i
}), A.d(t, "m", function() {
return l
}), A.d(t, "b", function() {
return u
}), A.d(t, "a", function() {
return c
}), A.d(t, "o", function() {
return g
}), A.d(t, "d", function() {
return d
}), A.d(t, "i", function() {
return h
}), A.d(t, "n", function() {
return m
}), A.d(t, "c", function() {
return p
}), A.d(t, "h", function() {
return E
}), A.d(t, "p", function() {
return B
}), A.d(t, "e", function() {
return f
}), A.d(t, "j", function() {
return C
}), A.d(t, "q", function() {
return w
}), A.d(t, "f", function() {
return I
}), A.d(t, "k", function() {
return y
});
var i = (n(o = {}, "accountMenu", !1), n(o, "fileMenu", !1), n(o, "editMenu", !1), n(o, "languageMenu", !1), n(o, "loginMenu", !1), o),
a = function(e, t) {
switch (void 0 === e && (e = i), t.type) {
case "scratch-gui/menus/OPEN_MENU":
return Object.assign({}, e, n({}, t.menu, !0));
case "scratch-gui/menus/CLOSE_MENU":
return Object.assign({}, e, n({}, t.menu, !1));
default:
return e
}
},
r = function(e) {
return {
type: "scratch-gui/menus/OPEN_MENU",
menu: e
}
},
s = function(e) {
return {
type: "scratch-gui/menus/CLOSE_MENU",
menu: e
}
},
l = function() {
return r("accountMenu")
},
u = function() {
return s("accountMenu")
},
c = function(e) {
return e.scratchGui.menus.accountMenu
},
g = function() {
return r("fileMenu")
},
d = function() {
return s("fileMenu")
},
h = function(e) {
return e.scratchGui.menus.fileMenu
},
m = function() {
return r("editMenu")
},
p = function() {
return s("editMenu")
},
E = function(e) {
return e.scratchGui.menus.editMenu
},
B = function() {
return r("languageMenu")
},
f = function() {
return s("languageMenu")
},
C = function(e) {
return e.scratchGui.menus.languageMenu
},
w = function() {
return r("loginMenu")
},
I = function() {
return s("loginMenu")
},
y = function(e) {
return e.scratchGui.menus.loginMenu
}
}, function(e, t) {
var A;
A = function() {
return this
}();
try {
A = A || new Function("return this")()
} catch (e) {
"object" == typeof window && (A = window)
}
e.exports = A
}, function(e, t, A) {
"use strict";
e.exports = function(e) {
var t, A = {};
if (!(e instanceof Object) || Array.isArray(e)) throw new Error("keyMirror(...): Argument must be an object.");
for (t in e) e.hasOwnProperty(t) && (A[t] = t);
return A
}
}, function(e, t, A) {
"use strict";
var o = A(172),
n = A(352),
i = {
INIT: "@@redux/INIT"
};
function a(e, t, A) {
var r;
if ("function" == typeof t && void 0 === A && (A = t, t = void 0), void 0 !== A) {
if ("function" != typeof A) throw new Error("Expected the enhancer to be a function.");
return A(a)(e, t)
}
if ("function" != typeof e) throw new Error("Expected the reducer to be a function.");
var s = e,
l = t,
u = [],
c = u,
g = !1;
function d() {
c === u && (c = u.slice())
}
function h() {
return l
}
function m(e) {
if ("function" != typeof e) throw new Error("Expected listener to be a function.");
var t = !0;
return d(), c.push(e),
function() {
if (t) {
t = !1, d();
var A = c.indexOf(e);
c.splice(A, 1)
}
}
}
function p(e) {
if (!Object(o.a)(e)) throw new Error("Actions must be plain objects. Use custom middleware for async actions.");
if (void 0 === e.type) throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');
if (g) throw new Error("Reducers may not dispatch actions.");
try {
g = !0, l = s(l, e)
} finally {
g = !1
}
for (var t = u = c, A = 0; A < t.length; A++) {
(0, t[A])()
}
return e
}
return p({
type: i.INIT
}), (r = {
dispatch: p,
subscribe: m,
getState: h,
replaceReducer: function(e) {
if ("function" != typeof e) throw new Error("Expected the nextReducer to be a function.");
s = e, p({
type: i.INIT
})
}
})[n.a] = function() {
var e, t = m;
return (e = {
subscribe: function(e) {
if ("object" != typeof e) throw new TypeError("Expected the observer to be an object.");
function A() {
e.next && e.next(h())
}
return A(), {
unsubscribe: t(A)
}
}
})[n.a] = function() {
return this
}, e
}, r
}
function r(e, t) {
var A = t && t.type;
return "Given action " + (A && '"' + A.toString() + '"' || "an action") + ', reducer "' + e + '" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'
}
function s(e) {
for (var t = Object.keys(e), A = {}, o = 0; o < t.length; o++) {
var n = t[o];
0, "function" == typeof e[n] && (A[n] = e[n])
}
var a = Object.keys(A);
var s = void 0;
try {
! function(e) {
Object.keys(e).forEach(function(t) {
var A = e[t];
if (void 0 === A(void 0, {
type: i.INIT
})) throw new Error('Reducer "' + t + "\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");
if (void 0 === A(void 0, {
type: "@@redux/PROBE_UNKNOWN_ACTION_" + Math.random().toString(36).substring(7).split("").join(".")
})) throw new Error('Reducer "' + t + "\" returned undefined when probed with a random type. Don't try to handle " + i.INIT + ' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')
})
}(A)
} catch (e) {
s = e
}
return function() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
t = arguments[1];
if (s) throw s;
for (var o = !1, n = {}, i = 0; i < a.length; i++) {
var l = a[i],
u = A[l],
c = e[l],
g = u(c, t);
if (void 0 === g) {
var d = r(l, t);
throw new Error(d)
}
n[l] = g, o = o || g !== c
}
return o ? n : e
}
}
function l(e, t) {
return function() {
return t(e.apply(void 0, arguments))
}
}
function u(e, t) {
if ("function" == typeof e) return l(e, t);
if ("object" != typeof e || null === e) throw new Error("bindActionCreators expected an object or a function, instead received " + (null === e ? "null" : typeof e) + '. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');
for (var A = Object.keys(e), o = {}, n = 0; n < A.length; n++) {
var i = A[n],
a = e[i];
"function" == typeof a && (o[i] = l(a, t))
}
return o
}
function c() {
for (var e = arguments.length, t = Array(e), A = 0; A < e; A++) t[A] = arguments[A];
return 0 === t.length ? function(e) {
return e
} : 1 === t.length ? t[0] : t.reduce(function(e, t) {
return function() {
return e(t.apply(void 0, arguments))
}
})
}
var g = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var A = arguments[t];
for (var o in A) Object.prototype.hasOwnProperty.call(A, o) && (e[o] = A[o])
}
return e
};
function d() {
for (var e = arguments.length, t = Array(e), A = 0; A < e; A++) t[A] = arguments[A];
return function(e) {
return function(A, o, n) {
var i, a = e(A, o, n),
r = a.dispatch,
s = {
getState: a.getState,
dispatch: function(e) {
return r(e)
}
};
return i = t.map(function(e) {
return e(s)
}), r = c.apply(void 0, i)(a.dispatch), g({}, a, {
dispatch: r
})
}
}
}
A.d(t, "e", function() {
return a
}), A.d(t, "c", function() {
return s
}), A.d(t, "b", function() {
return u
}), A.d(t, "a", function() {
return d
}), A.d(t, "d", function() {
return c
})
}, function(e, t, A) {
var o = A(1176);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
var o = A(1388);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
function o(e, t) {
for (var A = 0; A < t.length; A++) {
var o = t[A];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o)
}
}
var n = A(228),
i = Number.isNaN || isNaN,
a = function() {
function e() {
! function(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e)
}
return function(e, t, A) {
t && o(e.prototype, t), A && o(e, A)
}(e, null, [{
key: "toNumber",
value: function(e) {
if ("number" == typeof e) return i(e) ? 0 : e;
var t = Number(e);
return i(t) ? 0 : t
}
}, {
key: "toBoolean",
value: function(e) {
return "boolean" == typeof e ? e : "string" == typeof e ? "" !== e && "0" !== e && "false" !== e.toLowerCase() : Boolean(e)
}
}, {
key: "toString",
value: function(e) {
return String(e)
}
}, {
key: "toRgbColorList",
value: function(t) {
var A = e.toRgbColorObject(t);
return [A.r, A.g, A.b]
}
}, {
key: "toRgbColorObject",
value: function(t) {
return "string" == typeof t && "#" === t.substring(0, 1) ? n.hexToRgb(t) : n.decimalToRgb(e.toNumber(t))
}
}, {
key: "isWhiteSpace",
value: function(e) {
return null === e || "string" == typeof e && 0 === e.trim().length
}
}, {
key: "compare",
value: function(t, A) {
var o = Number(t),
n = Number(A);
if (0 === o && e.isWhiteSpace(t) ? o = NaN : 0 === n && e.isWhiteSpace(A) && (n = NaN), isNaN(o) || isNaN(n)) {
var i = String(t).toLowerCase(),
a = String(A).toLowerCase();
return i < a ? -1 : i > a ? 1 : 0
}
return o === 1 / 0 && n === 1 / 0 || o === -1 / 0 && n === -1 / 0 ? 0 : o - n
}
}, {
key: "isInt",
value: function(e) {
return "number" == typeof e ? !!isNaN(e) || e === parseInt(e, 10) : "boolean" == typeof e || "string" == typeof e && e.indexOf(".") < 0
}
}, {
key: "toListIndex",
value: function(t, A) {
if ("number" != typeof t) {
if ("all" === t) return e.LIST_ALL;
if ("last" === t) return A > 0 ? A : e.LIST_INVALID;
if ("random" === t || "any" === t) return A > 0 ? 1 + Math.floor(Math.random() * A) : e.LIST_INVALID
}
return (t = Math.floor(e.toNumber(t))) < 1 || t > A ? e.LIST_INVALID : t
}
}, {
key: "LIST_INVALID",
get: function() {
return "INVALID"
}
}, {
key: "LIST_ALL",
get: function() {
return "ALL"
}
}]), e
}();
e.exports = a
}, function(e, t, A) {
(function(t) {
var A = 200,
o = "__lodash_hash_undefined__",
n = 1 / 0,
i = 9007199254740991,
a = "[object Arguments]",
r = "[object Function]",
s = "[object GeneratorFunction]",
l = "[object Symbol]",
u = /^\[object .+?Constructor\]$/,
c = /^(?:0|[1-9]\d*)$/,
g = "object" == typeof t && t && t.Object === Object && t,
d = "object" == typeof self && self && self.Object === Object && self,
h = g || d || Function("return this")();
function m(e, t) {
return !!(e ? e.length : 0) && function(e, t, A) {
if (t != t) return function(e, t, A, o) {
var n = e.length,
i = A + (o ? 1 : -1);
for (; o ? i-- : ++i < n;)
if (t(e[i], i, e)) return i;
return -1
}(e, f, A);
var o = A - 1,
n = e.length;
for (; ++o < n;)
if (e[o] === t) return o;
return -1
}(e, t, 0) > -1
}
function p(e, t, A) {
for (var o = -1, n = e ? e.length : 0; ++o < n;)
if (A(t, e[o])) return !0;
return !1
}
function E(e, t) {
for (var A = -1, o = e ? e.length : 0, n = Array(o); ++A < o;) n[A] = t(e[A], A, e);
return n
}
function B(e, t) {
for (var A = -1, o = t.length, n = e.length; ++A < o;) e[n + A] = t[A];
return e
}
function f(e) {
return e != e
}
function C(e, t) {
return e.has(t)
}
function w(e, t) {
return function(A) {
return e(t(A))
}
}
var I = Array.prototype,
y = Function.prototype,
b = Object.prototype,
M = h["__core-js_shared__"],
T = function() {
var e = /[^.]+$/.exec(M && M.keys && M.keys.IE_PROTO || "");
return e ? "Symbol(src)_1." + e : ""
}(),
S = y.toString,
Q = b.hasOwnProperty,
D = b.toString,
k = RegExp("^" + S.call(Q).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"),
N = h.Symbol,
v = w(Object.getPrototypeOf, Object),
O = b.propertyIsEnumerable,
R = I.splice,
F = N ? N.isConcatSpreadable : void 0,
Y = Object.getOwnPropertySymbols,
U = Math.max,
L = q(h, "Map"),
G = q(Object, "create");
function x(e) {
var t = -1,
A = e ? e.length : 0;
for (this.clear(); ++t < A;) {
var o = e[t];
this.set(o[0], o[1])
}
}
function _(e) {
var t = -1,
A = e ? e.length : 0;
for (this.clear(); ++t < A;) {
var o = e[t];
this.set(o[0], o[1])
}
}
function P(e) {
var t = -1,
A = e ? e.length : 0;
for (this.clear(); ++t < A;) {
var o = e[t];
this.set(o[0], o[1])
}
}
function H(e) {
var t = -1,
A = e ? e.length : 0;
for (this.__data__ = new P; ++t < A;) this.add(e[t])
}
function j(e, t) {
var A = ne(e) || oe(e) ? function(e, t) {
for (var A = -1, o = Array(e); ++A < e;) o[A] = t(A);
return o
}(e.length, String) : [],
o = A.length,
n = !!o;
for (var i in e) !t && !Q.call(e, i) || n && ("length" == i || ee(i, o)) || A.push(i);
return A
}
function z(e, t) {
for (var A = e.length; A--;)
if (Ae(e[A][0], t)) return A;
return -1
}
function K(e) {
return !(!re(e) || function(e) {
return !!T && T in e
}(e)) && (ae(e) || function(e) {
var t = !1;
if (null != e && "function" != typeof e.toString) try {
t = !!(e + "")
} catch (e) {}
return t
}(e) ? k : u).test(function(e) {
if (null != e) {
try {
return S.call(e)
} catch (e) {}
try {
return e + ""
} catch (e) {}
}
return ""
}(e))
}
function J(e) {
if (!re(e)) return function(e) {
var t = [];
if (null != e)
for (var A in Object(e)) t.push(A);
return t
}(e);
var t = function(e) {
var t = e && e.constructor,
A = "function" == typeof t && t.prototype || b;
return e === A
}(e),
A = [];
for (var o in e)("constructor" != o || !t && Q.call(e, o)) && A.push(o);
return A
}
function V(e) {
return function(e, t, A) {
var o = t(e);
return ne(e) ? o : B(o, A(e))
}(e, le, Z)
}
function W(e, t) {
var A = e.__data__;
return function(e) {
var t = typeof e;
return "string" == t || "number" == t || "symbol" == t || "boolean" == t ? "__proto__" !== e : null === e
}(t) ? A["string" == typeof t ? "string" : "hash"] : A.map
}
function q(e, t) {
var A = function(e, t) {
return null == e ? void 0 : e[t]
}(e, t);
return K(A) ? A : void 0
}
x.prototype.clear = function() {
this.__data__ = G ? G(null) : {}
}, x.prototype.delete = function(e) {
return this.has(e) && delete this.__data__[e]
}, x.prototype.get = function(e) {
var t = this.__data__;
if (G) {
var A = t[e];
return A === o ? void 0 : A
}
return Q.call(t, e) ? t[e] : void 0
}, x.prototype.has = function(e) {
var t = this.__data__;
return G ? void 0 !== t[e] : Q.call(t, e)
}, x.prototype.set = function(e, t) {
return this.__data__[e] = G && void 0 === t ? o : t, this
}, _.prototype.clear = function() {
this.__data__ = []
}, _.prototype.delete = function(e) {
var t = this.__data__,
A = z(t, e);
return !(A < 0 || (A == t.length - 1 ? t.pop() : R.call(t, A, 1), 0))
}, _.prototype.get = function(e) {
var t = this.__data__,
A = z(t, e);
return A < 0 ? void 0 : t[A][1]
}, _.prototype.has = function(e) {
return z(this.__data__, e) > -1
}, _.prototype.set = function(e, t) {
var A = this.__data__,
o = z(A, e);
return o < 0 ? A.push([e, t]) : A[o][1] = t, this
}, P.prototype.clear = function() {
this.__data__ = {
hash: new x,
map: new(L || _),
string: new x
}
}, P.prototype.delete = function(e) {
return W(this, e).delete(e)
}, P.prototype.get = function(e) {
return W(this, e).get(e)
}, P.prototype.has = function(e) {
return W(this, e).has(e)
}, P.prototype.set = function(e, t) {
return W(this, e).set(e, t), this
}, H.prototype.add = H.prototype.push = function(e) {
return this.__data__.set(e, o), this
}, H.prototype.has = function(e) {
return this.__data__.has(e)
};
var X = Y ? w(Y, Object) : ce,
Z = Y ? function(e) {
for (var t = []; e;) B(t, X(e)), e = v(e);
return t
} : ce;
function $(e) {
return ne(e) || oe(e) || !!(F && e && e[F])
}
function ee(e, t) {
return !!(t = null == t ? i : t) && ("number" == typeof e || c.test(e)) && e > -1 && e % 1 == 0 && e < t
}
function te(e) {
if ("string" == typeof e || function(e) {
return "symbol" == typeof e || se(e) && D.call(e) == l
}(e)) return e;
var t = e + "";
return "0" == t && 1 / e == -n ? "-0" : t
}
function Ae(e, t) {
return e === t || e != e && t != t
}
function oe(e) {
return function(e) {
return se(e) && ie(e)
}(e) && Q.call(e, "callee") && (!O.call(e, "callee") || D.call(e) == a)
}
var ne = Array.isArray;
function ie(e) {
return null != e && function(e) {
return "number" == typeof e && e > -1 && e % 1 == 0 && e <= i
}(e.length) && !ae(e)
}
function ae(e) {
var t = re(e) ? D.call(e) : "";
return t == r || t == s
}
function re(e) {
var t = typeof e;
return !!e && ("object" == t || "function" == t)
}
function se(e) {
return !!e && "object" == typeof e
}
function le(e) {
return ie(e) ? j(e, !0) : J(e)
}
var ue = function(e, t) {
return t = U(void 0 === t ? e.length - 1 : t, 0),
function() {
for (var A = arguments, o = -1, n = U(A.length - t, 0), i = Array(n); ++o < n;) i[o] = A[t + o];
o = -1;
for (var a = Array(t + 1); ++o < t;) a[o] = A[o];
return a[t] = i,
function(e, t, A) {
switch (A.length) {
case 0:
return e.call(t);
case 1:
return e.call(t, A[0]);
case 2:
return e.call(t, A[0], A[1]);
case 3:
return e.call(t, A[0], A[1], A[2])
}
return e.apply(t, A)
}(e, this, a)
}
}(function(e, t) {
return null == e ? {} : (t = E(function e(t, A, o, n, i) {
var a = -1,
r = t.length;
for (o || (o = $), i || (i = []); ++a < r;) {
var s = t[a];
A > 0 && o(s) ? A > 1 ? e(s, A - 1, o, n, i) : B(i, s) : n || (i[i.length] = s)
}
return i
}(t, 1), te), function(e, t) {
return function(e, t, A) {
for (var o = -1, n = t.length, i = {}; ++o < n;) {
var a = t[o],
r = e[a];
A(r, a) && (i[a] = r)
}
return i
}(e = Object(e), t, function(t, A) {
return A in e
})
}(e, function(e, t, o, n) {
var i = -1,
a = m,
r = !0,
s = e.length,
l = [],
u = t.length;
if (!s) return l;
o && (t = E(t, function(e) {
return function(t) {
return e(t)
}
}(o))), n ? (a = p, r = !1) : t.length >= A && (a = C, r = !1, t = new H(t));
e: for (; ++i < s;) {
var c = e[i],
g = o ? o(c) : c;
if (c = n || 0 !== c ? c : 0, r && g == g) {
for (var d = u; d--;)
if (t[d] === g) continue e;
l.push(c)
} else a(t, g, n) || l.push(c)
}
return l
}(V(e), t)))
});
function ce() {
return []
}
e.exports = ue
}).call(this, A(45))
}, function(e, t, A) {
var o = A(1245);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
var o = A(1287);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t) {
var A = e.exports = {
version: "2.5.7"
};
"number" == typeof __e && (__e = A)
}, function(e, t, A) {
"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var o = Object.getOwnPropertySymbols,
n = Object.prototype.hasOwnProperty,
i = Object.prototype.propertyIsEnumerable;
e.exports = function() {
try {
if (!Object.assign) return !1;
var e = new String("abc");
if (e[5] = "de", "5" === Object.getOwnPropertyNames(e)[0]) return !1;
for (var t = {}, A = 0; A < 10; A++) t["_" + String.fromCharCode(A)] = A;
if ("0123456789" !== Object.getOwnPropertyNames(t).map(function(e) {
return t[e]
}).join("")) return !1;
var o = {};
return "abcdefghijklmnopqrst".split("").forEach(function(e) {
o[e] = e
}), "abcdefghijklmnopqrst" === Object.keys(Object.assign({}, o)).join("")
} catch (e) {
return !1
}
}() ? Object.assign : function(e, t) {
for (var A, a, r = function(e) {
if (null === e || void 0 === e) throw new TypeError("Object.assign cannot be called with null or undefined");
return Object(e)
}(e), s = 1; s < arguments.length; s++) {
for (var l in A = Object(arguments[s])) n.call(A, l) && (r[l] = A[l]);
if (o) {
a = o(A);
for (var u = 0; u < a.length; u++) i.call(A, a[u]) && (r[a[u]] = A[a[u]])
}
}
return r
}
}, function(e, t, A) {
"use strict";
var o = A(4),
n = A.n(o),
i = A(0),
a = A.n(i),
r = A(1),
s = A.n(r),
l = A(283),
u = A.n(l);
function c() {
return (c = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var A = arguments[t];
for (var o in A) Object.prototype.hasOwnProperty.call(A, o) && (e[o] = A[o])
}
return e
}).apply(this, arguments)
}
function g(e, t) {
if (null == e) return {};
var A, o, n = function(e, t) {
if (null == e) return {};
var A, o, n = {},
i = Object.keys(e);
for (o = 0; o < i.length; o++) A = i[o], t.indexOf(A) >= 0 || (n[A] = e[A]);
return n
}(e, t);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
for (o = 0; o < i.length; o++) A = i[o], t.indexOf(A) >= 0 || Object.prototype.propertyIsEnumerable.call(e, A) && (n[A] = e[A])
}
return n
}
var d = function(e) {
var t = e.className,
A = e.disabled,
o = e.iconClassName,
i = e.iconSrc,
a = e.onClick,
r = e.children,
l = g(e, ["className", "disabled", "iconClassName", "iconSrc", "onClick", "children"]);
A && (a = function() {});
var d = i && s.a.createElement("img", {
className: n()(o, u.a.icon),
draggable: !1,
src: i
});
return s.a.createElement("span", c({
className: n()(u.a.outlinedButton, t),
role: "button",
onClick: a
}, l), d, s.a.createElement("div", {
className: u.a.content
}, r))
};
d.propTypes = {
children: a.a.node,
className: a.a.string,
disabled: a.a.bool,
iconClassName: a.a.string,
iconSrc: a.a.string,
onClick: a.a.func
}, t.a = d
}, function(e, t, A) {
var o = A(1178);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
"use strict";
A.d(t, "c", function() {
return g
}), A.d(t, "a", function() {
return c
}), A.d(t, "b", function() {
return u
});
var o = A(1),
n = A.n(o),
i = A(2),
a = A(46),
r = A.n(a),
s = A(212),
l = A.n(s),
u = r()({
STANDARD: null,
EXTENSION: null,
INLINE: null
}),
c = {
SUCCESS: "success",
INFO: "info",
WARN: "warn"
},
g = [{
alertId: "createSuccess",
alertType: u.STANDARD,
clearList: ["createSuccess", "creating", "createCopySuccess", "creatingCopy", "createRemixSuccess", "creatingRemix", "saveSuccess", "saving"],
content: n.a.createElement(i.a, {
defaultMessage: "New project created.",
id: "gui.alerts.createsuccess"
}),
iconURL: l.a,
level: c.SUCCESS,
maxDisplaySecs: 5
}, {
alertId: "createCopySuccess",
alertType: u.STANDARD,
clearList: ["createSuccess", "creating", "createCopySuccess", "creatingCopy", "createRemixSuccess", "creatingRemix", "saveSuccess", "saving"],
content: n.a.createElement(i.a, {
defaultMessage: "Project saved as a copy.",
id: "gui.alerts.createcopysuccess"
}),
iconURL: l.a,
level: c.SUCCESS,
maxDisplaySecs: 5
}, {
alertId: "createRemixSuccess",
alertType: u.STANDARD,
clearList: ["createSuccess", "creating", "createCopySuccess", "creatingCopy", "createRemixSuccess", "creatingRemix", "saveSuccess", "saving"],
content: n.a.createElement(i.a, {
defaultMessage: "Project saved as a remix.",
id: "gui.alerts.createremixsuccess"
}),
iconURL: l.a,
level: c.SUCCESS,
maxDisplaySecs: 5
}, {
alertId: "creating",
alertType: u.STANDARD,
clearList: ["createSuccess", "creating", "createCopySuccess", "creatingCopy", "createRemixSuccess", "creatingRemix", "saveSuccess", "saving"],
content: n.a.createElement(i.a, {
defaultMessage: "Creating new…",
id: "gui.alerts.creating"
}),
iconSpinner: !0,
level: c.SUCCESS
}, {
alertId: "creatingCopy",
alertType: u.STANDARD,
clearList: ["createSuccess", "creating", "createCopySuccess", "creatingCopy", "createRemixSuccess", "creatingRemix", "saveSuccess", "saving"],
content: n.a.createElement(i.a, {
defaultMessage: "Copying project…",
id: "gui.alerts.creatingCopy"
}),
iconSpinner: !0,
level: c.SUCCESS
}, {
alertId: "creatingRemix",
alertType: u.STANDARD,
clearList: ["createSuccess", "creating", "createCopySuccess", "creatingCopy", "createRemixSuccess", "creatingRemix", "saveSuccess", "saving"],
content: n.a.createElement(i.a, {
defaultMessage: "Remixing project…",
id: "gui.alerts.creatingRemix"
}),
iconSpinner: !0,
level: c.SUCCESS
}, {
alertId: "creatingError",
clearList: ["createSuccess", "creating", "createCopySuccess", "creatingCopy", "createRemixSuccess", "creatingRemix", "saveSuccess", "saving"],
closeButton: !0,
content: n.a.createElement(i.a, {
defaultMessage: "Could not create the project. Please try again!",
id: "gui.alerts.creatingError"
}),
level: c.WARN
}, {
alertId: "savingError",
clearList: ["createSuccess", "creating", "createCopySuccess", "creatingCopy", "createRemixSuccess", "creatingRemix", "saveSuccess", "saving"],
showDownload: !0,
showSaveNow: !0,
closeButton: !1,
content: n.a.createElement(i.a, {
defaultMessage: "Project could not save.",
id: "gui.alerts.savingError"
}),
level: c.WARN
}, {
alertId: "saveSuccess",
alertType: u.INLINE,
clearList: ["saveSuccess", "saving", "savingError"],
content: n.a.createElement(i.a, {
defaultMessage: "Project saved.",
id: "gui.alerts.savesuccess"
}),
iconURL: l.a,
level: c.SUCCESS,
maxDisplaySecs: 3
}, {
alertId: "saving",
alertType: u.INLINE,
clearList: ["saveSuccess", "saving", "savingError"],
content: n.a.createElement(i.a, {
defaultMessage: "Saving project…",
id: "gui.alerts.saving"
}),
iconSpinner: !0,
level: c.INFO
}, {
alertId: "cloudInfo",
alertType: u.STANDARD,
clearList: ["cloudInfo"],
content: n.a.createElement(i.a, {
defaultMessage: "Please note, cloud variables only support numbers, not letters or symbols. {learnMoreLink}",
id: "gui.alerts.cloudInfo",
values: {
learnMoreLink: n.a.createElement("a", {
href: "https://scratch.mit.edu/info/faq/#clouddata",
rel: "noopener noreferrer",
target: "_blank"
}, n.a.createElement(i.a, {
defaultMessage: "Learn more.",
id: "gui.alerts.cloudInfoLearnMore"
}))
}
}),
closeButton: !0,
level: c.SUCCESS,
maxDisplaySecs: 15
}, {
alertId: "importingAsset",
alertType: u.STANDARD,
clearList: [],
content: n.a.createElement(i.a, {
defaultMessage: "Importing…",
id: "gui.alerts.importing"
}),
iconSpinner: !0,
level: c.SUCCESS
}]
}, function(e, t, A) {
var o = A(1264);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
var o = A(1267);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
var o = A(1360);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
"use strict";
A.d(t, "d", function() {
return a
}), A.d(t, "b", function() {
return i
}), A.d(t, "a", function() {
return r
}), A.d(t, "c", function() {
return s
}), A.d(t, "g", function() {
return l
}), A.d(t, "h", function() {
return u
}), A.d(t, "e", function() {
return c
}), A.d(t, "i", function() {
return g
}), A.d(t, "f", function() {
return d
});
var o = A(36),
n = "scratch-gui/cards/END_DRAG",
i = {
visible: !1,
content: A(63).a,
activeDeckId: null,
step: 0,
x: 0,
y: 0,
dragging: !1
},
a = function(e, t) {
switch (void 0 === e && (e = i), t.type) {
case "scratch-gui/cards/CLOSE_CARDS":
return Object.assign({}, e, {
visible: !1
});
case "scratch-gui/cards/VIEW_CARDS":
return Object.assign({}, e, {
visible: !0
});
case "scratch-gui/cards/ACTIVATE_DECK":
return Object.assign({}, e, {
activeDeckId: t.activeDeckId,
step: 0,
visible: !0
});
case "scratch-gui/cards/NEXT_STEP":
return null !== e.activeDeckId ? (o.a.event({
category: "how-to",
action: "next step",
label: "".concat(e.activeDeckId, " - ").concat(e.step)
}), Object.assign({}, e, {
step: e.step + 1
})) : e;
case "scratch-gui/cards/PREV_STEP":
return null !== e.activeDeckId && e.step > 0 ? Object.assign({}, e, {
step: e.step - 1
}) : e;
case "scratch-gui/cards/DRAG_CARD":
return Object.assign({}, e, {
x: t.x,
y: t.y
});
case "scratch-gui/cards/START_DRAG":
return Object.assign({}, e, {
dragging: !0
});
case n:
return Object.assign({}, e, {
dragging: !1
});
default:
return e
}
},
r = function(e) {
return {
type: "scratch-gui/cards/ACTIVATE_DECK",
activeDeckId: e
}
},
s = function() {
return {
type: "scratch-gui/cards/CLOSE_CARDS"
}
},
l = function() {
return {
type: "scratch-gui/cards/NEXT_STEP"
}
},
u = function() {
return {
type: "scratch-gui/cards/PREV_STEP"
}
},
c = function(e, t) {
return {
type: "scratch-gui/cards/DRAG_CARD",
x: e,
y: t
}
},
g = function() {
return {
type: "scratch-gui/cards/START_DRAG"
}
},
d = function() {
return {
type: n
}
}
}, function(e, t, A) {
"use strict";
var o = A(1),
n = A.n(o),
i = A(2),
a = A(560),
r = A.n(a),
s = A(561),
l = A.n(s),
u = A(562),
c = A.n(u),
g = A(563),
d = A.n(g),
h = A(564),
m = A.n(h),
p = A(565),
E = A.n(p),
B = A(566),
f = A.n(B),
C = A(567),
w = A.n(C),
I = A(568),
y = A.n(I),
b = A(569),
M = A.n(b),
T = A(570),
S = A.n(T),
Q = A(571),
D = A.n(Q),
k = A(572),
N = A.n(k),
v = A(573),
O = A.n(v),
R = A(574),
F = A.n(R),
Y = A(575),
U = A.n(Y),
L = A(576),
G = A.n(L),
x = A(577),
_ = A.n(x),
P = A(578),
H = A.n(P),
j = A(579),
z = A.n(j);
t.a = {
"intro-move-sayhello": {
name: n.a.createElement(i.a, {
defaultMessage: "Getting Started",
id: "gui.howtos.intro-move-sayhello-hat.name"
}),
tags: ["help", "stuck", "how", "can", "say"],
img: r.a,
steps: [{
video: "intro-move-sayhello"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Add a move block",
id: "gui.howtos.intro-move.step_stepMove"
}),
image: "introMove"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Click the green flag to start",
id: "gui.howtos.add-a-move-block.step_stepMoveSayHello"
}),
image: "introSayHello"
}, {
deckIds: ["add-a-backdrop", "add-sprite"]
}],
urlId: "getStarted"
},
"say-it-out-loud": {
name: n.a.createElement(i.a, {
defaultMessage: "Create Animations That Talk",
id: "gui.howtos.say-it-out-loud"
}),
img: l.a,
steps: [{
video: "k54n8uwcty",
trackingPixel: n.a.createElement("img", {
src: "https://code.org/api/hour/begin_scratch_talk.png"
})
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Add the Text to Speech blocks",
id: "gui.howtos.say-it-out-loud.step_AddTXTextension"
}),
image: "speechAddExtension"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Say Something",
id: "gui.howtos.say-it-out-loud.step_TXTSpeech"
}),
image: "speechSaySomething"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Set a Voice",
id: "gui.howtos.say-it-out-loud_TXTSetVoice"
}),
image: "speechSetVoice"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Move Around",
id: "gui.howtos.say-it-out-loud.step_TXTMove"
}),
image: "speechMoveAround"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Add a Backdrop ",
id: "gui.howtos.say-it-out-loud.step_TXTBackdrop"
}),
image: "speechAddBackdrop"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Add Another Character",
id: "gui.howtos.say-it-out-loud.step_TXTAddSprite"
}),
image: "speechAddSprite"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Perform a Song",
id: "gui.howtos.say-it-out-loud.step_TXTSong"
}),
image: "speechSong"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Change Color",
id: "gui.howtos.say-it-out-loud.step_TXTColor"
}),
image: "speechChangeColor"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Spin Around",
id: "gui.howtos.say-it-out-loud.step_TXTSpin"
}),
image: "speechSpin"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Grow and Shrink",
id: "gui.howtos.say-it-out-loud.step_TXTGrow"
}),
image: "speechGrowShrink"
}, {
deckIds: ["animate-a-name", "Make-Music"]
}],
urlId: "animations-that-talk"
},
"cartoon-network": {
name: n.a.createElement(i.a, {
defaultMessage: "Animate an Adventure Game",
id: "gui.howtos.cartoon-network"
}),
requiredProjectId: "249143200",
img: c.a,
steps: [{
video: "uz5oz5h9yg",
trackingPixel: n.a.createElement("img", {
src: "https://code.org/api/hour/begin_scratch_adventure.png"
})
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Choose a Character to Show",
id: "gui.howtos.cartoon-network.step_CNcharacter"
}),
image: "cnShowCharacter"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Say Something",
id: "gui.howtos.cartoon-network.step_CNsay"
}),
image: "cnSay"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Glide Around",
id: "gui.howtos.cartoon-network.step_CNglide"
}),
image: "cnGlide"
}, {
title: n.a.createElement(i.a, {
defaultMessage: " Choose an Object to Chase ",
id: "gui.howtos.cartoon-network.step_CNpicksprite"
}),
image: "cnPickSprite"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Collect Objects",
id: "gui.howtos.cartoon-network.step_CNcollect"
}),
image: "cnCollect"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Make a Score Variable",
id: "gui.howtos.cartoon-network.step_CNvariable"
}),
image: "cnVariable"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Keep Score",
id: "gui.howtos.cartoon-network.step_CNscore"
}),
image: "cnScore"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Level Up: Change Backdrop",
id: "gui.howtos.cartoon-network.step_CNbackdrop"
}),
image: "cnBackdrop"
}, {
video: "6o76f5ivo1"
}, {
deckIds: ["switch-costume", "add-effects"]
}],
urlId: "animate-an-adventure-game"
},
"animate-a-name": {
name: n.a.createElement(i.a, {
defaultMessage: "Animate a Name",
id: "gui.howtos.animate-a-name.name"
}),
img: m.a,
tags: ["animation", "art", "spin", "grow"],
steps: [{
video: "animate-a-name"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Pick a Letter Sprite",
id: "gui.howtos.animate-a-name.step_AnimatePickLetter"
}),
image: "namePickLetter"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Play a Sound When Clicked",
id: "gui.howtos.animate-a-name.step_AnimatePlaySound"
}),
image: "namePlaySound"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Pick Another Letter Sprite",
id: "gui.howtos.animate-a-name.step_AnimatePickLetter2"
}),
image: "namePickLetter2"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Change color",
id: "gui.howtos.animate-a-name.step_AnimateChangeColor"
}),
image: "nameChangeColor"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Pick Another Letter Sprite & Make It Spin",
id: "gui.howtos.animate-a-name.step_AnimateSpin"
}),
image: "nameSpin"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Pick Another Letter Sprite & Make It Grow",
id: "gui.howtos.animate-a-name.step_AnimateGrow"
}),
image: "nameGrow"
}, {
deckIds: ["add-a-backdrop", "glide-around"]
}],
urlId: "name"
},
"Make-Music": {
name: n.a.createElement(i.a, {
defaultMessage: "Make Music",
id: "gui.howtos.make-music.name"
}),
img: E.a,
tags: ["music", "sound", "instrument", "play", "song", "band"],
steps: [{
video: "Make-Music"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Pick an Instrument Sprite ",
id: "gui.howtos.Make-Music.step_PickInstrument"
}),
image: "musicPickInstrument"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Play Sound When Clicked",
id: "gui.howtos.Make-Music.step_PlaySoundClick"
}),
image: "musicPlaySound"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Create a Song",
id: "gui.howtos.Make-Music.step_MakeSong"
}),
image: "musicMakeSong"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Choose a Drum & Make a Beat",
id: "gui.howtos.make-music.step_MakeBeat"
}),
image: "musicMakeBeat"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Choose the Microphone Sprite & Surprise Beatbox",
id: "gui.howtos.make-music.step_MakeBeatBox"
}),
image: "musicMakeBeatbox"
}, {
deckIds: ["add-a-backdrop", "add-sprite"]
}],
urlId: "music"
},
"Make-A-Game": {
name: n.a.createElement(i.a, {
defaultMessage: "Make a Clicker Game",
id: "gui.howtos.make-a-game.name"
}),
img: w.a,
tags: ["games", "click", "clicked", "score"],
steps: [{
video: "Make-A-Game"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Pick A Sprite",
id: "gui.howtos.Make-A-Game.step_GamePickSprite"
}),
image: "popGamePickSprite"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Play Sound When Clicked",
id: "gui.howtos.make-a-game.step_GamePlaySound"
}),
image: "popGamePlaySound"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Create Score Variable",
id: "gui.howtos.make-a-game.step_GameAddScore"
}),
image: "popGameAddScore"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "When Clicked Increase Score",
id: "gui.howtos.make-a-game.step_GameChangeScore"
}),
image: "popGameChangeScore"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Go to a random position",
id: "gui.howtos.make-a-game.step_Random"
}),
image: "popGameRandomPosition"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Change Color",
id: "gui.howtos.make-music.step_GameChangeColor"
}),
image: "popGameChangeColor"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Reset Score",
id: "gui.howtos.make-music.step_ResetScore"
}),
image: "popGameResetScore"
}, {
deckIds: ["add-a-backdrop", "move-around-with-arrow-keys"]
}],
urlId: "clicker-game"
},
"Chase-Game": {
name: n.a.createElement(i.a, {
defaultMessage: "Make a Chase Game",
id: "gui.howtos.make-a-chase-game.name"
}),
img: f.a,
tags: ["games", "arrow", "keyboard", "score"],
steps: [{
video: "Chase-Game"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Add a Backdrop",
id: "gui.howtos.Chase-Game.step_BG"
}),
image: "chaseGameAddBackdrop"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Add a Sprite",
id: "gui.howtos.chase-game.step_AddOcto"
}),
image: "chaseGameAddSprite1"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Move Right & Left With Arrow Keys",
id: "gui.howtos.make-music.step_LeftRight"
}),
image: "chaseGameRightLeft"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Move Up & Down With Arrow Keys",
id: "gui.howtos.Chase-Game.step_UpDown"
}),
image: "chaseGameUpDown"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Add Another Sprite",
id: "gui.howtos.Chase-Game.step_AddStar"
}),
image: "chaseGameAddSprite2"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Move Randomly",
id: "gui.howtos.Chase-Game.step_MoveRandom"
}),
image: "chaseGameMoveRandomly"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "In Octopus Sprite, When Touching Play Sound",
id: "gui.howtos.Chase-Game.step_WhenTouch"
}),
image: "chaseGamePlaySound"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Create Score Variable",
id: "gui.howtos.Chase-Game.step_ScoreVariable"
}),
image: "chaseGameAddVariable"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "In Octopus Sprite, When Touching Add Score",
id: "gui.howtos.Chase-Game.ScoreWhenTouch"
}),
image: "chaseGameChangeScore"
}, {
deckIds: ["add-effects", "move-around-with-arrow-keys"]
}],
urlId: "chase-game"
},
"Animate-A-Character": {
name: n.a.createElement(i.a, {
defaultMessage: "Animate A Character",
id: "gui.howtos.animate-char.name"
}),
img: y.a,
steps: [{
video: "s228u3g5u9"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Add a Backdrop",
id: "gui.howtos.animate-char.step_addbg"
}),
image: "animateCharPickBackdrop"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Add a Sprite",
id: "gui.howtos.animate-char.step_addsprite"
}),
image: "animateCharPickSprite"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Say Something",
id: "gui.howtos.animate-char.step_saysomething"
}),
image: "animateCharSaySomething"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Add Sound",
id: "gui.howtos.animate-char.step_addsound"
}),
image: "animateCharAddSound"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Animate Talking",
id: "gui.howtos.animate-char.step_animatetalking"
}),
image: "animateCharTalk"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Move Using Arrow Keys",
id: "gui.howtos.animate-char.step_arrowkeys"
}),
image: "animateCharMove"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Jump",
id: "gui.howtos.animate-char.step_jump"
}),
image: "animateCharJump"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Change Color",
id: "gui.howtos.animate-char.step_changecolor"
}),
image: "animateCharChangeColor"
}, {
deckIds: ["Chase-Game", "Tell-A-Story"]
}],
urlId: "animate-a-character"
},
"Tell-A-Story": {
name: n.a.createElement(i.a, {
defaultMessage: "Create A Story",
id: "gui.howtos.story.name"
}),
img: M.a,
steps: [{
video: "stah7jjorp"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Add a Backdrop",
id: "gui.howtos.story.step_addbg"
}),
image: "storyPickBackdrop"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Add a Character",
id: "gui.howtos.story.step_addsprite"
}),
image: "storyPickSprite"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Say Something",
id: "gui.howtos.story.step_saysomething"
}),
image: "storySaySomething"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Add Another Character",
id: "gui.howtos.story.step_addanothersprite"
}),
image: "storyPickSprite2"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Flip Direction",
id: "gui.howtos.story.step_flip"
}),
image: "storyFlip"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Have A Conversation",
id: "gui.howtos.story.step_conversation"
}),
image: "storyConversation"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Add Another Backdrop",
id: "gui.howtos.story.addanotherbg"
}),
image: "storyPickBackdrop2"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Switch Backdrops",
id: "gui.howtos.story.step_swithbg"
}),
image: "storySwitchBackdrop"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Hide a Character",
id: "gui.howtos.story.step_hidewizard"
}),
image: "storyHideCharacter"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Show a Character",
id: "gui.howtos.story.step_showwizard"
}),
image: "storyShowCharacter"
}, {
deckIds: ["say-it-out-loud", "record-a-sound"]
}],
urlId: "tell-a-story"
},
"Video-Sensing": {
name: n.a.createElement(i.a, {
defaultMessage: "Video Sensing",
id: "gui.howtos.videosens.name"
}),
img: S.a,
steps: [{
video: "3pd1z110d6"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Add Extension",
id: "gui.howtos.videosens.step_addextension"
}),
image: "videoAddExtension"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Pet the Cat",
id: "gui.howtos.videosens.step_pet"
}),
image: "videoPet"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Animate",
id: "gui.howtos.videosens.step_animate"
}),
image: "videoAnimate"
}, {
title: n.a.createElement(i.a, {
defaultMessage: "Pop a Balloon",
id: "gui.howtos.videosens.step_pop"
}),
image: "videoPop"
}, {
deckIds: ["Make-Music", "add-effects"]
}],
urlId: "video-sensing"
},
"add-sprite": {
name: n.a.createElement(i.a, {
defaultMessage: "Add a Sprite",
id: "gui.howtos.add-sprite.name"
}),
img: d.a,
tags: ["art", "games", "stories", "character"],
steps: [{
title: n.a.createElement(i.a, {
defaultMessage: "Add a Sprite",
id: "gui.howtos.add-sprite.step_addSprite"
}),
image: "addSprite"
}, {
deckIds: ["add-a-backdrop", "switch-costume"]
}],
urlId: "add-a-sprite"
},
"add-a-backdrop": {
name: n.a.createElement(i.a, {
defaultMessage: "Add a Backdrop",
id: "gui.howtos.add-a-backdrop.name"
}),
img: G.a,
tags: ["art", "games", "stories", "background"],
steps: [{
video: "add-a-backdrop"
}, {
deckIds: ["change-size", "switch-costume"]
}],
urlId: "add-a-backdrop"
},
"change-size": {
name: n.a.createElement(i.a, {
defaultMessage: "Change Size",
id: "gui.howtos.change-size.name"
}),
img: O.a,
scale: ["art", "animation", "scale"],
steps: [{
video: "change-size"
}, {
deckIds: ["glide-around", "spin-video"]
}],
urlId: "change-size"
},
"glide-around": {
name: n.a.createElement(i.a, {
defaultMessage: "Glide Around",
id: "gui.howtos.glide-around.name"
}),
img: N.a,
tags: ["animation", "stories", "music", "instrument", "play", "song", "band"],
steps: [{
video: "glide-around"
}, {
deckIds: ["add-a-backdrop", "switch-costume"]
}],
urlId: "glide-around"
},
"record-a-sound": {
name: n.a.createElement(i.a, {
defaultMessage: "Record a Sound",
id: "gui.howtos.record-a-sound.name"
}),
tags: ["music", "games", "stories"],
img: D.a,
steps: [{
video: "record-a-sound"
}, {
deckIds: ["Make-Music", "switch-costume"]
}],
urlId: "record-a-sound"
},
"spin-video": {
name: n.a.createElement(i.a, {
defaultMessage: "Make It Spin",
id: "gui.howtos.spin-video.name"
}),
img: z.a,
tags: ["animation", "rotate", "rotation"],
steps: [{
video: "spin-video"
}, {
deckIds: ["add-a-backdrop", "switch-costume"]
}],
urlId: "make-it-spin"
},
"hide-and-show": {
name: n.a.createElement(i.a, {
defaultMessage: "Hide and Show",
id: "gui.howtos.hide-and-show.name"
}),
img: U.a,
tags: ["stories", "appear", "disappear"],
steps: [{
video: "hide-and-show"
}, {
deckIds: ["add-a-backdrop", "switch-costume"]
}],
urlId: "hide"
},
"switch-costume": {
name: n.a.createElement(i.a, {
defaultMessage: "Animate a Sprite",
id: "gui.howtos.switch-costume.name"
}),
img: F.a,
tags: ["animation", "art", "games", "stories", "paint", "edit", "change", "character", "sprite"],
steps: [{
video: "switch-costume"
}, {
deckIds: ["add-a-backdrop", "add-effects"]
}],
urlId: "animate-a-sprite"
},
"move-around-with-arrow-keys": {
name: n.a.createElement(i.a, {
defaultMessage: "Use Arrow Keys",
id: "gui.howtos.move-around-with-arrow-keys.name"
}),
img: H.a,
tags: ["games", "keyboard"],
steps: [{
video: "move-around-with-arrow-keys"
}, {
deckIds: ["add-a-backdrop", "switch-costume"]
}],
urlId: "arrow-keys"
},
"add-effects": {
name: n.a.createElement(i.a, {
defaultMessage: "Add Effects",
id: "gui.howtos.add-effects.name"
}),
tags: ["animation", "art", "games", "stories", "8-bit", "brightness", "ghost", "transparency", "opacity", "fx", "color", "fisheye", "whirl", "twist", "pixelate", "mosaic", "8bit"],
img: _.a,
steps: [{
video: "add-effects"
}, {
deckIds: ["add-a-backdrop", "switch-costume"]
}],
urlId: "add-effects"
},
"wedo2-getting-started": {
steps: [{
video: "4im7iizv47"
}],
urlId: "wedo",
hidden: !0
},
"ev3-getting-started": {
steps: [{
video: "qgu78c5y7d"
}],
urlId: "ev3",
hidden: !0
},
"whats-new": {
steps: [{
video: "mtqymxg0qq"
}],
urlId: "whatsnew",
hidden: !0
}
}
}, function(e, t, A) {
"use strict";
(function(e) {
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var o = A(223),
n = A(871),
i = A(391);
function a() {
return s.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
}
function r(e, t) {
if (a() < t) throw new RangeError("Invalid typed array length");
return s.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = s.prototype : (null === e && (e = new s(t)), e.length = t), e
}
function s(e, t, A) {
if (!(s.TYPED_ARRAY_SUPPORT || this instanceof s)) return new s(e, t, A);
if ("number" == typeof e) {
if ("string" == typeof t) throw new Error("If encoding is specified then the first argument must be a string");
return c(this, e)
}
return l(this, e, t, A)
}
function l(e, t, A, o) {
if ("number" == typeof t) throw new TypeError('"value" argument must not be a number');
return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, A, o) {
if (t.byteLength, A < 0 || t.byteLength < A) throw new RangeError("'offset' is out of bounds");
if (t.byteLength < A + (o || 0)) throw new RangeError("'length' is out of bounds");
t = void 0 === A && void 0 === o ? new Uint8Array(t) : void 0 === o ? new Uint8Array(t, A) : new Uint8Array(t, A, o);
s.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = s.prototype : e = g(e, t);
return e
}(e, t, A, o) : "string" == typeof t ? function(e, t, A) {
"string" == typeof A && "" !== A || (A = "utf8");
if (!s.isEncoding(A)) throw new TypeError('"encoding" must be a valid string encoding');
var o = 0 | h(t, A),
n = (e = r(e, o)).write(t, A);
n !== o && (e = e.slice(0, n));
return e
}(e, t, A) : function(e, t) {
if (s.isBuffer(t)) {
var A = 0 | d(t.length);
return 0 === (e = r(e, A)).length ? e : (t.copy(e, 0, 0, A), e)
}
if (t) {
if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length" in t) return "number" != typeof t.length || function(e) {
return e != e
}(t.length) ? r(e, 0) : g(e, t);
if ("Buffer" === t.type && i(t.data)) return g(e, t.data)
}
throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
}(e, t)
}
function u(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 c(e, t) {
if (u(t), e = r(e, t < 0 ? 0 : 0 | d(t)), !s.TYPED_ARRAY_SUPPORT)
for (var A = 0; A < t; ++A) e[A] = 0;
return e
}
function g(e, t) {
var A = t.length < 0 ? 0 : 0 | d(t.length);
e = r(e, A);
for (var o = 0; o < A; o += 1) e[o] = 255 & t[o];
return e
}
function d(e) {
if (e >= a()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + a().toString(16) + " bytes");
return 0 | e
}
function h(e, t) {
if (s.isBuffer(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 o = !1;;) switch (t) {
case "ascii":
case "latin1":
case "binary":
return A;
case "utf8":
case "utf-8":
case void 0:
return x(e).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return 2 * A;
case "hex":
return A >>> 1;
case "base64":
return _(e).length;
default:
if (o) return x(e).length;
t = ("" + t).toLowerCase(), o = !0
}
}
function m(e, t, A) {
var o = e[t];
e[t] = e[A], e[A] = o
}
function p(e, t, A, o, n) {
if (0 === e.length) return -1;
if ("string" == typeof A ? (o = A, A = 0) : A > 2147483647 ? A = 2147483647 : A < -2147483648 && (A = -2147483648), A = +A, isNaN(A) && (A = n ? 0 : e.length - 1), A < 0 && (A = e.length + A), A >= e.length) {
if (n) return -1;
A = e.length - 1
} else if (A < 0) {
if (!n) return -1;
A = 0
}
if ("string" == typeof t && (t = s.from(t, o)), s.isBuffer(t)) return 0 === t.length ? -1 : E(e, t, A, o, n);
if ("number" == typeof t) return t &= 255, s.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? n ? Uint8Array.prototype.indexOf.call(e, t, A) : Uint8Array.prototype.lastIndexOf.call(e, t, A) : E(e, [t], A, o, n);
throw new TypeError("val must be string, number or Buffer")
}
function E(e, t, A, o, n) {
var i, a = 1,
r = e.length,
s = t.length;
if (void 0 !== o && ("ucs2" === (o = String(o).toLowerCase()) || "ucs-2" === o || "utf16le" === o || "utf-16le" === o)) {
if (e.length < 2 || t.length < 2) return -1;
a = 2, r /= 2, s /= 2, A /= 2
}
function l(e, t) {
return 1 === a ? e[t] : e.readUInt16BE(t * a)
}
if (n) {
var u = -1;
for (i = A; i < r; i++)
if (l(e, i) === l(t, -1 === u ? 0 : i - u)) {
if (-1 === u && (u = i), i - u + 1 === s) return u * a
} else -1 !== u && (i -= i - u), u = -1
} else
for (A + s > r && (A = r - s), i = A; i >= 0; i--) {
for (var c = !0, g = 0; g < s; g++)
if (l(e, i + g) !== l(t, g)) {
c = !1;
break
}
if (c) return i
}
return -1
}
function B(e, t, A, o) {
A = Number(A) || 0;
var n = e.length - A;
o ? (o = Number(o)) > n && (o = n) : o = n;
var i = t.length;
if (i % 2 != 0) throw new TypeError("Invalid hex string");
o > i / 2 && (o = i / 2);
for (var a = 0; a < o; ++a) {
var r = parseInt(t.substr(2 * a, 2), 16);
if (isNaN(r)) return a;
e[A + a] = r
}
return a
}
function f(e, t, A, o) {
return P(x(t, e.length - A), e, A, o)
}
function C(e, t, A, o) {
return P(function(e) {
for (var t = [], A = 0; A < e.length; ++A) t.push(255 & e.charCodeAt(A));
return t
}(t), e, A, o)
}
function w(e, t, A, o) {
return C(e, t, A, o)
}
function I(e, t, A, o) {
return P(_(t), e, A, o)
}
function y(e, t, A, o) {
return P(function(e, t) {
for (var A, o, n, i = [], a = 0; a < e.length && !((t -= 2) < 0); ++a) A = e.charCodeAt(a), o = A >> 8, n = A % 256, i.push(n), i.push(o);
return i
}(t, e.length - A), e, A, o)
}
function b(e, t, A) {
return 0 === t && A === e.length ? o.fromByteArray(e) : o.fromByteArray(e.slice(t, A))
}
function M(e, t, A) {
A = Math.min(e.length, A);
for (var o = [], n = t; n < A;) {
var i, a, r, s, l = e[n],
u = null,
c = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1;
if (n + c <= A) switch (c) {
case 1:
l < 128 && (u = l);
break;
case 2:
128 == (192 & (i = e[n + 1])) && (s = (31 & l) << 6 | 63 & i) > 127 && (u = s);
break;
case 3:
i = e[n + 1], a = e[n + 2], 128 == (192 & i) && 128 == (192 & a) && (s = (15 & l) << 12 | (63 & i) << 6 | 63 & a) > 2047 && (s < 55296 || s > 57343) && (u = s);
break;
case 4:
i = e[n + 1], a = e[n + 2], r = e[n + 3], 128 == (192 & i) && 128 == (192 & a) && 128 == (192 & r) && (s = (15 & l) << 18 | (63 & i) << 12 | (63 & a) << 6 | 63 & r) > 65535 && s < 1114112 && (u = s)
}
null === u ? (u = 65533, c = 1) : u > 65535 && (u -= 65536, o.push(u >>> 10 & 1023 | 55296), u = 56320 | 1023 & u), o.push(u), n += c
}
return function(e) {
var t = e.length;
if (t <= T) return String.fromCharCode.apply(String, e);
var A = "",
o = 0;
for (; o < t;) A += String.fromCharCode.apply(String, e.slice(o, o += T));
return A
}(o)
}
t.Buffer = s, t.SlowBuffer = function(e) {
+e != e && (e = 0);
return s.alloc(+e)
}, t.INSPECT_MAX_BYTES = 50, s.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
try {
var e = new Uint8Array(1);
return e.__proto__ = {
__proto__: Uint8Array.prototype,
foo: function() {
return 42
}
}, 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
} catch (e) {
return !1
}
}(), t.kMaxLength = a(), s.poolSize = 8192, s._augment = function(e) {
return e.__proto__ = s.prototype, e
}, s.from = function(e, t, A) {
return l(null, e, t, A)
}, s.TYPED_ARRAY_SUPPORT && (s.prototype.__proto__ = Uint8Array.prototype, s.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && s[Symbol.species] === s && Object.defineProperty(s, Symbol.species, {
value: null,
configurable: !0
})), s.alloc = function(e, t, A) {
return function(e, t, A, o) {
return u(t), t <= 0 ? r(e, t) : void 0 !== A ? "string" == typeof o ? r(e, t).fill(A, o) : r(e, t).fill(A) : r(e, t)
}(null, e, t, A)
}, s.allocUnsafe = function(e) {
return c(null, e)
}, s.allocUnsafeSlow = function(e) {
return c(null, e)
}, s.isBuffer = function(e) {
return !(null == e || !e._isBuffer)
}, s.compare = function(e, t) {
if (!s.isBuffer(e) || !s.isBuffer(t)) throw new TypeError("Arguments must be Buffers");
if (e === t) return 0;
for (var A = e.length, o = t.length, n = 0, i = Math.min(A, o); n < i; ++n)
if (e[n] !== t[n]) {
A = e[n], o = t[n];
break
}
return A < o ? -1 : o < A ? 1 : 0
}, s.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 !0;
default:
return !1
}
}, s.concat = function(e, t) {
if (!i(e)) throw new TypeError('"list" argument must be an Array of Buffers');
if (0 === e.length) return s.alloc(0);
var A;
if (void 0 === t)
for (t = 0, A = 0; A < e.length; ++A) t += e[A].length;
var o = s.allocUnsafe(t),
n = 0;
for (A = 0; A < e.length; ++A) {
var a = e[A];
if (!s.isBuffer(a)) throw new TypeError('"list" argument must be an Array of Buffers');
a.copy(o, n), n += a.length
}
return o
}, s.byteLength = h, s.prototype._isBuffer = !0, s.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 t = 0; t < e; t += 2) m(this, t, t + 1);
return this
}, s.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 t = 0; t < e; t += 4) m(this, t, t + 3), m(this, t + 1, t + 2);
return this
}, s.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 t = 0; t < e; t += 8) m(this, t, t + 7), m(this, t + 1, t + 6), m(this, t + 2, t + 5), m(this, t + 3, t + 4);
return this
}, s.prototype.toString = function() {
var e = 0 | this.length;
return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : function(e, t, A) {
var o = !1;
if ((void 0 === t || t < 0) && (t = 0), t > this.length) return "";
if ((void 0 === A || A > this.length) && (A = this.length), A <= 0) return "";
if ((A >>>= 0) <= (t >>>= 0)) return "";
for (e || (e = "utf8");;) switch (e) {
case "hex":
return D(this, t, A);
case "utf8":
case "utf-8":
return M(this, t, A);
case "ascii":
return S(this, t, A);
case "latin1":
case "binary":
return Q(this, t, A);
case "base64":
return b(this, t, A);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return k(this, t, A);
default:
if (o) throw new TypeError("Unknown encoding: " + e);
e = (e + "").toLowerCase(), o = !0
}
}.apply(this, arguments)
}, s.prototype.equals = function(e) {
if (!s.isBuffer(e)) throw new TypeError("Argument must be a Buffer");
return this === e || 0 === s.compare(this, e)
}, s.prototype.inspect = function() {
var e = "",
A = t.INSPECT_MAX_BYTES;
return this.length > 0 && (e = this.toString("hex", 0, A).match(/.{2}/g).join(" "), this.length > A && (e += " ... ")), "<Buffer " + e + ">"
}, s.prototype.compare = function(e, t, A, o, n) {
if (!s.isBuffer(e)) throw new TypeError("Argument must be a Buffer");
if (void 0 === t && (t = 0), void 0 === A && (A = e ? e.length : 0), void 0 === o && (o = 0), void 0 === n && (n = this.length), t < 0 || A > e.length || o < 0 || n > this.length) throw new RangeError("out of range index");
if (o >= n && t >= A) return 0;
if (o >= n) return -1;
if (t >= A) return 1;
if (t >>>= 0, A >>>= 0, o >>>= 0, n >>>= 0, this === e) return 0;
for (var i = n - o, a = A - t, r = Math.min(i, a), l = this.slice(o, n), u = e.slice(t, A), c = 0; c < r; ++c)
if (l[c] !== u[c]) {
i = l[c], a = u[c];
break
}
return i < a ? -1 : a < i ? 1 : 0
}, s.prototype.includes = function(e, t, A) {
return -1 !== this.indexOf(e, t, A)
}, s.prototype.indexOf = function(e, t, A) {
return p(this, e, t, A, !0)
}, s.prototype.lastIndexOf = function(e, t, A) {
return p(this, e, t, A, !1)
}, s.prototype.write = function(e, t, A, o) {
if (void 0 === t) o = "utf8", A = this.length, t = 0;
else if (void 0 === A && "string" == typeof t) o = t, A = this.length, t = 0;
else {
if (!isFinite(t)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
t |= 0, isFinite(A) ? (A |= 0, void 0 === o && (o = "utf8")) : (o = A, A = void 0)
}
var n = this.length - t;
if ((void 0 === A || A > n) && (A = n), e.length > 0 && (A < 0 || t < 0) || t > this.length) throw new RangeError("Attempt to write outside buffer bounds");
o || (o = "utf8");
for (var i = !1;;) switch (o) {
case "hex":
return B(this, e, t, A);
case "utf8":
case "utf-8":
return f(this, e, t, A);
case "ascii":
return C(this, e, t, A);
case "latin1":
case "binary":
return w(this, e, t, A);
case "base64":
return I(this, e, t, A);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return y(this, e, t, A);
default:
if (i) throw new TypeError("Unknown encoding: " + o);
o = ("" + o).toLowerCase(), i = !0
}
}, s.prototype.toJSON = function() {
return {
type: "Buffer",
data: Array.prototype.slice.call(this._arr || this, 0)
}
};
var T = 4096;
function S(e, t, A) {
var o = "";
A = Math.min(e.length, A);
for (var n = t; n < A; ++n) o += String.fromCharCode(127 & e[n]);
return o
}
function Q(e, t, A) {
var o = "";
A = Math.min(e.length, A);
for (var n = t; n < A; ++n) o += String.fromCharCode(e[n]);
return o
}
function D(e, t, A) {
var o = e.length;
(!t || t < 0) && (t = 0), (!A || A < 0 || A > o) && (A = o);
for (var n = "", i = t; i < A; ++i) n += G(e[i]);
return n
}
function k(e, t, A) {
for (var o = e.slice(t, A), n = "", i = 0; i < o.length; i += 2) n += String.fromCharCode(o[i] + 256 * o[i + 1]);
return n
}
function N(e, t, A) {
if (e % 1 != 0 || e < 0) throw new RangeError("offset is not uint");
if (e + t > A) throw new RangeError("Trying to access beyond buffer length")
}
function v(e, t, A, o, n, i) {
if (!s.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance');
if (t > n || t < i) throw new RangeError('"value" argument is out of bounds');
if (A + o > e.length) throw new RangeError("Index out of range")
}
function O(e, t, A, o) {
t < 0 && (t = 65535 + t + 1);
for (var n = 0, i = Math.min(e.length - A, 2); n < i; ++n) e[A + n] = (t & 255 << 8 * (o ? n : 1 - n)) >>> 8 * (o ? n : 1 - n)
}
function R(e, t, A, o) {
t < 0 && (t = 4294967295 + t + 1);
for (var n = 0, i = Math.min(e.length - A, 4); n < i; ++n) e[A + n] = t >>> 8 * (o ? n : 3 - n) & 255
}
function F(e, t, A, o, n, i) {
if (A + o > e.length) throw new RangeError("Index out of range");
if (A < 0) throw new RangeError("Index out of range")
}
function Y(e, t, A, o, i) {
return i || F(e, 0, A, 4), n.write(e, t, A, o, 23, 4), A + 4
}
function U(e, t, A, o, i) {
return i || F(e, 0, A, 8), n.write(e, t, A, o, 52, 8), A + 8
}
s.prototype.slice = function(e, t) {
var A, o = this.length;
if (e = ~~e, t = void 0 === t ? o : ~~t, e < 0 ? (e += o) < 0 && (e = 0) : e > o && (e = o), t < 0 ? (t += o) < 0 && (t = 0) : t > o && (t = o), t < e && (t = e), s.TYPED_ARRAY_SUPPORT)(A = this.subarray(e, t)).__proto__ = s.prototype;
else {
var n = t - e;
A = new s(n, void 0);
for (var i = 0; i < n; ++i) A[i] = this[i + e]
}
return A
}, s.prototype.readUIntLE = function(e, t, A) {
e |= 0, t |= 0, A || N(e, t, this.length);
for (var o = this[e], n = 1, i = 0; ++i < t && (n *= 256);) o += this[e + i] * n;
return o
}, s.prototype.readUIntBE = function(e, t, A) {
e |= 0, t |= 0, A || N(e, t, this.length);
for (var o = this[e + --t], n = 1; t > 0 && (n *= 256);) o += this[e + --t] * n;
return o
}, s.prototype.readUInt8 = function(e, t) {
return t || N(e, 1, this.length), this[e]
}, s.prototype.readUInt16LE = function(e, t) {
return t || N(e, 2, this.length), this[e] | this[e + 1] << 8
}, s.prototype.readUInt16BE = function(e, t) {
return t || N(e, 2, this.length), this[e] << 8 | this[e + 1]
}, s.prototype.readUInt32LE = function(e, t) {
return t || N(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
}, s.prototype.readUInt32BE = function(e, t) {
return t || N(e, 4, this.length), 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
}, s.prototype.readIntLE = function(e, t, A) {
e |= 0, t |= 0, A || N(e, t, this.length);
for (var o = this[e], n = 1, i = 0; ++i < t && (n *= 256);) o += this[e + i] * n;
return o >= (n *= 128) && (o -= Math.pow(2, 8 * t)), o
}, s.prototype.readIntBE = function(e, t, A) {
e |= 0, t |= 0, A || N(e, t, this.length);
for (var o = t, n = 1, i = this[e + --o]; o > 0 && (n *= 256);) i += this[e + --o] * n;
return i >= (n *= 128) && (i -= Math.pow(2, 8 * t)), i
}, s.prototype.readInt8 = function(e, t) {
return t || N(e, 1, this.length), 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
}, s.prototype.readInt16LE = function(e, t) {
t || N(e, 2, this.length);
var A = this[e] | this[e + 1] << 8;
return 32768 & A ? 4294901760 | A : A
}, s.prototype.readInt16BE = function(e, t) {
t || N(e, 2, this.length);
var A = this[e + 1] | this[e] << 8;
return 32768 & A ? 4294901760 | A : A
}, s.prototype.readInt32LE = function(e, t) {
return t || N(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
}, s.prototype.readInt32BE = function(e, t) {
return t || N(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
}, s.prototype.readFloatLE = function(e, t) {
return t || N(e, 4, this.length), n.read(this, e, !0, 23, 4)
}, s.prototype.readFloatBE = function(e, t) {
return t || N(e, 4, this.length), n.read(this, e, !1, 23, 4)
}, s.prototype.readDoubleLE = function(e, t) {
return t || N(e, 8, this.length), n.read(this, e, !0, 52, 8)
}, s.prototype.readDoubleBE = function(e, t) {
return t || N(e, 8, this.length), n.read(this, e, !1, 52, 8)
}, s.prototype.writeUIntLE = function(e, t, A, o) {
(e = +e, t |= 0, A |= 0, o) || v(this, e, t, A, Math.pow(2, 8 * A) - 1, 0);
var n = 1,
i = 0;
for (this[t] = 255 & e; ++i < A && (n *= 256);) this[t + i] = e / n & 255;
return t + A
}, s.prototype.writeUIntBE = function(e, t, A, o) {
(e = +e, t |= 0, A |= 0, o) || v(this, e, t, A, Math.pow(2, 8 * A) - 1, 0);
var n = A - 1,
i = 1;
for (this[t + n] = 255 & e; --n >= 0 && (i *= 256);) this[t + n] = e / i & 255;
return t + A
}, s.prototype.writeUInt8 = function(e, t, A) {
return e = +e, t |= 0, A || v(this, e, t, 1, 255, 0), s.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), this[t] = 255 & e, t + 1
}, s.prototype.writeUInt16LE = function(e, t, A) {
return e = +e, t |= 0, A || v(this, e, t, 2, 65535, 0), s.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, this[t + 1] = e >>> 8) : O(this, e, t, !0), t + 2
}, s.prototype.writeUInt16BE = function(e, t, A) {
return e = +e, t |= 0, A || v(this, e, t, 2, 65535, 0), s.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8, this[t + 1] = 255 & e) : O(this, e, t, !1), t + 2
}, s.prototype.writeUInt32LE = function(e, t, A) {
return e = +e, t |= 0, A || v(this, e, t, 4, 4294967295, 0), s.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = 255 & e) : R(this, e, t, !0), t + 4
}, s.prototype.writeUInt32BE = function(e, t, A) {
return e = +e, t |= 0, A || v(this, e, t, 4, 4294967295, 0), s.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = 255 & e) : R(this, e, t, !1), t + 4
}, s.prototype.writeIntLE = function(e, t, A, o) {
if (e = +e, t |= 0, !o) {
var n = Math.pow(2, 8 * A - 1);
v(this, e, t, A, n - 1, -n)
}
var i = 0,
a = 1,
r = 0;
for (this[t] = 255 & e; ++i < A && (a *= 256);) e < 0 && 0 === r && 0 !== this[t + i - 1] && (r = 1), this[t + i] = (e / a >> 0) - r & 255;
return t + A
}, s.prototype.writeIntBE = function(e, t, A, o) {
if (e = +e, t |= 0, !o) {
var n = Math.pow(2, 8 * A - 1);
v(this, e, t, A, n - 1, -n)
}
var i = A - 1,
a = 1,
r = 0;
for (this[t + i] = 255 & e; --i >= 0 && (a *= 256);) e < 0 && 0 === r && 0 !== this[t + i + 1] && (r = 1), this[t + i] = (e / a >> 0) - r & 255;
return t + A
}, s.prototype.writeInt8 = function(e, t, A) {
return e = +e, t |= 0, A || v(this, e, t, 1, 127, -128), s.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), e < 0 && (e = 255 + e + 1), this[t] = 255 & e, t + 1
}, s.prototype.writeInt16LE = function(e, t, A) {
return e = +e, t |= 0, A || v(this, e, t, 2, 32767, -32768), s.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, this[t + 1] = e >>> 8) : O(this, e, t, !0), t + 2
}, s.prototype.writeInt16BE = function(e, t, A) {
return e = +e, t |= 0, A || v(this, e, t, 2, 32767, -32768), s.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8, this[t + 1] = 255 & e) : O(this, e, t, !1), t + 2
}, s.prototype.writeInt32LE = function(e, t, A) {
return e = +e, t |= 0, A || v(this, e, t, 4, 2147483647, -2147483648), s.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24) : R(this, e, t, !0), t + 4
}, s.prototype.writeInt32BE = function(e, t, A) {
return e = +e, t |= 0, A || v(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), s.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = 255 & e) : R(this, e, t, !1), t + 4
}, s.prototype.writeFloatLE = function(e, t, A) {
return Y(this, e, t, !0, A)
}, s.prototype.writeFloatBE = function(e, t, A) {
return Y(this, e, t, !1, A)
}, s.prototype.writeDoubleLE = function(e, t, A) {
return U(this, e, t, !0, A)
}, s.prototype.writeDoubleBE = function(e, t, A) {
return U(this, e, t, !1, A)
}, s.prototype.copy = function(e, t, A, o) {
if (A || (A = 0), o || 0 === o || (o = this.length), t >= e.length && (t = e.length), t || (t = 0), o > 0 && o < A && (o = A), o === A) return 0;
if (0 === e.length || 0 === this.length) return 0;
if (t < 0) throw new RangeError("targetStart out of bounds");
if (A < 0 || A >= this.length) throw new RangeError("sourceStart out of bounds");
if (o < 0) throw new RangeError("sourceEnd out of bounds");
o > this.length && (o = this.length), e.length - t < o - A && (o = e.length - t + A);
var n, i = o - A;
if (this === e && A < t && t < o)
for (n = i - 1; n >= 0; --n) e[n + t] = this[n + A];
else if (i < 1e3 || !s.TYPED_ARRAY_SUPPORT)
for (n = 0; n < i; ++n) e[n + t] = this[n + A];
else Uint8Array.prototype.set.call(e, this.subarray(A, A + i), t);
return i
}, s.prototype.fill = function(e, t, A, o) {
if ("string" == typeof e) {
if ("string" == typeof t ? (o = t, t = 0, A = this.length) : "string" == typeof A && (o = A, A = this.length), 1 === e.length) {
var n = e.charCodeAt(0);
n < 256 && (e = n)
}
if (void 0 !== o && "string" != typeof o) throw new TypeError("encoding must be a string");
if ("string" == typeof o && !s.isEncoding(o)) throw new TypeError("Unknown encoding: " + o)
} else "number" == typeof e && (e &= 255);
if (t < 0 || this.length < t || this.length < A) throw new RangeError("Out of range index");
if (A <= t) return this;
var i;
if (t >>>= 0, A = void 0 === A ? this.length : A >>> 0, e || (e = 0), "number" == typeof e)
for (i = t; i < A; ++i) this[i] = e;
else {
var a = s.isBuffer(e) ? e : x(new s(e, o).toString()),
r = a.length;
for (i = 0; i < A - t; ++i) this[i + t] = a[i % r]
}
return this
};
var L = /[^+\/0-9A-Za-z-_]/g;
function G(e) {
return e < 16 ? "0" + e.toString(16) : e.toString(16)
}
function x(e, t) {
var A;
t = t || 1 / 0;
for (var o = e.length, n = null, i = [], a = 0; a < o; ++a) {
if ((A = e.charCodeAt(a)) > 55295 && A < 57344) {
if (!n) {
if (A > 56319) {
(t -= 3) > -1 && i.push(239, 191, 189);
continue
}
if (a + 1 === o) {
(t -= 3) > -1 && i.push(239, 191, 189);
continue
}
n = A;
continue
}
if (A < 56320) {
(t -= 3) > -1 && i.push(239, 191, 189), n = A;
continue
}
A = 65536 + (n - 55296 << 10 | A - 56320)
} else n && (t -= 3) > -1 && i.push(239, 191, 189);
if (n = null, A < 128) {
if ((t -= 1) < 0) break;
i.push(A)
} else if (A < 2048) {
if ((t -= 2) < 0) break;
i.push(A >> 6 | 192, 63 & A | 128)
} else if (A < 65536) {
if ((t -= 3) < 0) break;
i.push(A >> 12 | 224, A >> 6 & 63 | 128, 63 & A | 128)
} else {
if (!(A < 1114112)) throw new Error("Invalid code point");
if ((t -= 4) < 0) break;
i.push(A >> 18 | 240, A >> 12 & 63 | 128, A >> 6 & 63 | 128, 63 & A | 128)
}
}
return i
}
function _(e) {
return o.toByteArray(function(e) {
if ((e = function(e) {
return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
}(e).replace(L, "")).length < 2) return "";
for (; e.length % 4 != 0;) e += "=";
return e
}(e))
}
function P(e, t, A, o) {
for (var n = 0; n < o && !(n + A >= t.length || n >= e.length); ++n) t[n + A] = e[n];
return n
}
}).call(this, A(45))
}, function(e, t) {
function A(e, t) {
for (var A = 0; A < t.length; A++) {
var o = t[A];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o)
}
}
var o = function() {
function e() {
! function(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e)
}
return function(e, t, o) {
t && A(e.prototype, t), o && A(e, o)
}(e, null, [{
key: "degToRad",
value: function(e) {
return e * Math.PI / 180
}
}, {
key: "radToDeg",
value: function(e) {
return 180 * e / Math.PI
}
}, {
key: "clamp",
value: function(e, t, A) {
return Math.min(Math.max(e, t), A)
}
}, {
key: "wrapClamp",
value: function(e, t, A) {
var o = A - t + 1;
return e - Math.floor((e - t) / o) * o
}
}, {
key: "tan",
value: function(e) {
switch (e %= 360) {
case -270:
case 90:
return 1 / 0;
case -90:
case 270:
return -1 / 0;
default:
return parseFloat(Math.tan(Math.PI * e / 180).toFixed(10))
}
}
}, {
key: "reducedSortOrdering",
value: function(e) {
var t = e.slice(0).sort(function(e, t) {
return e - t
});
return e.map(function(e) {
return t.indexOf(e)
})
}
}]), e
}();
e.exports = o
}, function(e, t) {
var A = e.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")();
"number" == typeof __g && (__g = A)
}, function(e, t, A) {
var o = A(334)("wks"),
n = A(240),
i = A(66).Symbol,
a = "function" == typeof i;
(e.exports = function(e) {
return o[e] || (o[e] = a && i[e] || (a ? i : n)("Symbol." + e))
}).store = o
}, function(e, t, A) {
"use strict";
var o = A(2);
t.a = Object(o.d)({
backdrop: {
id: "gui.sharedMessages.backdrop",
defaultMessage: "backdrop{index}"
},
costume: {
id: "gui.sharedMessages.costume",
defaultMessage: "costume{index}"
},
sprite: {
id: "gui.sharedMessages.sprite",
defaultMessage: "Sprite{index}"
},
pop: {
id: "gui.sharedMessages.pop",
defaultMessage: "pop"
},
replaceProjectWarning: {
id: "gui.sharedMessages.replaceProjectWarning",
defaultMessage: "Replace contents of the current project?"
}
})
}, function(e, t, A) {
"use strict";
var o = A(491),
n = A.n(o),
i = A(492),
a = A.n(i),
r = A(493),
s = A.n(r),
l = A(494),
u = A.n(l),
c = A(495),
g = A.n(c),
d = A(496),
h = A.n(d),
m = A(497),
p = A.n(m),
E = A(498),
B = A.n(E),
f = A(499),
C = A.n(f),
w = A(500),
I = A.n(w),
y = A(501),
b = A.n(y),
M = A(502),
T = A.n(M),
S = A(503),
Q = A.n(S),
D = A(504),
k = A.n(D),
N = A(505),
v = A.n(N),
O = A(506),
R = A.n(O),
F = A(507),
Y = A.n(F),
U = A(508),
L = A.n(U),
G = A(509),
x = A.n(G),
_ = A(510),
P = A.n(_),
H = A(511),
j = A.n(H),
z = A(512),
K = A.n(z),
J = A(513),
V = A.n(J),
W = A(514),
q = A.n(W),
X = A(515),
Z = A.n(X),
$ = A(516),
ee = A.n($),
te = A(517),
Ae = A.n(te),
oe = A(518),
ne = A.n(oe),
ie = A(519),
ae = A.n(ie),
re = A(520),
se = A.n(re),
le = A(521),
ue = A.n(le),
ce = A(522),
ge = A.n(ce),
de = A(523),
he = A.n(de),
me = A(524),
pe = A.n(me),
Ee = A(525),
Be = A.n(Ee),
fe = A(526),
Ce = A.n(fe),
we = A(527),
Ie = A.n(we),
ye = A(528),
be = A.n(ye),
Me = A(529),
Te = A.n(Me),
Se = A(530),
Qe = A.n(Se),
De = A(531),
ke = A.n(De),
Ne = A(532),
ve = A.n(Ne),
Oe = A(533),
Re = A.n(Oe),
Fe = A(534),
Ye = A.n(Fe),
Ue = A(535),
Le = A.n(Ue),
Ge = A(536),
xe = A.n(Ge),
_e = A(537),
Pe = A.n(_e),
He = A(538),
je = A.n(He),
ze = {
ab: {
name: "Аҧсшәа"
},
ar: {
name: "العربية"
},
am: {
name: "አማርኛ"
},
az: {
name: "Azeri"
},
id: {
name: "Bahasa Indonesia"
},
bg: {
name: "български"
},
ca: {
name: "Català"
},
cs: {
name: "Česky"
},
cy: {
name: "Cymraeg"
},
da: {
name: "Dansk"
},
de: {
name: "Deutsch"
},
et: {
name: "Eesti"
},
el: {
name: "Ελληνικά"
},
en: {
name: "English"
},
es: {
name: "Español"
},
"es-419": {
name: "Español Latinoamericano"
},
eu: {
name: "Euskara"
},
fa: {
name: "فارسی"
},
fr: {
name: "Français"
},
ga: {
name: "Gaeilge"
},
gd: {
name: "Gàidhlig"
},
gl: {
name: "Galego"
},
ko: {
name: "한국어"
},
he: {
name: "עִבְרִית"
},
hr: {
name: "Hrvatski"
},
zu: {
name: "isiZulu"
},
is: {
name: "Íslenska"
},
it: {
name: "Italiano"
},
ckb: {
name: "کوردیی ناوەندی"
},
lv: {
name: "Latviešu"
},
lt: {
name: "Lietuvių"
},
hu: {
name: "Magyar"
},
mi: {
name: "Māori"
},
nl: {
name: "Nederlands"
},
ja: {
name: "日本語"
},
"ja-Hira": {
name: "にほんご"
},
nb: {
name: "Norsk Bokmål"
},
nn: {
name: "Norsk Nynorsk"
},
th: {
name: "ไทย"
},
pl: {
name: "Polski"
},
pt: {
name: "Português"
},
"pt-br": {
name: "Português Brasileiro"
},
ro: {
name: "Română"
},
ru: {
name: "Русский"
},
sr: {
name: "Српски"
},
sk: {
name: "Slovenčina"
},
sl: {
name: "Slovenščina"
},
fi: {
name: "Suomi"
},
sv: {
name: "Svenska"
},
vi: {
name: "Tiếng Việt"
},
tr: {
name: "Türkçe"
},
uk: {
name: "Українська"
},
"zh-cn": {
name: "简体中文"
},
"zh-tw": {
name: "繁體中文"
}
},
Ke = {
ab: {
locale: "ab",
parentLocale: "az"
},
"es-419": {
locale: "es-419",
parentLocale: "es"
},
mi: {
locale: "mi",
parentLocale: "en"
},
"zh-cn": {
locale: "zh-cn",
parentLocale: "zh"
},
"zh-tw": {
locale: "zh-tw",
parentLocale: "zh"
}
},
Je = ["ar", "ckb", "fa", "he"],
Ve = function(e) {
return -1 !== Je.indexOf(e)
};
A.d(t, "c", function() {
return We
}), A.d(t, "a", function() {
return ze
}), A.d(t, "b", function() {
return Ve
});
var We = [].concat(n.a, a.a, s.a, u.a, g.a, h.a, p.a, B.a, C.a, I.a, b.a, T.a, Q.a, k.a, v.a, R.a, Y.a, L.a, x.a, P.a, j.a, K.a, V.a, q.a, Z.a, ee.a, Ae.a, ne.a, ae.a, se.a, ue.a, ge.a, he.a, pe.a, Be.a, Ce.a, Te.a, Qe.a, ke.a, ve.a, Ie.a, be.a, Re.a, Ye.a, Le.a, xe.a, Pe.a, je.a);
for (var qe in Ke) We.push(Ke[qe])
}, function(e, t, A) {
var o = A(1237);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
var o = A(849),
n = o.enable,
i = o.disable,
a = "undefined" != typeof navigator && /chrome/i.test(navigator.userAgent),
r = A(852);
if (o.defaultBackend = a ? r.minilog : r, "undefined" != typeof window) {
try {
o.enable(JSON.parse(window.localStorage.minilogSettings))
} catch (e) {}
if (window.location && window.location.search) {
var s = RegExp("[?&]minilog=([^&]*)").exec(window.location.search);
s && o.enable(decodeURIComponent(s[1]))
}
}
o.enable = function() {
n.call(o, !0);
try {
window.localStorage.minilogSettings = JSON.stringify(!0)
} catch (e) {}
return this
}, o.disable = function() {
i.call(o);
try {
delete window.localStorage.minilogSettings
} catch (e) {}
return this
}, (e.exports = o).backends = {
array: A(855),
browser: o.defaultBackend,
localStorage: A(856),
jQuery: A(857)
}
}, function(e, t, A) {
"use strict";
A.d(t, "a", function() {
return n
}), A.d(t, "b", function() {
return o
}), A.d(t, "c", function() {
return i
}), A.d(t, "d", function() {
return a
});
var o = {
showBranding: !1,
isFullScreen: !1,
isPlayerOnly: !1,
hasEverEnteredEditor: !0
},
n = function(e, t) {
switch (void 0 === e && (e = o), t.type) {
case "scratch-gui/mode/SET_FULL_SCREEN":
return Object.assign({}, e, {
isFullScreen: t.isFullScreen
});
case "scratch-gui/mode/SET_PLAYER":
return Object.assign({}, e, {
isPlayerOnly: t.isPlayerOnly,
hasEverEnteredEditor: e.hasEverEnteredEditor || !t.isPlayerOnly
});
default:
return e
}
},
i = function(e) {
return {
type: "scratch-gui/mode/SET_FULL_SCREEN",
isFullScreen: e
}
},
a = function(e) {
return {
type: "scratch-gui/mode/SET_PLAYER",
isPlayerOnly: e
}
}
}, function(e, t, A) {
e.exports = function() {
"use strict";
var e = Array.prototype.slice;
function t(e, t) {
t && (e.prototype = Object.create(t.prototype)), e.prototype.constructor = e
}
function A(e) {
return a(e) ? e : K(e)
}
function o(e) {
return r(e) ? e : J(e)
}
function n(e) {
return s(e) ? e : V(e)
}
function i(e) {
return a(e) && !l(e) ? e : W(e)
}
function a(e) {
return !(!e || !e[c])
}
function r(e) {
return !(!e || !e[g])
}
function s(e) {
return !(!e || !e[d])
}
function l(e) {
return r(e) || s(e)
}
function u(e) {
return !(!e || !e[h])
}
t(o, A), t(n, A), t(i, A), A.isIterable = a, A.isKeyed = r, A.isIndexed = s, A.isAssociative = l, A.isOrdered = u, A.Keyed = o, A.Indexed = n, A.Set = i;
var c = "@@__IMMUTABLE_ITERABLE__@@",
g = "@@__IMMUTABLE_KEYED__@@",
d = "@@__IMMUTABLE_INDEXED__@@",
h = "@@__IMMUTABLE_ORDERED__@@",
m = 5,
p = 1 << m,
E = p - 1,
B = {},
f = {
value: !1
},
C = {
value: !1
};
function w(e) {
return e.value = !1, e
}
function I(e) {
e && (e.value = !0)
}
function y() {}
function b(e, t) {
t = t || 0;
for (var A = Math.max(0, e.length - t), o = new Array(A), n = 0; n < A; n++) o[n] = e[n + t];
return o
}
function M(e) {
return void 0 === e.size && (e.size = e.__iterate(S)), e.size
}
function T(e, t) {
if ("number" != typeof t) {
var A = t >>> 0;
if ("" + A !== t || 4294967295 === A) return NaN;
t = A
}
return t < 0 ? M(e) + t : t
}
function S() {
return !0
}
function Q(e, t, A) {
return (0 === e || void 0 !== A && e <= -A) && (void 0 === t || void 0 !== A && t >= A)
}
function D(e, t) {
return N(e, t, 0)
}
function k(e, t) {
return N(e, t, t)
}
function N(e, t, A) {
return void 0 === e ? A : e < 0 ? Math.max(0, t + e) : void 0 === t ? e : Math.min(t, e)
}
var v = 0,
O = 1,
R = 2,
F = "function" == typeof Symbol && Symbol.iterator,
Y = "@@iterator",
U = F || Y;
function L(e) {
this.next = e
}
function G(e, t, A, o) {
var n = 0 === e ? t : 1 === e ? A : [t, A];
return o ? o.value = n : o = {
value: n,
done: !1
}, o
}
function x() {
return {
value: void 0,
done: !0
}
}
function _(e) {
return !!j(e)
}
function P(e) {
return e && "function" == typeof e.next
}
function H(e) {
var t = j(e);
return t && t.call(e)
}
function j(e) {
var t = e && (F && e[F] || e[Y]);
if ("function" == typeof t) return t
}
function z(e) {
return e && "number" == typeof e.length
}
function K(e) {
return null === e || void 0 === e ? ie() : a(e) ? e.toSeq() : function(e) {
var t = se(e) || "object" == typeof e && new te(e);
if (!t) throw new TypeError("Expected Array or iterable object of values, or keyed object: " + e);
return t
}(e)
}
function J(e) {
return null === e || void 0 === e ? ie().toKeyedSeq() : a(e) ? r(e) ? e.toSeq() : e.fromEntrySeq() : ae(e)
}
function V(e) {
return null === e || void 0 === e ? ie() : a(e) ? r(e) ? e.entrySeq() : e.toIndexedSeq() : re(e)
}
function W(e) {
return (null === e || void 0 === e ? ie() : a(e) ? r(e) ? e.entrySeq() : e : re(e)).toSetSeq()
}
L.prototype.toString = function() {
return "[Iterator]"
}, L.KEYS = v, L.VALUES = O, L.ENTRIES = R, L.prototype.inspect = L.prototype.toSource = function() {
return this.toString()
}, L.prototype[U] = function() {
return this
}, t(K, A), K.of = function() {
return K(arguments)
}, K.prototype.toSeq = function() {
return this
}, K.prototype.toString = function() {
return this.__toString("Seq {", "}")
}, K.prototype.cacheResult = function() {
return !this._cache && this.__iterateUncached && (this._cache = this.entrySeq().toArray(), this.size = this._cache.length), this
}, K.prototype.__iterate = function(e, t) {
return le(this, e, t, !0)
}, K.prototype.__iterator = function(e, t) {
return ue(this, e, t, !0)
}, t(J, K), J.prototype.toKeyedSeq = function() {
return this
}, t(V, K), V.of = function() {
return V(arguments)
}, V.prototype.toIndexedSeq = function() {
return this
}, V.prototype.toString = function() {
return this.__toString("Seq [", "]")
}, V.prototype.__iterate = function(e, t) {
return le(this, e, t, !1)
}, V.prototype.__iterator = function(e, t) {
return ue(this, e, t, !1)
}, t(W, K), W.of = function() {
return W(arguments)
}, W.prototype.toSetSeq = function() {
return this
}, K.isSeq = ne, K.Keyed = J, K.Set = W, K.Indexed = V;
var q, X, Z, $ = "@@__IMMUTABLE_SEQ__@@";
function ee(e) {
this._array = e, this.size = e.length
}
function te(e) {
var t = Object.keys(e);
this._object = e, this._keys = t, this.size = t.length
}
function Ae(e) {
this._iterable = e, this.size = e.length || e.size
}
function oe(e) {
this._iterator = e, this._iteratorCache = []
}
function ne(e) {
return !(!e || !e[$])
}
function ie() {
return q || (q = new ee([]))
}
function ae(e) {
var t = Array.isArray(e) ? new ee(e).fromEntrySeq() : P(e) ? new oe(e).fromEntrySeq() : _(e) ? new Ae(e).fromEntrySeq() : "object" == typeof e ? new te(e) : void 0;
if (!t) throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: " + e);
return t
}
function re(e) {
var t = se(e);
if (!t) throw new TypeError("Expected Array or iterable object of values: " + e);
return t
}
function se(e) {
return z(e) ? new ee(e) : P(e) ? new oe(e) : _(e) ? new Ae(e) : void 0
}
function le(e, t, A, o) {
var n = e._cache;
if (n) {
for (var i = n.length - 1, a = 0; a <= i; a++) {
var r = n[A ? i - a : a];
if (!1 === t(r[1], o ? r[0] : a, e)) return a + 1
}
return a
}
return e.__iterateUncached(t, A)
}
function ue(e, t, A, o) {
var n = e._cache;
if (n) {
var i = n.length - 1,
a = 0;
return new L(function() {
var e = n[A ? i - a : a];
return a++ > i ? {
value: void 0,
done: !0
} : G(t, o ? e[0] : a - 1, e[1])
})
}
return e.__iteratorUncached(t, A)
}
function ce(e, t) {
return t ? function e(t, A, o, n) {
return Array.isArray(A) ? t.call(n, o, V(A).map(function(o, n) {
return e(t, o, n, A)
})) : de(A) ? t.call(n, o, J(A).map(function(o, n) {
return e(t, o, n, A)
})) : A
}(t, e, "", {
"": e
}) : ge(e)
}
function ge(e) {
return Array.isArray(e) ? V(e).map(ge).toList() : de(e) ? J(e).map(ge).toMap() : e
}
function de(e) {
return e && (e.constructor === Object || void 0 === e.constructor)
}
function he(e, t) {
if (e === t || e != e && t != t) return !0;
if (!e || !t) return !1;
if ("function" == typeof e.valueOf && "function" == typeof t.valueOf) {
if (e = e.valueOf(), t = t.valueOf(), e === t || e != e && t != t) return !0;
if (!e || !t) return !1
}
return !("function" != typeof e.equals || "function" != typeof t.equals || !e.equals(t))
}
function me(e, t) {
if (e === t) return !0;
if (!a(t) || void 0 !== e.size && void 0 !== t.size && e.size !== t.size || void 0 !== e.__hash && void 0 !== t.__hash && e.__hash !== t.__hash || r(e) !== r(t) || s(e) !== s(t) || u(e) !== u(t)) return !1;
if (0 === e.size && 0 === t.size) return !0;
var A = !l(e);
if (u(e)) {
var o = e.entries();
return t.every(function(e, t) {
var n = o.next().value;
return n && he(n[1], e) && (A || he(n[0], t))
}) && o.next().done
}
var n = !1;
if (void 0 === e.size)
if (void 0 === t.size) "function" == typeof e.cacheResult && e.cacheResult();
else {
n = !0;
var i = e;
e = t, t = i
}
var c = !0,
g = t.__iterate(function(t, o) {
if (A ? !e.has(t) : n ? !he(t, e.get(o, B)) : !he(e.get(o, B), t)) return c = !1, !1
});
return c && e.size === g
}
function pe(e, t) {
if (!(this instanceof pe)) return new pe(e, t);
if (this._value = e, this.size = void 0 === t ? 1 / 0 : Math.max(0, t), 0 === this.size) {
if (X) return X;
X = this
}
}
function Ee(e, t) {
if (!e) throw new Error(t)
}
function Be(e, t, A) {
if (!(this instanceof Be)) return new Be(e, t, A);
if (Ee(0 !== A, "Cannot step a Range by 0"), e = e || 0, void 0 === t && (t = 1 / 0), A = void 0 === A ? 1 : Math.abs(A), t < e && (A = -A), this._start = e, this._end = t, this._step = A, this.size = Math.max(0, Math.ceil((t - e) / A - 1) + 1), 0 === this.size) {
if (Z) return Z;
Z = this
}
}
function fe() {
throw TypeError("Abstract")
}
function Ce() {}
function we() {}
function Ie() {}
K.prototype[$] = !0, t(ee, V), ee.prototype.get = function(e, t) {
return this.has(e) ? this._array[T(this, e)] : t
}, ee.prototype.__iterate = function(e, t) {
for (var A = this._array, o = A.length - 1, n = 0; n <= o; n++)
if (!1 === e(A[t ? o - n : n], n, this)) return n + 1;
return n
}, ee.prototype.__iterator = function(e, t) {
var A = this._array,
o = A.length - 1,
n = 0;
return new L(function() {
return n > o ? {
value: void 0,
done: !0
} : G(e, n, A[t ? o - n++ : n++])
})
}, t(te, J), te.prototype.get = function(e, t) {
return void 0 === t || this.has(e) ? this._object[e] : t
}, te.prototype.has = function(e) {
return this._object.hasOwnProperty(e)
}, te.prototype.__iterate = function(e, t) {
for (var A = this._object, o = this._keys, n = o.length - 1, i = 0; i <= n; i++) {
var a = o[t ? n - i : i];
if (!1 === e(A[a], a, this)) return i + 1
}
return i
}, te.prototype.__iterator = function(e, t) {
var A = this._object,
o = this._keys,
n = o.length - 1,
i = 0;
return new L(function() {
var a = o[t ? n - i : i];
return i++ > n ? {
value: void 0,
done: !0
} : G(e, a, A[a])
})
}, te.prototype[h] = !0, t(Ae, V), Ae.prototype.__iterateUncached = function(e, t) {
if (t) return this.cacheResult().__iterate(e, t);
var A = this._iterable,
o = H(A),
n = 0;
if (P(o))
for (var i; !(i = o.next()).done && !1 !== e(i.value, n++, this););
return n
}, Ae.prototype.__iteratorUncached = function(e, t) {
if (t) return this.cacheResult().__iterator(e, t);
var A = this._iterable,
o = H(A);
if (!P(o)) return new L(x);
var n = 0;
return new L(function() {
var t = o.next();
return t.done ? t : G(e, n++, t.value)
})
}, t(oe, V), oe.prototype.__iterateUncached = function(e, t) {
if (t) return this.cacheResult().__iterate(e, t);
for (var A, o = this._iterator, n = this._iteratorCache, i = 0; i < n.length;)
if (!1 === e(n[i], i++, this)) return i;
for (; !(A = o.next()).done;) {
var a = A.value;
if (n[i] = a, !1 === e(a, i++, this)) break
}
return i
}, oe.prototype.__iteratorUncached = function(e, t) {
if (t) return this.cacheResult().__iterator(e, t);
var A = this._iterator,
o = this._iteratorCache,
n = 0;
return new L(function() {
if (n >= o.length) {
var t = A.next();
if (t.done) return t;
o[n] = t.value
}
return G(e, n, o[n++])
})
}, t(pe, V), pe.prototype.toString = function() {
return 0 === this.size ? "Repeat []" : "Repeat [ " + this._value + " " + this.size + " times ]"
}, pe.prototype.get = function(e, t) {
return this.has(e) ? this._value : t
}, pe.prototype.includes = function(e) {
return he(this._value, e)
}, pe.prototype.slice = function(e, t) {
var A = this.size;
return Q(e, t, A) ? this : new pe(this._value, k(t, A) - D(e, A))
}, pe.prototype.reverse = function() {
return this
}, pe.prototype.indexOf = function(e) {
return he(this._value, e) ? 0 : -1
}, pe.prototype.lastIndexOf = function(e) {
return he(this._value, e) ? this.size : -1
}, pe.prototype.__iterate = function(e, t) {
for (var A = 0; A < this.size; A++)
if (!1 === e(this._value, A, this)) return A + 1;
return A
}, pe.prototype.__iterator = function(e, t) {
var A = this,
o = 0;
return new L(function() {
return o < A.size ? G(e, o++, A._value) : {
value: void 0,
done: !0
}
})
}, pe.prototype.equals = function(e) {
return e instanceof pe ? he(this._value, e._value) : me(e)
}, t(Be, V), Be.prototype.toString = function() {
return 0 === this.size ? "Range []" : "Range [ " + this._start + "..." + this._end + (1 !== this._step ? " by " + this._step : "") + " ]"
}, Be.prototype.get = function(e, t) {
return this.has(e) ? this._start + T(this, e) * this._step : t
}, Be.prototype.includes = function(e) {
var t = (e - this._start) / this._step;
return t >= 0 && t < this.size && t === Math.floor(t)
}, Be.prototype.slice = function(e, t) {
return Q(e, t, this.size) ? this : (e = D(e, this.size), (t = k(t, this.size)) <= e ? new Be(0, 0) : new Be(this.get(e, this._end), this.get(t, this._end), this._step))
}, Be.prototype.indexOf = function(e) {
var t = e - this._start;
if (t % this._step == 0) {
var A = t / this._step;
if (A >= 0 && A < this.size) return A
}
return -1
}, Be.prototype.lastIndexOf = function(e) {
return this.indexOf(e)
}, Be.prototype.__iterate = function(e, t) {
for (var A = this.size - 1, o = this._step, n = t ? this._start + A * o : this._start, i = 0; i <= A; i++) {
if (!1 === e(n, i, this)) return i + 1;
n += t ? -o : o
}
return i
}, Be.prototype.__iterator = function(e, t) {
var A = this.size - 1,
o = this._step,
n = t ? this._start + A * o : this._start,
i = 0;
return new L(function() {
var a = n;
return n += t ? -o : o, i > A ? {
value: void 0,
done: !0
} : G(e, i++, a)
})
}, Be.prototype.equals = function(e) {
return e instanceof Be ? this._start === e._start && this._end === e._end && this._step === e._step : me(this, e)
}, t(fe, A), t(Ce, fe), t(we, fe), t(Ie, fe), fe.Keyed = Ce, fe.Indexed = we, fe.Set = Ie;
var ye = "function" == typeof Math.imul && -2 === Math.imul(4294967295, 2) ? Math.imul : function(e, t) {
var A = 65535 & (e |= 0),
o = 65535 & (t |= 0);
return A * o + ((e >>> 16) * o + A * (t >>> 16) << 16 >>> 0) | 0
};
function be(e) {
return e >>> 1 & 1073741824 | 3221225471 & e
}
function Me(e) {
if (!1 === e || null === e || void 0 === e) return 0;
if ("function" == typeof e.valueOf && (!1 === (e = e.valueOf()) || null === e || void 0 === e)) return 0;
if (!0 === e) return 1;
var t = typeof e;
if ("number" === t) {
if (e != e || e === 1 / 0) return 0;
var A = 0 | e;
for (A !== e && (A ^= 4294967295 * e); e > 4294967295;) A ^= e /= 4294967295;
return be(A)
}
if ("string" === t) return e.length > Oe ? function(e) {
var t = Ye[e];
return void 0 === t && (t = Te(e), Fe === Re && (Fe = 0, Ye = {}), Fe++, Ye[e] = t), t
}(e) : Te(e);
if ("function" == typeof e.hashCode) return e.hashCode();
if ("object" === t) return function(e) {
var t;
if (ke && void 0 !== (t = Se.get(e))) return t;
if (void 0 !== (t = e[ve])) return t;
if (!De) {
if (void 0 !== (t = e.propertyIsEnumerable && e.propertyIsEnumerable[ve])) return t;
if (void 0 !== (t = function(e) {
if (e && e.nodeType > 0) switch (e.nodeType) {
case 1:
return e.uniqueID;
case 9:
return e.documentElement && e.documentElement.uniqueID
}
}(e))) return t
}
if (t = ++Ne, 1073741824 & Ne && (Ne = 0), ke) Se.set(e, t);
else {
if (void 0 !== Qe && !1 === Qe(e)) throw new Error("Non-extensible objects are not allowed as keys.");
if (De) Object.defineProperty(e, ve, {
enumerable: !1,
configurable: !1,
writable: !1,
value: t
});
else if (void 0 !== e.propertyIsEnumerable && e.propertyIsEnumerable === e.constructor.prototype.propertyIsEnumerable) e.propertyIsEnumerable = function() {
return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments)
}, e.propertyIsEnumerable[ve] = t;
else {
if (void 0 === e.nodeType) throw new Error("Unable to set a non-enumerable property on object.");
e[ve] = t
}
}
return t
}(e);
if ("function" == typeof e.toString) return Te(e.toString());
throw new Error("Value type " + t + " cannot be hashed.")
}
function Te(e) {
for (var t = 0, A = 0; A < e.length; A++) t = 31 * t + e.charCodeAt(A) | 0;
return be(t)
}
var Se, Qe = Object.isExtensible,
De = function() {
try {
return Object.defineProperty({}, "@", {}), !0
} catch (e) {
return !1
}
}(),
ke = "function" == typeof WeakMap;
ke && (Se = new WeakMap);
var Ne = 0,
ve = "__immutablehash__";
"function" == typeof Symbol && (ve = Symbol(ve));
var Oe = 16,
Re = 255,
Fe = 0,
Ye = {};
function Ue(e) {
Ee(e !== 1 / 0, "Cannot perform this action with an infinite size.")
}
function Le(e) {
return null === e || void 0 === e ? Ze() : Ge(e) && !u(e) ? e : Ze().withMutations(function(t) {
var A = o(e);
Ue(A.size), A.forEach(function(e, A) {
return t.set(A, e)
})
})
}
function Ge(e) {
return !(!e || !e[_e])
}
t(Le, Ce), Le.of = function() {
var t = e.call(arguments, 0);
return Ze().withMutations(function(e) {
for (var A = 0; A < t.length; A += 2) {
if (A + 1 >= t.length) throw new Error("Missing value for key: " + t[A]);
e.set(t[A], t[A + 1])
}
})
}, Le.prototype.toString = function() {
return this.__toString("Map {", "}")
}, Le.prototype.get = function(e, t) {
return this._root ? this._root.get(0, void 0, e, t) : t
}, Le.prototype.set = function(e, t) {
return $e(this, e, t)
}, Le.prototype.setIn = function(e, t) {
return this.updateIn(e, B, function() {
return t
})
}, Le.prototype.remove = function(e) {
return $e(this, e, B)
}, Le.prototype.deleteIn = function(e) {
return this.updateIn(e, function() {
return B
})
}, Le.prototype.update = function(e, t, A) {
return 1 === arguments.length ? e(this) : this.updateIn([e], t, A)
}, Le.prototype.updateIn = function(e, t, A) {
A || (A = t, t = void 0);
var o = function e(t, A, o, n) {
var i = t === B,
a = A.next();
if (a.done) {
var r = i ? o : t,
s = n(r);
return s === r ? t : s
}
Ee(i || t && t.set, "invalid keyPath");
var l = a.value,
u = i ? B : t.get(l, B),
c = e(u, A, o, n);
return c === u ? t : c === B ? t.remove(l) : (i ? Ze() : t).set(l, c)
}(this, AA(e), t, A);
return o === B ? void 0 : o
}, Le.prototype.clear = function() {
return 0 === this.size ? this : this.__ownerID ? (this.size = 0, this._root = null, this.__hash = void 0, this.__altered = !0, this) : Ze()
}, Le.prototype.merge = function() {
return ot(this, void 0, arguments)
}, Le.prototype.mergeWith = function(t) {
var A = e.call(arguments, 1);
return ot(this, t, A)
}, Le.prototype.mergeIn = function(t) {
var A = e.call(arguments, 1);
return this.updateIn(t, Ze(), function(e) {
return "function" == typeof e.merge ? e.merge.apply(e, A) : A[A.length - 1]
})
}, Le.prototype.mergeDeep = function() {
return ot(this, nt, arguments)
}, Le.prototype.mergeDeepWith = function(t) {
var A = e.call(arguments, 1);
return ot(this, it(t), A)
}, Le.prototype.mergeDeepIn = function(t) {
var A = e.call(arguments, 1);
return this.updateIn(t, Ze(), function(e) {
return "function" == typeof e.mergeDeep ? e.mergeDeep.apply(e, A) : A[A.length - 1]
})
}, Le.prototype.sort = function(e) {
return Dt(zt(this, e))
}, Le.prototype.sortBy = function(e, t) {
return Dt(zt(this, t, e))
}, Le.prototype.withMutations = function(e) {
var t = this.asMutable();
return e(t), t.wasAltered() ? t.__ensureOwner(this.__ownerID) : this
}, Le.prototype.asMutable = function() {
return this.__ownerID ? this : this.__ensureOwner(new y)
}, Le.prototype.asImmutable = function() {
return this.__ensureOwner()
}, Le.prototype.wasAltered = function() {
return this.__altered
}, Le.prototype.__iterator = function(e, t) {
return new Ve(this, e, t)
}, Le.prototype.__iterate = function(e, t) {
var A = this,
o = 0;
return this._root && this._root.iterate(function(t) {
return o++, e(t[1], t[0], A)
}, t), o
}, Le.prototype.__ensureOwner = function(e) {
return e === this.__ownerID ? this : e ? Xe(this.size, this._root, e, this.__hash) : (this.__ownerID = e, this.__altered = !1, this)
}, Le.isMap = Ge;
var xe, _e = "@@__IMMUTABLE_MAP__@@",
Pe = Le.prototype;
function He(e, t) {
this.ownerID = e, this.entries = t
}
function je(e, t, A) {
this.ownerID = e, this.bitmap = t, this.nodes = A
}
function ze(e, t, A) {
this.ownerID = e, this.count = t, this.nodes = A
}
function Ke(e, t, A) {
this.ownerID = e, this.keyHash = t, this.entries = A
}
function Je(e, t, A) {
this.ownerID = e, this.keyHash = t, this.entry = A
}
function Ve(e, t, A) {
this._type = t, this._reverse = A, this._stack = e._root && qe(e._root)
}
function We(e, t) {
return G(e, t[0], t[1])
}
function qe(e, t) {
return {
node: e,
index: 0,
__prev: t
}
}
function Xe(e, t, A, o) {
var n = Object.create(Pe);
return n.size = e, n._root = t, n.__ownerID = A, n.__hash = o, n.__altered = !1, n
}
function Ze() {
return xe || (xe = Xe(0))
}
function $e(e, t, A) {
var o, n;
if (e._root) {
var i = w(f),
a = w(C);
if (o = et(e._root, e.__ownerID, 0, void 0, t, A, i, a), !a.value) return e;
n = e.size + (i.value ? A === B ? -1 : 1 : 0)
} else {
if (A === B) return e;
n = 1, o = new He(e.__ownerID, [
[t, A]
])
}
return e.__ownerID ? (e.size = n, e._root = o, e.__hash = void 0, e.__altered = !0, e) : o ? Xe(n, o) : Ze()
}
function et(e, t, A, o, n, i, a, r) {
return e ? e.update(t, A, o, n, i, a, r) : i === B ? e : (I(r), I(a), new Je(t, o, [n, i]))
}
function tt(e) {
return e.constructor === Je || e.constructor === Ke
}
function At(e, t, A, o, n) {
if (e.keyHash === o) return new Ke(t, o, [e.entry, n]);
var i, a = (0 === A ? e.keyHash : e.keyHash >>> A) & E,
r = (0 === A ? o : o >>> A) & E,
s = a === r ? [At(e, t, A + m, o, n)] : (i = new Je(t, o, n), a < r ? [e, i] : [i, e]);
return new je(t, 1 << a | 1 << r, s)
}
function ot(e, t, A) {
for (var n = [], i = 0; i < A.length; i++) {
var r = A[i],
s = o(r);
a(r) || (s = s.map(function(e) {
return ce(e)
})), n.push(s)
}
return at(e, t, n)
}
function nt(e, t, A) {
return e && e.mergeDeep && a(t) ? e.mergeDeep(t) : he(e, t) ? e : t
}
function it(e) {
return function(t, A, o) {
if (t && t.mergeDeepWith && a(A)) return t.mergeDeepWith(e, A);
var n = e(t, A, o);
return he(t, n) ? t : n
}
}
function at(e, t, A) {
return 0 === (A = A.filter(function(e) {
return 0 !== e.size
})).length ? e : 0 !== e.size || e.__ownerID || 1 !== A.length ? e.withMutations(function(e) {
for (var o = t ? function(A, o) {
e.update(o, B, function(e) {
return e === B ? A : t(e, A, o)
})
} : function(t, A) {
e.set(A, t)
}, n = 0; n < A.length; n++) A[n].forEach(o)
}) : e.constructor(A[0])
}
function rt(e) {
return e = (e = (858993459 & (e -= e >> 1 & 1431655765)) + (e >> 2 & 858993459)) + (e >> 4) & 252645135, e += e >> 8, 127 & (e += e >> 16)
}
function st(e, t, A, o) {
var n = o ? e : b(e);
return n[t] = A, n
}
Pe[_e] = !0, Pe.delete = Pe.remove, Pe.removeIn = Pe.deleteIn, He.prototype.get = function(e, t, A, o) {
for (var n = this.entries, i = 0, a = n.length; i < a; i++)
if (he(A, n[i][0])) return n[i][1];
return o
}, He.prototype.update = function(e, t, A, o, n, i, a) {
for (var r = n === B, s = this.entries, l = 0, u = s.length; l < u && !he(o, s[l][0]); l++);
var c = l < u;
if (c ? s[l][1] === n : r) return this;
if (I(a), (r || !c) && I(i), !r || 1 !== s.length) {
if (!c && !r && s.length >= lt) return function(e, t, A, o) {
e || (e = new y);
for (var n = new Je(e, Me(A), [A, o]), i = 0; i < t.length; i++) {
var a = t[i];
n = n.update(e, 0, void 0, a[0], a[1])
}
return n
}(e, s, o, n);
var g = e && e === this.ownerID,
d = g ? s : b(s);
return c ? r ? l === u - 1 ? d.pop() : d[l] = d.pop() : d[l] = [o, n] : d.push([o, n]), g ? (this.entries = d, this) : new He(e, d)
}
}, je.prototype.get = function(e, t, A, o) {
void 0 === t && (t = Me(A));
var n = 1 << ((0 === e ? t : t >>> e) & E),
i = this.bitmap;
return 0 == (i & n) ? o : this.nodes[rt(i & n - 1)].get(e + m, t, A, o)
}, je.prototype.update = function(e, t, A, o, n, i, a) {
void 0 === A && (A = Me(o));
var r = (0 === t ? A : A >>> t) & E,
s = 1 << r,
l = this.bitmap,
u = 0 != (l & s);
if (!u && n === B) return this;
var c = rt(l & s - 1),
g = this.nodes,
d = u ? g[c] : void 0,
h = et(d, e, t + m, A, o, n, i, a);
if (h === d) return this;
if (!u && h && g.length >= ut) return function(e, t, A, o, n) {
for (var i = 0, a = new Array(p), r = 0; 0 !== A; r++, A >>>= 1) a[r] = 1 & A ? t[i++] : void 0;
return a[o] = n, new ze(e, i + 1, a)
}(e, g, l, r, h);
if (u && !h && 2 === g.length && tt(g[1 ^ c])) return g[1 ^ c];
if (u && h && 1 === g.length && tt(h)) return h;
var f = e && e === this.ownerID,
C = u ? h ? l : l ^ s : l | s,
w = u ? h ? st(g, c, h, f) : function(e, t, A) {
var o = e.length - 1;
if (A && t === o) return e.pop(), e;
for (var n = new Array(o), i = 0, a = 0; a < o; a++) a === t && (i = 1), n[a] = e[a + i];
return n
}(g, c, f) : function(e, t, A, o) {
var n = e.length + 1;
if (o && t + 1 === n) return e[t] = A, e;
for (var i = new Array(n), a = 0, r = 0; r < n; r++) r === t ? (i[r] = A, a = -1) : i[r] = e[r + a];
return i
}(g, c, h, f);
return f ? (this.bitmap = C, this.nodes = w, this) : new je(e, C, w)
}, ze.prototype.get = function(e, t, A, o) {
void 0 === t && (t = Me(A));
var n = (0 === e ? t : t >>> e) & E,
i = this.nodes[n];
return i ? i.get(e + m, t, A, o) : o
}, ze.prototype.update = function(e, t, A, o, n, i, a) {
void 0 === A && (A = Me(o));
var r = (0 === t ? A : A >>> t) & E,
s = n === B,
l = this.nodes,
u = l[r];
if (s && !u) return this;
var c = et(u, e, t + m, A, o, n, i, a);
if (c === u) return this;
var g = this.count;
if (u) {
if (!c && --g < ct) return function(e, t, A, o) {
for (var n = 0, i = 0, a = new Array(A), r = 0, s = 1, l = t.length; r < l; r++, s <<= 1) {
var u = t[r];
void 0 !== u && r !== o && (n |= s, a[i++] = u)
}
return new je(e, n, a)
}(e, l, g, r)
} else g++;
var d = e && e === this.ownerID,
h = st(l, r, c, d);
return d ? (this.count = g, this.nodes = h, this) : new ze(e, g, h)
}, Ke.prototype.get = function(e, t, A, o) {
for (var n = this.entries, i = 0, a = n.length; i < a; i++)
if (he(A, n[i][0])) return n[i][1];
return o
}, Ke.prototype.update = function(e, t, A, o, n, i, a) {
void 0 === A && (A = Me(o));
var r = n === B;
if (A !== this.keyHash) return r ? this : (I(a), I(i), At(this, e, t, A, [o, n]));
for (var s = this.entries, l = 0, u = s.length; l < u && !he(o, s[l][0]); l++);
var c = l < u;
if (c ? s[l][1] === n : r) return this;
if (I(a), (r || !c) && I(i), r && 2 === u) return new Je(e, this.keyHash, s[1 ^ l]);
var g = e && e === this.ownerID,
d = g ? s : b(s);
return c ? r ? l === u - 1 ? d.pop() : d[l] = d.pop() : d[l] = [o, n] : d.push([o, n]), g ? (this.entries = d, this) : new Ke(e, this.keyHash, d)
}, Je.prototype.get = function(e, t, A, o) {
return he(A, this.entry[0]) ? this.entry[1] : o
}, Je.prototype.update = function(e, t, A, o, n, i, a) {
var r = n === B,
s = he(o, this.entry[0]);
return (s ? n === this.entry[1] : r) ? this : (I(a), r ? void I(i) : s ? e && e === this.ownerID ? (this.entry[1] = n, this) : new Je(e, this.keyHash, [o, n]) : (I(i), At(this, e, t, Me(o), [o, n])))
}, He.prototype.iterate = Ke.prototype.iterate = function(e, t) {
for (var A = this.entries, o = 0, n = A.length - 1; o <= n; o++)
if (!1 === e(A[t ? n - o : o])) return !1
}, je.prototype.iterate = ze.prototype.iterate = function(e, t) {
for (var A = this.nodes, o = 0, n = A.length - 1; o <= n; o++) {
var i = A[t ? n - o : o];
if (i && !1 === i.iterate(e, t)) return !1
}
}, Je.prototype.iterate = function(e, t) {
return e(this.entry)
}, t(Ve, L), Ve.prototype.next = function() {
for (var e = this._type, t = this._stack; t;) {
var A, o = t.node,
n = t.index++;
if (o.entry) {
if (0 === n) return We(e, o.entry)
} else if (o.entries) {
if (A = o.entries.length - 1, n <= A) return We(e, o.entries[this._reverse ? A - n : n])
} else if (A = o.nodes.length - 1, n <= A) {
var i = o.nodes[this._reverse ? A - n : n];
if (i) {
if (i.entry) return We(e, i.entry);
t = this._stack = qe(i, t)
}
continue
}
t = this._stack = this._stack.__prev
}
return {
value: void 0,
done: !0
}
};
var lt = p / 4,
ut = p / 2,
ct = p / 4;
function gt(e) {
var t = It();
if (null === e || void 0 === e) return t;
if (dt(e)) return e;
var A = n(e),
o = A.size;
return 0 === o ? t : (Ue(o), o > 0 && o < p ? wt(0, o, m, null, new pt(A.toArray())) : t.withMutations(function(e) {
e.setSize(o), A.forEach(function(t, A) {
return e.set(A, t)
})
}))
}
function dt(e) {
return !(!e || !e[ht])
}
t(gt, we), gt.of = function() {
return this(arguments)
}, gt.prototype.toString = function() {
return this.__toString("List [", "]")
}, gt.prototype.get = function(e, t) {
if ((e = T(this, e)) >= 0 && e < this.size) {
var A = Mt(this, e += this._origin);
return A && A.array[e & E]
}
return t
}, gt.prototype.set = function(e, t) {
return function(e, t, A) {
if ((t = T(e, t)) != t) return e;
if (t >= e.size || t < 0) return e.withMutations(function(e) {
t < 0 ? Tt(e, t).set(0, A) : Tt(e, 0, t + 1).set(t, A)
});
t += e._origin;
var o = e._tail,
n = e._root,
i = w(C);
return t >= Qt(e._capacity) ? o = yt(o, e.__ownerID, 0, t, A, i) : n = yt(n, e.__ownerID, e._level, t, A, i), i.value ? e.__ownerID ? (e._root = n, e._tail = o, e.__hash = void 0, e.__altered = !0, e) : wt(e._origin, e._capacity, e._level, n, o) : e
}(this, e, t)
}, gt.prototype.remove = function(e) {
return this.has(e) ? 0 === e ? this.shift() : e === this.size - 1 ? this.pop() : this.splice(e, 1) : this
}, gt.prototype.insert = function(e, t) {
return this.splice(e, 0, t)
}, gt.prototype.clear = function() {
return 0 === this.size ? this : this.__ownerID ? (this.size = this._origin = this._capacity = 0, this._level = m, this._root = this._tail = null, this.__hash = void 0, this.__altered = !0, this) : It()
}, gt.prototype.push = function() {
var e = arguments,
t = this.size;
return this.withMutations(function(A) {
Tt(A, 0, t + e.length);
for (var o = 0; o < e.length; o++) A.set(t + o, e[o])
})
}, gt.prototype.pop = function() {
return Tt(this, 0, -1)
}, gt.prototype.unshift = function() {
var e = arguments;
return this.withMutations(function(t) {
Tt(t, -e.length);
for (var A = 0; A < e.length; A++) t.set(A, e[A])
})
}, gt.prototype.shift = function() {
return Tt(this, 1)
}, gt.prototype.merge = function() {
return St(this, void 0, arguments)
}, gt.prototype.mergeWith = function(t) {
var A = e.call(arguments, 1);
return St(this, t, A)
}, gt.prototype.mergeDeep = function() {
return St(this, nt, arguments)
}, gt.prototype.mergeDeepWith = function(t) {
var A = e.call(arguments, 1);
return St(this, it(t), A)
}, gt.prototype.setSize = function(e) {
return Tt(this, 0, e)
}, gt.prototype.slice = function(e, t) {
var A = this.size;
return Q(e, t, A) ? this : Tt(this, D(e, A), k(t, A))
}, gt.prototype.__iterator = function(e, t) {
var A = 0,
o = Ct(this, t);
return new L(function() {
var t = o();
return t === ft ? {
value: void 0,
done: !0
} : G(e, A++, t)
})
}, gt.prototype.__iterate = function(e, t) {
for (var A, o = 0, n = Ct(this, t);
(A = n()) !== ft && !1 !== e(A, o++, this););
return o
}, gt.prototype.__ensureOwner = function(e) {
return e === this.__ownerID ? this : e ? wt(this._origin, this._capacity, this._level, this._root, this._tail, e, this.__hash) : (this.__ownerID = e, this)
}, gt.isList = dt;
var ht = "@@__IMMUTABLE_LIST__@@",
mt = gt.prototype;
function pt(e, t) {
this.array = e, this.ownerID = t
}
mt[ht] = !0, mt.delete = mt.remove, mt.setIn = Pe.setIn, mt.deleteIn = mt.removeIn = Pe.removeIn, mt.update = Pe.update, mt.updateIn = Pe.updateIn, mt.mergeIn = Pe.mergeIn, mt.mergeDeepIn = Pe.mergeDeepIn, mt.withMutations = Pe.withMutations, mt.asMutable = Pe.asMutable, mt.asImmutable = Pe.asImmutable, mt.wasAltered = Pe.wasAltered, pt.prototype.removeBefore = function(e, t, A) {
if (A === t ? 1 << t : 0 === this.array.length) return this;
var o = A >>> t & E;
if (o >= this.array.length) return new pt([], e);
var n, i = 0 === o;
if (t > 0) {
var a = this.array[o];
if ((n = a && a.removeBefore(e, t - m, A)) === a && i) return this
}
if (i && !n) return this;
var r = bt(this, e);
if (!i)
for (var s = 0; s < o; s++) r.array[s] = void 0;
return n && (r.array[o] = n), r
}, pt.prototype.removeAfter = function(e, t, A) {
if (A === (t ? 1 << t : 0) || 0 === this.array.length) return this;
var o, n = A - 1 >>> t & E;
if (n >= this.array.length) return this;
if (t > 0) {
var i = this.array[n];
if ((o = i && i.removeAfter(e, t - m, A)) === i && n === this.array.length - 1) return this
}
var a = bt(this, e);
return a.array.splice(n + 1), o && (a.array[n] = o), a
};
var Et, Bt, ft = {};
function Ct(e, t) {
var A = e._origin,
o = e._capacity,
n = Qt(o),
i = e._tail;
return a(e._root, e._level, 0);
function a(e, r, s) {
return 0 === r ? function(e, a) {
var r = a === n ? i && i.array : e && e.array,
s = a > A ? 0 : A - a,
l = o - a;
return l > p && (l = p),
function() {
if (s === l) return ft;
var e = t ? --l : s++;
return r && r[e]
}
}(e, s) : function(e, n, i) {
var r, s = e && e.array,
l = i > A ? 0 : A - i >> n,
u = 1 + (o - i >> n);
return u > p && (u = p),
function() {
for (;;) {
if (r) {
var e = r();
if (e !== ft) return e;
r = null
}
if (l === u) return ft;
var A = t ? --u : l++;
r = a(s && s[A], n - m, i + (A << n))
}
}
}(e, r, s)
}
}
function wt(e, t, A, o, n, i, a) {
var r = Object.create(mt);
return r.size = t - e, r._origin = e, r._capacity = t, r._level = A, r._root = o, r._tail = n, r.__ownerID = i, r.__hash = a, r.__altered = !1, r
}
function It() {
return Et || (Et = wt(0, 0, m))
}
function yt(e, t, A, o, n, i) {
var a, r = o >>> A & E,
s = e && r < e.array.length;
if (!s && void 0 === n) return e;
if (A > 0) {
var l = e && e.array[r],
u = yt(l, t, A - m, o, n, i);
return u === l ? e : ((a = bt(e, t)).array[r] = u, a)
}
return s && e.array[r] === n ? e : (I(i), a = bt(e, t), void 0 === n && r === a.array.length - 1 ? a.array.pop() : a.array[r] = n, a)
}
function bt(e, t) {
return t && e && t === e.ownerID ? e : new pt(e ? e.array.slice() : [], t)
}
function Mt(e, t) {
if (t >= Qt(e._capacity)) return e._tail;
if (t < 1 << e._level + m) {
for (var A = e._root, o = e._level; A && o > 0;) A = A.array[t >>> o & E], o -= m;
return A
}
}
function Tt(e, t, A) {
void 0 !== t && (t |= 0), void 0 !== A && (A |= 0);
var o = e.__ownerID || new y,
n = e._origin,
i = e._capacity,
a = n + t,
r = void 0 === A ? i : A < 0 ? i + A : n + A;
if (a === n && r === i) return e;
if (a >= r) return e.clear();
for (var s = e._level, l = e._root, u = 0; a + u < 0;) l = new pt(l && l.array.length ? [void 0, l] : [], o), u += 1 << (s += m);
u && (a += u, n += u, r += u, i += u);
for (var c = Qt(i), g = Qt(r); g >= 1 << s + m;) l = new pt(l && l.array.length ? [l] : [], o), s += m;
var d = e._tail,
h = g < c ? Mt(e, r - 1) : g > c ? new pt([], o) : d;
if (d && g > c && a < i && d.array.length) {
for (var p = l = bt(l, o), B = s; B > m; B -= m) {
var f = c >>> B & E;
p = p.array[f] = bt(p.array[f], o)
}
p.array[c >>> m & E] = d
}
if (r < i && (h = h && h.removeAfter(o, 0, r)), a >= g) a -= g, r -= g, s = m, l = null, h = h && h.removeBefore(o, 0, a);
else if (a > n || g < c) {
for (u = 0; l;) {
var C = a >>> s & E;
if (C !== g >>> s & E) break;
C && (u += (1 << s) * C), s -= m, l = l.array[C]
}
l && a > n && (l = l.removeBefore(o, s, a - u)), l && g < c && (l = l.removeAfter(o, s, g - u)), u && (a -= u, r -= u)
}
return e.__ownerID ? (e.size = r - a, e._origin = a, e._capacity = r, e._level = s, e._root = l, e._tail = h, e.__hash = void 0, e.__altered = !0, e) : wt(a, r, s, l, h)
}
function St(e, t, A) {
for (var o = [], i = 0, r = 0; r < A.length; r++) {
var s = A[r],
l = n(s);
l.size > i && (i = l.size), a(s) || (l = l.map(function(e) {
return ce(e)
})), o.push(l)
}
return i > e.size && (e = e.setSize(i)), at(e, t, o)
}
function Qt(e) {
return e < p ? 0 : e - 1 >>> m << m
}
function Dt(e) {
return null === e || void 0 === e ? vt() : kt(e) ? e : vt().withMutations(function(t) {
var A = o(e);
Ue(A.size), A.forEach(function(e, A) {
return t.set(A, e)
})
})
}
function kt(e) {
return Ge(e) && u(e)
}
function Nt(e, t, A, o) {
var n = Object.create(Dt.prototype);
return n.size = e ? e.size : 0, n._map = e, n._list = t, n.__ownerID = A, n.__hash = o, n
}
function vt() {
return Bt || (Bt = Nt(Ze(), It()))
}
function Ot(e, t, A) {
var o, n, i = e._map,
a = e._list,
r = i.get(t),
s = void 0 !== r;
if (A === B) {
if (!s) return e;
a.size >= p && a.size >= 2 * i.size ? (n = a.filter(function(e, t) {
return void 0 !== e && r !== t
}), o = n.toKeyedSeq().map(function(e) {
return e[0]
}).flip().toMap(), e.__ownerID && (o.__ownerID = n.__ownerID = e.__ownerID)) : (o = i.remove(t), n = r === a.size - 1 ? a.pop() : a.set(r, void 0))
} else if (s) {
if (A === a.get(r)[1]) return e;
o = i, n = a.set(r, [t, A])
} else o = i.set(t, a.size), n = a.set(a.size, [t, A]);
return e.__ownerID ? (e.size = o.size, e._map = o, e._list = n, e.__hash = void 0, e) : Nt(o, n)
}
function Rt(e, t) {
this._iter = e, this._useKeys = t, this.size = e.size
}
function Ft(e) {
this._iter = e, this.size = e.size
}
function Yt(e) {
this._iter = e, this.size = e.size
}
function Ut(e) {
this._iter = e, this.size = e.size
}
function Lt(e) {
var t = $t(e);
return t._iter = e, t.size = e.size, t.flip = function() {
return e
}, t.reverse = function() {
var t = e.reverse.apply(this);
return t.flip = function() {
return e.reverse()
}, t
}, t.has = function(t) {
return e.includes(t)
}, t.includes = function(t) {
return e.has(t)
}, t.cacheResult = eA, t.__iterateUncached = function(t, A) {
var o = this;
return e.__iterate(function(e, A) {
return !1 !== t(A, e, o)
}, A)
}, t.__iteratorUncached = function(t, A) {
if (t === R) {
var o = e.__iterator(t, A);
return new L(function() {
var e = o.next();
if (!e.done) {
var t = e.value[0];
e.value[0] = e.value[1], e.value[1] = t
}
return e
})
}
return e.__iterator(t === O ? v : O, A)
}, t
}
function Gt(e, t, A) {
var o = $t(e);
return o.size = e.size, o.has = function(t) {
return e.has(t)
}, o.get = function(o, n) {
var i = e.get(o, B);
return i === B ? n : t.call(A, i, o, e)
}, o.__iterateUncached = function(o, n) {
var i = this;
return e.__iterate(function(e, n, a) {
return !1 !== o(t.call(A, e, n, a), n, i)
}, n)
}, o.__iteratorUncached = function(o, n) {
var i = e.__iterator(R, n);
return new L(function() {
var n = i.next();
if (n.done) return n;
var a = n.value,
r = a[0];
return G(o, r, t.call(A, a[1], r, e), n)
})
}, o
}
function xt(e, t) {
var A = $t(e);
return A._iter = e, A.size = e.size, A.reverse = function() {
return e
}, e.flip && (A.flip = function() {
var t = Lt(e);
return t.reverse = function() {
return e.flip()
}, t
}), A.get = function(A, o) {
return e.get(t ? A : -1 - A, o)
}, A.has = function(A) {
return e.has(t ? A : -1 - A)
}, A.includes = function(t) {
return e.includes(t)
}, A.cacheResult = eA, A.__iterate = function(t, A) {
var o = this;
return e.__iterate(function(e, A) {
return t(e, A, o)
}, !A)
}, A.__iterator = function(t, A) {
return e.__iterator(t, !A)
}, A
}
function _t(e, t, A, o) {
var n = $t(e);
return o && (n.has = function(o) {
var n = e.get(o, B);
return n !== B && !!t.call(A, n, o, e)
}, n.get = function(o, n) {
var i = e.get(o, B);
return i !== B && t.call(A, i, o, e) ? i : n
}), n.__iterateUncached = function(n, i) {
var a = this,
r = 0;
return e.__iterate(function(e, i, s) {
if (t.call(A, e, i, s)) return r++, n(e, o ? i : r - 1, a)
}, i), r
}, n.__iteratorUncached = function(n, i) {
var a = e.__iterator(R, i),
r = 0;
return new L(function() {
for (;;) {
var i = a.next();
if (i.done) return i;
var s = i.value,
l = s[0],
u = s[1];
if (t.call(A, u, l, e)) return G(n, o ? l : r++, u, i)
}
})
}, n
}
function Pt(e, t, A, o) {
var n = e.size;
if (void 0 !== t && (t |= 0), void 0 !== A && (A === 1 / 0 ? A = n : A |= 0), Q(t, A, n)) return e;
var i = D(t, n),
a = k(A, n);
if (i != i || a != a) return Pt(e.toSeq().cacheResult(), t, A, o);
var r, s = a - i;
s == s && (r = s < 0 ? 0 : s);
var l = $t(e);
return l.size = 0 === r ? r : e.size && r || void 0, !o && ne(e) && r >= 0 && (l.get = function(t, A) {
return (t = T(this, t)) >= 0 && t < r ? e.get(t + i, A) : A
}), l.__iterateUncached = function(t, A) {
var n = this;
if (0 === r) return 0;
if (A) return this.cacheResult().__iterate(t, A);
var a = 0,
s = !0,
l = 0;
return e.__iterate(function(e, A) {
if (!s || !(s = a++ < i)) return l++, !1 !== t(e, o ? A : l - 1, n) && l !== r
}), l
}, l.__iteratorUncached = function(t, A) {
if (0 !== r && A) return this.cacheResult().__iterator(t, A);
var n = 0 !== r && e.__iterator(t, A),
a = 0,
s = 0;
return new L(function() {
for (; a++ < i;) n.next();
if (++s > r) return {
value: void 0,
done: !0
};
var e = n.next();
return o || t === O ? e : G(t, s - 1, t === v ? void 0 : e.value[1], e)
})
}, l
}
function Ht(e, t, A, o) {
var n = $t(e);
return n.__iterateUncached = function(n, i) {
var a = this;
if (i) return this.cacheResult().__iterate(n, i);
var r = !0,
s = 0;
return e.__iterate(function(e, i, l) {
if (!r || !(r = t.call(A, e, i, l))) return s++, n(e, o ? i : s - 1, a)
}), s
}, n.__iteratorUncached = function(n, i) {
var a = this;
if (i) return this.cacheResult().__iterator(n, i);
var r = e.__iterator(R, i),
s = !0,
l = 0;
return new L(function() {
var e, i, u;
do {
if ((e = r.next()).done) return o || n === O ? e : G(n, l++, n === v ? void 0 : e.value[1], e);
var c = e.value;
i = c[0], u = c[1], s && (s = t.call(A, u, i, a))
} while (s);
return n === R ? e : G(n, i, u, e)
})
}, n
}
function jt(e, t, A) {
var o = $t(e);
return o.__iterateUncached = function(o, n) {
var i = 0,
r = !1;
return function e(s, l) {
var u = this;
s.__iterate(function(n, s) {
return (!t || l < t) && a(n) ? e(n, l + 1) : !1 === o(n, A ? s : i++, u) && (r = !0), !r
}, n)
}(e, 0), i
}, o.__iteratorUncached = function(o, n) {
var i = e.__iterator(o, n),
r = [],
s = 0;
return new L(function() {
for (; i;) {
var e = i.next();
if (!1 === e.done) {
var l = e.value;
if (o === R && (l = l[1]), t && !(r.length < t) || !a(l)) return A ? e : G(o, s++, l, e);
r.push(i), i = l.__iterator(o, n)
} else i = r.pop()
}
return {
value: void 0,
done: !0
}
})
}, o
}
function zt(e, t, A) {
t || (t = tA);
var o = r(e),
n = 0,
i = e.toSeq().map(function(t, o) {
return [o, t, n++, A ? A(t, o, e) : t]
}).toArray();
return i.sort(function(e, A) {
return t(e[3], A[3]) || e[2] - A[2]
}).forEach(o ? function(e, t) {
i[t].length = 2
} : function(e, t) {
i[t] = e[1]
}), o ? J(i) : s(e) ? V(i) : W(i)
}
function Kt(e, t, A) {
if (t || (t = tA), A) {
var o = e.toSeq().map(function(t, o) {
return [t, A(t, o, e)]
}).reduce(function(e, A) {
return Jt(t, e[1], A[1]) ? A : e
});
return o && o[0]
}
return e.reduce(function(e, A) {
return Jt(t, e, A) ? A : e
})
}
function Jt(e, t, A) {
var o = e(A, t);
return 0 === o && A !== t && (void 0 === A || null === A || A != A) || o > 0
}
function Vt(e, t, o) {
var n = $t(e);
return n.size = new ee(o).map(function(e) {
return e.size
}).min(), n.__iterate = function(e, t) {
for (var A, o = this.__iterator(O, t), n = 0; !(A = o.next()).done && !1 !== e(A.value, n++, this););
return n
}, n.__iteratorUncached = function(e, n) {
var i = o.map(function(e) {
return e = A(e), H(n ? e.reverse() : e)
}),
a = 0,
r = !1;
return new L(function() {
var A;
return r || (A = i.map(function(e) {
return e.next()
}), r = A.some(function(e) {
return e.done
})), r ? {
value: void 0,
done: !0
} : G(e, a++, t.apply(null, A.map(function(e) {
return e.value
})))
})
}, n
}
function Wt(e, t) {
return ne(e) ? t : e.constructor(t)
}
function qt(e) {
if (e !== Object(e)) throw new TypeError("Expected [K, V] tuple: " + e)
}
function Xt(e) {
return Ue(e.size), M(e)
}
function Zt(e) {
return r(e) ? o : s(e) ? n : i
}
function $t(e) {
return Object.create((r(e) ? J : s(e) ? V : W).prototype)
}
function eA() {
return this._iter.cacheResult ? (this._iter.cacheResult(), this.size = this._iter.size, this) : K.prototype.cacheResult.call(this)
}
function tA(e, t) {
return e > t ? 1 : e < t ? -1 : 0
}
function AA(e) {
var t = H(e);
if (!t) {
if (!z(e)) throw new TypeError("Expected iterable or array-like: " + e);
t = H(A(e))
}
return t
}
function oA(e, t) {
var A, o = function(i) {
if (i instanceof o) return i;
if (!(this instanceof o)) return new o(i);
if (!A) {
A = !0;
var a = Object.keys(e);
! function(e, t) {
try {
t.forEach(function(e, t) {
Object.defineProperty(e, t, {
get: function() {
return this.get(t)
},
set: function(e) {
Ee(this.__ownerID, "Cannot set on an immutable record."), this.set(t, e)
}
})
}.bind(void 0, e))
} catch (e) {}
}(n, a), n.size = a.length, n._name = t, n._keys = a, n._defaultValues = e
}
this._map = Le(i)
},
n = o.prototype = Object.create(nA);
return n.constructor = o, o
}
t(Dt, Le), Dt.of = function() {
return this(arguments)
}, Dt.prototype.toString = function() {
return this.__toString("OrderedMap {", "}")
}, Dt.prototype.get = function(e, t) {
var A = this._map.get(e);
return void 0 !== A ? this._list.get(A)[1] : t
}, Dt.prototype.clear = function() {
return 0 === this.size ? this : this.__ownerID ? (this.size = 0, this._map.clear(), this._list.clear(), this) : vt()
}, Dt.prototype.set = function(e, t) {
return Ot(this, e, t)
}, Dt.prototype.remove = function(e) {
return Ot(this, e, B)
}, Dt.prototype.wasAltered = function() {
return this._map.wasAltered() || this._list.wasAltered()
}, Dt.prototype.__iterate = function(e, t) {
var A = this;
return this._list.__iterate(function(t) {
return t && e(t[1], t[0], A)
}, t)
}, Dt.prototype.__iterator = function(e, t) {
return this._list.fromEntrySeq().__iterator(e, t)
}, Dt.prototype.__ensureOwner = function(e) {
if (e === this.__ownerID) return this;
var t = this._map.__ensureOwner(e),
A = this._list.__ensureOwner(e);
return e ? Nt(t, A, e, this.__hash) : (this.__ownerID = e, this._map = t, this._list = A, this)
}, Dt.isOrderedMap = kt, Dt.prototype[h] = !0, Dt.prototype.delete = Dt.prototype.remove, t(Rt, J), Rt.prototype.get = function(e, t) {
return this._iter.get(e, t)
}, Rt.prototype.has = function(e) {
return this._iter.has(e)
}, Rt.prototype.valueSeq = function() {
return this._iter.valueSeq()
}, Rt.prototype.reverse = function() {
var e = this,
t = xt(this, !0);
return this._useKeys || (t.valueSeq = function() {
return e._iter.toSeq().reverse()
}), t
}, Rt.prototype.map = function(e, t) {
var A = this,
o = Gt(this, e, t);
return this._useKeys || (o.valueSeq = function() {
return A._iter.toSeq().map(e, t)
}), o
}, Rt.prototype.__iterate = function(e, t) {
var A, o = this;
return this._iter.__iterate(this._useKeys ? function(t, A) {
return e(t, A, o)
} : (A = t ? Xt(this) : 0, function(n) {
return e(n, t ? --A : A++, o)
}), t)
}, Rt.prototype.__iterator = function(e, t) {
if (this._useKeys) return this._iter.__iterator(e, t);
var A = this._iter.__iterator(O, t),
o = t ? Xt(this) : 0;
return new L(function() {
var n = A.next();
return n.done ? n : G(e, t ? --o : o++, n.value, n)
})
}, Rt.prototype[h] = !0, t(Ft, V), Ft.prototype.includes = function(e) {
return this._iter.includes(e)
}, Ft.prototype.__iterate = function(e, t) {
var A = this,
o = 0;
return this._iter.__iterate(function(t) {
return e(t, o++, A)
}, t)
}, Ft.prototype.__iterator = function(e, t) {
var A = this._iter.__iterator(O, t),
o = 0;
return new L(function() {
var t = A.next();
return t.done ? t : G(e, o++, t.value, t)
})
}, t(Yt, W), Yt.prototype.has = function(e) {
return this._iter.includes(e)
}, Yt.prototype.__iterate = function(e, t) {
var A = this;
return this._iter.__iterate(function(t) {
return e(t, t, A)
}, t)
}, Yt.prototype.__iterator = function(e, t) {
var A = this._iter.__iterator(O, t);
return new L(function() {
var t = A.next();
return t.done ? t : G(e, t.value, t.value, t)
})
}, t(Ut, J), Ut.prototype.entrySeq = function() {
return this._iter.toSeq()
}, Ut.prototype.__iterate = function(e, t) {
var A = this;
return this._iter.__iterate(function(t) {
if (t) {
qt(t);
var o = a(t);
return e(o ? t.get(1) : t[1], o ? t.get(0) : t[0], A)
}
}, t)
}, Ut.prototype.__iterator = function(e, t) {
var A = this._iter.__iterator(O, t);
return new L(function() {
for (;;) {
var t = A.next();
if (t.done) return t;
var o = t.value;
if (o) {
qt(o);
var n = a(o);
return G(e, n ? o.get(0) : o[0], n ? o.get(1) : o[1], t)
}
}
})
}, Ft.prototype.cacheResult = Rt.prototype.cacheResult = Yt.prototype.cacheResult = Ut.prototype.cacheResult = eA, t(oA, Ce), oA.prototype.toString = function() {
return this.__toString(aA(this) + " {", "}")
}, oA.prototype.has = function(e) {
return this._defaultValues.hasOwnProperty(e)
}, oA.prototype.get = function(e, t) {
if (!this.has(e)) return t;
var A = this._defaultValues[e];
return this._map ? this._map.get(e, A) : A
}, oA.prototype.clear = function() {
if (this.__ownerID) return this._map && this._map.clear(), this;
var e = this.constructor;
return e._empty || (e._empty = iA(this, Ze()))
}, oA.prototype.set = function(e, t) {
if (!this.has(e)) throw new Error('Cannot set unknown key "' + e + '" on ' + aA(this));
if (this._map && !this._map.has(e)) {
var A = this._defaultValues[e];
if (t === A) return this
}
var o = this._map && this._map.set(e, t);
return this.__ownerID || o === this._map ? this : iA(this, o)
}, oA.prototype.remove = function(e) {
if (!this.has(e)) return this;
var t = this._map && this._map.remove(e);
return this.__ownerID || t === this._map ? this : iA(this, t)
}, oA.prototype.wasAltered = function() {
return this._map.wasAltered()
}, oA.prototype.__iterator = function(e, t) {
var A = this;
return o(this._defaultValues).map(function(e, t) {
return A.get(t)
}).__iterator(e, t)
}, oA.prototype.__iterate = function(e, t) {
var A = this;
return o(this._defaultValues).map(function(e, t) {
return A.get(t)
}).__iterate(e, t)
}, oA.prototype.__ensureOwner = function(e) {
if (e === this.__ownerID) return this;
var t = this._map && this._map.__ensureOwner(e);
return e ? iA(this, t, e) : (this.__ownerID = e, this._map = t, this)
};
var nA = oA.prototype;
function iA(e, t, A) {
var o = Object.create(Object.getPrototypeOf(e));
return o._map = t, o.__ownerID = A, o
}
function aA(e) {
return e._name || e.constructor.name || "Record"
}
function rA(e) {
return null === e || void 0 === e ? hA() : sA(e) && !u(e) ? e : hA().withMutations(function(t) {
var A = i(e);
Ue(A.size), A.forEach(function(e) {
return t.add(e)
})
})
}
function sA(e) {
return !(!e || !e[uA])
}
nA.delete = nA.remove, nA.deleteIn = nA.removeIn = Pe.removeIn, nA.merge = Pe.merge, nA.mergeWith = Pe.mergeWith, nA.mergeIn = Pe.mergeIn, nA.mergeDeep = Pe.mergeDeep, nA.mergeDeepWith = Pe.mergeDeepWith, nA.mergeDeepIn = Pe.mergeDeepIn, nA.setIn = Pe.setIn, nA.update = Pe.update, nA.updateIn = Pe.updateIn, nA.withMutations = Pe.withMutations, nA.asMutable = Pe.asMutable, nA.asImmutable = Pe.asImmutable, t(rA, Ie), rA.of = function() {
return this(arguments)
}, rA.fromKeys = function(e) {
return this(o(e).keySeq())
}, rA.prototype.toString = function() {
return this.__toString("Set {", "}")
}, rA.prototype.has = function(e) {
return this._map.has(e)
}, rA.prototype.add = function(e) {
return gA(this, this._map.set(e, !0))
}, rA.prototype.remove = function(e) {
return gA(this, this._map.remove(e))
}, rA.prototype.clear = function() {
return gA(this, this._map.clear())
}, rA.prototype.union = function() {
var t = e.call(arguments, 0);
return 0 === (t = t.filter(function(e) {
return 0 !== e.size
})).length ? this : 0 !== this.size || this.__ownerID || 1 !== t.length ? this.withMutations(function(e) {
for (var A = 0; A < t.length; A++) i(t[A]).forEach(function(t) {
return e.add(t)
})
}) : this.constructor(t[0])
}, rA.prototype.intersect = function() {
var t = e.call(arguments, 0);
if (0 === t.length) return this;
t = t.map(function(e) {
return i(e)
});
var A = this;
return this.withMutations(function(e) {
A.forEach(function(A) {
t.every(function(e) {
return e.includes(A)
}) || e.remove(A)
})
})
}, rA.prototype.subtract = function() {
var t = e.call(arguments, 0);
if (0 === t.length) return this;
t = t.map(function(e) {
return i(e)
});
var A = this;
return this.withMutations(function(e) {
A.forEach(function(A) {
t.some(function(e) {
return e.includes(A)
}) && e.remove(A)
})
})
}, rA.prototype.merge = function() {
return this.union.apply(this, arguments)
}, rA.prototype.mergeWith = function(t) {
var A = e.call(arguments, 1);
return this.union.apply(this, A)
}, rA.prototype.sort = function(e) {
return mA(zt(this, e))
}, rA.prototype.sortBy = function(e, t) {
return mA(zt(this, t, e))
}, rA.prototype.wasAltered = function() {
return this._map.wasAltered()
}, rA.prototype.__iterate = function(e, t) {
var A = this;
return this._map.__iterate(function(t, o) {
return e(o, o, A)
}, t)
}, rA.prototype.__iterator = function(e, t) {
return this._map.map(function(e, t) {
return t
}).__iterator(e, t)
}, rA.prototype.__ensureOwner = function(e) {
if (e === this.__ownerID) return this;
var t = this._map.__ensureOwner(e);
return e ? this.__make(t, e) : (this.__ownerID = e, this._map = t, this)
}, rA.isSet = sA;
var lA, uA = "@@__IMMUTABLE_SET__@@",
cA = rA.prototype;
function gA(e, t) {
return e.__ownerID ? (e.size = t.size, e._map = t, e) : t === e._map ? e : 0 === t.size ? e.__empty() : e.__make(t)
}
function dA(e, t) {
var A = Object.create(cA);
return A.size = e ? e.size : 0, A._map = e, A.__ownerID = t, A
}
function hA() {
return lA || (lA = dA(Ze()))
}
function mA(e) {
return null === e || void 0 === e ? CA() : pA(e) ? e : CA().withMutations(function(t) {
var A = i(e);
Ue(A.size), A.forEach(function(e) {
return t.add(e)
})
})
}
function pA(e) {
return sA(e) && u(e)
}
cA[uA] = !0, cA.delete = cA.remove, cA.mergeDeep = cA.merge, cA.mergeDeepWith = cA.mergeWith, cA.withMutations = Pe.withMutations, cA.asMutable = Pe.asMutable, cA.asImmutable = Pe.asImmutable, cA.__empty = hA, cA.__make = dA, t(mA, rA), mA.of = function() {
return this(arguments)
}, mA.fromKeys = function(e) {
return this(o(e).keySeq())
}, mA.prototype.toString = function() {
return this.__toString("OrderedSet {", "}")
}, mA.isOrderedSet = pA;
var EA, BA = mA.prototype;
function fA(e, t) {
var A = Object.create(BA);
return A.size = e ? e.size : 0, A._map = e, A.__ownerID = t, A
}
function CA() {
return EA || (EA = fA(vt()))
}
function wA(e) {
return null === e || void 0 === e ? SA() : IA(e) ? e : SA().unshiftAll(e)
}
function IA(e) {
return !(!e || !e[bA])
}
BA[h] = !0, BA.__empty = CA, BA.__make = fA, t(wA, we), wA.of = function() {
return this(arguments)
}, wA.prototype.toString = function() {
return this.__toString("Stack [", "]")
}, wA.prototype.get = function(e, t) {
var A = this._head;
for (e = T(this, e); A && e--;) A = A.next;
return A ? A.value : t
}, wA.prototype.peek = function() {
return this._head && this._head.value
}, wA.prototype.push = function() {
if (0 === arguments.length) return this;
for (var e = this.size + arguments.length, t = this._head, A = arguments.length - 1; A >= 0; A--) t = {
value: arguments[A],
next: t
};
return this.__ownerID ? (this.size = e, this._head = t, this.__hash = void 0, this.__altered = !0, this) : TA(e, t)
}, wA.prototype.pushAll = function(e) {
if (0 === (e = n(e)).size) return this;
Ue(e.size);
var t = this.size,
A = this._head;
return e.reverse().forEach(function(e) {
t++, A = {
value: e,
next: A
}
}), this.__ownerID ? (this.size = t, this._head = A, this.__hash = void 0, this.__altered = !0, this) : TA(t, A)
}, wA.prototype.pop = function() {
return this.slice(1)
}, wA.prototype.unshift = function() {
return this.push.apply(this, arguments)
}, wA.prototype.unshiftAll = function(e) {
return this.pushAll(e)
}, wA.prototype.shift = function() {
return this.pop.apply(this, arguments)
}, wA.prototype.clear = function() {
return 0 === this.size ? this : this.__ownerID ? (this.size = 0, this._head = void 0, this.__hash = void 0, this.__altered = !0, this) : SA()
}, wA.prototype.slice = function(e, t) {
if (Q(e, t, this.size)) return this;
var A = D(e, this.size),
o = k(t, this.size);
if (o !== this.size) return we.prototype.slice.call(this, e, t);
for (var n = this.size - A, i = this._head; A--;) i = i.next;
return this.__ownerID ? (this.size = n, this._head = i, this.__hash = void 0, this.__altered = !0, this) : TA(n, i)
}, wA.prototype.__ensureOwner = function(e) {
return e === this.__ownerID ? this : e ? TA(this.size, this._head, e, this.__hash) : (this.__ownerID = e, this.__altered = !1, this)
}, wA.prototype.__iterate = function(e, t) {
if (t) return this.reverse().__iterate(e);
for (var A = 0, o = this._head; o && !1 !== e(o.value, A++, this);) o = o.next;
return A
}, wA.prototype.__iterator = function(e, t) {
if (t) return this.reverse().__iterator(e);
var A = 0,
o = this._head;
return new L(function() {
if (o) {
var t = o.value;
return o = o.next, G(e, A++, t)
}
return {
value: void 0,
done: !0
}
})
}, wA.isStack = IA;
var yA, bA = "@@__IMMUTABLE_STACK__@@",
MA = wA.prototype;
function TA(e, t, A, o) {
var n = Object.create(MA);
return n.size = e, n._head = t, n.__ownerID = A, n.__hash = o, n.__altered = !1, n
}
function SA() {
return yA || (yA = TA(0))
}
function QA(e, t) {
var A = function(A) {
e.prototype[A] = t[A]
};
return Object.keys(t).forEach(A), Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(t).forEach(A), e
}
MA[bA] = !0, MA.withMutations = Pe.withMutations, MA.asMutable = Pe.asMutable, MA.asImmutable = Pe.asImmutable, MA.wasAltered = Pe.wasAltered, A.Iterator = L, QA(A, {
toArray: function() {
Ue(this.size);
var e = new Array(this.size || 0);
return this.valueSeq().__iterate(function(t, A) {
e[A] = t
}), e
},
toIndexedSeq: function() {
return new Ft(this)
},
toJS: function() {
return this.toSeq().map(function(e) {
return e && "function" == typeof e.toJS ? e.toJS() : e
}).__toJS()
},
toJSON: function() {
return this.toSeq().map(function(e) {
return e && "function" == typeof e.toJSON ? e.toJSON() : e
}).__toJS()
},
toKeyedSeq: function() {
return new Rt(this, !0)
},
toMap: function() {
return Le(this.toKeyedSeq())
},
toObject: function() {
Ue(this.size);
var e = {};
return this.__iterate(function(t, A) {
e[A] = t
}), e
},
toOrderedMap: function() {
return Dt(this.toKeyedSeq())
},
toOrderedSet: function() {
return mA(r(this) ? this.valueSeq() : this)
},
toSet: function() {
return rA(r(this) ? this.valueSeq() : this)
},
toSetSeq: function() {
return new Yt(this)
},
toSeq: function() {
return s(this) ? this.toIndexedSeq() : r(this) ? this.toKeyedSeq() : this.toSetSeq()
},
toStack: function() {
return wA(r(this) ? this.valueSeq() : this)
},
toList: function() {
return gt(r(this) ? this.valueSeq() : this)
},
toString: function() {
return "[Iterable]"
},
__toString: function(e, t) {
return 0 === this.size ? e + t : e + " " + this.toSeq().map(this.__toStringMapper).join(", ") + " " + t
},
concat: function() {
var t = e.call(arguments, 0);
return Wt(this, function(e, t) {
var A = r(e),
n = [e].concat(t).map(function(e) {
return a(e) ? A && (e = o(e)) : e = A ? ae(e) : re(Array.isArray(e) ? e : [e]), e
}).filter(function(e) {
return 0 !== e.size
});
if (0 === n.length) return e;
if (1 === n.length) {
var i = n[0];
if (i === e || A && r(i) || s(e) && s(i)) return i
}
var l = new ee(n);
return A ? l = l.toKeyedSeq() : s(e) || (l = l.toSetSeq()), (l = l.flatten(!0)).size = n.reduce(function(e, t) {
if (void 0 !== e) {
var A = t.size;
if (void 0 !== A) return e + A
}
}, 0), l
}(this, t))
},
includes: function(e) {
return this.some(function(t) {
return he(t, e)
})
},
entries: function() {
return this.__iterator(R)
},
every: function(e, t) {
Ue(this.size);
var A = !0;
return this.__iterate(function(o, n, i) {
if (!e.call(t, o, n, i)) return A = !1, !1
}), A
},
filter: function(e, t) {
return Wt(this, _t(this, e, t, !0))
},
find: function(e, t, A) {
var o = this.findEntry(e, t);
return o ? o[1] : A
},
forEach: function(e, t) {
return Ue(this.size), this.__iterate(t ? e.bind(t) : e)
},
join: function(e) {
Ue(this.size), e = void 0 !== e ? "" + e : ",";
var t = "",
A = !0;
return this.__iterate(function(o) {
A ? A = !1 : t += e, t += null !== o && void 0 !== o ? o.toString() : ""
}), t
},
keys: function() {
return this.__iterator(v)
},
map: function(e, t) {
return Wt(this, Gt(this, e, t))
},
reduce: function(e, t, A) {
var o, n;
return Ue(this.size), arguments.length < 2 ? n = !0 : o = t, this.__iterate(function(t, i, a) {
n ? (n = !1, o = t) : o = e.call(A, o, t, i, a)
}), o
},
reduceRight: function(e, t, A) {
var o = this.toKeyedSeq().reverse();
return o.reduce.apply(o, arguments)
},
reverse: function() {
return Wt(this, xt(this, !0))
},
slice: function(e, t) {
return Wt(this, Pt(this, e, t, !0))
},
some: function(e, t) {
return !this.every(OA(e), t)
},
sort: function(e) {
return Wt(this, zt(this, e))
},
values: function() {
return this.__iterator(O)
},
butLast: function() {
return this.slice(0, -1)
},
isEmpty: function() {
return void 0 !== this.size ? 0 === this.size : !this.some(function() {
return !0
})
},
count: function(e, t) {
return M(e ? this.toSeq().filter(e, t) : this)
},
countBy: function(e, t) {
return function(e, t, A) {
var o = Le().asMutable();
return e.__iterate(function(n, i) {
o.update(t.call(A, n, i, e), 0, function(e) {
return e + 1
})
}), o.asImmutable()
}(this, e, t)
},
equals: function(e) {
return me(this, e)
},
entrySeq: function() {
var e = this;
if (e._cache) return new ee(e._cache);
var t = e.toSeq().map(vA).toIndexedSeq();
return t.fromEntrySeq = function() {
return e.toSeq()
}, t
},
filterNot: function(e, t) {
return this.filter(OA(e), t)
},
findEntry: function(e, t, A) {
var o = A;
return this.__iterate(function(A, n, i) {
if (e.call(t, A, n, i)) return o = [n, A], !1
}), o
},
findKey: function(e, t) {
var A = this.findEntry(e, t);
return A && A[0]
},
findLast: function(e, t, A) {
return this.toKeyedSeq().reverse().find(e, t, A)
},
findLastEntry: function(e, t, A) {
return this.toKeyedSeq().reverse().findEntry(e, t, A)
},
findLastKey: function(e, t) {
return this.toKeyedSeq().reverse().findKey(e, t)
},
first: function() {
return this.find(S)
},
flatMap: function(e, t) {
return Wt(this, function(e, t, A) {
var o = Zt(e);
return e.toSeq().map(function(n, i) {
return o(t.call(A, n, i, e))
}).flatten(!0)
}(this, e, t))
},
flatten: function(e) {
return Wt(this, jt(this, e, !0))
},
fromEntrySeq: function() {
return new Ut(this)
},
get: function(e, t) {
return this.find(function(t, A) {
return he(A, e)
}, void 0, t)
},
getIn: function(e, t) {
for (var A, o = this, n = AA(e); !(A = n.next()).done;) {
var i = A.value;
if ((o = o && o.get ? o.get(i, B) : B) === B) return t
}
return o
},
groupBy: function(e, t) {
return function(e, t, A) {
var o = r(e),
n = (u(e) ? Dt() : Le()).asMutable();
e.__iterate(function(i, a) {
n.update(t.call(A, i, a, e), function(e) {
return (e = e || []).push(o ? [a, i] : i), e
})
});
var i = Zt(e);
return n.map(function(t) {
return Wt(e, i(t))
})
}(this, e, t)
},
has: function(e) {
return this.get(e, B) !== B
},
hasIn: function(e) {
return this.getIn(e, B) !== B
},
isSubset: function(e) {
return e = "function" == typeof e.includes ? e : A(e), this.every(function(t) {
return e.includes(t)
})
},
isSuperset: function(e) {
return (e = "function" == typeof e.isSubset ? e : A(e)).isSubset(this)
},
keyOf: function(e) {
return this.findKey(function(t) {
return he(t, e)
})
},
keySeq: function() {
return this.toSeq().map(NA).toIndexedSeq()
},
last: function() {
return this.toSeq().reverse().first()
},
lastKeyOf: function(e) {
return this.toKeyedSeq().reverse().keyOf(e)
},
max: function(e) {
return Kt(this, e)
},
maxBy: function(e, t) {
return Kt(this, t, e)
},
min: function(e) {
return Kt(this, e ? RA(e) : UA)
},
minBy: function(e, t) {
return Kt(this, t ? RA(t) : UA, e)
},
rest: function() {
return this.slice(1)
},
skip: function(e) {
return this.slice(Math.max(0, e))
},
skipLast: function(e) {
return Wt(this, this.toSeq().reverse().skip(e).reverse())
},
skipWhile: function(e, t) {
return Wt(this, Ht(this, e, t, !0))
},
skipUntil: function(e, t) {
return this.skipWhile(OA(e), t)
},
sortBy: function(e, t) {
return Wt(this, zt(this, t, e))
},
take: function(e) {
return this.slice(0, Math.max(0, e))
},
takeLast: function(e) {
return Wt(this, this.toSeq().reverse().take(e).reverse())
},
takeWhile: function(e, t) {
return Wt(this, function(e, t, A) {
var o = $t(e);
return o.__iterateUncached = function(o, n) {
var i = this;
if (n) return this.cacheResult().__iterate(o, n);
var a = 0;
return e.__iterate(function(e, n, r) {
return t.call(A, e, n, r) && ++a && o(e, n, i)
}), a
}, o.__iteratorUncached = function(o, n) {
var i = this;
if (n) return this.cacheResult().__iterator(o, n);
var a = e.__iterator(R, n),
r = !0;
return new L(function() {
if (!r) return {
value: void 0,
done: !0
};
var e = a.next();
if (e.done) return e;
var n = e.value,
s = n[0],
l = n[1];
return t.call(A, l, s, i) ? o === R ? e : G(o, s, l, e) : (r = !1, {
value: void 0,
done: !0
})
})
}, o
}(this, e, t))
},
takeUntil: function(e, t) {
return this.takeWhile(OA(e), t)
},
valueSeq: function() {
return this.toIndexedSeq()
},
hashCode: function() {
return this.__hash || (this.__hash = function(e) {
if (e.size === 1 / 0) return 0;
var t = u(e),
A = r(e),
o = t ? 1 : 0;
return function(e, t) {
return t = ye(t, 3432918353), t = ye(t << 15 | t >>> -15, 461845907), t = ye(t << 13 | t >>> -13, 5), t = ye((t = (t + 3864292196 | 0) ^ e) ^ t >>> 16, 2246822507), t = be((t = ye(t ^ t >>> 13, 3266489909)) ^ t >>> 16)
}(e.__iterate(A ? t ? function(e, t) {
o = 31 * o + LA(Me(e), Me(t)) | 0
} : function(e, t) {
o = o + LA(Me(e), Me(t)) | 0
} : t ? function(e) {
o = 31 * o + Me(e) | 0
} : function(e) {
o = o + Me(e) | 0
}), o)
}(this))
}
});
var DA = A.prototype;
DA[c] = !0, DA[U] = DA.values, DA.__toJS = DA.toArray, DA.__toStringMapper = FA, DA.inspect = DA.toSource = function() {
return this.toString()
}, DA.chain = DA.flatMap, DA.contains = DA.includes, QA(o, {
flip: function() {
return Wt(this, Lt(this))
},
mapEntries: function(e, t) {
var A = this,
o = 0;
return Wt(this, this.toSeq().map(function(n, i) {
return e.call(t, [i, n], o++, A)
}).fromEntrySeq())
},
mapKeys: function(e, t) {
var A = this;
return Wt(this, this.toSeq().flip().map(function(o, n) {
return e.call(t, o, n, A)
}).flip())
}
});
var kA = o.prototype;
function NA(e, t) {
return t
}
function vA(e, t) {
return [t, e]
}
function OA(e) {
return function() {
return !e.apply(this, arguments)
}
}
function RA(e) {
return function() {
return -e.apply(this, arguments)
}
}
function FA(e) {
return "string" == typeof e ? JSON.stringify(e) : String(e)
}
function YA() {
return b(arguments)
}
function UA(e, t) {
return e < t ? 1 : e > t ? -1 : 0
}
function LA(e, t) {
return e ^ t + 2654435769 + (e << 6) + (e >> 2) | 0
}
return kA[g] = !0, kA[U] = DA.entries, kA.__toJS = DA.toObject, kA.__toStringMapper = function(e, t) {
return JSON.stringify(t) + ": " + FA(e)
}, QA(n, {
toKeyedSeq: function() {
return new Rt(this, !1)
},
filter: function(e, t) {
return Wt(this, _t(this, e, t, !1))
},
findIndex: function(e, t) {
var A = this.findEntry(e, t);
return A ? A[0] : -1
},
indexOf: function(e) {
var t = this.keyOf(e);
return void 0 === t ? -1 : t
},
lastIndexOf: function(e) {
var t = this.lastKeyOf(e);
return void 0 === t ? -1 : t
},
reverse: function() {
return Wt(this, xt(this, !1))
},
slice: function(e, t) {
return Wt(this, Pt(this, e, t, !1))
},
splice: function(e, t) {
var A = arguments.length;
if (t = Math.max(0 | t, 0), 0 === A || 2 === A && !t) return this;
e = D(e, e < 0 ? this.count() : this.size);
var o = this.slice(0, e);
return Wt(this, 1 === A ? o : o.concat(b(arguments, 2), this.slice(e + t)))
},
findLastIndex: function(e, t) {
var A = this.findLastEntry(e, t);
return A ? A[0] : -1
},
first: function() {
return this.get(0)
},
flatten: function(e) {
return Wt(this, jt(this, e, !1))
},
get: function(e, t) {
return (e = T(this, e)) < 0 || this.size === 1 / 0 || void 0 !== this.size && e > this.size ? t : this.find(function(t, A) {
return A === e
}, void 0, t)
},
has: function(e) {
return (e = T(this, e)) >= 0 && (void 0 !== this.size ? this.size === 1 / 0 || e < this.size : -1 !== this.indexOf(e))
},
interpose: function(e) {
return Wt(this, function(e, t) {
var A = $t(e);
return A.size = e.size && 2 * e.size - 1, A.__iterateUncached = function(A, o) {
var n = this,
i = 0;
return e.__iterate(function(e, o) {
return (!i || !1 !== A(t, i++, n)) && !1 !== A(e, i++, n)
}, o), i
}, A.__iteratorUncached = function(A, o) {
var n, i = e.__iterator(O, o),
a = 0;
return new L(function() {
return (!n || a % 2) && (n = i.next()).done ? n : a % 2 ? G(A, a++, t) : G(A, a++, n.value, n)
})
}, A
}(this, e))
},
interleave: function() {
var e = [this].concat(b(arguments)),
t = Vt(this.toSeq(), V.of, e),
A = t.flatten(!0);
return t.size && (A.size = t.size * e.length), Wt(this, A)
},
keySeq: function() {
return Be(0, this.size)
},
last: function() {
return this.get(-1)
},
skipWhile: function(e, t) {
return Wt(this, Ht(this, e, t, !1))
},
zip: function() {
return Wt(this, Vt(this, YA, [this].concat(b(arguments))))
},
zipWith: function(e) {
var t = b(arguments);
return t[0] = this, Wt(this, Vt(this, e, t))
}
}), n.prototype[d] = !0, n.prototype[h] = !0, QA(i, {
get: function(e, t) {
return this.has(e) ? e : t
},
includes: function(e) {
return this.has(e)
},
keySeq: function() {
return this.valueSeq()
}
}), i.prototype.has = DA.includes, i.prototype.contains = i.prototype.includes, QA(J, o.prototype), QA(V, n.prototype), QA(W, i.prototype), QA(Ce, o.prototype), QA(we, n.prototype), QA(Ie, i.prototype), {
Iterable: A,
Seq: K,
Collection: fe,
Map: Le,
OrderedMap: Dt,
List: gt,
Stack: wA,
Set: rA,
OrderedSet: mA,
Record: oA,
Range: Be,
Repeat: pe,
is: he,
fromJS: ce
}
}()
}, function(e, t, A) {
var o = A(1238);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
var o = A(1382);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t) {
var A = e.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")();
"number" == typeof __g && (__g = A)
}, function(e, t, A) {
"use strict";
function o(e) {
this.name = e || "default", this.streamInfo = {}, this.generatedError = null, this.extraStreamInfo = {}, this.isPaused = !0, this.isFinished = !1, this.isLocked = !1, this._listeners = {
data: [],
end: [],
error: []
}, this.previous = null
}
o.prototype = {
push: function(e) {
this.emit("data", e)
},
end: function() {
if (this.isFinished) return !1;
this.flush();
try {
this.emit("end"), this.cleanUp(), this.isFinished = !0
} catch (e) {
this.emit("error", e)
}
return !0
},
error: function(e) {
return !this.isFinished && (this.isPaused ? this.generatedError = e : (this.isFinished = !0, this.emit("error", e), this.previous && this.previous.error(e), this.cleanUp()), !0)
},
on: function(e, t) {
return this._listeners[e].push(t), this
},
cleanUp: function() {
this.streamInfo = this.generatedError = this.extraStreamInfo = null, this._listeners = []
},
emit: function(e, t) {
if (this._listeners[e])
for (var A = 0; A < this._listeners[e].length; A++) this._listeners[e][A].call(this, t)
},
pipe: function(e) {
return e.registerPrevious(this)
},
registerPrevious: function(e) {
if (this.isLocked) throw new Error("The stream '" + this + "' has already been used.");
this.streamInfo = e.streamInfo, this.mergeStreamInfo(), this.previous = e;
var t = this;
return e.on("data", function(e) {
t.processChunk(e)
}), e.on("end", function() {
t.end()
}), e.on("error", function(e) {
t.error(e)
}), this
},
pause: function() {
return !this.isPaused && !this.isFinished && (this.isPaused = !0, this.previous && this.previous.pause(), !0)
},
resume: function() {
if (!this.isPaused || this.isFinished) return !1;
this.isPaused = !1;
var e = !1;
return this.generatedError && (this.error(this.generatedError), e = !0), this.previous && this.previous.resume(), !e
},
flush: function() {},
processChunk: function(e) {
this.push(e)
},
withStreamInfo: function(e, t) {
return this.extraStreamInfo[e] = t, this.mergeStreamInfo(), this
},
mergeStreamInfo: function() {
for (var e in this.extraStreamInfo) this.extraStreamInfo.hasOwnProperty(e) && (this.streamInfo[e] = this.extraStreamInfo[e])
},
lock: function() {
if (this.isLocked) throw new Error("The stream '" + this + "' has already been used.");
this.isLocked = !0, this.previous && this.previous.lock()
},
toString: function() {
var e = "Worker " + this.name;
return this.previous ? this.previous + " -> " + e : e
}
}, e.exports = o
}, function(e, t, A) {
"use strict";
var o = A(923),
n = A(924),
i = A(422),
a = A(421),
r = A(420);
function s(e, t) {
return Object.keys(t).forEach(function(A) {
e[A] = t[A]
}), e
}
e.exports = function e() {
var t = s({}, r),
A = "en",
l = {},
u = function(e) {
return e
},
c = null,
g = "warning",
d = {};
function h(e, t, i) {
var a = "string" == typeof e ? e : e.default,
r = E(a, "object" == typeof e && e.id || u(a), i || A);
return (r.format || (r.format = n(o(r.message), i || A, d)))(t)
}
h.rich = function(e, t, i) {
var a = "string" == typeof e ? e : e.default,
r = E(a, "object" == typeof e && e.id || u(a), i || A);
return (r.toParts || (r.toParts = n.toParts(o(r.message, {
tagsType: m
}), i || A, d)))(t)
};
var m = "<>";
function p(e, t) {
var A = e[2];
return function(e, t) {
var o = "object" == typeof A ? function(e, t) {
return Object.keys(e).reduce(function(A, o) {
return A[o] = e[o](t), A
}, {})
}(A, t) : A;
return "function" == typeof e ? e(o) : e
}
}
function E(e, t, A) {
var o = a(A, l) || "en",
n = l[o] || (l[o] = {}),
i = n[t];
if ("string" == typeof i && (i = n[t] = {
message: i
}), !i) {
var r = 'Translation for "' + t + '" in "' + o + '" is missing';
if ("warning" === g) "undefined" != typeof console && console.warn(r);
else if ("ignore" !== g) throw new Error(r);
var s = "function" == typeof c ? c(e, t, o) || e : c || e;
i = n[t] = {
message: s
}
}
return i
}
function B(e, t, o, n, r) {
"object" == typeof o && "object" != typeof n && (r = n, n = o, o = 0);
var s = a(r || A, i),
l = s && i[s][e] || f;
return n["=" + +t] || n[l(t - o)] || n.other
}
function f() {
return "other"
}
return d[m] = p, h.setup = function(e) {
return (e = e || {}).locale && (A = e.locale), "translations" in e && (l = e.translations || {}), e.generateId && (u = e.generateId), "missingReplacement" in e && (c = e.missingReplacement), e.missingTranslation && (g = e.missingTranslation), e.formats && (e.formats.number && s(t.number, e.formats.number), e.formats.date && s(t.date, e.formats.date), e.formats.time && s(t.time, e.formats.time)), e.types && ((d = e.types)[m] = p), {
locale: A,
translations: l,
generateId: u,
missingReplacement: c,
missingTranslation: g,
formats: t,
types: d
}
}, h.number = function(e, o, n) {
var i = o && t.number[o] || t.parseNumberPattern(o) || t.number.default;
return new Intl.NumberFormat(n || A, i).format(e)
}, h.date = function(e, o, n) {
var i = o && t.date[o] || t.parseDatePattern(o) || t.date.default;
return new Intl.DateTimeFormat(n || A, i).format(e)
}, h.time = function(e, o, n) {
var i = o && t.time[o] || t.parseDatePattern(o) || t.time.default;
return new Intl.DateTimeFormat(n || A, i).format(e)
}, h.select = function(e, t) {
return t[e] || t.other
}, h.custom = function(e, t, A, o) {
return e[1] in d ? d[e[1]](e, t)(A, o) : A
}, h.plural = B.bind(null, "cardinal"), h.selectordinal = B.bind(null, "ordinal"), h.namespace = e, h
}()
}, function(e, t) {
e.exports = {
BOOLEAN: "Boolean",
COMMAND: "command",
CONDITIONAL: "conditional",
EVENT: "event",
HAT: "hat",
LOOP: "loop",
REPORTER: "reporter"
}
}, function(e, t, A) {
"use strict";
var o = A(4),
n = A.n(o),
i = A(5),
a = A.n(i),
r = A(0),
s = A.n(r),
l = A(1),
u = A.n(l),
c = A(2),
g = A(7),
d = A(38),
h = A.n(d),
m = A(631),
p = A.n(m),
E = A(632),
B = A.n(E);
function f(e) {
return (f = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
})(e)
}
function C(e, t) {
for (var A = 0; A < t.length; A++) {
var o = t[A];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o)
}
}
function w(e, t) {
return !t || "object" !== f(t) && "function" != typeof t ? function(e) {
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}(e) : t
}
function I(e) {
return (I = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
return e.__proto__ || Object.getPrototypeOf(e)
})(e)
}
function y(e, t) {
return (y = Object.setPrototypeOf || function(e, t) {
return e.__proto__ = t, e
})(e, t)
}
var b = function(e) {
function t() {
return function(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, t), w(this, I(t).apply(this, arguments))
}
return function(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
writable: !0,
configurable: !0
}
}), t && y(e, t)
}(t, u.a.PureComponent),
function(e, t, A) {
t && C(e.prototype, t), A && C(e, A)
}(t, [{
key: "render",
value: function() {
return this.props.featured ? u.a.createElement("div", {
className: n()(h.a.libraryItem, h.a.featuredItem, function(e, t, A) {
return t in e ? Object.defineProperty(e, t, {
value: A,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = A, e
}({}, h.a.disabled, this.props.disabled), this.props.extensionId ? h.a.libraryItemExtension : null, this.props.hidden ? h.a.hidden : null),
onClick: this.props.onClick
}, u.a.createElement("div", {
className: h.a.featuredImageContainer
}, this.props.disabled ? u.a.createElement("div", {
className: h.a.comingSoonText
}, u.a.createElement(c.a, {
defaultMessage: "Coming Soon",
id: "gui.extensionLibrary.comingSoon"
})) : null, u.a.createElement("img", {
className: h.a.featuredImage,
src: this.props.iconURL
})), this.props.insetIconURL ? u.a.createElement("div", {
className: h.a.libraryItemInsetImageContainer
}, u.a.createElement("img", {
className: h.a.libraryItemInsetImage,
src: this.props.insetIconURL
})) : null, u.a.createElement("div", {
className: this.props.extensionId ? n()(h.a.featuredExtensionText, h.a.featuredText) : h.a.featuredText
}, u.a.createElement("span", {
className: h.a.libraryItemName
}, this.props.name), u.a.createElement("br", null), u.a.createElement("span", {
className: h.a.featuredDescription
}, this.props.description)), this.props.bluetoothRequired || this.props.internetConnectionRequired || this.props.collaborator ? u.a.createElement("div", {
className: h.a.featuredExtensionMetadata
}, u.a.createElement("div", {
className: h.a.featuredExtensionRequirement
}, this.props.bluetoothRequired || this.props.internetConnectionRequired ? u.a.createElement("div", null, u.a.createElement("div", null, u.a.createElement(c.a, {
defaultMessage: "Requires",
id: "gui.extensionLibrary.requires"
})), u.a.createElement("div", {
className: h.a.featuredExtensionMetadataDetail
}, u.a.createElement("img", {
src: this.props.bluetoothRequired ? p.a : B.a
}))) : null), u.a.createElement("div", {
className: h.a.featuredExtensionCollaboration
}, this.props.collaborator ? u.a.createElement("div", null, u.a.createElement("div", null, u.a.createElement(c.a, {
defaultMessage: "Collaboration with",
id: "gui.extensionLibrary.collaboration"
})), u.a.createElement("div", {
className: h.a.featuredExtensionMetadataDetail
}, this.props.collaborator)) : null)) : null) : u.a.createElement(g.a, {
className: n()(h.a.libraryItem, this.props.hidden ? h.a.hidden : null),
role: "button",
tabIndex: "0",
onBlur: this.props.onBlur,
onClick: this.props.onClick,
onFocus: this.props.onFocus,
onKeyPress: this.props.onKeyPress,
onMouseEnter: this.props.onMouseEnter,
onMouseLeave: this.props.onMouseLeave
}, u.a.createElement(g.a, {
className: h.a.libraryItemImageContainerWrapper
}, u.a.createElement(g.a, {
className: h.a.libraryItemImageContainer
}, u.a.createElement("img", {
className: h.a.libraryItemImage,
src: this.props.iconURL
}))), u.a.createElement("span", {
className: h.a.libraryItemName
}, this.props.name))
}
}]), t
}();
b.propTypes = {
bluetoothRequired: s.a.bool,
collaborator: s.a.string,
description: s.a.oneOfType([s.a.string, s.a.node]),
disabled: s.a.bool,
extensionId: s.a.string,
featured: s.a.bool,
hidden: s.a.bool,
iconURL: s.a.string,
insetIconURL: s.a.string,
internetConnectionRequired: s.a.bool,
name: s.a.oneOfType([s.a.string, s.a.node]),
onBlur: s.a.func.isRequired,
onClick: s.a.func.isRequired,
onFocus: s.a.func.isRequired,
onKeyPress: s.a.func.isRequired,
onMouseEnter: s.a.func.isRequired,
onMouseLeave: s.a.func.isRequired
}, b.defaultProps = {
disabled: !1
};
var M = b;
function T(e) {
return (T = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
})(e)
}
function S(e, t) {
for (var A = 0; A < t.length; A++) {
var o = t[A];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o)
}
}
function Q(e) {
return (Q = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
return e.__proto__ || Object.getPrototypeOf(e)
})(e)
}
function D(e) {
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}
function k(e, t) {
return (k = Object.setPrototypeOf || function(e, t) {
return e.__proto__ = t, e
})(e, t)
}
var N = function(e) {
function t(e) {
var A;
return function(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, t), A = function(e, t) {
return !t || "object" !== T(t) && "function" != typeof t ? D(e) : t
}(this, Q(t).call(this, e)), a()(D(A), ["handleBlur", "handleClick", "handleFocus", "handleKeyPress", "handleMouseEnter", "handleMouseLeave", "rotateIcon", "startRotatingIcons", "stopRotatingIcons"]), A.state = {
iconIndex: 0,
isRotatingIcon: !1
}, A
}
return function(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
writable: !0,
configurable: !0
}
}), t && k(e, t)
}(t, u.a.PureComponent),
function(e, t, A) {
t && S(e.prototype, t), A && S(e, A)
}(t, [{
key: "componentWillUnmount",
value: function() {
clearInterval(this.intervalId)
}
}, {
key: "handleBlur",
value: function(e) {
this.handleMouseLeave(e)
}
}, {
key: "handleClick",
value: function(e) {
this.props.disabled || this.props.onSelect(this.props.id), e.preventDefault()
}
}, {
key: "handleFocus",
value: function(e) {
this.handleMouseEnter(e)
}
}, {
key: "handleKeyPress",
value: function(e) {
" " !== e.key && "Enter" !== e.key || (e.preventDefault(), this.props.onSelect(this.props.id))
}
}, {
key: "handleMouseEnter",
value: function() {
this.props.onMouseEnter(this.props.id), this.props.icons && this.props.icons.length && (this.stopRotatingIcons(), this.setState({
isRotatingIcon: !0
}, this.startRotatingIcons))
}
}, {
key: "handleMouseLeave",
value: function() {
this.props.onMouseLeave(this.props.id), this.props.icons && this.props.icons.length && this.setState({
isRotatingIcon: !1
}, this.stopRotatingIcons)
}
}, {
key: "startRotatingIcons",
value: function() {
this.rotateIcon(), this.intervalId = setInterval(this.rotateIcon, 300)
}
}, {
key: "stopRotatingIcons",
value: function() {
this.intervalId && (this.intervalId = clearInterval(this.intervalId))
}
}, {
key: "rotateIcon",
value: function() {
var e = (this.state.iconIndex + 1) % this.props.icons.length;
this.setState({
iconIndex: e
})
}
}, {
key: "curIconMd5",
value: function() {
return this.props.icons && this.state.isRotatingIcon && this.state.iconIndex < this.props.icons.length && this.props.icons[this.state.iconIndex] && this.props.icons[this.state.iconIndex].baseLayerMD5 ? this.props.icons[this.state.iconIndex].baseLayerMD5 : this.props.iconMd5
}
}, {
key: "render",
value: function() {
var e = this.curIconMd5(),
t = e ? "https://cdn.assets.scratch.mit.edu/internalapi/asset/".concat(e, "/get/") : this.props.iconRawURL;
return u.a.createElement(M, {
bluetoothRequired: this.props.bluetoothRequired,
collaborator: this.props.collaborator,
description: this.props.description,
disabled: this.props.disabled,
extensionId: this.props.extensionId,
featured: this.props.featured,
hidden: this.props.hidden,
iconURL: t,
icons: this.props.icons,
id: this.props.id,
insetIconURL: this.props.insetIconURL,
internetConnectionRequired: this.props.internetConnectionRequired,
name: this.props.name,
onBlur: this.handleBlur,
onClick: this.handleClick,
onFocus: this.handleFocus,
onKeyPress: this.handleKeyPress,
onMouseEnter: this.handleMouseEnter,
onMouseLeave: this.handleMouseLeave
})
}
}]), t
}();
N.propTypes = {
bluetoothRequired: s.a.bool,
collaborator: s.a.string,
description: s.a.oneOfType([s.a.string, s.a.node]),
disabled: s.a.bool,
extensionId: s.a.string,
featured: s.a.bool,
hidden: s.a.bool,
iconMd5: s.a.string,
iconRawURL: s.a.string,
icons: s.a.arrayOf(s.a.shape({
baseLayerMD5: s.a.string
})),
id: s.a.number.isRequired,
insetIconURL: s.a.string,
internetConnectionRequired: s.a.bool,
name: s.a.oneOfType([s.a.string, s.a.node]),
onMouseEnter: s.a.func.isRequired,
onMouseLeave: s.a.func.isRequired,
onSelect: s.a.func.isRequired
};
var v = Object(c.e)(N),
O = A(81),
R = A(204),
F = A(634),
Y = A.n(F),
U = A(635),
L = A.n(U),
G = A(154),
x = A.n(G);
var _ = function(e) {
var t = e.className,
A = e.onChange,
o = e.onClear,
i = e.placeholderText,
a = e.filterQuery,
r = e.inputClassName;
return u.a.createElement("div", {
className: n()(t, x.a.filter, function(e, t, A) {
return t in e ? Object.defineProperty(e, t, {
value: A,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = A, e
}({}, x.a.isActive, a.length > 0))
}, u.a.createElement("img", {
className: x.a.filterIcon,
src: Y.a
}), u.a.createElement("input", {
className: n()(x.a.filterInput, r),
placeholder: i,
type: "text",
value: a,
onChange: A
}), u.a.createElement("div", {
className: x.a.xIconWrapper,
onClick: o
}, u.a.createElement("img", {
className: x.a.xIcon,
src: L.a
})))
};
_.propTypes = {
className: s.a.string,
filterQuery: s.a.string,
inputClassName: s.a.string,
onChange: s.a.func,
onClear: s.a.func,
placeholderText: s.a.string
}, _.defaultProps = {
placeholderText: "Search"
};
var P = _,
H = A(56),
j = A(284),
z = A.n(j);
function K() {
return (K = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var A = arguments[t];
for (var o in A) Object.prototype.hasOwnProperty.call(A, o) && (e[o] = A[o])
}
return e
}).apply(this, arguments)
}
function J(e, t, A) {
return t in e ? Object.defineProperty(e, t, {
value: A,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = A, e
}
function V(e, t) {
if (null == e) return {};
var A, o, n = function(e, t) {
if (null == e) return {};
var A, o, n = {},
i = Object.keys(e);
for (o = 0; o < i.length; o++) A = i[o], t.indexOf(A) >= 0 || (n[A] = e[A]);
return n
}(e, t);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
for (o = 0; o < i.length; o++) A = i[o], t.indexOf(A) >= 0 || Object.prototype.propertyIsEnumerable.call(e, A) && (n[A] = e[A])
}
return n
}
var W = function(e) {
var t = e.active,
A = e.iconClassName,
o = e.className,
i = (e.tag, e.intlLabel),
a = V(e, ["active", "iconClassName", "className", "tag", "intlLabel"]);
return u.a.createElement(H.a, K({
className: n()(z.a.tagButton, o, J({}, z.a.active, t)),
iconClassName: n()(z.a.tagButtonIcon, A)
}, a), u.a.createElement(c.a, i))
};
W.propTypes = function(e) {
for (var t = 1; t < arguments.length; t++) {
var A = null != arguments[t] ? arguments[t] : {},
o = Object.keys(A);
"function" == typeof Object.getOwnPropertySymbols && (o = o.concat(Object.getOwnPropertySymbols(A).filter(function(e) {
return Object.getOwnPropertyDescriptor(A, e).enumerable
}))), o.forEach(function(t) {
J(e, t, A[t])
})
}
return e
}({}, H.a.propTypes, {
active: s.a.bool,
intlLabel: s.a.shape({
defaultMessage: s.a.string,
description: s.a.string,
id: s.a.string
}).isRequired,
tag: s.a.string.isRequired
}), W.defaultProps = {
active: !1
};
var q = W;
function X(e, t, A) {
return t in e ? Object.defineProperty(e, t, {
value: A,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = A, e
}
function Z(e) {
return (Z = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
})(e)
}
function $() {
return ($ = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var A = arguments[t];
for (var o in A) Object.prototype.hasOwnProperty.call(A, o) && (e[o] = A[o])
}
return e
}).apply(this, arguments)
}
function ee(e, t) {
for (var A = 0; A < t.length; A++) {
var o = t[A];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o)
}
}
function te(e) {
return (te = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
return e.__proto__ || Object.getPrototypeOf(e)
})(e)
}
function Ae(e) {
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}
function oe(e, t) {
return (oe = Object.setPrototypeOf || function(e, t) {
return e.__proto__ = t, e
})(e, t)
}
var ne = function(e) {
function t(e) {
var A;
return function(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, t), A = function(e, t) {
return !t || "object" !== Z(t) && "function" != typeof t ? Ae(e) : t
}(this, te(t).call(this, e)), a()(Ae(A), ["handleClick"]), A
}
return function(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
writable: !0,
configurable: !0
}
}), t && oe(e, t)
}(t, u.a.Component),
function(e, t, A) {
t && ee(e.prototype, t), A && ee(e, A)
}(t, [{
key: "handleClick",
value: function() {
this.props.onClick(this.props.tag)
}
}, {
key: "render",
value: function() {
return u.a.createElement(q, $({}, this.props, {
onClick: this.handleClick
}))
}
}]), t
}();
ne.propTypes = function(e) {
for (var t = 1; t < arguments.length; t++) {
var A = null != arguments[t] ? arguments[t] : {},
o = Object.keys(A);
"function" == typeof Object.getOwnPropertySymbols && (o = o.concat(Object.getOwnPropertySymbols(A).filter(function(e) {
return Object.getOwnPropertyDescriptor(A, e).enumerable
}))), o.forEach(function(t) {
X(e, t, A[t])
})
}
return e
}({}, q.propTypes, {
onClick: s.a.func
});
var ie = ne,
ae = A(36),
re = A(85),
se = A.n(re);
function le(e) {
return (le = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
})(e)
}
function ue() {
return (ue = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var A = arguments[t];
for (var o in A) Object.prototype.hasOwnProperty.call(A, o) && (e[o] = A[o])
}
return e
}).apply(this, arguments)
}
function ce(e, t) {
for (var A = 0; A < t.length; A++) {
var o = t[A];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o)
}
}
function ge(e) {
return (ge = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
return e.__proto__ || Object.getPrototypeOf(e)
})(e)
}
function de(e) {
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}
function he(e, t) {
return (he = Object.setPrototypeOf || function(e, t) {
return e.__proto__ = t, e
})(e, t)
}
var me = Object(c.d)({
filterPlaceholder: {
id: "gui.library.filterPlaceholder",
defaultMessage: "Search"
},
allTag: {
id: "gui.library.allTag",
defaultMessage: "All"
}
}),
pe = {
tag: "all",
intlLabel: me.allTag
},
Ee = [pe],
Be = function(e) {
function t(e) {
var A;
return function(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, t), A = function(e, t) {
return !t || "object" !== le(t) && "function" != typeof t ? de(e) : t
}(this, ge(t).call(this, e)), a()(de(A), ["handleClose", "handleFilterChange", "handleFilterClear", "handleMouseEnter", "handleMouseLeave", "handleSelect", "handleTagClick", "setFilteredDataRef"]), A.state = {
selectedItem: null,
filterQuery: "",
selectedTag: pe.tag
}, A
}
return function(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
writable: !0,
configurable: !0
}
}), t && he(e, t)
}(t, u.a.Component),
function(e, t, A) {
t && ce(e.prototype, t), A && ce(e, A)
}(t, [{
key: "componentDidUpdate",
value: function(e, t) {
t.filterQuery === this.state.filterQuery && t.selectedTag === this.state.selectedTag || this.scrollToTop()
}
}, {
key: "handleSelect",
value: function(e) {
this.handleClose(), this.props.onItemSelected(this.getFilteredData()[e])
}
}, {
key: "handleClose",
value: function() {
this.props.onRequestClose(), ae.a.pageview("/".concat(this.props.id, "/search?q=").concat(this.state.filterQuery))
}
}, {
key: "handleTagClick",
value: function(e) {
this.setState({
filterQuery: "",
selectedTag: e.toLowerCase()
})
}
}, {
key: "handleMouseEnter",
value: function(e) {
this.props.onItemMouseEnter && this.props.onItemMouseEnter(this.getFilteredData()[e])
}
}, {
key: "handleMouseLeave",
value: function(e) {
this.props.onItemMouseLeave && this.props.onItemMouseLeave(this.getFilteredData()[e])
}
}, {
key: "handleFilterChange",
value: function(e) {
this.setState({
filterQuery: e.target.value,
selectedTag: pe.tag
})
}
}, {
key: "handleFilterClear",
value: function() {
this.setState({
filterQuery: ""
})
}
}, {
key: "getFilteredData",
value: function() {
var e = this;
return "all" === this.state.selectedTag ? this.state.filterQuery ? this.props.data.filter(function(t) {
return -1 !== (t.tags || []).map(String.prototype.toLowerCase.call, String.prototype.toLowerCase).concat(t.name ? ("string" == typeof t.name ? t.name : e.props.intl.formatMessage(t.name.props)).toLowerCase() : null).join("\n").indexOf(e.state.filterQuery.toLowerCase())
}) : this.props.data : this.props.data.filter(function(t) {
return t.tags && -1 !== t.tags.map(String.prototype.toLowerCase.call, String.prototype.toLowerCase).indexOf(e.state.selectedTag)
})
}
}, {
key: "scrollToTop",
value: function() {
this.filteredDataRef.scrollTop = 0
}
}, {
key: "setFilteredDataRef",
value: function(e) {
this.filteredDataRef = e
}
}, {
key: "render",
value: function() {
var e = this;
return u.a.createElement(O.a, {
fullScreen: !0,
contentLabel: this.props.title,
id: this.props.id,
onRequestClose: this.handleClose
}, (this.props.filterable || this.props.tags) && u.a.createElement("div", {
className: se.a.filterBar
}, this.props.filterable && u.a.createElement(P, {
className: n()(se.a.filterBarItem, se.a.filter),
filterQuery: this.state.filterQuery,
inputClassName: se.a.filterInput,
placeholderText: this.props.intl.formatMessage(me.filterPlaceholder),
onChange: this.handleFilterChange,
onClear: this.handleFilterClear
}), this.props.filterable && this.props.tags && u.a.createElement(R.a, {
className: n()(se.a.filterBarItem, se.a.divider)
}), this.props.tags && u.a.createElement("div", {
className: se.a.tagWrapper
}, Ee.concat(this.props.tags).map(function(t, A) {
return u.a.createElement(ie, ue({
active: e.state.selectedTag === t.tag.toLowerCase(),
className: n()(se.a.filterBarItem, se.a.tagButton, t.className),
key: "tag-button-".concat(A),
onClick: e.handleTagClick
}, t))
}))), u.a.createElement("div", {
className: n()(se.a.libraryScrollGrid, function(e, t, A) {
return t in e ? Object.defineProperty(e, t, {
value: A,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = A, e
}({}, se.a.withFilterBar, this.props.filterable || this.props.tags)),
ref: this.setFilteredDataRef
}, this.getFilteredData().map(function(t, A) {
return u.a.createElement(v, {
bluetoothRequired: t.bluetoothRequired,
collaborator: t.collaborator,
description: t.description,
disabled: t.disabled,
extensionId: t.extensionId,
featured: t.featured,
hidden: t.hidden,
iconMd5: t.md5,
iconRawURL: t.rawURL,
icons: t.json && t.json.costumes,
id: A,
insetIconURL: t.insetIconURL,
internetConnectionRequired: t.internetConnectionRequired,
key: "item_".concat(A),
name: t.name,
onMouseEnter: e.handleMouseEnter,
onMouseLeave: e.handleMouseLeave,
onSelect: e.handleSelect
})
})))
}
}]), t
}();
Be.propTypes = {
data: s.a.arrayOf(s.a.shape({
md5: s.a.string,
name: s.a.oneOfType([s.a.string, s.a.node]),
rawURL: s.a.string
})),
filterable: s.a.bool,
id: s.a.string.isRequired,
intl: c.f.isRequired,
onItemMouseEnter: s.a.func,
onItemMouseLeave: s.a.func,
onItemSelected: s.a.func,
onRequestClose: s.a.func,
tags: s.a.arrayOf(s.a.shape(ie.propTypes)),
title: s.a.string.isRequired
}, Be.defaultProps = {
filterable: !0
};
t.a = Object(c.e)(Be)
}, function(e, t, A) {
"use strict";
var o = A(5),
n = A.n(o),
i = A(0),
a = A.n(i),
r = A(1),
s = A.n(r),
l = A(6),
u = A(4),
c = A.n(u),
g = A(90),
d = A.n(g),
h = A(2),
m = A(7),
p = A(56),
E = A(91),
B = A(259),
f = A.n(B),
C = A(630),
w = A.n(C),
I = A(70),
y = A.n(I);
var b = function(e) {
return s.a.createElement(d.a, {
isOpen: !0,
className: c()(y.a.modalContent, e.className, function(e, t, A) {
return t in e ? Object.defineProperty(e, t, {
value: A,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = A, e
}({}, y.a.fullScreen, e.fullScreen)),
contentLabel: e.contentLabel,
overlayClassName: y.a.modalOverlay,
onRequestClose: e.onRequestClose
}, s.a.createElement(m.a, {
dir: e.isRtl ? "rtl" : "ltr",
direction: "column",
grow: 1
}, s.a.createElement("div", {
className: c()(y.a.header, e.headerClassName)
}, e.onHelp ? s.a.createElement("div", {
className: c()(y.a.headerItem, y.a.headerItemHelp)
}, s.a.createElement(p.a, {
className: y.a.helpButton,
iconSrc: w.a,
onClick: e.onHelp
}, s.a.createElement(h.a, {
defaultMessage: "Help",
id: "gui.modal.help"
}))) : null, s.a.createElement("div", {
className: c()(y.a.headerItem, y.a.headerItemTitle)
}, e.headerImage ? s.a.createElement("img", {
className: y.a.headerImage,
src: e.headerImage
}) : null, e.contentLabel), s.a.createElement("div", {
className: c()(y.a.headerItem, y.a.headerItemClose)
}, e.fullScreen ? s.a.createElement(p.a, {
className: y.a.backButton,
iconSrc: f.a,
onClick: e.onRequestClose
}, s.a.createElement(h.a, {
defaultMessage: "Back",
id: "gui.modal.back"
})) : s.a.createElement(E.a, {
size: E.a.SIZE_LARGE,
onClick: e.onRequestClose
}))), e.children))
};
b.propTypes = {
children: a.a.node,
className: a.a.string,
contentLabel: a.a.oneOfType([a.a.string, a.a.object]).isRequired,
fullScreen: a.a.bool,
headerClassName: a.a.string,
headerImage: a.a.string,
isRtl: a.a.bool,
onHelp: a.a.func,
onRequestClose: a.a.func
};
var M = b;
function T(e) {
return (T = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
})(e)
}
function S(e, t) {
for (var A = 0; A < t.length; A++) {
var o = t[A];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o)
}
}
function Q(e) {
return (Q = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
return e.__proto__ || Object.getPrototypeOf(e)
})(e)
}
function D(e) {
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}
function k(e, t) {
return (k = Object.setPrototypeOf || function(e, t) {
return e.__proto__ = t, e
})(e, t)
}
var N = function(e) {
function t(e) {
var A;
return function(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, t), A = function(e, t) {
return !t || "object" !== T(t) && "function" != typeof t ? D(e) : t
}(this, Q(t).call(this, e)), n()(D(A), ["addEventListeners", "removeEventListeners", "handlePopState", "pushHistory"]), A.addEventListeners(), A
}
return function(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
writable: !0,
configurable: !0
}
}), t && k(e, t)
}(t, s.a.Component),
function(e, t, A) {
t && S(e.prototype, t), A && S(e, A)
}(t, [{
key: "componentDidMount",
value: function() {
this.pushHistory(this.id, null === history.state || history.state !== this.id)
}
}, {
key: "componentWillUnmount",
value: function() {
this.removeEventListeners()
}
}, {
key: "addEventListeners",
value: function() {
window.addEventListener("popstate", this.handlePopState)
}
}, {
key: "removeEventListeners",
value: function() {
window.removeEventListener("popstate", this.handlePopState)
}
}, {
key: "handlePopState",
value: function() {
this.props.onRequestClose()
}
}, {
key: "pushHistory",
value: function(e, t) {
if (t) return history.pushState(e, this.id);
history.replaceState(e, this.id)
}
}, {
key: "render",
value: function() {
return s.a.createElement(M, this.props)
}
}, {
key: "id",
get: function() {
return "modal-".concat(this.props.id)
}
}]), t
}();
N.propTypes = {
id: a.a.string.isRequired,
isRtl: a.a.bool,
onRequestClose: a.a.func,
onRequestOpen: a.a.func
};
t.a = Object(l.b)(function(e) {
return {
isRtl: e.locales.isRtl
}
})(N)
}, function(e, t, A) {
"use strict";
A.d(t, "a", function() {
return i
}), A.d(t, "b", function() {
return n
}), A.d(t, "c", function() {
return a
}), A.d(t, "d", function() {
return r
});
var o = "scratch-gui/project-changed/SET_PROJECT_CHANGED",
n = !1,
i = function(e, t) {
switch (void 0 === e && (e = n), t.type) {
case o:
return t.changed;
default:
return e
}
},
a = function() {
return {
type: o,
changed: !0
}
},
r = function() {
return {
type: o,
changed: !1
}
}
}, function(e, t, A) {
var o = A(1147);
e.exports = function(e) {
var t, A, n, i;
if (t = /^((?:rgb|hs[lv]|cmyk|xyz|lab)a?)\s*\(([^\)]*)\)/.exec(e)) {
var a = t[1],
r = "cmyk" === (s = a.replace(/a$/, "")) ? 4 : 3;
A = o[s], n = t[2].replace(/^\s+|\s+$/g, "").split(/\s*,\s*/).map(function(e, t) {
return /%$/.test(e) && t === r ? parseFloat(e) / 100 : (/%$/.test(e), parseFloat(e))
}), a === s && n.push(1), i = void 0 === n[r] ? 1 : n[r], n = n.slice(0, r), A[s] = function() {
return n
}
} else if (/^#[A-Fa-f0-9]+$/.test(e)) {
var s;
r = (s = e.replace(/^#/, "")).length;
A = o.rgb, n = (n = s.split(3 === r ? /(.)/ : /(..)/)).filter(Boolean).map(function(e) {
return 3 === r ? parseInt(e + e, 16) : parseInt(e, 16)
}), i = 1, A.rgb = function() {
return n
}, n[0] || (n[0] = 0), n[1] || (n[1] = 0), n[2] || (n[2] = 0)
} else(A = o.keyword).keyword = function() {
return e
}, n = e, i = 1;
var l = {
rgb: void 0,
hsl: void 0,
hsv: void 0,
cmyk: void 0,
keyword: void 0,
hex: void 0
};
try {
l.rgb = A.rgb(n)
} catch (e) {}
try {
l.hsl = A.hsl(n)
} catch (e) {}
try {
l.hsv = A.hsv(n)
} catch (e) {}
try {
l.cmyk = A.cmyk(n)
} catch (e) {}
try {
l.keyword = A.keyword(n)
} catch (e) {}
return l.rgb && (l.hex = "#" + l.rgb.map(function(e) {
var t = e.toString(16);
return 1 === t.length ? "0" + t : t
}).join("")), l.rgb && (l.rgba = l.rgb.concat(i)), l.hsl && (l.hsla = l.hsl.concat(i)), l.hsv && (l.hsva = l.hsv.concat(i)), l.cmyk && (l.cmyka = l.cmyk.concat(i)), l
}
}, function(e, t, A) {
var o = A(1273);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
var o = A(1244);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t, A) {
var o = A(1361);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
var n = {
hmr: !0,
transform: void 0,
insertInto: void 0
};
A(10)(o, n);
o.locals && (e.exports = o.locals)
}, function(e, t) {
e.exports = {
ANGLE: "angle",
BOOLEAN: "Boolean",
COLOR: "color",
NUMBER: "number",
STRING: "string",
MATRIX: "matrix",
NOTE: "note"
}
}, function(e, t, A) {
"use strict";
function o() {
var e = this.constructor.getDerivedStateFromProps(this.props, this.state);
null !== e && void 0 !== e && this.setState(e)
}
function n(e) {
this.setState(function(t) {
var A = this.constructor.getDerivedStateFromProps(e, t);
return null !== A && void 0 !== A ? A : null
}.bind(this))
}
function i(e, t) {
try {
var A = this.props,
o = this.state;
this.props = e, this.state = t, this.__reactInternalSnapshotFlag = !0, this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(A, o)
} finally {
this.props = A, this.state = o
}
}
function a(e) {
var t = e.prototype;
if (!t || !t.isReactComponent) throw new Error("Can only polyfill class components");
if ("function" != typeof e.getDerivedStateFromProps && "function" != typeof t.getSnapshotBeforeUpdate) return e;
var A = null,
a = null,
r = null;
if ("function" == typeof t.componentWillMount ? A = "componentWillMount" : "function" == typeof t.UNSAFE_componentWillMount && (A = "UNSAFE_componentWillMount"), "function" == typeof t.componentWillReceiveProps ? a = "componentWillReceiveProps" : "function" == typeof t.UNSAFE_componentWillReceiveProps && (a = "UNSAFE_componentWillReceiveProps"), "function" == typeof t.componentWillUpdate ? r = "componentWillUpdate" : "function" == typeof t.UNSAFE_componentWillUpdate && (r = "UNSAFE_componentWillUpdate"), null !== A || null !== a || null !== r) {
var s = e.displayName || e.name,
l = "function" == typeof e.getDerivedStateFromProps ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n" + s + " uses " + l + " but also contains the following legacy lifecycles:" + (null !== A ? "\n " + A : "") + (null !== a ? "\n " + a : "") + (null !== r ? "\n " + r : "") + "\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")
}
if ("function" == typeof e.getDerivedStateFromProps && (t.componentWillMount = o, t.componentWillReceiveProps = n), "function" == typeof t.getSnapshotBeforeUpdate) {
if ("function" != typeof t.componentDidUpdate) throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");
t.componentWillUpdate = i;
var u = t.componentDidUpdate;
t.componentDidUpdate = function(e, t, A) {
var o = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : A;
u.call(this, e, t, o)
}
}
return e
}
A.r(t), A.d(t, "polyfill", function() {
return a
}), o.__suppressDeprecationWarning = !0, n.__suppressDeprecationWarning = !0, i.__suppressDeprecationWarning = !0
}, function(e, t, A) {
"use strict";
A.d(t, "a", function() {
return i
}), A.d(t, "b", function() {
return n
}), A.d(t, "c", function() {
return a
});
var o = "scratch-gui/restore-deletion/RESTORE_UPDATE",
n = {
restoreFun: null,
deletedItem: ""
},
i = function(e, t) {
switch (void 0 === e && (e = n), t.type) {
case o:
return Object.assign({}, e, t.state);
default:
return e
}
},
a = function(e) {
return {
type: o,
state: {
restoreFun: e.restoreFun,
deletedItem: e.deletedItem
}
}
}
}, function(e, t, A) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var o = function(e) {
return e && e.__esModule ? e : {
default: e
}
}(A(1180));
t.default = o.default, e.exports = t.default
}, function(e, t, A) {
"use strict";
var o, n = A(0),
i = A.n(n),
a = A(1),
r = A.n(a),
s = A(4),
l = A.n(s),
u = A(135),
c = A.n(u),
g = A(133),
d = A.n(g),
h = A(629),
m = A.n(h),
p = A(259),
E = A.n(p);
function B(e, t, A) {
return t in e ? Object.defineProperty(e, t, {
value: A,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = A, e
}
var f = {},
C = function e(t) {
var A;
return r.a.createElement("div", {
"aria-label": "Close",
className: l()(c.a.closeButton, t.className, (A = {}, B(A, c.a.small, t.size === e.SIZE_SMALL), B(A, c.a.large, t.size === e.SIZE_LARGE), B(A, c.a.orange, t.color === e.COLOR_ORANGE), A)),
role: "button",
tabIndex: "0",
onClick: t.onClick
}, "back" === t.buttonType ? r.a.createElement("img", {
className: c.a.backIcon,
src: E.a
}) : r.a.createElement("img", {
className: l()(c.a.closeIcon, B({}, c.a[t.color], t.color !== e.COLOR_NEUTRAL)),
src: t.color && f[t.color] ? f[t.color] : d.a
}))
};
C.SIZE_SMALL = "small", C.SIZE_LARGE = "large", C.COLOR_NEUTRAL = "neutral", C.COLOR_GREEN = "green", C.COLOR_ORANGE = "orange", B(o = {}, C.COLOR_NEUTRAL, d.a), B(o, C.COLOR_GREEN, d.a), B(o, C.COLOR_ORANGE, m.a), f = o, C.propTypes = {
buttonType: i.a.oneOf(["back", "close"]),
className: i.a.string,
color: i.a.string,
onClick: i.a.func.isRequired,
size: i.a.oneOf([C.SIZE_SMALL, C.SIZE_LARGE])
}, C.defaultProps = {
color: C.COLOR_NEUTRAL,
size: C.SIZE_LARGE,
buttonType: "close"
}, t.a = C
}, function(e, t, A) {
var o = A(1251);
"string" == typeof o && (o = [
[e.i, o, ""]
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment