Created
September 3, 2019 23:40
-
-
Save ajford/abbd94096141dc2e433d7a0d893051c7 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function html5ModeConfig(e) { | |
window.history && history.pushState ? e.html5Mode(!0) : e.html5Mode(!1).hashPrefix("!") | |
} | |
function toBoolean(e) { | |
if (e && 0 !== e.length) { | |
var t = angular.lowercase("" + e); | |
e = !("f" == t || "0" == t || "false" == t || "no" == t || "n" == t || "[]" == t) | |
} else e = !1; | |
return e | |
} | |
spreedlyIntegrationServiceFactory.$inject = ["$q", "lang", "utilsService"], utilsServiceFactory.$inject = ["$q"], Object.assign || Object.defineProperty(Object, "assign", { | |
enumerable: !1, | |
configurable: !0, | |
writable: !0, | |
value: function (e, t) { | |
"use strict"; | |
if (null == e) throw new TypeError("Cannot convert first argument to object"); | |
for (var n = Object(e), r = 1; r < arguments.length; r++) { | |
var o = arguments[r]; | |
if (null != o) for (var i = Object.keys(Object(o)), a = 0, c = i.length; a < c; a++) { | |
var s = i[a], l = Object.getOwnPropertyDescriptor(o, s); | |
void 0 !== l && l.enumerable && (n[s] = o[s]) | |
} | |
} | |
return n | |
} | |
}), Array.isArray || (Array.isArray = function (e) { | |
return "[object Array]" === Object.prototype.toString.call(e) | |
}), function () { | |
if ("function" == typeof window.CustomEvent) return !1; | |
function e(e, t) { | |
t = t || {bubbles: !1, cancelable: !1, detail: void 0}; | |
var n = document.createEvent("CustomEvent"); | |
return n.initCustomEvent(e, t.bubbles, t.cancelable, t.detail), n | |
} | |
e.prototype = window.Event.prototype, window.CustomEvent = e | |
}(), Array.prototype.find || (Array.prototype.find = function (e) { | |
if (null == this) throw new TypeError("Array.prototype.find called on null or undefined"); | |
if ("function" != typeof e) throw new TypeError("predicate must be a function"); | |
for (var t, n = Object(this), r = n.length >>> 0, o = arguments[1], i = 0; i < r; i++) if (t = n[i], e.call(o, t, i, n)) return t | |
}), Object.keys || (Object.keys = function () { | |
"use strict"; | |
var e = Object.prototype.hasOwnProperty, t = !{toString: null}.propertyIsEnumerable("toString"), | |
n = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"], | |
r = n.length; | |
return function (o) { | |
if ("object" != typeof o && ("function" != typeof o || null === o)) throw new TypeError("Object.keys called on non-object"); | |
var i, a, c = []; | |
for (i in o) e.call(o, i) && c.push(i); | |
if (t) for (a = 0; a < r; a++) e.call(o, n[a]) && c.push(n[a]); | |
return c | |
} | |
}()), Array.prototype.reduce || (Array.prototype.reduce = function (e) { | |
"use strict"; | |
if (null == this) throw new TypeError("Array.prototype.reduce called on null or undefined"); | |
if ("function" != typeof e) throw new TypeError(e + " is not a function"); | |
var t, n = Object(this), r = n.length >>> 0, o = 0; | |
if (arguments.length >= 2) t = arguments[1]; else { | |
for (; o < r && !(o in n);) o++; | |
if (o >= r) throw new TypeError("Reduce of empty array with no initial value"); | |
t = n[o++] | |
} | |
for (; o < r; o++) o in n && (t = e(t, n[o], o, n)); | |
return t | |
}), Array.prototype.fill || (Array.prototype.fill = function (e) { | |
if (null == this) throw new TypeError("this is null or not defined"); | |
for (var t = Object(this), n = t.length >>> 0, r = arguments[1] >> 0, o = r < 0 ? Math.max(n + r, 0) : Math.min(r, n), i = arguments[2], a = void 0 === i ? n : i >> 0, c = a < 0 ? Math.max(n + a, 0) : Math.min(a, n); o < c;) t[o] = e, o++; | |
return t | |
}), Object.freeze || (Object.freeze = function (e) { | |
if (Object(e) !== e) throw new TypeError("Object.freeze can only be called on Objects."); | |
return e | |
}), function (e, t) { | |
"object" == typeof module && "object" == typeof module.exports ? module.exports = e.document ? t(e, !0) : function (e) { | |
if (!e.document) throw new Error("jQuery requires a window with a document"); | |
return t(e) | |
} : t(e) | |
}("undefined" != typeof window ? window : this, function (e, t) { | |
var n = [], r = e.document, o = n.slice, i = n.concat, a = n.push, c = n.indexOf, s = {}, l = s.toString, | |
u = s.hasOwnProperty, d = {}, p = "1.12.4", f = function (e, t) { | |
return new f.fn.init(e, t) | |
}, m = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, h = /^-ms-/, g = /-([\da-z])/gi, v = function (e, t) { | |
return t.toUpperCase() | |
}; | |
function y(e) { | |
var t = !!e && "length" in e && e.length, n = f.type(e); | |
return "function" !== n && !f.isWindow(e) && ("array" === n || 0 === t || "number" == typeof t && t > 0 && t - 1 in e) | |
} | |
f.fn = f.prototype = { | |
jquery: p, constructor: f, selector: "", length: 0, toArray: function () { | |
return o.call(this) | |
}, get: function (e) { | |
return null != e ? 0 > e ? this[e + this.length] : this[e] : o.call(this) | |
}, pushStack: function (e) { | |
var t = f.merge(this.constructor(), e); | |
return t.prevObject = this, t.context = this.context, t | |
}, each: function (e) { | |
return f.each(this, e) | |
}, map: function (e) { | |
return this.pushStack(f.map(this, function (t, n) { | |
return e.call(t, n, t) | |
})) | |
}, slice: function () { | |
return this.pushStack(o.apply(this, arguments)) | |
}, first: function () { | |
return this.eq(0) | |
}, last: function () { | |
return this.eq(-1) | |
}, eq: function (e) { | |
var t = this.length, n = +e + (0 > e ? t : 0); | |
return this.pushStack(n >= 0 && t > n ? [this[n]] : []) | |
}, end: function () { | |
return this.prevObject || this.constructor() | |
}, push: a, sort: n.sort, splice: n.splice | |
}, f.extend = f.fn.extend = function () { | |
var e, t, n, r, o, i, a = arguments[0] || {}, c = 1, s = arguments.length, l = !1; | |
for ("boolean" == typeof a && (l = a, a = arguments[c] || {}, c++), "object" == typeof a || f.isFunction(a) || (a = {}), c === s && (a = this, c--); s > c; c++) if (null != (o = arguments[c])) for (r in o) e = a[r], a !== (n = o[r]) && (l && n && (f.isPlainObject(n) || (t = f.isArray(n))) ? (t ? (t = !1, i = e && f.isArray(e) ? e : []) : i = e && f.isPlainObject(e) ? e : {}, a[r] = f.extend(l, i, n)) : void 0 !== n && (a[r] = n)); | |
return a | |
}, f.extend({ | |
expando: "jQuery" + (p + Math.random()).replace(/\D/g, ""), isReady: !0, error: function (e) { | |
throw new Error(e) | |
}, noop: function () { | |
}, isFunction: function (e) { | |
return "function" === f.type(e) | |
}, isArray: Array.isArray || function (e) { | |
return "array" === f.type(e) | |
}, isWindow: function (e) { | |
return null != e && e == e.window | |
}, isNumeric: function (e) { | |
var t = e && e.toString(); | |
return !f.isArray(e) && t - parseFloat(t) + 1 >= 0 | |
}, isEmptyObject: function (e) { | |
var t; | |
for (t in e) return !1; | |
return !0 | |
}, isPlainObject: function (e) { | |
var t; | |
if (!e || "object" !== f.type(e) || e.nodeType || f.isWindow(e)) return !1; | |
try { | |
if (e.constructor && !u.call(e, "constructor") && !u.call(e.constructor.prototype, "isPrototypeOf")) return !1 | |
} catch (e) { | |
return !1 | |
} | |
if (!d.ownFirst) for (t in e) return u.call(e, t); | |
for (t in e) ; | |
return void 0 === t || u.call(e, t) | |
}, type: function (e) { | |
return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? s[l.call(e)] || "object" : typeof e | |
}, globalEval: function (t) { | |
t && f.trim(t) && (e.execScript || function (t) { | |
e.eval.call(e, t) | |
})(t) | |
}, camelCase: function (e) { | |
return e.replace(h, "ms-").replace(g, v) | |
}, nodeName: function (e, t) { | |
return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase() | |
}, each: function (e, t) { | |
var n, r = 0; | |
if (y(e)) for (n = e.length; n > r && !1 !== t.call(e[r], r, e[r]); r++) ; else for (r in e) if (!1 === t.call(e[r], r, e[r])) break; | |
return e | |
}, trim: function (e) { | |
return null == e ? "" : (e + "").replace(m, "") | |
}, makeArray: function (e, t) { | |
var n = t || []; | |
return null != e && (y(Object(e)) ? f.merge(n, "string" == typeof e ? [e] : e) : a.call(n, e)), n | |
}, inArray: function (e, t, n) { | |
var r; | |
if (t) { | |
if (c) return c.call(t, e, n); | |
for (r = t.length, n = n ? 0 > n ? Math.max(0, r + n) : n : 0; r > n; n++) if (n in t && t[n] === e) return n | |
} | |
return -1 | |
}, merge: function (e, t) { | |
for (var n = +t.length, r = 0, o = e.length; n > r;) e[o++] = t[r++]; | |
if (n != n) for (; void 0 !== t[r];) e[o++] = t[r++]; | |
return e.length = o, e | |
}, grep: function (e, t, n) { | |
for (var r = [], o = 0, i = e.length, a = !n; i > o; o++) !t(e[o], o) !== a && r.push(e[o]); | |
return r | |
}, map: function (e, t, n) { | |
var r, o, a = 0, c = []; | |
if (y(e)) for (r = e.length; r > a; a++) null != (o = t(e[a], a, n)) && c.push(o); else for (a in e) null != (o = t(e[a], a, n)) && c.push(o); | |
return i.apply([], c) | |
}, guid: 1, proxy: function (e, t) { | |
var n, r, i; | |
return "string" == typeof t && (i = e[t], t = e, e = i), f.isFunction(e) ? (n = o.call(arguments, 2), (r = function () { | |
return e.apply(t || this, n.concat(o.call(arguments))) | |
}).guid = e.guid = e.guid || f.guid++, r) : void 0 | |
}, now: function () { | |
return +new Date | |
}, support: d | |
}), "function" == typeof Symbol && (f.fn[Symbol.iterator] = n[Symbol.iterator]), f.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function (e, t) { | |
s["[object " + t + "]"] = t.toLowerCase() | |
}); | |
var E = function (e) { | |
var t, n, r, o, i, a, c, s, l, u, d, p, f, m, h, g, v, y, E, C = "sizzle" + 1 * new Date, | |
T = e.document, _ = 0, S = 0, w = ie(), b = ie(), A = ie(), P = function (e, t) { | |
return e === t && (d = !0), 0 | |
}, $ = 1 << 31, k = {}.hasOwnProperty, I = [], N = I.pop, D = I.push, x = I.push, O = I.slice, | |
M = function (e, t) { | |
for (var n = 0, r = e.length; r > n; n++) if (e[n] === t) return n; | |
return -1 | |
}, | |
R = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", | |
L = "[\\x20\\t\\r\\n\\f]", V = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", | |
F = "\\[" + L + "*(" + V + ")(?:" + L + "*([*^$|!~]?=)" + L + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + V + "))|)" + L + "*\\]", | |
U = ":(" + V + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + F + ")*)|.*)\\)|)", | |
B = new RegExp(L + "+", "g"), | |
H = new RegExp("^" + L + "+|((?:^|[^\\\\])(?:\\\\.)*)" + L + "+$", "g"), | |
W = new RegExp("^" + L + "*," + L + "*"), | |
j = new RegExp("^" + L + "*([>+~]|" + L + ")" + L + "*"), | |
Y = new RegExp("=" + L + "*([^\\]'\"]*?)" + L + "*\\]", "g"), q = new RegExp(U), | |
G = new RegExp("^" + V + "$"), z = { | |
ID: new RegExp("^#(" + V + ")"), | |
CLASS: new RegExp("^\\.(" + V + ")"), | |
TAG: new RegExp("^(" + V + "|[*])"), | |
ATTR: new RegExp("^" + F), | |
PSEUDO: new RegExp("^" + U), | |
CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + L + "*(even|odd|(([+-]|)(\\d*)n|)" + L + "*(?:([+-]|)" + L + "*(\\d+)|))" + L + "*\\)|)", "i"), | |
bool: new RegExp("^(?:" + R + ")$", "i"), | |
needsContext: new RegExp("^" + L + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + L + "*((?:-\\d)?\\d*)" + L + "*\\)|)(?=[^-]|$)", "i") | |
}, K = /^(?:input|select|textarea|button)$/i, Z = /^h\d$/i, J = /^[^{]+\{\s*\[native \w/, | |
Q = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, X = /[+~]/, ee = /'|\\/g, | |
te = new RegExp("\\\\([\\da-f]{1,6}" + L + "?|(" + L + ")|.)", "ig"), ne = function (e, t, n) { | |
var r = "0x" + t - 65536; | |
return r != r || n ? t : 0 > r ? String.fromCharCode(r + 65536) : String.fromCharCode(r >> 10 | 55296, 1023 & r | 56320) | |
}, re = function () { | |
p() | |
}; | |
try { | |
x.apply(I = O.call(T.childNodes), T.childNodes), I[T.childNodes.length].nodeType | |
} catch (e) { | |
x = { | |
apply: I.length ? function (e, t) { | |
D.apply(e, O.call(t)) | |
} : function (e, t) { | |
for (var n = e.length, r = 0; e[n++] = t[r++];) ; | |
e.length = n - 1 | |
} | |
} | |
} | |
function oe(e, t, r, o) { | |
var i, c, l, u, d, m, v, y, _ = t && t.ownerDocument, S = t ? t.nodeType : 9; | |
if (r = r || [], "string" != typeof e || !e || 1 !== S && 9 !== S && 11 !== S) return r; | |
if (!o && ((t ? t.ownerDocument || t : T) !== f && p(t), t = t || f, h)) { | |
if (11 !== S && (m = Q.exec(e))) if (i = m[1]) { | |
if (9 === S) { | |
if (!(l = t.getElementById(i))) return r; | |
if (l.id === i) return r.push(l), r | |
} else if (_ && (l = _.getElementById(i)) && E(t, l) && l.id === i) return r.push(l), r | |
} else { | |
if (m[2]) return x.apply(r, t.getElementsByTagName(e)), r; | |
if ((i = m[3]) && n.getElementsByClassName && t.getElementsByClassName) return x.apply(r, t.getElementsByClassName(i)), r | |
} | |
if (n.qsa && !A[e + " "] && (!g || !g.test(e))) { | |
if (1 !== S) _ = t, y = e; else if ("object" !== t.nodeName.toLowerCase()) { | |
for ((u = t.getAttribute("id")) ? u = u.replace(ee, "\\$&") : t.setAttribute("id", u = C), c = (v = a(e)).length, d = G.test(u) ? "#" + u : "[id='" + u + "']"; c--;) v[c] = d + " " + he(v[c]); | |
y = v.join(","), _ = X.test(e) && fe(t.parentNode) || t | |
} | |
if (y) try { | |
return x.apply(r, _.querySelectorAll(y)), r | |
} catch (e) { | |
} finally { | |
u === C && t.removeAttribute("id") | |
} | |
} | |
} | |
return s(e.replace(H, "$1"), t, r, o) | |
} | |
function ie() { | |
var e = []; | |
return function t(n, o) { | |
return e.push(n + " ") > r.cacheLength && delete t[e.shift()], t[n + " "] = o | |
} | |
} | |
function ae(e) { | |
return e[C] = !0, e | |
} | |
function ce(e) { | |
var t = f.createElement("div"); | |
try { | |
return !!e(t) | |
} catch (e) { | |
return !1 | |
} finally { | |
t.parentNode && t.parentNode.removeChild(t), t = null | |
} | |
} | |
function se(e, t) { | |
for (var n = e.split("|"), o = n.length; o--;) r.attrHandle[n[o]] = t | |
} | |
function le(e, t) { | |
var n = t && e, | |
r = n && 1 === e.nodeType && 1 === t.nodeType && (~t.sourceIndex || $) - (~e.sourceIndex || $); | |
if (r) return r; | |
if (n) for (; n = n.nextSibling;) if (n === t) return -1; | |
return e ? 1 : -1 | |
} | |
function ue(e) { | |
return function (t) { | |
return "input" === t.nodeName.toLowerCase() && t.type === e | |
} | |
} | |
function de(e) { | |
return function (t) { | |
var n = t.nodeName.toLowerCase(); | |
return ("input" === n || "button" === n) && t.type === e | |
} | |
} | |
function pe(e) { | |
return ae(function (t) { | |
return t = +t, ae(function (n, r) { | |
for (var o, i = e([], n.length, t), a = i.length; a--;) n[o = i[a]] && (n[o] = !(r[o] = n[o])) | |
}) | |
}) | |
} | |
function fe(e) { | |
return e && void 0 !== e.getElementsByTagName && e | |
} | |
for (t in n = oe.support = {}, i = oe.isXML = function (e) { | |
var t = e && (e.ownerDocument || e).documentElement; | |
return !!t && "HTML" !== t.nodeName | |
}, p = oe.setDocument = function (e) { | |
var t, o, a = e ? e.ownerDocument || e : T; | |
return a !== f && 9 === a.nodeType && a.documentElement ? (m = (f = a).documentElement, h = !i(f), (o = f.defaultView) && o.top !== o && (o.addEventListener ? o.addEventListener("unload", re, !1) : o.attachEvent && o.attachEvent("onunload", re)), n.attributes = ce(function (e) { | |
return e.className = "i", !e.getAttribute("className") | |
}), n.getElementsByTagName = ce(function (e) { | |
return e.appendChild(f.createComment("")), !e.getElementsByTagName("*").length | |
}), n.getElementsByClassName = J.test(f.getElementsByClassName), n.getById = ce(function (e) { | |
return m.appendChild(e).id = C, !f.getElementsByName || !f.getElementsByName(C).length | |
}), n.getById ? (r.find.ID = function (e, t) { | |
if (void 0 !== t.getElementById && h) { | |
var n = t.getElementById(e); | |
return n ? [n] : [] | |
} | |
}, r.filter.ID = function (e) { | |
var t = e.replace(te, ne); | |
return function (e) { | |
return e.getAttribute("id") === t | |
} | |
}) : (delete r.find.ID, r.filter.ID = function (e) { | |
var t = e.replace(te, ne); | |
return function (e) { | |
var n = void 0 !== e.getAttributeNode && e.getAttributeNode("id"); | |
return n && n.value === t | |
} | |
}), r.find.TAG = n.getElementsByTagName ? function (e, t) { | |
return void 0 !== t.getElementsByTagName ? t.getElementsByTagName(e) : n.qsa ? t.querySelectorAll(e) : void 0 | |
} : function (e, t) { | |
var n, r = [], o = 0, i = t.getElementsByTagName(e); | |
if ("*" === e) { | |
for (; n = i[o++];) 1 === n.nodeType && r.push(n); | |
return r | |
} | |
return i | |
}, r.find.CLASS = n.getElementsByClassName && function (e, t) { | |
return void 0 !== t.getElementsByClassName && h ? t.getElementsByClassName(e) : void 0 | |
}, v = [], g = [], (n.qsa = J.test(f.querySelectorAll)) && (ce(function (e) { | |
m.appendChild(e).innerHTML = "<a id='" + C + "'></a><select id='" + C + "-\r\\' msallowcapture=''><option selected=''></option></select>", e.querySelectorAll("[msallowcapture^='']").length && g.push("[*^$]=" + L + "*(?:''|\"\")"), e.querySelectorAll("[selected]").length || g.push("\\[" + L + "*(?:value|" + R + ")"), e.querySelectorAll("[id~=" + C + "-]").length || g.push("~="), e.querySelectorAll(":checked").length || g.push(":checked"), e.querySelectorAll("a#" + C + "+*").length || g.push(".#.+[+~]") | |
}), ce(function (e) { | |
var t = f.createElement("input"); | |
t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("name", "D"), e.querySelectorAll("[name=d]").length && g.push("name" + L + "*[*^$|!~]?="), e.querySelectorAll(":enabled").length || g.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), g.push(",.*:") | |
})), (n.matchesSelector = J.test(y = m.matches || m.webkitMatchesSelector || m.mozMatchesSelector || m.oMatchesSelector || m.msMatchesSelector)) && ce(function (e) { | |
n.disconnectedMatch = y.call(e, "div"), y.call(e, "[s!='']:x"), v.push("!=", U) | |
}), g = g.length && new RegExp(g.join("|")), v = v.length && new RegExp(v.join("|")), t = J.test(m.compareDocumentPosition), E = t || J.test(m.contains) ? function (e, t) { | |
var n = 9 === e.nodeType ? e.documentElement : e, r = t && t.parentNode; | |
return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r))) | |
} : function (e, t) { | |
if (t) for (; t = t.parentNode;) if (t === e) return !0; | |
return !1 | |
}, P = t ? function (e, t) { | |
if (e === t) return d = !0, 0; | |
var r = !e.compareDocumentPosition - !t.compareDocumentPosition; | |
return r || (1 & (r = (e.ownerDocument || e) === (t.ownerDocument || t) ? e.compareDocumentPosition(t) : 1) || !n.sortDetached && t.compareDocumentPosition(e) === r ? e === f || e.ownerDocument === T && E(T, e) ? -1 : t === f || t.ownerDocument === T && E(T, t) ? 1 : u ? M(u, e) - M(u, t) : 0 : 4 & r ? -1 : 1) | |
} : function (e, t) { | |
if (e === t) return d = !0, 0; | |
var n, r = 0, o = e.parentNode, i = t.parentNode, a = [e], c = [t]; | |
if (!o || !i) return e === f ? -1 : t === f ? 1 : o ? -1 : i ? 1 : u ? M(u, e) - M(u, t) : 0; | |
if (o === i) return le(e, t); | |
for (n = e; n = n.parentNode;) a.unshift(n); | |
for (n = t; n = n.parentNode;) c.unshift(n); | |
for (; a[r] === c[r];) r++; | |
return r ? le(a[r], c[r]) : a[r] === T ? -1 : c[r] === T ? 1 : 0 | |
}, f) : f | |
}, oe.matches = function (e, t) { | |
return oe(e, null, null, t) | |
}, oe.matchesSelector = function (e, t) { | |
if ((e.ownerDocument || e) !== f && p(e), t = t.replace(Y, "='$1']"), n.matchesSelector && h && !A[t + " "] && (!v || !v.test(t)) && (!g || !g.test(t))) try { | |
var r = y.call(e, t); | |
if (r || n.disconnectedMatch || e.document && 11 !== e.document.nodeType) return r | |
} catch (e) { | |
} | |
return oe(t, f, null, [e]).length > 0 | |
}, oe.contains = function (e, t) { | |
return (e.ownerDocument || e) !== f && p(e), E(e, t) | |
}, oe.attr = function (e, t) { | |
(e.ownerDocument || e) !== f && p(e); | |
var o = r.attrHandle[t.toLowerCase()], | |
i = o && k.call(r.attrHandle, t.toLowerCase()) ? o(e, t, !h) : void 0; | |
return void 0 !== i ? i : n.attributes || !h ? e.getAttribute(t) : (i = e.getAttributeNode(t)) && i.specified ? i.value : null | |
}, oe.error = function (e) { | |
throw new Error("Syntax error, unrecognized expression: " + e) | |
}, oe.uniqueSort = function (e) { | |
var t, r = [], o = 0, i = 0; | |
if (d = !n.detectDuplicates, u = !n.sortStable && e.slice(0), e.sort(P), d) { | |
for (; t = e[i++];) t === e[i] && (o = r.push(i)); | |
for (; o--;) e.splice(r[o], 1) | |
} | |
return u = null, e | |
}, o = oe.getText = function (e) { | |
var t, n = "", r = 0, i = e.nodeType; | |
if (i) { | |
if (1 === i || 9 === i || 11 === i) { | |
if ("string" == typeof e.textContent) return e.textContent; | |
for (e = e.firstChild; e; e = e.nextSibling) n += o(e) | |
} else if (3 === i || 4 === i) return e.nodeValue | |
} else for (; t = e[r++];) n += o(t); | |
return n | |
}, (r = oe.selectors = { | |
cacheLength: 50, | |
createPseudo: ae, | |
match: z, | |
attrHandle: {}, | |
find: {}, | |
relative: { | |
">": {dir: "parentNode", first: !0}, | |
" ": {dir: "parentNode"}, | |
"+": {dir: "previousSibling", first: !0}, | |
"~": {dir: "previousSibling"} | |
}, | |
preFilter: { | |
ATTR: function (e) { | |
return e[1] = e[1].replace(te, ne), e[3] = (e[3] || e[4] || e[5] || "").replace(te, ne), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4) | |
}, CHILD: function (e) { | |
return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || oe.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && oe.error(e[0]), e | |
}, PSEUDO: function (e) { | |
var t, n = !e[6] && e[2]; | |
return z.CHILD.test(e[0]) ? null : (e[3] ? e[2] = e[4] || e[5] || "" : n && q.test(n) && (t = a(n, !0)) && (t = n.indexOf(")", n.length - t) - n.length) && (e[0] = e[0].slice(0, t), e[2] = n.slice(0, t)), e.slice(0, 3)) | |
} | |
}, | |
filter: { | |
TAG: function (e) { | |
var t = e.replace(te, ne).toLowerCase(); | |
return "*" === e ? function () { | |
return !0 | |
} : function (e) { | |
return e.nodeName && e.nodeName.toLowerCase() === t | |
} | |
}, CLASS: function (e) { | |
var t = w[e + " "]; | |
return t || (t = new RegExp("(^|" + L + ")" + e + "(" + L + "|$)")) && w(e, function (e) { | |
return t.test("string" == typeof e.className && e.className || void 0 !== e.getAttribute && e.getAttribute("class") || "") | |
}) | |
}, ATTR: function (e, t, n) { | |
return function (r) { | |
var o = oe.attr(r, e); | |
return null == o ? "!=" === t : !t || (o += "", "=" === t ? o === n : "!=" === t ? o !== n : "^=" === t ? n && 0 === o.indexOf(n) : "*=" === t ? n && o.indexOf(n) > -1 : "$=" === t ? n && o.slice(-n.length) === n : "~=" === t ? (" " + o.replace(B, " ") + " ").indexOf(n) > -1 : "|=" === t && (o === n || o.slice(0, n.length + 1) === n + "-")) | |
} | |
}, CHILD: function (e, t, n, r, o) { | |
var i = "nth" !== e.slice(0, 3), a = "last" !== e.slice(-4), c = "of-type" === t; | |
return 1 === r && 0 === o ? function (e) { | |
return !!e.parentNode | |
} : function (t, n, s) { | |
var l, u, d, p, f, m, h = i !== a ? "nextSibling" : "previousSibling", | |
g = t.parentNode, v = c && t.nodeName.toLowerCase(), y = !s && !c, E = !1; | |
if (g) { | |
if (i) { | |
for (; h;) { | |
for (p = t; p = p[h];) if (c ? p.nodeName.toLowerCase() === v : 1 === p.nodeType) return !1; | |
m = h = "only" === e && !m && "nextSibling" | |
} | |
return !0 | |
} | |
if (m = [a ? g.firstChild : g.lastChild], a && y) { | |
for (E = (f = (l = (u = (d = (p = g)[C] || (p[C] = {}))[p.uniqueID] || (d[p.uniqueID] = {}))[e] || [])[0] === _ && l[1]) && l[2], p = f && g.childNodes[f]; p = ++f && p && p[h] || (E = f = 0) || m.pop();) if (1 === p.nodeType && ++E && p === t) { | |
u[e] = [_, f, E]; | |
break | |
} | |
} else if (y && (E = f = (l = (u = (d = (p = t)[C] || (p[C] = {}))[p.uniqueID] || (d[p.uniqueID] = {}))[e] || [])[0] === _ && l[1]), !1 === E) for (; (p = ++f && p && p[h] || (E = f = 0) || m.pop()) && ((c ? p.nodeName.toLowerCase() !== v : 1 !== p.nodeType) || !++E || (y && ((u = (d = p[C] || (p[C] = {}))[p.uniqueID] || (d[p.uniqueID] = {}))[e] = [_, E]), p !== t));) ; | |
return (E -= o) === r || E % r == 0 && E / r >= 0 | |
} | |
} | |
}, PSEUDO: function (e, t) { | |
var n, | |
o = r.pseudos[e] || r.setFilters[e.toLowerCase()] || oe.error("unsupported pseudo: " + e); | |
return o[C] ? o(t) : o.length > 1 ? (n = [e, e, "", t], r.setFilters.hasOwnProperty(e.toLowerCase()) ? ae(function (e, n) { | |
for (var r, i = o(e, t), a = i.length; a--;) e[r = M(e, i[a])] = !(n[r] = i[a]) | |
}) : function (e) { | |
return o(e, 0, n) | |
}) : o | |
} | |
}, | |
pseudos: { | |
not: ae(function (e) { | |
var t = [], n = [], r = c(e.replace(H, "$1")); | |
return r[C] ? ae(function (e, t, n, o) { | |
for (var i, a = r(e, null, o, []), c = e.length; c--;) (i = a[c]) && (e[c] = !(t[c] = i)) | |
}) : function (e, o, i) { | |
return t[0] = e, r(t, null, i, n), t[0] = null, !n.pop() | |
} | |
}), has: ae(function (e) { | |
return function (t) { | |
return oe(e, t).length > 0 | |
} | |
}), contains: ae(function (e) { | |
return e = e.replace(te, ne), function (t) { | |
return (t.textContent || t.innerText || o(t)).indexOf(e) > -1 | |
} | |
}), lang: ae(function (e) { | |
return G.test(e || "") || oe.error("unsupported lang: " + e), e = e.replace(te, ne).toLowerCase(), function (t) { | |
var n; | |
do { | |
if (n = h ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return (n = n.toLowerCase()) === e || 0 === n.indexOf(e + "-") | |
} while ((t = t.parentNode) && 1 === t.nodeType); | |
return !1 | |
} | |
}), target: function (t) { | |
var n = e.location && e.location.hash; | |
return n && n.slice(1) === t.id | |
}, root: function (e) { | |
return e === m | |
}, focus: function (e) { | |
return e === f.activeElement && (!f.hasFocus || f.hasFocus()) && !!(e.type || e.href || ~e.tabIndex) | |
}, enabled: function (e) { | |
return !1 === e.disabled | |
}, disabled: function (e) { | |
return !0 === e.disabled | |
}, checked: function (e) { | |
var t = e.nodeName.toLowerCase(); | |
return "input" === t && !!e.checked || "option" === t && !!e.selected | |
}, selected: function (e) { | |
return e.parentNode && e.parentNode.selectedIndex, !0 === e.selected | |
}, empty: function (e) { | |
for (e = e.firstChild; e; e = e.nextSibling) if (e.nodeType < 6) return !1; | |
return !0 | |
}, parent: function (e) { | |
return !r.pseudos.empty(e) | |
}, header: function (e) { | |
return Z.test(e.nodeName) | |
}, input: function (e) { | |
return K.test(e.nodeName) | |
}, button: function (e) { | |
var t = e.nodeName.toLowerCase(); | |
return "input" === t && "button" === e.type || "button" === t | |
}, text: function (e) { | |
var t; | |
return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || "text" === t.toLowerCase()) | |
}, first: pe(function () { | |
return [0] | |
}), last: pe(function (e, t) { | |
return [t - 1] | |
}), eq: pe(function (e, t, n) { | |
return [0 > n ? n + t : n] | |
}), even: pe(function (e, t) { | |
for (var n = 0; t > n; n += 2) e.push(n); | |
return e | |
}), odd: pe(function (e, t) { | |
for (var n = 1; t > n; n += 2) e.push(n); | |
return e | |
}), lt: pe(function (e, t, n) { | |
for (var r = 0 > n ? n + t : n; --r >= 0;) e.push(r); | |
return e | |
}), gt: pe(function (e, t, n) { | |
for (var r = 0 > n ? n + t : n; ++r < t;) e.push(r); | |
return e | |
}) | |
} | |
}).pseudos.nth = r.pseudos.eq, { | |
radio: !0, | |
checkbox: !0, | |
file: !0, | |
password: !0, | |
image: !0 | |
}) r.pseudos[t] = ue(t); | |
for (t in{submit: !0, reset: !0}) r.pseudos[t] = de(t); | |
function me() { | |
} | |
function he(e) { | |
for (var t = 0, n = e.length, r = ""; n > t; t++) r += e[t].value; | |
return r | |
} | |
function ge(e, t, n) { | |
var r = t.dir, o = n && "parentNode" === r, i = S++; | |
return t.first ? function (t, n, i) { | |
for (; t = t[r];) if (1 === t.nodeType || o) return e(t, n, i) | |
} : function (t, n, a) { | |
var c, s, l, u = [_, i]; | |
if (a) { | |
for (; t = t[r];) if ((1 === t.nodeType || o) && e(t, n, a)) return !0 | |
} else for (; t = t[r];) if (1 === t.nodeType || o) { | |
if ((c = (s = (l = t[C] || (t[C] = {}))[t.uniqueID] || (l[t.uniqueID] = {}))[r]) && c[0] === _ && c[1] === i) return u[2] = c[2]; | |
if (s[r] = u, u[2] = e(t, n, a)) return !0 | |
} | |
} | |
} | |
function ve(e) { | |
return e.length > 1 ? function (t, n, r) { | |
for (var o = e.length; o--;) if (!e[o](t, n, r)) return !1; | |
return !0 | |
} : e[0] | |
} | |
function ye(e, t, n, r, o) { | |
for (var i, a = [], c = 0, s = e.length, l = null != t; s > c; c++) (i = e[c]) && (n && !n(i, r, o) || (a.push(i), l && t.push(c))); | |
return a | |
} | |
function Ee(e, t, n, r, o, i) { | |
return r && !r[C] && (r = Ee(r)), o && !o[C] && (o = Ee(o, i)), ae(function (i, a, c, s) { | |
var l, u, d, p = [], f = [], m = a.length, h = i || function (e, t, n) { | |
for (var r = 0, o = t.length; o > r; r++) oe(e, t[r], n); | |
return n | |
}(t || "*", c.nodeType ? [c] : c, []), g = !e || !i && t ? h : ye(h, p, e, c, s), | |
v = n ? o || (i ? e : m || r) ? [] : a : g; | |
if (n && n(g, v, c, s), r) for (l = ye(v, f), r(l, [], c, s), u = l.length; u--;) (d = l[u]) && (v[f[u]] = !(g[f[u]] = d)); | |
if (i) { | |
if (o || e) { | |
if (o) { | |
for (l = [], u = v.length; u--;) (d = v[u]) && l.push(g[u] = d); | |
o(null, v = [], l, s) | |
} | |
for (u = v.length; u--;) (d = v[u]) && (l = o ? M(i, d) : p[u]) > -1 && (i[l] = !(a[l] = d)) | |
} | |
} else v = ye(v === a ? v.splice(m, v.length) : v), o ? o(null, a, v, s) : x.apply(a, v) | |
}) | |
} | |
function Ce(e) { | |
for (var t, n, o, i = e.length, a = r.relative[e[0].type], c = a || r.relative[" "], s = a ? 1 : 0, u = ge(function (e) { | |
return e === t | |
}, c, !0), d = ge(function (e) { | |
return M(t, e) > -1 | |
}, c, !0), p = [function (e, n, r) { | |
var o = !a && (r || n !== l) || ((t = n).nodeType ? u(e, n, r) : d(e, n, r)); | |
return t = null, o | |
}]; i > s; s++) if (n = r.relative[e[s].type]) p = [ge(ve(p), n)]; else { | |
if ((n = r.filter[e[s].type].apply(null, e[s].matches))[C]) { | |
for (o = ++s; i > o && !r.relative[e[o].type]; o++) ; | |
return Ee(s > 1 && ve(p), s > 1 && he(e.slice(0, s - 1).concat({value: " " === e[s - 2].type ? "*" : ""})).replace(H, "$1"), n, o > s && Ce(e.slice(s, o)), i > o && Ce(e = e.slice(o)), i > o && he(e)) | |
} | |
p.push(n) | |
} | |
return ve(p) | |
} | |
function Te(e, t) { | |
var n = t.length > 0, o = e.length > 0, i = function (i, a, c, s, u) { | |
var d, m, g, v = 0, y = "0", E = i && [], C = [], T = l, S = i || o && r.find.TAG("*", u), | |
w = _ += null == T ? 1 : Math.random() || .1, b = S.length; | |
for (u && (l = a === f || a || u); y !== b && null != (d = S[y]); y++) { | |
if (o && d) { | |
for (m = 0, a || d.ownerDocument === f || (p(d), c = !h); g = e[m++];) if (g(d, a || f, c)) { | |
s.push(d); | |
break | |
} | |
u && (_ = w) | |
} | |
n && ((d = !g && d) && v--, i && E.push(d)) | |
} | |
if (v += y, n && y !== v) { | |
for (m = 0; g = t[m++];) g(E, C, a, c); | |
if (i) { | |
if (v > 0) for (; y--;) E[y] || C[y] || (C[y] = N.call(s)); | |
C = ye(C) | |
} | |
x.apply(s, C), u && !i && C.length > 0 && v + t.length > 1 && oe.uniqueSort(s) | |
} | |
return u && (_ = w, l = T), E | |
}; | |
return n ? ae(i) : i | |
} | |
return me.prototype = r.filters = r.pseudos, r.setFilters = new me, a = oe.tokenize = function (e, t) { | |
var n, o, i, a, c, s, l, u = b[e + " "]; | |
if (u) return t ? 0 : u.slice(0); | |
for (c = e, s = [], l = r.preFilter; c;) { | |
for (a in n && !(o = W.exec(c)) || (o && (c = c.slice(o[0].length) || c), s.push(i = [])), n = !1, (o = j.exec(c)) && (n = o.shift(), i.push({ | |
value: n, | |
type: o[0].replace(H, " ") | |
}), c = c.slice(n.length)), r.filter) !(o = z[a].exec(c)) || l[a] && !(o = l[a](o)) || (n = o.shift(), i.push({ | |
value: n, | |
type: a, | |
matches: o | |
}), c = c.slice(n.length)); | |
if (!n) break | |
} | |
return t ? c.length : c ? oe.error(e) : b(e, s).slice(0) | |
}, c = oe.compile = function (e, t) { | |
var n, r = [], o = [], i = A[e + " "]; | |
if (!i) { | |
for (t || (t = a(e)), n = t.length; n--;) (i = Ce(t[n]))[C] ? r.push(i) : o.push(i); | |
(i = A(e, Te(o, r))).selector = e | |
} | |
return i | |
}, s = oe.select = function (e, t, o, i) { | |
var s, l, u, d, p, f = "function" == typeof e && e, m = !i && a(e = f.selector || e); | |
if (o = o || [], 1 === m.length) { | |
if ((l = m[0] = m[0].slice(0)).length > 2 && "ID" === (u = l[0]).type && n.getById && 9 === t.nodeType && h && r.relative[l[1].type]) { | |
if (!(t = (r.find.ID(u.matches[0].replace(te, ne), t) || [])[0])) return o; | |
f && (t = t.parentNode), e = e.slice(l.shift().value.length) | |
} | |
for (s = z.needsContext.test(e) ? 0 : l.length; s-- && (u = l[s], !r.relative[d = u.type]);) if ((p = r.find[d]) && (i = p(u.matches[0].replace(te, ne), X.test(l[0].type) && fe(t.parentNode) || t))) { | |
if (l.splice(s, 1), !(e = i.length && he(l))) return x.apply(o, i), o; | |
break | |
} | |
} | |
return (f || c(e, m))(i, t, !h, o, !t || X.test(e) && fe(t.parentNode) || t), o | |
}, n.sortStable = C.split("").sort(P).join("") === C, n.detectDuplicates = !!d, p(), n.sortDetached = ce(function (e) { | |
return 1 & e.compareDocumentPosition(f.createElement("div")) | |
}), ce(function (e) { | |
return e.innerHTML = "<a href='#'></a>", "#" === e.firstChild.getAttribute("href") | |
}) || se("type|href|height|width", function (e, t, n) { | |
return n ? void 0 : e.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2) | |
}), n.attributes && ce(function (e) { | |
return e.innerHTML = "<input/>", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value") | |
}) || se("value", function (e, t, n) { | |
return n || "input" !== e.nodeName.toLowerCase() ? void 0 : e.defaultValue | |
}), ce(function (e) { | |
return null == e.getAttribute("disabled") | |
}) || se(R, function (e, t, n) { | |
var r; | |
return n ? void 0 : !0 === e[t] ? t.toLowerCase() : (r = e.getAttributeNode(t)) && r.specified ? r.value : null | |
}), oe | |
}(e); | |
f.find = E, f.expr = E.selectors, f.expr[":"] = f.expr.pseudos, f.uniqueSort = f.unique = E.uniqueSort, f.text = E.getText, f.isXMLDoc = E.isXML, f.contains = E.contains; | |
var C = function (e, t, n) { | |
for (var r = [], o = void 0 !== n; (e = e[t]) && 9 !== e.nodeType;) if (1 === e.nodeType) { | |
if (o && f(e).is(n)) break; | |
r.push(e) | |
} | |
return r | |
}, T = function (e, t) { | |
for (var n = []; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e); | |
return n | |
}, _ = f.expr.match.needsContext, S = /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/, w = /^.[^:#\[\.,]*$/; | |
function b(e, t, n) { | |
if (f.isFunction(t)) return f.grep(e, function (e, r) { | |
return !!t.call(e, r, e) !== n | |
}); | |
if (t.nodeType) return f.grep(e, function (e) { | |
return e === t !== n | |
}); | |
if ("string" == typeof t) { | |
if (w.test(t)) return f.filter(t, e, n); | |
t = f.filter(t, e) | |
} | |
return f.grep(e, function (e) { | |
return f.inArray(e, t) > -1 !== n | |
}) | |
} | |
f.filter = function (e, t, n) { | |
var r = t[0]; | |
return n && (e = ":not(" + e + ")"), 1 === t.length && 1 === r.nodeType ? f.find.matchesSelector(r, e) ? [r] : [] : f.find.matches(e, f.grep(t, function (e) { | |
return 1 === e.nodeType | |
})) | |
}, f.fn.extend({ | |
find: function (e) { | |
var t, n = [], r = this, o = r.length; | |
if ("string" != typeof e) return this.pushStack(f(e).filter(function () { | |
for (t = 0; o > t; t++) if (f.contains(r[t], this)) return !0 | |
})); | |
for (t = 0; o > t; t++) f.find(e, r[t], n); | |
return (n = this.pushStack(o > 1 ? f.unique(n) : n)).selector = this.selector ? this.selector + " " + e : e, n | |
}, filter: function (e) { | |
return this.pushStack(b(this, e || [], !1)) | |
}, not: function (e) { | |
return this.pushStack(b(this, e || [], !0)) | |
}, is: function (e) { | |
return !!b(this, "string" == typeof e && _.test(e) ? f(e) : e || [], !1).length | |
} | |
}); | |
var A, P = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/; | |
(f.fn.init = function (e, t, n) { | |
var o, i; | |
if (!e) return this; | |
if (n = n || A, "string" == typeof e) { | |
if (!(o = "<" === e.charAt(0) && ">" === e.charAt(e.length - 1) && e.length >= 3 ? [null, e, null] : P.exec(e)) || !o[1] && t) return !t || t.jquery ? (t || n).find(e) : this.constructor(t).find(e); | |
if (o[1]) { | |
if (t = t instanceof f ? t[0] : t, f.merge(this, f.parseHTML(o[1], t && t.nodeType ? t.ownerDocument || t : r, !0)), S.test(o[1]) && f.isPlainObject(t)) for (o in t) f.isFunction(this[o]) ? this[o](t[o]) : this.attr(o, t[o]); | |
return this | |
} | |
if ((i = r.getElementById(o[2])) && i.parentNode) { | |
if (i.id !== o[2]) return A.find(e); | |
this.length = 1, this[0] = i | |
} | |
return this.context = r, this.selector = e, this | |
} | |
return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : f.isFunction(e) ? void 0 !== n.ready ? n.ready(e) : e(f) : (void 0 !== e.selector && (this.selector = e.selector, this.context = e.context), f.makeArray(e, this)) | |
}).prototype = f.fn, A = f(r); | |
var $ = /^(?:parents|prev(?:Until|All))/, k = {children: !0, contents: !0, next: !0, prev: !0}; | |
function I(e, t) { | |
do { | |
e = e[t] | |
} while (e && 1 !== e.nodeType); | |
return e | |
} | |
f.fn.extend({ | |
has: function (e) { | |
var t, n = f(e, this), r = n.length; | |
return this.filter(function () { | |
for (t = 0; r > t; t++) if (f.contains(this, n[t])) return !0 | |
}) | |
}, closest: function (e, t) { | |
for (var n, r = 0, o = this.length, i = [], a = _.test(e) || "string" != typeof e ? f(e, t || this.context) : 0; o > r; r++) for (n = this[r]; n && n !== t; n = n.parentNode) if (n.nodeType < 11 && (a ? a.index(n) > -1 : 1 === n.nodeType && f.find.matchesSelector(n, e))) { | |
i.push(n); | |
break | |
} | |
return this.pushStack(i.length > 1 ? f.uniqueSort(i) : i) | |
}, index: function (e) { | |
return e ? "string" == typeof e ? f.inArray(this[0], f(e)) : f.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 | |
}, add: function (e, t) { | |
return this.pushStack(f.uniqueSort(f.merge(this.get(), f(e, t)))) | |
}, addBack: function (e) { | |
return this.add(null == e ? this.prevObject : this.prevObject.filter(e)) | |
} | |
}), f.each({ | |
parent: function (e) { | |
var t = e.parentNode; | |
return t && 11 !== t.nodeType ? t : null | |
}, parents: function (e) { | |
return C(e, "parentNode") | |
}, parentsUntil: function (e, t, n) { | |
return C(e, "parentNode", n) | |
}, next: function (e) { | |
return I(e, "nextSibling") | |
}, prev: function (e) { | |
return I(e, "previousSibling") | |
}, nextAll: function (e) { | |
return C(e, "nextSibling") | |
}, prevAll: function (e) { | |
return C(e, "previousSibling") | |
}, nextUntil: function (e, t, n) { | |
return C(e, "nextSibling", n) | |
}, prevUntil: function (e, t, n) { | |
return C(e, "previousSibling", n) | |
}, siblings: function (e) { | |
return T((e.parentNode || {}).firstChild, e) | |
}, children: function (e) { | |
return T(e.firstChild) | |
}, contents: function (e) { | |
return f.nodeName(e, "iframe") ? e.contentDocument || e.contentWindow.document : f.merge([], e.childNodes) | |
} | |
}, function (e, t) { | |
f.fn[e] = function (n, r) { | |
var o = f.map(this, t, n); | |
return "Until" !== e.slice(-5) && (r = n), r && "string" == typeof r && (o = f.filter(r, o)), this.length > 1 && (k[e] || (o = f.uniqueSort(o)), $.test(e) && (o = o.reverse())), this.pushStack(o) | |
} | |
}); | |
var N, D, x = /\S+/g; | |
function O() { | |
r.addEventListener ? (r.removeEventListener("DOMContentLoaded", M), e.removeEventListener("load", M)) : (r.detachEvent("onreadystatechange", M), e.detachEvent("onload", M)) | |
} | |
function M() { | |
(r.addEventListener || "load" === e.event.type || "complete" === r.readyState) && (O(), f.ready()) | |
} | |
for (D in f.Callbacks = function (e) { | |
e = "string" == typeof e ? function (e) { | |
var t = {}; | |
return f.each(e.match(x) || [], function (e, n) { | |
t[n] = !0 | |
}), t | |
}(e) : f.extend({}, e); | |
var t, n, r, o, i = [], a = [], c = -1, s = function () { | |
for (o = e.once, r = t = !0; a.length; c = -1) for (n = a.shift(); ++c < i.length;) !1 === i[c].apply(n[0], n[1]) && e.stopOnFalse && (c = i.length, n = !1); | |
e.memory || (n = !1), t = !1, o && (i = n ? [] : "") | |
}, l = { | |
add: function () { | |
return i && (n && !t && (c = i.length - 1, a.push(n)), function t(n) { | |
f.each(n, function (n, r) { | |
f.isFunction(r) ? e.unique && l.has(r) || i.push(r) : r && r.length && "string" !== f.type(r) && t(r) | |
}) | |
}(arguments), n && !t && s()), this | |
}, remove: function () { | |
return f.each(arguments, function (e, t) { | |
for (var n; (n = f.inArray(t, i, n)) > -1;) i.splice(n, 1), c >= n && c-- | |
}), this | |
}, has: function (e) { | |
return e ? f.inArray(e, i) > -1 : i.length > 0 | |
}, empty: function () { | |
return i && (i = []), this | |
}, disable: function () { | |
return o = a = [], i = n = "", this | |
}, disabled: function () { | |
return !i | |
}, lock: function () { | |
return o = !0, n || l.disable(), this | |
}, locked: function () { | |
return !!o | |
}, fireWith: function (e, n) { | |
return o || (n = [e, (n = n || []).slice ? n.slice() : n], a.push(n), t || s()), this | |
}, fire: function () { | |
return l.fireWith(this, arguments), this | |
}, fired: function () { | |
return !!r | |
} | |
}; | |
return l | |
}, f.extend({ | |
Deferred: function (e) { | |
var t = [["resolve", "done", f.Callbacks("once memory"), "resolved"], ["reject", "fail", f.Callbacks("once memory"), "rejected"], ["notify", "progress", f.Callbacks("memory")]], | |
n = "pending", r = { | |
state: function () { | |
return n | |
}, always: function () { | |
return o.done(arguments).fail(arguments), this | |
}, then: function () { | |
var e = arguments; | |
return f.Deferred(function (n) { | |
f.each(t, function (t, i) { | |
var a = f.isFunction(e[t]) && e[t]; | |
o[i[1]](function () { | |
var e = a && a.apply(this, arguments); | |
e && f.isFunction(e.promise) ? e.promise().progress(n.notify).done(n.resolve).fail(n.reject) : n[i[0] + "With"](this === r ? n.promise() : this, a ? [e] : arguments) | |
}) | |
}), e = null | |
}).promise() | |
}, promise: function (e) { | |
return null != e ? f.extend(e, r) : r | |
} | |
}, o = {}; | |
return r.pipe = r.then, f.each(t, function (e, i) { | |
var a = i[2], c = i[3]; | |
r[i[1]] = a.add, c && a.add(function () { | |
n = c | |
}, t[1 ^ e][2].disable, t[2][2].lock), o[i[0]] = function () { | |
return o[i[0] + "With"](this === o ? r : this, arguments), this | |
}, o[i[0] + "With"] = a.fireWith | |
}), r.promise(o), e && e.call(o, o), o | |
}, when: function (e) { | |
var t, n, r, i = 0, a = o.call(arguments), c = a.length, | |
s = 1 !== c || e && f.isFunction(e.promise) ? c : 0, l = 1 === s ? e : f.Deferred(), | |
u = function (e, n, r) { | |
return function (i) { | |
n[e] = this, r[e] = arguments.length > 1 ? o.call(arguments) : i, r === t ? l.notifyWith(n, r) : --s || l.resolveWith(n, r) | |
} | |
}; | |
if (c > 1) for (t = new Array(c), n = new Array(c), r = new Array(c); c > i; i++) a[i] && f.isFunction(a[i].promise) ? a[i].promise().progress(u(i, n, t)).done(u(i, r, a)).fail(l.reject) : --s; | |
return s || l.resolveWith(r, a), l.promise() | |
} | |
}), f.fn.ready = function (e) { | |
return f.ready.promise().done(e), this | |
}, f.extend({ | |
isReady: !1, readyWait: 1, holdReady: function (e) { | |
e ? f.readyWait++ : f.ready(!0) | |
}, ready: function (e) { | |
(!0 === e ? --f.readyWait : f.isReady) || (f.isReady = !0, !0 !== e && --f.readyWait > 0 || (N.resolveWith(r, [f]), f.fn.triggerHandler && (f(r).triggerHandler("ready"), f(r).off("ready")))) | |
} | |
}), f.ready.promise = function (t) { | |
if (!N) if (N = f.Deferred(), "complete" === r.readyState || "loading" !== r.readyState && !r.documentElement.doScroll) e.setTimeout(f.ready); else if (r.addEventListener) r.addEventListener("DOMContentLoaded", M), e.addEventListener("load", M); else { | |
r.attachEvent("onreadystatechange", M), e.attachEvent("onload", M); | |
var n = !1; | |
try { | |
n = null == e.frameElement && r.documentElement | |
} catch (e) { | |
} | |
n && n.doScroll && function t() { | |
if (!f.isReady) { | |
try { | |
n.doScroll("left") | |
} catch (n) { | |
return e.setTimeout(t, 50) | |
} | |
O(), f.ready() | |
} | |
}() | |
} | |
return N.promise(t) | |
}, f.ready.promise(), f(d)) break; | |
d.ownFirst = "0" === D, d.inlineBlockNeedsLayout = !1, f(function () { | |
var e, t, n, o; | |
(n = r.getElementsByTagName("body")[0]) && n.style && (t = r.createElement("div"), (o = r.createElement("div")).style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", n.appendChild(o).appendChild(t), void 0 !== t.style.zoom && (t.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1", d.inlineBlockNeedsLayout = e = 3 === t.offsetWidth, e && (n.style.zoom = 1)), n.removeChild(o)) | |
}), function () { | |
var e = r.createElement("div"); | |
d.deleteExpando = !0; | |
try { | |
delete e.test | |
} catch (e) { | |
d.deleteExpando = !1 | |
} | |
e = null | |
}(); | |
var R = function (e) { | |
var t = f.noData[(e.nodeName + " ").toLowerCase()], n = +e.nodeType || 1; | |
return (1 === n || 9 === n) && (!t || !0 !== t && e.getAttribute("classid") === t) | |
}, L = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, V = /([A-Z])/g; | |
function F(e, t, n) { | |
if (void 0 === n && 1 === e.nodeType) { | |
var r = "data-" + t.replace(V, "-$1").toLowerCase(); | |
if ("string" == typeof (n = e.getAttribute(r))) { | |
try { | |
n = "true" === n || "false" !== n && ("null" === n ? null : +n + "" === n ? +n : L.test(n) ? f.parseJSON(n) : n) | |
} catch (e) { | |
} | |
f.data(e, t, n) | |
} else n = void 0 | |
} | |
return n | |
} | |
function U(e) { | |
var t; | |
for (t in e) if (("data" !== t || !f.isEmptyObject(e[t])) && "toJSON" !== t) return !1; | |
return !0 | |
} | |
function B(e, t, r, o) { | |
if (R(e)) { | |
var i, a, c = f.expando, s = e.nodeType, l = s ? f.cache : e, u = s ? e[c] : e[c] && c; | |
if (u && l[u] && (o || l[u].data) || void 0 !== r || "string" != typeof t) return u || (u = s ? e[c] = n.pop() || f.guid++ : c), l[u] || (l[u] = s ? {} : {toJSON: f.noop}), "object" != typeof t && "function" != typeof t || (o ? l[u] = f.extend(l[u], t) : l[u].data = f.extend(l[u].data, t)), a = l[u], o || (a.data || (a.data = {}), a = a.data), void 0 !== r && (a[f.camelCase(t)] = r), "string" == typeof t ? null == (i = a[t]) && (i = a[f.camelCase(t)]) : i = a, i | |
} | |
} | |
function H(e, t, n) { | |
if (R(e)) { | |
var r, o, i = e.nodeType, a = i ? f.cache : e, c = i ? e[f.expando] : f.expando; | |
if (a[c]) { | |
if (t && (r = n ? a[c] : a[c].data)) { | |
f.isArray(t) ? t = t.concat(f.map(t, f.camelCase)) : t in r ? t = [t] : t = (t = f.camelCase(t)) in r ? [t] : t.split(" "), o = t.length; | |
for (; o--;) delete r[t[o]]; | |
if (n ? !U(r) : !f.isEmptyObject(r)) return | |
} | |
(n || (delete a[c].data, U(a[c]))) && (i ? f.cleanData([e], !0) : d.deleteExpando || a != a.window ? delete a[c] : a[c] = void 0) | |
} | |
} | |
} | |
f.extend({ | |
cache: {}, | |
noData: {"applet ": !0, "embed ": !0, "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"}, | |
hasData: function (e) { | |
return !!(e = e.nodeType ? f.cache[e[f.expando]] : e[f.expando]) && !U(e) | |
}, | |
data: function (e, t, n) { | |
return B(e, t, n) | |
}, | |
removeData: function (e, t) { | |
return H(e, t) | |
}, | |
_data: function (e, t, n) { | |
return B(e, t, n, !0) | |
}, | |
_removeData: function (e, t) { | |
return H(e, t, !0) | |
} | |
}), f.fn.extend({ | |
data: function (e, t) { | |
var n, r, o, i = this[0], a = i && i.attributes; | |
if (void 0 === e) { | |
if (this.length && (o = f.data(i), 1 === i.nodeType && !f._data(i, "parsedAttrs"))) { | |
for (n = a.length; n--;) a[n] && (0 === (r = a[n].name).indexOf("data-") && F(i, r = f.camelCase(r.slice(5)), o[r])); | |
f._data(i, "parsedAttrs", !0) | |
} | |
return o | |
} | |
return "object" == typeof e ? this.each(function () { | |
f.data(this, e) | |
}) : arguments.length > 1 ? this.each(function () { | |
f.data(this, e, t) | |
}) : i ? F(i, e, f.data(i, e)) : void 0 | |
}, removeData: function (e) { | |
return this.each(function () { | |
f.removeData(this, e) | |
}) | |
} | |
}), f.extend({ | |
queue: function (e, t, n) { | |
var r; | |
return e ? (t = (t || "fx") + "queue", r = f._data(e, t), n && (!r || f.isArray(n) ? r = f._data(e, t, f.makeArray(n)) : r.push(n)), r || []) : void 0 | |
}, dequeue: function (e, t) { | |
t = t || "fx"; | |
var n = f.queue(e, t), r = n.length, o = n.shift(), i = f._queueHooks(e, t); | |
"inprogress" === o && (o = n.shift(), r--), o && ("fx" === t && n.unshift("inprogress"), delete i.stop, o.call(e, function () { | |
f.dequeue(e, t) | |
}, i)), !r && i && i.empty.fire() | |
}, _queueHooks: function (e, t) { | |
var n = t + "queueHooks"; | |
return f._data(e, n) || f._data(e, n, { | |
empty: f.Callbacks("once memory").add(function () { | |
f._removeData(e, t + "queue"), f._removeData(e, n) | |
}) | |
}) | |
} | |
}), f.fn.extend({ | |
queue: function (e, t) { | |
var n = 2; | |
return "string" != typeof e && (t = e, e = "fx", n--), arguments.length < n ? f.queue(this[0], e) : void 0 === t ? this : this.each(function () { | |
var n = f.queue(this, e, t); | |
f._queueHooks(this, e), "fx" === e && "inprogress" !== n[0] && f.dequeue(this, e) | |
}) | |
}, dequeue: function (e) { | |
return this.each(function () { | |
f.dequeue(this, e) | |
}) | |
}, clearQueue: function (e) { | |
return this.queue(e || "fx", []) | |
}, promise: function (e, t) { | |
var n, r = 1, o = f.Deferred(), i = this, a = this.length, c = function () { | |
--r || o.resolveWith(i, [i]) | |
}; | |
for ("string" != typeof e && (t = e, e = void 0), e = e || "fx"; a--;) (n = f._data(i[a], e + "queueHooks")) && n.empty && (r++, n.empty.add(c)); | |
return c(), o.promise(t) | |
} | |
}), function () { | |
var e; | |
d.shrinkWrapBlocks = function () { | |
return null != e ? e : (e = !1, (n = r.getElementsByTagName("body")[0]) && n.style ? (t = r.createElement("div"), (o = r.createElement("div")).style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", n.appendChild(o).appendChild(t), void 0 !== t.style.zoom && (t.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1", t.appendChild(r.createElement("div")).style.width = "5px", e = 3 !== t.offsetWidth), n.removeChild(o), e) : void 0); | |
var t, n, o | |
} | |
}(); | |
var W = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, | |
j = new RegExp("^(?:([+-])=|)(" + W + ")([a-z%]*)$", "i"), Y = ["Top", "Right", "Bottom", "Left"], | |
q = function (e, t) { | |
return e = t || e, "none" === f.css(e, "display") || !f.contains(e.ownerDocument, e) | |
}; | |
function G(e, t, n, r) { | |
var o, i = 1, a = 20, c = r ? function () { | |
return r.cur() | |
} : function () { | |
return f.css(e, t, "") | |
}, s = c(), l = n && n[3] || (f.cssNumber[t] ? "" : "px"), | |
u = (f.cssNumber[t] || "px" !== l && +s) && j.exec(f.css(e, t)); | |
if (u && u[3] !== l) { | |
l = l || u[3], n = n || [], u = +s || 1; | |
do { | |
u /= i = i || ".5", f.style(e, t, u + l) | |
} while (i !== (i = c() / s) && 1 !== i && --a) | |
} | |
return n && (u = +u || +s || 0, o = n[1] ? u + (n[1] + 1) * n[2] : +n[2], r && (r.unit = l, r.start = u, r.end = o)), o | |
} | |
var z = function (e, t, n, r, o, i, a) { | |
var c = 0, s = e.length, l = null == n; | |
if ("object" === f.type(n)) for (c in o = !0, n) z(e, t, c, n[c], !0, i, a); else if (void 0 !== r && (o = !0, f.isFunction(r) || (a = !0), l && (a ? (t.call(e, r), t = null) : (l = t, t = function (e, t, n) { | |
return l.call(f(e), n) | |
})), t)) for (; s > c; c++) t(e[c], n, a ? r : r.call(e[c], c, t(e[c], n))); | |
return o ? e : l ? t.call(e) : s ? t(e[0], n) : i | |
}, K = /^(?:checkbox|radio)$/i, Z = /<([\w:-]+)/, J = /^$|\/(?:java|ecma)script/i, Q = /^\s+/, | |
X = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video"; | |
function ee(e) { | |
var t = X.split("|"), n = e.createDocumentFragment(); | |
if (n.createElement) for (; t.length;) n.createElement(t.pop()); | |
return n | |
} | |
!function () { | |
var e = r.createElement("div"), t = r.createDocumentFragment(), n = r.createElement("input"); | |
e.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", d.leadingWhitespace = 3 === e.firstChild.nodeType, d.tbody = !e.getElementsByTagName("tbody").length, d.htmlSerialize = !!e.getElementsByTagName("link").length, d.html5Clone = "<:nav></:nav>" !== r.createElement("nav").cloneNode(!0).outerHTML, n.type = "checkbox", n.checked = !0, t.appendChild(n), d.appendChecked = n.checked, e.innerHTML = "<textarea>x</textarea>", d.noCloneChecked = !!e.cloneNode(!0).lastChild.defaultValue, t.appendChild(e), (n = r.createElement("input")).setAttribute("type", "radio"), n.setAttribute("checked", "checked"), n.setAttribute("name", "t"), e.appendChild(n), d.checkClone = e.cloneNode(!0).cloneNode(!0).lastChild.checked, d.noCloneEvent = !!e.addEventListener, e[f.expando] = 1, d.attributes = !e.getAttribute(f.expando) | |
}(); | |
var te = { | |
option: [1, "<select multiple='multiple'>", "</select>"], | |
legend: [1, "<fieldset>", "</fieldset>"], | |
area: [1, "<map>", "</map>"], | |
param: [1, "<object>", "</object>"], | |
thead: [1, "<table>", "</table>"], | |
tr: [2, "<table><tbody>", "</tbody></table>"], | |
col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"], | |
td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], | |
_default: d.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"] | |
}; | |
function ne(e, t) { | |
var n, r, o = 0, | |
i = void 0 !== e.getElementsByTagName ? e.getElementsByTagName(t || "*") : void 0 !== e.querySelectorAll ? e.querySelectorAll(t || "*") : void 0; | |
if (!i) for (i = [], n = e.childNodes || e; null != (r = n[o]); o++) !t || f.nodeName(r, t) ? i.push(r) : f.merge(i, ne(r, t)); | |
return void 0 === t || t && f.nodeName(e, t) ? f.merge([e], i) : i | |
} | |
function re(e, t) { | |
for (var n, r = 0; null != (n = e[r]); r++) f._data(n, "globalEval", !t || f._data(t[r], "globalEval")) | |
} | |
te.optgroup = te.option, te.tbody = te.tfoot = te.colgroup = te.caption = te.thead, te.th = te.td; | |
var oe = /<|&#?\w+;/, ie = /<tbody/i; | |
function ae(e) { | |
K.test(e.type) && (e.defaultChecked = e.checked) | |
} | |
function ce(e, t, n, r, o) { | |
for (var i, a, c, s, l, u, p, m = e.length, h = ee(t), g = [], v = 0; m > v; v++) if ((a = e[v]) || 0 === a) if ("object" === f.type(a)) f.merge(g, a.nodeType ? [a] : a); else if (oe.test(a)) { | |
for (s = s || h.appendChild(t.createElement("div")), l = (Z.exec(a) || ["", ""])[1].toLowerCase(), p = te[l] || te._default, s.innerHTML = p[1] + f.htmlPrefilter(a) + p[2], i = p[0]; i--;) s = s.lastChild; | |
if (!d.leadingWhitespace && Q.test(a) && g.push(t.createTextNode(Q.exec(a)[0])), !d.tbody) for (i = (a = "table" !== l || ie.test(a) ? "<table>" !== p[1] || ie.test(a) ? 0 : s : s.firstChild) && a.childNodes.length; i--;) f.nodeName(u = a.childNodes[i], "tbody") && !u.childNodes.length && a.removeChild(u); | |
for (f.merge(g, s.childNodes), s.textContent = ""; s.firstChild;) s.removeChild(s.firstChild); | |
s = h.lastChild | |
} else g.push(t.createTextNode(a)); | |
for (s && h.removeChild(s), d.appendChecked || f.grep(ne(g, "input"), ae), v = 0; a = g[v++];) if (r && f.inArray(a, r) > -1) o && o.push(a); else if (c = f.contains(a.ownerDocument, a), s = ne(h.appendChild(a), "script"), c && re(s), n) for (i = 0; a = s[i++];) J.test(a.type || "") && n.push(a); | |
return s = null, h | |
} | |
!function () { | |
var t, n, o = r.createElement("div"); | |
for (t in{ | |
submit: !0, | |
change: !0, | |
focusin: !0 | |
}) n = "on" + t, (d[t] = n in e) || (o.setAttribute(n, "t"), d[t] = !1 === o.attributes[n].expando); | |
o = null | |
}(); | |
var se = /^(?:input|select|textarea)$/i, le = /^key/, | |
ue = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, de = /^(?:focusinfocus|focusoutblur)$/, | |
pe = /^([^.]*)(?:\.(.+)|)/; | |
function fe() { | |
return !0 | |
} | |
function me() { | |
return !1 | |
} | |
function he() { | |
try { | |
return r.activeElement | |
} catch (e) { | |
} | |
} | |
function ge(e, t, n, r, o, i) { | |
var a, c; | |
if ("object" == typeof t) { | |
for (c in"string" != typeof n && (r = r || n, n = void 0), t) ge(e, c, n, r, t[c], i); | |
return e | |
} | |
if (null == r && null == o ? (o = n, r = n = void 0) : null == o && ("string" == typeof n ? (o = r, r = void 0) : (o = r, r = n, n = void 0)), !1 === o) o = me; else if (!o) return e; | |
return 1 === i && (a = o, (o = function (e) { | |
return f().off(e), a.apply(this, arguments) | |
}).guid = a.guid || (a.guid = f.guid++)), e.each(function () { | |
f.event.add(this, t, o, r, n) | |
}) | |
} | |
f.event = { | |
global: {}, | |
add: function (e, t, n, r, o) { | |
var i, a, c, s, l, u, d, p, m, h, g, v = f._data(e); | |
if (v) { | |
for (n.handler && (n = (s = n).handler, o = s.selector), n.guid || (n.guid = f.guid++), (a = v.events) || (a = v.events = {}), (u = v.handle) || ((u = v.handle = function (e) { | |
return void 0 === f || e && f.event.triggered === e.type ? void 0 : f.event.dispatch.apply(u.elem, arguments) | |
}).elem = e), c = (t = (t || "").match(x) || [""]).length; c--;) m = g = (i = pe.exec(t[c]) || [])[1], h = (i[2] || "").split(".").sort(), m && (l = f.event.special[m] || {}, m = (o ? l.delegateType : l.bindType) || m, l = f.event.special[m] || {}, d = f.extend({ | |
type: m, | |
origType: g, | |
data: r, | |
handler: n, | |
guid: n.guid, | |
selector: o, | |
needsContext: o && f.expr.match.needsContext.test(o), | |
namespace: h.join(".") | |
}, s), (p = a[m]) || ((p = a[m] = []).delegateCount = 0, l.setup && !1 !== l.setup.call(e, r, h, u) || (e.addEventListener ? e.addEventListener(m, u, !1) : e.attachEvent && e.attachEvent("on" + m, u))), l.add && (l.add.call(e, d), d.handler.guid || (d.handler.guid = n.guid)), o ? p.splice(p.delegateCount++, 0, d) : p.push(d), f.event.global[m] = !0); | |
e = null | |
} | |
}, | |
remove: function (e, t, n, r, o) { | |
var i, a, c, s, l, u, d, p, m, h, g, v = f.hasData(e) && f._data(e); | |
if (v && (u = v.events)) { | |
for (l = (t = (t || "").match(x) || [""]).length; l--;) if (m = g = (c = pe.exec(t[l]) || [])[1], h = (c[2] || "").split(".").sort(), m) { | |
for (d = f.event.special[m] || {}, p = u[m = (r ? d.delegateType : d.bindType) || m] || [], c = c[2] && new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)"), s = i = p.length; i--;) a = p[i], !o && g !== a.origType || n && n.guid !== a.guid || c && !c.test(a.namespace) || r && r !== a.selector && ("**" !== r || !a.selector) || (p.splice(i, 1), a.selector && p.delegateCount--, d.remove && d.remove.call(e, a)); | |
s && !p.length && (d.teardown && !1 !== d.teardown.call(e, h, v.handle) || f.removeEvent(e, m, v.handle), delete u[m]) | |
} else for (m in u) f.event.remove(e, m + t[l], n, r, !0); | |
f.isEmptyObject(u) && (delete v.handle, f._removeData(e, "events")) | |
} | |
}, | |
trigger: function (t, n, o, i) { | |
var a, c, s, l, d, p, m, h = [o || r], g = u.call(t, "type") ? t.type : t, | |
v = u.call(t, "namespace") ? t.namespace.split(".") : []; | |
if (s = p = o = o || r, 3 !== o.nodeType && 8 !== o.nodeType && !de.test(g + f.event.triggered) && (g.indexOf(".") > -1 && (v = g.split("."), g = v.shift(), v.sort()), c = g.indexOf(":") < 0 && "on" + g, (t = t[f.expando] ? t : new f.Event(g, "object" == typeof t && t)).isTrigger = i ? 2 : 3, t.namespace = v.join("."), t.rnamespace = t.namespace ? new RegExp("(^|\\.)" + v.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, t.result = void 0, t.target || (t.target = o), n = null == n ? [t] : f.makeArray(n, [t]), d = f.event.special[g] || {}, i || !d.trigger || !1 !== d.trigger.apply(o, n))) { | |
if (!i && !d.noBubble && !f.isWindow(o)) { | |
for (l = d.delegateType || g, de.test(l + g) || (s = s.parentNode); s; s = s.parentNode) h.push(s), p = s; | |
p === (o.ownerDocument || r) && h.push(p.defaultView || p.parentWindow || e) | |
} | |
for (m = 0; (s = h[m++]) && !t.isPropagationStopped();) t.type = m > 1 ? l : d.bindType || g, (a = (f._data(s, "events") || {})[t.type] && f._data(s, "handle")) && a.apply(s, n), (a = c && s[c]) && a.apply && R(s) && (t.result = a.apply(s, n), !1 === t.result && t.preventDefault()); | |
if (t.type = g, !i && !t.isDefaultPrevented() && (!d._default || !1 === d._default.apply(h.pop(), n)) && R(o) && c && o[g] && !f.isWindow(o)) { | |
(p = o[c]) && (o[c] = null), f.event.triggered = g; | |
try { | |
o[g]() | |
} catch (e) { | |
} | |
f.event.triggered = void 0, p && (o[c] = p) | |
} | |
return t.result | |
} | |
}, | |
dispatch: function (e) { | |
e = f.event.fix(e); | |
var t, n, r, i, a, c = [], s = o.call(arguments), | |
l = (f._data(this, "events") || {})[e.type] || [], u = f.event.special[e.type] || {}; | |
if (s[0] = e, e.delegateTarget = this, !u.preDispatch || !1 !== u.preDispatch.call(this, e)) { | |
for (c = f.event.handlers.call(this, e, l), t = 0; (i = c[t++]) && !e.isPropagationStopped();) for (e.currentTarget = i.elem, n = 0; (a = i.handlers[n++]) && !e.isImmediatePropagationStopped();) e.rnamespace && !e.rnamespace.test(a.namespace) || (e.handleObj = a, e.data = a.data, void 0 !== (r = ((f.event.special[a.origType] || {}).handle || a.handler).apply(i.elem, s)) && !1 === (e.result = r) && (e.preventDefault(), e.stopPropagation())); | |
return u.postDispatch && u.postDispatch.call(this, e), e.result | |
} | |
}, | |
handlers: function (e, t) { | |
var n, r, o, i, a = [], c = t.delegateCount, s = e.target; | |
if (c && s.nodeType && ("click" !== e.type || isNaN(e.button) || e.button < 1)) for (; s != this; s = s.parentNode || this) if (1 === s.nodeType && (!0 !== s.disabled || "click" !== e.type)) { | |
for (r = [], n = 0; c > n; n++) void 0 === r[o = (i = t[n]).selector + " "] && (r[o] = i.needsContext ? f(o, this).index(s) > -1 : f.find(o, this, null, [s]).length), r[o] && r.push(i); | |
r.length && a.push({elem: s, handlers: r}) | |
} | |
return c < t.length && a.push({elem: this, handlers: t.slice(c)}), a | |
}, | |
fix: function (e) { | |
if (e[f.expando]) return e; | |
var t, n, o, i = e.type, a = e, c = this.fixHooks[i]; | |
for (c || (this.fixHooks[i] = c = ue.test(i) ? this.mouseHooks : le.test(i) ? this.keyHooks : {}), o = c.props ? this.props.concat(c.props) : this.props, e = new f.Event(a), t = o.length; t--;) e[n = o[t]] = a[n]; | |
return e.target || (e.target = a.srcElement || r), 3 === e.target.nodeType && (e.target = e.target.parentNode), e.metaKey = !!e.metaKey, c.filter ? c.filter(e, a) : e | |
}, | |
props: "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), | |
fixHooks: {}, | |
keyHooks: { | |
props: "char charCode key keyCode".split(" "), filter: function (e, t) { | |
return null == e.which && (e.which = null != t.charCode ? t.charCode : t.keyCode), e | |
} | |
}, | |
mouseHooks: { | |
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), | |
filter: function (e, t) { | |
var n, o, i, a = t.button, c = t.fromElement; | |
return null == e.pageX && null != t.clientX && (i = (o = e.target.ownerDocument || r).documentElement, n = o.body, e.pageX = t.clientX + (i && i.scrollLeft || n && n.scrollLeft || 0) - (i && i.clientLeft || n && n.clientLeft || 0), e.pageY = t.clientY + (i && i.scrollTop || n && n.scrollTop || 0) - (i && i.clientTop || n && n.clientTop || 0)), !e.relatedTarget && c && (e.relatedTarget = c === e.target ? t.toElement : c), e.which || void 0 === a || (e.which = 1 & a ? 1 : 2 & a ? 3 : 4 & a ? 2 : 0), e | |
} | |
}, | |
special: { | |
load: {noBubble: !0}, focus: { | |
trigger: function () { | |
if (this !== he() && this.focus) try { | |
return this.focus(), !1 | |
} catch (e) { | |
} | |
}, delegateType: "focusin" | |
}, blur: { | |
trigger: function () { | |
return this === he() && this.blur ? (this.blur(), !1) : void 0 | |
}, delegateType: "focusout" | |
}, click: { | |
trigger: function () { | |
return f.nodeName(this, "input") && "checkbox" === this.type && this.click ? (this.click(), !1) : void 0 | |
}, _default: function (e) { | |
return f.nodeName(e.target, "a") | |
} | |
}, beforeunload: { | |
postDispatch: function (e) { | |
void 0 !== e.result && e.originalEvent && (e.originalEvent.returnValue = e.result) | |
} | |
} | |
}, | |
simulate: function (e, t, n) { | |
var r = f.extend(new f.Event, n, {type: e, isSimulated: !0}); | |
f.event.trigger(r, null, t), r.isDefaultPrevented() && n.preventDefault() | |
} | |
}, f.removeEvent = r.removeEventListener ? function (e, t, n) { | |
e.removeEventListener && e.removeEventListener(t, n) | |
} : function (e, t, n) { | |
var r = "on" + t; | |
e.detachEvent && (void 0 === e[r] && (e[r] = null), e.detachEvent(r, n)) | |
}, f.Event = function (e, t) { | |
return this instanceof f.Event ? (e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || void 0 === e.defaultPrevented && !1 === e.returnValue ? fe : me) : this.type = e, t && f.extend(this, t), this.timeStamp = e && e.timeStamp || f.now(), void (this[f.expando] = !0)) : new f.Event(e, t) | |
}, f.Event.prototype = { | |
constructor: f.Event, | |
isDefaultPrevented: me, | |
isPropagationStopped: me, | |
isImmediatePropagationStopped: me, | |
preventDefault: function () { | |
var e = this.originalEvent; | |
this.isDefaultPrevented = fe, e && (e.preventDefault ? e.preventDefault() : e.returnValue = !1) | |
}, | |
stopPropagation: function () { | |
var e = this.originalEvent; | |
this.isPropagationStopped = fe, e && !this.isSimulated && (e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0) | |
}, | |
stopImmediatePropagation: function () { | |
var e = this.originalEvent; | |
this.isImmediatePropagationStopped = fe, e && e.stopImmediatePropagation && e.stopImmediatePropagation(), this.stopPropagation() | |
} | |
}, f.each({ | |
mouseenter: "mouseover", | |
mouseleave: "mouseout", | |
pointerenter: "pointerover", | |
pointerleave: "pointerout" | |
}, function (e, t) { | |
f.event.special[e] = { | |
delegateType: t, bindType: t, handle: function (e) { | |
var n, r = e.relatedTarget, o = e.handleObj; | |
return r && (r === this || f.contains(this, r)) || (e.type = o.origType, n = o.handler.apply(this, arguments), e.type = t), n | |
} | |
} | |
}), d.submit || (f.event.special.submit = { | |
setup: function () { | |
return !f.nodeName(this, "form") && void f.event.add(this, "click._submit keypress._submit", function (e) { | |
var t = e.target, | |
n = f.nodeName(t, "input") || f.nodeName(t, "button") ? f.prop(t, "form") : void 0; | |
n && !f._data(n, "submit") && (f.event.add(n, "submit._submit", function (e) { | |
e._submitBubble = !0 | |
}), f._data(n, "submit", !0)) | |
}) | |
}, postDispatch: function (e) { | |
e._submitBubble && (delete e._submitBubble, this.parentNode && !e.isTrigger && f.event.simulate("submit", this.parentNode, e)) | |
}, teardown: function () { | |
return !f.nodeName(this, "form") && void f.event.remove(this, "._submit") | |
} | |
}), d.change || (f.event.special.change = { | |
setup: function () { | |
return se.test(this.nodeName) ? ("checkbox" !== this.type && "radio" !== this.type || (f.event.add(this, "propertychange._change", function (e) { | |
"checked" === e.originalEvent.propertyName && (this._justChanged = !0) | |
}), f.event.add(this, "click._change", function (e) { | |
this._justChanged && !e.isTrigger && (this._justChanged = !1), f.event.simulate("change", this, e) | |
})), !1) : void f.event.add(this, "beforeactivate._change", function (e) { | |
var t = e.target; | |
se.test(t.nodeName) && !f._data(t, "change") && (f.event.add(t, "change._change", function (e) { | |
!this.parentNode || e.isSimulated || e.isTrigger || f.event.simulate("change", this.parentNode, e) | |
}), f._data(t, "change", !0)) | |
}) | |
}, handle: function (e) { | |
var t = e.target; | |
return this !== t || e.isSimulated || e.isTrigger || "radio" !== t.type && "checkbox" !== t.type ? e.handleObj.handler.apply(this, arguments) : void 0 | |
}, teardown: function () { | |
return f.event.remove(this, "._change"), !se.test(this.nodeName) | |
} | |
}), d.focusin || f.each({focus: "focusin", blur: "focusout"}, function (e, t) { | |
var n = function (e) { | |
f.event.simulate(t, e.target, f.event.fix(e)) | |
}; | |
f.event.special[t] = { | |
setup: function () { | |
var r = this.ownerDocument || this, o = f._data(r, t); | |
o || r.addEventListener(e, n, !0), f._data(r, t, (o || 0) + 1) | |
}, teardown: function () { | |
var r = this.ownerDocument || this, o = f._data(r, t) - 1; | |
o ? f._data(r, t, o) : (r.removeEventListener(e, n, !0), f._removeData(r, t)) | |
} | |
} | |
}), f.fn.extend({ | |
on: function (e, t, n, r) { | |
return ge(this, e, t, n, r) | |
}, one: function (e, t, n, r) { | |
return ge(this, e, t, n, r, 1) | |
}, off: function (e, t, n) { | |
var r, o; | |
if (e && e.preventDefault && e.handleObj) return r = e.handleObj, f(e.delegateTarget).off(r.namespace ? r.origType + "." + r.namespace : r.origType, r.selector, r.handler), this; | |
if ("object" == typeof e) { | |
for (o in e) this.off(o, t, e[o]); | |
return this | |
} | |
return !1 !== t && "function" != typeof t || (n = t, t = void 0), !1 === n && (n = me), this.each(function () { | |
f.event.remove(this, e, n, t) | |
}) | |
}, trigger: function (e, t) { | |
return this.each(function () { | |
f.event.trigger(e, t, this) | |
}) | |
}, triggerHandler: function (e, t) { | |
var n = this[0]; | |
return n ? f.event.trigger(e, t, n, !0) : void 0 | |
} | |
}); | |
var ve = / jQuery\d+="(?:null|\d+)"/g, ye = new RegExp("<(?:" + X + ")[\\s/>]", "i"), | |
Ee = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, | |
Ce = /<script|<style|<link/i, Te = /checked\s*(?:[^=]|=\s*.checked.)/i, _e = /^true\/(.*)/, | |
Se = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, we = ee(r).appendChild(r.createElement("div")); | |
function be(e, t) { | |
return f.nodeName(e, "table") && f.nodeName(11 !== t.nodeType ? t : t.firstChild, "tr") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e | |
} | |
function Ae(e) { | |
return e.type = (null !== f.find.attr(e, "type")) + "/" + e.type, e | |
} | |
function Pe(e) { | |
var t = _e.exec(e.type); | |
return t ? e.type = t[1] : e.removeAttribute("type"), e | |
} | |
function $e(e, t) { | |
if (1 === t.nodeType && f.hasData(e)) { | |
var n, r, o, i = f._data(e), a = f._data(t, i), c = i.events; | |
if (c) for (n in delete a.handle, a.events = {}, c) for (r = 0, o = c[n].length; o > r; r++) f.event.add(t, n, c[n][r]); | |
a.data && (a.data = f.extend({}, a.data)) | |
} | |
} | |
function ke(e, t) { | |
var n, r, o; | |
if (1 === t.nodeType) { | |
if (n = t.nodeName.toLowerCase(), !d.noCloneEvent && t[f.expando]) { | |
for (r in(o = f._data(t)).events) f.removeEvent(t, r, o.handle); | |
t.removeAttribute(f.expando) | |
} | |
"script" === n && t.text !== e.text ? (Ae(t).text = e.text, Pe(t)) : "object" === n ? (t.parentNode && (t.outerHTML = e.outerHTML), d.html5Clone && e.innerHTML && !f.trim(t.innerHTML) && (t.innerHTML = e.innerHTML)) : "input" === n && K.test(e.type) ? (t.defaultChecked = t.checked = e.checked, t.value !== e.value && (t.value = e.value)) : "option" === n ? t.defaultSelected = t.selected = e.defaultSelected : "input" !== n && "textarea" !== n || (t.defaultValue = e.defaultValue) | |
} | |
} | |
function Ie(e, t, n, r) { | |
t = i.apply([], t); | |
var o, a, c, s, l, u, p = 0, m = e.length, h = m - 1, g = t[0], v = f.isFunction(g); | |
if (v || m > 1 && "string" == typeof g && !d.checkClone && Te.test(g)) return e.each(function (o) { | |
var i = e.eq(o); | |
v && (t[0] = g.call(this, o, i.html())), Ie(i, t, n, r) | |
}); | |
if (m && (o = (u = ce(t, e[0].ownerDocument, !1, e, r)).firstChild, 1 === u.childNodes.length && (u = o), o || r)) { | |
for (c = (s = f.map(ne(u, "script"), Ae)).length; m > p; p++) a = u, p !== h && (a = f.clone(a, !0, !0), c && f.merge(s, ne(a, "script"))), n.call(e[p], a, p); | |
if (c) for (l = s[s.length - 1].ownerDocument, f.map(s, Pe), p = 0; c > p; p++) a = s[p], J.test(a.type || "") && !f._data(a, "globalEval") && f.contains(l, a) && (a.src ? f._evalUrl && f._evalUrl(a.src) : f.globalEval((a.text || a.textContent || a.innerHTML || "").replace(Se, ""))); | |
u = o = null | |
} | |
return e | |
} | |
function Ne(e, t, n) { | |
for (var r, o = t ? f.filter(t, e) : e, i = 0; null != (r = o[i]); i++) n || 1 !== r.nodeType || f.cleanData(ne(r)), r.parentNode && (n && f.contains(r.ownerDocument, r) && re(ne(r, "script")), r.parentNode.removeChild(r)); | |
return e | |
} | |
f.extend({ | |
htmlPrefilter: function (e) { | |
return e.replace(Ee, "<$1></$2>") | |
}, clone: function (e, t, n) { | |
var r, o, i, a, c, s = f.contains(e.ownerDocument, e); | |
if (d.html5Clone || f.isXMLDoc(e) || !ye.test("<" + e.nodeName + ">") ? i = e.cloneNode(!0) : (we.innerHTML = e.outerHTML, we.removeChild(i = we.firstChild)), !(d.noCloneEvent && d.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || f.isXMLDoc(e))) for (r = ne(i), c = ne(e), a = 0; null != (o = c[a]); ++a) r[a] && ke(o, r[a]); | |
if (t) if (n) for (c = c || ne(e), r = r || ne(i), a = 0; null != (o = c[a]); a++) $e(o, r[a]); else $e(e, i); | |
return (r = ne(i, "script")).length > 0 && re(r, !s && ne(e, "script")), r = c = o = null, i | |
}, cleanData: function (e, t) { | |
for (var r, o, i, a, c = 0, s = f.expando, l = f.cache, u = d.attributes, p = f.event.special; null != (r = e[c]); c++) if ((t || R(r)) && (a = (i = r[s]) && l[i])) { | |
if (a.events) for (o in a.events) p[o] ? f.event.remove(r, o) : f.removeEvent(r, o, a.handle); | |
l[i] && (delete l[i], u || void 0 === r.removeAttribute ? r[s] = void 0 : r.removeAttribute(s), n.push(i)) | |
} | |
} | |
}), f.fn.extend({ | |
domManip: Ie, detach: function (e) { | |
return Ne(this, e, !0) | |
}, remove: function (e) { | |
return Ne(this, e) | |
}, text: function (e) { | |
return z(this, function (e) { | |
return void 0 === e ? f.text(this) : this.empty().append((this[0] && this[0].ownerDocument || r).createTextNode(e)) | |
}, null, e, arguments.length) | |
}, append: function () { | |
return Ie(this, arguments, function (e) { | |
1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || be(this, e).appendChild(e) | |
}) | |
}, prepend: function () { | |
return Ie(this, arguments, function (e) { | |
if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { | |
var t = be(this, e); | |
t.insertBefore(e, t.firstChild) | |
} | |
}) | |
}, before: function () { | |
return Ie(this, arguments, function (e) { | |
this.parentNode && this.parentNode.insertBefore(e, this) | |
}) | |
}, after: function () { | |
return Ie(this, arguments, function (e) { | |
this.parentNode && this.parentNode.insertBefore(e, this.nextSibling) | |
}) | |
}, empty: function () { | |
for (var e, t = 0; null != (e = this[t]); t++) { | |
for (1 === e.nodeType && f.cleanData(ne(e, !1)); e.firstChild;) e.removeChild(e.firstChild); | |
e.options && f.nodeName(e, "select") && (e.options.length = 0) | |
} | |
return this | |
}, clone: function (e, t) { | |
return e = null != e && e, t = null == t ? e : t, this.map(function () { | |
return f.clone(this, e, t) | |
}) | |
}, html: function (e) { | |
return z(this, function (e) { | |
var t = this[0] || {}, n = 0, r = this.length; | |
if (void 0 === e) return 1 === t.nodeType ? t.innerHTML.replace(ve, "") : void 0; | |
if ("string" == typeof e && !Ce.test(e) && (d.htmlSerialize || !ye.test(e)) && (d.leadingWhitespace || !Q.test(e)) && !te[(Z.exec(e) || ["", ""])[1].toLowerCase()]) { | |
e = f.htmlPrefilter(e); | |
try { | |
for (; r > n; n++) 1 === (t = this[n] || {}).nodeType && (f.cleanData(ne(t, !1)), t.innerHTML = e); | |
t = 0 | |
} catch (e) { | |
} | |
} | |
t && this.empty().append(e) | |
}, null, e, arguments.length) | |
}, replaceWith: function () { | |
var e = []; | |
return Ie(this, arguments, function (t) { | |
var n = this.parentNode; | |
f.inArray(this, e) < 0 && (f.cleanData(ne(this)), n && n.replaceChild(t, this)) | |
}, e) | |
} | |
}), f.each({ | |
appendTo: "append", | |
prependTo: "prepend", | |
insertBefore: "before", | |
insertAfter: "after", | |
replaceAll: "replaceWith" | |
}, function (e, t) { | |
f.fn[e] = function (e) { | |
for (var n, r = 0, o = [], i = f(e), c = i.length - 1; c >= r; r++) n = r === c ? this : this.clone(!0), f(i[r])[t](n), a.apply(o, n.get()); | |
return this.pushStack(o) | |
} | |
}); | |
var De, xe = {HTML: "block", BODY: "block"}; | |
function Oe(e, t) { | |
var n = f(t.createElement(e)).appendTo(t.body), r = f.css(n[0], "display"); | |
return n.detach(), r | |
} | |
function Me(e) { | |
var t = r, n = xe[e]; | |
return n || ("none" !== (n = Oe(e, t)) && n || ((t = ((De = (De || f("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement))[0].contentWindow || De[0].contentDocument).document).write(), t.close(), n = Oe(e, t), De.detach()), xe[e] = n), n | |
} | |
var Re = /^margin/, Le = new RegExp("^(" + W + ")(?!px)[a-z%]+$", "i"), Ve = function (e, t, n, r) { | |
var o, i, a = {}; | |
for (i in t) a[i] = e.style[i], e.style[i] = t[i]; | |
for (i in o = n.apply(e, r || []), t) e.style[i] = a[i]; | |
return o | |
}, Fe = r.documentElement; | |
!function () { | |
var t, n, o, i, a, c, s = r.createElement("div"), l = r.createElement("div"); | |
if (l.style) { | |
function u() { | |
var u, d, p = r.documentElement; | |
p.appendChild(s), l.style.cssText = "-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%", t = o = c = !1, n = a = !0, e.getComputedStyle && (d = e.getComputedStyle(l), t = "1%" !== (d || {}).top, c = "2px" === (d || {}).marginLeft, o = "4px" === (d || {width: "4px"}).width, l.style.marginRight = "50%", n = "4px" === (d || {marginRight: "4px"}).marginRight, (u = l.appendChild(r.createElement("div"))).style.cssText = l.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", u.style.marginRight = u.style.width = "0", l.style.width = "1px", a = !parseFloat((e.getComputedStyle(u) || {}).marginRight), l.removeChild(u)), l.style.display = "none", (i = 0 === l.getClientRects().length) && (l.style.display = "", l.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", l.childNodes[0].style.borderCollapse = "separate", (u = l.getElementsByTagName("td"))[0].style.cssText = "margin:0;border:0;padding:0;display:none", (i = 0 === u[0].offsetHeight) && (u[0].style.display = "", u[1].style.display = "none", i = 0 === u[0].offsetHeight)), p.removeChild(s) | |
} | |
l.style.cssText = "float:left;opacity:.5", d.opacity = "0.5" === l.style.opacity, d.cssFloat = !!l.style.cssFloat, l.style.backgroundClip = "content-box", l.cloneNode(!0).style.backgroundClip = "", d.clearCloneStyle = "content-box" === l.style.backgroundClip, (s = r.createElement("div")).style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute", l.innerHTML = "", s.appendChild(l), d.boxSizing = "" === l.style.boxSizing || "" === l.style.MozBoxSizing || "" === l.style.WebkitBoxSizing, f.extend(d, { | |
reliableHiddenOffsets: function () { | |
return null == t && u(), i | |
}, boxSizingReliable: function () { | |
return null == t && u(), o | |
}, pixelMarginRight: function () { | |
return null == t && u(), n | |
}, pixelPosition: function () { | |
return null == t && u(), t | |
}, reliableMarginRight: function () { | |
return null == t && u(), a | |
}, reliableMarginLeft: function () { | |
return null == t && u(), c | |
} | |
}) | |
} | |
}(); | |
var Ue, Be, He = /^(top|right|bottom|left)$/; | |
function We(e, t) { | |
return { | |
get: function () { | |
return e() ? void delete this.get : (this.get = t).apply(this, arguments) | |
} | |
} | |
} | |
e.getComputedStyle ? (Ue = function (t) { | |
var n = t.ownerDocument.defaultView; | |
return n && n.opener || (n = e), n.getComputedStyle(t) | |
}, Be = function (e, t, n) { | |
var r, o, i, a, c = e.style; | |
return "" !== (a = (n = n || Ue(e)) ? n.getPropertyValue(t) || n[t] : void 0) && void 0 !== a || f.contains(e.ownerDocument, e) || (a = f.style(e, t)), n && !d.pixelMarginRight() && Le.test(a) && Re.test(t) && (r = c.width, o = c.minWidth, i = c.maxWidth, c.minWidth = c.maxWidth = c.width = a, a = n.width, c.width = r, c.minWidth = o, c.maxWidth = i), void 0 === a ? a : a + "" | |
}) : Fe.currentStyle && (Ue = function (e) { | |
return e.currentStyle | |
}, Be = function (e, t, n) { | |
var r, o, i, a, c = e.style; | |
return null == (a = (n = n || Ue(e)) ? n[t] : void 0) && c && c[t] && (a = c[t]), Le.test(a) && !He.test(t) && (r = c.left, (i = (o = e.runtimeStyle) && o.left) && (o.left = e.currentStyle.left), c.left = "fontSize" === t ? "1em" : a, a = c.pixelLeft + "px", c.left = r, i && (o.left = i)), void 0 === a ? a : a + "" || "auto" | |
}); | |
var je = /alpha\([^)]*\)/i, Ye = /opacity\s*=\s*([^)]*)/i, qe = /^(none|table(?!-c[ea]).+)/, | |
Ge = new RegExp("^(" + W + ")(.*)$", "i"), | |
ze = {position: "absolute", visibility: "hidden", display: "block"}, | |
Ke = {letterSpacing: "0", fontWeight: "400"}, Ze = ["Webkit", "O", "Moz", "ms"], | |
Je = r.createElement("div").style; | |
function Qe(e) { | |
if (e in Je) return e; | |
for (var t = e.charAt(0).toUpperCase() + e.slice(1), n = Ze.length; n--;) if ((e = Ze[n] + t) in Je) return e | |
} | |
function Xe(e, t) { | |
for (var n, r, o, i = [], a = 0, c = e.length; c > a; a++) (r = e[a]).style && (i[a] = f._data(r, "olddisplay"), n = r.style.display, t ? (i[a] || "none" !== n || (r.style.display = ""), "" === r.style.display && q(r) && (i[a] = f._data(r, "olddisplay", Me(r.nodeName)))) : (o = q(r), (n && "none" !== n || !o) && f._data(r, "olddisplay", o ? n : f.css(r, "display")))); | |
for (a = 0; c > a; a++) (r = e[a]).style && (t && "none" !== r.style.display && "" !== r.style.display || (r.style.display = t ? i[a] || "" : "none")); | |
return e | |
} | |
function et(e, t, n) { | |
var r = Ge.exec(t); | |
return r ? Math.max(0, r[1] - (n || 0)) + (r[2] || "px") : t | |
} | |
function tt(e, t, n, r, o) { | |
for (var i = n === (r ? "border" : "content") ? 4 : "width" === t ? 1 : 0, a = 0; 4 > i; i += 2) "margin" === n && (a += f.css(e, n + Y[i], !0, o)), r ? ("content" === n && (a -= f.css(e, "padding" + Y[i], !0, o)), "margin" !== n && (a -= f.css(e, "border" + Y[i] + "Width", !0, o))) : (a += f.css(e, "padding" + Y[i], !0, o), "padding" !== n && (a += f.css(e, "border" + Y[i] + "Width", !0, o))); | |
return a | |
} | |
function nt(e, t, n) { | |
var r = !0, o = "width" === t ? e.offsetWidth : e.offsetHeight, i = Ue(e), | |
a = d.boxSizing && "border-box" === f.css(e, "boxSizing", !1, i); | |
if (0 >= o || null == o) { | |
if ((0 > (o = Be(e, t, i)) || null == o) && (o = e.style[t]), Le.test(o)) return o; | |
r = a && (d.boxSizingReliable() || o === e.style[t]), o = parseFloat(o) || 0 | |
} | |
return o + tt(e, t, n || (a ? "border" : "content"), r, i) + "px" | |
} | |
function rt(e, t, n, r, o) { | |
return new rt.prototype.init(e, t, n, r, o) | |
} | |
f.extend({ | |
cssHooks: { | |
opacity: { | |
get: function (e, t) { | |
if (t) { | |
var n = Be(e, "opacity"); | |
return "" === n ? "1" : n | |
} | |
} | |
} | |
}, | |
cssNumber: { | |
animationIterationCount: !0, | |
columnCount: !0, | |
fillOpacity: !0, | |
flexGrow: !0, | |
flexShrink: !0, | |
fontWeight: !0, | |
lineHeight: !0, | |
opacity: !0, | |
order: !0, | |
orphans: !0, | |
widows: !0, | |
zIndex: !0, | |
zoom: !0 | |
}, | |
cssProps: {float: d.cssFloat ? "cssFloat" : "styleFloat"}, | |
style: function (e, t, n, r) { | |
if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) { | |
var o, i, a, c = f.camelCase(t), s = e.style; | |
if (t = f.cssProps[c] || (f.cssProps[c] = Qe(c) || c), a = f.cssHooks[t] || f.cssHooks[c], void 0 === n) return a && "get" in a && void 0 !== (o = a.get(e, !1, r)) ? o : s[t]; | |
if ("string" === (i = typeof n) && (o = j.exec(n)) && o[1] && (n = G(e, t, o), i = "number"), null != n && n == n && ("number" === i && (n += o && o[3] || (f.cssNumber[c] ? "" : "px")), d.clearCloneStyle || "" !== n || 0 !== t.indexOf("background") || (s[t] = "inherit"), !(a && "set" in a && void 0 === (n = a.set(e, n, r))))) try { | |
s[t] = n | |
} catch (e) { | |
} | |
} | |
}, | |
css: function (e, t, n, r) { | |
var o, i, a, c = f.camelCase(t); | |
return t = f.cssProps[c] || (f.cssProps[c] = Qe(c) || c), (a = f.cssHooks[t] || f.cssHooks[c]) && "get" in a && (i = a.get(e, !0, n)), void 0 === i && (i = Be(e, t, r)), "normal" === i && t in Ke && (i = Ke[t]), "" === n || n ? (o = parseFloat(i), !0 === n || isFinite(o) ? o || 0 : i) : i | |
} | |
}), f.each(["height", "width"], function (e, t) { | |
f.cssHooks[t] = { | |
get: function (e, n, r) { | |
return n ? qe.test(f.css(e, "display")) && 0 === e.offsetWidth ? Ve(e, ze, function () { | |
return nt(e, t, r) | |
}) : nt(e, t, r) : void 0 | |
}, set: function (e, n, r) { | |
var o = r && Ue(e); | |
return et(0, n, r ? tt(e, t, r, d.boxSizing && "border-box" === f.css(e, "boxSizing", !1, o), o) : 0) | |
} | |
} | |
}), d.opacity || (f.cssHooks.opacity = { | |
get: function (e, t) { | |
return Ye.test((t && e.currentStyle ? e.currentStyle.filter : e.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : t ? "1" : "" | |
}, set: function (e, t) { | |
var n = e.style, r = e.currentStyle, o = f.isNumeric(t) ? "alpha(opacity=" + 100 * t + ")" : "", | |
i = r && r.filter || n.filter || ""; | |
n.zoom = 1, (t >= 1 || "" === t) && "" === f.trim(i.replace(je, "")) && n.removeAttribute && (n.removeAttribute("filter"), "" === t || r && !r.filter) || (n.filter = je.test(i) ? i.replace(je, o) : i + " " + o) | |
} | |
}), f.cssHooks.marginRight = We(d.reliableMarginRight, function (e, t) { | |
return t ? Ve(e, {display: "inline-block"}, Be, [e, "marginRight"]) : void 0 | |
}), f.cssHooks.marginLeft = We(d.reliableMarginLeft, function (e, t) { | |
return t ? (parseFloat(Be(e, "marginLeft")) || (f.contains(e.ownerDocument, e) ? e.getBoundingClientRect().left - Ve(e, {marginLeft: 0}, function () { | |
return e.getBoundingClientRect().left | |
}) : 0)) + "px" : void 0 | |
}), f.each({margin: "", padding: "", border: "Width"}, function (e, t) { | |
f.cssHooks[e + t] = { | |
expand: function (n) { | |
for (var r = 0, o = {}, i = "string" == typeof n ? n.split(" ") : [n]; 4 > r; r++) o[e + Y[r] + t] = i[r] || i[r - 2] || i[0]; | |
return o | |
} | |
}, Re.test(e) || (f.cssHooks[e + t].set = et) | |
}), f.fn.extend({ | |
css: function (e, t) { | |
return z(this, function (e, t, n) { | |
var r, o, i = {}, a = 0; | |
if (f.isArray(t)) { | |
for (r = Ue(e), o = t.length; o > a; a++) i[t[a]] = f.css(e, t[a], !1, r); | |
return i | |
} | |
return void 0 !== n ? f.style(e, t, n) : f.css(e, t) | |
}, e, t, arguments.length > 1) | |
}, show: function () { | |
return Xe(this, !0) | |
}, hide: function () { | |
return Xe(this) | |
}, toggle: function (e) { | |
return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function () { | |
q(this) ? f(this).show() : f(this).hide() | |
}) | |
} | |
}), f.Tween = rt, rt.prototype = { | |
constructor: rt, init: function (e, t, n, r, o, i) { | |
this.elem = e, this.prop = n, this.easing = o || f.easing._default, this.options = t, this.start = this.now = this.cur(), this.end = r, this.unit = i || (f.cssNumber[n] ? "" : "px") | |
}, cur: function () { | |
var e = rt.propHooks[this.prop]; | |
return e && e.get ? e.get(this) : rt.propHooks._default.get(this) | |
}, run: function (e) { | |
var t, n = rt.propHooks[this.prop]; | |
return this.options.duration ? this.pos = t = f.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : this.pos = t = e, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), n && n.set ? n.set(this) : rt.propHooks._default.set(this), this | |
} | |
}, rt.prototype.init.prototype = rt.prototype, rt.propHooks = { | |
_default: { | |
get: function (e) { | |
var t; | |
return 1 !== e.elem.nodeType || null != e.elem[e.prop] && null == e.elem.style[e.prop] ? e.elem[e.prop] : (t = f.css(e.elem, e.prop, "")) && "auto" !== t ? t : 0 | |
}, set: function (e) { | |
f.fx.step[e.prop] ? f.fx.step[e.prop](e) : 1 !== e.elem.nodeType || null == e.elem.style[f.cssProps[e.prop]] && !f.cssHooks[e.prop] ? e.elem[e.prop] = e.now : f.style(e.elem, e.prop, e.now + e.unit) | |
} | |
} | |
}, rt.propHooks.scrollTop = rt.propHooks.scrollLeft = { | |
set: function (e) { | |
e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now) | |
} | |
}, f.easing = { | |
linear: function (e) { | |
return e | |
}, swing: function (e) { | |
return .5 - Math.cos(e * Math.PI) / 2 | |
}, _default: "swing" | |
}, f.fx = rt.prototype.init, f.fx.step = {}; | |
var ot, it, at = /^(?:toggle|show|hide)$/, ct = /queueHooks$/; | |
function st() { | |
return e.setTimeout(function () { | |
ot = void 0 | |
}), ot = f.now() | |
} | |
function lt(e, t) { | |
var n, r = {height: e}, o = 0; | |
for (t = t ? 1 : 0; 4 > o; o += 2 - t) r["margin" + (n = Y[o])] = r["padding" + n] = e; | |
return t && (r.opacity = r.width = e), r | |
} | |
function ut(e, t, n) { | |
for (var r, o = (dt.tweeners[t] || []).concat(dt.tweeners["*"]), i = 0, a = o.length; a > i; i++) if (r = o[i].call(n, t, e)) return r | |
} | |
function dt(e, t, n) { | |
var r, o, i = 0, a = dt.prefilters.length, c = f.Deferred().always(function () { | |
delete s.elem | |
}), s = function () { | |
if (o) return !1; | |
for (var t = ot || st(), n = Math.max(0, l.startTime + l.duration - t), r = 1 - (n / l.duration || 0), i = 0, a = l.tweens.length; a > i; i++) l.tweens[i].run(r); | |
return c.notifyWith(e, [l, r, n]), 1 > r && a ? n : (c.resolveWith(e, [l]), !1) | |
}, l = c.promise({ | |
elem: e, | |
props: f.extend({}, t), | |
opts: f.extend(!0, {specialEasing: {}, easing: f.easing._default}, n), | |
originalProperties: t, | |
originalOptions: n, | |
startTime: ot || st(), | |
duration: n.duration, | |
tweens: [], | |
createTween: function (t, n) { | |
var r = f.Tween(e, l.opts, t, n, l.opts.specialEasing[t] || l.opts.easing); | |
return l.tweens.push(r), r | |
}, | |
stop: function (t) { | |
var n = 0, r = t ? l.tweens.length : 0; | |
if (o) return this; | |
for (o = !0; r > n; n++) l.tweens[n].run(1); | |
return t ? (c.notifyWith(e, [l, 1, 0]), c.resolveWith(e, [l, t])) : c.rejectWith(e, [l, t]), this | |
} | |
}), u = l.props; | |
for (function (e, t) { | |
var n, r, o, i, a; | |
for (n in e) if (o = t[r = f.camelCase(n)], i = e[n], f.isArray(i) && (o = i[1], i = e[n] = i[0]), n !== r && (e[r] = i, delete e[n]), (a = f.cssHooks[r]) && "expand" in a) for (n in i = a.expand(i), delete e[r], i) n in e || (e[n] = i[n], t[n] = o); else t[r] = o | |
}(u, l.opts.specialEasing); a > i; i++) if (r = dt.prefilters[i].call(l, e, u, l.opts)) return f.isFunction(r.stop) && (f._queueHooks(l.elem, l.opts.queue).stop = f.proxy(r.stop, r)), r; | |
return f.map(u, ut, l), f.isFunction(l.opts.start) && l.opts.start.call(e, l), f.fx.timer(f.extend(s, { | |
elem: e, | |
anim: l, | |
queue: l.opts.queue | |
})), l.progress(l.opts.progress).done(l.opts.done, l.opts.complete).fail(l.opts.fail).always(l.opts.always) | |
} | |
f.Animation = f.extend(dt, { | |
tweeners: { | |
"*": [function (e, t) { | |
var n = this.createTween(e, t); | |
return G(n.elem, e, j.exec(t), n), n | |
}] | |
}, tweener: function (e, t) { | |
f.isFunction(e) ? (t = e, e = ["*"]) : e = e.match(x); | |
for (var n, r = 0, o = e.length; o > r; r++) n = e[r], dt.tweeners[n] = dt.tweeners[n] || [], dt.tweeners[n].unshift(t) | |
}, prefilters: [function (e, t, n) { | |
var r, o, i, a, c, s, l, u = this, p = {}, m = e.style, h = e.nodeType && q(e), | |
g = f._data(e, "fxshow"); | |
for (r in n.queue || (null == (c = f._queueHooks(e, "fx")).unqueued && (c.unqueued = 0, s = c.empty.fire, c.empty.fire = function () { | |
c.unqueued || s() | |
}), c.unqueued++, u.always(function () { | |
u.always(function () { | |
c.unqueued--, f.queue(e, "fx").length || c.empty.fire() | |
}) | |
})), 1 === e.nodeType && ("height" in t || "width" in t) && (n.overflow = [m.overflow, m.overflowX, m.overflowY], "inline" === ("none" === (l = f.css(e, "display")) ? f._data(e, "olddisplay") || Me(e.nodeName) : l) && "none" === f.css(e, "float") && (d.inlineBlockNeedsLayout && "inline" !== Me(e.nodeName) ? m.zoom = 1 : m.display = "inline-block")), n.overflow && (m.overflow = "hidden", d.shrinkWrapBlocks() || u.always(function () { | |
m.overflow = n.overflow[0], m.overflowX = n.overflow[1], m.overflowY = n.overflow[2] | |
})), t) if (o = t[r], at.exec(o)) { | |
if (delete t[r], i = i || "toggle" === o, o === (h ? "hide" : "show")) { | |
if ("show" !== o || !g || void 0 === g[r]) continue; | |
h = !0 | |
} | |
p[r] = g && g[r] || f.style(e, r) | |
} else l = void 0; | |
if (f.isEmptyObject(p)) "inline" === ("none" === l ? Me(e.nodeName) : l) && (m.display = l); else for (r in g ? "hidden" in g && (h = g.hidden) : g = f._data(e, "fxshow", {}), i && (g.hidden = !h), h ? f(e).show() : u.done(function () { | |
f(e).hide() | |
}), u.done(function () { | |
var t; | |
for (t in f._removeData(e, "fxshow"), p) f.style(e, t, p[t]) | |
}), p) a = ut(h ? g[r] : 0, r, u), r in g || (g[r] = a.start, h && (a.end = a.start, a.start = "width" === r || "height" === r ? 1 : 0)) | |
}], prefilter: function (e, t) { | |
t ? dt.prefilters.unshift(e) : dt.prefilters.push(e) | |
} | |
}), f.speed = function (e, t, n) { | |
var r = e && "object" == typeof e ? f.extend({}, e) : { | |
complete: n || !n && t || f.isFunction(e) && e, | |
duration: e, | |
easing: n && t || t && !f.isFunction(t) && t | |
}; | |
return r.duration = f.fx.off ? 0 : "number" == typeof r.duration ? r.duration : r.duration in f.fx.speeds ? f.fx.speeds[r.duration] : f.fx.speeds._default, null != r.queue && !0 !== r.queue || (r.queue = "fx"), r.old = r.complete, r.complete = function () { | |
f.isFunction(r.old) && r.old.call(this), r.queue && f.dequeue(this, r.queue) | |
}, r | |
}, f.fn.extend({ | |
fadeTo: function (e, t, n, r) { | |
return this.filter(q).css("opacity", 0).show().end().animate({opacity: t}, e, n, r) | |
}, animate: function (e, t, n, r) { | |
var o = f.isEmptyObject(e), i = f.speed(t, n, r), a = function () { | |
var t = dt(this, f.extend({}, e), i); | |
(o || f._data(this, "finish")) && t.stop(!0) | |
}; | |
return a.finish = a, o || !1 === i.queue ? this.each(a) : this.queue(i.queue, a) | |
}, stop: function (e, t, n) { | |
var r = function (e) { | |
var t = e.stop; | |
delete e.stop, t(n) | |
}; | |
return "string" != typeof e && (n = t, t = e, e = void 0), t && !1 !== e && this.queue(e || "fx", []), this.each(function () { | |
var t = !0, o = null != e && e + "queueHooks", i = f.timers, a = f._data(this); | |
if (o) a[o] && a[o].stop && r(a[o]); else for (o in a) a[o] && a[o].stop && ct.test(o) && r(a[o]); | |
for (o = i.length; o--;) i[o].elem !== this || null != e && i[o].queue !== e || (i[o].anim.stop(n), t = !1, i.splice(o, 1)); | |
!t && n || f.dequeue(this, e) | |
}) | |
}, finish: function (e) { | |
return !1 !== e && (e = e || "fx"), this.each(function () { | |
var t, n = f._data(this), r = n[e + "queue"], o = n[e + "queueHooks"], i = f.timers, | |
a = r ? r.length : 0; | |
for (n.finish = !0, f.queue(this, e, []), o && o.stop && o.stop.call(this, !0), t = i.length; t--;) i[t].elem === this && i[t].queue === e && (i[t].anim.stop(!0), i.splice(t, 1)); | |
for (t = 0; a > t; t++) r[t] && r[t].finish && r[t].finish.call(this); | |
delete n.finish | |
}) | |
} | |
}), f.each(["toggle", "show", "hide"], function (e, t) { | |
var n = f.fn[t]; | |
f.fn[t] = function (e, r, o) { | |
return null == e || "boolean" == typeof e ? n.apply(this, arguments) : this.animate(lt(t, !0), e, r, o) | |
} | |
}), f.each({ | |
slideDown: lt("show"), | |
slideUp: lt("hide"), | |
slideToggle: lt("toggle"), | |
fadeIn: {opacity: "show"}, | |
fadeOut: {opacity: "hide"}, | |
fadeToggle: {opacity: "toggle"} | |
}, function (e, t) { | |
f.fn[e] = function (e, n, r) { | |
return this.animate(t, e, n, r) | |
} | |
}), f.timers = [], f.fx.tick = function () { | |
var e, t = f.timers, n = 0; | |
for (ot = f.now(); n < t.length; n++) (e = t[n])() || t[n] !== e || t.splice(n--, 1); | |
t.length || f.fx.stop(), ot = void 0 | |
}, f.fx.timer = function (e) { | |
f.timers.push(e), e() ? f.fx.start() : f.timers.pop() | |
}, f.fx.interval = 13, f.fx.start = function () { | |
it || (it = e.setInterval(f.fx.tick, f.fx.interval)) | |
}, f.fx.stop = function () { | |
e.clearInterval(it), it = null | |
}, f.fx.speeds = {slow: 600, fast: 200, _default: 400}, f.fn.delay = function (t, n) { | |
return t = f.fx && f.fx.speeds[t] || t, n = n || "fx", this.queue(n, function (n, r) { | |
var o = e.setTimeout(n, t); | |
r.stop = function () { | |
e.clearTimeout(o) | |
} | |
}) | |
}, function () { | |
var e, t = r.createElement("input"), n = r.createElement("div"), o = r.createElement("select"), | |
i = o.appendChild(r.createElement("option")); | |
(n = r.createElement("div")).setAttribute("className", "t"), n.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", e = n.getElementsByTagName("a")[0], t.setAttribute("type", "checkbox"), n.appendChild(t), (e = n.getElementsByTagName("a")[0]).style.cssText = "top:1px", d.getSetAttribute = "t" !== n.className, d.style = /top/.test(e.getAttribute("style")), d.hrefNormalized = "/a" === e.getAttribute("href"), d.checkOn = !!t.value, d.optSelected = i.selected, d.enctype = !!r.createElement("form").enctype, o.disabled = !0, d.optDisabled = !i.disabled, (t = r.createElement("input")).setAttribute("value", ""), d.input = "" === t.getAttribute("value"), t.value = "t", t.setAttribute("type", "radio"), d.radioValue = "t" === t.value | |
}(); | |
var pt = /\r/g, ft = /[\x20\t\r\n\f]+/g; | |
f.fn.extend({ | |
val: function (e) { | |
var t, n, r, o = this[0]; | |
return arguments.length ? (r = f.isFunction(e), this.each(function (n) { | |
var o; | |
1 === this.nodeType && (null == (o = r ? e.call(this, n, f(this).val()) : e) ? o = "" : "number" == typeof o ? o += "" : f.isArray(o) && (o = f.map(o, function (e) { | |
return null == e ? "" : e + "" | |
})), (t = f.valHooks[this.type] || f.valHooks[this.nodeName.toLowerCase()]) && "set" in t && void 0 !== t.set(this, o, "value") || (this.value = o)) | |
})) : o ? (t = f.valHooks[o.type] || f.valHooks[o.nodeName.toLowerCase()]) && "get" in t && void 0 !== (n = t.get(o, "value")) ? n : "string" == typeof (n = o.value) ? n.replace(pt, "") : null == n ? "" : n : void 0 | |
} | |
}), f.extend({ | |
valHooks: { | |
option: { | |
get: function (e) { | |
var t = f.find.attr(e, "value"); | |
return null != t ? t : f.trim(f.text(e)).replace(ft, " ") | |
} | |
}, select: { | |
get: function (e) { | |
for (var t, n, r = e.options, o = e.selectedIndex, i = "select-one" === e.type || 0 > o, a = i ? null : [], c = i ? o + 1 : r.length, s = 0 > o ? c : i ? o : 0; c > s; s++) if (((n = r[s]).selected || s === o) && (d.optDisabled ? !n.disabled : null === n.getAttribute("disabled")) && (!n.parentNode.disabled || !f.nodeName(n.parentNode, "optgroup"))) { | |
if (t = f(n).val(), i) return t; | |
a.push(t) | |
} | |
return a | |
}, set: function (e, t) { | |
for (var n, r, o = e.options, i = f.makeArray(t), a = o.length; a--;) if (r = o[a], f.inArray(f.valHooks.option.get(r), i) > -1) try { | |
r.selected = n = !0 | |
} catch (e) { | |
r.scrollHeight | |
} else r.selected = !1; | |
return n || (e.selectedIndex = -1), o | |
} | |
} | |
} | |
}), f.each(["radio", "checkbox"], function () { | |
f.valHooks[this] = { | |
set: function (e, t) { | |
return f.isArray(t) ? e.checked = f.inArray(f(e).val(), t) > -1 : void 0 | |
} | |
}, d.checkOn || (f.valHooks[this].get = function (e) { | |
return null === e.getAttribute("value") ? "on" : e.value | |
}) | |
}); | |
var mt, ht, gt = f.expr.attrHandle, vt = /^(?:checked|selected)$/i, yt = d.getSetAttribute, Et = d.input; | |
f.fn.extend({ | |
attr: function (e, t) { | |
return z(this, f.attr, e, t, arguments.length > 1) | |
}, removeAttr: function (e) { | |
return this.each(function () { | |
f.removeAttr(this, e) | |
}) | |
} | |
}), f.extend({ | |
attr: function (e, t, n) { | |
var r, o, i = e.nodeType; | |
if (3 !== i && 8 !== i && 2 !== i) return void 0 === e.getAttribute ? f.prop(e, t, n) : (1 === i && f.isXMLDoc(e) || (t = t.toLowerCase(), o = f.attrHooks[t] || (f.expr.match.bool.test(t) ? ht : mt)), void 0 !== n ? null === n ? void f.removeAttr(e, t) : o && "set" in o && void 0 !== (r = o.set(e, n, t)) ? r : (e.setAttribute(t, n + ""), n) : o && "get" in o && null !== (r = o.get(e, t)) ? r : null == (r = f.find.attr(e, t)) ? void 0 : r) | |
}, attrHooks: { | |
type: { | |
set: function (e, t) { | |
if (!d.radioValue && "radio" === t && f.nodeName(e, "input")) { | |
var n = e.value; | |
return e.setAttribute("type", t), n && (e.value = n), t | |
} | |
} | |
} | |
}, removeAttr: function (e, t) { | |
var n, r, o = 0, i = t && t.match(x); | |
if (i && 1 === e.nodeType) for (; n = i[o++];) r = f.propFix[n] || n, f.expr.match.bool.test(n) ? Et && yt || !vt.test(n) ? e[r] = !1 : e[f.camelCase("default-" + n)] = e[r] = !1 : f.attr(e, n, ""), e.removeAttribute(yt ? n : r) | |
} | |
}), ht = { | |
set: function (e, t, n) { | |
return !1 === t ? f.removeAttr(e, n) : Et && yt || !vt.test(n) ? e.setAttribute(!yt && f.propFix[n] || n, n) : e[f.camelCase("default-" + n)] = e[n] = !0, n | |
} | |
}, f.each(f.expr.match.bool.source.match(/\w+/g), function (e, t) { | |
var n = gt[t] || f.find.attr; | |
Et && yt || !vt.test(t) ? gt[t] = function (e, t, r) { | |
var o, i; | |
return r || (i = gt[t], gt[t] = o, o = null != n(e, t, r) ? t.toLowerCase() : null, gt[t] = i), o | |
} : gt[t] = function (e, t, n) { | |
return n ? void 0 : e[f.camelCase("default-" + t)] ? t.toLowerCase() : null | |
} | |
}), Et && yt || (f.attrHooks.value = { | |
set: function (e, t, n) { | |
return f.nodeName(e, "input") ? void (e.defaultValue = t) : mt && mt.set(e, t, n) | |
} | |
}), yt || (mt = { | |
set: function (e, t, n) { | |
var r = e.getAttributeNode(n); | |
return r || e.setAttributeNode(r = e.ownerDocument.createAttribute(n)), r.value = t += "", "value" === n || t === e.getAttribute(n) ? t : void 0 | |
} | |
}, gt.id = gt.name = gt.coords = function (e, t, n) { | |
var r; | |
return n ? void 0 : (r = e.getAttributeNode(t)) && "" !== r.value ? r.value : null | |
}, f.valHooks.button = { | |
get: function (e, t) { | |
var n = e.getAttributeNode(t); | |
return n && n.specified ? n.value : void 0 | |
}, set: mt.set | |
}, f.attrHooks.contenteditable = { | |
set: function (e, t, n) { | |
mt.set(e, "" !== t && t, n) | |
} | |
}, f.each(["width", "height"], function (e, t) { | |
f.attrHooks[t] = { | |
set: function (e, n) { | |
return "" === n ? (e.setAttribute(t, "auto"), n) : void 0 | |
} | |
} | |
})), d.style || (f.attrHooks.style = { | |
get: function (e) { | |
return e.style.cssText || void 0 | |
}, set: function (e, t) { | |
return e.style.cssText = t + "" | |
} | |
}); | |
var Ct = /^(?:input|select|textarea|button|object)$/i, Tt = /^(?:a|area)$/i; | |
f.fn.extend({ | |
prop: function (e, t) { | |
return z(this, f.prop, e, t, arguments.length > 1) | |
}, removeProp: function (e) { | |
return e = f.propFix[e] || e, this.each(function () { | |
try { | |
this[e] = void 0, delete this[e] | |
} catch (e) { | |
} | |
}) | |
} | |
}), f.extend({ | |
prop: function (e, t, n) { | |
var r, o, i = e.nodeType; | |
if (3 !== i && 8 !== i && 2 !== i) return 1 === i && f.isXMLDoc(e) || (t = f.propFix[t] || t, o = f.propHooks[t]), void 0 !== n ? o && "set" in o && void 0 !== (r = o.set(e, n, t)) ? r : e[t] = n : o && "get" in o && null !== (r = o.get(e, t)) ? r : e[t] | |
}, propHooks: { | |
tabIndex: { | |
get: function (e) { | |
var t = f.find.attr(e, "tabindex"); | |
return t ? parseInt(t, 10) : Ct.test(e.nodeName) || Tt.test(e.nodeName) && e.href ? 0 : -1 | |
} | |
} | |
}, propFix: {for: "htmlFor", class: "className"} | |
}), d.hrefNormalized || f.each(["href", "src"], function (e, t) { | |
f.propHooks[t] = { | |
get: function (e) { | |
return e.getAttribute(t, 4) | |
} | |
} | |
}), d.optSelected || (f.propHooks.selected = { | |
get: function (e) { | |
var t = e.parentNode; | |
return t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex), null | |
}, set: function (e) { | |
var t = e.parentNode; | |
t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex) | |
} | |
}), f.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () { | |
f.propFix[this.toLowerCase()] = this | |
}), d.enctype || (f.propFix.enctype = "encoding"); | |
var _t = /[\t\r\n\f]/g; | |
function St(e) { | |
return f.attr(e, "class") || "" | |
} | |
f.fn.extend({ | |
addClass: function (e) { | |
var t, n, r, o, i, a, c, s = 0; | |
if (f.isFunction(e)) return this.each(function (t) { | |
f(this).addClass(e.call(this, t, St(this))) | |
}); | |
if ("string" == typeof e && e) for (t = e.match(x) || []; n = this[s++];) if (o = St(n), r = 1 === n.nodeType && (" " + o + " ").replace(_t, " ")) { | |
for (a = 0; i = t[a++];) r.indexOf(" " + i + " ") < 0 && (r += i + " "); | |
o !== (c = f.trim(r)) && f.attr(n, "class", c) | |
} | |
return this | |
}, removeClass: function (e) { | |
var t, n, r, o, i, a, c, s = 0; | |
if (f.isFunction(e)) return this.each(function (t) { | |
f(this).removeClass(e.call(this, t, St(this))) | |
}); | |
if (!arguments.length) return this.attr("class", ""); | |
if ("string" == typeof e && e) for (t = e.match(x) || []; n = this[s++];) if (o = St(n), r = 1 === n.nodeType && (" " + o + " ").replace(_t, " ")) { | |
for (a = 0; i = t[a++];) for (; r.indexOf(" " + i + " ") > -1;) r = r.replace(" " + i + " ", " "); | |
o !== (c = f.trim(r)) && f.attr(n, "class", c) | |
} | |
return this | |
}, toggleClass: function (e, t) { | |
var n = typeof e; | |
return "boolean" == typeof t && "string" === n ? t ? this.addClass(e) : this.removeClass(e) : f.isFunction(e) ? this.each(function (n) { | |
f(this).toggleClass(e.call(this, n, St(this), t), t) | |
}) : this.each(function () { | |
var t, r, o, i; | |
if ("string" === n) for (r = 0, o = f(this), i = e.match(x) || []; t = i[r++];) o.hasClass(t) ? o.removeClass(t) : o.addClass(t); else void 0 !== e && "boolean" !== n || ((t = St(this)) && f._data(this, "__className__", t), f.attr(this, "class", t || !1 === e ? "" : f._data(this, "__className__") || "")) | |
}) | |
}, hasClass: function (e) { | |
var t, n, r = 0; | |
for (t = " " + e + " "; n = this[r++];) if (1 === n.nodeType && (" " + St(n) + " ").replace(_t, " ").indexOf(t) > -1) return !0; | |
return !1 | |
} | |
}), f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (e, t) { | |
f.fn[t] = function (e, n) { | |
return arguments.length > 0 ? this.on(t, null, e, n) : this.trigger(t) | |
} | |
}), f.fn.extend({ | |
hover: function (e, t) { | |
return this.mouseenter(e).mouseleave(t || e) | |
} | |
}); | |
var wt = e.location, bt = f.now(), At = /\?/, | |
Pt = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; | |
f.parseJSON = function (t) { | |
if (e.JSON && e.JSON.parse) return e.JSON.parse(t + ""); | |
var n, r = null, o = f.trim(t + ""); | |
return o && !f.trim(o.replace(Pt, function (e, t, o, i) { | |
return n && t && (r = 0), 0 === r ? e : (n = o || t, r += !i - !o, "") | |
})) ? Function("return " + o)() : f.error("Invalid JSON: " + t) | |
}, f.parseXML = function (t) { | |
var n; | |
if (!t || "string" != typeof t) return null; | |
try { | |
e.DOMParser ? n = (new e.DOMParser).parseFromString(t, "text/xml") : ((n = new e.ActiveXObject("Microsoft.XMLDOM")).async = "false", n.loadXML(t)) | |
} catch (e) { | |
n = void 0 | |
} | |
return n && n.documentElement && !n.getElementsByTagName("parsererror").length || f.error("Invalid XML: " + t), n | |
}; | |
var $t = /#.*$/, kt = /([?&])_=[^&]*/, It = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm, Nt = /^(?:GET|HEAD)$/, | |
Dt = /^\/\//, xt = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, Ot = {}, Mt = {}, | |
Rt = "*/".concat("*"), Lt = wt.href, Vt = xt.exec(Lt.toLowerCase()) || []; | |
function Ft(e) { | |
return function (t, n) { | |
"string" != typeof t && (n = t, t = "*"); | |
var r, o = 0, i = t.toLowerCase().match(x) || []; | |
if (f.isFunction(n)) for (; r = i[o++];) "+" === r.charAt(0) ? (r = r.slice(1) || "*", (e[r] = e[r] || []).unshift(n)) : (e[r] = e[r] || []).push(n) | |
} | |
} | |
function Ut(e, t, n, r) { | |
var o = {}, i = e === Mt; | |
function a(c) { | |
var s; | |
return o[c] = !0, f.each(e[c] || [], function (e, c) { | |
var l = c(t, n, r); | |
return "string" != typeof l || i || o[l] ? i ? !(s = l) : void 0 : (t.dataTypes.unshift(l), a(l), !1) | |
}), s | |
} | |
return a(t.dataTypes[0]) || !o["*"] && a("*") | |
} | |
function Bt(e, t) { | |
var n, r, o = f.ajaxSettings.flatOptions || {}; | |
for (r in t) void 0 !== t[r] && ((o[r] ? e : n || (n = {}))[r] = t[r]); | |
return n && f.extend(!0, e, n), e | |
} | |
function Ht(e) { | |
return e.style && e.style.display || f.css(e, "display") | |
} | |
f.extend({ | |
active: 0, | |
lastModified: {}, | |
etag: {}, | |
ajaxSettings: { | |
url: Lt, | |
type: "GET", | |
isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Vt[1]), | |
global: !0, | |
processData: !0, | |
async: !0, | |
contentType: "application/x-www-form-urlencoded; charset=UTF-8", | |
accepts: { | |
"*": Rt, | |
text: "text/plain", | |
html: "text/html", | |
xml: "application/xml, text/xml", | |
json: "application/json, text/javascript" | |
}, | |
contents: {xml: /\bxml\b/, html: /\bhtml/, json: /\bjson\b/}, | |
responseFields: {xml: "responseXML", text: "responseText", json: "responseJSON"}, | |
converters: {"* text": String, "text html": !0, "text json": f.parseJSON, "text xml": f.parseXML}, | |
flatOptions: {url: !0, context: !0} | |
}, | |
ajaxSetup: function (e, t) { | |
return t ? Bt(Bt(e, f.ajaxSettings), t) : Bt(f.ajaxSettings, e) | |
}, | |
ajaxPrefilter: Ft(Ot), | |
ajaxTransport: Ft(Mt), | |
ajax: function (t, n) { | |
"object" == typeof t && (n = t, t = void 0), n = n || {}; | |
var r, o, i, a, c, s, l, u, d = f.ajaxSetup({}, n), p = d.context || d, | |
m = d.context && (p.nodeType || p.jquery) ? f(p) : f.event, h = f.Deferred(), | |
g = f.Callbacks("once memory"), v = d.statusCode || {}, y = {}, E = {}, C = 0, T = "canceled", | |
_ = { | |
readyState: 0, getResponseHeader: function (e) { | |
var t; | |
if (2 === C) { | |
if (!u) for (u = {}; t = It.exec(a);) u[t[1].toLowerCase()] = t[2]; | |
t = u[e.toLowerCase()] | |
} | |
return null == t ? null : t | |
}, getAllResponseHeaders: function () { | |
return 2 === C ? a : null | |
}, setRequestHeader: function (e, t) { | |
var n = e.toLowerCase(); | |
return C || (e = E[n] = E[n] || e, y[e] = t), this | |
}, overrideMimeType: function (e) { | |
return C || (d.mimeType = e), this | |
}, statusCode: function (e) { | |
var t; | |
if (e) if (2 > C) for (t in e) v[t] = [v[t], e[t]]; else _.always(e[_.status]); | |
return this | |
}, abort: function (e) { | |
var t = e || T; | |
return l && l.abort(t), S(0, t), this | |
} | |
}; | |
if (h.promise(_).complete = g.add, _.success = _.done, _.error = _.fail, d.url = ((t || d.url || Lt) + "").replace($t, "").replace(Dt, Vt[1] + "//"), d.type = n.method || n.type || d.method || d.type, d.dataTypes = f.trim(d.dataType || "*").toLowerCase().match(x) || [""], null == d.crossDomain && (r = xt.exec(d.url.toLowerCase()), d.crossDomain = !(!r || r[1] === Vt[1] && r[2] === Vt[2] && (r[3] || ("http:" === r[1] ? "80" : "443")) === (Vt[3] || ("http:" === Vt[1] ? "80" : "443")))), d.data && d.processData && "string" != typeof d.data && (d.data = f.param(d.data, d.traditional)), Ut(Ot, d, n, _), 2 === C) return _; | |
for (o in(s = f.event && d.global) && 0 == f.active++ && f.event.trigger("ajaxStart"), d.type = d.type.toUpperCase(), d.hasContent = !Nt.test(d.type), i = d.url, d.hasContent || (d.data && (i = d.url += (At.test(i) ? "&" : "?") + d.data, delete d.data), !1 === d.cache && (d.url = kt.test(i) ? i.replace(kt, "$1_=" + bt++) : i + (At.test(i) ? "&" : "?") + "_=" + bt++)), d.ifModified && (f.lastModified[i] && _.setRequestHeader("If-Modified-Since", f.lastModified[i]), f.etag[i] && _.setRequestHeader("If-None-Match", f.etag[i])), (d.data && d.hasContent && !1 !== d.contentType || n.contentType) && _.setRequestHeader("Content-Type", d.contentType), _.setRequestHeader("Accept", d.dataTypes[0] && d.accepts[d.dataTypes[0]] ? d.accepts[d.dataTypes[0]] + ("*" !== d.dataTypes[0] ? ", " + Rt + "; q=0.01" : "") : d.accepts["*"]), d.headers) _.setRequestHeader(o, d.headers[o]); | |
if (d.beforeSend && (!1 === d.beforeSend.call(p, _, d) || 2 === C)) return _.abort(); | |
for (o in T = "abort", {success: 1, error: 1, complete: 1}) _[o](d[o]); | |
if (l = Ut(Mt, d, n, _)) { | |
if (_.readyState = 1, s && m.trigger("ajaxSend", [_, d]), 2 === C) return _; | |
d.async && d.timeout > 0 && (c = e.setTimeout(function () { | |
_.abort("timeout") | |
}, d.timeout)); | |
try { | |
C = 1, l.send(y, S) | |
} catch (e) { | |
if (!(2 > C)) throw e; | |
S(-1, e) | |
} | |
} else S(-1, "No Transport"); | |
function S(t, n, r, o) { | |
var u, y, E, T, S, w = n; | |
2 !== C && (C = 2, c && e.clearTimeout(c), l = void 0, a = o || "", _.readyState = t > 0 ? 4 : 0, u = t >= 200 && 300 > t || 304 === t, r && (T = function (e, t, n) { | |
for (var r, o, i, a, c = e.contents, s = e.dataTypes; "*" === s[0];) s.shift(), void 0 === o && (o = e.mimeType || t.getResponseHeader("Content-Type")); | |
if (o) for (a in c) if (c[a] && c[a].test(o)) { | |
s.unshift(a); | |
break | |
} | |
if (s[0] in n) i = s[0]; else { | |
for (a in n) { | |
if (!s[0] || e.converters[a + " " + s[0]]) { | |
i = a; | |
break | |
} | |
r || (r = a) | |
} | |
i = i || r | |
} | |
return i ? (i !== s[0] && s.unshift(i), n[i]) : void 0 | |
}(d, _, r)), T = function (e, t, n, r) { | |
var o, i, a, c, s, l = {}, u = e.dataTypes.slice(); | |
if (u[1]) for (a in e.converters) l[a.toLowerCase()] = e.converters[a]; | |
for (i = u.shift(); i;) if (e.responseFields[i] && (n[e.responseFields[i]] = t), !s && r && e.dataFilter && (t = e.dataFilter(t, e.dataType)), s = i, i = u.shift()) if ("*" === i) i = s; else if ("*" !== s && s !== i) { | |
if (!(a = l[s + " " + i] || l["* " + i])) for (o in l) if ((c = o.split(" "))[1] === i && (a = l[s + " " + c[0]] || l["* " + c[0]])) { | |
!0 === a ? a = l[o] : !0 !== l[o] && (i = c[0], u.unshift(c[1])); | |
break | |
} | |
if (!0 !== a) if (a && e.throws) t = a(t); else try { | |
t = a(t) | |
} catch (e) { | |
return { | |
state: "parsererror", | |
error: a ? e : "No conversion from " + s + " to " + i | |
} | |
} | |
} | |
return {state: "success", data: t} | |
}(d, T, _, u), u ? (d.ifModified && ((S = _.getResponseHeader("Last-Modified")) && (f.lastModified[i] = S), (S = _.getResponseHeader("etag")) && (f.etag[i] = S)), 204 === t || "HEAD" === d.type ? w = "nocontent" : 304 === t ? w = "notmodified" : (w = T.state, y = T.data, u = !(E = T.error))) : (E = w, !t && w || (w = "error", 0 > t && (t = 0))), _.status = t, _.statusText = (n || w) + "", u ? h.resolveWith(p, [y, w, _]) : h.rejectWith(p, [_, w, E]), _.statusCode(v), v = void 0, s && m.trigger(u ? "ajaxSuccess" : "ajaxError", [_, d, u ? y : E]), g.fireWith(p, [_, w]), s && (m.trigger("ajaxComplete", [_, d]), --f.active || f.event.trigger("ajaxStop"))) | |
} | |
return _ | |
}, | |
getJSON: function (e, t, n) { | |
return f.get(e, t, n, "json") | |
}, | |
getScript: function (e, t) { | |
return f.get(e, void 0, t, "script") | |
} | |
}), f.each(["get", "post"], function (e, t) { | |
f[t] = function (e, n, r, o) { | |
return f.isFunction(n) && (o = o || r, r = n, n = void 0), f.ajax(f.extend({ | |
url: e, | |
type: t, | |
dataType: o, | |
data: n, | |
success: r | |
}, f.isPlainObject(e) && e)) | |
} | |
}), f._evalUrl = function (e) { | |
return f.ajax({url: e, type: "GET", dataType: "script", cache: !0, async: !1, global: !1, throws: !0}) | |
}, f.fn.extend({ | |
wrapAll: function (e) { | |
if (f.isFunction(e)) return this.each(function (t) { | |
f(this).wrapAll(e.call(this, t)) | |
}); | |
if (this[0]) { | |
var t = f(e, this[0].ownerDocument).eq(0).clone(!0); | |
this[0].parentNode && t.insertBefore(this[0]), t.map(function () { | |
for (var e = this; e.firstChild && 1 === e.firstChild.nodeType;) e = e.firstChild; | |
return e | |
}).append(this) | |
} | |
return this | |
}, wrapInner: function (e) { | |
return f.isFunction(e) ? this.each(function (t) { | |
f(this).wrapInner(e.call(this, t)) | |
}) : this.each(function () { | |
var t = f(this), n = t.contents(); | |
n.length ? n.wrapAll(e) : t.append(e) | |
}) | |
}, wrap: function (e) { | |
var t = f.isFunction(e); | |
return this.each(function (n) { | |
f(this).wrapAll(t ? e.call(this, n) : e) | |
}) | |
}, unwrap: function () { | |
return this.parent().each(function () { | |
f.nodeName(this, "body") || f(this).replaceWith(this.childNodes) | |
}).end() | |
} | |
}), f.expr.filters.hidden = function (e) { | |
return d.reliableHiddenOffsets() ? e.offsetWidth <= 0 && e.offsetHeight <= 0 && !e.getClientRects().length : function (e) { | |
if (!f.contains(e.ownerDocument || r, e)) return !0; | |
for (; e && 1 === e.nodeType;) { | |
if ("none" === Ht(e) || "hidden" === e.type) return !0; | |
e = e.parentNode | |
} | |
return !1 | |
}(e) | |
}, f.expr.filters.visible = function (e) { | |
return !f.expr.filters.hidden(e) | |
}; | |
var Wt = /%20/g, jt = /\[\]$/, Yt = /\r?\n/g, qt = /^(?:submit|button|image|reset|file)$/i, | |
Gt = /^(?:input|select|textarea|keygen)/i; | |
function zt(e, t, n, r) { | |
var o; | |
if (f.isArray(t)) f.each(t, function (t, o) { | |
n || jt.test(e) ? r(e, o) : zt(e + "[" + ("object" == typeof o && null != o ? t : "") + "]", o, n, r) | |
}); else if (n || "object" !== f.type(t)) r(e, t); else for (o in t) zt(e + "[" + o + "]", t[o], n, r) | |
} | |
f.param = function (e, t) { | |
var n, r = [], o = function (e, t) { | |
t = f.isFunction(t) ? t() : null == t ? "" : t, r[r.length] = encodeURIComponent(e) + "=" + encodeURIComponent(t) | |
}; | |
if (void 0 === t && (t = f.ajaxSettings && f.ajaxSettings.traditional), f.isArray(e) || e.jquery && !f.isPlainObject(e)) f.each(e, function () { | |
o(this.name, this.value) | |
}); else for (n in e) zt(n, e[n], t, o); | |
return r.join("&").replace(Wt, "+") | |
}, f.fn.extend({ | |
serialize: function () { | |
return f.param(this.serializeArray()) | |
}, serializeArray: function () { | |
return this.map(function () { | |
var e = f.prop(this, "elements"); | |
return e ? f.makeArray(e) : this | |
}).filter(function () { | |
var e = this.type; | |
return this.name && !f(this).is(":disabled") && Gt.test(this.nodeName) && !qt.test(e) && (this.checked || !K.test(e)) | |
}).map(function (e, t) { | |
var n = f(this).val(); | |
return null == n ? null : f.isArray(n) ? f.map(n, function (e) { | |
return {name: t.name, value: e.replace(Yt, "\r\n")} | |
}) : {name: t.name, value: n.replace(Yt, "\r\n")} | |
}).get() | |
} | |
}), f.ajaxSettings.xhr = void 0 !== e.ActiveXObject ? function () { | |
return this.isLocal ? Xt() : r.documentMode > 8 ? Qt() : /^(get|post|head|put|delete|options)$/i.test(this.type) && Qt() || Xt() | |
} : Qt; | |
var Kt = 0, Zt = {}, Jt = f.ajaxSettings.xhr(); | |
function Qt() { | |
try { | |
return new e.XMLHttpRequest | |
} catch (e) { | |
} | |
} | |
function Xt() { | |
try { | |
return new e.ActiveXObject("Microsoft.XMLHTTP") | |
} catch (e) { | |
} | |
} | |
e.attachEvent && e.attachEvent("onunload", function () { | |
for (var e in Zt) Zt[e](void 0, !0) | |
}), d.cors = !!Jt && "withCredentials" in Jt, (Jt = d.ajax = !!Jt) && f.ajaxTransport(function (t) { | |
var n; | |
if (!t.crossDomain || d.cors) return { | |
send: function (r, o) { | |
var i, a = t.xhr(), c = ++Kt; | |
if (a.open(t.type, t.url, t.async, t.username, t.password), t.xhrFields) for (i in t.xhrFields) a[i] = t.xhrFields[i]; | |
for (i in t.mimeType && a.overrideMimeType && a.overrideMimeType(t.mimeType), t.crossDomain || r["X-Requested-With"] || (r["X-Requested-With"] = "XMLHttpRequest"), r) void 0 !== r[i] && a.setRequestHeader(i, r[i] + ""); | |
a.send(t.hasContent && t.data || null), n = function (e, r) { | |
var i, s, l; | |
if (n && (r || 4 === a.readyState)) if (delete Zt[c], n = void 0, a.onreadystatechange = f.noop, r) 4 !== a.readyState && a.abort(); else { | |
l = {}, i = a.status, "string" == typeof a.responseText && (l.text = a.responseText); | |
try { | |
s = a.statusText | |
} catch (e) { | |
s = "" | |
} | |
i || !t.isLocal || t.crossDomain ? 1223 === i && (i = 204) : i = l.text ? 200 : 404 | |
} | |
l && o(i, s, l, a.getAllResponseHeaders()) | |
}, t.async ? 4 === a.readyState ? e.setTimeout(n) : a.onreadystatechange = Zt[c] = n : n() | |
}, abort: function () { | |
n && n(void 0, !0) | |
} | |
} | |
}), f.ajaxSetup({ | |
accepts: {script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"}, | |
contents: {script: /\b(?:java|ecma)script\b/}, | |
converters: { | |
"text script": function (e) { | |
return f.globalEval(e), e | |
} | |
} | |
}), f.ajaxPrefilter("script", function (e) { | |
void 0 === e.cache && (e.cache = !1), e.crossDomain && (e.type = "GET", e.global = !1) | |
}), f.ajaxTransport("script", function (e) { | |
if (e.crossDomain) { | |
var t, n = r.head || f("head")[0] || r.documentElement; | |
return { | |
send: function (o, i) { | |
(t = r.createElement("script")).async = !0, e.scriptCharset && (t.charset = e.scriptCharset), t.src = e.url, t.onload = t.onreadystatechange = function (e, n) { | |
(n || !t.readyState || /loaded|complete/.test(t.readyState)) && (t.onload = t.onreadystatechange = null, t.parentNode && t.parentNode.removeChild(t), t = null, n || i(200, "success")) | |
}, n.insertBefore(t, n.firstChild) | |
}, abort: function () { | |
t && t.onload(void 0, !0) | |
} | |
} | |
} | |
}); | |
var en = [], tn = /(=)\?(?=&|$)|\?\?/; | |
f.ajaxSetup({ | |
jsonp: "callback", jsonpCallback: function () { | |
var e = en.pop() || f.expando + "_" + bt++; | |
return this[e] = !0, e | |
} | |
}), f.ajaxPrefilter("json jsonp", function (t, n, r) { | |
var o, i, a, | |
c = !1 !== t.jsonp && (tn.test(t.url) ? "url" : "string" == typeof t.data && 0 === (t.contentType || "").indexOf("application/x-www-form-urlencoded") && tn.test(t.data) && "data"); | |
return c || "jsonp" === t.dataTypes[0] ? (o = t.jsonpCallback = f.isFunction(t.jsonpCallback) ? t.jsonpCallback() : t.jsonpCallback, c ? t[c] = t[c].replace(tn, "$1" + o) : !1 !== t.jsonp && (t.url += (At.test(t.url) ? "&" : "?") + t.jsonp + "=" + o), t.converters["script json"] = function () { | |
return a || f.error(o + " was not called"), a[0] | |
}, t.dataTypes[0] = "json", i = e[o], e[o] = function () { | |
a = arguments | |
}, r.always(function () { | |
void 0 === i ? f(e).removeProp(o) : e[o] = i, t[o] && (t.jsonpCallback = n.jsonpCallback, en.push(o)), a && f.isFunction(i) && i(a[0]), a = i = void 0 | |
}), "script") : void 0 | |
}), f.parseHTML = function (e, t, n) { | |
if (!e || "string" != typeof e) return null; | |
"boolean" == typeof t && (n = t, t = !1), t = t || r; | |
var o = S.exec(e), i = !n && []; | |
return o ? [t.createElement(o[1])] : (o = ce([e], t, i), i && i.length && f(i).remove(), f.merge([], o.childNodes)) | |
}; | |
var nn = f.fn.load; | |
function rn(e) { | |
return f.isWindow(e) ? e : 9 === e.nodeType && (e.defaultView || e.parentWindow) | |
} | |
f.fn.load = function (e, t, n) { | |
if ("string" != typeof e && nn) return nn.apply(this, arguments); | |
var r, o, i, a = this, c = e.indexOf(" "); | |
return c > -1 && (r = f.trim(e.slice(c, e.length)), e = e.slice(0, c)), f.isFunction(t) ? (n = t, t = void 0) : t && "object" == typeof t && (o = "POST"), a.length > 0 && f.ajax({ | |
url: e, | |
type: o || "GET", | |
dataType: "html", | |
data: t | |
}).done(function (e) { | |
i = arguments, a.html(r ? f("<div>").append(f.parseHTML(e)).find(r) : e) | |
}).always(n && function (e, t) { | |
a.each(function () { | |
n.apply(this, i || [e.responseText, t, e]) | |
}) | |
}), this | |
}, f.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (e, t) { | |
f.fn[t] = function (e) { | |
return this.on(t, e) | |
} | |
}), f.expr.filters.animated = function (e) { | |
return f.grep(f.timers, function (t) { | |
return e === t.elem | |
}).length | |
}, f.offset = { | |
setOffset: function (e, t, n) { | |
var r, o, i, a, c, s, l = f.css(e, "position"), u = f(e), d = {}; | |
"static" === l && (e.style.position = "relative"), c = u.offset(), i = f.css(e, "top"), s = f.css(e, "left"), ("absolute" === l || "fixed" === l) && f.inArray("auto", [i, s]) > -1 ? (a = (r = u.position()).top, o = r.left) : (a = parseFloat(i) || 0, o = parseFloat(s) || 0), f.isFunction(t) && (t = t.call(e, n, f.extend({}, c))), null != t.top && (d.top = t.top - c.top + a), null != t.left && (d.left = t.left - c.left + o), "using" in t ? t.using.call(e, d) : u.css(d) | |
} | |
}, f.fn.extend({ | |
offset: function (e) { | |
if (arguments.length) return void 0 === e ? this : this.each(function (t) { | |
f.offset.setOffset(this, e, t) | |
}); | |
var t, n, r = {top: 0, left: 0}, o = this[0], i = o && o.ownerDocument; | |
return i ? (t = i.documentElement, f.contains(t, o) ? (void 0 !== o.getBoundingClientRect && (r = o.getBoundingClientRect()), n = rn(i), { | |
top: r.top + (n.pageYOffset || t.scrollTop) - (t.clientTop || 0), | |
left: r.left + (n.pageXOffset || t.scrollLeft) - (t.clientLeft || 0) | |
}) : r) : void 0 | |
}, position: function () { | |
if (this[0]) { | |
var e, t, n = {top: 0, left: 0}, r = this[0]; | |
return "fixed" === f.css(r, "position") ? t = r.getBoundingClientRect() : (e = this.offsetParent(), t = this.offset(), f.nodeName(e[0], "html") || (n = e.offset()), n.top += f.css(e[0], "borderTopWidth", !0), n.left += f.css(e[0], "borderLeftWidth", !0)), { | |
top: t.top - n.top - f.css(r, "marginTop", !0), | |
left: t.left - n.left - f.css(r, "marginLeft", !0) | |
} | |
} | |
}, offsetParent: function () { | |
return this.map(function () { | |
for (var e = this.offsetParent; e && !f.nodeName(e, "html") && "static" === f.css(e, "position");) e = e.offsetParent; | |
return e || Fe | |
}) | |
} | |
}), f.each({scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function (e, t) { | |
var n = /Y/.test(t); | |
f.fn[e] = function (r) { | |
return z(this, function (e, r, o) { | |
var i = rn(e); | |
return void 0 === o ? i ? t in i ? i[t] : i.document.documentElement[r] : e[r] : void (i ? i.scrollTo(n ? f(i).scrollLeft() : o, n ? o : f(i).scrollTop()) : e[r] = o) | |
}, e, r, arguments.length, null) | |
} | |
}), f.each(["top", "left"], function (e, t) { | |
f.cssHooks[t] = We(d.pixelPosition, function (e, n) { | |
return n ? (n = Be(e, t), Le.test(n) ? f(e).position()[t] + "px" : n) : void 0 | |
}) | |
}), f.each({Height: "height", Width: "width"}, function (e, t) { | |
f.each({padding: "inner" + e, content: t, "": "outer" + e}, function (n, r) { | |
f.fn[r] = function (r, o) { | |
var i = arguments.length && (n || "boolean" != typeof r), | |
a = n || (!0 === r || !0 === o ? "margin" : "border"); | |
return z(this, function (t, n, r) { | |
var o; | |
return f.isWindow(t) ? t.document.documentElement["client" + e] : 9 === t.nodeType ? (o = t.documentElement, Math.max(t.body["scroll" + e], o["scroll" + e], t.body["offset" + e], o["offset" + e], o["client" + e])) : void 0 === r ? f.css(t, n, a) : f.style(t, n, r, a) | |
}, t, i ? r : void 0, i, null) | |
} | |
}) | |
}), f.fn.extend({ | |
bind: function (e, t, n) { | |
return this.on(e, null, t, n) | |
}, unbind: function (e, t) { | |
return this.off(e, null, t) | |
}, delegate: function (e, t, n, r) { | |
return this.on(t, e, n, r) | |
}, undelegate: function (e, t, n) { | |
return 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", n) | |
} | |
}), f.fn.size = function () { | |
return this.length | |
}, f.fn.andSelf = f.fn.addBack, "function" == typeof define && define.amd && define("jquery", [], function () { | |
return f | |
}); | |
var on = e.jQuery, an = e.$; | |
return f.noConflict = function (t) { | |
return e.$ === f && (e.$ = an), t && e.jQuery === f && (e.jQuery = on), f | |
}, t || (e.jQuery = e.$ = f), f | |
}), void 0 === jQuery.migrateMute && (jQuery.migrateMute = !0), function (e, t, n) { | |
function r(n) { | |
var r = t.console; | |
i[n] || (i[n] = !0, e.migrateWarnings.push(n), r && r.warn && !e.migrateMute && (r.warn("JQMIGRATE: " + n), e.migrateTrace && r.trace && r.trace())) | |
} | |
function o(t, n, o, i) { | |
if (Object.defineProperty) try { | |
return void Object.defineProperty(t, n, { | |
configurable: !0, enumerable: !0, get: function () { | |
return r(i), o | |
}, set: function (e) { | |
r(i), o = e | |
} | |
}) | |
} catch (e) { | |
} | |
e._definePropertyBroken = !0, t[n] = o | |
} | |
e.migrateVersion = "1.4.1"; | |
var i = {}; | |
e.migrateWarnings = [], e.migrateTrace === n && (e.migrateTrace = !0), e.migrateReset = function () { | |
i = {}, e.migrateWarnings.length = 0 | |
}, "BackCompat" === document.compatMode && r("jQuery is not compatible with Quirks Mode"); | |
var a = e("<input/>", {size: 1}).attr("size") && e.attrFn, c = e.attr, | |
s = e.attrHooks.value && e.attrHooks.value.get || function () { | |
return null | |
}, l = e.attrHooks.value && e.attrHooks.value.set || function () { | |
return n | |
}, u = /^(?:input|button)$/i, d = /^[238]$/, | |
p = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, | |
f = /^(?:checked|selected)$/i; | |
o(e, "attrFn", a || {}, "jQuery.attrFn is deprecated"), e.attr = function (t, o, i, s) { | |
var l = o.toLowerCase(), m = t && t.nodeType; | |
return s && (c.length < 4 && r("jQuery.fn.attr( props, pass ) is deprecated"), t && !d.test(m) && (a ? o in a : e.isFunction(e.fn[o]))) ? e(t)[o](i) : ("type" === o && i !== n && u.test(t.nodeName) && t.parentNode && r("Can't change the 'type' of an input or button in IE 6/7/8"), !e.attrHooks[l] && p.test(l) && (e.attrHooks[l] = { | |
get: function (t, r) { | |
var o, i = e.prop(t, r); | |
return !0 === i || "boolean" != typeof i && (o = t.getAttributeNode(r)) && !1 !== o.nodeValue ? r.toLowerCase() : n | |
}, set: function (t, n, r) { | |
var o; | |
return !1 === n ? e.removeAttr(t, r) : ((o = e.propFix[r] || r) in t && (t[o] = !0), t.setAttribute(r, r.toLowerCase())), r | |
} | |
}, f.test(l) && r("jQuery.fn.attr('" + l + "') might use property instead of attribute")), c.call(e, t, o, i)) | |
}, e.attrHooks.value = { | |
get: function (e, t) { | |
var n = (e.nodeName || "").toLowerCase(); | |
return "button" === n ? s.apply(this, arguments) : ("input" !== n && "option" !== n && r("jQuery.fn.attr('value') no longer gets properties"), t in e ? e.value : null) | |
}, set: function (e, t) { | |
var n = (e.nodeName || "").toLowerCase(); | |
return "button" === n ? l.apply(this, arguments) : ("input" !== n && "option" !== n && r("jQuery.fn.attr('value', val) no longer sets properties"), void (e.value = t)) | |
} | |
}; | |
var m, h, g, v = e.fn.init, y = e.find, E = e.parseJSON, C = /^\s*</, | |
T = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/, | |
_ = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g, S = /^([^<]*)(<[\w\W]+>)([^>]*)$/; | |
for (g in e.fn.init = function (t, o, i) { | |
var a, c; | |
return t && "string" == typeof t && !e.isPlainObject(o) && (a = S.exec(e.trim(t))) && a[0] && (C.test(t) || r("$(html) HTML strings must start with '<' character"), a[3] && r("$(html) HTML text after last tag is ignored"), "#" === a[0].charAt(0) && (r("HTML string cannot start with a '#' character"), e.error("JQMIGRATE: Invalid selector string (XSS)")), o && o.context && o.context.nodeType && (o = o.context), e.parseHTML) ? v.call(this, e.parseHTML(a[2], o && o.ownerDocument || o || document, !0), o, i) : (c = v.apply(this, arguments), t && t.selector !== n ? (c.selector = t.selector, c.context = t.context) : (c.selector = "string" == typeof t ? t : "", t && (c.context = t.nodeType ? t : o || document)), c) | |
}, e.fn.init.prototype = e.fn, e.find = function (e) { | |
var t = Array.prototype.slice.call(arguments); | |
if ("string" == typeof e && T.test(e)) try { | |
document.querySelector(e) | |
} catch (n) { | |
e = e.replace(_, function (e, t, n, r) { | |
return "[" + t + n + '"' + r + '"]' | |
}); | |
try { | |
document.querySelector(e), r("Attribute selector with '#' must be quoted: " + t[0]), t[0] = e | |
} catch (e) { | |
r("Attribute selector with '#' was not fixed: " + t[0]) | |
} | |
} | |
return y.apply(this, t) | |
}, y) Object.prototype.hasOwnProperty.call(y, g) && (e.find[g] = y[g]); | |
e.parseJSON = function (e) { | |
return e ? E.apply(this, arguments) : (r("jQuery.parseJSON requires a valid JSON string"), null) | |
}, e.uaMatch = function (e) { | |
e = e.toLowerCase(); | |
var t = /(chrome)[ \/]([\w.]+)/.exec(e) || /(webkit)[ \/]([\w.]+)/.exec(e) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e) || /(msie) ([\w.]+)/.exec(e) || e.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e) || []; | |
return {browser: t[1] || "", version: t[2] || "0"} | |
}, e.browser || (h = {}, (m = e.uaMatch(navigator.userAgent)).browser && (h[m.browser] = !0, h.version = m.version), h.chrome ? h.webkit = !0 : h.webkit && (h.safari = !0), e.browser = h), o(e, "browser", e.browser, "jQuery.browser is deprecated"), e.boxModel = e.support.boxModel = "CSS1Compat" === document.compatMode, o(e, "boxModel", e.boxModel, "jQuery.boxModel is deprecated"), o(e.support, "boxModel", e.support.boxModel, "jQuery.support.boxModel is deprecated"), e.sub = function () { | |
function t(e, n) { | |
return new t.fn.init(e, n) | |
} | |
e.extend(!0, t, this), t.superclass = this, t.fn = t.prototype = this(), t.fn.constructor = t, t.sub = this.sub, t.fn.init = function (r, o) { | |
var i = e.fn.init.call(this, r, o, n); | |
return i instanceof t ? i : t(i) | |
}, t.fn.init.prototype = t.fn; | |
var n = t(document); | |
return r("jQuery.sub() is deprecated"), t | |
}, e.fn.size = function () { | |
return r("jQuery.fn.size() is deprecated; use the .length property"), this.length | |
}; | |
var w = !1; | |
e.swap && e.each(["height", "width", "reliableMarginRight"], function (t, n) { | |
var r = e.cssHooks[n] && e.cssHooks[n].get; | |
r && (e.cssHooks[n].get = function () { | |
var e; | |
return w = !0, e = r.apply(this, arguments), w = !1, e | |
}) | |
}), e.swap = function (e, t, n, o) { | |
var i, a, c = {}; | |
for (a in w || r("jQuery.swap() is undocumented and deprecated"), t) c[a] = e.style[a], e.style[a] = t[a]; | |
for (a in i = n.apply(e, o || []), t) e.style[a] = c[a]; | |
return i | |
}, e.ajaxSetup({converters: {"text json": e.parseJSON}}); | |
var b = e.fn.data; | |
e.fn.data = function (t) { | |
var o, i, a = this[0]; | |
return !a || "events" !== t || 1 !== arguments.length || (o = e.data(a, t), i = e._data(a, t), o !== n && o !== i || i === n) ? b.apply(this, arguments) : (r("Use of jQuery.fn.data('events') is deprecated"), i) | |
}; | |
var A = /\/(java|ecma)script/i; | |
e.clean || (e.clean = function (t, n, o, i) { | |
n = (n = !(n = n || document).nodeType && n[0] || n).ownerDocument || n, r("jQuery.clean() is deprecated"); | |
var a, c, s, l, u = []; | |
if (e.merge(u, e.buildFragment(t, n).childNodes), o) for (s = function (e) { | |
return !e.type || A.test(e.type) ? i ? i.push(e.parentNode ? e.parentNode.removeChild(e) : e) : o.appendChild(e) : void 0 | |
}, a = 0; null != (c = u[a]); a++) e.nodeName(c, "script") && s(c) || (o.appendChild(c), void 0 !== c.getElementsByTagName && (l = e.grep(e.merge([], c.getElementsByTagName("script")), s), u.splice.apply(u, [a + 1, 0].concat(l)), a += l.length)); | |
return u | |
}); | |
var P = e.event.add, $ = e.event.remove, k = e.event.trigger, I = e.fn.toggle, N = e.fn.live, | |
D = e.fn.die, x = e.fn.load, O = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess", | |
M = new RegExp("\\b(?:" + O + ")\\b"), R = /(?:^|\s)hover(\.\S+|)\b/, L = function (t) { | |
return "string" != typeof t || e.event.special.hover ? t : (R.test(t) && r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"), t && t.replace(R, "mouseenter$1 mouseleave$1")) | |
}; | |
e.event.props && "attrChange" !== e.event.props[0] && e.event.props.unshift("attrChange", "attrName", "relatedNode", "srcElement"), e.event.dispatch && o(e.event, "handle", e.event.dispatch, "jQuery.event.handle is undocumented and deprecated"), e.event.add = function (e, t, n, o, i) { | |
e !== document && M.test(t) && r("AJAX events should be attached to document: " + t), P.call(this, e, L(t || ""), n, o, i) | |
}, e.event.remove = function (e, t, n, r, o) { | |
$.call(this, e, L(t) || "", n, r, o) | |
}, e.each(["load", "unload", "error"], function (t, n) { | |
e.fn[n] = function () { | |
var e = Array.prototype.slice.call(arguments, 0); | |
return "load" === n && "string" == typeof e[0] ? x.apply(this, e) : (r("jQuery.fn." + n + "() is deprecated"), e.splice(0, 0, n), arguments.length ? this.bind.apply(this, e) : (this.triggerHandler.apply(this, e), this)) | |
} | |
}), e.fn.toggle = function (t, n) { | |
if (!e.isFunction(t) || !e.isFunction(n)) return I.apply(this, arguments); | |
r("jQuery.fn.toggle(handler, handler...) is deprecated"); | |
var o = arguments, i = t.guid || e.guid++, a = 0, c = function (n) { | |
var r = (e._data(this, "lastToggle" + t.guid) || 0) % a; | |
return e._data(this, "lastToggle" + t.guid, r + 1), n.preventDefault(), o[r].apply(this, arguments) || !1 | |
}; | |
for (c.guid = i; a < o.length;) o[a++].guid = i; | |
return this.click(c) | |
}, e.fn.live = function (t, n, o) { | |
return r("jQuery.fn.live() is deprecated"), N ? N.apply(this, arguments) : (e(this.context).on(t, this.selector, n, o), this) | |
}, e.fn.die = function (t, n) { | |
return r("jQuery.fn.die() is deprecated"), D ? D.apply(this, arguments) : (e(this.context).off(t, this.selector || "**", n), this) | |
}, e.event.trigger = function (e, t, n, o) { | |
return n || M.test(e) || r("Global events are undocumented and deprecated"), k.call(this, e, t, n || document, o) | |
}, e.each(O.split("|"), function (t, n) { | |
e.event.special[n] = { | |
setup: function () { | |
var t = this; | |
return t !== document && (e.event.add(document, n + "." + e.guid, function () { | |
e.event.trigger(n, Array.prototype.slice.call(arguments, 1), t, !0) | |
}), e._data(this, n, e.guid++)), !1 | |
}, teardown: function () { | |
return this !== document && e.event.remove(document, n + "." + e._data(this, n)), !1 | |
} | |
} | |
}), e.event.special.ready = { | |
setup: function () { | |
this === document && r("'ready' event is deprecated") | |
} | |
}; | |
var V = e.fn.andSelf || e.fn.addBack, F = e.fn.find; | |
if (e.fn.andSelf = function () { | |
return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"), V.apply(this, arguments) | |
}, e.fn.find = function (e) { | |
var t = F.apply(this, arguments); | |
return t.context = this.context, t.selector = this.selector ? this.selector + " " + e : e, t | |
}, e.Callbacks) { | |
var U = e.Deferred, | |
B = [["resolve", "done", e.Callbacks("once memory"), e.Callbacks("once memory"), "resolved"], ["reject", "fail", e.Callbacks("once memory"), e.Callbacks("once memory"), "rejected"], ["notify", "progress", e.Callbacks("memory"), e.Callbacks("memory")]]; | |
e.Deferred = function (t) { | |
var n = U(), o = n.promise(); | |
return n.pipe = o.pipe = function () { | |
var t = arguments; | |
return r("deferred.pipe() is deprecated"), e.Deferred(function (r) { | |
e.each(B, function (i, a) { | |
var c = e.isFunction(t[i]) && t[i]; | |
n[a[1]](function () { | |
var t = c && c.apply(this, arguments); | |
t && e.isFunction(t.promise) ? t.promise().done(r.resolve).fail(r.reject).progress(r.notify) : r[a[0] + "With"](this === o ? r.promise() : this, c ? [t] : arguments) | |
}) | |
}), t = null | |
}).promise() | |
}, n.isResolved = function () { | |
return r("deferred.isResolved is deprecated"), "resolved" === n.state() | |
}, n.isRejected = function () { | |
return r("deferred.isRejected is deprecated"), "rejected" === n.state() | |
}, t && t.call(n, n), n | |
} | |
} | |
}(jQuery, window), function (e) { | |
var t, n, r, o, i = 1, a = this, c = "postMessage", s = "addEventListener", l = a[c] && !e.browser.opera; | |
e[c] = function (t, n, r) { | |
n && (t = "string" == typeof t ? t : e.param(t), r = r || parent, l ? r[c](t, n.replace(/([^:]+:\/\/[^\/]+).*/, "$1")) : n && (r.location = n.replace(/#.*$/, "") + "#" + +new Date + i++ + "&" + t)) | |
}, e.receiveMessage = o = function (i, c, u) { | |
l ? (i && (r && o(), r = function (t) { | |
if ("string" == typeof c && t.origin !== c || e.isFunction(c) && !1 === c(t.origin)) return !1; | |
i(t) | |
}), a[s] ? a[i ? s : "removeEventListener"]("message", r, !1) : a[i ? "attachEvent" : "detachEvent"]("onmessage", r)) : (t && clearInterval(t), t = null, i && (u = "number" == typeof c ? c : "number" == typeof u ? u : 100, t = setInterval(function () { | |
var e = document.location.hash, t = /^#?\d+&/; | |
e !== n && t.test(e) && (n = e, i({data: e.replace(t, "")})) | |
}, u))) | |
} | |
}(jQuery), function (e, t, n) { | |
"use strict"; | |
function r(e) { | |
return function () { | |
var t, n = arguments[0]; | |
n = "[" + (e ? e + ":" : "") + n + "] http://errors.angularjs.org/1.2.22/" + (e ? e + "/" : "") + n; | |
for (t = 1; t < arguments.length; t++) n = n + (1 == t ? "?" : "&") + "p" + (t - 1) + "=" + encodeURIComponent("function" == typeof arguments[t] ? arguments[t].toString().replace(/ \{[\s\S]*$/, "") : void 0 === arguments[t] ? "undefined" : "string" != typeof arguments[t] ? JSON.stringify(arguments[t]) : arguments[t]); | |
return Error(n) | |
} | |
} | |
function o(e) { | |
if (null == e || w(e)) return !1; | |
var t = e.length; | |
return !(1 !== e.nodeType || !t) || (E(e) || Gt(e) || 0 === t || "number" == typeof t && 0 < t && t - 1 in e) | |
} | |
function i(e, t, n) { | |
var r; | |
if (e) if (_(e)) for (r in e) "prototype" == r || "length" == r || "name" == r || e.hasOwnProperty && !e.hasOwnProperty(r) || t.call(n, e[r], r); else if (Gt(e) || o(e)) for (r = 0; r < e.length; r++) t.call(n, e[r], r); else if (e.forEach && e.forEach !== i) e.forEach(t, n); else for (r in e) e.hasOwnProperty(r) && t.call(n, e[r], r); | |
return e | |
} | |
function a(e) { | |
var t, n = []; | |
for (t in e) e.hasOwnProperty(t) && n.push(t); | |
return n.sort() | |
} | |
function c(e) { | |
return function (t, n) { | |
e(n, t) | |
} | |
} | |
function s() { | |
for (var e, t = qt.length; t;) { | |
if (57 == (e = qt[--t].charCodeAt(0))) return qt[t] = "A", qt.join(""); | |
if (90 != e) return qt[t] = String.fromCharCode(e + 1), qt.join(""); | |
qt[t] = "0" | |
} | |
return qt.unshift("0"), qt.join("") | |
} | |
function l(e, t) { | |
t ? e.$$hashKey = t : delete e.$$hashKey | |
} | |
function u(e) { | |
var t = e.$$hashKey; | |
return i(arguments, function (t) { | |
t !== e && i(t, function (t, n) { | |
e[n] = t | |
}) | |
}), l(e, t), e | |
} | |
function d(e) { | |
return parseInt(e, 10) | |
} | |
function p(e, t) { | |
return u(new (u(function () { | |
}, {prototype: e})), t) | |
} | |
function f() { | |
} | |
function m(e) { | |
return e | |
} | |
function h(e) { | |
return function () { | |
return e | |
} | |
} | |
function g(e) { | |
return void 0 === e | |
} | |
function v(e) { | |
return void 0 !== e | |
} | |
function y(e) { | |
return null != e && "object" == typeof e | |
} | |
function E(e) { | |
return "string" == typeof e | |
} | |
function C(e) { | |
return "number" == typeof e | |
} | |
function T(e) { | |
return "[object Date]" === Wt.call(e) | |
} | |
function _(e) { | |
return "function" == typeof e | |
} | |
function S(e) { | |
return "[object RegExp]" === Wt.call(e) | |
} | |
function w(e) { | |
return e && e.document && e.location && e.alert && e.setInterval | |
} | |
function b(e) { | |
return !(!e || !(e.nodeName || e.prop && e.attr && e.find)) | |
} | |
function A(e, t) { | |
if (e.indexOf) return e.indexOf(t); | |
for (var n = 0; n < e.length; n++) if (t === e[n]) return n; | |
return -1 | |
} | |
function P(e, t) { | |
var n = A(e, t); | |
return 0 <= n && e.splice(n, 1), t | |
} | |
function $(e, t, n, r) { | |
if (w(e) || e && e.$evalAsync && e.$watch) throw jt("cpws"); | |
if (t) { | |
if (e === t) throw jt("cpi"); | |
if (n = n || [], r = r || [], y(e)) { | |
var o = A(n, e); | |
if (-1 !== o) return r[o]; | |
n.push(e), r.push(t) | |
} | |
if (Gt(e)) for (var a = t.length = 0; a < e.length; a++) o = $(e[a], null, n, r), y(e[a]) && (n.push(e[a]), r.push(o)), t.push(o); else { | |
var c = t.$$hashKey; | |
for (a in i(t, function (e, n) { | |
delete t[n] | |
}), e) o = $(e[a], null, n, r), y(e[a]) && (n.push(e[a]), r.push(o)), t[a] = o; | |
l(t, c) | |
} | |
} else (t = e) && (Gt(e) ? t = $(e, [], n, r) : T(e) ? t = new Date(e.getTime()) : S(e) ? (t = RegExp(e.source, e.toString().match(/[^\/]*$/)[0])).lastIndex = e.lastIndex : y(e) && (t = $(e, {}, n, r))); | |
return t | |
} | |
function k(e, t) { | |
if (Gt(e)) { | |
t = t || []; | |
for (var n = 0; n < e.length; n++) t[n] = e[n] | |
} else if (y(e)) for (n in t = t || {}, e) !Ft.call(e, n) || "$" === n.charAt(0) && "$" === n.charAt(1) || (t[n] = e[n]); | |
return t || e | |
} | |
function I(e, t) { | |
if (e === t) return !0; | |
if (null === e || null === t) return !1; | |
if (e != e && t != t) return !0; | |
var r, o = typeof e; | |
if (o == typeof t && "object" == o) { | |
if (!Gt(e)) { | |
if (T(e)) return T(t) && e.getTime() == t.getTime(); | |
if (S(e) && S(t)) return e.toString() == t.toString(); | |
if (e && e.$evalAsync && e.$watch || t && t.$evalAsync && t.$watch || w(e) || w(t) || Gt(t)) return !1; | |
for (r in o = {}, e) if ("$" !== r.charAt(0) && !_(e[r])) { | |
if (!I(e[r], t[r])) return !1; | |
o[r] = !0 | |
} | |
for (r in t) if (!o.hasOwnProperty(r) && "$" !== r.charAt(0) && t[r] !== n && !_(t[r])) return !1; | |
return !0 | |
} | |
if (!Gt(t)) return !1; | |
if ((o = e.length) == t.length) { | |
for (r = 0; r < o; r++) if (!I(e[r], t[r])) return !1; | |
return !0 | |
} | |
} | |
return !1 | |
} | |
function N(e, t) { | |
var n = 2 < arguments.length ? Bt.call(arguments, 2) : []; | |
return !_(t) || t instanceof RegExp ? t : n.length ? function () { | |
return arguments.length ? t.apply(e, n.concat(Bt.call(arguments, 0))) : t.apply(e, n) | |
} : function () { | |
return arguments.length ? t.apply(e, arguments) : t.call(e) | |
} | |
} | |
function D(e, r) { | |
var o = r; | |
return "string" == typeof e && "$" === e.charAt(0) ? o = n : w(r) ? o = "$WINDOW" : r && t === r ? o = "$DOCUMENT" : r && r.$evalAsync && r.$watch && (o = "$SCOPE"), o | |
} | |
function x(e, t) { | |
return void 0 === e ? n : JSON.stringify(e, D, t ? " " : null) | |
} | |
function O(e) { | |
return E(e) ? JSON.parse(e) : e | |
} | |
function M(e) { | |
return "function" == typeof e ? e = !0 : e && 0 !== e.length ? e = !("f" == (e = Vt("" + e)) || "0" == e || "false" == e || "no" == e || "n" == e || "[]" == e) : e = !1, e | |
} | |
function R(e) { | |
e = xt(e).clone(); | |
try { | |
e.empty() | |
} catch (e) { | |
} | |
var t = xt("<div>").append(e).html(); | |
try { | |
return 3 === e[0].nodeType ? Vt(t) : t.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/, function (e, t) { | |
return "<" + Vt(t) | |
}) | |
} catch (e) { | |
return Vt(t) | |
} | |
} | |
function L(e) { | |
try { | |
return decodeURIComponent(e) | |
} catch (e) { | |
} | |
} | |
function V(e) { | |
var t, n, r = {}; | |
return i((e || "").split("&"), function (e) { | |
e && (t = e.replace(/\+/g, "%20").split("="), v(n = L(t[0])) && (e = !v(t[1]) || L(t[1]), Ft.call(r, n) ? Gt(r[n]) ? r[n].push(e) : r[n] = [r[n], e] : r[n] = e)) | |
}), r | |
} | |
function F(e) { | |
var t = []; | |
return i(e, function (e, n) { | |
Gt(e) ? i(e, function (e) { | |
t.push(B(n, !0) + (!0 === e ? "" : "=" + B(e, !0))) | |
}) : t.push(B(n, !0) + (!0 === e ? "" : "=" + B(e, !0))) | |
}), t.length ? t.join("&") : "" | |
} | |
function U(e) { | |
return B(e, !0).replace(/%26/gi, "&").replace(/%3D/gi, "=").replace(/%2B/gi, "+") | |
} | |
function B(e, t) { | |
return encodeURIComponent(e).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, t ? "%20" : "+") | |
} | |
function H(n, r) { | |
var o = function () { | |
if ((n = xt(n)).injector()) { | |
var e = n[0] === t ? "document" : R(n); | |
throw jt("btstrpd", e) | |
} | |
return (r = r || []).unshift(["$provide", function (e) { | |
e.value("$rootElement", n) | |
}]), r.unshift("ng"), (e = he(r)).invoke(["$rootScope", "$rootElement", "$compile", "$injector", "$animate", function (e, t, n, r, o) { | |
e.$apply(function () { | |
t.data("$injector", r), n(t)(e) | |
}) | |
}]), e | |
}, a = /^NG_DEFER_BOOTSTRAP!/; | |
if (e && !a.test(e.name)) return o(); | |
e.name = e.name.replace(a, ""), Yt.resumeBootstrap = function (e) { | |
i(e, function (e) { | |
r.push(e) | |
}), o() | |
} | |
} | |
function W(e, t) { | |
return t = t || "_", e.replace(Zt, function (e, n) { | |
return (n ? t : "") + e.toLowerCase() | |
}) | |
} | |
function j(e, t, n) { | |
if (!e) throw jt("areq", t || "?", n || "required"); | |
return e | |
} | |
function Y(e, t, n) { | |
return n && Gt(e) && (e = e[e.length - 1]), j(_(e), t, "not a function, got " + (e && "object" == typeof e ? e.constructor.name || "Object" : typeof e)), e | |
} | |
function q(e, t) { | |
if ("hasOwnProperty" === e) throw jt("badname", t) | |
} | |
function G(e, t, n) { | |
if (!t) return e; | |
for (var r, o = e, i = (t = t.split(".")).length, a = 0; a < i; a++) r = t[a], e && (e = (o = e)[r]); | |
return !n && _(e) ? N(o, e) : e | |
} | |
function z(e) { | |
var t = e[0]; | |
if (t === (e = e[e.length - 1])) return xt(t); | |
var n = [t]; | |
do { | |
if (!(t = t.nextSibling)) break; | |
n.push(t) | |
} while (t !== e); | |
return xt(n) | |
} | |
function K(e) { | |
return e.replace(nn, function (e, t, n, r) { | |
return r ? n.toUpperCase() : n | |
}).replace(rn, "Moz$1") | |
} | |
function Z(e, t, n, r) { | |
function o(e) { | |
var o, a, c, s, l, u, d = n && e ? [this.filter(e)] : [this], p = t; | |
if (!r || null != e) for (; d.length;) for (a = 0, c = (o = d.shift()).length; a < c; a++) for (s = xt(o[a]), p ? s.triggerHandler("$destroy") : p = !p, l = 0, s = (u = s.children()).length; l < s; l++) d.push(Ot(u[l])); | |
return i.apply(this, arguments) | |
} | |
var i = (i = Ot.fn[e]).$original || i; | |
o.$original = i, Ot.fn[e] = o | |
} | |
function J(e) { | |
if (e instanceof J) return e; | |
if (E(e) && (e = zt(e)), !(this instanceof J)) { | |
if (E(e) && "<" != e.charAt(0)) throw on("nosel"); | |
return new J(e) | |
} | |
if (E(e)) { | |
var n, r = e; | |
if (e = t, n = an.exec(r)) e = [e.createElement(n[1])]; else { | |
var o, i = e; | |
if (e = i.createDocumentFragment(), n = [], cn.test(r)) { | |
for (i = e.appendChild(i.createElement("div")), o = (sn.exec(r) || ["", ""])[1].toLowerCase(), o = un[o] || un._default, i.innerHTML = "<div> </div>" + o[1] + r.replace(ln, "<$1></$2>") + o[2], i.removeChild(i.firstChild), r = o[0]; r--;) i = i.lastChild; | |
for (r = 0, o = i.childNodes.length; r < o; ++r) n.push(i.childNodes[r]); | |
(i = e.firstChild).textContent = "" | |
} else n.push(i.createTextNode(r)); | |
e.textContent = "", e.innerHTML = "", e = n | |
} | |
ce(this, e), xt(t.createDocumentFragment()).append(this) | |
} else ce(this, e) | |
} | |
function Q(e) { | |
return e.cloneNode(!0) | |
} | |
function X(e) { | |
te(e); | |
var t = 0; | |
for (e = e.childNodes || []; t < e.length; t++) X(e[t]) | |
} | |
function ee(e, t, n, r) { | |
if (v(r)) throw on("offargs"); | |
var o = ne(e, "events"); | |
ne(e, "handle") && (g(t) ? i(o, function (t, n) { | |
tn(e, n, t), delete o[n] | |
}) : i(t.split(" "), function (t) { | |
g(n) ? (tn(e, t, o[t]), delete o[t]) : P(o[t] || [], n) | |
})) | |
} | |
function te(e, t) { | |
var r = e.ng339, o = Qt[r]; | |
o && (t ? delete Qt[r].data[t] : (o.handle && (o.events.$destroy && o.handle({}, "$destroy"), ee(e)), delete Qt[r], e.ng339 = n)) | |
} | |
function ne(e, t, n) { | |
var r = e.ng339; | |
r = Qt[r || -1]; | |
if (!v(n)) return r && r[t]; | |
r || (e.ng339 = r = ++Xt, r = Qt[r] = {}), r[t] = n | |
} | |
function re(e, t, n) { | |
var r = ne(e, "data"), o = v(n), i = !o && v(t), a = i && !y(t); | |
if (r || a || ne(e, "data", r = {}), o) r[t] = n; else { | |
if (!i) return r; | |
if (a) return r && r[t]; | |
u(r, t) | |
} | |
} | |
function oe(e, t) { | |
return !!e.getAttribute && -1 < (" " + (e.getAttribute("class") || "") + " ").replace(/[\n\t]/g, " ").indexOf(" " + t + " ") | |
} | |
function ie(e, t) { | |
t && e.setAttribute && i(t.split(" "), function (t) { | |
e.setAttribute("class", zt((" " + (e.getAttribute("class") || "") + " ").replace(/[\n\t]/g, " ").replace(" " + zt(t) + " ", " "))) | |
}) | |
} | |
function ae(e, t) { | |
if (t && e.setAttribute) { | |
var n = (" " + (e.getAttribute("class") || "") + " ").replace(/[\n\t]/g, " "); | |
i(t.split(" "), function (e) { | |
e = zt(e), -1 === n.indexOf(" " + e + " ") && (n += e + " ") | |
}), e.setAttribute("class", zt(n)) | |
} | |
} | |
function ce(e, t) { | |
if (t) { | |
t = t.nodeName || !v(t.length) || w(t) ? [t] : t; | |
for (var n = 0; n < t.length; n++) e.push(t[n]) | |
} | |
} | |
function se(e, t) { | |
return le(e, "$" + (t || "ngController") + "Controller") | |
} | |
function le(e, t, r) { | |
for (9 == e.nodeType && (e = e.documentElement), t = Gt(t) ? t : [t]; e;) { | |
for (var o = 0, i = t.length; o < i; o++) if ((r = xt.data(e, t[o])) !== n) return r; | |
e = e.parentNode || 11 === e.nodeType && e.host | |
} | |
} | |
function ue(e) { | |
for (var t = 0, n = e.childNodes; t < n.length; t++) X(n[t]); | |
for (; e.firstChild;) e.removeChild(e.firstChild) | |
} | |
function de(e, t) { | |
var n = pn[t.toLowerCase()]; | |
return n && fn[e.nodeName] && n | |
} | |
function pe(e, t) { | |
var r, o = typeof e; | |
return "function" == o || "object" == o && null !== e ? "function" == typeof (r = e.$$hashKey) ? r = e.$$hashKey() : r === n && (r = e.$$hashKey = (t || s)()) : r = e, o + ":" + r | |
} | |
function fe(e, t) { | |
if (t) { | |
var n = 0; | |
this.nextUid = function () { | |
return ++n | |
} | |
} | |
i(e, this.put, this) | |
} | |
function me(e) { | |
var t, n; | |
return "function" == typeof e ? (t = e.$inject) || (t = [], e.length && i((n = (n = e.toString().replace(vn, "")).match(mn))[1].split(hn), function (e) { | |
e.replace(gn, function (e, n, r) { | |
t.push(r) | |
}) | |
}), e.$inject = t) : Gt(e) ? (Y(e[n = e.length - 1], "fn"), t = e.slice(0, n)) : Y(e, "fn", !0), t | |
} | |
function he(e) { | |
function t(e) { | |
return function (t, n) { | |
if (!y(t)) return e(t, n); | |
i(t, c(e)) | |
} | |
} | |
function n(e, t) { | |
if (q(e, "service"), (_(t) || Gt(t)) && (t = p.instantiate(t)), !t.$get) throw yn("pget", e); | |
return d[e + s] = t | |
} | |
function r(e, t) { | |
return n(e, {$get: t}) | |
} | |
function o(e, t) { | |
function n(n) { | |
if (e.hasOwnProperty(n)) { | |
if (e[n] === a) throw yn("cdep", n + " <- " + l.join(" <- ")); | |
return e[n] | |
} | |
try { | |
return l.unshift(n), e[n] = a, e[n] = t(n) | |
} catch (t) { | |
throw e[n] === a && delete e[n], t | |
} finally { | |
l.shift() | |
} | |
} | |
function r(e, t, r) { | |
var o, i, a, c = [], s = me(e); | |
for (i = 0, o = s.length; i < o; i++) { | |
if ("string" != typeof (a = s[i])) throw yn("itkn", a); | |
c.push(r && r.hasOwnProperty(a) ? r[a] : n(a)) | |
} | |
return Gt(e) && (e = e[o]), e.apply(t, c) | |
} | |
return { | |
invoke: r, instantiate: function (e, t) { | |
var n, o = function () { | |
}; | |
return o.prototype = (Gt(e) ? e[e.length - 1] : e).prototype, y(n = r(e, o = new o, t)) || _(n) ? n : o | |
}, get: n, annotate: me, has: function (t) { | |
return d.hasOwnProperty(t + s) || e.hasOwnProperty(t) | |
} | |
} | |
} | |
var a = {}, s = "Provider", l = [], u = new fe([], !0), d = { | |
$provide: { | |
provider: t(n), factory: t(r), service: t(function (e, t) { | |
return r(e, ["$injector", function (e) { | |
return e.instantiate(t) | |
}]) | |
}), value: t(function (e, t) { | |
return r(e, h(t)) | |
}), constant: t(function (e, t) { | |
q(e, "constant"), d[e] = t, m[e] = t | |
}), decorator: function (e, t) { | |
var n = p.get(e + s), r = n.$get; | |
n.$get = function () { | |
var e = g.invoke(r, n); | |
return g.invoke(t, null, {$delegate: e}) | |
} | |
} | |
} | |
}, p = d.$injector = o(d, function () { | |
throw yn("unpr", l.join(" <- ")) | |
}), m = {}, g = m.$injector = o(m, function (e) { | |
return e = p.get(e + s), g.invoke(e.$get, e) | |
}); | |
return i(function e(t) { | |
var n, r, o, a, c = []; | |
return i(t, function (t) { | |
if (!u.get(t)) { | |
u.put(t, !0); | |
try { | |
if (E(t)) for (n = Mt(t), c = c.concat(e(n.requires)).concat(n._runBlocks), r = n._invokeQueue, o = 0, a = r.length; o < a; o++) { | |
var i = r[o], s = p.get(i[0]); | |
s[i[1]].apply(s, i[2]) | |
} else _(t) ? c.push(p.invoke(t)) : Gt(t) ? c.push(p.invoke(t)) : Y(t, "module") | |
} catch (e) { | |
throw Gt(t) && (t = t[t.length - 1]), e.message && e.stack && -1 == e.stack.indexOf(e.message) && (e = e.message + "\n" + e.stack), yn("modulerr", t, e.stack || e.message || e) | |
} | |
} | |
}), c | |
}(e), function (e) { | |
g.invoke(e || f) | |
}), g | |
} | |
function ge() { | |
var e = !0; | |
this.disableAutoScrolling = function () { | |
e = !1 | |
}, this.$get = ["$window", "$location", "$rootScope", function (t, n, r) { | |
function o() { | |
var e, r = n.hash(); | |
r ? (e = a.getElementById(r)) ? e.scrollIntoView() : (e = function (e) { | |
var t = null; | |
return i(e, function (e) { | |
t || "a" !== Vt(e.nodeName) || (t = e) | |
}), t | |
}(a.getElementsByName(r))) ? e.scrollIntoView() : "top" === r && t.scrollTo(0, 0) : t.scrollTo(0, 0) | |
} | |
var a = t.document; | |
return e && r.$watch(function () { | |
return n.hash() | |
}, function () { | |
r.$evalAsync(o) | |
}), o | |
}] | |
} | |
function ve() { | |
this.$get = ["$$rAF", "$timeout", function (e, t) { | |
return e.supported ? function (t) { | |
return e(t) | |
} : function (e) { | |
return t(e, 0, !1) | |
} | |
}] | |
} | |
function ye(e, t, r, o) { | |
function a(e) { | |
try { | |
e.apply(null, Bt.call(arguments, 1)) | |
} finally { | |
if (0 === --v) for (; y.length;) try { | |
y.pop()() | |
} catch (e) { | |
r.error(e) | |
} | |
} | |
} | |
function c() { | |
w = null, _ != s.url() && (_ = s.url(), i(b, function (e) { | |
e(s.url()) | |
})) | |
} | |
var s = this, l = t[0], u = e.location, d = e.history, p = e.setTimeout, m = e.clearTimeout, h = {}; | |
s.isMock = !1; | |
var v = 0, y = []; | |
s.$$completeOutstandingRequest = a, s.$$incOutstandingRequestCount = function () { | |
v++ | |
}, s.notifyWhenNoOutstandingRequests = function (e) { | |
i(T, function (e) { | |
e() | |
}), 0 === v ? e() : y.push(e) | |
}; | |
var C, T = []; | |
s.addPollFn = function (e) { | |
return g(C) && function (e, t) { | |
!function n() { | |
i(T, function (e) { | |
e() | |
}), C = t(n, e) | |
}() | |
}(100, p), T.push(e), e | |
}; | |
var _ = u.href, S = t.find("base"), w = null; | |
s.url = function (t, n) { | |
return u !== e.location && (u = e.location), d !== e.history && (d = e.history), t ? _ != t ? (_ = t, o.history ? n ? d.replaceState(null, "", t) : (d.pushState(null, "", t), S.attr("href", S.attr("href"))) : (w = t, n ? u.replace(t) : u.href = t), s) : void 0 : w || u.href.replace(/%27/g, "'") | |
}; | |
var b = [], A = !1; | |
s.onUrlChange = function (t) { | |
return A || (o.history && xt(e).on("popstate", c), o.hashchange ? xt(e).on("hashchange", c) : s.addPollFn(c), A = !0), b.push(t), t | |
}, s.baseHref = function () { | |
var e = S.attr("href"); | |
return e ? e.replace(/^(https?\:)?\/\/[^\/]*/, "") : "" | |
}; | |
var P = {}, $ = "", k = s.baseHref(); | |
s.cookies = function (e, t) { | |
var o, i, a, c; | |
if (!e) { | |
if (l.cookie !== $) for (o = ($ = l.cookie).split("; "), P = {}, a = 0; a < o.length; a++) 0 < (c = (i = o[a]).indexOf("=")) && (e = unescape(i.substring(0, c)), P[e] === n && (P[e] = unescape(i.substring(c + 1)))); | |
return P | |
} | |
t === n ? l.cookie = escape(e) + "=;path=" + k + ";expires=Thu, 01 Jan 1970 00:00:00 GMT" : E(t) && (4096 < (o = (l.cookie = escape(e) + "=" + escape(t) + ";path=" + k).length + 1) && r.warn("Cookie '" + e + "' possibly not set or overflowed because it was too large (" + o + " > 4096 bytes)!")) | |
}, s.defer = function (e, t) { | |
var n; | |
return v++, n = p(function () { | |
delete h[n], a(e) | |
}, t || 0), h[n] = !0, n | |
}, s.defer.cancel = function (e) { | |
return !!h[e] && (delete h[e], m(e), a(f), !0) | |
} | |
} | |
function Ee() { | |
this.$get = ["$window", "$log", "$sniffer", "$document", function (e, t, n, r) { | |
return new ye(e, r, t, n) | |
}] | |
} | |
function Ce() { | |
this.$get = function () { | |
function e(e, n) { | |
function o(e) { | |
e != p && (f ? f == e && (f = e.n) : f = e, i(e.n, e.p), i(e, p), (p = e).n = null) | |
} | |
function i(e, t) { | |
e != t && (e && (e.p = t), t && (t.n = e)) | |
} | |
if (e in t) throw r("$cacheFactory")("iid", e); | |
var a = 0, c = u({}, n, {id: e}), s = {}, l = n && n.capacity || Number.MAX_VALUE, d = {}, | |
p = null, f = null; | |
return t[e] = { | |
put: function (e, t) { | |
l < Number.MAX_VALUE && o(d[e] || (d[e] = {key: e})); | |
if (!g(t)) return e in s || a++, s[e] = t, a > l && this.remove(f.key), t | |
}, get: function (e) { | |
if (l < Number.MAX_VALUE) { | |
var t = d[e]; | |
if (!t) return; | |
o(t) | |
} | |
return s[e] | |
}, remove: function (e) { | |
if (l < Number.MAX_VALUE) { | |
var t = d[e]; | |
if (!t) return; | |
t == p && (p = t.p), t == f && (f = t.n), i(t.n, t.p), delete d[e] | |
} | |
delete s[e], a-- | |
}, removeAll: function () { | |
s = {}, a = 0, d = {}, p = f = null | |
}, destroy: function () { | |
d = c = s = null, delete t[e] | |
}, info: function () { | |
return u({}, c, {size: a}) | |
} | |
} | |
} | |
var t = {}; | |
return e.info = function () { | |
var e = {}; | |
return i(t, function (t, n) { | |
e[n] = t.info() | |
}), e | |
}, e.get = function (e) { | |
return t[e] | |
}, e | |
} | |
} | |
function Te() { | |
this.$get = ["$cacheFactory", function (e) { | |
return e("templates") | |
}] | |
} | |
function _e(e, r) { | |
var o = {}, a = "Directive", s = /^\s*directive\:\s*([\d\w_\-]+)\s+(.*)$/, | |
l = /(([\d\w_\-]+)(?:\:([^;]+))?;?)/, d = /^(on[a-z]+|formaction)$/; | |
this.directive = function t(n, r) { | |
return q(n, "directive"), E(n) ? (j(r, "directiveFactory"), o.hasOwnProperty(n) || (o[n] = [], e.factory(n + a, ["$injector", "$exceptionHandler", function (e, t) { | |
var r = []; | |
return i(o[n], function (o, i) { | |
try { | |
var a = e.invoke(o); | |
_(a) ? a = {compile: h(a)} : !a.compile && a.link && (a.compile = h(a.link)), a.priority = a.priority || 0, a.index = i, a.name = a.name || n, a.require = a.require || a.controller && a.name, a.restrict = a.restrict || "A", r.push(a) | |
} catch (e) { | |
t(e) | |
} | |
}), r | |
}])), o[n].push(r)) : i(n, c(t)), this | |
}, this.aHrefSanitizationWhitelist = function (e) { | |
return v(e) ? (r.aHrefSanitizationWhitelist(e), this) : r.aHrefSanitizationWhitelist() | |
}, this.imgSrcSanitizationWhitelist = function (e) { | |
return v(e) ? (r.imgSrcSanitizationWhitelist(e), this) : r.imgSrcSanitizationWhitelist() | |
}, this.$get = ["$injector", "$interpolate", "$exceptionHandler", "$http", "$templateCache", "$parse", "$controller", "$rootScope", "$document", "$sce", "$animate", "$$sanitizeUri", function (e, r, c, f, h, g, v, C, T, S, w, b) { | |
function A(e, t, n, r, o) { | |
e instanceof xt || (e = xt(e)), i(e, function (t, n) { | |
3 == t.nodeType && t.nodeValue.match(/\S+/) && (e[n] = xt(t).wrap("<span></span>").parent()[0]) | |
}); | |
var a = $(e, t, e, n, r, o); | |
return P(e, "ng-scope"), function (t, n, r, o) { | |
j(t, "scope"); | |
var c = n ? dn.clone.call(e) : e; | |
i(r, function (e, t) { | |
c.data("$" + t + "Controller", e) | |
}), r = 0; | |
for (var s = c.length; r < s; r++) { | |
var l = c[r].nodeType; | |
1 !== l && 9 !== l || c.eq(r).data("$scope", t) | |
} | |
return n && n(c, t), a && a(t, c, c, o), c | |
} | |
} | |
function P(e, t) { | |
try { | |
e.addClass(t) | |
} catch (e) { | |
} | |
} | |
function $(e, t, r, o, i, a) { | |
for (var c, s, l, u, d = [], p = 0; p < e.length; p++) c = new K, (a = (s = D(e[p], [], c, 0 === p ? o : n, i)).length ? M(s, e[p], c, t, r, null, [], [], a) : null) && a.scope && P(c.$$element, "ng-scope"), c = a && a.terminal || !(l = e[p].childNodes) || !l.length ? null : $(l, a ? (a.transcludeOnThisElement || !a.templateOnThisElement) && a.transclude : t), d.push(a, c), u = u || a || c, a = null; | |
return u ? function (e, r, o, i) { | |
var a, c, s, l, u, p; | |
a = r.length; | |
var f = Array(a); | |
for (l = 0; l < a; l++) f[l] = r[l]; | |
for (p = l = 0, u = d.length; l < u; p++) c = f[p], r = d[l++], a = d[l++], r ? (r.scope ? (s = e.$new(), xt.data(c, "$scope", s)) : s = e, r(a, s, c, o, r.transcludeOnThisElement ? N(e, r.transclude, i) : !r.templateOnThisElement && i ? i : !i && t ? N(e, t) : null)) : a && a(e, c.childNodes, n, i) | |
} : null | |
} | |
function N(e, t, n) { | |
return function (r, o, i) { | |
var a = !1; | |
return r || (a = (r = e.$new()).$$transcluded = !0), o = t(r, o, i, n), a && o.on("$destroy", function () { | |
r.$destroy() | |
}), o | |
} | |
} | |
function D(e, t, n, r, o) { | |
var i, a = n.$attr; | |
switch (e.nodeType) { | |
case 1: | |
V(t, Se(Rt(e).toLowerCase()), "E", r, o); | |
for (var c, u, d, p = e.attributes, f = 0, m = p && p.length; f < m; f++) { | |
var h = !1, g = !1; | |
if (c = p[f], !Dt || 8 <= Dt || c.specified) { | |
i = c.name, u = zt(c.value), c = Se(i), (d = ee.test(c)) && (i = W(c.substr(6), "-")); | |
var v = c.replace(/(Start|End)$/, ""); | |
c === v + "Start" && (h = i, g = i.substr(0, i.length - 5) + "end", i = i.substr(0, i.length - 6)), a[c = Se(i.toLowerCase())] = i, !d && n.hasOwnProperty(c) || (n[c] = u, de(e, c) && (n[c] = !0)), q(e, t, u, c), V(t, c, "A", r, o, h, g) | |
} | |
} | |
if (E(e = e.className) && "" !== e) for (; i = l.exec(e);) V(t, c = Se(i[2]), "C", r, o) && (n[c] = zt(i[3])), e = e.substr(i.index + i[0].length); | |
break; | |
case 3: | |
Y(t, e.nodeValue); | |
break; | |
case 8: | |
try { | |
(i = s.exec(e.nodeValue)) && (V(t, c = Se(i[1]), "M", r, o) && (n[c] = zt(i[2]))) | |
} catch (e) { | |
} | |
} | |
return t.sort(B), t | |
} | |
function x(e, t, n) { | |
var r = [], o = 0; | |
if (t && e.hasAttribute && e.hasAttribute(t)) do { | |
if (!e) throw Tn("uterdir", t, n); | |
1 == e.nodeType && (e.hasAttribute(t) && o++, e.hasAttribute(n) && o--), r.push(e), e = e.nextSibling | |
} while (0 < o); else r.push(e); | |
return xt(r) | |
} | |
function O(e, t, n) { | |
return function (r, o, i, a, c) { | |
return o = x(o[0], t, n), e(r, o, i, a, c) | |
} | |
} | |
function M(e, o, a, s, l, u, d, p, f) { | |
function m(e, t, n, r) { | |
e && (n && (e = O(e, n, r)), e.require = S.require, e.directiveName = w, (V === S || S.$$isolateScope) && (e = z(e, {isolateScope: !0})), d.push(e)), t && (n && (t = O(t, n, r)), t.require = S.require, t.directiveName = w, (V === S || S.$$isolateScope) && (t = z(t, {isolateScope: !0})), p.push(t)) | |
} | |
function h(e, t, n, r) { | |
var o, a = "data", c = !1; | |
if (E(t)) { | |
for (; "^" == (o = t.charAt(0)) || "?" == o;) t = t.substr(1), "^" == o && (a = "inheritedData"), c = c || "?" == o; | |
if (o = null, r && "data" === a && (o = r[t]), !(o = o || n[a]("$" + t + "Controller")) && !c) throw Tn("ctreq", t, e) | |
} else Gt(t) && (o = [], i(t, function (t) { | |
o.push(h(e, t, n, r)) | |
})); | |
return o | |
} | |
function C(e, t, s, l, u) { | |
var f, m, y, E, C, T, _, S = {}; | |
if (f = o === s ? a : k(a, new K(xt(s), a.$attr)), m = f.$$element, V) { | |
var w = /^\s*([@=&])(\??)\s*(\w*)\s*$/; | |
T = t.$new(!0), !B || B !== V && B !== V.$$originalDirective ? m.data("$isolateScopeNoTemplate", T) : m.data("$isolateScope", T), P(m, "ng-isolate-scope"), i(V.scope, function (e, n) { | |
var o, i, a, c, s = (u = e.match(w) || [])[3] || n, l = "?" == u[2], u = u[1]; | |
switch (T.$$isolateBindings[n] = u + s, u) { | |
case"@": | |
f.$observe(s, function (e) { | |
T[n] = e | |
}), f.$$observers[s].$$scope = t, f[s] && (T[n] = r(f[s])(t)); | |
break; | |
case"=": | |
if (l && !f[s]) break; | |
i = g(f[s]), c = i.literal ? I : function (e, t) { | |
return e === t || e != e && t != t | |
}, a = i.assign || function () { | |
throw o = T[n] = i(t), Tn("nonassign", f[s], V.name) | |
}, o = T[n] = i(t), T.$watch(function () { | |
var e = i(t); | |
return c(e, T[n]) || (c(e, o) ? a(t, e = T[n]) : T[n] = e), o = e | |
}, null, i.literal); | |
break; | |
case"&": | |
i = g(f[s]), T[n] = function (e) { | |
return i(t, e) | |
}; | |
break; | |
default: | |
throw Tn("iscp", V.name, n, e) | |
} | |
}) | |
} | |
for (_ = u && function (e, t) { | |
var r; | |
return 2 > arguments.length && (t = e, e = n), q && (r = S), u(e, t, r) | |
}, M && i(M, function (e) { | |
var n, r = { | |
$scope: e === V || e.$$isolateScope ? T : t, | |
$element: m, | |
$attrs: f, | |
$transclude: _ | |
}; | |
"@" == (C = e.controller) && (C = f[e.name]), n = v(C, r), S[e.name] = n, q || m.data("$" + e.name + "Controller", n), e.controllerAs && (r.$scope[e.controllerAs] = n) | |
}), l = 0, y = d.length; l < y; l++) try { | |
(E = d[l])(E.isolateScope ? T : t, m, f, E.require && h(E.directiveName, E.require, m, S), _) | |
} catch (e) { | |
c(e, R(m)) | |
} | |
for (l = t, V && (V.template || null === V.templateUrl) && (l = T), e && e(l, s.childNodes, n, u), l = p.length - 1; 0 <= l; l--) try { | |
(E = p[l])(E.isolateScope ? T : t, m, f, E.require && h(E.directiveName, E.require, m, S), _) | |
} catch (e) { | |
c(e, R(m)) | |
} | |
} | |
f = f || {}; | |
for (var T, S, w, b, $, N = -Number.MAX_VALUE, M = f.controllerDirectives, V = f.newIsolateScopeDirective, B = f.templateDirective, W = f.nonTlbTranscludeDirective, j = !1, Y = !1, q = f.hasElementTranscludeDirective, Z = a.$$element = xt(o), J = s, ee = 0, te = e.length; ee < te; ee++) { | |
var ne = (S = e[ee]).$$start, re = S.$$end; | |
if (ne && (Z = x(o, ne, re)), b = n, N > S.priority) break; | |
if ((b = S.scope) && (T = T || S, S.templateUrl || (H("new/isolated scope", V, S, Z), y(b) && (V = S))), w = S.name, !S.templateUrl && S.controller && (b = S.controller, H("'" + w + "' controller", (M = M || {})[w], S, Z), M[w] = S), (b = S.transclude) && (j = !0, S.$$tlb || (H("transclusion", W, S, Z), W = S), "element" == b ? (q = !0, N = S.priority, b = Z, Z = a.$$element = xt(t.createComment(" " + w + ": " + a[w] + " ")), o = Z[0], G(l, Bt.call(b, 0), o), J = A(b, s, N, u && u.name, {nonTlbTranscludeDirective: W})) : (b = xt(Q(o)).contents(), Z.empty(), J = A(b, s))), S.template) if (Y = !0, H("template", B, S, Z), B = S, b = _(S.template) ? S.template(Z, a) : S.template, b = X(b), S.replace) { | |
if (u = S, b = cn.test(b) ? xt(zt(b)) : [], o = b[0], 1 != b.length || 1 !== o.nodeType) throw Tn("tplrt", w, ""); | |
G(l, Z, o), b = D(o, [], te = {$attr: {}}); | |
var oe = e.splice(ee + 1, e.length - (ee + 1)); | |
V && L(b), e = e.concat(b).concat(oe), F(a, te), te = e.length | |
} else Z.html(b); | |
if (S.templateUrl) Y = !0, H("template", B, S, Z), B = S, S.replace && (u = S), C = U(e.splice(ee, e.length - ee), Z, a, l, j && J, d, p, { | |
controllerDirectives: M, | |
newIsolateScopeDirective: V, | |
templateDirective: B, | |
nonTlbTranscludeDirective: W | |
}), te = e.length; else if (S.compile) try { | |
_($ = S.compile(Z, a, J)) ? m(null, $, ne, re) : $ && m($.pre, $.post, ne, re) | |
} catch (e) { | |
c(e, R(Z)) | |
} | |
S.terminal && (C.terminal = !0, N = Math.max(N, S.priority)) | |
} | |
return C.scope = T && !0 === T.scope, C.transcludeOnThisElement = j, C.templateOnThisElement = Y, C.transclude = J, f.hasElementTranscludeDirective = q, C | |
} | |
function L(e) { | |
for (var t = 0, n = e.length; t < n; t++) e[t] = p(e[t], {$$isolateScope: !0}) | |
} | |
function V(t, r, i, s, l, u, d) { | |
if (r === l) return null; | |
if (l = null, o.hasOwnProperty(r)) for (var f, m = 0, h = (r = e.get(r + a)).length; m < h; m++) try { | |
f = r[m], (s === n || s > f.priority) && -1 != f.restrict.indexOf(i) && (u && (f = p(f, { | |
$$start: u, | |
$$end: d | |
})), t.push(f), l = f) | |
} catch (e) { | |
c(e) | |
} | |
return l | |
} | |
function F(e, t) { | |
var n = t.$attr, r = e.$attr, o = e.$$element; | |
i(e, function (r, o) { | |
"$" != o.charAt(0) && (t[o] && t[o] !== r && (r += ("style" === o ? ";" : " ") + t[o]), e.$set(o, r, !0, n[o])) | |
}), i(t, function (t, i) { | |
"class" == i ? (P(o, t), e.class = (e.class ? e.class + " " : "") + t) : "style" == i ? (o.attr("style", o.attr("style") + ";" + t), e.style = (e.style ? e.style + ";" : "") + t) : "$" == i.charAt(0) || e.hasOwnProperty(i) || (e[i] = t, r[i] = n[i]) | |
}) | |
} | |
function U(e, t, n, r, o, a, c, s) { | |
var l, d, p = [], m = t[0], g = e.shift(), v = u({}, g, { | |
templateUrl: null, | |
transclude: null, | |
replace: null, | |
$$originalDirective: g | |
}), E = _(g.templateUrl) ? g.templateUrl(t, n) : g.templateUrl; | |
return t.empty(), f.get(S.getTrustedResourceUrl(E), {cache: h}).success(function (u) { | |
var f, h; | |
if (u = X(u), g.replace) { | |
if (u = cn.test(u) ? xt(zt(u)) : [], f = u[0], 1 != u.length || 1 !== f.nodeType) throw Tn("tplrt", g.name, E); | |
u = {$attr: {}}, G(r, t, f); | |
var C = D(f, [], u); | |
y(g.scope) && L(C), e = C.concat(e), F(n, u) | |
} else f = m, t.html(u); | |
for (e.unshift(v), l = M(e, f, n, o, t, g, a, c, s), i(r, function (e, n) { | |
e == f && (r[n] = t[0]) | |
}), d = $(t[0].childNodes, o); p.length;) { | |
u = p.shift(), h = p.shift(); | |
var T = p.shift(), _ = p.shift(); | |
C = t[0]; | |
if (h !== m) { | |
var S = h.className; | |
s.hasElementTranscludeDirective && g.replace || (C = Q(f)), G(T, xt(h), C), P(xt(C), S) | |
} | |
h = l.transcludeOnThisElement ? N(u, l.transclude, _) : _, l(d, u, C, r, h) | |
} | |
p = null | |
}).error(function (e, t, n, r) { | |
throw Tn("tpload", r.url) | |
}), function (e, t, n, r, o) { | |
e = o, p ? (p.push(t), p.push(n), p.push(r), p.push(e)) : (l.transcludeOnThisElement && (e = N(t, l.transclude, o)), l(d, t, n, r, e)) | |
} | |
} | |
function B(e, t) { | |
var n = t.priority - e.priority; | |
return 0 !== n ? n : e.name !== t.name ? e.name < t.name ? -1 : 1 : e.index - t.index | |
} | |
function H(e, t, n, r) { | |
if (t) throw Tn("multidir", t.name, n.name, e, R(r)) | |
} | |
function Y(e, t) { | |
var n = r(t, !0); | |
n && e.push({ | |
priority: 0, compile: function (e) { | |
var t = e.parent().length; | |
return t && P(e.parent(), "ng-binding"), function (e, r) { | |
var o = r.parent(), i = o.data("$binding") || []; | |
i.push(n), o.data("$binding", i), t || P(o, "ng-binding"), e.$watch(n, function (e) { | |
r[0].nodeValue = e | |
}) | |
} | |
} | |
}) | |
} | |
function q(e, t, n, o) { | |
var i = r(n, !0); | |
if (i) { | |
if ("multiple" === o && "SELECT" === Rt(e)) throw Tn("selmulti", R(e)); | |
t.push({ | |
priority: 100, compile: function () { | |
return { | |
pre: function (t, n, a) { | |
if (n = a.$$observers || (a.$$observers = {}), d.test(o)) throw Tn("nodomevents"); | |
(i = r(a[o], !0, function (e, t) { | |
if ("srcdoc" == t) return S.HTML; | |
var n = Rt(e); | |
return "xlinkHref" == t || "FORM" == n && "action" == t || "IMG" != n && ("src" == t || "ngSrc" == t) ? S.RESOURCE_URL : void 0 | |
}(e, o))) && (a[o] = i(t), (n[o] || (n[o] = [])).$$inter = !0, (a.$$observers && a.$$observers[o].$$scope || t).$watch(i, function (e, t) { | |
"class" === o && e != t ? a.$updateClass(e, t) : a.$set(o, e) | |
})) | |
} | |
} | |
} | |
}) | |
} | |
} | |
function G(e, n, r) { | |
var o, i, a = n[0], c = n.length, s = a.parentNode; | |
if (e) for (o = 0, i = e.length; o < i; o++) if (e[o] == a) { | |
e[o++] = r, i = o + c - 1; | |
for (var l = e.length; o < l; o++, i++) i < l ? e[o] = e[i] : delete e[o]; | |
e.length -= c - 1; | |
break | |
} | |
for (s && s.replaceChild(r, a), (e = t.createDocumentFragment()).appendChild(a), r[xt.expando] = a[xt.expando], a = 1, c = n.length; a < c; a++) s = n[a], xt(s).remove(), e.appendChild(s), delete n[a]; | |
n[0] = r, n.length = 1 | |
} | |
function z(e, t) { | |
return u(function () { | |
return e.apply(null, arguments) | |
}, e, t) | |
} | |
var K = function (e, t) { | |
this.$$element = e, this.$attr = t || {} | |
}; | |
K.prototype = { | |
$normalize: Se, $addClass: function (e) { | |
e && 0 < e.length && w.addClass(this.$$element, e) | |
}, $removeClass: function (e) { | |
e && 0 < e.length && w.removeClass(this.$$element, e) | |
}, $updateClass: function (e, t) { | |
var n = we(e, t), r = we(t, e); | |
0 === n.length ? w.removeClass(this.$$element, r) : 0 === r.length ? w.addClass(this.$$element, n) : w.setClass(this.$$element, n, r) | |
}, $set: function (e, t, r, o) { | |
var a = de(this.$$element[0], e); | |
a && (this.$$element.prop(e, t), o = a), this[e] = t, o ? this.$attr[e] = o : (o = this.$attr[e]) || (this.$attr[e] = o = W(e, "-")), ("A" === (a = Rt(this.$$element)) && "href" === e || "IMG" === a && "src" === e) && (this[e] = t = b(t, "src" === e)), !1 !== r && (null === t || t === n ? this.$$element.removeAttr(o) : this.$$element.attr(o, t)), (r = this.$$observers) && i(r[e], function (e) { | |
try { | |
e(t) | |
} catch (e) { | |
c(e) | |
} | |
}) | |
}, $observe: function (e, t) { | |
var n = this, r = n.$$observers || (n.$$observers = {}), o = r[e] || (r[e] = []); | |
return o.push(t), C.$evalAsync(function () { | |
o.$$inter || t(n[e]) | |
}), t | |
} | |
}; | |
var Z = r.startSymbol(), J = r.endSymbol(), X = "{{" == Z || "}}" == J ? m : function (e) { | |
return e.replace(/\{\{/g, Z).replace(/}}/g, J) | |
}, ee = /^ngAttr[A-Z]/; | |
return A | |
}] | |
} | |
function Se(e) { | |
return K(e.replace(_n, "")) | |
} | |
function we(e, t) { | |
var n = "", r = e.split(/\s+/), o = t.split(/\s+/), i = 0; | |
e:for (; i < r.length; i++) { | |
for (var a = r[i], c = 0; c < o.length; c++) if (a == o[c]) continue e; | |
n += (0 < n.length ? " " : "") + a | |
} | |
return n | |
} | |
function be() { | |
var e = {}, t = /^(\S+)(\s+as\s+(\w+))?$/; | |
this.register = function (t, n) { | |
q(t, "controller"), y(t) ? u(e, t) : e[t] = n | |
}, this.$get = ["$injector", "$window", function (n, o) { | |
return function (i, a) { | |
var c, s, l; | |
if (E(i) && (s = (c = i.match(t))[1], l = c[3], Y(i = e.hasOwnProperty(s) ? e[s] : G(a.$scope, s, !0) || G(o, s, !0), s, !0)), c = n.instantiate(i, a), l) { | |
if (!a || "object" != typeof a.$scope) throw r("$controller")("noscp", s || i.name, l); | |
a.$scope[l] = c | |
} | |
return c | |
} | |
}] | |
} | |
function Ae() { | |
this.$get = ["$window", function (e) { | |
return xt(e.document) | |
}] | |
} | |
function Pe() { | |
this.$get = ["$log", function (e) { | |
return function (t, n) { | |
e.error.apply(e, arguments) | |
} | |
}] | |
} | |
function $e(e) { | |
var t, n, r, o = {}; | |
return e ? (i(e.split("\n"), function (e) { | |
r = e.indexOf(":"), t = Vt(zt(e.substr(0, r))), n = zt(e.substr(r + 1)), t && (o[t] = o[t] ? o[t] + ", " + n : n) | |
}), o) : o | |
} | |
function ke(e) { | |
var t = y(e) ? e : n; | |
return function (n) { | |
return t || (t = $e(e)), n ? t[Vt(n)] || null : t | |
} | |
} | |
function Ie(e, t, n) { | |
return _(n) ? n(e, t) : (i(n, function (n) { | |
e = n(e, t) | |
}), e) | |
} | |
function Ne() { | |
var e = /^\s*(\[|\{[^\{])/, t = /[\}\]]\s*$/, r = /^\)\]\}',?\n/, | |
o = {"Content-Type": "application/json;charset=utf-8"}, c = this.defaults = { | |
transformResponse: [function (n) { | |
return E(n) && (n = n.replace(r, ""), e.test(n) && t.test(n) && (n = O(n))), n | |
}], | |
transformRequest: [function (e) { | |
return y(e) && "[object File]" !== Wt.call(e) && "[object Blob]" !== Wt.call(e) ? x(e) : e | |
}], | |
headers: { | |
common: {Accept: "application/json, text/plain, */*"}, | |
post: k(o), | |
put: k(o), | |
patch: k(o) | |
}, | |
xsrfCookieName: "XSRF-TOKEN", | |
xsrfHeaderName: "X-XSRF-TOKEN" | |
}, s = this.interceptors = [], l = this.responseInterceptors = []; | |
this.$get = ["$httpBackend", "$browser", "$cacheFactory", "$rootScope", "$q", "$injector", function (e, t, r, o, d, p) { | |
function f(e) { | |
function t(e) { | |
var t = u({}, e, {data: Ie(e.data, e.headers, r.transformResponse)}); | |
return 200 <= e.status && 300 > e.status ? t : d.reject(t) | |
} | |
var r = { | |
method: "get", | |
transformRequest: c.transformRequest, | |
transformResponse: c.transformResponse | |
}, o = function (e) { | |
var t, n, r = c.headers, o = u({}, e.headers); | |
r = u({}, r.common, r[Vt(e.method)]); | |
e:for (t in r) { | |
for (n in e = Vt(t), o) if (Vt(n) === e) continue e; | |
o[t] = r[t] | |
} | |
return function (e) { | |
var t; | |
i(e, function (n, r) { | |
_(n) && (null != (t = n()) ? e[r] = t : delete e[r]) | |
}) | |
}(o), o | |
}(e); | |
u(r, e), r.headers = o, r.method = Ut(r.method); | |
var a = [function (e) { | |
o = e.headers; | |
var n = Ie(e.data, ke(o), e.transformRequest); | |
return g(n) && i(o, function (e, t) { | |
"content-type" === Vt(t) && delete o[t] | |
}), g(e.withCredentials) && !g(c.withCredentials) && (e.withCredentials = c.withCredentials), m(e, n, o).then(t, t) | |
}, n], s = d.when(r); | |
for (i(S, function (e) { | |
(e.request || e.requestError) && a.unshift(e.request, e.requestError), (e.response || e.responseError) && a.push(e.response, e.responseError) | |
}); a.length;) { | |
e = a.shift(); | |
var l = a.shift(); | |
s = s.then(e, l) | |
} | |
return s.success = function (e) { | |
return s.then(function (t) { | |
e(t.data, t.status, t.headers, r) | |
}), s | |
}, s.error = function (e) { | |
return s.then(null, function (t) { | |
e(t.data, t.status, t.headers, r) | |
}), s | |
}, s | |
} | |
function m(r, i, a) { | |
function s(e, t, n, o) { | |
(200 <= (t = Math.max(t, 0)) && 300 > t ? m.resolve : m.reject)({ | |
data: e, | |
status: t, | |
headers: ke(n), | |
config: r, | |
statusText: o | |
}) | |
} | |
function l() { | |
var e = A(f.pendingRequests, r); | |
-1 !== e && f.pendingRequests.splice(e, 1) | |
} | |
var u, p, m = d.defer(), E = m.promise, T = h(r.url, r.params); | |
if (f.pendingRequests.push(r), E.then(l, l), !r.cache && !c.cache || !1 === r.cache || "GET" !== r.method && "JSONP" !== r.method || (u = y(r.cache) ? r.cache : y(c.cache) ? c.cache : C), u) if (v(p = u.get(T))) { | |
if (p && _(p.then)) return p.then(l, l), p; | |
Gt(p) ? s(p[1], p[0], k(p[2]), p[3]) : s(p, 200, {}, "OK") | |
} else u.put(T, E); | |
return g(p) && ((p = pt(r.url) ? t.cookies()[r.xsrfCookieName || c.xsrfCookieName] : n) && (a[r.xsrfHeaderName || c.xsrfHeaderName] = p), e(r.method, T, i, function (e, t, n, r) { | |
u && (200 <= e && 300 > e ? u.put(T, [e, t, $e(n), r]) : u.remove(T)), s(t, e, n, r), o.$$phase || o.$apply() | |
}, a, r.timeout, r.withCredentials, r.responseType)), E | |
} | |
function h(e, t) { | |
if (!t) return e; | |
var n = []; | |
return function (e, t, n) { | |
for (var r = a(e), o = 0; o < r.length; o++) t.call(n, e[r[o]], r[o]) | |
}(t, function (e, t) { | |
null === e || g(e) || (Gt(e) || (e = [e]), i(e, function (e) { | |
y(e) && (T(e) ? e = e.toISOString() : y(e) && (e = x(e))), n.push(B(t) + "=" + B(e)) | |
})) | |
}), 0 < n.length && (e += (-1 == e.indexOf("?") ? "?" : "&") + n.join("&")), e | |
} | |
var C = r("$http"), S = []; | |
return i(s, function (e) { | |
S.unshift(E(e) ? p.get(e) : p.invoke(e)) | |
}), i(l, function (e, t) { | |
var n = E(e) ? p.get(e) : p.invoke(e); | |
S.splice(t, 0, { | |
response: function (e) { | |
return n(d.when(e)) | |
}, responseError: function (e) { | |
return n(d.reject(e)) | |
} | |
}) | |
}), f.pendingRequests = [], function (e) { | |
i(arguments, function (e) { | |
f[e] = function (t, n) { | |
return f(u(n || {}, {method: e, url: t})) | |
} | |
}) | |
}("get", "delete", "head", "jsonp"), function (e) { | |
i(arguments, function (e) { | |
f[e] = function (t, n, r) { | |
return f(u(r || {}, {method: e, url: t, data: n})) | |
} | |
}) | |
}("post", "put"), f.defaults = c, f | |
}] | |
} | |
function De(t) { | |
if (8 >= Dt && (!t.match(/^(get|post|head|put|delete|options)$/i) || !e.XMLHttpRequest)) return new e.ActiveXObject("Microsoft.XMLHTTP"); | |
if (e.XMLHttpRequest) return new e.XMLHttpRequest; | |
throw r("$httpBackend")("noxhr") | |
} | |
function xe() { | |
this.$get = ["$browser", "$window", "$document", function (e, t, n) { | |
return function (e, t, n, r, o) { | |
function a(e, t, n) { | |
var i = o.createElement("script"), a = null; | |
return i.type = "text/javascript", i.src = e, i.async = !0, a = function (e) { | |
tn(i, "load", a), tn(i, "error", a), o.body.removeChild(i), i = null; | |
var c = -1, s = "unknown"; | |
e && ("load" !== e.type || r[t].called || (e = {type: "error"}), s = e.type, c = "error" === e.type ? 404 : 200), n && n(c, s) | |
}, en(i, "load", a), en(i, "error", a), 8 >= Dt && (i.onreadystatechange = function () { | |
E(i.readyState) && /loaded|complete/.test(i.readyState) && (i.onreadystatechange = null, a({type: "load"})) | |
}), o.body.appendChild(i), a | |
} | |
var c = -1; | |
return function (o, s, l, u, d, p, m, h) { | |
function g() { | |
E = c, T && T(), S && S.abort() | |
} | |
function y(t, r, o, i, a) { | |
w && n.cancel(w), T = S = null, 0 === r && (r = o ? 200 : "file" == dt(s).protocol ? 404 : 0), t(1223 === r ? 204 : r, o, i, a || ""), e.$$completeOutstandingRequest(f) | |
} | |
var E; | |
if (e.$$incOutstandingRequestCount(), s = s || e.url(), "jsonp" == Vt(o)) { | |
var C = "_" + (r.counter++).toString(36); | |
r[C] = function (e) { | |
r[C].data = e, r[C].called = !0 | |
}; | |
var T = a(s.replace("JSON_CALLBACK", "angular.callbacks." + C), C, function (e, t) { | |
y(u, e, r[C].data, "", t), r[C] = f | |
}) | |
} else { | |
var S = t(o); | |
if (S.open(o, s, !0), i(d, function (e, t) { | |
v(e) && S.setRequestHeader(t, e) | |
}), S.onreadystatechange = function () { | |
if (S && 4 == S.readyState) { | |
var e = null, t = null, n = ""; | |
E !== c && (e = S.getAllResponseHeaders(), t = "response" in S ? S.response : S.responseText), E === c && 10 > Dt || (n = S.statusText), y(u, E || S.status, t, e, n) | |
} | |
}, m && (S.withCredentials = !0), h) try { | |
S.responseType = h | |
} catch (e) { | |
if ("json" !== h) throw e | |
} | |
S.send(l || null) | |
} | |
if (0 < p) var w = n(g, p); else p && _(p.then) && p.then(g) | |
} | |
}(e, De, e.defer, t.angular.callbacks, n[0]) | |
}] | |
} | |
function Oe() { | |
var e = "{{", t = "}}"; | |
this.startSymbol = function (t) { | |
return t ? (e = t, this) : e | |
}, this.endSymbol = function (e) { | |
return e ? (t = e, this) : t | |
}, this.$get = ["$parse", "$exceptionHandler", "$sce", function (n, r, o) { | |
function i(i, s, l) { | |
for (var u, d, p = 0, f = [], m = i.length, h = !1, g = []; p < m;) -1 != (u = i.indexOf(e, p)) && -1 != (d = i.indexOf(t, u + a)) ? (p != u && f.push(i.substring(p, u)), f.push(p = n(h = i.substring(u + a, d))), p.exp = h, p = d + c, h = !0) : (p != m && f.push(i.substring(p)), p = m); | |
if ((m = f.length) || (f.push(""), m = 1), l && 1 < f.length) throw Sn("noconcat", i); | |
if (!s || h) return g.length = m, (p = function (e) { | |
try { | |
for (var t, n = 0, a = m; n < a; n++) { | |
if ("function" == typeof (t = f[n])) if (t = t(e), null == (t = l ? o.getTrusted(l, t) : o.valueOf(t))) t = ""; else switch (typeof t) { | |
case"string": | |
break; | |
case"number": | |
t = "" + t; | |
break; | |
default: | |
t = x(t) | |
} | |
g[n] = t | |
} | |
return g.join("") | |
} catch (t) { | |
e = Sn("interr", i, t.toString()), r(e) | |
} | |
}).exp = i, p.parts = f, p | |
} | |
var a = e.length, c = t.length; | |
return i.startSymbol = function () { | |
return e | |
}, i.endSymbol = function () { | |
return t | |
}, i | |
}] | |
} | |
function Me() { | |
this.$get = ["$rootScope", "$window", "$q", function (e, t, n) { | |
function r(r, i, a, c) { | |
var s = t.setInterval, l = t.clearInterval, u = n.defer(), d = u.promise, p = 0, | |
f = v(c) && !c; | |
return a = v(a) ? a : 0, d.then(null, null, r), d.$$intervalId = s(function () { | |
u.notify(p++), 0 < a && p >= a && (u.resolve(p), l(d.$$intervalId), delete o[d.$$intervalId]), f || e.$apply() | |
}, i), o[d.$$intervalId] = u, d | |
} | |
var o = {}; | |
return r.cancel = function (e) { | |
return !!(e && e.$$intervalId in o) && (o[e.$$intervalId].reject("canceled"), t.clearInterval(e.$$intervalId), delete o[e.$$intervalId], !0) | |
}, r | |
}] | |
} | |
function Re() { | |
this.$get = function () { | |
return { | |
id: "en-us", | |
NUMBER_FORMATS: { | |
DECIMAL_SEP: ".", | |
GROUP_SEP: ",", | |
PATTERNS: [{ | |
minInt: 1, | |
minFrac: 0, | |
maxFrac: 3, | |
posPre: "", | |
posSuf: "", | |
negPre: "-", | |
negSuf: "", | |
gSize: 3, | |
lgSize: 3 | |
}, { | |
minInt: 1, | |
minFrac: 2, | |
maxFrac: 2, | |
posPre: "¤", | |
posSuf: "", | |
negPre: "(¤", | |
negSuf: ")", | |
gSize: 3, | |
lgSize: 3 | |
}], | |
CURRENCY_SYM: "$" | |
}, | |
DATETIME_FORMATS: { | |
MONTH: "January February March April May June July August September October November December".split(" "), | |
SHORTMONTH: "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), | |
DAY: "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), | |
SHORTDAY: "Sun Mon Tue Wed Thu Fri Sat".split(" "), | |
AMPMS: ["AM", "PM"], | |
medium: "MMM d, y h:mm:ss a", | |
short: "M/d/yy h:mm a", | |
fullDate: "EEEE, MMMM d, y", | |
longDate: "MMMM d, y", | |
mediumDate: "MMM d, y", | |
shortDate: "M/d/yy", | |
mediumTime: "h:mm:ss a", | |
shortTime: "h:mm a" | |
}, | |
pluralCat: function (e) { | |
return 1 === e ? "one" : "other" | |
} | |
} | |
} | |
} | |
function Le(e) { | |
for (var t = (e = e.split("/")).length; t--;) e[t] = U(e[t]); | |
return e.join("/") | |
} | |
function Ve(e, t, n) { | |
e = dt(e, n), t.$$protocol = e.protocol, t.$$host = e.hostname, t.$$port = d(e.port) || bn[e.protocol] || null | |
} | |
function Fe(e, t, n) { | |
var r = "/" !== e.charAt(0); | |
r && (e = "/" + e), e = dt(e, n), t.$$path = decodeURIComponent(r && "/" === e.pathname.charAt(0) ? e.pathname.substring(1) : e.pathname), t.$$search = V(e.search), t.$$hash = decodeURIComponent(e.hash), t.$$path && "/" != t.$$path.charAt(0) && (t.$$path = "/" + t.$$path) | |
} | |
function Ue(e, t) { | |
if (0 === t.indexOf(e)) return t.substr(e.length) | |
} | |
function Be(e) { | |
var t = e.indexOf("#"); | |
return -1 == t ? e : e.substr(0, t) | |
} | |
function He(e) { | |
return e.substr(0, Be(e).lastIndexOf("/") + 1) | |
} | |
function We(e, t) { | |
this.$$html5 = !0, t = t || ""; | |
var r = He(e); | |
Ve(e, this, e), this.$$parse = function (t) { | |
var n = Ue(r, t); | |
if (!E(n)) throw An("ipthprfx", t, r); | |
Fe(n, this, e), this.$$path || (this.$$path = "/"), this.$$compose() | |
}, this.$$compose = function () { | |
var e = F(this.$$search), t = this.$$hash ? "#" + U(this.$$hash) : ""; | |
this.$$url = Le(this.$$path) + (e ? "?" + e : "") + t, this.$$absUrl = r + this.$$url.substr(1) | |
}, this.$$rewrite = function (o) { | |
var i; | |
return (i = Ue(e, o)) !== n ? (o = i, (i = Ue(t, i)) !== n ? r + (Ue("/", i) || i) : e + o) : (i = Ue(r, o)) !== n ? r + i : r == o + "/" ? r : void 0 | |
} | |
} | |
function je(e, t) { | |
var n = He(e); | |
Ve(e, this, e), this.$$parse = function (r) { | |
var o; | |
if (!E(o = "#" == (o = Ue(e, r) || Ue(n, r)).charAt(0) ? Ue(t, o) : this.$$html5 ? o : "")) throw An("ihshprfx", r, t); | |
Fe(o, this, e), r = this.$$path; | |
var i = /^\/[A-Z]:(\/.*)/; | |
0 === o.indexOf(e) && (o = o.replace(e, "")), i.exec(o) || (r = (o = i.exec(r)) ? o[1] : r), this.$$path = r, this.$$compose() | |
}, this.$$compose = function () { | |
var n = F(this.$$search), r = this.$$hash ? "#" + U(this.$$hash) : ""; | |
this.$$url = Le(this.$$path) + (n ? "?" + n : "") + r, this.$$absUrl = e + (this.$$url ? t + this.$$url : "") | |
}, this.$$rewrite = function (t) { | |
if (Be(e) == Be(t)) return t | |
} | |
} | |
function Ye(e, t) { | |
this.$$html5 = !0, je.apply(this, arguments); | |
var n = He(e); | |
this.$$rewrite = function (r) { | |
var o; | |
return e == Be(r) ? r : (o = Ue(n, r)) ? e + t + o : n === r + "/" ? n : void 0 | |
}, this.$$compose = function () { | |
var n = F(this.$$search), r = this.$$hash ? "#" + U(this.$$hash) : ""; | |
this.$$url = Le(this.$$path) + (n ? "?" + n : "") + r, this.$$absUrl = e + t + this.$$url | |
} | |
} | |
function qe(e) { | |
return function () { | |
return this[e] | |
} | |
} | |
function Ge(e, t) { | |
return function (n) { | |
return g(n) ? this[e] : (this[e] = t(n), this.$$compose(), this) | |
} | |
} | |
function ze() { | |
var t = "", n = !1; | |
this.hashPrefix = function (e) { | |
return v(e) ? (t = e, this) : t | |
}, this.html5Mode = function (e) { | |
return v(e) ? (n = e, this) : n | |
}, this.$get = ["$rootScope", "$browser", "$sniffer", "$rootElement", function (r, o, i, a) { | |
function c(e) { | |
r.$broadcast("$locationChangeSuccess", s.absUrl(), e) | |
} | |
var s, l, u, d = o.baseHref(), p = o.url(); | |
n ? (u = p.substring(0, p.indexOf("/", p.indexOf("//") + 2)) + (d || "/"), l = i.history ? We : Ye) : (u = Be(p), l = je), (s = new l(u, "#" + t)).$$parse(s.$$rewrite(p)); | |
var f = /^\s*(javascript|mailto):/i; | |
a.on("click", function (n) { | |
if (!n.ctrlKey && !n.metaKey && 2 != n.which) { | |
for (var i = xt(n.target); "a" !== Vt(i[0].nodeName);) if (i[0] === a[0] || !(i = i.parent())[0]) return; | |
var c = i.prop("href"); | |
if (y(c) && "[object SVGAnimatedString]" === c.toString() && (c = dt(c.animVal).href), !f.test(c)) { | |
if (l === Ye) if (0 > (p = i.attr("href") || i.attr("xlink:href")).indexOf("://")) if (c = "#" + t, "/" == p[0]) c = u + c + p; else if ("#" == p[0]) c = u + c + (s.path() || "/") + p; else { | |
for (var d = s.path().split("/"), p = p.split("/"), m = 0; m < p.length; m++) "." != p[m] && (".." == p[m] ? d.pop() : p[m].length && d.push(p[m])); | |
c = u + c + d.join("/") | |
} | |
d = s.$$rewrite(c), c && !i.attr("target") && d && !n.isDefaultPrevented() && (n.preventDefault(), d != o.url() && (s.$$parse(d), r.$apply(), e.angular["ff-684208-preventDefault"] = !0)) | |
} | |
} | |
}), s.absUrl() != p && o.url(s.absUrl(), !0), o.onUrlChange(function (e) { | |
s.absUrl() != e && (r.$evalAsync(function () { | |
var t = s.absUrl(); | |
s.$$parse(e), r.$broadcast("$locationChangeStart", e, t).defaultPrevented ? (s.$$parse(t), o.url(t)) : c(t) | |
}), r.$$phase || r.$digest()) | |
}); | |
var m = 0; | |
return r.$watch(function () { | |
var e = o.url(), t = s.$$replace; | |
return m && e == s.absUrl() || (m++, r.$evalAsync(function () { | |
r.$broadcast("$locationChangeStart", s.absUrl(), e).defaultPrevented ? s.$$parse(e) : (o.url(s.absUrl(), t), c(e)) | |
})), s.$$replace = !1, m | |
}), s | |
}] | |
} | |
function Ke() { | |
var e = !0, t = this; | |
this.debugEnabled = function (t) { | |
return v(t) ? (e = t, this) : e | |
}, this.$get = ["$window", function (n) { | |
function r(e) { | |
var t = n.console || {}, r = t[e] || t.log || f; | |
e = !1; | |
try { | |
e = !!r.apply | |
} catch (e) { | |
} | |
return e ? function () { | |
var e = []; | |
return i(arguments, function (t) { | |
e.push(function (e) { | |
return e instanceof Error && (e.stack ? e = e.message && -1 === e.stack.indexOf(e.message) ? "Error: " + e.message + "\n" + e.stack : e.stack : e.sourceURL && (e = e.message + "\n" + e.sourceURL + ":" + e.line)), e | |
}(t)) | |
}), r.apply(t, e) | |
} : function (e, t) { | |
r(e, null == t ? "" : t) | |
} | |
} | |
return { | |
log: r("log"), info: r("info"), warn: r("warn"), error: r("error"), debug: function () { | |
var n = r("debug"); | |
return function () { | |
e && n.apply(t, arguments) | |
} | |
}() | |
} | |
}] | |
} | |
function Ze(e, t) { | |
if ("__defineGetter__" === e || "__defineSetter__" === e || "__lookupGetter__" === e || "__lookupSetter__" === e || "__proto__" === e) throw $n("isecfld", t); | |
return e | |
} | |
function Je(e, t) { | |
if (e) { | |
if (e.constructor === e) throw $n("isecfn", t); | |
if (e.document && e.location && e.alert && e.setInterval) throw $n("isecwindow", t); | |
if (e.children && (e.nodeName || e.prop && e.attr && e.find)) throw $n("isecdom", t); | |
if (e === Object) throw $n("isecobj", t) | |
} | |
return e | |
} | |
function Qe(e, t, r, o, i) { | |
i = i || {}, t = t.split("."); | |
for (var a, c = 0; 1 < t.length; c++) { | |
var s = e[a = Ze(t.shift(), o)]; | |
s || (s = {}, e[a] = s), (e = s).then && i.unwrapPromises && (Pn(o), "$$v" in e || function (e) { | |
e.then(function (t) { | |
e.$$v = t | |
}) | |
}(e), e.$$v === n && (e.$$v = {}), e = e.$$v) | |
} | |
return a = Ze(t.shift(), o), Je(e, o), Je(e[a], o), e[a] = r | |
} | |
function Xe(e, t, r, o, i, a, c) { | |
return Ze(e, a), Ze(t, a), Ze(r, a), Ze(o, a), Ze(i, a), c.unwrapPromises ? function (c, s) { | |
var l, u = s && s.hasOwnProperty(e) ? s : c; | |
return null == u ? u : ((u = u[e]) && u.then && (Pn(a), "$$v" in u || ((l = u).$$v = n, l.then(function (e) { | |
l.$$v = e | |
})), u = u.$$v), t ? null == u ? n : ((u = u[t]) && u.then && (Pn(a), "$$v" in u || ((l = u).$$v = n, l.then(function (e) { | |
l.$$v = e | |
})), u = u.$$v), r ? null == u ? n : ((u = u[r]) && u.then && (Pn(a), "$$v" in u || ((l = u).$$v = n, l.then(function (e) { | |
l.$$v = e | |
})), u = u.$$v), o ? null == u ? n : ((u = u[o]) && u.then && (Pn(a), "$$v" in u || ((l = u).$$v = n, l.then(function (e) { | |
l.$$v = e | |
})), u = u.$$v), i ? null == u ? n : ((u = u[i]) && u.then && (Pn(a), "$$v" in u || ((l = u).$$v = n, l.then(function (e) { | |
l.$$v = e | |
})), u = u.$$v), u) : u) : u) : u) : u) | |
} : function (a, c) { | |
var s = c && c.hasOwnProperty(e) ? c : a; | |
return null == s ? s : (s = s[e], t ? null == s ? n : (s = s[t], r ? null == s ? n : (s = s[r], o ? null == s ? n : (s = s[o], i ? null == s ? n : s = s[i] : s) : s) : s) : s) | |
} | |
} | |
function et(e, t, r) { | |
if (Ln.hasOwnProperty(e)) return Ln[e]; | |
var o, a = e.split("."), c = a.length; | |
if (t.csp) o = 6 > c ? Xe(a[0], a[1], a[2], a[3], a[4], r, t) : function (e, o) { | |
var i, s = 0; | |
do { | |
i = Xe(a[s++], a[s++], a[s++], a[s++], a[s++], r, t)(e, o), o = n, e = i | |
} while (s < c); | |
return i | |
}; else { | |
var s = "var p;\n"; | |
i(a, function (e, n) { | |
Ze(e, r), s += "if(s == null) return undefined;\ns=" + (n ? "s" : '((k&&k.hasOwnProperty("' + e + '"))?k:s)') + '["' + e + '"];\n' + (t.unwrapPromises ? 'if (s && s.then) {\n pw("' + r.replace(/(["\r\n])/g, "\\$1") + '");\n if (!("$$v" in s)) {\n p=s;\n p.$$v = undefined;\n p.then(function(v) {p.$$v=v;});\n}\n s=s.$$v\n}\n' : "") | |
}); | |
s = s + "return s;"; | |
var l = new Function("s", "k", "pw", s); | |
l.toString = h(s), o = t.unwrapPromises ? function (e, t) { | |
return l(e, t, Pn) | |
} : l | |
} | |
return "hasOwnProperty" !== e && (Ln[e] = o), o | |
} | |
function tt() { | |
var e = {}, t = {csp: !1, unwrapPromises: !1, logPromiseWarnings: !0}; | |
this.unwrapPromises = function (e) { | |
return v(e) ? (t.unwrapPromises = !!e, this) : t.unwrapPromises | |
}, this.logPromiseWarnings = function (e) { | |
return v(e) ? (t.logPromiseWarnings = e, this) : t.logPromiseWarnings | |
}, this.$get = ["$filter", "$sniffer", "$log", function (n, r, o) { | |
return t.csp = r.csp, Pn = function (e) { | |
t.logPromiseWarnings && !kn.hasOwnProperty(e) && (kn[e] = !0, o.warn("[$parse] Promise found in the expression `" + e + "`. Automatic unwrapping of promises in Angular expressions is deprecated.")) | |
}, function (r) { | |
var o; | |
switch (typeof r) { | |
case"string": | |
return e.hasOwnProperty(r) ? e[r] : (o = new Mn(t), o = new Rn(o, n, t).parse(r), "hasOwnProperty" !== r && (e[r] = o), o); | |
case"function": | |
return r; | |
default: | |
return f | |
} | |
} | |
}] | |
} | |
function nt() { | |
this.$get = ["$rootScope", "$exceptionHandler", function (e, t) { | |
return function (e, t) { | |
function r(e) { | |
return e | |
} | |
function o(e) { | |
return s(e) | |
} | |
var a = function () { | |
var i, s, u = []; | |
return s = { | |
resolve: function (t) { | |
if (u) { | |
var r = u; | |
u = n, i = c(t), r.length && e(function () { | |
for (var e, t = 0, n = r.length; t < n; t++) e = r[t], i.then(e[0], e[1], e[2]) | |
}) | |
} | |
}, reject: function (e) { | |
s.resolve(l(e)) | |
}, notify: function (t) { | |
if (u) { | |
var n = u; | |
u.length && e(function () { | |
for (var e = 0, r = n.length; e < r; e++) n[e][2](t) | |
}) | |
} | |
}, promise: { | |
then: function (e, n, c) { | |
var s = a(), l = function (n) { | |
try { | |
s.resolve((_(e) ? e : r)(n)) | |
} catch (e) { | |
s.reject(e), t(e) | |
} | |
}, d = function (e) { | |
try { | |
s.resolve((_(n) ? n : o)(e)) | |
} catch (e) { | |
s.reject(e), t(e) | |
} | |
}, p = function (e) { | |
try { | |
s.notify((_(c) ? c : r)(e)) | |
} catch (e) { | |
t(e) | |
} | |
}; | |
return u ? u.push([l, d, p]) : i.then(l, d, p), s.promise | |
}, catch: function (e) { | |
return this.then(null, e) | |
}, finally: function (e) { | |
function t(e, t) { | |
var n = a(); | |
return t ? n.resolve(e) : n.reject(e), n.promise | |
} | |
function n(n, o) { | |
var i = null; | |
try { | |
i = (e || r)() | |
} catch (e) { | |
return t(e, !1) | |
} | |
return i && _(i.then) ? i.then(function () { | |
return t(n, o) | |
}, function (e) { | |
return t(e, !1) | |
}) : t(n, o) | |
} | |
return this.then(function (e) { | |
return n(e, !0) | |
}, function (e) { | |
return n(e, !1) | |
}) | |
} | |
} | |
} | |
}, c = function (t) { | |
return t && _(t.then) ? t : { | |
then: function (n) { | |
var r = a(); | |
return e(function () { | |
r.resolve(n(t)) | |
}), r.promise | |
} | |
} | |
}, s = function (e) { | |
var t = a(); | |
return t.reject(e), t.promise | |
}, l = function (n) { | |
return { | |
then: function (r, i) { | |
var c = a(); | |
return e(function () { | |
try { | |
c.resolve((_(i) ? i : o)(n)) | |
} catch (e) { | |
c.reject(e), t(e) | |
} | |
}), c.promise | |
} | |
} | |
}; | |
return { | |
defer: a, reject: s, when: function (n, i, l, u) { | |
var d, p = a(), f = function (e) { | |
try { | |
return (_(i) ? i : r)(e) | |
} catch (e) { | |
return t(e), s(e) | |
} | |
}, m = function (e) { | |
try { | |
return (_(l) ? l : o)(e) | |
} catch (e) { | |
return t(e), s(e) | |
} | |
}, h = function (e) { | |
try { | |
return (_(u) ? u : r)(e) | |
} catch (e) { | |
t(e) | |
} | |
}; | |
return e(function () { | |
c(n).then(function (e) { | |
d || (d = !0, p.resolve(c(e).then(f, m, h))) | |
}, function (e) { | |
d || (d = !0, p.resolve(m(e))) | |
}, function (e) { | |
d || p.notify(h(e)) | |
}) | |
}), p.promise | |
}, all: function (e) { | |
var t = a(), n = 0, r = Gt(e) ? [] : {}; | |
return i(e, function (e, o) { | |
n++, c(e).then(function (e) { | |
r.hasOwnProperty(o) || (r[o] = e, --n || t.resolve(r)) | |
}, function (e) { | |
r.hasOwnProperty(o) || t.reject(e) | |
}) | |
}), 0 === n && t.resolve(r), t.promise | |
} | |
} | |
}(function (t) { | |
e.$evalAsync(t) | |
}, t) | |
}] | |
} | |
function rt() { | |
this.$get = ["$window", "$timeout", function (e, t) { | |
var n = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame, | |
r = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.mozCancelAnimationFrame || e.webkitCancelRequestAnimationFrame, | |
o = !!n, i = o ? function (e) { | |
var t = n(e); | |
return function () { | |
r(t) | |
} | |
} : function (e) { | |
var n = t(e, 16.66, !1); | |
return function () { | |
t.cancel(n) | |
} | |
}; | |
return i.supported = o, i | |
}] | |
} | |
function ot() { | |
var e = 10, t = r("$rootScope"), n = null; | |
this.digestTtl = function (t) { | |
return arguments.length && (e = t), e | |
}, this.$get = ["$injector", "$exceptionHandler", "$parse", "$browser", function (r, a, c, l) { | |
function u() { | |
this.$id = s(), this.$$phase = this.$parent = this.$$watchers = this.$$nextSibling = this.$$prevSibling = this.$$childHead = this.$$childTail = null, this.this = this.$root = this, this.$$destroyed = !1, this.$$asyncQueue = [], this.$$postDigestQueue = [], this.$$listeners = {}, this.$$listenerCount = {}, this.$$isolateBindings = {} | |
} | |
function d(e) { | |
if (g.$$phase) throw t("inprog", g.$$phase); | |
g.$$phase = e | |
} | |
function p(e, t) { | |
var n = c(e); | |
return Y(n, t), n | |
} | |
function m(e, t, n) { | |
do { | |
e.$$listenerCount[n] -= t, 0 === e.$$listenerCount[n] && delete e.$$listenerCount[n] | |
} while (e = e.$parent) | |
} | |
function h() { | |
} | |
u.prototype = { | |
constructor: u, $new: function (e) { | |
return e ? ((e = new u).$root = this.$root, e.$$asyncQueue = this.$$asyncQueue, e.$$postDigestQueue = this.$$postDigestQueue) : (this.$$childScopeClass || (this.$$childScopeClass = function () { | |
this.$$watchers = this.$$nextSibling = this.$$childHead = this.$$childTail = null, this.$$listeners = {}, this.$$listenerCount = {}, this.$id = s(), this.$$childScopeClass = null | |
}, this.$$childScopeClass.prototype = this), e = new this.$$childScopeClass), e.this = e, e.$parent = this, e.$$prevSibling = this.$$childTail, this.$$childHead ? this.$$childTail = this.$$childTail.$$nextSibling = e : this.$$childHead = this.$$childTail = e, e | |
}, $watch: function (e, t, r) { | |
var o = p(e, "watch"), i = this.$$watchers, a = {fn: t, last: h, get: o, exp: e, eq: !!r}; | |
if (n = null, !_(t)) { | |
var c = p(t || f, "listener"); | |
a.fn = function (e, t, n) { | |
c(n) | |
} | |
} | |
if ("string" == typeof e && o.constant) { | |
var s = a.fn; | |
a.fn = function (e, t, n) { | |
s.call(this, e, t, n), P(i, a) | |
} | |
} | |
return i || (i = this.$$watchers = []), i.unshift(a), function () { | |
P(i, a), n = null | |
} | |
}, $watchCollection: function (e, t) { | |
var n, r, i, a = this, s = 1 < t.length, l = 0, u = c(e), d = [], p = {}, f = !0, m = 0; | |
return this.$watch(function () { | |
var e, t; | |
if (y(n = u(a))) if (o(n)) for (r !== d && (m = (r = d).length = 0, l++), e = n.length, m !== e && (l++, r.length = m = e), t = 0; t < e; t++) r[t] != r[t] && n[t] != n[t] || r[t] === n[t] || (l++, r[t] = n[t]); else { | |
for (t in r !== p && (r = p = {}, m = 0, l++), e = 0, n) n.hasOwnProperty(t) && (e++, r.hasOwnProperty(t) ? r[t] != r[t] && n[t] != n[t] || r[t] === n[t] || (l++, r[t] = n[t]) : (m++, r[t] = n[t], l++)); | |
if (m > e) for (t in l++, r) r.hasOwnProperty(t) && !n.hasOwnProperty(t) && (m--, delete r[t]) | |
} else r !== n && (r = n, l++); | |
return l | |
}, function () { | |
if (f ? (f = !1, t(n, n, a)) : t(n, i, a), s) if (y(n)) if (o(n)) { | |
i = Array(n.length); | |
for (var e = 0; e < n.length; e++) i[e] = n[e] | |
} else for (e in i = {}, n) Ft.call(n, e) && (i[e] = n[e]); else i = n | |
}) | |
}, $digest: function () { | |
var r, o, i, c, s, l, u, p, f, m, v = this.$$asyncQueue, y = this.$$postDigestQueue, | |
E = e, C = []; | |
d("$digest"), n = null; | |
do { | |
for (l = !1, u = this; v.length;) { | |
try { | |
(m = v.shift()).scope.$eval(m.expression) | |
} catch (e) { | |
g.$$phase = null, a(e) | |
} | |
n = null | |
} | |
e:do { | |
if (c = u.$$watchers) for (s = c.length; s--;) try { | |
if (r = c[s]) if ((o = r.get(u)) === (i = r.last) || (r.eq ? I(o, i) : "number" == typeof o && "number" == typeof i && isNaN(o) && isNaN(i))) { | |
if (r === n) { | |
l = !1; | |
break e | |
} | |
} else l = !0, n = r, r.last = r.eq ? $(o, null) : o, r.fn(o, i === h ? o : i, u), 5 > E && (C[p = 4 - E] || (C[p] = []), f = _(r.exp) ? "fn: " + (r.exp.name || r.exp.toString()) : r.exp, f += "; newVal: " + x(o) + "; oldVal: " + x(i), C[p].push(f)) | |
} catch (e) { | |
g.$$phase = null, a(e) | |
} | |
if (!(c = u.$$childHead || u !== this && u.$$nextSibling)) for (; u !== this && !(c = u.$$nextSibling);) u = u.$parent | |
} while (u = c); | |
if ((l || v.length) && !E--) throw g.$$phase = null, t("infdig", e, x(C)) | |
} while (l || v.length); | |
for (g.$$phase = null; y.length;) try { | |
y.shift()() | |
} catch (e) { | |
a(e) | |
} | |
}, $destroy: function () { | |
if (!this.$$destroyed) { | |
var e = this.$parent; | |
this.$broadcast("$destroy"), this.$$destroyed = !0, this !== g && (i(this.$$listenerCount, N(null, m, this)), e.$$childHead == this && (e.$$childHead = this.$$nextSibling), e.$$childTail == this && (e.$$childTail = this.$$prevSibling), this.$$prevSibling && (this.$$prevSibling.$$nextSibling = this.$$nextSibling), this.$$nextSibling && (this.$$nextSibling.$$prevSibling = this.$$prevSibling), this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead = this.$$childTail = this.$root = null, this.$$listeners = {}, this.$$watchers = this.$$asyncQueue = this.$$postDigestQueue = [], this.$destroy = this.$digest = this.$apply = f, this.$on = this.$watch = function () { | |
return f | |
}) | |
} | |
}, $eval: function (e, t) { | |
return c(e)(this, t) | |
}, $evalAsync: function (e) { | |
g.$$phase || g.$$asyncQueue.length || l.defer(function () { | |
g.$$asyncQueue.length && g.$digest() | |
}), this.$$asyncQueue.push({scope: this, expression: e}) | |
}, $$postDigest: function (e) { | |
this.$$postDigestQueue.push(e) | |
}, $apply: function (e) { | |
try { | |
return d("$apply"), this.$eval(e) | |
} catch (e) { | |
a(e) | |
} finally { | |
g.$$phase = null; | |
try { | |
g.$digest() | |
} catch (e) { | |
throw a(e), e | |
} | |
} | |
}, $on: function (e, t) { | |
var n = this.$$listeners[e]; | |
n || (this.$$listeners[e] = n = []), n.push(t); | |
var r = this; | |
do { | |
r.$$listenerCount[e] || (r.$$listenerCount[e] = 0), r.$$listenerCount[e]++ | |
} while (r = r.$parent); | |
var o = this; | |
return function () { | |
n[A(n, t)] = null, m(o, 1, e) | |
} | |
}, $emit: function (e, t) { | |
var n, r, o, i = [], c = this, s = !1, l = { | |
name: e, targetScope: c, stopPropagation: function () { | |
s = !0 | |
}, preventDefault: function () { | |
l.defaultPrevented = !0 | |
}, defaultPrevented: !1 | |
}, u = [l].concat(Bt.call(arguments, 1)); | |
do { | |
for (n = c.$$listeners[e] || i, l.currentScope = c, r = 0, o = n.length; r < o; r++) if (n[r]) try { | |
n[r].apply(null, u) | |
} catch (e) { | |
a(e) | |
} else n.splice(r, 1), r--, o--; | |
if (s) break; | |
c = c.$parent | |
} while (c); | |
return l | |
}, $broadcast: function (e, t) { | |
for (var n, r, o = this, i = this, c = { | |
name: e, | |
targetScope: this, | |
preventDefault: function () { | |
c.defaultPrevented = !0 | |
}, | |
defaultPrevented: !1 | |
}, s = [c].concat(Bt.call(arguments, 1)); o = i;) { | |
for (c.currentScope = o, n = 0, r = (i = o.$$listeners[e] || []).length; n < r; n++) if (i[n]) try { | |
i[n].apply(null, s) | |
} catch (e) { | |
a(e) | |
} else i.splice(n, 1), n--, r--; | |
if (!(i = o.$$listenerCount[e] && o.$$childHead || o !== this && o.$$nextSibling)) for (; o !== this && !(i = o.$$nextSibling);) o = o.$parent | |
} | |
return c | |
} | |
}; | |
var g = new u; | |
return g | |
}] | |
} | |
function it() { | |
var e = /^\s*(https?|ftp|mailto|tel|file):/, t = /^\s*(https?|ftp|file):|data:image\//; | |
this.aHrefSanitizationWhitelist = function (t) { | |
return v(t) ? (e = t, this) : e | |
}, this.imgSrcSanitizationWhitelist = function (e) { | |
return v(e) ? (t = e, this) : t | |
}, this.$get = function () { | |
return function (n, r) { | |
var o, i = r ? t : e; | |
return Dt && !(8 <= Dt) || ("" === (o = dt(n).href) || o.match(i)) ? n : "unsafe:" + o | |
} | |
} | |
} | |
function at(e) { | |
var t = []; | |
return v(e) && i(e, function (e) { | |
t.push(function (e) { | |
if ("self" === e) return e; | |
if (E(e)) { | |
if (-1 < e.indexOf("***")) throw Vn("iwcard", e); | |
return e = e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1").replace(/\x08/g, "\\x08").replace("\\*\\*", ".*").replace("\\*", "[^:/.?&;]*"), RegExp("^" + e + "$") | |
} | |
if (S(e)) return RegExp("^" + e.source + "$"); | |
throw Vn("imatcher") | |
}(e)) | |
}), t | |
} | |
function ct() { | |
this.SCE_CONTEXTS = Fn; | |
var e = ["self"], t = []; | |
this.resourceUrlWhitelist = function (t) { | |
return arguments.length && (e = at(t)), e | |
}, this.resourceUrlBlacklist = function (e) { | |
return arguments.length && (t = at(e)), t | |
}, this.$get = ["$injector", function (r) { | |
function o(e) { | |
var t = function (e) { | |
this.$$unwrapTrustedValue = function () { | |
return e | |
} | |
}; | |
return e && (t.prototype = new e), t.prototype.valueOf = function () { | |
return this.$$unwrapTrustedValue() | |
}, t.prototype.toString = function () { | |
return this.$$unwrapTrustedValue().toString() | |
}, t | |
} | |
var i = function (e) { | |
throw Vn("unsafe") | |
}; | |
r.has("$sanitize") && (i = r.get("$sanitize")); | |
var a = o(), c = {}; | |
return c[Fn.HTML] = o(a), c[Fn.CSS] = o(a), c[Fn.URL] = o(a), c[Fn.JS] = o(a), c[Fn.RESOURCE_URL] = o(c[Fn.URL]), { | |
trustAs: function (e, t) { | |
var r = c.hasOwnProperty(e) ? c[e] : null; | |
if (!r) throw Vn("icontext", e, t); | |
if (null === t || t === n || "" === t) return t; | |
if ("string" != typeof t) throw Vn("itype", e); | |
return new r(t) | |
}, getTrusted: function (r, o) { | |
if (null === o || o === n || "" === o) return o; | |
if ((l = c.hasOwnProperty(r) ? c[r] : null) && o instanceof l) return o.$$unwrapTrustedValue(); | |
if (r === Fn.RESOURCE_URL) { | |
var a, s, l = dt(o.toString()), u = !1; | |
for (a = 0, s = e.length; a < s; a++) if ("self" === e[a] ? pt(l) : e[a].exec(l.href)) { | |
u = !0; | |
break | |
} | |
if (u) for (a = 0, s = t.length; a < s; a++) if ("self" === t[a] ? pt(l) : t[a].exec(l.href)) { | |
u = !1; | |
break | |
} | |
if (u) return o; | |
throw Vn("insecurl", o.toString()) | |
} | |
if (r === Fn.HTML) return i(o); | |
throw Vn("unsafe") | |
}, valueOf: function (e) { | |
return e instanceof a ? e.$$unwrapTrustedValue() : e | |
} | |
} | |
}] | |
} | |
function st() { | |
var e = !0; | |
this.enabled = function (t) { | |
return arguments.length && (e = !!t), e | |
}, this.$get = ["$parse", "$sniffer", "$sceDelegate", function (t, n, r) { | |
if (e && n.msie && 8 > n.msieDocumentMode) throw Vn("iequirks"); | |
var o = k(Fn); | |
o.isEnabled = function () { | |
return e | |
}, o.trustAs = r.trustAs, o.getTrusted = r.getTrusted, o.valueOf = r.valueOf, e || (o.trustAs = o.getTrusted = function (e, t) { | |
return t | |
}, o.valueOf = m), o.parseAs = function (e, n) { | |
var r = t(n); | |
return r.literal && r.constant ? r : function (t, n) { | |
return o.getTrusted(e, r(t, n)) | |
} | |
}; | |
var a = o.parseAs, c = o.getTrusted, s = o.trustAs; | |
return i(Fn, function (e, t) { | |
var n = Vt(t); | |
o[K("parse_as_" + n)] = function (t) { | |
return a(e, t) | |
}, o[K("get_trusted_" + n)] = function (t) { | |
return c(e, t) | |
}, o[K("trust_as_" + n)] = function (t) { | |
return s(e, t) | |
} | |
}), o | |
}] | |
} | |
function lt() { | |
this.$get = ["$window", "$document", function (e, t) { | |
var n, r = {}, o = d((/android (\d+)/.exec(Vt((e.navigator || {}).userAgent)) || [])[1]), | |
i = /Boxee/i.test((e.navigator || {}).userAgent), a = t[0] || {}, c = a.documentMode, | |
s = /^(Moz|webkit|O|ms)(?=[A-Z])/, l = a.body && a.body.style, u = !1, p = !1; | |
if (l) { | |
for (var f in l) if (u = s.exec(f)) { | |
n = (n = u[0]).substr(0, 1).toUpperCase() + n.substr(1); | |
break | |
} | |
n || (n = "WebkitOpacity" in l && "webkit"), u = !!("transition" in l || n + "Transition" in l), p = !!("animation" in l || n + "Animation" in l), !o || u && p || (u = E(a.body.style.webkitTransition), p = E(a.body.style.webkitAnimation)) | |
} | |
return { | |
history: !(!e.history || !e.history.pushState || 4 > o || i), | |
hashchange: "onhashchange" in e && (!c || 7 < c), | |
hasEvent: function (e) { | |
if ("input" == e && 9 == Dt) return !1; | |
if (g(r[e])) { | |
var t = a.createElement("div"); | |
r[e] = "on" + e in t | |
} | |
return r[e] | |
}, | |
csp: Kt(), | |
vendorPrefix: n, | |
transitions: u, | |
animations: p, | |
android: o, | |
msie: Dt, | |
msieDocumentMode: c | |
} | |
}] | |
} | |
function ut() { | |
this.$get = ["$rootScope", "$browser", "$q", "$exceptionHandler", function (e, t, n, r) { | |
function o(o, a, c) { | |
var s = n.defer(), l = s.promise, u = v(c) && !c; | |
return a = t.defer(function () { | |
try { | |
s.resolve(o()) | |
} catch (e) { | |
s.reject(e), r(e) | |
} finally { | |
delete i[l.$$timeoutId] | |
} | |
u || e.$apply() | |
}, a), l.$$timeoutId = a, i[a] = s, l | |
} | |
var i = {}; | |
return o.cancel = function (e) { | |
return !!(e && e.$$timeoutId in i) && (i[e.$$timeoutId].reject("canceled"), delete i[e.$$timeoutId], t.defer.cancel(e.$$timeoutId)) | |
}, o | |
}] | |
} | |
function dt(e, t) { | |
var n = e; | |
return Dt && (Un.setAttribute("href", n), n = Un.href), Un.setAttribute("href", n), { | |
href: Un.href, | |
protocol: Un.protocol ? Un.protocol.replace(/:$/, "") : "", | |
host: Un.host, | |
search: Un.search ? Un.search.replace(/^\?/, "") : "", | |
hash: Un.hash ? Un.hash.replace(/^#/, "") : "", | |
hostname: Un.hostname, | |
port: Un.port, | |
pathname: "/" === Un.pathname.charAt(0) ? Un.pathname : "/" + Un.pathname | |
} | |
} | |
function pt(e) { | |
return (e = E(e) ? dt(e) : e).protocol === Bn.protocol && e.host === Bn.host | |
} | |
function ft() { | |
this.$get = h(e) | |
} | |
function mt(e) { | |
function t(r, o) { | |
if (y(r)) { | |
var a = {}; | |
return i(r, function (e, n) { | |
a[n] = t(n, e) | |
}), a | |
} | |
return e.factory(r + n, o) | |
} | |
var n = "Filter"; | |
this.register = t, this.$get = ["$injector", function (e) { | |
return function (t) { | |
return e.get(t + n) | |
} | |
}], t("currency", gt), t("date", _t), t("filter", ht), t("json", St), t("limitTo", wt), t("lowercase", qn), t("number", vt), t("orderBy", bt), t("uppercase", Gn) | |
} | |
function ht() { | |
return function (e, t, n) { | |
if (!Gt(e)) return e; | |
var r = typeof n, o = []; | |
o.check = function (e) { | |
for (var t = 0; t < o.length; t++) if (!o[t](e)) return !1; | |
return !0 | |
}, "function" !== r && (n = "boolean" === r && n ? function (e, t) { | |
return Yt.equals(e, t) | |
} : function (e, t) { | |
if (e && t && "object" == typeof e && "object" == typeof t) { | |
for (var r in e) if ("$" !== r.charAt(0) && Ft.call(e, r) && n(e[r], t[r])) return !0; | |
return !1 | |
} | |
return t = ("" + t).toLowerCase(), -1 < ("" + e).toLowerCase().indexOf(t) | |
}); | |
var i = function (e, t) { | |
if ("string" == typeof t && "!" === t.charAt(0)) return !i(e, t.substr(1)); | |
switch (typeof e) { | |
case"boolean": | |
case"number": | |
case"string": | |
return n(e, t); | |
case"object": | |
switch (typeof t) { | |
case"object": | |
return n(e, t); | |
default: | |
for (var r in e) if ("$" !== r.charAt(0) && i(e[r], t)) return !0 | |
} | |
return !1; | |
case"array": | |
for (r = 0; r < e.length; r++) if (i(e[r], t)) return !0; | |
return !1; | |
default: | |
return !1 | |
} | |
}; | |
switch (typeof t) { | |
case"boolean": | |
case"number": | |
case"string": | |
t = {$: t}; | |
case"object": | |
for (var a in t) !function (e) { | |
void 0 !== t[e] && o.push(function (n) { | |
return i("$" == e ? n : n && n[e], t[e]) | |
}) | |
}(a); | |
break; | |
case"function": | |
o.push(t); | |
break; | |
default: | |
return e | |
} | |
for (r = [], a = 0; a < e.length; a++) { | |
var c = e[a]; | |
o.check(c) && r.push(c) | |
} | |
return r | |
} | |
} | |
function gt(e) { | |
var t = e.NUMBER_FORMATS; | |
return function (e, n) { | |
return g(n) && (n = t.CURRENCY_SYM), yt(e, t.PATTERNS[1], t.GROUP_SEP, t.DECIMAL_SEP, 2).replace(/\u00A4/g, n) | |
} | |
} | |
function vt(e) { | |
var t = e.NUMBER_FORMATS; | |
return function (e, n) { | |
return yt(e, t.PATTERNS[0], t.GROUP_SEP, t.DECIMAL_SEP, n) | |
} | |
} | |
function yt(e, t, n, r, o) { | |
if (null == e || !isFinite(e) || y(e)) return ""; | |
var i = 0 > e, a = (e = Math.abs(e)) + "", c = "", s = [], l = !1; | |
-1 !== a.indexOf("e") && ((u = a.match(/([\d\.]+)e(-?)(\d+)/)) && "-" == u[2] && u[3] > o + 1 ? (a = "0", e = 0) : (c = a, l = !0)); | |
if (l) 0 < o && -1 < e && 1 > e && (c = e.toFixed(o)); else { | |
a = (a.split(Hn)[1] || "").length, g(o) && (o = Math.min(Math.max(t.minFrac, a), t.maxFrac)), a = (e = ("" + (e = +(Math.round(+(e.toString() + "e" + o)).toString() + "e" + -o))).split(Hn))[0], e = e[1] || ""; | |
var u = 0, d = t.lgSize, p = t.gSize; | |
if (a.length >= d + p) for (u = a.length - d, l = 0; l < u; l++) 0 == (u - l) % p && 0 !== l && (c += n), c += a.charAt(l); | |
for (l = u; l < a.length; l++) 0 == (a.length - l) % d && 0 !== l && (c += n), c += a.charAt(l); | |
for (; e.length < o;) e += "0"; | |
o && "0" !== o && (c += r + e.substr(0, o)) | |
} | |
return s.push(i ? t.negPre : t.posPre), s.push(c), s.push(i ? t.negSuf : t.posSuf), s.join("") | |
} | |
function Et(e, t, n) { | |
var r = ""; | |
for (0 > e && (r = "-", e = -e), e = "" + e; e.length < t;) e = "0" + e; | |
return n && (e = e.substr(e.length - t)), r + e | |
} | |
function Ct(e, t, n, r) { | |
return n = n || 0, function (o) { | |
return o = o["get" + e](), (0 < n || o > -n) && (o += n), 0 === o && -12 == n && (o = 12), Et(o, t, r) | |
} | |
} | |
function Tt(e, t) { | |
return function (n, r) { | |
var o = n["get" + e](); | |
return r[Ut(t ? "SHORT" + e : e)][o] | |
} | |
} | |
function _t(e) { | |
function t(e) { | |
var t; | |
if (t = e.match(n)) { | |
e = new Date(0); | |
var r = 0, o = 0, i = t[8] ? e.setUTCFullYear : e.setFullYear, | |
a = t[8] ? e.setUTCHours : e.setHours; | |
t[9] && (r = d(t[9] + t[10]), o = d(t[9] + t[11])), i.call(e, d(t[1]), d(t[2]) - 1, d(t[3])), r = d(t[4] || 0) - r, o = d(t[5] || 0) - o, i = d(t[6] || 0), t = Math.round(1e3 * parseFloat("0." + (t[7] || 0))), a.call(e, r, o, i, t) | |
} | |
return e | |
} | |
var n = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; | |
return function (n, r) { | |
var o, a, c = "", s = []; | |
if (r = r || "mediumDate", r = e.DATETIME_FORMATS[r] || r, E(n) && (n = Yn.test(n) ? d(n) : t(n)), C(n) && (n = new Date(n)), !T(n)) return n; | |
for (; r;) (a = jn.exec(r)) ? r = (s = s.concat(Bt.call(a, 1))).pop() : (s.push(r), r = null); | |
return i(s, function (t) { | |
o = Wn[t], c += o ? o(n, e.DATETIME_FORMATS) : t.replace(/(^'|'$)/g, "").replace(/''/g, "'") | |
}), c | |
} | |
} | |
function St() { | |
return function (e) { | |
return x(e, !0) | |
} | |
} | |
function wt() { | |
return function (e, t) { | |
if (!Gt(e) && !E(e)) return e; | |
if (t = 1 / 0 === Math.abs(Number(t)) ? Number(t) : d(t), E(e)) return t ? 0 <= t ? e.slice(0, t) : e.slice(t, e.length) : ""; | |
var n, r, o = []; | |
for (t > e.length ? t = e.length : t < -e.length && (t = -e.length), 0 < t ? (n = 0, r = t) : (n = e.length + t, r = e.length); n < r; n++) o.push(e[n]); | |
return o | |
} | |
} | |
function bt(e) { | |
return function (t, n, r) { | |
function o(e, t) { | |
return M(t) ? function (t, n) { | |
return e(n, t) | |
} : e | |
} | |
function a(e, t) { | |
var n = typeof e, r = typeof t; | |
return n == r ? (T(e) && T(t) && (e = e.valueOf(), t = t.valueOf()), "string" == n && (e = e.toLowerCase(), t = t.toLowerCase()), e === t ? 0 : e < t ? -1 : 1) : n < r ? -1 : 1 | |
} | |
if (!Gt(t) || !n) return t; | |
n = function (e, t, n) { | |
var r = []; | |
return i(e, function (e, o, i) { | |
r.push(t.call(n, e, o, i)) | |
}), r | |
}(n = Gt(n) ? n : [n], function (t) { | |
var n = !1, r = t || m; | |
if (E(t) && ("+" != t.charAt(0) && "-" != t.charAt(0) || (n = "-" == t.charAt(0), t = t.substring(1)), (r = e(t)).constant)) { | |
var i = r(); | |
return o(function (e, t) { | |
return a(e[i], t[i]) | |
}, n) | |
} | |
return o(function (e, t) { | |
return a(r(e), r(t)) | |
}, n) | |
}); | |
for (var c = [], s = 0; s < t.length; s++) c.push(t[s]); | |
return c.sort(o(function (e, t) { | |
for (var r = 0; r < n.length; r++) { | |
var o = n[r](e, t); | |
if (0 !== o) return o | |
} | |
return 0 | |
}, r)) | |
} | |
} | |
function At(e) { | |
return _(e) && (e = {link: e}), e.restrict = e.restrict || "AC", h(e) | |
} | |
function Pt(e, t, n, r) { | |
function o(t, n) { | |
n = n ? "-" + W(n, "-") : "", r.removeClass(e, (t ? cr : ar) + n), r.addClass(e, (t ? ar : cr) + n) | |
} | |
var a = this, c = e.parent().controller("form") || Zn, s = 0, l = a.$error = {}, u = []; | |
a.$name = t.name || t.ngForm, a.$dirty = !1, a.$pristine = !0, a.$valid = !0, a.$invalid = !1, c.$addControl(a), e.addClass(sr), o(!0), a.$addControl = function (e) { | |
q(e.$name, "input"), u.push(e), e.$name && (a[e.$name] = e) | |
}, a.$removeControl = function (e) { | |
e.$name && a[e.$name] === e && delete a[e.$name], i(l, function (t, n) { | |
a.$setValidity(n, !0, e) | |
}), P(u, e) | |
}, a.$setValidity = function (e, t, n) { | |
var r = l[e]; | |
if (t) r && (P(r, n), r.length || (--s || (o(t), a.$valid = !0, a.$invalid = !1), l[e] = !1, o(!0, e), c.$setValidity(e, !0, a))); else { | |
if (s || o(t), r) { | |
if (-1 != A(r, n)) return | |
} else l[e] = r = [], s++, o(!1, e), c.$setValidity(e, !1, a); | |
r.push(n), a.$valid = !1, a.$invalid = !0 | |
} | |
}, a.$setDirty = function () { | |
r.removeClass(e, sr), r.addClass(e, lr), a.$dirty = !0, a.$pristine = !1, c.$setDirty() | |
}, a.$setPristine = function () { | |
r.removeClass(e, lr), r.addClass(e, sr), a.$dirty = !1, a.$pristine = !0, i(u, function (e) { | |
e.$setPristine() | |
}) | |
} | |
} | |
function $t(e, t, r, o) { | |
return e.$setValidity(t, r), r ? o : n | |
} | |
function kt(e, t) { | |
var n; | |
if (t) for (n = 0; n < t.length; ++n) if (e[t[n]]) return !0; | |
return !1 | |
} | |
function It(e, t, n, o, i, a) { | |
var c = t.prop(Lt), s = t[0].placeholder, l = {}; | |
if (o.$$validityState = c, !i.android) { | |
var u = !1; | |
t.on("compositionstart", function (e) { | |
u = !0 | |
}), t.on("compositionend", function () { | |
u = !1, p() | |
}) | |
} | |
var p = function (r) { | |
if (!u) { | |
var i = t.val(); | |
Dt && "input" === (r || l).type && t[0].placeholder !== s ? s = t[0].placeholder : (M(n.ngTrim || "T") && (i = zt(i)), r = c && o.$$hasNativeValidators, (o.$viewValue !== i || "" === i && r) && (e.$$phase ? o.$setViewValue(i) : e.$apply(function () { | |
o.$setViewValue(i) | |
}))) | |
} | |
}; | |
if (i.hasEvent("input")) t.on("input", p); else { | |
var f, m = function () { | |
f || (f = a.defer(function () { | |
p(), f = null | |
})) | |
}; | |
t.on("keydown", function (e) { | |
91 === (e = e.keyCode) || 15 < e && 19 > e || 37 <= e && 40 >= e || m() | |
}), i.hasEvent("paste") && t.on("paste cut", m) | |
} | |
t.on("change", p), o.$render = function () { | |
t.val(o.$isEmpty(o.$viewValue) ? "" : o.$viewValue) | |
}; | |
var h = n.ngPattern; | |
if (h && ((i = h.match(/^\/(.*)\/([gim]*)$/)) ? (h = RegExp(i[1], i[2]), i = function (e) { | |
return $t(o, "pattern", o.$isEmpty(e) || h.test(e), e) | |
}) : i = function (n) { | |
var i = e.$eval(h); | |
if (!i || !i.test) throw r("ngPattern")("noregexp", h, i, R(t)); | |
return $t(o, "pattern", o.$isEmpty(n) || i.test(n), n) | |
}, o.$formatters.push(i), o.$parsers.push(i)), n.ngMinlength) { | |
var g = d(n.ngMinlength); | |
i = function (e) { | |
return $t(o, "minlength", o.$isEmpty(e) || e.length >= g, e) | |
}, o.$parsers.push(i), o.$formatters.push(i) | |
} | |
if (n.ngMaxlength) { | |
var v = d(n.ngMaxlength); | |
i = function (e) { | |
return $t(o, "maxlength", o.$isEmpty(e) || e.length <= v, e) | |
}, o.$parsers.push(i), o.$formatters.push(i) | |
} | |
} | |
function Nt(e, t) { | |
return e = "ngClass" + e, ["$animate", function (n) { | |
function r(e, t) { | |
var n = [], r = 0; | |
e:for (; r < e.length; r++) { | |
for (var o = e[r], i = 0; i < t.length; i++) if (o == t[i]) continue e; | |
n.push(o) | |
} | |
return n | |
} | |
function o(e) { | |
if (!Gt(e)) { | |
if (E(e)) return e.split(" "); | |
if (y(e)) { | |
var t = []; | |
return i(e, function (e, n) { | |
e && (t = t.concat(n.split(" "))) | |
}), t | |
} | |
} | |
return e | |
} | |
return { | |
restrict: "AC", link: function (a, c, s) { | |
function l(e, t) { | |
var n = c.data("$classCounts") || {}, r = []; | |
return i(e, function (e) { | |
(0 < t || n[e]) && (n[e] = (n[e] || 0) + t, n[e] === +(0 < t) && r.push(e)) | |
}), c.data("$classCounts", n), r.join(" ") | |
} | |
function u(e) { | |
if (!0 === t || a.$index % 2 === t) { | |
var i = o(e || []); | |
if (d) { | |
if (!I(e, d)) { | |
var u = o(d); | |
p = r(i, u), i = l(i = r(u, i), -1); | |
0 === (p = l(p, 1)).length ? n.removeClass(c, i) : 0 === i.length ? n.addClass(c, p) : n.setClass(c, p, i) | |
} | |
} else { | |
var p = l(i, 1); | |
s.$addClass(p) | |
} | |
} | |
d = k(e) | |
} | |
var d; | |
a.$watch(s[e], u, !0), s.$observe("class", function (t) { | |
u(a.$eval(s[e])) | |
}), "ngClass" !== e && a.$watch("$index", function (n, r) { | |
var i = 1 & n; | |
if (i !== (1 & r)) { | |
var c = o(a.$eval(s[e])); | |
i === t ? (i = l(c, 1), s.$addClass(i)) : (i = l(c, -1), s.$removeClass(i)) | |
} | |
}) | |
} | |
} | |
}] | |
} | |
var Dt, xt, Ot, Mt, Rt, Lt = "validity", Vt = function (e) { | |
return E(e) ? e.toLowerCase() : e | |
}, Ft = Object.prototype.hasOwnProperty, Ut = function (e) { | |
return E(e) ? e.toUpperCase() : e | |
}, Bt = [].slice, Ht = [].push, Wt = Object.prototype.toString, jt = r("ng"), | |
Yt = e.angular || (e.angular = {}), qt = ["0", "0", "0"]; | |
Dt = d((/msie (\d+)/.exec(Vt(navigator.userAgent)) || [])[1]), isNaN(Dt) && (Dt = d((/trident\/.*; rv:(\d+)/.exec(Vt(navigator.userAgent)) || [])[1])), f.$inject = [], m.$inject = []; | |
var Gt = _(Array.isArray) ? Array.isArray : function (e) { | |
return "[object Array]" === Wt.call(e) | |
}, zt = String.prototype.trim ? function (e) { | |
return E(e) ? e.trim() : e | |
} : function (e) { | |
return E(e) ? e.replace(/^\s\s*/, "").replace(/\s\s*$/, "") : e | |
}; | |
Rt = 9 > Dt ? function (e) { | |
return (e = e.nodeName ? e : e[0]).scopeName && "HTML" != e.scopeName ? Ut(e.scopeName + ":" + e.nodeName) : e.nodeName | |
} : function (e) { | |
return e.nodeName ? e.nodeName : e[0].nodeName | |
}; | |
var Kt = function () { | |
if (v(Kt.isActive_)) return Kt.isActive_; | |
var e = !(!t.querySelector("[ng-csp]") && !t.querySelector("[data-ng-csp]")); | |
if (!e) try { | |
new Function("") | |
} catch (t) { | |
e = !0 | |
} | |
return Kt.isActive_ = e | |
}, Zt = /[A-Z]/g, Jt = {full: "1.2.22", major: 1, minor: 2, dot: 22, codeName: "finicky-pleasure"}; | |
J.expando = "ng339"; | |
var Qt = J.cache = {}, Xt = 1, en = e.document.addEventListener ? function (e, t, n) { | |
e.addEventListener(t, n, !1) | |
} : function (e, t, n) { | |
e.attachEvent("on" + t, n) | |
}, tn = e.document.removeEventListener ? function (e, t, n) { | |
e.removeEventListener(t, n, !1) | |
} : function (e, t, n) { | |
e.detachEvent("on" + t, n) | |
}; | |
J._data = function (e) { | |
return this.cache[e[this.expando]] || {} | |
}; | |
var nn = /([\:\-\_]+(.))/g, rn = /^moz([A-Z])/, on = r("jqLite"), an = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, | |
cn = /<|&#?\w+;/, sn = /<([\w:]+)/, | |
ln = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, un = { | |
option: [1, '<select multiple="multiple">', "</select>"], | |
thead: [1, "<table>", "</table>"], | |
col: [2, "<table><colgroup>", "</colgroup></table>"], | |
tr: [2, "<table><tbody>", "</tbody></table>"], | |
td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], | |
_default: [0, "", ""] | |
}; | |
un.optgroup = un.option, un.tbody = un.tfoot = un.colgroup = un.caption = un.thead, un.th = un.td; | |
var dn = J.prototype = { | |
ready: function (n) { | |
function r() { | |
o || (o = !0, n()) | |
} | |
var o = !1; | |
"complete" === t.readyState ? setTimeout(r) : (this.on("DOMContentLoaded", r), J(e).on("load", r)) | |
}, toString: function () { | |
var e = []; | |
return i(this, function (t) { | |
e.push("" + t) | |
}), "[" + e.join(", ") + "]" | |
}, eq: function (e) { | |
return xt(0 <= e ? this[e] : this[this.length + e]) | |
}, length: 0, push: Ht, sort: [].sort, splice: [].splice | |
}, pn = {}; | |
i("multiple selected checked disabled readOnly required open".split(" "), function (e) { | |
pn[Vt(e)] = e | |
}); | |
var fn = {}; | |
i("input select option textarea button form details".split(" "), function (e) { | |
fn[Ut(e)] = !0 | |
}), i({data: re, removeData: te}, function (e, t) { | |
J[t] = e | |
}), i({ | |
data: re, inheritedData: le, scope: function (e) { | |
return xt.data(e, "$scope") || le(e.parentNode || e, ["$isolateScope", "$scope"]) | |
}, isolateScope: function (e) { | |
return xt.data(e, "$isolateScope") || xt.data(e, "$isolateScopeNoTemplate") | |
}, controller: se, injector: function (e) { | |
return le(e, "$injector") | |
}, removeAttr: function (e, t) { | |
e.removeAttribute(t) | |
}, hasClass: oe, css: function (e, t, r) { | |
var o; | |
if (t = K(t), !v(r)) return 8 >= Dt && ("" === (o = e.currentStyle && e.currentStyle[t]) && (o = "auto")), o = o || e.style[t], 8 >= Dt && (o = "" === o ? n : o), o; | |
e.style[t] = r | |
}, attr: function (e, t, r) { | |
var o = Vt(t); | |
if (pn[o]) { | |
if (!v(r)) return e[t] || (e.attributes.getNamedItem(t) || f).specified ? o : n; | |
r ? (e[t] = !0, e.setAttribute(t, o)) : (e[t] = !1, e.removeAttribute(o)) | |
} else if (v(r)) e.setAttribute(t, r); else if (e.getAttribute) return null === (e = e.getAttribute(t, 2)) ? n : e | |
}, prop: function (e, t, n) { | |
if (!v(n)) return e[t]; | |
e[t] = n | |
}, text: function () { | |
function e(e, n) { | |
var r = t[e.nodeType]; | |
if (g(n)) return r ? e[r] : ""; | |
e[r] = n | |
} | |
var t = []; | |
return 9 > Dt ? (t[1] = "innerText", t[3] = "nodeValue") : t[1] = t[3] = "textContent", e.$dv = "", e | |
}(), val: function (e, t) { | |
if (g(t)) { | |
if ("SELECT" === Rt(e) && e.multiple) { | |
var n = []; | |
return i(e.options, function (e) { | |
e.selected && n.push(e.value || e.text) | |
}), 0 === n.length ? null : n | |
} | |
return e.value | |
} | |
e.value = t | |
}, html: function (e, t) { | |
if (g(t)) return e.innerHTML; | |
for (var n = 0, r = e.childNodes; n < r.length; n++) X(r[n]); | |
e.innerHTML = t | |
}, empty: ue | |
}, function (e, t) { | |
J.prototype[t] = function (t, r) { | |
var o, i, a = this.length; | |
if (e !== ue && (2 == e.length && e !== oe && e !== se ? t : r) === n) { | |
if (y(t)) { | |
for (o = 0; o < a; o++) if (e === re) e(this[o], t); else for (i in t) e(this[o], i, t[i]); | |
return this | |
} | |
for (a = (o = e.$dv) === n ? Math.min(a, 1) : a, i = 0; i < a; i++) { | |
var c = e(this[i], t, r); | |
o = o ? o + c : c | |
} | |
return o | |
} | |
for (o = 0; o < a; o++) e(this[o], t, r); | |
return this | |
} | |
}), i({ | |
removeData: te, dealoc: X, on: function e(n, r, o, a) { | |
if (v(a)) throw on("onargs"); | |
var c = ne(n, "events"), s = ne(n, "handle"); | |
c || ne(n, "events", c = {}), s || ne(n, "handle", s = function (e, n) { | |
var r = function (r, o) { | |
if (r.preventDefault || (r.preventDefault = function () { | |
r.returnValue = !1 | |
}), r.stopPropagation || (r.stopPropagation = function () { | |
r.cancelBubble = !0 | |
}), r.target || (r.target = r.srcElement || t), g(r.defaultPrevented)) { | |
var a = r.preventDefault; | |
r.preventDefault = function () { | |
r.defaultPrevented = !0, a.call(r) | |
}, r.defaultPrevented = !1 | |
} | |
r.isDefaultPrevented = function () { | |
return r.defaultPrevented || !1 === r.returnValue | |
}, i(k(n[o || r.type] || []), function (t) { | |
t.call(e, r) | |
}), 8 >= Dt ? (r.preventDefault = null, r.stopPropagation = null, r.isDefaultPrevented = null) : (delete r.preventDefault, delete r.stopPropagation, delete r.isDefaultPrevented) | |
}; | |
return r.elem = e, r | |
}(n, c)), i(r.split(" "), function (r) { | |
var i = c[r]; | |
if (!i) { | |
if ("mouseenter" == r || "mouseleave" == r) { | |
var a = t.body.contains || t.body.compareDocumentPosition ? function (e, t) { | |
var n = 9 === e.nodeType ? e.documentElement : e, r = t && t.parentNode; | |
return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r))) | |
} : function (e, t) { | |
if (t) for (; t = t.parentNode;) if (t === e) return !0; | |
return !1 | |
}; | |
c[r] = [], e(n, {mouseleave: "mouseout", mouseenter: "mouseover"}[r], function (e) { | |
var t = e.relatedTarget; | |
t && (t === this || a(this, t)) || s(e, r) | |
}) | |
} else en(n, r, s), c[r] = []; | |
i = c[r] | |
} | |
i.push(o) | |
}) | |
}, off: ee, one: function (e, t, n) { | |
(e = xt(e)).on(t, function r() { | |
e.off(t, n), e.off(t, r) | |
}), e.on(t, n) | |
}, replaceWith: function (e, t) { | |
var n, r = e.parentNode; | |
X(e), i(new J(t), function (t) { | |
n ? r.insertBefore(t, n.nextSibling) : r.replaceChild(t, e), n = t | |
}) | |
}, children: function (e) { | |
var t = []; | |
return i(e.childNodes, function (e) { | |
1 === e.nodeType && t.push(e) | |
}), t | |
}, contents: function (e) { | |
return e.contentDocument || e.childNodes || [] | |
}, append: function (e, t) { | |
i(new J(t), function (t) { | |
1 !== e.nodeType && 11 !== e.nodeType || e.appendChild(t) | |
}) | |
}, prepend: function (e, t) { | |
if (1 === e.nodeType) { | |
var n = e.firstChild; | |
i(new J(t), function (t) { | |
e.insertBefore(t, n) | |
}) | |
} | |
}, wrap: function (e, t) { | |
t = xt(t)[0]; | |
var n = e.parentNode; | |
n && n.replaceChild(t, e), t.appendChild(e) | |
}, remove: function (e) { | |
X(e); | |
var t = e.parentNode; | |
t && t.removeChild(e) | |
}, after: function (e, t) { | |
var n = e, r = e.parentNode; | |
i(new J(t), function (e) { | |
r.insertBefore(e, n.nextSibling), n = e | |
}) | |
}, addClass: ae, removeClass: ie, toggleClass: function (e, t, n) { | |
t && i(t.split(" "), function (t) { | |
var r = n; | |
g(r) && (r = !oe(e, t)), (r ? ae : ie)(e, t) | |
}) | |
}, parent: function (e) { | |
return (e = e.parentNode) && 11 !== e.nodeType ? e : null | |
}, next: function (e) { | |
if (e.nextElementSibling) return e.nextElementSibling; | |
for (e = e.nextSibling; null != e && 1 !== e.nodeType;) e = e.nextSibling; | |
return e | |
}, find: function (e, t) { | |
return e.getElementsByTagName ? e.getElementsByTagName(t) : [] | |
}, clone: Q, triggerHandler: function (e, t, n) { | |
var r, o; | |
r = t.type || t; | |
var a = (ne(e, "events") || {})[r]; | |
a && (r = { | |
preventDefault: function () { | |
this.defaultPrevented = !0 | |
}, isDefaultPrevented: function () { | |
return !0 === this.defaultPrevented | |
}, stopPropagation: f, type: r, target: e | |
}, t.type && (r = u(r, t)), t = k(a), o = n ? [r].concat(n) : [r], i(t, function (t) { | |
t.apply(e, o) | |
})) | |
} | |
}, function (e, t) { | |
J.prototype[t] = function (t, n, r) { | |
for (var o, i = 0; i < this.length; i++) g(o) ? v(o = e(this[i], t, n, r)) && (o = xt(o)) : ce(o, e(this[i], t, n, r)); | |
return v(o) ? o : this | |
}, J.prototype.bind = J.prototype.on, J.prototype.unbind = J.prototype.off | |
}), fe.prototype = { | |
put: function (e, t) { | |
this[pe(e, this.nextUid)] = t | |
}, get: function (e) { | |
return this[pe(e, this.nextUid)] | |
}, remove: function (e) { | |
var t = this[e = pe(e, this.nextUid)]; | |
return delete this[e], t | |
} | |
}; | |
var mn = /^function\s*[^\(]*\(\s*([^\)]*)\)/m, hn = /,/, gn = /^\s*(_?)(\S+?)\1\s*$/, | |
vn = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm, yn = r("$injector"), En = r("$animate"), | |
Cn = ["$provide", function (e) { | |
this.$$selectors = {}, this.register = function (t, n) { | |
var r = t + "-animation"; | |
if (t && "." != t.charAt(0)) throw En("notcsel", t); | |
this.$$selectors[t.substr(1)] = r, e.factory(r, n) | |
}, this.classNameFilter = function (e) { | |
return 1 === arguments.length && (this.$$classNameFilter = e instanceof RegExp ? e : null), this.$$classNameFilter | |
}, this.$get = ["$timeout", "$$asyncCallback", function (e, t) { | |
return { | |
enter: function (e, n, r, o) { | |
r ? r.after(e) : (n && n[0] || (n = r.parent()), n.append(e)), o && t(o) | |
}, leave: function (e, n) { | |
e.remove(), n && t(n) | |
}, move: function (e, t, n, r) { | |
this.enter(e, t, n, r) | |
}, addClass: function (e, n, r) { | |
n = E(n) ? n : Gt(n) ? n.join(" ") : "", i(e, function (e) { | |
ae(e, n) | |
}), r && t(r) | |
}, removeClass: function (e, n, r) { | |
n = E(n) ? n : Gt(n) ? n.join(" ") : "", i(e, function (e) { | |
ie(e, n) | |
}), r && t(r) | |
}, setClass: function (e, n, r, o) { | |
i(e, function (e) { | |
ae(e, n), ie(e, r) | |
}), o && t(o) | |
}, enabled: f | |
} | |
}] | |
}], Tn = r("$compile"); | |
_e.$inject = ["$provide", "$$sanitizeUriProvider"]; | |
var _n = /^(x[\:\-_]|data[\:\-_])/i, Sn = r("$interpolate"), wn = /^([^\?#]*)(\?([^#]*))?(#(.*))?$/, | |
bn = {http: 80, https: 443, ftp: 21}, An = r("$location"); | |
Ye.prototype = je.prototype = We.prototype = { | |
$$html5: !1, | |
$$replace: !1, | |
absUrl: qe("$$absUrl"), | |
url: function (e, t) { | |
if (g(e)) return this.$$url; | |
var n = wn.exec(e); | |
return n[1] && this.path(decodeURIComponent(n[1])), (n[2] || n[1]) && this.search(n[3] || ""), this.hash(n[5] || "", t), this | |
}, | |
protocol: qe("$$protocol"), | |
host: qe("$$host"), | |
port: qe("$$port"), | |
path: Ge("$$path", function (e) { | |
return "/" == e.charAt(0) ? e : "/" + e | |
}), | |
search: function (e, t) { | |
switch (arguments.length) { | |
case 0: | |
return this.$$search; | |
case 1: | |
if (E(e)) this.$$search = V(e); else { | |
if (!y(e)) throw An("isrcharg"); | |
i(e, function (t, n) { | |
null == t && delete e[n] | |
}), this.$$search = e | |
} | |
break; | |
default: | |
g(t) || null === t ? delete this.$$search[e] : this.$$search[e] = t | |
} | |
return this.$$compose(), this | |
}, | |
hash: Ge("$$hash", m), | |
replace: function () { | |
return this.$$replace = !0, this | |
} | |
}; | |
var Pn, $n = r("$parse"), kn = {}, In = Function.prototype.call, Nn = Function.prototype.apply, | |
Dn = Function.prototype.bind, xn = { | |
null: function () { | |
return null | |
}, true: function () { | |
return !0 | |
}, false: function () { | |
return !1 | |
}, undefined: f, "+": function (e, t, r, o) { | |
return r = r(e, t), o = o(e, t), v(r) ? v(o) ? r + o : r : v(o) ? o : n | |
}, "-": function (e, t, n, r) { | |
return n = n(e, t), r = r(e, t), (v(n) ? n : 0) - (v(r) ? r : 0) | |
}, "*": function (e, t, n, r) { | |
return n(e, t) * r(e, t) | |
}, "/": function (e, t, n, r) { | |
return n(e, t) / r(e, t) | |
}, "%": function (e, t, n, r) { | |
return n(e, t) % r(e, t) | |
}, "^": function (e, t, n, r) { | |
return n(e, t) ^ r(e, t) | |
}, "=": f, "===": function (e, t, n, r) { | |
return n(e, t) === r(e, t) | |
}, "!==": function (e, t, n, r) { | |
return n(e, t) !== r(e, t) | |
}, "==": function (e, t, n, r) { | |
return n(e, t) == r(e, t) | |
}, "!=": function (e, t, n, r) { | |
return n(e, t) != r(e, t) | |
}, "<": function (e, t, n, r) { | |
return n(e, t) < r(e, t) | |
}, ">": function (e, t, n, r) { | |
return n(e, t) > r(e, t) | |
}, "<=": function (e, t, n, r) { | |
return n(e, t) <= r(e, t) | |
}, ">=": function (e, t, n, r) { | |
return n(e, t) >= r(e, t) | |
}, "&&": function (e, t, n, r) { | |
return n(e, t) && r(e, t) | |
}, "||": function (e, t, n, r) { | |
return n(e, t) || r(e, t) | |
}, "&": function (e, t, n, r) { | |
return n(e, t) & r(e, t) | |
}, "|": function (e, t, n, r) { | |
return r(e, t)(e, t, n(e, t)) | |
}, "!": function (e, t, n) { | |
return !n(e, t) | |
} | |
}, On = {n: "\n", f: "\f", r: "\r", t: "\t", v: "\v", "'": "'", '"': '"'}, Mn = function (e) { | |
this.options = e | |
}; | |
Mn.prototype = { | |
constructor: Mn, lex: function (e) { | |
for (this.text = e, this.index = 0, this.ch = n, this.lastCh = ":", this.tokens = []; this.index < this.text.length;) { | |
if (this.ch = this.text.charAt(this.index), this.is("\"'")) this.readString(this.ch); else if (this.isNumber(this.ch) || this.is(".") && this.isNumber(this.peek())) this.readNumber(); else if (this.isIdent(this.ch)) this.readIdent(); else if (this.is("(){}[].,;:?")) this.tokens.push({ | |
index: this.index, | |
text: this.ch | |
}), this.index++; else { | |
if (this.isWhitespace(this.ch)) { | |
this.index++; | |
continue | |
} | |
var t = (e = this.ch + this.peek()) + this.peek(2), r = xn[this.ch], o = xn[e], i = xn[t]; | |
i ? (this.tokens.push({ | |
index: this.index, | |
text: t, | |
fn: i | |
}), this.index += 3) : o ? (this.tokens.push({ | |
index: this.index, | |
text: e, | |
fn: o | |
}), this.index += 2) : r ? (this.tokens.push({ | |
index: this.index, | |
text: this.ch, | |
fn: r | |
}), this.index += 1) : this.throwError("Unexpected next character ", this.index, this.index + 1) | |
} | |
this.lastCh = this.ch | |
} | |
return this.tokens | |
}, is: function (e) { | |
return -1 !== e.indexOf(this.ch) | |
}, was: function (e) { | |
return -1 !== e.indexOf(this.lastCh) | |
}, peek: function (e) { | |
return e = e || 1, this.index + e < this.text.length && this.text.charAt(this.index + e) | |
}, isNumber: function (e) { | |
return "0" <= e && "9" >= e | |
}, isWhitespace: function (e) { | |
return " " === e || "\r" === e || "\t" === e || "\n" === e || "\v" === e || "Â " === e | |
}, isIdent: function (e) { | |
return "a" <= e && "z" >= e || "A" <= e && "Z" >= e || "_" === e || "$" === e | |
}, isExpOperator: function (e) { | |
return "-" === e || "+" === e || this.isNumber(e) | |
}, throwError: function (e, t, n) { | |
throw n = n || this.index, t = v(t) ? "s " + t + "-" + this.index + " [" + this.text.substring(t, n) + "]" : " " + n, $n("lexerr", e, t, this.text) | |
}, readNumber: function () { | |
for (var e = "", t = this.index; this.index < this.text.length;) { | |
var n = Vt(this.text.charAt(this.index)); | |
if ("." == n || this.isNumber(n)) e += n; else { | |
var r = this.peek(); | |
if ("e" == n && this.isExpOperator(r)) e += n; else if (this.isExpOperator(n) && r && this.isNumber(r) && "e" == e.charAt(e.length - 1)) e += n; else { | |
if (!this.isExpOperator(n) || r && this.isNumber(r) || "e" != e.charAt(e.length - 1)) break; | |
this.throwError("Invalid exponent") | |
} | |
} | |
this.index++ | |
} | |
e *= 1, this.tokens.push({ | |
index: t, text: e, literal: !0, constant: !0, fn: function () { | |
return e | |
} | |
}) | |
}, readIdent: function () { | |
for (var e, t, n, r, o = this, i = "", a = this.index; this.index < this.text.length && ("." === (r = this.text.charAt(this.index)) || this.isIdent(r) || this.isNumber(r));) "." === r && (e = this.index), i += r, this.index++; | |
if (e) for (t = this.index; t < this.text.length;) { | |
if ("(" === (r = this.text.charAt(t))) { | |
n = i.substr(e - a + 1), i = i.substr(0, e - a), this.index = t; | |
break | |
} | |
if (!this.isWhitespace(r)) break; | |
t++ | |
} | |
if (a = { | |
index: a, | |
text: i | |
}, xn.hasOwnProperty(i)) a.fn = xn[i], a.literal = !0, a.constant = !0; else { | |
var c = et(i, this.options, this.text); | |
a.fn = u(function (e, t) { | |
return c(e, t) | |
}, { | |
assign: function (e, t) { | |
return Qe(e, i, t, o.text, o.options) | |
} | |
}) | |
} | |
this.tokens.push(a), n && (this.tokens.push({ | |
index: e, | |
text: "." | |
}), this.tokens.push({index: e + 1, text: n})) | |
}, readString: function (e) { | |
var t = this.index; | |
this.index++; | |
for (var n = "", r = e, o = !1; this.index < this.text.length;) { | |
var i = this.text.charAt(this.index); | |
r = r + i; | |
if (o) "u" === i ? ((o = this.text.substring(this.index + 1, this.index + 5)).match(/[\da-f]{4}/i) || this.throwError("Invalid unicode escape [\\u" + o + "]"), this.index += 4, n += String.fromCharCode(parseInt(o, 16))) : n += On[i] || i, o = !1; else if ("\\" === i) o = !0; else { | |
if (i === e) return this.index++, void this.tokens.push({ | |
index: t, | |
text: r, | |
string: n, | |
literal: !0, | |
constant: !0, | |
fn: function () { | |
return n | |
} | |
}); | |
n += i | |
} | |
this.index++ | |
} | |
this.throwError("Unterminated quote", t) | |
} | |
}; | |
var Rn = function (e, t, n) { | |
this.lexer = e, this.$filter = t, this.options = n | |
}; | |
Rn.ZERO = u(function () { | |
return 0 | |
}, {constant: !0}), Rn.prototype = { | |
constructor: Rn, parse: function (e) { | |
return this.text = e, this.tokens = this.lexer.lex(e), e = this.statements(), 0 !== this.tokens.length && this.throwError("is an unexpected token", this.tokens[0]), e.literal = !!e.literal, e.constant = !!e.constant, e | |
}, primary: function () { | |
var e, t; | |
if (this.expect("(")) e = this.filterChain(), this.consume(")"); else if (this.expect("[")) e = this.arrayDeclaration(); else if (this.expect("{")) e = this.object(); else { | |
var n = this.expect(); | |
(e = n.fn) || this.throwError("not a primary expression", n), e.literal = !!n.literal, e.constant = !!n.constant | |
} | |
for (; n = this.expect("(", "[", ".");) "(" === n.text ? (e = this.functionCall(e, t), t = null) : "[" === n.text ? (t = e, e = this.objectIndex(e)) : "." === n.text ? (t = e, e = this.fieldAccess(e)) : this.throwError("IMPOSSIBLE"); | |
return e | |
}, throwError: function (e, t) { | |
throw $n("syntax", t.text, e, t.index + 1, this.text, this.text.substring(t.index)) | |
}, peekToken: function () { | |
if (0 === this.tokens.length) throw $n("ueoe", this.text); | |
return this.tokens[0] | |
}, peek: function (e, t, n, r) { | |
if (0 < this.tokens.length) { | |
var o = this.tokens[0], i = o.text; | |
if (i === e || i === t || i === n || i === r || !(e || t || n || r)) return o | |
} | |
return !1 | |
}, expect: function (e, t, n, r) { | |
return !!(e = this.peek(e, t, n, r)) && (this.tokens.shift(), e) | |
}, consume: function (e) { | |
this.expect(e) || this.throwError("is unexpected, expecting [" + e + "]", this.peek()) | |
}, unaryFn: function (e, t) { | |
return u(function (n, r) { | |
return e(n, r, t) | |
}, {constant: t.constant}) | |
}, ternaryFn: function (e, t, n) { | |
return u(function (r, o) { | |
return e(r, o) ? t(r, o) : n(r, o) | |
}, {constant: e.constant && t.constant && n.constant}) | |
}, binaryFn: function (e, t, n) { | |
return u(function (r, o) { | |
return t(r, o, e, n) | |
}, {constant: e.constant && n.constant}) | |
}, statements: function () { | |
for (var e = []; ;) if (0 < this.tokens.length && !this.peek("}", ")", ";", "]") && e.push(this.filterChain()), !this.expect(";")) return 1 === e.length ? e[0] : function (t, n) { | |
for (var r, o = 0; o < e.length; o++) { | |
var i = e[o]; | |
i && (r = i(t, n)) | |
} | |
return r | |
} | |
}, filterChain: function () { | |
for (var e, t = this.expression(); ;) { | |
if (!(e = this.expect("|"))) return t; | |
t = this.binaryFn(t, e.fn, this.filter()) | |
} | |
}, filter: function () { | |
for (var e = this.expect(), t = this.$filter(e.text), n = []; ;) { | |
if (!(e = this.expect(":"))) { | |
var r = function (e, r, o) { | |
o = [o]; | |
for (var i = 0; i < n.length; i++) o.push(n[i](e, r)); | |
return t.apply(e, o) | |
}; | |
return function () { | |
return r | |
} | |
} | |
n.push(this.expression()) | |
} | |
}, expression: function () { | |
return this.assignment() | |
}, assignment: function () { | |
var e, t, n = this.ternary(); | |
return (t = this.expect("=")) ? (n.assign || this.throwError("implies assignment but [" + this.text.substring(0, t.index) + "] can not be assigned to", t), e = this.ternary(), function (t, r) { | |
return n.assign(t, e(t, r), r) | |
}) : n | |
}, ternary: function () { | |
var e, t, n = this.logicalOR(); | |
return this.expect("?") ? (e = this.assignment(), (t = this.expect(":")) ? this.ternaryFn(n, e, this.assignment()) : void this.throwError("expected :", t)) : n | |
}, logicalOR: function () { | |
for (var e, t = this.logicalAND(); ;) { | |
if (!(e = this.expect("||"))) return t; | |
t = this.binaryFn(t, e.fn, this.logicalAND()) | |
} | |
}, logicalAND: function () { | |
var e, t = this.equality(); | |
return (e = this.expect("&&")) && (t = this.binaryFn(t, e.fn, this.logicalAND())), t | |
}, equality: function () { | |
var e, t = this.relational(); | |
return (e = this.expect("==", "!=", "===", "!==")) && (t = this.binaryFn(t, e.fn, this.equality())), t | |
}, relational: function () { | |
var e, t = this.additive(); | |
return (e = this.expect("<", ">", "<=", ">=")) && (t = this.binaryFn(t, e.fn, this.relational())), t | |
}, additive: function () { | |
for (var e, t = this.multiplicative(); e = this.expect("+", "-");) t = this.binaryFn(t, e.fn, this.multiplicative()); | |
return t | |
}, multiplicative: function () { | |
for (var e, t = this.unary(); e = this.expect("*", "/", "%");) t = this.binaryFn(t, e.fn, this.unary()); | |
return t | |
}, unary: function () { | |
var e; | |
return this.expect("+") ? this.primary() : (e = this.expect("-")) ? this.binaryFn(Rn.ZERO, e.fn, this.unary()) : (e = this.expect("!")) ? this.unaryFn(e.fn, this.unary()) : this.primary() | |
}, fieldAccess: function (e) { | |
var t = this, n = this.expect().text, r = et(n, this.options, this.text); | |
return u(function (t, n, o) { | |
return r(o || e(t, n)) | |
}, { | |
assign: function (r, o, i) { | |
return (i = e(r, i)) || e.assign(r, i = {}), Qe(i, n, o, t.text, t.options) | |
} | |
}) | |
}, objectIndex: function (e) { | |
var t = this, r = this.expression(); | |
return this.consume("]"), u(function (o, i) { | |
var a, c = e(o, i), s = r(o, i); | |
return Ze(s, t.text), c ? ((c = Je(c[s], t.text)) && c.then && t.options.unwrapPromises && (a = c, "$$v" in c || (a.$$v = n, a.then(function (e) { | |
a.$$v = e | |
})), c = c.$$v), c) : n | |
}, { | |
assign: function (n, o, i) { | |
var a = Ze(r(n, i), t.text); | |
return (i = Je(e(n, i), t.text)) || e.assign(n, i = {}), i[a] = o | |
} | |
}) | |
}, functionCall: function (e, t) { | |
var n = []; | |
if (")" !== this.peekToken().text) do { | |
n.push(this.expression()) | |
} while (this.expect(",")); | |
this.consume(")"); | |
var r = this; | |
return function (o, i) { | |
for (var a = [], c = t ? t(o, i) : o, s = 0; s < n.length; s++) a.push(n[s](o, i)); | |
s = e(o, i, c) || f, Je(c, r.text); | |
var l = r.text; | |
if (s) { | |
if (s.constructor === s) throw $n("isecfn", l); | |
if (s === In || s === Nn || Dn && s === Dn) throw $n("isecff", l) | |
} | |
return Je(a = s.apply ? s.apply(c, a) : s(a[0], a[1], a[2], a[3], a[4]), r.text) | |
} | |
}, arrayDeclaration: function () { | |
var e = [], t = !0; | |
if ("]" !== this.peekToken().text) do { | |
if (this.peek("]")) break; | |
var n = this.expression(); | |
e.push(n), n.constant || (t = !1) | |
} while (this.expect(",")); | |
return this.consume("]"), u(function (t, n) { | |
for (var r = [], o = 0; o < e.length; o++) r.push(e[o](t, n)); | |
return r | |
}, {literal: !0, constant: t}) | |
}, object: function () { | |
var e = [], t = !0; | |
if ("}" !== this.peekToken().text) do { | |
if (this.peek("}")) break; | |
var n = (n = this.expect()).string || n.text; | |
this.consume(":"); | |
var r = this.expression(); | |
e.push({key: n, value: r}), r.constant || (t = !1) | |
} while (this.expect(",")); | |
return this.consume("}"), u(function (t, n) { | |
for (var r = {}, o = 0; o < e.length; o++) { | |
var i = e[o]; | |
r[i.key] = i.value(t, n) | |
} | |
return r | |
}, {literal: !0, constant: t}) | |
} | |
}; | |
var Ln = {}, Vn = r("$sce"), | |
Fn = {HTML: "html", CSS: "css", URL: "url", RESOURCE_URL: "resourceUrl", JS: "js"}, | |
Un = t.createElement("a"), Bn = dt(e.location.href); | |
mt.$inject = ["$provide"], gt.$inject = ["$locale"], vt.$inject = ["$locale"]; | |
var Hn = ".", Wn = { | |
yyyy: Ct("FullYear", 4), | |
yy: Ct("FullYear", 2, 0, !0), | |
y: Ct("FullYear", 1), | |
MMMM: Tt("Month"), | |
MMM: Tt("Month", !0), | |
MM: Ct("Month", 2, 1), | |
M: Ct("Month", 1, 1), | |
dd: Ct("Date", 2), | |
d: Ct("Date", 1), | |
HH: Ct("Hours", 2), | |
H: Ct("Hours", 1), | |
hh: Ct("Hours", 2, -12), | |
h: Ct("Hours", 1, -12), | |
mm: Ct("Minutes", 2), | |
m: Ct("Minutes", 1), | |
ss: Ct("Seconds", 2), | |
s: Ct("Seconds", 1), | |
sss: Ct("Milliseconds", 3), | |
EEEE: Tt("Day"), | |
EEE: Tt("Day", !0), | |
a: function (e, t) { | |
return 12 > e.getHours() ? t.AMPMS[0] : t.AMPMS[1] | |
}, | |
Z: function (e) { | |
return (0 <= (e = -1 * e.getTimezoneOffset()) ? "+" : "") + (Et(Math[0 < e ? "floor" : "ceil"](e / 60), 2) + Et(Math.abs(e % 60), 2)) | |
} | |
}, jn = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/, Yn = /^\-?\d+$/; | |
_t.$inject = ["$locale"]; | |
var qn = h(Vt), Gn = h(Ut); | |
bt.$inject = ["$parse"]; | |
var zn = h({ | |
restrict: "E", compile: function (e, n) { | |
if (8 >= Dt && (n.href || n.name || n.$set("href", ""), e.append(t.createComment("IE fix"))), !n.href && !n.xlinkHref && !n.name) return function (e, t) { | |
var n = "[object SVGAnimatedString]" === Wt.call(t.prop("href")) ? "xlink:href" : "href"; | |
t.on("click", function (e) { | |
t.attr(n) || e.preventDefault() | |
}) | |
} | |
} | |
}), Kn = {}; | |
i(pn, function (e, t) { | |
if ("multiple" != e) { | |
var n = Se("ng-" + t); | |
Kn[n] = function () { | |
return { | |
priority: 100, link: function (e, r, o) { | |
e.$watch(o[n], function (e) { | |
o.$set(t, !!e) | |
}) | |
} | |
} | |
} | |
} | |
}), i(["src", "srcset", "href"], function (e) { | |
var t = Se("ng-" + e); | |
Kn[t] = function () { | |
return { | |
priority: 99, link: function (n, r, o) { | |
var i = e, a = e; | |
"href" === e && "[object SVGAnimatedString]" === Wt.call(r.prop("href")) && (a = "xlinkHref", o.$attr[a] = "xlink:href", i = null), o.$observe(t, function (e) { | |
e && (o.$set(a, e), Dt && i && r.prop(i, o[a])) | |
}) | |
} | |
} | |
} | |
}); | |
var Zn = {$addControl: f, $removeControl: f, $setValidity: f, $setDirty: f, $setPristine: f}; | |
Pt.$inject = ["$element", "$attrs", "$scope", "$animate"]; | |
var Jn = function (e) { | |
return ["$timeout", function (t) { | |
return { | |
name: "form", restrict: e ? "EAC" : "E", controller: Pt, compile: function () { | |
return { | |
pre: function (e, r, o, i) { | |
if (!o.action) { | |
var a = function (e) { | |
e.preventDefault ? e.preventDefault() : e.returnValue = !1 | |
}; | |
en(r[0], "submit", a), r.on("$destroy", function () { | |
t(function () { | |
tn(r[0], "submit", a) | |
}, 0, !1) | |
}) | |
} | |
var c = r.parent().controller("form"), s = o.name || o.ngForm; | |
s && Qe(e, s, i, s), c && r.on("$destroy", function () { | |
c.$removeControl(i), s && Qe(e, s, n, s), u(i, Zn) | |
}) | |
} | |
} | |
} | |
} | |
}] | |
}, Qn = Jn(), Xn = Jn(!0), | |
er = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/, | |
tr = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i, | |
nr = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/, rr = { | |
text: It, number: function (e, t, r, o, i, a) { | |
It(e, t, r, o, i, a), o.$parsers.push(function (e) { | |
var t = o.$isEmpty(e); | |
return t || nr.test(e) ? (o.$setValidity("number", !0), "" === e ? null : t ? e : parseFloat(e)) : (o.$setValidity("number", !1), n) | |
}), function (e, t, n, r, o) { | |
y(o) && (e.$$hasNativeValidators = !0, e.$parsers.push(function (i) { | |
if (e.$error[t] || kt(o, r) || !kt(o, n)) return i; | |
e.$setValidity(t, !1) | |
})) | |
}(o, "number", or, null, o.$$validityState), o.$formatters.push(function (e) { | |
return o.$isEmpty(e) ? "" : "" + e | |
}), r.min && (e = function (e) { | |
var t = parseFloat(r.min); | |
return $t(o, "min", o.$isEmpty(e) || e >= t, e) | |
}, o.$parsers.push(e), o.$formatters.push(e)), r.max && (e = function (e) { | |
var t = parseFloat(r.max); | |
return $t(o, "max", o.$isEmpty(e) || e <= t, e) | |
}, o.$parsers.push(e), o.$formatters.push(e)), o.$formatters.push(function (e) { | |
return $t(o, "number", o.$isEmpty(e) || C(e), e) | |
}) | |
}, url: function (e, t, n, r, o, i) { | |
It(e, t, n, r, o, i), e = function (e) { | |
return $t(r, "url", r.$isEmpty(e) || er.test(e), e) | |
}, r.$formatters.push(e), r.$parsers.push(e) | |
}, email: function (e, t, n, r, o, i) { | |
It(e, t, n, r, o, i), e = function (e) { | |
return $t(r, "email", r.$isEmpty(e) || tr.test(e), e) | |
}, r.$formatters.push(e), r.$parsers.push(e) | |
}, radio: function (e, t, n, r) { | |
g(n.name) && t.attr("name", s()), t.on("click", function () { | |
t[0].checked && e.$apply(function () { | |
r.$setViewValue(n.value) | |
}) | |
}), r.$render = function () { | |
t[0].checked = n.value == r.$viewValue | |
}, n.$observe("value", r.$render) | |
}, checkbox: function (e, t, n, r) { | |
var o = n.ngTrueValue, i = n.ngFalseValue; | |
E(o) || (o = !0), E(i) || (i = !1), t.on("click", function () { | |
e.$apply(function () { | |
r.$setViewValue(t[0].checked) | |
}) | |
}), r.$render = function () { | |
t[0].checked = r.$viewValue | |
}, r.$isEmpty = function (e) { | |
return e !== o | |
}, r.$formatters.push(function (e) { | |
return e === o | |
}), r.$parsers.push(function (e) { | |
return e ? o : i | |
}) | |
}, hidden: f, button: f, submit: f, reset: f, file: f | |
}, or = ["badInput"], ir = ["$browser", "$sniffer", function (e, t) { | |
return { | |
restrict: "E", require: "?ngModel", link: function (n, r, o, i) { | |
i && (rr[Vt(o.type)] || rr.text)(n, r, o, i, t, e) | |
} | |
} | |
}], ar = "ng-valid", cr = "ng-invalid", sr = "ng-pristine", lr = "ng-dirty", | |
ur = ["$scope", "$exceptionHandler", "$attrs", "$element", "$parse", "$animate", function (e, t, n, o, a, c) { | |
function s(e, t) { | |
t = t ? "-" + W(t, "-") : "", c.removeClass(o, (e ? cr : ar) + t), c.addClass(o, (e ? ar : cr) + t) | |
} | |
this.$modelValue = this.$viewValue = Number.NaN, this.$parsers = [], this.$formatters = [], this.$viewChangeListeners = [], this.$pristine = !0, this.$dirty = !1, this.$valid = !0, this.$invalid = !1, this.$name = n.name; | |
var l = a(n.ngModel), u = l.assign; | |
if (!u) throw r("ngModel")("nonassign", n.ngModel, R(o)); | |
this.$render = f, this.$isEmpty = function (e) { | |
return g(e) || "" === e || null === e || e != e | |
}; | |
var d = o.inheritedData("$formController") || Zn, p = 0, m = this.$error = {}; | |
o.addClass(sr), s(!0), this.$setValidity = function (e, t) { | |
m[e] !== !t && (t ? (m[e] && p--, p || (s(!0), this.$valid = !0, this.$invalid = !1)) : (s(!1), this.$invalid = !0, this.$valid = !1, p++), m[e] = !t, s(t, e), d.$setValidity(e, t, this)) | |
}, this.$setPristine = function () { | |
this.$dirty = !1, this.$pristine = !0, c.removeClass(o, lr), c.addClass(o, sr) | |
}, this.$setViewValue = function (n) { | |
this.$viewValue = n, this.$pristine && (this.$dirty = !0, this.$pristine = !1, c.removeClass(o, sr), c.addClass(o, lr), d.$setDirty()), i(this.$parsers, function (e) { | |
n = e(n) | |
}), this.$modelValue !== n && (this.$modelValue = n, u(e, n), i(this.$viewChangeListeners, function (e) { | |
try { | |
e() | |
} catch (e) { | |
t(e) | |
} | |
})) | |
}; | |
var h = this; | |
e.$watch(function () { | |
var t = l(e); | |
if (h.$modelValue !== t) { | |
var n = h.$formatters, r = n.length; | |
for (h.$modelValue = t; r--;) t = n[r](t); | |
h.$viewValue !== t && (h.$viewValue = t, h.$render()) | |
} | |
return t | |
}) | |
}], dr = function () { | |
return { | |
require: ["ngModel", "^?form"], controller: ur, link: function (e, t, n, r) { | |
var o = r[0], i = r[1] || Zn; | |
i.$addControl(o), e.$on("$destroy", function () { | |
i.$removeControl(o) | |
}) | |
} | |
} | |
}, pr = h({ | |
require: "ngModel", link: function (e, t, n, r) { | |
r.$viewChangeListeners.push(function () { | |
e.$eval(n.ngChange) | |
}) | |
} | |
}), fr = function () { | |
return { | |
require: "?ngModel", link: function (e, t, n, r) { | |
if (r) { | |
n.required = !0; | |
var o = function (e) { | |
if (!n.required || !r.$isEmpty(e)) return r.$setValidity("required", !0), e; | |
r.$setValidity("required", !1) | |
}; | |
r.$formatters.push(o), r.$parsers.unshift(o), n.$observe("required", function () { | |
o(r.$viewValue) | |
}) | |
} | |
} | |
} | |
}, mr = function () { | |
return { | |
require: "ngModel", link: function (e, t, r, o) { | |
var a = (e = /\/(.*)\//.exec(r.ngList)) && RegExp(e[1]) || r.ngList || ","; | |
o.$parsers.push(function (e) { | |
if (!g(e)) { | |
var t = []; | |
return e && i(e.split(a), function (e) { | |
e && t.push(zt(e)) | |
}), t | |
} | |
}), o.$formatters.push(function (e) { | |
return Gt(e) ? e.join(", ") : n | |
}), o.$isEmpty = function (e) { | |
return !e || !e.length | |
} | |
} | |
} | |
}, hr = /^(true|false|\d+)$/, gr = function () { | |
return { | |
priority: 100, compile: function (e, t) { | |
return hr.test(t.ngValue) ? function (e, t, n) { | |
n.$set("value", e.$eval(n.ngValue)) | |
} : function (e, t, n) { | |
e.$watch(n.ngValue, function (e) { | |
n.$set("value", e) | |
}) | |
} | |
} | |
} | |
}, vr = At({ | |
compile: function (e) { | |
return e.addClass("ng-binding"), function (e, t, r) { | |
t.data("$binding", r.ngBind), e.$watch(r.ngBind, function (e) { | |
t.text(e == n ? "" : e) | |
}) | |
} | |
} | |
}), yr = ["$interpolate", function (e) { | |
return function (t, n, r) { | |
t = e(n.attr(r.$attr.ngBindTemplate)), n.addClass("ng-binding").data("$binding", t), r.$observe("ngBindTemplate", function (e) { | |
n.text(e) | |
}) | |
} | |
}], Er = ["$sce", "$parse", function (e, t) { | |
return { | |
compile: function (n) { | |
return n.addClass("ng-binding"), function (n, r, o) { | |
r.data("$binding", o.ngBindHtml); | |
var i = t(o.ngBindHtml); | |
n.$watch(function () { | |
return (i(n) || "").toString() | |
}, function (t) { | |
r.html(e.getTrustedHtml(i(n)) || "") | |
}) | |
} | |
} | |
} | |
}], Cr = Nt("", !0), Tr = Nt("Odd", 0), _r = Nt("Even", 1), Sr = At({ | |
compile: function (e, t) { | |
t.$set("ngCloak", n), e.removeClass("ng-cloak") | |
} | |
}), wr = [function () { | |
return {scope: !0, controller: "@", priority: 500} | |
}], br = {}; | |
i("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "), function (e) { | |
var t = Se("ng-" + e); | |
br[t] = ["$parse", function (n) { | |
return { | |
compile: function (r, o) { | |
var i = n(o[t]); | |
return function (t, n) { | |
n.on(Vt(e), function (e) { | |
t.$apply(function () { | |
i(t, {$event: e}) | |
}) | |
}) | |
} | |
} | |
} | |
}] | |
}); | |
var Ar = ["$animate", function (e) { | |
return { | |
transclude: "element", | |
priority: 600, | |
terminal: !0, | |
restrict: "A", | |
$$tlb: !0, | |
link: function (n, r, o, i, a) { | |
var c, s, l; | |
n.$watch(o.ngIf, function (i) { | |
M(i) ? s || (s = n.$new(), a(s, function (n) { | |
n[n.length++] = t.createComment(" end ngIf: " + o.ngIf + " "), c = {clone: n}, e.enter(n, r.parent(), r) | |
})) : (l && (l.remove(), l = null), s && (s.$destroy(), s = null), c && (l = z(c.clone), e.leave(l, function () { | |
l = null | |
}), c = null)) | |
}) | |
} | |
} | |
}], Pr = ["$http", "$templateCache", "$anchorScroll", "$animate", "$sce", function (e, t, n, r, o) { | |
return { | |
restrict: "ECA", | |
priority: 400, | |
terminal: !0, | |
transclude: "element", | |
controller: Yt.noop, | |
compile: function (i, a) { | |
var c = a.ngInclude || a.src, s = a.onload || "", l = a.autoscroll; | |
return function (i, a, u, d, p) { | |
var f, m, h, g = 0, y = function () { | |
m && (m.remove(), m = null), f && (f.$destroy(), f = null), h && (r.leave(h, function () { | |
m = null | |
}), m = h, h = null) | |
}; | |
i.$watch(o.parseAsResourceUrl(c), function (o) { | |
var c = function () { | |
!v(l) || l && !i.$eval(l) || n() | |
}, u = ++g; | |
o ? (e.get(o, {cache: t}).success(function (e) { | |
if (u === g) { | |
var t = i.$new(); | |
d.template = e, e = p(t, function (e) { | |
y(), r.enter(e, null, a, c) | |
}), h = e, (f = t).$emit("$includeContentLoaded"), i.$eval(s) | |
} | |
}).error(function () { | |
u === g && y() | |
}), i.$emit("$includeContentRequested")) : (y(), d.template = null) | |
}) | |
} | |
} | |
} | |
}], $r = ["$compile", function (e) { | |
return { | |
restrict: "ECA", priority: -400, require: "ngInclude", link: function (t, n, r, o) { | |
n.html(o.template), e(n.contents())(t) | |
} | |
} | |
}], kr = At({ | |
priority: 450, compile: function () { | |
return { | |
pre: function (e, t, n) { | |
e.$eval(n.ngInit) | |
} | |
} | |
} | |
}), Ir = At({terminal: !0, priority: 1e3}), Nr = ["$locale", "$interpolate", function (e, t) { | |
var n = /{}/g; | |
return { | |
restrict: "EA", link: function (r, o, a) { | |
var c = a.count, s = a.$attr.when && o.attr(a.$attr.when), l = a.offset || 0, | |
u = r.$eval(s) || {}, d = {}, p = t.startSymbol(), f = t.endSymbol(), | |
m = /^when(Minus)?(.+)$/; | |
i(a, function (e, t) { | |
m.test(t) && (u[Vt(t.replace("when", "").replace("Minus", "-"))] = o.attr(a.$attr[t])) | |
}), i(u, function (e, r) { | |
d[r] = t(e.replace(n, p + c + "-" + l + f)) | |
}), r.$watch(function () { | |
var t = parseFloat(r.$eval(c)); | |
return isNaN(t) ? "" : (t in u || (t = e.pluralCat(t - l)), d[t](r, o, !0)) | |
}, function (e) { | |
o.text(e) | |
}) | |
} | |
} | |
}], Dr = ["$parse", "$animate", function (e, n) { | |
var a = r("ngRepeat"); | |
return { | |
transclude: "element", priority: 1e3, terminal: !0, $$tlb: !0, link: function (r, c, s, l, u) { | |
var d, p, f, m, h, g, v = s.ngRepeat, | |
y = v.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/), | |
E = {$id: pe}; | |
if (!y) throw a("iexp", v); | |
if (s = y[1], l = y[2], (y = y[3]) ? (d = e(y), p = function (e, t, n) { | |
return g && (E[g] = e), E[h] = t, E.$index = n, d(r, E) | |
}) : (f = function (e, t) { | |
return pe(t) | |
}, m = function (e) { | |
return e | |
}), !(y = s.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/))) throw a("iidexp", s); | |
h = y[3] || y[1], g = y[2]; | |
var C = {}; | |
r.$watchCollection(l, function (e) { | |
var s, l, d, y, E, T, _, S, w, b = c[0], A = {}, P = []; | |
if (o(e)) S = e, d = p || f; else { | |
for (T in d = p || m, S = [], e) e.hasOwnProperty(T) && "$" != T.charAt(0) && S.push(T); | |
S.sort() | |
} | |
for (y = S.length, l = P.length = S.length, s = 0; s < l; s++) if (q(_ = d(T = e === S ? s : S[s], _ = e[T], s), "`track by` id"), C.hasOwnProperty(_)) w = C[_], delete C[_], A[_] = w, P[s] = w; else { | |
if (A.hasOwnProperty(_)) throw i(P, function (e) { | |
e && e.scope && (C[e.id] = e) | |
}), a("dupes", v, _); | |
P[s] = {id: _}, A[_] = !1 | |
} | |
for (T in C) C.hasOwnProperty(T) && (s = z((w = C[T]).clone), n.leave(s), i(s, function (e) { | |
e.$$NG_REMOVED = !0 | |
}), w.scope.$destroy()); | |
for (s = 0, l = S.length; s < l; s++) { | |
if (_ = e[T = e === S ? s : S[s]], w = P[s], P[s - 1] && (b = P[s - 1].clone[P[s - 1].clone.length - 1]), w.scope) { | |
E = w.scope, d = b; | |
do { | |
d = d.nextSibling | |
} while (d && d.$$NG_REMOVED); | |
w.clone[0] != d && n.move(z(w.clone), null, xt(b)), b = w.clone[w.clone.length - 1] | |
} else E = r.$new(); | |
E[h] = _, g && (E[g] = T), E.$index = s, E.$first = 0 === s, E.$last = s === y - 1, E.$middle = !(E.$first || E.$last), E.$odd = !(E.$even = 0 == (1 & s)), w.scope || u(E, function (e) { | |
e[e.length++] = t.createComment(" end ngRepeat: " + v + " "), n.enter(e, null, xt(b)), b = e, w.scope = E, w.clone = e, A[w.id] = w | |
}) | |
} | |
C = A | |
}) | |
} | |
} | |
}], xr = ["$animate", function (e) { | |
return function (t, n, r) { | |
t.$watch(r.ngShow, function (t) { | |
e[M(t) ? "removeClass" : "addClass"](n, "ng-hide") | |
}) | |
} | |
}], Or = ["$animate", function (e) { | |
return function (t, n, r) { | |
t.$watch(r.ngHide, function (t) { | |
e[M(t) ? "addClass" : "removeClass"](n, "ng-hide") | |
}) | |
} | |
}], Mr = At(function (e, t, n) { | |
e.$watch(n.ngStyle, function (e, n) { | |
n && e !== n && i(n, function (e, n) { | |
t.css(n, "") | |
}), e && t.css(e) | |
}, !0) | |
}), Rr = ["$animate", function (e) { | |
return { | |
restrict: "EA", require: "ngSwitch", controller: ["$scope", function () { | |
this.cases = {} | |
}], link: function (t, n, r, o) { | |
var a = [], c = [], s = [], l = []; | |
t.$watch(r.ngSwitch || r.on, function (n) { | |
var u, d; | |
for (u = 0, d = s.length; u < d; ++u) s[u].remove(); | |
for (u = s.length = 0, d = l.length; u < d; ++u) { | |
var p = c[u]; | |
l[u].$destroy(), s[u] = p, e.leave(p, function () { | |
s.splice(u, 1) | |
}) | |
} | |
c.length = 0, l.length = 0, (a = o.cases["!" + n] || o.cases["?"]) && (t.$eval(r.change), i(a, function (n) { | |
var r = t.$new(); | |
l.push(r), n.transclude(r, function (t) { | |
var r = n.element; | |
c.push(t), e.enter(t, r.parent(), r) | |
}) | |
})) | |
}) | |
} | |
} | |
}], Lr = At({ | |
transclude: "element", priority: 800, require: "^ngSwitch", link: function (e, t, n, r, o) { | |
r.cases["!" + n.ngSwitchWhen] = r.cases["!" + n.ngSwitchWhen] || [], r.cases["!" + n.ngSwitchWhen].push({ | |
transclude: o, | |
element: t | |
}) | |
} | |
}), Vr = At({ | |
transclude: "element", priority: 800, require: "^ngSwitch", link: function (e, t, n, r, o) { | |
r.cases["?"] = r.cases["?"] || [], r.cases["?"].push({transclude: o, element: t}) | |
} | |
}), Fr = At({ | |
link: function (e, t, n, o, i) { | |
if (!i) throw r("ngTransclude")("orphan", R(t)); | |
i(function (e) { | |
t.empty(), t.append(e) | |
}) | |
} | |
}), Ur = ["$templateCache", function (e) { | |
return { | |
restrict: "E", terminal: !0, compile: function (t, n) { | |
"text/ng-template" == n.type && e.put(n.id, t[0].text) | |
} | |
} | |
}], Br = r("ngOptions"), Hr = h({terminal: !0}), Wr = ["$compile", "$parse", function (e, r) { | |
var o = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/, | |
c = {$setViewValue: f}; | |
return { | |
restrict: "E", | |
require: ["select", "?ngModel"], | |
controller: ["$element", "$scope", "$attrs", function (e, t, n) { | |
var r, o = this, i = {}, a = c; | |
o.databound = n.ngModel, o.init = function (e, t, n) { | |
a = e, r = n | |
}, o.addOption = function (t) { | |
q(t, '"option value"'), i[t] = !0, a.$viewValue == t && (e.val(t), r.parent() && r.remove()) | |
}, o.removeOption = function (e) { | |
this.hasOption(e) && (delete i[e], a.$viewValue == e && this.renderUnknownOption(e)) | |
}, o.renderUnknownOption = function (t) { | |
t = "? " + pe(t) + " ?", r.val(t), e.prepend(r), e.val(t), r.prop("selected", !0) | |
}, o.hasOption = function (e) { | |
return i.hasOwnProperty(e) | |
}, t.$on("$destroy", function () { | |
o.renderUnknownOption = f | |
}) | |
}], | |
link: function (c, s, l, u) { | |
if (u[1]) { | |
var d = u[0]; | |
u = u[1]; | |
var p, f = l.multiple, m = l.ngOptions, h = !1, y = xt(t.createElement("option")), | |
E = xt(t.createElement("optgroup")), C = y.clone(); | |
l = 0; | |
for (var T = s.children(), _ = T.length; l < _; l++) if ("" === T[l].value) { | |
p = h = T.eq(l); | |
break | |
} | |
d.init(u, h, C), f && (u.$isEmpty = function (e) { | |
return !e || 0 === e.length | |
}), m ? function (t, i, c) { | |
function s() { | |
var e, n, r, o, s, l = {"": []}, m = [""]; | |
r = c.$modelValue, o = T(t) || []; | |
var w, b, A, P, $, k = p ? a(o) : o; | |
if (b = {}, A = !1, f) if (n = c.$modelValue, _ && Gt(n)) for (A = new fe([]), e = {}, s = 0; s < n.length; s++) e[d] = n[s], A.put(_(t, e), n[s]); else A = new fe(n); | |
for (s = A, A = 0; A < (w = k.length); A++) { | |
if (n = A, p) { | |
if ("$" === (n = k[A]).charAt(0)) continue; | |
b[p] = n | |
} | |
b[d] = o[n], (n = l[e = g(t, b) || ""]) || (n = l[e] = [], m.push(e)), f ? e = v(s.remove(_ ? _(t, b) : C(t, b))) : (_ ? ((e = {})[d] = r, e = _(t, e) === _(t, b)) : e = r === C(t, b), s = s || e), P = v(P = u(t, b)) ? P : "", n.push({ | |
id: _ ? _(t, b) : p ? k[A] : A, | |
label: P, | |
selected: e | |
}) | |
} | |
for (f || (h || null === r ? l[""].unshift({ | |
id: "", | |
label: "", | |
selected: !s | |
}) : s || l[""].unshift({ | |
id: "?", | |
label: "", | |
selected: !0 | |
})), b = 0, k = m.length; b < k; b++) { | |
for (n = l[e = m[b]], S.length <= b ? (o = [r = { | |
element: E.clone().attr("label", e), | |
label: n.label | |
}], S.push(o), i.append(r.element)) : (r = (o = S[b])[0]).label != e && r.element.attr("label", r.label = e), P = null, A = 0, w = n.length; A < w; A++) e = n[A], (s = o[A + 1]) ? (P = s.element, s.label !== e.label && P.text(s.label = e.label), s.id !== e.id && P.val(s.id = e.id), P[0].selected !== e.selected && (P.prop("selected", s.selected = e.selected), Dt && P.prop("selected", s.selected))) : ("" === e.id && h ? $ = h : ($ = y.clone()).val(e.id).prop("selected", e.selected).attr("selected", e.selected).text(e.label), o.push({ | |
element: $, | |
label: e.label, | |
id: e.id, | |
selected: e.selected | |
}), P ? P.after($) : r.element.append($), P = $); | |
for (A++; o.length > A;) o.pop().element.remove() | |
} | |
for (; S.length > b;) S.pop()[0].element.remove() | |
} | |
var l; | |
if (!(l = m.match(o))) throw Br("iexp", m, R(i)); | |
var u = r(l[2] || l[1]), d = l[4] || l[6], p = l[5], g = r(l[3] || ""), | |
C = r(l[2] ? l[1] : d), T = r(l[7]), _ = l[8] ? r(l[8]) : null, | |
S = [[{element: i, label: ""}]]; | |
h && (e(h)(t), h.removeClass("ng-scope"), h.remove()), i.empty(), i.on("change", function () { | |
t.$apply(function () { | |
var e, r, o, a, l, u, m, h, g = T(t) || [], v = {}; | |
if (f) { | |
for (o = [], l = 0, m = S.length; l < m; l++) for (a = 1, u = (e = S[l]).length; a < u; a++) if ((r = e[a].element)[0].selected) { | |
if (r = r.val(), p && (v[p] = r), _) for (h = 0; h < g.length && (v[d] = g[h], _(t, v) != r); h++) ; else v[d] = g[r]; | |
o.push(C(t, v)) | |
} | |
} else if ("?" == (r = i.val())) o = n; else if ("" === r) o = null; else if (_) { | |
for (h = 0; h < g.length; h++) if (v[d] = g[h], _(t, v) == r) { | |
o = C(t, v); | |
break | |
} | |
} else v[d] = g[r], p && (v[p] = r), o = C(t, v); | |
c.$setViewValue(o), s() | |
}) | |
}), c.$render = s, t.$watchCollection(T, s), f && t.$watchCollection(function () { | |
return c.$modelValue | |
}, s) | |
}(c, s, u) : f ? function (e, t, n) { | |
var r; | |
n.$render = function () { | |
var e = new fe(n.$viewValue); | |
i(t.find("option"), function (t) { | |
t.selected = v(e.get(t.value)) | |
}) | |
}, e.$watch(function () { | |
I(r, n.$viewValue) || (r = k(n.$viewValue), n.$render()) | |
}), t.on("change", function () { | |
e.$apply(function () { | |
var e = []; | |
i(t.find("option"), function (t) { | |
t.selected && e.push(t.value) | |
}), n.$setViewValue(e) | |
}) | |
}) | |
}(c, s, u) : function (e, t, n, r) { | |
n.$render = function () { | |
var e = n.$viewValue; | |
r.hasOption(e) ? (C.parent() && C.remove(), t.val(e), "" === e && p.prop("selected", !0)) : g(e) && p ? t.val("") : r.renderUnknownOption(e) | |
}, t.on("change", function () { | |
e.$apply(function () { | |
C.parent() && C.remove(), n.$setViewValue(t.val()) | |
}) | |
}) | |
}(c, s, u, d) | |
} | |
} | |
} | |
}], jr = ["$interpolate", function (e) { | |
var t = {addOption: f, removeOption: f}; | |
return { | |
restrict: "E", priority: 100, compile: function (n, r) { | |
if (g(r.value)) { | |
var o = e(n.text(), !0); | |
o || r.$set("value", n.text()) | |
} | |
return function (e, n, r) { | |
var i = n.parent(), | |
a = i.data("$selectController") || i.parent().data("$selectController"); | |
a && a.databound ? n.prop("selected", !1) : a = t, o ? e.$watch(o, function (e, t) { | |
r.$set("value", e), e !== t && a.removeOption(t), a.addOption(e) | |
}) : a.addOption(r.value), n.on("$destroy", function () { | |
a.removeOption(r.value) | |
}) | |
} | |
} | |
} | |
}], Yr = h({restrict: "E", terminal: !0}); | |
e.angular.bootstrap ? console.log("WARNING: Tried to load angular more than once.") : ((Ot = e.jQuery) && Ot.fn.on ? (xt = Ot, u(Ot.fn, { | |
scope: dn.scope, | |
isolateScope: dn.isolateScope, | |
controller: dn.controller, | |
injector: dn.injector, | |
inheritedData: dn.inheritedData | |
}), Z("remove", !0, !0, !1), Z("empty", !1, !1, !1), Z("html", !1, !1, !0)) : xt = J, Yt.element = xt, function (t) { | |
u(t, { | |
bootstrap: H, | |
copy: $, | |
extend: u, | |
equals: I, | |
element: xt, | |
forEach: i, | |
injector: he, | |
noop: f, | |
bind: N, | |
toJson: x, | |
fromJson: O, | |
identity: m, | |
isUndefined: g, | |
isDefined: v, | |
isString: E, | |
isFunction: _, | |
isObject: y, | |
isNumber: C, | |
isElement: b, | |
isArray: Gt, | |
version: Jt, | |
isDate: T, | |
lowercase: Vt, | |
uppercase: Ut, | |
callbacks: {counter: 0}, | |
$$minErr: r, | |
$$csp: Kt | |
}), Mt = function (e) { | |
var t = r("$injector"), n = r("ng"); | |
return (e = e.angular || (e.angular = {})).$$minErr = e.$$minErr || r, e.module || (e.module = function () { | |
var e = {}; | |
return function (r, o, i) { | |
if ("hasOwnProperty" === r) throw n("badname", "module"); | |
return o && e.hasOwnProperty(r) && (e[r] = null), e[r] || (e[r] = function () { | |
function e(e, t, r) { | |
return function () { | |
return n[r || "push"]([e, t, arguments]), s | |
} | |
} | |
if (!o) throw t("nomod", r); | |
var n = [], a = [], c = e("$injector", "invoke"), s = { | |
_invokeQueue: n, | |
_runBlocks: a, | |
requires: o, | |
name: r, | |
provider: e("$provide", "provider"), | |
factory: e("$provide", "factory"), | |
service: e("$provide", "service"), | |
value: e("$provide", "value"), | |
constant: e("$provide", "constant", "unshift"), | |
animation: e("$animateProvider", "register"), | |
filter: e("$filterProvider", "register"), | |
controller: e("$controllerProvider", "register"), | |
directive: e("$compileProvider", "directive"), | |
config: c, | |
run: function (e) { | |
return a.push(e), this | |
} | |
}; | |
return i && c(i), s | |
}()) | |
} | |
}()) | |
}(e); | |
try { | |
Mt("ngLocale") | |
} catch (e) { | |
Mt("ngLocale", []).provider("$locale", Re) | |
} | |
Mt("ng", ["ngLocale"], ["$provide", function (e) { | |
e.provider({$$sanitizeUri: it}), e.provider("$compile", _e).directive({ | |
a: zn, | |
input: ir, | |
textarea: ir, | |
form: Qn, | |
script: Ur, | |
select: Wr, | |
style: Yr, | |
option: jr, | |
ngBind: vr, | |
ngBindHtml: Er, | |
ngBindTemplate: yr, | |
ngClass: Cr, | |
ngClassEven: _r, | |
ngClassOdd: Tr, | |
ngCloak: Sr, | |
ngController: wr, | |
ngForm: Xn, | |
ngHide: Or, | |
ngIf: Ar, | |
ngInclude: Pr, | |
ngInit: kr, | |
ngNonBindable: Ir, | |
ngPluralize: Nr, | |
ngRepeat: Dr, | |
ngShow: xr, | |
ngStyle: Mr, | |
ngSwitch: Rr, | |
ngSwitchWhen: Lr, | |
ngSwitchDefault: Vr, | |
ngOptions: Hr, | |
ngTransclude: Fr, | |
ngModel: dr, | |
ngList: mr, | |
ngChange: pr, | |
required: fr, | |
ngRequired: fr, | |
ngValue: gr | |
}).directive({ngInclude: $r}).directive(Kn).directive(br), e.provider({ | |
$anchorScroll: ge, | |
$animate: Cn, | |
$browser: Ee, | |
$cacheFactory: Ce, | |
$controller: be, | |
$document: Ae, | |
$exceptionHandler: Pe, | |
$filter: mt, | |
$interpolate: Oe, | |
$interval: Me, | |
$http: Ne, | |
$httpBackend: xe, | |
$location: ze, | |
$log: Ke, | |
$parse: tt, | |
$rootScope: ot, | |
$q: nt, | |
$sce: st, | |
$sceDelegate: ct, | |
$sniffer: lt, | |
$templateCache: Te, | |
$timeout: ut, | |
$window: ft, | |
$$rAF: rt, | |
$$asyncCallback: ve | |
}) | |
}]) | |
}(Yt), xt(t).ready(function () { | |
!function (e, n) { | |
function r(e) { | |
e && c.push(e) | |
} | |
var o, a, c = [e], s = ["ng:app", "ng-app", "x-ng-app", "data-ng-app"], | |
l = /\sng[:\-]app(:\s*([\w\d_]+);?)?\s/; | |
i(s, function (n) { | |
s[n] = !0, r(t.getElementById(n)), n = n.replace(":", "\\:"), e.querySelectorAll && (i(e.querySelectorAll("." + n), r), i(e.querySelectorAll("." + n + "\\:"), r), i(e.querySelectorAll("[" + n + "]"), r)) | |
}), i(c, function (e) { | |
if (!o) { | |
var t = l.exec(" " + e.className + " "); | |
t ? (o = e, a = (t[2] || "").replace(/\s+/g, ",")) : i(e.attributes, function (t) { | |
!o && s[t.name] && (o = e, a = t.value) | |
}) | |
} | |
}), o && n(o, a ? [a] : []) | |
}(t, H) | |
})) | |
}(window, document), !window.angular.$$csp() && window.angular.element(document).find("head").prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\\:form{display:block;}.ng-animate-block-transitions{transition:0s all!important;-webkit-transition:0s all!important;}.ng-hide-add-active,.ng-hide-remove{display:block!important;}</style>'), function (e, t, n) { | |
"use strict"; | |
t.module("ngAnimate", ["ng"]).directive("ngAnimateChildren", function () { | |
return function (e, n, r) { | |
r = r.ngAnimateChildren, t.isString(r) && 0 === r.length ? n.data("$$ngAnimateChildren", !0) : e.$watch(r, function (e) { | |
n.data("$$ngAnimateChildren", !!e) | |
}) | |
} | |
}).factory("$$animateReflow", ["$$rAF", "$document", function (e, t) { | |
return function (t) { | |
return e(function () { | |
t() | |
}) | |
} | |
}]).config(["$provide", "$animateProvider", function (r, o) { | |
function i(e) { | |
for (var t = 0; t < e.length; t++) { | |
var n = e[t]; | |
if (n.nodeType == u) return n | |
} | |
} | |
function a(e) { | |
return t.element(i(e)) | |
} | |
var c = t.noop, s = t.forEach, l = o.$$selectors, u = 1, d = "$$ngAnimateState", | |
p = "$$ngAnimateChildren", f = "ng-animate", m = {running: !0}; | |
r.decorator("$animate", ["$delegate", "$injector", "$sniffer", "$rootElement", "$$asyncCallback", "$rootScope", "$document", function (e, n, r, u, h, g, v) { | |
function y(e) { | |
var t = e.data(d) || {}; | |
t.running = !0, e.data(d, t) | |
} | |
function E(e, o, i) { | |
function a(e, t) { | |
var n = e[t], r = e["before" + t.charAt(0).toUpperCase() + t.substr(1)]; | |
if (n || r) return "leave" == t && (r = n, n = null), _.push({ | |
event: t, | |
fn: n | |
}), E.push({event: t, fn: r}), !0 | |
} | |
function u(t, n, r) { | |
var o = []; | |
s(t, function (e) { | |
e.fn && o.push(e) | |
}); | |
var a = 0; | |
s(o, function (t, s) { | |
var l = function () { | |
e:{ | |
if (n) { | |
if ((n[s] || c)(), ++a < o.length) break e; | |
n = null | |
} | |
r() | |
} | |
}; | |
switch (t.event) { | |
case"setClass": | |
n.push(t.fn(e, p, f, l)); | |
break; | |
case"addClass": | |
n.push(t.fn(e, p || i, l)); | |
break; | |
case"removeClass": | |
n.push(t.fn(e, f || i, l)); | |
break; | |
default: | |
n.push(t.fn(e, l)) | |
} | |
}), n && 0 === n.length && r() | |
} | |
var d = e[0]; | |
if (d) { | |
var p, f, m = "setClass" == o, h = m || "addClass" == o || "removeClass" == o; | |
t.isArray(i) && (p = i[0], f = i[1], i = p + " " + f); | |
var g = e.attr("class") + " " + i; | |
if (A(g)) { | |
var v = c, y = [], E = [], C = c, T = [], _ = []; | |
g = (" " + g).replace(/\s+/g, "."); | |
return s(function (e) { | |
if (e) { | |
var t = [], o = {}; | |
e = e.substr(1).split("."), (r.transitions || r.animations) && t.push(n.get(l[""])); | |
for (var i = 0; i < e.length; i++) { | |
var a = e[i], c = l[a]; | |
c && !o[a] && (t.push(n.get(c)), o[a] = !0) | |
} | |
return t | |
} | |
}(g), function (e) { | |
!a(e, o) && m && (a(e, "addClass"), a(e, "removeClass")) | |
}), { | |
node: d, | |
event: o, | |
className: i, | |
isClassBased: h, | |
isSetClassOperation: m, | |
before: function (e) { | |
v = e, u(E, y, function () { | |
v = c, e() | |
}) | |
}, | |
after: function (e) { | |
C = e, u(_, T, function () { | |
C = c, e() | |
}) | |
}, | |
cancel: function () { | |
y && (s(y, function (e) { | |
(e || c)(!0) | |
}), v(!0)), T && (s(T, function (e) { | |
(e || c)(!0) | |
}), C(!0)) | |
} | |
} | |
} | |
} | |
} | |
function C(e, n, r, o, i, a, c) { | |
function l(t) { | |
var o = "$animate:" + t; | |
C && C[o] && 0 < C[o].length && h(function () { | |
r.triggerHandler(o, {event: e, className: n}) | |
}) | |
} | |
function u() { | |
l("before") | |
} | |
function p() { | |
l("after") | |
} | |
function m() { | |
l("close"), c && h(function () { | |
c() | |
}) | |
} | |
function g() { | |
g.hasBeenRun || (g.hasBeenRun = !0, a()) | |
} | |
function v() { | |
if (!v.hasBeenRun) { | |
v.hasBeenRun = !0; | |
var e = r.data(d); | |
e && (y && y.isClassBased ? _(r, n) : (h(function () { | |
var e = r.data(d) || {}; | |
k == e.index && _(r, n) | |
}), r.data(d, e))), m() | |
} | |
} | |
var y = E(r, e, n); | |
if (y) { | |
n = y.className; | |
var C = (C = t.element._data(y.node)) && C.events; | |
o || (o = i ? i.parent() : r.parent()); | |
var T = r.data(d) || {}; | |
i = T.active || {}; | |
var b, A = T.totalActive || 0, P = T.last; | |
if (y.isClassBased && (b = T.running || T.disabled || P && !P.isClassBased), b || S(r, o)) g(), u(), p(), v(); else { | |
if (o = !1, 0 < A) { | |
if (b = [], y.isClassBased) "setClass" == P.event ? (b.push(P), _(r, n)) : i[n] && (($ = i[n]).event == e ? o = !0 : (b.push($), _(r, n))); else if ("leave" == e && i["ng-leave"]) o = !0; else { | |
for (var $ in i) b.push(i[$]), _(r, $); | |
i = {}, A = 0 | |
} | |
0 < b.length && s(b, function (e) { | |
e.cancel() | |
}) | |
} | |
if (!y.isClassBased || y.isSetClassOperation || o || (o = "addClass" == e == r.hasClass(n)), o) g(), u(), p(), m(); else { | |
"leave" == e && r.one("$destroy", function (e) { | |
var n = (e = t.element(this)).data(d); | |
n && (n = n.active["ng-leave"]) && (n.cancel(), _(e, "ng-leave")) | |
}), r.addClass(f); | |
var k = w++; | |
A++, i[n] = y, r.data(d, { | |
last: y, | |
active: i, | |
index: k, | |
totalActive: A | |
}), u(), y.before(function (t) { | |
var o = r.data(d); | |
t = t || !o || !o.active[n] || y.isClassBased && o.active[n].event != e, g(), !0 === t ? v() : (p(), y.after(v)) | |
}) | |
} | |
} | |
} else g(), u(), p(), v() | |
} | |
function T(e) { | |
(e = i(e)) && (e = t.isFunction(e.getElementsByClassName) ? e.getElementsByClassName(f) : e.querySelectorAll("." + f), s(e, function (e) { | |
(e = (e = t.element(e)).data(d)) && e.active && s(e.active, function (e) { | |
e.cancel() | |
}) | |
})) | |
} | |
function _(e, t) { | |
if (i(e) == i(u)) m.disabled || (m.running = !1, m.structural = !1); else if (t) { | |
var n = e.data(d) || {}, r = !0 === t; | |
!r && n.active && n.active[t] && (n.totalActive--, delete n.active[t]), !r && n.totalActive || (e.removeClass(f), e.removeData(d)) | |
} | |
} | |
function S(e, n) { | |
if (m.disabled) return !0; | |
if (i(e) == i(u)) return m.running; | |
var r, o, a; | |
do { | |
if (0 === n.length) break; | |
var c = i(n) == i(u), s = c ? m : n.data(d) || {}; | |
if (s.disabled) return !0; | |
c && (a = !0), !1 !== r && (c = n.data(p), t.isDefined(c) && (r = c)), o = o || s.running || s.last && !s.last.isClassBased | |
} while (n = n.parent()); | |
return !a || !r && o | |
} | |
var w = 0; | |
u.data(d, m), g.$$postDigest(function () { | |
g.$$postDigest(function () { | |
m.running = !1 | |
}) | |
}); | |
var b = o.classNameFilter(), A = b ? function (e) { | |
return b.test(e) | |
} : function () { | |
return !0 | |
}; | |
return { | |
enter: function (n, r, o, i) { | |
n = t.element(n), r = r && t.element(r), o = o && t.element(o), y(n), e.enter(n, r, o), g.$$postDigest(function () { | |
C("enter", "ng-enter", n = a(n), r, o, c, i) | |
}) | |
}, leave: function (n, r) { | |
T(n = t.element(n)), y(n), g.$$postDigest(function () { | |
C("leave", "ng-leave", a(n), null, null, function () { | |
e.leave(n) | |
}, r) | |
}) | |
}, move: function (n, r, o, i) { | |
n = t.element(n), r = r && t.element(r), o = o && t.element(o), T(n), y(n), e.move(n, r, o), g.$$postDigest(function () { | |
C("move", "ng-move", n = a(n), r, o, c, i) | |
}) | |
}, addClass: function (n, r, o) { | |
n = a(n = t.element(n)), C("addClass", r, n, null, null, function () { | |
e.addClass(n, r) | |
}, o) | |
}, removeClass: function (n, r, o) { | |
n = a(n = t.element(n)), C("removeClass", r, n, null, null, function () { | |
e.removeClass(n, r) | |
}, o) | |
}, setClass: function (n, r, o, i) { | |
n = a(n = t.element(n)), C("setClass", [r, o], n, null, null, function () { | |
e.setClass(n, r, o) | |
}, i) | |
}, enabled: function (e, t) { | |
switch (arguments.length) { | |
case 2: | |
if (e) _(t); else { | |
var n = t.data(d) || {}; | |
n.disabled = !0, t.data(d, n) | |
} | |
break; | |
case 1: | |
m.disabled = !e; | |
break; | |
default: | |
e = !m.disabled | |
} | |
return !!e | |
} | |
} | |
}]), o.register("", ["$window", "$sniffer", "$timeout", "$$animateReflow", function (r, o, a, l) { | |
function d(e, t) { | |
I && I(), W.push(t), I = l(function () { | |
s(W, function (e) { | |
e() | |
}), W = [], I = null, B = {} | |
}) | |
} | |
function p(e, n) { | |
var r = i(e); | |
e = t.element(r), q.push(e), (r = Date.now() + n) <= Y || (a.cancel(j), Y = r, j = a(function () { | |
s(q, function (e) { | |
(e = e.data(R)) && (e.closeAnimationFn || c)() | |
}), q = [] | |
}, n, !1)) | |
} | |
function f(e, t) { | |
var n = t ? B[t] : null; | |
if (!n) { | |
var o, i, a, c, l = 0, d = 0, p = 0, f = 0; | |
s(e, function (e) { | |
if (e.nodeType == u) { | |
e = r.getComputedStyle(e) || {}, a = e[b + N], l = Math.max(m(a), l), c = e[b + D], o = e[b + x], d = Math.max(m(o), d), i = e[P + x], f = Math.max(m(i), f); | |
var t = m(e[P + N]); | |
0 < t && (t *= parseInt(e[P + O], 10) || 1), p = Math.max(t, p) | |
} | |
}), n = { | |
total: 0, | |
transitionPropertyStyle: c, | |
transitionDurationStyle: a, | |
transitionDelayStyle: o, | |
transitionDelay: d, | |
transitionDuration: l, | |
animationDelayStyle: i, | |
animationDelay: f, | |
animationDuration: p | |
}, t && (B[t] = n) | |
} | |
return n | |
} | |
function m(e) { | |
var n = 0; | |
return e = t.isString(e) ? e.split(/\s*,\s*/) : [], s(e, function (e) { | |
n = Math.max(parseFloat(e) || 0, n) | |
}), n | |
} | |
function h(e) { | |
var t = e.parent(), n = t.data(M); | |
return n || (t.data(M, ++H), n = H), n + "-" + i(e).getAttribute("class") | |
} | |
function g(e, t, n, r) { | |
var o = h(t), a = o + " " + n, s = B[a] ? ++B[a].total : 0, l = {}; | |
0 < s && ((o = !B[l = o + " " + (u = n + "-stagger")]) && t.addClass(u), l = f(t, l), o && t.removeClass(u)); | |
r = r || function (e) { | |
return e() | |
}, t.addClass(n); | |
var u = t.data(R) || {}, d = r(function () { | |
return f(t, a) | |
}); | |
return r = d.transitionDuration, o = d.animationDuration, 0 === r && 0 === o ? (t.removeClass(n), !1) : (t.data(R, { | |
running: u.running || 0, | |
itemIndex: s, | |
stagger: l, | |
timings: d, | |
closeAnimationFn: c | |
}), e = 0 < u.running || "setClass" == e, 0 < r && function (e, t, n) { | |
"ng-enter" != t && "ng-move" != t && "ng-leave" != t && n ? e.addClass(L) : i(e).style[b + D] = "none" | |
}(t, n, e), 0 < o && 0 < l.animationDelay && 0 === l.animationDuration && (i(t).style[P] = "none 0s"), !0) | |
} | |
function v(e, t) { | |
var n = b + D, r = i(e); | |
r.style[n] && 0 < r.style[n].length && (r.style[n] = ""), e.removeClass(L) | |
} | |
function y(e) { | |
var t = P; | |
(e = i(e)).style[t] && 0 < e.style[t].length && (e.style[t] = "") | |
} | |
function E(e, t, n) { | |
var r = ""; | |
return s(e.split(","), function (e, o) { | |
r += (0 < o ? "," : "") + (n * t + parseInt(e, 10)) + "s" | |
}), r | |
} | |
function C(e, t, n, r) { | |
if (g(e, t, n, r)) return function (e) { | |
e && S(t, n) | |
} | |
} | |
function T(e, t, n, r) { | |
if (t.data(R)) return function (e, t, n, r) { | |
function o(e) { | |
for (var r in t.off(y, a), t.removeClass(l), S(t, n), e = i(t), T) e.style.removeProperty(T[r]) | |
} | |
function a(e) { | |
e.stopPropagation(); | |
var t = e.originalEvent || e; | |
e = t.$manualTimeStamp || t.timeStamp || Date.now(), t = parseFloat(t.elapsedTime.toFixed(V)), Math.max(e - v, 0) >= g && t >= m && r() | |
} | |
var c = i(t); | |
if (e = t.data(R), -1 != c.getAttribute("class").indexOf(n) && e) { | |
var l = ""; | |
s(n.split(" "), function (e, t) { | |
l += (0 < t ? " " : "") + e + "-active" | |
}); | |
var u = e.stagger, d = e.timings, f = e.itemIndex, | |
m = Math.max(d.transitionDuration, d.animationDuration), | |
h = Math.max(d.transitionDelay, d.animationDelay), g = h * U, v = Date.now(), | |
y = $ + " " + A, C = "", T = []; | |
if (0 < d.transitionDuration) { | |
var _ = d.transitionPropertyStyle; | |
-1 == _.indexOf("all") && (C += k + "transition-property: " + _ + ";", C += k + "transition-duration: " + d.transitionDurationStyle + ";", T.push(k + "transition-property"), T.push(k + "transition-duration")) | |
} | |
return 0 < f && (0 < u.transitionDelay && 0 === u.transitionDuration && (C += k + "transition-delay: " + E(d.transitionDelayStyle, u.transitionDelay, f) + "; ", T.push(k + "transition-delay")), 0 < u.animationDelay && 0 === u.animationDuration && (C += k + "animation-delay: " + E(d.animationDelayStyle, u.animationDelay, f) + "; ", T.push(k + "animation-delay"))), 0 < T.length && (d = c.getAttribute("style") || "", c.setAttribute("style", d + "; " + C)), t.on(y, a), t.addClass(l), e.closeAnimationFn = function () { | |
o(), r() | |
}, c = (f * (Math.max(u.animationDelay, u.transitionDelay) || 0) + (h + m) * F) * U, e.running++, p(t, c), o | |
} | |
r() | |
}(e, t, n, r); | |
S(t, n), r() | |
} | |
function _(e, t, n, r) { | |
var o = C(e, t, n); | |
if (o) { | |
var i = o; | |
return d(0, function () { | |
v(t), y(t), i = T(e, t, n, r) | |
}), function (e) { | |
(i || c)(e) | |
} | |
} | |
r() | |
} | |
function S(e, t) { | |
e.removeClass(t); | |
var n = e.data(R); | |
n && (n.running && n.running--, n.running && 0 !== n.running || e.removeData(R)) | |
} | |
function w(e, n) { | |
var r = ""; | |
return e = t.isArray(e) ? e : e.split(/\s+/), s(e, function (e, t) { | |
e && 0 < e.length && (r += (0 < t ? " " : "") + e + n) | |
}), r | |
} | |
var b, A, P, $, k = ""; | |
e.ontransitionend === n && e.onwebkittransitionend !== n ? (k = "-webkit-", b = "WebkitTransition", A = "webkitTransitionEnd transitionend") : (b = "transition", A = "transitionend"), e.onanimationend === n && e.onwebkitanimationend !== n ? (k = "-webkit-", P = "WebkitAnimation", $ = "webkitAnimationEnd animationend") : (P = "animation", $ = "animationend"); | |
var I, N = "Duration", D = "Property", x = "Delay", O = "IterationCount", M = "$$ngAnimateKey", | |
R = "$$ngAnimateCSS3Data", L = "ng-animate-block-transitions", V = 3, F = 1.5, U = 1e3, | |
B = {}, H = 0, W = [], j = null, Y = 0, q = []; | |
return { | |
enter: function (e, t) { | |
return _("enter", e, "ng-enter", t) | |
}, leave: function (e, t) { | |
return _("leave", e, "ng-leave", t) | |
}, move: function (e, t) { | |
return _("move", e, "ng-move", t) | |
}, beforeSetClass: function (e, t, n, r) { | |
var o = w(n, "-remove") + " " + w(t, "-add"), i = C("setClass", e, o, function (r) { | |
var o = e.attr("class"); | |
return e.removeClass(n), e.addClass(t), r = r(), e.attr("class", o), r | |
}); | |
if (i) return d(0, function () { | |
v(e), y(e), r() | |
}), i; | |
r() | |
}, beforeAddClass: function (e, t, n) { | |
var r = C("addClass", e, w(t, "-add"), function (n) { | |
return e.addClass(t), n = n(), e.removeClass(t), n | |
}); | |
if (r) return d(0, function () { | |
v(e), y(e), n() | |
}), r; | |
n() | |
}, setClass: function (e, t, n, r) { | |
return T("setClass", e, (n = w(n, "-remove")) + " " + (t = w(t, "-add")), r) | |
}, addClass: function (e, t, n) { | |
return T("addClass", e, w(t, "-add"), n) | |
}, beforeRemoveClass: function (e, t, n) { | |
var r = C("removeClass", e, w(t, "-remove"), function (n) { | |
var r = e.attr("class"); | |
return e.removeClass(t), n = n(), e.attr("class", r), n | |
}); | |
if (r) return d(0, function () { | |
v(e), y(e), n() | |
}), r; | |
n() | |
}, removeClass: function (e, t, n) { | |
return T("removeClass", e, w(t, "-remove"), n) | |
} | |
} | |
}]) | |
}]) | |
}(window, window.angular), function () { | |
"use strict"; | |
var e = "placeholder" in document.createElement("input"), t = angular.module("html5.placeholder", []), | |
n = function (e, t) { | |
var n = e.getAttributeNode(t); | |
return n ? n.nodeValue : n | |
}; | |
t.factory("placeholder", function () { | |
var t; | |
if (e) t = function (e, t) { | |
t && t({ | |
back: function () { | |
} | |
}) | |
}; else { | |
var r = "placeholderTmp" + +new Date, o = { | |
commit: function (e) { | |
angular.forEach(e, function (e) { | |
var t, o = angular.element(e); | |
t = n(e, "placeholder"), o.val() == t && (o.data(r, o.val()), o.val("")) | |
}) | |
}, doRollback: function (e) { | |
angular.forEach(e, function (e) { | |
var t, n = angular.element(e); | |
(t = n.data(r)) && (n.val(t), n.data(r, null)) | |
}) | |
} | |
}; | |
t = function (e, t) { | |
var n; | |
e.length && "form" == e[0].tagName.toLowerCase() ? (n = e.find("input"), n = function (e, t) { | |
return angular.forEach(t, function (t) { | |
e.push(t) | |
}), e | |
}(e.find("textarea"), n)) : n = e, o.commit(n), t && t({ | |
back: function () { | |
o.doRollback(n) | |
} | |
}) | |
} | |
} | |
return {ensure: t} | |
}), e || t.directive("placeholder", [function () { | |
var e, t, r, o, i = "_placeholder_" + +new Date, a = "focus", c = "blur", | |
s = /msie 9/i.test(navigator.userAgent); | |
return r = function (e) { | |
"password" == e.data(i).type && e.attr("type", "text") | |
}, o = function (e) { | |
"password" == e.data(i).type && e.attr("type", "password") | |
}, e = function () { | |
var e = angular.element(this); | |
e.val() == n(this, "placeholder") && (e.val(""), o(e)) | |
}, t = function () { | |
var e = angular.element(this); | |
"" == e.val() && (e.val(n(this, "placeholder")), r(e)) | |
}, { | |
link: function (n, l, u) { | |
n.$watch("ready", function () { | |
return "password" != l.attr("type") || s ? (l.val(u.placeholder).data(i, {type: (l.attr("type") || "").toLowerCase()}).bind(a, e).bind(c, t), r(l), void n.$on("$destroy", function () { | |
l.unbind(a, e).unbind(c, t), o(l) | |
})) : {} | |
}) | |
} | |
} | |
}]) | |
}(), function (e, t, n) { | |
"use strict"; | |
t.module("ngCookies", ["ng"]).factory("$cookies", ["$rootScope", "$browser", function (e, n) { | |
var r, o = {}, i = {}, a = !1, c = t.copy, s = t.isUndefined; | |
return n.addPollFn(function () { | |
var t = n.cookies(); | |
r != t && (r = t, c(t, i), c(t, o), a && e.$apply()) | |
})(), a = !0, e.$watch(function () { | |
var e, r, a; | |
for (e in i) s(o[e]) && n.cookies(e, void 0); | |
for (e in o) r = o[e], t.isString(r) || (r = "" + r, o[e] = r), r !== i[e] && (n.cookies(e, r), a = !0); | |
if (a) for (e in r = n.cookies(), o) o[e] !== r[e] && (s(r[e]) ? delete o[e] : o[e] = r[e]) | |
}), o | |
}]).factory("$cookieStore", ["$cookies", function (e) { | |
return { | |
get: function (n) { | |
return (n = e[n]) ? t.fromJson(n) : n | |
}, put: function (n, r) { | |
e[n] = t.toJson(r) | |
}, remove: function (t) { | |
delete e[t] | |
} | |
} | |
}]) | |
}(window, window.angular), function (e, t, n) { | |
"use strict"; | |
function r(e) { | |
var t, n = {}; | |
for (e = e.split(","), t = 0; t < e.length; t++) n[e[t]] = !0; | |
return n | |
} | |
function o(e) { | |
if (!e) return ""; | |
var t = P.exec(e); | |
e = t[1]; | |
var n = t[3]; | |
return (t = t[2]) && (A.innerHTML = t.replace(/</g, "<"), t = "textContent" in A ? A.textContent : A.innerText), e + t + n | |
} | |
function i(e) { | |
return e.replace(/&/g, "&").replace(g, function (e) { | |
return "&#" + (1024 * (e.charCodeAt(0) - 55296) + ((e = e.charCodeAt(1)) - 56320) + 65536) + ";" | |
}).replace(v, function (e) { | |
return "&#" + e.charCodeAt(0) + ";" | |
}).replace(/</g, "<").replace(/>/g, ">") | |
} | |
function a(e, n) { | |
var r = !1, o = t.bind(e, e.push); | |
return { | |
start: function (e, a, c) { | |
e = t.lowercase(e), !r && _[e] && (r = e), r || !0 !== S[e] || (o("<"), o(e), t.forEach(a, function (r, a) { | |
var c = t.lowercase(a), s = "img" === e && "src" === c || "background" === c; | |
!0 !== b[c] || !0 === w[c] && !n(r, s) || (o(" "), o(a), o('="'), o(i(r)), o('"')) | |
}), o(c ? "/>" : ">")) | |
}, end: function (e) { | |
e = t.lowercase(e), r || !0 !== S[e] || (o("</"), o(e), o(">")), e == r && (r = !1) | |
}, chars: function (e) { | |
r || o(i(e)) | |
} | |
} | |
} | |
var c = t.$$minErr("$sanitize"), | |
s = /^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/, | |
l = /^<\/\s*([\w:-]+)[^>]*>/, | |
u = /([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g, d = /^</, p = /^<\//, | |
f = /\x3c!--(.*?)--\x3e/g, m = /<!DOCTYPE([^>]*?)>/i, h = /<!\[CDATA\[(.*?)]]\x3e/g, | |
g = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, v = /([^\#-~| |!])/g, y = r("area,br,col,hr,img,wbr"); | |
e = r("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"), n = r("rp,rt"); | |
var E = t.extend({}, n, e), | |
C = t.extend({}, e, r("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")), | |
T = t.extend({}, n, r("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")), | |
_ = r("script,style"), S = t.extend({}, y, C, T, E), | |
w = r("background,cite,href,longdesc,src,usemap"), | |
b = t.extend({}, w, r("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,target,title,type,valign,value,vspace,width")), | |
A = document.createElement("pre"), P = /^(\s*)([\s\S]*?)(\s*)$/; | |
t.module("ngSanitize", []).provider("$sanitize", function () { | |
this.$get = ["$$sanitizeUri", function (e) { | |
return function (n) { | |
var r = []; | |
return function (e, n) { | |
function r(e, r, a, c) { | |
if (r = t.lowercase(r), C[r]) for (; S.last() && T[S.last()];) i(0, S.last()); | |
E[r] && S.last() == r && i(0, r), (c = y[r] || !!c) || S.push(r); | |
var s = {}; | |
a.replace(u, function (e, t, n, r, i) { | |
s[t] = o(n || r || i || "") | |
}), n.start && n.start(r, s, c) | |
} | |
function i(e, r) { | |
var o, i = 0; | |
if (r = t.lowercase(r)) for (i = S.length - 1; 0 <= i && S[i] != r; i--) ; | |
if (0 <= i) { | |
for (o = S.length - 1; o >= i; o--) n.end && n.end(S[o]); | |
S.length = i | |
} | |
} | |
"string" != typeof e && (e = null == e ? "" : "" + e); | |
var a, g, v, S = [], w = e; | |
for (S.last = function () { | |
return S[S.length - 1] | |
}; e;) { | |
if (v = "", g = !0, S.last() && _[S.last()] ? (e = e.replace(RegExp("(.*)<\\s*\\/\\s*" + S.last() + "[^>]*>", "i"), function (e, t) { | |
return t = t.replace(f, "$1").replace(h, "$1"), n.chars && n.chars(o(t)), "" | |
}), i(0, S.last())) : (0 === e.indexOf("\x3c!--") ? 0 <= (a = e.indexOf("--", 4)) && e.lastIndexOf("--\x3e", a) === a && (n.comment && n.comment(e.substring(4, a)), e = e.substring(a + 3), g = !1) : m.test(e) ? (a = e.match(m)) && (e = e.replace(a[0], ""), g = !1) : p.test(e) ? (a = e.match(l)) && (e = e.substring(a[0].length), a[0].replace(l, i), g = !1) : d.test(e) && ((a = e.match(s)) ? (a[4] && (e = e.substring(a[0].length), a[0].replace(s, r)), g = !1) : (v += "<", e = e.substring(1))), g && (v += 0 > (a = e.indexOf("<")) ? e : e.substring(0, a), e = 0 > a ? "" : e.substring(a), n.chars && n.chars(o(v)))), e == w) throw c("badparse", e); | |
w = e | |
} | |
i() | |
}(n, a(r, function (t, n) { | |
return !/^unsafe/.test(e(t, n)) | |
})), r.join("") | |
} | |
}] | |
}), t.module("ngSanitize").filter("linky", ["$sanitize", function (e) { | |
var n = /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>]/, r = /^mailto:/; | |
return function (o, i) { | |
function c(e) { | |
e && f.push(function (e) { | |
var n = []; | |
return a(n, t.noop).chars(e), n.join("") | |
}(e)) | |
} | |
function s(e, n) { | |
f.push("<a "), t.isDefined(i) && (f.push('target="'), f.push(i), f.push('" ')), f.push('href="'), f.push(e), f.push('">'), c(n), f.push("</a>") | |
} | |
if (!o) return o; | |
for (var l, u, d, p = o, f = []; l = p.match(n);) u = l[0], l[2] == l[3] && (u = "mailto:" + u), d = l.index, c(p.substr(0, d)), s(u, l[0].replace(r, "")), p = p.substring(d + l[0].length); | |
return c(p), e(f.join("")) | |
} | |
}]) | |
}(window, window.angular), function (e, t) { | |
"function" == typeof define && define.amd ? define([], function () { | |
return t() | |
}) : "object" == typeof exports ? module.exports = t() : t() | |
}(0, function () { | |
"use strict"; | |
return angular.module("tmh.dynamicLocale", []).config(["$provide", function (e) { | |
function t(e) { | |
return e.$stateful = !0, e | |
} | |
e.decorator("dateFilter", ["$delegate", t]), e.decorator("numberFilter", ["$delegate", t]), e.decorator("currencyFilter", ["$delegate", t]) | |
}]).constant("tmhDynamicLocale.STORAGE_KEY", "tmhDynamicLocale.locale").provider("tmhDynamicLocale", ["tmhDynamicLocale.STORAGE_KEY", function (e) { | |
function t(e, t, n, i, a, l, u) { | |
function d(e, t) { | |
o === n && (angular.forEach(e, function (n, r) { | |
t[r] ? angular.isArray(t[r]) && (e[r].length = t[r].length) : delete e[r] | |
}), angular.forEach(t, function (n, r) { | |
angular.isArray(t[r]) || angular.isObject(t[r]) ? (e[r] || (e[r] = angular.isArray(t[r]) ? [] : {}), d(e[r], t[r])) : e[r] = t[r] | |
})) | |
} | |
if (s[n]) return s[n]; | |
var p, f = a.defer(); | |
return n === o ? f.resolve(t) : (p = l.get(n)) ? (o = n, i.$evalAsync(function () { | |
d(t, p), r.put(c, n), i.$broadcast("$localeChangeSuccess", n, t), f.resolve(t) | |
})) : (o = n, s[n] = f.promise, function (e, t, n, r) { | |
var o = document.createElement("script"), i = document.getElementsByTagName("body")[0], | |
a = !1; | |
o.type = "text/javascript", o.readyState ? o.onreadystatechange = function () { | |
("complete" === o.readyState || "loaded" === o.readyState) && (o.onreadystatechange = null, r(function () { | |
a || (a = !0, i.removeChild(o), t()) | |
}, 30, !1)) | |
} : (o.onload = function () { | |
a || (a = !0, i.removeChild(o), t()) | |
}, o.onerror = function () { | |
a || (a = !0, i.removeChild(o), n()) | |
}), o.src = e, o.async = !1, i.appendChild(o) | |
}(e, function () { | |
var e = angular.injector(["ngLocale"]).get("$locale"); | |
d(t, e), l.put(n, e), delete s[n], i.$apply(function () { | |
r.put(c, n), i.$broadcast("$localeChangeSuccess", n, t), f.resolve(t) | |
}) | |
}, function () { | |
delete s[n], i.$apply(function () { | |
o === n && (o = t.id), i.$broadcast("$localeChangeError", n), f.reject(n) | |
}) | |
}, u)), f.promise | |
} | |
var n, r, o, i = "angular/i18n/angular-locale_{{locale}}.js", a = "tmhDynamicLocaleStorageCache", | |
c = e, s = {}; | |
this.localeLocationPattern = function (e) { | |
return e ? (i = e, this) : i | |
}, this.useStorage = function (e) { | |
a = e | |
}, this.useCookieStorage = function () { | |
this.useStorage("$cookieStore") | |
}, this.defaultLocale = function (e) { | |
n = e | |
}, this.storageKey = function (e) { | |
return e ? (c = e, this) : c | |
}, this.$get = ["$rootScope", "$injector", "$interpolate", "$locale", "$q", "tmhDynamicLocaleCache", "$timeout", function (e, s, l, u, d, p, f) { | |
function m(n) { | |
return t(h({locale: n}), u, n, e, d, p, f) | |
} | |
var h = l(i); | |
return r = s.get(a), e.$evalAsync(function () { | |
var e; | |
(e = r.get(c) || n) && m(e) | |
}), { | |
set: m, get: function () { | |
return o | |
} | |
} | |
}] | |
}]).provider("tmhDynamicLocaleCache", function () { | |
this.$get = ["$cacheFactory", function (e) { | |
return e("tmh.dynamicLocales") | |
}] | |
}).provider("tmhDynamicLocaleStorageCache", function () { | |
this.$get = ["$cacheFactory", function (e) { | |
return e("tmh.dynamicLocales.store") | |
}] | |
}).run(["tmhDynamicLocale", angular.noop]), "tmh.dynamicLocale" | |
}), angular.module("tp.i18n", ["ajaxServices", "ngCookies", "tmh.dynamicLocale", "tinypassServices"]).config(["tmhDynamicLocaleProvider", function (e) { | |
e.localeLocationPattern("/libs/angular-1.2.22/i18n/angular-locale_{{locale | replaceUnderscoreToDash}}.js") | |
}]).run(["lang", function (e) { | |
var t = TPParam.TRANSLATION_CONFIG && TPParam.TRANSLATION_CONFIG.initialLocaleId || void 0; | |
e.update(t) | |
}]).directive("t", ["$compile", "lang", function (e, t) { | |
var n = /^arg(\d+)$/i; | |
return { | |
restrict: "AE", compile: function (r, o) { | |
var i = r.html(), a = []; | |
return angular.forEach(o, function (e, t) { | |
var r = t.match(n); | |
r && r[1] && (a[r[1]] = e) | |
}), function (n, r, o) { | |
var c = TPParam.TRANSLATION_CONFIG && TPParam.TRANSLATION_CONFIG.templateContext || "", | |
s = o.context ? o.context : c; | |
function l(o, c) { | |
var l = c && (c[s + i] || c[i]) || i; | |
r.empty().append(t.formatString(l, a)), e(r.contents())(n) | |
} | |
s += "", l(), t.on(l), n.$on("$destroy", function () { | |
t.off(l) | |
}) | |
} | |
} | |
} | |
}]).directive("languageSelector", ["lang", function (e) { | |
return { | |
restrict: "E", | |
scope: {}, | |
template: '<div ng-show="areLanguagesAvailable()" class="language-wrapper"> <div id="language-label" class="language-label" ng-click="toggleMenu()">{{locale | shortLocale}}</div> <ul id="language-list" class="language-list" ng-class="{\'show\': opened === true, \'hide\': opened === false}"> <li ng-repeat="(index, value) in languages | filter:showAvailableLanguage" ng-click="changeLanguage(value.locale)"> <div ng-class="{\'selected\': value.locale === locale}">{{value.localized}}</div> </li> </ul></div>', | |
link: function (e, t) { | |
function n(n) { | |
jQuery(n.target)[0] !== t.find("#language-label")[0] && (e.opened = !1, jQuery(window).off("click"), e.$apply()) | |
} | |
e.toggleMenu = function () { | |
e.opened = !e.opened, jQuery(window).off("click"), jQuery(window).on("click", n) | |
}, e.opened = !1 | |
}, | |
controller: ["$scope", function (t) { | |
function n(e) { | |
t.locale = e | |
} | |
function r(e) { | |
t.languages = e | |
} | |
t.languages = [], t.locale = null, t.showAvailableLanguage = function (e) { | |
return !!e.isEnabled && e | |
}, t.changeLanguage = function (n) { | |
t.locale = n, e.update(t.locale) | |
}, t.isLanguagesEnabled = TPParam.TRANSLATION_CONFIG.isEnabled, e.on(n), t.$on("$destroy", function () { | |
e.off(n) | |
}), e.list().then(r), t.areLanguagesAvailable = function () { | |
return t.isLanguagesEnabled && t.languages.length > 1 | |
} | |
}] | |
} | |
}]).filter("shortLocale", function () { | |
return function (e) { | |
var t = e.toUpperCase().split("_"); | |
return t[0] + "-" + t[1] | |
} | |
}).filter("t", ["lang", function (e) { | |
return function (t, n) { | |
var r = TPParam.TRANSLATION_CONFIG && TPParam.TRANSLATION_CONFIG.templateContext || ""; | |
return e.trc(r, t, n) | |
} | |
}]).filter("tc", ["lang", function (e) { | |
return function (t, n, r) { | |
return e.trc(n, t, r) | |
} | |
}]).filter("replaceUnderscoreToDash", function () { | |
return function (e) { | |
return e.toString().toLowerCase().replace("_", "-") | |
} | |
}).filter("replaceDashToUnderscore", function () { | |
return function (e) { | |
var t; | |
return null === e.match(/\-/g) ? e : ((t = e.toUpperCase().split("-"))[0] = t[0].toLowerCase(), t.join("_")) | |
} | |
}).factory("lang", ["tpHTTP", "$q", "$locale", "$cookies", "tmhDynamicLocale", "resolveLocale", "cookieLang", "$rootScope", "$filter", function (e, t, n, r, o, i, a, c, s) { | |
var l, u = i(), d = !1, p = [], f = null, m = {translationMapStatic: {}, translationMapDynamic: {}}, | |
h = {}, g = {}; | |
return c.$on("CHECK_UPDATED_LANGUAGE", T), E(), P(), { | |
update: A, on: function (e, t) { | |
p.push(e), t || e(u, h[u]) | |
}, off: function (e) { | |
var t = p.indexOf(e); | |
-1 !== t && p.splice(t, 1) | |
}, tr: function (e) { | |
for (var t = new Array(arguments.length - 1), n = 0; n < t.length; ++n) t[n] = arguments[n + 1]; | |
return h[u] && _(h[u][e], t) || _(e, t) | |
}, trc: function (e, t, n) { | |
var r, o; | |
if (angular.isArray(n)) o = n; else { | |
o = new Array(arguments.length - 2); | |
for (var i = 0; i < o.length; ++i) o[i] = arguments[i + 2] | |
} | |
if (h[u]) return r = e + "" + t, e && h[u][r] ? _(h[u][r], o) : h[u][t] ? _(h[u][t], o) : _(t, o); | |
return _(t, o) | |
}, list: function () { | |
if (!TPParam.TRANSLATION_CONFIG.isEnabled) return t.when([]); | |
f || (f = t.when(TPParam.TRANSLATION_CONFIG.languages).then(function (e) { | |
return e, A(u), e | |
})); | |
return f | |
}, formatString: _, getLang: v, getLanguageTag: y | |
}; | |
function v() { | |
return d && u || "" | |
} | |
function y() { | |
return (v() || u).replace("_", "-") | |
} | |
function E() { | |
C(), l = setInterval(T, 500) | |
} | |
function C() { | |
l && clearInterval(l) | |
} | |
function T() { | |
var e = a.getCookie("LANG_CHANGED"); | |
e && e !== u && '""' !== e && A(e) | |
} | |
function _(e, t) { | |
return angular.isUndefined(e) || null === e ? e : e.replace(/<t([^>]+)?>|<\/t>/g, "").replace(/{(\d+)}/g, function (e, n) { | |
return void 0 !== t[n] ? t[n] : e | |
}) | |
} | |
function S(e) { | |
h[u] = e, p.forEach(function (e) { | |
e(u, h[u]) | |
}) | |
} | |
function w(e, n) { | |
var r, o, i, a = t.defer(); | |
return e && ((r = document.querySelector('script[src*="' + e + '"]')) || (o = document.getElementsByTagName("head")) && o.length && (i = o[0]) && ((r = document.createElement("script")).onload = function () { | |
return window["translation" + n] ? a.resolve(window["translation" + n]) : a.reject("Unable to load") | |
}, r.setAttribute("src", e), r.setAttribute("type", "text/javascript"), r.setAttribute("charset", "utf-8"), i.appendChild(r))), a.promise | |
} | |
function b(e) { | |
var n = "/ng/common/i18n/platform-translation-map_" + e + ".js?version=" + TPParam.TRANSLATION_CONFIG.version, | |
r = TPParam.TRANSLATION_CONFIG.loadTranslationUrl + "&language=" + e, | |
o = window["translation_static_" + e]; | |
return TPParam.TRANSLATION_CONFIG.isStatic ? o ? t.when(o) : w(n, "_static_" + e).then(function () { | |
return t.when(window["translation_static_" + e]) | |
}) : t.all({ | |
translationMapStatic: w(n, "_static_" + e).then(function (e) { | |
return e | |
}), translationMapDynamic: w(r, "_dynamic_" + e).then(function (e) { | |
return e | |
}) | |
}).then(function (e) { | |
return m.translationMapStatic = e.translationMapStatic, m.translationMapDynamic = e.translationMapDynamic, t.when(angular.extend({}, e.translationMapStatic, e.translationMapDynamic)) | |
}).catch(function (t) { | |
h = function (e, t) { | |
var n = [], r = {}; | |
"string" == typeof t && (n = [t]); | |
angular.isArray(t) && (n = [].concat(t)); | |
angular.isArray(e) && e.forEach(function (e, t) { | |
r[t] = e | |
}); | |
angular.isObject(e) && !angular.isArray(e) && (r = angular.extend({}, e)); | |
return n.forEach(function (e) { | |
delete r[e] | |
}), r | |
}(h, e) | |
}) | |
} | |
function A(e) { | |
C(), TPParam.TRANSLATION_CONFIG && TPParam.TRANSLATION_CONFIG.isEnabled && (angular.isUndefined(e) && (e = a.getCookie("LANG") || "en_US"), function (e) { | |
u = e, d = !0, e !== a.getCookie("LANG") && (a.setCookie("LANG", u, 1500), a.setCookie("LANG_CHANGED", u, 1)); | |
var t = s("replaceUnderscoreToDash")(e); | |
g[t] || n.id != t || (g[t] = angular.copy(n)); | |
g[t] && function e(t, n) { | |
angular.forEach(t, function (e, r) { | |
n[r] ? angular.isArray(n[r]) && (t[r].length = n[r].length) : delete t[r] | |
}); | |
angular.forEach(n, function (r, o) { | |
angular.isArray(n[o]) || angular.isObject(n[o]) ? (t[o] || (t[o] = angular.isArray(n[o]) ? [] : {}), e(t[o], n[o])) : t[o] = n[o] | |
}) | |
}(n, g[t]); | |
e != TPParam.TRANSLATION_CONFIG.initialLocaleId && (g[t] || o.set(t).then(function (e) { | |
g[e.id] = angular.copy(e) | |
}), function (e) { | |
window.TPParam.TRANSLATION_CONFIG && window.TPParam.TRANSLATION_CONFIG.initialLocaleId && (window.TPParam.TRANSLATION_CONFIG.initialLocaleId = e) | |
}(u)) | |
}(e), P(), E(), function (e) { | |
var n = window["translation_static_" + e], r = window["translation_dynamic_" + e]; | |
if (h[e]) return t.when(h[e]); | |
if (n || r) return h[e] = angular.extend({}, n, r), t.when(h[e]); | |
return b(e).then(function (t) { | |
return h[e] = t, t | |
}) | |
}(e).then(S).then(function () { | |
c.$broadcast("EVENT_I18N_LOCALE_CHANGED") | |
})) | |
} | |
function P() { | |
if ("undefined" != typeof moment) try { | |
moment.locale ? moment.locale(y()) : moment.lang(y()) | |
} catch (e) { | |
} | |
} | |
}]).factory("resolveLocale", ["$cookies", "$locale", "tmhDynamicLocale", "$filter", "cookieLang", function (e, t, n, r, o) { | |
return function () { | |
o.getCookie("LANG"); | |
return "en_US" | |
} | |
}]).factory("cookieLang", function () { | |
return { | |
getCookie: e, setCookie: function (e, t, n) { | |
var r, o = new Date; | |
o.setTime(o.getTime() + 24 * n * 60 * 60 * 1e3), r = "expires=" + o.toUTCString(), document.cookie = e + "=" + t + "; " + r + "; path=/" | |
}, getCountryCode: function () { | |
if (null == e("LANG") || null == e("LANG") || "" == e("LANG")) return "us"; | |
return e("LANG").split("_")[1].toLowerCase() | |
}, getLanguageCode: function () { | |
if (null == e("LANG") || null == e("LANG") || "" == e("LANG")) return "en"; | |
return e("LANG").split("_")[0] | |
} | |
}; | |
function e(e) { | |
var t = ("; " + document.cookie).split("; " + e + "="); | |
if (t.length > 1) return t.pop().split(";").shift() | |
} | |
}), function () { | |
var dateServices = angular.module("dateServices", []); | |
dateServices.factory("fromIsoToJsDate", function () { | |
return function (e, t) { | |
if (t.length) { | |
for (var n = t.length - 1; n >= 0; n--) t[n][e] && (t[n][e] = moment(t[n][e]).format()); | |
return t | |
} | |
return t[e] && (t[e] = moment(t[e]).format()), t[e] | |
} | |
}), dateServices.factory("TimezoneService", function () { | |
return { | |
SEND_DATETIME_FORMAT: "YYYY-MM-DDTHH:mm:ssZZ", dateToTimezonedMoment: function (e) { | |
return moment.tz(e, TPParam.CLIENT_TIMEZONE) | |
}, dateToClientTimezoneMoment: function (e) { | |
return moment.tz({ | |
year: e.getFullYear(), | |
month: e.getMonth(), | |
date: e.getDate(), | |
hour: e.getHours(), | |
minute: e.getMinutes(), | |
second: e.getSeconds(), | |
millisecond: e.getMilliseconds() | |
}, TPParam.CLIENT_TIMEZONE) | |
}, datesToTimezonedStringsRange: function (e, t) { | |
return { | |
from: this.dateToClientTimezoneMoment(e).startOf("day").format(this.SEND_DATETIME_FORMAT), | |
to: this.dateToClientTimezoneMoment(t).endOf("day").format(this.SEND_DATETIME_FORMAT) | |
} | |
}, momentToDate: function (e) { | |
return new Date(e.year(), e.month(), e.date(), e.hour(), e.minute(), e.second()) | |
} | |
} | |
}); | |
var ajaxServices = angular.module("ajaxServices", []); | |
ajaxServices.config(["$httpProvider", function (e) { | |
e.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest", e.defaults.headers.common["Ng-Request"] = "1", e.interceptors.push("tpHttpInterceptor"); | |
e.defaults.transformRequest.push(function (e, t) { | |
var n = t && t(); | |
return n && n["Piano-request-without-spinner"] || tinypass.withoutWaitPanel ? e : (tinypass.showWaitPanel(), e) | |
}) | |
}]), ajaxServices.factory("tpHttpInterceptor", ["$q", function (e) { | |
return { | |
response: function (e) { | |
return e.data && (e.data.models && (e.models = e.data.models), e.data.errors && (e.errors = e.data.errors)), tinypass.updateMetaRefresh(), tinypass.hideWaitPanel(), e | |
}, responseError: function (t) { | |
return t.data && (t.data.models && (t.models = t.data.models), t.data.errors && (t.errors = t.data.errors)), tinypass.hideWaitPanel(), e.reject(t) | |
} | |
} | |
}]), ajaxServices.factory("tpHTTP", ["$http", "$window", "$q", "$rootScope", function ($http, $window, $q, $rootScope) { | |
var f = function (e, t) { | |
!t && (e.url = $window.TPConfig.PATH + e.url); | |
var n = $http(e); | |
return n.then(f.processHeaders), n | |
}; | |
return f.get = function (e, t) { | |
e = $window.TPConfig.PATH + e; | |
var n = $http.get(e, t); | |
return n.then(f.processHeaders), n | |
}, f.post = function (e, t, n) { | |
e = $window.TPConfig.PATH + e; | |
var r = $http.post(e, t, n); | |
return r.then(f.processHeaders), r | |
}, f.jsonp = function (e, t) { | |
return (t = t || {}).callback = t.callback || "JSON_CALLBACK", $http.jsonp(e, {params: t}).then(function (e) { | |
return e.data | |
}) | |
}, f.processResponse = function (e) { | |
return e.data && e.data.models && (e.models = e.data.models), e.data && e.data.errors && (e.errors = e.data.errors), e | |
}, f.processResponseCatch = function (e) { | |
return e.data && e.data.models && (e.models = e.data.models), e.data && e.data.errors && (e.errors = e.data.errors), $q.reject(e) | |
}, f.processHeaders = function (response) { | |
var headers = response.headers(); | |
if (headers.execute_js_after) try { | |
eval(headers.execute_js_after) | |
} catch (e) { | |
} | |
return response | |
}, f.extractErrors = function (e, t, n) { | |
e && (e.errors || e.modalErrors) && (n.formErrors = e.errors && e.errors.length ? e.errors : e.modalErrors, angular.forEach(n.formErrors, function (e) { | |
var n = e.field, r = (e.key, e.msg); | |
t && t[n] && (angular.element("#" + n).focus(), t[n].$setValidity("error", !1), t[n].$error.msg = r) | |
})) | |
}, f.resetFormErrors = function (e, t, n) { | |
try { | |
n && (n.errors = [], n.modalErrors = []), angular.forEach(t.formErrors, function (t) { | |
e[t.field].$setValidity("error", !0), e[t.field].$setPristine() | |
}), delete t.formErrors, e.$setPristine(), t.$$phase || t.$apply() | |
} catch (e) { | |
Log.info("Could not reset form errors!", e) | |
} | |
}, f.setFieldsValid = function (e, t) { | |
try { | |
angular.forEach(e, function (e, t) { | |
0 != t.indexOf("$") && (e.$setValidity("error", !0), e.$setPristine()) | |
}), e.$setPristine(), t.$$phase || t.$apply() | |
} catch (e) { | |
Log.info("Could not reset form errors!", e) | |
} | |
}, f.extractModels = function (e, t) { | |
if (e && e.models) for (var n in e.models) t[n] = e.models[n]; | |
if (e && e.routes) for (var r in void 0 === t.routes && (t.routes = {}), e.routes) t.routes[r] = e.routes[r] | |
}, f.promiseResponse = function (e, t) { | |
var n = $q.defer(); | |
return t.errors = [], e.then(function (e) { | |
if (e && e.errors && angular.copy(e.errors, t.errors), e && e.models) for (var r in e.models) e.models.hasOwnProperty(r) && (t[r] = e.models[r]); | |
n.resolve() | |
}).catch(function (e) { | |
e && e.errors && angular.copy(e.errors, t.errors), n.reject() | |
}), n.promise | |
}, f.extractModelsTo = function (e) { | |
return function (t) { | |
f.extractModels(t.data, e) | |
} | |
}, f.successHander = function (e) { | |
return function (t) { | |
e.resolve({data: t, ok: !0}) | |
} | |
}, f.errorHander = function (e) { | |
return function (t) { | |
e.resolve({data: t, ok: !1}) | |
} | |
}, f.promiser = function (e) { | |
var t = $q.defer(); | |
return e.then(f.successHander(t)).catch(f.errorHander(t)), t.promise | |
}, f.buildUrl = function (e, t) { | |
if (!t) return e; | |
var n = []; | |
return function (e, t, n) { | |
for (var r = function (e) { | |
var t = []; | |
for (var n in e) e.hasOwnProperty(n) && t.push(n); | |
return t.sort() | |
}(e), o = 0; o < r.length; o++) t.call(n, e[r[o]], r[o]) | |
}(t, function (e, t) { | |
null != e && null != e && (angular.isObject(e) && (e = angular.toJson(e)), n.push(encodeURIComponent(t) + "=" + encodeURIComponent(e))) | |
}), e + (-1 == e.indexOf("?") ? "?" : "&") + n.join("&") | |
}, f | |
}]); | |
var tinypassService = angular.module("tinypassServices", []); | |
tinypassService.factory("TinypassService", ["$q", function (e) { | |
return { | |
setMessage: function (e, t) { | |
tinypass.setMessageDashboard(e, t) | |
}, hideMessage: function () { | |
tinypass.hideMessage() | |
}, cropImage: function (e, t, n, r, o, i, a, c, s) { | |
tinypass.cropImage(e, t, n, r, o, i, a, c, s) | |
}, getISODate: function (e, t) { | |
var n, r; | |
return n = new Date(e.getFullYear(), e.getMonth(), e.getDate()), r = new Date(t.getFullYear(), t.getMonth(), t.getDate(), 23, 59, 59), { | |
from: moment(n).format("YYYY-MM-DDTHH:mm:ssZZ"), | |
to: moment(r).format("YYYY-MM-DDTHH:mm:ssZZ") | |
} | |
}, reduceZeros: function (e) { | |
var t = (e = Math.round(e)) / 1e3 + ""; | |
return 0 != e && (t = (t = (t = (t + (t.indexOf(".") < 0 ? "." : "") + "000").replace(/(\..{3}).*$/, "$1")).substring(0, t.length - Math.min(3, (e + "").length - 2)).replace(/[.]$/, "")).split("").reverse().join("").replace(/((\d{3})(?!($|-|.*[.])))/g, "$1,").split("").reverse().join("")), t | |
}, genrateRandomString: function (e) { | |
e = e || 10; | |
for (var t = "", n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", r = 0; r < e; r++) t += n.charAt(Math.floor(Math.random() * n.length)); | |
return t | |
}, generateSuccessMessage: function (e) { | |
return function () { | |
tinypass.setMessage("success", e) | |
} | |
}, generateErrorMessage: function (t) { | |
return function () { | |
return tinypass.setMessage("error", t), e.reject() | |
} | |
}, showRequestError: function (t) { | |
return tinypass.setMessage("error", t.data.errors[0].msg), e.reject(t) | |
}, showRequestErrorDashboard: function (t) { | |
return tinypass.setMessageDashboard("error", t.data.errors[0].msg), e.reject(t) | |
}, getInMinorUnits: function (e) { | |
return e ? Math.round(100 * e) : 0 | |
}, getCurrencyByCode: function (e) { | |
if ("" == e) return "$"; | |
var t; | |
switch (e) { | |
case"USD": | |
t = "$"; | |
break; | |
case"EUR": | |
t = "€"; | |
break; | |
case"AUD": | |
t = "$"; | |
break; | |
case"GBP": | |
t = "£"; | |
break; | |
case"JPY": | |
t = "Â¥"; | |
break; | |
default: | |
t = e | |
} | |
return t | |
}, setCookie: function (e, t, n) { | |
var r = new Date; | |
r.setTime(r.getTime() + 24 * n * 60 * 60 * 1e3); | |
var o = "expires=" + r.toUTCString(); | |
document.cookie = e + "=" + t + "; " + o + "; path=/" | |
}, getCookie: function (e) { | |
var t = ("; " + document.cookie).split("; " + e + "="); | |
if (t.length > 1) return t.pop().split(";").shift() | |
} | |
} | |
}]), tinypassService.factory("modalConfirm", ["$rootScope", "$modal", function (e, t) { | |
return function (n, r, o, i) { | |
var a = e.$new(); | |
a.title = n, a.msg = r; | |
var c = {scope: a, templateUrl: "/libs/tinypass/_confirm_popup.shtml"}, s = t.open(c); | |
function l(e) { | |
s.close(e) | |
} | |
return a.onOk = function () { | |
_.isFunction(i) ? i().then(l) : l(o) | |
}, s.result | |
} | |
}]), tinypassService.factory("UpdatePerfectScrollbar", ["UpdateSpecificScrollbar", function (e) { | |
return function (t) { | |
if (t && t.target && t.target.nodeName) { | |
var n, r, o = $(t.target); | |
if ("input" == t.target.nodeName.toLowerCase()) { | |
var i = o.parents(".tp-dropdown__container"), a = o.parents(".dropdown-menu"); | |
return void (a.length > 0 ? a : i).find(".ps-container").each(function () { | |
var e = $(this); | |
e.is(":visible") && e.scrollTop(0) | |
}) | |
} | |
n = o.parent().outerHeight(!0), r = o.parents(".ps-container"), e(r, n) | |
} | |
} | |
}]), tinypassService.factory("UpdateSpecificScrollbar", function () { | |
return function (e, t) { | |
var n = e.children().height(), r = e.height(), o = e.scrollTop(); | |
o + r + t >= n && n >= r && e.scrollTop(o - t) | |
} | |
}), tinypassService.factory("iframeService", ["$rootElement", function (e) { | |
return { | |
injectHiddenIframe: t, injectHiddenIframeWithTimeout: function (e, n, r, o) { | |
var i = t(e, n), a = window.setTimeout(function () { | |
angular.element("#" + e).remove(), o && o() | |
}, r || 15e3); | |
return { | |
iframe: i, cancel: function () { | |
window.clearTimeout(a) | |
} | |
} | |
}, injectIframe: function (e, t, r) { | |
var o = t ? ' src="' + t + '" ' : ""; | |
return n(angular.element("<iframe " + o + "></iframe>"), e, r, { | |
backgroundColor: "transparent", | |
border: "0", | |
width: "100%", | |
height: "100%", | |
position: "relative", | |
zIndex: 4 | |
}) | |
}, injectRealIframe: function (e, t, r) { | |
return n(angular.element(t), e, r, { | |
backgroundColor: "#ffffff", | |
border: "0", | |
width: "100%", | |
height: "100%", | |
position: "relative", | |
zIndex: 1 | |
}) | |
}, injectHungTimeoutIframe: function (e, n) { | |
return window.setTimeout(function () { | |
var r = t(e), o = r.contentWindow ? r.contentWindow.document : r.contentDocument; | |
o.open("text/html", "replace"), o.write('<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript"> function submitform() { document.forms["page_return"].submit(); } <\/script> </head> <body onload="submitform()"> <form name="page_return" method="post" action="' + n + '"> <input type="hidden" name="resultCode" value="999"> <input type="hidden" name="message" value="Request timeout"> </form> </body></html>'), o.close() | |
}, 15e3) | |
}, appendContentToIframe: function (e, t) { | |
var n = e.contentWindow ? e.contentWindow.document : e.contentDocument; | |
n.open("text/html", "replace"), n.write(t), n.close() | |
} | |
}; | |
function t(t, n) { | |
var r = n ? ' src="' + n + '" ' : ""; | |
angular.element("#" + t).remove(); | |
var o = angular.element('<iframe id="' + t + '"' + r + ' style="display: none"></iframe>')[0]; | |
return e.append(o), o | |
} | |
function n(e, t, n, r) { | |
angular.element("#" + t).remove(), e.attr({allowtransparency: "true", id: t}).css(r); | |
var o = e[0]; | |
return n.append(o), o | |
} | |
}]); | |
var selectFactory = angular.module("selectFactory", ["ajaxServices"]); | |
selectFactory.factory("selectServiceFactory", ["tpHTTP", "$timeout", function (e, t) { | |
return function (n) { | |
var r = {}, o = !!n.invalidateUpdate, i = { | |
search: function (n) { | |
var a = r[n]; | |
a && !i.instantUpdate || (a = function (n) { | |
r[n] = function (t) { | |
var n = i.buildParams(t); | |
return e.post(i.endpoint, n).then(i.extractItems).catch(function (e) { | |
}) | |
}(n), i.instantUpdate = !1, o && t(function () { | |
delete r[n] | |
}, 1e3); | |
return r[n] | |
}(n)); | |
return a | |
} | |
}; | |
return angular.extend(i, n), i | |
} | |
}]), selectFactory.factory("selectDirectiveFactory", ["$timeout", "UpdatePerfectScrollbar", "$perfectScrollBarService", function (e, t, n) { | |
return function (r) { | |
return { | |
restrict: "AE", | |
replace: !0, | |
transclude: !0, | |
scope: {ngModel: "=", item: "=", clickFn: "=?", searchFn: "=?", clickOnClose: "=?"}, | |
require: "ngModel", | |
templateUrl: r.templateUrl, | |
link: function (o, i, a, c) { | |
var s, l = {}; | |
if (o.disabled = "true" == a.ngDisabled, o.disabled) return; | |
o.closeOnSelect = void 0 !== a.closeOnSelect, o.multiple = void 0 !== a.multiple, o.excludeSelected = void 0 !== a.excludeSelected, o.showCheckbox = o.multiple && !o.excludeSelected, o.model = { | |
filter: "", | |
list: [], | |
selected: {} | |
}, o.onSearch = u, o.searchItems = f, o.updateScrollBar = p, o.cancelClick = function (e) { | |
e.stopPropagation(), e.preventDefault() | |
}, o.closeDropdown = function () { | |
$(".dropdown.open", i).removeClass("open") | |
}, o.setItem = function (e, t) { | |
if (_.isUndefined(e.disabled) || !e.disabled) { | |
if (o.multiple) { | |
var n = angular.copy(o.ngModel || []), r = d(e, n); | |
null === r ? n.push(e) : n.splice(r, 1), o.ngModel = n, c.$setViewValue(o.ngModel) | |
} else o.ngModel = e, c.$setViewValue(o.ngModel); | |
o.closeOnSelect && (o.closeDropdown(), o.clickOnClose && o.clickOnClose(o.ngModel)), p(t) | |
} | |
}, o.modelContains = function (e) { | |
return null !== d(e, o.ngModel || []) | |
}, o.setFocusAfterClick = function () { | |
$("input:first", i).focus() | |
}, o.onOpen = function (e) { | |
o.clickFn && o.clickFn(f), function (e) { | |
e && !l[e] && (l[e] = !0, n.notify("update-perfect-scrollbar")) | |
}(e) | |
}, o.selectAll = function () { | |
if (o.multiple) { | |
var e = o.ngModel || [], t = []; | |
e.length || (t = angular.copy(o.model.list)), o.ngModel = t, c.$setViewValue(o.ngModel) | |
} | |
}, u(), o.multiple && o.$watch("ngModel", function () { | |
!function () { | |
var e = {}; | |
if (!o.multiple) return; | |
if (!o.ngModel || !Array.isArray(o.ngModel) || o.ngModel.length <= 0) return void (o.model.selected = null); | |
o.ngModel.forEach(function (t) { | |
e[t[r.idProperty]] = !0 | |
}), o.model.selected = e | |
}() | |
}, !0); | |
function u(t) { | |
s && e.cancel(s); | |
var n = o.model.filter ? 300 : 0; | |
s = e(function () { | |
f(t) | |
}, n) | |
} | |
function d(e, t) { | |
for (var n = t.length, o = 0; o < n; o++) if (t[o][r.idProperty] === e[r.idProperty]) return o; | |
return null | |
} | |
function p(e) { | |
t(e) | |
} | |
function f(e) { | |
var t = o.searchFn || r.searchService.search; | |
t && t(o.model.filter).then(function (t) { | |
t.forEach(function (e) { | |
e.id = e[r.idProperty] | |
}), o.model.list = t, e && o.updateScrollBar(e) | |
}) | |
} | |
} | |
} | |
} | |
}]); | |
var loggingModule = angular.module("loggingModule", ["ajaxServices"]); | |
loggingModule.factory("loggingService", ["tpHTTP", function (e) { | |
var t = { | |
logToServer: function (t) { | |
try { | |
var n = new Error; | |
e.post(TPParam.LOG_ERROR, {description: t, url: window.location.href, trace: n.stack}) | |
} catch (e) { | |
} | |
} | |
}; | |
return t | |
}]) | |
}(), String.prototype.format = function () { | |
for (var e = this, t = 0; t < arguments.length; t++) { | |
var n = "{" + t + "}"; | |
e = e.replace(n, arguments[t]) | |
} | |
return e | |
}; | |
var Log = { | |
info: function () { | |
"undefined" != typeof console && void 0 !== console.log && console.log.apply(console, arguments) | |
}, error: function () { | |
"undefined" != typeof console && void 0 !== console.error && console.error.apply(console, arguments) | |
}, debug: function () { | |
try { | |
"tpdebug" in localStorage && "undefined" != typeof console && void 0 !== console.log && console.log.apply(console, arguments) | |
} catch (e) { | |
} | |
} | |
}, directives = angular.module("tp.directives", ["tp.ui.grid", "tp.ui.cc", "tp.filters"]); | |
directives.directive("tpclipboard", ["lang", function (e) { | |
return { | |
restrict: "A", scope: {}, link: function (t, n) { | |
new Clipboard(n[0]).on("success", function (n) { | |
t.$apply(function () { | |
tinypass.setMessage("success", e.trc("publisher.dashboard", "Copied to clipboard")) | |
}) | |
}) | |
} | |
} | |
}]), directives.directive("tpUploader", ["$window", function (e) { | |
return function (e, t, n) { | |
$(t).click(function () { | |
var t = n.tpUploader, r = e.$eval(n.onComplete), o = e.$eval(t), i = n.field ? n.field : ""; | |
tinypass.uploadFile2(o.url, function (e) { | |
r(i, e) | |
}) | |
}) | |
} | |
}]), directives.directive("ignoreDirty", function () { | |
return { | |
restrict: "A", require: "ngModel", link: function (e, t, n, r) { | |
r.$pristine = !1 | |
} | |
} | |
}), directives.directive("fakeInput", function () { | |
return { | |
restrict: "E", | |
replace: !0, | |
scope: {value: "=", placeholder: "@", e2e: "@"}, | |
template: '<button data-e2e="{{e2e}}" class="btn-input btn-block">{{value}}<span ng-if="!value" class="placeholder">{{placeholder}}</span></button>' | |
} | |
}), directives.directive("tpImageCrop", ["$timeout", function (e) { | |
return { | |
scope: {cropOptions: "=", cropWidth: "@", cropHeight: "@", imgSrc: "@"}, | |
replace: !0, | |
template: "<img ng-src='{{imgSrc}}' id='crop-target'>", | |
link: function (t, n, r) { | |
var o = {boxWidth: 500, maxWidth: 500, keySupport: !1}; | |
function i() { | |
var n = t.cropOptions; | |
if (n && "object" == typeof n) for (var r in o) n.hasOwnProperty(r) || (n[r] = o[r]); else n = o; | |
t.cropWidth && t.cropHeight && 0 != t.cropHeight && (n.aspectRatio = t.cropWidth / t.cropHeight), e(function () { | |
t.$apply(function () { | |
tinypass.initImageCropper("#crop-target", n, t.cropWidth, t.cropHeight) | |
}) | |
}) | |
} | |
i(), t.$on("tinypass-jcrop-changeImageSrc", function (n, r) { | |
t.imgSrc = r, tinypass.jcrop && tinypass.jcrop.destroy(), t.$apply(), e(function () { | |
i() | |
}) | |
}) | |
} | |
} | |
}]), directives.directive("tpShow", [function () { | |
return function (e, t, n) { | |
var r = n.duration ? n.duration : "slow"; | |
isNaN(parseInt(r, 10)) || (r = parseInt(r, 10)), e.$watch(n.tpShow, function (e) { | |
toBoolean(e) ? $(t).fadeIn(r) : $(t).fadeOut(r) | |
}) | |
} | |
}]), directives.directive("fadey", function () { | |
return { | |
restrict: "A", link: function (e, t, n) { | |
jQuery(t).css({opacity: 0}).animate({opacity: 1}, parseInt(n.fadey)) | |
} | |
} | |
}), directives.directive("animatePosition", function () { | |
return { | |
link: function (e, t, n) { | |
e.$watch(n.animatePosition, function (e) { | |
switch (t.css({bottom: "auto", top: "auto", left: "auto", right: "auto"}), e) { | |
case 1: | |
t.css({right: "0px", top: "0px"}); | |
break; | |
case 2: | |
t.css({left: "0px", top: "0px"}); | |
break; | |
case 3: | |
t.css({left: "0px", bottom: "0px"}); | |
break; | |
case 4: | |
t.css({right: "0px", bottom: "0px"}) | |
} | |
}) | |
} | |
} | |
}), directives.directive("animateMargin", function () { | |
return { | |
link: function (e, t, n) { | |
e.$watch(n.animateMargin, function (e) { | |
$(".top-bottom").css({ | |
height: 300 - 2 * e, | |
marginTop: e | |
}), $(".left-right").css({width: 878 - 2 * e, marginLeft: e}), t.css({padding: e}) | |
}) | |
} | |
} | |
}), directives.directive("iframeContainer", function () { | |
return { | |
scope: {iframeId: "@", refreshFn: "&", maximizeFn: "&", fs: "="}, | |
restrict: "EA", | |
replace: !0, | |
template: '<div class="previewpane {{fs}}"><div class="tppreview" style="position: absolute; width: 100%; height: 100%; z-index: 50;"></div><iframe width="100%" height="100%" class="{{iframeId}}" id="{{iframeId}}" scrolling="no"></iframe><div class="inline-actions" style=\'z-index: 1000;\'><div id="btn-refresh" class="btn-icon rounded" ng-click="refreshFn()"><i class="icon-refresh"></i></div><div id="btn-maximize" class="btn-icon rounded" ng-click="maximizeFn()"><i class="icon-maximize"></i></div></div></div>' | |
} | |
}), directives.directive("errorSection", ["$animate", function (e) { | |
return { | |
scope: {errors: "=", heading: "@?", onCloseCallbackFn: "&?", renderAsPlainText: "=?"}, | |
replace: !0, | |
template: '<div ng-show="errors && errors.length > 0" class="alert alert-block alert-error tinypass-alert-messase"> <button type="button" class="close" ng-click="clear()"><i class="icon-close-light"></i></button> <div class="error-header" ng-show=\'heading\'>{{heading}}</div> <div ng-repeat="error in errors" class="error-line" ng-show=\'error.msg.length > 0\'><strong>·</strong> <span ng-if="renderAsPlainText">{{error.msg}}</span> <span ng-if="!renderAsPlainText" ng-bind-html="error.msg"></span></div></div>', | |
link: function (t, n) { | |
t.clear = function () { | |
t.onCloseCallbackFn && t.onCloseCallbackFn(), e.addClass(n, "fade", function () { | |
t.errors.length = 0, t.$apply() | |
}) | |
}, t.$watchCollection("errors", function (t, r) { | |
"[object Array]" === Object.prototype.toString.call(t) && t.length && e.removeClass(n, "fade") | |
}) | |
}, | |
controller: ["$scope", function (e) { | |
var t, n; | |
try { | |
t = angular.injector(["ng", "tp.i18n"]), (n = t.get("lang")).update() | |
} catch (e) { | |
} | |
var r = void 0 !== n ? n.trc("publisher.dashboard", "Oops! Please fix the errors below and try submitting again.") : "Oops! Please fix the errors below and try submitting again."; | |
e.heading = e.heading || r, e.headingLocalised = e.heading, angular.forEach(e.errors, function (t, r) { | |
return e.errors[r].msg = void 0 !== n ? n.trc("publisher.dashboard", t.msg) : t.msg | |
}) | |
}] | |
} | |
}]), directives.directive("warningSection", ["$animate", function (e) { | |
return { | |
scope: {warnings: "=", heading: "@?", renderAsPlainText: "=?"}, | |
replace: !0, | |
template: '<div ng-show="warnings && warnings.length > 0" class="alert alert-block alert-warning tinypass-alert-messase"> <button type="button" class="close" ng-click="clear()"><i class="icon-close"></i></button> <div class="warning-header" ng-show=\'heading\'>{{heading}}</div> <div ng-repeat="warning in warnings" class="warning-line" ng-show=\'warning.length > 0\'><strong>·</strong> <span ng-if="renderAsPlainText">{{warning}}</span> <span ng-if="!renderAsPlainText" ng-bind-html="warning"></span></div></div>', | |
link: function (t, n) { | |
t.clear = function () { | |
e.addClass(n, "fade", function () { | |
t.warnings.length = 0, t.$apply() | |
}) | |
}, t.$watchCollection("warnings", function (t, r) { | |
"[object Array]" === Object.prototype.toString.call(t) && t.length && e.removeClass(n, "fade") | |
}) | |
}, | |
controller: ["$scope", function (e) { | |
var t, n; | |
try { | |
t = angular.injector(["ng", "tp.i18n"]), (n = t.get("lang")).update() | |
} catch (e) { | |
} | |
var r = void 0 !== n ? n.trc("publisher.dashboard", "Warning!") : "Warning!"; | |
e.heading = e.heading || r, e.headingLocalised = e.heading, angular.forEach(e.warnings, function (t, r) { | |
return e.warnings[r] = void 0 !== n ? n.trc("publisher.dashboard", t) : t | |
}) | |
}] | |
} | |
}]), directives.directive("autoSelect", function () { | |
return { | |
link: function (e, t) { | |
var n; | |
t.on("focus", function () { | |
n = setTimeout(function () { | |
t.select() | |
}, 1) | |
}), t.on("blur", function () { | |
n && (clearTimeout(n), n = null) | |
}), t.on("mouseup", function () { | |
return !1 | |
}), e.$on("$destroy", function () { | |
t.off("focus"), t.off("blur"), t.off("mouseup") | |
}) | |
} | |
} | |
}), directives.directive("zeroClipboard", ["$injector", function (e) { | |
return { | |
restrict: "A", link: function (t, n, r) { | |
var o, i, a, c; | |
try { | |
o = e.get("lang") | |
} catch (e) { | |
} | |
if (a = angular.extend({}, t.$eval(r.zeroClipboard)), null == (c = tinypass.copyToClipboard(n, a))) n.replaceWith(""); else { | |
c.on("dataRequested", function (e, n) { | |
c.setText(t.model.embed) | |
}), c.on("complete", function (e, t) { | |
var a, | |
c = "false" === r.showCopiedText ? "" : "<b>" + (a = t.text, document.createElement("a").appendChild(document.createTextNode(a)).parentNode.innerHTML) + "</b>"; | |
i = "Copied " + c + " to clipboard", o && (i = o.trc("publisher.dashboard", "Copied {0} to clipboard", c)), tinypass.setMessage("success", i), n.click() | |
}), t.$watch("onClose", function (e) { | |
e && "true" == r.cleanup && ZeroClipboard.destroy() | |
}) | |
} | |
} | |
} | |
}]), directives.directive("selectAllCheckbox", function () { | |
return { | |
replace: !0, | |
restrict: "E", | |
scope: {checkboxes: "=", allselected: "=allSelected", allclear: "=allClear", includeRule: "="}, | |
template: '<div ng-model="master" ng-click="masterChange()" />', | |
controller: ["$scope", "$element", function (e, t) { | |
e.masterChange = function () { | |
e.allselected ? angular.forEach(e.checkboxes, function (e, t) { | |
e.isSelected = !1 | |
}) : angular.forEach(e.checkboxes, function (t, n) { | |
e.includeRule && !e.includeRule(t) || (t.isSelected = !0) | |
}) | |
}, e.$watch("checkboxes", function () { | |
var n = !0, r = !0; | |
angular.forEach(e.checkboxes, function (t, o) { | |
t.isSelected ? r = !1 : e.includeRule && !e.includeRule(t) || (n = !1) | |
}), void 0 !== e.allselected && (e.allselected = n), void 0 !== e.allclear && (e.allclear = r), t.prop("indeterminate", !1), n ? e.master = !0 : r ? e.master = !1 : (e.master = !1, t.prop("indeterminate", !0)) | |
}, !0) | |
}] | |
} | |
}), directives.directive("tpDisableEnter", function () { | |
return { | |
restrict: "A", link: function (e, t, n) { | |
t.bind("keypress", function (e) { | |
13 == e.which && e.preventDefault() | |
}) | |
} | |
} | |
}), directives.directive("tpDecimalFilter", function () { | |
return { | |
restrict: "A", link: function (e, t, n) { | |
t.bind("keypress", function (e) { | |
if (-1 == $.inArray(e.which, [46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57])) e.preventDefault(); else if (46 == e.which && t.val().indexOf(".") > -1) { | |
var n = t.val().substring(t.context.selectionStart, t.context.selectionEnd); | |
(n = -1 == n.indexOf(".")) && e.preventDefault() | |
} | |
}) | |
} | |
} | |
}), directives.directive("searchInput", function () { | |
return { | |
scope: { | |
changeSearchText: "&", | |
searchPanelOpen: "=", | |
inputPlaceholder: "@", | |
magnifierHover: "@", | |
searchText: "@", | |
searchOnEnter: "&?", | |
clearSearchResults: "&?", | |
control: "=?" | |
}, link: function (e, t) { | |
e.internalControl = e.control || {}, e.model = { | |
searchPanelOpen: !1, | |
searchText: e.searchText || "" | |
}, e.internalControl.changeSearchInput = function (t) { | |
e.model.searchText = t | |
}, e.openSearchPanel = function () { | |
e.searchPanelOpen = !0, setTimeout(function () { | |
t.find(".common-search-input").focus() | |
}, 100) | |
}, e.dismissSearch = function () { | |
e.model.searchText = "", e.searchPanelOpen = !1, e.changeSearchInput(e.model.searchText), e.clearSearchResults() | |
}, e.$on("reset-search-field", function () { | |
e.model.searchText = "" | |
}), e.changeSearchInput = function (t) { | |
e.changeSearchText({newSearchText: t}) | |
}, e.onEnter = function () { | |
e.searchOnEnter() | |
} | |
}, templateUrl: "/ng/common/search-input/searchInput.shtml", restrict: "A" | |
} | |
}), directives.directive("tpCurrencyInput", ["$filter", function (e) { | |
return { | |
require: "ngModel", link: function (t, n, r, o) { | |
var i = function (t) { | |
if (!t) return "0.00"; | |
t = new String(t).replace(/,/g, ""); | |
var n = e("number")(t, 2); | |
return n || "0.00" | |
}; | |
o.$parsers.push(function (e) { | |
return i(e).replace(/,/g, "") | |
}), o.$formatters.unshift(i), n.bind("focusout", function () { | |
n.val(i(n.val())) | |
}), n.bind("keydown", function (e) { | |
-1 !== $.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) || 65 == e.keyCode && !0 === e.ctrlKey || e.keyCode >= 35 && e.keyCode <= 39 || (e.shiftKey || e.keyCode < 48 || e.keyCode > 57) && (e.keyCode < 96 || e.keyCode > 105) && e.preventDefault() | |
}) | |
} | |
} | |
}]), directives.directive("preventTypingNonNumber", ["$filter", function (e) { | |
return { | |
require: "ngModel", link: function (e, t, n, r) { | |
t.bind("keydown", function (e) { | |
-1 !== $.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) || 65 == e.keyCode && !0 === e.ctrlKey || e.keyCode >= 35 && e.keyCode <= 39 || (e.shiftKey || e.keyCode < 48 || e.keyCode > 57) && (e.keyCode < 96 || e.keyCode > 105) && e.preventDefault() | |
}) | |
} | |
} | |
}]), directives.directive("tpDropDown", ["$document", function (e) { | |
return { | |
restrict: "A", | |
replace: !0, | |
transclude: !0, | |
scope: {alignment: "=", triangle: "=", actionAfterClick: "=?", actionAfterClose: "=?"}, | |
template: "<div ng-transclude></div>", | |
link: function (e, t, n) { | |
n.alignment = void 0 === n.alignment ? "center" : n.alignment; | |
var r = void 0 !== n.popoverUp, o = t.find(".dropdown-menu"), i = t.find(".tp-drop-down-button"), | |
a = i.outerHeight(!0), c = 0, s = 0; | |
e.close = function (e) { | |
o.removeClass("open") | |
}, o.addClass(n.alignment), void 0 !== n.triangle && o.addClass(n.triangle), void 0 !== n.preventCloseOnClick && o.on("click", function (e) { | |
$(e.target).hasClass("close-popover") || (e.preventDefault(), e.stopPropagation()) | |
}), i.bind("click", function () { | |
var l = t.find(".dropdown-menu"); | |
c = l.outerHeight(!0), "center" == n.alignment && (s = parseInt(l.outerWidth(!0) / 2 - i.outerWidth(!0) / 2), o.css({ | |
left: -s, | |
right: "auto" | |
})); | |
var u = t.offset().top, d = void 0 !== window.pageYOffset, | |
p = "CSS1Compat" === (document.compatMode || ""), | |
f = d ? window.pageYOffset : p ? document.documentElement.scrollTop : document.body.scrollTop; | |
r ? (o.addClass("dropdown-up"), u - c - a - parseInt(o.css("marginTop"), 10) < f && o.removeClass("dropdown-up"), u + c + a + parseInt(o.css("marginBottom"), 10) > f + window.innerHeight && o.addClass("dropdown-up")) : u + c + a > window.innerHeight + f && u - f > c ? o.hasClass("dropdown-up") || o.addClass("dropdown-up") : o.hasClass("dropdown-up") && o.removeClass("dropdown-up"), setTimeout(function () { | |
$("html").on("click.dropdown.data-api", function () { | |
$("html").off("click.dropdown.data-api"), e.actionAfterClose && e.actionAfterClose(o, !1) | |
}), e.actionAfterClick && e.actionAfterClick(o, "none" !== o.css("display")) | |
}, 0) | |
}) | |
} | |
} | |
}]), directives.directive("tpUnitPopover", function () { | |
return { | |
replace: !0, transclude: !0, template: "<div ng-transclude></div>", link: function (e, t) { | |
var n = t.find(".unit-popover"), r = t.find(".unit-popover-btn"), | |
o = t.find(".unit-popover-triangle"), i = 0; | |
n.bind("click", function (e) { | |
e.stopPropagation(), e.preventDefault() | |
}), r.bind("click", function () { | |
var e = t.find(".unit-popover"); | |
i = e.outerHeight(!0), r.offset().left + r.innerWidth() / 2 < e.innerWidth() / 2 ? n.offset({left: 20}) : r.offset().left + e.innerWidth() / 2 + r.innerWidth() / 2 > $(window).innerWidth() ? n.offset({left: $(window).innerWidth() - e.innerWidth() - 20}) : n.offset({left: parseInt(r.offset().left - e.innerWidth() / 2) + r.innerWidth() / 2}), o.offset({left: r.offset().left + r.innerWidth() / 2 - 5}); | |
var a = t.offset().top, c = void 0 !== window.pageYOffset, | |
s = "CSS1Compat" === (document.compatMode || ""), | |
l = c ? window.pageYOffset : s ? document.documentElement.scrollTop : document.body.scrollTop; | |
a - i < l ? n.hasClass("unit-popover-down") || n.addClass("unit-popover-down") : n.hasClass("unit-popover-down") && n.removeClass("unit-popover-down") | |
}) | |
} | |
} | |
}), directives.directive("tpCharLimit", ["$interval", function (e) { | |
return { | |
restrict: "A", link: function (t, n, r) { | |
var o = r.tpCharLimit; | |
n.bind("keypress", function (e) { | |
n.val().length >= o && n.context.selectionStart == n.context.selectionEnd && e.preventDefault() | |
}), n.bind("paste", function (t) { | |
var r = e(function () { | |
n.val().length >= o && n.val(n.val().substring(0, o)), e.cancel(r), r = void 0 | |
}, 1) | |
}) | |
} | |
} | |
}]), directives.directive("onEnter", ["$parse", function (e) { | |
return function (t, n, r) { | |
var o = e(r.onEnter); | |
n.on("keydown", function (e) { | |
13 == e.keyCode && (t.$apply(function () { | |
o(t, {$event: e}) | |
}), e.preventDefault()) | |
}) | |
} | |
}]), directives.directive("tpHeaderDescription", function () { | |
return { | |
scope: {header: "=", description: "=", hline: "@"}, | |
restrict: "EA", | |
transclude: !0, | |
template: '<div class="h-line-title-container"><div ng-transclude></div><div class="h-line-title-text">{{header}}</div><div class="h-line-title" ng-if="hline"></div></div><div class="description-hint">{{description}}</div>' | |
} | |
}), directives.directive("d3Planet", function () { | |
return { | |
scope: {idRenderTo: "@"}, | |
restrict: "EA", | |
template: '<div class="planet"></div>', | |
link: function (e) { | |
var t = 160, n = t >> 1, r = .015, o = Date.now(), | |
i = d3.geo.orthographic().scale(n - 2).translate([n, n]).clipAngle(90).precision(0), | |
a = d3.select("#" + e.idRenderTo).selectAll("canvas").data(d3.range(1)).enter().append("canvas").attr("width", t).attr("height", t), | |
c = d3.geo.path().projection(i); | |
d3.json("/libs/d3/world-110m.json", function (n, s) { | |
if (n) throw n; | |
var l = topojson.feature(s, s.objects.land), u = {type: "Sphere"}, d = [0, 0, 0], | |
p = a.node().getContext("2d"), f = p.createRadialGradient(160, 160, 160, 160, 160, 0); | |
f.addColorStop(0, "rgba(84, 142, 209, 1.000)"), f.addColorStop(1, "rgba(22, 82, 168, 1.000)"), p.fillStyle = f; | |
var m = setInterval(function () { | |
var e = r * (Date.now() - o); | |
d[0] = e, i.rotate(d), p.clearRect(0, 0, t, t), p.beginPath(), c.context(p)(l), p.fill(), p.beginPath(), c(u) | |
}, 50); | |
e.$on("$destroy", function () { | |
clearInterval(m) | |
}) | |
}) | |
} | |
} | |
}), directives.directive("translationsProgressMeter", function () { | |
return { | |
restrict: "EA", | |
scope: {cfg: "=translationsProgressMeter"}, | |
template: '<div id="progress-meter" class="progress-meter"><div class="foreground"></div></div>', | |
link: function (e, t, n) { | |
var r = 2 * Math.PI, | |
o = d3.select("#progress-meter").append("svg").attr("width", 220).attr("height", 220).append("g").attr("transform", "translate(110,110)").append("g").attr("class", "progress-meter").append("path").attr("class", "foreground"); | |
e.$watch("cfg.percentageOfTranslatedKeys", function () { | |
var t = Math.PI, n = e.cfg.percentageOfTranslatedKeys / 100 * r + Math.PI - .04, | |
i = d3.svg.arc().startAngle(t).innerRadius(106).outerRadius(110).cornerRadius(10); | |
o.transition().duration(e.cfg.animationSpeed).attrTween("d", function () { | |
var e = d3.interpolate(t, n); | |
return function (t) { | |
return i.endAngle(e(t))() | |
} | |
}) | |
}) | |
} | |
} | |
}), directives.directive("translationsTotal", function () { | |
return { | |
restrict: "EA", | |
scope: {cfg: "=translationsTotal"}, | |
template: '<div id="total-translation-percentage" class="inline"></div>', | |
link: function (e, t, n) { | |
e.$watch("cfg.percentageOfTranslatedKeys", function () { | |
d3.select("#total-translation-percentage").text(e.cfg.startValue || 0).transition().duration(e.cfg.animationSpeed).tween("text", function () { | |
var t = parseInt(this.textContent), | |
n = d3.interpolateRound(t, e.cfg.percentageOfTranslatedKeys); | |
return function (e) { | |
this.textContent = n(e) | |
} | |
}) | |
}) | |
} | |
} | |
}), directives.directive("setIframeHeightOnload", function () { | |
return { | |
restrict: "A", scope: {}, link: function (e, t, n) { | |
t.on("load", function () { | |
t.height(t.contents().height()) | |
}) | |
} | |
} | |
}), directives.directive("tpInfiniteScroll", ["$window", function (e) { | |
return { | |
restrict: "A", | |
scope: { | |
tpInfiniteScroll: "&", | |
tpInfiniteScrollOffset: "@?", | |
tpInfiniteScrollDebounce: "@?", | |
tpInfiniteScrollConfig: "=?" | |
}, | |
link: function (t, n, r) { | |
if (!t.tpInfiniteScroll) return; | |
var o, i = Number(t.tpInfiniteScrollOffset) || 0, a = Number(t.tpInfiniteScrollDebounce) || 250, | |
c = t.tpInfiniteScrollConfig, s = c && c.containerSelector, l = n; | |
c && "window" === c.containerSelector && (l = angular.element(e)); | |
function u(e) { | |
var r = l.scrollTop() >= n[0].clientHeight - i, a = e.target.scrollTop; | |
o = e.target.scrollHeight, a + e.target.clientHeight >= o - i && t.tpInfiniteScroll(), s && "window" === c.containerSelector && r && t.tpInfiniteScroll() | |
} | |
d = l, d.on("scroll", (p = u, f = a, function () { | |
var e = this, t = arguments, n = m && !h; | |
clearTimeout(h), h = setTimeout(function () { | |
h = null, m || p.apply(e, t) | |
}, f), n && p.apply(e, t) | |
})); | |
var d, p, f, m, h | |
} | |
} | |
}]), directives.filter("tpDateFormatFilter", function () { | |
return function (e) { | |
if (null == e) return null; | |
var t = new Date(e), n = new Date, r = t.getDate(), o = t.getMonth() + 1, | |
i = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][t.getMonth()], | |
a = t.getFullYear(), c = o + "/" + r + "/" + a, s = t.getHours(), l = t.getMinutes(); | |
l < 10 && (l = "0" + l); | |
var u = s < 12 ? " am" : " pm"; | |
s > 12 && (s -= 12); | |
var d = s + ":" + l + " " + u; | |
return n.getFullYear() == t.getFullYear() && n.getDate() == t.getDate() ? d : n.getFullYear() == a ? i + " " + r : (n.getFullYear(), c) | |
} | |
}); | |
var address = angular.module("tp.ui.address", []); | |
address.filter("formatAddress", function () { | |
return function (t, n, r, o) { | |
if (!t) return null; | |
void 0 === r && (r = ", "); | |
void 0 === o && (o = " "); | |
var i = t.additionalFields ? JSON.parse(t.additionalFields) : "", | |
a = [t.region && t.region.regionName || t.regionName, t.postalCode, i ? i.CEP : "", i ? i.CPF : ""].filter(e).join(o), | |
c = [t.address1, t.address2, i ? i.address3 : "", t.city, a, t.country.countryName]; | |
n && c.push(t.phone); | |
return c.filter(e).join(r) | |
}; | |
function e(e) { | |
return null != e && "" !== e | |
} | |
}), address.directive("regionSelect", function () { | |
return { | |
restrict: "E", | |
replace: !0, | |
scope: { | |
region: "=", | |
country: "=", | |
countries: "=", | |
inputId: "@", | |
clearOnInit: "=?", | |
inputClass: "@", | |
selectClass: "@", | |
placeholder: "@", | |
selectRequired: "=?", | |
inputPlaceholder: "@", | |
selectPlaceholder: "@", | |
wrapperInputClass: "@", | |
wrapperSelectClass: "@" | |
}, | |
template: '<div ng-class="wrapperClass"><select name="region" ng-if="regions.length" ng-options="region.regionName for region in regions track by region.regionName" ng-model="region" ng-change="onChangeRegion(region)" id="{{inputId}}" class="no-animate" ng-class="selectClass" ng-required="selectRequired"><option value="" disabled selected style="display: none;">{{getSelectPlaceholder()}}</option></select><input name="region" type="text" ng-if="!regions.length" ng-model="region.regionName" ng-change="onChangeRegionName(region.regionName)" id="{{inputId}}" autocomplete="off" class="no-animate" ng-class="inputClass" placeholder="{{getInputPlaceholder()}}"/></div>', | |
link: function (e, t, n) { | |
e.preSelectFirst = void 0 !== n.preSelectFirst | |
}, | |
controller: ["$scope", function (e) { | |
e.getInputPlaceholder = function () { | |
return e.inputPlaceholder ? e.inputPlaceholder : e.placeholder | |
}, e.getSelectPlaceholder = function () { | |
return e.selectPlaceholder ? e.selectPlaceholder : e.placeholder | |
}, e.$watch("country", function (t, n) { | |
e.regions = function (e, t) { | |
if (!e || !e.length || !t || !t.countryId && !t.pubId) return null; | |
for (var n = e.length, r = 0; r < n; r++) { | |
var o = e[r] === t || t.countryId && e[r].countryId === t.countryId || t.countryId && e[r].pubId === t.countryId || t.pubId && e[r].pubId === t.pubId; | |
if (o) return e[r].regions | |
} | |
return null | |
}(e.countries, t) || [], e.wrapperClass = e.regions.length ? e.wrapperSelectClass : e.wrapperInputClass, t !== n && (!t || n && (t.pubId || t.countryId) !== (n.pubId || n.countryId)) && (e.region = e.clearOnInit ? null : {}); | |
!e.preSelectFirst || !e.regions.length || t === n || n && (t.pubId || t.countryId) === (n.pubId || n.countryId) || !n && e.region || (e.region = e.regions[0]) | |
}), e.onChangeRegion = function (t) { | |
e.region = t | |
}, e.onChangeRegionName = function (t) { | |
e.region = {regionName: t} | |
} | |
}] | |
} | |
}); | |
var grid = angular.module("tp.ui.grid", []); | |
grid.normalizeCaption = function (e) { | |
return e.toLowerCase().replace(/\W+/g, "-") | |
}, grid.filter("toCssClass", function () { | |
return grid.normalizeCaption | |
}), grid.directive("tpGrid", function () { | |
return { | |
restrict: "A", | |
transclude: !0, | |
scope: {model: "=tpGrid", tpOnEmptyMessage: "@", tpOnEvent: "&"}, | |
templateUrl: "/ng/common/template/grid.shtml", | |
link: function (e, t) { | |
t.find("#page").bind("keypress", function (n) { | |
if (13 === n.which) try { | |
if (page = parseInt(t.find("#page").val()), isNaN(page)) return void (page = e.model.page); | |
page > e.model.pageCount && (page = e.model.pageCount), page < 1 && (page = 1), e.tpOnEvent()({ | |
name: "page", | |
page: page | |
}), t.find("#page").val(page).blur().focus() | |
} catch (e) { | |
} | |
}) | |
}, | |
controller: ["$scope", "$sce", function (e, t) { | |
e.$watch("model", function () { | |
if (e.model && e.model.data) { | |
e.model.page || (e.model.page = 1), e.model.pageCount || (e.model.pageCount = 1); | |
for (var n = 0; n < e.model.data.length; n++) for (var r = e.model.data[n], o = 0; o < r.series.length; o++) { | |
var i = r.series[o]; | |
switch (i.type) { | |
case"PLAIN": | |
i.compiled = t.trustAsHtml(i.content); | |
break; | |
case"LINK_EXTERNAL": | |
i.compiled = t.trustAsHtml('<a href="' + i.data + '" target="blank">' + i.content + "</a>"); | |
break; | |
case"LINK_INTERNAL": | |
i.compiled = t.trustAsHtml('<a href="' + i.data + '">' + i.content + "</a>"); | |
break; | |
case"LINK_AJAX": | |
i.compiled = t.trustAsHtml("<a onclick=\"ajaxItGet('" + i.data + "'); return false;\">" + i.content + "</a>") | |
} | |
} | |
} | |
}), e.handleEvent = function (t) { | |
if ("page" == t.name) { | |
if (t.page > e.model.pageCount) return; | |
if (t.page < 1) return | |
} | |
if ("cell" == t.name) { | |
if ("PLAIN" != e.model.data[t.row.index].series[t.cell.index].type) return; | |
t.name = "row" | |
} | |
"menu" == t.name && (t.menu.name = grid.normalizeCaption(t.menu.caption)), e.tpOnEvent()(t) | |
} | |
}], | |
replace: !0 | |
} | |
}); | |
var cc = angular.module("tp.ui.cc", []); | |
function tpDatepickerService() { | |
return { | |
buildCalendarSkeleton: function (r, o, i, a) { | |
var c = [], s = null, l = null, u = new Date; | |
u.setHours(0, 0, 0), i.innerFromDateStart && i.innerFromDateStart.setHours(0, 0, 0, 0); | |
i.innerFromDateEnd && i.innerFromDateEnd.setHours(0, 0, 0, 0); | |
a.innerToDateStart && a.innerToDateStart.setHours(0, 0, 0, 0); | |
a.innerToDateEnd && a.innerToDateEnd.setHours(0, 0, 0, 0); | |
for (var d = !1, p = r.numColumn * r.numRow; p > 0; p--) { | |
var f = null, m = null, h = !1, g = !1; | |
switch (r.unit) { | |
default: | |
case"d": | |
f = new Date(o.viewDateStart.getFullYear(), o.viewDateStart.getMonth(), p * r.unitRange - (r.unitRange - 1), 0, 0, 0, 0), m = new Date(o.viewDateEnd.getFullYear(), o.viewDateEnd.getMonth(), p * r.unitRange, 0, 0, 0); | |
break; | |
case"m": | |
f = new Date(o.viewDateStart.getFullYear(), p * r.unitRange - (r.unitRange - 1) - 1, 1), m = new Date(o.viewDateStart.getFullYear(), p * r.unitRange, 0) | |
} | |
i.innerFromDateStart >= f && i.innerFromDateEnd <= m && (g = !0), f >= i.innerFromDateEnd && m <= a.innerToDateStart && (g = !0), a.innerToDateStart >= f && a.innerToDateEnd <= m && (g = !0), f >= i.innerFromDateStart && m <= a.innerToDateEnd && (g = !0), f > o.viewDateEnd && (h = !0), d = e(f, u), c.unshift({ | |
currentDateStart: f, | |
currentDateOver: m, | |
selectRange: g, | |
disabled: t(f, r), | |
out: h, | |
today: d, | |
selectToday: d && r.currentDayHighlight, | |
firstSelectDay: !1, | |
lastSelectDay: !1 | |
}) | |
} | |
if ("d" === r.unit && 1 === r.unitRange && 7 === r.numColumn) for (var v = c[0].currentDateStart.getDay(), p = v >= r.startDay ? v - r.startDay : 7 - (r.startDay - v); p--;) { | |
var y = new Date(c[0].currentDateStart.getTime()); | |
y.setDate(c[0].currentDateStart.getDate() - 1), f = new Date(y.getTime()), m = new Date(f.getTime()); | |
var g = !1; | |
i.innerFromDateStart && a.innerToDateEnd && (s = new Date(i.innerFromDateStart.getTime()).setHours(0, 0, 0, 0), l = new Date(a.innerToDateEnd.getTime()).setHours(0, 0, 0, 0), f >= s && m <= l && (g = !0)), c.unshift({ | |
currentDateStart: f, | |
currentDateOver: m, | |
selectRange: g, | |
disabled: t(f, r), | |
out: !0, | |
today: !1, | |
firstSelectDay: !1, | |
lastSelectDay: !1 | |
}), c.pop() | |
} | |
var E = null; | |
for (p = c.length; p--;) c[p].index = p, E && c[p].selectRange && !E.selectRange && (c[p].lastSelectDay = !0), !E && c[p].selectRange && c[p].currentDateOver >= a.innerToDateEnd && (c[p].lastSelectDay = !0), E && !c[p].selectRange && E.selectRange && (c[p + 1].firstSelectDay = !0), !c[p - 1] && c[p].selectRange && c[p].currentDateStart <= i.innerFromDateStart && (c[p].firstSelectDay = !0), E = c[p]; | |
for (var C = [], T = 0; T < r.numRow; T++) { | |
C[T] = []; | |
for (var _ = 0; _ < r.numColumn; _++) { | |
if (C[T][_] = c[_ + T * r.numColumn], r.markerColumn) for (var S = r.markerColumn.length; S--;) r.markerColumn[S].numb - 1 === _ && (C[T][_].markerColumn = r.markerColumn[S].name || "marker-column"); | |
if (r.markerRow) for (var S = r.markerRow.length; S--;) r.markerRow[S].numb - 1 === T && (C[T][_].markerRow = r.markerRow[S].name || "marker-row"); | |
C[T][_].markerDay = n(C[T][_], r.markerDays) | |
} | |
} | |
return c = null, C | |
}, isSameDay: e | |
}; | |
function e(e, t) { | |
return e.getDate() <= t.getDate() && e.getMonth() <= t.getMonth() && e.getFullYear() <= t.getFullYear() && e.getDate() >= t.getDate() && e.getMonth() >= t.getMonth() && e.getFullYear() >= t.getFullYear() | |
} | |
function t(e, t) { | |
var n = t.limitDateNotBefore, r = t.limitDateNotAfter; | |
return n && r ? n > e || e > r : n ? n > e : !!r && r < e | |
} | |
function n(e, t) { | |
var n = !1; | |
if (t) { | |
var r = new Date(e.currentDateStart.getFullYear(), 0, 0), | |
o = Math.floor((e.currentDateStart - r) / 864e5); | |
r = new Date(e.currentDateOver.getFullYear(), 0, 0); | |
for (var i = Math.floor((e.currentDateOver - r) / 864e5), a = t.length; a--;) if (t[a] >= o && t[a] <= i) { | |
n = !0; | |
break | |
} | |
} | |
return n | |
} | |
} | |
cc.directive("tpCreditCardForm", ["$timeout", function (e) { | |
return { | |
restrict: "A", | |
transclude: !0, | |
scope: {model: "=tpCreditCardForm"}, | |
templateUrl: "/ng/common/template/credit_card_form.shtml", | |
controller: ["$scope", function (e) { | |
e.model || (e.model = {}), e.model.exp_mon || (e.model.exp_mon = (new Date).getMonth() + 1), e.model.exp_yr || (e.model.exp_yr = (new Date).getFullYear()), alert("YYY") | |
}], | |
link: function (e, t, n) { | |
var r = function (t) { | |
var n = Braintree.create(e.model.braintree.client_key); | |
return t ? n.encrypt(t) : "" | |
}; | |
e.model.encrypt = function () { | |
return { | |
number: r(e.model.number), | |
exp_mon: e.model.exp_mon, | |
exp_yr: e.model.exp_yr, | |
cvv: r(e.model.cvv), | |
zipcode: e.model.zipcode | |
} | |
}, e.model.validate = function () { | |
return e.model.formErrors = [], e.creditCardForm.number.$modelValue = tinypass.stripSpaces(e.creditCardForm.number.$modelValue), e.creditCardForm.number.$modelValue && tinypass.ccLuhnCheck(e.creditCardForm.number.$modelValue) || e.model.formErrors.push({ | |
field: "number", | |
msg: "Invalid credit card number" | |
}), e.model.isValid() | |
}, e.model.isValid = function () { | |
return !e.model.formErrors || 0 == e.model.formErrors | |
}, e.model.formErrors = [], e.$watch("model.formErrors", function () { | |
angular.forEach(e.creditCardForm, function (e) { | |
e.$setValidity && (e.$setValidity("error", !0), e.$setPristine()) | |
}), e.creditCardForm.$setPristine(), angular.forEach(e.model.formErrors, function (t) { | |
var n = t.field; | |
e.creditCardForm[n].$setValidity("error", !1), e.creditCardForm[n].$error.msg = t.msg | |
}) | |
}, !0) | |
}, | |
replace: !0 | |
} | |
}]), angular.module("tp.ui.datepicker", ["tp.ui.timepicker", "tp.i18n", "datetime", "ngInputDate"]).directive("tpDatepicker", tpDatepicker).directive("tpDatepickerInline", tpDatepickerInline).factory("tpDatepickerService", tpDatepickerService).run(tpTemplates); | |
var datepickerScope = { | |
openCalendar: "=?openCalendar", | |
disable: "=?disable", | |
changeState: "&?changeState", | |
fromDate: "=fromDate", | |
toDate: "=toDate", | |
pickClick: "&?pickClick", | |
applyClick: "&?applyClick", | |
changeTab: "&?changeTab", | |
options: "=?options", | |
activeTab: "=?activeTab", | |
openTab: "=?openTab", | |
initialEmpty: "&?initialEmpty" | |
}, datepickerInlineScope = { | |
fromDate: "=fromDate", | |
toDate: "=toDate", | |
pickClick: "&?pickClick", | |
options: "=?options", | |
currentFromDate: "=", | |
currentToDate: "=" | |
}; | |
function tpDatepickerInline() { | |
return { | |
scope: datepickerInlineScope, | |
controller: ["$scope", "$timeout", "tpDatepickerService", "lang", "datetimePlaceholder", function (e, t, n, r, o) { | |
datepickerController(e, t, n, r, o), e.$watch(function () { | |
return e.getSelectedFromDate() | |
}, function (t) { | |
e.currentFromDate = t | |
}), e.$watch(function () { | |
return e.getSelectedToDate() | |
}, function (t) { | |
e.currentToDate = new Date(t.getTime() + e.activeCalendar.diffDateEnd) | |
}) | |
}], | |
templateUrl: "template/datepicker/datepicker-inline.html", | |
restrict: "A" | |
} | |
} | |
function tpDatepicker(e, t, n, r) { | |
return { | |
scope: datepickerScope, | |
link: function (r, o, i) { | |
r.openCalendar = !!r.openCalendar, o.find("input[type=date]").prop("type", "text"), n(function () { | |
r.contentLoaded = !0 | |
}), r.showCalendar = function () { | |
if (r.openCalendar = !r.openCalendar, !0 === r.disable) r.openCalendar = !1, a(); else if (r.openCalendar) { | |
if (r.positionUpdated = !1, r.fromDate) { | |
var i = new Date(r.fromDate).getHours(), l = new Date(r.fromDate).getMinutes(); | |
r.$broadcast("time-updated", {hours: i, minutes: l}) | |
} | |
n(function () { | |
var n = o.find(".calendar"), i = o.find(".extended"), | |
a = n.offset().top + n.innerHeight() > t.innerHeight, | |
l = i.offset().top < n.innerHeight(), u = 1; | |
if (l && a) { | |
var d = n.innerHeight(), p = t.innerHeight - (i.offset().top + i.innerHeight()), | |
f = i.offset().top, m = p > f; | |
u = ((m ? p : f) - 10) / (n.innerHeight() + 19); | |
var h = (d - d * u) / 2 - 19 * u; | |
n[0].style.setProperty("transform", "scale(" + u + ")"), n[0].style.setProperty("margin-top", "-" + h + "px") | |
} else if (a) { | |
var h = n.offset().top - i.offset().top + n.innerHeight() + 9; | |
n[0].classList.add("top"), n[0].style.setProperty("top", "-" + h + "px") | |
} | |
if (i.offset().left + i.innerWidth() / 2 < n.innerWidth() * u / 2) n.offset({left: 20}); else if (i.offset().left + n.innerWidth() * u / 2 + i.innerWidth() / 2 > t.innerWidth) n.offset({left: t.innerWidth - n.innerWidth() * u - 20}); else { | |
var g = n.innerWidth() * u, v = (i.innerWidth() - g) / 2, | |
y = (n.innerWidth() - g) / 2, E = -y + v; | |
n[0].style.setProperty("left", E + "px") | |
} | |
e.bind("click", c), e.bind("keyup", s), r.positionUpdated = !0 | |
}, 10), n(function () { | |
r.changeState && r.changeState() | |
}, 10) | |
} else a(), n(function () { | |
r.changeState && r.changeState() | |
}, 10) | |
}, r.openCalendar && (r.openCalendar = !1, r.showCalendar()); | |
function a() { | |
e.unbind("click", c), e.unbind("keyup", s) | |
} | |
function c(e) { | |
r.$apply(function () { | |
r.showCalendar() | |
}) | |
} | |
function s(e) { | |
switch (e.keyCode) { | |
case 27: | |
r.$apply(function () { | |
r.showCalendar() | |
}); | |
break; | |
case 37: | |
r.$apply(function () { | |
r.changeLeft(-1), r.changeRight(-1) | |
}); | |
break; | |
case 39: | |
r.$apply(function () { | |
r.changeRight(1), r.changeLeft(1) | |
}) | |
} | |
} | |
r.updatePosition = function () { | |
n(function () { | |
var e = o.find(".calendar"), n = o.find(".extended"); | |
o.find(".dtpicker-input"); | |
n.offset().left + n.innerWidth() / 2 < e.innerWidth() / 2 ? e.offset({left: 20}) : n.offset().left + e.innerWidth() / 2 + n.innerWidth() / 2 > t.innerWidth ? e.offset({left: t.innerWidth - e.innerWidth() - 20}) : e.offset({left: n.offset().left + n.innerWidth() / 2 - e.innerWidth() / 2}) | |
}, 10) | |
}, (o.find(".calendar").length ? o.find(".calendar") : o).click(function (e) { | |
e.stopPropagation() | |
}) | |
}, | |
controller: ["$scope", "$timeout", "tpDatepickerService", "lang", "datetimePlaceholder", datepickerController], | |
templateUrl: "template/datepicker/datepicker-custom.html", | |
restrict: "A", | |
transclude: !0 | |
} | |
} | |
function datepickerController(e, t, n, r, o) { | |
o.year = "yyyy", o.month = "mm", o.day = "dd", o.date = "dd", function () { | |
e.options || (e.options = {}); | |
e.options.mainOptions || (e.options.mainOptions = {}); | |
"boolean" != typeof e.options.mainOptions.showPanelTab && (e.options.mainOptions.showPanelTab = !1); | |
"boolean" != typeof e.options.mainOptions.instantChanges && (e.options.mainOptions.instantChanges = !1); | |
"boolean" != typeof e.options.mainOptions.showPanelCustomButton && (e.options.mainOptions.showPanelCustomButton = !1); | |
e.options.mainOptions.customPanel || (e.options.mainOptions.customPanel = {}); | |
e.options.mainOptions.customPanel.dateFormat || (e.options.mainOptions.customPanel.dateFormat = "MMM d, yyyy"); | |
e.options.mainOptions.startTab || (e.options.mainOptions.startTab = 0); | |
e.options.mainOptions.applyButton || (e.options.mainOptions.applyButton = {}); | |
"string" != typeof e.options.mainOptions.applyButton.title && (e.options.mainOptions.applyButton.title = r.tr("Apply selected dates")); | |
"boolean" != typeof e.options.mainOptions.applyButton.enable && (e.options.mainOptions.applyButton.enable = !0); | |
e.options.mainOptions.closeButton || (e.options.mainOptions.closeButton = {}); | |
"string" != typeof e.options.mainOptions.closeButton.title && (e.options.mainOptions.closeButton.title = "Cancel"); | |
"boolean" != typeof e.options.mainOptions.applyClose && (e.options.mainOptions.applyClose = !0); | |
e.options.mainOptions.time || (e.options.mainOptions.time = {}); | |
"boolean" != typeof e.options.mainOptions.time.enabled && (e.options.mainOptions.time.enabled = !1); | |
"boolean" != typeof e.options.mainOptions.time.timeFormat12hours && (e.options.mainOptions.time.timeFormat12hours = !0); | |
e.options.mainOptions.time.minutesStep || (e.options.mainOptions.time.minutesStep = 15); | |
"boolean" != typeof e.options.mainOptions.time.showTimezone && (e.options.mainOptions.time.showTimezone = !0); | |
e.options.calendarOptions || (e.options.calendarOptions = [{}]); | |
for (var t = e.options.calendarOptions.length; t--;) e.options.calendarOptions[t].calendarUnitTitle || (e.options.calendarOptions[t].calendarUnitTitle = "MMM d, yyyy"), "boolean" != typeof e.options.calendarOptions[t].calendarUnitTitleRange && (e.options.calendarOptions[t].calendarUnitTitleRange = !1), e.options.calendarOptions[t].calendarUnit || (e.options.calendarOptions[t].calendarUnit = "m"), e.options.calendarOptions[t].calendarUnitCount || (e.options.calendarOptions[t].calendarUnitCount = 1), e.options.calendarOptions[t].oneCanvasCalendar || (e.options.calendarOptions[t].oneCanvasCalendar = !1), e.options.calendarOptions[t].unit || (e.options.calendarOptions[t].unit = "d"), e.options.calendarOptions[t].unitTitle || (e.options.calendarOptions[t].unitTitle = {}, e.options.calendarOptions[t].unitTitle.type = "date"), "date" === e.options.calendarOptions[t].unitTitle.type && "string" != typeof e.options.calendarOptions[t].unitTitle.title && (e.options.calendarOptions[t].unitTitle.title = "d"), "boolean" != typeof e.options.calendarOptions[t].unitTitleRange && (e.options.calendarOptions[t].unitTitleRange = !1), ("number" != typeof e.options.calendarOptions[t].startDay || e.options.calendarOptions[t].startDay < 0 || e.options.calendarOptions[t].startDay > 6) && (e.options.calendarOptions[t].startDay = 0), "number" != typeof e.options.calendarOptions[t].unitRange && (e.options.calendarOptions[t].unitRange = 1), "string" != typeof e.options.calendarOptions[t].unitSelectRange && "boolean" != typeof e.options.calendarOptions[t].unitSelectRange && (e.options.calendarOptions[t].unitSelectRange = !1), "boolean" != typeof e.options.calendarOptions[t].enableOneClickRange && (e.options.calendarOptions[t].enableOneClickRange = !1), "boolean" != typeof e.options.calendarOptions[t].viewDayOfWeek && (e.options.calendarOptions[t].viewDayOfWeek = "d" === e.options.calendarOptions[t].unit), "number" != typeof e.options.calendarOptions[t].numColumn && (e.options.calendarOptions[t].numColumn = 7), "number" != typeof e.options.calendarOptions[t].numRow && (e.options.calendarOptions[t].numRow = 6), e.options.calendarOptions[t].customButtonSelect || (e.options.calendarOptions[t].customButtonSelect = []), e.options.calendarOptions[t].customButtonCallback || (e.options.calendarOptions[t].customButtonCallback = []), "boolean" != typeof e.options.calendarOptions[t].showArrow && (e.options.calendarOptions[t].showArrow = !0), "boolean" != typeof e.options.calendarOptions[t].showExtraArrow && (e.options.calendarOptions[t].showExtraArrow = !1), e.options.calendarOptions[t].limitDateNotBefore instanceof Date ? e.options.calendarOptions[t].limitDateNotBefore.setHours(0, 0, 0, 0) : e.options.calendarOptions[t].limitDateNotBefore = void 0, e.options.calendarOptions[t].limitDateNotAfter instanceof Date ? e.options.calendarOptions[t].limitDateNotAfter.setHours(0, 0, 0, 0) : e.options.calendarOptions[t].limitDateNotAfter = void 0, e.options.calendarOptions[t].diffDateEnd || (e.options.calendarOptions[t].diffDateEnd = 0), "boolean" != typeof e.options.calendarOptions[t].currentDayHighlight && (e.options.calendarOptions[t].currentDayHighlight = !0), "boolean" != typeof e.options.calendarOptions[t].selectYear && (e.options.calendarOptions[t].selectYear = !1) | |
}(); | |
var i; | |
new Date; | |
function a() { | |
if (e.activeCalendar.startDay >= 0) { | |
e.dayNames = []; | |
for (var t = 7; t--;) { | |
var n = new Date, r = n.getDay(), o = e.activeCalendar.startDay - r; | |
n.setDate(n.getDate() + o + 6 - t), e.dayNames.push(n) | |
} | |
} | |
} | |
e.dirtyDate = !1, e.hideArrow = !1, e.activeTab = e.options.mainOptions.startTab ? e.options.mainOptions.startTab : 0, e.dayNames = [], e.options.calendarOptions && (e.activeCalendar = angular.copy(e.options.calendarOptions[e.activeTab]), e.openTab = e.activeCalendar, a()), e.years = [], e.yearInputName = "year_hash" + (new Date).getTime(), i = (new Date).getFullYear(), e.years = Array.apply(null, new Array(100)).map(function (e, t) { | |
return i - t | |
}), e.$watch("fromDate", function () { | |
v(), T() | |
}), e.$watch("toDate", function () { | |
v(), T() | |
}); | |
var c = null, s = null, l = null, u = null, d = null, p = null, f = null, m = null; | |
function h(t) { | |
return function (e, t, n) { | |
var r = null, o = null, i = null; | |
switch (t) { | |
default: | |
case"m": | |
(r = g(e)).setDate(1), o = g(r), r.setMonth(r.getMonth() * n + 1), r.setDate(r.getDate() - 1), i = g(r); | |
break; | |
case"y": | |
r = g(e), o = new Date(r.getFullYear(), 0, 1), i = new Date(r.getFullYear() + (n - 1), 11, 31) | |
} | |
return o.setHours(0, 0, 0, 0), i.setHours(0, 0, 0, 0), {dateStart: o, dateOver: i} | |
}(t, e.activeCalendar.calendarUnit, e.activeCalendar.calendarUnitCount) | |
} | |
function g(e) { | |
return e ? e instanceof Date ? new Date(e.getTime()) : "string" == typeof e ? new Date(e) : null : null | |
} | |
function v() { | |
c = s = g(e.fromDate), l = u = g(e.toDate), function () { | |
d = null, p = null, f = null, m = null; | |
var t = null; | |
e.fromDate ? (t = g(e.fromDate), d = h(t).dateStart, p = h(t).dateOver) : e.toDate ? (t = g(e.toDate), d = h(t).dateStart, p = h(t).dateOver) : (d = h(new Date).dateStart, p = h(new Date).dateOver); | |
var n = g(d); | |
switch (e.activeCalendar.calendarUnit) { | |
default: | |
case"m": | |
n.setMonth(n.getMonth() + e.activeCalendar.calendarUnitCount); | |
break; | |
case"y": | |
n.setFullYear(n.getFullYear() + e.activeCalendar.calendarUnitCount) | |
} | |
e.toDate && e.toDate >= n ? (t = new Date(e.toDate.getTime()), f = h(t).dateStart, m = h(t).dateOver) : (f = h(n).dateStart, m = h(n).dateOver); | |
var r = new Date(p.getTime()); | |
r.setDate(r.getDate() + 1), r.setHours(0, 0, 0, 0), e.hideArrow = r >= f, e.activeCalendar.oneCanvasCalendar && (e.hideArrow = !1), e.viewDateLeftStart = d, e.viewDateLeftEnd = p, e.viewDateRightStart = f, e.viewDateRightEnd = m | |
}() | |
} | |
function y(t) { | |
var n = h(t); | |
f = n.dateStart, m = n.dateOver; | |
var r = new Date(p.getTime()); | |
r.setDate(r.getDate() + 1), e.hideArrow = r >= f, e.viewDateRightStart = f, e.viewDateRightEnd = m, T() | |
} | |
function E(t) { | |
d = h(t).dateStart, p = h(t).dateOver; | |
var n = new Date(p.getTime()); | |
n.setDate(n.getDate() + 1), e.hideArrow = n >= f, e.activeCalendar.oneCanvasCalendar && (e.hideArrow = !1), e.viewDateLeftStart = d, e.viewDateLeftEnd = p, T() | |
} | |
function C(e, t, n) { | |
var r; | |
return (r = new Date(n > 0 ? t : e)).setDate(r.getDate() + n), r.setDate(1), r | |
} | |
v(), e.clickTab = function (n) { | |
e.activeTab = n, e.activeCalendar = e.options.calendarOptions[n], v(), T(), a(), e.dirtyDate = !1, e.updatePosition(), e.openTab = e.activeCalendar, t(function () { | |
e.changeTab && e.changeTab() | |
}, 10) | |
}, e.clickDate = function (n) { | |
if (e.activeCalendar.unitSelectRange) switch (e.activeCalendar.unitSelectRange) { | |
default: | |
case"w": | |
("d" !== e.activeCalendar.unit || "d" === e.activeCalendar.unit && 1 === e.activeCalendar.unitRange) && (n.currentDateStart.getDay() >= e.activeCalendar.startDay ? n.currentDateStart.setDate(n.currentDateStart.getDate() - (n.currentDateStart.getDay() - e.activeCalendar.startDay)) : n.currentDateStart.setDate(n.currentDateStart.getDate() - (7 - (e.activeCalendar.startDay - n.currentDateStart.getDay()))), n.currentDateOver.getDay() >= e.activeCalendar.startDay ? n.currentDateOver.setDate(n.currentDateOver.getDate() + (6 + e.activeCalendar.startDay - n.currentDateOver.getDay())) : e.activeCalendar.startDay > n.currentDateOver.getDay() && n.currentDateOver.setDate(n.currentDateOver.getDate() + (e.activeCalendar.startDay - n.currentDateOver.getDay() - 1))); | |
break; | |
case"m": | |
1 !== n.currentDateStart.getDate() && n.currentDateStart.setDate(1); | |
var r = new Date; | |
r.setMonth(r.getMonth() - 1), r.setDate(0), n.currentDateOver.getDate() !== r.getDate() && n.currentDateOver.setDate(r.getDate()); | |
break; | |
case"y": | |
0 !== n.currentDateStart.getMonth() && (n.currentDateStart.setMonth(0), n.currentDateStart.setDate(1)), 11 !== n.currentDateOver.getMonth() && (n.currentDateOver.setMonth(12), n.currentDateOver.setDate(0)) | |
} | |
if (n.disabled) return !1; | |
n.selectRange || !c || !s || c.getTime() !== l.getTime() || s.getTime() !== u.getTime() || e.activeCalendar.enableOneClickRange ? (c = new Date(n.currentDateStart.getTime()), s = new Date(n.currentDateOver.getTime()), l = new Date(n.currentDateStart.getTime()), u = new Date(n.currentDateOver.getTime())) : n.currentDateStart >= c || n.currentDateOver >= s ? (l = new Date(n.currentDateStart.getTime()), u = new Date(n.currentDateOver.getTime())) : (c = new Date(n.currentDateStart.getTime()), s = new Date(n.currentDateOver.getTime())), e.options.mainOptions.instantChanges ? e.applySelect() : (T(), e.dirtyDate = !0), t(function () { | |
e.pickClick && e.pickClick() | |
}, 0) | |
}, e.changeLeft = function (t) { | |
e.activeCalendar.oneCanvasCalendar && e.changeRight(t); | |
var n = C(d, p, t); | |
new Date(n) >= f && (n = new Date(f)).setDate(n.getDate() - 1), E(n) | |
}, e.changeRight = function (e) { | |
var t = C(f, m, e); | |
t <= p && (t = new Date(p)).setDate(t.getDate() + 1), y(t) | |
}, e.changeLeftInterim = function (t, n) { | |
e.activeCalendar.oneCanvasCalendar && e.changeRightInterim(t, n); | |
var r = new Date(d); | |
r.setYear(r.getFullYear() + t), new Date(r) >= f && ((r = new Date(p)).setDate(1), r.setMonth(f.getMonth() - 1), r.setYear(f.getFullYear())), E(r) | |
}, e.changeRightInterim = function (e) { | |
var t = new Date(m); | |
t.setYear(t.getFullYear() + e), t <= p && (t = new Date(p)).setDate(t.getDate() + 1), y(t) | |
}, e.onYearChange = function (t) { | |
var n = e.viewDateLeftStart.getFullYear(), r = parseInt(t.year) - n; | |
e.changeLeftInterim(r, "y") | |
}, e.customSelectButton = function (t) { | |
function n(e, t) { | |
var n = {}; | |
return n.fromDate = e, n.toDate = t, n | |
} | |
switch (t) { | |
case"today": | |
t = n(new Date, new Date); | |
break; | |
case"yesterday": | |
var r = new Date, o = (a = -1, (c = new Date(r)).setDate(c.getDate() + a), c); | |
t = n(o, o); | |
break; | |
case"week": | |
t = n(new Date, new Date); | |
var i = new Date; | |
i.getDay() >= e.activeCalendar.startDay ? t.fromDate.setDate(i.getDate() - (i.getDay() - e.activeCalendar.startDay)) : t.fromDate.setDate(i.getDate() - (7 - (e.activeCalendar.startDay - i.getDay()))), i.getDay() >= e.activeCalendar.startDay ? t.toDate.setDate(i.getDate() + (6 + e.activeCalendar.startDay - i.getDay())) : e.activeCalendar.startDay > i.getDay() && t.toDate.setDate(i.getDate() + (e.activeCalendar.startDay - i.getDay() - 1)); | |
break; | |
case"7days": | |
(t = n(new Date, new Date)).fromDate.setDate(t.toDate.getDate() - 6); | |
break; | |
case"month": | |
(t = n(new Date, new Date)).fromDate.setMonth(t.fromDate.getMonth() - 1), t.fromDate.setDate(1), t.toDate.setDate(0); | |
break; | |
case"30days": | |
(t = n(new Date, new Date)).fromDate.setDate(t.fromDate.getDate() - 29); | |
break; | |
case"year": | |
(t = n(new Date, new Date)).toDate.setDate(0), t.fromDate.setDate(t.fromDate.getDate() - 364); | |
break; | |
case"365days": | |
(t = n(new Date, new Date)).fromDate.setFullYear(t.fromDate.getFullYear() - 1) | |
} | |
var a, c; | |
e.fromDate = new Date(t.fromDate.getTime()), e.toDate = new Date(t.toDate.getTime()), e.clickDate({ | |
currentDateStart: e.fromDate, | |
currentDateOver: e.fromDate, | |
selectRange: !0 | |
}), e.clickDate({ | |
currentDateStart: e.toDate, | |
currentDateOver: e.toDate, | |
selectRange: !1 | |
}), v(), T(), e.dirtyDate = !1 | |
}, e.customButtonClick = function (t) { | |
t(function (t, n) { | |
e.fromDate = t, e.toDate = n | |
}) && e.showCalendar() | |
}, e.applySelect = function (n) { | |
!n || n.target.className.indexOf("dtpicker-cancel") ? (e.options.mainOptions.time.enabled ? ("[object Date]" === Object.prototype.toString.call(c) && (e.fromDate = new Date(c.setHours(e.hours, e.minutes, 0, 0))), "[object Date]" === Object.prototype.toString.call(u) && (e.toDate = new Date(u.setHours(e.hours, e.minutes, 0, 0)))) : (e.fromDate = c ? new Date(c.getTime()) : null, e.toDate = u ? new Date(u.getTime() + e.activeCalendar.diffDateEnd) : null), e.dirtyDate = !1, v(), T(), t(function () { | |
e.applyClick && e.applyClick() | |
}, 0), e.options.mainOptions.applyClose && e.openCalendar && e.showCalendar()) : e.openCalendar && e.showCalendar() | |
}; | |
var T = function () { | |
e.skeletonLeft = n.buildCalendarSkeleton(e.activeCalendar, { | |
viewDateEnd: p, | |
viewDateStart: d | |
}, {innerFromDateStart: c, innerFromDateEnd: s}, { | |
innerToDateStart: l, | |
innerToDateEnd: u | |
}), e.skeletonRight = n.buildCalendarSkeleton(e.activeCalendar, { | |
viewDateEnd: m, | |
viewDateStart: f | |
}, {innerFromDateStart: c, innerFromDateEnd: s}, {innerToDateStart: l, innerToDateEnd: u}) | |
}; | |
T(), e.getSelectedFromDate = function () { | |
return c | |
}, e.getSelectedToDate = function () { | |
return u | |
} | |
} | |
function tpTemplates(e) { | |
var t = '<div class="dtpicker-content">\t<div class="calendar-canva">\t\t<div class="dtpicker-head">\t\t\t<div class="dtpicker-title">\t\t\t\t<div class="dtpicker-pager dtpicker-pager-left">\t\t\t\t\t<div ng-if="activeCalendar.showExtraArrow" ng-click="changeLeftInterim(-1,\'y\')" class="dtpicker-prev-year"><i class="icon-arrow-double-datepicker-left"></i></div>\t\t\t\t\t<div ng-if="activeCalendar.showArrow" ng-click="changeLeft(-1)" class="dtpicker-prev-month"><i class="icon-arrow-datepicker-left"></i></div>\t\t\t\t</div>\t\t\t\t<div class="dtpicker-month">\t\t\t\t\t<span>{{viewDateLeftStart | date:activeCalendar.calendarUnitTitle}}</span> \t\t\t\t\t<span ng-if="activeCalendar.calendarUnitTitleRange"> — {{viewDateLeftEnd | date:activeCalendar.calendarUnitTitle}}</span>\t\t\t\t\t<div class="dtpicker-year" ng-if="activeCalendar.selectYear">\t\t\t\t\t\t<select ng-change="onYearChange(activeCalendar)" ng-model="activeCalendar.year">\t\t\t\t\t\t\t<option ng-repeat="year in years">{{ year }}</option>\t\t\t\t\t\t</select>\t\t\t\t\t</div>\t\t\t\t</div>\t\t\t\t<div class="dtpicker-pager dtpicker-pager-right">\t\t\t\t\t<div \t\t\t\t\t\tng-hide="hideArrow"\t\t\t\t\t\tng-if="activeCalendar.showArrow"\t\t\t\t\t\tng-click="changeLeft(1)"\t\t\t\t\t\tclass="dtpicker-next-month">\t\t\t\t\t\t<i class="icon-arrow-datepicker-right"></i>\t\t\t\t\t</div>\t\t\t\t\t<div ng-if="activeCalendar.showExtraArrow" ng-hide="hideArrow" ng-click="changeLeftInterim(1,\'y\')" class="dtpicker-next-year"><i class="icon-arrow-double-datepicker-right"></i></div>\t\t\t\t</div>\t\t\t</div>\t\t\t<div ng-if="activeCalendar.viewDayOfWeek" class="dtpicker-dayname clearfix">\t\t\t\t<div ng-repeat="dayname in dayNames track by $index" class="dayname-list">{{dayname | date:"EEE" | limitTo: 1}}</div>\t\t\t</div>\t\t</div>\t\t<table class="dtpicker-body">\t\t\t<tr class="dtpicker-row" ng-repeat="str in skeletonLeft">\t\t\t\t<td \t\t\t\t\tng-class="\t\t\t\t\t{\'out-day\': day.out, \t\t\t\t\t\'select-day\': day.selectRange, \t\t\t\t\t\'today\': day.today, \t\t\t\t\t\'select-today\': day.selectToday, \t\t\t\t\t\'range-day\': day.selectRange, \t\t\t\t\t\'change-date\': dirtyDate, \t\t\t\t\t\'first-select-day\': (day.firstSelectDay), \t\t\t\t\t\'last-select-day\': (day.lastSelectDay), \t\t\t\t\t\'disabled-day\': (day.disabled), \t\t\t\t\t\'marker-day\': (day.markerDay), \t\t\t\t\t\'marker-column\': (day.markerColumn), \t\t\t\t\t\'marker-row\': (day.markerRow)}" \t\t\t\t\tng-click="clickDate(day)"\t\t\t\t\tclass="calendar-day {{day.markerColumn}} {{day.markerRow}}"\t\t\t\t\tng-repeat="day in str track by $index">\t\t\t\t\t<div ng-if="activeCalendar.unitTitle.type === \'date\'">\t\t\t\t\t\t<span>\t\t\t\t\t\t\t{{day.currentDateStart | date:activeCalendar.unitTitle.title}} <em class="inline" ng-if="activeCalendar.unitTitleRange">- {{day.currentDateOver | date:activeCalendar.unitTitle.title}}</em>\t\t\t\t\t\t</span>\t\t\t\t\t</div>\t\t\t\t\t<div ng-if="activeCalendar.unitTitle.type === \'index\'">\t\t\t\t\t\t<span>\t\t\t\t\t\t\t<span>{{activeCalendar.unitTitle.Ltitle}}</span>\t\t\t\t\t\t\t<span>{{day.index + 1}}</span>\t\t\t\t\t\t\t<span>{{activeCalendar.unitTitle.Rtitle}}</span>\t\t\t\t\t\t</span>\t\t\t\t\t</div>\t\t\t\t</td>\t\t\t</tr>\t\t</table>\t</div>\t<div ng-if="!activeCalendar.oneCanvasCalendar" class="calendar-canva">\t\t<div class="dtpicker-head">\t\t\t<div class="dtpicker-title">\t\t\t\t<div class="dtpicker-pager dtpicker-pager-left">\t\t\t\t\t<div ng-if="activeCalendar.showExtraArrow" ng-hide="hideArrow" ng-click="changeRightInterim(-1,\'y\')" class="dtpicker-prev-year"><i class="icon-arrow-double-datepicker-left"></i></div>\t\t\t\t\t<div \t\t\t\t\t\tng-hide="hideArrow"\t\t\t\t\t\tng-if="activeCalendar.showArrow"\t\t\t\t\t\tng-click="changeRight(-1)"\t\t\t\t\t\tclass="dtpicker-prev-month">\t\t\t\t\t\t\t<i class="icon-arrow-datepicker-left"></i>\t\t\t\t\t</div>\t\t\t\t</div>\t\t\t\t<div class="dtpicker-month">\t\t\t\t\t<span>{{viewDateRightStart | date:activeCalendar.calendarUnitTitle}}</span> \t\t\t\t\t<span ng-if="activeCalendar.calendarUnitTitleRange"> — {{viewDateRightEnd | date:activeCalendar.calendarUnitTitle}}</span>\t\t\t\t</div>\t\t\t\t<div class="dtpicker-pager dtpicker-pager-right">\t\t\t\t\t<div ng-if="activeCalendar.showArrow" ng-click="changeRight(1)" class="dtpicker-next-month"><i class="icon-arrow-datepicker-right"></i></div>\t\t\t\t\t<div ng-if="activeCalendar.showExtraArrow" ng-click="changeRightInterim(1,\'y\')" class="dtpicker-next-year"><i class="icon-arrow-double-datepicker-right"></i></div>\t\t\t\t</div>\t\t\t</div>\t\t\t<div ng-if="activeCalendar.viewDayOfWeek" class="dtpicker-dayname clearfix">\t\t\t\t<div ng-repeat="dayname in dayNames track by $index" class="dayname-list">{{dayname | date:"EEE" | limitTo: 1}}</div>\t\t\t</div>\t\t</div>\t\t<table class="dtpicker-body">\t\t\t<tr class="dtpicker-row" ng-repeat="str in skeletonRight">\t\t\t\t<td \t\t\t\tng-class="\t\t\t\t{\'out-day\': day.out, \t\t\t\t\'select-day\': day.selectRange, \t\t\t\t\'today\': day.today, \t\t\t\t\'select-today\': day.selectToday, \t\t\t\t\'range-day\': day.selectRange, \t\t\t\t\'change-date\': dirtyDate, \t\t\t\t\'first-select-day\': (day.firstSelectDay), \t\t\t\t\'last-select-day\': (day.lastSelectDay), \t\t\t\t\'disabled-day\': (day.disabled), \t\t\t\t\'marker-day\': (day.markerDay), \t\t\t\t\'marker-column\': (day.markerColumn), \t\t\t\t\'marker-row\': (day.markerRow)}" \t\t\t\tng-click="clickDate(day)"\t\t\t\tclass="calendar-day {{day.markerColumn}} {{day.markerRow}}"\t\t\t\tng-repeat="day in str track by $index">\t\t\t\t\t<div ng-if="activeCalendar.unitTitle.type === \'date\'">\t\t\t\t\t\t<span>\t\t\t\t\t\t\t{{day.currentDateStart | date:activeCalendar.unitTitle.title}} <em class="inline" ng-if="activeCalendar.unitTitleRange">- {{day.currentDateOver | date:activeCalendar.unitTitle.title}}</em>\t\t\t\t\t\t</span>\t\t\t\t\t</div>\t\t\t\t\t<div ng-if="activeCalendar.unitTitle.type === \'index\'">\t\t\t\t\t\t<span>\t\t\t\t\t\t\t<span>{{activeCalendar.unitTitle.Ltitle}}</span>\t\t\t\t\t\t\t<span>{{day.index + 1}}</span>\t\t\t\t\t\t\t<span>{{activeCalendar.unitTitle.Rtitle}}</span>\t\t\t\t\t\t</span>\t\t\t\t\t</div>\t\t\t\t</td>\t\t\t</tr>\t\t</table>\t</div>\t<div ng-if="options.mainOptions.showPanelCustomButton && (activeCalendar.customButtonSelect.length || activeCalendar.customButtonCallback.length)" class="calendar-canva additional-canva">\t\t<div class="dtpicker-head">\t\t\t<div class="dtpicker-title">\t\t\t\t<div class="dtpicker-month">{{options.mainOptions.customPanel.title}}</div>\t\t\t</div>\t\t\t<div class="dtpicker-dayname clearfix">\t\t\t\t<div class="dtpicker-daterange">{{fromDate | date:options.mainOptions.customPanel.dateFormat}} - {{toDate | date:options.mainOptions.customPanel.dateFormat}}</div>\t\t\t</div>\t\t</div>\t\t<div class="dtpicker-body">\t\t\t<div class="dtpicker-buttons clearfix">\t\t\t\t<button ng-repeat="customButton in activeCalendar.customButtonSelect" class="btn btn-small btn-uppercased custom-select" ng-click="customSelectButton(customButton.diff())">{{ customButton.buttonName || customButton.butttonName }}</button>\t\t\t\t<button ng-repeat="customButton in activeCalendar.customButtonCallback" class="btn btn-small btn-uppercased custom-select" ng-click="customButtonClick(customButton.callback)">{{customButton.buttonName}}</button>\t\t\t</div>\t\t</div>\t</div></div>'; | |
e.put("template/datepicker/datepicker-inline.html", '<div class="tp-datepicker extended custom inline">' + t + "</div>"), e.put("template/datepicker/datepicker-custom.html", '<div class="tp-datepicker extended custom">\t<div ng-click="showCalendar()" class="dtpicker-input">\t\t<div ng-transclude></div>\t</div>\t<div ng-show="openCalendar" class="calendar" ng-animate="\'animate\'" ng-animate-children animate="animate" ng-class="{\'tabs-on\': options.mainOptions.showPanelTab, \'hidden-on-load\': !contentLoaded, \'hidden-on-position-updated\': !positionUpdated}">\t\t<div class="dtpicker-tabs" ng-if="options.mainOptions.showPanelTab">\t\t\t<div ng-click="clickTab($index)" ng-class="{active: activeTab === $index}" ng-repeat="optionItem in options.calendarOptions" ng-if="options.mainOptions.showPanelTab" class="dtpicker-tab">\t\t\t\t{{optionItem.calendarCaption || optionItem.calendarTitle}}\t\t\t</div>\t\t</div> <div ng-class="{\'datepicker-body\': true, \'initial-empty\': initialEmpty}" ng-if="openCalendar || !initialEmpty">' + t + ' </div>\t\t<div ng-show="options.mainOptions.time.enabled" id="dtpicker-time" class="dtpicker-time">\t\t\t<tp-time options="options.mainOptions.time" hours="hours" minutes="minutes"></tp-time>\t\t</div>\t\t<div ng-show="!options.mainOptions.hideApplySelect" ng-click="applySelect($event)" class="dtpicker-submit">\t\t\t<div ng-if="options.mainOptions.applyButton.enable">{{options.mainOptions.applyButton.title}}</div>\t\t\t<div ng-if="options.mainOptions.closeButton.enable" class="dtpicker-cancel">{{options.mainOptions.closeButton.title}}</div>\t\t</div>\t</div></div>') | |
} | |
function tpTime() { | |
return { | |
scope: {hours: "=?", minutes: "=?", options: "=?"}, | |
controller: "tpTimeController", | |
restrict: "AE", | |
replace: !0, | |
template: '<div id="time-wrapper" class="time-wrapper" ng-show="options.enabled"><div class="time-inputs-wrapper"><input type="text" ng-model="viewHours" id="hours" maxlength="2" ng-blur="onBlurHours($event)" ng-keydown="onKeyDownHours($event)" ng-keyup="onKeyUpHours($event)" /><input type="text" ng-model="viewMinutes" id="minutes" maxlength="2" ng-blur="onBlurMinutes($event)" ng-keydown="onKeyDownMinutes($event)" ng-keyup="onKeyUpMinutes($event)" /></div><div ng-show="options.timeFormat12hours" class="meridian-select-wrapper"><select ng-model="meridiem" ng-change="updateTime()" ng-options="key for (key, value) in meridiems" class="light"></select></div><div ng-show="options.showTimezone" class="timezone-wrapper">GMT {{timezone}}</div></div>' | |
} | |
} | |
function tpTimeController(e) { | |
var t, n, r; | |
if (e.options = angular.extend({ | |
enabled: !0, | |
timeFormat12hours: !0, | |
minutesStep: 15, | |
showTimezone: !0 | |
}, e.options), e.options.enabled) { | |
var o, i = new Date; | |
e.meridiems = {AM: 1, PM: 2}; | |
var a, c, s = 46, l = 8, u = 9, d = 37, p = 38, f = 39, m = 40, h = 16, g = 48, v = 57, | |
y = _.isUndefined(e.hours) ? i.getHours() : e.hours, | |
E = _.isUndefined(e.minutes) ? i.getMinutes() : e.minutes, | |
C = e.options.timeFormat12hours ? 12 : 24, T = 60, S = e.options.minutesStep, w = !1; | |
e.$on("time-updated", function (e, t) { | |
y = t.hours, E = t.minutes, b() | |
}), b(), e.onKeyDownHours = function (t) { | |
R(t), _.isNaN(e.viewHours) || "" === e.viewHours || (a = e.viewHours); | |
switch (t.keyCode) { | |
case p: | |
$(); | |
break; | |
case m: | |
k() | |
} | |
}, e.onKeyUpHours = function (t) { | |
x(t), function (t) { | |
var n = N(e.viewHours, a), r = t.which || t.keyCode; | |
e.options.timeFormat12hours && 0 === n && (e.viewHours = C); | |
M("hours", n) && (e.viewHours = P(n)); | |
(n > C || O(a, r)) && (e.viewHours = ""); | |
n === C && (e.viewHours = function (t) { | |
return t !== C || e.options.timeFormat12hours ? t : P(0) | |
}(C)) | |
}(t), L(), D(t) | |
}, e.onKeyDownMinutes = function (t) { | |
R(t), _.isNaN(e.viewMinutes) || "" === e.viewMinutes || (c = e.viewMinutes); | |
switch (t.keyCode) { | |
case p: | |
n = N(e.viewMinutes, c), (n += S || 1) > T - 1 ? ($(), e.viewMinutes = P(n - T)) : e.viewMinutes = P(n); | |
break; | |
case m: | |
!function () { | |
var t = N(e.viewMinutes, c); | |
(t -= S || 1) < 0 ? (k(), e.viewMinutes = P(t + T)) : e.viewMinutes = P(t) | |
}() | |
} | |
var n | |
}, e.onKeyUpMinutes = function (t) { | |
x(t), function (t) { | |
var n = _.parseInt(e.viewMinutes, 10), r = t.which || t.keyCode; | |
M("minutes", n) && (e.viewMinutes = P(n)); | |
(n > T || O(c, r)) && (e.viewMinutes = "") | |
}(t), L(), D(t) | |
}, e.onBlurHours = function () { | |
var t = parseInt(e.viewHours, 10), n = e.options.timeFormat12hours ? 12 : 23; | |
!_.isNaN(e.viewHours) && t > n && (A(n), e.hours = n) | |
}, e.onBlurMinutes = function () { | |
var t = parseInt(e.viewMinutes, 10); | |
!_.isNaN(e.viewHours) && t > 59 && (e.viewMinutes = P(59), e.minutes = 59) | |
}, e.updateTime = L, e.timezone = (t = i.getTimezoneOffset(), n = Math.abs(t), r = Math.floor(n / T), (t < 0 ? "+" : "-") + r) | |
} | |
function b() { | |
A(y), e.viewMinutes = P(E), e.hours = _.parseInt(y, 10), e.minutes = _.parseInt(E, 10) | |
} | |
function A(t) { | |
if (e.options.timeFormat12hours) { | |
var n = angular.copy(function (t) { | |
var n = t, r = e.meridiems.AM; | |
t > 12 && (n = t - 12); | |
t >= 12 && (r = e.meridiems.PM); | |
0 === t && (n = 12); | |
return [n, r] | |
}(t)); | |
e.viewHours = P(n[0]), e.meridiem = n[1] | |
} else e.viewHours = P(t) | |
} | |
function P(e) { | |
return 1 === e.toString().length ? "0" + e : e | |
} | |
function $() { | |
o = N(e.viewHours, a), e.options.timeFormat12hours ? (o === C - 1 && (e.meridiem = I()), o >= C && (o = 0)) : o === C - 1 && (o = -1), e.viewHours = P(o + 1) | |
} | |
function k() { | |
o = N(e.viewHours, a), e.options.timeFormat12hours ? (o === C && (e.meridiem = I()), o <= 1 && (o = C + 1)) : o <= 0 && (o = C), e.viewHours = P(o - 1) | |
} | |
function I() { | |
return e.meridiem === e.meridiems.AM ? e.meridiems.PM : e.meridiems.AM | |
} | |
function N(e, t) { | |
var n = _.parseInt(e, 10); | |
return (_.isNaN(n) || "" === n) && (n = _.parseInt(t, 10)), n | |
} | |
function D(e) { | |
switch (e.which || e.keyCode) { | |
case d: | |
case f: | |
e.preventDefault(), e.stopPropagation() | |
} | |
} | |
function x(e) { | |
(e.which || e.keyCode) === h && (w = !1) | |
} | |
function O(e, t) { | |
return e < 10 && (t === l || t === s) | |
} | |
function M(t, n) { | |
return "hours" === t ? 1 === n.toString().length && (e.options.timeFormat12hours ? n > 1 : n > 2 || 0 === n) : 1 === n.toString().length && n > 5 | |
} | |
function R(e) { | |
var t = e.which || e.keyCode; | |
(t < g && t != u && t != l && t != d && t != f && t != s || t > v || w && t != d && w && t != f) && e.preventDefault(), t === h && (w = !0) | |
} | |
function L() { | |
var t = N(e.viewHours, a), n = N(e.viewMinutes, c); | |
e.hours = function (t) { | |
var n = t; | |
(e.meridiem === e.meridiems.AM && t > 12 || e.meridiem === e.meridiems.AM && 12 === t) && (n = t - 12); | |
e.meridiem === e.meridiems.PM && t < 12 && (n = t + 12); | |
return n | |
}(t), e.minutes = n | |
} | |
} | |
function tpTimepicker(e, t, n, r) { | |
return { | |
scope: {time: "=?", options: "=?"}, | |
link: function (o, i, a) { | |
function c() { | |
o.$apply(function () { | |
o.closeWidget() | |
}) | |
} | |
function s(e) { | |
switch (e.keyCode) { | |
case 27: | |
o.$apply(function () { | |
o.closeWidget() | |
}) | |
} | |
} | |
o.texts = { | |
title: r.trc("publisher.dashboard", "Set time"), | |
apply: r.trc("publisher.dashboard", "Apply"), | |
cancel: r.trc("publisher.dashboard", "Cancel") | |
}, o.model = {openWidget: !1}, o.model.openWidget = !1, "undefined" != typeof moment ? o.model.time = moment(o.time).zone(0) : o.model.time = o.model.time.utc().valueOf(), o.tpTimeValues = { | |
hours: o.model.time.hour(), | |
minutes: o.model.time.minutes() | |
}, o.$broadcast("time-updated", o.tpTimeValues), o.showWidget = function () { | |
o.model.openWidget = !o.model.openWidget, o.model.openWidget && (n(function () { | |
var n = i.find(".tp-timepicker-wrapper"), r = i.find(".tp-timepicker"); | |
r.offset().left + r.innerWidth() / 2 < n.innerWidth() / 2 ? n.offset({left: 20}) : r.offset().left + n.innerWidth() / 2 + r.innerWidth() / 2 > e.innerWidth ? n.offset({left: e.innerWidth - n.innerWidth() - 20}) : n.offset({left: r.offset().left + r.innerWidth() / 2 - n.innerWidth() / 2}), t.bind("click", c), t.bind("keyup", s) | |
}, 10), o.$broadcast("time-updated", o.tpTimeValues)) | |
}, o.closeWidget = function () { | |
o.model.openWidget = !1, t.unbind("click", c), t.unbind("keyup", s) | |
}, o.setNewTime = function () { | |
o.model.time.hour(o.tpTimeValues.hours), o.model.time.minutes(o.tpTimeValues.minutes), o.time = o.model.time.utc().valueOf(), o.closeWidget(), o.$broadcast("time-updated", o.tpTimeValues) | |
}, i.find(".tp-timepicker-wrapper").click(function (e) { | |
e.stopPropagation() | |
}) | |
}, | |
controller: ["$scope", function (e) { | |
e.tpTimeOptions = {showTimezone: !1} | |
}], | |
restrict: "AE", | |
template: '<div class="tp-timepicker"> <div class="tp-timepicker-handler" ng-click="showWidget()"> {{model.time | tpDateMoment:"hh:mm A":0}} </div> <div ng-hide="!model.openWidget" class="tp-timepicker-wrapper"> <div class="tp-timepicker-header">{{texts.title}}</div> <div class="tp-timepicker-body"><tp-time hours="tpTimeValues.hours" minutes="tpTimeValues.minutes" options="tpTimeOptions"></tp-time></div> <div class="tp-timepicker-footer"><div class="tp-timepicker-footer-btn tp-timepicker-btn-cancel" ng-click="closeWidget()">{{texts.cancel}}</div><div class="tp-timepicker-footer-btn tp-timepicker-btn-apply" ng-click="setNewTime()">{{texts.apply}}</div></div> </div></div>' | |
} | |
} | |
tpDatepicker.$inject = ["$document", "$window", "$timeout", "$q"], tpTemplates.$inject = ["$templateCache"], function (e, t) { | |
"use strict"; | |
var n = "yyyy-MM-dd"; | |
function r(e) { | |
return new Date(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate()) | |
} | |
t.module("ngInputDate", ["ng"]).factory("inputDate", function () { | |
return {ExtractDate: r} | |
}).directive("input", ["dateFilter", "$timeout", function (e, t) { | |
return { | |
restrict: "EA", require: "?ngModel", link: function (t, r, o, i) { | |
if (void 0 !== o.type && "date" === o.type && i) { | |
var a = void 0 !== o.time && void 0 !== o.timeFormat ? o.timeFormat : o.dateFormat || n; | |
i.$formatters.unshift(function (t) { | |
return e(t, a) | |
}), i.$parsers.unshift(function (e) { | |
return function (e, t) { | |
if (void 0 === e || "" === e) return null; | |
var r, o, i; | |
if (t === n) { | |
var a = e.split("-"); | |
if (3 !== a.length) return null; | |
r = parseInt(a[0], 10), o = parseInt(a[1], 10), i = parseInt(a[2], 10) | |
} else if ("function" == typeof moment) { | |
var c = moment(e, t.toUpperCase()); | |
r = c.year(), o = c.month() + 1, i = c.date() | |
} | |
return o && r && i ? new Date(r, o - 1, i) : null | |
}(e, a) | |
}) | |
} | |
} | |
} | |
}]) | |
}(window, angular), function (e) { | |
"use strict"; | |
e.module("datetime", []), e.module("datetime").constant("datetimePlaceholder", { | |
year: "(year)", | |
yearShort: "(year)", | |
month: "(month)", | |
date: "(date)", | |
day: "(day)", | |
hour: "(hour)", | |
hour12: "(hour12)", | |
minute: "(minute)", | |
second: "(second)", | |
millisecond: "(millisecond)", | |
ampm: "(AM/PM)", | |
week: "(week)" | |
}); | |
var t = {exports: {}}; | |
!function (e) { | |
void 0 !== t && (t.exports = e); | |
var n = "listeners", r = { | |
on: function (e, t) { | |
return a(this, e).push(t), this | |
}, once: function (e, t) { | |
var n = this; | |
return r.originalListener = t, a(n, e).push(r), n; | |
function r() { | |
i.call(n, e, r), t.apply(this, arguments) | |
} | |
}, off: i, emit: function (e, t) { | |
var n = this, r = a(n, e, !0); | |
if (!r) return !1; | |
var o = arguments.length; | |
if (1 === o) r.forEach(function (e) { | |
e.call(n) | |
}); else if (2 === o) r.forEach(function (e) { | |
e.call(n, t) | |
}); else { | |
var i = Array.prototype.slice.call(arguments, 1); | |
r.forEach(function (e) { | |
e.apply(n, i) | |
}) | |
} | |
return !!r.length | |
} | |
}; | |
function o(e) { | |
for (var t in r) e[t] = r[t]; | |
return e | |
} | |
function i(e, t) { | |
var r, o = this; | |
if (arguments.length) { | |
if (t) { | |
if (r = a(o, e, !0)) { | |
if (!(r = r.filter(function (e) { | |
return e !== t && e.originalListener !== t | |
})).length) return i.call(o, e); | |
o[n][e] = r | |
} | |
} else if ((r = o[n]) && (delete r[e], !Object.keys(r).length)) return i.call(o) | |
} else delete o[n]; | |
return o | |
} | |
function a(e, t, r) { | |
if (!r || e[n]) { | |
var o = e[n] || (e[n] = {}); | |
return o[t] || (o[t] = []) | |
} | |
} | |
o(e.prototype), e.mixin = o | |
}(function e() { | |
if (!(this instanceof e)) return new e | |
}); | |
var n = t.exports, r = function (e, t, n) { | |
var r; | |
if ((e = "" + e).length > n) e = e.substr(e.length - n); else if (e.length < t) for (r = e.length; r < t; r++) e = "0" + e; | |
return e | |
}, o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { | |
return typeof e | |
} : function (e) { | |
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e | |
}, i = function (e, t) { | |
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") | |
}, a = function (e, t) { | |
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t); | |
e.prototype = Object.create(t && t.prototype, { | |
constructor: { | |
value: e, | |
enumerable: !1, | |
writable: !0, | |
configurable: !0 | |
} | |
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t) | |
}, c = function (e, t) { | |
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
return !t || "object" != typeof t && "function" != typeof t ? e : t | |
}; | |
function s(e, t, n) { | |
for (var r = 0, o = e.toUpperCase(), i = n.toUpperCase(); o[t + r] && o[t + r] == i[r];) r++; | |
return e.substr(t, r) | |
} | |
function l(e, t, n) { | |
var o = function (e, t, n) { | |
var o, i, a, c; | |
if ("static" == t.type) return e.startsWith(t.value, n) ? {viewValue: t.value} : { | |
err: 2, | |
code: "TEXT_MISMATCH", | |
message: "Pattern value mismatch" | |
}; | |
if ("number" == t.type) return null == (a = function (e, t) { | |
var n = (e = e.substring(t)).match(/^\d+/); | |
return n && n[0] | |
}(e, n)) ? { | |
err: 1, | |
code: "NUMBER_MISMATCH", | |
message: "Invalid number", | |
viewValue: "" | |
} : a.length < t.minLength ? { | |
err: 1, | |
code: "NUMBER_TOOSHORT", | |
message: "The length of number is too short", | |
value: +a, | |
viewValue: a, | |
properValue: r(+a, t.minLength, t.maxLength) | |
} : (a.length > t.maxLength && (a = a.substr(0, t.maxLength)), +a < t.min ? { | |
err: 1, | |
code: "NUMBER_TOOSMALL", | |
message: "The number is too small", | |
value: +a, | |
viewValue: a, | |
properValue: r(t.min, t.minLength, t.maxLength) | |
} : a.length > t.minLength && "0" == a[0] ? { | |
err: 1, | |
code: "LEADING_ZERO", | |
message: "The number has too many leading zero", | |
value: +a, | |
viewValue: a, | |
properValue: r(+a, t.minLength, t.maxLength) | |
} : +a > t.max ? { | |
err: 1, | |
code: "NUMBER_TOOLARGE", | |
message: "The number is too large", | |
value: +a, | |
viewValue: a, | |
properValue: r(t.max, t.minLength, t.maxLength) | |
} : {value: +a, viewValue: a}); | |
if ("select" == t.type) { | |
for (i = "", c = 0; c < t.select.length; c++) (o = s(e, n, t.select[c])) && o.length > i.length && (a = c, i = o); | |
return i ? i != t.select[a] ? { | |
err: 1, | |
code: "SELECT_INCOMPLETE", | |
message: "Incomplete select", | |
value: a + 1, | |
viewValue: i, | |
selected: t.select[a] | |
} : {value: a + 1, viewValue: i} : { | |
err: 1, | |
code: "SELECT_MISMATCH", | |
message: "Invalid select", | |
viewValue: "" | |
} | |
} | |
throw"Unknown token type: " + t.type | |
}(e, t, n); | |
return o.err && "static" != t.type && e.startsWith(t.placeholder, n) && (1 < o.err || o.viewValue.length <= t.placeholder.length) ? { | |
empty: !0, | |
viewValue: t.placeholder | |
} : o | |
} | |
function u(e, t) { | |
var n, r, o = 0, i = [], a = e, c = Array.isArray(a), s = 0; | |
for (a = c ? a : a[Symbol.iterator](); ;) { | |
if (c) { | |
if (s >= a.length) break; | |
n = a[s++] | |
} else { | |
if ((s = a.next()).done) break; | |
n = s.value | |
} | |
if ((r = l(t, n.token, o)).node = n, r.pos = o, r.token = n.token, 2 <= r.err) throw r.text = t, r; | |
o += r.viewValue.length, i.push(r) | |
} | |
var u = i[i.length - 1]; | |
if (u.pos + u.viewValue.length < t.length) throw{ | |
code: "TEXT_TOOLONG", | |
message: "Text is too long", | |
text: t | |
}; | |
return i | |
} | |
function d(e, t) { | |
if ("static" == t.type) return {viewValue: t.value}; | |
var n = t.extract(e); | |
if ("number" == t.type) return {value: n, viewValue: r(n, t.minLength, t.maxLength)}; | |
if ("select" == t.type) return {value: n, viewValue: t.select[n - 1]}; | |
throw"Unknown type to format: " + t.type | |
} | |
function p(e, t, n) { | |
var r, o, i = [], a = t, c = Array.isArray(a), s = 0; | |
for (a = c ? a : a[Symbol.iterator](); ;) { | |
if (c) { | |
if (s >= a.length) break; | |
o = a[s++] | |
} else { | |
if ((s = a.next()).done) break; | |
o = s.value | |
} | |
r = d(e, o.token), "static" != o.token.type && o.empty && !n && (r.value = null, r.viewValue = o.token.placeholder), i.push(r) | |
} | |
return i | |
} | |
var f = function () { | |
function e(t, n) { | |
i(this, e), this.parser = t, this.token = n, this.value = null, this.viewValue = n.value, this.offset = 0, this.next = null, this.prev = null, this.nextEdit = null, this.prevEdit = null, this.empty = !0 | |
} | |
return e.prototype.unset = function () { | |
"static" == this.token.type || this.parser.noEmpty || (this.empty = !0, this.parser.setValue(this.parser.value, !1)) | |
}, e.prototype.parse = function (e) { | |
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0, | |
n = l(e, this.token, t); | |
if (n.err) throw n.node = this, n.token = this.token, n; | |
if (this.parser.noEmpty && n.empty) throw{ | |
code: "NOT_INIT_FORBIDDEN", | |
message: "Empty node is forbidden", | |
node: this | |
}; | |
if (n.empty) this.unset(); else { | |
this.empty = !1; | |
var r = h(this.parser.copyValue(this.parser.value), this.token, n.value, this.parser); | |
this.parser.setValue(r, !1) | |
} | |
}, e.prototype.add = function (e) { | |
var t, n, r, o = this.parser.copyValue(this.parser.value); | |
this.empty = !1, o = m(o, this.token, e, this.parser), t = this.token.extract(o), "number" == this.token.type ? (n = this.token.min, r = this.token.max) : "select" == this.token.type && (n = 1, r = this.token.select.length), t < n && (o = h(o, this.token, n, this.parser)), r < t && (o = h(o, this.token, r, this.parser)), this.parser.setValue(o, !1) | |
}, e | |
}(); | |
function m(e, t, n, r) { | |
return "object" == (void 0 === e ? "undefined" : o(e)) ? (t.add(e, n, r), e) : t.add(e, n, r) | |
} | |
function h(e, t, n, r) { | |
return "object" == (void 0 === e ? "undefined" : o(e)) ? (t.restore(e, n, r), e) : t.restore(e, n, r) | |
} | |
function g(e) { | |
return e | |
} | |
var v = function (e) { | |
function t() { | |
i(this, t); | |
var n = c(this, e.call(this)); | |
return n._constructor.apply(n, arguments), n.initialize(), n | |
} | |
return a(t, e), t.prototype._constructor = function (e) { | |
var t = e.tokens, n = e.noEmpty, r = void 0 !== n && n, o = e.value, i = e.text, a = e.copyValue, | |
c = void 0 === a ? g : a; | |
if (!t || !t.length) throw new Error("option.tokens is required"); | |
this.tokens = t, this.nodes = function (e, t) { | |
var n, r, o, i = [], a = t, c = Array.isArray(a), s = 0; | |
for (a = c ? a : a[Symbol.iterator](); ;) { | |
if (c) { | |
if (s >= a.length) break; | |
n = a[s++] | |
} else { | |
if ((s = a.next()).done) break; | |
n = s.value | |
} | |
i.push(new f(e, n)) | |
} | |
for (r = 0; r < i.length; r++) i[r].next = i[r + 1] || null, i[r].prev = i[r - 1] || null; | |
for (o = null, r = 0; r < i.length; r++) i[r].prevEdit = o, "static" != i[r].token.type && (o = i[r]); | |
for (o = null, r = i.length - 1; 0 <= r; r--) i[r].nextEdit = o, "static" != i[r].token.type && (o = i[r]); | |
return i | |
}(this, t), this.nameMap = function (e) { | |
var t = new Map, n = e, r = Array.isArray(n), o = 0; | |
for (n = r ? n : n[Symbol.iterator](); ;) { | |
var i; | |
if (r) { | |
if (o >= n.length) break; | |
i = n[o++] | |
} else { | |
if ((o = n.next()).done) break; | |
i = o.value | |
} | |
var a = i, c = t.get(a.token.name); | |
c || (c = [], t.set(a.token.name, c)), c.push(a) | |
} | |
return t | |
}(this.nodes), this.value = o, this.text = i, this.noEmpty = r, this.copyValue = c, this.err = !1 | |
}, t.prototype.initialize = function () { | |
this.setValue(this.value) | |
}, t.prototype.parse = function (e) { | |
if (!e) throw{code: "EMPTY", message: "The input is empty", oldText: this.text}; | |
var t, n; | |
t = u(this.nodes, e); | |
var r, o = []; | |
for (r = this.err ? u(this.nodes, this.text) : this.nodes, n = 0; n < t.length; n++) t[n].empty || t[n].viewValue == r[n].viewValue || (t[n].token = this.nodes[n].token, o.push(t[n])); | |
var i = t.filter(function (e) { | |
return e.empty | |
}), a = t.filter(function (e) { | |
return e.err | |
}); | |
for (n = 0; n < t.length; n++) this.nodes[n].value = t[n].value, this.nodes[n].viewValue = t[n].viewValue, this.nodes[n].offset = t[n].pos, this.nodes[n].empty = t[n].empty; | |
if (a.length) throw this.err = !0, a[0]; | |
this.err = !1, o.sort(function (e, t) { | |
return t.empty ? -1 : e.empty ? 1 : (t.token.prior || 0) - (e.token.prior || 0) | |
}); | |
var c, s = this.copyValue(this.value), l = o, d = Array.isArray(l), f = 0; | |
for (l = d ? l : l[Symbol.iterator](); ;) { | |
if (d) { | |
if (f >= l.length) break; | |
c = l[f++] | |
} else { | |
if ((f = l.next()).done) break; | |
c = f.value | |
} | |
s = h(s, c.token, c.value, this) | |
} | |
var m = p(s, t).map(function (e) { | |
return e.viewValue | |
}).join(""); | |
if (e != m) throw this.err = !0, { | |
code: "INCONSISTENT_INPUT", | |
message: "Successfully parsed but the output text doesn't match the input", | |
text: e, | |
oldText: this.text, | |
properText: m | |
}; | |
if (this.text = e, this.value = s, this.emit("change", this.value), i.length) throw{ | |
code: "NOT_INIT", | |
message: "Some nodes are empty", | |
text: e, | |
node: i[0] | |
}; | |
return this | |
}, t.prototype.setValue = function (e) { | |
var t, n = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], | |
r = p(e, this.nodes, n), o = 0, i = ""; | |
for (t = 0; t < r.length; t++) this.nodes[t].value = r[t].value, this.nodes[t].viewValue = r[t].viewValue, this.nodes[t].offset = o, this.nodes[t].empty = !n && this.nodes[t].empty, o += this.nodes[t].viewValue.length, i += this.nodes[t].viewValue; | |
return this.value = e, this.text = i, this.emit("change", this.value), this | |
}, t.prototype.isEmpty = function (e) { | |
var t, n; | |
if (e) try { | |
t = u(this.nodes, e) | |
} catch (e) { | |
return !1 | |
} else t = this.nodes; | |
for (n = 0; n < t.length; n++) if ("static" != this.nodes[n].token.type && !t[n].empty) return !1; | |
return !0 | |
}, t.prototype.isInit = function () { | |
var e, t = this.nodes, n = Array.isArray(t), r = 0; | |
for (t = n ? t : t[Symbol.iterator](); ;) { | |
if (n) { | |
if (r >= t.length) break; | |
e = t[r++] | |
} else { | |
if ((r = t.next()).done) break; | |
e = r.value | |
} | |
if ("static" != e.token.type && e.empty) return !1 | |
} | |
return !0 | |
}, t.prototype.unset = function () { | |
var e, t = this.nodes, n = Array.isArray(t), r = 0; | |
for (t = n ? t : t[Symbol.iterator](); ;) { | |
if (n) { | |
if (r >= t.length) break; | |
e = t[r++] | |
} else { | |
if ((r = t.next()).done) break; | |
e = r.value | |
} | |
e.empty = !0 | |
} | |
return this.setValue(this.value, !1), this | |
}, t.prototype.getText = function () { | |
return this.text | |
}, t.prototype.getValue = function () { | |
return this.value | |
}, t.prototype.getNodes = function (e) { | |
return e ? this.nameMap.get(e) : this.nodes | |
}, t | |
}(n); | |
function y(e, t) { | |
if (t.length) { | |
var n = E(t, e).map(function (e) { | |
return e.node | |
}), r = n[0], o = n[1]; | |
return r == o ? r : e - r.offset - r.viewValue.length <= o.offset - e ? r : o | |
} | |
} | |
function E(e, t) { | |
var n, r, o, i = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : t, a = e, | |
c = Array.isArray(a), s = 0; | |
for (a = c ? a : a[Symbol.iterator](); ;) { | |
if (c) { | |
if (s >= a.length) break; | |
n = a[s++] | |
} else { | |
if ((s = a.next()).done) break; | |
n = s.value | |
} | |
n.offset <= t && (r = { | |
node: n, | |
pos: t - n.offset | |
}), n.offset + n.viewValue.length >= i && !o && (o = {node: n, pos: i - n.offset}) | |
} | |
if (!o) { | |
var l = e[e.length - 1]; | |
o = {node: l, pos: l.viewValue.length} | |
} | |
return r || (r = { | |
node: e[0], | |
pos: 0 | |
}), r.pos > r.node.viewValue.length && (r.pos = r.node.viewValue.length), [r, o] | |
} | |
var C = function () { | |
function e(t, n) { | |
i(this, e), this.el = t, this.nodes = n, this.range = { | |
node: y(0, this.nodes), | |
start: 0, | |
end: "end" | |
} | |
} | |
return e.prototype.selectNearestNode = function () { | |
var e = this.el.getSelection(); | |
e && this.select({node: y(e.start, this.nodes), start: 0, end: "end"}) | |
}, e.prototype.select = function (e) { | |
(e = Object.assign(this.range, e)).node && this.el.setSelection(e.node.offset + e.start, e.node.offset + ("end" == e.end ? e.node.viewValue.length : e.end)) | |
}, e.prototype.hasNext = function () { | |
if (this.range.node) return this.range.node.nextEdit | |
}, e.prototype.hasPrev = function () { | |
if (this.range.node) return this.range.node.prevEdit | |
}, e.prototype.selectNext = function () { | |
var e = this.hasNext(), t = {start: 0, end: "end"}; | |
e && (t.node = e), this.select(t) | |
}, e.prototype.selectPrev = function () { | |
var e = this.hasPrev(), t = {start: 0, end: "end"}; | |
e && (t.node = e), this.select(t) | |
}, e.prototype.get = function () { | |
if (this.nodes.length) { | |
var e = this.el.getSelection(); | |
if (e) { | |
var t = E(this.nodes, e.start, e.end), n = t[0], r = t[1]; | |
n.node == r.node && (this.range = {node: n.node, start: n.pos, end: r.pos}) | |
} | |
} | |
}, e.prototype.atNodeEnd = function () { | |
if (this.range.node) { | |
this.get(); | |
var e = this.range.node.viewValue.length, t = this.range.node.token.maxLength, | |
n = "end" == this.range.start ? e : this.range.start; | |
return n == ("end" == this.range.end ? e : this.range.end) && n == (null != t ? t : e) || !e | |
} | |
}, e.prototype.atNodeStart = function () { | |
if (this.range.node) { | |
this.get(); | |
var e = this.range.node.viewValue.length, | |
t = "end" == this.range.start ? e : this.range.start; | |
return t == ("end" == this.range.end ? e : this.range.end) && 0 == t | |
} | |
}, e | |
}(), T = function (e) { | |
function t() { | |
i(this, t); | |
var n = c(this, e.call(this)); | |
return n._constructor.apply(n, arguments), n.initialize(), n | |
} | |
return a(t, e), t.prototype._constructor = function (e, t) { | |
var n = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : ""; | |
this.el = e, this.tp = t, this.separators = n, this.sel = new C(e, t.getNodes().filter(function (e) { | |
return "static" != e.token.type | |
})) | |
}, t.prototype.initialize = function () { | |
var e = this; | |
this.el.on("mousedown", function () { | |
e.mousedown = !0 | |
}), this.el.on("focus", function () { | |
e.mousedown || setTimeout(function () { | |
e.sel.select({start: 0, end: "end"}) | |
}) | |
}), this.el.on("click", function () { | |
e.mousedown = !1, e.sel.selectNearestNode() | |
}), this.el.on("input", function () { | |
e.digest(null, e.el.val()) | |
}), this.el.on("keydown", function (t) { | |
t.altKey || t.ctrlKey || (37 == t.keyCode || 9 == t.keyCode && t.shiftKey && e.sel.hasPrev() ? (t.preventDefault(), e.tryFixingError(), e.sel.selectPrev()) : 39 == t.keyCode || 9 == t.keyCode && !t.shiftKey && e.sel.hasNext() ? (t.preventDefault(), e.tryFixingError(), e.sel.selectNext()) : 38 == t.keyCode ? (t.preventDefault(), e.sel.selectNearestNode(), e.sel.range.node && e.sel.range.node.add(1), e.val(e.tp.getText()), e.sel.select({ | |
start: 0, | |
end: "end" | |
})) : 40 == t.keyCode ? (t.preventDefault(), e.sel.selectNearestNode(), e.sel.range.node && e.sel.range.node.add(-1), e.val(e.tp.getText()), e.sel.select({ | |
start: 0, | |
end: "end" | |
})) : 36 == t.keyCode || 35 == t.keyCode ? setTimeout(function () { | |
return e.sel.selectNearestNode() | |
}) : 46 == t.keyCode ? e.sel.atNodeEnd() && (t.preventDefault(), e.tryFixingError(), e.sel.selectNext()) : 8 == t.keyCode && e.sel.atNodeStart() && (t.preventDefault(), e.tryFixingError(), e.sel.selectPrev())) | |
}), this.el.on("keypress", function (t) { | |
var n = null == t.charCode ? t.keyCode : t.charCode, r = String.fromCharCode(n), | |
o = e.separators, i = e.sel.range.node; | |
if (i && i.next && "static" == i.next.token.type && (o += i.next.viewValue[0]), o.includes(r)) return t.preventDefault(), e.tryFixingError(), void e.sel.selectNext(); | |
setTimeout(function () { | |
e.sel.atNodeEnd() && e.sel.range.node.viewValue && (e.tryFixingError(), e.sel.selectNext()) | |
}) | |
}), this.el.on("blur", function () { | |
setTimeout(function () { | |
e.tryFixingError() | |
}) | |
}), this.tp.on("change", function () { | |
e.err || e.inDigest || (e.val(e.tp.getText()), e.sel.select()) | |
}); | |
var t = this.el.val(); | |
t ? this.digest(null, t, !0) : this.val(this.tp.getText()) | |
}, t.prototype.errorViewLength = function () { | |
return this.err && null != this.err.viewValue ? this.err.viewValue.length : void 0 | |
}, t.prototype.val = function (e) { | |
this.el.val() != e && this.el.val(e), this.err = null | |
}, t.prototype.tryFixingError = function () { | |
this.err && (this.err.properValue ? this.digest(this.err.node, this.err.properValue, !0) : this.err.node && (this.err.node.unset(), this.digest(null, this.tp.getText()))) | |
}, t.prototype.digest = function (e, t, n) { | |
var r, o = 10; | |
for (this.inDigest = !0; o--;) { | |
this.err = null; | |
try { | |
e ? e.parse(t) : this.tp.parse(t) | |
} catch (o) { | |
if (this.emit("digest", o), this.sel.get(), "NOT_INIT" == o.code) break; | |
if (this.err = o, !n && ("NUMBER_TOOSHORT" == o.code || "NUMBER_TOOSMALL" == o.code || "NUMBER_MISMATCH" == o.code || "SELECT_MISMATCH" == o.code || "LEADING_ZERO" == o.code)) break; | |
if ("SELECT_INCOMPLETE" == o.code) { | |
e = o.node, t = o.selected, r = {end: "end"}; | |
continue | |
} | |
null != o.properValue ? (e = o.node, t = o.properValue) : null != o.properText ? (e = null, t = o.properText) : ("EMPTY" == o.code && this.tp.unset(), o.node && o.node.unset(), e = null, t = this.tp.getText(), r = { | |
start: 0, | |
end: "end" | |
}); | |
continue | |
} | |
break | |
} | |
if (this.err || (this.val(this.tp.getText()), o < 9 && this.sel.select(r)), this.inDigest = !1, o < 0) throw new Error("InputMask.digest crashed! Infinite loop on " + t) | |
}, t | |
}(n), _ = v, S = T; | |
function w(t, n) { | |
var o = t.DATETIME_FORMATS, | |
a = /yyyy|yy|y|M{1,4}|dd?|EEEE?|HH?|hh?|mm?|ss?|([.,])sss|a|Z{1,2}|ww|w|'(([^']+|'')*)'/g, c = { | |
y: {minLength: 1, maxLength: 4, max: 9999, min: 0, name: "year", type: "number"}, | |
yy: {minLength: 2, maxLength: 2, name: "yearShort", type: "number"}, | |
yyyy: {minLength: 4, maxLength: 4, max: 9999, min: 0, name: "year", type: "number"}, | |
MMMM: {name: "month", type: "select", select: o.MONTH}, | |
MMM: {name: "month", type: "select", select: o.SHORTMONTH}, | |
MM: {minLength: 2, maxLength: 2, name: "month", type: "number"}, | |
M: {minLength: 1, maxLength: 2, name: "month", type: "number", min: 1}, | |
dd: {minLength: 2, maxLength: 2, name: "date", type: "number"}, | |
d: {minLength: 1, maxLength: 2, name: "date", type: "number", min: 1}, | |
EEEE: {name: "day", type: "select", select: T(o.DAY)}, | |
EEE: {name: "day", type: "select", select: T(o.SHORTDAY)}, | |
HH: {minLength: 2, maxLength: 2, name: "hour", type: "number"}, | |
H: {minLength: 1, maxLength: 2, name: "hour", type: "number"}, | |
hh: {minLength: 2, maxLength: 2, name: "hour12", type: "number"}, | |
h: {minLength: 1, maxLength: 2, name: "hour12", type: "number"}, | |
mm: {minLength: 2, maxLength: 2, name: "minute", type: "number"}, | |
m: {minLength: 1, maxLength: 2, name: "minute", type: "number"}, | |
ss: {minLength: 2, maxLength: 2, name: "second", type: "number"}, | |
s: {minLength: 1, maxLength: 2, name: "second", type: "number"}, | |
sss: {minLength: 3, maxLength: 3, name: "millisecond", type: "number"}, | |
a: {name: "ampm", type: "select", select: o.AMPMS}, | |
ww: {minLength: 2, maxLength: 2, max: 53, name: "week", type: "number"}, | |
w: {minLength: 1, maxLength: 2, max: 53, name: "week", type: "number"}, | |
Z: {name: "timezone", type: "static"}, | |
ZZ: {name: "timezone", type: "static", colon: !0}, | |
string: {name: "string", type: "static"} | |
}, s = { | |
year: { | |
extract: function (e) { | |
var t = e.getFullYear() % 1e4; | |
return 0 <= t ? t : 0 | |
}, restore: function (e, t) { | |
return e.setFullYear(t) | |
}, add: function (e, t) { | |
return e.setFullYear(e.getFullYear() + t) | |
}, prior: 7 | |
}, yearShort: { | |
extract: function (e) { | |
var t = e.getFullYear() % 100; | |
return 0 <= t ? t : t + 100 | |
}, restore: function (e, t) { | |
return e.setFullYear(t) | |
}, add: function (e, t) { | |
return e.setFullYear(e.getFullYear() + t) | |
}, prior: 7 | |
}, month: { | |
extract: function (e) { | |
return e.getMonth() + 1 | |
}, restore: function (e, t) { | |
e.setMonth(t - 1), e.getMonth() == t && e.setDate(0) | |
}, add: function (e, t) { | |
t = e.getMonth() + t, e.setMonth(t), e.getMonth() == t + 1 && e.setDate(0) | |
}, prior: 5 | |
}, date: { | |
extract: function (e) { | |
return e.getDate() | |
}, restore: function (e, t, n) { | |
var r = e.getMonth(); | |
if (e.setDate(t), e.getMonth() != r && t <= 31) { | |
var o = n.getNodes("month"); | |
o && o.every(function (e) { | |
return e.empty | |
}) && e.setDate(t) | |
} | |
}, add: function (e, t, n) { | |
this.restore(e, e.getDate() + t, n) | |
}, prior: 4 | |
}, day: { | |
extract: function (e) { | |
return e.getDay() || 7 | |
}, restore: function (e, t) { | |
var n = e.getMonth(), r = t - (e.getDay() || 7); | |
e.setDate(e.getDate() + r), e.getMonth() != n && (0 < r ? e.setDate(e.getDate() - 7) : e.setDate(e.getDate() + 7)) | |
}, add: function (e, t) { | |
return e.setDate(e.getDate() + t) | |
}, prior: 4 | |
}, hour: { | |
extract: function (e) { | |
return e.getHours() | |
}, restore: function (e, t) { | |
return e.setHours(t) | |
}, add: function (e, t) { | |
return e.setHours(e.getHours() + t) | |
}, prior: 2 | |
}, hour12: { | |
extract: function (e) { | |
return e.getHours() % 12 || 12 | |
}, restore: function (e, t) { | |
t %= 12, 12 <= e.getHours() && (t += 12), e.setHours(t) | |
}, add: function (e, t) { | |
return e.setHours(e.getHours() + t) | |
}, prior: 2 | |
}, ampm: { | |
extract: function (e) { | |
return e.getHours() < 12 ? 1 : 2 | |
}, restore: function (e, t) { | |
var n = e.getHours(); | |
n < 12 == 1 < t && e.setHours((n + 12) % 24) | |
}, add: function (e, t) { | |
return e.setHours(e.getHours() + 12 * t) | |
}, prior: 3 | |
}, minute: { | |
extract: function (e) { | |
return e.getMinutes() | |
}, restore: function (e, t) { | |
return e.setMinutes(t) | |
}, add: function (e, t) { | |
return e.setMinutes(e.getMinutes() + t) | |
}, prior: 0 | |
}, second: { | |
extract: function (e) { | |
return e.getSeconds() | |
}, restore: function (e, t) { | |
return e.setSeconds(t) | |
}, add: function (e, t) { | |
return e.setSeconds(e.getSeconds() + t) | |
}, prior: 1 | |
}, millisecond: { | |
extract: function (e) { | |
return e.getMilliseconds() | |
}, restore: function (e, t) { | |
return e.setMilliseconds(t) | |
}, add: function (e, t) { | |
return e.setMilliseconds(e.getMilliseconds() + t) | |
}, prior: 1 | |
}, week: { | |
extract: w, restore: function (e, t) { | |
return e.setDate(e.getDate() + 7 * (t - w(e))) | |
}, add: function (e, t) { | |
return e.setDate(e.getDate() + 7 * t) | |
}, prior: 6 | |
} | |
}; | |
for (var l in s) s[l].placeholder = n[l]; | |
var u = Object.values(c), d = Array.isArray(u), p = 0; | |
for (u = d ? u : u[Symbol.iterator](); ;) { | |
var f; | |
if (d) { | |
if (p >= u.length) break; | |
f = u[p++] | |
} else { | |
if ((p = u.next()).done) break; | |
f = p.value | |
} | |
var m = f; | |
s[m.name] && e.extend(m, s[m.name]) | |
} | |
var h, g, v, y, E, | |
C = (g = 0 <= (h = -(new Date).getTimezoneOffset()) ? "+" : "-", v = Math.abs(h), y = Math.floor(v / 60), E = v % 60, g + r(y, 2, 2) + r(E, 2, 2)); | |
function T(e) { | |
var t, n = []; | |
for (t = 1; t < e.length; t++) n.push(e[t]); | |
return n.push(e[0]), n | |
} | |
function S(t) { | |
for (var n, r = [], o = 0; n = a.exec(t);) if (n.index > o && (r.push(e.extend({value: t.substring(o, n.index)}, c.string)), o = n.index), n.index == o) { | |
if (n[1]) r.push(e.extend({value: n[1]}, c.string)), r.push(c.sss); else if (n[2]) r.push(e.extend({value: n[2].replace("''", "'")}, c.string)); else if ("timezone" == c[n[0]].name) { | |
var i = C; | |
c[n[0]].colon && (i = b(i)), r.push(e.extend({value: i}, c[n[0]])) | |
} else r.push(c[n[0]]); | |
o = a.lastIndex | |
} | |
return o < t.length && r.push(e.extend({value: t.substring(o)}, c.string)), r | |
} | |
function w(e) { | |
var t = new Date(e.getFullYear(), 0, 1), n = new Date(t.getTime()); | |
4 < n.getDay() ? n.setDate(n.getDate() + (1 - n.getDay()) + 7) : n.setDate(n.getDate() + (1 - n.getDay())); | |
var r = e.getTime() - n.getTime(); | |
return Math.floor(r / 6048e5) | |
} | |
function b(e) { | |
return ":" == e[3] ? e : e.substr(0, 3) + ":" + e.substr(3, 2) | |
} | |
function A(e) { | |
return ":" != e[3] ? e : e.substr(0, 3) + e.substr(4, 2) | |
} | |
var P = function () { | |
function e(t) { | |
i(this, e), this.tp = t, this.timezone = C, this.timezoneNodes = this.tp.nodes.filter(function (e) { | |
return "timezone" == e.token.name | |
}) | |
} | |
return e.prototype.parse = function (e) { | |
return this.tp.parse(e), this | |
}, e.prototype.getText = function () { | |
return this.tp.getText() | |
}, e.prototype.setDate = function (e, t) { | |
return this.tp.setValue(function (e, t) { | |
var n = (60 * +(t = A(t)).substr(1, 2) + +t.substr(3, 2)) * (t[0] + "1"); | |
return new Date(e.getTime() + 60 * (n - -e.getTimezoneOffset()) * 1e3) | |
}(e, this.timezone), t), this | |
}, e.prototype.getDate = function () { | |
return e = this.tp.getValue(), t = this.timezone, n = (60 * +(t = A(t)).substr(1, 2) + +t.substr(3, 2)) * (t[0] + "1"), new Date(e.getTime() + 60 * (-e.getTimezoneOffset() - n) * 1e3); | |
var e, t, n | |
}, e.prototype.setTimezone = function () { | |
var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : C; | |
if (e != this.timezone) { | |
var t = this.getDate(); | |
this.timezone = e; | |
var n = this.timezoneNodes, r = Array.isArray(n), o = 0; | |
for (n = r ? n : n[Symbol.iterator](); ;) { | |
var i; | |
if (r) { | |
if (o >= n.length) break; | |
i = n[o++] | |
} else { | |
if ((o = n.next()).done) break; | |
i = o.value | |
} | |
var a = i; | |
a.token.colon ? a.token.value = b(e) : a.token.value = A(e) | |
} | |
return this.setDate(t, !1) | |
} | |
}, e.prototype.isEmpty = function () { | |
return this.tp.isEmpty.apply(this.tp, arguments) | |
}, e.prototype.isInit = function () { | |
return this.tp.isInit.apply(this.tp, arguments) | |
}, e.prototype.unset = function () { | |
return this.tp.unset(), this | |
}, e | |
}(); | |
return function (e) { | |
var t, n = S(o[e] || e); | |
t = n.some(function (e) { | |
return "yearShort" == e.name | |
}) ? function (e) { | |
return function (t) { | |
e.apply(this, arguments); | |
var n = t.getFullYear(); | |
n < 0 && t.setFullYear(n + 100) | |
} | |
} : function (e) { | |
return function (t) { | |
e.apply(this, arguments); | |
var n = t.getFullYear(); | |
n < 0 && t.setFullYear(0), 9999 < n && t.setFullYear(9999) | |
} | |
}; | |
var r = n, i = Array.isArray(r), a = 0; | |
for (r = i ? r : r[Symbol.iterator](); ;) { | |
var c; | |
if (i) { | |
if (a >= r.length) break; | |
c = r[a++] | |
} else { | |
if ((a = r.next()).done) break; | |
c = a.value | |
} | |
var s = c; | |
s.add && (s.add = t(s.add)), s.restore && (s.restore = t(s.restore)) | |
} | |
var l = new _({ | |
tokens: n, value: new Date, copyValue: function (e) { | |
return new Date(e.getTime()) | |
} | |
}); | |
return new P(l) | |
} | |
} | |
function b(t, n, r) { | |
var o = function () { | |
function t(e, n) { | |
i(this, t), this.el = e, this.doc = n | |
} | |
return t.prototype.on = function (e, t) { | |
if ("input" != e) return this.el.on(e, t) | |
}, t.prototype.getSelection = function () { | |
var t = this.el[0]; | |
if (this.doc.activeElement == t) { | |
var n = t.selectionStart, r = t.selectionEnd; | |
return e.isDefined(n) && e.isDefined(r) ? {start: n, end: r} : this.getSelectionIE() | |
} | |
}, t.prototype.getSelectionIE = function () { | |
var e = this.el[0], t = this.doc.selection.createRange().getBookmark(), | |
n = e.createTextRange(), r = n.duplicate(); | |
n.moveToBookmark(t), r.setEndPoint("EndToStart", n); | |
var o = r.text.length; | |
return {start: o, end: o + n.text.length} | |
}, t.prototype.setSelection = function (e, t) { | |
var n = this.el[0]; | |
this.doc.activeElement == n && (n.setSelectionRange ? n.setSelectionRange(e, t) : this.setSelectionIE(e, t)) | |
}, t.prototype.setSelectionIE = function (e, t) { | |
var n = this.el[0].createTextRange(); | |
n.moveStart("character", e), n.collapse(), n.moveEnd("character", t - e), n.select() | |
}, t.prototype.val = function () { | |
var e; | |
return (e = this.el).val.apply(e, arguments) | |
}, t | |
}(); | |
return { | |
restrict: "A", require: "?ngModel", link: function (n, i, a, c) { | |
if (!c) return !1; | |
a.ngTrim = "false"; | |
var s, l = t(a.datetime), u = a.datetimeModel && t(a.datetimeModel), d = new o(i, r[0]), | |
p = new S(d, l.tp, a.datetimeSeparator); | |
function f(e) { | |
e && !s ? (s = !0, l.setTimezone("+0000"), u && u.setTimezone("+0000")) : !e && s && (s = !1, l.setTimezone(), u && u.setTimezone()) | |
} | |
function m(e) { | |
l.setTimezone(e), u && u.setTimezone(e) | |
} | |
function h(t) { | |
return !(!c.$isEmpty(t) && !c.$isEmpty(a.min)) || (e.isDate(t) || (t = u.getDate()), t >= new Date(a.min)) | |
} | |
function g(t) { | |
return !(!c.$isEmpty(t) && !c.$isEmpty(a.max)) || (e.isDate(t) || (t = u.getDate()), t <= new Date(a.max)) | |
} | |
function v(e) { | |
return c.$validate ? c.$validate() : (c.$setValidity("min", h(e)), c.$setValidity("max", g(e))), !c.$error.min && !c.$error.max | |
} | |
p.on("digest", function (e) { | |
"NOT_INIT" != e.code && c.$setValidity("datetime", !1) | |
}), l.tp.on("change", function () { | |
n.$evalAsync(function () { | |
p.err ? c.$setValidity("datetime", !1) : (l.isInit() || l.isEmpty() ? c.$setValidity("datetime", !0) : c.$setValidity("datetime", !1), l.getText() != c.$viewValue && c.$setViewValue(l.getText())) | |
}) | |
}), e.isDefined(a.datetimeUtc) && (0 < a.datetimeUtc.length ? n.$watch(a.datetimeUtc, f) : f(!0)), e.isDefined(a.datetimeTimezone) && (/^[+-]\d{2}:?\d{2}$/.test(a.datetimeTimezone) ? m(a.datetimeTimezone) : n.$watch(a.datetimeTimezone, m)), c.$validators && (c.$validators.min = h, c.$validators.max = g), a.$observe("min", function () { | |
v(l.getDate()) | |
}), a.$observe("max", function () { | |
v(l.getDate()) | |
}), c.$render = function () { | |
}, c.$isEmpty = function (e) { | |
return !e || "string" == typeof e && l.isEmpty(e) | |
}, c.$parsers.unshift(function (t) { | |
if (e.isUndefined(t) && (t = l.getText()), !e.isString(t)) return t; | |
if (p.digest(null, t), l.isInit()) { | |
var n = l.getDate(); | |
return c.$validate || v(n) ? u ? u.setDate(n).getText() : new Date(n.getTime()) : void 0 | |
} | |
}), c.$formatters.push(function (t) { | |
return c.$setValidity("datetime", !0), t ? function (t) { | |
return !(!e.isDate(t) || u) || !(!e.isString(t) || !u) | |
}(t) ? (u && (t = u.parse(t).getDate()), c.$validate || v(t), l.setDate(t).getText()) : t : (l.unset(), n.$evalAsync(function () { | |
c.$setViewValue(l.getText()) | |
}), l.getText()) | |
}) | |
}, priority: 100 | |
} | |
} | |
e.module("datetime").factory("datetime", w), w.$inject = ["$locale", "datetimePlaceholder"], e.module("datetime").directive("datetime", b), b.$inject = ["datetime", "$log", "$document"] | |
}(angular), angular.module("tp.ui.timepicker", []).directive("tpTime", tpTime).controller("tpTimeController", tpTimeController).directive("tpTimepicker", tpTimepicker), tpTimeController.$inject = ["$scope"], tpTimepicker.$inject = ["$window", "$document", "$timeout", "lang"], angular.module("ui.event", []).directive("uiEvent", ["$parse", function (e) { | |
return function (t, n, r) { | |
var o = t.$eval(r.uiEvent); | |
angular.forEach(o, function (r, o) { | |
var i = e(r); | |
n.bind(o, function (e) { | |
var n = Array.prototype.slice.call(arguments); | |
n = n.splice(1), i(t, {$event: e, $params: n}), t.$$phase || t.$apply() | |
}) | |
}) | |
} | |
}]), angular.module("ui.format", []).filter("format", function () { | |
return function (e, t) { | |
var n = e; | |
if (angular.isString(n) && void 0 !== t) if (angular.isArray(t) || angular.isObject(t) || (t = [t]), angular.isArray(t)) { | |
var r = t.length; | |
n = n.replace(/\$([0-9]+)/g, function (e, n) { | |
return (n = parseInt(n, 10)) >= 0 && r > n ? t[n] : e | |
}) | |
} else angular.forEach(t, function (e, t) { | |
n = n.split(":" + t).join(e) | |
}); | |
return n | |
} | |
}), angular.module("ui.highlight", []).filter("highlight", function () { | |
return function (e, t, n) { | |
return t || angular.isNumber(t) ? (e = e.toString(), t = t.toString(), n ? e.split(t).join('<span class="ui-match">' + t + "</span>") : e.replace(new RegExp(t, "gi"), '<span class="ui-match">$&</span>')) : e | |
} | |
}), angular.module("ui.include", []).directive("uiInclude", ["$http", "$templateCache", "$anchorScroll", "$compile", function (e, t, n, r) { | |
return { | |
restrict: "ECA", terminal: !0, compile: function (o, i) { | |
var a = i.uiInclude || i.src, c = i.fragment || "", s = i.onload || "", l = i.autoscroll; | |
return function (o, i) { | |
function u() { | |
var u = ++p, m = o.$eval(a), h = o.$eval(c); | |
m ? e.get(m, {cache: t}).success(function (e) { | |
var t; | |
u === p && (d && d.$destroy(), d = o.$new(), t = h ? angular.element("<div/>").html(e).find(h) : angular.element("<div/>").html(e).contents(), i.html(t), r(t)(d), !angular.isDefined(l) || l && !o.$eval(l) || n(), d.$emit("$includeContentLoaded"), o.$eval(s)) | |
}).error(function () { | |
u === p && f() | |
}) : f() | |
} | |
var d, p = 0, f = function () { | |
d && (d.$destroy(), d = null), i.html("") | |
}; | |
o.$watch(c, u), o.$watch(a, u) | |
} | |
} | |
} | |
}]), angular.module("ui.indeterminate", []).directive("uiIndeterminate", [function () { | |
return { | |
compile: function (e, t) { | |
return t.type && "checkbox" === t.type.toLowerCase() ? function (e, t, n) { | |
e.$watch(n.uiIndeterminate, function (e) { | |
t[0].indeterminate = !!e | |
}) | |
} : angular.noop | |
} | |
} | |
}]), angular.module("ui.inflector", []).filter("inflector", function () { | |
function e(e) { | |
return e.replace(/^([a-z])|\s+([a-z])/g, function (e) { | |
return e.toUpperCase() | |
}) | |
} | |
function t(e, t) { | |
return e.replace(/[A-Z]/g, function (e) { | |
return t + e | |
}) | |
} | |
var n = { | |
humanize: function (n) { | |
return e(t(n, " ").split("_").join(" ")) | |
}, underscore: function (e) { | |
return e.substr(0, 1).toLowerCase() + t(e.substr(1), "_").toLowerCase().split(" ").join("_") | |
}, variable: function (t) { | |
return t.substr(0, 1).toLowerCase() + e(t.split("_").join(" ")).substr(1).split(" ").join("") | |
} | |
}; | |
return function (e, t) { | |
return !1 !== t && angular.isString(e) ? n[t = t || "humanize"](e) : e | |
} | |
}), angular.module("ui.jq", []).value("uiJqConfig", {}).directive("uiJq", ["uiJqConfig", "$timeout", function (e, t) { | |
return { | |
restrict: "A", compile: function (n, r) { | |
if (!angular.isFunction(n[r.uiJq])) throw new Error('ui-jq: The "' + r.uiJq + '" function does not exist'); | |
var o = e && e[r.uiJq]; | |
return function (e, n, r) { | |
function i() { | |
t(function () { | |
n[r.uiJq].apply(n, a) | |
}, 0, !1) | |
} | |
var a = []; | |
r.uiOptions ? (a = e.$eval("[" + r.uiOptions + "]"), angular.isObject(o) && angular.isObject(a[0]) && (a[0] = angular.extend({}, o, a[0]))) : o && (a = [o]), r.ngModel && n.is("select,input,textarea") && n.bind("change", function () { | |
n.trigger("input") | |
}), r.uiRefresh && e.$watch(r.uiRefresh, function () { | |
i() | |
}), i() | |
} | |
} | |
} | |
}]), angular.module("ui.keypress", []).factory("keypressHelper", ["$parse", function (e) { | |
var t = { | |
8: "backspace", | |
9: "tab", | |
13: "enter", | |
27: "esc", | |
32: "space", | |
33: "pageup", | |
34: "pagedown", | |
35: "end", | |
36: "home", | |
37: "left", | |
38: "up", | |
39: "right", | |
40: "down", | |
45: "insert", | |
46: "delete" | |
}; | |
return function (n, r, o, i) { | |
var a, c = []; | |
a = r.$eval(i["ui" + function (e) { | |
return e.charAt(0).toUpperCase() + e.slice(1) | |
}(n)]), angular.forEach(a, function (t, n) { | |
var r, o; | |
o = e(t), angular.forEach(n.split(" "), function (e) { | |
r = {expression: o, keys: {}}, angular.forEach(e.split("-"), function (e) { | |
r.keys[e] = !0 | |
}), c.push(r) | |
}) | |
}), o.bind(n, function (e) { | |
var o = !(!e.metaKey || e.ctrlKey), i = !!e.altKey, a = !!e.ctrlKey, s = !!e.shiftKey, | |
l = e.keyCode; | |
"keypress" === n && !s && l >= 97 && 122 >= l && (l -= 32), angular.forEach(c, function (n) { | |
var c = n.keys[t[l]] || n.keys[l.toString()], u = !!n.keys.meta, d = !!n.keys.alt, | |
p = !!n.keys.ctrl, f = !!n.keys.shift; | |
c && u === o && d === i && p === a && f === s && r.$apply(function () { | |
n.expression(r, {$event: e}) | |
}) | |
}) | |
}) | |
} | |
}]), angular.module("ui.keypress").directive("uiKeydown", ["keypressHelper", function (e) { | |
return { | |
link: function (t, n, r) { | |
e("keydown", t, n, r) | |
} | |
} | |
}]), angular.module("ui.keypress").directive("uiKeypress", ["keypressHelper", function (e) { | |
return { | |
link: function (t, n, r) { | |
e("keypress", t, n, r) | |
} | |
} | |
}]), angular.module("ui.keypress").directive("uiKeyup", ["keypressHelper", function (e) { | |
return { | |
link: function (t, n, r) { | |
e("keyup", t, n, r) | |
} | |
} | |
}]), angular.module("ui.mask", []).value("uiMaskConfig", { | |
maskDefinitions: { | |
9: /\d/, | |
A: /[a-zA-Z]/, | |
"*": /[a-zA-Z0-9]/ | |
} | |
}).directive("uiMask", ["uiMaskConfig", function (e) { | |
return { | |
priority: 100, require: "ngModel", restrict: "A", compile: function () { | |
var t = e; | |
return function (e, n, r, o) { | |
function i() { | |
return $ = !1, k && (n.unbind("blur", u), n.unbind("mousedown", d), n.unbind("mouseup", d), n.unbind("input", f), n.unbind("keyup", f), n.unbind("click", f), n.unbind("focus", f), k = !1), angular.isDefined(I) ? n.attr("placeholder", I) : n.removeAttr("placeholder"), angular.isDefined(N) ? n.attr("maxlength", N) : n.removeAttr("maxlength"), n.val(o.$modelValue), o.$viewValue = o.$modelValue, !1 | |
} | |
function a(e) { | |
return !e.length || e.length >= C | |
} | |
function c(e) { | |
var t = "", n = v.slice(); | |
return e = e.toString(), angular.forEach(E, function (t) { | |
e = e.replace(t, "") | |
}), angular.forEach(e.split(""), function (e) { | |
n.length && n[0].test(e) && (t += e, n.shift()) | |
}), t | |
} | |
function s(e) { | |
var t = "", n = g.slice(); | |
return angular.forEach(y.split(""), function (r, o) { | |
e.length && o === n[0] ? (t += e.charAt(0) || "_", e = e.substr(1), n.shift()) : t += r | |
}), t | |
} | |
function l(e) { | |
var t = r.placeholder; | |
return void 0 !== t && t[e] ? t[e] : "_" | |
} | |
function u() { | |
A = 0, P = 0, S && 0 !== T.length || (_ = "", n.val(""), e.$apply(function () { | |
o.$setViewValue("") | |
})) | |
} | |
function d(e) { | |
"mousedown" === e.type ? n.bind("mouseout", p) : n.unbind("mouseout", p) | |
} | |
function p() { | |
P = h(this), n.unbind("mouseout", p) | |
} | |
function f(t) { | |
var r = (t = t || {}).which, i = t.type; | |
if (16 !== r && 91 !== r) { | |
var a, l = n.val(), u = w, d = c(l), p = b, f = !1, v = function (e) { | |
if (void 0 !== e.selectionStart) return e.selectionStart; | |
if (document.selection) { | |
e.focus(); | |
var t = document.selection.createRange(); | |
return t.moveStart("character", -e.value.length), t.text.length | |
} | |
return 0 | |
}(this) || 0, y = A || 0, E = v - y, C = g[0], T = g[d.length] || g.slice().shift(), | |
_ = P || 0, S = h(this) > 0, $ = _ > 0, | |
k = l.length > u.length || _ && l.length > u.length - _, | |
I = l.length < u.length || _ && l.length === u.length - _, | |
N = r >= 37 && 40 >= r && t.shiftKey, | |
D = 8 === r || "keyup" !== i && I && -1 === E, | |
x = 46 === r || "keyup" !== i && I && 0 === E && !$, | |
O = (37 === r || D || "click" === i) && v > C; | |
if (P = h(this), !N && (!S || "click" !== i && "keyup" !== i)) { | |
if ("input" === i && I && !$ && d === p) { | |
for (; D && v > C && !m(v);) v--; | |
for (; x && T > v && -1 === g.indexOf(v);) v++; | |
var M = g.indexOf(v); | |
d = d.substring(0, M) + d.substring(M + 1), f = !0 | |
} | |
for (a = s(d), w = a, b = d, n.val(a), f && e.$apply(function () { | |
o.$setViewValue(d) | |
}), k && C >= v && (v = C + 1), O && v--, v = v > T ? T : C > v ? C : v; !m(v) && v > C && T > v;) v += O ? -1 : 1; | |
(O && T > v || k && !m(y)) && v++, A = v, function (e, t) { | |
if (0 !== e.offsetWidth && 0 !== e.offsetHeight) if (e.setSelectionRange) e.focus(), e.setSelectionRange(t, t); else if (e.createTextRange) { | |
var n = e.createTextRange(); | |
n.collapse(!0), n.moveEnd("character", t), n.moveStart("character", t), n.select() | |
} | |
}(this, v) | |
} | |
} | |
} | |
function m(e) { | |
return g.indexOf(e) > -1 | |
} | |
function h(e) { | |
return void 0 !== e.selectionStart ? e.selectionEnd - e.selectionStart : document.selection ? document.selection.createRange().text.length : 0 | |
} | |
var g, v, y, E, C, T, _, S, w, b, A, P, $ = !1, k = !1, I = r.placeholder, N = r.maxlength, | |
D = {}; | |
r.uiOptions ? (D = e.$eval("[" + r.uiOptions + "]"), angular.isObject(D[0]) && (D = function (e, t) { | |
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] ? angular.extend(t[n], e[n]) : t[n] = angular.copy(e[n])); | |
return t | |
}(t, D[0]))) : D = t, r.$observe("uiMask", function (e) { | |
return angular.isDefined(e) ? (function (e) { | |
var t = 0; | |
if (g = [], v = [], y = "", "string" == typeof e) { | |
C = 0; | |
var n = !1, r = e.split(""); | |
angular.forEach(r, function (e, r) { | |
D.maskDefinitions[e] ? (g.push(t), y += l(r), v.push(D.maskDefinitions[e]), t++, n || C++) : "?" === e ? n = !0 : (y += e, t++) | |
}) | |
} | |
g.push(g.slice().pop() + 1), E = y.replace(/[_]+/g, "_").replace(/([^_]+)([a-zA-Z0-9])([^_])/g, "$1$2_$3").split("_"), $ = g.length > 1 | |
}(e), $ ? (function () { | |
T = b = c(o.$modelValue || ""), _ = w = s(T); | |
var e = (S = a(T)) && T.length ? _ : ""; | |
r.maxlength && n.attr("maxlength", 2 * g[g.length - 1]), n.attr("placeholder", y), n.val(e), o.$viewValue = e | |
}(), k || (n.bind("blur", u), n.bind("mousedown mouseup", d), n.bind("input keyup click focus", f), k = !0), !0) : i()) : i() | |
}), r.$observe("placeholder", function (e) { | |
angular.isDefined(e) && (y = e, $ && f()) | |
}), o.$formatters.push(function (e) { | |
return $ ? (T = c(e || ""), S = a(T), o.$setValidity("mask", S), S && T.length ? s(T) : void 0) : e | |
}), o.$parsers.push(function (e) { | |
return $ ? (T = c(e || ""), S = a(T), o.$viewValue = T.length ? s(T) : "", o.$setValidity("mask", S), "" === T && void 0 !== o.$error.required && o.$setValidity("required", !1), S ? T : void 0) : e | |
}), n.bind("mousedown mouseup", d), Array.prototype.indexOf || (Array.prototype.indexOf = function (e) { | |
"use strict"; | |
if (null === this) throw new TypeError; | |
var t = Object(this), n = t.length >>> 0; | |
if (0 === n) return -1; | |
var r = 0; | |
if (arguments.length > 1 && ((r = Number(arguments[1])) != r ? r = 0 : 0 !== r && 1 / 0 !== r && r !== -1 / 0 && (r = (r > 0 || -1) * Math.floor(Math.abs(r)))), r >= n) return -1; | |
for (var o = r >= 0 ? r : Math.max(n - Math.abs(r), 0); n > o; o++) if (o in t && t[o] === e) return o; | |
return -1 | |
}) | |
} | |
} | |
} | |
}]), angular.module("ui.reset", []).value("uiResetConfig", null).directive("uiReset", ["uiResetConfig", function (e) { | |
var t = null; | |
return void 0 !== e && (t = e), { | |
require: "ngModel", link: function (e, n, r, o) { | |
var i; | |
i = angular.element('<a class="ui-reset" />'), n.wrap('<span class="ui-resetwrap" />').after(i), i.bind("click", function (n) { | |
n.preventDefault(), e.$apply(function () { | |
r.uiReset ? o.$setViewValue(e.$eval(r.uiReset)) : o.$setViewValue(t), o.$render() | |
}) | |
}) | |
} | |
} | |
}]), angular.module("ui.route", []).directive("uiRoute", ["$location", "$parse", function (e, t) { | |
return { | |
restrict: "AC", scope: !0, compile: function (n, r) { | |
var o; | |
if (r.uiRoute) o = "uiRoute"; else if (r.ngHref) o = "ngHref"; else { | |
if (!r.href) throw new Error("uiRoute missing a route or href property on " + n[0]); | |
o = "href" | |
} | |
return function (n, r, i) { | |
function a(t) { | |
var r = t.indexOf("#"); | |
r > -1 && (t = t.substr(r + 1)), (l = function () { | |
s(n, e.path().indexOf(t) > -1) | |
})() | |
} | |
function c(t) { | |
var r = t.indexOf("#"); | |
r > -1 && (t = t.substr(r + 1)), (l = function () { | |
var r = new RegExp("^" + t + "$", ["i"]); | |
s(n, r.test(e.path())) | |
})() | |
} | |
var s = t(i.ngModel || i.routeModel || "$uiRoute").assign, l = angular.noop; | |
switch (o) { | |
case"uiRoute": | |
i.uiRoute ? c(i.uiRoute) : i.$observe("uiRoute", c); | |
break; | |
case"ngHref": | |
i.ngHref ? a(i.ngHref) : i.$observe("ngHref", a); | |
break; | |
case"href": | |
a(i.href) | |
} | |
n.$on("$routeChangeSuccess", function () { | |
l() | |
}), n.$on("$stateChangeSuccess", function () { | |
l() | |
}) | |
} | |
} | |
} | |
}]), angular.module("ui.scrollfix", []).directive("uiScrollfix", ["$window", function (e) { | |
"use strict"; | |
return { | |
require: "^?uiScrollfixTarget", link: function (t, n, r, o) { | |
function i() { | |
var t; | |
angular.isDefined(e.pageYOffset) ? t = e.pageYOffset : t = (document.compatMode && "BackCompat" !== document.compatMode ? document.documentElement : document.body).scrollTop; | |
!n.hasClass("ui-scrollfix") && t > r.uiScrollfix ? n.addClass("ui-scrollfix") : n.hasClass("ui-scrollfix") && t < r.uiScrollfix && n.removeClass("ui-scrollfix") | |
} | |
var a = n[0].offsetTop, c = o && o.$element || angular.element(e); | |
r.uiScrollfix ? "string" == typeof r.uiScrollfix && ("-" === r.uiScrollfix.charAt(0) ? r.uiScrollfix = a - parseFloat(r.uiScrollfix.substr(1)) : "+" === r.uiScrollfix.charAt(0) && (r.uiScrollfix = a + parseFloat(r.uiScrollfix.substr(1)))) : r.uiScrollfix = a, c.on("scroll", i), t.$on("$destroy", function () { | |
c.off("scroll", i) | |
}) | |
} | |
} | |
}]).directive("uiScrollfixTarget", [function () { | |
"use strict"; | |
return { | |
controller: ["a", function (e) { | |
this.$element = e | |
}] | |
} | |
}]), angular.module("ui.showhide", []).directive("uiShow", [function () { | |
return function (e, t, n) { | |
e.$watch(n.uiShow, function (e) { | |
e ? t.addClass("ui-show") : t.removeClass("ui-show") | |
}) | |
} | |
}]).directive("uiHide", [function () { | |
return function (e, t, n) { | |
e.$watch(n.uiHide, function (e) { | |
e ? t.addClass("ui-hide") : t.removeClass("ui-hide") | |
}) | |
} | |
}]).directive("uiToggle", [function () { | |
return function (e, t, n) { | |
e.$watch(n.uiToggle, function (e) { | |
e ? t.removeClass("ui-hide").addClass("ui-show") : t.removeClass("ui-show").addClass("ui-hide") | |
}) | |
} | |
}]), angular.module("ui.unique", []).filter("unique", ["$parse", function (e) { | |
return function (t, n) { | |
if (!1 === n) return t; | |
if ((n || angular.isUndefined(n)) && angular.isArray(t)) { | |
var r = [], o = angular.isString(n) ? e(n) : function (e) { | |
return e | |
}, i = function (e) { | |
return angular.isObject(e) ? o(e) : e | |
}; | |
angular.forEach(t, function (e) { | |
for (var t = !1, n = 0; n < r.length; n++) if (angular.equals(i(r[n]), i(e))) { | |
t = !0; | |
break | |
} | |
t || r.push(e) | |
}), t = r | |
} | |
return t | |
} | |
}]), angular.module("ui.validate", []).directive("uiValidate", function () { | |
return { | |
restrict: "A", require: "ngModel", link: function (e, t, n, r) { | |
var o, i = {}, a = e.$eval(n.uiValidate); | |
a && (angular.isString(a) && (a = {validator: a}), angular.forEach(a, function (t, n) { | |
o = function (o) { | |
var i = e.$eval(t, {$value: o}); | |
return angular.isObject(i) && angular.isFunction(i.then) ? (i.then(function () { | |
r.$setValidity(n, !0) | |
}, function () { | |
r.$setValidity(n, !1) | |
}), o) : i ? (r.$setValidity(n, !0), o) : void r.$setValidity(n, !1) | |
}, i[n] = o, r.$formatters.push(o), r.$parsers.push(o) | |
}), n.uiValidateWatch && function (t) { | |
angular.isString(t) ? e.$watch(t, function () { | |
angular.forEach(i, function (e) { | |
e(r.$modelValue) | |
}) | |
}) : angular.isArray(t) ? angular.forEach(t, function (t) { | |
e.$watch(t, function () { | |
angular.forEach(i, function (e) { | |
e(r.$modelValue) | |
}) | |
}) | |
}) : angular.isObject(t) && angular.forEach(t, function (t, n) { | |
angular.isString(t) && e.$watch(t, function () { | |
i[n](r.$modelValue) | |
}), angular.isArray(t) && angular.forEach(t, function (t) { | |
e.$watch(t, function () { | |
i[n](r.$modelValue) | |
}) | |
}) | |
}) | |
}(e.$eval(n.uiValidateWatch))) | |
} | |
} | |
}), angular.module("ui.utils", ["ui.event", "ui.format", "ui.highlight", "ui.include", "ui.indeterminate", "ui.inflector", "ui.jq", "ui.keypress", "ui.mask", "ui.reset", "ui.route", "ui.scrollfix", "ui.showhide", "ui.unique", "ui.validate"]), function (e, t) { | |
var n = (e.ieShivDebug, ["ngInclude", "ngPluralize", "ngView", "ngSwitch", "uiCurrency", "uiCodemirror", "uiDate", "uiEvent", "uiKeypress", "uiKeyup", "uiKeydown", "uiMask", "uiMapInfoWindow", "uiMapMarker", "uiMapPolyline", "uiMapPolygon", "uiMapRectangle", "uiMapCircle", "uiMapGroundOverlay", "uiModal", "uiReset", "uiScrollfix", "uiSelect2", "uiShow", "uiHide", "uiToggle", "uiSortable", "uiTinymce"]); | |
e.myCustomTags = e.myCustomTags || [], n.push.apply(n, e.myCustomTags); | |
for (var r = function (e) { | |
var t = [], n = e.replace(/([A-Z])/g, function (e) { | |
return " " + e.toLowerCase() | |
}).split(" "); | |
if (1 === n.length) { | |
var r = n[0]; | |
t.push(r), t.push("x-" + r), t.push("data-" + r) | |
} else { | |
var o = n[0], i = n.slice(1).join("-"); | |
t.push(o + ":" + i), t.push(o + "-" + i), t.push("x-" + o + "-" + i), t.push("data-" + o + "-" + i) | |
} | |
return t | |
}, o = 0, i = n.length; i > o; o++) for (var a = r(n[o]), c = 0, s = a.length; s > c; c++) { | |
var l = a[c]; | |
t.createElement(l) | |
} | |
}(window, document), "undefined" != typeof module && "undefined" != typeof exports && module.exports === exports && (module.exports = "ui.router"), function (e, t, n) { | |
"use strict"; | |
function r(e, t) { | |
return k(new (k(function () { | |
}, {prototype: e})), t) | |
} | |
function o(e) { | |
return $(arguments, function (t) { | |
t !== e && $(t, function (t, n) { | |
e.hasOwnProperty(n) || (e[n] = t) | |
}) | |
}), e | |
} | |
function i(e, t) { | |
if (Array.prototype.indexOf) return e.indexOf(t, Number(arguments[2]) || 0); | |
var n = e.length >>> 0, r = Number(arguments[2]) || 0; | |
for (0 > (r = 0 > r ? Math.ceil(r) : Math.floor(r)) && (r += n); n > r; r++) if (r in e && e[r] === t) return r; | |
return -1 | |
} | |
function a(e, t, n, r) { | |
var o, a = function (e, t) { | |
var n = []; | |
for (var r in e.path) { | |
if (e.path[r] !== t.path[r]) break; | |
n.push(e.path[r]) | |
} | |
return n | |
}(n, r), c = {}, s = []; | |
for (var l in a) if (a[l].params && a[l].params.length) for (var u in o = a[l].params) i(s, o[u]) >= 0 || (s.push(o[u]), c[o[u]] = e[o[u]]); | |
return k({}, c, t) | |
} | |
function c(e, t) { | |
var n = {}; | |
return $(e, function (e) { | |
var r = t[e]; | |
n[e] = null != r ? String(r) : null | |
}), n | |
} | |
function s(e, t, n) { | |
if (!n) for (var r in n = [], e) n.push(r); | |
for (var o = 0; o < n.length; o++) { | |
var i = n[o]; | |
if (e[i] != t[i]) return !1 | |
} | |
return !0 | |
} | |
function l(e, t) { | |
var r = 1, i = 2, a = {}, c = [], s = a, l = k(e.when(a), {$$promises: a, $$values: a}); | |
this.study = function (a) { | |
function u(e) { | |
return A(e) && e.then && e.$$promises | |
} | |
if (!A(a)) throw new Error("'invocables' must be an object"); | |
var d = [], p = [], f = {}; | |
return $(a, function e(n, o) { | |
if (f[o] !== i) { | |
if (p.push(o), f[o] === r) throw p.splice(0, p.indexOf(o)), new Error("Cyclic dependency: " + p.join(" -> ")); | |
if (f[o] = r, b(n)) d.push(o, [function () { | |
return t.get(n) | |
}], c); else { | |
var s = t.annotate(n); | |
$(s, function (t) { | |
t !== o && a.hasOwnProperty(t) && e(a[t], t) | |
}), d.push(o, n, s) | |
} | |
p.pop(), f[o] = i | |
} | |
}), a = p = f = null, function (r, i, a) { | |
function c() { | |
--y || (E || o(v, i.$$values), h.$$values = v, h.$$promises = !0, m.resolve(v)) | |
} | |
function p(e) { | |
h.$$failure = e, m.reject(e) | |
} | |
function f(n, o, i) { | |
function s(e) { | |
u.reject(e), p(e) | |
} | |
function l() { | |
if (!S(h.$$failure)) try { | |
u.resolve(t.invoke(o, a, v)), u.promise.then(function (e) { | |
v[n] = e, c() | |
}, s) | |
} catch (e) { | |
s(e) | |
} | |
} | |
var u = e.defer(), d = 0; | |
$(i, function (e) { | |
g.hasOwnProperty(e) && !r.hasOwnProperty(e) && (d++, g[e].then(function (t) { | |
v[e] = t, --d || l() | |
}, s)) | |
}), d || l(), g[n] = u.promise | |
} | |
if (u(r) && a === n && (a = i, i = r, r = null), r) { | |
if (!A(r)) throw new Error("'locals' must be an object") | |
} else r = s; | |
if (i) { | |
if (!u(i)) throw new Error("'parent' must be a promise returned by $resolve.resolve()") | |
} else i = l; | |
var m = e.defer(), h = m.promise, g = h.$$promises = {}, v = k({}, r), y = 1 + d.length / 3, | |
E = !1; | |
if (S(i.$$failure)) return p(i.$$failure), h; | |
i.$$values ? (E = o(v, i.$$values), c()) : (k(g, i.$$promises), i.then(c, p)); | |
for (var C = 0, T = d.length; T > C; C += 3) r.hasOwnProperty(d[C]) ? c() : f(d[C], d[C + 1], d[C + 2]); | |
return h | |
} | |
}, this.resolve = function (e, t, n, r) { | |
return this.study(e)(t, n, r) | |
} | |
} | |
function u(e, t, n) { | |
this.fromConfig = function (e, t, n) { | |
return S(e.template) ? this.fromString(e.template, t) : S(e.templateUrl) ? this.fromUrl(e.templateUrl, t) : S(e.templateProvider) ? this.fromProvider(e.templateProvider, t, n) : null | |
}, this.fromString = function (e, t) { | |
return w(e) ? e(t) : e | |
}, this.fromUrl = function (n, r) { | |
return w(n) && (n = n(r)), null == n ? null : e.get(n, {cache: t}).then(function (e) { | |
return e.data | |
}) | |
}, this.fromProvider = function (e, t, r) { | |
return n.invoke(e, null, r || {params: t}) | |
} | |
} | |
function d(e) { | |
function t(t) { | |
if (!/^\w+(-+\w+)*$/.test(t)) throw new Error("Invalid parameter name '" + t + "' in pattern '" + e + "'"); | |
if (s[t]) throw new Error("Duplicate parameter name '" + t + "' in pattern '" + e + "'"); | |
s[t] = !0, p.push(t) | |
} | |
function n(e) { | |
return e.replace(/[\\\[\]\^$*+?.()|{}]/g, "\\$&") | |
} | |
var r, o, i, a, c = /([:*])(\w+)|\{(\w+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g, s = {}, | |
l = "^", u = 0, d = this.segments = [], p = this.params = []; | |
for (this.source = e; (r = c.exec(e)) && (o = r[2] || r[3], i = r[4] || ("*" == r[1] ? ".*" : "[^/]*"), !((a = e.substring(u, r.index)).indexOf("?") >= 0));) l += n(a) + "(" + i + ")", t(o), d.push(a), u = c.lastIndex; | |
var f = (a = e.substring(u)).indexOf("?"); | |
if (f >= 0) { | |
var m = this.sourceSearch = a.substring(f); | |
a = a.substring(0, f), this.sourcePath = e.substring(0, u + f), $(m.substring(1).split(/[&?]/), t) | |
} else this.sourcePath = e, this.sourceSearch = ""; | |
l += n(a) + "$", d.push(a), this.regexp = new RegExp(l), this.prefix = d[0] | |
} | |
function p(e) { | |
function t(e) { | |
var t = /^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(e.source); | |
return null != t ? t[1].replace(/\\(.)/g, "$1") : "" | |
} | |
function n(e, t, n) { | |
if (!n) return !1; | |
var r = e.invoke(t, t, {$match: n}); | |
return !S(r) || r | |
} | |
var r = [], o = null; | |
this.rule = function (e) { | |
if (!w(e)) throw new Error("'rule' must be a function"); | |
return r.push(e), this | |
}, this.otherwise = function (e) { | |
if (b(e)) { | |
var t = e; | |
e = function () { | |
return t | |
} | |
} else if (!w(e)) throw new Error("'rule' must be a function"); | |
return o = e, this | |
}, this.when = function (r, o) { | |
var i, a = b(o); | |
if (b(r) && (r = e.compile(r)), !a && !w(o) && !P(o)) throw new Error("invalid 'handler' in when()"); | |
var c = { | |
matcher: function (t, r) { | |
return a && (i = e.compile(r), r = ["$match", function (e) { | |
return i.format(e) | |
}]), k(function (e, o) { | |
return n(e, r, t.exec(o.path(), o.search())) | |
}, {prefix: b(t.prefix) ? t.prefix : ""}) | |
}, regex: function (e, r) { | |
if (e.global || e.sticky) throw new Error("when() RegExp must not be global or sticky"); | |
return a && (i = r, r = ["$match", function (e) { | |
return function (e, t) { | |
return e.replace(/\$(\$|\d{1,2})/, function (e, n) { | |
return t["$" === n ? 0 : Number(n)] | |
}) | |
}(i, e) | |
}]), k(function (t, o) { | |
return n(t, r, e.exec(o.path())) | |
}, {prefix: t(e)}) | |
} | |
}, s = {matcher: e.isMatcher(r), regex: r instanceof RegExp}; | |
for (var l in s) if (s[l]) return this.rule(c[l](r, o)); | |
throw new Error("invalid 'what' in when()") | |
}, this.$get = ["$location", "$rootScope", "$injector", function (e, t, n) { | |
function i(t) { | |
function i(t) { | |
var r = t(n, e); | |
return !!r && (b(r) && e.replace().url(r), !0) | |
} | |
if (!t || !t.defaultPrevented) { | |
var a, c = r.length; | |
for (a = 0; c > a; a++) if (i(r[a])) return; | |
o && i(o) | |
} | |
} | |
return t.$on("$locationChangeSuccess", i), { | |
sync: function () { | |
i() | |
} | |
} | |
}] | |
} | |
function f(e, o, i) { | |
function l(e, t) { | |
var r = b(e), o = r ? e : e.name; | |
if (function (e) { | |
return 0 === e.indexOf(".") || 0 === e.indexOf("^") | |
}(o)) { | |
if (!t) throw new Error("No reference point given for path '" + o + "'"); | |
for (var i = o.split("."), a = 0, c = i.length, s = t; c > a; a++) if ("" !== i[a] || 0 !== a) { | |
if ("^" !== i[a]) break; | |
if (!s.parent) throw new Error("Path '" + o + "' not valid for state '" + t.name + "'"); | |
s = s.parent | |
} else s = t; | |
i = i.slice(a).join("."), o = s.name + (s.name && i ? "." : "") + i | |
} | |
var l = m[o]; | |
return !l || !r && (r || l !== e && l.self !== e) ? n : l | |
} | |
function u(t) { | |
var n = (t = r(t, { | |
self: t, resolve: t.resolve || {}, toString: function () { | |
return this.name | |
} | |
})).name; | |
if (!b(n) || n.indexOf("@") >= 0) throw new Error("State must have a valid name"); | |
if (m.hasOwnProperty(n)) throw new Error("State '" + n + "'' is already defined"); | |
var o = -1 !== n.indexOf(".") ? n.substring(0, n.lastIndexOf(".")) : b(t.parent) ? t.parent : ""; | |
if (o && !m[o]) return function (e, t) { | |
h[e] || (h[e] = []), h[e].push(t) | |
}(o, t.self); | |
for (var i in v) w(v[i]) && (t[i] = v[i](t, v.$delegates[i])); | |
if (m[n] = t, !t[g] && t.url && e.when(t.url, ["$match", "$stateParams", function (e, n) { | |
f.$current.navigable == t && s(e, n) || f.transitionTo(t, e, {location: !1}) | |
}]), h[n]) for (var a = 0; a < h[n].length; a++) u(h[n][a]); | |
return t | |
} | |
function d(e, o, u, d, h, v, y, E, C) { | |
function T() { | |
y.url() !== O && (y.url(O), y.replace()) | |
} | |
function _(e, n, r, i, a) { | |
var c = r ? n : function (e, t) { | |
var n = {}; | |
return $(e, function (e) { | |
n[e] = t[e] | |
}), n | |
}(e.params, n), s = {$stateParams: c}; | |
a.resolve = h.resolve(e.resolve, s, a.resolve, e); | |
var l = [a.resolve.then(function (e) { | |
a.globals = e | |
})]; | |
return i && l.push(i), $(e.views, function (n, r) { | |
var o = n.resolve && n.resolve !== e.resolve ? n.resolve : {}; | |
o.$template = [function () { | |
return u.load(r, {view: n, locals: s, params: c, notify: !1}) || "" | |
}], l.push(h.resolve(o, s, a.resolve, e).then(function (i) { | |
if (w(n.controllerProvider) || P(n.controllerProvider)) { | |
var c = t.extend({}, o, s); | |
i.$$controller = d.invoke(n.controllerProvider, null, c) | |
} else i.$$controller = n.controller; | |
i.$$state = e, i.$$controllerAs = n.controllerAs, a[r] = i | |
})) | |
}), o.all(l).then(function () { | |
return a | |
}) | |
} | |
var A = o.reject(new Error("transition superseded")), | |
N = o.reject(new Error("transition prevented")), | |
D = o.reject(new Error("transition aborted")), x = o.reject(new Error("transition failed")), | |
O = y.url(), M = C.baseHref(); | |
return p.locals = {resolve: null, globals: {$stateParams: {}}}, (f = { | |
params: {}, | |
current: p.self, | |
$current: p, | |
transition: null | |
}).reload = function () { | |
f.transitionTo(f.current, v, {reload: !0, inherit: !1, notify: !1}) | |
}, f.go = function (e, t, n) { | |
return this.transitionTo(e, t, k({inherit: !0, relative: f.$current}, n)) | |
}, f.transitionTo = function (t, n, i) { | |
n = n || {}, i = k({ | |
location: !0, | |
inherit: !1, | |
relative: null, | |
notify: !0, | |
reload: !1, | |
$retry: !1 | |
}, i || {}); | |
var u, m = f.$current, h = f.params, E = m.path, C = l(t, i.relative); | |
if (!S(C)) { | |
var w = {to: t, toParams: n, options: i}; | |
if ((u = e.$broadcast("$stateNotFound", w, m.self, h)).defaultPrevented) return T(), D; | |
if (u.retry) { | |
if (i.$retry) return T(), x; | |
var b = f.transition = o.when(u.retry); | |
return b.then(function () { | |
return b !== f.transition ? A : (w.options.$retry = !0, f.transitionTo(w.to, w.toParams, w.options)) | |
}, function () { | |
return D | |
}), T(), b | |
} | |
if (t = w.to, n = w.toParams, i = w.options, C = l(t, i.relative), !S(C)) { | |
if (i.relative) throw new Error("Could not resolve '" + t + "' from state '" + i.relative + "'"); | |
throw new Error("No such state '" + t + "'") | |
} | |
} | |
if (C[g]) throw new Error("Cannot transition to abstract state '" + t + "'"); | |
i.inherit && (n = a(v, n || {}, f.$current, C)); | |
var P, $, M = (t = C).path, R = p.locals, L = []; | |
for ($ = M[P = 0]; $ && $ === E[P] && s(n, h, $.ownParams) && !i.reload; $ = M[++P]) R = L[P] = $.locals; | |
if (function (e, t, n, r) { | |
return e === t && (n === t.locals && !r.reload || !1 === e.self.reloadOnSearch) || void 0 | |
}(t, m, R, i)) return !1 !== t.self.reloadOnSearch && T(), f.transition = null, o.when(f.current); | |
if (n = c(t.params, n || {}), i.notify && (u = e.$broadcast("$stateChangeStart", t.self, n, m.self, h)).defaultPrevented) return T(), N; | |
for (var V = o.when(R), F = P; F < M.length; $ = M[++F]) R = L[F] = r(R), V = _($, n, $ === t, V, R); | |
var U = f.transition = V.then(function () { | |
var r, o, a; | |
if (f.transition !== U) return A; | |
for (r = E.length - 1; r >= P; r--) (a = E[r]).self.onExit && d.invoke(a.self.onExit, a.self, a.locals.globals), a.locals = null; | |
for (r = P; r < M.length; r++) (o = M[r]).locals = L[r], o.self.onEnter && d.invoke(o.self.onEnter, o.self, o.locals.globals); | |
if (f.transition !== U) return A; | |
f.$current = t, f.current = t.self, f.params = n, I(f.params, v), f.transition = null; | |
var c = t.navigable; | |
return i.location && c && (y.url(c.url.format(c.locals.globals.$stateParams)), "replace" === i.location && y.replace()), i.notify && e.$broadcast("$stateChangeSuccess", t.self, n, m.self, h), O = y.url(), f.current | |
}, function (r) { | |
return f.transition !== U ? A : (f.transition = null, e.$broadcast("$stateChangeError", t.self, n, m.self, h, r), T(), o.reject(r)) | |
}); | |
return U | |
}, f.is = function (e, r) { | |
var o = l(e); | |
return S(o) ? f.$current === o && (!S(r) || null === r || t.equals(v, r)) : n | |
}, f.includes = function (e, r) { | |
if (b(e) && function (e) { | |
return e.indexOf("*") > -1 | |
}(e)) { | |
if (!function (e) { | |
var t = e.split("."), n = f.$current.name.split("."); | |
if ("**" === t[0] && (n = n.slice(n.indexOf(t[1]))).unshift("**"), "**" === t[t.length - 1] && (n.splice(n.indexOf(t[t.length - 2]) + 1, Number.MAX_VALUE), n.push("**")), t.length != n.length) return !1; | |
for (var r = 0, o = t.length; o > r; r++) "*" === t[r] && (n[r] = "*"); | |
return n.join("") === t.join("") | |
}(e)) return !1; | |
e = f.$current.name | |
} | |
var o = l(e); | |
if (!S(o)) return n; | |
if (!S(f.$current.includes[o.name])) return !1; | |
var i = !0; | |
return t.forEach(r, function (e, t) { | |
S(v[t]) && v[t] === e || (i = !1) | |
}), i | |
}, f.href = function (e, t, n) { | |
var r = l(e, (n = k({ | |
lossy: !0, | |
inherit: !1, | |
absolute: !1, | |
relative: f.$current | |
}, n || {})).relative); | |
if (!S(r)) return null; | |
t = a(v, t || {}, f.$current, r); | |
var o = r && n.lossy ? r.navigable : r, | |
s = o && o.url ? o.url.format(c(r.params, t || {})) : null; | |
return !i.html5Mode() && s && (s = "#" + i.hashPrefix() + s), "/" !== M && (i.html5Mode() ? s = M.slice(0, -1) + s : n.absolute && (s = M.slice(1) + s)), n.absolute && s && (s = y.protocol() + "://" + y.host() + (80 == y.port() || 443 == y.port() ? "" : ":" + y.port()) + (!i.html5Mode() && s ? "/" : "") + s), s | |
}, f.get = function (e, t) { | |
if (!S(e)) { | |
var n = []; | |
return $(m, function (e) { | |
n.push(e.self) | |
}), n | |
} | |
var r = l(e, t); | |
return r && r.self ? r.self : null | |
}, f | |
} | |
var p, f, m = {}, h = {}, g = "abstract", v = { | |
parent: function (e) { | |
if (S(e.parent) && e.parent) return l(e.parent); | |
var t = /^(.+)\.[^.]+$/.exec(e.name); | |
return t ? l(t[1]) : p | |
}, data: function (e) { | |
return e.parent && e.parent.data && (e.data = e.self.data = k({}, e.parent.data, e.data)), e.data | |
}, url: function (e) { | |
var t = e.url; | |
if (b(t)) return "^" == t.charAt(0) ? o.compile(t.substring(1)) : (e.parent.navigable || p).url.concat(t); | |
if (o.isMatcher(t) || null == t) return t; | |
throw new Error("Invalid url '" + t + "' in state '" + e + "'") | |
}, navigable: function (e) { | |
return e.url ? e : e.parent ? e.parent.navigable : null | |
}, params: function (e) { | |
if (!e.params) return e.url ? e.url.parameters() : e.parent.params; | |
if (!P(e.params)) throw new Error("Invalid params in state '" + e + "'"); | |
if (e.url) throw new Error("Both params and url specicified in state '" + e + "'"); | |
return e.params | |
}, views: function (e) { | |
var t = {}; | |
return $(S(e.views) ? e.views : {"": e}, function (n, r) { | |
r.indexOf("@") < 0 && (r += "@" + e.parent.name), t[r] = n | |
}), t | |
}, ownParams: function (e) { | |
if (!e.parent) return e.params; | |
var t = {}; | |
$(e.params, function (e) { | |
t[e] = !0 | |
}), $(e.parent.params, function (n) { | |
if (!t[n]) throw new Error("Missing required parameter '" + n + "' in state '" + e.name + "'"); | |
t[n] = !1 | |
}); | |
var n = []; | |
return $(t, function (e, t) { | |
e && n.push(t) | |
}), n | |
}, path: function (e) { | |
return e.parent ? e.parent.path.concat(e) : [] | |
}, includes: function (e) { | |
var t = e.parent ? k({}, e.parent.includes) : {}; | |
return t[e.name] = !0, t | |
}, $delegates: {} | |
}; | |
(p = u({ | |
name: "", | |
url: "^", | |
views: null, | |
abstract: !0 | |
})).navigable = null, this.decorator = function (e, t) { | |
return b(e) && !S(t) ? v[e] : w(t) && b(e) ? (v[e] && !v.$delegates[e] && (v.$delegates[e] = v[e]), v[e] = t, this) : this | |
}, this.state = function (e, t) { | |
return A(e) ? t = e : t.name = e, u(t), this | |
}, this.$get = d, d.$inject = ["$rootScope", "$q", "$view", "$injector", "$resolve", "$stateParams", "$location", "$urlRouter", "$browser"] | |
} | |
function m() { | |
function e(e, t) { | |
return { | |
load: function (n, r) { | |
var o; | |
return (r = k({ | |
template: null, | |
controller: null, | |
view: null, | |
locals: null, | |
notify: !0, | |
async: !0, | |
params: {} | |
}, r)).view && (o = t.fromConfig(r.view, r.params, r.locals)), o && r.notify && e.$broadcast("$viewContentLoading", r), o | |
} | |
} | |
} | |
this.$get = e, e.$inject = ["$rootScope", "$templateFactory"] | |
} | |
function h(e, n, r) { | |
function o(e, t) { | |
if (c) return { | |
enter: function (e, t, n) { | |
c.enter(e, null, t, n) | |
}, leave: function (e, t) { | |
c.leave(e, t) | |
} | |
}; | |
if (a) { | |
var n = a && a(t, e); | |
return { | |
enter: function (e, t, r) { | |
n.enter(e, null, t), r() | |
}, leave: function (e, t) { | |
n.leave(e), t() | |
} | |
} | |
} | |
return { | |
enter: function (e, t, n) { | |
t.after(e), n() | |
}, leave: function (e, t) { | |
e.remove(), t() | |
} | |
} | |
} | |
var i = n.has ? function (e) { | |
return n.has(e) ? n.get(e) : null | |
} : function (e) { | |
try { | |
return n.get(e) | |
} catch (e) { | |
return null | |
} | |
}, a = i("$animator"), c = i("$animate"); | |
return { | |
restrict: "ECA", | |
terminal: !0, | |
priority: 400, | |
transclude: "element", | |
compile: function (n, i, a) { | |
return function (n, i, c) { | |
function s() { | |
u && (u.remove(), u = null), p && (p.$destroy(), p = null), d && (g.leave(d, function () { | |
u = null | |
}), u = d, d = null) | |
} | |
function l(o) { | |
var c = n.$new(), l = d && d.data("$uiViewName"), | |
u = l && e.$current && e.$current.locals[l]; | |
if (o || u !== f) { | |
var v = a(c, function (e) { | |
g.enter(e, i, function () { | |
(t.isDefined(h) && !h || n.$eval(h)) && r(e) | |
}), s() | |
}); | |
f = e.$current.locals[v.data("$uiViewName")], d = v, (p = c).$emit("$viewContentLoaded"), p.$eval(m) | |
} | |
} | |
var u, d, p, f, m = c.onload || "", h = c.autoscroll, g = o(c, n); | |
n.$on("$stateChangeSuccess", function () { | |
l(!1) | |
}), n.$on("$viewContentLoading", function () { | |
l(!1) | |
}), l(!0) | |
} | |
} | |
} | |
} | |
function g(e, t, n) { | |
return { | |
restrict: "ECA", priority: -400, compile: function (r) { | |
var o = r.html(); | |
return function (r, i, a) { | |
var c = a.uiView || a.name || "", s = i.inheritedData("$uiView"); | |
c.indexOf("@") < 0 && (c = c + "@" + (s ? s.state.name : "")), i.data("$uiViewName", c); | |
var l = n.$current, u = l && l.locals[c]; | |
if (u) { | |
i.data("$uiView", {name: c, state: u.$$state}), i.html(u.$template ? u.$template : o); | |
var d = e(i.contents()); | |
if (u.$$controller) { | |
u.$scope = r; | |
var p = t(u.$$controller, u); | |
u.$$controllerAs && (r[u.$$controllerAs] = p), i.data("$ngControllerController", p), i.children().data("$ngControllerController", p) | |
} | |
d(r) | |
} | |
} | |
} | |
} | |
} | |
function v(e) { | |
var t = e.parent().inheritedData("$uiView"); | |
return t && t.state && t.state.name ? t.state : void 0 | |
} | |
function y(e, n) { | |
var r = ["location", "inherit", "reload"]; | |
return { | |
restrict: "A", require: "?^uiSrefActive", link: function (o, i, a, c) { | |
var s = function (e) { | |
var t = e.replace(/\n/g, " ").match(/^([^(]+?)\s*(\((.*)\))?$/); | |
if (!t || 4 !== t.length) throw new Error("Invalid state ref '" + e + "'"); | |
return {state: t[1], paramExpr: t[3] || null} | |
}(a.uiSref), l = null, u = v(i) || e.$current, d = "FORM" === i[0].nodeName, | |
p = d ? "action" : "href", f = !0, m = {relative: u}, h = o.$eval(a.uiSrefOpts) || {}; | |
t.forEach(r, function (e) { | |
e in h && (m[e] = h[e]) | |
}); | |
var g = function (t) { | |
if (t && (l = t), f) { | |
var n = e.href(s.state, l, m); | |
return c && c.$$setStateInfo(s.state, l), n ? void (i[0][p] = n) : (f = !1, !1) | |
} | |
}; | |
s.paramExpr && (o.$watch(s.paramExpr, function (e) { | |
e !== l && g(e) | |
}, !0), l = o.$eval(s.paramExpr)), g(), d || i.bind("click", function (t) { | |
(t.which || t.button) > 1 || t.ctrlKey || t.metaKey || t.shiftKey || i.attr("target") || (n(function () { | |
e.go(s.state, l, m) | |
}), t.preventDefault()) | |
}) | |
} | |
} | |
} | |
function E(e, t, n) { | |
return { | |
restrict: "A", controller: ["$scope", "$element", "$attrs", function (r, o, i) { | |
function a() { | |
e.$current.self !== c || l && !s(l, t) ? o.removeClass(u) : o.addClass(u) | |
} | |
var c, l, u; | |
u = n(i.uiSrefActive || "", !1)(r), this.$$setStateInfo = function (t, n) { | |
c = e.get(t, v(o)), l = n, a() | |
}, r.$on("$stateChangeSuccess", a) | |
}] | |
} | |
} | |
function C(e) { | |
return function (t) { | |
return e.is(t) | |
} | |
} | |
function T(e) { | |
return function (t) { | |
return e.includes(t) | |
} | |
} | |
function _(e, t) { | |
function o(e) { | |
this.locals = e.locals.globals, this.params = this.locals.$stateParams | |
} | |
function i() { | |
this.locals = null, this.params = null | |
} | |
function a(e, t, r) { | |
function o(e) { | |
return "" !== e.name ? e : n | |
} | |
var i = {routes: c, params: r, current: n}; | |
return t.$on("$stateChangeStart", function (e, n, r, i) { | |
t.$broadcast("$routeChangeStart", o(n), o(i)) | |
}), t.$on("$stateChangeSuccess", function (e, n, r, a) { | |
i.current = o(n), t.$broadcast("$routeChangeSuccess", o(n), o(a)), I(r, i.params) | |
}), t.$on("$stateChangeError", function (e, n, r, i, a, c) { | |
t.$broadcast("$routeChangeError", o(n), o(i), c) | |
}), i | |
} | |
var c = []; | |
o.$inject = ["$$state"], this.when = function (n, a) { | |
if (null != a.redirectTo) { | |
var s, l = a.redirectTo; | |
if (b(l)) s = l; else { | |
if (!w(l)) throw new Error("Invalid 'redirectTo' in when()"); | |
s = function (e, t) { | |
return l(e, t.path(), t.search()) | |
} | |
} | |
t.when(n, s) | |
} else e.state(r(a, { | |
parent: null, | |
name: "route:" + encodeURIComponent(n), | |
url: n, | |
onEnter: o, | |
onExit: i | |
})); | |
return c.push(a), this | |
}, this.$get = a, a.$inject = ["$state", "$rootScope", "$routeParams"] | |
} | |
var S = t.isDefined, w = t.isFunction, b = t.isString, A = t.isObject, P = t.isArray, $ = t.forEach, | |
k = t.extend, I = t.copy; | |
t.module("ui.router.util", ["ng"]), t.module("ui.router.router", ["ui.router.util"]), t.module("ui.router.state", ["ui.router.router", "ui.router.util"]), t.module("ui.router", ["ui.router.state"]), t.module("ui.router.compat", ["ui.router"]), l.$inject = ["$q", "$injector"], t.module("ui.router.util").service("$resolve", l), u.$inject = ["$http", "$templateCache", "$injector"], t.module("ui.router.util").service("$templateFactory", u), d.prototype.concat = function (e) { | |
return new d(this.sourcePath + e + this.sourceSearch) | |
}, d.prototype.toString = function () { | |
return this.source | |
}, d.prototype.exec = function (e, t) { | |
var n = this.regexp.exec(e); | |
if (!n) return null; | |
var r, o = this.params, i = o.length, a = this.segments.length - 1, c = {}; | |
if (a !== n.length - 1) throw new Error("Unbalanced capture group in route '" + this.source + "'"); | |
for (r = 0; a > r; r++) c[o[r]] = n[r + 1]; | |
for (; i > r; r++) c[o[r]] = t[o[r]]; | |
return c | |
}, d.prototype.parameters = function () { | |
return this.params | |
}, d.prototype.format = function (e) { | |
var t = this.segments, n = this.params; | |
if (!e) return t.join(""); | |
var r, o, i, a = t.length - 1, c = n.length, s = t[0]; | |
for (r = 0; a > r; r++) null != (i = e[n[r]]) && (s += encodeURIComponent(i)), s += t[r + 1]; | |
for (; c > r; r++) null != (i = e[n[r]]) && (s += (o ? "&" : "?") + n[r] + "=" + encodeURIComponent(i), o = !0); | |
return s | |
}, t.module("ui.router.util").provider("$urlMatcherFactory", function () { | |
this.compile = function (e) { | |
return new d(e) | |
}, this.isMatcher = function (e) { | |
return A(e) && w(e.exec) && w(e.format) && w(e.concat) | |
}, this.$get = function () { | |
return this | |
} | |
}), p.$inject = ["$urlMatcherFactoryProvider"], t.module("ui.router.router").provider("$urlRouter", p), f.$inject = ["$urlRouterProvider", "$urlMatcherFactoryProvider", "$locationProvider"], t.module("ui.router.state").value("$stateParams", {}).provider("$state", f), m.$inject = [], t.module("ui.router.state").provider("$view", m), t.module("ui.router.state").provider("$uiViewScroll", function () { | |
var e = !1; | |
this.useAnchorScroll = function () { | |
e = !0 | |
}, this.$get = ["$anchorScroll", "$timeout", function (t, n) { | |
return e ? t : function (e) { | |
n(function () { | |
e[0].scrollIntoView() | |
}, 0, !1) | |
} | |
}] | |
}), h.$inject = ["$state", "$injector", "$uiViewScroll"], g.$inject = ["$compile", "$controller", "$state"], t.module("ui.router.state").directive("uiView", h), t.module("ui.router.state").directive("uiView", g), y.$inject = ["$state", "$timeout"], E.$inject = ["$state", "$stateParams", "$interpolate"], t.module("ui.router.state").directive("uiSref", y).directive("uiSrefActive", E), C.$inject = ["$state"], T.$inject = ["$state"], t.module("ui.router.state").filter("isState", C).filter("includedByState", T), _.$inject = ["$stateProvider", "$urlRouterProvider"], t.module("ui.router.compat").provider("$route", _).directive("ngView", h) | |
}(window, window.angular), function (e) { | |
var t, n; | |
void 0 === e.tinypass && (e.tinypass = {}), tinypass.uploadFile2 = function (e, t) { | |
}, tinypass.setMessageDashboard = function (e, t) { | |
return "error" === e ? tinypass.__setErrorMessageDashboard(t) : tinypass.__setMessage(e, t) | |
}, tinypass.__buildAlertPopupDashboard = function (e, t) { | |
if (t) { | |
var n = $('<div class="notification error"><span class="message">' + t + '</span><button type="button" class="close close-alert-dashboard">×</button></div>'); | |
$(document.body).append(n), n.css("marginLeft", -n.outerWidth() / 2), n.addClass("in"), $(".close-alert-dashboard").unbind("click").click(function () { | |
$(this).parent().remove(), tinypass.__buildAlertPopupDashboard() | |
}) | |
} | |
for (var r = $(".notification"), o = 0, i = 0; i < r.length; i++) $(r[i]), 0 !== i ? $(r[i]).css({top: 90 + o + "px"}) : $(r[i]).css({top: "90px"}), o += $(r[i]).outerHeight() + 10 | |
}, tinypass.__setErrorMessageDashboard = function (e) { | |
if ($(".modal-body").is(":visible")) $(".modal-body .alert").remove(), $(".modal-body").prepend(tinypass.__buildAlertPopup("error", e)); else if ($("#popup").is(":visible")) $("#popup #popup-content .alert").remove(), $("#popup #popup-content").prepend(tinypass.__buildAlertPopup("error", e)); else if ($(".modal .modal-body").length > 0) { | |
for (var t = $(".modal .modal-body"), n = !1, r = 0; r < t.length; r++) { | |
var o = t[r]; | |
$(o).is(":visible") && ($(".alert", o).remove(), $(o).prepend($('<div class="row"></div>').append(tinypass.__buildAlertPopup("error", e))), n = !0) | |
} | |
n || ($(".container .main").length > 0 ? tinypass.__buildAlertPopupDashboard("error", e) : tinypass.__setMessage("error", e)) | |
} else if ($(".container .main").length > 0) tinypass.__buildAlertPopupDashboard("error", e); else if ($("#payscreen #alert").length > 0) { | |
$("#payscreen #alert").html(e) | |
} else tinypass.__setMessage("error", e) | |
}, tinypass.setMessage = function (e, t) { | |
return "error" == e ? tinypass.__setErrorMessage(t) : tinypass.__setMessage(e, t) | |
}, tinypass.hideMessage = function () { | |
$(".alert-top").remove(), $(".tinypass-alert-messase").remove(), $(".notification.error").remove() | |
}, tinypass.__buildAlertPopup = function (e, t) { | |
return $('<div class="alert alert-block alert-' + e + ' tinypass-alert-messase"></div>').append('<button type="button" class="close" data-dismiss="alert">×</button>').append(t) | |
}, tinypass.__setErrorMessage = function (e) { | |
if ($(".modal-body").is(":visible")) $(".modal-body .alert").remove(), $(".modal-body").prepend(tinypass.__buildAlertPopup("error", e)); else if ($("#popup").is(":visible")) $("#popup #popup-content .alert").remove(), $("#popup #popup-content").prepend(tinypass.__buildAlertPopup("error", e)); else if ($(".modal .modal-body").length > 0) { | |
for (var t = $(".modal .modal-body"), n = !1, r = 0; r < t.length; r++) { | |
var o = t[r]; | |
$(o).is(":visible") && ($(".alert", o).remove(), $(o).prepend($('<div class="row"></div>').append(tinypass.__buildAlertPopup("error", e))), n = !0) | |
} | |
n || ($(".container .main").length > 0 ? ($(".container .main .alert").remove(), $(".container .main").prepend($('<div class="row"></div>').append(tinypass.__buildAlertPopup("error", e)))) : tinypass.__setMessage("error", e)) | |
} else if ($(".container .main").length > 0) $(".container .main .alert").remove(), $(".container .main").prepend($('<div class="row"></div>').append(tinypass.__buildAlertPopup("error", e))), setTimeout(function () { | |
$(".container .main .alert").fadeOut(2e3) | |
}, 1e3); else if ($("#payscreen #alert").length > 0) { | |
$("#payscreen #alert").html(e) | |
} else tinypass.__setMessage("error", e) | |
}, tinypass.__setMessage = function (e, t, n) { | |
var r = $('<div class="notification"><i class="icon-check-white status"></i><span class="message">' + t + "</span></div>"); | |
$(document.body).append(r), r.css("marginLeft", -r.outerWidth() / 2), r.addClass("in"), setTimeout(function () { | |
r.removeClass("in") | |
}, 1600), setTimeout(function () { | |
r.remove() | |
}, 3200) | |
}, tinypass.setOpacity = function (e, t) { | |
$(e).css("filter", "alpha(opacity=" + 100 * t + ")").css("-khtml-opacity", t).css("-moz-opacity", t).css("opacity", t) | |
}, tinypass.showWaitPanel = function (e) { | |
if (e || (e = {}), tinypass.hideWaitPanel(), $("body").append($('<div id="waitPanel">' + (e.title ? e.title : "Loading...") + "</div>").css("display", "block")), e.modal) { | |
var t = $('<div id="tinypassModalWindow"/>'); | |
t.css("position", "fixed").css("left", "0").css("top", "0").css("width", "100%").css("height", "100%").css("z-index", "1000"), e.opacity ? tinypass.setOpacity(t.css("background-color", e.background ? e.background : "white"), e.opacity) : t.css("background-color", "transparent"), $("body").append(t) | |
} | |
}, tinypass.hideWaitPanel = function () { | |
$("#waitPanel").remove(), $("#tinypassModalWindow").remove() | |
}, tinypass.__buildPopup = function () { | |
return $('<div id="popup" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true" style="display: none;"><div id="popup-title" class="modal-header"></div><div id="popup-content" class="modal-body"></div><div id="popup-controls" class="modal-footer"></div></div>') | |
}, tinypass.updateMetaRefresh = function (e) { | |
e && (n = e), n && !isNaN(n) && (clearTimeout(t), t = setTimeout("window.location.reload()", n)) | |
}, tinypass.__initNewlyAddedContent = function (e) { | |
tinypass.__initToolTips(e) | |
}, $(document).ready(function () { | |
var e = $("body"); | |
e.append(tinypass.__buildPopup()), e.ajaxStart(function () { | |
tinypass.updateMetaRefresh(), tinypass.showWaitPanel() | |
}), e.ajaxStop(function () { | |
tinypass.hideWaitPanel() | |
}), $("table.row-alternate").each(function () { | |
$(this).find("tr:even").find("td").toggleClass("line-item-alt", !0), $(this).find("tr:odd").find("td").toggleClass("line-item-alt2", !0) | |
}), tinypass.__initNewlyAddedContent(e), function (e) { | |
var t = new Array; | |
e.Watermark = { | |
ShowAll: function () { | |
for (var e = 0; e < t.length; e++) "" == t[e].obj.val() ? (t[e].obj.val(t[e].text), t[e].obj.toggleClass("watermark", !0)) : t[e].obj.toggleClass("watermark", !1) | |
}, HideAll: function () { | |
for (var e = 0; e < t.length; e++) t[e].obj.val() == t[e].text && t[e].obj.val("") | |
} | |
}, e.fn.Watermark = function (n) { | |
return this.each(function () { | |
var r = e(this); | |
function o() { | |
0 == r.val().length && r.toggleClass("watermark", !0).val(n) | |
} | |
t[t.length] = {text: n, obj: r}, r.focus(function () { | |
r.hasClass("watermark") && r.toggleClass("watermark", !1).val("") | |
}), r.blur(o), o() | |
}) | |
} | |
}(jQuery) | |
}), tinypass.__initToolTips = function (e) { | |
$(e).find('*[data-toggle="tooltip"]').each(function () { | |
var e = $(this); | |
e.attr("title") || e.attr("title", e.html()), e.tooltip({html: !0}) | |
}) | |
}, tinypass.hasFlash = function () { | |
try { | |
return ZeroClipboard.detectFlashSupport() | |
} catch (e) { | |
} | |
return !1 | |
}, tinypass.copyToClipboard = function (e, t) { | |
var n, r, o; | |
try { | |
if (!tinypass.hasFlash()) return null; | |
for (var i in r = $(e), (o = {}).moviePath = "/js/ZeroClipboard.swf", t) o[i] = t[i]; | |
return (n = new ZeroClipboard(r, o)).glue(r), n | |
} catch (e) { | |
} | |
}, tinypass.initImageCropper = function (e, t, n, r) { | |
}, tinypass.cropImage = function (e, t, n, r, o, i, a, c, s, l) { | |
}, tinypass.stripSpaces = function (e) { | |
return null == e || null == e ? e : e.replace(/\s+/g, "") | |
}, tinypass.ccLuhnCheck = function (e) { | |
if (!e.match(/^\d+$/)) return !1; | |
for (var t = e.length, n = 1 & t, r = 0, o = 0; o < t; o++) { | |
var i = parseInt(e.charAt(o)); | |
1 & o ^ n || (i *= 2) > 9 && (i -= 9), r += i | |
} | |
return r % 10 == 0 | |
}, tinypass.convertCurrencyAndFormat = function (e, t) { | |
try { | |
if (!e || e.match(/.*[^0-9.].*/)) return "?.??"; | |
if (!t || t.match(/.*[^0-9.].*/)) return "?.??"; | |
var n = parseFloat(e) / parseFloat(t); | |
return 0 == n || isNaN(n) ? "?.??" : n = (Math.ceil(Math.round(1e4 * n) / 100) / 100).toFixed(2).replace(/[.]00$/, "") | |
} catch (e) { | |
return "?.??" | |
} | |
}; | |
try { | |
$(document).ready(function () { | |
$(e).on("resize", function () { | |
$("#left-nav").find("#left-nav-panel").height($(e).height() - 121) | |
}), $(e).trigger("resize") | |
}) | |
} catch (e) { | |
} | |
}(window), function (e) { | |
try { | |
e.setConfig({whitelistUrls: [/\w*\.tinypass\.com/, /localhost/]}), e.start() | |
} catch (e) { | |
console.warn("Can't configure errorHandler: ", e) | |
} | |
}(function (e) { | |
function t() { | |
this.sender = null, this.event = null, this.params = null | |
} | |
var n = 1e4; | |
try { | |
return new function () { | |
var r = {whitelistUrls: []}; | |
function o() { | |
try { | |
var n = e.getErrors().filter(function (e) { | |
return r.whitelistUrls.some(function (t) { | |
return e.stack && e.stack.match(t) | |
}) | |
}); | |
if (0 === n.length) return; | |
!function (e) { | |
try { | |
var n = window.opener || window.parent, r = Object.assign(new t, { | |
sender: getParameterByName("iframeId"), | |
event: "EVENT_TP_ERROR_HANDLER", | |
params: e | |
}); | |
n && n.postMessage(JSON.stringify(r), "*") | |
} catch (e) { | |
console.warn("Can not post message errors to parent: ", e) | |
} | |
}(n) | |
} catch (e) { | |
console.warn("Errors can not be sent: ", e) | |
} | |
} | |
function i() { | |
e.watchUnhandled(), setTimeout(function () { | |
o(), e.reset() | |
}, n) | |
} | |
this.setConfig = function (e) { | |
r = Object.assign(r, e) | |
}, this.start = function () { | |
try { | |
i() | |
} catch (e) { | |
console.warn("Error logger can not be started: ", e) | |
} | |
} | |
} | |
} catch (e) { | |
console.warn("Can't initiate errorHandler: ", e) | |
} | |
}(function () { | |
function e() { | |
this.message = null, this.stack = null, this.userAgent = null | |
} | |
return new function () { | |
var t = []; | |
function n(n) { | |
var r, o = new e, i = n, a = "error" in i && i.error; | |
o.stack = a ? i.error.stack : "n/a", o.message = a ? i.error.message : "n/a", o.userAgent = navigator.userAgent, r = o, -1 === t.map(JSON.stringify).indexOf(JSON.stringify(r)) && t.push(o) | |
} | |
function r(e) { | |
try { | |
n(e) | |
} catch (e) { | |
console.warn("Can not log an error, something went wrong: ", e) | |
} | |
} | |
this.watchUnhandled = function () { | |
window.addEventListener && window.addEventListener("error", r) | |
}, this.reset = function () { | |
window.removeEventListener("error", r) | |
}, this.getErrors = function () { | |
return t.map(function (e) { | |
return Object.assign({}, e) | |
}) | |
} | |
} | |
}())), angular.module("exceptionHandler", []).factory("$exceptionHandler", ["$log", function (e) { | |
return function (t, n) { | |
e.warn(t); | |
var r = window.pnErrorHandler; | |
r && r.manualLog(t) | |
} | |
}]); | |
var generalModule = angular.module("generalModule", ["ngAnimate", "ui.router", "ajaxServices", "ngSanitize", "appConfigModule"]); | |
function getMonths() { | |
return { | |
"01": "1 - Jan", | |
"02": "2 - Feb", | |
"03": "3 - Mar", | |
"04": "4 - Apr", | |
"05": "5 - May", | |
"06": "6 - Jun", | |
"07": "7 - Jul", | |
"08": "8 - Aug", | |
"09": "9 - Sept", | |
10: "10 - Oct", | |
11: "11 - Nov", | |
12: "12 - Dec" | |
} | |
} | |
function getCookie(e) { | |
for (var t = e + "=", n = decodeURIComponent(document.cookie).split(";"), r = 0; r < n.length; r++) { | |
for (var o = n[r]; " " == o.charAt(0);) o = o.substring(1); | |
if (0 == o.indexOf(t)) return o.substring(t.length, o.length) | |
} | |
return "" | |
} | |
function eraseCookie(e) { | |
document.cookie = e + "=; expires=" + (new Date).toUTCString() | |
} | |
function getYears() { | |
for (var e = (new Date).getFullYear(), t = {}, n = e; n < e + 13; ++n) { | |
t[(n + "").substring(2)] = n | |
} | |
return t | |
} | |
function isString(e) { | |
return "string" == typeof e | |
} | |
function isNumber(e) { | |
return e && "" != e && !isNaN(e) | |
} | |
function lowercase(e) { | |
return isString(e) ? e.toLowerCase() : e | |
} | |
function toBoolean(e) { | |
if ("function" == typeof e) e = !0; else if (e && 0 !== e.length) { | |
var t = lowercase("" + e); | |
e = !("f" == t || "0" == t || "false" == t || "no" == t || "n" == t || "[]" == t) | |
} else e = !1; | |
return e | |
} | |
function _randomString(e) { | |
e || (e = 5); | |
for (var t = "", n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", r = 0; r < e; r++) t += n.charAt(Math.floor(Math.random() * n.length)); | |
return t | |
} | |
var util = { | |
debug: getParameterByName("debug"), log: function () { | |
if (util.debug && void 0 !== window.console && void 0 !== window.console.log) { | |
var e = arguments; | |
(function () { | |
var e = ["__webdriver_evaluate", "__selenium_evaluate", "__webdriver_script_function", "__webdriver_script_func", "__webdriver_script_fn", "__fxdriver_evaluate", "__driver_unwrapped", "__webdriver_unwrapped", "__driver_evaluate", "__selenium_unwrapped", "__fxdriver_unwrapped"], | |
t = ["_phantom", "__nightmare", "_selenium", "callPhantom", "callSelenium", "_Selenium_IDE_Recorder"]; | |
for (var n in t) { | |
var r = t[n]; | |
if (window[r]) return !0 | |
} | |
for (var o in e) { | |
var i = e[o]; | |
if (window.document[i]) return !0 | |
} | |
for (var a in window.document) if (a.match(/\$[a-z]dc_/) && window.document[a].cache_) return !0; | |
return !!(window.external && window.external.toString && window.external.toString() && -1 != window.external.toString().indexOf("Sequentum") || window.document.documentElement.getAttribute("selenium") || window.document.documentElement.getAttribute("webdriver") || window.document.documentElement.getAttribute("driver")) | |
})() && (e = function (e) { | |
var t = ""; | |
try { | |
for (var n = 0; n < e.length; n++) try { | |
t += JSON.stringify(e[n]) + ", " | |
} catch (e) { | |
t += "" + e | |
} | |
return e = [t] | |
} catch (t) { | |
return e | |
} | |
}(e)), "object" == typeof window.console.log ? window.console.log.apply.call(console.log, console, e) : console.log.apply(console, e) | |
} | |
} | |
}; | |
function getParameterByName(e) { | |
e = e.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
var t = new RegExp("[\\?&]" + e + "=([^&#]*)").exec(window.location.href); | |
return null == t ? "" : decodeURIComponent(t[1].replace(/\+/g, " ")) | |
} | |
function getIntParam(e, t) { | |
var n = getParameterByName(e); | |
return "" != n && isNaN(n) ? t : new Number(n) | |
} | |
BaseComponentController = { | |
_isValid: function () { | |
return !0 | |
} | |
}; | |
var EVENT_CHECKOUT_PAYMENT_METHODS_CHANGED = "EVENT_CHECKOUT_PAYMENT_METHODS_CHANGED", | |
EVENT_CHECKOUT_TERM_SELECTED = "EVENT_CHECKOUT_TERM_SELECTED", | |
EVENT_CHECKOUT_PRICE_CHANGED = "EVENT_CHECKOUT_PRICE_CHANGED", | |
EVENT_CHECKOUT_REDEEM_DONE = "EVENT_CHECKOUT_REDEEM_DONE", | |
EVENT_APPLE_PAY_CAN_MAKE_PAYMENTS = "EVENT_APPLE_PAY_CAN_MAKE_PAYMENTS", | |
EVENT_BILLING_COUNTRY_SELECTED = "EVENT_BILLING_COUNTRY_SELECTED", | |
EVENT_BILLING_FROM_TAX_REQUEST = "EVENT_BILLING_FROM_TAX_REQUEST", | |
EVENT_USER_ACCESS_CHANGED = "EVENT_USER_ACCESS_CHANGED", EVENT_ERRORS_CHANGED = "EVENT_ERRORS_CHANGED", | |
EVENT_TERMINAL_ERROR = "EVENT_TERMINAL_ERROR", EVENT_CONFIG_RELOAD = "EVENT_CONFIG_RELOAD", | |
EVENT_STATS_TRACKED = "EVENT_STATS_TRACKED", EVENT_TRACKING_ID_CHANGED = "EVENT_TRACKING_ID_CHANGED", | |
EVENT_SETUP_CUSTOM_VARIABLES = "setupCustomVariables"; | |
generalModule.factory("ngEventService", ["$rootScope", function (e) { | |
var t = { | |
fire: function (t, n, r, o, i, a) { | |
if (!t || "" == t) throw new Error("eventName is required"); | |
util.log("[NG EVENT SERVICE] Firing event:", arguments), e.$broadcast(t, n, r, o, i, a) | |
}, subscribe: function (t, n) { | |
if (!t || "" == t) throw new Error("eventName is required"); | |
if (!n) throw new Error("callback is required"); | |
return e.$on(t, n) | |
} | |
}; | |
return t | |
}]), generalModule.factory("stateService", function () { | |
var e = {active: !(TPParam && TPParam.params ? TPParam.params : {}).preload}; | |
return { | |
get: function (t) { | |
return e[t] | |
}, set: function (t, n) { | |
e[t] = n | |
} | |
} | |
}), generalModule.factory("eventLogger", ["$http", "$window", function (e, t) { | |
var n = {log: "https://api.tinypass.com/api/v3/anon/error/log"}; | |
function r(r, o) { | |
try { | |
var i = function () { | |
var e = {aid: null, offerId: null, gaTrackingId: null}, | |
n = location.href.match(/aid=([\w\d]+)&/), r = location.href.match(/offerId=([\w\d]+)&/); | |
return n && (e.aid = n[1]), r && (e.offerId = r[1]), t.ga && t.ga(function (t) { | |
e.gaTrackingId = t.get("trackingId") | |
}), e | |
}(), a = function (e, t, n) { | |
var r, o, i = []; | |
try { | |
r = "string" == typeof t ? {message: t} : JSON.stringify(t) | |
} catch (e) { | |
r = "parse error" | |
} | |
try { | |
o = JSON.stringify(n) | |
} catch (e) { | |
o = "meta error" | |
} | |
return i.push("=====checkout event====="), i.push("eventName: " + e), t && i.push("payload: " + r), i.push("meta: " + o), i.push("=====event body end====="), i.join("\n") | |
}(r, o, i); | |
if (!i) return; | |
if ("lGr3ciYmC7" !== i.aid && "6qv8OniKQO" !== i.aid) return; | |
e({ | |
method: "POST", | |
url: n.log, | |
data: "log_message=" + a, | |
headers: { | |
"Content-Type": "application/x-www-form-urlencoded", | |
"Piano-request-without-spinner": 1 | |
} | |
}) | |
} catch (e) { | |
console.warn("can't log event due to:", e) | |
} | |
} | |
return { | |
logGaEvent: function (e) { | |
r("gaEvent", e) | |
}, logGaFailedEvent: function (e) { | |
r("gaEvent [FAILED]", e) | |
}, logEvent: r | |
} | |
}]), generalModule.factory("performanceMetricsService", ["$window", "stateService", "integrationEventsService", "eventLogger", "eventService", "ngEventService", "appConfigService", function (e, t, n, r, o, i, a) { | |
var c = {}, s = !1, l = [], u = a.performanceMetrics().trackAid, | |
d = {loadtime: 200, rendering: {total: 200, scripting: 200}}, p = "EVENT_TP_PERFORMANCE_DATA", | |
f = "EVENT_LOGGER_READY", m = [{ | |
resourceRegExp: new RegExp("/checkout/offer/show"), | |
label: "showOffer" | |
}, { | |
resourceRegExp: new RegExp("/api/tinypass.min.js$"), | |
label: "tinypassMinJS" | |
}, {resourceRegExp: new RegExp("/xbuilder/experience/execute"), label: "experienceExecute"}], h = {}; | |
function g(e) { | |
var t = function (e) { | |
if (v(e)) return { | |
loadtime: "resource" === e.entryType ? e.responseEnd - e.startTime : e.duration, | |
dnsLookup: e.domainLookupEnd - e.domainLookupStart, | |
tcp: e.connectEnd - e.connectStart, | |
ttfb: e.responseStart - e.startTime, | |
fetchStart: e.fetchStart, | |
initiatorType: e.initiatorType, | |
resource: e.name, | |
responseEnd: e.responseEnd | |
} | |
}(e), n = function (e) { | |
var t = e.name, n = m.find(function (e) { | |
return t.match(e.resourceRegExp) | |
}); | |
return n && n.label | |
}(e); | |
t.loadtime < d.loadtime || (y("fetchStart", t.fetchStart, e.initiatorType, n), y("load", t.loadtime, e.initiatorType, n)) | |
} | |
function v(e) { | |
return "script" === e.initiatorType || "iframe" === e.initiatorType | |
} | |
function y(e, t, n, r) { | |
if (!0 === u) { | |
var o = {metricName: e, metricValue: t, metricType: n, metricLabel: r}; | |
s ? (l.push(o), l.forEach(function (e) { | |
var t; | |
t = e, ga("performanceTracker.send", { | |
hitType: "timing", | |
timingCategory: t.metricType, | |
timingVar: t.metricName, | |
timingValue: Math.round(t.metricValue), | |
timingLabel: t.metricLabel | |
}) | |
}), l = []) : l.push(o) | |
} | |
} | |
return n.listenExternal("ga.performance.tracker.created", function () { | |
s = !0, o.postMessage(f, {}) | |
}), i.subscribe(p, function (e, t) { | |
g(t.entry) | |
}), window.performance && "function" == typeof performance.getEntries && performance.getEntries().forEach(function (e) { | |
!function (e) { | |
(function (e) { | |
return m.some(function (t) { | |
return e.name.match(t.resourceRegExp) | |
}) && v(e) | |
})(e) && g(e) | |
}(e) | |
}), c.onViewRendered = function (e) { | |
var t, n; | |
"offer" !== e || h.offer || (h[e] = Date.now(), t = h[e] - TPPerformance.documentParseStart, n = h[e] - TPPerformance.domContentLoaded, t > d.rendering.total && y("rendering", t, "viewRendering", "offerScreen:totalTime"), n > d.rendering.scripting && y("rendering", n, "viewRendering", "offerScreen:scripting")) | |
}, c | |
}]), generalModule.factory("gaService", ["$window", "stateService", "integrationEventsService", "eventLogger", function (e, t, n, r) { | |
var o = ["showOffer", "termSelected", "promoApplied", "promoInvalid", "loginSuccess", "loginFailed", "registrationFailed", "registrationSuccess", "checkoutSuccess"], | |
i = {}, a = [], c = !1, s = function () { | |
if (!angular.isArray(arguments[0])) return !!e.ga && (e.ga.apply(this, arguments), !0); | |
for (var t = 0; t < arguments.length; ++t) s.apply(this, arguments[t]) | |
}; | |
return i.notReadyEmitEvents = function () { | |
return !t.get("active") || !c | |
}, i.sendGoogleAnalyticsEvent = function (e, t) { | |
if (i.notReadyEmitEvents()) a.push({event: e, callback: t}); else if (e) { | |
e.hitType = "event", e.eventCategory = e.eventAction; | |
var n = " "; | |
e.eventAction = "", angular.forEach(e.params, function (t, r) { | |
t && (e.eventAction += n + r + "_" + t, n = "____", e.eventLabel += " " + r + ":" + t) | |
}); | |
var c = {}, l = !1, u = function () { | |
!l && t && (l = !0, t()) | |
}; | |
t && (c.hitCallback = u), -1 !== o.indexOf(e.eventCategory) && (c.nonInteraction = !0); | |
var d = s("send", e.hitType, e.eventCategory, e.eventAction, e.eventLabel, 0, c); | |
r.logGaEvent(e), setTimeout(u, 1e3), d || u() | |
} | |
}, i.execBatch = function () { | |
if (c) { | |
var e = a; | |
a = [], e.forEach(function (e) { | |
i.sendGoogleAnalyticsEvent(e.event, e.callback) | |
}) | |
} | |
}, n.listenExternal("ga.created", function () { | |
c = !0, i.execBatch() | |
}), i | |
}]), generalModule.factory("statsService", ["ngEventService", "stateService", "gaService", "$q", "$http", function (e, t, n, r, o) { | |
var i = null, a = null, c = [], s = []; | |
function l() { | |
if (i) return r.when(i); | |
var e = r.defer(); | |
return c.push(e), e.promise | |
} | |
return e.subscribe("trackStat", function (r, l) { | |
if (function (e) { | |
if (e && e.preview) { | |
var t = e.preview; | |
return "string" == typeof t ? "true" === t : t | |
} | |
return !1 | |
}(l)) p(l, {}); else if (t.set("active", !0), n.execBatch(), TPParam.TRACK_SHOW) { | |
var u; | |
if (TPParam.config) { | |
var d = Object.assign({}, TPParam.config); | |
delete d.taxCountries, u = d | |
} else u = TPParam.config; | |
o({ | |
method: "POST", | |
url: TPParam.TRACK_SHOW, | |
data: {initStatParams: l, checkoutConfig: u}, | |
headers: {"Piano-request-without-spinner": 1} | |
}).then(function (e) { | |
p(l, e.data.models.stats) | |
}) | |
} | |
function p(t, n) { | |
i = n, a = t, angular.forEach(c, function (e) { | |
e.resolve(i) | |
}), c = [], angular.forEach(s, function (e) { | |
e.resolve(a) | |
}), s = [], e.fire(EVENT_STATS_TRACKED, {params: a, stat: i}) | |
} | |
}), { | |
getStats: l, mergeStats: function (e) { | |
l().then(function () { | |
angular.extend(i, e) | |
}) | |
}, getParams: function () { | |
var e = r.defer(); | |
return a ? e.resolve(a) : s.push(e), e.promise | |
} | |
} | |
}]), generalModule.factory("browserIdService", ["ngEventService", "$q", function (e, t) { | |
var n = t.defer(); | |
return e.subscribe("passBrowserId", function (e, t) { | |
n.resolve(t.browserId) | |
}), { | |
getBrowserId: function () { | |
return n.promise | |
} | |
} | |
}]), generalModule.factory("configService", ["ngEventService", function (e) { | |
var t = {}; | |
return { | |
get: function () { | |
return t | |
}, setProperty: function (e, n) { | |
t[e] = n | |
}, changed: function () { | |
e.fire(EVENT_CONFIG_RELOAD, t) | |
} | |
} | |
}]), generalModule.factory("apiService", ["$http", function (e) { | |
var t = {method: "post", headers: {"Piano-request-without-spinner": 1}}; | |
return { | |
call: function (n, r, o) { | |
var i = angular.copy(t); | |
return i.url = "/api/v3" + n, o && (i.method = o), i.params = r, e(i) | |
} | |
} | |
}]), generalModule.factory("eventService", ["$window", "$rootScope", "$q", "configService", function (e, t, n, r) { | |
var o = {}; | |
return o.last = null, o.resultCallbacks = {}, o.postMessage = function (t, n) { | |
var r = ((TPParam || {}).params || {}).os || "desktop"; | |
try { | |
switch (r) { | |
case"ios": | |
!function (e, t) { | |
window.webkit.messageHandlers[e].postMessage(t) | |
}(t, n); | |
break; | |
case"android": | |
!function (e, t) { | |
var n = JSON.stringify(t); | |
PianoAndroid[e](n) | |
}(t, n); | |
break; | |
default: | |
!function (t, n) { | |
var r = {}; | |
if (o.parentURL = getParameterByName("url"), r.sender = getParameterByName("iframeId"), r.displayMode = getParameterByName("displayMode"), r.recipient = "opener", r.event = t, r.params = n, n && n.resultCallback) { | |
var i = _randomString(16); | |
r.params.resultCallbackId = i, o.resultCallbacks[i] = n.resultCallback, delete n.resultCallback | |
} | |
util.log("[EVENT SERVICE] Post message:" + t, r), $.postMessage(JSON.stringify(r), o.parentURL, "popup" === r.displayMode ? e.opener : e.parent) | |
}(t, n) | |
} | |
} catch (e) { | |
util.log("[EVENT SERVICE] Event wasn't expected: ", t) | |
} | |
}, o.customPostMessage = function (e, t, n, r) { | |
var o = {}; | |
o.sender = getParameterByName("iframeId"), o.event = e, o.params = t, util.log("[EVENT SERVICE] Custom post message:" + e, o), $.postMessage(JSON.stringify(o), n, r) | |
}, o.resizeEvent = function (e) { | |
if (e.iframeId = getParameterByName("iframeId"), null === o.last) o.postMessage("loaded", e), o.last = e; else if (e.height !== o.last.height || e.width !== o.last.width) { | |
var t = r.get().closeButtonType; | |
void 0 !== t && (e.closeButtonType = t), o.postMessage("resize", e), o.last = e | |
} | |
}, o.purgeEvent = function (e) { | |
o.postMessage("purge", e) | |
}, o.closeEvent = function (e) { | |
o.postMessage("close", e) | |
}, o.closeAndRefreshEvent = function (e) { | |
o.postMessage("closeAndRefresh", e) | |
}, o.checkoutStateChange = function (e, t) { | |
o.postMessage("checkoutStateChange", {stateName: e, offerId: TPParam.config.offerId, term: t}) | |
}, o.startCheckoutEvent = function (e) { | |
o.postMessage("startCheckout", e) | |
}, o.startThreeDBankSecure = function () { | |
o.postMessage("startThreeDBankSecure") | |
}, o.loginRequiredEvent = function (e) { | |
var t = n.defer(); | |
return e.resultCallback = function (e) { | |
t.resolve(e) | |
}, o.postMessage("loginRequired", e), t.promise | |
}, o.gigyaPasswordlessLoginEvent = function (e) { | |
e.iframeId = getParameterByName("iframeId"), o.postMessage("gigyaPasswordlessLogin", e) | |
}, o.customEvent = function (e, t) { | |
o.postMessage(e, t) | |
}, o.systemErrorEvent = function (e) { | |
o.postMessage("error", e) | |
}, o.submitPayment = function (e) { | |
o.postMessage("submitPayment", e) | |
}, o.completeEvent = function (e) { | |
o.postMessage("complete", e) | |
}, o.alreadyPurchasedEvent = function (e) { | |
o.postMessage("alreadyPurchased", e) | |
}, o.checkoutPaymentErrorEvent = function (e) { | |
o.postMessage("checkoutPaymentError", {message: e}) | |
}, o.loginEvent = function (e) { | |
o.postMessage("login", e) | |
}, o.registerEvent = function (e) { | |
o.postMessage("register", e) | |
}, o.getParentSize = function () { | |
o.postMessage("parentSize") | |
}, o.isMobileDevice = function () { | |
return TPParam && TPParam.params && ("ios" === TPParam.params.os || "android" === TPParam.params.os) | |
}, $.receiveMessage(function (e) { | |
var n; | |
try { | |
if (util.log("[EVENT SERVICE] Received message:", e), -1 != ["https://core.spreedly.com", "https://jsl.prod.obi.aol.com", "https://pay.datatrans.com"].indexOf(e.origin)) return; | |
(n = JSON.parse(e.data)).sender && 0 === n.sender.indexOf("piano-id-") && (n.event = n.sender + "-" + n.event), t.$broadcast(n.event, n.params), n.params && n.params.resultCallbackId && o.resultCallbacks[n.params.resultCallbackId] && (o.resultCallbacks[n.params.resultCallbackId](n.params), delete o.resultCallbacks[n.params.resultCallbackId]) | |
} catch (t) { | |
return void util.log("[EVENT SERVICE][Could not parse message:", e) | |
} | |
}), o | |
}]), generalModule.factory("modalService", ["$rootScope", "$q", "$http", "$templateCache", "$injector", "$timeout", "$document", "$compile", "$controller", function (e, t, n, r, o, i, a, c, s) { | |
var l = {}, u = {created: !1, visible: !1, domEl: null}, d = {created: !1, scope: null, domEl: null}; | |
return l.openDialog = function (i) { | |
var l, p, f, m = { | |
close: function (e) { | |
!function (e, t, n) { | |
var r = t.speed || 600; | |
u.created && u.visible && ($(u.domEl).animate({opacity: 0}, r, "swing"), $(u.domEl).removeClass("active"), u.visible = !1), d.created && $(d.domEl).animate({ | |
opacity: 0, | |
marginTop: 0 | |
}, r, "swing", function () { | |
$(d.domEl).removeClass("active"), $(d.domEl).removeClass("error"), d.domEl.remove(), d.scope.$destroy(), d.scope = null, d.domEl = null, d.created = !1, n && n() | |
}) | |
}(0, i, e) | |
} | |
}; | |
if (util.log("MODAL OPTIONS", i), !i.template && !i.templateUrl) throw new Error("One of template or templateUrl options is required."); | |
t.all([(f = i, f.template ? t.when(f.template) : n.get(f.templateUrl, {cache: r}).then(function (e) { | |
return e.data | |
}))].concat((l = i.resolve, p = [], angular.forEach(l, function (e, n) { | |
(angular.isFunction(e) || angular.isArray(e)) && p.push(t.when(o.invoke(e))) | |
}), p))).then(function (t) { | |
var n = (i.scope || e).$new(); | |
n.close = m.close; | |
var r = {}, o = 1; | |
i.controller && (r.$scope = n, r.$modalInstance = m, angular.forEach(i.resolve, function (e, n) { | |
r[n] = t[o++] | |
}), s(i.controller, r)), function (t, n, r) { | |
var o = a.find("body").eq(0); | |
if (!u.created) { | |
var i = e.$new(!0), s = c('<div class="modal-overlay"></div> ')(i); | |
o.append(s), u.created = !0, u.domEl = s | |
} | |
if (!u.visible) { | |
var l = $(u.domEl), p = r.speed || 600; | |
l.addClass("active"), l.animate({opacity: .7}, p), u.visible = !0 | |
} | |
var f = angular.element('<div class="modal ' + (r.class || "") + '"></div>'); | |
f.addClass("active"), f.animate({opacity: 1}, p), f.html(n.content); | |
var m = c(f)(n.scope); | |
d.created = !0, d.scope = n.scope, d.domEl = f, o.append(m) | |
}(0, {scope: n, content: t[0]}, i) | |
}) | |
}, l.getModalEl = function () { | |
return d ? d.domEl : null | |
}, l | |
}]), generalModule.factory("errorService", ["$rootScope", "eventService", "ngEventService", function (e, t, n) { | |
var r = {}, o = {GLOBAL: "global", COMPONENT: "component", TERMINAL: "terminal"}; | |
return function (i) { | |
var a = {}, c = null; | |
return a.error = function (e, t) { | |
if (!i) throw Error("The $scope is undefined"); | |
var r = t; | |
r || (r = {}), angular.isString(r) && (r = {message: t}), r.type = e, r.errorInstanceId = i.errorInstanceId, c.errors.push(r), n.fire(EVENT_ERRORS_CHANGED) | |
}, a.global = function (e) { | |
a.error(o.GLOBAL, e) | |
}, a.globals = function (e) { | |
angular.forEach(e, function (e) { | |
a.error(o.GLOBAL, e) | |
}) | |
}, a.component = function (e) { | |
a.error(o.COMPONENT, e) | |
}, a.components = function (e) { | |
angular.forEach(e, function (e) { | |
a.error(o.COMPONENT, e) | |
}) | |
}, a.terminal = function (r) { | |
var a = r; | |
a || (a = {}), angular.isString(a) && (a = {message: r}), a.type = o.TERMINAL, i && (a.errorInstanceId = i.errorInstanceId), n.fire(EVENT_TERMINAL_ERROR, a), e.terminalError = a.message, e.terminalErrorHeading = a.heading, t.systemErrorEvent({message: a.message}) | |
}, a.reset = function () { | |
i && c.errors.length > 0 && (c.errors = [], n.fire(EVENT_ERRORS_CHANGED, i.errorInstanceId)) | |
}, a.errors = function (e) { | |
var t = []; | |
if (i) { | |
var n = function (r) { | |
angular.forEach(r.errors, function (e) { | |
t.push(e) | |
}), e || angular.forEach(r.children, function (e) { | |
n(e) | |
}) | |
}; | |
n(c) | |
} else angular.forEach(r, function (e) { | |
angular.forEach(e.errors, function (e) { | |
t.push(e) | |
}) | |
}); | |
return t | |
}, a.childrenErrors = function () { | |
var e = []; | |
if (i) { | |
var t = function (n) { | |
angular.forEach(n.errors, function (t) { | |
e.push(t) | |
}), angular.forEach(n.children, function (e) { | |
t(e) | |
}) | |
}; | |
angular.forEach(c.children, function (e) { | |
t(e) | |
}) | |
} else e = []; | |
return e | |
}, a.resetDisplayed = function () { | |
var e = a.getId(); | |
angular.forEach(r, function (t) { | |
var n = []; | |
angular.forEach(t.errors, function (t) { | |
t.displayedOn != e && n.push(t) | |
}), t.errors = n | |
}), n.fire(EVENT_ERRORS_CHANGED, i.errorInstanceId) | |
}, a.TYPES = o, a.getId = function () { | |
return i ? i.errorInstanceId : null | |
}, function () { | |
var e, t, n; | |
if (i) { | |
if (!((n = i) && n.$evalAsync && n.$watch)) throw Error("The first parameter should be scope"); | |
i.errorInstanceId ? c = r[i.errorInstanceId] : (i.errorInstanceId = _randomString(16), c = { | |
children: [], | |
errors: [], | |
errorInstanceId: i.errorInstanceId, | |
$id: i.$id | |
}, r[i.errorInstanceId] = c, (e = (t = function (e) { | |
return e ? e.errorInstanceId ? e.errorInstanceId : e.$parent ? t(e.$parent) : void 0 : null | |
})(i.$parent)) && r[e].children.push(c)) | |
} | |
}(), a | |
} | |
}]), generalModule.factory("shakeService", function () { | |
var e = { | |
shake: function (e) { | |
for (var t = Math.random() < .5 ? -2 : 2, n = 0; n < 10; n++) $(e).animate({"margin-left": (t = -t) + "px"}, 10 + 2 * n); | |
$(e).animate({"margin-left": 0}, 5) | |
} | |
}; | |
return e | |
}), generalModule.directive("customScript", function () { | |
return { | |
restrict: "A", scope: {}, link: function (e, t, n) { | |
var r = document.createElement("script"); | |
r.type = "text/javascript", r.innerText = t.text(), r.innerHTML = t.text(), t.empty(), document.getElementsByTagName("body")[0].appendChild(r) | |
} | |
} | |
}), generalModule.directive("boilerplateCloseButton", ["configService", function (e) { | |
return { | |
restrict: "E", | |
transclude: !0, | |
replace: !0, | |
template: "<div ng-if='isShowBoilerplateCloseButton()' class='boilerplate-close-button' ng-click='close()'></div>", | |
link: function (t, n, r) { | |
t.isShowBoilerplateCloseButton = function () { | |
var t = e.get().closeButtonType; | |
return "false" !== getParameterByName("showCloseButton") && "boilerplate" === t | |
} | |
} | |
} | |
}]), generalModule.factory("windowStateService", ["errorService", function (e) { | |
return { | |
checkIframeOrChildWindow: function () { | |
return !0 | |
} | |
} | |
}]), generalModule.factory("exposeTemplateParams", function () { | |
return function (e) { | |
var t = ["aid", "debug", "displayMode", "iframeId", "offerId", "tags", "templateId", "templateVariantId", "url", "width"].concat(["trackingId", "experienceId", "experienceExecutionId", "experienceActionId"]), | |
n = {}; | |
return angular.forEach(t, function (t) { | |
e[t] && (n[t] = e[t]) | |
}), n | |
} | |
}), generalModule.factory("exposeCustomVariables", function () { | |
return function (e) { | |
var t = {}; | |
try { | |
t = JSON.parse(e) | |
} catch (e) { | |
} | |
return t | |
} | |
}), generalModule.factory("exposeCustomCookies", function () { | |
return function (e) { | |
var t = {}; | |
try { | |
t = JSON.parse(e) | |
} catch (e) { | |
} | |
return t | |
} | |
}), generalModule.factory("exposeActiveMeters", function () { | |
return function (e) { | |
var t = []; | |
try { | |
t = JSON.parse(e) | |
} catch (e) { | |
} | |
return t | |
} | |
}), generalModule.service("integrationEventsService", function () { | |
this.dispatchLocal = function (e, t) { | |
IntegrationEvents.dispatchLocal(e, t) | |
}, this.listenExternal = function (e, t) { | |
IntegrationEvents.listenExternal(e, t) | |
}, this.listenLocal = function (e, t) { | |
IntegrationEvents.listenLocal(e, t) | |
} | |
}), generalModule.factory("topLocation", ["$window", "eventService", "$q", function (e, t, n) { | |
var r = function () { | |
var r = n.defer(); | |
return t.postMessage("getLocation", { | |
resultCallback: function (t) { | |
var n = e.document.createElement("a"); | |
n.href = t.result, r.resolve(n) | |
} | |
}), r.promise | |
}; | |
return r.hash = function (e) { | |
t.postMessage("setLocationHash", {hash: e}) | |
}, r | |
}]), generalModule.factory("addQueryParameterToUrl", function () { | |
return function (e, t, n) { | |
var r, o; | |
e.indexOf("#") > 0 ? (o = e.indexOf("#"), r = e.substring(e.indexOf("#"), e.length)) : (r = "", o = e.length); | |
var i = e.substring(0, o).split("?"), a = "?"; | |
if (i.length > 1) { | |
var c = i[1]; | |
c.length && (a += c + "&") | |
} | |
return a += t + "=" + encodeURIComponent(n), i[0] + a + r | |
} | |
}), generalModule.factory("setupTrackingId", ["ngEventService", function (e) { | |
return function (t) { | |
var n = piano._getTrackingId(); | |
piano._setTrackingId(t), n !== t && e.fire(EVENT_TRACKING_ID_CHANGED, t) | |
} | |
}]), generalModule.service("utilsService", function () { | |
this.isIphone = function () { | |
return /iPhone/.test(navigator.userAgent) && !window.MSStream | |
}, this.contains = function (e, t) { | |
return angular.isArray(e) ? e.some(function (e) { | |
return e === t | |
}) : (util.log("method contains() works only with Arrays"), !1) | |
}, this.last = function (e) { | |
if (angular.isArray(e)) return e[e.length - 1]; | |
util.log("method last() works only with Arrays") | |
}, this.forEach = function (e, t) { | |
return angular.isArray(e) ? (e.forEach(function (e, n) { | |
t(e, n) | |
}), e) : angular.isObject(e) ? (Object.keys(e).forEach(function (n) { | |
t(e[n], n) | |
}), e) : e | |
}, this.map = function (e, t) { | |
return angular.isArray(e) ? e.map(function (e, n) { | |
return t(e, n) | |
}) : angular.isObject(e) ? Object.keys(e).map(function (n) { | |
return t(e[n], n) | |
}) : [] | |
}, this.reduce = function (e, t, n) { | |
if (angular.isArray(e)) return e.reduce(t, n) | |
}, this.find = function (e, t) { | |
if (angular.isArray(e)) return e.find(t); | |
util.log("method find() works only with Arrays") | |
}, this.filter = function (e, t) { | |
return angular.isArray(e) ? e.filter(t) : (util.log("method filter() works only with Arrays"), []) | |
}, this.omit = function (e, t) { | |
var n = [], r = {}; | |
return "string" == typeof t && (n = [t]), angular.isArray(t) && (n = [].concat(t)), angular.isArray(e) && e.forEach(function (e, t) { | |
r[t] = e | |
}), angular.isObject(e) && !angular.isArray(e) && (r = angular.extend({}, e)), n.forEach(function (e) { | |
delete r[e] | |
}), r | |
} | |
}), generalModule.factory("getTrackingId", function () { | |
return function () { | |
return piano._getTrackingId() | |
} | |
}), generalModule.factory("trackExternalEvent", function () { | |
return function (e, t, n) { | |
piano._logAutoMicroConversion(e, t, n) | |
} | |
}), generalModule.factory("interceptAjax", ["lang", function (e) { | |
tinypass.waitLockedBy = null, tinypass.withoutWaitPanel = !1; | |
var t = null; | |
return tinypass.showWaitPanel = function (e, t) { | |
try { | |
document.dispatchEvent(new CustomEvent("EVENT_SHOW_WAIT_PANEL", {detail: {id: e, content: t}})) | |
} catch (e) { | |
} | |
}, tinypass.hideWaitPanel = function (e) { | |
(!e && "others" == tinypass.waitLockedBy || e == tinypass.waitLockedBy) && (t && (t.stop(), t.remove()), tinypass.waitLockedBy = null) | |
}, { | |
appendLoaderTo: function (n) { | |
document.addEventListener("EVENT_SHOW_WAIT_PANEL", function (r) { | |
!function (r) { | |
if (tinypass.withoutWaitPanel || tinypass.waitLockedBy) return; | |
tinypass.waitLockedBy = r.detail.id || "others", t && t.remove(); | |
t = r.detail.content ? $('<div id="waitParent">' + r.detail.content + "</div>") : $('<div id="waitParent"><div id="waitPanel">' + e.tr("Loading...") + "</div></div>"); | |
$("." + n).prepend(t), t.animate({opacity: 1}, 600) | |
}(r) | |
}) | |
} | |
} | |
}]), generalModule.filter("encodeURIComponent", ["$window", function (e) { | |
return e.encodeURIComponent | |
}]); | |
var Helper = function () { | |
}; | |
Helper.wrapMethod = function (e, t, n) { | |
n[e] = function (n, r, o) { | |
return t[e](n, r, o) | |
} | |
}; | |
var IntegrationEvents = function () { | |
var e = { | |
"externalApiFieldset.change": "externalApiFieldset.change", | |
"ga.created": "ga.created", | |
"ga.performance.tracker.created": "ga.performance.tracker.created" | |
}, t = "_piano_._local_.", n = "_piano_._external_."; | |
function r(e) { | |
return t + e | |
} | |
function o(e) { | |
return n + e | |
} | |
function i(t) { | |
if (!(t in e)) throw new Error("event " + t + " is not recognized") | |
} | |
function a(e) { | |
var t = angular.isDate(e), n = angular.isArray(e), r = angular.isObject(e); | |
return t ? new Date(e) : n ? angular.copy(e, []) : r && !n ? angular.copy(e, {}) : e | |
} | |
return { | |
dispatchLocal: function (e, t) { | |
i(e), document.dispatchEvent(new CustomEvent(r(e), {detail: a(t)})) | |
}, dispatchExternal: function (e, t) { | |
i(e), document.dispatchEvent(new CustomEvent(o(e), {detail: a(t)})) | |
}, listenLocal: function (e, t) { | |
document.addEventListener(r(e), function (e) { | |
t(e) | |
}) | |
}, listenExternal: function (e, t) { | |
document.addEventListener(o(e), function (e) { | |
t(e) | |
}) | |
} | |
} | |
}(), piano = function (e) { | |
var t = {}, n = { | |
listen: function (t, n) { | |
e.listenLocal(t, n) | |
}, externalEvent: function (t, n) { | |
e.dispatchExternal(t, n) | |
}, _setTrackingId: function (e) { | |
t.trackingId = e | |
}, _getTrackingId: function () { | |
return t.trackingId | |
} | |
}, r = function (e, n) { | |
t.trackingId && parent.postMessage(JSON.stringify({ | |
event: "iframeLogRequest", | |
url: e, | |
queryParams: n | |
}), "*") | |
}; | |
n._logAutoMicroConversion = function (e, n, o) { | |
var i = {tracking_id: t.trackingId, event_type: e, event_group_id: n, custom_params: o || ""}; | |
void 0 !== n ? void 0 !== e ? r("/api/v3/conversion/logAutoMicroConversion", i) : util.log("Parameter eventType is required to log micro conversion.") : util.log("Parameter eventGroupId is required to log micro conversion.") | |
}, n.logFunnelStep = function (e, n, o) { | |
var i = {tracking_id: t.trackingId, step_number: e, step_name: n, custom_params: o || ""}; | |
void 0 !== e ? void 0 !== n ? r("/api/v3/conversion/logFunnelStep", i) : util.log("Parameter stepName is required to log funnel step.") : util.log("Parameter stepNumber is required to log funnel step.") | |
}, n.logMicroConversion = function (e, n) { | |
var o = {tracking_id: t.trackingId, event_group_id: e, custom_params: n || ""}; | |
void 0 !== e ? r("/api/v3/conversion/logMicroConversion", o) : util.log("Parameter eventGroupId is required to log micro conversion.") | |
}; | |
var o = function (e, n, o, i, a, c, s) { | |
var l = {tracking_id: t.trackingId, term_id: e, term_name: n}; | |
void 0 !== e ? void 0 !== n ? (void 0 !== o && (l.step_number = o), void 0 !== i && (l.amount = i), void 0 !== a && (l.currency = a), void 0 !== c && (l.custom_params = c), void 0 !== s && (l.conversion_category = s), r("/api/v3/conversion/log", l)) : util.log("Parameter termName is required to log conversion.") : util.log("Parameter termId is required to log conversion.") | |
}; | |
return n.logConversion = function (e) { | |
"object" == typeof e ? o(e.term_id, e.term_name, e.step_number, e.amount, e.currency, e.custom_params, e.conversion_category) : o.apply(this, arguments) | |
}, n.reloadTemplateWithUserToken = function (e) { | |
}, n | |
}(IntegrationEvents); | |
angular.module("appConfigModule", []).factory("appConfigService", [function () { | |
return { | |
performanceMetrics: function () { | |
return window.TPParam.performanceMetrics | |
} | |
} | |
}]); | |
var tpDrop = function (e, t, n, r, o, i, a, c, s, l) { | |
var u = ".tp-dropdown__container", d = ".search-query"; | |
return function (e) { | |
return r.all({ | |
tpl: (t = e, t.template ? r.when(t.template) : o.get(t.templateUrl, {cache: i}).then(function (e) { | |
return e.data | |
})), opts: r.when(e) | |
}).then(p); | |
var t | |
}; | |
function p(e) { | |
var o, i, p = r.defer(), f = e.tpl, m = e.opts || {style: {width: 200}}, h = function (e) { | |
if (e.centerOn) { | |
var n = e.centerOn.parents().filter(function () { | |
var e = $(this).css("position"); | |
return ("fixed" === e || "absolute" === e) && !1 === $(this).hasClass("modal") | |
}).last(); | |
return n.length > 0 ? n : t.find("body") | |
} | |
return t.find("body") | |
}(m), g = (m.scope || n).$new(), v = t.find("body"); | |
g.$close = function (e) { | |
y.remove(), p.resolve(e), v.removeClass("component-opened") | |
}, g.$dismiss = _, (m.rejecter || function () { | |
var e = r.defer(); | |
return t.on("click", function n(r) { | |
t.off("click", n), r && (r.preventDefault(), r.stopPropagation()), e.reject() | |
}), e.promise | |
}()).then(_, _), m.controller && a(m.controller, {$scope: g}); | |
var y = c(angular.element(f))(g); | |
h.append(y), v.addClass("component-opened"); | |
var E = function () { | |
var e; | |
!function (e, t) { | |
"right" === e.side && e.centerOn.offset().left + e.centerOn.width() + t.width() > window.innerWidth && (e.side = "left"); | |
"left" === e.side && e.centerOn.offset().left - t.width() < 0 && (e.side = "right") | |
}(m, y), i = m.side || "bottom", o = function (e, t) { | |
return t.centerOn ? function (e, t) { | |
var n = function (e, t, n, r, o) { | |
var a = {}; | |
return a[e] = i(o.centerOn, e) + o.centerOn[n]() / 2 - o.style[t] / 2, a | |
}("right" === t.side || "left" === t.side ? "top" : "left", "right" === t.side || "left" === t.side ? "height" : "width", "right" === t.side || "left" === t.side ? "outerHeight" : "outerWidth", 0, t); | |
return n = "right" === t.side ? o("left", "outerWidth", t, n) : "left" === t.side ? r("right", "width", "left", "scrollLeft", e, t, n) : "top" === t.side ? r("bottom", "height", "top", "scrollTop", e, t, n) : o("top", "outerHeight", t, n); | |
function r(e, t, n, r, o, a, c) { | |
return c[e] = o[t]() - i(a.centerOn, n) - o[r](), c | |
} | |
function o(e, t, n, r) { | |
return r[e] = i(n.centerOn, e) + n.centerOn[t](), r | |
} | |
function i(e, t) { | |
return e.offset()[t] | |
} | |
}(e, t) : function (e, t) { | |
return {left: e.width() / 2 - t.style.width / 2, top: e.height() / 2 - t.style.height / 2} | |
}(e, t) | |
}(h, m), y.css({display: "block", position: "absolute"}).on("click", function (e) { | |
e.preventDefault(), e.stopPropagation() | |
}).addClass(i).addClass(m.cl).css(o).css(m.style), (e = angular.element(u)).is(":visible") && e.find(d).focus() | |
}; | |
if (g.type && "enchained" === g.type) { | |
var C = s(E, 50), T = function () { | |
s.cancel(C) | |
}; | |
p.promise.then(T, T) | |
} else l(E, 0); | |
return p.promise; | |
function _(e) { | |
y.remove(), p.reject(e), v.removeClass("component-opened") | |
} | |
} | |
}; | |
tpDrop.$inject = ["$injector", "$document", "$rootScope", "$q", "$http", "$templateCache", "$controller", "$compile", "$interval", "$timeout"], angular.module("tpDrop.module", ["ngSanitize", "generalModule"]).factory("tpDrop", tpDrop); | |
var containerServiceModule = angular.module("containerServiceModule", ["ngAnimate", "ui.router", "ngSanitize", "generalModule"]); | |
containerServiceModule.factory("containerService", ["$window", "$rootScope", "$rootElement", "$timeout", "$document", "eventService", "errorService", "windowStateService", "ngEventService", function (e, t, n, r, o, i, a, c, s) { | |
var l = {}; | |
return l.$rootScope = t, l.rootElement = n, $(document).on("focus", "input, textarea, select", function () { | |
i.postMessage("inputFocus") | |
}).on("blur", "input, textarea, select", function () { | |
i.postMessage("inputBlur") | |
}), l.getConfig = function () { | |
return {container: this._getConfigFn().container} | |
}, l.getPreferredWidth = function () { | |
return this.preferredWidth | |
}, l.setPreferredWidth = function (e) { | |
this.preferredWidth = e | |
}, l.init = function (e, t) { | |
this._getConfigFn = t, this.isModal = "modal" === getParameterByName("displayMode"), this.isPopup = "popup" === getParameterByName("displayMode"), this.isInline = "inline" === getParameterByName("displayMode"), this.isPreview = !!getParameterByName("preview"), this.isOpenedFromInlineCheckout = "true" === getParameterByName("isOpenedFromInlineCheckout"), this.container = this.getConfig().container, this.suggestedWidth = getIntParam("width", 1), this.preferredWidth = e.preferredWidth, l.initResizeHandler(this.container) | |
}, l.initResizeHandler = function (e) { | |
var t = document.createElement("iframe"), n = -1; | |
e.css("position", "relative"), t.width = "100%", t.height = "100%", t.setAttribute("style", "position: absolute !important; z-index: -1 !important;"), e.prepend(t); | |
var r = t.contentWindow || t.contentDocument, o = t.contentDocument || {}; | |
"function" == typeof ResizeObserver ? new ResizeObserver(i).observe(t) : r.onresize = i; | |
function i() { | |
var e = r.document ? r.document.body : r.body, t = o.documentElement || {}, | |
i = Math.max(e.scrollHeight, t.scrollHeight, e.offsetHeight, t.offsetHeight, e.clientHeight, t.clientHeight); | |
n !== i && (n = i, l.resize()) | |
} | |
window.onload = function () { | |
l.resize() | |
}, l.onReady(function () { | |
l.resize() | |
}), s.subscribe("loaded", function () { | |
l.resize() | |
}) | |
}, l.onReady = function (e) { | |
"loading" !== document.readyState ? e() : document.addEventListener ? document.addEventListener("DOMContentLoaded", e) : document.attachEvent("onreadystatechange", function () { | |
"complete" === document.readyState && e() | |
}) | |
}, s.subscribe("RESIZE_MODAL_CHECKOUT", function (e, t) { | |
var n = t.iframe, r = t.width; | |
setTimeout(function () { | |
l.suggestedWidth = r, n.config.width && (l.suggestedWidth = r < n.config.width ? r : n.config.width), l.resize() | |
}, 100) | |
}), l.resize = function () { | |
var e = l.rootElement.height(), | |
t = l.rootElement[0].parentElement ? l.rootElement[0].parentElement : 0, n = e || t; | |
if (l.isModal || l.isPopup || l.isPreview) { | |
var r = l.getNewWidth(); | |
angular.element("body").css("min-width", r), angular.element("body").width(r), l.rootElement.width(r), l.container.width(r), i.resizeEvent({ | |
width: r, | |
height: n | |
}), setTimeout(l.scrollTop, 500) | |
} else i.resizeEvent({height: n}) | |
}, l.scrollTop = function () { | |
window.scrollTo(0, 0) | |
}, l.getNewWidth = function () { | |
var e = 0; | |
return l.isModal || l.isPopup ? (e = l.suggestedWidth, l.preferredWidth <= l.suggestedWidth && (e = l.preferredWidth)) : e = l.suggestedWidth, parseInt(e) | |
}, l.getCenterScreen = function (e, t) { | |
e = e || 0, t = t || 0; | |
var n = parseInt(getParameterByName("parentWidth"), 10), | |
r = parseInt(getParameterByName("parentDualScreenLeft"), 10), | |
o = parseInt(getParameterByName("parentDualScreenTop"), 10); | |
return { | |
left: n / 2 - e / 2 + r, | |
top: parseInt(getParameterByName("parentOuterHeight"), 10) / 2 - t / 2 + o | |
} | |
}, l.getOriginUrl = function () { | |
return getParameterByName("url") | |
}, l.purge = function (e) { | |
try { | |
l.rootElement.remove() | |
} catch (e) { | |
} | |
i.purgeEvent(e) | |
}, l.close = function (e) { | |
console.log("REMOVE???? rly?"); | |
try { | |
l.rootElement.remove() | |
} catch (e) { | |
} | |
i.closeEvent(e) | |
}, l | |
}]); | |
var userServiceModule = angular.module("userServiceModule", ["ngAnimate", "ui.router", "ajaxServices", "ngSanitize", "generalModule", "tp.i18n"]); | |
userServiceModule.factory("userService", ["$rootScope", "$rootElement", "$q", "tpHTTP", "eventService", "ngEventService", "errorService", "gaService", "lang", "utilsService", function (e, t, n, r, o, i, a, c, s, l) { | |
var u = _randomString(16), d = null, p = !1, f = [], m = {}; | |
m.$rootScope = e, m.rootElement = t; | |
var h, g = function () { | |
}; | |
function v(e) { | |
return m.loginSuccessNoPostMessage(e).then(function () { | |
h && h.resolve(e) | |
}) | |
} | |
return m.getConfig = function () { | |
return { | |
app: this._getConfigFn().app, | |
user: this._getConfigFn().user, | |
fillLoginIframeParams: this._getConfigFn().fillLoginIframeParams || g, | |
fillLoginRequiredParamsToGoogleAnalytics: this._getConfigFn().fillLoginRequiredParamsToGoogleAnalytics || g, | |
fillLoginRequiredEventParams: this._getConfigFn().fillLoginRequiredEventParams || g, | |
fillLoginSuccessEventParams: this._getConfigFn().fillLoginSuccessEventParams || g | |
} | |
}, m.init = function (e) { | |
if (this._getConfigFn = e, !TPParam.LOGIN) throw"Login handler URL (variable TPParam.LOGIN) is not set" | |
}, m.isUserValid = function () { | |
return m.getConfig().user && !0 === m.getConfig().user.valid | |
}, m.isUserConfirmed = function () { | |
return m.getConfig().user && !1 !== m.getConfig().user.confirmed | |
}, m.allowLogout = function () { | |
return m.isUserValid() && m.isProviderAllowLogout() | |
}, m.allowLogin = function () { | |
return m.allowTinypassAccountsLogin() || m.isGigyaUserProvider() | |
}, m.allowTinypassAccountsLogin = function () { | |
var e = m.getConfig().app; | |
return e && e.useTinypassAccounts | |
}, m.isGigyaUserProvider = function () { | |
return m.getConfig().app && "gigya" === m.getConfig().app.userProvider | |
}, m.isCondeUserProvider = function () { | |
return m.getConfig().app && "conde" === m.getConfig().app.userProvider | |
}, m.isPianoIdUserProvider = function () { | |
return m.getConfig().app && "piano_id" === m.getConfig().app.userProvider | |
}, m.isJanrainUserProvider = function () { | |
return m.getConfig().app && "janrain" === m.getConfig().app.userProvider | |
}, m.allowMyAccountLogin = function () { | |
return m.allowTinypassAccountsLogin() | |
}, m.allowTinypassAccountsLogout = function () { | |
return m.isProviderAllowLogout() && m.isUserValid() | |
}, m.isProviderAllowLogout = function () { | |
return m.allowTinypassAccountsLogin() || m.isCondeUserProvider() || m.isPianoIdUserProvider() || m.isGigyaUserProvider() || m.isJanrainUserProvider() | |
}, m.logout = function () { | |
m.isProviderAllowLogout() && o.postMessage("logout", {closeOnLogout: getParameterByName("closeOnLogout")}), p = !1 | |
}, m.loginSuccessNoPostMessage = function (e) { | |
return function (e) { | |
var t = n.defer(); | |
p ? t.reject(!1) : (p = !0, e || (e = {}), m.getConfig().fillLoginSuccessEventParams(e), e.resultCallback = function () { | |
angular.forEach(f, function (t) { | |
t.callback(e) | |
}), f = l.filter(f, function (e) { | |
return !e.oneTime | |
}), t.resolve(e) | |
}, o.postMessage("loginSuccess", e)); | |
return t.promise | |
}(e) | |
}, m.onUserProfileUpdated = function (e) { | |
o.postMessage("userProfileUpdateSuccess", e) | |
}, m.register = function () { | |
return m.login("register") | |
}, m.checkUser = function (e) { | |
return r({method: "get", url: "/checkout/user/check", params: e}) | |
}, m.login = function (e) { | |
void 0 === e && (e = "login"); | |
var t = getParameterByName("aid"), r = getParameterByName("url"), i = (h = n.defer()).promise; | |
if (o.postMessage("loginStart", {}), i.finally(function () { | |
o.postMessage("loginEnd", {}) | |
}), util.log("[USER SERVICE] Cannot continue without valid user...sending loginRequiredEvent"), m.allowTinypassAccountsLogin()) { | |
p = !1; | |
var l = { | |
displayMode: "popup", | |
aid: t, | |
width: 360, | |
height: 660, | |
state: e, | |
iframeId: "login-" + _randomString(10), | |
host_url: r | |
}; | |
m.getConfig().fillLoginIframeParams(l); | |
var f = TPParam.LOGIN + "?" + $.param(l, !0) + "#/" + e; | |
d = function (e, t) { | |
var n = parseInt(getParameterByName("parentWidth"), 10), | |
r = parseInt(getParameterByName("parentHeight"), 10), o = e.width ? e.width : n, | |
i = e.height ? e.height : r, a = parseInt(getParameterByName("parentDualScreenLeft"), 10), | |
c = parseInt(getParameterByName("parentDualScreenTop"), 10), s = n / 2 - o / 2 + a, | |
l = parseInt(getParameterByName("parentOuterHeight"), 10) / 2 - i / 2 + c, | |
d = window.open(t, u, "scrollbars=yes,status=0,toolbar=0,resizable=1, width=" + o + ", height=" + i + ", top=" + l + ", left=" + s); | |
return window.focus && d.focus(), d | |
}(l, f); | |
var g = setInterval(function () { | |
d.closed && (clearInterval(g), m.checkUser({ | |
aid: l.aid, | |
url: l.host_url, | |
fromUserIdentity: !1 | |
}).then(function (e) { | |
if (e.models.user_token) { | |
var t = { | |
token_list: e.models.token_list, | |
cookie_domain: e.models.cookie_domain, | |
user_token: e.models.user_token, | |
user: e.models.user | |
}; | |
m.loginSuccessNoPostMessage(t).then(function () { | |
h.resolve(t) | |
}).catch(function () { | |
h.reject(!1) | |
}) | |
} else h.reject(!1) | |
}).catch(function (e) { | |
h.reject(!1), util.log("/user/check failed with error", e) | |
})) | |
}, 100) | |
} else { | |
var v = {aid: t}; | |
m.getConfig().fillLoginRequiredParamsToGoogleAnalytics(v), c.sendGoogleAnalyticsEvent({ | |
eventAction: "loginRequired", | |
eventLabel: "Login required", | |
params: v | |
}); | |
var y = {}; | |
y.startScreen = e, m.getConfig().fillLoginRequiredEventParams(y), o.loginRequiredEvent(y).then(function (e) { | |
(e.callbackNotFound || !1 !== e.result) && (h.reject(!1), a().terminal(s.trc("checkout.platform", "Cannot start checkout. User not logged in"))) | |
}) | |
} | |
return h.promise | |
}, m.onLoginSuccess = function (e, t) { | |
e && f.push({callback: e, oneTime: t}) | |
}, m.cleanSuccessLoginCallbacks = function () { | |
f = l.filter(f, function (e) { | |
return !e.oneTime | |
}) | |
}, m.loginSuccessPosted = function () { | |
return p | |
}, m.setLoginSuccessPosted = function (e) { | |
p = e | |
}, m.onExternalLogin = v, i.subscribe("changeLocale", function (e, t) { | |
t && t.locale && s.list().then(function (e) { | |
for (var n in e) if (e[n].locale === t.locale) { | |
s.update(t.locale); | |
break | |
} | |
}) | |
}), i.subscribe("loginSuccess", function (e, t) { | |
if (d && 0 == d.closed) { | |
try { | |
d.document.body.innerHTML = null | |
} catch (e) { | |
} | |
d.close() | |
} | |
}), i.subscribe("externalLoginSuccess", function (e, t) { | |
(t = t || {}).reloadAfterLogin = !0, v(t) | |
}), m.userChanged = function (e) { | |
h && h.resolve(e) | |
}, m | |
}]), function () { | |
var e = angular.module("tpComponentsModule", ["generalModule", "containerServiceModule"]); | |
e.directive("a", ["trackExternalEvent", "getTrackingId", "addQueryParameterToUrl", "$timeout", "ngEventService", function (e, t, n, r, o) { | |
return { | |
restrict: "E", link: function (i, a, c) { | |
r(function () { | |
function e() { | |
var e = void 0 === a.attr("noptid"), r = t(); | |
e && r && a.attr("href", n(a.attr("href"), "_ptid", r)) | |
} | |
a.attr("href") && 0 == a.attr("href").indexOf("http") && ("_parent" != a.attr("target") && a.attr("target", "_blank"), e(), o.subscribe(EVENT_TRACKING_ID_CHANGED, function () { | |
e() | |
})) | |
}), a.on("touchstart click", function (t) { | |
if ("click" === t.type) { | |
var n = a.attr("href") || ""; | |
0 === n.lastIndexOf("http", 0) && e("EXTERNAL_LINK", decodeURI(function (e) { | |
var t = e.split(/[?#]/)[0], n = t.length - 1; | |
return "/" === t[n] && (t = t.slice(0, n)), t | |
}(n)), {href: encodeURI(n)}) | |
} | |
}) | |
} | |
} | |
}]), e.directive("radioTrackBy", function () { | |
return { | |
restrict: "A", scope: {ngModel: "=", ngValue: "=", radioTrackBy: "@"}, link: function (e) { | |
e.ngValue[e.radioTrackBy] === e.ngModel[e.radioTrackBy] && (e.ngModel = e.ngValue) | |
} | |
} | |
}), e.factory("getExternalEventParams", function () { | |
return function (e) { | |
var t, n = {}; | |
for (var r in e) e.hasOwnProperty(r) && 0 === r.indexOf("externalEvent") && "externalEvent" !== r && (n[(t = r.split("externalEvent")[1], t.charAt(0).toLowerCase() + t.slice(1))] = e[r]); | |
return n | |
} | |
}), e.directive("externalEvent", ["eventService", "getExternalEventParams", "trackExternalEvent", function (e, t, n) { | |
return { | |
restrict: "A", link: function (r, o, i) { | |
o.on("touchstart click", function (r) { | |
if ("click" === r.type) { | |
var o = t(i); | |
n("EXTERNAL_EVENT", i.externalEvent, o), e.customEvent("customEvent", { | |
eventName: i.externalEvent, | |
params: t(i) | |
}) | |
} | |
}) | |
} | |
} | |
}]), e.directive("showIf", ["$animate", function (e) { | |
return { | |
restrict: "A", link: function (t, n, r) { | |
t.$watch(r.showIf, function (t) { | |
n.html(toBoolean(t) ? t : ""), e[toBoolean(t) ? "removeClass" : "addClass"](n, "ng-hide") | |
}) | |
} | |
} | |
}]), e.factory("checkMobile", ["$q", "$timeout", "containerService", function (e, t, n) { | |
return function () { | |
return n.getNewWidth() <= 600 | |
} | |
}]), e.directive("mobile", ["checkMobile", function (e) { | |
return { | |
restrict: "A", | |
transclude: !0, | |
scope: {}, | |
template: '<div class="mobile-mode" ng-if="check()" ng-transclude></div>', | |
controller: ["$scope", function (t) { | |
t.check = function () { | |
return e() | |
} | |
}] | |
} | |
}]), e.directive("desktop", ["checkMobile", function (e) { | |
return { | |
restrict: "A", | |
transclude: !0, | |
scope: {}, | |
template: '<div class="desktop-mode" ng-if="check()" ng-transclude></div>', | |
controller: ["$scope", function (t) { | |
t.check = function () { | |
return !e() | |
} | |
}] | |
} | |
}]), e.directive("onEnter", ["$parse", function (e) { | |
return function (t, n, r) { | |
var o = e(r.onEnter); | |
n.bind("keyup", function (e) { | |
13 == e.keyCode && t.$apply(function () { | |
o(t, {$event: e}) | |
}) | |
}) | |
} | |
}]), e.directive("errorMessage", ["$parse", function (e) { | |
return { | |
scope: !1, | |
controller: ["$scope", "$element", "$attrs", "ngEventService", "errorService", "shakeService", function (e, t, n, r, o, i) { | |
var a = o(e).TYPES, c = o(e).getId(), s = n.name, l = n.errorMessage, u = null, | |
d = function () { | |
u && u.remove(), t.removeClass("error") | |
}; | |
r.subscribe(EVENT_ERRORS_CHANGED, function () { | |
d(); | |
var n = null, r = o(e).errors(); | |
angular.forEach(r, function (e) { | |
angular.isObject(e) && e.field === s && e.type == a.COMPONENT && (n = e) | |
}), !t.is(":visible") || !n || n.displayed && n.displayedOn != c || (n.displayed = !0, "shake" == l ? (i.shake(t), t.addClass("error")) : (u = $("<div class='" + l + "'>" + n.message + "</div>"), t.after(u), t.addClass("error"))) | |
}), t.click(function () { | |
d() | |
}) | |
}] | |
} | |
}]), e.directive("config", ["containerService", "configService", function (e, t) { | |
return { | |
restrict: "E", link: function (n, r, o) { | |
isNumber(o.width) && (e.setPreferredWidth(o.width), e.resize()); | |
var i = !1; | |
angular.forEach(o, function (e, n) { | |
var r; | |
r = "$", n.substr(0, r.length) != r && (i = !0, t.setProperty(n, e)) | |
}), i && t.changed() | |
} | |
} | |
}]), e.directive("hideIfBlank", ["$animate", function (e) { | |
return { | |
link: function (t, n) { | |
t.$watch(function () { | |
}, function () { | |
var t = n.text().replace(/[\s\uFEFF\xA0\n]/gim, ""), | |
r = 0 === n.children().length && "" === t; | |
e[r ? "addClass" : "removeClass"](n, "ng-hide") | |
}) | |
} | |
} | |
}]), e.directive("reCaptcha", function () { | |
var e = 3; | |
return { | |
restrict: "EA", | |
template: "", | |
scope: {key: "@", onResolve: "&?", onReady: "&?"}, | |
link: function (t, n) { | |
if (!t.key) return void console.warn("There is no re-captcha site-key. See more: https://developers.google.com/recaptcha/docs/display"); | |
function r(e) { | |
n.addClass("captcha-resolved"), t.onResolve && t.$apply(function () { | |
t.onResolve({response: e}) | |
}) | |
} | |
!function e(o) { | |
if (0 !== o) try { | |
var i = grecaptcha.render(n.get(0), {sitekey: t.key, callback: r}); | |
t.onReady && t.onReady({id: i}) | |
} catch (t) { | |
setTimeout(function () { | |
e(o--) | |
}, 1e3) | |
} else console.warn("ReCaptcha can't be initialized") | |
}(e), t.resolve = r | |
} | |
} | |
}) | |
}(), function () { | |
var e = angular.module("authModule", ["userServiceModule", "condeProviderModule", "pianoIdProviderModule", "generalModule", "containerServiceModule", "tp.i18n"]); | |
e.factory("auth", ["$q", "condeProvider", "$rootScope", "errorService", "containerService", "utilsService", function (e, t, n, r, o, i) { | |
var a = {}, c = {}, s = { | |
register: function () { | |
throw new Exception("Should be implement") | |
}, login: function () { | |
throw new Exception("Should be implement") | |
}, resetPassword: function () { | |
throw new Exception("Should be implement") | |
} | |
}; | |
return a.input = {}, a.currentState = {name: null}, a.registerState = function (e) { | |
a.currentState.name || (a.currentState.name = e.name), e.currentState = a.currentState, e.input = a.input, c[e.name] = e, e.close = a.close; | |
var t = i.map(c, function (e) { | |
var t, o = e.name, i = {}; | |
return i["goto" + (t = e.name, t.charAt(0).toUpperCase() + t.slice(1))] = function () { | |
var e; | |
e = o, r(n).reset(), a.currentState.name = e | |
}, i | |
}); | |
i.forEach(c, function (e) { | |
i.forEach(t, function (t) { | |
i.forEach(t, function (t, n) { | |
e[n] || (e[n] = t) | |
}) | |
}) | |
}) | |
}, a.close = function () { | |
o.close({}) | |
}, a.register = function (e) { | |
return r(n).reset(), a.getProvider().register(e) | |
}, a.login = function (e) { | |
return r(n).reset(), a.getProvider().login(e) | |
}, a.resetPassword = function (e) { | |
return r(n).reset(), a.getProvider().resetPassword(e) | |
}, a.getProvider = function () { | |
return "conde" == (window.TPParam && window.TPParam.config && window.TPParam.config.app.userProvider) ? t : s | |
}, a | |
}]), e.directive("authComponent", function () { | |
return { | |
restrict: "A", | |
templateUrl: "/widget/checkout/component/partials/auth-component.html", | |
link: function (e, t) { | |
e.$watch(function () { | |
return t.is(":visible") | |
}, function (t) { | |
e.isVisible = t | |
}) | |
} | |
} | |
}), e.directive("authCustomLogin", function () { | |
return { | |
restrict: "E", | |
replace: !0, | |
transclude: !0, | |
template: '<div> <div ng-if="isCondeUserProvider() && !isUserValid()"> <div ng-transclude></div> </div> <piano-id ng-if="isPianoId && !isPasswordlessLogin()"></piano-id> <div passwordless-login ng-if="isPasswordlessLogin()"></div> <div ng-show="isAfterLogin()" class="auth-state-valid"></div> </div>', | |
controller: ["$scope", "auth", "userService", "viewService", "checkout", function (e, t, n, r, o) { | |
e.isPasswordlessLogin = function () { | |
return o.isPasswordlessCheckoutEnabled() && !n.isUserValid() && (n.isPianoIdUserProvider() && !o.config.isExistPasswordlessUser || !n.isPianoIdUserProvider()) | |
}, e.isPianoId = n.isPianoIdUserProvider(), e.isCondeUserProvider = n.isCondeUserProvider, e.isUserValid = n.isUserValid, e.isAfterLogin = function () { | |
return "auth" === r.getActiveState() && n.isUserValid() | |
} | |
}] | |
} | |
}), e.directive("authState", function () { | |
return { | |
restrict: "E", | |
require: "^authCustomLogin", | |
transclude: !0, | |
replace: !0, | |
scope: {}, | |
template: '<div ng-class="isVisible()" class="auth-{{name}} auth-state auth-state-hidden"></div>', | |
link: function (e, t, n, r, o) { | |
o(e, function (e, n) { | |
t.append(e) | |
}) | |
}, | |
controller: ["$scope", "$attrs", "auth", "userService", "errorService", "$rootScope", "lang", "checkout", function (e, t, n, r, o, i, a, c) { | |
function s(e) { | |
var t = e.data.errors; | |
o(i).reset(), o(i).global(t && t[0] && t[0].msg ? t[0].msg : "Unknown error") | |
} | |
e.currentState = null, e.name = t.name, e.isVisible = function () { | |
return {"auth-state-visible": e.currentState.name === e.name} | |
}, n.registerState(e), e.doLogin = function (e) { | |
n.login(n.input).then(function (e) { | |
return r.onExternalLogin({ | |
token_list: e.data.models.token_list, | |
cookie_domain: e.data.models.cookie_domain, | |
user_token: e.data.models.user_token, | |
params: e.data.models.auth | |
}).then(function () { | |
c.reload() | |
}) | |
}).catch(s) | |
}, e.doForgotPassword = function () { | |
n.resetPassword(n.input).then(function (t) { | |
t.data.models.succeeded && e.gotoForgotPasswordHasSent() | |
}, s) | |
}, e.doRegister = function (e) { | |
!e || n.input.password && n.input.confirmPassword && n.input.confirmPassword == n.input.password ? n.register(n.input).then(function (e) { | |
return r.onExternalLogin({ | |
token_list: e.data.models.token_list, | |
cookie_domain: e.data.models.cookie_domain, | |
user_token: e.data.models.user_token, | |
params: e.data.models.auth | |
}).then(function () { | |
c.reload() | |
}) | |
}).catch(s) : o(i).global(a.tr("Password and confirm password are not equal")) | |
} | |
}] | |
} | |
}) | |
}(), angular.module("condeProviderModule", []).factory("condeProvider", ["tpHTTP", function (e) { | |
var t = {}, n = function (t, n) { | |
var r = n || {}; | |
return r.aid = window.TPParam.config.app.aid, r.url = window.TPParam.params.url, e({ | |
method: "post", | |
url: t, | |
data: r | |
}) | |
}; | |
return t.register = function (e) { | |
return n(window.TPParam.CONDE_REGISTER, e) | |
}, t.login = function (e) { | |
return n(window.TPParam.CONDE_LOGIN, e) | |
}, t.resetPassword = function (e) { | |
return n(window.TPParam.CONDE_RESET_PASSWORD, e) | |
}, t | |
}]), function () { | |
var e = angular.module("pianoIdProviderModule", ["generalModule"]); | |
e.factory("pianoIdProvider", ["$q", "eventService", "ngEventService", "userService", "containerService", "checkout", function (e, t, n, r, o, i) { | |
var a = !1, c = { | |
register: function () { | |
}, login: function () { | |
}, resetPassword: function () { | |
}, onLoginSuccess: function (e) { | |
var t = e.user; | |
t.firstName = t.given_name, t.lastName = t.family_name, t.valid = !0, t.confirmed = !(e.user && e.user.email_confirmation_required), t.uid = t.sub, a = !!e.registration; | |
var n = i.getAid(), c = o.getOriginUrl(); | |
r.checkUser({aid: n, url: c, userToken: e.token, fromUserIdentity: !0}).then(function (e) { | |
return e.models.token_list | |
}).catch(function () { | |
return null | |
}).then(function (n) { | |
r.onExternalLogin({ | |
token_list: n, | |
cookie_domain: e.cookie_domain, | |
user_token: e.token, | |
params: e.user, | |
user: t, | |
registration: a | |
}) | |
}) | |
}, isNewUser: function () { | |
return a | |
} | |
}; | |
return c | |
}]), e.directive("pianoId", function () { | |
return { | |
restrict: "EA", | |
template: '<div id="piano-id-container"> <auth-piano-id ng-if="authIsExist()"></auth-piano-id> <form-piano-id ng-if="formIsExist()"></form-piano-id></div>', | |
controller: ["$scope", "userService", "viewService", "checkout", "pianoIdProvider", function (e, t, n, r, o) { | |
e.formIsExist = function () { | |
return !!r.getCustomFormParams().formName && t.isUserValid() && r.isPaymentMethodRequired() && (r.canSelectPaymentMethod() || r.isPaymentMethodSelected()) && !o.isNewUser() | |
}, e.authIsExist = function () { | |
return e.isVisible && !(t.isUserValid() && t.isUserConfirmed()) | |
}, e.isUserValid = t.isUserValid | |
}] | |
} | |
}), e.directive("emailConfirmationRequired", ["errorService", "ngEventService", "viewService", "eventService", "checkout", "$sce", "$window", "containerService", "pianoIdProvider", "lang", function (e, t, n, r, o, i, a, c, s, l) { | |
return { | |
restrict: "EA", | |
scope: {}, | |
require: "^view", | |
template: '<iframe id="{{id}}" ng-src="{{url}}" style="width:100%;"></iframe>', | |
link: function (e, s, u, d) { | |
if (n.isActive(d.stateName)) { | |
e.id = "piano-id-" + _randomString(5); | |
var p, f = o.params.pianoIdUrl || "https://id.tinypass.com/id/", m = function (e) { | |
return 0 === e.indexOf("http") ? e : document.location.origin || document.location.href | |
}(f); | |
l.on(T); | |
var h, g, v, y, E = (h = f, g = e.id, v = c.rootElement.width(), y = { | |
aid: o.getAid(), | |
sender: g, | |
origin: document.location.origin || document.location.href, | |
site: a.TPParam.params.url, | |
screen: "email_confirmation_required", | |
checkout: 1, | |
width: v, | |
lang: p || "", | |
passwordless: o.isPasswordlessCheckoutEnabled() | |
}, [h, $.param(y)].join("?")); | |
e.url = i.trustAsResourceUrl(E), t.subscribe(e.id + "-resize", function (e, t) { | |
!function (e) { | |
if (0 === e.height) return; | |
s.find("#piano-id-container, iframe").css({height: e.height + "px"}), c.resize() | |
}(t) | |
}), t.subscribe(e.id + "-loaded", function (e, t) { | |
var n = s.find("iframe"); | |
t = {width: n.width(), center: c.getCenterScreen(), originUrl: c.getOriginUrl()}; | |
r.customPostMessage("resize", t, m, n[0].contentWindow), T(), o.getDoubleOptInParams().then(function (e) { | |
var t = s.find("iframe")[0]; | |
if (t) { | |
var n = { | |
tbc: e.tbc, | |
termId: e.params.termId, | |
showOfferParams: JSON.stringify(e.params) | |
}; | |
r.customPostMessage("setupDoubleOptInParams", n, m, t.contentWindow) | |
} | |
}) | |
}); | |
var C = o.getCustomFormParams(); | |
t.subscribe(e.id + "-pianoIdEvent", function (e, t) { | |
var n = {trackingId: C.trackingId}, o = { | |
event: t.event, | |
params: $.extend({}, t.params, n), | |
iframeId: getParameterByName("iframeId") | |
}; | |
r.postMessage("pianoIdEvent", o) | |
}) | |
} else s.remove(); | |
function T(e) { | |
p = e || p; | |
var t = s.find("iframe")[0]; | |
t && r.customPostMessage("lang", {lang: p}, m, t.contentWindow) | |
} | |
} | |
} | |
}]), e.directive("authPianoId", ["errorService", "ngEventService", "viewService", "eventService", "checkout", "$sce", "$window", "containerService", "pianoIdProvider", "lang", "userService", function (e, t, n, r, o, i, a, c, s, l, u) { | |
return { | |
restrict: "EA", | |
scope: {}, | |
require: "^view", | |
template: '<iframe id="{{id}}" ng-src="{{url}}" style="width:100%;"></iframe>', | |
link: function (d, p, f, m) { | |
if (n.isActive(m.stateName)) { | |
d.id = "piano-id-" + _randomString(5); | |
var h, g = o.params.pianoIdUrl || "https://id.tinypass.com/id/", v = function (e) { | |
return 0 === e.indexOf("http") ? e : document.location.origin || document.location.href | |
}(g); | |
l.on(T); | |
var y = o.getCustomFormParams(); | |
d.formName = y.formName; | |
var E = function (e, t) { | |
var n = c.rootElement.width(), r = { | |
aid: o.getAid(), | |
sender: t, | |
origin: document.location.origin || document.location.href, | |
site: a.TPParam.params.url, | |
screen: _(), | |
checkout: 1, | |
width: n, | |
lang: h || "", | |
passwordless: o.isPasswordlessCheckoutEnabled() && o.config.isUserPasswordlessAndExist | |
}; | |
d.formName && (r.form_name = d.formName); | |
return [e, $.param(r)].join("?") | |
}(g, d.id); | |
d.url = i.trustAsResourceUrl(E), d.error_msg = l.trc("checkout.platform", "You should sign in or sign up first"), t.subscribe(d.id + "-loginSuccess", function (e, t) { | |
s.onLoginSuccess(t) | |
}), t.subscribe(d.id + "-resize", function (e, t) { | |
!function (e) { | |
if (0 === e.height) return; | |
p.find("#piano-id-container, iframe").css({height: e.height + "px"}), c.resize() | |
}(t) | |
}), t.subscribe(d.id + "-customEvent", function (e, t) { | |
r.customEvent("customEvent", t) | |
}), t.subscribe(d.id + "-loaded", function (e, t) { | |
var n = p.find("iframe"); | |
t = {width: n.width(), center: c.getCenterScreen(), originUrl: c.getOriginUrl()}; | |
r.customPostMessage("resize", t, v, n[0].contentWindow), T(), o.getDoubleOptInParams().then(function (e) { | |
var t = p.find("iframe")[0]; | |
if (t) { | |
var n = { | |
tbc: e.tbc, | |
termId: e.params.termId, | |
showOfferParams: JSON.stringify(e.params) | |
}; | |
r.customPostMessage("setupDoubleOptInParams", n, v, t.contentWindow) | |
} | |
}) | |
}), t.subscribe(d.id + "-pianoIdEvent", function (e, t) { | |
var n = {trackingId: y.trackingId, formName: t.params.formName}, o = { | |
event: t.event, | |
params: $.extend({}, t.params, n), | |
iframeId: getParameterByName("iframeId") | |
}; | |
r.postMessage("pianoIdEvent", o) | |
}); | |
var C = {preventExternalLogin: !0}; | |
u.getConfig().fillLoginRequiredEventParams(C), r.loginRequiredEvent(C), "auth" !== m.stateName && (m.registerComponentController(d), d._isValid = function () { | |
return e(d).reset(), e(d).global(d.error_msg), !1 | |
}, p.on("$destroy", function () { | |
e(d).reset(), m.unregisterComponentController(d) | |
})) | |
} else p.remove(); | |
function T(e) { | |
h = e || h; | |
var t = p.find("iframe")[0]; | |
t && r.customPostMessage("lang", {lang: h}, v, t.contentWindow) | |
} | |
function _() { | |
return u.isUserValid() && !u.isUserConfirmed() ? "email_is_not_confirmed" : o.config.isSentLoginEmail ? "passwordless_confirmation" : o.isPasswordlessCheckoutEnabled() ? "login" : "register" | |
} | |
} | |
} | |
}]), e.directive("formPianoId", ["$q", "$sce", "checkout", "ngEventService", "eventService", "$window", "containerService", "pianoIdProvider", "lang", function (e, t, n, r, o, i, a, c, s) { | |
return { | |
restrict: "EA", | |
require: "^view", | |
scope: {}, | |
template: '<iframe ng-hide="isFormHidden" id="{{id}}" ng-src="{{url}}" style="width:100%;"></iframe>', | |
link: function (i, l, u, d) { | |
if ("auth" !== d.stateName) { | |
var p, f = e.defer(), m = !1; | |
i.isFormHidden = !0, i.id = "piano-id-" + _randomString(5); | |
var h = n.getCustomFormParams(); | |
i.formName = h.formName, i.hideIfComplete = h.hideCompletedFields, i.registerForm = c.registerForm, i.unregisterForm = c.unregisterForm; | |
var g, v = n.params.pianoIdUrl || "https://id.tinypass.com/id/", y = function (e) { | |
return 0 === e.indexOf("http") ? e : document.location.origin || document.location.href | |
}(v); | |
s.on(C); | |
var E = function (e, t) { | |
var r = a.rootElement.width(), o = { | |
aid: n.getAid(), | |
form_name: i.formName, | |
hide_if_complete: i.hideIfComplete, | |
sender: t, | |
origin: document.location.origin || document.location.href, | |
checkout: 1, | |
width: r, | |
lang: g || "", | |
passwordless: n.isPasswordlessCheckoutEnabled() | |
}; | |
n.params.userToken && (o.access_token = n.params.userToken); | |
return [e, $.param(o)].join("?") | |
}(v + "form.html", i.id); | |
r.subscribe(i.id + "-profileUpdated", function (e, t) { | |
m = !0, p && p.resolve(!0) | |
}), r.subscribe(i.id + "-change", function (e, t) { | |
m = !1 | |
}), r.subscribe(i.id + "-profileUpdatedError", function (e, t) { | |
m = !1, p && p.resolve(!1) | |
}), r.subscribe(i.id + "-pianoIdEvent", function (e, t) { | |
"cfFormImpression" === t.event && i.$apply(function () { | |
i.isFormHidden = !1 | |
}); | |
var n = {trackingId: h.trackingId, formName: t.params.formName}, r = { | |
event: t.event, | |
params: $.extend({}, t.params, n), | |
iframeId: getParameterByName("iframeId") | |
}; | |
o.postMessage("pianoIdEvent", r) | |
}), r.subscribe(i.id + "-resize", function (e, t) { | |
!function (e) { | |
if (0 === e.height) return; | |
var t = l.find("#piano-id-container, iframe"); | |
e.animate ? t.animate({height: e.height + "px"}, 200) : t.css({height: e.height + "px"}); | |
a.resize() | |
}(t) | |
}), r.subscribe(i.id + "-loaded", function (e, t) { | |
var n = l.parent(), r = l.find("iframe"); | |
t = {width: n.width(), center: a.getCenterScreen(), originUrl: a.getOriginUrl()}; | |
o.customPostMessage("resize", t, y, r[0].contentWindow), C(), f.resolve() | |
}), r.subscribe(i.id + "-stateReady", function (e, t) { | |
var r = l.find("iframe"); | |
o.customPostMessage("setToken", n.params.userToken, y, r[0].contentWindow) | |
}), d.registerComponentController(i), i.url = t.trustAsResourceUrl(E), i._isValid = function () { | |
return f.promise.then(function () { | |
if (i.isFullFilled || m) return !0; | |
var t = l.find("iframe"); | |
return m || (p = e.defer(), o.customPostMessage("submit", {}, y, t[0].contentWindow)), p.promise | |
}) | |
}, l.on("$destroy", function () { | |
i.isFullFilled = !0, d.unregisterComponentController(i) | |
}) | |
} else l.remove(); | |
function C(e) { | |
g = e || g; | |
var t = l.find("iframe")[0]; | |
t && o.customPostMessage("lang", {lang: g}, y, t.contentWindow) | |
} | |
} | |
} | |
}]) | |
}(); | |
var datesModule = angular.module("datesModule", ["generalModule"]); | |
datesModule.service("dateUtils", function () { | |
var e = 6e4, t = 36e5, n = this; | |
this.isDate = function (e) { | |
return e instanceof Date | |
}, this.parse = function (r, o) { | |
var i = 2, a = /[T ]/, c = /:/, s = /^(\d{2})$/, | |
l = [/^([+-]\d{2})$/, /^([+-]\d{3})$/, /^([+-]\d{4})$/], u = /^(\d{4})/, | |
d = [/^([+-]\d{4})/, /^([+-]\d{5})/, /^([+-]\d{6})/], p = /^-(\d{2})$/, f = /^-?(\d{3})$/, | |
m = /^-?(\d{2})-?(\d{2})$/, h = /^-?W(\d{2})$/, g = /^-?W(\d{2})-?(\d{1})$/, | |
v = /^(\d{2}([.,]\d*)?)$/, y = /^(\d{2}):?(\d{2}([.,]\d*)?)$/, | |
E = /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/, C = /([Z+-].*)$/, T = /^(Z)$/, _ = /^([+-])(\d{2})$/, | |
S = /^([+-])(\d{2}):?(\d{2})$/; | |
function w(e, t, n) { | |
t = t || 0, n = n || 0; | |
var r = new Date(0); | |
r.setUTCFullYear(e, 0, 4); | |
var o = 7 * t + n + 1 - (r.getUTCDay() || 7); | |
return r.setUTCDate(r.getUTCDate() + o), r | |
} | |
return function (r, o) { | |
if (n.isDate(r)) return new Date(r.getTime()); | |
if ("string" != typeof r) return new Date(r); | |
var b = (o || {}).additionalDigits; | |
b = null == b ? i : Number(b); | |
var A = function (e) { | |
var t, n = {}, r = e.split(a); | |
if (c.test(r[0]) ? (n.date = null, t = r[0]) : (n.date = r[0], t = r[1]), t) { | |
var o = C.exec(t); | |
o ? (n.time = t.replace(o[1], ""), n.timezone = o[1]) : n.time = t | |
} | |
return n | |
}(r), P = function (e, t) { | |
var n, r = l[t], o = d[t]; | |
if (n = u.exec(e) || o.exec(e)) { | |
var i = n[1]; | |
return {year: parseInt(i, 10), restDateString: e.slice(i.length)} | |
} | |
if (n = s.exec(e) || r.exec(e)) { | |
var a = n[1]; | |
return {year: 100 * parseInt(a, 10), restDateString: e.slice(a.length)} | |
} | |
return {year: null} | |
}(A.date, b), $ = P.year, k = function (e, t) { | |
if (null === t) return null; | |
var n, r, o, i; | |
if (0 === e.length) return (r = new Date(0)).setUTCFullYear(t), r; | |
if (n = p.exec(e)) return r = new Date(0), o = parseInt(n[1], 10) - 1, r.setUTCFullYear(t, o), r; | |
if (n = f.exec(e)) { | |
r = new Date(0); | |
var a = parseInt(n[1], 10); | |
return r.setUTCFullYear(t, 0, a), r | |
} | |
if (n = m.exec(e)) { | |
r = new Date(0), o = parseInt(n[1], 10) - 1; | |
var c = parseInt(n[2], 10); | |
return r.setUTCFullYear(t, o, c), r | |
} | |
if (n = h.exec(e)) return i = parseInt(n[1], 10) - 1, w(t, i); | |
if (n = g.exec(e)) { | |
i = parseInt(n[1], 10) - 1; | |
var s = parseInt(n[2], 10) - 1; | |
return w(t, i, s) | |
} | |
return null | |
}(P.restDateString, $); | |
if (k) { | |
var I, N = k.getTime(), D = 0; | |
return A.time && (D = function (n) { | |
var r, o, i; | |
if (r = v.exec(n)) return (o = parseFloat(r[1].replace(",", "."))) % 24 * t; | |
if (r = y.exec(n)) return o = parseInt(r[1], 10), i = parseFloat(r[2].replace(",", ".")), o % 24 * t + i * e; | |
if (r = E.exec(n)) { | |
o = parseInt(r[1], 10), i = parseInt(r[2], 10); | |
var a = parseFloat(r[3].replace(",", ".")); | |
return o % 24 * t + i * e + 1e3 * a | |
} | |
return null | |
}(A.time)), A.timezone ? (x = A.timezone, I = (O = T.exec(x)) ? 0 : (O = _.exec(x)) ? (M = 60 * parseInt(O[2], 10), "+" === O[1] ? -M : M) : (O = S.exec(x)) ? (M = 60 * parseInt(O[2], 10) + parseInt(O[3], 10), "+" === O[1] ? -M : M) : 0) : (I = new Date(N + D).getTimezoneOffset(), I = new Date(N + D + I * e).getTimezoneOffset()), new Date(N + D + I * e) | |
} | |
var x, O, M; | |
return new Date(r) | |
}(r, o) | |
}, this.getTime = function (e) { | |
return this.parse(e).getTime() | |
}, this.unixTime = function (e) { | |
return Math.floor(this.getTime(e) / 1e3) | |
}, this.startOfDay = function (e) { | |
var t = this.parse(e); | |
return t.setHours(0, 0, 0, 0), t | |
}, this.getDayOfYear = function (e) { | |
var t = this.parse(e); | |
return this.differenceInCalendarDays(t, this.startOfYear(t)) + 1 | |
}, this.differenceInCalendarDays = function (t, n) { | |
var r = this.startOfDay(t), o = this.startOfDay(n), i = r.getTime() - r.getTimezoneOffset() * e, | |
a = o.getTime() - o.getTimezoneOffset() * e; | |
return Math.round((i - a) / 864e5) | |
}, this.getISOYear = function (e) { | |
var t = this.parse(e), n = t.getFullYear(), r = new Date(0); | |
r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0); | |
var o = this.startOfISOWeek(r), i = new Date(0); | |
i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0); | |
var a = this.startOfISOWeek(i); | |
return t.getTime() >= o.getTime() ? n + 1 : t.getTime() >= a.getTime() ? n : n - 1 | |
}, this.startOfISOYear = function (e) { | |
var t = this.getISOYear(e), n = new Date(0); | |
return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), this.startOfISOWeek(n) | |
}, this.getISOWeek = function (e) { | |
var t = this.parse(e), n = this.startOfISOWeek(t).getTime() - this.startOfISOYear(t).getTime(); | |
return Math.round(n / 6048e5) + 1 | |
}, this.startOfISOWeek = function (e) { | |
return this.startOfWeek(e, {weekStartsOn: 1}) | |
}, this.startOfYear = function (e) { | |
var t = this.parse(e), n = new Date(0); | |
return n.setFullYear(t.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n | |
}, this.startOfWeek = function (e, t) { | |
var n = t && Number(t.weekStartsOn) || 0, r = this.parse(e), o = r.getDay(), | |
i = (o < n ? 7 : 0) + o - n; | |
return r.setDate(r.getDate() - i), r.setHours(0, 0, 0, 0), r | |
}, this.isValid = function (e) { | |
if (this.isDate(e)) return !isNaN(e); | |
throw new TypeError(toString.call(e) + " is not an instance of Date") | |
}, this.format = function (e, t, r) { | |
var o = { | |
M: function (e) { | |
return e.getMonth() + 1 | |
}, MM: function (e) { | |
return a(e.getMonth() + 1, 2) | |
}, Q: function (e) { | |
return Math.ceil((e.getMonth() + 1) / 3) | |
}, D: function (e) { | |
return e.getDate() | |
}, DD: function (e) { | |
return a(e.getDate(), 2) | |
}, DDD: function (e) { | |
return n.getDayOfYear(e) | |
}, DDDD: function (e) { | |
return a(n.getDayOfYear(e), 3) | |
}, d: function (e) { | |
return e.getDay() | |
}, E: function (e) { | |
return e.getDay() || 7 | |
}, W: function (e) { | |
return n.getISOWeek(e) | |
}, WW: function (e) { | |
return a(n.getISOWeek(e), 2) | |
}, YY: function (e) { | |
return a(e.getFullYear(), 4).substr(2) | |
}, YYYY: function (e) { | |
return a(e.getFullYear(), 4) | |
}, GG: function (e) { | |
return String(n.getISOYear(e)).substr(2) | |
}, GGGG: function (e) { | |
return n.getISOYear(e) | |
}, H: function (e) { | |
return e.getHours() | |
}, HH: function (e) { | |
return a(e.getHours(), 2) | |
}, h: function (e) { | |
var t = e.getHours(); | |
return 0 === t ? 12 : t > 12 ? t % 12 : t | |
}, hh: function (e) { | |
return a(o.h(e), 2) | |
}, m: function (e) { | |
return e.getMinutes() | |
}, mm: function (e) { | |
return a(e.getMinutes(), 2) | |
}, s: function (e) { | |
return e.getSeconds() | |
}, ss: function (e) { | |
return a(e.getSeconds(), 2) | |
}, S: function (e) { | |
return Math.floor(e.getMilliseconds() / 100) | |
}, SS: function (e) { | |
return a(Math.floor(e.getMilliseconds() / 10), 2) | |
}, SSS: function (e) { | |
return a(e.getMilliseconds(), 3) | |
}, Z: function (e) { | |
return i(e.getTimezoneOffset(), ":") | |
}, ZZ: function (e) { | |
return i(e.getTimezoneOffset()) | |
}, X: function (e) { | |
return Math.floor(e.getTime() / 1e3) | |
}, x: function (e) { | |
return e.getTime() | |
} | |
}; | |
function i(e, t) { | |
t = t || ""; | |
var n = e > 0 ? "-" : "+", r = Math.abs(e), o = r % 60; | |
return n + a(Math.floor(r / 60), 2) + t + a(o, 2) | |
} | |
function a(e, t) { | |
for (var n = Math.abs(e).toString(); n.length < t;) n = "0" + n; | |
return n | |
} | |
return function (e, t, r) { | |
var i = t ? String(t) : "YYYY-MM-DDTHH:mm:ss.SSSZ", a = (r || {}).locale, | |
c = n.enLocale().format.formatters, s = n.enLocale().format.formattingTokensRegExp; | |
a && a.format && a.format.formatters && (c = a.format.formatters, a.format.formattingTokensRegExp && (s = a.format.formattingTokensRegExp)); | |
var l = n.parse(e); | |
return n.isValid(l) ? function (e, t, n) { | |
var r, i, a, c = e.match(n), s = c.length; | |
for (r = 0; r < s; r++) i = t[c[r]] || o[c[r]], c[r] = i || ((a = c[r]).match(/\[[\s\S]/) ? a.replace(/^\[|]$/g, "") : a.replace(/\\/g, "")); | |
return function (e) { | |
for (var t = "", n = 0; n < s; n++) c[n] instanceof Function ? t += c[n](e, o) : t += c[n]; | |
return t | |
} | |
}(i, c, s)(l) : "Invalid Date" | |
}(e, t, r) | |
}, this.enLocale = function () { | |
return { | |
distanceInWords: (u = { | |
lessThanXSeconds: { | |
one: "less than a second", | |
other: "less than {{count}} seconds" | |
}, | |
xSeconds: {one: "1 second", other: "{{count}} seconds"}, | |
halfAMinute: "half a minute", | |
lessThanXMinutes: {one: "less than a minute", other: "less than {{count}} minutes"}, | |
xMinutes: {one: "1 minute", other: "{{count}} minutes"}, | |
aboutXHours: {one: "about 1 hour", other: "about {{count}} hours"}, | |
xHours: {one: "1 hour", other: "{{count}} hours"}, | |
xDays: {one: "1 day", other: "{{count}} days"}, | |
aboutXMonths: {one: "about 1 month", other: "about {{count}} months"}, | |
xMonths: {one: "1 month", other: "{{count}} months"}, | |
aboutXYears: {one: "about 1 year", other: "about {{count}} years"}, | |
xYears: {one: "1 year", other: "{{count}} years"}, | |
overXYears: {one: "over 1 year", other: "over {{count}} years"}, | |
almostXYears: {one: "almost 1 year", other: "almost {{count}} years"} | |
}, { | |
localize: function (e, t, n) { | |
var r; | |
return n = n || {}, r = "string" == typeof u[e] ? u[e] : 1 === t ? u[e].one : u[e].other.replace("{{count}}", t), n.addSuffix ? n.comparison > 0 ? "in " + r : r + " ago" : r | |
} | |
}), | |
format: (e = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], t = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], r = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], o = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], i = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], a = ["AM", "PM"], c = ["am", "pm"], s = ["a.m.", "p.m."], l = { | |
MMM: function (t) { | |
return e[t.getMonth()] | |
}, MMMM: function (e) { | |
return t[e.getMonth()] | |
}, dd: function (e) { | |
return r[e.getDay()] | |
}, ddd: function (e) { | |
return o[e.getDay()] | |
}, dddd: function (e) { | |
return i[e.getDay()] | |
}, A: function (e) { | |
return e.getHours() / 12 >= 1 ? a[1] : a[0] | |
}, a: function (e) { | |
return e.getHours() / 12 >= 1 ? c[1] : c[0] | |
}, aa: function (e) { | |
return e.getHours() / 12 >= 1 ? s[1] : s[0] | |
} | |
}, ["M", "D", "DDD", "d", "Q", "W"].forEach(function (e) { | |
l[e + "o"] = function (t, n) { | |
return function (e) { | |
var t = e % 100; | |
if (t > 20 || t < 10) switch (t % 10) { | |
case 1: | |
return e + "st"; | |
case 2: | |
return e + "nd"; | |
case 3: | |
return e + "rd" | |
} | |
return e + "th" | |
}(n[e](t)) | |
} | |
}), {formatters: l, formattingTokensRegExp: n.buildFormattingTokensRegExp(l)}) | |
}; | |
var e, t, r, o, i, a, c, s, l, u | |
}, this.buildFormattingTokensRegExp = function (e) { | |
var t = []; | |
for (var n in e) e.hasOwnProperty(n) && t.push(n); | |
var r = ["M", "MM", "Q", "D", "DD", "DDD", "DDDD", "d", "E", "W", "WW", "YY", "YYYY", "GG", "GGGG", "H", "HH", "h", "hh", "m", "mm", "s", "ss", "S", "SS", "SSS", "Z", "ZZ", "X", "x"].concat(t).sort().reverse(); | |
return new RegExp("(\\[[^\\[]*\\])|(\\\\)?(" + r.join("|") + "|.)", "g") | |
} | |
}), angular.module("country.selector", ["ngSanitize", "generalModule"]).directive("dynamicHtml", ["$compile", function (e) { | |
return { | |
restrict: "A", replace: !0, link: function (t, n, r) { | |
t.$watch(r.dynamicHtml, function (r) { | |
n.html(r), e(n.contents())(t) | |
}) | |
} | |
} | |
}]).directive("tpCallingCodeSelector", ["CountrySelectorCtrl", function (e) { | |
return { | |
restrict: "A", | |
scope: { | |
selectorOptions: "=", | |
selectorLabel: "@", | |
dropdownStyles: "=", | |
side: "=", | |
dropdownClasses: "=?", | |
clickOnSelect: "=?" | |
}, | |
templateUrl: "/widget/checkout/component/partials/calling-code-selector.html", | |
link: function (t, n) { | |
e(t, n) | |
} | |
} | |
}]).directive("tpCountrySelector", ["CountrySelectorCtrl", function (e) { | |
return { | |
restrict: "A", | |
scope: { | |
selectorOptions: "=", | |
selectorLabel: "@", | |
dropdownStyles: "=", | |
side: "=", | |
clickOnSelect: "=?", | |
countryType: "=?", | |
defaultCountry: "=?" | |
}, | |
templateUrl: "/widget/checkout/component/partials/country-selector.html", | |
link: function (t, n) { | |
e(t, n) | |
} | |
} | |
}]).factory("CountrySelectorCtrl", ["tpDrop", "$rootScope", "utilsService", function (e, t, n) { | |
return function (t, r) { | |
var o, i, a = { | |
scope: t, | |
templateUrl: "/widget/checkout/component/partials/select-selector.html", | |
centerOn: r, | |
controller: ["$scope", function (e) { | |
e.currentCategoryModel = "", e.searchItemModel = "", e.options = angular.copy(e.selectorOptions.items), e.update = o, e.countryListHtml = ""; | |
var t = "", r = ""; | |
function o() { | |
var o; | |
e.countryListHtml = (o = e.searchItemModel, r = "", n.forEach(e.options, function (e, n) { | |
-1 != e.name.toLowerCase().indexOf(o.toLowerCase()) && (e.name.replace(/'/g, "\\'"), t = "" == o ? e.name : function (e, t) { | |
return e.replace(new RegExp(t.replace(/\+/g, "\\+"), "gi"), function (e) { | |
return '<span class="tp-dropdown__text-highlight">' + e + "</span>" | |
}) | |
}(e.name, o), r += '<a class="tp-dropdown__link dropdown-link-group clearfix" ng-click="select(' + n + ')"><div class="country-icon country-icon-' + e.countryCode.toLowerCase() + '"></div> <span>' + t + "</span></a>") | |
}), r) | |
} | |
o(), e.select = function (t) { | |
e.$close(e.options[t]) | |
} | |
}], | |
style: t.dropdownStyles || {width: 580, zIndex: 1004}, | |
cl: t.dropdownClasses || null, | |
side: t.side || "top" | |
}; | |
function c(e) { | |
var r; | |
return n.forEach(t.selectorOptions.items, function (t) { | |
t.countryCode === e && (r = t) | |
}), r | |
} | |
function s(e) { | |
t.selectorOptions.selectorModel = {label: e.name, item: e}, t.clickOnSelect && t.clickOnSelect(e) | |
} | |
t.$on("selectCountry", function (e, n) { | |
if (n[0] === t.countryType) { | |
var r = c(n[1]); | |
r && s(r) | |
} | |
}), t.confirm = s, r.click(function (n) { | |
n.preventDefault(), n.stopPropagation(), e(angular.extend({}, a)).then(t.confirm, t.reject) | |
}), t.defaultCountry && (o = t.defaultCountry, (i = c(o)) && (t.selectorOptions.selectorModel.label = i.name, t.selectorOptions.selectorModel.item = i)) | |
} | |
}]).directive("tpStateSelector", ["StateSelectorCtrl", function (e) { | |
return { | |
restrict: "A", | |
scope: { | |
selectorOptions: "=", | |
selectorLabel: "@", | |
dropdownStyles: "=", | |
side: "=", | |
clickOnSelect: "=?", | |
defaultState: "=?" | |
}, | |
templateUrl: "/widget/checkout/component/partials/country-selector.html", | |
link: function (t, n) { | |
e(t, n) | |
} | |
} | |
}]).factory("StateSelectorCtrl", ["tpDrop", "$rootScope", "utilsService", function (e, t, n) { | |
return function (t, r) { | |
var o = { | |
scope: t, | |
templateUrl: "/widget/checkout/component/partials/select-selector.html", | |
centerOn: r, | |
controller: ["$scope", function (e) { | |
e.currentCategoryModel = "", e.searchItemModel = "", e.options = angular.copy(e.selectorOptions.items), e.update = o, e.countryListHtml = ""; | |
var t = "", r = ""; | |
function o() { | |
var o; | |
e.countryListHtml = (o = e.searchItemModel, r = "", n.forEach(e.options, function (e, n) { | |
-1 != e.name.toLowerCase().indexOf(o.toLowerCase()) && (e.name.replace(/'/g, "\\'"), t = "" == o ? e.name : function (e, t) { | |
return e.replace(new RegExp(t.replace(/\+/g, "\\+"), "gi"), function (e) { | |
return '<span class="tp-dropdown__text-highlight">' + e + "</span>" | |
}) | |
}(e.name, o), r += '<a class="tp-dropdown__link dropdown-link-group clearfix" ng-click="select(' + n + ')"><span>' + t + "</span></a>") | |
}), r) | |
} | |
o(), e.select = function (t) { | |
e.$close(e.options[t]) | |
} | |
}], | |
style: t.dropdownStyles || {width: 580, zIndex: 1004}, | |
cl: t.dropdownClasses || null, | |
side: t.side || "top" | |
}; | |
function i(e) { | |
var r = function (e) { | |
var r; | |
return n.forEach(t.selectorOptions.items, function (t) { | |
t.stateCode === e && (r = t) | |
}), r | |
}(e); | |
r && (t.selectorOptions.selectorModel.label = r.name, t.selectorOptions.selectorModel.item = r) | |
} | |
t.confirm = function (e) { | |
t.selectorOptions.selectorModel = {label: e.name, item: e}, t.clickOnSelect && t.clickOnSelect(e) | |
}, r.click(function (n) { | |
n.preventDefault(), n.stopPropagation(), e(angular.extend({}, o)).then(t.confirm, t.reject) | |
}), t.defaultState && i(t.defaultState) | |
} | |
}]), angular.element(document).ready(function () { | |
window.TPInjector = angular.bootstrap(document.getElementById("ng-app"), ["checkoutComponentsModule"], {strictDi: !0}) | |
}); | |
var EVENT_VIEW_ACTIVATED = "EVENT_VIEW_ACTIVATED", EVENT_VIEW_CHANGED = "EVENT_VIEW_CHANGED", | |
EVENT_CHECKOUT_STARTED = "EVENT_CHECKOUT_STARTED", EVENT_CHECKOUT_RELOADED = "EVENT_CHECKOUT_RELOADED", | |
EVENT_REAPPLY_PROMO_CODE = "EVENT_REAPPLY_PROMO_CODE", EVENT_RESET_PROMO_CODE = "EVENT_RESET_PROMO_CODE", | |
EVENT_REAPPLY_PAY_WANT_YOU_WANT = "EVENT_REAPPLY_PAY_WANT_YOU_WANT"; | |
window.angular = angular; | |
var checkoutModule = angular.module("checkoutModule", ["ngAnimate", "ui.router", "ajaxServices", "purchaseServiceModule", "ngSanitize", "generalModule", "userServiceModule", "containerServiceModule", "tpComponentsModule", "tp.i18n", "consentModule", "authModule", "swgModule"]); | |
checkoutModule.config(["$compileProvider", "$qProvider", "$stateProvider", function (e, t, n) { | |
e.debugInfoEnabled && e.debugInfoEnabled(!1), e.commentDirectivesEnabled && e.commentDirectivesEnabled(!1), e.cssClassDirectivesEnabled && e.cssClassDirectivesEnabled(!1), t.errorOnUnhandledRejections && t.errorOnUnhandledRejections(!1), e.aHrefSanitizationWhitelist && e.aHrefSanitizationWhitelist(/^\s*(https?|data|local|ftp|mailto|file|javascript|sms):/), checkoutModule.$stateProvider = n | |
}]), checkoutModule.run(["interceptAjax", function (e) { | |
e.appendLoaderTo("checkout") | |
}]), checkoutModule.factory("checkoutService", ["tpHTTP", "$q", "$timeout", "$window", "statsService", function (e, t, n, r, o) { | |
var i = { | |
getOffer$: null, isTimeOutDelay: !1, getOffer: function (n, a) { | |
return o.getStats().then(function (o) { | |
return !0 === i.isTimeOutDelay ? i.getOffer$.promise : (i.getOffer$ = t.defer(), i.isTimeOutDelay = !0, setTimeout(function () { | |
i.isTimeOutDelay = !1; | |
var t = i.getOffer$; | |
i.getOffer$ = null, e({ | |
method: "post", | |
url: r.TPParam.GET_OFFER, | |
params: n, | |
data: {checkoutStats: o} | |
}).then(function (e) { | |
a.mergeStats(e), t.resolve(e) | |
}).catch(function (e) { | |
t.reject(e) | |
}).finally(function () { | |
t = null | |
}) | |
}, 10), i.getOffer$.promise) | |
}) | |
}, getAccess: function (n) { | |
return o.getStats().then(function (o) { | |
var i = n.getSelectedTerm(), a = i ? i.termId : null; | |
return e({ | |
method: "post", | |
url: r.TPParam.GET_ACCESS, | |
params: { | |
aid: n.params.aid, | |
offerId: n.params.offerId, | |
termId: a, | |
userToken: n.params.userToken, | |
userProvider: n.params.userProvider | |
}, | |
data: {checkoutStats: o} | |
}).catch(function (e) { | |
t.reject(e) | |
}) | |
}) | |
}, getUserResource: function (n) { | |
var o = {aid: n.params.aid, userToken: n.params.userToken, userProvider: n.params.userProvider}; | |
return e({ | |
method: "post", | |
url: r.TPParam.GET_USER_RESOURCES, | |
params: o, | |
data: {checkoutStats: n.stats} | |
}).catch(function (e) { | |
t.reject(e) | |
}) | |
}, setAsDefaultPaymentMethod: function (t) { | |
return e({method: "post", url: r.TPParam.APPLY_DEFAULT_PAYMENT_METHOD, params: t}) | |
} | |
}; | |
return i | |
}]), checkoutModule.factory("checkout", ["$window", "$rootScope", "$state", "$rootElement", "eventService", "purchaseService", "$timeout", "ngEventService", "$q", "viewService", "$document", "modalService", "errorService", "windowStateService", "userService", "containerService", "checkoutService", "tpHTTP", "gaService", "lang", "checkConsents", "configService", "trackExternalEvent", "utilsService", "eventLogger", "auth", "statsService", "swgService", "setupTrackingId", "performanceMetricsService", "passwordlessService", function (e, t, n, r, o, i, a, c, s, l, u, d, p, f, m, h, g, v, y, E, C, T, _, S, w, b, A, P, $, k, I) { | |
var N = null, D = { | |
name: "", | |
details: [], | |
startedAt: null, | |
renewsOn: null, | |
alreadyPurchased: null, | |
canBeRenewed: null, | |
canBeRenewedUsingExistedUPI: null, | |
renewChargeAmount: null, | |
renewChargeCurrency: null, | |
renewChargeDisplayAmount: null, | |
inRenewal: null | |
}, x = {id: null, externalApiConfigurationId: null, externalApiFields: [], externalApiUserLocation: null}, | |
O = {name: "CheckoutService"}; | |
O.$rootScope = t, O.rootElement = r, O.log = [], O.flags = {}, O.input = {}; | |
var M = { | |
oid: null, | |
autoRenew: !0, | |
chargeDisplayAmount: null, | |
chargeAmount: null, | |
chargeCurrency: "USD", | |
originalChargeAmount: null, | |
originalChargeCurrency: null, | |
originalChargeDisplayAmount: null, | |
promotionBillingPlan: null, | |
isTermLockedByPromocode: !1, | |
paymentMethods: [], | |
receipt: {}, | |
user_data: {first_name: null, last_name: null}, | |
termId: null, | |
offerId: null, | |
zipCode: null, | |
confirmated: { | |
billingPlan: null, | |
chargeAmount: null, | |
taxAmount: null, | |
total: null, | |
taxRate: null, | |
hstRate: null, | |
hstAmount: null, | |
qstRate: null, | |
qstAmount: null, | |
pstRate: null, | |
pstAmount: null, | |
gstRate: null, | |
gstAmount: null | |
}, | |
credit_card: {}, | |
paypalBt: {}, | |
applePayBt: {}, | |
consents: [], | |
canadianTaxes: [], | |
customFormTermId: null | |
}; | |
O.billingConfig = { | |
countryCode: window.TPParam.GEO_COUNTRY_CODE, | |
zipCode: window.TPParam.GEO_COUNTRY_POSTAL_CODE, | |
needResidence: !1, | |
sameResidence: !0, | |
residenceCountryCode: null, | |
vatLabel: "VAT", | |
taxIncludeBilling: !0, | |
showVAT: !1, | |
geoCountryCode: window.TPParam.GEO_COUNTRY_CODE, | |
geoZipCode: window.TPParam.GEO_COUNTRY_POSTAL_CODE, | |
renewBillingCountryCode: null, | |
renewBillingZipCode: null, | |
renewResidenceCountryCode: null, | |
countryTaxSupport: window.TPParam.GEO_COUNTRY_TAX_SUPPORT, | |
updateFromTaxRequest: function (e) { | |
e && (O.billingConfig.countryCode = e.billingCountryCode, O.billingConfig.residenceCountryCode = e.residenceCountryCode, O.billingConfig.zipCode = e.residenceZipCode ? e.residenceZipCode : e.billingZipCode, c.fire(EVENT_BILLING_FROM_TAX_REQUEST)) | |
}, | |
taxRequestFromUpi: function (e) { | |
var t = null; | |
return e.tax_request && (t = JSON.parse(e.tax_request)), t | |
} | |
}, angular.copy(M, O.input), O.termGate = {}, O.access = {}, angular.copy(D, O.access), O.flags.applePayCanMakePayments = !1, O.flags.selectedTerm = {}; | |
var R = {}; | |
function L() { | |
O.params.userToken = null, z({}), O.config.checkoutAuthenticationInSeparateState && O.getSelectedTerm() && O._unselectTerm(), O.resetAssociatedData(), O.config.isRedemption && !O.params.startFromInlineCheckout && l.isActive("redemption") ? l.gotoState("redemption") : l.gotoState("offer") | |
} | |
function V() { | |
O.flags.isDiscounted = !1, O.input.originalChargeAmount = O.input.chargeAmount, O.input.originalChargeCurrency = O.input.chargeCurrency, O.input.originalChargeDisplayAmount = O.input.chargeDisplayAmount | |
} | |
function F(e, t, n) { | |
util.log("[CHECKOUT] already purchased", e); | |
var r = { | |
alreadyPurchased: e.models.alreadyPurchased, | |
name: e.models.name, | |
details: e.models.details.split(";"), | |
startedAt: e.models.startedAt, | |
renewsOn: e.models.renewsOn, | |
expiresOn: e.models.expiresOn, | |
canBeRenewed: e.models.canBeRenewed, | |
canBeRenewedUsingExistedUPI: e.models.canBeRenewedUsingExistedUPI, | |
renewChargeAmount: e.models.renewChargeAmount, | |
renewChargeCurrency: e.models.renewChargeCurrency, | |
renewChargeDisplayAmount: e.models.renewChargeDisplayAmount, | |
sourceTermId: e.models.sourceTermId, | |
sourceTerm: e.models.sourceTerm, | |
renewBillingCountryCode: e.models.renewBillingCountryCode, | |
renewBillingZipCode: e.models.renewBillingZipCode, | |
renewResidenceCountryCode: e.models.renewResidenceCountryCode, | |
renewHasTax: e.models.renewHasTax | |
}; | |
if (angular.copy(r, O.access), O._selectTerm(r.sourceTerm, !0), r.canBeRenewed && (O.input.chargeAmount = r.renewChargeAmount, O.input.chargeCurrency = r.renewChargeCurrency, O.input.chargeDisplayAmount = r.renewChargeDisplayAmount, V(), O.config.hasTax = r.renewHasTax), O.billingConfig.renewBillingCountryCode = r.renewBillingCountryCode, O.billingConfig.renewBillingZipCode = r.renewBillingZipCode, O.billingConfig.renewResidenceCountryCode = r.renewResidenceCountryCode, O.config.hasTax = r.renewHasTax, e.models.renewalBillingPlan && (O.getSelectedTerm().billingPlanTable = e.models.renewalBillingPlan), e.models.renewalBillingPlanModel) { | |
var i = O.getSelectedTerm(); | |
angular.forEach(e.models.renewalBillingPlanModel, function (e, t) { | |
i[t] = e | |
}) | |
} | |
e.models.renewalOriginalBillingPlanModel && (O._findTerm(O.getSelectedTerm()).originalBillingPlan = e.models.renewalOriginalBillingPlanModel), c.fire(EVENT_USER_ACCESS_CHANGED), function (e) { | |
var t, n = O.getSelectedTerm(); | |
if (n && n.resource) t = n.resource.rid; else if (e.models.sourceTermId) { | |
var r = O._findTerm(e.models.sourceTermId); | |
r && r.resource && (t = r.resource.rid) | |
} | |
o.alreadyPurchasedEvent({rid: t}) | |
}(e), n || O.gotoAlreadyHasAccess() | |
} | |
angular.copy(R, O.flags.selectedTerm), O.flags.isRenewNow = !1, O.flags.selectedPaymentMethod = null, O.flags.termComplete = !1, O.flags.paymentComplete = !1, O.flags.termSelectorActivated = !1, O.flags.receiptActivated = !1, O.flags.hasLoginRequiredCallback = !1, O.flags.autoCompleteRegistrationTerm = !0, O.flags.needUpdateUserResources = !1, O.config = { | |
terms: [{}], | |
originalTerms: [{}], | |
additionalTerms: [{}], | |
userResources: [{}] | |
}, O.GAProccesses = 0, O.params = {}, O.redemptionLoginRequiredParams = { | |
state: null, | |
form: {redeemCode: null} | |
}, O.closeButtonTypes = { | |
default: "default", | |
boilerplate: "boilerplate" | |
}, O.SYSTEM_ERROR_CODES = { | |
100: E.trc("checkout.platform", "Please try again later"), | |
101: E.trc("checkout.platform", "Your payment is being processed. Try to refresh the page in 30 seconds") | |
}, O.init = function (e, t) { | |
var n, r; | |
l.startState = (n = "true" === getParameterByName("isCheckout"), r = "" === getParameterByName("termId"), n && r ? "state1" : "offer"); | |
var i = t.preferredWidth || 450; | |
O.flags.hasLoginRequiredCallback = "true" === getParameterByName("hasLoginRequiredCallback"), O.initConfig(), angular.copy(M, O.input), this.config.isRedemption && (l.startState = "redemption"), "true" === getParameterByName("isAuth") && (l.startState = "auth", b.currentState.name = getParameterByName("authStartScreen") || "login"); | |
var s = angular.element("#checkout-container"); | |
h.init({preferredWidth: i}, function () { | |
return {container: s} | |
}), m.init(function () { | |
return { | |
app: O.config.app, user: O.config.user, fillLoginIframeParams: function (e) { | |
e.offerId = O.config.offerId, e.templateId = O.config.offerTemplateId, e.templateVariantId = O.config.offerTemplateVariantId, e.gaClientId = O.params.gaClientId | |
}, fillLoginRequiredParamsToGoogleAnalytics: function (e) { | |
e.offerId = O.config.offerId, e.templateId = O.config.offerTemplateId, e.templateVariantId = O.config.offerTemplateVariantId | |
}, fillLoginRequiredEventParams: function (e) { | |
e.term = O._findTerm(O.params.termId || N), e.isRedemption = O.params.isRedemption, e.termId = N, e.currentState = l.getActiveState(), e.redemption = {}, angular.copy(O.redemptionLoginRequiredParams, e.redemption) | |
}, fillLoginSuccessEventParams: function (e) { | |
e.termId = N | |
} | |
} | |
}), m.onLoginSuccess(function (e) { | |
O.params.userToken = e.user_token, z(e.user), function () { | |
if (!O.isAutoCompleteRegistrationTerm()) return !1; | |
!O.isTermSelected() && O.config.terms && 1 === O.config.terms.length && "registration" === O.config.terms[0].type && J(O.config.terms[0]) | |
}() | |
}, !1), TPParam.error ? p().terminal(TPParam.error) : (TPParam.config && TPParam.config.consoleError && util.log("%c[CHECKOUT] Error: ".concat(TPParam.config.consoleError), "color: red;"), util.log("[CHECKOUT] Startup params", this.params), util.log("[CHECKOUT] Startup config", this.config), O.input.user_data.first_name = O.config.user.firstName, O.input.user_data.last_name = O.config.user.lastName, "true" == getParameterByName("allowReturnToStartState") && l.saveHistory(l.startState), t.isReload || (c.fire(EVENT_CHECKOUT_STARTED), O.params.termId ? a(function () { | |
var e = O._findTerm(O.params.termId); | |
e && e.newCustomersOnly && !O.config.isNewCustomer ? p().terminal(E.trc("term.name", e.name) + " " + E.trc("checkout.platform", "is restricted for new customers only") + " ") : (l.startState = "state1", O.startCheckout(O.params.termId)) | |
}, 0) : "offer" == l.startState ? a(function () { | |
O.startShowOffer() | |
}, 0) : "redemption" === l.startState ? a(function () { | |
o.startCheckoutEvent(O.params), O.startRedemption() | |
}, 0) : "auth" === l.startState ? a(function () { | |
O.gotoAuthState(null, function () { | |
O.close() | |
}, !0) | |
}, 0) : a(function () { | |
O.gotoCheckoutStart() | |
}, 0)), A.getParams().then(function (e) { | |
$(e.trackingId) | |
})) | |
}, O.initConfig = function () { | |
window.TPParam && window.TPParam.config && angular.copy(window.TPParam.config, O.config), window.TPParam && window.TPParam.params && angular.copy(window.TPParam.params, O.params), angular.copy(O.config.consents, M.consents) | |
}, O.updateSelectedTerm = function () { | |
var e, t = O.getSelectedTerm(); | |
t && (e = O._findTerm(t)) && (angular.forEach(this.config.terms, function (e) { | |
e.selected = !1 | |
}), e.selected = !0, angular.copy(e, O.flags.selectedTerm), O.input.chargeAmount = O.flags.selectedTerm.chargeAmount, O.input.chargeCurrency = O.flags.selectedTerm.chargeCurrency, O.input.chargeDisplayAmount = O.flags.selectedTerm.chargeDisplayAmount, O.input.canadianTaxes = O.canadianTaxes()) | |
}, O.getGeoCountryCode = function () { | |
return window.TPParam.GEO_COUNTRY_CODE | |
}, O.getCustomFormParams = function () { | |
var e, t = {}, n = window.TPParam.params.formNameByTermId; | |
if (n) { | |
var r = JSON.parse(n), o = O.input.customFormTermId; | |
o && (e = r[o]) | |
} | |
return e && (t.formName = e, t.hideCompletedFields = window.TPParam.params.hideCompletedFields || !1), t.trackingId = window.TPParam.params.trackingId, t | |
}, O.updatePromoCode = function () { | |
c.fire(EVENT_REAPPLY_PROMO_CODE) | |
}, O.updatePayWhatYouWant = function () { | |
c.fire(EVENT_REAPPLY_PAY_WANT_YOU_WANT) | |
}, O.mergeStats = function (e) { | |
e && e.models && e.models.checkoutStats && A.mergeStats(e.models.checkoutStats) | |
}, O.resize = function () { | |
h.resize() | |
}, O.updatePreferredWith = function (e) { | |
h.setPreferredWidth(e), O.resize() | |
}, O.getPreferredWidth = function () { | |
return h.getPreferredWidth() | |
}, O.allowTinypassAccountsLogin = function () { | |
return m.allowTinypassAccountsLogin() | |
}, O.allowLogout = function () { | |
return "receipt" !== l.getActiveState() && m.allowLogout() | |
}, O.allowTinypassAccountsLogout = function () { | |
return "receipt" !== l.getActiveState() && m.allowTinypassAccountsLogout() | |
}, O.logout = function () { | |
m.logout(), L() | |
}, O.resetAssociatedData = function () { | |
c.fire(EVENT_RESET_PROMO_CODE) | |
}, O.sendGoogleAnalyticsEvent = function (e, t) { | |
e && e.params && (e.params.aid = O.getAid()), y.sendGoogleAnalyticsEvent(e, t) | |
}, O.register = function () { | |
return O.login("register") | |
}, O.login = function (e) { | |
return function () { | |
if (m.isCondeUserProvider()) { | |
var t = e || "login"; | |
if (h.isModal) { | |
var n = s.defer(); | |
return b.currentState.name = t, O.gotoAuthState(null, function () { | |
"auth" === l.getActiveState() && l.gotoPreviousState(), n.resolve() | |
}, !0), n.promise | |
} | |
var r = {}; | |
return angular.copy(O.params, r), r.isAuth = !0, r.authStartScreen = t, o.startCheckoutEvent(r), s.reject() | |
} | |
return m.login(e).then(function (e) { | |
var t = e.user; | |
return K(!0, !1, t) | |
}) | |
}().then(function () { | |
return g.getAccess(O) | |
}).then(function (e) { | |
return e.data.models.alreadyPurchased && (h.isModal || h.isPopup ? F(e.data) : O._findTerm(e.data.models.sourceTermId) ? O.startCheckout(e.data.models.sourceTermId) : O.config.terms && O.config.terms.length && O.config.terms[0] && O.config.terms[0].termId && O.startCheckout(O.config.terms[0].termId)), e.data.models.alreadyPurchased | |
}) | |
}, O.startRedemption = function () { | |
function e(e) { | |
e ? l.gotoRedemptionState() : o.startCheckoutEvent(O.params) | |
} | |
O.flags.inStartCheckoutFlow = !0, O.params.isRedemption = !0, O.params.startFromInlineCheckout = !1, h.isModal || h.isPopup ? (o.startCheckoutEvent(O.params), e(!0)) : (O.params.termId = null, O.params.startFromInlineCheckout = !0, e(!1)), O.flags.inStartCheckoutFlow = !1 | |
}, O.gotoRedemptionState = function () { | |
l.gotoRedemptionState() | |
}, O.isExternalCheckoutAvailable = function (e) { | |
return P.isAvailableForTerm(e) | |
}, O.startExternalCheckout = function (e) { | |
P.startCheckout(e).then(function () { | |
O.sendGoogleAnalyticsEvent({ | |
eventAction: "externalReceiptDisplayed", | |
eventLabel: "External receipt displayed", | |
params: { | |
offerId: O.config.offerId, | |
templateId: O.config.offerTemplateId, | |
templateVariantId: O.config.offerTemplateVariantId | |
} | |
}) | |
}) | |
}, O.getExternalCheckoutConfig = function () { | |
return P.getUiConfig() | |
}, O.startCheckout = function (e) { | |
var t = e && "object" == typeof e ? e.termId : e; | |
if (N = t, O.canCheckout()) { | |
if (O.notify("[CHECKOUT] Starting checkout with termId:" + t), A.mergeStats({ | |
promo_code: "", | |
promotion_id: "", | |
promo_state: 0 | |
}), O.input.promotionBillingPlan = null, t && (O.params.termId = t), o.startCheckoutEvent(O.params), !h.isInline) if (t) { | |
var n = O._findTerm(t); | |
n ? O.selectTerm(n) : g.getAccess(O).then(function (e) { | |
O.gotoCheckoutStart(), e.data.models.alreadyPurchased && F(e.data) | |
}) | |
} else O.gotoCheckoutStart() | |
} else m.loginSuccessPosted() || m.login("register").then(function (e) { | |
return K(!0, !1, e.user) | |
}).then(function () { | |
O.startCheckout(t) | |
}) | |
}, O.allowRedemption = function () { | |
return O.config.redemptionEnabled | |
}, O.systemError = function (e) { | |
o.systemErrorEvent({message: e}) | |
}, O.notify = function (e, t) { | |
}, O.updatePaymentMethods = function (e) { | |
var t = O.flags.selectedTerm.isSubscription ? O.flags.selectedTerm.subscriptionPaymentMethods : O.flags.selectedTerm.oneOffPaymentMethods; | |
t || (t = []), util.log("[CHECKOUT] Selecting new payment methods list", t), angular.copy(t, O.input.paymentMethods), function () { | |
if (!O.flags.applePayCanMakePayments) { | |
var e = []; | |
angular.forEach(O.input.paymentMethods, function (t) { | |
t.id !== window.APPLE_PAY_BT && t.id !== window.APPLE_PAY_SS && e.push(t) | |
}), angular.copy(e, O.input.paymentMethods) | |
} | |
}(); | |
var n, r = !e; | |
if (O.input.paymentMethods && 1 == O.input.paymentMethods.length && void 0 !== O.input.paymentMethods[0].id) n = O.selectPaymentMethod(O.input.paymentMethods[0], r); else if (O.flags.selectedPaymentMethod && void 0 !== O.flags.selectedPaymentMethod.id) n = O.selectPaymentMethod(O.flags.selectedPaymentMethod, r); else { | |
var o, i = window.ApplePaySession; | |
angular.forEach(O.input.paymentMethods, function (e) { | |
e.id !== window.APPLE_PAY_BT && e.id !== window.APPLE_PAY_SS || (o = e) | |
}), i && o && (n = O.selectPaymentMethod(o, !1)) | |
} | |
return n ? s.all([n]).then(function () { | |
O.isZeroPayment() || c.fire(EVENT_CHECKOUT_PAYMENT_METHODS_CHANGED, O.input.paymentMethods) | |
}) : (O.isZeroPayment() || c.fire(EVENT_CHECKOUT_PAYMENT_METHODS_CHANGED, O.input.paymentMethods), s.when(!1)) | |
}, O.canCheckout = function () { | |
return !(O.config.settings.requiresValidUser && !1 === O.isUserValid() && !O.canInitCheckoutWithAnon()) || O.isPasswordlessCheckoutEnabled() | |
}, O.selectTerm = function (e, t, n, r, a) { | |
if ("inline" === window.TPParam.params.displayMode) return O.startCheckout(e), s.reject(); | |
var c = t; | |
if (c || (c = O.params.offerId), "string" == typeof e && !(e = O._findTerm(e))) return p(O.$rootScope).reset(), p(O.$rootScope).global(E.trc("checkout.platform", "Term not found")), O.enabledCheckout(), s.reject(); | |
if (e.termId === O.input.termId && !a) return O.enabledCheckout(), s.reject(); | |
if (!O.canCheckout()) return O.enabledCheckout(), s.reject(); | |
var l = e; | |
return p(O.$rootScope).reset(), l.newCustomersOnly && !O.config.isNewCustomer ? (p(O.$rootScope).global(E.trc("term.name", l.name) + " " + E.trc("checkout.platform", "is restricted for new customers only") + " "), O.enabledCheckout(), s.reject()) : l.restrictCheckoutProcess ? (l.sellDate ? p(O.$rootScope).global(E.trc("term.name", l.name) + " " + E.trc("checkout.platform", "sales start on") + " " + l.sellDate) : l.hasFinishedSales ? p(O.$rootScope).global(E.trc("term.name", l.name) + " " + E.trc("checkout.platform", "sales of the old season has finished and the sales of new season have not started yet")) : p(O.$rootScope).global(E.trc("term.name", l.name) + " " + E.trc("checkout.platform", "sales have not started yet")), O.enabledCheckout(), s.reject()) : "registration" === l.type ? O.gotoAuthState(function () { | |
if (N = e.termId, O.input.customFormTermId = e.termId, O.isDoubleOptInEnabled()) return u(!0) | |
}, function () { | |
return J(e) | |
}) ? (O.enabledCheckout(), s.reject()) : (d(), u()) : (d(), h().then(function (t) { | |
if ((O.hasExternalVerificationGate() || O.isRequirePrintAddress() || "gift" === l.type && !O.input.giftParamsFormFilled || O.config.checkoutAuthenticationInSeparateState || O.isPasswordlessCheckoutEnabled() && !O.isSingleStepEnabled()) && !O.isUserValid()) { | |
var n = s.defer(); | |
return O.gotoAuthState(function () { | |
N = e.termId, O.input.customFormTermId = e.termId | |
}, function () { | |
m.isUserValid() && !m.isUserConfirmed() ? n.reject() : n.resolve(t) | |
}, !0), n.promise | |
} | |
return s.when(t) | |
}).then(function (e) { | |
return f(e) | |
})); | |
function u(e) { | |
return h().then(function (t) { | |
return f(t, e) | |
}) | |
} | |
function d() { | |
O.input.termId = e.termId, O.input.offerId = c, O.input.customFormTermId = e.termId, angular.copy(D, O.access) | |
} | |
function f(t, i) { | |
t.models.alreadyPurchased ? F(t, l.termId, r) : i || (O._selectTerm(e, n, r), o.postMessage("selectTerm", {alreadyPurchased: O.access.alreadyPurchased}), O.gotoNextState(r)), o.postMessage("selectTerm", {alreadyPurchased: O.access.alreadyPurchased}) | |
} | |
function h() { | |
return O.disableCheckout(), i.createOrder(O, e.termId, c, O.params.templateId).then(function (e) { | |
util.log("[CHECKOUT] order created", e), O.input.oid = e.models.oid, O.input.isTermLockedByPromocode = e.models.isTermLockedByPromocode, angular.copy(D, O.access), angular.copy(x, O.termGate), angular.copy(e.models.user, O.config.user); | |
var t = { | |
id: e.models.termGateId, | |
externalApiTitle: e.models.externalApiTitle, | |
externalApiApplyButtonName: e.models.externalApiApplyButtonName, | |
externalApiVerifyNew: e.models.externalApiVerifyNew, | |
externalApiConfigurationId: e.models.externalApiConfigurationId, | |
externalApiFields: e.models.externalApiFields, | |
externalVerificationStatus: e.models.externalVerificationStatus, | |
externalVerificationConversionId: e.models.externalVerificationConversionId, | |
externalApiSource: e.models.externalApiSource, | |
externalApiFieldCountry: e.models.externalApiFieldCountry, | |
externalApiSavedForms: e.models.externalApiSavedForms, | |
externalApiPrepopulationForm: e.models.externalApiPrepopulationForm, | |
adrCollectionAvailableAddresses: e.models.adrCollectionAvailableAddresses, | |
adrCollectionCountries: e.models.adrCollectionCountries, | |
adrCollectionEnabled: e.models.adrCollectionEnabled, | |
adrDefaultCountry: e.models.adrDefaultCountry, | |
adrPrepopulationForm: e.models.adrPrepopulationForm | |
}; | |
return t.externalApiFields && t.externalApiFields.length && angular.forEach(t.externalApiFields, function (e) { | |
e.value = e.defaultValue | |
}), angular.copy(t, O.termGate), O.flags.isDiscounted = !1, s.when(e) | |
}).catch(function (e) { | |
var t; | |
return "object" == typeof e && (e.errors && e.errors.length ? t = e.errors[0].message || e.errors[0].msg : e.message && (t = e.message)), t ? getParameterByName("termId") ? p().terminal(E.trc("service.error.codes", t)) : p(O.$rootScope).global(E.trc("service.error.codes", t)) : p().terminal(E.trc("checkout.platform", "Create order failed")), O._unselectTerm(), s.reject(e) | |
}).finally(function () { | |
O.enabledCheckout() | |
}) | |
} | |
}, O.isSelectedTermLocked = function () { | |
return O.flags && O.flags.selectedTerm && O.input && O.input.isTermLockedByPromocode && !O.input.validUnlockPromoCode && !O.access.alreadyPurchased | |
}, O.isPaymentMethodRequired = function () { | |
return O.getSelectedTerm().isPaymentMethodRequired | |
}, O.hasExternalVerificationGate = function () { | |
return O.termGate.externalApiConfigurationId && "accepted" != O.termGate.externalVerificationStatus | |
}, O.isRequirePrintAddress = function () { | |
return O.termGate.adrCollectionEnabled && !O.termGate.adrCollectionSucceeded | |
}, O.isZeroPayment = function () { | |
return O.flags && O.flags.selectedPaymentMethod && O.flags.selectedPaymentMethod.id == ZERO | |
}, O.checkoutWithNewTerm = function (e, t) { | |
O.selectTerm(e, t, !0, !1), "gift" === e.type ? O.gotoGiftParams() : O.gotoPaymentState(e, t) | |
}, O.getWidthTerm = function () { | |
return h.getNewWidth() | |
}, O.softResetDiscount = function () { | |
return !0 === O.flags.isDiscounted ? (O.resetDiscount(), O.updatePaymentMethods(!0)) : s.when(!1) | |
}, O.resetDiscount = function () { | |
if (O.flags.isDiscounted = !1, O.input.promoCodeId = null, O.input.promoCodeTermId = null, O.input.originalChargeAmount && (O.input.chargeAmount = O.input.originalChargeAmount, O.input.chargeCurrency = O.input.originalChargeCurrency, O.input.chargeDisplayAmount = O.input.originalChargeDisplayAmount, O.input.promotionBillingPlan = null, delete O.input.originalChargeAmount, delete O.input.originalChargeCurrency, delete O.input.originalChargeDisplayAmount), angular.forEach(this.config.terms, function (e) { | |
e.originalBillingPlan && (angular.forEach(e.originalBillingPlan, function (t, n) { | |
e[n] = t | |
}), delete e.originalBillingPlan) | |
}), O.updateSelectedTerm(), O.isZeroPayment()) { | |
var e = null; | |
O.input.paymentMethods && 1 == O.input.paymentMethods.length && (e = O.input.paymentMethods[0]), O.flags.selectedPaymentMethod = e | |
} | |
return c.fire(EVENT_CHECKOUT_PRICE_CHANGED), s.when(!1) | |
}, O.getAid = function () { | |
return O.params.aid | |
}, O.getDoubleOptInParams = function () { | |
return A.getStats().then(function (e) { | |
var t = {}; | |
return angular.copy(O.params, t), O.getLoginTermId() && (t.termId = O.getLoginTermId()), O.input.oid && (t.oid = O.input.oid), { | |
tbc: e.tbc, | |
params: t | |
} | |
}) | |
}, O.discountSelectedTerm = function (e, t, n, r, o, i) { | |
util.log("[CHECKOUT] Discounting selected with:", e, t, n), V(), O.flags.isDiscounted = !0, O.input.chargeAmount = e, O.input.chargeCurrency = t, O.input.chargeDisplayAmount = n, O.input.promotionBillingPlan = r, O.input.promoCodeId = o, O.input.promoCodeTermId = i | |
}, O._selectTerm = function (e, t, n) { | |
var r; | |
if (r = t ? e : O._findTerm(e)) { | |
if (util.log("[CHECKOUT] Selecting term", r), angular.forEach(this.config.terms, function (e) { | |
e.selected = !1 | |
}), r.selected = !0, angular.copy(r, O.flags.selectedTerm), O.input.chargeAmount = O.flags.selectedTerm.chargeAmount, O.input.chargeCurrency = O.flags.selectedTerm.chargeCurrency, O.input.chargeDisplayAmount = O.flags.selectedTerm.chargeDisplayAmount, O.input.canadianTaxes = O.canadianTaxes(), O.input.customFormTermId = O.flags.selectedTerm.termId, n) return; | |
angular.copy({}, O.flags.selectedPaymentMethod), delete O.input.promoCode, c.fire(EVENT_CHECKOUT_TERM_SELECTED, r); | |
var i = { | |
termName: r.name, | |
termId: r.termId, | |
resourceName: r.resource.name, | |
resourceId: r.resource.rid | |
}; | |
o.customEvent("checkoutSelectTerm", i), O.sendGoogleAnalyticsEvent({ | |
eventAction: "termSelected", | |
eventLabel: "Term selected", | |
params: { | |
offerId: O.config.offerId, | |
templateId: O.config.offerTemplateId, | |
templateVariantId: O.config.offerTemplateVariantId, | |
termId: r.termId | |
} | |
}) | |
} else util.log("Did not find existing term for", e) | |
}, O._unselectTerm = function () { | |
angular.forEach(this.config.terms, function (e) { | |
e.selected = !1 | |
}); | |
O.flags.selectedTerm; | |
var e = O.input.zipCode; | |
angular.copy(M, O.input), angular.copy(R, O.flags.selectedTerm), angular.copy(M.consents, O.input.consents), O.params.termId = null, O.input.user_data.first_name = O.config.user.firstName, O.input.user_data.last_name = O.config.user.lastName, O.input.zipCode = e, O.input.customFormTermId = null | |
}, O._findTerm = function (e) { | |
if (null === e) return null; | |
var t = e; | |
"object" == typeof e && e.termId && (t = e.termId); | |
var n = null; | |
return angular.forEach(this.config.terms, function (e) { | |
e.termId === t && (O.notify("[CHECKOUT] Found existing term:" + t), n = e) | |
}), n | |
}; | |
var U, B = !1; | |
function H() { | |
h.purge({alreadyPurchased: O.access.alreadyPurchased, completePayment: O.flags.termComplete}) | |
} | |
function W() { | |
var e = O.getSelectedTerm(); | |
return e && e.newCustomersOnly && !O.config.isNewCustomer ? (p().terminal(E.trc("term.name", e.name) + " " + E.trc("checkout.platform", "is restricted for new customers only") + " "), s.reject(!1)) : s.when(!0) | |
} | |
O.selectPaymentMethod = function (e, t) { | |
if (!0 === B) return s.when(!1); | |
O.flags.selectedPaymentMethod = null, angular.forEach(this.input.paymentMethods, function (t) { | |
t.selected = !1, e && t.id === e.id && (O.notify("[CHECKOUT] Payment method selected:" + e.name), t.selected = !0, O.flags.selectedPaymentMethod = t) | |
}); | |
var n = O.flags.isRenewNow; | |
return O.reload(void 0, n).then(function (e) { | |
if ((e || O.flags.isRenewNow) && O.flags.selectedPaymentMethod && !t) return B = !0, i.initiatePurchase(O).finally(function () { | |
B = !1 | |
}) | |
}) | |
}, O.startRenewal = function () { | |
O.flags.isRenewNow = !0, O.selectTerm(O.flags.selectedTerm, null, !1, !0, !0).then(function () { | |
O.access && O.access.alreadyPurchased && !O.access.canBeRenewed ? O._showSubscriptionHasAlreadyRenewed() : (O.access.inRenewal = !0, O.gotoPaymentState(O.flags.selectedTerm)) | |
}) | |
}, O.startShowOffer = function () { | |
l.gotoState("offer") | |
}, O.gotoNextState = function (e, t, n) { | |
var r, o = O.getSelectedTerm(), a = O._findTerm(o); | |
t && l.viewStack.pop(), m.isPianoIdUserProvider() && m.isUserValid() && !m.isUserConfirmed() ? r = function () { | |
"auth" !== l.getActiveState() && l.gotoState("user-non-confirmed") | |
} : O.isSelectedTermLocked() ? r = O.gotoLockedPromoCode : O.hasExternalVerificationGate() ? r = O.gotoExternalVerificationState : O.isRequirePrintAddress() ? r = O.gotoPrintAddress : "gift" !== a.type || O.input.giftParamsFormFilled ? e || (r = function () { | |
O.gotoPaymentState(o, void 0, n), m.isUserValid() || m.onLoginSuccess(function (e) { | |
K(!0, O.config.preventReloadAfterLogin, e.user); | |
var t = c.subscribe(EVENT_CHECKOUT_RELOADED, function () { | |
t(), O.flags.selectedPaymentMethod && (n || i.initiatePurchase(O)) | |
}) | |
}, !0) | |
}) : r = O.gotoGiftParams, !e && r ? r() : e && !r && (n || i.purchaseStarting(O, a)) | |
}, O.gotoPaymentState = function (e, t, n) { | |
var r = t; | |
r || (r = O.params.offerId), n || i.purchaseStarting(O, e), O.isPaymentMethodRequired() ? l.gotoPaymentState({ | |
termId: e.termId, | |
term: e, | |
offerId: r, | |
paySource: O.params.paySource | |
}) : O.gotoReceipt() | |
}, O.gotoCheckoutStart = function () { | |
O.flags.termSelectorActivated = !0; | |
var e = l.gotoTermSelectorState(); | |
if (l.isPaymentFormState(e) && O.config.terms && O.config.terms.length) { | |
for (var t = O.config.terms[0], n = 0; n < O.config.terms.length; n++) { | |
var r = O.config.terms[n]; | |
if (!r.newCustomersOnly || O.config.isNewCustomer) { | |
t = r; | |
break | |
} | |
} | |
var o = !0; | |
O.config.checkoutAuthenticationInSeparateState && !O.isUserValid() && (o = !1), O.selectTerm(t, null, !1, o) | |
} | |
}, O.gotoReceipt = function () { | |
return O.sendGoogleAnalyticsEvent({ | |
eventAction: "receiptDisplayed", | |
eventLabel: "Receipt displayed", | |
params: { | |
offerId: O.config.offerId, | |
templateId: O.config.offerTemplateId, | |
templateVariantId: O.config.offerTemplateVariantId | |
} | |
}), O.flags.receiptActivated = !0, l.disable(!0), l.gotoState("receipt", {term: O._findTerm(O.params.termId)}) | |
}, O.gotoAlreadyHasAccess = function () { | |
return l.gotoState("alreadyHasAccess", {term: O._findTerm(O.params.termId)}) | |
}, O.gotoUserLogin = function () { | |
return l.gotoState("userLogin") | |
}, O.gotoLockedPromoCode = function () { | |
return l.gotoState("lockedPromoCode", {term: O._findTerm(O.params.termId)}) | |
}, O.gotoExternalVerificationState = function () { | |
return O.termGate.externalVerificationStatus = null, l.gotoState("externalVerification", {term: O._findTerm(O.params.termId)}) | |
}, O.gotoConfirmation = function () { | |
return l.gotoState("confirmation", {term: O._findTerm(O.params.termId)}) | |
}, O.goToBankSecureState = function () { | |
return l.gotoState("bankSecure") | |
}, O.gotoAuthState = function (e, t, n) { | |
return !O.isUserValid() && (e && (r = e()), r && "function" == typeof r.then ? r.then(function () { | |
return o() | |
}) : o()); | |
var r; | |
function o() { | |
if (t || (t = function () { | |
"auth" === l.getActiveState() && l.gotoPreviousState() | |
}), n) { | |
var e = t; | |
t = function (e) { | |
K(!0, O.config.preventReloadAfterLogin, e.user) | |
}, O.onUserChanged().then(function () { | |
e() | |
}) | |
} | |
return m.onLoginSuccess(t, !0), p(O.$rootScope).reset(), l.gotoState("auth"), !0 | |
} | |
}, O.onUserChanged = function () { | |
var e = s.defer(), t = m.isUserValid(), n = c.subscribe(EVENT_CHECKOUT_RELOADED, function () { | |
t !== m.isUserValid() && (n(), i.waitInitPurchase().then(function () { | |
e.resolve() | |
})) | |
}); | |
return e.promise | |
}, O.gotoPrintAddress = function () { | |
O.termGate.adrCollectionSucceeded = !1, l.gotoState("printAddress", O._findTerm(O.params.termId)) | |
}, O.gotoGiftParams = function () { | |
O.input.giftParamsFormFilled = !1, l.gotoState("giftParams", {term: O._findTerm(O.params.termId)}) | |
}, O.close = function () { | |
h.close({alreadyPurchased: O.access.alreadyPurchased, completePayment: O.flags.termComplete}) | |
}, O.isUserValid = function () { | |
return m.isUserValid() | |
}, O.isNewCustomer = function () { | |
return O.config.isNewCustomer | |
}, O.canInitCheckoutWithAnon = function () { | |
return O.config.app && !0 === O.config.app.canInitCheckoutWithAnon | |
}, O.fireCheckoutPaymentErrorEvent = function () { | |
var e = p(t).errors(!1); | |
angular.forEach(e, function (e) { | |
o.checkoutPaymentErrorEvent(e.message) | |
}) | |
}, O.completePayment = function () { | |
o.submitPayment({term: O._findTerm(O.params.termId)}); | |
var e = s.defer(), n = function () { | |
e.resolve(), O.enabledCheckout() | |
}, r = function () { | |
e.reject(), O.enabledCheckout() | |
}; | |
return O.disableCheckout(), p(O.$rootScope).reset(), l._validateViews().then(function () { | |
p(O.$rootScope).reset(); | |
O.checkConsents(!0).then(function () { | |
return I.loginUser(O) | |
}).then(function () { | |
return W() | |
}).then(function () { | |
i.processPurchase(O, a, c) | |
}).catch(r) | |
}).catch(function () { | |
util.log("[CHECKOUT] Validation on completePayment has failed"), O.fireCheckoutPaymentErrorEvent(), r() | |
}), e.promise; | |
function a(e) { | |
w.logEvent("successPurchase", {async_processing: e ? e.async_processing : "params not provided"}), "true" == e.async_processing ? (util.log("[CHECKOUT] Asynchronous processing. Completing and granting provisional access", e), angular.copy(JSON.parse(e.receipt), O.input.receipt), O.GAProccesses++, O.sendGoogleAnalyticsEvent({ | |
eventAction: "checkoutSuccess", | |
eventLabel: "Checkout success", | |
params: { | |
offerId: O.offerId, | |
templateId: O.config.offerTemplateId, | |
templateVariantId: O.config.offerTemplateVariantId | |
} | |
}, function () { | |
setTimeout(function () { | |
O.GAProccesses-- | |
}, 3e3) | |
}), o.completeEvent(O.input.receipt), O.gotoReceipt().finally(n)) : (util.log("[CHECKOUT] completing term", e), O._completeTerm(e).finally(n)) | |
} | |
function c(e) { | |
if ("object" == typeof e && e.models && e.models.alreadyPurchased) return F(e, O.getSelectedTerm().termId, !1), void r(); | |
var n; | |
"object" == typeof e ? e.errors && e.errors.length ? n = e.errors[0].message || e.errors[0].msg : e.message && (n = e.message) : "string" == typeof e && (n = e), n && (p(t).global(E.trc("service.error.codes", n)), O.fireCheckoutPaymentErrorEvent()), r(), i.initiatePurchase(O) | |
} | |
}, O.confirmPayment = function () { | |
var e = s.defer(), n = function () { | |
e.resolve(), O.enabledCheckout() | |
}, r = function () { | |
e.reject(), O.enabledCheckout() | |
}; | |
return O.disableCheckout(), p(t).reset(), l._validateViews().then(function () { | |
O.checkConsents(!1).then(function () { | |
return I.loginUser(O) | |
}, r).then(function () { | |
i.confirmPayment(O).then(function (e) { | |
O.input.confirmated.billingPlan = e.models.billingPlan, O.input.confirmated.taxAmount = e.models.taxAmount, O.input.confirmated.chargeAmount = e.models.chargeAmount, O.input.confirmated.amount = e.models.amount, O.input.confirmated.total = e.models.total, O.input.confirmated.taxRate = e.models.taxRate, O.input.confirmated.taxAmount = e.models.taxAmount, O.input.confirmated.hstRate = e.models.hstRate, O.input.confirmated.hstAmount = e.models.hstAmount, O.input.confirmated.qstRate = e.models.qstRate, O.input.confirmated.qstAmount = e.models.qstAmount, O.input.confirmated.pstRate = e.models.pstRate, O.input.confirmated.pstAmount = e.models.pstAmount, O.input.confirmated.gstRate = e.models.gstRate, O.input.confirmated.gstAmount = e.models.gstAmount, O.input.canadianTaxes = O.canadianTaxes(), O.gotoConfirmation().finally(n) | |
}, function (e) { | |
e && e.errors && e.errors.length > 0 && e.errors[0].msg ? p(t).global(E.trc("service.error.codes", e.errors[0].msg)) : p().terminal(E.tr("Confirmation order failed")), r() | |
}) | |
}, function () { | |
r() | |
}) | |
}, function () { | |
util.log("[CHECKOUT] Validation on confirmPayment has failed"), O.fireCheckoutPaymentErrorEvent(), r() | |
}), e.promise | |
}, O.checkConsents = function (e) { | |
var t = s.defer(), n = i.checkConsentsFunction(); | |
function r(e) { | |
e && e.length && (angular.forEach(e, function (e) { | |
e.message = e.msg | |
}), p(O.$rootScope).globals(e)) | |
} | |
return n && !0 === e ? n(O).then(t.resolve).catch(function (e) { | |
r(e), t.reject() | |
}) : C.isNeeded(O) ? C(O).then(t.resolve()).catch(function (e) { | |
r(e.errors), t.reject() | |
}) : t.resolve(), t.promise | |
}, O._showSubscriptionHasAlreadyRenewed = function () { | |
p().terminal(E.trc("checkout.platform", "The subscription has already been renewed")) | |
}, O._completeTerm = function (e) { | |
var n = s.defer(); | |
return e.first_name = O.input.user_data.first_name, e.last_name = O.input.user_data.last_name, e.url = O.params.url, p(t).reset(), i.completePurchase(O, O.input.oid, e, function (e) { | |
w.logEvent("completePurchaseSuccess"), O.flags.termComplete = !0, angular.copy(e.receipt, O.input.receipt), O.GAProccesses++, O.sendGoogleAnalyticsEvent({ | |
eventAction: "checkoutSuccess", | |
eventLabel: "Checkout success", | |
params: { | |
offerId: O.config.offerId, | |
templateId: O.config.offerTemplateId, | |
templateVariantId: O.config.offerTemplateVariantId | |
} | |
}, function () { | |
setTimeout(function () { | |
O.GAProccesses-- | |
}, 3e3) | |
}), o.completeEvent(O.input.receipt), O.gotoReceipt().finally(n.resolve), document.cookie = "ch_sid=; Path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;", O.enabledCheckout() | |
}, function (e) { | |
w.logEvent("completePurchaseError"), "object" == typeof e && e.models && e.models.renewalSubscriptionLockException ? O._showSubscriptionHasAlreadyRenewed() : (O.enabledCheckout(), n.reject()) | |
}), n.promise | |
}, O.isTermSelected = function () { | |
return null != this.flags.selectedTerm && this.flags.selectedTerm.selected | |
}, O.getSelectedTerm = function () { | |
return this.flags.selectedTerm | |
}, O.getLoginTermId = function () { | |
return N | |
}, O.isPaymentMethod = function (e) { | |
return O.isPaymentMethodSelected() && this.flags.selectedPaymentMethod.id === e | |
}, O.isPaymentMethodSelected = function () { | |
return O.flags.selectedPaymentMethod && null != O.flags.selectedPaymentMethod | |
}, O.getPaymentMethodId = function () { | |
return this.flags && this.flags.selectedPaymentMethod && this.flags.selectedPaymentMethod.id | |
}, O.isPayWhatYouWantTerm = function () { | |
return O.flags.selectedTerm.billingPlanTable && 1 == O.flags.selectedTerm.billingPlanTable.length && "true" == O.flags.selectedTerm.billingPlanTable[0].isPayWhatYouWant | |
}, O.isPaymentTerm = function (e) { | |
return e && "payment" === e.type | |
}, O.isExternalTerm = function (e) { | |
return e && "external" === e.type | |
}, O.isGiftTerm = function (e) { | |
return e && "gift" === e.type | |
}, O.isPayableTerm = function (e) { | |
return O.isPaymentTerm(e) || O.isGiftTerm(e) | |
}, O.isChargingTerm = function (e) { | |
return e && !e.isZero && !e.hasFreeTrial && O.isPayableTerm(e) | |
}, O.isRegistrationTerm = function (e) { | |
return e && "registration" === e.type | |
}, O.isSelectedTermAutoRenewChoiceAvailable = function () { | |
return O.flags.selectedTerm.isSubscription && !O.flags.selectedTerm.forceAutoRenew && (O.access && !O.access.alreadyPurchased || !O.access) && "gift" !== O.flags.selectedTerm.type | |
}, O.isConfirmStepEnabled = function () { | |
return O.config.isConfirmStepEnabled && (O.hasTax() || O.isTaxCnbcEnabled()) | |
}, O.isDoubleOptInEnabled = function () { | |
return O.config.isDoubleOptInEnabled | |
}, O.isPasswordlessCheckoutEnabled = function () { | |
return O.config.isPasswordlessCheckoutEnabled | |
}, O.isSingleStepEnabled = function () { | |
return O.config.isSingleStepEnabled | |
}, O.isPromoCodeApplyWithoutUserEnabled = function () { | |
return O.config.isPromoCodeApplyWithoutUserEnabled | |
}, O.hasAccess = function (e) { | |
return O.flags.needUpdateUserResources && (O.flags.needUpdateUserResources = !1, g.getUserResource(O).then(function (e) { | |
angular.copy(e.data.models.userResources, O.config.userResources) | |
})), O.config.userResources.indexOf(e) > -1 | |
}, O.hasResources = function (e) { | |
if (!e) return !1; | |
if (!O.flags.selectedTerm || !O.flags.selectedTerm.resource || !O.flags.selectedTerm.resource.rid) return !1; | |
var t = []; | |
return "string" == typeof e && (t = ~e.indexOf(",") ? e.replace(/\s/gm, "").split(",") : [e]), Array.isArray(e) && (t = e.slice(0)), t.some(function (e) { | |
return e === O.flags.selectedTerm.resource.rid | |
}) | |
}, O.setAsDefaultPaymentMethod = function (e) { | |
return g.setAsDefaultPaymentMethod(e).then(function (e) { | |
var t = e.data.models, | |
n = t && t.applyResult && t.applyResult.updateFailedSubscriptionPubIds || {}, | |
r = t && t.applyResult && t.applyResult.updatedSubscriptionPubIds || []; | |
return Object.keys(n).length > 0 ? (console.error(n), p(O.$rootScope).reset(), r.length > 0 ? p(O.$rootScope).global(E.trc("checkout.platform", "Could not apply payment method to all subscriptions")) : p(O.$rootScope).global(E.trc("checkout.platform", "Could not apply payment method"))) : 0 === r.length && p(O.$rootScope).global(E.trc("checkout.platform", "No active subscriptions")), { | |
updated: r.length, | |
failed: Object.keys(n).length | |
} | |
}).catch(function (e) { | |
p(O.$rootScope).reset(), p(O.$rootScope).global(e.data.errors[0].msg) | |
}) | |
}, O.canSelectPaymentMethod = function () { | |
return O.input.paymentMethods && O.input.paymentMethods.length > 1 && !O.isZeroPayment() | |
}, O.hasMultiplePaymentMethods = function () { | |
return O.input.paymentMethods && O.input.paymentMethods.length > 1 | |
}, O.resetPaymentSelection = function () { | |
angular.forEach(this.input.paymentMethods, function (e) { | |
e.selected = !1 | |
}), O.flags.selectedPaymentMethod = null | |
}, O.isMockUsed = function () { | |
return O.config && O.config.useMock | |
}, O.isPreviewMod = function () { | |
return !(!O.params || !O.params.preview || !0 !== O.params.preview && "true" !== O.params.preview) | |
}, O.disableCheckout = function () { | |
tinypass.showWaitPanel("checkoutDisable", '<div id="lock-modal-overlay"></div>') | |
}, O.enabledCheckout = function () { | |
tinypass.hideWaitPanel("checkoutDisable") | |
}, O.isPromoCodeAvailable = function () { | |
var e = O.getSelectedTerm(); | |
return !e.isCustomPriceAvailable && e.allowPromoCodes && !O.input.validUnlockPromoCode && (O.access || O.access && !O.access.alreadyPurchased) | |
}, O.reload = function (e, t) { | |
var n = Q(e); | |
return n.countryCode = O.getBillingCountryCode(), n.residenceCountryCode = O.getResidenceCountryCode(), n.billingZipCode = O.getBillingZipCode(), n.zipCode = O.input.zipCode, n.oid = O.input.oid, n.promoCodeId = O.input.promoCodeId, n.promoCodeTermId = O.input.promoCodeTermId, O.flags.selectedPaymentMethod && void 0 !== O.flags.selectedPaymentMethod.id && (n.paySourceId = O.flags.selectedPaymentMethod.id), g.getOffer(n, O).then(function (e) { | |
util.log("CHECKOUT - RELOAD", getParameterByName("iframeId"), e); | |
var r = !1; | |
return window.TPParam.config = e.models.config, window.TPParam.params = n, O.initConfig(), O.updateSelectedTerm(), z(O.config.user), !O.isUserValid() && m.loginSuccessPosted() && m.setLoginSuccessPosted(!1), !O.config.settings.requiresValidUser || O.isUserValid() || O.canInitCheckoutWithAnon() || l.isActive("auth") || O.isPasswordlessCheckoutEnabled() && O.isSingleStepEnabled() || L(), O.updatePayWhatYouWant(), e.models.alreadyPurchased && O.getSelectedTerm() && (F(e, O.getSelectedTerm().termId, t), r = !0), W(), c.fire(EVENT_CHECKOUT_RELOADED), !r | |
}, function () { | |
return p().terminal(E.trc("checkout.platform", "Reload failed")), !1 | |
}) | |
}, O.getBillingCountryCode = function () { | |
return O.billingConfig.countryCode | |
}, O.isSameResidence = function () { | |
return O.billingConfig.sameResidence | |
}, O.getRequiredZipCode = function () { | |
return O.billingConfig.requiredZipCode || !1 | |
}, O.getBillingZipCode = function () { | |
return O.billingConfig.zipCode | |
}, O.getResidenceCountryCode = function () { | |
return O.billingConfig.residenceCountryCode | |
}, O.isTaxCnbcEnabled = function () { | |
return S.contains(O.config.taxSupports, "tax.cnbc") | |
}, O.isVatEuEnabled = function () { | |
var e = S.contains(O.config.taxSupports, "vat.eu"); | |
return e && O.config.taxSupports.length > 1 ? "vat.eu" === O.billingConfig.countryTaxSupport : e | |
}, O.isBillingCountryEnabled = function () { | |
return O.isVatMXEnabled() || O.isVatAUEnabled() || O.isVatNOEnabled() || O.isVatJPEnabled() || O.isVatChEnabled() || O.isVatCanadaEnabled() || O.isVatEuEnabled() || O.isTaxUsEnabled() || O.isCustomVatEnabled() | |
}, O.isEuBillingCountryLabel = function () { | |
return O.billingConfig.needResidence | |
}, O.isUsBillingCountryLabel = function () { | |
return !O.billingConfig.needResidence | |
}, O.isVatMXEnabled = function () { | |
return S.contains(O.config.taxSupports, "vat.mx") && !O.isVatEuEnabled() | |
}, O.isVatAUEnabled = function () { | |
return S.contains(O.config.taxSupports, "vat.au") && !O.isVatEuEnabled() | |
}, O.isVatNOEnabled = function () { | |
return S.contains(O.config.taxSupports, "vat.no") && !O.isVatEuEnabled() | |
}, O.isVatJPEnabled = function () { | |
return S.contains(O.config.taxSupports, "vat.jp") && !O.isVatEuEnabled() | |
}, O.isVatChEnabled = function () { | |
return S.contains(O.config.taxSupports, "vat.ch") && !O.isVatEuEnabled() | |
}, O.isCustomVatEnabled = function () { | |
return S.contains(O.config.taxSupports, "custom.vat") && !O.isVatEuEnabled() | |
}, O.isVatCanadaEnabled = function () { | |
return S.contains(O.config.taxSupports, "vat.canada") && !O.isVatEuEnabled() | |
}, O.isTaxUsEnabled = function () { | |
return S.contains(O.config.taxSupports, "tax.us") && !O.isVatEuEnabled() | |
}, O.hasTax = function () { | |
return O.config.hasTax | |
}, O.isVatColumnVisible = function () { | |
return O.hasTax() && O.billingConfig.taxIncludeBilling && O.billingConfig.showVAT | |
}, O.getVatLabel = function () { | |
return O.billingConfig.vatLabel | |
}, O.toggleVatColumn = function () { | |
O.billingConfig.showVAT = !O.billingConfig.showVAT | |
}, O.isVatColumnAvailable = function () { | |
return O.hasTax() && O.billingConfig.taxIncludeBilling | |
}, O.isTaxColumnVisible = function () { | |
return O.hasTax() && !O.billingConfig.taxIncludeBilling | |
}, O.isAutoCompleteRegistrationTerm = function () { | |
return O.flags.autoCompleteRegistrationTerm | |
}, O.alreadyPurchased = function () { | |
return O.access && O.access.alreadyPurchased | |
}, O.canadianTaxes = function () { | |
var e = O.input.confirmated, t = []; | |
return e && (n("HST", e.hstRate, e.hstAmount), n("QST", e.qstRate, e.qstAmount), n("PST", e.pstRate, e.pstAmount), n("GST", e.gstRate, e.gstAmount)), t; | |
function n(e, n, r) { | |
n && n > 0 && t.push({name: e, rate: n, amount: r}) | |
} | |
}, O.setCustomConfirmationUrl = function (e) { | |
U = e | |
}, O.getCustomOrDefaultConfirmationUrl = function (e) { | |
return U || e | |
}, O.getPasswordlessEmail = function () { | |
return I.data.email | |
}, O.isShowBoilerplateCloseButton = function () { | |
var e = T.get().closeButtonType, t = "false" !== getParameterByName("showCloseButton"), | |
n = e === O.closeButtonTypes.boilerplate; | |
return t && n | |
}, c.subscribe(EVENT_TERMINAL_ERROR, function (e, t) { | |
l.disable() | |
}), c.subscribe(EVENT_APPLE_PAY_CAN_MAKE_PAYMENTS, function (e, t) { | |
O.flags.applePayCanMakePayments = t.canMakePayments | |
}), c.subscribe(EVENT_SETUP_CUSTOM_VARIABLES, function (e, t) { | |
O.config.customVariables = t, window.TPParam.params.customVariables = t | |
}); | |
var j, Y, q = !1, G = !1; | |
function z(e) { | |
e !== O.config.user && angular.copy(e, O.config.user), m.userChanged(e) | |
} | |
function K(e, t, n, r, o) { | |
return e && n ? O.config.hasTermForNewCustomerBillingPlan ? O.reload(o, r) : (z(n), a(function () { | |
angular.copy(n, O.config.user), O.flags.needUpdateUserResources = !0, c.fire(EVENT_CHECKOUT_RELOADED) | |
}, 0)) : e && t ? a(function () { | |
z({valid: !0}), c.fire(EVENT_CHECKOUT_RELOADED) | |
}, 0) : O.reload(o, r) | |
} | |
c.subscribe(EVENT_VIEW_ACTIVATED, function (e, t, n) { | |
if ("offer" === t.name && q && (O.softResetDiscount(), O.sendGoogleAnalyticsEvent({ | |
eventAction: "checkoutRestarted", | |
eventLabel: "Checkout restarted", | |
params: { | |
offerId: O.config.offerId, | |
templateId: O.config.offerTemplateId, | |
templateVariantId: O.config.offerTemplateVariantId | |
} | |
})), "offer" === t.name && (q = !0, O.sendGoogleAnalyticsEvent({ | |
eventAction: "showOffer", | |
eventLabel: "Show offer", | |
params: { | |
offerId: O.config.offerId, | |
templateId: O.config.offerTemplateId, | |
templateVariantId: O.config.offerTemplateVariantId | |
} | |
})), "state1" === t.name && G && O.softResetDiscount(), "state1" === t.name && (G = !0), "state2" !== t.name || !n || n.termId === O.input.termId && n.offerId === O.input.offerId) if ("externalVerification" !== t.name || O.hasExternalVerificationGate()) if ("state2" === t.name && O.alreadyPurchased() && !O.access.inRenewal) l.gotoPreviousState(); else if ("lockedPromoCode" !== t.name || O.isPromoCodeAvailable()) if ("auth" === t.name && O.isUserValid()) l.gotoPreviousState(); else if (l.isPaymentFormState(t.name) && n && (n.termId !== O.input.termId || n.offerId !== O.input.offerId)) O.selectTerm(n.term, n.offerId, !0, !0); else if ((!l.isTermSelectorState(t.name) || n && n.termId) && "offer" !== t.name) { | |
if ("state2" === t.name && n.paySource) { | |
var r = function (e) { | |
for (var t = 0; t < O.input.paymentMethods.length; t++) { | |
var n = O.input.paymentMethods[t]; | |
if (n.id === e) return n | |
} | |
}(+n.paySource); | |
O.selectPaymentMethod(r) | |
} | |
} else O._unselectTerm(); else l.gotoPreviousState(); else a(function () { | |
O.gotoCheckoutStart() | |
}, 0); else O.selectTerm(n.term, n.offerId, !0, !0) | |
}), c.subscribe("reloadOffer", function (e, t) { | |
var n = l.getActiveState(), r = l.isPaymentFormState(n) || "auth" === n || "offer" === n; | |
t && t.noNeedStartCheckout && (delete t.noNeedStartCheckout, r = !1); | |
var o = !r && "auth" === n, i = (t = Q(t)).reloadAfterLogin, a = t.preventReloadAfterLogin, | |
c = t.user; | |
O.params.userToken = t.userToken, K(i, a, c, o, t) | |
}), c.subscribe(EVENT_CONFIG_RELOAD, function () { | |
var e = !0; | |
"false" != T.get().autoCompleteRegistrationTerm && !1 !== T.get().autoCompleteRegistrationTerm || (e = !1), O.flags.autoCompleteRegistrationTerm = e | |
}), E.on(function (e) { | |
Y && e === Y || o.postMessage("langChangedWithinOffer", {lang: e}), Y = e, j && e !== j && O.reload(null, !0), j = e | |
}), c.subscribe("langChanged", function (e, t) { | |
Y = t.lang, E.update(t.lang) | |
}); | |
var Z = null; | |
function J(e) { | |
O.reload({}).then(function () { | |
if (O.isUserValid() && m.isUserConfirmed()) { | |
var t = O._findTerm(e); | |
return O.selectTerm(t) | |
} | |
return !1 | |
}) | |
} | |
function Q(e) { | |
var t = e || {}; | |
angular.forEach(["userToken", "isRedemption", "startFromInlineCheckout"], function (e) { | |
var n = O.params[e] || getParameterByName(e); | |
null != t[e] && (n = t[e]), t[e] = n | |
}); | |
var n = O.getSelectedTerm(); | |
return t.termId = n && n.termId || t.termId, angular.forEach(window.TPParam.params, function (e, n) { | |
null == t[n] && (t[n] = e) | |
}), t.lang = Y, t | |
} | |
return c.subscribe("checkProccessesForClose", function () { | |
_("EXTERNAL_EVENT", "close"), Z = (new Date).getTime(), O.GAProccesses ? function e() { | |
!O.GAProccesses || (new Date).getTime() - Z > 3e4 ? (H(), Z = null) : setTimeout(function () { | |
e() | |
}, 50) | |
}() : H() | |
}), c.subscribe("startDirectCheckout", function () { | |
O.config.terms && 1 === O.config.terms.length && "payment" === O.config.terms[0].type && O.startCheckout(O.config.terms[0]) | |
}), O | |
}]), checkoutModule.factory("viewService", ["$q", "$document", "$window", "$rootScope", "$state", "eventService", "ngEventService", "lang", "errorService", "userService", "utilsService", "$injector", function (e, t, n, r, o, i, a, c, s, l, u, d) { | |
var p = {views: [], viewStack: []}; | |
return p.$stateProvider = checkoutModule.$stateProvider, p.startState = null, p.steps = [], p.disabled = !1, p.preventStateChange = !1, p.stateManager = {}, d.has("$transitions") ? ($transitions = d.get("$transitions"), $transitions.onStart({to: !0}, function (e, t) { | |
return p._viewStateChange({}, e.to(), e.params(), e.from()), !1 | |
}), $transitions.onError({}, function () { | |
util.log("NOT FOUND STATE") | |
})) : (p.viewStateChangeListener = r.$on("$stateChangeStart", function (e, t, n, r) { | |
e.preventDefault(), p._viewStateChange(e, t, n, r) | |
}), r.$on("$stateNotFound", function () { | |
util.log("NOT FOUND STATE") | |
})), p._viewStateChange = function (e, t, o, c) { | |
if (!p.preventStateChange) { | |
try { | |
for (var l = 0; l < n.document.styleSheets.length; l++) { | |
var u = n.document.styleSheets[l], d = u.ownerNode ? u.ownerNode : u.owningElement; | |
null != d.getAttribute("tp-style") && d.getAttribute("tp-style").indexOf("-custom-style") > -1 && (u.disabled = !0) | |
} | |
} catch (e) { | |
} | |
angular.forEach(p.views, function (e) { | |
if (e.active = !1, e.stateName == t.name) { | |
e.active = !0; | |
try { | |
for (var r = 0; r < n.document.styleSheets.length; r++) { | |
var o = n.document.styleSheets[r], | |
i = o.ownerNode ? o.ownerNode : o.owningElement; | |
"offer" != t.name && "checkout-custom-style" == i.getAttribute("tp-style") && (o.disabled = !1), i.getAttribute("tp-style") == t.name + "-custom-style" && (o.disabled = !1) | |
} | |
} catch (e) { | |
} | |
} | |
}); | |
var f, m = window.navigator.userAgent, h = m.indexOf("MSIE"), g = m.indexOf("Trident/"), | |
v = m.indexOf("Edge/"); | |
if (h > 0 || g > 0 || v > 0) var y = setInterval(function () { | |
var e = $("input:visible:focus").first(); | |
e.length ? (e.blur().focus(), clearInterval(y)) : $("input:visible").first().focus() | |
}, 1e3); | |
p.viewStack.length > o.step && (f = p.viewStack[o.step].params), s(r).resetDisplayed(), a.fire(EVENT_VIEW_ACTIVATED, t, f), i.postMessage(EVENT_VIEW_ACTIVATED) | |
} | |
}, p.registerState = function (e, t, n) { | |
p.stateManager[e] = {options: t || {}, template: n || ""} | |
}, p.getStateManager = function (e) { | |
return p.stateManager[e] | |
}, p.isActive = function (e) { | |
var t = !1; | |
return angular.forEach(p.views, function (n) { | |
n.stateName == e && (t = n.active) | |
}), t | |
}, p.registerView = function (e) { | |
e.stateName.match(/^state/) && p.steps.push(e.stateName), "error" == e.stateName && (p.errorView = e), p.$stateProvider.state(e.stateName, {url: "/" + e.stateName + "/:step"}); | |
for (var t = 0; t < p.views.length; t++) if (p.views[t].stateName == e.stateName) return void (p.views[t] = e); | |
p.views.push(e) | |
}, p._saveHistoryAndGoToState = function (e, t) { | |
if (p.isViewExists(e)) { | |
var n = u.last(p.viewStack); | |
return (n && "auth" === n.stateName || n && "state2" === n.stateName && "alreadyHasAccess" === e) && p.viewStack.pop(), n && n.stateName === e && p.viewStack.pop(), e === p.startState && (p.viewStack = []), t && t.term ? i.checkoutStateChange(e, t.term) : i.checkoutStateChange(e), p.viewStack.push({ | |
stateName: e, | |
params: t | |
}), o.go(e, {step: p.viewStack.length - 1}, {location: "replace", reload: !1}) | |
} | |
s(r).terminal(c.trc("checkout.platform", "Error. State {0} doesn't exist", e)) | |
}, p.saveHistory = function (e, t) { | |
p.viewStack.push({stateName: e, params: t}) | |
}, p.gotoState = function (e, t) { | |
return p._saveHistoryAndGoToState(e, t) | |
}, p._validateCurrentView = function () { | |
util.log("[ViewService] validateCurrentView"); | |
for (var t = e.defer(), n = [], r = 0; r < p.views.length; r++) p.views[r].stateName == o.current.name && n.push(e.when(p.views[r]._isValid())); | |
return e.all(n).then(function (e) { | |
var n = !0; | |
angular.forEach(e, function (e) { | |
!1 === e && (util.log('[ViewService] view for state "' + o.current.name + '" is not valid'), n = !1) | |
}), util.log("[ViewService] validateCurrentView result = ", n), n ? t.resolve() : t.reject() | |
}, function () { | |
util.log("[ViewService] validateCurrentView has failed with rejection"), t.reject() | |
}), t.promise | |
}, p.getActiveState = function () { | |
for (var e = 0; e < p.views.length; e++) if (p.views[e].active) return p.views[e].stateName; | |
return null | |
}, p.getViews = function () { | |
return p.views | |
}, p.isViewExists = function (e) { | |
var t = !1; | |
return p.getViews().forEach(function (n) { | |
n.stateName === e && (t = !0) | |
}), t | |
}, p._validateViews = function () { | |
util.log("[ViewService] validateViews"); | |
var t = e.defer(), n = []; | |
return angular.forEach(p.views, function (t) { | |
t.customActionOnCompletePurchase ? n.push(t.customActionOnCompletePurchase()) : t._isValid && n.push(e.when(t._isValid())) | |
}), e.all(n).then(function (e) { | |
var n = !0; | |
angular.forEach(e, function (e) { | |
!1 === e && (util.log("[ViewService] view is not valid"), n = !1) | |
}), util.log("[ViewService] validateViews result = ", n), n ? t.resolve() : t.reject() | |
}, function () { | |
util.log("[ViewService] validateViews has failed with rejection"), t.reject() | |
}), t.promise | |
}, p._gotoNextState = function (e) { | |
for (var t = -1, n = 0; n < p.views.length; n++) p.steps[n] == o.current.name && (t = n + 1); | |
t > 0 && t < p.steps.length && p._saveHistoryAndGoToState(p.steps[t], e) | |
}, p.gotoPreviousState = function () { | |
if (p.viewStack.length > 1) { | |
var e = p.viewStack.pop(); | |
"auth" !== e.stateName && "state2" !== e.stateName || l.cleanSuccessLoginCallbacks(); | |
var t = p.viewStack[p.viewStack.length - 1]; | |
i.checkoutStateChange(t.stateName), o.go(t.stateName, {step: p.viewStack.length - 1}, {location: "replace"}) | |
} | |
}, p.hasPreviousState = function () { | |
return 0 == p.disabled && p.viewStack && p.viewStack.length > 1 | |
}, p.gotoNextView = function (e) { | |
p.notify("Next button clicked"), p._validateCurrentView().then(function () { | |
p._gotoNextState(e) | |
}) | |
}, p.notify = function (e) { | |
}, p.isTermSelectorState = function (e) { | |
var t = !1; | |
return angular.forEach(p.views, function (n) { | |
n.options.hasTermSelector && n.stateName === e && (t = !0) | |
}), t | |
}, p.isPaymentFormState = function (e) { | |
var t = !1; | |
return angular.forEach(p.views, function (n) { | |
n.options.hasPaymentForm && n.stateName === e && (t = !0) | |
}), t | |
}, p.isPasswordlessFormState = function (e) { | |
var t = !1; | |
return angular.forEach(p.views, function (n) { | |
n.options.hasPasswordlessLoginForm && n.stateName === e && (t = !0) | |
}), t | |
}, p.gotoRedemptionState = function (e) { | |
var t = null; | |
if (angular.forEach(p.views, function (e) { | |
e.options.hasRedemptionForm && (t = e) | |
}), t) return p.gotoState(t.stateName, e), t.stateName; | |
throw new Error(c.trc("checkout.platform", "Not found redemption view")) | |
}, p.gotoTermSelectorState = function (e) { | |
var t = null; | |
if (angular.forEach(p.views, function (e) { | |
e.options.hasTermSelector && (t = e) | |
}), t) return p.gotoState(t.stateName, e), t.stateName; | |
throw new Error(c.trc("checkout.platform", "Not found term selector view")) | |
}, p.gotoPaymentState = function (e) { | |
var t = null; | |
if (angular.forEach(p.views, function (e) { | |
e.options.hasPaymentForm && (t = e) | |
}), t) return p.gotoState(t.stateName, e), t.stateName; | |
throw new Error(c.trc("checkout.platform", "Not found term selector view")) | |
}, p.disable = function (e) { | |
p.disabled = !0, p.preventStateChange = !e | |
}, p | |
}]), function () { | |
var e = ["exceptionHandler", "generalModule", "tpComponentsModule", "checkoutModule", "authModule", "passThroughModule", "consentModule", "redemptionModule", "giftModule", "country.selector", "tpDrop.module", "tp.i18n", "html5.placeholder"]; | |
window.TPLightestOffer || e.push("amazonmwsModule", "coinbaseModule", "creditCardModule", "mockModule", "dwollaModule", "paymentServiceModule", "payPalModule", "applePayBtModule", "payWhatYouWantModule", "spreedlyModule", "promocodeModule", "externalVerificationModule", "alreadyHasAccessModule", "zeroModule", "confirmationModule", "checkoutMockModule", "bankSecureModule", "printAddressModule", "providersModuleCH"); | |
var t = angular.module("checkoutComponentsModule", e); | |
t.constant("COMPONENT_TO_OPTIONS_MAP", { | |
"account-header-component": {}, | |
"term-selector-component": {termSelector: !0}, | |
"promo-code-component": {}, | |
"pay-what-you-want-form-component": {}, | |
"auth-component": {}, | |
"payment-form-component": {paymentForm: !0}, | |
"already-has-access-component": {}, | |
"external-verification-component": {}, | |
"print-address-component": {}, | |
"confirmation-component": {}, | |
"gift-form-component": {}, | |
"redemption-component": {redemptionForm: !0} | |
}), t.directive("view", ["$animate", "checkout", "COMPONENT_TO_OPTIONS_MAP", "$compile", "viewService", "$timeout", "performanceMetricsService", function (e, t, n, r, o, i, a) { | |
var c = "lazy-transclude", | |
s = '<div> <div error-list=""></div> <div class="' + c + '"></div> <div class="clearfix"></div></div>'; | |
function l(e) { | |
var t = NodeFilter ? NodeFilter.SHOW_ELEMENT : 1, r = function e(t, n) { | |
var r = n || [], o = t.nextNode(); | |
return o ? e(t, r.concat(o)) : r | |
}(document.createNodeIterator(e.get(0), t, null, null), null).map(function (e) { | |
return Array.prototype.slice.call(e.attributes) | |
}).filter(function (e) { | |
return e.length | |
}).reduce(function (e, t) { | |
return e.concat(t) | |
}, []).map(function (e) { | |
return e.name | |
}); | |
return Object.keys(n).filter(function (e) { | |
return -1 !== r.indexOf(e) | |
}).reduce(function (e, t) { | |
return angular.extend(e, n[t]) | |
}, {}) | |
} | |
return { | |
restrict: "A", | |
replace: !0, | |
template: function (e, t) { | |
var n = l(e), r = e.get(0).innerHTML.trim(); | |
return o.registerState(t.view, n, r), s | |
}, | |
link: function (t, n, s, l) { | |
var u = "view-" + s.view, d = o.getStateManager(s.view); | |
n.addClass("view"), n.addClass(u), n.attr("id", u), t.$watch(function () { | |
return l.active | |
}, function (o) { | |
if (e[o ? "addClass" : "removeClass"](n, "view-show"), o) { | |
var l = function (e) { | |
return e.find("." + c) | |
}(n); | |
l.children().length || (l.append(d.template), r(l.contents())(t), i(function () { | |
a.onViewRendered(s.view) | |
}, 0)) | |
} | |
}) | |
}, | |
controller: ["$scope", "$q", "$element", "$attrs", "ngEventService", "viewService", "$timeout", "exposeTemplateParams", "exposeCustomVariables", "exposeActiveMeters", "exposeCustomCookies", "userService", "giftService", "redemptionService", "setupTrackingId", "statsService", "browserIdService", function (n, r, o, i, a, c, s, l, u, d, p, f, m, h, g, v, y) { | |
var E = this; | |
this.options = { | |
hasTermSelector: !1, | |
hasPaymentForm: !1, | |
hasRedemptionForm: !1, | |
hasPasswordlessLoginForm: !1 | |
}, this.active = !1, this.components = [], this.stateName = i.view, this.name = "view-" + this.stateName, this.registerComponentController = function (e, t) { | |
t && this.registerComponentOptions(t), this.components.push(e) | |
}, this.unregisterComponentController = function (e) { | |
this.components = this.components.filter(function (t) { | |
return t.$id !== e.$id | |
}) | |
}, this.registerComponentOptions = function (e) { | |
e && e.termSelector && (E.options.hasTermSelector = e.termSelector), e && e.paymentForm && (E.options.hasPaymentForm = e.paymentForm), e && e.redemptionForm && (E.options.hasRedemptionForm = e.redemptionForm), e && e.passwordlessLoginForm && (E.options.hasPasswordlessLoginForm = e.passwordlessLoginForm) | |
}, this._isValid = function () { | |
var e = r.defer(), t = []; | |
return angular.forEach(this.components, function (e) { | |
(!e._validateViewOnCompletePurchase || e._validateViewOnCompletePurchase && e._validateViewOnCompletePurchase()) && (e.customActionOnCompletePurchase ? t.push(e.customActionOnCompletePurchase()) : e._isValid && t.push(r.when(e._isValid()))) | |
}), r.all(t).then(function (t) { | |
var n = !0; | |
angular.forEach(t, function (e) { | |
0 == e && (util.log('["' + E.name + '" validation] component is not valid'), n = !1) | |
}), e.resolve(n) | |
}, function () { | |
util.log('["' + E.name + '" validation] validation has failed with rejection'), e.resolve(!1) | |
}), e.promise | |
}, this.extendScope = function (r) { | |
function i() { | |
r.app = t.config.app, r.terms = t.config.terms, r.user = t.config.user, r.passwordlessCaptchaEnabled = t.config.passwordlessCaptchaEnabled, r.input = t.input, r.billingConfig = t.billingConfig, r.access = t.access, r.selectedTerm = t.flags.selectedTerm, r.flags = t.flags, r.allowLogout = t.allowLogout, r.isShowBoilerplateCloseButton = t.isShowBoilerplateCloseButton, r.giftEmailParams = m.form, r.voucher = h.voucher, r.externalCheckoutConfig = t.getExternalCheckoutConfig(), v.getParams().then(function (e) { | |
var t = {}; | |
angular.extend(t, TPParam.params), angular.extend(t, e), r.params = l(t), r.custom = u(t.customVariables || {}), r.customCookies = p(t.customCookies || {}), r.activeMeters = d(t.activeMeters || []), y.getBrowserId().then(function (e) { | |
n.browserId = e | |
}) | |
}) | |
} | |
Helper.wrapMethod("startCheckout", t, r), Helper.wrapMethod("startRedemption", t, r), Helper.wrapMethod("allowRedemption", t, r), Helper.wrapMethod("canInitCheckoutWithAnon", t, r), Helper.wrapMethod("isUserValid", t, r), Helper.wrapMethod("isNewCustomer", t, r), Helper.wrapMethod("allowTinypassAccountsLogin", t, r), Helper.wrapMethod("allowTinypassAccountsLogout", t, r), Helper.wrapMethod("allowTinypassAccountsLogout1", t, r), Helper.wrapMethod("logout", t, r), Helper.wrapMethod("login", t, r), Helper.wrapMethod("register", t, r), Helper.wrapMethod("isSelectedTermLocked", t, r), Helper.wrapMethod("isPaymentMethod", t, r), Helper.wrapMethod("isPaymentMethodSelected", t, r), Helper.wrapMethod("selectPaymentMethod", t, r), Helper.wrapMethod("resetPaymentSelection", t, r), Helper.wrapMethod("close", t, r), Helper.wrapMethod("canSelectPaymentMethod", t, r), Helper.wrapMethod("isPayWhatYouWantTerm", t, r), Helper.wrapMethod("isConfirmStepEnabled", t, r), Helper.wrapMethod("selectTerm", t, r), Helper.wrapMethod("isPasswordlessCheckoutEnabled", t, r), Helper.wrapMethod("isDoubleOptInEnabled", t, r), Helper.wrapMethod("isVatEuEnabled", t, r), Helper.wrapMethod("isVatCanadaEnabled", t, r), Helper.wrapMethod("isTaxUsEnabled", t, r), Helper.wrapMethod("isUsBillingCountryLabel", t, r), Helper.wrapMethod("isEuBillingCountryLabel", t, r), Helper.wrapMethod("isBillingCountryEnabled", t, r), Helper.wrapMethod("isPaymentTerm", t, r), Helper.wrapMethod("isTermSelected", t, r), Helper.wrapMethod("isExternalTerm", t, r), Helper.wrapMethod("isGiftTerm", t, r), Helper.wrapMethod("isPayableTerm", t, r), Helper.wrapMethod("isChargingTerm", t, r), Helper.wrapMethod("hasTax", t, r), Helper.wrapMethod("toggleVatColumn", t, r), Helper.wrapMethod("isVatColumnAvailable", t, r), Helper.wrapMethod("isTaxColumnVisible", t, r), Helper.wrapMethod("isVatColumnVisible", t, r), Helper.wrapMethod("getVatLabel", t, r), Helper.wrapMethod("gotoAuthState", t, r), Helper.wrapMethod("hasAccess", t, r), Helper.wrapMethod("isExternalCheckoutAvailable", t, r), Helper.wrapMethod("startExternalCheckout", t, r), i(), r.isAuthorizationSupportedByPaymentMethod = function () { | |
var e = t.flags.selectedPaymentMethod; | |
return !e || e && !0 === e.authSupported | |
}, r.getFreeTrialType = function () { | |
var e = t.getSelectedTerm(), | |
n = e.originalBillingPlan ? e.originalBillingPlan.billingPlanTable : null, | |
r = e.billingPlanTable.some(function (e, t) { | |
return "true" === e.isFree && (!n || "true" === n[t].isFree) | |
}), o = e.billingPlanTable.some(function (e, t) { | |
return "true" === e.isFree && n && "false" === n[t].isFree | |
}); | |
return r && o ? "FREE_TRIAL_TERM_PROMO" : r ? "FREE_TRIAL_TERM" : o ? "FREE_TRIAL_PROMO" : "NOT_FREE_TRIAL" | |
}, r.getPayableTermType = function () { | |
var e = t.getSelectedTerm(); | |
return t.isPayableTerm(e) ? !t.alreadyPurchased() && e.isSubscription && e.hasFreeTrial ? "FREE_TRIAL_SUBSCRIPTION" : !t.alreadyPurchased() && e.hasFreeTrial ? "FREE_TRIAL" : "PAYABLE" : "NOT_PAYABLE_TERM" | |
}, r.getTaxType = function () { | |
if (t.hasTax()) { | |
if (t.isTaxCnbcEnabled()) return "CNBC"; | |
if (t.isVatEuEnabled()) return "EU"; | |
if (t.isTaxUsEnabled()) return "US"; | |
if (t.isVatCanadaEnabled() && t.input.canadianTaxes.length > 1) return "MANY_RATE_CA"; | |
if (t.isVatCanadaEnabled() && 1 == t.input.canadianTaxes.length) return "ONE_RATE_CA" | |
} | |
return "NONE" | |
}, r.getReceiptType = function () { | |
return t.isPaymentMethod(OPENPAY_CASH) ? "OpenpayCash" : t.isPaymentMethod(EASYPAY_MULTIBANCO) ? "EasypayMultibanco" : t.isPaymentMethod(EASYPAY_MBWAY) ? "EasypayMbway" : t.isPaymentMethod(EASYPAY_DIRECT_DEBIT) ? "EasypayDirectDebit" : t.isPaymentMethod(EASYPAY_BOLETO) ? "EasypayBoleto" : t.isPaymentMethod(ONET) ? "Onet" : t.isGiftTerm(t.flags.selectedTerm) ? "GiftPurchase" : r.isRedemption() ? "GiftRedemption" : t.isExternalTerm(t.flags.selectedTerm) ? "External" : t.isRegistrationTerm(t.flags.selectedTerm) ? "Registration" : "Purchase" | |
}, r.getReceiptTemplateConfig = function () { | |
var e = {footer: !0}; | |
return t.isPaymentMethod(EASYPAY_BOLETO) ? (e.footer = !1, e) : e | |
}, r.isRedemption = function () { | |
return h.state === h.STATE_DONE | |
}, r.getSelectedPaymentMethodName = function () { | |
return t.flags.selectedPaymentMethod ? t.flags.selectedPaymentMethod.name : null | |
}, r.isTermDiscounted = function () { | |
return t.flags.isDiscounted | |
}, r.isGigyaUserProvider = f.isGigyaUserProvider, r.allowLogin = f.allowLogin, r.allowInvalidUser = function () { | |
return t.canInitCheckoutWithAnon() || "offer" === c.getActiveState() && (f.allowTinypassAccountsLogin() || f.isGigyaUserProvider()) | |
}, a.subscribe(EVENT_CHECKOUT_RELOADED, function () { | |
i() | |
}), a.subscribe(EVENT_VIEW_ACTIVATED, function () { | |
e[E.active ? "addClass" : "removeClass"](o, "view-show"), s(function () { | |
t.resize() | |
}) | |
}), a.subscribe(EVENT_CHECKOUT_TERM_SELECTED, function () { | |
i() | |
}), a.subscribe(EVENT_CHECKOUT_PRICE_CHANGED, function () { | |
i() | |
}), a.subscribe(EVENT_STATS_TRACKED, function () { | |
i() | |
}) | |
}, this.extendScope(n), c.registerView(this), this.registerComponentOptions(c.getStateManager(this.stateName).options) | |
}] | |
} | |
}]), t.directive("errorMsg", ["errorService", function (e) { | |
return { | |
restrict: "A", | |
require: ["^view", "ngModel"], | |
scope: {msg: "@errorMsg"}, | |
link: function (t, n, r, o) { | |
var i = o[0], a = o[1]; | |
t._isValid = function () { | |
e(t).reset(); | |
var n = !0; | |
return a.$error && angular.forEach(a.$error, function (e, t) { | |
e && (n = !1) | |
}), n || e(t).global(t.msg), n | |
}, i.registerComponentController(t) | |
} | |
} | |
}]), t.directive("termSelectorComponent", ["checkout", "$sce", function (e, t) { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/term-selector-component.html", | |
link: function (e, t, n, r) { | |
r.registerComponentController(e, {termSelector: !0}), t.attr("id", "term-selector-component"), e.extendScope = function () { | |
r.extendScope(e) | |
}, e.extendScope() | |
}, | |
controller: ["$scope", "$timeout", "ngEventService", function (t, n, r) { | |
angular.extend(t, BaseComponentController), t.isTermDiscounted = function () { | |
return e.flags.isDiscounted | |
}, t.isUnlimInterval = function (e) { | |
return e && 2147483647 == e.cycles | |
}, angular.forEach(e.config.terms, function (e, n) { | |
t["term" + (n + 1)] = e | |
}), t._isValid = function () { | |
return e.isTermSelected() | |
}, r.subscribe(EVENT_CHECKOUT_RELOADED, function () { | |
t.extendScope() | |
}) | |
}] | |
} | |
}]), t.directive("dynamicName", ["$parse", function (e) { | |
return { | |
restrict: "A", | |
priority: 1e4, | |
controller: ["$scope", "$element", "$attrs", function (t, n, r) { | |
var o = e(r.dynamicName)(t); | |
delete r.dynamicName, n.removeAttr("data-dynamic-name"), n.removeAttr("dynamic-name"), r.$set("name", o) | |
}] | |
} | |
}]), t.directive("paymentFormComponent", ["checkout", "ccFieldsService", function (e, t) { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/payment-form-component.html", | |
transclude: !0, | |
link: function (e, t, n, r) { | |
r.registerComponentController(e, {paymentForm: !0}), t.attr("id", "payment-form-component"), r.extendScope(e) | |
}, | |
controller: ["$scope", function (n) { | |
angular.extend(n, BaseComponentController), Helper.wrapMethod("isPaymentMethodRequired", e, n), Helper.wrapMethod("isZeroPayment", e, n), Helper.wrapMethod("isSelectedTermAutoRenewChoiceAvailable", e, n), n.hasNewFlow = function () { | |
var n = e.flags.selectedPaymentMethod && e.flags.selectedPaymentMethod.id, | |
r = t.getNewFlowProviders()[n], o = n === EDGIL_PAYWAY; | |
return r && r.name && !o | |
}, n.input = e.input | |
}] | |
} | |
}]), t.directive("paymentMethodSelectorComponent", ["checkout", "ngEventService", function (e, t) { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/payment-method-selector-component.html", | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), t.attr("id", "payment-method-selector-component") | |
}, | |
controller: ["$scope", function (n) { | |
angular.extend(n, BaseComponentController), n.paymentMethods = e.input.paymentMethods, n.selectedPaymentMethod = null, t.subscribe(EVENT_CHECKOUT_PAYMENT_METHODS_CHANGED, function (e, t) { | |
util.log("[PM SELECTOR] Got new payment method event", t), n.paymentMethods = t | |
}), n.selectPaymentMethod = function (t) { | |
return n.selectedPaymentMethod = t, e.selectPaymentMethod.apply(e, Array.prototype.slice.call(arguments)) | |
}, Helper.wrapMethod("isPaymentMethod", e, n), Helper.wrapMethod("isPaymentMethodSelected", e, n), Helper.wrapMethod("resetPaymentSelection", e, n), Helper.wrapMethod("canSelectPaymentMethod", e, n), Helper.wrapMethod("isPaymentMethodRequired", e, n), Helper.wrapMethod("isZeroPayment", e, n), n._isValid = function () { | |
return e.isPaymentMethodSelected() | |
} | |
}] | |
} | |
}]), t.directive("closeButton", ["checkout", function (e) { | |
return { | |
restrict: "A", | |
require: "^view", | |
replace: !0, | |
templateUrl: "/widget/checkout/component/partials/close-button-component.html", | |
scope: {title: "@"}, | |
link: function (t, n, r, o) { | |
o.registerComponentController(t), n.on("click", function () { | |
t.$apply(function () { | |
e.close() | |
}) | |
}) | |
}, | |
controller: ["$scope", function (e) { | |
angular.extend(e, BaseComponentController) | |
}] | |
} | |
}]), t.directive("nextButton", ["viewService", function (e) { | |
return { | |
restrict: "A", | |
require: "^view", | |
replace: !0, | |
templateUrl: "/widget/checkout/component/partials/next-button-component.html", | |
scope: {title: "@"}, | |
link: function (t, n, r, o) { | |
o.registerComponentController(t), n.on("click", function () { | |
t.$apply(function () { | |
e.gotoNextView() | |
}) | |
}) | |
}, | |
controller: ["$scope", function (e) { | |
angular.extend(e, BaseComponentController) | |
}] | |
} | |
}]), t.directive("previousButton", ["viewService", function (e) { | |
return { | |
restrict: "A", | |
require: "^view", | |
replace: !0, | |
templateUrl: "/widget/checkout/component/partials/previous-button-component.html", | |
scope: {title: "@"}, | |
link: function (t, n, r, o) { | |
o.registerComponentController(t), n.on("click", function () { | |
t.$apply(function () { | |
e.gotoPreviousState() | |
}) | |
}) | |
}, | |
controller: ["$scope", function (t) { | |
angular.extend(t, BaseComponentController), t.hasPreviousState = e.hasPreviousState | |
}] | |
} | |
}]), t.directive("errorList", function () { | |
return { | |
restrict: "A", | |
templateUrl: "/widget/checkout/component/partials/error-list-component.html", | |
scope: !1, | |
controller: ["$scope", "ngEventService", "errorService", "$timeout", function (e, t, n, r) { | |
e.errors = []; | |
var o = n(e).getId(); | |
t.subscribe(EVENT_ERRORS_CHANGED, function () { | |
e.errors.length = 0, r(function () { | |
var t = [], i = n(e).errors(!0); | |
angular.forEach(i, function (e) { | |
e.displayed && e.displayedOn != o || (t.push(e), e.displayed = !0, e.displayedOn = o) | |
}), r(function () { | |
var r = n(e).childrenErrors(); | |
angular.forEach(r, function (e) { | |
e.displayed && e.displayedOn != o || (t.push(e), e.displayed = !0, e.displayedOn = o) | |
}), t.length > 0 && (e.errors = t) | |
}, 0) | |
}, 0) | |
}), e.reset = function () { | |
n(e).resetDisplayed() | |
}, e.hasErrors = function () { | |
return e.errors && e.errors.length | |
}, e.hasOneError = function () { | |
return e.errors && 1 == e.errors.length | |
} | |
}] | |
} | |
}), t.directive("completePurchaseButton", ["checkout", "ngEventService", function (e, t) { | |
return { | |
restrict: "A", | |
require: "^view", | |
replace: !0, | |
templateUrl: "/widget/checkout/component/partials/complete-purchase-button-component.html", | |
scope: {title: "@", isDisabled: "="}, | |
link: function (n, r, o, i) { | |
var a = !1; | |
t.subscribe("PURCHASE_FAILED", function () { | |
a = !1 | |
}), i.registerComponentController(n), r.on("click", function () { | |
n.isDisabled || a || (a = !0, e.completePayment().finally(function () { | |
a = !1 | |
})) | |
}) | |
}, | |
controller: ["$scope", function (e) { | |
angular.extend(e, BaseComponentController) | |
}] | |
} | |
}]), t.directive("gotoConfirmationButton", ["checkout", function (e) { | |
return { | |
restrict: "A", | |
require: "^view", | |
replace: !0, | |
templateUrl: "/widget/checkout/component/partials/goto-confirmation-component.html", | |
scope: {title: "@"}, | |
link: function (t, n, r, o) { | |
var i = !1; | |
o.registerComponentController(t), n.on("click", function () { | |
i || (i = !0, e.confirmPayment().finally(function () { | |
i = !1 | |
})) | |
}) | |
}, | |
controller: ["$scope", function (e) { | |
angular.extend(e, BaseComponentController) | |
}] | |
} | |
}]), t.directive("accountHeaderComponent", ["checkout", function (e) { | |
return { | |
restrict: "A", | |
templateUrl: "/widget/checkout/component/partials/account-header-component.html", | |
replace: !0, | |
link: function (e, t, n) { | |
e.noLanguage = n.hasOwnProperty("noLanguage") | |
}, | |
controller: ["$scope", function (t) { | |
t.login = e.login, t.logout = e.logout, t.isUserValid = e.isUserValid, t.allowTinypassAccountsLogin = e.allowTinypassAccountsLogin, t.allowTinypassAccountsLogout = e.allowTinypassAccountsLogout | |
}] | |
} | |
}]), t.directive("debugger", ["checkout", function (e) { | |
return { | |
restrict: "A", | |
templateUrl: "/widget/checkout/component/partials/debugger.html", | |
link: function (e) { | |
e.$watch(function () { | |
return e.log.length | |
}, function () { | |
$("#debugger #log-output").scrollTop(1e10) | |
}) | |
}, | |
controller: ["$scopes", function (t) { | |
t.app = e.config.app, t.terms = e.config.terms, t.log = e.log, t.input = e.input, t.access = e.access | |
}] | |
} | |
}]), t.directive("checkout", ["checkout", function (e) { | |
return { | |
restrict: "A", link: function (e, t) { | |
t.addClass("checkout") | |
}, controller: ["$scope", "$element", "$attrs", function (t, n, r) { | |
var o = {preferredWidth: r.width, preferredHeight: r.height}; | |
e.init(t, o) | |
}] | |
} | |
}]), t.directive("billingCountry", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
replace: !0, | |
templateUrl: "/widget/checkout/component/partials/billing-country-component.html", | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), r.extendScope(e) | |
}, | |
controller: ["$scope", "$q", "checkout", "$sce", "$timeout", "ngEventService", "utilsService", function (e, t, n, r, o, i, a) { | |
var c = !1, s = null, l = !1, u = !1, d = "Countries"; | |
function p(t) { | |
var r; | |
e.selectorOptions.items = m(n.config.taxCountries, d); | |
var o = n.billingConfig.countryCode || n.billingConfig.geoCountryCode; | |
r = t && n.billingConfig.countryCode === n.billingConfig.geoCountryCode && n.billingConfig.renewBillingCountryCode ? n.billingConfig.renewBillingCountryCode : e.selectorOptions.selectorModel.item.countryCode === o ? e.selectorOptions.selectorModel.item.countryCode : n.billingConfig.countryCode || n.billingConfig.geoCountryCode; | |
var i = a.find(e.selectorOptions.items, function (e) { | |
return e.countryCode === r | |
}); | |
null != i && (e.selectorOptions.selectorModel.label = i.name, e.selectorOptions.selectorModel.item = i, n.billingConfig.requiredZipCode = i.requireZipCode, n.billingConfig.vatLabel = i.vatLabel, n.billingConfig.needResidence = i.needResidence, n.billingConfig.taxIncludeBilling = i.taxIncludeBilling, n.billingConfig.countryCode = r, n.billingConfig.countryTaxSupport = i.taxSupport), t && n.billingConfig.requiredZipCode && n.billingConfig.zipCode === n.billingConfig.geoZipCode && n.billingConfig.renewBillingZipCode && (n.billingConfig.zipCode = n.billingConfig.renewBillingZipCode); | |
var c, s = null; | |
e.selectorOptions.selectorModel.item.countryCode && (s = e.selectorOptions.selectorModel.item), e.residenceOptions.items = m(n.config.taxCountries, d, s), c = t && n.billingConfig.renewResidenceCountryCode ? n.billingConfig.renewResidenceCountryCode : n.billingConfig.residenceCountryCode; | |
var l = a.find(e.residenceOptions.items, function (e) { | |
return e.countryCode == c | |
}); | |
null != l && (e.residenceOptions.selectorModel.label = l.name, e.residenceOptions.selectorModel.item = l, n.billingConfig.residenceCountryCode = c, n.billingConfig.residenceRequireZipCode = l.requireZipCode, n.billingConfig.sameResidence = !n.billingConfig.residenceCountryCode || n.billingConfig.countryCode == n.billingConfig.residenceCountryCode, n.billingConfig.sameResidence || (n.billingConfig.taxIncludeBilling = l.taxIncludeBilling, n.billingConfig.vatLabel = l.vatLabel)) | |
} | |
function f(t) { | |
var r, i; | |
function a() { | |
s = o(function () { | |
e._isValid() && (t && (tinypass.withoutWaitPanel = !0), l = !0, n.reload(void 0, !0).then(function () { | |
tinypass.withoutWaitPanel = !1, l = !1, u && u(), u = !1 | |
}, function () { | |
tinypass.withoutWaitPanel = !1, l = !1, u && u(), u = !1 | |
})) | |
}, 300) | |
} | |
e.selectorOptions.selectorModel && e.selectorOptions.selectorModel.item && (r = e.selectorOptions.selectorModel.item, n.billingConfig.countryCode = r.countryCode, n.billingConfig.countryTaxSupport = r.taxSupport, n.billingConfig.requiredZipCode = r.requireZipCode, n.billingConfig.vatLabel = r.vatLabel, n.billingConfig.needResidence = r.needResidence, n.billingConfig.taxIncludeBilling = r.taxIncludeBilling), e.residenceOptions.selectorModel && e.residenceOptions.selectorModel.item && (i = e.residenceOptions.selectorModel.item, (r && r.countryCode === i.countryCode || !n.billingConfig.needResidence) && (n.billingConfig.sameResidence = !0)), n.billingConfig.sameResidence ? (n.billingConfig.residenceCountryCode = "", n.billingConfig.residenceRequireZipCode = !1, e.residenceOptions.selectorModel.label = "", e.residenceOptions.selectorModel.item = {}) : e.residenceOptions.selectorModel && e.residenceOptions.selectorModel.item && (i = e.residenceOptions.selectorModel.item, n.billingConfig.residenceCountryCode = i.countryCode, n.billingConfig.residenceRequireZipCode = i.requireZipCode, n.billingConfig.residenceCountryCode && (n.billingConfig.taxIncludeBilling = i.taxIncludeBilling, n.billingConfig.vatLabel = i.vatLabel)), o.cancel(s), c && (l ? u = function () { | |
a() | |
} : a()) | |
} | |
function m(e, t, n) { | |
return a.filter(e, function (e) { | |
return !(n && n.countryCode == e.countryCode) | |
}).map(function (e) { | |
return { | |
category: t, | |
name: e.name, | |
countryCode: e.countryCode, | |
requireZipCode: e.requireZipCode, | |
vatLabel: e.vatLabel, | |
needResidence: e.needResidence, | |
taxIncludeBilling: e.taxIncludeBilling, | |
taxSupport: e.taxSupport, | |
visibility: !0 | |
} | |
}) | |
} | |
angular.extend(e, BaseComponentController), e.selectorOptions = { | |
selectorModel: { | |
label: "", | |
item: {} | |
}, items: {} | |
}, e.residenceOptions = angular.copy(e.selectorOptions), e.onZipCodeChanged = function () { | |
f(!0) | |
}, e.onChangeSameResidence = function () { | |
f() | |
}, e.$watch("selectorOptions.selectorModel", function () { | |
c && (n.billingConfig.zipCode = ""), f() | |
}), e.$watch("residenceOptions.selectorModel", function () { | |
f(), i.fire(EVENT_BILLING_COUNTRY_SELECTED) | |
}), t.when(n.config.taxCountries).then(function (e) { | |
p(), o(function () { | |
c = !0 | |
}) | |
}), e._isValid = function () { | |
return !0 | |
}, i.subscribe(EVENT_BILLING_FROM_TAX_REQUEST, function () { | |
p(), o(f, 0) | |
}), i.subscribe(EVENT_BILLING_COUNTRY_SELECTED, function () { | |
p() | |
}), i.subscribe(EVENT_CHECKOUT_RELOADED, function () { | |
p() | |
}), i.subscribe(EVENT_USER_ACCESS_CHANGED, function () { | |
p(!0) | |
}) | |
}] | |
} | |
}), t.directive("purchaseReceipt", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/purchase-receipt-component.html", | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), r.extendScope(e) | |
} | |
} | |
}), t.directive("registrationReceipt", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/registration-receipt-component.html", | |
scope: {}, | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), r.extendScope(e) | |
} | |
} | |
}), t.directive("externalReceipt", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/external-receipt-component.html", | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), r.extendScope(e) | |
} | |
} | |
}), t.directive("giftRedemptionReceipt", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/gift-redemption-receipt-component.html", | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), r.extendScope(e) | |
} | |
} | |
}), t.directive("giftPurchaseReceipt", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/gift-purchase-receipt-component.html", | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), r.extendScope(e) | |
} | |
} | |
}), t.directive("openpayCashReceipt", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/openpay-cash-receipt-component.html", | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), r.extendScope(e) | |
} | |
} | |
}), t.directive("easypayMultibancoReceipt", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/easypay-multibanco-receipt-component.html", | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), r.extendScope(e) | |
} | |
} | |
}), t.directive("easypayMbwayReceipt", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/easypay-mbway-receipt-component.html", | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), r.extendScope(e) | |
} | |
} | |
}), t.directive("easypayDirectDebitReceipt", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/easypay-direct-debit-receipt-component.html", | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), r.extendScope(e) | |
} | |
} | |
}), t.directive("easypayBoletoReceipt", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/easypay-boleto-receipt-component.html", | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), r.extendScope(e) | |
} | |
} | |
}), t.directive("onetReceipt", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/onet-receipt-component.html", | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), r.extendScope(e) | |
} | |
} | |
}), t.directive("canadianTaxes", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/canadian-taxes.html", | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), r.extendScope(e) | |
} | |
} | |
}), t.directive("canadianHint", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/canadian-taxes-hint.html", | |
scope: {}, | |
controller: ["$scope", function (e) { | |
angular.extend(e, BaseComponentController) | |
}], | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), r.extendScope(e) | |
} | |
} | |
}), t.factory("passwordlessService", ["tpHTTP", "ngEventService", "viewService", "containerService", "userService", "eventService", "$q", "errorService", "$rootScope", function (e, t, n, r, o, i, a, c, s) { | |
var l, u, d = {email: "", error: ""}; | |
function p() { | |
u.reload() | |
} | |
return { | |
data: d, onCaptchaResolve: function (e) { | |
l = e | |
}, onCaptchaReady: function (e) { | |
e | |
}, loginUser: function (f) { | |
u = f; | |
var m = a.defer(); | |
if (f.isPasswordlessCheckoutEnabled() && !o.isUserValid() && n.isPasswordlessFormState(n.getActiveState())) { | |
u.onUserChanged().then(function () { | |
m.resolve() | |
}); | |
var h = t.subscribe("gigyaHide", function (e, t) { | |
h(), t.afterLogin || m.reject() | |
}); | |
u.getDoubleOptInParams().then(function (e) { | |
return { | |
tbc: e.tbc, | |
termId: e.params.termId, | |
showOfferParams: JSON.stringify(e.params), | |
url: r.getOriginUrl() | |
} | |
}).then(function (t) { | |
return function (t) { | |
var r = {aid: TPParam.params.aid, email: d.email, "g-recaptcha-response": l}; | |
return Object.assign(r, t), d.error = "", e.post(TPParam.LOGIN_PASSWORDLESS_USER, r).then(function (e) { | |
var t, r = e.models.user || {}; | |
"auth" === n.getActiveState() && n.viewStack.pop(), r.userExist ? (t = r.sentLoginEmail, u.config.isExistPasswordlessUser = !0, o.isPianoIdUserProvider() ? u.config.isSentLoginEmail = t : o.isGigyaUserProvider() ? o.login() : util.log("[PASSWORDLESS] Unsupported user provider")) : function (e) { | |
if (o.isPianoIdUserProvider()) { | |
var t = {}; | |
Object.assign(t, e.userModel, {rememberMe: !1}), o.onExternalLogin({ | |
token_list: e.tokenList, | |
cookie_domain: e.cookieDomain, | |
user_token: e.accessToken, | |
user: t, | |
params: t, | |
registration: !0 | |
}).then(function () { | |
p() | |
}) | |
} else o.isGigyaUserProvider() ? (o.onLoginSuccess(function () { | |
p() | |
}, !0), i.gigyaPasswordlessLoginEvent({ | |
accessTokenName: e.accessToken, | |
accessToken: e.accessToken | |
})) : util.log("[PASSWORDLESS] Unsupported user provider") | |
}(r) | |
}).catch(function (e) { | |
return d.error = e && e.errors && e.errors.length && e.errors[0].msg, "auth" !== n.getActiveState() && c(s).global(d.error), a.reject(d.error) | |
}) | |
}(t) | |
}).catch(function () { | |
m.reject() | |
}) | |
} else m.resolve(); | |
return m.promise | |
} | |
} | |
}]), t.directive("passwordlessLogin", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/passwordless-login.html", | |
scope: {}, | |
controller: ["$scope", "passwordlessService", "checkout", "viewService", function (e, t, n, r) { | |
angular.extend(e, BaseComponentController), e.data = t.data, e.recaptchaKey = TPParam.RECAPTCHA_SITE_KEY, e.onCaptchaResolve = t.onCaptchaResolve, e.onCaptchaReady = t.onCaptchaReady, e.isSingleStepEnabled = function () { | |
return n.isSingleStepEnabled() && "auth" !== r.getActiveState() | |
}, e.loginUser = function () { | |
return t.loginUser(n) | |
} | |
}], | |
link: function (e, t, n, r) { | |
r.registerComponentController(e, {passwordlessLoginForm: !0}), r.extendScope(e) | |
} | |
} | |
}), t.directive("passwordlessSingleStepCaptcha", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/passwordless-single-step-captcha.html", | |
scope: {}, | |
controller: ["$scope", "passwordlessService", "checkout", "userService", function (e, t, n, r) { | |
angular.extend(e, BaseComponentController), e.data = t.data, e.recaptchaKey = TPParam.RECAPTCHA_SITE_KEY, e.onCaptchaResolve = t.onCaptchaResolve, e.onCaptchaReady = t.onCaptchaReady, e.isCaptchaVerificationRequired = function () { | |
return n.isSingleStepEnabled() && n.config.passwordlessCaptchaEnabled && !r.isUserValid() | |
} | |
}], | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), r.extendScope(e) | |
} | |
} | |
}) | |
}(), function () { | |
var e = angular.module("consentModule", ["checkoutModule", "tp.i18n"]); | |
e.directive("consentsList", function () { | |
return { | |
restrict: "AE", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/consents-list.html", | |
controller: ["$scope", "checkout", "checkConsents", function (e, t, n) { | |
function r() { | |
e.consents = n.isNeeded(t) ? t.input.consents : [] | |
} | |
e.$watch(function () { | |
return t.input.consents | |
}, r), r() | |
}] | |
} | |
}), e.directive("consentBox", function () { | |
return { | |
restrict: "AE", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/consent-box.html", | |
scope: {consentId: "="}, | |
controller: ["$scope", "checkout", function (e, t) { | |
e.$watch(function () { | |
return t.input.consents | |
}, function () { | |
angular.forEach(t.input.consents, function (t) { | |
t.fieldId === e.consentId && (e.consent = t) | |
}) | |
}) | |
}] | |
} | |
}), e.factory("checkConsents", ["$q", "$window", "tpHTTP", function (e, t, n) { | |
var r = function (e) { | |
return n({ | |
method: "post", | |
url: t.TPParam.VALIDATE_CONSENTS, | |
params: {aid: e.params.aid, consents: e.input.consents} | |
}) | |
}; | |
return r.isNeeded = function (e) { | |
var t = e.getSelectedTerm(); | |
return e.input.consents && e.input.consents.length && !e.isRegistrationTerm(t) && !e.isExternalTerm(t) | |
}, r | |
}]) | |
}(), function () { | |
var e = angular.module("redemptionModule", ["checkoutModule", "datesModule"]); | |
e.factory("redeemRedemptionCodeService", ["$q", "eventService", "statsService", "checkout", "tpHTTP", function (e, t, n, r, o) { | |
return function (i) { | |
return n.getStats().then(function (n) { | |
return o({ | |
method: "post", | |
url: TPParam.REDEEM_REDEMPTION_CODE, | |
params: { | |
aid: r.getAid(), | |
redeemCode: i.form.redeemCode, | |
url: r.params.url, | |
zone: r.params.zone, | |
userToken: r.params.userToken, | |
userProvider: r.params.userProvider, | |
userRef: r.params.userRef, | |
janrainCaptureToken: r.params.janrainCaptureToken, | |
experienceId: r.params.experienceId, | |
templatePubId: r.params.templateId, | |
offerPubId: r.params.offerId | |
}, | |
data: {checkoutStats: n} | |
}).then(function (e) { | |
i.state = i.STATE_DONE; | |
var n = e.data.models.receipt; | |
return t.completeEvent(n), r.mergeStats(e), n | |
}, function (t) { | |
var n = t.data.errors; | |
return i.errors = n, e.reject(n) | |
}) | |
}) | |
} | |
}]), e.factory("redemptionService", ["$q", "checkout", "tpHTTP", "userService", "eventService", "statsService", "ngEventService", "viewService", "containerService", "$timeout", "redeemRedemptionCodeService", function (e, t, n, r, o, i, a, c, s, l, u) { | |
var d = { | |
STATE_CODE: 1, | |
STATE_INFO: 2, | |
STATE_DONE: 3, | |
state: null, | |
form: {redeemCode: null}, | |
voucher: null, | |
errors: [], | |
applyCode: function () { | |
return i.getStats().then(function (r) { | |
return n({ | |
method: "post", | |
url: TPParam.APPLY_REDEMPTION_CODE, | |
params: { | |
aid: t.getAid(), | |
redeemCode: d.form.redeemCode, | |
userToken: t.params.userToken, | |
userProvider: t.params.userProvider, | |
userRef: t.params.userRef, | |
janrainCaptureToken: t.params.janrainCaptureToken | |
}, | |
data: {checkoutStats: r} | |
}).then(function (e) { | |
var n = e.data.models; | |
return d.state = d.STATE_INFO, d.voucher = n, t.mergeStats(e), n | |
}, function (t) { | |
var n = t.data.errors; | |
return d.errors = n, d.voucher = null, e.reject(n) | |
}) | |
}) | |
}, | |
redeem: function () { | |
var n = e.defer(); | |
return r.isUserValid() ? i() ? u(d) : (t.params.redeemCode = d.form.redeemCode, c.gotoState("user-non-confirmed"), n.promise) : t.isPasswordlessCheckoutEnabled() || r.isCondeUserProvider() || r.isPianoIdUserProvider() ? function () { | |
if (s.isModal) { | |
var e = d.form.redeemCode; | |
t.params.redeemCode = e, t.gotoAuthState(null, function () { | |
"auth" === c.getActiveState() && i() ? (c.gotoPreviousState(), l(function () { | |
d.form.redeemCode = e, d.applyCode().then(function () { | |
return u(d) | |
}).then(function () { | |
n.resolve() | |
}) | |
}, 100)) : n.reject() | |
}, !0) | |
} else n.reject(), o.startCheckoutEvent(t.params); | |
return n.promise | |
}() : (t.redemptionLoginRequiredParams.state = d.state, t.redemptionLoginRequiredParams.form.redeemCode = d.form.redeemCode, t.login("register").then(function () { | |
return u(d) | |
})); | |
function i() { | |
return !r.isPianoIdUserProvider() || r.isUserConfirmed() | |
} | |
}, | |
reset: function () { | |
d.form.redeemCode = null, d.voucher = null, d.state = d.STATE_CODE | |
}, | |
resetErrors: function () { | |
d.errors = [] | |
} | |
}; | |
return d.state = d.STATE_CODE, t.params.voucherCode && (d.form.redeemCode = t.params.voucherCode, d.applyCode()), d | |
}]), e.directive("redemptionComponent", function () { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/redemption-component.html", | |
link: function (e, t, n, r) { | |
r.registerComponentController(e, {redemptionForm: !0}), e.extendScope = function () { | |
r.extendScope(e) | |
}, e.extendScope() | |
}, | |
controller: ["$scope", function (e) { | |
angular.extend(e, BaseComponentController) | |
}] | |
} | |
}), e.directive("redemptionCodeAndInfo", ["redemptionService", "$compile", "$http", "$templateCache", function (e, t, n, r) { | |
var o = "/widget/checkout/component/partials/redemption-code.html", | |
i = "/widget/checkout/component/partials/redemption-info.html"; | |
return { | |
restrict: "A", | |
require: "^redemptionComponent", | |
replace: !1, | |
scope: !0, | |
link: function (a, c) { | |
a.$watch(function () { | |
return e.state | |
}, function (s) { | |
var l = s === e.STATE_CODE ? o : i; | |
n.get(l, {cache: r}).then(function (e) { | |
c.html(e.data), t(c.contents())(a) | |
}) | |
}) | |
}, | |
controller: ["$scope", "viewService", "ngEventService", "checkout", "errorService", "$filter", "eventService", "lang", function (t, n, r, o, i, a, c, s) { | |
t.$watch(function () { | |
return e.errors | |
}, function (e) { | |
var n = e.filter(function (e) { | |
return "redeemCode" !== e.field | |
}); | |
n.length ? i(t).global(n[0].msg) : i(t).reset() | |
}), t.$watch(function () { | |
return e.voucher | |
}, function (e) { | |
t.voucher = e | |
}), t.softReset = function () { | |
o.config.isRedemption || (e.reset(), e.resetErrors()) | |
}, t.cancel = function () { | |
e.state === e.STATE_INFO ? (e.reset(), c.checkoutStateChange("redemption")) : o.config.isRedemption ? o.close() : n.gotoPreviousState() | |
}, t.applyCode = function () { | |
e.resetErrors(), e.applyCode() | |
}, t.redeem = function () { | |
e.resetErrors(), e.redeem().then(function () { | |
r.fire(EVENT_CHECKOUT_REDEEM_DONE), o.gotoReceipt() | |
}) | |
}, t.redeemCode = function () { | |
return e.form.redeemCode | |
}, t.voucherResource = function () { | |
return t.voucher ? t.voucher.resource.name : null | |
}, t.voucherDuration = function () { | |
return t.voucher ? t.voucher.duration : null | |
}, t.voucherStarting = function () { | |
if (!t.voucher) return null; | |
var e = new Date(t.voucher.startingDate), n = new Date; | |
return e.getFullYear() === n.getFullYear() && e.getMonth() === n.getMonth() && e.getDate() === n.getDate() ? s.trc("checkout.platform", "Today") : a("date")(t.voucher.startingDate, s.tr("MMM dd, yyyy")) | |
}, t.voucherExpires = function () { | |
return t.voucher ? a("date")(t.voucher.expireDate, s.tr("MMM dd, yyyy")) : null | |
}, t.voucherRedemptionStartDate = function () { | |
return t.voucher ? t.voucher.redemptionStartDate : null | |
}, t.voucherRedemptionEndDate = function () { | |
return t.voucher ? t.voucher.redemptionEndDate : null | |
}, t.voucherRedemptionAllowed = function () { | |
return t.voucher ? t.voucher.redemptionAllowed : null | |
}, r.subscribe(EVENT_VIEW_ACTIVATED, function (e, n) { | |
"redemption" === n.name && t.softReset() | |
}) | |
}] | |
} | |
}]), e.directive("redeemCodeInput", ["redemptionService", "eventService", function (e, t) { | |
return { | |
restrict: "A", | |
require: "^redemptionComponent", | |
templateUrl: "/widget/checkout/component/partials/redeem-code-input.html", | |
controller: ["$scope", function (n) { | |
n.errors = [], n.form = e.form, n.$watch(function () { | |
return e.errors | |
}, function (e) { | |
n.errors = e.filter(function (e) { | |
return "redeemCode" === e.field | |
}) | |
}), n.redeemCodeIsInvalid = function () { | |
return !!n.errors.length | |
}, n.redeemCodeErrorMessage = function () { | |
return n.errors.map(function (e) { | |
return e.msg | |
}).join("\n") | |
}, n.applyCode = function () { | |
e.resetErrors(), e.applyCode().then(function () { | |
t.checkoutStateChange("redemptionCodeApplied") | |
}) | |
} | |
}] | |
} | |
}]) | |
}(), function () { | |
var e = angular.module("giftModule", ["checkoutModule", "tp.ui.datepicker", "tp.i18n", "datesModule"]), | |
t = "now"; | |
e.factory("giftService", ["tpHTTP", "$rootScope", "$q", "$window", "checkout", "userService", "lang", "dateUtils", function (e, n, r, o, i, a, c, s) { | |
var l = {errors: [], form: {}}; | |
return l.resetForm = function () { | |
angular.extend(l.form, { | |
sendType: t, | |
sendTime: new Date, | |
recipientName: null, | |
recipientEmail: null, | |
message: null, | |
getRecipientName: function () { | |
return l.form.recipientName ? l.form.recipientName : l.form.recipientEmail | |
} | |
}) | |
}, l.saveGiftParams = function () { | |
var n = { | |
recipientName: l.form.recipientName, | |
recipientEmail: l.form.recipientEmail, | |
message: l.form.message, | |
sendTime: l.form.sendTime | |
}, u = s.unixTime(s.startOfDay(Date.now())); | |
if (l.form.sendType === t ? n.sendTime = u : n.sendTime = s.unixTime(n.sendTime), !n.sendTime || n.sendTime < u) return l.errors = [{ | |
key: null, | |
field: null, | |
msg: c.trc("checkout.platform", "Send time may not be in past") | |
}], r.reject(); | |
var d = a.getConfig(), p = d && d.user && d.user.uid || null, f = i.getSelectedTerm(); | |
return angular.extend(n, { | |
aid: i.getAid(), | |
oid: i.input.oid, | |
uid: p, | |
termId: f.termId | |
}), e.promiseResponse(e.post(o.TPParam.SAVE_GIFT_PARAMS, n), l) | |
}, l.resetForm(), l | |
}]), e.directive("giftFormComponent", ["viewService", "lang", function (e, t) { | |
return { | |
restrict: "A", | |
require: "^view", | |
templateUrl: "/widget/checkout/component/partials/gift-form-component.html", | |
link: function (e, t, n, r) { | |
r.registerComponentController(e), e.extendScope = function () { | |
r.extendScope(e) | |
}, e.extendScope() | |
}, | |
controller: ["$scope", "giftService", "checkout", "ngEventService", "errorService", "containerService", function (t, n, r, o, i, a) { | |
angular.extend(t, BaseComponentController), o.subscribe(EVENT_CHECKOUT_RELOADED, function () { | |
t.extendScope() | |
}), o.subscribe(EVENT_VIEW_ACTIVATED, function (e, t) { | |
"giftParams" === t.name && n.resetForm() | |
}), t.cancel = function () { | |
a.isOpenedFromInlineCheckout ? r.close() : (r.input.giftParamsFormFilled = !1, e.gotoPreviousState()) | |
}, t.save = function () { | |
i(r.$rootScope).reset(), n.saveGiftParams().then(function () { | |
r.input.giftParamsFormFilled = !0, r.gotoNextState(!1, !0) | |
}).catch(function () { | |
n.errors && n.errors.length && (angular.forEach(n.errors, function (e) { | |
e.message = e.msg | |
}), i(r.$rootScope).globals(n.errors)) | |
}) | |
} | |
}] | |
} | |
}]), e.directive("giftInputTime", ["lang", "$filter", function (e, n) { | |
return { | |
restrict: "A", | |
require: "^giftFormComponent", | |
templateUrl: "/widget/checkout/component/partials/gift-input-time.html", | |
scope: {}, | |
controller: ["$scope", "giftService", "checkout", function (n, r, o) { | |
n.form = r.form, n.inputDisabled = function () { | |
return n.form.sendType === t | |
}, n.dateFormat = "MMM d, yyyy", n.datePlaceholder = "MMM d, yyyy", e.on(function () { | |
n.form.sendTime = angular.copy(n.form.sendTime) | |
}); | |
var i = new Date, a = null, c = o.getSelectedTerm(); | |
if (c) { | |
var s = c.giftEmailSendStartTime; | |
s && s > i.getTime() && (i = new Date(s)); | |
var l = c.giftEmailSendEndTime; | |
l && (a = new Date(l)) | |
} | |
n.optionsDatepicker = { | |
mainOptions: { | |
instantChanges: !0, | |
closeButton: {title: e.trc("checkout.platform", "Cancel"), enable: !0}, | |
applyButton: {enable: !1} | |
}, | |
calendarOptions: [{ | |
calendarUnitTitle: "MMMM yyyy", | |
oneCanvasCalendar: !0, | |
enableOneClickRange: !0, | |
limitDateNotBefore: i, | |
limitDateNotAfter: a | |
}] | |
} | |
}] | |
} | |
}]), e.directive("giftInputName", function () { | |
return { | |
restrict: "A", | |
require: "^giftFormComponent", | |
templateUrl: "/widget/checkout/component/partials/gift-input-name.html", | |
controller: ["$scope", "giftService", function (e, t) { | |
e.form = t.form | |
}] | |
} | |
}), e.directive("giftInputEmail", function () { | |
return { | |
restrict: "A", | |
require: "^giftFormComponent", | |
templateUrl: "/widget/checkout/component/partials/gift-input-email.html", | |
controller: ["$scope", "giftService", function (e, t) { | |
e.form = t.form | |
}] | |
} | |
}), e.directive("giftInputMessage", function () { | |
return { | |
restrict: "A", | |
require: "^giftFormComponent", | |
templateUrl: "/widget/checkout/component/partials/gift-input-message.html", | |
controller: ["$scope", "giftService", function (e, t) { | |
e.form = t.form | |
}] | |
} | |
}) | |
}(); | |
var registrationService = angular.module("registrationServiceModule", ["ajaxServices", "checkoutModule", "purchaseServiceDataModule"]); | |
registrationService.factory("registrationService", ["$rootScope", "purchaseServiceData", function (e, t) { | |
var n = { | |
purchaseStarting: function (e, t) { | |
var n = {id: 0}; | |
e.input.paymentMethods = [n], e.selectPaymentMethod(n) | |
}, initiatePurchase: function (e, n, r) { | |
var o = { | |
oid: e.input.oid, | |
term_id: e.flags.selectedTerm.termId, | |
userToken: e.params.userToken, | |
aid: e.getAid() | |
}, i = function (t) { | |
t.errors && t.errors.length > 0 ? r && r(t.errors) : n && (n(e), e.completePayment()) | |
}; | |
t.initiatePurchase(o, e).then(function (e) { | |
i(e) | |
}, function (e) { | |
i(e) | |
}) | |
}, processPurchase: function (e, n, r) { | |
var o = {oid: e.input.oid}, i = function (e) { | |
e.errors && e.errors.length > 0 ? r && r(e) : n && n(e.models) | |
}; | |
t.processPurchase(o, e).then(function (e) { | |
i(e) | |
}, function (e) { | |
i(e) | |
}) | |
}, completePurchase: function (e, n, r, o, i) { | |
r.oid = n; | |
var a = function (e) { | |
e.errors && e.errors.length > 0 ? i && i(e.errors) : o && o(e.models) | |
}; | |
t.completePurchase(r, e).then(function (e) { | |
a(e) | |
}, function (e) { | |
a(e) | |
}) | |
} | |
}; | |
return n | |
}]); | |
var passThrough = angular.module("passThroughModule", ["checkoutModule"]); | |
passThrough.directive("passThroughFormComponent", ["checkout", function (e) { | |
return { | |
restrict: "A", | |
require: "^view", | |
transclude: !0, | |
templateUrl: "/widget/checkout/component/partials/pass-through-form-component.html", | |
scope: {skipValidation: "@"}, | |
link: function (e, t, n, r) { | |
r.registerComponentController(e) | |
}, | |
controller: ["$scope", function (e) { | |
angular.extend(e, BaseComponentController) | |
}] | |
} | |
}]); | |
var swgModule = angular.module("swgModule", ["generalModule", "tp.i18n"]); | |
swgModule.factory("swgService", ["tpHTTP", "$q", "$window", "ngEventService", "lang", "eventService", function (e, t, n, r, o, i) { | |
var a, c = {}; | |
return r.subscribe("swgCheckoutComplete", function (e, t) { | |
a && a.resolve(t) | |
}), c.isAvailableForTerm = function (e) { | |
return e.sku | |
}, c.startCheckout = function (e) { | |
return a && a.reject(), a = t.defer(), i.postMessage("swgCheckoutStart", { | |
sku: e.sku, | |
termId: e.termId | |
}), a.promise | |
}, c.getUiConfig = function () { | |
return {name: "swg", class: "swg-button", title: o.trc("checkout.platform", "Subscribe with Google")} | |
}, c | |
}]), angular.module("paymentProviderModule", []), angular.module("paymentProviderModule").factory("creditCardUtils", function () { | |
return { | |
ccExpireDateValidate: function (e, n) { | |
if (!t(e) || !t(n)) return !1; | |
var r = parseInt(e, 10), o = parseInt(n, 10); | |
if (r < 1 || r > 12) return !1; | |
if (o < 0) return !1; | |
o < 100 && (o += 2e3); | |
var i = new Date; | |
i.setDate(1), i.setHours(0), i.setMinutes(0), i.setSeconds(0), i.setMilliseconds(0); | |
var a = new Date; | |
return a.setDate(1), a.setMonth(r - 1), a.setYear(o), a.setHours(0), a.setMinutes(0), a.setSeconds(0), a.setMilliseconds(0), i.getTime() <= a.getTime() | |
}, ccLuhnCheck: function (e) { | |
if (!e.match(/^\d+$/)) return !1; | |
for (var t = e.length, n = 1 & t, r = 0, o = 0; o < t; o++) { | |
var i = parseInt(e.charAt(o)); | |
1 & o ^ n || (i *= 2) > 9 && (i -= 9), r += i | |
} | |
return r % 10 == 0 | |
}, detectCardType: function (e) { | |
for (var t = {shortName: "v", longName: "Visa"}, n = [{ | |
type: t, | |
rname: "electron", | |
rgxp: /^(4026|417500|4405|4508|4844|4913|4917)\d+$/ | |
}, { | |
type: {shortName: "card", longName: "Credit card"}, | |
rname: "maestro", | |
rgxp: /^(5018|5020|5038|5612|5893|6304|6759|6761|6762|6763|0604|6390)\d+$/ | |
}, { | |
type: {shortName: "card", longName: "Credit card"}, | |
rname: "dankort", | |
rgxp: /^(5019)\d+$/ | |
}, { | |
type: {shortName: "card", longName: "Credit card"}, | |
rname: "interpayment", | |
rgxp: /^(636)\d+$/ | |
}, { | |
type: {shortName: "card", longName: "Credit card"}, | |
rname: "unionpay", | |
rgxp: /^(62|88)\d+$/ | |
}, {type: t, rname: "visa", rgxp: /^4[0-9]{12}(?:[0-9]{3})?$/}, { | |
type: { | |
shortName: "mc", | |
longName: "MasterCard" | |
}, | |
rname: "mastercard", | |
rgxp: /^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/ | |
}, { | |
type: {shortName: "amex", longName: "American Express"}, | |
rname: "amex", | |
rgxp: /^3[47][0-9]{13}$/ | |
}, { | |
type: {shortName: "dci", longName: "Diners Club"}, | |
rname: "diners", | |
rgxp: /^3(?:0[0-5]|[68][0-9])[0-9]{11}$/ | |
}, { | |
type: {shortName: "d", longName: "Discover"}, | |
rname: "discover", | |
rgxp: /^6(?:011|5[0-9]{2})[0-9]{12}$/ | |
}, { | |
type: {shortName: "card", longName: "Credit card"}, | |
rname: "jcb", | |
rgxp: /^(?:2131|1800|35\d{3})\d{11}$/ | |
}], r = 0; r < n.length; r++) { | |
var o = n[r]; | |
if (o.rgxp.test(e)) return o.type | |
} | |
return {shortName: "card", longName: "Credit card"} | |
}, getUnknownCardType: e | |
}; | |
function e() { | |
return {shortName: "card", longName: "Credit card"} | |
} | |
function t(e) { | |
return !isNaN(e) && parseInt(Number(e)) == e && !isNaN(parseInt(e, 10)) | |
} | |
}); | |
var eigenMiraSecureModule = angular.module("eigenMiraSecureModule", ["paymentProviderModule"]); | |
eigenMiraSecureModule.factory("eigenMiraSecure", ["$q", "iframeService", function (e, t) { | |
var n, r, o = null, i = {}; | |
return window.addEventListener("message", function (e) { | |
if (null === o) return; | |
if (e.origin && e.origin.toLowerCase() === r) return void function (e) { | |
try { | |
var t = JSON.parse(e.data); | |
switch (t.Type) { | |
case"FormReady": | |
return Object.getOwnPropertyNames(i).forEach(function (e) { | |
c({Type: "FieldSetValue", FieldName: e, Value: i[e]}) | |
}), void c({Type: "FormSubmit"}); | |
case"FormError": | |
return void o.reject([{msg: "[MiraSecure] FormError" + t.Error}]); | |
case"FormTimeout": | |
o.reject([{msg: "[MiraSecure] FormTimeout"}]) | |
} | |
} catch (t) { | |
o.reject([{msg: "[MiraSecure] Received message with parsing error: " + e.data}]) | |
} | |
}(e); | |
try { | |
var t = JSON.parse(e.data); | |
t && t.event && "eigen-mira-secure-tokenization-complete" === t.event && function (e) { | |
switch (e.result) { | |
case"success": | |
o.resolve(e.token); | |
break; | |
case"failed": | |
o.reject([{msg: "[Piano] Internal error"}]); | |
break; | |
default: | |
o.reject([{msg: "[Piano] Received unknown message: " + e.result}]) | |
} | |
n.cancel(), o = null | |
}(t.params) | |
} catch (e) { | |
} | |
}), { | |
tokenize: function (c, s) { | |
i = s, r = function (e) { | |
var t = e.toLowerCase().split("/"); | |
return t[0] + "//" + t[2] | |
}(c), o && o.reject(); | |
return o = e.defer(), n = t.injectHiddenIframeWithTimeout("eigen-provider-mira-secure-iframe", c, 15e3, a), o.promise | |
} | |
}; | |
function a() { | |
o && (n = null, o.reject([{msg: "Timeout"}]), o = null) | |
} | |
function c(e) { | |
if (n && n.iframe.contentWindow) { | |
var t = JSON.stringify(e); | |
n.iframe.contentWindow.postMessage(t, r) | |
} | |
} | |
}]); | |
var paypalExpressCheckoutProviderModule = angular.module("paypalExpressCheckoutProviderModule", ["checkoutModule", "tpComponentsModule", "paypalExpressCheckout"]), | |
EVENT_PREVIEW_PAYPAL_EXPRESS_CHECKOUT_TERM_COMPLETE = "EVENT_PREVIEW_PAYPAL_EXPRESS_CHECKOUT_TERM_COMPLETE", | |
EVENT_PAYPAL_EXPRESS_CHECKOUT_INITIATE_SUCCEED = "EVENT_PAYPAL_EXPRESS_CHECKOUT_INITIATE_SUCCEED", | |
EVENT_PAYPAL_EXPRESS_CHECKOUT_BEFORE_PROCESS = "EVENT_PAYPAL_EXPRESS_CHECKOUT_BEFORE_PROCESS", | |
EVENT_PAYPAL_EXPRESS_CHECKOUT_PROCESS_SUCCEED = "EVENT_PAYPAL_EXPRESS_CHECKOUT_PROCESS_SUCCEED", | |
EVENT_PAYPAL_EXPRESS_CHECKOUT_DECLINED = "EVENT_PAYPAL_EXPRESS_CHECKOUT_DECLINED", | |
EVENT_PAYPAL_EXPRESS_CHECKOUT_COMPLETE_FAILED = "EVENT_PAYPAL_EXPRESS_CHECKOUT_COMPLETE_FAILED"; | |
paypalExpressCheckoutProviderModule.factory("paypalExpressCheckoutProvider", ["$rootScope", function (e) { | |
var t = { | |
beforeInitiate: function () { | |
}, initiateSucceed: function (t) { | |
e.$broadcast(EVENT_PAYPAL_EXPRESS_CHECKOUT_INITIATE_SUCCEED, t) | |
}, initiateFailed: function (e) { | |
}, beforeProcess: function () { | |
e.$broadcast(EVENT_PAYPAL_EXPRESS_CHECKOUT_BEFORE_PROCESS) | |
}, processSucceed: function (t) { | |
e.$broadcast(EVENT_PAYPAL_EXPRESS_CHECKOUT_PROCESS_SUCCEED, t) | |
}, processFailed: function (e) { | |
}, confirmed: function (e) { | |
}, declined: function (t) { | |
e.$broadcast(EVENT_PAYPAL_EXPRESS_CHECKOUT_DECLINED, t) | |
}, completeSucceed: function (e) { | |
}, completeFailed: function (t) { | |
e.$broadcast(EVENT_PAYPAL_EXPRESS_CHECKOUT_COMPLETE_FAILED, t) | |
} | |
}; | |
return t | |
}]), paypalExpressCheckoutProviderModule.directive("paypalExpressCheckoutProviderFormComponent", ["paypalExpressCheckoutService", function (e) { | |
return { | |
restrict: "A", | |
require: "^view", | |
transclude: !0, | |
templateUrl: "/widget/checkout/component/partials/paypal-express-checkout-provider-form-component.html", | |
scope: {skipValidation: "@"}, | |
link: function (e, t, n, r) { | |
r.registerComponentController(e) | |
}, | |
controller: ["$scope", "errorService", "ngEventService", "checkout", "paypalExpressCheckoutService", "$timeout", "lang", function (t, n, r, o, i, a) { | |
angular.extend(t, BaseComponentController), m() && (t.paypalFromRedirectLoading = !0); | |
var c = -1, s = function () { | |
t.stored = [], t.data = {}, t.data.selectedUpi = null, t.data.newUpi = null | |
}; | |
function l() { | |
t.stored.length > 0 && (t.data.selectedUpi = t.stored[0]) | |
} | |
function u(e) { | |
if (Array.isArray(e)) for (var r = 0; r < e.length; r++) { | |
var o = e[r].msg || e[r].message; | |
o && "" !== o.trim() && n(t).global(o) | |
} else n(t).global(e.message) | |
} | |
function d() { | |
t.data.newUpi = null, t.stored.splice(t.stored.length - 1, 1), t.data.selectedUpi.isNew && (t.data.selectedUpi = null, l()) | |
} | |
function p() { | |
if (t.data.selectedUpi) { | |
var e = t.getTaxRequest(); | |
t.data.selectedUpi.id && (o.input.upiId = t.data.selectedUpi.id, o.input.upiId && e && o.billingConfig.updateFromTaxRequest(e)) | |
} | |
} | |
function f(e) { | |
t.data.newUpi = { | |
id: void 0, | |
isNew: !0, | |
number: e.email, | |
token: e.token, | |
payerId: e.payerId | |
}, t.stored.push(t.data.newUpi), t.data.selectedUpi = t.data.newUpi | |
} | |
function m() { | |
return getCookie("paypal-express-checkout-complete") | |
} | |
t._isValid = function () { | |
if (!0 !== o.isPreviewMod()) { | |
if (n(t).reset(), !o.isPaymentMethod(PAYPAL_EXPRESS_CHECKOUT) || o.isMockUsed()) return !0; | |
if (!t.data.selectedUpi) return n(t).global(a.trc("checkout.platform", "Please select one of your PayPal accounts or add new one")), !1 | |
} | |
return !0 | |
}, t.$on(EVENT_PREVIEW_PAYPAL_EXPRESS_CHECKOUT_TERM_COMPLETE, function (e, t) { | |
o._completeTerm({q: "q"}) | |
}), t.$on(EVENT_PAYPAL_EXPRESS_CHECKOUT_INITIATE_SUCCEED, function (e, n) { | |
c = o.getSelectedTerm().chargeAmount, t.stored = JSON.parse(n.stored), t.data.newUpi && t.stored.push(t.data.newUpi), t.data.selectedUpi || l(), t.initUrl = n.init_url, t.storedRurl = n.stored_rurl, t.commonRurl = n.common_rurl, p() | |
}), t.$on(EVENT_PAYPAL_EXPRESS_CHECKOUT_BEFORE_PROCESS, function (e, n) { | |
t.data.newUpi && (o.input.upiId = null) | |
}), t.$on(EVENT_PAYPAL_EXPRESS_CHECKOUT_PROCESS_SUCCEED, function (n, r) { | |
o.disableCheckout(), e.processPurchase(t.data.selectedUpi, t.storedRurl, t.commonRurl) | |
}), t.$on(EVENT_PAYPAL_EXPRESS_CHECKOUT_DECLINED, function (e, t) { | |
o.enabledCheckout() | |
}), t.$on(EVENT_PAYPAL_EXPRESS_CHECKOUT_COMPLETE_FAILED, function (e, t) { | |
u(t) | |
}), r.subscribe(EVENT_CHECKOUT_STARTED, function () { | |
s() | |
}), r.subscribe(EVENT_CHECKOUT_PRICE_CHANGED, function () { | |
var e = o.input.chargeAmount; | |
t.data.newUpi && e !== c && d(), c = e | |
}), r.subscribe(EVENT_CHECKOUT_RELOADED, function () { | |
var e = o.getSelectedTerm(); | |
t.data.newUpi && e.chargeAmount !== c && d(), c = e.chargeAmount; | |
var n = m(); | |
n && function (e) { | |
f(JSON.parse(e)), eraseCookie("paypal-express-checkout-complete"), t.paypalFromRedirectLoading = !1 | |
}(n) | |
}), s(), propagatePaymentVars(o, t), t.addNewAccount = function () { | |
var n = t.initUrl; | |
n += "&zipCode=" + o.input.zipCode, o.getBillingZipCode() && (n += "&billingZipCode=" + o.getBillingZipCode()), o.getBillingCountryCode() && (n += "&countryCode=" + o.getBillingCountryCode()), o.getResidenceCountryCode() && (n += "&residenceCountryCode=" + o.getResidenceCountryCode()); | |
var r = {termId: o.flags.selectedTerm.termId, paySource: o.flags.selectedPaymentMethod.id}; | |
e.startExpressCheckout(n, r).then(f).catch(function (e) { | |
e && u(e) | |
}) | |
}, t.$watch("data.selectedUpi ", function () { | |
p() | |
}), t.getTaxRequest = function () { | |
if (t.data.selectedUpi) for (var e = 0; e < t.stored.length; e++) { | |
var n = t.stored[e]; | |
if (n.id === t.data.selectedUpi.id) return o.billingConfig.taxRequestFromUpi(n) | |
} | |
return null | |
}, t.cancelNewAccount = d, t.canContinue = function () { | |
return !!t.data.selectedUpi | |
} | |
}] | |
} | |
}]), window.PAYPAL = 1, window.CREDIT_CARD = 4, window.DWOLLA = 7, window.AMAZON = 8, window.COINBASE = 9, window.MOCK = 5, window.ZERO = 0, window.PAYPAL_BT = 11, window.WORLDPAY_HPP = 12, window.WORLDPAY_PAYPAL = 13, window.WORLDPAY_IDEAL = 14, window.WORLDPAY_ELV = 15, window.SPREEDLY_CC = 16, window.SPREEDLY_STRIPE_CC = 17, window.SPREEDLY_BEANSTREAM = 18, window.EDGIL_PAYWAY = 19, window.WORLDPAY_CC_TOKEN = 20, window.SPREEDLY_PAYU_LATAM = 21, window.PAYPAL_EXPRESS_CHECKOUT = 22, window.SPREEDLY_OPENPAY = 23, window.EIGEN = 24, window.APPLE_PAY_BT = 25, window.OPENPAY_CASH = 26, window.EASYPAY_MULTIBANCO = 28, window.EASYPAY_MBWAY = 29, window.EASYPAY_DIRECT_DEBIT = 30, window.EASYPAY_BOLETO = 31, window.KLARNA = 32, window.OBI = 33, window.OBI_PAYPAL = 34, window.DATATRANS = 35, window.DATATRANS_POSTFINANCE = 36, window.ONET = 37, window.APPLE_PAY_SS = 38, window.CYBER_SOURCE = 39; | |
var paymentService = angular.module("paymentServiceModule", ["ajaxServices", "creditCardModule", "checkoutModule", "purchaseServiceDataModule", "payPalBtModule", "worldPayModule", "worldPayHppModule", "spreedlyModule", "worldPayTokenModule", "edgilPaywayProviderModule", "paypalExpressCheckoutProviderModule", "eigenProviderModule", "applePayBtModule", "easypayCheckoutModule", "klarnaCheckoutModule", "obiCheckoutModule", "obiPaypalCheckoutModule", "datatransCheckoutModule", "datatransPostfinanceCheckoutModule", "openpayCashModule"]); | |
paymentService.factory("paymentService", ["$rootScope", "$window", "$location", "$rootElement", "creditCard", "payPal", "dwolla", "amazonmws", "coinbase", "mock", "zero", "errorService", "purchaseServiceData", "payPalBt", "$q", "lang", "worldPayRxml", "worldPayHpp", "spreedly", "worldPayToken", "edgilPaywayProvider", "paypalExpressCheckoutProvider", "eigenProvider", "applePayBt", "klarnaProvider", "openpayCashProvider", "easypayMultibancoProvider", "easypayMbwayProvider", "easypayDirectDebitProvider", "easypayBoletoProvider", "obiProvider", "obiPaypalProvider", "datatransProvider", "datatransPostfinanceProvider", "providersServiceCH", function (e, t, n, r, o, i, a, c, s, l, u, d, p, f, m, h, g, v, y, E, C, T, _, S, w, b, A, P, $, k, I, N, D, x, O) { | |
var M = {}, R = { | |
beforeInitiate: function () { | |
}, initiateSucceed: function (e) { | |
}, initiateFailed: function (e) { | |
}, beforeProcess: function (e) { | |
}, processSucceed: function (e) { | |
}, processFailed: function (e) { | |
}, confirmed: function (e) { | |
}, declined: function (e) { | |
}, completeSucceed: function (e) { | |
}, completeFailed: function (e) { | |
}, checkConsents: function (e) { | |
} | |
}; | |
function L(e) { | |
var t = {}; | |
for (var n in t.oid = e.input.oid, t.aid = e.params.aid, t.userToken = e.params.userToken, t.autoRenew = e.input.autoRenew, t.chargeDisplayAmount = e.input.chargeDisplayAmount, t.chargeAmount = e.input.chargeAmount, t.chargeCurrency = e.input.chargeCurrency, t.originalChargeAmount = e.input.originalChargeAmount, t.originalChargeCurrency = e.input.originalChargeCurrency, t.originalChargeDisplayAmount = e.input.originalChargeDisplayAmount, t.isTermLockedByPromocode = e.input.isTermLockedByPromocode, t.user_data = e.input.user_data, t.first_name = e.input.first_name, t.last_name = e.input.last_name, t.termId = e.input.termId, t.offerId = e.input.offerId, t.zipCode = e.input.zipCode, t.billingPlan = e.input.billingPlan, t.taxAmount = e.input.taxAmount, t.total = e.input.total, t.credit_card = e.input.credit_card, t.consents = e.input.consents, t.promoCode = e.input.promoCode, t.storeInVault = e.input.storeInVault, t.deviceSessionId = e.input.deviceSessionId, t.spreedlyPayULatamLanguage = e.input.spreedlyPayULatamLanguage, t) { | |
var r = t[n]; | |
null != r && "" !== r || delete t[n] | |
} | |
return t | |
} | |
M.purchaseStarting = function (e, t) { | |
e.updatePaymentMethods(!0) | |
}, M.initiatePurchase = function (e, t, n) { | |
var r = e.isMockUsed() ? MOCK : e.flags.selectedPaymentMethod.id; | |
if (void 0 === r) throw new Error("Provider has to be selected"); | |
V(r); | |
var o = L(e); | |
o.oid = e.input.oid, null == e.input.storeInVault && (e.input.storeInVault = !0), o.store_in_vault = e.input.storeInVault, o.term_id = e.flags.selectedTerm.termId, o.pm_type = r, R.beforeInitiate && R.beforeInitiate(), F(e, o, function (r) { | |
r.errors && r.errors.length > 0 ? (util.log("[PAYMENT SERVICE] Initiate error", r.errors), R.initiateFailed && R.initiateFailed(r.errors), n && n(r.errors)) : (R.initiateSucceed && R.initiateSucceed(r.models), t && t(e)) | |
}) | |
}, M.confirmPayment = function (t, n, r) { | |
if (!t) throw new Error("checkout is required"); | |
if (!R) throw new Error("provider has to be set first"); | |
var o; | |
d(e).reset(), R.beforeConfirm && (o = R.beforeConfirm(t)); | |
var i = {}; | |
i.userToken = t.params.userToken, i.userProvider = t.params.userProvider, i.userRef = t.params.userRef, i.janrainCaptureToken = t.params.janrainCaptureToken, i.oid = t.input.oid, i.aid = t.getAid(), i.termId = t.getSelectedTerm().termId, i.zipCode = t.input.zipCode, i.countryCode = t.getBillingCountryCode(), i.billingZipCode = t.getBillingZipCode(), i.residenceCountryCode = t.getResidenceCountryCode(), i.upiId = t.input.upiId, o && angular.forEach(o, function (e) { | |
i[e] = t.input[e] | |
}), B(t, i, function (e) { | |
e.errors && e.errors.length > 0 ? r && r(e) : n && n(e) | |
}) | |
}, M.processPurchase = function (t, n, r) { | |
if (!t) throw new Error("checkout is required"); | |
if (!R) throw new Error("provider has to be set first"); | |
function o(o) { | |
var i = L(t); | |
i.oid = t.input.oid, i.auto_renew = t.input.autoRenew, i.zip_code = t.input.zipCode, i.store_in_vault = t.input.storeInVault, i.defaultPaymentMethodId = t.input.defaultPaymentMethodId, i.consents = t.input.consents, i.upi_id = t.input.upiId, i.paymentMethodNonce = t.input.paymentMethodNonce, t.getBillingCountryCode() && (i.country_code = t.getBillingCountryCode()), t.getBillingZipCode() && (i.billing_zip_code = t.getBillingZipCode()), t.getResidenceCountryCode() && (i.residence_country_code = t.getResidenceCountryCode()), o && angular.forEach(o, function (e) { | |
i[e] = t.input[e] | |
}); | |
var a = function () { | |
return j(function (e) { | |
util.log("[PAYMENT SERVICE] Confirmed", e), R.confirmed && R.confirmed(e), n && n(e) | |
}, function (e, t) { | |
if ((util.log("[PAYMENT SERVICE] Declined", e), R.declined) && R.declined(e, t)) return void a(); | |
r && r(e) | |
}) | |
}; | |
U(t, i, function (n) { | |
if (n.errorCode) d(e).global(t.SYSTEM_ERROR_CODES[n.errorCode]); else if (n.errors && n.errors.length > 0) util.log("[PAYMENT SERVICE] Process error", n.errors), R.processFailed && R.processFailed(n.errors), n && n.errors && n.errors.length > 0 && n.errors[0].msg ? r ? r(n) : d(e).global(h.trc("service.error.codes", n.errors[0].msg)) : (r && r(), d().terminal(h.tr("Confirmation order failed"))); else { | |
if (util.log("[PAYMENT SERVICE] Process succeed", n.models), !R.processSucceed) throw new Error("processSucceed should be implemented"); | |
var o = a(), i = R.processSucceed(n.models); | |
i && i.catch(function () { | |
o(), r && r() | |
}) | |
} | |
}) | |
} | |
d(e).reset(), R.beforeProcess ? m.when(R.beforeProcess(t)).then(function (e) { | |
o(e) | |
}).catch(function (e) { | |
r(e) | |
}) : o() | |
}, M.completePurchase = function (e, t, n, r, o) { | |
if (!n.q) throw new Error("You should pass the 'q' parameter that you've obtained on the confirmation step"); | |
n.oid = t, H(e, n, function (t) { | |
t.errorCode ? d().terminal(e.SYSTEM_ERROR_CODES[t.errorCode]) : t.errors && t.errors.length > 0 ? (util.log("[PAYMENT SERVICE] Complete error", t.errors), R.completeFailed && R.completeFailed(t.errors), o && o(t)) : (util.log("[PAYMENT SERVICE] Complete succeed", t.models), R.completeSucceed && R.completeSucceed(t.models), r && r(t.models)) | |
}) | |
}, M.checkConsentsFunction = function () { | |
return R.checkConsents | |
}, M.lock = null, M.getLock = function () { | |
return (null == M.lock || (new Date).getTime() - M.lock > 1e4) && (M.lock = (new Date).getTime(), M.lock) | |
}, M.clearLock = function () { | |
M.lock = null | |
}; | |
var V = function (e) { | |
if (e, e !== EDGIL_PAYWAY && O.checkProviderInstanceById(e)) return R = O.getProviderInstanceById(e), void util.log("[PAYMENT SERVICE] Set the provider", e, R); | |
switch (e) { | |
case CREDIT_CARD: | |
R = o; | |
break; | |
case PAYPAL: | |
R = i; | |
break; | |
case DWOLLA: | |
R = a; | |
break; | |
case AMAZON: | |
R = c; | |
break; | |
case COINBASE: | |
R = s; | |
break; | |
case MOCK: | |
R = l; | |
break; | |
case ZERO: | |
R = u; | |
break; | |
case PAYPAL_BT: | |
R = f; | |
break; | |
case APPLE_PAY_BT: | |
R = S; | |
break; | |
case WORLDPAY_HPP: | |
R = v; | |
break; | |
case WORLDPAY_PAYPAL: | |
case WORLDPAY_IDEAL: | |
case WORLDPAY_ELV: | |
R = g; | |
break; | |
case WORLDPAY_CC_TOKEN: | |
R = E; | |
break; | |
case SPREEDLY_CC: | |
case SPREEDLY_STRIPE_CC: | |
case SPREEDLY_BEANSTREAM: | |
case SPREEDLY_PAYU_LATAM: | |
case SPREEDLY_OPENPAY: | |
R = y; | |
break; | |
case EDGIL_PAYWAY: | |
R = C; | |
break; | |
case EIGEN: | |
R = _; | |
break; | |
case PAYPAL_EXPRESS_CHECKOUT: | |
R = T; | |
break; | |
case OPENPAY_CASH: | |
R = b; | |
break; | |
case EASYPAY_MULTIBANCO: | |
R = A; | |
break; | |
case EASYPAY_MBWAY: | |
R = P; | |
break; | |
case EASYPAY_DIRECT_DEBIT: | |
R = $; | |
break; | |
case EASYPAY_BOLETO: | |
R = k; | |
break; | |
case KLARNA: | |
R = w; | |
break; | |
case OBI: | |
R = I; | |
break; | |
case OBI_PAYPAL: | |
R = N; | |
break; | |
case DATATRANS: | |
R = D; | |
break; | |
case DATATRANS_POSTFINANCE: | |
R = x; | |
break; | |
default: | |
throw new Error("Provider isn't recognized: " + e) | |
} | |
util.log("[PAYMENT SERVICE] Set the provider", e, R) | |
}, F = function (e, t, n) { | |
return p.initiatePurchase(t, e).then(function (e) { | |
n(e, t) | |
}, function (e) { | |
n(e, t) | |
}) | |
}, U = function (e, t, n) { | |
return p.processPurchase(t, e).then(function (e) { | |
n(e, t) | |
}, function (e) { | |
n(e, t) | |
}) | |
}, B = function (e, t, n) { | |
return p.confirmPayment(t, e).then(function (e) { | |
n(e, t) | |
}, function (e) { | |
n(e, t) | |
}) | |
}, H = function (e, t, n) { | |
return p.completePurchase(t, e).then(function (e) { | |
n(e, t) | |
}, function (e) { | |
n(e, t) | |
}) | |
}, W = function (e, t) { | |
d().terminal(e) | |
}, j = function (e, t) { | |
var n = function () { | |
var e = m.defer(), t = function (t) { | |
try { | |
var r = JSON.parse(t.data) | |
} catch (e) { | |
return | |
} | |
void 0 !== r && r.event && "string" == typeof r.event && 0 == r.event.indexOf("payment-") && (e.resolve(r), n()) | |
}; | |
return window.addEventListener("message", t, !1), {promise: e.promise, remove: n}; | |
function n() { | |
window.removeEventListener("message", t) | |
} | |
}(); | |
return n.promise.then(function (n) { | |
try { | |
"payment-complete" === n.event ? (e(n.params), M.clearLock()) : "payment-error" === n.event && (t(n.error, n.params), M.clearLock()) | |
} catch (e) { | |
W("Error occurred"), M.clearLock() | |
} | |
}, function (e) { | |
W("Error occurred"), M.clearLock() | |
}), n.remove | |
}; | |
return M | |
}]); | |
var propagatePaymentVars = function (e, t) { | |
Helper.wrapMethod("isPaymentMethod", e, t), Helper.wrapMethod("isMockUsed", e, t), Helper.wrapMethod("isPreviewMod", e, t), Helper.wrapMethod("isPaymentMethodSelected", e, t), t.CREDIT_CARD = CREDIT_CARD, t.AMAZON = AMAZON, t.PAYPAL = PAYPAL, t.DWOLLA = DWOLLA, t.COINBASE = COINBASE, t.ZERO = ZERO, t.MOCK = MOCK, t.PAYPAL_BT = PAYPAL_BT, t.APPLE_PAY_BT = APPLE_PAY_BT, t.WORLDPAY_HPP = WORLDPAY_HPP, t.WORLDPAY_PAYPAL = WORLDPAY_PAYPAL, t.WORLDPAY_IDEAL = WORLDPAY_IDEAL, t.WORLDPAY_ELV = WORLDPAY_ELV, t.WORLDPAY_CC_TOKEN = WORLDPAY_CC_TOKEN, t.SPREEDLY_CC = SPREEDLY_CC, t.SPREEDLY_STRIPE_CC = SPREEDLY_STRIPE_CC, t.SPREEDLY_BEANSTREAM = SPREEDLY_BEANSTREAM, t.SPREEDLY_PAYU_LATAM = SPREEDLY_PAYU_LATAM, t.SPREEDLY_OPENPAY = SPREEDLY_OPENPAY, t.EDGIL_PAYWAY = EDGIL_PAYWAY, t.PAYPAL_EXPRESS_CHECKOUT = PAYPAL_EXPRESS_CHECKOUT, t.EIGEN = EIGEN, t.OPENPAY_CASH = OPENPAY_CASH, t.EASYPAY_MULTIBANCO = EASYPAY_MULTIBANCO, t.EASYPAY_MBWAY = EASYPAY_MBWAY, t.EASYPAY_DIRECT_DEBIT = EASYPAY_DIRECT_DEBIT, t.EASYPAY_BOLETO = EASYPAY_BOLETO, t.KLARNA = KLARNA, t.OBI = OBI, t.OBI_PAYPAL = OBI_PAYPAL, t.DATATRANS = DATATRANS, t.DATATRANS_POSTFINANCE = DATATRANS_POSTFINANCE, t.APPLE_PAY_SS = APPLE_PAY_SS, t.input = e.input, t.isSubscription = function () { | |
return e.getSelectedTerm().isSubscription | |
}, t.isConfirmStepEnabled = e.isConfirmStepEnabled, t.isSelectedTermAutoRenewChoiceAvailable = e.isSelectedTermAutoRenewChoiceAvailable, t.setAsDefaultPaymentMethod = function (n) { | |
var r = {upiId: n.id, aid: e.getAid(), userToken: e.params.userToken}; | |
e.setAsDefaultPaymentMethod(r).then(function (e) { | |
e.updated > 0 && (e.failed > 0 ? t.cc.defaultPaymentMethodId = null : t.cc.defaultPaymentMethodId = r.upiId) | |
}) | |
} | |
}, createPaymentPopUp = function (e, t, n, r) { | |
n = n || "payment provider", e = e && e > 0 ? e : 800, t = t && t > 0 ? t : 600; | |
var o = r ? r.trc("checkout.platform", "Redirecting to <strong>{0}</strong>...", n) : "Redirecting to <strong>" + n + "</strong>..."; | |
if (window.providerPopup) try { | |
window.providerPopup.close() | |
} catch (e) { | |
} | |
return window.providerPopup = window.open("", "payment_popup", "scrollbars=1,popup=true,width=" + e + ",height=" + t, !0), window.providerPopup.document.write("<html><body><STYLE type='text/css'>body {margin: 0}</STYLE><div style='font-family: Arial; background: #f5f5f5; height:100px; width: 100%; text-align: center;'><div style='display: inline-block;line-height: 100px;width: 50px;vertical-align:middle'><img alt='' src='data:image/gif;base64,R0lGODlhFgAWAIQAALS2tNze3MzKzPTy9MTCxOzq7NTW1Pz6/Ly+vOTm5NTS1Ly6vOTi5MzOzPT29MTGxOzu7Nza3Pz+/PX19QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAgATACwAAAAAFgAWAAAFkeAkjg6jPIgiScfovsxDIMsCrGv7ioMhyAjaDbdyvHqNH+HRUEyIOOMooEg2GFLR4QAdFQwGhWGw0xJbpYiaXDbjJoOAHNJ2cXOQBCNRdzmIAwUJbH0iRBAFEISFgAMDWYw4Bw5/hSNQb5Z3OZKakn9RfaArbkVtmyyXZy8OqBJ2mCyupn6xsTo7s6t9W5i4LiEAIfkECQIAEwAsAAAAABYAFgAABZDgJI5TESnPIygM6Y6F0qQPgiyAdLyiExgygYBgwzEkEseLEQE2GoamYIFAIpWwQCASKQxIjoMVORokEowWb+IY7xyQwhm7FlsnB4h+7bLrDg4DX3wjbW5hhCRjVjuJIotIjY6QZI4TlBKWB36cjpyGV4SgmXhjdH1uI4uSPX6VIq6MsaFgmJCsJLOphJu3PCEAIfkECQIAEwAsAAAAABYAFgAABY/gJI4OxARKo0SJM77vEERGKjwPQQQuPJWnmU1AQCAWgh5pkEgwIpHAyVA8AiRKEQRSSAxgMqtEMjo4BgNI9gU5jCWHH9wV95HeZPe4bi+/9WN9MA54eIIwhXuHL4lwiyONZI8TkZMHgJiPmIRva4OGE4BYfaJ8hXwiDqKSIqt7rqMvnJF4qC+wf4uXibYiIQAh+QQJAgATACwAAAAAFgAWAAAFluAkjs4EJUwQMNDovs6AMpGhNDjzksdQFIlA7SYQPBQtl0PicEB+v6Di8SAgBAOXRHI4TEquAaOKWAjAh+0WvBtYF4vAV83duSALAEAySW+9dncLBFx0gTBqfluHL3SJjFqOdZAikouUE5Z8lF2Jj5CKB0tqbHajl4pMgamAmXStIg6pmyKzf7aqSpqSsC64n4edjr0iIQAh+QQJAgATACwAAAAAFgAWAAAFmOAkjs7hOEVaQGPrHpIzQEUSBFFUuKTkH4NBIsGIGAyKyMDl8P1Os0IA2WgoliPnj1lQCAQPwwjmPPBEkMbjQWBMmuXzCCJAEB4TssQsHwUQCAsJWn0tA4ELCoSFIwIAAAZxjCIHCwtafJNai5qbPpN5eqKTonA+DoWmEpRaqGd6e1mYTLCrY557tadMuLiZL71bhQe6vyMhACH5BAkCABMALAAAAAAWABYAAAWU4CSOziGdhzOurGie0jENRVJArejAsAzVjECiteOhVLVAIBJQjYyylWOwNCgCoxcqN4soFI3CpLjlzhoNgWKijZonCcFDkOC9R4PHgxCx30UKBAgNPX8iBggED4WGBgsLizCGEwoAkH53OwAAA21/bWQSTlxaEi48oywHniJQLCVGK6U9syepY0a5jC21PG6ktb8jIQAh+QQJAgATACwAAAAAFgAWAAAFk+Akjs4hnegxrqyJpkfJkm8dD9DgsE6dSgdcIVFg2XgHSILBSIxcJ9Vs4igEAhEI9SWdirCRyATa9U4KBoUC8jKzFI0Go+0eReKGVH0UEDwUensTEQ8PDXR7DQQEhyiCAwgIBApkexELmAk9KDtmBxEACwQDYy+dMwcmAAAMI0crJTUrUFy0nDw+uUBetq+evWUjIQAh+QQJAgATACwAAAAAFgAWAAAFk+Akjs4hnegxrqyJvqfKig5sow5b2+57HLkRTDb6SQ4DyKp3nNEcyUJuF3OSIIVEYdIjWieDBIMxeH1XDkYgUDCfR4lIhJF6jwoGQ6BunyQUChFudhECDYIofQMCDwIBXXYBD41SL0FWEASaAiJMlywDBAijCUI+OgcMAAsIDZdMKT0Fqw8DOjcwabZOsENvRr4zIQAh+QQJAgATACwAAAAAFgAWAAAFkuAkjs4hnegxrqyJvqfKig5sow5b266djzDZ6NA7DV9CXUq1i81WtYMj10s+J4eBtim56gaQAtfLGiQKkBR5BUkwCuq1CBIIwFFyESMSSbzyEwYGfVVyCQqIEFw/VxACAg0GIkWMZY+PBUBIlQMBBAgED5JHPCYEC6AEDQNKNxIAC6irV0UoCwAIDKxeREEFuyshACH5BAkCABMALAAAAAAWABYAAAWT4CSOziGd6DGurIm+p8qKDmyjDlvbrp2PMNno0DsNX0IdcrKLzVZNyaSXfE5TL2sLi9KyJESqd3UYQMRjGgQyyaYng0Ji4B47GIw52gsJMAIDUT9WAxGGDCJFgywDBgoGBmwiQYwMDZcKiEc2BQoNDwQPAg0Ri0w2AAsICAQCAgammxIOCwCsoQljYRICCAIKczMhACH5BAkCABMALAAAAAAWABYAAAWL4CSOziGd6DGurIm+p8qKDmyjDlvfLpyPsIOM1juNikPdS7WLzVZNyaSXfE5TL2vrJtWueN6vrarlho9C2Hk6yKWdZwikHf1ZHYVEYSAq2nUMDAkJdkEzBRERAQwFK0ULCA0GEQYNCgqTDH8TOwIAkAQEAgKWBgxaQp8IoQ+kBo1hDAoPBA8KEbAsIQAh+QQJAgATACwAAAAAFgAWAAAFjeAkjs4hnegxrqyJvqfKig5sow5b266djzDZ6NA7DV9CHXKyi81WTcmkl3xOUy9r6ybVrm5VLdj7vZGB5jMR6ySvJYfoz5pbi6gQ6wEyGJTQAAsIDANQEAkFBRBJJguBCA8RAQwBkwwMCX4sAwSCBAQPAg0KEZIMEHNQEQSQoaMGkoVeAwkRCqMRCXkzIQAh+QQJAgATACwAAAAAFgAWAAAFj+Akjs4hnegxrqyJvqfKig5sow5b266djzDZ6NA7DV9CHXKyi81WTcmkl3xOUy9r6ybVrm5VLdj7vZGB5jMRS1hA1CkHBLBADLxRUWDBF7yfRUIPCAgEDwk6Kj0rAwSODwIKAQkFlRAQJRI/IxANkAINCgYBDJQQAwebUAENrQYRAZMFEGEsAwUMARGlmE8hACH5BAkCABMALAAAAAAWABYAAAWS4CSOziGd6DGurIm+p8qKDmyjDlvfLpyPMNno0DsNX0IdcrKLzVZNyaSXfE5TL2vrJtWueN5VcYGoal+NBaARBqLS5J+3yCAjGG3qAEEgPAZeUSIBfgIKgE9RMg4KDw8NCgU6RV0iAw2QCgYBBRADB1EScpYRDQYRAQwJnUQpVgURqKoFA58SZjoQBQUJEFOjIyEAIfkECQIAEwAsAAAAABYAFgAABY/gJI7OIZ3oMa6sib6nyooObKMOW9uunY8w2ejQOw1fQh1ysovNVk3JpJd8TlMQwEJqhb4IC0Cky3otzgbyqodoj9Wil4BASMMnLwPhIbhHE3wCCXBUAw0CDQYDZFEiCQ0KCgFdRUIRBgYRDItQRVw0AREBAQkQJZ4nPyMDDKQFBQMlPFYDCa+xQWo/RClPIQAh+QQJAgATACwAAAAAFgAWAAAFkOAkjs4hnegxrqyJvqfKig5sow5b266djzDZ6NA7jQILQGxGe6kGiGThx5wUJ4yFllFd9Q4NBIJA7e5ODQJB0WW9HvBIe/USPASBORClaOD1Ii8BfQaARCgFCgYGEHpfExEGAQxlM1cTBQGTU1VnEkIJDAwJA5UlMCwFCRADVp9FODoDrKc3n521PHMlsEIrIQAh+QQJAgATACwAAAAAFgAWAAAFlOAkjs4hnegxrqyJvqfKihDjwrDDDgQAvLfcaPBALBYTGSkoGQUICARhMBM5gBMiYQupjoKThOBBSHhXt0PkIRDoztaXodGIwFcvhZ5xH8kVBmZ9Ey8MBhGCfS8JAQF8fVcoAwwMCW9waQ4JCQUQl1VgEw6dAw6faGlDAwMmSlZMK6aRKUwnp7M4MK5ouSl3B7W7IiEAIfkECQIAEwAsAAAAABYAFgAABZXgJI5DIZ3oMa6rEyHAgs4qKw4CsizA7DuswYOA0BEOEqRPAhwpHkNCYNBSokYJgeAhgNhE1qRI0RA0qF/wbFJQkAvplfWQMNjjrRkjEkngVzMBgnB/InoJDF6FEzMQBQlohTMlEJF4DjMOAwMONXhzDqFITWmYVxMHVqQsYZ4+niKdPnlLqUtMrLe3sHK6J7w2tq9fIQA7' /></div><div style='display: inline-block; color: #b4b4b4; font-size: 18px;line-height: 100px;vertical-align:middle'>" + o + "</div></div></body></html>"), window.providerPopup | |
}, creditCard = angular.module("creditCardModule", ["checkoutModule", "tp.i18n", "braintreeCommonModule"]), | |
EVENT_CC_INITIATED = "EVENT_CC_INITIATED", EVENT_CC_PROCESSING = "EVENT_CC_PROCESSING", | |
EVENT_CC_PROCESSED = "EVENT_CC_PROCESSED", EVENT_CC_FAILED = "EVENT_CC_FAILED", | |
EVENT_CC_DECLINED = "EVENT_CC_DECLINED", EVENT_CHECKOUT_STARTED = "EVENT_CHECKOUT_STARTED"; | |
creditCard.factory("creditCard", ["$rootScope", "errorService", "lang", "$q", function (e, t, n, r) { | |
var o = { | |
initiateSucceed: function (t) { | |
e.$broadcast(EVENT_CC_INITIATED, t) | |
}, initiateFailed: function (e) { | |
t().terminal(e && e[0] && e[0].msg ? e[0].msg + " " + n.trc("checkout.platform", "Please contact support to get help.") : n.trc("checkout.platform", "Unknown error.") + " " + n.trc("checkout.platform", "Please contact support to get help.")) | |
}, beforeProcess: function () { | |
e.$broadcast(EVENT_CC_PROCESSING) | |
}, processSucceed: function (t) { | |
var n = r.defer(); | |
return e.$broadcast(EVENT_CC_PROCESSED, t, n), n.promise | |
}, declined: function (t) { | |
e.$broadcast(EVENT_CC_DECLINED, t ? t.message : n.trc("checkout.platform", "Unknown error.")) | |
}, completeFailed: function (t) { | |
e.$broadcast(EVENT_CC_FAILED, t && t.length > 0 ? t[0].msg : n.trc("checkout.platform", "Unknown error.")) | |
} | |
}; | |
return o | |
}]), creditCard.factory("creditCardService", ["tpHTTP", "$q", "$timeout", "$window", "checkout", "errorService", "lang", function (e, t, n, r, o, i, a) { | |
var c = {payWithNew: !0, selectedUpiId: null, initiated: !1, defaultPaymentMethodId: null}, | |
s = {store_in_vault: !0}; | |
return { | |
cc: c, credit_card: s, processCC: function (e, t, n, r) { | |
o.disableCheckout(); | |
if (e.cc.payWithNew) { | |
var c = n.trData, s = n.trUrl; | |
if (!function (e) { | |
if (!e) return !1; | |
return /^(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/.test(e) | |
}(s)) return i(e).global(a.trc("checkout.platform", "Redirect URL is not valid")), o.enabledCheckout(), void r.reject(); | |
angular.element("#bt_post_frame").remove(), angular.element("#bt_form").remove(); | |
var l = angular.element('<iframe name="bt_post_frame" id="bt_post_frame" style="display: none"></iframe>'), | |
u = angular.element('<form id="bt_form" method="POST" target="bt_post_frame" action="' + s + '">'), | |
d = [{name: "", btName: "tr_data", value: c}, { | |
name: "", | |
btName: "transaction[options][add_billing_address_to_payment_method]", | |
value: !0 | |
}, { | |
name: "num", | |
btName: "transaction[credit_card][number]", | |
value: "" | |
}, { | |
name: "expire_month", | |
btName: "transaction[credit_card][expiration_month]", | |
value: "" | |
}, { | |
name: "expire_year", | |
btName: "transaction[credit_card][expiration_year]", | |
value: "" | |
}, { | |
name: "cvv", | |
btName: "transaction[credit_card][cvv]", | |
value: "" | |
}, { | |
name: "store_in_vault", | |
btName: "transaction[options][store_in_vault_on_success]", | |
value: !0 | |
}, { | |
name: "postal_code", | |
btName: "transaction[billing][postal_code]", | |
value: "" | |
}, { | |
name: "email", | |
btName: "transaction[customer][email]", | |
value: o.config.user.email | |
}, { | |
name: "first_name", | |
btName: "transaction[customer][first_name]", | |
value: o.input.user_data.first_name | |
}, { | |
name: "last_name", | |
btName: "transaction[customer][last_name]", | |
value: o.input.user_data.last_name | |
}], p = e.ccForm || {}; | |
angular.forEach(d, function (e) { | |
void 0 !== p[e.name] && (e.value = p[e.name].$modelValue); | |
var t = angular.element("<input type='hidden'>"); | |
t.attr("name", e.btName), t.val(e.value), u.append(t) | |
}), t.append(l), t.append(u), u.submit() | |
} else { | |
angular.element("#bt_form").remove(); | |
var f = e.cc.storedRurl + "&id=" + e.cc.selectedUpiId, | |
l = angular.element('<iframe name="bt_post_frame" id="bt_post_frame" style="display: none" src="' + f + '"></iframe>'); | |
t.append(l) | |
} | |
return !0 | |
} | |
} | |
}]), creditCard.directive("ccFormComponent", ["checkout", "$rootElement", "errorService", "creditCardService", "lang", "braintreeFactory", "viewService", "$q", "paymentProvider", "iframeService", function (e, t, n, r, o, i, a, c, s, l) { | |
return { | |
restrict: "A", | |
require: "^view", | |
transclude: !0, | |
templateUrl: "/widget/checkout/component/partials/cc-form-component.html", | |
scope: {skipValidation: "@"}, | |
link: function (e, t, n, r) { | |
r.registerComponentController(e) | |
}, | |
controller: ["$scope", "errorService", "$timeout", "ngEventService", function (n, u, d, p) { | |
angular.extend(n, BaseComponentController); | |
var f = null; | |
n.isBraintreeV3 = function () { | |
return "V3_3DS2" === f | |
}; | |
var m, h = !1, g = null, v = !1, y = {}; | |
function E() { | |
n.cc = r.cc, n.credit_card = r.credit_card | |
} | |
p.subscribe(EVENT_CHECKOUT_STARTED, function () { | |
E() | |
}), E(); | |
var C = function (e) { | |
return !isNaN(e) && parseInt(Number(e)) == e && !isNaN(parseInt(e, 10)) | |
}; | |
function T(e) { | |
if (u(n).reset(), Array.isArray(e)) for (var t = 0; t < e.length; t++) { | |
var r = e[t].msg || e[t].message; | |
r && "" !== r.trim() && u(n).global(r) | |
} else u(n).global(e.message) | |
} | |
function _(t) { | |
i.getNonceData(g).then(function (t) { | |
var n = { | |
amount: e.input.chargeAmount || e.input.originalChargeAmount, | |
nonce: t.nonce, | |
threeDSecure: g.threeDSecureInstance, | |
addFrameCallback: function (t, n) { | |
y.callbackOnInit = function (t) { | |
e.enabledCheckout(), document.getElementById(t.loaderWrapperId).style.display = "none", l.injectRealIframe(t.iframeId, n, angular.element("#bank-secure-container")) | |
}, e.goToBankSecureState(), p.fire("INIT_BANK_SECURE") | |
} | |
}; | |
return i.verifyCard(n) | |
}).then(function (r) { | |
n.skipValidation = !0, v = !0, e.input.paymentMethodNonce = r.nonce, t.resolve(!0) | |
}).catch(function (e) { | |
S(e, t) | |
}) | |
} | |
function S(t, n) { | |
v = !1, e.enabledCheckout(), T(t), n.reject(!1) | |
} | |
n.$on(EVENT_CC_FAILED, function (t, r) { | |
e.enabledCheckout(), u(n).global(r) | |
}), n.$on(EVENT_CC_DECLINED, function (t, n) { | |
e.enabledCheckout() | |
}), n.$on(EVENT_CC_INITIATED, function (t, o) { | |
var a; | |
n.cc.defaultPaymentMethodId = o.defaultPaymentMethodId, r.cc.stored = JSON.parse(o.stored), r.cc.storedRurl = o.stored_rurl, r.cc.payWithNew = 0 === n.cc.stored.length || r.cc.payWithNew && r.cc.initiated, r.cc.selectedUpiId = r.cc.stored.length > 0 ? r.cc.stored[0].id : null, r.cc.initiated = !0, n.updateUpiInfo(), f = o.version, !1 === h && !0 === n.isBraintreeV3() && (o.isEditing = !1, a = o, e.disableCheckout(), i.initHostedFields(a).then(function (t) { | |
e.enabledCheckout(), h = !0, g = t | |
}).catch(function (t) { | |
T(t), e.enabledCheckout() | |
})), d(function () { | |
n.$apply() | |
}) | |
}), n.$on("BANK_SECURE_COMPONENT_INIT_SUCCESS", function () { | |
p.fire("INIT_BANK_SECURE") | |
}), n.$watch("cc.selectedUpiId ", function () { | |
n.updateUpiInfo() | |
}), n.updateUpiInfo = function () { | |
e.input.credit_card = n.getCurrentCreditCardInfo(), e.input.upiId = r.cc.selectedUpiId, e.input.upiId && e.input.credit_card.taxRequest && e.billingConfig.updateFromTaxRequest(e.input.credit_card.taxRequest) | |
}, n.$watch("credit_card.num ", function () { | |
e.input.credit_card = n.getCurrentCreditCardInfo() | |
}), n.$watch("credit_card.expire_month ", function () { | |
e.input.credit_card = n.getCurrentCreditCardInfo() | |
}), n.$watch("credit_card.expire_year ", function () { | |
e.input.credit_card = n.getCurrentCreditCardInfo() | |
}), n.$on(EVENT_CC_PROCESSED, function (o, a, c) { | |
!0 === n.isBraintreeV3() ? (a.payWithNew = n.cc.payWithNew, a.paymentMethodNonce = e.input.paymentMethodNonce, a.email = e.config.user.email, a.first_name = e.input.user_data.first_name, a.last_name = e.input.user_data.last_name, a.storedRurl = r.cc.storedRurl, a.selectedUpiId = n.cc.selectedUpiId, i.processCc(t, a)) : r.processCC(n, t, a, c) | |
}), y.goBackToPreviousState = function () { | |
v = !1, a.gotoPreviousState(), m && m.reject(), g.threeDSecureInstance.cancelVerifyCard(function (e, t) { | |
e && T(e) | |
}) | |
}, n.customActionOnCompletePurchase = function () { | |
return !e.isPaymentMethod(CREDIT_CARD) || e.isMockUsed() ? (n.skipValidation = !0, c.when(!0)) : !1 === n.isBraintreeV3() ? n._isValid() : (m = c.defer(), !0 === v || !0 !== n.cc.payWithNew ? (n.skipValidation = !0, m.resolve(!0)) : e.isConfirmStepEnabled() ? "confirmation" === a.getActiveState() ? _(m) : (t = m, u(n).reset(), i.getNonceData(g).then(function () { | |
t.resolve(!0) | |
}).catch(function (e) { | |
S(e, t) | |
})) : _(m), m.promise); | |
var t | |
}, n._isValid = function () { | |
if (u(n).reset(), !e.isPaymentMethod(CREDIT_CARD) || e.isMockUsed()) return !0; | |
if (!0 === toBoolean(n.skipValidation)) return !0; | |
if (r.cc.payWithNew) { | |
if (0 == n.ccForm.$valid) { | |
for (var t = [{ | |
name: "num", | |
msg: o.trc("checkout.platform", "Credit card number is required") | |
}, { | |
name: "expire_month", | |
msg: o.trc("checkout.platform", "Expired month is required") | |
}, { | |
name: "expire_year", | |
msg: o.trc("checkout.platform", "Expired year is required") | |
}, { | |
name: "cvv", | |
msg: o.trc("checkout.platform", "CVV is required") | |
}, { | |
name: "postal_code", | |
msg: o.trc("checkout.platform", "Postal code is required") | |
}], i = 0; i < t.length; i++) { | |
var a = t[i]; | |
if (n.ccForm[a.name]) if (n.ccForm[a.name].$invalid) { | |
u(n).global(a.msg); | |
break | |
} | |
} | |
return !1 | |
} | |
if (!w(n.credit_card.num)) return u(n).global(o.trc("checkout.platform", "Invalid credit card number")), !1; | |
if (!function (e, t) { | |
if (!C(e) || !C(t)) return !1; | |
var n = parseInt(e, 10), r = parseInt(t, 10); | |
if (n < 1 || n > 12) return !1; | |
if (r < 0) return !1; | |
r < 100 && (r += 2e3); | |
var o = new Date; | |
o.setDate(1), o.setHours(0), o.setMinutes(0), o.setSeconds(0), o.setMilliseconds(0); | |
var i = new Date; | |
return i.setDate(1), i.setMonth(n - 1), i.setYear(r), i.setHours(0), i.setMinutes(0), i.setSeconds(0), i.setMilliseconds(0), o.getTime() <= i.getTime() | |
}(n.credit_card.expire_month, n.credit_card.expire_year)) return u(n).global(o.trc("checkout.platform", "Invalid expiration date")), !1 | |
} else if (!r.cc.selectedUpiId) return u(n).global(o.trc("checkout.platform", "Please select one of your cards or add new one")), !1; | |
return !0 | |
}, n.$on(EVENT_CC_PROCESSING, function () { | |
n.cc.payWithNew && (n.cc.selectedUpiId = null, r.cc.selectedUpiId = null, e.input.upiId = null), e.input.storeInVault = n.credit_card.store_in_vault, e.input.defaultPaymentMethodId = n.credit_card.store_in_vault && n.cc.defaultPaymentMethodId | |
}); | |
var w = function (e) { | |
if (!e.match(/^\d+$/)) return !1; | |
for (var t = e.length, n = 1 & t, r = 0, o = 0; o < t; o++) { | |
var i = parseInt(e.charAt(o)); | |
1 & o ^ n || (i *= 2) > 9 && (i -= 9), r += i | |
} | |
return r % 10 == 0 | |
}, b = {shortName: "card", longName: "Credit card"}, A = function (e) { | |
for (var t = {shortName: "v", longName: "Visa"}, n = [{ | |
type: t, | |
rname: "electron", | |
rgxp: /^(4026|417500|4405|4508|4844|4913|4917)\d+$/ | |
}, { | |
type: b, | |
rname: "maestro", | |
rgxp: /^(5018|5020|5038|5612|5893|6304|6759|6761|6762|6763|0604|6390)\d+$/ | |
}, {type: b, rname: "dankort", rgxp: /^(5019)\d+$/}, { | |
type: b, | |
rname: "interpayment", | |
rgxp: /^(636)\d+$/ | |
}, {type: b, rname: "unionpay", rgxp: /^(62|88)\d+$/}, { | |
type: t, | |
rname: "visa", | |
rgxp: /^4[0-9]{12}(?:[0-9]{3})?$/ | |
}, { | |
type: {shortName: "mc", longName: "MasterCard"}, | |
rname: "mastercard", | |
rgxp: /^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/ | |
}, { | |
type: {shortName: "amex", longName: "American Express"}, | |
rname: "amex", | |
rgxp: /^3[47][0-9]{13}$/ | |
}, { | |
type: {shortName: "dci", longName: "Diners Club"}, | |
rname: "diners", | |
rgxp: /^3(?:0[0-5]|[68][0-9])[0-9]{11}$/ | |
}, { | |
type: {shortName: "d", longName: "Discover"}, | |
rname: "discover", | |
rgxp: /^6(?:011|5[0-9]{2})[0-9]{12}$/ | |
}, { | |
type: b, | |
rname: "jcb", | |
rgxp: /^(?:2131|1800|35\d{3})\d{11}$/ | |
}], r = 0; r < n.length; r++) { | |
var o = n[r]; | |
if (o.rgxp.test(e)) return o.type | |
} | |
return b | |
}; | |
n.getCurrentCreditCardInfo = function () { | |
if (r.cc.payWithNew) return { | |
type: A(n.credit_card.num), | |
ending: n.credit_card.num ? n.credit_card.num.slice(-4) : "", | |
expireMonth: n.credit_card.expire_month, | |
expireYear: n.credit_card.expire_year | |
}; | |
if (r.cc.selectedUpiId) for (var t = 0; t < r.cc.stored.length; t++) { | |
var o = r.cc.stored[t]; | |
if (o.id == r.cc.selectedUpiId) return { | |
type: {shortName: o.identifier, longName: o.type}, | |
ending: o.ending_in, | |
expireMonth: o.expire_month, | |
expireYear: o.expire_year, | |
taxRequest: e.billingConfig.taxRequestFromUpi(o) | |
} | |
} | |
return { | |
type: b, | |
ending: n.credit_card.num ? n.credit_card.num.slice(-4) : "", | |
expireMonth: n.credit_card.expire_month, | |
expireYear: n.credit_card.expire_year | |
} | |
}, n.expireYears = getYears(), n.expireMonths = getMonths(), s.setInstance(y), propagatePaymentVars(e, n) | |
}] | |
} | |
}]); | |
var payPal = angular.module("payPalModule", ["checkoutModule"]); | |
payPal.factory("payPal", function () { | |
var e, t = {}; | |
return t.beforeInitiate = function () { | |
}, t.initiateSucceed = function (e) { | |
}, t.initiateFailed = function (e) { | |
}, t.beforeProcess = function () { | |
e = createPaymentPopUp(1200, 800, "PayPal") | |
}, t.processSucceed = function (t) { | |
e.location.href = t.url | |
}, t.processFailed = function (e) { | |
}, t.confirmed = function (t) { | |
e.close() | |
}, t.declined = function (t) { | |
e.close() | |
}, t.completeSucceed = function (e) { | |
}, t.completeFailed = function (e) { | |
}, t | |
}), payPal.directive("paypalFormComponent", ["checkout", function (e) { | |
return { | |
restrict: "A", | |
require: "^view", | |
transclude: !0, | |
templateUrl: "/widget/checkout/component/partials/paypal-form-component.html", | |
scope: {skipValidation: "@"}, | |
link: function (e, t, n, r) { | |
r.registerComponentController(e) | |
}, | |
controller: ["$scope", "errorService", function (t, n) { | |
angular.extend(t, BaseComponentController), t._isValid = function () { | |
return n(t).reset(), !e.isPaymentMethod(PAYPAL) || e.isMockUsed(), !0 | |
}, propagatePaymentVars(e, t) | |
}] | |
} | |
}]); | |
var dwolla = angular.module("dwollaModule", ["checkoutModule"]), | |
EVENT_PREVIEW_DWOLLA_TERM_COMPLETE = "EVENT_PREVIEW_DWOLLA_TERM_COMPLETE", | |
EVENT_DWOLLA_INIT = "EVENT_DWOLLA_INIT", EVENT_DWOLLA_SUBMIT = "EVENT_DWOLLA_SUBMIT", | |
EVENT_DWOLLA_ERROR = "EVENT_DWOLLA_ERROR"; | |
dwolla.factory("dwolla", ["$rootScope", "$rootElement", function (e, t) { | |
var n = { | |
initiateSucceed: function (t) { | |
var n = {}; | |
n.loginUrl = t.loginUrl, n.isRecurring = "true" == t.isRecurring, n.sources = angular.fromJson(t.sources), n.id = t.id, n.storePin = !0, e.$broadcast(EVENT_DWOLLA_INIT, n) | |
}, processSucceed: function (t) { | |
var n = {}; | |
n.rurl = t.rurl, e.$broadcast(EVENT_DWOLLA_SUBMIT, n) | |
}, completeFailed: function (t) { | |
e.$broadcast(EVENT_DWOLLA_ERROR, t && t.length > 0 ? t[0].msg : "Unknown error") | |
} | |
}; | |
return n | |
}]), dwolla.directive("dwollaFormComponent", ["checkout", "$rootElement", function (e, t) { | |
return { | |
restrict: "A", | |
require: "^view", | |
transclude: !0, | |
templateUrl: "/widget/checkout/component/partials/dwolla-form-component.html", | |
scope: {skipValidation: "@"}, | |
link: function (e, t, n, r) { | |
r.registerComponentController(e) | |
}, | |
controller: ["$scope", "$element", "errorService", function (n, r, o) { | |
angular.extend(n, BaseComponentController), n.dwolla = {}, function (t, n) { | |
var r; | |
t.dwolla.login = function () { | |
(r = createPaymentPopUp(800, 600, "Dwolla")).location.href = t.dwolla.loginUrl | |
}, t.$on(EVENT_PREVIEW_DWOLLA_TERM_COMPLETE, function (t, n) { | |
e._completeTerm({q: "q"}) | |
}), t.$on("dwolla-login-complete", function (e, n) { | |
t.dwolla.sources = angular.fromJson(n.sources), t.dwolla.id = n.id, t.$apply(), r.close() | |
}), t.$on("dwolla-login-error", function (e, n) { | |
t.dwolla.error = n.error, t.$apply(), r.close() | |
}), n.find("#dwolla_login_button").click(function () { | |
t.dwolla.login() | |
}) | |
}(n, r), n.$on(EVENT_DWOLLA_INIT, function (e, t) { | |
n.dwolla.loginUrl = t.loginUrl, n.dwolla.isRecurring = t.isRecurring, n.dwolla.sources = t.sources, n.dwolla.id = t.id, n.dwolla.storePin = !0, n.dwolla.sources && n.dwolla.sources.length > 0 && (n.dwolla.source = n.dwolla.sources[0], n.dwolla.sources.forEach(function (e) { | |
"true" === e.selected && (n.dwolla.source = e) | |
})) | |
}), n.$on(EVENT_DWOLLA_SUBMIT, function (e, r) { | |
angular.element("#dwolla_frame").remove(); | |
var o = r.rurl + "&funding_source=" + n.dwolla.source.id + "&pincode=" + n.dwolla.pin + "&storePin=" + n.dwolla.storePin + "&id=" + n.dwolla.id, | |
i = angular.element('<iframe name="dwolla_frame" id="dwolla_frame" style="display: none" src="' + o + '"></iframe>'); | |
t.append(i) | |
}), n.$on(EVENT_DWOLLA_ERROR, function (e, t) { | |
o(n).reset(), o(n).global(t) | |
}), n._isValid = function () { | |
return o(n).reset(), !(e.isPaymentMethod(DWOLLA) && !e.isMockUsed()) || (o(n).reset(), n.dwolla.source ? !(!n.dwolla.pin || "" == n.dwolla.pin) || (o(n).global("Enter the pincode"), !1) : (o(n).global("Select where to pay from"), !1)) | |
}, propagatePaymentVars(e, n) | |
}] | |
} | |
}]); | |
var amazonmws = angular.module("amazonmwsModule", ["checkoutModule"]), | |
EVENT_PREVIEW_TERM_COMPLETE = "EVENT_PREVIEW_TERM_COMPLETE", EVENT_AMAZON_INIT = "EVENT_AMAZON_INIT", | |
EVENT_AMAZON_SUBMIT = "EVENT_AMAZON_SUBMIT"; | |
amazonmws.factory("amazonmws", ["$rootScope", function (e) { | |
var t = { | |
initiateSucceed: function (t) { | |
e.$broadcast(EVENT_AMAZON_INIT, t) | |
}, processSucceed: function (t) { | |
e.$broadcast(EVENT_AMAZON_SUBMIT, t) | |
} | |
}; | |
return t | |
}]), amazonmws.directive("amazonFormComponent", ["$rootElement", "errorService", function (e, t) { | |
return { | |
restrict: "A", | |
require: "^view", | |
transclude: !0, | |
templateUrl: "/widget/checkout/component/partials/amazon-form-component.html", | |
scope: {skipValidation: "@"}, | |
link: function (e, t, n, r) { | |
r.registerComponentController(e) | |
}, | |
controller: ["$scope", "checkout", function (n, r) { | |
angular.extend(n, BaseComponentController); | |
var o = null, i = null, a = null; | |
n.$on(EVENT_PREVIEW_TERM_COMPLETE, function () { | |
r._completeTerm({q: "q"}) | |
}), n.$on(EVENT_AMAZON_INIT, function (e, t) { | |
o = t.sellerId, a = t.clientId, i = "true" == t.isRecurring, n.amazon.isRecurring = i, window.onAmazonLoginReady = function () { | |
amazon.Login.setClientId(a) | |
}, amazon.Login.setClientId(a), m.schedule(), p() | |
}), n.$on(EVENT_AMAZON_SUBMIT, function (t, r) { | |
angular.element("#amazon_frame").remove(); | |
var o = r.rurl + "&order_reference_id=" + encodeURIComponent(n.amazon.order) + "&resource=" + encodeURIComponent(r.resource), | |
i = angular.element('<iframe name="amazon_frame" id="amazon_frame" style="display: none" src="' + o + '"></iframe>'); | |
e.append(i) | |
}), n._isValid = function () { | |
return t(n).reset(), !(r.isPaymentMethod(AMAZON) && !r.isMockUsed()) || (!(i && !n.amazon.buyerBillingAgreementConsentStatus) || (t(n).global("Please check the box below to allow Tinypass to auto renew your subscription."), !1)) | |
}, propagatePaymentVars(r, n); | |
n.amazon = {}, n.amazon.isRecurring = null, n.amazon.loggedIn = !1, n.amazon.loading = !0, n.amazon.techError = !1, n.amazon.order = null, n.amazon.buyerBillingAgreementConsentStatus = !1; | |
var c, s, l, u = function () { | |
util.log("[AMAZON] createButton"), h(), new OffAmazonPayments.Button("login_widget", o, { | |
type: "LwA", | |
agreementType: i ? "BillingAgreement" : void 0, | |
useAmazonAddressBook: !1, | |
authorization: function (e) { | |
util.log("[AMAZON] createButton:authorization", e), n.amazon.loading = !1, n.$apply(), loginOptions = { | |
scope: "payments:widget", | |
popup: !0 | |
}, authRequest = amazon.Login.authorize(loginOptions) | |
}, | |
onSignIn: function (e) { | |
util.log("[AMAZON] createButton:onSignIn [isRecurring=" + i + "]", e), n.amazon.order = i ? e.getAmazonBillingAgreementId() : e.getAmazonOrderReferenceId(), n.amazon.loggedIn = !0, n.$apply(), p() | |
}, | |
onError: function (e) { | |
util.log("[AMAZON] createButton:onError", e), g("[AMAZON LOGIN UNKNOWN ERROR] " + e.getErrorCode()) | |
} | |
}) | |
}, d = function () { | |
return !(i && "C" !== n.amazon.order.substr(0, 1) || !i && "S" !== n.amazon.order.substr(0, 1)) || (util.log("[AMAZON] Wrong order for this type, relogin [order=" + n.amazon.order + "]"), n.amazon.loggedIn = !1, n.amazon.loading = !0, n.amazon.order = null, n.$apply(), m.schedule(), u(), !1) | |
}, p = function () { | |
util.log("[AMAZON] createWallet [isRecurring=" + i + "]"), n.amazon.loading = !0, new OffAmazonPayments.Widgets.Wallet({ | |
sellerId: o, | |
agreementType: i ? "BillingAgreement" : void 0, | |
onBillingAgreementCreate: function (e) { | |
n.amazon.order = e.getAmazonBillingAgreementId(), util.log("[AMAZON] createWallet:onBillingAgreementCreate [order=" + n.amazon.order + "]", e), d() && (i && f(n.amazon.order), m.cancel(), n.amazon.loggedIn = !0, n.amazon.loading = !1, n.$apply()) | |
}, | |
onOrderReferenceCreate: function (e) { | |
n.amazon.order = e.getAmazonOrderReferenceId(), util.log("[AMAZON] createWallet:onOrderReferenceCreate [order=" + n.amazon.order + "]", e), d() && (m.cancel(), n.amazon.loggedIn = !0, n.amazon.loading = !1, n.$apply()) | |
}, | |
design: {size: {width: r.getWidthTerm() - 50 + "px", height: "100px"}}, | |
onPaymentSelect: function (e) { | |
util.log("[AMAZON] createWallet:onPaymentSelect [order=" + n.amazon.order + "]", e), d() && (m.cancel(), n.amazon.loggedIn = !0, n.amazon.loading = !1, n.$apply()) | |
}, | |
onError: function (e) { | |
util.log("[AMAZON] createWallet:onError", e.getErrorCode(), e), "BuyerSessionExpired" == e.getErrorCode() ? u() : g("[AMAZON WALLET UNKNOWN ERROR]" + e.getErrorCode()) | |
} | |
}).bind("wallet_widget") | |
}, f = function (e) { | |
i && (util.log("[AMAZON] createConsent [billingAgreementId=" + e + "]"), new OffAmazonPayments.Widgets.Consent({ | |
sellerId: o, | |
amazonBillingAgreementId: e, | |
design: {size: {width: r.getWidthTerm() - 50 + "", height: "260"}}, | |
onReady: function (e) { | |
n.amazon.buyerBillingAgreementConsentStatus = "true" == e.getConsentStatus(), util.log("[AMAZON] createConsent:onReady: [buyerBillingAgreementConsentStatus=" + n.amazon.buyerBillingAgreementConsentStatus + "]") | |
}, | |
onConsent: function (e) { | |
n.amazon.buyerBillingAgreementConsentStatus = "true" == e.getConsentStatus(), util.log("[AMAZON] createConsent:onConsent: [buyerBillingAgreementConsentStatus=" + n.amazon.buyerBillingAgreementConsentStatus + "]") | |
}, | |
onError: function (t) { | |
"InvalidBillingAgreementId" == t.getErrorCode() ? (util.log("[AMAZON] createConsent:onError [InvalidBillingAgreementId=" + e + "]"), n.amazon.loggedIn = !1, n.$apply(), u()) : g("[AMAZON CONSENT UNKNOWN ERROR] " + t.getErrorCode()) | |
} | |
}).bind("consent_widget")) | |
}, m = (s = !1, l = function () { | |
c = setTimeout(function () { | |
0 == $("#login_widget").children().length && 0 == $("#wallet_widget").children().length && (s ? (console.warn("[AMAZON] Loading failed, show the error screen"), n.amazon.techError = !0, n.$apply()) : (s = !0, console.warn("[AMAZON] Loading failed, trying to clear the cookies"), document.cookie = "amazon_Login_accessToken=", l(), u())) | |
}, 1e4) | |
}, { | |
schedule: function () { | |
l() | |
}, cancel: function () { | |
clearTimeout(c) | |
} | |
}), h = function () { | |
var e = setInterval(function () { | |
($("#login_widget").children().length > 0 || $("#wallet_widget").children().length > 0) && (util.log("[AMAZON] loading completed"), n.amazon.loading = !1, n.$apply(), clearInterval(e)) | |
}, 100) | |
}, g = function (e) { | |
n.techError = !0, n.$apply() | |
} | |
}] | |
} | |
}]); | |
var EVENT_PREVIEW_COINBASE_TERM_COMPLETE = "EVENT_PREVIEW_COINBASE_TERM_COMPLETE", | |
coinbase = angular.module("coinbaseModule", ["checkoutModule"]); | |
coinbase.factory("coinbase", function () { | |
var e, t = {}; | |
return t.beforeProcess = function () { | |
e = createPaymentPopUp(1200, 700, "Coinbase") | |
}, t.processSucceed = function (t) { | |
e.location.href = t.url | |
}, t.confirmed = function (t) { | |
e.close() | |
}, t.declined = function (t) { | |
e.close() | |
}, t | |
}), coinbase.directive("coinbaseFormComponent", ["checkout", function (e) { | |
return { | |
restrict: "A", | |
require: "^view", | |
transclude: !0, | |
templateUrl: "/widget/checkout/component/partials/coinbase-form-component.html", | |
scope: {skipValidation: "@"}, | |
link: function (e, t, n, r) { | |
r.registerComponentController(e) | |
}, | |
controller: ["$scope", "errorService", function (t, n) { | |
angular.extend(t, BaseComponentController), t.$on(EVENT_PREVIEW_COINBASE_TERM_COMPLETE, function () { | |
e._completeTerm({q: "q"}) | |
}), t._isValid = function () { | |
return n(t).reset(), !e.isPaymentMethod(COINBASE) || e.isMockUsed(), !0 | |
}, propagatePaymentVars(e, t) | |
}] | |
} | |
}]); | |
var mock = angular.module("mockModule", ["checkoutModule"]), | |
EVENT_MOCK_PROCESS_SUCCEED = "EVENT_MOCK_PROCESS_SUCCEED", | |
EVENT_MOCK_PROCESS_CONFIRMED = "EVENT_MOCK_PROCESS_CONFIRMED"; | |
mock.factory("mock", ["$rootScope", function (e) { | |
var t = { | |
beforeInitiate: function () { | |
}, initiateSucceed: function (e) { | |
}, initiateFailed: function (e) { | |
}, beforeProcess: function () { | |
}, processSucceed: function (t) { | |
e.$broadcast(EVENT_MOCK_PROCESS_SUCCEED, t) | |
}, processFailed: function (e) { | |
}, confirmed: function (t) { | |
e.$broadcast(EVENT_MOCK_PROCESS_CONFIRMED, t) | |
}, declined: function (e) { | |
}, completeSucceed: function (e) { | |
}, completeFailed: function (e) { | |
} | |
}; | |
return t | |
}]), mock.directive("mockFormComponent", ["checkout", "tpHTTP", function (e, t) { | |
return { | |
restrict: "A", | |
require: "^view", | |
transclude: !0, | |
templateUrl: "/widget/checkout/component/partials/mock-form-component.html", | |
scope: {skipValidation: "@"}, | |
link: function (e, t, n, r) { | |
r.registerComponentController(e) | |
}, | |
controller: ["$scope", "$rootElement", "checkout", function (e, n, r) { | |
angular. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment