Skip to content

Instantly share code, notes, and snippets.

@voidfiles
Created June 21, 2013 21:20
Show Gist options
  • Select an option

  • Save voidfiles/5834425 to your computer and use it in GitHub Desktop.

Select an option

Save voidfiles/5834425 to your computer and use it in GitHub Desktop.
AOL Reader Beautified Javascript
/**
* Isotope v1.5.25
* An exquisite jQuery plugin for magical layouts
* http://isotope.metafizzy.co
*
* Commercial use requires one-time purchase of a commercial license
* http://isotope.metafizzy.co/docs/license.html
*
* Non-commercial use is licensed under the MIT License
*
* Copyright 2013 Metafizzy
*/
/*!
* Modernizr v1.6ish: miniModernizr for Isotope
* http://www.modernizr.com
*
* Developed by:
* - Faruk Ates http://farukat.es/
* - Paul Irish http://paulirish.com/
*
* Copyright (c) 2009-2010
* Dual-licensed under the BSD or MIT licenses.
* http://www.modernizr.com/license/
*/
/*
* smartresize: debounced resize event for jQuery
*
* latest version and complete README available on Github:
* https://github.com/louisremi/jquery.smartresize.js
*
* Copyright 2011 @louis_remi
* Licensed under the MIT license.
*/
/*!
* jQuery imagesLoaded plugin v1.1.0
* http://github.com/desandro/imagesloaded
*
* MIT License. by Paul Irish et al.
*/
/* ============================================================
* bootstrap-dropdown.js v2.3.1
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
* ============================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
/* ===========================================================
* bootstrap-tooltip.js v2.3.2
* http://twitter.github.com/bootstrap/javascript.html#tooltips
* Inspired by the original jQuery.tipsy by Jason Frame
* ===========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================== */
/*! jQuery UI - v1.10.3 - 2013-05-16
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.sortable.js
* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */
/**
* Copyright 2013 Craig Campbell
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Mousetrap is a simple keyboard shortcut library for Javascript with
* no external dependencies
*
* @version 1.3.3
* @url craig.is/killing/mice
*/
/**
* @license
* Lo-Dash 1.2.1 (Custom Build) <http://lodash.com/>
* Build: `lodash -o ./dist/lodash.compat.js`
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.4.4 <http://underscorejs.org/>
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
* Available under MIT license <http://lodash.com/license>
*/
// Underscore.string
// (c) 2010 Esa-Matti Suuronen <esa-matti aet suuronen dot org>
// Underscore.string is freely distributable under the terms of the MIT license.
// Documentation: https://github.com/epeli/underscore.string
// Some code is borrowed from MooTools and Alexandru Marasteanu.
// Version '2.3.0'
// Copyright (c) Alexandru Marasteanu <alexaholic [at) gmail (dot] com>
// (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc.
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
// http://backbonejs.org
/*
Copyright (C) 2011 by Yehuda Katz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
// moment.js
// version : 2.0.0
// author : Tim Wood
// license : MIT
// momentjs.com
/**
* @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
*
* @version 0.6.7
* @codingstandard ftlabs-jsv2
* @copyright The Financial Times Limited [All Rights Reserved]
* @license MIT License (see LICENSE.txt)
*/
function FastClick(e) {
var t, n = this;
this.trackingClick = !1, this.trackingClickStart = 0, this.targetElement = null, this.touchStartX = 0, this.touchStartY = 0, this.lastTouchIdentifier = 0, this.touchBoundary = 10, this.layer = e;
if (!e || !e.nodeType) throw new TypeError("Layer must be a document node");
this.onClick = function() {
return FastClick.prototype.onClick.apply(n, arguments)
}, this.onMouse = function() {
return FastClick.prototype.onMouse.apply(n, arguments)
}, this.onTouchStart = function() {
return FastClick.prototype.onTouchStart.apply(n, arguments)
}, this.onTouchMove = function() {
return FastClick.prototype.onTouchMove.apply(n, arguments)
}, this.onTouchEnd = function() {
return FastClick.prototype.onTouchEnd.apply(n, arguments)
}, this.onTouchCancel = function() {
return FastClick.prototype.onTouchCancel.apply(n, arguments)
};
if (FastClick.notNeeded(e)) return;
this.deviceIsAndroid && (e.addEventListener("mouseover", this.onMouse, !0), e.addEventListener("mousedown", this.onMouse, !0), e.addEventListener("mouseup", this.onMouse, !0)), e.addEventListener("click", this.onClick, !0), e.addEventListener("touchstart", this.onTouchStart, !1), e.addEventListener("touchmove", this.onTouchMove, !1), e.addEventListener("touchend", this.onTouchEnd, !1), e.addEventListener("touchcancel", this.onTouchCancel, !1), Event.prototype.stopImmediatePropagation || (e.removeEventListener = function(t, n, r) {
var i = Node.prototype.removeEventListener;
t === "click" ? i.call(e, t, n.hijacked || n, r) : i.call(e, t, n, r)
}, e.addEventListener = function(t, n, r) {
var i = Node.prototype.addEventListener;
t === "click" ? i.call(e, t, n.hijacked || (n.hijacked = function(e) {
e.propagationStopped || n(e)
}), r) : i.call(e, t, n, r)
}), typeof e.onclick == "function" && (t = e.onclick, e.addEventListener("click", function(e) {
t(e)
}, !1), e.onclick = null)
}(function(e, t, n) {
var r = e.document,
i = e.Modernizr,
s = function(e) {
return e.charAt(0).toUpperCase() + e.slice(1)
},
o = "Moz Webkit O Ms".split(" "),
u = function(e) {
var t = r.documentElement.style,
n;
if (typeof t[e] == "string") return e;
e = s(e);
for (var i = 0, u = o.length;
i < u;
i++) {
n = o[i] + e;
if (typeof t[n] == "string") return n
}
},
a = u("transform"),
f = u("transitionProperty"),
l = {
csstransforms: function() {
return !!a
},
csstransforms3d: function() {
var e = !! u("perspective");
if (e) {
var n = " -o- -moz- -ms- -webkit- -khtml- ".split(" "),
r = "@media (" + n.join("transform-3d),(") + "modernizr)",
i = t("<style>" + r + "{#modernizr{height:3px
}
}" + "</style>").appendTo("head"),
s = t('<div id="modernizr" />').appendTo("html");
e = s.height() === 3, s.remove(), i.remove()
}
return e
},
csstransitions: function() {
return !!f
}
},
c;
if (i) for (c in l) i.hasOwnProperty(c) || i.addTest(c, l[c]);
else {
i = e.Modernizr = {
_version: "1.6ish: miniModernizr for Isotope"
};
var h = " ",
p;
for (c in l) p = l[c](), i[c] = p, h += " " + (p ? "" : "no-") + c;
t("html").addClass(h)
}
if (i.csstransforms) {
var d = i.csstransforms3d ? {
translate: function(e) {
return "translate3d(" + e[0] + "px, " + e[1] + "px, 0) "
},
scale: function(e) {
return "scale3d(" + e + ", " + e + ", 1) "
}
} : {
translate: function(e) {
return "translate(" + e[0] + "px, " + e[1] + "px) "
},
scale: function(e) {
return "scale(" + e + ") "
}
},
v = function(e, n, r) {
var i = t.data(e, "isoTransform") || {},
s = {},
o, u = {},
f;
s[n] = r, t.extend(i, s);
for (o in i) f = i[o], u[o] = d[o](f);
var l = u.translate || "",
c = u.scale || "",
h = l + c;
t.data(e, "isoTransform", i), e.style[a] = h
};
t.cssNumber.scale = !0, t.cssHooks.scale = {
set: function(e, t) {
v(e, "scale", t)
},
get: function(e, n) {
var r = t.data(e, "isoTransform");
return r && r.scale ? r.scale : 1
}
}, t.fx.step.scale = function(e) {
t.cssHooks.scale.set(e.elem, e.now + e.unit)
}, t.cssNumber.translate = !0, t.cssHooks.translate = {
set: function(e, t) {
v(e, "translate", t)
},
get: function(e, n) {
var r = t.data(e, "isoTransform");
return r && r.translate ? r.translate : [0, 0]
}
}
}
var m, g;
i.csstransitions && (m = {
WebkitTransitionProperty: "webkitTransitionEnd",
MozTransitionProperty: "transitionend",
OTransitionProperty: "oTransitionEnd otransitionend",
transitionProperty: "transitionend"
}[f], g = u("transitionDuration"));
var y = t.event,
b = t.event.handle ? "handle" : "dispatch",
w;
y.special.smartresize = {
setup: function() {
t(this).bind("resize", y.special.smartresize.handler)
},
teardown: function() {
t(this).unbind("resize", y.special.smartresize.handler)
},
handler: function(e, t) {
var n = this,
r = arguments;
e.type = "smartresize", w && clearTimeout(w), w = setTimeout(function() {
y[b].apply(n, r)
}, t === "execAsap" ? 0 : 100)
}
}, t.fn.smartresize = function(e) {
return e ? this.bind("smartresize", e) : this.trigger("smartresize", ["execAsap"])
}, t.Isotope = function(e, n, r) {
this.element = t(n), this._create(e), this._init(r)
};
var E = ["width", "height"],
S = t(e);
t.Isotope.settings = {
resizable: !0,
layoutMode: "masonry",
containerClass: "isotope",
itemClass: "isotope-item",
hiddenClass: "isotope-hidden",
hiddenStyle: {
opacity: 0,
scale: .001
},
visibleStyle: {
opacity: 1,
scale: 1
},
containerStyle: {
position: "relative",
overflow: "hidden"
},
animationEngine: "best-available",
animationOptions: {
queue: !1,
duration: 800
},
sortBy: "original-order",
sortAscending: !0,
resizesContainer: !0,
transformsEnabled: !0,
itemPositionDataEnabled: !1
}, t.Isotope.prototype = {
_create: function(e) {
this.options = t.extend({}, t.Isotope.settings, e), this.styleQueue = [], this.elemCount = 0;
var n = this.element[0].style;
this.originalStyle = {};
var r = E.slice(0);
for (var i in this.options.containerStyle) r.push(i);
for (var s = 0, o = r.length;
s < o;
s++) i = r[s], this.originalStyle[i] = n[i] || "";
this.element.css(this.options.containerStyle), this._updateAnimationEngine(), this._updateUsingTransforms();
var u = {
"original-order": function(e, t) {
return t.elemCount++, t.elemCount
},
random: function() {
return Math.random()
}
};
this.options.getSortData = t.extend(this.options.getSortData, u), this.reloadItems(), this.offset = {
left: parseInt(this.element.css("padding-left") || 0, 10),
top: parseInt(this.element.css("padding-top") || 0, 10)
};
var a = this;
setTimeout(function() {
a.element.addClass(a.options.containerClass)
}, 0), this.options.resizable && S.bind("smartresize.isotope", function() {
a.resize()
}), this.element.delegate("." + this.options.hiddenClass, "click", function() {
return !1
})
},
_getAtoms: function(e) {
var t = this.options.itemSelector,
n = t ? e.filter(t).add(e.find(t)) : e,
r = {
position: "absolute"
};
return n = n.filter(function(e, t) {
return t.nodeType === 1
}), this.usingTransforms && (r.left = 0, r.top = 0), n.css(r).addClass(this.options.itemClass), this.updateSortData(n, !0), n
},
_init: function(e) {
this.$filteredAtoms = this._filter(this.$allAtoms), this._sort(), this.reLayout(e)
},
option: function(e) {
if (t.isPlainObject(e)) {
this.options = t.extend(!0, this.options, e);
var n;
for (var r in e) n = "_update" + s(r), this[n] && this[n]()
}
},
_updateAnimationEngine: function() {
var e = this.options.animationEngine.toLowerCase().replace(/[ _\-]/g, ""),
t;
switch (e) {
case "css":
case "none":
t = !1;
break;
case "jquery":
t = !0;
break;
default:
t = !i.csstransitions
}
this.isUsingJQueryAnimation = t, this._updateUsingTransforms()
},
_updateTransformsEnabled: function() {
this._updateUsingTransforms()
},
_updateUsingTransforms: function() {
var e = this.usingTransforms = this.options.transformsEnabled && i.csstransforms && i.csstransitions && !this.isUsingJQueryAnimation;
e || (delete this.options.hiddenStyle.scale, delete this.options.visibleStyle.scale), this.getPositionStyles = e ? this._translate : this._positionAbs
},
_filter: function(e) {
var t = this.options.filter === "" ? "*" : this.options.filter;
if (!t) return e;
var n = this.options.hiddenClass,
r = "." + n,
i = e.filter(r),
s = i;
if (t !== "*") {
s = i.filter(t);
var o = e.not(r).not(t).addClass(n);
this.styleQueue.push({
$el: o,
style: this.options.hiddenStyle
})
}
return this.styleQueue.push({
$el: s,
style: this.options.visibleStyle
}), s.removeClass(n), e.filter(t)
},
updateSortData: function(e, n) {
var r = this,
i = this.options.getSortData,
s, o;
e.each(function() {
s = t(this), o = {};
for (var e in i)!n && e === "original-order" ? o[e] = t.data(this, "isotope-sort-data")[e] : o[e] = i[e](s, r);
t.data(this, "isotope-sort-data", o)
})
},
_sort: function() {
var e = this.options.sortBy,
t = this._getSorter,
n = this.options.sortAscending ? 1 : -1,
r = function(r, i) {
var s = t(r, e),
o = t(i, e);
return s === o && e !== "original-order" && (s = t(r, "original-order"), o = t(i, "original-order")), (s > o ? 1 : s < o ? -1 : 0) * n
};
this.$filteredAtoms.sort(r)
},
_getSorter: function(e, n) {
return t.data(e, "isotope-sort-data")[n]
},
_translate: function(e, t) {
return {
translate: [e, t]
}
},
_positionAbs: function(e, t) {
return {
left: e,
top: t
}
},
_pushPosition: function(e, t, n) {
t = Math.round(t + this.offset.left), n = Math.round(n + this.offset.top);
var r = this.getPositionStyles(t, n);
this.styleQueue.push({
$el: e,
style: r
}), this.options.itemPositionDataEnabled && e.data("isotope-item-position", {
x: t,
y: n
})
},
layout: function(e, t) {
var n = this.options.layoutMode;
this["_" + n + "Layout"](e);
if (this.options.resizesContainer) {
var r = this["_" + n + "GetContainerSize"]();
this.styleQueue.push({
$el: this.element,
style: r
})
}
this._processStyleQueue(e, t), this.isLaidOut = !0
},
_processStyleQueue: function(e, n) {
var r = this.isLaidOut ? this.isUsingJQueryAnimation ? "animate" : "css" : "css",
s = this.options.animationOptions,
o = this.options.onLayout,
u, a, f, l;
a = function(e, t) {
t.$el[r](t.style, s)
};
if (this._isInserting && this.isUsingJQueryAnimation) a = function(e, t) {
u = t.$el.hasClass("no-transition") ? "css" : r, t.$el[u](t.style, s)
};
else if (n || o || s.complete) {
var c = !1,
h = [n, o, s.complete],
p = this;
f = !0, l = function() {
if (c) return;
var t;
for (var n = 0, r = h.length;
n < r;
n++) t = h[n], typeof t == "function" && t.call(p.element, e, p);
c = !0
};
if (this.isUsingJQueryAnimation && r === "animate") s.complete = l, f = !1;
else if (i.csstransitions) {
var d = 0,
v = this.styleQueue[0],
y = v && v.$el,
b;
while (!y || !y.length) {
b = this.styleQueue[d++];
if (!b) return;
y = b.$el
}
var w = parseFloat(getComputedStyle(y[0])[g]);
w > 0 && (a = function(e, t) {
t.$el[r](t.style, s).one(m, l)
}, f = !1)
}
}
t.each(this.styleQueue, a), f && l(), this.styleQueue = []
},
resize: function() {
this["_" + this.options.layoutMode + "ResizeChanged"]() && this.reLayout()
},
reLayout: function(e) {
this["_" + this.options.layoutMode + "Reset"](), this.layout(this.$filteredAtoms, e)
},
addItems: function(e, t) {
var n = this._getAtoms(e);
this.$allAtoms = this.$allAtoms.add(n), t && t(n)
},
insert: function(e, t) {
this.element.append(e);
var n = this;
this.addItems(e, function(e) {
var r = n._filter(e);
n._addHideAppended(r), n._sort(), n.reLayout(), n._revealAppended(r, t)
})
},
appended: function(e, t) {
var n = this;
this.addItems(e, function(e) {
n._addHideAppended(e), n.layout(e), n._revealAppended(e, t)
})
},
_addHideAppended: function(e) {
this.$filteredAtoms = this.$filteredAtoms.add(e), e.addClass("no-transition"), this._isInserting = !0, this.styleQueue.push({
$el: e,
style: this.options.hiddenStyle
})
},
_revealAppended: function(e, t) {
var n = this;
setTimeout(function() {
e.removeClass("no-transition"), n.styleQueue.push({
$el: e,
style: n.options.visibleStyle
}), n._isInserting = !1, n._processStyleQueue(e, t)
}, 10)
},
reloadItems: function() {
this.$allAtoms = this._getAtoms(this.element.children())
},
remove: function(e, t) {
this.$allAtoms = this.$allAtoms.not(e), this.$filteredAtoms = this.$filteredAtoms.not(e);
var n = this,
r = function() {
e.remove(), t && t.call(n.element)
};
e.filter(":not(." + this.options.hiddenClass + ")").length ? (this.styleQueue.push({
$el: e,
style: this.options.hiddenStyle
}), this._sort(), this.reLayout(r)) : r()
},
shuffle: function(e) {
this.updateSortData(this.$allAtoms), this.options.sortBy = "random", this._sort(), this.reLayout(e)
},
destroy: function() {
var e = this.usingTransforms,
t = this.options;
this.$allAtoms.removeClass(t.hiddenClass + " " + t.itemClass).each(function() {
var t = this.style;
t.position = "", t.top = "", t.left = "", t.opacity = "", e && (t[a] = "")
});
var n = this.element[0].style;
for (var r in this.originalStyle) n[r] = this.originalStyle[r];
this.element.unbind(".isotope").undelegate("." + t.hiddenClass, "click").removeClass(t.containerClass).removeData("isotope"), S.unbind(".isotope")
},
_getSegments: function(e) {
var t = this.options.layoutMode,
n = e ? "rowHeight" : "columnWidth",
r = e ? "height" : "width",
i = e ? "rows" : "cols",
o = this.element[r](),
u, a = this.options[t] && this.options[t][n] || this.$filteredAtoms["outer" + s(r)](!0) || o;
u = Math.floor(o / a), u = Math.max(u, 1), this[t][i] = u, this[t][n] = a
},
_checkIfSegmentsChanged: function(e) {
var t = this.options.layoutMode,
n = e ? "rows" : "cols",
r = this[t][n];
return this._getSegments(e), this[t][n] !== r
},
_masonryReset: function() {
this.masonry = {}, this._getSegments();
var e = this.masonry.cols;
this.masonry.colYs = [];
while (e--) this.masonry.colYs.push(0)
},
_masonryLayout: function(e) {
var n = this,
r = n.masonry;
e.each(function() {
var e = t(this),
i = Math.ceil(e.outerWidth(!0) / r.columnWidth);
i = Math.min(i, r.cols);
if (i === 1) n._masonryPlaceBrick(e, r.colYs);
else {
var s = r.cols + 1 - i,
o = [],
u, a;
for (a = 0;
a < s;
a++) u = r.colYs.slice(a, a + i), o[a] = Math.max.apply(Math, u);
n._masonryPlaceBrick(e, o)
}
})
},
_masonryPlaceBrick: function(e, t) {
var n = Math.min.apply(Math, t),
r = 0;
for (var i = 0, s = t.length;
i < s;
i++) if (t[i] === n) {
r = i;
break
}
var o = this.masonry.columnWidth * r,
u = n;
this._pushPosition(e, o, u);
var a = n + e.outerHeight(!0),
f = this.masonry.cols + 1 - s;
for (i = 0;
i < f;
i++) this.masonry.colYs[r + i] = a
},
_masonryGetContainerSize: function() {
var e = Math.max.apply(Math, this.masonry.colYs);
return {
height: e
}
},
_masonryResizeChanged: function() {
return this._checkIfSegmentsChanged()
},
_fitRowsReset: function() {
this.fitRows = {
x: 0,
y: 0,
height: 0
}
},
_fitRowsLayout: function(e) {
var n = this,
r = this.element.width(),
i = this.fitRows;
e.each(function() {
var e = t(this),
s = e.outerWidth(!0),
o = e.outerHeight(!0);
i.x !== 0 && s + i.x > r && (i.x = 0, i.y = i.height), n._pushPosition(e, i.x, i.y), i.height = Math.max(i.y + o, i.height), i.x += s
})
},
_fitRowsGetContainerSize: function() {
return {
height: this.fitRows.height
}
},
_fitRowsResizeChanged: function() {
return !0
},
_cellsByRowReset: function() {
this.cellsByRow = {
index: 0
}, this._getSegments(), this._getSegments(!0)
},
_cellsByRowLayout: function(e) {
var n = this,
r = this.cellsByRow;
e.each(function() {
var e = t(this),
i = r.index % r.cols,
s = Math.floor(r.index / r.cols),
o = (i + .5) * r.columnWidth - e.outerWidth(!0) / 2,
u = (s + .5) * r.rowHeight - e.outerHeight(!0) / 2;
n._pushPosition(e, o, u), r.index++
})
},
_cellsByRowGetContainerSize: function() {
return {
height: Math.ceil(this.$filteredAtoms.length / this.cellsByRow.cols) * this.cellsByRow.rowHeight + this.offset.top
}
},
_cellsByRowResizeChanged: function() {
return this._checkIfSegmentsChanged()
},
_straightDownReset: function() {
this.straightDown = {
y: 0
}
},
_straightDownLayout: function(e) {
var n = this;
e.each(function(e) {
var r = t(this);
n._pushPosition(r, 0, n.straightDown.y), n.straightDown.y += r.outerHeight(!0)
})
},
_straightDownGetContainerSize: function() {
return {
height: this.straightDown.y
}
},
_straightDownResizeChanged: function() {
return !0
},
_masonryHorizontalReset: function() {
this.masonryHorizontal = {}, this._getSegments(!0);
var e = this.masonryHorizontal.rows;
this.masonryHorizontal.rowXs = [];
while (e--) this.masonryHorizontal.rowXs.push(0)
},
_masonryHorizontalLayout: function(e) {
var n = this,
r = n.masonryHorizontal;
e.each(function() {
var e = t(this),
i = Math.ceil(e.outerHeight(!0) / r.rowHeight);
i = Math.min(i, r.rows);
if (i === 1) n._masonryHorizontalPlaceBrick(e, r.rowXs);
else {
var s = r.rows + 1 - i,
o = [],
u, a;
for (a = 0;
a < s;
a++) u = r.rowXs.slice(a, a + i), o[a] = Math.max.apply(Math, u);
n._masonryHorizontalPlaceBrick(e, o)
}
})
},
_masonryHorizontalPlaceBrick: function(e, t) {
var n = Math.min.apply(Math, t),
r = 0;
for (var i = 0, s = t.length;
i < s;
i++) if (t[i] === n) {
r = i;
break
}
var o = n,
u = this.masonryHorizontal.rowHeight * r;
this._pushPosition(e, o, u);
var a = n + e.outerWidth(!0),
f = this.masonryHorizontal.rows + 1 - s;
for (i = 0;
i < f;
i++) this.masonryHorizontal.rowXs[r + i] = a
},
_masonryHorizontalGetContainerSize: function() {
var e = Math.max.apply(Math, this.masonryHorizontal.rowXs);
return {
width: e
}
},
_masonryHorizontalResizeChanged: function() {
return this._checkIfSegmentsChanged(!0)
},
_fitColumnsReset: function() {
this.fitColumns = {
x: 0,
y: 0,
width: 0
}
},
_fitColumnsLayout: function(e) {
var n = this,
r = this.element.height(),
i = this.fitColumns;
e.each(function() {
var e = t(this),
s = e.outerWidth(!0),
o = e.outerHeight(!0);
i.y !== 0 && o + i.y > r && (i.x = i.width, i.y = 0), n._pushPosition(e, i.x, i.y), i.width = Math.max(i.x + s, i.width), i.y += o
})
},
_fitColumnsGetContainerSize: function() {
return {
width: this.fitColumns.width
}
},
_fitColumnsResizeChanged: function() {
return !0
},
_cellsByColumnReset: function() {
this.cellsByColumn = {
index: 0
}, this._getSegments(), this._getSegments(!0)
},
_cellsByColumnLayout: function(e) {
var n = this,
r = this.cellsByColumn;
e.each(function() {
var e = t(this),
i = Math.floor(r.index / r.rows),
s = r.index % r.rows,
o = (i + .5) * r.columnWidth - e.outerWidth(!0) / 2,
u = (s + .5) * r.rowHeight - e.outerHeight(!0) / 2;
n._pushPosition(e, o, u), r.index++
})
},
_cellsByColumnGetContainerSize: function() {
return {
width: Math.ceil(this.$filteredAtoms.length / this.cellsByColumn.rows) * this.cellsByColumn.columnWidth
}
},
_cellsByColumnResizeChanged: function() {
return this._checkIfSegmentsChanged(!0)
},
_straightAcrossReset: function() {
this.straightAcross = {
x: 0
}
},
_straightAcrossLayout: function(e) {
var n = this;
e.each(function(e) {
var r = t(this);
n._pushPosition(r, n.straightAcross.x, 0), n.straightAcross.x += r.outerWidth(!0)
})
},
_straightAcrossGetContainerSize: function() {
return {
width: this.straightAcross.x
}
},
_straightAcrossResizeChanged: function() {
return !0
}
}, t.fn.imagesLoaded = function(e) {
function u() {
e.call(n, r)
}
function a(e) {
var n = e.target;
n.src !== s && t.inArray(n, o) === -1 && (o.push(n), --i <= 0 && (setTimeout(u), r.unbind(".imagesLoaded", a)))
}
var n = this,
r = n.find("img").add(n.filter("img")),
i = r.length,
s = "data:image/gif;
base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",
o = [];
return i || u(), r.bind("load.imagesLoaded error.imagesLoaded", a).each(function() {
var e = this.src;
this.src = s, this.src = e
}), n
};
var x = function(t) {
e.console && e.console.error(t)
};
t.fn.isotope = function(e, n) {
if (typeof e == "string") {
var r = Array.prototype.slice.call(arguments, 1);
this.each(function() {
var n = t.data(this, "isotope");
if (!n) {
x("cannot call methods on isotope prior to initialization;
attempted to call method '" + e + "'");
return
}
if (!t.isFunction(n[e]) || e.charAt(0) === "_") {
x("no such method '" + e + "' for isotope instance");
return
}
n[e].apply(n, r)
})
} else this.each(function() {
var r = t.data(this, "isotope");
r ? (r.option(e), r._init(n)) : t.data(this, "isotope", new t.Isotope(e, this, n))
});
return this
}
})(window, jQuery), define("vendor/jquery.isotope", function(e) {
return function() {
var t, n;
return t || e.$.isotope
}
}(this)), !
function(e) {
function r() {
e(t).each(function() {
i(e(this)).removeClass("open"), e(t).closest(".article-item").removeClass("article-item-zindex"), e(t).tooltip({
container: "body",
placement: "bottom"
})
})
}
function i(t) {
var n = t.attr("data-target"),
r;
n || (n = t.attr("href"), n = n && /#/.test(n) && n.replace(/.*(?=#[^\s]*$)/, "")), r = n && e(n);
if (!r || !r.length) r = t.parent();
return r
}
var t = "[data-toggle=dropdown]",
n = function(t) {
var n = e(t).on("click.dropdown.data-api", this.toggle);
e("html").on("click.dropdown.data-api", function() {
n.parent().removeClass("open")
})
};
n.prototype = {
constructor: n,
toggle: function(t) {
var n = e(this),
s, o;
if (n.is(".disabled, :disabled")) return;
return s = i(n), o = s.hasClass("open"), r(), o || (n.tooltip("destroy"), s.toggleClass("open"), s.closest(".article-item").toggleClass("article-item-zindex")), n.focus(), !1
},
keydown: function(n) {
var r, s, o, u, a, f;
if (!/(38|40|27)/.test(n.keyCode)) return;
r = e(this), n.preventDefault(), n.stopPropagation();
if (r.is(".disabled, :disabled")) return;
u = i(r), a = u.hasClass("open");
if (!a || a && n.keyCode == 27) return n.which == 27 && u.find(t).focus(), r.click();
s = e("[role=menu] li:not(.divider):visible a", u);
if (!s.length) return;
f = s.index(s.filter(":focus")), n.keyCode == 38 && f > 0 && f--, n.keyCode == 40 && f < s.length - 1 && f++, ~f || (f = 0), s.eq(f).focus()
}
};
var s = e.fn.dropdown;
e.fn.dropdown = function(t) {
return this.each(function() {
var r = e(this),
i = r.data("dropdown");
i || r.data("dropdown", i = new n(this)), typeof t == "string" && i[t].call(r)
})
}, e.fn.dropdown.Constructor = n, e.fn.dropdown.noConflict = function() {
return e.fn.dropdown = s, this
}, e(document).on("click.dropdown.data-api", r).on("click.dropdown.data-api", ".dropdown form", function(e) {
e.stopPropagation()
}).on("click.dropdown-menu", function(e) {
e.stopPropagation()
}).on("click.dropdown.data-api", t, n.prototype.toggle).on("keydown.dropdown.data-api", t + ", [role=menu]", n.prototype.keydown)
}(window.jQuery), define("vendor/jquery.dropdown", function(e) {
return function() {
var t, n;
return t || e.$.dropdown
}
}(this)), !
function(e) {
var t = function(e, t) {
this.init("tooltip", e, t)
};
t.prototype = {
constructor: t,
init: function(t, n, r) {
var i, s, o, u, a;
this.type = t, this.$element = e(n), this.options = this.getOptions(r), this.enabled = !0, o = this.options.trigger.split(" ");
for (a = o.length;
a--;) u = o[a], u == "click" ? this.$element.on("click." + this.type, this.options.selector, e.proxy(this.toggle, this)) : u != "manual" && (i = u == "hover" ? "mouseenter" : "focus", s = u == "hover" ? "mouseleave" : "blur", this.$element.on(i + "." + this.type, this.options.selector, e.proxy(this.enter, this)), this.$element.on(s + "." + this.type, this.options.selector, e.proxy(this.leave, this)));
this.options.selector ? this._options = e.extend({}, this.options, {
trigger: "manual",
selector: ""
}) : this.fixTitle()
},
getOptions: function(t) {
return t = e.extend({}, e.fn[this.type].defaults, this.$element.data(), t), t.delay && typeof t.delay == "number" && (t.delay = {
show: t.delay,
hide: 0
}), t
},
enter: function(t) {
var n = e.fn[this.type].defaults,
r = {},
i;
this._options && e.each(this._options, function(e, t) {
n[e] != t && (r[e] = t)
}, this), i = e(t.currentTarget)[this.type](r).data(this.type);
if (!i.options.delay || !i.options.delay.show) return i.show();
clearTimeout(this.timeout), i.hoverState = "in", this.timeout = setTimeout(function() {
i.hoverState == "in" && i.show()
}, i.options.delay.show)
},
leave: function(t) {
var n = e(t.currentTarget)[this.type](this._options).data(this.type);
this.timeout && clearTimeout(this.timeout);
if (!n.options.delay || !n.options.delay.hide) return n.hide();
n.hoverState = "out", this.timeout = setTimeout(function() {
n.hoverState == "out" && n.hide()
}, n.options.delay.hide)
},
show: function() {
var t, n, r, i, s, o, u = e.Event("show");
if (this.hasContent() && this.enabled) {
this.$element.trigger(u);
if (u.isDefaultPrevented()) return;
t = this.tip(), this.setContent(), this.options.animation && t.addClass("fade"), s = typeof this.options.placement == "function" ? this.options.placement.call(this, t[0], this.$element[0]) : this.options.placement, t.detach().css({
top: 0,
left: 0,
display: "block"
}), this.options.container ? t.appendTo(this.options.container) : t.insertAfter(this.$element), n = this.getPosition(), r = t[0].offsetWidth, i = t[0].offsetHeight;
switch (s) {
case "bottom":
o = {
top: n.top + n.height,
left: n.left + n.width / 2 - r / 2
};
break;
case "top":
o = {
top: n.top - i,
left: n.left + n.width / 2 - r / 2
};
break;
case "left":
o = {
top: n.top + n.height / 2 - i / 2,
left: n.left - r
};
break;
case "right":
o = {
top: n.top + n.height / 2 - i / 2,
left: n.left + n.width
}
}
this.applyPlacement(o, s), this.$element.trigger("shown")
}
},
applyPlacement: function(e, t) {
var n = this.tip(),
r = n[0].offsetWidth,
i = n[0].offsetHeight,
s, o, u, a;
n.offset(e).addClass(t).addClass("in"), s = n[0].offsetWidth, o = n[0].offsetHeight, t == "top" && o != i && (e.top = e.top + i - o, a = !0), t == "bottom" || t == "top" ? (u = 0, e.left < 0 && (u = e.left * -2, e.left = 0, n.offset(e), s = n[0].offsetWidth, o = n[0].offsetHeight), this.replaceArrow(u - r + s, s, "left")) : this.replaceArrow(o - i, o, "top"), a && n.offset(e)
},
replaceArrow: function(e, t, n) {
this.arrow().css(n, e ? 50 * (1 - e / t) + "%" : "")
},
setContent: function() {
var e = this.tip(),
t = this.getTitle();
e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t), e.removeClass("fade in top bottom left right")
},
hide: function() {
function i() {
var t = setTimeout(function() {
n.off(e.support.transition.end).detach()
}, 500);
n.one(e.support.transition.end, function() {
clearTimeout(t), n.detach()
})
}
var t = this,
n = this.tip(),
r = e.Event("hide");
this.$element.trigger(r);
if (r.isDefaultPrevented()) return;
return n.removeClass("in"), e.support.transition && this.$tip.hasClass("fade") ? i() : n.detach(), this.$element.trigger("hidden"), this
},
fixTitle: function() {
var e = this.$element;
(e.attr("title") || typeof e.attr("data-original-title") != "string") && e.attr("data-original-title", e.attr("title") || "").attr("title", "")
},
hasContent: function() {
return this.getTitle()
},
getPosition: function() {
var t = this.$element[0];
return e.extend({}, typeof t.getBoundingClientRect == "function" ? t.getBoundingClientRect() : {
width: t.offsetWidth,
height: t.offsetHeight
}, this.$element.offset())
},
getTitle: function() {
var e, t = this.$element,
n = this.options;
return e = t.attr("data-original-title") || (typeof n.title == "function" ? n.title.call(t[0]) : n.title), e
},
tip: function() {
return this.$tip = this.$tip || e(this.options.template)
},
arrow: function() {
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
},
validate: function() {
this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null)
},
enable: function() {
this.enabled = !0
},
disable: function() {
this.enabled = !1
},
toggleEnabled: function() {
this.enabled = !this.enabled
},
toggle: function(t) {
var n = t ? e(t.currentTarget)[this.type](this._options).data(this.type) : this;
n.tip().hasClass("in") ? n.hide() : n.show()
},
destroy: function() {
clearTimeout(this.timeout), this.hide().$element.off("." + this.type).removeData(this.type)
}
};
var n = e.fn.tooltip;
e.fn.tooltip = function(n) {
return this.each(function() {
var r = e(this),
i = r.data("tooltip"),
s = typeof n == "object" && n;
i || r.data("tooltip", i = new t(this, s)), typeof n == "string" && i[n]()
})
}, e.fn.tooltip.Constructor = t, e.fn.tooltip.defaults = {
animation: !0,
placement: "top",
selector: !1,
template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
trigger: "hover focus",
title: "",
delay: 500,
html: !1,
container: !1
}, e.fn.tooltip.noConflict = function() {
return e.fn.tooltip = n, this
}
}(window.jQuery), define("vendor/jquery.tipsy", function(e) {
return function() {
var t, n;
return t || e.$.tipsy
}
}(this)), function(e, t) {
function i(t, n) {
var r, i, o, u = t.nodeName.toLowerCase();
return "area" === u ? (r = t.parentNode, i = r.name, !t.href || !i || r.nodeName.toLowerCase() !== "map" ? !1 : (o = e("img[usemap=#" + i + "]")[0], !! o && s(o))) : (/input|select|textarea|button|object/.test(u) ? !t.disabled : "a" === u ? t.href || n : n) && s(t)
}
function s(t) {
return e.expr.filters.visible(t) && !e(t).parents().addBack().filter(function() {
return e.css(this, "visibility") === "hidden"
}).length
}
var n = 0,
r = /^ui-id-\d+$/;
e.ui = e.ui || {}, e.extend(e.ui, {
version: "1.10.3",
keyCode: {
BACKSPACE: 8,
COMMA: 188,
DELETE: 46,
DOWN: 40,
END: 35,
ENTER: 13,
ESCAPE: 27,
HOME: 36,
LEFT: 37,
NUMPAD_ADD: 107,
NUMPAD_DECIMAL: 110,
NUMPAD_DIVIDE: 111,
NUMPAD_ENTER: 108,
NUMPAD_MULTIPLY: 106,
NUMPAD_SUBTRACT: 109,
PAGE_DOWN: 34,
PAGE_UP: 33,
PERIOD: 190,
RIGHT: 39,
SPACE: 32,
TAB: 9,
UP: 38
}
}), e.fn.extend({
focus: function(t) {
return function(n, r) {
return typeof n == "number" ? this.each(function() {
var t = this;
setTimeout(function() {
e(t).focus(), r && r.call(t)
}, n)
}) : t.apply(this, arguments)
}
}(e.fn.focus),
scrollParent: function() {
var t;
return e.ui.ie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position")) ? t = this.parents().filter(function() {
return /(relative|absolute|fixed)/.test(e.css(this, "position")) && /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x"))
}).eq(0) : t = this.parents().filter(function() {
return /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x"))
}).eq(0), /fixed/.test(this.css("position")) || !t.length ? e(document) : t
},
zIndex: function(n) {
if (n !== t) return this.css("zIndex", n);
if (this.length) {
var r = e(this[0]),
i, s;
while (r.length && r[0] !== document) {
i = r.css("position");
if (i === "absolute" || i === "relative" || i === "fixed") {
s = parseInt(r.css("zIndex"), 10);
if (!isNaN(s) && s !== 0) return s
}
r = r.parent()
}
}
return 0
},
uniqueId: function() {
return this.each(function() {
this.id || (this.id = "ui-id-" + ++n)
})
},
removeUniqueId: function() {
return this.each(function() {
r.test(this.id) && e(this).removeAttr("id")
})
}
}), e.extend(e.expr[":"], {
data: e.expr.createPseudo ? e.expr.createPseudo(function(t) {
return function(n) {
return !!e.data(n, t)
}
}) : function(t, n, r) {
return !!e.data(t, r[3])
},
focusable: function(t) {
return i(t, !isNaN(e.attr(t, "tabindex")))
},
tabbable: function(t) {
var n = e.attr(t, "tabindex"),
r = isNaN(n);
return (r || n >= 0) && i(t, !r)
}
}), e("<a>").outerWidth(1).jquery || e.each(["Width", "Height"], function(n, r) {
function u(t, n, r, s) {
return e.each(i, function() {
n -= parseFloat(e.css(t, "padding" + this)) || 0, r && (n -= parseFloat(e.css(t, "border" + this + "Width")) || 0), s && (n -= parseFloat(e.css(t, "margin" + this)) || 0)
}), n
}
var i = r === "Width" ? ["Left", "Right"] : ["Top", "Bottom"],
s = r.toLowerCase(),
o = {
innerWidth: e.fn.innerWidth,
innerHeight: e.fn.innerHeight,
outerWidth: e.fn.outerWidth,
outerHeight: e.fn.outerHeight
};
e.fn["inner" + r] = function(n) {
return n === t ? o["inner" + r].call(this) : this.each(function() {
e(this).css(s, u(this, n) + "px")
})
}, e.fn["outer" + r] = function(t, n) {
return typeof t != "number" ? o["outer" + r].call(this, t) : this.each(function() {
e(this).css(s, u(this, t, !0, n) + "px")
})
}
}), e.fn.addBack || (e.fn.addBack = function(e) {
return this.add(e == null ? this.prevObject : this.prevObject.filter(e))
}), e("<a>").data("a-b", "a").removeData("a-b").data("a-b") && (e.fn.removeData = function(t) {
return function(n) {
return arguments.length ? t.call(this, e.camelCase(n)) : t.call(this)
}
}(e.fn.removeData)), e.ui.ie = !! /msie [\w.]+/.exec(navigator.userAgent.toLowerCase()), e.support.selectstart = "onselectstart" in document.createElement("div"), e.fn.extend({
disableSelection: function() {
return this.bind((e.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function(e) {
e.preventDefault()
})
},
enableSelection: function() {
return this.unbind(".ui-disableSelection")
}
}), e.extend(e.ui, {
plugin: {
add: function(t, n, r) {
var i, s = e.ui[t].prototype;
for (i in r) s.plugins[i] = s.plugins[i] || [], s.plugins[i].push([n, r[i]])
},
call: function(e, t, n) {
var r, i = e.plugins[t];
if (!i || !e.element[0].parentNode || e.element[0].parentNode.nodeType === 11) return;
for (r = 0;
r < i.length;
r++) e.options[i[r][0]] && i[r][1].apply(e.element, n)
}
},
hasScroll: function(t, n) {
if (e(t).css("overflow") === "hidden") return !1;
var r = n && n === "left" ? "scrollLeft" : "scrollTop",
i = !1;
return t[r] > 0 ? !0 : (t[r] = 1, i = t[r] > 0, t[r] = 0, i)
}
})
}(jQuery), function(e, t) {
var n = 0,
r = Array.prototype.slice,
i = e.cleanData;
e.cleanData = function(t) {
for (var n = 0, r;
(r = t[n]) != null;
n++) try {
e(r).triggerHandler("remove")
} catch (s) {}
i(t)
}, e.widget = function(t, n, r) {
var i, s, o, u, a = {},
f = t.split(".")[0];
t = t.split(".")[1], i = f + "-" + t, r || (r = n, n = e.Widget), e.expr[":"][i.toLowerCase()] = function(t) {
return !!e.data(t, i)
}, e[f] = e[f] || {}, s = e[f][t], o = e[f][t] = function(e, t) {
if (!this._createWidget) return new o(e, t);
arguments.length && this._createWidget(e, t)
}, e.extend(o, s, {
version: r.version,
_proto: e.extend({}, r),
_childConstructors: []
}), u = new n, u.options = e.widget.extend({}, u.options), e.each(r, function(t, r) {
if (!e.isFunction(r)) {
a[t] = r;
return
}
a[t] = function() {
var e = function() {
return n.prototype[t].apply(this, arguments)
},
i = function(e) {
return n.prototype[t].apply(this, e)
};
return function() {
var t = this._super,
n = this._superApply,
s;
return this._super = e, this._superApply = i, s = r.apply(this, arguments), this._super = t, this._superApply = n, s
}
}()
}), o.prototype = e.widget.extend(u, {
widgetEventPrefix: s ? u.widgetEventPrefix : t
}, a, {
constructor: o,
namespace: f,
widgetName: t,
widgetFullName: i
}), s ? (e.each(s._childConstructors, function(t, n) {
var r = n.prototype;
e.widget(r.namespace + "." + r.widgetName, o, n._proto)
}), delete s._childConstructors) : n._childConstructors.push(o), e.widget.bridge(t, o)
}, e.widget.extend = function(n) {
var i = r.call(arguments, 1),
s = 0,
o = i.length,
u, a;
for (;
s < o;
s++) for (u in i[s]) a = i[s][u], i[s].hasOwnProperty(u) && a !== t && (e.isPlainObject(a) ? n[u] = e.isPlainObject(n[u]) ? e.widget.extend({}, n[u], a) : e.widget.extend({}, a) : n[u] = a);
return n
}, e.widget.bridge = function(n, i) {
var s = i.prototype.widgetFullName || n;
e.fn[n] = function(o) {
var u = typeof o == "string",
a = r.call(arguments, 1),
f = this;
return o = !u && a.length ? e.widget.extend.apply(null, [o].concat(a)) : o, u ? this.each(function() {
var r, i = e.data(this, s);
if (!i) return e.error("cannot call methods on " + n + " prior to initialization;
" + "attempted to call method '" + o + "'");
if (!e.isFunction(i[o]) || o.charAt(0) === "_") return e.error("no such method '" + o + "' for " + n + " widget instance");
r = i[o].apply(i, a);
if (r !== i && r !== t) return f = r && r.jquery ? f.pushStack(r.get()) : r, !1
}) : this.each(function() {
var t = e.data(this, s);
t ? t.option(o || {})._init() : e.data(this, s, new i(o, this))
}), f
}
}, e.Widget = function() {}, e.Widget._childConstructors = [], e.Widget.prototype = {
widgetName: "widget",
widgetEventPrefix: "",
defaultElement: "<div>",
options: {
disabled: !1,
create: null
},
_createWidget: function(t, r) {
r = e(r || this.defaultElement || this)[0], this.element = e(r), this.uuid = n++, this.eventNamespace = "." + this.widgetName + this.uuid, this.options = e.widget.extend({}, this.options, this._getCreateOptions(), t), this.bindings = e(), this.hoverable = e(), this.focusable = e(), r !== this && (e.data(r, this.widgetFullName, this), this._on(!0, this.element, {
remove: function(e) {
e.target === r && this.destroy()
}
}), this.document = e(r.style ? r.ownerDocument : r.document || r), this.window = e(this.document[0].defaultView || this.document[0].parentWindow)), this._create(), this._trigger("create", null, this._getCreateEventData()), this._init()
},
_getCreateOptions: e.noop,
_getCreateEventData: e.noop,
_create: e.noop,
_init: e.noop,
destroy: function() {
this._destroy(), this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)), this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName + "-disabled " + "ui-state-disabled"), this.bindings.unbind(this.eventNamespace), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus")
},
_destroy: e.noop,
widget: function() {
return this.element
},
option: function(n, r) {
var i = n,
s, o, u;
if (arguments.length === 0) return e.widget.extend({}, this.options);
if (typeof n == "string") {
i = {}, s = n.split("."), n = s.shift();
if (s.length) {
o = i[n] = e.widget.extend({}, this.options[n]);
for (u = 0;
u < s.length - 1;
u++) o[s[u]] = o[s[u]] || {}, o = o[s[u]];
n = s.pop();
if (r === t) return o[n] === t ? null : o[n];
o[n] = r
} else {
if (r === t) return this.options[n] === t ? null : this.options[n];
i[n] = r
}
}
return this._setOptions(i), this
},
_setOptions: function(e) {
var t;
for (t in e) this._setOption(t, e[t]);
return this
},
_setOption: function(e, t) {
return this.options[e] = t, e === "disabled" && (this.widget().toggleClass(this.widgetFullName + "-disabled ui-state-disabled", !! t).attr("aria-disabled", t), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus")), this
},
enable: function() {
return this._setOption("disabled", !1)
},
disable: function() {
return this._setOption("disabled", !0)
},
_on: function(t, n, r) {
var i, s = this;
typeof t != "boolean" && (r = n, n = t, t = !1), r ? (n = i = e(n), this.bindings = this.bindings.add(n)) : (r = n, n = this.element, i = this.widget()), e.each(r, function(r, o) {
function u() {
if (!t && (s.options.disabled === !0 || e(this).hasClass("ui-state-disabled"))) return;
return (typeof o == "string" ? s[o] : o).apply(s, arguments)
}
typeof o != "string" && (u.guid = o.guid = o.guid || u.guid || e.guid++);
var a = r.match(/^(\w+)\s*(.*)$/),
f = a[1] + s.eventNamespace,
l = a[2];
l ? i.delegate(l, f, u) : n.bind(f, u)
})
},
_off: function(e, t) {
t = (t || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace, e.unbind(t).undelegate(t)
},
_delay: function(e, t) {
function n() {
return (typeof e == "string" ? r[e] : e).apply(r, arguments)
}
var r = this;
return setTimeout(n, t || 0)
},
_hoverable: function(t) {
this.hoverable = this.hoverable.add(t), this._on(t, {
mouseenter: function(t) {
e(t.currentTarget).addClass("ui-state-hover")
},
mouseleave: function(t) {
e(t.currentTarget).removeClass("ui-state-hover")
}
})
},
_focusable: function(t) {
this.focusable = this.focusable.add(t), this._on(t, {
focusin: function(t) {
e(t.currentTarget).addClass("ui-state-focus")
},
focusout: function(t) {
e(t.currentTarget).removeClass("ui-state-focus")
}
})
},
_trigger: function(t, n, r) {
var i, s, o = this.options[t];
r = r || {}, n = e.Event(n), n.type = (t === this.widgetEventPrefix ? t : this.widgetEventPrefix + t).toLowerCase(), n.target = this.element[0], s = n.originalEvent;
if (s) for (i in s) i in n || (n[i] = s[i]);
return this.element.trigger(n, r), !(e.isFunction(o) && o.apply(this.element[0], [n].concat(r)) === !1 || n.isDefaultPrevented())
}
}, e.each({
show: "fadeIn",
hide: "fadeOut"
}, function(t, n) {
e.Widget.prototype["_" + t] = function(r, i, s) {
typeof i == "string" && (i = {
effect: i
});
var o, u = i ? i === !0 || typeof i == "number" ? n : i.effect || n : t;
i = i || {}, typeof i == "number" && (i = {
duration: i
}), o = !e.isEmptyObject(i), i.complete = s, i.delay && r.delay(i.delay), o && e.effects && e.effects.effect[u] ? r[t](i) : u !== t && r[u] ? r[u](i.duration, i.easing, s) : r.queue(function(n) {
e(this)[t](), s && s.call(r[0]), n()
})
}
})
}(jQuery), function(e, t) {
var n = !1;
e(document).mouseup(function() {
n = !1
}), e.widget("ui.mouse", {
version: "1.10.3",
options: {
cancel: "input,textarea,button,select,option",
distance: 1,
delay: 0
},
_mouseInit: function() {
var t = this;
this.element.bind("mousedown." + this.widgetName, function(e) {
return t._mouseDown(e)
}).bind("click." + this.widgetName, function(n) {
if (!0 === e.data(n.target, t.widgetName + ".preventClickEvent")) return e.removeData(n.target, t.widgetName + ".preventClickEvent"), n.stopImmediatePropagation(), !1
}), this.started = !1
},
_mouseDestroy: function() {
this.element.unbind("." + this.widgetName), this._mouseMoveDelegate && e(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate)
},
_mouseDown: function(t) {
if (n) return;
this._mouseStarted && this._mouseUp(t), this._mouseDownEvent = t;
var r = this,
i = t.which === 1,
s = typeof this.options.cancel == "string" && t.target.nodeName ? e(t.target).closest(this.options.cancel).length : !1;
if (!i || s || !this._mouseCapture(t)) return !0;
this.mouseDelayMet = !this.options.delay, this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function() {
r.mouseDelayMet = !0
}, this.options.delay));
if (this._mouseDistanceMet(t) && this._mouseDelayMet(t)) {
this._mouseStarted = this._mouseStart(t) !== !1;
if (!this._mouseStarted) return t.preventDefault(), !0
}
return !0 === e.data(t.target, this.widgetName + ".preventClickEvent") && e.removeData(t.target, this.widgetName + ".preventClickEvent"), this._mouseMoveDelegate = function(e) {
return r._mouseMove(e)
}, this._mouseUpDelegate = function(e) {
return r._mouseUp(e)
}, e(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate), t.preventDefault(), n = !0, !0
},
_mouseMove: function(t) {
return e.ui.ie && (!document.documentMode || document.documentMode < 9) && !t.button ? this._mouseUp(t) : this._mouseStarted ? (this._mouseDrag(t), t.preventDefault()) : (this._mouseDistanceMet(t) && this._mouseDelayMet(t) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, t) !== !1, this._mouseStarted ? this._mouseDrag(t) : this._mouseUp(t)), !this._mouseStarted)
},
_mouseUp: function(t) {
return e(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate), this._mouseStarted && (this._mouseStarted = !1, t.target === this._mouseDownEvent.target && e.data(t.target, this.widgetName + ".preventClickEvent", !0), this._mouseStop(t)), !1
},
_mouseDistanceMet: function(e) {
return Math.max(Math.abs(this._mouseDownEvent.pageX - e.pageX), Math.abs(this._mouseDownEvent.pageY - e.pageY)) >= this.options.distance
},
_mouseDelayMet: function() {
return this.mouseDelayMet
},
_mouseStart: function() {},
_mouseDrag: function() {},
_mouseStop: function() {},
_mouseCapture: function() {
return !0
}
})
}(jQuery), function(e, t) {
function n(e, t, n) {
return e > t && e < t + n
}
function r(e) {
return /left|right/.test(e.css("float")) || /inline|table-cell/.test(e.css("display"))
}
e.widget("ui.sortable", e.ui.mouse, {
version: "1.10.3",
widgetEventPrefix: "sort",
ready: !1,
options: {
appendTo: "parent",
axis: !1,
connectWith: !1,
containment: !1,
cursor: "auto",
cursorAt: !1,
dropOnEmpty: !0,
forcePlaceholderSize: !1,
forceHelperSize: !1,
grid: !1,
handle: !1,
helper: "original",
items: "> *",
opacity: !1,
placeholder: !1,
revert: !1,
scroll: !0,
scrollSensitivity: 20,
scrollSpeed: 20,
scope: "default",
tolerance: "intersect",
zIndex: 1e3,
activate: null,
beforeStop: null,
change: null,
deactivate: null,
out: null,
over: null,
receive: null,
remove: null,
sort: null,
start: null,
stop: null,
update: null
},
_create: function() {
var e = this.options;
this.containerCache = {}, this.element.addClass("ui-sortable"), this.refresh(), this.floating = this.items.length ? e.axis === "x" || r(this.items[0].item) : !1, this.offset = this.element.offset(), this._mouseInit(), this.ready = !0
},
_destroy: function() {
this.element.removeClass("ui-sortable ui-sortable-disabled"), this._mouseDestroy();
for (var e = this.items.length - 1;
e >= 0;
e--) this.items[e].item.removeData(this.widgetName + "-item");
return this
},
_setOption: function(t, n) {
t === "disabled" ? (this.options[t] = n, this.widget().toggleClass("ui-sortable-disabled", !! n)) : e.Widget.prototype._setOption.apply(this, arguments)
},
_mouseCapture: function(t, n) {
var r = null,
i = !1,
s = this;
if (this.reverting) return !1;
if (this.options.disabled || this.options.type === "static") return !1;
this._refreshItems(t), e(t.target).parents().each(function() {
if (e.data(this, s.widgetName + "-item") === s) return r = e(this), !1
}), e.data(t.target, s.widgetName + "-item") === s && (r = e(t.target));
if (!r) return !1;
if (this.options.handle && !n) {
e(this.options.handle, r).find("*").addBack().each(function() {
this === t.target && (i = !0)
});
if (!i) return !1
}
return this.currentItem = r, this._removeCurrentsFromItems(), !0
},
_mouseStart: function(t, n, r) {
var i, s, o = this.options;
this.currentContainer = this, this.refreshPositions(), this.helper = this._createHelper(t), this._cacheHelperProportions(), this._cacheMargins(), this.scrollParent = this.helper.scrollParent(), this.offset = this.currentItem.offset(), this.offset = {
top: this.offset.top - this.margins.top,
left: this.offset.left - this.margins.left
}, e.extend(this.offset, {
click: {
left: t.pageX - this.offset.left,
top: t.pageY - this.offset.top
},
parent: this._getParentOffset(),
relative: this._getRelativeOffset()
}), this.helper.css("position", "absolute"), this.cssPosition = this.helper.css("position"), this.originalPosition = this._generatePosition(t), this.originalPageX = t.pageX, this.originalPageY = t.pageY, o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt), this.domPosition = {
prev: this.currentItem.prev()[0],
parent: this.currentItem.parent()[0]
}, this.helper[0] !== this.currentItem[0] && this.currentItem.hide(), this._createPlaceholder(), o.containment && this._setContainment(), o.cursor && o.cursor !== "auto" && (s = this.document.find("body"), this.storedCursor = s.css("cursor"), s.css("cursor", o.cursor), this.storedStylesheet = e("<style>*{ cursor: " + o.cursor + " !important;
}</style>").appendTo(s)), o.opacity && (this.helper.css("opacity") && (this._storedOpacity = this.helper.css("opacity")), this.helper.css("opacity", o.opacity)), o.zIndex && (this.helper.css("zIndex") && (this._storedZIndex = this.helper.css("zIndex")), this.helper.css("zIndex", o.zIndex)), this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML" && (this.overflowOffset = this.scrollParent.offset()), this._trigger("start", t, this._uiHash()), this._preserveHelperProportions || this._cacheHelperProportions();
if (!r) for (i = this.containers.length - 1;
i >= 0;
i--) this.containers[i]._trigger("activate", t, this._uiHash(this));
return e.ui.ddmanager && (e.ui.ddmanager.current = this), e.ui.ddmanager && !o.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t), this.dragging = !0, this.helper.addClass("ui-sortable-helper"), this._mouseDrag(t), !0
},
_mouseDrag: function(t) {
var n, r, i, s, o = this.options,
u = !1;
this.position = this._generatePosition(t), this.positionAbs = this._convertPositionTo("absolute"), this.lastPositionAbs || (this.lastPositionAbs = this.positionAbs), this.options.scroll && (this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML" ? (this.overflowOffset.top + this.scrollParent[0].offsetHeight - t.pageY < o.scrollSensitivity ? this.scrollParent[0].scrollTop = u = this.scrollParent[0].scrollTop + o.scrollSpeed : t.pageY - this.overflowOffset.top < o.scrollSensitivity && (this.scrollParent[0].scrollTop = u = this.scrollParent[0].scrollTop - o.scrollSpeed), this.overflowOffset.left + this.scrollParent[0].offsetWidth - t.pageX < o.scrollSensitivity ? this.scrollParent[0].scrollLeft = u = this.scrollParent[0].scrollLeft + o.scrollSpeed : t.pageX - this.overflowOffset.left < o.scrollSensitivity && (this.scrollParent[0].scrollLeft = u = this.scrollParent[0].scrollLeft - o.scrollSpeed)) : (t.pageY - e(document).scrollTop() < o.scrollSensitivity ? u = e(document).scrollTop(e(document).scrollTop() - o.scrollSpeed) : e(window).height() - (t.pageY - e(document).scrollTop()) < o.scrollSensitivity && (u = e(document).scrollTop(e(document).scrollTop() + o.scrollSpeed)), t.pageX - e(document).scrollLeft() < o.scrollSensitivity ? u = e(document).scrollLeft(e(document).scrollLeft() - o.scrollSpeed) : e(window).width() - (t.pageX - e(document).scrollLeft()) < o.scrollSensitivity && (u = e(document).scrollLeft(e(document).scrollLeft() + o.scrollSpeed))), u !== !1 && e.ui.ddmanager && !o.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t)), this.positionAbs = this._convertPositionTo("absolute");
if (!this.options.axis || this.options.axis !== "y") this.helper[0].style.left = this.position.left + "px";
if (!this.options.axis || this.options.axis !== "x") this.helper[0].style.top = this.position.top + "px";
for (n = this.items.length - 1;
n >= 0;
n--) {
r = this.items[n], i = r.item[0], s = this._intersectsWithPointer(r);
if (!s) continue;
if (r.instance !== this.currentContainer) continue;
if (i !== this.currentItem[0] && this.placeholder[s === 1 ? "next" : "prev"]()[0] !== i && !e.contains(this.placeholder[0], i) && (this.options.type === "semi-dynamic" ? !e.contains(this.element[0], i) : !0)) {
this.direction = s === 1 ? "down" : "up";
if (this.options.tolerance !== "pointer" && !this._intersectsWithSides(r)) break;
this._rearrange(t, r), this._trigger("change", t, this._uiHash());
break
}
}
return this._contactContainers(t), e.ui.ddmanager && e.ui.ddmanager.drag(this, t), this._trigger("sort", t, this._uiHash()), this.lastPositionAbs = this.positionAbs, !1
},
_mouseStop: function(t, n) {
if (!t) return;
e.ui.ddmanager && !this.options.dropBehaviour && e.ui.ddmanager.drop(this, t);
if (this.options.revert) {
var r = this,
i = this.placeholder.offset(),
s = this.options.axis,
o = {};
if (!s || s === "x") o.left = i.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft);
if (!s || s === "y") o.top = i.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop);
this.reverting = !0, e(this.helper).animate(o, parseInt(this.options.revert, 10) || 500, function() {
r._clear(t)
})
} else this._clear(t, n);
return !1
},
cancel: function() {
if (this.dragging) {
this._mouseUp({
target: null
}), this.options.helper === "original" ? this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") : this.currentItem.show();
for (var t = this.containers.length - 1;
t >= 0;
t--) this.containers[t]._trigger("deactivate", null, this._uiHash(this)), this.containers[t].containerCache.over && (this.containers[t]._trigger("out", null, this._uiHash(this)), this.containers[t].containerCache.over = 0)
}
return this.placeholder && (this.placeholder[0].parentNode && this.placeholder[0].parentNode.removeChild(this.placeholder[0]), this.options.helper !== "original" && this.helper && this.helper[0].parentNode && this.helper.remove(), e.extend(this, {
helper: null,
dragging: !1,
reverting: !1,
_noFinalSort: null
}), this.domPosition.prev ? e(this.domPosition.prev).after(this.currentItem) : e(this.domPosition.parent).prepend(this.currentItem)), this
},
serialize: function(t) {
var n = this._getItemsAsjQuery(t && t.connected),
r = [];
return t = t || {}, e(n).each(function() {
var n = (e(t.item || this).attr(t.attribute || "id") || "").match(t.expression || /(.+)[\-=_](.+)/);
n && r.push((t.key || n[1] + "[]") + "=" + (t.key && t.expression ? n[1] : n[2]))
}), !r.length && t.key && r.push(t.key + "="), r.join("&")
},
toArray: function(t) {
var n = this._getItemsAsjQuery(t && t.connected),
r = [];
return t = t || {}, n.each(function() {
r.push(e(t.item || this).attr(t.attribute || "id") || "")
}), r
},
_intersectsWith: function(e) {
var t = this.positionAbs.left,
n = t + this.helperProportions.width,
r = this.positionAbs.top,
i = r + this.helperProportions.height,
s = e.left,
o = s + e.width,
u = e.top,
a = u + e.height,
f = this.offset.click.top,
l = this.offset.click.left,
c = this.options.axis === "x" || r + f > u && r + f < a,
h = this.options.axis === "y" || t + l > s && t + l < o,
p = c && h;
return this.options.tolerance === "pointer" || this.options.forcePointerForContainers || this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > e[this.floating ? "width" : "height"] ? p : s < t + this.helperProportions.width / 2 && n - this.helperProportions.width / 2 < o && u < r + this.helperProportions.height / 2 && i - this.helperProportions.height / 2 < a
},
_intersectsWithPointer: function(e) {
var t = this.options.axis === "x" || n(this.positionAbs.top + this.offset.click.top, e.top, e.height),
r = this.options.axis === "y" || n(this.positionAbs.left + this.offset.click.left, e.left, e.width),
i = t && r,
s = this._getDragVerticalDirection(),
o = this._getDragHorizontalDirection();
return i ? this.floating ? o && o === "right" || s === "down" ? 2 : 1 : s && (s === "down" ? 2 : 1) : !1
},
_intersectsWithSides: function(e) {
var t = n(this.positionAbs.top + this.offset.click.top, e.top + e.height / 2, e.height),
r = n(this.positionAbs.left + this.offset.click.left, e.left + e.width / 2, e.width),
i = this._getDragVerticalDirection(),
s = this._getDragHorizontalDirection();
return this.floating && s ? s === "right" && r || s === "left" && !r : i && (i === "down" && t || i === "up" && !t)
},
_getDragVerticalDirection: function() {
var e = this.positionAbs.top - this.lastPositionAbs.top;
return e !== 0 && (e > 0 ? "down" : "up")
},
_getDragHorizontalDirection: function() {
var e = this.positionAbs.left - this.lastPositionAbs.left;
return e !== 0 && (e > 0 ? "right" : "left")
},
refresh: function(e) {
return this._refreshItems(e), this.refreshPositions(), this
},
_connectWith: function() {
var e = this.options;
return e.connectWith.constructor === String ? [e.connectWith] : e.connectWith
},
_getItemsAsjQuery: function(t) {
var n, r, i, s, o = [],
u = [],
a = this._connectWith();
if (a && t) for (n = a.length - 1;
n >= 0;
n--) {
i = e(a[n]);
for (r = i.length - 1;
r >= 0;
r--) s = e.data(i[r], this.widgetFullName), s && s !== this && !s.options.disabled && u.push([e.isFunction(s.options.items) ? s.options.items.call(s.element) : e(s.options.items, s.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), s])
}
u.push([e.isFunction(this.options.items) ? this.options.items.call(this.element, null, {
options: this.options,
item: this.currentItem
}) : e(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
for (n = u.length - 1;
n >= 0;
n--) u[n][0].each(function() {
o.push(this)
});
return e(o)
},
_removeCurrentsFromItems: function() {
var t = this.currentItem.find(":data(" + this.widgetName + "-item)");
this.items = e.grep(this.items, function(e) {
for (var n = 0;
n < t.length;
n++) if (t[n] === e.item[0]) return !1;
return !0
})
},
_refreshItems: function(t) {
this.items = [], this.containers = [this];
var n, r, i, s, o, u, a, f, l = this.items,
c = [
[e.isFunction(this.options.items) ? this.options.items.call(this.element[0], t, {
item: this.currentItem
}) : e(this.options.items, this.element), this]
],
h = this._connectWith();
if (h && this.ready) for (n = h.length - 1;
n >= 0;
n--) {
i = e(h[n]);
for (r = i.length - 1;
r >= 0;
r--) s = e.data(i[r], this.widgetFullName), s && s !== this && !s.options.disabled && (c.push([e.isFunction(s.options.items) ? s.options.items.call(s.element[0], t, {
item: this.currentItem
}) : e(s.options.items, s.element), s]), this.containers.push(s))
}
for (n = c.length - 1;
n >= 0;
n--) {
o = c[n][1], u = c[n][0];
for (r = 0, f = u.length;
r < f;
r++) a = e(u[r]), a.data(this.widgetName + "-item", o), l.push({
item: a,
instance: o,
width: 0,
height: 0,
left: 0,
top: 0
})
}
},
refreshPositions: function(t) {
this.offsetParent && this.helper && (this.offset.parent = this._getParentOffset());
var n, r, i, s;
for (n = this.items.length - 1;
n >= 0;
n--) {
r = this.items[n];
if (r.instance !== this.currentContainer && this.currentContainer && r.item[0] !== this.currentItem[0]) continue;
i = this.options.toleranceElement ? e(this.options.toleranceElement, r.item) : r.item, t || (r.width = i.outerWidth(), r.height = i.outerHeight()), s = i.offset(), r.left = s.left, r.top = s.top
}
if (this.options.custom && this.options.custom.refreshContainers) this.options.custom.refreshContainers.call(this);
else for (n = this.containers.length - 1;
n >= 0;
n--) s = this.containers[n].element.offset(), this.containers[n].containerCache.left = s.left, this.containers[n].containerCache.top = s.top, this.containers[n].containerCache.width = this.containers[n].element.outerWidth(), this.containers[n].containerCache.height = this.containers[n].element.outerHeight();
return this
},
_createPlaceholder: function(t) {
t = t || this;
var n, r = t.options;
if (!r.placeholder || r.placeholder.constructor === String) n = r.placeholder, r.placeholder = {
element: function() {
var r = t.currentItem[0].nodeName.toLowerCase(),
i = e("<" + r + ">", t.document[0]).addClass(n || t.currentItem[0].className + " ui-sortable-placeholder").removeClass("ui-sortable-helper");
return r === "tr" ? t.currentItem.children().each(function() {
e("<td>&#160;
</td>", t.document[0]).attr("colspan", e(this).attr("colspan") || 1).appendTo(i)
}) : r === "img" && i.attr("src", t.currentItem.attr("src")), n || i.css("visibility", "hidden"), i
},
update: function(e, i) {
if (n && !r.forcePlaceholderSize) return;
i.height() || i.height(t.currentItem.innerHeight() - parseInt(t.currentItem.css("paddingTop") || 0, 10) - parseInt(t.currentItem.css("paddingBottom") || 0, 10)), i.width() || i.width(t.currentItem.innerWidth() - parseInt(t.currentItem.css("paddingLeft") || 0, 10) - parseInt(t.currentItem.css("paddingRight") || 0, 10))
}
};
t.placeholder = e(r.placeholder.element.call(t.element, t.currentItem)), t.currentItem.after(t.placeholder), r.placeholder.update(t, t.placeholder)
},
_contactContainers: function(t) {
var i, s, o, u, a, f, l, c, h, p, d = null,
v = null;
for (i = this.containers.length - 1;
i >= 0;
i--) {
if (e.contains(this.currentItem[0], this.containers[i].element[0])) continue;
if (this._intersectsWith(this.containers[i].containerCache)) {
if (d && e.contains(this.containers[i].element[0], d.element[0])) continue;
d = this.containers[i], v = i
} else this.containers[i].containerCache.over && (this.containers[i]._trigger("out", t, this._uiHash(this)), this.containers[i].containerCache.over = 0)
}
if (!d) return;
if (this.containers.length === 1) this.containers[v].containerCache.over || (this.containers[v]._trigger("over", t, this._uiHash(this)), this.containers[v].containerCache.over = 1);
else {
o = 1e4, u = null, p = d.floating || r(this.currentItem), a = p ? "left" : "top", f = p ? "width" : "height", l = this.positionAbs[a] + this.offset.click[a];
for (s = this.items.length - 1;
s >= 0;
s--) {
if (!e.contains(this.containers[v].element[0], this.items[s].item[0])) continue;
if (this.items[s].item[0] === this.currentItem[0]) continue;
if (p && !n(this.positionAbs.top + this.offset.click.top, this.items[s].top, this.items[s].height)) continue;
c = this.items[s].item.offset()[a], h = !1, Math.abs(c - l) > Math.abs(c + this.items[s][f] - l) && (h = !0, c += this.items[s][f]), Math.abs(c - l) < o && (o = Math.abs(c - l), u = this.items[s], this.direction = h ? "up" : "down")
}
if (!u && !this.options.dropOnEmpty) return;
if (this.currentContainer === this.containers[v]) return;
u ? this._rearrange(t, u, null, !0) : this._rearrange(t, null, this.containers[v].element, !0), this._trigger("change", t, this._uiHash()), this.containers[v]._trigger("change", t, this._uiHash(this)), this.currentContainer = this.containers[v], this.options.placeholder.update(this.currentContainer, this.placeholder), this.containers[v]._trigger("over", t, this._uiHash(this)), this.containers[v].containerCache.over = 1
}
},
_createHelper: function(t) {
var n = this.options,
r = e.isFunction(n.helper) ? e(n.helper.apply(this.element[0], [t, this.currentItem])) : n.helper === "clone" ? this.currentItem.clone() : this.currentItem;
return r.parents("body").length || e(n.appendTo !== "parent" ? n.appendTo : this.currentItem[0].parentNode)[0].appendChild(r[0]), r[0] === this.currentItem[0] && (this._storedCSS = {
width: this.currentItem[0].style.width,
height: this.currentItem[0].style.height,
position: this.currentItem.css("position"),
top: this.currentItem.css("top"),
left: this.currentItem.css("left")
}), (!r[0].style.width || n.forceHelperSize) && r.width(this.currentItem.width()), (!r[0].style.height || n.forceHelperSize) && r.height(this.currentItem.height()), r
},
_adjustOffsetFromHelper: function(t) {
typeof t == "string" && (t = t.split(" ")), e.isArray(t) && (t = {
left: +t[0],
top: +t[1] || 0
}), "left" in t && (this.offset.click.left = t.left + this.margins.left), "right" in t && (this.offset.click.left = this.helperProportions.width - t.right + this.margins.left), "top" in t && (this.offset.click.top = t.top + this.margins.top), "bottom" in t && (this.offset.click.top = this.helperProportions.height - t.bottom + this.margins.top)
},
_getParentOffset: function() {
this.offsetParent = this.helper.offsetParent();
var t = this.offsetParent.offset();
this.cssPosition === "absolute" && this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) && (t.left += this.scrollParent.scrollLeft(), t.top += this.scrollParent.scrollTop());
if (this.offsetParent[0] === document.body || this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && e.ui.ie) t = {
top: 0,
left: 0
};
return {
top: t.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
left: t.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
}
},
_getRelativeOffset: function() {
if (this.cssPosition === "relative") {
var e = this.currentItem.position();
return {
top: e.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(),
left: e.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()
}
}
return {
top: 0,
left: 0
}
},
_cacheMargins: function() {
this.margins = {
left: parseInt(this.currentItem.css("marginLeft"), 10) || 0,
top: parseInt(this.currentItem.css("marginTop"), 10) || 0
}
},
_cacheHelperProportions: function() {
this.helperProportions = {
width: this.helper.outerWidth(),
height: this.helper.outerHeight()
}
},
_setContainment: function() {
var t, n, r, i = this.options;
i.containment === "parent" && (i.containment = this.helper[0].parentNode);
if (i.containment === "document" || i.containment === "window") this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, e(i.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left, (e(i.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];
/^(document|window|parent)$/.test(i.containment) || (t = e(i.containment)[0], n = e(i.containment).offset(), r = e(t).css("overflow") !== "hidden", this.containment = [n.left + (parseInt(e(t).css("borderLeftWidth"), 10) || 0) + (parseInt(e(t).css("paddingLeft"), 10) || 0) - this.margins.left, n.top + (parseInt(e(t).css("borderTopWidth"), 10) || 0) + (parseInt(e(t).css("paddingTop"), 10) || 0) - this.margins.top, n.left + (r ? Math.max(t.scrollWidth, t.offsetWidth) : t.offsetWidth) - (parseInt(e(t).css("borderLeftWidth"), 10) || 0) - (parseInt(e(t).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, n.top + (r ? Math.max(t.scrollHeight, t.offsetHeight) : t.offsetHeight) - (parseInt(e(t).css("borderTopWidth"), 10) || 0) - (parseInt(e(t).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top])
},
_convertPositionTo: function(t, n) {
n || (n = this.position);
var r = t === "absolute" ? 1 : -1,
i = this.cssPosition !== "absolute" || this.scrollParent[0] !== document && !! e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent,
s = /(html|body)/i.test(i[0].tagName);
return {
top: n.top + this.offset.relative.top * r + this.offset.parent.top * r - (this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : s ? 0 : i.scrollTop()) * r,
left: n.left + this.offset.relative.left * r + this.offset.parent.left * r - (this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : s ? 0 : i.scrollLeft()) * r
}
},
_generatePosition: function(t) {
var n, r, i = this.options,
s = t.pageX,
o = t.pageY,
u = this.cssPosition !== "absolute" || this.scrollParent[0] !== document && !! e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent,
a = /(html|body)/i.test(u[0].tagName);
return this.cssPosition === "relative" && (this.scrollParent[0] === document || this.scrollParent[0] === this.offsetParent[0]) && (this.offset.relative = this._getRelativeOffset()), this.originalPosition && (this.containment && (t.pageX - this.offset.click.left < this.containment[0] && (s = this.containment[0] + this.offset.click.left), t.pageY - this.offset.click.top < this.containment[1] && (o = this.containment[1] + this.offset.click.top), t.pageX - this.offset.click.left > this.containment[2] && (s = this.containment[2] + this.offset.click.left), t.pageY - this.offset.click.top > this.containment[3] && (o = this.containment[3] + this.offset.click.top)), i.grid && (n = this.originalPageY + Math.round((o - this.originalPageY) / i.grid[1]) * i.grid[1], o = this.containment ? n - this.offset.click.top >= this.containment[1] && n - this.offset.click.top <= this.containment[3] ? n : n - this.offset.click.top >= this.containment[1] ? n - i.grid[1] : n + i.grid[1] : n, r = this.originalPageX + Math.round((s - this.originalPageX) / i.grid[0]) * i.grid[0], s = this.containment ? r - this.offset.click.left >= this.containment[0] && r - this.offset.click.left <= this.containment[2] ? r : r - this.offset.click.left >= this.containment[0] ? r - i.grid[0] : r + i.grid[0] : r)), {
top: o - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : a ? 0 : u.scrollTop()),
left: s - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : a ? 0 : u.scrollLeft())
}
},
_rearrange: function(e, t, n, r) {
n ? n[0].appendChild(this.placeholder[0]) : t.item[0].parentNode.insertBefore(this.placeholder[0], this.direction === "down" ? t.item[0] : t.item[0].nextSibling), this.counter = this.counter ? ++this.counter : 1;
var i = this.counter;
this._delay(function() {
i === this.counter && this.refreshPositions(!r)
})
},
_clear: function(e, t) {
this.reverting = !1;
var n, r = [];
!this._noFinalSort && this.currentItem.parent().length && this.placeholder.before(this.currentItem), this._noFinalSort = null;
if (this.helper[0] === this.currentItem[0]) {
for (n in this._storedCSS) if (this._storedCSS[n] === "auto" || this._storedCSS[n] === "static") this._storedCSS[n] = "";
this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")
} else this.currentItem.show();
this.fromOutside && !t && r.push(function(e) {
this._trigger("receive", e, this._uiHash(this.fromOutside))
}), (this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !t && r.push(function(e) {
this._trigger("update", e, this._uiHash())
}), this !== this.currentContainer && (t || (r.push(function(e) {
this._trigger("remove", e, this._uiHash())
}), r.push(function(e) {
return function(t) {
e._trigger("receive", t, this._uiHash(this))
}
}.call(this, this.currentContainer)), r.push(function(e) {
return function(t) {
e._trigger("update", t, this._uiHash(this))
}
}.call(this, this.currentContainer))));
for (n = this.containers.length - 1;
n >= 0;
n--) t || r.push(function(e) {
return function(t) {
e._trigger("deactivate", t, this._uiHash(this))
}
}.call(this, this.containers[n])), this.containers[n].containerCache.over && (r.push(function(e) {
return function(t) {
e._trigger("out", t, this._uiHash(this))
}
}.call(this, this.containers[n])), this.containers[n].containerCache.over = 0);
this.storedCursor && (this.document.find("body").css("cursor", this.storedCursor), this.storedStylesheet.remove()), this._storedOpacity && this.helper.css("opacity", this._storedOpacity), this._storedZIndex && this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex), this.dragging = !1;
if (this.cancelHelperRemoval) {
if (!t) {
this._trigger("beforeStop", e, this._uiHash());
for (n = 0;
n < r.length;
n++) r[n].call(this, e);
this._trigger("stop", e, this._uiHash())
}
return this.fromOutside = !1, !1
}
t || this._trigger("beforeStop", e, this._uiHash()), this.placeholder[0].parentNode.removeChild(this.placeholder[0]), this.helper[0] !== this.currentItem[0] && this.helper.remove(), this.helper = null;
if (!t) {
for (n = 0;
n < r.length;
n++) r[n].call(this, e);
this._trigger("stop", e, this._uiHash())
}
return this.fromOutside = !1, !0
},
_trigger: function() {
e.Widget.prototype._trigger.apply(this, arguments) === !1 && this.cancel()
},
_uiHash: function(t) {
var n = t || this;
return {
helper: n.helper,
placeholder: n.placeholder || e([]),
position: n.position,
originalPosition: n.originalPosition,
offset: n.positionAbs,
item: n.currentItem,
sender: t ? t.element : null
}
}
})
}(jQuery), define("vendor/jquery-sortable", function(e) {
return function() {
var t, n;
return t || e.$.sortable
}
}(this)), function() {
function h(e, t, n) {
if (e.addEventListener) {
e.addEventListener(t, n, !1);
return
}
e.attachEvent("on" + t, n)
}
function p(n) {
if (n.type == "keypress") {
var r = String.fromCharCode(n.which);
return n.shiftKey || (r = r.toLowerCase()), r
}
return e[n.which] ? e[n.which] : t[n.which] ? t[n.which] : String.fromCharCode(n.which).toLowerCase()
}
function d(e, t) {
return e.sort().join(",") === t.sort().join(",")
}
function v(e, t) {
e = e || {};
var n = !1,
r;
for (r in u) {
if (e[r] && u[r] > t) {
n = !0;
continue
}
u[r] = 0
}
n || (l = !1)
}
function m(e, t, n, r, i) {
var o, a, f = [],
l = n.type;
if (!s[e]) return [];
l == "keyup" && E(e) && (t = [e]);
for (o = 0;
o < s[e].length; ++o) {
a = s[e][o];
if (a.seq && u[a.seq] != a.level) continue;
if (l != a.action) continue;
if (l == "keypress" && !n.metaKey && !n.ctrlKey || d(t, a.modifiers)) r && a.combo == i && s[e].splice(o, 1), f.push(a)
}
return f
}
function g(e) {
var t = [];
return e.shiftKey && t.push("shift"), e.altKey && t.push("alt"), e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), t
}
function y(e, t, n) {
if (L.stopCallback(t, t.target || t.srcElement, n)) return;
e(t, n) === !1 && (t.preventDefault && t.preventDefault(), t.stopPropagation && t.stopPropagation(), t.returnValue = !1, t.cancelBubble = !0)
}
function b(e, t, n) {
var r = m(e, t, n),
i, s = {},
o = 0,
u = !1,
a = E(e);
for (i = 0;
i < r.length; ++i) {
if (r[i].seq) {
u = !0, o = Math.max(o, r[i].level), s[r[i].seq] = 1, y(r[i].callback, n, r[i].combo);
continue
}!u && !l && y(r[i].callback, n, r[i].combo)
}
var f = n.type == l && !a,
c = u && a;
(f || c) && v(s, o)
}
function w(e) {
typeof e.which != "number" && (e.which = e.keyCode);
var t = p(e);
if (!t) return;
if (e.type == "keyup" && f == t) {
f = !1;
return
}
L.handleKey(t, g(e), e)
}
function E(e) {
return e == "shift" || e == "ctrl" || e == "alt" || e == "meta"
}
function S() {
clearTimeout(a), a = setTimeout(v, 1e3)
}
function x() {
if (!i) {
i = {};
for (var t in e) {
if (t > 95 && t < 112) continue;
e.hasOwnProperty(t) && (i[e[t]] = t)
}
}
return i
}
function T(e, t, n) {
return n || (n = x()[e] ? "keydown" : "keypress"), n == "keypress" && t.length && (n = "keydown"), n
}
function N(e, t, n, r) {
u[e] = 0, r || (r = T(t[0], []));
var i = function() {
l = r, ++u[e], S()
},
s = function(t) {
y(n, t, e), r !== "keyup" && (f = p(t)), setTimeout(v, 10)
},
o;
for (o = 0;
o < t.length; ++o) C(t[o], o < t.length - 1 ? i : s, r, e, o)
}
function C(e, t, i, u, a) {
o[e + ":" + i] = t, e = e.replace(/\s+/g, " ");
var f = e.split(" "),
l, c, h, p = [];
if (f.length > 1) {
N(e, f, t, i);
return
}
h = e === "+" ? ["+"] : e.split("+");
for (l = 0;
l < h.length; ++l) c = h[l], r[c] && (c = r[c]), i && i != "keypress" && n[c] && (c = n[c], p.push("shift")), E(c) && p.push(c);
i = T(c, p, i), s[c] || (s[c] = []), m(c, p, {
type: i
}, !u, e), s[c][u ? "unshift" : "push"]({
callback: t,
modifiers: p,
action: i,
seq: u,
level: a,
combo: e
})
}
function k(e, t, n) {
for (var r = 0;
r < e.length; ++r) C(e[r], t, n)
}
var e = {
8: "backspace",
9: "tab",
13: "enter",
16: "shift",
17: "ctrl",
18: "alt",
20: "capslock",
27: "esc",
32: "space",
33: "pageup",
34: "pagedown",
35: "end",
36: "home",
37: "left",
38: "up",
39: "right",
40: "down",
45: "ins",
46: "del",
91: "meta",
93: "meta",
224: "meta"
},
t = {
106: "*",
107: "+",
109: "-",
110: ".",
111: "/",
186: ";
",
187: "=",
188: ",",
189: "-",
190: ".",
191: "/",
192: "`",
219: "[",
220: "\\",
221: "]",
222: "'"
},
n = {
"~": "`",
"!": "1",
"@": "2",
"#": "3",
$: "4",
"%": "5",
"^": "6",
"&": "7",
"*": "8",
"(": "9",
")": "0",
_: "-",
"+": "=",
":": ";
",
'"': "'",
"<": ",",
">": ".",
"?": "/",
"|": "\\"
},
r = {
option: "alt",
command: "meta",
"return": "enter",
escape: "esc"
},
i, s = {},
o = {},
u = {},
a, f = !1,
l = !1;
for (var c = 1;
c < 20; ++c) e[111 + c] = "f" + c;
for (c = 0;
c <= 9; ++c) e[c + 96] = c;
h(document, "keypress", w), h(document, "keydown", w), h(document, "keyup", w);
var L = {
bind: function(e, t, n) {
return e = e instanceof Array ? e : [e], k(e, t, n), this
},
unbind: function(e, t) {
return L.bind(e, function() {}, t)
},
trigger: function(e, t) {
return o[e + ":" + t] && o[e + ":" + t]({}, e), this
},
reset: function() {
return s = {}, o = {}, this
},
stopCallback: function(e, t) {
return (" " + t.className + " ").indexOf(" mousetrap ") > -1 ? !1 : t.tagName == "INPUT" || t.tagName == "SELECT" || t.tagName == "TEXTAREA" || t.contentEditable && t.contentEditable == "true"
},
handleKey: b
};
window.Mousetrap = L
}(), define("vendor/mousetrap", function(e) {
return function() {
var t, n;
return t || e.Mousetrap
}
}(this)), function(e) {
function B(n) {
function wt(e) {
return e && typeof e == "object" && !qt(e) && nt.call(e, "__wrapped__") ? e : new Pt(e)
}
function Ct(e) {
var t = e.length,
n = t >= a;
if (n) {
var r = {},
i = -1;
while (++i < t) {
var s = u + e[i];
(r[s] || (r[s] = [])).push(e[i])
}
}
return function(t) {
if (n) {
var i = u + t;
return r[i] && Qn(r[i], t) > -1
}
return Qn(e, t) > -1
}
}
function kt(e) {
return e.charCodeAt(0)
}
function Lt(e, t) {
var n = e.index,
r = t.index;
e = e.criteria, t = t.criteria;
if (e !== t) {
if (e > t || typeof e == "undefined") return 1;
if (e < t || typeof t == "undefined") return -1
}
return n < r ? -1 : 1
}
function At(e, t, n, r) {
function a() {
var r = arguments,
f = s ? this : t;
i || (e = t[o]), n.length && (r = r.length ? (r = mt.call(r), u ? r.concat(n) : n.concat(r)) : n);
if (this instanceof a) {
Ht.prototype = e.prototype, f = new Ht, Ht.prototype = null;
var l = e.apply(f, r);
return ln(l) ? l : f
}
return e.apply(f, r)
}
var i = fn(e),
s = !n,
o = t;
if (s) {
var u = r;
n = t
} else if (!i) {
if (!r) throw new V;
t = e
}
return a
}
function Ot() {
var e = {
shadowedProps: S,
arrays: "isArray(iterable)",
bottom: "",
init: "iterable",
loop: "",
top: "",
useHas: !0,
useKeys: !! Ut
};
for (var t, n = 0;
t = arguments[n];
n++) for (var r in t) e[r] = t[r];
var i = e.args;
e.firstArg = /^[^,]+/.exec(i)[0];
var s = q("hasOwnProperty, isArguments, isArray, isString, keys, lodash, objectTypes", "return function(" + i + ")
{
\n" + St(e) + "\n
}");
return s(nt, It, qt, mn, Ut, wt, P)
}
function Mt(e) {
return "\\" + H[e]
}
function _t(e) {
return Wt[e]
}
function Dt(e) {
return typeof e.toString != "function" && typeof(e + "") == "string"
}
function Pt(e) {
this.__wrapped__ = e
}
function Ht() {}
function Bt(e) {
var t = !1;
if (!e || ot.call(e) != O || !Et.argsClass && It(e)) return t;
var n = e.constructor;
return (fn(n) ? n instanceof n : Et.nodeClass || !Dt(e)) ? Et.ownLast ? (Gt(e, function(e, n, r) {
return t = nt.call(r, n), !1
}), t === !0) : (Gt(e, function(e, n) {
t = n
}), t === !1 || nt.call(e, t)) : t
}
function jt(e, t, n) {
t || (t = 0), typeof n == "undefined" && (n = e ? e.length : 0);
var r = -1,
s = n - t || 0,
o = i(s < 0 ? 0 : s);
while (++r < s) o[r] = e[t + r];
return o
}
function Ft(e) {
return Xt[e]
}
function It(e) {
return ot.call(e) == T
}
function $t(e, n, r, i, s, o) {
var u = e;
typeof n == "function" && (i = r, r = n, n = !1);
if (typeof r == "function") {
r = typeof i == "undefined" ? r : wt.createCallback(r, i, 1), u = r(u);
if (typeof u != "undefined") return u;
u = e
}
var a = ln(u);
if (a) {
var f = ot.call(u);
if (!D[f] || !Et.nodeClass && Dt(u)) return u;
var l = qt(u)
}
if (!a || !n) return a ? l ? jt(u) : Vt({}, u) : u;
var c = bt[f];
switch (f) {
case C:
case k:
return new c(+u);
case A:
case _:
return new c(u);
case M:
return c(u.source, d.exec(u))
}
s || (s = []), o || (o = []);
var h = s.length;
while (h--) if (s[h] == e) return o[h];
return u = l ? c(u.length) : {}, l && (nt.call(e, "index") && (u.index = e.index), nt.call(e, "input") && (u.input = e.input)), s.push(e), o.push(u), (l ? An : Yt)(e, function(e, i) {
u[i] = $t(e, n, r, t, s, o)
}), u
}
function Jt(e, t, n) {
return $t(e, !0, t, n)
}
function Qt(e, t, n) {
var r;
return t = wt.createCallback(t, n), Yt(e, function(e, n, i) {
if (t(e, n, i)) return r = n, !1
}), r
}
function Zt(e) {
var t = [];
return Gt(e, function(e, n) {
fn(e) && t.push(n)
}), t.sort()
}
function en(e, t) {
return e ? nt.call(e, t) : !1
}
function tn(e) {
var t = -1,
n = Ut(e),
r = n.length,
i = {};
while (++t < r) {
var s = n[t];
i[e[s]] = s
}
return i
}
function nn(e) {
return e === !0 || e === !1 || ot.call(e) == C
}
function rn(e) {
return e ? typeof e == "object" && ot.call(e) == k : !1
}
function sn(e) {
return e ? e.nodeType === 1 : !1
}
function on(e) {
var t = !0;
if (!e) return t;
var n = ot.call(e),
r = e.length;
return n == N || n == _ || (Et.argsClass ? n == T : It(e)) || n == O && typeof r == "number" && fn(e.splice) ? !r : (Yt(e, function() {
return t = !1
}), t)
}
function un(e, t, n, r, i, s) {
var u = n === o;
if (typeof n == "function" && !u) {
n = wt.createCallback(n, r, 2);
var a = n(e, t);
if (typeof a != "undefined") return !!a
}
if (e === t) return e !== 0 || 1 / e == 1 / t;
var f = typeof e,
l = typeof t;
if (e === e && (!e || f != "function" && f != "object") && (!t || l != "function" && l != "object")) return !1;
if (e == null || t == null) return e === t;
var c = ot.call(e),
h = ot.call(t);
c == T && (c = O), h == T && (h = O);
if (c != h) return !1;
switch (c) {
case C:
case k:
return +e == +t;
case A:
return e != +e ? t != +t : e == 0 ? 1 / e == 1 / t : e == +t;
case M:
case _:
return e == X(t)
}
var p = c == N;
if (!p) {
if (nt.call(e, "__wrapped__ ") || nt.call(t, "__wrapped__")) return un(e.__wrapped__ || e, t.__wrapped__ || t, n, r, i, s);
if (c != O || !Et.nodeClass && (Dt(e) || Dt(t))) return !1;
var d = !Et.argsObject && It(e) ? z : e.constructor,
v = !Et.argsObject && It(t) ? z : t.constructor;
if (d != v && !(fn(d) && d instanceof d && fn(v) && v instanceof v)) return !1
}
i || (i = []), s || (s = []);
var m = i.length;
while (m--) if (i[m] == e) return s[m] == t;
var g = 0;
a = !0, i.push(e), s.push(t);
if (p) {
m = e.length, g = t.length, a = g == e.length;
if (!a && !u) return a;
while (g--) {
var y = m,
b = t[g];
if (u) {
while (y--) if (a = un(e[y], b, n, r, i, s)) break
} else if (!(a = un(e[g], b, n, r, i, s))) break
}
return a
}
return Gt(t, function(t, o, u) {
if (nt.call(u, o)) return g++, a = nt.call(e, o) && un(e[o], t, n, r, i, s)
}), a && !u && Gt(e, function(e, t, n) {
if (nt.call(n, t)) return a = --g > -1
}), a
}
function an(e) {
return ft(e) && !lt(parseFloat(e))
}
function fn(e) {
return typeof e == "function"
}
function ln(e) {
return e ? P[typeof e] : !1
}
function cn(e) {
return pn(e) && e != +e
}
function hn(e) {
return e === null
}
function pn(e) {
return typeof e == "number" || ot.call(e) == A
}
function vn(e) {
return e ? P[typeof e] && ot.call(e) == M : !1
}
function mn(e) {
return typeof e == "string" || ot.call(e) == _
}
function gn(e) {
return typeof e == "undefined"
}
function yn(e, t, n) {
var r = arguments,
i = 0,
s = 2;
if (!ln(e)) return e;
if (n === o) var u = r[3],
a = r[4],
f = r[5];
else a = [], f = [], typeof n != "number" && (s = r.length), s > 3 && typeof r[s - 2] == "function" ? u = wt.createCallback(r[--s - 1], r[s--], 2) : s > 2 && typeof r[s - 1] == "function" && (u = r[--s]);
while (++i < s)(qt(r[i]) ? An : Yt)(r[i], function(t, n) {
var r, i, s = t,
l = e[n];
if (t && ((i = qt(t)) || dn(t))) {
var c = a.length;
while (c--) if (r = a[c] == t) {
l = f[c];
break
}
if (!r) {
var h;
if (u) {
s = u(l, t);
if (h = typeof s != "undefined") l = s
}
h || (l = i ? qt(l) ? l : [] : dn(l) ? l : {}), a.push(t), f.push(l), h || (l = yn(l, t, o, u, a, f))
}
} else u && (s = u(l, t), typeof s == "undefined" && (s = t)), typeof s != "undefined" && (l = s);
e[n] = l
});
return e
}
function bn(e, t, n) {
var r = typeof t == "function",
i = {};
if (r) t = wt.createCallback(t, n);
else var s = Z.apply($, mt.call(arguments, 1));
return Gt(e, function(e, n, o) {
if (r ? !t(e, n, o) : Qn(s, n) < 0) i[n] = e
}), i
}
function wn(e) {
var t = -1,
n = Ut(e),
r = n.length,
s = i(r);
while (++t < r) {
var o = n[t];
s[t] = [o, e[o]]
}
return s
}
function En(e, t, n) {
var r = {};
if (typeof t != "function") {
var i = -1,
s = Z.apply($, mt.call(arguments, 1)),
o = ln(e) ? s.length : 0;
while (++i < o) {
var u = s[i];
u in e && (r[u] = e[u])
}
} else t = wt.createCallback(t, n), Gt(e, function(e, n, i) {
t(e, n, i) && (r[n] = e)
});
return r
}
function Sn(e) {
var t = -1,
n = Ut(e),
r = n.length,
s = i(r);
while (++t < r) s[t] = e[n[t]];
return s
}
function xn(e) {
var t = -1,
n = Z.apply($, mt.call(arguments, 1)),
r = n.length,
s = i(r);
Et.unindexedChars && mn(e) && (e = e.split(""));
while (++t < r) s[t] = e[n[t]];
return s
}
function Tn(e, t, n) {
var r = -1,
i = e ? e.length : 0,
s = !1;
return n = (n < 0 ? ht(0, i + n) : n) || 0, typeof i == "number" ? s = (mn(e) ? e.indexOf(t, n) : Qn(e, t, n)) > -1 : zt(e, function(e) {
if (++r >= n) return !(s = e === t)
}), s
}
function Nn(e, t, n) {
var r = {};
return t = wt.createCallback(t, n), An(e, function(e, n, i) {
n = X(t(e, n, i)), nt.call(r, n) ? r[n]++ : r[n] = 1
}), r
}
function Cn(e, t, n) {
var r = !0;
t = wt.createCallback(t, n);
if (qt(e)) {
var i = -1,
s = e.length;
while (++i < s) if (!(r = !! t(e[i], i, e))) break
} else zt(e, function(e, n, i) {
return r = !! t(e, n, i)
});
return r
}
function kn(e, t, n) {
var r = [];
t = wt.createCallback(t, n);
if (qt(e)) {
var i = -1,
s = e.length;
while (++i < s) {
var o = e[i];
t(o, i, e) && r.push(o)
}
} else zt(e, function(e, n, i) {
t(e, n, i) && r.push(e)
});
return r
}
function Ln(e, t, n) {
t = wt.createCallback(t, n);
if (!qt(e)) {
var o;
return zt(e, function(e, n, r) {
if (t(e, n, r)) return o = e, !1
}), o
}
var r = -1,
i = e.length;
while (++r < i) {
var s = e[r];
if (t(s, r, e)) return s
}
}
function An(e, t, n) {
if (t && typeof n == "undefined" && qt(e)) {
var r = -1,
i = e.length;
while (++r < i) if (t(e[r], r, e) === !1) break
} else zt(e, t, n);
return e
}
function On(e, t, n) {
var r = {};
return t = wt.createCallback(t, n), An(e, function(e, n, i) {
n = X(t(e, n, i)), (nt.call(r, n) ? r[n] : r[n] = []).push(e)
}), r
}
function Mn(e, t) {
var n = mt.call(arguments, 2),
r = -1,
s = typeof t == "function",
o = e ? e.length : 0,
u = i(typeof o == "number" ? o : 0);
return An(e, function(e) {
u[++r] = (s ? t : e[t]).apply(e, n)
}), u
}
function _n(e, t, n) {
var r = -1,
s = e ? e.length : 0,
o = i(typeof s == "number" ? s : 0);
t = wt.createCallback(t, n);
if (qt(e)) while (++r < s) o[r] = t(e[r], r, e);
else zt(e, function(e, n, i) {
o[++r] = t(e, n, i)
});
return o
}
function Dn(e, t, n) {
var r = -Infinity,
i = r;
if (!t && qt(e)) {
var s = -1,
o = e.length;
while (++s < o) {
var u = e[s];
u > i && (i = u)
}
} else t = !t && mn(e) ? kt : wt.createCallback(t, n), zt(e, function(e, n, s) {
var o = t(e, n, s);
o > r && (r = o, i = e)
});
return i
}
function Pn(e, t, n) {
var r = Infinity,
i = r;
if (!t && qt(e)) {
var s = -1,
o = e.length;
while (++s < o) {
var u = e[s];
u < i && (i = u)
}
} else t = !t && mn(e) ? kt : wt.createCallback(t, n), zt(e, function(e, n, s) {
var o = t(e, n, s);
o < r && (r = o, i = e)
});
return i
}
function Bn(e, t, n, r) {
var i = arguments.length < 3;
t = wt.createCallback(t, r, 4);
if (qt(e)) {
var s = -1,
o = e.length;
i && (n = e[++s]);
while (++s < o) n = t(n, e[s], s, e)
} else zt(e, function(e, r, s) {
n = i ? (i = !1, e) : t(n, e, r, s)
});
return n
}
function jn(e, t, n, r) {
var i = e,
s = e ? e.length : 0,
o = arguments.length < 3;
if (typeof s != "number") {
var u = Ut(e);
s = u.length
} else Et.unindexedChars && mn(e) && (i = e.split(""));
return t = wt.createCallback(t, r, 4), An(e, function(e, r, a) {
r = u ? u[--s] : --s, n = o ? (o = !1, i[r]) : t(n, i[r], r, a)
}), n
}
function Fn(e, t, n) {
return t = wt.createCallback(t, n), kn(e, function(e, n, r) {
return !t(e, n, r)
})
}
function In(e) {
var t = -1,
n = e ? e.length : 0,
r = i(typeof n == "number" ? n : 0);
return An(e, function(e) {
var n = et(vt() * (++t + 1));
r[t] = r[n], r[n] = e
}), r
}
function qn(e) {
var t = e ? e.length : 0;
return typeof t == "number" ? t : Ut(e).length
}
function Rn(e, t, n) {
var r;
t = wt.createCallback(t, n);
if (qt(e)) {
var i = -1,
s = e.length;
while (++i < s) if (r = t(e[i], i, e)) break
} else zt(e, function(e, n, i) {
return !(r = t(e, n, i))
});
return !!r
}
function Un(e, t, n) {
var r = -1,
s = e ? e.length : 0,
o = i(typeof s == "number" ? s : 0);
t = wt.createCallback(t, n), An(e, function(e, n, i) {
o[++r] = {
criteria: t(e, n, i),
index: r,
value: e
}
}), s = o.length, o.sort(Lt);
while (s--) o[s] = o[s].value;
return o
}
function zn(e) {
return e && typeof e.length == "number" ? Et.unindexedChars && mn(e) ? e.split("") : jt(e) : Sn(e)
}
function Xn(e) {
var t = -1,
n = e ? e.length : 0,
r = [];
while (++t < n) {
var i = e[t];
i && r.push(i)
}
return r
}
function Vn(e) {
var t = -1,
n = e ? e.length : 0,
r = Z.apply($, mt.call(arguments, 1)),
i = Ct(r),
s = [];
while (++t < n) {
var o = e[t];
i(o) || s.push(o)
}
return s
}
function $n(e, t, n) {
var r = -1,
i = e ? e.length : 0;
t = wt.createCallback(t, n);
while (++r < i) if (t(e[r], r, e)) return r;
return -1
}
function Jn(e, t, n) {
if (e) {
var r = 0,
i = e.length;
if (typeof t != "number" && t != null) {
var s = -1;
t = wt.createCallback(t, n);
while (++s < i && t(e[s], s, e)) r++
} else {
r = t;
if (r == null || n) return e[0]
}
return jt(e, 0, pt(ht(0, r), i))
}
}
function Kn(e, t, n, r) {
var i = -1,
s = e ? e.length : 0,
o = [];
typeof t != "boolean" && t != null && (r = n, n = t, t = !1), n != null && (n = wt.createCallback(n, r));
while (++i < s) {
var u = e[i];
n && (u = n(u, i, e)), qt(u) ? rt.apply(o, t ? u : Kn(u)) : o.push(u)
}
return o
}
function Qn(e, t, n) {
var r = -1,
i = e ? e.length : 0;
if (typeof n == "number") r = (n < 0 ? ht(0, i + n) : n || 0) - 1;
else if (n) return r = rr(e, t), e[r] === t ? r : -1;
while (++r < i) if (e[r] === t) return r;
return -1
}
function Gn(e, t, n) {
if (!e) return [];
var r = 0,
i = e.length;
if (typeof t != "number" && t != null) {
var s = i;
t = wt.createCallback(t, n);
while (s-- && t(e[s], s, e)) r++
} else r = t == null || n ? 1 : t || r;
return jt(e, 0, pt(ht(0, i - r), i))
}
function Yn(e) {
var t = arguments,
n = t.length,
r = {
0: {}
},
i = -1,
s = e ? e.length : 0,
o = s >= a,
f = [],
l = f;
e: while (++i < s) {
var c = e[i];
if (o) var h = u + c,
p = r[0][h] ? !(l = r[0][h]) : l = r[0][h] = [];
if (p || Qn(l, c) < 0) {
o && l.push(c);
var d = n;
while (--d) if (!(r[d] || (r[d] = Ct(t[d])))(c)) continue e;
f.push(c)
}
}
return f
}
function Zn(e, t, n) {
if (e) {
var r = 0,
i = e.length;
if (typeof t != "number" && t != null) {
var s = i;
t = wt.createCallback(t, n);
while (s-- && t(e[s], s, e)) r++
} else {
r = t;
if (r == null || n) return e[i - 1]
}
return jt(e, ht(0, i - r))
}
}
function er(e, t, n) {
var r = e ? e.length : 0;
typeof n == "number" && (r = (n < 0 ? ht(0, r + n) : pt(n, r - 1)) + 1);
while (r--) if (e[r] === t) return r;
return -1
}
function tr(e, t, n) {
e = +e || 0, n = +n || 1, t == null && (t = e, e = 0);
var r = -1,
s = ht(0, G((t - e) / n)),
o = i(s);
while (++r < s) o[r] = e, e += n;
return o
}
function nr(e, t, n) {
if (typeof t != "number" && t != null) {
var r = 0,
i = -1,
s = e ? e.length : 0;
t = wt.createCallback(t, n);
while (++i < s && t(e[i], i, e)) r++
} else r = t == null || n ? 1 : ht(0, t);
return jt(e, r)
}
function rr(e, t, n, r) {
var i = 0,
s = e ? e.length : i;
n = n ? wt.createCallback(n, r, 1) : Cr, t = n(t);
while (i < s) {
var o = i + s >>> 1;
n(e[o]) < t ? i = o + 1 : s = o
}
return i
}
function ir(e) {
return qt(e) || (arguments[0] = e ? mt.call(e) : $), sr(Z.apply($, arguments))
}
function sr(e, t, n, r) {
var i = -1,
s = e ? e.length : 0,
o = [],
f = o;
typeof t != "boolean" && t != null && (r = n, n = t, t = !1);
var l = !t && s >= a;
if (l) var c = {};
n != null && (f = [], n = wt.createCallback(n, r));
while (++i < s) {
var h = e[i],
p = n ? n(h, i, e) : h;
if (l) var d = u + p,
v = c[d] ? !(f = c[d]) : f = c[d] = [];
if (t ? !i || f[f.length - 1] !== p : v || Qn(f, p) < 0)(n || l) && f.push(p), o.push(h)
}
return o
}
function or(e) {
var t = -1,
n = e ? e.length : 0,
r = n ? Dn(Hn(e, "length")) : 0,
s = i(r);
while (++t < n) {
var o = -1,
u = e[t];
while (++o < r)(s[o] || (s[o] = i(n)))[t] = u[o]
}
return s
}
function ur(e) {
return Vn(e, mt.call(arguments, 1))
}
function ar(e) {
var t = -1,
n = e ? Dn(Hn(arguments, "length")) : 0,
r = i(n);
while (++t < n) r[t] = Hn(arguments, t);
return r
}
function fr(e, t) {
var n = -1,
r = e ? e.length : 0,
i = {};
while (++n < r) {
var s = e[n];
t ? i[s] = t[n] : i[s[0]] = s[1]
}
return i
}
function lr(e, t) {
return e < 1 ? t() : function() {
if (--e < 1) return t.apply(this, arguments)
}
}
function cr(e, t) {
return Et.fastBind || ut && arguments.length > 2 ? ut.call.apply(ut, arguments) : At(e, t, mt.call(arguments, 2))
}
function hr(e) {
var t = arguments.length > 1 ? Z.apply($, mt.call(arguments, 1)) : Zt(e),
n = -1,
r = t.length;
while (++n < r) {
var i = t[n];
e[i] = cr(e[i], e)
}
return e
}
function pr(e, t) {
return At(e, t, mt.call(arguments, 2), o)
}
function dr() {
var e = arguments;
return function() {
var t = arguments,
n = e.length;
while (n--) t = [e[n].apply(this, t)];
return t[0]
}
}
function vr(e, t, n) {
if (e == null) return Cr;
var r = typeof e;
if (r != "function") {
if (r != "object") return function(t) {
return t[e]
};
var i = Ut(e);
return function(t) {
var n = i.length,
r = !1;
while (n--) if (!(r = un(t[i[n]], e[i[n]], o))) break;
return r
}
}
return typeof t != "undefined" ? n === 1 ?
function(n) {
return e.call(t, n)
} : n === 2 ?
function(n, r) {
return e.call(t, n, r)
} : n === 4 ?
function(n, r, i, s) {
return e.call(t, n, r, i, s)
} : function(n, r, i) {
return e.call(t, n, r, i)
} : e
}
function mr(e, t, n) {
function f() {
i = u = null, a && (s = e.apply(o, r))
}
var r, i, s, o, u, a = !0;
if (n === !0) {
var l = !0;
a = !1
} else n && P[typeof n] && (l = n.leading, a = "trailing" in n ? n.trailing : a);
return function() {
return r = arguments, o = this, Y(u), !i && l ? (i = !0, s = e.apply(o, r)) : u = st(f, t), s
}
}
function gr(e) {
var n = mt.call(arguments, 1);
return st(function() {
e.apply(t, n)
}, 1)
}
function yr(e, n) {
var r = mt.call(arguments, 2);
return st(function() {
e.apply(t, r)
}, n)
}
function br(e, t) {
var n = {};
return function() {
var r = u + (t ? t.apply(this, arguments) : arguments[0]);
return nt.call(n, r) ? n[r] : n[r] = e.apply(this, arguments)
}
}
function wr(e) {
var t, n;
return function() {
return t ? n : (t = !0, n = e.apply(this, arguments), e = null, n)
}
}
function Er(e) {
return At(e, mt.call(arguments, 1))
}
function Sr(e) {
return At(e, mt.call(arguments, 1), null, o)
}
function xr(e, t, n) {
function l() {
o = null, f && (u = new I, i = e.apply(s, r))
}
var r, i, s, o, u = 0,
a = !0,
f = !0;
return n === !1 ? a = !1 : n && P[typeof n] && (a = "leading" in n ? n.leading : a, f = "trailing" in n ? n.trailing : f), function() {
var n = new I;
!o && !a && (u = n);
var f = t - (n - u);
return r = arguments, s = this, f <= 0 ? (Y(o), o = null, u = n, i = e.apply(s, r)) : o || (o = st(l, f)), i
}
}
function Tr(e, t) {
return function() {
var n = [e];
return rt.apply(n, arguments), t.apply(this, n)
}
}
function Nr(e) {
return e == null ? "" : X(e).replace(b, _t)
}
function Cr(e) {
return e
}
function kr(e) {
An(Zt(e), function(t) {
var n = wt[t] = e[t];
wt.prototype[t] = function() {
var e = this.__wrapped__,
t = [e];
rt.apply(t, arguments);
var r = n.apply(wt, t);
return e && typeof e == "object" && e == r ? this : new Pt(r)
}
})
}
function Lr() {
return n._ = K, this
}
function Or(e, t) {
return e == null && t == null && (t = 1), e = +e || 0, t == null && (t = e, e = 0), e + et(vt() * ((+t || 0) - e + 1))
}
function Mr(e, n) {
var r = e ? e[n] : t;
return fn(r) ? e[n]() : r
}
function _r(e, n, r) {
var i = wt.templateSettings;
e || (e = ""), r = Kt({}, r, i);
var s = Kt({}, r.imports, i.imports),
o = Ut(s),
u = Sn(s),
a, h = 0,
d = r.interpolate || y,
m = "__p += '",
g = W((r.escape || y).source + "|" + d.source + "|" + (d === v ? p : y).source + "|" + (r.evaluate || y).source + "|$", "g");
e.replace(g, function(t, n, r, i, s, o) {
return r || (r = i), m += e.slice(h, o).replace(w, Mt), n && (m += "' +\n__e(" + n + ") +\n'"), s && (a = !0, m += "';
\n" + s + ";
\n__p += '"), r && (m += "' +\n((__t = (" + r + ")) == null ? '' : __t) +\n'"), h = o + t.length, t
}), m += "';
\n";
var b = r.variable,
E = b;
E || (b = "obj", m = "with (" + b + ")
{
\n" + m + "\n
}\n"), m = (a ? m.replace(f, "") : m).replace(l, "$1").replace(c, "$1;
"), m = "function(" + b + ")
{
\n" + (E ? "" : b + " || (" + b + " = {
});
\n") + "var __t, __p = '', __e = _.escape" + (a ? ", __j = Array.prototype.join;
\nfunction print()
{
__p += __j.call(arguments, '')
}\n" : ";
\n") + m + "return __p\n
}";
var S = "\n/*\n//@ sourceURL=" + (r.sourceURL || "/lodash/template/source[" + x+++"]") + "\n*/";
try {
var T = q(o, "return " + m + S).apply(t, u)
} catch (N) {
throw N.source = m, N
}
return n ? T(n) : (T.source = m, T)
}
function Dr(e, t, n) {
e = (e = +e) > -1 ? e : 0;
var r = -1,
s = i(e);
t = wt.createCallback(t, n, 1);
while (++r < e) s[r] = t(r);
return s
}
function Pr(e) {
return e == null ? "" : X(e).replace(h, Ft)
}
function Hr(e) {
var t = ++s;
return X(e == null ? "" : e) + t
}
function Br(e, t) {
return t(e), e
}
function jr() {
return X(this.__wrapped__)
}
function Fr() {
return this.__wrapped__
}
n = n ? j.defaults(e.Object(), n, j.pick(e, E)) : e;
var i = n.Array,
F = n.Boolean,
I = n.Date,
q = n.Function,
R = n.Math,
U = n.Number,
z = n.Object,
W = n.RegExp,
X = n.String,
V = n.TypeError,
$ = i(),
J = z(),
K = n._,
Q = W("^" + X(J.valueOf).replace(/[.*+?^${
}()|[\]\\]/g, "\\$&").replace(/valueOf|for [^\]]+/g, ".+?") + "$"),
G = R.ceil,
Y = n.clearTimeout,
Z = $.concat,
et = R.floor,
tt = Q.test(tt = z.getPrototypeOf) && tt,
nt = J.hasOwnProperty,
rt = $.push,
it = n.setImmediate,
st = n.setTimeout,
ot = J.toString,
ut = Q.test(ut = ot.bind) && ut,
at = Q.test(at = i.isArray) && at,
ft = n.isFinite,
lt = n.isNaN,
ct = Q.test(ct = z.keys) && ct,
ht = R.max,
pt = R.min,
dt = n.parseInt,
vt = R.random,
mt = $.slice,
gt = Q.test(n.attachEvent),
yt = ut && !/\n|true/.test(ut + gt),
bt = {};
bt[N] = i, bt[C] = F, bt[k] = I, bt[O] = z, bt[A] = U, bt[M] = W, bt[_] = X;
var Et = wt.support = {};
(function() {
var e = function() {
this.x = 1
},
t = {
0: 1,
length: 1
},
n = [];
e.prototype = {
valueOf: 1,
y: 1
};
for (var r in new e) n.push(r);
for (r in arguments);
Et.argsObject = arguments.constructor == z && !(arguments instanceof i), Et.argsClass = It(arguments), Et.enumPrototypes = e.propertyIsEnumerable("prototype"), Et.fastBind = ut && !yt, Et.ownLast = n[0] != "x", Et.nonEnumArgs = r != 0, Et.nonEnumShadows = !/valueOf/.test(n), Et.spliceObjects = ($.splice.call(t, 0, 1), !t[0]), Et.unindexedChars = "x" [0] + z("x")[0] != "xx";
try {
Et.nodeClass = ot.call(document) != O || !! ({
toString: 0
} + "")
} catch (s) {
Et.nodeClass = !0
}
})(1), wt.templateSettings = {
escape: /<%-([\s\S]+?)%>/g,
evaluate: /<%([\s\S]+?)%>/g,
interpolate: v,
variable: "",
imports: {
_: wt
}
};
var St = function(e) {
var t = "var index, iterable = " + e.firstArg + ", result = " + e.init + ";
\nif (!iterable) return result;
\n" + e.top + ";
\n";
e.arrays ? (t += "var length = iterable.length;
index = -1;
\nif (" + e.arrays + ")
{
", Et.unindexedChars && (t += "\n if (isString(iterable))
{
\n iterable = iterable.split('')\n
}
"), t += "\n while (++index < length)
{
\n " + e.loop + "\n
}\n
}\nelse { ") : Et.nonEnumArgs && (t += "\n var length = iterable.length;
index = -1;
\n if (length && isArguments(iterable))
{
\n while (++index < length)
{
\n index += '';
\n " + e.loop + "\n
}\n
}
else
{ "), Et.enumPrototypes && (t += "\n var skipProto = typeof iterable == 'function';
\n ");
if (e.useHas && e.useKeys) t += "\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] ? keys(iterable) : [],\n length = ownProps.length;
\n\n while (++ownIndex < length)
{
\n index = ownProps[ownIndex];
\n ", Et.enumPrototypes && (t += "if (!(skipProto && index == 'prototype'))
{
\n "), t += e.loop, Et.enumPrototypes && (t += "
}\n"), t += "
}
";
else {
t += "\n for (index in iterable)
{
";
if (Et.enumPrototypes || e.useHas) t += "\n if (", Et.enumPrototypes && (t += "!(skipProto && index == 'prototype')"), Et.enumPrototypes && e.useHas && (t += " && "), e.useHas && (t += "hasOwnProperty.call(iterable, index)"), t += ")
{
";
t += e.loop + ";
";
if (Et.enumPrototypes || e.useHas) t += "\n
}";
t += "\n
}
";
if (Et.nonEnumShadows) {
t += "\n\n var ctor = iterable.constructor;
\n ";
for (var n = 0;
n < 7;
n++) t += "\n index = '" + e.shadowedProps[n] + "';
\n if (", e.shadowedProps[n] == "constructor" && (t += "!(ctor && ctor.prototype === iterable) && "), t += "hasOwnProperty.call(iterable, index))
{
\n " + e.loop + "\n
}
"
}
}
if (e.arrays || Et.nonEnumArgs) t += "\n
}";
return t += e.bottom + ";
\nreturn result", t
},
xt = {
args: "object, source, guard",
top: "var args = arguments,\n argsIndex = 0,\n argsLength = typeof guard == 'number' ? 2 : args.length;
\nwhile (++argsIndex < argsLength)
{
\n iterable = args[argsIndex];
\n if (iterable && objectTypes[typeof iterable])
{
",
loop: "if (typeof result[index] == 'undefined') result[index] = iterable[index]",
bottom: "
}\n
}"
},
Tt = {
args: "collection, callback, thisArg",
top: "callback = callback && typeof thisArg == 'undefined' ? callback : lodash.createCallback(callback, thisArg)",
arrays: "typeof length == 'number'",
loop: "if (callback(iterable[index], index, collection) === false) return result"
},
Nt = {
top: "if (!objectTypes[typeof iterable]) return result;
\n" + Tt.top,
arrays: !1
};
Pt.prototype = wt.prototype, Et.argsClass || (It = function(e) {
return e ? nt.call(e, "callee") : !1
});
var qt = at ||
function(e) {
return e ? typeof e == "object" && ot.call(e) == N : !1
}, Rt = Ot({
args: "object",
init: "[]",
top: "if (!(objectTypes[typeof object])) return result",
loop: "result.push(index)",
arrays: !1
}), Ut = ct ?
function(e) {
return ln(e) ? Et.enumPrototypes && typeof e == "function" || Et.nonEnumArgs && e.length && It(e) ? Rt(e) : ct(e) : []
} : Rt, zt = Ot(Tt), Wt = {
"&": "&amp;
",
"<": "&lt;
",
">": "&gt;
",
'"': "&quot;
",
"'": "&#39;
"
}, Xt = tn(Wt), Vt = Ot(xt, {
top: xt.top.replace(";
", ";
\nif (argsLength > 3 && typeof args[argsLength - 2] == 'function')
{
\n var callback = lodash.createCallback(args[--argsLength - 1], args[argsLength--], 2);
\n
}
else if (argsLength > 2 && typeof args[argsLength - 1] == 'function')
{
\n callback = args[--argsLength];
\n
}"),
loop: "result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]"
}), Kt = Ot(xt), Gt = Ot(Tt, Nt, {
useHas: !1
}), Yt = Ot(Tt, Nt);
fn(/x/) && (fn = function(e) {
return typeof e == "function" && ot.call(e) == L
});
var dn = tt ?
function(e) {
if (!e || ot.call(e) != O || !Et.argsClass && It(e)) return !1;
var t = e.valueOf,
n = typeof t == "function" && (n = tt(t)) && tt(n);
return n ? e == n || tt(e) == n : Bt(e)
} : Bt, Hn = _n, Wn = kn;
yt && r && typeof it == "function" && (gr = cr(it, n));
var Ar = dt(m + "08") == 8 ? dt : function(e, t) {
return dt(mn(e) ? e.replace(g, "") : e, t || 0)
};
return wt.after = lr, wt.assign = Vt, wt.at = xn, wt.bind = cr, wt.bindAll = hr, wt.bindKey = pr, wt.compact = Xn, wt.compose = dr, wt.countBy = Nn, wt.createCallback = vr, wt.debounce = mr, wt.defaults = Kt, wt.defer = gr, wt.delay = yr, wt.difference = Vn, wt.filter = kn, wt.flatten = Kn, wt.forEach = An, wt.forIn = Gt, wt.forOwn = Yt, wt.functions = Zt, wt.groupBy = On, wt.initial = Gn, wt.intersection = Yn, wt.invert = tn, wt.invoke = Mn, wt.keys = Ut, wt.map = _n, wt.max = Dn, wt.memoize = br, wt.merge = yn, wt.min = Pn, wt.omit = bn, wt.once = wr, wt.pairs = wn, wt.partial = Er, wt.partialRight = Sr, wt.pick = En, wt.pluck = Hn, wt.range = tr, wt.reject = Fn, wt.rest = nr, wt.shuffle = In, wt.sortBy = Un, wt.tap = Br, wt.throttle = xr, wt.times = Dr, wt.toArray = zn, wt.union = ir, wt.uniq = sr, wt.unzip = or, wt.values = Sn, wt.where = Wn, wt.without = ur, wt.wrap = Tr, wt.zip = ar, wt.zipObject = fr, wt.collect = _n, wt.drop = nr, wt.each = An, wt.extend = Vt, wt.methods = Zt, wt.object = fr, wt.select = kn, wt.tail = nr, wt.unique = sr, kr(wt), wt.clone = $t, wt.cloneDeep = Jt, wt.contains = Tn, wt.escape = Nr, wt.every = Cn, wt.find = Ln, wt.findIndex = $n, wt.findKey = Qt, wt.has = en, wt.identity = Cr, wt.indexOf = Qn, wt.isArguments = It, wt.isArray = qt, wt.isBoolean = nn, wt.isDate = rn, wt.isElement = sn, wt.isEmpty = on, wt.isEqual = un, wt.isFinite = an, wt.isFunction = fn, wt.isNaN = cn, wt.isNull = hn, wt.isNumber = pn, wt.isObject = ln, wt.isPlainObject = dn, wt.isRegExp = vn, wt.isString = mn, wt.isUndefined = gn, wt.lastIndexOf = er, wt.mixin = kr, wt.noConflict = Lr, wt.parseInt = Ar, wt.random = Or, wt.reduce = Bn, wt.reduceRight = jn, wt.result = Mr, wt.runInContext = B, wt.size = qn, wt.some = Rn, wt.sortedIndex = rr, wt.template = _r, wt.unescape = Pr, wt.uniqueId = Hr, wt.all = Cn, wt.any = Rn, wt.detect = Ln, wt.foldl = Bn, wt.foldr = jn, wt.include = Tn, wt.inject = Bn, Yt(wt, function(e, t) {
wt.prototype[t] || (wt.prototype[t] = function() {
var t = [this.__wrapped__];
return rt.apply(t, arguments), e.apply(wt, t)
})
}), wt.first = Jn, wt.last = Zn, wt.take = Jn, wt.head = Jn, Yt(wt, function(e, t) {
wt.prototype[t] || (wt.prototype[t] = function(t, n) {
var r = e(this.__wrapped__, t, n);
return t == null || n && typeof t != "function" ? r : new Pt(r)
})
}), wt.VERSION = "1.2.1", wt.prototype.toString = jr, wt.prototype.value = Fr, wt.prototype.valueOf = Fr, zt(["join", "pop", "shift"], function(e) {
var t = $[e];
wt.prototype[e] = function() {
return t.apply(this.__wrapped__, arguments)
}
}), zt(["push", "reverse", "sort", "unshift"], function(e) {
var t = $[e];
wt.prototype[e] = function() {
return t.apply(this.__wrapped__, arguments), this
}
}), zt(["concat", "slice", "splice"], function(e) {
var t = $[e];
wt.prototype[e] = function() {
return new Pt(t.apply(this.__wrapped__, arguments))
}
}), Et.spliceObjects || zt(["pop", "shift", "splice"], function(e) {
var t = $[e],
n = e == "splice";
wt.prototype[e] = function() {
var e = this.__wrapped__,
r = t.apply(e, arguments);
return e.length === 0 && delete e[0], n ? new Pt(r) : r
}
}), wt
}
var t, n = typeof exports == "object" && exports,
r = typeof module == "object" && module && module.exports == n && module,
i = typeof global == "object" && global;
if (i.global === i || i.window === i) e = i;
var s = 0,
o = {},
u = +(new Date) + "",
a = 200,
f = /\b__p \+= '';
/g,
l = /\b(__p \+=) '' \+/g,
c = /(__e\(.*?\)|\b__t\)) \+\n'';
/g,
h = /&(?:amp|lt|gt|quot|#39);
/g,
p = /\$\{([^\\
}]*(?:\\.[^\\
}]*)*)\
}/g,
d = /\w*$/,
v = /<%=([\s\S]+?)%>/g,
m = " \f \n\r\u2028\u2029áš€á Žâ€€â€â€‚â€ƒâ€„â€…â€†â€‡â€ˆâ€‰â€Šâ€¯âŸã€€",
g = RegExp("^[" + m + "]*0+(?=.$)"),
y = /($^)/,
b = /[&<>"']/g,
w = /['\n\r\t\u2028\u2029\\]/g,
E = ["Array", "Boolean", "Date", "Function", "Math", "Number", "Object", "RegExp", "String", "_", "attachEvent", "clearTimeout", "isFinite", "isNaN", "parseInt", "setImmediate", "setTimeout"],
S = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"],
x = 0,
T = "[object Arguments]",
N = "[object Array]",
C = "[object Boolean]",
k = "[object Date]",
L = "[object Function]",
A = "[object Number]",
O = "[object Object]",
M = "[object RegExp]",
_ = "[object String]",
D = {};
D[L] = !1, D[T] = D[N] = D[C] = D[k] = D[A] = D[O] = D[M] = D[_] = !0;
var P = {
"boolean": !1,
"function": !0,
object: !0,
number: !1,
string: !1,
"undefined": !1
},
H = {
"\\": "\\",
"'": "'",
"\n": "n",
"\r": "r",
" ": "t",
"\u2028": "u2028",
"\u2029": "u2029"
},
j = B();
typeof define == "function" && typeof define.amd == "object" && define.amd ? (e._ = j, define("vendor/lodash", [], function() {
return j
})) : n && !n.nodeType ? r ? (r.exports = j)._ = j : n._ = j : e._ = j
}(this), !
function(e, t) {
var n = t.prototype.trim,
r = t.prototype.trimRight,
i = t.prototype.trimLeft,
s = function(e) {
return e * 1 || 0
},
o = function(e, t) {
if (t < 1) return "";
var n = "";
while (t > 0) t & 1 && (n += e), t >>= 1, e += e;
return n
},
u = [].slice,
a = function(e) {
return e == null ? "\\s" : e.source ? e.source : "[" + p.escapeRegExp(e) + "]"
},
f = {
lt: "<",
gt: ">",
quot: '"',
amp: "&",
apos: "'"
},
l = {};
for (var c in f) l[f[c]] = c;
l["'"] = "#39";
var h = function() {
function e(e) {
return Object.prototype.toString.call(e).slice(8, -1).toLowerCase()
}
var n = o,
r = function() {
return r.cache.hasOwnProperty(arguments[0]) || (r.cache[arguments[0]] = r.parse(arguments[0])), r.format.call(null, r.cache[arguments[0]], arguments)
};
return r.format = function(r, i) {
var s = 1,
o = r.length,
u = "",
a, f = [],
l, c, p, d, v, m;
for (l = 0;
l < o;
l++) {
u = e(r[l]);
if (u === "string") f.push(r[l]);
else if (u === "array") {
p = r[l];
if (p[2]) {
a = i[s];
for (c = 0;
c < p[2].length;
c++) {
if (!a.hasOwnProperty(p[2][c])) throw new Error(h('[_.sprintf] property "%s" does not exist', p[2][c]));
a = a[p[2][c]]
}
} else p[1] ? a = i[p[1]] : a = i[s++];
if (/[^s]/.test(p[8]) && e(a) != "number") throw new Error(h("[_.sprintf] expecting number but found %s", e(a)));
switch (p[8]) {
case "b":
a = a.toString(2);
break;
case "c":
a = t.fromCharCode(a);
break;
case "d":
a = parseInt(a, 10);
break;
case "e":
a = p[7] ? a.toExponential(p[7]) : a.toExponential();
break;
case "f":
a = p[7] ? parseFloat(a).toFixed(p[7]) : parseFloat(a);
break;
case "o":
a = a.toString(8);
break;
case "s":
a = (a = t(a)) && p[7] ? a.substring(0, p[7]) : a;
break;
case "u":
a = Math.abs(a);
break;
case "x":
a = a.toString(16);
break;
case "X":
a = a.toString(16).toUpperCase()
}
a = /[def]/.test(p[8]) && p[3] && a >= 0 ? "+" + a : a, v = p[4] ? p[4] == "0" ? "0" : p[4].charAt(1) : " ", m = p[6] - t(a).length, d = p[6] ? n(v, m) : "", f.push(p[5] ? a + d : d + a)
}
}
return f.join("")
}, r.cache = {}, r.parse = function(e) {
var t = e,
n = [],
r = [],
i = 0;
while (t) {
if ((n = /^[^\x25]+/.exec(t)) !== null) r.push(n[0]);
else if ((n = /^\x25{2
}/.exec(t)) !== null) r.push("%");
else {
if ((n = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(t)) === null) throw new Error("[_.sprintf] huh?");
if (n[2]) {
i |= 1;
var s = [],
o = n[2],
u = [];
if ((u = /^([a-z_][a-z_\d]*)/i.exec(o)) === null) throw new Error("[_.sprintf] huh?");
s.push(u[1]);
while ((o = o.substring(u[0].length)) !== "") if ((u = /^\.([a-z_][a-z_\d]*)/i.exec(o)) !== null) s.push(u[1]);
else {
if ((u = /^\[(\d+)\]/.exec(o)) === null) throw new Error("[_.sprintf] huh?");
s.push(u[1])
}
n[2] = s
} else i |= 2;
if (i === 3) throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");
r.push(n)
}
t = t.substring(n[0].length)
}
return r
}, r
}(),
p = {
VERSION: "2.3.0",
isBlank: function(e) {
return e == null && (e = ""), /^\s*$/.test(e)
},
stripTags: function(e) {
return e == null ? "" : t(e).replace(/<\/?[^>]+>/g, "")
},
capitalize: function(e) {
return e = e == null ? "" : t(e), e.charAt(0).toUpperCase() + e.slice(1)
},
chop: function(e, n) {
return e == null ? [] : (e = t(e), n = ~~n, n > 0 ? e.match(new RegExp(".{1," + n + "
}", "g")) : [e])
},
clean: function(e) {
return p.strip(e).replace(/\s+/g, " ")
},
count: function(e, n) {
if (e == null || n == null) return 0;
e = t(e), n = t(n);
var r = 0,
i = 0,
s = n.length;
for (;;) {
i = e.indexOf(n, i);
if (i === -1) break;
r++, i += s
}
return r
},
chars: function(e) {
return e == null ? [] : t(e).split("")
},
swapCase: function(e) {
return e == null ? "" : t(e).replace(/\S/g, function(e) {
return e === e.toUpperCase() ? e.toLowerCase() : e.toUpperCase()
})
},
escapeHTML: function(e) {
return e == null ? "" : t(e).replace(/[&<>"']/g, function(e) {
return "&" + l[e] + ";
"
})
},
unescapeHTML: function(e) {
return e == null ? "" : t(e).replace(/\&([^;
]+);
/g, function(e, n) {
var r;
return n in f ? f[n] : (r = n.match(/^#x([\da-fA-F]+)$/)) ? t.fromCharCode(parseInt(r[1], 16)) : (r = n.match(/^#(\d+)$/)) ? t.fromCharCode(~~r[1]) : e
})
},
escapeRegExp: function(e) {
return e == null ? "" : t(e).replace(/([.*+?^=!:${
}()|[\]\/\\])/g, "\\$1")
},
splice: function(e, t, n, r) {
var i = p.chars(e);
return i.splice(~~t, ~~n, r), i.join("")
},
insert: function(e, t, n) {
return p.splice(e, t, 0, n)
},
include: function(e, n) {
return n === "" ? !0 : e == null ? !1 : t(e).indexOf(n) !== -1
},
join: function() {
var e = u.call(arguments),
t = e.shift();
return t == null && (t = ""), e.join(t)
},
lines: function(e) {
return e == null ? [] : t(e).split("\n")
},
reverse: function(e) {
return p.chars(e).reverse().join("")
},
startsWith: function(e, n) {
return n === "" ? !0 : e == null || n == null ? !1 : (e = t(e), n = t(n), e.length >= n.length && e.slice(0, n.length) === n)
},
endsWith: function(e, n) {
return n === "" ? !0 : e == null || n == null ? !1 : (e = t(e), n = t(n), e.length >= n.length && e.slice(e.length - n.length) === n)
},
succ: function(e) {
return e == null ? "" : (e = t(e), e.slice(0, -1) + t.fromCharCode(e.charCodeAt(e.length - 1) + 1))
},
titleize: function(e) {
return e == null ? "" : t(e).replace(/(?:^|\s)\S/g, function(e) {
return e.toUpperCase()
})
},
camelize: function(e) {
return p.trim(e).replace(/[-_\s]+(.)?/g, function(e, t) {
return t.toUpperCase()
})
},
underscored: function(e) {
return p.trim(e).replace(/([a-z\d])([A-Z]+)/g, "$1_$2").replace(/[-\s]+/g, "_").toLowerCase()
},
dasherize: function(e) {
return p.trim(e).replace(/([A-Z])/g, "-$1").replace(/[-_\s]+/g, "-").toLowerCase()
},
classify: function(e) {
return p.titleize(t(e).replace(/[\W_]/g, " ")).replace(/\s/g, "")
},
humanize: function(e) {
return p.capitalize(p.underscored(e).replace(/_id$/, "").replace(/_/g, " "))
},
trim: function(e, r) {
return e == null ? "" : !r && n ? n.call(e) : (r = a(r), t(e).replace(new RegExp("^" + r + "+|" + r + "+$", "g"), ""))
},
ltrim: function(e, n) {
return e == null ? "" : !n && i ? i.call(e) : (n = a(n), t(e).replace(new RegExp("^" + n + "+"), ""))
},
rtrim: function(e, n) {
return e == null ? "" : !n && r ? r.call(e) : (n = a(n), t(e).replace(new RegExp(n + "+$"), ""))
},
truncate: function(e, n, r) {
return e == null ? "" : (e = t(e), r = r || "...", n = ~~n, e.length > n ? e.slice(0, n) + r : e)
},
prune: function(e, n, r) {
if (e == null) return "";
e = t(e), n = ~~n, r = r != null ? t(r) : "...";
if (e.length <= n) return e;
var i = function(e) {
return e.toUpperCase() !== e.toLowerCase() ? "A" : " "
},
s = e.slice(0, n + 1).replace(/.(?=\W*\w*$)/g, i);
return s.slice(s.length - 2).match(/\w\w/) ? s = s.replace(/\s*\S+$/, "") : s = p.rtrim(s.slice(0, s.length - 1)), (s + r).length > e.length ? e : e.slice(0, s.length) + r
},
words: function(e, t) {
return p.isBlank(e) ? [] : p.trim(e, t).split(t || /\s+/)
},
pad: function(e, n, r, i) {
e = e == null ? "" : t(e), n = ~~n;
var s = 0;
r ? r.length > 1 && (r = r.charAt(0)) : r = " ";
switch (i) {
case "right":
return s = n - e.length, e + o(r, s);
case "both":
return s = n - e.length, o(r, Math.ceil(s / 2)) + e + o(r, Math.floor(s / 2));
default:
return s = n - e.length, o(r, s) + e
}
},
lpad: function(e, t, n) {
return p.pad(e, t, n)
},
rpad: function(e, t, n) {
return p.pad(e, t, n, "right")
},
lrpad: function(e, t, n) {
return p.pad(e, t, n, "both")
},
sprintf: h,
vsprintf: function(e, t) {
return t.unshift(e), h.apply(null, t)
},
toNumber: function(e, t) {
return e ? (e = p.trim(e), e.match(/^-?\d+(?:\.\d+)?$/) ? s(s(e).toFixed(~~t)) : NaN) : 0
},
numberFormat: function(e, t, n, r) {
if (isNaN(e) || e == null) return "";
e = e.toFixed(~~t), r = typeof r == "string" ? r : ",";
var i = e.split("."),
s = i[0],
o = i[1] ? (n || ".") + i[1] : "";
return s.replace(/(\d)(?=(?:\d{3
})+$)/g, "$1" + r) + o
},
strRight: function(e, n) {
if (e == null) return "";
e = t(e), n = n != null ? t(n) : n;
var r = n ? e.indexOf(n) : -1;
return ~r ? e.slice(r + n.length, e.length) : e
},
strRightBack: function(e, n) {
if (e == null) return "";
e = t(e), n = n != null ? t(n) : n;
var r = n ? e.lastIndexOf(n) : -1;
return ~r ? e.slice(r + n.length, e.length) : e
},
strLeft: function(e, n) {
if (e == null) return "";
e = t(e), n = n != null ? t(n) : n;
var r = n ? e.indexOf(n) : -1;
return ~r ? e.slice(0, r) : e
},
strLeftBack: function(e, t) {
if (e == null) return "";
e += "", t = t != null ? "" + t : t;
var n = e.lastIndexOf(t);
return ~n ? e.slice(0, n) : e
},
toSentence: function(e, t, n, r) {
t = t || ", ", n = n || " and ";
var i = e.slice(),
s = i.pop();
return e.length > 2 && r && (n = p.rtrim(t) + n), i.length ? i.join(t) + n + s : s
},
toSentenceSerial: function() {
var e = u.call(arguments);
return e[3] = !0, p.toSentence.apply(p, e)
},
slugify: function(e) {
if (e == null) return "";
var n = "ąà áäâãåæćęèéëêìíïîłńòóöôõøśùúüûñçżź",
r = "aaaaaaaaceeeeeiiiilnoooooosuuuunczz",
i = new RegExp(a(n), "g");
return e = t(e).toLowerCase().replace(i, function(e) {
var t = n.indexOf(e);
return r.charAt(t) || "-"
}), p.dasherize(e.replace(/[^\w\s-]/g, ""))
},
surround: function(e, t) {
return [t, e, t].join("")
},
quote: function(e) {
return p.surround(e, '"')
},
exports: function() {
var e = {};
for (var t in this) {
if (!this.hasOwnProperty(t) || t.match(/^(?:include|contains|reverse)$/)) continue;
e[t] = this[t]
}
return e
},
repeat: function(e, n, r) {
if (e == null) return "";
n = ~~n;
if (r == null) return o(t(e), n);
for (var i = [];
n > 0;
i[--n] = e);
return i.join(r)
},
naturalCmp: function(e, n) {
if (e == n) return 0;
if (!e) return -1;
if (!n) return 1;
var r = /(\.\d+)|(\d+)|(\D+)/g,
i = t(e).toLowerCase().match(r),
s = t(n).toLowerCase().match(r),
o = Math.min(i.length, s.length);
for (var u = 0;
u < o;
u++) {
var a = i[u],
f = s[u];
if (a !== f) {
var l = parseInt(a, 10);
if (!isNaN(l)) {
var c = parseInt(f, 10);
if (!isNaN(c) && l - c) return l - c
}
return a < f ? -1 : 1
}
}
return i.length === s.length ? i.length - s.length : e < n ? -1 : 1
},
levenshtein: function(e, n) {
if (e == null && n == null) return 0;
if (e == null) return t(n).length;
if (n == null) return t(e).length;
e = t(e), n = t(n);
var r = [],
i, s;
for (var o = 0;
o <= n.length;
o++) for (var u = 0;
u <= e.length;
u++) o && u ? e.charAt(u - 1) === n.charAt(o - 1) ? s = i : s = Math.min(r[u], r[u - 1], i) + 1 : s = o + u, i = r[u], r[u] = s;
return r.pop()
}
};
p.strip = p.trim, p.lstrip = p.ltrim, p.rstrip = p.rtrim, p.center = p.lrpad, p.rjust = p.lpad, p.ljust = p.rpad, p.contains = p.include, p.q = p.quote, typeof exports != "undefined" && (typeof module != "undefined" && module.exports && (module.exports = p), exports._s = p), typeof define == "function" && define.amd && define("underscore.string", [], function() {
return p
}), e._ = e._ || {}, e._.string = e._.str = p
}(this, String), define("vendor/underscore.string", ["vendor/lodash"], function(e) {
return function() {
var t, n;
return t || e._.str
}
}(this)), function() {
var e = this,
t = e.Backbone,
n = [],
r = n.push,
i = n.slice,
s = n.splice,
o;
typeof exports != "undefined" ? o = exports : o = e.Backbone = {}, o.VERSION = "1.0.0";
var u = e._;
!u && typeof require != "undefined" && (u = require("underscore")), o.$ = e.jQuery || e.Zepto || e.ender || e.$, o.noConflict = function() {
return e.Backbone = t, this
}, o.emulateHTTP = !1, o.emulateJSON = !1;
var a = o.Events = {
on: function(e, t, n) {
if (!l(this, "on", e, [t, n]) || !t) return this;
this._events || (this._events = {});
var r = this._events[e] || (this._events[e] = []);
return r.push({
callback: t,
context: n,
ctx: n || this
}), this
},
once: function(e, t, n) {
if (!l(this, "once", e, [t, n]) || !t) return this;
var r = this,
i = u.once(function() {
r.off(e, i), t.apply(this, arguments)
});
return i._callback = t, this.on(e, i, n)
},
off: function(e, t, n) {
var r, i, s, o, a, f, c, h;
if (!this._events || !l(this, "off", e, [t, n])) return this;
if (!e && !t && !n) return this._events = {}, this;
o = e ? [e] : u.keys(this._events);
for (a = 0, f = o.length;
a < f;
a++) {
e = o[a];
if (s = this._events[e]) {
this._events[e] = r = [];
if (t || n) for (c = 0, h = s.length;
c < h;
c++) i = s[c], (t && t !== i.callback && t !== i.callback._callback || n && n !== i.context) && r.push(i);
r.length || delete this._events[e]
}
}
return this
},
trigger: function(e) {
if (!this._events) return this;
var t = i.call(arguments, 1);
if (!l(this, "trigger", e, t)) return this;
var n = this._events[e],
r = this._events.all;
return n && c(n, t), r && c(r, arguments), this
},
stopListening: function(e, t, n) {
var r = this._listeners;
if (!r) return this;
var i = !t && !n;
typeof t == "object" && (n = this), e && ((r = {})[e._listenerId] = e);
for (var s in r) r[s].off(t, n, this), i && delete this._listeners[s];
return this
}
},
f = /\s+/,
l = function(e, t, n, r) {
if (!n) return !0;
if (typeof n == "object") {
for (var i in n) e[t].apply(e, [i, n[i]].concat(r));
return !1
}
if (f.test(n)) {
var s = n.split(f);
for (var o = 0, u = s.length;
o < u;
o++) e[t].apply(e, [s[o]].concat(r));
return !1
}
return !0
},
c = function(e, t) {
var n, r = -1,
i = e.length,
s = t[0],
o = t[1],
u = t[2];
switch (t.length) {
case 0:
while (++r < i)(n = e[r]).callback.call(n.ctx);
return;
case 1:
while (++r < i)(n = e[r]).callback.call(n.ctx, s);
return;
case 2:
while (++r < i)(n = e[r]).callback.call(n.ctx, s, o);
return;
case 3:
while (++r < i)(n = e[r]).callback.call(n.ctx, s, o, u);
return;
default:
while (++r < i)(n = e[r]).callback.apply(n.ctx, t)
}
},
h = {
listenTo: "on",
listenToOnce: "once"
};
u.each(h, function(e, t) {
a[t] = function(t, n, r) {
var i = this._listeners || (this._listeners = {}),
s = t._listenerId || (t._listenerId = u.uniqueId("l"));
return i[s] = t, typeof n == "object" && (r = this), t[e](n, r, this), this
}
}), a.bind = a.on, a.unbind = a.off, u.extend(o, a);
var p = o.Model = function(e, t) {
var n, r = e || {};
t || (t = {}), this.cid = u.uniqueId("c"), this.attributes = {}, t.collection && (this.collection = t.collection), t.parse && (r = this.parse(r, t) || {});
if (n = u.result(this, "defaults")) r = u.defaults({}, r, n);
this.set(r, t), this.changed = {}, this.initialize.apply(this, arguments)
};
u.extend(p.prototype, a, {
changed: null,
validationError: null,
idAttribute: "id",
initialize: function() {},
toJSON: function(e) {
return u.clone(this.attributes)
},
sync: function() {
return o.sync.apply(this, arguments)
},
get: function(e) {
return this.attributes[e]
},
escape: function(e) {
return u.escape(this.get(e))
},
has: function(e) {
return this.get(e) != null
},
set: function(e, t, n) {
var r, i, s, o, a, f, l, c;
if (e == null) return this;
typeof e == "object" ? (i = e, n = t) : (i = {})[e] = t, n || (n = {});
if (!this._validate(i, n)) return !1;
s = n.unset, a = n.silent, o = [], f = this._changing, this._changing = !0, f || (this._previousAttributes = u.clone(this.attributes), this.changed = {}), c = this.attributes, l = this._previousAttributes, this.idAttribute in i && (this.id = i[this.idAttribute]);
for (r in i) t = i[r], u.isEqual(c[r], t) || o.push(r), u.isEqual(l[r], t) ? delete this.changed[r] : this.changed[r] = t, s ? delete c[r] : c[r] = t;
if (!a) {
o.length && (this._pending = !0);
for (var h = 0, p = o.length;
h < p;
h++) this.trigger("change:" + o[h], this, c[o[h]], n)
}
if (f) return this;
if (!a) while (this._pending) this._pending = !1, this.trigger("change", this, n);
return this._pending = !1, this._changing = !1, this
},
unset: function(e, t) {
return this.set(e, void 0, u.extend({}, t, {
unset: !0
}))
},
clear: function(e) {
var t = {};
for (var n in this.attributes) t[n] = void 0;
return this.set(t, u.extend({}, e, {
unset: !0
}))
},
hasChanged: function(e) {
return e == null ? !u.isEmpty(this.changed) : u.has(this.changed, e)
},
changedAttributes: function(e) {
if (!e) return this.hasChanged() ? u.clone(this.changed) : !1;
var t, n = !1,
r = this._changing ? this._previousAttributes : this.attributes;
for (var i in e) {
if (u.isEqual(r[i], t = e[i])) continue;
(n || (n = {}))[i] = t
}
return n
},
previous: function(e) {
return e == null || !this._previousAttributes ? null : this._previousAttributes[e]
},
previousAttributes: function() {
return u.clone(this._previousAttributes)
},
fetch: function(e) {
e = e ? u.clone(e) : {}, e.parse === void 0 && (e.parse = !0);
var t = this,
n = e.success;
return e.success = function(r) {
if (!t.set(t.parse(r, e), e)) return !1;
n && n(t, r, e), t.trigger("sync", t, r, e)
}, B(this, e), this.sync("read", this, e)
},
save: function(e, t, n) {
var r, i, s, o = this.attributes;
e == null || typeof e == "object" ? (r = e, n = t) : (r = {})[e] = t, n = u.extend({
validate: !0
}, n);
if (r && !n.wait) {
if (!this.set(r, n)) return !1
} else if (!this._validate(r, n)) return !1;
r && n.wait && (this.attributes = u.extend({}, o, r)), n.parse === void 0 && (n.parse = !0);
var a = this,
f = n.success;
return n.success = function(e) {
a.attributes = o;
var t = a.parse(e, n);
n.wait && (t = u.extend(r || {}, t));
if (u.isObject(t) && !a.set(t, n)) return !1;
f && f(a, e, n), a.trigger("sync", a, e, n)
}, B(this, n), i = this.isNew() ? "create" : n.patch ? "patch" : "update", i === "patch" && (n.attrs = r), s = this.sync(i, this, n), r && n.wait && (this.attributes = o), s
},
destroy: function(e) {
e = e ? u.clone(e) : {};
var t = this,
n = e.success,
r = function() {
t.trigger("destroy", t, t.collection, e)
};
e.success = function(i) {
(e.wait || t.isNew()) && r(), n && n(t, i, e), t.isNew() || t.trigger("sync", t, i, e)
};
if (this.isNew()) return e.success(), !1;
B(this, e);
var i = this.sync("delete", this, e);
return e.wait || r(), i
},
url: function() {
var e = u.result(this, "urlRoot") || u.result(this.collection, "url") || H();
return this.isNew() ? e : e + (e.charAt(e.length - 1) === "/" ? "" : "/") + encodeURIComponent(this.id)
},
parse: function(e, t) {
return e
},
clone: function() {
return new this.constructor(this.attributes)
},
isNew: function() {
return this.id == null
},
isValid: function(e) {
return this._validate({}, u.extend(e || {}, {
validate: !0
}))
},
_validate: function(e, t) {
if (!t.validate || !this.validate) return !0;
e = u.extend({}, this.attributes, e);
var n = this.validationError = this.validate(e, t) || null;
return n ? (this.trigger("invalid", this, n, u.extend(t || {}, {
validationError: n
})), !1) : !0
}
});
var d = ["keys", "values", "pairs", "invert", "pick", "omit"];
u.each(d, function(e) {
p.prototype[e] = function() {
var t = i.call(arguments);
return t.unshift(this.attributes), u[e].apply(u, t)
}
});
var v = o.Collection = function(e, t) {
t || (t = {}), t.model && (this.model = t.model), t.comparator !== void 0 && (this.comparator = t.comparator), this._reset(), this.initialize.apply(this, arguments), e && this.reset(e, u.extend({
silent: !0
}, t))
},
m = {
add: !0,
remove: !0,
merge: !0
},
g = {
add: !0,
merge: !1,
remove: !1
};
u.extend(v.prototype, a, {
model: p,
initialize: function() {},
toJSON: function(e) {
return this.map(function(t) {
return t.toJSON(e)
})
},
sync: function() {
return o.sync.apply(this, arguments)
},
add: function(e, t) {
return this.set(e, u.defaults(t || {}, g))
},
remove: function(e, t) {
e = u.isArray(e) ? e.slice() : [e], t || (t = {});
var n, r, i, s;
for (n = 0, r = e.length;
n < r;
n++) {
s = this.get(e[n]);
if (!s) continue;
delete this._byId[s.id], delete this._byId[s.cid], i = this.indexOf(s), this.models.splice(i, 1), this.length--, t.silent || (t.index = i, s.trigger("remove", s, this, t)), this._removeReference(s)
}
return this
},
set: function(e, t) {
t = u.defaults(t || {}, m), t.parse && (e = this.parse(e, t)), u.isArray(e) || (e = e ? [e] : []);
var n, i, o, a, f, l, c = t.at,
h = this.comparator && c == null && t.sort !== !1,
p = u.isString(this.comparator) ? this.comparator : null,
d = [],
v = [],
g = {},
y = t.add,
b = t.merge,
w = t.remove,
E = !h && y && w ? [] : !1;
for (n = 0, i = e.length;
n < i;
n++) {
if (!(o = this._prepareModel(e[n], t))) continue;
(f = this.get(o)) ? (w && (g[f.cid] = !0), b && (f.set(o.attributes, t), h && !l && f.hasChanged(p) && (l = !0))) : y && (d.push(o), o.on("all", this._onModelEvent, this), this._byId[o.cid] = o, o.id != null && (this._byId[o.id] = o)), E && E.push(f || o)
}
if (w) {
for (n = 0, i = this.length;
n < i; ++n) g[(o = this.models[n]).cid] || v.push(o);
v.length && this.remove(v, t)
}
if (d.length || E && E.length) h && (l = !0), this.length += d.length, c != null ? s.apply(this.models, [c, 0].concat(d)) : (E && (this.models.length = 0), r.apply(this.models, E || d));
l && this.sort({
silent: !0
});
if (t.silent) return this;
for (n = 0, i = d.length;
n < i;
n++)(o = d[n]).trigger("add", o, this, t);
return (l || E && E.length) && this.trigger("sort", this, t), this
},
reset: function(e, t) {
t || (t = {});
for (var n = 0, r = this.models.length;
n < r;
n++) this._removeReference(this.models[n]);
return t.previousModels = this.models, this._reset(), this.add(e, u.extend({
silent: !0
}, t)), t.silent || this.trigger("reset", this, t), this
},
push: function(e, t) {
return e = this._prepareModel(e, t), this.add(e, u.extend({
at: this.length
}, t)), e
},
pop: function(e) {
var t = this.at(this.length - 1);
return this.remove(t, e), t
},
unshift: function(e, t) {
return e = this._prepareModel(e, t), this.add(e, u.extend({
at: 0
}, t)), e
},
shift: function(e) {
var t = this.at(0);
return this.remove(t, e), t
},
slice: function() {
return i.apply(this.models, arguments)
},
get: function(e) {
return e == null ? void 0 : this._byId[e.id != null ? e.id : e.cid || e]
},
at: function(e) {
return this.models[e]
},
where: function(e, t) {
return u.isEmpty(e) ? t ? void 0 : [] : this[t ? "find" : "filter"](function(t) {
for (var n in e) if (e[n] !== t.get(n)) return !1;
return !0
})
},
findWhere: function(e) {
return this.where(e, !0)
},
sort: function(e) {
if (!this.comparator) throw new Error("Cannot sort a set without a comparator");
return e || (e = {}), u.isString(this.comparator) || this.comparator.length === 1 ? this.models = this.sortBy(this.comparator, this) : this.models.sort(u.bind(this.comparator, this)), e.silent || this.trigger("sort", this, e), this
},
sortedIndex: function(e, t, n) {
t || (t = this.comparator);
var r = u.isFunction(t) ? t : function(e) {
return e.get(t)
};
return u.sortedIndex(this.models, e, r, n)
},
pluck: function(e) {
return u.invoke(this.models, "get", e)
},
fetch: function(e) {
e = e ? u.clone(e) : {}, e.parse === void 0 && (e.parse = !0);
var t = e.success,
n = this;
return e.success = function(r) {
var i = e.reset ? "reset" : "set";
n[i](r, e), t && t(n, r, e), n.trigger("sync", n, r, e)
}, B(this, e), this.sync("read", this, e)
},
create: function(e, t) {
t = t ? u.clone(t) : {};
if (!(e = this._prepareModel(e, t))) return !1;
t.wait || this.add(e, t);
var n = this,
r = t.success;
return t.success = function(i) {
t.wait && n.add(e, t), r && r(e, i, t)
}, e.save(null, t), e
},
parse: function(e, t) {
return e
},
clone: function() {
return new this.constructor(this.models)
},
_reset: function() {
this.length = 0, this.models = [], this._byId = {}
},
_prepareModel: function(e, t) {
if (e instanceof p) return e.collection || (e.collection = this), e;
t || (t = {}), t.collection = this;
var n = new this.model(e, t);
return n._validate(e, t) ? n : (this.trigger("invalid", this, e, t), !1)
},
_removeReference: function(e) {
this === e.collection && delete e.collection, e.off("all", this._onModelEvent, this)
},
_onModelEvent: function(e, t, n, r) {
if ((e === "add" || e === "remove") && n !== this) return;
e === "destroy" && this.remove(t, r), t && e === "change:" + t.idAttribute && (delete this._byId[t.previous(t.idAttribute)], t.id != null && (this._byId[t.id] = t)), this.trigger.apply(this, arguments)
}
});
var y = ["forEach", "each", "map", "collect", "reduce", "foldl", "inject", "reduceRight", "foldr", "find", "detect", "filter", "select", "reject", "every", "all", "some", "any", "include", "contains", "invoke", "max", "min", "toArray", "size", "first", "head", "take", "initial", "rest", "tail", "drop", "last", "without", "indexOf", "shuffle", "lastIndexOf", "isEmpty", "chain"];
u.each(y, function(e) {
v.prototype[e] = function() {
var t = i.call(arguments);
return t.unshift(this.models), u[e].apply(u, t)
}
});
var b = ["groupBy", "countBy", "sortBy"];
u.each(b, function(e) {
v.prototype[e] = function(t, n) {
var r = u.isFunction(t) ? t : function(e) {
return e.get(t)
};
return u[e](this.models, r, n)
}
});
var w = o.View = function(e) {
this.cid = u.uniqueId("view"), this._configure(e || {}), this._ensureElement(), this.initialize.apply(this, arguments), this.delegateEvents()
},
E = /^(\S+)\s*(.*)$/,
S = ["model", "collection", "el", "id", "attributes", "className", "tagName", "events"];
u.extend(w.prototype, a, {
tagName: "div",
$: function(e) {
return this.$el.find(e)
},
initialize: function() {},
render: function() {
return this
},
remove: function() {
return this.$el.remove(), this.stopListening(), this
},
setElement: function(e, t) {
return this.$el && this.undelegateEvents(), this.$el = e instanceof o.$ ? e : o.$(e), this.el = this.$el[0], t !== !1 && this.delegateEvents(), this
},
delegateEvents: function(e) {
if (!e && !(e = u.result(this, "events"))) return this;
this.undelegateEvents();
for (var t in e) {
var n = e[t];
u.isFunction(n) || (n = this[e[t]]);
if (!n) continue;
var r = t.match(E),
i = r[1],
s = r[2];
n = u.bind(n, this), i += ".delegateEvents" + this.cid, s === "" ? this.$el.on(i, n) : this.$el.on(i, s, n)
}
return this
},
undelegateEvents: function() {
return this.$el.off(".delegateEvents" + this.cid), this
},
_configure: function(e) {
this.options && (e = u.extend({}, u.result(this, "options"), e)), u.extend(this, u.pick(e, S)), this.options = e
},
_ensureElement: function() {
if (!this.el) {
var e = u.extend({}, u.result(this, "attributes"));
this.id && (e.id = u.result(this, "id")), this.className && (e["class"] = u.result(this, "className"));
var t = o.$("<" + u.result(this, "tagName") + ">").attr(e);
this.setElement(t, !1)
} else this.setElement(u.result(this, "el"), !1)
}
}), o.sync = function(e, t, n) {
var r = x[e];
u.defaults(n || (n = {}), {
emulateHTTP: o.emulateHTTP,
emulateJSON: o.emulateJSON
});
var i = {
type: r,
dataType: "json"
};
n.url || (i.url = u.result(t, "url") || H()), n.data == null && t && (e === "create" || e === "update" || e === "patch") && (i.contentType = "application/json", i.data = JSON.stringify(n.attrs || t.toJSON(n))), n.emulateJSON && (i.contentType = "application/x-www-form-urlencoded", i.data = i.data ? {
model: i.data
} : {});
if (n.emulateHTTP && (r === "PUT" || r === "DELETE" || r === "PATCH")) {
i.type = "POST", n.emulateJSON && (i.data._method = r);
var s = n.beforeSend;
n.beforeSend = function(e) {
e.setRequestHeader("X-HTTP-Method-Override", r);
if (s) return s.apply(this, arguments)
}
}
i.type !== "GET" && !n.emulateJSON && (i.processData = !1), i.type === "PATCH" && window.ActiveXObject && (!window.external || !window.external.msActiveXFilteringEnabled) && (i.xhr = function() {
return new ActiveXObject("Microsoft.XMLHTTP")
});
var a = n.xhr = o.ajax(u.extend(i, n));
return t.trigger("request", t, a, n), a
};
var x = {
create: "POST",
update: "PUT",
patch: "PATCH",
"delete": "DELETE",
read: "GET"
};
o.ajax = function() {
return o.$.ajax.apply(o.$, arguments)
};
var T = o.Router = function(e) {
e || (e = {}), e.routes && (this.routes = e.routes), this._bindRoutes(), this.initialize.apply(this, arguments)
},
N = /\((.*?)\)/g,
C = /(\(\?)?:\w+/g,
k = /\*\w+/g,
L = /[\-{
}\[\]+?.,\\\^$|#\s]/g;
u.extend(T.prototype, a, {
initialize: function() {},
route: function(e, t, n) {
u.isRegExp(e) || (e = this._routeToRegExp(e)), u.isFunction(t) && (n = t, t = ""), n || (n = this[t]);
var r = this;
return o.history.route(e, function(i) {
var s = r._extractParameters(e, i);
n && n.apply(r, s), r.trigger.apply(r, ["route:" + t].concat(s)), r.trigger("route", t, s), o.history.trigger("route", r, t, s)
}), this
},
navigate: function(e, t) {
return o.history.navigate(e, t), this
},
_bindRoutes: function() {
if (!this.routes) return;
this.routes = u.result(this, "routes");
var e, t = u.keys(this.routes);
while ((e = t.pop()) != null) this.route(e, this.routes[e])
},
_routeToRegExp: function(e) {
return e = e.replace(L, "\\$&").replace(N, "(?:$1)?").replace(C, function(e, t) {
return t ? e : "([^/]+)"
}).replace(k, "(.*?)"), new RegExp("^" + e + "$")
},
_extractParameters: function(e, t) {
var n = e.exec(t).slice(1);
return u.map(n, function(e) {
return e ? decodeURIComponent(e) : null
})
}
});
var A = o.History = function() {
this.handlers = [], u.bindAll(this, "checkUrl"), typeof window != "undefined" && (this.location = window.location, this.history = window.history)
},
O = /^[#\/]|\s+$/g,
M = /^\/+|\/+$/g,
_ = /msie [\w.]+/,
D = /\/$/;
A.started = !1, u.extend(A.prototype, a, {
interval: 50,
getHash: function(e) {
var t = (e || this).location.href.match(/#(.*)$/);
return t ? t[1] : ""
},
getFragment: function(e, t) {
if (e == null) if (this._hasPushState || !this._wantsHashChange || t) {
e = this.location.pathname;
var n = this.root.replace(D, "");
e.indexOf(n) || (e = e.substr(n.length))
} else e = this.getHash();
return e.replace(O, "")
},
start: function(e) {
if (A.started) throw new Error("Backbone.history has already been started");
A.started = !0, this.options = u.extend({}, {
root: "/"
}, this.options, e), this.root = this.options.root, this._wantsHashChange = this.options.hashChange !== !1, this._wantsPushState = !! this.options.pushState, this._hasPushState = !! (this.options.pushState && this.history && this.history.pushState);
var t = this.getFragment(),
n = document.documentMode,
r = _.exec(navigator.userAgent.toLowerCase()) && (!n || n <= 7);
this.root = ("/" + this.root + "/").replace(M, "/"), r && this._wantsHashChange && (this.iframe = o.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow, this.navigate(t)), this._hasPushState ? o.$(window).on("popstate", this.checkUrl) : this._wantsHashChange && "onhashchange" in window && !r ? o.$(window).on("hashchange", this.checkUrl) : this._wantsHashChange && (this._checkUrlInterval = setInterval(this.checkUrl, this.interval)), this.fragment = t;
var i = this.location,
s = i.pathname.replace(/[^\/]$/, "$&/") === this.root;
if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !s) return this.fragment = this.getFragment(null, !0), this.location.replace(this.root + this.location.search + "#" + this.fragment), !0;
this._wantsPushState && this._hasPushState && s && i.hash && (this.fragment = this.getHash().replace(O, ""), this.history.replaceState({}, document.title, this.root + this.fragment + i.search));
if (!this.options.silent) return this.loadUrl()
},
stop: function() {
o.$(window).off("popstate", this.checkUrl).off("hashchange", this.checkUrl), clearInterval(this._checkUrlInterval), A.started = !1
},
route: function(e, t) {
this.handlers.unshift({
route: e,
callback: t
})
},
checkUrl: function(e) {
var t = this.getFragment();
t === this.fragment && this.iframe && (t = this.getFragment(this.getHash(this.iframe)));
if (t === this.fragment) return !1;
this.iframe && this.navigate(t), this.loadUrl() || this.loadUrl(this.getHash())
},
loadUrl: function(e) {
var t = this.fragment = this.getFragment(e),
n = u.any(this.handlers, function(e) {
if (e.route.test(t)) return e.callback(t), !0
});
return n
},
navigate: function(e, t) {
if (!A.started) return !1;
if (!t || t === !0) t = {
trigger: t
};
e = this.getFragment(e || "");
if (this.fragment === e) return;
this.fragment = e;
var n = this.root + e;
if (this._hasPushState) this.history[t.replace ? "replaceState" : "pushState"]({}, document.title, n);
else {
if (!this._wantsHashChange) return this.location.assign(n);
this._updateHash(this.location, e, t.replace), this.iframe && e !== this.getFragment(this.getHash(this.iframe)) && (t.replace || this.iframe.document.open().close(), this._updateHash(this.iframe.location, e, t.replace))
}
if (t.trigger) return this.loadUrl(e)
},
_updateHash: function(e, t, n) {
if (n) {
var r = e.href.replace(/(javascript:|#).*$/, "");
e.replace(r + "#" + t)
} else e.hash = "#" + t
}
}), o.history = new A;
var P = function(e, t) {
var n = this,
r;
e && u.has(e, "constructor") ? r = e.constructor : r = function() {
return n.apply(this, arguments)
}, u.extend(r, n, t);
var i = function() {
this.constructor = r
};
return i.prototype = n.prototype, r.prototype = new i, e && u.extend(r.prototype, e), r.__super__ = n.prototype, r
};
p.extend = v.extend = T.extend = w.extend = A.extend = P;
var H = function() {
throw new Error('A "url" property or function must be specified')
},
B = function(e, t) {
var n = t.error;
t.error = function(r) {
n && n(e, r, t), e.trigger("error", e, r, t)
}
}
}.call(this), define("vendor/backbone", ["vendor/lodash"], function(e) {
return function() {
var t, n;
return t || e.Backbone
}
}(this)), function(e, t) {
t(_, Backbone)
}(this, function(e, t) {
function n() {
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1)
}
function r() {
return n() + n() + "-" + n() + "-" + n() + "-" + n() + "-" + n() + n() + n()
}
t.readerSync = function(n, r, s) {
var o = i[n];
e.defaults(s || (s = {}), {
emulateHTTP: t.emulateHTTP,
emulateJSON: t.emulateJSON
});
var u = {
type: o,
dataType: "json"
};
s.url || (u.url = e.result(r, "url") || urlError());
if (n === "create" || n === "update" || n === "patch") {
u.contentType = "application/x-www-form-urlencoded";
var a = s.attrs || r.toJSON(s);
r.url === "/reader/settings" && (a = {
settings: JSON.stringify(a)
}), a.token = rdr.getToken(), u.data = $.param(a)
} else u.data = $.param({
token: rdr.getToken()
});
if (s.emulateHTTP && (o === "PUT" || o === "DELETE" || o === "PATCH")) {
u.type = "POST", s.emulateJSON && (u.data._method = o);
var f = s.beforeSend;
s.beforeSend = function(e) {
e.setRequestHeader("X-HTTP-Method-Override", o);
if (f) return f.apply(this, arguments)
}
}
u.type !== "GET" && !s.emulateJSON && (u.processData = !1), u.type === "PATCH" && window.ActiveXObject && (!window.external || !window.external.msActiveXFilteringEnabled) && (u.xhr = function() {
return new ActiveXObject("Microsoft.XMLHTTP")
});
var l = s.xhr = t.ajax(e.extend(u, s));
return r.trigger("request", r, l, s), l
};
var i = {
create: "POST",
update: "PUT",
patch: "POST",
"delete": "DELETE",
read: "GET"
};
return t.ajaxSync = t.sync, t.getSyncMethod = function(e) {
return t.readerSync
}, t.sync = function(e, n, r) {
return t.getSyncMethod(n).apply(this, [e, n, r])
}, t
}), define("vendor/backbone.readerSync", ["vendor/backbone"], function(e) {
return function() {
var t, n;
return t || e.Backbone.readerSync
}
}(this)), this.Handlebars = {}, function(e) {
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 undefined;
throw new Error("Could not find property '" + e + "'")
});
var t = Object.prototype.toString,
n = "[object Function]";
e.registerHelper("blockHelperMissing", function(r, i) {
var s = i.inverse ||
function() {}, o = i.fn, u = "", a = t.call(r);
return a === n && (r = r.call(this)), r === !0 ? o(this) : r === !1 || r == null ? s(this) : a === "[object Array]" ? r.length > 0 ? e.helpers.each(r, i) : s(this) : o(r)
}), 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(r, i) {
var s = t.call(r);
return s === n && (r = r.call(this)), !r || e.Utils.isEmpty(r) ? i.inverse(this) : i.fn(this)
}), e.registerHelper("unless", function(t, n) {
var r = n.fn,
i = n.inverse;
return n.fn = i, n.inverse = r, e.helpers["if"].call(this, t, n)
}), 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)
})
}(this.Handlebars);
var handlebars = 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
}();
Handlebars.Parser = handlebars, Handlebars.parse = function(e) {
return e.constructor === Handlebars.AST.ProgramNode ? e : (Handlebars.Parser.yy = Handlebars.AST, Handlebars.Parser.parse(e))
}, Handlebars.print = function(e) {
return (new Handlebars.PrintVisitor).accept(e)
}, function() {
Handlebars.AST = {}, Handlebars.AST.ProgramNode = function(e, t) {
this.type = "program", this.statements = e, t && (this.inverse = new Handlebars.AST.ProgramNode(t))
}, Handlebars.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)
}, Handlebars.AST.PartialNode = function(e, t) {
this.type = "partial", this.partialName = e, this.context = t
};
var e = function(e, t) {
if (e.original !== t.original) throw new Handlebars.Exception(e.original + " doesn't match " + t.original)
};
Handlebars.AST.BlockNode = function(t, n, r, i) {
e(t.id, i), this.type = "block", this.mustache = t, this.program = n, this.inverse = r, this.inverse && !this.program && (this.isInverse = !0)
}, Handlebars.AST.ContentNode = function(e) {
this.type = "content", this.string = e
}, Handlebars.AST.HashNode = function(e) {
this.type = "hash", this.pairs = e
}, Handlebars.AST.IdNode = function(e) {
this.type = "ID", this.original = e.join(".");
var t = [],
n = 0;
for (var r = 0, i = e.length;
r < i;
r++) {
var s = e[r];
if (s === ".." || s === "." || s === "this") {
if (t.length > 0) throw new Handlebars.Exception("Invalid path: " + this.original);
s === ".." ? n++ : this.isScoped = !0
} else t.push(s)
}
this.parts = t, this.string = t.join("."), this.depth = n, this.isSimple = e.length === 1 && !this.isScoped && n === 0, this.stringModeValue = this.string
}, Handlebars.AST.PartialNameNode = function(e) {
this.type = "PARTIAL_NAME", this.name = e
}, Handlebars.AST.DataNode = function(e) {
this.type = "DATA", this.id = e
}, Handlebars.AST.StringNode = function(e) {
this.type = "STRING", this.string = e, this.stringModeValue = e
}, Handlebars.AST.IntegerNode = function(e) {
this.type = "INTEGER", this.integer = e, this.stringModeValue = Number(e)
}, Handlebars.AST.BooleanNode = function(e) {
this.type = "BOOLEAN", this.bool = e, this.stringModeValue = e === "true"
}, Handlebars.AST.CommentNode = function(e) {
this.type = "comment", this.comment = e
}
}();
var errorProps = ["description", "fileName", "lineNumber", "message", "name", "number", "stack"];
Handlebars.Exception = function(e) {
var t = Error.prototype.constructor.apply(this, arguments);
for (var n = 0;
n < errorProps.length;
n++) this[errorProps[n]] = t[errorProps[n]]
}, Handlebars.Exception.prototype = new Error, Handlebars.SafeString = function(e) {
this.string = e
}, Handlebars.SafeString.prototype.toString = function() {
return this.string.toString()
}, function() {
var e = {
"&": "&amp;
",
"<": "&lt;
",
">": "&gt;
",
'"': "&quot;
",
"'": "&#x27;
",
"`": "&#x60;
"
},
t = /[&<>"'`]/g,
n = /[&<>"'`]/,
r = function(t) {
return e[t] || "&amp;
"
};
Handlebars.Utils = {
escapeExpression: function(e) {
return e instanceof Handlebars.SafeString ? e.toString() : e == null || e === !1 ? "" : n.test(e) ? e.replace(t, r) : e
},
isEmpty: function(e) {
return !e && e !== 0 ? !0 : Object.prototype.toString.call(e) === "[object Array]" && e.length === 0 ? !0 : !1
}
}
}(), Handlebars.Compiler = function() {}, Handlebars.JavaScriptCompiler = function() {}, function(e, t) {
e.prototype = {
compiler: e,
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
}
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 n = function(e) {
this.value = e
};
t.prototype = {
nameLookup: function(e, n) {
return /^[0-9]+$/.test(n) ? e + "[" + n + "]" : t.isValidJavaScriptVariableName(n) ? e + "." + n : e + "['" + n + "']"
},
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(e, t, n, r) {
this.environment = e, this.options = t || {}, Handlebars.log(Handlebars.logger.DEBUG, this.environment.disassemble() + "\n\n"), this.name = this.environment.name, this.isChild = !! n, this.context = n || {
programs: [],
environments: [],
aliases: {}
}, this.preamble(), this.stackSlot = 0, this.stackVars = [], this.registers = {
list: []
}, this.compileStack = [], this.inlineStack = [], this.compileChildren(e, t);
var i = e.opcodes,
s;
this.i = 0;
for (o = i.length;
this.i < o;
this.i++) s = i[this.i], s.opcode === "DECLARE" ? this[s.name] = s.value : this[s.opcode].apply(this, s.args);
return this.createFunctionContext(r)
},
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(e) {
var t = this.stackVars.concat(this.registers.list);
t.length > 0 && (this.source[1] = this.source[1] + ", " + t.join(", "));
if (!this.isChild) for (var n in this.context.aliases) this.source[1] = this.source[1] + ", " + n + "=" + this.context.aliases[n];
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 r = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"];
for (var i = 0, s = this.environment.depths.list.length;
i < s;
i++) r.push("depth" + this.environment.depths.list[i]);
var o = this.mergeSource();
if (!this.isChild) {
var u = Handlebars.COMPILER_REVISION,
a = Handlebars.REVISION_CHANGES[u];
o = "this.compilerInfo = [" + u + ",'" + a + "'];
\n" + o
}
if (e) return r.push(o), Function.apply(this, r);
var f = "function " + (this.name || "") + "(" + r.join(",") + ")
{
\n " + o + "
}";
return Handlebars.log(Handlebars.logger.DEBUG, f + "\n\n"), f
},
mergeSource: function() {
var e = "",
t;
for (var n = 0, r = this.source.length;
n < r;
n++) {
var i = this.source[n];
i.appendToBuffer ? t ? t = t + "\n + " + i.content : t = i.content : (t && (e += "buffer += " + t + ";
\n ", t = undefined), e += i + "\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 = undefined, 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: t,
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 n(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 = "",
r = this.isInline(),
i;
if (r) {
var s = this.popStack(!0);
if (s instanceof n) i = s.value;
else {
var o = this.stackSlot ? this.topStackName() : this.incrStack();
t = "(" + this.push(o) + " = " + s + "),", i = this.topStack()
}
} else i = this.topStack();
var u = e.call(this, i);
return r ? ((this.inlineStack.length || this.compileStack.length) && this.popStack(), this.push("(" + t + u + ")")) : (/^stack/.test(i) || (i = this.nextStack()), this.source.push(i + " = (" + t + u + ");
")), i
},
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, r = e.length;
t < r;
t++) {
var i = e[t];
i instanceof n ? this.compileStack.push(i) : this.pushStack(i)
}
}
},
isInline: function() {
return this.inlineStack.length
},
popStack: function(e) {
var t = this.isInline(),
r = (t ? this.inlineStack : this.compileStack).pop();
return !e && r instanceof n ? r.value : (t || this.stackSlot--, r)
},
topStack: function(e) {
var t = this.isInline() ? this.inlineStack : this.compileStack,
r = t[t.length - 1];
return !e && r instanceof n ? r.value : r
},
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 r = "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(" "),
i = t.RESERVED_WORDS = {};
for (var s = 0, o = r.length;
s < o;
s++) i[r[s]] = !0;
t.isValidJavaScriptVariableName = function(e) {
return !t.RESERVED_WORDS[e] && /^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(e) ? !0 : !1
}
}(Handlebars.Compiler, Handlebars.JavaScriptCompiler), Handlebars.precompile = function(e, t) {
if (!e || typeof e != "string" && e.constructor !== Handlebars.AST.ProgramNode) throw new Handlebars.Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + e);
t = t || {}, "data" in t || (t.data = !0);
var n = Handlebars.parse(e),
r = (new Handlebars.Compiler).compile(n, t);
return (new Handlebars.JavaScriptCompiler).compile(r, t)
}, Handlebars.compile = function(e, t) {
function r() {
var n = Handlebars.parse(e),
r = (new Handlebars.Compiler).compile(n, t),
i = (new Handlebars.JavaScriptCompiler).compile(r, t, undefined, !0);
return Handlebars.template(i)
}
if (!e || typeof e != "string" && e.constructor !== Handlebars.AST.ProgramNode) throw new Handlebars.Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + e);
t = t || {}, "data" in t || (t.data = !0);
var n;
return function(e, t) {
return n || (n = r()), n.call(this, e, t)
}
}, Handlebars.VM = {
template: function(e) {
var t = {
escapeExpression: Handlebars.Utils.escapeExpression,
invokePartial: Handlebars.VM.invokePartial,
programs: [],
program: function(e, t, n) {
var r = this.programs[e];
return n ? Handlebars.VM.program(t, n) : r ? r : (r = this.programs[e] = Handlebars.VM.program(t), r)
},
programWithDepth: Handlebars.VM.programWithDepth,
noop: Handlebars.VM.noop,
compilerInfo: null
};
return function(n, r) {
r = r || {};
var i = e.call(t, Handlebars, n, r.helpers, r.partials, r.data),
s = t.compilerInfo || [],
o = s[0] || 1,
u = Handlebars.COMPILER_REVISION;
if (o !== u) {
if (o < u) {
var a = Handlebars.REVISION_CHANGES[u],
f = Handlebars.REVISION_CHANGES[o];
throw "Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (" + a + ") or downgrade your runtime to an older version (" + f + ")."
}
throw "Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version (" + s[1] + ")."
}
return i
}
},
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(e, t, n, r, i, s) {
var o = {
helpers: r,
partials: i,
data: s
};
if (e === undefined) throw new Handlebars.Exception("The partial " + t + " could not be found");
if (e instanceof Function) return e(n, o);
if (!Handlebars.compile) throw new Handlebars.Exception("The partial " + t + " could not be compiled when running in runtime-only mode");
return i[t] = Handlebars.compile(e, {
data: s !== undefined
}), i[t](n, o)
}
}, Handlebars.template = Handlebars.VM.template, define("vendor/handlebars", function(e) {
return function() {
var t, n;
return t || e.Handlebars
}
}(this)), function(e) {
function O(e, t) {
return function(n) {
return j(e.call(this, n), t)
}
}
function M(e) {
return function(t) {
return this.lang().ordinal(e.call(this, t))
}
}
function _() {}
function D(e) {
H(this, e)
}
function P(e) {
var t = this._data = {},
n = e.years || e.year || e.y || 0,
r = e.months || e.month || e.M || 0,
i = e.weeks || e.week || e.w || 0,
s = e.days || e.day || e.d || 0,
o = e.hours || e.hour || e.h || 0,
u = e.minutes || e.minute || e.m || 0,
a = e.seconds || e.second || e.s || 0,
f = e.milliseconds || e.millisecond || e.ms || 0;
this._milliseconds = f + a * 1e3 + u * 6e4 + o * 36e5, this._days = s + i * 7, this._months = r + n * 12, t.milliseconds = f % 1e3, a += B(f / 1e3), t.seconds = a % 60, u += B(a / 60), t.minutes = u % 60, o += B(u / 60), t.hours = o % 24, s += B(o / 24), s += i * 7, t.days = s % 30, r += B(s / 30), t.months = r % 12, n += B(r / 12), t.years = n
}
function H(e, t) {
for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
return e
}
function B(e) {
return e < 0 ? Math.ceil(e) : Math.floor(e)
}
function j(e, t) {
var n = e + "";
while (n.length < t) n = "0" + n;
return n
}
function F(e, t, n) {
var r = t._milliseconds,
i = t._days,
s = t._months,
o;
r && e._d.setTime(+e + r * n), i && e.date(e.date() + i * n), s && (o = e.date(), e.date(1).month(e.month() + s * n).date(Math.min(o, e.daysInMonth())))
}
function I(e) {
return Object.prototype.toString.call(e) === "[object Array]"
}
function q(e, t) {
var n = Math.min(e.length, t.length),
r = Math.abs(e.length - t.length),
i = 0,
s;
for (s = 0;
s < n;
s++)~~e[s] !== ~~t[s] && i++;
return i + r
}
function R(e, t) {
return t.abbr = e, s[e] || (s[e] = new _), s[e].set(t), s[e]
}
function U(e) {
return e ? (!s[e] && o && require("./lang/" + e), s[e]) : t.fn._lang
}
function z(e) {
return e.match(/\[.*\]/) ? e.replace(/^\[|\]$/g, "") : e.replace(/\\/g, "")
}
function W(e) {
var t = e.match(a),
n, r;
for (n = 0, r = t.length;
n < r;
n++) A[t[n]] ? t[n] = A[t[n]] : t[n] = z(t[n]);
return function(i) {
var s = "";
for (n = 0;
n < r;
n++) s += typeof t[n].call == "function" ? t[n].call(i, e) : t[n];
return s
}
}
function X(e, t) {
function r(t) {
return e.lang().longDateFormat(t) || t
}
var n = 5;
while (n-- && f.test(t)) t = t.replace(f, r);
return C[t] || (C[t] = W(t)), C[t](e)
}
function V(e) {
switch (e) {
case "DDDD":
return p;
case "YYYY":
return d;
case "YYYYY":
return v;
case "S":
case "SS":
case "SSS":
case "DDD":
return h;
case "MMM":
case "MMMM":
case "dd":
case "ddd":
case "dddd":
case "a":
case "A":
return m;
case "X":
return b;
case "Z":
case "ZZ":
return g;
case "T":
return y;
case "MM":
case "DD":
case "YY":
case "HH":
case "hh":
case "mm":
case "ss":
case "M":
case "D":
case "d":
case "H":
case "h":
case "m":
case "s":
return c;
default:
return new RegExp(e.replace("\\", ""))
}
}
function $(e, t, n) {
var r, i, s = n._a;
switch (e) {
case "M":
case "MM":
s[1] = t == null ? 0 : ~~t - 1;
break;
case "MMM":
case "MMMM":
r = U(n._l).monthsParse(t), r != null ? s[1] = r : n._isValid = !1;
break;
case "D":
case "DD":
case "DDD":
case "DDDD":
t != null && (s[2] = ~~t);
break;
case "YY":
s[0] = ~~t + (~~t > 68 ? 1900 : 2e3);
break;
case "YYYY":
case "YYYYY":
s[0] = ~~t;
break;
case "a":
case "A":
n._isPm = (t + "").toLowerCase() === "pm";
break;
case "H":
case "HH":
case "h":
case "hh":
s[3] = ~~t;
break;
case "m":
case "mm":
s[4] = ~~t;
break;
case "s":
case "ss":
s[5] = ~~t;
break;
case "S":
case "SS":
case "SSS":
s[6] = ~~ (("0." + t) * 1e3);
break;
case "X":
n._d = new Date(parseFloat(t) * 1e3);
break;
case "Z":
case "ZZ":
n._useUTC = !0, r = (t + "").match(x), r && r[1] && (n._tzh = ~~r[1]), r && r[2] && (n._tzm = ~~r[2]), r && r[0] === "+" && (n._tzh = -n._tzh, n._tzm = -n._tzm)
}
t == null && (n._isValid = !1)
}
function J(e) {
var t, n, r = [];
if (e._d) return;
for (t = 0;
t < 7;
t++) e._a[t] = r[t] = e._a[t] == null ? t === 2 ? 1 : 0 : e._a[t];
r[3] += e._tzh || 0, r[4] += e._tzm || 0, n = new Date(0), e._useUTC ? (n.setUTCFullYear(r[0], r[1], r[2]), n.setUTCHours(r[3], r[4], r[5], r[6])) : (n.setFullYear(r[0], r[1], r[2]), n.setHours(r[3], r[4], r[5], r[6])), e._d = n
}
function K(e) {
var t = e._f.match(a),
n = e._i,
r, i;
e._a = [];
for (r = 0;
r < t.length;
r++) i = (V(t[r]).exec(n) || [])[0], i && (n = n.slice(n.indexOf(i) + i.length)), A[t[r]] && $(t[r], i, e);
e._isPm && e._a[3] < 12 && (e._a[3] += 12), e._isPm === !1 && e._a[3] === 12 && (e._a[3] = 0), J(e)
}
function Q(e) {
var t, n, r, i = 99,
s, o, u;
while (e._f.length) {
t = H({}, e), t._f = e._f.pop(), K(t), n = new D(t);
if (n.isValid()) {
r = n;
break
}
u = q(t._a, n.toArray()), u < i && (i = u, r = n)
}
H(e, r)
}
function G(e) {
var t, n = e._i;
if (w.exec(n)) {
e._f = "YYYY-MM-DDT";
for (t = 0;
t < 4;
t++) if (S[t][1].exec(n)) {
e._f += S[t][0];
break
}
g.exec(n) && (e._f += " Z"), K(e)
} else e._d = new Date(n)
}
function Y(t) {
var n = t._i,
r = u.exec(n);
n === e ? t._d = new Date : r ? t._d = new Date(+r[1]) : typeof n == "string" ? G(t) : I(n) ? (t._a = n.slice(0), J(t)) : t._d = n instanceof Date ? new Date(+n) : new Date(n)
}
function Z(e, t, n, r, i) {
return i.relativeTime(t || 1, !! n, e, r)
}
function et(e, t, n) {
var i = r(Math.abs(e) / 1e3),
s = r(i / 60),
o = r(s / 60),
u = r(o / 24),
a = r(u / 365),
f = i < 45 && ["s", i] || s === 1 && ["m"] || s < 45 && ["mm", s] || o === 1 && ["h"] || o < 22 && ["hh", o] || u === 1 && ["d"] || u <= 25 && ["dd", u] || u <= 45 && ["M"] || u < 345 && ["MM", r(u / 30)] || a === 1 && ["y"] || ["yy", a];
return f[2] = t, f[3] = e > 0, f[4] = n, Z.apply({}, f)
}
function tt(e, n, r) {
var i = r - n,
s = r - e.day();
return s > i && (s -= 7), s < i - 7 && (s += 7), Math.ceil(t(e).add("d", s).dayOfYear() / 7)
}
function nt(e) {
var n = e._i,
r = e._f;
return n === null || n === "" ? null : (typeof n == "string" && (e._i = n = U().preparse(n)), t.isMoment(n) ? (e = H({}, n), e._d = new Date(+n._d)) : r ? I(r) ? Q(e) : K(e) : Y(e), new D(e))
}
function rt(e, n) {
t.fn[e] = t.fn[e + "s"] = function(e) {
var t = this._isUTC ? "UTC" : "";
return e != null ? (this._d["set" + t + n](e), this) : this._d["get" + t + n]()
}
}
function it(e) {
t.duration.fn[e] = function() {
return this._data[e]
}
}
function st(e, n) {
t.duration.fn["as" + e] = function() {
return +this / n
}
}
var t, n = "2.0.0",
r = Math.round,
i, s = {},
o = typeof module != "undefined" && module.exports,
u = /^\/?Date\((\-?\d+)/i,
a = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,
f = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4
})/g,
l = /([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi,
c = /\d\d?/,
h = /\d{1,3
}/,
p = /\d{3
}/,
d = /\d{1,4
}/,
v = /[+\-]?\d{1,6
}/,
m = /[0-9]*[a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF]+\s*?[\u0600-\u06FF]+/i,
g = /Z|[\+\-]\d\d:?\d\d/i,
y = /T/i,
b = /[\+\-]?\d+(\.\d{1,3
})?/,
w = /^\s*\d{4
}-\d\d-\d\d((T|)(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,
E = "YYYY-MM-DDTHH:mm:ssZ",
S = [
["HH:mm:ss.S", /(T|)\d\d:\d\d:\d\d\.\d{1,3
}/],
["HH:mm:ss", /(T|)\d\d:\d\d:\d\d/],
["HH:mm", /(T|)\d\d:\d\d/],
["HH", /(T|)\d\d/]
],
x = /([\+\-]|\d\d)/gi,
T = "Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|"),
N = {
Milliseconds: 1,
Seconds: 1e3,
Minutes: 6e4,
Hours: 36e5,
Days: 864e5,
Months: 2592e6,
Years: 31536e6
},
C = {},
k = "DDD w W M D d".split(" "),
L = "M D H h m s w W".split(" "),
A = {
M: function() {
return this.month() + 1
},
MMM: function(e) {
return this.lang().monthsShort(this, e)
},
MMMM: function(e) {
return this.lang().months(this, e)
},
D: function() {
return this.date()
},
DDD: function() {
return this.dayOfYear()
},
d: function() {
return this.day()
},
dd: function(e) {
return this.lang().weekdaysMin(this, e)
},
ddd: function(e) {
return this.lang().weekdaysShort(this, e)
},
dddd: function(e) {
return this.lang().weekdays(this, e)
},
w: function() {
return this.week()
},
W: function() {
return this.isoWeek()
},
YY: function() {
return j(this.year() % 100, 2)
},
YYYY: function() {
return j(this.year(), 4)
},
YYYYY: function() {
return j(this.year(), 5)
},
a: function() {
return this.lang().meridiem(this.hours(), this.minutes(), !0)
},
A: function() {
return this.lang().meridiem(this.hours(), this.minutes(), !1)
},
H: function() {
return this.hours()
},
h: function() {
return this.hours() % 12 || 12
},
m: function() {
return this.minutes()
},
s: function() {
return this.seconds()
},
S: function() {
return ~~ (this.milliseconds() / 100)
},
SS: function() {
return j(~~ (this.milliseconds() / 10), 2)
},
SSS: function() {
return j(this.milliseconds(), 3)
},
Z: function() {
var e = -this.zone(),
t = "+";
return e < 0 && (e = -e, t = "-"), t + j(~~ (e / 60), 2) + ":" + j(~~e % 60, 2)
},
ZZ: function() {
var e = -this.zone(),
t = "+";
return e < 0 && (e = -e, t = "-"), t + j(~~ (10 * e / 6), 4)
},
X: function() {
return this.unix()
}
};
while (k.length) i = k.pop(), A[i + "o"] = M(A[i]);
while (L.length) i = L.pop(), A[i + i] = O(A[i], 2);
A.DDDD = O(A.DDD, 3), _.prototype = {
set: function(e) {
var t, n;
for (n in e) t = e[n], typeof t == "function" ? this[n] = t : this["_" + n] = t
},
_months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
months: function(e) {
return this._months[e.month()]
},
_monthsShort: "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
monthsShort: function(e) {
return this._monthsShort[e.month()]
},
monthsParse: function(e) {
var n, r, i, s;
this._monthsParse || (this._monthsParse = []);
for (n = 0;
n < 12;
n++) {
this._monthsParse[n] || (r = t([2e3, n]), i = "^" + this.months(r, "") + "|^" + this.monthsShort(r, ""), this._monthsParse[n] = new RegExp(i.replace(".", ""), "i"));
if (this._monthsParse[n].test(e)) return n
}
},
_weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
weekdays: function(e) {
return this._weekdays[e.day()]
},
_weekdaysShort: "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
weekdaysShort: function(e) {
return this._weekdaysShort[e.day()]
},
_weekdaysMin: "Su_Mo_Tu_We_Th_Fr_Sa".split("_"),
weekdaysMin: function(e) {
return this._weekdaysMin[e.day()]
},
_longDateFormat: {
LT: "h:mm A",
L: "MM/DD/YYYY",
LL: "MMMM D YYYY",
LLL: "MMMM D YYYY LT",
LLLL: "dddd, MMMM D YYYY LT"
},
longDateFormat: function(e) {
var t = this._longDateFormat[e];
return !t && this._longDateFormat[e.toUpperCase()] && (t = this._longDateFormat[e.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function(e) {
return e.slice(1)
}), this._longDateFormat[e] = t), t
},
meridiem: function(e, t, n) {
return e > 11 ? n ? "pm" : "PM" : n ? "am" : "AM"
},
_calendar: {
sameDay: "[Today at] LT",
nextDay: "[Tomorrow at] LT",
nextWeek: "dddd [at] LT",
lastDay: "[Yesterday at] LT",
lastWeek: "[last] dddd [at] LT",
sameElse: "L"
},
calendar: function(e, t) {
var n = this._calendar[e];
return typeof n == "function" ? n.apply(t) : n
},
_relativeTime: {
future: "in %s",
past: "%s ago",
s: "a few seconds",
m: "a minute",
mm: "%d minutes",
h: "an hour",
hh: "%d hours",
d: "a day",
dd: "%d days",
M: "a month",
MM: "%d months",
y: "a year",
yy: "%d years"
},
relativeTime: function(e, t, n, r) {
var i = this._relativeTime[n];
return typeof i == "function" ? i(e, t, n, r) : i.replace(/%d/i, e)
},
pastFuture: function(e, t) {
var n = this._relativeTime[e > 0 ? "future" : "past"];
return typeof n == "function" ? n(t) : n.replace(/%s/i, t)
},
ordinal: function(e) {
return this._ordinal.replace("%d", e)
},
_ordinal: "%d",
preparse: function(e) {
return e
},
postformat: function(e) {
return e
},
week: function(e) {
return tt(e, this._week.dow, this._week.doy)
},
_week: {
dow: 0,
doy: 6
}
}, t = function(e, t, n) {
return nt({
_i: e,
_f: t,
_l: n,
_isUTC: !1
})
}, t.utc = function(e, t, n) {
return nt({
_useUTC: !0,
_isUTC: !0,
_l: n,
_i: e,
_f: t
})
}, t.unix = function(e) {
return t(e * 1e3)
}, t.duration = function(e, n) {
var r = t.isDuration(e),
i = typeof e == "number",
s = r ? e._data : i ? {} : e,
o;
return i && (n ? s[n] = e : s.milliseconds = e), o = new P(s), r && e.hasOwnProperty("_lang") && (o._lang = e._lang), o
}, t.version = n, t.defaultFormat = E, t.lang = function(e, n) {
var r;
if (!e) return t.fn._lang._abbr;
n ? R(e, n) : s[e] || U(e), t.duration.fn._lang = t.fn._lang = U(e)
}, t.langData = function(e) {
return e && e._lang && e._lang._abbr && (e = e._lang._abbr), U(e)
}, t.isMoment = function(e) {
return e instanceof D
}, t.isDuration = function(e) {
return e instanceof P
}, t.fn = D.prototype = {
clone: function() {
return t(this)
},
valueOf: function() {
return +this._d
},
unix: function() {
return Math.floor(+this._d / 1e3)
},
toString: function() {
return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")
},
toDate: function() {
return this._d
},
toJSON: function() {
return t.utc(this).format("YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")
},
toArray: function() {
var e = this;
return [e.year(), e.month(), e.date(), e.hours(), e.minutes(), e.seconds(), e.milliseconds()]
},
isValid: function() {
return this._isValid == null && (this._a ? this._isValid = !q(this._a, (this._isUTC ? t.utc(this._a) : t(this._a)).toArray()) : this._isValid = !isNaN(this._d.getTime())), !! this._isValid
},
utc: function() {
return this._isUTC = !0, this
},
local: function() {
return this._isUTC = !1, this
},
format: function(e) {
var n = X(this, e || t.defaultFormat);
return this.lang().postformat(n)
},
add: function(e, n) {
var r;
return typeof e == "string" ? r = t.duration(+n, e) : r = t.duration(e, n), F(this, r, 1), this
},
subtract: function(e, n) {
var r;
return typeof e == "string" ? r = t.duration(+n, e) : r = t.duration(e, n), F(this, r, -1), this
},
diff: function(e, n, r) {
var i = this._isUTC ? t(e).utc() : t(e).local(),
s = (this.zone() - i.zone()) * 6e4,
o, u;
return n && (n = n.replace(/s$/, "")), n === "year" || n === "month" ? (o = (this.daysInMonth() + i.daysInMonth()) * 432e5, u = (this.year() - i.year()) * 12 + (this.month() - i.month()), u += (this - t(this).startOf("month") - (i - t(i).startOf("month"))) / o, n === "year" && (u /= 12)) : (o = this - i - s, u = n === "second" ? o / 1e3 : n === "minute" ? o / 6e4 : n === "hour" ? o / 36e5 : n === "day" ? o / 864e5 : n === "week" ? o / 6048e5 : o), r ? u : B(u)
},
from: function(e, n) {
return t.duration(this.diff(e)).lang(this.lang()._abbr).humanize(!n)
},
fromNow: function(e) {
return this.from(t(), e)
},
calendar: function() {
var e = this.diff(t().startOf("day"), "days", !0),
n = e < -6 ? "sameElse" : e < -1 ? "lastWeek" : e < 0 ? "lastDay" : e < 1 ? "sameDay" : e < 2 ? "nextDay" : e < 7 ? "nextWeek" : "sameElse";
return this.format(this.lang().calendar(n, this))
},
isLeapYear: function() {
var e = this.year();
return e % 4 === 0 && e % 100 !== 0 || e % 400 === 0
},
isDST: function() {
return this.zone() < t([this.year()]).zone() || this.zone() < t([this.year(), 5]).zone()
},
day: function(e) {
var t = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
return e == null ? t : this.add({
d: e - t
})
},
startOf: function(e) {
e = e.replace(/s$/, "");
switch (e) {
case "year":
this.month(0);
case "month":
this.date(1);
case "week":
case "day":
this.hours(0);
case "hour":
this.minutes(0);
case "minute":
this.seconds(0);
case "second":
this.milliseconds(0)
}
return e === "week" && this.day(0), this
},
endOf: function(e) {
return this.startOf(e).add(e.replace(/s?$/, "s"), 1).subtract("ms", 1)
},
isAfter: function(e, n) {
return n = typeof n != "undefined" ? n : "millisecond", +this.clone().startOf(n) > +t(e).startOf(n)
},
isBefore: function(e, n) {
return n = typeof n != "undefined" ? n : "millisecond", +this.clone().startOf(n) < +t(e).startOf(n)
},
isSame: function(e, n) {
return n = typeof n != "undefined" ? n : "millisecond", +this.clone().startOf(n) === +t(e).startOf(n)
},
zone: function() {
return this._isUTC ? 0 : this._d.getTimezoneOffset()
},
daysInMonth: function() {
return t.utc([this.year(), this.month() + 1, 0]).date()
},
dayOfYear: function(e) {
var n = r((t(this).startOf("day") - t(this).startOf("year")) / 864e5) + 1;
return e == null ? n : this.add("d", e - n)
},
isoWeek: function(e) {
var t = tt(this, 1, 4);
return e == null ? t : this.add("d", (e - t) * 7)
},
week: function(e) {
var t = this.lang().week(this);
return e == null ? t : this.add("d", (e - t) * 7)
},
lang: function(t) {
return t === e ? this._lang : (this._lang = U(t), this)
}
};
for (i = 0;
i < T.length;
i++) rt(T[i].toLowerCase().replace(/s$/, ""), T[i]);
rt("year", "FullYear"), t.fn.days = t.fn.day, t.fn.weeks = t.fn.week, t.fn.isoWeeks = t.fn.isoWeek, t.duration.fn = P.prototype = {
weeks: function() {
return B(this.days() / 7)
},
valueOf: function() {
return this._milliseconds + this._days * 864e5 + this._months * 2592e6
},
humanize: function(e) {
var t = +this,
n = et(t, !e, this.lang());
return e && (n = this.lang().pastFuture(t, n)), this.lang().postformat(n)
},
lang: t.fn.lang
};
for (i in N) N.hasOwnProperty(i) && (st(i, N[i]), it(i.toLowerCase()));
st("Weeks", 6048e5), t.lang("en", {
ordinal: function(e) {
var t = e % 10,
n = ~~ (e % 100 / 10) === 1 ? "th" : t === 1 ? "st" : t === 2 ? "nd" : t === 3 ? "rd" : "th";
return e + n
}
}), o && (module.exports = t), typeof ender == "undefined" && (this.moment = t), typeof define == "function" && define.amd && define("moment", [], function() {
return t
})
}.call(this), define("vendor/moment", function(e) {
return function() {
var t, n;
return t || e.moment
}
}(this)), FastClick.prototype.deviceIsAndroid = navigator.userAgent.indexOf("Android") > 0, FastClick.prototype.deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent), FastClick.prototype.deviceIsIOS4 = FastClick.prototype.deviceIsIOS && /OS 4_\d(_\d)?/.test(navigator.userAgent), FastClick.prototype.deviceIsIOSWithBadTarget = FastClick.prototype.deviceIsIOS && /OS ([6-9]|\d{2
})_\d/.test(navigator.userAgent), FastClick.prototype.needsClick = function(e) {
switch (e.nodeName.toLowerCase()) {
case "button":
case "select":
case "textarea":
if (e.disabled) return !0;
break;
case "input":
if (this.deviceIsIOS && e.type === "file" || e.disabled) return !0;
break;
case "label":
case "video":
return !0
}
return /\bneedsclick\b/.test(e.className)
}, FastClick.prototype.needsFocus = function(e) {
switch (e.nodeName.toLowerCase()) {
case "textarea":
case "select":
return !0;
case "input":
switch (e.type) {
case "button":
case "checkbox":
case "file":
case "image":
case "radio":
case "submit":
return !1
}
return !e.disabled && !e.readOnly;
default:
return /\bneedsfocus\b/.test(e.className)
}
}, FastClick.prototype.sendClick = function(e, t) {
var n, r;
document.activeElement && document.activeElement !== e && document.activeElement.blur(), r = t.changedTouches[0], n = document.createEvent("MouseEvents"), n.initMouseEvent("click", !0, !0, window, 1, r.screenX, r.screenY, r.clientX, r.clientY, !1, !1, !1, !1, 0, null), n.forwardedTouchEvent = !0, e.dispatchEvent(n)
}, FastClick.prototype.focus = function(e) {
var t;
this.deviceIsIOS && e.setSelectionRange ? (t = e.value.length, e.setSelectionRange(t, t)) : e.focus()
}, FastClick.prototype.updateScrollParent = function(e) {
var t, n;
t = e.fastClickScrollParent;
if (!t || !t.contains(e)) {
n = e;
do {
if (n.scrollHeight > n.offsetHeight) {
t = n, e.fastClickScrollParent = n;
break
}
n = n.parentElement
} while (n)
}
t && (t.fastClickLastScrollTop = t.scrollTop)
}, FastClick.prototype.getTargetElementFromEventTarget = function(e) {
return e.nodeType === Node.TEXT_NODE ? e.parentNode : e
}, FastClick.prototype.onTouchStart = function(e) {
var t, n, r;
if (e.targetTouches.length > 1) return !0;
t = this.getTargetElementFromEventTarget(e.target), n = e.targetTouches[0];
if (this.deviceIsIOS) {
r = window.getSelection();
if (r.rangeCount && !r.isCollapsed) return !0;
if (!this.deviceIsIOS4) {
if (n.identifier === this.lastTouchIdentifier) return e.preventDefault(), !1;
this.lastTouchIdentifier = n.identifier, this.updateScrollParent(t)
}
}
return this.trackingClick = !0, this.trackingClickStart = e.timeStamp, this.targetElement = t, this.touchStartX = n.pageX, this.touchStartY = n.pageY, e.timeStamp - this.lastClickTime < 200 && e.preventDefault(), !0
}, FastClick.prototype.touchHasMoved = function(e) {
var t = e.changedTouches[0],
n = this.touchBoundary;
return Math.abs(t.pageX - this.touchStartX) > n || Math.abs(t.pageY - this.touchStartY) > n ? !0 : !1
}, FastClick.prototype.onTouchMove = function(e) {
if (!this.trackingClick) return !0;
if (this.targetElement !== this.getTargetElementFromEventTarget(e.target) || this.touchHasMoved(e)) this.trackingClick = !1, this.targetElement = null;
return !0
}, FastClick.prototype.findControl = function(e) {
return e.control !== undefined ? e.control : e.htmlFor ? document.getElementById(e.htmlFor) : e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")
}, FastClick.prototype.onTouchEnd = function(e) {
var t, n, r, i, s, o = this.targetElement;
if (!this.trackingClick) return !0;
if (e.timeStamp - this.lastClickTime < 200) return this.cancelNextClick = !0, !0;
this.lastClickTime = e.timeStamp, n = this.trackingClickStart, this.trackingClick = !1, this.trackingClickStart = 0, this.deviceIsIOSWithBadTarget && (s = e.changedTouches[0], o = document.elementFromPoint(s.pageX - window.pageXOffset, s.pageY - window.pageYOffset)), r = o.tagName.toLowerCase();
if (r === "label") {
t = this.findControl(o);
if (t) {
this.focus(o);
if (this.deviceIsAndroid) return !1;
o = t
}
} else if (this.needsFocus(o)) {
if (e.timeStamp - n > 100 || this.deviceIsIOS && window.top !== window && r === "input") return this.targetElement = null, !1;
this.focus(o);
if (!this.deviceIsIOS4 || r !== "select") this.targetElement = null, e.preventDefault();
return !1
}
if (this.deviceIsIOS && !this.deviceIsIOS4) {
i = o.fastClickScrollParent;
if (i && i.fastClickLastScrollTop !== i.scrollTop) return !0
}
return this.needsClick(o) || (e.preventDefault(), this.sendClick(o, e)), !1
}, FastClick.prototype.onTouchCancel = function() {
this.trackingClick = !1, this.targetElement = null
}, FastClick.prototype.onMouse = function(e) {
return this.targetElement ? e.forwardedTouchEvent ? !0 : e.cancelable ? !this.needsClick(this.targetElement) || this.cancelNextClick ? (e.stopImmediatePropagation ? e.stopImmediatePropagation() : e.propagationStopped = !0, e.stopPropagation(), e.preventDefault(), !1) : !0 : !0 : !0
}, FastClick.prototype.onClick = function(e) {
var t;
return this.trackingClick ? (this.targetElement = null, this.trackingClick = !1, !0) : e.target.type === "submit" && e.detail === 0 ? !0 : (t = this.onMouse(e), t || (this.targetElement = null), t)
}, FastClick.prototype.destroy = function() {
var e = this.layer;
this.deviceIsAndroid && (e.removeEventListener("mouseover", this.onMouse, !0), e.removeEventListener("mousedown", this.onMouse, !0), e.removeEventListener("mouseup", this.onMouse, !0)), e.removeEventListener("click", this.onClick, !0), e.removeEventListener("touchstart", this.onTouchStart, !1), e.removeEventListener("touchmove", this.onTouchMove, !1), e.removeEventListener("touchend", this.onTouchEnd, !1), e.removeEventListener("touchcancel", this.onTouchCancel, !1)
}, FastClick.notNeeded = function(e) {
var t;
if (typeof window.ontouchstart == "undefined") return !0;
if (/Chrome\/[0-9]+/.test(navigator.userAgent)) {
if (!FastClick.prototype.deviceIsAndroid) return !0;
t = document.querySelector("meta[name=viewport]");
if (t && t.content.indexOf("user-scalable=no") !== -1) return !0
}
return e.style.msTouchAction === "none" ? !0 : !1
}, FastClick.attach = function(e) {
return new FastClick(e)
}, window.FastClick = FastClick, define("vendor/fastclick", function(e) {
return function() {
var t, n;
return t || e.fastclick
}
}(this));
var readerTranslations = {
en: {
tags: "Tags",
save: "Save",
cancel: "Cancel",
nav: {
home: "Home",
all: "All",
starred: "Starred"
},
feed: {
unread: "Unread",
more_in: "More in",
unread_articles: "Unread articles",
no_unread_articles: "No Unread Articles",
no_selected_articles: "No Articles Selected",
recommended: "Recommended Sources"
},
"add-feed": {
title: "Add Subscription",
subscribe: "Subscribe",
update_category: "Add Categories",
update: "Update",
done: "Done",
search: "Search",
search_again: "Search Again",
search_results: "Search Results",
search_feed_label: "Enter a search term to find sources or paste in a source URL:",
search_feed_example: "Example: http://feeds.huffingtonpost.com/FeaturedPosts or News",
pick_category_label: "Pick a category for this new source (optional):",
discovery_results: "Browse sources by topic:"
},
organize: {
title: "Organize",
edit: "Edit",
edit_feed: "Edit a subcription",
edit_label: "Name this category:",
edit_label_feed_category: "Pick a category for this new source:",
edit_label_feed: "Name this source: <span>(Optional)</span>",
"delete": "Delete",
unsubscribe_from: "Unsubscribe from",
delete_tag_label: "Are you sure you want to delete this category?",
delete_feed_label: "Are you sure you want to unsubscribe from this source?",
delete_feed_label_more: "We'll keep any starred articles from this source but won't get any further updates from it. If you change your mind, your can always subscribe again later.",
yes_delete: "Yes, Delete",
update: "Update",
cancel: "Cancel",
add_tag: "Add Tag",
add: "Add",
sort_az: "Sort A-Z",
sort_za: "Sort Z-A"
},
"import": {
title: "Import Your Subscriptions",
"import": "import",
upload: "Upload",
cancel: "Cancel",
message: "Moving from another RSS Reader? You can upload your subscriptions in standard OPML format.",
label: "Select an OPML File:",
failure_message: "There was an issue while importing your subscriptions.",
failure_message_max: "Your subscriptions were imported successfully! <br/>However you've reached maximum number of allowed subscriptions and some of your subscriptions were not imported.",
failure_message_invalid: "Your subscriptions were imported successfully! <br/>However, the following subscriptions were invalid and were not imported:",
success_message: "Your subscriptions were imported successfully! <br/> It can take a couple minutes for us to process all your subscriptions.",
try_again: "Try Again",
start_reading: "Start Reading"
},
shortcuts: {
title: "Keyboard Shortcuts",
navigation: "Navigation",
jumping: "Jumping",
article_actions: "Article Actions",
site_wide: "Site-Wide",
next_previous_item: "Next or previous item",
next_previous_item_list: "Items scan down/up (Except Full)",
next_item_page: "Next item or page",
previous_item_page: "Previous item or page",
open_new_window: "Open In A New Window",
go_home: "Go Home",
go_all: "Go to all items",
go_starred: "Go to starred items",
article_star: "Star article",
article_tag: "Tag article",
article_original: "View Origical Content",
expand_collapse_item: "Expand/collapse item (List Only)",
article_read: "Mark article as read or unread",
article_all_read: "Mark all as read",
toggle_shortcuts: "Toggle Shortcuts Window",
refresh: "Refresh",
layout_list: "Switch to List View",
layout_card: "Switch to Card View",
layout_full: "Switch to Article View",
search: "Move Cursor to search box",
add_feed: "Add a subscription",
magnify_more: "Increase magnification",
magnify_less: "Decrease magnification",
next_previous_subscription: "next/previous subscription",
expand_subscription: "expand folder",
open_subscription: "open subscription or folder"
},
settings: {
title: "Settings",
general: "General",
font_preference: "Font Preference",
font_size: "Font Size",
confirmation: "Confirmation",
start_page: "Start Page",
theme: "Theme",
confirm_when_all_read: "Confirm when all read",
confirm_when_unsubscribe: "Confirm when unsubscribing to a feed",
confirm_when_delete_category: "Confirm when deleting a category",
hide_cat_with_no_count: "Hide categories and feeds with no unread articles",
show_unread_count: "Show unread count next to each category and subscription",
yes: "Yes",
no: "No",
dark: "Dark",
light: "Light",
small: "Small",
medium: "Medium",
large: "Large",
x_large: "X-Large",
sort_articles: "Sort articles by",
view_articles: "View articles",
all_articles: "All articles",
unread_articles: "Unread articles"
},
mark: {
title: "Mark All As Read",
text: "Are you sure you want to mark all articles as read?",
label: "Don't ask again",
yes_continue: "Yes, Continue",
cancel: "Cancel"
}
}
};
define("translations", function(e) {
return function() {
var t, n;
return t || e.translations
}
}(this));
var readerDiscovery = [{
title: "Huffington Post",
description: "The Blog",
category: "News",
url: "http://feeds.huffingtonpost.com/FeaturedPosts"
}, {
title: "Engadget RSS Feed",
description: "Engadget",
category: "Technology",
url: "http://www.engadget.com/rss.xml"
}, {
title: "TechCrunch",
description: "TechCrunch is a group-edited blog that profiles the companies, products and events defining and transforming the new web.",
category: "Technology",
url: "http://feeds.feedburner.com/Techcrunch"
}, {
title: "Business Insider",
category: "News",
url: "http://feeds2.feedburner.com/businessinsider"
}, {
title: "TUAW",
description: "TUAW - The Unofficial Apple Weblog",
category: "Apple",
url: "http://www.tuaw.com/rss.xml"
}, {
title: "Joystiq",
category: "Technology",
url: "http://www.joystiq.com/rss.xml"
}, {
title: "ESPN.com",
description: "Latest news from ESPN.com",
category: "Sports",
url: "http://sports.espn.go.com/espn/rss/news"
}, {
title: "xkcd.com",
description: "xkcd.com: A webcomic of romance and math humor.",
category: "Comics",
url: "http://xkcd.com/rss.xml"
}, {
title: "MacRumors: Mac News and Rumors - Front Page",
description: "the mac news you care about",
category: "Apple",
url: "http://www.macrumors.com/macrumors.xml"
}, {
title: "The Moviefone Blog",
description: "The Moviefone Blog is the place for movie lists, trailers, trivia, interviews and features on movies out in theaters and coming soon.",
category: "Movies",
url: "http://news.moviefone.com/rss.xml"
}, {
title: "NYT > Art & Design",
description: "a blog about drawing, painting, illustration, comics, concept art and other visual arts",
category: "Art",
url: "http://www.nytimes.com/services/xml/rss/nyt/ArtandDesign.xml"
}, {
title: "Books news, reviews and author interviews | guardian.co.uk",
description: "Latest news and features from guardian.co.uk, the world's leading liberal voice",
category: "Books",
url: "http://www.guardian.co.uk/rssfeed/0,,10,00.xml"
}, {
title: "Rotten Tomatoes",
description: "Movies Reviews and previews of movies from print, online, and broadcast critics.",
category: "Movies",
url: "http://i.rottentomatoes.com/syndication/rss/complete_movies.xml"
}, {
title: "NYY Homepage News",
description: "NYY Homepage News",
category: "Sports",
url: "http://mlb.mlb.com/partnerxml/gen/news/rss/nyy.xml"
}, {
title: "Yahoo! Sports - MLB - New York Mets News ",
description: "Latest news and information about the New York Mets.",
category: "Sports",
url: "http://sports.yahoo.com/mlb/teams/nym/rss.xml"
}, {
title: "Yahoo! Sports - NFL - New York Giants News",
description: "Latest news and information about the New York Giants.",
category: "Sports",
url: "http://sports.yahoo.com/nfl/teams/nyg/rss.xml"
}, {
title: "NYT > Travel",
description: "Travel",
category: "Travel",
url: "http://www.nytimes.com/services/xml/rss/nyt/Travel.xml"
}, {
title: "DailyFinance.com",
description: "DailyFinance.com",
category: "Finance",
url: "http://www.dailyfinance.com/rss.xml"
}, {
title: "Apple | GigaOM",
category: "Apple",
url: "http://theappleblog.com/feed/"
}, {
title: "Apple Hot News",
description: "ot News provided by Apple.",
category: "Apple",
url: "http://www.apple.com/main/rss/hotnews/hotnews.rss"
}, {
title: "AppleInsider - Frontpage News ",
description: "AppleInsider News",
category: "Apple",
url: "ttp://www.appleinsider.com/appleinsider.rss"
}, {
title: "The Verge",
category: "Technology",
url: "http://www.theverge.com/rss/index.xml"
}, {
title: "we make money not art",
category: "Art",
url: "http://feeds.we-make-money-not-art.com/wmmna"
}, {
title: "Wooster Collective",
category: "Art",
url: "ttp://www.woostercollective.com/atom.xml"
}, {
title: "Yahoo! Sports - NBA - Brooklyn Nets News",
description: "Latest news and information about the Brooklyn Nets.",
category: "Sports",
url: "http://sports.yahoo.com/nba/teams/njn/rss.xml"
}, {
title: "The Rhizome Frontpage RSS",
description: "The Rhizome Blog and Rhizome News",
category: "Art",
url: "http://rhizome.org/syndicate/fp.rss"
}, {
title: "BBC Sport - Sport",
description: "The latest stories from the Sport section of the BBC Sport web site.",
category: "Sports",
url: "http://feeds.bbci.co.uk/sport/0/rss.xml?edition=int"
}, {
title: "Daring Fireball",
description: "Mac and web curmudgeonry/nerdery. By John Gruber.",
category: "Apple",
url: "http://daringfireball.net/index.xml"
}, {
title: "The Moviefone Blog",
description: "The Moviefone Blog is the place for movie lists, trailers, trivia, interviews and features on movies out in theaters and coming soon.",
category: "Entertainment",
url: "http://news.moviefone.com/rss.xml"
}, {
title: "StyleList",
category: "Lifestyle",
url: "http://www.stylelist.com/rss.xml"
}, {
title: "RollingStone.com: Music News",
description: "Music News from Rolling Stone",
category: "Entertainment",
url: "http://www.rollingstone.com/rssxml/music_news.xml?bid=782298053"
}, {
title: "London Review of Books",
description: "Literary review publishing essay-length book reviews and topical articles on politics, literature, history, philosophy, science and the arts by leading writers and thinkers",
category: "Books",
url: "http://www.lrb.co.uk/homerss.xml"
}, {
title: "StyleList",
category: "Lifestyle",
url: "http://www.stylelist.com/rss.xml"
}, {
title: "Books",
description: "NPR's brings you news about books and authors along with our picks for great reads. Interviews, reviews, the NPR Bestseller Lists, New in Paperback and much more.",
category: "Books",
url: "http://www.npr.org/rss/rss.php?id=1032"
}, {
title: "E! Online (US) - Top Stories",
description: "News from across the show-biz spectrum-TV, movies, music and celebrities",
category: "Entertainment",
url: "http://www.eonline.com/syndication/feeds/rssfeeds/topstories.xml"
}, {
title: "Makers",
category: "Lifestyle",
url: "http://www.makers.com/rss.xml"
}, {
title: "Penny Arcade",
category: "Comics",
url: "http://www.penny-arcade.com/rss.xml"
}, {
title: "Ctrl+Alt+Del",
description: "RSS for the popular comic Ctrl+Alt+Del",
category: "Comics",
url: " http://www.cad-comic.com/rss/rss.xml"
}, {
title: "Homesessive",
category: "Lifestyle",
url: "http://www.homesessive.com/rss.xml"
}, {
title: "ArtsBeat",
description: "New York Times Blog",
category: "Books",
url: "http://papercuts.blogs.nytimes.com/rss2.xml"
}, {
title: "lines and colors",
description: "a blog about drawing, painting, illustration, comics, concept art and other visual arts",
category: "Art",
url: "http://www.linesandcolors.com/feed/"
}, {
title: "NYT > Books Books",
category: "Books",
url: "http://www.nytimes.com/services/xml/rss/nyt/Books.xml"
}, {
title: "Kitchen Daily",
category: "Lifestyle",
url: "http://www.kitchendaily.com/rss.xml"
}, {
title: "Entertainment News Headlines - Yahoo! News",
description: "Get the latest entertainment news headlines from Yahoo! News. Find breaking entertainment news, including analysis and opinion on top entertainment stories.",
category: "Entertainment",
url: "http://rss.news.yahoo.com/rss/entertainment"
}, {
title: "TMZ.com Celebrity Gossip and Entertainment",
description: "News, Covering Celebrity News and Hollywood Rumors. Get All The Latest Gossip at TMZ - Thirty Mile Zone.",
category: "Entertainment",
url: "http://www.tmz.com/rss.xml"
}, {
title: "Business and financial news - CNNMoney.com",
description: "From CNN and Money magazine, CNNMoney.com combines business news and in-depth market analysis with practical advice and answers to personal finance questions.",
category: "Finance",
url: "http://rss.cnn.com/rss/money_topstories.rss"
}, {
title: "Dinosaur Comics Sexy exciting comics for all the awesome people of the world!",
category: "Comics",
url: "http://www.rsspect.com/rss/qwantz.xml"
}, {
title: "Lifehacker",
description: "Tips and downloads for getting things done",
category: "Lifestyle",
url: "http://feeds.gawker.com/lifehacker/full"
}, {
title: "Get Rich Slowly - Personal Finance That Makes Sense.",
description: "Common sense advice on money saving tips, how to get out of debt, high interest savings accounts, cd rates, money market accounts, mortgage rates, money management and more.",
category: "Finance",
url: "http://feeds.feedburner.com/getrichslowly"
}, {
title: "MarketWatch.com - Top Stories",
description: " MarketWatch, a leading publisher of business and financial news, offers users up-to-the minute news, investment tools, and subscription products.",
category: "Finance",
url: "http://www.marketwatch.com/rss/topstories"
}, {
title: "CNET News",
description: "Tech news and business reports by CNET News. Focused on information technology, core topics include computers, hardware, software, networking, and Internet media.",
category: "Technology",
url: "http://news.com.com/2547-1_3-0-5.xml"
}, {
title: "Fool.com: The Motley Fool",
description: "Today's top headlines from The Motley Fool",
category: "Finance",
url: "http://www.fool.com/About/headlines/rss_headlines.asp"
}, {
title: "I Will Teach You To Be Rich by Ramit Sethi",
category: "Finance",
url: "http://www.iwillteachyoutoberich.com/atom.xml"
}, {
title: "Latest Movie Trailers",
description: "Recently added Movie Trailers.",
category: "Movies",
url: "http://trailers.apple.com/trailers/home/rss/newtrailers.rss"
}, {
title: "CONCIERGE.COM: LATEST TRAVEL FEATURES",
description: "Stay updated on Concierge's insider recommendations on the world's greatest destinations, hot hotels, dream trips, inspiring travel ideas, and more. Plus the latest from Condé Nast Traveler magazine.",
category: "Travel",
url: "http://www.concierge.com/services/rss/feeds/travel_features.xml"
}, {
title: "NYT > Movies",
description: "Movies",
category: "Movies",
url: "http://rss.nytimes.com/services/xml/rss/nyt/Movies.xml"
}, {
title: "BBC News - Home",
description: "The latest stories from the Home section of the BBC News web site.",
category: "News",
url: "http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml"
}, {
title: "ComingSoon.net - 30",
description: "most recent stories Do you know what's coming?",
category: "Movies",
url: "http://feeds.feedburner.com/comingsoonnet30"
}, {
title: "Reuters: Top News",
description: "Reuters.com is your source for breaking news, business, financial and investing news, including personal finance and stocks. Reuters is the leading global provider of news, financial information and technology solutions to the world's media, financial institutions, businesses and individuals.",
category: "News",
url: "http://feeds.reuters.com/reuters/topNews"
}, {
title: "The Guardian World News",
description: "Latest news and features from guardian.co.uk, the world's leading liberal voice",
category: "News",
url: "http://www.guardian.co.uk/rssfeed/0,,1,00.xml"
}, {
title: "Top Stories - Google News",
description: "",
category: "News",
url: "http://news.google.com/?topic=h&num=3&output=rss"
}, {
title: "NYT > Home Page HomePage ",
category: "News",
url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
}, {
title: "The Next Web",
category: "Technology",
url: "http://feeds2.feedburner.com/thenextweb"
}, {
title: "Ars Technica",
description: "The Art of Technology",
category: "Technology",
url: "http://arstechnica.com/index.ars/rss"
}, {
title: "CNN.com - Travel",
description: "NN.com delivers up-to-the-minute news and information on the latest top stories, weather, entertainment, politics and more.",
category: "Travel",
url: "http://rss.cnn.com/rss/cnn_travel.rss"
}, {
title: "PHD Comics ",
description: "Providing global up-to-the-minute procrastination!",
category: "Comics",
url: "http://www.phdcomics.com/gradfeed.php"
}, {
title: "Frommer's Deals and News",
description: "Frommers.com brings you cheap airfares, bargain rate cruises, discounted hotel rooms, budget car rentals and money-saving advice, all written and reviewed by travel experts.",
category: "Travel",
url: "http://www.frommers.com/rss/deals_and_news.xml"
}, {
title: "USATODAY.com Feed",
category: "Travel",
url: "http://www.usatoday.com http://rssfeeds.usatoday.com/UsatodaycomTravel-TopStories"
}];
define("discovery", function(e) {
return function() {
var t, n;
return t || e.discovery
}
}(this)), define("config", [], function() {
function t(e) {
var t = e.changedTouches[0],
n = document.createEvent("MouseEvent");
n.initMouseEvent({
touchstart: "mousedown",
touchmove: "mousemove",
touchend: "mouseup"
}[e.type], !0, !0, window, 1, t.screenX, t.screenY, t.clientX, t.clientY, !1, !1, !1, !1, 0, null), t.target.dispatchEvent(n);
var r = $(document.body);
r.hasClass("drag-active") && e.preventDefault()
}
var e = {
server: "https://api.screenname.aol.com",
devId: "ao101LsAXCqh84",
host: window.location.host,
protocol: window.location.protocol,
referer: document.location.href,
hash: location.hash,
token: null,
succUrl: null,
registrationUrl: "https://new.aol.com",
urlEncoder: function(e) {
var t = encodeURIComponent(e);
return t = t.replace("+", "%2B"), t = t.replace("/", "%2F"), t
},
ie: function() {
var e, t = 3,
n = document.createElement("div"),
r = n.getElementsByTagName("i");
while (n.innerHTML = "<!--[if gt IE " + ++t + "]><i></i><![endif]-->", r[0]);
return t > 4 ? t : e
}(),
isTouchDevice: function() {
return "ontouchstart" in window || window.DocumentTouch && document instanceof DocumentTouch
}()
};
return e.succUrl = e.protocol + "//" + e.host + "/login" + (e.hash ? "?r_hash=" + e.urlEncoder(e.hash) : ""), e.phone = function(e, t) {
return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s)|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(|\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt(|\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg(g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v)|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v)|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-|)|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0, 4))
}(navigator.userAgent || navigator.vendor || window.opera), Backbone.emulateHTTP = !0, jQuery.ajaxSettings.traditional = !0, _.mixin(_.str.exports()), _.str.include("Underscore.string", "string"), moment.lang("en", {
relativeTime: {
future: "in %s",
past: "%s ago",
s: "now",
m: "1min",
mm: "%dmin",
h: "1h",
hh: "%dh",
d: "1d",
dd: "%dd",
M: "1m",
MM: "%dm",
y: "1y",
yy: "%dy"
}
}), $.Isotope.prototype._getCenteredMasonryColumns = function() {
this.width = this.element.width();
var e = this.element.parent().width(),
t = this.options.masonry && this.options.masonry.columnWidth || this.$filteredAtoms.outerWidth(!0) || e,
n = Math.floor(e / t);
n = Math.max(n, 1), this.masonry.cols = n, this.masonry.columnWidth = t
}, $.Isotope.prototype._masonryReset = function() {
this.masonry = {}, this._getCenteredMasonryColumns();
var e = this.masonry.cols;
this.masonry.colYs = [];
while (e--) this.masonry.colYs.push(0)
}, $.Isotope.prototype._masonryResizeChanged = function() {
var e = this.masonry.cols;
return this._getCenteredMasonryColumns(), this.masonry.cols !== e
}, $.Isotope.prototype._masonryGetContainerSize = function() {
var e = 0,
t = this.masonry.cols;
while (--t) {
if (this.masonry.colYs[t] !== 0) break;
e++
}
return {
height: Math.max.apply(Math, this.masonry.colYs),
width: (this.masonry.cols - e) * this.masonry.columnWidth
}
}, Handlebars.registerHelper("translate", function(e) {
return rdr.getTranslation(e)
}), Handlebars.registerHelper("sort", function(e) {
return e === rdr.preference.get("sort") ? " active " : ""
}), Handlebars.registerHelper("xt", function(e) {
return e.replace("-", rdr.userId) === rdr.preference.get("xt") ? " active " : ""
}), Handlebars.registerHelper("if_eq", function(e, t, n) {
return _.isString(t) && (t = t.replace("user/-", "user/" + rdr.userId)), e == t ? n.fn(this) : n.inverse(this)
}), $(function() {
e.isTouchDevice && (document.addEventListener("touchstart", t, !0), document.addEventListener("touchmove", t, !0), document.addEventListener("touchend", t, !0), document.addEventListener("touchcancel", t, !0), FastClick.attach(document.body)), $.support.transition = function() {
var e = function() {
var e = document.createElement("bootstrap"),
t = {
WebkitTransition: "webkitTransitionEnd",
MozTransition: "transitionend",
OTransition: "oTransitionEnd otransitionend",
transition: "transitionend"
},
n;
for (n in t) if (e.style[n] !== undefined) return t[n]
}();
return e && {
end: e
}
}()
}), e
}), define("routes", [], function() {
return Backbone.Router.extend({
routes: {
"": "getDefault",
home: "getHome",
latest: "getLatest",
starred: "getStarred",
"subscription/*id": "getSubscription",
"category/:id": "getCategory",
organize: "getOrganize",
settings: "getSettings",
"quickadd/*id": "quickAddSubscription",
"*default": "getDefault"
},
getDefault: function() {
var e = rdr.preference.get("landing_page");
this.navigate(e, {
trigger: !0
})
},
getHome: function() {
subpub.trigger("nav:list"), subpub.trigger("feed:get", "home")
},
getOrganize: function() {
subpub.trigger("feed:get", "organize")
},
getLatest: function() {
subpub.trigger("nav:list"), subpub.trigger("feed:get", "user/" + rdr.userId + "/state/" + "reading-list", "category")
},
getStarred: function() {
subpub.trigger("nav:list"), subpub.trigger("feed:get", "user/" + rdr.userId + "/state/" + "starred", "category")
},
getSubscription: function(e) {
subpub.trigger("nav:list"), subpub.trigger("feed:get", e, "subscription")
},
getCategory: function(e) {
subpub.trigger("nav:list"), subpub.trigger("feed:get", "user/" + rdr.userId + "/label/" + e, "category")
},
getSettings: function() {
subpub.trigger("nav:list"), subpub.trigger("feed:get", "settings")
},
quickAddSubscription: function(e) {
subpub.trigger("nav:list"), subpub.trigger("feed:add", {
quickadd: e
})
}
})
}), define("models/subscription", [], function() {
var e = Backbone.Model.extend({
url: "reader/api/0/subscription/edit",
defaults: {
hasChildren: !1,
count: 0
},
initialize: function() {
this.boundUpdateCount = _.bind(this.updateCount, this), this.boundChangeCount = _.bind(this.changeCount, this), this.set("originIcon", this.originIcon()), this.set("count", 0), subpub.on("count:update", this.boundUpdateCount), subpub.on("read:" + this.get("id"), this.boundChangeCount)
},
originIcon: function() {
var e = (this.get("htmlUrl") || "").match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i),
t = e && e[1];
return "//s2.googleusercontent.com/s2/favicons?domain=" + t + "&amp;
alt=feed"
},
updateCount: function(e) {
var t = _.find(e, function(e) {
return this.get("id") == e.id
}, this);
if (t) {
var n = t.count;
this.set("count", n)
} else this.set("count", 0)
},
toJson: function() {
var e = Backbone.Model.prototype.toJSON.call(this);
return e.count && e.count > 1e3 && (e.count = "999+"), e
},
changeCount: function(e) {
var t = this.get("count");
e && t > 0 ? t-- : t < 1e3 && t++, this.set("count", t)
},
clearListeners: function() {
subpub.off("count:update", this.boundUpdateCount), subpub.off("read:" + this.get("id"), this.boundChangeCount)
},
update: function(e, t, n) {
var r = this,
i = _.map(r.get("categories"), function(e) {
return e.id
}),
s = {},
o = _.difference(i, t),
u = _.difference(t, i);
s = {
ac: "edit",
s: this.get("id"),
t: e,
a: u,
r: o
}, this.save(s, {
patch: !0,
success: function() {
r.set("title", e), n ? subpub.trigger("feed:reload") : (r.set("categories", _.map(t, function(e) {
return {
label: e.split("label/")[1],
id: e
}
})), rdr.collections.tags.each(function(e) {
if (o.indexOf(e.get("id")) >= 0 || u.indexOf(e.get("id") > 0)) e.clearListeners(), e.getState(), e.addListeners()
}), subpub.trigger("feed:reset"))
}
})
},
updateCategory: function(e, t) {
var n = this,
r = {
a: e ? e.get("id") : undefined,
r: t ? t.get("id") : undefined,
ac: "edit",
s: this.get("id"),
t: this.get("title")
};
this.save(r, {
patch: !0,
success: function() {
var r = n.get("categories");
e && r.push({
id: e.get("id"),
label: e.get("label")
}), t && (r = _.reject(r, function(e) {
return e.id === t.get("id")
})), n.set("categories", r), e && (e.clearListeners(), e.getState(), e.addListeners()), t && (t.clearListeners(), t.getState(), t.addListeners()), subpub.trigger("feed:reset")
}
})
},
unsubscribe: function() {
var e = this,
t = e.get("id"),
n = {
ac: "unsubscribe",
s: t,
t: e.get("title")
};
this.save(n, {
patch: !0,
success: function() {
var t = _.map(e.get("categories"), function(e) {
return e.id
});
e.trigger("destroy", e, e.collection), rdr.collections.tags.each(function(e) {
if (t.indexOf(e.get("id")) >= 0 || e.get("state") === "latest") e.clearListeners(), e.getState(), e.addListeners()
}), subpub.trigger("feed:reset")
}
})
}
});
return e
}), define("collections/subscriptions", ["models/subscription"], function(e) {
var t = Backbone.Collection.extend({
model: e,
url: "reader/api/0/subscription/list",
parse: function(e) {
return e.subscriptions
}
});
return t
}), define("models/tag", [], function() {
var e = Backbone.Model.extend({
url: "/reader/api/0/edit-tag",
defaults: {
count: 0,
icon: "icon-tag",
hideCount: !0
},
initialize: function() {
var e = this;
if (e.get("label")) e.set("title", this.get("label"));
else {
var t = e.get("id").split("label/")[1];
e.set("label", t), e.set("title", t)
}
e.getState(), e.boundUpdateCount = _.bind(this.updateCount, e), e.boundChangeCount = _.bind(this.changeCount, e), e.set("count", 0), e.addListeners()
},
getState: function() {
var e = this,
t = e.get("id");
e.feeds = _.map(rdr.collections.subscriptions.filter(function(n) {
var r = _.map(n.get("categories"), function(e) {
return e.id
});
return _.contains(r, t) || e.get("state") === "latest"
}), function(e) {
return e.get("id")
}), e.feeds.length > 0 ? (e.set("isCategory", !0), e.set("hideCount", !1)) : (e.set("isCategory", !1), e.set("hideCount", !0))
},
originIcon: function() {
var e = (this.get("htmlUrl") || "").match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i),
t = e && e[1];
return "//s2.googleusercontent.com/s2/favicons?domain=" + t + "&amp;
alt=feed"
},
toJson: function() {
var e = Backbone.Model.prototype.toJSON.call(this);
return e.count && e.count > 1e3 && (e.count = "999+"), e
},
updateCount: function(e) {
var t = _.find(e, function(e) {
return this.get("id") == e.id
}, this);
if (t) {
var n = t.count;
this.set("count", n)
} else this.set("count", 0)
},
changeCount: function(e) {
var t = this.get("count");
e && t > 0 ? t-- : t++, this.set("count", t)
},
addListeners: function() {
var e = this,
t = this.get("id");
subpub.on("count:update", this.boundUpdateCount), _.each(e.feeds, function(t) {
subpub.on("read:" + t, e.boundChangeCount)
})
},
clearListeners: function() {
var e = this;
subpub.off("count:update", this.boundUpdateCount), _.each(e.feeds, function(t) {
subpub.off("read:" + t, e.boundChangeCount)
})
},
update: function(e) {
var t = this,
n = {
s: t.get("id"),
t: t.get("label"),
dest: "user/" + rdr.userId + "/label/" + e,
token: rdr.getToken()
};
this.save(n, {
patch: !0,
success: function() {
t.set("label", e), t.set("title", e), t.set("id", "user/" + rdr.userId + "/label/" + e), subpub.trigger("feed:reset")
}
})
},
disable: function() {
var e = this,
t = e.get("id"),
n = {
s: t,
t: e.get("label"),
token: rdr.getToken()
};
$.ajax({
type: "POST",
dataType: "json",
url: "/reader/api/0/disable-tag",
data: n,
success: function(n) {
rdr.collections.subscriptions.each(function(n) {
if (_.contains(e.feeds, n.get("id"))) {
var r = _.filter(n.get("categories"), function(e) {
return e.id !== t
});
n.set("categories", r)
}
}), e.clearListeners(), e.trigger("destroy", e, e.collection), subpub.trigger("feed:reset")
}
})
}
});
return e
}), define("collections/tags", ["models/tag"], function(e) {
var t = Backbone.Collection.extend({
model: e,
url: "reader/api/0/tag/list",
parse: function(e) {
return _.sortBy(_.filter(e.tags, function(e) {
return !/\/state\//gi.test(e.id)
}), function(e) {
return e.id
})
}
});
return t
}), define("models/preference", [], function() {
var e = Backbone.Model.extend({
url: "/reader/settings",
defaults: {
landing_page: "home",
font_size: 1,
confirm_read_all: !0,
confirm_unsubscribe: !0,
confirm_delete_tag: !0,
hide_cat_no_count: !1,
show_unread_count: !0,
layout: "list",
sort: "n",
xt: "",
theme: "dark"
},
getSubscriptionOrder: function(e) {
var t = this.get(e),
n = t && t["subscription-ordering"] ? t["subscription-ordering"] : "";
return n.split("|")
}
});
return e
}), define("app", ["config", "routes", "collections/subscriptions", "collections/tags", "models/preference"], function(e, t, n, r, i) {
/mobile/.test(window.location.search) && (e.phone = !0);
var s = function() {
this.options = e
};
return s.prototype = {
csrf: null,
token: null,
views: {},
collections: {},
tokenInterval: 18e5,
userId: null,
lang: "en",
ie: e.ie,
baseTags: function() {
var e = this;
return [{
id: "home",
label: e.getTranslation("nav.home", e.lang),
hideCount: !0,
state: "home",
icon: "icon-home"
}, {
id: "user/" + e.userId + "/state/" + "starred",
label: e.getTranslation("nav.starred", e.lang),
hideCount: !0,
state: "starred",
icon: "icon-star"
}, {
id: "user/" + e.userId + "/state/" + "reading-list",
label: e.getTranslation("nav.all", e.lang),
hideCount: !1,
state: "latest",
icon: "icon-all"
}]
},
initialize: function() {
var t = this,
n = $(document.body);
e.isTouchDevice ? n.addClass("is-touch-device") : n.addClass("is-desktop"), t.loadCss(e.phone ? "/css/papp.css" : "/css/app.css").then(_.bind(t.getAuthToken, t)).then(_.bind(t.validateAuthToken, t)).then(_.bind(t.setAuthToken, t)).then(_.bind(t.getUser, t)).then(_.bind(t.setUser, t)).then(_.bind(t.bootstrapApp, t), _.bind(t.loadAuthView, t))
},
getAuthToken: function() {
return $.ajax({
url: this.options.server + "/auth/getToken",
dataType: "jsonp",
jsonp: "c",
data: {
devId: this.options.devId,
referer: this.options.urlEncoder(this.options.host),
f: "json"
}
})
},
getUser: function() {
var e = this;
return $.ajax({
url: "reader/user/info",
dataType: "json",
data: {
token: e.getToken()
}
})
},
setUser: function(e) {
var t = this,
n = $.Deferred();
return t.options.userData = e, t.userId = e.id, window.userId = e.id, e.beta ? n.resolve(e) : n.reject(e), n.promise()
},
validateAuthToken: function(e) {
var t = $.Deferred();
return e.response.statusCode === 200 ? t.resolve(e.response.data.token.a) : e.response.statusCode === 445 ? t.reject(e) : t.reject(e), t.promise()
},
setAuthToken: function(e) {
this.options.token = e
},
getToken: function() {
return this.options.token
},
doBetaLogin: function(e) {
var t = this;
window.location = t.options.server + "/auth/login?devId=" + t.options.urlEncoder(t.options.devId) + "&f=qs&language=en-us&supportedIdType=aol,facebook,twitter,google&succUrl=" + t.options.urlEncoder(t.options.succUrl)
},
doLogin: function(e) {
var t = this;
window.location = t.options.server + "/auth/login?devId=" + t.options.urlEncoder(t.options.devId) + "&f=qs&language=en-us&supportedIdType=aol,facebook,twitter,google&succUrl=" + t.options.urlEncoder(t.options.succUrl)
},
doSignup: function(e) {
var t = this;
window.location = t.options.registrationUrl + "/productsweb/?promocode=" + t.options.urlEncoder(promocode) + "&siteState=" + t.options.urlEncoder(t.options.succUrl)
},
doLogout: function() {
var e = this;
window.location = e.options.server + "/auth/logout?devId=" + e.options.urlEncoder(e.options.devId) + "&f=qs&language=en-us&a=" + e.options.urlEncoder(e.getToken()) + "&referer=" + e.options.host + "&succUrl=" + e.options.urlEncoder(e.options.succUrl)
},
loadAuthView: function(e) {
var t = this;
t.loadCss(window.location.host === "reader.aol.com" ? "/css/homepage.css" : "/css/homepage2.css").then(_.bind(t.loadJs, t, window.location.host === "reader.aol.com" ? "views/homepage" : "views/homepage2")).then(_.bind(t.initAuthApp, t)), subpub.on("auth:betaLogin", _.bind(t.doBetaLogin, t)), subpub.on("auth:login", _.bind(t.doLogin, t)), subpub.on("auth:signup", _.bind(t.doSignup, t)), subpub.on("auth:logout", _.bind(t.doLogout, t))
},
initAuthApp: function(e) {
var t = this;
t.app = new e(t.options)
},
bootstrapApp: function() {
var t = this,
n = $(document.body);
n.addClass("loading").prepend('<h2 class="app-load" id="app-load"><img src="/' + dir + "/img/" + (e.phone ? "loader-24x24.gif" : "loader-initial.gif") + '" />Loading AOL Reader</h2>'), t.initEvents().then(_.bind(t.initCollections, t)).then(_.bind(t.initPreference, t)).then(_.bind(t.fetchSubscriptions, t)).then(_.bind(t.fetchTags, t)).then(_.bind(t.getUnreadCounts, t)).then(_.bind(t.loadJs, t, e.phone ? "mobile-views/app" : "views/app")).then(_.bind(t.initApp, t)).always(_.bind(t.initHotKeys, t)).always(_.bind(t.initRoutes, t)).always(_.bind(t.initHistory, t))
},
initRoutes: function() {
var e = this,
n = $.Deferred();
return e.routes = new t({
pushState: !0
}), n.resolve(), n.promise()
},
initCollections: function() {
var e = this;
e.collections.subscriptions = new n, e.collections.tags = new r
},
initPreference: function() {
var e = this,
t = $.Deferred();
return e.preference = new i, e.preference.fetch({
success: function() {
t.resolve()
}
}), t.promise()
},
initEvents: function() {
var e = this,
t = $.Deferred();
return $(window).on("scroll", _.throttle(function() {
subpub.trigger("window:scroll")
}, 200)), $(window).on("orientationchange", function() {
subpub.trigger("orientationChange")
}), subpub.on("auth:logout", _.bind(e.doLogout, e)), subpub.on("feed:refresh", _.bind(e.refresh, e)), subpub.on("feed:added", _.bind(e.feedadded, e)), subpub.on("feed:reload", _.bind(e.feedReset, e)), subpub.on("unreadcount:update", _.bind(e.getUnreadCounts, e)), e.initIdleTimer(), t.resolve(), t.promise()
},
initApp: function(e) {
var t = this;
t.app = new e(t.options)
},
initHotKeys: function() {
var t = this;
if (e.isTouchDevice) return;
Mousetrap.bind("=", function() {
subpub.trigger("magnify", "more")
}), Mousetrap.bind("-", function() {
subpub.trigger("magnify", "less")
}), Mousetrap.bind("r", function() {
subpub.trigger("feed:refresh")
}), Mousetrap.bind("1", function() {
subpub.trigger("feed:layout", "list")
}), Mousetrap.bind("2", function() {
subpub.trigger("feed:layout", "card")
}), Mousetrap.bind("3", function() {
subpub.trigger("feed:layout", "full")
}), Mousetrap.bind("4", function() {
subpub.trigger("feed:layout", "pane")
}), Mousetrap.bind("a", function() {
subpub.trigger("feed:add")
}), Mousetrap.bind("shift+a", function() {
subpub.trigger("feed:mark")
}), Mousetrap.bind(["j"], function() {
subpub.trigger("article:next")
}), Mousetrap.bind(["k"], function() {
subpub.trigger("article:prev")
}), Mousetrap.bind(["n"], function() {
subpub.trigger("article:focusnext")
}), Mousetrap.bind(["p"], function() {
subpub.trigger("article:focusprev")
}), Mousetrap.bind(["o"], function() {
subpub.trigger("article:focusopen")
}), Mousetrap.bind(["shift+n"], function() {
subpub.trigger("subscription:focusnext")
}), Mousetrap.bind(["shift+p"], function() {
subpub.trigger("subscription:focusprev")
}), Mousetrap.bind(["shift+x"], function() {
subpub.trigger("subscription:focustoggle")
}), Mousetrap.bind(["shift+o"], function() {
subpub.trigger("subscription:focusopen")
}), Mousetrap.bind(["space"], function(e) {
return subpub.trigger("article:pagedown"), !1
}), Mousetrap.bind(["shift+space"], function(e) {
return subpub.trigger("article:pageup"), !1
}), Mousetrap.bind("shift+m", function() {
subpub.trigger("feed:mark")
}), Mousetrap.bind("m", function() {
subpub.trigger("feed:read")
}), Mousetrap.bind("s", function() {
subpub.trigger("article:starred")
}), Mousetrap.bind("v", function() {
subpub.trigger("article:original")
}), Mousetrap.bind("t", function() {
subpub.trigger("article:tags")
}), Mousetrap.bind("g h", function() {
t.routes.navigate("home", {
trigger: !0
})
}), Mousetrap.bind("g a", function() {
t.routes.navigate("latest", {
trigger: !0
})
}), Mousetrap.bind("g s", function() {
t.routes.navigate("starred", {
trigger: !0
})
}), Mousetrap.bind("escape", function() {
subpub.trigger("escape")
}), Mousetrap.bind("shit+?", function() {
subpub.trigger("shortcuts")
})
},
fetchTags: function() {
var e = this,
t = $.Deferred();
return e.collections.tags.add(this.baseTags()), e.collections.tags.fetch({
success: function() {
t.resolve()
},
remove: !1
}), t.promise()
},
fetchSubscriptions: function() {
var e = this,
t = $.Deferred();
return e.collections.subscriptions.fetch({
success: function() {
t.resolve()
}
}), t.promise()
},
resetFeeds: function() {
subpub.trigger("feed:reset")
},
clearSubscriptions: function() {
var e = this,
t = $.Deferred();
return e.collections.tags.each(function(e) {
e.clearListeners()
}), e.collections.subscriptions.each(function(e) {
e.clearListeners()
}), e.collections.tags.reset(), e.collections.subscriptions.reset(), t.resolve(), t.promise()
},
initHistory: function() {
Backbone.history.start({
trigger: !e.phone
})
},
getUnreadCounts: function() {
var e = this;
return e.ck = +(new Date).getTime(), $.ajax({
url: "/reader/api/0/unread-count?output=json",
dataType: "json",
data: {
token: e.getToken(),
ck: e.ck
},
success: function(e) {
subpub.trigger("count:update", e.unreadcounts)
}
})
},
getCk: function() {
var e = this;
return e.ck
},
feedReset: function() {
var e = this;
e.clearSubscriptions().then(_.bind(e.fetchSubscriptions, e)).then(_.bind(e.fetchTags, e)).then(_.bind(e.getUnreadCounts, e)).then(_.bind(e.resetFeeds, e))
},
feedadded: function(e) {
var t = this;
t.clearSubscriptions().then(_.bind(t.fetchSubscriptions, t)).then(_.bind(t.fetchTags, t)).then(_.bind(t.getUnreadCounts, t)).then(_.bind(t.resetFeeds, t)).then(function() {
e && t.routes.navigate("/subscription/" + e, {
trigger: !0
})
})
},
refresh: function(e) {
var t = this;
t.getUnreadCounts()
},
getTranslation: function(e) {
var t = this,
n = e.split("."),
r = t.lang,
i = readerTranslations[r];
for (var s = 0;
s < n.length;
s++) {
var o = n[s];
i = i[o];
if (typeof i == "string") return i;
if (!i) return e
}
},
loadJs: function(e) {
var t = this,
n = $.Deferred();
return require([e], function(e) {
t.app = new s(t.options), n.resolve(e)
}), n.promise()
},
loadCss: function(e) {
var t = this,
n = $.Deferred(),
r = document.getElementsByTagName("head")[0],
i = document.createElement("style"),
s, o;
i.textContent = '@import "' + assetDir + e + "?v=" + rev + '"';
var u, a;
return "sheet" in i ? (u = "sheet", a = "cssRules") : (u = "styleSheet", a = "rules"), s = setInterval(function() {
try {
i[u] && i[u][a].length && (clearInterval(s), clearTimeout(o), n.resolve())
} catch (e) {} finally {}
}, 10), o = setTimeout(function() {
clearInterval(s), clearTimeout(o), r.removeChild(i), n.reject()
}, 15e3), r.appendChild(i), n.promise()
},
initIdleTimer: function() {
function r() {
clearInterval(e.unreadInterval), e.unreadInterval = null
}
function i() {
e.unreadInterval || e.initUnreadInterval(), clearTimeout(t), t = setTimeout(r, 6e5)
}
var e = this,
t, n = $(document);
n.on("mousemove", i), n.on("keypress", i), n.on("touchstart", i), i()
},
initUnreadInterval: function() {
var e = this;
e.unreadInterval = setInterval(_.bind(e.getUnreadCounts, e), 6e5)
}
}, s
}), requirejs.config({
baseUrl: "/" + dir + "/js/app",
urlArgs: "bust=" + (new Date).getTime(),
paths: {
vendor: "../vendor",
text: "../vendor/text"
},
shim: {
"vendor/jquery.isotope": {
exports: "$.isotope"
},
"vendor/jquery.dropdown": {
exports: "$.dropdown"
},
"vendor/jquery-sortable": {
exports: "$.sortable"
},
"vendor/jquery.tipsy": {
exports: "$.tipsy"
},
"vendor/mousetrap": {
exports: "Mousetrap"
},
"vendor/lodash": {
exports: "_"
},
"vendor/underscore.string": {
deps: ["vendor/lodash"],
exports: "_.str"
},
"vendor/backbone": {
deps: ["vendor/lodash"],
exports: "Backbone"
},
"vendor/backbone.readerSync": {
deps: ["vendor/backbone"],
exports: "Backbone.readerSync"
},
"vendor/handlebars": {
exports: "Handlebars"
},
"vendor/moment": {
exports: "moment"
},
"vendor/fastclick": {
exports: "fastclick"
},
translations: {
exports: "translations"
},
discovery: {
exports: "discovery"
},
app: {
deps: ["vendor/jquery.isotope", "vendor/jquery.tipsy", "vendor/jquery.dropdown", "vendor/jquery-sortable", "vendor/mousetrap", "vendor/lodash", "vendor/underscore.string", "vendor/backbone", "vendor/backbone.readerSync", "vendor/handlebars", "vendor/moment", "vendor/fastclick", "translations", "discovery"]
}
}
}), require(["app"], function(e) {
window.subpub = _.extend({}, Backbone.Events), window.rdr = new e, window.rdr.initialize()
}), define("main", function() {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment