Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ! function(a) {
- var b = "object" == typeof exports && exports,
- c = "object" == typeof module && module && module.exports == b && module,
- d = "object" == typeof global && global;
- d.global !== d && d.window !== d || (a = d);
- var e = function(a) {
- this.message = a
- };
- e.prototype = new Error, e.prototype.name = "InvalidCharacterError";
- var f = function(a) {
- throw new e(a)
- },
- g = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
- h = /[\t\n\f\r ]/g,
- i = function(a) {
- a = String(a).replace(h, "");
- var b = a.length;
- b % 4 == 0 && (a = a.replace(/==?$/, ""), b = a.length), (b % 4 == 1 || /[^+a-zA-Z0-9/]/.test(a)) && f("Invalid character: the string to be decoded is not correctly encoded.");
- for (var c, d, e = 0, i = "", j = -1; ++j < b;) d = g.indexOf(a.charAt(j)), c = e % 4 ? 64 * c + d : d, e++ % 4 && (i += String.fromCharCode(255 & c >> (-2 * e & 6)));
- return i
- },
- j = function(a) {
- a = String(a), /[^\0-\xFF]/.test(a) && f("The string to be encoded contains characters outside of the Latin1 range.");
- for (var b, c, d, e, h = a.length % 3, i = "", j = -1, k = a.length - h; ++j < k;) b = a.charCodeAt(j) << 16, c = a.charCodeAt(++j) << 8, d = a.charCodeAt(++j), e = b + c + d, i += g.charAt(e >> 18 & 63) + g.charAt(e >> 12 & 63) + g.charAt(e >> 6 & 63) + g.charAt(63 & e);
- return 2 == h ? (b = a.charCodeAt(j) << 8, c = a.charCodeAt(++j), e = b + c, i += g.charAt(e >> 10) + g.charAt(e >> 4 & 63) + g.charAt(e << 2 & 63) + "=") : 1 == h && (e = a.charCodeAt(j), i += g.charAt(e >> 2) + g.charAt(e << 4 & 63) + "=="), i
- },
- k = {
- encode: j,
- decode: i,
- version: "0.1.0"
- };
- if ("function" == typeof define && "object" == typeof define.amd && define.amd) define(function() {
- return k
- });
- else if (b && !b.nodeType)
- if (c) c.exports = k;
- else
- for (var l in k) k.hasOwnProperty(l) && (b[l] = k[l]);
- else a.base64 = k
- }(this),
- function(a, b) {
- "use strict";
- var c = function(a) {
- if ("object" != typeof a.document) throw new Error("Cookies.js requires a `window` with a `document` object");
- var c = function(a, b, d) {
- return 1 === arguments.length ? c.get(a) : c.set(a, b, d)
- };
- return c._document = a.document, c._cacheKeyPrefix = "cookey.", c._maxExpireDate = new Date("Fri, 31 Dec 9999 23:59:59 UTC"), c.defaults = {
- path: "/",
- secure: !1
- }, c.get = function(a) {
- c._cachedDocumentCookie !== c._document.cookie && c._renewCache();
- var d = c._cache[c._cacheKeyPrefix + a];
- return d === b ? b : decodeURIComponent(d)
- }, c.set = function(a, d, e) {
- return e = c._getExtendedOptions(e), e.expires = c._getExpiresDate(d === b ? -1 : e.expires), c._document.cookie = c._generateCookieString(a, d, e), c
- }, c.expire = function(a, d) {
- return c.set(a, b, d)
- }, c._getExtendedOptions = function(a) {
- return {
- path: a && a.path || c.defaults.path,
- domain: a && a.domain || c.defaults.domain,
- expires: a && a.expires || c.defaults.expires,
- secure: a && a.secure !== b ? a.secure : c.defaults.secure
- }
- }, c._isValidDate = function(a) {
- return "[object Date]" === Object.prototype.toString.call(a) && !isNaN(a.getTime())
- }, c._getExpiresDate = function(a, b) {
- if (b = b || new Date, "number" == typeof a ? a = a === 1 / 0 ? c._maxExpireDate : new Date(b.getTime() + 1e3 * a) : "string" == typeof a && (a = new Date(a)), a && !c._isValidDate(a)) throw new Error("`expires` parameter cannot be converted to a valid Date instance");
- return a
- }, c._generateCookieString = function(a, b, c) {
- a = a.replace(/[^#$&+\^`|]/g, encodeURIComponent), a = a.replace(/\(/g, "%28").replace(/\)/g, "%29"), b = (b + "").replace(/[^!#$&-+\--:<-\[\]-~]/g, encodeURIComponent), c = c || {};
- var d = a + "=" + b;
- return d += c.path ? ";path=" + c.path : "", d += c.domain ? ";domain=" + c.domain : "", d += c.expires ? ";expires=" + c.expires.toUTCString() : "", d += c.secure ? ";secure" : ""
- }, c._getCacheFromString = function(a) {
- for (var d = {}, e = a ? a.split("; ") : [], f = 0; f < e.length; f++) {
- var g = c._getKeyValuePairFromCookieString(e[f]);
- d[c._cacheKeyPrefix + g.key] === b && (d[c._cacheKeyPrefix + g.key] = g.value)
- }
- return d
- }, c._getKeyValuePairFromCookieString = function(a) {
- var b = a.indexOf("=");
- b = b < 0 ? a.length : b;
- var c, d = a.substr(0, b);
- try {
- c = decodeURIComponent(d)
- } catch (a) {
- console && "function" == typeof console.error && console.error('Could not decode cookie with key "' + d + '"', a)
- }
- return {
- key: c,
- value: a.substr(b + 1)
- }
- }, c._renewCache = function() {
- c._cache = c._getCacheFromString(c._document.cookie), c._cachedDocumentCookie = c._document.cookie
- }, c._areEnabled = function() {
- var a = "cookies.js",
- b = "1" === c.set(a, 1).get(a);
- return c.expire(a), b
- }, c.enabled = c._areEnabled(), c
- },
- d = "object" == typeof a.document ? c(a) : c;
- "function" == typeof define && define.amd ? define(function() {
- return d
- }) : "object" == typeof exports ? ("object" == typeof module && "object" == typeof module.exports && (exports = module.exports = d), exports.Cookies = d) : a.Cookies = d
- }("undefined" == typeof window ? this : window), window.XdUtils = window.XdUtils || function() {
- function a(a, b) {
- var c, d = b || {};
- for (c in a) a.hasOwnProperty(c) && (d[c] = a[c]);
- return d
- }
- return {
- extend: a
- }
- }(), window.xdLocalStorage = window.xdLocalStorage || function() {
- function a(a) {
- j[a.id] && (j[a.id](a), delete j[a.id])
- }
- function b(b) {
- var c;
- try {
- c = JSON.parse(b.data)
- } catch (a) {}
- c && c.namespace === g && ("iframe-ready" === c.id ? (l = !0, h.initCallback()) : a(c))
- }
- function c(a, b, c, d) {
- i++, j[i] = d;
- var e = {
- namespace: g,
- id: i,
- action: a,
- key: b,
- value: c
- };
- f.contentWindow.postMessage(JSON.stringify(e), "*")
- }
- function d(a) {
- h = XdUtils.extend(a, h);
- var c = document.createElement("div");
- window.addEventListener ? window.addEventListener("message", b, !1) : window.attachEvent("onmessage", b), c.innerHTML = '<iframe id="' + h.iframeId + '" src=' + h.iframeUrl + ' style="display: none;"></iframe>', document.body.appendChild(c), f = document.getElementById(h.iframeId)
- }
- function e() {
- return k ? !!l || (console.log("You must wait for iframe ready message before using the api."), !1) : (console.log("You must call xdLocalStorage.init() before using it."), !1)
- }
- var f, g = "cross-domain-local-message",
- h = {
- iframeId: "cross-domain-iframe",
- iframeUrl: void 0,
- initCallback: function() {}
- },
- i = -1,
- j = {},
- k = !1,
- l = !0;
- return {
- init: function(a) {
- if (!a.iframeUrl) throw "You must specify iframeUrl";
- return k ? void console.log("xdLocalStorage was already initialized!") : (k = !0, void("complete" === document.readyState ? d(a) : window.onload = function() {
- d(a)
- }))
- },
- setItem: function(a, b, d) {
- e() && c("set", a, b, d)
- },
- getItem: function(a, b) {
- e() && c("get", a, null, b)
- },
- removeItem: function(a, b) {
- e() && c("remove", a, null, b)
- },
- key: function(a, b) {
- e() && c("key", a, null, b)
- },
- getSize: function(a) {
- e() && c("size", null, null, a)
- },
- getLength: function(a) {
- e() && c("length", null, null, a)
- },
- clear: function(a) {
- e() && c("clear", null, null, a)
- },
- wasInit: function() {
- return k
- }
- }
- }(),
- function() {
- ! function(a) {
- var b = this || (0, eval)("this"),
- c = b.document,
- d = b.navigator,
- e = b.jQuery,
- f = b.JSON;
- ! function(a) {
- "function" == typeof require && "object" == typeof exports && "object" == typeof module ? a(module.exports || exports, require) : "function" == typeof define && define.amd ? define(["exports", "require"], a) : a(b.ko = {})
- }(function(g, h) {
- function i(a, b) {
- return (null === a || typeof a in n) && a === b
- }
- function j(b, c) {
- var d;
- return function() {
- d || (d = setTimeout(function() {
- d = a, b()
- }, c))
- }
- }
- function k(a, b) {
- var c;
- return function() {
- clearTimeout(c), c = setTimeout(a, b)
- }
- }
- function l(a, b, c, d) {
- m.d[a] = {
- init: function(a, e, f, g, h) {
- var i, j;
- return m.s(function() {
- var f = m.a.c(e()),
- g = !c != !f,
- k = !j;
- (k || b || g !== i) && (k && m.Y.la() && (j = m.a.ia(m.f.childNodes(a), !0)), g ? (k || m.f.T(a, m.a.ia(j)), m.Ca(d ? d(h, f) : h, a)) : m.f.ja(a), i = g)
- }, null, {
- o: a
- }), {
- controlsDescendantBindings: !0
- }
- }
- }, m.h.ha[a] = !1, m.f.Q[a] = !0
- }
- var m = "undefined" != typeof g ? g : {};
- m.b = function(a, b) {
- for (var c = a.split("."), d = m, e = 0; e < c.length - 1; e++) d = d[c[e]];
- d[c[c.length - 1]] = b
- }, m.A = function(a, b, c) {
- a[b] = c
- }, m.version = "3.2.0", m.b("version", m.version), m.a = function() {
- function g(a, b) {
- for (var c in a) a.hasOwnProperty(c) && b(c, a[c])
- }
- function h(a, b) {
- if (b)
- for (var c in b) b.hasOwnProperty(c) && (a[c] = b[c]);
- return a
- }
- function i(a, b) {
- return a.__proto__ = b, a
- }
- var j = {
- __proto__: []
- }
- instanceof Array, k = {}, l = {};
- k[d && /Firefox\/2/i.test(d.userAgent) ? "KeyboardEvent" : "UIEvents"] = ["keyup", "keydown", "keypress"], k.MouseEvents = "click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "), g(k, function(a, b) {
- if (b.length)
- for (var c = 0, d = b.length; c < d; c++) l[b[c]] = a
- });
- var n = {
- propertychange: !0
- },
- o = c && function() {
- for (var b = 3, d = c.createElement("div"), e = d.getElementsByTagName("i"); d.innerHTML = "<!--[if gt IE " + ++b + "]><i></i><![endif]-->", e[0];);
- return 4 < b ? b : a
- }();
- return {
- vb: ["authenticity_token", /^__RequestVerificationToken(_.*)?$/],
- u: function(a, b) {
- for (var c = 0, d = a.length; c < d; c++) b(a[c], c)
- },
- m: function(a, b) {
- if ("function" == typeof Array.prototype.indexOf) return Array.prototype.indexOf.call(a, b);
- for (var c = 0, d = a.length; c < d; c++)
- if (a[c] === b) return c;
- return -1
- },
- qb: function(a, b, c) {
- for (var d = 0, e = a.length; d < e; d++)
- if (b.call(c, a[d], d)) return a[d];
- return null
- },
- ua: function(a, b) {
- var c = m.a.m(a, b);
- 0 < c ? a.splice(c, 1) : 0 === c && a.shift()
- },
- rb: function(a) {
- a = a || [];
- for (var b = [], c = 0, d = a.length; c < d; c++) 0 > m.a.m(b, a[c]) && b.push(a[c]);
- return b
- },
- Da: function(a, b) {
- a = a || [];
- for (var c = [], d = 0, e = a.length; d < e; d++) c.push(b(a[d], d));
- return c
- },
- ta: function(a, b) {
- a = a || [];
- for (var c = [], d = 0, e = a.length; d < e; d++) b(a[d], d) && c.push(a[d]);
- return c
- },
- ga: function(a, b) {
- if (b instanceof Array) a.push.apply(a, b);
- else
- for (var c = 0, d = b.length; c < d; c++) a.push(b[c]);
- return a
- },
- ea: function(a, b, c) {
- var d = m.a.m(m.a.Xa(a), b);
- 0 > d ? c && a.push(b) : c || a.splice(d, 1)
- },
- xa: j,
- extend: h,
- za: i,
- Aa: j ? i : h,
- G: g,
- na: function(a, b) {
- if (!a) return a;
- var c, d = {};
- for (c in a) a.hasOwnProperty(c) && (d[c] = b(a[c], c, a));
- return d
- },
- Ka: function(a) {
- for (; a.firstChild;) m.removeNode(a.firstChild)
- },
- oc: function(a) {
- a = m.a.S(a);
- for (var b = c.createElement("div"), d = 0, e = a.length; d < e; d++) b.appendChild(m.R(a[d]));
- return b
- },
- ia: function(a, b) {
- for (var c = 0, d = a.length, e = []; c < d; c++) {
- var f = a[c].cloneNode(!0);
- e.push(b ? m.R(f) : f)
- }
- return e
- },
- T: function(a, b) {
- if (m.a.Ka(a), b)
- for (var c = 0, d = b.length; c < d; c++) a.appendChild(b[c])
- },
- Lb: function(a, b) {
- var c = a.nodeType ? [a] : a;
- if (0 < c.length) {
- for (var d = c[0], e = d.parentNode, f = 0, g = b.length; f < g; f++) e.insertBefore(b[f], d);
- for (f = 0, g = c.length; f < g; f++) m.removeNode(c[f])
- }
- },
- ka: function(a, b) {
- if (a.length) {
- for (b = 8 === b.nodeType && b.parentNode || b; a.length && a[0].parentNode !== b;) a.shift();
- if (1 < a.length) {
- var c = a[0],
- d = a[a.length - 1];
- for (a.length = 0; c !== d;)
- if (a.push(c), c = c.nextSibling, !c) return;
- a.push(d)
- }
- }
- return a
- },
- Nb: function(a, b) {
- 7 > o ? a.setAttribute("selected", b) : a.selected = b
- },
- cb: function(b) {
- return null === b || b === a ? "" : b.trim ? b.trim() : b.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, "")
- },
- vc: function(a, b) {
- return a = a || "", !(b.length > a.length) && a.substring(0, b.length) === b
- },
- cc: function(a, b) {
- if (a === b) return !0;
- if (11 === a.nodeType) return !1;
- if (b.contains) return b.contains(3 === a.nodeType ? a.parentNode : a);
- if (b.compareDocumentPosition) return 16 == (16 & b.compareDocumentPosition(a));
- for (; a && a != b;) a = a.parentNode;
- return !!a
- },
- Ja: function(a) {
- return m.a.cc(a, a.ownerDocument.documentElement)
- },
- ob: function(a) {
- return !!m.a.qb(a, m.a.Ja)
- },
- t: function(a) {
- return a && a.tagName && a.tagName.toLowerCase()
- },
- n: function(a, b, c) {
- var d = o && n[b];
- if (!d && e) e(a).bind(b, c);
- else if (d || "function" != typeof a.addEventListener) {
- if ("undefined" == typeof a.attachEvent) throw Error("Browser doesn't support addEventListener or attachEvent");
- var f = function(b) {
- c.call(a, b)
- },
- g = "on" + b;
- a.attachEvent(g, f), m.a.w.da(a, function() {
- a.detachEvent(g, f)
- })
- } else a.addEventListener(b, c, !1)
- },
- oa: function(a, d) {
- if (!a || !a.nodeType) throw Error("element must be a DOM node when calling triggerEvent");
- var f;
- if ("input" === m.a.t(a) && a.type && "click" == d.toLowerCase() ? (f = a.type, f = "checkbox" == f || "radio" == f) : f = !1, e && !f) e(a).trigger(d);
- else if ("function" == typeof c.createEvent) {
- if ("function" != typeof a.dispatchEvent) throw Error("The supplied element doesn't support dispatchEvent");
- f = c.createEvent(l[d] || "HTMLEvents"), f.initEvent(d, !0, !0, b, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, a), a.dispatchEvent(f)
- } else if (f && a.click) a.click();
- else {
- if ("undefined" == typeof a.fireEvent) throw Error("Browser doesn't support triggering events");
- a.fireEvent("on" + d)
- }
- },
- c: function(a) {
- return m.C(a) ? a() : a
- },
- Xa: function(a) {
- return m.C(a) ? a.v() : a
- },
- Ba: function(a, b, c) {
- if (b) {
- var d = /\S+/g,
- e = a.className.match(d) || [];
- m.a.u(b.match(d), function(a) {
- m.a.ea(e, a, c)
- }), a.className = e.join(" ")
- }
- },
- bb: function(b, c) {
- var d = m.a.c(c);
- null !== d && d !== a || (d = "");
- var e = m.f.firstChild(b);
- !e || 3 != e.nodeType || m.f.nextSibling(e) ? m.f.T(b, [b.ownerDocument.createTextNode(d)]) : e.data = d, m.a.fc(b)
- },
- Mb: function(a, b) {
- if (a.name = b, 7 >= o) try {
- a.mergeAttributes(c.createElement("<input name='" + a.name + "'/>"), !1)
- } catch (a) {}
- },
- fc: function(a) {
- 9 <= o && (a = 1 == a.nodeType ? a : a.parentNode, a.style && (a.style.zoom = a.style.zoom))
- },
- dc: function(a) {
- if (o) {
- var b = a.style.width;
- a.style.width = 0, a.style.width = b
- }
- },
- sc: function(a, b) {
- a = m.a.c(a), b = m.a.c(b);
- for (var c = [], d = a; d <= b; d++) c.push(d);
- return c
- },
- S: function(a) {
- for (var b = [], c = 0, d = a.length; c < d; c++) b.push(a[c]);
- return b
- },
- yc: 6 === o,
- zc: 7 === o,
- L: o,
- xb: function(a, b) {
- for (var c = m.a.S(a.getElementsByTagName("input")).concat(m.a.S(a.getElementsByTagName("textarea"))), d = "string" == typeof b ? function(a) {
- return a.name === b
- } : function(a) {
- return b.test(a.name)
- }, e = [], f = c.length - 1; 0 <= f; f--) d(c[f]) && e.push(c[f]);
- return e
- },
- pc: function(a) {
- return "string" == typeof a && (a = m.a.cb(a)) ? f && f.parse ? f.parse(a) : new Function("return " + a)() : null
- },
- eb: function(a, b, c) {
- if (!f || !f.stringify) throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");
- return f.stringify(m.a.c(a), b, c)
- },
- qc: function(a, b, d) {
- d = d || {};
- var e = d.params || {},
- f = d.includeFields || this.vb,
- h = a;
- if ("object" == typeof a && "form" === m.a.t(a))
- for (var h = a.action, i = f.length - 1; 0 <= i; i--)
- for (var j = m.a.xb(a, f[i]), k = j.length - 1; 0 <= k; k--) e[j[k].name] = j[k].value;
- b = m.a.c(b);
- var l = c.createElement("form");
- l.style.display = "none", l.action = h, l.method = "post";
- for (var n in b) a = c.createElement("input"), a.type = "hidden", a.name = n, a.value = m.a.eb(m.a.c(b[n])), l.appendChild(a);
- g(e, function(a, b) {
- var d = c.createElement("input");
- d.type = "hidden", d.name = a, d.value = b, l.appendChild(d)
- }), c.body.appendChild(l), d.submitter ? d.submitter(l) : l.submit(), setTimeout(function() {
- l.parentNode.removeChild(l)
- }, 0)
- }
- }
- }(), m.b("utils", m.a), m.b("utils.arrayForEach", m.a.u), m.b("utils.arrayFirst", m.a.qb), m.b("utils.arrayFilter", m.a.ta), m.b("utils.arrayGetDistinctValues", m.a.rb), m.b("utils.arrayIndexOf", m.a.m), m.b("utils.arrayMap", m.a.Da), m.b("utils.arrayPushAll", m.a.ga), m.b("utils.arrayRemoveItem", m.a.ua), m.b("utils.extend", m.a.extend), m.b("utils.fieldsIncludedWithJsonPost", m.a.vb), m.b("utils.getFormFields", m.a.xb), m.b("utils.peekObservable", m.a.Xa), m.b("utils.postJson", m.a.qc), m.b("utils.parseJson", m.a.pc), m.b("utils.registerEventHandler", m.a.n), m.b("utils.stringifyJson", m.a.eb), m.b("utils.range", m.a.sc), m.b("utils.toggleDomNodeCssClass", m.a.Ba), m.b("utils.triggerEvent", m.a.oa), m.b("utils.unwrapObservable", m.a.c), m.b("utils.objectForEach", m.a.G), m.b("utils.addOrRemoveItem", m.a.ea), m.b("unwrap", m.a.c), Function.prototype.bind || (Function.prototype.bind = function(a) {
- var b = this,
- c = Array.prototype.slice.call(arguments);
- return a = c.shift(),
- function() {
- return b.apply(a, c.concat(Array.prototype.slice.call(arguments)))
- }
- }), m.a.e = new function() {
- function b(b, f) {
- var g = b[d];
- if (!g || "null" === g || !e[g]) {
- if (!f) return a;
- g = b[d] = "ko" + c++, e[g] = {}
- }
- return e[g]
- }
- var c = 0,
- d = "__ko__" + (new Date).getTime(),
- e = {};
- return {
- get: function(c, d) {
- var e = b(c, !1);
- return e === a ? a : e[d]
- },
- set: function(c, d, e) {
- e === a && b(c, !1) === a || (b(c, !0)[d] = e)
- },
- clear: function(a) {
- var b = a[d];
- return !!b && (delete e[b], a[d] = null, !0)
- },
- F: function() {
- return c++ + d
- }
- }
- }, m.b("utils.domData", m.a.e), m.b("utils.domData.clear", m.a.e.clear), m.a.w = new function() {
- function b(b, c) {
- var e = m.a.e.get(b, d);
- return e === a && c && (e = [], m.a.e.set(b, d, e)), e
- }
- function c(a) {
- var d = b(a, !1);
- if (d)
- for (var d = d.slice(0), e = 0; e < d.length; e++) d[e](a);
- if (m.a.e.clear(a), m.a.w.cleanExternalData(a), g[a.nodeType])
- for (d = a.firstChild; a = d;) d = a.nextSibling, 8 === a.nodeType && c(a)
- }
- var d = m.a.e.F(),
- f = {
- 1: !0,
- 8: !0,
- 9: !0
- },
- g = {
- 1: !0,
- 9: !0
- };
- return {
- da: function(a, c) {
- if ("function" != typeof c) throw Error("Callback must be a function");
- b(a, !0).push(c)
- },
- Kb: function(c, e) {
- var f = b(c, !1);
- f && (m.a.ua(f, e), 0 == f.length && m.a.e.set(c, d, a))
- },
- R: function(a) {
- if (f[a.nodeType] && (c(a), g[a.nodeType])) {
- var b = [];
- m.a.ga(b, a.getElementsByTagName("*"));
- for (var d = 0, e = b.length; d < e; d++) c(b[d])
- }
- return a
- },
- removeNode: function(a) {
- m.R(a), a.parentNode && a.parentNode.removeChild(a)
- },
- cleanExternalData: function(a) {
- e && "function" == typeof e.cleanData && e.cleanData([a])
- }
- }
- }, m.R = m.a.w.R, m.removeNode = m.a.w.removeNode, m.b("cleanNode", m.R), m.b("removeNode", m.removeNode), m.b("utils.domNodeDisposal", m.a.w), m.b("utils.domNodeDisposal.addDisposeCallback", m.a.w.da), m.b("utils.domNodeDisposal.removeDisposeCallback", m.a.w.Kb),
- function() {
- m.a.ba = function(a) {
- var d;
- if (e) {
- if (e.parseHTML) d = e.parseHTML(a) || [];
- else if ((d = e.clean([a])) && d[0]) {
- for (a = d[0]; a.parentNode && 11 !== a.parentNode.nodeType;) a = a.parentNode;
- a.parentNode && a.parentNode.removeChild(a)
- }
- } else {
- var f = m.a.cb(a).toLowerCase();
- for (d = c.createElement("div"), f = f.match(/^<(thead|tbody|tfoot)/) && [1, "<table>", "</table>"] || !f.indexOf("<tr") && [2, "<table><tbody>", "</tbody></table>"] || (!f.indexOf("<td") || !f.indexOf("<th")) && [3, "<table><tbody><tr>", "</tr></tbody></table>"] || [0, "", ""], a = "ignored<div>" + f[1] + a + f[2] + "</div>", "function" == typeof b.innerShiv ? d.appendChild(b.innerShiv(a)) : d.innerHTML = a; f[0]--;) d = d.lastChild;
- d = m.a.S(d.lastChild.childNodes)
- }
- return d
- }, m.a.$a = function(b, c) {
- if (m.a.Ka(b), c = m.a.c(c), null !== c && c !== a)
- if ("string" != typeof c && (c = c.toString()), e) e(b).html(c);
- else
- for (var d = m.a.ba(c), f = 0; f < d.length; f++) b.appendChild(d[f])
- }
- }(), m.b("utils.parseHtmlFragment", m.a.ba), m.b("utils.setHtml", m.a.$a), m.D = function() {
- function b(a, c) {
- if (a)
- if (8 == a.nodeType) {
- var d = m.D.Gb(a.nodeValue);
- null != d && c.push({
- bc: a,
- mc: d
- })
- } else if (1 == a.nodeType)
- for (var d = 0, e = a.childNodes, f = e.length; d < f; d++) b(e[d], c)
- }
- var c = {};
- return {
- Ua: function(a) {
- if ("function" != typeof a) throw Error("You can only pass a function to ko.memoization.memoize()");
- var b = (4294967296 * (1 + Math.random()) | 0).toString(16).substring(1) + (4294967296 * (1 + Math.random()) | 0).toString(16).substring(1);
- return c[b] = a, "<!--[ko_memo:" + b + "]-->"
- },
- Rb: function(b, d) {
- var e = c[b];
- if (e === a) throw Error("Couldn't find any memo with ID " + b + ". Perhaps it's already been unmemoized.");
- try {
- return e.apply(null, d || []), !0
- } finally {
- delete c[b]
- }
- },
- Sb: function(a, c) {
- var d = [];
- b(a, d);
- for (var e = 0, f = d.length; e < f; e++) {
- var g = d[e].bc,
- h = [g];
- c && m.a.ga(h, c), m.D.Rb(d[e].mc, h), g.nodeValue = "", g.parentNode && g.parentNode.removeChild(g)
- }
- },
- Gb: function(a) {
- return (a = a.match(/^\[ko_memo\:(.*?)\]$/)) ? a[1] : null
- }
- }
- }(), m.b("memoization", m.D), m.b("memoization.memoize", m.D.Ua), m.b("memoization.unmemoize", m.D.Rb), m.b("memoization.parseMemoText", m.D.Gb), m.b("memoization.unmemoizeDomNodeAndDescendants", m.D.Sb), m.La = {
- throttle: function(a, b) {
- a.throttleEvaluation = b;
- var c = null;
- return m.j({
- read: a,
- write: function(d) {
- clearTimeout(c), c = setTimeout(function() {
- a(d)
- }, b)
- }
- })
- },
- rateLimit: function(a, b) {
- var c, d, e;
- "number" == typeof b ? c = b : (c = b.timeout, d = b.method), e = "notifyWhenChangesStop" == d ? k : j, a.Ta(function(a) {
- return e(a, c)
- })
- },
- notify: function(a, b) {
- a.equalityComparer = "always" == b ? null : i
- }
- };
- var n = {
- undefined: 1,
- boolean: 1,
- number: 1,
- string: 1
- };
- m.b("extenders", m.La), m.Pb = function(a, b, c) {
- this.target = a, this.wa = b, this.ac = c, this.Cb = !1, m.A(this, "dispose", this.K)
- }, m.Pb.prototype.K = function() {
- this.Cb = !0, this.ac()
- }, m.P = function() {
- m.a.Aa(this, m.P.fn), this.M = {}
- };
- var o = "change",
- p = {
- U: function(a, b, c) {
- var d = this;
- c = c || o;
- var e = new m.Pb(d, b ? a.bind(b) : a, function() {
- m.a.ua(d.M[c], e), d.nb && d.nb()
- });
- return d.va && d.va(c), d.M[c] || (d.M[c] = []), d.M[c].push(e), e
- },
- notifySubscribers: function(a, b) {
- if (b = b || o, this.Ab(b)) try {
- m.k.Ea();
- for (var c, d = this.M[b].slice(0), e = 0; c = d[e]; ++e) c.Cb || c.wa(a)
- } finally {
- m.k.end()
- }
- },
- Ta: function(a) {
- var b, c, d, e = this,
- f = m.C(e);
- e.qa || (e.qa = e.notifySubscribers, e.notifySubscribers = function(a, b) {
- b && b !== o ? "beforeChange" === b ? e.kb(a) : e.qa(a, b) : e.lb(a)
- });
- var g = a(function() {
- f && d === e && (d = e()), b = !1, e.Pa(c, d) && e.qa(c = d)
- });
- e.lb = function(a) {
- b = !0, d = a, g()
- }, e.kb = function(a) {
- b || (c = a, e.qa(a, "beforeChange"))
- }
- },
- Ab: function(a) {
- return this.M[a] && this.M[a].length
- },
- yb: function() {
- var a = 0;
- return m.a.G(this.M, function(b, c) {
- a += c.length
- }), a
- },
- Pa: function(a, b) {
- return !this.equalityComparer || !this.equalityComparer(a, b)
- },
- extend: function(a) {
- var b = this;
- return a && m.a.G(a, function(a, c) {
- var d = m.La[a];
- "function" == typeof d && (b = d(b, c) || b)
- }), b
- }
- };
- m.A(p, "subscribe", p.U), m.A(p, "extend", p.extend), m.A(p, "getSubscriptionsCount", p.yb), m.a.xa && m.a.za(p, Function.prototype), m.P.fn = p, m.Db = function(a) {
- return null != a && "function" == typeof a.U && "function" == typeof a.notifySubscribers
- }, m.b("subscribable", m.P), m.b("isSubscribable", m.Db), m.Y = m.k = function() {
- function a(a) {
- d.push(c), c = a
- }
- function b() {
- c = d.pop()
- }
- var c, d = [],
- e = 0;
- return {
- Ea: a,
- end: b,
- Jb: function(a) {
- if (c) {
- if (!m.Db(a)) throw Error("Only subscribable things can act as dependencies");
- c.wa(a, a.Vb || (a.Vb = ++e))
- }
- },
- B: function(c, d, e) {
- try {
- return a(), c.apply(d, e || [])
- } finally {
- b()
- }
- },
- la: function() {
- if (c) return c.s.la()
- },
- ma: function() {
- if (c) return c.ma
- }
- }
- }(), m.b("computedContext", m.Y), m.b("computedContext.getDependenciesCount", m.Y.la), m.b("computedContext.isInitial", m.Y.ma), m.b("computedContext.isSleeping", m.Y.Ac), m.p = function(a) {
- function b() {
- return 0 < arguments.length ? (b.Pa(c, arguments[0]) && (b.X(), c = arguments[0], b.W()), this) : (m.k.Jb(b), c)
- }
- var c = a;
- return m.P.call(b), m.a.Aa(b, m.p.fn), b.v = function() {
- return c
- }, b.W = function() {
- b.notifySubscribers(c)
- }, b.X = function() {
- b.notifySubscribers(c, "beforeChange")
- }, m.A(b, "peek", b.v), m.A(b, "valueHasMutated", b.W), m.A(b, "valueWillMutate", b.X), b
- }, m.p.fn = {
- equalityComparer: i
- };
- var q = m.p.rc = "__ko_proto__";
- m.p.fn[q] = m.p, m.a.xa && m.a.za(m.p.fn, m.P.fn), m.Ma = function(b, c) {
- return null !== b && b !== a && b[q] !== a && (b[q] === c || m.Ma(b[q], c))
- }, m.C = function(a) {
- return m.Ma(a, m.p)
- }, m.Ra = function(a) {
- return !!("function" == typeof a && a[q] === m.p || "function" == typeof a && a[q] === m.j && a.hc)
- }, m.b("observable", m.p), m.b("isObservable", m.C), m.b("isWriteableObservable", m.Ra), m.b("isWritableObservable", m.Ra), m.aa = function(a) {
- if (a = a || [], "object" != typeof a || !("length" in a)) throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");
- return a = m.p(a), m.a.Aa(a, m.aa.fn), a.extend({
- trackArrayChanges: !0
- })
- }, m.aa.fn = {
- remove: function(a) {
- for (var b = this.v(), c = [], d = "function" != typeof a || m.C(a) ? function(b) {
- return b === a
- } : a, e = 0; e < b.length; e++) {
- var f = b[e];
- d(f) && (0 === c.length && this.X(), c.push(f), b.splice(e, 1), e--)
- }
- return c.length && this.W(), c
- },
- removeAll: function(b) {
- if (b === a) {
- var c = this.v(),
- d = c.slice(0);
- return this.X(), c.splice(0, c.length), this.W(), d
- }
- return b ? this.remove(function(a) {
- return 0 <= m.a.m(b, a)
- }) : []
- },
- destroy: function(a) {
- var b = this.v(),
- c = "function" != typeof a || m.C(a) ? function(b) {
- return b === a
- } : a;
- this.X();
- for (var d = b.length - 1; 0 <= d; d--) c(b[d]) && (b[d]._destroy = !0);
- this.W()
- },
- destroyAll: function(b) {
- return b === a ? this.destroy(function() {
- return !0
- }) : b ? this.destroy(function(a) {
- return 0 <= m.a.m(b, a)
- }) : []
- },
- indexOf: function(a) {
- var b = this();
- return m.a.m(b, a)
- },
- replace: function(a, b) {
- var c = this.indexOf(a);
- 0 <= c && (this.X(), this.v()[c] = b, this.W())
- }
- }, m.a.u("pop push reverse shift sort splice unshift".split(" "), function(a) {
- m.aa.fn[a] = function() {
- var b = this.v();
- return this.X(), this.sb(b, a, arguments), b = b[a].apply(b, arguments), this.W(), b
- }
- }), m.a.u(["slice"], function(a) {
- m.aa.fn[a] = function() {
- var b = this();
- return b[a].apply(b, arguments)
- }
- }), m.a.xa && m.a.za(m.aa.fn, m.p.fn), m.b("observableArray", m.aa);
- var r = "arrayChange";
- m.La.trackArrayChanges = function(a) {
- function b() {
- if (!c) {
- c = !0;
- var b = a.notifySubscribers;
- a.notifySubscribers = function(a, c) {
- return c && c !== o || ++e, b.apply(this, arguments)
- };
- var f = [].concat(a.v() || []);
- d = null, a.U(function(b) {
- if (b = [].concat(b || []), a.Ab(r)) {
- var c;
- (!d || 1 < e) && (d = m.a.Fa(f, b, {
- sparse: !0
- })), c = d, c.length && a.notifySubscribers(c, r)
- }
- f = b, d = null, e = 0
- })
- }
- }
- if (!a.sb) {
- var c = !1,
- d = null,
- e = 0,
- f = a.U;
- a.U = a.subscribe = function(a, c, d) {
- return d === r && b(), f.apply(this, arguments)
- }, a.sb = function(a, b, f) {
- function g(a, b, c) {
- return h[h.length] = {
- status: a,
- value: b,
- index: c
- }
- }
- if (c && !e) {
- var h = [],
- i = a.length,
- j = f.length,
- k = 0;
- switch (b) {
- case "push":
- k = i;
- case "unshift":
- for (b = 0; b < j; b++) g("added", f[b], k + b);
- break;
- case "pop":
- k = i - 1;
- case "shift":
- i && g("deleted", a[k], k);
- break;
- case "splice":
- b = Math.min(Math.max(0, 0 > f[0] ? i + f[0] : f[0]), i);
- for (var i = 1 === j ? i : Math.min(b + (f[1] || 0), i), j = b + j - 2, k = Math.max(i, j), l = [], n = [], o = 2; b < k; ++b, ++o) b < i && n.push(g("deleted", a[b], b)), b < j && l.push(g("added", f[o], b));
- m.a.wb(n, l);
- break;
- default:
- return
- }
- d = h
- }
- }
- }
- }, m.s = m.j = function(b, c, d) {
- function e() {
- m.a.G(z, function(a, b) {
- b.K()
- }), z = {}
- }
- function f() {
- e(), A = 0, q = !0, n = !1
- }
- function g() {
- var a = i.throttleEvaluation;
- a && 0 <= a ? (clearTimeout(B), B = setTimeout(h, a)) : i.ib ? i.ib() : h()
- }
- function h(b) {
- if (o) {
- if (s) throw Error("A 'pure' computed must not be called recursively")
- } else if (!q) {
- if (x && x()) {
- if (!p) return void y()
- } else p = !1;
- if (o = !0, t) try {
- var d = {};
- m.k.Ea({
- wa: function(a, b) {
- d[b] || (d[b] = 1, ++A)
- },
- s: i,
- ma: a
- }), A = 0, l = r.call(c)
- } finally {
- m.k.end(), o = !1
- } else try {
- var e = z,
- f = A;
- m.k.Ea({
- wa: function(a, b) {
- q || (f && e[b] ? (z[b] = e[b], ++A, delete e[b], --f) : z[b] || (z[b] = a.U(g), ++A))
- },
- s: i,
- ma: s ? a : !A
- }), z = {}, A = 0;
- try {
- var h = c ? r.call(c) : r()
- } finally {
- m.k.end(), f && m.a.G(e, function(a, b) {
- b.K()
- }), n = !1
- }
- i.Pa(l, h) && (i.notifySubscribers(l, "beforeChange"), l = h, !0 !== b && i.notifySubscribers(l))
- } finally {
- o = !1
- }
- A || y()
- }
- }
- function i() {
- if (0 < arguments.length) {
- if ("function" != typeof u) throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");
- return u.apply(c, arguments), this
- }
- return m.k.Jb(i), n && h(!0), l
- }
- function j() {
- return n && !A && h(!0), l
- }
- function k() {
- return n || 0 < A
- }
- var l, n = !0,
- o = !1,
- p = !1,
- q = !1,
- r = b,
- s = !1,
- t = !1;
- if (r && "object" == typeof r ? (d = r, r = d.read) : (d = d || {}, r || (r = d.read)), "function" != typeof r) throw Error("Pass a function that returns the value of the ko.computed");
- var u = d.write,
- v = d.disposeWhenNodeIsRemoved || d.o || null,
- w = d.disposeWhen || d.Ia,
- x = w,
- y = f,
- z = {},
- A = 0,
- B = null;
- c || (c = d.owner), m.P.call(i), m.a.Aa(i, m.j.fn), i.v = j, i.la = function() {
- return A
- }, i.hc = "function" == typeof d.write, i.K = function() {
- y()
- }, i.Z = k;
- var C = i.Ta;
- return i.Ta = function(a) {
- C.call(i, a), i.ib = function() {
- i.kb(l), n = !0, i.lb(i)
- }
- }, d.pure ? (t = s = !0, i.va = function() {
- t && (t = !1, h(!0))
- }, i.nb = function() {
- i.yb() || (e(), t = n = !0)
- }) : d.deferEvaluation && (i.va = function() {
- j(), delete i.va
- }), m.A(i, "peek", i.v), m.A(i, "dispose", i.K), m.A(i, "isActive", i.Z), m.A(i, "getDependenciesCount", i.la), v && (p = !0, v.nodeType && (x = function() {
- return !m.a.Ja(v) || w && w()
- })), t || d.deferEvaluation || h(), v && k() && v.nodeType && (y = function() {
- m.a.w.Kb(v, y), f()
- }, m.a.w.da(v, y)), i
- }, m.jc = function(a) {
- return m.Ma(a, m.j)
- }, p = m.p.rc, m.j[p] = m.p, m.j.fn = {
- equalityComparer: i
- }, m.j.fn[p] = m.j, m.a.xa && m.a.za(m.j.fn, m.P.fn), m.b("dependentObservable", m.j), m.b("computed", m.j), m.b("isComputed", m.jc), m.Ib = function(a, b) {
- return "function" == typeof a ? m.s(a, b, {
- pure: !0
- }) : (a = m.a.extend({}, a), a.pure = !0, m.s(a, b))
- }, m.b("pureComputed", m.Ib),
- function() {
- function b(e, f, g) {
- if (g = g || new d, e = f(e), "object" != typeof e || null === e || e === a || e instanceof Date || e instanceof String || e instanceof Number || e instanceof Boolean) return e;
- var h = e instanceof Array ? [] : {};
- return g.save(e, h), c(e, function(c) {
- var d = f(e[c]);
- switch (typeof d) {
- case "boolean":
- case "number":
- case "string":
- case "function":
- h[c] = d;
- break;
- case "object":
- case "undefined":
- var i = g.get(d);
- h[c] = i !== a ? i : b(d, f, g)
- }
- }), h
- }
- function c(a, b) {
- if (a instanceof Array) {
- for (var c = 0; c < a.length; c++) b(c);
- "function" == typeof a.toJSON && b("toJSON")
- } else
- for (c in a) b(c)
- }
- function d() {
- this.keys = [], this.hb = []
- }
- m.Qb = function(a) {
- if (0 == arguments.length) throw Error("When calling ko.toJS, pass the object you want to convert.");
- return b(a, function(a) {
- for (var b = 0; m.C(a) && 10 > b; b++) a = a();
- return a
- })
- }, m.toJSON = function(a, b, c) {
- return a = m.Qb(a), m.a.eb(a, b, c)
- }, d.prototype = {
- save: function(a, b) {
- var c = m.a.m(this.keys, a);
- 0 <= c ? this.hb[c] = b : (this.keys.push(a), this.hb.push(b))
- },
- get: function(b) {
- return b = m.a.m(this.keys, b), 0 <= b ? this.hb[b] : a
- }
- }
- }(), m.b("toJS", m.Qb), m.b("toJSON", m.toJSON),
- function() {
- m.i = {
- q: function(b) {
- switch (m.a.t(b)) {
- case "option":
- return !0 === b.__ko__hasDomDataOptionValue__ ? m.a.e.get(b, m.d.options.Va) : 7 >= m.a.L ? b.getAttributeNode("value") && b.getAttributeNode("value").specified ? b.value : b.text : b.value;
- case "select":
- return 0 <= b.selectedIndex ? m.i.q(b.options[b.selectedIndex]) : a;
- default:
- return b.value
- }
- },
- ca: function(b, c, d) {
- switch (m.a.t(b)) {
- case "option":
- switch (typeof c) {
- case "string":
- m.a.e.set(b, m.d.options.Va, a), "__ko__hasDomDataOptionValue__" in b && delete b.__ko__hasDomDataOptionValue__, b.value = c;
- break;
- default:
- m.a.e.set(b, m.d.options.Va, c), b.__ko__hasDomDataOptionValue__ = !0, b.value = "number" == typeof c ? c : ""
- }
- break;
- case "select":
- "" !== c && null !== c || (c = a);
- for (var e, f = -1, g = 0, h = b.options.length; g < h; ++g)
- if (e = m.i.q(b.options[g]), e == c || "" == e && c === a) {
- f = g;
- break
- }(d || 0 <= f || c === a && 1 < b.size) && (b.selectedIndex = f);
- break;
- default:
- null !== c && c !== a || (c = ""), b.value = c
- }
- }
- }
- }(), m.b("selectExtensions", m.i), m.b("selectExtensions.readValue", m.i.q), m.b("selectExtensions.writeValue", m.i.ca), m.h = function() {
- function a(a) {
- a = m.a.cb(a), 123 === a.charCodeAt(0) && (a = a.slice(1, -1));
- var b, c, g = [],
- h = a.match(d),
- i = 0;
- if (h) {
- h.push(",");
- for (var j, k = 0; j = h[k]; ++k) {
- var l = j.charCodeAt(0);
- if (44 === l) {
- if (0 >= i) {
- b && g.push(c ? {
- key: b,
- value: c.join("")
- } : {
- unknown: b
- }), b = c = i = 0;
- continue
- }
- } else if (58 === l) {
- if (!c) continue
- } else if (47 === l && k && 1 < j.length)(l = h[k - 1].match(e)) && !f[l[0]] && (a = a.substr(a.indexOf(j) + 1), h = a.match(d), h.push(","), k = -1, j = "/");
- else if (40 === l || 123 === l || 91 === l) ++i;
- else if (41 === l || 125 === l || 93 === l) --i;
- else if (!b && !c) {
- b = 34 === l || 39 === l ? j.slice(1, -1) : j;
- continue
- }
- c ? c.push(j) : c = [j]
- }
- }
- return g
- }
- var b = ["true", "false", "null", "undefined"],
- c = /^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,
- d = RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]", "g"),
- e = /[\])"'A-Za-z0-9_$]+$/,
- f = { in: 1,
- return: 1,
- typeof: 1
- },
- g = {};
- return {
- ha: [],
- V: g,
- Wa: a,
- ya: function(d, e) {
- function f(a, d) {
- var e;
- if (!k) {
- var l = m.getBindingHandler(a);
- if (l && l.preprocess && !(d = l.preprocess(d, a, f))) return;
- (l = g[a]) && (e = d, 0 <= m.a.m(b, e) ? e = !1 : (l = e.match(c), e = null !== l && (l[1] ? "Object(" + l[1] + ")" + l[2] : e)), l = e), l && i.push("'" + a + "':function(_z){" + e + "=_z}")
- }
- j && (d = "function(){return " + d + " }"), h.push("'" + a + "':" + d)
- }
- e = e || {};
- var h = [],
- i = [],
- j = e.valueAccessors,
- k = e.bindingParams,
- l = "string" == typeof d ? a(d) : d;
- return m.a.u(l, function(a) {
- f(a.key || a.unknown, a.value)
- }), i.length && f("_ko_property_writers", "{" + i.join(",") + " }"), h.join(",")
- },
- lc: function(a, b) {
- for (var c = 0; c < a.length; c++)
- if (a[c].key == b) return !0;
- return !1
- },
- pa: function(a, b, c, d, e) {
- a && m.C(a) ? !m.Ra(a) || e && a.v() === d || a(d) : (a = b.get("_ko_property_writers")) && a[c] && a[c](d)
- }
- }
- }(), m.b("expressionRewriting", m.h), m.b("expressionRewriting.bindingRewriteValidators", m.h.ha), m.b("expressionRewriting.parseObjectLiteral", m.h.Wa), m.b("expressionRewriting.preProcessBindings", m.h.ya), m.b("expressionRewriting._twoWayBindings", m.h.V), m.b("jsonExpressionRewriting", m.h), m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson", m.h.ya),
- function() {
- function a(a) {
- return 8 == a.nodeType && g.test(f ? a.text : a.nodeValue)
- }
- function b(a) {
- return 8 == a.nodeType && h.test(f ? a.text : a.nodeValue)
- }
- function d(c, d) {
- for (var e = c, f = 1, g = []; e = e.nextSibling;) {
- if (b(e) && (f--, 0 === f)) return g;
- g.push(e), a(e) && f++
- }
- if (!d) throw Error("Cannot find closing comment tag to match: " + c.nodeValue);
- return null
- }
- function e(a, b) {
- var c = d(a, b);
- return c ? 0 < c.length ? c[c.length - 1].nextSibling : a.nextSibling : null
- }
- var f = c && "<!--test-->" === c.createComment("test").text,
- g = f ? /^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/ : /^\s*ko(?:\s+([\s\S]+))?\s*$/,
- h = f ? /^\x3c!--\s*\/ko\s*--\x3e$/ : /^\s*\/ko\s*$/,
- i = {
- ul: !0,
- ol: !0
- };
- m.f = {
- Q: {},
- childNodes: function(b) {
- return a(b) ? d(b) : b.childNodes
- },
- ja: function(b) {
- if (a(b)) {
- b = m.f.childNodes(b);
- for (var c = 0, d = b.length; c < d; c++) m.removeNode(b[c])
- } else m.a.Ka(b)
- },
- T: function(b, c) {
- if (a(b)) {
- m.f.ja(b);
- for (var d = b.nextSibling, e = 0, f = c.length; e < f; e++) d.parentNode.insertBefore(c[e], d)
- } else m.a.T(b, c)
- },
- Hb: function(b, c) {
- a(b) ? b.parentNode.insertBefore(c, b.nextSibling) : b.firstChild ? b.insertBefore(c, b.firstChild) : b.appendChild(c)
- },
- Bb: function(b, c, d) {
- d ? a(b) ? b.parentNode.insertBefore(c, d.nextSibling) : d.nextSibling ? b.insertBefore(c, d.nextSibling) : b.appendChild(c) : m.f.Hb(b, c)
- },
- firstChild: function(c) {
- return a(c) ? !c.nextSibling || b(c.nextSibling) ? null : c.nextSibling : c.firstChild
- },
- nextSibling: function(c) {
- return a(c) && (c = e(c)), c.nextSibling && b(c.nextSibling) ? null : c.nextSibling
- },
- gc: a,
- xc: function(a) {
- return (a = (f ? a.text : a.nodeValue).match(g)) ? a[1] : null
- },
- Fb: function(c) {
- if (i[m.a.t(c)]) {
- var d = c.firstChild;
- if (d)
- do
- if (1 === d.nodeType) {
- var f;
- f = d.firstChild;
- var g = null;
- if (f)
- do
- if (g) g.push(f);
- else if (a(f)) {
- var h = e(f, !0);
- h ? f = h : g = [f]
- } else b(f) && (g = [f]);
- while (f = f.nextSibling);
- if (f = g)
- for (g = d.nextSibling, h = 0; h < f.length; h++) g ? c.insertBefore(f[h], g) : c.appendChild(f[h])
- }
- while (d = d.nextSibling)
- }
- }
- }
- }(), m.b("virtualElements", m.f), m.b("virtualElements.allowedBindings", m.f.Q), m.b("virtualElements.emptyNode", m.f.ja), m.b("virtualElements.insertAfter", m.f.Bb), m.b("virtualElements.prepend", m.f.Hb), m.b("virtualElements.setDomNodeChildren", m.f.T),
- function() {
- m.J = function() {
- this.Yb = {}
- }, m.a.extend(m.J.prototype, {
- nodeHasBindings: function(a) {
- switch (a.nodeType) {
- case 1:
- return null != a.getAttribute("data-bind") || m.g.getComponentNameForNode(a);
- case 8:
- return m.f.gc(a);
- default:
- return !1
- }
- },
- getBindings: function(a, b) {
- var c = this.getBindingsString(a, b),
- c = c ? this.parseBindingsString(c, b, a) : null;
- return m.g.mb(c, a, b, !1)
- },
- getBindingAccessors: function(a, b) {
- var c = this.getBindingsString(a, b),
- c = c ? this.parseBindingsString(c, b, a, {
- valueAccessors: !0
- }) : null;
- return m.g.mb(c, a, b, !0)
- },
- getBindingsString: function(a) {
- switch (a.nodeType) {
- case 1:
- return a.getAttribute("data-bind");
- case 8:
- return m.f.xc(a);
- default:
- return null
- }
- },
- parseBindingsString: function(a, b, c, d) {
- try {
- var e, f = this.Yb,
- g = a + (d && d.valueAccessors || "");
- if (!(e = f[g])) {
- var h, i = "with($context){with($data||{}){return{" + m.h.ya(a, d) + "}}}";
- h = new Function("$context", "$element", i), e = f[g] = h
- }
- return e(b, c)
- } catch (b) {
- throw b.message = "Unable to parse bindings.\nBindings value: " + a + "\nMessage: " + b.message, b
- }
- }
- }), m.J.instance = new m.J
- }(), m.b("bindingProvider", m.J),
- function() {
- function c(a) {
- return function() {
- return a
- }
- }
- function d(a) {
- return a()
- }
- function f(a) {
- return m.a.na(m.k.B(a), function(b, c) {
- return function() {
- return a()[c]
- }
- })
- }
- function g(a, b) {
- return f(this.getBindings.bind(this, a, b))
- }
- function h(a, b, c) {
- var d, e = m.f.firstChild(b),
- f = m.J.instance,
- g = f.preprocessNode;
- if (g) {
- for (; d = e;) e = m.f.nextSibling(d), g.call(f, d);
- e = m.f.firstChild(b)
- }
- for (; d = e;) e = m.f.nextSibling(d), i(a, d, c)
- }
- function i(a, b, c) {
- var d = !0,
- e = 1 === b.nodeType;
- e && m.f.Fb(b), (e && c || m.J.instance.nodeHasBindings(b)) && (d = k(b, null, a, c).shouldBindDescendants), d && !n[m.a.t(b)] && h(a, b, !e)
- }
- function j(a) {
- var b = [],
- c = {},
- d = [];
- return m.a.G(a, function e(f) {
- if (!c[f]) {
- var g = m.getBindingHandler(f);
- g && (g.after && (d.push(f), m.a.u(g.after, function(b) {
- if (a[b]) {
- if (-1 !== m.a.m(d, b)) throw Error("Cannot combine the following bindings, because they have a cyclic dependency: " + d.join(", "));
- e(b)
- }
- }), d.length--), b.push({
- key: f,
- zb: g
- })), c[f] = !0
- }
- }), b
- }
- function k(b, c, e, f) {
- var h = m.a.e.get(b, o);
- if (!c) {
- if (h) throw Error("You cannot apply bindings multiple times to the same element.");
- m.a.e.set(b, o, !0)
- }!h && f && m.Ob(b, e);
- var i;
- if (c && "function" != typeof c) i = c;
- else {
- var k = m.J.instance,
- l = k.getBindingAccessors || g,
- n = m.j(function() {
- return (i = c ? c(e, b) : l.call(k, b, e)) && e.I && e.I(), i
- }, null, {
- o: b
- });
- i && n.Z() || (n = null)
- }
- var p;
- if (i) {
- var q = n ? function(a) {
- return function() {
- return d(n()[a])
- }
- } : function(a) {
- return i[a]
- },
- r = function() {
- return m.a.na(n ? n() : i, d)
- };
- r.get = function(a) {
- return i[a] && d(q(a))
- }, r.has = function(a) {
- return a in i
- }, f = j(i), m.a.u(f, function(c) {
- var d = c.zb.init,
- f = c.zb.update,
- g = c.key;
- if (8 === b.nodeType && !m.f.Q[g]) throw Error("The binding '" + g + "' cannot be used with virtual elements");
- try {
- "function" == typeof d && m.k.B(function() {
- var c = d(b, q(g), r, e.$data, e);
- if (c && c.controlsDescendantBindings) {
- if (p !== a) throw Error("Multiple bindings (" + p + " and " + g + ") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");
- p = g
- }
- }), "function" == typeof f && m.j(function() {
- f(b, q(g), r, e.$data, e)
- }, null, {
- o: b
- })
- } catch (a) {
- throw a.message = 'Unable to process binding "' + g + ": " + i[g] + '"\nMessage: ' + a.message, a
- }
- })
- }
- return {
- shouldBindDescendants: p === a
- }
- }
- function l(a) {
- return a && a instanceof m.N ? a : new m.N(a)
- }
- m.d = {};
- var n = {
- script: !0
- };
- m.getBindingHandler = function(a) {
- return m.d[a]
- }, m.N = function(b, c, d, e) {
- var f, g = this,
- h = "function" == typeof b && !m.C(b),
- i = m.j(function() {
- var a = h ? b() : b,
- f = m.a.c(a);
- return c ? (c.I && c.I(), m.a.extend(g, c), i && (g.I = i)) : (g.$parents = [], g.$root = f, g.ko = m), g.$rawData = a, g.$data = f, d && (g[d] = f), e && e(g, c, f), g.$data
- }, null, {
- Ia: function() {
- return f && !m.a.ob(f)
- },
- o: !0
- });
- i.Z() && (g.I = i, i.equalityComparer = null, f = [], i.Tb = function(b) {
- f.push(b), m.a.w.da(b, function(b) {
- m.a.ua(f, b), f.length || (i.K(), g.I = i = a)
- })
- })
- }, m.N.prototype.createChildContext = function(a, b, c) {
- return new m.N(a, this, b, function(a, b) {
- a.$parentContext = b, a.$parent = b.$data, a.$parents = (b.$parents || []).slice(0), a.$parents.unshift(a.$parent), c && c(a)
- })
- }, m.N.prototype.extend = function(a) {
- return new m.N(this.I || this.$data, this, null, function(b, c) {
- b.$rawData = c.$rawData, m.a.extend(b, "function" == typeof a ? a() : a)
- })
- };
- var o = m.a.e.F(),
- p = m.a.e.F();
- m.Ob = function(a, b) {
- return 2 != arguments.length ? m.a.e.get(a, p) : (m.a.e.set(a, p, b), void(b.I && b.I.Tb(a)))
- }, m.ra = function(a, b, c) {
- return 1 === a.nodeType && m.f.Fb(a), k(a, b, l(c), !0)
- }, m.Wb = function(a, b, d) {
- return d = l(d), m.ra(a, "function" == typeof b ? f(b.bind(null, d, a)) : m.a.na(b, c), d)
- }, m.Ca = function(a, b) {
- 1 !== b.nodeType && 8 !== b.nodeType || h(l(a), b, !0)
- }, m.pb = function(a, c) {
- if (!e && b.jQuery && (e = b.jQuery), c && 1 !== c.nodeType && 8 !== c.nodeType) throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");
- c = c || b.document.body, i(l(a), c, !0)
- }, m.Ha = function(b) {
- switch (b.nodeType) {
- case 1:
- case 8:
- var c = m.Ob(b);
- if (c) return c;
- if (b.parentNode) return m.Ha(b.parentNode)
- }
- return a
- }, m.$b = function(b) {
- return (b = m.Ha(b)) ? b.$data : a
- }, m.b("bindingHandlers", m.d), m.b("applyBindings", m.pb), m.b("applyBindingsToDescendants", m.Ca), m.b("applyBindingAccessorsToNode", m.ra), m.b("applyBindingsToNode", m.Wb), m.b("contextFor", m.Ha), m.b("dataFor", m.$b)
- }(),
- function(a) {
- function b(b, d) {
- var g, h = e.hasOwnProperty(b) ? e[b] : a;
- h || (h = e[b] = new m.P, c(b, function(a) {
- f[b] = a, delete e[b], g ? h.notifySubscribers(a) : setTimeout(function() {
- h.notifySubscribers(a)
- }, 0)
- }), g = !0), h.U(d)
- }
- function c(a, b) {
- d("getConfig", [a], function(c) {
- c ? d("loadComponent", [a, c], function(a) {
- b(a)
- }) : b(null)
- })
- }
- function d(b, c, e, f) {
- f || (f = m.g.loaders.slice(0));
- var g = f.shift();
- if (g) {
- var h = g[b];
- if (h) {
- var i = !1;
- if (h.apply(g, c.concat(function(a) {
- i ? e(null) : null !== a ? e(a) : d(b, c, e, f)
- })) !== a && (i = !0, !g.suppressLoaderExceptions)) throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")
- } else d(b, c, e, f)
- } else e(null)
- }
- var e = {},
- f = {};
- m.g = {
- get: function(c, d) {
- var e = f.hasOwnProperty(c) ? f[c] : a;
- e ? setTimeout(function() {
- d(e)
- }, 0) : b(c, d)
- },
- tb: function(a) {
- delete f[a]
- },
- jb: d
- }, m.g.loaders = [], m.b("components", m.g), m.b("components.get", m.g.get), m.b("components.clearCachedDefinition", m.g.tb)
- }(),
- function() {
- function a(a, b, c, d) {
- function e() {
- 0 === --h && d(f)
- }
- var f = {},
- h = 2,
- i = c.template;
- c = c.viewModel, i ? g(b, i, function(b) {
- m.g.jb("loadTemplate", [a, b], function(a) {
- f.template = a, e()
- })
- }) : e(), c ? g(b, c, function(b) {
- m.g.jb("loadViewModel", [a, b], function(a) {
- f[k] = a, e()
- })
- }) : e()
- }
- function d(a, b, c) {
- if ("function" == typeof b) c(function(a) {
- return new b(a)
- });
- else if ("function" == typeof b[k]) c(b[k]);
- else if ("instance" in b) {
- var e = b.instance;
- c(function() {
- return e
- })
- } else "viewModel" in b ? d(a, b.viewModel, c) : a("Unknown viewModel value: " + b)
- }
- function e(a) {
- switch (m.a.t(a)) {
- case "script":
- return m.a.ba(a.text);
- case "textarea":
- return m.a.ba(a.value);
- case "template":
- if (f(a.content)) return m.a.ia(a.content.childNodes)
- }
- return m.a.ia(a.childNodes)
- }
- function f(a) {
- return b.DocumentFragment ? a instanceof DocumentFragment : a && 11 === a.nodeType
- }
- function g(a, c, d) {
- "string" == typeof c.require ? h || b.require ? (h || b.require)([c.require], d) : a("Uses require, but no AMD loader is present") : d(c)
- }
- function i(a) {
- return function(b) {
- throw Error("Component '" + a + "': " + b)
- }
- }
- var j = {};
- m.g.tc = function(a, b) {
- if (!b) throw Error("Invalid configuration for " + a);
- if (m.g.Qa(a)) throw Error("Component " + a + " is already registered");
- j[a] = b
- }, m.g.Qa = function(a) {
- return a in j
- }, m.g.wc = function(a) {
- delete j[a], m.g.tb(a)
- }, m.g.ub = {
- getConfig: function(a, b) {
- b(j.hasOwnProperty(a) ? j[a] : null)
- },
- loadComponent: function(b, c, d) {
- var e = i(b);
- g(e, c, function(c) {
- a(b, e, c, d)
- })
- },
- loadTemplate: function(a, d, g) {
- if (a = i(a), "string" == typeof d) g(m.a.ba(d));
- else if (d instanceof Array) g(d);
- else if (f(d)) g(m.a.S(d.childNodes));
- else if (d.element)
- if (d = d.element, b.HTMLElement ? d instanceof HTMLElement : d && d.tagName && 1 === d.nodeType) g(e(d));
- else if ("string" == typeof d) {
- var h = c.getElementById(d);
- h ? g(e(h)) : a("Cannot find element with ID " + d)
- } else a("Unknown element type: " + d);
- else a("Unknown template value: " + d)
- },
- loadViewModel: function(a, b, c) {
- d(i(a), b, c)
- }
- };
- var k = "createViewModel";
- m.b("components.register", m.g.tc), m.b("components.isRegistered", m.g.Qa), m.b("components.unregister", m.g.wc), m.b("components.defaultLoader", m.g.ub), m.g.loaders.push(m.g.ub), m.g.Ub = j
- }(),
- function() {
- function a(a, c) {
- var d = a.getAttribute("params");
- if (d) {
- var d = b.parseBindingsString(d, c, a, {
- valueAccessors: !0,
- bindingParams: !0
- }),
- d = m.a.na(d, function(b) {
- return m.s(b, null, {
- o: a
- })
- }),
- e = m.a.na(d, function(b) {
- return b.Z() ? m.s(function() {
- return m.a.c(b())
- }, null, {
- o: a
- }) : b.v()
- });
- return e.hasOwnProperty("$raw") || (e.$raw = d), e
- }
- return {
- $raw: {}
- }
- }
- m.g.getComponentNameForNode = function(a) {
- return a = m.a.t(a), m.g.Qa(a) && a
- }, m.g.mb = function(b, c, d, e) {
- if (1 === c.nodeType) {
- var f = m.g.getComponentNameForNode(c);
- if (f) {
- if (b = b || {}, b.component) throw Error('Cannot use the "component" binding on a custom element matching a component');
- var g = {
- name: f,
- params: a(c, d)
- };
- b.component = e ? function() {
- return g
- } : g
- }
- }
- return b
- };
- var b = new m.J;
- 9 > m.a.L && (m.g.register = function(a) {
- return function(b) {
- return c.createElement(b), a.apply(this, arguments)
- }
- }(m.g.register), c.createDocumentFragment = function(a) {
- return function() {
- var b, c = a(),
- d = m.g.Ub;
- for (b in d) d.hasOwnProperty(b) && c.createElement(b);
- return c
- }
- }(c.createDocumentFragment))
- }(),
- function() {
- var a = 0;
- m.d.component = {
- init: function(b, c, d, e, f) {
- function g() {
- var a = h && h.dispose;
- "function" == typeof a && a.call(h), i = null
- }
- var h, i;
- return m.a.w.da(b, g), m.s(function() {
- var d, e, j = m.a.c(c());
- if ("string" == typeof j ? d = j : (d = m.a.c(j.name), e = m.a.c(j.params)), !d) throw Error("No component name specified");
- var k = i = ++a;
- m.g.get(d, function(a) {
- if (i === k) {
- if (g(), !a) throw Error("Unknown component '" + d + "'");
- var c = a.template;
- if (!c) throw Error("Component '" + d + "' has no template");
- c = m.a.ia(c), m.f.T(b, c);
- var c = e,
- j = a.createViewModel;
- a = j ? j.call(a, c, {
- element: b
- }) : c, c = f.createChildContext(a), h = a, m.Ca(c, b)
- }
- })
- }, null, {
- o: b
- }), {
- controlsDescendantBindings: !0
- }
- }
- }, m.f.Q.component = !0
- }();
- var s = {
- class: "className",
- for: "htmlFor"
- };
- m.d.attr = {
- update: function(b, c) {
- var d = m.a.c(c()) || {};
- m.a.G(d, function(c, d) {
- d = m.a.c(d);
- var e = !1 === d || null === d || d === a;
- e && b.removeAttribute(c), 8 >= m.a.L && c in s ? (c = s[c], e ? b.removeAttribute(c) : b[c] = d) : e || b.setAttribute(c, d.toString()), "name" === c && m.a.Mb(b, e ? "" : d.toString())
- })
- }
- },
- function() {
- m.d.checked = {
- after: ["value", "attr"],
- init: function(b, c, d) {
- function e() {
- var a = b.checked,
- e = l ? g() : a;
- if (!m.Y.ma() && (!i || a)) {
- var f = m.k.B(c);
- j ? k !== e ? (a && (m.a.ea(f, e, !0), m.a.ea(f, k, !1)), k = e) : m.a.ea(f, e, a) : m.h.pa(f, d, "checked", e, !0)
- }
- }
- function f() {
- var a = m.a.c(c());
- b.checked = j ? 0 <= m.a.m(a, g()) : h ? a : g() === a
- }
- var g = m.Ib(function() {
- return d.has("checkedValue") ? m.a.c(d.get("checkedValue")) : d.has("value") ? m.a.c(d.get("value")) : b.value
- }),
- h = "checkbox" == b.type,
- i = "radio" == b.type;
- if (h || i) {
- var j = h && m.a.c(c()) instanceof Array,
- k = j ? g() : a,
- l = i || j;
- i && !b.name && m.d.uniqueName.init(b, function() {
- return !0
- }), m.s(e, null, {
- o: b
- }), m.a.n(b, "click", e), m.s(f, null, {
- o: b
- })
- }
- }
- }, m.h.V.checked = !0, m.d.checkedValue = {
- update: function(a, b) {
- a.value = m.a.c(b())
- }
- }
- }(), m.d.css = {
- update: function(a, b) {
- var c = m.a.c(b());
- "object" == typeof c ? m.a.G(c, function(b, c) {
- c = m.a.c(c), m.a.Ba(a, b, c)
- }) : (c = String(c || ""), m.a.Ba(a, a.__ko__cssValue, !1), a.__ko__cssValue = c, m.a.Ba(a, c, !0))
- }
- }, m.d.enable = {
- update: function(a, b) {
- var c = m.a.c(b());
- c && a.disabled ? a.removeAttribute("disabled") : c || a.disabled || (a.disabled = !0)
- }
- }, m.d.disable = {
- update: function(a, b) {
- m.d.enable.update(a, function() {
- return !m.a.c(b())
- })
- }
- }, m.d.event = {
- init: function(a, b, c, d, e) {
- var f = b() || {};
- m.a.G(f, function(f) {
- "string" == typeof f && m.a.n(a, f, function(a) {
- var g, h = b()[f];
- if (h) {
- try {
- var i = m.a.S(arguments);
- d = e.$data, i.unshift(d), g = h.apply(d, i)
- } finally {
- !0 !== g && (a.preventDefault ? a.preventDefault() : a.returnValue = !1)
- }!1 === c.get(f + "Bubble") && (a.cancelBubble = !0, a.stopPropagation && a.stopPropagation())
- }
- })
- })
- }
- }, m.d.foreach = {
- Eb: function(a) {
- return function() {
- var b = a(),
- c = m.a.Xa(b);
- return c && "number" != typeof c.length ? (m.a.c(b), {
- foreach: c.data,
- as: c.as,
- includeDestroyed: c.includeDestroyed,
- afterAdd: c.afterAdd,
- beforeRemove: c.beforeRemove,
- afterRender: c.afterRender,
- beforeMove: c.beforeMove,
- afterMove: c.afterMove,
- templateEngine: m.O.Oa
- }) : {
- foreach: b,
- templateEngine: m.O.Oa
- }
- }
- },
- init: function(a, b) {
- return m.d.template.init(a, m.d.foreach.Eb(b))
- },
- update: function(a, b, c, d, e) {
- return m.d.template.update(a, m.d.foreach.Eb(b), c, d, e)
- }
- }, m.h.ha.foreach = !1, m.f.Q.foreach = !0, m.d.hasfocus = {
- init: function(a, b, c) {
- function d(d) {
- a.__ko_hasfocusUpdating = !0;
- var e = a.ownerDocument;
- if ("activeElement" in e) {
- var f;
- try {
- f = e.activeElement
- } catch (a) {
- f = e.body
- }
- d = f === a
- }
- e = b(), m.h.pa(e, c, "hasfocus", d, !0), a.__ko_hasfocusLastValue = d, a.__ko_hasfocusUpdating = !1
- }
- var e = d.bind(null, !0),
- f = d.bind(null, !1);
- m.a.n(a, "focus", e), m.a.n(a, "focusin", e), m.a.n(a, "blur", f), m.a.n(a, "focusout", f)
- },
- update: function(a, b) {
- var c = !!m.a.c(b());
- a.__ko_hasfocusUpdating || a.__ko_hasfocusLastValue === c || (c ? a.focus() : a.blur(), m.k.B(m.a.oa, null, [a, c ? "focusin" : "focusout"]))
- }
- }, m.h.V.hasfocus = !0, m.d.hasFocus = m.d.hasfocus, m.h.V.hasFocus = !0, m.d.html = {
- init: function() {
- return {
- controlsDescendantBindings: !0
- }
- },
- update: function(a, b) {
- m.a.$a(a, b())
- }
- }, l("if"), l("ifnot", !1, !0), l("with", !0, !1, function(a, b) {
- return a.createChildContext(b)
- });
- var t = {};
- m.d.options = {
- init: function(a) {
- if ("select" !== m.a.t(a)) throw Error("options binding applies only to SELECT elements");
- for (; 0 < a.length;) a.remove(0);
- return {
- controlsDescendantBindings: !0
- }
- },
- update: function(b, c, d) {
- function e() {
- return m.a.ta(b.options, function(a) {
- return a.selected
- })
- }
- function f(a, b, c) {
- var d = typeof b;
- return "function" == d ? b(a) : "string" == d ? a[b] : c
- }
- function g(a, c) {
- if (l.length) {
- var d = 0 <= m.a.m(l, m.i.q(c[0]));
- m.a.Nb(c[0], d), n && !d && m.k.B(m.a.oa, null, [b, "change"])
- }
- }
- var h = 0 != b.length && b.multiple ? b.scrollTop : null,
- i = m.a.c(c()),
- j = d.get("optionsIncludeDestroyed");
- c = {};
- var k, l;
- l = b.multiple ? m.a.Da(e(), m.i.q) : 0 <= b.selectedIndex ? [m.i.q(b.options[b.selectedIndex])] : [], i && ("undefined" == typeof i.length && (i = [i]), k = m.a.ta(i, function(b) {
- return j || b === a || null === b || !m.a.c(b._destroy)
- }), d.has("optionsCaption") && (i = m.a.c(d.get("optionsCaption")), null !== i && i !== a && k.unshift(t)));
- var n = !1;
- c.beforeRemove = function(a) {
- b.removeChild(a)
- }, i = g, d.has("optionsAfterRender") && (i = function(b, c) {
- g(0, c), m.k.B(d.get("optionsAfterRender"), null, [c[0], b !== t ? b : a])
- }), m.a.Za(b, k, function(c, e, g) {
- return g.length && (l = g[0].selected ? [m.i.q(g[0])] : [], n = !0), e = b.ownerDocument.createElement("option"), c === t ? (m.a.bb(e, d.get("optionsCaption")), m.i.ca(e, a)) : (g = f(c, d.get("optionsValue"), c), m.i.ca(e, m.a.c(g)), c = f(c, d.get("optionsText"), g), m.a.bb(e, c)), [e]
- }, c, i), m.k.B(function() {
- d.get("valueAllowUnset") && d.has("value") ? m.i.ca(b, m.a.c(d.get("value")), !0) : (b.multiple ? l.length && e().length < l.length : l.length && 0 <= b.selectedIndex ? m.i.q(b.options[b.selectedIndex]) !== l[0] : l.length || 0 <= b.selectedIndex) && m.a.oa(b, "change")
- }), m.a.dc(b), h && 20 < Math.abs(h - b.scrollTop) && (b.scrollTop = h)
- }
- }, m.d.options.Va = m.a.e.F(), m.d.selectedOptions = {
- after: ["options", "foreach"],
- init: function(a, b, c) {
- m.a.n(a, "change", function() {
- var d = b(),
- e = [];
- m.a.u(a.getElementsByTagName("option"), function(a) {
- a.selected && e.push(m.i.q(a))
- }), m.h.pa(d, c, "selectedOptions", e)
- })
- },
- update: function(a, b) {
- if ("select" != m.a.t(a)) throw Error("values binding applies only to SELECT elements");
- var c = m.a.c(b());
- c && "number" == typeof c.length && m.a.u(a.getElementsByTagName("option"), function(a) {
- var b = 0 <= m.a.m(c, m.i.q(a));
- m.a.Nb(a, b)
- })
- }
- }, m.h.V.selectedOptions = !0, m.d.style = {
- update: function(b, c) {
- var d = m.a.c(c() || {});
- m.a.G(d, function(c, d) {
- d = m.a.c(d), null !== d && d !== a && !1 !== d || (d = ""), b.style[c] = d
- })
- }
- }, m.d.submit = {
- init: function(a, b, c, d, e) {
- if ("function" != typeof b()) throw Error("The value for a submit binding must be a function");
- m.a.n(a, "submit", function(c) {
- var d, f = b();
- try {
- d = f.call(e.$data, a)
- } finally {
- !0 !== d && (c.preventDefault ? c.preventDefault() : c.returnValue = !1)
- }
- })
- }
- }, m.d.text = {
- init: function() {
- return {
- controlsDescendantBindings: !0
- }
- },
- update: function(a, b) {
- m.a.bb(a, b())
- }
- }, m.f.Q.text = !0,
- function() {
- if (b && b.navigator) var c = function(a) {
- if (a) return parseFloat(a[1])
- },
- d = b.opera && b.opera.version && parseInt(b.opera.version()),
- e = b.navigator.userAgent,
- f = c(e.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),
- g = c(e.match(/Firefox\/([^ ]*)/));
- if (10 > m.a.L) var h = m.a.e.F(),
- i = m.a.e.F(),
- j = function(a) {
- var b = this.activeElement;
- (b = b && m.a.e.get(b, i)) && b(a)
- },
- k = function(a, b) {
- var c = a.ownerDocument;
- m.a.e.get(c, h) || (m.a.e.set(c, h, !0), m.a.n(c, "selectionchange", j)), m.a.e.set(a, i, b)
- };
- m.d.textInput = {
- init: function(b, c, e) {
- function h(a, c) {
- m.a.n(b, a, c)
- }
- function i() {
- var d = m.a.c(c());
- null !== d && d !== a || (d = ""), o !== a && d === o ? setTimeout(i, 4) : b.value !== d && (p = d, b.value = d)
- }
- function j() {
- n || (o = b.value, n = setTimeout(l, 4))
- }
- function l() {
- clearTimeout(n), o = n = a;
- var d = b.value;
- p !== d && (p = d, m.h.pa(c(), e, "textInput", d))
- }
- var n, o, p = b.value;
- 10 > m.a.L ? (h("propertychange", function(a) {
- "value" === a.propertyName && l()
- }), 8 == m.a.L && (h("keyup", l), h("keydown", l)), 8 <= m.a.L && (k(b, l), h("dragend", j))) : (h("input", l), 5 > f && "textarea" === m.a.t(b) ? (h("keydown", j), h("paste", j), h("cut", j)) : 11 > d ? h("keydown", j) : 4 > g && (h("DOMAutoComplete", l), h("dragdrop", l), h("drop", l))), h("change", l), m.s(i, null, {
- o: b
- })
- }
- }, m.h.V.textInput = !0, m.d.textinput = {
- preprocess: function(a, b, c) {
- c("textInput", a)
- }
- }
- }(), m.d.uniqueName = {
- init: function(a, b) {
- if (b()) {
- var c = "ko_unique_" + ++m.d.uniqueName.Zb;
- m.a.Mb(a, c)
- }
- }
- }, m.d.uniqueName.Zb = 0, m.d.value = {
- after: ["options", "foreach"],
- init: function(a, b, c) {
- if ("input" != a.tagName.toLowerCase() || "checkbox" != a.type && "radio" != a.type) {
- var d = ["change"],
- e = c.get("valueUpdate"),
- f = !1,
- g = null;
- e && ("string" == typeof e && (e = [e]), m.a.ga(d, e), d = m.a.rb(d));
- var h = function() {
- g = null, f = !1;
- var d = b(),
- e = m.i.q(a);
- m.h.pa(d, c, "value", e)
- };
- !m.a.L || "input" != a.tagName.toLowerCase() || "text" != a.type || "off" == a.autocomplete || a.form && "off" == a.form.autocomplete || -1 != m.a.m(d, "propertychange") || (m.a.n(a, "propertychange", function() {
- f = !0
- }), m.a.n(a, "focus", function() {
- f = !1
- }), m.a.n(a, "blur", function() {
- f && h()
- })), m.a.u(d, function(b) {
- var c = h;
- m.a.vc(b, "after") && (c = function() {
- g = m.i.q(a), setTimeout(h, 0)
- }, b = b.substring(5)), m.a.n(a, b, c)
- });
- var i = function() {
- var d = m.a.c(b()),
- e = m.i.q(a);
- if (null !== g && d === g) setTimeout(i, 0);
- else if (d !== e)
- if ("select" === m.a.t(a)) {
- var f = c.get("valueAllowUnset"),
- e = function() {
- m.i.ca(a, d, f)
- };
- e(), f || d === m.i.q(a) ? setTimeout(e, 0) : m.k.B(m.a.oa, null, [a, "change"])
- } else m.i.ca(a, d)
- };
- m.s(i, null, {
- o: a
- })
- } else m.ra(a, {
- checkedValue: b
- })
- },
- update: function() {}
- }, m.h.V.value = !0, m.d.visible = {
- update: function(a, b) {
- var c = m.a.c(b()),
- d = "none" != a.style.display;
- c && !d ? a.style.display = "" : !c && d && (a.style.display = "none")
- }
- },
- function(a) {
- m.d[a] = {
- init: function(b, c, d, e, f) {
- return m.d.event.init.call(this, b, function() {
- var b = {};
- return b[a] = c(), b
- }, d, e, f)
- }
- }
- }("click"), m.H = function() {}, m.H.prototype.renderTemplateSource = function() {
- throw Error("Override renderTemplateSource")
- }, m.H.prototype.createJavaScriptEvaluatorBlock = function() {
- throw Error("Override createJavaScriptEvaluatorBlock")
- }, m.H.prototype.makeTemplateSource = function(a, b) {
- if ("string" == typeof a) {
- b = b || c;
- var d = b.getElementById(a);
- if (!d) throw Error("Cannot find template with ID " + a);
- return new m.r.l(d)
- }
- if (1 == a.nodeType || 8 == a.nodeType) return new m.r.fa(a);
- throw Error("Unknown template type: " + a)
- }, m.H.prototype.renderTemplate = function(a, b, c, d) {
- return a = this.makeTemplateSource(a, d), this.renderTemplateSource(a, b, c)
- }, m.H.prototype.isTemplateRewritten = function(a, b) {
- return !1 === this.allowTemplateRewriting || this.makeTemplateSource(a, b).data("isRewritten")
- }, m.H.prototype.rewriteTemplate = function(a, b, c) {
- a = this.makeTemplateSource(a, c), b = b(a.text()), a.text(b), a.data("isRewritten", !0)
- }, m.b("templateEngine", m.H), m.fb = function() {
- function a(a, b, c, d) {
- a = m.h.Wa(a);
- for (var e = m.h.ha, f = 0; f < a.length; f++) {
- var g = a[f].key;
- if (e.hasOwnProperty(g)) {
- var h = e[g];
- if ("function" == typeof h) {
- if (g = h(a[f].value)) throw Error(g)
- } else if (!h) throw Error("This template engine does not support the '" + g + "' binding within its templates")
- }
- }
- return c = "ko.__tr_ambtns(function($context,$element){return(function(){return{ " + m.h.ya(a, {
- valueAccessors: !0
- }) + " } })()},'" + c.toLowerCase() + "')", d.createJavaScriptEvaluatorBlock(c) + b
- }
- var b = /(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,
- c = /\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;
- return {
- ec: function(a, b, c) {
- b.isTemplateRewritten(a, c) || b.rewriteTemplate(a, function(a) {
- return m.fb.nc(a, b)
- }, c)
- },
- nc: function(d, e) {
- return d.replace(b, function(b, c, d, f, g) {
- return a(g, c, d, e)
- }).replace(c, function(b, c) {
- return a(c, "<!-- ko -->", "#comment", e)
- })
- },
- Xb: function(a, b) {
- return m.D.Ua(function(c, d) {
- var e = c.nextSibling;
- e && e.nodeName.toLowerCase() === b && m.ra(e, a, d)
- })
- }
- }
- }(), m.b("__tr_ambtns", m.fb.Xb),
- function() {
- m.r = {}, m.r.l = function(a) {
- this.l = a
- }, m.r.l.prototype.text = function() {
- var a = m.a.t(this.l),
- a = "script" === a ? "text" : "textarea" === a ? "value" : "innerHTML";
- if (0 == arguments.length) return this.l[a];
- var b = arguments[0];
- "innerHTML" === a ? m.a.$a(this.l, b) : this.l[a] = b
- };
- var b = m.a.e.F() + "_";
- m.r.l.prototype.data = function(a) {
- return 1 === arguments.length ? m.a.e.get(this.l, b + a) : void m.a.e.set(this.l, b + a, arguments[1])
- };
- var c = m.a.e.F();
- m.r.fa = function(a) {
- this.l = a
- }, m.r.fa.prototype = new m.r.l, m.r.fa.prototype.text = function() {
- if (0 == arguments.length) {
- var b = m.a.e.get(this.l, c) || {};
- return b.gb === a && b.Ga && (b.gb = b.Ga.innerHTML), b.gb
- }
- m.a.e.set(this.l, c, {
- gb: arguments[0]
- })
- }, m.r.l.prototype.nodes = function() {
- return 0 == arguments.length ? (m.a.e.get(this.l, c) || {}).Ga : void m.a.e.set(this.l, c, {
- Ga: arguments[0]
- })
- }, m.b("templateSources", m.r), m.b("templateSources.domElement", m.r.l), m.b("templateSources.anonymousTemplate", m.r.fa)
- }(),
- function() {
- function b(a, b, c) {
- var d;
- for (b = m.f.nextSibling(b); a && (d = a) !== b;) a = m.f.nextSibling(d), c(d, a)
- }
- function c(a, c) {
- if (a.length) {
- var d = a[0],
- e = a[a.length - 1],
- f = d.parentNode,
- g = m.J.instance,
- h = g.preprocessNode;
- if (h) {
- if (b(d, e, function(a, b) {
- var c = a.previousSibling,
- f = h.call(g, a);
- f && (a === d && (d = f[0] || b), a === e && (e = f[f.length - 1] || c))
- }), a.length = 0, !d) return;
- d === e ? a.push(d) : (a.push(d, e), m.a.ka(a, f))
- }
- b(d, e, function(a) {
- 1 !== a.nodeType && 8 !== a.nodeType || m.pb(c, a)
- }), b(d, e, function(a) {
- 1 !== a.nodeType && 8 !== a.nodeType || m.D.Sb(a, [c])
- }), m.a.ka(a, f)
- }
- }
- function d(a) {
- return a.nodeType ? a : 0 < a.length ? a[0] : null
- }
- function e(a, b, e, g, h) {
- h = h || {};
- var i = a && d(a),
- i = i && i.ownerDocument,
- j = h.templateEngine || f;
- if (m.fb.ec(e, j, i), e = j.renderTemplate(e, g, h, i), "number" != typeof e.length || 0 < e.length && "number" != typeof e[0].nodeType) throw Error("Template engine must return an array of DOM nodes");
- switch (i = !1, b) {
- case "replaceChildren":
- m.f.T(a, e), i = !0;
- break;
- case "replaceNode":
- m.a.Lb(a, e), i = !0;
- break;
- case "ignoreTargetNode":
- break;
- default:
- throw Error("Unknown renderMode: " + b)
- }
- return i && (c(e, g), h.afterRender && m.k.B(h.afterRender, null, [e, g.$data])), e
- }
- var f;
- m.ab = function(b) {
- if (b != a && !(b instanceof m.H)) throw Error("templateEngine must inherit from ko.templateEngine");
- f = b
- }, m.Ya = function(b, c, g, h, i) {
- if (g = g || {}, (g.templateEngine || f) == a) throw Error("Set a template engine before calling renderTemplate");
- if (i = i || "replaceChildren", h) {
- var j = d(h);
- return m.j(function() {
- var a = c && c instanceof m.N ? c : new m.N(m.a.c(c)),
- f = m.C(b) ? b() : "function" == typeof b ? b(a.$data, a) : b,
- a = e(h, i, f, a, g);
- "replaceNode" == i && (h = a, j = d(h))
- }, null, {
- Ia: function() {
- return !j || !m.a.Ja(j)
- },
- o: j && "replaceNode" == i ? j.parentNode : j
- })
- }
- return m.D.Ua(function(a) {
- m.Ya(b, c, g, a, "replaceNode")
- })
- }, m.uc = function(b, d, f, g, h) {
- function i(a, b) {
- c(b, k), f.afterRender && f.afterRender(b, a)
- }
- function j(a, c) {
- k = h.createChildContext(a, f.as, function(a) {
- a.$index = c
- });
- var d = m.C(b) ? b() : "function" == typeof b ? b(a, k) : b;
- return e(null, "ignoreTargetNode", d, k, f)
- }
- var k;
- return m.j(function() {
- var b = m.a.c(d) || [];
- "undefined" == typeof b.length && (b = [b]), b = m.a.ta(b, function(b) {
- return f.includeDestroyed || b === a || null === b || !m.a.c(b._destroy)
- }), m.k.B(m.a.Za, null, [g, b, j, f, i])
- }, null, {
- o: g
- })
- };
- var g = m.a.e.F();
- m.d.template = {
- init: function(a, b) {
- var c = m.a.c(b());
- return "string" == typeof c || c.name ? m.f.ja(a) : (c = m.f.childNodes(a), c = m.a.oc(c), new m.r.fa(a).nodes(c)), {
- controlsDescendantBindings: !0
- }
- },
- update: function(b, c, d, e, f) {
- var h, i = c();
- c = m.a.c(i), d = !0, e = null, "string" == typeof c ? c = {} : (i = c.name, "if" in c && (d = m.a.c(c.if)), d && "ifnot" in c && (d = !m.a.c(c.ifnot)), h = m.a.c(c.data)), "foreach" in c ? e = m.uc(i || b, d && c.foreach || [], c, b, f) : d ? (f = "data" in c ? f.createChildContext(h, c.as) : f, e = m.Ya(i || b, f, c, b)) : m.f.ja(b), f = e, (h = m.a.e.get(b, g)) && "function" == typeof h.K && h.K(), m.a.e.set(b, g, f && f.Z() ? f : a)
- }
- }, m.h.ha.template = function(a) {
- return a = m.h.Wa(a), 1 == a.length && a[0].unknown || m.h.lc(a, "name") ? null : "This template engine does not support anonymous templates nested within its templates"
- }, m.f.Q.template = !0
- }(), m.b("setTemplateEngine", m.ab), m.b("renderTemplate", m.Ya), m.a.wb = function(a, b, c) {
- if (a.length && b.length) {
- var d, e, f, g, h;
- for (d = e = 0;
- (!c || d < c) && (g = a[e]); ++e) {
- for (f = 0; h = b[f]; ++f)
- if (g.value === h.value) {
- g.moved = h.index, h.moved = g.index, b.splice(f, 1), d = f = 0;
- break
- }
- d += f
- }
- }
- }, m.a.Fa = function() {
- function a(a, b, c, d, e) {
- var f, g, h, i, j, k = Math.min,
- l = Math.max,
- n = [],
- o = a.length,
- p = b.length,
- q = p - o || 1,
- r = o + p + 1;
- for (f = 0; f <= o; f++)
- for (i = h, n.push(h = []), j = k(p, f + q), g = l(0, f - 1); g <= j; g++) h[g] = g ? f ? a[f - 1] === b[g - 1] ? i[g - 1] : k(i[g] || r, h[g - 1] || r) + 1 : g + 1 : f + 1;
- for (k = [], l = [], q = [], f = o, g = p; f || g;) p = n[f][g] - 1, g && p === n[f][g - 1] ? l.push(k[k.length] = {
- status: c,
- value: b[--g],
- index: g
- }) : f && p === n[f - 1][g] ? q.push(k[k.length] = {
- status: d,
- value: a[--f],
- index: f
- }) : (--g, --f, e.sparse || k.push({
- status: "retained",
- value: b[g]
- }));
- return m.a.wb(l, q, 10 * o), k.reverse()
- }
- return function(b, c, d) {
- return d = "boolean" == typeof d ? {
- dontLimitMoves: d
- } : d || {}, b = b || [], c = c || [], b.length <= c.length ? a(b, c, "added", "deleted", d) : a(c, b, "deleted", "added", d)
- }
- }(), m.b("utils.compareArrays", m.a.Fa),
- function() {
- function b(b, c, d, e, f) {
- var g = [],
- h = m.j(function() {
- var a = c(d, f, m.a.ka(g, b)) || [];
- 0 < g.length && (m.a.Lb(g, a), e && m.k.B(e, null, [d, a, f])), g.length = 0, m.a.ga(g, a)
- }, null, {
- o: b,
- Ia: function() {
- return !m.a.ob(g)
- }
- });
- return {
- $: g,
- j: h.Z() ? h : a
- }
- }
- var c = m.a.e.F();
- m.a.Za = function(d, e, f, g, h) {
- function i(a, b) {
- u = l[b], r !== b && (x[a] = u), u.Na(r++), m.a.ka(u.$, d), p.push(u), t.push(u)
- }
- function j(a, b) {
- if (a)
- for (var c = 0, d = b.length; c < d; c++) b[c] && m.a.u(b[c].$, function(d) {
- a(d, c, b[c].sa)
- })
- }
- e = e || [], g = g || {};
- var k = m.a.e.get(d, c) === a,
- l = m.a.e.get(d, c) || [],
- n = m.a.Da(l, function(a) {
- return a.sa
- }),
- o = m.a.Fa(n, e, g.dontLimitMoves),
- p = [],
- q = 0,
- r = 0,
- s = [],
- t = [];
- e = [];
- for (var u, v, w, x = [], n = [], y = 0; v = o[y]; y++) switch (w = v.moved, v.status) {
- case "deleted":
- w === a && (u = l[q], u.j && u.j.K(), s.push.apply(s, m.a.ka(u.$, d)), g.beforeRemove && (e[y] = u, t.push(u))), q++;
- break;
- case "retained":
- i(y, q++);
- break;
- case "added":
- w !== a ? i(y, w) : (u = {
- sa: v.value,
- Na: m.p(r++)
- }, p.push(u), t.push(u), k || (n[y] = u))
- }
- j(g.beforeMove, x), m.a.u(s, g.beforeRemove ? m.R : m.removeNode);
- for (var z, y = 0, k = m.f.firstChild(d); u = t[y]; y++) {
- for (u.$ || m.a.extend(u, b(d, f, u.sa, h, u.Na)), q = 0; o = u.$[q]; k = o.nextSibling, z = o, q++) o !== k && m.f.Bb(d, o, z);
- !u.ic && h && (h(u.sa, u.$, u.Na), u.ic = !0)
- }
- j(g.beforeRemove, e), j(g.afterMove, x), j(g.afterAdd, n), m.a.e.set(d, c, p)
- }
- }(), m.b("utils.setDomNodeChildrenFromArrayMapping", m.a.Za), m.O = function() {
- this.allowTemplateRewriting = !1
- }, m.O.prototype = new m.H, m.O.prototype.renderTemplateSource = function(a) {
- var b = (9 > m.a.L ? 0 : a.nodes) ? a.nodes() : null;
- return b ? m.a.S(b.cloneNode(!0).childNodes) : (a = a.text(), m.a.ba(a))
- }, m.O.Oa = new m.O, m.ab(m.O.Oa), m.b("nativeTemplateEngine", m.O),
- function() {
- m.Sa = function() {
- var a = this.kc = function() {
- if (!e || !e.tmpl) return 0;
- try {
- if (0 <= e.tmpl.tag.tmpl.open.toString().indexOf("__")) return 2
- } catch (a) {}
- return 1
- }();
- this.renderTemplateSource = function(b, d, f) {
- if (f = f || {}, 2 > a) throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");
- var g = b.data("precompiled");
- return g || (g = b.text() || "", g = e.template(null, "{{ko_with $item.koBindingContext}}" + g + "{{/ko_with}}"), b.data("precompiled", g)), b = [d.$data], d = e.extend({
- koBindingContext: d
- }, f.templateOptions), d = e.tmpl(g, b, d), d.appendTo(c.createElement("div")), e.fragments = {}, d
- }, this.createJavaScriptEvaluatorBlock = function(a) {
- return "{{ko_code ((function() { return " + a + " })()) }}"
- }, this.addTemplate = function(a, b) {
- c.write("<script type='text/html' id='" + a + "'>" + b + "</script>")
- }, 0 < a && (e.tmpl.tag.ko_code = {
- open: "__.push($1 || '');"
- }, e.tmpl.tag.ko_with = {
- open: "with($1) {",
- close: "} "
- })
- }, m.Sa.prototype = new m.H;
- var a = new m.Sa;
- 0 < a.kc && m.ab(a), m.b("jqueryTmplTemplateEngine", m.Sa)
- }()
- })
- }()
- }(),
- function() {
- function a(a) {
- function b(b, c, d, e, f, g) {
- for (; f >= 0 && g > f; f += a) {
- var h = e ? e[f] : f;
- d = c(d, b[h], h, b)
- }
- return d
- }
- return function(c, d, e, f) {
- d = t(d, f, 4);
- var g = !A(c) && s.keys(c),
- h = (g || c).length,
- i = a > 0 ? 0 : h - 1;
- return arguments.length < 3 && (e = c[g ? g[i] : i], i += a), b(c, d, e, g, i, h)
- }
- }
- function b(a) {
- return function(b, c, d) {
- c = u(c, d);
- for (var e = z(b), f = a > 0 ? 0 : e - 1; f >= 0 && e > f; f += a)
- if (c(b[f], f, b)) return f;
- return -1
- }
- }
- function c(a, b, c) {
- return function(d, e, f) {
- var g = 0,
- h = z(d);
- if ("number" == typeof f) a > 0 ? g = f >= 0 ? f : Math.max(f + h, g) : h = f >= 0 ? Math.min(f + 1, h) : f + h + 1;
- else if (c && f && h) return f = c(d, e), d[f] === e ? f : -1;
- if (e !== e) return f = b(k.call(d, g, h), s.isNaN), f >= 0 ? f + g : -1;
- for (f = a > 0 ? g : h - 1; f >= 0 && h > f; f += a)
- if (d[f] === e) return f;
- return -1
- }
- }
- function d(a, b) {
- var c = F.length,
- d = a.constructor,
- e = s.isFunction(d) && d.prototype || h,
- f = "constructor";
- for (s.has(a, f) && !s.contains(b, f) && b.push(f); c--;) f = F[c], f in a && a[f] !== e[f] && !s.contains(b, f) && b.push(f)
- }
- var e = this,
- f = e._,
- g = Array.prototype,
- h = Object.prototype,
- i = Function.prototype,
- j = g.push,
- k = g.slice,
- l = h.toString,
- m = h.hasOwnProperty,
- n = Array.isArray,
- o = Object.keys,
- p = i.bind,
- q = Object.create,
- r = function() {},
- s = function(a) {
- return a instanceof s ? a : this instanceof s ? void(this._wrapped = a) : new s(a)
- };
- "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = s), exports._ = s) : e._ = s, s.VERSION = "1.8.3";
- var t = function(a, b, c) {
- if (void 0 === b) return a;
- switch (null == c ? 3 : c) {
- case 1:
- return function(c) {
- return a.call(b, c)
- };
- case 2:
- return function(c, d) {
- return a.call(b, c, d)
- };
- case 3:
- return function(c, d, e) {
- return a.call(b, c, d, e)
- };
- case 4:
- return function(c, d, e, f) {
- return a.call(b, c, d, e, f)
- }
- }
- return function() {
- return a.apply(b, arguments)
- }
- },
- u = function(a, b, c) {
- return null == a ? s.identity : s.isFunction(a) ? t(a, b, c) : s.isObject(a) ? s.matcher(a) : s.property(a)
- };
- s.iteratee = function(a, b) {
- return u(a, b, 1 / 0)
- };
- var v = function(a, b) {
- return function(c) {
- var d = arguments.length;
- if (2 > d || null == c) return c;
- for (var e = 1; d > e; e++)
- for (var f = arguments[e], g = a(f), h = g.length, i = 0; h > i; i++) {
- var j = g[i];
- b && void 0 !== c[j] || (c[j] = f[j])
- }
- return c
- }
- },
- w = function(a) {
- if (!s.isObject(a)) return {};
- if (q) return q(a);
- r.prototype = a;
- var b = new r;
- return r.prototype = null, b
- },
- x = function(a) {
- return function(b) {
- return null == b ? void 0 : b[a]
- }
- },
- y = Math.pow(2, 53) - 1,
- z = x("length"),
- A = function(a) {
- var b = z(a);
- return "number" == typeof b && b >= 0 && y >= b
- };
- s.each = s.forEach = function(a, b, c) {
- b = t(b, c);
- var d, e;
- if (A(a))
- for (d = 0, e = a.length; e > d; d++) b(a[d], d, a);
- else {
- var f = s.keys(a);
- for (d = 0, e = f.length; e > d; d++) b(a[f[d]], f[d], a)
- }
- return a
- }, s.map = s.collect = function(a, b, c) {
- b = u(b, c);
- for (var d = !A(a) && s.keys(a), e = (d || a).length, f = Array(e), g = 0; e > g; g++) {
- var h = d ? d[g] : g;
- f[g] = b(a[h], h, a)
- }
- return f
- }, s.reduce = s.foldl = s.inject = a(1), s.reduceRight = s.foldr = a(-1), s.find = s.detect = function(a, b, c) {
- var d;
- return d = A(a) ? s.findIndex(a, b, c) : s.findKey(a, b, c), void 0 !== d && d !== -1 ? a[d] : void 0
- }, s.filter = s.select = function(a, b, c) {
- var d = [];
- return b = u(b, c), s.each(a, function(a, c, e) {
- b(a, c, e) && d.push(a)
- }), d
- }, s.reject = function(a, b, c) {
- return s.filter(a, s.negate(u(b)), c)
- }, s.every = s.all = function(a, b, c) {
- b = u(b, c);
- for (var d = !A(a) && s.keys(a), e = (d || a).length, f = 0; e > f; f++) {
- var g = d ? d[f] : f;
- if (!b(a[g], g, a)) return !1
- }
- return !0
- }, s.some = s.any = function(a, b, c) {
- b = u(b, c);
- for (var d = !A(a) && s.keys(a), e = (d || a).length, f = 0; e > f; f++) {
- var g = d ? d[f] : f;
- if (b(a[g], g, a)) return !0
- }
- return !1
- }, s.contains = s.includes = s.include = function(a, b, c, d) {
- return A(a) || (a = s.values(a)), ("number" != typeof c || d) && (c = 0), s.indexOf(a, b, c) >= 0
- }, s.invoke = function(a, b) {
- var c = k.call(arguments, 2),
- d = s.isFunction(b);
- return s.map(a, function(a) {
- var e = d ? b : a[b];
- return null == e ? e : e.apply(a, c)
- })
- }, s.pluck = function(a, b) {
- return s.map(a, s.property(b))
- }, s.where = function(a, b) {
- return s.filter(a, s.matcher(b))
- }, s.findWhere = function(a, b) {
- return s.find(a, s.matcher(b))
- }, s.max = function(a, b, c) {
- var d, e, f = -1 / 0,
- g = -1 / 0;
- if (null == b && null != a) {
- a = A(a) ? a : s.values(a);
- for (var h = 0, i = a.length; i > h; h++) d = a[h], d > f && (f = d)
- } else b = u(b, c), s.each(a, function(a, c, d) {
- e = b(a, c, d), (e > g || e === -1 / 0 && f === -1 / 0) && (f = a, g = e)
- });
- return f
- }, s.min = function(a, b, c) {
- var d, e, f = 1 / 0,
- g = 1 / 0;
- if (null == b && null != a) {
- a = A(a) ? a : s.values(a);
- for (var h = 0, i = a.length; i > h; h++) d = a[h], f > d && (f = d)
- } else b = u(b, c), s.each(a, function(a, c, d) {
- e = b(a, c, d), (g > e || 1 / 0 === e && 1 / 0 === f) && (f = a, g = e)
- });
- return f
- }, s.shuffle = function(a) {
- for (var b, c = A(a) ? a : s.values(a), d = c.length, e = Array(d), f = 0; d > f; f++) b = s.random(0, f), b !== f && (e[f] = e[b]), e[b] = c[f];
- return e
- }, s.sample = function(a, b, c) {
- return null == b || c ? (A(a) || (a = s.values(a)), a[s.random(a.length - 1)]) : s.shuffle(a).slice(0, Math.max(0, b))
- },
- s.sortBy = function(a, b, c) {
- return b = u(b, c), s.pluck(s.map(a, function(a, c, d) {
- return {
- value: a,
- index: c,
- criteria: b(a, c, d)
- }
- }).sort(function(a, b) {
- var c = a.criteria,
- d = b.criteria;
- if (c !== d) {
- if (c > d || void 0 === c) return 1;
- if (d > c || void 0 === d) return -1
- }
- return a.index - b.index
- }), "value")
- };
- var B = function(a) {
- return function(b, c, d) {
- var e = {};
- return c = u(c, d), s.each(b, function(d, f) {
- var g = c(d, f, b);
- a(e, d, g)
- }), e
- }
- };
- s.groupBy = B(function(a, b, c) {
- s.has(a, c) ? a[c].push(b) : a[c] = [b]
- }), s.indexBy = B(function(a, b, c) {
- a[c] = b
- }), s.countBy = B(function(a, b, c) {
- s.has(a, c) ? a[c]++ : a[c] = 1
- }), s.toArray = function(a) {
- return a ? s.isArray(a) ? k.call(a) : A(a) ? s.map(a, s.identity) : s.values(a) : []
- }, s.size = function(a) {
- return null == a ? 0 : A(a) ? a.length : s.keys(a).length
- }, s.partition = function(a, b, c) {
- b = u(b, c);
- var d = [],
- e = [];
- return s.each(a, function(a, c, f) {
- (b(a, c, f) ? d : e).push(a)
- }), [d, e]
- }, s.first = s.head = s.take = function(a, b, c) {
- return null == a ? void 0 : null == b || c ? a[0] : s.initial(a, a.length - b)
- }, s.initial = function(a, b, c) {
- return k.call(a, 0, Math.max(0, a.length - (null == b || c ? 1 : b)))
- }, s.last = function(a, b, c) {
- return null == a ? void 0 : null == b || c ? a[a.length - 1] : s.rest(a, Math.max(0, a.length - b))
- }, s.rest = s.tail = s.drop = function(a, b, c) {
- return k.call(a, null == b || c ? 1 : b)
- }, s.compact = function(a) {
- return s.filter(a, s.identity)
- };
- var C = function(a, b, c, d) {
- for (var e = [], f = 0, g = d || 0, h = z(a); h > g; g++) {
- var i = a[g];
- if (A(i) && (s.isArray(i) || s.isArguments(i))) {
- b || (i = C(i, b, c));
- var j = 0,
- k = i.length;
- for (e.length += k; k > j;) e[f++] = i[j++]
- } else c || (e[f++] = i)
- }
- return e
- };
- s.flatten = function(a, b) {
- return C(a, b, !1)
- }, s.without = function(a) {
- return s.difference(a, k.call(arguments, 1))
- }, s.uniq = s.unique = function(a, b, c, d) {
- s.isBoolean(b) || (d = c, c = b, b = !1), null != c && (c = u(c, d));
- for (var e = [], f = [], g = 0, h = z(a); h > g; g++) {
- var i = a[g],
- j = c ? c(i, g, a) : i;
- b ? (g && f === j || e.push(i), f = j) : c ? s.contains(f, j) || (f.push(j), e.push(i)) : s.contains(e, i) || e.push(i)
- }
- return e
- }, s.union = function() {
- return s.uniq(C(arguments, !0, !0))
- }, s.intersection = function(a) {
- for (var b = [], c = arguments.length, d = 0, e = z(a); e > d; d++) {
- var f = a[d];
- if (!s.contains(b, f)) {
- for (var g = 1; c > g && s.contains(arguments[g], f); g++);
- g === c && b.push(f)
- }
- }
- return b
- }, s.difference = function(a) {
- var b = C(arguments, !0, !0, 1);
- return s.filter(a, function(a) {
- return !s.contains(b, a)
- })
- }, s.zip = function() {
- return s.unzip(arguments)
- }, s.unzip = function(a) {
- for (var b = a && s.max(a, z).length || 0, c = Array(b), d = 0; b > d; d++) c[d] = s.pluck(a, d);
- return c
- }, s.object = function(a, b) {
- for (var c = {}, d = 0, e = z(a); e > d; d++) b ? c[a[d]] = b[d] : c[a[d][0]] = a[d][1];
- return c
- }, s.findIndex = b(1), s.findLastIndex = b(-1), s.sortedIndex = function(a, b, c, d) {
- c = u(c, d, 1);
- for (var e = c(b), f = 0, g = z(a); g > f;) {
- var h = Math.floor((f + g) / 2);
- c(a[h]) < e ? f = h + 1 : g = h
- }
- return f
- }, s.indexOf = c(1, s.findIndex, s.sortedIndex), s.lastIndexOf = c(-1, s.findLastIndex), s.range = function(a, b, c) {
- null == b && (b = a || 0, a = 0), c = c || 1;
- for (var d = Math.max(Math.ceil((b - a) / c), 0), e = Array(d), f = 0; d > f; f++, a += c) e[f] = a;
- return e
- };
- var D = function(a, b, c, d, e) {
- if (!(d instanceof b)) return a.apply(c, e);
- var f = w(a.prototype),
- g = a.apply(f, e);
- return s.isObject(g) ? g : f
- };
- s.bind = function(a, b) {
- if (p && a.bind === p) return p.apply(a, k.call(arguments, 1));
- if (!s.isFunction(a)) throw new TypeError("Bind must be called on a function");
- var c = k.call(arguments, 2),
- d = function() {
- return D(a, d, b, this, c.concat(k.call(arguments)))
- };
- return d
- }, s.partial = function(a) {
- var b = k.call(arguments, 1),
- c = function() {
- for (var d = 0, e = b.length, f = Array(e), g = 0; e > g; g++) f[g] = b[g] === s ? arguments[d++] : b[g];
- for (; d < arguments.length;) f.push(arguments[d++]);
- return D(a, c, this, this, f)
- };
- return c
- }, s.bindAll = function(a) {
- var b, c, d = arguments.length;
- if (1 >= d) throw new Error("bindAll must be passed function names");
- for (b = 1; d > b; b++) c = arguments[b], a[c] = s.bind(a[c], a);
- return a
- }, s.memoize = function(a, b) {
- var c = function(d) {
- var e = c.cache,
- f = "" + (b ? b.apply(this, arguments) : d);
- return s.has(e, f) || (e[f] = a.apply(this, arguments)), e[f]
- };
- return c.cache = {}, c
- }, s.delay = function(a, b) {
- var c = k.call(arguments, 2);
- return setTimeout(function() {
- return a.apply(null, c)
- }, b)
- }, s.defer = s.partial(s.delay, s, 1), s.throttle = function(a, b, c) {
- var d, e, f, g = null,
- h = 0;
- c || (c = {});
- var i = function() {
- h = c.leading === !1 ? 0 : s.now(), g = null, f = a.apply(d, e), g || (d = e = null)
- };
- return function() {
- var j = s.now();
- h || c.leading !== !1 || (h = j);
- var k = b - (j - h);
- return d = this, e = arguments, 0 >= k || k > b ? (g && (clearTimeout(g), g = null), h = j, f = a.apply(d, e), g || (d = e = null)) : g || c.trailing === !1 || (g = setTimeout(i, k)), f
- }
- }, s.debounce = function(a, b, c) {
- var d, e, f, g, h, i = function() {
- var j = s.now() - g;
- b > j && j >= 0 ? d = setTimeout(i, b - j) : (d = null, c || (h = a.apply(f, e), d || (f = e = null)))
- };
- return function() {
- f = this, e = arguments, g = s.now();
- var j = c && !d;
- return d || (d = setTimeout(i, b)), j && (h = a.apply(f, e), f = e = null), h
- }
- }, s.wrap = function(a, b) {
- return s.partial(b, a)
- }, s.negate = function(a) {
- return function() {
- return !a.apply(this, arguments)
- }
- }, s.compose = function() {
- var a = arguments,
- b = a.length - 1;
- return function() {
- for (var c = b, d = a[b].apply(this, arguments); c--;) d = a[c].call(this, d);
- return d
- }
- }, s.after = function(a, b) {
- return function() {
- return --a < 1 ? b.apply(this, arguments) : void 0
- }
- }, s.before = function(a, b) {
- var c;
- return function() {
- return --a > 0 && (c = b.apply(this, arguments)), 1 >= a && (b = null), c
- }
- }, s.once = s.partial(s.before, 2);
- var E = !{
- toString: null
- }.propertyIsEnumerable("toString"),
- F = ["valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"];
- s.keys = function(a) {
- if (!s.isObject(a)) return [];
- if (o) return o(a);
- var b = [];
- for (var c in a) s.has(a, c) && b.push(c);
- return E && d(a, b), b
- }, s.allKeys = function(a) {
- if (!s.isObject(a)) return [];
- var b = [];
- for (var c in a) b.push(c);
- return E && d(a, b), b
- }, s.values = function(a) {
- for (var b = s.keys(a), c = b.length, d = Array(c), e = 0; c > e; e++) d[e] = a[b[e]];
- return d
- }, s.mapObject = function(a, b, c) {
- b = u(b, c);
- for (var d, e = s.keys(a), f = e.length, g = {}, h = 0; f > h; h++) d = e[h], g[d] = b(a[d], d, a);
- return g
- }, s.pairs = function(a) {
- for (var b = s.keys(a), c = b.length, d = Array(c), e = 0; c > e; e++) d[e] = [b[e], a[b[e]]];
- return d
- }, s.invert = function(a) {
- for (var b = {}, c = s.keys(a), d = 0, e = c.length; e > d; d++) b[a[c[d]]] = c[d];
- return b
- }, s.functions = s.methods = function(a) {
- var b = [];
- for (var c in a) s.isFunction(a[c]) && b.push(c);
- return b.sort()
- }, s.extend = v(s.allKeys), s.extendOwn = s.assign = v(s.keys), s.findKey = function(a, b, c) {
- b = u(b, c);
- for (var d, e = s.keys(a), f = 0, g = e.length; g > f; f++)
- if (d = e[f], b(a[d], d, a)) return d
- }, s.pick = function(a, b, c) {
- var d, e, f = {},
- g = a;
- if (null == g) return f;
- s.isFunction(b) ? (e = s.allKeys(g), d = t(b, c)) : (e = C(arguments, !1, !1, 1), d = function(a, b, c) {
- return b in c
- }, g = Object(g));
- for (var h = 0, i = e.length; i > h; h++) {
- var j = e[h],
- k = g[j];
- d(k, j, g) && (f[j] = k)
- }
- return f
- }, s.omit = function(a, b, c) {
- if (s.isFunction(b)) b = s.negate(b);
- else {
- var d = s.map(C(arguments, !1, !1, 1), String);
- b = function(a, b) {
- return !s.contains(d, b)
- }
- }
- return s.pick(a, b, c)
- }, s.defaults = v(s.allKeys, !0), s.create = function(a, b) {
- var c = w(a);
- return b && s.extendOwn(c, b), c
- }, s.clone = function(a) {
- return s.isObject(a) ? s.isArray(a) ? a.slice() : s.extend({}, a) : a
- }, s.tap = function(a, b) {
- return b(a), a
- }, s.isMatch = function(a, b) {
- var c = s.keys(b),
- d = c.length;
- if (null == a) return !d;
- for (var e = Object(a), f = 0; d > f; f++) {
- var g = c[f];
- if (b[g] !== e[g] || !(g in e)) return !1
- }
- return !0
- };
- var G = function(a, b, c, d) {
- if (a === b) return 0 !== a || 1 / a === 1 / b;
- if (null == a || null == b) return a === b;
- a instanceof s && (a = a._wrapped), b instanceof s && (b = b._wrapped);
- var e = l.call(a);
- if (e !== l.call(b)) return !1;
- switch (e) {
- case "[object RegExp]":
- case "[object String]":
- return "" + a == "" + b;
- case "[object Number]":
- return +a !== +a ? +b !== +b : 0 === +a ? 1 / +a === 1 / b : +a === +b;
- case "[object Date]":
- case "[object Boolean]":
- return +a === +b
- }
- var f = "[object Array]" === e;
- if (!f) {
- if ("object" != typeof a || "object" != typeof b) return !1;
- var g = a.constructor,
- h = b.constructor;
- if (g !== h && !(s.isFunction(g) && g instanceof g && s.isFunction(h) && h instanceof h) && "constructor" in a && "constructor" in b) return !1
- }
- c = c || [], d = d || [];
- for (var i = c.length; i--;)
- if (c[i] === a) return d[i] === b;
- if (c.push(a), d.push(b), f) {
- if (i = a.length, i !== b.length) return !1;
- for (; i--;)
- if (!G(a[i], b[i], c, d)) return !1
- } else {
- var j, k = s.keys(a);
- if (i = k.length, s.keys(b).length !== i) return !1;
- for (; i--;)
- if (j = k[i], !s.has(b, j) || !G(a[j], b[j], c, d)) return !1
- }
- return c.pop(), d.pop(), !0
- };
- s.isEqual = function(a, b) {
- return G(a, b)
- }, s.isEmpty = function(a) {
- return null == a || (A(a) && (s.isArray(a) || s.isString(a) || s.isArguments(a)) ? 0 === a.length : 0 === s.keys(a).length)
- }, s.isElement = function(a) {
- return !(!a || 1 !== a.nodeType)
- }, s.isArray = n || function(a) {
- return "[object Array]" === l.call(a)
- }, s.isObject = function(a) {
- var b = typeof a;
- return "function" === b || "object" === b && !!a
- }, s.each(["Arguments", "Function", "String", "Number", "Date", "RegExp", "Error"], function(a) {
- s["is" + a] = function(b) {
- return l.call(b) === "[object " + a + "]"
- }
- }), s.isArguments(arguments) || (s.isArguments = function(a) {
- return s.has(a, "callee")
- }), "function" != typeof /./ && "object" != typeof Int8Array && (s.isFunction = function(a) {
- return "function" == typeof a || !1
- }), s.isFinite = function(a) {
- return isFinite(a) && !isNaN(parseFloat(a))
- }, s.isNaN = function(a) {
- return s.isNumber(a) && a !== +a
- }, s.isBoolean = function(a) {
- return a === !0 || a === !1 || "[object Boolean]" === l.call(a)
- }, s.isNull = function(a) {
- return null === a
- }, s.isUndefined = function(a) {
- return void 0 === a
- }, s.has = function(a, b) {
- return null != a && m.call(a, b)
- }, s.noConflict = function() {
- return e._ = f, this
- }, s.identity = function(a) {
- return a
- }, s.constant = function(a) {
- return function() {
- return a
- }
- }, s.noop = function() {}, s.property = x, s.propertyOf = function(a) {
- return null == a ? function() {} : function(b) {
- return a[b]
- }
- }, s.matcher = s.matches = function(a) {
- return a = s.extendOwn({}, a),
- function(b) {
- return s.isMatch(b, a)
- }
- }, s.times = function(a, b, c) {
- var d = Array(Math.max(0, a));
- b = t(b, c, 1);
- for (var e = 0; a > e; e++) d[e] = b(e);
- return d
- }, s.random = function(a, b) {
- return null == b && (b = a, a = 0), a + Math.floor(Math.random() * (b - a + 1))
- }, s.now = Date.now || function() {
- return (new Date).getTime()
- };
- var H = {
- "&": "&",
- "<": "<",
- ">": ">",
- '"': """,
- "'": "'",
- "`": "`"
- },
- I = s.invert(H),
- J = function(a) {
- var b = function(b) {
- return a[b]
- },
- c = "(?:" + s.keys(a).join("|") + ")",
- d = RegExp(c),
- e = RegExp(c, "g");
- return function(a) {
- return a = null == a ? "" : "" + a, d.test(a) ? a.replace(e, b) : a
- }
- };
- s.escape = J(H), s.unescape = J(I), s.result = function(a, b, c) {
- var d = null == a ? void 0 : a[b];
- return void 0 === d && (d = c), s.isFunction(d) ? d.call(a) : d
- };
- var K = 0;
- s.uniqueId = function(a) {
- var b = ++K + "";
- return a ? a + b : b
- }, s.templateSettings = {
- evaluate: /<%([\s\S]+?)%>/g,
- interpolate: /<%=([\s\S]+?)%>/g,
- escape: /<%-([\s\S]+?)%>/g
- };
- var L = /(.)^/,
- M = {
- "'": "'",
- "\\": "\\",
- "\r": "r",
- "\n": "n",
- "\u2028": "u2028",
- "\u2029": "u2029"
- },
- N = /\\|'|\r|\n|\u2028|\u2029/g,
- O = function(a) {
- return "\\" + M[a]
- };
- s.template = function(a, b, c) {
- !b && c && (b = c), b = s.defaults({}, b, s.templateSettings);
- var d = RegExp([(b.escape || L).source, (b.interpolate || L).source, (b.evaluate || L).source].join("|") + "|$", "g"),
- e = 0,
- f = "__p+='";
- a.replace(d, function(b, c, d, g, h) {
- return f += a.slice(e, h).replace(N, O), e = h + b.length, c ? f += "'+\n((__t=(" + c + "))==null?'':_.escape(__t))+\n'" : d ? f += "'+\n((__t=(" + d + "))==null?'':__t)+\n'" : g && (f += "';\n" + g + "\n__p+='"), b
- }), f += "';\n", b.variable || (f = "with(obj||{}){\n" + f + "}\n"), f = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + f + "return __p;\n";
- try {
- var g = new Function(b.variable || "obj", "_", f)
- } catch (a) {
- throw a.source = f, a
- }
- var h = function(a) {
- return g.call(this, a, s)
- },
- i = b.variable || "obj";
- return h.source = "function(" + i + "){\n" + f + "}", h
- }, s.chain = function(a) {
- var b = s(a);
- return b._chain = !0, b
- };
- var P = function(a, b) {
- return a._chain ? s(b).chain() : b
- };
- s.mixin = function(a) {
- s.each(s.functions(a), function(b) {
- var c = s[b] = a[b];
- s.prototype[b] = function() {
- var a = [this._wrapped];
- return j.apply(a, arguments), P(this, c.apply(s, a))
- }
- })
- }, s.mixin(s), s.each(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function(a) {
- var b = g[a];
- s.prototype[a] = function() {
- var c = this._wrapped;
- return b.apply(c, arguments), "shift" !== a && "splice" !== a || 0 !== c.length || delete c[0], P(this, c)
- }
- }), s.each(["concat", "join", "slice"], function(a) {
- var b = g[a];
- s.prototype[a] = function() {
- return P(this, b.apply(this._wrapped, arguments))
- }
- }), s.prototype.value = function() {
- return this._wrapped
- }, s.prototype.valueOf = s.prototype.toJSON = s.prototype.value, s.prototype.toString = function() {
- return "" + this._wrapped
- }, "function" == typeof define && define.amd && define("underscore", [], function() {
- return s
- })
- }.call(this),
- function(a, b) {
- function c(a) {
- var b = oa[a] = {};
- return $.each(a.split(ba), function(a, c) {
- b[c] = !0
- }), b
- }
- function d(a, c, d) {
- if (d === b && 1 === a.nodeType) {
- var e = "data-" + c.replace(qa, "-$1").toLowerCase();
- if (d = a.getAttribute(e), "string" == typeof d) {
- try {
- d = "true" === d || "false" !== d && ("null" === d ? null : +d + "" === d ? +d : pa.test(d) ? $.parseJSON(d) : d)
- } catch (a) {}
- $.data(a, c, d)
- } else d = b
- }
- return d
- }
- function e(a) {
- var b;
- for (b in a)
- if (("data" !== b || !$.isEmptyObject(a[b])) && "toJSON" !== b) return !1;
- return !0
- }
- function f() {
- return !1
- }
- function g() {
- return !0
- }
- function h(a) {
- return !a || !a.parentNode || 11 === a.parentNode.nodeType
- }
- function i(a, b) {
- do a = a[b]; while (a && 1 !== a.nodeType);
- return a
- }
- function j(a, b, c) {
- if (b = b || 0, $.isFunction(b)) return $.grep(a, function(a, d) {
- var e = !!b.call(a, d, a);
- return e === c
- });
- if (b.nodeType) return $.grep(a, function(a, d) {
- return a === b === c
- });
- if ("string" == typeof b) {
- var d = $.grep(a, function(a) {
- return 1 === a.nodeType
- });
- if (Ka.test(b)) return $.filter(b, d, !c);
- b = $.filter(b, d)
- }
- return $.grep(a, function(a, d) {
- return $.inArray(a, b) >= 0 === c
- })
- }
- function k(a) {
- var b = Na.split("|"),
- c = a.createDocumentFragment();
- if (c.createElement)
- for (; b.length;) c.createElement(b.pop());
- return c
- }
- function l(a, b) {
- return a.getElementsByTagName(b)[0] || a.appendChild(a.ownerDocument.createElement(b))
- }
- function m(a, b) {
- if (1 === b.nodeType && $.hasData(a)) {
- var c, d, e, f = $._data(a),
- g = $._data(b, f),
- h = f.events;
- if (h) {
- delete g.handle, g.events = {};
- for (c in h)
- for (d = 0, e = h[c].length; d < e; d++) $.event.add(b, c, h[c][d])
- }
- g.data && (g.data = $.extend({}, g.data))
- }
- }
- function n(a, b) {
- var c;
- 1 === b.nodeType && (b.clearAttributes && b.clearAttributes(), b.mergeAttributes && b.mergeAttributes(a), c = b.nodeName.toLowerCase(), "object" === c ? (b.parentNode && (b.outerHTML = a.outerHTML), $.support.html5Clone && a.innerHTML && !$.trim(b.innerHTML) && (b.innerHTML = a.innerHTML)) : "input" === c && Xa.test(a.type) ? (b.defaultChecked = b.checked = a.checked, b.value !== a.value && (b.value = a.value)) : "option" === c ? b.selected = a.defaultSelected : "input" === c || "textarea" === c ? b.defaultValue = a.defaultValue : "script" === c && b.text !== a.text && (b.text = a.text), b.removeAttribute($.expando))
- }
- function o(a) {
- return "undefined" != typeof a.getElementsByTagName ? a.getElementsByTagName("*") : "undefined" != typeof a.querySelectorAll ? a.querySelectorAll("*") : []
- }
- function p(a) {
- Xa.test(a.type) && (a.defaultChecked = a.checked)
- }
- function q(a, b) {
- if (b in a) return b;
- for (var c = b.charAt(0).toUpperCase() + b.slice(1), d = b, e = rb.length; e--;)
- if (b = rb[e] + c, b in a) return b;
- return d
- }
- function r(a, b) {
- return a = b || a, "none" === $.css(a, "display") || !$.contains(a.ownerDocument, a)
- }
- function s(a, b) {
- for (var c, d, e = [], f = 0, g = a.length; f < g; f++) c = a[f], c.style && (e[f] = $._data(c, "olddisplay"), b ? (!e[f] && "none" === c.style.display && (c.style.display = ""), "" === c.style.display && r(c) && (e[f] = $._data(c, "olddisplay", w(c.nodeName)))) : (d = cb(c, "display"), !e[f] && "none" !== d && $._data(c, "olddisplay", d)));
- for (f = 0; f < g; f++) c = a[f], c.style && (b && "none" !== c.style.display && "" !== c.style.display || (c.style.display = b ? e[f] || "" : "none"));
- return a
- }
- function t(a, b, c) {
- var d = kb.exec(b);
- return d ? Math.max(0, d[1] - (c || 0)) + (d[2] || "px") : b
- }
- function u(a, b, c, d) {
- for (var e = c === (d ? "border" : "content") ? 4 : "width" === b ? 1 : 0, f = 0; e < 4; e += 2) "margin" === c && (f += $.css(a, c + qb[e], !0)), d ? ("content" === c && (f -= parseFloat(cb(a, "padding" + qb[e])) || 0), "margin" !== c && (f -= parseFloat(cb(a, "border" + qb[e] + "Width")) || 0)) : (f += parseFloat(cb(a, "padding" + qb[e])) || 0, "padding" !== c && (f += parseFloat(cb(a, "border" + qb[e] + "Width")) || 0));
- return f
- }
- function v(a, b, c) {
- var d = "width" === b ? a.offsetWidth : a.offsetHeight,
- e = !0,
- f = $.support.boxSizing && "border-box" === $.css(a, "boxSizing");
- if (d <= 0 || null == d) {
- if (d = cb(a, b), (d < 0 || null == d) && (d = a.style[b]), lb.test(d)) return d;
- e = f && ($.support.boxSizingReliable || d === a.style[b]), d = parseFloat(d) || 0
- }
- return d + u(a, b, c || (f ? "border" : "content"), e) + "px"
- }
- function w(a) {
- if (nb[a]) return nb[a];
- var b = $("<" + a + ">").appendTo(P.body),
- c = b.css("display");
- return b.remove(), "none" !== c && "" !== c || (db = P.body.appendChild(db || $.extend(P.createElement("iframe"), {
- frameBorder: 0,
- width: 0,
- height: 0
- })), eb && db.createElement || (eb = (db.contentWindow || db.contentDocument).document, eb.write("<!doctype html><html><body>"), eb.close()), b = eb.body.appendChild(eb.createElement(a)), c = cb(b, "display"), P.body.removeChild(db)), nb[a] = c, c
- }
- function x(a, b, c, d) {
- var e;
- if ($.isArray(b)) $.each(b, function(b, e) {
- c || ub.test(a) ? d(a, e) : x(a + "[" + ("object" == typeof e ? b : "") + "]", e, c, d)
- });
- else if (c || "object" !== $.type(b)) d(a, b);
- else
- for (e in b) x(a + "[" + e + "]", b[e], c, d)
- }
- function y(a) {
- return function(b, c) {
- "string" != typeof b && (c = b, b = "*");
- var d, e, f, g = b.toLowerCase().split(ba),
- h = 0,
- i = g.length;
- if ($.isFunction(c))
- for (; h < i; h++) d = g[h], f = /^\+/.test(d), f && (d = d.substr(1) || "*"), e = a[d] = a[d] || [], e[f ? "unshift" : "push"](c)
- }
- }
- function z(a, c, d, e, f, g) {
- f = f || c.dataTypes[0], g = g || {}, g[f] = !0;
- for (var h, i = a[f], j = 0, k = i ? i.length : 0, l = a === Kb; j < k && (l || !h); j++) h = i[j](c, d, e), "string" == typeof h && (!l || g[h] ? h = b : (c.dataTypes.unshift(h), h = z(a, c, d, e, h, g)));
- return (l || !h) && !g["*"] && (h = z(a, c, d, e, "*", g)), h
- }
- function A(a, c) {
- var d, e, f = $.ajaxSettings.flatOptions || {};
- for (d in c) c[d] !== b && ((f[d] ? a : e || (e = {}))[d] = c[d]);
- e && $.extend(!0, a, e)
- }
- function B(a, c, d) {
- var e, f, g, h, i = a.contents,
- j = a.dataTypes,
- k = a.responseFields;
- for (f in k) f in d && (c[k[f]] = d[f]);
- for (;
- "*" === j[0];) j.shift(), e === b && (e = a.mimeType || c.getResponseHeader("content-type"));
- if (e)
- for (f in i)
- if (i[f] && i[f].test(e)) {
- j.unshift(f);
- break
- }
- if (j[0] in d) g = j[0];
- else {
- for (f in d) {
- if (!j[0] || a.converters[f + " " + j[0]]) {
- g = f;
- break
- }
- h || (h = f)
- }
- g = g || h
- }
- if (g) return g !== j[0] && j.unshift(g), d[g]
- }
- function C(a, b) {
- var c, d, e, f, g = a.dataTypes.slice(),
- h = g[0],
- i = {},
- j = 0;
- if (a.dataFilter && (b = a.dataFilter(b, a.dataType)), g[1])
- for (c in a.converters) i[c.toLowerCase()] = a.converters[c];
- for (; e = g[++j];)
- if ("*" !== e) {
- if ("*" !== h && h !== e) {
- if (c = i[h + " " + e] || i["* " + e], !c)
- for (d in i)
- if (f = d.split(" "), f[1] === e && (c = i[h + " " + f[0]] || i["* " + f[0]])) {
- c === !0 ? c = i[d] : i[d] !== !0 && (e = f[0], g.splice(j--, 0, e));
- break
- }
- if (c !== !0)
- if (c && a.throws) b = c(b);
- else try {
- b = c(b)
- } catch (a) {
- return {
- state: "parsererror",
- error: c ? a : "No conversion from " + h + " to " + e
- }
- }
- }
- h = e
- }
- return {
- state: "success",
- data: b
- }
- }
- function D() {
- try {
- return new a.XMLHttpRequest
- } catch (a) {}
- }
- function E() {
- try {
- return new a.ActiveXObject("Microsoft.XMLHTTP")
- } catch (a) {}
- }
- function F() {
- return setTimeout(function() {
- Ub = b
- }, 0), Ub = $.now()
- }
- function G(a, b) {
- $.each(b, function(b, c) {
- for (var d = ($b[b] || []).concat($b["*"]), e = 0, f = d.length; e < f; e++)
- if (d[e].call(a, b, c)) return
- })
- }
- function H(a, b, c) {
- var d, e = 0,
- f = Zb.length,
- g = $.Deferred().always(function() {
- delete h.elem
- }),
- h = function() {
- for (var b = Ub || F(), c = Math.max(0, i.startTime + i.duration - b), d = 1 - (c / i.duration || 0), e = 0, f = i.tweens.length; e < f; e++) i.tweens[e].run(d);
- return g.notifyWith(a, [i, d, c]), d < 1 && f ? c : (g.resolveWith(a, [i]), !1)
- },
- i = g.promise({
- elem: a,
- props: $.extend({}, b),
- opts: $.extend(!0, {
- specialEasing: {}
- }, c),
- originalProperties: b,
- originalOptions: c,
- startTime: Ub || F(),
- duration: c.duration,
- tweens: [],
- createTween: function(b, c, d) {
- var e = $.Tween(a, i.opts, b, c, i.opts.specialEasing[b] || i.opts.easing);
- return i.tweens.push(e), e
- },
- stop: function(b) {
- for (var c = 0, d = b ? i.tweens.length : 0; c < d; c++) i.tweens[c].run(1);
- return b ? g.resolveWith(a, [i, b]) : g.rejectWith(a, [i, b]), this
- }
- }),
- j = i.props;
- for (I(j, i.opts.specialEasing); e < f; e++)
- if (d = Zb[e].call(i, a, j, i.opts)) return d;
- return G(i, j), $.isFunction(i.opts.start) && i.opts.start.call(a, i), $.fx.timer($.extend(h, {
- anim: i,
- queue: i.opts.queue,
- elem: a
- })), i.progress(i.opts.progress).done(i.opts.done, i.opts.complete).fail(i.opts.fail).always(i.opts.always)
- }
- function I(a, b) {
- var c, d, e, f, g;
- for (c in a)
- if (d = $.camelCase(c), e = b[d], f = a[c], $.isArray(f) && (e = f[1], f = a[c] = f[0]), c !== d && (a[d] = f, delete a[c]), g = $.cssHooks[d], g && "expand" in g) {
- f = g.expand(f), delete a[d];
- for (c in f) c in a || (a[c] = f[c], b[c] = e)
- } else b[d] = e
- }
- function J(a, b, c) {
- var d, e, f, g, h, i, j, k, l = this,
- m = a.style,
- n = {},
- o = [],
- p = a.nodeType && r(a);
- c.queue || (j = $._queueHooks(a, "fx"), null == j.unqueued && (j.unqueued = 0, k = j.empty.fire, j.empty.fire = function() {
- j.unqueued || k()
- }), j.unqueued++, l.always(function() {
- l.always(function() {
- j.unqueued--, $.queue(a, "fx").length || j.empty.fire()
- })
- })), 1 === a.nodeType && ("height" in b || "width" in b) && (c.overflow = [m.overflow, m.overflowX, m.overflowY], "inline" === $.css(a, "display") && "none" === $.css(a, "float") && ($.support.inlineBlockNeedsLayout && "inline" !== w(a.nodeName) ? m.zoom = 1 : m.display = "inline-block")), c.overflow && (m.overflow = "hidden", $.support.shrinkWrapBlocks || l.done(function() {
- m.overflow = c.overflow[0], m.overflowX = c.overflow[1], m.overflowY = c.overflow[2]
- }));
- for (d in b)
- if (f = b[d], Wb.exec(f)) {
- if (delete b[d], f === (p ? "hide" : "show")) continue;
- o.push(d)
- }
- if (g = o.length)
- for (h = $._data(a, "fxshow") || $._data(a, "fxshow", {}), p ? $(a).show() : l.done(function() {
- $(a).hide()
- }), l.done(function() {
- var b;
- $.removeData(a, "fxshow", !0);
- for (b in n) $.style(a, b, n[b])
- }), d = 0; d < g; d++) e = o[d], i = l.createTween(e, p ? h[e] : 0), n[e] = h[e] || $.style(a, e), e in h || (h[e] = i.start, p && (i.end = i.start, i.start = "width" === e || "height" === e ? 1 : 0))
- }
- function K(a, b, c, d, e) {
- return new K.prototype.init(a, b, c, d, e)
- }
- function L(a, b) {
- var c, d = {
- height: a
- },
- e = 0;
- for (b = b ? 1 : 0; e < 4; e += 2 - b) c = qb[e], d["margin" + c] = d["padding" + c] = a;
- return b && (d.opacity = d.width = a), d
- }
- function M(a) {
- return $.isWindow(a) ? a : 9 === a.nodeType && (a.defaultView || a.parentWindow)
- }
- var N, O, P = a.document,
- Q = a.location,
- R = a.navigator,
- S = a.jQuery,
- T = a.$,
- U = Array.prototype.push,
- V = Array.prototype.slice,
- W = Array.prototype.indexOf,
- X = Object.prototype.toString,
- Y = Object.prototype.hasOwnProperty,
- Z = String.prototype.trim,
- $ = function(a, b) {
- return new $.fn.init(a, b, N)
- },
- _ = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,
- aa = /\S/,
- ba = /\s+/,
- ca = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
- da = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
- ea = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
- fa = /^[\],:{}\s]*$/,
- ga = /(?:^|:|,)(?:\s*\[)+/g,
- ha = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
- ia = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,
- ja = /^-ms-/,
- ka = /-([\da-z])/gi,
- la = function(a, b) {
- return (b + "").toUpperCase()
- },
- ma = function() {
- P.addEventListener ? (P.removeEventListener("DOMContentLoaded", ma, !1), $.ready()) : "complete" === P.readyState && (P.detachEvent("onreadystatechange", ma), $.ready())
- },
- na = {};
- $.fn = $.prototype = {
- constructor: $,
- init: function(a, c, d) {
- var e, f, g;
- if (!a) return this;
- if (a.nodeType) return this.context = this[0] = a, this.length = 1, this;
- if ("string" == typeof a) {
- if (e = "<" === a.charAt(0) && ">" === a.charAt(a.length - 1) && a.length >= 3 ? [null, a, null] : da.exec(a), e && (e[1] || !c)) {
- if (e[1]) return c = c instanceof $ ? c[0] : c, g = c && c.nodeType ? c.ownerDocument || c : P, a = $.parseHTML(e[1], g, !0), ea.test(e[1]) && $.isPlainObject(c) && this.attr.call(a, c, !0), $.merge(this, a);
- if (f = P.getElementById(e[2]), f && f.parentNode) {
- if (f.id !== e[2]) return d.find(a);
- this.length = 1, this[0] = f
- }
- return this.context = P, this.selector = a, this
- }
- return !c || c.jquery ? (c || d).find(a) : this.constructor(c).find(a)
- }
- return $.isFunction(a) ? d.ready(a) : (a.selector !== b && (this.selector = a.selector, this.context = a.context), $.makeArray(a, this))
- },
- selector: "",
- jquery: "1.8.1",
- length: 0,
- size: function() {
- return this.length
- },
- toArray: function() {
- return V.call(this)
- },
- get: function(a) {
- return null == a ? this.toArray() : a < 0 ? this[this.length + a] : this[a]
- },
- pushStack: function(a, b, c) {
- var d = $.merge(this.constructor(), a);
- return d.prevObject = this, d.context = this.context, "find" === b ? d.selector = this.selector + (this.selector ? " " : "") + c : b && (d.selector = this.selector + "." + b + "(" + c + ")"), d
- },
- each: function(a, b) {
- return $.each(this, a, b)
- },
- ready: function(a) {
- return $.ready.promise().done(a), this
- },
- eq: function(a) {
- return a = +a, a === -1 ? this.slice(a) : this.slice(a, a + 1)
- },
- first: function() {
- return this.eq(0)
- },
- last: function() {
- return this.eq(-1)
- },
- slice: function() {
- return this.pushStack(V.apply(this, arguments), "slice", V.call(arguments).join(","))
- },
- map: function(a) {
- return this.pushStack($.map(this, function(b, c) {
- return a.call(b, c, b)
- }))
- },
- end: function() {
- return this.prevObject || this.constructor(null)
- },
- push: U,
- sort: [].sort,
- splice: [].splice
- }, $.fn.init.prototype = $.fn, $.extend = $.fn.extend = function() {
- var a, c, d, e, f, g, h = arguments[0] || {},
- i = 1,
- j = arguments.length,
- k = !1;
- for ("boolean" == typeof h && (k = h, h = arguments[1] || {}, i = 2), "object" != typeof h && !$.isFunction(h) && (h = {}), j === i && (h = this, --i); i < j; i++)
- if (null != (a = arguments[i]))
- for (c in a) d = h[c], e = a[c], h !== e && (k && e && ($.isPlainObject(e) || (f = $.isArray(e))) ? (f ? (f = !1, g = d && $.isArray(d) ? d : []) : g = d && $.isPlainObject(d) ? d : {}, h[c] = $.extend(k, g, e)) : e !== b && (h[c] = e));
- return h
- }, $.extend({
- noConflict: function(b) {
- return a.$ === $ && (a.$ = T), b && a.jQuery === $ && (a.jQuery = S), $
- },
- isReady: !1,
- readyWait: 1,
- holdReady: function(a) {
- a ? $.readyWait++ : $.ready(!0)
- },
- ready: function(a) {
- if (a === !0 ? !--$.readyWait : !$.isReady) {
- if (!P.body) return setTimeout($.ready, 1);
- $.isReady = !0, a !== !0 && --$.readyWait > 0 || (O.resolveWith(P, [$]), $.fn.trigger && $(P).trigger("ready").off("ready"))
- }
- },
- isFunction: function(a) {
- return "function" === $.type(a)
- },
- isArray: Array.isArray || function(a) {
- return "array" === $.type(a)
- },
- isWindow: function(a) {
- return null != a && a == a.window
- },
- isNumeric: function(a) {
- return !isNaN(parseFloat(a)) && isFinite(a)
- },
- type: function(a) {
- return null == a ? String(a) : na[X.call(a)] || "object"
- },
- isPlainObject: function(a) {
- if (!a || "object" !== $.type(a) || a.nodeType || $.isWindow(a)) return !1;
- try {
- if (a.constructor && !Y.call(a, "constructor") && !Y.call(a.constructor.prototype, "isPrototypeOf")) return !1
- } catch (a) {
- return !1
- }
- var c;
- for (c in a);
- return c === b || Y.call(a, c)
- },
- isEmptyObject: function(a) {
- var b;
- for (b in a) return !1;
- return !0
- },
- error: function(a) {
- throw new Error(a)
- },
- parseHTML: function(a, b, c) {
- var d;
- return a && "string" == typeof a ? ("boolean" == typeof b && (c = b, b = 0), b = b || P, (d = ea.exec(a)) ? [b.createElement(d[1])] : (d = $.buildFragment([a], b, c ? null : []), $.merge([], (d.cacheable ? $.clone(d.fragment) : d.fragment).childNodes))) : null
- },
- parseJSON: function(b) {
- return b && "string" == typeof b ? (b = $.trim(b), a.JSON && a.JSON.parse ? a.JSON.parse(b) : fa.test(b.replace(ha, "@").replace(ia, "]").replace(ga, "")) ? new Function("return " + b)() : void $.error("Invalid JSON: " + b)) : null
- },
- parseXML: function(c) {
- var d, e;
- if (!c || "string" != typeof c) return null;
- try {
- a.DOMParser ? (e = new DOMParser, d = e.parseFromString(c, "text/xml")) : (d = new ActiveXObject("Microsoft.XMLDOM"), d.async = "false", d.loadXML(c))
- } catch (a) {
- d = b
- }
- return (!d || !d.documentElement || d.getElementsByTagName("parsererror").length) && $.error("Invalid XML: " + c), d
- },
- noop: function() {},
- globalEval: function(b) {
- b && aa.test(b) && (a.execScript || function(b) {
- a.eval.call(a, b)
- })(b)
- },
- camelCase: function(a) {
- return a.replace(ja, "ms-").replace(ka, la)
- },
- nodeName: function(a, b) {
- return a.nodeName && a.nodeName.toUpperCase() === b.toUpperCase()
- },
- each: function(a, c, d) {
- var e, f = 0,
- g = a.length,
- h = g === b || $.isFunction(a);
- if (d)
- if (h) {
- for (e in a)
- if (c.apply(a[e], d) === !1) break
- } else
- for (; f < g && c.apply(a[f++], d) !== !1;);
- else if (h) {
- for (e in a)
- if (c.call(a[e], e, a[e]) === !1) break
- } else
- for (; f < g && c.call(a[f], f, a[f++]) !== !1;);
- return a
- },
- trim: Z && !Z.call("\ufeff ") ? function(a) {
- return null == a ? "" : Z.call(a)
- } : function(a) {
- return null == a ? "" : a.toString().replace(ca, "")
- },
- makeArray: function(a, b) {
- var c, d = b || [];
- return null != a && (c = $.type(a), null == a.length || "string" === c || "function" === c || "regexp" === c || $.isWindow(a) ? U.call(d, a) : $.merge(d, a)), d
- },
- inArray: function(a, b, c) {
- var d;
- if (b) {
- if (W) return W.call(b, a, c);
- for (d = b.length, c = c ? c < 0 ? Math.max(0, d + c) : c : 0; c < d; c++)
- if (c in b && b[c] === a) return c
- }
- return -1
- },
- merge: function(a, c) {
- var d = c.length,
- e = a.length,
- f = 0;
- if ("number" == typeof d)
- for (; f < d; f++) a[e++] = c[f];
- else
- for (; c[f] !== b;) a[e++] = c[f++];
- return a.length = e, a
- },
- grep: function(a, b, c) {
- var d, e = [],
- f = 0,
- g = a.length;
- for (c = !!c; f < g; f++) d = !!b(a[f], f), c !== d && e.push(a[f]);
- return e
- },
- map: function(a, c, d) {
- var e, f, g = [],
- h = 0,
- i = a.length,
- j = a instanceof $ || i !== b && "number" == typeof i && (i > 0 && a[0] && a[i - 1] || 0 === i || $.isArray(a));
- if (j)
- for (; h < i; h++) e = c(a[h], h, d), null != e && (g[g.length] = e);
- else
- for (f in a) e = c(a[f], f, d), null != e && (g[g.length] = e);
- return g.concat.apply([], g)
- },
- guid: 1,
- proxy: function(a, c) {
- var d, e, f;
- return "string" == typeof c && (d = a[c], c = a, a = d), $.isFunction(a) ? (e = V.call(arguments, 2), f = function() {
- return a.apply(c, e.concat(V.call(arguments)))
- }, f.guid = a.guid = a.guid || f.guid || $.guid++, f) : b
- },
- access: function(a, c, d, e, f, g, h) {
- var i, j = null == d,
- k = 0,
- l = a.length;
- if (d && "object" == typeof d) {
- for (k in d) $.access(a, c, k, d[k], 1, g, e);
- f = 1
- } else if (e !== b) {
- if (i = h === b && $.isFunction(e), j && (i ? (i = c, c = function(a, b, c) {
- return i.call($(a), c)
- }) : (c.call(a, e), c = null)), c)
- for (; k < l; k++) c(a[k], d, i ? e.call(a[k], k, c(a[k], d)) : e, h);
- f = 1
- }
- return f ? a : j ? c.call(a) : l ? c(a[0], d) : g
- },
- now: function() {
- return (new Date).getTime()
- }
- }), $.ready.promise = function(b) {
- if (!O)
- if (O = $.Deferred(), "complete" === P.readyState) setTimeout($.ready, 1);
- else if (P.addEventListener) P.addEventListener("DOMContentLoaded", ma, !1), a.addEventListener("load", $.ready, !1);
- else {
- P.attachEvent("onreadystatechange", ma), a.attachEvent("onload", $.ready);
- var c = !1;
- try {
- c = null == a.frameElement && P.documentElement
- } catch (a) {}
- c && c.doScroll && function a() {
- if (!$.isReady) {
- try {
- c.doScroll("left")
- } catch (b) {
- return setTimeout(a, 50)
- }
- $.ready()
- }
- }()
- }
- return O.promise(b)
- }, $.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(a, b) {
- na["[object " + b + "]"] = b.toLowerCase()
- }), N = $(P);
- var oa = {};
- $.Callbacks = function(a) {
- a = "string" == typeof a ? oa[a] || c(a) : $.extend({}, a);
- var d, e, f, g, h, i, j = [],
- k = !a.once && [],
- l = function(b) {
- for (d = a.memory && b, e = !0, i = g || 0, g = 0, h = j.length, f = !0; j && i < h; i++)
- if (j[i].apply(b[0], b[1]) === !1 && a.stopOnFalse) {
- d = !1;
- break
- }
- f = !1, j && (k ? k.length && l(k.shift()) : d ? j = [] : m.disable())
- },
- m = {
- add: function() {
- if (j) {
- var b = j.length;
- ! function b(c) {
- $.each(c, function(c, d) {
- var e = $.type(d);
- "function" !== e || a.unique && m.has(d) ? d && d.length && "string" !== e && b(d) : j.push(d)
- })
- }(arguments), f ? h = j.length : d && (g = b, l(d))
- }
- return this
- },
- remove: function() {
- return j && $.each(arguments, function(a, b) {
- for (var c;
- (c = $.inArray(b, j, c)) > -1;) j.splice(c, 1), f && (c <= h && h--, c <= i && i--)
- }), this
- },
- has: function(a) {
- return $.inArray(a, j) > -1
- },
- empty: function() {
- return j = [], this
- },
- disable: function() {
- return j = k = d = b, this
- },
- disabled: function() {
- return !j
- },
- lock: function() {
- return k = b, d || m.disable(), this
- },
- locked: function() {
- return !k
- },
- fireWith: function(a, b) {
- return b = b || [], b = [a, b.slice ? b.slice() : b], j && (!e || k) && (f ? k.push(b) : l(b)), this
- },
- fire: function() {
- return m.fireWith(this, arguments), this
- },
- fired: function() {
- return !!e
- }
- };
- return m
- }, $.extend({
- Deferred: function(a) {
- var b = [
- ["resolve", "done", $.Callbacks("once memory"), "resolved"],
- ["reject", "fail", $.Callbacks("once memory"), "rejected"],
- ["notify", "progress", $.Callbacks("memory")]
- ],
- c = "pending",
- d = {
- state: function() {
- return c
- },
- always: function() {
- return e.done(arguments).fail(arguments), this
- },
- then: function() {
- var a = arguments;
- return $.Deferred(function(c) {
- $.each(b, function(b, d) {
- var f = d[0],
- g = a[b];
- e[d[1]]($.isFunction(g) ? function() {
- var a = g.apply(this, arguments);
- a && $.isFunction(a.promise) ? a.promise().done(c.resolve).fail(c.reject).progress(c.notify) : c[f + "With"](this === e ? c : this, [a])
- } : c[f])
- }), a = null
- }).promise()
- },
- promise: function(a) {
- return "object" == typeof a ? $.extend(a, d) : d
- }
- },
- e = {};
- return d.pipe = d.then, $.each(b, function(a, f) {
- var g = f[2],
- h = f[3];
- d[f[1]] = g.add, h && g.add(function() {
- c = h
- }, b[1 ^ a][2].disable, b[2][2].lock), e[f[0]] = g.fire, e[f[0] + "With"] = g.fireWith
- }), d.promise(e), a && a.call(e, e), e
- },
- when: function(a) {
- var b, c, d, e = 0,
- f = V.call(arguments),
- g = f.length,
- h = 1 !== g || a && $.isFunction(a.promise) ? g : 0,
- i = 1 === h ? a : $.Deferred(),
- j = function(a, c, d) {
- return function(e) {
- c[a] = this, d[a] = arguments.length > 1 ? V.call(arguments) : e, d === b ? i.notifyWith(c, d) : --h || i.resolveWith(c, d)
- }
- };
- if (g > 1)
- for (b = new Array(g), c = new Array(g), d = new Array(g); e < g; e++) f[e] && $.isFunction(f[e].promise) ? f[e].promise().done(j(e, d, f)).fail(i.reject).progress(j(e, c, b)) : --h;
- return h || i.resolveWith(d, f), i.promise()
- }
- }), $.support = function() {
- var b, c, d, e, f, g, h, i, j, k, l, m = P.createElement("div");
- if (m.setAttribute("className", "t"), m.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", c = m.getElementsByTagName("*"), d = m.getElementsByTagName("a")[0], d.style.cssText = "top:1px;float:left;opacity:.5", !c || !c.length || !d) return {};
- e = P.createElement("select"), f = e.appendChild(P.createElement("option")), g = m.getElementsByTagName("input")[0], b = {
- leadingWhitespace: 3 === m.firstChild.nodeType,
- tbody: !m.getElementsByTagName("tbody").length,
- htmlSerialize: !!m.getElementsByTagName("link").length,
- style: /top/.test(d.getAttribute("style")),
- hrefNormalized: "/a" === d.getAttribute("href"),
- opacity: /^0.5/.test(d.style.opacity),
- cssFloat: !!d.style.cssFloat,
- checkOn: "on" === g.value,
- optSelected: f.selected,
- getSetAttribute: "t" !== m.className,
- enctype: !!P.createElement("form").enctype,
- html5Clone: "<:nav></:nav>" !== P.createElement("nav").cloneNode(!0).outerHTML,
- boxModel: "CSS1Compat" === P.compatMode,
- submitBubbles: !0,
- changeBubbles: !0,
- focusinBubbles: !1,
- deleteExpando: !0,
- noCloneEvent: !0,
- inlineBlockNeedsLayout: !1,
- shrinkWrapBlocks: !1,
- reliableMarginRight: !0,
- boxSizingReliable: !0,
- pixelPosition: !1
- }, g.checked = !0,
- b.noCloneChecked = g.cloneNode(!0).checked, e.disabled = !0, b.optDisabled = !f.disabled;
- try {
- delete m.test
- } catch (a) {
- b.deleteExpando = !1
- }
- if (!m.addEventListener && m.attachEvent && m.fireEvent && (m.attachEvent("onclick", l = function() {
- b.noCloneEvent = !1
- }), m.cloneNode(!0).fireEvent("onclick"), m.detachEvent("onclick", l)), g = P.createElement("input"), g.value = "t", g.setAttribute("type", "radio"), b.radioValue = "t" === g.value, g.setAttribute("checked", "checked"), g.setAttribute("name", "t"), m.appendChild(g), h = P.createDocumentFragment(), h.appendChild(m.lastChild), b.checkClone = h.cloneNode(!0).cloneNode(!0).lastChild.checked, b.appendChecked = g.checked, h.removeChild(g), h.appendChild(m), m.attachEvent)
- for (j in {
- submit: !0,
- change: !0,
- focusin: !0
- }) i = "on" + j, k = i in m, k || (m.setAttribute(i, "return;"), k = "function" == typeof m[i]), b[j + "Bubbles"] = k;
- return $(function() {
- var c, d, e, f, g = "padding:0;margin:0;border:0;display:block;overflow:hidden;",
- h = P.getElementsByTagName("body")[0];
- h && (c = P.createElement("div"), c.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px", h.insertBefore(c, h.firstChild), d = P.createElement("div"), c.appendChild(d), d.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", e = d.getElementsByTagName("td"), e[0].style.cssText = "padding:0;margin:0;border:0;display:none", k = 0 === e[0].offsetHeight, e[0].style.display = "", e[1].style.display = "none", b.reliableHiddenOffsets = k && 0 === e[0].offsetHeight, d.innerHTML = "", d.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", b.boxSizing = 4 === d.offsetWidth, b.doesNotIncludeMarginInBodyOffset = 1 !== h.offsetTop, a.getComputedStyle && (b.pixelPosition = "1%" !== (a.getComputedStyle(d, null) || {}).top, b.boxSizingReliable = "4px" === (a.getComputedStyle(d, null) || {
- width: "4px"
- }).width, f = P.createElement("div"), f.style.cssText = d.style.cssText = g, f.style.marginRight = f.style.width = "0", d.style.width = "1px", d.appendChild(f), b.reliableMarginRight = !parseFloat((a.getComputedStyle(f, null) || {}).marginRight)), "undefined" != typeof d.style.zoom && (d.innerHTML = "", d.style.cssText = g + "width:1px;padding:1px;display:inline;zoom:1", b.inlineBlockNeedsLayout = 3 === d.offsetWidth, d.style.display = "block", d.style.overflow = "visible", d.innerHTML = "<div></div>", d.firstChild.style.width = "5px", b.shrinkWrapBlocks = 3 !== d.offsetWidth, c.style.zoom = 1), h.removeChild(c), c = d = e = f = null)
- }), h.removeChild(m), c = d = e = f = g = h = m = null, b
- }();
- var pa = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
- qa = /([A-Z])/g;
- $.extend({
- cache: {},
- deletedIds: [],
- uuid: 0,
- expando: "jQuery" + ($.fn.jquery + Math.random()).replace(/\D/g, ""),
- noData: {
- embed: !0,
- object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
- applet: !0
- },
- hasData: function(a) {
- return a = a.nodeType ? $.cache[a[$.expando]] : a[$.expando], !!a && !e(a)
- },
- data: function(a, c, d, e) {
- if ($.acceptData(a)) {
- var f, g, h = $.expando,
- i = "string" == typeof c,
- j = a.nodeType,
- k = j ? $.cache : a,
- l = j ? a[h] : a[h] && h;
- if (l && k[l] && (e || k[l].data) || !i || d !== b) return l || (j ? a[h] = l = $.deletedIds.pop() || ++$.uuid : l = h), k[l] || (k[l] = {}, j || (k[l].toJSON = $.noop)), "object" != typeof c && "function" != typeof c || (e ? k[l] = $.extend(k[l], c) : k[l].data = $.extend(k[l].data, c)), f = k[l], e || (f.data || (f.data = {}), f = f.data), d !== b && (f[$.camelCase(c)] = d), i ? (g = f[c], null == g && (g = f[$.camelCase(c)])) : g = f, g
- }
- },
- removeData: function(a, b, c) {
- if ($.acceptData(a)) {
- var d, f, g, h = a.nodeType,
- i = h ? $.cache : a,
- j = h ? a[$.expando] : $.expando;
- if (i[j]) {
- if (b && (d = c ? i[j] : i[j].data)) {
- $.isArray(b) || (b in d ? b = [b] : (b = $.camelCase(b), b = b in d ? [b] : b.split(" ")));
- for (f = 0, g = b.length; f < g; f++) delete d[b[f]];
- if (!(c ? e : $.isEmptyObject)(d)) return
- }(c || (delete i[j].data, e(i[j]))) && (h ? $.cleanData([a], !0) : $.support.deleteExpando || i != i.window ? delete i[j] : i[j] = null)
- }
- }
- },
- _data: function(a, b, c) {
- return $.data(a, b, c, !0)
- },
- acceptData: function(a) {
- var b = a.nodeName && $.noData[a.nodeName.toLowerCase()];
- return !b || b !== !0 && a.getAttribute("classid") === b
- }
- }), $.fn.extend({
- data: function(a, c) {
- var e, f, g, h, i, j = this[0],
- k = 0,
- l = null;
- if (a === b) {
- if (this.length && (l = $.data(j), 1 === j.nodeType && !$._data(j, "parsedAttrs"))) {
- for (g = j.attributes, i = g.length; k < i; k++) h = g[k].name, 0 === h.indexOf("data-") && (h = $.camelCase(h.substring(5)), d(j, h, l[h]));
- $._data(j, "parsedAttrs", !0)
- }
- return l
- }
- return "object" == typeof a ? this.each(function() {
- $.data(this, a)
- }) : (e = a.split(".", 2), e[1] = e[1] ? "." + e[1] : "", f = e[1] + "!", $.access(this, function(c) {
- return c === b ? (l = this.triggerHandler("getData" + f, [e[0]]), l === b && j && (l = $.data(j, a), l = d(j, a, l)), l === b && e[1] ? this.data(e[0]) : l) : (e[1] = c, void this.each(function() {
- var b = $(this);
- b.triggerHandler("setData" + f, e), $.data(this, a, c), b.triggerHandler("changeData" + f, e)
- }))
- }, null, c, arguments.length > 1, null, !1))
- },
- removeData: function(a) {
- return this.each(function() {
- $.removeData(this, a)
- })
- }
- }), $.extend({
- queue: function(a, b, c) {
- var d;
- if (a) return b = (b || "fx") + "queue", d = $._data(a, b), c && (!d || $.isArray(c) ? d = $._data(a, b, $.makeArray(c)) : d.push(c)), d || []
- },
- dequeue: function(a, b) {
- b = b || "fx";
- var c = $.queue(a, b),
- d = c.length,
- e = c.shift(),
- f = $._queueHooks(a, b),
- g = function() {
- $.dequeue(a, b)
- };
- "inprogress" === e && (e = c.shift(), d--), e && ("fx" === b && c.unshift("inprogress"), delete f.stop, e.call(a, g, f)), !d && f && f.empty.fire()
- },
- _queueHooks: function(a, b) {
- var c = b + "queueHooks";
- return $._data(a, c) || $._data(a, c, {
- empty: $.Callbacks("once memory").add(function() {
- $.removeData(a, b + "queue", !0), $.removeData(a, c, !0)
- })
- })
- }
- }), $.fn.extend({
- queue: function(a, c) {
- var d = 2;
- return "string" != typeof a && (c = a, a = "fx", d--), arguments.length < d ? $.queue(this[0], a) : c === b ? this : this.each(function() {
- var b = $.queue(this, a, c);
- $._queueHooks(this, a), "fx" === a && "inprogress" !== b[0] && $.dequeue(this, a)
- })
- },
- dequeue: function(a) {
- return this.each(function() {
- $.dequeue(this, a)
- })
- },
- delay: function(a, b) {
- return a = $.fx ? $.fx.speeds[a] || a : a, b = b || "fx", this.queue(b, function(b, c) {
- var d = setTimeout(b, a);
- c.stop = function() {
- clearTimeout(d)
- }
- })
- },
- clearQueue: function(a) {
- return this.queue(a || "fx", [])
- },
- promise: function(a, c) {
- var d, e = 1,
- f = $.Deferred(),
- g = this,
- h = this.length,
- i = function() {
- --e || f.resolveWith(g, [g])
- };
- for ("string" != typeof a && (c = a, a = b), a = a || "fx"; h--;) d = $._data(g[h], a + "queueHooks"), d && d.empty && (e++, d.empty.add(i));
- return i(), f.promise(c)
- }
- });
- var ra, sa, ta, ua = /[\t\r\n]/g,
- va = /\r/g,
- wa = /^(?:button|input)$/i,
- xa = /^(?:button|input|object|select|textarea)$/i,
- ya = /^a(?:rea|)$/i,
- za = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
- Aa = $.support.getSetAttribute;
- $.fn.extend({
- attr: function(a, b) {
- return $.access(this, $.attr, a, b, arguments.length > 1)
- },
- removeAttr: function(a) {
- return this.each(function() {
- $.removeAttr(this, a)
- })
- },
- prop: function(a, b) {
- return $.access(this, $.prop, a, b, arguments.length > 1)
- },
- removeProp: function(a) {
- return a = $.propFix[a] || a, this.each(function() {
- try {
- this[a] = b, delete this[a]
- } catch (a) {}
- })
- },
- addClass: function(a) {
- var b, c, d, e, f, g, h;
- if ($.isFunction(a)) return this.each(function(b) {
- $(this).addClass(a.call(this, b, this.className))
- });
- if (a && "string" == typeof a)
- for (b = a.split(ba), c = 0, d = this.length; c < d; c++)
- if (e = this[c], 1 === e.nodeType)
- if (e.className || 1 !== b.length) {
- for (f = " " + e.className + " ", g = 0, h = b.length; g < h; g++) ~f.indexOf(" " + b[g] + " ") || (f += b[g] + " ");
- e.className = $.trim(f)
- } else e.className = a;
- return this
- },
- removeClass: function(a) {
- var c, d, e, f, g, h, i;
- if ($.isFunction(a)) return this.each(function(b) {
- $(this).removeClass(a.call(this, b, this.className))
- });
- if (a && "string" == typeof a || a === b)
- for (c = (a || "").split(ba), h = 0, i = this.length; h < i; h++)
- if (e = this[h], 1 === e.nodeType && e.className) {
- for (d = (" " + e.className + " ").replace(ua, " "), f = 0, g = c.length; f < g; f++)
- for (; d.indexOf(" " + c[f] + " ") > -1;) d = d.replace(" " + c[f] + " ", " ");
- e.className = a ? $.trim(d) : ""
- }
- return this
- },
- toggleClass: function(a, b) {
- var c = typeof a,
- d = "boolean" == typeof b;
- return $.isFunction(a) ? this.each(function(c) {
- $(this).toggleClass(a.call(this, c, this.className, b), b)
- }) : this.each(function() {
- if ("string" === c)
- for (var e, f = 0, g = $(this), h = b, i = a.split(ba); e = i[f++];) h = d ? h : !g.hasClass(e), g[h ? "addClass" : "removeClass"](e);
- else "undefined" !== c && "boolean" !== c || (this.className && $._data(this, "__className__", this.className), this.className = this.className || a === !1 ? "" : $._data(this, "__className__") || "")
- })
- },
- hasClass: function(a) {
- for (var b = " " + a + " ", c = 0, d = this.length; c < d; c++)
- if (1 === this[c].nodeType && (" " + this[c].className + " ").replace(ua, " ").indexOf(b) > -1) return !0;
- return !1
- },
- val: function(a) {
- var c, d, e, f = this[0]; {
- if (arguments.length) return e = $.isFunction(a), this.each(function(d) {
- var f, g = $(this);
- 1 === this.nodeType && (f = e ? a.call(this, d, g.val()) : a, null == f ? f = "" : "number" == typeof f ? f += "" : $.isArray(f) && (f = $.map(f, function(a) {
- return null == a ? "" : a + ""
- })), c = $.valHooks[this.type] || $.valHooks[this.nodeName.toLowerCase()], c && "set" in c && c.set(this, f, "value") !== b || (this.value = f))
- });
- if (f) return c = $.valHooks[f.type] || $.valHooks[f.nodeName.toLowerCase()], c && "get" in c && (d = c.get(f, "value")) !== b ? d : (d = f.value, "string" == typeof d ? d.replace(va, "") : null == d ? "" : d)
- }
- }
- }), $.extend({
- valHooks: {
- option: {
- get: function(a) {
- var b = a.attributes.value;
- return !b || b.specified ? a.value : a.text
- }
- },
- select: {
- get: function(a) {
- var b, c, d, e, f = a.selectedIndex,
- g = [],
- h = a.options,
- i = "select-one" === a.type;
- if (f < 0) return null;
- for (c = i ? f : 0, d = i ? f + 1 : h.length; c < d; c++)
- if (e = h[c], e.selected && ($.support.optDisabled ? !e.disabled : null === e.getAttribute("disabled")) && (!e.parentNode.disabled || !$.nodeName(e.parentNode, "optgroup"))) {
- if (b = $(e).val(), i) return b;
- g.push(b)
- }
- return i && !g.length && h.length ? $(h[f]).val() : g
- },
- set: function(a, b) {
- var c = $.makeArray(b);
- return $(a).find("option").each(function() {
- this.selected = $.inArray($(this).val(), c) >= 0
- }), c.length || (a.selectedIndex = -1), c
- }
- }
- },
- attrFn: {},
- attr: function(a, c, d, e) {
- var f, g, h, i = a.nodeType;
- if (a && 3 !== i && 8 !== i && 2 !== i) return e && $.isFunction($.fn[c]) ? $(a)[c](d) : "undefined" == typeof a.getAttribute ? $.prop(a, c, d) : (h = 1 !== i || !$.isXMLDoc(a), h && (c = c.toLowerCase(), g = $.attrHooks[c] || (za.test(c) ? sa : ra)), d !== b ? null === d ? void $.removeAttr(a, c) : g && "set" in g && h && (f = g.set(a, d, c)) !== b ? f : (a.setAttribute(c, "" + d), d) : g && "get" in g && h && null !== (f = g.get(a, c)) ? f : (f = a.getAttribute(c), null === f ? b : f))
- },
- removeAttr: function(a, b) {
- var c, d, e, f, g = 0;
- if (b && 1 === a.nodeType)
- for (d = b.split(ba); g < d.length; g++) e = d[g], e && (c = $.propFix[e] || e, f = za.test(e), f || $.attr(a, e, ""), a.removeAttribute(Aa ? e : c), f && c in a && (a[c] = !1))
- },
- attrHooks: {
- type: {
- set: function(a, b) {
- if (wa.test(a.nodeName) && a.parentNode) $.error("type property can't be changed");
- else if (!$.support.radioValue && "radio" === b && $.nodeName(a, "input")) {
- var c = a.value;
- return a.setAttribute("type", b), c && (a.value = c), b
- }
- }
- },
- value: {
- get: function(a, b) {
- return ra && $.nodeName(a, "button") ? ra.get(a, b) : b in a ? a.value : null
- },
- set: function(a, b, c) {
- return ra && $.nodeName(a, "button") ? ra.set(a, b, c) : void(a.value = b)
- }
- }
- },
- propFix: {
- tabindex: "tabIndex",
- readonly: "readOnly",
- for: "htmlFor",
- class: "className",
- maxlength: "maxLength",
- cellspacing: "cellSpacing",
- cellpadding: "cellPadding",
- rowspan: "rowSpan",
- colspan: "colSpan",
- usemap: "useMap",
- frameborder: "frameBorder",
- contenteditable: "contentEditable"
- },
- prop: function(a, c, d) {
- var e, f, g, h = a.nodeType;
- if (a && 3 !== h && 8 !== h && 2 !== h) return g = 1 !== h || !$.isXMLDoc(a), g && (c = $.propFix[c] || c, f = $.propHooks[c]), d !== b ? f && "set" in f && (e = f.set(a, d, c)) !== b ? e : a[c] = d : f && "get" in f && null !== (e = f.get(a, c)) ? e : a[c]
- },
- propHooks: {
- tabIndex: {
- get: function(a) {
- var c = a.getAttributeNode("tabindex");
- return c && c.specified ? parseInt(c.value, 10) : xa.test(a.nodeName) || ya.test(a.nodeName) && a.href ? 0 : b
- }
- }
- }
- }), sa = {
- get: function(a, c) {
- var d, e = $.prop(a, c);
- return e === !0 || "boolean" != typeof e && (d = a.getAttributeNode(c)) && d.nodeValue !== !1 ? c.toLowerCase() : b
- },
- set: function(a, b, c) {
- var d;
- return b === !1 ? $.removeAttr(a, c) : (d = $.propFix[c] || c, d in a && (a[d] = !0), a.setAttribute(c, c.toLowerCase())), c
- }
- }, Aa || (ta = {
- name: !0,
- id: !0,
- coords: !0
- }, ra = $.valHooks.button = {
- get: function(a, c) {
- var d;
- return d = a.getAttributeNode(c), d && (ta[c] ? "" !== d.value : d.specified) ? d.value : b
- },
- set: function(a, b, c) {
- var d = a.getAttributeNode(c);
- return d || (d = P.createAttribute(c), a.setAttributeNode(d)), d.value = b + ""
- }
- }, $.each(["width", "height"], function(a, b) {
- $.attrHooks[b] = $.extend($.attrHooks[b], {
- set: function(a, c) {
- if ("" === c) return a.setAttribute(b, "auto"), c
- }
- })
- }), $.attrHooks.contenteditable = {
- get: ra.get,
- set: function(a, b, c) {
- "" === b && (b = "false"), ra.set(a, b, c)
- }
- }), $.support.hrefNormalized || $.each(["href", "src", "width", "height"], function(a, c) {
- $.attrHooks[c] = $.extend($.attrHooks[c], {
- get: function(a) {
- var d = a.getAttribute(c, 2);
- return null === d ? b : d
- }
- })
- }), $.support.style || ($.attrHooks.style = {
- get: function(a) {
- return a.style.cssText.toLowerCase() || b
- },
- set: function(a, b) {
- return a.style.cssText = "" + b
- }
- }), $.support.optSelected || ($.propHooks.selected = $.extend($.propHooks.selected, {
- get: function(a) {
- var b = a.parentNode;
- return b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex), null
- }
- })), $.support.enctype || ($.propFix.enctype = "encoding"), $.support.checkOn || $.each(["radio", "checkbox"], function() {
- $.valHooks[this] = {
- get: function(a) {
- return null === a.getAttribute("value") ? "on" : a.value
- }
- }
- }), $.each(["radio", "checkbox"], function() {
- $.valHooks[this] = $.extend($.valHooks[this], {
- set: function(a, b) {
- if ($.isArray(b)) return a.checked = $.inArray($(a).val(), b) >= 0
- }
- })
- });
- var Ba = /^(?:textarea|input|select)$/i,
- Ca = /^([^\.]*|)(?:\.(.+)|)$/,
- Da = /(?:^|\s)hover(\.\S+|)\b/,
- Ea = /^key/,
- Fa = /^(?:mouse|contextmenu)|click/,
- Ga = /^(?:focusinfocus|focusoutblur)$/,
- Ha = function(a) {
- return $.event.special.hover ? a : a.replace(Da, "mouseenter$1 mouseleave$1")
- };
- $.event = {
- add: function(a, c, d, e, f) {
- var g, h, i, j, k, l, m, n, o, p, q;
- if (3 !== a.nodeType && 8 !== a.nodeType && c && d && (g = $._data(a))) {
- for (d.handler && (o = d, d = o.handler, f = o.selector), d.guid || (d.guid = $.guid++), i = g.events, i || (g.events = i = {}), h = g.handle, h || (g.handle = h = function(a) {
- return "undefined" == typeof $ || a && $.event.triggered === a.type ? b : $.event.dispatch.apply(h.elem, arguments)
- }, h.elem = a), c = $.trim(Ha(c)).split(" "), j = 0; j < c.length; j++) k = Ca.exec(c[j]) || [], l = k[1], m = (k[2] || "").split(".").sort(), q = $.event.special[l] || {}, l = (f ? q.delegateType : q.bindType) || l, q = $.event.special[l] || {}, n = $.extend({
- type: l,
- origType: k[1],
- data: e,
- handler: d,
- guid: d.guid,
- selector: f,
- namespace: m.join(".")
- }, o), p = i[l], p || (p = i[l] = [], p.delegateCount = 0, q.setup && q.setup.call(a, e, m, h) !== !1 || (a.addEventListener ? a.addEventListener(l, h, !1) : a.attachEvent && a.attachEvent("on" + l, h))), q.add && (q.add.call(a, n), n.handler.guid || (n.handler.guid = d.guid)), f ? p.splice(p.delegateCount++, 0, n) : p.push(n), $.event.global[l] = !0;
- a = null
- }
- },
- global: {},
- remove: function(a, b, c, d, e) {
- var f, g, h, i, j, k, l, m, n, o, p, q = $.hasData(a) && $._data(a);
- if (q && (m = q.events)) {
- for (b = $.trim(Ha(b || "")).split(" "), f = 0; f < b.length; f++)
- if (g = Ca.exec(b[f]) || [], h = i = g[1], j = g[2], h) {
- for (n = $.event.special[h] || {}, h = (d ? n.delegateType : n.bindType) || h, o = m[h] || [], k = o.length, j = j ? new RegExp("(^|\\.)" + j.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null, l = 0; l < o.length; l++) p = o[l], (e || i === p.origType) && (!c || c.guid === p.guid) && (!j || j.test(p.namespace)) && (!d || d === p.selector || "**" === d && p.selector) && (o.splice(l--, 1), p.selector && o.delegateCount--, n.remove && n.remove.call(a, p));
- 0 === o.length && k !== o.length && ((!n.teardown || n.teardown.call(a, j, q.handle) === !1) && $.removeEvent(a, h, q.handle), delete m[h])
- } else
- for (h in m) $.event.remove(a, h + b[f], c, d, !0);
- $.isEmptyObject(m) && (delete q.handle, $.removeData(a, "events", !0))
- }
- },
- customEvent: {
- getData: !0,
- setData: !0,
- changeData: !0
- },
- trigger: function(c, d, e, f) {
- if (!e || 3 !== e.nodeType && 8 !== e.nodeType) {
- var g, h, i, j, k, l, m, n, o, p, q = c.type || c,
- r = [];
- if (Ga.test(q + $.event.triggered)) return;
- if (q.indexOf("!") >= 0 && (q = q.slice(0, -1), h = !0), q.indexOf(".") >= 0 && (r = q.split("."), q = r.shift(), r.sort()), (!e || $.event.customEvent[q]) && !$.event.global[q]) return;
- if (c = "object" == typeof c ? c[$.expando] ? c : new $.Event(q, c) : new $.Event(q), c.type = q, c.isTrigger = !0, c.exclusive = h, c.namespace = r.join("."), c.namespace_re = c.namespace ? new RegExp("(^|\\.)" + r.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, l = q.indexOf(":") < 0 ? "on" + q : "", !e) {
- g = $.cache;
- for (i in g) g[i].events && g[i].events[q] && $.event.trigger(c, d, g[i].handle.elem, !0);
- return
- }
- if (c.result = b, c.target || (c.target = e), d = null != d ? $.makeArray(d) : [], d.unshift(c), m = $.event.special[q] || {}, m.trigger && m.trigger.apply(e, d) === !1) return;
- if (o = [
- [e, m.bindType || q]
- ], !f && !m.noBubble && !$.isWindow(e)) {
- for (p = m.delegateType || q, j = Ga.test(p + q) ? e : e.parentNode, k = e; j; j = j.parentNode) o.push([j, p]), k = j;
- k === (e.ownerDocument || P) && o.push([k.defaultView || k.parentWindow || a, p])
- }
- for (i = 0; i < o.length && !c.isPropagationStopped(); i++) j = o[i][0], c.type = o[i][1], n = ($._data(j, "events") || {})[c.type] && $._data(j, "handle"), n && n.apply(j, d), n = l && j[l], n && $.acceptData(j) && n.apply(j, d) === !1 && c.preventDefault();
- return c.type = q, !f && !c.isDefaultPrevented() && (!m._default || m._default.apply(e.ownerDocument, d) === !1) && ("click" !== q || !$.nodeName(e, "a")) && $.acceptData(e) && l && e[q] && ("focus" !== q && "blur" !== q || 0 !== c.target.offsetWidth) && !$.isWindow(e) && (k = e[l], k && (e[l] = null), $.event.triggered = q, e[q](), $.event.triggered = b, k && (e[l] = k)), c.result
- }
- },
- dispatch: function(c) {
- c = $.event.fix(c || a.event);
- var d, e, f, g, h, i, j, k, l, m = ($._data(this, "events") || {})[c.type] || [],
- n = m.delegateCount,
- o = [].slice.call(arguments),
- p = !c.exclusive && !c.namespace,
- q = $.event.special[c.type] || {},
- r = [];
- if (o[0] = c, c.delegateTarget = this, !q.preDispatch || q.preDispatch.call(this, c) !== !1) {
- if (n && (!c.button || "click" !== c.type))
- for (f = c.target; f != this; f = f.parentNode || this)
- if (f.disabled !== !0 || "click" !== c.type) {
- for (h = {}, j = [], d = 0; d < n; d++) k = m[d], l = k.selector, h[l] === b && (h[l] = $(l, this).index(f) >= 0), h[l] && j.push(k);
- j.length && r.push({
- elem: f,
- matches: j
- })
- }
- for (m.length > n && r.push({
- elem: this,
- matches: m.slice(n)
- }), d = 0; d < r.length && !c.isPropagationStopped(); d++)
- for (i = r[d], c.currentTarget = i.elem, e = 0; e < i.matches.length && !c.isImmediatePropagationStopped(); e++) k = i.matches[e], (p || !c.namespace && !k.namespace || c.namespace_re && c.namespace_re.test(k.namespace)) && (c.data = k.data, c.handleObj = k, g = (($.event.special[k.origType] || {}).handle || k.handler).apply(i.elem, o), g !== b && (c.result = g, g === !1 && (c.preventDefault(), c.stopPropagation())));
- return q.postDispatch && q.postDispatch.call(this, c), c.result
- }
- },
- props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
- fixHooks: {},
- keyHooks: {
- props: "char charCode key keyCode".split(" "),
- filter: function(a, b) {
- return null == a.which && (a.which = null != b.charCode ? b.charCode : b.keyCode), a
- }
- },
- mouseHooks: {
- props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
- filter: function(a, c) {
- var d, e, f, g = c.button,
- h = c.fromElement;
- return null == a.pageX && null != c.clientX && (d = a.target.ownerDocument || P, e = d.documentElement, f = d.body, a.pageX = c.clientX + (e && e.scrollLeft || f && f.scrollLeft || 0) - (e && e.clientLeft || f && f.clientLeft || 0), a.pageY = c.clientY + (e && e.scrollTop || f && f.scrollTop || 0) - (e && e.clientTop || f && f.clientTop || 0)), !a.relatedTarget && h && (a.relatedTarget = h === a.target ? c.toElement : h), !a.which && g !== b && (a.which = 1 & g ? 1 : 2 & g ? 3 : 4 & g ? 2 : 0), a
- }
- },
- fix: function(a) {
- if (a[$.expando]) return a;
- var b, c, d = a,
- e = $.event.fixHooks[a.type] || {},
- f = e.props ? this.props.concat(e.props) : this.props;
- for (a = $.Event(d), b = f.length; b;) c = f[--b], a[c] = d[c];
- return a.target || (a.target = d.srcElement || P), 3 === a.target.nodeType && (a.target = a.target.parentNode), a.metaKey = !!a.metaKey, e.filter ? e.filter(a, d) : a
- },
- special: {
- load: {
- noBubble: !0
- },
- focus: {
- delegateType: "focusin"
- },
- blur: {
- delegateType: "focusout"
- },
- beforeunload: {
- setup: function(a, b, c) {
- $.isWindow(this) && (this.onbeforeunload = c)
- },
- teardown: function(a, b) {
- this.onbeforeunload === b && (this.onbeforeunload = null)
- }
- }
- },
- simulate: function(a, b, c, d) {
- var e = $.extend(new $.Event, c, {
- type: a,
- isSimulated: !0,
- originalEvent: {}
- });
- d ? $.event.trigger(e, null, b) : $.event.dispatch.call(b, e), e.isDefaultPrevented() && c.preventDefault()
- }
- }, $.event.handle = $.event.dispatch, $.removeEvent = P.removeEventListener ? function(a, b, c) {
- a.removeEventListener && a.removeEventListener(b, c, !1)
- } : function(a, b, c) {
- var d = "on" + b;
- a.detachEvent && ("undefined" == typeof a[d] && (a[d] = null), a.detachEvent(d, c))
- }, $.Event = function(a, b) {
- return this instanceof $.Event ? (a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || a.returnValue === !1 || a.getPreventDefault && a.getPreventDefault() ? g : f) : this.type = a, b && $.extend(this, b), this.timeStamp = a && a.timeStamp || $.now(), this[$.expando] = !0, void 0) : new $.Event(a, b)
- }, $.Event.prototype = {
- preventDefault: function() {
- this.isDefaultPrevented = g;
- var a = this.originalEvent;
- a && (a.preventDefault ? a.preventDefault() : a.returnValue = !1)
- },
- stopPropagation: function() {
- this.isPropagationStopped = g;
- var a = this.originalEvent;
- a && (a.stopPropagation && a.stopPropagation(), a.cancelBubble = !0)
- },
- stopImmediatePropagation: function() {
- this.isImmediatePropagationStopped = g, this.stopPropagation()
- },
- isDefaultPrevented: f,
- isPropagationStopped: f,
- isImmediatePropagationStopped: f
- }, $.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout"
- }, function(a, b) {
- $.event.special[a] = {
- delegateType: b,
- bindType: b,
- handle: function(a) {
- var c, d = this,
- e = a.relatedTarget,
- f = a.handleObj;
- f.selector;
- return e && (e === d || $.contains(d, e)) || (a.type = f.origType, c = f.handler.apply(this, arguments), a.type = b), c
- }
- }
- }), $.support.submitBubbles || ($.event.special.submit = {
- setup: function() {
- return !$.nodeName(this, "form") && void $.event.add(this, "click._submit keypress._submit", function(a) {
- var c = a.target,
- d = $.nodeName(c, "input") || $.nodeName(c, "button") ? c.form : b;
- d && !$._data(d, "_submit_attached") && ($.event.add(d, "submit._submit", function(a) {
- a._submit_bubble = !0
- }), $._data(d, "_submit_attached", !0))
- })
- },
- postDispatch: function(a) {
- a._submit_bubble && (delete a._submit_bubble, this.parentNode && !a.isTrigger && $.event.simulate("submit", this.parentNode, a, !0))
- },
- teardown: function() {
- return !$.nodeName(this, "form") && void $.event.remove(this, "._submit")
- }
- }), $.support.changeBubbles || ($.event.special.change = {
- setup: function() {
- return Ba.test(this.nodeName) ? ("checkbox" !== this.type && "radio" !== this.type || ($.event.add(this, "propertychange._change", function(a) {
- "checked" === a.originalEvent.propertyName && (this._just_changed = !0)
- }), $.event.add(this, "click._change", function(a) {
- this._just_changed && !a.isTrigger && (this._just_changed = !1), $.event.simulate("change", this, a, !0)
- })), !1) : void $.event.add(this, "beforeactivate._change", function(a) {
- var b = a.target;
- Ba.test(b.nodeName) && !$._data(b, "_change_attached") && ($.event.add(b, "change._change", function(a) {
- this.parentNode && !a.isSimulated && !a.isTrigger && $.event.simulate("change", this.parentNode, a, !0)
- }), $._data(b, "_change_attached", !0))
- })
- },
- handle: function(a) {
- var b = a.target;
- if (this !== b || a.isSimulated || a.isTrigger || "radio" !== b.type && "checkbox" !== b.type) return a.handleObj.handler.apply(this, arguments)
- },
- teardown: function() {
- return $.event.remove(this, "._change"), !Ba.test(this.nodeName)
- }
- }), $.support.focusinBubbles || $.each({
- focus: "focusin",
- blur: "focusout"
- }, function(a, b) {
- var c = 0,
- d = function(a) {
- $.event.simulate(b, a.target, $.event.fix(a), !0)
- };
- $.event.special[b] = {
- setup: function() {
- 0 === c++ && P.addEventListener(a, d, !0)
- },
- teardown: function() {
- 0 === --c && P.removeEventListener(a, d, !0)
- }
- }
- }), $.fn.extend({
- on: function(a, c, d, e, g) {
- var h, i;
- if ("object" == typeof a) {
- "string" != typeof c && (d = d || c, c = b);
- for (i in a) this.on(i, c, d, a[i], g);
- return this
- }
- if (null == d && null == e ? (e = c, d = c = b) : null == e && ("string" == typeof c ? (e = d, d = b) : (e = d, d = c, c = b)), e === !1) e = f;
- else if (!e) return this;
- return 1 === g && (h = e, e = function(a) {
- return $().off(a), h.apply(this, arguments)
- }, e.guid = h.guid || (h.guid = $.guid++)), this.each(function() {
- $.event.add(this, a, e, d, c)
- })
- },
- one: function(a, b, c, d) {
- return this.on(a, b, c, d, 1)
- },
- off: function(a, c, d) {
- var e, g;
- if (a && a.preventDefault && a.handleObj) return e = a.handleObj, $(a.delegateTarget).off(e.namespace ? e.origType + "." + e.namespace : e.origType, e.selector, e.handler), this;
- if ("object" == typeof a) {
- for (g in a) this.off(g, c, a[g]);
- return this
- }
- return c !== !1 && "function" != typeof c || (d = c, c = b), d === !1 && (d = f), this.each(function() {
- $.event.remove(this, a, d, c)
- })
- },
- bind: function(a, b, c) {
- return this.on(a, null, b, c)
- },
- unbind: function(a, b) {
- return this.off(a, null, b)
- },
- live: function(a, b, c) {
- return $(this.context).on(a, this.selector, b, c), this
- },
- die: function(a, b) {
- return $(this.context).off(a, this.selector || "**", b), this
- },
- delegate: function(a, b, c, d) {
- return this.on(b, a, c, d)
- },
- undelegate: function(a, b, c) {
- return 1 == arguments.length ? this.off(a, "**") : this.off(b, a || "**", c)
- },
- trigger: function(a, b) {
- return this.each(function() {
- $.event.trigger(a, b, this)
- })
- },
- triggerHandler: function(a, b) {
- if (this[0]) return $.event.trigger(a, b, this[0], !0)
- },
- toggle: function(a) {
- var b = arguments,
- c = a.guid || $.guid++,
- d = 0,
- e = function(c) {
- var e = ($._data(this, "lastToggle" + a.guid) || 0) % d;
- return $._data(this, "lastToggle" + a.guid, e + 1), c.preventDefault(), b[e].apply(this, arguments) || !1
- };
- for (e.guid = c; d < b.length;) b[d++].guid = c;
- return this.click(e)
- },
- hover: function(a, b) {
- return this.mouseenter(a).mouseleave(b || a)
- }
- }), $.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(a, b) {
- $.fn[b] = function(a, c) {
- return null == c && (c = a, a = null), arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b)
- }, Ea.test(b) && ($.event.fixHooks[b] = $.event.keyHooks), Fa.test(b) && ($.event.fixHooks[b] = $.event.mouseHooks)
- }),
- function(a, b) {
- function c(a, b, c, d) {
- c = c || [], b = b || C;
- var e, f, g, h, i = b.nodeType;
- if (1 !== i && 9 !== i) return [];
- if (!a || "string" != typeof a) return c;
- if (g = u(b), !g && !d && (e = X.exec(a)))
- if (h = e[1]) {
- if (9 === i) {
- if (f = b.getElementById(h), !f || !f.parentNode) return c;
- if (f.id === h) return c.push(f), c
- } else if (b.ownerDocument && (f = b.ownerDocument.getElementById(h)) && v(b, f) && f.id === h) return c.push(f), c
- } else {
- if (e[2]) return G.apply(c, F.call(b.getElementsByTagName(a), 0)), c;
- if ((h = e[3]) && ha && b.getElementsByClassName) return G.apply(c, F.call(b.getElementsByClassName(h), 0)), c
- }
- return o(a, b, c, d, g)
- }
- function d(a) {
- return function(b) {
- var c = b.nodeName.toLowerCase();
- return "input" === c && b.type === a
- }
- }
- function e(a) {
- return function(b) {
- var c = b.nodeName.toLowerCase();
- return ("input" === c || "button" === c) && b.type === a
- }
- }
- function f(a, b, c) {
- if (a === b) return c;
- for (var d = a.nextSibling; d;) {
- if (d === b) return -1;
- d = d.nextSibling
- }
- return 1
- }
- function g(a, b, d, e) {
- var f, g, h, i, j, k, l, m, n, o, p = !d && b !== C,
- q = (p ? "<s>" : "") + a.replace(T, "$1<s>"),
- r = K[B][q];
- if (r) return e ? 0 : F.call(r, 0);
- for (j = a, k = [], m = 0, n = s.preFilter, o = s.filter; j;) {
- f && !(g = U.exec(j)) || (g && (j = j.slice(g[0].length), h.selector = l), k.push(h = []), l = "", p && (j = " " + j)), f = !1, (g = V.exec(j)) && (l += g[0], j = j.slice(g[0].length), f = h.push({
- part: g.pop().replace(T, " "),
- string: g[0],
- captures: g
- }));
- for (i in o)(g = ca[i].exec(j)) && (!n[i] || (g = n[i](g, b, d))) && (l += g[0], j = j.slice(g[0].length), f = h.push({
- part: i,
- string: g.shift(),
- captures: g
- }));
- if (!f) break
- }
- return l && (h.selector = l), e ? j.length : j ? c.error(a) : F.call(K(q, k), 0)
- }
- function h(a, b, c, d) {
- var e = b.dir,
- f = E++;
- return a || (a = function(a) {
- return a === c
- }), b.first ? function(b) {
- for (; b = b[e];)
- if (1 === b.nodeType) return a(b) && b
- } : d ? function(b) {
- for (; b = b[e];)
- if (1 === b.nodeType && a(b)) return b
- } : function(b) {
- for (var c, d = f + "." + p, g = d + "." + q; b = b[e];)
- if (1 === b.nodeType) {
- if ((c = b[B]) === g) return b.sizset;
- if ("string" == typeof c && 0 === c.indexOf(d)) {
- if (b.sizset) return b
- } else {
- if (b[B] = g, a(b)) return b.sizset = !0, b;
- b.sizset = !1
- }
- }
- }
- }
- function i(a, b) {
- return a ? function(c) {
- var d = b(c);
- return d && a(d === !0 ? c : d)
- } : b
- }
- function j(a, b, c) {
- for (var d, e, f = 0; d = a[f]; f++) e = s.relative[d.part] ? h(e, s.relative[d.part], b, c) : i(e, s.filter[d.part].apply(null, d.captures.concat(b, c)));
- return e
- }
- function k(a) {
- return function(b) {
- for (var c, d = 0; c = a[d]; d++)
- if (c(b)) return !0;
- return !1
- }
- }
- function l(a, b, d, e) {
- for (var f = 0, g = b.length; f < g; f++) c(a, b[f], d, e)
- }
- function m(a, b, d, e, f, g) {
- var h, i = s.setFilters[b.toLowerCase()];
- return i || c.error(b), (a || !(h = f)) && l(a || "*", e, h = [], f), h.length > 0 ? i(h, d, g) : []
- }
- function n(a, d, e, f) {
- for (var g, h, i, j, k, n, o, p, q, r, s, t, u, v = 0, w = a.length, x = ca.POS, y = new RegExp("^" + x.source + "(?!" + M + ")", "i"), z = function() {
- for (var a = 1, c = arguments.length - 2; a < c; a++) arguments[a] === b && (q[a] = b)
- }; v < w; v++) {
- for (g = a[v], h = "", p = f, i = 0, j = g.length; i < j; i++) {
- if (k = g[i], n = k.string, "PSEUDO" === k.part)
- for (x.exec(""), o = 0; q = x.exec(n);) r = !0, s = x.lastIndex = q.index + q[0].length, s > o && (h += n.slice(o, q.index), o = s, t = [d], V.test(h) && (p && (t = p), p = f), (u = Z.test(h)) && (h = h.slice(0, -5).replace(V, "$&*"), o++), q.length > 1 && q[0].replace(y, z), p = m(h, q[1], q[2], t, p, u)), h = "";
- r || (h += n), r = !1
- }
- h ? V.test(h) ? l(h, p || [d], e, f) : c(h, d, e, f ? f.concat(p) : p) : G.apply(e, p)
- }
- return 1 === w ? e : c.uniqueSort(e)
- }
- function o(a, b, c, d, e) {
- a = a.replace(T, "$1");
- var f, h, i, j, k, l, m, o, r, t = g(a, b, e),
- u = b.nodeType;
- if (ca.POS.test(a)) return n(t, b, c, d);
- if (d) f = F.call(d, 0);
- else if (1 === t.length) {
- if ((k = F.call(t[0], 0)).length > 2 && "ID" === (l = k[0]).part && 9 === u && !e && s.relative[k[1].part]) {
- if (b = s.find.ID(l.captures[0].replace(ba, ""), b, e)[0], !b) return c;
- a = a.slice(k.shift().string.length)
- }
- for (o = (t = Y.exec(k[0].string)) && !t.index && b.parentNode || b, m = "", j = k.length - 1; j >= 0 && (l = k[j], r = l.part, m = l.string + m, !s.relative[r]); j--)
- if (s.order.test(r)) {
- if (f = s.find[r](l.captures[0].replace(ba, ""), o, e), null == f) continue;
- a = a.slice(0, a.length - m.length) + m.replace(ca[r], ""), a || G.apply(c, F.call(f, 0));
- break
- }
- }
- if (a)
- for (h = w(a, b, e), p = h.dirruns++, null == f && (f = s.find.TAG("*", Y.test(a) && b.parentNode || b)), j = 0; i = f[j]; j++) q = h.runs++, h(i) && c.push(i);
- return c
- }
- var p, q, r, s, t, u, v, w, x, y, z = !0,
- A = "undefined",
- B = ("sizcache" + Math.random()).replace(".", ""),
- C = a.document,
- D = C.documentElement,
- E = 0,
- F = [].slice,
- G = [].push,
- H = function(a, b) {
- return a[B] = b || !0, a
- },
- I = function() {
- var a = {},
- b = [];
- return H(function(c, d) {
- return b.push(c) > s.cacheLength && delete a[b.shift()], a[c] = d
- }, a)
- },
- J = I(),
- K = I(),
- L = I(),
- M = "[\\x20\\t\\r\\n\\f]",
- N = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",
- O = N.replace("w", "w#"),
- P = "([*^$|!~]?=)",
- Q = "\\[" + M + "*(" + N + ")" + M + "*(?:" + P + M + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + O + ")|)|)" + M + "*\\]",
- R = ":(" + N + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + Q + ")|[^:]|\\\\.)*|.*))\\)|)",
- S = ":(nth|eq|gt|lt|first|last|even|odd)(?:\\(((?:-\\d)?\\d*)\\)|)(?=[^-]|$)",
- T = new RegExp("^" + M + "+|((?:^|[^\\\\])(?:\\\\.)*)" + M + "+$", "g"),
- U = new RegExp("^" + M + "*," + M + "*"),
- V = new RegExp("^" + M + "*([\\x20\\t\\r\\n\\f>+~])" + M + "*"),
- W = new RegExp(R),
- X = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,
- Y = /[\x20\t\r\n\f]*[+~]/,
- Z = /:not\($/,
- _ = /h\d/i,
- aa = /input|select|textarea|button/i,
- ba = /\\(?!\\)/g,
- ca = {
- ID: new RegExp("^#(" + N + ")"),
- CLASS: new RegExp("^\\.(" + N + ")"),
- NAME: new RegExp("^\\[name=['\"]?(" + N + ")['\"]?\\]"),
- TAG: new RegExp("^(" + N.replace("w", "w*") + ")"),
- ATTR: new RegExp("^" + Q),
- PSEUDO: new RegExp("^" + R),
- CHILD: new RegExp("^:(only|nth|last|first)-child(?:\\(" + M + "*(even|odd|(([+-]|)(\\d*)n|)" + M + "*(?:([+-]|)" + M + "*(\\d+)|))" + M + "*\\)|)", "i"),
- POS: new RegExp(S, "ig"),
- needsContext: new RegExp("^" + M + "*[>+~]|" + S, "i")
- },
- da = function(a) {
- var b = C.createElement("div");
- try {
- return a(b)
- } catch (a) {
- return !1
- } finally {
- b = null
- }
- },
- ea = da(function(a) {
- return a.appendChild(C.createComment("")), !a.getElementsByTagName("*").length
- }),
- fa = da(function(a) {
- return a.innerHTML = "<a href='#'></a>", a.firstChild && typeof a.firstChild.getAttribute !== A && "#" === a.firstChild.getAttribute("href")
- }),
- ga = da(function(a) {
- a.innerHTML = "<select></select>";
- var b = typeof a.lastChild.getAttribute("multiple");
- return "boolean" !== b && "string" !== b
- }),
- ha = da(function(a) {
- return a.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>", !(!a.getElementsByClassName || !a.getElementsByClassName("e").length) && (a.lastChild.className = "e", 2 === a.getElementsByClassName("e").length)
- }),
- ia = da(function(a) {
- a.id = B + 0, a.innerHTML = "<a name='" + B + "'></a><div name='" + B + "'></div>", D.insertBefore(a, D.firstChild);
- var b = C.getElementsByName && C.getElementsByName(B).length === 2 + C.getElementsByName(B + 0).length;
- return r = !C.getElementById(B), D.removeChild(a), b
- });
- try {
- F.call(D.childNodes, 0)[0].nodeType
- } catch (a) {
- F = function(a) {
- for (var b, c = []; b = this[a]; a++) c.push(b);
- return c
- }
- }
- c.matches = function(a, b) {
- return c(a, null, null, b)
- }, c.matchesSelector = function(a, b) {
- return c(b, null, null, [a]).length > 0
- }, t = c.getText = function(a) {
- var b, c = "",
- d = 0,
- e = a.nodeType;
- if (e) {
- if (1 === e || 9 === e || 11 === e) {
- if ("string" == typeof a.textContent) return a.textContent;
- for (a = a.firstChild; a; a = a.nextSibling) c += t(a)
- } else if (3 === e || 4 === e) return a.nodeValue
- } else
- for (; b = a[d]; d++) c += t(b);
- return c
- }, u = c.isXML = function(a) {
- var b = a && (a.ownerDocument || a).documentElement;
- return !!b && "HTML" !== b.nodeName
- }, v = c.contains = D.contains ? function(a, b) {
- var c = 9 === a.nodeType ? a.documentElement : a,
- d = b && b.parentNode;
- return a === d || !!(d && 1 === d.nodeType && c.contains && c.contains(d))
- } : D.compareDocumentPosition ? function(a, b) {
- return b && !!(16 & a.compareDocumentPosition(b))
- } : function(a, b) {
- for (; b = b.parentNode;)
- if (b === a) return !0;
- return !1
- }, c.attr = function(a, b) {
- var c, d = u(a);
- return d || (b = b.toLowerCase()), s.attrHandle[b] ? s.attrHandle[b](a) : ga || d ? a.getAttribute(b) : (c = a.getAttributeNode(b), c ? "boolean" == typeof a[b] ? a[b] ? b : null : c.specified ? c.value : null : null);
- }, s = c.selectors = {
- cacheLength: 50,
- createPseudo: H,
- match: ca,
- order: new RegExp("ID|TAG" + (ia ? "|NAME" : "") + (ha ? "|CLASS" : "")),
- attrHandle: fa ? {} : {
- href: function(a) {
- return a.getAttribute("href", 2)
- },
- type: function(a) {
- return a.getAttribute("type")
- }
- },
- find: {
- ID: r ? function(a, b, c) {
- if (typeof b.getElementById !== A && !c) {
- var d = b.getElementById(a);
- return d && d.parentNode ? [d] : []
- }
- } : function(a, c, d) {
- if (typeof c.getElementById !== A && !d) {
- var e = c.getElementById(a);
- return e ? e.id === a || typeof e.getAttributeNode !== A && e.getAttributeNode("id").value === a ? [e] : b : []
- }
- },
- TAG: ea ? function(a, b) {
- if (typeof b.getElementsByTagName !== A) return b.getElementsByTagName(a)
- } : function(a, b) {
- var c = b.getElementsByTagName(a);
- if ("*" === a) {
- for (var d, e = [], f = 0; d = c[f]; f++) 1 === d.nodeType && e.push(d);
- return e
- }
- return c
- },
- NAME: function(a, b) {
- if (typeof b.getElementsByName !== A) return b.getElementsByName(name)
- },
- CLASS: function(a, b, c) {
- if (typeof b.getElementsByClassName !== A && !c) return b.getElementsByClassName(a)
- }
- },
- relative: {
- ">": {
- dir: "parentNode",
- first: !0
- },
- " ": {
- dir: "parentNode"
- },
- "+": {
- dir: "previousSibling",
- first: !0
- },
- "~": {
- dir: "previousSibling"
- }
- },
- preFilter: {
- ATTR: function(a) {
- return a[1] = a[1].replace(ba, ""), a[3] = (a[4] || a[5] || "").replace(ba, ""), "~=" === a[2] && (a[3] = " " + a[3] + " "), a.slice(0, 4)
- },
- CHILD: function(a) {
- return a[1] = a[1].toLowerCase(), "nth" === a[1] ? (a[2] || c.error(a[0]), a[3] = +(a[3] ? a[4] + (a[5] || 1) : 2 * ("even" === a[2] || "odd" === a[2])), a[4] = +(a[6] + a[7] || "odd" === a[2])) : a[2] && c.error(a[0]), a
- },
- PSEUDO: function(a, b, c) {
- var d, e;
- return ca.CHILD.test(a[0]) ? null : (a[3] ? a[2] = a[3] : (d = a[4]) && (W.test(d) && (e = g(d, b, c, !0)) && (e = d.indexOf(")", d.length - e) - d.length) && (d = d.slice(0, e), a[0] = a[0].slice(0, e)), a[2] = d), a.slice(0, 3))
- }
- },
- filter: {
- ID: r ? function(a) {
- return a = a.replace(ba, ""),
- function(b) {
- return b.getAttribute("id") === a
- }
- } : function(a) {
- return a = a.replace(ba, ""),
- function(b) {
- var c = typeof b.getAttributeNode !== A && b.getAttributeNode("id");
- return c && c.value === a
- }
- },
- TAG: function(a) {
- return "*" === a ? function() {
- return !0
- } : (a = a.replace(ba, "").toLowerCase(), function(b) {
- return b.nodeName && b.nodeName.toLowerCase() === a
- })
- },
- CLASS: function(a) {
- var b = J[B][a];
- return b || (b = J(a, new RegExp("(^|" + M + ")" + a + "(" + M + "|$)"))),
- function(a) {
- return b.test(a.className || typeof a.getAttribute !== A && a.getAttribute("class") || "")
- }
- },
- ATTR: function(a, b, d) {
- return b ? function(e) {
- var f = c.attr(e, a),
- g = f + "";
- if (null == f) return "!=" === b;
- switch (b) {
- case "=":
- return g === d;
- case "!=":
- return g !== d;
- case "^=":
- return d && 0 === g.indexOf(d);
- case "*=":
- return d && g.indexOf(d) > -1;
- case "$=":
- return d && g.substr(g.length - d.length) === d;
- case "~=":
- return (" " + g + " ").indexOf(d) > -1;
- case "|=":
- return g === d || g.substr(0, d.length + 1) === d + "-"
- }
- } : function(b) {
- return null != c.attr(b, a)
- }
- },
- CHILD: function(a, b, c, d) {
- if ("nth" === a) {
- var e = E++;
- return function(a) {
- var b, f, g = 0,
- h = a;
- if (1 === c && 0 === d) return !0;
- if (b = a.parentNode, b && (b[B] !== e || !a.sizset)) {
- for (h = b.firstChild; h && (1 !== h.nodeType || (h.sizset = ++g, h !== a)); h = h.nextSibling);
- b[B] = e
- }
- return f = a.sizset - d, 0 === c ? 0 === f : f % c === 0 && f / c >= 0
- }
- }
- return function(b) {
- var c = b;
- switch (a) {
- case "only":
- case "first":
- for (; c = c.previousSibling;)
- if (1 === c.nodeType) return !1;
- if ("first" === a) return !0;
- c = b;
- case "last":
- for (; c = c.nextSibling;)
- if (1 === c.nodeType) return !1;
- return !0
- }
- }
- },
- PSEUDO: function(a, b, d, e) {
- var f, g = s.pseudos[a] || s.pseudos[a.toLowerCase()];
- return g || c.error("unsupported pseudo: " + a), g[B] ? g(b, d, e) : g.length > 1 ? (f = [a, a, "", b], function(a) {
- return g(a, 0, f)
- }) : g
- }
- },
- pseudos: {
- not: H(function(a, b, c) {
- var d = w(a.replace(T, "$1"), b, c);
- return function(a) {
- return !d(a)
- }
- }),
- enabled: function(a) {
- return a.disabled === !1
- },
- disabled: function(a) {
- return a.disabled === !0
- },
- checked: function(a) {
- var b = a.nodeName.toLowerCase();
- return "input" === b && !!a.checked || "option" === b && !!a.selected
- },
- selected: function(a) {
- return a.parentNode && a.parentNode.selectedIndex, a.selected === !0
- },
- parent: function(a) {
- return !s.pseudos.empty(a)
- },
- empty: function(a) {
- var b;
- for (a = a.firstChild; a;) {
- if (a.nodeName > "@" || 3 === (b = a.nodeType) || 4 === b) return !1;
- a = a.nextSibling
- }
- return !0
- },
- contains: H(function(a) {
- return function(b) {
- return (b.textContent || b.innerText || t(b)).indexOf(a) > -1
- }
- }),
- has: H(function(a) {
- return function(b) {
- return c(a, b).length > 0
- }
- }),
- header: function(a) {
- return _.test(a.nodeName)
- },
- text: function(a) {
- var b, c;
- return "input" === a.nodeName.toLowerCase() && "text" === (b = a.type) && (null == (c = a.getAttribute("type")) || c.toLowerCase() === b)
- },
- radio: d("radio"),
- checkbox: d("checkbox"),
- file: d("file"),
- password: d("password"),
- image: d("image"),
- submit: e("submit"),
- reset: e("reset"),
- button: function(a) {
- var b = a.nodeName.toLowerCase();
- return "input" === b && "button" === a.type || "button" === b
- },
- input: function(a) {
- return aa.test(a.nodeName)
- },
- focus: function(a) {
- var b = a.ownerDocument;
- return a === b.activeElement && (!b.hasFocus || b.hasFocus()) && (!!a.type || !!a.href)
- },
- active: function(a) {
- return a === a.ownerDocument.activeElement
- }
- },
- setFilters: {
- first: function(a, b, c) {
- return c ? a.slice(1) : [a[0]]
- },
- last: function(a, b, c) {
- var d = a.pop();
- return c ? a : [d]
- },
- even: function(a, b, c) {
- for (var d = [], e = c ? 1 : 0, f = a.length; e < f; e += 2) d.push(a[e]);
- return d
- },
- odd: function(a, b, c) {
- for (var d = [], e = c ? 0 : 1, f = a.length; e < f; e += 2) d.push(a[e]);
- return d
- },
- lt: function(a, b, c) {
- return c ? a.slice(+b) : a.slice(0, +b)
- },
- gt: function(a, b, c) {
- return c ? a.slice(0, +b + 1) : a.slice(+b + 1)
- },
- eq: function(a, b, c) {
- var d = a.splice(+b, 1);
- return c ? a : d
- }
- }
- }, x = D.compareDocumentPosition ? function(a, b) {
- return a === b ? (y = !0, 0) : (a.compareDocumentPosition && b.compareDocumentPosition ? 4 & a.compareDocumentPosition(b) : a.compareDocumentPosition) ? -1 : 1
- } : function(a, b) {
- if (a === b) return y = !0, 0;
- if (a.sourceIndex && b.sourceIndex) return a.sourceIndex - b.sourceIndex;
- var c, d, e = [],
- g = [],
- h = a.parentNode,
- i = b.parentNode,
- j = h;
- if (h === i) return f(a, b);
- if (!h) return -1;
- if (!i) return 1;
- for (; j;) e.unshift(j), j = j.parentNode;
- for (j = i; j;) g.unshift(j), j = j.parentNode;
- c = e.length, d = g.length;
- for (var k = 0; k < c && k < d; k++)
- if (e[k] !== g[k]) return f(e[k], g[k]);
- return k === c ? f(a, g[k], -1) : f(e[k], b, 1)
- }, [0, 0].sort(x), z = !y, c.uniqueSort = function(a) {
- var b, c = 1;
- if (y = z, a.sort(x), y)
- for (; b = a[c]; c++) b === a[c - 1] && a.splice(c--, 1);
- return a
- }, c.error = function(a) {
- throw new Error("Syntax error, unrecognized expression: " + a)
- }, w = c.compile = function(a, b, c) {
- var d, e, f, h = L[B][a];
- if (h && h.context === b) return h;
- for (d = g(a, b, c), e = 0, f = d.length; e < f; e++) d[e] = j(d[e], b, c);
- return h = L(a, k(d)), h.context = b, h.runs = h.dirruns = 0, h
- }, C.querySelectorAll && function() {
- var a, b = o,
- d = /'|\\/g,
- e = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
- f = [],
- h = [":active"],
- i = D.matchesSelector || D.mozMatchesSelector || D.webkitMatchesSelector || D.oMatchesSelector || D.msMatchesSelector;
- da(function(a) {
- a.innerHTML = "<select><option selected=''></option></select>", a.querySelectorAll("[selected]").length || f.push("\\[" + M + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)"), a.querySelectorAll(":checked").length || f.push(":checked")
- }), da(function(a) {
- a.innerHTML = "<p test=''></p>", a.querySelectorAll("[test^='']").length && f.push("[*^$]=" + M + "*(?:\"\"|'')"), a.innerHTML = "<input type='hidden'/>", a.querySelectorAll(":enabled").length || f.push(":enabled", ":disabled")
- }), f = f.length && new RegExp(f.join("|")), o = function(a, c, e, h, i) {
- if (!(h || i || f && f.test(a)))
- if (9 === c.nodeType) try {
- return G.apply(e, F.call(c.querySelectorAll(a), 0)), e
- } catch (a) {} else if (1 === c.nodeType && "object" !== c.nodeName.toLowerCase()) {
- var j, k, l, m = c.getAttribute("id"),
- n = m || B,
- o = Y.test(a) && c.parentNode || c;
- for (m ? n = n.replace(d, "\\$&") : c.setAttribute("id", n), j = g(a, c, i), n = "[id='" + n + "']", k = 0, l = j.length; k < l; k++) j[k] = n + j[k].selector;
- try {
- return G.apply(e, F.call(o.querySelectorAll(j.join(",")), 0)), e
- } catch (a) {} finally {
- m || c.removeAttribute("id")
- }
- }
- return b(a, c, e, h, i)
- }, i && (da(function(b) {
- a = i.call(b, "div");
- try {
- i.call(b, "[test!='']:sizzle"), h.push(ca.PSEUDO.source, ca.POS.source, "!=")
- } catch (a) {}
- }), h = new RegExp(h.join("|")), c.matchesSelector = function(b, d) {
- if (d = d.replace(e, "='$1']"), !(u(b) || h.test(d) || f && f.test(d))) try {
- var g = i.call(b, d);
- if (g || a || b.document && 11 !== b.document.nodeType) return g
- } catch (a) {}
- return c(d, null, null, [b]).length > 0
- })
- }(), s.setFilters.nth = s.setFilters.eq, s.filters = s.pseudos, c.attr = $.attr, $.find = c, $.expr = c.selectors, $.expr[":"] = $.expr.pseudos, $.unique = c.uniqueSort, $.text = c.getText, $.isXMLDoc = c.isXML, $.contains = c.contains
- }(a);
- var Ia = /Until$/,
- Ja = /^(?:parents|prev(?:Until|All))/,
- Ka = /^.[^:#\[\.,]*$/,
- La = $.expr.match.needsContext,
- Ma = {
- children: !0,
- contents: !0,
- next: !0,
- prev: !0
- };
- $.fn.extend({
- find: function(a) {
- var b, c, d, e, f, g, h = this;
- if ("string" != typeof a) return $(a).filter(function() {
- for (b = 0, c = h.length; b < c; b++)
- if ($.contains(h[b], this)) return !0
- });
- for (g = this.pushStack("", "find", a), b = 0, c = this.length; b < c; b++)
- if (d = g.length, $.find(a, this[b], g), b > 0)
- for (e = d; e < g.length; e++)
- for (f = 0; f < d; f++)
- if (g[f] === g[e]) {
- g.splice(e--, 1);
- break
- }
- return g
- },
- has: function(a) {
- var b, c = $(a, this),
- d = c.length;
- return this.filter(function() {
- for (b = 0; b < d; b++)
- if ($.contains(this, c[b])) return !0
- })
- },
- not: function(a) {
- return this.pushStack(j(this, a, !1), "not", a)
- },
- filter: function(a) {
- return this.pushStack(j(this, a, !0), "filter", a)
- },
- is: function(a) {
- return !!a && ("string" == typeof a ? La.test(a) ? $(a, this.context).index(this[0]) >= 0 : $.filter(a, this).length > 0 : this.filter(a).length > 0)
- },
- closest: function(a, b) {
- for (var c, d = 0, e = this.length, f = [], g = La.test(a) || "string" != typeof a ? $(a, b || this.context) : 0; d < e; d++)
- for (c = this[d]; c && c.ownerDocument && c !== b && 11 !== c.nodeType;) {
- if (g ? g.index(c) > -1 : $.find.matchesSelector(c, a)) {
- f.push(c);
- break
- }
- c = c.parentNode
- }
- return f = f.length > 1 ? $.unique(f) : f, this.pushStack(f, "closest", a)
- },
- index: function(a) {
- return a ? "string" == typeof a ? $.inArray(this[0], $(a)) : $.inArray(a.jquery ? a[0] : a, this) : this[0] && this[0].parentNode ? this.prevAll().length : -1
- },
- add: function(a, b) {
- var c = "string" == typeof a ? $(a, b) : $.makeArray(a && a.nodeType ? [a] : a),
- d = $.merge(this.get(), c);
- return this.pushStack(h(c[0]) || h(d[0]) ? d : $.unique(d))
- },
- addBack: function(a) {
- return this.add(null == a ? this.prevObject : this.prevObject.filter(a))
- }
- }), $.fn.andSelf = $.fn.addBack, $.each({
- parent: function(a) {
- var b = a.parentNode;
- return b && 11 !== b.nodeType ? b : null
- },
- parents: function(a) {
- return $.dir(a, "parentNode")
- },
- parentsUntil: function(a, b, c) {
- return $.dir(a, "parentNode", c)
- },
- next: function(a) {
- return i(a, "nextSibling")
- },
- prev: function(a) {
- return i(a, "previousSibling")
- },
- nextAll: function(a) {
- return $.dir(a, "nextSibling")
- },
- prevAll: function(a) {
- return $.dir(a, "previousSibling")
- },
- nextUntil: function(a, b, c) {
- return $.dir(a, "nextSibling", c)
- },
- prevUntil: function(a, b, c) {
- return $.dir(a, "previousSibling", c)
- },
- siblings: function(a) {
- return $.sibling((a.parentNode || {}).firstChild, a)
- },
- children: function(a) {
- return $.sibling(a.firstChild)
- },
- contents: function(a) {
- return $.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : $.merge([], a.childNodes)
- }
- }, function(a, b) {
- $.fn[a] = function(c, d) {
- var e = $.map(this, b, c);
- return Ia.test(a) || (d = c), d && "string" == typeof d && (e = $.filter(d, e)), e = this.length > 1 && !Ma[a] ? $.unique(e) : e, this.length > 1 && Ja.test(a) && (e = e.reverse()), this.pushStack(e, a, V.call(arguments).join(","))
- }
- }), $.extend({
- filter: function(a, b, c) {
- return c && (a = ":not(" + a + ")"), 1 === b.length ? $.find.matchesSelector(b[0], a) ? [b[0]] : [] : $.find.matches(a, b)
- },
- dir: function(a, c, d) {
- for (var e = [], f = a[c]; f && 9 !== f.nodeType && (d === b || 1 !== f.nodeType || !$(f).is(d));) 1 === f.nodeType && e.push(f), f = f[c];
- return e
- },
- sibling: function(a, b) {
- for (var c = []; a; a = a.nextSibling) 1 === a.nodeType && a !== b && c.push(a);
- return c
- }
- });
- var Na = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
- Oa = / jQuery\d+="(?:null|\d+)"/g,
- Pa = /^\s+/,
- Qa = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
- Ra = /<([\w:]+)/,
- Sa = /<tbody/i,
- Ta = /<|&#?\w+;/,
- Ua = /<(?:script|style|link)/i,
- Va = /<(?:script|object|embed|option|style)/i,
- Wa = new RegExp("<(?:" + Na + ")[\\s/>]", "i"),
- Xa = /^(?:checkbox|radio)$/,
- Ya = /checked\s*(?:[^=]|=\s*.checked.)/i,
- Za = /\/(java|ecma)script/i,
- $a = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,
- _a = {
- option: [1, "<select multiple='multiple'>", "</select>"],
- legend: [1, "<fieldset>", "</fieldset>"],
- thead: [1, "<table>", "</table>"],
- tr: [2, "<table><tbody>", "</tbody></table>"],
- td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
- col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
- area: [1, "<map>", "</map>"],
- _default: [0, "", ""]
- },
- ab = k(P),
- bb = ab.appendChild(P.createElement("div"));
- _a.optgroup = _a.option, _a.tbody = _a.tfoot = _a.colgroup = _a.caption = _a.thead, _a.th = _a.td, $.support.htmlSerialize || (_a._default = [1, "X<div>", "</div>"]), $.fn.extend({
- text: function(a) {
- return $.access(this, function(a) {
- return a === b ? $.text(this) : this.empty().append((this[0] && this[0].ownerDocument || P).createTextNode(a))
- }, null, a, arguments.length)
- },
- wrapAll: function(a) {
- if ($.isFunction(a)) return this.each(function(b) {
- $(this).wrapAll(a.call(this, b))
- });
- if (this[0]) {
- var b = $(a, this[0].ownerDocument).eq(0).clone(!0);
- this[0].parentNode && b.insertBefore(this[0]), b.map(function() {
- for (var a = this; a.firstChild && 1 === a.firstChild.nodeType;) a = a.firstChild;
- return a
- }).append(this)
- }
- return this
- },
- wrapInner: function(a) {
- return $.isFunction(a) ? this.each(function(b) {
- $(this).wrapInner(a.call(this, b))
- }) : this.each(function() {
- var b = $(this),
- c = b.contents();
- c.length ? c.wrapAll(a) : b.append(a)
- })
- },
- wrap: function(a) {
- var b = $.isFunction(a);
- return this.each(function(c) {
- $(this).wrapAll(b ? a.call(this, c) : a)
- })
- },
- unwrap: function() {
- return this.parent().each(function() {
- $.nodeName(this, "body") || $(this).replaceWith(this.childNodes)
- }).end()
- },
- append: function() {
- return this.domManip(arguments, !0, function(a) {
- (1 === this.nodeType || 11 === this.nodeType) && this.appendChild(a)
- })
- },
- prepend: function() {
- return this.domManip(arguments, !0, function(a) {
- (1 === this.nodeType || 11 === this.nodeType) && this.insertBefore(a, this.firstChild)
- })
- },
- before: function() {
- if (!h(this[0])) return this.domManip(arguments, !1, function(a) {
- this.parentNode.insertBefore(a, this)
- });
- if (arguments.length) {
- var a = $.clean(arguments);
- return this.pushStack($.merge(a, this), "before", this.selector)
- }
- },
- after: function() {
- if (!h(this[0])) return this.domManip(arguments, !1, function(a) {
- this.parentNode.insertBefore(a, this.nextSibling)
- });
- if (arguments.length) {
- var a = $.clean(arguments);
- return this.pushStack($.merge(this, a), "after", this.selector)
- }
- },
- remove: function(a, b) {
- for (var c, d = 0; null != (c = this[d]); d++) a && !$.filter(a, [c]).length || (!b && 1 === c.nodeType && ($.cleanData(c.getElementsByTagName("*")), $.cleanData([c])), c.parentNode && c.parentNode.removeChild(c));
- return this
- },
- empty: function() {
- for (var a, b = 0; null != (a = this[b]); b++)
- for (1 === a.nodeType && $.cleanData(a.getElementsByTagName("*")); a.firstChild;) a.removeChild(a.firstChild);
- return this
- },
- clone: function(a, b) {
- return a = null != a && a, b = null == b ? a : b, this.map(function() {
- return $.clone(this, a, b)
- })
- },
- html: function(a) {
- return $.access(this, function(a) {
- var c = this[0] || {},
- d = 0,
- e = this.length;
- if (a === b) return 1 === c.nodeType ? c.innerHTML.replace(Oa, "") : b;
- if ("string" == typeof a && !Ua.test(a) && ($.support.htmlSerialize || !Wa.test(a)) && ($.support.leadingWhitespace || !Pa.test(a)) && !_a[(Ra.exec(a) || ["", ""])[1].toLowerCase()]) {
- a = a.replace(Qa, "<$1></$2>");
- try {
- for (; d < e; d++) c = this[d] || {}, 1 === c.nodeType && ($.cleanData(c.getElementsByTagName("*")), c.innerHTML = a);
- c = 0
- } catch (a) {}
- }
- c && this.empty().append(a)
- }, null, a, arguments.length)
- },
- replaceWith: function(a) {
- return h(this[0]) ? this.length ? this.pushStack($($.isFunction(a) ? a() : a), "replaceWith", a) : this : $.isFunction(a) ? this.each(function(b) {
- var c = $(this),
- d = c.html();
- c.replaceWith(a.call(this, b, d))
- }) : ("string" != typeof a && (a = $(a).detach()), this.each(function() {
- var b = this.nextSibling,
- c = this.parentNode;
- $(this).remove(), b ? $(b).before(a) : $(c).append(a)
- }))
- },
- detach: function(a) {
- return this.remove(a, !0)
- },
- domManip: function(a, c, d) {
- a = [].concat.apply([], a);
- var e, f, g, h, i = 0,
- j = a[0],
- k = [],
- m = this.length;
- if (!$.support.checkClone && m > 1 && "string" == typeof j && Ya.test(j)) return this.each(function() {
- $(this).domManip(a, c, d)
- });
- if ($.isFunction(j)) return this.each(function(e) {
- var f = $(this);
- a[0] = j.call(this, e, c ? f.html() : b), f.domManip(a, c, d)
- });
- if (this[0]) {
- if (e = $.buildFragment(a, this, k), g = e.fragment, f = g.firstChild, 1 === g.childNodes.length && (g = f), f)
- for (c = c && $.nodeName(f, "tr"), h = e.cacheable || m - 1; i < m; i++) d.call(c && $.nodeName(this[i], "table") ? l(this[i], "tbody") : this[i], i === h ? g : $.clone(g, !0, !0));
- g = f = null, k.length && $.each(k, function(a, b) {
- b.src ? $.ajax ? $.ajax({
- url: b.src,
- type: "GET",
- dataType: "script",
- async: !1,
- global: !1,
- throws: !0
- }) : $.error("no ajax") : $.globalEval((b.text || b.textContent || b.innerHTML || "").replace($a, "")), b.parentNode && b.parentNode.removeChild(b)
- })
- }
- return this
- }
- }), $.buildFragment = function(a, c, d) {
- var e, f, g, h = a[0];
- return c = c || P, c = !c.nodeType && c[0] || c, c = c.ownerDocument || c, 1 === a.length && "string" == typeof h && h.length < 512 && c === P && "<" === h.charAt(0) && !Va.test(h) && ($.support.checkClone || !Ya.test(h)) && ($.support.html5Clone || !Wa.test(h)) && (f = !0, e = $.fragments[h], g = e !== b), e || (e = c.createDocumentFragment(), $.clean(a, c, e, d), f && ($.fragments[h] = g && e)), {
- fragment: e,
- cacheable: f
- }
- }, $.fragments = {}, $.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
- }, function(a, b) {
- $.fn[a] = function(c) {
- var d, e = 0,
- f = [],
- g = $(c),
- h = g.length,
- i = 1 === this.length && this[0].parentNode;
- if ((null == i || i && 11 === i.nodeType && 1 === i.childNodes.length) && 1 === h) return g[b](this[0]), this;
- for (; e < h; e++) d = (e > 0 ? this.clone(!0) : this).get(), $(g[e])[b](d), f = f.concat(d);
- return this.pushStack(f, a, g.selector)
- }
- }), $.extend({
- clone: function(a, b, c) {
- var d, e, f, g;
- if ($.support.html5Clone || $.isXMLDoc(a) || !Wa.test("<" + a.nodeName + ">") ? g = a.cloneNode(!0) : (bb.innerHTML = a.outerHTML, bb.removeChild(g = bb.firstChild)), !($.support.noCloneEvent && $.support.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || $.isXMLDoc(a)))
- for (n(a, g), d = o(a), e = o(g), f = 0; d[f]; ++f) e[f] && n(d[f], e[f]);
- if (b && (m(a, g), c))
- for (d = o(a), e = o(g), f = 0; d[f]; ++f) m(d[f], e[f]);
- return d = e = null, g
- },
- clean: function(a, b, c, d) {
- var e, f, g, h, i, j, l, m, n, o, q, r = b === P && ab,
- s = [];
- for (b && "undefined" != typeof b.createDocumentFragment || (b = P), e = 0; null != (g = a[e]); e++)
- if ("number" == typeof g && (g += ""), g) {
- if ("string" == typeof g)
- if (Ta.test(g)) {
- for (r = r || k(b), l = b.createElement("div"), r.appendChild(l), g = g.replace(Qa, "<$1></$2>"), h = (Ra.exec(g) || ["", ""])[1].toLowerCase(), i = _a[h] || _a._default, j = i[0], l.innerHTML = i[1] + g + i[2]; j--;) l = l.lastChild;
- if (!$.support.tbody)
- for (m = Sa.test(g), n = "table" !== h || m ? "<table>" !== i[1] || m ? [] : l.childNodes : l.firstChild && l.firstChild.childNodes, f = n.length - 1; f >= 0; --f) $.nodeName(n[f], "tbody") && !n[f].childNodes.length && n[f].parentNode.removeChild(n[f]);
- !$.support.leadingWhitespace && Pa.test(g) && l.insertBefore(b.createTextNode(Pa.exec(g)[0]), l.firstChild), g = l.childNodes, l.parentNode.removeChild(l)
- } else g = b.createTextNode(g);
- g.nodeType ? s.push(g) : $.merge(s, g)
- }
- if (l && (g = l = r = null), !$.support.appendChecked)
- for (e = 0; null != (g = s[e]); e++) $.nodeName(g, "input") ? p(g) : "undefined" != typeof g.getElementsByTagName && $.grep(g.getElementsByTagName("input"), p);
- if (c)
- for (o = function(a) {
- if (!a.type || Za.test(a.type)) return d ? d.push(a.parentNode ? a.parentNode.removeChild(a) : a) : c.appendChild(a)
- }, e = 0; null != (g = s[e]); e++) $.nodeName(g, "script") && o(g) || (c.appendChild(g), "undefined" != typeof g.getElementsByTagName && (q = $.grep($.merge([], g.getElementsByTagName("script")), o), s.splice.apply(s, [e + 1, 0].concat(q)), e += q.length));
- return s
- },
- cleanData: function(a, b) {
- for (var c, d, e, f, g = 0, h = $.expando, i = $.cache, j = $.support.deleteExpando, k = $.event.special; null != (e = a[g]); g++)
- if ((b || $.acceptData(e)) && (d = e[h], c = d && i[d])) {
- if (c.events)
- for (f in c.events) k[f] ? $.event.remove(e, f) : $.removeEvent(e, f, c.handle);
- i[d] && (delete i[d], j ? delete e[h] : e.removeAttribute ? e.removeAttribute(h) : e[h] = null, $.deletedIds.push(d))
- }
- }
- }),
- function() {
- var a, b;
- $.uaMatch = function(a) {
- a = a.toLowerCase();
- var b = /(chrome)[ \/]([\w.]+)/.exec(a) || /(webkit)[ \/]([\w.]+)/.exec(a) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a) || /(msie) ([\w.]+)/.exec(a) || a.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a) || [];
- return {
- browser: b[1] || "",
- version: b[2] || "0"
- }
- }, a = $.uaMatch(R.userAgent), b = {}, a.browser && (b[a.browser] = !0, b.version = a.version), b.chrome ? b.webkit = !0 : b.webkit && (b.safari = !0), $.browser = b, $.sub = function() {
- function a(b, c) {
- return new a.fn.init(b, c)
- }
- $.extend(!0, a, this), a.superclass = this, a.fn = a.prototype = this(), a.fn.constructor = a, a.sub = this.sub, a.fn.init = function c(c, d) {
- return d && d instanceof $ && !(d instanceof a) && (d = a(d)), $.fn.init.call(this, c, d, b)
- }, a.fn.init.prototype = a.fn;
- var b = a(P);
- return a
- }
- }();
- var cb, db, eb, fb = /alpha\([^)]*\)/i,
- gb = /opacity=([^)]*)/,
- hb = /^(top|right|bottom|left)$/,
- ib = /^(none|table(?!-c[ea]).+)/,
- jb = /^margin/,
- kb = new RegExp("^(" + _ + ")(.*)$", "i"),
- lb = new RegExp("^(" + _ + ")(?!px)[a-z%]+$", "i"),
- mb = new RegExp("^([-+])=(" + _ + ")", "i"),
- nb = {},
- ob = {
- position: "absolute",
- visibility: "hidden",
- display: "block"
- },
- pb = {
- letterSpacing: 0,
- fontWeight: 400
- },
- qb = ["Top", "Right", "Bottom", "Left"],
- rb = ["Webkit", "O", "Moz", "ms"],
- sb = $.fn.toggle;
- $.fn.extend({
- css: function(a, c) {
- return $.access(this, function(a, c, d) {
- return d !== b ? $.style(a, c, d) : $.css(a, c)
- }, a, c, arguments.length > 1)
- },
- show: function() {
- return s(this, !0)
- },
- hide: function() {
- return s(this)
- },
- toggle: function(a, b) {
- var c = "boolean" == typeof a;
- return $.isFunction(a) && $.isFunction(b) ? sb.apply(this, arguments) : this.each(function() {
- (c ? a : r(this)) ? $(this).show(): $(this).hide()
- })
- }
- }), $.extend({
- cssHooks: {
- opacity: {
- get: function(a, b) {
- if (b) {
- var c = cb(a, "opacity");
- return "" === c ? "1" : c
- }
- }
- }
- },
- cssNumber: {
- fillOpacity: !0,
- fontWeight: !0,
- lineHeight: !0,
- opacity: !0,
- orphans: !0,
- widows: !0,
- zIndex: !0,
- zoom: !0
- },
- cssProps: {
- float: $.support.cssFloat ? "cssFloat" : "styleFloat"
- },
- style: function(a, c, d, e) {
- if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) {
- var f, g, h, i = $.camelCase(c),
- j = a.style;
- if (c = $.cssProps[i] || ($.cssProps[i] = q(j, i)), h = $.cssHooks[c] || $.cssHooks[i], d === b) return h && "get" in h && (f = h.get(a, !1, e)) !== b ? f : j[c];
- if (g = typeof d, "string" === g && (f = mb.exec(d)) && (d = (f[1] + 1) * f[2] + parseFloat($.css(a, c)), g = "number"), !(null == d || "number" === g && isNaN(d) || ("number" === g && !$.cssNumber[i] && (d += "px"), h && "set" in h && (d = h.set(a, d, e)) === b))) try {
- j[c] = d
- } catch (a) {}
- }
- },
- css: function(a, c, d, e) {
- var f, g, h, i = $.camelCase(c);
- return c = $.cssProps[i] || ($.cssProps[i] = q(a.style, i)), h = $.cssHooks[c] || $.cssHooks[i], h && "get" in h && (f = h.get(a, !0, e)), f === b && (f = cb(a, c)), "normal" === f && c in pb && (f = pb[c]), d || e !== b ? (g = parseFloat(f), d || $.isNumeric(g) ? g || 0 : f) : f
- },
- swap: function(a, b, c) {
- var d, e, f = {};
- for (e in b) f[e] = a.style[e], a.style[e] = b[e];
- d = c.call(a);
- for (e in b) a.style[e] = f[e];
- return d
- }
- }), a.getComputedStyle ? cb = function(b, c) {
- var d, e, f, g, h = a.getComputedStyle(b, null),
- i = b.style;
- return h && (d = h[c], "" === d && !$.contains(b.ownerDocument, b) && (d = $.style(b, c)), lb.test(d) && jb.test(c) && (e = i.width, f = i.minWidth, g = i.maxWidth, i.minWidth = i.maxWidth = i.width = d, d = h.width, i.width = e, i.minWidth = f, i.maxWidth = g)), d
- } : P.documentElement.currentStyle && (cb = function(a, b) {
- var c, d, e = a.currentStyle && a.currentStyle[b],
- f = a.style;
- return null == e && f && f[b] && (e = f[b]), lb.test(e) && !hb.test(b) && (c = f.left, d = a.runtimeStyle && a.runtimeStyle.left, d && (a.runtimeStyle.left = a.currentStyle.left), f.left = "fontSize" === b ? "1em" : e, e = f.pixelLeft + "px", f.left = c, d && (a.runtimeStyle.left = d)), "" === e ? "auto" : e
- }), $.each(["height", "width"], function(a, b) {
- $.cssHooks[b] = {
- get: function(a, c, d) {
- if (c) return 0 === a.offsetWidth && ib.test(cb(a, "display")) ? $.swap(a, ob, function() {
- return v(a, b, d)
- }) : v(a, b, d)
- },
- set: function(a, c, d) {
- return t(a, c, d ? u(a, b, d, $.support.boxSizing && "border-box" === $.css(a, "boxSizing")) : 0)
- }
- }
- }), $.support.opacity || ($.cssHooks.opacity = {
- get: function(a, b) {
- return gb.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : b ? "1" : ""
- },
- set: function(a, b) {
- var c = a.style,
- d = a.currentStyle,
- e = $.isNumeric(b) ? "alpha(opacity=" + 100 * b + ")" : "",
- f = d && d.filter || c.filter || "";
- c.zoom = 1, b >= 1 && "" === $.trim(f.replace(fb, "")) && c.removeAttribute && (c.removeAttribute("filter"), d && !d.filter) || (c.filter = fb.test(f) ? f.replace(fb, e) : f + " " + e)
- }
- }), $(function() {
- $.support.reliableMarginRight || ($.cssHooks.marginRight = {
- get: function(a, b) {
- return $.swap(a, {
- display: "inline-block"
- }, function() {
- if (b) return cb(a, "marginRight")
- })
- }
- }), !$.support.pixelPosition && $.fn.position && $.each(["top", "left"], function(a, b) {
- $.cssHooks[b] = {
- get: function(a, c) {
- if (c) {
- var d = cb(a, b);
- return lb.test(d) ? $(a).position()[b] + "px" : d
- }
- }
- }
- })
- }), $.expr && $.expr.filters && ($.expr.filters.hidden = function(a) {
- return 0 === a.offsetWidth && 0 === a.offsetHeight || !$.support.reliableHiddenOffsets && "none" === (a.style && a.style.display || cb(a, "display"))
- }, $.expr.filters.visible = function(a) {
- return !$.expr.filters.hidden(a)
- }), $.each({
- margin: "",
- padding: "",
- border: "Width"
- }, function(a, b) {
- $.cssHooks[a + b] = {
- expand: function(c) {
- var d, e = "string" == typeof c ? c.split(" ") : [c],
- f = {};
- for (d = 0; d < 4; d++) f[a + qb[d] + b] = e[d] || e[d - 2] || e[0];
- return f
- }
- }, jb.test(a) || ($.cssHooks[a + b].set = t)
- });
- var tb = /%20/g,
- ub = /\[\]$/,
- vb = /\r?\n/g,
- wb = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
- xb = /^(?:select|textarea)/i;
- $.fn.extend({
- serialize: function() {
- return $.param(this.serializeArray())
- },
- serializeArray: function() {
- return this.map(function() {
- return this.elements ? $.makeArray(this.elements) : this
- }).filter(function() {
- return this.name && !this.disabled && (this.checked || xb.test(this.nodeName) || wb.test(this.type))
- }).map(function(a, b) {
- var c = $(this).val();
- return null == c ? null : $.isArray(c) ? $.map(c, function(a, c) {
- return {
- name: b.name,
- value: a.replace(vb, "\r\n")
- }
- }) : {
- name: b.name,
- value: c.replace(vb, "\r\n")
- }
- }).get()
- }
- }), $.param = function(a, c) {
- var d, e = [],
- f = function(a, b) {
- b = $.isFunction(b) ? b() : null == b ? "" : b, e[e.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b)
- };
- if (c === b && (c = $.ajaxSettings && $.ajaxSettings.traditional), $.isArray(a) || a.jquery && !$.isPlainObject(a)) $.each(a, function() {
- f(this.name, this.value)
- });
- else
- for (d in a) x(d, a[d], c, f);
- return e.join("&").replace(tb, "+")
- };
- var yb, zb, Ab = /#.*$/,
- Bb = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm,
- Cb = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
- Db = /^(?:GET|HEAD)$/,
- Eb = /^\/\//,
- Fb = /\?/,
- Gb = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
- Hb = /([?&])_=[^&]*/,
- Ib = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
- Jb = $.fn.load,
- Kb = {},
- Lb = {},
- Mb = ["*/"] + ["*"];
- try {
- yb = Q.href
- } catch (a) {
- yb = P.createElement("a"), yb.href = "", yb = yb.href
- }
- zb = Ib.exec(yb.toLowerCase()) || [], $.fn.load = function(a, c, d) {
- if ("string" != typeof a && Jb) return Jb.apply(this, arguments);
- if (!this.length) return this;
- var e, f, g, h = this,
- i = a.indexOf(" ");
- return i >= 0 && (e = a.slice(i, a.length), a = a.slice(0, i)), $.isFunction(c) ? (d = c, c = b) : c && "object" == typeof c && (f = "POST"), $.ajax({
- url: a,
- type: f,
- dataType: "html",
- data: c,
- complete: function(a, b) {
- d && h.each(d, g || [a.responseText, b, a])
- }
- }).done(function(a) {
- g = arguments, h.html(e ? $("<div>").append(a.replace(Gb, "")).find(e) : a)
- }), this
- }, $.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function(a, b) {
- $.fn[b] = function(a) {
- return this.on(b, a)
- }
- }), $.each(["get", "post"], function(a, c) {
- $[c] = function(a, d, e, f) {
- return $.isFunction(d) && (f = f || e, e = d, d = b), $.ajax({
- type: c,
- url: a,
- data: d,
- success: e,
- dataType: f
- })
- }
- }), $.extend({
- getScript: function(a, c) {
- return $.get(a, b, c, "script")
- },
- getJSON: function(a, b, c) {
- return $.get(a, b, c, "json")
- },
- ajaxSetup: function(a, b) {
- return b ? A(a, $.ajaxSettings) : (b = a, a = $.ajaxSettings), A(a, b), a
- },
- ajaxSettings: {
- url: yb,
- isLocal: Cb.test(zb[1]),
- global: !0,
- type: "GET",
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- processData: !0,
- async: !0,
- accepts: {
- xml: "application/xml, text/xml",
- html: "text/html",
- text: "text/plain",
- json: "application/json, text/javascript",
- "*": Mb
- },
- contents: {
- xml: /xml/,
- html: /html/,
- json: /json/
- },
- responseFields: {
- xml: "responseXML",
- text: "responseText"
- },
- converters: {
- "* text": a.String,
- "text html": !0,
- "text json": $.parseJSON,
- "text xml": $.parseXML
- },
- flatOptions: {
- context: !0,
- url: !0
- }
- },
- ajaxPrefilter: y(Kb),
- ajaxTransport: y(Lb),
- ajax: function(a, c) {
- function d(a, c, d, g) {
- var j, l, s, t, v, x = c;
- 2 !== u && (u = 2, i && clearTimeout(i), h = b, f = g || "", w.readyState = a > 0 ? 4 : 0, d && (t = B(m, w, d)), a >= 200 && a < 300 || 304 === a ? (m.ifModified && (v = w.getResponseHeader("Last-Modified"), v && ($.lastModified[e] = v), v = w.getResponseHeader("Etag"), v && ($.etag[e] = v)), 304 === a ? (x = "notmodified", j = !0) : (j = C(m, t), x = j.state, l = j.data, s = j.error, j = !s)) : (s = x, x && !a || (x = "error", a < 0 && (a = 0))), w.status = a, w.statusText = "" + (c || x), j ? p.resolveWith(n, [l, x, w]) : p.rejectWith(n, [w, x, s]), w.statusCode(r), r = b, k && o.trigger("ajax" + (j ? "Success" : "Error"), [w, m, j ? l : s]), q.fireWith(n, [w, x]), k && (o.trigger("ajaxComplete", [w, m]), --$.active || $.event.trigger("ajaxStop")))
- }
- "object" == typeof a && (c = a, a = b), c = c || {};
- var e, f, g, h, i, j, k, l, m = $.ajaxSetup({}, c),
- n = m.context || m,
- o = n !== m && (n.nodeType || n instanceof $) ? $(n) : $.event,
- p = $.Deferred(),
- q = $.Callbacks("once memory"),
- r = m.statusCode || {},
- s = {},
- t = {},
- u = 0,
- v = "canceled",
- w = {
- readyState: 0,
- setRequestHeader: function(a, b) {
- if (!u) {
- var c = a.toLowerCase();
- a = t[c] = t[c] || a, s[a] = b
- }
- return this
- },
- getAllResponseHeaders: function() {
- return 2 === u ? f : null
- },
- getResponseHeader: function(a) {
- var c;
- if (2 === u) {
- if (!g)
- for (g = {}; c = Bb.exec(f);) g[c[1].toLowerCase()] = c[2];
- c = g[a.toLowerCase()]
- }
- return c === b ? null : c
- },
- overrideMimeType: function(a) {
- return u || (m.mimeType = a), this
- },
- abort: function(a) {
- return a = a || v, h && h.abort(a), d(0, a), this
- }
- };
- if (p.promise(w), w.success = w.done, w.error = w.fail, w.complete = q.add, w.statusCode = function(a) {
- if (a) {
- var b;
- if (u < 2)
- for (b in a) r[b] = [r[b], a[b]];
- else b = a[w.status], w.always(b)
- }
- return this
- }, m.url = ((a || m.url) + "").replace(Ab, "").replace(Eb, zb[1] + "//"), m.dataTypes = $.trim(m.dataType || "*").toLowerCase().split(ba), null == m.crossDomain && (j = Ib.exec(m.url.toLowerCase()), m.crossDomain = !(!j || j[1] == zb[1] && j[2] == zb[2] && (j[3] || ("http:" === j[1] ? 80 : 443)) == (zb[3] || ("http:" === zb[1] ? 80 : 443)))), m.data && m.processData && "string" != typeof m.data && (m.data = $.param(m.data, m.traditional)), z(Kb, m, c, w), 2 === u) return w;
- if (k = m.global, m.type = m.type.toUpperCase(), m.hasContent = !Db.test(m.type), k && 0 === $.active++ && $.event.trigger("ajaxStart"), !m.hasContent && (m.data && (m.url += (Fb.test(m.url) ? "&" : "?") + m.data, delete m.data), e = m.url, m.cache === !1)) {
- var x = $.now(),
- y = m.url.replace(Hb, "$1_=" + x);
- m.url = y + (y === m.url ? (Fb.test(m.url) ? "&" : "?") + "_=" + x : "")
- }(m.data && m.hasContent && m.contentType !== !1 || c.contentType) && w.setRequestHeader("Content-Type", m.contentType), m.ifModified && (e = e || m.url, $.lastModified[e] && w.setRequestHeader("If-Modified-Since", $.lastModified[e]), $.etag[e] && w.setRequestHeader("If-None-Match", $.etag[e])), w.setRequestHeader("Accept", m.dataTypes[0] && m.accepts[m.dataTypes[0]] ? m.accepts[m.dataTypes[0]] + ("*" !== m.dataTypes[0] ? ", " + Mb + "; q=0.01" : "") : m.accepts["*"]);
- for (l in m.headers) w.setRequestHeader(l, m.headers[l]);
- if (!m.beforeSend || m.beforeSend.call(n, w, m) !== !1 && 2 !== u) {
- v = "abort";
- for (l in {
- success: 1,
- error: 1,
- complete: 1
- }) w[l](m[l]);
- if (h = z(Lb, m, c, w)) {
- w.readyState = 1, k && o.trigger("ajaxSend", [w, m]), m.async && m.timeout > 0 && (i = setTimeout(function() {
- w.abort("timeout")
- }, m.timeout));
- try {
- u = 1, h.send(s, d)
- } catch (a) {
- if (!(u < 2)) throw a;
- d(-1, a)
- }
- } else d(-1, "No Transport");
- return w
- }
- return w.abort()
- },
- active: 0,
- lastModified: {},
- etag: {}
- });
- var Nb = [],
- Ob = /\?/,
- Pb = /(=)\?(?=&|$)|\?\?/,
- Qb = $.now();
- $.ajaxSetup({
- jsonp: "callback",
- jsonpCallback: function() {
- var a = Nb.pop() || $.expando + "_" + Qb++;
- return this[a] = !0, a
- }
- }), $.ajaxPrefilter("json jsonp", function(c, d, e) {
- var f, g, h, i = c.data,
- j = c.url,
- k = c.jsonp !== !1,
- l = k && Pb.test(j),
- m = k && !l && "string" == typeof i && !(c.contentType || "").indexOf("application/x-www-form-urlencoded") && Pb.test(i);
- if ("jsonp" === c.dataTypes[0] || l || m) return f = c.jsonpCallback = $.isFunction(c.jsonpCallback) ? c.jsonpCallback() : c.jsonpCallback, g = a[f], l ? c.url = j.replace(Pb, "$1" + f) : m ? c.data = i.replace(Pb, "$1" + f) : k && (c.url += (Ob.test(j) ? "&" : "?") + c.jsonp + "=" + f), c.converters["script json"] = function() {
- return h || $.error(f + " was not called"), h[0]
- }, c.dataTypes[0] = "json", a[f] = function() {
- h = arguments
- }, e.always(function() {
- a[f] = g, c[f] && (c.jsonpCallback = d.jsonpCallback, Nb.push(f)), h && $.isFunction(g) && g(h[0]), h = g = b
- }), "script"
- }), $.ajaxSetup({
- accepts: {
- script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
- },
- contents: {
- script: /javascript|ecmascript/
- },
- converters: {
- "text script": function(a) {
- return $.globalEval(a), a
- }
- }
- }), $.ajaxPrefilter("script", function(a) {
- a.cache === b && (a.cache = !1), a.crossDomain && (a.type = "GET", a.global = !1)
- }), $.ajaxTransport("script", function(a) {
- if (a.crossDomain) {
- var c, d = P.head || P.getElementsByTagName("head")[0] || P.documentElement;
- return {
- send: function(e, f) {
- c = P.createElement("script"), c.async = "async", a.scriptCharset && (c.charset = a.scriptCharset), c.src = a.url, c.onload = c.onreadystatechange = function(a, e) {
- (e || !c.readyState || /loaded|complete/.test(c.readyState)) && (c.onload = c.onreadystatechange = null, d && c.parentNode && d.removeChild(c), c = b, e || f(200, "success"))
- }, d.insertBefore(c, d.firstChild)
- },
- abort: function() {
- c && c.onload(0, 1)
- }
- }
- }
- });
- var Rb, Sb = !!a.ActiveXObject && function() {
- for (var a in Rb) Rb[a](0, 1)
- },
- Tb = 0;
- $.ajaxSettings.xhr = a.ActiveXObject ? function() {
- return !this.isLocal && D() || E();
- } : D,
- function(a) {
- $.extend($.support, {
- ajax: !!a,
- cors: !!a && "withCredentials" in a
- })
- }($.ajaxSettings.xhr()), $.support.ajax && $.ajaxTransport(function(c) {
- if (!c.crossDomain || $.support.cors) {
- var d;
- return {
- send: function(e, f) {
- var g, h, i = c.xhr();
- if (c.username ? i.open(c.type, c.url, c.async, c.username, c.password) : i.open(c.type, c.url, c.async), c.xhrFields)
- for (h in c.xhrFields) i[h] = c.xhrFields[h];
- c.mimeType && i.overrideMimeType && i.overrideMimeType(c.mimeType), !c.crossDomain && !e["X-Requested-With"] && (e["X-Requested-With"] = "XMLHttpRequest");
- try {
- for (h in e) i.setRequestHeader(h, e[h])
- } catch (a) {}
- i.send(c.hasContent && c.data || null), d = function(a, e) {
- var h, j, k, l, m;
- try {
- if (d && (e || 4 === i.readyState))
- if (d = b, g && (i.onreadystatechange = $.noop, Sb && delete Rb[g]), e) 4 !== i.readyState && i.abort();
- else {
- h = i.status, k = i.getAllResponseHeaders(), l = {}, m = i.responseXML, m && m.documentElement && (l.xml = m);
- try {
- l.text = i.responseText
- } catch (a) {}
- try {
- j = i.statusText
- } catch (a) {
- j = ""
- }
- h || !c.isLocal || c.crossDomain ? 1223 === h && (h = 204) : h = l.text ? 200 : 404
- }
- } catch (a) {
- e || f(-1, a)
- }
- l && f(h, j, l, k)
- }, c.async ? 4 === i.readyState ? setTimeout(d, 0) : (g = ++Tb, Sb && (Rb || (Rb = {}, $(a).unload(Sb)), Rb[g] = d), i.onreadystatechange = d) : d()
- },
- abort: function() {
- d && d(0, 1)
- }
- }
- }
- });
- var Ub, Vb, Wb = /^(?:toggle|show|hide)$/,
- Xb = new RegExp("^(?:([-+])=|)(" + _ + ")([a-z%]*)$", "i"),
- Yb = /queueHooks$/,
- Zb = [J],
- $b = {
- "*": [function(a, b) {
- var c, d, e, f = this.createTween(a, b),
- g = Xb.exec(b),
- h = f.cur(),
- i = +h || 0,
- j = 1;
- if (g) {
- if (c = +g[2], d = g[3] || ($.cssNumber[a] ? "" : "px"), "px" !== d && i) {
- i = $.css(f.elem, a, !0) || c || 1;
- do e = j = j || ".5", i /= j, $.style(f.elem, a, i + d), j = f.cur() / h; while (1 !== j && j !== e)
- }
- f.unit = d, f.start = i, f.end = g[1] ? i + (g[1] + 1) * c : c
- }
- return f
- }]
- };
- $.Animation = $.extend(H, {
- tweener: function(a, b) {
- $.isFunction(a) ? (b = a, a = ["*"]) : a = a.split(" ");
- for (var c, d = 0, e = a.length; d < e; d++) c = a[d], $b[c] = $b[c] || [], $b[c].unshift(b)
- },
- prefilter: function(a, b) {
- b ? Zb.unshift(a) : Zb.push(a)
- }
- }), $.Tween = K, K.prototype = {
- constructor: K,
- init: function(a, b, c, d, e, f) {
- this.elem = a, this.prop = c, this.easing = e || "swing", this.options = b, this.start = this.now = this.cur(), this.end = d, this.unit = f || ($.cssNumber[c] ? "" : "px")
- },
- cur: function() {
- var a = K.propHooks[this.prop];
- return a && a.get ? a.get(this) : K.propHooks._default.get(this)
- },
- run: function(a) {
- var b, c = K.propHooks[this.prop];
- return this.options.duration ? this.pos = b = $.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : this.pos = b = a, this.now = (this.end - this.start) * b + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), c && c.set ? c.set(this) : K.propHooks._default.set(this), this
- }
- }, K.prototype.init.prototype = K.prototype, K.propHooks = {
- _default: {
- get: function(a) {
- var b;
- return null == a.elem[a.prop] || a.elem.style && null != a.elem.style[a.prop] ? (b = $.css(a.elem, a.prop, !1, ""), b && "auto" !== b ? b : 0) : a.elem[a.prop]
- },
- set: function(a) {
- $.fx.step[a.prop] ? $.fx.step[a.prop](a) : a.elem.style && (null != a.elem.style[$.cssProps[a.prop]] || $.cssHooks[a.prop]) ? $.style(a.elem, a.prop, a.now + a.unit) : a.elem[a.prop] = a.now
- }
- }
- }, K.propHooks.scrollTop = K.propHooks.scrollLeft = {
- set: function(a) {
- a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now)
- }
- }, $.each(["toggle", "show", "hide"], function(a, b) {
- var c = $.fn[b];
- $.fn[b] = function(d, e, f) {
- return null == d || "boolean" == typeof d || !a && $.isFunction(d) && $.isFunction(e) ? c.apply(this, arguments) : this.animate(L(b, !0), d, e, f)
- }
- }), $.fn.extend({
- fadeTo: function(a, b, c, d) {
- return this.filter(r).css("opacity", 0).show().end().animate({
- opacity: b
- }, a, c, d)
- },
- animate: function(a, b, c, d) {
- var e = $.isEmptyObject(a),
- f = $.speed(b, c, d),
- g = function() {
- var b = H(this, $.extend({}, a), f);
- e && b.stop(!0)
- };
- return e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g)
- },
- stop: function(a, c, d) {
- var e = function(a) {
- var b = a.stop;
- delete a.stop, b(d)
- };
- return "string" != typeof a && (d = c, c = a, a = b), c && a !== !1 && this.queue(a || "fx", []), this.each(function() {
- var b = !0,
- c = null != a && a + "queueHooks",
- f = $.timers,
- g = $._data(this);
- if (c) g[c] && g[c].stop && e(g[c]);
- else
- for (c in g) g[c] && g[c].stop && Yb.test(c) && e(g[c]);
- for (c = f.length; c--;) f[c].elem === this && (null == a || f[c].queue === a) && (f[c].anim.stop(d), b = !1, f.splice(c, 1));
- (b || !d) && $.dequeue(this, a)
- })
- }
- }), $.each({
- slideDown: L("show"),
- slideUp: L("hide"),
- slideToggle: L("toggle"),
- fadeIn: {
- opacity: "show"
- },
- fadeOut: {
- opacity: "hide"
- },
- fadeToggle: {
- opacity: "toggle"
- }
- }, function(a, b) {
- $.fn[a] = function(a, c, d) {
- return this.animate(b, a, c, d)
- }
- }), $.speed = function(a, b, c) {
- var d = a && "object" == typeof a ? $.extend({}, a) : {
- complete: c || !c && b || $.isFunction(a) && a,
- duration: a,
- easing: c && b || b && !$.isFunction(b) && b
- };
- return d.duration = $.fx.off ? 0 : "number" == typeof d.duration ? d.duration : d.duration in $.fx.speeds ? $.fx.speeds[d.duration] : $.fx.speeds._default, null != d.queue && d.queue !== !0 || (d.queue = "fx"), d.old = d.complete, d.complete = function() {
- $.isFunction(d.old) && d.old.call(this), d.queue && $.dequeue(this, d.queue)
- }, d
- }, $.easing = {
- linear: function(a) {
- return a
- },
- swing: function(a) {
- return .5 - Math.cos(a * Math.PI) / 2
- }
- }, $.timers = [], $.fx = K.prototype.init, $.fx.tick = function() {
- for (var a, b = $.timers, c = 0; c < b.length; c++) a = b[c], !a() && b[c] === a && b.splice(c--, 1);
- b.length || $.fx.stop()
- }, $.fx.timer = function(a) {
- a() && $.timers.push(a) && !Vb && (Vb = setInterval($.fx.tick, $.fx.interval))
- }, $.fx.interval = 13, $.fx.stop = function() {
- clearInterval(Vb), Vb = null
- }, $.fx.speeds = {
- slow: 600,
- fast: 200,
- _default: 400
- }, $.fx.step = {}, $.expr && $.expr.filters && ($.expr.filters.animated = function(a) {
- return $.grep($.timers, function(b) {
- return a === b.elem
- }).length
- });
- var _b = /^(?:body|html)$/i;
- $.fn.offset = function(a) {
- if (arguments.length) return a === b ? this : this.each(function(b) {
- $.offset.setOffset(this, a, b)
- });
- var c, d, e, f, g, h, i, j, k, l, m = this[0],
- n = m && m.ownerDocument;
- if (n) return (e = n.body) === m ? $.offset.bodyOffset(m) : (d = n.documentElement, $.contains(d, m) ? (c = m.getBoundingClientRect(), f = M(n), g = d.clientTop || e.clientTop || 0, h = d.clientLeft || e.clientLeft || 0, i = f.pageYOffset || d.scrollTop, j = f.pageXOffset || d.scrollLeft, k = c.top + i - g, l = c.left + j - h, {
- top: k,
- left: l
- }) : {
- top: 0,
- left: 0
- })
- }, $.offset = {
- bodyOffset: function(a) {
- var b = a.offsetTop,
- c = a.offsetLeft;
- return $.support.doesNotIncludeMarginInBodyOffset && (b += parseFloat($.css(a, "marginTop")) || 0, c += parseFloat($.css(a, "marginLeft")) || 0), {
- top: b,
- left: c
- }
- },
- setOffset: function(a, b, c) {
- var d = $.css(a, "position");
- "static" === d && (a.style.position = "relative");
- var e, f, g = $(a),
- h = g.offset(),
- i = $.css(a, "top"),
- j = $.css(a, "left"),
- k = ("absolute" === d || "fixed" === d) && $.inArray("auto", [i, j]) > -1,
- l = {},
- m = {};
- k ? (m = g.position(), e = m.top, f = m.left) : (e = parseFloat(i) || 0, f = parseFloat(j) || 0), $.isFunction(b) && (b = b.call(a, c, h)), null != b.top && (l.top = b.top - h.top + e), null != b.left && (l.left = b.left - h.left + f), "using" in b ? b.using.call(a, l) : g.css(l)
- }
- }, $.fn.extend({
- position: function() {
- if (this[0]) {
- var a = this[0],
- b = this.offsetParent(),
- c = this.offset(),
- d = _b.test(b[0].nodeName) ? {
- top: 0,
- left: 0
- } : b.offset();
- return c.top -= parseFloat($.css(a, "marginTop")) || 0, c.left -= parseFloat($.css(a, "marginLeft")) || 0, d.top += parseFloat($.css(b[0], "borderTopWidth")) || 0, d.left += parseFloat($.css(b[0], "borderLeftWidth")) || 0, {
- top: c.top - d.top,
- left: c.left - d.left
- }
- }
- },
- offsetParent: function() {
- return this.map(function() {
- for (var a = this.offsetParent || P.body; a && !_b.test(a.nodeName) && "static" === $.css(a, "position");) a = a.offsetParent;
- return a || P.body
- })
- }
- }), $.each({
- scrollLeft: "pageXOffset",
- scrollTop: "pageYOffset"
- }, function(a, c) {
- var d = /Y/.test(c);
- $.fn[a] = function(e) {
- return $.access(this, function(a, e, f) {
- var g = M(a);
- return f === b ? g ? c in g ? g[c] : g.document.documentElement[e] : a[e] : void(g ? g.scrollTo(d ? $(g).scrollLeft() : f, d ? f : $(g).scrollTop()) : a[e] = f)
- }, a, e, arguments.length, null)
- }
- }), $.each({
- Height: "height",
- Width: "width"
- }, function(a, c) {
- $.each({
- padding: "inner" + a,
- content: c,
- "": "outer" + a
- }, function(d, e) {
- $.fn[e] = function(e, f) {
- var g = arguments.length && (d || "boolean" != typeof e),
- h = d || (e === !0 || f === !0 ? "margin" : "border");
- return $.access(this, function(c, d, e) {
- var f;
- return $.isWindow(c) ? c.document.documentElement["client" + a] : 9 === c.nodeType ? (f = c.documentElement, Math.max(c.body["scroll" + a], f["scroll" + a], c.body["offset" + a], f["offset" + a], f["client" + a])) : e === b ? $.css(c, d, e, h) : $.style(c, d, e, h)
- }, c, g ? e : b, g, null)
- }
- })
- }), a.jQuery = a.$ = $, "function" == typeof define && define.amd && define.amd.jQuery && define("jquery", [], function() {
- return $
- })
- }(window),
- function(a, b) {
- "object" == typeof module && "object" == typeof module.exports ? module.exports = b : a.CrossDomainLocalStorage = b
- }(this, function() {
- function a(a) {
- a = a || {}, this.keyPrefix = a.prefix || "", this.lifetime = a.lifetime || null, this.storage = xdLocalStorage
- }
- var b = [],
- c = !1;
- return a.prototype.isStorageExists = function() {
- return !!this.storage
- }, a.prototype.getFullKey = function(a) {
- return "" !== this.keyPrefix ? this.keyPrefix + "_" + a : a
- }, a.prototype.updateTimestamp = function(a) {
- this._getCachedObject(a, function(b) {
- b && this.setItem(a, b.data)
- }.bind(this))
- }, a.prototype._getCachedObject = function(a, b) {
- this.isStorageExists() && this.storage.getItem(this.getFullKey(a), function(c) {
- var d;
- try {
- d = JSON.parse(c.value)
- } catch (a) {
- d = null
- }
- return d && d.data && d.timestamp ? b(d) : (this.removeItem(a), b(null))
- }.bind(this), !0)
- }, a.prototype.getItem = function(a, b, c) {
- var d = 1e3 * (this.lifetime || 0);
- void 0 === c && (c = !0), this._getCachedObject(a, function(e) {
- if (!e) return b(null);
- var f = (new Date).getTime() - new Date(e.timestamp).getTime();
- return d && f > d ? (this.removeItem(a), b(null)) : (!c && this.updateTimestamp(a), b(e.data))
- }.bind(this))
- }, a.prototype.setItem = function(a, b) {
- var c;
- this.isStorageExists() && (c = {
- data: b || "",
- timestamp: new Date
- }, this.storage.setItem(this.getFullKey(a), JSON.stringify(c)))
- }, a.prototype.getObject = function(a, b, c) {
- this.getItem(a, function(a) {
- var c;
- try {
- c = JSON.parse(a)
- } catch (a) {
- c = null
- }
- b(c)
- }, c)
- }, a.prototype.setObject = function(a, b) {
- this.setItem(a, JSON.stringify(b))
- }, a.prototype.removeItem = function(a) {
- this.isStorageExists() && this.storage.removeItem(this.getFullKey(a))
- }, a.prototype.getFlash = function(a) {
- var b = this.getItem(a);
- return b && this.removeItem(a), b
- }, a.addCallback = function(a) {
- "function" == typeof a && (c ? a() : b.push(a))
- }, $(function() {
- xdLocalStorage.init({
- iframeUrl: Onliner.secureProjectUrl("gc", "/views/cross-domain-local-storage.html"),
- initCallback: function() {
- for (; b.length;) b.shift()();
- c = !0
- }
- })
- }), a
- }()),
- function(a, b) {
- "object" == typeof module && "object" == typeof module.exports ? module.exports = b : a.EventDispatcher = b
- }(this, function() {
- function a() {
- this.subscriptions = {}
- }
- return a.prototype.subscribe = function(a, b) {
- [].concat(a).forEach(function(a) {
- var c = this.subscriptions[a];
- "undefined" == typeof c && (c = this.subscriptions[a] = []), "function" == typeof b && c.push(b)
- }.bind(this))
- }, a.prototype.trigger = function(a) {
- var b = Array.prototype.splice.call(arguments, 1);
- [].concat(a).forEach(function(a) {
- var c = this.subscriptions[a];
- if ("undefined" != typeof c)
- for (var d in c) c[d].apply(null, b)
- }.bind(this))
- }, a.prototype.unsubscribe = function(a) {
- [].concat(a).forEach(function(a) {
- "undefined" != typeof this.subscriptions[a] && delete this.subscriptions[a]
- }.bind(this))
- }, a
- }()),
- function(a, b) {
- "object" == typeof module && "object" == typeof module.exports ? module.exports = b : a.URL = b
- }(this, function() {
- var a = {};
- return a.baseDomain = function() {
- return document.location.host.split(".").slice(-2).join(".")
- }(), a.projectDomain = function(b) {
- return b + "." + a.baseDomain
- }, a.projectUrl = function(b, c, d) {
- return c = c ? c.replace(/^\/*/, "/") : "", d = d || "http://", d + a.projectDomain(b) + c
- }, a.secureProjectUrl = function(b, c) {
- return a.projectUrl(b, c, "https://")
- }, a.redirect = function(a) {
- document.location.href = a
- }, a
- }()),
- function(a, b) {
- "object" == typeof module && "object" == typeof module.exports ? module.exports = b(window.jQuery) : a.Rest = b(window.jQuery)
- }(this, function(a) {
- function b(c) {
- this.options = {
- dataType: "json",
- contentType: "application/json",
- statusCode: {
- 400: function() {
- b.showErrorNotification("Что-то пошло не так")
- },
- 403: function() {
- b.showErrorNotification("ДоÑтуп запрещен. Войдите на Ñайт")
- },
- 404: function() {
- b.showErrorNotification("Что-то пошло не так")
- },
- 415: function() {
- b.showErrorNotification("Ðеподдерживаемый тип данных")
- },
- 500: function() {
- b.showErrorNotification("Ошибка Ñервера")
- },
- 501: function() {
- b.showErrorNotification("Ошибка Ñервера")
- },
- 502: function() {
- b.showErrorNotification("Ошибка Ñервера")
- },
- 503: function() {
- b.showErrorNotification("Ошибка Ñервера")
- },
- 504: function() {
- b.showErrorNotification("Ошибка Ñервера")
- }
- }
- }, a.extend(!0, this.options, c || {})
- }
- return b.prototype.query = function(b) {
- var c = {};
- return a.extend(!0, c, this.options, b), a.ajax(c)
- }, b.collectErrors = function(b, c) {
- var d, e = [];
- if (b.responseText) try {
- d = JSON.parse(b.responseText).errors
- } catch (a) {
- d = b.responseText
- } else d = b.errors;
- return d = d || c, a.isPlainObject(d) ? a.each(d, function(a, b) {
- e = e.concat(b)
- }) : e = e.concat(d), e
- }, b.showErrorNotification = function(b, c) {
- a.notifications.error(b, c)
- }, b
- }),
- function(a, b) {
- "object" == typeof module && "object" == typeof module.exports ? module.exports = b(require("jquery"), require("./url.js"), require("cookies-js"), require("base-64")) : a.Credentials = b(window.jQuery, window.URL, window.Cookies, window.base64)
- }(this, function(a, b, c, d) {
- function e(a) {
- this.dispatcher = a, this.token = null, this.tokenType = null, this.timer = null, this.functionsToExecute = [], this.request = null
- }
- return e.isAuth = function() {
- var a = window.MODELS && window.MODELS.currentUser || null;
- return !!c.get("onl_session") && !(!a || !a.id())
- }, e.prototype.executeFunctions = function() {
- for (var a = this.functionsToExecute || [], b = a.shift(); b;) "function" == typeof b && b(), b = a.shift()
- }, e.prototype.query = function(e) {
- var f = this,
- g = this.dispatcher;
- return this.token ? e && e() : (this.functionsToExecute.push(e), void(this.request || (this.request = a.ajax({
- type: "POST",
- url: b.secureProjectUrl("credentials.api", "/oauth/token"),
- contentType: "application/x-www-form-urlencoded",
- dataType: "json",
- data: {
- grant_type: "client_credentials"
- },
- headers: {
- Authorization: "Basic " + d.encode("onliner_user:" + c.get("onl_session"))
- }
- }), this.request.done(function(a) {
- var b = 1e3 * Math.max(a.expires_in - 60, 60);
- clearTimeout(f.timer), f.token = a.access_token, f.tokenType = a.token_type, f.timer = setTimeout(function() {
- f.token = null
- }, b), f.executeFunctions(), g && g.trigger("credentials:success", f.token)
- }), this.request.fail(function(a) {
- f.functionsToExecute = [], g && g.trigger("credentials:error", a)
- }), this.request.always(function() {
- f.request = null
- }))))
- }, e
- }),
- function(a, b) {
- "object" == typeof module && "object" == typeof module.exports ? (require("../../bower_components/growl/javascripts/jquery.growl.js"), b(window.jQuery)) : b(window.jQuery)
- }(this, function(a) {
- function b(b, d, e) {
- var f = {
- title: e || "",
- message: d || ""
- },
- g = a.growl[b];
- g && g(f, c)
- }
- var c = {
- fixed: !1,
- size: "medium",
- style: "default",
- delayOnHover: !0
- };
- a.notifications = {
- success: function(a, c) {
- b("notice", a, c)
- },
- error: function(a, c) {
- b("error", a, c)
- }
- }
- }),
- function() {
- window.Onliner = window.Onliner || {}, Onliner.documentCharset = function() {
- var a = $("head").find("meta[http-equiv=Content-Type][content]");
- return a && /windows-1251/.test(a.attr("content")) ? "windows-1251" : "utf-8"
- }(), Onliner.domain = function() {
- return document.location.host.split(".").pop()
- }(), Onliner.isCredentialsProblemInCORS = function() {
- return /^Opera.*Presto.*$/i.test(navigator.userAgent)
- }(), Onliner.isMobile = function() {
- return /Android|iPhone|iPad|iPod|IEMobile/i.test(navigator.userAgent)
- }(), Onliner.isIEMobile = function() {
- return "-ms-user-select" in document.documentElement.style && navigator.userAgent.match(/IEMobile/)
- }(), Onliner.isRetina = function() {
- return window.devicePixelRatio && window.devicePixelRatio >= 2
- }(), Onliner.baseDomain = function() {
- return document.location.host.split(".").slice(-2).join(".")
- }(), Onliner.projectDomain = function(a) {
- return a + "." + Onliner.baseDomain
- }, Onliner.projectUrl = function(a, b, c) {
- return b = b ? b.replace(/^\/*/, "/") : "", c = c || "http://", c + Onliner.projectDomain(a) + b
- }, Onliner.secureProjectUrl = function(a, b) {
- return Onliner.projectUrl(a, b, "https://")
- }, Onliner.urls = {
- profile: Onliner.secureProjectUrl("profile")
- }, Onliner.apiUrls = {
- user: Onliner.isCredentialsProblemInCORS ? "/sdapi/user.api" : Onliner.secureProjectUrl("user.api"),
- credentials: Onliner.secureProjectUrl("credentials.api"),
- upload: Onliner.secureProjectUrl("upload.api"),
- ak: Onliner.secureProjectUrl("ak.api"),
- catalog: Onliner.secureProjectUrl("catalog.api")
- }, Onliner.redirect = function(a) {
- a && (document.location.href = a)
- }, Onliner.reloadAfterAuth = function() {
- Onliner.dispatcher && Onliner.dispatcher.subscribe("auth:cart-merge:complete", function() {
- location.reload()
- })
- }, Onliner.redirectAfterAuth = function(a) {
- Onliner.dispatcher && Onliner.dispatcher.subscribe("auth:cart-merge:complete", function() {
- Onliner.redirect(a)
- })
- }, Onliner.executeAfterAuth = function(a) {
- Onliner.dispatcher && Onliner.dispatcher.subscribe("auth:cart-merge:complete", function() {
- a()
- })
- }, Onliner.inherit = function(a, b) {
- var c = function() {};
- c.prototype = b.prototype, a.prototype = new c, a.prototype.constructor = a, a.superclass = b.prototype
- }, window.EventDispatcher && (Onliner.dispatcher = new EventDispatcher)
- }(),
- function() {
- function a(a) {
- var b = this;
- this.fields = a, this.data = {}, $.each(a, function(a, c) {
- b.data[c] = ko.observable()
- }), this.errors = ko.observable({}), this.errorsArray = ko.computed(function() {
- var a = [];
- return $.each(b.errors(), function(b, c) {
- a = a.concat(c)
- }), a
- }), this.isProcessing = ko.observable(!1)
- }
- window.CLASSES = window.CLASSES || {}, a.prototype.clearData = function() {
- var a = this;
- $.each(this.fields, function(b, c) {
- a.data[c]("")
- })
- }, a.prototype.clearErrors = function(a) {
- if (!a) return void this.errors({});
- var b = this.errors();
- delete b[a], this.errors(b)
- }, CLASSES.AuthForm = a
- }(),
- function() {
- function a(a) {
- a = a || {};
- var b = a.driver || "sessionStorage";
- this.keyPrefix = a.prefix || "", this.lifetime = a.lifetime || null, this.storage = b in window ? window[b] : null
- }
- window.CLASSES = window.CLASSES || {}, a.prototype.isStorageExists = function() {
- return !!this.storage
- }, a.prototype.getFullKey = function(a) {
- return "" !== this.keyPrefix ? this.keyPrefix + "_" + a : a
- }, a.prototype.getItem = function(a) {
- var b, c, d, e;
- if (this.isStorageExists()) {
- b = this.storage.getItem(this.getFullKey(a)), e = this.lifetime;
- try {
- c = JSON.parse(b)
- } catch (a) {
- return null
- }
- return c && c.data && c.timestamp ? e ? (d = (new Date).getTime() - new Date(c.timestamp).getTime(), d < 1e3 * e ? c.data : null) : c.data : null
- }
- }, a.prototype.setItem = function(a, b) {
- var c;
- this.isStorageExists() && (c = {
- data: b || "",
- timestamp: new Date
- }, this.storage.setItem(this.getFullKey(a), JSON.stringify(c)))
- }, a.prototype.getObject = function(a) {
- try {
- return JSON.parse(this.getItem(a))
- } catch (a) {
- return null
- }
- }, a.prototype.setObject = function(a, b) {
- this.setItem(a, JSON.stringify(b))
- }, a.prototype.removeItem = function(a) {
- this.isStorageExists() && this.storage.removeItem(this.getFullKey(a))
- }, a.prototype.clear = function() {
- this.isStorageExists() && this.storage.clear()
- }, a.prototype.length = function() {
- return this.isStorageExists() ? this.storage.length : null
- }, a.prototype.getFlash = function(a) {
- var b = this.getItem(a);
- return b && this.removeItem(a), b
- }, CLASSES.Cache = a
- }(),
- function(a) {
- function b(e, f) {
- var g = b.instances[e];
- if (g) return g.open(), g;
- var h = {
- autoOpen: !0,
- closeButton: !0,
- closeOverlay: !1
- };
- a.extend(h, f || {}), this.$container = a('<div id="' + e + '" class="modal" role="dialog" aria-hidden="true"></div>'), this.$container.html('<div class="modal-dialog"><div class="modal-content"></div>' + (h.closeButton ? '<div class="modal-close" data-dismiss="modal"></div>' : "") + "</div>"), a("body").append(this.$container), h.autoOpen && this.open(), b.instances[e] = this, h.closeOverlay && this.$container.on("click", function() {
- b.closeAll()
- }), Onliner.isIEMobile && !a("#ms-viewport-style").length && (c.originalValue !== c.newValue ? d.$newTag.html(d.originalValue) : d.$newTag.html(d.newValue), a("head").append(d.$newTag))
- }
- window.CLASSES = window.CLASSES || {};
- var c = {},
- d = {};
- c.$metaTag = a("head").find("meta[name=viewport]:first"), c.newValue = "width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no", c.originalValue = c.$metaTag.length ? c.$metaTag.attr("content") : null, d.$newTag = a("<style/>", {
- id: "ms-viewport-style"
- }), d.newValue = "@-ms-viewport{width:device-width!important;}", d.originalValue = "@-ms-viewport{width:1150px!important;}", b.instances = {}, b.prototype.open = function(a) {
- b.setViewport(), this.$container.trigger("modal:open", a || {}).fadeIn(300)
- }, b.prototype.appendContent = function(a) {
- this.$container.find(".modal-content").append(a)
- }, b.closeAll = function() {
- b.restoreViewport(), a(".modal:visible").trigger("modal:close").hide()
- }, b.setViewport = function() {
- c.originalValue !== c.newValue && (c.$metaTag.length ? c.$metaTag.attr("content", c.newValue) : (c.$metaTag = a('<meta name="viewport" content="' + c.newValue + '"/>'), a("head").append(c.$metaTag)), Onliner.isIEMobile && d.$newTag.html(d.newValue)), a("body").addClass("modal-visible")
- }, b.restoreViewport = function() {
- a("body").removeClass("modal-visible"), c.originalValue !== c.newValue && (c.$metaTag && c.$metaTag.length && (c.originalValue ? c.$metaTag.attr("content", c.originalValue) : c.$metaTag.remove()), Onliner.isIEMobile && d.$newTag.html(d.originalValue))
- }, a(function() {
- a("body").on("click", "[data-dismiss=modal]", function() {
- b.closeAll()
- }), a("body").bind("keyup", function(a) {
- var c = a.keyCode || a.which;
- 27 === c && b.closeAll()
- })
- }), CLASSES.Modal = b
- }(jQuery),
- function() {
- function a() {
- var a = this;
- this.data = {
- token: ko.observable(),
- login: ko.observable(),
- password: ko.observable()
- }, this.errors = ko.observable({}), this.errorsArray = ko.computed(function() {
- var b = [];
- return $.each(a.errors(), function(a, c) {
- b = b.concat(c)
- }), b
- }), this.isProcessing = ko.observable(!1), this.data.login.subscribe(function(b) {
- b && a.clearErrors("login")
- }), this.data.password.subscribe(function(b) {
- b && a.clearErrors("password")
- }), this.callbacks = {
- success: function(a) {
- MODELS.AuthController.updateCurrentUserData(a.user), MODELS.AuthController.closeModals()
- }
- }
- }
- window.CLASSES = window.CLASSES || {}, a.prototype.isCaptchaVisible = ko.observable(!1), a.prototype.clearData = function(a) {
- return a ? void this.data[a]("") : (this.data.login(""), void this.data.password(""))
- }, a.prototype.clearErrors = function(a) {
- if (!a) return void this.errors({});
- var b = this.errors();
- delete b[a], this.errors(b)
- }, a.prototype.query = function() {
- var a, b = this;
- this.clearErrors(), this.isProcessing(!0), a = $.ajax({
- type: "POST",
- url: Onliner.apiUrls.user + "/login",
- data: JSON.stringify({
- token: this.data.token(),
- login: this.data.login(),
- password: this.data.password(),
- session_id: this.data.session_id || null,
- recaptcha_challenge_field: window.Recaptcha && Recaptcha.get_challenge(),
- recaptcha_response_field: window.Recaptcha && Recaptcha.get_response()
- }),
- dataType: "json",
- contentType: "application/json",
- xhrFields: {
- withCredentials: !0
- },
- headers: {
- "X-Accept-Charset": Onliner.documentCharset
- }
- }), a.done(function(a) {
- b.callbacks.success(a), Onliner.dispatcher && Onliner.dispatcher.trigger("auth:success", a)
- }), a.fail(function(a, c, d) {
- var e;
- b.isCaptchaVisible() && window.Recaptcha && Recaptcha.reload();
- try {
- e = JSON.parse(a.responseText)
- } catch (a) {}
- $.isPlainObject(e) && (e.captcha && b.isCaptchaVisible(e.captcha.show_at_login), b.errors(e.errors || {})), b.data.password(""), MODELS.AuthController.fieldFocus("login", "#auth"), MODELS.AuthController.fieldFocus("password", "#auth-additional-container__password"), Onliner.dispatcher && Onliner.dispatcher.trigger("auth:error")
- }), a.always(function() {
- b.isProcessing(!1), Onliner.dispatcher && Onliner.dispatcher.trigger("auth:complete")
- })
- }, CLASSES.OnlinerLogin = a
- }(),
- function() {
- function a() {
- var a = this;
- this.data = {
- token: ko.observable(),
- email: ko.observable(),
- password: ko.observable(),
- password_confirmation: ko.observable()
- }, this.errors = ko.observable({}), this.errorsArray = ko.computed(function() {
- var b = [];
- return $.each(a.errors(), function(a, c) {
- b = b.concat(c)
- }), b
- }), this.isProcessing = ko.observable(!1), this.data.email.subscribe(function(b) {
- b && a.clearErrors("email")
- }), this.data.password.subscribe(function(b) {
- b && a.clearErrors("password"), b && a.clearErrors("password_confirmation")
- }), this.data.password_confirmation.subscribe(function(b) {
- b && a.clearErrors("password"), b && a.clearErrors("password_confirmation")
- })
- }
- window.CLASSES = window.CLASSES || {}, a.prototype.clearData = function() {
- this.data.email(""), this.data.password(""), this.data.password_confirmation("")
- }, a.prototype.clearErrors = function(a) {
- if (!a) return void this.errors({});
- var b = this.errors();
- delete b[a], this.errors(b)
- }, a.prototype.query = function() {
- var a, b = this;
- this.clearErrors(), this.isProcessing(!0), a = $.ajax({
- type: "POST",
- url: Onliner.apiUrls.user + "/users",
- data: JSON.stringify({
- token: this.data.token(),
- email: this.data.email(),
- password: this.data.password(),
- password_confirmation: this.data.password_confirmation(),
- recaptcha_challenge_field: Recaptcha.get_challenge(),
- recaptcha_response_field: Recaptcha.get_response()
- }),
- dataType: "json",
- contentType: "application/json",
- xhrFields: {
- withCredentials: !0
- },
- headers: {
- "X-Accept-Charset": Onliner.documentCharset
- }
- }), a.done(function() {
- $("#auth-container__social, #auth-container__forms").hide(), $("#auth-container__msg").show()
- }), a.fail(function(a, c, d) {
- var e;
- try {
- e = JSON.parse(a.responseText)
- } catch (a) {}
- $.isPlainObject(e) && b.errors(e.errors || {}), Recaptcha && Recaptcha.reload(), MODELS.AuthController.fieldFocus("registration", "#auth")
- }), a.always(function() {
- b.isProcessing(!1)
- })
- }, CLASSES.OnlinerRegistration = a
- }(),
- function() {
- function a(a) {
- this.name = a, this.sessionId = null, this.url = ""
- }
- function b() {
- this.networks = {
- facebook: new a("facebook"),
- vkontakte: new a("vkontakte"),
- twitter: new a("twitter")
- }, this.user = {
- nickname: ko.observable(),
- email: ko.observable()
- }, this.currentNetwork = null, this.popupWindow = null, this.processStatusCallbacks = {
- logged_in: function(a) {
- MODELS.AuthController.updateCurrentUserData(a.user), MODELS.AuthController.closeModals()
- },
- email_required: function(a) {
- MODELS.AuthController.showModalAuthAdditional()
- },
- errors: function(a) {
- MODELS.AuthController.closeModals()
- },
- linked: function(a) {
- MODELS.AuthController.updateCurrentUserData(a.user), MODELS.AuthController.closeModals()
- },
- default: function(a) {}
- }
- }
- window.CLASSES = window.CLASSES || {}, b.prototype.auth = function(a, b) {
- var c, d = this,
- e = this.networks[a];
- if (e) {
- if (this.popupWindow && !this.popupWindow.closed) {
- if (this.currentNetwork && this.currentNetwork.name === e.name) return void this.popupWindow.focus();
- this.popupWindow.close(), clearInterval(c)
- }
- this.currentNetwork = e, this.popupWindow = window.open(e.url, "auth " + e.name, "width=656,height=377,menubar=no,toolbar=no,location=no,directories=no,status=no"), c = setInterval(function() {
- d.popupWindow.closed && (d.statusQuery(), clearInterval(c))
- }, 500)
- }
- }, b.prototype.statusQuery = function() {
- var a = this,
- b = $.ajax({
- url: Onliner.apiUrls.user + "/sessions/" + this.currentNetwork.sessionId,
- type: "GET",
- dataType: "json",
- contentType: "application/json",
- xhrFields: {
- withCredentials: !0
- },
- headers: {
- "X-Accept-Charset": Onliner.documentCharset
- }
- });
- b.done(function(b) {
- var c;
- b && (c = a.processStatusCallbacks[b.status] || a.processStatusCallbacks.default, c && c(b), "logged_in" !== b.status && "linked" !== b.status || Onliner.dispatcher && Onliner.dispatcher.trigger("networks-auth:success", b))
- }), b.fail(function(a) {
- 401 === a.status && window.location.reload(), Onliner.dispatcher && Onliner.dispatcher.trigger("networks-auth:error")
- }), b.always(function() {
- Onliner.dispatcher && Onliner.dispatcher.trigger("networks-auth:complete")
- })
- }, b.prototype.link = function(a) {
- if (this.currentNetwork) {
- var b = $.ajax({
- type: "GET",
- xhrFields: {
- withCredentials: !0
- },
- url: Onliner.apiUrls.user + "/sessions/" + this.currentNetwork.sessionId + "/link"
- });
- b.done(function() {
- a && a()
- })
- }
- }, b.prototype.sendEmail = function() {
- var a, b = this,
- c = this.emailForm;
- c && (c.clearErrors(), c.isProcessing(!0), a = $.ajax({
- type: "POST",
- url: Onliner.apiUrls.user + "/users/sessions/" + this.currentNetwork.sessionId,
- data: JSON.stringify({
- token: c.data.token,
- email: c.data.email()
- }),
- dataType: "json",
- contentType: "application/json",
- xhrFields: {
- withCredentials: !0
- },
- headers: {
- "X-Accept-Charset": Onliner.documentCharset
- }
- }), a.done(function() {
- $("#auth-additional-container__email").hide(), $("#auth-additional-container__password").hide(), $("#auth-additional-container__msg").show()
- }), a.fail(function(a) {
- var d;
- if (409 === a.status) {
- var d;
- b.user.email(c.data.email());
- try {
- d = JSON.parse(a.responseText)
- } catch (a) {}
- return $.isPlainObject(d) && b.user.nickname(d.nickname), $("#auth-additional-container__email").hide(), $("#auth-additional-container__password").show(), $("#auth-additional-container__msg").hide(), void MODELS.AuthController.fieldFocus("password", "#auth-additional-container__password")
- }
- try {
- d = JSON.parse(a.responseText)
- } catch (a) {}
- $.isPlainObject(d) && c.errors(d.errors || {}), MODELS.AuthController.fieldFocus("email", "#auth-additional-container__email")
- }), a.always(function() {
- c.isProcessing(!1)
- }))
- }, CLASSES.SocialNetworksAuth = b
- }(),
- function() {
- function a() {
- this.id = ko.observable(null), this.nickname = ko.observable(""), this.money = ko.observable(""), this.logout_key = ko.observable(""), this.newMessages = ko.observable(0), this.isSmsValidated = ko.observable(null)
- }
- window.CLASSES = window.CLASSES || {}, a.prototype.setData = function(a) {
- var b = this;
- a && ($.each(["id", "nickname", "money", "logout_key", "isSmsValidated"], function(c, d) {
- var e = a[d];
- void 0 !== e && b[d](e)
- }), this.getNewMessagesCount())
- }, a.prototype.getNewMessagesCount = function() {
- var a = this;
- $.ajax({
- type: "GET",
- url: "/sdapi/api/messages/unread",
- dataType: "text",
- success: function(b) {
- a.newMessages(parseInt(b))
- },
- error: function() {
- a.newMessages(0)
- }
- })
- }, CLASSES.User = a
- }(),
- function() {
- window.MODELS = window.MODELS || {};
- var a = {},
- b = null;
- a.showModalAuth = function() {
- return Onliner.isCredentialsProblemInCORS ? void Onliner.redirect(Onliner.urls.profile + "/login?redirect=" + encodeURIComponent(document.location.href)) : (b = new CLASSES.Modal("modal-auth"), b.appendContent('<div id="auth-container"></div>'), this.getAuthTemplate("#auth-container"), void(this.showModalAuth = function(c) {
- b.open(), MODELS.onlinerAuth && a.fieldFocus(MODELS.onlinerAuth.openedTab(), "#auth"), c && MODELS.onlinerAuth.openedTab(c)
- }))
- }, a.showModalAuthAdditional = function() {
- b = new CLASSES.Modal("modal-auth"), b.appendContent('<div id="auth-additional-container"></div>'), this.getAdditionalTemplate("#auth-additional-container"), $("#auth-container").hide(), this.showModalAuthAdditional = function() {
- $("#auth-container").hide(), $("#auth-additional-container").show(), this.showPasswordCaptcha && this.showPasswordCaptcha(), b.open(), a.fieldFocus("email", "#auth-additional-container__email")
- }
- }, a.getAuthTemplate = function(a, b) {
- this.getTemplate(Onliner.apiUrls.user + "/login", a, b)
- }, a.getAdditionalTemplate = function(a, b) {
- var c = MODELS.socialNetworksAuth.currentNetwork.sessionId;
- this.getTemplate(Onliner.apiUrls.user + "/users/sessions/" + c, a, b)
- }, a.getTemplate = function(a, b, c) {
- var d, e = $('<div class="auth__loader"></div>'),
- f = $(b);
- f.append(e), d = $.ajax({
- type: "GET",
- url: a,
- dataType: "html",
- xhrFields: {
- withCredentials: !0
- },
- headers: {
- "X-Accept-Charset": Onliner.documentCharset
- }
- }), d.done(function(a) {
- e.hide(), f.append(a), c && c()
- })
- }, a.updateCurrentUserData = function(a) {
- MODELS.currentUser.setData(a)
- }, a.closeModals = function() {
- CLASSES.Modal.closeAll()
- }, a.fieldFocus = function(a, b) {
- if (!Onliner.isMobile) {
- var c = $((b || "") + ' [data-field="' + a + '"]'),
- d = c.filter(".is-error"),
- e = $("#recaptcha_response_field");
- (d.length ? d : c).first().trigger("focus"), e.hasClass("is-error") && e.trigger("focus")
- }
- }, a.showCaptcha = function(a, b) {
- function c(a, b) {
- $(".auth-box__captcha-primary").parent().empty(), $("#" + b).html(d), Recaptcha.create(a, b, {
- theme: "custom",
- custom_theme_widget: b
- })
- }
- var d = this.recaptchaTemplate || "";
- window.Recaptcha ? c(a, b) : $.getScript("https://www.google.com/recaptcha/api/js/recaptcha_ajax.js").done(function() {
- Recaptcha.focus_response_field = function() {}, c(a, b)
- })
- }, MODELS.AuthController = a
- }(),
- function() {
- window.MODELS = window.MODELS || {}, MODELS.currentUser = new CLASSES.User
- }(),
- function() {
- window.MODELS = window.MODELS || {}, MODELS.onlinerLogin = new CLASSES.OnlinerLogin
- }(),
- function() {
- window.MODELS = window.MODELS || {}, MODELS.onlinerRegistration = new CLASSES.OnlinerRegistration
- }(),
- function() {
- window.MODELS = window.MODELS || {}, MODELS.socialNetworksAuth = new CLASSES.SocialNetworksAuth
- }(),
- function(a, b) {
- "object" == typeof module && "object" == typeof module.exports ? module.exports = b(require("knockout"), require("underscore"), require("../modules/CrossDomainLocalStorage.js")) : a.CartPositionsCache = b(window.ko, window._, window.CrossDomainLocalStorage)
- }(this, function(a, b, c) {
- function d() {
- this.cache = new c({
- prefix: "cart",
- lifetime: 2592e3
- }), this.maxPositions = 50, this.maxQuantity = 10
- }
- return d.prototype.getPositionsSummary = function(a) {
- var a = a || {};
- this.getPositions({
- success: function(b) {
- var c = {};
- c.total = {
- quantity: b && b.length || 0
- }, a.success && a.success(c)
- }
- })
- }, d.prototype.clearPositions = function() {
- this.cache.removeItem("positions")
- }, d.prototype.getPositions = function(a, b) {
- var a = a || {};
- a.success = a.success || function() {}, this.cache.getObject("positions", a.success, b)
- }, d
- }),
- function(a, b) {
- "object" == typeof module && "object" == typeof module.exports ? module.exports = b(require("knockout"), require("../modules/Credentials.js"), require("../modules/url.js")) : a.CartPositionsServer = b(window.ko, window.Credentials, window.URL)
- }(this, function(a, b, c) {
- function d() {
- this.credentials = new b, this.url = c.secureProjectUrl("cart.api");
- }
- var e = MODELS && MODELS.currentUser || null;
- return d.prototype.getPositionsSummary = function(a) {
- return this._getPositionsSummary(a)
- }, d.prototype.mergePositions = function(a, b) {
- return this.credentials.query(this._mergePositions.bind(this, a, b))
- }, d.prototype._getPositionsSummary = function(a) {
- var b = e && e.id() || null;
- return this._query({
- type: "GET",
- path: "/users/" + b + "/positions/summary",
- authorization: !1
- }, a)
- }, d.prototype._mergePositions = function(a, b) {
- return this._query({
- data: JSON.stringify({
- positions: a
- }),
- type: "POST",
- path: "/positions/merge",
- authorization: !0
- }, b)
- }, d.prototype._query = function(a, b) {
- var c, a = a || {},
- b = b || {};
- return c = $.ajax({
- url: this.url + (a.path || ""),
- type: a.type,
- data: a.data || {},
- dataType: "json",
- contentType: "application/json",
- headers: {
- Authorization: a.authorization ? this.credentials.tokenType + " " + this.credentials.token : null
- }
- }), c.done(function() {
- b.success && b.success.apply(null, arguments)
- }), c.fail(function() {
- b.error && b.error.apply(null, arguments)
- }), c.always(function() {
- b.complete && b.complete.apply(null, arguments)
- }), c
- }, d
- }),
- function(a, b) {
- "object" == typeof module && "object" == typeof module.exports ? module.exports = b(require("./CartPositionsCache.js"), require("./CartPositionsServer.js"), require("../modules/Credentials.js")) : a.CartPositions = b(window.CartPositionsCache, window.CartPositionsServer, window.Credentials)
- }(this, function(a, b, c) {
- function d() {
- this.cartPositionsCache = new a, this.cartPositionsServer = new b
- }
- return d.prototype._getInstance = function() {
- return c.isAuth() ? this.cartPositionsServer : this.cartPositionsCache
- }, d.prototype.getPositionsSummary = function(a) {
- return this._getInstance().getPositionsSummary(a)
- }, d.prototype.mergePositions = function(a) {
- this.cartPositionsCache.getPositions({
- success: function(b) {
- return Onliner.dispatcher && Onliner.dispatcher.trigger("cart:merge:start"), b && b.length ? void this.cartPositionsServer.mergePositions(b, {
- success: function() {
- this.cartPositionsCache.clearPositions(), Onliner.dispatcher && Onliner.dispatcher.trigger("cart:merge:success")
- }.bind(this),
- error: function(a) {
- 422 === a.status && this.cartPositionsCache.clearPositions(), Onliner.dispatcher && Onliner.dispatcher.trigger("cart:merge:error")
- }.bind(this),
- complete: function() {
- a && a(), Onliner.dispatcher && Onliner.dispatcher.trigger("cart:merge:complete")
- }
- }) : (a && a(), Onliner.dispatcher && Onliner.dispatcher.trigger("cart:merge:success"), void(Onliner.dispatcher && Onliner.dispatcher.trigger("cart:merge:complete")))
- }.bind(this)
- })
- }, d
- }),
- function() {
- Onliner.dispatcher && Onliner.dispatcher.subscribe(["auth:success", "networks-auth:success"], function() {
- var a = new CartPositions;
- a.mergePositions(function() {
- Onliner.dispatcher && Onliner.dispatcher.trigger("auth:cart-merge:complete")
- })
- })
- }();
Add Comment
Please, Sign In to add comment