Advertisement
Guest User

Untitled

a guest
May 14th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 450.63 KB | None | 0 0
  1. ! function(a, b) {
  2. "object" == typeof module && "object" == typeof module.exports ? module.exports = a.document ? b(a, !0) : function(a) {
  3. if (!a.document) throw new Error("jQuery requires a window with a document");
  4. return b(a)
  5. } : b(a)
  6. }("undefined" != typeof window ? window : this, function(a, b) {
  7. var c = [],
  8. d = a.document,
  9. e = c.slice,
  10. f = c.concat,
  11. g = c.push,
  12. h = c.indexOf,
  13. i = {},
  14. j = i.toString,
  15. k = i.hasOwnProperty,
  16. l = {},
  17. m = "1.12.4",
  18. n = function(a, b) {
  19. return new n.fn.init(a, b)
  20. },
  21. o = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
  22. p = /^-ms-/,
  23. q = /-([\da-z])/gi,
  24. r = function(a, b) {
  25. return b.toUpperCase()
  26. };
  27. n.fn = n.prototype = {
  28. jquery: m,
  29. constructor: n,
  30. selector: "",
  31. length: 0,
  32. toArray: function() {
  33. return e.call(this)
  34. },
  35. get: function(a) {
  36. return null != a ? 0 > a ? this[a + this.length] : this[a] : e.call(this)
  37. },
  38. pushStack: function(a) {
  39. var b = n.merge(this.constructor(), a);
  40. return b.prevObject = this, b.context = this.context, b
  41. },
  42. each: function(a) {
  43. return n.each(this, a)
  44. },
  45. map: function(a) {
  46. return this.pushStack(n.map(this, function(b, c) {
  47. return a.call(b, c, b)
  48. }))
  49. },
  50. slice: function() {
  51. return this.pushStack(e.apply(this, arguments))
  52. },
  53. first: function() {
  54. return this.eq(0)
  55. },
  56. last: function() {
  57. return this.eq(-1)
  58. },
  59. eq: function(a) {
  60. var b = this.length,
  61. c = +a + (0 > a ? b : 0);
  62. return this.pushStack(c >= 0 && b > c ? [this[c]] : [])
  63. },
  64. end: function() {
  65. return this.prevObject || this.constructor()
  66. },
  67. push: g,
  68. sort: c.sort,
  69. splice: c.splice
  70. }, n.extend = n.fn.extend = function() {
  71. var a, b, c, d, e, f, g = arguments[0] || {},
  72. h = 1,
  73. i = arguments.length,
  74. j = !1;
  75. for ("boolean" == typeof g && (j = g, g = arguments[h] || {}, h++), "object" == typeof g || n.isFunction(g) || (g = {}), h === i && (g = this, h--); i > h; h++)
  76. if (null != (e = arguments[h]))
  77. for (d in e) a = g[d], c = e[d], g !== c && (j && c && (n.isPlainObject(c) || (b = n.isArray(c))) ? (b ? (b = !1, f = a && n.isArray(a) ? a : []) : f = a && n.isPlainObject(a) ? a : {}, g[d] = n.extend(j, f, c)) : void 0 !== c && (g[d] = c));
  78. return g
  79. }, n.extend({
  80. expando: "jQuery" + (m + Math.random()).replace(/\D/g, ""),
  81. isReady: !0,
  82. error: function(a) {
  83. throw new Error(a)
  84. },
  85. noop: function() {},
  86. isFunction: function(a) {
  87. return "function" === n.type(a)
  88. },
  89. isArray: Array.isArray || function(a) {
  90. return "array" === n.type(a)
  91. },
  92. isWindow: function(a) {
  93. return null != a && a == a.window
  94. },
  95. isNumeric: function(a) {
  96. var b = a && a.toString();
  97. return !n.isArray(a) && b - parseFloat(b) + 1 >= 0
  98. },
  99. isEmptyObject: function(a) {
  100. var b;
  101. for (b in a) return !1;
  102. return !0
  103. },
  104. isPlainObject: function(a) {
  105. var b;
  106. if (!a || "object" !== n.type(a) || a.nodeType || n.isWindow(a)) return !1;
  107. try {
  108. if (a.constructor && !k.call(a, "constructor") && !k.call(a.constructor.prototype, "isPrototypeOf")) return !1
  109. } catch (c) {
  110. return !1
  111. }
  112. if (!l.ownFirst)
  113. for (b in a) return k.call(a, b);
  114. for (b in a);
  115. return void 0 === b || k.call(a, b)
  116. },
  117. type: function(a) {
  118. return null == a ? a + "" : "object" == typeof a || "function" == typeof a ? i[j.call(a)] || "object" : typeof a
  119. },
  120. globalEval: function(b) {
  121. b && n.trim(b) && (a.execScript || function(b) {
  122. a.eval.call(a, b)
  123. })(b)
  124. },
  125. camelCase: function(a) {
  126. return a.replace(p, "ms-").replace(q, r)
  127. },
  128. nodeName: function(a, b) {
  129. return a.nodeName && a.nodeName.toLowerCase() === b.toLowerCase()
  130. },
  131. each: function(a, b) {
  132. var c, d = 0;
  133. if (s(a)) {
  134. for (c = a.length; c > d; d++)
  135. if (b.call(a[d], d, a[d]) === !1) break
  136. } else
  137. for (d in a)
  138. if (b.call(a[d], d, a[d]) === !1) break;
  139. return a
  140. },
  141. trim: function(a) {
  142. return null == a ? "" : (a + "").replace(o, "")
  143. },
  144. makeArray: function(a, b) {
  145. var c = b || [];
  146. return null != a && (s(Object(a)) ? n.merge(c, "string" == typeof a ? [a] : a) : g.call(c, a)), c
  147. },
  148. inArray: function(a, b, c) {
  149. var d;
  150. if (b) {
  151. if (h) return h.call(b, a, c);
  152. for (d = b.length, c = c ? 0 > c ? Math.max(0, d + c) : c : 0; d > c; c++)
  153. if (c in b && b[c] === a) return c
  154. }
  155. return -1
  156. },
  157. merge: function(a, b) {
  158. var c = +b.length,
  159. d = 0,
  160. e = a.length;
  161. while (c > d) a[e++] = b[d++];
  162. if (c !== c)
  163. while (void 0 !== b[d]) a[e++] = b[d++];
  164. return a.length = e, a
  165. },
  166. grep: function(a, b, c) {
  167. for (var d, e = [], f = 0, g = a.length, h = !c; g > f; f++) d = !b(a[f], f), d !== h && e.push(a[f]);
  168. return e
  169. },
  170. map: function(a, b, c) {
  171. var d, e, g = 0,
  172. h = [];
  173. if (s(a))
  174. for (d = a.length; d > g; g++) e = b(a[g], g, c), null != e && h.push(e);
  175. else
  176. for (g in a) e = b(a[g], g, c), null != e && h.push(e);
  177. return f.apply([], h)
  178. },
  179. guid: 1,
  180. proxy: function(a, b) {
  181. var c, d, f;
  182. return "string" == typeof b && (f = a[b], b = a, a = f), n.isFunction(a) ? (c = e.call(arguments, 2), d = function() {
  183. return a.apply(b || this, c.concat(e.call(arguments)))
  184. }, d.guid = a.guid = a.guid || n.guid++, d) : void 0
  185. },
  186. now: function() {
  187. return +new Date
  188. },
  189. support: l
  190. }), "function" == typeof Symbol && (n.fn[Symbol.iterator] = c[Symbol.iterator]), n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function(a, b) {
  191. i["[object " + b + "]"] = b.toLowerCase()
  192. });
  193.  
  194. function s(a) {
  195. var b = !!a && "length" in a && a.length,
  196. c = n.type(a);
  197. return "function" === c || n.isWindow(a) ? !1 : "array" === c || 0 === b || "number" == typeof b && b > 0 && b - 1 in a
  198. }
  199. var t = function(a) {
  200. var b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u = "sizzle" + 1 * new Date,
  201. v = a.document,
  202. w = 0,
  203. x = 0,
  204. y = ga(),
  205. z = ga(),
  206. A = ga(),
  207. B = function(a, b) {
  208. return a === b && (l = !0), 0
  209. },
  210. C = 1 << 31,
  211. D = {}.hasOwnProperty,
  212. E = [],
  213. F = E.pop,
  214. G = E.push,
  215. H = E.push,
  216. I = E.slice,
  217. J = function(a, b) {
  218. for (var c = 0, d = a.length; d > c; c++)
  219. if (a[c] === b) return c;
  220. return -1
  221. },
  222. K = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  223. L = "[\\x20\\t\\r\\n\\f]",
  224. M = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
  225. N = "\\[" + L + "*(" + M + ")(?:" + L + "*([*^$|!~]?=)" + L + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + M + "))|)" + L + "*\\]",
  226. O = ":(" + M + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + N + ")*)|.*)\\)|)",
  227. P = new RegExp(L + "+", "g"),
  228. Q = new RegExp("^" + L + "+|((?:^|[^\\\\])(?:\\\\.)*)" + L + "+$", "g"),
  229. R = new RegExp("^" + L + "*," + L + "*"),
  230. S = new RegExp("^" + L + "*([>+~]|" + L + ")" + L + "*"),
  231. T = new RegExp("=" + L + "*([^\\]'\"]*?)" + L + "*\\]", "g"),
  232. U = new RegExp(O),
  233. V = new RegExp("^" + M + "$"),
  234. W = {
  235. ID: new RegExp("^#(" + M + ")"),
  236. CLASS: new RegExp("^\\.(" + M + ")"),
  237. TAG: new RegExp("^(" + M + "|[*])"),
  238. ATTR: new RegExp("^" + N),
  239. PSEUDO: new RegExp("^" + O),
  240. CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + L + "*(even|odd|(([+-]|)(\\d*)n|)" + L + "*(?:([+-]|)" + L + "*(\\d+)|))" + L + "*\\)|)", "i"),
  241. bool: new RegExp("^(?:" + K + ")$", "i"),
  242. needsContext: new RegExp("^" + L + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + L + "*((?:-\\d)?\\d*)" + L + "*\\)|)(?=[^-]|$)", "i")
  243. },
  244. X = /^(?:input|select|textarea|button)$/i,
  245. Y = /^h\d$/i,
  246. Z = /^[^{]+\{\s*\[native \w/,
  247. $ = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  248. _ = /[+~]/,
  249. aa = /'|\\/g,
  250. ba = new RegExp("\\\\([\\da-f]{1,6}" + L + "?|(" + L + ")|.)", "ig"),
  251. ca = function(a, b, c) {
  252. var d = "0x" + b - 65536;
  253. return d !== d || c ? b : 0 > d ? String.fromCharCode(d + 65536) : String.fromCharCode(d >> 10 | 55296, 1023 & d | 56320)
  254. },
  255. da = function() {
  256. m()
  257. };
  258. try {
  259. H.apply(E = I.call(v.childNodes), v.childNodes), E[v.childNodes.length].nodeType
  260. } catch (ea) {
  261. H = {
  262. apply: E.length ? function(a, b) {
  263. G.apply(a, I.call(b))
  264. } : function(a, b) {
  265. var c = a.length,
  266. d = 0;
  267. while (a[c++] = b[d++]);
  268. a.length = c - 1
  269. }
  270. }
  271. }
  272.  
  273. function fa(a, b, d, e) {
  274. var f, h, j, k, l, o, r, s, w = b && b.ownerDocument,
  275. x = b ? b.nodeType : 9;
  276. if (d = d || [], "string" != typeof a || !a || 1 !== x && 9 !== x && 11 !== x) return d;
  277. if (!e && ((b ? b.ownerDocument || b : v) !== n && m(b), b = b || n, p)) {
  278. if (11 !== x && (o = $.exec(a)))
  279. if (f = o[1]) {
  280. if (9 === x) {
  281. if (!(j = b.getElementById(f))) return d;
  282. if (j.id === f) return d.push(j), d
  283. } else if (w && (j = w.getElementById(f)) && t(b, j) && j.id === f) return d.push(j), d
  284. } else {
  285. if (o[2]) return H.apply(d, b.getElementsByTagName(a)), d;
  286. if ((f = o[3]) && c.getElementsByClassName && b.getElementsByClassName) return H.apply(d, b.getElementsByClassName(f)), d
  287. }
  288. if (c.qsa && !A[a + " "] && (!q || !q.test(a))) {
  289. if (1 !== x) w = b, s = a;
  290. else if ("object" !== b.nodeName.toLowerCase()) {
  291. (k = b.getAttribute("id")) ? k = k.replace(aa, "\\$&"): b.setAttribute("id", k = u), r = g(a), h = r.length, l = V.test(k) ? "#" + k : "[id='" + k + "']";
  292. while (h--) r[h] = l + " " + qa(r[h]);
  293. s = r.join(","), w = _.test(a) && oa(b.parentNode) || b
  294. }
  295. if (s) try {
  296. return H.apply(d, w.querySelectorAll(s)), d
  297. } catch (y) {} finally {
  298. k === u && b.removeAttribute("id")
  299. }
  300. }
  301. }
  302. return i(a.replace(Q, "$1"), b, d, e)
  303. }
  304.  
  305. function ga() {
  306. var a = [];
  307.  
  308. function b(c, e) {
  309. return a.push(c + " ") > d.cacheLength && delete b[a.shift()], b[c + " "] = e
  310. }
  311. return b
  312. }
  313.  
  314. function ha(a) {
  315. return a[u] = !0, a
  316. }
  317.  
  318. function ia(a) {
  319. var b = n.createElement("div");
  320. try {
  321. return !!a(b)
  322. } catch (c) {
  323. return !1
  324. } finally {
  325. b.parentNode && b.parentNode.removeChild(b), b = null
  326. }
  327. }
  328.  
  329. function ja(a, b) {
  330. var c = a.split("|"),
  331. e = c.length;
  332. while (e--) d.attrHandle[c[e]] = b
  333. }
  334.  
  335. function ka(a, b) {
  336. var c = b && a,
  337. d = c && 1 === a.nodeType && 1 === b.nodeType && (~b.sourceIndex || C) - (~a.sourceIndex || C);
  338. if (d) return d;
  339. if (c)
  340. while (c = c.nextSibling)
  341. if (c === b) return -1;
  342. return a ? 1 : -1
  343. }
  344.  
  345. function la(a) {
  346. return function(b) {
  347. var c = b.nodeName.toLowerCase();
  348. return "input" === c && b.type === a
  349. }
  350. }
  351.  
  352. function ma(a) {
  353. return function(b) {
  354. var c = b.nodeName.toLowerCase();
  355. return ("input" === c || "button" === c) && b.type === a
  356. }
  357. }
  358.  
  359. function na(a) {
  360. return ha(function(b) {
  361. return b = +b, ha(function(c, d) {
  362. var e, f = a([], c.length, b),
  363. g = f.length;
  364. while (g--) c[e = f[g]] && (c[e] = !(d[e] = c[e]))
  365. })
  366. })
  367. }
  368.  
  369. function oa(a) {
  370. return a && "undefined" != typeof a.getElementsByTagName && a
  371. }
  372. c = fa.support = {}, f = fa.isXML = function(a) {
  373. var b = a && (a.ownerDocument || a).documentElement;
  374. return b ? "HTML" !== b.nodeName : !1
  375. }, m = fa.setDocument = function(a) {
  376. var b, e, g = a ? a.ownerDocument || a : v;
  377. return g !== n && 9 === g.nodeType && g.documentElement ? (n = g, o = n.documentElement, p = !f(n), (e = n.defaultView) && e.top !== e && (e.addEventListener ? e.addEventListener("unload", da, !1) : e.attachEvent && e.attachEvent("onunload", da)), c.attributes = ia(function(a) {
  378. return a.className = "i", !a.getAttribute("className")
  379. }), c.getElementsByTagName = ia(function(a) {
  380. return a.appendChild(n.createComment("")), !a.getElementsByTagName("*").length
  381. }), c.getElementsByClassName = Z.test(n.getElementsByClassName), c.getById = ia(function(a) {
  382. return o.appendChild(a).id = u, !n.getElementsByName || !n.getElementsByName(u).length
  383. }), c.getById ? (d.find.ID = function(a, b) {
  384. if ("undefined" != typeof b.getElementById && p) {
  385. var c = b.getElementById(a);
  386. return c ? [c] : []
  387. }
  388. }, d.filter.ID = function(a) {
  389. var b = a.replace(ba, ca);
  390. return function(a) {
  391. return a.getAttribute("id") === b
  392. }
  393. }) : (delete d.find.ID, d.filter.ID = function(a) {
  394. var b = a.replace(ba, ca);
  395. return function(a) {
  396. var c = "undefined" != typeof a.getAttributeNode && a.getAttributeNode("id");
  397. return c && c.value === b
  398. }
  399. }), d.find.TAG = c.getElementsByTagName ? function(a, b) {
  400. return "undefined" != typeof b.getElementsByTagName ? b.getElementsByTagName(a) : c.qsa ? b.querySelectorAll(a) : void 0
  401. } : function(a, b) {
  402. var c, d = [],
  403. e = 0,
  404. f = b.getElementsByTagName(a);
  405. if ("*" === a) {
  406. while (c = f[e++]) 1 === c.nodeType && d.push(c);
  407. return d
  408. }
  409. return f
  410. }, d.find.CLASS = c.getElementsByClassName && function(a, b) {
  411. return "undefined" != typeof b.getElementsByClassName && p ? b.getElementsByClassName(a) : void 0
  412. }, r = [], q = [], (c.qsa = Z.test(n.querySelectorAll)) && (ia(function(a) {
  413. o.appendChild(a).innerHTML = "<a id='" + u + "'></a><select id='" + u + "-\r\\' msallowcapture=''><option selected=''></option></select>", a.querySelectorAll("[msallowcapture^='']").length && q.push("[*^$]=" + L + "*(?:''|\"\")"), a.querySelectorAll("[selected]").length || q.push("\\[" + L + "*(?:value|" + K + ")"), a.querySelectorAll("[id~=" + u + "-]").length || q.push("~="), a.querySelectorAll(":checked").length || q.push(":checked"), a.querySelectorAll("a#" + u + "+*").length || q.push(".#.+[+~]")
  414. }), ia(function(a) {
  415. var b = n.createElement("input");
  416. b.setAttribute("type", "hidden"), a.appendChild(b).setAttribute("name", "D"), a.querySelectorAll("[name=d]").length && q.push("name" + L + "*[*^$|!~]?="), a.querySelectorAll(":enabled").length || q.push(":enabled", ":disabled"), a.querySelectorAll("*,:x"), q.push(",.*:")
  417. })), (c.matchesSelector = Z.test(s = o.matches || o.webkitMatchesSelector || o.mozMatchesSelector || o.oMatchesSelector || o.msMatchesSelector)) && ia(function(a) {
  418. c.disconnectedMatch = s.call(a, "div"), s.call(a, "[s!='']:x"), r.push("!=", O)
  419. }), q = q.length && new RegExp(q.join("|")), r = r.length && new RegExp(r.join("|")), b = Z.test(o.compareDocumentPosition), t = b || Z.test(o.contains) ? function(a, b) {
  420. var c = 9 === a.nodeType ? a.documentElement : a,
  421. d = b && b.parentNode;
  422. return a === d || !(!d || 1 !== d.nodeType || !(c.contains ? c.contains(d) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(d)))
  423. } : function(a, b) {
  424. if (b)
  425. while (b = b.parentNode)
  426. if (b === a) return !0;
  427. return !1
  428. }, B = b ? function(a, b) {
  429. if (a === b) return l = !0, 0;
  430. var d = !a.compareDocumentPosition - !b.compareDocumentPosition;
  431. return d ? d : (d = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1, 1 & d || !c.sortDetached && b.compareDocumentPosition(a) === d ? a === n || a.ownerDocument === v && t(v, a) ? -1 : b === n || b.ownerDocument === v && t(v, b) ? 1 : k ? J(k, a) - J(k, b) : 0 : 4 & d ? -1 : 1)
  432. } : function(a, b) {
  433. if (a === b) return l = !0, 0;
  434. var c, d = 0,
  435. e = a.parentNode,
  436. f = b.parentNode,
  437. g = [a],
  438. h = [b];
  439. if (!e || !f) return a === n ? -1 : b === n ? 1 : e ? -1 : f ? 1 : k ? J(k, a) - J(k, b) : 0;
  440. if (e === f) return ka(a, b);
  441. c = a;
  442. while (c = c.parentNode) g.unshift(c);
  443. c = b;
  444. while (c = c.parentNode) h.unshift(c);
  445. while (g[d] === h[d]) d++;
  446. return d ? ka(g[d], h[d]) : g[d] === v ? -1 : h[d] === v ? 1 : 0
  447. }, n) : n
  448. }, fa.matches = function(a, b) {
  449. return fa(a, null, null, b)
  450. }, fa.matchesSelector = function(a, b) {
  451. if ((a.ownerDocument || a) !== n && m(a), b = b.replace(T, "='$1']"), c.matchesSelector && p && !A[b + " "] && (!r || !r.test(b)) && (!q || !q.test(b))) try {
  452. var d = s.call(a, b);
  453. if (d || c.disconnectedMatch || a.document && 11 !== a.document.nodeType) return d
  454. } catch (e) {}
  455. return fa(b, n, null, [a]).length > 0
  456. }, fa.contains = function(a, b) {
  457. return (a.ownerDocument || a) !== n && m(a), t(a, b)
  458. }, fa.attr = function(a, b) {
  459. (a.ownerDocument || a) !== n && m(a);
  460. var e = d.attrHandle[b.toLowerCase()],
  461. f = e && D.call(d.attrHandle, b.toLowerCase()) ? e(a, b, !p) : void 0;
  462. return void 0 !== f ? f : c.attributes || !p ? a.getAttribute(b) : (f = a.getAttributeNode(b)) && f.specified ? f.value : null
  463. }, fa.error = function(a) {
  464. throw new Error("Syntax error, unrecognized expression: " + a)
  465. }, fa.uniqueSort = function(a) {
  466. var b, d = [],
  467. e = 0,
  468. f = 0;
  469. if (l = !c.detectDuplicates, k = !c.sortStable && a.slice(0), a.sort(B), l) {
  470. while (b = a[f++]) b === a[f] && (e = d.push(f));
  471. while (e--) a.splice(d[e], 1)
  472. }
  473. return k = null, a
  474. }, e = fa.getText = function(a) {
  475. var b, c = "",
  476. d = 0,
  477. f = a.nodeType;
  478. if (f) {
  479. if (1 === f || 9 === f || 11 === f) {
  480. if ("string" == typeof a.textContent) return a.textContent;
  481. for (a = a.firstChild; a; a = a.nextSibling) c += e(a)
  482. } else if (3 === f || 4 === f) return a.nodeValue
  483. } else
  484. while (b = a[d++]) c += e(b);
  485. return c
  486. }, d = fa.selectors = {
  487. cacheLength: 50,
  488. createPseudo: ha,
  489. match: W,
  490. attrHandle: {},
  491. find: {},
  492. relative: {
  493. ">": {
  494. dir: "parentNode",
  495. first: !0
  496. },
  497. " ": {
  498. dir: "parentNode"
  499. },
  500. "+": {
  501. dir: "previousSibling",
  502. first: !0
  503. },
  504. "~": {
  505. dir: "previousSibling"
  506. }
  507. },
  508. preFilter: {
  509. ATTR: function(a) {
  510. return a[1] = a[1].replace(ba, ca), a[3] = (a[3] || a[4] || a[5] || "").replace(ba, ca), "~=" === a[2] && (a[3] = " " + a[3] + " "), a.slice(0, 4)
  511. },
  512. CHILD: function(a) {
  513. return a[1] = a[1].toLowerCase(), "nth" === a[1].slice(0, 3) ? (a[3] || fa.error(a[0]), a[4] = +(a[4] ? a[5] + (a[6] || 1) : 2 * ("even" === a[3] || "odd" === a[3])), a[5] = +(a[7] + a[8] || "odd" === a[3])) : a[3] && fa.error(a[0]), a
  514. },
  515. PSEUDO: function(a) {
  516. var b, c = !a[6] && a[2];
  517. return W.CHILD.test(a[0]) ? null : (a[3] ? a[2] = a[4] || a[5] || "" : c && U.test(c) && (b = g(c, !0)) && (b = c.indexOf(")", c.length - b) - c.length) && (a[0] = a[0].slice(0, b), a[2] = c.slice(0, b)), a.slice(0, 3))
  518. }
  519. },
  520. filter: {
  521. TAG: function(a) {
  522. var b = a.replace(ba, ca).toLowerCase();
  523. return "*" === a ? function() {
  524. return !0
  525. } : function(a) {
  526. return a.nodeName && a.nodeName.toLowerCase() === b
  527. }
  528. },
  529. CLASS: function(a) {
  530. var b = y[a + " "];
  531. return b || (b = new RegExp("(^|" + L + ")" + a + "(" + L + "|$)")) && y(a, function(a) {
  532. return b.test("string" == typeof a.className && a.className || "undefined" != typeof a.getAttribute && a.getAttribute("class") || "")
  533. })
  534. },
  535. ATTR: function(a, b, c) {
  536. return function(d) {
  537. var e = fa.attr(d, a);
  538. return null == e ? "!=" === b : b ? (e += "", "=" === b ? e === c : "!=" === b ? e !== c : "^=" === b ? c && 0 === e.indexOf(c) : "*=" === b ? c && e.indexOf(c) > -1 : "$=" === b ? c && e.slice(-c.length) === c : "~=" === b ? (" " + e.replace(P, " ") + " ").indexOf(c) > -1 : "|=" === b ? e === c || e.slice(0, c.length + 1) === c + "-" : !1) : !0
  539. }
  540. },
  541. CHILD: function(a, b, c, d, e) {
  542. var f = "nth" !== a.slice(0, 3),
  543. g = "last" !== a.slice(-4),
  544. h = "of-type" === b;
  545. return 1 === d && 0 === e ? function(a) {
  546. return !!a.parentNode
  547. } : function(b, c, i) {
  548. var j, k, l, m, n, o, p = f !== g ? "nextSibling" : "previousSibling",
  549. q = b.parentNode,
  550. r = h && b.nodeName.toLowerCase(),
  551. s = !i && !h,
  552. t = !1;
  553. if (q) {
  554. if (f) {
  555. while (p) {
  556. m = b;
  557. while (m = m[p])
  558. if (h ? m.nodeName.toLowerCase() === r : 1 === m.nodeType) return !1;
  559. o = p = "only" === a && !o && "nextSibling"
  560. }
  561. return !0
  562. }
  563. if (o = [g ? q.firstChild : q.lastChild], g && s) {
  564. m = q, l = m[u] || (m[u] = {}), k = l[m.uniqueID] || (l[m.uniqueID] = {}), j = k[a] || [], n = j[0] === w && j[1], t = n && j[2], m = n && q.childNodes[n];
  565. while (m = ++n && m && m[p] || (t = n = 0) || o.pop())
  566. if (1 === m.nodeType && ++t && m === b) {
  567. k[a] = [w, n, t];
  568. break
  569. }
  570. } else if (s && (m = b, l = m[u] || (m[u] = {}), k = l[m.uniqueID] || (l[m.uniqueID] = {}), j = k[a] || [], n = j[0] === w && j[1], t = n), t === !1)
  571. while (m = ++n && m && m[p] || (t = n = 0) || o.pop())
  572. if ((h ? m.nodeName.toLowerCase() === r : 1 === m.nodeType) && ++t && (s && (l = m[u] || (m[u] = {}), k = l[m.uniqueID] || (l[m.uniqueID] = {}), k[a] = [w, t]), m === b)) break;
  573. return t -= e, t === d || t % d === 0 && t / d >= 0
  574. }
  575. }
  576. },
  577. PSEUDO: function(a, b) {
  578. var c, e = d.pseudos[a] || d.setFilters[a.toLowerCase()] || fa.error("unsupported pseudo: " + a);
  579. return e[u] ? e(b) : e.length > 1 ? (c = [a, a, "", b], d.setFilters.hasOwnProperty(a.toLowerCase()) ? ha(function(a, c) {
  580. var d, f = e(a, b),
  581. g = f.length;
  582. while (g--) d = J(a, f[g]), a[d] = !(c[d] = f[g])
  583. }) : function(a) {
  584. return e(a, 0, c)
  585. }) : e
  586. }
  587. },
  588. pseudos: {
  589. not: ha(function(a) {
  590. var b = [],
  591. c = [],
  592. d = h(a.replace(Q, "$1"));
  593. return d[u] ? ha(function(a, b, c, e) {
  594. var f, g = d(a, null, e, []),
  595. h = a.length;
  596. while (h--)(f = g[h]) && (a[h] = !(b[h] = f))
  597. }) : function(a, e, f) {
  598. return b[0] = a, d(b, null, f, c), b[0] = null, !c.pop()
  599. }
  600. }),
  601. has: ha(function(a) {
  602. return function(b) {
  603. return fa(a, b).length > 0
  604. }
  605. }),
  606. contains: ha(function(a) {
  607. return a = a.replace(ba, ca),
  608. function(b) {
  609. return (b.textContent || b.innerText || e(b)).indexOf(a) > -1
  610. }
  611. }),
  612. lang: ha(function(a) {
  613. return V.test(a || "") || fa.error("unsupported lang: " + a), a = a.replace(ba, ca).toLowerCase(),
  614. function(b) {
  615. var c;
  616. do
  617. if (c = p ? b.lang : b.getAttribute("xml:lang") || b.getAttribute("lang")) return c = c.toLowerCase(), c === a || 0 === c.indexOf(a + "-"); while ((b = b.parentNode) && 1 === b.nodeType);
  618. return !1
  619. }
  620. }),
  621. target: function(b) {
  622. var c = a.location && a.location.hash;
  623. return c && c.slice(1) === b.id
  624. },
  625. root: function(a) {
  626. return a === o
  627. },
  628. focus: function(a) {
  629. return a === n.activeElement && (!n.hasFocus || n.hasFocus()) && !!(a.type || a.href || ~a.tabIndex)
  630. },
  631. enabled: function(a) {
  632. return a.disabled === !1
  633. },
  634. disabled: function(a) {
  635. return a.disabled === !0
  636. },
  637. checked: function(a) {
  638. var b = a.nodeName.toLowerCase();
  639. return "input" === b && !!a.checked || "option" === b && !!a.selected
  640. },
  641. selected: function(a) {
  642. return a.parentNode && a.parentNode.selectedIndex, a.selected === !0
  643. },
  644. empty: function(a) {
  645. for (a = a.firstChild; a; a = a.nextSibling)
  646. if (a.nodeType < 6) return !1;
  647. return !0
  648. },
  649. parent: function(a) {
  650. return !d.pseudos.empty(a)
  651. },
  652. header: function(a) {
  653. return Y.test(a.nodeName)
  654. },
  655. input: function(a) {
  656. return X.test(a.nodeName)
  657. },
  658. button: function(a) {
  659. var b = a.nodeName.toLowerCase();
  660. return "input" === b && "button" === a.type || "button" === b
  661. },
  662. text: function(a) {
  663. var b;
  664. return "input" === a.nodeName.toLowerCase() && "text" === a.type && (null == (b = a.getAttribute("type")) || "text" === b.toLowerCase())
  665. },
  666. first: na(function() {
  667. return [0]
  668. }),
  669. last: na(function(a, b) {
  670. return [b - 1]
  671. }),
  672. eq: na(function(a, b, c) {
  673. return [0 > c ? c + b : c]
  674. }),
  675. even: na(function(a, b) {
  676. for (var c = 0; b > c; c += 2) a.push(c);
  677. return a
  678. }),
  679. odd: na(function(a, b) {
  680. for (var c = 1; b > c; c += 2) a.push(c);
  681. return a
  682. }),
  683. lt: na(function(a, b, c) {
  684. for (var d = 0 > c ? c + b : c; --d >= 0;) a.push(d);
  685. return a
  686. }),
  687. gt: na(function(a, b, c) {
  688. for (var d = 0 > c ? c + b : c; ++d < b;) a.push(d);
  689. return a
  690. })
  691. }
  692. }, d.pseudos.nth = d.pseudos.eq;
  693. for (b in {
  694. radio: !0,
  695. checkbox: !0,
  696. file: !0,
  697. password: !0,
  698. image: !0
  699. }) d.pseudos[b] = la(b);
  700. for (b in {
  701. submit: !0,
  702. reset: !0
  703. }) d.pseudos[b] = ma(b);
  704.  
  705. function pa() {}
  706. pa.prototype = d.filters = d.pseudos, d.setFilters = new pa, g = fa.tokenize = function(a, b) {
  707. var c, e, f, g, h, i, j, k = z[a + " "];
  708. if (k) return b ? 0 : k.slice(0);
  709. h = a, i = [], j = d.preFilter;
  710. while (h) {
  711. c && !(e = R.exec(h)) || (e && (h = h.slice(e[0].length) || h), i.push(f = [])), c = !1, (e = S.exec(h)) && (c = e.shift(), f.push({
  712. value: c,
  713. type: e[0].replace(Q, " ")
  714. }), h = h.slice(c.length));
  715. for (g in d.filter) !(e = W[g].exec(h)) || j[g] && !(e = j[g](e)) || (c = e.shift(), f.push({
  716. value: c,
  717. type: g,
  718. matches: e
  719. }), h = h.slice(c.length));
  720. if (!c) break
  721. }
  722. return b ? h.length : h ? fa.error(a) : z(a, i).slice(0)
  723. };
  724.  
  725. function qa(a) {
  726. for (var b = 0, c = a.length, d = ""; c > b; b++) d += a[b].value;
  727. return d
  728. }
  729.  
  730. function ra(a, b, c) {
  731. var d = b.dir,
  732. e = c && "parentNode" === d,
  733. f = x++;
  734. return b.first ? function(b, c, f) {
  735. while (b = b[d])
  736. if (1 === b.nodeType || e) return a(b, c, f)
  737. } : function(b, c, g) {
  738. var h, i, j, k = [w, f];
  739. if (g) {
  740. while (b = b[d])
  741. if ((1 === b.nodeType || e) && a(b, c, g)) return !0
  742. } else
  743. while (b = b[d])
  744. if (1 === b.nodeType || e) {
  745. if (j = b[u] || (b[u] = {}), i = j[b.uniqueID] || (j[b.uniqueID] = {}), (h = i[d]) && h[0] === w && h[1] === f) return k[2] = h[2];
  746. if (i[d] = k, k[2] = a(b, c, g)) return !0
  747. }
  748. }
  749. }
  750.  
  751. function sa(a) {
  752. return a.length > 1 ? function(b, c, d) {
  753. var e = a.length;
  754. while (e--)
  755. if (!a[e](b, c, d)) return !1;
  756. return !0
  757. } : a[0]
  758. }
  759.  
  760. function ta(a, b, c) {
  761. for (var d = 0, e = b.length; e > d; d++) fa(a, b[d], c);
  762. return c
  763. }
  764.  
  765. function ua(a, b, c, d, e) {
  766. for (var f, g = [], h = 0, i = a.length, j = null != b; i > h; h++)(f = a[h]) && (c && !c(f, d, e) || (g.push(f), j && b.push(h)));
  767. return g
  768. }
  769.  
  770. function va(a, b, c, d, e, f) {
  771. return d && !d[u] && (d = va(d)), e && !e[u] && (e = va(e, f)), ha(function(f, g, h, i) {
  772. var j, k, l, m = [],
  773. n = [],
  774. o = g.length,
  775. p = f || ta(b || "*", h.nodeType ? [h] : h, []),
  776. q = !a || !f && b ? p : ua(p, m, a, h, i),
  777. r = c ? e || (f ? a : o || d) ? [] : g : q;
  778. if (c && c(q, r, h, i), d) {
  779. j = ua(r, n), d(j, [], h, i), k = j.length;
  780. while (k--)(l = j[k]) && (r[n[k]] = !(q[n[k]] = l))
  781. }
  782. if (f) {
  783. if (e || a) {
  784. if (e) {
  785. j = [], k = r.length;
  786. while (k--)(l = r[k]) && j.push(q[k] = l);
  787. e(null, r = [], j, i)
  788. }
  789. k = r.length;
  790. while (k--)(l = r[k]) && (j = e ? J(f, l) : m[k]) > -1 && (f[j] = !(g[j] = l))
  791. }
  792. } else r = ua(r === g ? r.splice(o, r.length) : r), e ? e(null, g, r, i) : H.apply(g, r)
  793. })
  794. }
  795.  
  796. function wa(a) {
  797. for (var b, c, e, f = a.length, g = d.relative[a[0].type], h = g || d.relative[" "], i = g ? 1 : 0, k = ra(function(a) {
  798. return a === b
  799. }, h, !0), l = ra(function(a) {
  800. return J(b, a) > -1
  801. }, h, !0), m = [function(a, c, d) {
  802. var e = !g && (d || c !== j) || ((b = c).nodeType ? k(a, c, d) : l(a, c, d));
  803. return b = null, e
  804. }]; f > i; i++)
  805. if (c = d.relative[a[i].type]) m = [ra(sa(m), c)];
  806. else {
  807. if (c = d.filter[a[i].type].apply(null, a[i].matches), c[u]) {
  808. for (e = ++i; f > e; e++)
  809. if (d.relative[a[e].type]) break;
  810. return va(i > 1 && sa(m), i > 1 && qa(a.slice(0, i - 1).concat({
  811. value: " " === a[i - 2].type ? "*" : ""
  812. })).replace(Q, "$1"), c, e > i && wa(a.slice(i, e)), f > e && wa(a = a.slice(e)), f > e && qa(a))
  813. }
  814. m.push(c)
  815. }
  816. return sa(m)
  817. }
  818.  
  819. function xa(a, b) {
  820. var c = b.length > 0,
  821. e = a.length > 0,
  822. f = function(f, g, h, i, k) {
  823. var l, o, q, r = 0,
  824. s = "0",
  825. t = f && [],
  826. u = [],
  827. v = j,
  828. x = f || e && d.find.TAG("*", k),
  829. y = w += null == v ? 1 : Math.random() || .1,
  830. z = x.length;
  831. for (k && (j = g === n || g || k); s !== z && null != (l = x[s]); s++) {
  832. if (e && l) {
  833. o = 0, g || l.ownerDocument === n || (m(l), h = !p);
  834. while (q = a[o++])
  835. if (q(l, g || n, h)) {
  836. i.push(l);
  837. break
  838. }
  839. k && (w = y)
  840. }
  841. c && ((l = !q && l) && r--, f && t.push(l))
  842. }
  843. if (r += s, c && s !== r) {
  844. o = 0;
  845. while (q = b[o++]) q(t, u, g, h);
  846. if (f) {
  847. if (r > 0)
  848. while (s--) t[s] || u[s] || (u[s] = F.call(i));
  849. u = ua(u)
  850. }
  851. H.apply(i, u), k && !f && u.length > 0 && r + b.length > 1 && fa.uniqueSort(i)
  852. }
  853. return k && (w = y, j = v), t
  854. };
  855. return c ? ha(f) : f
  856. }
  857. return h = fa.compile = function(a, b) {
  858. var c, d = [],
  859. e = [],
  860. f = A[a + " "];
  861. if (!f) {
  862. b || (b = g(a)), c = b.length;
  863. while (c--) f = wa(b[c]), f[u] ? d.push(f) : e.push(f);
  864. f = A(a, xa(e, d)), f.selector = a
  865. }
  866. return f
  867. }, i = fa.select = function(a, b, e, f) {
  868. var i, j, k, l, m, n = "function" == typeof a && a,
  869. o = !f && g(a = n.selector || a);
  870. if (e = e || [], 1 === o.length) {
  871. if (j = o[0] = o[0].slice(0), j.length > 2 && "ID" === (k = j[0]).type && c.getById && 9 === b.nodeType && p && d.relative[j[1].type]) {
  872. if (b = (d.find.ID(k.matches[0].replace(ba, ca), b) || [])[0], !b) return e;
  873. n && (b = b.parentNode), a = a.slice(j.shift().value.length)
  874. }
  875. i = W.needsContext.test(a) ? 0 : j.length;
  876. while (i--) {
  877. if (k = j[i], d.relative[l = k.type]) break;
  878. if ((m = d.find[l]) && (f = m(k.matches[0].replace(ba, ca), _.test(j[0].type) && oa(b.parentNode) || b))) {
  879. if (j.splice(i, 1), a = f.length && qa(j), !a) return H.apply(e, f), e;
  880. break
  881. }
  882. }
  883. }
  884. return (n || h(a, o))(f, b, !p, e, !b || _.test(a) && oa(b.parentNode) || b), e
  885. }, c.sortStable = u.split("").sort(B).join("") === u, c.detectDuplicates = !!l, m(), c.sortDetached = ia(function(a) {
  886. return 1 & a.compareDocumentPosition(n.createElement("div"))
  887. }), ia(function(a) {
  888. return a.innerHTML = "<a href='#'></a>", "#" === a.firstChild.getAttribute("href")
  889. }) || ja("type|href|height|width", function(a, b, c) {
  890. return c ? void 0 : a.getAttribute(b, "type" === b.toLowerCase() ? 1 : 2)
  891. }), c.attributes && ia(function(a) {
  892. return a.innerHTML = "<input/>", a.firstChild.setAttribute("value", ""), "" === a.firstChild.getAttribute("value")
  893. }) || ja("value", function(a, b, c) {
  894. return c || "input" !== a.nodeName.toLowerCase() ? void 0 : a.defaultValue
  895. }), ia(function(a) {
  896. return null == a.getAttribute("disabled")
  897. }) || ja(K, function(a, b, c) {
  898. var d;
  899. return c ? void 0 : a[b] === !0 ? b.toLowerCase() : (d = a.getAttributeNode(b)) && d.specified ? d.value : null
  900. }), fa
  901. }(a);
  902. n.find = t, n.expr = t.selectors, n.expr[":"] = n.expr.pseudos, n.uniqueSort = n.unique = t.uniqueSort, n.text = t.getText, n.isXMLDoc = t.isXML, n.contains = t.contains;
  903. var u = function(a, b, c) {
  904. var d = [],
  905. e = void 0 !== c;
  906. while ((a = a[b]) && 9 !== a.nodeType)
  907. if (1 === a.nodeType) {
  908. if (e && n(a).is(c)) break;
  909. d.push(a)
  910. }
  911. return d
  912. },
  913. v = function(a, b) {
  914. for (var c = []; a; a = a.nextSibling) 1 === a.nodeType && a !== b && c.push(a);
  915. return c
  916. },
  917. w = n.expr.match.needsContext,
  918. x = /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,
  919. y = /^.[^:#\[\.,]*$/;
  920.  
  921. function z(a, b, c) {
  922. if (n.isFunction(b)) return n.grep(a, function(a, d) {
  923. return !!b.call(a, d, a) !== c
  924. });
  925. if (b.nodeType) return n.grep(a, function(a) {
  926. return a === b !== c
  927. });
  928. if ("string" == typeof b) {
  929. if (y.test(b)) return n.filter(b, a, c);
  930. b = n.filter(b, a)
  931. }
  932. return n.grep(a, function(a) {
  933. return n.inArray(a, b) > -1 !== c
  934. })
  935. }
  936. n.filter = function(a, b, c) {
  937. var d = b[0];
  938. return c && (a = ":not(" + a + ")"), 1 === b.length && 1 === d.nodeType ? n.find.matchesSelector(d, a) ? [d] : [] : n.find.matches(a, n.grep(b, function(a) {
  939. return 1 === a.nodeType
  940. }))
  941. }, n.fn.extend({
  942. find: function(a) {
  943. var b, c = [],
  944. d = this,
  945. e = d.length;
  946. if ("string" != typeof a) return this.pushStack(n(a).filter(function() {
  947. for (b = 0; e > b; b++)
  948. if (n.contains(d[b], this)) return !0
  949. }));
  950. for (b = 0; e > b; b++) n.find(a, d[b], c);
  951. return c = this.pushStack(e > 1 ? n.unique(c) : c), c.selector = this.selector ? this.selector + " " + a : a, c
  952. },
  953. filter: function(a) {
  954. return this.pushStack(z(this, a || [], !1))
  955. },
  956. not: function(a) {
  957. return this.pushStack(z(this, a || [], !0))
  958. },
  959. is: function(a) {
  960. return !!z(this, "string" == typeof a && w.test(a) ? n(a) : a || [], !1).length
  961. }
  962. });
  963. var A, B = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
  964. C = n.fn.init = function(a, b, c) {
  965. var e, f;
  966. if (!a) return this;
  967. if (c = c || A, "string" == typeof a) {
  968. if (e = "<" === a.charAt(0) && ">" === a.charAt(a.length - 1) && a.length >= 3 ? [null, a, null] : B.exec(a), !e || !e[1] && b) return !b || b.jquery ? (b || c).find(a) : this.constructor(b).find(a);
  969. if (e[1]) {
  970. if (b = b instanceof n ? b[0] : b, n.merge(this, n.parseHTML(e[1], b && b.nodeType ? b.ownerDocument || b : d, !0)), x.test(e[1]) && n.isPlainObject(b))
  971. for (e in b) n.isFunction(this[e]) ? this[e](b[e]) : this.attr(e, b[e]);
  972. return this
  973. }
  974. if (f = d.getElementById(e[2]), f && f.parentNode) {
  975. if (f.id !== e[2]) return A.find(a);
  976. this.length = 1, this[0] = f
  977. }
  978. return this.context = d, this.selector = a, this
  979. }
  980. return a.nodeType ? (this.context = this[0] = a, this.length = 1, this) : n.isFunction(a) ? "undefined" != typeof c.ready ? c.ready(a) : a(n) : (void 0 !== a.selector && (this.selector = a.selector, this.context = a.context), n.makeArray(a, this))
  981. };
  982. C.prototype = n.fn, A = n(d);
  983. var D = /^(?:parents|prev(?:Until|All))/,
  984. E = {
  985. children: !0,
  986. contents: !0,
  987. next: !0,
  988. prev: !0
  989. };
  990. n.fn.extend({
  991. has: function(a) {
  992. var b, c = n(a, this),
  993. d = c.length;
  994. return this.filter(function() {
  995. for (b = 0; d > b; b++)
  996. if (n.contains(this, c[b])) return !0
  997. })
  998. },
  999. closest: function(a, b) {
  1000. for (var c, d = 0, e = this.length, f = [], g = w.test(a) || "string" != typeof a ? n(a, b || this.context) : 0; e > d; d++)
  1001. for (c = this[d]; c && c !== b; c = c.parentNode)
  1002. if (c.nodeType < 11 && (g ? g.index(c) > -1 : 1 === c.nodeType && n.find.matchesSelector(c, a))) {
  1003. f.push(c);
  1004. break
  1005. }
  1006. return this.pushStack(f.length > 1 ? n.uniqueSort(f) : f)
  1007. },
  1008. index: function(a) {
  1009. return a ? "string" == typeof a ? n.inArray(this[0], n(a)) : n.inArray(a.jquery ? a[0] : a, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1
  1010. },
  1011. add: function(a, b) {
  1012. return this.pushStack(n.uniqueSort(n.merge(this.get(), n(a, b))))
  1013. },
  1014. addBack: function(a) {
  1015. return this.add(null == a ? this.prevObject : this.prevObject.filter(a))
  1016. }
  1017. });
  1018.  
  1019. function F(a, b) {
  1020. do a = a[b]; while (a && 1 !== a.nodeType);
  1021. return a
  1022. }
  1023. n.each({
  1024. parent: function(a) {
  1025. var b = a.parentNode;
  1026. return b && 11 !== b.nodeType ? b : null
  1027. },
  1028. parents: function(a) {
  1029. return u(a, "parentNode")
  1030. },
  1031. parentsUntil: function(a, b, c) {
  1032. return u(a, "parentNode", c)
  1033. },
  1034. next: function(a) {
  1035. return F(a, "nextSibling")
  1036. },
  1037. prev: function(a) {
  1038. return F(a, "previousSibling")
  1039. },
  1040. nextAll: function(a) {
  1041. return u(a, "nextSibling")
  1042. },
  1043. prevAll: function(a) {
  1044. return u(a, "previousSibling")
  1045. },
  1046. nextUntil: function(a, b, c) {
  1047. return u(a, "nextSibling", c)
  1048. },
  1049. prevUntil: function(a, b, c) {
  1050. return u(a, "previousSibling", c)
  1051. },
  1052. siblings: function(a) {
  1053. return v((a.parentNode || {}).firstChild, a)
  1054. },
  1055. children: function(a) {
  1056. return v(a.firstChild)
  1057. },
  1058. contents: function(a) {
  1059. return n.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : n.merge([], a.childNodes)
  1060. }
  1061. }, function(a, b) {
  1062. n.fn[a] = function(c, d) {
  1063. var e = n.map(this, b, c);
  1064. return "Until" !== a.slice(-5) && (d = c), d && "string" == typeof d && (e = n.filter(d, e)), this.length > 1 && (E[a] || (e = n.uniqueSort(e)), D.test(a) && (e = e.reverse())), this.pushStack(e)
  1065. }
  1066. });
  1067. var G = /\S+/g;
  1068.  
  1069. function H(a) {
  1070. var b = {};
  1071. return n.each(a.match(G) || [], function(a, c) {
  1072. b[c] = !0
  1073. }), b
  1074. }
  1075. n.Callbacks = function(a) {
  1076. a = "string" == typeof a ? H(a) : n.extend({}, a);
  1077. var b, c, d, e, f = [],
  1078. g = [],
  1079. h = -1,
  1080. i = function() {
  1081. for (e = a.once, d = b = !0; g.length; h = -1) {
  1082. c = g.shift();
  1083. while (++h < f.length) f[h].apply(c[0], c[1]) === !1 && a.stopOnFalse && (h = f.length, c = !1)
  1084. }
  1085. a.memory || (c = !1), b = !1, e && (f = c ? [] : "")
  1086. },
  1087. j = {
  1088. add: function() {
  1089. return f && (c && !b && (h = f.length - 1, g.push(c)), function d(b) {
  1090. n.each(b, function(b, c) {
  1091. n.isFunction(c) ? a.unique && j.has(c) || f.push(c) : c && c.length && "string" !== n.type(c) && d(c)
  1092. })
  1093. }(arguments), c && !b && i()), this
  1094. },
  1095. remove: function() {
  1096. return n.each(arguments, function(a, b) {
  1097. var c;
  1098. while ((c = n.inArray(b, f, c)) > -1) f.splice(c, 1), h >= c && h--
  1099. }), this
  1100. },
  1101. has: function(a) {
  1102. return a ? n.inArray(a, f) > -1 : f.length > 0
  1103. },
  1104. empty: function() {
  1105. return f && (f = []), this
  1106. },
  1107. disable: function() {
  1108. return e = g = [], f = c = "", this
  1109. },
  1110. disabled: function() {
  1111. return !f
  1112. },
  1113. lock: function() {
  1114. return e = !0, c || j.disable(), this
  1115. },
  1116. locked: function() {
  1117. return !!e
  1118. },
  1119. fireWith: function(a, c) {
  1120. return e || (c = c || [], c = [a, c.slice ? c.slice() : c], g.push(c), b || i()), this
  1121. },
  1122. fire: function() {
  1123. return j.fireWith(this, arguments), this
  1124. },
  1125. fired: function() {
  1126. return !!d
  1127. }
  1128. };
  1129. return j
  1130. }, n.extend({
  1131. Deferred: function(a) {
  1132. var b = [
  1133. ["resolve", "done", n.Callbacks("once memory"), "resolved"],
  1134. ["reject", "fail", n.Callbacks("once memory"), "rejected"],
  1135. ["notify", "progress", n.Callbacks("memory")]
  1136. ],
  1137. c = "pending",
  1138. d = {
  1139. state: function() {
  1140. return c
  1141. },
  1142. always: function() {
  1143. return e.done(arguments).fail(arguments), this
  1144. },
  1145. then: function() {
  1146. var a = arguments;
  1147. return n.Deferred(function(c) {
  1148. n.each(b, function(b, f) {
  1149. var g = n.isFunction(a[b]) && a[b];
  1150. e[f[1]](function() {
  1151. var a = g && g.apply(this, arguments);
  1152. a && n.isFunction(a.promise) ? a.promise().progress(c.notify).done(c.resolve).fail(c.reject) : c[f[0] + "With"](this === d ? c.promise() : this, g ? [a] : arguments)
  1153. })
  1154. }), a = null
  1155. }).promise()
  1156. },
  1157. promise: function(a) {
  1158. return null != a ? n.extend(a, d) : d
  1159. }
  1160. },
  1161. e = {};
  1162. return d.pipe = d.then, n.each(b, function(a, f) {
  1163. var g = f[2],
  1164. h = f[3];
  1165. d[f[1]] = g.add, h && g.add(function() {
  1166. c = h
  1167. }, b[1 ^ a][2].disable, b[2][2].lock), e[f[0]] = function() {
  1168. return e[f[0] + "With"](this === e ? d : this, arguments), this
  1169. }, e[f[0] + "With"] = g.fireWith
  1170. }), d.promise(e), a && a.call(e, e), e
  1171. },
  1172. when: function(a) {
  1173. var b = 0,
  1174. c = e.call(arguments),
  1175. d = c.length,
  1176. f = 1 !== d || a && n.isFunction(a.promise) ? d : 0,
  1177. g = 1 === f ? a : n.Deferred(),
  1178. h = function(a, b, c) {
  1179. return function(d) {
  1180. b[a] = this, c[a] = arguments.length > 1 ? e.call(arguments) : d, c === i ? g.notifyWith(b, c) : --f || g.resolveWith(b, c)
  1181. }
  1182. },
  1183. i, j, k;
  1184. if (d > 1)
  1185. for (i = new Array(d), j = new Array(d), k = new Array(d); d > b; b++) c[b] && n.isFunction(c[b].promise) ? c[b].promise().progress(h(b, j, i)).done(h(b, k, c)).fail(g.reject) : --f;
  1186. return f || g.resolveWith(k, c), g.promise()
  1187. }
  1188. });
  1189. var I;
  1190. n.fn.ready = function(a) {
  1191. return n.ready.promise().done(a), this
  1192. }, n.extend({
  1193. isReady: !1,
  1194. readyWait: 1,
  1195. holdReady: function(a) {
  1196. a ? n.readyWait++ : n.ready(!0)
  1197. },
  1198. ready: function(a) {
  1199. (a === !0 ? --n.readyWait : n.isReady) || (n.isReady = !0, a !== !0 && --n.readyWait > 0 || (I.resolveWith(d, [n]), n.fn.triggerHandler && (n(d).triggerHandler("ready"), n(d).off("ready"))))
  1200. }
  1201. });
  1202.  
  1203. function J() {
  1204. d.addEventListener ? (d.removeEventListener("DOMContentLoaded", K), a.removeEventListener("load", K)) : (d.detachEvent("onreadystatechange", K), a.detachEvent("onload", K))
  1205. }
  1206.  
  1207. function K() {
  1208. (d.addEventListener || "load" === a.event.type || "complete" === d.readyState) && (J(), n.ready())
  1209. }
  1210. n.ready.promise = function(b) {
  1211. if (!I)
  1212. if (I = n.Deferred(), "complete" === d.readyState || "loading" !== d.readyState && !d.documentElement.doScroll) a.setTimeout(n.ready);
  1213. else if (d.addEventListener) d.addEventListener("DOMContentLoaded", K), a.addEventListener("load", K);
  1214. else {
  1215. d.attachEvent("onreadystatechange", K), a.attachEvent("onload", K);
  1216. var c = !1;
  1217. try {
  1218. c = null == a.frameElement && d.documentElement
  1219. } catch (e) {}
  1220. c && c.doScroll && ! function f() {
  1221. if (!n.isReady) {
  1222. try {
  1223. c.doScroll("left")
  1224. } catch (b) {
  1225. return a.setTimeout(f, 50)
  1226. }
  1227. J(), n.ready()
  1228. }
  1229. }()
  1230. }
  1231. return I.promise(b)
  1232. }, n.ready.promise();
  1233. var L;
  1234. for (L in n(l)) break;
  1235. l.ownFirst = "0" === L, l.inlineBlockNeedsLayout = !1, n(function() {
  1236. var a, b, c, e;
  1237. c = d.getElementsByTagName("body")[0], c && c.style && (b = d.createElement("div"), e = d.createElement("div"), e.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", c.appendChild(e).appendChild(b), "undefined" != typeof b.style.zoom && (b.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1", l.inlineBlockNeedsLayout = a = 3 === b.offsetWidth, a && (c.style.zoom = 1)), c.removeChild(e))
  1238. }),
  1239. function() {
  1240. var a = d.createElement("div");
  1241. l.deleteExpando = !0;
  1242. try {
  1243. delete a.test
  1244. } catch (b) {
  1245. l.deleteExpando = !1
  1246. }
  1247. a = null
  1248. }();
  1249. var M = function(a) {
  1250. var b = n.noData[(a.nodeName + " ").toLowerCase()],
  1251. c = +a.nodeType || 1;
  1252. return 1 !== c && 9 !== c ? !1 : !b || b !== !0 && a.getAttribute("classid") === b
  1253. },
  1254. N = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  1255. O = /([A-Z])/g;
  1256.  
  1257. function P(a, b, c) {
  1258. if (void 0 === c && 1 === a.nodeType) {
  1259. var d = "data-" + b.replace(O, "-$1").toLowerCase();
  1260. if (c = a.getAttribute(d), "string" == typeof c) {
  1261. try {
  1262. c = "true" === c ? !0 : "false" === c ? !1 : "null" === c ? null : +c + "" === c ? +c : N.test(c) ? n.parseJSON(c) : c
  1263. } catch (e) {}
  1264. n.data(a, b, c)
  1265. } else c = void 0
  1266. }
  1267. return c
  1268. }
  1269.  
  1270. function Q(a) {
  1271. var b;
  1272. for (b in a)
  1273. if (("data" !== b || !n.isEmptyObject(a[b])) && "toJSON" !== b) return !1;
  1274. return !0
  1275. }
  1276.  
  1277. function R(a, b, d, e) {
  1278. if (M(a)) {
  1279. var f, g, h = n.expando,
  1280. i = a.nodeType,
  1281. j = i ? n.cache : a,
  1282. k = i ? a[h] : a[h] && h;
  1283. if (k && j[k] && (e || j[k].data) || void 0 !== d || "string" != typeof b) return k || (k = i ? a[h] = c.pop() || n.guid++ : h), j[k] || (j[k] = i ? {} : {
  1284. toJSON: n.noop
  1285. }), "object" != typeof b && "function" != typeof b || (e ? j[k] = n.extend(j[k], b) : j[k].data = n.extend(j[k].data, b)), g = j[k], e || (g.data || (g.data = {}), g = g.data), void 0 !== d && (g[n.camelCase(b)] = d), "string" == typeof b ? (f = g[b], null == f && (f = g[n.camelCase(b)])) : f = g, f
  1286. }
  1287. }
  1288.  
  1289. function S(a, b, c) {
  1290. if (M(a)) {
  1291. var d, e, f = a.nodeType,
  1292. g = f ? n.cache : a,
  1293. h = f ? a[n.expando] : n.expando;
  1294. if (g[h]) {
  1295. if (b && (d = c ? g[h] : g[h].data)) {
  1296. n.isArray(b) ? b = b.concat(n.map(b, n.camelCase)) : b in d ? b = [b] : (b = n.camelCase(b), b = b in d ? [b] : b.split(" ")), e = b.length;
  1297. while (e--) delete d[b[e]];
  1298. if (c ? !Q(d) : !n.isEmptyObject(d)) return
  1299. }(c || (delete g[h].data, Q(g[h]))) && (f ? n.cleanData([a], !0) : l.deleteExpando || g != g.window ? delete g[h] : g[h] = void 0)
  1300. }
  1301. }
  1302. }
  1303. n.extend({
  1304. cache: {},
  1305. noData: {
  1306. "applet ": !0,
  1307. "embed ": !0,
  1308. "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  1309. },
  1310. hasData: function(a) {
  1311. return a = a.nodeType ? n.cache[a[n.expando]] : a[n.expando], !!a && !Q(a)
  1312. },
  1313. data: function(a, b, c) {
  1314. return R(a, b, c)
  1315. },
  1316. removeData: function(a, b) {
  1317. return S(a, b)
  1318. },
  1319. _data: function(a, b, c) {
  1320. return R(a, b, c, !0)
  1321. },
  1322. _removeData: function(a, b) {
  1323. return S(a, b, !0)
  1324. }
  1325. }), n.fn.extend({
  1326. data: function(a, b) {
  1327. var c, d, e, f = this[0],
  1328. g = f && f.attributes;
  1329. if (void 0 === a) {
  1330. if (this.length && (e = n.data(f), 1 === f.nodeType && !n._data(f, "parsedAttrs"))) {
  1331. c = g.length;
  1332. while (c--) g[c] && (d = g[c].name, 0 === d.indexOf("data-") && (d = n.camelCase(d.slice(5)), P(f, d, e[d])));
  1333. n._data(f, "parsedAttrs", !0)
  1334. }
  1335. return e
  1336. }
  1337. return "object" == typeof a ? this.each(function() {
  1338. n.data(this, a)
  1339. }) : arguments.length > 1 ? this.each(function() {
  1340. n.data(this, a, b)
  1341. }) : f ? P(f, a, n.data(f, a)) : void 0
  1342. },
  1343. removeData: function(a) {
  1344. return this.each(function() {
  1345. n.removeData(this, a)
  1346. })
  1347. }
  1348. }), n.extend({
  1349. queue: function(a, b, c) {
  1350. var d;
  1351. return a ? (b = (b || "fx") + "queue", d = n._data(a, b), c && (!d || n.isArray(c) ? d = n._data(a, b, n.makeArray(c)) : d.push(c)), d || []) : void 0
  1352. },
  1353. dequeue: function(a, b) {
  1354. b = b || "fx";
  1355. var c = n.queue(a, b),
  1356. d = c.length,
  1357. e = c.shift(),
  1358. f = n._queueHooks(a, b),
  1359. g = function() {
  1360. n.dequeue(a, b)
  1361. };
  1362. "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()
  1363. },
  1364. _queueHooks: function(a, b) {
  1365. var c = b + "queueHooks";
  1366. return n._data(a, c) || n._data(a, c, {
  1367. empty: n.Callbacks("once memory").add(function() {
  1368. n._removeData(a, b + "queue"), n._removeData(a, c)
  1369. })
  1370. })
  1371. }
  1372. }), n.fn.extend({
  1373. queue: function(a, b) {
  1374. var c = 2;
  1375. return "string" != typeof a && (b = a, a = "fx", c--), arguments.length < c ? n.queue(this[0], a) : void 0 === b ? this : this.each(function() {
  1376. var c = n.queue(this, a, b);
  1377. n._queueHooks(this, a), "fx" === a && "inprogress" !== c[0] && n.dequeue(this, a)
  1378. })
  1379. },
  1380. dequeue: function(a) {
  1381. return this.each(function() {
  1382. n.dequeue(this, a)
  1383. })
  1384. },
  1385. clearQueue: function(a) {
  1386. return this.queue(a || "fx", [])
  1387. },
  1388. promise: function(a, b) {
  1389. var c, d = 1,
  1390. e = n.Deferred(),
  1391. f = this,
  1392. g = this.length,
  1393. h = function() {
  1394. --d || e.resolveWith(f, [f])
  1395. };
  1396. "string" != typeof a && (b = a, a = void 0), a = a || "fx";
  1397. while (g--) c = n._data(f[g], a + "queueHooks"), c && c.empty && (d++, c.empty.add(h));
  1398. return h(), e.promise(b)
  1399. }
  1400. }),
  1401. function() {
  1402. var a;
  1403. l.shrinkWrapBlocks = function() {
  1404. if (null != a) return a;
  1405. a = !1;
  1406. var b, c, e;
  1407. return c = d.getElementsByTagName("body")[0], c && c.style ? (b = d.createElement("div"), e = d.createElement("div"), e.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", c.appendChild(e).appendChild(b), "undefined" != typeof b.style.zoom && (b.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1", b.appendChild(d.createElement("div")).style.width = "5px", a = 3 !== b.offsetWidth), c.removeChild(e), a) : void 0
  1408. }
  1409. }();
  1410. var T = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
  1411. U = new RegExp("^(?:([+-])=|)(" + T + ")([a-z%]*)$", "i"),
  1412. V = ["Top", "Right", "Bottom", "Left"],
  1413. W = function(a, b) {
  1414. return a = b || a, "none" === n.css(a, "display") || !n.contains(a.ownerDocument, a)
  1415. };
  1416.  
  1417. function X(a, b, c, d) {
  1418. var e, f = 1,
  1419. g = 20,
  1420. h = d ? function() {
  1421. return d.cur()
  1422. } : function() {
  1423. return n.css(a, b, "")
  1424. },
  1425. i = h(),
  1426. j = c && c[3] || (n.cssNumber[b] ? "" : "px"),
  1427. k = (n.cssNumber[b] || "px" !== j && +i) && U.exec(n.css(a, b));
  1428. if (k && k[3] !== j) {
  1429. j = j || k[3], c = c || [], k = +i || 1;
  1430. do f = f || ".5", k /= f, n.style(a, b, k + j); while (f !== (f = h() / i) && 1 !== f && --g)
  1431. }
  1432. return c && (k = +k || +i || 0, e = c[1] ? k + (c[1] + 1) * c[2] : +c[2], d && (d.unit = j, d.start = k, d.end = e)), e
  1433. }
  1434. var Y = function(a, b, c, d, e, f, g) {
  1435. var h = 0,
  1436. i = a.length,
  1437. j = null == c;
  1438. if ("object" === n.type(c)) {
  1439. e = !0;
  1440. for (h in c) Y(a, b, h, c[h], !0, f, g)
  1441. } else if (void 0 !== d && (e = !0, n.isFunction(d) || (g = !0), j && (g ? (b.call(a, d), b = null) : (j = b, b = function(a, b, c) {
  1442. return j.call(n(a), c)
  1443. })), b))
  1444. for (; i > h; h++) b(a[h], c, g ? d : d.call(a[h], h, b(a[h], c)));
  1445. return e ? a : j ? b.call(a) : i ? b(a[0], c) : f
  1446. },
  1447. Z = /^(?:checkbox|radio)$/i,
  1448. $ = /<([\w:-]+)/,
  1449. _ = /^$|\/(?:java|ecma)script/i,
  1450. aa = /^\s+/,
  1451. ba = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";
  1452.  
  1453. function ca(a) {
  1454. var b = ba.split("|"),
  1455. c = a.createDocumentFragment();
  1456. if (c.createElement)
  1457. while (b.length) c.createElement(b.pop());
  1458. return c
  1459. }! function() {
  1460. var a = d.createElement("div"),
  1461. b = d.createDocumentFragment(),
  1462. c = d.createElement("input");
  1463. a.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", l.leadingWhitespace = 3 === a.firstChild.nodeType, l.tbody = !a.getElementsByTagName("tbody").length, l.htmlSerialize = !!a.getElementsByTagName("link").length, l.html5Clone = "<:nav></:nav>" !== d.createElement("nav").cloneNode(!0).outerHTML, c.type = "checkbox", c.checked = !0, b.appendChild(c), l.appendChecked = c.checked, a.innerHTML = "<textarea>x</textarea>", l.noCloneChecked = !!a.cloneNode(!0).lastChild.defaultValue, b.appendChild(a), c = d.createElement("input"), c.setAttribute("type", "radio"), c.setAttribute("checked", "checked"), c.setAttribute("name", "t"), a.appendChild(c), l.checkClone = a.cloneNode(!0).cloneNode(!0).lastChild.checked, l.noCloneEvent = !!a.addEventListener, a[n.expando] = 1, l.attributes = !a.getAttribute(n.expando)
  1464. }();
  1465. var da = {
  1466. option: [1, "<select multiple='multiple'>", "</select>"],
  1467. legend: [1, "<fieldset>", "</fieldset>"],
  1468. area: [1, "<map>", "</map>"],
  1469. param: [1, "<object>", "</object>"],
  1470. thead: [1, "<table>", "</table>"],
  1471. tr: [2, "<table><tbody>", "</tbody></table>"],
  1472. col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
  1473. td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
  1474. _default: l.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"]
  1475. };
  1476. da.optgroup = da.option, da.tbody = da.tfoot = da.colgroup = da.caption = da.thead, da.th = da.td;
  1477.  
  1478. function ea(a, b) {
  1479. var c, d, e = 0,
  1480. f = "undefined" != typeof a.getElementsByTagName ? a.getElementsByTagName(b || "*") : "undefined" != typeof a.querySelectorAll ? a.querySelectorAll(b || "*") : void 0;
  1481. if (!f)
  1482. for (f = [], c = a.childNodes || a; null != (d = c[e]); e++) !b || n.nodeName(d, b) ? f.push(d) : n.merge(f, ea(d, b));
  1483. return void 0 === b || b && n.nodeName(a, b) ? n.merge([a], f) : f
  1484. }
  1485.  
  1486. function fa(a, b) {
  1487. for (var c, d = 0; null != (c = a[d]); d++) n._data(c, "globalEval", !b || n._data(b[d], "globalEval"))
  1488. }
  1489. var ga = /<|&#?\w+;/,
  1490. ha = /<tbody/i;
  1491.  
  1492. function ia(a) {
  1493. Z.test(a.type) && (a.defaultChecked = a.checked)
  1494. }
  1495.  
  1496. function ja(a, b, c, d, e) {
  1497. for (var f, g, h, i, j, k, m, o = a.length, p = ca(b), q = [], r = 0; o > r; r++)
  1498. if (g = a[r], g || 0 === g)
  1499. if ("object" === n.type(g)) n.merge(q, g.nodeType ? [g] : g);
  1500. else if (ga.test(g)) {
  1501. i = i || p.appendChild(b.createElement("div")), j = ($.exec(g) || ["", ""])[1].toLowerCase(), m = da[j] || da._default, i.innerHTML = m[1] + n.htmlPrefilter(g) + m[2], f = m[0];
  1502. while (f--) i = i.lastChild;
  1503. if (!l.leadingWhitespace && aa.test(g) && q.push(b.createTextNode(aa.exec(g)[0])), !l.tbody) {
  1504. g = "table" !== j || ha.test(g) ? "<table>" !== m[1] || ha.test(g) ? 0 : i : i.firstChild, f = g && g.childNodes.length;
  1505. while (f--) n.nodeName(k = g.childNodes[f], "tbody") && !k.childNodes.length && g.removeChild(k)
  1506. }
  1507. n.merge(q, i.childNodes), i.textContent = "";
  1508. while (i.firstChild) i.removeChild(i.firstChild);
  1509. i = p.lastChild
  1510. } else q.push(b.createTextNode(g));
  1511. i && p.removeChild(i), l.appendChecked || n.grep(ea(q, "input"), ia), r = 0;
  1512. while (g = q[r++])
  1513. if (d && n.inArray(g, d) > -1) e && e.push(g);
  1514. else if (h = n.contains(g.ownerDocument, g), i = ea(p.appendChild(g), "script"), h && fa(i), c) {
  1515. f = 0;
  1516. while (g = i[f++]) _.test(g.type || "") && c.push(g)
  1517. }
  1518. return i = null, p
  1519. }! function() {
  1520. var b, c, e = d.createElement("div");
  1521. for (b in {
  1522. submit: !0,
  1523. change: !0,
  1524. focusin: !0
  1525. }) c = "on" + b, (l[b] = c in a) || (e.setAttribute(c, "t"), l[b] = e.attributes[c].expando === !1);
  1526. e = null
  1527. }();
  1528. var ka = /^(?:input|select|textarea)$/i,
  1529. la = /^key/,
  1530. ma = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
  1531. na = /^(?:focusinfocus|focusoutblur)$/,
  1532. oa = /^([^.]*)(?:\.(.+)|)/;
  1533.  
  1534. function pa() {
  1535. return !0
  1536. }
  1537.  
  1538. function qa() {
  1539. return !1
  1540. }
  1541.  
  1542. function ra() {
  1543. try {
  1544. return d.activeElement
  1545. } catch (a) {}
  1546. }
  1547.  
  1548. function sa(a, b, c, d, e, f) {
  1549. var g, h;
  1550. if ("object" == typeof b) {
  1551. "string" != typeof c && (d = d || c, c = void 0);
  1552. for (h in b) sa(a, h, c, d, b[h], f);
  1553. return a
  1554. }
  1555. if (null == d && null == e ? (e = c, d = c = void 0) : null == e && ("string" == typeof c ? (e = d, d = void 0) : (e = d, d = c, c = void 0)), e === !1) e = qa;
  1556. else if (!e) return a;
  1557. return 1 === f && (g = e, e = function(a) {
  1558. return n().off(a), g.apply(this, arguments)
  1559. }, e.guid = g.guid || (g.guid = n.guid++)), a.each(function() {
  1560. n.event.add(this, b, e, d, c)
  1561. })
  1562. }
  1563. n.event = {
  1564. global: {},
  1565. add: function(a, b, c, d, e) {
  1566. var f, g, h, i, j, k, l, m, o, p, q, r = n._data(a);
  1567. if (r) {
  1568. c.handler && (i = c, c = i.handler, e = i.selector), c.guid || (c.guid = n.guid++), (g = r.events) || (g = r.events = {}), (k = r.handle) || (k = r.handle = function(a) {
  1569. return "undefined" == typeof n || a && n.event.triggered === a.type ? void 0 : n.event.dispatch.apply(k.elem, arguments)
  1570. }, k.elem = a), b = (b || "").match(G) || [""], h = b.length;
  1571. while (h--) f = oa.exec(b[h]) || [], o = q = f[1], p = (f[2] || "").split(".").sort(), o && (j = n.event.special[o] || {}, o = (e ? j.delegateType : j.bindType) || o, j = n.event.special[o] || {}, l = n.extend({
  1572. type: o,
  1573. origType: q,
  1574. data: d,
  1575. handler: c,
  1576. guid: c.guid,
  1577. selector: e,
  1578. needsContext: e && n.expr.match.needsContext.test(e),
  1579. namespace: p.join(".")
  1580. }, i), (m = g[o]) || (m = g[o] = [], m.delegateCount = 0, j.setup && j.setup.call(a, d, p, k) !== !1 || (a.addEventListener ? a.addEventListener(o, k, !1) : a.attachEvent && a.attachEvent("on" + o, k))), j.add && (j.add.call(a, l), l.handler.guid || (l.handler.guid = c.guid)), e ? m.splice(m.delegateCount++, 0, l) : m.push(l), n.event.global[o] = !0);
  1581. a = null
  1582. }
  1583. },
  1584. remove: function(a, b, c, d, e) {
  1585. var f, g, h, i, j, k, l, m, o, p, q, r = n.hasData(a) && n._data(a);
  1586. if (r && (k = r.events)) {
  1587. b = (b || "").match(G) || [""], j = b.length;
  1588. while (j--)
  1589. if (h = oa.exec(b[j]) || [], o = q = h[1], p = (h[2] || "").split(".").sort(), o) {
  1590. l = n.event.special[o] || {}, o = (d ? l.delegateType : l.bindType) || o, m = k[o] || [], h = h[2] && new RegExp("(^|\\.)" + p.join("\\.(?:.*\\.|)") + "(\\.|$)"), i = f = m.length;
  1591. while (f--) g = m[f], !e && q !== g.origType || c && c.guid !== g.guid || h && !h.test(g.namespace) || d && d !== g.selector && ("**" !== d || !g.selector) || (m.splice(f, 1), g.selector && m.delegateCount--, l.remove && l.remove.call(a, g));
  1592. i && !m.length && (l.teardown && l.teardown.call(a, p, r.handle) !== !1 || n.removeEvent(a, o, r.handle), delete k[o])
  1593. } else
  1594. for (o in k) n.event.remove(a, o + b[j], c, d, !0);
  1595. n.isEmptyObject(k) && (delete r.handle, n._removeData(a, "events"))
  1596. }
  1597. },
  1598. trigger: function(b, c, e, f) {
  1599. var g, h, i, j, l, m, o, p = [e || d],
  1600. q = k.call(b, "type") ? b.type : b,
  1601. r = k.call(b, "namespace") ? b.namespace.split(".") : [];
  1602. if (i = m = e = e || d, 3 !== e.nodeType && 8 !== e.nodeType && !na.test(q + n.event.triggered) && (q.indexOf(".") > -1 && (r = q.split("."), q = r.shift(), r.sort()), h = q.indexOf(":") < 0 && "on" + q, b = b[n.expando] ? b : new n.Event(q, "object" == typeof b && b), b.isTrigger = f ? 2 : 3, b.namespace = r.join("."), b.rnamespace = b.namespace ? new RegExp("(^|\\.)" + r.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, b.result = void 0, b.target || (b.target = e), c = null == c ? [b] : n.makeArray(c, [b]), l = n.event.special[q] || {}, f || !l.trigger || l.trigger.apply(e, c) !== !1)) {
  1603. if (!f && !l.noBubble && !n.isWindow(e)) {
  1604. for (j = l.delegateType || q, na.test(j + q) || (i = i.parentNode); i; i = i.parentNode) p.push(i), m = i;
  1605. m === (e.ownerDocument || d) && p.push(m.defaultView || m.parentWindow || a)
  1606. }
  1607. o = 0;
  1608. while ((i = p[o++]) && !b.isPropagationStopped()) b.type = o > 1 ? j : l.bindType || q, g = (n._data(i, "events") || {})[b.type] && n._data(i, "handle"), g && g.apply(i, c), g = h && i[h], g && g.apply && M(i) && (b.result = g.apply(i, c), b.result === !1 && b.preventDefault());
  1609. if (b.type = q, !f && !b.isDefaultPrevented() && (!l._default || l._default.apply(p.pop(), c) === !1) && M(e) && h && e[q] && !n.isWindow(e)) {
  1610. m = e[h], m && (e[h] = null), n.event.triggered = q;
  1611. try {
  1612. e[q]()
  1613. } catch (s) {}
  1614. n.event.triggered = void 0, m && (e[h] = m)
  1615. }
  1616. return b.result
  1617. }
  1618. },
  1619. dispatch: function(a) {
  1620. a = n.event.fix(a);
  1621. var b, c, d, f, g, h = [],
  1622. i = e.call(arguments),
  1623. j = (n._data(this, "events") || {})[a.type] || [],
  1624. k = n.event.special[a.type] || {};
  1625. if (i[0] = a, a.delegateTarget = this, !k.preDispatch || k.preDispatch.call(this, a) !== !1) {
  1626. h = n.event.handlers.call(this, a, j), b = 0;
  1627. while ((f = h[b++]) && !a.isPropagationStopped()) {
  1628. a.currentTarget = f.elem, c = 0;
  1629. while ((g = f.handlers[c++]) && !a.isImmediatePropagationStopped()) a.rnamespace && !a.rnamespace.test(g.namespace) || (a.handleObj = g, a.data = g.data, d = ((n.event.special[g.origType] || {}).handle || g.handler).apply(f.elem, i), void 0 !== d && (a.result = d) === !1 && (a.preventDefault(), a.stopPropagation()))
  1630. }
  1631. return k.postDispatch && k.postDispatch.call(this, a), a.result
  1632. }
  1633. },
  1634. handlers: function(a, b) {
  1635. var c, d, e, f, g = [],
  1636. h = b.delegateCount,
  1637. i = a.target;
  1638. if (h && i.nodeType && ("click" !== a.type || isNaN(a.button) || a.button < 1))
  1639. for (; i != this; i = i.parentNode || this)
  1640. if (1 === i.nodeType && (i.disabled !== !0 || "click" !== a.type)) {
  1641. for (d = [], c = 0; h > c; c++) f = b[c], e = f.selector + " ", void 0 === d[e] && (d[e] = f.needsContext ? n(e, this).index(i) > -1 : n.find(e, this, null, [i]).length), d[e] && d.push(f);
  1642. d.length && g.push({
  1643. elem: i,
  1644. handlers: d
  1645. })
  1646. }
  1647. return h < b.length && g.push({
  1648. elem: this,
  1649. handlers: b.slice(h)
  1650. }), g
  1651. },
  1652. fix: function(a) {
  1653. if (a[n.expando]) return a;
  1654. var b, c, e, f = a.type,
  1655. g = a,
  1656. h = this.fixHooks[f];
  1657. h || (this.fixHooks[f] = h = ma.test(f) ? this.mouseHooks : la.test(f) ? this.keyHooks : {}), e = h.props ? this.props.concat(h.props) : this.props, a = new n.Event(g), b = e.length;
  1658. while (b--) c = e[b], a[c] = g[c];
  1659. return a.target || (a.target = g.srcElement || d), 3 === a.target.nodeType && (a.target = a.target.parentNode), a.metaKey = !!a.metaKey, h.filter ? h.filter(a, g) : a
  1660. },
  1661. props: "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
  1662. fixHooks: {},
  1663. keyHooks: {
  1664. props: "char charCode key keyCode".split(" "),
  1665. filter: function(a, b) {
  1666. return null == a.which && (a.which = null != b.charCode ? b.charCode : b.keyCode), a
  1667. }
  1668. },
  1669. mouseHooks: {
  1670. props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
  1671. filter: function(a, b) {
  1672. var c, e, f, g = b.button,
  1673. h = b.fromElement;
  1674. return null == a.pageX && null != b.clientX && (e = a.target.ownerDocument || d, f = e.documentElement, c = e.body, a.pageX = b.clientX + (f && f.scrollLeft || c && c.scrollLeft || 0) - (f && f.clientLeft || c && c.clientLeft || 0), a.pageY = b.clientY + (f && f.scrollTop || c && c.scrollTop || 0) - (f && f.clientTop || c && c.clientTop || 0)), !a.relatedTarget && h && (a.relatedTarget = h === a.target ? b.toElement : h), a.which || void 0 === g || (a.which = 1 & g ? 1 : 2 & g ? 3 : 4 & g ? 2 : 0), a
  1675. }
  1676. },
  1677. special: {
  1678. load: {
  1679. noBubble: !0
  1680. },
  1681. focus: {
  1682. trigger: function() {
  1683. if (this !== ra() && this.focus) try {
  1684. return this.focus(), !1
  1685. } catch (a) {}
  1686. },
  1687. delegateType: "focusin"
  1688. },
  1689. blur: {
  1690. trigger: function() {
  1691. return this === ra() && this.blur ? (this.blur(), !1) : void 0
  1692. },
  1693. delegateType: "focusout"
  1694. },
  1695. click: {
  1696. trigger: function() {
  1697. return n.nodeName(this, "input") && "checkbox" === this.type && this.click ? (this.click(), !1) : void 0
  1698. },
  1699. _default: function(a) {
  1700. return n.nodeName(a.target, "a")
  1701. }
  1702. },
  1703. beforeunload: {
  1704. postDispatch: function(a) {
  1705. void 0 !== a.result && a.originalEvent && (a.originalEvent.returnValue = a.result)
  1706. }
  1707. }
  1708. },
  1709. simulate: function(a, b, c) {
  1710. var d = n.extend(new n.Event, c, {
  1711. type: a,
  1712. isSimulated: !0
  1713. });
  1714. n.event.trigger(d, null, b), d.isDefaultPrevented() && c.preventDefault()
  1715. }
  1716. }, n.removeEvent = d.removeEventListener ? function(a, b, c) {
  1717. a.removeEventListener && a.removeEventListener(b, c)
  1718. } : function(a, b, c) {
  1719. var d = "on" + b;
  1720. a.detachEvent && ("undefined" == typeof a[d] && (a[d] = null), a.detachEvent(d, c))
  1721. }, n.Event = function(a, b) {
  1722. return this instanceof n.Event ? (a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || void 0 === a.defaultPrevented && a.returnValue === !1 ? pa : qa) : this.type = a, b && n.extend(this, b), this.timeStamp = a && a.timeStamp || n.now(), void(this[n.expando] = !0)) : new n.Event(a, b)
  1723. }, n.Event.prototype = {
  1724. constructor: n.Event,
  1725. isDefaultPrevented: qa,
  1726. isPropagationStopped: qa,
  1727. isImmediatePropagationStopped: qa,
  1728. preventDefault: function() {
  1729. var a = this.originalEvent;
  1730. this.isDefaultPrevented = pa, a && (a.preventDefault ? a.preventDefault() : a.returnValue = !1)
  1731. },
  1732. stopPropagation: function() {
  1733. var a = this.originalEvent;
  1734. this.isPropagationStopped = pa, a && !this.isSimulated && (a.stopPropagation && a.stopPropagation(), a.cancelBubble = !0)
  1735. },
  1736. stopImmediatePropagation: function() {
  1737. var a = this.originalEvent;
  1738. this.isImmediatePropagationStopped = pa, a && a.stopImmediatePropagation && a.stopImmediatePropagation(), this.stopPropagation()
  1739. }
  1740. }, n.each({
  1741. mouseenter: "mouseover",
  1742. mouseleave: "mouseout",
  1743. pointerenter: "pointerover",
  1744. pointerleave: "pointerout"
  1745. }, function(a, b) {
  1746. n.event.special[a] = {
  1747. delegateType: b,
  1748. bindType: b,
  1749. handle: function(a) {
  1750. var c, d = this,
  1751. e = a.relatedTarget,
  1752. f = a.handleObj;
  1753. return e && (e === d || n.contains(d, e)) || (a.type = f.origType, c = f.handler.apply(this, arguments), a.type = b), c
  1754. }
  1755. }
  1756. }), l.submit || (n.event.special.submit = {
  1757. setup: function() {
  1758. return n.nodeName(this, "form") ? !1 : void n.event.add(this, "click._submit keypress._submit", function(a) {
  1759. var b = a.target,
  1760. c = n.nodeName(b, "input") || n.nodeName(b, "button") ? n.prop(b, "form") : void 0;
  1761. c && !n._data(c, "submit") && (n.event.add(c, "submit._submit", function(a) {
  1762. a._submitBubble = !0
  1763. }), n._data(c, "submit", !0))
  1764. })
  1765. },
  1766. postDispatch: function(a) {
  1767. a._submitBubble && (delete a._submitBubble, this.parentNode && !a.isTrigger && n.event.simulate("submit", this.parentNode, a))
  1768. },
  1769. teardown: function() {
  1770. return n.nodeName(this, "form") ? !1 : void n.event.remove(this, "._submit")
  1771. }
  1772. }), l.change || (n.event.special.change = {
  1773. setup: function() {
  1774. return ka.test(this.nodeName) ? ("checkbox" !== this.type && "radio" !== this.type || (n.event.add(this, "propertychange._change", function(a) {
  1775. "checked" === a.originalEvent.propertyName && (this._justChanged = !0)
  1776. }), n.event.add(this, "click._change", function(a) {
  1777. this._justChanged && !a.isTrigger && (this._justChanged = !1), n.event.simulate("change", this, a)
  1778. })), !1) : void n.event.add(this, "beforeactivate._change", function(a) {
  1779. var b = a.target;
  1780. ka.test(b.nodeName) && !n._data(b, "change") && (n.event.add(b, "change._change", function(a) {
  1781. !this.parentNode || a.isSimulated || a.isTrigger || n.event.simulate("change", this.parentNode, a)
  1782. }), n._data(b, "change", !0))
  1783. })
  1784. },
  1785. handle: function(a) {
  1786. var b = a.target;
  1787. return this !== b || a.isSimulated || a.isTrigger || "radio" !== b.type && "checkbox" !== b.type ? a.handleObj.handler.apply(this, arguments) : void 0
  1788. },
  1789. teardown: function() {
  1790. return n.event.remove(this, "._change"), !ka.test(this.nodeName)
  1791. }
  1792. }), l.focusin || n.each({
  1793. focus: "focusin",
  1794. blur: "focusout"
  1795. }, function(a, b) {
  1796. var c = function(a) {
  1797. n.event.simulate(b, a.target, n.event.fix(a))
  1798. };
  1799. n.event.special[b] = {
  1800. setup: function() {
  1801. var d = this.ownerDocument || this,
  1802. e = n._data(d, b);
  1803. e || d.addEventListener(a, c, !0), n._data(d, b, (e || 0) + 1)
  1804. },
  1805. teardown: function() {
  1806. var d = this.ownerDocument || this,
  1807. e = n._data(d, b) - 1;
  1808. e ? n._data(d, b, e) : (d.removeEventListener(a, c, !0), n._removeData(d, b))
  1809. }
  1810. }
  1811. }), n.fn.extend({
  1812. on: function(a, b, c, d) {
  1813. return sa(this, a, b, c, d)
  1814. },
  1815. one: function(a, b, c, d) {
  1816. return sa(this, a, b, c, d, 1)
  1817. },
  1818. off: function(a, b, c) {
  1819. var d, e;
  1820. if (a && a.preventDefault && a.handleObj) return d = a.handleObj, n(a.delegateTarget).off(d.namespace ? d.origType + "." + d.namespace : d.origType, d.selector, d.handler), this;
  1821. if ("object" == typeof a) {
  1822. for (e in a) this.off(e, b, a[e]);
  1823. return this
  1824. }
  1825. return b !== !1 && "function" != typeof b || (c = b, b = void 0), c === !1 && (c = qa), this.each(function() {
  1826. n.event.remove(this, a, c, b)
  1827. })
  1828. },
  1829. trigger: function(a, b) {
  1830. return this.each(function() {
  1831. n.event.trigger(a, b, this)
  1832. })
  1833. },
  1834. triggerHandler: function(a, b) {
  1835. var c = this[0];
  1836. return c ? n.event.trigger(a, b, c, !0) : void 0
  1837. }
  1838. });
  1839. var ta = / jQuery\d+="(?:null|\d+)"/g,
  1840. ua = new RegExp("<(?:" + ba + ")[\\s/>]", "i"),
  1841. va = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
  1842. wa = /<script|<style|<link/i,
  1843. xa = /checked\s*(?:[^=]|=\s*.checked.)/i,
  1844. ya = /^true\/(.*)/,
  1845. za = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
  1846. Aa = ca(d),
  1847. Ba = Aa.appendChild(d.createElement("div"));
  1848.  
  1849. function Ca(a, b) {
  1850. return n.nodeName(a, "table") && n.nodeName(11 !== b.nodeType ? b : b.firstChild, "tr") ? a.getElementsByTagName("tbody")[0] || a.appendChild(a.ownerDocument.createElement("tbody")) : a
  1851. }
  1852.  
  1853. function Da(a) {
  1854. return a.type = (null !== n.find.attr(a, "type")) + "/" + a.type, a
  1855. }
  1856.  
  1857. function Ea(a) {
  1858. var b = ya.exec(a.type);
  1859. return b ? a.type = b[1] : a.removeAttribute("type"), a
  1860. }
  1861.  
  1862. function Fa(a, b) {
  1863. if (1 === b.nodeType && n.hasData(a)) {
  1864. var c, d, e, f = n._data(a),
  1865. g = n._data(b, f),
  1866. h = f.events;
  1867. if (h) {
  1868. delete g.handle, g.events = {};
  1869. for (c in h)
  1870. for (d = 0, e = h[c].length; e > d; d++) n.event.add(b, c, h[c][d])
  1871. }
  1872. g.data && (g.data = n.extend({}, g.data))
  1873. }
  1874. }
  1875.  
  1876. function Ga(a, b) {
  1877. var c, d, e;
  1878. if (1 === b.nodeType) {
  1879. if (c = b.nodeName.toLowerCase(), !l.noCloneEvent && b[n.expando]) {
  1880. e = n._data(b);
  1881. for (d in e.events) n.removeEvent(b, d, e.handle);
  1882. b.removeAttribute(n.expando)
  1883. }
  1884. "script" === c && b.text !== a.text ? (Da(b).text = a.text, Ea(b)) : "object" === c ? (b.parentNode && (b.outerHTML = a.outerHTML), l.html5Clone && a.innerHTML && !n.trim(b.innerHTML) && (b.innerHTML = a.innerHTML)) : "input" === c && Z.test(a.type) ? (b.defaultChecked = b.checked = a.checked, b.value !== a.value && (b.value = a.value)) : "option" === c ? b.defaultSelected = b.selected = a.defaultSelected : "input" !== c && "textarea" !== c || (b.defaultValue = a.defaultValue)
  1885. }
  1886. }
  1887.  
  1888. function Ha(a, b, c, d) {
  1889. b = f.apply([], b);
  1890. var e, g, h, i, j, k, m = 0,
  1891. o = a.length,
  1892. p = o - 1,
  1893. q = b[0],
  1894. r = n.isFunction(q);
  1895. if (r || o > 1 && "string" == typeof q && !l.checkClone && xa.test(q)) return a.each(function(e) {
  1896. var f = a.eq(e);
  1897. r && (b[0] = q.call(this, e, f.html())), Ha(f, b, c, d)
  1898. });
  1899. if (o && (k = ja(b, a[0].ownerDocument, !1, a, d), e = k.firstChild, 1 === k.childNodes.length && (k = e), e || d)) {
  1900. for (i = n.map(ea(k, "script"), Da), h = i.length; o > m; m++) g = k, m !== p && (g = n.clone(g, !0, !0), h && n.merge(i, ea(g, "script"))), c.call(a[m], g, m);
  1901. if (h)
  1902. for (j = i[i.length - 1].ownerDocument, n.map(i, Ea), m = 0; h > m; m++) g = i[m], _.test(g.type || "") && !n._data(g, "globalEval") && n.contains(j, g) && (g.src ? n._evalUrl && n._evalUrl(g.src) : n.globalEval((g.text || g.textContent || g.innerHTML || "").replace(za, "")));
  1903. k = e = null
  1904. }
  1905. return a
  1906. }
  1907.  
  1908. function Ia(a, b, c) {
  1909. for (var d, e = b ? n.filter(b, a) : a, f = 0; null != (d = e[f]); f++) c || 1 !== d.nodeType || n.cleanData(ea(d)), d.parentNode && (c && n.contains(d.ownerDocument, d) && fa(ea(d, "script")), d.parentNode.removeChild(d));
  1910. return a
  1911. }
  1912. n.extend({
  1913. htmlPrefilter: function(a) {
  1914. return a.replace(va, "<$1></$2>")
  1915. },
  1916. clone: function(a, b, c) {
  1917. var d, e, f, g, h, i = n.contains(a.ownerDocument, a);
  1918. if (l.html5Clone || n.isXMLDoc(a) || !ua.test("<" + a.nodeName + ">") ? f = a.cloneNode(!0) : (Ba.innerHTML = a.outerHTML, Ba.removeChild(f = Ba.firstChild)), !(l.noCloneEvent && l.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || n.isXMLDoc(a)))
  1919. for (d = ea(f), h = ea(a), g = 0; null != (e = h[g]); ++g) d[g] && Ga(e, d[g]);
  1920. if (b)
  1921. if (c)
  1922. for (h = h || ea(a), d = d || ea(f), g = 0; null != (e = h[g]); g++) Fa(e, d[g]);
  1923. else Fa(a, f);
  1924. return d = ea(f, "script"), d.length > 0 && fa(d, !i && ea(a, "script")), d = h = e = null, f
  1925. },
  1926. cleanData: function(a, b) {
  1927. for (var d, e, f, g, h = 0, i = n.expando, j = n.cache, k = l.attributes, m = n.event.special; null != (d = a[h]); h++)
  1928. if ((b || M(d)) && (f = d[i], g = f && j[f])) {
  1929. if (g.events)
  1930. for (e in g.events) m[e] ? n.event.remove(d, e) : n.removeEvent(d, e, g.handle);
  1931. j[f] && (delete j[f], k || "undefined" == typeof d.removeAttribute ? d[i] = void 0 : d.removeAttribute(i), c.push(f))
  1932. }
  1933. }
  1934. }), n.fn.extend({
  1935. domManip: Ha,
  1936. detach: function(a) {
  1937. return Ia(this, a, !0)
  1938. },
  1939. remove: function(a) {
  1940. return Ia(this, a)
  1941. },
  1942. text: function(a) {
  1943. return Y(this, function(a) {
  1944. return void 0 === a ? n.text(this) : this.empty().append((this[0] && this[0].ownerDocument || d).createTextNode(a))
  1945. }, null, a, arguments.length)
  1946. },
  1947. append: function() {
  1948. return Ha(this, arguments, function(a) {
  1949. if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
  1950. var b = Ca(this, a);
  1951. b.appendChild(a)
  1952. }
  1953. })
  1954. },
  1955. prepend: function() {
  1956. return Ha(this, arguments, function(a) {
  1957. if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
  1958. var b = Ca(this, a);
  1959. b.insertBefore(a, b.firstChild)
  1960. }
  1961. })
  1962. },
  1963. before: function() {
  1964. return Ha(this, arguments, function(a) {
  1965. this.parentNode && this.parentNode.insertBefore(a, this)
  1966. })
  1967. },
  1968. after: function() {
  1969. return Ha(this, arguments, function(a) {
  1970. this.parentNode && this.parentNode.insertBefore(a, this.nextSibling)
  1971. })
  1972. },
  1973. empty: function() {
  1974. for (var a, b = 0; null != (a = this[b]); b++) {
  1975. 1 === a.nodeType && n.cleanData(ea(a, !1));
  1976. while (a.firstChild) a.removeChild(a.firstChild);
  1977. a.options && n.nodeName(a, "select") && (a.options.length = 0)
  1978. }
  1979. return this
  1980. },
  1981. clone: function(a, b) {
  1982. return a = null == a ? !1 : a, b = null == b ? a : b, this.map(function() {
  1983. return n.clone(this, a, b)
  1984. })
  1985. },
  1986. html: function(a) {
  1987. return Y(this, function(a) {
  1988. var b = this[0] || {},
  1989. c = 0,
  1990. d = this.length;
  1991. if (void 0 === a) return 1 === b.nodeType ? b.innerHTML.replace(ta, "") : void 0;
  1992. if ("string" == typeof a && !wa.test(a) && (l.htmlSerialize || !ua.test(a)) && (l.leadingWhitespace || !aa.test(a)) && !da[($.exec(a) || ["", ""])[1].toLowerCase()]) {
  1993. a = n.htmlPrefilter(a);
  1994. try {
  1995. for (; d > c; c++) b = this[c] || {}, 1 === b.nodeType && (n.cleanData(ea(b, !1)), b.innerHTML = a);
  1996. b = 0
  1997. } catch (e) {}
  1998. }
  1999. b && this.empty().append(a)
  2000. }, null, a, arguments.length)
  2001. },
  2002. replaceWith: function() {
  2003. var a = [];
  2004. return Ha(this, arguments, function(b) {
  2005. var c = this.parentNode;
  2006. n.inArray(this, a) < 0 && (n.cleanData(ea(this)), c && c.replaceChild(b, this))
  2007. }, a)
  2008. }
  2009. }), n.each({
  2010. appendTo: "append",
  2011. prependTo: "prepend",
  2012. insertBefore: "before",
  2013. insertAfter: "after",
  2014. replaceAll: "replaceWith"
  2015. }, function(a, b) {
  2016. n.fn[a] = function(a) {
  2017. for (var c, d = 0, e = [], f = n(a), h = f.length - 1; h >= d; d++) c = d === h ? this : this.clone(!0), n(f[d])[b](c), g.apply(e, c.get());
  2018. return this.pushStack(e)
  2019. }
  2020. });
  2021. var Ja, Ka = {
  2022. HTML: "block",
  2023. BODY: "block"
  2024. };
  2025.  
  2026. function La(a, b) {
  2027. var c = n(b.createElement(a)).appendTo(b.body),
  2028. d = n.css(c[0], "display");
  2029. return c.detach(), d
  2030. }
  2031.  
  2032. function Ma(a) {
  2033. var b = d,
  2034. c = Ka[a];
  2035. return c || (c = La(a, b), "none" !== c && c || (Ja = (Ja || n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement), b = (Ja[0].contentWindow || Ja[0].contentDocument).document, b.write(), b.close(), c = La(a, b), Ja.detach()), Ka[a] = c), c
  2036. }
  2037. var Na = /^margin/,
  2038. Oa = new RegExp("^(" + T + ")(?!px)[a-z%]+$", "i"),
  2039. Pa = function(a, b, c, d) {
  2040. var e, f, g = {};
  2041. for (f in b) g[f] = a.style[f], a.style[f] = b[f];
  2042. e = c.apply(a, d || []);
  2043. for (f in b) a.style[f] = g[f];
  2044. return e
  2045. },
  2046. Qa = d.documentElement;
  2047. ! function() {
  2048. var b, c, e, f, g, h, i = d.createElement("div"),
  2049. j = d.createElement("div");
  2050. if (j.style) {
  2051. j.style.cssText = "float:left;opacity:.5", l.opacity = "0.5" === j.style.opacity, l.cssFloat = !!j.style.cssFloat, j.style.backgroundClip = "content-box", j.cloneNode(!0).style.backgroundClip = "", l.clearCloneStyle = "content-box" === j.style.backgroundClip, i = d.createElement("div"), i.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute", j.innerHTML = "", i.appendChild(j), l.boxSizing = "" === j.style.boxSizing || "" === j.style.MozBoxSizing || "" === j.style.WebkitBoxSizing, n.extend(l, {
  2052. reliableHiddenOffsets: function() {
  2053. return null == b && k(), f
  2054. },
  2055. boxSizingReliable: function() {
  2056. return null == b && k(), e
  2057. },
  2058. pixelMarginRight: function() {
  2059. return null == b && k(), c
  2060. },
  2061. pixelPosition: function() {
  2062. return null == b && k(), b
  2063. },
  2064. reliableMarginRight: function() {
  2065. return null == b && k(), g
  2066. },
  2067. reliableMarginLeft: function() {
  2068. return null == b && k(), h
  2069. }
  2070. });
  2071.  
  2072. function k() {
  2073. var k, l, m = d.documentElement;
  2074. m.appendChild(i), j.style.cssText = "-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%", b = e = h = !1, c = g = !0, a.getComputedStyle && (l = a.getComputedStyle(j), b = "1%" !== (l || {}).top, h = "2px" === (l || {}).marginLeft, e = "4px" === (l || {
  2075. width: "4px"
  2076. }).width, j.style.marginRight = "50%", c = "4px" === (l || {
  2077. marginRight: "4px"
  2078. }).marginRight, k = j.appendChild(d.createElement("div")), k.style.cssText = j.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", k.style.marginRight = k.style.width = "0", j.style.width = "1px", g = !parseFloat((a.getComputedStyle(k) || {}).marginRight), j.removeChild(k)), j.style.display = "none", f = 0 === j.getClientRects().length, f && (j.style.display = "", j.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", j.childNodes[0].style.borderCollapse = "separate", k = j.getElementsByTagName("td"), k[0].style.cssText = "margin:0;border:0;padding:0;display:none", f = 0 === k[0].offsetHeight, f && (k[0].style.display = "", k[1].style.display = "none", f = 0 === k[0].offsetHeight)), m.removeChild(i)
  2079. }
  2080. }
  2081. }();
  2082. var Ra, Sa, Ta = /^(top|right|bottom|left)$/;
  2083. a.getComputedStyle ? (Ra = function(b) {
  2084. var c = b.ownerDocument.defaultView;
  2085. return c && c.opener || (c = a), c.getComputedStyle(b)
  2086. }, Sa = function(a, b, c) {
  2087. var d, e, f, g, h = a.style;
  2088. return c = c || Ra(a), g = c ? c.getPropertyValue(b) || c[b] : void 0, "" !== g && void 0 !== g || n.contains(a.ownerDocument, a) || (g = n.style(a, b)), c && !l.pixelMarginRight() && Oa.test(g) && Na.test(b) && (d = h.width, e = h.minWidth, f = h.maxWidth, h.minWidth = h.maxWidth = h.width = g, g = c.width, h.width = d, h.minWidth = e, h.maxWidth = f), void 0 === g ? g : g + ""
  2089. }) : Qa.currentStyle && (Ra = function(a) {
  2090. return a.currentStyle
  2091. }, Sa = function(a, b, c) {
  2092. var d, e, f, g, h = a.style;
  2093. return c = c || Ra(a), g = c ? c[b] : void 0, null == g && h && h[b] && (g = h[b]), Oa.test(g) && !Ta.test(b) && (d = h.left, e = a.runtimeStyle, f = e && e.left, f && (e.left = a.currentStyle.left), h.left = "fontSize" === b ? "1em" : g, g = h.pixelLeft + "px", h.left = d, f && (e.left = f)), void 0 === g ? g : g + "" || "auto"
  2094. });
  2095.  
  2096. function Ua(a, b) {
  2097. return {
  2098. get: function() {
  2099. return a() ? void delete this.get : (this.get = b).apply(this, arguments)
  2100. }
  2101. }
  2102. }
  2103. var Va = /alpha\([^)]*\)/i,
  2104. Wa = /opacity\s*=\s*([^)]*)/i,
  2105. Xa = /^(none|table(?!-c[ea]).+)/,
  2106. Ya = new RegExp("^(" + T + ")(.*)$", "i"),
  2107. Za = {
  2108. position: "absolute",
  2109. visibility: "hidden",
  2110. display: "block"
  2111. },
  2112. $a = {
  2113. letterSpacing: "0",
  2114. fontWeight: "400"
  2115. },
  2116. _a = ["Webkit", "O", "Moz", "ms"],
  2117. ab = d.createElement("div").style;
  2118.  
  2119. function bb(a) {
  2120. if (a in ab) return a;
  2121. var b = a.charAt(0).toUpperCase() + a.slice(1),
  2122. c = _a.length;
  2123. while (c--)
  2124. if (a = _a[c] + b, a in ab) return a
  2125. }
  2126.  
  2127. function cb(a, b) {
  2128. for (var c, d, e, f = [], g = 0, h = a.length; h > g; g++) d = a[g], d.style && (f[g] = n._data(d, "olddisplay"), c = d.style.display, b ? (f[g] || "none" !== c || (d.style.display = ""), "" === d.style.display && W(d) && (f[g] = n._data(d, "olddisplay", Ma(d.nodeName)))) : (e = W(d), (c && "none" !== c || !e) && n._data(d, "olddisplay", e ? c : n.css(d, "display"))));
  2129. for (g = 0; h > g; g++) d = a[g], d.style && (b && "none" !== d.style.display && "" !== d.style.display || (d.style.display = b ? f[g] || "" : "none"));
  2130. return a
  2131. }
  2132.  
  2133. function db(a, b, c) {
  2134. var d = Ya.exec(b);
  2135. return d ? Math.max(0, d[1] - (c || 0)) + (d[2] || "px") : b
  2136. }
  2137.  
  2138. function eb(a, b, c, d, e) {
  2139. for (var f = c === (d ? "border" : "content") ? 4 : "width" === b ? 1 : 0, g = 0; 4 > f; f += 2) "margin" === c && (g += n.css(a, c + V[f], !0, e)), d ? ("content" === c && (g -= n.css(a, "padding" + V[f], !0, e)), "margin" !== c && (g -= n.css(a, "border" + V[f] + "Width", !0, e))) : (g += n.css(a, "padding" + V[f], !0, e), "padding" !== c && (g += n.css(a, "border" + V[f] + "Width", !0, e)));
  2140. return g
  2141. }
  2142.  
  2143. function fb(a, b, c) {
  2144. var d = !0,
  2145. e = "width" === b ? a.offsetWidth : a.offsetHeight,
  2146. f = Ra(a),
  2147. g = l.boxSizing && "border-box" === n.css(a, "boxSizing", !1, f);
  2148. if (0 >= e || null == e) {
  2149. if (e = Sa(a, b, f), (0 > e || null == e) && (e = a.style[b]), Oa.test(e)) return e;
  2150. d = g && (l.boxSizingReliable() || e === a.style[b]), e = parseFloat(e) || 0
  2151. }
  2152. return e + eb(a, b, c || (g ? "border" : "content"), d, f) + "px"
  2153. }
  2154. n.extend({
  2155. cssHooks: {
  2156. opacity: {
  2157. get: function(a, b) {
  2158. if (b) {
  2159. var c = Sa(a, "opacity");
  2160. return "" === c ? "1" : c
  2161. }
  2162. }
  2163. }
  2164. },
  2165. cssNumber: {
  2166. animationIterationCount: !0,
  2167. columnCount: !0,
  2168. fillOpacity: !0,
  2169. flexGrow: !0,
  2170. flexShrink: !0,
  2171. fontWeight: !0,
  2172. lineHeight: !0,
  2173. opacity: !0,
  2174. order: !0,
  2175. orphans: !0,
  2176. widows: !0,
  2177. zIndex: !0,
  2178. zoom: !0
  2179. },
  2180. cssProps: {
  2181. "float": l.cssFloat ? "cssFloat" : "styleFloat"
  2182. },
  2183. style: function(a, b, c, d) {
  2184. if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) {
  2185. var e, f, g, h = n.camelCase(b),
  2186. i = a.style;
  2187. if (b = n.cssProps[h] || (n.cssProps[h] = bb(h) || h), g = n.cssHooks[b] || n.cssHooks[h], void 0 === c) return g && "get" in g && void 0 !== (e = g.get(a, !1, d)) ? e : i[b];
  2188. if (f = typeof c, "string" === f && (e = U.exec(c)) && e[1] && (c = X(a, b, e), f = "number"), null != c && c === c && ("number" === f && (c += e && e[3] || (n.cssNumber[h] ? "" : "px")), l.clearCloneStyle || "" !== c || 0 !== b.indexOf("background") || (i[b] = "inherit"), !(g && "set" in g && void 0 === (c = g.set(a, c, d))))) try {
  2189. i[b] = c
  2190. } catch (j) {}
  2191. }
  2192. },
  2193. css: function(a, b, c, d) {
  2194. var e, f, g, h = n.camelCase(b);
  2195. return b = n.cssProps[h] || (n.cssProps[h] = bb(h) || h), g = n.cssHooks[b] || n.cssHooks[h], g && "get" in g && (f = g.get(a, !0, c)), void 0 === f && (f = Sa(a, b, d)), "normal" === f && b in $a && (f = $a[b]), "" === c || c ? (e = parseFloat(f), c === !0 || isFinite(e) ? e || 0 : f) : f
  2196. }
  2197. }), n.each(["height", "width"], function(a, b) {
  2198. n.cssHooks[b] = {
  2199. get: function(a, c, d) {
  2200. return c ? Xa.test(n.css(a, "display")) && 0 === a.offsetWidth ? Pa(a, Za, function() {
  2201. return fb(a, b, d)
  2202. }) : fb(a, b, d) : void 0
  2203. },
  2204. set: function(a, c, d) {
  2205. var e = d && Ra(a);
  2206. return db(a, c, d ? eb(a, b, d, l.boxSizing && "border-box" === n.css(a, "boxSizing", !1, e), e) : 0)
  2207. }
  2208. }
  2209. }), l.opacity || (n.cssHooks.opacity = {
  2210. get: function(a, b) {
  2211. return Wa.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : b ? "1" : ""
  2212. },
  2213. set: function(a, b) {
  2214. var c = a.style,
  2215. d = a.currentStyle,
  2216. e = n.isNumeric(b) ? "alpha(opacity=" + 100 * b + ")" : "",
  2217. f = d && d.filter || c.filter || "";
  2218. c.zoom = 1, (b >= 1 || "" === b) && "" === n.trim(f.replace(Va, "")) && c.removeAttribute && (c.removeAttribute("filter"), "" === b || d && !d.filter) || (c.filter = Va.test(f) ? f.replace(Va, e) : f + " " + e)
  2219. }
  2220. }), n.cssHooks.marginRight = Ua(l.reliableMarginRight, function(a, b) {
  2221. return b ? Pa(a, {
  2222. display: "inline-block"
  2223. }, Sa, [a, "marginRight"]) : void 0
  2224. }), n.cssHooks.marginLeft = Ua(l.reliableMarginLeft, function(a, b) {
  2225. return b ? (parseFloat(Sa(a, "marginLeft")) || (n.contains(a.ownerDocument, a) ? a.getBoundingClientRect().left - Pa(a, {
  2226. marginLeft: 0
  2227. }, function() {
  2228. return a.getBoundingClientRect().left
  2229. }) : 0)) + "px" : void 0
  2230. }), n.each({
  2231. margin: "",
  2232. padding: "",
  2233. border: "Width"
  2234. }, function(a, b) {
  2235. n.cssHooks[a + b] = {
  2236. expand: function(c) {
  2237. for (var d = 0, e = {}, f = "string" == typeof c ? c.split(" ") : [c]; 4 > d; d++) e[a + V[d] + b] = f[d] || f[d - 2] || f[0];
  2238. return e
  2239. }
  2240. }, Na.test(a) || (n.cssHooks[a + b].set = db)
  2241. }), n.fn.extend({
  2242. css: function(a, b) {
  2243. return Y(this, function(a, b, c) {
  2244. var d, e, f = {},
  2245. g = 0;
  2246. if (n.isArray(b)) {
  2247. for (d = Ra(a), e = b.length; e > g; g++) f[b[g]] = n.css(a, b[g], !1, d);
  2248. return f
  2249. }
  2250. return void 0 !== c ? n.style(a, b, c) : n.css(a, b)
  2251. }, a, b, arguments.length > 1)
  2252. },
  2253. show: function() {
  2254. return cb(this, !0)
  2255. },
  2256. hide: function() {
  2257. return cb(this)
  2258. },
  2259. toggle: function(a) {
  2260. return "boolean" == typeof a ? a ? this.show() : this.hide() : this.each(function() {
  2261. W(this) ? n(this).show() : n(this).hide()
  2262. })
  2263. }
  2264. });
  2265.  
  2266. function gb(a, b, c, d, e) {
  2267. return new gb.prototype.init(a, b, c, d, e)
  2268. }
  2269. n.Tween = gb, gb.prototype = {
  2270. constructor: gb,
  2271. init: function(a, b, c, d, e, f) {
  2272. this.elem = a, this.prop = c, this.easing = e || n.easing._default, this.options = b, this.start = this.now = this.cur(), this.end = d, this.unit = f || (n.cssNumber[c] ? "" : "px")
  2273. },
  2274. cur: function() {
  2275. var a = gb.propHooks[this.prop];
  2276. return a && a.get ? a.get(this) : gb.propHooks._default.get(this)
  2277. },
  2278. run: function(a) {
  2279. var b, c = gb.propHooks[this.prop];
  2280. return this.options.duration ? this.pos = b = n.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) : gb.propHooks._default.set(this), this
  2281. }
  2282. }, gb.prototype.init.prototype = gb.prototype, gb.propHooks = {
  2283. _default: {
  2284. get: function(a) {
  2285. var b;
  2286. return 1 !== a.elem.nodeType || null != a.elem[a.prop] && null == a.elem.style[a.prop] ? a.elem[a.prop] : (b = n.css(a.elem, a.prop, ""), b && "auto" !== b ? b : 0)
  2287. },
  2288. set: function(a) {
  2289. n.fx.step[a.prop] ? n.fx.step[a.prop](a) : 1 !== a.elem.nodeType || null == a.elem.style[n.cssProps[a.prop]] && !n.cssHooks[a.prop] ? a.elem[a.prop] = a.now : n.style(a.elem, a.prop, a.now + a.unit)
  2290. }
  2291. }
  2292. }, gb.propHooks.scrollTop = gb.propHooks.scrollLeft = {
  2293. set: function(a) {
  2294. a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now)
  2295. }
  2296. }, n.easing = {
  2297. linear: function(a) {
  2298. return a
  2299. },
  2300. swing: function(a) {
  2301. return .5 - Math.cos(a * Math.PI) / 2
  2302. },
  2303. _default: "swing"
  2304. }, n.fx = gb.prototype.init, n.fx.step = {};
  2305. var hb, ib, jb = /^(?:toggle|show|hide)$/,
  2306. kb = /queueHooks$/;
  2307.  
  2308. function lb() {
  2309. return a.setTimeout(function() {
  2310. hb = void 0
  2311. }), hb = n.now()
  2312. }
  2313.  
  2314. function mb(a, b) {
  2315. var c, d = {
  2316. height: a
  2317. },
  2318. e = 0;
  2319. for (b = b ? 1 : 0; 4 > e; e += 2 - b) c = V[e], d["margin" + c] = d["padding" + c] = a;
  2320. return b && (d.opacity = d.width = a), d
  2321. }
  2322.  
  2323. function nb(a, b, c) {
  2324. for (var d, e = (qb.tweeners[b] || []).concat(qb.tweeners["*"]), f = 0, g = e.length; g > f; f++)
  2325. if (d = e[f].call(c, b, a)) return d
  2326. }
  2327.  
  2328. function ob(a, b, c) {
  2329. var d, e, f, g, h, i, j, k, m = this,
  2330. o = {},
  2331. p = a.style,
  2332. q = a.nodeType && W(a),
  2333. r = n._data(a, "fxshow");
  2334. c.queue || (h = n._queueHooks(a, "fx"), null == h.unqueued && (h.unqueued = 0, i = h.empty.fire, h.empty.fire = function() {
  2335. h.unqueued || i()
  2336. }), h.unqueued++, m.always(function() {
  2337. m.always(function() {
  2338. h.unqueued--, n.queue(a, "fx").length || h.empty.fire()
  2339. })
  2340. })), 1 === a.nodeType && ("height" in b || "width" in b) && (c.overflow = [p.overflow, p.overflowX, p.overflowY], j = n.css(a, "display"), k = "none" === j ? n._data(a, "olddisplay") || Ma(a.nodeName) : j, "inline" === k && "none" === n.css(a, "float") && (l.inlineBlockNeedsLayout && "inline" !== Ma(a.nodeName) ? p.zoom = 1 : p.display = "inline-block")), c.overflow && (p.overflow = "hidden", l.shrinkWrapBlocks() || m.always(function() {
  2341. p.overflow = c.overflow[0], p.overflowX = c.overflow[1], p.overflowY = c.overflow[2]
  2342. }));
  2343. for (d in b)
  2344. if (e = b[d], jb.exec(e)) {
  2345. if (delete b[d], f = f || "toggle" === e, e === (q ? "hide" : "show")) {
  2346. if ("show" !== e || !r || void 0 === r[d]) continue;
  2347. q = !0
  2348. }
  2349. o[d] = r && r[d] || n.style(a, d)
  2350. } else j = void 0;
  2351. if (n.isEmptyObject(o)) "inline" === ("none" === j ? Ma(a.nodeName) : j) && (p.display = j);
  2352. else {
  2353. r ? "hidden" in r && (q = r.hidden) : r = n._data(a, "fxshow", {}), f && (r.hidden = !q), q ? n(a).show() : m.done(function() {
  2354. n(a).hide()
  2355. }), m.done(function() {
  2356. var b;
  2357. n._removeData(a, "fxshow");
  2358. for (b in o) n.style(a, b, o[b])
  2359. });
  2360. for (d in o) g = nb(q ? r[d] : 0, d, m), d in r || (r[d] = g.start, q && (g.end = g.start, g.start = "width" === d || "height" === d ? 1 : 0))
  2361. }
  2362. }
  2363.  
  2364. function pb(a, b) {
  2365. var c, d, e, f, g;
  2366. for (c in a)
  2367. if (d = n.camelCase(c), e = b[d], f = a[c], n.isArray(f) && (e = f[1], f = a[c] = f[0]), c !== d && (a[d] = f, delete a[c]), g = n.cssHooks[d], g && "expand" in g) {
  2368. f = g.expand(f), delete a[d];
  2369. for (c in f) c in a || (a[c] = f[c], b[c] = e)
  2370. } else b[d] = e
  2371. }
  2372.  
  2373. function qb(a, b, c) {
  2374. var d, e, f = 0,
  2375. g = qb.prefilters.length,
  2376. h = n.Deferred().always(function() {
  2377. delete i.elem
  2378. }),
  2379. i = function() {
  2380. if (e) return !1;
  2381. for (var b = hb || lb(), c = Math.max(0, j.startTime + j.duration - b), d = c / j.duration || 0, f = 1 - d, g = 0, i = j.tweens.length; i > g; g++) j.tweens[g].run(f);
  2382. return h.notifyWith(a, [j, f, c]), 1 > f && i ? c : (h.resolveWith(a, [j]), !1)
  2383. },
  2384. j = h.promise({
  2385. elem: a,
  2386. props: n.extend({}, b),
  2387. opts: n.extend(!0, {
  2388. specialEasing: {},
  2389. easing: n.easing._default
  2390. }, c),
  2391. originalProperties: b,
  2392. originalOptions: c,
  2393. startTime: hb || lb(),
  2394. duration: c.duration,
  2395. tweens: [],
  2396. createTween: function(b, c) {
  2397. var d = n.Tween(a, j.opts, b, c, j.opts.specialEasing[b] || j.opts.easing);
  2398. return j.tweens.push(d), d
  2399. },
  2400. stop: function(b) {
  2401. var c = 0,
  2402. d = b ? j.tweens.length : 0;
  2403. if (e) return this;
  2404. for (e = !0; d > c; c++) j.tweens[c].run(1);
  2405. return b ? (h.notifyWith(a, [j, 1, 0]), h.resolveWith(a, [j, b])) : h.rejectWith(a, [j, b]), this
  2406. }
  2407. }),
  2408. k = j.props;
  2409. for (pb(k, j.opts.specialEasing); g > f; f++)
  2410. if (d = qb.prefilters[f].call(j, a, k, j.opts)) return n.isFunction(d.stop) && (n._queueHooks(j.elem, j.opts.queue).stop = n.proxy(d.stop, d)), d;
  2411. return n.map(k, nb, j), n.isFunction(j.opts.start) && j.opts.start.call(a, j), n.fx.timer(n.extend(i, {
  2412. elem: a,
  2413. anim: j,
  2414. queue: j.opts.queue
  2415. })), j.progress(j.opts.progress).done(j.opts.done, j.opts.complete).fail(j.opts.fail).always(j.opts.always)
  2416. }
  2417. n.Animation = n.extend(qb, {
  2418. tweeners: {
  2419. "*": [function(a, b) {
  2420. var c = this.createTween(a, b);
  2421. return X(c.elem, a, U.exec(b), c), c
  2422. }]
  2423. },
  2424. tweener: function(a, b) {
  2425. n.isFunction(a) ? (b = a, a = ["*"]) : a = a.match(G);
  2426. for (var c, d = 0, e = a.length; e > d; d++) c = a[d], qb.tweeners[c] = qb.tweeners[c] || [], qb.tweeners[c].unshift(b)
  2427. },
  2428. prefilters: [ob],
  2429. prefilter: function(a, b) {
  2430. b ? qb.prefilters.unshift(a) : qb.prefilters.push(a)
  2431. }
  2432. }), n.speed = function(a, b, c) {
  2433. var d = a && "object" == typeof a ? n.extend({}, a) : {
  2434. complete: c || !c && b || n.isFunction(a) && a,
  2435. duration: a,
  2436. easing: c && b || b && !n.isFunction(b) && b
  2437. };
  2438. return d.duration = n.fx.off ? 0 : "number" == typeof d.duration ? d.duration : d.duration in n.fx.speeds ? n.fx.speeds[d.duration] : n.fx.speeds._default, null != d.queue && d.queue !== !0 || (d.queue = "fx"), d.old = d.complete, d.complete = function() {
  2439. n.isFunction(d.old) && d.old.call(this), d.queue && n.dequeue(this, d.queue)
  2440. }, d
  2441. }, n.fn.extend({
  2442. fadeTo: function(a, b, c, d) {
  2443. return this.filter(W).css("opacity", 0).show().end().animate({
  2444. opacity: b
  2445. }, a, c, d)
  2446. },
  2447. animate: function(a, b, c, d) {
  2448. var e = n.isEmptyObject(a),
  2449. f = n.speed(b, c, d),
  2450. g = function() {
  2451. var b = qb(this, n.extend({}, a), f);
  2452. (e || n._data(this, "finish")) && b.stop(!0)
  2453. };
  2454. return g.finish = g, e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g)
  2455. },
  2456. stop: function(a, b, c) {
  2457. var d = function(a) {
  2458. var b = a.stop;
  2459. delete a.stop, b(c)
  2460. };
  2461. return "string" != typeof a && (c = b, b = a, a = void 0), b && a !== !1 && this.queue(a || "fx", []), this.each(function() {
  2462. var b = !0,
  2463. e = null != a && a + "queueHooks",
  2464. f = n.timers,
  2465. g = n._data(this);
  2466. if (e) g[e] && g[e].stop && d(g[e]);
  2467. else
  2468. for (e in g) g[e] && g[e].stop && kb.test(e) && d(g[e]);
  2469. for (e = f.length; e--;) f[e].elem !== this || null != a && f[e].queue !== a || (f[e].anim.stop(c), b = !1, f.splice(e, 1));
  2470. !b && c || n.dequeue(this, a)
  2471. })
  2472. },
  2473. finish: function(a) {
  2474. return a !== !1 && (a = a || "fx"), this.each(function() {
  2475. var b, c = n._data(this),
  2476. d = c[a + "queue"],
  2477. e = c[a + "queueHooks"],
  2478. f = n.timers,
  2479. g = d ? d.length : 0;
  2480. for (c.finish = !0, n.queue(this, a, []), e && e.stop && e.stop.call(this, !0), b = f.length; b--;) f[b].elem === this && f[b].queue === a && (f[b].anim.stop(!0), f.splice(b, 1));
  2481. for (b = 0; g > b; b++) d[b] && d[b].finish && d[b].finish.call(this);
  2482. delete c.finish
  2483. })
  2484. }
  2485. }), n.each(["toggle", "show", "hide"], function(a, b) {
  2486. var c = n.fn[b];
  2487. n.fn[b] = function(a, d, e) {
  2488. return null == a || "boolean" == typeof a ? c.apply(this, arguments) : this.animate(mb(b, !0), a, d, e)
  2489. }
  2490. }), n.each({
  2491. slideDown: mb("show"),
  2492. slideUp: mb("hide"),
  2493. slideToggle: mb("toggle"),
  2494. fadeIn: {
  2495. opacity: "show"
  2496. },
  2497. fadeOut: {
  2498. opacity: "hide"
  2499. },
  2500. fadeToggle: {
  2501. opacity: "toggle"
  2502. }
  2503. }, function(a, b) {
  2504. n.fn[a] = function(a, c, d) {
  2505. return this.animate(b, a, c, d)
  2506. }
  2507. }), n.timers = [], n.fx.tick = function() {
  2508. var a, b = n.timers,
  2509. c = 0;
  2510. for (hb = n.now(); c < b.length; c++) a = b[c], a() || b[c] !== a || b.splice(c--, 1);
  2511. b.length || n.fx.stop(), hb = void 0
  2512. }, n.fx.timer = function(a) {
  2513. n.timers.push(a), a() ? n.fx.start() : n.timers.pop()
  2514. }, n.fx.interval = 13, n.fx.start = function() {
  2515. ib || (ib = a.setInterval(n.fx.tick, n.fx.interval))
  2516. }, n.fx.stop = function() {
  2517. a.clearInterval(ib), ib = null
  2518. }, n.fx.speeds = {
  2519. slow: 600,
  2520. fast: 200,
  2521. _default: 400
  2522. }, n.fn.delay = function(b, c) {
  2523. return b = n.fx ? n.fx.speeds[b] || b : b, c = c || "fx", this.queue(c, function(c, d) {
  2524. var e = a.setTimeout(c, b);
  2525. d.stop = function() {
  2526. a.clearTimeout(e)
  2527. }
  2528. })
  2529. },
  2530. function() {
  2531. var a, b = d.createElement("input"),
  2532. c = d.createElement("div"),
  2533. e = d.createElement("select"),
  2534. f = e.appendChild(d.createElement("option"));
  2535. c = d.createElement("div"), c.setAttribute("className", "t"), c.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", a = c.getElementsByTagName("a")[0], b.setAttribute("type", "checkbox"), c.appendChild(b), a = c.getElementsByTagName("a")[0], a.style.cssText = "top:1px", l.getSetAttribute = "t" !== c.className, l.style = /top/.test(a.getAttribute("style")), l.hrefNormalized = "/a" === a.getAttribute("href"), l.checkOn = !!b.value, l.optSelected = f.selected, l.enctype = !!d.createElement("form").enctype, e.disabled = !0, l.optDisabled = !f.disabled, b = d.createElement("input"), b.setAttribute("value", ""), l.input = "" === b.getAttribute("value"), b.value = "t", b.setAttribute("type", "radio"), l.radioValue = "t" === b.value
  2536. }();
  2537. var rb = /\r/g,
  2538. sb = /[\x20\t\r\n\f]+/g;
  2539. n.fn.extend({
  2540. val: function(a) {
  2541. var b, c, d, e = this[0]; {
  2542. if (arguments.length) return d = n.isFunction(a), this.each(function(c) {
  2543. var e;
  2544. 1 === this.nodeType && (e = d ? a.call(this, c, n(this).val()) : a, null == e ? e = "" : "number" == typeof e ? e += "" : n.isArray(e) && (e = n.map(e, function(a) {
  2545. return null == a ? "" : a + ""
  2546. })), b = n.valHooks[this.type] || n.valHooks[this.nodeName.toLowerCase()], b && "set" in b && void 0 !== b.set(this, e, "value") || (this.value = e))
  2547. });
  2548. if (e) return b = n.valHooks[e.type] || n.valHooks[e.nodeName.toLowerCase()], b && "get" in b && void 0 !== (c = b.get(e, "value")) ? c : (c = e.value, "string" == typeof c ? c.replace(rb, "") : null == c ? "" : c)
  2549. }
  2550. }
  2551. }), n.extend({
  2552. valHooks: {
  2553. option: {
  2554. get: function(a) {
  2555. var b = n.find.attr(a, "value");
  2556. return null != b ? b : n.trim(n.text(a)).replace(sb, " ")
  2557. }
  2558. },
  2559. select: {
  2560. get: function(a) {
  2561. for (var b, c, d = a.options, e = a.selectedIndex, f = "select-one" === a.type || 0 > e, g = f ? null : [], h = f ? e + 1 : d.length, i = 0 > e ? h : f ? e : 0; h > i; i++)
  2562. if (c = d[i], (c.selected || i === e) && (l.optDisabled ? !c.disabled : null === c.getAttribute("disabled")) && (!c.parentNode.disabled || !n.nodeName(c.parentNode, "optgroup"))) {
  2563. if (b = n(c).val(), f) return b;
  2564. g.push(b)
  2565. }
  2566. return g
  2567. },
  2568. set: function(a, b) {
  2569. var c, d, e = a.options,
  2570. f = n.makeArray(b),
  2571. g = e.length;
  2572. while (g--)
  2573. if (d = e[g], n.inArray(n.valHooks.option.get(d), f) > -1) try {
  2574. d.selected = c = !0
  2575. } catch (h) {
  2576. d.scrollHeight
  2577. } else d.selected = !1;
  2578. return c || (a.selectedIndex = -1), e
  2579. }
  2580. }
  2581. }
  2582. }), n.each(["radio", "checkbox"], function() {
  2583. n.valHooks[this] = {
  2584. set: function(a, b) {
  2585. return n.isArray(b) ? a.checked = n.inArray(n(a).val(), b) > -1 : void 0
  2586. }
  2587. }, l.checkOn || (n.valHooks[this].get = function(a) {
  2588. return null === a.getAttribute("value") ? "on" : a.value
  2589. })
  2590. });
  2591. var tb, ub, vb = n.expr.attrHandle,
  2592. wb = /^(?:checked|selected)$/i,
  2593. xb = l.getSetAttribute,
  2594. yb = l.input;
  2595. n.fn.extend({
  2596. attr: function(a, b) {
  2597. return Y(this, n.attr, a, b, arguments.length > 1)
  2598. },
  2599. removeAttr: function(a) {
  2600. return this.each(function() {
  2601. n.removeAttr(this, a)
  2602. })
  2603. }
  2604. }), n.extend({
  2605. attr: function(a, b, c) {
  2606. var d, e, f = a.nodeType;
  2607. if (3 !== f && 8 !== f && 2 !== f) return "undefined" == typeof a.getAttribute ? n.prop(a, b, c) : (1 === f && n.isXMLDoc(a) || (b = b.toLowerCase(), e = n.attrHooks[b] || (n.expr.match.bool.test(b) ? ub : tb)), void 0 !== c ? null === c ? void n.removeAttr(a, b) : e && "set" in e && void 0 !== (d = e.set(a, c, b)) ? d : (a.setAttribute(b, c + ""), c) : e && "get" in e && null !== (d = e.get(a, b)) ? d : (d = n.find.attr(a, b), null == d ? void 0 : d))
  2608. },
  2609. attrHooks: {
  2610. type: {
  2611. set: function(a, b) {
  2612. if (!l.radioValue && "radio" === b && n.nodeName(a, "input")) {
  2613. var c = a.value;
  2614. return a.setAttribute("type", b), c && (a.value = c), b
  2615. }
  2616. }
  2617. }
  2618. },
  2619. removeAttr: function(a, b) {
  2620. var c, d, e = 0,
  2621. f = b && b.match(G);
  2622. if (f && 1 === a.nodeType)
  2623. while (c = f[e++]) d = n.propFix[c] || c, n.expr.match.bool.test(c) ? yb && xb || !wb.test(c) ? a[d] = !1 : a[n.camelCase("default-" + c)] = a[d] = !1 : n.attr(a, c, ""), a.removeAttribute(xb ? c : d)
  2624. }
  2625. }), ub = {
  2626. set: function(a, b, c) {
  2627. return b === !1 ? n.removeAttr(a, c) : yb && xb || !wb.test(c) ? a.setAttribute(!xb && n.propFix[c] || c, c) : a[n.camelCase("default-" + c)] = a[c] = !0, c
  2628. }
  2629. }, n.each(n.expr.match.bool.source.match(/\w+/g), function(a, b) {
  2630. var c = vb[b] || n.find.attr;
  2631. yb && xb || !wb.test(b) ? vb[b] = function(a, b, d) {
  2632. var e, f;
  2633. return d || (f = vb[b], vb[b] = e, e = null != c(a, b, d) ? b.toLowerCase() : null, vb[b] = f), e
  2634. } : vb[b] = function(a, b, c) {
  2635. return c ? void 0 : a[n.camelCase("default-" + b)] ? b.toLowerCase() : null
  2636. }
  2637. }), yb && xb || (n.attrHooks.value = {
  2638. set: function(a, b, c) {
  2639. return n.nodeName(a, "input") ? void(a.defaultValue = b) : tb && tb.set(a, b, c)
  2640. }
  2641. }), xb || (tb = {
  2642. set: function(a, b, c) {
  2643. var d = a.getAttributeNode(c);
  2644. return d || a.setAttributeNode(d = a.ownerDocument.createAttribute(c)), d.value = b += "", "value" === c || b === a.getAttribute(c) ? b : void 0
  2645. }
  2646. }, vb.id = vb.name = vb.coords = function(a, b, c) {
  2647. var d;
  2648. return c ? void 0 : (d = a.getAttributeNode(b)) && "" !== d.value ? d.value : null
  2649. }, n.valHooks.button = {
  2650. get: function(a, b) {
  2651. var c = a.getAttributeNode(b);
  2652. return c && c.specified ? c.value : void 0
  2653. },
  2654. set: tb.set
  2655. }, n.attrHooks.contenteditable = {
  2656. set: function(a, b, c) {
  2657. tb.set(a, "" === b ? !1 : b, c)
  2658. }
  2659. }, n.each(["width", "height"], function(a, b) {
  2660. n.attrHooks[b] = {
  2661. set: function(a, c) {
  2662. return "" === c ? (a.setAttribute(b, "auto"), c) : void 0
  2663. }
  2664. }
  2665. })), l.style || (n.attrHooks.style = {
  2666. get: function(a) {
  2667. return a.style.cssText || void 0
  2668. },
  2669. set: function(a, b) {
  2670. return a.style.cssText = b + ""
  2671. }
  2672. });
  2673. var zb = /^(?:input|select|textarea|button|object)$/i,
  2674. Ab = /^(?:a|area)$/i;
  2675. n.fn.extend({
  2676. prop: function(a, b) {
  2677. return Y(this, n.prop, a, b, arguments.length > 1)
  2678. },
  2679. removeProp: function(a) {
  2680. return a = n.propFix[a] || a, this.each(function() {
  2681. try {
  2682. this[a] = void 0, delete this[a]
  2683. } catch (b) {}
  2684. })
  2685. }
  2686. }), n.extend({
  2687. prop: function(a, b, c) {
  2688. var d, e, f = a.nodeType;
  2689. if (3 !== f && 8 !== f && 2 !== f) return 1 === f && n.isXMLDoc(a) || (b = n.propFix[b] || b, e = n.propHooks[b]), void 0 !== c ? e && "set" in e && void 0 !== (d = e.set(a, c, b)) ? d : a[b] = c : e && "get" in e && null !== (d = e.get(a, b)) ? d : a[b]
  2690. },
  2691. propHooks: {
  2692. tabIndex: {
  2693. get: function(a) {
  2694. var b = n.find.attr(a, "tabindex");
  2695. return b ? parseInt(b, 10) : zb.test(a.nodeName) || Ab.test(a.nodeName) && a.href ? 0 : -1
  2696. }
  2697. }
  2698. },
  2699. propFix: {
  2700. "for": "htmlFor",
  2701. "class": "className"
  2702. }
  2703. }), l.hrefNormalized || n.each(["href", "src"], function(a, b) {
  2704. n.propHooks[b] = {
  2705. get: function(a) {
  2706. return a.getAttribute(b, 4)
  2707. }
  2708. }
  2709. }), l.optSelected || (n.propHooks.selected = {
  2710. get: function(a) {
  2711. var b = a.parentNode;
  2712. return b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex), null
  2713. },
  2714. set: function(a) {
  2715. var b = a.parentNode;
  2716. b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex)
  2717. }
  2718. }), n.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() {
  2719. n.propFix[this.toLowerCase()] = this
  2720. }), l.enctype || (n.propFix.enctype = "encoding");
  2721. var Bb = /[\t\r\n\f]/g;
  2722.  
  2723. function Cb(a) {
  2724. return n.attr(a, "class") || ""
  2725. }
  2726. n.fn.extend({
  2727. addClass: function(a) {
  2728. var b, c, d, e, f, g, h, i = 0;
  2729. if (n.isFunction(a)) return this.each(function(b) {
  2730. n(this).addClass(a.call(this, b, Cb(this)))
  2731. });
  2732. if ("string" == typeof a && a) {
  2733. b = a.match(G) || [];
  2734. while (c = this[i++])
  2735. if (e = Cb(c), d = 1 === c.nodeType && (" " + e + " ").replace(Bb, " ")) {
  2736. g = 0;
  2737. while (f = b[g++]) d.indexOf(" " + f + " ") < 0 && (d += f + " ");
  2738. h = n.trim(d), e !== h && n.attr(c, "class", h)
  2739. }
  2740. }
  2741. return this
  2742. },
  2743. removeClass: function(a) {
  2744. var b, c, d, e, f, g, h, i = 0;
  2745. if (n.isFunction(a)) return this.each(function(b) {
  2746. n(this).removeClass(a.call(this, b, Cb(this)))
  2747. });
  2748. if (!arguments.length) return this.attr("class", "");
  2749. if ("string" == typeof a && a) {
  2750. b = a.match(G) || [];
  2751. while (c = this[i++])
  2752. if (e = Cb(c), d = 1 === c.nodeType && (" " + e + " ").replace(Bb, " ")) {
  2753. g = 0;
  2754. while (f = b[g++])
  2755. while (d.indexOf(" " + f + " ") > -1) d = d.replace(" " + f + " ", " ");
  2756. h = n.trim(d), e !== h && n.attr(c, "class", h)
  2757. }
  2758. }
  2759. return this
  2760. },
  2761. toggleClass: function(a, b) {
  2762. var c = typeof a;
  2763. return "boolean" == typeof b && "string" === c ? b ? this.addClass(a) : this.removeClass(a) : n.isFunction(a) ? this.each(function(c) {
  2764. n(this).toggleClass(a.call(this, c, Cb(this), b), b)
  2765. }) : this.each(function() {
  2766. var b, d, e, f;
  2767. if ("string" === c) {
  2768. d = 0, e = n(this), f = a.match(G) || [];
  2769. while (b = f[d++]) e.hasClass(b) ? e.removeClass(b) : e.addClass(b)
  2770. } else void 0 !== a && "boolean" !== c || (b = Cb(this), b && n._data(this, "__className__", b), n.attr(this, "class", b || a === !1 ? "" : n._data(this, "__className__") || ""))
  2771. })
  2772. },
  2773. hasClass: function(a) {
  2774. var b, c, d = 0;
  2775. b = " " + a + " ";
  2776. while (c = this[d++])
  2777. if (1 === c.nodeType && (" " + Cb(c) + " ").replace(Bb, " ").indexOf(b) > -1) return !0;
  2778. return !1
  2779. }
  2780. }), n.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) {
  2781. n.fn[b] = function(a, c) {
  2782. return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b)
  2783. }
  2784. }), n.fn.extend({
  2785. hover: function(a, b) {
  2786. return this.mouseenter(a).mouseleave(b || a)
  2787. }
  2788. });
  2789. var Db = a.location,
  2790. Eb = n.now(),
  2791. Fb = /\?/,
  2792. Gb = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
  2793. n.parseJSON = function(b) {
  2794. if (a.JSON && a.JSON.parse) return a.JSON.parse(b + "");
  2795. var c, d = null,
  2796. e = n.trim(b + "");
  2797. return e && !n.trim(e.replace(Gb, function(a, b, e, f) {
  2798. return c && b && (d = 0), 0 === d ? a : (c = e || b, d += !f - !e, "")
  2799. })) ? Function("return " + e)() : n.error("Invalid JSON: " + b)
  2800. }, n.parseXML = function(b) {
  2801. var c, d;
  2802. if (!b || "string" != typeof b) return null;
  2803. try {
  2804. a.DOMParser ? (d = new a.DOMParser, c = d.parseFromString(b, "text/xml")) : (c = new a.ActiveXObject("Microsoft.XMLDOM"), c.async = "false", c.loadXML(b))
  2805. } catch (e) {
  2806. c = void 0
  2807. }
  2808. return c && c.documentElement && !c.getElementsByTagName("parsererror").length || n.error("Invalid XML: " + b), c
  2809. };
  2810. var Hb = /#.*$/,
  2811. Ib = /([?&])_=[^&]*/,
  2812. Jb = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm,
  2813. Kb = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  2814. Lb = /^(?:GET|HEAD)$/,
  2815. Mb = /^\/\//,
  2816. Nb = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
  2817. Ob = {},
  2818. Pb = {},
  2819. Qb = "*/".concat("*"),
  2820. Rb = Db.href,
  2821. Sb = Nb.exec(Rb.toLowerCase()) || [];
  2822.  
  2823. function Tb(a) {
  2824. return function(b, c) {
  2825. "string" != typeof b && (c = b, b = "*");
  2826. var d, e = 0,
  2827. f = b.toLowerCase().match(G) || [];
  2828. if (n.isFunction(c))
  2829. while (d = f[e++]) "+" === d.charAt(0) ? (d = d.slice(1) || "*", (a[d] = a[d] || []).unshift(c)) : (a[d] = a[d] || []).push(c)
  2830. }
  2831. }
  2832.  
  2833. function Ub(a, b, c, d) {
  2834. var e = {},
  2835. f = a === Pb;
  2836.  
  2837. function g(h) {
  2838. var i;
  2839. return e[h] = !0, n.each(a[h] || [], function(a, h) {
  2840. var j = h(b, c, d);
  2841. return "string" != typeof j || f || e[j] ? f ? !(i = j) : void 0 : (b.dataTypes.unshift(j), g(j), !1)
  2842. }), i
  2843. }
  2844. return g(b.dataTypes[0]) || !e["*"] && g("*")
  2845. }
  2846.  
  2847. function Vb(a, b) {
  2848. var c, d, e = n.ajaxSettings.flatOptions || {};
  2849. for (d in b) void 0 !== b[d] && ((e[d] ? a : c || (c = {}))[d] = b[d]);
  2850. return c && n.extend(!0, a, c), a
  2851. }
  2852.  
  2853. function Wb(a, b, c) {
  2854. var d, e, f, g, h = a.contents,
  2855. i = a.dataTypes;
  2856. while ("*" === i[0]) i.shift(), void 0 === e && (e = a.mimeType || b.getResponseHeader("Content-Type"));
  2857. if (e)
  2858. for (g in h)
  2859. if (h[g] && h[g].test(e)) {
  2860. i.unshift(g);
  2861. break
  2862. }
  2863. if (i[0] in c) f = i[0];
  2864. else {
  2865. for (g in c) {
  2866. if (!i[0] || a.converters[g + " " + i[0]]) {
  2867. f = g;
  2868. break
  2869. }
  2870. d || (d = g)
  2871. }
  2872. f = f || d
  2873. }
  2874. return f ? (f !== i[0] && i.unshift(f), c[f]) : void 0
  2875. }
  2876.  
  2877. function Xb(a, b, c, d) {
  2878. var e, f, g, h, i, j = {},
  2879. k = a.dataTypes.slice();
  2880. if (k[1])
  2881. for (g in a.converters) j[g.toLowerCase()] = a.converters[g];
  2882. f = k.shift();
  2883. while (f)
  2884. if (a.responseFields[f] && (c[a.responseFields[f]] = b), !i && d && a.dataFilter && (b = a.dataFilter(b, a.dataType)), i = f, f = k.shift())
  2885. if ("*" === f) f = i;
  2886. else if ("*" !== i && i !== f) {
  2887. if (g = j[i + " " + f] || j["* " + f], !g)
  2888. for (e in j)
  2889. if (h = e.split(" "), h[1] === f && (g = j[i + " " + h[0]] || j["* " + h[0]])) {
  2890. g === !0 ? g = j[e] : j[e] !== !0 && (f = h[0], k.unshift(h[1]));
  2891. break
  2892. }
  2893. if (g !== !0)
  2894. if (g && a["throws"]) b = g(b);
  2895. else try {
  2896. b = g(b)
  2897. } catch (l) {
  2898. return {
  2899. state: "parsererror",
  2900. error: g ? l : "No conversion from " + i + " to " + f
  2901. }
  2902. }
  2903. }
  2904. return {
  2905. state: "success",
  2906. data: b
  2907. }
  2908. }
  2909. n.extend({
  2910. active: 0,
  2911. lastModified: {},
  2912. etag: {},
  2913. ajaxSettings: {
  2914. url: Rb,
  2915. type: "GET",
  2916. isLocal: Kb.test(Sb[1]),
  2917. global: !0,
  2918. processData: !0,
  2919. async: !0,
  2920. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  2921. accepts: {
  2922. "*": Qb,
  2923. text: "text/plain",
  2924. html: "text/html",
  2925. xml: "application/xml, text/xml",
  2926. json: "application/json, text/javascript"
  2927. },
  2928. contents: {
  2929. xml: /\bxml\b/,
  2930. html: /\bhtml/,
  2931. json: /\bjson\b/
  2932. },
  2933. responseFields: {
  2934. xml: "responseXML",
  2935. text: "responseText",
  2936. json: "responseJSON"
  2937. },
  2938. converters: {
  2939. "* text": String,
  2940. "text html": !0,
  2941. "text json": n.parseJSON,
  2942. "text xml": n.parseXML
  2943. },
  2944. flatOptions: {
  2945. url: !0,
  2946. context: !0
  2947. }
  2948. },
  2949. ajaxSetup: function(a, b) {
  2950. return b ? Vb(Vb(a, n.ajaxSettings), b) : Vb(n.ajaxSettings, a)
  2951. },
  2952. ajaxPrefilter: Tb(Ob),
  2953. ajaxTransport: Tb(Pb),
  2954. ajax: function(b, c) {
  2955. "object" == typeof b && (c = b, b = void 0), c = c || {};
  2956. var d, e, f, g, h, i, j, k, l = n.ajaxSetup({}, c),
  2957. m = l.context || l,
  2958. o = l.context && (m.nodeType || m.jquery) ? n(m) : n.event,
  2959. p = n.Deferred(),
  2960. q = n.Callbacks("once memory"),
  2961. r = l.statusCode || {},
  2962. s = {},
  2963. t = {},
  2964. u = 0,
  2965. v = "canceled",
  2966. w = {
  2967. readyState: 0,
  2968. getResponseHeader: function(a) {
  2969. var b;
  2970. if (2 === u) {
  2971. if (!k) {
  2972. k = {};
  2973. while (b = Jb.exec(g)) k[b[1].toLowerCase()] = b[2]
  2974. }
  2975. b = k[a.toLowerCase()]
  2976. }
  2977. return null == b ? null : b
  2978. },
  2979. getAllResponseHeaders: function() {
  2980. return 2 === u ? g : null
  2981. },
  2982. setRequestHeader: function(a, b) {
  2983. var c = a.toLowerCase();
  2984. return u || (a = t[c] = t[c] || a, s[a] = b), this
  2985. },
  2986. overrideMimeType: function(a) {
  2987. return u || (l.mimeType = a), this
  2988. },
  2989. statusCode: function(a) {
  2990. var b;
  2991. if (a)
  2992. if (2 > u)
  2993. for (b in a) r[b] = [r[b], a[b]];
  2994. else w.always(a[w.status]);
  2995. return this
  2996. },
  2997. abort: function(a) {
  2998. var b = a || v;
  2999. return j && j.abort(b), y(0, b), this
  3000. }
  3001. };
  3002. if (p.promise(w).complete = q.add, w.success = w.done, w.error = w.fail, l.url = ((b || l.url || Rb) + "").replace(Hb, "").replace(Mb, Sb[1] + "//"), l.type = c.method || c.type || l.method || l.type, l.dataTypes = n.trim(l.dataType || "*").toLowerCase().match(G) || [""], null == l.crossDomain && (d = Nb.exec(l.url.toLowerCase()), l.crossDomain = !(!d || d[1] === Sb[1] && d[2] === Sb[2] && (d[3] || ("http:" === d[1] ? "80" : "443")) === (Sb[3] || ("http:" === Sb[1] ? "80" : "443")))), l.data && l.processData && "string" != typeof l.data && (l.data = n.param(l.data, l.traditional)), Ub(Ob, l, c, w), 2 === u) return w;
  3003. i = n.event && l.global, i && 0 === n.active++ && n.event.trigger("ajaxStart"), l.type = l.type.toUpperCase(), l.hasContent = !Lb.test(l.type), f = l.url, l.hasContent || (l.data && (f = l.url += (Fb.test(f) ? "&" : "?") + l.data, delete l.data), l.cache === !1 && (l.url = Ib.test(f) ? f.replace(Ib, "$1_=" + Eb++) : f + (Fb.test(f) ? "&" : "?") + "_=" + Eb++)), l.ifModified && (n.lastModified[f] && w.setRequestHeader("If-Modified-Since", n.lastModified[f]), n.etag[f] && w.setRequestHeader("If-None-Match", n.etag[f])), (l.data && l.hasContent && l.contentType !== !1 || c.contentType) && w.setRequestHeader("Content-Type", l.contentType), w.setRequestHeader("Accept", l.dataTypes[0] && l.accepts[l.dataTypes[0]] ? l.accepts[l.dataTypes[0]] + ("*" !== l.dataTypes[0] ? ", " + Qb + "; q=0.01" : "") : l.accepts["*"]);
  3004. for (e in l.headers) w.setRequestHeader(e, l.headers[e]);
  3005. if (l.beforeSend && (l.beforeSend.call(m, w, l) === !1 || 2 === u)) return w.abort();
  3006. v = "abort";
  3007. for (e in {
  3008. success: 1,
  3009. error: 1,
  3010. complete: 1
  3011. }) w[e](l[e]);
  3012. if (j = Ub(Pb, l, c, w)) {
  3013. if (w.readyState = 1, i && o.trigger("ajaxSend", [w, l]), 2 === u) return w;
  3014. l.async && l.timeout > 0 && (h = a.setTimeout(function() {
  3015. w.abort("timeout")
  3016. }, l.timeout));
  3017. try {
  3018. u = 1, j.send(s, y)
  3019. } catch (x) {
  3020. if (!(2 > u)) throw x;
  3021. y(-1, x)
  3022. }
  3023. } else y(-1, "No Transport");
  3024.  
  3025. function y(b, c, d, e) {
  3026. var k, s, t, v, x, y = c;
  3027. 2 !== u && (u = 2, h && a.clearTimeout(h), j = void 0, g = e || "", w.readyState = b > 0 ? 4 : 0, k = b >= 200 && 300 > b || 304 === b, d && (v = Wb(l, w, d)), v = Xb(l, v, w, k), k ? (l.ifModified && (x = w.getResponseHeader("Last-Modified"), x && (n.lastModified[f] = x), x = w.getResponseHeader("etag"), x && (n.etag[f] = x)), 204 === b || "HEAD" === l.type ? y = "nocontent" : 304 === b ? y = "notmodified" : (y = v.state, s = v.data, t = v.error, k = !t)) : (t = y, !b && y || (y = "error", 0 > b && (b = 0))), w.status = b, w.statusText = (c || y) + "", k ? p.resolveWith(m, [s, y, w]) : p.rejectWith(m, [w, y, t]), w.statusCode(r), r = void 0, i && o.trigger(k ? "ajaxSuccess" : "ajaxError", [w, l, k ? s : t]), q.fireWith(m, [w, y]), i && (o.trigger("ajaxComplete", [w, l]), --n.active || n.event.trigger("ajaxStop")))
  3028. }
  3029. return w
  3030. },
  3031. getJSON: function(a, b, c) {
  3032. return n.get(a, b, c, "json")
  3033. },
  3034. getScript: function(a, b) {
  3035. return n.get(a, void 0, b, "script")
  3036. }
  3037. }), n.each(["get", "post"], function(a, b) {
  3038. n[b] = function(a, c, d, e) {
  3039. return n.isFunction(c) && (e = e || d, d = c, c = void 0), n.ajax(n.extend({
  3040. url: a,
  3041. type: b,
  3042. dataType: e,
  3043. data: c,
  3044. success: d
  3045. }, n.isPlainObject(a) && a))
  3046. }
  3047. }), n._evalUrl = function(a) {
  3048. return n.ajax({
  3049. url: a,
  3050. type: "GET",
  3051. dataType: "script",
  3052. cache: !0,
  3053. async: !1,
  3054. global: !1,
  3055. "throws": !0
  3056. })
  3057. }, n.fn.extend({
  3058. wrapAll: function(a) {
  3059. if (n.isFunction(a)) return this.each(function(b) {
  3060. n(this).wrapAll(a.call(this, b))
  3061. });
  3062. if (this[0]) {
  3063. var b = n(a, this[0].ownerDocument).eq(0).clone(!0);
  3064. this[0].parentNode && b.insertBefore(this[0]), b.map(function() {
  3065. var a = this;
  3066. while (a.firstChild && 1 === a.firstChild.nodeType) a = a.firstChild;
  3067. return a
  3068. }).append(this)
  3069. }
  3070. return this
  3071. },
  3072. wrapInner: function(a) {
  3073. return n.isFunction(a) ? this.each(function(b) {
  3074. n(this).wrapInner(a.call(this, b))
  3075. }) : this.each(function() {
  3076. var b = n(this),
  3077. c = b.contents();
  3078. c.length ? c.wrapAll(a) : b.append(a)
  3079. })
  3080. },
  3081. wrap: function(a) {
  3082. var b = n.isFunction(a);
  3083. return this.each(function(c) {
  3084. n(this).wrapAll(b ? a.call(this, c) : a)
  3085. })
  3086. },
  3087. unwrap: function() {
  3088. return this.parent().each(function() {
  3089. n.nodeName(this, "body") || n(this).replaceWith(this.childNodes)
  3090. }).end()
  3091. }
  3092. });
  3093.  
  3094. function Yb(a) {
  3095. return a.style && a.style.display || n.css(a, "display")
  3096. }
  3097.  
  3098. function Zb(a) {
  3099. if (!n.contains(a.ownerDocument || d, a)) return !0;
  3100. while (a && 1 === a.nodeType) {
  3101. if ("none" === Yb(a) || "hidden" === a.type) return !0;
  3102. a = a.parentNode
  3103. }
  3104. return !1
  3105. }
  3106. n.expr.filters.hidden = function(a) {
  3107. return l.reliableHiddenOffsets() ? a.offsetWidth <= 0 && a.offsetHeight <= 0 && !a.getClientRects().length : Zb(a)
  3108. }, n.expr.filters.visible = function(a) {
  3109. return !n.expr.filters.hidden(a)
  3110. };
  3111. var $b = /%20/g,
  3112. _b = /\[\]$/,
  3113. ac = /\r?\n/g,
  3114. bc = /^(?:submit|button|image|reset|file)$/i,
  3115. cc = /^(?:input|select|textarea|keygen)/i;
  3116.  
  3117. function dc(a, b, c, d) {
  3118. var e;
  3119. if (n.isArray(b)) n.each(b, function(b, e) {
  3120. c || _b.test(a) ? d(a, e) : dc(a + "[" + ("object" == typeof e && null != e ? b : "") + "]", e, c, d)
  3121. });
  3122. else if (c || "object" !== n.type(b)) d(a, b);
  3123. else
  3124. for (e in b) dc(a + "[" + e + "]", b[e], c, d)
  3125. }
  3126. n.param = function(a, b) {
  3127. var c, d = [],
  3128. e = function(a, b) {
  3129. b = n.isFunction(b) ? b() : null == b ? "" : b, d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b)
  3130. };
  3131. if (void 0 === b && (b = n.ajaxSettings && n.ajaxSettings.traditional), n.isArray(a) || a.jquery && !n.isPlainObject(a)) n.each(a, function() {
  3132. e(this.name, this.value)
  3133. });
  3134. else
  3135. for (c in a) dc(c, a[c], b, e);
  3136. return d.join("&").replace($b, "+")
  3137. }, n.fn.extend({
  3138. serialize: function() {
  3139. return n.param(this.serializeArray())
  3140. },
  3141. serializeArray: function() {
  3142. return this.map(function() {
  3143. var a = n.prop(this, "elements");
  3144. return a ? n.makeArray(a) : this
  3145. }).filter(function() {
  3146. var a = this.type;
  3147. return this.name && !n(this).is(":disabled") && cc.test(this.nodeName) && !bc.test(a) && (this.checked || !Z.test(a))
  3148. }).map(function(a, b) {
  3149. var c = n(this).val();
  3150. return null == c ? null : n.isArray(c) ? n.map(c, function(a) {
  3151. return {
  3152. name: b.name,
  3153. value: a.replace(ac, "\r\n")
  3154. }
  3155. }) : {
  3156. name: b.name,
  3157. value: c.replace(ac, "\r\n")
  3158. }
  3159. }).get()
  3160. }
  3161. }), n.ajaxSettings.xhr = void 0 !== a.ActiveXObject ? function() {
  3162. return this.isLocal ? ic() : d.documentMode > 8 ? hc() : /^(get|post|head|put|delete|options)$/i.test(this.type) && hc() || ic()
  3163. } : hc;
  3164. var ec = 0,
  3165. fc = {},
  3166. gc = n.ajaxSettings.xhr();
  3167. a.attachEvent && a.attachEvent("onunload", function() {
  3168. for (var a in fc) fc[a](void 0, !0)
  3169. }), l.cors = !!gc && "withCredentials" in gc, gc = l.ajax = !!gc, gc && n.ajaxTransport(function(b) {
  3170. if (!b.crossDomain || l.cors) {
  3171. var c;
  3172. return {
  3173. send: function(d, e) {
  3174. var f, g = b.xhr(),
  3175. h = ++ec;
  3176. if (g.open(b.type, b.url, b.async, b.username, b.password), b.xhrFields)
  3177. for (f in b.xhrFields) g[f] = b.xhrFields[f];
  3178. b.mimeType && g.overrideMimeType && g.overrideMimeType(b.mimeType), b.crossDomain || d["X-Requested-With"] || (d["X-Requested-With"] = "XMLHttpRequest");
  3179. for (f in d) void 0 !== d[f] && g.setRequestHeader(f, d[f] + "");
  3180. g.send(b.hasContent && b.data || null), c = function(a, d) {
  3181. var f, i, j;
  3182. if (c && (d || 4 === g.readyState))
  3183. if (delete fc[h], c = void 0, g.onreadystatechange = n.noop, d) 4 !== g.readyState && g.abort();
  3184. else {
  3185. j = {}, f = g.status, "string" == typeof g.responseText && (j.text = g.responseText);
  3186. try {
  3187. i = g.statusText
  3188. } catch (k) {
  3189. i = ""
  3190. }
  3191. f || !b.isLocal || b.crossDomain ? 1223 === f && (f = 204) : f = j.text ? 200 : 404
  3192. }
  3193. j && e(f, i, j, g.getAllResponseHeaders())
  3194. }, b.async ? 4 === g.readyState ? a.setTimeout(c) : g.onreadystatechange = fc[h] = c : c()
  3195. },
  3196. abort: function() {
  3197. c && c(void 0, !0)
  3198. }
  3199. }
  3200. }
  3201. });
  3202.  
  3203. function hc() {
  3204. try {
  3205. return new a.XMLHttpRequest
  3206. } catch (b) {}
  3207. }
  3208.  
  3209. function ic() {
  3210. try {
  3211. return new a.ActiveXObject("Microsoft.XMLHTTP")
  3212. } catch (b) {}
  3213. }
  3214. n.ajaxSetup({
  3215. accepts: {
  3216. script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  3217. },
  3218. contents: {
  3219. script: /\b(?:java|ecma)script\b/
  3220. },
  3221. converters: {
  3222. "text script": function(a) {
  3223. return n.globalEval(a), a
  3224. }
  3225. }
  3226. }), n.ajaxPrefilter("script", function(a) {
  3227. void 0 === a.cache && (a.cache = !1), a.crossDomain && (a.type = "GET", a.global = !1)
  3228. }), n.ajaxTransport("script", function(a) {
  3229. if (a.crossDomain) {
  3230. var b, c = d.head || n("head")[0] || d.documentElement;
  3231. return {
  3232. send: function(e, f) {
  3233. b = d.createElement("script"), b.async = !0, a.scriptCharset && (b.charset = a.scriptCharset), b.src = a.url, b.onload = b.onreadystatechange = function(a, c) {
  3234. (c || !b.readyState || /loaded|complete/.test(b.readyState)) && (b.onload = b.onreadystatechange = null, b.parentNode && b.parentNode.removeChild(b), b = null, c || f(200, "success"))
  3235. }, c.insertBefore(b, c.firstChild)
  3236. },
  3237. abort: function() {
  3238. b && b.onload(void 0, !0)
  3239. }
  3240. }
  3241. }
  3242. });
  3243. var jc = [],
  3244. kc = /(=)\?(?=&|$)|\?\?/;
  3245. n.ajaxSetup({
  3246. jsonp: "callback",
  3247. jsonpCallback: function() {
  3248. var a = jc.pop() || n.expando + "_" + Eb++;
  3249. return this[a] = !0, a
  3250. }
  3251. }), n.ajaxPrefilter("json jsonp", function(b, c, d) {
  3252. var e, f, g, h = b.jsonp !== !1 && (kc.test(b.url) ? "url" : "string" == typeof b.data && 0 === (b.contentType || "").indexOf("application/x-www-form-urlencoded") && kc.test(b.data) && "data");
  3253. return h || "jsonp" === b.dataTypes[0] ? (e = b.jsonpCallback = n.isFunction(b.jsonpCallback) ? b.jsonpCallback() : b.jsonpCallback, h ? b[h] = b[h].replace(kc, "$1" + e) : b.jsonp !== !1 && (b.url += (Fb.test(b.url) ? "&" : "?") + b.jsonp + "=" + e), b.converters["script json"] = function() {
  3254. return g || n.error(e + " was not called"), g[0]
  3255. }, b.dataTypes[0] = "json", f = a[e], a[e] = function() {
  3256. g = arguments
  3257. }, d.always(function() {
  3258. void 0 === f ? n(a).removeProp(e) : a[e] = f, b[e] && (b.jsonpCallback = c.jsonpCallback, jc.push(e)), g && n.isFunction(f) && f(g[0]), g = f = void 0
  3259. }), "script") : void 0
  3260. }), n.parseHTML = function(a, b, c) {
  3261. if (!a || "string" != typeof a) return null;
  3262. "boolean" == typeof b && (c = b, b = !1), b = b || d;
  3263. var e = x.exec(a),
  3264. f = !c && [];
  3265. return e ? [b.createElement(e[1])] : (e = ja([a], b, f), f && f.length && n(f).remove(), n.merge([], e.childNodes))
  3266. };
  3267. var lc = n.fn.load;
  3268. n.fn.load = function(a, b, c) {
  3269. if ("string" != typeof a && lc) return lc.apply(this, arguments);
  3270. var d, e, f, g = this,
  3271. h = a.indexOf(" ");
  3272. return h > -1 && (d = n.trim(a.slice(h, a.length)), a = a.slice(0, h)), n.isFunction(b) ? (c = b, b = void 0) : b && "object" == typeof b && (e = "POST"), g.length > 0 && n.ajax({
  3273. url: a,
  3274. type: e || "GET",
  3275. dataType: "html",
  3276. data: b
  3277. }).done(function(a) {
  3278. f = arguments, g.html(d ? n("<div>").append(n.parseHTML(a)).find(d) : a)
  3279. }).always(c && function(a, b) {
  3280. g.each(function() {
  3281. c.apply(this, f || [a.responseText, b, a])
  3282. })
  3283. }), this
  3284. }, n.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(a, b) {
  3285. n.fn[b] = function(a) {
  3286. return this.on(b, a)
  3287. }
  3288. }), n.expr.filters.animated = function(a) {
  3289. return n.grep(n.timers, function(b) {
  3290. return a === b.elem
  3291. }).length
  3292. };
  3293.  
  3294. function mc(a) {
  3295. return n.isWindow(a) ? a : 9 === a.nodeType ? a.defaultView || a.parentWindow : !1
  3296. }
  3297. n.offset = {
  3298. setOffset: function(a, b, c) {
  3299. var d, e, f, g, h, i, j, k = n.css(a, "position"),
  3300. l = n(a),
  3301. m = {};
  3302. "static" === k && (a.style.position = "relative"), h = l.offset(), f = n.css(a, "top"), i = n.css(a, "left"), j = ("absolute" === k || "fixed" === k) && n.inArray("auto", [f, i]) > -1, j ? (d = l.position(), g = d.top, e = d.left) : (g = parseFloat(f) || 0, e = parseFloat(i) || 0), n.isFunction(b) && (b = b.call(a, c, n.extend({}, h))), null != b.top && (m.top = b.top - h.top + g), null != b.left && (m.left = b.left - h.left + e), "using" in b ? b.using.call(a, m) : l.css(m)
  3303. }
  3304. }, n.fn.extend({
  3305. offset: function(a) {
  3306. if (arguments.length) return void 0 === a ? this : this.each(function(b) {
  3307. n.offset.setOffset(this, a, b)
  3308. });
  3309. var b, c, d = {
  3310. top: 0,
  3311. left: 0
  3312. },
  3313. e = this[0],
  3314. f = e && e.ownerDocument;
  3315. if (f) return b = f.documentElement, n.contains(b, e) ? ("undefined" != typeof e.getBoundingClientRect && (d = e.getBoundingClientRect()), c = mc(f), {
  3316. top: d.top + (c.pageYOffset || b.scrollTop) - (b.clientTop || 0),
  3317. left: d.left + (c.pageXOffset || b.scrollLeft) - (b.clientLeft || 0)
  3318. }) : d
  3319. },
  3320. position: function() {
  3321. if (this[0]) {
  3322. var a, b, c = {
  3323. top: 0,
  3324. left: 0
  3325. },
  3326. d = this[0];
  3327. return "fixed" === n.css(d, "position") ? b = d.getBoundingClientRect() : (a = this.offsetParent(), b = this.offset(), n.nodeName(a[0], "html") || (c = a.offset()), c.top += n.css(a[0], "borderTopWidth", !0), c.left += n.css(a[0], "borderLeftWidth", !0)), {
  3328. top: b.top - c.top - n.css(d, "marginTop", !0),
  3329. left: b.left - c.left - n.css(d, "marginLeft", !0)
  3330. }
  3331. }
  3332. },
  3333. offsetParent: function() {
  3334. return this.map(function() {
  3335. var a = this.offsetParent;
  3336. while (a && !n.nodeName(a, "html") && "static" === n.css(a, "position")) a = a.offsetParent;
  3337. return a || Qa
  3338. })
  3339. }
  3340. }), n.each({
  3341. scrollLeft: "pageXOffset",
  3342. scrollTop: "pageYOffset"
  3343. }, function(a, b) {
  3344. var c = /Y/.test(b);
  3345. n.fn[a] = function(d) {
  3346. return Y(this, function(a, d, e) {
  3347. var f = mc(a);
  3348. return void 0 === e ? f ? b in f ? f[b] : f.document.documentElement[d] : a[d] : void(f ? f.scrollTo(c ? n(f).scrollLeft() : e, c ? e : n(f).scrollTop()) : a[d] = e)
  3349. }, a, d, arguments.length, null)
  3350. }
  3351. }), n.each(["top", "left"], function(a, b) {
  3352. n.cssHooks[b] = Ua(l.pixelPosition, function(a, c) {
  3353. return c ? (c = Sa(a, b), Oa.test(c) ? n(a).position()[b] + "px" : c) : void 0
  3354. })
  3355. }), n.each({
  3356. Height: "height",
  3357. Width: "width"
  3358. }, function(a, b) {
  3359. n.each({
  3360. padding: "inner" + a,
  3361. content: b,
  3362. "": "outer" + a
  3363. }, function(c, d) {
  3364. n.fn[d] = function(d, e) {
  3365. var f = arguments.length && (c || "boolean" != typeof d),
  3366. g = c || (d === !0 || e === !0 ? "margin" : "border");
  3367. return Y(this, function(b, c, d) {
  3368. var e;
  3369. return n.isWindow(b) ? b.document.documentElement["client" + a] : 9 === b.nodeType ? (e = b.documentElement, Math.max(b.body["scroll" + a], e["scroll" + a], b.body["offset" + a], e["offset" + a], e["client" + a])) : void 0 === d ? n.css(b, c, g) : n.style(b, c, d, g)
  3370. }, b, f ? d : void 0, f, null)
  3371. }
  3372. })
  3373. }), n.fn.extend({
  3374. bind: function(a, b, c) {
  3375. return this.on(a, null, b, c)
  3376. },
  3377. unbind: function(a, b) {
  3378. return this.off(a, null, b)
  3379. },
  3380. delegate: function(a, b, c, d) {
  3381. return this.on(b, a, c, d)
  3382. },
  3383. undelegate: function(a, b, c) {
  3384. return 1 === arguments.length ? this.off(a, "**") : this.off(b, a || "**", c)
  3385. }
  3386. }), n.fn.size = function() {
  3387. return this.length
  3388. }, n.fn.andSelf = n.fn.addBack, "function" == typeof define && define.amd && define("jquery", [], function() {
  3389. return n
  3390. });
  3391. var nc = a.jQuery,
  3392. oc = a.$;
  3393. return n.noConflict = function(b) {
  3394. return a.$ === n && (a.$ = oc), b && a.jQuery === n && (a.jQuery = nc), n
  3395. }, b || (a.jQuery = a.$ = n), n
  3396. });
  3397. (function(e) {
  3398. "function" == typeof define && define.amd ? define(["jquery"], e) : e(jQuery)
  3399. })(function(e) {
  3400. function t(t, s) {
  3401. var n, a, o, r = t.nodeName.toLowerCase();
  3402. return "area" === r ? (n = t.parentNode, a = n.name, t.href && a && "map" === n.nodeName.toLowerCase() ? (o = e("img[usemap='#" + a + "']")[0], !!o && i(o)) : !1) : (/input|select|textarea|button|object/.test(r) ? !t.disabled : "a" === r ? t.href || s : s) && i(t)
  3403. }
  3404.  
  3405. function i(t) {
  3406. return e.expr.filters.visible(t) && !e(t).parents().addBack().filter(function() {
  3407. return "hidden" === e.css(this, "visibility")
  3408. }).length
  3409. }
  3410. e.ui = e.ui || {}, e.extend(e.ui, {
  3411. version: "1.11.1",
  3412. keyCode: {
  3413. BACKSPACE: 8,
  3414. COMMA: 188,
  3415. DELETE: 46,
  3416. DOWN: 40,
  3417. END: 35,
  3418. ENTER: 13,
  3419. ESCAPE: 27,
  3420. HOME: 36,
  3421. LEFT: 37,
  3422. PAGE_DOWN: 34,
  3423. PAGE_UP: 33,
  3424. PERIOD: 190,
  3425. RIGHT: 39,
  3426. SPACE: 32,
  3427. TAB: 9,
  3428. UP: 38
  3429. }
  3430. }), e.fn.extend({
  3431. scrollParent: function(t) {
  3432. var i = this.css("position"),
  3433. s = "absolute" === i,
  3434. n = t ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
  3435. a = this.parents().filter(function() {
  3436. var t = e(this);
  3437. return s && "static" === t.css("position") ? !1 : n.test(t.css("overflow") + t.css("overflow-y") + t.css("overflow-x"))
  3438. }).eq(0);
  3439. return "fixed" !== i && a.length ? a : e(this[0].ownerDocument || document)
  3440. },
  3441. uniqueId: function() {
  3442. var e = 0;
  3443. return function() {
  3444. return this.each(function() {
  3445. this.id || (this.id = "ui-id-" + ++e)
  3446. })
  3447. }
  3448. }(),
  3449. removeUniqueId: function() {
  3450. return this.each(function() {
  3451. /^ui-id-\d+$/.test(this.id) && e(this).removeAttr("id")
  3452. })
  3453. }
  3454. }), e.extend(e.expr[":"], {
  3455. data: e.expr.createPseudo ? e.expr.createPseudo(function(t) {
  3456. return function(i) {
  3457. return !!e.data(i, t)
  3458. }
  3459. }) : function(t, i, s) {
  3460. return !!e.data(t, s[3])
  3461. },
  3462. focusable: function(i) {
  3463. return t(i, !isNaN(e.attr(i, "tabindex")))
  3464. },
  3465. tabbable: function(i) {
  3466. var s = e.attr(i, "tabindex"),
  3467. n = isNaN(s);
  3468. return (n || s >= 0) && t(i, !n)
  3469. }
  3470. }), e("<a>").outerWidth(1).jquery || e.each(["Width", "Height"], function(t, i) {
  3471. function s(t, i, s, a) {
  3472. return e.each(n, function() {
  3473. i -= parseFloat(e.css(t, "padding" + this)) || 0, s && (i -= parseFloat(e.css(t, "border" + this + "Width")) || 0), a && (i -= parseFloat(e.css(t, "margin" + this)) || 0)
  3474. }), i
  3475. }
  3476. var n = "Width" === i ? ["Left", "Right"] : ["Top", "Bottom"],
  3477. a = i.toLowerCase(),
  3478. o = {
  3479. innerWidth: e.fn.innerWidth,
  3480. innerHeight: e.fn.innerHeight,
  3481. outerWidth: e.fn.outerWidth,
  3482. outerHeight: e.fn.outerHeight
  3483. };
  3484. e.fn["inner" + i] = function(t) {
  3485. return void 0 === t ? o["inner" + i].call(this) : this.each(function() {
  3486. e(this).css(a, s(this, t) + "px")
  3487. })
  3488. }, e.fn["outer" + i] = function(t, n) {
  3489. return "number" != typeof t ? o["outer" + i].call(this, t) : this.each(function() {
  3490. e(this).css(a, s(this, t, !0, n) + "px")
  3491. })
  3492. }
  3493. }), e.fn.addBack || (e.fn.addBack = function(e) {
  3494. return this.add(null == e ? this.prevObject : this.prevObject.filter(e))
  3495. }), e("<a>").data("a-b", "a").removeData("a-b").data("a-b") && (e.fn.removeData = function(t) {
  3496. return function(i) {
  3497. return arguments.length ? t.call(this, e.camelCase(i)) : t.call(this)
  3498. }
  3499. }(e.fn.removeData)), e.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()), e.fn.extend({
  3500. focus: function(t) {
  3501. return function(i, s) {
  3502. return "number" == typeof i ? this.each(function() {
  3503. var t = this;
  3504. setTimeout(function() {
  3505. e(t).focus(), s && s.call(t)
  3506. }, i)
  3507. }) : t.apply(this, arguments)
  3508. }
  3509. }(e.fn.focus),
  3510. disableSelection: function() {
  3511. var e = "onselectstart" in document.createElement("div") ? "selectstart" : "mousedown";
  3512. return function() {
  3513. return this.bind(e + ".ui-disableSelection", function(e) {
  3514. e.preventDefault()
  3515. })
  3516. }
  3517. }(),
  3518. enableSelection: function() {
  3519. return this.unbind(".ui-disableSelection")
  3520. },
  3521. zIndex: function(t) {
  3522. if (void 0 !== t) return this.css("zIndex", t);
  3523. if (this.length)
  3524. for (var i, s, n = e(this[0]); n.length && n[0] !== document;) {
  3525. if (i = n.css("position"), ("absolute" === i || "relative" === i || "fixed" === i) && (s = parseInt(n.css("zIndex"), 10), !isNaN(s) && 0 !== s)) return s;
  3526. n = n.parent()
  3527. }
  3528. return 0
  3529. }
  3530. }), e.ui.plugin = {
  3531. add: function(t, i, s) {
  3532. var n, a = e.ui[t].prototype;
  3533. for (n in s) a.plugins[n] = a.plugins[n] || [], a.plugins[n].push([i, s[n]])
  3534. },
  3535. call: function(e, t, i, s) {
  3536. var n, a = e.plugins[t];
  3537. if (a && (s || e.element[0].parentNode && 11 !== e.element[0].parentNode.nodeType))
  3538. for (n = 0; a.length > n; n++) e.options[a[n][0]] && a[n][1].apply(e.element, i)
  3539. }
  3540. };
  3541. var s = 0,
  3542. n = Array.prototype.slice;
  3543. e.cleanData = function(t) {
  3544. return function(i) {
  3545. var s, n, a;
  3546. for (a = 0; null != (n = i[a]); a++) try {
  3547. s = e._data(n, "events"), s && s.remove && e(n).triggerHandler("remove")
  3548. } catch (o) {}
  3549. t(i)
  3550. }
  3551. }(e.cleanData), e.widget = function(t, i, s) {
  3552. var n, a, o, r, h = {},
  3553. l = t.split(".")[0];
  3554. return t = t.split(".")[1], n = l + "-" + t, s || (s = i, i = e.Widget), e.expr[":"][n.toLowerCase()] = function(t) {
  3555. return !!e.data(t, n)
  3556. }, e[l] = e[l] || {}, a = e[l][t], o = e[l][t] = function(e, t) {
  3557. return this._createWidget ? (arguments.length && this._createWidget(e, t), void 0) : new o(e, t)
  3558. }, e.extend(o, a, {
  3559. version: s.version,
  3560. _proto: e.extend({}, s),
  3561. _childConstructors: []
  3562. }), r = new i, r.options = e.widget.extend({}, r.options), e.each(s, function(t, s) {
  3563. return e.isFunction(s) ? (h[t] = function() {
  3564. var e = function() {
  3565. return i.prototype[t].apply(this, arguments)
  3566. },
  3567. n = function(e) {
  3568. return i.prototype[t].apply(this, e)
  3569. };
  3570. return function() {
  3571. var t, i = this._super,
  3572. a = this._superApply;
  3573. return this._super = e, this._superApply = n, t = s.apply(this, arguments), this._super = i, this._superApply = a, t
  3574. }
  3575. }(), void 0) : (h[t] = s, void 0)
  3576. }), o.prototype = e.widget.extend(r, {
  3577. widgetEventPrefix: a ? r.widgetEventPrefix || t : t
  3578. }, h, {
  3579. constructor: o,
  3580. namespace: l,
  3581. widgetName: t,
  3582. widgetFullName: n
  3583. }), a ? (e.each(a._childConstructors, function(t, i) {
  3584. var s = i.prototype;
  3585. e.widget(s.namespace + "." + s.widgetName, o, i._proto)
  3586. }), delete a._childConstructors) : i._childConstructors.push(o), e.widget.bridge(t, o), o
  3587. }, e.widget.extend = function(t) {
  3588. for (var i, s, a = n.call(arguments, 1), o = 0, r = a.length; r > o; o++)
  3589. for (i in a[o]) s = a[o][i], a[o].hasOwnProperty(i) && void 0 !== s && (t[i] = e.isPlainObject(s) ? e.isPlainObject(t[i]) ? e.widget.extend({}, t[i], s) : e.widget.extend({}, s) : s);
  3590. return t
  3591. }, e.widget.bridge = function(t, i) {
  3592. var s = i.prototype.widgetFullName || t;
  3593. e.fn[t] = function(a) {
  3594. var o = "string" == typeof a,
  3595. r = n.call(arguments, 1),
  3596. h = this;
  3597. return a = !o && r.length ? e.widget.extend.apply(null, [a].concat(r)) : a, o ? this.each(function() {
  3598. var i, n = e.data(this, s);
  3599. return "instance" === a ? (h = n, !1) : n ? e.isFunction(n[a]) && "_" !== a.charAt(0) ? (i = n[a].apply(n, r), i !== n && void 0 !== i ? (h = i && i.jquery ? h.pushStack(i.get()) : i, !1) : void 0) : e.error("no such method '" + a + "' for " + t + " widget instance") : e.error("cannot call methods on " + t + " prior to initialization; " + "attempted to call method '" + a + "'")
  3600. }) : this.each(function() {
  3601. var t = e.data(this, s);
  3602. t ? (t.option(a || {}), t._init && t._init()) : e.data(this, s, new i(a, this))
  3603. }), h
  3604. }
  3605. }, e.Widget = function() {}, e.Widget._childConstructors = [], e.Widget.prototype = {
  3606. widgetName: "widget",
  3607. widgetEventPrefix: "",
  3608. defaultElement: "<div>",
  3609. options: {
  3610. disabled: !1,
  3611. create: null
  3612. },
  3613. _createWidget: function(t, i) {
  3614. i = e(i || this.defaultElement || this)[0], this.element = e(i), this.uuid = s++, this.eventNamespace = "." + this.widgetName + this.uuid, this.options = e.widget.extend({}, this.options, this._getCreateOptions(), t), this.bindings = e(), this.hoverable = e(), this.focusable = e(), i !== this && (e.data(i, this.widgetFullName, this), this._on(!0, this.element, {
  3615. remove: function(e) {
  3616. e.target === i && this.destroy()
  3617. }
  3618. }), this.document = e(i.style ? i.ownerDocument : i.document || i), this.window = e(this.document[0].defaultView || this.document[0].parentWindow)), this._create(), this._trigger("create", null, this._getCreateEventData()), this._init()
  3619. },
  3620. _getCreateOptions: e.noop,
  3621. _getCreateEventData: e.noop,
  3622. _create: e.noop,
  3623. _init: e.noop,
  3624. destroy: function() {
  3625. this._destroy(), this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)), this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName + "-disabled " + "ui-state-disabled"), this.bindings.unbind(this.eventNamespace), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus")
  3626. },
  3627. _destroy: e.noop,
  3628. widget: function() {
  3629. return this.element
  3630. },
  3631. option: function(t, i) {
  3632. var s, n, a, o = t;
  3633. if (0 === arguments.length) return e.widget.extend({}, this.options);
  3634. if ("string" == typeof t)
  3635. if (o = {}, s = t.split("."), t = s.shift(), s.length) {
  3636. for (n = o[t] = e.widget.extend({}, this.options[t]), a = 0; s.length - 1 > a; a++) n[s[a]] = n[s[a]] || {}, n = n[s[a]];
  3637. if (t = s.pop(), 1 === arguments.length) return void 0 === n[t] ? null : n[t];
  3638. n[t] = i
  3639. } else {
  3640. if (1 === arguments.length) return void 0 === this.options[t] ? null : this.options[t];
  3641. o[t] = i
  3642. }
  3643. return this._setOptions(o), this
  3644. },
  3645. _setOptions: function(e) {
  3646. var t;
  3647. for (t in e) this._setOption(t, e[t]);
  3648. return this
  3649. },
  3650. _setOption: function(e, t) {
  3651. return this.options[e] = t, "disabled" === e && (this.widget().toggleClass(this.widgetFullName + "-disabled", !!t), t && (this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus"))), this
  3652. },
  3653. enable: function() {
  3654. return this._setOptions({
  3655. disabled: !1
  3656. })
  3657. },
  3658. disable: function() {
  3659. return this._setOptions({
  3660. disabled: !0
  3661. })
  3662. },
  3663. _on: function(t, i, s) {
  3664. var n, a = this;
  3665. "boolean" != typeof t && (s = i, i = t, t = !1), s ? (i = n = e(i), this.bindings = this.bindings.add(i)) : (s = i, i = this.element, n = this.widget()), e.each(s, function(s, o) {
  3666. function r() {
  3667. return t || a.options.disabled !== !0 && !e(this).hasClass("ui-state-disabled") ? ("string" == typeof o ? a[o] : o).apply(a, arguments) : void 0
  3668. }
  3669. "string" != typeof o && (r.guid = o.guid = o.guid || r.guid || e.guid++);
  3670. var h = s.match(/^([\w:-]*)\s*(.*)$/),
  3671. l = h[1] + a.eventNamespace,
  3672. u = h[2];
  3673. u ? n.delegate(u, l, r) : i.bind(l, r)
  3674. })
  3675. },
  3676. _off: function(e, t) {
  3677. t = (t || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace, e.unbind(t).undelegate(t)
  3678. },
  3679. _delay: function(e, t) {
  3680. function i() {
  3681. return ("string" == typeof e ? s[e] : e).apply(s, arguments)
  3682. }
  3683. var s = this;
  3684. return setTimeout(i, t || 0)
  3685. },
  3686. _hoverable: function(t) {
  3687. this.hoverable = this.hoverable.add(t), this._on(t, {
  3688. mouseenter: function(t) {
  3689. e(t.currentTarget).addClass("ui-state-hover")
  3690. },
  3691. mouseleave: function(t) {
  3692. e(t.currentTarget).removeClass("ui-state-hover")
  3693. }
  3694. })
  3695. },
  3696. _focusable: function(t) {
  3697. this.focusable = this.focusable.add(t), this._on(t, {
  3698. focusin: function(t) {
  3699. e(t.currentTarget).addClass("ui-state-focus")
  3700. },
  3701. focusout: function(t) {
  3702. e(t.currentTarget).removeClass("ui-state-focus")
  3703. }
  3704. })
  3705. },
  3706. _trigger: function(t, i, s) {
  3707. var n, a, o = this.options[t];
  3708. if (s = s || {}, i = e.Event(i), i.type = (t === this.widgetEventPrefix ? t : this.widgetEventPrefix + t).toLowerCase(), i.target = this.element[0], a = i.originalEvent)
  3709. for (n in a) n in i || (i[n] = a[n]);
  3710. return this.element.trigger(i, s), !(e.isFunction(o) && o.apply(this.element[0], [i].concat(s)) === !1 || i.isDefaultPrevented())
  3711. }
  3712. }, e.each({
  3713. show: "fadeIn",
  3714. hide: "fadeOut"
  3715. }, function(t, i) {
  3716. e.Widget.prototype["_" + t] = function(s, n, a) {
  3717. "string" == typeof n && (n = {
  3718. effect: n
  3719. });
  3720. var o, r = n ? n === !0 || "number" == typeof n ? i : n.effect || i : t;
  3721. n = n || {}, "number" == typeof n && (n = {
  3722. duration: n
  3723. }), o = !e.isEmptyObject(n), n.complete = a, n.delay && s.delay(n.delay), o && e.effects && e.effects.effect[r] ? s[t](n) : r !== t && s[r] ? s[r](n.duration, n.easing, a) : s.queue(function(i) {
  3724. e(this)[t](), a && a.call(s[0]), i()
  3725. })
  3726. }
  3727. }), e.widget;
  3728. var a = !1;
  3729. e(document).mouseup(function() {
  3730. a = !1
  3731. }), e.widget("ui.mouse", {
  3732. version: "1.11.1",
  3733. options: {
  3734. cancel: "input,textarea,button,select,option",
  3735. distance: 1,
  3736. delay: 0
  3737. },
  3738. _mouseInit: function() {
  3739. var t = this;
  3740. this.element.bind("mousedown." + this.widgetName, function(e) {
  3741. return t._mouseDown(e)
  3742. }).bind("click." + this.widgetName, function(i) {
  3743. return !0 === e.data(i.target, t.widgetName + ".preventClickEvent") ? (e.removeData(i.target, t.widgetName + ".preventClickEvent"), i.stopImmediatePropagation(), !1) : void 0
  3744. }), this.started = !1
  3745. },
  3746. _mouseDestroy: function() {
  3747. this.element.unbind("." + this.widgetName), this._mouseMoveDelegate && this.document.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate)
  3748. },
  3749. _mouseDown: function(t) {
  3750. if (!a) {
  3751. this._mouseStarted && this._mouseUp(t), this._mouseDownEvent = t;
  3752. var i = this,
  3753. s = 1 === t.which,
  3754. n = "string" == typeof this.options.cancel && t.target.nodeName ? e(t.target).closest(this.options.cancel).length : !1;
  3755. return s && !n && this._mouseCapture(t) ? (this.mouseDelayMet = !this.options.delay, this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function() {
  3756. i.mouseDelayMet = !0
  3757. }, this.options.delay)), this._mouseDistanceMet(t) && this._mouseDelayMet(t) && (this._mouseStarted = this._mouseStart(t) !== !1, !this._mouseStarted) ? (t.preventDefault(), !0) : (!0 === e.data(t.target, this.widgetName + ".preventClickEvent") && e.removeData(t.target, this.widgetName + ".preventClickEvent"), this._mouseMoveDelegate = function(e) {
  3758. return i._mouseMove(e)
  3759. }, this._mouseUpDelegate = function(e) {
  3760. return i._mouseUp(e)
  3761. }, this.document.bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate), t.preventDefault(), a = !0, !0)) : !0
  3762. }
  3763. },
  3764. _mouseMove: function(t) {
  3765. return e.ui.ie && (!document.documentMode || 9 > document.documentMode) && !t.button ? this._mouseUp(t) : t.which ? this._mouseStarted ? (this._mouseDrag(t), t.preventDefault()) : (this._mouseDistanceMet(t) && this._mouseDelayMet(t) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, t) !== !1, this._mouseStarted ? this._mouseDrag(t) : this._mouseUp(t)), !this._mouseStarted) : this._mouseUp(t)
  3766. },
  3767. _mouseUp: function(t) {
  3768. return this.document.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate), this._mouseStarted && (this._mouseStarted = !1, t.target === this._mouseDownEvent.target && e.data(t.target, this.widgetName + ".preventClickEvent", !0), this._mouseStop(t)), a = !1, !1
  3769. },
  3770. _mouseDistanceMet: function(e) {
  3771. return Math.max(Math.abs(this._mouseDownEvent.pageX - e.pageX), Math.abs(this._mouseDownEvent.pageY - e.pageY)) >= this.options.distance
  3772. },
  3773. _mouseDelayMet: function() {
  3774. return this.mouseDelayMet
  3775. },
  3776. _mouseStart: function() {},
  3777. _mouseDrag: function() {},
  3778. _mouseStop: function() {},
  3779. _mouseCapture: function() {
  3780. return !0
  3781. }
  3782. }),
  3783. function() {
  3784. function t(e, t, i) {
  3785. return [parseFloat(e[0]) * (p.test(e[0]) ? t / 100 : 1), parseFloat(e[1]) * (p.test(e[1]) ? i / 100 : 1)]
  3786. }
  3787.  
  3788. function i(t, i) {
  3789. return parseInt(e.css(t, i), 10) || 0
  3790. }
  3791.  
  3792. function s(t) {
  3793. var i = t[0];
  3794. return 9 === i.nodeType ? {
  3795. width: t.width(),
  3796. height: t.height(),
  3797. offset: {
  3798. top: 0,
  3799. left: 0
  3800. }
  3801. } : e.isWindow(i) ? {
  3802. width: t.width(),
  3803. height: t.height(),
  3804. offset: {
  3805. top: t.scrollTop(),
  3806. left: t.scrollLeft()
  3807. }
  3808. } : i.preventDefault ? {
  3809. width: 0,
  3810. height: 0,
  3811. offset: {
  3812. top: i.pageY,
  3813. left: i.pageX
  3814. }
  3815. } : {
  3816. width: t.outerWidth(),
  3817. height: t.outerHeight(),
  3818. offset: t.offset()
  3819. }
  3820. }
  3821. e.ui = e.ui || {};
  3822. var n, a, o = Math.max,
  3823. r = Math.abs,
  3824. h = Math.round,
  3825. l = /left|center|right/,
  3826. u = /top|center|bottom/,
  3827. d = /[\+\-]\d+(\.[\d]+)?%?/,
  3828. c = /^\w+/,
  3829. p = /%$/,
  3830. f = e.fn.position;
  3831. e.position = {
  3832. scrollbarWidth: function() {
  3833. if (void 0 !== n) return n;
  3834. var t, i, s = e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),
  3835. a = s.children()[0];
  3836. return e("body").append(s), t = a.offsetWidth, s.css("overflow", "scroll"), i = a.offsetWidth, t === i && (i = s[0].clientWidth), s.remove(), n = t - i
  3837. },
  3838. getScrollInfo: function(t) {
  3839. var i = t.isWindow || t.isDocument ? "" : t.element.css("overflow-x"),
  3840. s = t.isWindow || t.isDocument ? "" : t.element.css("overflow-y"),
  3841. n = "scroll" === i || "auto" === i && t.width < t.element[0].scrollWidth,
  3842. a = "scroll" === s || "auto" === s && t.height < t.element[0].scrollHeight;
  3843. return {
  3844. width: a ? e.position.scrollbarWidth() : 0,
  3845. height: n ? e.position.scrollbarWidth() : 0
  3846. }
  3847. },
  3848. getWithinInfo: function(t) {
  3849. var i = e(t || window),
  3850. s = e.isWindow(i[0]),
  3851. n = !!i[0] && 9 === i[0].nodeType;
  3852. return {
  3853. element: i,
  3854. isWindow: s,
  3855. isDocument: n,
  3856. offset: i.offset() || {
  3857. left: 0,
  3858. top: 0
  3859. },
  3860. scrollLeft: i.scrollLeft(),
  3861. scrollTop: i.scrollTop(),
  3862. width: s || n ? i.width() : i.outerWidth(),
  3863. height: s || n ? i.height() : i.outerHeight()
  3864. }
  3865. }
  3866. }, e.fn.position = function(n) {
  3867. if (!n || !n.of) return f.apply(this, arguments);
  3868. n = e.extend({}, n);
  3869. var p, m, g, v, y, b, _ = e(n.of),
  3870. x = e.position.getWithinInfo(n.within),
  3871. w = e.position.getScrollInfo(x),
  3872. k = (n.collision || "flip").split(" "),
  3873. T = {};
  3874. return b = s(_), _[0].preventDefault && (n.at = "left top"), m = b.width, g = b.height, v = b.offset, y = e.extend({}, v), e.each(["my", "at"], function() {
  3875. var e, t, i = (n[this] || "").split(" ");
  3876. 1 === i.length && (i = l.test(i[0]) ? i.concat(["center"]) : u.test(i[0]) ? ["center"].concat(i) : ["center", "center"]), i[0] = l.test(i[0]) ? i[0] : "center", i[1] = u.test(i[1]) ? i[1] : "center", e = d.exec(i[0]), t = d.exec(i[1]), T[this] = [e ? e[0] : 0, t ? t[0] : 0], n[this] = [c.exec(i[0])[0], c.exec(i[1])[0]]
  3877. }), 1 === k.length && (k[1] = k[0]), "right" === n.at[0] ? y.left += m : "center" === n.at[0] && (y.left += m / 2), "bottom" === n.at[1] ? y.top += g : "center" === n.at[1] && (y.top += g / 2), p = t(T.at, m, g), y.left += p[0], y.top += p[1], this.each(function() {
  3878. var s, l, u = e(this),
  3879. d = u.outerWidth(),
  3880. c = u.outerHeight(),
  3881. f = i(this, "marginLeft"),
  3882. b = i(this, "marginTop"),
  3883. D = d + f + i(this, "marginRight") + w.width,
  3884. S = c + b + i(this, "marginBottom") + w.height,
  3885. N = e.extend({}, y),
  3886. M = t(T.my, u.outerWidth(), u.outerHeight());
  3887. "right" === n.my[0] ? N.left -= d : "center" === n.my[0] && (N.left -= d / 2), "bottom" === n.my[1] ? N.top -= c : "center" === n.my[1] && (N.top -= c / 2), N.left += M[0], N.top += M[1], a || (N.left = h(N.left), N.top = h(N.top)), s = {
  3888. marginLeft: f,
  3889. marginTop: b
  3890. }, e.each(["left", "top"], function(t, i) {
  3891. e.ui.position[k[t]] && e.ui.position[k[t]][i](N, {
  3892. targetWidth: m,
  3893. targetHeight: g,
  3894. elemWidth: d,
  3895. elemHeight: c,
  3896. collisionPosition: s,
  3897. collisionWidth: D,
  3898. collisionHeight: S,
  3899. offset: [p[0] + M[0], p[1] + M[1]],
  3900. my: n.my,
  3901. at: n.at,
  3902. within: x,
  3903. elem: u
  3904. })
  3905. }), n.using && (l = function(e) {
  3906. var t = v.left - N.left,
  3907. i = t + m - d,
  3908. s = v.top - N.top,
  3909. a = s + g - c,
  3910. h = {
  3911. target: {
  3912. element: _,
  3913. left: v.left,
  3914. top: v.top,
  3915. width: m,
  3916. height: g
  3917. },
  3918. element: {
  3919. element: u,
  3920. left: N.left,
  3921. top: N.top,
  3922. width: d,
  3923. height: c
  3924. },
  3925. horizontal: 0 > i ? "left" : t > 0 ? "right" : "center",
  3926. vertical: 0 > a ? "top" : s > 0 ? "bottom" : "middle"
  3927. };
  3928. d > m && m > r(t + i) && (h.horizontal = "center"), c > g && g > r(s + a) && (h.vertical = "middle"), h.important = o(r(t), r(i)) > o(r(s), r(a)) ? "horizontal" : "vertical", n.using.call(this, e, h)
  3929. }), u.offset(e.extend(N, {
  3930. using: l
  3931. }))
  3932. })
  3933. }, e.ui.position = {
  3934. fit: {
  3935. left: function(e, t) {
  3936. var i, s = t.within,
  3937. n = s.isWindow ? s.scrollLeft : s.offset.left,
  3938. a = s.width,
  3939. r = e.left - t.collisionPosition.marginLeft,
  3940. h = n - r,
  3941. l = r + t.collisionWidth - a - n;
  3942. t.collisionWidth > a ? h > 0 && 0 >= l ? (i = e.left + h + t.collisionWidth - a - n, e.left += h - i) : e.left = l > 0 && 0 >= h ? n : h > l ? n + a - t.collisionWidth : n : h > 0 ? e.left += h : l > 0 ? e.left -= l : e.left = o(e.left - r, e.left)
  3943. },
  3944. top: function(e, t) {
  3945. var i, s = t.within,
  3946. n = s.isWindow ? s.scrollTop : s.offset.top,
  3947. a = t.within.height,
  3948. r = e.top - t.collisionPosition.marginTop,
  3949. h = n - r,
  3950. l = r + t.collisionHeight - a - n;
  3951. t.collisionHeight > a ? h > 0 && 0 >= l ? (i = e.top + h + t.collisionHeight - a - n, e.top += h - i) : e.top = l > 0 && 0 >= h ? n : h > l ? n + a - t.collisionHeight : n : h > 0 ? e.top += h : l > 0 ? e.top -= l : e.top = o(e.top - r, e.top)
  3952. }
  3953. },
  3954. flip: {
  3955. left: function(e, t) {
  3956. var i, s, n = t.within,
  3957. a = n.offset.left + n.scrollLeft,
  3958. o = n.width,
  3959. h = n.isWindow ? n.scrollLeft : n.offset.left,
  3960. l = e.left - t.collisionPosition.marginLeft,
  3961. u = l - h,
  3962. d = l + t.collisionWidth - o - h,
  3963. c = "left" === t.my[0] ? -t.elemWidth : "right" === t.my[0] ? t.elemWidth : 0,
  3964. p = "left" === t.at[0] ? t.targetWidth : "right" === t.at[0] ? -t.targetWidth : 0,
  3965. f = -2 * t.offset[0];
  3966. 0 > u ? (i = e.left + c + p + f + t.collisionWidth - o - a, (0 > i || r(u) > i) && (e.left += c + p + f)) : d > 0 && (s = e.left - t.collisionPosition.marginLeft + c + p + f - h, (s > 0 || d > r(s)) && (e.left += c + p + f))
  3967. },
  3968. top: function(e, t) {
  3969. var i, s, n = t.within,
  3970. a = n.offset.top + n.scrollTop,
  3971. o = n.height,
  3972. h = n.isWindow ? n.scrollTop : n.offset.top,
  3973. l = e.top - t.collisionPosition.marginTop,
  3974. u = l - h,
  3975. d = l + t.collisionHeight - o - h,
  3976. c = "top" === t.my[1],
  3977. p = c ? -t.elemHeight : "bottom" === t.my[1] ? t.elemHeight : 0,
  3978. f = "top" === t.at[1] ? t.targetHeight : "bottom" === t.at[1] ? -t.targetHeight : 0,
  3979. m = -2 * t.offset[1];
  3980. 0 > u ? (s = e.top + p + f + m + t.collisionHeight - o - a, e.top + p + f + m > u && (0 > s || r(u) > s) && (e.top += p + f + m)) : d > 0 && (i = e.top - t.collisionPosition.marginTop + p + f + m - h, e.top + p + f + m > d && (i > 0 || d > r(i)) && (e.top += p + f + m))
  3981. }
  3982. },
  3983. flipfit: {
  3984. left: function() {
  3985. e.ui.position.flip.left.apply(this, arguments), e.ui.position.fit.left.apply(this, arguments)
  3986. },
  3987. top: function() {
  3988. e.ui.position.flip.top.apply(this, arguments), e.ui.position.fit.top.apply(this, arguments)
  3989. }
  3990. }
  3991. },
  3992. function() {
  3993. var t, i, s, n, o, r = document.getElementsByTagName("body")[0],
  3994. h = document.createElement("div");
  3995. t = document.createElement(r ? "div" : "body"), s = {
  3996. visibility: "hidden",
  3997. width: 0,
  3998. height: 0,
  3999. border: 0,
  4000. margin: 0,
  4001. background: "none"
  4002. }, r && e.extend(s, {
  4003. position: "absolute",
  4004. left: "-1000px",
  4005. top: "-1000px"
  4006. });
  4007. for (o in s) t.style[o] = s[o];
  4008. t.appendChild(h), i = r || document.documentElement, i.insertBefore(t, i.firstChild), h.style.cssText = "position: absolute; left: 10.7432222px;", n = e(h).offset().left, a = n > 10 && 11 > n, t.innerHTML = "", i.removeChild(t)
  4009. }()
  4010. }(), e.ui.position, e.widget("ui.menu", {
  4011. version: "1.11.1",
  4012. defaultElement: "<ul>",
  4013. delay: 300,
  4014. options: {
  4015. icons: {
  4016. submenu: "ui-icon-carat-1-e"
  4017. },
  4018. items: "> *",
  4019. menus: "ul",
  4020. position: {
  4021. my: "left-1 top",
  4022. at: "right top"
  4023. },
  4024. role: "menu",
  4025. blur: null,
  4026. focus: null,
  4027. select: null
  4028. },
  4029. _create: function() {
  4030. this.activeMenu = this.element, this.mouseHandled = !1, this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons", !!this.element.find(".ui-icon").length).attr({
  4031. role: this.options.role,
  4032. tabIndex: 0
  4033. }), this.options.disabled && this.element.addClass("ui-state-disabled").attr("aria-disabled", "true"), this._on({
  4034. "mousedown .ui-menu-item": function(e) {
  4035. e.preventDefault()
  4036. },
  4037. "click .ui-menu-item": function(t) {
  4038. var i = e(t.target);
  4039. !this.mouseHandled && i.not(".ui-state-disabled").length && (this.select(t), t.isPropagationStopped() || (this.mouseHandled = !0), i.has(".ui-menu").length ? this.expand(t) : !this.element.is(":focus") && e(this.document[0].activeElement).closest(".ui-menu").length && (this.element.trigger("focus", [!0]), this.active && 1 === this.active.parents(".ui-menu").length && clearTimeout(this.timer)))
  4040. },
  4041. "mouseenter .ui-menu-item": function(t) {
  4042. var i = e(t.currentTarget);
  4043. i.siblings(".ui-state-active").removeClass("ui-state-active"), this.focus(t, i)
  4044. },
  4045. mouseleave: "collapseAll",
  4046. "mouseleave .ui-menu": "collapseAll",
  4047. focus: function(e, t) {
  4048. var i = this.active || this.element.find(this.options.items).eq(0);
  4049. t || this.focus(e, i)
  4050. },
  4051. blur: function(t) {
  4052. this._delay(function() {
  4053. e.contains(this.element[0], this.document[0].activeElement) || this.collapseAll(t)
  4054. })
  4055. },
  4056. keydown: "_keydown"
  4057. }), this.refresh(), this._on(this.document, {
  4058. click: function(e) {
  4059. this._closeOnDocumentClick(e) && this.collapseAll(e), this.mouseHandled = !1
  4060. }
  4061. })
  4062. },
  4063. _destroy: function() {
  4064. this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(), this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function() {
  4065. var t = e(this);
  4066. t.data("ui-menu-submenu-carat") && t.remove()
  4067. }), this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")
  4068. },
  4069. _keydown: function(t) {
  4070. function i(e) {
  4071. return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&")
  4072. }
  4073. var s, n, a, o, r, h = !0;
  4074. switch (t.keyCode) {
  4075. case e.ui.keyCode.PAGE_UP:
  4076. this.previousPage(t);
  4077. break;
  4078. case e.ui.keyCode.PAGE_DOWN:
  4079. this.nextPage(t);
  4080. break;
  4081. case e.ui.keyCode.HOME:
  4082. this._move("first", "first", t);
  4083. break;
  4084. case e.ui.keyCode.END:
  4085. this._move("last", "last", t);
  4086. break;
  4087. case e.ui.keyCode.UP:
  4088. this.previous(t);
  4089. break;
  4090. case e.ui.keyCode.DOWN:
  4091. this.next(t);
  4092. break;
  4093. case e.ui.keyCode.LEFT:
  4094. this.collapse(t);
  4095. break;
  4096. case e.ui.keyCode.RIGHT:
  4097. this.active && !this.active.is(".ui-state-disabled") && this.expand(t);
  4098. break;
  4099. case e.ui.keyCode.ENTER:
  4100. case e.ui.keyCode.SPACE:
  4101. this._activate(t);
  4102. break;
  4103. case e.ui.keyCode.ESCAPE:
  4104. this.collapse(t);
  4105. break;
  4106. default:
  4107. h = !1, n = this.previousFilter || "", a = String.fromCharCode(t.keyCode), o = !1, clearTimeout(this.filterTimer), a === n ? o = !0 : a = n + a, r = RegExp("^" + i(a), "i"), s = this.activeMenu.find(this.options.items).filter(function() {
  4108. return r.test(e(this).text())
  4109. }), s = o && -1 !== s.index(this.active.next()) ? this.active.nextAll(".ui-menu-item") : s, s.length || (a = String.fromCharCode(t.keyCode), r = RegExp("^" + i(a), "i"), s = this.activeMenu.find(this.options.items).filter(function() {
  4110. return r.test(e(this).text())
  4111. })), s.length ? (this.focus(t, s), s.length > 1 ? (this.previousFilter = a, this.filterTimer = this._delay(function() {
  4112. delete this.previousFilter
  4113. }, 1e3)) : delete this.previousFilter) : delete this.previousFilter
  4114. }
  4115. h && t.preventDefault()
  4116. },
  4117. _activate: function(e) {
  4118. this.active.is(".ui-state-disabled") || (this.active.is("[aria-haspopup='true']") ? this.expand(e) : this.select(e))
  4119. },
  4120. refresh: function() {
  4121. var t, i, s = this,
  4122. n = this.options.icons.submenu,
  4123. a = this.element.find(this.options.menus);
  4124. this.element.toggleClass("ui-menu-icons", !!this.element.find(".ui-icon").length), a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({
  4125. role: this.options.role,
  4126. "aria-hidden": "true",
  4127. "aria-expanded": "false"
  4128. }).each(function() {
  4129. var t = e(this),
  4130. i = t.parent(),
  4131. s = e("<span>").addClass("ui-menu-icon ui-icon " + n).data("ui-menu-submenu-carat", !0);
  4132. i.attr("aria-haspopup", "true").prepend(s), t.attr("aria-labelledby", i.attr("id"))
  4133. }), t = a.add(this.element), i = t.find(this.options.items), i.not(".ui-menu-item").each(function() {
  4134. var t = e(this);
  4135. s._isDivider(t) && t.addClass("ui-widget-content ui-menu-divider")
  4136. }), i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({
  4137. tabIndex: -1,
  4138. role: this._itemRole()
  4139. }), i.filter(".ui-state-disabled").attr("aria-disabled", "true"), this.active && !e.contains(this.element[0], this.active[0]) && this.blur()
  4140. },
  4141. _itemRole: function() {
  4142. return {
  4143. menu: "menuitem",
  4144. listbox: "option"
  4145. }[this.options.role]
  4146. },
  4147. _setOption: function(e, t) {
  4148. "icons" === e && this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu), "disabled" === e && this.element.toggleClass("ui-state-disabled", !!t).attr("aria-disabled", t), this._super(e, t)
  4149. },
  4150. focus: function(e, t) {
  4151. var i, s;
  4152. this.blur(e, e && "focus" === e.type), this._scrollIntoView(t), this.active = t.first(), s = this.active.addClass("ui-state-focus").removeClass("ui-state-active"), this.options.role && this.element.attr("aria-activedescendant", s.attr("id")), this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"), e && "keydown" === e.type ? this._close() : this.timer = this._delay(function() {
  4153. this._close()
  4154. }, this.delay), i = t.children(".ui-menu"), i.length && e && /^mouse/.test(e.type) && this._startOpening(i), this.activeMenu = t.parent(), this._trigger("focus", e, {
  4155. item: t
  4156. })
  4157. },
  4158. _scrollIntoView: function(t) {
  4159. var i, s, n, a, o, r;
  4160. this._hasScroll() && (i = parseFloat(e.css(this.activeMenu[0], "borderTopWidth")) || 0, s = parseFloat(e.css(this.activeMenu[0], "paddingTop")) || 0, n = t.offset().top - this.activeMenu.offset().top - i - s, a = this.activeMenu.scrollTop(), o = this.activeMenu.height(), r = t.outerHeight(), 0 > n ? this.activeMenu.scrollTop(a + n) : n + r > o && this.activeMenu.scrollTop(a + n - o + r))
  4161. },
  4162. blur: function(e, t) {
  4163. t || clearTimeout(this.timer), this.active && (this.active.removeClass("ui-state-focus"), this.active = null, this._trigger("blur", e, {
  4164. item: this.active
  4165. }))
  4166. },
  4167. _startOpening: function(e) {
  4168. clearTimeout(this.timer), "true" === e.attr("aria-hidden") && (this.timer = this._delay(function() {
  4169. this._close(), this._open(e)
  4170. }, this.delay))
  4171. },
  4172. _open: function(t) {
  4173. var i = e.extend({ of: this.active
  4174. }, this.options.position);
  4175. clearTimeout(this.timer), this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden", "true"), t.show().removeAttr("aria-hidden").attr("aria-expanded", "true").position(i)
  4176. },
  4177. collapseAll: function(t, i) {
  4178. clearTimeout(this.timer), this.timer = this._delay(function() {
  4179. var s = i ? this.element : e(t && t.target).closest(this.element.find(".ui-menu"));
  4180. s.length || (s = this.element), this._close(s), this.blur(t), this.activeMenu = s
  4181. }, this.delay)
  4182. },
  4183. _close: function(e) {
  4184. e || (e = this.active ? this.active.parent() : this.element), e.find(".ui-menu").hide().attr("aria-hidden", "true").attr("aria-expanded", "false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")
  4185. },
  4186. _closeOnDocumentClick: function(t) {
  4187. return !e(t.target).closest(".ui-menu").length
  4188. },
  4189. _isDivider: function(e) {
  4190. return !/[^\-\u2014\u2013\s]/.test(e.text())
  4191. },
  4192. collapse: function(e) {
  4193. var t = this.active && this.active.parent().closest(".ui-menu-item", this.element);
  4194. t && t.length && (this._close(), this.focus(e, t))
  4195. },
  4196. expand: function(e) {
  4197. var t = this.active && this.active.children(".ui-menu ").find(this.options.items).first();
  4198. t && t.length && (this._open(t.parent()), this._delay(function() {
  4199. this.focus(e, t)
  4200. }))
  4201. },
  4202. next: function(e) {
  4203. this._move("next", "first", e)
  4204. },
  4205. previous: function(e) {
  4206. this._move("prev", "last", e)
  4207. },
  4208. isFirstItem: function() {
  4209. return this.active && !this.active.prevAll(".ui-menu-item").length
  4210. },
  4211. isLastItem: function() {
  4212. return this.active && !this.active.nextAll(".ui-menu-item").length
  4213. },
  4214. _move: function(e, t, i) {
  4215. var s;
  4216. this.active && (s = "first" === e || "last" === e ? this.active["first" === e ? "prevAll" : "nextAll"](".ui-menu-item").eq(-1) : this.active[e + "All"](".ui-menu-item").eq(0)), s && s.length && this.active || (s = this.activeMenu.find(this.options.items)[t]()), this.focus(i, s)
  4217. },
  4218. nextPage: function(t) {
  4219. var i, s, n;
  4220. return this.active ? (this.isLastItem() || (this._hasScroll() ? (s = this.active.offset().top, n = this.element.height(), this.active.nextAll(".ui-menu-item").each(function() {
  4221. return i = e(this), 0 > i.offset().top - s - n
  4222. }), this.focus(t, i)) : this.focus(t, this.activeMenu.find(this.options.items)[this.active ? "last" : "first"]())), void 0) : (this.next(t), void 0)
  4223. },
  4224. previousPage: function(t) {
  4225. var i, s, n;
  4226. return this.active ? (this.isFirstItem() || (this._hasScroll() ? (s = this.active.offset().top, n = this.element.height(), this.active.prevAll(".ui-menu-item").each(function() {
  4227. return i = e(this), i.offset().top - s + n > 0
  4228. }), this.focus(t, i)) : this.focus(t, this.activeMenu.find(this.options.items).first())), void 0) : (this.next(t), void 0)
  4229. },
  4230. _hasScroll: function() {
  4231. return this.element.outerHeight() < this.element.prop("scrollHeight")
  4232. },
  4233. select: function(t) {
  4234. this.active = this.active || e(t.target).closest(".ui-menu-item");
  4235. var i = {
  4236. item: this.active
  4237. };
  4238. this.active.has(".ui-menu").length || this.collapseAll(t, !0), this._trigger("select", t, i)
  4239. }
  4240. }), e.widget("ui.autocomplete", {
  4241. version: "1.11.1",
  4242. defaultElement: "<input>",
  4243. options: {
  4244. appendTo: null,
  4245. autoFocus: !1,
  4246. delay: 300,
  4247. minLength: 1,
  4248. position: {
  4249. my: "left top",
  4250. at: "left bottom",
  4251. collision: "none"
  4252. },
  4253. source: null,
  4254. change: null,
  4255. close: null,
  4256. focus: null,
  4257. open: null,
  4258. response: null,
  4259. search: null,
  4260. select: null
  4261. },
  4262. requestIndex: 0,
  4263. pending: 0,
  4264. _create: function() {
  4265. var t, i, s, n = this.element[0].nodeName.toLowerCase(),
  4266. a = "textarea" === n,
  4267. o = "input" === n;
  4268. this.isMultiLine = a ? !0 : o ? !1 : this.element.prop("isContentEditable"), this.valueMethod = this.element[a || o ? "val" : "text"], this.isNewMenu = !0, this.element.addClass("ui-autocomplete-input").attr("autocomplete", "off"), this._on(this.element, {
  4269. keydown: function(n) {
  4270. if (this.element.prop("readOnly")) return t = !0, s = !0, i = !0, void 0;
  4271. t = !1, s = !1, i = !1;
  4272. var a = e.ui.keyCode;
  4273. switch (n.keyCode) {
  4274. case a.PAGE_UP:
  4275. t = !0, this._move("previousPage", n);
  4276. break;
  4277. case a.PAGE_DOWN:
  4278. t = !0, this._move("nextPage", n);
  4279. break;
  4280. case a.UP:
  4281. t = !0, this._keyEvent("previous", n);
  4282. break;
  4283. case a.DOWN:
  4284. t = !0, this._keyEvent("next", n);
  4285. break;
  4286. case a.ENTER:
  4287. this.menu.active && (t = !0, n.preventDefault(), this.menu.select(n));
  4288. break;
  4289. case a.TAB:
  4290. this.menu.active && this.menu.select(n);
  4291. break;
  4292. case a.ESCAPE:
  4293. this.menu.element.is(":visible") && (this.isMultiLine || this._value(this.term), this.close(n), n.preventDefault());
  4294. break;
  4295. default:
  4296. i = !0, this._searchTimeout(n)
  4297. }
  4298. },
  4299. keypress: function(s) {
  4300. if (t) return t = !1, (!this.isMultiLine || this.menu.element.is(":visible")) && s.preventDefault(), void 0;
  4301. if (!i) {
  4302. var n = e.ui.keyCode;
  4303. switch (s.keyCode) {
  4304. case n.PAGE_UP:
  4305. this._move("previousPage", s);
  4306. break;
  4307. case n.PAGE_DOWN:
  4308. this._move("nextPage", s);
  4309. break;
  4310. case n.UP:
  4311. this._keyEvent("previous", s);
  4312. break;
  4313. case n.DOWN:
  4314. this._keyEvent("next", s)
  4315. }
  4316. }
  4317. },
  4318. input: function(e) {
  4319. return s ? (s = !1, e.preventDefault(), void 0) : (this._searchTimeout(e), void 0)
  4320. },
  4321. focus: function() {
  4322. this.selectedItem = null, this.previous = this._value()
  4323. },
  4324. blur: function(e) {
  4325. return this.cancelBlur ? (delete this.cancelBlur, void 0) : (clearTimeout(this.searching), this.close(e), this._change(e), void 0)
  4326. }
  4327. }), this._initSource(), this.menu = e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({
  4328. role: null
  4329. }).hide().menu("instance"), this._on(this.menu.element, {
  4330. mousedown: function(t) {
  4331. t.preventDefault(), this.cancelBlur = !0, this._delay(function() {
  4332. delete this.cancelBlur
  4333. });
  4334. var i = this.menu.element[0];
  4335. e(t.target).closest(".ui-menu-item").length || this._delay(function() {
  4336. var t = this;
  4337. this.document.one("mousedown", function(s) {
  4338. s.target === t.element[0] || s.target === i || e.contains(i, s.target) || t.close()
  4339. })
  4340. })
  4341. },
  4342. menufocus: function(t, i) {
  4343. var s, n;
  4344. return this.isNewMenu && (this.isNewMenu = !1, t.originalEvent && /^mouse/.test(t.originalEvent.type)) ? (this.menu.blur(), this.document.one("mousemove", function() {
  4345. e(t.target).trigger(t.originalEvent)
  4346. }), void 0) : (n = i.item.data("ui-autocomplete-item"), !1 !== this._trigger("focus", t, {
  4347. item: n
  4348. }) && t.originalEvent && /^key/.test(t.originalEvent.type) && this._value(n.value), s = i.item.attr("aria-label") || n.value, s && e.trim(s).length && (this.liveRegion.children().hide(), e("<div>").text(s).appendTo(this.liveRegion)), void 0)
  4349. },
  4350. menuselect: function(e, t) {
  4351. var i = t.item.data("ui-autocomplete-item"),
  4352. s = this.previous;
  4353. this.element[0] !== this.document[0].activeElement && (this.element.focus(), this.previous = s, this._delay(function() {
  4354. this.previous = s, this.selectedItem = i
  4355. })), !1 !== this._trigger("select", e, {
  4356. item: i
  4357. }) && this._value(i.value), this.term = this._value(), this.close(e), this.selectedItem = i
  4358. }
  4359. }), this.liveRegion = e("<span>", {
  4360. role: "status",
  4361. "aria-live": "assertive",
  4362. "aria-relevant": "additions"
  4363. }).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body), this._on(this.window, {
  4364. beforeunload: function() {
  4365. this.element.removeAttr("autocomplete")
  4366. }
  4367. })
  4368. },
  4369. _destroy: function() {
  4370. clearTimeout(this.searching), this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"), this.menu.element.remove(), this.liveRegion.remove()
  4371. },
  4372. _setOption: function(e, t) {
  4373. this._super(e, t), "source" === e && this._initSource(), "appendTo" === e && this.menu.element.appendTo(this._appendTo()), "disabled" === e && t && this.xhr && this.xhr.abort()
  4374. },
  4375. _appendTo: function() {
  4376. var t = this.options.appendTo;
  4377. return t && (t = t.jquery || t.nodeType ? e(t) : this.document.find(t).eq(0)), t && t[0] || (t = this.element.closest(".ui-front")), t.length || (t = this.document[0].body), t
  4378. },
  4379. _initSource: function() {
  4380. var t, i, s = this;
  4381. e.isArray(this.options.source) ? (t = this.options.source, this.source = function(i, s) {
  4382. s(e.ui.autocomplete.filter(t, i.term))
  4383. }) : "string" == typeof this.options.source ? (i = this.options.source, this.source = function(t, n) {
  4384. s.xhr && s.xhr.abort(), s.xhr = e.ajax({
  4385. url: i,
  4386. data: t,
  4387. dataType: "json",
  4388. success: function(e) {
  4389. n(e)
  4390. },
  4391. error: function() {
  4392. n([])
  4393. }
  4394. })
  4395. }) : this.source = this.options.source
  4396. },
  4397. _searchTimeout: function(e) {
  4398. clearTimeout(this.searching), this.searching = this._delay(function() {
  4399. var t = this.term === this._value(),
  4400. i = this.menu.element.is(":visible"),
  4401. s = e.altKey || e.ctrlKey || e.metaKey || e.shiftKey;
  4402. (!t || t && !i && !s) && (this.selectedItem = null, this.search(null, e))
  4403. }, this.options.delay)
  4404. },
  4405. search: function(e, t) {
  4406. return e = null != e ? e : this._value(), this.term = this._value(), e.length < this.options.minLength ? this.close(t) : this._trigger("search", t) !== !1 ? this._search(e) : void 0
  4407. },
  4408. _search: function(e) {
  4409. this.pending++, this.element.addClass("ui-autocomplete-loading"), this.cancelSearch = !1, this.source({
  4410. term: e
  4411. }, this._response())
  4412. },
  4413. _response: function() {
  4414. var t = ++this.requestIndex;
  4415. return e.proxy(function(e) {
  4416. t === this.requestIndex && this.__response(e), this.pending--, this.pending || this.element.removeClass("ui-autocomplete-loading")
  4417. }, this)
  4418. },
  4419. __response: function(e) {
  4420. e && (e = this._normalize(e)), this._trigger("response", null, {
  4421. content: e
  4422. }), !this.options.disabled && e && e.length && !this.cancelSearch ? (this._suggest(e), this._trigger("open")) : this._close()
  4423. },
  4424. close: function(e) {
  4425. this.cancelSearch = !0, this._close(e)
  4426. },
  4427. _close: function(e) {
  4428. this.menu.element.is(":visible") && (this.menu.element.hide(), this.menu.blur(), this.isNewMenu = !0, this._trigger("close", e))
  4429. },
  4430. _change: function(e) {
  4431. this.previous !== this._value() && this._trigger("change", e, {
  4432. item: this.selectedItem
  4433. })
  4434. },
  4435. _normalize: function(t) {
  4436. return t.length && t[0].label && t[0].value ? t : e.map(t, function(t) {
  4437. return "string" == typeof t ? {
  4438. label: t,
  4439. value: t
  4440. } : e.extend({}, t, {
  4441. label: t.label || t.value,
  4442. value: t.value || t.label
  4443. })
  4444. })
  4445. },
  4446. _suggest: function(t) {
  4447. var i = this.menu.element.empty();
  4448. this._renderMenu(i, t), this.isNewMenu = !0, this.menu.refresh(), i.show(), this._resizeMenu(), i.position(e.extend({ of: this.element
  4449. }, this.options.position)), this.options.autoFocus && this.menu.next()
  4450. },
  4451. _resizeMenu: function() {
  4452. var e = this.menu.element;
  4453. e.outerWidth(Math.max(e.width("").outerWidth() + 1, this.element.outerWidth()))
  4454. },
  4455. _renderMenu: function(t, i) {
  4456. var s = this;
  4457. e.each(i, function(e, i) {
  4458. s._renderItemData(t, i)
  4459. })
  4460. },
  4461. _renderItemData: function(e, t) {
  4462. return this._renderItem(e, t).data("ui-autocomplete-item", t)
  4463. },
  4464. _renderItem: function(t, i) {
  4465. return e("<li>").text(i.label).appendTo(t)
  4466. },
  4467. _move: function(e, t) {
  4468. return this.menu.element.is(":visible") ? this.menu.isFirstItem() && /^previous/.test(e) || this.menu.isLastItem() && /^next/.test(e) ? (this.isMultiLine || this._value(this.term), this.menu.blur(), void 0) : (this.menu[e](t), void 0) : (this.search(null, t), void 0)
  4469. },
  4470. widget: function() {
  4471. return this.menu.element
  4472. },
  4473. _value: function() {
  4474. return this.valueMethod.apply(this.element, arguments)
  4475. },
  4476. _keyEvent: function(e, t) {
  4477. (!this.isMultiLine || this.menu.element.is(":visible")) && (this._move(e, t), t.preventDefault())
  4478. }
  4479. }), e.extend(e.ui.autocomplete, {
  4480. escapeRegex: function(e) {
  4481. return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&")
  4482. },
  4483. filter: function(t, i) {
  4484. var s = RegExp(e.ui.autocomplete.escapeRegex(i), "i");
  4485. return e.grep(t, function(e) {
  4486. return s.test(e.label || e.value || e)
  4487. })
  4488. }
  4489. }), e.widget("ui.autocomplete", e.ui.autocomplete, {
  4490. options: {
  4491. messages: {
  4492. noResults: "No search results.",
  4493. results: function(e) {
  4494. return e + (e > 1 ? " results are" : " result is") + " available, use up and down arrow keys to navigate."
  4495. }
  4496. }
  4497. },
  4498. __response: function(t) {
  4499. var i;
  4500. this._superApply(arguments), this.options.disabled || this.cancelSearch || (i = t && t.length ? this.options.messages.results(t.length) : this.options.messages.noResults, this.liveRegion.children().hide(), e("<div>").text(i).appendTo(this.liveRegion))
  4501. }
  4502. }), e.ui.autocomplete
  4503. });
  4504.  
  4505. function modal(t) {
  4506. return $.cModal(t)
  4507. }! function(t) {
  4508. t.cModal = function(n) {
  4509. var e, o = {
  4510. type: "default",
  4511. title: null,
  4512. text: null,
  4513. size: "normal",
  4514. buttons: [{
  4515. text: "OK",
  4516. val: !0,
  4517. onClick: function() {
  4518. return !0
  4519. }
  4520. }],
  4521. center: !0,
  4522. autoclose: !1,
  4523. callback: null,
  4524. onShow: null,
  4525. animate: !0,
  4526. closeClick: !0,
  4527. closable: !0,
  4528. theme: "default",
  4529. background: "rgba(0,0,0,0.35)",
  4530. zIndex: 1050,
  4531. buttonText: {
  4532. ok: "OK",
  4533. yes: "Yes",
  4534. cancel: "Cancel"
  4535. },
  4536. template: '<div class="modal-box"><div class="modal-inner"><div class="modal-title"><a class="modal-close-btn"></a></div><div class="modal-text"></div><div class="modal-buttons"></div></div></div>',
  4537. _classes: {
  4538. box: ".modal-box",
  4539. boxInner: ".modal-inner",
  4540. title: ".modal-title",
  4541. content: ".modal-text",
  4542. buttons: ".modal-buttons",
  4543. closebtn: ".modal-close-btn"
  4544. }
  4545. },
  4546. n = t.extend({}, o, n),
  4547. a = t("<div id='modal-window' />").hide(),
  4548. l = n._classes.box,
  4549. s = a.append(n.template),
  4550. i = {
  4551. init: function() {
  4552. t("#modal-window").remove(), i._setStyle(), i._modalShow(), i._modalConent(), a.on("click", "a.modal-btn", function() {
  4553. i._modalBtn(t(this))
  4554. }).on("click", n._classes.closebtn, function() {
  4555. i._modalHide()
  4556. }).click(function(t) {
  4557. n.closeClick && "modal-window" == t.target.id && i._modalHide()
  4558. }), t(window).bind("keyup", i._keyUpF).resize(function() {
  4559. var t = n.animate;
  4560. n.animate = !1, i._position(), n.animate = t
  4561. })
  4562. },
  4563. _setStyle: function() {
  4564. a.css({
  4565. position: "fixed",
  4566. width: "100%",
  4567. height: "100%",
  4568. top: "0",
  4569. left: "0",
  4570. "z-index": n.zIndex,
  4571. overflow: "auto"
  4572. }), a.find(n._classes.box).css({
  4573. position: "absolute"
  4574. })
  4575. },
  4576. _keyUpF: function(t) {
  4577. switch (t.keyCode) {
  4578. case 13:
  4579. if (s.find("input:not(.modal-prompt-input),textarea").is(":focus")) return !1;
  4580. i._modalBtn(a.find(n._classes.buttons + " a.modal-btn" + ("undefined" != typeof i.btnForEKey && a.find(n._classes.buttons + " a.modal-btn:eq(" + i.btnForEKey + ")").size() > 0 ? ":eq(" + i.btnForEKey + ")" : ":last-child")));
  4581. break;
  4582. case 27:
  4583. i._modalHide()
  4584. }
  4585. },
  4586. _modalShow: function() {
  4587. t("body").css({
  4588. overflow: "hidden",
  4589. width: t("body").innerWidth()
  4590. }).append(s), null != n.onShow ? n.onShow(i.actions) : null
  4591. },
  4592. _modalHide: function(o) {
  4593. if (n.closable === !1) return !1;
  4594. e = "undefined" == typeof e ? !1 : e;
  4595. var s = function() {
  4596. if (null != n.callback && "function" == typeof n.callback && 0 == n.callback(e, a, i.actions) ? !1 : !0) {
  4597. a.fadeOut(200, function() {
  4598. t(this).remove(), t("body").css({
  4599. overflow: "",
  4600. width: ""
  4601. })
  4602. });
  4603. var o = 100 * parseFloat(t(l).css("top")) / parseFloat(t(l).parent().css("height"));
  4604. t(l).stop(!0, !0).animate({
  4605. top: o + (n.animate ? 3 : 0) + "%"
  4606. }, "fast")
  4607. }
  4608. };
  4609. o ? setTimeout(function() {
  4610. s()
  4611. }, o) : s(), t(window).unbind("keyup", i._keyUpF)
  4612. },
  4613. _modalConent: function() {
  4614. var e = n._classes.title,
  4615. o = n._classes.content,
  4616. s = n._classes.buttons,
  4617. d = n.buttonText,
  4618. c = ["alert", "confirm", "prompt"],
  4619. u = ["xenon", "atlant", "reseted"];
  4620. if (-1 == t.inArray(n.type, c) && "default" != n.type && t(l).addClass("modal-type-" + n.type), t(l).addClass(n.size && null != n.size ? "modal-size-" + n.size : "modal-size-normal"), n.theme && null != n.theme && "default" != n.theme && t(l).addClass((-1 == t.inArray(n.theme, u) ? "" : "modal-theme-") + n.theme), n.background && null != n.background && a.css("background-color", n.background), n.title || null != n.title ? t(e).prepend("<h3>" + n.title + "</h3>") : t(e).remove(), "prompt" == n.type ? n.text = (null != n.text ? n.text : "") + '<input type="text" name="modal-prompt-input" class="modal-prompt-input" autocomplete="off" autofocus="on" />' : "", t(o).html(n.text), n.buttons || null != n.buttons) {
  4621. var r = "";
  4622. switch (n.type) {
  4623. case "alert":
  4624. r = '<a class="modal-btn' + (n.buttons[0].addClass ? " " + n.buttons[0].addClass : "") + '">' + d.ok + "</a>";
  4625. break;
  4626. case "confirm":
  4627. r = '<a class="modal-btn' + (n.buttons[0].addClass ? " " + n.buttons[0].addClass : "") + '">' + d.cancel + '</a><a class="modal-btn ' + (n.buttons[1] && n.buttons[1].addClass ? " " + n.buttons[1].addClass : "btn-light-blue") + '">' + d.yes + "</a>";
  4628. break;
  4629. case "prompt":
  4630. r = '<a class="modal-btn' + (n.buttons[0].addClass ? " " + n.buttons[0].addClass : "") + '">' + d.cancel + '</a><a class="modal-btn ' + (n.buttons[1] && n.buttons[1].addClass ? " " + n.buttons[1].addClass : "btn-light-blue") + '">' + d.ok + "</a>";
  4631. break;
  4632. default:
  4633. n.buttons.length > 0 && t.isArray(n.buttons) ? t.each(n.buttons, function(t, n) {
  4634. var e = n.addClass && "undefined" != typeof n.addClass ? " " + n.addClass : "";
  4635. r += '<a class="modal-btn' + e + '">' + n.text + "</a>", n.eKey && (i.btnForEKey = t)
  4636. }) : r += '<a class="modal-btn">' + d.ok + "</a>"
  4637. }
  4638. t(s).html(r)
  4639. } else t(s).remove();
  4640. if ("prompt" == n.type && $(".modal-prompt-input").focus(), n.autoclose) {
  4641. var m = n.buttons || null != n.buttons ? 32 * t(o).text().length : 900;
  4642. i._modalHide(900 > m ? 900 : m)
  4643. }
  4644. a.fadeIn(200), i._position()
  4645. },
  4646. _position: function() {
  4647. var e, o, a;
  4648. n.center ? (e = {
  4649. top: t(window).height() < t(l).outerHeight() ? 1 : 50,
  4650. left: 50,
  4651. marginTop: t(window).height() < t(l).outerHeight() ? 0 : -t(l).outerHeight() / 2,
  4652. marginLeft: -t(l).outerWidth() / 2
  4653. }, o = {
  4654. top: e.top - (n.animate ? 3 : 0) + "%",
  4655. left: e.left + "%",
  4656. "margin-top": e.marginTop,
  4657. "margin-left": e.marginLeft
  4658. }, a = {
  4659. top: e.top + "%"
  4660. }) : (e = {
  4661. top: t(window).height() < t(l).outerHeight() ? 1 : 10,
  4662. left: 50,
  4663. marginTop: 0,
  4664. marginLeft: -t(l).outerWidth() / 2
  4665. }, o = {
  4666. top: e.top - (n.animate ? 3 : 0) + "%",
  4667. left: e.left + "%",
  4668. "margin-top": e.marginTop,
  4669. "margin-left": e.marginLeft
  4670. }, a = {
  4671. top: e.top + "%"
  4672. }), t(l).css(o).stop(!0, !0).animate(a, "fast")
  4673. },
  4674. _modalBtn: function(o) {
  4675. var l = !1,
  4676. s = n.type,
  4677. d = o.index(),
  4678. c = n.buttons[d];
  4679. if (t.inArray(s, ["alert", "confirm", "prompt"]) > -1) e = l = 1 == d ? !0 : !1, "prompt" == s && (e = l = l && a.find("input.modal-prompt-input").size() > 0 != 0 ? a.find("input.modal-prompt-input").val() : !1), i._modalHide();
  4680. else {
  4681. if (o.hasClass("btn-disabled")) return !1;
  4682. e = l = c && c.val ? c.val : !0, (!c.onClick || c.onClick(t.extend({
  4683. val: l,
  4684. bObj: o,
  4685. bOpts: c
  4686. }, i.actions))) && i._modalHide()
  4687. }
  4688. e = l
  4689. },
  4690. actions: {
  4691. html: a,
  4692. close: function() {
  4693. i._modalHide()
  4694. },
  4695. getModal: function() {
  4696. return a
  4697. },
  4698. getBox: function() {
  4699. return a.find(n._classes.box)
  4700. },
  4701. getInner: function() {
  4702. return a.find(n._classes.boxInner)
  4703. },
  4704. getTitle: function() {
  4705. return a.find(n._classes.title)
  4706. },
  4707. getContet: function() {
  4708. return a.find(n._classes.content)
  4709. },
  4710. getButtons: function() {
  4711. return a.find(n._classes.buttons).find("a")
  4712. },
  4713. setTitle: function(t) {
  4714. return a.find(n._classes.title + " h3").html(t), a.find(n._classes.title + " h3").size() > 0
  4715. },
  4716. setContent: function(t) {
  4717. return a.find(n._classes.content).html(t), a.find(n._classes.content).size() > 0
  4718. }
  4719. }
  4720. };
  4721. return i.init(), i.actions
  4722. }
  4723. }(jQuery);
  4724. (function(factory) {
  4725. "use strict";
  4726. if (typeof define === 'function' && define.amd) {
  4727. define(['jquery'], factory)
  4728. } else if (typeof exports == "object" && typeof module == "object") {
  4729. module.exports = factory
  4730. } else {
  4731. factory(jQuery)
  4732. }
  4733. })(function($, undefined) {
  4734. "use strict";
  4735. var defaultOpts = {
  4736. beforeShow: noop,
  4737. move: noop,
  4738. change: noop,
  4739. show: noop,
  4740. hide: noop,
  4741. color: !1,
  4742. flat: !1,
  4743. showInput: !1,
  4744. allowEmpty: !1,
  4745. showButtons: !0,
  4746. clickoutFiresChange: !0,
  4747. showInitial: !1,
  4748. showPalette: !1,
  4749. showPaletteOnly: !1,
  4750. hideAfterPaletteSelect: !1,
  4751. togglePaletteOnly: !1,
  4752. showSelectionPalette: !0,
  4753. localStorageKey: !1,
  4754. appendTo: "body",
  4755. maxSelectionSize: 7,
  4756. cancelText: "iptal et",
  4757. chooseText: "seç",
  4758. togglePaletteMoreText: "more",
  4759. togglePaletteLessText: "less",
  4760. clearText: "Clear Color Selection",
  4761. noColorSelectedText: "No Color Selected",
  4762. preferredFormat: !1,
  4763. className: "",
  4764. containerClassName: "",
  4765. replacerClassName: "",
  4766. showAlpha: !1,
  4767. theme: "sp-light",
  4768. palette: [
  4769. ["#ffffff", "#000000", "#ff0000", "#ff8000", "#ffff00", "#008000", "#0000ff", "#4b0082", "#9400d3"]
  4770. ],
  4771. selectionPalette: [],
  4772. disabled: !1,
  4773. offset: null
  4774. },
  4775. spectrums = [],
  4776. IE = !!/msie/i.exec(window.navigator.userAgent),
  4777. rgbaSupport = (function() {
  4778. function contains(str, substr) {
  4779. return !!~('' + str).indexOf(substr)
  4780. }
  4781. var elem = document.createElement('div');
  4782. var style = elem.style;
  4783. style.cssText = 'background-color:rgba(0,0,0,.5)';
  4784. return contains(style.backgroundColor, 'rgba') || contains(style.backgroundColor, 'hsla')
  4785. })(),
  4786. replaceInput = ["<div class='sp-replacer'>", "<div class='sp-preview'><div class='sp-preview-inner'></div></div>", "<div class='sp-dd'>&#9660;</div>", "</div>"].join(''),
  4787. markup = (function() {
  4788. var gradientFix = "";
  4789. if (IE) {
  4790. for (var i = 1; i <= 6; i++) {
  4791. gradientFix += "<div class='sp-" + i + "'></div>"
  4792. }
  4793. }
  4794. return ["<div class='sp-container sp-hidden'>", "<div class='sp-palette-container'>", "<div class='sp-palette sp-thumb sp-cf'></div>", "<div class='sp-palette-button-container sp-cf'>", "<button type='button' class='sp-palette-toggle'></button>", "</div>", "</div>", "<div class='sp-picker-container'>", "<div class='sp-top sp-cf'>", "<div class='sp-fill'></div>", "<div class='sp-top-inner'>", "<div class='sp-color'>", "<div class='sp-sat'>", "<div class='sp-val'>", "<div class='sp-dragger'></div>", "</div>", "</div>", "</div>", "<div class='sp-clear sp-clear-display'>", "</div>", "<div class='sp-hue'>", "<div class='sp-slider'></div>", gradientFix, "</div>", "</div>", "<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>", "</div>", "<div class='sp-input-container sp-cf'>", "<input class='sp-input' type='text' spellcheck='false' />", "</div>", "<div class='sp-initial sp-thumb sp-cf'></div>", "<div class='sp-button-container sp-cf'>", "<a class='sp-cancel' href='#'></a>", "<button type='button' class='sp-choose'></button>", "</div>", "</div>", "</div>"].join("")
  4795. })();
  4796.  
  4797. function paletteTemplate(p, color, className, opts) {
  4798. var html = [];
  4799. for (var i = 0; i < p.length; i++) {
  4800. var current = p[i];
  4801. if (current) {
  4802. var tiny = tinycolor(current);
  4803. var c = tiny.toHsl().l < 0.5 ? "sp-thumb-el sp-thumb-dark" : "sp-thumb-el sp-thumb-light";
  4804. c += (tinycolor.equals(color, current)) ? " sp-thumb-active" : "";
  4805. var formattedString = tiny.toString(opts.preferredFormat || "rgb");
  4806. var swatchStyle = rgbaSupport ? ("background-color:" + tiny.toRgbString()) : "filter:" + tiny.toFilter();
  4807. html.push('<span title="' + formattedString + '" data-color="' + tiny.toRgbString() + '" class="' + c + '"><span class="sp-thumb-inner" style="' + swatchStyle + ';" /></span>')
  4808. } else {
  4809. var cls = 'sp-clear-display';
  4810. html.push($('<div />').append($('<span data-color="" style="background-color:transparent;" class="' + cls + '"></span>').attr('title', opts.noColorSelectedText)).html())
  4811. }
  4812. }
  4813. return "<div class='sp-cf " + className + "'>" + html.join('') + "</div>"
  4814. }
  4815.  
  4816. function hideAll() {
  4817. for (var i = 0; i < spectrums.length; i++) {
  4818. if (spectrums[i]) {
  4819. spectrums[i].hide()
  4820. }
  4821. }
  4822. }
  4823.  
  4824. function instanceOptions(o, callbackContext) {
  4825. var opts = $.extend({}, defaultOpts, o);
  4826. opts.callbacks = {
  4827. 'move': bind(opts.move, callbackContext),
  4828. 'change': bind(opts.change, callbackContext),
  4829. 'show': bind(opts.show, callbackContext),
  4830. 'hide': bind(opts.hide, callbackContext),
  4831. 'beforeShow': bind(opts.beforeShow, callbackContext)
  4832. };
  4833. return opts
  4834. }
  4835.  
  4836. function spectrum(element, o) {
  4837. var opts = instanceOptions(o, element),
  4838. flat = opts.flat,
  4839. showSelectionPalette = opts.showSelectionPalette,
  4840. localStorageKey = opts.localStorageKey,
  4841. theme = opts.theme,
  4842. callbacks = opts.callbacks,
  4843. resize = throttle(reflow, 10),
  4844. visible = !1,
  4845. isDragging = !1,
  4846. dragWidth = 0,
  4847. dragHeight = 0,
  4848. dragHelperHeight = 0,
  4849. slideHeight = 0,
  4850. slideWidth = 0,
  4851. alphaWidth = 0,
  4852. alphaSlideHelperWidth = 0,
  4853. slideHelperHeight = 0,
  4854. currentHue = 0,
  4855. currentSaturation = 0,
  4856. currentValue = 0,
  4857. currentAlpha = 1,
  4858. palette = [],
  4859. paletteArray = [],
  4860. paletteLookup = {},
  4861. selectionPalette = opts.selectionPalette.slice(0),
  4862. maxSelectionSize = opts.maxSelectionSize,
  4863. draggingClass = "sp-dragging",
  4864. shiftMovementDirection = null;
  4865. var doc = element.ownerDocument,
  4866. body = doc.body,
  4867. boundElement = $(element),
  4868. disabled = !1,
  4869. container = $(markup, doc).addClass(theme),
  4870. pickerContainer = container.find(".sp-picker-container"),
  4871. dragger = container.find(".sp-color"),
  4872. dragHelper = container.find(".sp-dragger"),
  4873. slider = container.find(".sp-hue"),
  4874. slideHelper = container.find(".sp-slider"),
  4875. alphaSliderInner = container.find(".sp-alpha-inner"),
  4876. alphaSlider = container.find(".sp-alpha"),
  4877. alphaSlideHelper = container.find(".sp-alpha-handle"),
  4878. textInput = container.find(".sp-input"),
  4879. paletteContainer = container.find(".sp-palette"),
  4880. initialColorContainer = container.find(".sp-initial"),
  4881. cancelButton = container.find(".sp-cancel"),
  4882. clearButton = container.find(".sp-clear"),
  4883. chooseButton = container.find(".sp-choose"),
  4884. toggleButton = container.find(".sp-palette-toggle"),
  4885. isInput = boundElement.is("input"),
  4886. isInputTypeColor = isInput && boundElement.attr("type") === "color" && inputTypeColorSupport(),
  4887. shouldReplace = isInput && !flat,
  4888. replacer = (shouldReplace) ? $(replaceInput).addClass(theme).addClass(opts.className).addClass(opts.replacerClassName) : $([]),
  4889. offsetElement = (shouldReplace) ? replacer : boundElement,
  4890. previewElement = replacer.find(".sp-preview-inner"),
  4891. initialColor = opts.color || (isInput && boundElement.val()),
  4892. colorOnShow = !1,
  4893. preferredFormat = opts.preferredFormat,
  4894. currentPreferredFormat = preferredFormat,
  4895. clickoutFiresChange = !opts.showButtons || opts.clickoutFiresChange,
  4896. isEmpty = !initialColor,
  4897. allowEmpty = opts.allowEmpty && !isInputTypeColor;
  4898.  
  4899. function applyOptions() {
  4900. if (opts.showPaletteOnly) {
  4901. opts.showPalette = !0
  4902. }
  4903. toggleButton.text(opts.showPaletteOnly ? opts.togglePaletteMoreText : opts.togglePaletteLessText);
  4904. if (opts.palette) {
  4905. palette = opts.palette.slice(0);
  4906. paletteArray = $.isArray(palette[0]) ? palette : [palette];
  4907. paletteLookup = {};
  4908. for (var i = 0; i < paletteArray.length; i++) {
  4909. for (var j = 0; j < paletteArray[i].length; j++) {
  4910. var rgb = tinycolor(paletteArray[i][j]).toRgbString();
  4911. paletteLookup[rgb] = !0
  4912. }
  4913. }
  4914. }
  4915. container.toggleClass("sp-flat", flat);
  4916. container.toggleClass("sp-input-disabled", !opts.showInput);
  4917. container.toggleClass("sp-alpha-enabled", opts.showAlpha);
  4918. container.toggleClass("sp-clear-enabled", allowEmpty);
  4919. container.toggleClass("sp-buttons-disabled", !opts.showButtons);
  4920. container.toggleClass("sp-palette-buttons-disabled", !opts.togglePaletteOnly);
  4921. container.toggleClass("sp-palette-disabled", !opts.showPalette);
  4922. container.toggleClass("sp-palette-only", opts.showPaletteOnly);
  4923. container.toggleClass("sp-initial-disabled", !opts.showInitial);
  4924. container.addClass(opts.className).addClass(opts.containerClassName);
  4925. reflow()
  4926. }
  4927.  
  4928. function initialize() {
  4929. if (IE) {
  4930. container.find("*:not(input)").attr("unselectable", "on")
  4931. }
  4932. applyOptions();
  4933. if (shouldReplace) {
  4934. boundElement.after(replacer).hide()
  4935. }
  4936. if (!allowEmpty) {
  4937. clearButton.hide()
  4938. }
  4939. if (flat) {
  4940. boundElement.after(container).hide()
  4941. } else {
  4942. var appendTo = opts.appendTo === "parent" ? boundElement.parent() : $(opts.appendTo);
  4943. if (appendTo.length !== 1) {
  4944. appendTo = $("body")
  4945. }
  4946. appendTo.append(container)
  4947. }
  4948. updateSelectionPaletteFromStorage();
  4949. offsetElement.bind("click.spectrum touchstart.spectrum", function(e) {
  4950. if (!disabled) {
  4951. toggle()
  4952. }
  4953. e.stopPropagation();
  4954. if (!$(e.target).is("input")) {
  4955. e.preventDefault()
  4956. }
  4957. });
  4958. if (boundElement.is(":disabled") || (opts.disabled === !0)) {
  4959. disable()
  4960. }
  4961. container.click(stopPropagation);
  4962. textInput.change(setFromTextInput);
  4963. textInput.bind("paste", function() {
  4964. setTimeout(setFromTextInput, 1)
  4965. });
  4966. textInput.keydown(function(e) {
  4967. if (e.keyCode == 13) {
  4968. setFromTextInput()
  4969. }
  4970. });
  4971. cancelButton.text(opts.cancelText);
  4972. cancelButton.bind("click.spectrum", function(e) {
  4973. e.stopPropagation();
  4974. e.preventDefault();
  4975. revert();
  4976. hide()
  4977. });
  4978. clearButton.attr("title", opts.clearText);
  4979. clearButton.bind("click.spectrum", function(e) {
  4980. e.stopPropagation();
  4981. e.preventDefault();
  4982. isEmpty = !0;
  4983. move();
  4984. if (flat) {
  4985. updateOriginalInput(!0)
  4986. }
  4987. });
  4988. chooseButton.text(opts.chooseText);
  4989. chooseButton.bind("click.spectrum", function(e) {
  4990. e.stopPropagation();
  4991. e.preventDefault();
  4992. if (IE && textInput.is(":focus")) {
  4993. textInput.trigger('change')
  4994. }
  4995. if (isValid()) {
  4996. updateOriginalInput(!0);
  4997. hide()
  4998. }
  4999. });
  5000. toggleButton.text(opts.showPaletteOnly ? opts.togglePaletteMoreText : opts.togglePaletteLessText);
  5001. toggleButton.bind("click.spectrum", function(e) {
  5002. e.stopPropagation();
  5003. e.preventDefault();
  5004. opts.showPaletteOnly = !opts.showPaletteOnly;
  5005. if (!opts.showPaletteOnly && !flat) {
  5006. container.css('left', '-=' + (pickerContainer.outerWidth(!0) + 5))
  5007. }
  5008. applyOptions()
  5009. });
  5010. draggable(alphaSlider, function(dragX, dragY, e) {
  5011. currentAlpha = (dragX / alphaWidth);
  5012. isEmpty = !1;
  5013. if (e.shiftKey) {
  5014. currentAlpha = Math.round(currentAlpha * 10) / 10
  5015. }
  5016. move()
  5017. }, dragStart, dragStop);
  5018. draggable(slider, function(dragX, dragY) {
  5019. currentHue = parseFloat(dragY / slideHeight);
  5020. isEmpty = !1;
  5021. if (!opts.showAlpha) {
  5022. currentAlpha = 1
  5023. }
  5024. move()
  5025. }, dragStart, dragStop);
  5026. draggable(dragger, function(dragX, dragY, e) {
  5027. if (!e.shiftKey) {
  5028. shiftMovementDirection = null
  5029. } else if (!shiftMovementDirection) {
  5030. var oldDragX = currentSaturation * dragWidth;
  5031. var oldDragY = dragHeight - (currentValue * dragHeight);
  5032. var furtherFromX = Math.abs(dragX - oldDragX) > Math.abs(dragY - oldDragY);
  5033. shiftMovementDirection = furtherFromX ? "x" : "y"
  5034. }
  5035. var setSaturation = !shiftMovementDirection || shiftMovementDirection === "x";
  5036. var setValue = !shiftMovementDirection || shiftMovementDirection === "y";
  5037. if (setSaturation) {
  5038. currentSaturation = parseFloat(dragX / dragWidth)
  5039. }
  5040. if (setValue) {
  5041. currentValue = parseFloat((dragHeight - dragY) / dragHeight)
  5042. }
  5043. isEmpty = !1;
  5044. if (!opts.showAlpha) {
  5045. currentAlpha = 1
  5046. }
  5047. move()
  5048. }, dragStart, dragStop);
  5049. if (!!initialColor) {
  5050. set(initialColor);
  5051. updateUI();
  5052. currentPreferredFormat = preferredFormat || tinycolor(initialColor).format;
  5053. addColorToSelectionPalette(initialColor)
  5054. } else {
  5055. updateUI()
  5056. }
  5057. if (flat) {
  5058. show()
  5059. }
  5060.  
  5061. function paletteElementClick(e) {
  5062. if (e.data && e.data.ignore) {
  5063. set($(e.target).closest(".sp-thumb-el").data("color"));
  5064. move()
  5065. } else {
  5066. set($(e.target).closest(".sp-thumb-el").data("color"));
  5067. move();
  5068. updateOriginalInput(!0);
  5069. if (opts.hideAfterPaletteSelect) {
  5070. hide()
  5071. }
  5072. }
  5073. return !1
  5074. }
  5075. var paletteEvent = IE ? "mousedown.spectrum" : "click.spectrum touchstart.spectrum";
  5076. paletteContainer.delegate(".sp-thumb-el", paletteEvent, paletteElementClick);
  5077. initialColorContainer.delegate(".sp-thumb-el:nth-child(1)", paletteEvent, {
  5078. ignore: !0
  5079. }, paletteElementClick)
  5080. }
  5081.  
  5082. function updateSelectionPaletteFromStorage() {
  5083. if (localStorageKey && window.localStorage) {
  5084. try {
  5085. var oldPalette = window.localStorage[localStorageKey].split(",#");
  5086. if (oldPalette.length > 1) {
  5087. delete window.localStorage[localStorageKey];
  5088. $.each(oldPalette, function(i, c) {
  5089. addColorToSelectionPalette(c)
  5090. })
  5091. }
  5092. } catch (e) {}
  5093. try {
  5094. selectionPalette = window.localStorage[localStorageKey].split(";")
  5095. } catch (e) {}
  5096. }
  5097. }
  5098.  
  5099. function addColorToSelectionPalette(color) {
  5100. if (showSelectionPalette) {
  5101. var rgb = tinycolor(color).toRgbString();
  5102. if (!paletteLookup[rgb] && $.inArray(rgb, selectionPalette) === -1) {
  5103. selectionPalette.push(rgb);
  5104. while (selectionPalette.length > maxSelectionSize) {
  5105. selectionPalette.shift()
  5106. }
  5107. }
  5108. if (localStorageKey && window.localStorage) {
  5109. try {
  5110. window.localStorage[localStorageKey] = selectionPalette.join(";")
  5111. } catch (e) {}
  5112. }
  5113. }
  5114. }
  5115.  
  5116. function getUniqueSelectionPalette() {
  5117. var unique = [];
  5118. if (opts.showPalette) {
  5119. for (var i = 0; i < selectionPalette.length; i++) {
  5120. var rgb = tinycolor(selectionPalette[i]).toRgbString();
  5121. if (!paletteLookup[rgb]) {
  5122. unique.push(selectionPalette[i])
  5123. }
  5124. }
  5125. }
  5126. return unique.reverse().slice(0, opts.maxSelectionSize)
  5127. }
  5128.  
  5129. function drawPalette() {
  5130. var currentColor = get();
  5131. var html = $.map(paletteArray, function(palette, i) {
  5132. return paletteTemplate(palette, currentColor, "sp-palette-row sp-palette-row-" + i, opts)
  5133. });
  5134. updateSelectionPaletteFromStorage();
  5135. if (selectionPalette) {
  5136. html.push(paletteTemplate(getUniqueSelectionPalette(), currentColor, "sp-palette-row sp-palette-row-selection", opts))
  5137. }
  5138. paletteContainer.html(html.join(""))
  5139. }
  5140.  
  5141. function drawInitial() {
  5142. if (opts.showInitial) {
  5143. var initial = colorOnShow;
  5144. var current = get();
  5145. initialColorContainer.html(paletteTemplate([initial, current], current, "sp-palette-row-initial", opts))
  5146. }
  5147. }
  5148.  
  5149. function dragStart() {
  5150. if (dragHeight <= 0 || dragWidth <= 0 || slideHeight <= 0) {
  5151. reflow()
  5152. }
  5153. isDragging = !0;
  5154. container.addClass(draggingClass);
  5155. shiftMovementDirection = null;
  5156. boundElement.trigger('dragstart.spectrum', [get()])
  5157. }
  5158.  
  5159. function dragStop() {
  5160. isDragging = !1;
  5161. container.removeClass(draggingClass);
  5162. boundElement.trigger('dragstop.spectrum', [get()])
  5163. }
  5164.  
  5165. function setFromTextInput() {
  5166. var value = textInput.val();
  5167. if ((value === null || value === "") && allowEmpty) {
  5168. set(null);
  5169. updateOriginalInput(!0)
  5170. } else {
  5171. var tiny = tinycolor(value);
  5172. if (tiny.isValid()) {
  5173. set(tiny);
  5174. updateOriginalInput(!0)
  5175. } else {
  5176. textInput.addClass("sp-validation-error")
  5177. }
  5178. }
  5179. }
  5180.  
  5181. function toggle() {
  5182. if (visible) {
  5183. hide()
  5184. } else {
  5185. show()
  5186. }
  5187. }
  5188.  
  5189. function show() {
  5190. var event = $.Event('beforeShow.spectrum');
  5191. if (visible) {
  5192. reflow();
  5193. return
  5194. }
  5195. boundElement.trigger(event, [get()]);
  5196. if (callbacks.beforeShow(get()) === !1 || event.isDefaultPrevented()) {
  5197. return
  5198. }
  5199. hideAll();
  5200. visible = !0;
  5201. $(doc).bind("keydown.spectrum", onkeydown);
  5202. $(doc).bind("click.spectrum", clickout);
  5203. $(window).bind("resize.spectrum", resize);
  5204. replacer.addClass("sp-active");
  5205. container.removeClass("sp-hidden");
  5206. reflow();
  5207. updateUI();
  5208. colorOnShow = get();
  5209. drawInitial();
  5210. callbacks.show(colorOnShow);
  5211. boundElement.trigger('show.spectrum', [colorOnShow])
  5212. }
  5213.  
  5214. function onkeydown(e) {
  5215. if (e.keyCode === 27) {
  5216. hide()
  5217. }
  5218. }
  5219.  
  5220. function clickout(e) {
  5221. if (e.button == 2) {
  5222. return
  5223. }
  5224. if (isDragging) {
  5225. return
  5226. }
  5227. if (clickoutFiresChange) {
  5228. updateOriginalInput(!0)
  5229. } else {
  5230. revert()
  5231. }
  5232. hide()
  5233. }
  5234.  
  5235. function hide() {
  5236. if (!visible || flat) {
  5237. return
  5238. }
  5239. visible = !1;
  5240. $(doc).unbind("keydown.spectrum", onkeydown);
  5241. $(doc).unbind("click.spectrum", clickout);
  5242. $(window).unbind("resize.spectrum", resize);
  5243. replacer.removeClass("sp-active");
  5244. container.addClass("sp-hidden");
  5245. callbacks.hide(get());
  5246. boundElement.trigger('hide.spectrum', [get()])
  5247. }
  5248.  
  5249. function revert() {
  5250. set(colorOnShow, !0)
  5251. }
  5252.  
  5253. function set(color, ignoreFormatChange) {
  5254. if (tinycolor.equals(color, get())) {
  5255. updateUI();
  5256. return
  5257. }
  5258. var newColor, newHsv;
  5259. if (!color && allowEmpty) {
  5260. isEmpty = !0
  5261. } else {
  5262. isEmpty = !1;
  5263. newColor = tinycolor(color);
  5264. newHsv = newColor.toHsv();
  5265. currentHue = (newHsv.h % 360) / 360;
  5266. currentSaturation = newHsv.s;
  5267. currentValue = newHsv.v;
  5268. currentAlpha = newHsv.a
  5269. }
  5270. updateUI();
  5271. if (newColor && newColor.isValid() && !ignoreFormatChange) {
  5272. currentPreferredFormat = preferredFormat || newColor.getFormat()
  5273. }
  5274. }
  5275.  
  5276. function get(opts) {
  5277. opts = opts || {};
  5278. if (allowEmpty && isEmpty) {
  5279. return null
  5280. }
  5281. return tinycolor.fromRatio({
  5282. h: currentHue,
  5283. s: currentSaturation,
  5284. v: currentValue,
  5285. a: Math.round(currentAlpha * 100) / 100
  5286. }, {
  5287. format: opts.format || currentPreferredFormat
  5288. })
  5289. }
  5290.  
  5291. function isValid() {
  5292. return !textInput.hasClass("sp-validation-error")
  5293. }
  5294.  
  5295. function move() {
  5296. updateUI();
  5297. callbacks.move(get());
  5298. boundElement.trigger('move.spectrum', [get()])
  5299. }
  5300.  
  5301. function updateUI() {
  5302. textInput.removeClass("sp-validation-error");
  5303. updateHelperLocations();
  5304. var flatColor = tinycolor.fromRatio({
  5305. h: currentHue,
  5306. s: 1,
  5307. v: 1
  5308. });
  5309. dragger.css("background-color", flatColor.toHexString());
  5310. var format = currentPreferredFormat;
  5311. if (currentAlpha < 1 && !(currentAlpha === 0 && format === "name")) {
  5312. if (format === "hex" || format === "hex3" || format === "hex6" || format === "name") {
  5313. format = "rgb"
  5314. }
  5315. }
  5316. var realColor = get({
  5317. format: format
  5318. }),
  5319. displayColor = '';
  5320. previewElement.removeClass("sp-clear-display");
  5321. previewElement.css('background-color', 'transparent');
  5322. if (!realColor && allowEmpty) {
  5323. previewElement.addClass("sp-clear-display")
  5324. } else {
  5325. var realHex = realColor.toHexString(),
  5326. realRgb = realColor.toRgbString();
  5327. if (rgbaSupport || realColor.alpha === 1) {
  5328. previewElement.css("background-color", realRgb)
  5329. } else {
  5330. previewElement.css("background-color", "transparent");
  5331. previewElement.css("filter", realColor.toFilter())
  5332. }
  5333. if (opts.showAlpha) {
  5334. var rgb = realColor.toRgb();
  5335. rgb.a = 0;
  5336. var realAlpha = tinycolor(rgb).toRgbString();
  5337. var gradient = "linear-gradient(left, " + realAlpha + ", " + realHex + ")";
  5338. if (IE) {
  5339. alphaSliderInner.css("filter", tinycolor(realAlpha).toFilter({
  5340. gradientType: 1
  5341. }, realHex))
  5342. } else {
  5343. alphaSliderInner.css("background", "-webkit-" + gradient);
  5344. alphaSliderInner.css("background", "-moz-" + gradient);
  5345. alphaSliderInner.css("background", "-ms-" + gradient);
  5346. alphaSliderInner.css("background", "linear-gradient(to right, " + realAlpha + ", " + realHex + ")")
  5347. }
  5348. }
  5349. displayColor = realColor.toString(format)
  5350. }
  5351. if (opts.showInput) {
  5352. textInput.val(displayColor)
  5353. }
  5354. if (opts.showPalette) {
  5355. drawPalette()
  5356. }
  5357. drawInitial()
  5358. }
  5359.  
  5360. function updateHelperLocations() {
  5361. var s = currentSaturation;
  5362. var v = currentValue;
  5363. if (allowEmpty && isEmpty) {
  5364. alphaSlideHelper.hide();
  5365. slideHelper.hide();
  5366. dragHelper.hide()
  5367. } else {
  5368. alphaSlideHelper.show();
  5369. slideHelper.show();
  5370. dragHelper.show();
  5371. var dragX = s * dragWidth;
  5372. var dragY = dragHeight - (v * dragHeight);
  5373. dragX = Math.max(-dragHelperHeight, Math.min(dragWidth - dragHelperHeight, dragX - dragHelperHeight));
  5374. dragY = Math.max(-dragHelperHeight, Math.min(dragHeight - dragHelperHeight, dragY - dragHelperHeight));
  5375. dragHelper.css({
  5376. "top": dragY + "px",
  5377. "left": dragX + "px"
  5378. });
  5379. var alphaX = currentAlpha * alphaWidth;
  5380. alphaSlideHelper.css({
  5381. "left": (alphaX - (alphaSlideHelperWidth / 2)) + "px"
  5382. });
  5383. var slideY = (currentHue) * slideHeight;
  5384. slideHelper.css({
  5385. "top": (slideY - slideHelperHeight) + "px"
  5386. })
  5387. }
  5388. }
  5389.  
  5390. function updateOriginalInput(fireCallback) {
  5391. var color = get(),
  5392. displayColor = '',
  5393. hasChanged = !tinycolor.equals(color, colorOnShow);
  5394. if (color) {
  5395. displayColor = color.toString(currentPreferredFormat);
  5396. addColorToSelectionPalette(color)
  5397. }
  5398. if (isInput) {
  5399. boundElement.val(displayColor)
  5400. }
  5401. if (fireCallback && hasChanged) {
  5402. callbacks.change(color);
  5403. boundElement.trigger('change', [color])
  5404. }
  5405. }
  5406.  
  5407. function reflow() {
  5408. dragWidth = dragger.width();
  5409. dragHeight = dragger.height();
  5410. dragHelperHeight = dragHelper.height();
  5411. slideWidth = slider.width();
  5412. slideHeight = slider.height();
  5413. slideHelperHeight = slideHelper.height();
  5414. alphaWidth = alphaSlider.width();
  5415. alphaSlideHelperWidth = alphaSlideHelper.width();
  5416. if (!flat) {
  5417. container.css("position", "absolute");
  5418. if (opts.offset) {
  5419. container.offset(opts.offset)
  5420. } else {
  5421. container.offset(getOffset(container, offsetElement))
  5422. }
  5423. }
  5424. updateHelperLocations();
  5425. if (opts.showPalette) {
  5426. drawPalette()
  5427. }
  5428. boundElement.trigger('reflow.spectrum')
  5429. }
  5430.  
  5431. function destroy() {
  5432. boundElement.show();
  5433. offsetElement.unbind("click.spectrum touchstart.spectrum");
  5434. container.remove();
  5435. replacer.remove();
  5436. spectrums[spect.id] = null
  5437. }
  5438.  
  5439. function option(optionName, optionValue) {
  5440. if (optionName === undefined) {
  5441. return $.extend({}, opts)
  5442. }
  5443. if (optionValue === undefined) {
  5444. return opts[optionName]
  5445. }
  5446. opts[optionName] = optionValue;
  5447. applyOptions()
  5448. }
  5449.  
  5450. function enable() {
  5451. disabled = !1;
  5452. boundElement.attr("disabled", !1);
  5453. offsetElement.removeClass("sp-disabled")
  5454. }
  5455.  
  5456. function disable() {
  5457. hide();
  5458. disabled = !0;
  5459. boundElement.attr("disabled", !0);
  5460. offsetElement.addClass("sp-disabled")
  5461. }
  5462.  
  5463. function setOffset(coord) {
  5464. opts.offset = coord;
  5465. reflow()
  5466. }
  5467. initialize();
  5468. var spect = {
  5469. show: show,
  5470. hide: hide,
  5471. toggle: toggle,
  5472. reflow: reflow,
  5473. option: option,
  5474. enable: enable,
  5475. disable: disable,
  5476. offset: setOffset,
  5477. set: function(c) {
  5478. set(c);
  5479. updateOriginalInput()
  5480. },
  5481. get: get,
  5482. destroy: destroy,
  5483. container: container
  5484. };
  5485. spect.id = spectrums.push(spect) - 1;
  5486. return spect
  5487. }
  5488.  
  5489. function getOffset(picker, input) {
  5490. var extraY = 0;
  5491. var dpWidth = picker.outerWidth();
  5492. var dpHeight = picker.outerHeight();
  5493. var inputHeight = input.outerHeight();
  5494. var doc = picker[0].ownerDocument;
  5495. var docElem = doc.documentElement;
  5496. var viewWidth = docElem.clientWidth + $(doc).scrollLeft();
  5497. var viewHeight = docElem.clientHeight + $(doc).scrollTop();
  5498. var offset = input.offset();
  5499. offset.top += inputHeight;
  5500. offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? Math.abs(offset.left + dpWidth - viewWidth) : 0);
  5501. offset.top -= Math.min(offset.top, ((offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? Math.abs(dpHeight + inputHeight - extraY) : extraY));
  5502. return offset
  5503. }
  5504.  
  5505. function noop() {}
  5506.  
  5507. function stopPropagation(e) {
  5508. e.stopPropagation()
  5509. }
  5510.  
  5511. function bind(func, obj) {
  5512. var slice = Array.prototype.slice;
  5513. var args = slice.call(arguments, 2);
  5514. return function() {
  5515. return func.apply(obj, args.concat(slice.call(arguments)))
  5516. }
  5517. }
  5518.  
  5519. function draggable(element, onmove, onstart, onstop) {
  5520. onmove = onmove || function() {};
  5521. onstart = onstart || function() {};
  5522. onstop = onstop || function() {};
  5523. var doc = document;
  5524. var dragging = !1;
  5525. var offset = {};
  5526. var maxHeight = 0;
  5527. var maxWidth = 0;
  5528. var hasTouch = ('ontouchstart' in window);
  5529. var duringDragEvents = {};
  5530. duringDragEvents.selectstart = prevent;
  5531. duringDragEvents.dragstart = prevent;
  5532. duringDragEvents["touchmove mousemove"] = move;
  5533. duringDragEvents["touchend mouseup"] = stop;
  5534.  
  5535. function prevent(e) {
  5536. if (e.stopPropagation) {
  5537. e.stopPropagation()
  5538. }
  5539. if (e.preventDefault) {
  5540. e.preventDefault()
  5541. }
  5542. e.returnValue = !1
  5543. }
  5544.  
  5545. function move(e) {
  5546. if (dragging) {
  5547. if (IE && doc.documentMode < 9 && !e.button) {
  5548. return stop()
  5549. }
  5550. var t0 = e.originalEvent && e.originalEvent.touches && e.originalEvent.touches[0];
  5551. var pageX = t0 && t0.pageX || e.pageX;
  5552. var pageY = t0 && t0.pageY || e.pageY;
  5553. var dragX = Math.max(0, Math.min(pageX - offset.left, maxWidth));
  5554. var dragY = Math.max(0, Math.min(pageY - offset.top, maxHeight));
  5555. if (hasTouch) {
  5556. prevent(e)
  5557. }
  5558. onmove.apply(element, [dragX, dragY, e])
  5559. }
  5560. }
  5561.  
  5562. function start(e) {
  5563. var rightclick = (e.which) ? (e.which == 3) : (e.button == 2);
  5564. if (!rightclick && !dragging) {
  5565. if (onstart.apply(element, arguments) !== !1) {
  5566. dragging = !0;
  5567. maxHeight = $(element).height();
  5568. maxWidth = $(element).width();
  5569. offset = $(element).offset();
  5570. $(doc).bind(duringDragEvents);
  5571. $(doc.body).addClass("sp-dragging");
  5572. move(e);
  5573. prevent(e)
  5574. }
  5575. }
  5576. }
  5577.  
  5578. function stop() {
  5579. if (dragging) {
  5580. $(doc).unbind(duringDragEvents);
  5581. $(doc.body).removeClass("sp-dragging");
  5582. setTimeout(function() {
  5583. onstop.apply(element, arguments)
  5584. }, 0)
  5585. }
  5586. dragging = !1
  5587. }
  5588. $(element).bind("touchstart mousedown", start)
  5589. }
  5590.  
  5591. function throttle(func, wait, debounce) {
  5592. var timeout;
  5593. return function() {
  5594. var context = this,
  5595. args = arguments;
  5596. var throttler = function() {
  5597. timeout = null;
  5598. func.apply(context, args)
  5599. };
  5600. if (debounce) clearTimeout(timeout);
  5601. if (debounce || !timeout) timeout = setTimeout(throttler, wait)
  5602. }
  5603. }
  5604.  
  5605. function inputTypeColorSupport() {
  5606. return $.fn.spectrum.inputTypeColorSupport()
  5607. }
  5608. var dataID = "spectrum.id";
  5609. $.fn.spectrum = function(opts, extra) {
  5610. if (typeof opts == "string") {
  5611. var returnValue = this;
  5612. var args = Array.prototype.slice.call(arguments, 1);
  5613. this.each(function() {
  5614. var spect = spectrums[$(this).data(dataID)];
  5615. if (spect) {
  5616. var method = spect[opts];
  5617. if (!method) {
  5618. throw new Error("Spectrum: no such method: '" + opts + "'")
  5619. }
  5620. if (opts == "get") {
  5621. returnValue = spect.get()
  5622. } else if (opts == "container") {
  5623. returnValue = spect.container
  5624. } else if (opts == "option") {
  5625. returnValue = spect.option.apply(spect, args)
  5626. } else if (opts == "destroy") {
  5627. spect.destroy();
  5628. $(this).removeData(dataID)
  5629. } else {
  5630. method.apply(spect, args)
  5631. }
  5632. }
  5633. });
  5634. return returnValue
  5635. }
  5636. return this.spectrum("destroy").each(function() {
  5637. var options = $.extend({}, opts, $(this).data());
  5638. var spect = spectrum(this, options);
  5639. $(this).data(dataID, spect.id)
  5640. })
  5641. };
  5642. $.fn.spectrum.load = !0;
  5643. $.fn.spectrum.loadOpts = {};
  5644. $.fn.spectrum.draggable = draggable;
  5645. $.fn.spectrum.defaults = defaultOpts;
  5646. $.fn.spectrum.inputTypeColorSupport = function inputTypeColorSupport() {
  5647. if (typeof inputTypeColorSupport._cachedResult === "undefined") {
  5648. var colorInput = $("<input type='color'/>")[0];
  5649. inputTypeColorSupport._cachedResult = colorInput.type === "color" && colorInput.value !== ""
  5650. }
  5651. return inputTypeColorSupport._cachedResult
  5652. };
  5653. $.spectrum = {};
  5654. $.spectrum.localization = {};
  5655. $.spectrum.palettes = {};
  5656. $.fn.spectrum.processNativeColorInputs = function() {
  5657. var colorInputs = $("input[type=color]");
  5658. if (colorInputs.length && !inputTypeColorSupport()) {
  5659. colorInputs.spectrum({
  5660. preferredFormat: "hex6"
  5661. })
  5662. }
  5663. };
  5664. (function() {
  5665. var trimLeft = /^[\s,#]+/,
  5666. trimRight = /\s+$/,
  5667. tinyCounter = 0,
  5668. math = Math,
  5669. mathRound = math.round,
  5670. mathMin = math.min,
  5671. mathMax = math.max,
  5672. mathRandom = math.random;
  5673. var tinycolor = function(color, opts) {
  5674. color = (color) ? color : '';
  5675. opts = opts || {};
  5676. if (color instanceof tinycolor) {
  5677. return color
  5678. }
  5679. if (!(this instanceof tinycolor)) {
  5680. return new tinycolor(color, opts)
  5681. }
  5682. var rgb = inputToRGB(color);
  5683. this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = mathRound(100 * this._a) / 100, this._format = opts.format || rgb.format;
  5684. this._gradientType = opts.gradientType;
  5685. if (this._r < 1) {
  5686. this._r = mathRound(this._r)
  5687. }
  5688. if (this._g < 1) {
  5689. this._g = mathRound(this._g)
  5690. }
  5691. if (this._b < 1) {
  5692. this._b = mathRound(this._b)
  5693. }
  5694. this._ok = rgb.ok;
  5695. this._tc_id = tinyCounter++
  5696. };
  5697. tinycolor.prototype = {
  5698. isDark: function() {
  5699. return this.getBrightness() < 128
  5700. },
  5701. isLight: function() {
  5702. return !this.isDark()
  5703. },
  5704. isValid: function() {
  5705. return this._ok
  5706. },
  5707. getOriginalInput: function() {
  5708. return this._originalInput
  5709. },
  5710. getFormat: function() {
  5711. return this._format
  5712. },
  5713. getAlpha: function() {
  5714. return this._a
  5715. },
  5716. getBrightness: function() {
  5717. var rgb = this.toRgb();
  5718. return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000
  5719. },
  5720. setAlpha: function(value) {
  5721. this._a = boundAlpha(value);
  5722. this._roundA = mathRound(100 * this._a) / 100;
  5723. return this
  5724. },
  5725. toHsv: function() {
  5726. var hsv = rgbToHsv(this._r, this._g, this._b);
  5727. return {
  5728. h: hsv.h * 360,
  5729. s: hsv.s,
  5730. v: hsv.v,
  5731. a: this._a
  5732. }
  5733. },
  5734. toHsvString: function() {
  5735. var hsv = rgbToHsv(this._r, this._g, this._b);
  5736. var h = mathRound(hsv.h * 360),
  5737. s = mathRound(hsv.s * 100),
  5738. v = mathRound(hsv.v * 100);
  5739. return (this._a == 1) ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")"
  5740. },
  5741. toHsl: function() {
  5742. var hsl = rgbToHsl(this._r, this._g, this._b);
  5743. return {
  5744. h: hsl.h * 360,
  5745. s: hsl.s,
  5746. l: hsl.l,
  5747. a: this._a
  5748. }
  5749. },
  5750. toHslString: function() {
  5751. var hsl = rgbToHsl(this._r, this._g, this._b);
  5752. var h = mathRound(hsl.h * 360),
  5753. s = mathRound(hsl.s * 100),
  5754. l = mathRound(hsl.l * 100);
  5755. return (this._a == 1) ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")"
  5756. },
  5757. toHex: function(allow3Char) {
  5758. return rgbToHex(this._r, this._g, this._b, allow3Char)
  5759. },
  5760. toHexString: function(allow3Char) {
  5761. return '#' + this.toHex(allow3Char)
  5762. },
  5763. toHex8: function() {
  5764. return rgbaToHex(this._r, this._g, this._b, this._a)
  5765. },
  5766. toHex8String: function() {
  5767. return '#' + this.toHex8()
  5768. },
  5769. toRgb: function() {
  5770. return {
  5771. r: mathRound(this._r),
  5772. g: mathRound(this._g),
  5773. b: mathRound(this._b),
  5774. a: this._a
  5775. }
  5776. },
  5777. toRgbString: function() {
  5778. return (this._a == 1) ? "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" : "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")"
  5779. },
  5780. toPercentageRgb: function() {
  5781. return {
  5782. r: mathRound(bound01(this._r, 255) * 100) + "%",
  5783. g: mathRound(bound01(this._g, 255) * 100) + "%",
  5784. b: mathRound(bound01(this._b, 255) * 100) + "%",
  5785. a: this._a
  5786. }
  5787. },
  5788. toPercentageRgbString: function() {
  5789. return (this._a == 1) ? "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" : "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")"
  5790. },
  5791. toName: function() {
  5792. if (this._a === 0) {
  5793. return "transparent"
  5794. }
  5795. if (this._a < 1) {
  5796. return !1
  5797. }
  5798. return hexNames[rgbToHex(this._r, this._g, this._b, !0)] || !1
  5799. },
  5800. toFilter: function(secondColor) {
  5801. var hex8String = '#' + rgbaToHex(this._r, this._g, this._b, this._a);
  5802. var secondHex8String = hex8String;
  5803. var gradientType = this._gradientType ? "GradientType = 1, " : "";
  5804. if (secondColor) {
  5805. var s = tinycolor(secondColor);
  5806. secondHex8String = s.toHex8String()
  5807. }
  5808. return "progid:DXImageTransform.Microsoft.gradient(" + gradientType + "startColorstr=" + hex8String + ",endColorstr=" + secondHex8String + ")"
  5809. },
  5810. toString: function(format) {
  5811. var formatSet = !!format;
  5812. format = format || this._format;
  5813. var formattedString = !1;
  5814. var hasAlpha = this._a < 1 && this._a >= 0;
  5815. var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "name");
  5816. if (needsAlphaFormat) {
  5817. if (format === "name" && this._a === 0) {
  5818. return this.toName()
  5819. }
  5820. return this.toRgbString()
  5821. }
  5822. if (format === "rgb") {
  5823. formattedString = this.toRgbString()
  5824. }
  5825. if (format === "prgb") {
  5826. formattedString = this.toPercentageRgbString()
  5827. }
  5828. if (format === "hex" || format === "hex6") {
  5829. formattedString = this.toHexString()
  5830. }
  5831. if (format === "hex3") {
  5832. formattedString = this.toHexString(!0)
  5833. }
  5834. if (format === "hex8") {
  5835. formattedString = this.toHex8String()
  5836. }
  5837. if (format === "name") {
  5838. formattedString = this.toName()
  5839. }
  5840. if (format === "hsl") {
  5841. formattedString = this.toHslString()
  5842. }
  5843. if (format === "hsv") {
  5844. formattedString = this.toHsvString()
  5845. }
  5846. return formattedString || this.toHexString()
  5847. },
  5848. _applyModification: function(fn, args) {
  5849. var color = fn.apply(null, [this].concat([].slice.call(args)));
  5850. this._r = color._r;
  5851. this._g = color._g;
  5852. this._b = color._b;
  5853. this.setAlpha(color._a);
  5854. return this
  5855. },
  5856. lighten: function() {
  5857. return this._applyModification(lighten, arguments)
  5858. },
  5859. brighten: function() {
  5860. return this._applyModification(brighten, arguments)
  5861. },
  5862. darken: function() {
  5863. return this._applyModification(darken, arguments)
  5864. },
  5865. desaturate: function() {
  5866. return this._applyModification(desaturate, arguments)
  5867. },
  5868. saturate: function() {
  5869. return this._applyModification(saturate, arguments)
  5870. },
  5871. greyscale: function() {
  5872. return this._applyModification(greyscale, arguments)
  5873. },
  5874. spin: function() {
  5875. return this._applyModification(spin, arguments)
  5876. },
  5877. _applyCombination: function(fn, args) {
  5878. return fn.apply(null, [this].concat([].slice.call(args)))
  5879. },
  5880. analogous: function() {
  5881. return this._applyCombination(analogous, arguments)
  5882. },
  5883. complement: function() {
  5884. return this._applyCombination(complement, arguments)
  5885. },
  5886. monochromatic: function() {
  5887. return this._applyCombination(monochromatic, arguments)
  5888. },
  5889. splitcomplement: function() {
  5890. return this._applyCombination(splitcomplement, arguments)
  5891. },
  5892. triad: function() {
  5893. return this._applyCombination(triad, arguments)
  5894. },
  5895. tetrad: function() {
  5896. return this._applyCombination(tetrad, arguments)
  5897. }
  5898. };
  5899. tinycolor.fromRatio = function(color, opts) {
  5900. if (typeof color == "object") {
  5901. var newColor = {};
  5902. for (var i in color) {
  5903. if (color.hasOwnProperty(i)) {
  5904. if (i === "a") {
  5905. newColor[i] = color[i]
  5906. } else {
  5907. newColor[i] = convertToPercentage(color[i])
  5908. }
  5909. }
  5910. }
  5911. color = newColor
  5912. }
  5913. return tinycolor(color, opts)
  5914. };
  5915.  
  5916. function inputToRGB(color) {
  5917. var rgb = {
  5918. r: 0,
  5919. g: 0,
  5920. b: 0
  5921. };
  5922. var a = 1;
  5923. var ok = !1;
  5924. var format = !1;
  5925. if (typeof color == "string") {
  5926. color = stringInputToObject(color)
  5927. }
  5928. if (typeof color == "object") {
  5929. if (color.hasOwnProperty("r") && color.hasOwnProperty("g") && color.hasOwnProperty("b")) {
  5930. rgb = rgbToRgb(color.r, color.g, color.b);
  5931. ok = !0;
  5932. format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb"
  5933. } else if (color.hasOwnProperty("h") && color.hasOwnProperty("s") && color.hasOwnProperty("v")) {
  5934. color.s = convertToPercentage(color.s);
  5935. color.v = convertToPercentage(color.v);
  5936. rgb = hsvToRgb(color.h, color.s, color.v);
  5937. ok = !0;
  5938. format = "hsv"
  5939. } else if (color.hasOwnProperty("h") && color.hasOwnProperty("s") && color.hasOwnProperty("l")) {
  5940. color.s = convertToPercentage(color.s);
  5941. color.l = convertToPercentage(color.l);
  5942. rgb = hslToRgb(color.h, color.s, color.l);
  5943. ok = !0;
  5944. format = "hsl"
  5945. }
  5946. if (color.hasOwnProperty("a")) {
  5947. a = color.a
  5948. }
  5949. }
  5950. a = boundAlpha(a);
  5951. return {
  5952. ok: ok,
  5953. format: color.format || format,
  5954. r: mathMin(255, mathMax(rgb.r, 0)),
  5955. g: mathMin(255, mathMax(rgb.g, 0)),
  5956. b: mathMin(255, mathMax(rgb.b, 0)),
  5957. a: a
  5958. }
  5959. }
  5960.  
  5961. function rgbToRgb(r, g, b) {
  5962. return {
  5963. r: bound01(r, 255) * 255,
  5964. g: bound01(g, 255) * 255,
  5965. b: bound01(b, 255) * 255
  5966. }
  5967. }
  5968.  
  5969. function rgbToHsl(r, g, b) {
  5970. r = bound01(r, 255);
  5971. g = bound01(g, 255);
  5972. b = bound01(b, 255);
  5973. var max = mathMax(r, g, b),
  5974. min = mathMin(r, g, b);
  5975. var h, s, l = (max + min) / 2;
  5976. if (max == min) {
  5977. h = s = 0
  5978. } else {
  5979. var d = max - min;
  5980. s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
  5981. switch (max) {
  5982. case r:
  5983. h = (g - b) / d + (g < b ? 6 : 0);
  5984. break;
  5985. case g:
  5986. h = (b - r) / d + 2;
  5987. break;
  5988. case b:
  5989. h = (r - g) / d + 4;
  5990. break
  5991. }
  5992. h /= 6
  5993. }
  5994. return {
  5995. h: h,
  5996. s: s,
  5997. l: l
  5998. }
  5999. }
  6000.  
  6001. function hslToRgb(h, s, l) {
  6002. var r, g, b;
  6003. h = bound01(h, 360);
  6004. s = bound01(s, 100);
  6005. l = bound01(l, 100);
  6006.  
  6007. function hue2rgb(p, q, t) {
  6008. if (t < 0) t += 1;
  6009. if (t > 1) t -= 1;
  6010. if (t < 1 / 6) return p + (q - p) * 6 * t;
  6011. if (t < 1 / 2) return q;
  6012. if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
  6013. return p
  6014. }
  6015. if (s === 0) {
  6016. r = g = b = l
  6017. } else {
  6018. var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
  6019. var p = 2 * l - q;
  6020. r = hue2rgb(p, q, h + 1 / 3);
  6021. g = hue2rgb(p, q, h);
  6022. b = hue2rgb(p, q, h - 1 / 3)
  6023. }
  6024. return {
  6025. r: r * 255,
  6026. g: g * 255,
  6027. b: b * 255
  6028. }
  6029. }
  6030.  
  6031. function rgbToHsv(r, g, b) {
  6032. r = bound01(r, 255);
  6033. g = bound01(g, 255);
  6034. b = bound01(b, 255);
  6035. var max = mathMax(r, g, b),
  6036. min = mathMin(r, g, b);
  6037. var h, s, v = max;
  6038. var d = max - min;
  6039. s = max === 0 ? 0 : d / max;
  6040. if (max == min) {
  6041. h = 0
  6042. } else {
  6043. switch (max) {
  6044. case r:
  6045. h = (g - b) / d + (g < b ? 6 : 0);
  6046. break;
  6047. case g:
  6048. h = (b - r) / d + 2;
  6049. break;
  6050. case b:
  6051. h = (r - g) / d + 4;
  6052. break
  6053. }
  6054. h /= 6
  6055. }
  6056. return {
  6057. h: h,
  6058. s: s,
  6059. v: v
  6060. }
  6061. }
  6062.  
  6063. function hsvToRgb(h, s, v) {
  6064. h = bound01(h, 360) * 6;
  6065. s = bound01(s, 100);
  6066. v = bound01(v, 100);
  6067. var i = math.floor(h),
  6068. f = h - i,
  6069. p = v * (1 - s),
  6070. q = v * (1 - f * s),
  6071. t = v * (1 - (1 - f) * s),
  6072. mod = i % 6,
  6073. r = [v, q, p, p, t, v][mod],
  6074. g = [t, v, v, q, p, p][mod],
  6075. b = [p, p, t, v, v, q][mod];
  6076. return {
  6077. r: r * 255,
  6078. g: g * 255,
  6079. b: b * 255
  6080. }
  6081. }
  6082.  
  6083. function rgbToHex(r, g, b, allow3Char) {
  6084. var hex = [pad2(mathRound(r).toString(16)), pad2(mathRound(g).toString(16)), pad2(mathRound(b).toString(16))];
  6085. if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
  6086. return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0)
  6087. }
  6088. return hex.join("")
  6089. }
  6090.  
  6091. function rgbaToHex(r, g, b, a) {
  6092. var hex = [pad2(convertDecimalToHex(a)), pad2(mathRound(r).toString(16)), pad2(mathRound(g).toString(16)), pad2(mathRound(b).toString(16))];
  6093. return hex.join("")
  6094. }
  6095. tinycolor.equals = function(color1, color2) {
  6096. if (!color1 || !color2) {
  6097. return !1
  6098. }
  6099. return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString()
  6100. };
  6101. tinycolor.random = function() {
  6102. return tinycolor.fromRatio({
  6103. r: mathRandom(),
  6104. g: mathRandom(),
  6105. b: mathRandom()
  6106. })
  6107. };
  6108.  
  6109. function desaturate(color, amount) {
  6110. amount = (amount === 0) ? 0 : (amount || 10);
  6111. var hsl = tinycolor(color).toHsl();
  6112. hsl.s -= amount / 100;
  6113. hsl.s = clamp01(hsl.s);
  6114. return tinycolor(hsl)
  6115. }
  6116.  
  6117. function saturate(color, amount) {
  6118. amount = (amount === 0) ? 0 : (amount || 10);
  6119. var hsl = tinycolor(color).toHsl();
  6120. hsl.s += amount / 100;
  6121. hsl.s = clamp01(hsl.s);
  6122. return tinycolor(hsl)
  6123. }
  6124.  
  6125. function greyscale(color) {
  6126. return tinycolor(color).desaturate(100)
  6127. }
  6128.  
  6129. function lighten(color, amount) {
  6130. amount = (amount === 0) ? 0 : (amount || 10);
  6131. var hsl = tinycolor(color).toHsl();
  6132. hsl.l += amount / 100;
  6133. hsl.l = clamp01(hsl.l);
  6134. return tinycolor(hsl)
  6135. }
  6136.  
  6137. function brighten(color, amount) {
  6138. amount = (amount === 0) ? 0 : (amount || 10);
  6139. var rgb = tinycolor(color).toRgb();
  6140. rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * -(amount / 100))));
  6141. rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * -(amount / 100))));
  6142. rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * -(amount / 100))));
  6143. return tinycolor(rgb)
  6144. }
  6145.  
  6146. function darken(color, amount) {
  6147. amount = (amount === 0) ? 0 : (amount || 10);
  6148. var hsl = tinycolor(color).toHsl();
  6149. hsl.l -= amount / 100;
  6150. hsl.l = clamp01(hsl.l);
  6151. return tinycolor(hsl)
  6152. }
  6153.  
  6154. function spin(color, amount) {
  6155. var hsl = tinycolor(color).toHsl();
  6156. var hue = (mathRound(hsl.h) + amount) % 360;
  6157. hsl.h = hue < 0 ? 360 + hue : hue;
  6158. return tinycolor(hsl)
  6159. }
  6160.  
  6161. function complement(color) {
  6162. var hsl = tinycolor(color).toHsl();
  6163. hsl.h = (hsl.h + 180) % 360;
  6164. return tinycolor(hsl)
  6165. }
  6166.  
  6167. function triad(color) {
  6168. var hsl = tinycolor(color).toHsl();
  6169. var h = hsl.h;
  6170. return [tinycolor(color), tinycolor({
  6171. h: (h + 120) % 360,
  6172. s: hsl.s,
  6173. l: hsl.l
  6174. }), tinycolor({
  6175. h: (h + 240) % 360,
  6176. s: hsl.s,
  6177. l: hsl.l
  6178. })]
  6179. }
  6180.  
  6181. function tetrad(color) {
  6182. var hsl = tinycolor(color).toHsl();
  6183. var h = hsl.h;
  6184. return [tinycolor(color), tinycolor({
  6185. h: (h + 90) % 360,
  6186. s: hsl.s,
  6187. l: hsl.l
  6188. }), tinycolor({
  6189. h: (h + 180) % 360,
  6190. s: hsl.s,
  6191. l: hsl.l
  6192. }), tinycolor({
  6193. h: (h + 270) % 360,
  6194. s: hsl.s,
  6195. l: hsl.l
  6196. })]
  6197. }
  6198.  
  6199. function splitcomplement(color) {
  6200. var hsl = tinycolor(color).toHsl();
  6201. var h = hsl.h;
  6202. return [tinycolor(color), tinycolor({
  6203. h: (h + 72) % 360,
  6204. s: hsl.s,
  6205. l: hsl.l
  6206. }), tinycolor({
  6207. h: (h + 216) % 360,
  6208. s: hsl.s,
  6209. l: hsl.l
  6210. })]
  6211. }
  6212.  
  6213. function analogous(color, results, slices) {
  6214. results = results || 6;
  6215. slices = slices || 30;
  6216. var hsl = tinycolor(color).toHsl();
  6217. var part = 360 / slices;
  6218. var ret = [tinycolor(color)];
  6219. for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results;) {
  6220. hsl.h = (hsl.h + part) % 360;
  6221. ret.push(tinycolor(hsl))
  6222. }
  6223. return ret
  6224. }
  6225.  
  6226. function monochromatic(color, results) {
  6227. results = results || 6;
  6228. var hsv = tinycolor(color).toHsv();
  6229. var h = hsv.h,
  6230. s = hsv.s,
  6231. v = hsv.v;
  6232. var ret = [];
  6233. var modification = 1 / results;
  6234. while (results--) {
  6235. ret.push(tinycolor({
  6236. h: h,
  6237. s: s,
  6238. v: v
  6239. }));
  6240. v = (v + modification) % 1
  6241. }
  6242. return ret
  6243. }
  6244. tinycolor.mix = function(color1, color2, amount) {
  6245. amount = (amount === 0) ? 0 : (amount || 50);
  6246. var rgb1 = tinycolor(color1).toRgb();
  6247. var rgb2 = tinycolor(color2).toRgb();
  6248. var p = amount / 100;
  6249. var w = p * 2 - 1;
  6250. var a = rgb2.a - rgb1.a;
  6251. var w1;
  6252. if (w * a == -1) {
  6253. w1 = w
  6254. } else {
  6255. w1 = (w + a) / (1 + w * a)
  6256. }
  6257. w1 = (w1 + 1) / 2;
  6258. var w2 = 1 - w1;
  6259. var rgba = {
  6260. r: rgb2.r * w1 + rgb1.r * w2,
  6261. g: rgb2.g * w1 + rgb1.g * w2,
  6262. b: rgb2.b * w1 + rgb1.b * w2,
  6263. a: rgb2.a * p + rgb1.a * (1 - p)
  6264. };
  6265. return tinycolor(rgba)
  6266. };
  6267. tinycolor.readability = function(color1, color2) {
  6268. var c1 = tinycolor(color1);
  6269. var c2 = tinycolor(color2);
  6270. var rgb1 = c1.toRgb();
  6271. var rgb2 = c2.toRgb();
  6272. var brightnessA = c1.getBrightness();
  6273. var brightnessB = c2.getBrightness();
  6274. var colorDiff = (Math.max(rgb1.r, rgb2.r) - Math.min(rgb1.r, rgb2.r) + Math.max(rgb1.g, rgb2.g) - Math.min(rgb1.g, rgb2.g) + Math.max(rgb1.b, rgb2.b) - Math.min(rgb1.b, rgb2.b));
  6275. return {
  6276. brightness: Math.abs(brightnessA - brightnessB),
  6277. color: colorDiff
  6278. }
  6279. };
  6280. tinycolor.isReadable = function(color1, color2) {
  6281. var readability = tinycolor.readability(color1, color2);
  6282. return readability.brightness > 125 && readability.color > 500
  6283. };
  6284. tinycolor.mostReadable = function(baseColor, colorList) {
  6285. var bestColor = null;
  6286. var bestScore = 0;
  6287. var bestIsReadable = !1;
  6288. for (var i = 0; i < colorList.length; i++) {
  6289. var readability = tinycolor.readability(baseColor, colorList[i]);
  6290. var readable = readability.brightness > 125 && readability.color > 500;
  6291. var score = 3 * (readability.brightness / 125) + (readability.color / 500);
  6292. if ((readable && !bestIsReadable) || (readable && bestIsReadable && score > bestScore) || ((!readable) && (!bestIsReadable) && score > bestScore)) {
  6293. bestIsReadable = readable;
  6294. bestScore = score;
  6295. bestColor = tinycolor(colorList[i])
  6296. }
  6297. }
  6298. return bestColor
  6299. };
  6300. var names = tinycolor.names = {
  6301. aliceblue: "f0f8ff",
  6302. antiquewhite: "faebd7",
  6303. aqua: "0ff",
  6304. aquamarine: "7fffd4",
  6305. azure: "f0ffff",
  6306. beige: "f5f5dc",
  6307. bisque: "ffe4c4",
  6308. black: "000",
  6309. blanchedalmond: "ffebcd",
  6310. blue: "00f",
  6311. blueviolet: "8a2be2",
  6312. brown: "a52a2a",
  6313. burlywood: "deb887",
  6314. burntsienna: "ea7e5d",
  6315. cadetblue: "5f9ea0",
  6316. chartreuse: "7fff00",
  6317. chocolate: "d2691e",
  6318. coral: "ff7f50",
  6319. cornflowerblue: "6495ed",
  6320. cornsilk: "fff8dc",
  6321. crimson: "dc143c",
  6322. cyan: "0ff",
  6323. darkblue: "00008b",
  6324. darkcyan: "008b8b",
  6325. darkgoldenrod: "b8860b",
  6326. darkgray: "a9a9a9",
  6327. darkgreen: "006400",
  6328. darkgrey: "a9a9a9",
  6329. darkkhaki: "bdb76b",
  6330. darkmagenta: "8b008b",
  6331. darkolivegreen: "556b2f",
  6332. darkorange: "ff8c00",
  6333. darkorchid: "9932cc",
  6334. darkred: "8b0000",
  6335. darksalmon: "e9967a",
  6336. darkseagreen: "8fbc8f",
  6337. darkslateblue: "483d8b",
  6338. darkslategray: "2f4f4f",
  6339. darkslategrey: "2f4f4f",
  6340. darkturquoise: "00ced1",
  6341. darkviolet: "9400d3",
  6342. deeppink: "ff1493",
  6343. deepskyblue: "00bfff",
  6344. dimgray: "696969",
  6345. dimgrey: "696969",
  6346. dodgerblue: "1e90ff",
  6347. firebrick: "b22222",
  6348. floralwhite: "fffaf0",
  6349. forestgreen: "228b22",
  6350. fuchsia: "f0f",
  6351. gainsboro: "dcdcdc",
  6352. ghostwhite: "f8f8ff",
  6353. gold: "ffd700",
  6354. goldenrod: "daa520",
  6355. gray: "808080",
  6356. green: "008000",
  6357. greenyellow: "adff2f",
  6358. grey: "808080",
  6359. honeydew: "f0fff0",
  6360. hotpink: "ff69b4",
  6361. indianred: "cd5c5c",
  6362. indigo: "4b0082",
  6363. ivory: "fffff0",
  6364. khaki: "f0e68c",
  6365. lavender: "e6e6fa",
  6366. lavenderblush: "fff0f5",
  6367. lawngreen: "7cfc00",
  6368. lemonchiffon: "fffacd",
  6369. lightblue: "add8e6",
  6370. lightcoral: "f08080",
  6371. lightcyan: "e0ffff",
  6372. lightgoldenrodyellow: "fafad2",
  6373. lightgray: "d3d3d3",
  6374. lightgreen: "90ee90",
  6375. lightgrey: "d3d3d3",
  6376. lightpink: "ffb6c1",
  6377. lightsalmon: "ffa07a",
  6378. lightseagreen: "20b2aa",
  6379. lightskyblue: "87cefa",
  6380. lightslategray: "789",
  6381. lightslategrey: "789",
  6382. lightsteelblue: "b0c4de",
  6383. lightyellow: "ffffe0",
  6384. lime: "0f0",
  6385. limegreen: "32cd32",
  6386. linen: "faf0e6",
  6387. magenta: "f0f",
  6388. maroon: "800000",
  6389. mediumaquamarine: "66cdaa",
  6390. mediumblue: "0000cd",
  6391. mediumorchid: "ba55d3",
  6392. mediumpurple: "9370db",
  6393. mediumseagreen: "3cb371",
  6394. mediumslateblue: "7b68ee",
  6395. mediumspringgreen: "00fa9a",
  6396. mediumturquoise: "48d1cc",
  6397. mediumvioletred: "c71585",
  6398. midnightblue: "191970",
  6399. mintcream: "f5fffa",
  6400. mistyrose: "ffe4e1",
  6401. moccasin: "ffe4b5",
  6402. navajowhite: "ffdead",
  6403. navy: "000080",
  6404. oldlace: "fdf5e6",
  6405. olive: "808000",
  6406. olivedrab: "6b8e23",
  6407. orange: "ffa500",
  6408. orangered: "ff4500",
  6409. orchid: "da70d6",
  6410. palegoldenrod: "eee8aa",
  6411. palegreen: "98fb98",
  6412. paleturquoise: "afeeee",
  6413. palevioletred: "db7093",
  6414. papayawhip: "ffefd5",
  6415. peachpuff: "ffdab9",
  6416. peru: "cd853f",
  6417. pink: "ffc0cb",
  6418. plum: "dda0dd",
  6419. powderblue: "b0e0e6",
  6420. purple: "800080",
  6421. rebeccapurple: "663399",
  6422. red: "f00",
  6423. rosybrown: "bc8f8f",
  6424. royalblue: "4169e1",
  6425. saddlebrown: "8b4513",
  6426. salmon: "fa8072",
  6427. sandybrown: "f4a460",
  6428. seagreen: "2e8b57",
  6429. seashell: "fff5ee",
  6430. sienna: "a0522d",
  6431. silver: "c0c0c0",
  6432. skyblue: "87ceeb",
  6433. slateblue: "6a5acd",
  6434. slategray: "708090",
  6435. slategrey: "708090",
  6436. snow: "fffafa",
  6437. springgreen: "00ff7f",
  6438. steelblue: "4682b4",
  6439. tan: "d2b48c",
  6440. teal: "008080",
  6441. thistle: "d8bfd8",
  6442. tomato: "ff6347",
  6443. turquoise: "40e0d0",
  6444. violet: "ee82ee",
  6445. wheat: "f5deb3",
  6446. white: "fff",
  6447. whitesmoke: "f5f5f5",
  6448. yellow: "ff0",
  6449. yellowgreen: "9acd32"
  6450. };
  6451. var hexNames = tinycolor.hexNames = flip(names);
  6452.  
  6453. function flip(o) {
  6454. var flipped = {};
  6455. for (var i in o) {
  6456. if (o.hasOwnProperty(i)) {
  6457. flipped[o[i]] = i
  6458. }
  6459. }
  6460. return flipped
  6461. }
  6462.  
  6463. function boundAlpha(a) {
  6464. a = parseFloat(a);
  6465. if (isNaN(a) || a < 0 || a > 1) {
  6466. a = 1
  6467. }
  6468. return a
  6469. }
  6470.  
  6471. function bound01(n, max) {
  6472. if (isOnePointZero(n)) {
  6473. n = "100%"
  6474. }
  6475. var processPercent = isPercentage(n);
  6476. n = mathMin(max, mathMax(0, parseFloat(n)));
  6477. if (processPercent) {
  6478. n = parseInt(n * max, 10) / 100
  6479. }
  6480. if ((math.abs(n - max) < 0.000001)) {
  6481. return 1
  6482. }
  6483. return (n % max) / parseFloat(max)
  6484. }
  6485.  
  6486. function clamp01(val) {
  6487. return mathMin(1, mathMax(0, val))
  6488. }
  6489.  
  6490. function parseIntFromHex(val) {
  6491. return parseInt(val, 16)
  6492. }
  6493.  
  6494. function isOnePointZero(n) {
  6495. return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1
  6496. }
  6497.  
  6498. function isPercentage(n) {
  6499. return typeof n === "string" && n.indexOf('%') != -1
  6500. }
  6501.  
  6502. function pad2(c) {
  6503. return c.length == 1 ? '0' + c : '' + c
  6504. }
  6505.  
  6506. function convertToPercentage(n) {
  6507. if (n <= 1) {
  6508. n = (n * 100) + "%"
  6509. }
  6510. return n
  6511. }
  6512.  
  6513. function convertDecimalToHex(d) {
  6514. return Math.round(parseFloat(d) * 255).toString(16)
  6515. }
  6516.  
  6517. function convertHexToDecimal(h) {
  6518. return (parseIntFromHex(h) / 255)
  6519. }
  6520. var matchers = (function() {
  6521. var CSS_INTEGER = "[-\\+]?\\d+%?";
  6522. var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
  6523. var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
  6524. var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
  6525. var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
  6526. return {
  6527. rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
  6528. rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
  6529. hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
  6530. hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
  6531. hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
  6532. hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
  6533. hex3: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  6534. hex6: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
  6535. hex8: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
  6536. }
  6537. })();
  6538.  
  6539. function stringInputToObject(color) {
  6540. color = color.replace(trimLeft, '').replace(trimRight, '').toLowerCase();
  6541. var named = !1;
  6542. if (names[color]) {
  6543. color = names[color];
  6544. named = !0
  6545. } else if (color == 'transparent') {
  6546. return {
  6547. r: 0,
  6548. g: 0,
  6549. b: 0,
  6550. a: 0,
  6551. format: "name"
  6552. }
  6553. }
  6554. var match;
  6555. if ((match = matchers.rgb.exec(color))) {
  6556. return {
  6557. r: match[1],
  6558. g: match[2],
  6559. b: match[3]
  6560. }
  6561. }
  6562. if ((match = matchers.rgba.exec(color))) {
  6563. return {
  6564. r: match[1],
  6565. g: match[2],
  6566. b: match[3],
  6567. a: match[4]
  6568. }
  6569. }
  6570. if ((match = matchers.hsl.exec(color))) {
  6571. return {
  6572. h: match[1],
  6573. s: match[2],
  6574. l: match[3]
  6575. }
  6576. }
  6577. if ((match = matchers.hsla.exec(color))) {
  6578. return {
  6579. h: match[1],
  6580. s: match[2],
  6581. l: match[3],
  6582. a: match[4]
  6583. }
  6584. }
  6585. if ((match = matchers.hsv.exec(color))) {
  6586. return {
  6587. h: match[1],
  6588. s: match[2],
  6589. v: match[3]
  6590. }
  6591. }
  6592. if ((match = matchers.hsva.exec(color))) {
  6593. return {
  6594. h: match[1],
  6595. s: match[2],
  6596. v: match[3],
  6597. a: match[4]
  6598. }
  6599. }
  6600. if ((match = matchers.hex8.exec(color))) {
  6601. return {
  6602. a: convertHexToDecimal(match[1]),
  6603. r: parseIntFromHex(match[2]),
  6604. g: parseIntFromHex(match[3]),
  6605. b: parseIntFromHex(match[4]),
  6606. format: named ? "name" : "hex8"
  6607. }
  6608. }
  6609. if ((match = matchers.hex6.exec(color))) {
  6610. return {
  6611. r: parseIntFromHex(match[1]),
  6612. g: parseIntFromHex(match[2]),
  6613. b: parseIntFromHex(match[3]),
  6614. format: named ? "name" : "hex"
  6615. }
  6616. }
  6617. if ((match = matchers.hex3.exec(color))) {
  6618. return {
  6619. r: parseIntFromHex(match[1] + '' + match[1]),
  6620. g: parseIntFromHex(match[2] + '' + match[2]),
  6621. b: parseIntFromHex(match[3] + '' + match[3]),
  6622. format: named ? "name" : "hex"
  6623. }
  6624. }
  6625. return !1
  6626. }
  6627. window.tinycolor = tinycolor
  6628. })();
  6629. $(function() {
  6630. if ($.fn.spectrum.load) {
  6631. $.fn.spectrum.processNativeColorInputs()
  6632. }
  6633. })
  6634. });
  6635. (function($) {
  6636. var types = ['DOMMouseScroll', 'mousewheel'];
  6637. if ($.event.fixHooks) {
  6638. for (var i = types.length; i;) {
  6639. $.event.fixHooks[types[--i]] = $.event.mouseHooks
  6640. }
  6641. }
  6642. $.event.special.mousewheel = {
  6643. setup: function() {
  6644. if (this.addEventListener) {
  6645. for (var i = types.length; i;) {
  6646. this.addEventListener(types[--i], handler, !1)
  6647. }
  6648. } else {
  6649. this.onmousewheel = handler
  6650. }
  6651. },
  6652. teardown: function() {
  6653. if (this.removeEventListener) {
  6654. for (var i = types.length; i;) {
  6655. this.removeEventListener(types[--i], handler, !1)
  6656. }
  6657. } else {
  6658. this.onmousewheel = null
  6659. }
  6660. }
  6661. };
  6662. $.fn.extend({
  6663. mousewheel: function(fn) {
  6664. return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel")
  6665. },
  6666. unmousewheel: function(fn) {
  6667. return this.unbind("mousewheel", fn)
  6668. }
  6669. });
  6670.  
  6671. function handler(event) {
  6672. var orgEvent = event || window.event,
  6673. args = [].slice.call(arguments, 1),
  6674. delta = 0,
  6675. returnValue = !0,
  6676. deltaX = 0,
  6677. deltaY = 0;
  6678. event = $.event.fix(orgEvent);
  6679. event.type = "mousewheel";
  6680. if (orgEvent.wheelDelta) {
  6681. delta = orgEvent.wheelDelta / 120
  6682. }
  6683. if (orgEvent.detail) {
  6684. delta = -orgEvent.detail / 3
  6685. }
  6686. deltaY = delta;
  6687. if (orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS) {
  6688. deltaY = 0;
  6689. deltaX = -1 * delta
  6690. }
  6691. if (orgEvent.wheelDeltaY !== undefined) {
  6692. deltaY = orgEvent.wheelDeltaY / 120
  6693. }
  6694. if (orgEvent.wheelDeltaX !== undefined) {
  6695. deltaX = -1 * orgEvent.wheelDeltaX / 120
  6696. }
  6697. args.unshift(event, delta, deltaX, deltaY);
  6698. return ($.event.dispatch || $.event.handle).apply(this, args)
  6699. }
  6700. })(jQuery);
  6701. ! function t(e, n, r) {
  6702. function o(i, s) {
  6703. if (!n[i]) {
  6704. if (!e[i]) {
  6705. var a = "function" == typeof require && require;
  6706. if (!s && a) return a(i, !0);
  6707. if (l) return l(i, !0);
  6708. var c = new Error("Cannot find module '" + i + "'");
  6709. throw c.code = "MODULE_NOT_FOUND", c
  6710. }
  6711. var u = n[i] = {
  6712. exports: {}
  6713. };
  6714. e[i][0].call(u.exports, function(t) {
  6715. var n = e[i][1][t];
  6716. return o(n ? n : t)
  6717. }, u, u.exports, t, e, n, r)
  6718. }
  6719. return n[i].exports
  6720. }
  6721. for (var l = "function" == typeof require && require, i = 0; i < r.length; i++) o(r[i]);
  6722. return o
  6723. }({
  6724. 1: [function(t, e, n) {
  6725. "use strict";
  6726.  
  6727. function r(t) {
  6728. t.fn.perfectScrollbar = function(t) {
  6729. return this.each(function() {
  6730. if ("object" == typeof t || "undefined" == typeof t) {
  6731. var e = t;
  6732. l.get(this) || o.initialize(this, e)
  6733. } else {
  6734. var n = t;
  6735. "update" === n ? o.update(this) : "destroy" === n && o.destroy(this)
  6736. }
  6737. })
  6738. }
  6739. }
  6740. var o = t("../main"),
  6741. l = t("../plugin/instances");
  6742. if ("function" == typeof define && define.amd) define(["jquery"], r);
  6743. else {
  6744. var i = window.jQuery ? window.jQuery : window.$;
  6745. "undefined" != typeof i && r(i)
  6746. }
  6747. e.exports = r
  6748. }, {
  6749. "../main": 7,
  6750. "../plugin/instances": 18
  6751. }],
  6752. 2: [function(t, e, n) {
  6753. "use strict";
  6754.  
  6755. function r(t, e) {
  6756. var n = t.className.split(" ");
  6757. n.indexOf(e) < 0 && n.push(e), t.className = n.join(" ")
  6758. }
  6759.  
  6760. function o(t, e) {
  6761. var n = t.className.split(" "),
  6762. r = n.indexOf(e);
  6763. r >= 0 && n.splice(r, 1), t.className = n.join(" ")
  6764. }
  6765. n.add = function(t, e) {
  6766. t.classList ? t.classList.add(e) : r(t, e)
  6767. }, n.remove = function(t, e) {
  6768. t.classList ? t.classList.remove(e) : o(t, e)
  6769. }, n.list = function(t) {
  6770. return t.classList ? Array.prototype.slice.apply(t.classList) : t.className.split(" ")
  6771. }
  6772. }, {}],
  6773. 3: [function(t, e, n) {
  6774. "use strict";
  6775.  
  6776. function r(t, e) {
  6777. return window.getComputedStyle(t)[e]
  6778. }
  6779.  
  6780. function o(t, e, n) {
  6781. return "number" == typeof n && (n = n.toString() + "px"), t.style[e] = n, t
  6782. }
  6783.  
  6784. function l(t, e) {
  6785. for (var n in e) {
  6786. var r = e[n];
  6787. "number" == typeof r && (r = r.toString() + "px"), t.style[n] = r
  6788. }
  6789. return t
  6790. }
  6791. var i = {};
  6792. i.e = function(t, e) {
  6793. var n = document.createElement(t);
  6794. return n.className = e, n
  6795. }, i.appendTo = function(t, e) {
  6796. return e.appendChild(t), t
  6797. }, i.css = function(t, e, n) {
  6798. return "object" == typeof e ? l(t, e) : "undefined" == typeof n ? r(t, e) : o(t, e, n)
  6799. }, i.matches = function(t, e) {
  6800. return "undefined" != typeof t.matches ? t.matches(e) : "undefined" != typeof t.matchesSelector ? t.matchesSelector(e) : "undefined" != typeof t.webkitMatchesSelector ? t.webkitMatchesSelector(e) : "undefined" != typeof t.mozMatchesSelector ? t.mozMatchesSelector(e) : "undefined" != typeof t.msMatchesSelector ? t.msMatchesSelector(e) : void 0
  6801. }, i.remove = function(t) {
  6802. "undefined" != typeof t.remove ? t.remove() : t.parentNode && t.parentNode.removeChild(t)
  6803. }, i.queryChildren = function(t, e) {
  6804. return Array.prototype.filter.call(t.childNodes, function(t) {
  6805. return i.matches(t, e)
  6806. })
  6807. }, e.exports = i
  6808. }, {}],
  6809. 4: [function(t, e, n) {
  6810. "use strict";
  6811. var r = function(t) {
  6812. this.element = t, this.events = {}
  6813. };
  6814. r.prototype.bind = function(t, e) {
  6815. "undefined" == typeof this.events[t] && (this.events[t] = []), this.events[t].push(e), this.element.addEventListener(t, e, !1)
  6816. }, r.prototype.unbind = function(t, e) {
  6817. var n = "undefined" != typeof e;
  6818. this.events[t] = this.events[t].filter(function(r) {
  6819. return !(!n || r === e) || (this.element.removeEventListener(t, r, !1), !1)
  6820. }, this)
  6821. }, r.prototype.unbindAll = function() {
  6822. for (var t in this.events) this.unbind(t)
  6823. };
  6824. var o = function() {
  6825. this.eventElements = []
  6826. };
  6827. o.prototype.eventElement = function(t) {
  6828. var e = this.eventElements.filter(function(e) {
  6829. return e.element === t
  6830. })[0];
  6831. return "undefined" == typeof e && (e = new r(t), this.eventElements.push(e)), e
  6832. }, o.prototype.bind = function(t, e, n) {
  6833. this.eventElement(t).bind(e, n)
  6834. }, o.prototype.unbind = function(t, e, n) {
  6835. this.eventElement(t).unbind(e, n)
  6836. }, o.prototype.unbindAll = function() {
  6837. for (var t = 0; t < this.eventElements.length; t++) this.eventElements[t].unbindAll()
  6838. }, o.prototype.once = function(t, e, n) {
  6839. var r = this.eventElement(t),
  6840. o = function(t) {
  6841. r.unbind(e, o), n(t)
  6842. };
  6843. r.bind(e, o)
  6844. }, e.exports = o
  6845. }, {}],
  6846. 5: [function(t, e, n) {
  6847. "use strict";
  6848. e.exports = function() {
  6849. function t() {
  6850. return Math.floor(65536 * (1 + Math.random())).toString(16).substring(1)
  6851. }
  6852. return function() {
  6853. return t() + t() + "-" + t() + "-" + t() + "-" + t() + "-" + t() + t() + t()
  6854. }
  6855. }()
  6856. }, {}],
  6857. 6: [function(t, e, n) {
  6858. "use strict";
  6859. var r = t("./class"),
  6860. o = t("./dom"),
  6861. l = n.toInt = function(t) {
  6862. return parseInt(t, 10) || 0
  6863. },
  6864. i = n.clone = function(t) {
  6865. if (t) {
  6866. if (t.constructor === Array) return t.map(i);
  6867. if ("object" == typeof t) {
  6868. var e = {};
  6869. for (var n in t) e[n] = i(t[n]);
  6870. return e
  6871. }
  6872. return t
  6873. }
  6874. return null
  6875. };
  6876. n.extend = function(t, e) {
  6877. var n = i(t);
  6878. for (var r in e) n[r] = i(e[r]);
  6879. return n
  6880. }, n.isEditable = function(t) {
  6881. return o.matches(t, "input,[contenteditable]") || o.matches(t, "select,[contenteditable]") || o.matches(t, "textarea,[contenteditable]") || o.matches(t, "button,[contenteditable]")
  6882. }, n.removePsClasses = function(t) {
  6883. for (var e = r.list(t), n = 0; n < e.length; n++) {
  6884. var o = e[n];
  6885. 0 === o.indexOf("ps-") && r.remove(t, o)
  6886. }
  6887. }, n.outerWidth = function(t) {
  6888. return l(o.css(t, "width")) + l(o.css(t, "paddingLeft")) + l(o.css(t, "paddingRight")) + l(o.css(t, "borderLeftWidth")) + l(o.css(t, "borderRightWidth"))
  6889. }, n.startScrolling = function(t, e) {
  6890. r.add(t, "ps-in-scrolling"), "undefined" != typeof e ? r.add(t, "ps-" + e) : (r.add(t, "ps-x"), r.add(t, "ps-y"))
  6891. }, n.stopScrolling = function(t, e) {
  6892. r.remove(t, "ps-in-scrolling"), "undefined" != typeof e ? r.remove(t, "ps-" + e) : (r.remove(t, "ps-x"), r.remove(t, "ps-y"))
  6893. }, n.env = {
  6894. isWebKit: "WebkitAppearance" in document.documentElement.style,
  6895. supportsTouch: "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch,
  6896. supportsIePointer: null !== window.navigator.msMaxTouchPoints
  6897. }
  6898. }, {
  6899. "./class": 2,
  6900. "./dom": 3
  6901. }],
  6902. 7: [function(t, e, n) {
  6903. "use strict";
  6904. var r = t("./plugin/destroy"),
  6905. o = t("./plugin/initialize"),
  6906. l = t("./plugin/update");
  6907. e.exports = {
  6908. initialize: o,
  6909. update: l,
  6910. destroy: r
  6911. }
  6912. }, {
  6913. "./plugin/destroy": 9,
  6914. "./plugin/initialize": 17,
  6915. "./plugin/update": 21
  6916. }],
  6917. 8: [function(t, e, n) {
  6918. "use strict";
  6919. e.exports = {
  6920. handlers: ["click-rail", "drag-scrollbar", "keyboard", "wheel", "touch"],
  6921. maxScrollbarLength: null,
  6922. minScrollbarLength: null,
  6923. scrollXMarginOffset: 0,
  6924. scrollYMarginOffset: 0,
  6925. suppressScrollX: !1,
  6926. suppressScrollY: !1,
  6927. swipePropagation: !0,
  6928. useBothWheelAxes: !1,
  6929. wheelPropagation: !1,
  6930. wheelSpeed: 1,
  6931. theme: "default"
  6932. }
  6933. }, {}],
  6934. 9: [function(t, e, n) {
  6935. "use strict";
  6936. var r = t("../lib/helper"),
  6937. o = t("../lib/dom"),
  6938. l = t("./instances");
  6939. e.exports = function(t) {
  6940. var e = l.get(t);
  6941. e && (e.event.unbindAll(), o.remove(e.scrollbarX), o.remove(e.scrollbarY), o.remove(e.scrollbarXRail), o.remove(e.scrollbarYRail), r.removePsClasses(t), l.remove(t))
  6942. }
  6943. }, {
  6944. "../lib/dom": 3,
  6945. "../lib/helper": 6,
  6946. "./instances": 18
  6947. }],
  6948. 10: [function(t, e, n) {
  6949. "use strict";
  6950.  
  6951. function r(t, e) {
  6952. function n(t) {
  6953. return t.getBoundingClientRect()
  6954. }
  6955. var r = function(t) {
  6956. t.stopPropagation()
  6957. };
  6958. e.event.bind(e.scrollbarY, "click", r), e.event.bind(e.scrollbarYRail, "click", function(r) {
  6959. var o = r.pageY - window.pageYOffset - n(e.scrollbarYRail).top,
  6960. s = o > e.scrollbarYTop ? 1 : -1;
  6961. i(t, "top", t.scrollTop + s * e.containerHeight), l(t), r.stopPropagation()
  6962. }), e.event.bind(e.scrollbarX, "click", r), e.event.bind(e.scrollbarXRail, "click", function(r) {
  6963. var o = r.pageX - window.pageXOffset - n(e.scrollbarXRail).left,
  6964. s = o > e.scrollbarXLeft ? 1 : -1;
  6965. i(t, "left", t.scrollLeft + s * e.containerWidth), l(t), r.stopPropagation()
  6966. })
  6967. }
  6968. var o = t("../instances"),
  6969. l = t("../update-geometry"),
  6970. i = t("../update-scroll");
  6971. e.exports = function(t) {
  6972. var e = o.get(t);
  6973. r(t, e)
  6974. }
  6975. }, {
  6976. "../instances": 18,
  6977. "../update-geometry": 19,
  6978. "../update-scroll": 20
  6979. }],
  6980. 11: [function(t, e, n) {
  6981. "use strict";
  6982.  
  6983. function r(t, e) {
  6984. function n(n) {
  6985. var o = r + n * e.railXRatio,
  6986. i = Math.max(0, e.scrollbarXRail.getBoundingClientRect().left) + e.railXRatio * (e.railXWidth - e.scrollbarXWidth);
  6987. o < 0 ? e.scrollbarXLeft = 0 : o > i ? e.scrollbarXLeft = i : e.scrollbarXLeft = o;
  6988. var s = l.toInt(e.scrollbarXLeft * (e.contentWidth - e.containerWidth) / (e.containerWidth - e.railXRatio * e.scrollbarXWidth)) - e.negativeScrollAdjustment;
  6989. c(t, "left", s)
  6990. }
  6991. var r = null,
  6992. o = null,
  6993. s = function(e) {
  6994. n(e.pageX - o), a(t), e.stopPropagation(), e.preventDefault()
  6995. },
  6996. u = function() {
  6997. l.stopScrolling(t, "x"), e.event.unbind(e.ownerDocument, "mousemove", s)
  6998. };
  6999. e.event.bind(e.scrollbarX, "mousedown", function(n) {
  7000. o = n.pageX, r = l.toInt(i.css(e.scrollbarX, "left")) * e.railXRatio, l.startScrolling(t, "x"), e.event.bind(e.ownerDocument, "mousemove", s), e.event.once(e.ownerDocument, "mouseup", u), n.stopPropagation(), n.preventDefault()
  7001. })
  7002. }
  7003.  
  7004. function o(t, e) {
  7005. function n(n) {
  7006. var o = r + n * e.railYRatio,
  7007. i = Math.max(0, e.scrollbarYRail.getBoundingClientRect().top) + e.railYRatio * (e.railYHeight - e.scrollbarYHeight);
  7008. o < 0 ? e.scrollbarYTop = 0 : o > i ? e.scrollbarYTop = i : e.scrollbarYTop = o;
  7009. var s = l.toInt(e.scrollbarYTop * (e.contentHeight - e.containerHeight) / (e.containerHeight - e.railYRatio * e.scrollbarYHeight));
  7010. c(t, "top", s)
  7011. }
  7012. var r = null,
  7013. o = null,
  7014. s = function(e) {
  7015. n(e.pageY - o), a(t), e.stopPropagation(), e.preventDefault()
  7016. },
  7017. u = function() {
  7018. l.stopScrolling(t, "y"), e.event.unbind(e.ownerDocument, "mousemove", s)
  7019. };
  7020. e.event.bind(e.scrollbarY, "mousedown", function(n) {
  7021. o = n.pageY, r = l.toInt(i.css(e.scrollbarY, "top")) * e.railYRatio, l.startScrolling(t, "y"), e.event.bind(e.ownerDocument, "mousemove", s), e.event.once(e.ownerDocument, "mouseup", u), n.stopPropagation(), n.preventDefault()
  7022. })
  7023. }
  7024. var l = t("../../lib/helper"),
  7025. i = t("../../lib/dom"),
  7026. s = t("../instances"),
  7027. a = t("../update-geometry"),
  7028. c = t("../update-scroll");
  7029. e.exports = function(t) {
  7030. var e = s.get(t);
  7031. r(t, e), o(t, e)
  7032. }
  7033. }, {
  7034. "../../lib/dom": 3,
  7035. "../../lib/helper": 6,
  7036. "../instances": 18,
  7037. "../update-geometry": 19,
  7038. "../update-scroll": 20
  7039. }],
  7040. 12: [function(t, e, n) {
  7041. "use strict";
  7042.  
  7043. function r(t, e) {
  7044. function n(n, r) {
  7045. var o = t.scrollTop;
  7046. if (0 === n) {
  7047. if (!e.scrollbarYActive) return !1;
  7048. if (0 === o && r > 0 || o >= e.contentHeight - e.containerHeight && r < 0) return !e.settings.wheelPropagation
  7049. }
  7050. var l = t.scrollLeft;
  7051. if (0 === r) {
  7052. if (!e.scrollbarXActive) return !1;
  7053. if (0 === l && n < 0 || l >= e.contentWidth - e.containerWidth && n > 0) return !e.settings.wheelPropagation
  7054. }
  7055. return !0
  7056. }
  7057. var r = !1;
  7058. e.event.bind(t, "mouseenter", function() {
  7059. r = !0
  7060. }), e.event.bind(t, "mouseleave", function() {
  7061. r = !1
  7062. });
  7063. var i = !1;
  7064. e.event.bind(e.ownerDocument, "keydown", function(c) {
  7065. if (!(c.isDefaultPrevented && c.isDefaultPrevented() || c.defaultPrevented)) {
  7066. var u = l.matches(e.scrollbarX, ":focus") || l.matches(e.scrollbarY, ":focus");
  7067. if (r || u) {
  7068. var d = document.activeElement ? document.activeElement : e.ownerDocument.activeElement;
  7069. if (d) {
  7070. if ("IFRAME" === d.tagName) d = d.contentDocument.activeElement;
  7071. else
  7072. for (; d.shadowRoot;) d = d.shadowRoot.activeElement;
  7073. if (o.isEditable(d)) return
  7074. }
  7075. var p = 0,
  7076. f = 0;
  7077. switch (c.which) {
  7078. case 37:
  7079. p = c.metaKey ? -e.contentWidth : c.altKey ? -e.containerWidth : -30;
  7080. break;
  7081. case 38:
  7082. f = c.metaKey ? e.contentHeight : c.altKey ? e.containerHeight : 30;
  7083. break;
  7084. case 39:
  7085. p = c.metaKey ? e.contentWidth : c.altKey ? e.containerWidth : 30;
  7086. break;
  7087. case 40:
  7088. f = c.metaKey ? -e.contentHeight : c.altKey ? -e.containerHeight : -30;
  7089. break;
  7090. case 33:
  7091. f = 90;
  7092. break;
  7093. case 32:
  7094. f = c.shiftKey ? 90 : -90;
  7095. break;
  7096. case 34:
  7097. f = -90;
  7098. break;
  7099. case 35:
  7100. f = c.ctrlKey ? -e.contentHeight : -e.containerHeight;
  7101. break;
  7102. case 36:
  7103. f = c.ctrlKey ? t.scrollTop : e.containerHeight;
  7104. break;
  7105. default:
  7106. return
  7107. }
  7108. a(t, "top", t.scrollTop - f), a(t, "left", t.scrollLeft + p), s(t), i = n(p, f), i && c.preventDefault()
  7109. }
  7110. }
  7111. })
  7112. }
  7113. var o = t("../../lib/helper"),
  7114. l = t("../../lib/dom"),
  7115. i = t("../instances"),
  7116. s = t("../update-geometry"),
  7117. a = t("../update-scroll");
  7118. e.exports = function(t) {
  7119. var e = i.get(t);
  7120. r(t, e)
  7121. }
  7122. }, {
  7123. "../../lib/dom": 3,
  7124. "../../lib/helper": 6,
  7125. "../instances": 18,
  7126. "../update-geometry": 19,
  7127. "../update-scroll": 20
  7128. }],
  7129. 13: [function(t, e, n) {
  7130. "use strict";
  7131.  
  7132. function r(t, e) {
  7133. function n(n, r) {
  7134. var o = t.scrollTop;
  7135. if (0 === n) {
  7136. if (!e.scrollbarYActive) return !1;
  7137. if (0 === o && r > 0 || o >= e.contentHeight - e.containerHeight && r < 0) return !e.settings.wheelPropagation
  7138. }
  7139. var l = t.scrollLeft;
  7140. if (0 === r) {
  7141. if (!e.scrollbarXActive) return !1;
  7142. if (0 === l && n < 0 || l >= e.contentWidth - e.containerWidth && n > 0) return !e.settings.wheelPropagation
  7143. }
  7144. return !0
  7145. }
  7146.  
  7147. function r(t) {
  7148. var e = t.deltaX,
  7149. n = -1 * t.deltaY;
  7150. return "undefined" != typeof e && "undefined" != typeof n || (e = -1 * t.wheelDeltaX / 6, n = t.wheelDeltaY / 6), t.deltaMode && 1 === t.deltaMode && (e *= 10, n *= 10), e !== e && n !== n && (e = 0, n = t.wheelDelta), t.shiftKey ? [-n, -e] : [e, n]
  7151. }
  7152.  
  7153. function o(e, n) {
  7154. var r = t.querySelector("textarea:hover, select[multiple]:hover, .ps-child:hover");
  7155. if (r) {
  7156. if (!window.getComputedStyle(r).overflow.match(/(scroll|auto)/)) return !1;
  7157. var o = r.scrollHeight - r.clientHeight;
  7158. if (o > 0 && !(0 === r.scrollTop && n > 0 || r.scrollTop === o && n < 0)) return !0;
  7159. var l = r.scrollLeft - r.clientWidth;
  7160. if (l > 0 && !(0 === r.scrollLeft && e < 0 || r.scrollLeft === l && e > 0)) return !0
  7161. }
  7162. return !1
  7163. }
  7164.  
  7165. function s(s) {
  7166. var c = r(s),
  7167. u = c[0],
  7168. d = c[1];
  7169. o(u, d) || (a = !1, e.settings.useBothWheelAxes ? e.scrollbarYActive && !e.scrollbarXActive ? (d ? i(t, "top", t.scrollTop - d * e.settings.wheelSpeed) : i(t, "top", t.scrollTop + u * e.settings.wheelSpeed), a = !0) : e.scrollbarXActive && !e.scrollbarYActive && (u ? i(t, "left", t.scrollLeft + u * e.settings.wheelSpeed) : i(t, "left", t.scrollLeft - d * e.settings.wheelSpeed), a = !0) : (i(t, "top", t.scrollTop - d * e.settings.wheelSpeed), i(t, "left", t.scrollLeft + u * e.settings.wheelSpeed)), l(t), a = a || n(u, d), a && (s.stopPropagation(), s.preventDefault()))
  7170. }
  7171. var a = !1;
  7172. "undefined" != typeof window.onwheel ? e.event.bind(t, "wheel", s) : "undefined" != typeof window.onmousewheel && e.event.bind(t, "mousewheel", s)
  7173. }
  7174. var o = t("../instances"),
  7175. l = t("../update-geometry"),
  7176. i = t("../update-scroll");
  7177. e.exports = function(t) {
  7178. var e = o.get(t);
  7179. r(t, e)
  7180. }
  7181. }, {
  7182. "../instances": 18,
  7183. "../update-geometry": 19,
  7184. "../update-scroll": 20
  7185. }],
  7186. 14: [function(t, e, n) {
  7187. "use strict";
  7188.  
  7189. function r(t, e) {
  7190. e.event.bind(t, "scroll", function() {
  7191. l(t)
  7192. })
  7193. }
  7194. var o = t("../instances"),
  7195. l = t("../update-geometry");
  7196. e.exports = function(t) {
  7197. var e = o.get(t);
  7198. r(t, e)
  7199. }
  7200. }, {
  7201. "../instances": 18,
  7202. "../update-geometry": 19
  7203. }],
  7204. 15: [function(t, e, n) {
  7205. "use strict";
  7206.  
  7207. function r(t, e) {
  7208. function n() {
  7209. var t = window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : "";
  7210. return 0 === t.toString().length ? null : t.getRangeAt(0).commonAncestorContainer
  7211. }
  7212.  
  7213. function r() {
  7214. c || (c = setInterval(function() {
  7215. return l.get(t) ? (s(t, "top", t.scrollTop + u.top), s(t, "left", t.scrollLeft + u.left), void i(t)) : void clearInterval(c)
  7216. }, 50))
  7217. }
  7218.  
  7219. function a() {
  7220. c && (clearInterval(c), c = null), o.stopScrolling(t)
  7221. }
  7222. var c = null,
  7223. u = {
  7224. top: 0,
  7225. left: 0
  7226. },
  7227. d = !1;
  7228. e.event.bind(e.ownerDocument, "selectionchange", function() {
  7229. t.contains(n()) ? d = !0 : (d = !1, a())
  7230. }), e.event.bind(window, "mouseup", function() {
  7231. d && (d = !1, a())
  7232. }), e.event.bind(window, "keyup", function() {
  7233. d && (d = !1, a())
  7234. }), e.event.bind(window, "mousemove", function(e) {
  7235. if (d) {
  7236. var n = {
  7237. x: e.pageX,
  7238. y: e.pageY
  7239. },
  7240. l = {
  7241. left: t.offsetLeft,
  7242. right: t.offsetLeft + t.offsetWidth,
  7243. top: t.offsetTop,
  7244. bottom: t.offsetTop + t.offsetHeight
  7245. };
  7246. n.x < l.left + 3 ? (u.left = -5, o.startScrolling(t, "x")) : n.x > l.right - 3 ? (u.left = 5, o.startScrolling(t, "x")) : u.left = 0, n.y < l.top + 3 ? (l.top + 3 - n.y < 5 ? u.top = -5 : u.top = -20, o.startScrolling(t, "y")) : n.y > l.bottom - 3 ? (n.y - l.bottom + 3 < 5 ? u.top = 5 : u.top = 20, o.startScrolling(t, "y")) : u.top = 0, 0 === u.top && 0 === u.left ? a() : r()
  7247. }
  7248. })
  7249. }
  7250. var o = t("../../lib/helper"),
  7251. l = t("../instances"),
  7252. i = t("../update-geometry"),
  7253. s = t("../update-scroll");
  7254. e.exports = function(t) {
  7255. var e = l.get(t);
  7256. r(t, e)
  7257. }
  7258. }, {
  7259. "../../lib/helper": 6,
  7260. "../instances": 18,
  7261. "../update-geometry": 19,
  7262. "../update-scroll": 20
  7263. }],
  7264. 16: [function(t, e, n) {
  7265. "use strict";
  7266.  
  7267. function r(t, e, n, r) {
  7268. function o(n, r) {
  7269. var o = t.scrollTop,
  7270. l = t.scrollLeft,
  7271. i = Math.abs(n),
  7272. s = Math.abs(r);
  7273. if (s > i) {
  7274. if (r < 0 && o === e.contentHeight - e.containerHeight || r > 0 && 0 === o) return !e.settings.swipePropagation
  7275. } else if (i > s && (n < 0 && l === e.contentWidth - e.containerWidth || n > 0 && 0 === l)) return !e.settings.swipePropagation;
  7276. return !0
  7277. }
  7278.  
  7279. function a(e, n) {
  7280. s(t, "top", t.scrollTop - n), s(t, "left", t.scrollLeft - e), i(t)
  7281. }
  7282.  
  7283. function c() {
  7284. w = !0
  7285. }
  7286.  
  7287. function u() {
  7288. w = !1
  7289. }
  7290.  
  7291. function d(t) {
  7292. return t.targetTouches ? t.targetTouches[0] : t
  7293. }
  7294.  
  7295. function p(t) {
  7296. return !(!t.targetTouches || 1 !== t.targetTouches.length) || !(!t.pointerType || "mouse" === t.pointerType || t.pointerType === t.MSPOINTER_TYPE_MOUSE)
  7297. }
  7298.  
  7299. function f(t) {
  7300. if (p(t)) {
  7301. Y = !0;
  7302. var e = d(t);
  7303. g.pageX = e.pageX, g.pageY = e.pageY, v = (new Date).getTime(), null !== y && clearInterval(y), t.stopPropagation()
  7304. }
  7305. }
  7306.  
  7307. function h(t) {
  7308. if (!Y && e.settings.swipePropagation && f(t), !w && Y && p(t)) {
  7309. var n = d(t),
  7310. r = {
  7311. pageX: n.pageX,
  7312. pageY: n.pageY
  7313. },
  7314. l = r.pageX - g.pageX,
  7315. i = r.pageY - g.pageY;
  7316. a(l, i), g = r;
  7317. var s = (new Date).getTime(),
  7318. c = s - v;
  7319. c > 0 && (m.x = l / c, m.y = i / c, v = s), o(l, i) && (t.stopPropagation(), t.preventDefault())
  7320. }
  7321. }
  7322.  
  7323. function b() {
  7324. !w && Y && (Y = !1, clearInterval(y), y = setInterval(function() {
  7325. return l.get(t) && (m.x || m.y) ? Math.abs(m.x) < .01 && Math.abs(m.y) < .01 ? void clearInterval(y) : (a(30 * m.x, 30 * m.y), m.x *= .8, void(m.y *= .8)) : void clearInterval(y)
  7326. }, 10))
  7327. }
  7328. var g = {},
  7329. v = 0,
  7330. m = {},
  7331. y = null,
  7332. w = !1,
  7333. Y = !1;
  7334. n && (e.event.bind(window, "touchstart", c), e.event.bind(window, "touchend", u), e.event.bind(t, "touchstart", f), e.event.bind(t, "touchmove", h), e.event.bind(t, "touchend", b)), r && (window.PointerEvent ? (e.event.bind(window, "pointerdown", c), e.event.bind(window, "pointerup", u), e.event.bind(t, "pointerdown", f), e.event.bind(t, "pointermove", h), e.event.bind(t, "pointerup", b)) : window.MSPointerEvent && (e.event.bind(window, "MSPointerDown", c), e.event.bind(window, "MSPointerUp", u), e.event.bind(t, "MSPointerDown", f), e.event.bind(t, "MSPointerMove", h), e.event.bind(t, "MSPointerUp", b)))
  7335. }
  7336. var o = t("../../lib/helper"),
  7337. l = t("../instances"),
  7338. i = t("../update-geometry"),
  7339. s = t("../update-scroll");
  7340. e.exports = function(t) {
  7341. if (o.env.supportsTouch || o.env.supportsIePointer) {
  7342. var e = l.get(t);
  7343. r(t, e, o.env.supportsTouch, o.env.supportsIePointer)
  7344. }
  7345. }
  7346. }, {
  7347. "../../lib/helper": 6,
  7348. "../instances": 18,
  7349. "../update-geometry": 19,
  7350. "../update-scroll": 20
  7351. }],
  7352. 17: [function(t, e, n) {
  7353. "use strict";
  7354. var r = t("../lib/helper"),
  7355. o = t("../lib/class"),
  7356. l = t("./instances"),
  7357. i = t("./update-geometry"),
  7358. s = {
  7359. "click-rail": t("./handler/click-rail"),
  7360. "drag-scrollbar": t("./handler/drag-scrollbar"),
  7361. keyboard: t("./handler/keyboard"),
  7362. wheel: t("./handler/mouse-wheel"),
  7363. touch: t("./handler/touch"),
  7364. selection: t("./handler/selection")
  7365. },
  7366. a = t("./handler/native-scroll");
  7367. e.exports = function(t, e) {
  7368. e = "object" == typeof e ? e : {}, o.add(t, "ps-container");
  7369. var n = l.add(t);
  7370. n.settings = r.extend(n.settings, e), o.add(t, "ps-theme-" + n.settings.theme), n.settings.handlers.forEach(function(e) {
  7371. s[e](t)
  7372. }), a(t), i(t)
  7373. }
  7374. }, {
  7375. "../lib/class": 2,
  7376. "../lib/helper": 6,
  7377. "./handler/click-rail": 10,
  7378. "./handler/drag-scrollbar": 11,
  7379. "./handler/keyboard": 12,
  7380. "./handler/mouse-wheel": 13,
  7381. "./handler/native-scroll": 14,
  7382. "./handler/selection": 15,
  7383. "./handler/touch": 16,
  7384. "./instances": 18,
  7385. "./update-geometry": 19
  7386. }],
  7387. 18: [function(t, e, n) {
  7388. "use strict";
  7389.  
  7390. function r(t) {
  7391. function e() {
  7392. a.add(t, "ps-focus")
  7393. }
  7394.  
  7395. function n() {
  7396. a.remove(t, "ps-focus")
  7397. }
  7398. var r = this;
  7399. r.settings = s.clone(c), r.containerWidth = null, r.containerHeight = null, r.contentWidth = null, r.contentHeight = null, r.isRtl = "rtl" === u.css(t, "direction"), r.isNegativeScroll = function() {
  7400. var e = t.scrollLeft,
  7401. n = null;
  7402. return t.scrollLeft = -1, n = t.scrollLeft < 0, t.scrollLeft = e, n
  7403. }(), r.negativeScrollAdjustment = r.isNegativeScroll ? t.scrollWidth - t.clientWidth : 0, r.event = new d, r.ownerDocument = t.ownerDocument || document, r.scrollbarXRail = u.appendTo(u.e("div", "ps-scrollbar-x-rail"), t), r.scrollbarX = u.appendTo(u.e("div", "ps-scrollbar-x"), r.scrollbarXRail), r.scrollbarX.setAttribute("tabindex", 0), r.event.bind(r.scrollbarX, "focus", e), r.event.bind(r.scrollbarX, "blur", n), r.scrollbarXActive = null, r.scrollbarXWidth = null, r.scrollbarXLeft = null, r.scrollbarXBottom = s.toInt(u.css(r.scrollbarXRail, "bottom")), r.isScrollbarXUsingBottom = r.scrollbarXBottom === r.scrollbarXBottom, r.scrollbarXTop = r.isScrollbarXUsingBottom ? null : s.toInt(u.css(r.scrollbarXRail, "top")), r.railBorderXWidth = s.toInt(u.css(r.scrollbarXRail, "borderLeftWidth")) + s.toInt(u.css(r.scrollbarXRail, "borderRightWidth")), u.css(r.scrollbarXRail, "display", "block"), r.railXMarginWidth = s.toInt(u.css(r.scrollbarXRail, "marginLeft")) + s.toInt(u.css(r.scrollbarXRail, "marginRight")), u.css(r.scrollbarXRail, "display", ""), r.railXWidth = null, r.railXRatio = null, r.scrollbarYRail = u.appendTo(u.e("div", "ps-scrollbar-y-rail"), t), r.scrollbarY = u.appendTo(u.e("div", "ps-scrollbar-y"), r.scrollbarYRail), r.scrollbarY.setAttribute("tabindex", 0), r.event.bind(r.scrollbarY, "focus", e), r.event.bind(r.scrollbarY, "blur", n), r.scrollbarYActive = null, r.scrollbarYHeight = null, r.scrollbarYTop = null, r.scrollbarYRight = s.toInt(u.css(r.scrollbarYRail, "right")), r.isScrollbarYUsingRight = r.scrollbarYRight === r.scrollbarYRight, r.scrollbarYLeft = r.isScrollbarYUsingRight ? null : s.toInt(u.css(r.scrollbarYRail, "left")), r.scrollbarYOuterWidth = r.isRtl ? s.outerWidth(r.scrollbarY) : null, r.railBorderYWidth = s.toInt(u.css(r.scrollbarYRail, "borderTopWidth")) + s.toInt(u.css(r.scrollbarYRail, "borderBottomWidth")), u.css(r.scrollbarYRail, "display", "block"), r.railYMarginHeight = s.toInt(u.css(r.scrollbarYRail, "marginTop")) + s.toInt(u.css(r.scrollbarYRail, "marginBottom")), u.css(r.scrollbarYRail, "display", ""), r.railYHeight = null, r.railYRatio = null
  7404. }
  7405.  
  7406. function o(t) {
  7407. return t.getAttribute("data-ps-id")
  7408. }
  7409.  
  7410. function l(t, e) {
  7411. t.setAttribute("data-ps-id", e)
  7412. }
  7413.  
  7414. function i(t) {
  7415. t.removeAttribute("data-ps-id")
  7416. }
  7417. var s = t("../lib/helper"),
  7418. a = t("../lib/class"),
  7419. c = t("./default-setting"),
  7420. u = t("../lib/dom"),
  7421. d = t("../lib/event-manager"),
  7422. p = t("../lib/guid"),
  7423. f = {};
  7424. n.add = function(t) {
  7425. var e = p();
  7426. return l(t, e), f[e] = new r(t), f[e]
  7427. }, n.remove = function(t) {
  7428. delete f[o(t)], i(t)
  7429. }, n.get = function(t) {
  7430. return f[o(t)]
  7431. }
  7432. }, {
  7433. "../lib/class": 2,
  7434. "../lib/dom": 3,
  7435. "../lib/event-manager": 4,
  7436. "../lib/guid": 5,
  7437. "../lib/helper": 6,
  7438. "./default-setting": 8
  7439. }],
  7440. 19: [function(t, e, n) {
  7441. "use strict";
  7442.  
  7443. function r(t, e) {
  7444. return t.settings.minScrollbarLength && (e = Math.max(e, t.settings.minScrollbarLength)), t.settings.maxScrollbarLength && (e = Math.min(e, t.settings.maxScrollbarLength)), e
  7445. }
  7446.  
  7447. function o(t, e) {
  7448. var n = {
  7449. width: e.railXWidth
  7450. };
  7451. e.isRtl ? n.left = e.negativeScrollAdjustment + t.scrollLeft + e.containerWidth - e.contentWidth : n.left = t.scrollLeft, e.isScrollbarXUsingBottom ? n.bottom = e.scrollbarXBottom - t.scrollTop : n.top = e.scrollbarXTop + t.scrollTop, s.css(e.scrollbarXRail, n);
  7452. var r = {
  7453. top: t.scrollTop,
  7454. height: e.railYHeight
  7455. };
  7456. e.isScrollbarYUsingRight ? e.isRtl ? r.right = e.contentWidth - (e.negativeScrollAdjustment + t.scrollLeft) - e.scrollbarYRight - e.scrollbarYOuterWidth : r.right = e.scrollbarYRight - t.scrollLeft : e.isRtl ? r.left = e.negativeScrollAdjustment + t.scrollLeft + 2 * e.containerWidth - e.contentWidth - e.scrollbarYLeft - e.scrollbarYOuterWidth : r.left = e.scrollbarYLeft + t.scrollLeft, s.css(e.scrollbarYRail, r), s.css(e.scrollbarX, {
  7457. left: e.scrollbarXLeft,
  7458. width: e.scrollbarXWidth - e.railBorderXWidth
  7459. }), s.css(e.scrollbarY, {
  7460. top: e.scrollbarYTop,
  7461. height: e.scrollbarYHeight - e.railBorderYWidth
  7462. })
  7463. }
  7464. var l = t("../lib/helper"),
  7465. i = t("../lib/class"),
  7466. s = t("../lib/dom"),
  7467. a = t("./instances"),
  7468. c = t("./update-scroll");
  7469. e.exports = function(t) {
  7470. var e = a.get(t);
  7471. e.containerWidth = t.clientWidth, e.containerHeight = t.clientHeight, e.contentWidth = t.scrollWidth, e.contentHeight = t.scrollHeight;
  7472. var n;
  7473. t.contains(e.scrollbarXRail) || (n = s.queryChildren(t, ".ps-scrollbar-x-rail"), n.length > 0 && n.forEach(function(t) {
  7474. s.remove(t)
  7475. }), s.appendTo(e.scrollbarXRail, t)), t.contains(e.scrollbarYRail) || (n = s.queryChildren(t, ".ps-scrollbar-y-rail"), n.length > 0 && n.forEach(function(t) {
  7476. s.remove(t)
  7477. }), s.appendTo(e.scrollbarYRail, t)), !e.settings.suppressScrollX && e.containerWidth + e.settings.scrollXMarginOffset < e.contentWidth ? (e.scrollbarXActive = !0, e.railXWidth = e.containerWidth - e.railXMarginWidth, e.railXRatio = e.containerWidth / e.railXWidth, e.scrollbarXWidth = r(e, l.toInt(e.railXWidth * e.containerWidth / e.contentWidth)), e.scrollbarXLeft = l.toInt((e.negativeScrollAdjustment + t.scrollLeft) * (e.railXWidth - e.scrollbarXWidth) / (e.contentWidth - e.containerWidth))) : e.scrollbarXActive = !1, !e.settings.suppressScrollY && e.containerHeight + e.settings.scrollYMarginOffset < e.contentHeight ? (e.scrollbarYActive = !0, e.railYHeight = e.containerHeight - e.railYMarginHeight, e.railYRatio = e.containerHeight / e.railYHeight, e.scrollbarYHeight = r(e, l.toInt(e.railYHeight * e.containerHeight / e.contentHeight)), e.scrollbarYTop = l.toInt(t.scrollTop * (e.railYHeight - e.scrollbarYHeight) / (e.contentHeight - e.containerHeight))) : e.scrollbarYActive = !1, e.scrollbarXLeft >= e.railXWidth - e.scrollbarXWidth && (e.scrollbarXLeft = e.railXWidth - e.scrollbarXWidth), e.scrollbarYTop >= e.railYHeight - e.scrollbarYHeight && (e.scrollbarYTop = e.railYHeight - e.scrollbarYHeight), o(t, e), e.scrollbarXActive ? i.add(t, "ps-active-x") : (i.remove(t, "ps-active-x"), e.scrollbarXWidth = 0, e.scrollbarXLeft = 0, c(t, "left", 0)), e.scrollbarYActive ? i.add(t, "ps-active-y") : (i.remove(t, "ps-active-y"), e.scrollbarYHeight = 0, e.scrollbarYTop = 0, c(t, "top", 0))
  7478. }
  7479. }, {
  7480. "../lib/class": 2,
  7481. "../lib/dom": 3,
  7482. "../lib/helper": 6,
  7483. "./instances": 18,
  7484. "./update-scroll": 20
  7485. }],
  7486. 20: [function(t, e, n) {
  7487. "use strict";
  7488. var r, o, l = t("./instances"),
  7489. i = function(t) {
  7490. var e = document.createEvent("Event");
  7491. return e.initEvent(t, !0, !0), e
  7492. };
  7493. e.exports = function(t, e, n) {
  7494. if ("undefined" == typeof t) throw "You must provide an element to the update-scroll function";
  7495. if ("undefined" == typeof e) throw "You must provide an axis to the update-scroll function";
  7496. if ("undefined" == typeof n) throw "You must provide a value to the update-scroll function";
  7497. "top" === e && n <= 0 && (t.scrollTop = n = 0, t.dispatchEvent(i("ps-y-reach-start"))), "left" === e && n <= 0 && (t.scrollLeft = n = 0, t.dispatchEvent(i("ps-x-reach-start")));
  7498. var s = l.get(t);
  7499. "top" === e && n >= s.contentHeight - s.containerHeight && (n = s.contentHeight - s.containerHeight, n - t.scrollTop <= 1 ? n = t.scrollTop : t.scrollTop = n, t.dispatchEvent(i("ps-y-reach-end"))), "left" === e && n >= s.contentWidth - s.containerWidth && (n = s.contentWidth - s.containerWidth, n - t.scrollLeft <= 1 ? n = t.scrollLeft : t.scrollLeft = n, t.dispatchEvent(i("ps-x-reach-end"))), r || (r = t.scrollTop), o || (o = t.scrollLeft), "top" === e && n < r && t.dispatchEvent(i("ps-scroll-up")), "top" === e && n > r && t.dispatchEvent(i("ps-scroll-down")), "left" === e && n < o && t.dispatchEvent(i("ps-scroll-left")), "left" === e && n > o && t.dispatchEvent(i("ps-scroll-right")), "top" === e && (t.scrollTop = r = n, t.dispatchEvent(i("ps-scroll-y"))), "left" === e && (t.scrollLeft = o = n, t.dispatchEvent(i("ps-scroll-x")))
  7500. }
  7501. }, {
  7502. "./instances": 18
  7503. }],
  7504. 21: [function(t, e, n) {
  7505. "use strict";
  7506. var r = t("../lib/helper"),
  7507. o = t("../lib/dom"),
  7508. l = t("./instances"),
  7509. i = t("./update-geometry"),
  7510. s = t("./update-scroll");
  7511. e.exports = function(t) {
  7512. var e = l.get(t);
  7513. e && (e.negativeScrollAdjustment = e.isNegativeScroll ? t.scrollWidth - t.clientWidth : 0, o.css(e.scrollbarXRail, "display", "block"), o.css(e.scrollbarYRail, "display", "block"), e.railXMarginWidth = r.toInt(o.css(e.scrollbarXRail, "marginLeft")) + r.toInt(o.css(e.scrollbarXRail, "marginRight")), e.railYMarginHeight = r.toInt(o.css(e.scrollbarYRail, "marginTop")) + r.toInt(o.css(e.scrollbarYRail, "marginBottom")), o.css(e.scrollbarXRail, "display", "none"), o.css(e.scrollbarYRail, "display", "none"), i(t), s(t, "top", t.scrollTop), s(t, "left", t.scrollLeft), o.css(e.scrollbarXRail, "display", ""), o.css(e.scrollbarYRail, "display", ""))
  7514. }
  7515. }, {
  7516. "../lib/dom": 3,
  7517. "../lib/helper": 6,
  7518. "./instances": 18,
  7519. "./update-geometry": 19,
  7520. "./update-scroll": 20
  7521. }]
  7522. }, {}, [1]);
  7523. (function($) {
  7524. var SelectBox = this.SelectBox = function(select, options) {
  7525. if (select instanceof jQuery) {
  7526. if (select.length > 0) {
  7527. select = select[0]
  7528. } else {
  7529. return
  7530. }
  7531. }
  7532. this.typeTimer = null;
  7533. this.typeSearch = '';
  7534. this.isMac = navigator.platform.match(/mac/i);
  7535. options = 'object' === typeof options ? options : {};
  7536. this.selectElement = select;
  7537. if (!options.mobile && navigator.userAgent.match(/iPad|iPhone|Android|IEMobile|BlackBerry/i)) {
  7538. return !1
  7539. }
  7540. if ('select' !== select.tagName.toLowerCase()) {
  7541. return !1
  7542. }
  7543. this.init(options)
  7544. };
  7545. SelectBox.prototype.version = '1.2.0';
  7546. SelectBox.prototype.init = function(options) {
  7547. var select = $(this.selectElement);
  7548. if (select.data('selectBox-control')) {
  7549. return !1
  7550. }
  7551. var control = $('<a class="selectBox" />'),
  7552. inline = select.attr('multiple') || parseInt(select.attr('size')) > 1,
  7553. settings = options || {},
  7554. tabIndex = parseInt(select.prop('tabindex')) || 0,
  7555. self = this;
  7556. control.width(select.outerWidth()).addClass(select.attr('class')).attr('title', select.attr('title') || '').attr('tabindex', tabIndex).css('display', 'inline-block').bind('focus.selectBox', function() {
  7557. if (this !== document.activeElement && document.body !== document.activeElement) {
  7558. $(document.activeElement).blur()
  7559. }
  7560. if (control.hasClass('selectBox-active')) {
  7561. return
  7562. }
  7563. control.addClass('selectBox-active');
  7564. select.trigger('focus')
  7565. }).bind('blur.selectBox', function() {
  7566. if (!control.hasClass('selectBox-active')) {
  7567. return
  7568. }
  7569. control.removeClass('selectBox-active');
  7570. select.trigger('blur')
  7571. });
  7572. if (!$(window).data('selectBox-bindings')) {
  7573. $(window).data('selectBox-bindings', !0).bind('scroll.selectBox', (settings.hideOnWindowScroll) ? this.hideMenus : $.noop).bind('resize.selectBox', this.hideMenus)
  7574. }
  7575. if (select.attr('disabled')) {
  7576. control.addClass('selectBox-disabled')
  7577. }
  7578. select.bind('click.selectBox', function(event) {
  7579. control.focus();
  7580. event.preventDefault()
  7581. });
  7582. if (inline) {
  7583. options = this.getOptions('inline');
  7584. control.append(options).data('selectBox-options', options).addClass('selectBox-inline selectBox-menuShowing').bind('keydown.selectBox', function(event) {
  7585. self.handleKeyDown(event)
  7586. }).bind('keypress.selectBox', function(event) {
  7587. self.handleKeyPress(event)
  7588. }).bind('mousedown.selectBox', function(event) {
  7589. if (1 !== event.which) {
  7590. return
  7591. }
  7592. if ($(event.target).is('A.selectBox-inline')) {
  7593. event.preventDefault()
  7594. }
  7595. if (!control.hasClass('selectBox-focus')) {
  7596. control.focus()
  7597. }
  7598. }).insertAfter(select);
  7599. if (!select[0].style.height) {
  7600. var size = select.attr('size') ? parseInt(select.attr('size')) : 5;
  7601. var tmp = control.clone().removeAttr('id').css({
  7602. position: 'absolute',
  7603. top: '-9999em'
  7604. }).show().appendTo('body');
  7605. tmp.find('.selectBox-options').html('<li><a>\u00A0</a></li>');
  7606. var optionHeight = parseInt(tmp.find('.selectBox-options A:first').html('&nbsp;').outerHeight());
  7607. tmp.remove();
  7608. control.height(optionHeight * size)
  7609. }
  7610. this.disableSelection(control)
  7611. } else {
  7612. var label = $('<span class="selectBox-label" />'),
  7613. arrow = $('<span class="selectBox-arrow" />');
  7614. label.attr('class', this.getLabelClass()).text(this.getLabelText());
  7615. options = this.getOptions('dropdown');
  7616. options.appendTo('BODY');
  7617. control.data('selectBox-options', options).addClass('selectBox-dropdown').append(label).append(arrow).bind('mousedown.selectBox', function(event) {
  7618. if (1 === event.which) {
  7619. if (control.hasClass('selectBox-menuShowing')) {
  7620. self.hideMenus()
  7621. } else {
  7622. event.stopPropagation();
  7623. options.data('selectBox-down-at-x', event.screenX).data('selectBox-down-at-y', event.screenY);
  7624. self.showMenu()
  7625. }
  7626. }
  7627. }).bind('keydown.selectBox', function(event) {
  7628. self.handleKeyDown(event)
  7629. }).bind('keypress.selectBox', function(event) {
  7630. self.handleKeyPress(event)
  7631. }).bind('open.selectBox', function(event, triggerData) {
  7632. if (triggerData && triggerData._selectBox === !0) {
  7633. return
  7634. }
  7635. self.showMenu()
  7636. }).bind('close.selectBox', function(event, triggerData) {
  7637. if (triggerData && triggerData._selectBox === !0) {
  7638. return
  7639. }
  7640. self.hideMenus()
  7641. }).insertAfter(select);
  7642. var labelWidth = control.width() - arrow.outerWidth() - (parseInt(label.css('paddingLeft')) || 0) - (parseInt(label.css('paddingRight')) || 0);
  7643. label.width(labelWidth);
  7644. this.disableSelection(control)
  7645. }
  7646. select.addClass('selectBox').data('selectBox-control', control).data('selectBox-settings', settings).hide()
  7647. };
  7648. SelectBox.prototype.getOptions = function(type) {
  7649. var options;
  7650. var select = $(this.selectElement);
  7651. var self = this;
  7652. var _getOptions = function(select, options) {
  7653. select.children('OPTION, OPTGROUP').each(function() {
  7654. if ($(this).is('OPTION')) {
  7655. if ($(this).length > 0) {
  7656. self.generateOptions($(this), options)
  7657. } else {
  7658. options.append('<li>\u00A0</li>')
  7659. }
  7660. } else {
  7661. var optgroup = $('<li class="selectBox-optgroup" />');
  7662. optgroup.text($(this).attr('label'));
  7663. options.append(optgroup);
  7664. options = _getOptions($(this), options)
  7665. }
  7666. });
  7667. return options
  7668. };
  7669. switch (type) {
  7670. case 'inline':
  7671. options = $('<ul class="selectBox-options" />');
  7672. options = _getOptions(select, options);
  7673. options.find('A').bind('mouseover.selectBox', function(event) {
  7674. self.addHover($(this).parent())
  7675. }).bind('mouseout.selectBox', function(event) {
  7676. self.removeHover($(this).parent())
  7677. }).bind('mousedown.selectBox', function(event) {
  7678. if (1 !== event.which) {
  7679. return
  7680. }
  7681. event.preventDefault();
  7682. if (!select.selectBox('control').hasClass('selectBox-active')) {
  7683. select.selectBox('control').focus()
  7684. }
  7685. }).bind('mouseup.selectBox', function(event) {
  7686. if (1 !== event.which) {
  7687. return
  7688. }
  7689. self.hideMenus();
  7690. self.selectOption($(this).parent(), event)
  7691. });
  7692. this.disableSelection(options);
  7693. return options;
  7694. case 'dropdown':
  7695. options = $('<ul class="selectBox-dropdown-menu selectBox-options" />');
  7696. options = _getOptions(select, options);
  7697. options.data('selectBox-select', select).css('display', 'none').appendTo('BODY').find('A').bind('mousedown.selectBox', function(event) {
  7698. if (event.which === 1) {
  7699. event.preventDefault();
  7700. if (event.screenX === options.data('selectBox-down-at-x') && event.screenY === options.data('selectBox-down-at-y')) {
  7701. options.removeData('selectBox-down-at-x').removeData('selectBox-down-at-y');
  7702. if (/android/i.test(navigator.userAgent.toLowerCase()) && /chrome/i.test(navigator.userAgent.toLowerCase())) {
  7703. self.selectOption($(this).parent())
  7704. }
  7705. self.hideMenus()
  7706. }
  7707. }
  7708. }).bind('mouseup.selectBox', function(event) {
  7709. if (1 !== event.which) {
  7710. return
  7711. }
  7712. if (event.screenX === options.data('selectBox-down-at-x') && event.screenY === options.data('selectBox-down-at-y')) {
  7713. return
  7714. } else {
  7715. options.removeData('selectBox-down-at-x').removeData('selectBox-down-at-y')
  7716. }
  7717. self.selectOption($(this).parent());
  7718. self.hideMenus()
  7719. }).bind('mouseover.selectBox', function(event) {
  7720. self.addHover($(this).parent())
  7721. }).bind('mouseout.selectBox', function(event) {
  7722. self.removeHover($(this).parent())
  7723. });
  7724. var classes = select.attr('class') || '';
  7725. if ('' !== classes) {
  7726. classes = classes.split(' ');
  7727. for (var i = 0; i < classes.length; i++) {
  7728. options.addClass(classes[i] + '-selectBox-dropdown-menu')
  7729. }
  7730. }
  7731. this.disableSelection(options);
  7732. return options
  7733. }
  7734. };
  7735. SelectBox.prototype.getLabelClass = function() {
  7736. var selected = $(this.selectElement).find('OPTION:selected');
  7737. return ('selectBox-label ' + (selected.attr('class') || '')).replace(/\s+$/, '')
  7738. };
  7739. SelectBox.prototype.getLabelText = function() {
  7740. var selected = $(this.selectElement).find('OPTION:selected');
  7741. return selected.text() || '\u00A0'
  7742. };
  7743. SelectBox.prototype.setLabel = function() {
  7744. var select = $(this.selectElement);
  7745. var control = select.data('selectBox-control');
  7746. if (!control) {
  7747. return
  7748. }
  7749. control.find('.selectBox-label').attr('class', this.getLabelClass()).text(this.getLabelText())
  7750. };
  7751. SelectBox.prototype.destroy = function() {
  7752. var select = $(this.selectElement);
  7753. var control = select.data('selectBox-control');
  7754. if (!control) {
  7755. return
  7756. }
  7757. var options = control.data('selectBox-options');
  7758. options.remove();
  7759. control.remove();
  7760. select.removeClass('selectBox').removeData('selectBox-control').data('selectBox-control', null).removeData('selectBox-settings').data('selectBox-settings', null).show()
  7761. };
  7762. SelectBox.prototype.refresh = function() {
  7763. var select = $(this.selectElement),
  7764. control = select.data('selectBox-control'),
  7765. type = control.hasClass('selectBox-dropdown') ? 'dropdown' : 'inline',
  7766. options;
  7767. control.data('selectBox-options').remove();
  7768. options = this.getOptions(type);
  7769. control.data('selectBox-options', options);
  7770. switch (type) {
  7771. case 'inline':
  7772. control.append(options);
  7773. break;
  7774. case 'dropdown':
  7775. this.setLabel();
  7776. $("BODY").append(options);
  7777. break
  7778. }
  7779. if ('dropdown' === type && control.hasClass('selectBox-menuShowing')) {
  7780. this.showMenu()
  7781. }
  7782. };
  7783. SelectBox.prototype.showMenu = function() {
  7784. var self = this,
  7785. select = $(this.selectElement),
  7786. control = select.data('selectBox-control'),
  7787. settings = select.data('selectBox-settings'),
  7788. options = control.data('selectBox-options');
  7789. if (control.hasClass('selectBox-disabled')) {
  7790. return !1
  7791. }
  7792. this.hideMenus();
  7793. var borderBottomWidth = parseInt(control.css('borderBottomWidth')) || 0;
  7794. var borderTopWidth = parseInt(control.css('borderTopWidth')) || 0;
  7795. var pos = control.offset(),
  7796. topPositionCorrelation = (settings.topPositionCorrelation) ? settings.topPositionCorrelation : 0,
  7797. bottomPositionCorrelation = (settings.bottomPositionCorrelation) ? settings.bottomPositionCorrelation : 0,
  7798. optionsHeight = options.outerHeight(),
  7799. controlHeight = control.outerHeight(),
  7800. maxHeight = parseInt(options.css('max-height')),
  7801. scrollPos = $(window).scrollTop(),
  7802. heightToTop = pos.top - scrollPos,
  7803. heightToBottom = $(window).height() - (heightToTop + controlHeight),
  7804. posTop = (heightToTop > heightToBottom) && (settings.keepInViewport == null ? !0 : settings.keepInViewport),
  7805. top = posTop ? pos.top - optionsHeight + borderTopWidth + topPositionCorrelation : pos.top + controlHeight - borderBottomWidth - bottomPositionCorrelation;
  7806. if (heightToTop < maxHeight && heightToBottom < maxHeight) {
  7807. if (posTop) {
  7808. var maxHeightDiff = maxHeight - (heightToTop - 5);
  7809. options.css({
  7810. 'max-height': maxHeight - maxHeightDiff + 'px'
  7811. });
  7812. top = top + maxHeightDiff
  7813. } else {
  7814. var maxHeightDiff = maxHeight - (heightToBottom - 5);
  7815. options.css({
  7816. 'max-height': maxHeight - maxHeightDiff + 'px'
  7817. })
  7818. }
  7819. }
  7820. options.data('posTop', posTop);
  7821. options.width(control.innerWidth()).css({
  7822. top: top,
  7823. left: control.offset().left
  7824. }).addClass('selectBox-options selectBox-options-' + (posTop ? 'top' : 'bottom'));
  7825. if (select.triggerHandler('beforeopen')) {
  7826. return !1
  7827. }
  7828. var dispatchOpenEvent = function() {
  7829. select.triggerHandler('open', {
  7830. _selectBox: !0
  7831. })
  7832. };
  7833. switch (settings.menuTransition) {
  7834. case 'fade':
  7835. options.fadeIn(settings.menuSpeed, dispatchOpenEvent);
  7836. break;
  7837. case 'slide':
  7838. options.slideDown(settings.menuSpeed, dispatchOpenEvent);
  7839. break;
  7840. default:
  7841. options.show(settings.menuSpeed, dispatchOpenEvent);
  7842. break
  7843. }
  7844. if (!settings.menuSpeed) {
  7845. dispatchOpenEvent()
  7846. }
  7847. var li = options.find('.selectBox-selected:first');
  7848. this.keepOptionInView(li, !0);
  7849. this.addHover(li);
  7850. control.addClass('selectBox-menuShowing selectBox-menuShowing-' + (posTop ? 'top' : 'bottom'));
  7851. $(document).bind('mousedown.selectBox', function(event) {
  7852. if (1 === event.which) {
  7853. if ($(event.target).parents().andSelf().hasClass('selectBox-options')) {
  7854. return
  7855. }
  7856. self.hideMenus()
  7857. }
  7858. })
  7859. };
  7860. SelectBox.prototype.hideMenus = function() {
  7861. if ($(".selectBox-dropdown-menu:visible").length === 0) {
  7862. return
  7863. }
  7864. $(document).unbind('mousedown.selectBox');
  7865. $(".selectBox-dropdown-menu").each(function() {
  7866. var options = $(this),
  7867. select = options.data('selectBox-select'),
  7868. control = select.data('selectBox-control'),
  7869. settings = select.data('selectBox-settings'),
  7870. posTop = options.data('posTop');
  7871. if (select.triggerHandler('beforeclose')) {
  7872. return !1
  7873. }
  7874. var dispatchCloseEvent = function() {
  7875. select.triggerHandler('close', {
  7876. _selectBox: !0
  7877. })
  7878. };
  7879. if (settings) {
  7880. switch (settings.menuTransition) {
  7881. case 'fade':
  7882. options.fadeOut(settings.menuSpeed, dispatchCloseEvent);
  7883. break;
  7884. case 'slide':
  7885. options.slideUp(settings.menuSpeed, dispatchCloseEvent);
  7886. break;
  7887. default:
  7888. options.hide(settings.menuSpeed, dispatchCloseEvent);
  7889. break
  7890. }
  7891. if (!settings.menuSpeed) {
  7892. dispatchCloseEvent()
  7893. }
  7894. control.removeClass('selectBox-menuShowing selectBox-menuShowing-' + (posTop ? 'top' : 'bottom'))
  7895. } else {
  7896. $(this).hide();
  7897. $(this).triggerHandler('close', {
  7898. _selectBox: !0
  7899. });
  7900. $(this).removeClass('selectBox-menuShowing selectBox-menuShowing-' + (posTop ? 'top' : 'bottom'))
  7901. }
  7902. options.css('max-height', '');
  7903. options.removeClass('selectBox-options-' + (posTop ? 'top' : 'bottom'));
  7904. options.data('posTop', !1)
  7905. })
  7906. };
  7907. SelectBox.prototype.selectOption = function(li, event) {
  7908. var select = $(this.selectElement);
  7909. li = $(li);
  7910. var control = select.data('selectBox-control'),
  7911. settings = select.data('selectBox-settings');
  7912. if (control.hasClass('selectBox-disabled')) {
  7913. return !1
  7914. }
  7915. if (0 === li.length || li.hasClass('selectBox-disabled')) {
  7916. return !1
  7917. }
  7918. if (select.attr('multiple')) {
  7919. if (event.shiftKey && control.data('selectBox-last-selected')) {
  7920. li.toggleClass('selectBox-selected');
  7921. var affectedOptions;
  7922. if (li.index() > control.data('selectBox-last-selected').index()) {
  7923. affectedOptions = li.siblings().slice(control.data('selectBox-last-selected').index(), li.index())
  7924. } else {
  7925. affectedOptions = li.siblings().slice(li.index(), control.data('selectBox-last-selected').index())
  7926. }
  7927. affectedOptions = affectedOptions.not('.selectBox-optgroup, .selectBox-disabled');
  7928. if (li.hasClass('selectBox-selected')) {
  7929. affectedOptions.addClass('selectBox-selected')
  7930. } else {
  7931. affectedOptions.removeClass('selectBox-selected')
  7932. }
  7933. } else if ((this.isMac && event.metaKey) || (!this.isMac && event.ctrlKey)) {
  7934. li.toggleClass('selectBox-selected')
  7935. } else {
  7936. li.siblings().removeClass('selectBox-selected');
  7937. li.addClass('selectBox-selected')
  7938. }
  7939. } else {
  7940. li.siblings().removeClass('selectBox-selected');
  7941. li.addClass('selectBox-selected')
  7942. }
  7943. if (control.hasClass('selectBox-dropdown')) {
  7944. control.find('.selectBox-label').text(li.text())
  7945. }
  7946. var i = 0,
  7947. selection = [];
  7948. if (select.attr('multiple')) {
  7949. control.find('.selectBox-selected A').each(function() {
  7950. selection[i++] = $(this).attr('rel')
  7951. })
  7952. } else {
  7953. selection = li.find('A').attr('rel')
  7954. }
  7955. control.data('selectBox-last-selected', li);
  7956. if (select.val() !== selection) {
  7957. select.val(selection);
  7958. this.setLabel();
  7959. select.trigger('change')
  7960. }
  7961. return !0
  7962. };
  7963. SelectBox.prototype.addHover = function(li) {
  7964. li = $(li);
  7965. var select = $(this.selectElement),
  7966. control = select.data('selectBox-control'),
  7967. options = control.data('selectBox-options');
  7968. options.find('.selectBox-hover').removeClass('selectBox-hover');
  7969. li.addClass('selectBox-hover')
  7970. };
  7971. SelectBox.prototype.getSelectElement = function() {
  7972. return this.selectElement
  7973. };
  7974. SelectBox.prototype.removeHover = function(li) {
  7975. li = $(li);
  7976. var select = $(this.selectElement),
  7977. control = select.data('selectBox-control'),
  7978. options = control.data('selectBox-options');
  7979. options.find('.selectBox-hover').removeClass('selectBox-hover')
  7980. };
  7981. SelectBox.prototype.keepOptionInView = function(li, center) {
  7982. if (!li || li.length === 0) {
  7983. return
  7984. }
  7985. var select = $(this.selectElement),
  7986. control = select.data('selectBox-control'),
  7987. options = control.data('selectBox-options'),
  7988. scrollBox = control.hasClass('selectBox-dropdown') ? options : options.parent(),
  7989. top = parseInt(li.offset().top - scrollBox.position().top),
  7990. bottom = parseInt(top + li.outerHeight());
  7991. if (center) {
  7992. scrollBox.scrollTop(li.offset().top - scrollBox.offset().top + scrollBox.scrollTop() - (scrollBox.height() / 2))
  7993. } else {
  7994. if (top < 0) {
  7995. scrollBox.scrollTop(li.offset().top - scrollBox.offset().top + scrollBox.scrollTop())
  7996. }
  7997. if (bottom > scrollBox.height()) {
  7998. scrollBox.scrollTop((li.offset().top + li.outerHeight()) - scrollBox.offset().top + scrollBox.scrollTop() - scrollBox.height())
  7999. }
  8000. }
  8001. };
  8002. SelectBox.prototype.handleKeyDown = function(event) {
  8003. var select = $(this.selectElement),
  8004. control = select.data('selectBox-control'),
  8005. options = control.data('selectBox-options'),
  8006. settings = select.data('selectBox-settings'),
  8007. totalOptions = 0,
  8008. i = 0;
  8009. if (control.hasClass('selectBox-disabled')) {
  8010. return
  8011. }
  8012. switch (event.keyCode) {
  8013. case 8:
  8014. event.preventDefault();
  8015. this.typeSearch = '';
  8016. break;
  8017. case 9:
  8018. case 27:
  8019. this.hideMenus();
  8020. this.removeHover();
  8021. break;
  8022. case 13:
  8023. if (control.hasClass('selectBox-menuShowing')) {
  8024. this.selectOption(options.find('LI.selectBox-hover:first'), event);
  8025. if (control.hasClass('selectBox-dropdown')) {
  8026. this.hideMenus()
  8027. }
  8028. } else {
  8029. this.showMenu()
  8030. }
  8031. break;
  8032. case 38:
  8033. case 37:
  8034. event.preventDefault();
  8035. if (control.hasClass('selectBox-menuShowing')) {
  8036. var prev = options.find('.selectBox-hover').prev('LI');
  8037. totalOptions = options.find('LI:not(.selectBox-optgroup)').length;
  8038. i = 0;
  8039. while (prev.length === 0 || prev.hasClass('selectBox-disabled') || prev.hasClass('selectBox-optgroup')) {
  8040. prev = prev.prev('LI');
  8041. if (prev.length === 0) {
  8042. if (settings.loopOptions) {
  8043. prev = options.find('LI:last')
  8044. } else {
  8045. prev = options.find('LI:first')
  8046. }
  8047. }
  8048. if (++i >= totalOptions) {
  8049. break
  8050. }
  8051. }
  8052. this.addHover(prev);
  8053. this.selectOption(prev, event);
  8054. this.keepOptionInView(prev)
  8055. } else {
  8056. this.showMenu()
  8057. }
  8058. break;
  8059. case 40:
  8060. case 39:
  8061. event.preventDefault();
  8062. if (control.hasClass('selectBox-menuShowing')) {
  8063. var next = options.find('.selectBox-hover').next('LI');
  8064. totalOptions = options.find('LI:not(.selectBox-optgroup)').length;
  8065. i = 0;
  8066. while (0 === next.length || next.hasClass('selectBox-disabled') || next.hasClass('selectBox-optgroup')) {
  8067. next = next.next('LI');
  8068. if (next.length === 0) {
  8069. if (settings.loopOptions) {
  8070. next = options.find('LI:first')
  8071. } else {
  8072. next = options.find('LI:last')
  8073. }
  8074. }
  8075. if (++i >= totalOptions) {
  8076. break
  8077. }
  8078. }
  8079. this.addHover(next);
  8080. this.selectOption(next, event);
  8081. this.keepOptionInView(next)
  8082. } else {
  8083. this.showMenu()
  8084. }
  8085. break
  8086. }
  8087. };
  8088. SelectBox.prototype.handleKeyPress = function(event) {
  8089. var select = $(this.selectElement),
  8090. control = select.data('selectBox-control'),
  8091. options = control.data('selectBox-options'),
  8092. self = this;
  8093. if (control.hasClass('selectBox-disabled')) {
  8094. return
  8095. }
  8096. switch (event.keyCode) {
  8097. case 9:
  8098. case 27:
  8099. case 13:
  8100. case 38:
  8101. case 37:
  8102. case 40:
  8103. case 39:
  8104. break;
  8105. default:
  8106. if (!control.hasClass('selectBox-menuShowing')) {
  8107. this.showMenu()
  8108. }
  8109. event.preventDefault();
  8110. clearTimeout(this.typeTimer);
  8111. this.typeSearch += String.fromCharCode(event.charCode || event.keyCode);
  8112. options.find('A').each(function() {
  8113. if ($(this).text().substr(0, self.typeSearch.length).toLowerCase() === self.typeSearch.toLowerCase()) {
  8114. self.addHover($(this).parent());
  8115. self.selectOption($(this).parent(), event);
  8116. self.keepOptionInView($(this).parent());
  8117. return !1
  8118. }
  8119. });
  8120. this.typeTimer = setTimeout(function() {
  8121. self.typeSearch = ''
  8122. }, 1000);
  8123. break
  8124. }
  8125. };
  8126. SelectBox.prototype.enable = function() {
  8127. var select = $(this.selectElement);
  8128. select.prop('disabled', !1);
  8129. var control = select.data('selectBox-control');
  8130. if (!control) {
  8131. return
  8132. }
  8133. control.removeClass('selectBox-disabled')
  8134. };
  8135. SelectBox.prototype.disable = function() {
  8136. var select = $(this.selectElement);
  8137. select.prop('disabled', !0);
  8138. var control = select.data('selectBox-control');
  8139. if (!control) {
  8140. return
  8141. }
  8142. control.addClass('selectBox-disabled')
  8143. };
  8144. SelectBox.prototype.setValue = function(value) {
  8145. var select = $(this.selectElement);
  8146. select.val(value);
  8147. value = select.val();
  8148. if (null === value) {
  8149. value = select.children().first().val();
  8150. select.val(value)
  8151. }
  8152. var control = select.data('selectBox-control');
  8153. if (!control) {
  8154. return
  8155. }
  8156. var settings = select.data('selectBox-settings'),
  8157. options = control.data('selectBox-options');
  8158. this.setLabel();
  8159. options.find('.selectBox-selected').removeClass('selectBox-selected');
  8160. options.find('A').each(function() {
  8161. if (typeof(value) === 'object') {
  8162. for (var i = 0; i < value.length; i++) {
  8163. if ($(this).attr('rel') == value[i]) {
  8164. $(this).parent().addClass('selectBox-selected')
  8165. }
  8166. }
  8167. } else {
  8168. if ($(this).attr('rel') == value) {
  8169. $(this).parent().addClass('selectBox-selected')
  8170. }
  8171. }
  8172. });
  8173. if (settings.change) {
  8174. settings.change.call(select)
  8175. }
  8176. };
  8177. SelectBox.prototype.setOptions = function(options) {
  8178. var select = $(this.selectElement),
  8179. control = select.data('selectBox-control');
  8180. switch (typeof(options)) {
  8181. case 'string':
  8182. select.html(options);
  8183. break;
  8184. case 'object':
  8185. select.html('');
  8186. for (var i in options) {
  8187. if (options[i] === null) {
  8188. continue
  8189. }
  8190. if (typeof(options[i]) === 'object') {
  8191. var optgroup = $('<optgroup label="' + i + '" />');
  8192. for (var j in options[i]) {
  8193. optgroup.append('<option value="' + j + '">' + options[i][j] + '</option>')
  8194. }
  8195. select.append(optgroup)
  8196. } else {
  8197. var option = $('<option value="' + i + '">' + options[i] + '</option>');
  8198. select.append(option)
  8199. }
  8200. }
  8201. break
  8202. }
  8203. if (control) {
  8204. this.refresh()
  8205. }
  8206. };
  8207. SelectBox.prototype.disableSelection = function(selector) {
  8208. $(selector).css('MozUserSelect', 'none').bind('selectstart', function(event) {
  8209. event.preventDefault()
  8210. })
  8211. };
  8212. SelectBox.prototype.generateOptions = function(self, options) {
  8213. var li = $('<li />'),
  8214. a = $('<a />');
  8215. li.addClass(self.attr('class'));
  8216. li.data(self.data());
  8217. a.attr('rel', self.val()).text(self.text());
  8218. li.append(a);
  8219. if (self.attr('disabled')) {
  8220. li.addClass('selectBox-disabled')
  8221. }
  8222. if (self.attr('selected')) {
  8223. li.addClass('selectBox-selected')
  8224. }
  8225. options.append(li)
  8226. };
  8227. $.extend($.fn, {
  8228. selectBox: function(method, options) {
  8229. var selectBox;
  8230. switch (method) {
  8231. case 'control':
  8232. return $(this).data('selectBox-control');
  8233. case 'settings':
  8234. if (!options) {
  8235. return $(this).data('selectBox-settings')
  8236. }
  8237. $(this).each(function() {
  8238. $(this).data('selectBox-settings', $.extend(!0, $(this).data('selectBox-settings'), options))
  8239. });
  8240. break;
  8241. case 'options':
  8242. if (undefined === options) {
  8243. return $(this).data('selectBox-control').data('selectBox-options')
  8244. }
  8245. $(this).each(function() {
  8246. if (selectBox = $(this).data('selectBox')) {
  8247. selectBox.setOptions(options)
  8248. }
  8249. });
  8250. break;
  8251. case 'value':
  8252. if (undefined === options) {
  8253. return $(this).val()
  8254. }
  8255. $(this).each(function() {
  8256. if (selectBox = $(this).data('selectBox')) {
  8257. selectBox.setValue(options)
  8258. }
  8259. });
  8260. break;
  8261. case 'refresh':
  8262. $(this).each(function() {
  8263. if (selectBox = $(this).data('selectBox')) {
  8264. selectBox.refresh()
  8265. }
  8266. });
  8267. break;
  8268. case 'enable':
  8269. $(this).each(function() {
  8270. if (selectBox = $(this).data('selectBox')) {
  8271. selectBox.enable(this)
  8272. }
  8273. });
  8274. break;
  8275. case 'disable':
  8276. $(this).each(function() {
  8277. if (selectBox = $(this).data('selectBox')) {
  8278. selectBox.disable()
  8279. }
  8280. });
  8281. break;
  8282. case 'destroy':
  8283. $(this).each(function() {
  8284. if (selectBox = $(this).data('selectBox')) {
  8285. selectBox.destroy();
  8286. $(this).data('selectBox', null)
  8287. }
  8288. });
  8289. break;
  8290. case 'instance':
  8291. return $(this).data('selectBox');
  8292. default:
  8293. $(this).each(function(idx, select) {
  8294. if (!$(select).data('selectBox')) {
  8295. $(select).data('selectBox', new SelectBox(select, method))
  8296. }
  8297. });
  8298. break
  8299. }
  8300. return $(this)
  8301. }
  8302. })
  8303. })(jQuery);
  8304. (function(a) {
  8305. a.fn.extend({
  8306. customSelect: function(c) {
  8307. if (typeof document.body.style.maxHeight === "undefined") {
  8308. return this
  8309. }
  8310. var e = {
  8311. customClass: "customSelect",
  8312. mapClass: !0,
  8313. mapStyle: !0
  8314. },
  8315. c = a.extend(e, c),
  8316. d = c.customClass,
  8317. f = function(h, k) {
  8318. var g = h.find(":selected"),
  8319. j = k.children(":first"),
  8320. i = g.html() || "&nbsp;";
  8321. j.html(i);
  8322. if (g.attr("disabled")) {
  8323. k.addClass(b("DisabledOption"))
  8324. } else {
  8325. k.removeClass(b("DisabledOption"))
  8326. }
  8327. setTimeout(function() {
  8328. k.removeClass(b("Open"));
  8329. a(document).off("mouseup.customSelect")
  8330. }, 60)
  8331. },
  8332. b = function(g) {
  8333. return d + g
  8334. };
  8335. return this.each(function() {
  8336. var g = a(this),
  8337. i = a("<span />").addClass(b("Inner")),
  8338. h = a("<span />");
  8339. g.after(h.append(i));
  8340. h.addClass(d);
  8341. if (c.mapClass) {
  8342. h.addClass(g.attr("class"))
  8343. }
  8344. if (c.mapStyle) {
  8345. h.attr("style", g.attr("style"))
  8346. }
  8347. g.addClass("hasCustomSelect").on("render.customSelect", function() {
  8348. f(g, h);
  8349. g.css("width", "");
  8350. var k = parseInt(g.outerWidth(), 10) - (parseInt(h.outerWidth(), 10) - parseInt(h.width(), 10));
  8351. h.css({
  8352. display: "inline-block"
  8353. });
  8354. var j = h.outerHeight();
  8355. if (g.attr("disabled")) {
  8356. h.addClass(b("Disabled"))
  8357. } else {
  8358. h.removeClass(b("Disabled"))
  8359. }
  8360. i.css({
  8361. width: k,
  8362. display: "inline-block"
  8363. });
  8364. g.css({
  8365. "-webkit-appearance": "menulist-button",
  8366. width: h.outerWidth(),
  8367. position: "absolute",
  8368. opacity: 0,
  8369. height: j,
  8370. fontSize: h.css("font-size")
  8371. })
  8372. }).on("change.customSelect", function() {
  8373. h.addClass(b("Changed"));
  8374. f(g, h)
  8375. }).on("keyup.customSelect", function(j) {
  8376. if (!h.hasClass(b("Open"))) {
  8377. g.trigger("blur.customSelect");
  8378. g.trigger("focus.customSelect")
  8379. } else {
  8380. if (j.which == 13 || j.which == 27) {
  8381. f(g, h)
  8382. }
  8383. }
  8384. }).on("mousedown.customSelect", function() {
  8385. h.removeClass(b("Changed"))
  8386. }).on("mouseup.customSelect", function(j) {
  8387. if (!h.hasClass(b("Open"))) {
  8388. if (a("." + b("Open")).not(h).length > 0 && typeof InstallTrigger !== "undefined") {
  8389. g.trigger("focus.customSelect")
  8390. } else {
  8391. h.addClass(b("Open"));
  8392. j.stopPropagation();
  8393. a(document).one("mouseup.customSelect", function(k) {
  8394. if (k.target != g.get(0) && a.inArray(k.target, g.find("*").get()) < 0) {
  8395. g.trigger("blur.customSelect")
  8396. } else {
  8397. f(g, h)
  8398. }
  8399. })
  8400. }
  8401. }
  8402. }).on("focus.customSelect", function() {
  8403. h.removeClass(b("Changed")).addClass(b("Focus"))
  8404. }).on("blur.customSelect", function() {
  8405. h.removeClass(b("Focus") + " " + b("Open"))
  8406. }).on("mouseenter.customSelect", function() {
  8407. h.addClass(b("Hover"))
  8408. }).on("mouseleave.customSelect", function() {
  8409. h.removeClass(b("Hover"))
  8410. }).trigger("render.customSelect")
  8411. })
  8412. }
  8413. })
  8414. })(jQuery);
  8415. ! function(e) {
  8416. var t, o = {
  8417. className: "autosizejs",
  8418. id: "autosizejs",
  8419. append: "\n",
  8420. callback: !1,
  8421. resizeDelay: 10,
  8422. placeholder: !0
  8423. },
  8424. i = '<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>',
  8425. a = ["fontFamily", "fontSize", "fontWeight", "fontStyle", "letterSpacing", "textTransform", "wordSpacing", "textIndent", "whiteSpace"],
  8426. n = e(i).data("autosize", !0)[0];
  8427. n.style.lineHeight = "99px", "99px" === e(n).css("lineHeight") && a.push("lineHeight"), n.style.lineHeight = "", e.fn.autosize = function(i) {
  8428. return this.length ? (i = e.extend({}, o, i || {}), n.parentNode !== document.body && e(document.body).append(n), this.each(function() {
  8429. function o() {
  8430. var t, o = window.getComputedStyle ? window.getComputedStyle(u, null) : null;
  8431. o ? (t = parseFloat(o.width), ("border-box" === o.boxSizing || "border-box" === o.webkitBoxSizing || "border-box" === o.mozBoxSizing) && e.each(["paddingLeft", "paddingRight", "borderLeftWidth", "borderRightWidth"], function(e, i) {
  8432. t -= parseFloat(o[i])
  8433. })) : t = p.width(), n.style.width = Math.max(t, 0) + "px"
  8434. }
  8435.  
  8436. function s() {
  8437. var s = {};
  8438. if (t = u, n.className = i.className, n.id = i.id, d = parseFloat(p.css("maxHeight")), e.each(a, function(e, t) {
  8439. s[t] = p.css(t)
  8440. }), e(n).css(s).attr("wrap", p.attr("wrap")), o(), window.chrome) {
  8441. var r = u.style.width;
  8442. u.style.width = "0px"; {
  8443. u.offsetWidth
  8444. }
  8445. u.style.width = r
  8446. }
  8447. }
  8448.  
  8449. function r() {
  8450. var e, a;
  8451. t !== u ? s() : o(), n.value = !u.value && i.placeholder ? p.attr("placeholder") || "" : u.value, n.value += i.append || "", n.style.overflowY = u.style.overflowY, a = parseFloat(u.style.height) || 0, n.scrollTop = 0, n.scrollTop = 9e4, e = n.scrollTop, d && e > d ? (u.style.overflowY = "scroll", e = d) : (u.style.overflowY = "hidden", c > e && (e = c)), e += z, Math.abs(a - e) > .01 && (u.style.height = e + "px", n.className = n.className, w && i.callback.call(u, u), p.trigger("autosize.resized"))
  8452. }
  8453.  
  8454. function l() {
  8455. clearTimeout(h), h = setTimeout(function() {
  8456. var e = p.width();
  8457. e !== b && (b = e, r())
  8458. }, parseInt(i.resizeDelay, 10))
  8459. }
  8460. var d, c, h, u = this,
  8461. p = e(u),
  8462. z = 0,
  8463. w = e.isFunction(i.callback),
  8464. f = {
  8465. height: u.style.height,
  8466. overflow: u.style.overflow,
  8467. overflowY: u.style.overflowY,
  8468. wordWrap: u.style.wordWrap,
  8469. resize: u.style.resize
  8470. },
  8471. b = p.width(),
  8472. g = p.css("resize");
  8473. p.data("autosize") || (p.data("autosize", !0), ("border-box" === p.css("box-sizing") || "border-box" === p.css("-moz-box-sizing") || "border-box" === p.css("-webkit-box-sizing")) && (z = p.outerHeight() - p.height()), c = Math.max(parseFloat(p.css("minHeight")) - z || 0, p.height()), p.css({
  8474. overflow: "hidden",
  8475. overflowY: "hidden",
  8476. wordWrap: "break-word"
  8477. }), "vertical" === g ? p.css("resize", "none") : "both" === g && p.css("resize", "horizontal"), "onpropertychange" in u ? "oninput" in u ? p.on("input.autosize keyup.autosize", r) : p.on("propertychange.autosize", function() {
  8478. "value" === event.propertyName && r()
  8479. }) : p.on("input.autosize", r), i.resizeDelay !== !1 && e(window).on("resize.autosize", l), p.on("autosize.resize", r), p.on("autosize.resizeIncludeStyle", function() {
  8480. t = null, r()
  8481. }), p.on("autosize.destroy", function() {
  8482. t = null, clearTimeout(h), e(window).off("resize", l), p.off("autosize").off(".autosize").css(f).removeData("autosize")
  8483. }), r())
  8484. })) : this
  8485. }
  8486. }(jQuery || $);
  8487. (function($) {
  8488. jQuery.fn.efektUygula = function(methodName, speed) {
  8489. return this[methodName]((methodName == 'show' ? 0 : speed))
  8490. }
  8491. jQuery.fn.pTab = function(ayarlar) {
  8492. var ayar = jQuery.extend({
  8493. pEvent: 'click',
  8494. pTab: 'ul',
  8495. pTabElem: 'li',
  8496. pClass: 'aktif',
  8497. pContent: '.icerik',
  8498. pDuration: 500,
  8499. pEffect: 'show',
  8500. pAutoHeight: !1,
  8501. pUi: !1,
  8502. pUiEffect: 'fade',
  8503. pDebug: !1,
  8504. pSlide: !1,
  8505. pSlideWidth: 0,
  8506. pEasing: 'linear',
  8507. pSlidePrev: !1,
  8508. pSlideNext: !1,
  8509. pSlideLoop: !1,
  8510. pSlideLoopDuration: 500,
  8511. pMouseWheel: !1,
  8512. pElemFunc: !1,
  8513. pEventFunc: !1,
  8514. pKeyboardEvent: !1,
  8515. pActiveTab: 0
  8516. }, ayarlar);
  8517. return this.each(function() {
  8518. if (ayar.pDebug) {
  8519. if (ayar.pUi) {
  8520. if (!jQuery.ui) {
  8521. alert("Tab uygulaması için UI Kütüphanesini sayfanıza dahil etmeniz gerekiyor!")
  8522. }
  8523. }
  8524. var events = ['click', 'mouseenter', 'dblclick'];
  8525. if (jQuery.inArray(ayar.pEvent, events) == -1) {
  8526. alert(ayar.pEvent + " adında bir event tanımı yapamazsınız!\n[" + events.join(', ') + "]")
  8527. }
  8528. var effects = ['show', 'fadeIn', 'slideDown'];
  8529. if (jQuery.inArray(ayar.pEffect, effects) == -1) {
  8530. alert(ayar.pEffect + " adında bir efekt tanımı yapamazsınız!\n[" + effects.join(', ') + "]")
  8531. }
  8532. var uiEffects = ['fade', 'bounce', 'highlight', 'pulsate', 'shake', 'slide'];
  8533. if (jQuery.inArray(ayar.pUiEffect, uiEffects) == -1) {
  8534. alert(ayar.pUiEffect + " adında bir ui efekt tanımı yapamazsınız!\n[" + uiEffects.join(', ') + "]")
  8535. }
  8536. }
  8537. if (ayar.pElemFunc) {
  8538. ayar.pElemFunc()
  8539. }
  8540. var elem = jQuery(this),
  8541. indis = ayar.pActiveTab;
  8542. jQuery(ayar.pTab + " " + ayar.pTabElem + ":eq(" + ayar.pActiveTab + ")", elem).addClass(ayar.pClass);
  8543. if (ayar.pMouseWheel || ayar.pSlideLoop || ayar.pSlide || ayar.pSlideNext || ayar.pSlidePrev) {
  8544. var elemLength = jQuery(ayar.pContent, elem).length;
  8545. if (ayar.pSlide == !0) {
  8546. jQuery(ayar.pContent, elem).css("float", "left")
  8547. }
  8548. if (ayar.pSlideNext == !1 && ayar.pSlidePrev == !1) {
  8549. ayar.pSlideNext = !0;
  8550. ayar.pSlidePrev = !0
  8551. }
  8552. }
  8553. var pLoadFile = jQuery(ayar.pTab + " " + ayar.pTabElem + ":eq(" + ayar.pActiveTab + ")", elem).data("ploadfile");
  8554. if (pLoadFile) {
  8555. jQuery(ayar.pContent + ":eq(" + ayar.pActiveTab + ")", elem).load(pLoadFile, function() {
  8556. var height = jQuery(ayar.pContent + ":first", elem).outerHeight();
  8557. jQuery('div[rel=pSlideContent]', elem).stop().animate({
  8558. height: height + 'px'
  8559. }, {
  8560. duration: ayar.pDuration
  8561. })
  8562. })
  8563. }
  8564. var pIframe = jQuery(ayar.pTab + " " + ayar.pTabElem + ":first", elem).data("piframe");
  8565. if (pIframe) {
  8566. jQuery(ayar.pContent + ":eq(" + ayar.pActiveTab + ")", elem).html('<iframe src="' + pIframe.url + '" frameborder="0" width="' + pIframe.width + '" height="' + pIframe.height + '" style="display: none"></iframe>').append('<div class="loader">Tab İçeriği Yükleniyor..</div>').find("iframe").load(function() {
  8567. $(this).siblings(".loader").hide();
  8568. $(this).show();
  8569. var height = jQuery(ayar.pContent + ":first", elem).outerHeight();
  8570. jQuery('div[rel=pSlideContent]', elem).stop().animate({
  8571. height: height + 'px'
  8572. }, {
  8573. duration: ayar.pDuration
  8574. })
  8575. })
  8576. }
  8577. if (ayar.pSlide == !1) {
  8578. jQuery(ayar.pContent, elem).hide();
  8579. jQuery(ayar.pContent + ":eq(" + ayar.pActiveTab + ")", elem).show()
  8580. } else {
  8581. jQuery(ayar.pContent, elem).wrapAll('<div rel="pSlide"></div>');
  8582. jQuery('div[rel=pSlide]', elem).wrapAll('<div rel="pSlideContent"></div>');
  8583. if (ayar.pAutoHeight) {
  8584. var height = jQuery(ayar.pContent + ":first", elem).outerHeight()
  8585. }
  8586. jQuery('div[rel=pSlideContent]', elem).css({
  8587. "width": ayar.pSlideWidth,
  8588. "overflow": "hidden",
  8589. "height": height
  8590. });
  8591. jQuery('div[rel=pSlide]', elem).width(elemLength * ayar.pSlideWidth);
  8592. jQuery('div[rel=pSlide]', elem).css('margin-left', '-' + ayar.pActiveTab * ayar.pSlideWidth + 'px')
  8593. }
  8594. jQuery(ayar.pTab + " " + ayar.pTabElem, elem).bind(ayar.pEvent, function() {
  8595. if (!jQuery(this).is('.' + ayar.pClass)) {
  8596. if (ayar.pEventFunc) {
  8597. ayar.pEventFunc(jQuery(this))
  8598. }
  8599. indis = jQuery(this).index();
  8600. if (ayar.pDebug) {
  8601. if (!jQuery(ayar.pContent + ":eq(" + indis + ")", elem).length) {
  8602. alert(jQuery(this).text() + " nesnesine ait " + ayar.pContent + " nesnesi bulunamadı!");
  8603. return !1
  8604. }
  8605. }
  8606. var pLoadFile = $(this).data("ploadfile");
  8607. if (pLoadFile) {
  8608. jQuery(ayar.pContent + ":eq(" + indis + ")", elem).load(pLoadFile, function() {
  8609. var height = jQuery(ayar.pContent + ":eq(" + indis + ")", elem).outerHeight();
  8610. jQuery('div[rel=pSlideContent]', elem).stop().animate({
  8611. height: height + 'px'
  8612. }, {
  8613. duration: ayar.pDuration
  8614. })
  8615. })
  8616. }
  8617. var pIframe = $(this).data("piframe");
  8618. if (pIframe) {
  8619. jQuery(ayar.pContent + ":eq(" + indis + ")", elem).html('<iframe src="' + pIframe.url + '" frameborder="0" width="' + pIframe.width + '" height="' + pIframe.height + '" style="display: none"></iframe>').append('<div class="loader">Tab İçeriği Yükleniyor..</div>').find("iframe").load(function() {
  8620. $(this).siblings(".loader").hide();
  8621. $(this).show();
  8622. var height = jQuery(ayar.pContent + ":eq(" + indis + ")", elem).outerHeight();
  8623. jQuery('div[rel=pSlideContent]', elem).stop().animate({
  8624. height: height + 'px'
  8625. }, {
  8626. duration: ayar.pDuration
  8627. })
  8628. })
  8629. }
  8630. jQuery(this).parent().find(ayar.pTabElem).removeClass(ayar.pClass);
  8631. jQuery(this).addClass(ayar.pClass);
  8632. if (ayar.pSlide == !1) {
  8633. ayar.pEffect == 'slideDown' ? jQuery(ayar.pContent, elem).finish().slideUp(ayar.pDuration) : jQuery(ayar.pContent, elem).hide();
  8634. if (ayar.pUi && jQuery.ui) {
  8635. jQuery(ayar.pContent + ":eq(" + indis + ")", elem).finish().effect(ayar.pUiEffect)
  8636. } else {
  8637. jQuery(ayar.pContent + ":eq(" + indis + ")", elem).finish().efektUygula(ayar.pEffect, ayar.pDuration)
  8638. }
  8639. } else {
  8640. jQuery('div[rel=pSlide]', elem).stop().animate({
  8641. marginLeft: '-' + (indis * ayar.pSlideWidth) + 'px'
  8642. }, {
  8643. duration: ayar.pDuration,
  8644. easing: ayar.pEasing
  8645. });
  8646. if (ayar.pAutoHeight) {
  8647. var height = jQuery(ayar.pContent + ":eq(" + indis + ")", elem).outerHeight();
  8648. jQuery('div[rel=pSlideContent]', elem).stop().animate({
  8649. height: height + 'px'
  8650. }, {
  8651. duration: ayar.pDuration
  8652. })
  8653. }
  8654. }
  8655. }
  8656. return !1
  8657. });
  8658. if (ayar.pSlidePrev) {
  8659. var pSlidePrevFunc = function() {
  8660. indis > 0 ? indis-- : indis = elemLength - 1;
  8661. if (ayar.pSlide == !1) {
  8662. ayar.pEffect == 'slideDown' ? jQuery(ayar.pContent, elem).finish().slideUp(ayar.pDuration) : jQuery(ayar.pContent, elem).hide();
  8663. if (ayar.pUi && jQuery.ui) {
  8664. jQuery(ayar.pContent + ":eq(" + indis + ")", elem).finish().effect(ayar.pUiEffect)
  8665. } else {
  8666. jQuery(ayar.pContent + ":eq(" + indis + ")", elem).finish().efektUygula(ayar.pEffect, ayar.pDuration)
  8667. }
  8668. } else {
  8669. jQuery('div[rel=pSlide]', elem).stop().animate({
  8670. marginLeft: '-' + (indis * ayar.pSlideWidth) + 'px'
  8671. }, {
  8672. duration: ayar.pDuration,
  8673. easing: ayar.pEasing
  8674. })
  8675. }
  8676. if (ayar.pAutoHeight) {
  8677. var height = jQuery(ayar.pContent + ":eq(" + indis + ")", elem).outerHeight();
  8678. jQuery('div[rel=pSlideContent]', elem).stop().animate({
  8679. height: height + 'px'
  8680. }, {
  8681. duration: ayar.pDuration
  8682. })
  8683. }
  8684. jQuery(ayar.pTab + " " + ayar.pTabElem, elem).parent().find(ayar.pTabElem).removeClass(ayar.pClass);
  8685. jQuery(ayar.pTab + " " + ayar.pTabElem + ":eq(" + indis + ")", elem).addClass(ayar.pClass);
  8686. if (ayar.pEventFunc) {
  8687. ayar.pEventFunc(jQuery(ayar.pTab + " " + ayar.pTabElem + ":eq(" + indis + ")", elem))
  8688. }
  8689. }
  8690. jQuery(ayar.pSlidePrev, elem).click(function() {
  8691. pSlidePrevFunc();
  8692. return !1
  8693. })
  8694. }
  8695. if (ayar.pSlideNext) {
  8696. var pSlideNextFunc = function() {
  8697. indis < elemLength - 1 ? indis++ : indis = 0;
  8698. if (ayar.pSlide == !1) {
  8699. ayar.pEffect == 'slideDown' ? jQuery(ayar.pContent, elem).finish().slideUp(ayar.pDuration) : $(ayar.pContent, elem).hide();
  8700. if (ayar.pUi && jQuery.ui) {
  8701. jQuery(ayar.pContent + ":eq(" + indis + ")", elem).finish().effect(ayar.pUiEffect)
  8702. } else {
  8703. jQuery(ayar.pContent + ":eq(" + indis + ")", elem).finish().efektUygula(ayar.pEffect, ayar.pDuration)
  8704. }
  8705. } else {
  8706. jQuery('div[rel=pSlide]', elem).stop().animate({
  8707. marginLeft: '-' + (indis * ayar.pSlideWidth) + 'px'
  8708. }, {
  8709. duration: ayar.pDuration,
  8710. easing: ayar.pEasing
  8711. })
  8712. }
  8713. if (ayar.pAutoHeight) {
  8714. var height = jQuery(ayar.pContent + ":eq(" + indis + ")", elem).outerHeight();
  8715. jQuery('div[rel=pSlideContent]', elem).stop().animate({
  8716. height: height + 'px'
  8717. }, {
  8718. duration: ayar.pDuration
  8719. })
  8720. }
  8721. jQuery(ayar.pTab + " " + ayar.pTabElem, elem).parent().find(ayar.pTabElem).removeClass(ayar.pClass);
  8722. jQuery(ayar.pTab + " " + ayar.pTabElem + ":eq(" + indis + ")", elem).addClass(ayar.pClass);
  8723. if (ayar.pEventFunc) {
  8724. ayar.pEventFunc(jQuery(ayar.pTab + " " + ayar.pTabElem + ":eq(" + indis + ")", elem))
  8725. }
  8726. }
  8727. jQuery(ayar.pSlideNext, elem).click(function() {
  8728. pSlideNextFunc();
  8729. return !1
  8730. })
  8731. }
  8732. if (ayar.pSlideLoop) {
  8733. var pTabSlider = function() {
  8734. if (indis < elemLength - 1) {
  8735. pSlideNextFunc()
  8736. } else {
  8737. indis = -1;
  8738. pSlideNextFunc()
  8739. }
  8740. }
  8741. var interval = setInterval(function() {
  8742. pTabSlider()
  8743. }, ayar.pSlideLoopDuration);
  8744. jQuery(elem).hover(function() {
  8745. clearInterval(interval);
  8746. interval = null
  8747. }, function() {
  8748. interval = setInterval(function() {
  8749. pTabSlider()
  8750. }, ayar.pSlideLoopDuration)
  8751. })
  8752. }
  8753. if (ayar.pMouseWheel) {
  8754. jQuery(elem).mousewheel(function(event, delta, deltaX, deltaY) {
  8755. delta > 0 ? pSlidePrevFunc() : pSlideNextFunc();
  8756. return !1
  8757. })
  8758. }
  8759. $(elem).hover(function() {
  8760. if (ayar.pKeyboardEvent) {
  8761. $("body").attr("onKeyDown", "$.doKey(event)");
  8762. $.doKey = function(e) {
  8763. evt = e || window.event;
  8764. if (evt.keyCode == 37) {
  8765. pSlidePrevFunc()
  8766. } else if (evt.keyCode == 39) {
  8767. pSlideNextFunc()
  8768. }
  8769. }
  8770. } else {
  8771. $("body").removeAttr("onKeyDown")
  8772. }
  8773. }, function() {
  8774. $("body").removeAttr("onKeyDown")
  8775. })
  8776. })
  8777. }
  8778. })(jQuery);
  8779. (function(factory) {
  8780. var jQuery;
  8781. if (typeof define === 'function' && define.amd) {
  8782. define(['jquery'], factory)
  8783. } else if (typeof exports === 'object') {
  8784. try {
  8785. jQuery = require('jquery')
  8786. } catch (e) {}
  8787. module.exports = factory(jQuery)
  8788. } else {
  8789. var _OldCookies = window.Cookies;
  8790. var api = window.Cookies = factory(window.jQuery);
  8791. api.noConflict = function() {
  8792. window.Cookies = _OldCookies;
  8793. return api
  8794. }
  8795. }
  8796. }(function($) {
  8797. var pluses = /\+/g;
  8798.  
  8799. function encode(s) {
  8800. return api.raw ? s : encodeURIComponent(s)
  8801. }
  8802.  
  8803. function decode(s) {
  8804. return api.raw ? s : decodeURIComponent(s)
  8805. }
  8806.  
  8807. function stringifyCookieValue(value) {
  8808. return encode(api.json ? JSON.stringify(value) : String(value))
  8809. }
  8810.  
  8811. function parseCookieValue(s) {
  8812. if (s.indexOf('"') === 0) {
  8813. s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\')
  8814. }
  8815. try {
  8816. s = decodeURIComponent(s.replace(pluses, ' '));
  8817. return api.json ? JSON.parse(s) : s
  8818. } catch (e) {}
  8819. }
  8820.  
  8821. function read(s, converter) {
  8822. var value = api.raw ? s : parseCookieValue(s);
  8823. return isFunction(converter) ? converter(value) : value
  8824. }
  8825.  
  8826. function extend() {
  8827. var key, options;
  8828. var i = 0;
  8829. var result = {};
  8830. for (; i < arguments.length; i++) {
  8831. options = arguments[i];
  8832. for (key in options) {
  8833. result[key] = options[key]
  8834. }
  8835. }
  8836. return result
  8837. }
  8838.  
  8839. function isFunction(obj) {
  8840. return Object.prototype.toString.call(obj) === '[object Function]'
  8841. }
  8842. var api = function(key, value, options) {
  8843. if (arguments.length > 1 && !isFunction(value)) {
  8844. options = extend(api.defaults, options);
  8845. if (typeof options.expires === 'number') {
  8846. var days = options.expires,
  8847. t = options.expires = new Date();
  8848. t.setMilliseconds(t.getMilliseconds() + days * 864e+5)
  8849. }
  8850. return (document.cookie = [encode(key), '=', stringifyCookieValue(value), options.expires ? '; expires=' + options.expires.toUTCString() : '', options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', options.secure ? '; secure' : ''].join(''))
  8851. }
  8852. var result = key ? undefined : {},
  8853. cookies = document.cookie ? document.cookie.split('; ') : [],
  8854. i = 0,
  8855. l = cookies.length;
  8856. for (; i < l; i++) {
  8857. var parts = cookies[i].split('='),
  8858. name = decode(parts.shift()),
  8859. cookie = parts.join('=');
  8860. if (key === name) {
  8861. result = read(cookie, value);
  8862. break
  8863. }
  8864. if (!key && (cookie = read(cookie)) !== undefined) {
  8865. result[name] = cookie
  8866. }
  8867. }
  8868. return result
  8869. };
  8870. api.get = api.set = api;
  8871. api.defaults = {};
  8872. api.remove = function(key, options) {
  8873. api(key, '', extend(options, {
  8874. expires: -1
  8875. }));
  8876. return !api(key)
  8877. };
  8878. if ($) {
  8879. $.cookie = api;
  8880. $.removeCookie = api.remove
  8881. }
  8882. return api
  8883. }));
  8884. if (self != top) {
  8885. top.location.replace(location.href)
  8886. }
  8887. $(document).ready(function(e) {
  8888. $('.banner').css('display', 'block');
  8889. var total = $('[data-load-image]').length,
  8890. current = 0;
  8891.  
  8892. function load_image(eq) {
  8893. $('[data-load-image]:eq(' + eq + ')').attr('src', $('[data-load-image]:eq(' + eq + ')').data('load-image')).load(function() {
  8894. if (current < total)
  8895. current += 1;
  8896. load_image(current)
  8897. }).error(function() {
  8898. if (current < total)
  8899. current += 1;
  8900. load_image(current)
  8901. })
  8902. }
  8903. load_image(current);
  8904. $('[data-load-image]').each(function() {
  8905. var image = $(this).data('load-image');
  8906. $(this).attr('src', image)
  8907. })
  8908. });
  8909. WebFontConfig = {
  8910. google: {
  8911. families: ['Open Sans:300,400,600,700:latin,latin-ext', 'Roboto:400']
  8912. }
  8913. };
  8914. ! function(e) {
  8915. e.fn.shorten = function(s) {
  8916. "use strict";
  8917. var t = {
  8918. showChars: 100,
  8919. minHideChars: 10,
  8920. ellipsesText: "",
  8921. moreText: "more",
  8922. lessText: "less",
  8923. onLess: function() {},
  8924. onMore: function() {},
  8925. errMsg: null,
  8926. force: !1
  8927. };
  8928. return s && e.extend(t, s), e(this).data("jquery.shorten") && !t.force ? !1 : (e(this).data("jquery.shorten", !0), e(document).off("click", ".read-more"), e(document).on({
  8929. click: function() {
  8930. var s = e(this);
  8931. return s.hasClass("less") ? (s.removeClass("less"), s.html(t.moreText), s.parent().prev().animate({
  8932. height: "0%"
  8933. }, function() {
  8934. s.parent().prev().prev().show()
  8935. }).hide("fast", function() {
  8936. t.onLess()
  8937. })) : (s.addClass("less"), s.html(t.lessText), s.parent().prev().animate({
  8938. height: "100%"
  8939. }, function() {
  8940. s.parent().prev().prev().hide()
  8941. }).show("fast", function() {
  8942. t.onMore()
  8943. })), !1
  8944. }
  8945. }, ".read-more"), this.each(function() {
  8946. var s = e(this),
  8947. n = s.html(),
  8948. r = s.text().length;
  8949. if (r > t.showChars + t.minHideChars) {
  8950. var o = n.substr(0, t.showChars);
  8951. if (o.indexOf("<") >= 0) {
  8952. for (var a = !1, i = "", h = 0, l = [], c = null, f = 0, u = 0; u <= t.showChars; f++)
  8953. if ("<" != n[f] || a || (a = !0, c = n.substring(f + 1, n.indexOf(">", f)), "/" == c[0] ? c != "/" + l[0] ? t.errMsg = "ERROR en HTML: the top of the stack should be the tag that closes" : l.shift() : "br" != c.toLowerCase() && l.unshift(c)), a && ">" == n[f] && (a = !1), a) i += n.charAt(f);
  8954. else if (u++, h <= t.showChars) i += n.charAt(f), h++;
  8955. else if (l.length > 0) {
  8956. for (j = 0; j < l.length; j++) i += "</" + l[j] + ">";
  8957. break
  8958. }
  8959. o = e("<div/>").html(i + '<span class="ellip">' + t.ellipsesText + "</span>").html()
  8960. } else o += t.ellipsesText;
  8961. var m = '<div class="shortcontent">' + o + '</div><div class="allcontent">' + n + '</div><span><a href="javascript://nop/" class="read-more">' + t.moreText + "</a></span>";
  8962. s.html(m), s.find(".allcontent").hide(), e(".shortcontent p:last", s).css("margin-bottom", 0)
  8963. }
  8964. }))
  8965. }
  8966. }(jQuery);
  8967.  
  8968. function error(msg) {
  8969. modal({
  8970. type: 'error',
  8971. title: 'Hata!',
  8972. text: msg
  8973. })
  8974. }
  8975.  
  8976. function success(msg) {
  8977. modal({
  8978. type: 'success',
  8979. title: 'Başarılı!',
  8980. text: msg
  8981. })
  8982. }
  8983. var popupFix = function(e) {
  8984. var height = $('>div', e).height();
  8985. $('>div', e).css('margin-top', '-' + (height / 2) + 'px');
  8986. $('input:first', e).focus()
  8987. };
  8988.  
  8989. function video_play(form) {
  8990. $.post(request_url, $(form).serialize() + '&type=video_play', function(response) {
  8991. if (response.error) {
  8992. error(response.error)
  8993. } else {
  8994. setTimeout(function() {
  8995. window.location.reload(!0)
  8996. }, 1000)
  8997. }
  8998. }, 'json')
  8999. }
  9000.  
  9001. function lost_password(form) {
  9002. $(form).addClass('loading');
  9003. $.post(request_url, $(form).serialize() + '&type=lost_password', function(response) {
  9004. $(form).removeClass('loading');
  9005. if (response.error) {
  9006. error(response.error)
  9007. } else {
  9008. success(response.success)
  9009. }
  9010. }, 'json')
  9011. }
  9012.  
  9013. function new_password(form) {
  9014. var pass = $(form).find('#pass').val(),
  9015. passt = $(form).find('#passt').val();
  9016. if (pass != passt) {
  9017. error('Her iki şifreyi de aynı girmezsen vallaha kabul etmem! Tekrar dene hadi.');
  9018. return !1
  9019. }
  9020. $(form).addClass('loading');
  9021. $.post(request_url, $(form).serialize() + '&type=new_password', function(response) {
  9022. $(form).removeClass('loading');
  9023. if (response.error) {
  9024. error(response.error)
  9025. } else {
  9026. success(response.success)
  9027. }
  9028. }, 'json')
  9029. }
  9030.  
  9031. function change_password(form) {
  9032. var passo = $(form).find('#passo').val(),
  9033. pass = $(form).find('#pass').val(),
  9034. passt = $(form).find('#passt').val();
  9035. if (passo == "" || passo == undefined) {
  9036. error('Eski şifreni yazmadın ?');
  9037. return !1
  9038. } else if (pass == "" || pass == undefined) {
  9039. error('Yeni şifreni yazmadın ?');
  9040. return !1
  9041. } else if (passt == "" || passt == undefined) {
  9042. error('Yeni şifreni tekrarını yazmadın ?');
  9043. return !1
  9044. } else if (pass != passt) {
  9045. error('Yeni şifreni aynı girmezsen vallaha kabul etmem! Tekrar dene hadi.');
  9046. return !1
  9047. }
  9048. $(form).addClass('loading');
  9049. $.post(request_url, $(form).serialize() + '&type=change_password', function(response) {
  9050. $(form).removeClass('loading');
  9051. if (response.error) {
  9052. error(response.error)
  9053. } else {
  9054. success(response.success)
  9055. }
  9056. }, 'json')
  9057. }
  9058.  
  9059. function watched(id) {
  9060. $.post(request_url, {
  9061. 'id': id,
  9062. 'type': 'watched'
  9063. }, function(response) {
  9064. if (response.success) {
  9065. $('#watched').fadeIn(300).html(response.success);
  9066. setTimeout(function() {
  9067. $('#watched').remove()
  9068. }, 6000)
  9069. }
  9070. }, 'json')
  9071. }
  9072.  
  9073. function deleteComment(id) {
  9074. modal({
  9075. type: 'warning',
  9076. title: 'Uyarı',
  9077. text: 'Mesajını silmek istediğine emin misin ? <br /><br /> Not: <b>Adminler</b> silinen mesajları görebilirler.',
  9078. size: 'small',
  9079. buttons: [{
  9080. text: 'Vazgeçtim',
  9081. val: 'kapat',
  9082. addClass: 'btn-white btn-square modal-close-btn'
  9083. }, {
  9084. text: 'Çabuk sil, kimse görmeden!',
  9085. val: 'ok',
  9086. eKey: !0,
  9087. addClass: 'btn-red btn-square',
  9088. onClick: function(argument) {
  9089. $.post(request_url, {
  9090. 'id': id,
  9091. 'type': 'deletecomment'
  9092. }, function(response) {
  9093. if (response.error) {
  9094. error(response.error)
  9095. } else {
  9096. $("div.comment#yorum" + id).slideUp('medium')
  9097. }
  9098. }, 'json');
  9099. return !0
  9100. }
  9101. }],
  9102. center: !0,
  9103. autoclose: !1,
  9104. closeClick: !0,
  9105. closable: !0,
  9106. animate: !0,
  9107. background: 'rgba(0,0,0,0.35)',
  9108. zIndex: 1050,
  9109. template: '<div class="modal-box"><div class="modal-inner"><div class="modal-title"><a class="modal-close-btn"></a></div><div class="modal-text"></div><div class="modal-buttons"></div></div></div>',
  9110. _classes: {
  9111. box: '.modal-box',
  9112. boxInner: ".modal-inner",
  9113. title: '.modal-title',
  9114. content: '.modal-text',
  9115. buttons: '.modal-buttons',
  9116. closebtn: '.modal-close-btn'
  9117. }
  9118. })
  9119. }
  9120.  
  9121. function addcomment() {
  9122. var yorum = $('textarea[name=yorum_text]').val(),
  9123. spoiler = $('input[name=spoiler]:checked').val();
  9124. $('#addcomment').addClass('form-active');
  9125. $.post(request_url, {
  9126. 'yorum': yorum,
  9127. 'spoiler': spoiler,
  9128. 'type': 'addcomment'
  9129. }, function(response) {
  9130. $('#addcomment').removeClass('form-active');
  9131. if (response.error) {
  9132. error(response.error)
  9133. } else {
  9134. $('.no-comment').remove();
  9135. $('.comments').prepend(response.data);
  9136. $('[name=yorum_text]').val('');
  9137. $('[data-load-image]').each(function() {
  9138. $(this).attr('src', $(this).data('load-image'))
  9139. })
  9140. }
  9141. }, 'json')
  9142. }
  9143.  
  9144. function artist_addcomment(uniqid) {
  9145. var yorum = $('textarea[name=yorum_text]').val(),
  9146. spoiler = $('input[name=spoiler]:checked').val();
  9147. $('#addcomment').addClass('form-active');
  9148. $.post(request_url, {
  9149. 'yorum': yorum,
  9150. 'spoiler': spoiler,
  9151. 'type': 'artist_addcomment',
  9152. 'uniqid': uniqid
  9153. }, function(response) {
  9154. $('#addcomment').removeClass('form-active');
  9155. if (response.error) {
  9156. error(response.error)
  9157. } else {
  9158. $('.no-comment').remove();
  9159. $('.comments').prepend(response.data);
  9160. $('[name=yorum_text]').val('')
  9161. }
  9162. }, 'json')
  9163. }
  9164.  
  9165. function series_addcomment() {
  9166. var yorum = $('textarea[name=yorum_text]').val(),
  9167. spoiler = $('input[name=spoiler]:checked').val();
  9168. $('#addcomment').addClass('form-active');
  9169. $.post(request_url, {
  9170. 'yorum': yorum,
  9171. 'spoiler': spoiler,
  9172. 'type': 'series_addcomment'
  9173. }, function(response) {
  9174. $('#addcomment').removeClass('form-active');
  9175. if (response.error) {
  9176. error(response.error)
  9177. } else {
  9178. $('.no-comment').remove();
  9179. $('.comments').prepend(response.data);
  9180. $('[name=yorum_text]').val('');
  9181. $('[data-load-image]').each(function() {
  9182. $(this).attr('src', $(this).data('load-image'))
  9183. })
  9184. }
  9185. }, 'json')
  9186. }
  9187.  
  9188. function forum_addcomment() {
  9189. var yorum = $('textarea[name=yorum_text]').val(),
  9190. spoiler = $('input[name=spoiler]:checked').val();
  9191. $('#addcomment').addClass('form-active');
  9192. $.post(request_url, {
  9193. 'yorum': yorum,
  9194. 'spoiler': spoiler,
  9195. 'type': 'forum_addcomment'
  9196. }, function(response) {
  9197. $('#addcomment').removeClass('form-active');
  9198. if (response.error) {
  9199. error(response.error)
  9200. } else {
  9201. $('.no-comment').remove();
  9202. $('#comments').append(response.data);
  9203. $('[name=yorum_text]').val('');
  9204. $('[data-load-image]').each(function() {
  9205. $(this).attr('src', $(this).data('load-image'))
  9206. })
  9207. }
  9208. }, 'json')
  9209. }
  9210.  
  9211. function comment_complain(id) {
  9212. $.post(request_url, {
  9213. 'id': id,
  9214. 'type': 'comment_complain'
  9215. }, function(response) {
  9216. if (response.error) {
  9217. error(response.error)
  9218. } else {
  9219. alert(response.result)
  9220. }
  9221. }, 'json')
  9222. }
  9223.  
  9224. function login() {
  9225. var data = $('#login').serialize() + '&type=login';
  9226. $.post(request_url, data, function(response) {
  9227. if (response.error) {
  9228. error(response.error)
  9229. } else {
  9230. window.location.reload(!0)
  9231. }
  9232. }, 'json')
  9233. }
  9234.  
  9235. function register() {
  9236. var form = $('#register');
  9237. form.addClass('loading');
  9238. var data = form.serialize() + '&type=register';
  9239. $.post(request_url, data, function(response) {
  9240. form.removeClass('loading');
  9241. if (response.error) {
  9242. error(response.error)
  9243. } else {
  9244. $('.register-content').html(response.success);
  9245. popupFix('#register-form')
  9246. }
  9247. }, 'json')
  9248. }
  9249.  
  9250. function update_profile(id) {
  9251. var data = $('#' + id).serialize() + '&type=update_profile';
  9252. $.post(request_url, data, function(response) {
  9253. if (response.error) {
  9254. error(response.error)
  9255. } else {
  9256. success(response.success)
  9257. }
  9258. }, 'json')
  9259. }
  9260.  
  9261. function update_caption_settings(id) {
  9262. var data = $('#' + id).serialize() + '&type=update_caption_settings';
  9263. $.post(request_url, data, function(response) {
  9264. if (response.error) {
  9265. error(response.error)
  9266. } else {
  9267. alert(response.success)
  9268. }
  9269. }, 'json')
  9270. }
  9271.  
  9272. function comment_like(id) {
  9273. $.post(request_url, {
  9274. 'id': id,
  9275. 'type': 'comment_like'
  9276. }, function(response) {
  9277. if (response.error) {
  9278. error(response.error)
  9279. } else {
  9280. $('#like_' + id).text(parseInt($('#like_' + id).text()) + 1)
  9281. }
  9282. }, 'json')
  9283. }
  9284.  
  9285. function comment_dislike(id) {
  9286. $.post(request_url, {
  9287. 'id': id,
  9288. 'type': 'comment_dislike'
  9289. }, function(response) {
  9290. if (response.error) {
  9291. error(response.error)
  9292. } else {
  9293. $('#dislike_' + id).text(parseInt($('#dislike_' + id).text()) + 1)
  9294. }
  9295. }, 'json')
  9296. }
  9297.  
  9298. function like_graph(id) {
  9299. var like = parseInt($('#series_like_' + id).text()),
  9300. dislike = parseInt($('#series_dislike_' + id).text()),
  9301. total = like + dislike,
  9302. percent = (like / total) * 100;
  9303. $('.like-bar div').css('width', percent + '%')
  9304. }
  9305.  
  9306. function series_like(id) {
  9307. $.post(request_url, {
  9308. 'id': id,
  9309. 'type': 'series_like'
  9310. }, function(response) {
  9311. if (response.error) {
  9312. if (response.login_open) {
  9313. $('#login-form').hide().fadeIn(300);
  9314. popupFix('#login-form')
  9315. } else {
  9316. error(response.error)
  9317. }
  9318. } else {
  9319. $('#series_like_' + id).text(parseInt($('#series_like_' + id).text()) + 1);
  9320. like_graph(id)
  9321. }
  9322. }, 'json');
  9323. return !1
  9324. }
  9325.  
  9326. function series_dislike(id) {
  9327. $.post(request_url, {
  9328. 'id': id,
  9329. 'type': 'series_dislike'
  9330. }, function(response) {
  9331. if (response.error) {
  9332. error(response.error)
  9333. } else {
  9334. $('#series_dislike_' + id).text(parseInt($('#series_dislike_' + id).text()) + 1);
  9335. like_graph(id)
  9336. }
  9337. }, 'json')
  9338. }
  9339.  
  9340. function follow(id, elem) {
  9341. $.post(request_url, {
  9342. 'id': id,
  9343. 'type': 'follow'
  9344. }, function(response) {
  9345. if (response.error) {
  9346. error(response.error)
  9347. } else {
  9348. $("a.mesaj_gonder").show();
  9349. $(elem).attr('onclick', 'unfollow("' + id + '", this)').html('<span class="fa fa-check"></span> Takip Ediliyor')
  9350. }
  9351. }, 'json')
  9352. }
  9353.  
  9354. function series_follow(id, elem) {
  9355. $.post(request_url, {
  9356. 'id': id,
  9357. 'type': 'series_follow'
  9358. }, function(response) {
  9359. if (response.error) {
  9360. error(response.error)
  9361. } else {
  9362. $(elem).attr('onclick', 'series_unfollow("' + id + '", this)').html('<span class="fa fa-check"></span> AboneliÄŸi Ä°ptal Et')
  9363. }
  9364. }, 'json')
  9365. }
  9366.  
  9367. function artist_fan_add(id, elem) {
  9368. $.post(request_url, {
  9369. 'id': id,
  9370. 'type': 'artist_fan_add'
  9371. }, function(response) {
  9372. if (response.error) {
  9373. error(response.error)
  9374. } else {
  9375. $(elem).attr('onclick', 'artist_fan_remove("' + id + '", this)').html('<span class="fa fa-check"></span> Hayran Olmaktan Vazgeç')
  9376. }
  9377. }, 'json')
  9378. }
  9379.  
  9380. function artist_fan_remove(id, elem) {
  9381. $.post(request_url, {
  9382. 'id': id,
  9383. 'type': 'artist_fan_remove'
  9384. }, function(response) {
  9385. if (response.error) {
  9386. error(response.error)
  9387. } else {
  9388. $(elem).attr('onclick', 'artist_fan_add("' + id + '", this)').html('<span class="fa fa-plus"></span> Hayranı Ol')
  9389. }
  9390. }, 'json')
  9391. }
  9392.  
  9393. function series_unfollow(id, elem, type) {
  9394. var li = $(elem).closest('li');
  9395. li.addClass('loading');
  9396. $.post(request_url, {
  9397. 'id': id,
  9398. 'type': 'series_unfollow'
  9399. }, function(response) {
  9400. li.removeClass('loading');
  9401. if (response.error) {
  9402. error(response.error)
  9403. } else {
  9404. if (type) {
  9405. li.remove()
  9406. } else {
  9407. $(elem).attr('onclick', 'series_follow("' + id + '", this)').html('<span class="fa fa-check"></span> Abone Ol')
  9408. }
  9409. }
  9410. }, 'json')
  9411. }
  9412.  
  9413. function unfollow(id, elem) {
  9414. $.post(request_url, {
  9415. 'id': id,
  9416. 'type': 'unfollow'
  9417. }, function(response) {
  9418. if (response.error) {
  9419. error(response.error)
  9420. } else {
  9421. $("a.mesaj_gonder").hide();
  9422. $(elem).attr('onclick', 'follow("' + id + '", this)').html('<span class="fa fa-plus"></span> Takip Et')
  9423. }
  9424. }, 'json')
  9425. }
  9426.  
  9427. function add_to_my_watch(id, elem) {
  9428. $.post(request_url, {
  9429. 'id': id,
  9430. 'type': 'add_to_my_watch'
  9431. }, function(response) {
  9432. if (response.error) {
  9433. error(response.error)
  9434. } else {
  9435. $(elem).toggleClass('active')
  9436. }
  9437. }, 'json')
  9438. }
  9439.  
  9440. function last_watched() {
  9441. $('.tv-series-list').addClass('loading');
  9442. $.post(request_url, {
  9443. 'type': 'last_watched'
  9444. }, function(response) {
  9445. if (response.error) {
  9446. error(response.error)
  9447. } else {
  9448. $('.new-episode-list').hide();
  9449. $('.tv-series-list').show().find('.tv-series-scroll').scrollTop(0).find('ul').html(response.data);
  9450. $('.section-tab ul li').removeClass('active').eq(1).addClass('active');
  9451. $('[data-load-image]').each(function() {
  9452. $(this).attr('src', $(this).data('load-image'))
  9453. })
  9454. }
  9455. $('.tv-series-list').removeClass('loading')
  9456. }, 'json')
  9457. }
  9458.  
  9459. function new_added() {
  9460. $('.tv-series-list').addClass('loading');
  9461. $.post(request_url, {
  9462. 'type': 'new_added'
  9463. }, function(response) {
  9464. if (response.error) {
  9465. error(response.error)
  9466. } else {
  9467. $('.new-episode-list').hide();
  9468. $('.tv-series-list').show().find('.tv-series-scroll').scrollTop(0).find('ul').html(response.data);
  9469. $('.section-tab ul li').removeClass('active').eq(0).addClass('active');
  9470. $('[data-load-image]').each(function() {
  9471. $(this).attr('src', $(this).data('load-image'))
  9472. });
  9473. var series_notification = $('#series_notification').text();
  9474. localStorage.setItem('series_notification', series_notification)
  9475. }
  9476. $('.tv-series-list').removeClass('loading')
  9477. }, 'json')
  9478. }
  9479. var series_notification = localStorage.getItem('series_notification'),
  9480. series_notification2 = $('#series_notification').text();
  9481. if (series_notification == series_notification2) {
  9482. $('#series_notification').hide()
  9483. }
  9484.  
  9485. function last_series() {
  9486. $('.tv-series-list').addClass('loading');
  9487. $.post(request_url, {
  9488. 'type': 'last_series'
  9489. }, function(response) {
  9490. if (response.error) {
  9491. error(response.error)
  9492. } else {
  9493. $('.new-episode-list').hide();
  9494. $('.tv-series-list').show().find('.tv-series-scroll').scrollTop(0).find('ul').html(response.data);
  9495. $('.section-tab ul li').removeClass('active').eq(3).addClass('active');
  9496. $('[data-load-image]').each(function() {
  9497. $(this).attr('src', $(this).data('load-image'))
  9498. })
  9499. }
  9500. $('.tv-series-list').removeClass('loading')
  9501. }, 'json')
  9502. }
  9503.  
  9504. function followed_series() {
  9505. $('.tv-series-list').addClass('loading');
  9506. $.post(request_url, {
  9507. 'type': 'followed_series'
  9508. }, function(response) {
  9509. if (response.error) {
  9510. error(response.error)
  9511. } else {
  9512. $('.new-episode-list').hide();
  9513. $('.tv-series-list').show().find('.tv-series-scroll').scrollTop(0).find('ul').html(response.data);
  9514. $('.section-tab ul li').removeClass('active').eq(2).addClass('active');
  9515. $('[data-load-image]').each(function() {
  9516. $(this).attr('src', $(this).data('load-image'))
  9517. });
  9518. $('.tv-series-list').removeClass('loading')
  9519. }
  9520. }, 'json')
  9521. }
  9522.  
  9523. function add_watch_later(id) {
  9524. $.post(request_url, {
  9525. 'id': id,
  9526. 'type': 'add_watch_later'
  9527. }, function(response) {
  9528. if (response.error) {
  9529. error(response.error)
  9530. } else {
  9531. success(response.success)
  9532. }
  9533. }, 'json')
  9534. }
  9535.  
  9536. function remove_watch_later(id, elem) {
  9537. var li = $(elem).closest('li');
  9538. li.addClass('loading');
  9539. $.post(request_url, {
  9540. 'id': id,
  9541. 'type': 'remove_watch_later'
  9542. }, function(response) {
  9543. li.removeClass('loading');
  9544. if (response.error) {
  9545. error(response.error)
  9546. } else {
  9547. li.remove()
  9548. }
  9549. }, 'json')
  9550. }
  9551.  
  9552. function load_social() {
  9553. var id = $('ul.timeline li:last-child').attr('id');
  9554. $.post(request_url, {
  9555. 'id': id,
  9556. 'type': 'load_social'
  9557. }, function(response) {
  9558. if (response.error) {
  9559. $('.submit-btn').remove()
  9560. } else {
  9561. $('ul.timeline').append(response.data);
  9562. $('[data-load-image]').each(function() {
  9563. $(this).attr('src', $(this).data('load-image'))
  9564. })
  9565. }
  9566. }, 'json')
  9567. }
  9568.  
  9569. function read_notification() {
  9570. $.post(request_url, {
  9571. 'type': 'read_notification'
  9572. }, function(response) {
  9573. $('.notification').remove()
  9574. }, 'json')
  9575. }
  9576.  
  9577. function translation_evaluation(vid, etype) {
  9578. var point = $('.popup .translate-popup' + etype + ' .translate-points ul li.active span:eq(0)').text();
  9579. var cd_not = $('.popup .translate-popup' + etype + ' textarea[name=cd_not]').val();
  9580. var bad_select = $('.popup .translate-popup#begenmedim select[name=begenmedim]').val();
  9581. if (!point) {
  9582. error('Çeviri için verdiğiniz puanı belirleyin.')
  9583. } else if (!bad_select && etype == "#begenmedim") {
  9584. error('Çeviriyi beğenmeme nedeninizi seçin.')
  9585. } else if (point < 0 && !cd_not) {
  9586. error('Olumsuz puan verdiyseniz çeviri ya da çevirmen hakkında birkaç şey yazmanız gerekiyor not bölümüne.')
  9587. } else if (bad_select == 3 && point < 0 && cd_not.length < 75) {
  9588. error('Beğenmeme nedeninizi daha açıklayıcı bir şekilde not bölümüne yazınız.')
  9589. } else {
  9590. $.post(request_url, {
  9591. 'vid': vid,
  9592. 'point': point,
  9593. 'bad_select': bad_select,
  9594. 'cd_not': cd_not,
  9595. 'type': 'translation_evaluation'
  9596. }, function(response) {
  9597. if (response.error) {
  9598. error(response.error)
  9599. } else {
  9600. $('.popup .translate-popup').hide();
  9601. $('.popup .translate-success').fadeIn(300);
  9602. popupFix('#translation-evaluation')
  9603. }
  9604. }, 'json')
  9605. }
  9606. }
  9607.  
  9608. function loadEvaluation(pagination, id) {
  9609. $(".comments").addClass("loading").html('<div class="form-loader"></div><div class="comment"></div>');
  9610. $(".pagination").html('');
  9611. $.post(request_url, {
  9612. 'pagination': pagination,
  9613. 'id': id,
  9614. 'type': 'loadEvaluation'
  9615. }, function(response) {
  9616. if (response.error) {
  9617. error(response.error)
  9618. } else {
  9619. $('.comments').removeClass('loading').html(response.comments);
  9620. $('.pagination').html(response.pagination);
  9621. $('html,body').animate({
  9622. scrollTop: $('#commentz').offset().top
  9623. }, 900)
  9624. }
  9625. }, 'json')
  9626. }
  9627.  
  9628. function bug_report(vid) {
  9629. var bug = $('.popup .hatabildir-popup .hatabildir-select ul li.active span:eq(0)').data('bug');
  9630. if (!bug) {
  9631. error('Karşılaştığınız hatayı seçiniz.')
  9632. } else {
  9633. $.post(request_url, {
  9634. 'vid': vid,
  9635. 'bug': bug,
  9636. 'type': 'bug_report'
  9637. }, function(response) {
  9638. if (response.error) {
  9639. error(response.error)
  9640. } else {
  9641. $('.popup .hatabildir-popup').hide();
  9642. $('.popup .hatabildir-success').fadeIn(300);
  9643. popupFix('#hata-bildir')
  9644. }
  9645. }, 'json')
  9646. }
  9647. }
  9648.  
  9649. function contact(form) {
  9650. var data = $(form).serialize();
  9651. $.post(request_url, data + '&type=contact', function(response) {
  9652. if (response.error) {
  9653. error(response.error)
  9654. } else {
  9655. $('input, textarea', form).val('');
  9656. success(response.success)
  9657. }
  9658. }, 'json')
  9659. }
  9660.  
  9661. function today_watchs(elem, e) {
  9662. $(elem).addClass('loading');
  9663. $(e).closest('ul').find('li').removeClass('active');
  9664. $(e).parent().addClass('active');
  9665. $.post(request_url, {
  9666. 'type': 'today_watchs'
  9667. }, function(response) {
  9668. if (response.error) {
  9669. error(response.error)
  9670. } else {
  9671. $(elem + ' ul').html(response.html)
  9672. }
  9673. $(elem).removeClass('loading')
  9674. }, 'json')
  9675. }
  9676.  
  9677. function today_follows(elem, e) {
  9678. $(elem).addClass('loading');
  9679. $(e).closest('ul').find('li').removeClass('active');
  9680. $(e).parent().addClass('active');
  9681. $.post(request_url, {
  9682. 'type': 'today_follows'
  9683. }, function(response) {
  9684. if (response.error) {
  9685. error(response.error)
  9686. } else {
  9687. $(elem + ' ul').html(response.html)
  9688. }
  9689. $(elem).removeClass('loading')
  9690. }, 'json')
  9691. }
  9692.  
  9693. function season_watch(season, series_url, elem) {
  9694. var tab = $('.episode-tab .tv-series-episodes:eq(' + (season - 1) + ')'),
  9695. episodes = $('ul li:not(.title)', tab),
  9696. totalEpisode = episodes.length,
  9697. watchEpisodesTotal = episodes.filter('.active').length,
  9698. loader = $('.episode-loader', tab);
  9699. if (totalEpisode == watchEpisodesTotal) {
  9700. error(season + '. sezonun bütün bölümlerini izledin, harikasın! ')
  9701. } else {
  9702. loader.show();
  9703. $.post(request_url, {
  9704. 'type': 'season_watch',
  9705. 'season': season,
  9706. 'series_url': series_url
  9707. }, function(response) {
  9708. if (response.error) {
  9709. error(response.error)
  9710. } else {
  9711. success(response.success);
  9712. episodes.find('>span >span').addClass('active');
  9713. $(elem).addClass('active')
  9714. }
  9715. loader.hide()
  9716. }, 'json')
  9717. }
  9718. }
  9719.  
  9720. function addSubComment(self, id) {
  9721. var form = $(self).closest('form');
  9722. var data = form.serialize();
  9723. $(form).addClass('loading');
  9724. $.post(request_url, data + '&type=addSubComment', function(response) {
  9725. if (response.error) {
  9726. error(response.error)
  9727. } else {
  9728. $('#comments' + id).append(response.comment);
  9729. $('[data-load-image]').each(function() {
  9730. $(this).attr('src', $(this).data('load-image'))
  9731. });
  9732. form.find('textarea').val('');
  9733. $('.open-subcomment').removeClass('active');
  9734. $('#open_add_subcomment_' + id).hide()
  9735. }
  9736. $(form).removeClass('loading')
  9737. }, 'json')
  9738. }
  9739.  
  9740. function loadComments(id, self) {
  9741. var last_id = $('#comments' + id + ' .comment:first').data('id');
  9742. $('#comment_content_' + id).addClass('loading');
  9743. $.post(request_url, {
  9744. 'last_id': last_id,
  9745. 'id': id,
  9746. 'type': 'loadComments'
  9747. }, function(response) {
  9748. $('#comment_content_' + id).removeClass('loading');
  9749. if (response.error) {
  9750. error(response.error)
  9751. } else {
  9752. $('#comments' + id).prepend(response.comments);
  9753. $(self).remove();
  9754. $('[data-load-image]').each(function() {
  9755. $(this).attr('src', $(this).data('load-image'))
  9756. })
  9757. }
  9758. $('label.cb').on('click', function(e) {
  9759. if ($(':radio', this).length) {
  9760. var name = $(':radio', this).attr('name');
  9761. $('input[name=' + name + ']').parent().removeClass('checked');
  9762. $(this).addClass('checked')
  9763. }
  9764. if ($(':checkbox', this).length) {
  9765. if ($(':checkbox', this).is(':checked')) {
  9766. $(this).addClass('checked')
  9767. } else {
  9768. $(this).removeClass('checked')
  9769. }
  9770. }
  9771. })
  9772. }, 'json')
  9773. }
  9774.  
  9775. function loadComment(pagination, id, scroll) {
  9776. if (scroll === undefined || scroll === null) {
  9777. var scroll = !0
  9778. }
  9779. $('.comments').addClass('loading');
  9780. $.post(request_url, {
  9781. 'pagination': pagination,
  9782. 'id': id,
  9783. 'type': 'loadComment'
  9784. }, function(response) {
  9785. if (response.error) {
  9786. error(response.error)
  9787. } else {
  9788. $('.comments').removeClass('loading');
  9789. $('.comments').html(response.comments);
  9790. $('.pagination').html(response.pagination);
  9791. if (scroll) {
  9792. $('[data-load-image]').each(function() {
  9793. $(this).attr('src', $(this).data('load-image'))
  9794. });
  9795. $('html,body').animate({
  9796. scrollTop: $('#commentz').offset().top
  9797. }, 900)
  9798. }
  9799. var popComments = $(".popular-comments").data('count'),
  9800. totalMessage = '',
  9801. countMessage = parseInt(response.totals) - parseInt(popComments);
  9802. if (popComments > 0) {
  9803. totalMessage = "DiÄŸer " + countMessage + " yorum"
  9804. } else {
  9805. totalMessage = countMessage + " yorum"
  9806. }
  9807. $('#yorumlar span#spanTotal').html(totalMessage);
  9808. if (loginCheck) {
  9809. var yorumId = '';
  9810. $('.c-text .c-top a[data-id="' + loginCheck + '"]').each(function() {
  9811. yorumId = $(this).closest('div.comment').attr('id');
  9812. yorumId = yorumId.replace(/[^\d.]/g, '');
  9813. $(this).parent().parent().find('.c-alt').append('<span class="action"> <span>|</span><a href="javascript:;" onclick="deleteComment(' + yorumId + ')"> <i class="fa fa-trash"></i> Yorumu Sil </a></span>')
  9814. })
  9815. }
  9816. }
  9817. }, 'json')
  9818. }
  9819. var player_source = [];
  9820. var errorinfo = '';
  9821.  
  9822. function loadVideo(vid, elem) {
  9823. player_source = [];
  9824. if ($(elem).parent('li').attr("class") == "active") {
  9825. return !1
  9826. }
  9827. if ($('#vidad').length > 0) {
  9828. $('#vidad').html('')
  9829. }
  9830. $("#player").html('').hide();
  9831. $("#episode_msg").show().html("<img src='" + url + "template/assets/images/loading.gif' style='padding-top:200px;'> <br />Alternatife geçiş yapılıyor, lütfen bekleyin.");
  9832. var tip = (elem) ? 1 : 0;
  9833. $.post(request_url, {
  9834. 'vid': vid,
  9835. 'tip': tip,
  9836. 'type': 'loadVideo'
  9837. }, function(response) {
  9838. errorinfo = response.errorinfo;
  9839. if (response.error) {
  9840. error(response.error)
  9841. } else if (response.errormsg) {
  9842. $("#episode_msg").show().html(response.errormsg);
  9843. jwSetupError(response.errorinfo)
  9844. } else {
  9845. $("#player").show();
  9846. $("#episode_msg").hide();
  9847. if (response.jwPlayer) {
  9848. for (var i = 0; i < response.sources.length; i++) {
  9849. player_source.push(response.sources[i])
  9850. }
  9851. load_video()
  9852. } else {
  9853. $("#player").html(response.html)
  9854. }
  9855. }
  9856. if (elem && !response.error) {
  9857. $("a#alterMenu").html($(elem).html() + ' <span class="fa fa-angle-down"></span>');
  9858. $(".language li").removeClass("active");
  9859. $("ul.language.alternative").hide();
  9860. $(elem).parent('li').addClass("active");
  9861. if ($('#vidad').length > 0) {
  9862. $('#vidad').html('')
  9863. }
  9864. }
  9865. }, 'json')
  9866. }
  9867.  
  9868. function dizi_kapak_getir(fileid) {
  9869. player_source = [];
  9870. $.ajax({
  9871. url: kapak_url + '?fileid=' + fileid + '&access_token=' + aCtkp,
  9872. dataType: 'json',
  9873. success: function(data) {
  9874. for (x in data.variants) {
  9875. var host = data.variants[x].hosts[0],
  9876. path = data.variants[x].path,
  9877. url = "https://" + host + path;
  9878. var kalite = data.variants[x].height + 'p';
  9879. if (son_kalite != kalite) {
  9880. player_source.push({
  9881. "file": url,
  9882. "label": kalite,
  9883. "type": "mp4"
  9884. })
  9885. }
  9886. var son_kalite = kalite
  9887. }
  9888. load_video()
  9889. }
  9890. })
  9891. }
  9892.  
  9893. function loadTimeline() {
  9894. $.post(request_url, {
  9895. 'type': 'timeline'
  9896. }, function(response) {
  9897. if (response.error) {
  9898. error(response.error)
  9899. } else {
  9900. $('#timeline').html(response.html)
  9901. }
  9902. }, 'json')
  9903. }
  9904.  
  9905. function seriesVote(self) {
  9906. var seriesId = $(self).data('series-id');
  9907. var vote = $('select[name=vote]').val();
  9908. if (!vote) {
  9909. error('Diziye oy vermeyi denemelisin.')
  9910. } else {
  9911. $.post(request_url, {
  9912. 'type': 'seriesVote',
  9913. 'id': seriesId,
  9914. 'vote': vote
  9915. }, function(response) {
  9916. if (response.error) {
  9917. error(response.error)
  9918. } else {
  9919. success(response.success);
  9920. var oldVote = $('.series-vote .total').text();
  9921. $('.vote-form').slideUp(300);
  9922. $('.success-vote').slideDown(300);
  9923. $('.series-vote .total').text(response.vote);
  9924. setTimeout(function() {
  9925. $('.vote-form').slideDown(300);
  9926. $('.success-vote').slideUp(300);
  9927. $('.add-vote').slideUp(300)
  9928. }, 3000)
  9929. }
  9930. }, 'json')
  9931. }
  9932. }
  9933.  
  9934. function jwSetupError(error_this) {
  9935. $.post(request_url, {
  9936. 'type': 'jwError',
  9937. 'error': error_this
  9938. }, function(response) {
  9939. if (response.error) {
  9940. error(response.error)
  9941. }
  9942. }, 'json')
  9943. }
  9944.  
  9945. function load_series() {
  9946. $.post(request_url, {
  9947. 'type': 'getDizi'
  9948. }, function(response) {
  9949. var search_content = $('.search-result ul'),
  9950. data = response.data;
  9951. for (var i = 0; i < data.length; i++) {
  9952. var dizi = data[i];
  9953. search_content.append('<li>\
  9954. <a href="' + dizi.url + '">\
  9955. <img src="' + dizi.resim + '" alt="">\
  9956. <span class="title">' + dizi.adi + '</span>\
  9957. <span class="category">' + dizi.tur + '</span>\
  9958. </a>\
  9959. </li>')
  9960. }
  9961. $.expr[':'].icontains = function(obj, index, meta, stack) {
  9962. return (obj.textContent || obj.innerText || jQuery(obj).text() || '').toLowerCase().indexOf(meta[3].toLowerCase()) >= 0
  9963. };
  9964. var result_content = $('.search-result'),
  9965. result_items = $('.search-result ul li'),
  9966. all_result = $('.search-result .all-result');
  9967. $('#searchbar').on('keyup', function(e) {
  9968. result_content.show();
  9969. var val = $(this).val();
  9970. result_items.hide().removeClass('item').filter(':icontains(' + val + ')').show().addClass('item');
  9971. if (result_items.filter(':visible').length == 0) {
  9972. $('.result-error').show()
  9973. } else {
  9974. $('.result-error').hide()
  9975. }
  9976. if (val == '') {
  9977. result_content.hide()
  9978. }
  9979. all_result.attr('href', url + 'arsiv?dizi_adi=' + val)
  9980. })
  9981. }, 'json')
  9982. }
  9983. $(document).ready(function() {
  9984. $("#searchbar").one('click', function(e) {
  9985. e.preventDefault();
  9986. load_series()
  9987. })
  9988. });
  9989. $(window).load(function() {
  9990. $('[data-async-url]').each(function() {
  9991. var $this = $(this),
  9992. tur = $this.data('tur'),
  9993. dataType = $this.data('type') || 'json',
  9994. delay = $this.data('delay') || 0;
  9995. window.setTimeout(function() {
  9996. $.ajax({
  9997. url: request_url,
  9998. data: 'type=getAds&tur=' + tur,
  9999. dataType: dataType,
  10000. type: 'POST',
  10001. success: function(data) {
  10002. var html = dataType == 'json' ? data.html : data;
  10003. if (html) {
  10004. $this.show().html(html)
  10005. } else {
  10006. $this.remove()
  10007. }
  10008. }
  10009. })
  10010. }, delay);
  10011. delay += 250
  10012. })
  10013. });
  10014.  
  10015. function openSubcommentForm(id, self, sub) {
  10016. if (!loginCheck) {
  10017. return !1
  10018. }
  10019. $('.add-subcomment').hide();
  10020. var form = $('#open_add_subcomment_' + id);
  10021. if ($(self).hasClass('active')) {
  10022. form.hide();
  10023. $(self).removeClass('active')
  10024. } else {
  10025. if (sub == 1) {
  10026. var username = $(self).closest('.comment').find('[data-user]').data('user');
  10027. var user_id = $(self).closest('.comment').find('[data-id]').data('id')
  10028. } else {
  10029. var username = form.closest('.comment').find('[data-user]').data('user');
  10030. var user_id = form.closest('.comment').find('[data-id]').data('id')
  10031. }
  10032. $('.open-subcomment').removeClass('active');
  10033. form.show().find('textarea').focus().val('@' + username + ', ');
  10034. form.find('input[name=user_id]').val(user_id);
  10035. $(self).addClass('active')
  10036. }
  10037. $('label.cb').on('click', function(e) {
  10038. if ($(':checkbox', this).length) {
  10039. if ($(':checkbox', this).is(':checked')) {
  10040. $(this).addClass('checked')
  10041. } else {
  10042. $(this).removeClass('checked')
  10043. }
  10044. }
  10045. });
  10046. return !1
  10047. }
  10048. $(document).ready(function() {
  10049. $(document).on('click', '.translate-points ul li', function(e) {
  10050. $('.translate-points ul li').removeClass('active').filter(this).addClass('active');
  10051. e.preventDefault()
  10052. });
  10053. $(document).on('click', '.hatabildir-select ul li', function(e) {
  10054. $('.hatabildir-select ul li').removeClass('active').filter(this).addClass('active');
  10055. e.preventDefault()
  10056. });
  10057. $('#change-bg').on('click', function(e) {
  10058. $(this).next().toggle();
  10059. e.preventDefault()
  10060. });
  10061. $('[data-bg]').on('click', function(e) {
  10062. if (typeof(Storage) !== "undefined") {
  10063. if ($(this).hasClass('default')) {
  10064. delete localStorage.bg;
  10065. $('body').css('background', '#000 url(' + $(this).data('bg') + '?v=' + VERSION + ') no-repeat top center fixed')
  10066. } else {
  10067. localStorage.setItem("bg", $(this).data('bg'));
  10068. bgChange()
  10069. }
  10070. } else {
  10071. alert("Bu özelliği kullanabilmek için tarayıcınızın sürümünü yükseltmeniz gerekiyor!")
  10072. }
  10073. e.preventDefault()
  10074. });
  10075. $('.alphabetic >li').hover(function() {
  10076. $(this).addClass('active').find('ul').show()
  10077. }, function() {
  10078. $(this).removeClass('active').find('ul').hide()
  10079. });
  10080. if (jQuery.fn.perfectScrollbar) {
  10081. $('.tv-series-scroll, .oe-scroll, [scrollbar] >div').perfectScrollbar({
  10082. suppressScrollX: !0,
  10083. wheelSpeed: 1
  10084. })
  10085. }
  10086. if (jQuery.fn.selectBox) {
  10087. $('.selectbox').selectBox({
  10088. topPositionCorrelation: 1
  10089. })
  10090. }
  10091. $(':radio, :checkbox').each(function() {
  10092. $(this).next('span').remove().end().after('<span></span>');
  10093. if ($(this).is(':checked')) {
  10094. $(this).parent().addClass('checked')
  10095. }
  10096. });
  10097. $('label.cb').on('click', function(e) {
  10098. if ($(':radio', this).length) {
  10099. var name = $(':radio', this).attr('name');
  10100. $('input[name=' + name + ']').parent().removeClass('checked');
  10101. $(this).addClass('checked')
  10102. }
  10103. if ($(':checkbox', this).length) {
  10104. if ($(':checkbox', this).is(':checked')) {
  10105. $(this).addClass('checked')
  10106. } else {
  10107. $(this).removeClass('checked')
  10108. }
  10109. }
  10110. });
  10111. $(document.body).on('click', '.spoiler-text', function(e) {
  10112. $(this).hide().next('p').show();
  10113. e.preventDefault()
  10114. });
  10115. $('.tab-menu li.hovered').hover(function() {
  10116. $(this).addClass('hover').find('>ul').show()
  10117. }, function() {
  10118. $(this).removeClass('hover').find('>ul').hide()
  10119. });
  10120. if (jQuery.fn.customSelect) {
  10121. $('.select').customSelect()
  10122. }
  10123. var popupFix = function(e) {
  10124. var height = $('>div', e).height();
  10125. $('>div', e).css('margin-top', '-' + (height / 2) + 'px');
  10126. $('input:first', e).focus()
  10127. };
  10128. $('[data-open]').on('click', function(e) {
  10129. $('[data-open]').each(function() {
  10130. $($(this).data('open')).hide()
  10131. });
  10132. var open = $(this).data('open');
  10133. $(open).fadeIn(300);
  10134. popupFix(open);
  10135. e.preventDefault()
  10136. });
  10137. $('[data-close]').on('click', function(e) {
  10138. var close = $(this).data('close');
  10139. $(close).fadeOut(300);
  10140. e.preventDefault()
  10141. });
  10142. $('[data-open]').each(function() {
  10143. $($(this).data('open') + ' a').on('click', function() {
  10144. window.location.href = $(this).attr('href')
  10145. })
  10146. });
  10147. $('body').on('keyup', function(e) {
  10148. if (e.keyCode == 27) {
  10149. $('.popup').fadeOut(300)
  10150. }
  10151. });
  10152. if (jQuery.fn.pTab) {
  10153. $('[tab]').pTab({
  10154. pTab: '[tab-list]',
  10155. pTabElem: 'a',
  10156. pContent: '[tab-content]',
  10157. pClass: 'active'
  10158. });
  10159. $('[tab2]').pTab({
  10160. pTab: '[tab2-list]',
  10161. pTabElem: 'li',
  10162. pContent: '[tab2-content]',
  10163. pClass: 'active'
  10164. })
  10165. }
  10166. var total = $('.oe-scroll').length,
  10167. current_season = $('[data-season]').data('season'),
  10168. season_content = $('.oe-scroll');
  10169. $('#total_season').text(total);
  10170. $('#current_season').text(current_season);
  10171. season_content.filter(':not(:eq(' + (current_season - 1) + '))').hide();
  10172. $('#next').on('click', function(e) {
  10173. if (current_season < total) {
  10174. current_season++;
  10175. season_content.hide().filter(':eq(' + (current_season - 1) + ')').show();
  10176. $('#current_season').text(current_season)
  10177. }
  10178. e.preventDefault()
  10179. });
  10180. $('#prev').on('click', function(e) {
  10181. if (current_season > 1) {
  10182. current_season--;
  10183. season_content.hide().filter(':eq(' + (current_season - 1) + ')').show();
  10184. $('#current_season').text(current_season)
  10185. }
  10186. e.preventDefault()
  10187. });
  10188. if (jQuery.fn.swiper) {
  10189. if ($('.my-tv-series').length) {
  10190. var sag = $('.right').height() - 64;
  10191. $('.my-tv-series').height(sag - 682);
  10192. $('.swiper-container').height((sag - 682) - 49);
  10193. if (sag > 1500 && sag < 2500) {
  10194. var carousel = new Swiper('.my-tv-series >div .swiper-container', {
  10195. slidesPerView: 10,
  10196. loop: !0,
  10197. mode: 'vertical'
  10198. });
  10199. $('.my-tv-series .prev').on('click', carousel.swipePrev);
  10200. $('.my-tv-series .next').on('click', carousel.swipeNext)
  10201. } else if (sag > 2500) {
  10202. var carousel = new Swiper('.my-tv-series >div .swiper-container', {
  10203. slidesPerView: 20,
  10204. loop: !0,
  10205. mode: 'vertical'
  10206. });
  10207. $('.my-tv-series .prev').on('click', carousel.swipePrev);
  10208. $('.my-tv-series .next').on('click', carousel.swipeNext)
  10209. }
  10210. }
  10211. }
  10212. $('[name=yorum_text]').autosize();
  10213. setTimeout(function() {
  10214. $('.ads').each(function() {
  10215. if ($(this).height() == 0) {
  10216. $(this).parent().remove()
  10217. }
  10218. })
  10219. }, 100);
  10220. $('.popup .translate-popup .translate-points ul li').on('click', function(e) {
  10221. $('.popup .translate-popup .translate-points ul li').removeClass('active').filter(this).addClass('active');
  10222. e.preventDefault()
  10223. });
  10224. $('html').on('click', function(event) {
  10225. var target = $(event.target);
  10226. if (target.is('.user-bar') || target.parents('.user-bar').size() > 0)
  10227. return;
  10228. $('.notif, .change-bg').hide()
  10229. });
  10230. $('.vote').on('click', function(e) {
  10231. $('.add-vote').slideToggle(300);
  10232. $('.selectbox').selectBox('refresh', {
  10233. topPositionCorrelation: 1
  10234. });
  10235. e.preventDefault()
  10236. })
  10237. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement