Skip to content

Instantly share code, notes, and snippets.

@jdjkelly
Created June 5, 2013 17:18
Show Gist options
  • Save jdjkelly/5715588 to your computer and use it in GitHub Desktop.
Save jdjkelly/5715588 to your computer and use it in GitHub Desktop.
function URI(e) {
e || (e = "");
var t = /^(?:([^:\/?\#]+):)?(?:\/\/([^\/?\#]*))?([^?\#]*)(?:\?([^\#]*))?(?:\#(.*))?/,
n = e.match(t);
this.scheme = n[1] || null, this.authority = n[2] || null, this.path = n[3] || null, this.query = n[4] || null, this.fragment = n[5] || null
}(function () {
Stripe.setPublishableKey(PRELOAD.stripe_settings.public_key)
}).call(this), PRELOAD.intercom_settings && (window.intercomSettings = PRELOAD.intercom_settings, $.extend(window.intercomSettings, {
widget: {
activator: "#intercom",
use_counter: !0
}
}), function () {
var e = window,
t = e.Intercom;
if (typeof t == "function") t("reattach_activator"), t("update", intercomSettings);
else {
var n = document,
r = function () {
r.c(arguments)
};
r.q = [], r.c = function (e) {
r.q.push(e)
}, e.Intercom = r;
function i() {
var e = n.createElement("script");
e.type = "text/javascript", e.async = !0, e.src = "https://static.intercomcdn.com/intercom.v1.js";
var t = n.getElementsByTagName("script")[0];
t.parentNode.insertBefore(e, t)
}
e.attachEvent ? e.attachEvent("onload", i) : e.addEventListener("load", i, !1)
}
}()), URI.prototype.toString = function () {
var e = "";
return this.scheme && (e += this.scheme + ":"), this.authority && (e += "//" + this.authority), this.path && (e += this.path), this.query && (e += "?" + this.query), this.fragment && (e += "#" + this.fragment), e
},
function () {
function e(e, t) {
var n = /^(.*)\//;
return e.authority && !e.path ? "/" + t : e.path.match(n)[0] + t
}
function n(e) {
if (!e) return "";
var n = e.replace(/\/\.\//g, "/");
n = n.replace(/\/\.$/, "/");
while (n.match(t)) n = n.replace(t, "/");
n = n.replace(/\/([^\/]*)\/\.\.$/, "/");
while (n.match(/\/\.\.\//)) n = n.replace(/\/\.\.\//, "/");
return n
}
var t = /\/((?!\.\.\/)[^\/]*)\/\.\.\//;
URI.prototype.resolve = function (t) {
var r = new URI;
return this.scheme ? (r.scheme = this.scheme, r.authority = this.authority, r.path = n(this.path), r.query = this.query) : (this.authority ? (r.authority = this.authority, r.path = n(this.path), r.query = this.query) : (this.path ? (this.path.charAt(0) === "/" ? r.path = n(this.path) : (r.path = e(t, this.path), r.path = n(r.path)), r.query = this.query) : (r.path = t.path, this.query ? r.query = this.query : r.query = t.query), r.authority = t.authority), r.scheme = t.scheme), r.fragment = this.fragment, r
}
}();
var TraceKit = {};
TraceKit.report = function () {
function r(t) {
e.push(t)
}
function i(t) {
for (var n = e.length - 1; n >= 0; --n) e[n] === t && e.splice(n, 1)
}
function s(t) {
var n = null;
for (var r in e)
if (e.hasOwnProperty(r)) try {
e[r](t)
} catch (i) {
n = i
}
if (n) throw n
}
function u(e) {
if (n) {
if (t === e) return;
var r = n;
n = null, t = null, s(r)
}
var i = TraceKit.computeStackTrace(e);
throw n = i, t = e, window.setTimeout(function () {
t === e && (n = null, t = null, s(i))
}, i.incomplete ? 2e3 : 0), e
}
var e = [],
t = null,
n = null,
o = window.onerror;
return window.onerror = function (e, r, i) {
var u = null;
if (n) TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(n, r, i, e), u = n, n = null, t = null;
else {
var a = {
url: r,
line: i
};
a.func = TraceKit.computeStackTrace.guessFunctionName(a.url, a.line), a.context = TraceKit.computeStackTrace.gatherContext(a.url, a.line), u = {
mode: "onerror",
message: e,
stack: [a]
}
}
return s(u), o ? o.apply(this, arguments) : !1
}, u.subscribe = r, u.unsubscribe = i, u
}(), TraceKit.computeStackTrace = function () {
function n(e) {
try {
XMLHttpRequest === undefined && (XMLHttpRequest = function () {
try {
return new ActiveXObject("Msxml2.XMLHTTP.6.0")
} catch (e) {}
try {
return new ActiveXObject("Msxml2.XMLHTTP.3.0")
} catch (e) {}
try {
return new ActiveXObject("Msxml2.XMLHTTP")
} catch (e) {}
try {
return new ActiveXObject("Microsoft.XMLHTTP")
} catch (e) {}
throw new Error("No XHR.")
});
var t = new XMLHttpRequest;
return t.open("GET", e, !1), t.send(""), t.responseText
} catch (n) {
return ""
}
}
function r(e) {
if (!t.hasOwnProperty(e)) {
var r, i = e.split("/");
i.length > 2 && i[2] === document.domain ? r = n(e) : r = [], t[e] = r.length ? r.split("\n") : []
}
return t[e]
}
function i(e, t) {
var n = /function ([^(]*)\(([^)]*)\)/,
i = /['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,
s = "",
o = 10,
u = r(e),
a;
if (!u.length) return "?";
for (var f = 0; f < o; ++f) {
s = u[t - f] + s;
if (s !== undefined) {
if (a = i.exec(s)) return a[1];
if (a = n.exec(s)) return a[1]
}
}
return "?"
}
function s(e, t) {
var n = r(e),
i = [],
s = !1;
if (!n.length) return null;
t -= 1;
for (var o = t - 2, u = t + 2; o < u; ++o) i.push(n[o]), n[o] !== undefined && (s = !0);
return s ? i : null
}
function o(e) {
return e.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g, "\\$&")
}
function u(e) {
return o(e).replace("<", "(?:<|&lt;)").replace(">", "(?:>|&gt;)").replace("&", "(?:&|&amp;)").replace('"', '(?:"|&quot;)').replace(/\s+/g, "\\s+")
}
function a(e, t) {
var n, i;
for (var s = 0, o = t.length; s < o; ++s)
if ((n = r(t[s])).length) {
n = n.join("\n");
if (i = e.exec(n)) return {
url: t[s],
line: n.substring(0, i.index).split("\n").length,
column: i.index - n.lastIndexOf("\n", i.index) - 1
}
}
return null
}
function f(e, t, n) {
var i = r(t),
s = new RegExp("\\b" + o(e) + "\\b"),
u;
return n -= 1, i && i.length > n && (u = s.exec(i[n])) ? u.index : null
}
function l(e) {
var t = [window.location.href],
n = document.getElementsByTagName("script"),
r, i = "" + e,
s = /^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,
f = /^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,
l, c, h;
for (var p = 0; p < n.length; ++p) {
var d = n[p];
d.src && t.push(d.src)
}
if (!(c = s.exec(i))) l = new RegExp(o(i).replace(/\s+/g, "\\s+"));
else {
var v = c[1] ? "\\s+" + c[1] : "",
m = c[2].split(",").join("\\s*,\\s*");
r = o(c[3]).replace(/;$/, ";?").replace(/\s+/g, "\\s+"), l = new RegExp("function" + v + "\\s*\\(\\s*" + m + "\\s*\\)\\s*{\\s*" + r + "\\s*}")
} if (h = a(l, t)) return h;
if (c = f.exec(i)) {
var g = c[1];
r = u(c[2]), l = new RegExp("on" + g + "=[\\'\"]\\s*" + r + "\\s*[\\'\"]", "i");
if (h = a(l, t[0])) return h;
l = new RegExp(r);
if (h = a(l, t)) return h
}
return null
}
function c(e) {
if (!e.stack) return null;
var t = /^\s*at (\S+) \(((?:file|http):.*?):(\d+)(?::(\d+))?\)\s*$/i,
n = /^\s*(\S*)(?:\((.*?)\))?@((?:file|http).*?):(\d+)(?::(\d+))?\s*$/i,
r = e.stack.split("\n"),
o = [],
u, a, l = /^(.*) is undefined$/.exec(e.message);
for (var c = 0, h = r.length; c < h; ++c) {
if (u = n.exec(r[c])) a = {
url: u[3],
func: u[1],
args: u[2] ? u[2].split(",") : "",
line: +u[4],
column: u[5] ? +u[5] : null
};
else {
if (!(u = t.exec(r[c]))) continue;
a = {
url: u[2],
func: u[1],
line: +u[3],
column: u[4] ? +u[4] : null
}
}!a.func && a.line && (a.func = i(a.url, a.line)), a.line && (a.context = s(a.url, a.line)), o.push(a)
}
return o[0] && o[0].line && !o[0].column && l && (o[0].column = f(l[1], o[0].url, o[0].line)), o.length ? {
mode: "stack",
name: e.name,
message: e.message,
stack: o
} : null
}
function h(e) {
var t = e.stacktrace,
n = / line (\d+), column (\d+) in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,
r = t.split("\n"),
o = [],
u;
for (var a = 0, f = r.length; a < f; a += 2)
if (u = n.exec(r[a])) {
var l = {
line: +u[1],
column: +u[2],
func: u[3] || u[4],
args: u[5] ? u[5].split(",") : [],
url: u[6]
};
!l.func && l.line && (l.func = i(l.url, l.line));
if (l.line) try {
l.context = s(l.url, l.line)
} catch (c) {}
l.context || (l.context = [r[a + 1]]), o.push(l)
}
return o.length ? {
mode: "stacktrace",
name: e.name,
message: e.message,
stack: o
} : null
}
function p(e) {
var t = e.message.split("\n");
if (t.length < 4) return null;
var n = /^\s*Line (\d+) of linked script ((?:file|http)\S+)(?:: in function (\S+))?\s*$/i,
o = /^\s*Line (\d+) of inline#(\d+) script in ((?:file|http)\S+)(?:: in function (\S+))?\s*$/i,
f = /^\s*Line (\d+) of function script\s*$/i,
l = [],
c = document.getElementsByTagName("script"),
h = [],
p, d, v, m;
for (d in c) c.hasOwnProperty(d) && !c[d].src && h.push(c[d]);
for (d = 2, v = t.length; d < v; d += 2) {
var g = null;
if (p = n.exec(t[d])) g = {
url: p[2],
func: p[3],
line: +p[1]
};
else if (p = o.exec(t[d])) {
g = {
url: p[3],
func: p[4]
};
var y = +p[1],
b = h[p[2] - 1];
if (b) {
m = r(g.url);
if (m) {
m = m.join("\n");
var w = m.indexOf(b.innerText);
w >= 0 && (g.line = y + m.substring(0, w).split("\n").length)
}
}
} else if (p = f.exec(t[d])) {
var E = window.location.href.replace(/#.*$/, ""),
S = p[1],
x = new RegExp(u(t[d + 1]));
m = a(x, [E]), g = {
url: E,
line: m ? m.line : S,
func: ""
}
}
if (g) {
g.func || (g.func = i(g.url, g.line));
var T = s(g.url, g.line),
N = T ? T[Math.floor(T.length / 2)] : null;
T && N.replace(/^\s*/, "") === t[d + 1].replace(/^\s*/, "") ? g.context = T : g.context = [t[d + 1]], l.push(g)
}
}
return l.length ? {
mode: "multiline",
name: e.name,
message: t[0],
stack: l
} : null
}
function d(e, t, n, r) {
var o = {
url: t,
line: n
};
if (o.url && o.line) {
e.incomplete = !1, o.func || (o.func = i(o.url, o.line)), o.context || (o.context = s(o.url, o.line));
var u = / '([^']+)' /.exec(r);
u && (o.column = f(u[1], o.url, o.line));
if (e.stack.length > 0 && e.stack[0].url === o.url) {
if (e.stack[0].line === o.line) return !1;
if (!e.stack[0].line && e.stack[0].func === o.func) return e.stack[0].line = o.line, e.stack[0].context = o.context, !1
}
return e.stack.unshift(o), e.partial = !0, !0
}
return e.incomplete = !0, !1
}
function v(e, t) {
var n = /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,
r = [],
s = {}, o = !1,
u, a, c;
for (var h = arguments.callee.caller; h && !o; h = h.caller) {
if (h === m || h === TraceKit.report) continue;
a = {
url: null,
func: "?",
line: null,
column: null
};
if (h.name) a.func = h.name;
else if (u = n.exec(h.toString())) a.func = u[1];
if (c = l(h)) {
a.url = c.url, a.line = c.line, a.func === "?" && (a.func = i(a.url, a.line));
var p = / '([^']+)' /.exec(e.message || e.description);
p && (a.column = f(p[1], c.url, c.line))
}
s["" + h] && (a.recursion = !0), r.push(a)
}
t && r.splice(0, t);
var v = {
mode: "callers",
name: e.name,
message: e.message,
stack: r
};
return d(v, e.sourceURL || e.fileName, e.line || e.lineNumber, e.message || e.description), v
}
function m(t, n) {
var r = null;
n = n === undefined ? 0 : +n;
try {
r = h(t);
if (r) return r
} catch (i) {
if (e) throw i
}
try {
r = c(t);
if (r) return r
} catch (i) {
if (e) throw i
}
try {
r = p(t);
if (r) return r
} catch (i) {
if (e) throw i
}
try {
r = v(t, n + 1);
if (r) return r
} catch (i) {
if (e) throw i
}
return {
mode: "failed"
}
}
function g(e) {
e = (e === undefined ? 0 : +e) + 1;
try {
(0)()
} catch (t) {
return m(t, e + 1)
}
return null
}
var e = !1,
t = {};
return m.augmentStackTraceWithInitialElement = d, m.guessFunctionName = i, m.gatherContext = s, m.ofCaller = g, m
}(),
function (e) {
var t = Array.prototype.slice,
n = e.setTimeout;
e.setTimeout = function () {
var e = t.call(arguments, 0),
r = e[0];
return e[0] = function () {
try {
r.apply(this, arguments)
} catch (e) {
throw TraceKit.report(e), e
}
}, n.apply(this, e)
};
var r = e.setInterval;
e.setInterval = function () {
var e = t.call(arguments, 0),
n = e[0];
return e[0] = function () {
try {
n.apply(this, arguments)
} catch (e) {
throw TraceKit.report(e), e
}
}, r.apply(this, e)
}
}(window),
function () {
var e, t, n = {}.hasOwnProperty,
r = [].slice;
e = typeof exports != "undefined" && exports !== null ? exports : this, e.SquashJavascript = function () {
function n() {}
var e;
return e = void 0, n.instance = function () {
return e != null ? e : e = new t
}, n
}(), t = function () {
function o() {
TraceKit.report.subscribe(function (e) {
return SquashJavascript.instance().report(e)
})
}
var e, t, i, s;
return o.prototype.configure = function (e) {
var t, r, i;
this.options || (this.options = {
disabled: !1,
notifyPath: "/api/1.0/notify",
transmitTimeout: 15e3,
ignoredExceptionClasses: [],
ignoredExceptionMessages: {}
}), i = [];
for (t in e) {
if (!n.call(e, t)) continue;
r = e[t], i.push(this.options[t] = r)
}
return i
}, o.prototype.notify = function (e) {
if (e instanceof Error) return TraceKit.report(e);
throw e
}, o.prototype.report = function (t) {
var n, r, s, o, u, a, f, l, c;
try {
return ((o = this.options) != null ? o.disabled : void 0) ? !1 : ((u = this.options) != null ? !u.APIKey : !void 0) || ((a = this.options) != null ? !a.environment : !void 0) || ((f = this.options) != null ? !f.revision : !void 0) || ((l = this.options) != null ? !l.APIHost : !void 0) ? (console.error("Missing required Squash configuration keys"), !1) : this.shouldIgnoreError(t) ? !1 : t.stack ? (r = arguments[1] || new Object, r.api_key = this.options.APIKey, r.environment = this.options.environment, r.client = "javascript", r.revision = this.options.revision, r.class_name = t.type || t.name, !t.name && (s = t.message.match(/^(Uncaught )?(\w+): (.+)/)) ? (r.class_name = s[2], r.message = s[3]) : r.message = t.message, (c = r.class_name) == null && (r.class_name = "Error"), r.backtraces = i(t.stack), r.capture_method = t.mode, r.occurred_at = e(new Date), r.schema = window.location.protocol.replace(/:$/, ""), r.host = window.location.hostname, window.location.port.length > 0 && (r.port = window.location.port), r.path = window.location.pathname, r.query = window.location.search, window.location.hash !== "" && (r.fragment = window.location.hash), r.user_agent = navigator.userAgent, r.screen_width = screen.width, r.screen_height = screen.height, r.window_width = window.innerWidth, r.window_height = window.innerHeight, r.color_depth = screen.colorDepth, n = JSON.stringify(r), this.HTTPTransmit(this.options.APIHost + this.options.notifyPath, [
["Content-Type", "application/json"]
], n), !0) : !1
} catch (h) {
return console.error("Error while trying to notify Squash:", h.stack), console.error("-- original error:", t)
}
}, o.prototype.addUserData = function (e, t) {
var n;
try {
return t()
} catch (r) {
throw (n = r._squash_user_data) == null && (r._squash_user_data = {}), s(r._squash_user_data, e), r
}
}, o.prototype.addingUserData = function (e, t) {
return function () {
var n;
return n = 1 <= arguments.length ? r.call(arguments, 0) : [], SquashJavascript.instance().addUserData(e, function () {
return t.apply(null, n)
})
}
}, o.prototype.ignoreExceptions = function () {
var e, t, n;
t = 2 <= arguments.length ? r.call(arguments, 0, n = arguments.length - 1) : (n = 0, []), e = arguments[n++];
try {
return e()
} catch (i) {
throw i._squash_ignored_exceptions = (i._squash_ignored_exceptions || []).concat(t), i
}
}, o.prototype.ignoringExceptions = function () {
var e, t, n;
return t = 2 <= arguments.length ? r.call(arguments, 0, n = arguments.length - 1) : (n = 0, []), e = arguments[n++],
function () {
var n, i;
return n = 1 <= arguments.length ? r.call(arguments, 0) : [], (i = SquashJavascript.instance()).ignoreExceptions.apply(i, r.call(t).concat([
function () {
return e.apply(null, n)
}
]))
}
}, o.prototype.HTTPTransmit = function (e, t, n) {
var r, i, s, o;
i = new XMLHttpRequest, i.timeout = this.options.transmitTimeout, i.open("POST", e, !0);
for (s = 0, o = t.length; s < o; s++) r = t[s], i.setRequestHeader(r[0], r[1]);
return i.send(n), i
}, o.prototype.shouldIgnoreError = function (e) {
var n;
return n = this.options.ignoredExceptionClasses.concat(e._squash_ignored_exceptions || []), t(n, function (t) {
return e.name === t
}) ? !0 : t(this.options.ignoredExceptionMessages, function (n, r) {
return e.name === n ? t(r, function (t) {
return e.message.match(t)
}) : !1
})
}, i = function (e) {
var n, r, i, s, o;
n = [];
for (s = 0, o = e.length; s < o; s++) i = e[s], r = i.context, r && t(r, function (e) {
return e.length > 200
}) && (r = null), n.push({
url: i.url,
line: i.line,
column: i.column,
symbol: i.func,
context: r,
type: "minified"
});
return [{
name: "Active Thread",
faulted: !0,
backtrace: n
}]
}, e = function (e) {
var t;
return t = function (e) {
return e < 10 ? "0" + e : e
}, "" + e.getUTCFullYear() + "-" + t(e.getUTCMonth() + 1) + "-" + t(e.getUTCDate()) + "T" + t(e.getUTCHours()) + ":" + t(e.getUTCMinutes()) + ":" + t(e.getUTCSeconds()) + "Z"
}, t = function (e, t) {
var r, i, s, o, u;
if (e instanceof Array)
for (o = 0, u = e.length; o < u; o++) {
r = e[o];
if (t(r)) return !0
} else
for (i in e) {
if (!n.call(e, i)) continue;
s = e[i];
if (t(i, s)) return !0
}
return !1
}, s = function (e, t) {
var r, i, s;
s = [];
for (r in t) {
if (!n.call(t, r)) continue;
i = t[r], s.push(e[r] = i)
}
return s
}, o
}()
}.call(this),
function () {
PRELOAD.squash_settings.enabled && SquashJavascript.instance().configure({
APIHost: PRELOAD.squash_settings.server,
APIKey: PRELOAD.squash_settings.api_key,
revision: PRELOAD.squash_settings.revision,
environment: PRELOAD.app_settings.environment
})
}.call(this),
function (e) {
typeof define == "function" && define.amd ? define(["jquery"], e) : e(jQuery)
}(function (e) {
function r() {
var t = i(this);
return isNaN(t.datetime) || e(this).text(s(t.datetime)), this
}
function i(n) {
n = e(n);
if (!n.data("timeago")) {
n.data("timeago", {
datetime: t.datetime(n)
});
var r = e.trim(n.text());
t.settings.localeTitle ? n.attr("title", n.data("timeago").datetime.toLocaleString()) : r.length > 0 && (!t.isTime(n) || !n.attr("title")) && n.attr("title", r)
}
return n.data("timeago")
}
function s(e) {
return t.inWords(o(e))
}
function o(e) {
return (new Date).getTime() - e.getTime()
}
e.timeago = function (t) {
return t instanceof Date ? s(t) : typeof t == "string" ? s(e.timeago.parse(t)) : typeof t == "number" ? s(new Date(t)) : s(e.timeago.datetime(t))
};
var t = e.timeago;
e.extend(e.timeago, {
settings: {
refreshMillis: 6e4,
allowFuture: !1,
localeTitle: !1,
strings: {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "ago",
suffixFromNow: "from now",
seconds: "less than a minute",
minute: "about a minute",
minutes: "%d minutes",
hour: "about an hour",
hours: "about %d hours",
day: "a day",
days: "%d days",
month: "about a month",
months: "%d months",
year: "about a year",
years: "%d years",
wordSeparator: " ",
numbers: []
}
},
inWords: function (t) {
function l(r, i) {
var s = e.isFunction(r) ? r(i, t) : r,
o = n.numbers && n.numbers[i] || i;
return s.replace(/%d/i, o)
}
var n = this.settings.strings,
r = n.prefixAgo,
i = n.suffixAgo;
this.settings.allowFuture && t < 0 && (r = n.prefixFromNow, i = n.suffixFromNow);
var s = Math.abs(t) / 1e3,
o = s / 60,
u = o / 60,
a = u / 24,
f = a / 365,
c = s < 45 && l(n.seconds, Math.round(s)) || s < 90 && l(n.minute, 1) || o < 45 && l(n.minutes, Math.round(o)) || o < 90 && l(n.hour, 1) || u < 24 && l(n.hours, Math.round(u)) || u < 42 && l(n.day, 1) || a < 30 && l(n.days, Math.round(a)) || a < 45 && l(n.month, 1) || a < 365 && l(n.months, Math.round(a / 30)) || f < 1.5 && l(n.year, 1) || l(n.years, Math.round(f)),
h = n.wordSeparator || "";
return n.wordSeparator === undefined && (h = " "), e.trim([r, c, i].join(h))
},
parse: function (t) {
var n = e.trim(t);
return n = n.replace(/\.\d+/, ""), n = n.replace(/-/, "/").replace(/-/, "/"), n = n.replace(/T/, " ").replace(/Z/, " UTC"), n = n.replace(/([\+\-]\d\d)\:?(\d\d)/, " $1$2"), new Date(n)
},
datetime: function (n) {
var r = t.isTime(n) ? e(n).attr("datetime") : e(n).attr("title");
return t.parse(r)
},
isTime: function (t) {
return e(t).get(0).tagName.toLowerCase() === "time"
}
});
var n = {
init: function () {
var n = e.proxy(r, this);
n();
var i = t.settings;
i.refreshMillis > 0 && setInterval(n, i.refreshMillis)
},
update: function (n) {
e(this).data("timeago", {
datetime: t.parse(n)
}), r.apply(this)
}
};
e.fn.timeago = function (e, t) {
var r = e ? n[e] : n.init;
if (!r) throw new Error("Unknown function name '" + e + "' for timeago");
return this.each(function () {
r.call(this, t)
}), this
}, document.createElement("abbr"), document.createElement("time")
}),
function () {
$.ajaxSetup({
dataType: "json",
beforeSend: function (e) {
var t;
return t = $('meta[name="csrf-token"]').attr("content"), e.setRequestHeader("X-CSRF-Token", t)
}
})
}.call(this),
function () {
var e, t;
e = function (e, t, n) {
var r;
return function () {
var i = this,
s = arguments,
o = function () {
r = null, n || e.apply(i, s)
};
n && !r && e.apply(i, s), clearTimeout(r), r = setTimeout(o, t)
}
}, t = function (t, n) {
var r, i, s, o, u, a, f = e(function () {
u = o = !1
}, n);
return function () {
r = this, i = arguments;
var e = function () {
s = null, u && t.apply(r, i), f()
};
return s || (s = setTimeout(e, n)), o ? u = !0 : a = t.apply(r, i), f(), o = !0, a
}
}, Function.prototype.debounce = function (t, n) {
return e(this, t, n)
}, Function.prototype.throttle = function (e) {
return t(this, e)
}
}();
var Handlebars = {};
(function (e, t) {
e.VERSION = "1.0.0-rc.3", e.COMPILER_REVISION = 2, e.REVISION_CHANGES = {
1: "<= 1.0.rc.2",
2: ">= 1.0.0-rc.3"
}, e.helpers = {}, e.partials = {}, e.registerHelper = function (e, t, n) {
n && (t.not = n), this.helpers[e] = t
}, e.registerPartial = function (e, t) {
this.partials[e] = t
}, e.registerHelper("helperMissing", function (e) {
if (arguments.length === 2) return t;
throw new Error("Could not find property '" + e + "'")
});
var n = Object.prototype.toString,
r = "[object Function]";
e.registerHelper("blockHelperMissing", function (t, i) {
var s = i.inverse || function () {}, o = i.fn,
u = n.call(t);
return u === r && (t = t.call(this)), t === !0 ? o(this) : t === !1 || t == null ? s(this) : u === "[object Array]" ? t.length > 0 ? e.helpers.each(t, i) : s(this) : o(t)
}), e.K = function () {}, e.createFrame = Object.create || function (t) {
e.K.prototype = t;
var n = new e.K;
return e.K.prototype = null, n
}, e.logger = {
DEBUG: 0,
INFO: 1,
WARN: 2,
ERROR: 3,
level: 3,
methodMap: {
0: "debug",
1: "info",
2: "warn",
3: "error"
},
log: function (t, n) {
if (e.logger.level <= t) {
var r = e.logger.methodMap[t];
typeof console != "undefined" && console[r] && console[r].call(console, n)
}
}
}, e.log = function (t, n) {
e.logger.log(t, n)
}, e.registerHelper("each", function (t, n) {
var r = n.fn,
i = n.inverse,
s = 0,
o = "",
u;
n.data && (u = e.createFrame(n.data));
if (t && typeof t == "object")
if (t instanceof Array)
for (var a = t.length; s < a; s++) u && (u.index = s), o += r(t[s], {
data: u
});
else
for (var f in t) t.hasOwnProperty(f) && (u && (u.key = f), o += r(t[f], {
data: u
}), s++);
return s === 0 && (o = i(this)), o
}), e.registerHelper("if", function (t, i) {
var s = n.call(t);
return s === r && (t = t.call(this)), !t || e.Utils.isEmpty(t) ? i.inverse(this) : i.fn(this)
}), e.registerHelper("unless", function (t, n) {
return e.helpers["if"].call(this, t, {
fn: n.inverse,
inverse: n.fn
})
}), e.registerHelper("with", function (e, t) {
return t.fn(e)
}), e.registerHelper("log", function (t, n) {
var r = n.data && n.data.level != null ? parseInt(n.data.level, 10) : 1;
e.log(r, t)
});
var i = function () {
function n() {
this.yy = {}
}
var e = {
trace: function () {},
yy: {},
symbols_: {
error: 2,
root: 3,
program: 4,
EOF: 5,
simpleInverse: 6,
statements: 7,
statement: 8,
openInverse: 9,
closeBlock: 10,
openBlock: 11,
mustache: 12,
partial: 13,
CONTENT: 14,
COMMENT: 15,
OPEN_BLOCK: 16,
inMustache: 17,
CLOSE: 18,
OPEN_INVERSE: 19,
OPEN_ENDBLOCK: 20,
path: 21,
OPEN: 22,
OPEN_UNESCAPED: 23,
OPEN_PARTIAL: 24,
partialName: 25,
params: 26,
hash: 27,
DATA: 28,
param: 29,
STRING: 30,
INTEGER: 31,
BOOLEAN: 32,
hashSegments: 33,
hashSegment: 34,
ID: 35,
EQUALS: 36,
PARTIAL_NAME: 37,
pathSegments: 38,
SEP: 39,
$accept: 0,
$end: 1
},
terminals_: {
2: "error",
5: "EOF",
14: "CONTENT",
15: "COMMENT",
16: "OPEN_BLOCK",
18: "CLOSE",
19: "OPEN_INVERSE",
20: "OPEN_ENDBLOCK",
22: "OPEN",
23: "OPEN_UNESCAPED",
24: "OPEN_PARTIAL",
28: "DATA",
30: "STRING",
31: "INTEGER",
32: "BOOLEAN",
35: "ID",
36: "EQUALS",
37: "PARTIAL_NAME",
39: "SEP"
},
productions_: [0, [3, 2],
[4, 2],
[4, 3],
[4, 2],
[4, 1],
[4, 1],
[4, 0],
[7, 1],
[7, 2],
[8, 3],
[8, 3],
[8, 1],
[8, 1],
[8, 1],
[8, 1],
[11, 3],
[9, 3],
[10, 3],
[12, 3],
[12, 3],
[13, 3],
[13, 4],
[6, 2],
[17, 3],
[17, 2],
[17, 2],
[17, 1],
[17, 1],
[26, 2],
[26, 1],
[29, 1],
[29, 1],
[29, 1],
[29, 1],
[29, 1],
[27, 1],
[33, 2],
[33, 1],
[34, 3],
[34, 3],
[34, 3],
[34, 3],
[34, 3],
[25, 1],
[21, 1],
[38, 3],
[38, 1]
],
performAction: function (t, n, r, i, s, o, u) {
var a = o.length - 1;
switch (s) {
case 1:
return o[a - 1];
case 2:
this.$ = new i.ProgramNode([], o[a]);
break;
case 3:
this.$ = new i.ProgramNode(o[a - 2], o[a]);
break;
case 4:
this.$ = new i.ProgramNode(o[a - 1], []);
break;
case 5:
this.$ = new i.ProgramNode(o[a]);
break;
case 6:
this.$ = new i.ProgramNode([], []);
break;
case 7:
this.$ = new i.ProgramNode([]);
break;
case 8:
this.$ = [o[a]];
break;
case 9:
o[a - 1].push(o[a]), this.$ = o[a - 1];
break;
case 10:
this.$ = new i.BlockNode(o[a - 2], o[a - 1].inverse, o[a - 1], o[a]);
break;
case 11:
this.$ = new i.BlockNode(o[a - 2], o[a - 1], o[a - 1].inverse, o[a]);
break;
case 12:
this.$ = o[a];
break;
case 13:
this.$ = o[a];
break;
case 14:
this.$ = new i.ContentNode(o[a]);
break;
case 15:
this.$ = new i.CommentNode(o[a]);
break;
case 16:
this.$ = new i.MustacheNode(o[a - 1][0], o[a - 1][1]);
break;
case 17:
this.$ = new i.MustacheNode(o[a - 1][0], o[a - 1][1]);
break;
case 18:
this.$ = o[a - 1];
break;
case 19:
this.$ = new i.MustacheNode(o[a - 1][0], o[a - 1][1]);
break;
case 20:
this.$ = new i.MustacheNode(o[a - 1][0], o[a - 1][1], !0);
break;
case 21:
this.$ = new i.PartialNode(o[a - 1]);
break;
case 22:
this.$ = new i.PartialNode(o[a - 2], o[a - 1]);
break;
case 23:
break;
case 24:
this.$ = [
[o[a - 2]].concat(o[a - 1]), o[a]
];
break;
case 25:
this.$ = [
[o[a - 1]].concat(o[a]), null
];
break;
case 26:
this.$ = [
[o[a - 1]], o[a]
];
break;
case 27:
this.$ = [
[o[a]], null
];
break;
case 28:
this.$ = [
[new i.DataNode(o[a])], null
];
break;
case 29:
o[a - 1].push(o[a]), this.$ = o[a - 1];
break;
case 30:
this.$ = [o[a]];
break;
case 31:
this.$ = o[a];
break;
case 32:
this.$ = new i.StringNode(o[a]);
break;
case 33:
this.$ = new i.IntegerNode(o[a]);
break;
case 34:
this.$ = new i.BooleanNode(o[a]);
break;
case 35:
this.$ = new i.DataNode(o[a]);
break;
case 36:
this.$ = new i.HashNode(o[a]);
break;
case 37:
o[a - 1].push(o[a]), this.$ = o[a - 1];
break;
case 38:
this.$ = [o[a]];
break;
case 39:
this.$ = [o[a - 2], o[a]];
break;
case 40:
this.$ = [o[a - 2], new i.StringNode(o[a])];
break;
case 41:
this.$ = [o[a - 2], new i.IntegerNode(o[a])];
break;
case 42:
this.$ = [o[a - 2], new i.BooleanNode(o[a])];
break;
case 43:
this.$ = [o[a - 2], new i.DataNode(o[a])];
break;
case 44:
this.$ = new i.PartialNameNode(o[a]);
break;
case 45:
this.$ = new i.IdNode(o[a]);
break;
case 46:
o[a - 2].push(o[a]), this.$ = o[a - 2];
break;
case 47:
this.$ = [o[a]]
}
},
table: [{
3: 1,
4: 2,
5: [2, 7],
6: 3,
7: 4,
8: 6,
9: 7,
11: 8,
12: 9,
13: 10,
14: [1, 11],
15: [1, 12],
16: [1, 13],
19: [1, 5],
22: [1, 14],
23: [1, 15],
24: [1, 16]
}, {
1: [3]
}, {
5: [1, 17]
}, {
5: [2, 6],
7: 18,
8: 6,
9: 7,
11: 8,
12: 9,
13: 10,
14: [1, 11],
15: [1, 12],
16: [1, 13],
19: [1, 19],
20: [2, 6],
22: [1, 14],
23: [1, 15],
24: [1, 16]
}, {
5: [2, 5],
6: 20,
8: 21,
9: 7,
11: 8,
12: 9,
13: 10,
14: [1, 11],
15: [1, 12],
16: [1, 13],
19: [1, 5],
20: [2, 5],
22: [1, 14],
23: [1, 15],
24: [1, 16]
}, {
17: 23,
18: [1, 22],
21: 24,
28: [1, 25],
35: [1, 27],
38: 26
}, {
5: [2, 8],
14: [2, 8],
15: [2, 8],
16: [2, 8],
19: [2, 8],
20: [2, 8],
22: [2, 8],
23: [2, 8],
24: [2, 8]
}, {
4: 28,
6: 3,
7: 4,
8: 6,
9: 7,
11: 8,
12: 9,
13: 10,
14: [1, 11],
15: [1, 12],
16: [1, 13],
19: [1, 5],
20: [2, 7],
22: [1, 14],
23: [1, 15],
24: [1, 16]
}, {
4: 29,
6: 3,
7: 4,
8: 6,
9: 7,
11: 8,
12: 9,
13: 10,
14: [1, 11],
15: [1, 12],
16: [1, 13],
19: [1, 5],
20: [2, 7],
22: [1, 14],
23: [1, 15],
24: [1, 16]
}, {
5: [2, 12],
14: [2, 12],
15: [2, 12],
16: [2, 12],
19: [2, 12],
20: [2, 12],
22: [2, 12],
23: [2, 12],
24: [2, 12]
}, {
5: [2, 13],
14: [2, 13],
15: [2, 13],
16: [2, 13],
19: [2, 13],
20: [2, 13],
22: [2, 13],
23: [2, 13],
24: [2, 13]
}, {
5: [2, 14],
14: [2, 14],
15: [2, 14],
16: [2, 14],
19: [2, 14],
20: [2, 14],
22: [2, 14],
23: [2, 14],
24: [2, 14]
}, {
5: [2, 15],
14: [2, 15],
15: [2, 15],
16: [2, 15],
19: [2, 15],
20: [2, 15],
22: [2, 15],
23: [2, 15],
24: [2, 15]
}, {
17: 30,
21: 24,
28: [1, 25],
35: [1, 27],
38: 26
}, {
17: 31,
21: 24,
28: [1, 25],
35: [1, 27],
38: 26
}, {
17: 32,
21: 24,
28: [1, 25],
35: [1, 27],
38: 26
}, {
25: 33,
37: [1, 34]
}, {
1: [2, 1]
}, {
5: [2, 2],
8: 21,
9: 7,
11: 8,
12: 9,
13: 10,
14: [1, 11],
15: [1, 12],
16: [1, 13],
19: [1, 19],
20: [2, 2],
22: [1, 14],
23: [1, 15],
24: [1, 16]
}, {
17: 23,
21: 24,
28: [1, 25],
35: [1, 27],
38: 26
}, {
5: [2, 4],
7: 35,
8: 6,
9: 7,
11: 8,
12: 9,
13: 10,
14: [1, 11],
15: [1, 12],
16: [1, 13],
19: [1, 19],
20: [2, 4],
22: [1, 14],
23: [1, 15],
24: [1, 16]
}, {
5: [2, 9],
14: [2, 9],
15: [2, 9],
16: [2, 9],
19: [2, 9],
20: [2, 9],
22: [2, 9],
23: [2, 9],
24: [2, 9]
}, {
5: [2, 23],
14: [2, 23],
15: [2, 23],
16: [2, 23],
19: [2, 23],
20: [2, 23],
22: [2, 23],
23: [2, 23],
24: [2, 23]
}, {
18: [1, 36]
}, {
18: [2, 27],
21: 41,
26: 37,
27: 38,
28: [1, 45],
29: 39,
30: [1, 42],
31: [1, 43],
32: [1, 44],
33: 40,
34: 46,
35: [1, 47],
38: 26
}, {
18: [2, 28]
}, {
18: [2, 45],
28: [2, 45],
30: [2, 45],
31: [2, 45],
32: [2, 45],
35: [2, 45],
39: [1, 48]
}, {
18: [2, 47],
28: [2, 47],
30: [2, 47],
31: [2, 47],
32: [2, 47],
35: [2, 47],
39: [2, 47]
}, {
10: 49,
20: [1, 50]
}, {
10: 51,
20: [1, 50]
}, {
18: [1, 52]
}, {
18: [1, 53]
}, {
18: [1, 54]
}, {
18: [1, 55],
21: 56,
35: [1, 27],
38: 26
}, {
18: [2, 44],
35: [2, 44]
}, {
5: [2, 3],
8: 21,
9: 7,
11: 8,
12: 9,
13: 10,
14: [1, 11],
15: [1, 12],
16: [1, 13],
19: [1, 19],
20: [2, 3],
22: [1, 14],
23: [1, 15],
24: [1, 16]
}, {
14: [2, 17],
15: [2, 17],
16: [2, 17],
19: [2, 17],
20: [2, 17],
22: [2, 17],
23: [2, 17],
24: [2, 17]
}, {
18: [2, 25],
21: 41,
27: 57,
28: [1, 45],
29: 58,
30: [1, 42],
31: [1, 43],
32: [1, 44],
33: 40,
34: 46,
35: [1, 47],
38: 26
}, {
18: [2, 26]
}, {
18: [2, 30],
28: [2, 30],
30: [2, 30],
31: [2, 30],
32: [2, 30],
35: [2, 30]
}, {
18: [2, 36],
34: 59,
35: [1, 60]
}, {
18: [2, 31],
28: [2, 31],
30: [2, 31],
31: [2, 31],
32: [2, 31],
35: [2, 31]
}, {
18: [2, 32],
28: [2, 32],
30: [2, 32],
31: [2, 32],
32: [2, 32],
35: [2, 32]
}, {
18: [2, 33],
28: [2, 33],
30: [2, 33],
31: [2, 33],
32: [2, 33],
35: [2, 33]
}, {
18: [2, 34],
28: [2, 34],
30: [2, 34],
31: [2, 34],
32: [2, 34],
35: [2, 34]
}, {
18: [2, 35],
28: [2, 35],
30: [2, 35],
31: [2, 35],
32: [2, 35],
35: [2, 35]
}, {
18: [2, 38],
35: [2, 38]
}, {
18: [2, 47],
28: [2, 47],
30: [2, 47],
31: [2, 47],
32: [2, 47],
35: [2, 47],
36: [1, 61],
39: [2, 47]
}, {
35: [1, 62]
}, {
5: [2, 10],
14: [2, 10],
15: [2, 10],
16: [2, 10],
19: [2, 10],
20: [2, 10],
22: [2, 10],
23: [2, 10],
24: [2, 10]
}, {
21: 63,
35: [1, 27],
38: 26
}, {
5: [2, 11],
14: [2, 11],
15: [2, 11],
16: [2, 11],
19: [2, 11],
20: [2, 11],
22: [2, 11],
23: [2, 11],
24: [2, 11]
}, {
14: [2, 16],
15: [2, 16],
16: [2, 16],
19: [2, 16],
20: [2, 16],
22: [2, 16],
23: [2, 16],
24: [2, 16]
}, {
5: [2, 19],
14: [2, 19],
15: [2, 19],
16: [2, 19],
19: [2, 19],
20: [2, 19],
22: [2, 19],
23: [2, 19],
24: [2, 19]
}, {
5: [2, 20],
14: [2, 20],
15: [2, 20],
16: [2, 20],
19: [2, 20],
20: [2, 20],
22: [2, 20],
23: [2, 20],
24: [2, 20]
}, {
5: [2, 21],
14: [2, 21],
15: [2, 21],
16: [2, 21],
19: [2, 21],
20: [2, 21],
22: [2, 21],
23: [2, 21],
24: [2, 21]
}, {
18: [1, 64]
}, {
18: [2, 24]
}, {
18: [2, 29],
28: [2, 29],
30: [2, 29],
31: [2, 29],
32: [2, 29],
35: [2, 29]
}, {
18: [2, 37],
35: [2, 37]
}, {
36: [1, 61]
}, {
21: 65,
28: [1, 69],
30: [1, 66],
31: [1, 67],
32: [1, 68],
35: [1, 27],
38: 26
}, {
18: [2, 46],
28: [2, 46],
30: [2, 46],
31: [2, 46],
32: [2, 46],
35: [2, 46],
39: [2, 46]
}, {
18: [1, 70]
}, {
5: [2, 22],
14: [2, 22],
15: [2, 22],
16: [2, 22],
19: [2, 22],
20: [2, 22],
22: [2, 22],
23: [2, 22],
24: [2, 22]
}, {
18: [2, 39],
35: [2, 39]
}, {
18: [2, 40],
35: [2, 40]
}, {
18: [2, 41],
35: [2, 41]
}, {
18: [2, 42],
35: [2, 42]
}, {
18: [2, 43],
35: [2, 43]
}, {
5: [2, 18],
14: [2, 18],
15: [2, 18],
16: [2, 18],
19: [2, 18],
20: [2, 18],
22: [2, 18],
23: [2, 18],
24: [2, 18]
}
],
defaultActions: {
17: [2, 1],
25: [2, 28],
38: [2, 26],
57: [2, 24]
},
parseError: function (t, n) {
throw new Error(t)
},
parse: function (t) {
function v(e) {
r.length = r.length - 2 * e, i.length = i.length - e, s.length = s.length - e
}
function m() {
var e;
return e = n.lexer.lex() || 1, typeof e != "number" && (e = n.symbols_[e] || e), e
}
var n = this,
r = [0],
i = [null],
s = [],
o = this.table,
u = "",
a = 0,
f = 0,
l = 0,
c = 2,
h = 1;
this.lexer.setInput(t), this.lexer.yy = this.yy, this.yy.lexer = this.lexer, this.yy.parser = this, typeof this.lexer.yylloc == "undefined" && (this.lexer.yylloc = {});
var p = this.lexer.yylloc;
s.push(p);
var d = this.lexer.options && this.lexer.options.ranges;
typeof this.yy.parseError == "function" && (this.parseError = this.yy.parseError);
var g, y, b, w, E, S, x = {}, T, N, C, k;
for (;;) {
b = r[r.length - 1];
if (this.defaultActions[b]) w = this.defaultActions[b];
else {
if (g === null || typeof g == "undefined") g = m();
w = o[b] && o[b][g]
} if (typeof w == "undefined" || !w.length || !w[0]) {
var L = "";
if (!l) {
k = [];
for (T in o[b]) this.terminals_[T] && T > 2 && k.push("'" + this.terminals_[T] + "'");
this.lexer.showPosition ? L = "Parse error on line " + (a + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + k.join(", ") + ", got '" + (this.terminals_[g] || g) + "'" : L = "Parse error on line " + (a + 1) + ": Unexpected " + (g == 1 ? "end of input" : "'" + (this.terminals_[g] || g) + "'"), this.parseError(L, {
text: this.lexer.match,
token: this.terminals_[g] || g,
line: this.lexer.yylineno,
loc: p,
expected: k
})
}
}
if (w[0] instanceof Array && w.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + b + ", token: " + g);
switch (w[0]) {
case 1:
r.push(g), i.push(this.lexer.yytext), s.push(this.lexer.yylloc), r.push(w[1]), g = null, y ? (g = y, y = null) : (f = this.lexer.yyleng, u = this.lexer.yytext, a = this.lexer.yylineno, p = this.lexer.yylloc, l > 0 && l--);
break;
case 2:
N = this.productions_[w[1]][1], x.$ = i[i.length - N], x._$ = {
first_line: s[s.length - (N || 1)].first_line,
last_line: s[s.length - 1].last_line,
first_column: s[s.length - (N || 1)].first_column,
last_column: s[s.length - 1].last_column
}, d && (x._$.range = [s[s.length - (N || 1)].range[0], s[s.length - 1].range[1]]), S = this.performAction.call(x, u, f, a, this.yy, w[1], i, s);
if (typeof S != "undefined") return S;
N && (r = r.slice(0, -1 * N * 2), i = i.slice(0, -1 * N), s = s.slice(0, -1 * N)), r.push(this.productions_[w[1]][0]), i.push(x.$), s.push(x._$), C = o[r[r.length - 2]][r[r.length - 1]], r.push(C);
break;
case 3:
return !0
}
}
return !0
}
}, t = function () {
var e = {
EOF: 1,
parseError: function (t, n) {
if (!this.yy.parser) throw new Error(t);
this.yy.parser.parseError(t, n)
},
setInput: function (e) {
return this._input = e, this._more = this._less = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
first_line: 1,
first_column: 0,
last_line: 1,
last_column: 0
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this
},
input: function () {
var e = this._input[0];
this.yytext += e, this.yyleng++, this.offset++, this.match += e, this.matched += e;
var t = e.match(/(?:\r\n?|\n).*/g);
return t ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), e
},
unput: function (e) {
var t = e.length,
n = e.split(/(?:\r\n?|\n)/g);
this._input = e + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - t - 1), this.offset -= t;
var r = this.match.split(/(?:\r\n?|\n)/g);
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
var i = this.yylloc.range;
return this.yylloc = {
first_line: this.yylloc.first_line,
last_line: this.yylineno + 1,
first_column: this.yylloc.first_column,
last_column: n ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length : this.yylloc.first_column - t
}, this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - t]), this
},
more: function () {
return this._more = !0, this
},
less: function (e) {
this.unput(this.match.slice(e))
},
pastInput: function () {
var e = this.matched.substr(0, this.matched.length - this.match.length);
return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, "")
},
upcomingInput: function () {
var e = this.match;
return e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "")
},
showPosition: function () {
var e = this.pastInput(),
t = (new Array(e.length + 1)).join("-");
return e + this.upcomingInput() + "\n" + t + "^"
},
next: function () {
if (this.done) return this.EOF;
this._input || (this.done = !0);
var e, t, n, r, i, s;
this._more || (this.yytext = "", this.match = "");
var o = this._currentRules();
for (var u = 0; u < o.length; u++) {
n = this._input.match(this.rules[o[u]]);
if (n && (!t || n[0].length > t[0].length)) {
t = n, r = u;
if (!this.options.flex) break
}
}
if (t) {
s = t[0].match(/(?:\r\n?|\n).*/g), s && (this.yylineno += s.length), this.yylloc = {
first_line: this.yylloc.last_line,
last_line: this.yylineno + 1,
first_column: this.yylloc.last_column,
last_column: s ? s[s.length - 1].length - s[s.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length
}, this.yytext += t[0], this.match += t[0], this.matches = t, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._input = this._input.slice(t[0].length), this.matched += t[0], e = this.performAction.call(this, this.yy, this, o[r], this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1);
if (e) return e;
return
}
return this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
text: "",
token: null,
line: this.yylineno
})
},
lex: function () {
var t = this.next();
return typeof t != "undefined" ? t : this.lex()
},
begin: function (t) {
this.conditionStack.push(t)
},
popState: function () {
return this.conditionStack.pop()
},
_currentRules: function () {
return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules
},
topState: function () {
return this.conditionStack[this.conditionStack.length - 2]
},
pushState: function (t) {
this.begin(t)
}
};
return e.options = {}, e.performAction = function (t, n, r, i) {
var s = i;
switch (r) {
case 0:
n.yytext.slice(-1) !== "\\" && this.begin("mu"), n.yytext.slice(-1) === "\\" && (n.yytext = n.yytext.substr(0, n.yyleng - 1), this.begin("emu"));
if (n.yytext) return 14;
break;
case 1:
return 14;
case 2:
return n.yytext.slice(-1) !== "\\" && this.popState(), n.yytext.slice(-1) === "\\" && (n.yytext = n.yytext.substr(0, n.yyleng - 1)), 14;
case 3:
return n.yytext = n.yytext.substr(0, n.yyleng - 4), this.popState(), 15;
case 4:
return this.begin("par"), 24;
case 5:
return 16;
case 6:
return 20;
case 7:
return 19;
case 8:
return 19;
case 9:
return 23;
case 10:
return 23;
case 11:
this.popState(), this.begin("com");
break;
case 12:
return n.yytext = n.yytext.substr(3, n.yyleng - 5), this.popState(), 15;
case 13:
return 22;
case 14:
return 36;
case 15:
return 35;
case 16:
return 35;
case 17:
return 39;
case 18:
break;
case 19:
return this.popState(), 18;
case 20:
return this.popState(), 18;
case 21:
return n.yytext = n.yytext.substr(1, n.yyleng - 2).replace(/\\"/g, '"'), 30;
case 22:
return n.yytext = n.yytext.substr(1, n.yyleng - 2).replace(/\\'/g, "'"), 30;
case 23:
return n.yytext = n.yytext.substr(1), 28;
case 24:
return 32;
case 25:
return 32;
case 26:
return 31;
case 27:
return 35;
case 28:
return n.yytext = n.yytext.substr(1, n.yyleng - 2), 35;
case 29:
return "INVALID";
case 30:
break;
case 31:
return this.popState(), 37;
case 32:
return 5
}
}, e.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|$)))/, /^(?:[\s\S]*?--\}\})/, /^(?:\{\{>)/, /^(?:\{\{#)/, /^(?:\{\{\/)/, /^(?:\{\{\^)/, /^(?:\{\{\s*else\b)/, /^(?:\{\{\{)/, /^(?:\{\{&)/, /^(?:\{\{!--)/, /^(?:\{\{![\s\S]*?\}\})/, /^(?:\{\{)/, /^(?:=)/, /^(?:\.(?=[} ]))/, /^(?:\.\.)/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}\}\})/, /^(?:\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@[a-zA-Z]+)/, /^(?:true(?=[}\s]))/, /^(?:false(?=[}\s]))/, /^(?:-?[0-9]+(?=[}\s]))/, /^(?:[a-zA-Z0-9_$-]+(?=[=}\s\/.]))/, /^(?:\[[^\]]*\])/, /^(?:.)/, /^(?:\s+)/, /^(?:[a-zA-Z0-9_$-/]+)/, /^(?:$)/], e.conditions = {
mu: {
rules: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32],
inclusive: !1
},
emu: {
rules: [2],
inclusive: !1
},
com: {
rules: [3],
inclusive: !1
},
par: {
rules: [30, 31],
inclusive: !1
},
INITIAL: {
rules: [0, 1, 32],
inclusive: !0
}
}, e
}();
return e.lexer = t, n.prototype = e, e.Parser = n, new n
}();
e.Parser = i, e.parse = function (t) {
return t.constructor === e.AST.ProgramNode ? t : (e.Parser.yy = e.AST, e.Parser.parse(t))
}, e.AST = {}, e.AST.ProgramNode = function (t, n) {
this.type = "program", this.statements = t, n && (this.inverse = new e.AST.ProgramNode(n))
}, e.AST.MustacheNode = function (e, t, n) {
this.type = "mustache", this.escaped = !n, this.hash = t;
var r = this.id = e[0],
i = this.params = e.slice(1),
s = this.eligibleHelper = r.isSimple;
this.isHelper = s && (i.length || t)
}, e.AST.PartialNode = function (e, t) {
this.type = "partial", this.partialName = e, this.context = t
}, e.AST.BlockNode = function (t, n, r, i) {
var s = function (t, n) {
if (t.original !== n.original) throw new e.Exception(t.original + " doesn't match " + n.original)
};
s(t.id, i), this.type = "block", this.mustache = t, this.program = n, this.inverse = r, this.inverse && !this.program && (this.isInverse = !0)
}, e.AST.ContentNode = function (e) {
this.type = "content", this.string = e
}, e.AST.HashNode = function (e) {
this.type = "hash", this.pairs = e
}, e.AST.IdNode = function (t) {
this.type = "ID", this.original = t.join(".");
var n = [],
r = 0;
for (var i = 0, s = t.length; i < s; i++) {
var o = t[i];
if (o === ".." || o === "." || o === "this") {
if (n.length > 0) throw new e.Exception("Invalid path: " + this.original);
o === ".." ? r++ : this.isScoped = !0
} else n.push(o)
}
this.parts = n, this.string = n.join("."), this.depth = r, this.isSimple = t.length === 1 && !this.isScoped && r === 0, this.stringModeValue = this.string
}, e.AST.PartialNameNode = function (e) {
this.type = "PARTIAL_NAME", this.name = e
}, e.AST.DataNode = function (e) {
this.type = "DATA", this.id = e
}, e.AST.StringNode = function (e) {
this.type = "STRING", this.string = e, this.stringModeValue = e
}, e.AST.IntegerNode = function (e) {
this.type = "INTEGER", this.integer = e, this.stringModeValue = Number(e)
}, e.AST.BooleanNode = function (e) {
this.type = "BOOLEAN", this.bool = e, this.stringModeValue = e === "true"
}, e.AST.CommentNode = function (e) {
this.type = "comment", this.comment = e
};
var s = ["description", "fileName", "lineNumber", "message", "name", "number", "stack"];
e.Exception = function (e) {
var t = Error.prototype.constructor.apply(this, arguments);
for (var n = 0; n < s.length; n++) this[s[n]] = t[s[n]]
}, e.Exception.prototype = new Error, e.SafeString = function (e) {
this.string = e
}, e.SafeString.prototype.toString = function () {
return this.string.toString()
};
var o = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
"'": "&#x27;",
"`": "&#x60;"
}, u = /[&<>"'`]/g,
a = /[&<>"'`]/,
f = function (e) {
return o[e] || "&amp;"
};
e.Utils = {
escapeExpression: function (t) {
return t instanceof e.SafeString ? t.toString() : t == null || t === !1 ? "" : a.test(t) ? t.replace(u, f) : t
},
isEmpty: function (e) {
return !e && e !== 0 ? !0 : n.call(e) === "[object Array]" && e.length === 0 ? !0 : !1
}
};
var l = e.Compiler = function () {}, c = e.JavaScriptCompiler = function () {};
l.prototype = {
compiler: l,
disassemble: function () {
var e = this.opcodes,
t, n = [],
r, i;
for (var s = 0, o = e.length; s < o; s++) {
t = e[s];
if (t.opcode === "DECLARE") n.push("DECLARE " + t.name + "=" + t.value);
else {
r = [];
for (var u = 0; u < t.args.length; u++) i = t.args[u], typeof i == "string" && (i = '"' + i.replace("\n", "\\n") + '"'), r.push(i);
n.push(t.opcode + " " + r.join(" "))
}
}
return n.join("\n")
},
equals: function (e) {
var t = this.opcodes.length;
if (e.opcodes.length !== t) return !1;
for (var n = 0; n < t; n++) {
var r = this.opcodes[n],
i = e.opcodes[n];
if (r.opcode !== i.opcode || r.args.length !== i.args.length) return !1;
for (var s = 0; s < r.args.length; s++)
if (r.args[s] !== i.args[s]) return !1
}
t = this.children.length;
if (e.children.length !== t) return !1;
for (n = 0; n < t; n++)
if (!this.children[n].equals(e.children[n])) return !1;
return !0
},
guid: 0,
compile: function (e, t) {
this.children = [], this.depths = {
list: []
}, this.options = t;
var n = this.options.knownHelpers;
this.options.knownHelpers = {
helperMissing: !0,
blockHelperMissing: !0,
each: !0,
"if": !0,
unless: !0,
"with": !0,
log: !0
};
if (n)
for (var r in n) this.options.knownHelpers[r] = n[r];
return this.program(e)
},
accept: function (e) {
return this[e.type](e)
},
program: function (e) {
var t = e.statements,
n;
this.opcodes = [];
for (var r = 0, i = t.length; r < i; r++) n = t[r], this[n.type](n);
return this.isSimple = i === 1, this.depths.list = this.depths.list.sort(function (e, t) {
return e - t
}), this
},
compileProgram: function (e) {
var t = (new this.compiler).compile(e, this.options),
n = this.guid++,
r;
this.usePartial = this.usePartial || t.usePartial, this.children[n] = t;
for (var i = 0, s = t.depths.list.length; i < s; i++) {
r = t.depths.list[i];
if (r < 2) continue;
this.addDepth(r - 1)
}
return n
},
block: function (e) {
var t = e.mustache,
n = e.program,
r = e.inverse;
n && (n = this.compileProgram(n)), r && (r = this.compileProgram(r));
var i = this.classifyMustache(t);
i === "helper" ? this.helperMustache(t, n, r) : i === "simple" ? (this.simpleMustache(t), this.opcode("pushProgram", n), this.opcode("pushProgram", r), this.opcode("emptyHash"), this.opcode("blockValue")) : (this.ambiguousMustache(t, n, r), this.opcode("pushProgram", n), this.opcode("pushProgram", r), this.opcode("emptyHash"), this.opcode("ambiguousBlockValue")), this.opcode("append")
},
hash: function (e) {
var t = e.pairs,
n, r;
this.opcode("pushHash");
for (var i = 0, s = t.length; i < s; i++) n = t[i], r = n[1], this.options.stringParams ? this.opcode("pushStringParam", r.stringModeValue, r.type) : this.accept(r), this.opcode("assignToHash", n[0]);
this.opcode("popHash")
},
partial: function (e) {
var t = e.partialName;
this.usePartial = !0, e.context ? this.ID(e.context) : this.opcode("push", "depth0"), this.opcode("invokePartial", t.name), this.opcode("append")
},
content: function (e) {
this.opcode("appendContent", e.string)
},
mustache: function (e) {
var t = this.options,
n = this.classifyMustache(e);
n === "simple" ? this.simpleMustache(e) : n === "helper" ? this.helperMustache(e) : this.ambiguousMustache(e), e.escaped && !t.noEscape ? this.opcode("appendEscaped") : this.opcode("append")
},
ambiguousMustache: function (e, t, n) {
var r = e.id,
i = r.parts[0],
s = t != null || n != null;
this.opcode("getContext", r.depth), this.opcode("pushProgram", t), this.opcode("pushProgram", n), this.opcode("invokeAmbiguous", i, s)
},
simpleMustache: function (e) {
var t = e.id;
t.type === "DATA" ? this.DATA(t) : t.parts.length ? this.ID(t) : (this.addDepth(t.depth), this.opcode("getContext", t.depth), this.opcode("pushContext")), this.opcode("resolvePossibleLambda")
},
helperMustache: function (e, t, n) {
var r = this.setupFullMustacheParams(e, t, n),
i = e.id.parts[0];
if (this.options.knownHelpers[i]) this.opcode("invokeKnownHelper", r.length, i);
else {
if (this.knownHelpersOnly) throw new Error("You specified knownHelpersOnly, but used the unknown helper " + i);
this.opcode("invokeHelper", r.length, i)
}
},
ID: function (e) {
this.addDepth(e.depth), this.opcode("getContext", e.depth);
var t = e.parts[0];
t ? this.opcode("lookupOnContext", e.parts[0]) : this.opcode("pushContext");
for (var n = 1, r = e.parts.length; n < r; n++) this.opcode("lookup", e.parts[n])
},
DATA: function (e) {
this.options.data = !0, this.opcode("lookupData", e.id)
},
STRING: function (e) {
this.opcode("pushString", e.string)
},
INTEGER: function (e) {
this.opcode("pushLiteral", e.integer)
},
BOOLEAN: function (e) {
this.opcode("pushLiteral", e.bool)
},
comment: function () {},
opcode: function (e) {
this.opcodes.push({
opcode: e,
args: [].slice.call(arguments, 1)
})
},
declare: function (e, t) {
this.opcodes.push({
opcode: "DECLARE",
name: e,
value: t
})
},
addDepth: function (e) {
if (isNaN(e)) throw new Error("EWOT");
if (e === 0) return;
this.depths[e] || (this.depths[e] = !0, this.depths.list.push(e))
},
classifyMustache: function (e) {
var t = e.isHelper,
n = e.eligibleHelper,
r = this.options;
if (n && !t) {
var i = e.id.parts[0];
r.knownHelpers[i] ? t = !0 : r.knownHelpersOnly && (n = !1)
}
return t ? "helper" : n ? "ambiguous" : "simple"
},
pushParams: function (e) {
var t = e.length,
n;
while (t--) n = e[t], this.options.stringParams ? (n.depth && this.addDepth(n.depth), this.opcode("getContext", n.depth || 0), this.opcode("pushStringParam", n.stringModeValue, n.type)) : this[n.type](n)
},
setupMustacheParams: function (e) {
var t = e.params;
return this.pushParams(t), e.hash ? this.hash(e.hash) : this.opcode("emptyHash"), t
},
setupFullMustacheParams: function (e, t, n) {
var r = e.params;
return this.pushParams(r), this.opcode("pushProgram", t), this.opcode("pushProgram", n), e.hash ? this.hash(e.hash) : this.opcode("emptyHash"), r
}
};
var h = function (e) {
this.value = e
};
c.prototype = {
nameLookup: function (e, t) {
return /^[0-9]+$/.test(t) ? e + "[" + t + "]" : c.isValidJavaScriptVariableName(t) ? e + "." + t : e + "['" + t + "']"
},
appendToBuffer: function (e) {
return this.environment.isSimple ? "return " + e + ";" : {
appendToBuffer: !0,
content: e,
toString: function () {
return "buffer += " + e + ";"
}
}
},
initializeBuffer: function () {
return this.quotedString("")
},
namespace: "Handlebars",
compile: function (t, n, r, i) {
this.environment = t, this.options = n || {}, e.log(e.logger.DEBUG, this.environment.disassemble() + "\n\n"), this.name = this.environment.name, this.isChild = !! r, this.context = r || {
programs: [],
environments: [],
aliases: {}
}, this.preamble(), this.stackSlot = 0, this.stackVars = [], this.registers = {
list: []
}, this.compileStack = [], this.inlineStack = [], this.compileChildren(t, n);
var s = t.opcodes,
o;
this.i = 0;
for (m = s.length; this.i < m; this.i++) o = s[this.i], o.opcode === "DECLARE" ? this[o.name] = o.value : this[o.opcode].apply(this, o.args);
return this.createFunctionContext(i)
},
nextOpcode: function () {
var e = this.environment.opcodes;
return e[this.i + 1]
},
eat: function () {
this.i = this.i + 1
},
preamble: function () {
var e = [];
if (!this.isChild) {
var t = this.namespace,
n = "helpers = helpers || " + t + ".helpers;";
this.environment.usePartial && (n = n + " partials = partials || " + t + ".partials;"), this.options.data && (n += " data = data || {};"), e.push(n)
} else e.push("");
this.environment.isSimple ? e.push("") : e.push(", buffer = " + this.initializeBuffer()), this.lastContext = 0, this.source = e
},
createFunctionContext: function (t) {
var n = this.stackVars.concat(this.registers.list);
n.length > 0 && (this.source[1] = this.source[1] + ", " + n.join(", "));
if (!this.isChild)
for (var r in this.context.aliases) this.source[1] = this.source[1] + ", " + r + "=" + this.context.aliases[r];
this.source[1] && (this.source[1] = "var " + this.source[1].substring(2) + ";"), this.isChild || (this.source[1] += "\n" + this.context.programs.join("\n") + "\n"), this.environment.isSimple || this.source.push("return buffer;");
var i = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"];
for (var s = 0, o = this.environment.depths.list.length; s < o; s++) i.push("depth" + this.environment.depths.list[s]);
var u = this.mergeSource();
if (!this.isChild) {
var a = e.COMPILER_REVISION,
f = e.REVISION_CHANGES[a];
u = "this.compilerInfo = [" + a + ",'" + f + "'];\n" + u
}
if (t) return i.push(u), Function.apply(this, i);
var l = "function " + (this.name || "") + "(" + i.join(",") + ") {\n " + u + "}";
return e.log(e.logger.DEBUG, l + "\n\n"), l
},
mergeSource: function () {
var e = "",
n;
for (var r = 0, i = this.source.length; r < i; r++) {
var s = this.source[r];
s.appendToBuffer ? n ? n = n + "\n + " + s.content : n = s.content : (n && (e += "buffer += " + n + ";\n ", n = t), e += s + "\n ")
}
return e
},
blockValue: function () {
this.context.aliases.blockHelperMissing = "helpers.blockHelperMissing";
var e = ["depth0"];
this.setupParams(0, e), this.replaceStack(function (t) {
return e.splice(1, 0, t), "blockHelperMissing.call(" + e.join(", ") + ")"
})
},
ambiguousBlockValue: function () {
this.context.aliases.blockHelperMissing = "helpers.blockHelperMissing";
var e = ["depth0"];
this.setupParams(0, e);
var t = this.topStack();
e.splice(1, 0, t), e[e.length - 1] = "options", this.source.push("if (!" + this.lastHelper + ") { " + t + " = blockHelperMissing.call(" + e.join(", ") + "); }")
},
appendContent: function (e) {
this.source.push(this.appendToBuffer(this.quotedString(e)))
},
append: function () {
this.flushInline();
var e = this.popStack();
this.source.push("if(" + e + " || " + e + " === 0) { " + this.appendToBuffer(e) + " }"), this.environment.isSimple && this.source.push("else { " + this.appendToBuffer("''") + " }")
},
appendEscaped: function () {
this.context.aliases.escapeExpression = "this.escapeExpression", this.source.push(this.appendToBuffer("escapeExpression(" + this.popStack() + ")"))
},
getContext: function (e) {
this.lastContext !== e && (this.lastContext = e)
},
lookupOnContext: function (e) {
this.push(this.nameLookup("depth" + this.lastContext, e, "context"))
},
pushContext: function () {
this.pushStackLiteral("depth" + this.lastContext)
},
resolvePossibleLambda: function () {
this.context.aliases.functionType = '"function"', this.replaceStack(function (e) {
return "typeof " + e + " === functionType ? " + e + ".apply(depth0) : " + e
})
},
lookup: function (e) {
this.replaceStack(function (t) {
return t + " == null || " + t + " === false ? " + t + " : " + this.nameLookup(t, e, "context")
})
},
lookupData: function (e) {
this.push(this.nameLookup("data", e, "data"))
},
pushStringParam: function (e, t) {
this.pushStackLiteral("depth" + this.lastContext), this.pushString(t), typeof e == "string" ? this.pushString(e) : this.pushStackLiteral(e)
},
emptyHash: function () {
this.pushStackLiteral("{}"), this.options.stringParams && this.register("hashTypes", "{}")
},
pushHash: function () {
this.hash = {
values: [],
types: []
}
},
popHash: function () {
var e = this.hash;
this.hash = t, this.options.stringParams && this.register("hashTypes", "{" + e.types.join(",") + "}"), this.push("{\n " + e.values.join(",\n ") + "\n }")
},
pushString: function (e) {
this.pushStackLiteral(this.quotedString(e))
},
push: function (e) {
return this.inlineStack.push(e), e
},
pushLiteral: function (e) {
this.pushStackLiteral(e)
},
pushProgram: function (e) {
e != null ? this.pushStackLiteral(this.programExpression(e)) : this.pushStackLiteral(null)
},
invokeHelper: function (e, t) {
this.context.aliases.helperMissing = "helpers.helperMissing";
var n = this.lastHelper = this.setupHelper(e, t, !0);
this.push(n.name), this.replaceStack(function (e) {
return e + " ? " + e + ".call(" + n.callParams + ") " + ": helperMissing.call(" + n.helperMissingParams + ")"
})
},
invokeKnownHelper: function (e, t) {
var n = this.setupHelper(e, t);
this.push(n.name + ".call(" + n.callParams + ")")
},
invokeAmbiguous: function (e, t) {
this.context.aliases.functionType = '"function"', this.pushStackLiteral("{}");
var n = this.setupHelper(0, e, t),
r = this.lastHelper = this.nameLookup("helpers", e, "helper"),
i = this.nameLookup("depth" + this.lastContext, e, "context"),
s = this.nextStack();
this.source.push("if (" + s + " = " + r + ") { " + s + " = " + s + ".call(" + n.callParams + "); }"), this.source.push("else { " + s + " = " + i + "; " + s + " = typeof " + s + " === functionType ? " + s + ".apply(depth0) : " + s + "; }")
},
invokePartial: function (e) {
var t = [this.nameLookup("partials", e, "partial"), "'" + e + "'", this.popStack(), "helpers", "partials"];
this.options.data && t.push("data"), this.context.aliases.self = "this", this.push("self.invokePartial(" + t.join(", ") + ")")
},
assignToHash: function (e) {
var t = this.popStack(),
n;
this.options.stringParams && (n = this.popStack(), this.popStack());
var r = this.hash;
n && r.types.push("'" + e + "': " + n), r.values.push("'" + e + "': (" + t + ")")
},
compiler: c,
compileChildren: function (e, t) {
var n = e.children,
r, i;
for (var s = 0, o = n.length; s < o; s++) {
r = n[s], i = new this.compiler;
var u = this.matchExistingProgram(r);
u == null ? (this.context.programs.push(""), u = this.context.programs.length, r.index = u, r.name = "program" + u, this.context.programs[u] = i.compile(r, t, this.context), this.context.environments[u] = r) : (r.index = u, r.name = "program" + u)
}
},
matchExistingProgram: function (e) {
for (var t = 0, n = this.context.environments.length; t < n; t++) {
var r = this.context.environments[t];
if (r && r.equals(e)) return t
}
},
programExpression: function (e) {
this.context.aliases.self = "this";
if (e == null) return "self.noop";
var t = this.environment.children[e],
n = t.depths.list,
r, i = [t.index, t.name, "data"];
for (var s = 0, o = n.length; s < o; s++) r = n[s], r === 1 ? i.push("depth0") : i.push("depth" + (r - 1));
return n.length === 0 ? "self.program(" + i.join(", ") + ")" : (i.shift(), "self.programWithDepth(" + i.join(", ") + ")")
},
register: function (e, t) {
this.useRegister(e), this.source.push(e + " = " + t + ";")
},
useRegister: function (e) {
this.registers[e] || (this.registers[e] = !0, this.registers.list.push(e))
},
pushStackLiteral: function (e) {
return this.push(new h(e))
},
pushStack: function (e) {
this.flushInline();
var t = this.incrStack();
return e && this.source.push(t + " = " + e + ";"), this.compileStack.push(t), t
},
replaceStack: function (e) {
var t = "",
n = this.isInline(),
r;
if (n) {
var i = this.popStack(!0);
if (i instanceof h) r = i.value;
else {
var s = this.stackSlot ? this.topStackName() : this.incrStack();
t = "(" + this.push(s) + " = " + i + "),", r = this.topStack()
}
} else r = this.topStack();
var o = e.call(this, r);
return n ? ((this.inlineStack.length || this.compileStack.length) && this.popStack(), this.push("(" + t + o + ")")) : (/^stack/.test(r) || (r = this.nextStack()), this.source.push(r + " = (" + t + o + ");")), r
},
nextStack: function () {
return this.pushStack()
},
incrStack: function () {
return this.stackSlot++, this.stackSlot > this.stackVars.length && this.stackVars.push("stack" + this.stackSlot), this.topStackName()
},
topStackName: function () {
return "stack" + this.stackSlot
},
flushInline: function () {
var e = this.inlineStack;
if (e.length) {
this.inlineStack = [];
for (var t = 0, n = e.length; t < n; t++) {
var r = e[t];
r instanceof h ? this.compileStack.push(r) : this.pushStack(r)
}
}
},
isInline: function () {
return this.inlineStack.length
},
popStack: function (e) {
var t = this.isInline(),
n = (t ? this.inlineStack : this.compileStack).pop();
return !e && n instanceof h ? n.value : (t || this.stackSlot--, n)
},
topStack: function (e) {
var t = this.isInline() ? this.inlineStack : this.compileStack,
n = t[t.length - 1];
return !e && n instanceof h ? n.value : n
},
quotedString: function (e) {
return '"' + e.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r") + '"'
},
setupHelper: function (e, t, n) {
var r = [];
this.setupParams(e, r, n);
var i = this.nameLookup("helpers", t, "helper");
return {
params: r,
name: i,
callParams: ["depth0"].concat(r).join(", "),
helperMissingParams: n && ["depth0", this.quotedString(t)].concat(r).join(", ")
}
},
setupParams: function (e, t, n) {
var r = [],
i = [],
s = [],
o, u, a;
r.push("hash:" + this.popStack()), u = this.popStack(), a = this.popStack();
if (a || u) a || (this.context.aliases.self = "this", a = "self.noop"), u || (this.context.aliases.self = "this", u = "self.noop"), r.push("inverse:" + u), r.push("fn:" + a);
for (var f = 0; f < e; f++) o = this.popStack(), t.push(o), this.options.stringParams && (s.push(this.popStack()), i.push(this.popStack()));
return this.options.stringParams && (r.push("contexts:[" + i.join(",") + "]"), r.push("types:[" + s.join(",") + "]"), r.push("hashTypes:hashTypes")), this.options.data && r.push("data:data"), r = "{" + r.join(",") + "}", n ? (this.register("options", r), t.push("options")) : t.push(r), t.join(", ")
}
};
var p = "break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),
d = c.RESERVED_WORDS = {};
for (var v = 0, m = p.length; v < m; v++) d[p[v]] = !0;
c.isValidJavaScriptVariableName = function (e) {
return !c.RESERVED_WORDS[e] && /^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(e) ? !0 : !1
}, e.precompile = function (t, n) {
if (!t || typeof t != "string" && t.constructor !== e.AST.ProgramNode) throw new e.Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + t);
n = n || {}, "data" in n || (n.data = !0);
var r = e.parse(t),
i = (new l).compile(r, n);
return (new c).compile(i, n)
}, e.compile = function (n, r) {
function s() {
var i = e.parse(n),
s = (new l).compile(i, r),
o = (new c).compile(s, r, t, !0);
return e.template(o)
}
if (!n || typeof n != "string" && n.constructor !== e.AST.ProgramNode) throw new e.Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + n);
r = r || {}, "data" in r || (r.data = !0);
var i;
return function (e, t) {
return i || (i = s()), i.call(this, e, t)
}
}, e.VM = {
template: function (t) {
var n = {
escapeExpression: e.Utils.escapeExpression,
invokePartial: e.VM.invokePartial,
programs: [],
program: function (t, n, r) {
var i = this.programs[t];
return r ? e.VM.program(n, r) : i ? i : (i = this.programs[t] = e.VM.program(n), i)
},
programWithDepth: e.VM.programWithDepth,
noop: e.VM.noop,
compilerInfo: null
};
return function (r, i) {
i = i || {};
var s = t.call(n, e, r, i.helpers, i.partials, i.data),
o = n.compilerInfo || [],
u = o[0] || 1,
a = e.COMPILER_REVISION;
if (u !== a) {
if (u < a) {
var f = e.REVISION_CHANGES[a],
l = e.REVISION_CHANGES[u];
throw "Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (" + f + ") or downgrade your runtime to an older version (" + l + ")."
}
throw "Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version (" + o[1] + ")."
}
return s
}
},
programWithDepth: function (e, t, n) {
var r = Array.prototype.slice.call(arguments, 2);
return function (n, i) {
return i = i || {}, e.apply(this, [n, i.data || t].concat(r))
}
},
program: function (e, t) {
return function (n, r) {
return r = r || {}, e(n, r.data || t)
}
},
noop: function () {
return ""
},
invokePartial: function (n, r, i, s, o, u) {
var a = {
helpers: s,
partials: o,
data: u
};
if (n === t) throw new e.Exception("The partial " + r + " could not be found");
if (n instanceof Function) return n(i, a);
if (!e.compile) throw new e.Exception("The partial " + r + " could not be compiled when running in runtime-only mode");
return o[r] = e.compile(n, {
data: u !== t
}), o[r](i, a)
}
}, e.template = e.VM.template
})(Handlebars),
function () {
var e, t;
(function () {
var n = {}, r = {};
e = function (e, t, r) {
n[e] = {
deps: t,
callback: r
}
}, t = function (e) {
if (r[e]) return r[e];
r[e] = {};
for (var i, s = n[e], o = s.deps, u = s.callback, a = [], f = 0, l = o.length; l > f; f++) "exports" === o[f] ? a.push(i = {}) : a.push(t(o[f]));
var c = u.apply(this, a);
return r[e] = i || c
}
})(),
function () {
function e(e) {
return t.console && t.console[e] ? t.console[e].apply ? function () {
t.console[e].apply(t.console, arguments)
} : function () {
var n = Array.prototype.join.call(arguments, ", ");
t.console[e](n)
} : void 0
}
"undefined" == typeof Ember && (Ember = {});
var t = Ember.imports = Ember.imports || this,
n = Ember.exports = Ember.exports || this;
Ember.lookup = Ember.lookup || this, n.Em = n.Ember = Em = Ember, Ember.isNamespace = !0, Ember.toString = function () {
return "Ember"
}, Ember.VERSION = "1.0.0-rc.3", Ember.ENV = Ember.ENV || ("undefined" == typeof ENV ? {} : ENV), Ember.config = Ember.config || {}, Ember.EXTEND_PROTOTYPES = Ember.ENV.EXTEND_PROTOTYPES, "undefined" == typeof Ember.EXTEND_PROTOTYPES && (Ember.EXTEND_PROTOTYPES = !0), Ember.LOG_STACKTRACE_ON_DEPRECATION = Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION !== !1, Ember.SHIM_ES5 = Ember.ENV.SHIM_ES5 === !1 ? !1 : Ember.EXTEND_PROTOTYPES, Ember.LOG_VERSION = Ember.ENV.LOG_VERSION === !1 ? !1 : !0, Ember.K = function () {
return this
}, "undefined" == typeof Ember.assert && (Ember.assert = Ember.K), "undefined" == typeof Ember.warn && (Ember.warn = Ember.K), "undefined" == typeof Ember.debug && (Ember.debug = Ember.K), "undefined" == typeof Ember.deprecate && (Ember.deprecate = Ember.K), "undefined" == typeof Ember.deprecateFunc && (Ember.deprecateFunc = function (e, t) {
return t
}), Ember.uuid = 0, Ember.Logger = {
log: e("log") || Ember.K,
warn: e("warn") || Ember.K,
error: e("error") || Ember.K,
info: e("info") || Ember.K,
debug: e("debug") || e("info") || Ember.K
}, Ember.onerror = null, Ember.handleErrors = function (e, t) {
if ("function" != typeof Ember.onerror) return e.call(t || this);
try {
return e.call(t || this)
} catch (n) {
Ember.onerror(n)
}
}, Ember.merge = function (e, t) {
for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
return e
}, Ember.isNone = function (e) {
return null === e || void 0 === e
}, Ember.none = Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isNone instead.", Ember.isNone), Ember.isEmpty = function (e) {
return Ember.isNone(e) || 0 === e.length && "function" != typeof e || "object" == typeof e && 0 === Ember.get(e, "length")
}, Ember.empty = Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.", Ember.isEmpty)
}(),
function () {
var e = Ember.platform = {};
if (Ember.create = Object.create, Ember.create && 2 !== Ember.create({
a: 1
}, {
a: {
value: 2
}
}).a && (Ember.create = null), !Ember.create || Ember.ENV.STUB_OBJECT_CREATE) {
var t = function () {};
Ember.create = function (e, n) {
if (t.prototype = e, e = new t, n) {
t.prototype = e;
for (var r in n) t.prototype[r] = n[r].value;
e = new t
}
return t.prototype = null, e
}, Ember.create.isSimulated = !0
}
var n, r, i = Object.defineProperty;
if (i) try {
i({}, "a", {
get: function () {}
})
} catch (s) {
i = null
}
i && (n = function () {
var e = {};
return i(e, "a", {
configurable: !0,
enumerable: !0,
get: function () {},
set: function () {}
}), i(e, "a", {
configurable: !0,
enumerable: !0,
writable: !0,
value: !0
}), e.a === !0
}(), r = function () {
try {
return i(document.createElement("div"), "definePropertyOnDOM", {}), !0
} catch (e) {}
return !1
}(), n ? r || (i = function (e, t, n) {
var r;
return r = "object" == typeof Node ? e instanceof Node : "object" == typeof e && "number" == typeof e.nodeType && "string" == typeof e.nodeName, r ? e[t] = n.value : Object.defineProperty(e, t, n)
}) : i = null), e.defineProperty = i, e.hasPropertyAccessors = !0, e.defineProperty || (e.hasPropertyAccessors = !1, e.defineProperty = function (e, t, n) {
n.get || (e[t] = n.value)
}, e.defineProperty.isSimulated = !0), Ember.ENV.MANDATORY_SETTER && !e.hasPropertyAccessors && (Ember.ENV.MANDATORY_SETTER = !1)
}(),
function () {
var e = function (e) {
return e && Function.prototype.toString.call(e).indexOf("[native code]") > -1
}, t = e(Array.prototype.map) ? Array.prototype.map : function (e) {
if (void 0 === this || null === this) throw new TypeError;
var t = Object(this),
n = t.length >>> 0;
if ("function" != typeof e) throw new TypeError;
for (var r = new Array(n), i = arguments[1], s = 0; n > s; s++) s in t && (r[s] = e.call(i, t[s], s, t));
return r
}, n = e(Array.prototype.forEach) ? Array.prototype.forEach : function (e) {
if (void 0 === this || null === this) throw new TypeError;
var t = Object(this),
n = t.length >>> 0;
if ("function" != typeof e) throw new TypeError;
for (var r = arguments[1], i = 0; n > i; i++) i in t && e.call(r, t[i], i, t)
}, r = e(Array.prototype.indexOf) ? Array.prototype.indexOf : function (e, t) {
null === t || void 0 === t ? t = 0 : 0 > t && (t = Math.max(0, this.length + t));
for (var n = t, r = this.length; r > n; n++)
if (this[n] === e) return n;
return -1
};
Ember.ArrayPolyfills = {
map: t,
forEach: n,
indexOf: r
}, Ember.SHIM_ES5 && (Array.prototype.map || (Array.prototype.map = t), Array.prototype.forEach || (Array.prototype.forEach = n), Array.prototype.indexOf || (Array.prototype.indexOf = r))
}(),
function () {
function e(e) {
this.descs = {}, this.watching = {}, this.cache = {}, this.source = e
}
function t(e, t) {
return !!e && "function" == typeof e[t]
}
var n = Ember.platform.defineProperty,
r = Ember.create,
i = "__ember" + +(new Date),
s = 0,
o = [],
u = {}, a = Ember.ENV.MANDATORY_SETTER;
Ember.GUID_KEY = i;
var f = {
writable: !1,
configurable: !1,
enumerable: !1,
value: null
};
Ember.generateGuid = function (e, t) {
t || (t = "ember");
var r = t + s++;
return e && (f.value = r, n(e, i, f)), r
}, Ember.guidFor = function (e) {
if (void 0 === e) return "(undefined)";
if (null === e) return "(null)";
var t, r = typeof e;
switch (r) {
case "number":
return t = o[e], t || (t = o[e] = "nu" + e), t;
case "string":
return t = u[e], t || (t = u[e] = "st" + s++), t;
case "boolean":
return e ? "(true)" : "(false)";
default:
return e[i] ? e[i] : e === Object ? "(Object)" : e === Array ? "(Array)" : (t = "ember" + s++, f.value = t, n(e, i, f), t)
}
};
var l = {
writable: !0,
configurable: !1,
enumerable: !1,
value: null
}, c = Ember.GUID_KEY + "_meta";
Ember.META_KEY = c;
var h = {
descs: {},
watching: {}
};
a && (h.values = {}), Ember.EMPTY_META = h, Object.freeze && Object.freeze(h);
var p = Ember.platform.defineProperty.isSimulated;
p && (e.prototype.__preventPlainObject__ = !0, e.prototype.toJSON = function () {}), Ember.meta = function (t, i) {
var s = t[c];
return i === !1 ? s || h : (s ? s.source !== t && (p || n(t, c, l), s = r(s), s.descs = r(s.descs), s.watching = r(s.watching), s.cache = {}, s.source = t, a && (s.values = r(s.values)), t[c] = s) : (p || n(t, c, l), s = new e(t), a && (s.values = {}), t[c] = s, s.descs.constructor = null), s)
}, Ember.getMeta = function (e, t) {
var n = Ember.meta(e, !1);
return n[t]
}, Ember.setMeta = function (e, t, n) {
var r = Ember.meta(e, !0);
return r[t] = n, n
}, Ember.metaPath = function (e, t, n) {
for (var i, s, o = Ember.meta(e, n), u = 0, a = t.length; a > u; u++) {
if (i = t[u], s = o[i]) {
if (s.__ember_source__ !== e) {
if (!n) return void 0;
s = o[i] = r(s), s.__ember_source__ = e
}
} else {
if (!n) return void 0;
s = o[i] = {
__ember_source__: e
}
}
o = s
}
return s
}, Ember.wrap = function (e, t) {
function n() {}
function r() {
var r, i = this._super;
return this._super = t || n, r = e.apply(this, arguments), this._super = i, r
}
return r.wrappedFunction = e, r.__ember_observes__ = e.__ember_observes__, r.__ember_observesBefore__ = e.__ember_observesBefore__, r
}, Ember.isArray = function (e) {
return !e || e.setInterval ? !1 : Array.isArray && Array.isArray(e) ? !0 : Ember.Array && Ember.Array.detect(e) ? !0 : void 0 !== e.length && "object" == typeof e ? !0 : !1
}, Ember.makeArray = function (e) {
return null === e || void 0 === e ? [] : Ember.isArray(e) ? e : [e]
}, Ember.canInvoke = t, Ember.tryInvoke = function (e, n, r) {
return t(e, n) ? e[n].apply(e, r || []) : void 0
};
var d = function () {
var e = 0;
try {
try {} finally {
throw e++, new Error("needsFinallyFixTest")
}
} catch (t) {}
return 1 !== e
}();
Ember.tryFinally = d ? function (e, t, n) {
var r, i, s;
n = n || this;
try {
r = e.call(n)
} finally {
try {
i = t.call(n)
} catch (o) {
s = o
}
}
if (s) throw s;
return void 0 === i ? r : i
} : function (e, t, n) {
var r, i;
n = n || this;
try {
r = e.call(n)
} finally {
i = t.call(n)
}
return void 0 === i ? r : i
}, Ember.tryCatchFinally = d ? function (e, t, n, r) {
var i, s, o;
r = r || this;
try {
i = e.call(r)
} catch (u) {
i = t.call(r, u)
} finally {
try {
s = n.call(r)
} catch (a) {
o = a
}
}
if (o) throw o;
return void 0 === s ? i : s
} : function (e, t, n, r) {
var i, s;
r = r || this;
try {
i = e.call(r)
} catch (o) {
i = t.call(r, o)
} finally {
s = n.call(r)
}
return void 0 === s ? i : s
};
var v = {}, m = "Boolean Number String Function Array Date RegExp Object".split(" ");
Ember.ArrayPolyfills.forEach.call(m, function (e) {
v["[object " + e + "]"] = e.toLowerCase()
});
var g = Object.prototype.toString;
Ember.typeOf = function (e) {
var t;
return t = null === e || void 0 === e ? String(e) : v[g.call(e)] || "object", "function" === t ? Ember.Object && Ember.Object.detect(e) && (t = "class") : "object" === t && (t = e instanceof Error ? "error" : Ember.Object && e instanceof Ember.Object ? "instance" : "object"), t
}
}(),
function () {
Ember.Instrumentation = {};
var e = [],
t = {}, n = function (n) {
for (var r, i = [], s = 0, o = e.length; o > s; s++) r = e[s], r.regex.test(n) && i.push(r.object);
return t[n] = i, i
}, r = function () {
var e = "undefined" != typeof window ? window.performance || {} : {}, t = e.now || e.mozNow || e.webkitNow || e.msNow || e.oNow;
return t ? t.bind(e) : function () {
return +(new Date)
}
}();
Ember.Instrumentation.instrument = function (e, i, s, o) {
function u() {
for (d = 0, v = h.length; v > d; d++) p = h[d], m[d] = p.before(e, r(), i);
return s.call(o)
}
function a(e) {
i = i || {}, i.exception = e
}
function f() {
for (d = 0, v = h.length; v > d; d++) p = h[d], p.after(e, r(), i, m[d]);
Ember.STRUCTURED_PROFILE && console.timeEnd(l)
}
var l, c, h = t[e];
if (Ember.STRUCTURED_PROFILE && (l = e + ": " + i.object, console.time(l)), h || (h = n(e)), 0 === h.length) return c = s.call(o), Ember.STRUCTURED_PROFILE && console.timeEnd(l), c;
var p, d, v, m = [];
return Ember.tryCatchFinally(u, a, f)
}, Ember.Instrumentation.subscribe = function (n, r) {
for (var i, s = n.split("."), o = [], u = 0, a = s.length; a > u; u++) i = s[u], "*" === i ? o.push("[^\\.]*") : o.push(i);
o = o.join("\\."), o += "(\\..*)?";
var f = {
pattern: n,
regex: new RegExp("^" + o + "$"),
object: r
};
return e.push(f), t = {}, f
}, Ember.Instrumentation.unsubscribe = function (n) {
for (var r, i = 0, s = e.length; s > i; i++) e[i] === n && (r = i);
e.splice(r, 1), t = {}
}, Ember.Instrumentation.reset = function () {
e = [], t = {}
}, Ember.instrument = Ember.Instrumentation.instrument, Ember.subscribe = Ember.Instrumentation.subscribe
}(),
function () {
var e, t, n, r;
r = Array.prototype.concat, e = Array.prototype.map || Ember.ArrayPolyfills.map, t = Array.prototype.forEach || Ember.ArrayPolyfills.forEach, n = Array.prototype.indexOf || Ember.ArrayPolyfills.indexOf;
var i = Ember.EnumerableUtils = {
map: function (t, n, r) {
return t.map ? t.map.call(t, n, r) : e.call(t, n, r)
},
forEach: function (e, n, r) {
return e.forEach ? e.forEach.call(e, n, r) : t.call(e, n, r)
},
indexOf: function (e, t, r) {
return e.indexOf ? e.indexOf.call(e, t, r) : n.call(e, t, r)
},
indexesOf: function (e, t) {
return void 0 === t ? [] : i.map(t, function (t) {
return i.indexOf(e, t)
})
},
addObject: function (e, t) {
var n = i.indexOf(e, t); - 1 === n && e.push(t)
},
removeObject: function (e, t) {
var n = i.indexOf(e, t); - 1 !== n && e.splice(n, 1)
},
replace: function (e, t, n, i) {
if (e.replace) return e.replace(t, n, i);
var s = r.apply([t, n], i);
return e.splice.apply(e, s)
},
intersection: function (e, t) {
var n = [];
return i.forEach(e, function (e) {
i.indexOf(t, e) >= 0 && n.push(e)
}), n
}
}
}(),
function () {
var e = Ember.guidFor,
t = Ember.ArrayPolyfills.indexOf,
n = function (e) {
var t = {};
for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]);
return t
}, r = function (e, t) {
var r =
e.keys.copy(),
i = n(e.values);
return t.keys = r, t.values = i, t
}, i = Ember.OrderedSet = function () {
this.clear()
};
i.create = function () {
return new i
}, i.prototype = {
clear: function () {
this.presenceSet = {}, this.list = []
},
add: function (t) {
var n = e(t),
r = this.presenceSet,
i = this.list;
n in r || (r[n] = !0, i.push(t))
},
remove: function (n) {
var r = e(n),
i = this.presenceSet,
s = this.list;
delete i[r];
var o = t.call(s, n);
o > -1 && s.splice(o, 1)
},
isEmpty: function () {
return 0 === this.list.length
},
has: function (t) {
var n = e(t),
r = this.presenceSet;
return n in r
},
forEach: function (e, t) {
for (var n = this.toArray(), r = 0, i = n.length; i > r; r++) e.call(t, n[r])
},
toArray: function () {
return this.list.slice()
},
copy: function () {
var e = new i;
return e.presenceSet = n(this.presenceSet), e.list = this.toArray(), e
}
};
var s = Ember.Map = function () {
this.keys = Ember.OrderedSet.create(), this.values = {}
};
s.create = function () {
return new s
}, s.prototype = {
get: function (t) {
var n = this.values,
r = e(t);
return n[r]
},
set: function (t, n) {
var r = this.keys,
i = this.values,
s = e(t);
r.add(t), i[s] = n
},
remove: function (t) {
var n = this.keys,
r = this.values,
i = e(t);
return r.hasOwnProperty(i) ? (n.remove(t), delete r[i], !0) : !1
},
has: function (t) {
var n = this.values,
r = e(t);
return n.hasOwnProperty(r)
},
forEach: function (t, n) {
var r = this.keys,
i = this.values;
r.forEach(function (r) {
var s = e(r);
t.call(n, r, i[s])
})
},
copy: function () {
return r(this, new s)
}
};
var o = Ember.MapWithDefault = function (e) {
s.call(this), this.defaultValue = e.defaultValue
};
o.create = function (e) {
return e ? new o(e) : new s
}, o.prototype = Ember.create(s.prototype), o.prototype.get = function (e) {
var t = this.has(e);
if (t) return s.prototype.get.call(this, e);
var n = this.defaultValue(e);
return this.set(e, n), n
}, o.prototype.copy = function () {
return r(this, new o({
defaultValue: this.defaultValue
}))
}
}(),
function () {
function e(e) {
return e.match(u)[0]
}
function t(t, r) {
var i, u = o.test(r),
a = !u && s.test(r);
if ((!t || a) && (t = Ember.lookup), u && (r = r.slice(5)), t === Ember.lookup && (i = e(r), t = n(t, i), r = r.slice(i.length + 1)), !r || 0 === r.length) throw new Error("Invalid Path");
return [t, r]
}
var n, r = Ember.META_KEY,
i = Ember.ENV.MANDATORY_SETTER,
s = /^([A-Z$]|([0-9][A-Z$])).*[\.\*]/,
o = /^this[\.\*]/,
u = /^([^\.\*]+)/;
n = function f(e, t) {
if ("" === t) return e;
if (t || "string" != typeof e || (t = e, e = null), null === e || -1 !== t.indexOf(".")) return a(e, t);
var f, n = e[r],
s = n && n.descs[t];
return s ? s.get(e, t) : (f = i && n && n.watching[t] > 0 ? n.values[t] : e[t], void 0 !== f || "object" != typeof e || t in e || "function" != typeof e.unknownProperty ? f : e.unknownProperty(t))
}, Ember.config.overrideAccessors && (Ember.get = n, Ember.config.overrideAccessors(), n = Ember.get);
var a = Ember._getPath = function (e, r) {
var i, s, u, a, f;
if (null === e && -1 === r.indexOf(".")) return n(Ember.lookup, r);
for (i = o.test(r), (!e || i) && (u = t(e, r), e = u[0], r = u[1], u.length = 0), s = r.split("."), f = s.length, a = 0; void 0 !== e && null !== e && f > a; a++)
if (e = n(e, s[a], !0), e && e.isDestroyed) return void 0;
return e
};
Ember.normalizeTuple = function (e, n) {
return t(e, n)
}, Ember.getWithDefault = function (e, t, r) {
var i = n(e, t);
return void 0 === i ? r : i
}, Ember.get = n, Ember.getPath = Ember.deprecateFunc("getPath is deprecated since get now supports paths", Ember.get)
}(),
function () {
function e(e, t, n) {
for (var r = -1, i = 0, s = e.length; s > i; i++)
if (t === e[i][0] && n === e[i][1]) {
r = i;
break
}
return r
}
function t(e, t) {
var n, r = p(e, !0);
return r.listeners || (r.listeners = {}), r.hasOwnProperty("listeners") || (r.listeners = h(r.listeners)), n = r.listeners[t], n && !r.listeners.hasOwnProperty(t) ? n = r.listeners[t] = r.listeners[t].slice() : n || (n = r.listeners[t] = []), n
}
function n(t, n, r) {
var i = t[d],
s = i && i.listeners && i.listeners[n];
if (s)
for (var o = s.length - 1; o >= 0; o--) {
var u = s[o][0],
a = s[o][1],
f = s[o][2],
l = e(r, u, a); - 1 === l && r.push([u, a, f])
}
}
function r(t, n, r) {
var i = t[d],
s = i && i.listeners && i.listeners[n],
o = [];
if (s) {
for (var u = s.length - 1; u >= 0; u--) {
var a = s[u][0],
f = s[u][1],
l = s[u][2],
c = e(r, a, f); - 1 === c && (r.push([a, f, l]), o.push([a, f, l]))
}
return o
}
}
function i(n, r, i, s, o) {
s || "function" != typeof i || (s = i, i = null);
var u = t(n, r),
a = e(u, i, s),
f = 0;
o && (f |= v), -1 === a && (u.push([i, s, f]), "function" == typeof n.didAddListener && n.didAddListener(r, i, s))
}
function s(n, r, i, s) {
function o(i, s) {
var o = t(n, r),
u = e(o, i, s); - 1 !== u && (o.splice(u, 1), "function" == typeof n.didRemoveListener && n.didRemoveListener(r, i, s))
}
if (s || "function" != typeof i || (s = i, i = null), s) o(i, s);
else {
var u = n[d],
a = u && u.listeners && u.listeners[r];
if (!a) return;
for (var f = a.length - 1; f >= 0; f--) o(a[f][0], a[f][1])
}
}
function o(n, r, i, s, o) {
function u() {
return o.call(i)
}
function a() {
f && (f[2] &= ~m)
}
s || "function" != typeof i || (s = i, i = null);
var f, l = t(n, r),
c = e(l, i, s);
return -1 !== c && (f = l[c].slice(), f[2] |= m, l[c] = f), Ember.tryFinally(u, a)
}
function u(n, r, i, s, o) {
function u() {
return o.call(i)
}
function a() {
for (h = 0, p = d.length; p > h; h++) d[h][2] &= ~m
}
s || "function" != typeof i || (s = i, i = null);
var f, l, c, h, p, d = [];
for (h = 0, p = r.length; p > h; h++) {
f = r[h], l = t(n, f);
var v = e(l, i, s); - 1 !== v && (c = l[v].slice(), c[2] |= m, l[v] = c, d.push(c))
}
return Ember.tryFinally(u, a)
}
function a(e) {
var t = e[d].listeners,
n = [];
if (t)
for (var r in t) t[r] && n.push(r);
return n
}
function f(e, t, n, r) {
if (e !== Ember && "function" == typeof e.sendEvent && e.sendEvent(t, n), !r) {
var i = e[d];
r = i && i.listeners && i.listeners[t]
}
if (r) {
for (var o = r.length - 1; o >= 0; o--) {
var u = r[o];
if (u) {
var a = u[0],
f = u[1],
l = u[2];
l & m || (l & v && s(e, t, a, f), a || (a = e), "string" == typeof f && (f = a[f]), n ? f.apply(a, n) : f.call(a))
}
}
return !0
}
}
function l(e, t) {
var n = e[d],
r = n && n.listeners && n.listeners[t];
return !!r && !! r.length
}
function c(e, t) {
var n = [],
r = e[d],
i = r && r.listeners && r.listeners[t];
if (!i) return n;
for (var s = 0, o = i.length; o > s; s++) {
var u = i[s][0],
a = i[s][1];
n.push([u, a])
}
return n
}
var h = Ember.create,
p = Ember.meta,
d = Ember.META_KEY,
v = 1,
m = 2;
Ember.addListener = i, Ember.removeListener = s, Ember._suspendListener = o, Ember._suspendListeners = u, Ember.sendEvent = f, Ember.hasListeners = l, Ember.watchedEvents = a, Ember.listenersFor = c, Ember.listenersDiff = r, Ember.listenersUnion = n
}(),
function () {
var e = Ember.guidFor,
t = Ember.sendEvent,
n = Ember._ObserverSet = function () {
this.clear()
};
n.prototype.add = function (t, n, r) {
var i, s = this.observerSet,
o = this.observers,
u = e(t),
a = s[u];
return a || (s[u] = a = {}), i = a[n], void 0 === i && (i = o.push({
sender: t,
keyName: n,
eventName: r,
listeners: []
}) - 1, a[n] = i), o[i].listeners
}, n.prototype.flush = function () {
var e, n, r, i, s = this.observers;
for (this.clear(), e = 0, n = s.length; n > e; ++e) r = s[e], i = r.sender, i.isDestroying || i.isDestroyed || t(i, r.eventName, [i, r.keyName], r.listeners)
}, n.prototype.clear = function () {
this.observerSet = {}, this.observers = []
}
}(),
function () {
function e(e, t, i) {
if (!e.isDestroying) {
var s = r,
o = !s;
o && (s = r = {}), n(v, e, t, s, i), o && (r = null)
}
}
function t(e, t, r) {
if (!e.isDestroying) {
var s = i,
o = !s;
o && (s = i = {}), n(m, e, t, s, r), o && (i = null)
}
}
function n(e, t, n, r, i) {
var s = o(t);
if (r[s] || (r[s] = {}), !r[s][n]) {
r[s][n] = !0;
var u = i.deps;
if (u = u && u[n])
for (var a in u) {
var f = i.descs[a];
f && f._suspended === t || e(t, a)
}
}
}
var r, i, s = Ember.meta,
o = Ember.guidFor,
u = Ember.tryFinally,
a = Ember.sendEvent,
f = Ember.listenersUnion,
l = Ember.listenersDiff,
c = Ember._ObserverSet,
h = new c,
p = new c,
d = 0,
v = Ember.propertyWillChange = function (t, n) {
var r = s(t, !1),
i = r.watching[n] > 0 || "length" === n,
o = r.proto,
u = r.descs[n];
i && o !== t && (u && u.willChange && u.willChange(t, n), e(t, n, r), g(t, n, r), E(t, n))
}, m = Ember.propertyDidChange = function (e, n) {
var r = s(e, !1),
i = r.watching[n] > 0 || "length" === n,
o = r.proto,
u = r.descs[n];
o !== e && (u && u.didChange && u.didChange(e, n), (i || "length" === n) && (t(e, n, r), y(e, n, r), S(e, n)))
}, g = function (e, t, n, r) {
if (n.hasOwnProperty("chainWatchers")) {
var i = n.chainWatchers;
if (i = i[t])
for (var s = 0, o = i.length; o > s; s++) i[s].willChange(r)
}
}, y = function (e, t, n, r) {
if (n.hasOwnProperty("chainWatchers")) {
var i = n.chainWatchers;
if (i = i[t])
for (var s = i.length - 1; s >= 0; s--) i[s].didChange(r)
}
};
Ember.overrideChains = function (e, t, n) {
y(e, t, n, !0)
};
var b = Ember.beginPropertyChanges = function () {
d++
}, w = Ember.endPropertyChanges = function () {
d--, 0 >= d && (h.clear(), p.flush())
};
Ember.changeProperties = function (e, t) {
b(), u(e, w, t)
};
var E = function (e, t) {
if (!e.isDestroying) {
var n, r, i = t + ":before";
d ? (n = h.add(e, t, i), r = l(e, i, n), a(e, i, [e, t], r)) : a(e, i, [e, t])
}
}, S = function (e, t) {
if (!e.isDestroying) {
var n, r = t + ":change";
d ? (n = p.add(e, t, r), f(e, r, n)) : a(e, r, [e, t])
}
}
}(),
function () {
function e(e, t, n, s) {
var o;
if (o = t.slice(t.lastIndexOf(".") + 1), t = t.slice(0, t.length - (o.length + 1)), "this" !== t && (e = r(e, t)), !o || 0 === o.length) throw new Error("You passed an empty path");
if (!e) {
if (s) return;
throw new Error("Object in path " + t + " could not be found or was destroyed.")
}
return i(e, o, n)
}
var t = Ember.META_KEY,
n = Ember.ENV.MANDATORY_SETTER,
r = Ember._getPath,
i = function s(r, s, i, o) {
if ("string" == typeof r && (i = s, s = r, r = null), !r || -1 !== s.indexOf(".")) return e(r, s, i, o);
var u, a, f = r[t],
l = f && f.descs[s];
return l ? l.set(r, s, i) : (u = "object" == typeof r && !(s in r), u && "function" == typeof r.setUnknownProperty ? r.setUnknownProperty(s, i) : f && f.watching[s] > 0 ? (a = n ? f.values[s] : r[s], i !== a && (Ember.propertyWillChange(r, s), n ? void 0 !== a || s in r ? f.values[s] = i : Ember.defineProperty(r, s, null, i) : r[s] = i, Ember.propertyDidChange(r, s))) : r[s] = i), i
};
Ember.config.overrideAccessors && (Ember.set = i, Ember.config.overrideAccessors(), i = Ember.set), Ember.set = i, Ember.setPath = Ember.deprecateFunc("setPath is deprecated since set now supports paths", Ember.set), Ember.trySet = function (e, t, n) {
return i(e, t, n, !0)
}, Ember.trySetPath = Ember.deprecateFunc("trySetPath has been renamed to trySet", Ember.trySet)
}(),
function () {
var e = Ember.META_KEY,
t = Ember.meta,
n = Ember.platform.defineProperty,
r = Ember.ENV.MANDATORY_SETTER;
Ember.Descriptor = function () {};
var i = Ember.MANDATORY_SETTER_FUNCTION = function () {}, s = Ember.DEFAULT_GETTER_FUNCTION = function (t) {
return function () {
var n = this[e];
return n && n.values[t]
}
};
Ember.defineProperty = function (e, u, a, f, l) {
var c, h, p, d;
return l || (l = t(e)), c = l.descs, h = l.descs[u], p = l.watching[u] > 0, h instanceof Ember.Descriptor && h.teardown(e, u), a instanceof Ember.Descriptor ? (d = a, c[u] = a, r && p ? n(e, u, {
configurable: !0,
enumerable: !0,
writable: !0,
value: void 0
}) : e[u] = void 0, a.setup(e, u)) : (c[u] = void 0, null == a ? (d = f, r && p ? (l.values[u] = f, n(e, u, {
configurable: !0,
enumerable: !0,
set: i,
get: s(u)
})) : e[u] = f) : (d = a, n(e, u, a))), p && Ember.overrideChains(e, u, l), e.didDefineProperty && e.didDefineProperty(e, u, d), this
}
}(),
function () {
var e = Ember.changeProperties,
t = Ember.set;
Ember.setProperties = function (n, r) {
return e(function () {
for (var e in r) r.hasOwnProperty(e) && t(n, e, r[e])
}), n
}
}(),
function () {
var e = Ember.meta,
t = Ember.typeOf,
n = Ember.ENV.MANDATORY_SETTER,
r = Ember.platform.defineProperty;
Ember.watchKey = function (i, s) {
if ("length" !== s || "array" !== t(i)) {
var o, u = e(i),
a = u.watching;
a[s] ? a[s] = (a[s] || 0) + 1 : (a[s] = 1, o = u.descs[s], o && o.willWatch && o.willWatch(i, s), "function" == typeof i.willWatchProperty && i.willWatchProperty(s), n && s in i && (u.values[s] = i[s], r(i, s, {
configurable: !0,
enumerable: !0,
set: Ember.MANDATORY_SETTER_FUNCTION,
get: Ember.DEFAULT_GETTER_FUNCTION(s)
})))
}
}, Ember.unwatchKey = function (t, i) {
var s, o = e(t),
u = o.watching;
1 === u[i] ? (u[i] = 0, s = o.descs[i], s && s.didUnwatch && s.didUnwatch(t, i), "function" == typeof t.didUnwatchProperty && t.didUnwatchProperty(i), n && i in t && (r(t, i, {
configurable: !0,
enumerable: !0,
writable: !0,
value: o.values[i]
}), delete o.values[i])) : u[i] > 1 && u[i]--
}
}(),
function () {
function e(e) {
return e.match(h)[0]
}
function t(e, t, n) {
if (e && "object" == typeof e) {
var i = r(e),
s = i.chainWatchers;
i.hasOwnProperty("chainWatchers") || (s = i.chainWatchers = {}), s[t] || (s[t] = []), s[t].push(n), a(e, t)
}
}
function n(e) {
return r(e, !1).proto === e
}
var r = Ember.meta,
i = Ember.get,
s = Ember.normalizeTuple,
o = Ember.ArrayPolyfills.forEach,
u = Ember.warn,
a = Ember.watchKey,
f = Ember.unwatchKey,
l = Ember.propertyWillChange,
c = Ember.propertyDidChange,
h = /^([^\.\*]+)/,
p = [];
Ember.flushPendingChains = function () {
if (0 !== p.length) {
var e = p;
p = [], o.call(e, function (e) {
e[0].add(e[1])
}), u("Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos", 0 === p.length)
}
};
var d = Ember.removeChainWatcher = function (e, t, n) {
if (e && "object" == typeof e) {
var i = r(e, !1);
if (i.hasOwnProperty("chainWatchers")) {
var s = i.chainWatchers;
if (s[t]) {
s = s[t];
for (var o = 0, u = s.length; u > o; o++) s[o] === n && s.splice(o, 1)
}
f(e, t)
}
}
}, v = Ember._ChainNode = function (e, n, r) {
this._parent = e, this._key = n, this._watching = void 0 === r, this._value = r, this._paths = {}, this._watching && (this._object = e.value(), this._object && t(this._object, this._key, this)), this._parent && "@each" === this._parent._key && this.value()
}, m = v.prototype;
m.value = function () {
if (void 0 === this._value && this._watching) {
var e = this._parent.value();
this._value = e && !n(e) ? i(e, this._key) : void 0
}
return this._value
}, m.destroy = function () {
if (this._watching) {
var e = this._object;
e && d(e, this._key, this), this._watching = !1
}
}, m.copy = function (e) {
var t, n = new v(null, null, e),
r = this._paths;
for (t in r) 0 >= r[t] || n.add(t);
return n
}, m.add = function (t) {
var n, r, i, o, u;
if (u = this._paths, u[t] = (u[t] || 0) + 1, n = this.value(), r = s(n, t), r[0] && r[0] === n) t = r[1], i = e(t), t = t.slice(i.length + 1);
else {
if (!r[0]) return p.push([this, t]), r.length = 0, void 0;
o = r[0], i = t.slice(0, 0 - (r[1].length + 1)), t = r[1]
}
r.length = 0, this.chain(i, t, o)
}, m.remove = function (t) {
var n, r, i, o, u;
u = this._paths, u[t] > 0 && u[t]--, n = this.value(), r = s(n, t), r[0] === n ? (t = r[1], i = e(t), t = t.slice(i.length + 1)) : (o = r[0], i = t.slice(0, 0 - (r[1].length + 1)), t = r[1]), r.length = 0, this.unchain(i, t)
}, m.count = 0, m.chain = function (t, n, r) {
var i, s = this._chains;
s || (s = this._chains = {}), i = s[t], i || (i = s[t] = new v(this, t, r)), i.count++, n && n.length > 0 && (t = e(n), n = n.slice(t.length + 1), i.chain(t, n))
}, m.unchain = function (t, n) {
var r = this._chains,
i = r[t];
n && n.length > 1 && (t = e(n), n = n.slice(t.length + 1), i.unchain(t, n)), i.count--, 0 >= i.count && (delete r[i._key], i.destroy())
}, m.willChange = function () {
var e = this._chains;
if (e)
for (var t in e) e.hasOwnProperty(t) && e[t].willChange();
this._parent && this._parent.chainWillChange(this, this._key, 1)
}, m.chainWillChange = function (e, t, n) {
this._key && (t = this._key + "." + t), this._parent ? this._parent.chainWillChange(this, t, n + 1) : (n > 1 && l(this.value(), t), t = "this." + t, this._paths[t] > 0 && l(this.value(), t))
}, m.chainDidChange = function (e, t, n) {
this._key && (t = this._key + "." + t), this._parent ? this._parent.chainDidChange(this, t, n + 1) : (n > 1 && c(this.value(), t), t = "this." + t, this._paths[t] > 0 && c(this.value(), t))
}, m.didChange = function (e) {
if (this._watching) {
var n = this._parent.value();
n !== this._object && (d(this._object, this._key, this), this._object = n, t(n, this._key, this)), this._value = void 0, this._parent && "@each" === this._parent._key && this.value()
}
var r = this._chains;
if (r)
for (var i in r) r.hasOwnProperty(i) && r[i].didChange(e);
e || this._parent && this._parent.chainDidChange(this, this._key, 1)
}, Ember.finishChains = function (e) {
var t = r(e, !1),
n = t.chains;
n && (n.value() !== e && (t.chains = n = n.copy(e)), n.didChange(!0))
}
}(),
function () {
function e(e) {
var n = t(e),
i = n.chains;
return i ? i.value() !== e && (i = n.chains = i.copy(e)) : i = n.chains = new r(null, null, e), i
}
var t = Ember.meta,
n = Ember.typeOf,
r = Ember._ChainNode;
Ember.watchPath = function (r, i) {
if ("length" !== i || "array" !== n(r)) {
var s = t(r),
o = s.watching;
o[i] ? o[i] = (o[i] || 0) + 1 : (o[i] = 1, e(r).add(i))
}
}, Ember.unwatchPath = function (n, r) {
var i = t(n),
s = i.watching;
1 === s[r] ? (s[r] = 0, e(n).remove(r)) : s[r] > 1 && s[r]--
}
}(),
function () {
function e(e) {
return "*" === e || !c.test(e)
}
var t = Ember.meta,
n = Ember.GUID_KEY,
r = Ember.META_KEY,
i = Ember.removeChainWatcher,
s = Ember.watchKey,
o = Ember.unwatchKey,
u = Ember.watchPath,
a = Ember.unwatchPath,
f = Ember.typeOf,
l = Ember.generateGuid,
c = /[\.\*]/;
Ember.watch = function (t, n) {
("length" !== n || "array" !== f(t)) && (e(n) ? s(t, n) : u(t, n))
}, Ember.isWatching = function (e, t) {
var n = e[r];
return (n && n.watching[t]) > 0
}, Ember.watch.flushPending = Ember.flushPendingChains, Ember.unwatch = function (t, n) {
("length" !== n || "array" !== f(t)) && (e(n) ? o(t, n) : a(t, n))
}, Ember.rewatch = function (e) {
var r = t(e, !1),
i = r.chains;
n in e && !e.hasOwnProperty(n) && l(e, "ember"), i && i.value() !== e && (r.chains = i.copy(e))
};
var h = [];
Ember.destroy = function (e) {
var t, n, s, o, u = e[r];
if (u && (e[r] = null, t = u.chains))
for (h.push(t); h.length > 0;) {
if (t = h.pop(), n = t._chains)
for (s in n) n.hasOwnProperty(s) && h.push(n[s]);
t._watching && (o = t._object, o && i(o, t._key, t))
}
}
}(),
function () {
function e(e, t) {
var n = e[t];
return n ? e.hasOwnProperty(t) || (n = e[t] = h(n)) : n = e[t] = {}, n
}
function t(t) {
return e(t, "deps")
}
function n(n, r, i, s) {
var o, u, a, f, l, c = n._dependentKeys;
if (c)
for (o = t(s), u = 0, a = c.length; a > u; u++) f = c[u], l = e(o, f), l[i] = (l[i] || 0) + 1, d(r, f)
}
function r(n, r, i, s) {
var o, u, a, f, l, c = n._dependentKeys;
if (c)
for (o = t(s), u = 0, a = c.length; a > u; u++) f = c[u], l = e(o, f), l[i] = (l[i] || 0) - 1, v(r, f)
}
function i(e, t) {
this.func = e, this._cacheable = t && void 0 !== t.cacheable ? t.cacheable : !0, this._dependentKeys = t && t.dependentKeys, this._readOnly = t && (void 0 !== t.readOnly || !! t.readOnly)
}
function s(e, t) {
for (var n = {}, r = 0; t.length > r; r++) n[t[r]] = a(e, t[r]);
return n
}
function o(e, t) {
Ember.computed[e] = function (e) {
var n = c.call(arguments);
return Ember.computed(e, function () {
return t.apply(this, n)
})
}
}
function u(e, t) {
Ember.computed[e] = function () {
var e = c.call(arguments),
n = Ember.computed(function () {
return t.apply(this, [s(this, e)])
});
return n.property.apply(n, e)
}
}
var a = Ember.get,
f = Ember.set,
l = Ember.meta,
c = [].slice,
h = Ember.create,
p = Ember.META_KEY,
d = Ember.watch,
v = Ember.unwatch;
Ember.ComputedProperty = i, i.prototype = new Ember.Descriptor;
var m = i.prototype;
m.cacheable = function (e) {
return this._cacheable = e !== !1, this
}, m.volatile = function () {
return this.cacheable(!1)
}, m.readOnly = function (e) {
return this._readOnly = void 0 === e || !! e, this
}, m.property = function () {
for (var e = [], t = 0, n = arguments.length; n > t; t++) e.push(arguments[t]);
return this._dependentKeys = e, this
}, m.meta = function (e) {
return 0 === arguments.length ? this._meta || {} : (this._meta = e, this)
}, m.willWatch = function (e, t) {
var r = e[p];
t in r.cache || n(this, e, t, r)
}, m.didUnwatch = function (e, t) {
var n = e[p];
t in n.cache || r(this, e, t, n)
}, m.didChange = function (e, t) {
if (this._cacheable && this._suspended !== e) {
var n = l(e);
t in n.cache && (delete n.cache[t], n.watching[t] || r(this, e, t, n))
}
}, m.get = function (e, t) {
var r, i, s;
if (this._cacheable) {
if (s = l(e), i = s.cache, t in i) return i[t];
r = i[t] = this.func.call(e, t), s.watching[t] || n(this, e, t, s)
} else r = this.func.call(e, t);
return r
}, m.set = function (e, t, r) {
var i, s, o = this._cacheable,
u = this.func,
a = l(e, o),
f = a.watching[t],
c = this._suspended,
h = !1,
p = a.cache;
if (this._readOnly) throw new Error("Cannot Set: " + t + " on: " + e.toString());
this._suspended = e;
try {
if (o && p.hasOwnProperty(t) && (i = p[t], h = !0), u.wrappedFunction && (u = u.wrappedFunction), 3 === u.length) s = u.call(e, t, r, i);
else {
if (2 !== u.length) return Ember.defineProperty(e, t, null, i), Ember.set(e, t, r), void 0;
s = u.call(e, t, r)
} if (h && i === s) return;
f && Ember.propertyWillChange(e, t), h && delete p[t], o && (f || h || n(this, e, t, a), p[t] = s), f && Ember.propertyDidChange(e, t)
} finally {
this._suspended = c
}
return s
}, m.setup = function (e, t) {
var r = e[p];
r && r.watching[t] && n(this, e, t, l(e))
}, m.teardown = function (e, t) {
var n = l(e);
return (n.watching[t] || t in n.cache) && r(this, e, t, n), this._cacheable && delete n.cache[t], null
}, Ember.computed = function (e) {
var t;
if (arguments.length > 1 && (t = c.call(arguments, 0, -1), e = c.call(arguments, -1)[0]), "function" != typeof e) throw new Error("Computed Property declared without a property function");
var n = new i(e);
return t && n.property.apply(n, t), n
}, Ember.cacheFor = function (e, t) {
var n = l(e, !1).cache;
return n && t in n ? n[t] : void 0
}, o("empty", function (e) {
return Ember.isEmpty(a(this, e))
}), o("notEmpty", function (e) {
return !Ember.isEmpty(a(this, e))
}), o("none", function (e) {
return Ember.isNone(a(this, e))
}), o("not", function (e) {
return !a(this, e)
}), o("bool", function (e) {
return !!a(this, e)
}), o("match", function (e, t) {
var n = a(this, e);
return "string" == typeof n ? !! n.match(t) : !1
}), o("equal", function (e, t) {
return a(this, e) === t
}), o("gt", function (e, t) {
return a(this, e) > t
}), o("gte", function (e, t) {
return a(this, e) >= t
}), o("lt", function (e, t) {
return t > a(this, e)
}), o("lte", function (e, t) {
return t >= a(this, e)
}), u("and", function (e) {
for (var t in e)
if (e.hasOwnProperty(t) && !e[t]) return !1;
return !0
}), u("or", function (e) {
for (var t in e)
if (e.hasOwnProperty(t) && e[t]) return !0;
return !1
}), u("any", function (e) {
for (var t in e)
if (e.hasOwnProperty(t) && e[t]) return e[t];
return null
}), u("map", function (e) {
var t = [];
for (var n in e) e.hasOwnProperty(n) && (Ember.isNone(e[n]) ? t.push(null) : t.push(e[n]));
return t
}), Ember.computed.alias = function (e) {
return Ember.computed(e, function (t, n) {
return arguments.length > 1 ? (f(this, e, n), n) : a(this, e)
})
}, Ember.computed.defaultTo = function (e) {
return Ember.computed(function (t, n, r) {
return 1 === arguments.length ? null != r ? r : a(this, e) : null != n ? n : a(this, e)
})
}
}(),
function () {
function e(e) {
return e + n
}
function t(e) {
return e + r
}
var n = ":change",
r = ":before";
Ember.guidFor, Ember.addObserver = function (t, n, r, i) {
return Ember.addListener(t, e(n), r, i), Ember.watch(t, n), this
}, Ember.observersFor = function (t, n) {
return Ember.listenersFor(t, e(n))
}, Ember.removeObserver = function (t, n, r, i) {
return Ember.unwatch(t, n), Ember.removeListener(t, e(n), r, i), this
}, Ember.addBeforeObserver = function (e, n, r, i) {
return Ember.addListener(e, t(n), r, i), Ember.watch(e, n), this
}, Ember._suspendBeforeObserver = function (e, n, r, i, s) {
return Ember._suspendListener(e, t(n), r, i, s)
}, Ember._suspendObserver = function (t, n, r, i, s) {
return Ember._suspendListener(t, e(n), r, i, s)
};
var i = Ember.ArrayPolyfills.map;
Ember._suspendBeforeObservers = function (e, n, r, s, o) {
var u = i.call(n, t);
return Ember._suspendListeners(e, u, r, s, o)
}, Ember._suspendObservers = function (t, n, r, s, o) {
var u = i.call(n, e);
return Ember._suspendListeners(t, u, r, s, o)
}, Ember.beforeObserversFor = function (e, n) {
return Ember.listenersFor(e, t(n))
}, Ember.removeBeforeObserver = function (e, n, r, i) {
return Ember.unwatch(e, n), Ember.removeListener(e, t(n), r, i), this
}
}(),
function () {
function e(e, t, n, r) {
return void 0 === t && (t = e, e = void 0), "string" == typeof t && (t = e[t]), n && r > 0 && (n = n.length > r ? o.call(n, r) : null), Ember.handleErrors(function () {
return t.apply(e || this, n || [])
}, this)
}
function t() {
l = null, f.currentRunLoop && f.end()
}
function n(e, t) {
var n = e.expires,
r = t.expires;
return n > r ? 1 : r > n ? -1 : 0
}
function r() {
c = null, f(function () {
var t = +(new Date),
i = -1,
s = [];
for (var o in p)
if (p.hasOwnProperty(o)) {
var a = p[o];
a && a.expires && (t >= a.expires ? (delete p[o], s.push(a)) : (0 > i || i > a.expires) && (i = a.expires))
}
u.call(s.sort(n), function (t) {
e(t.target, t.method, t.args, 2)
}), i > 0 && (c = window.setTimeout(r, i - t), h = i)
})
}
function i(t, n) {
n[this.tguid] && delete n[this.tguid][this.mguid], p[t] && e(this.target, this.method, this.args), delete p[t]
}
function s(e, t, n, r) {
var s, o = Ember.guidFor(t),
u = Ember.guidFor(n),
a = f.autorun().onceTimers,
l = a[o] && a[o][u];
return l && p[l] ? p[l].args = r : (s = {
target: t,
method: n,
args: r,
tguid: o,
mguid: u
}, l = Ember.guidFor(s), p[l] = s, a[o] || (a[o] = {}), a[o][u] = l, f.schedule(e, s, i, l, a)), l
}
var o = [].slice,
u = Ember.ArrayPolyfills.forEach,
a = function (e) {
this._prev = e || null, this.onceTimers = {}
};
a.prototype = {
end: function () {
this.flush()
},
prev: function () {
return this._prev
},
schedule: function (e, t, n) {
var r, i = this._queues;
i || (i = this._queues = {}), r = i[e], r || (r = i[e] = []);
var s = arguments.length > 3 ? o.call(arguments, 3) : null;
return r.push({
target: t,
method: n,
args: s
}), this
},
flush: function (t) {
function n(t) {
e(t.target, t.method, t.args)
}
function r() {
u.call(a, n)
}
var i, s, o, a, f;
if (!this._queues) return this;
if (Ember.watch.flushPending(), t)
for (; this._queues && (a = this._queues[t]);) this._queues[t] = null, "sync" === t ? (f = Ember.LOG_BINDINGS, f && Ember.Logger.log("Begin: Flush Sync Queue"), Ember.beginPropertyChanges(), Ember.tryFinally(r, Ember.endPropertyChanges), f && Ember.Logger.log("End: Flush Sync Queue")) : u.call(a, n);
else {
i = Ember.run.queues, o = i.length, s = 0;
e: for (; o > s;) {
t = i[s], a = this._queues && this._queues[t], delete this._queues[t], a && ("sync" === t ? (f = Ember.LOG_BINDINGS, f && Ember.Logger.log("Begin: Flush Sync Queue"), Ember.beginPropertyChanges(), Ember.tryFinally(r, Ember.endPropertyChanges), f && Ember.Logger.log("End: Flush Sync Queue")) : u.call(a, n));
for (var l = 0; s >= l; l++)
if (this._queues && this._queues[i[l]]) {
s = l;
continue e
}
s++
}
}
return this
}
}, Ember.RunLoop = a, Ember.run = function (t, n) {
function r() {
return t || n ? e(t, n, i, 2) : void 0
}
var i = arguments;
return f.begin(), Ember.tryFinally(r, f.end)
};
var f = Ember.run;
Ember.run.begin = function () {
f.currentRunLoop = new a(f.currentRunLoop)
}, Ember.run.end = function () {
function e() {
f.currentRunLoop.end()
}
function t() {
f.currentRunLoop = f.currentRunLoop.prev()
}
Ember.tryFinally(e, t)
}, Ember.run.queues = ["sync", "actions", "destroy"], Ember.run.schedule = function () {
var e = f.autorun();
e.schedule.apply(e, arguments)
};
var l;
Ember.run.hasScheduledTimers = function () {
return !!l || !! c
}, Ember.run.cancelTimers = function () {
l && (clearTimeout(l), l = null), c && (clearTimeout(c), c = null), p = {}
}, Ember.run.autorun = function () {
return f.currentRunLoop || (f.begin(), l || (l = setTimeout(t, 1))), f.currentRunLoop
}, Ember.run.sync = function () {
f.autorun(), f.currentRunLoop.flush("sync")
};
var c, h, p = {};
Ember.run.later = function (e, t) {
var n, i, s, u, a;
return 2 === arguments.length && "function" == typeof e ? (a = t, t = e, e = void 0, n = [e, t]) : (n = o.call(arguments), a = n.pop()), i = +(new Date) + a, s = {
target: e,
method: t,
expires: i,
args: n
}, u = Ember.guidFor(s), p[u] = s, c && h > i && (clearTimeout(c), c = null), c || (c = setTimeout(r, a), h = i), u
}, Ember.run.once = function (e, t) {
return s("actions", e, t, o.call(arguments, 2))
}, Ember.run.scheduleOnce = function (e, t, n) {
return s(e, t, n, o.call(arguments, 3))
}, Ember.run.next = function () {
var e = o.call(arguments);
return e.push(1), f.later.apply(this, e)
}, Ember.run.cancel = function (e) {
delete p[e]
}
}(),
function () {
function e(e, t) {
return n(s(t) ? Ember.lookup : e, t)
}
function t(e, t) {
for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n])
}
Ember.LOG_BINDINGS = !! Ember.ENV.LOG_BINDINGS;
var n = Ember.get,
r = (Ember.set, Ember.guidFor),
i = /^([A-Z$]|([0-9][A-Z$]))/,
s = Ember.isGlobalPath = function (e) {
return i.test(e)
}, o = function (e, t) {
this._direction = "fwd", this._from = t, this._to = e, this._directionMap = Ember.Map.create()
};
o.prototype = {
copy: function () {
var e = new o(this._to, this._from);
return this._oneWay && (e._oneWay = !0), e
},
from: function (e) {
return this._from = e, this
},
to: function (e) {
return this._to = e, this
},
oneWay: function () {
return this._oneWay = !0, this
},
toString: function () {
var e = this._oneWay ? "[oneWay]" : "";
return "Ember.Binding<" + r(this) + ">(" + this._from + " -> " + this._to + ")" + e
},
connect: function (t) {
var n = this._from,
r = this._to;
return Ember.trySet(t, r, e(t, n)), Ember.addObserver(t, n, this, this.fromDidChange), this._oneWay || Ember.addObserver(t, r, this, this.toDidChange), this._readyToSync = !0, this
},
disconnect: function (e) {
var t = !this._oneWay;
return Ember.removeObserver(e, this._from, this, this.fromDidChange), t && Ember.removeObserver(e, this._to, this, this.toDidChange), this._readyToSync = !1, this
},
fromDidChange: function (e) {
this._scheduleSync(e, "fwd")
},
toDidChange: function (e) {
this._scheduleSync(e, "back")
},
_scheduleSync: function (e, t) {
var n = this._directionMap,
r = n.get(e);
r || (Ember.run.schedule("sync", this, this._sync, e), n.set(e, t)), "back" === r && "fwd" === t && n.set(e, "fwd")
},
_sync: function (t) {
var r = Ember.LOG_BINDINGS;
if (!t.isDestroyed && this._readyToSync) {
var i = this._directionMap,
s = i.get(t),
o = this._from,
u = this._to;
if (i.remove(t), "fwd" === s) {
var a = e(t, this._from);
r && Ember.Logger.log(" ", this.toString(), "->", a, t), this._oneWay ? Ember.trySet(t, u, a) : Ember._suspendObserver(t, u, this, this.toDidChange, function () {
Ember.trySet(t, u, a)
})
} else if ("back" === s) {
var f = n(t, this._to);
r && Ember.Logger.log(" ", this.toString(), "<-", f, t), Ember._suspendObserver(t, o, this, this.fromDidChange, function () {
Ember.trySet(Ember.isGlobalPath(o) ? Ember.lookup : t, o, f)
})
}
}
}
}, t(o, {
from: function () {
var e = this,
t = new e;
return t.from.apply(t, arguments)
},
to: function () {
var e = this,
t = new e;
return t.to.apply(t, arguments)
},
oneWay: function (e, t) {
var n = this,
r = new n(null, e);
return r.oneWay(t)
}
}), Ember.Binding = o, Ember.bind = function (e, t, n) {
return (new Ember.Binding(t, n)).connect(e)
}, Ember.oneWay = function (e, t, n) {
return (new Ember.Binding(t, n)).oneWay().connect(e)
}
}(),
function () {
function e(e) {
var t = Ember.meta(e, !0),
n = t.mixins;
return n ? t.hasOwnProperty("mixins") || (n = t.mixins = C(n)) : n = t.mixins = {}, n
}
function t(e, t) {
return t && t.length > 0 && (e.mixins = S.call(t, function (e) {
if (e instanceof b) return e;
var t = new b;
return t.properties = e, t
})), e
}
function n(e) {
return "function" == typeof e && e.isMethod !== !1 && e !== Boolean && e !== Object && e !== Number && e !== Array && e !== Date && e !== String
}
function r(e, t) {
var n;
return t instanceof b ? (n = L(t), e[n] ? A : (e[n] = t, t.properties)) : t
}
function i(e, t, n) {
var r;
return r = t.concatenatedProperties || n.concatenatedProperties, e.concatenatedProperties && (r = r ? r.concat(e.concatenatedProperties) : e.concatenatedProperties), r
}
function s(e, t, n, r, i) {
var s;
return void 0 === r[t] && (s = i[t]), s = s || e.descs[t], s && s instanceof Ember.ComputedProperty ? (n = C(n), n.func = Ember.wrap(n.func, s.func), n) : n
}
function o(e, t, n, r, i) {
var s;
return void 0 === i[t] && (s = r[t]), s = s || e[t], "function" != typeof s ? n : Ember.wrap(n, s)
}
function u(e, t, n, r) {
var i = r[t] || e[t];
return i ? "function" == typeof i.concat ? i.concat(n) : Ember.makeArray(i).concat(n) : Ember.makeArray(n)
}
function a(e, t, r, i, a, f, l) {
if (r instanceof Ember.Descriptor) {
if (r === w && a[t]) return A;
r.func && (r = s(i, t, r, f, a)), a[t] = r, f[t] = void 0
} else n(r) ? r = o(e, t, r, f, a) : (l && x.call(l, t) >= 0 || "concatenatedProperties" === t) && (r = u(e, t, r, f)), a[t] = void 0, f[t] = r
}
function f(e, t, n, s, o, u) {
function l(e) {
delete n[e], delete s[e]
}
for (var c, h, p, d, v, m = 0, g = e.length; g > m; m++)
if (c = e[m], h = r(t, c), h !== A)
if (h) {
v = Ember.meta(o), d = i(h, s, o);
for (p in h) h.hasOwnProperty(p) && (u.push(p), a(o, p, h[p], v, n, s, d));
h.hasOwnProperty("toString") && (o.toString = h.toString)
} else c.mixins && (f(c.mixins, t, n, s, o, u), c._without && T.call(c._without, l))
}
function l(e, t, n, r) {
if (O.test(t)) {
var i = r.bindings;
i ? r.hasOwnProperty("bindings") || (i = r.bindings = C(r.bindings)) : i = r.bindings = {}, i[t] = n
}
}
function c(e, t) {
var n, r, i, s = t.bindings;
if (s) {
for (n in s) r = s[n], r && (i = n.slice(0, -7), r instanceof Ember.Binding ? (r = r.copy(), r.to(i)) : r = new Ember.Binding(i, r), r.connect(e), e[n] = r);
t.bindings = {}
}
}
function h(e, t) {
return c(e, t || Ember.meta(e)), e
}
function p(e, t, n, r, i) {
var s, o = t.methodName;
return r[o] || i[o] ? (s = i[o], t = r[o]) : n.descs[o] ? (t = n.descs[o], s = void 0) : (t = void 0, s = e[o]), {
desc: t,
value: s
}
}
function d(e, t, n, r, i) {
if ("function" == typeof n) {
var s = n[r];
if (s)
for (var o = 0, u = s.length; u > o; o++) Ember[i](e, s[o], null, t)
}
}
function v(e, t, n) {
var r = e[t];
d(e, t, r, "__ember_observesBefore__", "removeBeforeObserver"), d(e, t, r, "__ember_observes__", "removeObserver"), d(e, t, n, "__ember_observesBefore__", "addBeforeObserver"), d(e, t, n, "__ember_observes__", "addObserver")
}
function m(t, n, r) {
var i, s, o, u = {}, a = {}, c = Ember.meta(t),
d = [];
f(n, e(t), u, a, t, d);
for (var m = 0, g = d.length; g > m; m++)
if (i = d[m], "constructor" !== i && a.hasOwnProperty(i) && (o = u[i], s = a[i], o !== w)) {
for (; o && o instanceof E;) {
var y = p(t, o, c, u, a);
o = y.desc, s = y.value
}(void 0 !== o || void 0 !== s) && (v(t, i, s), l(t, i, s, c), k(t, i, o, s, c))
}
return r || h(t, c), t
}
function g(e, t, n) {
var r = L(e);
if (n[r]) return !1;
if (n[r] = !0, e === t) return !0;
for (var i = e.mixins, s = i ? i.length : 0; --s >= 0;)
if (g(i[s], t, n)) return !0;
return !1
}
function y(e, t, n) {
if (!n[L(t)])
if (n[L(t)] = !0, t.properties) {
var r = t.properties;
for (var i in r) r.hasOwnProperty(i) && (e[i] = !0)
} else t.mixins && T.call(t.mixins, function (t) {
y(e, t, n)
})
}
var b, w, E, S = Ember.ArrayPolyfills.map,
x = Ember.ArrayPolyfills.indexOf,
T = Ember.ArrayPolyfills.forEach,
N = [].slice,
C = Ember.create,
k = Ember.defineProperty,
L = Ember.guidFor,
A = {}, O = Ember.IS_BINDING = /^.+Binding$/;
Ember.mixin = function (e) {
var t = N.call(arguments, 1);
return m(e, t, !1), e
}, Ember.Mixin = function () {
return t(this, arguments)
}, b = Ember.Mixin, b.prototype = {
properties: null,
mixins: null,
ownerConstructor: null
}, b._apply = m, b.applyPartial = function (e) {
var t = N.call(arguments, 1);
return m(e, t, !0)
}, b.finishPartial = h, Ember.anyUnprocessedMixins = !1, b.create = function () {
Ember.anyUnprocessedMixins = !0;
var e = this;
return t(new e, arguments)
};
var M = b.prototype;
M.reopen = function () {
var e, t;
this.properties ? (e = b.create(), e.properties = this.properties, delete this.properties, this.mixins = [e]) : this.mixins || (this.mixins = []);
var n, r = arguments.length,
i = this.mixins;
for (n = 0; r > n; n++) e = arguments[n], e instanceof b ? i.push(e) : (t = b.create(), t.properties = e, i.push(t));
return this
}, M.apply = function (e) {
return m(e, [this], !1)
}, M.applyPartial = function (e) {
return m(e, [this], !0)
}, M.detect = function (e) {
if (!e) return !1;
if (e instanceof b) return g(e, this, {});
var t = Ember.meta(e, !1).mixins;
return t ? !! t[L(this)] : !1
}, M.without = function () {
var e = new b(this);
return e._without = N.call(arguments), e
}, M.keys = function () {
var e = {}, t = {}, n = [];
y(e, this, t);
for (var r in e) e.hasOwnProperty(r) && n.push(r);
return n
}, b.mixins = function (e) {
var t = Ember.meta(e, !1).mixins,
n = [];
if (!t) return n;
for (var r in t) {
var i = t[r];
i.properties || n.push(i)
}
return n
}, w = new Ember.Descriptor, w.toString = function () {
return "(Required Property)"
}, Ember.required = function () {
return w
}, E = function (e) {
this.methodName = e
}, E.prototype = new Ember.Descriptor, Ember.alias = function (e) {
return new E(e)
}, Ember.alias = Ember.deprecateFunc("Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead.", Ember.alias), Ember.aliasMethod = function (e) {
return new E(e)
}, Ember.observer = function (e) {
var t = N.call(arguments, 1);
return e.__ember_observes__ = t, e
}, Ember.immediateObserver = function () {
for (var e = 0, t = arguments.length; t > e; e++) arguments[e];
return Ember.observer.apply(this, arguments)
}, Ember.beforeObserver = function (e) {
var t = N.call(arguments, 1);
return e.__ember_observesBefore__ = t, e
}
}(),
function () {
e("rsvp/all", ["rsvp/defer", "exports"], function (e, t) {
"use strict";
function n(e) {
var t = [],
n = r(),
i = e.length;
0 === i && n.resolve([]);
for (var s = function (e) {
return function (t) {
o(e, t)
}
}, o = function (e, r) {
t[e] = r, 0 === --i && n.resolve(t)
}, u = function (e) {
n.reject(e)
}, a = 0; e.length > a; a++) e[a] && "function" == typeof e[a].then ? e[a].then(s(a), u) : o(a, e[a]);
return n.promise
}
var r = e.defer;
t.all = n
}), e("rsvp/async", ["exports"], function (e) {
"use strict";
var t, n = "undefined" != typeof window ? window : {}, r = n.MutationObserver || n
.WebKitMutationObserver;
if ("undefined" != typeof process && "[object process]" === {}.toString.call(process)) t = function (e, t) {
process.nextTick(function () {
e.call(t)
})
};
else if (r) {
var i = [],
s = new r(function () {
var e = i.slice();
i = [], e.forEach(function (e) {
var t = e[0],
n = e[1];
t.call(n)
})
}),
o = document.createElement("div");
s.observe(o, {
attributes: !0
}), window.addEventListener("unload", function () {
s.disconnect(), s = null
}), t = function (e, t) {
i.push([e, t]), o.setAttribute("drainQueue", "drainQueue")
}
} else t = function (e, t) {
setTimeout(function () {
e.call(t)
}, 1)
};
e.async = t
}), e("rsvp/config", ["rsvp/async", "exports"], function (e, t) {
"use strict";
var n = e.async,
r = {};
r.async = n, t.config = r
}), e("rsvp/defer", ["rsvp/promise", "exports"], function (e, t) {
"use strict";
function n() {
var e = {}, t = new r(function (t, n) {
e.resolve = t, e.reject = n
});
return e.promise = t, e
}
var r = e.Promise;
t.defer = n
}), e("rsvp/events", ["exports"], function (e) {
"use strict";
var t = function (e, t) {
this.type = e;
for (var n in t) t.hasOwnProperty(n) && (this[n] = t[n])
}, n = function (e, t) {
for (var n = 0, r = e.length; r > n; n++)
if (e[n][0] === t) return n;
return -1
}, r = function (e) {
var t = e._promiseCallbacks;
return t || (t = e._promiseCallbacks = {}), t
}, i = {
mixin: function (e) {
return e.on = this.on, e.off = this.off, e.trigger = this.trigger, e
},
on: function (e, t, i) {
var s, o, u = r(this);
for (e = e.split(/\s+/), i = i || this; o = e.shift();) s = u[o], s || (s = u[o] = []), -1 === n(s, t) && s.push([t, i])
},
off: function (e, t) {
var i, s, o, u = r(this);
for (e = e.split(/\s+/); s = e.shift();) t ? (i = u[s], o = n(i, t), -1 !== o && i.splice(o, 1)) : u[s] = []
},
trigger: function (e, n) {
var i, s, o, u, a, f = r(this);
if (i = f[e])
for (var l = 0; i.length > l; l++) s = i[l], o = s[0], u = s[1], "object" != typeof n && (n = {
detail: n
}), a = new t(e, n), o.call(u, a)
}
};
e.EventTarget = i
}), e("rsvp/hash", ["rsvp/defer", "exports"], function (e, t) {
"use strict";
function n(e) {
var t = 0;
for (var n in e) t++;
return t
}
function r(e) {
var t = {}, r = i(),
s = n(e);
0 === s && r.resolve({});
var o = function (e) {
return function (t) {
u(e, t)
}
}, u = function (e, n) {
t[e] = n, 0 === --s && r.resolve(t)
}, a = function (e) {
r.reject(e)
};
for (var f in e) e[f] && "function" == typeof e[f].then ? e[f].then(o(f), a) : u(f, e[f]);
return r.promise
}
var i = e.defer;
t.hash = r
}), e("rsvp/node", ["rsvp/promise", "rsvp/all", "exports"], function (e, t, n) {
"use strict";
function r(e, t) {
return function (n, r) {
n ? t(n) : arguments.length > 2 ? e(Array.prototype.slice.call(arguments, 1)) : e(r)
}
}
function i(e) {
return function () {
var t, n, i = Array.prototype.slice.call(arguments),
u = new s(function (e, r) {
t = e, n = r
});
return o(i).then(function (i) {
i.push(r(t, n));
try {
e.apply(this, i)
} catch (s) {
n(s)
}
}), u
}
}
var s = e.Promise,
o = t.all;
n.denodeify = i
}), e("rsvp/promise", ["rsvp/config", "rsvp/events", "exports"], function (e, t, n) {
"use strict";
function r(e) {
return i(e) || "object" == typeof e && null !== e
}
function i(e) {
return "function" == typeof e
}
function s(e, t) {
e === t ? u(e, t) : o(e, t) || u(e, t)
}
function o(e, t) {
var n = null;
if (r(t)) {
try {
n = t.then
} catch (o) {
return a(e, o), !0
}
if (i(n)) {
try {
n.call(t, function (n) {
t !== n ? s(e, n) : u(e, n)
}, function (t) {
a(e, t)
})
} catch (o) {
a(e, o)
}
return !0
}
}
return !1
}
function u(e, t) {
f.async(function () {
e.trigger("promise:resolved", {
detail: t
}), e.isFulfilled = !0, e.fulfillmentValue = t
})
}
function a(e, t) {
f.async(function () {
e.trigger("promise:failed", {
detail: t
}), e.isRejected = !0, e.rejectedReason = t
})
}
var f = e.config,
l = t.EventTarget,
c = function (e) {
var t = this,
n = !1;
if ("function" != typeof e) throw new TypeError("You must pass a resolver function as the sole argument to the promise constructor");
if (!(t instanceof c)) return new c(e);
var r = function (e) {
n || (n = !0, s(t, e))
}, i = function (e) {
n || (n = !0, a(t, e))
};
this.on("promise:resolved", function (e) {
this.trigger("success", {
detail: e.detail
})
}, this), this.on("promise:failed", function (e) {
this.trigger("error", {
detail: e.detail
})
}, this);
try {
e(r, i)
} catch (o) {
i(o)
}
}, h = function (e, t, n, r) {
var u, f, l, c, h = i(n);
if (h) try {
u = n(r.detail), l = !0
} catch (p) {
c = !0, f = p
} else u = r.detail, l = !0;
o(t, u) || (h && l ? s(t, u) : c ? a(t, f) : "resolve" === e ? s(t, u) : "reject" === e && a(t, u))
};
c.prototype = {
constructor: c,
then: function (e, t) {
var n = new c(function () {});
return this.isFulfilled && f.async(function () {
h("resolve", n, e, {
detail: this.fulfillmentValue
})
}, this), this.isRejected && f.async(function () {
h("reject", n, t, {
detail: this.rejectedReason
})
}, this), this.on("promise:resolved", function (t) {
h("resolve", n, e, t)
}), this.on("promise:failed", function (e) {
h("reject", n, t, e)
}), n
}
}, l.mixin(c.prototype), n.Promise = c
}), e("rsvp/reject", ["rsvp/promise", "exports"], function (e, t) {
"use strict";
function n(e) {
return new r(function (t, n) {
n(e)
})
}
var r = e.Promise;
t.reject = n
}), e("rsvp/resolve", ["rsvp/promise", "exports"], function (e, t) {
"use strict";
function n(e) {
return "function" == typeof e || "object" == typeof e && null !== e
}
function r(e) {
var t = new i(function (t, r) {
var i;
try {
n(e) ? (i = e.then, "function" == typeof i ? i.call(e, t, r) : t(e)) : t(e)
} catch (s) {
r(s)
}
});
return t
}
var i = e.Promise;
t.resolve = r
}), e("rsvp", ["rsvp/events", "rsvp/promise", "rsvp/node", "rsvp/all", "rsvp/hash", "rsvp/defer", "rsvp/config", "rsvp/resolve", "rsvp/reject", "exports"], function (e, t, n, r, i, s, o, u, a, f) {
"use strict";
function l(e, t) {
g[e] = t
}
var c = e.EventTarget,
h = t.Promise,
p = n.denodeify,
d = r.all,
v = i.hash,
m = s.defer,
g = o.config,
y = u.resolve,
b = a.reject;
f.Promise = h, f.EventTarget = c, f.all = d, f.hash = v, f.defer = m, f.denodeify = p, f.configure = l, f.resolve = y, f.reject = b
})
}(),
function () {
e("container", [], function () {
function e(e) {
this.parent = e, this.dict = {}
}
function t(t) {
this.parent = t, this.children = [], this.resolver = t && t.resolver || function () {}, this.registry = new e(t && t.registry), this.cache = new e(t && t.cache), this.typeInjections = new e(t && t.typeInjections), this.injections = {}, this._options = new e(t && t._options), this._typeOptions = new e(t && t._typeOptions)
}
function n(e) {
throw new Error(e + " is not currently supported on child containers")
}
function r(e, t) {
var n = s(e, t, "singleton");
return n !== !1
}
function i(e, t) {
var n = {};
if (!t) return n;
for (var r, i, s = 0, o = t.length; o > s; s++) r = t[s], i = e.lookup(r.fullName), n[r.property] = i;
return n
}
function s(e, t, n) {
var r = e._options.get(t);
if (r && void 0 !== r[n]) return r[n];
var i = t.split(":")[0];
return r = e._typeOptions.get(i), r ? r[n] : void 0
}
function o(e, t) {
var n = e.normalize(t);
return e.resolve(n)
}
function u(e, t) {
var n, r = o(e, t),
u = t.split(":"),
a = u[0];
if (s(e, t, "instantiate") === !1) return r;
if (r) {
var f = [];
f = f.concat(e.typeInjections.get(a) || []), f = f.concat(e.injections[t] || []);
var l = i(e, f);
return l.container = e, l._debugContainerKey = t, n = r.create(l)
}
}
function a(e, t) {
e.cache.eachLocal(function (n, r) {
s(e, n, "instantiate") !== !1 && t(r)
})
}
function f(e) {
e.cache.eachLocal(function (t, n) {
s(e, t, "instantiate") !== !1 && n.destroy()
}), e.cache.dict = {}
}
return e.prototype = {
get: function (e) {
var t = this.dict;
return t.hasOwnProperty(e) ? t[e] : this.parent ? this.parent.get(e) : void 0
},
set: function (e, t) {
this.dict[e] = t
},
has: function (e) {
var t = this.dict;
return t.hasOwnProperty(e) ? !0 : this.parent ? this.parent.has(e) : !1
},
eachLocal: function (e, t) {
var n = this.dict;
for (var r in n) n.hasOwnProperty(r) && e.call(t, r, n[r])
}
}, t.prototype = {
child: function () {
var e = new t(this);
return this.children.push(e), e
},
set: function (e, t, n) {
e[t] = n
},
register: function (e, t, n, r) {
var i; - 1 !== e.indexOf(":") ? (r = n, n = t, i = e) : i = e + ":" + t;
var s = this.normalize(i);
this.registry.set(s, n), this._options.set(s, r || {})
},
resolve: function (e) {
return this.resolver(e) || this.registry.get(e)
},
normalize: function (e) {
return e
},
lookup: function (e, t) {
if (e = this.normalize(e), t = t || {}, this.cache.has(e) && t.singleton !== !1) return this.cache.get(e);
var n = u(this, e);
return n ? (r(this, e) && t.singleton !== !1 && this.cache.set(e, n), n) : void 0
},
has: function (e) {
return this.cache.has(e) ? !0 : !! o(this, e)
},
optionsForType: function (e, t) {
this.parent && n("optionsForType"), this._typeOptions.set(e, t)
},
options: function (e, t) {
this.optionsForType(e, t)
},
typeInjection: function (e, t, r) {
this.parent && n("typeInjection");
var i = this.typeInjections.get(e);
i || (i = [], this.typeInjections.set(e, i)), i.push({
property: t,
fullName: r
})
},
injection: function (e, t, r) {
if (this.parent && n("injection"), -1 === e.indexOf(":")) return this.typeInjection(e, t, r);
var i = this.injections[e] = this.injections[e] || [];
i.push({
property: t,
fullName: r
})
},
destroy: function () {
this.isDestroyed = !0;
for (var e = 0, t = this.children.length; t > e; e++) this.children[e].destroy();
this.children = [], a(this, function (e) {
e.isDestroying = !0
}), a(this, function (e) {
e.destroy()
}), delete this.parent, this.isDestroyed = !0
},
reset: function () {
for (var e = 0, t = this.children.length; t > e; e++) f(this.children[e]);
f(this)
}
}, t
})
}(),
function () {
function e(n, r, i, s) {
var o, u, a;
if ("object" != typeof n || null === n) return n;
if (r && (u = t(i, n)) >= 0) return s[u];
if ("array" === Ember.typeOf(n)) {
if (o = n.slice(), r)
for (u = o.length; --u >= 0;) o[u] = e(o[u], r, i, s)
} else if (Ember.Copyable && Ember.Copyable.detect(n)) o = n.copy(r, i, s);
else {
o = {};
for (a in n) n.hasOwnProperty(a) && "__" !== a.substring(0, 2) && (o[a] = r ? e(n[a], r, i, s) : n[a])
}
return r && (i.push(n), s.push(o)), o
}
var t = Ember.EnumerableUtils.indexOf;
Ember.compare = function r(e, t) {
if (e === t) return 0;
var n = Ember.typeOf(e),
i = Ember.typeOf(t),
s = Ember.Comparable;
if (s) {
if ("instance" === n && s.detect(e.constructor)) return e.constructor.compare(e, t);
if ("instance" === i && s.detect(t.constructor)) return 1 - t.constructor.compare(t, e)
}
var o = Ember.ORDER_DEFINITION_MAPPING;
if (!o) {
var u = Ember.ORDER_DEFINITION;
o = Ember.ORDER_DEFINITION_MAPPING = {};
var a, f;
for (a = 0, f = u.length; f > a; ++a) o[u[a]] = a;
delete Ember.ORDER_DEFINITION
}
var l = o[n],
c = o[i];
if (c > l) return -1;
if (l > c) return 1;
switch (n) {
case "boolean":
case "number":
return t > e ? -1 : e > t ? 1 : 0;
case "string":
var h = e.localeCompare(t);
return 0 > h ? -1 : h > 0 ? 1 : 0;
case "array":
for (var p = e.length, d = t.length, v = Math.min(p, d), m = 0, g = 0; 0 === m && v > g;) m = r(e[g], t[g]), g++;
return 0 !== m ? m : d > p ? -1 : p > d ? 1 : 0;
case "instance":
return Ember.Comparable && Ember.Comparable.detect(e) ? e.compare(e, t) : 0;
case "date":
var y = e.getTime(),
b = t.getTime();
return b > y ? -1 : y > b ? 1 : 0;
default:
return 0
}
}, Ember.copy = function (t, n) {
return "object" != typeof t || null === t ? t : Ember.Copyable && Ember.Copyable.detect(t) ? t.copy(n) : e(t, n, n ? [] : null, n ? [] : null)
}, Ember.inspect = function (e) {
if ("object" != typeof e || null === e) return e + "";
var t, n = [];
for (var r in e)
if (e.hasOwnProperty(r)) {
if (t = e[r], "toString" === t) continue;
"function" === Ember.typeOf(t) && (t = "function() { ... }"), n.push(r + ": " + t)
}
return "{" + n.join(", ") + "}"
}, Ember.isEqual = function (e, t) {
return e && "function" == typeof e.isEqual ? e.isEqual(t) : e === t
}, Ember.ORDER_DEFINITION = Ember.ENV.ORDER_DEFINITION || ["undefined", "null", "boolean", "number", "string", "array", "object", "instance", "function", "class", "date"], Ember.keys = Object.keys, Ember.keys || (Ember.keys = function (e) {
var t = [];
for (var n in e) e.hasOwnProperty(n) && t.push(n);
return t
});
var n = ["description", "fileName", "lineNumber", "message", "name", "number", "stack"];
Ember.Error = function () {
for (var e = Error.prototype.constructor.apply(this, arguments), t = 0; n.length > t; t++) this[n[t]] = e[n[t]]
}, Ember.Error.prototype = Ember.create(Error.prototype)
}(),
function () {
Ember.RSVP = t("rsvp")
}(),
function () {
var e = /[ _]/g,
t = {}, n = /([a-z])([A-Z])/g,
r = /(\-|_|\.|\s)+(.)?/g,
i = /([a-z\d])([A-Z]+)/g,
s = /\-|\s+/g;
Ember.STRINGS = {}, Ember.String = {
fmt: function (e, t) {
var n = 0;
return e.replace(/%@([0-9]+)?/g, function (e, r) {
return r = r ? parseInt(r, 0) - 1 : n++, e = t[r], (null === e ? "(null)" : void 0 === e ? "" : e).toString()
})
},
loc: function (e, t) {
return e = Ember.STRINGS[e] || e, Ember.String.fmt(e, t)
},
w: function (e) {
return e.split(/\s+/)
},
decamelize: function (e) {
return e.replace(n, "$1_$2").toLowerCase()
},
dasherize: function (n) {
var r, i = t,
s = i.hasOwnProperty(n);
return s ? i[n] : (r = Ember.String.decamelize(n).replace(e, "-"), i[n] = r, r)
},
camelize: function (e) {
return e.replace(r, function (e, t, n) {
return n ? n.toUpperCase() : ""
}).replace(/^([A-Z])/, function (e) {
return e.toLowerCase()
})
},
classify: function (e) {
for (var t = e.split("."), n = [], r = 0, i = t.length; i > r; r++) {
var s = Ember.String.camelize(t[r]);
n.push(s.charAt(0).toUpperCase() + s.substr(1))
}
return n.join(".")
},
underscore: function (e) {
return e.replace(i, "$1_$2").replace(s, "_").toLowerCase()
},
capitalize: function (e) {
return e.charAt(0).toUpperCase() + e.substr(1)
}
}
}(),
function () {
var e = Ember.String.fmt,
t = Ember.String.w,
n = Ember.String.loc,
r = Ember.String.camelize,
i = Ember.String.decamelize,
s = Ember.String.dasherize,
o = Ember.String.underscore,
u = Ember.String.capitalize,
a = Ember.String.classify;
(Ember.EXTEND_PROTOTYPES === !0 || Ember.EXTEND_PROTOTYPES.String) && (String.prototype.fmt = function () {
return e(this, arguments)
}, String.prototype.w = function () {
return t(this)
}, String.prototype.loc = function () {
return n(this, arguments)
}, String.prototype.camelize = function () {
return r(this)
}, String.prototype.decamelize = function () {
return i(this)
}, String.prototype.dasherize = function () {
return s(this)
}, String.prototype.underscore = function () {
return o(this)
}, String.prototype.classify = function () {
return a(this)
}, String.prototype.capitalize = function () {
return u(this)
})
}(),
function () {
var e = Array.prototype.slice;
(Ember.EXTEND_PROTOTYPES === !0 || Ember.EXTEND_PROTOTYPES.Function) && (Function.prototype.property = function () {
var e = Ember.computed(this);
return e.property.apply(e, arguments)
}, Function.prototype.observes = function () {
return this.__ember_observes__ = e.call(arguments), this
}, Function.prototype.observesBefore = function () {
return this.__ember_observesBefore__ = e.call(arguments), this
})
}(),
function () {
function e() {
return 0 === u.length ? {} : u.pop()
}
function t(e) {
return u.push(e), null
}
function n(e, t) {
function n(n) {
var s = r(n, e);
return i ? t === s : !! s
}
var i = 2 === arguments.length;
return n
}
var r = Ember.get,
i = Ember.set,
s = Array.prototype.slice,
o = Ember.EnumerableUtils.indexOf,
u = [];
Ember.Enumerable = Ember.Mixin.create({
isEnumerable: !0,
nextObject: Ember.required(Function),
firstObject: Ember.computed(function () {
if (0 === r(this, "length")) return void 0;
var n, i = e();
return n = this.nextObject(0, null, i), t(i), n
}).property("[]"),
lastObject: Ember.computed(function () {
var n = r(this, "length");
if (0 === n) return void 0;
var i, s = e(),
o = 0,
u = null;
do u = i, i = this.nextObject(o++, u, s); while (void 0 !== i);
return t(s), u
}).property("[]"),
contains: function (e) {
return void 0 !== this.find(function (t) {
return t === e
})
},
forEach: function (n, i) {
if ("function" != typeof n) throw new TypeError;
var s = r(this, "length"),
o = null,
u = e();
void 0 === i && (i = null);
for (var a = 0; s > a; a++) {
var f = this.nextObject(a, o, u);
n.call(i, f, a, this), o = f
}
return o = null, u = t(u), this
},
getEach: function (e) {
return this.mapProperty(e)
},
setEach: function (e, t) {
return this.forEach(function (n) {
i(n, e, t)
})
},
map: function (e, t) {
var n = Ember.A([]);
return this.forEach(function (r, i, s) {
n[i] = e.call(t, r, i, s)
}), n
},
mapProperty: function (e) {
return this.map(function (t) {
return r(t, e)
})
},
filter: function (e, t) {
var n = Ember.A([]);
return this.forEach(function (r, i, s) {
e.call(t, r, i, s) && n.push(r)
}), n
},
reject: function (e, t) {
return this.filter(function () {
return !e.apply(t, arguments)
})
},
filterProperty: function () {
return this.filter(n.apply(this, arguments))
},
rejectProperty: function (e, t) {
var n = function (n) {
return r(n, e) === t
}, i = function (t) {
return !!r(t, e)
}, s = 2 === arguments.length ? n : i;
return this.reject(s)
},
find: function (n, i) {
var s = r(this, "length");
void 0 === i && (i = null);
for (var o, u, a = null, f = !1, l = e(), c = 0; s > c && !f; c++) o = this.nextObject(c, a, l), (f = n.call(i, o, c, this)) && (u = o), a = o;
return o = a = null, l = t(l), u
},
findProperty: function () {
return this.find(n.apply(this, arguments))
},
every: function (e, t) {
return !this.find(function (n, r, i) {
return !e.call(t, n, r, i)
})
},
everyProperty: function () {
return this.every(n.apply(this, arguments))
},
some: function (e, t) {
return !!this.find(function (n, r, i) {
return !!e.call(t, n, r, i)
})
},
someProperty: function () {
return this.some(n.apply(this, arguments))
},
reduce: function (e, t, n) {
if ("function" != typeof e) throw new TypeError;
var r = t;
return this.forEach(function (t, i) {
r = e.call(null, r, t, i, this, n)
}, this), r
},
invoke: function (e) {
var t, n = Ember.A([]);
return arguments.length > 1 && (t = s.call(arguments, 1)), this.forEach(function (r, i) {
var s = r && r[e];
"function" == typeof s && (n[i] = t ? s.apply(r, t) : s.call(r))
}, this), n
},
toArray: function () {
var e = Ember.A([]);
return this.forEach(function (t, n) {
e[n] = t
}), e
},
compact: function () {
return this.filter(function (e) {
return null != e
})
},
without: function (e) {
if (!this.contains(e)) return this;
var t = Ember.A([]);
return this.forEach(function (n) {
n !== e && (t[t.length] = n)
}), t
},
uniq: function () {
var e = Ember.A([]);
return this.forEach(function (t) {
0 > o(e, t) && e.push(t)
}), e
},
"[]": Ember.computed(function () {
return this
}),
addEnumerableObserver: function (e, t) {
var n = t && t.willChange || "enumerableWillChange",
i = t && t.didChange || "enumerableDidChange",
s = r(this, "hasEnumerableObservers");
return s || Ember.propertyWillChange(this, "hasEnumerableObservers"), Ember.addListener(this, "@enumerable:before", e, n), Ember.addListener(this, "@enumerable:change", e, i), s || Ember.propertyDidChange(this, "hasEnumerableObservers"), this
},
removeEnumerableObserver: function (e, t) {
var n = t && t.willChange || "enumerableWillChange",
i = t && t.didChange || "enumerableDidChange",
s = r(this, "hasEnumerableObservers");
return s && Ember.propertyWillChange(this, "hasEnumerableObservers"), Ember.removeListener(this, "@enumerable:before", e, n), Ember.removeListener(this, "@enumerable:change", e, i), s && Ember.propertyDidChange(this, "hasEnumerableObservers"), this
},
hasEnumerableObservers: Ember.computed(function () {
return Ember.hasListeners(this, "@enumerable:change") || Ember.hasListeners(this, "@enumerable:before")
}),
enumerableContentWillChange: function (e, t) {
var n, i, s;
return n = "number" == typeof e ? e : e ? r(e, "length") : e = -1, i = "number" == typeof t ? t : t ? r(t, "length") : t = -1, s = 0 > i || 0 > n || 0 !== i - n, -1 === e && (e = null), -1 === t && (t = null), Ember.propertyWillChange(this, "[]"), s && Ember.propertyWillChange(this, "length"), Ember.sendEvent(this, "@enumerable:before", [this, e, t]), this
},
enumerableContentDidChange: function (e, t) {
var n, i, s;
return n = "number" == typeof e ? e : e ? r(e, "length") : e = -1, i = "number" == typeof t ? t : t ? r(t, "length") : t = -1, s = 0 > i || 0 > n || 0 !== i - n, -1 === e && (e = null), -1 === t && (t = null), Ember.sendEvent(this, "@enumerable:change", [this, e, t]), s && Ember.propertyDidChange(this, "length"), Ember.propertyDidChange(this, "[]"), this
}
})
}(),
function () {
var e = Ember.get,
t = (Ember.set, Ember.isNone),
n = Ember.EnumerableUtils.map,
r = Ember.cacheFor;
Ember.Array = Ember.Mixin.create(Ember.Enumerable, {
isSCArray: !0,
length: Ember.required(),
objectAt: function (t) {
return 0 > t || t >= e(this, "length") ? void 0 : e(this, t)
},
objectsAt: function (e) {
var t = this;
return n(e, function (e) {
return t.objectAt(e)
})
},
nextObject: function (e) {
return this.objectAt(e)
},
"[]": Ember.computed(function (t, n) {
return void 0 !== n && this.replace(0, e(this, "length"), n), this
}),
firstObject: Ember.computed(function () {
return this.objectAt(0)
}),
lastObject: Ember.computed(function () {
return this.objectAt(e(this, "length") - 1)
}),
contains: function (e) {
return this.indexOf(e) >= 0
},
slice: function (n, r) {
var i = Ember.A([]),
s = e(this, "length");
for (t(n) && (n = 0), (t(r) || r > s) && (r = s), 0 > n && (n = s + n), 0 > r && (r = s + r); r > n;) i[i.length] = this.objectAt(n++);
return i
},
indexOf: function (t, n) {
var r, i = e(this, "length");
for (void 0 === n && (n = 0), 0 > n && (n += i), r = n; i > r; r++)
if (this.objectAt(r, !0) === t) return r;
return -1
},
lastIndexOf: function (t, n) {
var r, i = e(this, "length");
for ((void 0 === n || n >= i) && (n = i - 1), 0 > n && (n += i), r = n; r >= 0; r--)
if (this.objectAt(r) === t) return r;
return -1
},
addArrayObserver: function (t, n) {
var r = n && n.willChange || "arrayWillChange",
i = n && n.didChange || "arrayDidChange",
s = e(this, "hasArrayObservers");
return s || Ember.propertyWillChange(this, "hasArrayObservers"), Ember.addListener(this, "@array:before", t, r), Ember.addListener(this, "@array:change", t, i), s || Ember.propertyDidChange(this, "hasArrayObservers"), this
},
removeArrayObserver: function (t, n) {
var r = n && n.willChange || "arrayWillChange",
i = n && n.didChange || "arrayDidChange",
s = e(this, "hasArrayObservers");
return s && Ember.propertyWillChange(this, "hasArrayObservers"), Ember.removeListener(this, "@array:before", t, r), Ember.removeListener(this, "@array:change", t, i), s && Ember.propertyDidChange(this, "hasArrayObservers"), this
},
hasArrayObservers: Ember.computed(function () {
return Ember.hasListeners(this, "@array:change") || Ember.hasListeners(this, "@array:before")
}),
arrayContentWillChange: function (t, n, r) {
void 0 === t ? (t = 0, n = r = -1) : (void 0 === n && (n = -1), void 0 === r && (r = -1)), Ember.isWatching(this, "@each") && e(this, "@each"), Ember.sendEvent(this, "@array:before", [this, t, n, r]);
var i, s;
if (t >= 0 && n >= 0 && e(this, "hasEnumerableObservers")) {
i = [], s = t + n;
for (var o = t; s > o; o++) i.push(this.objectAt(o))
} else i = n;
return this.enumerableContentWillChange(i, r), this
},
arrayContentDidChange: function (t, n, i) {
void 0 === t ? (t = 0, n = i = -1) : (void 0 === n && (n = -1), void 0 === i && (i = -1));
var s, o;
if (t >= 0 && i >= 0 && e(this, "hasEnumerableObservers")) {
s = [], o = t + i;
for (var u = t; o > u; u++) s.push(this.objectAt(u))
} else s = i;
this.enumerableContentDidChange(n, s), Ember.sendEvent(this, "@array:change", [this, t, n, i]);
var a = e(this, "length"),
f = r(this, "firstObject"),
l = r(this, "lastObject");
return this.objectAt(0) !== f && (Ember.propertyWillChange(this, "firstObject"), Ember.propertyDidChange(this, "firstObject")), this.objectAt(a - 1) !== l && (Ember.propertyWillChange(this, "lastObject"), Ember.propertyDidChange(this, "lastObject")), this
},
"@each": Ember.computed(function () {
return this.__each || (this.__each = new Ember.EachProxy(this)), this.__each
})
})
}(),
function () {
Ember.Comparable = Ember.Mixin.create({
isComparable: !0,
compare: Ember.required(Function)
})
}(),
function () {
var e = Ember.get;
Ember.set, Ember.Copyable = Ember.Mixin.create({
copy: Ember.required(Function),
frozenCopy: function () {
if (Ember.Freezable && Ember.Freezable.detect(this)) return e(this, "isFrozen") ? this : this.copy().freeze();
throw new Error(Ember.String.fmt("%@ does not support freezing", [this]))
}
})
}(),
function () {
var e = Ember.get,
t = Ember.set;
Ember.Freezable = Ember.Mixin.create({
isFrozen: !1,
freeze: function () {
return e(this, "isFrozen") ? this : (t(this, "isFrozen", !0), this)
}
}), Ember.FROZEN_ERROR = "Frozen object cannot be modified."
}(),
function () {
var e = Ember.EnumerableUtils.forEach;
Ember.MutableEnumerable = Ember.Mixin.create(Ember.Enumerable, {
addObject: Ember.required(Function),
addObjects: function (t) {
return Ember.beginPropertyChanges(this), e(t, function (e) {
this.addObject(e)
}, this), Ember.endPropertyChanges(this), this
},
removeObject: Ember.required(Function),
removeObjects: function (t) {
return Ember.beginPropertyChanges(this), e(t, function (e) {
this.removeObject(e)
}, this), Ember.endPropertyChanges(this), this
}
})
}(),
function () {
var e = "Index out of range",
t = [],
n = Ember.get;
Ember.set, Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable, {
replace: Ember.required(),
clear: function () {
var e = n(this, "length");
return 0 === e ? this : (this.replace(0, e, t), this)
},
insertAt: function (t, i) {
if (t > n(this, "length")) throw new Error(e);
return this.replace(t, 0, [i]), this
},
removeAt: function (i, s) {
if ("number" == typeof i) {
if (0 > i || i >= n(this, "length")) throw new Error(e);
void 0 === s && (s = 1), this.replace(i, s, t)
}
return this
},
pushObject: function (e) {
return this.insertAt(n(this, "length"), e), e
},
pushObjects: function (e) {
return this.replace(n(this, "length"), 0, e), this
},
popObject: function () {
var e = n(this, "length");
if (0 === e) return null;
var t = this.objectAt(e - 1);
return this.removeAt(e - 1, 1), t
},
shiftObject: function () {
if (0 === n(this, "length")) return null;
var e = this.objectAt(0);
return this.removeAt(0), e
},
unshiftObject: function (e) {
return this.insertAt(0, e), e
},
unshiftObjects: function (e) {
return this.replace(0, 0, e), this
},
reverseObjects: function () {
var e = n(this, "length");
if (0 === e) return this;
var t = this.toArray().reverse();
return this.replace(0, e, t), this
},
setObjects: function (e) {
if (0 === e.length) return this.clear();
var t = n(this, "length");
return this.replace(0, t, e), this
},
removeObject: function (e) {
for (var t = n(this, "length") || 0; --t >= 0;) {
var i = this.objectAt(t);
i === e && this.removeAt(t)
}
return this
},
addObject: function (e) {
return this.contains(e) || this.pushObject(e), this
}
})
}(),
function () {
var e = Ember.get,
t = Ember.set;
Ember.Observable = Ember.Mixin.create({
get: function (t) {
return e(this, t)
},
getProperties: function () {
var t = {}, n = arguments;
1 === arguments.length && "array" === Ember.typeOf(arguments[0]) && (n = arguments[0]);
for (var r = 0; n.length > r; r++) t[n[r]] = e(this, n[r]);
return t
},
set: function (e, n) {
return t(this, e, n), this
},
setProperties: function (e) {
return Ember.setProperties(this, e)
},
beginPropertyChanges: function () {
return Ember.beginPropertyChanges(), this
},
endPropertyChanges: function () {
return Ember.endPropertyChanges(), this
},
propertyWillChange: function (e) {
return Ember.propertyWillChange(this, e), this
},
propertyDidChange: function (e) {
return Ember.propertyDidChange(this, e), this
},
notifyPropertyChange: function (e) {
return this.propertyWillChange(e), this.propertyDidChange(e), this
},
addBeforeObserver: function (e, t, n) {
Ember.addBeforeObserver(this, e, t, n)
},
addObserver: function (e, t, n) {
Ember.addObserver(this, e, t, n)
},
removeObserver: function (e, t, n) {
Ember.removeObserver(this, e, t, n)
},
hasObserverFor: function (e) {
return Ember.hasListeners(this, e + ":change")
},
getPath: function (e) {
return this.get(e)
},
setPath: function (e, t) {
return this.set(e, t)
},
getWithDefault: function (e, t) {
return Ember.getWithDefault(this, e, t)
},
incrementProperty: function (n, r) {
return Ember.isNone(r) && (r = 1), t(this, n, (e(this, n) || 0) + r), e(this, n)
},
decrementProperty: function (n, r) {
return Ember.isNone(r) && (r = 1), t(this, n, (e(this, n) || 0) - r), e(this, n)
},
toggleProperty: function (n) {
return t(this, n, !e(this, n)), e(this, n)
},
cacheFor: function (e) {
return Ember.cacheFor(this, e)
},
observersForKey: function (e) {
return Ember.observersFor(this, e)
}
})
}(),
function () {
var e = Ember.get;
Ember.set, Ember.TargetActionSupport = Ember.Mixin.create({
target: null,
action: null,
actionContext: null,
targetObject: Ember.computed(function () {
var t = e(this, "target");
if ("string" === Ember.typeOf(t)) {
var n = e(this, t);
return void 0 === n && (n = e(Ember.lookup, t)), n
}
return t
}).property("target"),
actionContextObject: Ember.computed(function () {
var t = e(this, "actionContext");
if ("string" === Ember.typeOf(t)) {
var n = e(this, t);
return void 0 === n && (n = e(Ember.lookup, t)), n
}
return t
}).property("actionContext"),
triggerAction: function (t) {
t = t || {};
var n = t.action || e(this, "action"),
r = t.target || e(this, "targetObject"),
i = t.actionContext || e(this, "actionContextObject") || this;
if (r && n) {
var s;
return s = r.send ? r.send.apply(r, [n, i]) : r[n].apply(r, [i]), s !== !1 && (s = !0), s
}
return !1
}
})
}(),
function () {
Ember.Evented = Ember.Mixin.create({
on: function (e, t, n) {
return Ember.addListener(this, e, t, n), this
},
one: function (e, t, n) {
return n || (n = t, t = null), Ember.addListener(this, e, t, n, !0), this
},
trigger: function (e) {
var t, n, r = [];
for (t = 1, n = arguments.length; n > t; t++) r.push(arguments[t]);
Ember.sendEvent(this, e, r)
},
fire: function () {
this.trigger.apply(this, arguments)
},
off: function (e, t, n) {
return Ember.removeListener(this, e, t, n), this
},
has: function (e) {
return Ember.hasListeners(this, e)
}
})
}(),
function () {
var e = t("rsvp");
e.configure("async", function (e, t) {
Ember.run.schedule("actions", t, e)
});
var n = Ember.get;
Ember.DeferredMixin = Ember.Mixin.create({
then: function (e, t) {
var i, s, o;
return o = this, i = n(this, "_deferred"), s = i.promise, s.then(function (t) {
return t === s ? e(o) : e(t)
}, function (e) {
return t(e)
})
},
resolve: function (e) {
var t, i;
t = n(this, "_deferred"), i = t.promise, e === this ? t.resolve(i) : t.resolve(e)
},
reject: function (e) {
n(this, "_deferred").reject(e)
},
_deferred: Ember.computed(function () {
return e.defer()
})
})
}(),
function () {
Ember.Container = t("container"), Ember.Container.set = Ember.set
}(),
function () {
function e() {
var e, t, s = !1,
o = function () {
s || o.proto(), r(this, i, y), r(this, "_super", y);
var a = u(this);
if (a.proto = this, e) {
var l = e;
e = null, this.reopen.apply(this, l)
}
if (t) {
var c = t;
t = null;
for (var h = this.concatenatedProperties, p = 0, v = c.length; v > p; p++) {
var b = c[p];
for (var w in b)
if (b.hasOwnProperty(w)) {
var S = b[w],
x = Ember.IS_BINDING;
if (x.test(w)) {
var T = a.bindings;
T ? a.hasOwnProperty("bindings") || (T = a.bindings = n(a.bindings)) : T = a.bindings = {}, T[w] = S
}
var N = a.descs[w];
if (h && g(h, w) >= 0) {
var C = this[w];
S = C ? "function" == typeof C.concat ? C.concat(S) : Ember.makeArray(C).concat(S) : Ember.makeArray(S)
}
N ? N.set(this, w, S) : "function" != typeof this.setUnknownProperty || w in this ? m ? Ember.defineProperty(this, w, null, S) : this[w] = S : this.setUnknownProperty(w, S)
}
}
}
d(this, a), delete a.proto, f(this), this.init.apply(this, arguments)
};
return o.toString = h.prototype.toString, o.willReopen = function () {
s && (o.PrototypeMixin = h.create(o.PrototypeMixin)), s = !1
}, o._initMixins = function (t) {
e = t
}, o._initProperties = function (e) {
t = e
}, o.proto = function () {
var e = o.superclass;
return e && e.proto(), s || (s = !0, o.PrototypeMixin.applyPartial(o.prototype), a(o.prototype)), this.prototype
}, o
}
function t(e) {
return function () {
return e
}
}
var n = (Ember.set, Ember.get, Ember.create),
r = Ember.platform.defineProperty,
i = Ember.GUID_KEY,
s = Ember.guidFor,
o = Ember.generateGuid,
u = Ember.meta,
a = Ember.rewatch,
f = Ember.finishChains,
l = Ember.destroy,
c = Ember.run.schedule,
h = Ember.Mixin,
p = h._apply,
d = h.finishPartial,
v = h.prototype.reopen,
m = Ember.ENV.MANDATORY_SETTER,
g = Ember.EnumerableUtils.indexOf,
y = {
configurable: !0,
writable: !0,
enumerable: !1,
value: void 0
}, b = e();
b.toString = function () {
return "Ember.CoreObject"
}, b.PrototypeMixin = h.create({
reopen: function () {
return p(this, arguments, !0), this
},
isInstance: !0,
init: function () {},
concatenatedProperties: null,
isDestroyed: !1,
isDestroying: !1,
destroy: function () {
return this._didCallDestroy ? void 0 : (this.isDestroying = !0, this._didCallDestroy = !0, c("destroy", this, this._scheduledDestroy), this)
},
willDestroy: Ember.K,
_scheduledDestroy: function () {
this.willDestroy && this.willDestroy(), l(this), this.isDestroyed = !0, this.didDestroy && this.didDestroy()
},
bind: function (e, t) {
return t instanceof Ember.Binding || (t = Ember.Binding.from(t)), t.to(e).connect(this), t
},
toString: function () {
var e = "function" == typeof this.toStringExtension,
n = e ? ":" + this.toStringExtension() : "",
r = "<" + this.constructor.toString() + ":" + s(this) + n + ">";
return this.toString = t(r), r
}
}), b.PrototypeMixin.ownerConstructor = b, Ember.config.overridePrototypeMixin && Ember.config.overridePrototypeMixin(b.PrototypeMixin), b.__super__ = null;
var w = h.create({
ClassMixin: Ember.required(),
PrototypeMixin: Ember.required(),
isClass: !0,
isMethod: !1,
extend: function () {
var t, r = e();
return r.ClassMixin = h.create(this.ClassMixin), r.PrototypeMixin = h.create(this.PrototypeMixin), r.ClassMixin.ownerConstructor = r, r.PrototypeMixin.ownerConstructor = r, v.apply(r.PrototypeMixin, arguments), r.superclass = this, r.__super__ = this.prototype, t = r.prototype = n(this.prototype), t.constructor = r, o(t, "ember"), u(t).proto = t, r.ClassMixin.apply(r), r
},
createWithMixins: function () {
var e = this;
return arguments.length > 0 && this._initMixins(arguments), new e
},
create: function () {
var e = this;
return arguments.length > 0 && this._initProperties(arguments), new e
},
reopen: function () {
return this.willReopen(), v.apply(this.PrototypeMixin, arguments), this
},
reopenClass: function () {
return v.apply(this.ClassMixin, arguments), p(this, arguments, !1), this
},
detect: function (e) {
if ("function" != typeof e) return !1;
for (; e;) {
if (e === this) return !0;
e = e.superclass
}
return !1
},
detectInstance: function (e) {
return e instanceof this
},
metaForProperty: function (e) {
var t = u(this.proto(), !1).descs[e];
return t._meta || {}
},
eachComputedProperty: function (e, t) {
var n, r = this.proto(),
i = u(r).descs,
s = {};
for (var o in i) n = i[o], n instanceof Ember.ComputedProperty && e.call(t || this, o, n._meta || s)
}
});
w.ownerConstructor = b, Ember.config.overrideClassMixin && Ember.config.overrideClassMixin(w), b.ClassMixin = w, w.apply(b), Ember.CoreObject = b
}(),
function () {
Ember.Object = Ember.CoreObject.extend(Ember.Observable), Ember.Object.toString = function () {
return "Ember.Object"
}
}(),
function () {
function e(t, n, i) {
var o = t.length;
f[t.join(".")] = n;
for (var u in n)
if (l.call(n, u)) {
var a = n[u];
if (t[o] = u, a && a.toString === r) a.toString = s(t.join(".")), a[h] = t.join(".");
else if (a && a.isNamespace) {
if (i[c(a)]) continue;
i[c(a)] = !0, e(t, a, i)
}
}
t.length = o
}
function t() {
var e, t, n = Ember.Namespace,
r = Ember.lookup;
if (!n.PROCESSED)
for (var i in r)
if ("parent" !== i && "top" !== i && "frameElement" !== i && "webkitStorageInfo" !== i && !("globalStorage" === i && r.StorageList && r.globalStorage instanceof r.StorageList || r.hasOwnProperty && !r.hasOwnProperty(i))) {
try {
e = Ember.lookup[i], t = e && e.isNamespace
} catch (s) {
continue
}
t && (e[h] = i)
}
}
function n(e) {
var t = e.superclass;
return t ? t[h] ? t[h] : n(t) : void 0
}
function r() {
Ember.BOOTED || this[h] || i();
var e;
if (this[h]) e = this[h];
else {
var t = n(this);
e = t ? "(subclass of " + t + ")" : "(unknown mixin)", this.toString = s(e)
}
return e
}
function i() {
var n = !a.PROCESSED,
r = Ember.anyUnprocessedMixins;
if (n && (t(), a.PROCESSED = !0), n || r) {
for (var i, s = a.NAMESPACES, o = 0, u = s.length; u > o; o++) i = s[o], e([i.toString()], i, {});
Ember.anyUnprocessedMixins = !1
}
}
function s(e) {
return function () {
return e
}
}
var o = Ember.get,
u = Ember.ArrayPolyfills.indexOf,
a = Ember.Namespace = Ember.Object.extend({
isNamespace: !0,
init: function () {
Ember.Namespace.NAMESPACES.push(this), Ember.Namespace.PROCESSED = !1
},
toString: function () {
var e = o(this, "name");
return e ? e : (t(), this[Ember.GUID_KEY + "_name"])
},
nameClasses: function () {
e([this.toString()], this, {})
},
destroy: function () {
var e = Ember.Namespace.NAMESPACES;
Ember.lookup[this.toString()] = void 0, e.splice(u.call(e, this), 1), this._super()
}
});
a.reopenClass({
NAMESPACES: [Ember],
NAMESPACES_BY_ID: {},
PROCESSED: !1,
processAll: i,
byName: function (e) {
return Ember.BOOTED || i(), f[e]
}
});
var f = a.NAMESPACES_BY_ID,
l = {}.hasOwnProperty,
c = Ember.guidFor,
h = Ember.NAME_KEY = Ember.GUID_KEY + "_name";
Ember.Mixin.prototype.toString = r
}(),
function () {
Ember.Application = Ember.Namespace.extend()
}(),
function () {
var e = "Index out of range",
t = [],
n = Ember.get;
Ember.set, Ember.ArrayProxy = Ember.Object.extend(Ember.MutableArray, {
content: null,
arrangedContent: Ember.computed.alias("content"),
objectAtContent: function (e) {
return n(this, "arrangedContent").objectAt(e)
},
replaceContent: function (e, t, i) {
n(this, "content").replace(e, t, i)
},
_contentWillChange: Ember.beforeObserver(function () {
this._teardownContent()
}, "content"),
_teardownContent: function () {
var e = n(this, "content");
e && e.removeArrayObserver(this, {
willChange: "contentArrayWillChange",
didChange: "contentArrayDidChange"
})
},
contentArrayWillChange: Ember.K,
contentArrayDidChange: Ember.K,
_contentDidChange: Ember.observer(function () {
n(this, "content"), this._setupContent()
}, "content"),
_setupContent: function () {
var e = n(this, "content");
e && e.addArrayObserver(this, {
willChange: "contentArrayWillChange",
didChange: "contentArrayDidChange"
})
},
_arrangedContentWillChange: Ember.beforeObserver(function () {
var e = n(this, "arrangedContent"),
t = e ? n(e, "length") : 0;
this.arrangedContentArrayWillChange(this, 0, t, void 0), this.arrangedContentWillChange(this), this._teardownArrangedContent(e)
}, "arrangedContent"),
_arrangedContentDidChange: Ember.observer(function () {
var e = n(this, "arrangedContent"),
t = e ? n(e, "length") : 0;
this._setupArrangedContent(), this.arrangedContentDidChange(this), this.arrangedContentArrayDidChange(this, 0, void 0, t)
}, "arrangedContent"),
_setupArrangedContent: function () {
var e = n(this, "arrangedContent");
e && e.addArrayObserver(this, {
willChange: "arrangedContentArrayWillChange",
didChange: "arrangedContentArrayDidChange"
})
},
_teardownArrangedContent: function () {
var e = n(this, "arrangedContent");
e && e.removeArrayObserver(this, {
willChange: "arrangedContentArrayWillChange",
didChange: "arrangedContentArrayDidChange"
})
},
arrangedContentWillChange: Ember.K,
arrangedContentDidChange: Ember.K,
objectAt: function (e) {
return n(this, "content") && this.objectAtContent(e)
},
length: Ember.computed(function () {
var e = n(this, "arrangedContent");
return e ? n(e, "length") : 0
}),
_replace: function (e, t, i) {
var s = n(this, "content");
return s && this.replaceContent(e, t, i), this
},
replace: function () {
if (n(this, "arrangedContent") !== n(this, "content")) throw new Ember.Error("Using replace on an arranged ArrayProxy is not allowed.");
this._replace.apply(this, arguments)
},
_insertAt: function (t, i) {
if (t > n(this, "content.length")) throw new Error(e);
return this._replace(t, 0, [i]), this
},
insertAt: function (e, t) {
if (n(this, "arrangedContent") === n(this, "content")) return this._insertAt(e, t);
throw new Ember.Error("Using insertAt on an arranged ArrayProxy is not allowed.")
},
removeAt: function (i, s) {
if ("number" == typeof i) {
var o, u = n(this, "content"),
a = n(this, "arrangedContent"),
f = [];
if (0 > i || i >= n(this, "length")) throw new Error(e);
for (void 0 === s && (s = 1), o = i; i + s > o; o++) f.push(u.indexOf(a.objectAt(o)));
for (f.sort(function (e, t) {
return t - e
}), Ember.beginPropertyChanges(), o = 0; f.length > o; o++) this._replace(f[o], 1, t);
Ember.endPropertyChanges()
}
return this
},
pushObject: function (e) {
return this._insertAt(n(this, "content.length"), e), e
},
pushObjects: function (e) {
return this._replace(n(this, "length"), 0, e), this
},
setObjects: function (e) {
if (0 === e.length) return this.clear();
var t = n(this, "length");
return this._replace(0, t, e), this
},
unshiftObject: function (e) {
return this._insertAt(0, e), e
},
unshiftObjects: function (e) {
return this._replace(0, 0, e), this
},
slice: function () {
var e = this.toArray();
return e.slice.apply(e, arguments)
},
arrangedContentArrayWillChange: function (e, t, n, r) {
this.arrayContentWillChange(t, n, r)
},
arrangedContentArrayDidChange: function (e, t, n, r) {
this.arrayContentDidChange(t, n, r)
},
init: function () {
this._super(), this._setupContent(), this._setupArrangedContent()
},
willDestroy: function () {
this._teardownArrangedContent(), this._teardownContent()
}
})
}(),
function () {
function e(e, t) {
var n = t.slice(8);
n in this || a(this, n)
}
function t(e, t) {
var n = t.slice(8);
n in this || f(this, n)
}
var n = Ember.get,
r = Ember.set,
i = (Ember.String.fmt, Ember.addBeforeObserver),
s = Ember.addObserver,
o = Ember.removeBeforeObserver,
u = Ember.removeObserver,
a = Ember.propertyWillChange,
f = Ember.propertyDidChange;
Ember.ObjectProxy = Ember.Object.extend({
content: null,
_contentDidChange: Ember.observer(function () {}, "content"),
isTruthy: Ember.computed.bool("content"),
_debugContainerKey: null,
willWatchProperty: function (n) {
var r = "content." + n;
i(this, r, null, e), s(this, r, null, t)
},
didUnwatchProperty: function (n) {
var r = "content." + n;
o(this, r, null, e), u(this, r, null, t)
},
unknownProperty: function (e) {
var t = n(this, "content");
return t ? n(t, e) : void 0
},
setUnknownProperty: function (e, t) {
var i = n(this, "content");
return r(i, e, t)
}
}), Ember.ObjectProxy.reopenClass({
create: function () {
var e, t, n, r, i, s;
if (arguments.length) {
for (t = this.proto(), n = 0, r = arguments.length; r > n; n++) {
i = arguments[n];
for (s in i)!i.hasOwnProperty(s) || s in t || (e || (e = {}), e[s] = null)
}
e && this._initMixins([e])
}
return this._super.apply(this, arguments)
}
})
}(),
function () {
function e(e, t, n, i, s) {
var o, u = n._objects;
for (u || (u = n._objects = {}); --s >= i;) {
var a = e.objectAt(s);
a && (Ember.addBeforeObserver(a, t, n, "contentKeyWillChange"), Ember.addObserver(a, t, n, "contentKeyDidChange"), o = r(a), u[o] || (u[o] = []), u[o].push(s))
}
}
function t(e, t, n, i, s) {
var o = n._objects;
o || (o = n._objects = {});
for (var u, a; --s >= i;) {
var f = e.objectAt(s);
f && (Ember.removeBeforeObserver(f, t, n, "contentKeyWillChange"), Ember.removeObserver(f, t, n, "contentKeyDidChange"), a = r(f), u = o[a], u[u.indexOf(s)] = null)
}
}
var n = (Ember.set, Ember.get),
r = Ember.guidFor,
i = Ember.EnumerableUtils.forEach,
s = Ember.Object.extend(Ember.Array, {
init: function (e, t, n) {
this._super(), this._keyName = t, this._owner = n, this._content = e
},
objectAt: function (e) {
var t = this._content.objectAt(e);
return t && n(t, this._keyName)
},
length: Ember.computed(function () {
var e = this._content;
return e ? n(e, "length") : 0
})
}),
o = /^.+:(before|change)$/;
Ember.EachProxy = Ember.Object.extend({
init: function (e) {
this._super(), this._content = e, e.addArrayObserver(this), i(Ember.watchedEvents(this), function (e) {
this.didAddListener(e)
}, this)
},
unknownProperty: function (e) {
var t;
return t = new s(this._content, e, this), Ember.defineProperty(this, e, null, t), this.beginObservingContentKey(e), t
},
arrayWillChange: function (e, n, r) {
var i, s, o = this._keys;
s = r > 0 ? n + r : -1, Ember.beginPropertyChanges(this);
for (i in o) o.hasOwnProperty(i) && (s > 0 && t(e, i, this, n, s), Ember.propertyWillChange(this, i));
Ember.propertyWillChange(this._content, "@each"), Ember.endPropertyChanges(this)
},
arrayDidChange: function (t, n, r, i) {
var s, o, u = this._keys;
o = i > 0 ? n + i : -1, Ember.beginPropertyChanges(this);
for (s in u) u.hasOwnProperty(s) && (o > 0 && e(t, s, this, n, o), Ember.propertyDidChange(this, s));
Ember.propertyDidChange(this._content, "@each"), Ember.endPropertyChanges(this)
},
didAddListener: function (e) {
o.test(e) && this.beginObservingContentKey(e.slice(0, -7))
},
didRemoveListener: function (e) {
o.test(e) && this.stopObservingContentKey(e.slice(0, -7))
},
beginObservingContentKey: function (t) {
var r = this._keys;
if (r || (r = this._keys = {}), r[t]) r[t]++;
else {
r[t] = 1;
var i = this._content,
s = n(i, "length");
e(i, t, this, 0, s)
}
},
stopObservingContentKey: function (e) {
var r = this._keys;
if (r && r[e] > 0 && 0 >= --r[e]) {
var i = this._content,
s = n(i, "length");
t(i, e, this, 0, s)
}
},
contentKeyWillChange: function (e, t) {
Ember.propertyWillChange(this, t)
},
contentKeyDidChange: function (e, t) {
Ember.propertyDidChange(this, t)
}
})
}(),
function () {
var e = Ember.get;
Ember.set;
var t = Ember.Mixin.create(Ember.MutableArray, Ember.Observable, Ember.Copyable, {
get: function (e) {
return "length" === e ? this.length : "number" == typeof e ? this[e] : this._super(e)
},
objectAt: function (e) {
return this[e]
},
replace: function (t, n, r) {
if (this.isFrozen) throw Ember.FROZEN_ERROR;
var i = r ? e(r, "length") : 0;
if (this.arrayContentWillChange(t, n, i), r && 0 !== r.length) {
var s = [t, n].concat(r);
this.splice.apply(this, s)
} else this.splice(t, n);
return this.arrayContentDidChange(t, n, i), this
},
unknownProperty: function (e, t) {
var n;
return void 0 !== t && void 0 === n && (n = this[e] = t), n
},
indexOf: function (e, t) {
var n, r = this.length;
for (t = void 0 === t ? 0 : 0 > t ? Math.ceil(t) : Math.floor(t), 0 > t && (t += r), n = t; r > n; n++)
if (this[n] === e) return n;
return -1
},
lastIndexOf: function (e, t) {
var n, r = this.length;
for (t = void 0 === t ? r - 1 : 0 > t ? Math.ceil(t) : Math.floor(t), 0 > t && (t += r), n = t; n >= 0; n--)
if (this[n] === e) return n;
return -1
},
copy: function (e) {
return e ? this.map(function (e) {
return Ember.copy(e, !0)
}) : this.slice()
}
}),
n = ["length"];
Ember.EnumerableUtils.forEach(t.keys(), function (e) {
Array.prototype[e] && n.push(e)
}), n.length > 0 && (t = t.without.apply(t, n)), Ember.NativeArray = t, Ember.A = function (e) {
return void 0 === e && (e = []), Ember.Array.detect(e) ? e : Ember.NativeArray.apply(e)
}, Ember.NativeArray.activate = function () {
t.apply(Array.prototype), Ember.A = function (e) {
return e || []
}
}, (Ember.EXTEND_PROTOTYPES === !0 || Ember.EXTEND_PROTOTYPES.Array) && Ember.NativeArray.activate()
}(),
function () {
var e = Ember.get,
t = Ember.set,
n = Ember.guidFor,
r = Ember.isNone,
i = Ember.String.fmt;
Ember.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Ember.Freezable, {
length: 0,
clear: function () {
if (this.isFrozen) throw new Error(Ember.FROZEN_ERROR);
var r = e(this, "length");
if (0 === r) return this;
var i;
this.enumerableContentWillChange(r, 0), Ember.propertyWillChange(this, "firstObject"), Ember.propertyWillChange(this, "lastObject");
for (var s = 0; r > s; s++) i = n(this[s]), delete this[i], delete this[s];
return t(this, "length", 0), Ember.propertyDidChange(this, "firstObject"), Ember.propertyDidChange(this, "lastObject"), this.enumerableContentDidChange(r, 0), this
},
isEqual: function (t) {
if (!Ember.Enumerable.detect(t)) return !1;
var n = e(this, "length");
if (e(t, "length") !== n) return !1;
for (; --n >= 0;)
if (!t.contains(this[n])) return !1;
return !0
},
add: Ember.aliasMethod("addObject"),
remove: Ember.aliasMethod("removeObject"),
pop: function () {
if (e(this, "isFrozen")) throw new Error(Ember.FROZEN_ERROR);
var t = this.length > 0 ? this[this.length - 1] : null;
return this.remove(t), t
},
push: Ember.aliasMethod("addObject"),
shift: Ember.aliasMethod("pop"),
unshift: Ember.aliasMethod("push"),
addEach: Ember.aliasMethod("addObjects"),
removeEach: Ember.aliasMethod("removeObjects"),
init: function (e) {
this._super(), e && this.addObjects(e)
},
nextObject: function (e) {
return this[e]
},
firstObject: Ember.computed(function () {
return this.length > 0 ? this[0] : void 0
}),
lastObject: Ember.computed(function () {
return this.length > 0 ? this[this.length - 1] : void 0
}),
addObject: function (i) {
if (e(this, "isFrozen")) throw new Error(Ember.FROZEN_ERROR);
if (r(i)) return this;
var s, o = n(i),
u = this[o],
a = e(this, "length");
return u >= 0 && a > u && this[u] === i ? this : (s = [i], this.enumerableContentWillChange(null, s), Ember.propertyWillChange(this, "lastObject"), a = e(this, "length"), this[o] = a, this[a] = i, t(this, "length", a + 1), Ember.propertyDidChange(this, "lastObject"), this.enumerableContentDidChange(null, s), this)
},
removeObject: function (i) {
if (e(this, "isFrozen")) throw new Error(Ember.FROZEN_ERROR);
if (r(i)) return this;
var s, o, u = n(i),
a = this[u],
f = e(this, "length"),
l = 0 === a,
c = a === f - 1;
return a >= 0 && f > a && this[a] === i && (o = [i], this.enumerableContentWillChange(o, null), l && Ember.propertyWillChange(this, "firstObject"), c && Ember.propertyWillChange(this, "lastObject"), f - 1 > a && (s = this[f - 1], this[a] = s, this[n(s)] = a), delete this[u], delete this[f - 1], t(this, "length", f - 1), l && Ember.propertyDidChange(this, "firstObject"), c && Ember.propertyDidChange(this, "lastObject"), this.enumerableContentDidChange(o, null)), this
},
contains: function (e) {
return this[n(e)] >= 0
},
copy: function () {
var r = this.constructor,
i = new r,
s = e(this, "length");
for (t(i, "length", s); --s >= 0;) i[s] = this[s], i[n(this[s])] = s;
return i
},
toString: function () {
var e, t = this.length,
n = [];
for (e = 0; t > e; e++) n[e] = this[e];
return i("Ember.Set<%@>", [n.join(",")])
}
})
}(),
function () {
var e = Ember.DeferredMixin;
Ember.get;
var t = Ember.Object.extend(e);
t.reopenClass({
promise: function (e, n) {
var r = t.create();
return e.call(n, r), r
}
}), Ember.Deferred = t
}(),
function () {
var e = Ember.ArrayPolyfills.forEach,
t = Ember.ENV.EMBER_LOAD_HOOKS || {}, n = {};
Ember.onLoad = function (e, i) {
var s;
t[e] = t[e] || Ember.A(), t[e].pushObject(i), (s = n[e]) && i(s)
}, Ember.runLoadHooks = function (i, s) {
n[i] = s, t[i] && e.call(t[i], function (e) {
e(s)
})
}
}(),
function () {
var e = Ember.get;
Ember.ControllerMixin = Ember.Mixin.create({
isController: !0,
target: null,
container: null,
parentController: null,
store: null,
model: Ember.computed.alias("content"),
send: function (t) {
var n, r = [].slice.call(arguments, 1),
i = !0;
this[t] && (i = this[t].apply(this, r) === !0), i && (n = e(this, "target")) && n.send.apply(n, arguments)
}
}), Ember.Controller = Ember.Object.extend(Ember.ControllerMixin)
}(),
function () {
var e = Ember.get,
t = (Ember.set, Ember.EnumerableUtils.forEach);
Ember.SortableMixin = Ember.Mixin.create(Ember.MutableEnumerable, {
sortProperties: null,
sortAscending: !0,
orderBy: function (n, r) {
var i = 0,
s = e(this, "sortProperties"),
o = e(this, "sortAscending");
return t(s, function (t) {
0 === i && (i = Ember.compare(e(n, t), e(r, t)), 0 === i || o || (i = -1 * i))
}), i
},
destroy: function () {
var n = e(this, "content"),
r = e(this, "sortProperties");
return n && r && t(n, function (e) {
t(r, function (t) {
Ember.removeObserver(e, t, this, "contentItemSortPropertyDidChange")
}, this)
}, this), this._super()
},
isSorted: Ember.computed.bool("sortProperties"),
arrangedContent: Ember.computed("content", "sortProperties.@each", function () {
var n = e(this, "content"),
r = e(this, "isSorted"),
i = e(this, "sortProperties"),
s = this;
return n && r ? (n = n.slice(), n.sort(function (e, t) {
return s.orderBy(e, t)
}), t(n, function (e) {
t(i, function (t) {
Ember.addObserver(e, t, this, "contentItemSortPropertyDidChange")
}, this)
}, this), Ember.A(n)) : n
}),
_contentWillChange: Ember.beforeObserver(function () {
var n = e(this, "content"),
r = e(this, "sortProperties");
n && r && t(n, function (e) {
t(r, function (t) {
Ember.removeObserver(e, t, this, "contentItemSortPropertyDidChange")
}, this)
}, this), this._super()
}, "content"),
sortAscendingWillChange: Ember.beforeObserver(function () {
this._lastSortAscending = e(this, "sortAscending")
}, "sortAscending"),
sortAscendingDidChange: Ember.observer(function () {
if (e(this, "sortAscending") !== this._lastSortAscending) {
var t = e(this, "arrangedContent");
t.reverseObjects()
}
}, "sortAscending"),
contentArrayWillChange: function (n, r, i, s) {
var o = e(this, "isSorted");
if (o) {
var u = e(this, "arrangedContent"),
a = n.slice(r, r + i),
f = e(this, "sortProperties");
t(a, function (e) {
u.removeObject(e), t(f, function (t) {
Ember.removeObserver(e, t, this, "contentItemSortPropertyDidChange")
}, this)
}, this)
}
return this._super(n, r, i, s)
},
contentArrayDidChange: function (n, r, i, s) {
var o = e(this, "isSorted"),
u = e(this, "sortProperties");
if (o) {
var a = n.slice(r, r + s);
t(a, function (e) {
this.insertItemSorted(e), t(u, function (t) {
Ember.addObserver(e, t, this, "contentItemSortPropertyDidChange")
}, this)
}, this)
}
return this._super(n, r, i, s)
},
insertItemSorted: function (t) {
var n = e(this, "arrangedContent"),
r = e(n, "length"),
i = this._binarySearch(t, 0, r);
n.insertAt(i, t)
},
contentItemSortPropertyDidChange: function (t) {
var n = e(this, "arrangedContent"),
r = n.indexOf(t),
i = n.objectAt(r - 1),
s = n.objectAt(r + 1),
o = i && this.orderBy(t, i),
u = s && this.orderBy(t, s);
(0 > o || u > 0) && (n.removeObject(t), this.insertItemSorted(t))
},
_binarySearch: function (t, n, r) {
var i, s, o, u;
return n === r ? n : (u = e(this, "arrangedContent"), i = n + Math.floor((r - n) / 2), s = u.objectAt(i), o = this.orderBy(s, t), 0 > o ? this._binarySearch(t, i + 1, r) : o > 0 ? this._binarySearch(t, n, i) : i)
}
})
}(),
function () {
var e = Ember.get,
t = (Ember.set, Ember.EnumerableUtils.forEach),
n = Ember.EnumerableUtils.replace;
Ember.ArrayController = Ember.ArrayProxy.extend(Ember.ControllerMixin, Ember.SortableMixin, {
itemController: null,
lookupItemController: function () {
return e(this, "itemController")
},
objectAtContent: function (t) {
var n = e(this, "length"),
r = e(this, "arrangedContent"),
i = r && r.objectAt(t);
if (t >= 0 && n > t) {
var s = this.lookupItemController(i);
if (s) return this.controllerAt(t, i, s)
}
return i
},
arrangedContentDidChange: function () {
this._super(), this._resetSubControllers()
},
arrayContentDidChange: function (i, s, o) {
var u = e(this, "_subControllers"),
a = u.slice(i, i + s);
t(a, function (e) {
e && e.destroy()
}), n(u, i, s, new Array(o)), this._super(i, s, o)
},
init: function () {
this.get("content") || Ember.defineProperty(this, "content", void 0, Ember.A()), this._super(), this.set("_subControllers", Ember.A())
},
controllerAt: function (t, n, r) {
var i = e(this, "container"),
s = e(this, "_subControllers"),
o = s[t];
if (o || (o = i.lookup("controller:" + r, {
singleton: !1
}), s[t] = o), !o) throw new Error('Could not resolve itemController: "' + r + '"');
return o.set("target", this), o.set("parentController", e(this, "parentController") || this), o.set("content", n), o
},
_subControllers: null,
_resetSubControllers: function () {
var n = e(this, "_subControllers");
n && t(n, function (e) {
e && e.destroy()
}), this.set("_subControllers", Ember.A())
}
})
}(),
function () {
Ember.ObjectController = Ember.ObjectProxy.extend(Ember.ControllerMixin)
}(),
function () {
var e = Ember.imports.jQuery;
Ember.$ = e
}(),
function () {
if (Ember.$) {
var e = Ember.String.w("dragstart drag dragenter dragleave dragover drop dragend");
Ember.EnumerableUtils.forEach(e, function (e) {
Ember.$.event.fixHooks[e] = {
props: ["dataTransfer"]
}
})
}
}(),
function () {
function e(e) {
var t = e.shiftKey || e.metaKey || e.altKey || e.ctrlKey,
n = e.which > 1;
return !t && !n
}
var t = this.document && function () {
var e = document.createElement("div");
return e.innerHTML = "<div></div>", e.firstChild.innerHTML = "<script></script>", "" === e.firstChild.innerHTML
}(),
n = this.document && function () {
var e = document.createElement("div");
return e.innerHTML = "Test: <script type='text/x-placeholder'></script>Value", "Test:" === e.childNodes[0].nodeValue && " Value" === e.childNodes[2].nodeValue
}(),
r = function (e, t) {
if (e.getAttribute("id") === t) return e;
var n, i, s, o = e.childNodes.length;
for (n = 0; o > n; n++)
if (i = e.childNodes[n], s = 1 === i.nodeType && r(i, t)) return s
}, i = function (e, i) {
t && (i = "&shy;" + i);
var s = [];
if (n && (i = i.replace(/(\s+)(<script id='([^']+)')/g, function (e, t, n, r) {
return s.push([r, t]), n
})), e.innerHTML = i, s.length > 0) {
var o, u = s.length;
for (o = 0; u > o; o++) {
var a = r(e, s[o][0]),
f = document.createTextNode(s[o][1]);
a.parentNode.insertBefore(f, a)
}
}
if (t) {
for (var l = e.firstChild; 1 === l.nodeType && !l.nodeName;) l = l.firstChild;
3 === l.nodeType && "­" === l.nodeValue.charAt(0) && (l.nodeValue = l.nodeValue.slice(1))
}
}, s = {}, o = function (e) {
if (void 0 !== s[e]) return s[e];
var t = !0;
if ("select" === e.toLowerCase()) {
var n = document.createElement("select");
i(n, '<option value="test">Test</option>'), t = 1 === n.options.length
}
return s[e] = t, t
}, u = function (e, t) {
var n = e.tagName;
if (o(n)) i(e, t);
else {
var r = e.outerHTML || (new XMLSerializer).serializeToString(e),
s = r.match(new RegExp("<" + n + "([^>]*)>", "i"))[0],
u = "</" + n + ">",
a = document.createElement("div");
for (i(a, s + t + u), e = a.firstChild; e.tagName !== n;) e = e.nextSibling
}
return e
};
Ember.ViewUtils = {
setInnerHTML: u,
isSimpleClick: e
}
}(),
function () {
Ember.get, Ember.set;
var e = function () {
this.seen = {}, this.list = []
};
e.prototype = {
add: function (e) {
e in this.seen || (this.seen[e] = !0, this.list.push(e))
},
toDOM: function () {
return this.list.join(" ")
}
}, Ember.RenderBuffer = function (e) {
return new Ember._RenderBuffer(e)
}, Ember._RenderBuffer = function (e) {
this.tagNames = [e || null], this.buffer = ""
}, Ember._RenderBuffer.prototype = {
_element: null,
_hasElement: !0,
elementClasses: null,
classes: null,
elementId: null,
elementAttributes: null,
elementProperties: null,
elementTag: null,
elementStyle: null,
parentBuffer: null,
push: function (e) {
return this.buffer += e, this
},
addClass: function (t) {
return this.elementClasses = this.elementClasses || new e, this.elementClasses.add(t), this.classes = this.elementClasses.list, this
},
setClasses: function (e) {
this.classes = e
},
id: function (e) {
return this.elementId = e, this
},
attr: function (e, t) {
var n = this.elementAttributes = this.elementAttributes || {};
return 1 === arguments.length ? n[e] : (n[e] = t, this)
},
removeAttr: function (e) {
var t = this.elementAttributes;
return t && delete t[e], this
},
prop: function (e, t) {
var n = this.elementProperties = this.elementProperties || {};
return 1 === arguments.length ? n[e] : (n[e] = t, this)
},
removeProp: function (e) {
var t = this.elementProperties;
return t && delete t[e], this
},
style: function (e, t) {
return this.elementStyle = this.elementStyle || {}, this.elementStyle[e] = t, this
},
begin: function (e) {
return this.tagNames.push(e || null), this
},
pushOpeningTag: function () {
var e = this.currentTagName();
if (e) {
if (this._hasElement && !this._element && 0 === this.buffer.length) return this._element = this.generateElement(), void 0;
var t, n, r = this.buffer,
i = this.elementId,
s = this.classes,
o = this.elementAttributes,
u = this.elementProperties,
a = this.elementStyle;
if (r += "<" + e, i && (r += ' id="' + this._escapeAttribute(i) + '"', this.elementId = null), s && (r += ' class="' + this._escapeAttribute(s.join(" ")) + '"', this.classes = null), a) {
r += ' style="';
for (n in a) a.hasOwnProperty(n) && (r += n + ":" + this._escapeAttribute(a[n]) + ";");
r += '"', this.elementStyle = null
}
if (o) {
for (t in o) o.hasOwnProperty(t) && (r += " " + t + '="' + this._escapeAttribute(o[t]) + '"');
this.elementAttributes = null
}
if (u) {
for (n in u)
if (u.hasOwnProperty(n)) {
var f = u[n];
(f || "number" == typeof f) && (r += f === !0 ? " " + n + '="' + n + '"' : " " + n + '="' + this._escapeAttribute(u[n]) + '"')
}
this.elementProperties = null
}
r += ">", this.buffer = r
}
},
pushClosingTag: function () {
var e = this.tagNames.pop();
e && (this.buffer += "</" + e + ">")
},
currentTagName: function () {
return this.tagNames[this.tagNames.length - 1]
},
generateElement: function () {
var e, t, n = this.tagNames.pop(),
r = document.createElement(n),
i = Ember.$(r),
s = this.elementId,
o = this.classes,
u = this.elementAttributes,
a = this.elementProperties,
f = this.elementStyle,
l = "";
if (s && (i.attr("id", s), this.elementId = null), o && (i.attr("class", o.join(" ")), this.classes = null), f) {
for (t in f) f.hasOwnProperty(t) && (l += t + ":" + f[t] + ";");
i.attr("style", l), this.elementStyle = null
}
if (u) {
for (e in u) u.hasOwnProperty(e) && i.attr(e, u[e]);
this.elementAttributes = null
}
if (a) {
for (t in a) a.hasOwnProperty(t) && i.prop(t, a[t]);
this.elementProperties = null
}
return r
},
element: function () {
var e = this.innerString();
return e && (this._element = Ember.ViewUtils.setInnerHTML(this._element, e)), this._element
},
string: function () {
if (this._hasElement && this._element) {
var e = this.element(),
t = e.outerHTML;
return "undefined" == typeof t ? Ember.$("<div/>").append(e).html() : t
}
return this.innerString()
},
innerString: function () {
return this.buffer
},
_escapeAttribute: function (e) {
var t = {
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
"'": "&#x27;",
"`": "&#x60;"
}, n = /&(?!\w+;)|[<>"'`]/g,
r = /[&<>"'`]/,
i = function (e) {
return t[e] || "&amp;"
}, s = e.toString();
return r.test(s) ? s.replace(n, i) : s
}
}
}(),
function () {
var e = Ember.get,
t = Ember.set;
Ember.String.fmt, Ember.EventDispatcher = Ember.Object.extend({
rootElement: "body",
setup: function (n, r) {
var i, s = {
touchstart: "touchStart",
touchmove: "touchMove",
touchend: "touchEnd",
touchcancel: "touchCancel",
keydown: "keyDown",
keyup: "keyUp",
keypress: "keyPress",
mousedown: "mouseDown",
mouseup: "mouseUp",
contextmenu: "contextMenu",
click: "click",
dblclick: "doubleClick",
mousemove: "mouseMove",
focusin: "focusIn",
focusout: "focusOut",
mouseenter: "mouseEnter",
mouseleave: "mouseLeave",
submit: "submit",
input: "input",
change: "change",
dragstart: "dragStart",
drag: "drag",
dragenter: "dragEnter",
dragleave: "dragLeave",
dragover: "dragOver",
drop: "drop",
dragend: "dragEnd"
};
Ember.$.extend(s, n || {}), Ember.isNone(r) || t(this, "rootElement", r), r = Ember.$(e(this, "rootElement")), r.addClass("ember-application");
for (i in s) s.hasOwnProperty(i) && this.setupHandler(r, i, s[i])
},
setupHandler: function (e, t, n) {
var r = this;
e.on(t + ".ember", ".ember-view", function (e, t) {
return Ember.handleErrors(function () {
var i = Ember.View.views[this.id],
s = !0,
o = null;
return o = r._findNearestEventManager(i, n), o && o !== t ? s = r._dispatchEvent(o, e, n, i) : i ? s = r._bubbleEvent(i, e, n) : e.stopPropagation(), s
}, this)
}), e.on(t + ".ember", "[data-ember-action]", function (e) {
return Ember.handleErrors(function () {
var t = Ember.$(e.currentTarget).attr("data-ember-action"),
r = Ember.Handlebars.ActionHelper.registeredActions[t];
return r && r.eventName === n ? r.handler(e) : void 0
}, this)
})
},
_findNearestEventManager: function (t, n) {
for (var r = null; t && (r = e(t, "eventManager"), !r || !r[n]);) t = e(t, "parentView");
return r
},
_dispatchEvent: function (e, t, n, r) {
var i = !0,
s = e[n];
return "function" === Ember.typeOf(s) ? (i = s.call(e, t, r), t.stopPropagation()) : i = this._bubbleEvent(r, t, n), i
},
_bubbleEvent: function (e, t, n) {
return Ember.run(function () {
return e.handleEvent(n, t)
})
},
destroy: function () {
var t = e(this, "rootElement");
return Ember.$(t).off(".ember", "**").removeClass("ember-application"), this._super()
}
})
}(),
function () {
var e = Ember.run.queues,
t = Ember.ArrayPolyfills.indexOf;
e.splice(t.call(e, "actions") + 1, 0, "render", "afterRender")
}(),
function () {
var e = Ember.get,
t = Ember.set;
Ember.ControllerMixin.reopen({
target: null,
namespace: null,
view: null,
container: null,
_childContainers: null,
init: function () {
this._super(), t(this, "_childContainers", {})
},
_modelDidChange: Ember.observer(function () {
var n = e(this, "_childContainers");
for (var r in n) n.hasOwnProperty(r) && n[r].destroy();
t(this, "_childContainers", {})
}, "model")
})
}(),
function () {
function e() {
Ember.run.once(Ember.View, "notifyMutationListeners")
}
var t = {}, n = Ember.get,
r = Ember.set,
i = Ember.guidFor,
s = Ember.EnumerableUtils.forEach,
o = Ember.EnumerableUtils.addObject,
u = Ember.computed(function () {
var e = this._childViews,
t = Ember.A(),
r = this;
return s(e, function (e) {
e.isVirtual ? t.pushObjects(n(e, "childViews")) : t.push(e)
}), t.replace = function (e, t, n) {
if (r instanceof Ember.ContainerView) return r.replace(e, t, n);
throw new Error("childViews is immutable")
}, t
});
Ember.TEMPLATES = {}, Ember.CoreView = Ember.Object.extend(Ember.Evented, {
isView: !0,
states: t,
init: function () {
this._super(), this.transitionTo("preRender")
},
parentView: Ember.computed(function () {
var e = this._parentView;
return e && e.isVirtual ? n(e, "parentView") : e
}).property("_parentView"),
state: null,
_parentView: null,
concreteView: Ember.computed(function () {
return this.isVirtual ? n(this, "parentView") : this
}).property("parentView"),
instrumentName: "core_view",
instrumentDetails: function (e) {
e.object = this.toString()
},
renderToBuffer: function (e, t) {
var n = "render." + this.instrumentName,
r = {};
return this.instrumentDetails(r), Ember.instrument(n, r, function () {
return this._renderToBuffer(e, t)
}, this)
},
_renderToBuffer: function (e) {
var t = this.tagName;
(null === t || void 0 === t) && (t = "div");
var n = this.buffer = e && e.begin(t) || Ember.RenderBuffer(t);
return this.transitionTo("inBuffer", !1), this.beforeRender(n), this.render(n), this.afterRender(n), n
},
trigger: function (e) {
this._super.apply(this, arguments);
var t = this[e];
if (t) {
var n, r, i = [];
for (n = 1, r = arguments.length; r > n; n++) i.push(arguments[n]);
return t.apply(this, i)
}
},
has: function (e) {
return "function" === Ember.typeOf(this[e]) || this._super(e)
},
destroy: function () {
var e = this._parentView;
if (this._super()) return this.removedFromDOM || this.destroyElement(), e && e.removeChild(this), this.transitionTo("destroying", !1), this
},
clearRenderedChildren: Ember.K,
triggerRecursively: Ember.K,
invokeRecursively: Ember.K,
transitionTo: Ember.K,
destroyElement: Ember.K
});
var a = Ember._ViewCollection = function (e) {
var t = this.views = e || [];
this.length = t.length
};
a.prototype = {
length: 0,
trigger: function (e) {
for (var t, n = this.views, r = 0, i = n.length; i > r; r++) t = n[r], t.trigger && t.trigger(e)
},
triggerRecursively: function (e) {
for (var t = this.views, n = 0, r = t.length; r > n; n++) t[n].triggerRecursively(e)
},
invokeRecursively: function (e) {
for (var t, n = this.views, r = 0, i = n.length; i > r; r++) t = n[r], e(t)
},
transitionTo: function (e, t) {
for (var n = this.views, r = 0, i = n.length; i > r; r++) n[r].transitionTo(e, t)
},
push: function () {
this.length += arguments.length;
var e = this.views;
return e.push.apply(e, arguments)
},
objectAt: function (e) {
return this.views[e]
},
forEach: function (e) {
var t = this.views;
return s(t, e)
},
clear: function () {
this.length = 0, this.views.length = 0
}
};
var f = [];
Ember.View = Ember.CoreView.extend({
concatenatedProperties: ["classNames", "classNameBindings", "attributeBindings"],
isView: !0,
templateName: null,
layoutName: null,
templates: Ember.TEMPLATES,
template: Ember.computed(function (e, t) {
if (void 0 !== t) return t;
var r = n(this, "templateName"),
i = this.templateForName(r, "template");
return i || n(this, "defaultTemplate")
}).property("templateName"),
controller: Ember.computed(function () {
var e = n(this, "_parentView");
return e ? n(e, "controller") : null
}).property("_parentView"),
layout: Ember.computed(function () {
var e = n(this, "layoutName"),
t = this.templateForName(e, "layout");
return t || n(this, "defaultLayout")
}).property("layoutName"),
templateForName: function (e) {
if (e) {
var t = this.container || Ember.Container && Ember.Container.defaultContainer;
return t && t.lookup("template:" + e)
}
},
context: Ember.computed(function (e, t) {
return 2 === arguments.length ? (r(this, "_context", t), t) : n(this, "_context")
}).volatile(),
_context: Ember.computed(function () {
var e, t;
return (t = n(this, "controller")) ? t : (e = this._parentView, e ? n(e, "_context") : null)
}),
_contextDidChange: Ember.observer(function () {
this.rerender()
}, "context"),
isVisible: !0,
childViews: u,
_childViews: f,
_childViewsWillChange: Ember.beforeObserver(function () {
if (this.isVirtual) {
var e = n(this, "parentView");
e && Ember.propertyWillChange(e, "childViews")
}
}, "childViews"),
_childViewsDidChange: Ember.observer(function () {
if (this.isVirtual) {
var e = n(this, "parentView");
e && Ember.propertyDidChange(e, "childViews")
}
}, "childViews"),
nearestInstanceOf: function (e) {
for (var t = n(this, "parentView"); t;) {
if (t instanceof e) return t;
t = n(t, "parentView")
}
},
nearestOfType: function (e) {
for (var t = n(this, "parentView"), r = e instanceof Ember.Mixin ? function (t) {
return e.detect(t)
} : function (t) {
return e.detect(t.constructor)
}; t;) {
if (r(t)) return t;
t = n(t, "parentView")
}
},
nearestWithProperty: function (e) {
for (var t = n(this, "parentView"); t;) {
if (e in t) return t;
t = n(t, "parentView")
}
},
nearestChildOf: function (e) {
for (var t = n(this, "parentView"); t;) {
if (n(t, "parentView") instanceof e) return t;
t = n(t, "parentView")
}
},
_parentViewDidChange: Ember.observer(function () {
this.isDestroying || n(this, "parentView.controller") && !n(this, "controller") && this.notifyPropertyChange("controller")
}, "_parentView"),
_controllerDidChange: Ember.observer(function () {
this.isDestroying || (this.rerender(), this.forEachChildView(function (e) {
e.propertyDidChange("controller")
}))
}, "controller"),
cloneKeywords: function () {
var e = n(this, "templateData"),
t = e ? Ember.copy(e.keywords) : {};
return r(t, "view", n(this, "concreteView")), r(t, "_view", this), r(t, "controller", n(this, "controller")), t
},
render: function (e) {
var t = n(this, "layout") || n(this, "template");
if (t) {
var r, i = n(this, "context"),
s = this.cloneKeywords(),
o = {
view: this,
buffer: e,
isRenderData: !0,
keywords: s,
insideGroup: n(this, "templateData.insideGroup")
};
r = t(i, {
data: o
}), void 0 !== r && e.push(r)
}
},
rerender: function () {
return this.currentState.rerender(this)
},
clearRenderedChildren: function () {
for (var e = this.lengthBeforeRender, t = this.lengthAfterRender, n = this._childViews, r = t - 1; r >= e; r--) n[r] && n[r].destroy()
},
_applyClassNameBindings: function (e) {
var t, n, r, i = this.classNames;
s(e, function (e) {
var s, u = Ember.View._parsePropertyPath(e),
a = function () {
n = this._classStringForProperty(e), t = this.$(), s && (t.removeClass(s), i.removeObject(s)), n ? (t.addClass(n), s = n) : s = null
};
r = this._classStringForProperty(e), r && (o(i, r), s = r), this.registerObserver(this, u.path, a), this.one("willClearRender", function () {
s && (i.removeObject(s), s = null)
})
}, this)
},
_applyAttributeBindings: function (e, t) {
var r, i;
s(t, function (t) {
var s = t.split(":"),
o = s[0],
u = s[1] || o,
a = function () {
i = this.$(), r = n(this, o), Ember.View.applyAttributeBindings(i, u, r)
};
this.registerObserver(this, o, a), r = n(this, o), Ember.View.applyAttributeBindings(e, u, r)
}, this)
},
_classStringForProperty: function (e) {
var t = Ember.View._parsePropertyPath(e),
r = t.path,
i = n(this, r);
return void 0 === i && Ember.isGlobalPath(r) && (i = n(Ember.lookup, r)), Ember.View._classStringForValue(r, i, t.className, t.falsyClassName)
},
element: Ember.computed(function (e, t) {
return void 0 !== t ? this.currentState.setElement(this, t) : this.currentState.getElement(this)
}).property("_parentView"),
$: function (e) {
return this.currentState.$(this, e)
},
mutateChildViews: function (e) {
for (var t, n = this._childViews, r = n.length; --r >= 0;) t = n[r], e(this, t, r);
return this
},
forEachChildView: function (e) {
var t = this._childViews;
if (!t) return this;
var n, r, i = t.length;
for (r = 0; i > r; r++) n = t[r], e(n);
return this
},
appendTo: function (e) {
return this._insertElementLater(function () {
this.$().appendTo(e)
}), this
},
replaceIn: function (e) {
return this._insertElementLater(function () {
Ember.$(e).empty(), this.$().appendTo(e)
}), this
},
_insertElementLater: function (e) {
this._scheduledInsert = Ember.run.scheduleOnce("render", this, "_insertElement", e)
},
_insertElement: function (e) {
this._scheduledInsert = null, this.currentState.insertElement(this, e)
},
append: function () {
return this.appendTo(document.body)
},
remove: function () {
this.removedFromDOM || this.destroyElement(), this.invokeRecursively(function (e) {
e.clearRenderedChildren && e.clearRenderedChildren()
})
},
elementId: null,
findElementInParentElement: function (e) {
var t = "#" + this.elementId;
return Ember.$(t)[0] || Ember.$(t, e)[0]
},
createElement: function () {
if (n(this, "element")) return this;
var e = this.renderToBuffer();
return r(this, "element", e.element()), this
},
willInsertElement: Ember.K,
didInsertElement: Ember.K,
willClearRender: Ember.K,
invokeRecursively: function (e, t) {
for (var n, r, i = t === !1 ? this._childViews : [this]; i.length;) {
n = i.slice(), i = [];
for (var s = 0, o = n.length; o > s; s++) r = n[s], e(r), r._childViews && i.push.apply(i, r._childViews)
}
},
triggerRecursively: function (e) {
for (var t, n, r = [this]; r.length;) {
t = r.slice(), r = [];
for (var i = 0, s = t.length; s > i; i++) n = t[i], n.trigger && n.trigger(e), n._childViews && r.push.apply(r, n._childViews)
}
},
viewHierarchyCollection: function () {
for (var e, t = new a([this]), n = 0; t.length > n; n++) e = t.objectAt(n), e._childViews && t.push.apply(t, e._childViews);
return t
},
destroyElement: function () {
return this.currentState.destroyElement(this)
},
willDestroyElement: function () {},
_notifyWillDestroyElement: function () {
var e = this.viewHierarchyCollection();
return e.trigger("willClearRender"), e.trigger("willDestroyElement"), e
},
_elementWillChange: Ember.beforeObserver(function () {
this.forEachChildView(function (e) {
Ember.propertyWillChange(e, "element")
})
}, "element"),
_elementDidChange: Ember.observer(function () {
this.forEachChildView(function (e) {
Ember.propertyDidChange(e, "element")
})
}, "element"),
parentViewDidChange: Ember.K,
instrumentName: "view",
instrumentDetails: function (e) {
e.template = n(this, "templateName"), this._super(e)
},
_renderToBuffer: function (e, t) {
this.lengthBeforeRender = this._childViews.length;
var n = this._super(e, t);
return this.lengthAfterRender = this._childViews.length, n
},
renderToBufferIfNeeded: function (e) {
return this.currentState.renderToBufferIfNeeded(this, e)
},
beforeRender: function (e) {
this.applyAttributesToBuffer(e), e.pushOpeningTag()
},
afterRender: function (e) {
e.pushClosingTag()
},
applyAttributesToBuffer: function (e) {
var t = n(this, "classNameBindings");
t.length && this._applyClassNameBindings(t);
var r = n(this, "attributeBindings");
r.length && this._applyAttributeBindings(e, r), e.setClasses(this.classNames), e.id(this.elementId);
var i = n(this, "ariaRole");
i && e.attr("role", i), n(this, "isVisible") === !1 && e.style("display", "none")
},
tagName: null,
ariaRole: null,
classNames: ["ember-view"],
classNameBindings: f,
attributeBindings: f,
init: function () {
this.elementId = this.elementId || i(this), this._super(), this._childViews = this._childViews.slice(), this.classNameBindings = Ember.A(this.classNameBindings.slice()), this.classNames = Ember.A(this.classNames.slice());
var e = n(this, "viewController");
e && (e = n(e), e && r(e, "view", this))
},
appendChild: function (e, t) {
return this.currentState.appendChild(this, e, t)
},
removeChild: function (e) {
if (!this.isDestroying) {
r(e, "_parentView", null);
var t = this._childViews;
return Ember.EnumerableUtils.removeObject(t, e), this.propertyDidChange("childViews"), this
}
},
removeAllChildren: function () {
return this.mutateChildViews(function (e, t) {
e.removeChild(t)
})
},
destroyAllChildren: function () {
return this.mutateChildViews(function (e, t) {
t.destroy()
})
},
removeFromParent: function () {
var e = this._parentView;
return this.remove(), e && e.removeChild(this), this
},
destroy: function () {
var e, t, r = this._childViews,
i = n(this, "parentView"),
s = this.viewName;
if (this._super()) {
for (e = r.length, t = e - 1; t >= 0; t--) r[t].removedFromDOM = !0;
for (s && i && i.set(s, null), e = r.length, t = e - 1; t >= 0; t--) r[t].destroy();
return this
}
},
createChildView: function (e, t) {
return e.isView && e._parentView === this ? e : (Ember.CoreView.detect(e) ? (t = t || {}, t._parentView = this, t.container = this.container, t.templateData = t.templateData || n(this, "templateData"), e = e.create(t), e.viewName && r(n(this, "concreteView"), e.viewName, e)) : (t && e.setProperties(t), n(e, "templateData") || r(e, "templateData", n(this, "templateData")), r(e, "_parentView", this)), e)
},
becameVisible: Ember.K,
becameHidden: Ember.K,
_isVisibleDidChange: Ember.observer(function () {
var e = this.$();
if (e) {
var t = n(this, "isVisible");
e.toggle(t), this._isAncestorHidden() || (t ? this._notifyBecameVisible() : this._notifyBecameHidden())
}
}, "isVisible"),
_notifyBecameVisible: function () {
this.trigger("becameVisible"), this.forEachChildView(function (e) {
var t = n(e, "isVisible");
(t || null === t) && e._notifyBecameVisible()
})
},
_notifyBecameHidden: function () {
this.trigger("becameHidden"), this.forEachChildView(function (e) {
var t = n(e, "isVisible");
(t || null === t) && e._notifyBecameHidden()
})
},
_isAncestorHidden: function () {
for (var e = n(this, "parentView"); e;) {
if (n(e, "isVisible") === !1) return !0;
e = n(e, "parentView")
}
return !1
},
clearBuffer: function () {
this.invokeRecursively(function (e) {
e.buffer = null
})
},
transitionTo: function (e, t) {
var n = this.currentState,
r = this.currentState = this.states[e];
this.state = e, n && n.exit && n.exit(this), r.enter && r.enter(this), t !== !1 && this.forEachChildView(function (t) {
t.transitionTo(e)
})
},
handleEvent: function (e, t) {
return this.currentState.handleEvent(this, e, t)
},
registerObserver: function (e, t, n, r) {
r || "function" != typeof n || (r = n, n = null);
var i = this,
s = function () {
i.currentState.invokeObserver(this, r)
}, o = function () {
Ember.run.scheduleOnce("render", this, s)
};
Ember.addObserver(e, t, n, o), this.one("willClearRender", function () {
Ember.removeObserver(e, t, n, o)
})
}
});
var l = {
prepend: function (t, n) {
t.$().prepend(n), e()
},
after: function (t, n) {
t.$().after(n), e()
},
html: function (t, n) {
t.$().html(n), e()
},
replace: function (t) {
var i = n(t, "element");
r(t, "element", null), t._insertElementLater(function () {
Ember.$(i).replaceWith(n(t, "element")), e()
})
},
remove: function (t) {
t.$().remove(), e()
},
empty: function (t) {
t.$().empty(), e()
}
};
Ember.View.reopen({
domManager: l
}), Ember.View.reopenClass({
_parsePropertyPath: function (e) {
var t, n, r = e.split(":"),
i = r[0],
s = "";
return r.length > 1 && (t = r[1], 3 === r.length && (n = r[2]), s = ":" + t, n && (s += ":" + n)), {
path: i,
classNames: s,
className: "" === t ? void 0 : t,
falsyClassName: n
}
},
_classStringForValue: function (e, t, n, r) {
if (n || r) return n && t ? n : r && !t ? r : null;
if (t === !0) {
var i = e.split(".");
return Ember.String.dasherize(i[i.length - 1])
}
return t !== !1 && void 0 !== t && null !== t ? t : null
}
});
var c = Ember.Object.extend(Ember.Evented).create();
Ember.View.addMutationListener = function (e) {
c.on("change", e)
}, Ember.View.removeMutationListener = function (e) {
c.off("change", e)
}, Ember.View.notifyMutationListeners = function () {
c.trigger("change")
}, Ember.View.views = {}, Ember.View.childViewsProperty = u, Ember.View.applyAttributeBindings = function (e, t, n) {
var r = Ember.typeOf(n);
"value" === t || "string" !== r && ("number" !== r || isNaN(n)) ? "value" === t || "boolean" === r ? (void 0 === n && (n = null), n !== e.prop(t) && e.prop(t, n)) : n || e.removeAttr(t) : n !== e.attr(t) && e.attr(t, n)
}, Ember.View.states = t
}(),
function () {
var e = (Ember.get, Ember.set);
Ember.View.states._default = {
appendChild: function () {
throw "You can't use appendChild outside of the rendering process"
},
$: function () {
return void 0
},
getElement: function () {
return null
},
handleEvent: function () {
return !0
},
destroyElement: function (t) {
return e(t, "element", null), t._scheduledInsert && (Ember.run.cancel(t._scheduledInsert), t._scheduledInsert = null), t
},
renderToBufferIfNeeded: function () {
return !1
},
rerender: Ember.K,
invokeObserver: Ember.K
}
}(),
function () {
var e = Ember.View.states.preRender = Ember.create(Ember.View.states._default);
Ember.merge(e, {
insertElement: function (e, t) {
e.createElement();
var n = e.viewHierarchyCollection();
n.trigger("willInsertElement"), t.call(e), n.transitionTo("inDOM", !1), n.trigger("didInsertElement")
},
renderToBufferIfNeeded: function (e, t) {
return e.renderToBuffer(t), !0
},
empty: Ember.K,
setElement: function (e, t) {
return null !== t && e.transitionTo("hasElement"), t
}
})
}(),
function () {
Ember.get, Ember.set;
var e = Ember.View.states.inBuffer = Ember.create(Ember.View.states._default);
Ember.merge(e, {
$: function (e) {
return e.rerender(), Ember.$()
},
rerender: function () {
throw new Ember.Error("Something you did caused a view to re-render after it rendered but before it was inserted into the DOM.")
},
appendChild: function (e, t, n) {
var r = e.buffer,
i = e._childViews;
return t = e.createChildView(t, n), i.length || (i = e._childViews = i.slice()), i.push(t), t.renderToBuffer(r), e.propertyDidChange("childViews"), t
},
destroyElement: function (e) {
e.clearBuffer();
var t = e._notifyWillDestroyElement();
return t.transitionTo("preRender", !1), e
},
empty: function () {},
renderToBufferIfNeeded: function () {
return !1
},
insertElement: function () {
throw "You can't insert an element that has already been rendered"
},
setElement: function (e, t) {
return null === t ? e.transitionTo("preRender") : (e.clearBuffer(), e.transitionTo("hasElement")), t
},
invokeObserver: function (e, t) {
t.call(e)
}
})
}(),
function () {
var e = Ember.get,
t = Ember.set,
n = Ember.View.states.hasElement = Ember.create(Ember.View.states._default);
Ember.merge(n, {
$: function (t, n) {
var r = e(t, "element");
return n ? Ember.$(n, r) : Ember.$(r)
},
getElement: function (t) {
var n = e(t, "parentView");
return n && (n = e(n, "element")), n ? t.findElementInParentElement(n) : Ember.$("#" + e(t, "elementId"))[0]
},
setElement: function (e, t) {
if (null !== t) throw "You cannot set an element to a non-null value when the element is already in the DOM.";
return e.transitionTo("preRender"), t
},
rerender: function (e) {
return e.triggerRecursively("willClearRender"), e.clearRenderedChildren(), e.domManager.replace(e), e
},
destroyElement: function (e) {
return e._notifyWillDestroyElement(), e.domManager.remove(e), t(e, "element", null), e._scheduledInsert && (Ember.run.cancel(e._scheduledInsert), e._scheduledInsert = null), e
},
empty: function (e) {
var t, n, r = e._childViews;
if (r)
for (t = r.length, n = 0; t > n; n++) r[n]._notifyWillDestroyElement();
e.domManager.empty(e)
},
handleEvent: function (e, t, n) {
return e.has(t) ? e.trigger(t, n) : !0
},
invokeObserver: function (e, t) {
t.call(e)
}
});
var r = Ember.View.states.inDOM = Ember.create(n);
Ember.merge(r, {
enter: function (e) {
e.isVirtual || (Ember.View.views[e.elementId] = e), e.addBeforeObserver("elementId", function () {
throw new Error("Changing a view's elementId after creation is not allowed")
})
},
exit: function (e) {
this.isVirtual || delete Ember.View.views[e.elementId]
},
insertElement: function () {
throw "You can't insert an element into the DOM that has already been inserted"
}
})
}(),
function () {
var e = "You can't call %@ on a view being destroyed",
t = Ember.String.fmt,
n = Ember.View.states.destroying = Ember.create(Ember.View.states._default);
Ember.merge(n, {
appendChild: function () {
throw t(e, ["appendChild"])
},
rerender: function () {
throw t(e, ["rerender"])
},
destroyElement: function () {
throw t(e, ["destroyElement"])
},
empty: function () {
throw t(e, ["empty"])
},
setElement: function () {
throw t(e, ["set('element', ...)"])
},
renderToBufferIfNeeded: function () {
return !1
},
insertElement: Ember.K
})
}(),
function () {
Ember.View.cloneStates = function (e) {
var t = {};
t._default = {}, t.preRender = Ember.create(t._default), t.destroying = Ember.create(t._default), t.inBuffer = Ember.create(t._default), t.hasElement = Ember.create(t._default), t.inDOM = Ember.create(t.hasElement);
for (var n in e) e.hasOwnProperty(n) && Ember.merge(t[n], e[n]);
return t
}
}(),
function () {
function e(e, t, n, r) {
t.triggerRecursively("willInsertElement"), n ? n.domManager.after(n, r.string()) : e.domManager.prepend(e, r.string()), t.forEach(function (e) {
e.transitionTo("inDOM"), e.propertyDidChange("element"), e.triggerRecursively("didInsertElement")
})
}
var t = Ember.View.cloneStates(Ember.View.states),
n = Ember.get,
r = Ember.set,
i = Ember.EnumerableUtils.forEach,
s = Ember._ViewCollection;
Ember.ContainerView = Ember.View.extend(Ember.MutableArray, {
states: t,
init: function () {
this._super();
var e = n(this, "childViews");
Ember.defineProperty(this, "childViews", Ember.View.childViewsProperty);
var t = this._childViews;
i(e, function (e, i) {
var s;
"string" == typeof e ? (s = n(this, e), s = this.createChildView(s), r(this, e, s)) : s = this.createChildView(e), t[i] = s
}, this);
var s = n(this, "currentView");
s && (t.length || (t = this._childViews = this._childViews.slice()), t.push(this.createChildView(s)))
},
replace: function (e, t, r) {
var i = r ? n(r, "length") : 0;
if (this.arrayContentWillChange(e, t, i), this.childViewsWillChange(this._childViews, e, t), 0 === i) this._childViews.splice(e, t);
else {
var s = [e, t].concat(r);
r.length && !this._childViews.length && (this._childViews = this._childViews.slice()), this._childViews.splice.apply(this._childViews, s)
}
return this.arrayContentDidChange(e, t, i), this.childViewsDidChange(this._childViews, e, t, i), this
},
objectAt: function (e) {
return this._childViews[e]
},
length: Ember.computed(function () {
return this._childViews.length
}),
render: function (e) {
this.forEachChildView(function (t) {
t.renderToBuffer(e)
})
},
instrumentName: "container",
childViewsWillChange: function (e, t, n) {
if (this.propertyWillChange("childViews"), n > 0) {
var r = e.slice(t, t + n);
this.currentState.childViewsWillChange(this, e, t, n), this.initializeViews(r, null, null)
}
},
removeChild: function (e) {
return this.removeObject(e), this
},
childViewsDidChange: function (e, t, r, i) {
if (i > 0) {
var s = e.slice(t, t + i);
this.initializeViews(s, this, n(this, "templateData")), this.currentState.childViewsDidChange(this, e, t, i)
}
this.propertyDidChange("childViews")
},
initializeViews: function (e, t, s) {
i(e, function (e) {
r(e, "_parentView", t), n(e, "templateData") || r(e, "templateData", s)
})
},
currentView: null,
_currentViewWillChange: Ember.beforeObserver(function () {
var e = n(this, "currentView");
e && e.destroy()
}, "currentView"),
_currentViewDidChange: Ember.observer(function () {
var e = n(this, "currentView");
e && this.pushObject(e)
}, "currentView"),
_ensureChildrenAreInDOM: function () {
this.currentState.ensureChildrenAreInDOM(this)
}
}), Ember.merge(t._default, {
childViewsWillChange: Ember.K,
childViewsDidChange: Ember.K,
ensureChildrenAreInDOM: Ember.K
}), Ember.merge(t.inBuffer, {
childViewsDidChange: function () {
throw new Error("You cannot modify child views while in the inBuffer state")
}
}), Ember.merge(t.hasElement, {
childViewsWillChange: function (e, t, n, r) {
for (var i = n; n + r > i; i++) t[i].remove()
},
childViewsDidChange: function (e) {
Ember.run.scheduleOnce("render", e, "_ensureChildrenAreInDOM")
},
ensureChildrenAreInDOM: function (t) {
var n, r, i, u, a, f = t._childViews,
l = new s;
for (n = 0, r = f.length; r > n; n++) i = f[n], a || (a = Ember.RenderBuffer(), a._hasElement = !1), i.renderToBufferIfNeeded(a) ? l.push(i) : l.length ? (e(t, l, u, a), a = null, u = i, l.clear()) : u = i;
l.length && e(t, l, u, a)
}
})
}(),
function () {
var e = Ember.get,
t = Ember.set;
Ember.String.fmt, Ember.CollectionView = Ember.ContainerView.extend({
content: null,
emptyViewClass: Ember.View,
emptyView: null,
itemViewClass: Ember.View,
init: function () {
var e = this._super();
return this._contentDidChange(), e
},
_contentWillChange: Ember.beforeObserver(function () {
var t = this.get("content");
t && t.removeArrayObserver(this);
var n = t ? e(t, "length") : 0;
this.arrayWillChange(t, 0, n)
}, "content"),
_contentDidChange: Ember.observer(function () {
var t = e(this, "content");
t && t.addArrayObserver(this);
var n = t ? e(t, "length") : 0;
this.arrayDidChange(t, 0, null, n)
}, "content"),
destroy: function () {
if (this._super()) {
var t = e(this, "content");
return t && t.removeArrayObserver(this), this._createdEmptyView && this._createdEmptyView.destroy(), this
}
},
arrayWillChange: function (t, n, r) {
var i = e(this, "emptyView");
i && i instanceof Ember.View && i.removeFromParent();
var s, o, u, a = this._childViews;
u = this._childViews.length;
var f = r === u;
for (f && (this.currentState.empty(this), this.invokeRecursively(function (e) {
e.removedFromDOM = !0
}, !1)), o = n + r - 1; o >= n; o--) s = a[o], s.destroy()
},
arrayDidChange: function (n, r, i, s) {
var o, u, a, f, l = e(this, "itemViewClass"),
c = [];
if ("string" == typeof l && (l = e(l)), f = n ? e(n, "length") : 0)
for (a = r; r + s > a; a++) u = n.objectAt(a), o = this.createChildView(l, {
content: u,
contentIndex: a
}), c.push(o);
else {
var h = e(this, "emptyView");
if (!h) return;
var p = Ember.CoreView.detect(h);
h = this.createChildView(h), c.push(h), t(this, "emptyView", h), p && (this._createdEmptyView = h)
}
this.replace(r, 0, c)
},
createChildView: function (n, r) {
n = this._super(n, r);
var i = e(n, "tagName"),
s = null === i || void 0 === i ? Ember.CollectionView.CONTAINER_MAP[e(this, "tagName")] : i;
return t(n, "tagName", s), n
}
}), Ember.CollectionView.CONTAINER_MAP = {
ul: "li",
ol: "li",
table: "tr",
thead: "tr",
tbody: "tr",
tfoot: "tr",
tr: "td",
select: "option"
}
}(),
function () {
Ember.ViewTargetActionSupport = Ember.Mixin.create(Ember.TargetActionSupport, {
target: Ember.computed.alias("controller"),
actionContext: Ember.computed.alias("context")
})
}(),
function () {
e("metamorph", [], function () {
"use strict";
var e = function () {}, t = 0,
n = this.document,
r = n && "createRange" in n && "undefined" != typeof Range && Range.prototype.createContextualFragment,
i = n && function () {
var e = n.createElement("div");
return e.innerHTML = "<div></div>", e.firstChild.innerHTML = "<script></script>", "" === e.firstChild.innerHTML
}(),
s = n && function () {
var e = n.createElement("div");
return e.innerHTML = "Test: <script type='text/x-placeholder'></script>Value", "Test:" === e.childNodes[0].nodeValue && " Value" === e.childNodes[2].nodeValue
}(),
o = function (n) {
var r;
r = this instanceof o ? this : new e, r.innerHTML = n;
var i = "metamorph-" + t++;
return r.start = i + "-start", r.end = i + "-end", r
};
e.prototype = o.prototype;
var u, a, f, l, c, h, p, d, v;
if (l = function () {
return this.startTag() + this.innerHTML + this.endTag()
}, d = function () {
return "<script id='" + this.start + "' type='text/x-placeholder'></script>"
}, v = function () {
return "<script id='" + this.end + "' type='text/x-placeholder'></script>"
}, r) u = function (e, t) {
var r = n.createRange(),
i = n.getElementById(e.start),
s = n.getElementById(e.end);
return t ? (r.setStartBefore(i), r.setEndAfter(s)) : (r.setStartAfter(i), r.setEndBefore(s)), r
}, a = function (e, t) {
var n = u(this, t);
n.deleteContents();
var r = n.createContextualFragment(e);
n.insertNode(r)
}, f = function () {
var e = u(this, !0);
e.deleteContents()
}, c = function (e) {
var t = n.createRange();
t.setStart(e), t.collapse(!1);
var r = t.createContextualFragment(this.outerHTML());
e.appendChild(r)
}, h = function (e) {
var t = n.createRange(),
r = n.getElementById(this.end);
t.setStartAfter(r), t.setEndAfter(r);
var i = t.createContextualFragment(e);
t.insertNode(i)
}, p = function (e) {
var t = n.createRange(),
r = n.getElementById(this.start);
t.setStartAfter(r), t.setEndAfter(r);
var i = t.createContextualFragment(e);
t.insertNode(i)
};
else {
var m = {
select: [1, "<select multiple='multiple'>", "</select>"],
fieldset: [1, "<fieldset>", "</fieldset>"],
table: [1, "<table>", "</table>"],
tbody: [2, "<table><tbody>", "</tbody></table>"],
tr: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
colgroup: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
map: [1, "<map>", "</map>"],
_default: [0, "", ""]
}, g = function (e, t) {
if (e.getAttribute("id") === t) return e;
var n, r, i, s = e.childNodes.length;
for (n = 0; s > n; n++)
if (r = e.childNodes[n], i = 1 === r.nodeType && g(r, t)) return i
}, y = function (e, t) {
var r = [];
if (s && (t = t.replace(/(\s+)(<script id='([^']+)')/g, function (e, t, n, i) {
return r.push([i, t]), n
})), e.innerHTML = t, r.length > 0) {
var i, o = r.length;
for (i = 0; o > i; i++) {
var u = g(e, r[i][0]),
a = n.createTextNode(r[i][1]);
u.parentNode.insertBefore(a, u)
}
}
}, b = function (e, t) {
var r = m[e.tagName.toLowerCase()] || m._default,
s = r[0],
o = r[1],
u = r[2];
i && (t = "&shy;" + t);
var a = n.createElement("div");
y(a, o + t + u);
for (var f = 0; s >= f; f++) a = a.firstChild;
if (i) {
for (var l = a; 1 === l.nodeType && !l.nodeName;) l = l.firstChild;
3 === l.nodeType && "­" === l.nodeValue.charAt(0) && (l.nodeValue = l.nodeValue.slice(1))
}
return a
}, w = function (e) {
for (;
"" === e.parentNode.tagName;) e = e.parentNode;
return e
}, E = function (e, t) {
e.parentNode !== t.parentNode && t.parentNode.insertBefore(e, t.parentNode.firstChild)
};
a = function (e, t) {
var r, i, s, o = w(n.getElementById(this.start)),
u = n.getElementById(this.end),
a = u.parentNode;
for (E(o, u), r = o.nextSibling; r;) {
if (i = r.nextSibling, s = r === u) {
if (!t) break;
u = r.nextSibling
}
if (r.parentNode.removeChild(r), s) break;
r = i
}
for (r = b(o.parentNode, e); r;) i = r.nextSibling, a.insertBefore(r, u), r = i
}, f = function () {
var e = w(n.getElementById(this.start)),
t = n.getElementById(this.end);
this.html(""), e.parentNode.removeChild(e), t.parentNode.removeChild(t)
}, c = function (e) {
for (var t, n = b(e, this.outerHTML()); n;) t = n.nextSibling, e.appendChild(n), n = t
}, h = function (e) {
var t, r, i = n.getElementById(this.end),
s = i.nextSibling,
o = i.parentNode;
for (r = b(o, e); r;) t = r.nextSibling, o.insertBefore(r, s), r = t
}, p = function (e) {
var t, r, i = n.getElementById(this.start),
s = i.parentNode;
r = b(s, e);
for (var o = i.nextSibling; r;) t = r.nextSibling, s.insertBefore(r, o), r = t
}
}
return o.prototype.html = function (e) {
return this.checkRemoved(), void 0 === e ? this.innerHTML : (a.call(this, e), this.innerHTML = e, void 0)
}, o.prototype.replaceWith = function (e) {
this.checkRemoved(), a.call(this, e, !0)
}, o.prototype.remove = f, o.prototype.outerHTML = l, o.prototype.appendTo = c, o.prototype.after = h, o.prototype.prepend = p, o.prototype.startTag = d, o.prototype.endTag = v, o.prototype.isRemoved = function () {
var e = n.getElementById(this.start),
t = n.getElementById(this.end);
return !e || !t
}, o.prototype.checkRemoved = function () {
if (this.isRemoved()) throw new Error("Cannot perform operations on a Metamorph that is not in the DOM.")
}, o
})
}(),
function () {
function e(e) {
var t = e.hash,
n = e.hashTypes;
for (var r in t) "ID" === n[r] && (t[r + "Binding"] = t[r], n[r + "Binding"] = "STRING", delete t[r], delete n[r])
}
var t = Object.create || function (e) {
function t() {}
return t.prototype = e, new t
}, n = this.Handlebars || Ember.imports && Ember.imports.Handlebars;
n || "function" != typeof require || (n = require("handlebars")), Ember.Handlebars = t(n), Ember.Handlebars.helper = function (t, n) {
Ember.View.detect(n) ? Ember.Handlebars.registerHelper(t, function (t) {
return e(t), Ember.Handlebars.helpers.view.call(this, n, t)
}) : Ember.Handlebars.registerBoundHelper.apply(null, arguments)
}, Ember.Handlebars.helpers = t(n.helpers), Ember.Handlebars.Compiler = function () {}, n.Compiler && (Ember.Handlebars.Compiler.prototype = t(n.Compiler.prototype)), Ember.Handlebars.Compiler.prototype.compiler = Ember.Handlebars.Compiler, Ember.Handlebars.JavaScriptCompiler = function () {}, n.JavaScriptCompiler && (Ember.Handlebars.JavaScriptCompiler.prototype = t(n.JavaScriptCompiler.prototype), Ember.Handlebars.JavaScriptCompiler.prototype.compiler = Ember.Handlebars.JavaScriptCompiler), Ember.Handlebars.JavaScriptCompiler.prototype.namespace = "Ember.Handlebars", Ember.Handlebars.JavaScriptCompiler.prototype.initializeBuffer = function () {
return "''"
}, Ember.Handlebars.JavaScriptCompiler.prototype.appendToBuffer = function (e) {
return "data.buffer.push(" + e + ");"
};
var r = "ember" + +(new Date),
i = 1;
Ember.Handlebars.Compiler.prototype.mustache = function (e) {
if (e.isHelper && "control" === e.id.string) e.hash = e.hash || new n.AST.HashNode([]), e.hash.pairs.push(["controlID", new n.AST.StringNode(r + i++)]);
else if (!e.params.length && !e.hash) {
var t = new n.AST.IdNode(["_triageMustache"]);
e.escaped || (e.hash = e.hash || new n.AST.HashNode([]), e.hash.pairs.push(["unescaped", new n.AST.StringNode("true")])), e = new n.AST.MustacheNode([t].concat([e.id]), e.hash, !e.escaped)
}
return n.Compiler.prototype.mustache.call(this, e)
}, Ember.Handlebars.precompile = function (e) {
var t = n.parse(e),
r = {
knownHelpers: {
action: !0,
unbound: !0,
bindAttr: !0,
template: !0,
view: !0,
_triageMustache: !0
},
data: !0,
stringParams: !0
}, i = (new Ember.Handlebars.Compiler).compile(t, r);
return (new Ember.Handlebars.JavaScriptCompiler).compile(i, r, void 0, !0)
}, n.compile && (Ember.Handlebars.compile = function (e) {
var t = n.parse(e),
r = {
data: !0,
stringParams: !0
}, i = (new Ember.Handlebars.Compiler).compile(t, r),
s = (new Ember.Handlebars.JavaScriptCompiler).compile(i, r, void 0, !0);
return Ember.Handlebars.template(s)
})
}(),
function () {
function e(e, t, n, i) {
var s, o, u, a, f, l, c = n.length,
h = i.data,
p = h.view,
d = i.hash,
v = d.boundOptions;
u = new Ember._SimpleHandlebarsView(null, null, !d.unescaped, h), u.normalizedValue = function () {
var s, o = [];
for (s in v) v.hasOwnProperty(s) && (f = r(e, v[s], h), u.path = f.path, u.pathRoot = f.root, d[s] = Ember._SimpleHandlebarsView.prototype.normalizedValue.call(u));
for (a = 0; c > a; ++a) f = n[a], u.path = f.path, u.pathRoot = f.root, o.push(Ember._SimpleHandlebarsView.prototype.normalizedValue.call(u));
return o.push(i), t.apply(e, o)
}, p.appendChild(u), s = [];
for (o in v) v.hasOwnProperty(o) && s.push(r(e, v[o], h));
for (s = s.concat(n), a = 0, l = s.length; l > a; ++a) f = s[a], p.registerObserver(f.root, f.path, u, u.rerender)
}
function t(e, t, n, r) {
var i, s, o, u, a = [],
f = r.hash,
l = f.boundOptions;
for (u in l) l.hasOwnProperty(u) && (f[u] = Ember.Handlebars.get(e, l[u], r));
for (i = 0, s = n.length; s > i; ++i) o = n[i], a.push(Ember.Handlebars.get(e, o.path, r));
return a.push(r), t.apply(e, a)
}
var n = Array.prototype.slice,
r = Ember.Handlebars.normalizePath = function (e, t, n) {
var r, i, s = n && n.keywords || {};
return r = t.split(".", 1)[0], s.hasOwnProperty(r) && (e = s[r], i = !0, t = t === r ? "" : t.substr(r.length + 1)), {
root: e,
path: t,
isKeyword: i
}
}, i = Ember.Handlebars.get = function (e, t, n) {
var i, s = n && n.data,
o = r(e, t, s);
return e = o.root, t = o.path, i = Ember.get(e, t), void 0 === i && e !== Ember.lookup && Ember.isGlobalPath(t) && (i = Ember.get(Ember.lookup, t)), i
};
Ember.Handlebars.getPath = Ember.deprecateFunc("`Ember.Handlebars.getPath` has been changed to `Ember.Handlebars.get` for consistency.", Ember.Handlebars.get), Ember.Handlebars.resolveParams = function (e, t, n) {
for (var r, s, o = [], u = n.types, a = 0, f = t.length; f > a; a++) r = t[a], s = u[a], "ID" === s ? o.push(i(e, r, n)) : o.push(r);
return o
}, Ember.Handlebars.resolveHash = function (e, t, n) {
var r, s = {}, o = n.hashTypes;
for (var u in t) t.hasOwnProperty(u) && (r = o[u], s[u] = "ID" === r ? i(e, t[u], n) : t[u]);
return s
}, Ember.Handlebars.registerHelper("helperMissing", function (e, t) {
var n, r = "";
throw n = "%@ Handlebars error: Could not find property '%@' on object %@.", t.data && (r = t.data.view), new Ember.Error(Ember.String.fmt(n, [r, e, this]))
}), Ember.Handlebars.registerBoundHelper = function (i, s) {
function o() {
var i, o, f, l, c, h = n.call(arguments, 0, -1),
p = h.length,
d = arguments[arguments.length - 1],
v = [],
m = d.data,
g = d.hash,
y = m.view,
b = d.contexts && d.contexts[0] || this;
g.boundOptions = {};
for (c in g) g.hasOwnProperty(c) && Ember.IS_BINDING.test(c) && "string" == typeof g[c] && (g.boundOptions[c.slice(0, -7)] = g[c]);
for (m.properties = [], l = 0; p > l; ++l) m.properties.push(h[l]), v.push(r(b, h[l], m));
if (m.isUnbound) return t(this, s, v, d);
if (0 === u.length) return e(b, s, v, d);
i = v[0], o = i.root, f = i.path;
var w = new Ember._SimpleHandlebarsView(f, o, !d.hash.unescaped, d.data);
w.normalizedValue = function () {
var e = Ember._SimpleHandlebarsView.prototype.normalizedValue.call(w);
return s.call(y, e, d)
}, y.appendChild(w), y.registerObserver(o, f, w, w.rerender);
for (var E = 0, S = u.length; S > E; E++) y.registerObserver(o, f + "." + u[E], w, w.rerender)
}
var u = n.call(arguments, 2);
o._rawFunction = s, Ember.Handlebars.registerHelper(i, o)
}, Ember.Handlebars.template = function (e) {
var t = Handlebars.template(e);
return t.isTop = !0, t
}
}(),
function () {
Ember.String.htmlSafe = function (e) {
return new Handlebars.SafeString(e)
};
var e = Ember.String.htmlSafe;
(Ember.EXTEND_PROTOTYPES === !0 || Ember.EXTEND_PROTOTYPES.String) && (String.prototype.htmlSafe = function () {
return e(this)
})
}(),
function () {
Ember.Handlebars.resolvePaths = function (e) {
for (var t = [], n = e.contexts, r = e.roots, i = e.data, s = 0, o = n.length; o > s; s++) t.push(Ember.Handlebars.get(r[s], n[s], {
data: i
}));
return t
}
}(),
function () {
function e() {
Ember.run.once(Ember.View, "notifyMutationListeners")
}
Ember.set, Ember.get;
var n = t("metamorph"),
r = {
remove: function (t) {
t.morph.remove(), e()
},
prepend: function (t, n) {
t.morph.prepend(n), e()
},
after: function (t, n) {
t.morph.after(n), e()
},
html: function (t, n) {
t.morph.html(n), e()
},
replace: function (t) {
var n = t.morph;
t.transitionTo("preRender"), Ember.run.schedule("render", this, function () {
if (!t.isDestroying) {
t.clearRenderedChildren();
var r = t.renderToBuffer();
t.invokeRecursively(function (e) {
e.propertyWillChange("element")
}), t.triggerRecursively("willInsertElement"), n.replaceWith(r.string()), t.transitionTo("inDOM"), t.invokeRecursively(function (e) {
e.propertyDidChange("element")
}), t.triggerRecursively("didInsertElement"), e()
}
})
},
empty: function (t) {
t.morph.html(""), e()
}
};
Ember._Metamorph = Ember.Mixin.create({
isVirtual: !0,
tagName: "",
instrumentName: "metamorph",
init: function () {
this._super(), this.morph = n()
},
beforeRender: function (e) {
e.push(this.morph.startTag()), e.pushOpeningTag()
},
afterRender: function (e) {
e.pushClosingTag(), e.push(this.morph.endTag())
},
createElement: function () {
var e = this.renderToBuffer();
this.outerHTML = e.string(), this.clearBuffer()
},
domManager: r
}), Ember._MetamorphView = Ember.View.extend(Ember._Metamorph), Ember._SimpleMetamorphView = Ember.CoreView.extend(Ember._Metamorph)
}(),
function () {
function e(e, t, n, r) {
this.path = e, this.pathRoot = t, this.isEscaped = n, this.templateData = r, this.morph = s(), this.state = "preRender", this.updateId = null
}
var n = Ember.get,
r = Ember.set,
i = Ember.Handlebars.get,
s = t("metamorph");
Ember._SimpleHandlebarsView = e, e.prototype = {
isVirtual: !0,
isView: !0,
destroy: function () {
this.updateId && (Ember.run.cancel(this.updateId), this.updateId = null), this.morph = null
},
propertyWillChange: Ember.K,
propertyDidChange: Ember.K,
normalizedValue: function () {
var e, t, n = this.path,
r = this.pathRoot;
return "" === n ? e = r : (t = this.templateData, e = i(r, n, {
data: t
})), e
},
renderToBuffer: function (e) {
var t = "";
t += this.morph.startTag(), t += this.render(), t += this.morph.endTag(), e.push(t)
},
render: function () {
var e = this.isEscaped,
t = this.normalizedValue();
return null === t || void 0 === t ? t = "" : t instanceof Handlebars.SafeString || (t = String(t)), e && (t = Handlebars.Utils.escapeExpression(t)), t
},
rerender: function () {
switch (this.state) {
case "preRender":
case "destroying":
break;
case "inBuffer":
throw new Ember.Error("Something you did tried to replace an {{expression}} before it was inserted into the DOM.");
case "hasElement":
case "inDOM":
this.updateId = Ember.run.scheduleOnce("render", this, "update")
}
return this
},
update: function () {
this.updateId = null, this.morph.html(this.render())
},
transitionTo: function (e) {
this.state = e
}
};
var o = Ember.View.cloneStates(Ember.View.states),
u = Ember.merge;
u(o._default, {
rerenderIfNeeded: Ember.K
}), u(o.inDOM, {
rerenderIfNeeded: function (e) {
e.normalizedValue() !== e._lastNormalizedValue && e.rerender()
}
}), Ember._HandlebarsBoundView = Ember._MetamorphView.extend({
instrumentName: "boundHandlebars",
states: o,
shouldDisplayFunc: null,
preserveContext: !1,
previousContext: null,
displayTemplate: null,
inverseTemplate: null,
path: null,
pathRoot: null,
normalizedValue: function () {
var e, t, r = n(this, "path"),
s = n(this, "pathRoot"),
o = n(this, "valueNormalizerFunc");
return "" === r ? e = s : (t = n(this, "templateData"), e = i(s, r, {
data: t
})), o ? o(e) : e
},
rerenderIfNeeded: function () {
this.currentState.rerenderIfNeeded(this)
},
render: function (e) {
var t = n(this, "isEscaped"),
i = n(this, "shouldDisplayFunc"),
s = n(this, "preserveContext"),
o = n(this, "previousContext"),
u = n(this, "inverseTemplate"),
a = n(this, "displayTemplate"),
f = this.normalizedValue();
if (this._lastNormalizedValue = f, i(f))
if (r(this, "template", a), s) r(this, "_context", o);
else {
if (!a) return null === f || void 0 === f ? f = "" : f instanceof Handlebars.SafeString || (f = String(f)), t && (f = Handlebars.Utils.escapeExpression(f)), e.push(f), void 0;
r(this, "_context", f)
} else u ? (r(this, "template", u), s ? r(this, "_context", o) : r(this, "_context", f)) : r(this, "template", function () {
return ""
});
return this._super(e)
}
})
}(),
function () {
function e(e) {
return !Ember.isNone(e)
}
function t(e, t, n, r, o, u) {
var a, f, l, c = t.data,
h = t.fn,
p = t.inverse,
d = c.view,
v = this;
if (a = s(v, e, c), "object" == typeof this) {
if (c.insideGroup) {
f = function () {
Ember.run.once(d, "rerender")
};
var m, g, y = i(v, e, t);
y = o(y), g = n ? v : y, r(y) ? m = h : p && (m = p), m(g, {
data: t.data
})
} else {
var b = d.createChildView(Ember._HandlebarsBoundView, {
preserveContext: n,
shouldDisplayFunc: r,
valueNormalizerFunc: o,
displayTemplate: h,
inverseTemplate: p,
path: e,
pathRoot: v,
previousContext: v,
isEscaped: !t.hash.unescaped,
templateData: t.data
});
d.appendChild(b), f = function () {
Ember.run.scheduleOnce("render", b, "rerenderIfNeeded")
}
} if ("" !== a.path && (d.registerObserver(a.root, a.path, f), u))
for (l = 0; u.length > l; l++) d.registerObserver(a.root, a.path + "." + u[l], f)
} else c.buffer.push(i(v, e, t))
}
function n(e, t) {
var n, r, o = t.data,
u = o.view,
a = this;
if (n = s(a, e, o), "object" == typeof this) {
if (o.insideGroup) {
r = function () {
Ember.run.once(u, "rerender")
};
var f = i(a, e, t);
(null === f || void 0 === f) && (f = ""), o.buffer.push(f)
} else {
var l = new Ember._SimpleHandlebarsView(e, a, !t.hash.unescaped, t.data);
l._parentView = u, u.appendChild(l), r = function () {
Ember.run.scheduleOnce("render", l, "rerender")
}
}
"" !== n.path && u.registerObserver(n.root, n.path, r)
} else o.buffer.push(i(a, e, t))
}
var r = Ember.get;
Ember.set, Ember.String.fmt;
var i = Ember.Handlebars.get,
s = Ember.Handlebars.normalizePath,
o = Ember.ArrayPolyfills.forEach,
u = Ember.Handlebars,
a = u.helpers;
u.registerHelper("_triageMustache", function (e, t) {
return a[e] ? a[e].call(this, t) : a.bind.apply(this, arguments)
}), u.registerHelper("bind", function (r, i) {
var s = i.contexts && i.contexts[0] || this;
return i.fn ? t.call(s, r, i, !1, e) : n.call(s, r, i)
}), u.registerHelper("boundIf", function (e, n) {
var i = n.contexts && n.contexts[0] || this,
s = function (e) {
var t = e && r(e, "isTruthy");
return "boolean" == typeof t ? t : Ember.isArray(e) ? 0 !== r(e, "length") : !! e
};
return t.call(i, e, n, !0, s, s, ["isTruthy", "length"])
}), u.registerHelper("with", function (n, r) {
if (4 === arguments.length) {
var i, o, u, f;
if (r = arguments[3], i = arguments[2], o = arguments[0], Ember.isGlobalPath(o)) Ember.bind(r.data.keywords, i, o);
else {
f = s(this, o, r.data), o = f.path, u = f.root;
var l = Ember.$.expando + Ember.guidFor(u);
r.data.keywords[l] = u;
var c = o ? l + "." + o : l;
Ember.bind(r.data.keywords, i, c)
}
return t.call(this, o, r, !0, e)
}
return a.bind.call(r.contexts[0], n, r)
}), u.registerHelper("if", function (e, t) {
return a.boundIf.call(t.contexts[0], e, t)
}), u.registerHelper("unless", function (e, t) {
var n = t.fn,
r = t.inverse;
return t.fn = r, t.inverse = n, a.boundIf.call(t.contexts[0], e, t)
}), u.registerHelper("bindAttr", function (e) {
var t = e.hash,
n = e.data.view,
r = [],
a = this,
f = ++Ember.uuid,
l = t["class"];
if (null !== l && void 0 !== l) {
var c = u.bindClasses(this, l, n, f, e);
r.push('class="' + Handlebars.Utils.escapeExpression(c.join(" ")) + '"'), delete t["class"]
}
var h = Ember.keys(t);
return o.call(h, function (o) {
var u, l = t[o];
u = s(a, l, e.data);
var c, h, p = "this" === l ? u.root : i(a, l, e),
d = Ember.typeOf(p);
c = function () {
var r = i(a, l, e),
s = n.$("[data-bindattr-" + f + "='" + f + "']");
return s && 0 !== s.length ? (Ember.View.applyAttributeBindings(s, o, r), void 0) : (Ember.removeObserver(u.root, u.path, h), void 0)
}, "this" === l || u.isKeyword && "" === u.path || n.registerObserver(u.root, u.path, c), "string" === d || "number" === d && !isNaN(p) ? r.push(o + '="' + Handlebars.Utils.escapeExpression(p) + '"') : p && "boolean" === d && r.push(o + '="' + o + '"')
}, this), r.push("data-bindattr-" + f + '="' + f + '"'), new u.SafeString(r.join(" "))
}), u.bindClasses = function (e, t, n, r, u) {
var a, f, l, c = [],
h = function (e, t, n) {
var r, s = t.path;
return r = "this" === s ? e : "" === s ? !0 : i(e, s, n), Ember.View._classStringForValue(s, r, t.className, t.falsyClassName)
};
return o.call(t.split(" "), function (t) {
var i, o, p, d, v = Ember.View._parsePropertyPath(t),
g = v.path,
y = e;
"" !== g && "this" !== g && (d = s(e, g, u.data), y = d.root, g = d.path), o = function () {
a = h(e, v, u), l = r ? n.$("[data-bindattr-" + r + "='" + r + "']") : n.$(), l && 0 !== l.length ? (i && l.removeClass(i), a ? (l.addClass(a), i = a) : i = null) : Ember.removeObserver(y, g, p)
}, "" !== g && "this" !== g && n.registerObserver(y, g, o), f = h(e, v, u), f && (c.push(f), i = f)
}), c
}
}(),
function () {
Ember.get, Ember.set;
var e = Ember.Handlebars;
e.ViewHelper = Ember.Object.create({
propertiesFromHTMLOptions: function (e) {
var t = e.hash,
n = e.data,
r = {}, i = t["class"],
s = !1;
t.id && (r.elementId = t.id, s = !0), t.tag && (r.tagName = t.tag, s = !0), i && (i = i.split(" "), r.classNames = i, s = !0), t.classBinding && (r.classNameBindings = t.classBinding.split(" "), s = !0), t.classNameBindings && (void 0 === r.classNameBindings &&
(r.classNameBindings = []), r.classNameBindings = r.classNameBindings.concat(t.classNameBindings.split(" ")), s = !0), t.attributeBindings && (r.attributeBindings = null, s = !0), s && (t = Ember.$.extend({}, t), delete t.id, delete t.tag, delete t["class"], delete t.classBinding);
var o;
for (var u in t) t.hasOwnProperty(u) && Ember.IS_BINDING.test(u) && "string" == typeof t[u] && (o = this.contextualizeBindingPath(t[u], n), o && (t[u] = o));
if (r.classNameBindings)
for (var a in r.classNameBindings) {
var f = r.classNameBindings[a];
if ("string" == typeof f) {
var l = Ember.View._parsePropertyPath(f);
o = this.contextualizeBindingPath(l.path, n), o && (r.classNameBindings[a] = o + l.classNames)
}
}
return Ember.$.extend(t, r)
},
contextualizeBindingPath: function (e, t) {
var n = Ember.Handlebars.normalizePath(null, e, t);
return n.isKeyword ? "templateData.keywords." + e : Ember.isGlobalPath(e) ? null : "this" === e ? "_parentView.context" : "_parentView.context." + e
},
helper: function (t, n, r) {
var i, s = r.data,
o = r.fn;
i = "string" == typeof n ? e.get(t, n, r) : n;
var u = this.propertiesFromHTMLOptions(r, t),
a = s.view;
u.templateData = s;
var f = i.proto ? i.proto() : i;
o && (u.template = o), f.controller || f.controllerBinding || u.controller || u.controllerBinding || (u._context = t), a.appendChild(i, u)
}
}), e.registerHelper("view", function (t, n) {
return t && t.data && t.data.isRenderData && (n = t, t = "Ember.View"), e.ViewHelper.helper(this, t, n)
})
}(),
function () {
var e = Ember.get,
t = Ember.Handlebars.get;
Ember.String.fmt, Ember.Handlebars.registerHelper("collection", function (n, r) {
n && n.data && n.data.isRenderData && (r = n, n = void 0);
var i = r.fn,
s = r.data,
o = r.inverse;
r.data.view;
var u;
u = n ? t(this, n, r) : Ember.CollectionView;
var a, f, l = r.hash,
c = {}, h = l.itemViewClass,
p = u.proto();
delete l.itemViewClass, f = h ? t(p, h, r) : p.itemViewClass;
for (var d in l) l.hasOwnProperty(d) && (a = d.match(/^item(.)(.*)$/), a && "itemController" !== d && (c[a[1].toLowerCase() + a[2]] = l[d], delete l[d]));
i && (c.template = i, delete r.fn);
var v;
o && o !== Handlebars.VM.noop ? (v = e(p, "emptyViewClass"), v = v.extend({
template: o,
tagName: c.tagName
})) : l.emptyViewClass && (v = t(this, l.emptyViewClass, r)), v && (l.emptyView = v), l.keyword || (c._context = Ember.computed.alias("content"));
var m = Ember.Handlebars.ViewHelper.propertiesFromHTMLOptions({
data: s,
hash: c
}, this);
return l.itemViewClass = f.extend(m), Ember.Handlebars.helpers.view.call(this, u, r)
})
}(),
function () {
var e = Ember.Handlebars.get;
Ember.Handlebars.registerHelper("unbound", function (t, n) {
var r, i, s, o = arguments[arguments.length - 1];
return arguments.length > 2 ? (o.data.isUnbound = !0, r = Ember.Handlebars.helpers[arguments[0]] || Ember.Handlebars.helperMissing, s = r.apply(this, Array.prototype.slice.call(arguments, 1)), delete o.data.isUnbound, s) : (i = n.contexts && n.contexts[0] || this, e(i, t, n))
})
}(),
function () {
var e = Ember.Handlebars.get,
t = Ember.Handlebars.normalizePath;
Ember.Handlebars.registerHelper("log", function (n, r) {
var i = r.contexts && r.contexts[0] || this,
s = t(i, n, r.data),
o = s.root,
u = s.path,
a = "this" === u ? o : e(o, u, r);
Ember.Logger.log(a)
}), Ember.Handlebars.registerHelper("debugger", function () {})
}(),
function () {
var e = Ember.get,
t = Ember.set;
Ember.Handlebars.EachView = Ember.CollectionView.extend(Ember._Metamorph, {
init: function () {
var n, r = e(this, "itemController");
if (r) {
var i = Ember.ArrayController.create();
t(i, "itemController", r), t(i, "container", e(this, "controller.container")), t(i, "_eachView", this), t(i, "target", e(this, "controller")), t(i, "parentController", e(this, "controller")), this.disableContentObservers(function () {
t(this, "content", i), n = (new Ember.Binding("content", "_eachView.dataSource")).oneWay(), n.connect(i)
}), t(this, "_arrayController", i)
} else this.disableContentObservers(function () {
n = (new Ember.Binding("content", "dataSource")).oneWay(), n.connect(this)
});
return this._super()
},
disableContentObservers: function (e) {
Ember.removeBeforeObserver(this, "content", null, "_contentWillChange"), Ember.removeObserver(this, "content", null, "_contentDidChange"), e.call(this), Ember.addBeforeObserver(this, "content", null, "_contentWillChange"), Ember.addObserver(this, "content", null, "_contentDidChange")
},
itemViewClass: Ember._MetamorphView,
emptyViewClass: Ember._MetamorphView,
createChildView: function (n, r) {
n = this._super(n, r);
var i = e(this, "keyword"),
s = e(n, "content");
if (i) {
var o = e(n, "templateData");
o = Ember.copy(o), o.keywords = n.cloneKeywords(), t(n, "templateData", o), o.keywords[i] = s
}
return s && e(s, "isController") && t(n, "controller", s), n
},
destroy: function () {
if (this._super()) {
var t = e(this, "_arrayController");
return t && t.destroy(), this
}
}
});
var n = Ember.Handlebars.GroupedEach = function (e, t, n) {
var r = this,
i = Ember.Handlebars.normalizePath(e, t, n.data);
this.context = e, this.path = t, this.options = n, this.template = n.fn, this.containingView = n.data.view, this.normalizedRoot = i.root, this.normalizedPath = i.path, this.content = this.lookupContent(), this.addContentObservers(), this.addArrayObservers(), this.containingView.on("willClearRender", function () {
r.destroy()
})
};
n.prototype = {
contentWillChange: function () {
this.removeArrayObservers()
},
contentDidChange: function () {
this.content = this.lookupContent(), this.addArrayObservers(), this.rerenderContainingView()
},
contentArrayWillChange: Ember.K,
contentArrayDidChange: function () {
this.rerenderContainingView()
},
lookupContent: function () {
return Ember.Handlebars.get(this.normalizedRoot, this.normalizedPath, this.options)
},
addArrayObservers: function () {
this.content.addArrayObserver(this, {
willChange: "contentArrayWillChange",
didChange: "contentArrayDidChange"
})
},
removeArrayObservers: function () {
this.content.removeArrayObserver(this, {
willChange: "contentArrayWillChange",
didChange: "contentArrayDidChange"
})
},
addContentObservers: function () {
Ember.addBeforeObserver(this.normalizedRoot, this.normalizedPath, this, this.contentWillChange), Ember.addObserver(this.normalizedRoot, this.normalizedPath, this, this.contentDidChange)
},
removeContentObservers: function () {
Ember.removeBeforeObserver(this.normalizedRoot, this.normalizedPath, this.contentWillChange), Ember.removeObserver(this.normalizedRoot, this.normalizedPath, this.contentDidChange)
},
render: function () {
var t = this.content,
n = e(t, "length"),
r = this.options.data,
i = this.template;
r.insideEach = !0;
for (var s = 0; n > s; s++) i(t.objectAt(s), {
data: r
})
},
rerenderContainingView: function () {
Ember.run.scheduleOnce("render", this.containingView, "rerender")
},
destroy: function () {
this.removeContentObservers(), this.removeArrayObservers()
}
}, Ember.Handlebars.registerHelper("each", function (e, t) {
if (4 === arguments.length) {
var n = arguments[0];
t = arguments[3], e = arguments[2], "" === e && (e = "this"), t.hash.keyword = n
}
return t.hash.dataSourceBinding = e, !t.data.insideGroup || t.hash.groupedRows || t.hash.itemViewClass ? Ember.Handlebars.helpers.collection.call(this, "Ember.Handlebars.EachView", t) : ((new Ember.Handlebars.GroupedEach(this, e, t)).render(), void 0)
})
}(),
function () {
Ember.Handlebars.registerHelper("template", function (e, t) {
var n = t.data.view,
r = n.templateForName(e);
r(this, {
data: t.data
})
})
}(),
function () {
Ember.Handlebars.registerHelper("partial", function (e, t) {
var n = e.split("/"),
r = n[n.length - 1];
n[n.length - 1] = "_" + r;
var i = t.data.view,
s = n.join("/"),
o = i.templateForName(s),
u = i.templateForName(e);
o = o || u, o(this, {
data: t.data
})
})
}(),
function () {
var e = Ember.get;
Ember.set, Ember.Handlebars.registerHelper("yield", function (t) {
for (var n, r = t.data.view; r && !e(r, "layout");) r = e(r, "parentView");
n = e(r, "template"), n && n(this, t)
})
}(),
function () {
var e = Ember.set;
Ember.get, Ember.Checkbox = Ember.View.extend({
classNames: ["ember-checkbox"],
tagName: "input",
attributeBindings: ["type", "checked", "disabled", "tabindex", "name"],
type: "checkbox",
checked: !1,
disabled: !1,
init: function () {
this._super(), this.on("change", this, this._updateElementValue)
},
_updateElementValue: function () {
e(this, "checked", this.$().prop("checked"))
}
})
}(),
function () {
var e = (Ember.get, Ember.set);
Ember.TextSupport = Ember.Mixin.create({
value: "",
attributeBindings: ["placeholder", "disabled", "maxlength", "tabindex"],
placeholder: null,
disabled: !1,
maxlength: null,
insertNewline: Ember.K,
cancel: Ember.K,
init: function () {
this._super(), this.on("focusOut", this, this._elementValueDidChange), this.on("change", this, this._elementValueDidChange), this.on("paste", this, this._elementValueDidChange), this.on("cut", this, this._elementValueDidChange), this.on("input", this, this._elementValueDidChange), this.on("keyUp", this, this.interpretKeyEvents)
},
interpretKeyEvents: function (e) {
var t = Ember.TextSupport.KEY_EVENTS,
n = t[e.keyCode];
return this._elementValueDidChange(), n ? this[n](e) : void 0
},
_elementValueDidChange: function () {
e(this, "value", this.$().val())
}
}), Ember.TextSupport.KEY_EVENTS = {
13: "insertNewline",
27: "cancel"
}
}(),
function () {
function e(e, n, r) {
var i = t(n, "action"),
s = t(n, "onEvent");
if (i && s === e) {
var o = t(n, "controller"),
u = t(n, "value"),
a = t(n, "bubbles");
o.send(i, u, n), a || r.stopPropagation()
}
}
var t = Ember.get;
Ember.set, Ember.TextField = Ember.View.extend(Ember.TextSupport, {
classNames: ["ember-text-field"],
tagName: "input",
attributeBindings: ["type", "value", "size", "pattern", "name"],
value: "",
type: "text",
size: null,
pattern: null,
action: null,
onEvent: "enter",
bubbles: !1,
insertNewline: function (t) {
e("enter", this, t)
},
keyPress: function (t) {
e("keyPress", this, t)
}
})
}(),
function () {
var e = Ember.get,
t = Ember.set;
Ember.Button = Ember.View.extend(Ember.TargetActionSupport, {
classNames: ["ember-button"],
classNameBindings: ["isActive"],
tagName: "button",
propagateEvents: !1,
attributeBindings: ["type", "disabled", "href", "tabindex"],
targetObject: Ember.computed(function () {
var t = e(this, "target"),
n = e(this, "context"),
r = e(this, "templateData");
return "string" != typeof t ? t : Ember.Handlebars.get(n, t, {
data: r
})
}).property("target"),
type: Ember.computed(function () {
var e = this.tagName;
return "input" === e || "button" === e ? "button" : void 0
}),
disabled: !1,
href: Ember.computed(function () {
return "a" === this.tagName ? "#" : null
}),
mouseDown: function () {
return e(this, "disabled") || (t(this, "isActive", !0), this._mouseDown = !0, this._mouseEntered = !0), e(this, "propagateEvents")
},
mouseLeave: function () {
this._mouseDown && (t(this, "isActive", !1), this._mouseEntered = !1)
},
mouseEnter: function () {
this._mouseDown && (t(this, "isActive", !0), this._mouseEntered = !0)
},
mouseUp: function () {
return e(this, "isActive") && (this.triggerAction(), t(this, "isActive", !1)), this._mouseDown = !1, this._mouseEntered = !1, e(this, "propagateEvents")
},
keyDown: function (e) {
(13 === e.keyCode || 32 === e.keyCode) && this.mouseDown()
},
keyUp: function (e) {
(13 === e.keyCode || 32 === e.keyCode) && this.mouseUp()
},
touchStart: function (e) {
return this.mouseDown(e)
},
touchEnd: function (e) {
return this.mouseUp(e)
},
init: function () {
this._super()
}
})
}(),
function () {
var e = Ember.get;
Ember.set, Ember.TextArea = Ember.View.extend(Ember.TextSupport, {
classNames: ["ember-text-area"],
tagName: "textarea",
attributeBindings: ["rows", "cols", "name"],
rows: null,
cols: null,
_updateElementValue: Ember.observer(function () {
var t = e(this, "value"),
n = this.$();
n && t !== n.val() && n.val(t)
}, "value"),
init: function () {
this._super(), this.on("didInsertElement", this, this._updateElementValue)
}
})
}(),
function () {
var e = Ember.set,
t = Ember.get,
n = Ember.EnumerableUtils.indexOf,
r = Ember.EnumerableUtils.indexesOf,
i = Ember.EnumerableUtils.replace,
s = Ember.isArray;
Ember.Handlebars.compile, Ember.SelectOption = Ember.View.extend({
tagName: "option",
attributeBindings: ["value", "selected"],
defaultTemplate: function (e, t) {
t = {
data: t.data,
hash: {}
}, Ember.Handlebars.helpers.bind.call(e, "view.label", t)
},
init: function () {
this.labelPathDidChange(), this.valuePathDidChange(), this._super()
},
selected: Ember.computed(function () {
var e = t(this, "content"),
r = t(this, "parentView.selection");
return t(this, "parentView.multiple") ? r && n(r, e.valueOf()) > -1 : e == r
}).property("content", "parentView.selection"),
labelPathDidChange: Ember.observer(function () {
var e = t(this, "parentView.optionLabelPath");
e && Ember.defineProperty(this, "label", Ember.computed(function () {
return t(this, e)
}).property(e))
}, "parentView.optionLabelPath"),
valuePathDidChange: Ember.observer(function () {
var e = t(this, "parentView.optionValuePath");
e && Ember.defineProperty(this, "value", Ember.computed(function () {
return t(this, e)
}).property(e))
}, "parentView.optionValuePath")
}), Ember.Select = Ember.View.extend({
tagName: "select",
classNames: ["ember-select"],
defaultTemplate: Ember.Handlebars.template(function (e, t, n, r, i) {
function s(e, t) {
var r, i = "";
return t.buffer.push('<option value="">'), r = {}, t.buffer.push(l(n._triageMustache.call(e, "view.prompt", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: r,
data: t
}))), t.buffer.push("</option>"), i
}
function o(e, t) {
var r;
r = {
contentBinding: "STRING"
}, t.buffer.push(l(n.view.call(e, "view.optionView", {
hash: {
contentBinding: "this"
},
contexts: [e],
types: ["ID"],
hashTypes: r,
data: t
})))
}
this.compilerInfo = [2, ">= 1.0.0-rc.3"], n = n || Ember.Handlebars.helpers, i = i || {};
var u, a, f = "",
l = this.escapeExpression,
c = this;
return a = {}, u = n["if"].call(t, "view.prompt", {
hash: {},
inverse: c.noop,
fn: c.program(1, s, i),
contexts: [t],
types: ["ID"],
hashTypes: a,
data: i
}), (u || 0 === u) && i.buffer.push(u), a = {}, u = n.each.call(t, "view.content", {
hash: {},
inverse: c.noop,
fn: c.program(3, o, i),
contexts: [t],
types: ["ID"],
hashTypes: a,
data: i
}), (u || 0 === u) && i.buffer.push(u), f
}),
attributeBindings: ["multiple", "disabled", "tabindex", "name"],
multiple: !1,
disabled: !1,
content: null,
selection: null,
value: Ember.computed(function (e, n) {
if (2 === arguments.length) return n;
var r = t(this, "optionValuePath").replace(/^content\.?/, "");
return r ? t(this, "selection." + r) : t(this, "selection")
}).property("selection"),
prompt: null,
optionLabelPath: "content",
optionValuePath: "content",
optionView: Ember.SelectOption,
_change: function () {
t(this, "multiple") ? this._changeMultiple() : this._changeSingle()
},
selectionDidChange: Ember.observer(function () {
var n = t(this, "selection");
if (t(this, "multiple")) {
if (!s(n)) return e(this, "selection", Ember.A([n])), void 0;
this._selectionDidChangeMultiple()
} else this._selectionDidChangeSingle()
}, "selection.@each"),
valueDidChange: Ember.observer(function () {
var e, n = t(this, "content"),
r = t(this, "value"),
i = t(this, "optionValuePath").replace(/^content\.?/, ""),
s = i ? t(this, "selection." + i) : t(this, "selection");
r !== s && (e = n ? n.find(function (e) {
return r === (i ? t(e, i) : e)
}) : null, this.set("selection", e))
}, "value"),
_triggerChange: function () {
var e = t(this, "selection"),
n = t(this, "value");
e && this.selectionDidChange(), n && this.valueDidChange(), this._change()
},
_changeSingle: function () {
var n = this.$()[0].selectedIndex,
r = t(this, "content"),
i = t(this, "prompt");
if (r && t(r, "length")) {
if (i && 0 === n) return e(this, "selection", null), void 0;
i && (n -= 1), e(this, "selection", r.objectAt(n))
}
},
_changeMultiple: function () {
var n = this.$("option:selected"),
r = t(this, "prompt"),
u = r ? 1 : 0,
a = t(this, "content"),
f = t(this, "selection");
if (a && n) {
var l = n.map(function () {
return this.index - u
}).toArray(),
c = a.objectsAt(l);
s(f) ? i(f, 0, t(f, "length"), c) : e(this, "selection", c)
}
},
_selectionDidChangeSingle: function () {
var e = this.get("element");
if (e) {
var r = t(this, "content"),
i = t(this, "selection"),
s = r ? n(r, i) : -1,
o = t(this, "prompt");
o && (s += 1), e && (e.selectedIndex = s)
}
},
_selectionDidChangeMultiple: function () {
var e, i = t(this, "content"),
s = t(this, "selection"),
o = i ? r(i, s) : [-1],
u = t(this, "prompt"),
a = u ? 1 : 0,
f = this.$("option");
f && f.each(function () {
e = this.index > -1 ? this.index - a : -1, this.selected = n(o, e) > -1
})
},
init: function () {
this._super(), this.on("didInsertElement", this, this._triggerChange), this.on("change", this, this._change)
}
})
}(),
function () {
function e(e, t) {
for (var n in e) "ID" === t[n] && (e[n + "Binding"] = e[n], delete e[n])
}
Ember.Handlebars.registerHelper("input", function (t) {
var n = t.hash,
r = t.hashTypes,
i = n.type,
s = n.on;
return delete n.type, delete n.on, e(n, r), "checkbox" === i ? Ember.Handlebars.helpers.view.call(this, Ember.Checkbox, t) : (n.type = i || "text", n.onEvent = s || "enter", Ember.Handlebars.helpers.view.call(this, Ember.TextField, t))
}), Ember.Handlebars.registerHelper("textarea", function (t) {
var n = t.hash,
r = t.hashTypes;
return e(n, r), Ember.Handlebars.helpers.view.call(this, Ember.TextArea, t)
})
}(),
function () {
function e() {
Ember.Handlebars.bootstrap(Ember.$(document))
}
Ember.Handlebars.bootstrap = function (e) {
var t = 'script[type="text/x-handlebars"], script[type="text/x-raw-handlebars"]';
Ember.$(t, e).each(function () {
var e = Ember.$(this),
t = "text/x-raw-handlebars" === e.attr("type") ? Ember.$.proxy(Handlebars.compile, Handlebars) : Ember.$.proxy(Ember.Handlebars.compile, Ember.Handlebars),
n = e.attr("data-template-name") || e.attr("id") || "application",
r = t(e.html());
Ember.TEMPLATES[n] = r, e.remove()
})
}, Ember.onLoad("application", e)
}(),
function () {
Ember.runLoadHooks("Ember.Handlebars", Ember.Handlebars)
}(),
function () {
e("route-recognizer", [], function () {
"use strict";
function e(e) {
this.string = e
}
function t(e) {
this.name = e
}
function n(e) {
this.name = e
}
function r() {}
function i(i, s, o) {
"/" === i.charAt(0) && (i = i.substr(1));
for (var u = i.split("/"), a = [], f = 0, l = u.length; l > f; f++) {
var c, h = u[f];
(c = h.match(/^:([^\/]+)$/)) ? (a.push(new t(c[1])), s.push(c[1]), o.dynamics++) : (c = h.match(/^\*([^\/]+)$/)) ? (a.push(new n(c[1])), s.push(c[1]), o.stars++) : "" === h ? a.push(new r) : (a.push(new e(h)), o.statics++)
}
return a
}
function s(e) {
this.charSpec = e, this.nextStates = []
}
function o(e) {
return e.sort(function (e, t) {
return e.types.stars !== t.types.stars ? e.types.stars - t.types.stars : e.types.dynamics !== t.types.dynamics ? e.types.dynamics - t.types.dynamics : e.types.statics !== t.types.statics ? e.types.statics - t.types.statics : 0
})
}
function u(e, t) {
for (var n = [], r = 0, i = e.length; i > r; r++) {
var s = e[r];
n = n.concat(s.match(t))
}
return n
}
function a(e, t) {
for (var n = e.handlers, r = e.regex, i = t.match(r), s = 1, o = [], u = 0, a = n.length; a > u; u++) {
for (var f = n[u], l = f.names, c = {}, h = 0, p = l.length; p > h; h++) c[l[h]] = i[s++];
o.push({
handler: f.handler,
params: c,
isDynamic: !! l.length
})
}
return o
}
function f(e, t) {
return t.eachChar(function (t) {
e = e.put(t)
}), e
}
function l(e, t, n) {
this.path = e, this.matcher = t, this.delegate = n
}
function c(e) {
this.routes = {}, this.children = {}, this.target = e
}
function h(e, t, n) {
return function (r, i) {
var s = e + r;
return i ? (i(h(s, t, n)), void 0) : new l(e + r, t, n)
}
}
function p(e, t, n) {
for (var r = 0, i = 0, s = e.length; s > i; i++) r += e[i].path.length;
t = t.substr(r), e.push({
path: t,
handler: n
})
}
function d(e, t, n, r) {
var i = t.routes;
for (var s in i)
if (i.hasOwnProperty(s)) {
var o = e.slice();
p(o, s, i[s]), t.children[s] ? d(o, t.children[s], n, r) : n.call(r, o)
}
}
var v = ["/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\"],
m = new RegExp("(\\" + v.join("|\\") + ")", "g");
e.prototype = {
eachChar: function (e) {
for (var t, n = this.string, r = 0, i = n.length; i > r; r++) t = n.charAt(r), e({
validChars: t
})
},
regex: function () {
return this.string.replace(m, "\\$1")
},
generate: function () {
return this.string
}
}, t.prototype = {
eachChar: function (e) {
e({
invalidChars: "/",
repeat: !0
})
},
regex: function () {
return "([^/]+)"
},
generate: function (e) {
return e[this.name]
}
}, n.prototype = {
eachChar: function (e) {
e({
invalidChars: "",
repeat: !0
})
},
regex: function () {
return "(.+)"
},
generate: function (e) {
return e[this.name]
}
}, r.prototype = {
eachChar: function () {},
regex: function () {
return ""
},
generate: function () {
return ""
}
}, s.prototype = {
get: function (e) {
for (var t = this.nextStates, n = 0, r = t.length; r > n; n++) {
var i = t[n],
s = i.charSpec.validChars === e.validChars;
if (s = s && i.charSpec.invalidChars === e.invalidChars) return i
}
},
put: function (e) {
var t;
return (t = this.get(e)) ? t : (t = new s(e), this.nextStates.push(t), e.repeat && t.nextStates.push(t), t)
},
match: function (e) {
for (var t, n, r, i = this.nextStates, s = [], o = 0, u = i.length; u > o; o++) t = i[o], n = t.charSpec, "undefined" != typeof (r = n.validChars) ? -1 !== r.indexOf(e) && s.push(t) : "undefined" != typeof (r = n.invalidChars) && -1 === r.indexOf(e) && s.push(t);
return s
}
};
var g = function () {
this.rootState = new s, this.names = {}
};
return g.prototype = {
add: function (e, t) {
for (var n, s = this.rootState, o = "^", u = {
statics: 0,
dynamics: 0,
stars: 0
}, a = [], l = [], c = !0, h = 0, p = e.length; p > h; h++) {
var d = e[h],
v = [],
m = i(d.path, v, u);
l = l.concat(m);
for (var g = 0, y = m.length; y > g; g++) {
var b = m[g];
b instanceof r || (c = !1, s = s.put({
validChars: "/"
}), o += "/", s = f(s, b), o += b.regex())
}
a.push({
handler: d.handler,
names: v
})
}
c && (s = s.put({
validChars: "/"
}), o += "/"), s.handlers = a, s.regex = new RegExp(o + "$"), s.types = u, (n = t && t.as) && (this.names[n] = {
segments: l,
handlers: a
})
},
handlersFor: function (e) {
var t = this.names[e],
n = [];
if (!t) throw new Error("There is no route named " + e);
for (var r = 0, i = t.handlers.length; i > r; r++) n.push(t.handlers[r]);
return n
},
hasRoute: function (e) {
return !!this.names[e]
},
generate: function (e, t) {
var n = this.names[e],
i = "";
if (!n) throw new Error("There is no route named " + e);
for (var s = n.segments, o = 0, u = s.length; u > o; o++) {
var a = s[o];
a instanceof r || (i += "/", i += a.generate(t))
}
return "/" !== i.charAt(0) && (i = "/" + i), i
},
recognize: function (e) {
var t, n, r, i = [this.rootState];
for ("/" !== e.charAt(0) && (e = "/" + e), t = e.length, t > 1 && "/" === e.charAt(t - 1) && (e = e.substr(0, t - 1)), n = 0, r = e.length; r > n && (i = u(i, e.charAt(n)), i.length); n++);
var s = [];
for (n = 0, r = i.length; r > n; n++) i[n].handlers && s.push(i[n]);
i = o(s);
var f = s[0];
return f && f.handlers ? a(f, e) : void 0
}
}, l.prototype = {
to: function (e, t) {
var n = this.delegate;
if (n && n.willAddRoute && (e = n.willAddRoute(this.matcher.target, e)), this.matcher.add(this.path, e), t) {
if (0 === t.length) throw new Error("You must have an argument in the function passed to `to`");
this.matcher.addChild(this.path, e, t, this.delegate)
}
}
}, c.prototype = {
add: function (e, t) {
this.routes[e] = t
},
addChild: function (e, t, n, r) {
var i = new c(t);
this.children[e] = i;
var s = h(e, i, r);
r && r.contextEntered && r.contextEntered(t, s), n(s)
}
}, g.prototype.map = function (e, t) {
var n = new c;
e(h("", n, this.delegate)), d([], n, function (e) {
t ? t(this, e) : this.add(e)
}, this)
}, g
})
}(),
function () {
e("router", ["route-recognizer"], function (e) {
"use strict";
function t() {
this.recognizer = new e
}
function n(e, t) {
for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n])
}
function r(e) {
if (!e.isLoading) {
e.isLoading = !0;
var t = e.getHandler("loading");
t && (t.enter && t.enter(), t.setup && t.setup())
}
}
function i(e) {
e.isLoading = !1;
var t = e.getHandler("loading");
t && t.exit && t.exit()
}
function s(e, t) {
i(e);
var n = e.getHandler("failure");
n && (n.enter && n.enter(), n.setup && n.setup(t))
}
function o(e, t, n, r) {
var i = e._paramsForHandler(t, r, !0),
s = i.params,
o = i.toSetup,
u = e.recognizer.generate(t, s);
n.call(e, u), a(e, o)
}
function u(e, t, n, o) {
function f(r) {
v.context !== g && h(v, g);
var i = o.concat([{
context: r,
name: d.handler,
handler: e.getHandler(d.handler),
isDynamic: d.isDynamic
}
]);
u(e, t, n + 1, i)
}
if (t.length === n) {
var l = o[o.length - 1],
c = l && l.handler;
if (!c || !c.additionalHandler) return i(e), a(e, o), void 0;
var p = {
handler: c.additionalHandler(),
params: {},
isDynamic: !1
};
t.push(p)
}
var d = t[n],
v = e.getHandler(d.handler),
g = v.deserialize && v.deserialize(d.params);
g && "function" == typeof g.then ? (r(e), g.then(f).then(null, function (t) {
s(e, t)
})) : f(g)
}
function a(e, t) {
var n = l(e.currentHandlerInfos || [], t);
e.targetHandlerInfos = t, f(n.exited, function (e) {
delete e.context, e.exit && e.exit()
});
var r = n.unchanged.slice();
e.currentHandlerInfos = r, f(n.updatedContext, function (e, t, n) {
h(e, t), e.setup && e.setup(t), r.push(n)
});
var i = !1;
f(n.entered, function (e, t, n) {
i || (e.enter && e.enter(), h(e, t), e.setup && !1 === e.setup(t) && (i = !0), i || r.push(n))
}), !i && e.didTransition && e.didTransition(t)
}
function f(e, t) {
for (var n = 0, r = e.length; r > n; n++) {
var i = e[n],
s = i.handler,
o = i.context;
t(s, o, i)
}
}
function l(e, t) {
var n, r, i, s, o = {
updatedContext: [],
exited: [],
entered: [],
unchanged: []
};
for (i = 0, s = t.length; s > i; i++) {
var u = e[i],
a = t[i];
u && u.handler === a.handler || (n = !0), n ? (o.entered.push(a), u && o.exited.unshift(u)) : r || u.context !== a.context ? (r = !0, o.updatedContext.push(a)) : o.unchanged.push(u)
}
for (i = t.length, s = e.length; s > i; i++) o.exited.unshift(e[i]);
return o
}
function c(e, t) {
var n = e.currentHandlerInfos,
r = t.shift();
if (!n) throw new Error("Could not trigger event '" + r + "'. There are no active handlers");
for (var i = !1, s = n.length - 1; s >= 0; s--) {
var o = n[s],
u = o.handler;
if (u.events && u.events[r]) {
if (u.events[r].apply(u, t) !== !0) return;
i = !0
}
}
if (!i) throw new Error("Nothing handled the event '" + r + "'.")
}
function h(e, t) {
e.context = t, e.contextDidChange && e.contextDidChange()
}
return t.prototype = {
map: function (e) {
this.recognizer.delegate = this.delegate, this.recognizer.map(e, function (e, t) {
var n = t[t.length - 1].handler,
r = [t, {
as: n
}
];
e.add.apply(e, r)
})
},
hasRoute: function (e) {
return this.recognizer.hasRoute(e)
},
handleURL: function (e) {
var t = this.recognizer.recognize(e);
if (!t) throw new Error("No route matched the URL '" + e + "'");
u(this, t, 0, [])
},
updateURL: function () {
throw "updateURL is not implemented"
},
replaceURL: function (e) {
this.updateURL(e)
},
transitionTo: function (e) {
var t = Array.prototype.slice.call(arguments, 1);
o(this, e, this.updateURL, t)
},
replaceWith: function (e) {
var t = Array.prototype.slice.call(arguments, 1);
o(this, e, this.replaceURL, t)
},
paramsForHandler: function (e) {
var t = this._paramsForHandler(e, [].slice.call(arguments, 1));
return t.params
},
generate: function (e) {
var t = this.paramsForHandler.apply(this, arguments);
return this.recognizer.generate(e, t)
},
_paramsForHandler: function (e, t, r) {
var i, s, o, u, a, f, l = this.recognizer.handlersFor(e),
c = {}, p = [],
d = l.length,
v = t.length;
for (f = l.length - 1; f >= 0 && v > 0; f--) l[f].names.length && (v--, d = f);
if (v > 0) throw "More context objects were passed than there are dynamic segments for the route: " + e;
for (f = 0; l.length > f; f++)
if (o = l[f], u = this.getHandler(o.handler), a = o.names, s = !1, a.length ? (f >= d ? (i = t.shift(), s = !0) : i = u.context, u.serialize && n(c, u.serialize(i, a))) : r && (f > d || !u.hasOwnProperty("context") ? u.deserialize && (i = u.deserialize({}), s = !0) : i = u.context), r && s && h(u, i), p.push({
isDynamic: !! o.names.length,
name: o.handler,
handler: u,
context: i
}), f === l.length - 1) {
var g, y = p[p.length - 1];
(g = y.handler.additionalHandler) && l.push({
handler: g.call(y.handler),
names: []
})
}
return {
params: c,
toSetup: p
}
},
isActive: function (e) {
for (var t, n, r = [].slice.call(arguments, 1), i = this.targetHandlerInfos, s = !1, o = i.length - 1; o >= 0; o--)
if (n = i[o], n.name === e && (s = !0), s) {
if (0 === r.length) break;
if (n.isDynamic && (t = r.pop(), n.context !== t)) return !1
}
return 0 === r.length && s
},
trigger: function () {
var e = [].slice.call(arguments);
c(this, e)
}
}, t
})
}(),
function () {
function e(e) {
this.parent = e, this.matches = []
}
e.prototype = {
resource: function (t, n, r) {
if (2 === arguments.length && "function" == typeof n && (r = n, n = {}), 1 === arguments.length && (n = {}), "string" != typeof n.path && (n.path = "/" + t), r) {
var i = new e(t);
r.call(i), this.push(n.path, t, i.generate())
} else this.push(n.path, t)
},
push: function (e, t, n) {
var r = t.split(".");
("" === e || "/" === e || "index" === r[r.length - 1]) && (this.explicitIndex = !0), this.matches.push([e, t, n])
},
route: function (e, t) {
t = t || {}, "string" != typeof t.path && (t.path = "/" + e), this.parent && "application" !== this.parent && (e = this.parent + "." + e), this.push(t.path, e)
},
generate: function () {
var e = this.matches;
return this.explicitIndex || this.route("index", {
path: "/"
}),
function (t) {
for (var n = 0, r = e.length; r > n; n++) {
var i = e[n];
t(i[0]).to(i[1], i[2])
}
}
}
}, e.map = function (t) {
var n = new e;
return t.call(n), n
}, Ember.RouterDSL = e
}(),
function () {
Ember.controllerFor = function (e, t, n, r) {
return e.lookup("controller:" + t, r) || Ember.generateController(e, t, n)
}, Ember.generateController = function (e, t, n) {
var r, i, s;
return n && Ember.isArray(n) ? (i = e.resolve("controller:array"), r = i.extend({
content: n
})) : n ? (i = e.resolve("controller:object"), r = i.extend({
content: n
})) : (i = e.resolve("controller:basic"), r = i.extend()), r.toString = function () {
return "(generated " + t + " controller)"
}, s = "controller:" + t, e.register(s, r), e.lookup(s)
}
}(),
function () {
function e(e) {
var t = u(e, "location"),
n = u(e, "rootURL"),
r = {};
"string" == typeof n && (r.rootURL = n), "string" == typeof t && (r.implementation = t, t = a(e, "location", Ember.Location.create(r)))
}
function n(e) {
var t = {}, n = e.container,
r = n.resolve("route:basic");
return function (i) {
var s = "route:" + i,
o = n.lookup(s);
if (t[i]) return o;
if (t[i] = !0, !o) {
if ("loading" === i) return {};
if ("failure" === i) return e.constructor.defaultFailureHandler;
n.register(s, r.extend()), o = n.lookup(s)
}
return "application" === i && (o.events = o.events || {}, o.events.routeTo = o.events.routeTo || Ember.TransitionEvent.defaultHandler), o.routeName = i, o
}
}
function r(e) {
for (var t = [], n = 1, r = e.length; r > n; n++) {
var i = e[n].name,
s = i.split(".");
t.push(s[s.length - 1])
}
return t.join(".")
}
function i(e, t, r) {
var i;
t.getHandler = n(e);
var s = function () {
r.setURL(i)
};
if (t.updateURL = function (e) {
i = e, Ember.run.once(s)
}, r.replaceURL) {
var o = function () {
r.replaceURL(i)
};
t.replaceURL = function (e) {
i = e, Ember.run.once(o)
}
}
t.didTransition = function (t) {
e.didTransition(t)
}
}
function s(e, t, n) {
var r, i = n[0];
r = e.router.hasRoute(n[0]) ? i : n[0] = i + ".index", e.router[t].apply(e.router, n), e.notifyPropertyChange("url")
}
var o = t("router"),
u = Ember.get,
a = Ember.set,
f = Ember._MetamorphView;
Ember.Router = Ember.Object.extend({
location: "hash",
init: function () {
this.router = this.constructor.router, this._activeViews = {}, e(this)
},
url: Ember.computed(function () {
return u(this, "location").getURL()
}),
startRouting: function () {
this.router = this.router || this.constructor.map(Ember.K);
var e = this.router,
t = u(this, "location"),
n = this.container,
r = this;
i(this, e, t), n.register("view:default", f), n.register("view:toplevel", Ember.View.extend()), t.onUpdateURL(function (e) {
r.handleURL(e)
}), this.handleURL(t.getURL())
},
didTransition: function (e) {
var t = this.container.lookup("controller:application"),
n = r(e);
a(t, "currentPath", n), this.notifyPropertyChange("url"), u(this, "namespace").LOG_TRANSITIONS && Ember.Logger.log("Transitioned into '" + n + "'")
},
handleURL: function (e) {
this.router.handleURL(e), this.notifyPropertyChange("url")
},
routeTo: function (e) {
var t = this.router.currentHandlerInfos;
t && (e.sourceRoute = t[t.length - 1].handler), this.send("routeTo", e)
},
transitionTo: function () {
var e = [].slice.call(arguments);
s(this, "transitionTo", e)
},
replaceWith: function () {
var e = [].slice.call(arguments);
s(this, "replaceWith", e)
},
generate: function () {
var e = this.router.generate.apply(this.router, arguments);
return this.location.formatURL(e)
},
isActive: function () {
var e = this.router;
return e.isActive.apply(e, arguments)
},
send: function () {
this.router.trigger.apply(this.router, arguments)
},
hasRoute: function (e) {
return this.router.hasRoute(e)
},
_lookupActiveView: function (e) {
var t = this._activeViews[e];
return t && t[0]
},
_connectActiveView: function (e, t) {
var n = this._activeViews[e];
n && n[0].off("willDestroyElement", this, n[1]);
var r = function () {
delete this._activeViews[e]
};
this._activeViews[e] = [t, r], t.one("willDestroyElement", this, r)
}
}), Ember.Router.reopenClass({
defaultFailureHandler: {
setup: function (e) {
Ember.Logger.error("Error while loading route:", e), setTimeout(function () {
throw e
})
}
}
}), Ember.Router.reopenClass({
map: function (e) {
var t = this.router = new o,
n = Ember.RouterDSL.map(function () {
this.resource("application", {
path: "/"
}, function () {
e.call(this)
})
});
return t.map(n.generate()), t
}
})
}(),
function () {
function e(e) {
for (var t, n, r = e.router.router.targetHandlerInfos, i = 0, s = r.length; s > i; i++) {
if (n = r[i].handler, n === e) return t;
t = n
}
}
function t(n) {
var r, i = e(n);
if (i) return (r = i.lastRenderedTemplate) ? r : t(i, !0)
}
function n(e, n, r, i) {
i = i || {}, i.into = i.into ? i.into.replace(/\//g, ".") : t(e), i.outlet = i.outlet || "main", i.name = n, i.template = r;
var s, o = i.controller;
return o = i.controller ? i.controller : (s = e.container.lookup("controller:" + n)) ? s : e.routeName, "string" == typeof o && (o = e.container.lookup("controller:" + o)), i.controller = o, i
}
function r(e, t, n) {
var r = n.into ? "view:default" : "view:toplevel";
return e = e || t.lookup(r), a(e, "templateName") || (f(e, "template", n.template), f(e, "_debugTemplateName", n.name)), f(e, "renderedName", n.name), f(e, "controller", n.controller), e
}
function i(e, t, n) {
if (n.into) {
var r = e.router._lookupActiveView(n.into);
e.teardownView = o(r, n.outlet), r.connectOutlet(n.outlet, t)
} else {
var i = a(e, "router.namespace.rootElement");
e.teardownView && e.teardownView(), e.router._connectActiveView(n.name, t), e.teardownView = s(t), t.appendTo(i)
}
}
function s(e) {
return function () {
e.destroy()
}
}
function o(e, t) {
return function () {
e.disconnectOutlet(t)
}
}
function u(e) {
e.teardownView && e.teardownView(), delete e.teardownView, delete e.lastRenderedTemplate
}
var a = Ember.get,
f = Ember.set,
l = Ember.String.classify;
Ember.String.fmt, Ember.Route = Ember.Object.extend({
exit: function () {
this.deactivate(), u(this)
},
enter: function () {
this.activate()
},
events: null,
deactivate: Ember.K,
activate: Ember.K,
routeTo: function (e) {
this.router.routeTo(e)
},
transitionTo: function () {
var e = this.router;
if (!e.isActive.apply(e, arguments)) return this._checkingRedirect && (this._redirected[this._redirectDepth] = !0), e.transitionTo.apply(e, arguments)
},
replaceWith: function () {
var e = this.router;
if (!e.isActive.apply(e, arguments)) return this._checkingRedirect && (this._redirected[this._redirectDepth] = !0), this.router.replaceWith.apply(this.router, arguments)
},
send: function () {
return this.router.send.apply(this.router, arguments)
},
_redirectDepth: 0,
setup: function (e) {
var t;
this._redirected || (t = !0, this._redirected = []), this._checkingRedirect = !0;
var n = ++this._redirectDepth;
void 0 === e ? this.redirect() : this.redirect(e), this._redirectDepth--, this._checkingRedirect = !1;
var r = this._redirected;
if (t && (this._redirected = null), r[n]) return !1;
var i = this.controllerFor(this.routeName, e);
i && (this.controller = i, f(i, "model", e)), this.setupControllers ? this.setupControllers(i, e) : this.setupController(i, e), this.renderTemplates ? this.renderTemplates(e) : this.renderTemplate(i, e)
},
redirect: Ember.K,
deserialize: function (e) {
var t = this.model(e);
return this.currentModel = t
},
contextDidChange: function () {
this.currentModel = this.context
},
model: function (e) {
var t, n, r, i;
for (var s in e)(t = s.match(/^(.*)_id$/)) && (n = t[1], i = e[s]), r = !0;
if (!n && r) return e;
if (n) {
var o = l(n),
u = this.router.namespace,
a = u[o];
return a.find(i)
}
},
serialize: function (e, t) {
if (1 === t.length) {
var n = t[0],
r = {};
return r[n] = /_id$/.test(n) ? a(e, "id") : e, r
}
},
setupController: Ember.K,
controllerFor: function (e, t) {
var n = this.router.container,
r = n.lookup("controller:" + e);
return r || (t = t || this.modelFor(e), r = Ember.generateController(n, e, t)), r
},
modelFor: function (
e) {
var t = this.container.lookup("route:" + e);
return t && t.currentModel
},
renderTemplate: function () {
this.render()
},
render: function (e, t) {
"object" != typeof e || t || (t = e, e = this.routeName), e = e ? e.replace(/\//g, ".") : this.routeName;
var s = this.container,
o = s.lookup("view:" + e),
u = s.lookup("template:" + e);
(o || u) && (t = n(this, e, u, t), o = r(o, s, t), "main" === t.outlet && (this.lastRenderedTemplate = e), i(this, o, t))
},
willDestroy: function () {
u(this)
}
})
}(),
function () {
Ember.TransitionEvent = Ember.Object.extend({
transitionMethod: "transitionTo",
destinationRouteName: null,
sourceRoute: null,
contexts: null,
init: function () {
this._super(), this.contexts = this.contexts || []
},
transitionToArgs: function () {
return [this.destinationRouteName].concat(this.contexts)
}
}), Ember.TransitionEvent.reopenClass({
defaultHandler: function (e) {
var t = this.router;
t[e.transitionMethod].apply(t, e.transitionToArgs())
}
})
}(),
function () {
Ember.onLoad("Ember.Handlebars", function () {
function e(e, i, s) {
function o(e, t) {
return "controller" === i[t] ? e : Ember.ControllerMixin.detect(e) ? o(r(e, "model")) : e
}
var u = t(e, i, s);
return n.call(u, o)
}
var t = Ember.Handlebars.resolveParams,
n = Ember.ArrayPolyfills.map,
r = Ember.get;
Ember.Router.resolveParams = e
})
}(),
function () {
var e = Ember.get;
Ember.set, Ember.String.fmt, Ember.onLoad("Ember.Handlebars", function () {
function t(e, t) {
return e.hasRoute(t) || (t += ".index"), t
}
function n(e) {
var t = e.options.types.slice(1),
n = e.options.data;
return i(e.context, e.params, {
types: t,
data: n
})
}
function r(e, r, i) {
var s, o = i || e.namedRoute;
s = t(r, o);
var u = [s];
return u.concat(n(e.parameters))
}
var i = Ember.Router.resolveParams,
s = Ember.ViewUtils.isSimpleClick,
o = Ember.LinkView = Ember.View.extend({
tagName: "a",
namedRoute: null,
currentWhen: null,
title: null,
activeClass: "active",
disabledClass: "disabled",
_isDisabled: !1,
replace: !1,
attributeBindings: ["href", "title"],
classNameBindings: ["active", "disabled"],
concreteView: Ember.computed(function () {
return e(this, "parentView")
}).property("parentView"),
disabled: Ember.computed(function (e, t) {
return void 0 !== t && this.set("_isDisabled", t), t ? this.get("disabledClass") : !1
}),
active: Ember.computed(function () {
var t = this.get("router"),
r = n(this.parameters),
i = this.currentWhen + ".index",
s = t.isActive.apply(t, [this.currentWhen].concat(r)) || t.isActive.apply(t, [i].concat(r));
return s ? e(this, "activeClass") : void 0
}).property("namedRoute", "router.url"),
router: Ember.computed(function () {
return this.get("controller").container.lookup("router:main")
}),
click: function (t) {
if (!s(t)) return !0;
if (t.preventDefault(), this.bubbles === !1 && t.stopPropagation(), e(this, "_isDisabled")) return !1;
var n = this.get("router");
if (Ember.ENV.ENABLE_ROUTE_TO) {
var i = r(this, n);
n.routeTo(Ember.TransitionEvent.create({
transitionMethod: this.get("replace") ? "replaceWith" : "transitionTo",
destinationRouteName: i[0],
contexts: i.slice(1)
}))
} else this.get("replace") ? n.replaceWith.apply(n, r(this, n)) : n.transitionTo.apply(n, r(this, n))
},
href: Ember.computed(function () {
if ("a" !== this.get("tagName")) return !1;
var e = this.get("router");
return e.generate.apply(e, r(this, e))
})
});
o.toString = function () {
return "LinkView"
}, Ember.Handlebars.registerHelper("linkTo", function (e) {
var t = [].slice.call(arguments, -1)[0],
n = [].slice.call(arguments, 1, -1),
r = t.hash;
return r.namedRoute = e, r.currentWhen = r.currentWhen || e, r.disabledBinding = r.disabledWhen, r.parameters = {
context: this,
options: t,
params: n
}, Ember.Handlebars.helpers.view.call(this, o, t)
})
})
}(),
function () {
Ember.get, Ember.set, Ember.onLoad("Ember.Handlebars", function (e) {
e.OutletView = Ember.ContainerView.extend(Ember._Metamorph), e.registerHelper("outlet", function (t, n) {
var r;
for (t && t.data && t.data.isRenderData && (n = t, t = "main"), r = n.data.view; !r.get("template.isTop");) r = r.get("_parentView");
return n.data.view.set("outletSource", r), n.hash.currentViewBinding = "_view.outletSource._outlets." + t, e.helpers.view.call(this, e.OutletView, n)
})
})
}(),
function () {
Ember.get, Ember.set, Ember.onLoad("Ember.Handlebars", function () {
Ember.Handlebars.registerHelper("render", function (e, t, n) {
var r, i, s, o, u, a;
2 === arguments.length && (n = t, t = void 0), "string" == typeof t && (u = Ember.Handlebars.get(n.contexts[1], t, n), a = {
singleton: !1
}), e = e.replace(/\//g, "."), r = n.data.keywords.controller.container, i = r.lookup("router:main"), o = r.lookup("view:" + e) || r.lookup("view:default"), s = (s = n.hash.controller) ? r.lookup("controller:" + s, a) : Ember.controllerFor(r, e, u, a), s && u && s.set("model", u);
var f = n.contexts[1];
f && o.registerObserver(f, t, function () {
s.set("model", Ember.Handlebars.get(f, t, n))
}), s.set("target", n.data.keywords.controller), n.hash.viewName = Ember.String.camelize(e), n.hash.template = r.lookup("template:" + e), n.hash.controller = s, i && !u && i._connectActiveView(e, o), Ember.Handlebars.helpers.view.call(this, o, n)
})
})
}(),
function () {
Ember.onLoad("Ember.Handlebars", function () {
function e(e, n) {
var r = [];
n && r.push(n);
var i = e.options.types.slice(1),
s = e.options.data;
return r.concat(t(e.context, e.params, {
types: i,
data: s
}))
}
var t = Ember.Router.resolveParams,
n = Ember.ViewUtils.isSimpleClick,
r = Ember.Handlebars,
i = r.get,
s = r.SafeString,
o = Ember.ArrayPolyfills.forEach,
u = (Ember.get, Array.prototype.slice),
a = r.ActionHelper = {
registeredActions: {}
}, f = ["alt", "shift", "meta", "ctrl"],
l = function (e, t) {
if ("undefined" == typeof t) return n(e);
var r = !0;
return o.call(f, function (n) {
e[n + "Key"] && -1 === t.indexOf(n) && (r = !1)
}), r
};
a.registerAction = function (t, n, r) {
var s = (++Ember.uuid).toString();
return a.registeredActions[s] = {
eventName: n.eventName,
handler: function (s) {
if (!l(s, r)) return !0;
s.preventDefault(), n.bubbles === !1 && s.stopPropagation();
var o = n.target;
o = o.target ? i(o.root, o.target, o.options) : o.root, Ember.run(function () {
o.send ? o.send.apply(o, e(n.parameters, t)) : o[t].apply(o, e(n.parameters))
})
}
}, n.view.on("willClearRender", function () {
delete a.registeredActions[s]
}), s
}, r.registerHelper("action", function (e) {
var t, n = arguments[arguments.length - 1],
r = u.call(arguments, 1, -1),
i = n.hash,
o = {
eventName: i.on || "click"
};
o.parameters = {
context: this,
options: n,
params: r
}, o.view = n.data.view;
var f, l;
i.target ? (f = this, l = i.target) : (t = n.data.keywords.controller) && (f = t), o.target = {
root: f,
target: l,
options: n
}, o.bubbles = i.bubbles;
var c = a.registerAction(e, o, i.allowedKeys);
return new s('data-ember-action="' + c + '"')
})
})
}(),
function () {
if (Ember.ENV.EXPERIMENTAL_CONTROL_HELPER) {
var e = Ember.get,
t = Ember.set;
Ember.Handlebars.registerHelper("control", function (n, r, i) {
function s() {
var e = Ember.Handlebars.get(this, r, i);
t(d, "model", e), p.rerender()
}
2 === arguments.length && (i = r, r = void 0);
var o;
r && (o = Ember.Handlebars.get(this, r, i));
var u, a, f = i.data.keywords.controller,
l = (i.data.keywords.view, e(f, "_childContainers")),
c = i.hash.controlID;
l.hasOwnProperty(c) ? a = l[c] : (u = e(f, "container"), a = u.child(), l[c] = a);
var h = n.replace(/\//g, "."),
p = a.lookup("view:" + h) || a.lookup("view:default"),
d = a.lookup("controller:" + h),
v = a.lookup("template:" + n);
t(d, "target", f), t(d, "model", o), i.hash.template = v, i.hash.controller = d, Ember.addObserver(this, r, s), p.one("willDestroyElement", this, function () {
Ember.removeObserver(this, r, s)
}), Ember.Handlebars.helpers.view.call(this, p, i)
})
}
}(),
function () {
var e = Ember.get;
Ember.set, Ember.ControllerMixin.reopen({
transitionToRoute: function () {
var t = e(this, "target"),
n = t.transitionToRoute || t.transitionTo;
return n.apply(t, arguments)
},
transitionTo: function () {
return this.transitionToRoute.apply(this, arguments)
},
replaceRoute: function () {
var t = e(this, "target"),
n = t.replaceRoute || t.replaceWith;
return n.apply(t, arguments)
},
replaceWith: function () {
return this.replaceRoute.apply(this, arguments)
}
})
}(),
function () {
var e = Ember.get,
t = Ember.set;
Ember.View.reopen({
init: function () {
t(this, "_outlets", {}), this._super()
},
connectOutlet: function (n, r) {
var i = e(this, "_outlets"),
s = e(this, "container"),
o = s && s.lookup("router:main"),
u = e(r, "renderedName");
t(i, n, r), o && u && o._connectActiveView(u, r)
},
disconnectOutlet: function (n) {
var r = e(this, "_outlets");
t(r, n, null)
}
})
}(),
function () {
Ember.get, Ember.set, Ember.Location = {
create: function (e) {
var t = e && e.implementation,
n = this.implementations[t];
return n.create.apply(n, arguments)
},
registerImplementation: function (e, t) {
this.implementations[e] = t
},
implementations: {}
}
}(),
function () {
var e = Ember.get,
t = Ember.set;
Ember.NoneLocation = Ember.Object.extend({
path: "",
getURL: function () {
return e(this, "path")
},
setURL: function (e) {
t(this, "path", e)
},
onUpdateURL: function (e) {
this.updateCallback = e
},
handleURL: function (e) {
t(this, "path", e), this.updateCallback(e)
},
formatURL: function (e) {
return e
}
}), Ember.Location.registerImplementation("none", Ember.NoneLocation)
}(),
function () {
var e = Ember.get,
t = Ember.set;
Ember.HashLocation = Ember.Object.extend({
init: function () {
t(this, "location", e(this, "location") || window.location)
},
getURL: function () {
return e(this, "location").hash.substr(1)
},
setURL: function (n) {
e(this, "location").hash = n, t(this, "lastSetURL", n)
},
onUpdateURL: function (n) {
var r = this,
i = Ember.guidFor(this);
Ember.$(window).on("hashchange.ember-location-" + i, function () {
Ember.run(function () {
var i = location.hash.substr(1);
e(r, "lastSetURL") !== i && (t(r, "lastSetURL", null), n(i))
})
})
},
formatURL: function (e) {
return "#" + e
},
willDestroy: function () {
var e = Ember.guidFor(this);
Ember.$(window).unbind("hashchange.ember-location-" + e)
}
}), Ember.Location.registerImplementation("hash", Ember.HashLocation)
}(),
function () {
var e = Ember.get,
t = Ember.set,
n = !1;
Ember.HistoryLocation = Ember.Object.extend({
init: function () {
t(this, "location", e(this, "location") || window.location), this.initState()
},
initState: function () {
t(this, "history", e(this, "history") || window.history), this.replaceState(this.formatURL(this.getURL()))
},
rootURL: "/",
getURL: function () {
var t = e(this, "rootURL"),
n = e(this, "location").pathname;
return t = t.replace(/\/$/, ""), n = n.replace(t, "")
},
setURL: function (e) {
e = this.formatURL(e), this.getState() && this.getState().path !== e && this.pushState(e)
},
replaceURL: function (e) {
e = this.formatURL(e), this.getState() && this.getState().path !== e && this.replaceState(e)
},
getState: function () {
return e(this, "history").state
},
pushState: function (t) {
e(this, "history").pushState({
path: t
}, null, t), this._previousURL = this.getURL()
},
replaceState: function (t) {
e(this, "history").replaceState({
path: t
}, null, t), this._previousURL = this.getURL()
},
onUpdateURL: function (e) {
var t = Ember.guidFor(this),
i = this;
Ember.$(window).on("popstate.ember-location-" + t, function () {
(n || (n = !0, i.getURL() !== i._previousURL)) && e(i.getURL())
})
},
formatURL: function (t) {
var n = e(this, "rootURL");
return "" !== t && (n = n.replace(/\/$/, "")), n + t
},
willDestroy: function () {
var e = Ember.guidFor(this);
Ember.$(window).unbind("popstate.ember-location-" + e)
}
}), Ember.Location.registerImplementation("history", Ember.HistoryLocation)
}(),
function () {
function e(t, n, r, i) {
var s, o = t.name,
u = t.incoming,
a = t.incomingNames,
f = a.length;
if (r || (r = {}), i || (i = []), !r.hasOwnProperty(o)) {
for (i.push(o), r[o] = !0, s = 0; f > s; s++) e(u[a[s]], n, r, i);
n(t, i), i.pop()
}
}
function t() {
this.names = [], this.vertices = {}
}
t.prototype.add = function (e) {
if (e) {
if (this.vertices.hasOwnProperty(e)) return this.vertices[e];
var t = {
name: e,
incoming: {},
incomingNames: [],
hasOutgoing: !1,
value: null
};
return this.vertices[e] = t, this.names.push(e), t
}
}, t.prototype.map = function (e, t) {
this.add(e).value = t
}, t.prototype.addEdge = function (t, n) {
function r(e, t) {
if (e.name === n) throw new Error("cycle detected: " + n + " <- " + t.join(" <- "))
}
if (t && n && t !== n) {
var i = this.add(t),
s = this.add(n);
s.incoming.hasOwnProperty(t) || (e(i, r), i.hasOutgoing = !0, s.incoming[t] = i, s.incomingNames.push(t))
}
}, t.prototype.topsort = function (t) {
var n, r, i = {}, s = this.vertices,
o = this.names,
u = o.length;
for (n = 0; u > n; n++) r = s[o[n]], r.hasOutgoing || e(r, t, i)
}, t.prototype.addEdges = function (e, t, n, r) {
var i;
if (this.map(e, t), n)
if ("string" == typeof n) this.addEdge(e, n);
else
for (i = 0; n.length > i; i++) this.addEdge(e, n[i]);
if (r)
if ("string" == typeof r) this.addEdge(r, e);
else
for (i = 0; r.length > i; i++) this.addEdge(r[i], e)
}, Ember.DAG = t
}(),
function () {
var e = Ember.get,
t = Ember.String.classify,
n = Ember.String.capitalize,
r = Ember.String.decamelize;
Ember.DefaultResolver = Ember.Object.extend({
namespace: null,
resolve: function (e) {
var t = this.parseName(e),
n = this[t.resolveMethodName];
if (n) {
var r = n.call(this, t);
if (r) return r
}
return this.resolveOther(t)
},
parseName: function (r) {
var i = r.split(":"),
s = i[0],
o = i[1],
u = o,
a = e(this, "namespace"),
f = a;
if ("template" !== s && -1 !== u.indexOf("/")) {
var l = u.split("/");
u = l[l.length - 1];
var c = n(l.slice(0, -1).join("."));
f = Ember.Namespace.byName(c)
}
return {
fullName: r,
type: s,
fullNameWithoutType: o,
name: u,
root: f,
resolveMethodName: "resolve" + t(s)
}
},
resolveTemplate: function (e) {
var t = e.fullNameWithoutType.replace(/\./g, "/");
return Ember.TEMPLATES[t] ? Ember.TEMPLATES[t] : (t = r(t), Ember.TEMPLATES[t] ? Ember.TEMPLATES[t] : void 0)
},
useRouterNaming: function (e) {
e.name = e.name.replace(/\./g, "_"), "basic" === e.name && (e.name = "")
},
resolveController: function (e) {
return this.useRouterNaming(e), this.resolveOther(e)
},
resolveRoute: function (e) {
return this.useRouterNaming(e), this.resolveOther(e)
},
resolveView: function (e) {
return this.useRouterNaming(e), this.resolveOther(e)
},
resolveOther: function (n) {
var r = t(n.name) + t(n.type),
i = e(n.root, r);
return i ? i : void 0
}
})
}(),
function () {
function e(e) {
this._container = e
}
function t(e) {
var t = e.get("resolver") || Ember.DefaultResolver,
n = t.create({
namespace: e
});
return function (e) {
return n.resolve(e)
}
}
function n(e) {
var t = e.split(":"),
n = t[0],
r = t[1];
if ("template" !== n) {
var i = r;
return i.indexOf(".") > -1 && (i = i.replace(/\.(.)/g, function (e) {
return e.charAt(1).toUpperCase()
})), r.indexOf("_") > -1 && (i = i.replace(/_(.)/g, function (e) {
return e.charAt(1).toUpperCase()
})), n + ":" + i
}
return e
}
var r = Ember.get,
i = Ember.set;
e.deprecate = function (e) {
return function () {
var t = this._container;
return t[e].apply(t, arguments)
}
}, e.prototype = {
_container: null,
lookup: e.deprecate("lookup"),
resolve: e.deprecate("resolve"),
register: e.deprecate("register")
};
var s = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin, {
rootElement: "body",
eventDispatcher: null,
customEvents: null,
_readinessDeferrals: 1,
init: function () {
this.$ || (this.$ = Ember.$), this.__container__ = this.buildContainer(), this.Router = this.Router || this.defaultRouter(), this.Router && (this.Router.namespace = this), this._super(), this.scheduleInitialize(), Ember.LOG_VERSION && (Ember.LOG_VERSION = !1)
},
buildContainer: function () {
var e = this.__container__ = s.buildContainer(this);
return e
},
defaultRouter: function () {
return void 0 === this.router ? Ember.Router.extend() : void 0
},
scheduleInitialize: function () {
var e = this;
!this.$ || this.$.isReady ? Ember.run.schedule("actions", e, "_initialize") : this.$().ready(function () {
Ember.run(e, "_initialize")
})
},
deferReadiness: function () {
this._readinessDeferrals++
},
advanceReadiness: function () {
this._readinessDeferrals--, 0 === this._readinessDeferrals && Ember.run.once(this, this.didBecomeReady)
},
register: function () {
var e = this.__container__;
e.register.apply(e, arguments)
},
inject: function () {
var e = this.__container__;
e.injection.apply(e, arguments)
},
initialize: function () {},
_initialize: function () {
return this.isDestroyed ? void 0 : (this.register("router:main", this.Router), this.runInitializers(), Ember.runLoadHooks("application", this), this.advanceReadiness(), this)
},
reset: function () {
Ember.run(this, function () {
Ember.run(this.__container__, "destroy"), this.buildContainer(), this._readinessDeferrals = 1, Ember.run.schedule("actions", this, function () {
this._initialize(), this.startRouting()
})
})
},
runInitializers: function () {
var e, t, n = r(this.constructor, "initializers"),
i = this.__container__,
s = new Ember.DAG,
o = this;
for (e = 0; n.length > e; e++) t = n[e], s.addEdges(t.name, t.initialize, t.before, t.after);
s.topsort(function (e) {
var t = e.value;
t(i, o)
})
},
didBecomeReady: function () {
this.setupEventDispatcher(), this.ready(), this.startRouting(), Ember.testing || (Ember.Namespace.processAll(), Ember.BOOTED = !0), this.resolve(this)
},
setupEventDispatcher: function () {
var e = r(this, "customEvents"),
t = r(this, "rootElement"),
n = this.__container__.lookup("event_dispatcher:main");
i(this, "eventDispatcher", n), n.setup(e, t)
},
startRouting: function () {
var e = this.__container__.lookup("router:main");
e && e.startRouting()
},
handleURL: function (e) {
var t = this.__container__.lookup("router:main");
t.handleURL(e)
},
ready: Ember.K,
resolver: null,
willDestroy: function () {
Ember.BOOTED = !1, this.__container__.destroy()
},
initializer: function (e) {
this.constructor.initializer(e)
}
});
Ember.Application.reopenClass({
concatenatedProperties: ["initializers"],
initializers: Ember.A(),
initializer: function (e) {
var t = r(this, "initializers");
t.push(e)
},
buildContainer: function (r) {
var i = new Ember.Container;
return Ember.Container.defaultContainer = new e(i), i.set = Ember.set, i.normalize = n, i.resolver = t(r), i.optionsForType("view", {
singleton: !1
}), i.optionsForType("template", {
instantiate: !1
}), i.register("application:main", r, {
instantiate: !1
}), i.register("controller:basic", Ember.Controller, {
instantiate: !1
}), i.register("controller:object", Ember.ObjectController, {
instantiate: !1
}), i.register("controller:array", Ember.ArrayController, {
instantiate: !1
}), i.register("route:basic", Ember.Route, {
instantiate: !1
}), i.register("event_dispatcher:main", Ember.EventDispatcher), i.injection("router:main", "namespace", "application:main"), i.injection("controller", "target", "router:main"), i.injection("controller", "namespace", "application:main"), i.injection("route", "router", "router:main"), i
}
}), Ember.runLoadHooks("Ember.Application", Ember.Application)
}(),
function () {
function e(e) {
for (var n, r = t(e, "needs"), i = t(e, "container"), s = !0, o = 0, u = r.length; u > o; o++) n = r[o], -1 === n.indexOf(":") && (n = "controller:" + n), i.has(n) || (s = !1);
return s
}
var t = Ember.get;
Ember.set;
var n = Ember.Object.extend({
controller: null,
unknownProperty: function (e) {
for (var n, r = t(this, "controller"), i = t(r, "needs"), s = r.get("container"), o = 0, u = i.length; u > o; o++)
if (n = i[o], n === e) return s.lookup("controller:" + e)
}
});
Ember.ControllerMixin.reopen({
concatenatedProperties: ["needs"],
needs: [],
init: function () {
this._super.apply(this, arguments), !e(this)
},
controllerFor: function (e) {
var n = t(this, "container");
return n.lookup("controller:" + e)
},
controllers: Ember.computed(function () {
return n.create({
controller: this
})
})
})
}(),
function () {
var e = Ember.get,
t = Ember.set;
Ember.State = Ember.Object.extend(Ember.Evented, {
isState: !0,
parentState: null,
start: null,
name: null,
path: Ember.computed(function () {
var t = e(this, "parentState.path"),
n = e(this, "name");
return t && (n = t + "." + n), n
}),
trigger: function (e) {
this[e] && this[e].apply(this, [].slice.call(arguments, 1)), this._super.apply(this, arguments)
},
init: function () {
var n = e(this, "states");
t(this, "childStates", Ember.A()), t(this, "eventTransitions", e(this, "eventTransitions") || {});
var r, i, s;
if (n)
for (r in n) this.setupChild(n, r, n[r]);
else {
n = {};
for (r in this) "constructor" !== r && (i = this[r]) && ((s = i.transitionTarget) && (this.eventTransitions[r] = s), this.setupChild(n, r, i));
t(this, "states", n)
}
t(this, "pathsCaches", {})
},
setPathsCache: function (t, n, r) {
var i = Ember.guidFor(t.constructor),
s = e(this, "pathsCaches"),
o = s[i] || {};
o[n] = r, s[i] = o
},
getPathsCache: function (t, n) {
var r = Ember.guidFor(t.constructor),
i = e(this, "pathsCaches"),
s = i[r] || {};
return s[n]
},
setupChild: function (n, r, i) {
return i ? (i.isState ? t(i, "name", r) : Ember.State.detect(i) && (i = i.create({
name: r
})), i.isState ? (t(i, "parentState", this), e(this, "childStates").pushObject(i), n[r] = i, i) : void 0) : !1
},
lookupEventTransition: function (e) {
for (var t, n = this; n && !t;) t = n.eventTransitions[e], n = n.get("parentState");
return t
},
isLeaf: Ember.computed(function () {
return !e(this, "childStates").length
}),
hasContext: !0,
setup: Ember.K,
enter: Ember.K,
exit: Ember.K
}), Ember.State.reopenClass({
transitionTo: function (e) {
var t = function (t, n) {
var r = [],
i = Ember.$ && Ember.$.Event;
n && i && n instanceof i ? n.hasOwnProperty("contexts") && (r = n.contexts.slice()) : r = [].slice.call(arguments, 1), r.unshift(e), t.transitionTo.apply(t, r)
};
return t.transitionTarget = e, t
}
})
}(),
function () {
var e = Ember.get,
t = Ember.set,
n = Ember.String.fmt,
r = Ember.ArrayPolyfills.forEach,
i = function (e) {
this.enterStates = e.enterStates.slice(), this.exitStates = e.exitStates.slice(), this.resolveState = e.resolveState, this.finalState = e.enterStates[e.enterStates.length - 1] || e.resolveState
};
i.prototype = {
normalize: function (e, t) {
return this.matchContextsToStates(t), this.addInitialStates(), this.removeUnchangedContexts(e), this
},
matchContextsToStates: function (t) {
for (var n, r, i = this.enterStates.length - 1, s = []; t.length > 0;) {
if (i >= 0) n = this.enterStates[i--];
else {
if (this.enterStates.length) {
if (n = e(this.enterStates[0], "parentState"), !n) throw "Cannot match all contexts to states"
} else n = this.resolveState;
this.enterStates.unshift(n), this.exitStates.unshift(n)
}
r = e(n, "hasContext") ? t.pop() : null, s.unshift(r)
}
this.contexts = s
},
addInitialStates: function () {
for (var t, n = this.finalState;;) {
if (t = e(n, "initialState") || "start", n = e(n, "states." + t), !n) break;
this.finalState = n, this.enterStates.push(n), this.contexts.push(void 0)
}
},
removeUnchangedContexts: function (e) {
for (; this.enterStates.length > 0 && this.enterStates[0] === this.exitStates[0];) {
if (this.enterStates.length === this.contexts.length) {
if (e.getStateMeta(this.enterStates[0], "context") !== this.contexts[0]) break;
this.contexts.shift()
}
this.resolveState = this.enterStates.shift(), this.exitStates.shift()
}
}
};
var s = function (t, r, i) {
var u, a, f, l = this.enableLogging,
c = i ? "unhandledEvent" : t,
h = r[c];
if (u = [].slice.call(arguments, 3), "function" == typeof h) return l && (i ? Ember.Logger.log(n("STATEMANAGER: Unhandled event '%@' being sent to state %@.", [t, e(r, "path")])) : Ember.Logger.log(n("STATEMANAGER: Sending event '%@' to state %@.", [t, e(r, "path")]))), f = u, i && f.unshift(t), f.unshift(this), h.apply(r, f);
var p = e(r, "parentState");
return p ? (a = u, a.unshift(t, p, i), s.apply(this, a)) : i ? void 0 : o.call(this, t, u, !0)
}, o = function (t, n, r) {
return n.unshift(t, e(this, "currentState"), r), s.apply(this, n)
};
Ember.StateManager = Ember.State.extend({
init: function () {
this._super(), t(this, "stateMeta", Ember.Map.create());
var n = e(this, "initialState");
!n && e(this, "states.start") && (n = "start"), n && this.transitionTo(n)
},
stateMetaFor: function (t) {
var n = e(this, "stateMeta"),
r = n.get(t);
return r || (r = {}, n.set(t, r)), r
},
setStateMeta: function (e, n, r) {
return t(this.stateMetaFor(e), n, r)
},
getStateMeta: function (t, n) {
return e(this.stateMetaFor(t), n)
},
currentState: null,
currentPath: Ember.computed.alias("currentState.path"),
transitionEvent: "setup",
errorOnUnhandledEvent: !0,
send: function (e) {
var t = [].slice.call(arguments, 1);
return o.call(this, e, t, !1)
},
unhandledEvent: function (t, n) {
if (e(this, "errorOnUnhandledEvent")) throw new Ember.Error(this.toString() + " could not respond to event " + n + " in state " + e(this, "currentState.path") + ".")
},
getStateByPath: function (t, n) {
for (var r = n.split("."), i = t, s = 0, o = r.length; o > s && (i = e(e(i, "states"), r[s]), i); s++);
return i
},
findStateByPath: function (t, n) {
for (var r; !r && t;) r = this.getStateByPath(t, n), t = e(t, "parentState");
return r
},
getStatesInPath: function (t, n) {
if (!n || "" === n) return void 0;
for (var r, i, s = n.split("."), o = [], u = 0, a = s.length; a > u; u++) {
if (r = e(t, "states"), !r) return void 0;
if (i = e(r, s[u]), !i) return void 0;
t = i, o.push(i)
}
return o
},
goToState: function () {
return this.transitionTo.apply(this, arguments)
},
transitionTo: function (t, n) {
if (!Ember.isEmpty(t)) {
var r = n ? Array.prototype.slice.call(arguments, 1) : [],
s = e(this, "currentState") || this,
o = this.contextFreeTransition(s, t),
u = (new i(o)).normalize(this, r);
this.enterState(u), this.triggerSetupContext(u)
}
},
contextFreeTransition: function (t, n) {
var r = t.getPathsCache(this, n);
if (r) return r;
for (var i = this.getStatesInPath(t, n), s = [], o = t; o && !i;) {
if (s.unshift(o), o = e(o, "parentState"), !o && (i = this.getStatesInPath(this, n), !i)) return;
i = this.getStatesInPath(o, n)
}
for (; i.length > 0 && i[0] === s[0];) o = i.shift(), s.shift();
var u = {
exitStates: s,
enterStates: i,
resolveState: o
};
return t.setPathsCache(this, n, u), u
},
triggerSetupContext: function (t) {
var n = t.contexts,
i = t.enterStates.length - n.length,
s = t.enterStates,
o = e(this, "transitionEvent");
r.call(s, function (e, t) {
e.trigger(o, this, n[t - i])
}, this)
},
getState: function (t) {
var n = e(this, t),
r = e(this, "parentState");
return n ? n : r ? r.getState(t) : void 0
},
enterState: function (n) {
var i = this.enableLogging,
s = n.exitStates.slice(0).reverse();
r.call(s, function (e) {
e.trigger("exit", this)
}, this), r.call(n.enterStates, function (t) {
i && Ember.Logger.log("STATEMANAGER: Entering " + e(t, "path")), t.trigger("enter", this)
}, this), t(this, "currentState", n.finalState)
}
})
}(),
function () {
function e(e, n) {
return function () {
var r = t.call(arguments);
return r.unshift(e), n.apply(e, r)
}
}
var t = [].slice,
n = {}, r = {}, i = [];
Ember.Test = {
registerHelper: function (e, t) {
n[e] = t
},
unregisterHelper: function (e) {
delete n[e], r[e] && (window[e] = r[e]), delete r[e]
},
onInjectHelpers: function (e) {
i.push(e)
}
}, Ember.Application.reopen({
testHelpers: {},
setupForTesting: function () {
this.deferReadiness(), this.Router.reopen({
location: "none"
})
},
injectTestHelpers: function () {
this.testHelpers = {};
for (var t in n) r[t] = window[t], this.testHelpers[t] = window[t] = e(this, n[t]);
for (var s = 0, o = i.length; o > s; s++) i[s](this)
},
removeTestHelpers: function () {
for (var e in n) window[e] = r[e], delete this.testHelpers[e], delete r[e]
}
})
}(),
function () {
function e(e, t) {
return Ember.run(e, e.handleURL, t), e.__container__.lookup("router:main").location.setURL(t), i(e)
}
function t(e, t) {
return Ember.run(function () {
e.$(t).click()
}), i(e)
}
function n(e, t, n) {
var s = r(e, t);
return Ember.run(function () {
s.val(n)
}), i(e)
}
function r(e, t) {
return e.$(o(e, "rootElement")).find(t)
}
function i(e, t) {
return new s(function (n) {
stop();
var r = setInterval(function () {
var i = e.__container__.lookup("router:main").router.isLoading;
i || a || Ember.run.hasScheduledTimers() || Ember.run.currentRunLoop || (clearInterval(r), start(), Ember.run(function () {
n(t)
}))
}, 10)
})
}
var s = Ember.RSVP.Promise,
o = Ember.get,
u = Ember.Test.registerHelper,
a = 0;
Ember.Test.onInjectHelpers(function () {
Ember.$(document).ajaxStart(function () {
a++
}), Ember.$(document).ajaxStop(function () {
a--
})
}), u("visit", e), u("click", t), u("fillIn", n), u("find", r), u("wait", i)
}()
}(), "undefined" == typeof location || "localhost" !== location.hostname && "127.0.0.1" !== location.hostname || console.warn("You are running a production build of Ember on localhost and won't receive detailed error messages. If you want full error messages please use the non-minified build provided on the Ember website."),
function () {
var e, t;
(function () {
var n = {}, r = {};
e = function (e, t, r) {
n[e] = {
deps: t,
callback: r
}
}, t = function (e) {
if (r[e]) return r[e];
r[e] = {};
for (var i, s = n[e], o = s.deps, u = s.callback, a = [], f = 0, l = o.length; l > f; f++) "exports" === o[f] ? a.push(i = {}) : a.push(t(o[f]));
var c = u.apply(this, a);
return r[e] = i || c
}
})(),
function () {
e("json-normalizer/hash-utils", ["json-normalizer/string-utils", "exports"], function (e, t) {
"use strict";
function n(e, t, n) {
var r = {};
for (var i in e) t.call(n, r, i, e[i]);
return r
}
var r = e.camelize,
i = e.decamelize,
s = function (e) {
return n(e, function (e, t, n) {
e[r(t)] = n
})
}, o = function (e) {
return n(e, function (e, t, n) {
e[i(t)] = n
})
};
t.map = n, t.camelizeKeys = s, t.decamelizeKeys = o
}), e("json-normalizer/processor", ["json-normalizer/hash-utils", "exports"], function (e, t) {
"use strict";
function n(e) {
this.json = e
}
var r = e.camelizeKeys;
n.prototype = {
constructor: n,
camelizeKeys: function () {
return this.json = r(this.json), this
}
}, t.Processor = n
}), e("json-normalizer/string-utils", ["exports"], function (e) {
"use strict";
var t = /(\-|_|\.|\s)+(.)?/g,
n = function (e) {
return e.replace(t, function (e, t, n) {
return n ? n.toUpperCase() : ""
}).replace(/^([A-Z])/, function (e) {
return e.toLowerCase()
})
}, r = /([a-z])([A-Z])/g,
i = function (e) {
return e.replace(r, "$1_$2").toLowerCase()
};
e.camelize = n, e.decamelize = i
}), e("json-normalizer", ["json-normalizer/string-utils", "json-normalizer/hash-utils", "json-normalizer/processor", "exports"], function (e, t, n, r) {
"use strict";
var i = e.camelize,
s = e.decamelize,
o = t.map,
u = t.camelizeKeys,
a = t.decamelizeKeys,
f = n.Processor,
l = o;
r.camelize = i, r.decamelize = s, r.mapKeys = l, r.camelizeKeys = u, r.decamelizeKeys = a, r.Processor = f
})
}(),
function () {
window.DS = Ember.Namespace.create({
CURRENT_API_REVISION: 12
})
}(),
function () {
Ember.Date = Ember.Date || {};
var e = Date.parse,
t = [1, 4, 5, 6, 7, 10, 11];
Ember.Date.parse = function (n) {
var r, i, s = 0;
if (i = /^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/.exec(n)) {
for (var o, u = 0; o = t[u]; ++u) i[o] = +i[o] || 0;
i[2] = (+i[2] || 1) - 1, i[3] = +i[3] || 1, "Z" !== i[8] && void 0 !== i[9] && (s = 60 * i[10] + i[11], "+" === i[9] && (s = 0 - s)), r = Date.UTC(i[1], i[2], i[3], i[4], i[5] + s, i[6], i[7])
} else r = e ? e(n) : 0 / 0;
return r
}, (Ember.EXTEND_PROTOTYPES === !0 || Ember.EXTEND_PROTOTYPES.Date) && (Date.parse = Ember.Date.parse)
}(),
function () {
var e = Ember.Evented,
t = Ember.DeferredMixin,
n = Ember.run,
r = Ember.get,
i = Ember.Mixin.create(e, t, {
init: function () {
this._super.apply(this, arguments), this.one("didLoad", this, function () {
n(this, "resolve", this)
}), this.one("becameError", this, function () {
n(this, "reject", this)
}), r(this, "isLoaded") && this.trigger("didLoad")
}
});
DS.LoadPromise = i
}(),
function () {
var e = Ember.get;
Ember.set;
var t = DS.LoadPromise;
DS.RecordArray = Ember.ArrayProxy.extend(Ember.Evented, t, {
type: null,
content: null,
isLoaded: !1,
isUpdating: !1,
store: null,
objectAtContent: function (t) {
var n = e(this, "content"),
r = n.objectAt(t),
i = e(this, "store");
return r ? i.recordForReference(r) : void 0
},
materializedObjectAt: function (t) {
var n = e(this, "content").objectAt(t);
if (n) return e(this, "store").recordIsMaterialized(n) ? this.objectAt(t) : void 0
},
update: function () {
if (!e(this, "isUpdating")) {
var t = e(this, "store"),
n = e(this, "type");
t.fetchAll(n, this)
}
},
addReference: function (t) {
e(this, "content").addObject(t)
},
removeReference: function (t) {
e(this, "content").removeObject(t)
}
})
}(),
function () {
var e = Ember.get;
Ember.set;
var t = Ember.run.once,
n = Ember.EnumerableUtils.forEach;
DS.RecordArrayManager = Ember.Object.extend({
init: function () {
this.filteredRecordArrays = Ember.MapWithDefault.create({
defaultValue: function () {
return []
}
}), this.changedReferences = []
},
referenceDidChange: function (e) {
this.changedReferences.push(e), t(this, this.updateRecordArrays)
},
recordArraysForReference: function (e) {
return e.recordArrays = e.recordArrays || Ember.OrderedSet.create(), e.recordArrays
},
updateRecordArrays: function () {
n(this.changedReferences, function (t) {
var n, r = t.type,
i = this.filteredRecordArrays.get(r);
i.forEach(function (i) {
n = e(i, "filterFunction"), this.updateRecordArray(i, n, r, t)
}, this);
var s = t.loadingRecordArrays;
if (s) {
for (var o = 0, u = s.length; u > o; o++) s[o].loadedRecord();
t.loadingRecordArrays = []
}
}, this), this.changedReferences = []
},
updateRecordArray: function (e, t, n, r) {
var i, s;
t ? (s = this.store.recordForReference(r), i = t(s)) : i = !0;
var o = this.recordArraysForReference(r);
i ? (o.add(e), e.addReference(r)) : i || (o.remove(e), e.removeReference(r))
},
remove: function (t) {
var n = e(t, "_reference"),
r = n.recordArrays || [];
r.forEach(function (e) {
e.removeReference(n)
})
},
updateFilter: function (t, n, r) {
for (var i, s, o, u, a = this.store.typeMapFor(n), f = a.references, l = 0, c = f.length; c > l; l++) i = f[l], o = !1, s = i.data, "object" == typeof s && ((u = i.record) ? e(u, "isDeleted") || (o = !0) : o = !0, o && this.updateRecordArray(t, r, n, i))
},
createManyArray: function (e, t) {
var n = DS.ManyArray.create({
type: e,
content: t,
store: this.store
});
return t.forEach(function (e) {
var t = this.recordArraysForReference(e);
t.add(n)
}, this), n
},
registerFilteredRecordArray: function (e, t, n) {
var r = this.filteredRecordArrays.get(t);
r.push(e), this.updateFilter(e, t, n)
},
registerWaitingRecordArray: function (e, t) {
var n = t.loadingRecordArrays || [];
n.push(e), t.loadingRecordArrays = n
}
})
}(),
function () {
var e = Ember.get;
DS.FilteredRecordArray = DS.RecordArray.extend({
filterFunction: null,
isLoaded: !0,
replace: function () {
var t = e(this, "type").toString();
throw new Error("The result of a client-side filter (on " + t + ") is immutable.")
},
updateFilter: Ember.observer(function () {
var t = e(this, "manager");
t.updateFilter(this, e(this, "type"), e(this, "filterFunction"))
}, "filterFunction")
})
}(),
function () {
var e = Ember.get,
t = Ember.set;
DS.AdapterPopulatedRecordArray = DS.RecordArray.extend({
query: null,
replace: function () {
var t = e(this, "type").toString();
throw new Error("The result of a server query (on " + t + ") is immutable.")
},
load: function (e) {
this.beginPropertyChanges(), t(this, "content", Ember.A(e)), t(this, "isLoaded", !0), this.endPropertyChanges();
var n = this;
Ember.run.once(function () {
n.trigger("didLoad")
})
}
})
}(),
function () {
var e = Ember.get,
t = Ember.set;
DS.ManyArray = DS.RecordArray.extend({
init: function () {
this._super.apply(this, arguments), this._changesToSync = Ember.OrderedSet.create()
},
owner: null,
isPolymorphic: !1,
isLoaded: !1,
loadingRecordsCount: function (e) {
this.loadingRecordsCount = e
},
loadedRecord: function () {
this.loadingRecordsCount--, 0 === this.loadingRecordsCount && (t(this, "isLoaded", !0), this.trigger("didLoad"))
},
fetch: function () {
var t = e(this, "content"),
n = e(this, "store"),
r = e(this, "owner");
n.fetchUnloadedReferences(t, r)
},
replaceContent: function (t, n, r) {
r = r.map(function (t) {
return e(t, "_reference")
}, this), this._super(t, n, r)
},
arrangedContentDidChange: function () {
this.fetch()
},
arrayContentWillChange: function (t, n) {
var r = e(this, "owner"),
i = e(this, "name");
if (!r._suspendedRelationships)
for (var s = t; t + n > s; s++) {
var o = e(this, "content").objectAt(s),
u = DS.RelationshipChange.createChange(r.get("_reference"), o, e(this, "store"), {
parentType: r.constructor,
changeType: "remove",
kind: "hasMany",
key: i
});
this._changesToSync.add(u)
}
return this._super.apply(this, arguments)
},
arrayContentDidChange: function (t, n, r) {
this._super.apply(this, arguments);
var i = e(this, "owner"),
s = e(this, "name"),
o = e(this, "store");
if (!i._suspendedRelationships) {
for (var u = t; t + r > u; u++) {
var a = e(this, "content").objectAt(u),
f = DS.RelationshipChange.createChange(i.get("_reference"), a, o, {
parentType: i.constructor,
changeType: "add",
kind: "hasMany",
key: s
});
f.hasManyName = s, this._changesToSync
.add(f)
}
this._changesToSync.forEach(function (e) {
e.sync()
}), DS.OneToManyChange.ensureSameTransaction(this._changesToSync, o), this._changesToSync.clear()
}
},
createRecord: function (t, n) {
var r, i = e(this, "owner"),
s = e(i, "store"),
o = e(this, "type");
return n = n || e(i, "transaction"), r = s.createRecord.call(s, o, t, n), this.pushObject(r), r
}
})
}(),
function () {
var e = Ember.get,
t = Ember.set,
n = Ember.EnumerableUtils.forEach;
DS.Transaction = Ember.Object.extend({
init: function () {
t(this, "records", Ember.OrderedSet.create())
},
createRecord: function (t, n) {
var r = e(this, "store");
return r.createRecord(t, n, this)
},
isEqualOrDefault: function (t) {
return this === t || t === e(this, "store.defaultTransaction") ? !0 : void 0
},
isDefault: Ember.computed(function () {
return this === e(this, "store.defaultTransaction")
}).volatile(),
add: function (t) {
var n = e(this, "store"),
r = e(n, "_adapter"),
i = e(r, "serializer");
i.eachEmbeddedRecord(t, function (e, t) {
"load" !== t && this.add(e)
}, this), this.adoptRecord(t)
},
relationships: Ember.computed(function () {
var t = Ember.OrderedSet.create(),
n = e(this, "records"),
r = e(this, "store");
return n.forEach(function (n) {
for (var i = e(n, "_reference"), s = r.relationshipChangesFor(i), o = 0; s.length > o; o++) t.add(s[o])
}), t
}).volatile(),
commit: function () {
var n = e(this, "store"),
r = e(n, "_adapter");
e(this, "isDefault") && t(n, "defaultTransaction", n.transaction()), this.removeCleanRecords();
var i = e(this, "relationships"),
s = this._commitDetails();
s.created.isEmpty() && s.updated.isEmpty() && s.deleted.isEmpty() && s.relationships.isEmpty() || r.commit(n, s), i.forEach(function (e) {
e.destroy()
})
},
_commitDetails: function () {
var t = e(this, "relationships"),
n = {
created: Ember.OrderedSet.create(),
updated: Ember.OrderedSet.create(),
deleted: Ember.OrderedSet.create(),
relationships: t
}, r = e(this, "records");
return r.forEach(function (t) {
e(t, "isDirty") && (t.send("willCommit"), n[e(t, "dirtyType")].add(t))
}), n
},
rollback: function () {
e(this, "store");
var t = Ember.OrderedSet.create(),
n = e(this, "relationships");
n.forEach(function (e) {
t.add(e.firstRecordReference), t.add(e.secondRecordReference), e.destroy()
}), n.clear();
var r = e(this, "records");
r.forEach(function (e) {
e.get("isDirty") && e.send("rollback")
}), this.removeCleanRecords(), t.forEach(function (e) {
if (e && e.record) {
var t = e.record;
t.suspendRelationshipObservers(function () {
t.reloadHasManys()
})
}
}, this)
},
remove: function (t) {
var n = e(this, "store.defaultTransaction");
n.adoptRecord(t)
},
removeCleanRecords: function () {
var t = e(this, "records");
t.forEach(function (e) {
e.get("isDirty") || this.remove(e)
}, this)
},
adoptRecord: function (n) {
var r = e(n, "transaction");
r && r.removeRecord(n), e(this, "records").add(n), t(n, "transaction", this)
},
removeRecord: function (t) {
e(this, "records").remove(t)
}
}), DS.Transaction.reopenClass({
ensureSameTransaction: function (t) {
var i = Ember.A();
n(t, function (t) {
t && i.pushObject(e(t, "transaction"))
});
var s = i.reduce(function (t, n) {
return e(n, "isDefault") || null !== t ? t : n
}, null);
return s ? n(t, function (e) {
e && s.add(e)
}) : s = i.objectAt(0), s
}
})
}(),
function () {
Ember.get;
var e = function (e) {
return e
}, t = function (e) {
return e
}, n = function (e, t) {
return t
};
DS._Mappable = Ember.Mixin.create({
createInstanceMapFor: function (e) {
var t = Ember.metaPath(this, ["DS.Mappable"], !0);
if (t.values = t.values || {}, t.values[e]) return t.values[e];
for (var n = t.values[e] = new Ember.Map, r = this.constructor; r && r !== DS.Store;) this._copyMap(e, r, n), r = r.superclass;
return t.values[e] = n, n
},
_copyMap: function (i, s, o) {
function u(i, u) {
var a = (s.transformMapKey || t)(i, u),
f = (s.transformMapValue || n)(i, u),
l = o.get(a),
c = f;
l && (c = (this.constructor.resolveMapConflict || e)(l, c)), o.set(a, c)
}
var a = Ember.metaPath(s, ["DS.Mappable"], !0),
f = a[i];
f && f.forEach(u, this)
}
}), DS._Mappable.generateMapFunctionFor = function (e, t) {
return function (n, r) {
var i = Ember.metaPath(this, ["DS.Mappable"], !0),
s = i[e] || Ember.MapWithDefault.create({
defaultValue: function () {
return {}
}
});
t.call(this, n, r, s), i[e] = s
}
}
}(),
function () {
var e = Ember.get,
t = Ember.set,
n = Ember.run.once,
r = Ember.isNone,
i = Ember.EnumerableUtils.forEach,
s = Ember.EnumerableUtils.map,
o = "unloaded",
u = "loading",
a = {
materialized: !0
}, f = {
created: !0
}, l = function (e) {
return null == e ? null : e + ""
};
DS.Store = Ember.Object.extend(DS._Mappable, {
init: function () {
var n = e(this, "revision");
if (n !== DS.CURRENT_API_REVISION && !Ember.ENV.TESTING) throw new Error("Error: The Ember Data library has had breaking API changes since the last time you updated the library. Please review the list of breaking changes at https://github.com/emberjs/data/blob/master/BREAKING_CHANGES.md, then update your store's `revision` property to " + DS.CURRENT_API_REVISION);
(!e(DS, "defaultStore") || e(this, "isDefaultStore")) && t(DS, "defaultStore", this), this.typeMaps = {}, this.recordArrayManager = DS.RecordArrayManager.create({
store: this
}), this.relationshipChanges = {}, t(this, "currentTransaction", this.transaction()), t(this, "defaultTransaction", this.transaction())
},
transaction: function () {
return DS.Transaction.create({
store: this
})
},
materializeData: function (t) {
var n = e(t, "_reference"),
r = n.data,
i = this.adapterForType(t.constructor);
n.data = a, t.setupData(), r !== f && i.materialize(t, r, n.prematerialized)
},
adapter: Ember.computed(function () {
return "DS.RESTAdapter"
}).property(),
serialize: function (e, t) {
return this.adapterForType(e.constructor).serialize(e, t)
},
_adapter: Ember.computed(function () {
var t = e(this, "adapter");
return "string" == typeof t && (t = e(this, t, !1) || e(Ember.lookup, t)), DS.Adapter.detect(t) && (t = t.create()), t
}).property("adapter"),
clientIdCounter: 1,
createRecord: function (n, i, s) {
i = i || {};
var o = n._create({
store: this
});
s = s || e(this, "defaultTransaction"), s.adoptRecord(o);
var u = i.id;
if (r(u)) {
var a = this.adapterForType(n);
a && a.generateIdForRecord && (u = l(a.generateIdForRecord(this, o)), i.id = u)
}
u = l(u);
var c = this.createReference(n, u);
return c.data = f, t(o, "_reference", c), c.record = o, o.loadedData(), o.setupData(), o.setProperties(i), Ember.run(o, "resolve", o), o
},
deleteRecord: function (e) {
e.deleteRecord()
},
unloadRecord: function (e) {
e.unloadRecord()
},
find: function (e, t) {
return void 0 === t ? this.findAll(e) : "object" === Ember.typeOf(t) ? this.findQuery(e, t) : this.findById(e, l(t))
},
findById: function (e, t) {
var n;
if (this.hasReferenceForId(e, t) && (n = this.referenceForId(e, t), n.data !== o)) return this.recordForReference(n);
n || (n = this.createReference(e, t)), n.data = u;
var r = this.materializeRecord(n);
if (n.data === u) {
var i = this.adapterForType(e),
s = this,
a = i.find(this, e, t);
a && a.then && a.then(null, function () {
s.recordWasError(r)
})
}
return r
},
reloadRecord: function (t) {
var n = t.constructor,
r = this.adapterForType(n),
i = this,
s = e(t, "id"),
o = r.find(this, n, s);
o && o.then && o.then(null, function () {
i.recordWasError(t)
})
},
recordForReference: function (e) {
var t = e.record;
return t || (t = this.materializeRecord(e)), t
},
unloadedReferences: function (e) {
for (var t = [], n = 0, r = e.length; r > n; n++) {
var i = e[n];
i.data === o && (t.push(i), i.data = u)
}
return t
},
fetchUnloadedReferences: function (e, t) {
var n = this.unloadedReferences(e);
this.fetchMany(n, t)
},
fetchMany: function (e, t) {
if (e.length) {
var n = Ember.MapWithDefault.create({
defaultValue: function () {
return Ember.A()
}
});
i(e, function (e) {
n.get(e.type).push(e)
}), i(n, function (e) {
var r = n.get(e),
i = s(r, function (e) {
return e.id
}),
o = this.adapterForType(e);
o.findMany(this, e, i, t)
}, this)
}
},
hasReferenceForId: function (e, t) {
return t = l(t), !! this.typeMapFor(e).idToReference[t]
},
referenceForId: function (e, t) {
t = l(t);
var n = this.typeMapFor(e).idToReference[t];
return n || (n = this.createReference(e, t), n.data = o), n
},
findMany: function (e, t, n, r) {
if (!Ember.isArray(t)) {
var i = this.adapterForType(e);
return i && i.findHasMany && i.findHasMany(this, n, r, t), this.recordArrayManager.createManyArray(e, Ember.A())
}
var o, u, a, f = s(t, function (t) {
return "object" != typeof t && null !== t ? this.referenceForId(e, t) : t
}, this),
l = this.unloadedReferences(f),
c = this.recordArrayManager.createManyArray(e, Ember.A(f));
if (this.loadingRecordArrays, c.loadingRecordsCount(l.length), l.length) {
for (u = 0, a = l.length; a > u; u++) o = l[u], this.recordArrayManager.registerWaitingRecordArray(c, o);
this.fetchMany(l, n)
} else c.set("isLoaded", !0), Ember.run.once(function () {
c.trigger("didLoad")
});
return c
},
findQuery: function (e, t) {
var n = DS.AdapterPopulatedRecordArray.create({
type: e,
query: t,
content: Ember.A([]),
store: this
}),
r = this.adapterForType(e);
return r.findQuery(this, e, t, n), n
},
findAll: function (e) {
return this.fetchAll(e, this.all(e))
},
fetchAll: function (e, n) {
var r = this.adapterForType(e),
i = this.typeMapFor(e).metadata.since;
return t(n, "isUpdating", !0), r.findAll(this, e, i), n
},
metaForType: function (e, n, r) {
var i = this.typeMapFor(e).metadata;
t(i, n, r)
},
didUpdateAll: function (e) {
var n = this.typeMapFor(e).findAllCache;
t(n, "isUpdating", !1)
},
all: function (e) {
var t = this.typeMapFor(e),
n = t.findAllCache;
if (n) return n;
var r = DS.RecordArray.create({
type: e,
content: Ember.A([]),
store: this,
isLoaded: !0
});
return this.recordArrayManager.registerFilteredRecordArray(r, e), t.findAllCache = r, r
},
filter: function (e, t, n) {
3 === arguments.length ? this.findQuery(e, t) : 2 === arguments.length && (n = t);
var r = DS.FilteredRecordArray.create({
type: e,
content: Ember.A([]),
store: this,
manager: this.recordArrayManager,
filterFunction: n
});
return this.recordArrayManager.registerFilteredRecordArray(r, e, n), r
},
recordIsLoaded: function (e, t) {
return this.hasReferenceForId(e, t) ? "object" == typeof this.referenceForId(e, t).data : !1
},
dataWasUpdated: function (t, n, r) {
e(r, "isDeleted") || "object" == typeof n.data && this.recordArrayManager.referenceDidChange(n)
},
scheduleSave: function (t) {
e(this, "currentTransaction").add(t), n(this, "flushSavedRecords")
},
flushSavedRecords: function () {
e(this, "currentTransaction").commit(), t(this, "currentTransaction", this.transaction())
},
save: function () {
n(this, "commit")
},
commit: function () {
e(this, "defaultTransaction").commit()
},
didSaveRecord: function (e, t) {
t ? (this.updateId(e, t), this.updateRecordData(e, t)) : this.didUpdateAttributes(e), e.adapterDidCommit()
},
didSaveRecords: function (e, t) {
var n = 0;
e.forEach(function (e) {
this.didSaveRecord(e, t && t[n++])
}, this)
},
recordWasInvalid: function (e, t) {
e.adapterDidInvalidate(t)
},
recordWasError: function (e) {
e.adapterDidError()
},
didUpdateAttribute: function (e, t, n) {
e.adapterDidUpdateAttribute(t, n)
},
didUpdateAttributes: function (e) {
e.eachAttribute(function (t) {
this.didUpdateAttribute(e, t)
}, this)
},
didUpdateRelationship: function (t, n) {
var r = e(t, "_reference").clientId,
i = this.relationshipChangeFor(r, n);
i && i.adapterDidUpdate()
},
didUpdateRelationships: function (t) {
var n = this.relationshipChangesFor(e(t, "_reference"));
for (var r in n) n.hasOwnProperty(r) && n[r].adapterDidUpdate()
},
didReceiveId: function (t, n) {
var r = this.typeMapFor(t.constructor),
i = e(t, "clientId");
e(t, "id"), r.idToCid[n] = i, this.clientIdToId[i] = n
},
updateRecordData: function (t, n) {
e(t, "_reference").data = n, t.didChangeData()
},
updateId: function (t, n) {
var r = t.constructor,
i = this.typeMapFor(r),
s = e(t, "_reference"),
o = (e(t, "id"), this.preprocessData(r, n));
i.idToReference[o] = s, s.id = o
},
preprocessData: function (e, t) {
return this.adapterForType(e).extractId(e, t)
},
typeMapFor: function (t) {
var n, r = e(this, "typeMaps"),
i = Ember.guidFor(t);
return (n = r[i]) ? n : (n = {
idToReference: {},
references: [],
metadata: {}
}, r[i] = n, n)
},
load: function (e, t, r) {
var i;
("number" == typeof t || "string" == typeof t) && (i = t, t = r, r = null), r && r.id ? i = r.id : void 0 === i && (i = this.preprocessData(e, t)), i = l(i);
var s = this.referenceForId(e, i);
return s.record && n(s.record, "loadedData"), s.data = t, s.prematerialized = r, this.recordArrayManager.referenceDidChange(s), s
},
loadMany: function (e, t, n) {
return void 0 === n && (n = t, t = s(n, function (t) {
return this.preprocessData(e, t)
}, this)), s(t, function (t, r) {
return this.load(e, t, n[r])
}, this)
},
loadHasMany: function (e, n, r) {
var i = e.get(n + ".type"),
o = s(r, function (e) {
return {
id: e,
type: i
}
});
e.materializeHasMany(n, o), e.hasManyDidChange(n);
var u = e.cacheFor(n);
u && (t(u, "isLoaded", !0), u.trigger("didLoad"))
},
createReference: function (e, t) {
var n = this.typeMapFor(e),
r = n.idToReference,
i = {
id: t,
clientId: this.clientIdCounter++,
type: e
};
return t && (r[t] = i), n.references.push(i), i
},
materializeRecord: function (t) {
var n = t.type._create({
id: t.id,
store: this,
_reference: t
});
return t.record = n, e(this, "defaultTransaction").adoptRecord(n), n.loadingData(), "object" == typeof t.data && n.loadedData(), n
},
dematerializeRecord: function (t) {
var n = e(t, "_reference"),
r = n.type,
i = n.id,
s = this.typeMapFor(r);
t.updateRecordArrays(), i && delete s.idToReference[i];
var o = s.references.indexOf(n);
s.references.splice(o, 1)
},
willDestroy: function () {
e(DS, "defaultStore") === this && t(DS, "defaultStore", null)
},
addRelationshipChangeFor: function (e, t, n, r, i) {
var s = e.clientId,
o = n ? n.clientId : n,
u = t + r,
a = this.relationshipChanges;
s in a || (a[s] = {}), o in a[s] || (a[s][o] = {}), u in a[s][o] || (a[s][o][u] = {}), a[s][o][u][i.changeType] = i
},
removeRelationshipChangeFor: function (e, t, n, r, i) {
var s = e.clientId,
o = n ? n.clientId : n,
u = this.relationshipChanges,
a = t + r;
s in u && o in u[s] && a in u[s][o] && delete u[s][o][a][i]
},
relationshipChangeFor: function (e, t, n, r, i) {
var s = e.clientId,
o = n ? n.clientId : n,
u = this.relationshipChanges,
a = t + r;
return s in u && o in u[s] ? i ? u[s][o][a][i] : u[s][o][a].add || u[s][o][a].remove : void 0
},
relationshipChangePairsFor: function (e) {
var t = [];
if (!e) return t;
var n = this.relationshipChanges[e.clientId];
for (var r in n)
if (n.hasOwnProperty(r))
for (var i in n[r]) n[r].hasOwnProperty(i) && t.push(n[r][i]);
return t
},
relationshipChangesFor: function (e) {
var t = [];
if (!e) return t;
var n = this.relationshipChangePairsFor(e);
return i(n, function (e) {
var n = e.add,
r = e.remove;
n && t.push(n), r && t.push(r)
}), t
},
adapterForType: function (e) {
this._adaptersMap = this.createInstanceMapFor("adapters");
var t = this._adaptersMap.get(e);
return t ? t : this.get("_adapter")
},
recordAttributeDidChange: function (e, t, n, r) {
var i = e.record,
s = new Ember.OrderedSet,
o = this.adapterForType(i.constructor);
o.dirtyRecordsForAttributeChange && o.dirtyRecordsForAttributeChange(s, i, t, n, r), s.forEach(function (e) {
e.adapterDidDirty()
})
},
recordBelongsToDidChange: function (e, t, n) {
var r = this.adapterForType(t.constructor);
r.dirtyRecordsForBelongsToChange && r.dirtyRecordsForBelongsToChange(e, t, n)
},
recordHasManyDidChange: function (e, t, n) {
var r = this.adapterForType(t.constructor);
r.dirtyRecordsForHasManyChange && r.dirtyRecordsForHasManyChange(e, t, n)
}
}), DS.Store.reopenClass({
registerAdapter: DS._Mappable.generateMapFunctionFor("adapters", function (e, t, n) {
n.set(e, t)
}),
transformMapKey: function (t) {
if ("string" == typeof t) {
var n;
return n = e(Ember.lookup, t)
}
return t
},
transformMapValue: function (e, t) {
return Ember.Object.detect(t) ? t.create() : t
}
})
}(),
function () {
var e = Ember.get,
t = Ember.set,
n = Ember.run.once,
r = Ember.ArrayPolyfills.map,
i = Ember.computed(function (t) {
var n = e(this, "parentState");
return n ? e(n, t) : void 0
}).property(),
s = function (e) {
for (var t in e)
if (e.hasOwnProperty(t) && e[t]) return !0;
return !1
}, o = function (t) {
var n = e(t, "record");
n.materializeData()
}, u = function (t, n) {
n.oldValue = e(e(t, "record"), n.name);
var r = DS.AttributeChange.createChange(n);
e(t, "record")._changesToSync[n.name] = r
}, a = function (t, n) {
var r = e(t, "record")._changesToSync[n.name];
r.value = e(e(t, "record"), n.name), r.sync()
};
DS.State = Ember.State.extend({
isLoading: i,
isLoaded: i,
isReloading: i,
isDirty: i,
isSaving: i,
isDeleted: i,
isError: i,
isNew: i,
isValid: i,
dirtyType: i
});
var f = DS.State.extend({
initialState: "uncommitted",
isDirty: !0,
uncommitted: DS.State.extend({
willSetProperty: u,
didSetProperty: a,
becomeDirty: Ember.K,
willCommit: function (e) {
e.transitionTo("inFlight")
},
becameClean: function (t) {
var n = e(t, "record");
n.withTransaction(function (e) {
e.remove(n)
}), t.transitionTo("loaded.materializing")
},
becameInvalid: function (e) {
e.transitionTo("invalid")
},
rollback: function (t) {
e(t, "record").rollback()
}
}),
inFlight: DS.State.extend({
isSaving: !0,
enter: function (t) {
var n = e(t, "record");
n.becameInFlight()
},
materializingData: function (n) {
t(n, "lastDirtyType", e(this, "dirtyType")), n.transitionTo("materializing")
},
didCommit: function (t) {
var n = e(this, "dirtyType"),
r = e(t, "record");
r.withTransaction(function (e) {
e.remove(r)
}), t.transitionTo("saved"), t.send("invokeLifecycleCallbacks", n)
},
didChangeData: o,
becameInvalid: function (n, r) {
var i = e(n, "record");
t(i, "errors", r), n.transitionTo("invalid"), n.send("invokeLifecycleCallbacks")
},
becameError: function (e) {
e.transitionTo("error"), e.send("invokeLifecycleCallbacks")
}
}),
invalid: DS.State.extend({
isValid: !1,
exit: function (t) {
var n = e(t, "record");
n.withTransaction(function (e) {
e.remove(n)
})
},
deleteRecord: function (t) {
t.transitionTo("deleted"), e(t, "record").clearRelationships()
},
willSetProperty: u,
didSetProperty: function (n, r) {
var i = e(n, "record"),
o = e(i, "errors"),
u = r.name;
t(o, u, null), s(o) || n.send("becameValid"), a(n, r)
},
becomeDirty: Ember.K,
rollback: function (e) {
e.send("becameValid"), e.send("rollback")
},
becameValid: function (e) {
e.transitionTo("uncommitted")
},
invokeLifecycleCallbacks: function (t) {
var n = e(t, "record");
n.trigger("becameInvalid", n)
}
})
}),
l = f.create({
dirtyType: "created",
isNew: !0
}),
c = f.create({
dirtyType: "updated"
});
l.states.uncommitted.reopen({
deleteRecord: function (t) {
var n = e(t, "record");
n.clearRelationships(), t.transitionTo("deleted.saved")
}
}), l.states.uncommitted.reopen({
rollback: function (e) {
this._super(e), e.transitionTo("deleted.saved")
}
}), c.states.uncommitted.reopen({
deleteRecord: function (t) {
var n = e(t, "record");
t.transitionTo("deleted"), n.clearRelationships()
}
});
var h = {
rootState: Ember.State.create({
isLoading: !1,
isLoaded: !1,
isReloading: !1,
isDirty: !1,
isSaving: !1,
isDeleted: !1,
isError: !1,
isNew: !1,
isValid: !0,
empty: DS.State.create({
loadingData: function (e) {
e.transitionTo("loading")
},
loadedData: function (e) {
e.transitionTo("loaded.created")
}
}),
loading: DS.State.create({
isLoading: !0,
loadedData: o,
materializingData: function (e) {
e.transitionTo("loaded.materializing.firstTime")
},
becameError: function (e) {
e.transitionTo("error"), e.send("invokeLifecycleCallbacks")
}
}),
loaded: DS.State.create({
initialState: "saved",
isLoaded: !0,
materializing: DS.State.create({
willSetProperty: Ember.K,
didSetProperty: Ember.K,
didChangeData: o,
finishedMaterializing: function (e) {
e.transitionTo("loaded.saved")
},
firstTime: DS.State.create({
isLoaded: !1,
exit: function (t) {
var r = e(t, "record");
n(function () {
r.trigger("didLoad")
})
}
})
}),
reloading: DS.State.create({
isReloading: !0,
enter: function (t) {
var n = e(t, "record"),
r = e(n, "store");
r.reloadRecord(n)
},
exit: function (t) {
var r = e(t, "record");
n(r, "trigger", "didReload")
},
loadedData: o,
materializingData: function (e) {
e.transitionTo("loaded.materializing")
}
}),
saved: DS.State.create({
willSetProperty: u,
didSetProperty: a,
didChangeData: o,
loadedData: o,
reloadRecord: function (e) {
e.transitionTo("loaded.reloading")
},
materializingData: function (e) {
e.transitionTo("loaded.materializing")
},
becomeDirty: function (e) {
e.transitionTo("updated")
},
deleteRecord: function (t) {
t.transitionTo("deleted"), e(t, "record").clearRelationships()
},
unloadRecord: function (t) {
var n = e(t, "record");
n.clearRelationships(), t.transitionTo("deleted.saved")
},
didCommit: function (t) {
var n = e(t, "record");
n.withTransaction(function (e) {
e.remove(n)
}), t.send("invokeLifecycleCallbacks", e(t, "lastDirtyType"))
},
invokeLifecycleCallbacks: function (t, n) {
var r = e(t, "record");
"created" === n ? r.trigger("didCreate", r) : r.trigger("didUpdate", r), r.trigger("didCommit", r)
}
}),
created: l,
updated: c
}),
deleted: DS.State.create({
initialState: "uncommitted",
dirtyType: "deleted",
isDeleted: !0,
isLoaded: !0,
isDirty: !0,
setup: function (t) {
var n = e(t, "record"),
r = e(n, "store");
r.recordArrayManager.remove(n)
},
uncommitted: DS.State.create({
willCommit: function (e) {
e.transitionTo("inFlight")
},
rollback: function (t) {
e(t, "record").rollback()
},
becomeDirty: Ember.K,
becameClean: function (t) {
var n = e(t, "record");
n.withTransaction(function (e) {
e.remove(n)
}), t.transitionTo("loaded.materializing")
}
}),
inFlight: DS.State.create({
isSaving: !0,
enter: function (t) {
var n = e(t, "record");
n.becameInFlight()
},
didCommit: function (t) {
var n = e(t, "record");
n.withTransaction(function (e) {
e.remove(n)
}), t.transitionTo("saved"), t.send("invokeLifecycleCallbacks")
}
}),
saved: DS.State.create({
isDirty: !1,
setup: function (t) {
var n = e(t, "record"),
r = e(n, "store");
r.dematerializeRecord(n)
},
invokeLifecycleCallbacks: function (t) {
var n = e(t, "record");
n.trigger("didDelete", n), n.trigger("didCommit", n)
}
})
}),
error: DS.State.create({
isError: !0,
invokeLifecycleCallbacks: function (t) {
var n = e(t, "record");
n.trigger("becameError", n)
}
})
})
};
DS.StateManager = Ember.StateManager.extend({
record: null,
initialState: "rootState",
states: h,
unhandledEvent: function (t, n) {
var i, s = t.get("record"),
o = [].slice.call(arguments, 2);
throw i = "Attempted to handle event `" + n + "` ", i += "on " + s.toString() + " while in state ", i += e(t, "currentState.path") + ". Called with ", i += r.call(o, function (e) {
return Ember.inspect(e)
}).join(", "), new Ember.Error(i)
}
})
}(),
function () {
var e = DS.LoadPromise,
t = Ember.get,
n = Ember.set,
r = Ember.EnumerableUtils.map,
i = Ember.computed(function (e) {
return t(t(this, "stateManager.currentState"), e)
}).property("stateManager.currentState").readOnly();
DS.Model = Ember.Object.extend(Ember.Evented, e, {
isLoading: i,
isLoaded: i,
isReloading: i,
isDirty: i,
isSaving: i,
isDeleted: i,
isError: i,
isNew: i,
isValid: i,
dirtyType: i,
clientId: null,
id: null,
transaction: null,
stateManager: null,
errors: null,
serialize: function (e) {
var n = t(this, "store");
return n.serialize(this, e)
},
toJSON: function (e) {
var t = DS.JSONSerializer.create();
return t.serialize(this, e)
},
didLoad: Ember.K,
didReload: Ember.K,
didUpdate: Ember.K,
didCreate: Ember.K,
didDelete: Ember.K,
becameInvalid: Ember.K,
becameError: Ember.K,
data: Ember.computed(function () {
return this._data || this.materializeData(), this._data
}).property(),
materializeData: function () {
this.send("materializingData"), t(this, "store").materializeData(this), this.suspendRelationshipObservers(function () {
this.notifyPropertyChange("data")
})
},
_data: null,
init: function () {
this._super();
var e = DS.StateManager.create({
record: this
});
n(this, "stateManager", e), this._setup(), e.goToState("empty")
},
_setup: function () {
this._changesToSync = {}
},
send: function (e, n) {
return t(this, "stateManager").send(e, n)
},
withTransaction: function (e) {
var n = t(this, "transaction");
n && e(n)
},
loadingData: function () {
this.send("loadingData")
},
loadedData: function () {
this.send("loadedData")
},
didChangeData: function () {
this.send("didChangeData")
},
reload: function () {
this.send("reloadRecord")
},
deleteRecord: function () {
this.send("deleteRecord")
},
unloadRecord: function () {
this.send("unloadRecord")
},
clearRelationships: function () {
this.eachRelationship(function (e, t) {
"belongsTo" === t.kind ? n(this, e, null) : "hasMany" === t.kind && this.clearHasMany(t)
}, this)
},
updateRecordArrays: function () {
var e = t(this, "store");
e && e.dataWasUpdated(this.constructor, t(this, "_reference"), this)
},
adapterDidCommit: function () {
var e = t(this, "data").attributes;
t(this.constructor, "attributes").forEach(function (n) {
e[n] = t(this, n)
}, this), this.send("didCommit"), this.updateRecordArraysLater()
},
adapterDidDirty: function () {
this.send("becomeDirty"), this.updateRecordArraysLater()
},
dataDidChange: Ember.observer(function () {
this.reloadHasManys(), this.send("finishedMaterializing")
}, "data"),
reloadHasManys: function () {
var e = t(this.constructor, "relationshipsByName");
this.updateRecordArraysLater(), e.forEach(function (e, t) {
"hasMany" === t.kind && this.hasManyDidChange(t.key)
}, this)
},
hasManyDidChange: function (e) {
var i = this.cacheFor(e);
if (i) {
var s = t(this.constructor, "relationshipsByName").get(e).type,
o = t(this, "store"),
u = this._data.hasMany[e] || [],
a = r(u, function (e) {
return "object" == typeof e ? e.clientId ? e : o.referenceForId(e.type, e.id) : o.referenceForId(s, e)
});
n(i, "content", Ember.A(a))
}
},
updateRecordArraysLater: function () {
Ember.run.once(this, this.updateRecordArrays)
},
setupData: function () {
this._data = {
attributes: {},
belongsTo: {},
hasMany: {},
id: null
}
},
materializeId: function (e) {
n(this, "id", e)
},
materializeAttributes: function (e) {
this._data.attributes = e
},
materializeAttribute: function (e, t) {
this._data.attributes[e] = t
},
materializeHasMany: function (e, t) {
var n = typeof t;
if (t && "string" !== n && t.length > 1 && Ember.assert("materializeHasMany expects tuples, references or opaque token, not " + t[0], t[0].hasOwnProperty("id") && t[0].type), "string" === n) this._data.hasMany[e] = t;
else {
var r = t;
t && Ember.isArray(t) && (r = this._convertTuplesToReferences(t)), this._data.hasMany[e] = r
}
},
materializeBelongsTo: function (e, t) {
t && Ember.assert("materializeBelongsTo expects a tuple or a reference, not a " + t, !t || t.hasOwnProperty("id") && t.hasOwnProperty("type")), this._data.belongsTo[e] = t
},
_convertTuplesToReferences: function (e) {
return r(e, function (e) {
return this._convertTupleToReference(e)
}, this)
},
_convertTupleToReference: function (e) {
var n = t(this, "store");
return e.clientId ? e : n.referenceForId(e.type, e.id)
},
rollback: function () {
this._setup(), this.send("becameClean"), this.suspendRelationshipObservers(function () {
this.notifyPropertyChange("data")
})
},
toStringExtension: function () {
return t(this, "id")
},
suspendRelationshipObservers: function (e, n) {
var r = t(this.constructor, "relationshipNames").belongsTo,
i = this;
try {
this._suspendedRelationships = !0, Ember._suspendObservers(i, r, null, "belongsToDidChange", function () {
Ember._suspendBeforeObservers(i, r, null, "belongsToWillChange", function () {
e.call(n || i)
})
})
} finally {
this._suspendedRelationships = !1
}
},
becameInFlight: function () {},
save: function () {
var e = this;
return this.get("store").scheduleSave(this), new Ember.RSVP.Promise(function (t) {
e.one("didCommit", function () {
t(this)
})
})
},
adapterDidUpdateAttribute: function (e, n) {
void 0 !== n ? (t(this, "data.attributes")[e] = n, this.notifyPropertyChange(e)) : (n = t(this, e), t(this, "data.attributes")[e] = n), this.updateRecordArraysLater()
},
adapterDidInvalidate: function (e) {
this.send("becameInvalid", e)
},
adapterDidError: function () {
this.send("becameError")
},
trigger: function (e) {
Ember.tryInvoke(this, e, [].slice.call(arguments, 1)), this._super.apply(this, arguments)
}
});
var s = function (e) {
return function () {
var n = t(DS, "defaultStore"),
r = [].slice.call(arguments);
return r.unshift(this), n[e].apply(n, r)
}
};
DS.Model.reopenClass({
isLoaded: s("recordIsLoaded"),
find: s("find"),
all: s("all"),
query: s("findQuery"),
filter: s("filter"),
_create: DS.Model.create,
create: function () {
throw new Ember.Error("You should not call `create` on a model. Instead, call `createRecord` with the attributes you would like to set.")
},
createRecord: s("createRecord")
})
}(),
function () {
function e(e, n, r) {
var i = t(e, "data").attributes,
s = i[r];
return void 0 === s && (s = "function" == typeof n.defaultValue ? n.defaultValue() : n.defaultValue), s
}
var t = Ember.get;
DS.Model.reopenClass({
attributes: Ember.computed(function () {
var e = Ember.Map.create();
return this.eachComputedProperty(function (t, n) {
n.isAttribute && (n.name = t, e.set(t, n))
}), e
})
});
var n = DS.AttributeChange = function (e) {
this.reference = e.reference, this.store = e.store, this.name = e.name, this.oldValue = e.oldValue
};
n.createChange = function (e) {
return new n(e)
}, n.prototype = {
sync: function () {
this.store.recordAttributeDidChange(this.reference, this.name, this.value, this.oldValue), this.destroy()
},
destroy: function () {
delete this.store.recordForReference(this.reference)._changesToSync[this.name]
}
}, DS.Model.reopen({
eachAttribute: function (e, n) {
t(this.constructor, "attributes").forEach(function (t, i) {
e.call(n, t, i)
}, n)
},
attributeWillChange: Ember.beforeObserver(function (e, n) {
var r = t(e, "_reference"),
i = t(e, "store");
e.send("willSetProperty", {
reference: r,
store: i,
name: n
})
}),
attributeDidChange: Ember.observer(function (e, t) {
e.send("didSetProperty", {
name: t
})
})
}), DS.attr = function (t, n) {
n = n || {};
var r = {
type: t,
isAttribute: !0,
options: n
};
return Ember.computed(function (t, r) {
return arguments.length > 1 || (r = e(this, n, t)), r
}).property("data").meta(r)
}
}(),
function () {
var e = Ember.get,
t = (Ember.set, Ember.isNone);
DS.belongsTo = function (n, r) {
r = r || {};
var i = {
type: n,
isRelationship: !0,
options: r,
kind: "belongsTo"
};
return Ember.computed(function (r, i) {
if ("string" == typeof n && (n = e(this, n, !1) || e(Ember.lookup, n)), 2 === arguments.length) return void 0 === i ? null : i;
var s, o = e(this, "data").belongsTo,
u = e(this, "store");
return s = o[r], t(s) ? null : s.clientId ? u.recordForReference(s) : s.type ? u.findById(s.type, s.id) : u.findById(n, s.id)
}).property("data").meta(i)
}, DS.Model.reopen({
belongsToWillChange: Ember.beforeObserver(function (t, n) {
if (e(t, "isLoaded")) {
var r = e(t, n),
i = e(t, "_reference"),
s = e(t, "store");
if (r) {
var o = DS.RelationshipChange.createChange(i, e(r, "_reference"), s, {
key: n,
kind: "belongsTo",
changeType: "remove"
});
o.sync(), this._changesToSync[n] = o
}
}
}),
belongsToDidChange: Ember.immediateObserver(function (t, n) {
if (e(t, "isLoaded")) {
var r = e(t, n);
if (r) {
var i = e(t, "_reference"),
s = e(t, "store"),
o = DS.RelationshipChange.createChange(i, e(r, "_reference"), s, {
key: n,
kind: "belongsTo",
changeType: "add"
});
o.sync(), this._changesToSync[n] && DS.OneToManyChange.ensureSameTransaction([o, this._changesToSync[n]], s)
}
}
delete this._changesToSync[n]
})
})
}(),
function () {
function e(e, i) {
var s = (t(e, "store"), t(e, "data").hasMany),
o = s[i.key];
if (o) {
var u = e.constructor.inverseFor(i.key).name;
r.call(o, function (t) {
var r;
(r = t.record) && e.suspendRelationshipObservers(function () {
n(r, u, null)
})
})
}
}
var t = Ember.get,
n = Ember.set,
r = Ember.ArrayPolyfills.forEach,
i = function (e, r) {
r = r || {};
var i = {
type: e,
isRelationship: !0,
options: r,
kind: "hasMany"
};
return Ember.computed(function (s) {
var o, u, a = t(this, "data").hasMany,
f = t(this, "store");
return "string" == typeof e && (e = t(this, e, !1) || t(Ember.lookup, e)), o = a[s], u = f.findMany(e, o, this, i), n(u, "owner", this), n(u, "name", s), n(u, "isPolymorphic", r.polymorphic), u
}).property().meta(i)
};
DS.hasMany = function (e, t) {
return i(e, t)
}, DS.Model.reopen({
clearHasMany: function (t) {
var n = this.cacheFor(t.name);
n ? n.clear() : e(this, t)
}
})
}(),
function () {
var e = Ember.get;
Ember.set, DS.Model.reopen({
didDefineProperty: function (e, t, n) {
if (n instanceof Ember.Descriptor) {
var r = n.meta();
r.isRelationship && "belongsTo" === r.kind && (Ember.addObserver(e, t, null, "belongsToDidChange"), Ember.addBeforeObserver(e, t, null, "belongsToWillChange")), r.isAttribute && (Ember.addObserver(e, t, null, "attributeDidChange"), Ember.addBeforeObserver(e, t, null, "attributeWillChange")), r.parentType = e.constructor
}
}
}), DS.Model.reopenClass({
typeForRelationship: function (t) {
var n = e(this, "relationshipsByName").get(t);
return n && n.type
},
inverseFor: function (t) {
function n(t, r, i) {
i = i || [];
var s = e(r, "relationships");
if (s) {
var o = s.get(t);
return o && i.push.apply(i, s.get(t)), t.superclass && n(t.superclass, r, i), i
}
}
var r = this.typeForRelationship(t);
if (!r) return null;
var i, s, o = this.metaForProperty(t).options;
if (o.inverse) i = o.inverse, s = Ember.get(r, "relationshipsByName").get(i).kind;
else {
var u = n(this, r);
if (0 === u.length) return null;
i = u[0].name, s = u[0].kind
}
return {
type: r,
name: i,
kind: s
}
},
relationships: Ember.computed(function () {
var e = new Ember.MapWithDefault({
defaultValue: function () {
return []
}
});
return this.eachComputedProperty(function (t, n) {
if (n.isRelationship) {
"string" == typeof n.type && (n.type = Ember.get(Ember.lookup, n.type));
var r = e.get(n.type);
r.push({
name: t,
kind: n.kind
})
}
}), e
}),
relationshipNames: Ember.computed(function () {
var e = {
hasMany: [],
belongsTo: []
};
return this.eachComputedProperty(function (t, n) {
n.isRelationship && e[n.kind].push(t)
}), e
}),
relatedTypes: Ember.computed(function () {
var t, n = Ember.A([]);
return this.eachComputedProperty(function (i, s) {
s.isRelationship && (t = s.type, "string" == typeof t && (t = e(this, t, !1) || e(Ember.lookup, t)), n.contains(t) || n.push(t))
}), n
}),
relationshipsByName: Ember.computed(function () {
var t, n = Ember.Map.create();
return this.eachComputedProperty(function (i, s) {
s.isRelationship && (s.key = i, t = s.type, "string" == typeof t && (t = e(this, t, !1) || e(Ember.lookup, t), s.type = t), n.set(i, s))
}), n
}),
fields: Ember.computed(function () {
var e = Ember.Map.create();
return this.eachComputedProperty(function (t, n) {
n.isRelationship ? e.set(t, n.kind) : n.isAttribute && e.set(t, "attribute")
}), e
}),
eachRelationship: function (t, n) {
e(this, "relationshipsByName").forEach(function (e, i) {
t.call(n, e, i)
})
},
eachRelatedType: function (t, n) {
e(this, "relatedTypes").forEach(function (e) {
t.call(n, e)
})
}
}), DS.Model.reopen({
eachRelationship: function (e, t) {
this.constructor.eachRelationship(e, t)
}
})
}(),
function () {
var e = Ember.get,
t = Ember.set,
n = Ember.EnumerableUtils.forEach;
DS.RelationshipChange = function (e) {
this.parentReference = e.parentReference, this.childReference = e.childReference, this.firstRecordReference = e.firstRecordReference, this.firstRecordKind = e.firstRecordKind, this.firstRecordName = e.firstRecordName, this.secondRecordReference = e.secondRecordReference, this.secondRecordKind = e.secondRecordKind, this.secondRecordName = e.secondRecordName, this.store = e.store, this.committed = {}, this.changeType = e.changeType
}, DS.RelationshipChangeAdd = function (e) {
DS.RelationshipChange.call(this, e)
}, DS.RelationshipChangeRemove = function (e) {
DS.RelationshipChange.call(this, e)
}, DS.RelationshipChange.create = function (e) {
return new DS.RelationshipChange(e)
}, DS.RelationshipChangeAdd.create = function (e) {
return new DS.RelationshipChangeAdd(e)
}, DS.RelationshipChangeRemove.create = function (e) {
return new DS.RelationshipChangeRemove(e)
}, DS.OneToManyChange = {}, DS.OneToNoneChange = {}, DS.ManyToNoneChange = {}, DS.OneToOneChange = {}, DS.ManyToManyChange = {}, DS.RelationshipChange._createChange = function (e) {
return "add" === e.changeType ? DS.RelationshipChangeAdd.create(e) : "remove" === e.changeType ? DS.RelationshipChangeRemove.create(e) : void 0
}, DS.RelationshipChange.determineRelationshipType = function (e, t) {
var n, r, i = t.key,
s = t.kind,
o = e.inverseFor(i);
return o && (n = o.name, r = o.kind), o ? "belongsTo" === r ? "belongsTo" === s ? "oneToOne" : "manyToOne" : "belongsTo" === s ? "oneToMany" : "manyToMany" : "belongsTo" === s ? "oneToNone" : "manyToNone"
}, DS.RelationshipChange.createChange = function (e, t, n, r) {
var i, s = e.type;
return i = DS.RelationshipChange.determineRelationshipType(s, r), "oneToMany" === i ? DS.OneToManyChange.createChange(e, t, n, r) : "manyToOne" ===
i ? DS.OneToManyChange.createChange(t, e, n, r) : "oneToNone" === i ? DS.OneToNoneChange.createChange(e, t, n, r) : "manyToNone" === i ? DS.ManyToNoneChange.createChange(e, t, n, r) : "oneToOne" === i ? DS.OneToOneChange.createChange(e, t, n, r) : "manyToMany" === i ? DS.ManyToManyChange.createChange(e, t, n, r) : void 0
}, DS.OneToNoneChange.createChange = function (e, t, n, r) {
var i = r.key,
s = DS.RelationshipChange._createChange({
parentReference: t,
childReference: e,
firstRecordReference: e,
store: n,
changeType: r.changeType,
firstRecordName: i,
firstRecordKind: "belongsTo"
});
return n.addRelationshipChangeFor(e, i, t, null, s), s
}, DS.ManyToNoneChange.createChange = function (e, t, n, r) {
var i = r.key,
s = DS.RelationshipChange._createChange({
parentReference: e,
childReference: t,
secondRecordReference: e,
store: n,
changeType: r.changeType,
secondRecordName: r.key,
secondRecordKind: "hasMany"
});
return n.addRelationshipChangeFor(e, i, t, null, s), s
}, DS.ManyToManyChange.createChange = function (e, t, n, r) {
var i = r.key,
s = DS.RelationshipChange._createChange({
parentReference: t,
childReference: e,
firstRecordReference: e,
secondRecordReference: t,
firstRecordKind: "hasMany",
secondRecordKind: "hasMany",
store: n,
changeType: r.changeType,
firstRecordName: i
});
return n.addRelationshipChangeFor(e, i, t, null, s), s
}, DS.OneToOneChange.createChange = function (e, t, n, r) {
var i;
r.parentType ? i = r.parentType.inverseFor(r.key).name : r.key && (i = r.key);
var s = DS.RelationshipChange._createChange({
parentReference: t,
childReference: e,
firstRecordReference: e,
secondRecordReference: t,
firstRecordKind: "belongsTo",
secondRecordKind: "belongsTo",
store: n,
changeType: r.changeType,
firstRecordName: i
});
return n.addRelationshipChangeFor(e, i, t, null, s), s
}, DS.OneToOneChange.maintainInvariant = function (t, n, r, i) {
if ("add" === t.changeType && n.recordIsMaterialized(r)) {
var s = n.recordForReference(r),
o = e(s, i);
if (o) {
var u = DS.OneToOneChange.createChange(r, o.get("_reference"), n, {
parentType: t.parentType,
hasManyName: t.hasManyName,
changeType: "remove",
key: t.key
});
n.addRelationshipChangeFor(r, i, t.parentReference, null, u), u.sync()
}
}
}, DS.OneToManyChange.createChange = function (e, t, n, r) {
var i;
r.parentType ? (i = r.parentType.inverseFor(r.key).name, DS.OneToManyChange.maintainInvariant(r, n, e, i)) : r.key && (i = r.key);
var s = DS.RelationshipChange._createChange({
parentReference: t,
childReference: e,
firstRecordReference: e,
secondRecordReference: t,
firstRecordKind: "belongsTo",
secondRecordKind: "hasMany",
store: n,
changeType: r.changeType,
firstRecordName: i
});
return n.addRelationshipChangeFor(e, i, t, s.getSecondRecordName(), s), s
}, DS.OneToManyChange.maintainInvariant = function (t, n, r, i) {
var s = r.record;
if ("add" === t.changeType && s) {
var o = e(s, i);
if (o) {
var u = DS.OneToManyChange.createChange(r, o.get("_reference"), n, {
parentType: t.parentType,
hasManyName: t.hasManyName,
changeType: "remove",
key: t.key
});
n.addRelationshipChangeFor(r, i, t.parentReference, u.getSecondRecordName(), u), u.sync()
}
}
}, DS.OneToManyChange.ensureSameTransaction = function (e) {
var t = Ember.A();
return n(e, function (e) {
t.addObject(e.getSecondRecord()), t.addObject(e.getFirstRecord())
}), DS.Transaction.ensureSameTransaction(t)
}, DS.RelationshipChange.prototype = {
getSecondRecordName: function () {
var e, t = this.secondRecordName;
if (!t) {
if (e = this.secondRecordReference, !e) return;
var n = this.firstRecordReference.type,
r = n.inverseFor(this.firstRecordName);
this.secondRecordName = r.name
}
return this.secondRecordName
},
getFirstRecordName: function () {
var e = this.firstRecordName;
return e
},
destroy: function () {
var e = this.childReference,
t = this.getFirstRecordName(),
n = this.getSecondRecordName(),
r = this.store;
r.removeRelationshipChangeFor(e, t, this.parentReference, n, this.changeType)
},
getByReference: function (e) {
return this.store, e ? e.record ? e.record : void 0 : e
},
getSecondRecord: function () {
return this.getByReference(this.secondRecordReference)
},
getFirstRecord: function () {
return this.getByReference(this.firstRecordReference)
},
ensureSameTransaction: function () {
var e = this.getFirstRecord(),
t = this.getSecondRecord(),
n = DS.Transaction.ensureSameTransaction([e, t]);
return this.transaction = n, n
},
callChangeEvents: function () {
var t = this.getFirstRecord(),
n = this.getSecondRecord(),
r = new Ember.OrderedSet;
n && e(n, "isLoaded") && this.store.recordHasManyDidChange(r, n, this), t && this.store.recordBelongsToDidChange(r, t, this), r.forEach(function (e) {
e.adapterDidDirty()
})
},
coalesce: function () {
var e = this.store.relationshipChangePairsFor(this.firstRecordReference);
n(e, function (e) {
var t = e.add,
n = e.remove;
t && n && (t.destroy(), n.destroy())
})
}
}, DS.RelationshipChangeAdd.prototype = Ember.create(DS.RelationshipChange.create({})), DS.RelationshipChangeRemove.prototype = Ember.create(DS.RelationshipChange.create({})), DS.RelationshipChangeAdd.prototype.changeType = "add", DS.RelationshipChangeAdd.prototype.sync = function () {
var n = this.getSecondRecordName(),
r = this.getFirstRecordName(),
i = this.getFirstRecord(),
s = this.getSecondRecord();
this.ensureSameTransaction(), this.callChangeEvents(), s && i && ("belongsTo" === this.secondRecordKind ? s.suspendRelationshipObservers(function () {
t(s, n, i)
}) : "hasMany" === this.secondRecordKind && s.suspendRelationshipObservers(function () {
e(s, n).addObject(i)
})), i && s && e(i, r) !== s && ("belongsTo" === this.firstRecordKind ? i.suspendRelationshipObservers(function () {
t(i, r, s)
}) : "hasMany" === this.firstRecordKind && i.suspendRelationshipObservers(function () {
e(i, r).addObject(s)
})), this.coalesce()
}, DS.RelationshipChangeRemove.prototype.changeType = "remove", DS.RelationshipChangeRemove.prototype.sync = function () {
var n = this.getSecondRecordName(),
r = this.getFirstRecordName(),
i = this.getFirstRecord(),
s = this.getSecondRecord();
this.ensureSameTransaction(i, s, n, r), this.callChangeEvents(), s && i && ("belongsTo" === this.secondRecordKind ? s.suspendRelationshipObservers(function () {
t(s, n, null)
}) : "hasMany" === this.secondRecordKind && s.suspendRelationshipObservers(function () {
e(s, n).removeObject(i)
})), i && e(i, r) && ("belongsTo" === this.firstRecordKind ? i.suspendRelationshipObservers(function () {
t(i, r, null)
}) : "hasMany" === this.firstRecordKind && i.suspendRelationshipObservers(function () {
e(i, r).removeObject(s)
})), this.coalesce()
}
}(),
function () {
var e = Ember.set;
Ember.onLoad("Ember.Application", function (t) {
t.registerInjection ? (t.registerInjection({
name: "store",
before: "controllers",
injection: function (t, n, r) {
n && "Store" === r && e(n, "store", t[r].create())
}
}), t.registerInjection({
name: "giveStoreToControllers",
after: ["store", "controllers"],
injection: function (e, t, n) {
if (t && /^[A-Z].*Controller$/.test(n)) {
var r = n.charAt(0).toLowerCase() + n.substr(1),
i = t.get("store"),
s = t.get(r);
if (!s) return;
s.set("store", i)
}
}
})) : t.initializer && (t.initializer({
name: "store",
initialize: function (e, t) {
t.register("store:main", t.Store), e.lookup("store:main")
}
}), t.initializer({
name: "injectStore",
initialize: function (e, t) {
t.inject("controller", "store", "store:main"), t.inject("route", "store", "store:main")
}
}))
})
}(),
function () {
function e(e) {
return function () {
throw new Ember.Error("Your serializer " + this.toString() + " does not implement the required method " + e)
}
}
var t = Ember.get,
n = (Ember.set, Ember.ArrayPolyfills.map),
r = Ember.isNone;
DS.Serializer = Ember.Object.extend({
init: function () {
this.mappings = Ember.Map.create(), this.aliases = Ember.Map.create(), this.configurations = Ember.Map.create(), this.globalConfigurations = {}
},
extract: e("extract"),
extractMany: e("extractMany"),
extractId: e("extractId"),
extractAttribute: e("extractAttribute"),
extractHasMany: e("extractHasMany"),
extractBelongsTo: e("extractBelongsTo"),
extractRecordRepresentation: function (e, t, n, i) {
var s, o = {};
return s = i ? e.sideload(t, n) : e.load(t, n), this.eachEmbeddedHasMany(t, function (t, i) {
var u = n[this.keyFor(i)];
r(u) || this.extractEmbeddedHasMany(e, i, u, s, o)
}, this), this.eachEmbeddedBelongsTo(t, function (t, i) {
var u = n[this.keyFor(i)];
r(u) || this.extractEmbeddedBelongsTo(e, i, u, s, o)
}, this), e.prematerialize(s, o), s
},
extractEmbeddedHasMany: function (e, t, r, i, s) {
var o = n.call(r, function (n) {
if (n) {
var r = this.extractEmbeddedType(t, n),
s = this.extractRecordRepresentation(e, r, n, !0),
o = this.embeddedType(i.type, t.key);
return "always" === o && (s.parent = i), s
}
}, this);
s[t.key] = o
},
extractEmbeddedBelongsTo: function (e, t, n, r, i) {
var s = this.extractEmbeddedType(t, n),
o = this.extractRecordRepresentation(e, s, n, !0);
i[t.key] = o;
var u = this.embeddedType(r.type, t.key);
"always" === u && (o.parent = r)
},
extractEmbeddedType: function (e) {
return e.type
},
serialize: function (e, n) {
n = n || {};
var r, i = this.createSerializedForm();
return n.includeId && (r = t(e, "id")) && this._addId(i, e.constructor, r), n.includeType && this.addType(i, e.constructor), this.addAttributes(i, e), this.addRelationships(i, e), i
},
serializeValue: function (e, t) {
var n = this.transforms ? this.transforms[t] : null;
return n.serialize(e)
},
serializeId: function (e) {
return isNaN(e) ? e : +e
},
addAttributes: function (e, t) {
t.eachAttribute(function (n, r) {
this._addAttribute(e, t, n, r.type)
}, this)
},
addAttribute: e("addAttribute"),
addId: e("addId"),
addType: Ember.K,
createSerializedForm: function () {
return {}
},
addRelationships: function (e, t) {
t.eachRelationship(function (n, r) {
"belongsTo" === r.kind ? this._addBelongsTo(e, t, n, r) : "hasMany" === r.kind && this._addHasMany(e, t, n, r)
}, this)
},
addBelongsTo: e("addBelongsTo"),
addHasMany: e("addHasMany"),
keyForAttributeName: function (e, t) {
return t
},
primaryKey: function () {
return "id"
},
keyForBelongsTo: function (e, t) {
return this.keyForAttributeName(e, t)
},
keyForHasMany: function (e, t) {
return this.keyForAttributeName(e, t)
},
materialize: function (e, n, r) {
var i;
Ember.isNone(t(e, "id")) && (i = r && r.hasOwnProperty("id") ? r.id : this.extractId(e.constructor, n), e.materializeId(i)), this.materializeAttributes(e, n, r), this.materializeRelationships(e, n, r)
},
deserializeValue: function (e, t) {
var n = this.transforms ? this.transforms[t] : null;
return n.deserialize(e)
},
materializeAttributes: function (e, t, n) {
e.eachAttribute(function (r, i) {
n && n.hasOwnProperty(r) ? e.materializeAttribute(r, n[r]) : this.materializeAttribute(e, t, r, i.type)
}, this)
},
materializeAttribute: function (e, t, n, r) {
var i = this.extractAttribute(e.constructor, t, n);
i = this.deserializeValue(i, r), e.materializeAttribute(n, i)
},
materializeRelationships: function (e, t, n) {
e.eachRelationship(function (r, i) {
if ("hasMany" === i.kind)
if (n && n.hasOwnProperty(r)) {
var s = this._convertPrematerializedHasMany(i.type, n[r]);
e.materializeHasMany(r, s)
} else this.materializeHasMany(r, e, t, i, n);
else if ("belongsTo" === i.kind)
if (n && n.hasOwnProperty(r)) {
var o = this._convertTuple(i.type, n[r]);
e.materializeBelongsTo(r, o)
} else this.materializeBelongsTo(r, e, t, i, n)
}, this)
},
materializeHasMany: function (e, t, n, r) {
var i = t.constructor,
s = this._keyForHasMany(i, r.key),
o = this.extractHasMany(i, n, s),
u = o;
o && Ember.isArray(o) && (u = this._convertTuples(r.type, o)), t.materializeHasMany(e, u)
},
materializeBelongsTo: function (e, t, n, i) {
var s, o = t.constructor,
u = this._keyForBelongsTo(o, i.key),
a = null;
s = i.options && i.options.polymorphic ? this.extractBelongsToPolymorphic(o, n, u) : this.extractBelongsTo(o, n, u), r(s) || (a = this._convertTuple(i.type, s)), t.materializeBelongsTo(e, a)
},
_convertPrematerializedHasMany: function (e, t) {
var n;
return n = "string" == typeof t ? t : this._convertTuples(e, t)
},
_convertTuples: function (e, t) {
return n.call(t, function (t) {
return this._convertTuple(e, t)
}, this)
},
_convertTuple: function (e, t) {
var n;
return "object" == typeof t ? DS.Model.detect(t.type) ? t : (n = this.typeFromAlias(t.type), {
id: t.id,
type: n
}) : {
id: t,
type: e
}
},
_primaryKey: function (e) {
var t = this.configurationForType(e),
n = t && t.primaryKey;
return n ? n : this.primaryKey(e)
},
_addAttribute: function (e, n, r, i) {
var s = this._keyForAttributeName(n.constructor, r),
o = t(n, r);
this.addAttribute(e, s, this.serializeValue(o, i))
},
_addId: function (e, t, n) {
var r = this._primaryKey(t);
this.addId(e, r, this.serializeId(n))
},
_keyForAttributeName: function (e, t) {
return this._keyFromMappingOrHook("keyForAttributeName", e, t)
},
_keyForBelongsTo: function (e, t) {
return this._keyFromMappingOrHook("keyForBelongsTo", e, t)
},
keyFor: function (e) {
var t = e.parentType,
n = e.key;
switch (e.kind) {
case "belongsTo":
return this._keyForBelongsTo(t, n);
case "hasMany":
return this._keyForHasMany(t, n)
}
},
_keyForHasMany: function (e, t) {
return this._keyFromMappingOrHook("keyForHasMany", e, t)
},
_addBelongsTo: function (e, t, n, r) {
var i = this._keyForBelongsTo(t.constructor, n);
this.addBelongsTo(e, t, i, r)
},
_addHasMany: function (e, t, n, r) {
var i = this._keyForHasMany(t.constructor, n);
this.addHasMany(e, t, i, r)
},
_keyFromMappingOrHook: function (e, t, n) {
var r = this.mappingOption(t, n, "key");
return r ? r : this[e](t, n)
},
registerTransform: function (e, t) {
this.transforms[e] = t
},
registerEnumTransform: function (e, t) {
var n = {
deserialize: function (e) {
return Ember.A(t).objectAt(e)
},
serialize: function (e) {
return Ember.EnumerableUtils.indexOf(t, e)
},
values: t
};
this.registerTransform(e, n)
},
map: function (e, t) {
this.mappings.set(e, t)
},
configure: function (e, t) {
if (e && !t) return Ember.merge(this.globalConfigurations, e), void 0;
var n, r;
t.alias && (r = t.alias, this.aliases.set(r, e), delete t.alias), n = Ember.create(this.globalConfigurations), Ember.merge(n, t), this.configurations.set(e, n)
},
typeFromAlias: function (e) {
return this._completeAliases(), this.aliases.get(e)
},
mappingForType: function (e) {
return this._reifyMappings(), this.mappings.get(e) || {}
},
configurationForType: function (e) {
return this._reifyConfigurations(), this.configurations.get(e) || this.globalConfigurations
},
_completeAliases: function () {
this._pluralizeAliases(), this._reifyAliases()
},
_pluralizeAliases: function () {
if (!this._didPluralizeAliases) {
var e, t = this.aliases,
n = this.aliases.sideloadMapping,
r = this;
t.forEach(function (n, i) {
e = r.pluralize(n), t.set(e, i)
}), n && (n.forEach(function (e, n) {
t.set(e, n)
}), delete this.aliases.sideloadMapping), this._didPluralizeAliases = !0
}
},
_reifyAliases: function () {
if (!this._didReifyAliases) {
var e, t = this.aliases,
n = Ember.Map.create();
t.forEach(function (t, r) {
"string" == typeof r ? (e = Ember.get(Ember.lookup, r), n.set(t, e)) : n.set(t, r)
}), this.aliases = n, this._didReifyAliases = !0
}
},
_reifyMappings: function () {
if (!this._didReifyMappings) {
var e = this.mappings,
t = Ember.Map.create();
e.forEach(function (e, n) {
if ("string" == typeof e) {
var r = Ember.get(Ember.lookup, e);
t.set(r, n)
} else t.set(e, n)
}), this.mappings = t, this._didReifyMappings = !0
}
},
_reifyConfigurations: function () {
if (!this._didReifyConfigurations) {
var e = this.configurations,
t = Ember.Map.create();
e.forEach(function (e, n) {
if ("string" == typeof e && "plurals" !== e) {
var r = Ember.get(Ember.lookup, e);
t.set(r, n)
} else t.set(e, n)
}), this.configurations = t, this._didReifyConfigurations = !0
}
},
mappingOption: function (e, t, n) {
var r = this.mappingForType(e)[t];
return r && r[n]
},
configOption: function (e, t) {
var n = this.configurationForType(e);
return n[t]
},
embeddedType: function (e, t) {
return this.mappingOption(e, t, "embedded")
},
eachEmbeddedRecord: function (e, t, n) {
this.eachEmbeddedBelongsToRecord(e, t, n), this.eachEmbeddedHasManyRecord(e, t, n)
},
eachEmbeddedBelongsToRecord: function (e, n, r) {
this.eachEmbeddedBelongsTo(e.constructor, function (i, s, o) {
var u = t(e, i);
u && n.call(r, u, o)
})
},
eachEmbeddedHasManyRecord: function (e, n, r) {
this.eachEmbeddedHasMany(e.constructor, function (i, s, o) {
for (var u = t(e, i), a = 0, f = t(u, "length"); f > a; a++) n.call(r, u.objectAt(a), o)
})
},
eachEmbeddedHasMany: function (e, t, n) {
this.eachEmbeddedRelationship(e, "hasMany", t, n)
},
eachEmbeddedBelongsTo: function (e, t, n) {
this.eachEmbeddedRelationship(e, "belongsTo", t, n)
},
eachEmbeddedRelationship: function (e, t, n, r) {
e.eachRelationship(function (i, s) {
var o = this.embeddedType(e, i);
o && s.kind === t && n.call(r, i, s, o)
}, this)
},
pluralize: function (e) {
var t = this.configurations.get("plurals");
return t && t[e] || e + "s"
},
singularize: function (e) {
var t = this.configurations.get("plurals");
if (t)
for (var n in t)
if (t[n] === e) return n;
return e.lastIndexOf("s") === e.length - 1 ? e.substring(0, e.length - 1) : e
}
})
}(),
function () {
var e = Ember.isNone,
t = Ember.isEmpty;
DS.JSONTransforms = {
string: {
deserialize: function (t) {
return e(t) ? null : String(t)
},
serialize: function (t) {
return e(t) ? null : String(t)
}
},
number: {
deserialize: function (e) {
return t(e) ? null : Number(e)
},
serialize: function (e) {
return t(e) ? null : Number(e)
}
},
"boolean": {
deserialize: function (e) {
var t = typeof e;
return "boolean" === t ? e : "string" === t ? null !== e.match(/^true$|^t$|^1$/i) : "number" === t ? 1 === e : !1
},
serialize: function (e) {
return Boolean(e)
}
},
date: {
deserialize: function (e) {
var t = typeof e;
return "string" === t ? new Date(Ember.Date.parse(e)) : "number" === t ? new Date(e) : null === e || void 0 === e ? e : null
},
serialize: function (e) {
if (e instanceof Date) {
var t = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
n = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
r = function (e) {
return 10 > e ? "0" + e : "" + e
}, i = e.getUTCFullYear(),
s = e.getUTCMonth(),
o = e.getUTCDate(),
u = e.getUTCDay(),
a = e.getUTCHours(),
f = e.getUTCMinutes(),
l = e.getUTCSeconds(),
c = t[u],
h = r(o),
p = n[s];
return c + ", " + h + " " + p + " " + i + " " + r(a) + ":" + r(f) + ":" + r(l) + " GMT"
}
return null
}
}
}
}(),
function () {
var e = Ember.get;
Ember.set, DS.JSONSerializer = DS.Serializer.extend({
init: function () {
this._super(), e(this, "transforms") || this.set("transforms", DS.JSONTransforms), this.sideloadMapping = Ember.Map.create(), this.metadataMapping = Ember.Map.create(), this.configure({
meta: "meta",
since: "since"
})
},
configure: function (t, n) {
var r;
if (t && !n) {
for (r in t) this.metadataMapping.set(e(t, r), r);
return this._super(t)
}
var i, s = n.sideloadAs;
s && (i = this.aliases.sideloadMapping || Ember.Map.create(), i.set(s, t), this.aliases.sideloadMapping = i, delete n.sideloadAs), this._super.apply(this, arguments)
},
addId: function (e, t, n) {
e[t] = n
},
addAttribute: function (e, t, n) {
e[t] = n
},
extractAttribute: function (e, t, n) {
var r = this._keyForAttributeName(e, n);
return t[r]
},
extractId: function (e, t) {
var n = this._primaryKey(e);
return t.hasOwnProperty(n) ? t[n] + "" : null
},
extractHasMany: function (e, t, n) {
return t[n]
},
extractBelongsTo: function (e, t, n) {
return t[n]
},
extractBelongsToPolymorphic: function (e, t, n) {
var r, i = this.keyForPolymorphicId(n),
s = t[i];
return s ? (r = this.keyForPolymorphicType(n), {
id: s,
type: t[r]
}) : null
},
addBelongsTo: function (t, n, r, i) {
var s, o, u, a = n.constructor,
f = i.key,
l = null,
c = i.options && i.options.polymorphic;
this.embeddedType(a, f) ? ((s = e(n, f)) && (l = this.serialize(s, {
includeId: !0,
includeType: c
})), t[r] = l) : (o = e(n, i.key), u = e(o, "id"), i.options && i.options.polymorphic && !Ember.isNone(u) ? this.addBelongsToPolymorphic(t, r, u, o.constructor) : t[r] = void 0 === u ? null : this.serializeId(u))
},
addBelongsToPolymorphic: function (e, t, n, r) {
var i = this.keyForPolymorphicId(t),
s = this.keyForPolymorphicType(t);
e[i] = n, e[s] = this.rootForType(r)
},
addHasMany: function (t, n, r, i) {
var s, o, u = n.constructor,
a = i.key,
f = [],
l = i.options && i.options.polymorphic;
o = this.embeddedType(u, a), "always" === o && (s = e(n, a), s.forEach(function (e) {
f.push(this.serialize(e, {
includeId: !0,
includeType: l
}))
}, this), t[r] = f)
},
addType: function (e, t) {
var n = this.keyForEmbeddedType();
e[n] = this.rootForType(t)
},
extract: function (e, t, n, r) {
var i = this.rootForType(n);
this.sideload(e, n, t, i), this.extractMeta(e, n, t), t[i] && (r && e.updateId(r, t[i]), this.extractRecordRepresentation(e, n, t[i]))
},
extractMany: function (e, t, n, r) {
var i = this.rootForType(n);
if (i = this.pluralize(i), this.sideload(e, n, t, i), this.extractMeta(e, n, t), t[i]) {
var s = t[i],
o = [];
r && (r = r.toArray());
for (var u = 0; s.length > u; u++) {
r && e.updateId(r[u], s[u]);
var a = this.extractRecordRepresentation(e, n, s[u]);
o.push(a)
}
e.populateArray(o)
}
},
extractMeta: function (e, t, n) {
var r, i = this.configOption(t, "meta"),
s = n;
i && n[i] && (s = n[i]), this.metadataMapping.forEach(function (n, i) {
(r = s[n]) && e.metaForType(t, i, r)
})
},
extractEmbeddedType: function (e, t) {
var n = e.type;
if (e.options && e.options.polymorphic) {
var r = this.keyFor(e),
i = this.keyForEmbeddedType(r);
n = this.typeFromAlias(t[i]), delete t[i]
}
return n
},
sideload: function (e, t, n, r) {
var i;
this.configureSideloadMappingForType(t);
for (var s in n) n.hasOwnProperty(s) && s !== r && !this.metadataMapping.get(s) && (i = this.typeFromAlias(s), this.loadValue(e, i, n[s]))
},
configureSideloadMappingForType: function (e, t) {
t || (t = Ember.A([])), t.pushObject(e), e.eachRelatedType(function (e) {
if (!t.contains(e)) {
var n = this.defaultSideloadRootForType(e);
this.aliases.set(n, e), this.configureSideloadMappingForType(e, t)
}
}, this)
},
loadValue: function (e, t, n) {
if (n instanceof Array)
for (var r = 0; n.length > r; r++) e.sideload(t, n[r]);
else e.sideload(t, n)
},
keyForPolymorphicId: Ember.K,
keyForPolymorphicType: Ember.K,
keyForEmbeddedType: function () {
return "type"
},
rootForType: function (e) {
var t = e.toString(),
n = t.split("."),
r = n[n.length - 1];
return r.replace(/([A-Z])/g, "_$1").toLowerCase().slice(1)
},
defaultSideloadRootForType: function (e) {
return this.pluralize(this.rootForType(e))
}
})
}(),
function () {
function e(e) {
return {
load: function (t, n, r) {
return e.load(t, n, r)
},
loadMany: function (t, n) {
return e.loadMany(t, n)
},
updateId: function (t, n) {
return e.updateId(t, n)
},
populateArray: Ember.K,
sideload: function (t, n) {
return e.adapterForType(t).load(e, t, n)
},
sideloadMany: function (t, n) {
return e.loadMany(t, n)
},
prematerialize: function (e, t) {
e.prematerialized = t
},
metaForType: function (t, n, r) {
e.metaForType(t, n, r)
}
}
}
var t = Ember.get,
n = Ember.set,
r = Ember.merge;
DS.loaderFor = e, DS.Adapter = Ember.Object.extend(DS._Mappable, {
init: function () {
var e = t(this, "serializer");
Ember.Object.detect(e) && (e = e.create(), n(this, "serializer", e)), this._attributesMap = this.createInstanceMapFor("attributes"), this._configurationsMap = this.createInstanceMapFor("configurations"), this._outstandingOperations = new Ember.MapWithDefault({
defaultValue: function () {
return 0
}
}), this._dependencies = new Ember.MapWithDefault({
defaultValue: function () {
return new Ember.OrderedSet
}
}), this.registerSerializerTransforms(this.constructor, e, {}), this.registerSerializerMappings(e)
},
load: function (n, r, i) {
var s = e(n);
return t(this, "serializer").extractRecordRepresentation(s, r, i)
},
didCreateRecord: function (e, n, r, i) {
if (e.didSaveRecord(r), i) {
var s = DS.loaderFor(e);
s.load = function (t, n, i) {
return e.updateId(r, n), e.load(t, n, i)
}, t(this, "serializer").extract(s, i, n)
}
},
didCreateRecords: function (e, n, r, i) {
if (r.forEach(function (t) {
e.didSaveRecord(t)
}, this), i) {
var s = DS.loaderFor(e);
t(this, "serializer").extractMany(s, i, n, r)
}
},
didSaveRecord: function (e, n, r, i) {
e.didSaveRecord(r);
var s = t(this, "serializer");
if (s.eachEmbeddedRecord(r, function (t, n) {
"load" !== n && this.didSaveRecord(e, t.constructor, t)
}, this), i) {
var o = DS.loaderFor(e);
s.extract(o, i, n)
}
},
didUpdateRecord: function () {
this.didSaveRecord.apply(this, arguments)
},
didDeleteRecord: function () {
this.didSaveRecord.apply(this, arguments)
},
didSaveRecords: function (e, n, r, i) {
if (r.forEach(function (t) {
e.didSaveRecord(t)
}, this), i) {
var s = DS.loaderFor(e);
t(this, "serializer").extractMany(s, i, n)
}
},
didUpdateRecords: function () {
this.didSaveRecords.apply(this, arguments)
},
didDeleteRecords: function () {
this.didSaveRecords.apply(this, arguments)
},
didFindRecord: function (e, n, r, i) {
var s = DS.loaderFor(e);
s.load = function (t, n, r) {
return r = r || {}, r.id = i, e.load(t, n, r)
}, t(this, "serializer").extract(s, r, n)
},
didFindAll: function (e, n, r) {
var i = DS.loaderFor(e),
s = t(this, "serializer");
e.didUpdateAll(n), s.extractMany(i, r, n)
},
didFindQuery: function (e, n, r, i) {
var s = DS.loaderFor(e);
s.populateArray = function (e) {
i.load(e)
}, t(this, "serializer").extractMany(s, r, n)
},
didFindMany: function (e, n, r) {
var i = DS.loaderFor(e);
t(this, "serializer").extractMany(i, r, n)
},
didError: function (e, t, n) {
e.recordWasError(n)
},
dirtyRecordsForAttributeChange: function (e, t, n, r, i) {
r !== i && this.dirtyRecordsForRecordChange(e, t)
},
dirtyRecordsForRecordChange: function (e, t) {
e.add(t)
},
dirtyRecordsForBelongsToChange: function (e, t) {
this.dirtyRecordsForRecordChange(e, t)
},
dirtyRecordsForHasManyChange: function (e, t) {
this.dirtyRecordsForRecordChange(e, t)
},
registerSerializerTransforms: function (e, t, n) {
var r, i, s = e._registeredTransforms,
o = e._registeredEnumTransforms;
for (i in s)!s.hasOwnProperty(i) || i in n || (n[i] = !0, t.registerTransform(i, s[i]));
for (i in o)!o.hasOwnProperty(i) || i in n || (n[i] = !0, t.registerEnumTransform(i, o[i]));
(r = e.superclass) && this.registerSerializerTransforms(r, t, n)
},
registerSerializerMappings: function (e) {
var t = this._attributesMap,
n = this._configurationsMap;
t.forEach(e.map, e), n.forEach(e.configure, e)
},
find: null,
serializer: DS.JSONSerializer,
registerTransform: function (e, n) {
t(this, "serializer").registerTransform(e, n)
},
registerEnumTransform: function (e, n) {
t(this, "serializer").registerEnumTransform(e, n)
},
generateIdForRecord: null,
materialize: function (e, n, r) {
t(this, "serializer").materialize(e, n, r)
},
serialize: function (e, n) {
return t(this, "serializer").serialize(e, n)
},
extractId: function (e, n) {
return t(this, "serializer").extractId(e, n)
},
groupByType: function (e) {
var t = Ember.MapWithDefault.create({
defaultValue: function () {
return Ember.OrderedSet.create()
}
});
return e.forEach(function (e) {
t.get(e.constructor).add(e)
}), t
},
commit: function (e, t) {
this.save(e, t)
},
save: function (e, t) {
function n(e) {
var t = Ember.OrderedSet.create();
return e.forEach(function (e) {
r.shouldSave(e) && t.add(e)
}), t
}
var r = this;
this.groupByType(t.created).forEach(function (t, r) {
this.createRecords(e, t, n(r))
}, this), this.groupByType(t.updated).forEach(function (t, r) {
this.updateRecords(e, t, n(r))
}, this), this.groupByType(t.deleted).forEach(function (t, r) {
this.deleteRecords(e, t, n(r))
}, this)
},
shouldSave: Ember.K,
createRecords: function (e, t, n) {
n.forEach(function (n) {
this.createRecord(e, t, n)
}, this)
},
updateRecords: function (e, t, n) {
n.forEach(function (n) {
this.updateRecord(e, t, n)
}, this)
},
deleteRecords: function (e, t, n) {
n.forEach(function (n) {
this.deleteRecord(e, t, n)
}, this)
},
findMany: function (e, t, n) {
n.forEach(function (n) {
this.find(e, t, n)
}, this)
}
}), DS.Adapter.reopenClass({
registerTransform: function (e, t) {
var n = this._registeredTransforms || {};
n[e] = t, this._registeredTransforms = n
},
registerEnumTransform: function (e, t) {
var n = this._registeredEnumTransforms || {};
n[e] = t, this._registeredEnumTransforms = n
},
map: DS._Mappable.generateMapFunctionFor("attributes", function (e, t, n) {
var i = n.get(e);
r(i, t)
}),
configure: DS._Mappable.generateMapFunctionFor("configurations", function (e, t, n) {
var i = n.get(e),
s = t && t.mappings;
s && (this.map(e, s), delete t.mappings), r(i, t)
}),
resolveMapConflict: function (e, t) {
return r(t, e), t
}
})
}(),
function () {
var e = Ember.get;
Ember.set, DS.FixtureSerializer = DS.Serializer.extend({
deserializeValue: function (e) {
return e
},
serializeValue: function (e) {
return e
},
addId: function (e, t, n) {
e[t] = n
},
addAttribute: function (e, t, n) {
e[t] = n
},
addBelongsTo: function (t, n, r, i) {
var s = e(n, i.key + ".id");
Ember.isNone(s) || (t[r] = s)
},
addHasMany: function (t, n, r, i) {
var s = e(n, i.key).map(function (e) {
return e.get("id")
});
t[i.key] = s
},
extract: function (e, t, n, r) {
r && e.updateId(r, t), this.extractRecordRepresentation(e, n, t)
},
extractMany: function (e, t, n, r) {
var i = t,
s = [];
r && (r = r.toArray());
for (var o = 0; i.length > o; o++) {
r && e.updateId(r[o], i[o]);
var u = this.extractRecordRepresentation(e, n, i[o]);
s.push(u)
}
e.populateArray(s)
},
extractId: function (e, t) {
var n = this._primaryKey(e);
return t.hasOwnProperty(n) ? t[n] + "" : null
},
extractAttribute: function (e, t, n) {
var r = this._keyForAttributeName(e, n);
return t[r]
},
extractHasMany: function (e, t, n) {
return t[n]
},
extractBelongsTo: function (e, t, n) {
var r = t[n];
return null !== r && void 0 !== r && (r += ""), r
},
extractBelongsToPolymorphic: function (e, t, n) {
var r, i = this.keyForPolymorphicId(n),
s = t[i];
return s ? (r = this.keyForPolymorphicType(n), {
id: s,
type: t[r]
}) : null
},
keyForPolymorphicId: function (e) {
return e
},
keyForPolymorphicType: function (e) {
return e + "_type"
}
})
}(),
function () {
var e = Ember.get,
t = Ember.String.fmt,
n = Ember.get(window, "JSON.stringify") || function (e) {
return e.toString()
};
DS.FixtureAdapter = DS.Adapter.extend({
simulateRemoteResponse: !0,
latency: 50,
serializer: DS.FixtureSerializer,
fixturesForType: function (e) {
if (e.FIXTURES) {
var i = Ember.A(e.FIXTURES);
return i.map(function (e) {
if (!e.id) throw new Error(t("the id property must be defined for fixture %@", [n(e)]));
return e.id = e.id + "", e
})
}
return null
},
queryFixtures: function () {},
updateFixtures: function (e, t) {
e.FIXTURES || (e.FIXTURES = []);
var n = e.FIXTURES;
this.deleteLoadedFixture(e, t), n.push(t)
},
mockJSON: function (e, t) {
return this.serialize(t, {
includeId: !0
})
},
generateIdForRecord: function (e, t) {
return Ember.guidFor(t)
},
find: function (e, t, n) {
var r, i = this.fixturesForType(t);
i && (r = Ember.A(i).findProperty("id", n)), r && this.simulateRemoteCall(function () {
this.didFindRecord(e, t, r, n)
}, this)
},
findMany: function (e, t, n) {
var r = this.fixturesForType(t);
r && (r = r.filter(function (e) {
return -1 !== n.indexOf(e.id)
})), r && this.simulateRemoteCall(function () {
this.didFindMany(e, t, r)
}, this)
},
findAll: function (e, t) {
var n = this.fixturesForType(t);
this.simulateRemoteCall(function () {
this.didFindAll(e, t, n)
}, this)
},
findQuery: function (e, t, n, r) {
var i = this.fixturesForType(t);
i = this.queryFixtures(i, n, t), i && this.simulateRemoteCall(function () {
this.didFindQuery(e, t, i, r)
}, this)
},
createRecord: function (e, t, n) {
var r = this.mockJSON(t, n);
this.updateFixtures(t, r), this.simulateRemoteCall(function () {
this.didCreateRecord(e, t, n, r)
}, this)
},
updateRecord: function (e, t, n) {
var r = this.mockJSON(t, n);
this.updateFixtures(t, r), this.simulateRemoteCall(function () {
this.didUpdateRecord(e, t, n, r)
}, this)
},
deleteRecord: function (e, t, n) {
var r = this.mockJSON(t, n);
this.deleteLoadedFixture(t, r), this.simulateRemoteCall(function () {
this.didDeleteRecord(e, t, n)
}, this)
},
deleteLoadedFixture: function (e, t) {
var n = this.findExistingFixture(e, t);
if (n) {
var r = e.FIXTURES.indexOf(n);
return e.FIXTURES.splice(r, 1), !0
}
},
findExistingFixture: function (e, t) {
var n = this.fixturesForType(e),
r = this.extractId(e, t);
return this.findFixtureById(n, r)
},
findFixtureById: function (t, n) {
return Ember.A(t).find(function (t) {
return "" + e(t, "id") == "" + n ? !0 : !1
})
},
simulateRemoteCall: function (t, n) {
e(this, "simulateRemoteResponse") ? Ember.run.later(n, t, e(this, "latency")) : Ember.run.once(n, t)
}
})
}(),
function () {
var e = Ember.get;
DS.RESTSerializer = DS.JSONSerializer.extend({
keyForAttributeName: function (e, t) {
return Ember.String.decamelize(t)
},
keyForBelongsTo: function (e, t) {
var n = this.keyForAttributeName(e, t);
return this.embeddedType(e, t) ? n : n + "_id"
},
keyForHasMany: function (e, t) {
var n = this.keyForAttributeName(e, t);
return this.embeddedType(e, t) ? n : this.singularize(n) + "_ids"
},
keyForPolymorphicId: function (e) {
return e
},
keyForPolymorphicType: function (e) {
return e.replace(/_id$/, "_type")
},
extractValidationErrors: function (t, n) {
var r = {};
return e(t, "attributes").forEach(function (e) {
var i = this._keyForAttributeName(t, e);
n.errors.hasOwnProperty(i) && (r[e] = n.errors[i])
}, this), r
}
})
}(),
function () {
var e = Ember.get;
Ember.set, DS.RESTAdapter = DS.Adapter.extend({
namespace: null,
bulkCommit: !1,
since: "since",
serializer: DS.RESTSerializer,
init: function () {
this._super.apply(this, arguments)
},
shouldSave: function (t) {
var n = e(t, "_reference");
return !n.parent
},
dirtyRecordsForRecordChange: function (e, t) {
this._dirtyTree(e, t)
},
dirtyRecordsForHasManyChange: function (t, n, r) {
var i = e(this, "serializer").embeddedType(n.constructor, r.secondRecordName);
"always" === i && (r.childReference.parent = r.parentReference, this._dirtyTree(t, n))
},
_dirtyTree: function (t, n) {
t.add(n), e(this, "serializer").eachEmbeddedRecord(n, function (e, n) {
"always" === n && (t.has(e) || this._dirtyTree(t, e))
}, this);
var r = n.get("_reference");
if (r.parent) {
var i = e(n, "store"),
s = i.recordForReference(r.parent);
this._dirtyTree(t, s)
}
},
createRecord: function (e, t, n) {
var r = this.rootForType(t),
i = this,
s = {};
return s[r] = this.serialize(n, {
includeId: !0
}), this.ajax(this.buildURL(r), "POST", {
data: s
}).then(function (r) {
Ember.run(i, "didCreateRecord", e, t, n, r)
}, function (r) {
throw i.didError(e, t, n, r), r
})
},
createRecords: function (t, n, r) {
var i = this;
if (e(this, "bulkCommit") === !1) return this._super(t, n, r);
var s = this.rootForType(n),
o = this.pluralize(s),
u = {};
return u[o] = [], r.forEach(function (e) {
u[o].push(this.serialize(e, {
includeId: !0
}))
}, this), this.ajax(this.buildURL(s), "POST", {
data: u
}).then(function (e) {
Ember.run(i, "didCreateRecords", t, n, r, e)
})
},
updateRecord: function (t, n, r) {
var i, s, o, u;
return i = e(r, "id"), s = this.rootForType(n), o = this, u = {}, u[s] = this.serialize(r), this.ajax(this.buildURL(s, i), "PUT", {
data: u
}).then(function (e) {
Ember.run(o, "didUpdateRecord", t, n, r, e)
}, function (e) {
throw o.didError(t, n, r, e), e
})
},
updateRecords: function (t, n, r) {
var i, s, o, u;
return e(this, "bulkCommit") === !1 ? this._super(t, n, r) : (i = this.rootForType(n), s = this.pluralize(i), o = this, u = {}, u[s] = [], r.forEach(function (e) {
u[s].push(this.serialize(e, {
includeId: !0
}))
}, this), this.ajax(this.buildURL(i, "bulk"), "PUT", {
data: u
}).then(function (e) {
Ember.run(o, "didUpdateRecords", t, n, r, e)
}))
},
deleteRecord: function (t, n, r) {
var i, s, o;
return i = e(r, "id"), s = this.rootForType(n), o = this, this.ajax(this.buildURL(s, i), "DELETE").then(function (e) {
Ember.run(o, "didDeleteRecord", t, n, r, e)
}, function (e) {
throw o.didError(t, n, r, e), e
})
},
deleteRecords: function (t, n, r) {
var i, s, o, u, a;
return e(this, "bulkCommit") === !1 ? this._super(t, n, r) : (i = this.rootForType(n), s = this.pluralize(i), o = e(this, "serializer"), u = this, a = {}, a[s] = [], r.forEach(function (t) {
a[s].push(o.serializeId(e(t, "id")))
}), this.ajax(this.buildURL(i, "bulk"), "DELETE", {
data: a
}).then(function (e) {
Ember.run(u, "didDeleteRecords", t, n, r, e)
}))
},
find: function (e, t, n) {
var r = this.rootForType(t),
i = this;
return this.ajax(this.buildURL(r, n), "GET").then(function (r) {
return Ember.run(i, "didFindRecord", e, t, r, n)
})
},
findAll: function (e, t, n) {
var r, i;
return r = this.rootForType(t), i = this, this.ajax(this.buildURL(r), "GET", {
data: this.sinceQuery(n)
}).then(function (n) {
Ember.run(i, "didFindAll", e, t, n)
})
},
findQuery: function (e, t, n, r) {
var i = this.rootForType(t),
s = this;
return this.ajax(this.buildURL(i), "GET", {
data: n
}).then(function (n) {
Ember.run(s, function () {
this.didFindQuery(e, t, n, r)
})
})
},
findMany: function (e, t, n) {
var r = this.rootForType(t),
i = this;
return n = this.serializeIds(n), this.ajax(this.buildURL(r), "GET", {
data: {
ids: n
}
}).then(function (n) {
return Ember.run(i, "didFindMany", e, t, n)
})
},
serializeIds: function (t) {
var n = e(this, "serializer");
return Ember.EnumerableUtils.map(t, function (e) {
return n.serializeId(e)
})
},
didError: function (t, n, r, i) {
if (422 === i.status) {
var s = JSON.parse(i.responseText),
o = e(this, "serializer"),
u = o.extractValidationErrors(n, s);
t.recordWasInvalid(r, u)
} else this._super.apply(this, arguments)
},
ajax: function (e, t, n) {
try {
return n = n || {}, n.url = e, n.type = t, n.dataType = "json", n.context = this, n.data && "GET" !== t && (n.contentType = "application/json; charset=utf-8", n.data = JSON.stringify(n.data)), Ember.RSVP.resolve(jQuery.ajax(n))
} catch (r) {
return Ember.RSVP.reject(r)
}
},
url: "",
rootForType: function (t) {
var n = e(this, "serializer");
return n.rootForType(t)
},
pluralize: function (t) {
var n = e(this, "serializer");
return n.pluralize(t)
},
buildURL: function (e, t) {
var n = [this.url];
return Ember.isNone(this.namespace) || n.push(this.namespace), n.push(this.pluralize(e)), void 0 !== t && n.push(t), n.join("/")
},
sinceQuery: function (t) {
var n = {};
return n[e(this, "since")] = t, t ? n : null
}
})
}()
}(), "undefined" == typeof location || "localhost" !== location.hostname && "127.0.0.1" !== location.hostname || console.warn("You are running a production build of Ember on localhost and won't receive detailed error messages. If you want full error messages please use the non-minified build provided on the Ember website."),
function () {
window.Yoleo = Em.Application.create({
LOG_TRANSITIONS: PRELOAD.ember_settings.log_transitions,
api_namespace: PRELOAD.ember_settings.api_namespace
})
}.call(this),
function () {
Yoleo.PluralView = Em.View.extend({
tagName: "span",
template: Em.Handlebars.compile("{{view.properValue}}"),
properValue: function () {
return this.get("value") === 1 ? this.get("singular") : this.get("plural") || this.get("singular") + "s"
}.property("value")
})
}.call(this),
function () {
jQuery.timeago.settings.allowFuture = !0
}.call(this), Yoleo.PusherController = Em.Controller.extend({
LOG_ALL_EVENTS: !1,
_channels: [],
_pusher: null,
connect: function (e, t, n) {
this.set("_pusher", new Pusher(e, n));
for (var r in t) {
var i = this.get("_pusher").subscribe(t[r]);
this.get("_channels").pushObject({
name: r,
channel: i
}), this.LOG_ALL_EVENTS && i.bind_all(function (e, t) {
console.log("Pusher event received", e, t)
})
}
},
channelFor: function (e) {
try {
return this.get("_channels").findProperty("name", e).channel
} catch (t) {
console.warn("Could not find a channel by the name of '" + e + "'")
}
}
}), Yoleo.PusherListener = Em.Mixin.create({
needs: "pusher",
_pusherBindings: [],
pusherListenTo: function (e, t) {
var n = this.get("controllers.pusher").channelFor(e);
if (n) {
var r = this,
i = function (e) {
r.send(Em.String.camelize(t), e)
};
n.bind(t, i), this.get("_pusherBindings").pushObject({
channelName: e,
eventName: t,
handler: i
})
} else console.warn("The channel '" + e + "' does not exist")
},
pusherUnlistenTo: function (e, t) {
var n = this.get("_pusherBindings").find(function (n) {
return n.channelName === e && n.eventName === t
}),
r = this.get("controllers.pusher").channelFor(e);
n && r ? (r.unbind(n.eventName, n.handler), this.get("_pusherBindings").removeObject(n)) : console.warn("It doesn't look like have '" + t + "' bound to the '" + e + "' channel")
},
destroy: function () {
var e = this;
this.get("_pusherBindings").forEach(function (t) {
e.pusherUnlistenTo(t.channelName, t.eventName)
}), this._super()
}
}), Yoleo.PusherTrigger = Em.Mixin.create({
needs: "pusher",
pusherTrigger: function (e, t, n) {
var r = this.get("controllers.pusher").channelFor(e);
r.trigger(t, n)
}
}),
function () {
DS.RESTAdapter.map("Yoleo.User", {
subscriptions: {
embedded: "load"
}
}), DS.RESTAdapter.map("Yoleo.Subscription", {
feed: {
embedded: "load"
}
}), DS.RESTAdapter.reopen({
namespace: Yoleo.get("api_namespace")
}), DS.RESTAdapter.registerTransform("raw", {
deserialize: function (e) {
return e
},
serialize: function (e) {
return e
}
}), Yoleo.Store = DS.Store.extend({
revision: 12,
adapter: DS.RESTAdapter.create()
})
}.call(this),
function () {
Yoleo.Article = DS.Model.extend({
user: DS.belongsTo("Yoleo.User"),
feed: DS.belongsTo("Yoleo.Feed"),
articleUrl: DS.attr("string"),
body: DS.attr("string"),
summary: DS.attr("string"),
title: DS.attr("string"),
author: DS.attr("string"),
articleUrl: DS.attr("string"),
slug: DS.attr("string"),
guid: DS.attr("string"),
articlePublishedAt: DS.attr("date"),
isUnread: function () {
return this.get("user.unreadArticleIds").contains(parseInt(this.id))
}.property("user.unreadArticleIds"),
isStarred: function () {
return this.get("user.starredArticleIds").contains(parseInt(this.id))
}.property("user.starredArticleIds"),
articlePublishedAtISOString: function () {
return this.get("articlePublishedAt").toISOString()
}.property("articlePublishedAt"),
toggleRead: function () {
return this.get("isUnread") ? this.markRead() : this.markUnread()
},
markRead: function () {
if (this.get("isUnread")) return Yoleo.Article.markArticlesRead([this.id])
},
markUnread: function () {
this.get("isUnread") || Yoleo.Article.markArticlesUnread([this.id]);
if (typeof _gaq != "undefined" && _gaq !== null) return _gaq.push(["_trackEvent", "Articles", "Mark Unread", this.get("articleUrl")])
},
toggleStar: function () {
var e = this;
return typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Articles", "Toggle Star", this.get("url")]), $.ajax({
url: "/" + Yoleo.get("api_namespace") + "/articles/" + this.id + "/toggle_star",
type: "put",
success: function (e) {
return Yoleo.__container__.lookup("controller:user").reload()
}
})
},
guidIsMp3: function () {
return /\.mp3$/.test(this.get("guid"))
}.property("guid")
}), Yoleo.Article.reopenClass({
markArticlesRead: function (e) {
var t = this;
return e == null && (e = []), $.ajax({
url: "/" + Yoleo.get("api_namespace") + "/articles/mark_read",
type: "post",
data: {
article_ids: e
},
success: function (e) {
return Yoleo.__container__.lookup("controller:user").reload()
}
})
},
markAllRead: function () {
return this.markArticlesRead(Yoleo.User.find("current").get("unreadArticleIds"))
},
markArticlesUnread: function (e) {
var t = this;
return e == null && (e = []), $.ajax({
url: "/" + Yoleo.get("api_namespace") + "/articles/mark_unread",
type: "post",
data: {
article_ids: e
},
success: function (e) {
return Yoleo.__container__.lookup("controller:user").reload()
}
})
}
})
}.call(this),
function () {
Yoleo.Feed = DS.Model.extend({
title: DS.attr("string"),
url: DS.attr("string"),
slug: DS.attr("string"),
favicon: DS.attr("string"),
shouldUpdate: DS.attr("boolean"),
notUpdating: function () {
return !this.get("shouldUpdate")
}.property("shouldUpdate")
})
}.call(this),
function () {
Yoleo.Subscription = DS.Model.extend({
feed: DS.belongsTo("Yoleo.Feed"),
numUnread: DS.attr("number"),
numStarred: DS.attr("number"),
tags: DS.attr("raw"),
isTaggedWith: function (e) {
return this.get("tags").contains(e)
}
})
}.call(this),
function () {
Yoleo.User = DS.Model.extend({
subscriptions: DS.hasMany("Yoleo.Subscription"),
email: DS.attr("string"),
username: DS.attr("string"),
planId: DS.attr("string"),
ccLastFour: DS.attr("string"),
planName: DS.attr("string"),
isImporting: DS.attr("boolean"),
tags: DS.attr("raw"),
unreadArticleIds: DS.attr("raw"),
starredArticleIds: DS.attr("raw"),
lastGrImport: DS.attr("date"),
planRenewsAt: DS.attr("date"),
planExpiresAt: DS.attr("date"),
numSubscriptions: function () {
return this.get("subscriptions.length")
}.property("subscriptions.length"),
numUnread: function () {
return this.get("unreadArticleIds.length")
}.property("unreadArticleIds.length"),
numStarred: function () {
return this.get("starredArticleIds").length
}.property("starredArticleIds.length"),
untaggedSubscriptions: function () {
return this.get("subscriptions").filter(function (e) {
return Em.isEmpty(e.get("tags"))
})
}.property("subscriptions.length"),
taggedSubscriptions: function () {
return this.get("subscriptions").filter(function (e) {
return !Em.isEmpty(e.get("tags"))
})
}.property("subscriptions.length")
})
}.call(this),
function () {
Yoleo.ApplicationController = Em.Controller.extend(Yoleo.PusherListener, {
needs: ["articles", "currentArticle", "subscriptionsNew", "filters", "user"],
userBinding: "controllers.user",
articlesBinding: "controllers.articles",
currentArticleBinding: "controllers.currentArticle",
subscriptionsNewBinding: "controllers.subscriptionsNew",
filtersBinding: "controllers.filters",
reloadRequired: function (e) {
return alert("Due to maintenance the application requires a reload"), window.location.reload()
},
authRequired: function (e) {
if (confirm("Authorization with your google account is required, do that now?")) return window.location = e.auth_url
}
})
}.call(this),
function () {
Yoleo.ArticlesController = Em.ArrayController.extend(Yoleo.PusherListener, {
needs: ["user", "currentArticle", "articlesList", "filters"],
currentArticleBinding: "controllers.currentArticle",
userBinding: "controllers.user",
lastParams: {},
isLastPage: !1,
hasLoaded: !1,
isLoading: !1,
isFirstLoad: !0,
isLastPage: !1,
currentArticle: null,
noArticles: function () {
return this.get("hasLoaded") && !this.get("length")
}.property("length"),
loadArticles: function (e) {
var t = this;
e == null && (e = {}), Em.isEmpty(e.page) ? (e.page = 1, this.set("hasLoaded", !1), this.set("content", []), this.set("isFirstLoad", !0), this.set("isLastPage", !1), this.set("currentArticle.content", null)) : this.set("isFirstLoad", !1);
if (!this.get("isLoading")) return this.get("isLastPage") ? (this.set("isLoading", !1), this.set("hasLoaded", !0)) : (this.set("isLoading", !0), this.set("lastParams", e), Yoleo.Article.find(e).addObserver("isLoaded", function (e) {
var n;
return n = e.map(function (e) {
return e
}), t.set("isLastPage", n.length === 0), t.get("isFirstLoad") ? (t.set("content", n), n.length && (t.set("currentArticle.content", t.get("firstObject")), t.get("firstObject").markRead())) : t.pushObjects(n), t.set("isLoading", !1), t.set("isFirstLoad", !1), t.set("hasLoaded", !0)
}))
},
loadMoreArticles: function () {
var e;
return e = this.get("lastParams"), e.page += 1, this.loadArticles(e)
},
newArticle: function (e) {
var t, n, r, i = this;
e == null && (e = {}), typeof console != "undefined" && console !== null && console.log("New article!", e);
if ( !! Em.isEmpty(e.article_id) || !! Em.isEmpty(e.feed_slug)) return typeof console != "undefined" && console !== null ? console.warn("article_id wasn't passed into newArticle!") : void 0;
r = this.get("lastParams.state"), n = this.get("lastParams.feed_slug"), typeof console != "undefined" && console !== null && console.log("state, slug", r, n), this.get("user").send("reload");
if ((Em.isEmpty(n) || e.feed_slug === n) && r !== "starred") {
t = Yoleo.Article.find(e.article_id);
if (!t.get("isLoaded")) return t.one("didLoad", function () {
if (!i.contains(t)) return i.unshiftObject(t)
});
if (!this.contains(t)) return this.unshiftObject(t)
}
},
nextArticle: function () {
var e, t;
t = this.get("currentArticleIndex"), e = this.objectAt(t + 1);
if (e) return e && this.set("currentArticle.content", e), this.get("controllers.articlesList").send("articleNavigated"), this._markCurrentRead(e)
},
previousArticle: function () {
var e, t;
t = this.get("currentArticleIndex"), e = this.objectAt(t - 1);
if (e) return e && this.set("currentArticle.content", e), this.get("controllers.articlesList").send("articleNavigated"), this._markCurrentRead(e)
},
_markCurrentRead: function (e) {
var t = this;
return this.readTimer && clearTimeout(this.readTimer), this.readTimer = setTimeout(function () {
return e.markRead(), t.readTimer = null
}, 300)
},
currentArticleIndex: function () {
return this.indexOf(this.get("currentArticle.content"))
}.property("currentArticle.content", "length")
})
}.call(this),
function () {
Yoleo.ArticlesListController = Em.ArrayController.extend(Em.Evented, {
needs: ["articles", "filters", "user"],
articlesBinding: "controllers.articles",
userBinding: "controllers.user",
isLoadingBinding: "articles.isLoading",
noArticlesBinding: "articles.noArticles",
isLastPageBinding: "articles.isLastPage",
hasLoadedBinding: "articles.hasLoaded",
loadMoreArticles: function () {
return this.get("articles").send("loadMoreArticles")
},
articleNavigated: function () {
return this.trigger("articleNavigated")
}
})
}.call(this),
function () {
Yoleo.ArticlesListEntryController = Em.ObjectController.extend({
needs: ["currentArticle", "articles"],
isCurrent: function () {
return this.get("content") === this.get("controllers.currentArticle.content")
}.property("controllers.currentArticle.content"),
setAsCurrentArticle: function (e) {
return e == null && (e = null), e == null && (e = this.get("content")), this.set("controllers.currentArticle.content", e), e.markRead()
},
notInFeed: function () {
return !this.get("controllers.articles.lastParams.feed_slug")
}.property("controllers.articles.lastParams.feed_slug"),
toggleRead: function () {
return this.get("content").toggleRead(), !1
}
})
}.call(this),
function () {
Yoleo.BillingInfoController = Em.Controller.extend({
needs: "user",
accountBinding: "controllers.user",
reset: function () {
return this.setProperties({
errors: [],
numberError: !1,
cvcError: !1,
expMonthError: !1,
expYearError: !1,
success: !1,
submitting: !1
})
},
submit: function () {
var e = this;
return this.reset(), this.set("submitting", !0), Stripe.createToken({
number: this.get("number"),
cvc: this.get("cvc"),
exp_month: this.get("expMonth"),
exp_year: this.get("expYear")
}, function (t, n) {
return typeof console != "undefined" && console !== null && console.log("token response handler: ", t, n), n.error ? (e.get("errors").pushObject(n.error.message), e.set("" + Em.String.camelize(n.error.param) + "Error", !0), e.set("submitting", !1)) : $.ajax({
url: "/users/update_billing_info",
type: "put",
data: {
card_token: n.id,
cc_last_four: n.card.last4,
cc_exp_month: n.card.exp_month,
cc_exp_year: n.card.exp_year,
cc_type: n.card.type
},
success: function () {
return alert("Thanks! We hope you enjoy using Yoleo!"), window.location.pathname = "/articles"
},
error: function () {
return window.location.reload(), alert("Something went wrong updating your information")
}
})
})
},
fRenewsAt: function () {
var e;
return (e = this.get("account.planRenewsAt")) != null ? e.toISOString() : void 0
}.property("account.planRenewsAt")
})
}.call(this),
function () {
Yoleo.CurrentArticleController = Em.ObjectController.extend(Em.Evented, {
needs: ["articles", "application"],
nextPressed: function () {
return this.trigger("nextPressed")
},
nextReleased: function () {
return this.trigger("nextReleased")
},
prevPressed: function () {
return this.trigger("prevPressed")
},
prevReleased: function () {
return this.trigger("prevReleased")
}
})
}.call(this),
function () {
Yoleo.FiltersController = Em.Controller.extend({
state: "",
tag: null,
feed_slug: null,
hidden: !1,
setFilter: function (e) {
return e.filter === "feed_slug" && this.get("tag") ? this.set("tag", null) : e.filter === "tag" && this.get("feed_slug") && this.set("feed_slug", null), this.set(e.filter, e.value), this.send("filterChanged")
},
clearAll: function () {
return this.setProperties({
tag: null,
feed_slug: null
}), this.send("filterChanged")
},
notFiltered: function () {
return Em.isEmpty(this.get("state")) && Em.isEmpty(this.get("tag")) && Em.isEmpty(this.get("feed_slug"))
}.property("state", "tag", "feed_slug")
})
}.call(this),
function () {
Yoleo.ImportController = Em.ArrayController.extend(Yoleo.PusherListener, {
needs: "user",
isImportingBinding: Em.Binding.oneWay("controllers.user.isImporting"),
lastImportAtBinding: Em.Binding.oneWay("controllers.user.lastGrImport"),
isImporting: !1,
isDone: !1,
importedFeeds: [],
importButtonTxt: function () {
return this.get("isImporting") ? "Importing..." : "Import from Google Reader"
}.property("isImporting"),
importGoogleReader: function () {
this.set("isImporting", !0), $.get("/google_reader_import");
if (typeof _gaq != "undefined" && _gaq !== null) return _gaq.push(["_trackEvent", "Account", "Import", this.get("controllers.user.email")])
},
importSuccessful: function (e) {
return this.setProperties({
isImporting: !1,
lastImportAt: new Date,
isDone: !0
}), this.get("controllers.user").send("reload")
},
isImportingOrDone: function () {
return this.get("isImporting") || this.get("isDone")
}.property("isImporting", "isDone"),
importFeed: function (e) {
return this.get("controllers.user").send("reload"), this.get("importedFeeds").pushObject(e.title)
}
})
}.call(this),
function () {
Yoleo.ShortcutsController = Em.Controller.extend({
isVisible: !1,
toggle: function () {
return this.get("isVisible") ? this.set("isVisible", !1) : this.set("isVisible", !0)
},
hide: function () {
return this.set("isVisible", !1)
}
})
}.call(this),
function () {
Yoleo.SubscriptionsNavController = Em.Controller.extend({
needs: ["user", "articles", "filters"],
userBinding: "controllers.user",
articlesBinding: "controllers.articles",
filtersBinding: "controllers.filters",
isAllSubscriptions: function () {
return Em.isEmpty(this.get("filters.tag")) && Em.isEmpty(this.get("filters.feed_slug"))
}.property("filters.state", "filters.tag", "filters.feed_slug"),
tags: function () {
var e, t = this;
return e = this.get("user.tags").map(function (e) {
return {
label: e,
params: {
state: e
},
taggedSubscriptions: t._taggedSubscriptionsMap(e)
}
}), this.tagFilters(e)
}.property("user.tags", "user.subscriptions", "filters.state"),
_taggedSubscriptionsMap: function (e) {
var t;
return t = this.get("user.subscriptions").filter(function (t) {
return t.isTaggedWith(e)
}).map(function (e) {
return {
params: {
state: e.get("feed.slug")
},
subscription: e
}
}), this.subscriptionFilter(t)
},
untaggedSubscriptionsMap: function () {
var e;
return e = this.get("user.untaggedSubscriptions").map(function (e) {
return {
params: {
state: e.get("feed.slug")
},
subscription: e
}
}), this.subscriptionFilter(e)
}.property("user.tags", "user.untaggedSubscriptions", "filters.state"),
tagFilters: function (e) {
return e
},
subscriptionFilter: function (e) {
return e
}
})
}.call(this),
function () {
Yoleo.SubscriptionsNavEntryController = Em.ObjectController.extend({
needs: ["user", "articles", "filters"],
markRead: function () {
var e = this;
return $.ajax({
url: "/" + Yoleo.get("api_namespace") + "/subscriptions/" + this.get("subscription.id") + "/mark_read",
type: "put",
success: function () {
return e.get("controllers.user").send("reload")
}
})
},
unsubscribe: function () {
var e = this;
return $.ajax({
url: "/" + Yoleo.get("api_namespace") + "/subscriptions/" + this.get("subscription.id"),
type: "delete",
success: function () {
return e.get("controllers.user").send("reload")
}
})
}
})
}.call(this),
function () {
Yoleo.SubscriptionsNewController = Em.Controller.extend({
needs: "user",
isVisible: !1,
closeDelay: 6,
reset: function () {
return this.set("url", null), this.set("error", null), this.set("saveSuccess", !1), this.set("isSaving", !1), this.set("closeIn", null)
},
toggleVisible: function () {
return this.reset(), this.set("isVisible", !this.get("isVisible"))
},
close: function () {
return this.set("isVisible", !1)
},
save: function () {
var e = this;
return this.set("isSaving", !0), this.set("error", null), $.ajax({
url: "/" + Yoleo.get("api_namespace") + "/subscriptions",
type: "post",
data: {
url: this.get("url")
}
}).success(function (t) {
var n;
return e.set("saveSuccess", !0), e.get("controllers.user").send("reload"), e.get("controllers.user.content").one("didReload", function () {
return e.send("goToNewFeed", t.subscription.feed.slug)
}), e.set("closeIn", e.get("closeDelay")), n = setInterval(function () {
e.set("closeIn", e.get("closeIn") - 1);
if (e.get("closeIn") <= 0) return clearInterval(n), e.close()
}, 1e3)
}).error(function (t, n, r) {
switch (t.status) {
case 422:
e.set("error", "Sorry, that does not look like a valid URL");
break;
default:
e.set("error", "Sorry, but something went wrong. Verify you have entered a complete URL.")
}
if (typeof _gaq != "undefined" && _gaq !== null) return _gaq.push(["_trackEvent", "Account", "Add Subscription Failure", e.get("url")])
}).always(function () {
e.set("isSaving", !1);
if (typeof _gaq != "undefined" && _gaq !== null) return _gaq.push(["_trackEvent", "Account", "Add Subscription", e.get("url")])
})
}
})
}.call(this),
function () {
Yoleo.UserController = Em.ObjectController.extend(Yoleo.PusherListener, {
reload: function () {
var e = this;
if (!this.get("reloading")) return this.set("reloading", !0), this.get("content").reload(), this.get("content").one("didReload", function () {
return e.set("reloading", !1)
})
},
"pusher:subscriptionSucceeded": function () {
return this.get("didFirstConnect") ? this.reload() : this.set("didFirstConnect", !0)
}
})
}.call(this),
function () {
Yoleo.ApplicationView = Em.View.extend({
goPendingBinding: "controller.goPending",
a: 65,
g: 71,
h: 72,
j: 74,
k: 75,
m: 77,
n: 78,
p: 80,
r: 82,
s: 83,
v: 86,
up: 38,
down: 40,
esc: 27,
questionMark: 191,
enter: 13,
space: 32,
didInsertElement: function () {
return this.$().attr({
tabindex: 1
}), this.$().focus()
},
classNames: ["application-container"],
goIfPending: function (e) {
return this.get("goPending") && this.get("controller").send(e), this.set("goPending", !1), !1
},
numUnreadChanged: function () {
var e, t;
return e = PRELOAD.app_settings.app_name, (t = this.get("controller.user.unreadArticleIds.length")) > 0 && (e += " (" + t + ")"), $("title").text(e)
}.observes("controller.user.unreadArticleIds.length"),
keyDown: function (e) {
var t, n, r = this;
switch (e.keyCode) {
case this.questionMark:
e.shiftKey && this.get("controller").send("toggleShortcuts");
break;
case this.esc:
this.get("controller").send("hideModals");
break;
case this.j:
this.get("controller.articles").send("nextArticle");
break;
case this.k:
this.get("controller.articles").send("previousArticle");
break;
case this.m:
this.get("controller.currentArticle.content").toggleRead();
break;
case this.r:
window.location.reload();
break;
case this.g:
this.set("goPending", !0), setTimeout(function () {
return r.set("goPending", !1)
}, 1e3);
break;
case this.v:
(t = this.get("controller.currentArticle.articleUrl")) && window.open(t, "_blank").focus();
break;
case this.a:
this.get("goPending") ? this.get("controller.filters").send("setFilter", {
filter: "state",
value: ""
}) : this.get("controller.subscriptionsNew").toggleVisible();
break;
case this.h:
this.goIfPending("goHome");
break;
case this.s:
this.get("goPending") ? this.get("controller.filters").send("setFilter", {
filter: "state",
value: "starred"
}) : (n = this.get("controller.currentArticle.content")) != null && n.toggleStar();
break;
case this.p:
case this.up:
this.get("controller.currentArticle").send("prevPressed");
break;
case this.n:
case this.down:
case this.space:
this.get("goPending") ? this.get("controller.filters").send("setFilter", {
filter: "state",
value: "new"
}) : this.get("controller.currentArticle").send("nextPressed");
break;
case this.enter:
this.get("controller.articles.currentArticle.content").markRead();
break;
default:
return this.set("goPending", !1), !0
}
return !1
},
keyUp: function (e) {
switch (e.keyCode) {
case this.up:
case this.p:
this.get("controller.currentArticle").send("prevReleased");
break;
case this.down:
case this.n:
case this.space:
this.get("controller.currentArticle").send("nextReleased");
break;
default:
return !0
}
return !0
}
})
}.call(this),
function () {
Yoleo.ArticlesListEntryView = Em.View.extend({
className: "articles-list-entry",
templateName: "articlesListEntry",
tagName: "li",
classNameBindings: ["controller.isUnread:is-unread:is-read", "controller.isStarred", "controller.isCurrent"],
didInsertElement: function () {
return this.$(".timeago").timeago()
},
setAsCurrent: function () {
return this.get("controller").send("setAsCurrentArticle"), !1
},
toggleRead: function () {
return this.get("controller").send("toggleRead"), !1
}
})
}.call(this),
function () {
Yoleo.ArticlesListView = Em.View.extend({
TAB_INDEX: 2,
TOP_SCROLL_MARGIN: 180,
BOTTOM_SCROLL_MARGIN: -20,
SCROLL_ANIMATION: 500,
classNames: "articles-list-container",
classNameBindings: ["controller.hidden"],
up: 38,
down: 40,
didInsertElement: function () {
var e = this;
return this.setupScrollWatch(), this.$().attr({
tabindex: this.TAB_INDEX
}), Em.run.next(function () {
return e.get("controller").on("articleNavigated", function () {
return e.articleNavigated()
})
})
},
willDestroy: function () {
return this.get("controller").off("articleNavigated")
},
scrollable: function () {
return this.$()
},
setupScrollWatch: function () {
var e = this;
return this.scrollable().scroll(function () {
if (e.isNearBottom() && e.get("controller.articles.length")) return e.get("controller").send("loadMoreArticles")
}.throttle(400))
},
isNearBottom: function () {
var e, t;
return e = this.$(".articles").outerHeight(!0), t = this.scrollable().scrollTop(), e - t < 1e3
},
articleNavigated: function () {
var e = this;
return Em.run.next(function () {
var t, n, r, i, s, o, u, a, f, l, c;
r = e.$(".is-current"), a = e.$(".articles"), o = 0, c = e.scrollable().height(), t = c - e.BOTTOM_SCROLL_MARGIN, l = e.TOP_SCROLL_MARGIN + parseInt(a.css("padding-top").replace("px", "")) + o, s = r.offset().top, n = s + r.outerHeight(!0), i = e.scrollable().scrollTop(), u = r.prop("id") === a.children("li:first").prop("id");
if (s < l) return f = u ? 0 : i - l + s, e.scrollable().stop(!0, !0).animate({
scrollTop: f
});
if (n > t) return e.scrollable().stop(!0, !0).animate({
scrollTop: i + n - t
})
})
},
keyDown: function (e) {
switch (e.keyCode) {
case this.up:
this.get("controller.articles").send("previousArticle");
break;
case this.down:
this.get("controller.articles").send("nextArticle");
break;
default:
return !0
}
return !1
}
})
}.call(this),
function () {
Yoleo.BillingInfoView = Em.View.extend({
templateName: "billingInfo",
classNames: ["billing-info"],
didInsertElement: function () {
this.get("controller").reset(), this.$(".timeago").timeago();
if (PRELOAD.app_settings.environment !== "production") return this.get("controller").setProperties({
number: "4242424242424242",
cvc: "123",
expMonth: "12",
expYear: "13"
})
},
changedNumber: function () {
return this.set("controller.numberError", !1)
}.observes("controller.number"),
changedCVC: function () {
return this.set("controller.cvcError", !1)
}.observes("controller.cvc"),
changedExpMonth: function () {
return this.set("controller.expMonthError", !1)
}.observes("controller.expMonth"),
changedExpYear: function () {
return this.set("controller.expYearError", !1)
}.observes("controller.expYear")
})
}.call(this),
function () {
Yoleo.CurrentArticleView = Em.View.extend({
NAV_DELAY: 500,
SCROLL_BY: 60,
SCROLL_DURATION: 100,
classNames: ["current-article"],
didInsertElement: function () {
var e = this;
return Em.run.next(function () {
return e.addObserver("controller.content", e.currentArticleChanged), e.get("controller").on("nextPressed", function () {
return e.nextPressed()
}), e.get("controller").on("nextReleased", function () {
return e.nextReleased()
}), e.get("controller").on("prevPressed", function () {
return e.prevPressed()
}), e.get("controller").on("prevReleased", function () {
return e.prevReleased()
})
})
},
willDestroy: function () {
return this.get("controller").off("nextPressed"), this.get("controller").off("nextReleased"), this.get("controller").off("prevPressed"), this.get("controller").off("prevReleased")
},
currentArticleChanged: function () {
var e;
return (e = this.scrollable()) != null && e.scrollTop(0), this.$().hide().fadeIn(200)
},
scrollable: function () {
return this.$().parents(".content")
},
nextPressed: function () {
if (this.isAtBottomOfArticle()) return this.startNextTimer();
if (!this.nextTimer) return this.scrollable().stop(!0, !0).animate({
scrollTop: this.scrollable().scrollTop() + this.SCROLL_BY
}, this.SCROLL_DURATION, "linear")
},
prevPressed: function () {
if (this.isAtTopOfArticle()) return this.startPrevTimer();
if (!this.prevTimer) return this.scrollable().stop(!0, !0).animate({
scrollTop: this.scrollable().scrollTop() - this.SCROLL_BY
}, this.SCROLL_DURATION, "linear")
},
nextReleased: function () {
return clearTimeout(this.nextTimer), this.nextTimer = null
},
prevReleased: function () {
return clearTimeout(this.prevTimer), this.prevTimer = null
},
startPrevTimer: function () {
var e = this;
if (!this.prevTimer) return this.prevTimer = setTimeout(function () {
return e.get("controller.controllers.articles").send("previousArticle"), setTimeout(function () {
return e.prevTimer = null
}, e.NAV_DELAY)
}, this.NAV_DELAY)
},
startNextTimer: function () {
var e = this;
if (!this.nextTimer) return this.nextTimer = setTimeout(function () {
return e.get("controller.controllers.articles").send("nextArticle"), setTimeout(function () {
return e.nextTimer = null
}, e.NAV_DELAY)
}, this.NAV_DELAY)
},
isAtTopOfArticle: function () {
return this.scrollable().scrollTop() === 0
},
isAtBottomOfArticle: function () {
var e;
return e = this.scrollable().prop("scrollHeight"), e -= this.scrollable().outerHeight(!0), e - this.scrollable().scrollTop() < 3
}
})
}.call(this),
function () {
Yoleo.ImportView = Em.View.extend({
classNames: "import",
didInsertElement: function () {
return this.$(".timeago").timeago()
},
lastImportAtISOString: function () {
var e;
return (e = this.get("controller.lastImportAt")) != null ? e.toISOString() : void 0
}.property("controller.lastImportAt")
})
}.call(this),
function () {
Yoleo.NavFilterView = Em.View.extend({
needs: "articles",
templateName: "navFilter",
classNameBindings: ["selected", ":filter"],
tagName: "div",
controllerBinding: "controller.controllers.filters",
selected: function () {
return this.get("controller." + this.get("filter")) === this.get("value")
}.property("controller.tag", "controller.state", "controller.feed_slug"),
click: function () {
if (!this.get("selected")) return this.get("controller").send("setFilter", {
filter: this.get("filter"),
value: this.get("value")
}), !1
}
})
}.call(this),
function () {
Yoleo.NavSubscriptionView = Em.View.extend({
needs: "articles",
classNameBindings: ["selected"],
tagName: "li",
selected: function () {
return this.get("controller.controllers.articles.lastParams.feed_slug") === this.get("thisSlug")
}.property("controller.controllers.articles.lastParams.feed_slug")
})
}.call(this),
function () {
Yoleo.NavTagView = Em.View.extend({
needs: "articles",
classNameBindings: [":category-name", "selected"],
tagName: "li",
selected: function () {
return this.get("controller.controllers.articles.lastParams.tag") === this.get("thisTag.state")
}.property("controller.controllers.articles.lastParams.tag")
})
}.call(this),
function () {
Yoleo.ShortcutsView = Em.View.extend({
classNameBindings: [":shortcuts", "controller.isVisible"],
didInsertElement: function () {
return this.addObserver("controller.isVisible", this.visibilityChanged)
},
visibilityChanged: function () {
return this.$().hasClass("is-visible") ? this.$().slideUp(100) : this.$().slideDown(100)
}
})
}.call(this),
function () {
Yoleo.StarView = Em.View.extend({
tagName: "i",
classNameBindings: ["isStarred:icon-star:icon-star-empty"],
isStarred: function () {
return this.get("article.isStarred")
}.property("article.isStarred"),
click: function () {
return this.get("article").toggleStar(), !1
}
})
}.call(this),
function () {
Yoleo.SubscriptionCollectionEntryView = Em.View.extend({
classNames: "head-3",
tagName: "li",
mouseLeave: function () {
var e, t = this;
if (!this.get("subscriptionActions.isCollapsed")) return e = setTimeout(function () {
return t.get("subscriptionActions").hide()
}, 500), this.set("leaveTimer", e)
},
mouseEnter: function () {
return clearTimeout(this.get("leaveTimer"))
},
subscriptionActionsView: Em.View.extend({
templateName: "subscriptionActions",
isCollapsed: !0,
classNameBindings: ["isCollapsed"],
classNames: ["float-rev", "push-left", "subscription-options"],
hide: function () {
return this.set("isCollapsed", !0)
},
openTogglerView: Em.View.extend({
tagName: "a",
attributeBindings: "href",
classNames: "toggler padded-horz",
href: "",
click: function () {
return this.set("parentView.isCollapsed", !this.get("parentView.isCollapsed")), !1
}
}),
actionsView: Em.View.extend({
tagName: "ul",
classNames: ["actions", "size-2"]
})
})
})
}.call(this),
function () {
Yoleo.SubscriptionCollectionView = Em.View.extend({
tagName: "li",
classNameBindings: [":push-bottom", "expanded", ":category-container"],
tag: "uncategorized",
toggleExpansion: function () {
return this.set("expanded", !this.get("expanded")), this.persistExpansionState(), !1
},
didInsertElement: function () {
return this.get("expanded") || this.$(".category-list").hide(), this.addObserver("expanded", this.expansionChanged)
},
expansionChanged: function () {
return this.get("expanded") ? this.$(".category-list").slideDown(100) : this.$(".category-list").slideUp(100)
},
persistExpansionState: function () {
var e;
if (typeof localStorage != "undefined" && localStorage !== null) return e = this.collapsedTags(), this.get("expanded") ? e = e.without(this.get("tag")) : e.pushObject(this.get("tag")), localStorage.setItem("collapsedTags", e)
},
collapsedTags: function () {
return (localStorage.getItem("collapsedTags") || "").split(",")
},
init: function () {
return this._super(), this.set("expanded", !this.previouslyCollapsed())
},
previouslyCollapsed: function () {
return typeof localStorage == "undefined" || localStorage === null ? !1 : this.collapsedTags().contains(this.get("tag"))
}
})
}.call(this),
function () {
Yoleo.SubscriptionsNewView = Em.View.extend({
templateName: "subscriptionsNew",
didInsertElement: function () {
return this.addObserver("controller.isVisible", this.isVisibleChanged)
},
classNames: ["subscriptions-new-container"],
isVisibleChanged: function () {
return this.get("controller.isVisible") ? (this.$(".subscriptions-new").stop(!0, !0).slideDown(100), this.$("input").focus()) : this.$(".subscriptions-new").stop(!0, !0).slideUp(100)
},
form: Em.View.extend({
tagName: "form",
submit: function () {
return this.get("controller").send("save"), !1
}
}),
eventManager: Em.Object.create({
keyDown: function (e) {
return e.keyCode === 27 && (Yoleo.__container__.lookup("controller:subscriptionsNew").send("toggleVisible"), $(".application-container").focus()), !0
}
})
})
}.call(this), Ember.TEMPLATES._footer = Ember.Handlebars.template(function (t, n, r, i, s) {
this.compilerInfo = [2, ">= 1.0.0-rc.3"], r = r || Ember.Handlebars.helpers, s = s || {};
var o = "",
u, a = this.escapeExpression;
return s.buffer.push('<footer class="app-footer padded-horz-2">\n <ul class="horz float-rev">\n <li class="push-right-3">\n <a href="" title="Shortcuts" class="shortcuts-link size-3" '), u = {}, s.buffer.push(a(r.action.call(n, "toggleShortcuts", {
hash: {},
contexts: [n],
types: ["ID"],
hashTypes: u,
data: s
}))), s.buffer.push('><i class="icon-keyboard"></i> Shortcuts</a>\n </li>\n <li>\n <a href="" title="Support" id="intercom" class="size-3"><i>?</i> Support</a>\n </li>\n </ul>\n</footer>\n'), o
}), Ember.TEMPLATES._header = Ember.Handlebars.template(function (t, n, r, i, s) {
this.compilerInfo = [2, ">= 1.0.0-rc.3"], r = r || Ember.Handlebars.helpers, s = s || {}, s.buffer.push("<header id='app-header'>\n</header>\n\n")
}), Ember.TEMPLATES.application = Ember.Handlebars.template(function (t, n, r, i, s) {
function d(e, t) {
var n = "",
i;
return t.buffer.push('\n <a href="" class="button button-primary size-2 mark-all-read padded-horz float-rev push-right-2" '), i = {}, t.buffer.push(c(r.action.call(e, "markAllRead", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push(">Mark all read</a>\n "), n
}
this.compilerInfo = [2, ">= 1.0.0-rc.3"], r = r || Ember.Handlebars.helpers, s = s || {};
var o = "",
u, a, f, l, c = this.escapeExpression,
h = r.helperMissing,
p = this;
return f = {}, l = {
hash: {},
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}, s.buffer.push(c((u = r.outlet, u ? u.call(n, "leftNav", l) : h.call(n, "outlet", "leftNav", l)))), s.buffer.push('\n\n<header class="article-list-header">\n '), f = {}, a = r["if"].call(n, "controller.controllers.filters.notFiltered", {
hash: {},
inverse: p.noop,
fn: p.program(1, d, s),
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}), (a || a === 0) && s.buffer.push(a), s.buffer.push('\n <ul class="filters clear padded-horz-2">\n <!-- <li><i class="icon-refresh"></i></li> -->\n <li class="push-right-2 link float">\n '), f = {
filter: "STRING",
value: "STRING",
label: "STRING"
}, s.buffer.push(c(r.view.call(n, "Yoleo.NavFilterView", {
hash: {
filter: "state",
value: "",
label: "All"
},
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}))), s.buffer.push('\n </li>\n <li class="push-right-2 link float">\n '), f = {
filter: "STRING",
value: "STRING",
label: "STRING"
}, s.buffer.push(c(r.view.call(n, "Yoleo.NavFilterView", {
hash: {
filter: "state",
value: "new",
label: "New"
},
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}))), s.buffer.push('\n </li>\n <li class="link float">\n '), f = {
filter: "STRING",
value: "STRING",
label: "STRING"
}, s.buffer.push(c(r.view.call(n, "Yoleo.NavFilterView", {
hash: {
filter: "state",
value: "starred",
label: "Starred"
},
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}))), s.buffer.push("\n </li>\n </ul>\n</header>\n\n"), f = {}, l = {
hash: {},
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}, s.buffer.push(c((u = r.outlet, u ? u.call(n, "rightNav", l) : h.call(n, "outlet", "rightNav", l)))), s.buffer.push('\n\n<div class="content padded-left-3 padded-right-5 padded-bottom-3">\n '), f = {}, s.buffer.push(c(r._triageMustache.call(n, "outlet", {
hash: {},
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}))), s.buffer.push("\n</div>\n\n"), f = {}, l = {
hash: {},
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}, s.buffer.push(c((u = r.render, u ? u.call(n, "shortcuts", l) : h.call(n, "render", "shortcuts", l)))), s.buffer.push("\n\n"), f = {}, l = {
hash: {},
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}, s.buffer.push(c((u = r.partial, u ? u.call(n, "footer", l) : h.call(n, "partial", "footer", l)))), s.buffer.push("\n"), o
}), Ember.TEMPLATES.articles_list = Ember.Handlebars.template(function (t, n, r, i, s) {
function c(e, t) {
var n = "",
i;
return t.buffer.push("\n "), i = {
itemController: "STRING",
itemViewClass: "STRING"
}, t.buffer.push(f(r.each.call(e, "article", "in", "articles", {
hash: {
itemController: "articlesListEntry",
itemViewClass: "Yoleo.ArticlesListEntryView"
},
contexts: [e, e, e],
types: ["ID", "ID", "ID"],
hashTypes: i,
data: t
}))), t.buffer.push("\n "), n
}
function h(e, t) {
var n = "",
i, s;
return t.buffer.push("\n "), s = {}, i = r["if"].call(e, "noArticles", {
hash: {},
inverse: l.program(6, d, t),
fn: l.program(4, p, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n "), n
}
function p(e, t) {
t.buffer.push('\n <p class="box padded-2 push-horz-2 box-feed">Nothing here.</p>\n ')
}
function d(e, t) {
var n = "",
i, s;
return t.buffer.push("\n "), s = {}, i = r["if"].call(e, "isLastPage", {
hash: {},
inverse: l.noop,
fn: l.program(7, v, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n "), n
}
function v(e, t) {
t.buffer.push('\n <p class="box padded-2 end-of-articles push-horz-2 box-feed">End of articles</p>\n ')
}
function m(e, t) {
t.buffer.push('\n <p class="box padded-2 push-horz-2 box-feed"><i class="icon-spinner icon-spin"></i> Loading&hellip;</p>\n ')
}
this.compilerInfo = [2, ">= 1.0.0-rc.3"], r = r || Ember.Handlebars.helpers, s = s || {};
var o = "",
u, a, f = this.escapeExpression,
l = this;
return s.buffer.push('\n\n<ul class="articles padded-bottom-2">\n '), a = {}, u = r["if"].call(n, "articles.length", {
hash: {},
inverse: l.noop,
fn: l.program(1, c, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push("\n\n "), a = {}, u = r["if"].call(n, "hasLoaded", {
hash: {},
inverse: l.noop,
fn: l.program(3, h, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push("\n\n "), a = {}, u = r["if"].call(n, "isLoading", {
hash: {},
inverse: l.noop,
fn: l.program(9, m, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push("\n</ul>\n"), o
}), Ember.TEMPLATES.articles_list_entry = Ember.Handlebars.template(function (t, n, r, i, s) {
function c(e, t) {
var n = "",
i, s;
return t.buffer.push('\n <div class="actions float push-right">\n '), s = {
articleBinding: "STRING"
}, t.buffer.push(f(r.view.call(e, "Yoleo.StarView", {
hash: {
articleBinding: "content"
},
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}))), t.buffer.push("\n <a "), s = {
target: "STRING"
}, t.buffer.push(f(r.action.call(e, "toggleRead", {
hash: {
target: "view"
},
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}))), t.buffer.push(' class="article-mark-read hide-text" title="mark unread">mark unread</a>\n </div>\n <section '), s = {
target: "STRING"
}, t.buffer.push(f(r.action.call(e, "setAsCurrent", {
hash: {
target: "view"
},
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}))), t.buffer.push(' class="article-info link">\n <h1 class="article-title head-4">'), s = {}, t.buffer.push(f(r._triageMustache.call(e, "title", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}))), t.buffer.push("</h1>\n "), s = {}, i = r["if"].call(e, "notInFeed", {
hash: {},
inverse: l.noop,
fn: l.program(2, h, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push('\n <time class="published head-3">Published <abbr class="timeago" '), s = {
title: "STRING"
}, t.buffer.push(f(r.bindAttr.call(e, {
hash: {
title: "articlePublishedAtISOString"
},
contexts: [],
types: [],
hashTypes: s,
data: t
}))), t.buffer.push("></abbr></time>\n </section>\n"), n
}
function h(e, t) {
var n = "",
i;
return t.buffer.push('\n <h2 class="feed-title head-3">'), i = {}, t.buffer.push(f(r._triageMustache.call(e, "feed.title", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push("</h2>\n "), n
}
this.compilerInfo = [2, ">= 1.0.0-rc.3"], r = r || Ember.Handlebars.helpers, s = s || {};
var o = "",
u, a, f = this.escapeExpression,
l = this;
return a = {}, u = r["with"].call(n, "article", {
hash: {},
inverse: l.noop,
fn: l.program(1, c, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push("\n"), o
}), Ember.TEMPLATES.billing_info = Ember.Handlebars.template(function (t, n, r, i, s) {
function c(e, t) {
var n = "",
i;
return t.buffer.push('\n <h3 class="success head-6"><i class="icon-ok"></i> You\'re on the '), i = {}, t.buffer.push(f(r._triageMustache.call(e, "account.planName", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push(" plan.</h3>\n <p>Your plan renews <abbr "), i = {
title: "STRING"
}, t.buffer.push(f(r.bindAttr.call(e, {
hash: {
title: "fRenewsAt"
},
contexts: [],
types: [],
hashTypes: i,
data: t
}))), t.buffer.push(' class="timeago">.</p>\n '), n
}
function h(e, t) {
t.buffer.push('\n <h3 class="head-6">A subscription to Yoleo is just $9/year.</h3>\n <p>Your contribution helps to ensure that we are able to keep Yoleo running.</p>\n ')
}
function p(e, t) {
t.buffer.push("\n Need to update your Payment Information?\n ")
}
function d(e, t) {
t.buffer.push("\n Payment Information\n ")
}
function v(e, t) {
var n = "",
i, s;
return t.buffer.push('\n <ul class="errors padded push-horz">\n '), s = {}, i = r.each.call(e, "errors", {
hash: {},
inverse: l.noop,
fn: l.program(10, m, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n </ul>\n "), n
}
function m(e, t) {
var n = "",
i;
return t.buffer.push("\n <li>"), i = {}, t.buffer.push(f(r._triageMustache.call(e, "", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push("</li>\n "), n
}
function g(e, t) {
t.buffer.push("\n Update Card\n ")
}
function y(e, t) {
t.buffer.push("\n Purchase\n ")
}
function b(e, t) {
var n = "",
i, s;
return t.buffer.push('\n <li class="push-top">\n '), s = {}, i = r["if"].call(e, "submitted", {
hash: {},
inverse: l.program(22, x, t),
fn: l.program(17, w, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n </li>\n "), n
}
function w(e, t) {
var n = "",
i, s;
return t.buffer.push("\n "), s = {}, i = r["if"].call(e, "success", {
hash: {},
inverse: l.program(20, S, t),
fn: l.program(18, E, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n "), n
}
function E(e, t) {
t.buffer.push('\n <p class="success"><strong>Billing information updated successfully!</strong></p>\n ')
}
function S(e, t) {
t.buffer.push('\n <p class="error">Sorry, we could not update your billing information at this time.</p>\n ')
}
function x(e, t) {
t.buffer.push("\n <p>Submitting&hellip;</p>\n ")
}
this.compilerInfo = [2, ">= 1.0.0-rc.3"], r = r || Ember.Handlebars.helpers, s = s || {};
var o = "",
u, a, f = this.escapeExpression,
l = this;
return s.buffer.push('<div class="billing-form padded-vert-2">\n <header class="push-bottom-2">\n <h1 class="head-8 push-bottom">My Account</h1>\n <h2 class="head-6">Logged in as <strong>'), a = {}, s.buffer.push(f(r._triageMustache.call(n, "account.email", {
hash: {},
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}))), s.buffer.push('</strong></h2>\n </header>\n\n <section class="my-plan padded-2 push-bottom-4 box">\n '), a = {}, u = r["if"].call(n, "account.planId", {
hash: {},
inverse: l.program(3, h, s),
fn: l.program(1, c, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push('\n </section>\n\n <section class="billing-info-form float push-right-5">\n <h3 class="head-5 push-bottom">\n <i class="icon-edit"></i>\n '), a = {}, u = r["if"].call(n, "account.ccLastFour", {
hash: {},
inverse: l.program(7, d, s),
fn: l.program(5, p, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push("\n </h3>\n\n "), a = {}, u = r["if"].call(n, "errors", {
hash: {},
inverse: l.noop,
fn: l.program(9, v, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push('\n\n <form>\n <fieldset class="form-area">\n <ol>\n <li>\n <label>Card Number</label>\n '), a = {
size: "STRING",
"class": "STRING",
valueBinding: "STRING",
autocomplete: "STRING",
classBinding: "STRING",
disabledBinding: "STRING"
}, s.buffer.push(f(r.view.call(n, "Em.TextField", {
hash: {
size: "20",
"class": "card-number",
valueBinding: "number",
autocomplete: "off",
classBinding: "numberError:error",
disabledBinding: "submitting"
},
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}))), s.buffer.push('\n </li>\n <li class="push-top">\n <label>CVC</label>\n '), a = {
size: "STRING",
"class": "STRING",
valueBinding: "STRING",
autocomplete: "STRING",
classBinding: "STRING",
disabledBinding: "STRING"
}, s.buffer.push(f(r.view.call(n, "Em.TextField", {
hash: {
size: "4",
"class": "card-cvc",
valueBinding: "cvc",
autocomplete: "off",
classBinding: "cvcError:error",
disabledBinding: "submitting"
},
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}))), s.buffer.push('\n </li>\n <li class="push-top">\n <label>Expiration (MM / YY)</label>\n '), a = {
size: "STRING",
"class": "STRING",
valueBinding: "STRING",
autocomplete: "STRING",
classBinding: "STRING",
disabledBinding: "STRING"
}, s.buffer.push(f(r.view.call(n, "Em.TextField", {
hash: {
size: "2",
"class": "card-exp-month",
valueBinding: "expMonth",
autocomplete: "off",
classBinding: "expMonthError:error",
disabledBinding: "submitting"
},
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}))), s.buffer.push("\n <span> / </span>\n "), a = {
size: "STRING",
"class": "STRING",
valueBinding: "STRING",
autocomplete: "STRING",
classBinding: "STRING",
disabledBinding: "STRING"
}, s.buffer.push(f(r.view.call(n, "Em.TextField", {
hash: {
size: "2",
"class": "card-exp-year",
valueBinding: "expYear",
autocomplete: "off",
classBinding: "expYearError:error",
disabledBinding: "submitting"
},
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}))), s.buffer.push('\n </li>\n <li class="push-top-2">\n <button class="button button-primary padded-vert padded-horz-2" '), a = {
disabled: "STRING"
}, s.buffer.push(f(r.bindAttr.call(n, {
hash: {
disabled: "submitting"
},
contexts: [],
types: [],
hashTypes: a,
data: s
}))), s.buffer.push(" "), a = {}, s.buffer.push(f(r.action.call(n, "submit", {
hash: {},
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}))), s.buffer.push(' class="submit">\n '), a = {}, u = r["if"].call(n, "account.ccLastFour", {
hash: {},
inverse: l.program(14, y, s),
fn: l.program(12, g, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push("\n </button>\n </li>\n "), a = {}, u = r["if"].call(n, "submitting", {
hash: {},
inverse: l.noop,
fn: l.program(16, b, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push('\n </ol>\n </fieldset>\n </form>\n </section>\n\n <div class="flow size-2">\n <a href="http://stripe.com" target="_blank" class="stripe push-bottom"><img src="/assets/stripe.png" alt="Stripe"></a>\n <p>Stripe is used and trusted by thousands of sites &amp; apps for commerce across the web.\n <br>\n <strong>Your payments are safe and secure. <br> <a href="http://stripe.com" target="_blank">Click here to learn more about Stripe</a>.</strong></p>\n </div>\n\n <p class="head-2 form-note padded-top-4">\n <strong>Please note:</strong>\n Your privacy and security are important to us. All payment informaton received and processed are fully encrypted with advanced security technologies.\n </p>\n\n</div>\n'), o
}), Ember.TEMPLATES.current_article = Ember.Handlebars.template(function (t, n, r, i, s) {
function c(e, t) {
var n = "",
i;
return t.buffer.push('\n <h1 class="article-title">\n <span class="float push-right size-5">\n '), i = {
articleBinding: "STRING"
}, t.buffer.push(f(r.view.call(e, "Yoleo.StarView", {
hash: {
articleBinding: "content"
},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push('\n </span>\n <a class="flow head-6" target="_blank" '), i = {
href: "STRING"
}, t.buffer.push(f(r.bindAttr.call(e, {
hash: {
href: "articleUrl"
},
contexts: [],
types: [],
hashTypes: i,
data: t
}))), t.buffer.push(">\n "), i = {}, t.buffer.push(f(r._triageMustache.call(e, "title", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push('\n </a>\n <a class="external-url" title="View original" target="_blank" '), i = {
href: "STRING"
}, t.buffer.push(f(r.bindAttr.call(e, {
hash: {
href: "articleUrl"
},
contexts: [],
types: [],
hashTypes: i,
data: t
}))), t.buffer.push('>\n <i class="icon-share size-3"></i>\n </a>\n </h1>\n <h2 class="feed-title">\n '), i = {}, t.buffer.push(f(r._triageMustache.call(e, "feed.title", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push("\n </h2>\n"), n
}
function h(e, t) {
var n = "",
i, s;
return t.buffer.push("\n "), s = {}, i = r["if"].call(e, "controller.controllers.articles.isFirstLoad", {
hash: {},
inverse: l.program(6, d, t),
fn: l.program(4, p, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n"), n
}
function p(e, t) {
t.buffer.push('\n <p class="box padded-2 push-horz-2"><i class="icon-spinner icon-spin"></i> Loading&hellip;</p>\n ')
}
function d(e, t) {
var n = "",
i, s;
return t.buffer.push("\n "), s = {}, i = r["if"].call(e, "controller.controllers.articles.noArticles", {
hash: {},
inverse: l.noop,
fn: l.program(7, v, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n "), n
}
function v(e, t) {
t.buffer.push('\n <p class="box padded-2 push-horz-2">No article selected.</p>\n ')
}
function m(e, t) {
var n = "",
i, s;
return t.buffer.push('\n <article class="article-contents push-top">\n '), s = {
unescaped: "STRING"
}, i = r._triageMustache.call(e, "body", {
hash: {
unescaped: "true"
},
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n\n <br /><br />\n "), s = {}, i = r["if"].call(e, "guidIsMp3", {
hash: {},
inverse: l.noop,
fn: l.program(10, g, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n </article>\n"), n
}
function g(e, t) {
var n = "",
i;
return t.buffer.push("\n <audio "), i = {
src: "STRING"
}, t.buffer.push(f(r.bindAttr.call(e, {
hash: {
src: "guid"
},
contexts: [],
types: [],
hashTypes: i,
data: t
}))), t.buffer.push(" controls>\n Your browser does not support the <code>audio</code> element.\n </audio>\n "), n
}
this.compilerInfo = [2, ">= 1.0.0-rc.3"], r = r || Ember.Handlebars.helpers, s = s || {};
var o = "",
u, a, f = this.escapeExpression,
l = this;
return a = {}, u = r["if"].call(n, "content", {
hash: {},
inverse: l.program(3, h, s),
fn: l.program(1, c, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push("\n\n"), a = {}, u = r["if"].call(n, "content", {
hash: {},
inverse: l.noop,
fn: l.program(9, m, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push("\n"), o
}), Ember.TEMPLATES["import"] = Ember.Handlebars.template(function (t, n, r, i, s) {
function c(e, t) {
var n = "",
i, s;
return t.buffer.push("\n "), s = {}, i = r["if"].call(e, "isDone", {
hash: {},
inverse: l.program(4, p, t),
fn: l.program(2, h, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push('\n <ul class="import-feeds-list push-vert-2">\n '), s = {}, i = r.each.call(e, "importedFeeds", {
hash: {},
inverse: l.noop,
fn: l.program(6, d, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n </ul>\n "), s = {}, i = r["if"].call(e, "isDone", {
hash: {},
inverse: l.noop,
fn: l.program(8, v, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n "), n
}
function h(e, t) {
t.buffer.push('\n <h1 class="success head-6 push-horz-5 padded">Imported!</h1>\n ')
}
function p(e, t) {
t.buffer.push('\n <h1 class="head-6"><i class="icon-spinner icon-spin push-right"></i> Importing&hellip;</h1>\n <p class="head-3 push-top-2">\n You can safely navigate away from this page while your feeds are being imported.\n <br>\n Once a feed title shows up on the sidebar, it can be read immediately.\n </p>\n ')
}
function d(e, t) {
var n = "",
i;
return t.buffer.push("\n <li>"), i = {}, t.buffer.push(f(r._triageMustache.call(e, "", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push("</li>\n "), n
}
function v(e, t) {
t.buffer.push('\n <h2 class="success head-6 push-horz-5 padded">All done!</h2>\n ')
}
function m(e, t) {
var n = "",
i;
return t.buffer.push('\n <h1 class="head-6 push-bottom">Have Existing Feeds?</h1>\n <button class="button button-primary padded-vert padded-horz-2 size-5" '), i = {}, t.buffer.push(f(r.action.call(e, "importGoogleReader", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push(" "), i = {
disabled: "STRING"
}, t.buffer.push(f(r.bindAttr.call(e, {
hash: {
disabled: "isImporting"
},
contexts: [],
types: [],
hashTypes: i,
data: t
}))), t.buffer.push(">"), i = {}, t.buffer.push(f(r._triageMustache.call(e, "importButtonTxt", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push("</button>\n "), n
}
function g(e, t) {
var n = "",
i;
return t.buffer.push('\n <p class="push-top-2">Last imported <abbr class="timeago" '), i = {
title: "STRING"
}, t.buffer.push(f(r.bindAttr.call(e, {
hash: {
title: "view.lastImportAtISOString"
},
contexts: [],
types: [],
hashTypes: i,
data: t
}))), t.buffer.push("></abbr></p>\n "), n
}
this.compilerInfo = [2, ">= 1.0.0-rc.3"], r = r || Ember.Handlebars.helpers, s = s || {};
var o = "",
u, a, f = this.escapeExpression,
l = this;
return s.buffer.push('<div class="import-content">\n '), a = {}, u = r["if"].call(n, "isImportingOrDone", {
hash: {},
inverse: l.program(10, m, s),
fn: l.program(1, c, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push("\n\n "), a = {}, u = r["if"].call(n, "lastImportAtISOString", {
hash: {},
inverse: l.noop,
fn: l.program(12, g, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push("\n</div>\n"), o
}), Ember.TEMPLATES.nav_filter = Ember.Handlebars.template(function (t, n, r, i, s) {
function c(e, t) {
var n = "",
i;
return t.buffer.push('\n <img class="favicon float push-right" '), i = {
src: "STRING"
}, t.buffer.push(f(r.bindAttr.call(e, {
hash: {
src: "view.favicon"
},
contexts: [],
types: [],
hashTypes: i,
data: t
}))), t.buffer.push(' alt="icon"></img>\n'), n
}
function h(e, t) {
var n = "",
i;
return t.buffer.push('\n <span class="count float-rev push-left">\n ('), i = {}, t.buffer.push(f(r._triageMustache.call(e, "view.count", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push(')\n </span>\n <strong class="unread flow">'), i = {}, t.buffer.push(f(r._triageMustache.call(e, "view.label", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push("</strong>\n "), n
}
function p(e, t) {
var n = "",
i;
return t.buffer.push("\n "), i = {}, t.buffer.push(f(r._triageMustache.call(e, "view.label", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push("\n "), n
}
this.compilerInfo = [2, ">= 1.0.0-rc.3"], r = r || Ember.Handlebars.helpers, s = s || {};
var o = "",
u, a, f = this.escapeExpression,
l = this;
return a = {}, u = r["if"].call(n, "view.favicon", {
hash: {},
inverse: l.noop,
fn: l.program(1, c, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push('\n\n<div class="flow ellip">\n '), a = {}, u = r["if"].call(n, "view.count", {
hash: {},
inverse: l.program(5, p, s),
fn: l.program(3, h, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push("\n</div>\n"), o
}), Ember.TEMPLATES.shortcuts = Ember.Handlebars.template(function (t, n, r, i, s) {
this.compilerInfo = [2, ">= 1.0.0-rc.3"], r = r || Ember.Handlebars.helpers, s = s || {};
var o = "",
u, a = this.escapeExpression;
return s.buffer.push('<div class="padded-horz-2 padded-vert size-1">\n <a href="" class="shortcuts-link" '), u = {}, s.buffer.push(a(r.action.call(n, "toggleShortcuts", {
hash: {},
contexts: [n],
types: ["ID"],
hashTypes: u,
data: s
}))), s.buffer.push('>close</a>\n <h1 class="head-3"><i class="icon-keyboard size-4 push-right"></i> Keyboard Shortcuts</h1>\n\n <div class="grid-wrapper clear">\n <section class="push-top grid-2 padded-right-2">\n <h2 class="head-2">Navigation</h2>\n <ul>\n <li><code>j</code> &mdash; next article</li>\n <li><code>k</code> &mdash; previous article</li>\n <li><code>n/space</code> &mdash; scan down article (hold at bottom of article for next)</li>\n <li><code>p</code> &mdash; scan up article (hold at top of article for previous)</li>\n <li><code>m</code> &mdash; toggle article unread</li>\n </ul>\n </section>\n\n <section class="push-top grid-2 padded-right-2">\n <h2 class="head-2">Jumping</h2>\n <ul>\n <li><code>g</code> then <code>h</code> &mdash; go home</li>\n <li><code>g</code> then <code>a</code> &mdash; all articles</li>\n <li><code>g</code> then <code>s</code> &mdash; starred articles</li>\n <li><code>g</code> then <code>n</code> &mdash; new articles</li>\n </ul>\n </section>\n\n <section class="push-top grid-2">\n <h2 class="head-2">Application</h2>\n <ul>\n <li><code>a</code> &mdash; add subscription</li>\n <li><code>r</code> &mdash; reload</li>\n <li><code>?</code> &mdash; show/hide shortcuts</li>\n </ul>\n </section>\n </div>\n\n <div class="grid-wrapper clear">\n <section class="push-top grid-2 padded-right-2">\n <h2 class="head-2">Articles</h2>\n <ul>\n <li><code>s</code> &mdash; toggle star on article</li>\n <li><code>v</code> &mdash; view original</li>\n </ul>\n </section>\n\n <section class="push-top grid-2 padded-right-2">\n <h2 class="head-2">Cursor in the articles list</h2>\n <ul>\n <li><code>&uarr;</code> &mdash; previous article</li>\n <li><code>&darr;</code> &mdash; next article</li>\n </ul>\n </section>\n\n <section class="push-top grid-2">\n <h2 class="head-2">Cursor in an article</h2>\n <ul>\n <li>hold <code>&uarr;</code> at the top of an article &mdash; previous article</li>\n <li>hold <code>&darr;</code> at the bottom of an article &mdash; next article</li>\n </ul>\n </section>\n </div>\n\n</div>\n'), o
}), Ember.TEMPLATES.start = Ember.Handlebars.template(function (t, n, r, i, s) {
function p(e, t) {
t.buffer.push("Import Google Reader")
}
this.compilerInfo = [2, ">= 1.0.0-rc.3"], r = r || Ember.Handlebars.helpers, s = s || {};
var o = "",
u, a, f, l, c = this,
h = r.helperMissing;
return s.buffer.push("<h1>No feeds yet</h1>\n"), f = {}, l = {
hash: {},
inverse: c.noop,
fn: c.program(1, p, s),
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}, a = (u = r.linkTo, u ? u.call(n, "import", l) : h.call(n, "linkTo", "import", l)), (a || a === 0) && s.buffer.push(a), s.buffer.push("\n"), o
}), Ember.TEMPLATES.subscription_actions = Ember.Handlebars.template(function (t, n, r, i, s) {
function c(e, t) {
t.buffer.push('\n <i class="icon-sort-down link" title="Actions"></i>\n')
}
function h(e, t) {
var n = "",
i;
return t.buffer.push('\n <li>\n <a href="" '), i = {}, t.buffer.push(f(r.action.call(e, "markRead", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push('>Mark read</a>\n </li>\n <li>\n <a href="" '), i = {}, t.buffer.push(f(r.action.call(e, "unsubscribe", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push(">Unsubscribe</a>\n </li>\n"), n
}
this.compilerInfo = [2, ">= 1.0.0-rc.3"], r = r || Ember.Handlebars.helpers, s = s || {};
var o = "",
u, a, f = this.escapeExpression,
l = this;
return a = {}, u = r.view.call(n, "view.openTogglerView", {
hash: {},
inverse: l.noop,
fn: l.program(1, c, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push("\n\n"), a = {}, u = r.view.call(n, "view.actionsView", {
hash: {},
inverse: l.noop,
fn: l.program(3, h, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push("\n"), o
}), Ember.TEMPLATES.subscriptions_nav = Ember.Handlebars.template(function (t, n, r, i, s) {
function d(e, t) {
var n = "",
i;
return t.buffer.push('\n <span class="total-num-unread float-rev push-left">('), i = {}, t.buffer.push(c(r._triageMustache.call(e, "user.unreadArticleIds.length", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push(")</span>\n "), n
}
function v(e, t) {
var n = "",
i, s;
return t.buffer.push("\n "), s = {
tagBinding: "STRING"
}, i = r.view.call(e, "Yoleo.SubscriptionCollectionView", {
hash: {
tagBinding: "label"
},
inverse: h.noop,
fn: h.program(4, m, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n "), n
}
function m(e, t) {
var n = "",
i, s;
return t.buffer.push('\n <h2 class="link head-4 folder-title">\n <i '), s = {
target: "STRING"
}, t.buffer.push(c(r.action.call(e, "toggleExpansion", {
hash: {
target: "view"
},
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}))), t.buffer.push(' class="float push-right icon-folder-close-alt"></i>\n '), s = {
filter: "STRING",
valueBinding: "ID",
labelBinding: "ID"
}, t.buffer.push(c(r.view.call(e, "Yoleo.NavFilterView", {
hash: {
filter: "tag",
valueBinding: "params.state",
labelBinding: "label"
},
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}))), t.buffer.push("\n </h2>\n "), s = {}, i = r["if"].call(e, "taggedSubscriptions.length", {
hash: {},
inverse: h.noop,
fn: h.program(5, g, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n "), n
}
function g(e, t) {
var n = "",
i, s;
return t.buffer.push('\n <ul class="category-list push-bottom">\n '), s = {
itemController: "STRING"
}, i = r.each.call(e, "taggedSubscriptions", {
hash: {
itemController: "subscriptionsNavEntry"
},
inverse: h.noop,
fn: h.program(6, y, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n </ul>\n "), n
}
function y(e, t) {
var n = "",
i, s;
return t.buffer.push("\n "), s = {}, i = r.view.call(e, "Yoleo.SubscriptionCollectionEntryView", {
hash: {},
inverse: h.noop,
fn: h.program(7, b, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n "), n
}
function b(e, t) {
var n = "",
i;
return t.buffer.push("\n "), i = {
viewName: "STRING"
}, t.buffer.push(c(r.view.call(e, "view.subscriptionActionsView", {
hash: {
viewName: "subscriptionActions"
},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push('\n <span class="link flow">\n '), i = {
faviconBinding: "STRING",
filter: "STRING",
valueBinding: "ID",
labelBinding: "ID",
countBinding: "ID"
}, t.buffer.push(c(r.view.call(e, "Yoleo.NavFilterView", {
hash: {
faviconBinding: "subscription.feed.favicon",
filter: "feed_slug",
valueBinding: "subscription.feed.slug",
labelBinding: "subscription.feed.title",
countBinding: "subscription.numUnread"
},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push("\n </span>\n "), n
}
function w(e, t) {
var n = "",
i, s;
return t.buffer.push("\n "), s = {}, i = r["if"].call(e, "untaggedSubscriptionsMap.length", {
hash: {},
inverse: h.noop,
fn: h.program(10, E, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n "), n
}
function E(e, t) {
var n = "",
i, s;
return t.buffer.push("\n "), s = {}, i = r["if"].call(e, "controllers.user.tags.length", {
hash: {},
inverse: h.noop,
fn: h.program(11, S, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n <ul "), s = {
"class": "STRING"
}, t.buffer.push(c(r.bindAttr.call(e, {
hash: {
"class": ":category-list :push-bottom controllers.user.tags.length:has-categories:no-categories"
},
contexts: [],
types: [],
hashTypes: s,
data: t
}))), t.buffer.push(">\n "), s = {
itemController: "STRING"
}, i = r.each.call(e, "untaggedSubscriptionsMap", {
hash: {
itemController: "subscriptionsNavEntry"
},
inverse: h.noop,
fn: h.program(13, x, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n </ul>\n "), n
}
function S(e, t) {
var n = "",
i;
return t.buffer.push('\n <h2 class="link head-4 folder-title">\n <i '), i = {
target: "STRING"
}, t.buffer.push(c(r.action.call(e, "toggleExpansion", {
hash: {
target: "view"
},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push(' class="float push-right icon-inbox"></i>\n '), i = {
filter: "STRING",
value: "STRING",
label: "STRING"
}, t.buffer.push(c(r.view.call(e, "Yoleo.NavFilterView", {
hash: {
filter: "tag",
value: "uncategorized",
label: "Uncategorized"
},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push("\n </h2>\n "), n
}
function x(e, t) {
var n = "",
i, s;
return t.buffer.push("\n "), s = {}, i = r.view.call(e, "Yoleo.SubscriptionCollectionEntryView", {
hash: {},
inverse: h.noop,
fn: h.program(14, T, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n "), n
}
function T(e, t) {
var n = "",
i;
return t.buffer.push("\n "), i = {
viewName: "STRING"
}, t.buffer.push(c(r.view.call(e, "view.subscriptionActionsView", {
hash: {
viewName: "subscriptionActions"
},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push('\n <span class="link flow">\n '), i = {
filter: "STRING",
faviconBinding: "STRING",
valueBinding: "ID",
labelBinding: "ID",
countBinding: "ID"
}, t.buffer.push(c(r.view.call(e, "Yoleo.NavFilterView", {
hash: {
filter: "feed_slug",
faviconBinding: "subscription.feed.favicon",
valueBinding: "subscription.feed.slug",
labelBinding: "subscription.feed.title",
countBinding: "subscription.numUnread"
},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push("\n </span>\n "), n
}
function N(e, t) {
t.buffer.push("Import")
}
function C(e, t) {
t.buffer.push("Starting page")
}
function k(e, t) {
t.buffer.push("My Account")
}
this.compilerInfo = [2, ">= 1.0.0-rc.3"], r = r || Ember.Handlebars.helpers, s = s || {};
var o = "",
u, a, f, l, c = this.escapeExpression,
h = this,
p = r.helperMissing;
return s.buffer.push('<header class="app-nav-header padded-horz-2">\n <a href="/" class="app-logo" '), f = {}, s.buffer.push(c(r.action.call(n, "goHome", {
hash: {},
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}))), s.buffer.push('>\n <div class="app-logo-img float push-right"></div>\n <div class="app-logo-text size-7">\n Yoleo Reader\n <span class="app-version size-3">α</span>\n </div>\n </a><!-- .app-logo -->\n <div class="add-subscriptions">\n '), f = {}, l = {
hash: {},
contexts: [n],
types: ["STRING"],
hashTypes: f,
data: s
}, s.buffer.push(c((u = r.render, u ? u.call(n, "subscriptionsNew", l) : p.call(n, "render", "subscriptionsNew", l)))), s.buffer.push("\n </div><!-- .add-subscriptions -->\n <h1 "), f = {
"class": "STRING"
}, s.buffer.push(c(r.bindAttr.call(n, {
hash: {
"class": "isAllSubscriptions:selected :head-5 :all-subscriptions :link :app-nav-title :ellip :push-top"
},
contexts: [],
types: [],
hashTypes: f,
data: s
}))), s.buffer.push(" "), f = {
target: "STRING"
}, s.buffer.push(c(r.action.call(n, "clearAll", {
hash: {
target: "filters"
},
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}))), s.buffer.push(">\n "), f = {}, a = r["if"].call(n, "user.unreadArticleIds.length", {
hash: {},
inverse: h.noop,
fn: h.program(1, d, s),
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}), (a || a === 0) && s.buffer.push(a), s.buffer.push('\n <span class="flow">\n <i class="icon-rss push-right"></i> All Subscriptions\n </span>\n <div class="subscriptions-header padded-horz-2">\n <h1 '), f = {
"class": "STRING"
}, s.buffer.push(c(r.bindAttr.call(n, {
hash: {
"class": "isAllSubscriptions:selected :head-5 :all-subscriptions :link :app-nav-title :push-bottom :ellip"
},
contexts: [],
types: [],
hashTypes: f,
data: s
}))), s.buffer.push(" "), f = {
target: "STRING"
}, s.buffer.push(c(r.action.call(n, "clearAll", {
hash: {
target: "filters"
},
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}))), s.buffer.push('></h1>\n </div>\n </h1>\n</header><!-- .app-nav-header -->\n\n<nav class="app-navigation padded-2">\n <div class="subscriptions-list">\n <ul class="subscription-categories">\n '), f = {}, a = r.each.call(n, "tags", {
hash: {},
inverse: h.noop,
fn: h.program(3, v, s),
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}), (a || a === 0) && s.buffer.push(a), s.buffer.push("\n\n "), f = {}, a = r.view.call(n, "Yoleo.SubscriptionCollectionView", {
hash: {},
inverse: h.noop,
fn: h.program(9, w, s),
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}), (a || a === 0) && s.buffer.push(a), s.buffer.push('\n\n </ul><!-- .subscription-categories -->\n </div><!-- .subscriptions-list -->\n</nav><!-- .app-navigation -->\n\n<ul class="horz app-nav-footer">\n <li>'), f = {}, l = {
hash: {},
inverse: h.noop,
fn: h.program(16, N, s),
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}, a = (u = r.linkTo, u ? u.call(n, "import", l) : p.call(n, "linkTo", "import", l)), (a || a === 0) && s.buffer.push(a), s.buffer.push("</li>\n <!-- <li>"), f = {}, l = {
hash: {},
inverse: h.noop,
fn: h.program(18, C, s),
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}, a = (u = r.linkTo, u ? u.call(n, "start", l) : p.call(n, "linkTo", "start", l)), (a || a === 0) && s.buffer.push(a), s.buffer.push('</li> -->\n <li class="push-horz-3">'), f = {}, l = {
hash: {},
inverse: h.noop,
fn: h.program(20, k, s),
contexts: [n],
types: ["ID"],
hashTypes: f,
data: s
}, a = (u = r.linkTo, u ? u.call(n, "account", l) : p.call(n, "linkTo", "account", l)), (a || a === 0) && s.buffer.push(a), s.buffer.push('</li>\n <li><a href="/logout">Logout</a></li>\n</ul>\n'), o
}), Ember.TEMPLATES.subscriptions_new = Ember.Handlebars.template(function (t, n, r, i, s) {
function c(e, t) {
var n = "",
i;
return t.buffer.push('\n <div class="success notice-area padded head-2 push-top">\n Subscription Added&hellip;<br>\n This dialog will close automatically in '), i = {}, t.buffer.push(f(r._triageMustache.call(e, "closeIn", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push(" seconds.\n </div>\n "), n
}
function h(e, t) {
var n = "",
i, s;
return t.buffer.push("\n "), s = {}, i = r.view.call(e, "view.form", {
hash: {},
inverse: l.noop,
fn: l.program(4, p, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n "), n
}
function p(e, t) {
var n = "",
i, s;
return t.buffer.push('\n <fieldset class="form-area add-feed padded-bottom">\n\n '), s = {}, i = r["if"].call(e, "error", {
hash: {},
inverse: l.noop,
fn: l.program(5, d, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push('\n\n <label class="hidden">Paste URL&hellip;</label>\n <div class="flow">\n '), s = {
valueBinding: "STRING",
placeholder: "STRING",
isDisabledBinding: "STRING"
}, t.buffer.push(f(r.view.call(e, "Em.TextField", {
hash: {
valueBinding: "url",
placeholder: "Paste URL&hellip;",
isDisabledBinding: "isSaving"
},
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}))), t.buffer.push('\n </div>\n <ul class="horz push-top">\n <li class="push-right">\n <span class="save size-3 link" '), s = {}, t.buffer.push(f(r.action.call(e, "save", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}))), t.buffer.push(' isDisabledBinding="isSaving">Save</span>\n </li>\n <li class="push-right">\n <span class="close size-3 link" '), s = {}, t.buffer.push(f(r.action.call(e, "close", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}))), t.buffer.push(">Cancel</span>\n </li>\n "), s = {}, i = r["if"].call(e, "isSaving", {
hash: {},
inverse: l.noop,
fn: l.program(7, v, t),
contexts: [e],
types: ["ID"],
hashTypes: s,
data: t
}), (i || i === 0) && t.buffer.push(i), t.buffer.push("\n </ul>\n </fieldset>\n "), n
}
function d(e, t) {
var n = "",
i;
return t.buffer.push('\n <div class="notice-area errors padded head-2 push-bottom">'), i = {}, t.buffer.push(f(r._triageMustache.call(e, "error", {
hash: {},
contexts: [e],
types: ["ID"],
hashTypes: i,
data: t
}))), t.buffer.push("</div>\n "), n
}
function v(e, t) {
t.buffer.push('\n <li class="push-left">\n <span class=" success size-3">\n Saving&hellip;\n </span>\n </li>\n ')
}
this.compilerInfo = [2, ">= 1.0.0-rc.3"], r = r || Ember.Handlebars.helpers, s = s || {};
var o = "",
u, a, f = this.escapeExpression,
l = this;
return s.buffer.push('<h1 class="head-5 new-subscription-link app-nav-title ellip">\n <a href="" '), a = {}, s.buffer.push(f(r.action.call(n, "toggleVisible", {
hash: {},
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}))), s.buffer.push(' class="">\n <i class="icon-plus-sign-alt push-right"></i>\n New Subscription\n </a>\n</h1>\n\n<div class="subscriptions-new hidden">\n\n '), a = {}, u = r["if"].call(n, "saveSuccess", {
hash: {},
inverse: l.program(3, h, s),
fn: l.program(1, c, s),
contexts: [n],
types: ["ID"],
hashTypes: a,
data: s
}), (u || u === 0) && s.buffer.push(u), s.buffer.push("\n\n\n\n"), o
}),
function () {
Yoleo.Router.map(function () {
return this.route("start"), this.route("import"), this.route("account"), this.route("home", {
path: "/"
}), this.route("article", {
path: "/article/:article_id"
}), this.resource("articles", {
path: "/articles"
}, function () {
return this.route("state", {
path: "/:filter1"
}), this.route("tag", {
path: "/:filter1/:filter2"
})
})
}), Yoleo.Router.reopen({
location: "history",
didTransition: function () {
var e = this;
return Em.run.next(function () {
if (typeof _gaq != "undefined" && _gaq !== null && e.get("url")) return _gaq.push(["_trackPageview", e.get("url")])
})
}
})
}.call(this),
function () {
Yoleo.AccountRoute = Em.Route.extend({
redirect: function () {
return Em.run.next(function () {
if (window.location.protocol !== "https:") return window.location.protocol = "https:"
})
},
setupController: function (e) {
return this.controllerFor("articlesList").set("hidden", !0)
},
renderTemplate: function () {
return this.render("billingInfo", {
into: "application"
}), this.render("subscriptionsNav", {
into: "application",
outlet: "leftNav",
controller: "subscriptionsNav"
})
}
})
}.call(this),
function () {
Yoleo.ApplicationRoute = Em.Route.extend({
events: {
goNew: function () {
return this.transitionTo("articles.state", {
state: "new"
}), !1
},
goHome: function () {
return this.transitionTo("articles.index"), !1
},
goStarred: function () {
return this.transitionTo("articles.state", {
state: "starred"
}), !1
},
filterChanged: function () {
var e, t, n;
return t = this.controllerFor("filters"), e = t.get("feed_slug") || t.get("tag"), n = t.get("state"), e && n ? this.transitionTo("articles.tag", {
tag: e,
state: n
}) : n || e ? this.transitionTo("articles.state", {
state: n || e
}) : this.transitionTo("articles.index")
},
markAllRead: function () {
return Yoleo.Article.markAllRead()
},
toggleShortcuts: function () {
return this.controllerFor("shortcuts").send("toggle")
},
hideModals: function () {
return this.controllerFor("shortcuts").send("hide"), this.controllerFor("subscriptionsNew").send("close")
}
},
setupController: function (e) {
var t, n;
if (!e.get("wasInitialized")) return n = e.get("store"), n.adapterForType(Yoleo.User).load(n, Yoleo.User, PRELOAD.user), this.controllerFor("user").set("content", Yoleo.User.find("current")), t = this.controllerFor("pusher"), t.connect(PRELOAD.pusher_settings.key, {
app: PRELOAD.pusher_settings.app_channel,
user: PRELOAD.pusher_settings.user_channel
}, {
encrypted: !0,
auth: {
params: {
authenticity_token: $('meta[name="csrf-token"]').attr("content")
}
}
}), e.pusherListenTo("app", "reload_required"), e.pusherListenTo("user", "auth_required"), this.controllerFor("user").pusherListenTo("user", "pusher:subscription_succeeded"), e.set("wasInitialized", !0)
}
})
}.call(this),
function () {
Yoleo.ArticlesIndexRoute = Em.Route.extend(Yoleo.PusherListener, {
setupController: function () {
return this.controllerFor("articles").send("loadArticles")
},
renderTemplate: function () {
return this.render("currentArticle", {
into: "application"
})
}
})
}.call(this),
function () {
Yoleo.ArticlesRoute = Em.Route.extend(Yoleo.PusherListener, {
setupController: function (e) {
this.controllerFor("articlesList").set("hidden", !1);
if (!this.get("setupPusherBindings")) return e.pusherListenTo("user", "new_article"), this.set("setupPusherBindings", !0)
},
redirect: function () {
var e;
Em.run.next(function () {
if (window.location.protocol !== "http:") return window.location.protocol = "http:"
}), e = this.controllerFor("user");
if (e.get("numSubscriptions") === 0) return this.transitionTo("import")
},
model: function () {
return []
},
events: {
goToNewFeed: function (e) {
return this.transitionTo("articles.state", {
state: e
})
},
filterChanged: function () {
var e, t, n;
return t = this.controllerFor("filters"), e = t.get("feed_slug") || t.get("tag"), n = t.get("state"), e && n ? this.transitionTo("articles.tag", {
tag: e,
state: n
}) : n || e ? this.transitionTo("articles.state", {
state: n || e
}) : this.transitionTo("articles.index")
}
},
renderTemplate: function () {
return this.render("articles"), this.render("articlesList", {
into: "application",
outlet: "rightNav",
controller: "articlesList"
}), this.render("subscriptionsNav", {
into: "application",
outlet: "leftNav",
controller: "subscriptionsNav"
})
}
})
}.call(this),
function () {
Yoleo.ArticlesStateRoute = Em.Route.extend({
RESERVED_STATE_NAMES: ["starred", "new"],
setupController: function (e, t) {
var n, r, i;
return t == null && (t = {}), i = this.controllerFor("user"), r = unescape(t.state), this.RESERVED_STATE_NAMES.contains(r) ? (n = {
state: r
}, this.controllerFor("filters").set("state", r)) : i.get("tags").contains(r) || r === "uncategorized" ? (n = {
tag: r
}, this.controllerFor("filters").set("tag", r)) : (n = {
feed_slug: r
}, this.controllerFor("filters").set("feed_slug", r)), this.controllerFor("articles").send("loadArticles", n)
},
serialize: function (e) {
return e == null && (e = {}), {
filter1: e.state
}
},
deserialize: function (e) {
return {
state: e.filter1
}
},
renderTemplate: function () {
return this.render("currentArticle", {
into: "application"
})
}
})
}.call(this),
function () {
Yoleo.ArticlesTagRoute = Em.Route.extend({
RESERVED_STATE_NAMES: ["starred", "new"],
setupController: function (e, t) {
var n, r, i;
return delete t.page, i = this.controllerFor("user"), r = unescape(t.tag), i.get("tags").contains(r) || t.tag === "uncategorized" ? (n = {
tag: r,
state: t.state
}, this.controllerFor("filters").set("tag", r)) : (n = {
feed_slug: r,
state: t.state
}, this.controllerFor("filters").set("feed_slug", r)), this.controllerFor("filters").set("state", t.state), this.controllerFor("articles").send("loadArticles", n)
},
serialize: function (e) {
return {
filter1: e.tag,
filter2: e.state
}
},
deserialize: function (e) {
return {
tag: e.filter1,
state: e.filter2
}
},
renderTemplate: function () {
return this.render("currentArticle", {
into: "application"
})
}
})
}.call(this),
function () {
Yoleo.HomeRoute = Em.Route.extend({
redirect: function () {
return window.location.protocol === "https:" ? window.location = "/articles" : this.transitionTo("articles")
}
})
}.call(this),
function () {
Yoleo.ImportRoute = Em.Route.extend({
setupController: function (e) {
this.controllerFor("articlesList").set("hidden", !0);
if (!this.get("pusherBindingsSetup")) return e.pusherListenTo("user", "import_successful"), e.pusherListenTo("user", "import_feed"), this.set("pusherBindingsSetup", !0)
},
renderTemplate: function () {
return this.render("import"), this.render("subscriptionsNav", {
into: "application",
outlet: "leftNav",
controller: "subscriptionsNav"
})
}
})
}.call(this),
function () {}.call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment