· 6 years ago · Feb 11, 2020, 06:58 PM
1! function (a, b) {
2 "use strict";
3 "function" == typeof define && define.amd ? define([], b) : (a.Riot = a.Riot || {}, a.Riot.ApolloForums = b(), a.Riot.ApolloForums.init(), Riot.Apollo && Riot.Apollo.init())
4}(this, function () {
5 var requirejs, require, define;
6 return function (a) {
7 function b(a, b) {
8 return r.call(a, b)
9 }
10
11 function c(a, b) {
12 var c, d, e, f, g, h, i, j, k, l, m, n = b && b.split("/"),
13 o = p.map,
14 q = o && o["*"] || {};
15 if (a && "." === a.charAt(0))
16 if (b) {
17 for (n = n.slice(0, n.length - 1), a = a.split("/"), g = a.length - 1, p.nodeIdCompat && t.test(a[g]) && (a[g] = a[g].replace(t, "")), a = n.concat(a), k = 0; k < a.length; k += 1)
18 if (m = a[k], "." === m) a.splice(k, 1), k -= 1;
19 else if (".." === m) {
20 if (1 === k && (".." === a[2] || ".." === a[0])) break;
21 k > 0 && (a.splice(k - 1, 2), k -= 2)
22 }
23 a = a.join("/")
24 } else 0 === a.indexOf("./") && (a = a.substring(2));
25 if ((n || q) && o) {
26 for (c = a.split("/"), k = c.length; k > 0; k -= 1) {
27 if (d = c.slice(0, k).join("/"), n)
28 for (l = n.length; l > 0; l -= 1)
29 if (e = o[n.slice(0, l).join("/")], e && (e = e[d])) {
30 f = e, h = k;
31 break
32 }
33 if (f) break;
34 !i && q && q[d] && (i = q[d], j = k)
35 }!f && i && (f = i, h = j), f && (c.splice(0, h, f), a = c.join("/"))
36 }
37 return a
38 }
39
40 function d(b, c) {
41 return function () {
42 return k.apply(a, s.call(arguments, 0).concat([b, c]))
43 }
44 }
45
46 function e(a) {
47 return function (b) {
48 return c(b, a)
49 }
50 }
51
52 function f(a) {
53 return function (b) {
54 n[a] = b
55 }
56 }
57
58 function g(c) {
59 if (b(o, c)) {
60 var d = o[c];
61 delete o[c], q[c] = !0, j.apply(a, d)
62 }
63 if (!b(n, c) && !b(q, c)) throw new Error("No " + c);
64 return n[c]
65 }
66
67 function h(a) {
68 var b, c = a ? a.indexOf("!") : -1;
69 return c > -1 && (b = a.substring(0, c), a = a.substring(c + 1, a.length)), [b, a]
70 }
71
72 function i(a) {
73 return function () {
74 return p && p.config && p.config[a] || {}
75 }
76 }
77 var j, k, l, m, n = {},
78 o = {},
79 p = {},
80 q = {},
81 r = Object.prototype.hasOwnProperty,
82 s = [].slice,
83 t = /\.js$/;
84 l = function (a, b) {
85 var d, f = h(a),
86 i = f[0];
87 return a = f[1], i && (i = c(i, b), d = g(i)), i ? a = d && d.normalize ? d.normalize(a, e(b)) : c(a, b) : (a = c(a, b), f = h(a), i = f[0], a = f[1], i && (d = g(i))), {
88 f: i ? i + "!" + a : a,
89 n: a,
90 pr: i,
91 p: d
92 }
93 }, m = {
94 require: function (a) {
95 return d(a)
96 },
97 exports: function (a) {
98 var b = n[a];
99 return "undefined" != typeof b ? b : n[a] = {}
100 },
101 module: function (a) {
102 return {
103 id: a,
104 uri: "",
105 exports: n[a],
106 config: i(a)
107 }
108 }
109 }, j = function (c, e, h, i) {
110 var j, k, p, r, s, t, u = [],
111 v = typeof h;
112 if (i = i || c, "undefined" === v || "function" === v) {
113 for (e = !e.length && h.length ? ["require", "exports", "module"] : e, s = 0; s < e.length; s += 1)
114 if (r = l(e[s], i), k = r.f, "require" === k) u[s] = m.require(c);
115 else if ("exports" === k) u[s] = m.exports(c), t = !0;
116 else if ("module" === k) j = u[s] = m.module(c);
117 else if (b(n, k) || b(o, k) || b(q, k)) u[s] = g(k);
118 else {
119 if (!r.p) throw new Error(c + " missing " + k);
120 r.p.load(r.n, d(i, !0), f(k), {}), u[s] = n[k]
121 }
122 p = h ? h.apply(n[c], u) : void 0, c && (j && j.exports !== a && j.exports !== n[c] ? n[c] = j.exports : p === a && t || (n[c] = p))
123 } else c && (n[c] = h)
124 }, requirejs = require = k = function (b, c, d, e, f) {
125 if ("string" == typeof b) return m[b] ? m[b](c) : g(l(b, c).f);
126 if (!b.splice) {
127 if (p = b, p.deps && k(p.deps, p.callback), !c) return;
128 c.splice ? (b = c, c = d, d = null) : b = a
129 }
130 return c = c || function () {}, "function" == typeof d && (d = e, e = f), e ? j(a, b, c, d) : setTimeout(function () {
131 j(a, b, c, d)
132 }, 4), k
133 }, k.config = function (a) {
134 return k(a)
135 }, requirejs._defined = n, define = function (a, c, d) {
136 c.splice || (d = c, c = []), b(n, a) || b(o, a) || (o[a] = [a, c, d])
137 }, define.amd = {
138 jQuery: !0
139 }
140 }(), define("almond", function () {}),
141 function () {
142 function a(a, b, c) {
143 c = (c || 0) - 1;
144 for (var d = a ? a.length : 0; ++c < d;)
145 if (a[c] === b) return c;
146 return -1
147 }
148
149 function b(a, b) {
150 for (var c = a.m, d = b.m, e = -1, f = c.length; ++e < f;) {
151 var g = c[e],
152 h = d[e];
153 if (g !== h) {
154 if (g > h || "undefined" == typeof g) return 1;
155 if (h > g || "undefined" == typeof h) return -1
156 }
157 }
158 return a.n - b.n
159 }
160
161 function c(a) {
162 return "\\" + qa[a]
163 }
164
165 function d(a, b, c) {
166 b || (b = 0), "undefined" == typeof c && (c = a ? a.length : 0);
167 var d = -1;
168 c = c - b || 0;
169 for (var e = Array(0 > c ? 0 : c); ++d < c;) e[d] = a[b + d];
170 return e
171 }
172
173 function e(a) {
174 return a instanceof e ? a : new f(a)
175 }
176
177 function f(a, b) {
178 this.__chain__ = !!b, this.__wrapped__ = a
179 }
180
181 function g(a) {
182 function b() {
183 if (e) {
184 var a = d(e);
185 Ea.apply(a, arguments)
186 }
187 if (this instanceof b) {
188 var g = h(c.prototype),
189 a = c.apply(g, a || arguments);
190 return B(a) ? a : g
191 }
192 return c.apply(f, a || arguments)
193 }
194 var c = a[0],
195 e = a[2],
196 f = a[4];
197 return b
198 }
199
200 function h(a) {
201 return B(a) ? Ga(a) : {}
202 }
203
204 function i(a, b, c) {
205 if ("function" != typeof a) return $;
206 if ("undefined" == typeof b || !("prototype" in a)) return a;
207 switch (c) {
208 case 1:
209 return function (c) {
210 return a.call(b, c)
211 };
212 case 2:
213 return function (c, d) {
214 return a.call(b, c, d)
215 };
216 case 3:
217 return function (c, d, e) {
218 return a.call(b, c, d, e)
219 };
220 case 4:
221 return function (c, d, e, f) {
222 return a.call(b, c, d, e, f)
223 }
224 }
225 return X(a, b)
226 }
227
228 function j(a) {
229 function b() {
230 var a = l ? i : this;
231 if (f) {
232 var q = d(f);
233 Ea.apply(q, arguments)
234 }
235 return (g || n) && (q || (q = d(arguments)), g && Ea.apply(q, g), n && q.length < k) ? (e |= 16, j([c, o ? e : -4 & e, q, null, i, k])) : (q || (q = arguments), m && (c = a[p]), this instanceof b ? (a = h(c.prototype), q = c.apply(a, q), B(q) ? q : a) : c.apply(a, q))
236 }
237 var c = a[0],
238 e = a[1],
239 f = a[2],
240 g = a[3],
241 i = a[4],
242 k = a[5],
243 l = 1 & e,
244 m = 2 & e,
245 n = 4 & e,
246 o = 8 & e,
247 p = c;
248 return b
249 }
250
251 function k(a, b) {
252 for (var c = -1, d = r(), e = a ? a.length : 0, f = []; ++c < e;) {
253 var g = a[c];
254 0 > d(b, g) && f.push(g)
255 }
256 return f
257 }
258
259 function l(a, b, c, d) {
260 d = (d || 0) - 1;
261 for (var e = a ? a.length : 0, f = []; ++d < e;) {
262 var g = a[d];
263 if (g && "object" == typeof g && "number" == typeof g.length && (Pa(g) || u(g))) {
264 b || (g = l(g, b, c));
265 var h = -1,
266 i = g.length,
267 j = f.length;
268 for (f.length += i; ++h < i;) f[j++] = g[h]
269 } else c || f.push(g)
270 }
271 return f
272 }
273
274 function m(a, b, c, d) {
275 if (a === b) return 0 !== a || 1 / a == 1 / b;
276 if (a === a && !(a && pa[typeof a] || b && pa[typeof b])) return !1;
277 if (null == a || null == b) return a === b;
278 var f = za.call(a),
279 g = za.call(b);
280 if (f != g) return !1;
281 switch (f) {
282 case ja:
283 case ka:
284 return +a == +b;
285 case la:
286 return a != +a ? b != +b : 0 == a ? 1 / a == 1 / b : a == +b;
287 case na:
288 case oa:
289 return a == b + ""
290 }
291 if (g = f == ia, !g) {
292 var h = a instanceof e,
293 i = b instanceof e;
294 if (h || i) return m(h ? a.__wrapped__ : a, i ? b.__wrapped__ : b, c, d);
295 if (f != ma) return !1;
296 if (f = a.constructor, h = b.constructor, f != h && !(A(f) && f instanceof f && A(h) && h instanceof h) && "constructor" in a && "constructor" in b) return !1
297 }
298 for (c || (c = []), d || (d = []), f = c.length; f--;)
299 if (c[f] == a) return d[f] == b;
300 var j = !0,
301 k = 0;
302 if (c.push(a), d.push(b), g) {
303 if (k = b.length, j = k == a.length)
304 for (; k-- && (j = m(a[k], b[k], c, d)););
305 } else Wa(b, function (b, e, f) {
306 return Da.call(f, e) ? (k++, !(j = Da.call(a, e) && m(a[e], b, c, d)) && da) : void 0
307 }), j && Wa(a, function (a, b, c) {
308 return Da.call(c, b) ? !(j = -1 < --k) && da : void 0
309 });
310 return c.pop(), d.pop(), j
311 }
312
313 function n(a, b, c) {
314 for (var d = -1, e = r(), f = a ? a.length : 0, g = [], h = c ? [] : g; ++d < f;) {
315 var i = a[d],
316 j = c ? c(i, d, a) : i;
317 (b ? !d || h[h.length - 1] !== j : 0 > e(h, j)) && (c && h.push(j), g.push(i))
318 }
319 return g
320 }
321
322 function o(a) {
323 return function (b, c, d) {
324 var e = {};
325 c = Z(c, d, 3), d = -1;
326 var f = b ? b.length : 0;
327 if ("number" == typeof f)
328 for (; ++d < f;) {
329 var g = b[d];
330 a(e, g, c(g, d, b), b)
331 } else Xa(b, function (b, d, f) {
332 a(e, b, c(b, d, f), f)
333 });
334 return e
335 }
336 }
337
338 function p(a, b, c, d, e, f) {
339 var h = 16 & b,
340 i = 32 & b;
341 if (!(2 & b || A(a))) throw new TypeError;
342 return h && !c.length && (b &= -17, c = !1), i && !d.length && (b &= -33, d = !1), (1 == b || 17 === b ? g : j)([a, b, c, d, e, f])
343 }
344
345 function q(a) {
346 return Sa[a]
347 }
348
349 function r() {
350 var b = (b = e.indexOf) === T ? a : b;
351 return b
352 }
353
354 function s(a) {
355 return "function" == typeof a && Aa.test(a)
356 }
357
358 function t(a) {
359 return Ta[a]
360 }
361
362 function u(a) {
363 return a && "object" == typeof a && "number" == typeof a.length && za.call(a) == ha || !1
364 }
365
366 function v(a) {
367 if (!a) return a;
368 for (var b = 1, c = arguments.length; c > b; b++) {
369 var d = arguments[b];
370 if (d)
371 for (var e in d) a[e] = d[e]
372 }
373 return a
374 }
375
376 function w(a) {
377 if (!a) return a;
378 for (var b = 1, c = arguments.length; c > b; b++) {
379 var d = arguments[b];
380 if (d)
381 for (var e in d) "undefined" == typeof a[e] && (a[e] = d[e])
382 }
383 return a
384 }
385
386 function x(a) {
387 var b = [];
388 return Wa(a, function (a, c) {
389 A(a) && b.push(c)
390 }), b.sort()
391 }
392
393 function y(a) {
394 for (var b = -1, c = Ra(a), d = c.length, e = {}; ++b < d;) {
395 var f = c[b];
396 e[a[f]] = f
397 }
398 return e
399 }
400
401 function z(a) {
402 if (!a) return !0;
403 if (Pa(a) || D(a)) return !a.length;
404 for (var b in a)
405 if (Da.call(a, b)) return !1;
406 return !0
407 }
408
409 function A(a) {
410 return "function" == typeof a
411 }
412
413 function B(a) {
414 return !(!a || !pa[typeof a])
415 }
416
417 function C(a) {
418 return "number" == typeof a || a && "object" == typeof a && za.call(a) == la || !1
419 }
420
421 function D(a) {
422 return "string" == typeof a || a && "object" == typeof a && za.call(a) == oa || !1
423 }
424
425 function E(a) {
426 for (var b = -1, c = Ra(a), d = c.length, e = Array(d); ++b < d;) e[b] = a[c[b]];
427 return e
428 }
429
430 function F(a, b) {
431 var c = r(),
432 d = a ? a.length : 0,
433 e = !1;
434 return d && "number" == typeof d ? e = -1 < c(a, b) : Xa(a, function (a) {
435 return (e = a === b) && da
436 }), e
437 }
438
439 function G(a, b, c) {
440 var d = !0;
441 b = Z(b, c, 3), c = -1;
442 var e = a ? a.length : 0;
443 if ("number" == typeof e)
444 for (; ++c < e && (d = !!b(a[c], c, a)););
445 else Xa(a, function (a, c, e) {
446 return !(d = !!b(a, c, e)) && da
447 });
448 return d
449 }
450
451 function H(a, b, c) {
452 var d = [];
453 b = Z(b, c, 3), c = -1;
454 var e = a ? a.length : 0;
455 if ("number" == typeof e)
456 for (; ++c < e;) {
457 var f = a[c];
458 b(f, c, a) && d.push(f)
459 } else Xa(a, function (a, c, e) {
460 b(a, c, e) && d.push(a)
461 });
462 return d
463 }
464
465 function I(a, b, c) {
466 b = Z(b, c, 3), c = -1;
467 var d = a ? a.length : 0;
468 if ("number" != typeof d) {
469 var e;
470 return Xa(a, function (a, c, d) {
471 return b(a, c, d) ? (e = a, da) : void 0
472 }), e
473 }
474 for (; ++c < d;) {
475 var f = a[c];
476 if (b(f, c, a)) return f
477 }
478 }
479
480 function J(a, b, c) {
481 var d = -1,
482 e = a ? a.length : 0;
483 if (b = b && "undefined" == typeof c ? b : i(b, c, 3), "number" == typeof e)
484 for (; ++d < e && b(a[d], d, a) !== da;);
485 else Xa(a, b)
486 }
487
488 function K(a, b) {
489 var c = a ? a.length : 0;
490 if ("number" == typeof c)
491 for (; c-- && !1 !== b(a[c], c, a););
492 else {
493 var d = Ra(a),
494 c = d.length;
495 Xa(a, function (a, e, f) {
496 return e = d ? d[--c] : --c, !1 === b(f[e], e, f) && da
497 })
498 }
499 }
500
501 function L(a, b, c) {
502 var d = -1,
503 e = a ? a.length : 0;
504 if (b = Z(b, c, 3), "number" == typeof e)
505 for (var f = Array(e); ++d < e;) f[d] = b(a[d], d, a);
506 else f = [], Xa(a, function (a, c, e) {
507 f[++d] = b(a, c, e)
508 });
509 return f
510 }
511
512 function M(a, b, c) {
513 var d = -1 / 0,
514 e = d;
515 "function" != typeof b && c && c[b] === a && (b = null);
516 var f = -1,
517 g = a ? a.length : 0;
518 if (null == b && "number" == typeof g)
519 for (; ++f < g;) c = a[f], c > e && (e = c);
520 else b = Z(b, c, 3), J(a, function (a, c, f) {
521 c = b(a, c, f), c > d && (d = c, e = a)
522 });
523 return e
524 }
525
526 function N(a, b, c, d) {
527 if (!a) return c;
528 var e = 3 > arguments.length;
529 b = Z(b, d, 4);
530 var f = -1,
531 g = a.length;
532 if ("number" == typeof g)
533 for (e && (c = a[++f]); ++f < g;) c = b(c, a[f], f, a);
534 else Xa(a, function (a, d, f) {
535 c = e ? (e = !1, a) : b(c, a, d, f)
536 });
537 return c
538 }
539
540 function O(a, b, c, d) {
541 var e = 3 > arguments.length;
542 return b = Z(b, d, 4), K(a, function (a, d, f) {
543 c = e ? (e = !1, a) : b(c, a, d, f)
544 }), c
545 }
546
547 function P(a) {
548 var b = -1,
549 c = a ? a.length : 0,
550 d = Array("number" == typeof c ? c : 0);
551 return J(a, function (a) {
552 var c;
553 c = ++b, c = 0 + Ca(Na() * (c - 0 + 1)), d[b] = d[c], d[c] = a
554 }), d
555 }
556
557 function Q(a, b, c) {
558 var d;
559 b = Z(b, c, 3), c = -1;
560 var e = a ? a.length : 0;
561 if ("number" == typeof e)
562 for (; ++c < e && !(d = b(a[c], c, a)););
563 else Xa(a, function (a, c, e) {
564 return (d = b(a, c, e)) && da
565 });
566 return !!d
567 }
568
569 function R(a, b, c) {
570 return c && z(b) ? ba : (c ? I : H)(a, b)
571 }
572
573 function S(a, b, c) {
574 var e = 0,
575 f = a ? a.length : 0;
576 if ("number" != typeof b && null != b) {
577 var g = -1;
578 for (b = Z(b, c, 3); ++g < f && b(a[g], g, a);) e++
579 } else if (e = b, null == e || c) return a ? a[0] : ba;
580 return d(a, 0, Ma(La(0, e), f))
581 }
582
583 function T(b, c, d) {
584 if ("number" == typeof d) {
585 var e = b ? b.length : 0;
586 d = 0 > d ? La(0, e + d) : d || 0
587 } else if (d) return d = V(b, c), b[d] === c ? d : -1;
588 return a(b, c, d)
589 }
590
591 function U(a, b, c) {
592 if ("number" != typeof b && null != b) {
593 var e = 0,
594 f = -1,
595 g = a ? a.length : 0;
596 for (b = Z(b, c, 3); ++f < g && b(a[f], f, a);) e++
597 } else e = null == b || c ? 1 : La(0, b);
598 return d(a, e)
599 }
600
601 function V(a, b, c, d) {
602 var e = 0,
603 f = a ? a.length : e;
604 for (c = c ? Z(c, d, 1) : $, b = c(b); f > e;) d = e + f >>> 1, c(a[d]) < b ? e = d + 1 : f = d;
605 return e
606 }
607
608 function W(a, b, c, d) {
609 return "boolean" != typeof b && null != b && (d = c, c = "function" != typeof b && d && d[b] === a ? null : b, b = !1), null != c && (c = Z(c, d, 3)), n(a, b, c)
610 }
611
612 function X(a, b) {
613 return 2 < arguments.length ? p(a, 17, d(arguments, 2), null, b) : p(a, 1, null, null, b)
614 }
615
616 function Y(a, b, c) {
617 var d, e, f, g, h, i, j, k = 0,
618 l = !1,
619 m = !0;
620 if (!A(a)) throw new TypeError;
621 if (b = La(0, b) || 0, !0 === c) var n = !0,
622 m = !1;
623 else B(c) && (n = c.leading, l = "maxWait" in c && (La(b, c.maxWait) || 0), m = "trailing" in c ? c.trailing : m);
624 var o = function () {
625 var c = b - (ab() - g);
626 c > 0 ? i = setTimeout(o, c) : (e && clearTimeout(e), c = j, e = i = j = ba, c && (k = ab(), f = a.apply(h, d), i || e || (d = h = null)))
627 },
628 p = function () {
629 i && clearTimeout(i), e = i = j = ba, (m || l !== b) && (k = ab(), f = a.apply(h, d), i || e || (d = h = null))
630 };
631 return function () {
632 if (d = arguments, g = ab(), h = this, j = m && (i || !n), !1 === l) var c = n && !i;
633 else {
634 e || n || (k = g);
635 var q = l - (g - k),
636 r = 0 >= q;
637 r ? (e && (e = clearTimeout(e)), k = g, f = a.apply(h, d)) : e || (e = setTimeout(p, q))
638 }
639 return r && i ? i = clearTimeout(i) : i || b === l || (i = setTimeout(o, b)), c && (r = !0, f = a.apply(h, d)), !r || i || e || (d = h = null), f
640 }
641 }
642
643 function Z(a, b, c) {
644 var d = typeof a;
645 if (null == a || "function" == d) return i(a, b, c);
646 if ("object" != d) return aa(a);
647 var e = Ra(a);
648 return function (b) {
649 for (var c = e.length, d = !1; c-- && (d = b[e[c]] === a[e[c]]););
650 return d
651 }
652 }
653
654 function $(a) {
655 return a
656 }
657
658 function _(a) {
659 J(x(a), function (b) {
660 var c = e[b] = a[b];
661 e.prototype[b] = function () {
662 var a = [this.__wrapped__];
663 return Ea.apply(a, arguments), a = c.apply(e, a), this.__chain__ ? new f(a, !0) : a
664 }
665 })
666 }
667
668 function aa(a) {
669 return function (b) {
670 return b[a]
671 }
672 }
673 var ba, ca = 0,
674 da = {},
675 ea = +new Date + "",
676 fa = /($^)/,
677 ga = /['\n\r\t\u2028\u2029\\]/g,
678 ha = "[object Arguments]",
679 ia = "[object Array]",
680 ja = "[object Boolean]",
681 ka = "[object Date]",
682 la = "[object Number]",
683 ma = "[object Object]",
684 na = "[object RegExp]",
685 oa = "[object String]",
686 pa = {
687 "boolean": !1,
688 "function": !0,
689 object: !0,
690 number: !1,
691 string: !1,
692 undefined: !1
693 },
694 qa = {
695 "\\": "\\",
696 "'": "'",
697 "\n": "n",
698 "\r": "r",
699 " ": "t",
700 "\u2028": "u2028",
701 "\u2029": "u2029"
702 },
703 ra = pa[typeof window] && window || this,
704 sa = pa[typeof exports] && exports && !exports.nodeType && exports,
705 ta = pa[typeof module] && module && !module.nodeType && module,
706 ua = ta && ta.exports === sa && sa,
707 va = pa[typeof global] && global;
708 !va || va.global !== va && va.window !== va || (ra = va);
709 var wa = [],
710 xa = Object.prototype,
711 ya = ra._,
712 za = xa.toString,
713 Aa = RegExp("^" + (za + "").replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/toString| for [^\]]+/g, ".*?") + "$"),
714 Ba = Math.ceil,
715 Ca = Math.floor,
716 Da = xa.hasOwnProperty,
717 Ea = wa.push,
718 Fa = xa.propertyIsEnumerable,
719 Ga = s(Ga = Object.create) && Ga,
720 Ha = s(Ha = Array.isArray) && Ha,
721 Ia = ra.isFinite,
722 Ja = ra.isNaN,
723 Ka = s(Ka = Object.keys) && Ka,
724 La = Math.max,
725 Ma = Math.min,
726 Na = Math.random;
727 f.prototype = e.prototype;
728 var Oa = {};
729 ! function () {
730 var a = {
731 0: 1,
732 length: 1
733 };
734 Oa.spliceObjects = (wa.splice.call(a, 0, 1), !a[0])
735 }(1), e.templateSettings = {
736 escape: /<%-([\s\S]+?)%>/g,
737 evaluate: /<%([\s\S]+?)%>/g,
738 interpolate: /<%=([\s\S]+?)%>/g,
739 variable: ""
740 }, Ga || (h = function () {
741 function a() {}
742 return function (b) {
743 if (B(b)) {
744 a.prototype = b;
745 var c = new a;
746 a.prototype = null
747 }
748 return c || ra.Object()
749 }
750 }()), u(arguments) || (u = function (a) {
751 return a && "object" == typeof a && "number" == typeof a.length && Da.call(a, "callee") && !Fa.call(a, "callee") || !1
752 });
753 var Pa = Ha || function (a) {
754 return a && "object" == typeof a && "number" == typeof a.length && za.call(a) == ia || !1
755 },
756 Qa = function (a) {
757 var b, c = [];
758 if (!a || !pa[typeof a]) return c;
759 for (b in a) Da.call(a, b) && c.push(b);
760 return c
761 },
762 Ra = Ka ? function (a) {
763 return B(a) ? Ka(a) : []
764 } : Qa,
765 Sa = {
766 "&": "&",
767 "<": "<",
768 ">": ">",
769 '"': """,
770 "'": "'"
771 },
772 Ta = y(Sa),
773 Ua = RegExp("(" + Ra(Ta).join("|") + ")", "g"),
774 Va = RegExp("[" + Ra(Sa).join("") + "]", "g"),
775 Wa = function (a, b) {
776 var c;
777 if (!a || !pa[typeof a]) return a;
778 for (c in a)
779 if (b(a[c], c, a) === da) break;
780 return a
781 },
782 Xa = function (a, b) {
783 var c;
784 if (!a || !pa[typeof a]) return a;
785 for (c in a)
786 if (Da.call(a, c) && b(a[c], c, a) === da) break;
787 return a
788 };
789 A(/x/) && (A = function (a) {
790 return "function" == typeof a && "[object Function]" == za.call(a)
791 });
792 var Ya = o(function (a, b, c) {
793 Da.call(a, c) ? a[c]++ : a[c] = 1
794 }),
795 Za = o(function (a, b, c) {
796 (Da.call(a, c) ? a[c] : a[c] = []).push(b)
797 }),
798 $a = o(function (a, b, c) {
799 a[c] = b
800 }),
801 _a = L,
802 ab = s(ab = Date.now) && ab || function () {
803 return (new Date).getTime()
804 };
805 e.after = function (a, b) {
806 if (!A(b)) throw new TypeError;
807 return function () {
808 return 1 > --a ? b.apply(this, arguments) : void 0
809 }
810 }, e.bind = X, e.bindAll = function (a) {
811 for (var b = 1 < arguments.length ? l(arguments, !0, !1, 1) : x(a), c = -1, d = b.length; ++c < d;) {
812 var e = b[c];
813 a[e] = p(a[e], 1, null, null, a)
814 }
815 return a
816 }, e.chain = function (a) {
817 return a = new f(a), a.__chain__ = !0, a
818 }, e.compact = function (a) {
819 for (var b = -1, c = a ? a.length : 0, d = []; ++b < c;) {
820 var e = a[b];
821 e && d.push(e)
822 }
823 return d
824 }, e.compose = function () {
825 for (var a = arguments, b = a.length; b--;)
826 if (!A(a[b])) throw new TypeError;
827 return function () {
828 for (var b = arguments, c = a.length; c--;) b = [a[c].apply(this, b)];
829 return b[0]
830 }
831 }, e.countBy = Ya, e.debounce = Y, e.defaults = w, e.defer = function (a) {
832 if (!A(a)) throw new TypeError;
833 var b = d(arguments, 1);
834 return setTimeout(function () {
835 a.apply(ba, b)
836 }, 1)
837 }, e.delay = function (a, b) {
838 if (!A(a)) throw new TypeError;
839 var c = d(arguments, 2);
840 return setTimeout(function () {
841 a.apply(ba, c)
842 }, b)
843 }, e.difference = function (a) {
844 return k(a, l(arguments, !0, !0, 1))
845 }, e.filter = H, e.flatten = function (a, b) {
846 return l(a, b)
847 }, e.forEach = J, e.functions = x, e.groupBy = Za, e.indexBy = $a, e.initial = function (a, b, c) {
848 var e = 0,
849 f = a ? a.length : 0;
850 if ("number" != typeof b && null != b) {
851 var g = f;
852 for (b = Z(b, c, 3); g-- && b(a[g], g, a);) e++
853 } else e = null == b || c ? 1 : b || e;
854 return d(a, 0, Ma(La(0, f - e), f))
855 }, e.intersection = function () {
856 for (var a = [], b = -1, c = arguments.length; ++b < c;) {
857 var d = arguments[b];
858 (Pa(d) || u(d)) && a.push(d)
859 }
860 var e = a[0],
861 f = -1,
862 g = r(),
863 h = e ? e.length : 0,
864 i = [];
865 a: for (; ++f < h;)
866 if (d = e[f], 0 > g(i, d)) {
867 for (b = c; --b;)
868 if (0 > g(a[b], d)) continue a;
869 i.push(d)
870 }
871 return i
872 }, e.invert = y, e.invoke = function (a, b) {
873 var c = d(arguments, 2),
874 e = -1,
875 f = "function" == typeof b,
876 g = a ? a.length : 0,
877 h = Array("number" == typeof g ? g : 0);
878 return J(a, function (a) {
879 h[++e] = (f ? b : a[b]).apply(a, c)
880 }), h
881 }, e.keys = Ra, e.map = L, e.max = M, e.memoize = function (a, b) {
882 var c = {};
883 return function () {
884 var d = b ? b.apply(this, arguments) : ea + arguments[0];
885 return Da.call(c, d) ? c[d] : c[d] = a.apply(this, arguments)
886 }
887 }, e.min = function (a, b, c) {
888 var d = 1 / 0,
889 e = d;
890 "function" != typeof b && c && c[b] === a && (b = null);
891 var f = -1,
892 g = a ? a.length : 0;
893 if (null == b && "number" == typeof g)
894 for (; ++f < g;) c = a[f], e > c && (e = c);
895 else b = Z(b, c, 3), J(a, function (a, c, f) {
896 c = b(a, c, f), d > c && (d = c, e = a)
897 });
898 return e
899 }, e.omit = function (a) {
900 var b = [];
901 Wa(a, function (a, c) {
902 b.push(c)
903 });
904 for (var b = k(b, l(arguments, !0, !1, 1)), c = -1, d = b.length, e = {}; ++c < d;) {
905 var f = b[c];
906 e[f] = a[f]
907 }
908 return e
909 }, e.once = function (a) {
910 var b, c;
911 if (!A(a)) throw new TypeError;
912 return function () {
913 return b ? c : (b = !0, c = a.apply(this, arguments), a = null, c)
914 }
915 }, e.pairs = function (a) {
916 for (var b = -1, c = Ra(a), d = c.length, e = Array(d); ++b < d;) {
917 var f = c[b];
918 e[b] = [f, a[f]]
919 }
920 return e
921 }, e.partial = function (a) {
922 return p(a, 16, d(arguments, 1))
923 }, e.pick = function (a) {
924 for (var b = -1, c = l(arguments, !0, !1, 1), d = c.length, e = {}; ++b < d;) {
925 var f = c[b];
926 f in a && (e[f] = a[f])
927 }
928 return e
929 }, e.pluck = _a, e.range = function (a, b, c) {
930 a = +a || 0, c = +c || 1, null == b && (b = a, a = 0);
931 var d = -1;
932 b = La(0, Ba((b - a) / c));
933 for (var e = Array(b); ++d < b;) e[d] = a, a += c;
934 return e
935 }, e.reject = function (a, b, c) {
936 return b = Z(b, c, 3), H(a, function (a, c, d) {
937 return !b(a, c, d)
938 })
939 }, e.rest = U, e.shuffle = P, e.sortBy = function (a, c, d) {
940 var e = -1,
941 f = a ? a.length : 0,
942 g = Array("number" == typeof f ? f : 0);
943 for (c = Z(c, d, 3), J(a, function (a, b, d) {
944 g[++e] = {
945 m: [c(a, b, d)],
946 n: e,
947 o: a
948 }
949 }), f = g.length, g.sort(b); f--;) g[f] = g[f].o;
950 return g
951 }, e.tap = function (a, b) {
952 return b(a), a
953 }, e.throttle = function (a, b, c) {
954 var d = !0,
955 e = !0;
956 if (!A(a)) throw new TypeError;
957 return !1 === c ? d = !1 : B(c) && (d = "leading" in c ? c.leading : d, e = "trailing" in c ? c.trailing : e), c = {}, c.leading = d, c.maxWait = b, c.trailing = e, Y(a, b, c)
958 }, e.times = function (a, b, c) {
959 a = -1 < (a = +a) ? a : 0;
960 var d = -1,
961 e = Array(a);
962 for (b = i(b, c, 1); ++d < a;) e[d] = b(d);
963 return e
964 }, e.toArray = function (a) {
965 return Pa(a) ? d(a) : a && "number" == typeof a.length ? L(a) : E(a)
966 }, e.union = function () {
967 return n(l(arguments, !0, !0))
968 }, e.uniq = W, e.values = E, e.where = R, e.without = function (a) {
969 return k(a, d(arguments, 1))
970 }, e.wrap = function (a, b) {
971 return p(b, 16, [a])
972 }, e.zip = function () {
973 for (var a = -1, b = M(_a(arguments, "length")), c = Array(0 > b ? 0 : b); ++a < b;) c[a] = _a(arguments, a);
974 return c
975 }, e.collect = L, e.drop = U, e.each = J, e.extend = v, e.methods = x, e.object = function (a, b) {
976 var c = -1,
977 d = a ? a.length : 0,
978 e = {};
979 for (b || !d || Pa(a[0]) || (b = []); ++c < d;) {
980 var f = a[c];
981 b ? e[f] = b[c] : f && (e[f[0]] = f[1])
982 }
983 return e
984 }, e.select = H, e.tail = U, e.unique = W, e.clone = function (a) {
985 return B(a) ? Pa(a) ? d(a) : v({}, a) : a
986 }, e.contains = F, e.escape = function (a) {
987 return null == a ? "" : (a + "").replace(Va, q)
988 }, e.every = G, e.find = I, e.has = function (a, b) {
989 return a ? Da.call(a, b) : !1
990 }, e.identity = $, e.indexOf = T, e.isArguments = u, e.isArray = Pa, e.isBoolean = function (a) {
991 return !0 === a || !1 === a || a && "object" == typeof a && za.call(a) == ja || !1
992 }, e.isDate = function (a) {
993 return a && "object" == typeof a && za.call(a) == ka || !1
994 }, e.isElement = function (a) {
995 return a && 1 === a.nodeType || !1
996 }, e.isEmpty = z, e.isEqual = function (a, b) {
997 return m(a, b)
998 }, e.isFinite = function (a) {
999 return Ia(a) && !Ja(parseFloat(a))
1000 }, e.isFunction = A, e.isNaN = function (a) {
1001 return C(a) && a != +a
1002 }, e.isNull = function (a) {
1003 return null === a
1004 }, e.isNumber = C, e.isObject = B, e.isRegExp = function (a) {
1005 return a && pa[typeof a] && za.call(a) == na || !1
1006 }, e.isString = D, e.isUndefined = function (a) {
1007 return "undefined" == typeof a
1008 }, e.lastIndexOf = function (a, b, c) {
1009 var d = a ? a.length : 0;
1010 for ("number" == typeof c && (d = (0 > c ? La(0, d + c) : Ma(c, d - 1)) + 1); d--;)
1011 if (a[d] === b) return d;
1012 return -1
1013 }, e.mixin = _, e.noConflict = function () {
1014 return ra._ = ya, this
1015 }, e.random = function (a, b) {
1016 return null == a && null == b && (b = 1), a = +a || 0, null == b ? (b = a, a = 0) : b = +b || 0, a + Ca(Na() * (b - a + 1))
1017 }, e.reduce = N, e.reduceRight = O, e.result = function (a, b) {
1018 if (a) {
1019 var c = a[b];
1020 return A(c) ? a[b]() : c
1021 }
1022 }, e.size = function (a) {
1023 var b = a ? a.length : 0;
1024 return "number" == typeof b ? b : Ra(a).length
1025 }, e.some = Q, e.sortedIndex = V, e.template = function (a, b, d) {
1026 var f = e,
1027 g = f.templateSettings;
1028 a = (a || "") + "", d = w({}, d, g);
1029 var h = 0,
1030 i = "__p+='",
1031 g = d.variable;
1032 a.replace(RegExp((d.escape || fa).source + "|" + (d.interpolate || fa).source + "|" + (d.evaluate || fa).source + "|$", "g"), function (b, d, e, f, g) {
1033 return i += a.slice(h, g).replace(ga, c), d && (i += "'+_.escape(" + d + ")+'"), f && (i += "';" + f + ";\n__p+='"), e && (i += "'+((__t=(" + e + "))==null?'':__t)+'"), h = g + b.length, b
1034 }), i += "';", g || (g = "obj", i = "with(" + g + "||{}){" + i + "}"), i = "function(" + g + "){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}" + i + "return __p}";
1035 try {
1036 var j = Function("_", "return " + i)(f)
1037 } catch (k) {
1038 throw k.source = i, k
1039 }
1040 return b ? j(b) : (j.source = i, j)
1041 }, e.unescape = function (a) {
1042 return null == a ? "" : (a + "").replace(Ua, t)
1043 }, e.uniqueId = function (a) {
1044 var b = ++ca + "";
1045 return a ? a + b : b
1046 }, e.all = G, e.any = Q, e.detect = I, e.findWhere = function (a, b) {
1047 return R(a, b, !0)
1048 }, e.foldl = N, e.foldr = O, e.include = F, e.inject = N, e.first = S, e.last = function (a, b, c) {
1049 var e = 0,
1050 f = a ? a.length : 0;
1051 if ("number" != typeof b && null != b) {
1052 var g = f;
1053 for (b = Z(b, c, 3); g-- && b(a[g], g, a);) e++
1054 } else if (e = b, null == e || c) return a ? a[f - 1] : ba;
1055 return d(a, La(0, f - e))
1056 }, e.sample = function (a, b, c) {
1057 return a && "number" != typeof a.length && (a = E(a)), null == b || c ? a ? a[0 + Ca(Na() * (a.length - 1 - 0 + 1))] : ba : (a = P(a), a.length = Ma(La(0, b), a.length), a)
1058 }, e.take = S, e.head = S, _(e), e.VERSION = "2.4.1", e.prototype.chain = function () {
1059 return this.__chain__ = !0, this
1060 }, e.prototype.value = function () {
1061 return this.__wrapped__
1062 }, J("pop push reverse shift sort splice unshift".split(" "), function (a) {
1063 var b = wa[a];
1064 e.prototype[a] = function () {
1065 var a = this.__wrapped__;
1066 return b.apply(a, arguments), Oa.spliceObjects || 0 !== a.length || delete a[0], this
1067 }
1068 }), J(["concat", "join", "slice"], function (a) {
1069 var b = wa[a];
1070 e.prototype[a] = function () {
1071 var a = b.apply(this.__wrapped__, arguments);
1072 return this.__chain__ && (a = new f(a), a.__chain__ = !0), a
1073 }
1074 }), "function" == typeof define && "object" == typeof define.amd && define.amd ? (ra._ = e, define("underscore", [], function () {
1075 return e
1076 })) : sa && ta ? ua ? (ta.exports = e)._ = e : sa._ = e : ra._ = e
1077 }.call(this), ! function (a, b) {
1078 "use strict";
1079
1080 function c(a, b) {
1081 var c, d, e = a.toLowerCase();
1082 for (b = [].concat(b), c = 0; b.length > c; c += 1)
1083 if (d = b[c]) {
1084 if (d.test && d.test(a)) return !0;
1085 if (d.toLowerCase() === e) return !0
1086 }
1087 }
1088 var d = b.prototype.trim,
1089 e = b.prototype.trimRight,
1090 f = b.prototype.trimLeft,
1091 g = function (a) {
1092 return 1 * a || 0
1093 },
1094 h = function (a, b) {
1095 if (1 > b) return "";
1096 for (var c = ""; b > 0;) 1 & b && (c += a), b >>= 1, a += a;
1097 return c
1098 },
1099 i = [].slice,
1100 j = function (a) {
1101 return null == a ? "\\s" : a.source ? a.source : "[" + o.escapeRegExp(a) + "]"
1102 },
1103 k = {
1104 lt: "<",
1105 gt: ">",
1106 quot: '"',
1107 amp: "&",
1108 apos: "'"
1109 },
1110 l = {};
1111 for (var m in k) l[k[m]] = m;
1112 l["'"] = "#39";
1113 var n = function () {
1114 function a(a) {
1115 return Object.prototype.toString.call(a).slice(8, -1).toLowerCase()
1116 }
1117 var c = h,
1118 d = function () {
1119 return d.cache.hasOwnProperty(arguments[0]) || (d.cache[arguments[0]] = d.parse(arguments[0])), d.format.call(null, d.cache[arguments[0]], arguments)
1120 };
1121 return d.format = function (d, e) {
1122 var f, g, h, i, j, k, l, m = 1,
1123 o = d.length,
1124 p = "",
1125 q = [];
1126 for (g = 0; o > g; g++)
1127 if (p = a(d[g]), "string" === p) q.push(d[g]);
1128 else if ("array" === p) {
1129 if (i = d[g], i[2])
1130 for (f = e[m], h = 0; i[2].length > h; h++) {
1131 if (!f.hasOwnProperty(i[2][h])) throw new Error(n('[_.sprintf] property "%s" does not exist', i[2][h]));
1132 f = f[i[2][h]]
1133 } else f = i[1] ? e[i[1]] : e[m++];
1134 if (/[^s]/.test(i[8]) && "number" != a(f)) throw new Error(n("[_.sprintf] expecting number but found %s", a(f)));
1135 switch (i[8]) {
1136 case "b":
1137 f = f.toString(2);
1138 break;
1139 case "c":
1140 f = b.fromCharCode(f);
1141 break;
1142 case "d":
1143 f = parseInt(f, 10);
1144 break;
1145 case "e":
1146 f = i[7] ? f.toExponential(i[7]) : f.toExponential();
1147 break;
1148 case "f":
1149 f = i[7] ? parseFloat(f).toFixed(i[7]) : parseFloat(f);
1150 break;
1151 case "o":
1152 f = f.toString(8);
1153 break;
1154 case "s":
1155 f = (f = b(f)) && i[7] ? f.substring(0, i[7]) : f;
1156 break;
1157 case "u":
1158 f = Math.abs(f);
1159 break;
1160 case "x":
1161 f = f.toString(16);
1162 break;
1163 case "X":
1164 f = f.toString(16).toUpperCase()
1165 }
1166 f = /[def]/.test(i[8]) && i[3] && f >= 0 ? "+" + f : f, k = i[4] ? "0" == i[4] ? "0" : i[4].charAt(1) : " ", l = i[6] - b(f).length, j = i[6] ? c(k, l) : "", q.push(i[5] ? f + j : j + f)
1167 }
1168 return q.join("")
1169 }, d.cache = {}, d.parse = function (a) {
1170 for (var b = a, c = [], d = [], e = 0; b;) {
1171 if (null !== (c = /^[^\x25]+/.exec(b))) d.push(c[0]);
1172 else if (null !== (c = /^\x25{2}/.exec(b))) d.push("%");
1173 else {
1174 if (null === (c = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(b))) throw new Error("[_.sprintf] huh?");
1175 if (c[2]) {
1176 e |= 1;
1177 var f = [],
1178 g = c[2],
1179 h = [];
1180 if (null === (h = /^([a-z_][a-z_\d]*)/i.exec(g))) throw new Error("[_.sprintf] huh?");
1181 for (f.push(h[1]);
1182 "" !== (g = g.substring(h[0].length));)
1183 if (null !== (h = /^\.([a-z_][a-z_\d]*)/i.exec(g))) f.push(h[1]);
1184 else {
1185 if (null === (h = /^\[(\d+)\]/.exec(g))) throw new Error("[_.sprintf] huh?");
1186 f.push(h[1])
1187 }
1188 c[2] = f
1189 } else e |= 2;
1190 if (3 === e) throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");
1191 d.push(c)
1192 }
1193 b = b.substring(c[0].length)
1194 }
1195 return d
1196 }, d
1197 }(),
1198 o = {
1199 VERSION: "2.3.0",
1200 isBlank: function (a) {
1201 return null == a && (a = ""), /^\s*$/.test(a)
1202 },
1203 stripTags: function (a) {
1204 return null == a ? "" : b(a).replace(/<\/?[^>]+>/g, "")
1205 },
1206 capitalize: function (a) {
1207 return a = null == a ? "" : b(a), a.charAt(0).toUpperCase() + a.slice(1)
1208 },
1209 chop: function (a, c) {
1210 return null == a ? [] : (a = b(a), c = ~~c, c > 0 ? a.match(new RegExp(".{1," + c + "}", "g")) : [a])
1211 },
1212 clean: function (a) {
1213 return o.strip(a).replace(/\s+/g, " ")
1214 },
1215 count: function (a, c) {
1216 if (null == a || null == c) return 0;
1217 a = b(a), c = b(c);
1218 for (var d = 0, e = 0, f = c.length; e = a.indexOf(c, e), -1 !== e;) d++, e += f;
1219 return d
1220 },
1221 chars: function (a) {
1222 return null == a ? [] : b(a).split("")
1223 },
1224 swapCase: function (a) {
1225 return null == a ? "" : b(a).replace(/\S/g, function (a) {
1226 return a === a.toUpperCase() ? a.toLowerCase() : a.toUpperCase()
1227 })
1228 },
1229 escapeHTML: function (a) {
1230 return null == a ? "" : b(a).replace(/[&<>"']/g, function (a) {
1231 return "&" + l[a] + ";"
1232 })
1233 },
1234 unescapeHTML: function (a) {
1235 return null == a ? "" : b(a).replace(/\&([^;]+);/g, function (a, c) {
1236 var d;
1237 return c in k ? k[c] : (d = c.match(/^#x([\da-fA-F]+)$/)) ? b.fromCharCode(parseInt(d[1], 16)) : (d = c.match(/^#(\d+)$/)) ? b.fromCharCode(~~d[1]) : a
1238 })
1239 },
1240 escapeRegExp: function (a) {
1241 return null == a ? "" : b(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1")
1242 },
1243 splice: function (a, b, c, d) {
1244 var e = o.chars(a);
1245 return e.splice(~~b, ~~c, d), e.join("")
1246 },
1247 insert: function (a, b, c) {
1248 return o.splice(a, b, 0, c)
1249 },
1250 include: function (a, c) {
1251 return "" === c ? !0 : null == a ? !1 : -1 !== b(a).indexOf(c)
1252 },
1253 join: function () {
1254 var a = i.call(arguments),
1255 b = a.shift();
1256 return null == b && (b = ""), a.join(b)
1257 },
1258 lines: function (a) {
1259 return null == a ? [] : b(a).split("\n")
1260 },
1261 reverse: function (a) {
1262 return o.chars(a).reverse().join("")
1263 },
1264 startsWith: function (a, c) {
1265 return "" === c ? !0 : null == a || null == c ? !1 : (a = b(a), c = b(c), a.length >= c.length && a.slice(0, c.length) === c)
1266 },
1267 endsWith: function (a, c) {
1268 return "" === c ? !0 : null == a || null == c ? !1 : (a = b(a), c = b(c), a.length >= c.length && a.slice(a.length - c.length) === c)
1269 },
1270 succ: function (a) {
1271 return null == a ? "" : (a = b(a), a.slice(0, -1) + b.fromCharCode(a.charCodeAt(a.length - 1) + 1))
1272 },
1273 titleize: function (a) {
1274 return null == a ? "" : (a = b(a).toLowerCase(), a.replace(/(?:^|\s|-)\S/g, function (a) {
1275 return a.toUpperCase()
1276 }))
1277 },
1278 camelize: function (a) {
1279 return o.trim(a).replace(/[-_\s]+(.)?/g, function (a, b) {
1280 return b ? b.toUpperCase() : ""
1281 })
1282 },
1283 underscored: function (a) {
1284 return o.trim(a).replace(/([a-z\d])([A-Z]+)/g, "$1_$2").replace(/[-\s]+/g, "_").toLowerCase()
1285 },
1286 dasherize: function (a) {
1287 return o.trim(a).replace(/([A-Z])/g, "-$1").replace(/[-_\s]+/g, "-").toLowerCase()
1288 },
1289 classify: function (a) {
1290 return o.titleize(b(a).replace(/[\W_]/g, " ")).replace(/\s/g, "")
1291 },
1292 humanize: function (a) {
1293 return o.capitalize(o.underscored(a).replace(/_id$/, "").replace(/_/g, " "))
1294 },
1295 trim: function (a, c) {
1296 return null == a ? "" : !c && d ? d.call(a) : (c = j(c), b(a).replace(new RegExp("^" + c + "+|" + c + "+$", "g"), ""))
1297 },
1298 ltrim: function (a, c) {
1299 return null == a ? "" : !c && f ? f.call(a) : (c = j(c), b(a).replace(new RegExp("^" + c + "+"), ""))
1300 },
1301 rtrim: function (a, c) {
1302 return null == a ? "" : !c && e ? e.call(a) : (c = j(c), b(a).replace(new RegExp(c + "+$"), ""))
1303 },
1304 truncate: function (a, c, d) {
1305 return null == a ? "" : (a = b(a), d = d || "...", c = ~~c, a.length > c ? a.slice(0, c) + d : a)
1306 },
1307 prune: function (a, c, d) {
1308 if (null == a) return "";
1309 if (a = b(a), c = ~~c, d = null != d ? b(d) : "...", c >= a.length) return a;
1310 var e = function (a) {
1311 return a.toUpperCase() !== a.toLowerCase() ? "A" : " "
1312 },
1313 f = a.slice(0, c + 1).replace(/.(?=\W*\w*$)/g, e);
1314 return f = f.slice(f.length - 2).match(/\w\w/) ? f.replace(/\s*\S+$/, "") : o.rtrim(f.slice(0, f.length - 1)), (f + d).length > a.length ? a : a.slice(0, f.length) + d
1315 },
1316 words: function (a, b) {
1317 return o.isBlank(a) ? [] : o.trim(a, b).split(b || /\s+/)
1318 },
1319 pad: function (a, c, d, e) {
1320 a = null == a ? "" : b(a), c = ~~c;
1321 var f = 0;
1322 switch (d ? d.length > 1 && (d = d.charAt(0)) : d = " ", e) {
1323 case "right":
1324 return f = c - a.length, a + h(d, f);
1325 case "both":
1326 return f = c - a.length, h(d, Math.ceil(f / 2)) + a + h(d, Math.floor(f / 2));
1327 default:
1328 return f = c - a.length, h(d, f) + a
1329 }
1330 },
1331 lpad: function (a, b, c) {
1332 return o.pad(a, b, c)
1333 },
1334 rpad: function (a, b, c) {
1335 return o.pad(a, b, c, "right")
1336 },
1337 lrpad: function (a, b, c) {
1338 return o.pad(a, b, c, "both")
1339 },
1340 sprintf: n,
1341 vsprintf: function (a, b) {
1342 return b.unshift(a), n.apply(null, b)
1343 },
1344 toNumber: function (a, b) {
1345 return a ? (a = o.trim(a), a.match(/^-?\d+(?:\.\d+)?$/) ? g(g(a).toFixed(~~b)) : NaN) : 0
1346 },
1347 numberFormat: function (a, b, c, d) {
1348 if (isNaN(a) || null == a) return "";
1349 a = a.toFixed(~~b), d = "string" == typeof d ? d : ",";
1350 var e = a.split("."),
1351 f = e[0],
1352 g = e[1] ? (c || ".") + e[1] : "";
1353 return f.replace(/(\d)(?=(?:\d{3})+$)/g, "$1" + d) + g
1354 },
1355 strRight: function (a, c) {
1356 if (null == a) return "";
1357 a = b(a), c = null != c ? b(c) : c;
1358 var d = c ? a.indexOf(c) : -1;
1359 return ~d ? a.slice(d + c.length, a.length) : a
1360 },
1361 strRightBack: function (a, c) {
1362 if (null == a) return "";
1363 a = b(a), c = null != c ? b(c) : c;
1364 var d = c ? a.lastIndexOf(c) : -1;
1365 return ~d ? a.slice(d + c.length, a.length) : a
1366 },
1367 strLeft: function (a, c) {
1368 if (null == a) return "";
1369 a = b(a), c = null != c ? b(c) : c;
1370 var d = c ? a.indexOf(c) : -1;
1371 return ~d ? a.slice(0, d) : a
1372 },
1373 strLeftBack: function (a, b) {
1374 if (null == a) return "";
1375 a += "", b = null != b ? "" + b : b;
1376 var c = a.lastIndexOf(b);
1377 return ~c ? a.slice(0, c) : a
1378 },
1379 toSentence: function (a, b, c, d) {
1380 b = b || ", ", c = c || " and ";
1381 var e = a.slice(),
1382 f = e.pop();
1383 return a.length > 2 && d && (c = o.rtrim(b) + c), e.length ? e.join(b) + c + f : f
1384 },
1385 toSentenceSerial: function () {
1386 var a = i.call(arguments);
1387 return a[3] = !0, o.toSentence.apply(o, a)
1388 },
1389 slugify: function (a) {
1390 if (null == a) return "";
1391 var c = "ąàáäâãåæăćęèéëêìíïîłńòóöôõøśșțùúüûñçżź",
1392 d = "aaaaaaaaaceeeeeiiiilnoooooosstuuuunczz",
1393 e = new RegExp(j(c), "g");
1394 return a = b(a).toLowerCase().replace(e, function (a) {
1395 var b = c.indexOf(a);
1396 return d.charAt(b) || "-"
1397 }), o.dasherize(a.replace(/[^\w\s-]/g, ""))
1398 },
1399 surround: function (a, b) {
1400 return [b, a, b].join("")
1401 },
1402 quote: function (a, b) {
1403 return o.surround(a, b || '"')
1404 },
1405 unquote: function (a, b) {
1406 return b = b || '"', a[0] === b && a[a.length - 1] === b ? a.slice(1, a.length - 1) : a
1407 },
1408 exports: function () {
1409 var a = {};
1410 for (var b in this) this.hasOwnProperty(b) && !b.match(/^(?:include|contains|reverse)$/) && (a[b] = this[b]);
1411 return a
1412 },
1413 repeat: function (a, c, d) {
1414 if (null == a) return "";
1415 if (c = ~~c, null == d) return h(b(a), c);
1416 for (var e = []; c > 0; e[--c] = a);
1417 return e.join(d)
1418 },
1419 naturalCmp: function (a, c) {
1420 if (a == c) return 0;
1421 if (!a) return -1;
1422 if (!c) return 1;
1423 for (var d = /(\.\d+)|(\d+)|(\D+)/g, e = b(a).toLowerCase().match(d), f = b(c).toLowerCase().match(d), g = Math.min(e.length, f.length), h = 0; g > h; h++) {
1424 var i = e[h],
1425 j = f[h];
1426 if (i !== j) {
1427 var k = parseInt(i, 10);
1428 if (!isNaN(k)) {
1429 var l = parseInt(j, 10);
1430 if (!isNaN(l) && k - l) return k - l
1431 }
1432 return j > i ? -1 : 1
1433 }
1434 }
1435 return e.length === f.length ? e.length - f.length : c > a ? -1 : 1
1436 },
1437 levenshtein: function (a, c) {
1438 if (null == a && null == c) return 0;
1439 if (null == a) return b(c).length;
1440 if (null == c) return b(a).length;
1441 a = b(a), c = b(c);
1442 for (var d, e, f = [], g = 0; c.length >= g; g++)
1443 for (var h = 0; a.length >= h; h++) e = g && h ? a.charAt(h - 1) === c.charAt(g - 1) ? d : Math.min(f[h], f[h - 1], d) + 1 : g + h, d = f[h], f[h] = e;
1444 return f.pop()
1445 },
1446 toBoolean: function (a, b, d) {
1447 return "number" == typeof a && (a = "" + a), "string" != typeof a ? !!a : (a = o.trim(a), c(a, b || ["true", "1"]) ? !0 : c(a, d || ["false", "0"]) ? !1 : void 0)
1448 }
1449 };
1450 o.strip = o.trim, o.lstrip = o.ltrim, o.rstrip = o.rtrim, o.center = o.lrpad, o.rjust = o.lpad, o.ljust = o.rpad, o.contains = o.include, o.q = o.quote, o.toBool = o.toBoolean, "undefined" != typeof exports && ("undefined" != typeof module && module.exports && (module.exports = o), exports._s = o), "function" == typeof define && define.amd && define("underscore.string", [], function () {
1451 return o
1452 }), a._ = a._ || {}, a._.string = a._.str = o
1453 }(this, String), define("underscoreLoader", ["underscore", "underscore.string"], function (a, b) {
1454 return a.str = b, a
1455 }), define("loggerService", [], function () {
1456 "use strict";
1457
1458 function a(a) {
1459 return this.name = a, this._log = b, this._warn = b, this._error = b, this._enabled = !1, this
1460 }
1461 var b = function () {},
1462 c = window.console || {};
1463 a.prototype.isEnabled = function () {
1464 return this._enabled
1465 }, a.prototype.setName = function (a) {
1466 this.name = a
1467 }, a.prototype.enable = function () {
1468 this._log = c.log || b, this._warn = c.warn || this._log, this._error = c.error || this._log, this._enabled = !0;
1469 try {
1470 if (Function.prototype.bind && "object" == typeof c)
1471 for (var a = ["log", "warn", "error"], d = 0; d < a.length; d++) c[a[d]] = Function.prototype.call.bind(c[a[d]], c)
1472 } catch (e) {}
1473 return this
1474 }, a.prototype.write = function (a, b) {
1475 var d = Array.prototype.slice.call(b);
1476 d.unshift(this.name + ":"), a.apply(c, d)
1477 }, a.prototype.log = function () {
1478 this.write(this._log, arguments)
1479 }, a.prototype.warn = function () {
1480 this.write(this._warn, arguments)
1481 }, a.prototype.error = function () {
1482 this.write(this._error, arguments)
1483 };
1484 var d = new a("Apollo");
1485 return d.enable(), d
1486 }), define("jquery", ["loggerService"], function (a) {
1487 "use strict";
1488 return window.jQuery ? window.jQuery : window.$ ? window.$ : (a.error("ApolloJS: jQuery is required"), !1)
1489 }), jQuery.extend(jQuery.easing, {
1490 easeInOutQuad: function (a, b, c, d, e) {
1491 return (b /= e / 2) < 1 ? d / 2 * b * b + c : -d / 2 * (--b * (b - 2) - 1) + c
1492 }
1493 }), define("jqueryEaseInOutQuad", function () {}),
1494 function (a) {
1495 "function" == typeof define && define.amd ? define("jqueryTimeago", ["jquery"], a) : a(jQuery)
1496 }(function (a) {
1497 function b() {
1498 var b = c(this),
1499 g = f.settings;
1500 return isNaN(b.datetime) || (0 == g.cutoff || e(b.datetime) < g.cutoff) && a(this).text(d(b.datetime)), this
1501 }
1502
1503 function c(b) {
1504 if (b = a(b), !b.data("timeago")) {
1505 b.data("timeago", {
1506 datetime: f.datetime(b)
1507 });
1508 var c = a.trim(b.text());
1509 f.settings.localeTitle ? b.attr("title", b.data("timeago").datetime.toLocaleString()) : !(c.length > 0) || f.isTime(b) && b.attr("title") || b.attr("title", c)
1510 }
1511 return b.data("timeago")
1512 }
1513
1514 function d(a) {
1515 return f.inWords(e(a))
1516 }
1517
1518 function e(a) {
1519 return (new Date).getTime() - a.getTime()
1520 }
1521 a.timeago = function (b) {
1522 return d(b instanceof Date ? b : "string" == typeof b ? a.timeago.parse(b) : "number" == typeof b ? new Date(b) : a.timeago.datetime(b))
1523 };
1524 var f = a.timeago;
1525 a.extend(a.timeago, {
1526 settings: {
1527 refreshMillis: 6e4,
1528 allowFuture: !1,
1529 localeTitle: !1,
1530 cutoff: 0,
1531 strings: {
1532 prefixAgo: null,
1533 prefixFromNow: null,
1534 suffixAgo: "ago",
1535 suffixFromNow: "from now",
1536 seconds: "less than a minute",
1537 minute: "about a minute",
1538 minutes: "%d minutes",
1539 hour: "about an hour",
1540 hours: "about %d hours",
1541 day: "a day",
1542 days: "%d days",
1543 month: "about a month",
1544 months: "%d months",
1545 year: "about a year",
1546 years: "%d years",
1547 wordSeparator: " ",
1548 numbers: []
1549 }
1550 },
1551 inWords: function (b) {
1552 function c(c, e) {
1553 var f = a.isFunction(c) ? c(e, b) : c,
1554 g = d.numbers && d.numbers[e] || e;
1555 return f.replace(/%d/i, g)
1556 }
1557 var d = this.settings.strings,
1558 e = d.prefixAgo,
1559 f = d.suffixAgo;
1560 this.settings.allowFuture && 0 > b && (e = d.prefixFromNow, f = d.suffixFromNow);
1561 var g = Math.abs(b) / 1e3,
1562 h = g / 60,
1563 i = h / 60,
1564 j = i / 24,
1565 k = j / 365,
1566 l = 45 > g && c(d.seconds, Math.round(g)) || 90 > g && c(d.minute, 1) || 45 > h && c(d.minutes, Math.round(h)) || 90 > h && c(d.hour, 1) || 24 > i && c(d.hours, Math.round(i)) || 42 > i && c(d.day, 1) || 30 > j && c(d.days, Math.round(j)) || 45 > j && c(d.month, 1) || 365 > j && c(d.months, Math.round(j / 30)) || 1.5 > k && c(d.year, 1) || c(d.years, Math.round(k)),
1567 m = d.wordSeparator || "";
1568 return void 0 === d.wordSeparator && (m = " "), a.trim([e, l, f].join(m))
1569 },
1570 parse: function (b) {
1571 var c = a.trim(b);
1572 return c = c.replace(/\.\d+/, ""), c = c.replace(/-/, "/").replace(/-/, "/"), c = c.replace(/T/, " ").replace(/Z/, " UTC"), c = c.replace(/([\+\-]\d\d)\:?(\d\d)/, " $1$2"), c = c.replace(/([\+\-]\d\d)$/, " $100"), new Date(c)
1573 },
1574 datetime: function (b) {
1575 var c = f.isTime(b) ? a(b).attr("datetime") : a(b).attr("title");
1576 return f.parse(c)
1577 },
1578 isTime: function (b) {
1579 return "time" === a(b).get(0).tagName.toLowerCase()
1580 }
1581 });
1582 var g = {
1583 init: function () {
1584 var c = a.proxy(b, this);
1585 c();
1586 var d = f.settings;
1587 d.refreshMillis > 0 && (this._timeagoInterval = setInterval(c, d.refreshMillis))
1588 },
1589 update: function (c) {
1590 var d = f.parse(c);
1591 a(this).data("timeago", {
1592 datetime: d
1593 }), f.settings.localeTitle && a(this).attr("title", d.toLocaleString()), b.apply(this)
1594 },
1595 updateFromDOM: function () {
1596 a(this).data("timeago", {
1597 datetime: f.parse(f.isTime(this) ? a(this).attr("datetime") : a(this).attr("title"))
1598 }), b.apply(this)
1599 },
1600 dispose: function () {
1601 this._timeagoInterval && (window.clearInterval(this._timeagoInterval), this._timeagoInterval = null)
1602 }
1603 };
1604 a.fn.timeago = function (a, b) {
1605 var c = a ? g[a] : g.init;
1606 if (!c) throw new Error("Unknown function name '" + a + "' for timeago");
1607 return this.each(function () {
1608 c.call(this, b)
1609 }), this
1610 }, document.createElement("abbr"), document.createElement("time")
1611 }),
1612 function (a) {
1613 var b = {
1614 key: null,
1615 endpoint: "oembed",
1616 secure: !0,
1617 query: {},
1618 method: "replace",
1619 addImageStyles: !0,
1620 wrapElement: "div",
1621 className: "embed",
1622 batch: 20,
1623 urlRe: null,
1624 oembedApiUrl: "api.embed.ly",
1625 imageApiUrl: "i.embed.ly"
1626 },
1627 c = {},
1628 d = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,
1629 e = function (a) {
1630 return null === a || void 0 === a
1631 },
1632 f = function (b, c) {
1633 var d = [],
1634 e = [];
1635 return a.each(b, function (a, b) {
1636 e.push(b), e.length === c && (d.push(e), e = [])
1637 }), 0 !== e.length && d.push(e), d
1638 },
1639 g = function (b) {
1640 return e(b) ? [] : a.isArray(b) ? b : [b]
1641 },
1642 h = function (b) {
1643 return a.map(b[0], function (c, d) {
1644 return [a.map(b, function (a) {
1645 return a[d]
1646 })]
1647 })
1648 },
1649 i = function (a, b, c) {
1650 this.init(a, b, c)
1651 };
1652 i.prototype = {
1653 init: function (b) {
1654 this.urls = b, this.count = 0, this.results = {}, this._deferred = a.Deferred()
1655 },
1656 notify: function (b) {
1657 if (this.results[b.original_url] = b, this.count++, this._deferred.notify.apply(this._deferred, [b]), this.count === this.urls.length) {
1658 var c = this,
1659 d = a.map(this.urls, function (a) {
1660 return c.results[a]
1661 });
1662 this._deferred.resolve(d)
1663 }
1664 return this
1665 },
1666 state: function () {
1667 return this._deferred.state.apply(this._deferred, arguments)
1668 }
1669 }, window.Keeper = i;
1670 var j = function () {};
1671 j.prototype = {
1672 defaults: {},
1673 log: function (a, b) {
1674 e(window.console) || e(window.console[a]) || window.console[a].apply(window.console, [b])
1675 },
1676 build: function (c, d, f) {
1677 f = a.extend({}, b, a.embedly.defaults, "object" == typeof f && f);
1678 var g = f.secure;
1679 e(g) && (g = "https:" === window.location.protocol ? !0 : !1);
1680 var h = (g ? "https" : "http") + "://" + f.oembedApiUrl + "/" + ("objectify" === c ? "2/" : "1/") + c,
1681 i = e(f.query) ? {} : f.query;
1682 return i.key = f.key, h += "?" + a.param(i), h += "&urls=" + a.map(d, encodeURIComponent).join(",")
1683 },
1684 ajax: function (j, k, l) {
1685 if (l = a.extend({}, b, a.embedly.defaults, "object" == typeof l && l), e(l.key)) return this.log("error", "Embedly jQuery requires an API Key. Please sign up for one at http://embed.ly"), null;
1686 k = g(k);
1687 var m, n = new i(k),
1688 o = [],
1689 p = [];
1690 a.each(k, function (a, b) {
1691 m = !1, d.test(b) && (m = !0, null !== l.urlRe && l.urlRe.test && !l.urlRe.test(b) && (m = !1)), m === !0 ? o.push(b) : p.push({
1692 url: b,
1693 original_url: b,
1694 error: !0,
1695 invalid: !0,
1696 type: "error",
1697 error_message: 'Invalid URL "' + b + '"'
1698 })
1699 });
1700 var q = f(o, l.batch),
1701 r = this;
1702 return a.each(q, function (b, d) {
1703 for (var e = d[0].replace(/[^a-z]+/gi, ""); c.hasOwnProperty(e);) e += "a";
1704 c[e] = !0, a.ajax({
1705 url: r.build(j, d, l),
1706 dataType: "jsonp",
1707 jsonpCallback: e,
1708 cache: !0,
1709 success: function (b) {
1710 a.each(h([d, b]), function (a, b) {
1711 var c = b[1];
1712 c.original_url = b[0], c.invalid = !1, n.notify(c)
1713 })
1714 }
1715 })
1716 }), p.length && setTimeout(function () {
1717 a.each(p, function (a, b) {
1718 n.notify(b)
1719 })
1720 }, 1), n._deferred
1721 },
1722 oembed: function (a, b) {
1723 return this.ajax("oembed", a, b)
1724 },
1725 preview: function (a, b) {
1726 return this.ajax("preview", a, b)
1727 },
1728 objectify: function (a, b) {
1729 return this.ajax("objectify", a, b)
1730 },
1731 extract: function (a, b) {
1732 return this.ajax("extract", a, b)
1733 }
1734 };
1735 var k = function () {};
1736 k.prototype = {
1737 build: function (c, d, f) {
1738 f = a.extend({}, b, a.embedly.defaults, "object" == typeof f && f);
1739 var g = f.secure;
1740 e(g) && (g = "https:" === window.location.protocol ? !0 : !1);
1741 var h = (g ? "https" : "http") + "://" + f.imageApiUrl + "/" + ("display" === c ? "1/" : "1/display/") + c,
1742 i = e(f.query) ? {} : f.query;
1743 return i.key = f.key, h += "?" + a.param(i), h += "&url=" + encodeURIComponent(d)
1744 },
1745 display: function (a, b) {
1746 return this.build("display", a, b)
1747 },
1748 resize: function (a, b) {
1749 return this.build("resize", a, b)
1750 },
1751 fill: function (a, b) {
1752 return this.build("fill", a, b)
1753 },
1754 crop: function (a, b) {
1755 return this.build("crop", a, b)
1756 }
1757 };
1758 var l = function (a, b, c) {
1759 this.init(a, b, c)
1760 };
1761 l.prototype = {
1762 init: function (b, c, d) {
1763 this.elem = b, this.$elem = a(b), this.original_url = c, this.options = d, this.loaded = a.Deferred();
1764 var e = this;
1765 this.loaded.done(function () {
1766 e.$elem.trigger("loaded", [e])
1767 }), this.$elem.trigger("initialized", [this])
1768 },
1769 progress: function (b) {
1770 a.extend(this, b), this.options.display ? this.options.display.apply(this.elem, [this, this.elem]) : "oembed" === this.options.endpoint && this.display(), this.loaded.resolve(this)
1771 },
1772 imageStyle: function () {
1773 var a, b = [];
1774 return this.options.addImageStyles && (this.options.query.maxwidth && (a = isNaN(parseInt(this.options.query.maxwidth, 10)) ? "" : "px", b.push("max-width: " + this.options.query.maxwidth + a)), this.options.query.maxheight && (a = isNaN(parseInt(this.options.query.maxheight, 10)) ? "" : "px", b.push("max-height: " + this.options.query.maxheight + a))), b.join(";")
1775 },
1776 display: function () {
1777 if ("error" === this.type) return !1;
1778 this.style = this.imageStyle();
1779 var a;
1780 "photo" === this.type ? (a = "<a href='" + this.original_url + "' target='_blank'>", a += "<img style='" + this.style + "' src='" + this.url + "' alt='" + this.title + "' /></a>") : "video" === this.type || "rich" === this.type ? a = this.html : (this.title = this.title || this.url, a = this.thumbnail_url ? "<img src='" + this.thumbnail_url + "' class='thumb' style='" + this.style + "'/>" : "", a += "<a href='" + this.original_url + "'>" + this.title + "</a>", a += this.provider_name ? "<a href='" + this.provider_url + "' class='provider'>" + this.provider_name + "</a>" : "", a += this.description ? '<div class="description">' + this.description + "</div>" : ""), this.options.wrapElement && (a = "<" + this.options.wrapElement + ' class="' + this.options.className + '">' + a + "</" + this.options.wrapElement + ">"), this.code = a, "replace" === this.options.method ? this.$elem.replaceWith(this.code) : "after" === this.options.method ? this.$elem.after(this.code) : "afterParent" === this.options.method ? this.$elem.parent().after(this.code) : "replaceParent" === this.options.method && this.$elem.parent().replaceWith(this.code), this.$elem.trigger("displayed", [this])
1781 }
1782 }, a.embedly = new j, a.embedly.display = new k, a.fn.embedly = function (c) {
1783 if (void 0 === c || "object" == typeof c) {
1784 if (c = a.extend({}, b, a.embedly.defaults, "object" == typeof c && c), e(c.key)) return a.embedly.log("error", "Embedly jQuery requires an API Key. Please sign up for one at http://embed.ly"), this.each(a.noop);
1785 var d = {},
1786 f = function (b) {
1787 if (!a.data(a(b), "embedly")) {
1788 var e = a(b).attr("href"),
1789 f = new l(b, e, c);
1790 a.data(b, "embedly", f), d.hasOwnProperty(e) ? d[e].push(f) : d[e] = [f]
1791 }
1792 },
1793 g = this.each(function () {
1794 e(a(this).attr("href")) ? a(this).find("a").each(function () {
1795 !e(a(this).attr("href")) && a(this).text().match(/^http/) && f(this)
1796 }) : f(this)
1797 }),
1798 h = a.embedly.ajax(c.endpoint, a.map(d, function (a, b) {
1799 return b
1800 }), c).progress(function (b) {
1801 a.each(d[b.original_url], function (a, c) {
1802 c.progress(b)
1803 })
1804 });
1805 return c.progress && h.progress(c.progress), c.done && h.done(c.done), g
1806 }
1807 }, a.expr[":"].embedly = function (b) {
1808 return !e(a(b).data("embedly"))
1809 }, a.fn.display = function (c, d) {
1810 if (e(c) && (c = "display"), void 0 === d || "object" == typeof d) {
1811 if (d = a.extend({}, b, a.embedly.defaults, "object" == typeof d && d), e(d.key)) return a.embedly.log("error", "Embedly jQuery requires an API Key. Please sign up for one at http://embed.ly/display"), this.each(a.noop);
1812 var f = function (b) {
1813 var e = a(b);
1814 if (!e.data("display")) {
1815 var f = e.data("src") || e.attr("href"),
1816 g = {
1817 original_url: f,
1818 url: a.embedly.display.build(c, f, d)
1819 };
1820 e.data("display", g), e.trigger("initialized", [b]);
1821 var h = "<img src='" + g.url + "' />";
1822 e.is("a") ? e.append(h) : e.replaceWith(h)
1823 }
1824 },
1825 g = function (b) {
1826 return e(a(b).data("src")) && e(a(b).attr("href")) ? !1 : !0
1827 },
1828 h = this.each(function () {
1829 g(this) ? f(this) : a(this).find("img,a").each(function () {
1830 g(this) && f(this)
1831 })
1832 });
1833 return h
1834 }
1835 }, a.expr[":"].display = function (b) {
1836 return !e(a(b).data("display"))
1837 }
1838 }(jQuery, window), define("jqueryEmbedly", function () {}),
1839 function (a) {
1840 "function" == typeof define && define.amd ? define("jqueryExpanding", ["jquery"], a) : a(jQuery)
1841 }(function (a) {
1842 function b(a) {
1843 window.console && console.warn && console.warn(a)
1844 }
1845 var c = function (b, d) {
1846 c._registry.push(this), this.$textarea = b, this.$textCopy = a("<span />"), this.$clone = a("<pre class='expanding-clone'><br /></pre>").prepend(this.$textCopy), this._resetStyles(), this._setCloneStyles(), this._setTextareaStyles(), b.wrap(a("<div class='expanding-wrapper' style='position:relative' />")).after(this.$clone), this.attach(), this.update(), d.update && b.bind("update.expanding", d.update)
1847 };
1848 c._registry = [], c.getExpandingInstance = function (b) {
1849 var d = a.map(c._registry, function (a) {
1850 return a.$textarea[0]
1851 }),
1852 e = a.inArray(b, d);
1853 return e > -1 ? c._registry[e] : null
1854 };
1855 var d = function () {
1856 var a = -1;
1857 if ("Microsoft Internet Explorer" === navigator.appName) {
1858 var b = navigator.userAgent,
1859 c = new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})");
1860 null !== c.exec(b) && (a = parseFloat(RegExp.$1))
1861 }
1862 return a
1863 }(),
1864 e = "oninput" in document.createElement("input") && 9 !== d;
1865 c.prototype = {
1866 attach: function () {
1867 var a = "input.expanding change.expanding",
1868 b = this;
1869 e || (a += " keyup.expanding"), this.$textarea.bind(a, function () {
1870 b.update()
1871 })
1872 },
1873 update: function () {
1874 this.$textCopy.text(this.$textarea.val().replace(/\r\n/g, "\n")), this.$textarea.triggerHandler("update.expanding")
1875 },
1876 destroy: function () {
1877 this.$clone.remove(), this.$textarea.unwrap().attr("style", this._oldTextareaStyles || ""), delete this._oldTextareaStyles;
1878 var b = a.inArray(this, c._registry);
1879 b > -1 && c._registry.splice(b, 1), this.$textarea.unbind("input.expanding change.expanding keyup.expanding update.expanding")
1880 },
1881 _resetStyles: function () {
1882 this._oldTextareaStyles = this.$textarea.attr("style"), this.$textarea.add(this.$clone).css({
1883 margin: 0,
1884 webkitBoxSizing: "border-box",
1885 mozBoxSizing: "border-box",
1886 boxSizing: "border-box",
1887 width: "100%"
1888 })
1889 },
1890 _setCloneStyles: function () {
1891 var a = {
1892 display: "block",
1893 border: "0 solid",
1894 visibility: "hidden",
1895 minHeight: this.$textarea.outerHeight()
1896 };
1897 "off" === this.$textarea.attr("wrap") ? a.overflowX = "scroll" : a.whiteSpace = "pre-wrap", this.$clone.css(a), this._copyTextareaStylesToClone()
1898 },
1899 _copyTextareaStylesToClone: function () {
1900 var b = this,
1901 c = ["lineHeight", "textDecoration", "letterSpacing", "fontSize", "fontFamily", "fontStyle", "fontWeight", "textTransform", "textAlign", "direction", "wordSpacing", "fontSizeAdjust", "wordWrap", "word-break", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "maxHeight"];
1902 a.each(c, function (a, c) {
1903 var d = b.$textarea.css(c);
1904 b.$clone.css(c) !== d && (b.$clone.css(c, d), "maxHeight" === c && "none" !== d && b.$clone.css("overflow", "hidden"))
1905 })
1906 },
1907 _setTextareaStyles: function () {
1908 this.$textarea.css({
1909 position: "absolute",
1910 top: 0,
1911 left: 0,
1912 height: "100%",
1913 resize: "none",
1914 overflow: "auto"
1915 })
1916 }
1917 }, a.expanding = a.extend({
1918 autoInitialize: !0,
1919 initialSelector: "textarea.expanding",
1920 opts: {
1921 update: function () {}
1922 }
1923 }, a.expanding || {}), a.fn.expanding = function (d) {
1924 if ("destroy" === d) return this.each(function () {
1925 var a = c.getExpandingInstance(this);
1926 a && a.destroy()
1927 }), this;
1928 if ("active" === d) return !!this.filter(function () {
1929 return !!c.getExpandingInstance(this)
1930 }).length;
1931 var e = a.extend({}, a.expanding.opts, d);
1932 return this.filter("textarea").each(function () {
1933 var d = this.offsetWidth > 0 || this.offsetHeight > 0,
1934 f = c.getExpandingInstance(this);
1935 d && !f ? new c(a(this), e) : (d || b("ExpandingTextareas: attempt to initialize an invisible textarea. Call expanding() again once it has been inserted into the page and/or is visible."), f && b("ExpandingTextareas: attempt to initialize a textarea that has already been initialized. Subsequent calls are ignored."))
1936 }), this
1937 }, a(function () {
1938 a.expanding.autoInitialize && a(a.expanding.initialSelector).expanding()
1939 })
1940 }), "object" != typeof JSON && (JSON = {}),
1941 function () {
1942 "use strict";
1943
1944 function f(a) {
1945 return 10 > a ? "0" + a : a
1946 }
1947
1948 function quote(a) {
1949 return escapable.lastIndex = 0, escapable.test(a) ? '"' + a.replace(escapable, function (a) {
1950 var b = meta[a];
1951 return "string" == typeof b ? b : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
1952 }) + '"' : '"' + a + '"'
1953 }
1954
1955 function str(a, b) {
1956 var c, d, e, f, g, h = gap,
1957 i = b[a];
1958 switch (i && "object" == typeof i && "function" == typeof i.toJSON && (i = i.toJSON(a)), "function" == typeof rep && (i = rep.call(b, a, i)), typeof i) {
1959 case "string":
1960 return quote(i);
1961 case "number":
1962 return isFinite(i) ? String(i) : "null";
1963 case "boolean":
1964 case "null":
1965 return String(i);
1966 case "object":
1967 if (!i) return "null";
1968 if (gap += indent, g = [], "[object Array]" === Object.prototype.toString.apply(i)) {
1969 for (f = i.length, c = 0; f > c; c += 1) g[c] = str(c, i) || "null";
1970 return e = 0 === g.length ? "[]" : gap ? "[\n" + gap + g.join(",\n" + gap) + "\n" + h + "]" : "[" + g.join(",") + "]", gap = h, e
1971 }
1972 if (rep && "object" == typeof rep)
1973 for (f = rep.length, c = 0; f > c; c += 1) "string" == typeof rep[c] && (d = rep[c], e = str(d, i), e && g.push(quote(d) + (gap ? ": " : ":") + e));
1974 else
1975 for (d in i) Object.prototype.hasOwnProperty.call(i, d) && (e = str(d, i), e && g.push(quote(d) + (gap ? ": " : ":") + e));
1976 return e = 0 === g.length ? "{}" : gap ? "{\n" + gap + g.join(",\n" + gap) + "\n" + h + "}" : "{" + g.join(",") + "}", gap = h, e
1977 }
1978 }
1979 "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function (a) {
1980 return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
1981 }, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function (a) {
1982 return this.valueOf()
1983 });
1984 var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
1985 escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
1986 gap, indent, meta = {
1987 "\b": "\\b",
1988 " ": "\\t",
1989 "\n": "\\n",
1990 "\f": "\\f",
1991 "\r": "\\r",
1992 '"': '\\"',
1993 "\\": "\\\\"
1994 },
1995 rep;
1996 "function" != typeof JSON.stringify && (JSON.stringify = function (a, b, c) {
1997 var d;
1998 if (gap = "", indent = "", "number" == typeof c)
1999 for (d = 0; c > d; d += 1) indent += " ";
2000 else "string" == typeof c && (indent = c);
2001 if (rep = b, b && "function" != typeof b && ("object" != typeof b || "number" != typeof b.length)) throw new Error("JSON.stringify");
2002 return str("", {
2003 "": a
2004 })
2005 }), "function" != typeof JSON.parse && (JSON.parse = function (text, reviver) {
2006 function walk(a, b) {
2007 var c, d, e = a[b];
2008 if (e && "object" == typeof e)
2009 for (c in e) Object.prototype.hasOwnProperty.call(e, c) && (d = walk(e, c), void 0 !== d ? e[c] = d : delete e[c]);
2010 return reviver.call(a, b, e)
2011 }
2012 var j;
2013 if (text = String(text), cx.lastIndex = 0, cx.test(text) && (text = text.replace(cx, function (a) {
2014 return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
2015 })), /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return j = eval("(" + text + ")"), "function" == typeof reviver ? walk({
2016 "": j
2017 }, "") : j;
2018 throw new SyntaxError("JSON.parse")
2019 })
2020 }(),
2021 function (a, b) {
2022 "use strict";
2023 var c = a.History = a.History || {},
2024 d = a.jQuery;
2025 if ("undefined" != typeof c.Adapter) throw new Error("History.js Adapter has already been loaded...");
2026 c.Adapter = {
2027 bind: function (a, b, c) {
2028 d(a).bind(b, c)
2029 },
2030 trigger: function (a, b, c) {
2031 d(a).trigger(b, c)
2032 },
2033 extractEventData: function (a, c, d) {
2034 var e = c && c.originalEvent && c.originalEvent[a] || d && d[a] || b;
2035 return e
2036 },
2037 onDomLoad: function (a) {
2038 d(a)
2039 }
2040 }, "undefined" != typeof c.init && c.init()
2041 }(window),
2042 function (a, b) {
2043 "use strict";
2044 var c = a.document,
2045 d = a.setTimeout || d,
2046 e = a.clearTimeout || e,
2047 f = a.setInterval || f,
2048 g = a.History = a.History || {};
2049 if ("undefined" != typeof g.initHtml4) throw new Error("History.js HTML4 Support has already been loaded...");
2050 g.initHtml4 = function () {
2051 return "undefined" != typeof g.initHtml4.initialized ? !1 : (g.initHtml4.initialized = !0, g.enabled = !0, g.savedHashes = [], g.isLastHash = function (a) {
2052 var b, c = g.getHashByIndex();
2053 return b = a === c
2054 }, g.isHashEqual = function (a, b) {
2055 return a = encodeURIComponent(a).replace(/%25/g, "%"), b = encodeURIComponent(b).replace(/%25/g, "%"), a === b
2056 }, g.saveHash = function (a) {
2057 return g.isLastHash(a) ? !1 : (g.savedHashes.push(a), !0)
2058 }, g.getHashByIndex = function (a) {
2059 var b = null;
2060 return b = "undefined" == typeof a ? g.savedHashes[g.savedHashes.length - 1] : 0 > a ? g.savedHashes[g.savedHashes.length + a] : g.savedHashes[a]
2061 }, g.discardedHashes = {}, g.discardedStates = {}, g.discardState = function (a, b, c) {
2062 var d, e = g.getHashByState(a);
2063 return d = {
2064 discardedState: a,
2065 backState: c,
2066 forwardState: b
2067 }, g.discardedStates[e] = d, !0
2068 }, g.discardHash = function (a, b, c) {
2069 var d = {
2070 discardedHash: a,
2071 backState: c,
2072 forwardState: b
2073 };
2074 return g.discardedHashes[a] = d, !0
2075 }, g.discardedState = function (a) {
2076 var b, c = g.getHashByState(a);
2077 return b = g.discardedStates[c] || !1
2078 }, g.discardedHash = function (a) {
2079 var b = g.discardedHashes[a] || !1;
2080 return b
2081 }, g.recycleState = function (a) {
2082 var b = g.getHashByState(a);
2083 return g.discardedState(a) && delete g.discardedStates[b], !0
2084 }, g.emulated.hashChange && (g.hashChangeInit = function () {
2085 g.checkerFunction = null;
2086 var b, d, e, h, i = "",
2087 j = Boolean(g.getHash());
2088 return g.isInternetExplorer() ? (b = "historyjs-iframe", d = c.createElement("iframe"), d.setAttribute("id", b), d.setAttribute("src", "#"), d.style.display = "none", c.body.appendChild(d), d.contentWindow.document.open(), d.contentWindow.document.close(), e = "", h = !1, g.checkerFunction = function () {
2089 if (h) return !1;
2090 h = !0;
2091 var b = g.getHash(),
2092 c = g.getHash(d.contentWindow.document);
2093 return b !== i ? (i = b, c !== b && (e = c = b, d.contentWindow.document.open(), d.contentWindow.document.close(), d.contentWindow.document.location.hash = g.escapeHash(b)), g.Adapter.trigger(a, "hashchange")) : c !== e && (e = c, j && "" === c ? g.back() : g.setHash(c, !1)), h = !1, !0
2094 }) : g.checkerFunction = function () {
2095 var b = g.getHash() || "";
2096 return b !== i && (i = b, g.Adapter.trigger(a, "hashchange")), !0
2097 }, g.intervalList.push(f(g.checkerFunction, g.options.hashChangeInterval)), !0
2098 }, g.Adapter.onDomLoad(g.hashChangeInit)), g.emulated.pushState && (g.onHashChange = function (b) {
2099 var c, d = b && b.newURL || g.getLocationHref(),
2100 e = g.getHashByUrl(d),
2101 f = null,
2102 h = null;
2103 return g.isLastHash(e) ? (g.busy(!1), !1) : (g.doubleCheckComplete(), g.saveHash(e), e && g.isTraditionalAnchor(e) ? (g.Adapter.trigger(a, "anchorchange"), g.busy(!1), !1) : (f = g.extractState(g.getFullUrl(e || g.getLocationHref()), !0), g.isLastSavedState(f) ? (g.busy(!1), !1) : (h = g.getHashByState(f), (c = g.discardedState(f)) ? (g.getHashByIndex(-2) === g.getHashByState(c.forwardState) ? g.back(!1) : g.forward(!1), !1) : (g.pushState(f.data, f.title, encodeURI(f.url), !1), !0))))
2104 }, g.Adapter.bind(a, "hashchange", g.onHashChange), g.pushState = function (b, c, d, e) {
2105 if (d = encodeURI(d).replace(/%25/g, "%"), g.getHashByUrl(d)) throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).");
2106 if (e !== !1 && g.busy()) return g.pushQueue({
2107 scope: g,
2108 callback: g.pushState,
2109 args: arguments,
2110 queue: e
2111 }), !1;
2112 g.busy(!0);
2113 var f = g.createStateObject(b, c, d),
2114 h = g.getHashByState(f),
2115 i = g.getState(!1),
2116 j = g.getHashByState(i),
2117 k = g.getHash(),
2118 l = g.expectedStateId == f.id;
2119 return g.storeState(f), g.expectedStateId = f.id, g.recycleState(f), g.setTitle(f), h === j ? (g.busy(!1), !1) : (g.saveState(f), l || g.Adapter.trigger(a, "statechange"), g.isHashEqual(h, k) || g.isHashEqual(h, g.getShortUrl(g.getLocationHref())) || g.setHash(h, !1), g.busy(!1), !0)
2120 }, g.replaceState = function (b, c, d, e) {
2121 if (d = encodeURI(d).replace(/%25/g, "%"), g.getHashByUrl(d)) throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).");
2122 if (e !== !1 && g.busy()) return g.pushQueue({
2123 scope: g,
2124 callback: g.replaceState,
2125 args: arguments,
2126 queue: e
2127 }), !1;
2128 g.busy(!0);
2129 var f = g.createStateObject(b, c, d),
2130 h = g.getHashByState(f),
2131 i = g.getState(!1),
2132 j = g.getHashByState(i),
2133 k = g.getStateByIndex(-2);
2134 return g.discardState(i, f, k), h === j ? (g.storeState(f), g.expectedStateId = f.id, g.recycleState(f), g.setTitle(f), g.saveState(f), g.Adapter.trigger(a, "statechange"), g.busy(!1)) : g.pushState(f.data, f.title, f.url, !1), !0
2135 }), void(g.emulated.pushState && g.getHash() && !g.emulated.hashChange && g.Adapter.onDomLoad(function () {
2136 g.Adapter.trigger(a, "hashchange")
2137 })))
2138 }, "undefined" != typeof g.init && g.init()
2139 }(window),
2140 function (a, b) {
2141 "use strict";
2142 var c = a.console || b,
2143 d = a.document,
2144 e = a.navigator,
2145 f = a.sessionStorage || !1,
2146 g = a.setTimeout,
2147 h = a.clearTimeout,
2148 i = a.setInterval,
2149 j = a.clearInterval,
2150 k = a.JSON,
2151 l = a.alert,
2152 m = a.History = a.History || {},
2153 n = a.history;
2154 try {
2155 f.setItem("TEST", "1"), f.removeItem("TEST")
2156 } catch (o) {
2157 f = !1
2158 }
2159 if (k.stringify = k.stringify || k.encode, k.parse = k.parse || k.decode, "undefined" != typeof m.init) throw new Error("History.js Core has already been loaded...");
2160 m.init = function (a) {
2161 return "undefined" == typeof m.Adapter ? !1 : ("undefined" != typeof m.initCore && m.initCore(), "undefined" != typeof m.initHtml4 && m.initHtml4(), !0)
2162 }, m.initCore = function (o) {
2163 if ("undefined" != typeof m.initCore.initialized) return !1;
2164 if (m.initCore.initialized = !0, m.options = m.options || {}, m.options.hashChangeInterval = m.options.hashChangeInterval || 100, m.options.safariPollInterval = m.options.safariPollInterval || 500, m.options.doubleCheckInterval = m.options.doubleCheckInterval || 500, m.options.disableSuid = m.options.disableSuid || !1, m.options.storeInterval = m.options.storeInterval || 1e3, m.options.busyDelay = m.options.busyDelay || 250, m.options.debug = m.options.debug || !1, m.options.initialTitle = m.options.initialTitle || d.title, m.options.html4Mode = m.options.html4Mode || !1, m.options.delayInit = m.options.delayInit || !1, m.intervalList = [], m.clearAllIntervals = function () {
2165 var a, b = m.intervalList;
2166 if ("undefined" != typeof b && null !== b) {
2167 for (a = 0; a < b.length; a++) j(b[a]);
2168 m.intervalList = null
2169 }
2170 }, m.debug = function () {
2171 m.options.debug && m.log.apply(m, arguments)
2172 }, m.log = function () {
2173 var a, b, e, f, g, h = !("undefined" == typeof c || "undefined" == typeof c.log || "undefined" == typeof c.log.apply),
2174 i = d.getElementById("log");
2175 for (h ? (f = Array.prototype.slice.call(arguments), a = f.shift(), "undefined" != typeof c.debug ? c.debug.apply(c, [a, f]) : c.log.apply(c, [a, f])) : a = "\n" + arguments[0] + "\n", b = 1, e = arguments.length; e > b; ++b) {
2176 if (g = arguments[b], "object" == typeof g && "undefined" != typeof k) try {
2177 g = k.stringify(g)
2178 } catch (j) {}
2179 a += "\n" + g + "\n"
2180 }
2181 return i ? (i.value += a + "\n-----\n", i.scrollTop = i.scrollHeight - i.clientHeight) : h || l(a), !0
2182 }, m.getInternetExplorerMajorVersion = function () {
2183 var a = m.getInternetExplorerMajorVersion.cached = "undefined" != typeof m.getInternetExplorerMajorVersion.cached ? m.getInternetExplorerMajorVersion.cached : function () {
2184 for (var a = 3, b = d.createElement("div"), c = b.getElementsByTagName("i");
2185 (b.innerHTML = "<!--[if gt IE " + ++a + "]><i></i><![endif]-->") && c[0];);
2186 return a > 4 ? a : !1
2187 }();
2188 return a
2189 }, m.isInternetExplorer = function () {
2190 var a = m.isInternetExplorer.cached = "undefined" != typeof m.isInternetExplorer.cached ? m.isInternetExplorer.cached : Boolean(m.getInternetExplorerMajorVersion());
2191 return a
2192 }, m.options.html4Mode ? m.emulated = {
2193 pushState: !0,
2194 hashChange: !0
2195 } : m.emulated = {
2196 pushState: !Boolean(a.history && a.history.pushState && a.history.replaceState && !(/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(e.userAgent) || /AppleWebKit\/5([0-2]|3[0-2])/i.test(e.userAgent))),
2197 hashChange: Boolean(!("onhashchange" in a || "onhashchange" in d) || m.isInternetExplorer() && m.getInternetExplorerMajorVersion() < 8)
2198 }, m.enabled = !m.emulated.pushState, m.bugs = {
2199 setHash: Boolean(!m.emulated.pushState && "Apple Computer, Inc." === e.vendor && /AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),
2200 safariPoll: Boolean(!m.emulated.pushState && "Apple Computer, Inc." === e.vendor && /AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),
2201 ieDoubleCheck: Boolean(m.isInternetExplorer() && m.getInternetExplorerMajorVersion() < 8),
2202 hashEscape: Boolean(m.isInternetExplorer() && m.getInternetExplorerMajorVersion() < 7)
2203 }, m.isEmptyObject = function (a) {
2204 for (var b in a)
2205 if (a.hasOwnProperty(b)) return !1;
2206 return !0
2207 }, m.cloneObject = function (a) {
2208 var b, c;
2209 return a ? (b = k.stringify(a), c = k.parse(b)) : c = {}, c
2210 }, m.getRootUrl = function () {
2211 var a = d.location.protocol + "//" + (d.location.hostname || d.location.host);
2212 return d.location.port && (a += ":" + d.location.port), a += "/"
2213 }, m.getBaseHref = function () {
2214 var a = d.getElementsByTagName("base"),
2215 b = null,
2216 c = "";
2217 return 1 === a.length && (b = a[0], c = b.href.replace(/[^\/]+$/, "")), c = c.replace(/\/+$/, ""), c && (c += "/"), c
2218 }, m.getBaseUrl = function () {
2219 var a = m.getBaseHref() || m.getBasePageUrl() || m.getRootUrl();
2220 return a
2221 }, m.getPageUrl = function () {
2222 var a, b = m.getState(!1, !1),
2223 c = (b || {}).url || m.getLocationHref();
2224 return a = c.replace(/\/+$/, "").replace(/[^\/]+$/, function (a, b, c) {
2225 return /\./.test(a) ? a : a + "/"
2226 })
2227 }, m.getBasePageUrl = function () {
2228 var a = m.getLocationHref().replace(/[#\?].*/, "").replace(/[^\/]+$/, function (a, b, c) {
2229 return /[^\/]$/.test(a) ? "" : a
2230 }).replace(/\/+$/, "") + "/";
2231 return a
2232 }, m.getFullUrl = function (a, b) {
2233 var c = a,
2234 d = a.substring(0, 1);
2235 return b = "undefined" == typeof b ? !0 : b, /[a-z]+\:\/\//.test(a) || (c = "/" === d ? m.getRootUrl() + a.replace(/^\/+/, "") : "#" === d ? m.getPageUrl().replace(/#.*/, "") + a : "?" === d ? m.getPageUrl().replace(/[\?#].*/, "") + a : b ? m.getBaseUrl() + a.replace(/^(\.\/)+/, "") : m.getBasePageUrl() + a.replace(/^(\.\/)+/, "")), c.replace(/\#$/, "")
2236 }, m.getShortUrl = function (a) {
2237 var b = a,
2238 c = m.getBaseUrl(),
2239 d = m.getRootUrl();
2240 return m.emulated.pushState && (b = b.replace(c, "")), b = b.replace(d, "/"), m.isTraditionalAnchor(b) && (b = "./" + b), b = b.replace(/^(\.\/)+/g, "./").replace(/\#$/, "")
2241 }, m.getLocationHref = function (a) {
2242 return a = a || d, a.URL === a.location.href ? a.location.href : a.location.href === decodeURIComponent(a.URL) ? a.URL : a.location.hash && decodeURIComponent(a.location.href.replace(/^[^#]+/, "")) === a.location.hash ? a.location.href : -1 == a.URL.indexOf("#") && -1 != a.location.href.indexOf("#") ? a.location.href : a.URL || a.location.href
2243 }, m.store = {}, m.idToState = m.idToState || {}, m.stateToId = m.stateToId || {}, m.urlToId = m.urlToId || {}, m.storedStates = m.storedStates || [], m.savedStates = m.savedStates || [], m.normalizeStore = function () {
2244 m.store.idToState = m.store.idToState || {}, m.store.urlToId = m.store.urlToId || {}, m.store.stateToId = m.store.stateToId || {}
2245 }, m.getState = function (a, b) {
2246 "undefined" == typeof a && (a = !0), "undefined" == typeof b && (b = !0);
2247 var c = m.getLastSavedState();
2248 return !c && b && (c = m.createStateObject()), a && (c = m.cloneObject(c), c.url = c.cleanUrl || c.url), c
2249 }, m.getIdByState = function (a) {
2250 var b, c = m.extractId(a.url);
2251 if (!c)
2252 if (b = m.getStateString(a), "undefined" != typeof m.stateToId[b]) c = m.stateToId[b];
2253 else if ("undefined" != typeof m.store.stateToId[b]) c = m.store.stateToId[b];
2254 else {
2255 for (;;)
2256 if (c = (new Date).getTime() + String(Math.random()).replace(/\D/g, ""), "undefined" == typeof m.idToState[c] && "undefined" == typeof m.store.idToState[c]) break;
2257 m.stateToId[b] = c, m.idToState[c] = a
2258 }
2259 return c
2260 }, m.normalizeState = function (a) {
2261 var b, c;
2262 return a && "object" == typeof a || (a = {}), "undefined" != typeof a.normalized ? a : (a.data && "object" == typeof a.data || (a.data = {}), b = {}, b.normalized = !0, b.title = a.title || "", b.url = m.getFullUrl(a.url ? a.url : m.getLocationHref()), b.hash = m.getShortUrl(b.url), b.data = m.cloneObject(a.data), b.id = m.getIdByState(b), b.cleanUrl = b.url.replace(/\??\&_suid.*/, ""), b.url = b.cleanUrl, c = !m.isEmptyObject(b.data), (b.title || c) && m.options.disableSuid !== !0 && (b.hash = m.getShortUrl(b.url).replace(/\??\&_suid.*/, ""), /\?/.test(b.hash) || (b.hash += "?"), b.hash += "&_suid=" + b.id), b.hashedUrl = m.getFullUrl(b.hash), (m.emulated.pushState || m.bugs.safariPoll) && m.hasUrlDuplicate(b) && (b.url = b.hashedUrl), b)
2263 }, m.createStateObject = function (a, b, c) {
2264 var d = {
2265 data: a,
2266 title: b,
2267 url: c
2268 };
2269 return d = m.normalizeState(d)
2270 }, m.getStateById = function (a) {
2271 a = String(a);
2272 var c = m.idToState[a] || m.store.idToState[a] || b;
2273 return c
2274 }, m.getStateString = function (a) {
2275 var b, c, d;
2276 return b = m.normalizeState(a), c = {
2277 data: b.data,
2278 title: a.title,
2279 url: a.url
2280 }, d = k.stringify(c)
2281 }, m.getStateId = function (a) {
2282 var b, c;
2283 return b = m.normalizeState(a), c = b.id
2284 }, m.getHashByState = function (a) {
2285 var b, c;
2286 return b = m.normalizeState(a), c = b.hash
2287 }, m.extractId = function (a) {
2288 var b, c, d, e;
2289 return e = -1 != a.indexOf("#") ? a.split("#")[0] : a, c = /(.*)\&_suid=([0-9]+)$/.exec(e), d = c ? c[1] || a : a, b = c ? String(c[2] || "") : "", b || !1
2290 }, m.isTraditionalAnchor = function (a) {
2291 var b = !/[\/\?\.]/.test(a);
2292 return b
2293 }, m.extractState = function (a, b) {
2294 var c, d, e = null;
2295 return b = b || !1, c = m.extractId(a), c && (e = m.getStateById(c)), e || (d = m.getFullUrl(a), c = m.getIdByUrl(d) || !1, c && (e = m.getStateById(c)), e || !b || m.isTraditionalAnchor(a) || (e = m.createStateObject(null, null, d))), e
2296 }, m.getIdByUrl = function (a) {
2297 var c = m.urlToId[a] || m.store.urlToId[a] || b;
2298 return c
2299 }, m.getLastSavedState = function () {
2300 return m.savedStates[m.savedStates.length - 1] || b
2301 }, m.getLastStoredState = function () {
2302 return m.storedStates[m.storedStates.length - 1] || b
2303 }, m.hasUrlDuplicate = function (a) {
2304 var b, c = !1;
2305 return b = m.extractState(a.url), c = b && b.id !== a.id
2306 }, m.storeState = function (a) {
2307 return m.urlToId[a.url] = a.id, m.storedStates.push(m.cloneObject(a)), a
2308 }, m.isLastSavedState = function (a) {
2309 var b, c, d, e = !1;
2310 return m.savedStates.length && (b = a.id, c = m.getLastSavedState(), d = c.id, e = b === d), e
2311 }, m.saveState = function (a) {
2312 return m.isLastSavedState(a) ? !1 : (m.savedStates.push(m.cloneObject(a)), !0)
2313 }, m.getStateByIndex = function (a) {
2314 var b = null;
2315 return b = "undefined" == typeof a ? m.savedStates[m.savedStates.length - 1] : 0 > a ? m.savedStates[m.savedStates.length + a] : m.savedStates[a]
2316 }, m.getCurrentIndex = function () {
2317 var a = null;
2318 return a = m.savedStates.length < 1 ? 0 : m.savedStates.length - 1
2319 }, m.getHash = function (a) {
2320 var b, c = m.getLocationHref(a);
2321 return b = m.getHashByUrl(c)
2322 }, m.unescapeHash = function (a) {
2323 var b = m.normalizeHash(a);
2324 return b = decodeURIComponent(b)
2325 }, m.normalizeHash = function (a) {
2326 var b = a.replace(/[^#]*#/, "").replace(/#.*/, "");
2327 return b
2328 }, m.setHash = function (a, b) {
2329 var c, e;
2330 return b !== !1 && m.busy() ? (m.pushQueue({
2331 scope: m,
2332 callback: m.setHash,
2333 args: arguments,
2334 queue: b
2335 }), !1) : (m.busy(!0), c = m.extractState(a, !0), c && !m.emulated.pushState ? m.pushState(c.data, c.title, c.url, !1) : m.getHash() !== a && (m.bugs.setHash ? (e = m.getPageUrl(), m.pushState(null, null, e + "#" + a, !1)) : d.location.hash = a), m)
2336 }, m.escapeHash = function (b) {
2337 var c = m.normalizeHash(b);
2338 return c = a.encodeURIComponent(c), m.bugs.hashEscape || (c = c.replace(/\%21/g, "!").replace(/\%26/g, "&").replace(/\%3D/g, "=").replace(/\%3F/g, "?")), c
2339 }, m.getHashByUrl = function (a) {
2340 var b = String(a).replace(/([^#]*)#?([^#]*)#?(.*)/, "$2");
2341 return b = m.unescapeHash(b)
2342 }, m.setTitle = function (a) {
2343 var b, c = a.title;
2344 c || (b = m.getStateByIndex(0), b && b.url === a.url && (c = b.title || m.options.initialTitle));
2345 try {
2346 d.getElementsByTagName("title")[0].innerHTML = c.replace("<", "<").replace(">", ">").replace(" & ", " & ")
2347 } catch (e) {}
2348 return d.title = c, m
2349 }, m.queues = [], m.busy = function (a) {
2350 if ("undefined" != typeof a ? m.busy.flag = a : "undefined" == typeof m.busy.flag && (m.busy.flag = !1), !m.busy.flag) {
2351 h(m.busy.timeout);
2352 var b = function () {
2353 var a, c, d;
2354 if (!m.busy.flag)
2355 for (a = m.queues.length - 1; a >= 0; --a) c = m.queues[a], 0 !== c.length && (d = c.shift(), m.fireQueueItem(d), m.busy.timeout = g(b, m.options.busyDelay))
2356 };
2357 m.busy.timeout = g(b, m.options.busyDelay)
2358 }
2359 return m.busy.flag
2360 }, m.busy.flag = !1, m.fireQueueItem = function (a) {
2361 return a.callback.apply(a.scope || m, a.args || [])
2362 }, m.pushQueue = function (a) {
2363 return m.queues[a.queue || 0] = m.queues[a.queue || 0] || [], m.queues[a.queue || 0].push(a),
2364 m
2365 }, m.queue = function (a, b) {
2366 return "function" == typeof a && (a = {
2367 callback: a
2368 }), "undefined" != typeof b && (a.queue = b), m.busy() ? m.pushQueue(a) : m.fireQueueItem(a), m
2369 }, m.clearQueue = function () {
2370 return m.busy.flag = !1, m.queues = [], m
2371 }, m.stateChanged = !1, m.doubleChecker = !1, m.doubleCheckComplete = function () {
2372 return m.stateChanged = !0, m.doubleCheckClear(), m
2373 }, m.doubleCheckClear = function () {
2374 return m.doubleChecker && (h(m.doubleChecker), m.doubleChecker = !1), m
2375 }, m.doubleCheck = function (a) {
2376 return m.stateChanged = !1, m.doubleCheckClear(), m.bugs.ieDoubleCheck && (m.doubleChecker = g(function () {
2377 return m.doubleCheckClear(), m.stateChanged || a(), !0
2378 }, m.options.doubleCheckInterval)), m
2379 }, m.safariStatePoll = function () {
2380 var b, c = m.extractState(m.getLocationHref());
2381 if (!m.isLastSavedState(c)) return b = c, b || (b = m.createStateObject()), m.Adapter.trigger(a, "popstate"), m
2382 }, m.back = function (a) {
2383 return a !== !1 && m.busy() ? (m.pushQueue({
2384 scope: m,
2385 callback: m.back,
2386 args: arguments,
2387 queue: a
2388 }), !1) : (m.busy(!0), m.doubleCheck(function () {
2389 m.back(!1)
2390 }), n.go(-1), !0)
2391 }, m.forward = function (a) {
2392 return a !== !1 && m.busy() ? (m.pushQueue({
2393 scope: m,
2394 callback: m.forward,
2395 args: arguments,
2396 queue: a
2397 }), !1) : (m.busy(!0), m.doubleCheck(function () {
2398 m.forward(!1)
2399 }), n.go(1), !0)
2400 }, m.go = function (a, b) {
2401 var c;
2402 if (a > 0)
2403 for (c = 1; a >= c; ++c) m.forward(b);
2404 else {
2405 if (!(0 > a)) throw new Error("History.go: History.go requires a positive or negative integer passed.");
2406 for (c = -1; c >= a; --c) m.back(b)
2407 }
2408 return m
2409 }, m.emulated.pushState) {
2410 var p = function () {};
2411 m.pushState = m.pushState || p, m.replaceState = m.replaceState || p
2412 } else m.onPopState = function (b, c) {
2413 var d, e, f = !1,
2414 g = !1;
2415 return m.doubleCheckComplete(), (d = m.getHash()) ? (e = m.extractState(d || m.getLocationHref(), !0), e ? m.replaceState(e.data, e.title, e.url, !1) : (m.Adapter.trigger(a, "anchorchange"), m.busy(!1)), m.expectedStateId = !1, !1) : (f = m.Adapter.extractEventData("state", b, c) || !1, g = f ? m.getStateById(f) : m.expectedStateId ? m.getStateById(m.expectedStateId) : m.extractState(m.getLocationHref()), g || (g = m.createStateObject(null, null, m.getLocationHref())), m.expectedStateId = !1, m.isLastSavedState(g) ? (m.busy(!1), !1) : (m.storeState(g), m.saveState(g), m.setTitle(g), m.Adapter.trigger(a, "statechange"), m.busy(!1), !0))
2416 }, m.Adapter.bind(a, "popstate", m.onPopState), m.pushState = function (b, c, d, e) {
2417 if (m.getHashByUrl(d) && m.emulated.pushState) throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");
2418 if (e !== !1 && m.busy()) return m.pushQueue({
2419 scope: m,
2420 callback: m.pushState,
2421 args: arguments,
2422 queue: e
2423 }), !1;
2424 m.busy(!0);
2425 var f = m.createStateObject(b, c, d);
2426 return m.isLastSavedState(f) ? m.busy(!1) : (m.storeState(f), m.expectedStateId = f.id, n.pushState(f.id, f.title, f.url), m.Adapter.trigger(a, "popstate")), !0
2427 }, m.replaceState = function (b, c, d, e) {
2428 if (m.getHashByUrl(d) && m.emulated.pushState) throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");
2429 if (e !== !1 && m.busy()) return m.pushQueue({
2430 scope: m,
2431 callback: m.replaceState,
2432 args: arguments,
2433 queue: e
2434 }), !1;
2435 m.busy(!0);
2436 var f = m.createStateObject(b, c, d);
2437 return m.isLastSavedState(f) ? m.busy(!1) : (m.storeState(f), m.expectedStateId = f.id, n.replaceState(f.id, f.title, f.url), m.Adapter.trigger(a, "popstate")), !0
2438 };
2439 if (f) {
2440 try {
2441 m.store = k.parse(f.getItem("History.store")) || {}
2442 } catch (q) {
2443 m.store = {}
2444 }
2445 m.normalizeStore()
2446 } else m.store = {}, m.normalizeStore();
2447 m.Adapter.bind(a, "unload", m.clearAllIntervals), m.saveState(m.storeState(m.extractState(m.getLocationHref(), !0))), f && (m.onUnload = function () {
2448 var a, b, c;
2449 try {
2450 a = k.parse(f.getItem("History.store")) || {}
2451 } catch (d) {
2452 a = {}
2453 }
2454 a.idToState = a.idToState || {}, a.urlToId = a.urlToId || {}, a.stateToId = a.stateToId || {};
2455 for (b in m.idToState) m.idToState.hasOwnProperty(b) && (a.idToState[b] = m.idToState[b]);
2456 for (b in m.urlToId) m.urlToId.hasOwnProperty(b) && (a.urlToId[b] = m.urlToId[b]);
2457 for (b in m.stateToId) m.stateToId.hasOwnProperty(b) && (a.stateToId[b] = m.stateToId[b]);
2458 m.store = a, m.normalizeStore(), c = k.stringify(a);
2459 try {
2460 f.setItem("History.store", c)
2461 } catch (e) {
2462 if (e.code !== DOMException.QUOTA_EXCEEDED_ERR) throw e;
2463 f.length && (f.removeItem("History.store"), f.setItem("History.store", c))
2464 }
2465 }, m.intervalList.push(i(m.onUnload, m.options.storeInterval)), m.Adapter.bind(a, "beforeunload", m.onUnload), m.Adapter.bind(a, "unload", m.onUnload)), m.emulated.pushState || (m.bugs.safariPoll && m.intervalList.push(i(m.safariStatePoll, m.options.safariPollInterval)), ("Apple Computer, Inc." === e.vendor || "Mozilla" === (e.appCodeName || "")) && (m.Adapter.bind(a, "hashchange", function () {
2466 m.Adapter.trigger(a, "popstate")
2467 }), m.getHash() && m.Adapter.onDomLoad(function () {
2468 m.Adapter.trigger(a, "hashchange")
2469 })))
2470 }, m.options && m.options.delayInit || m.init()
2471 }(window), define("jqueryHistory", function () {}), define("jqueryLoader", ["./jquery", "jqueryEaseInOutQuad", "jqueryTimeago", "jqueryEmbedly", "jqueryExpanding", "jqueryHistory"], function (a) {
2472 "use strict";
2473 return a
2474 }),
2475 function () {
2476 function a(a) {
2477 return function () {
2478 return a
2479 }
2480 }! function (b) {
2481 var c = this || (0, eval)("this"),
2482 d = c.document,
2483 e = c.navigator,
2484 f = c.jQuery,
2485 g = c.JSON;
2486 ! function (a) {
2487 "function" == typeof require && "object" == typeof exports && "object" == typeof module ? a(module.exports || exports) : "function" == typeof define && define.amd ? define("knockout", ["exports"], a) : a(c.ko = {})
2488 }(function (h) {
2489 function i(a, b, c, d) {
2490 k.d[a] = {
2491 init: function (a) {
2492 return k.a.f.set(a, o, {}), {
2493 controlsDescendantBindings: !0
2494 }
2495 },
2496 update: function (a, e, f, g, h) {
2497 f = k.a.f.get(a, o), e = k.a.c(e()), g = !c != !e;
2498 var i = !f.fb;
2499 (i || b || g !== f.vb) && (i && (f.fb = k.a.Oa(k.e.childNodes(a), !0)), g ? (i || k.e.P(a, k.a.Oa(f.fb)), k.Ja(d ? d(h, e) : h, a)) : k.e.ba(a), f.vb = g)
2500 }
2501 }, k.g.S[a] = !1, k.e.L[a] = !0
2502 }
2503
2504 function j(a, b, c) {
2505 c && b !== k.h.n(a) && k.h.W(a, b), b !== k.h.n(a) && k.q.I(k.a.Ga, null, [a, "change"])
2506 }
2507 var k = "undefined" != typeof h ? h : {};
2508 k.b = function (a, b) {
2509 for (var c = a.split("."), d = k, e = 0; e < c.length - 1; e++) d = d[c[e]];
2510 d[c[c.length - 1]] = b
2511 }, k.r = function (a, b, c) {
2512 a[b] = c
2513 }, k.version = "2.3.0", k.b("version", k.version), k.a = function () {
2514 function a(a, b) {
2515 for (var c in a) a.hasOwnProperty(c) && b(c, a[c])
2516 }
2517
2518 function h(a, b) {
2519 if ("input" !== k.a.u(a) || !a.type || "click" != b.toLowerCase()) return !1;
2520 var c = a.type;
2521 return "checkbox" == c || "radio" == c
2522 }
2523 var i = {},
2524 j = {};
2525 i[e && /Firefox\/2/i.test(e.userAgent) ? "KeyboardEvent" : "UIEvents"] = ["keyup", "keydown", "keypress"], i.MouseEvents = "click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "), a(i, function (a, b) {
2526 if (b.length)
2527 for (var c = 0, d = b.length; d > c; c++) j[b[c]] = a
2528 });
2529 var l = {
2530 propertychange: !0
2531 },
2532 m = d && function () {
2533 for (var a = 3, c = d.createElement("div"), e = c.getElementsByTagName("i"); c.innerHTML = "<!--[if gt IE " + ++a + "]><i></i><![endif]-->", e[0];);
2534 return a > 4 ? a : b
2535 }();
2536 return {
2537 Ta: ["authenticity_token", /^__RequestVerificationToken(_.*)?$/],
2538 p: function (a, b) {
2539 for (var c = 0, d = a.length; d > c; c++) b(a[c])
2540 },
2541 k: function (a, b) {
2542 if ("function" == typeof Array.prototype.indexOf) return Array.prototype.indexOf.call(a, b);
2543 for (var c = 0, d = a.length; d > c; c++)
2544 if (a[c] === b) return c;
2545 return -1
2546 },
2547 La: function (a, b, c) {
2548 for (var d = 0, e = a.length; e > d; d++)
2549 if (b.call(c, a[d])) return a[d];
2550 return null
2551 },
2552 ka: function (a, b) {
2553 var c = k.a.k(a, b);
2554 c >= 0 && a.splice(c, 1)
2555 },
2556 Ma: function (a) {
2557 a = a || [];
2558 for (var b = [], c = 0, d = a.length; d > c; c++) 0 > k.a.k(b, a[c]) && b.push(a[c]);
2559 return b
2560 },
2561 Z: function (a, b) {
2562 a = a || [];
2563 for (var c = [], d = 0, e = a.length; e > d; d++) c.push(b(a[d]));
2564 return c
2565 },
2566 Y: function (a, b) {
2567 a = a || [];
2568 for (var c = [], d = 0, e = a.length; e > d; d++) b(a[d]) && c.push(a[d]);
2569 return c
2570 },
2571 R: function (a, b) {
2572 if (b instanceof Array) a.push.apply(a, b);
2573 else
2574 for (var c = 0, d = b.length; d > c; c++) a.push(b[c]);
2575 return a
2576 },
2577 ja: function (a, b, c) {
2578 var d = a.indexOf ? a.indexOf(b) : k.a.k(a, b);
2579 0 > d ? c && a.push(b) : c || a.splice(d, 1)
2580 },
2581 extend: function (a, b) {
2582 if (b)
2583 for (var c in b) b.hasOwnProperty(c) && (a[c] = b[c]);
2584 return a
2585 },
2586 w: a,
2587 oa: function (a) {
2588 for (; a.firstChild;) k.removeNode(a.firstChild)
2589 },
2590 Mb: function (a) {
2591 a = k.a.N(a);
2592 for (var b = d.createElement("div"), c = 0, e = a.length; e > c; c++) b.appendChild(k.H(a[c]));
2593 return b
2594 },
2595 Oa: function (a, b) {
2596 for (var c = 0, d = a.length, e = []; d > c; c++) {
2597 var f = a[c].cloneNode(!0);
2598 e.push(b ? k.H(f) : f)
2599 }
2600 return e
2601 },
2602 P: function (a, b) {
2603 if (k.a.oa(a), b)
2604 for (var c = 0, d = b.length; d > c; c++) a.appendChild(b[c])
2605 },
2606 eb: function (a, b) {
2607 var c = a.nodeType ? [a] : a;
2608 if (0 < c.length) {
2609 for (var d = c[0], e = d.parentNode, f = 0, g = b.length; g > f; f++) e.insertBefore(b[f], d);
2610 for (f = 0, g = c.length; g > f; f++) k.removeNode(c[f])
2611 }
2612 },
2613 hb: function (a, b) {
2614 7 > m ? a.setAttribute("selected", b) : a.selected = b
2615 },
2616 F: function (a) {
2617 return null === a || a === b ? "" : a.trim ? a.trim() : a.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, "")
2618 },
2619 Wb: function (a, b) {
2620 for (var c = [], d = (a || "").split(b), e = 0, f = d.length; f > e; e++) {
2621 var g = k.a.F(d[e]);
2622 "" !== g && c.push(g)
2623 }
2624 return c
2625 },
2626 Tb: function (a, b) {
2627 return a = a || "", b.length > a.length ? !1 : a.substring(0, b.length) === b
2628 },
2629 yb: function (a, b) {
2630 if (b.compareDocumentPosition) return 16 == (16 & b.compareDocumentPosition(a));
2631 for (; null != a;) {
2632 if (a == b) return !0;
2633 a = a.parentNode
2634 }
2635 return !1
2636 },
2637 aa: function (a) {
2638 return k.a.yb(a, a.ownerDocument)
2639 },
2640 pb: function (a) {
2641 return !!k.a.La(a, k.a.aa)
2642 },
2643 u: function (a) {
2644 return a && a.tagName && a.tagName.toLowerCase()
2645 },
2646 o: function (a, b, c) {
2647 var d = m && l[b];
2648 if (d || "undefined" == typeof f)
2649 if (d || "function" != typeof a.addEventListener) {
2650 if ("undefined" == typeof a.attachEvent) throw Error("Browser doesn't support addEventListener or attachEvent");
2651 var e = function (b) {
2652 c.call(a, b)
2653 },
2654 g = "on" + b;
2655 a.attachEvent(g, e), k.a.C.ia(a, function () {
2656 a.detachEvent(g, e)
2657 })
2658 } else a.addEventListener(b, c, !1);
2659 else {
2660 if (h(a, b)) {
2661 var i = c;
2662 c = function (a, b) {
2663 var c = this.checked;
2664 b && (this.checked = !0 !== b.sb), i.call(this, a), this.checked = c
2665 }
2666 }
2667 f(a).bind(b, c)
2668 }
2669 },
2670 Ga: function (a, b) {
2671 if (!a || !a.nodeType) throw Error("element must be a DOM node when calling triggerEvent");
2672 if ("undefined" != typeof f) {
2673 var e = [];
2674 h(a, b) && e.push({
2675 sb: a.checked
2676 }), f(a).trigger(b, e)
2677 } else if ("function" == typeof d.createEvent) {
2678 if ("function" != typeof a.dispatchEvent) throw Error("The supplied element doesn't support dispatchEvent");
2679 e = d.createEvent(j[b] || "HTMLEvents"), e.initEvent(b, !0, !0, c, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, a), a.dispatchEvent(e)
2680 } else {
2681 if ("undefined" == typeof a.fireEvent) throw Error("Browser doesn't support triggering events");
2682 h(a, b) && (a.checked = !0 !== a.checked), a.fireEvent("on" + b)
2683 }
2684 },
2685 c: function (a) {
2686 return k.T(a) ? a() : a
2687 },
2688 ya: function (a) {
2689 return k.T(a) ? a.t() : a
2690 },
2691 ga: function (a, b, c) {
2692 if (b) {
2693 var d = /\S+/g,
2694 e = a.className.match(d) || [];
2695 k.a.p(b.match(d), function (a) {
2696 k.a.ja(e, a, c)
2697 }), a.className = e.join(" ")
2698 }
2699 },
2700 ib: function (a, c) {
2701 var e = k.a.c(c);
2702 (null === e || e === b) && (e = "");
2703 var f = k.e.firstChild(a);
2704 !f || 3 != f.nodeType || k.e.nextSibling(f) ? k.e.P(a, [d.createTextNode(e)]) : f.data = e, k.a.Bb(a)
2705 },
2706 gb: function (a, b) {
2707 if (a.name = b, 7 >= m) try {
2708 a.mergeAttributes(d.createElement("<input name='" + a.name + "'/>"), !1)
2709 } catch (c) {}
2710 },
2711 Bb: function (a) {
2712 m >= 9 && (a = 1 == a.nodeType ? a : a.parentNode, a.style && (a.style.zoom = a.style.zoom))
2713 },
2714 zb: function (a) {
2715 if (m) {
2716 var b = a.style.width;
2717 a.style.width = 0, a.style.width = b
2718 }
2719 },
2720 Qb: function (a, b) {
2721 a = k.a.c(a), b = k.a.c(b);
2722 for (var c = [], d = a; b >= d; d++) c.push(d);
2723 return c
2724 },
2725 N: function (a) {
2726 for (var b = [], c = 0, d = a.length; d > c; c++) b.push(a[c]);
2727 return b
2728 },
2729 Ub: 6 === m,
2730 Vb: 7 === m,
2731 ca: m,
2732 Ua: function (a, b) {
2733 for (var c = k.a.N(a.getElementsByTagName("input")).concat(k.a.N(a.getElementsByTagName("textarea"))), d = "string" == typeof b ? function (a) {
2734 return a.name === b
2735 } : function (a) {
2736 return b.test(a.name)
2737 }, e = [], f = c.length - 1; f >= 0; f--) d(c[f]) && e.push(c[f]);
2738 return e
2739 },
2740 Nb: function (a) {
2741 return "string" == typeof a && (a = k.a.F(a)) ? g && g.parse ? g.parse(a) : new Function("return " + a)() : null
2742 },
2743 Ca: function (a, b, c) {
2744 if (!g || !g.stringify) throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");
2745 return g.stringify(k.a.c(a), b, c)
2746 },
2747 Ob: function (b, c, e) {
2748 e = e || {};
2749 var f = e.params || {},
2750 g = e.includeFields || this.Ta,
2751 h = b;
2752 if ("object" == typeof b && "form" === k.a.u(b))
2753 for (var h = b.action, i = g.length - 1; i >= 0; i--)
2754 for (var j = k.a.Ua(b, g[i]), l = j.length - 1; l >= 0; l--) f[j[l].name] = j[l].value;
2755 c = k.a.c(c);
2756 var m = d.createElement("form");
2757 m.style.display = "none", m.action = h, m.method = "post";
2758 for (var n in c) b = d.createElement("input"), b.name = n, b.value = k.a.Ca(k.a.c(c[n])), m.appendChild(b);
2759 a(f, function (a, b) {
2760 var c = d.createElement("input");
2761 c.name = a, c.value = b, m.appendChild(c)
2762 }), d.body.appendChild(m), e.submitter ? e.submitter(m) : m.submit(), setTimeout(function () {
2763 m.parentNode.removeChild(m)
2764 }, 0)
2765 }
2766 }
2767 }(), k.b("utils", k.a), k.b("utils.arrayForEach", k.a.p), k.b("utils.arrayFirst", k.a.La), k.b("utils.arrayFilter", k.a.Y), k.b("utils.arrayGetDistinctValues", k.a.Ma), k.b("utils.arrayIndexOf", k.a.k), k.b("utils.arrayMap", k.a.Z), k.b("utils.arrayPushAll", k.a.R), k.b("utils.arrayRemoveItem", k.a.ka), k.b("utils.extend", k.a.extend), k.b("utils.fieldsIncludedWithJsonPost", k.a.Ta), k.b("utils.getFormFields", k.a.Ua), k.b("utils.peekObservable", k.a.ya), k.b("utils.postJson", k.a.Ob), k.b("utils.parseJson", k.a.Nb), k.b("utils.registerEventHandler", k.a.o), k.b("utils.stringifyJson", k.a.Ca), k.b("utils.range", k.a.Qb), k.b("utils.toggleDomNodeCssClass", k.a.ga), k.b("utils.triggerEvent", k.a.Ga), k.b("utils.unwrapObservable", k.a.c), k.b("utils.objectForEach", k.a.w), k.b("utils.addOrRemoveItem", k.a.ja), k.b("unwrap", k.a.c), Function.prototype.bind || (Function.prototype.bind = function (a) {
2768 var b = this,
2769 c = Array.prototype.slice.call(arguments);
2770 return a = c.shift(),
2771 function () {
2772 return b.apply(a, c.concat(Array.prototype.slice.call(arguments)))
2773 }
2774 }), k.a.f = new function () {
2775 var a = 0,
2776 c = "__ko__" + (new Date).getTime(),
2777 d = {};
2778 return {
2779 get: function (a, c) {
2780 var d = k.a.f.pa(a, !1);
2781 return d === b ? b : d[c]
2782 },
2783 set: function (a, c, d) {
2784 (d !== b || k.a.f.pa(a, !1) !== b) && (k.a.f.pa(a, !0)[c] = d)
2785 },
2786 pa: function (e, f) {
2787 var g = e[c];
2788 if (!g || "null" === g || !d[g]) {
2789 if (!f) return b;
2790 g = e[c] = "ko" + a++, d[g] = {}
2791 }
2792 return d[g]
2793 },
2794 clear: function (a) {
2795 var b = a[c];
2796 return b ? (delete d[b], a[c] = null, !0) : !1
2797 }
2798 }
2799 }, k.b("utils.domData", k.a.f), k.b("utils.domData.clear", k.a.f.clear), k.a.C = new function () {
2800 function a(a, c) {
2801 var e = k.a.f.get(a, d);
2802 return e === b && c && (e = [], k.a.f.set(a, d, e)), e
2803 }
2804
2805 function c(b) {
2806 var d = a(b, !1);
2807 if (d)
2808 for (var d = d.slice(0), e = 0; e < d.length; e++) d[e](b);
2809 if (k.a.f.clear(b), "function" == typeof f && "function" == typeof f.cleanData && f.cleanData([b]), g[b.nodeType])
2810 for (d = b.firstChild; b = d;) d = b.nextSibling, 8 === b.nodeType && c(b)
2811 }
2812 var d = "__ko_domNodeDisposal__" + (new Date).getTime(),
2813 e = {
2814 1: !0,
2815 8: !0,
2816 9: !0
2817 },
2818 g = {
2819 1: !0,
2820 9: !0
2821 };
2822 return {
2823 ia: function (b, c) {
2824 if ("function" != typeof c) throw Error("Callback must be a function");
2825 a(b, !0).push(c)
2826 },
2827 cb: function (c, e) {
2828 var f = a(c, !1);
2829 f && (k.a.ka(f, e), 0 == f.length && k.a.f.set(c, d, b))
2830 },
2831 H: function (a) {
2832 if (e[a.nodeType] && (c(a), g[a.nodeType])) {
2833 var b = [];
2834 k.a.R(b, a.getElementsByTagName("*"));
2835 for (var d = 0, f = b.length; f > d; d++) c(b[d])
2836 }
2837 return a
2838 },
2839 removeNode: function (a) {
2840 k.H(a), a.parentNode && a.parentNode.removeChild(a)
2841 }
2842 }
2843 }, k.H = k.a.C.H, k.removeNode = k.a.C.removeNode, k.b("cleanNode", k.H), k.b("removeNode", k.removeNode), k.b("utils.domNodeDisposal", k.a.C), k.b("utils.domNodeDisposal.addDisposeCallback", k.a.C.ia), k.b("utils.domNodeDisposal.removeDisposeCallback", k.a.C.cb),
2844 function () {
2845 k.a.xa = function (a) {
2846 var b;
2847 if ("undefined" != typeof f) {
2848 if (f.parseHTML) b = f.parseHTML(a) || [];
2849 else if ((b = f.clean([a])) && b[0]) {
2850 for (a = b[0]; a.parentNode && 11 !== a.parentNode.nodeType;) a = a.parentNode;
2851 a.parentNode && a.parentNode.removeChild(a)
2852 }
2853 } else {
2854 var e = k.a.F(a).toLowerCase();
2855 for (b = d.createElement("div"), e = e.match(/^<(thead|tbody|tfoot)/) && [1, "<table>", "</table>"] || !e.indexOf("<tr") && [2, "<table><tbody>", "</tbody></table>"] || (!e.indexOf("<td") || !e.indexOf("<th")) && [3, "<table><tbody><tr>", "</tr></tbody></table>"] || [0, "", ""], a = "ignored<div>" + e[1] + a + e[2] + "</div>", "function" == typeof c.innerShiv ? b.appendChild(c.innerShiv(a)) : b.innerHTML = a; e[0]--;) b = b.lastChild;
2856 b = k.a.N(b.lastChild.childNodes)
2857 }
2858 return b
2859 }, k.a.fa = function (a, c) {
2860 if (k.a.oa(a), c = k.a.c(c), null !== c && c !== b)
2861 if ("string" != typeof c && (c = c.toString()), "undefined" != typeof f) f(a).html(c);
2862 else
2863 for (var d = k.a.xa(c), e = 0; e < d.length; e++) a.appendChild(d[e])
2864 }
2865 }(), k.b("utils.parseHtmlFragment", k.a.xa), k.b("utils.setHtml", k.a.fa), k.s = function () {
2866 function a(b, c) {
2867 if (b)
2868 if (8 == b.nodeType) {
2869 var d = k.s.$a(b.nodeValue);
2870 null != d && c.push({
2871 xb: b,
2872 Kb: d
2873 })
2874 } else if (1 == b.nodeType)
2875 for (var d = 0, e = b.childNodes, f = e.length; f > d; d++) a(e[d], c)
2876 }
2877 var c = {};
2878 return {
2879 va: function (a) {
2880 if ("function" != typeof a) throw Error("You can only pass a function to ko.memoization.memoize()");
2881 var b = (4294967296 * (1 + Math.random()) | 0).toString(16).substring(1) + (4294967296 * (1 + Math.random()) | 0).toString(16).substring(1);
2882 return c[b] = a, "<!--[ko_memo:" + b + "]-->"
2883 },
2884 mb: function (a, d) {
2885 var e = c[a];
2886 if (e === b) throw Error("Couldn't find any memo with ID " + a + ". Perhaps it's already been unmemoized.");
2887 try {
2888 return e.apply(null, d || []), !0
2889 } finally {
2890 delete c[a]
2891 }
2892 },
2893 nb: function (b, c) {
2894 var d = [];
2895 a(b, d);
2896 for (var e = 0, f = d.length; f > e; e++) {
2897 var g = d[e].xb,
2898 h = [g];
2899 c && k.a.R(h, c), k.s.mb(d[e].Kb, h), g.nodeValue = "", g.parentNode && g.parentNode.removeChild(g)
2900 }
2901 },
2902 $a: function (a) {
2903 return (a = a.match(/^\[ko_memo\:(.*?)\]$/)) ? a[1] : null
2904 }
2905 }
2906 }(), k.b("memoization", k.s), k.b("memoization.memoize", k.s.va), k.b("memoization.unmemoize", k.s.mb), k.b("memoization.parseMemoText", k.s.$a), k.b("memoization.unmemoizeDomNodeAndDescendants", k.s.nb), k.Sa = {
2907 throttle: function (a, b) {
2908 a.throttleEvaluation = b;
2909 var c = null;
2910 return k.j({
2911 read: a,
2912 write: function (d) {
2913 clearTimeout(c), c = setTimeout(function () {
2914 a(d)
2915 }, b)
2916 }
2917 })
2918 },
2919 notify: function (b, c) {
2920 return b.equalityComparer = "always" == c ? a(!1) : k.m.fn.equalityComparer, b
2921 }
2922 }, k.b("extenders", k.Sa), k.kb = function (a, b, c) {
2923 this.target = a, this.la = b, this.wb = c, k.r(this, "dispose", this.B)
2924 }, k.kb.prototype.B = function () {
2925 this.Hb = !0, this.wb()
2926 }, k.V = function () {
2927 this.G = {}, k.a.extend(this, k.V.fn), k.r(this, "subscribe", this.Da), k.r(this, "extend", this.extend), k.r(this, "getSubscriptionsCount", this.Db)
2928 }, k.V.fn = {
2929 Da: function (a, b, c) {
2930 c = c || "change";
2931 var d = new k.kb(this, b ? a.bind(b) : a, function () {
2932 k.a.ka(this.G[c], d)
2933 }.bind(this));
2934 return this.G[c] || (this.G[c] = []), this.G[c].push(d), d
2935 },
2936 notifySubscribers: function (a, b) {
2937 b = b || "change", this.G[b] && k.q.I(function () {
2938 k.a.p(this.G[b].slice(0), function (b) {
2939 b && !0 !== b.Hb && b.la(a)
2940 })
2941 }, this)
2942 },
2943 Db: function () {
2944 var a = 0;
2945 return k.a.w(this.G, function (b, c) {
2946 a += c.length
2947 }), a
2948 },
2949 extend: function (a) {
2950 var b = this;
2951 return a && k.a.w(a, function (a, c) {
2952 var d = k.Sa[a];
2953 "function" == typeof d && (b = d(b, c))
2954 }), b
2955 }
2956 }, k.Wa = function (a) {
2957 return null != a && "function" == typeof a.Da && "function" == typeof a.notifySubscribers
2958 }, k.b("subscribable", k.V), k.b("isSubscribable", k.Wa), k.q = function () {
2959 var a = [];
2960 return {
2961 rb: function (b) {
2962 a.push({
2963 la: b,
2964 Ra: []
2965 })
2966 },
2967 end: function () {
2968 a.pop()
2969 },
2970 bb: function (b) {
2971 if (!k.Wa(b)) throw Error("Only subscribable things can act as dependencies");
2972 if (0 < a.length) {
2973 var c = a[a.length - 1];
2974 !c || 0 <= k.a.k(c.Ra, b) || (c.Ra.push(b), c.la(b))
2975 }
2976 },
2977 I: function (b, c, d) {
2978 try {
2979 return a.push(null), b.apply(c, d || [])
2980 } finally {
2981 a.pop()
2982 }
2983 }
2984 }
2985 }();
2986 var l = {
2987 undefined: !0,
2988 "boolean": !0,
2989 number: !0,
2990 string: !0
2991 };
2992 k.m = function (a) {
2993 function b() {
2994 return 0 < arguments.length ? (b.equalityComparer && b.equalityComparer(c, arguments[0]) || (b.K(), c = arguments[0], b.J()), this) : (k.q.bb(b), c)
2995 }
2996 var c = a;
2997 return k.V.call(b), b.t = function () {
2998 return c
2999 }, b.J = function () {
3000 b.notifySubscribers(c)
3001 }, b.K = function () {
3002 b.notifySubscribers(c, "beforeChange")
3003 }, k.a.extend(b, k.m.fn), k.r(b, "peek", b.t), k.r(b, "valueHasMutated", b.J), k.r(b, "valueWillMutate", b.K), b
3004 }, k.m.fn = {
3005 equalityComparer: function (a, b) {
3006 return null === a || typeof a in l ? a === b : !1
3007 }
3008 };
3009 var m = k.m.Pb = "__ko_proto__";
3010 k.m.fn[m] = k.m, k.qa = function (a, c) {
3011 return null === a || a === b || a[m] === b ? !1 : a[m] === c ? !0 : k.qa(a[m], c)
3012 }, k.T = function (a) {
3013 return k.qa(a, k.m)
3014 }, k.Xa = function (a) {
3015 return "function" == typeof a && a[m] === k.m || "function" == typeof a && a[m] === k.j && a.Eb ? !0 : !1
3016 }, k.b("observable", k.m), k.b("isObservable", k.T), k.b("isWriteableObservable", k.Xa), k.U = function (a) {
3017 if (a = a || [], "object" != typeof a || !("length" in a)) throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");
3018 return a = k.m(a), k.a.extend(a, k.U.fn), a
3019 }, k.U.fn = {
3020 remove: function (a) {
3021 for (var b = this.t(), c = [], d = "function" == typeof a ? a : function (b) {
3022 return b === a
3023 }, e = 0; e < b.length; e++) {
3024 var f = b[e];
3025 d(f) && (0 === c.length && this.K(), c.push(f), b.splice(e, 1), e--)
3026 }
3027 return c.length && this.J(), c
3028 },
3029 removeAll: function (a) {
3030 if (a === b) {
3031 var c = this.t(),
3032 d = c.slice(0);
3033 return this.K(), c.splice(0, c.length), this.J(), d
3034 }
3035 return a ? this.remove(function (b) {
3036 return 0 <= k.a.k(a, b)
3037 }) : []
3038 },
3039 destroy: function (a) {
3040 var b = this.t(),
3041 c = "function" == typeof a ? a : function (b) {
3042 return b === a
3043 };
3044 this.K();
3045 for (var d = b.length - 1; d >= 0; d--) c(b[d]) && (b[d]._destroy = !0);
3046 this.J()
3047 },
3048 destroyAll: function (c) {
3049 return c === b ? this.destroy(a(!0)) : c ? this.destroy(function (a) {
3050 return 0 <= k.a.k(c, a)
3051 }) : []
3052 },
3053 indexOf: function (a) {
3054 var b = this();
3055 return k.a.k(b, a)
3056 },
3057 replace: function (a, b) {
3058 var c = this.indexOf(a);
3059 c >= 0 && (this.K(), this.t()[c] = b, this.J())
3060 }
3061 }, k.a.p("pop push reverse shift sort splice unshift".split(" "), function (a) {
3062 k.U.fn[a] = function () {
3063 var b = this.t();
3064 return this.K(), b = b[a].apply(b, arguments), this.J(), b
3065 }
3066 }), k.a.p(["slice"], function (a) {
3067 k.U.fn[a] = function () {
3068 var b = this();
3069 return b[a].apply(b, arguments)
3070 }
3071 }), k.b("observableArray", k.U), k.j = function (c, d, e) {
3072 function f() {
3073 k.a.p(t, function (a) {
3074 a.B()
3075 }), t = []
3076 }
3077
3078 function g() {
3079 var a = i.throttleEvaluation;
3080 a && a >= 0 ? (clearTimeout(u), u = setTimeout(h, a)) : h()
3081 }
3082
3083 function h() {
3084 if (!n)
3085 if (m && r()) s();
3086 else {
3087 n = !0;
3088 try {
3089 var a = k.a.Z(t, function (a) {
3090 return a.target
3091 });
3092 k.q.rb(function (c) {
3093 var d;
3094 0 <= (d = k.a.k(a, c)) ? a[d] = b : t.push(c.Da(g))
3095 });
3096 for (var c = o.call(d), e = a.length - 1; e >= 0; e--) a[e] && t.splice(e, 1)[0].B();
3097 m = !0, i.notifySubscribers(l, "beforeChange"), l = c, i.notifySubscribers(l)
3098 } finally {
3099 k.q.end(), n = !1
3100 }
3101 t.length || s()
3102 }
3103 }
3104
3105 function i() {
3106 if (0 < arguments.length) {
3107 if ("function" != typeof p) throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");
3108 return p.apply(d, arguments), this
3109 }
3110 return m || h(), k.q.bb(i), l
3111 }
3112
3113 function j() {
3114 return !m || 0 < t.length
3115 }
3116 var l, m = !1,
3117 n = !1,
3118 o = c;
3119 if (o && "object" == typeof o ? (e = o, o = e.read) : (e = e || {}, o || (o = e.read)), "function" != typeof o) throw Error("Pass a function that returns the value of the ko.computed");
3120 var p = e.write,
3121 q = e.disposeWhenNodeIsRemoved || e.$ || null,
3122 r = e.disposeWhen || e.Qa || a(!1),
3123 s = f,
3124 t = [],
3125 u = null;
3126 if (d || (d = e.owner), i.t = function () {
3127 return m || h(), l
3128 }, i.Cb = function () {
3129 return t.length
3130 }, i.Eb = "function" == typeof e.write, i.B = function () {
3131 s()
3132 }, i.ta = j, k.V.call(i), k.a.extend(i, k.j.fn), k.r(i, "peek", i.t), k.r(i, "dispose", i.B), k.r(i, "isActive", i.ta), k.r(i, "getDependenciesCount", i.Cb), !0 !== e.deferEvaluation && h(), q && j()) {
3133 s = function () {
3134 k.a.C.cb(q, s), f()
3135 }, k.a.C.ia(q, s);
3136 var v = r,
3137 r = function () {
3138 return !k.a.aa(q) || v()
3139 }
3140 }
3141 return i
3142 }, k.Gb = function (a) {
3143 return k.qa(a, k.j)
3144 }, h = k.m.Pb, k.j[h] = k.m, k.j.fn = {}, k.j.fn[h] = k.j, k.b("dependentObservable", k.j), k.b("computed", k.j), k.b("isComputed", k.Gb),
3145 function () {
3146 function a(e, f, g) {
3147 if (g = g || new d, e = f(e), "object" != typeof e || null === e || e === b || e instanceof Date || e instanceof String || e instanceof Number || e instanceof Boolean) return e;
3148 var h = e instanceof Array ? [] : {};
3149 return g.save(e, h), c(e, function (c) {
3150 var d = f(e[c]);
3151 switch (typeof d) {
3152 case "boolean":
3153 case "number":
3154 case "string":
3155 case "function":
3156 h[c] = d;
3157 break;
3158 case "object":
3159 case "undefined":
3160 var i = g.get(d);
3161 h[c] = i !== b ? i : a(d, f, g)
3162 }
3163 }), h
3164 }
3165
3166 function c(a, b) {
3167 if (a instanceof Array) {
3168 for (var c = 0; c < a.length; c++) b(c);
3169 "function" == typeof a.toJSON && b("toJSON")
3170 } else
3171 for (c in a) b(c)
3172 }
3173
3174 function d() {
3175 this.keys = [], this.Ha = []
3176 }
3177 k.lb = function (b) {
3178 if (0 == arguments.length) throw Error("When calling ko.toJS, pass the object you want to convert.");
3179 return a(b, function (a) {
3180 for (var b = 0; k.T(a) && 10 > b; b++) a = a();
3181 return a
3182 })
3183 }, k.toJSON = function (a, b, c) {
3184 return a = k.lb(a), k.a.Ca(a, b, c)
3185 }, d.prototype = {
3186 save: function (a, b) {
3187 var c = k.a.k(this.keys, a);
3188 c >= 0 ? this.Ha[c] = b : (this.keys.push(a), this.Ha.push(b))
3189 },
3190 get: function (a) {
3191 return a = k.a.k(this.keys, a), a >= 0 ? this.Ha[a] : b
3192 }
3193 }
3194 }(), k.b("toJS", k.lb), k.b("toJSON", k.toJSON),
3195 function () {
3196 k.h = {
3197 n: function (a) {
3198 switch (k.a.u(a)) {
3199 case "option":
3200 return !0 === a.__ko__hasDomDataOptionValue__ ? k.a.f.get(a, k.d.options.wa) : 7 >= k.a.ca ? a.getAttributeNode("value") && a.getAttributeNode("value").specified ? a.value : a.text : a.value;
3201 case "select":
3202 return 0 <= a.selectedIndex ? k.h.n(a.options[a.selectedIndex]) : b;
3203 default:
3204 return a.value
3205 }
3206 },
3207 W: function (a, c) {
3208 switch (k.a.u(a)) {
3209 case "option":
3210 switch (typeof c) {
3211 case "string":
3212 k.a.f.set(a, k.d.options.wa, b), "__ko__hasDomDataOptionValue__" in a && delete a.__ko__hasDomDataOptionValue__, a.value = c;
3213 break;
3214 default:
3215 k.a.f.set(a, k.d.options.wa, c), a.__ko__hasDomDataOptionValue__ = !0, a.value = "number" == typeof c ? c : ""
3216 }
3217 break;
3218 case "select":
3219 "" === c && (c = b), (null === c || c === b) && (a.selectedIndex = -1);
3220 for (var d = a.options.length - 1; d >= 0; d--)
3221 if (k.h.n(a.options[d]) == c) {
3222 a.selectedIndex = d;
3223 break
3224 }
3225 1 < a.size || -1 !== a.selectedIndex || (a.selectedIndex = 0);
3226 break;
3227 default:
3228 (null === c || c === b) && (c = ""), a.value = c
3229 }
3230 }
3231 }
3232 }(), k.b("selectExtensions", k.h), k.b("selectExtensions.readValue", k.h.n), k.b("selectExtensions.writeValue", k.h.W), k.g = function () {
3233 function a(a, c) {
3234 for (var d = null; a != d;) d = a, a = a.replace(b, function (a, b) {
3235 return c[b]
3236 });
3237 return a
3238 }
3239 var b = /\@ko_token_(\d+)\@/g,
3240 c = ["true", "false", "null", "undefined"],
3241 d = /^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i;
3242 return {
3243 S: [],
3244 da: function (b) {
3245 var c = k.a.F(b);
3246 if (3 > c.length) return [];
3247 "{" === c.charAt(0) && (c = c.substring(1, c.length - 1)), b = [];
3248 for (var d, e = null, f = 0; f < c.length; f++) {
3249 var g = c.charAt(f);
3250 if (null === e) switch (g) {
3251 case '"':
3252 case "'":
3253 case "/":
3254 e = f, d = g
3255 } else if (g == d && "\\" !== c.charAt(f - 1)) {
3256 g = c.substring(e, f + 1), b.push(g);
3257 var h = "@ko_token_" + (b.length - 1) + "@",
3258 c = c.substring(0, e) + h + c.substring(f + 1),
3259 f = f - (g.length - h.length),
3260 e = null
3261 }
3262 }
3263 d = e = null;
3264 for (var i = 0, j = null, f = 0; f < c.length; f++) {
3265 if (g = c.charAt(f), null === e) switch (g) {
3266 case "{":
3267 e = f, j = g, d = "}";
3268 break;
3269 case "(":
3270 e = f, j = g, d = ")";
3271 break;
3272 case "[":
3273 e = f, j = g, d = "]"
3274 }
3275 g === j ? i++ : g === d && (i--, 0 === i && (g = c.substring(e, f + 1), b.push(g), h = "@ko_token_" + (b.length - 1) + "@", c = c.substring(0, e) + h + c.substring(f + 1), f -= g.length - h.length, e = null))
3276 }
3277 for (d = [], c = c.split(","), e = 0, f = c.length; f > e; e++) i = c[e], j = i.indexOf(":"), j > 0 && j < i.length - 1 ? (g = i.substring(j + 1), d.push({
3278 key: a(i.substring(0, j), b),
3279 value: a(g, b)
3280 })) : d.push({
3281 unknown: a(i, b)
3282 });
3283 return d
3284 },
3285 ea: function (a) {
3286 var b = "string" == typeof a ? k.g.da(a) : a,
3287 e = [];
3288 a = [];
3289 for (var f, g = 0; f = b[g]; g++)
3290 if (0 < e.length && e.push(","), f.key) {
3291 var h;
3292 a: {
3293 h = f.key;
3294 var i = k.a.F(h);
3295 switch (i.length && i.charAt(0)) {
3296 case "'":
3297 case '"':
3298 break a;
3299 default:
3300 h = "'" + i + "'"
3301 }
3302 }
3303 f = f.value, e.push(h), e.push(":"), e.push(f), f = k.a.F(f), 0 <= k.a.k(c, k.a.F(f).toLowerCase()) ? f = !1 : (i = f.match(d), f = null === i ? !1 : i[1] ? "Object(" + i[1] + ")" + i[2] : f), f && (0 < a.length && a.push(", "), a.push(h + " : function(__ko_value) { " + f + " = __ko_value; }"))
3304 } else f.unknown && e.push(f.unknown);
3305 return b = e.join(""), 0 < a.length && (b = b + ", '_ko_property_writers' : { " + a.join("") + " } "), b
3306 },
3307 Jb: function (a, b) {
3308 for (var c = 0; c < a.length; c++)
3309 if (k.a.F(a[c].key) == b) return !0;
3310 return !1
3311 },
3312 ha: function (a, b, c, d, e) {
3313 a && k.T(a) ? !k.Xa(a) || e && a.t() === d || a(d) : (a = b()._ko_property_writers) && a[c] && a[c](d)
3314 }
3315 }
3316 }(), k.b("expressionRewriting", k.g), k.b("expressionRewriting.bindingRewriteValidators", k.g.S), k.b("expressionRewriting.parseObjectLiteral", k.g.da), k.b("expressionRewriting.preProcessBindings", k.g.ea), k.b("jsonExpressionRewriting", k.g), k.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson", k.g.ea),
3317 function () {
3318 function a(a) {
3319 return 8 == a.nodeType && (f ? a.text : a.nodeValue).match(g)
3320 }
3321
3322 function b(a) {
3323 return 8 == a.nodeType && (f ? a.text : a.nodeValue).match(h)
3324 }
3325
3326 function c(c, d) {
3327 for (var e = c, f = 1, g = []; e = e.nextSibling;) {
3328 if (b(e) && (f--, 0 === f)) return g;
3329 g.push(e), a(e) && f++
3330 }
3331 if (!d) throw Error("Cannot find closing comment tag to match: " + c.nodeValue);
3332 return null
3333 }
3334
3335 function e(a, b) {
3336 var d = c(a, b);
3337 return d ? 0 < d.length ? d[d.length - 1].nextSibling : a.nextSibling : null
3338 }
3339 var f = d && "<!--test-->" === d.createComment("test").text,
3340 g = f ? /^\x3c!--\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*--\x3e$/ : /^\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*$/,
3341 h = f ? /^\x3c!--\s*\/ko\s*--\x3e$/ : /^\s*\/ko\s*$/,
3342 i = {
3343 ul: !0,
3344 ol: !0
3345 };
3346 k.e = {
3347 L: {},
3348 childNodes: function (b) {
3349 return a(b) ? c(b) : b.childNodes
3350 },
3351 ba: function (b) {
3352 if (a(b)) {
3353 b = k.e.childNodes(b);
3354 for (var c = 0, d = b.length; d > c; c++) k.removeNode(b[c])
3355 } else k.a.oa(b)
3356 },
3357 P: function (b, c) {
3358 if (a(b)) {
3359 k.e.ba(b);
3360 for (var d = b.nextSibling, e = 0, f = c.length; f > e; e++) d.parentNode.insertBefore(c[e], d)
3361 } else k.a.P(b, c)
3362 },
3363 ab: function (b, c) {
3364 a(b) ? b.parentNode.insertBefore(c, b.nextSibling) : b.firstChild ? b.insertBefore(c, b.firstChild) : b.appendChild(c)
3365 },
3366 Va: function (b, c, d) {
3367 d ? a(b) ? b.parentNode.insertBefore(c, d.nextSibling) : d.nextSibling ? b.insertBefore(c, d.nextSibling) : b.appendChild(c) : k.e.ab(b, c)
3368 },
3369 firstChild: function (c) {
3370 return a(c) ? !c.nextSibling || b(c.nextSibling) ? null : c.nextSibling : c.firstChild
3371 },
3372 nextSibling: function (c) {
3373 return a(c) && (c = e(c)), c.nextSibling && b(c.nextSibling) ? null : c.nextSibling
3374 },
3375 ob: function (b) {
3376 return (b = a(b)) ? b[1] : null
3377 },
3378 Za: function (c) {
3379 if (i[k.a.u(c)]) {
3380 var d = c.firstChild;
3381 if (d)
3382 do
3383 if (1 === d.nodeType) {
3384 var f;
3385 f = d.firstChild;
3386 var g = null;
3387 if (f)
3388 do
3389 if (g) g.push(f);
3390 else if (a(f)) {
3391 var h = e(f, !0);
3392 h ? f = h : g = [f]
3393 } else b(f) && (g = [f]);
3394 while (f = f.nextSibling);
3395 if (f = g)
3396 for (g = d.nextSibling, h = 0; h < f.length; h++) g ? c.insertBefore(f[h], g) : c.appendChild(f[h])
3397 }
3398 while (d = d.nextSibling)
3399 }
3400 }
3401 }
3402 }(), k.b("virtualElements", k.e), k.b("virtualElements.allowedBindings", k.e.L), k.b("virtualElements.emptyNode", k.e.ba), k.b("virtualElements.insertAfter", k.e.Va), k.b("virtualElements.prepend", k.e.ab), k.b("virtualElements.setDomNodeChildren", k.e.P),
3403 function () {
3404 k.M = function () {
3405 this.Na = {}
3406 }, k.a.extend(k.M.prototype, {
3407 nodeHasBindings: function (a) {
3408 switch (a.nodeType) {
3409 case 1:
3410 return null != a.getAttribute("data-bind");
3411 case 8:
3412 return null != k.e.ob(a);
3413 default:
3414 return !1
3415 }
3416 },
3417 getBindings: function (a, b) {
3418 var c = this.getBindingsString(a, b);
3419 return c ? this.parseBindingsString(c, b, a) : null
3420 },
3421 getBindingsString: function (a) {
3422 switch (a.nodeType) {
3423 case 1:
3424 return a.getAttribute("data-bind");
3425 case 8:
3426 return k.e.ob(a);
3427 default:
3428 return null
3429 }
3430 },
3431 parseBindingsString: function (a, b, c) {
3432 try {
3433 var d;
3434 if (!(d = this.Na[a])) {
3435 var e, f = this.Na,
3436 g = "with($context){with($data||{}){return{" + k.g.ea(a) + "}}}";
3437 e = new Function("$context", "$element", g), d = f[a] = e
3438 }
3439 return d(b, c)
3440 } catch (h) {
3441 throw h.message = "Unable to parse bindings.\nBindings value: " + a + "\nMessage: " + h.message, h
3442 }
3443 }
3444 }), k.M.instance = new k.M
3445 }(), k.b("bindingProvider", k.M),
3446 function () {
3447 function a(a, b, c) {
3448 for (var e = k.e.firstChild(b); b = e;) e = k.e.nextSibling(b), d(a, b, c)
3449 }
3450
3451 function d(b, c, d) {
3452 var f = !0,
3453 g = 1 === c.nodeType;
3454 g && k.e.Za(c), (g && d || k.M.instance.nodeHasBindings(c)) && (f = e(c, null, b, d).Sb), f && a(b, c, !g)
3455 }
3456
3457 function e(a, c, d, e) {
3458 function g(a) {
3459 return function () {
3460 return i[a]
3461 }
3462 }
3463
3464 function h() {
3465 return i
3466 }
3467 var i, j, l = 0,
3468 m = k.a.f.get(a, f);
3469 if (!c) {
3470 if (m) throw Error("You cannot apply bindings multiple times to the same element.");
3471 k.a.f.set(a, f, !0)
3472 }
3473 return k.j(function () {
3474 var f = d && d instanceof k.A ? d : new k.A(k.a.c(d)),
3475 n = f.$data;
3476 !m && e && k.jb(a, f), (i = ("function" == typeof c ? c(f, a) : c) || k.M.instance.getBindings(a, f)) && (0 === l && (l = 1, k.a.w(i, function (c) {
3477 var d = k.d[c];
3478 if (d && 8 === a.nodeType && !k.e.L[c]) throw Error("The binding '" + c + "' cannot be used with virtual elements");
3479 if (d && "function" == typeof d.init && (d = d.init(a, g(c), h, n, f)) && d.controlsDescendantBindings) {
3480 if (j !== b) throw Error("Multiple bindings (" + j + " and " + c + ") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");
3481 j = c
3482 }
3483 }), l = 2), 2 === l && k.a.w(i, function (b) {
3484 var c = k.d[b];
3485 c && "function" == typeof c.update && c.update(a, g(b), h, n, f)
3486 }))
3487 }, null, {
3488 $: a
3489 }), {
3490 Sb: j === b
3491 }
3492 }
3493 k.d = {}, k.A = function (a, b, c) {
3494 b ? (k.a.extend(this, b), this.$parentContext = b, this.$parent = b.$data, this.$parents = (b.$parents || []).slice(0), this.$parents.unshift(this.$parent)) : (this.$parents = [], this.$root = a, this.ko = k), this.$data = a, c && (this[c] = a)
3495 }, k.A.prototype.createChildContext = function (a, b) {
3496 return new k.A(a, this, b)
3497 }, k.A.prototype.extend = function (a) {
3498 var b = k.a.extend(new k.A, this);
3499 return k.a.extend(b, a)
3500 };
3501 var f = "__ko_boundElement";
3502 k.jb = function (a, b) {
3503 return 2 != arguments.length ? k.a.f.get(a, "__ko_bindingContext__") : void k.a.f.set(a, "__ko_bindingContext__", b)
3504 }, k.Ka = function (a, b, c) {
3505 return 1 === a.nodeType && k.e.Za(a), e(a, b, c, !0)
3506 }, k.Ja = function (b, c) {
3507 1 !== c.nodeType && 8 !== c.nodeType || a(b, c, !0)
3508 }, k.Ia = function (a, b) {
3509 if (b && 1 !== b.nodeType && 8 !== b.nodeType) throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");
3510 b = b || c.document.body, d(a, b, !0)
3511 }, k.na = function (a) {
3512 switch (a.nodeType) {
3513 case 1:
3514 case 8:
3515 var c = k.jb(a);
3516 if (c) return c;
3517 if (a.parentNode) return k.na(a.parentNode)
3518 }
3519 return b
3520 }, k.ub = function (a) {
3521 return (a = k.na(a)) ? a.$data : b
3522 }, k.b("bindingHandlers", k.d), k.b("applyBindings", k.Ia), k.b("applyBindingsToDescendants", k.Ja), k.b("applyBindingsToNode", k.Ka), k.b("contextFor", k.na), k.b("dataFor", k.ub)
3523 }();
3524 var n = {
3525 "class": "className",
3526 "for": "htmlFor"
3527 };
3528 k.d.attr = {
3529 update: function (a, c) {
3530 var d = k.a.c(c()) || {};
3531 k.a.w(d, function (c, d) {
3532 d = k.a.c(d);
3533 var e = !1 === d || null === d || d === b;
3534 e && a.removeAttribute(c), 8 >= k.a.ca && c in n ? (c = n[c], e ? a.removeAttribute(c) : a[c] = d) : e || a.setAttribute(c, d.toString()), "name" === c && k.a.gb(a, e ? "" : d.toString())
3535 })
3536 }
3537 }, k.d.checked = {
3538 init: function (b, c, d) {
3539 k.a.o(b, "click", function () {
3540 var a;
3541 if ("checkbox" == b.type) a = b.checked;
3542 else {
3543 if ("radio" != b.type || !b.checked) return;
3544 a = b.value
3545 }
3546 var e = c(),
3547 f = k.a.c(e);
3548 "checkbox" == b.type && f instanceof Array ? k.a.ja(e, b.value, b.checked) : k.g.ha(e, d, "checked", a, !0)
3549 }), "radio" != b.type || b.name || k.d.uniqueName.init(b, a(!0))
3550 },
3551 update: function (a, b) {
3552 var c = k.a.c(b());
3553 "checkbox" == a.type ? a.checked = c instanceof Array ? 0 <= k.a.k(c, a.value) : c : "radio" == a.type && (a.checked = a.value == c)
3554 }
3555 }, k.d.css = {
3556 update: function (a, b) {
3557 var c = k.a.c(b());
3558 "object" == typeof c ? k.a.w(c, function (b, c) {
3559 c = k.a.c(c), k.a.ga(a, b, c)
3560 }) : (c = String(c || ""), k.a.ga(a, a.__ko__cssValue, !1), a.__ko__cssValue = c, k.a.ga(a, c, !0))
3561 }
3562 }, k.d.enable = {
3563 update: function (a, b) {
3564 var c = k.a.c(b());
3565 c && a.disabled ? a.removeAttribute("disabled") : c || a.disabled || (a.disabled = !0)
3566 }
3567 }, k.d.disable = {
3568 update: function (a, b) {
3569 k.d.enable.update(a, function () {
3570 return !k.a.c(b())
3571 })
3572 }
3573 }, k.d.event = {
3574 init: function (a, b, c, d) {
3575 var e = b() || {};
3576 k.a.w(e, function (e) {
3577 "string" == typeof e && k.a.o(a, e, function (a) {
3578 var f, g = b()[e];
3579 if (g) {
3580 var h = c();
3581 try {
3582 var i = k.a.N(arguments);
3583 i.unshift(d), f = g.apply(d, i)
3584 } finally {
3585 !0 !== f && (a.preventDefault ? a.preventDefault() : a.returnValue = !1)
3586 }!1 === h[e + "Bubble"] && (a.cancelBubble = !0, a.stopPropagation && a.stopPropagation())
3587 }
3588 })
3589 })
3590 }
3591 }, k.d.foreach = {
3592 Ya: function (a) {
3593 return function () {
3594 var b = a(),
3595 c = k.a.ya(b);
3596 return c && "number" != typeof c.length ? (k.a.c(b), {
3597 foreach: c.data,
3598 as: c.as,
3599 includeDestroyed: c.includeDestroyed,
3600 afterAdd: c.afterAdd,
3601 beforeRemove: c.beforeRemove,
3602 afterRender: c.afterRender,
3603 beforeMove: c.beforeMove,
3604 afterMove: c.afterMove,
3605 templateEngine: k.D.sa
3606 }) : {
3607 foreach: b,
3608 templateEngine: k.D.sa
3609 }
3610 }
3611 },
3612 init: function (a, b) {
3613 return k.d.template.init(a, k.d.foreach.Ya(b))
3614 },
3615 update: function (a, b, c, d, e) {
3616 return k.d.template.update(a, k.d.foreach.Ya(b), c, d, e)
3617 }
3618 }, k.g.S.foreach = !1, k.e.L.foreach = !0, k.d.hasfocus = {
3619 init: function (a, b, c) {
3620 function d(d) {
3621 a.__ko_hasfocusUpdating = !0;
3622 var e = a.ownerDocument;
3623 if ("activeElement" in e) {
3624 var f;
3625 try {
3626 f = e.activeElement
3627 } catch (g) {
3628 f = e.body
3629 }
3630 d = f === a
3631 }
3632 e = b(), k.g.ha(e, c, "hasfocus", d, !0), a.__ko_hasfocusLastValue = d, a.__ko_hasfocusUpdating = !1
3633 }
3634 var e = d.bind(null, !0),
3635 f = d.bind(null, !1);
3636 k.a.o(a, "focus", e), k.a.o(a, "focusin", e), k.a.o(a, "blur", f), k.a.o(a, "focusout", f)
3637 },
3638 update: function (a, b) {
3639 var c = !!k.a.c(b());
3640 a.__ko_hasfocusUpdating || a.__ko_hasfocusLastValue === c || (c ? a.focus() : a.blur(), k.q.I(k.a.Ga, null, [a, c ? "focusin" : "focusout"]))
3641 }
3642 }, k.d.hasFocus = k.d.hasfocus, k.d.html = {
3643 init: function () {
3644 return {
3645 controlsDescendantBindings: !0
3646 }
3647 },
3648 update: function (a, b) {
3649 k.a.fa(a, b())
3650 }
3651 };
3652 var o = "__ko_withIfBindingData";
3653 i("if"), i("ifnot", !1, !0), i("with", !0, !1, function (a, b) {
3654 return a.createChildContext(b)
3655 }), k.d.options = {
3656 init: function (a) {
3657 if ("select" !== k.a.u(a)) throw Error("options binding applies only to SELECT elements");
3658 for (; 0 < a.length;) a.remove(0);
3659 return {
3660 controlsDescendantBindings: !0
3661 }
3662 },
3663 update: function (a, c, e) {
3664 function f(a, b, c) {
3665 var d = typeof b;
3666 return "function" == d ? b(a) : "string" == d ? a[b] : c
3667 }
3668
3669 function g(a, b) {
3670 if (m) {
3671 var c = 0 <= k.a.k(m, k.h.n(b[0]));
3672 k.a.hb(b[0], c)
3673 }
3674 }
3675 var h = 0 == a.length,
3676 i = !h && a.multiple ? a.scrollTop : null;
3677 c = k.a.c(c());
3678 var l, m, n = e(),
3679 o = n.optionsIncludeDestroyed,
3680 p = {};
3681 if (a.multiple ? m = k.a.Z(a.selectedOptions || k.a.Y(a.childNodes, function (a) {
3682 return a.tagName && "option" === k.a.u(a) && a.selected
3683 }), function (a) {
3684 return k.h.n(a)
3685 }) : 0 <= a.selectedIndex && (m = [k.h.n(a.options[a.selectedIndex])]), c) {
3686 "undefined" == typeof c.length && (c = [c]);
3687 var q = k.a.Y(c, function (a) {
3688 return o || a === b || null === a || !k.a.c(a._destroy)
3689 });
3690 "optionsCaption" in n && (l = k.a.c(n.optionsCaption), null !== l && l !== b && q.unshift(p))
3691 } else c = [];
3692 e = g, n.optionsAfterRender && (e = function (a, c) {
3693 g(0, c), k.q.I(n.optionsAfterRender, null, [c[0], a !== p ? a : b])
3694 }), k.a.Aa(a, q, function (a, c, e) {
3695 return e.length && (m = e[0].selected && [k.h.n(e[0])]), c = d.createElement("option"), a === p ? (k.a.fa(c, l), k.h.W(c, b)) : (e = f(a, n.optionsValue, a), k.h.W(c, k.a.c(e)), a = f(a, n.optionsText, e), k.a.ib(c, a)), [c]
3696 }, null, e), m = null, h && "value" in n && j(a, k.a.ya(n.value), !0), k.a.zb(a), i && 20 < Math.abs(i - a.scrollTop) && (a.scrollTop = i)
3697 }
3698 }, k.d.options.wa = "__ko.optionValueDomData__", k.d.selectedOptions = {
3699 init: function (a, b, c) {
3700 k.a.o(a, "change", function () {
3701 var d = b(),
3702 e = [];
3703 k.a.p(a.getElementsByTagName("option"), function (a) {
3704 a.selected && e.push(k.h.n(a))
3705 }), k.g.ha(d, c, "selectedOptions", e)
3706 })
3707 },
3708 update: function (a, b) {
3709 if ("select" != k.a.u(a)) throw Error("values binding applies only to SELECT elements");
3710 var c = k.a.c(b());
3711 c && "number" == typeof c.length && k.a.p(a.getElementsByTagName("option"), function (a) {
3712 var b = 0 <= k.a.k(c, k.h.n(a));
3713 k.a.hb(a, b)
3714 })
3715 }
3716 }, k.d.style = {
3717 update: function (a, b) {
3718 var c = k.a.c(b() || {});
3719 k.a.w(c, function (b, c) {
3720 c = k.a.c(c), a.style[b] = c || ""
3721 })
3722 }
3723 }, k.d.submit = {
3724 init: function (a, b, c, d) {
3725 if ("function" != typeof b()) throw Error("The value for a submit binding must be a function");
3726 k.a.o(a, "submit", function (c) {
3727 var e, f = b();
3728 try {
3729 e = f.call(d, a)
3730 } finally {
3731 !0 !== e && (c.preventDefault ? c.preventDefault() : c.returnValue = !1)
3732 }
3733 })
3734 }
3735 }, k.d.text = {
3736 update: function (a, b) {
3737 k.a.ib(a, b())
3738 }
3739 }, k.e.L.text = !0, k.d.uniqueName = {
3740 init: function (a, b) {
3741 if (b()) {
3742 var c = "ko_unique_" + ++k.d.uniqueName.tb;
3743 k.a.gb(a, c)
3744 }
3745 }
3746 }, k.d.uniqueName.tb = 0, k.d.value = {
3747 init: function (a, b, c) {
3748 function d() {
3749 g = !1;
3750 var d = b(),
3751 e = k.h.n(a);
3752 k.g.ha(d, c, "value", e)
3753 }
3754 var e = ["change"],
3755 f = c().valueUpdate,
3756 g = !1;
3757 f && ("string" == typeof f && (f = [f]), k.a.R(e, f), e = k.a.Ma(e)), !k.a.ca || "input" != a.tagName.toLowerCase() || "text" != a.type || "off" == a.autocomplete || a.form && "off" == a.form.autocomplete || -1 != k.a.k(e, "propertychange") || (k.a.o(a, "propertychange", function () {
3758 g = !0
3759 }), k.a.o(a, "blur", function () {
3760 g && d()
3761 })), k.a.p(e, function (b) {
3762 var c = d;
3763 k.a.Tb(b, "after") && (c = function () {
3764 setTimeout(d, 0)
3765 }, b = b.substring(5)), k.a.o(a, b, c)
3766 })
3767 },
3768 update: function (a, b) {
3769 var c = "select" === k.a.u(a),
3770 d = k.a.c(b()),
3771 e = k.h.n(a);
3772 d !== e && (e = function () {
3773 k.h.W(a, d)
3774 }, e(), c && setTimeout(e, 0)), c && 0 < a.length && j(a, d, !1)
3775 }
3776 }, k.d.visible = {
3777 update: function (a, b) {
3778 var c = k.a.c(b()),
3779 d = "none" != a.style.display;
3780 c && !d ? a.style.display = "" : !c && d && (a.style.display = "none")
3781 }
3782 },
3783 function (a) {
3784 k.d[a] = {
3785 init: function (b, c, d, e) {
3786 return k.d.event.init.call(this, b, function () {
3787 var b = {};
3788 return b[a] = c(), b
3789 }, d, e)
3790 }
3791 }
3792 }("click"), k.v = function () {}, k.v.prototype.renderTemplateSource = function () {
3793 throw Error("Override renderTemplateSource")
3794 }, k.v.prototype.createJavaScriptEvaluatorBlock = function () {
3795 throw Error("Override createJavaScriptEvaluatorBlock")
3796 }, k.v.prototype.makeTemplateSource = function (a, b) {
3797 if ("string" == typeof a) {
3798 b = b || d;
3799 var c = b.getElementById(a);
3800 if (!c) throw Error("Cannot find template with ID " + a);
3801 return new k.l.i(c)
3802 }
3803 if (1 == a.nodeType || 8 == a.nodeType) return new k.l.Q(a);
3804 throw Error("Unknown template type: " + a)
3805 }, k.v.prototype.renderTemplate = function (a, b, c, d) {
3806 return a = this.makeTemplateSource(a, d), this.renderTemplateSource(a, b, c)
3807 }, k.v.prototype.isTemplateRewritten = function (a, b) {
3808 return !1 === this.allowTemplateRewriting ? !0 : this.makeTemplateSource(a, b).data("isRewritten")
3809 }, k.v.prototype.rewriteTemplate = function (a, b, c) {
3810 a = this.makeTemplateSource(a, c), b = b(a.text()), a.text(b), a.data("isRewritten", !0)
3811 }, k.b("templateEngine", k.v), k.Ea = function () {
3812 function a(a, b, c, d) {
3813 a = k.g.da(a);
3814 for (var e = k.g.S, f = 0; f < a.length; f++) {
3815 var g = a[f].key;
3816 if (e.hasOwnProperty(g)) {
3817 var h = e[g];
3818 if ("function" == typeof h) {
3819 if (g = h(a[f].value)) throw Error(g)
3820 } else if (!h) throw Error("This template engine does not support the '" + g + "' binding within its templates")
3821 }
3822 }
3823 return c = "ko.__tr_ambtns(function($context,$element){return(function(){return{ " + k.g.ea(a) + " } })()},'" + c.toLowerCase() + "')", d.createJavaScriptEvaluatorBlock(c) + b
3824 }
3825 var b = /(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,
3826 c = /\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;
3827 return {
3828 Ab: function (a, b, c) {
3829 b.isTemplateRewritten(a, c) || b.rewriteTemplate(a, function (a) {
3830 return k.Ea.Lb(a, b)
3831 }, c)
3832 },
3833 Lb: function (d, e) {
3834 return d.replace(b, function (b, c, d, f, g) {
3835 return a(g, c, d, e)
3836 }).replace(c, function (b, c) {
3837 return a(c, "<!-- ko -->", "#comment", e)
3838 })
3839 },
3840 qb: function (a, b) {
3841 return k.s.va(function (c, d) {
3842 var e = c.nextSibling;
3843 e && e.nodeName.toLowerCase() === b && k.Ka(e, a, d)
3844 })
3845 }
3846 }
3847 }(), k.b("__tr_ambtns", k.Ea.qb),
3848 function () {
3849 k.l = {}, k.l.i = function (a) {
3850 this.i = a
3851 }, k.l.i.prototype.text = function () {
3852 var a = k.a.u(this.i),
3853 a = "script" === a ? "text" : "textarea" === a ? "value" : "innerHTML";
3854 if (0 == arguments.length) return this.i[a];
3855 var b = arguments[0];
3856 "innerHTML" === a ? k.a.fa(this.i, b) : this.i[a] = b
3857 }, k.l.i.prototype.data = function (a) {
3858 return 1 === arguments.length ? k.a.f.get(this.i, "templateSourceData_" + a) : void k.a.f.set(this.i, "templateSourceData_" + a, arguments[1])
3859 }, k.l.Q = function (a) {
3860 this.i = a
3861 }, k.l.Q.prototype = new k.l.i, k.l.Q.prototype.text = function () {
3862 if (0 == arguments.length) {
3863 var a = k.a.f.get(this.i, "__ko_anon_template__") || {};
3864 return a.Fa === b && a.ma && (a.Fa = a.ma.innerHTML), a.Fa
3865 }
3866 k.a.f.set(this.i, "__ko_anon_template__", {
3867 Fa: arguments[0]
3868 })
3869 }, k.l.i.prototype.nodes = function () {
3870 return 0 == arguments.length ? (k.a.f.get(this.i, "__ko_anon_template__") || {}).ma : void k.a.f.set(this.i, "__ko_anon_template__", {
3871 ma: arguments[0]
3872 })
3873 }, k.b("templateSources", k.l), k.b("templateSources.domElement", k.l.i), k.b("templateSources.anonymousTemplate", k.l.Q)
3874 }(),
3875 function () {
3876 function a(a, b, c) {
3877 var d;
3878 for (b = k.e.nextSibling(b); a && (d = a) !== b;) a = k.e.nextSibling(d), 1 !== d.nodeType && 8 !== d.nodeType || c(d)
3879 }
3880
3881 function c(b, c) {
3882 if (b.length) {
3883 var d = b[0],
3884 e = b[b.length - 1];
3885 a(d, e, function (a) {
3886 k.Ia(c, a)
3887 }), a(d, e, function (a) {
3888 k.s.nb(a, [c])
3889 })
3890 }
3891 }
3892
3893 function d(a) {
3894 return a.nodeType ? a : 0 < a.length ? a[0] : null
3895 }
3896
3897 function e(a, b, e, g, h) {
3898 h = h || {};
3899 var i = a && d(a),
3900 i = i && i.ownerDocument,
3901 j = h.templateEngine || f;
3902 if (k.Ea.Ab(e, j, i), e = j.renderTemplate(e, g, h, i), "number" != typeof e.length || 0 < e.length && "number" != typeof e[0].nodeType) throw Error("Template engine must return an array of DOM nodes");
3903 switch (i = !1, b) {
3904 case "replaceChildren":
3905 k.e.P(a, e), i = !0;
3906 break;
3907 case "replaceNode":
3908 k.a.eb(a, e), i = !0;
3909 break;
3910 case "ignoreTargetNode":
3911 break;
3912 default:
3913 throw Error("Unknown renderMode: " + b)
3914 }
3915 return i && (c(e, g), h.afterRender && k.q.I(h.afterRender, null, [e, g.$data])), e
3916 }
3917 var f;
3918 k.Ba = function (a) {
3919 if (a != b && !(a instanceof k.v)) throw Error("templateEngine must inherit from ko.templateEngine");
3920 f = a
3921 }, k.za = function (a, c, g, h, i) {
3922 if (g = g || {}, (g.templateEngine || f) == b) throw Error("Set a template engine before calling renderTemplate");
3923 if (i = i || "replaceChildren", h) {
3924 var j = d(h);
3925 return k.j(function () {
3926 var b = c && c instanceof k.A ? c : new k.A(k.a.c(c)),
3927 f = "function" == typeof a ? a(b.$data, b) : a,
3928 b = e(h, i, f, b, g);
3929 "replaceNode" == i && (h = b, j = d(h))
3930 }, null, {
3931 Qa: function () {
3932 return !j || !k.a.aa(j)
3933 },
3934 $: j && "replaceNode" == i ? j.parentNode : j
3935 })
3936 }
3937 return k.s.va(function (b) {
3938 k.za(a, c, g, b, "replaceNode")
3939 })
3940 }, k.Rb = function (a, d, f, g, h) {
3941 function i(a, b) {
3942 c(b, l), f.afterRender && f.afterRender(b, a)
3943 }
3944
3945 function j(b, c) {
3946 l = h.createChildContext(k.a.c(b), f.as), l.$index = c;
3947 var d = "function" == typeof a ? a(b, l) : a;
3948 return e(null, "ignoreTargetNode", d, l, f)
3949 }
3950 var l;
3951 return k.j(function () {
3952 var a = k.a.c(d) || [];
3953 "undefined" == typeof a.length && (a = [a]), a = k.a.Y(a, function (a) {
3954 return f.includeDestroyed || a === b || null === a || !k.a.c(a._destroy)
3955 }), k.q.I(k.a.Aa, null, [g, a, j, f, i])
3956 }, null, {
3957 $: g
3958 })
3959 }, k.d.template = {
3960 init: function (a, b) {
3961 var c = k.a.c(b());
3962 return "string" == typeof c || c.name || 1 != a.nodeType && 8 != a.nodeType || (c = 1 == a.nodeType ? a.childNodes : k.e.childNodes(a), c = k.a.Mb(c), new k.l.Q(a).nodes(c)), {
3963 controlsDescendantBindings: !0
3964 }
3965 },
3966 update: function (a, c, d, e, f) {
3967 c = k.a.c(c()), d = {}, e = !0;
3968 var g, h = null;
3969 "string" != typeof c && (d = c, c = k.a.c(d.name), "if" in d && (e = k.a.c(d["if"])), e && "ifnot" in d && (e = !k.a.c(d.ifnot)), g = k.a.c(d.data)), "foreach" in d ? h = k.Rb(c || a, e && d.foreach || [], d, a, f) : e ? (f = "data" in d ? f.createChildContext(g, d.as) : f, h = k.za(c || a, f, d, a)) : k.e.ba(a), f = h, (g = k.a.f.get(a, "__ko__templateComputedDomDataKey__")) && "function" == typeof g.B && g.B(), k.a.f.set(a, "__ko__templateComputedDomDataKey__", f && f.ta() ? f : b)
3970 }
3971 }, k.g.S.template = function (a) {
3972 return a = k.g.da(a), 1 == a.length && a[0].unknown || k.g.Jb(a, "name") ? null : "This template engine does not support anonymous templates nested within its templates"
3973 }, k.e.L.template = !0
3974 }(), k.b("setTemplateEngine", k.Ba), k.b("renderTemplate", k.za), k.a.Pa = function () {
3975 function a(a, b, c, d, e) {
3976 var f, g, h, i, j, k = Math.min,
3977 l = Math.max,
3978 m = [],
3979 n = a.length,
3980 o = b.length,
3981 p = o - n || 1,
3982 q = n + o + 1;
3983 for (f = 0; n >= f; f++)
3984 for (i = h, m.push(h = []), j = k(o, f + p), g = l(0, f - 1); j >= g; g++) h[g] = g ? f ? a[f - 1] === b[g - 1] ? i[g - 1] : k(i[g] || q, h[g - 1] || q) + 1 : g + 1 : f + 1;
3985 for (k = [], l = [], p = [], f = n, g = o; f || g;) o = m[f][g] - 1, g && o === m[f][g - 1] ? l.push(k[k.length] = {
3986 status: c,
3987 value: b[--g],
3988 index: g
3989 }) : f && o === m[f - 1][g] ? p.push(k[k.length] = {
3990 status: d,
3991 value: a[--f],
3992 index: f
3993 }) : (k.push({
3994 status: "retained",
3995 value: b[--g]
3996 }), --f);
3997 if (l.length && p.length) {
3998 a = 10 * n;
3999 var r;
4000 for (b = c = 0;
4001 (e || a > b) && (r = l[c]); c++) {
4002 for (d = 0; m = p[d]; d++)
4003 if (r.value === m.value) {
4004 r.moved = m.index, m.moved = r.index, p.splice(d, 1), b = d = 0;
4005 break
4006 }
4007 b += d
4008 }
4009 }
4010 return k.reverse()
4011 }
4012 return function (b, c, d) {
4013 return b = b || [], c = c || [], b.length <= c.length ? a(b, c, "added", "deleted", d) : a(c, b, "deleted", "added", d)
4014 }
4015 }(), k.b("utils.compareArrays", k.a.Pa),
4016 function () {
4017 function a(a) {
4018 for (; a.length && !k.a.aa(a[0]);) a.splice(0, 1);
4019 if (1 < a.length) {
4020 for (var b = a[0], c = a[a.length - 1], d = [b]; b !== c;) {
4021 if (b = b.nextSibling, !b) return;
4022 d.push(b)
4023 }
4024 Array.prototype.splice.apply(a, [0, a.length].concat(d))
4025 }
4026 return a
4027 }
4028
4029 function c(c, d, e, f, g) {
4030 var h = [];
4031 return c = k.j(function () {
4032 var b = d(e, g, a(h)) || [];
4033 0 < h.length && (k.a.eb(h, b), f && k.q.I(f, null, [e, b, g])), h.splice(0, h.length), k.a.R(h, b)
4034 }, null, {
4035 $: c,
4036 Qa: function () {
4037 return !k.a.pb(h)
4038 }
4039 }), {
4040 O: h,
4041 j: c.ta() ? c : b
4042 }
4043 }
4044 k.a.Aa = function (d, e, f, g, h) {
4045 function i(b, c) {
4046 u = m[c], r !== c && (x[b] = u), u.ra(r++), a(u.O), p.push(u), t.push(u)
4047 }
4048
4049 function j(a, b) {
4050 if (a)
4051 for (var c = 0, d = b.length; d > c; c++) b[c] && k.a.p(b[c].O, function (d) {
4052 a(d, c, b[c].X)
4053 })
4054 }
4055 e = e || [], g = g || {};
4056 var l = k.a.f.get(d, "setDomNodeChildrenFromArrayMapping_lastMappingResult") === b,
4057 m = k.a.f.get(d, "setDomNodeChildrenFromArrayMapping_lastMappingResult") || [],
4058 n = k.a.Z(m, function (a) {
4059 return a.X
4060 }),
4061 o = k.a.Pa(n, e, g.dontLimitMoves),
4062 p = [],
4063 q = 0,
4064 r = 0,
4065 s = [],
4066 t = [];
4067 e = [];
4068 for (var u, v, w, x = [], n = [], y = 0; v = o[y]; y++) switch (w = v.moved, v.status) {
4069 case "deleted":
4070 w === b && (u = m[q], u.j && u.j.B(), s.push.apply(s, a(u.O)), g.beforeRemove && (e[y] = u, t.push(u))), q++;
4071 break;
4072 case "retained":
4073 i(y, q++);
4074 break;
4075 case "added":
4076 w !== b ? i(y, w) : (u = {
4077 X: v.value,
4078 ra: k.m(r++)
4079 }, p.push(u), t.push(u), l || (n[y] = u))
4080 }
4081 j(g.beforeMove, x), k.a.p(s, g.beforeRemove ? k.H : k.removeNode);
4082 for (var z, y = 0, l = k.e.firstChild(d); u = t[y]; y++) {
4083 for (u.O || k.a.extend(u, c(d, f, u.X, h, u.ra)), q = 0; o = u.O[q]; l = o.nextSibling, z = o, q++) o !== l && k.e.Va(d, o, z);
4084 !u.Fb && h && (h(u.X, u.O, u.ra), u.Fb = !0)
4085 }
4086 j(g.beforeRemove, e), j(g.afterMove, x), j(g.afterAdd, n), k.a.f.set(d, "setDomNodeChildrenFromArrayMapping_lastMappingResult", p)
4087 }
4088 }(), k.b("utils.setDomNodeChildrenFromArrayMapping", k.a.Aa), k.D = function () {
4089 this.allowTemplateRewriting = !1
4090 }, k.D.prototype = new k.v, k.D.prototype.renderTemplateSource = function (a) {
4091 var b = (9 > k.a.ca ? 0 : a.nodes) ? a.nodes() : null;
4092 return b ? k.a.N(b.cloneNode(!0).childNodes) : (a = a.text(), k.a.xa(a))
4093 }, k.D.sa = new k.D, k.Ba(k.D.sa), k.b("nativeTemplateEngine", k.D),
4094 function () {
4095 k.ua = function () {
4096 var a = this.Ib = function () {
4097 if ("undefined" == typeof f || !f.tmpl) return 0;
4098 try {
4099 if (0 <= f.tmpl.tag.tmpl.open.toString().indexOf("__")) return 2
4100 } catch (a) {}
4101 return 1
4102 }();
4103 this.renderTemplateSource = function (b, c, e) {
4104 if (e = e || {}, 2 > a) throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");
4105 var g = b.data("precompiled");
4106 return g || (g = b.text() || "", g = f.template(null, "{{ko_with $item.koBindingContext}}" + g + "{{/ko_with}}"), b.data("precompiled", g)), b = [c.$data], c = f.extend({
4107 koBindingContext: c
4108 }, e.templateOptions), c = f.tmpl(g, b, c), c.appendTo(d.createElement("div")), f.fragments = {}, c
4109 }, this.createJavaScriptEvaluatorBlock = function (a) {
4110 return "{{ko_code ((function() { return " + a + " })()) }}"
4111 }, this.addTemplate = function (a, b) {
4112 d.write("<script type='text/html' id='" + a + "'>" + b + "</script>")
4113 }, a > 0 && (f.tmpl.tag.ko_code = {
4114 open: "__.push($1 || '');"
4115 }, f.tmpl.tag.ko_with = {
4116 open: "with($1) {",
4117 close: "} "
4118 })
4119 }, k.ua.prototype = new k.v;
4120 var a = new k.ua;
4121 0 < a.Ib && k.Ba(a), k.b("jqueryTmplTemplateEngine", k.ua)
4122 }()
4123 })
4124 }()
4125 }(),
4126 function (a) {
4127 function b(a) {
4128 throw RangeError(D[a])
4129 }
4130
4131 function c(a, b) {
4132 for (var c = a.length; c--;) a[c] = b(a[c]);
4133 return a
4134 }
4135
4136 function d(a, b) {
4137 var d = ".";
4138 return c(a.split(d), b).join(d)
4139 }
4140
4141 function e(a) {
4142 for (var b, c, d = [], e = 0, f = a.length; f > e;) b = a.charCodeAt(e++), 55296 == (63488 & b) && f > e ? (c = a.charCodeAt(e++), 56320 == (64512 & c) ? d.push(((1023 & b) << 10) + (1023 & c) + 65536) : d.push(b, c)) : d.push(b);
4143 return d
4144 }
4145
4146 function f(a) {
4147 return c(a, function (a) {
4148 var b = "";
4149 return a > 65535 && (a -= 65536, b += G(a >>> 10 & 1023 | 55296), a = 56320 | 1023 & a), b += G(a)
4150 }).join("")
4151 }
4152
4153 function g(a) {
4154 return 10 > a - 48 ? a - 22 : 26 > a - 65 ? a - 65 : 26 > a - 97 ? a - 97 : t
4155 }
4156
4157 function h(a, b) {
4158 return a + 22 + 75 * (26 > a) - ((0 != b) << 5)
4159 }
4160
4161 function i(a, b, c) {
4162 var d = 0;
4163 for (a = c ? F(a / x) : a >> 1, a += F(a / b); a > E * v >> 1; d += t) a = F(a / E);
4164 return F(d + (E + 1) * a / (a + w))
4165 }
4166
4167 function j(a) {
4168 var c, d, e, h, j, k, l, m, n, o, p = [],
4169 q = a.length,
4170 r = 0,
4171 w = z,
4172 x = y;
4173 for (d = a.lastIndexOf(A), 0 > d && (d = 0), e = 0; d > e; ++e) a.charCodeAt(e) >= 128 && b("not-basic"), p.push(a.charCodeAt(e));
4174 for (h = d > 0 ? d + 1 : 0; q > h;) {
4175 for (j = r, k = 1, l = t; h >= q && b("invalid-input"), m = g(a.charCodeAt(h++)), (m >= t || m > F((s - r) / k)) && b("overflow"), r += m * k, n = x >= l ? u : l >= x + v ? v : l - x, !(n > m); l += t) o = t - n, k > F(s / o) && b("overflow"), k *= o;
4176 c = p.length + 1, x = i(r - j, c, 0 == j), F(r / c) > s - w && b("overflow"), w += F(r / c), r %= c, p.splice(r++, 0, w)
4177 }
4178 return f(p)
4179 }
4180
4181 function k(a) {
4182 var c, d, f, g, j, k, l, m, n, o, p, q, r, w, x, B = [];
4183 for (a = e(a), q = a.length, c = z, d = 0, j = y, k = 0; q > k; ++k) p = a[k], 128 > p && B.push(G(p));
4184 for (f = g = B.length, g && B.push(A); q > f;) {
4185 for (l = s, k = 0; q > k; ++k) p = a[k], p >= c && l > p && (l = p);
4186 for (r = f + 1, l - c > F((s - d) / r) && b("overflow"), d += (l - c) * r, c = l, k = 0; q > k; ++k)
4187 if (p = a[k], c > p && ++d > s && b("overflow"), p == c) {
4188 for (m = d, n = t; o = j >= n ? u : n >= j + v ? v : n - j, !(o > m); n += t) x = m - o, w = t - o, B.push(G(h(o + x % w, 0))), m = F(x / w);
4189 B.push(G(h(m, 0))), j = i(d, r, f == g), d = 0, ++f
4190 }++d, ++c
4191 }
4192 return B.join("")
4193 }
4194
4195 function l(a) {
4196 return d(a, function (a) {
4197 return C.test(a) ? j(a.slice(4).toLowerCase()) : a
4198 })
4199 }
4200
4201 function m(a) {
4202 return d(a, function (a) {
4203 return B.test(a) ? "xn--" + k(a) : a
4204 })
4205 }
4206 var n, o, p = "function" == typeof define && "object" == typeof define.amd && define.amd && define,
4207 q = "object" == typeof exports && exports,
4208 r = "object" == typeof module && module,
4209 s = 2147483647,
4210 t = 36,
4211 u = 1,
4212 v = 26,
4213 w = 38,
4214 x = 700,
4215 y = 72,
4216 z = 128,
4217 A = "-",
4218 B = /[^ -~]/,
4219 C = /^xn--/,
4220 D = {
4221 overflow: "Overflow: input needs wider integers to process.",
4222 "not-basic": "Illegal input >= 0x80 (not a basic code point)",
4223 "invalid-input": "Invalid input"
4224 },
4225 E = t - u,
4226 F = Math.floor,
4227 G = String.fromCharCode;
4228 if (n = {
4229 version: "1.1.1",
4230 ucs2: {
4231 decode: e,
4232 encode: f
4233 },
4234 decode: j,
4235 encode: k,
4236 toASCII: m,
4237 toUnicode: l
4238 }, q)
4239 if (r && r.exports == q) r.exports = n;
4240 else
4241 for (o in n) n.hasOwnProperty(o) && (q[o] = n[o]);
4242 else p ? define("punycode", n) : a.punycode = n
4243 }(this),
4244 function (a, b) {
4245 "object" == typeof exports ? module.exports = b() : "function" == typeof define && define.amd ? define("IPv6", b) : a.IPv6 = b()
4246 }(this, function () {
4247 "use strict";
4248
4249 function a(a) {
4250 var b = a.toLowerCase(),
4251 c = b.split(":"),
4252 d = c.length,
4253 e = 8;
4254 "" === c[0] && "" === c[1] && "" === c[2] ? (c.shift(), c.shift()) : "" === c[0] && "" === c[1] ? c.shift() : "" === c[d - 1] && "" === c[d - 2] && c.pop(), d = c.length, -1 !== c[d - 1].indexOf(".") && (e = 7);
4255 var f;
4256 for (f = 0; d > f && "" !== c[f]; f++);
4257 if (e > f) {
4258 for (c.splice(f, 1, "0000"); c.length < e;) c.splice(f, 0, "0000");
4259 d = c.length
4260 }
4261 for (var g, h = 0; e > h; h++) {
4262 g = c[h].split("");
4263 for (var i = 0; 3 > i && ("0" === g[0] && g.length > 1); i++) g.splice(0, 1);
4264 c[h] = g.join("")
4265 }
4266 var j = -1,
4267 k = 0,
4268 l = 0,
4269 m = -1,
4270 n = !1;
4271 for (h = 0; e > h; h++) n ? "0" === c[h] ? l += 1 : (n = !1, l > k && (j = m, k = l)) : "0" == c[h] && (n = !0, m = h, l = 1);
4272 l > k && (j = m, k = l), k > 1 && c.splice(j, k, ""), d = c.length;
4273 var o = "";
4274 for ("" === c[0] && (beststr = ":"), h = 0; d > h && (o += c[h], h !== d - 1); h++) o += ":";
4275 return "" === c[d - 1] && (o += ":"), o
4276 }
4277 return {
4278 best: a
4279 }
4280 }),
4281 function (a, b) {
4282 "object" == typeof exports ? module.exports = b() : "function" == typeof define && define.amd ? define("SecondLevelDomains", b) : a.SecondLevelDomains = b()
4283 }(this, function () {
4284 "use strict";
4285 var a = Object.prototype.hasOwnProperty,
4286 b = {
4287 list: {
4288 ac: "com|gov|mil|net|org",
4289 ae: "ac|co|gov|mil|name|net|org|pro|sch",
4290 af: "com|edu|gov|net|org",
4291 al: "com|edu|gov|mil|net|org",
4292 ao: "co|ed|gv|it|og|pb",
4293 ar: "com|edu|gob|gov|int|mil|net|org|tur",
4294 at: "ac|co|gv|or",
4295 au: "asn|com|csiro|edu|gov|id|net|org",
4296 ba: "co|com|edu|gov|mil|net|org|rs|unbi|unmo|unsa|untz|unze",
4297 bb: "biz|co|com|edu|gov|info|net|org|store|tv",
4298 bh: "biz|cc|com|edu|gov|info|net|org",
4299 bn: "com|edu|gov|net|org",
4300 bo: "com|edu|gob|gov|int|mil|net|org|tv",
4301 br: "adm|adv|agr|am|arq|art|ato|b|bio|blog|bmd|cim|cng|cnt|com|coop|ecn|edu|eng|esp|etc|eti|far|flog|fm|fnd|fot|fst|g12|ggf|gov|imb|ind|inf|jor|jus|lel|mat|med|mil|mus|net|nom|not|ntr|odo|org|ppg|pro|psc|psi|qsl|rec|slg|srv|tmp|trd|tur|tv|vet|vlog|wiki|zlg",
4302 bs: "com|edu|gov|net|org",
4303 bz: "du|et|om|ov|rg",
4304 ca: "ab|bc|mb|nb|nf|nl|ns|nt|nu|on|pe|qc|sk|yk",
4305 ck: "biz|co|edu|gen|gov|info|net|org",
4306 cn: "ac|ah|bj|com|cq|edu|fj|gd|gov|gs|gx|gz|ha|hb|he|hi|hl|hn|jl|js|jx|ln|mil|net|nm|nx|org|qh|sc|sd|sh|sn|sx|tj|tw|xj|xz|yn|zj",
4307 co: "com|edu|gov|mil|net|nom|org",
4308 cr: "ac|c|co|ed|fi|go|or|sa",
4309 cy: "ac|biz|com|ekloges|gov|ltd|name|net|org|parliament|press|pro|tm",
4310 "do": "art|com|edu|gob|gov|mil|net|org|sld|web",
4311 dz: "art|asso|com|edu|gov|net|org|pol",
4312 ec: "com|edu|fin|gov|info|med|mil|net|org|pro",
4313 eg: "com|edu|eun|gov|mil|name|net|org|sci",
4314 er: "com|edu|gov|ind|mil|net|org|rochest|w",
4315 es: "com|edu|gob|nom|org",
4316 et: "biz|com|edu|gov|info|name|net|org",
4317 fj: "ac|biz|com|info|mil|name|net|org|pro",
4318 fk: "ac|co|gov|net|nom|org",
4319 fr: "asso|com|f|gouv|nom|prd|presse|tm",
4320 gg: "co|net|org",
4321 gh: "com|edu|gov|mil|org",
4322 gn: "ac|com|gov|net|org",
4323 gr: "com|edu|gov|mil|net|org",
4324 gt: "com|edu|gob|ind|mil|net|org",
4325 gu: "com|edu|gov|net|org",
4326 hk: "com|edu|gov|idv|net|org",
4327 id: "ac|co|go|mil|net|or|sch|web",
4328 il: "ac|co|gov|idf|k12|muni|net|org",
4329 "in": "ac|co|edu|ernet|firm|gen|gov|i|ind|mil|net|nic|org|res",
4330 iq: "com|edu|gov|i|mil|net|org",
4331 ir: "ac|co|dnssec|gov|i|id|net|org|sch",
4332 it: "edu|gov",
4333 je: "co|net|org",
4334 jo: "com|edu|gov|mil|name|net|org|sch",
4335 jp: "ac|ad|co|ed|go|gr|lg|ne|or",
4336 ke: "ac|co|go|info|me|mobi|ne|or|sc",
4337 kh: "com|edu|gov|mil|net|org|per",
4338 ki: "biz|com|de|edu|gov|info|mob|net|org|tel",
4339 km: "asso|com|coop|edu|gouv|k|medecin|mil|nom|notaires|pharmaciens|presse|tm|veterinaire",
4340 kn: "edu|gov|net|org",
4341 kr: "ac|busan|chungbuk|chungnam|co|daegu|daejeon|es|gangwon|go|gwangju|gyeongbuk|gyeonggi|gyeongnam|hs|incheon|jeju|jeonbuk|jeonnam|k|kg|mil|ms|ne|or|pe|re|sc|seoul|ulsan",
4342 kw: "com|edu|gov|net|org",
4343 ky: "com|edu|gov|net|org",
4344 kz: "com|edu|gov|mil|net|org",
4345 lb: "com|edu|gov|net|org",
4346 lk: "assn|com|edu|gov|grp|hotel|int|ltd|net|ngo|org|sch|soc|web",
4347 lr: "com|edu|gov|net|org",
4348 lv: "asn|com|conf|edu|gov|id|mil|net|org",
4349 ly: "com|edu|gov|id|med|net|org|plc|sch",
4350 ma: "ac|co|gov|m|net|org|press",
4351 mc: "asso|tm",
4352 me: "ac|co|edu|gov|its|net|org|priv",
4353 mg: "com|edu|gov|mil|nom|org|prd|tm",
4354 mk: "com|edu|gov|inf|name|net|org|pro",
4355 ml: "com|edu|gov|net|org|presse",
4356 mn: "edu|gov|org",
4357 mo: "com|edu|gov|net|org",
4358 mt: "com|edu|gov|net|org",
4359 mv: "aero|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro",
4360 mw: "ac|co|com|coop|edu|gov|int|museum|net|org",
4361 mx: "com|edu|gob|net|org",
4362 my: "com|edu|gov|mil|name|net|org|sch",
4363 nf: "arts|com|firm|info|net|other|per|rec|store|web",
4364 ng: "biz|com|edu|gov|mil|mobi|name|net|org|sch",
4365 ni: "ac|co|com|edu|gob|mil|net|nom|org",
4366 np: "com|edu|gov|mil|net|org",
4367 nr: "biz|com|edu|gov|info|net|org",
4368 om: "ac|biz|co|com|edu|gov|med|mil|museum|net|org|pro|sch",
4369 pe: "com|edu|gob|mil|net|nom|org|sld",
4370 ph: "com|edu|gov|i|mil|net|ngo|org",
4371 pk: "biz|com|edu|fam|gob|gok|gon|gop|gos|gov|net|org|web",
4372 pl: "art|bialystok|biz|com|edu|gda|gdansk|gorzow|gov|info|katowice|krakow|lodz|lublin|mil|net|ngo|olsztyn|org|poznan|pwr|radom|slupsk|szczecin|torun|warszawa|waw|wroc|wroclaw|zgora",
4373 pr: "ac|biz|com|edu|est|gov|info|isla|name|net|org|pro|prof",
4374 ps: "com|edu|gov|net|org|plo|sec",
4375 pw: "belau|co|ed|go|ne|or",
4376 ro: "arts|com|firm|info|nom|nt|org|rec|store|tm|www",
4377 rs: "ac|co|edu|gov|in|org",
4378 sb: "com|edu|gov|net|org",
4379 sc: "com|edu|gov|net|org",
4380 sh: "co|com|edu|gov|net|nom|org",
4381 sl: "com|edu|gov|net|org",
4382 st: "co|com|consulado|edu|embaixada|gov|mil|net|org|principe|saotome|store",
4383 sv: "com|edu|gob|org|red",
4384 sz: "ac|co|org",
4385 tr: "av|bbs|bel|biz|com|dr|edu|gen|gov|info|k12|name|net|org|pol|tel|tsk|tv|web",
4386 tt: "aero|biz|cat|co|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel",
4387 tw: "club|com|ebiz|edu|game|gov|idv|mil|net|org",
4388 mu: "ac|co|com|gov|net|or|org",
4389 mz: "ac|co|edu|gov|org",
4390 na: "co|com",
4391 nz: "ac|co|cri|geek|gen|govt|health|iwi|maori|mil|net|org|parliament|school",
4392 pa: "abo|ac|com|edu|gob|ing|med|net|nom|org|sld",
4393 pt: "com|edu|gov|int|net|nome|org|publ",
4394 py: "com|edu|gov|mil|net|org",
4395 qa: "com|edu|gov|mil|net|org",
4396 re: "asso|com|nom",
4397 ru: "ac|adygeya|altai|amur|arkhangelsk|astrakhan|bashkiria|belgorod|bir|bryansk|buryatia|cbg|chel|chelyabinsk|chita|chukotka|chuvashia|com|dagestan|e-burg|edu|gov|grozny|int|irkutsk|ivanovo|izhevsk|jar|joshkar-ola|kalmykia|kaluga|kamchatka|karelia|kazan|kchr|kemerovo|khabarovsk|khakassia|khv|kirov|koenig|komi|kostroma|kranoyarsk|kuban|kurgan|kursk|lipetsk|magadan|mari|mari-el|marine|mil|mordovia|mosreg|msk|murmansk|nalchik|net|nnov|nov|novosibirsk|nsk|omsk|orenburg|org|oryol|penza|perm|pp|pskov|ptz|rnd|ryazan|sakhalin|samara|saratov|simbirsk|smolensk|spb|stavropol|stv|surgut|tambov|tatarstan|tom|tomsk|tsaritsyn|tsk|tula|tuva|tver|tyumen|udm|udmurtia|ulan-ude|vladikavkaz|vladimir|vladivostok|volgograd|vologda|voronezh|vrn|vyatka|yakutia|yamal|yekaterinburg|yuzhno-sakhalinsk",
4398 rw: "ac|co|com|edu|gouv|gov|int|mil|net",
4399 sa: "com|edu|gov|med|net|org|pub|sch",
4400 sd: "com|edu|gov|info|med|net|org|tv",
4401 se: "a|ac|b|bd|c|d|e|f|g|h|i|k|l|m|n|o|org|p|parti|pp|press|r|s|t|tm|u|w|x|y|z",
4402 sg: "com|edu|gov|idn|net|org|per",
4403 sn: "art|com|edu|gouv|org|perso|univ",
4404 sy: "com|edu|gov|mil|net|news|org",
4405 th: "ac|co|go|in|mi|net|or",
4406 tj: "ac|biz|co|com|edu|go|gov|info|int|mil|name|net|nic|org|test|web",
4407 tn: "agrinet|com|defense|edunet|ens|fin|gov|ind|info|intl|mincom|nat|net|org|perso|rnrt|rns|rnu|tourism",
4408 tz: "ac|co|go|ne|or",
4409 ua: "biz|cherkassy|chernigov|chernovtsy|ck|cn|co|com|crimea|cv|dn|dnepropetrovsk|donetsk|dp|edu|gov|if|in|ivano-frankivsk|kh|kharkov|kherson|khmelnitskiy|kiev|kirovograd|km|kr|ks|kv|lg|lugansk|lutsk|lviv|me|mk|net|nikolaev|od|odessa|org|pl|poltava|pp|rovno|rv|sebastopol|sumy|te|ternopil|uzhgorod|vinnica|vn|zaporizhzhe|zhitomir|zp|zt",
4410 ug: "ac|co|go|ne|or|org|sc",
4411 uk: "ac|bl|british-library|co|cym|gov|govt|icnet|jet|lea|ltd|me|mil|mod|national-library-scotland|nel|net|nhs|nic|nls|org|orgn|parliament|plc|police|sch|scot|soc",
4412 us: "dni|fed|isa|kids|nsn",
4413 uy: "com|edu|gub|mil|net|org",
4414 ve: "co|com|edu|gob|info|mil|net|org|web",
4415 vi: "co|com|k12|net|org",
4416 vn: "ac|biz|com|edu|gov|health|info|int|name|net|org|pro",
4417 ye: "co|com|gov|ltd|me|net|org|plc",
4418 yu: "ac|co|edu|gov|org",
4419 za: "ac|agric|alt|bourse|city|co|cybernet|db|edu|gov|grondar|iaccess|imt|inca|landesign|law|mil|net|ngo|nis|nom|olivetti|org|pix|school|tm|web",
4420 zm: "ac|co|com|edu|gov|net|org|sch"
4421 },
4422 has_expression: null,
4423 is_expression: null,
4424 has: function (a) {
4425 return !!a.match(b.has_expression)
4426 },
4427 is: function (a) {
4428 return !!a.match(b.is_expression)
4429 },
4430 get: function (a) {
4431 var c = a.match(b.has_expression);
4432 return c && c[1] || null
4433 },
4434 init: function () {
4435 var c = "";
4436 for (var d in b.list)
4437 if (a.call(b.list, d)) {
4438 var e = "(" + b.list[d] + ")." + d;
4439 c += "|(" + e + ")"
4440 }
4441 b.has_expression = new RegExp("\\.(" + c.substr(1) + ")$", "i"), b.is_expression = new RegExp("^(" + c.substr(1) + ")$", "i")
4442 }
4443 };
4444 return b.init(), b
4445 }),
4446 function (a, b) {
4447 "object" == typeof exports ? module.exports = b(require("./punycode"), require("./IPv6"), require("./SecondLevelDomains")) : "function" == typeof define && define.amd ? define("URI", ["./punycode", "./IPv6", "./SecondLevelDomains"], b) : a.URI = b(a.punycode, a.IPv6, a.SecondLevelDomains)
4448 }(this, function (a, b, c) {
4449 "use strict";
4450
4451 function d(a, b) {
4452 return this instanceof d ? (void 0 === a && (a = "undefined" != typeof location ? location.href + "" : ""), this.href(a), void 0 !== b ? this.absoluteTo(b) : this) : new d(a, b)
4453 }
4454
4455 function e(a) {
4456 return a.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1")
4457 }
4458
4459 function f(a) {
4460 return String(Object.prototype.toString.call(a)).slice(8, -1)
4461 }
4462
4463 function g(a) {
4464 return "Array" === f(a)
4465 }
4466
4467 function h(a, b) {
4468 var c, d, e = {};
4469 if (g(b))
4470 for (c = 0, d = b.length; d > c; c++) e[b[c]] = !0;
4471 else e[b] = !0;
4472 for (c = 0, d = a.length; d > c; c++) void 0 !== e[a[c]] && (a.splice(c, 1), d--, c--);
4473 return a
4474 }
4475
4476 function i(a, b) {
4477 var c, d;
4478 if (g(b)) {
4479 for (c = 0, d = b.length; d > c; c++)
4480 if (!i(a, b[c])) return !1;
4481 return !0
4482 }
4483 var e = f(b);
4484 for (c = 0, d = a.length; d > c; c++)
4485 if ("RegExp" === e) {
4486 if ("string" == typeof a[c] && a[c].match(b)) return !0
4487 } else if (a[c] === b) return !0;
4488 return !1
4489 }
4490
4491 function j(a, b) {
4492 if (!g(a) || !g(b)) return !1;
4493 if (a.length !== b.length) return !1;
4494 a.sort(), b.sort();
4495 for (var c = 0, d = a.length; d > c; c++)
4496 if (a[c] !== b[c]) return !1;
4497 return !0
4498 }
4499
4500 function k(a) {
4501 return encodeURIComponent(a).replace(/[!'()*]/g, escape).replace(/\*/g, "%2A")
4502 }
4503 var l = d.prototype,
4504 m = Object.prototype.hasOwnProperty;
4505 d._parts = function () {
4506 return {
4507 protocol: null,
4508 username: null,
4509 password: null,
4510 hostname: null,
4511 urn: null,
4512 port: null,
4513 path: null,
4514 query: null,
4515 fragment: null,
4516 duplicateQueryParameters: d.duplicateQueryParameters
4517 }
4518 }, d.duplicateQueryParameters = !1, d.protocol_expression = /^[a-z][a-z0-9-+-]*$/i, d.idn_expression = /[^a-z0-9\.-]/i, d.punycode_expression = /(xn--)/i, d.ip4_expression = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, d.ip6_expression = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/, d.find_uri_expression = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi, d.defaultPorts = {
4519 http: "80",
4520 https: "443",
4521 ftp: "21",
4522 gopher: "70",
4523 ws: "80",
4524 wss: "443"
4525 }, d.invalid_hostname_characters = /[^a-zA-Z0-9\.-]/, d.encode = k, d.decode = decodeURIComponent, d.iso8859 = function () {
4526 d.encode = escape, d.decode = unescape
4527 }, d.unicode = function () {
4528 d.encode = k, d.decode = decodeURIComponent
4529 }, d.characters = {
4530 pathname: {
4531 encode: {
4532 expression: /%(24|26|2B|2C|3B|3D|3A|40)/gi,
4533 map: {
4534 "%24": "$",
4535 "%26": "&",
4536 "%2B": "+",
4537 "%2C": ",",
4538 "%3B": ";",
4539 "%3D": "=",
4540 "%3A": ":",
4541 "%40": "@"
4542 }
4543 },
4544 decode: {
4545 expression: /[\/\?#]/g,
4546 map: {
4547 "/": "%2F",
4548 "?": "%3F",
4549 "#": "%23"
4550 }
4551 }
4552 },
4553 reserved: {
4554 encode: {
4555 expression: /%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,
4556 map: {
4557 "%3A": ":",
4558 "%2F": "/",
4559 "%3F": "?",
4560 "%23": "#",
4561 "%5B": "[",
4562 "%5D": "]",
4563 "%40": "@",
4564 "%21": "!",
4565 "%24": "$",
4566 "%26": "&",
4567 "%27": "'",
4568 "%28": "(",
4569 "%29": ")",
4570 "%2A": "*",
4571 "%2B": "+",
4572 "%2C": ",",
4573 "%3B": ";",
4574 "%3D": "="
4575 }
4576 }
4577 }
4578 }, d.encodeQuery = function (a) {
4579 return d.encode(a + "").replace(/%20/g, "+")
4580 }, d.decodeQuery = function (a) {
4581 return d.decode((a + "").replace(/\+/g, "%20"))
4582 }, d.recodePath = function (a) {
4583 for (var b = (a + "").split("/"), c = 0, e = b.length; e > c; c++) b[c] = d.encodePathSegment(d.decode(b[c]));
4584 return b.join("/")
4585 }, d.decodePath = function (a) {
4586 for (var b = (a + "").split("/"), c = 0, e = b.length; e > c; c++) b[c] = d.decodePathSegment(b[c]);
4587 return b.join("/")
4588 };
4589 var n, o = {
4590 encode: "encode",
4591 decode: "decode"
4592 },
4593 p = function (a, b) {
4594 return function (c) {
4595 return d[b](c + "").replace(d.characters[a][b].expression, function (c) {
4596 return d.characters[a][b].map[c]
4597 })
4598 }
4599 };
4600 for (n in o) d[n + "PathSegment"] = p("pathname", o[n]);
4601 d.encodeReserved = p("reserved", "encode"), d.parse = function (a, b) {
4602 var c;
4603 return b || (b = {}), c = a.indexOf("#"), c > -1 && (b.fragment = a.substring(c + 1) || null, a = a.substring(0, c)), c = a.indexOf("?"), c > -1 && (b.query = a.substring(c + 1) || null, a = a.substring(0, c)), "//" === a.substring(0, 2) ? (b.protocol = "", a = a.substring(2), a = d.parseAuthority(a, b)) : (c = a.indexOf(":"), c > -1 && (b.protocol = a.substring(0, c), b.protocol && !b.protocol.match(d.protocol_expression) ? b.protocol = void 0 : "file" === b.protocol ? a = a.substring(c + 3) : "//" === a.substring(c + 1, c + 3) ? (a = a.substring(c + 3), a = d.parseAuthority(a, b)) : (a = a.substring(c + 1), b.urn = !0))), b.path = a, b
4604 }, d.parseHost = function (a, b) {
4605 var c, d, e = a.indexOf("/");
4606 return -1 === e && (e = a.length), "[" === a.charAt(0) ? (c = a.indexOf("]"), b.hostname = a.substring(1, c) || null, b.port = a.substring(c + 2, e) || null) : a.indexOf(":") !== a.lastIndexOf(":") ? (b.hostname = a.substring(0, e) || null, b.port = null) : (d = a.substring(0, e).split(":"), b.hostname = d[0] || null, b.port = d[1] || null), b.hostname && "/" !== a.substring(e).charAt(0) && (e++, a = "/" + a), a.substring(e) || "/"
4607 }, d.parseAuthority = function (a, b) {
4608 return a = d.parseUserinfo(a, b), d.parseHost(a, b)
4609 }, d.parseUserinfo = function (a, b) {
4610 var c, e = a.indexOf("@"),
4611 f = a.indexOf("/");
4612 return e > -1 && (-1 === f || f > e) ? (c = a.substring(0, e).split(":"), b.username = c[0] ? d.decode(c[0]) : null, c.shift(), b.password = c[0] ? d.decode(c.join(":")) : null, a = a.substring(e + 1)) : (b.username = null, b.password = null), a
4613 }, d.parseQuery = function (a) {
4614 if (!a) return {};
4615 if (a = a.replace(/&+/g, "&").replace(/^\?*&*|&+$/g, ""), !a) return {};
4616 for (var b, c, e, f = {}, g = a.split("&"), h = g.length, i = 0; h > i; i++) b = g[i].split("="), c = d.decodeQuery(b.shift()), e = b.length ? d.decodeQuery(b.join("=")) : null, f[c] ? ("string" == typeof f[c] && (f[c] = [f[c]]),
4617 f[c].push(e)) : f[c] = e;
4618 return f
4619 }, d.build = function (a) {
4620 var b = "";
4621 return a.protocol && (b += a.protocol + ":"), a.urn || !b && !a.hostname || (b += "//"), b += d.buildAuthority(a) || "", "string" == typeof a.path && ("/" !== a.path.charAt(0) && "string" == typeof a.hostname && (b += "/"), b += a.path), "string" == typeof a.query && a.query && (b += "?" + a.query), "string" == typeof a.fragment && a.fragment && (b += "#" + a.fragment), b
4622 }, d.buildHost = function (a) {
4623 var b = "";
4624 return a.hostname ? (d.ip6_expression.test(a.hostname) ? b += a.port ? "[" + a.hostname + "]:" + a.port : a.hostname : (b += a.hostname, a.port && (b += ":" + a.port)), b) : ""
4625 }, d.buildAuthority = function (a) {
4626 return d.buildUserinfo(a) + d.buildHost(a)
4627 }, d.buildUserinfo = function (a) {
4628 var b = "";
4629 return a.username && (b += d.encode(a.username), a.password && (b += ":" + d.encode(a.password)), b += "@"), b
4630 }, d.buildQuery = function (a, b) {
4631 var c, e, f, h, i = "";
4632 for (e in a)
4633 if (m.call(a, e) && e)
4634 if (g(a[e]))
4635 for (c = {}, f = 0, h = a[e].length; h > f; f++) void 0 !== a[e][f] && void 0 === c[a[e][f] + ""] && (i += "&" + d.buildQueryParameter(e, a[e][f]), b !== !0 && (c[a[e][f] + ""] = !0));
4636 else void 0 !== a[e] && (i += "&" + d.buildQueryParameter(e, a[e]));
4637 return i.substring(1)
4638 }, d.buildQueryParameter = function (a, b) {
4639 return d.encodeQuery(a) + (null !== b ? "=" + d.encodeQuery(b) : "")
4640 }, d.addQuery = function (a, b, c) {
4641 if ("object" == typeof b)
4642 for (var e in b) m.call(b, e) && d.addQuery(a, e, b[e]);
4643 else {
4644 if ("string" != typeof b) throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");
4645 if (void 0 === a[b]) return void(a[b] = c);
4646 "string" == typeof a[b] && (a[b] = [a[b]]), g(c) || (c = [c]), a[b] = a[b].concat(c)
4647 }
4648 }, d.removeQuery = function (a, b, c) {
4649 var e, f, i;
4650 if (g(b))
4651 for (e = 0, f = b.length; f > e; e++) a[b[e]] = void 0;
4652 else if ("object" == typeof b)
4653 for (i in b) m.call(b, i) && d.removeQuery(a, i, b[i]);
4654 else {
4655 if ("string" != typeof b) throw new TypeError("URI.addQuery() accepts an object, string as the first parameter");
4656 void 0 !== c ? a[b] === c ? a[b] = void 0 : g(a[b]) && (a[b] = h(a[b], c)) : a[b] = void 0
4657 }
4658 }, d.hasQuery = function (a, b, c, e) {
4659 if ("object" == typeof b) {
4660 for (var h in b)
4661 if (m.call(b, h) && !d.hasQuery(a, h, b[h])) return !1;
4662 return !0
4663 }
4664 if ("string" != typeof b) throw new TypeError("URI.hasQuery() accepts an object, string as the name parameter");
4665 switch (f(c)) {
4666 case "Undefined":
4667 return b in a;
4668 case "Boolean":
4669 var k = Boolean(g(a[b]) ? a[b].length : a[b]);
4670 return c === k;
4671 case "Function":
4672 return !!c(a[b], b, a);
4673 case "Array":
4674 if (!g(a[b])) return !1;
4675 var l = e ? i : j;
4676 return l(a[b], c);
4677 case "RegExp":
4678 return g(a[b]) ? e ? i(a[b], c) : !1 : Boolean(a[b] && a[b].match(c));
4679 case "Number":
4680 c = String(c);
4681 case "String":
4682 return g(a[b]) ? e ? i(a[b], c) : !1 : a[b] === c;
4683 default:
4684 throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")
4685 }
4686 }, d.commonPath = function (a, b) {
4687 var c, d = Math.min(a.length, b.length);
4688 for (c = 0; d > c; c++)
4689 if (a.charAt(c) !== b.charAt(c)) {
4690 c--;
4691 break
4692 }
4693 return 1 > c ? a.charAt(0) === b.charAt(0) && "/" === a.charAt(0) ? "/" : "" : (("/" !== a.charAt(c) || "/" !== b.charAt(c)) && (c = a.substring(0, c).lastIndexOf("/")), a.substring(0, c + 1))
4694 }, d.withinString = function (a, b) {
4695 return a.replace(d.find_uri_expression, b)
4696 }, d.ensureValidHostname = function (b) {
4697 if (b.match(d.invalid_hostname_characters)) {
4698 if (!a) throw new TypeError("Hostname '" + b + "' contains characters other than [A-Z0-9.-] and Punycode.js is not available");
4699 if (a.toASCII(b).match(d.invalid_hostname_characters)) throw new TypeError("Hostname '" + b + "' contains characters other than [A-Z0-9.-]")
4700 }
4701 }, l.build = function (a) {
4702 return a === !0 ? this._deferred_build = !0 : (void 0 === a || this._deferred_build) && (this._string = d.build(this._parts), this._deferred_build = !1), this
4703 }, l.clone = function () {
4704 return new d(this)
4705 }, l.valueOf = l.toString = function () {
4706 return this.build(!1)._string
4707 }, o = {
4708 protocol: "protocol",
4709 username: "username",
4710 password: "password",
4711 hostname: "hostname",
4712 port: "port"
4713 }, p = function (a) {
4714 return function (b, c) {
4715 return void 0 === b ? this._parts[a] || "" : (this._parts[a] = b, this.build(!c), this)
4716 }
4717 };
4718 for (n in o) l[n] = p(o[n]);
4719 o = {
4720 query: "?",
4721 fragment: "#"
4722 }, p = function (a, b) {
4723 return function (c, d) {
4724 return void 0 === c ? this._parts[a] || "" : (null !== c && (c += "", c.charAt(0) === b && (c = c.substring(1))), this._parts[a] = c, this.build(!d), this)
4725 }
4726 };
4727 for (n in o) l[n] = p(n, o[n]);
4728 o = {
4729 search: ["?", "query"],
4730 hash: ["#", "fragment"]
4731 }, p = function (a, b) {
4732 return function (c, d) {
4733 var e = this[a](c, d);
4734 return "string" == typeof e && e.length ? b + e : e
4735 }
4736 };
4737 for (n in o) l[n] = p(o[n][1], o[n][0]);
4738 l.pathname = function (a, b) {
4739 if (void 0 === a || a === !0) {
4740 var c = this._parts.path || (this._parts.urn ? "" : "/");
4741 return a ? d.decodePath(c) : c
4742 }
4743 return this._parts.path = a ? d.recodePath(a) : "/", this.build(!b), this
4744 }, l.path = l.pathname, l.href = function (a, b) {
4745 var c;
4746 if (void 0 === a) return this.toString();
4747 this._string = "", this._parts = d._parts();
4748 var e = a instanceof d,
4749 f = "object" == typeof a && (a.hostname || a.path);
4750 if (!e && f && void 0 !== a.pathname && (a = a.toString()), "string" == typeof a) this._parts = d.parse(a, this._parts);
4751 else {
4752 if (!e && !f) throw new TypeError("invalid input");
4753 var g = e ? a._parts : a;
4754 for (c in g) m.call(this._parts, c) && (this._parts[c] = g[c])
4755 }
4756 return this.build(!b), this
4757 }, l.is = function (a) {
4758 var b = !1,
4759 e = !1,
4760 f = !1,
4761 g = !1,
4762 h = !1,
4763 i = !1,
4764 j = !1,
4765 k = !this._parts.urn;
4766 switch (this._parts.hostname && (k = !1, e = d.ip4_expression.test(this._parts.hostname), f = d.ip6_expression.test(this._parts.hostname), b = e || f, g = !b, h = g && c && c.has(this._parts.hostname), i = g && d.idn_expression.test(this._parts.hostname), j = g && d.punycode_expression.test(this._parts.hostname)), a.toLowerCase()) {
4767 case "relative":
4768 return k;
4769 case "absolute":
4770 return !k;
4771 case "domain":
4772 case "name":
4773 return g;
4774 case "sld":
4775 return h;
4776 case "ip":
4777 return b;
4778 case "ip4":
4779 case "ipv4":
4780 case "inet4":
4781 return e;
4782 case "ip6":
4783 case "ipv6":
4784 case "inet6":
4785 return f;
4786 case "idn":
4787 return i;
4788 case "url":
4789 return !this._parts.urn;
4790 case "urn":
4791 return !!this._parts.urn;
4792 case "punycode":
4793 return j
4794 }
4795 return null
4796 };
4797 var q = l.protocol,
4798 r = l.port,
4799 s = l.hostname;
4800 l.protocol = function (a, b) {
4801 if (void 0 !== a && a && (a = a.replace(/:(\/\/)?$/, ""), a.match(/[^a-zA-z0-9\.+-]/))) throw new TypeError("Protocol '" + a + "' contains characters other than [A-Z0-9.+-]");
4802 return q.call(this, a, b)
4803 }, l.scheme = l.protocol, l.port = function (a, b) {
4804 if (this._parts.urn) return void 0 === a ? "" : this;
4805 if (void 0 !== a && (0 === a && (a = null), a && (a += "", ":" === a.charAt(0) && (a = a.substring(1)), a.match(/[^0-9]/)))) throw new TypeError("Port '" + a + "' contains characters other than [0-9]");
4806 return r.call(this, a, b)
4807 }, l.hostname = function (a, b) {
4808 if (this._parts.urn) return void 0 === a ? "" : this;
4809 if (void 0 !== a) {
4810 var c = {};
4811 d.parseHost(a, c), a = c.hostname
4812 }
4813 return s.call(this, a, b)
4814 }, l.host = function (a, b) {
4815 return this._parts.urn ? void 0 === a ? "" : this : void 0 === a ? this._parts.hostname ? d.buildHost(this._parts) : "" : (d.parseHost(a, this._parts), this.build(!b), this)
4816 }, l.authority = function (a, b) {
4817 return this._parts.urn ? void 0 === a ? "" : this : void 0 === a ? this._parts.hostname ? d.buildAuthority(this._parts) : "" : (d.parseAuthority(a, this._parts), this.build(!b), this)
4818 }, l.userinfo = function (a, b) {
4819 if (this._parts.urn) return void 0 === a ? "" : this;
4820 if (void 0 === a) {
4821 if (!this._parts.username) return "";
4822 var c = d.buildUserinfo(this._parts);
4823 return c.substring(0, c.length - 1)
4824 }
4825 return "@" !== a[a.length - 1] && (a += "@"), d.parseUserinfo(a, this._parts), this.build(!b), this
4826 }, l.resource = function (a, b) {
4827 var c;
4828 return void 0 === a ? this.path() + this.search() + this.hash() : (c = d.parse(a), this._parts.path = c.path, this._parts.query = c.query, this._parts.fragment = c.fragment, this.build(!b), this)
4829 }, l.subdomain = function (a, b) {
4830 if (this._parts.urn) return void 0 === a ? "" : this;
4831 if (void 0 === a) {
4832 if (!this._parts.hostname || this.is("IP")) return "";
4833 var c = this._parts.hostname.length - this.domain().length - 1;
4834 return this._parts.hostname.substring(0, c) || ""
4835 }
4836 var f = this._parts.hostname.length - this.domain().length,
4837 g = this._parts.hostname.substring(0, f),
4838 h = new RegExp("^" + e(g));
4839 return a && "." !== a.charAt(a.length - 1) && (a += "."), a && d.ensureValidHostname(a), this._parts.hostname = this._parts.hostname.replace(h, a), this.build(!b), this
4840 }, l.domain = function (a, b) {
4841 if (this._parts.urn) return void 0 === a ? "" : this;
4842 if ("boolean" == typeof a && (b = a, a = void 0), void 0 === a) {
4843 if (!this._parts.hostname || this.is("IP")) return "";
4844 var c = this._parts.hostname.match(/\./g);
4845 if (c && c.length < 2) return this._parts.hostname;
4846 var f = this._parts.hostname.length - this.tld(b).length - 1;
4847 return f = this._parts.hostname.lastIndexOf(".", f - 1) + 1, this._parts.hostname.substring(f) || ""
4848 }
4849 if (!a) throw new TypeError("cannot set domain empty");
4850 if (d.ensureValidHostname(a), !this._parts.hostname || this.is("IP")) this._parts.hostname = a;
4851 else {
4852 var g = new RegExp(e(this.domain()) + "$");
4853 this._parts.hostname = this._parts.hostname.replace(g, a)
4854 }
4855 return this.build(!b), this
4856 }, l.tld = function (a, b) {
4857 if (this._parts.urn) return void 0 === a ? "" : this;
4858 if ("boolean" == typeof a && (b = a, a = void 0), void 0 === a) {
4859 if (!this._parts.hostname || this.is("IP")) return "";
4860 var d = this._parts.hostname.lastIndexOf("."),
4861 f = this._parts.hostname.substring(d + 1);
4862 return b !== !0 && c && c.list[f.toLowerCase()] ? c.get(this._parts.hostname) || f : f
4863 }
4864 var g;
4865 if (!a) throw new TypeError("cannot set TLD empty");
4866 if (a.match(/[^a-zA-Z0-9-]/)) {
4867 if (!c || !c.is(a)) throw new TypeError("TLD '" + a + "' contains characters other than [A-Z0-9]");
4868 g = new RegExp(e(this.tld()) + "$"), this._parts.hostname = this._parts.hostname.replace(g, a)
4869 } else {
4870 if (!this._parts.hostname || this.is("IP")) throw new ReferenceError("cannot set TLD on non-domain host");
4871 g = new RegExp(e(this.tld()) + "$"), this._parts.hostname = this._parts.hostname.replace(g, a)
4872 }
4873 return this.build(!b), this
4874 }, l.directory = function (a, b) {
4875 if (this._parts.urn) return void 0 === a ? "" : this;
4876 if (void 0 === a || a === !0) {
4877 if (!this._parts.path && !this._parts.hostname) return "";
4878 if ("/" === this._parts.path) return "/";
4879 var c = this._parts.path.length - this.filename().length - 1,
4880 f = this._parts.path.substring(0, c) || (this._parts.hostname ? "/" : "");
4881 return a ? d.decodePath(f) : f
4882 }
4883 var g = this._parts.path.length - this.filename().length,
4884 h = this._parts.path.substring(0, g),
4885 i = new RegExp("^" + e(h));
4886 return this.is("relative") || (a || (a = "/"), "/" !== a.charAt(0) && (a = "/" + a)), a && "/" !== a.charAt(a.length - 1) && (a += "/"), a = d.recodePath(a), this._parts.path = this._parts.path.replace(i, a), this.build(!b), this
4887 }, l.filename = function (a, b) {
4888 if (this._parts.urn) return void 0 === a ? "" : this;
4889 if (void 0 === a || a === !0) {
4890 if (!this._parts.path || "/" === this._parts.path) return "";
4891 var c = this._parts.path.lastIndexOf("/"),
4892 f = this._parts.path.substring(c + 1);
4893 return a ? d.decodePathSegment(f) : f
4894 }
4895 var g = !1;
4896 "/" === a.charAt(0) && (a = a.substring(1)), a.match(/\.?\//) && (g = !0);
4897 var h = new RegExp(e(this.filename()) + "$");
4898 return a = d.recodePath(a), this._parts.path = this._parts.path.replace(h, a), g ? this.normalizePath(b) : this.build(!b), this
4899 }, l.suffix = function (a, b) {
4900 if (this._parts.urn) return void 0 === a ? "" : this;
4901 if (void 0 === a || a === !0) {
4902 if (!this._parts.path || "/" === this._parts.path) return "";
4903 var c, f, g = this.filename(),
4904 h = g.lastIndexOf(".");
4905 return -1 === h ? "" : (c = g.substring(h + 1), f = /^[a-z0-9%]+$/i.test(c) ? c : "", a ? d.decodePathSegment(f) : f)
4906 }
4907 "." === a.charAt(0) && (a = a.substring(1));
4908 var i, j = this.suffix();
4909 if (j) i = a ? new RegExp(e(j) + "$") : new RegExp(e("." + j) + "$");
4910 else {
4911 if (!a) return this;
4912 this._parts.path += "." + d.recodePath(a)
4913 }
4914 return i && (a = d.recodePath(a), this._parts.path = this._parts.path.replace(i, a)), this.build(!b), this
4915 }, l.segment = function (a, b, c) {
4916 var d = this._parts.urn ? ":" : "/",
4917 e = this.path(),
4918 f = "/" === e.substring(0, 1),
4919 h = e.split(d);
4920 if ("number" != typeof a && (c = b, b = a, a = void 0), void 0 !== a && "number" != typeof a) throw new Error("Bad segment '" + a + "', must be 0-based integer");
4921 return f && h.shift(), 0 > a && (a = Math.max(h.length + a, 0)), void 0 === b ? void 0 === a ? h : h[a] : (null === a || void 0 === h[a] ? g(b) ? h = b : (b || "string" == typeof b && b.length) && ("" === h[h.length - 1] ? h[h.length - 1] = b : h.push(b)) : b || "string" == typeof b && b.length ? h[a] = b : h.splice(a, 1), f && h.unshift(""), this.path(h.join(d), c))
4922 };
4923 var t = l.query;
4924 return l.query = function (a, b) {
4925 if (a === !0) return d.parseQuery(this._parts.query);
4926 if ("function" == typeof a) {
4927 var c = d.parseQuery(this._parts.query),
4928 e = a.call(this, c);
4929 return this._parts.query = d.buildQuery(e || c, this._parts.duplicateQueryParameters), this.build(!b), this
4930 }
4931 return void 0 !== a && "string" != typeof a ? (this._parts.query = d.buildQuery(a, this._parts.duplicateQueryParameters), this.build(!b), this) : t.call(this, a, b)
4932 }, l.setQuery = function (a, b, c) {
4933 var e = d.parseQuery(this._parts.query);
4934 if ("object" == typeof a)
4935 for (var f in a) m.call(a, f) && (e[f] = a[f]);
4936 else {
4937 if ("string" != typeof a) throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");
4938 e[a] = void 0 !== b ? b : null
4939 }
4940 return this._parts.query = d.buildQuery(e, this._parts.duplicateQueryParameters), "string" != typeof a && (c = b), this.build(!c), this
4941 }, l.addQuery = function (a, b, c) {
4942 var e = d.parseQuery(this._parts.query);
4943 return d.addQuery(e, a, void 0 === b ? null : b), this._parts.query = d.buildQuery(e, this._parts.duplicateQueryParameters), "string" != typeof a && (c = b), this.build(!c), this
4944 }, l.removeQuery = function (a, b, c) {
4945 var e = d.parseQuery(this._parts.query);
4946 return d.removeQuery(e, a, b), this._parts.query = d.buildQuery(e, this._parts.duplicateQueryParameters), "string" != typeof a && (c = b), this.build(!c), this
4947 }, l.hasQuery = function (a, b, c) {
4948 var e = d.parseQuery(this._parts.query);
4949 return d.hasQuery(e, a, b, c)
4950 }, l.setSearch = l.setQuery, l.addSearch = l.addQuery, l.removeSearch = l.removeQuery, l.hasSearch = l.hasQuery, l.normalize = function () {
4951 return this._parts.urn ? this.normalizeProtocol(!1).normalizeQuery(!1).normalizeFragment(!1).build() : this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()
4952 }, l.normalizeProtocol = function (a) {
4953 return "string" == typeof this._parts.protocol && (this._parts.protocol = this._parts.protocol.toLowerCase(), this.build(!a)), this
4954 }, l.normalizeHostname = function (c) {
4955 return this._parts.hostname && (this.is("IDN") && a ? this._parts.hostname = a.toASCII(this._parts.hostname) : this.is("IPv6") && b && (this._parts.hostname = b.best(this._parts.hostname)), this._parts.hostname = this._parts.hostname.toLowerCase(), this.build(!c)), this
4956 }, l.normalizePort = function (a) {
4957 return "string" == typeof this._parts.protocol && this._parts.port === d.defaultPorts[this._parts.protocol] && (this._parts.port = null, this.build(!a)), this
4958 }, l.normalizePath = function (a) {
4959 if (this._parts.urn) return this;
4960 if (!this._parts.path || "/" === this._parts.path) return this;
4961 var b, c, e, f, g = this._parts.path;
4962 for ("/" !== g.charAt(0) && ("." === g.charAt(0) && (c = g.substring(0, g.indexOf("/"))), b = !0, g = "/" + g), g = g.replace(/(\/(\.\/)+)|\/{2,}/g, "/");;) {
4963 if (e = g.indexOf("/../"), -1 === e) break;
4964 if (0 === e) {
4965 g = g.substring(3);
4966 break
4967 }
4968 f = g.substring(0, e).lastIndexOf("/"), -1 === f && (f = e), g = g.substring(0, f) + g.substring(e + 3)
4969 }
4970 return b && this.is("relative") && (g = g.substring(1)), g = d.recodePath(g), this._parts.path = g, this.build(!a), this
4971 }, l.normalizePathname = l.normalizePath, l.normalizeQuery = function (a) {
4972 return "string" == typeof this._parts.query && (this._parts.query.length ? this.query(d.parseQuery(this._parts.query)) : this._parts.query = null, this.build(!a)), this
4973 }, l.normalizeFragment = function (a) {
4974 return this._parts.fragment || (this._parts.fragment = null, this.build(!a)), this
4975 }, l.normalizeSearch = l.normalizeQuery, l.normalizeHash = l.normalizeFragment, l.iso8859 = function () {
4976 var a = d.encode,
4977 b = d.decode;
4978 return d.encode = escape, d.decode = decodeURIComponent, this.normalize(), d.encode = a, d.decode = b, this
4979 }, l.unicode = function () {
4980 var a = d.encode,
4981 b = d.decode;
4982 return d.encode = k, d.decode = unescape, this.normalize(), d.encode = a, d.decode = b, this
4983 }, l.readable = function () {
4984 var b = this.clone();
4985 b.username("").password("").normalize();
4986 var c = "";
4987 if (b._parts.protocol && (c += b._parts.protocol + "://"), b._parts.hostname && (b.is("punycode") && a ? (c += a.toUnicode(b._parts.hostname), b._parts.port && (c += ":" + b._parts.port)) : c += b.host()), b._parts.hostname && b._parts.path && "/" !== b._parts.path.charAt(0) && (c += "/"), c += b.path(!0), b._parts.query) {
4988 for (var e = "", f = 0, g = b._parts.query.split("&"), h = g.length; h > f; f++) {
4989 var i = (g[f] || "").split("=");
4990 e += "&" + d.decodeQuery(i[0]).replace(/&/g, "%26"), void 0 !== i[1] && (e += "=" + d.decodeQuery(i[1]).replace(/&/g, "%26"))
4991 }
4992 c += "?" + e.substring(1)
4993 }
4994 return c += b.hash()
4995 }, l.absoluteTo = function (a) {
4996 var b, c, e, f = this.clone(),
4997 g = ["protocol", "username", "password", "hostname", "port"];
4998 if (this._parts.urn) throw new Error("URNs do not have any generally defined hierachical components");
4999 if (a instanceof d || (a = new d(a)), f._parts.protocol || (f._parts.protocol = a._parts.protocol), this._parts.hostname) return f;
5000 for (c = 0, e; e = g[c]; c++) f._parts[e] = a._parts[e];
5001 for (g = ["query", "path"], c = 0, e; e = g[c]; c++) !f._parts[e] && a._parts[e] && (f._parts[e] = a._parts[e]);
5002 return "/" !== f.path().charAt(0) && (b = a.directory(), f._parts.path = (b ? b + "/" : "") + f._parts.path, f.normalizePath()), f.build(), f
5003 }, l.relativeTo = function (a) {
5004 var b, c, f, g, h, i = this.clone(),
5005 j = ["protocol", "username", "password", "hostname", "port"];
5006 if (i._parts.urn) throw new Error("URNs do not have any generally defined hierachical components");
5007 if (a instanceof d || (a = new d(a)), "/" !== i.path().charAt(0) || "/" !== a.path().charAt(0)) throw new Error("Cannot calculate common path from non-relative URLs");
5008 b = d.commonPath(i.path(), a.path());
5009 for (var k, l = 0; k = j[l]; l++) i._parts[k] = null;
5010 if ("/" === b) return i;
5011 if (!b) return this.clone();
5012 if (c = a.directory(), f = i.directory(), c === f) return i._parts.path = i.filename(), i.build();
5013 if (g = c.substring(b.length), h = f.substring(b.length), c + "/" === b) return h && (h += "/"), i._parts.path = h + i.filename(), i.build();
5014 for (var m = "../", n = new RegExp("^" + e(b)), o = c.replace(n, "/").match(/\//g).length - 1; o--;) m += "../";
5015 return i._parts.path = i._parts.path.replace(n, m), i.build()
5016 }, l.equals = function (a) {
5017 var b, c, e, f = this.clone(),
5018 h = new d(a),
5019 i = {},
5020 k = {},
5021 l = {};
5022 if (f.normalize(), h.normalize(), f.toString() === h.toString()) return !0;
5023 if (b = f.query(), c = h.query(), f.query(""), h.query(""), f.toString() !== h.toString()) return !1;
5024 if (b.length !== c.length) return !1;
5025 i = d.parseQuery(b), k = d.parseQuery(c);
5026 for (e in i)
5027 if (m.call(i, e)) {
5028 if (g(i[e])) {
5029 if (!j(i[e], k[e])) return !1
5030 } else if (i[e] !== k[e]) return !1;
5031 l[e] = !0
5032 }
5033 for (e in k)
5034 if (m.call(k, e) && !l[e]) return !1;
5035 return !0
5036 }, l.duplicateQueryParameters = function (a) {
5037 return this._parts.duplicateQueryParameters = !!a, this
5038 }, d
5039 }),
5040 function (a, b) {
5041 "function" == typeof define && define.amd ? define("marked", [], b) : "object" == typeof exports ? module.exports = b() : a.Marked = b()
5042 }(this, function () {
5043 var a = function () {
5044 return "undefined" != typeof Riot && "undefined" != typeof Riot.DDragon && Riot.DDragon.hasOwnProperty("useModel")
5045 },
5046 b = {
5047 userFlavoredMarkdown: !0,
5048 adminFlavoredMarkdown: !1,
5049 tables: !0,
5050 breaks: !0,
5051 pedantic: !1,
5052 sanitize: !0,
5053 smartLists: !1,
5054 silent: !1,
5055 highlight: null,
5056 langPrefix: "lang-"
5057 };
5058 a() && Riot.DDragon.addApp(["champion", "summoner", "item"], function () {});
5059 var c = function (a) {
5060 var b = "https://cdn.leagueoflegends.com/stickers/";
5061 switch (a) {
5062 case "slayer-jinx-catface":
5063 case "slayer-jinx-unamused":
5064 case "slayer-jinx-wink":
5065 case "slayer-pantheon-popcorn":
5066 case "slayer-pantheon-rainbows":
5067 case "slayer-pantheon-thumbs":
5068 case "zombie-brand-clap":
5069 case "zombie-brand-facepalm":
5070 case "zombie-brand-mindblown":
5071 case "zombie-nunu-bummed":
5072 case "zombie-nunu-hearts":
5073 case "zombie-nunu-tears":
5074 case "cass-cry":
5075 case "darius-angry":
5076 case "draven-pose":
5077 case "fiora-cool":
5078 case "galio-happy":
5079 case "garen-swing":
5080 case "katarina-love":
5081 case "leblanc-funny":
5082 case "poppy-wink":
5083 case "sona-playing":
5084 case "vayne-pose":
5085 case "vlad-salute":
5086 var c = b + "slayer140/" + a + ".png";
5087 return "background-image: url(" + c + ");";
5088 case "sg-ahri-1":
5089 case "sg-ahri-2":
5090 case "sg-ahri-3":
5091 case "sg-ezreal":
5092 case "sg-janna":
5093 case "sg-jinx":
5094 case "sg-kiko":
5095 case "sg-lulu":
5096 case "sg-lux":
5097 case "sg-lux-2":
5098 case "sg-miss-fortune":
5099 case "sg-poppy":
5100 case "sg-shisa":
5101 case "sg-soraka":
5102 case "sg-syndra":
5103 case "sg-zephyr":
5104 var c = b + "starguardian140/" + a + ".png";
5105 return "background-image: url(" + c + ");"
5106 }
5107 return null
5108 },
5109 d = function (a) {
5110 for (var b, c, d = 1; d < arguments.length; d++) {
5111 b = arguments[d];
5112 for (c in b) Object.prototype.hasOwnProperty.call(b, c) && (a[c] = b[c])
5113 }
5114 return a
5115 },
5116 e = function () {
5117 function e(c, e) {
5118 if (this.options = e || b, this.links = c, this.rules = m.normal, !this.links) throw new Error("Tokens array requires a `links` property.");
5119 this.options.userFlavoredMarkdown && (this.rules = m.userFlavoredMarkdown), this.options.adminFlavoredMarkdown && (this.rules = m.adminFlavoredMarkdown), a() && (this.rules = d({}, this.rules, m.dataDragonMarkdown)), this.rules = d({}, this.rules, m.stickerMarkdown)
5120 }
5121 this.defaults = b, this.merge = d;
5122 var f = function (a, b) {
5123 return a.replace(b ? /&/g : /&(?!#?\w+;)/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'")
5124 },
5125 g = function (a) {
5126 return a.replace(/</g, "").replace(/>/g, "").replace(/"/g, "").replace(/'/g, "").replace(/\//g, "").replace(/\\/g, "")
5127 },
5128 h = function (a, b) {
5129 return a = a.source, b = b || "",
5130 function c(d, e) {
5131 return d ? (e = e.source || e, e = e.replace(/(^|[^\[])\^/g, "$1"), a = a.replace(d, e), c) : new RegExp(a, b)
5132 }
5133 },
5134 j = function () {};
5135 j.exec = j;
5136 var k = {
5137 newline: /^\n+/,
5138 code: /^( {4}[^\n]+\n*)+/,
5139 fences: j,
5140 hr: /^( *[-*_]){3,} *(?:\n+|$)/,
5141 heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,
5142 blockquote: /^( *>[^\n]+(\n[^\n]+)*\n*)+/,
5143 list: /^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
5144 table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/,
5145 paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,
5146 text: /^[^\n]+/
5147 };
5148 k.bullet = /(?:[*+-]|\d+\.)/, k.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/, k.item = h(k.item, "gm")(/bull/g, k.bullet)(), k.list = h(k.list)(/bull/g, k.bullet)("hr", /\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/)(), k._tag = "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|@)\\b", k.paragraph = h(k.paragraph)("hr", k.hr)("heading", k.heading)("blockquote", k.blockquote)("tag", "<" + k._tag)(), k.normal = d({}, k), k.userFlavoredMarkdown = d({}, k.normal, {}), k.adminFlavoredMarkdown = d({}, k.userFlavoredMarkdown, {
5149 fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,
5150 nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/
5151 });
5152 k.userAvatar = h(k.paragraph)("");
5153 var l = function (a) {
5154 this.tokens = [], this.tokens.links = {}, this.options = a || b, this.rules = k.normal, this.options.userFlavoredMarkdown && (this.rules = k.userFlavoredMarkdown), this.options.adminFlavoredMarkdown && (this.rules = k.adminFlavoredMarkdown)
5155 };
5156 l.lex = function (a, b) {
5157 var c = new l(b);
5158 return c.lex(a)
5159 }, l.rules = k, l.prototype.lex = function (a) {
5160 return a ? (a = a.replace(/\r\n|\r/g, "\n").replace(/\t/g, " ").replace(/\u00a0/g, " ").replace(/\u2424/g, "\n"), this.token(a, !0)) : this.tokens
5161 }, l.prototype.token = function (a, b) {
5162 for (var c, d, e, f, g, h, i, j, l, a = a.replace(/^ +$/gm, ""); a;)
5163 if ((e = this.rules.newline.exec(a)) && (a = a.substring(e[0].length), e[0].length > 1 && this.tokens.push({
5164 type: "space"
5165 })), e = this.rules.heading.exec(a)) a = a.substring(e[0].length), this.tokens.push({
5166 type: "heading",
5167 depth: e[1].length,
5168 text: e[2]
5169 });
5170 else if (e = this.rules.hr.exec(a)) a = a.substring(e[0].length), this.tokens.push({
5171 type: "hr"
5172 });
5173 else if (b && (e = this.rules.blockquote.exec(a))) a = a.substring(e[0].length), this.tokens.push({
5174 type: "blockquote_start"
5175 }), e = e[0].replace(/^ *> ?/gm, ""), this.token(e, !1), this.tokens.push({
5176 type: "blockquote_end"
5177 });
5178 else if (e = this.rules.list.exec(a)) {
5179 for (a = a.substring(e[0].length), f = e[2], this.tokens.push({
5180 type: "list_start",
5181 ordered: f.length > 1
5182 }), e = e[0].match(this.rules.item), c = !1, l = e.length, j = 0; l > j; j++) h = e[j], i = h.length, h = h.replace(/^ *([*+-]|\d+\.) +/, ""), ~h.indexOf("\n ") && (i -= h.length, h = this.options.pedantic ? h.replace(/^ {1,4}/gm, "") : h.replace(new RegExp("^ {1," + i + "}", "gm"), "")), this.options.smartLists && j !== l - 1 && (g = k.bullet.exec(e[j + 1])[0], f === g || f.length > 1 && g.length > 1 || (a = e.slice(j + 1).join("\n") + a, j = l - 1)), d = c || /\n\n(?!\s*$)/.test(h), j !== l - 1 && (c = "\n" === h[h.length - 1], d || (d = c)), this.tokens.push({
5183 type: d ? "loose_item_start" : "list_item_start"
5184 }), this.token(h, !1), this.tokens.push({
5185 type: "list_item_end"
5186 });
5187 this.tokens.push({
5188 type: "list_end"
5189 })
5190 } else if (b && (e = this.rules.table.exec(a))) {
5191 for (a = a.substring(e[0].length), h = {
5192 type: "table",
5193 header: e[1].replace(/^ *| *\| *$/g, "").split(/ *\| */),
5194 align: e[2].replace(/^ *|\| *$/g, "").split(/ *\| */),
5195 cells: e[3].replace(/(?: *\| *)?\n$/, "").split("\n")
5196 }, j = 0; j < h.align.length; j++) /^ *-+: *$/.test(h.align[j]) ? h.align[j] = "right" : /^ *:-+: *$/.test(h.align[j]) ? h.align[j] = "center" : /^ *:-+ *$/.test(h.align[j]) ? h.align[j] = "left" : h.align[j] = null;
5197 for (j = 0; j < h.cells.length; j++) h.cells[j] = h.cells[j].replace(/^ *\| *| *\| *$/g, "").split(/ *\| */);
5198 this.tokens.push(h)
5199 } else if (b && (e = this.rules.paragraph.exec(a))) a = a.substring(e[0].length), this.tokens.push({
5200 type: "paragraph",
5201 text: "\n" === e[1][e[1].length - 1] ? e[1].slice(0, -1) : e[1]
5202 });
5203 else if (e = this.rules.text.exec(a)) a = a.substring(e[0].length), this.tokens.push({
5204 type: "text",
5205 text: e[0]
5206 });
5207 else if (a) throw new Error("Infinite loop on byte: " + a.charCodeAt(0));
5208 return this.tokens
5209 };
5210 var m = {
5211 escape: /^\\([\\`*{}\[\]()#+\-.!_>])/,
5212 strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
5213 em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
5214 link: /^!?\[(inside)\]\(href\)/,
5215 reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/,
5216 nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
5217 br: /^ {2,}\n(?!\s*$)/,
5218 text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|\{\{|~~|$)/,
5219 blockquote: /^( *(>)[^\n]+(\n[^\n]+)*\n*)+/,
5220 meta: /^!?\[{([\s\S]+)}\]\(([\s\S]+)\)/,
5221 url: /^(https?:\/\/[^\s]+)/,
5222 strike: /^~~(.+?)~~/
5223 };
5224 m._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/, m._href = /\s*^(https?:\/\/[^\s]+)\s*/, meta = {}, meta.whitelist = {
5225 quoted: ["name", "realm", "application-id", "discussion-id", "comment-id", "timestamp"]
5226 }, m.link = h(m.link)("inside", m._inside)("href", m._href)(), m.reflink = h(m.reflink)("inside", m._inside)(), m.normal = d({}, m), m.pedantic = d({}, m.normal, {
5227 strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
5228 em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/
5229 }), m.breaks = d({}, {
5230 br: h(m.br)("{2,}", "*")()
5231 }), m.userFlavoredMarkdown = d({}, m.normal, {
5232 tag: j,
5233 br: /^ *\n(?!\s*$)/,
5234 text: /^[\s\S]+?(?=[\\<!\[_*`~]|https?:\/\/| *\n|\{\{|~~|$)/,
5235 curly: j
5236 }), m.dataDragonMarkdown = d({}, m.userFlavoredMarkdown, {
5237 curly: /^{{(.+?):(.+?)}}/
5238 }), m.adminFlavoredMarkdown = d({}, m.userFlavoredMarkdown, {}), e.prototype.output = function (b) {
5239 for (var d, e, h, j, k, l, m, n = ""; b;)
5240 if (j = this.rules.escape.exec(b)) b = b.substring(j[0].length), n += j[1];
5241 else if (j = this.rules.meta.exec(b)) {
5242 if (b = b.substring(j[0].length), !(j[1] in meta.whitelist)) {
5243 n = g(j[0]);
5244 continue
5245 }
5246 for (m = '<span class="markdown-meta markdown-meta-' + j[1] + '" style="display:none;"', k = g(j[2]).split(","), i = 0; i < k.length; i++) l = k[i].split("=", 2), meta.whitelist[j[1]].indexOf(l[0].trim()) >= 0 && l.length > 1 && (m += " data-" + g(l[0].trim()) + '="' + g(l[1]).trim() + '"');
5247 m += "></span>", n = m
5248 } else if (j = this.rules.url.exec(b)) b = b.substring(j[0].length), e = f(j[1]), h = e, n += '<a href="' + h + '">' + e + "</a>\n";
5249 else if (j = this.rules.link.exec(b)) b = b.substring(j[0].length), n += this.outputLink(j, {
5250 href: j[2],
5251 title: j[3]
5252 });
5253 else if ((j = this.rules.reflink.exec(b)) || (j = this.rules.nolink.exec(b))) {
5254 if (b = b.substring(j[0].length), d = (j[2] || j[1]).replace(/\s+/g, " "), d = this.links[d.toLowerCase()], !d || !d.href) {
5255 n += j[0].charAt(0), b = j[0].substring(1) + b;
5256 continue
5257 }
5258 n += this.outputLink(j, d)
5259 } else if (j = this.rules.strong.exec(b)) b = b.substring(j[0].length), n += "<strong>" + this.output(j[2] || j[1]) + "</strong>";
5260 else if (j = this.rules.em.exec(b)) b = b.substring(j[0].length), n += "<em>" + this.output(j[2] || j[1]) + "</em>";
5261 else if (j = this.rules.br.exec(b)) b = b.substring(j[0].length), n += "<br>";
5262 else if (j = this.rules.curly.exec(b)) {
5263 b = b.substring(j[0].length);
5264 var o = j[1].toLowerCase();
5265 if (o = "champion" == o || "item" == o || "summoner" == o || "sticker" == o ? o : null) try {
5266 var p = null,
5267 q = null;
5268 if ("sticker" == o) p = c(j[2]), q = "sticker slayer";
5269 else if (a()) {
5270 if (!j[2].match(/^[0-9]+$/)) continue;
5271 p = Riot.DDragon.useModel(o).getImg(j[2], {
5272 size: "small",
5273 wrap: 1
5274 }, "item" != o ? !0 : null), q = ""
5275 }
5276 p && (n += '<span class="' + q + '" style="display: inline-block; ' + p + '"></span>')
5277 } catch (r) {}
5278 } else if (j = this.rules.strike.exec(b)) b = b.substring(j[0].length), n += "<del>" + f(j[1]) + "</del>";
5279 else if (j = this.rules.text.exec(b)) b = b.substring(j[0].length), n += f(j[0]);
5280 else if (b) throw new Error("Infinite loop on byte: " + b.charCodeAt(0));
5281 return n
5282 }, e.prototype.outputLink = function (a, b) {
5283 return '<a href="' + f(b.href) + '"' + (b.title ? ' title="' + f(b.title) + '"' : "") + ">" + this.output(a[1]) + "</a>"
5284 }, e.prototype.smartypants = function (a) {
5285 return this.options.smartypants ? a.replace(/--/g, "—").replace(/'([^']*)'/g, "‘$1’").replace(/"([^"]*)"/g, "“$1”").replace(/\.{3}/g, "…") : a
5286 }, e.prototype.mangle = function (a) {
5287 for (var b, c = "", d = a.length, e = 0; d > e; e++) b = a.charCodeAt(e), Math.random() > .5 && (b = "x" + b.toString(16)), c += "&#" + b + ";";
5288 return c
5289 };
5290 var n = function (a) {
5291 this.tokens = [], this.token = null, this.options = a || b
5292 };
5293 n.prototype.parse = function (a) {
5294 this.inline = new e(a.links, this.options), this.tokens = a.reverse();
5295 for (var b = ""; this.next();) b += this.tok();
5296 return b
5297 }, n.prototype.next = function () {
5298 return this.token = this.tokens.pop()
5299 }, n.prototype.peek = function () {
5300 return this.tokens[this.tokens.length - 1] || 0
5301 }, n.prototype.parseText = function () {
5302 for (var a = this.token.text;
5303 "text" === this.peek().type;) a += "\n" + this.next().text;
5304 return this.inline.output(a)
5305 }, n.prototype.tok = function () {
5306 switch (this.token.type) {
5307 case "space":
5308 return "";
5309 case "hr":
5310 return "<hr>\n";
5311 case "heading":
5312 return "<h" + this.token.depth + ">" + this.inline.output(this.token.text) + "</h" + this.token.depth + ">\n";
5313 case "table":
5314 var a, b, c, d, e, f = "";
5315 for (f += "<thead>\n<tr>\n", b = 0; b < this.token.header.length; b++) a = this.inline.output(this.token.header[b]), f += this.token.align[b] ? '<th align="' + this.token.align[b] + '">' + a + "</th>\n" : "<th>" + a + "</th>\n";
5316 for (f += "</tr>\n</thead>\n", f += "<tbody>\n", b = 0; b < this.token.cells.length; b++) {
5317 for (c = this.token.cells[b], f += "<tr>\n", e = 0; e < c.length; e++) d = this.inline.output(c[e]), f += this.token.align[e] ? '<td align="' + this.token.align[e] + '">' + d + "</td>\n" : "<td>" + d + "</td>\n";
5318 f += "</tr>\n"
5319 }
5320 return f += "</tbody>\n", '<table class="table table-bordered">\n' + f + "</table>\n";
5321 case "blockquote_start":
5322 for (var f = "";
5323 "blockquote_end" !== this.next().type;) f += this.tok();
5324 return "<blockquote>\n" + f + "</blockquote>\n";
5325 case "list_start":
5326 for (var g = this.token.ordered ? "ol" : "ul", f = "";
5327 "list_end" !== this.next().type;) f += this.tok();
5328 return "<" + g + ">\n" + f + "</" + g + ">\n";
5329 case "list_item_start":
5330 for (var f = "";
5331 "list_item_end" !== this.next().type;) f += "text" === this.token.type ? this.parseText() : this.tok();
5332 return "<li>" + f + "</li>\n";
5333 case "loose_item_start":
5334 for (var f = "";
5335 "list_item_end" !== this.next().type;) f += this.tok();
5336 return "<li>" + f + "</li>\n";
5337 case "html":
5338 return this.token.pre || this.options.pedantic ? this.token.text : this.inline.output(this.token.text);
5339 case "paragraph":
5340 return "<p>" + this.inline.output(this.token.text) + "</p>\n";
5341 case "text":
5342 return "<p>" + this.parseText() + "</p>\n"
5343 }
5344 }, this.Parser = new n, this.Lexer = new l
5345 };
5346 return e.prototype.parse = function (a, b, c) {
5347 if (c || "function" == typeof b) {
5348 c || (c = b, b = null), b && (b = this.merge({}, this.defaults, b));
5349 var e = this.Lexer.lex(e, b),
5350 f = b.highlight,
5351 g = 0,
5352 h = e.length,
5353 i = 0;
5354 if (!f || f.length < 3) return c(null, this.Parser.parse(e, b));
5355 for (var j = function () {
5356 delete b.highlight;
5357 var a = this.Parser.parse(e, b);
5358 return b.highlight = f, c(null, a)
5359 }; h > i; i++) ! function (a) {
5360 return "code" === a.type ? (g++, f(a.text, a.lang, function (b, c) {
5361 return null == c || c === a.text ? --g || j() : (a.text = c, a.escaped = !0, void(--g || j()))
5362 })) : void 0
5363 }(e[i])
5364 } else try {
5365 return b && (b = d({}, this.defaults, b)), this.Parser.parse(this.Lexer.lex(a, b), b)
5366 } catch (k) {
5367 if (k.message += "\n Sorry!", (b || this.defaults).silent) return "<p>An error occured:</p><pre>" + escape(k.message + "", !0) + "</pre>";
5368 throw k
5369 }
5370 }, e.prototype.setOptions = function (a) {
5371 return this.merge(this.defaults, a), this
5372 }, e
5373 }), Array.prototype.forEach || (Array.prototype.forEach = function (a, b) {
5374 "use strict";
5375 var c, d;
5376 for (c = 0, d = this.length; d > c; ++c) c in this && a.call(b, this[c], c, this)
5377 }), define("truncate", [], function () {
5378 return function (a, b, c) {
5379 function d(a) {
5380 var b, c, d = x.exec(a);
5381 return d ? (b = d.index, c = d[0].length, a.substring(0, b) + a.substring(b + c)) : a
5382 }
5383
5384 function e(a) {
5385 var b = "";
5386 return a.reverse().forEach(function (a, c) {
5387 -1 === n.indexOf(a) && (b += "</" + a + ">")
5388 }), b
5389 }
5390
5391 function f(a) {
5392 var b = a.indexOf(" ");
5393 if (-1 === b && (b = a.indexOf(">"), -1 === b)) throw new Error("HTML tag is not well-formed : " + a);
5394 return a.substring(1, b)
5395 }
5396 var g, h, i, j, k = {},
5397 l = "",
5398 m = "...",
5399 n = ["img"],
5400 o = [],
5401 p = 0,
5402 q = l,
5403 r = '(\\w+\\s*=\\s*"[^"]*"\\s*)*',
5404 s = "\\s*\\/?\\s*",
5405 t = "\\s*\\/\\s*",
5406 u = new RegExp("<\\/?\\w+\\s*" + r + t + ">"),
5407 v = new RegExp("<\\/?\\w+\\s*" + r + s + ">"),
5408 w = /(((ftp|https?):\/\/)[\-\w@:%_\+.~#?,&\/\/=]+)|((mailto:)?[_.\w\-]+@([\w][\w\-]+\.)+[a-zA-Z]{2,3})/g,
5409 x = new RegExp("<img\\s*" + r + s + ">"),
5410 y = !0;
5411 for (c = c || k, c.ellipsis = void 0 !== c.ellipsis ? c.ellipsis : m; y;) {
5412 if (y = v.exec(a), !y) {
5413 if (p >= b) break;
5414 if (y = w.exec(a), !y || y.index >= b) {
5415 q += a.substring(0, b - p);
5416 break
5417 }
5418 for (; y;) g = y[0], h = y.index, q += a.substring(0, h + g.length - p), a = a.substring(h + g.length), y = w.exec(a);
5419 break
5420 }
5421 if (g = y[0], h = y.index, p + h > b) {
5422 q += a.substring(0, b - p);
5423 break
5424 }
5425 p += h, q += a.substring(0, h), "/" === g[1] ? o.pop() : (j = u.exec(g), j || (i = f(g), o.push(i))), q += j ? j[0] : g, a = a.substring(h + g.length)
5426 }
5427 return a.length > b && c.ellipsis && (q += c.ellipsis), q += e(o), c.keepImageTag || (q = d(q)), q
5428 }
5429 }),
5430 function (a, b) {
5431 "function" == typeof define && define.amd ? define("burry", [], function () {
5432 return b()
5433 }) : a.Burry = b()
5434 }(this, function () {
5435 var a = {
5436 Store: function (b, c) {
5437 var d = a.stores();
5438 b && (this._CACHE_SUFFIX = this._CACHE_SUFFIX + b, this._EXPIRY_KEY = this._EXPIRY_KEY + b, -1 === d.indexOf(b) && d.push(b)), localStorage.setItem("_burry_stores_", JSON.stringify(d)),
5439 this.default_ttl = c
5440 },
5441 _EXPIRY_UNITS: 6e4,
5442 _mEpoch: function () {
5443 return Math.floor((new Date).getTime() / a._EXPIRY_UNITS)
5444 },
5445 stores: function () {
5446 var a = localStorage.getItem("_burry_stores_");
5447 return a = a ? JSON.parse(a) : [""]
5448 },
5449 isSupported: function () {
5450 if (a._isSupported) return a._isSupported;
5451 try {
5452 localStorage.setItem("_burry_", "_burry_"), localStorage.removeItem("_burry_")
5453 } catch (b) {
5454 return a._isSupported = !1
5455 }
5456 return JSON ? a._isSupported = !0 : a._isSupported = !1
5457 },
5458 flushExpired: function () {
5459 var b, c, d, e, f, g = [],
5460 h = a._mEpoch(),
5461 i = new RegExp("(.+)" + a.Store.prototype._EXPIRY_KEY + "(.*)");
5462 for (b = 0; b < localStorage.length; b++) d = localStorage.key(b), c = d.match(i), c && (e = localStorage.getItem(d), h > e && (d = c[1], f = c[2], g.push(d + a.Store.prototype._CACHE_SUFFIX + f), g.push(d + a.Store.prototype._EXPIRY_KEY + f)));
5463 for (b = 0; b < g.length; b++) localStorage.removeItem(g[b])
5464 }
5465 };
5466 return a.Store.prototype = {
5467 _CACHE_SUFFIX: "-_burry_",
5468 _EXPIRY_KEY: "-_burry_exp_",
5469 _internalKey: function (a) {
5470 return a + this._CACHE_SUFFIX
5471 },
5472 _expirationKey: function (a) {
5473 return a + this._EXPIRY_KEY
5474 },
5475 _isInternalKey: function (a) {
5476 return a.slice(-this._CACHE_SUFFIX.length) === this._CACHE_SUFFIX ? a.slice(0, -this._CACHE_SUFFIX.length) : !1
5477 },
5478 _isExpirationKey: function (a) {
5479 return a.slice(-this._EXPIRY_KEY.length) === this._EXPIRY_KEY ? a.slice(0, -this._EXPIRY_KEY.length) : !1
5480 },
5481 _expiresOn: function (a) {
5482 var b = localStorage.getItem(this._expirationKey(a));
5483 return b ? parseInt(b, 10) : void 0
5484 },
5485 _getCounter: function (a) {
5486 var b = localStorage.getItem(a);
5487 return null === b ? 0 : parseInt(b, 10)
5488 },
5489 get: function (a) {
5490 var b = localStorage.getItem(this._internalKey(a));
5491 if (null === b) return void 0;
5492 if (this.hasExpired(a)) return void this.remove(a);
5493 try {
5494 b = JSON.parse(b)
5495 } catch (c) {
5496 return void 0
5497 }
5498 return b
5499 },
5500 set: function (b, c, d) {
5501 var e = this,
5502 f = function () {
5503 localStorage.setItem(e._internalKey(b), c), d ? localStorage.setItem(e._expirationKey(b), a._mEpoch() + d) : localStorage.removeItem(e._expirationKey(b))
5504 };
5505 if (d = d || e.default_ttl, d && (d = parseInt(d, 10)), void 0 === typeof b || void 0 === typeof c) return !1;
5506 c = JSON.stringify(c);
5507 try {
5508 f()
5509 } catch (g) {
5510 if (22 === g.code || "QUOTA_EXCEEDED_ERR" === g.name || "QuoteExceededError" === g.name || "NS_ERROR_DOM_QUOTA_REACHED" === g.name) {
5511 a.flushExpired();
5512 try {
5513 f()
5514 } catch (g) {
5515 return !1
5516 }
5517 }
5518 }
5519 return !0
5520 },
5521 add: function (a, b, c) {
5522 return null === localStorage.getItem(this._internalKey(a)) || this.hasExpired(a) ? this.set(a, b, c) : !1
5523 },
5524 replace: function (a, b, c) {
5525 return null === localStorage.getItem(this._internalKey(a)) || this.hasExpired(a) ? !1 : this.set(a, b, c)
5526 },
5527 remove: function (a) {
5528 localStorage.removeItem(this._internalKey(a)), localStorage.removeItem(this._expirationKey(a))
5529 },
5530 incr: function (a) {
5531 var b = this._internalKey(a),
5532 c = this._getCounter(b);
5533 c++, localStorage.setItem(b, c)
5534 },
5535 decr: function (a) {
5536 var b = this._internalKey(a),
5537 c = this._getCounter(b);
5538 c--, localStorage.setItem(b, c)
5539 },
5540 hasExpired: function (b) {
5541 var c = this._expiresOn(b);
5542 return c && c < a._mEpoch() ? !0 : !1
5543 },
5544 keys: function () {
5545 var a, b, c, d = [];
5546 for (a = 0; a < localStorage.length; a++) b = localStorage.key(a), c = this._isInternalKey(b), c && d.push(c);
5547 return d
5548 },
5549 expirableKeys: function () {
5550 var a, b, c, d = {};
5551 for (a = 0; a < localStorage.length; a++) b = localStorage.key(a), c = this._isExpirationKey(b), c && (d[c] = parseInt(localStorage.getItem(b), 10));
5552 return d
5553 },
5554 flush: function () {
5555 var a, b, c = [];
5556 for (a = 0; a < localStorage.length; a++) b = localStorage.key(a), (this._isInternalKey(b) || this._isExpirationKey(b)) && c.push(b);
5557 for (a = 0; a < c.length; a++) localStorage.removeItem(c[a])
5558 },
5559 flushExpired: function () {
5560 var b, c, d = this.expirableKeys(),
5561 e = a._mEpoch();
5562 for (b in d) c = d[b], e > c && this.remove(b)
5563 }
5564 }, a
5565 }), define("riotbar", [], function () {
5566 var a = window.RiotBar || {};
5567 a.account = a.account || {};
5568 for (var b = ["getSummonerName", "getLang", "login"], c = 0; c < b.length; c++) a.account.hasOwnProperty(b[c]) || (a.account[b[c]] = function () {
5569 return !1
5570 });
5571 return a
5572 }),
5573 function (a) {
5574 "function" == typeof require && "object" == typeof exports && "object" == typeof module ? a(require("knockout"), exports) : "function" == typeof define && define.amd ? define("knockoutMapping", ["knockout", "exports"], a) : a(ko, ko.mapping = {})
5575 }(function (a, b) {
5576 function c() {
5577 for (var a, b, c, d = arguments, e = d.length, f = {}, g = []; e--;)
5578 for (c = d[e], a = c.length; a--;) b = c[a], f[b] || (f[b] = 1, g.push(b));
5579 return g
5580 }
5581
5582 function d(a, e) {
5583 var f;
5584 for (var g in e)
5585 if (e.hasOwnProperty(g) && e[g])
5586 if (f = b.getType(a[g]), g && a[g] && "array" !== f && "string" !== f) d(a[g], e[g]);
5587 else {
5588 var h = "array" === b.getType(a[g]) && "array" === b.getType(e[g]);
5589 h ? a[g] = c(a[g], e[g]) : a[g] = e[g]
5590 }
5591 }
5592
5593 function e(a, b) {
5594 var c = {};
5595 return d(c, a), d(c, b), c
5596 }
5597
5598 function f(a, b) {
5599 for (var c = e({}, a), d = y.length - 1; d >= 0; d--) {
5600 var f = y[d];
5601 c[f] && (c[""] instanceof Object || (c[""] = {}), c[""][f] = c[f], delete c[f])
5602 }
5603 return b && (c.ignore = g(b.ignore, c.ignore), c.include = g(b.include, c.include), c.copy = g(b.copy, c.copy), c.observe = g(b.observe, c.observe)), c.ignore = g(c.ignore, B.ignore), c.include = g(c.include, B.include), c.copy = g(c.copy, B.copy), c.observe = g(c.observe, B.observe), c.mappedProperties = c.mappedProperties || {}, c.copiedProperties = c.copiedProperties || {}, c
5604 }
5605
5606 function g(c, d) {
5607 return "array" !== b.getType(c) && (c = "undefined" === b.getType(c) ? [] : [c]), "array" !== b.getType(d) && (d = "undefined" === b.getType(d) ? [] : [d]), a.utils.arrayGetDistinctValues(c.concat(d))
5608 }
5609
5610 function h(b, c) {
5611 var d = a.dependentObservable;
5612 a.dependentObservable = function (c, d, e) {
5613 e = e || {}, c && "object" == typeof c && (e = c);
5614 var f = e.deferEvaluation,
5615 g = !1,
5616 h = function (c) {
5617 var d = a.dependentObservable;
5618 a.dependentObservable = w;
5619 var e = a.isWriteableObservable(c);
5620 a.dependentObservable = d;
5621 var f = w({
5622 read: function () {
5623 return g || (a.utils.arrayRemoveItem(b, c), g = !0), c.apply(c, arguments)
5624 },
5625 write: e && function (a) {
5626 return c(a)
5627 },
5628 deferEvaluation: !0
5629 });
5630 return u && (f._wrapper = !0), f.__DO = c, f
5631 };
5632 e.deferEvaluation = !0;
5633 var i = new w(c, d, e);
5634 return f || (i = h(i), b.push(i)), i
5635 }, a.dependentObservable.fn = w.fn, a.computed = a.dependentObservable;
5636 var e = c();
5637 return a.dependentObservable = d, a.computed = a.dependentObservable, e
5638 }
5639
5640 function i(c, d, f, g, k, p, q) {
5641 var r = "array" === b.getType(a.utils.unwrapObservable(d));
5642 if (p = p || "", b.isMapped(c)) {
5643 var u = a.utils.unwrapObservable(c)[v];
5644 f = e(u, f)
5645 }
5646 var w = {
5647 data: d,
5648 parent: q || k
5649 },
5650 x = function () {
5651 return f[g] && f[g].create instanceof Function
5652 },
5653 y = function (b) {
5654 return h(s, function () {
5655 return a.utils.unwrapObservable(k) instanceof Array ? f[g].create({
5656 data: b || w.data,
5657 parent: w.parent,
5658 skip: z
5659 }) : f[g].create({
5660 data: b || w.data,
5661 parent: w.parent
5662 })
5663 })
5664 },
5665 A = function () {
5666 return f[g] && f[g].update instanceof Function
5667 },
5668 B = function (b, c) {
5669 var d = {
5670 data: c || w.data,
5671 parent: w.parent,
5672 target: a.utils.unwrapObservable(b)
5673 };
5674 return a.isWriteableObservable(b) && (d.observable = b), f[g].update(d)
5675 },
5676 C = t.get(d);
5677 if (C) return C;
5678 if (g = g || "", r) {
5679 var D = [],
5680 E = !1,
5681 F = function (a) {
5682 return a
5683 };
5684 f[g] && f[g].key && (F = f[g].key, E = !0), a.isObservable(c) || (c = a.observableArray([]), c.mappedRemove = function (a) {
5685 var b = "function" == typeof a ? a : function (b) {
5686 return b === F(a)
5687 };
5688 return c.remove(function (a) {
5689 return b(F(a))
5690 })
5691 }, c.mappedRemoveAll = function (b) {
5692 var d = m(b, F);
5693 return c.remove(function (b) {
5694 return -1 != a.utils.arrayIndexOf(d, F(b))
5695 })
5696 }, c.mappedDestroy = function (a) {
5697 var b = "function" == typeof a ? a : function (b) {
5698 return b === F(a)
5699 };
5700 return c.destroy(function (a) {
5701 return b(F(a))
5702 })
5703 }, c.mappedDestroyAll = function (b) {
5704 var d = m(b, F);
5705 return c.destroy(function (b) {
5706 return -1 != a.utils.arrayIndexOf(d, F(b))
5707 })
5708 }, c.mappedIndexOf = function (b) {
5709 var d = m(c(), F),
5710 e = F(b);
5711 return a.utils.arrayIndexOf(d, e)
5712 }, c.mappedGet = function (a) {
5713 return c()[c.mappedIndexOf(a)]
5714 }, c.mappedCreate = function (b) {
5715 if (-1 !== c.mappedIndexOf(b)) throw new Error("There already is an object with the key that you specified.");
5716 var d = x() ? y(b) : b;
5717 if (A()) {
5718 var e = B(d, b);
5719 a.isWriteableObservable(d) ? d(e) : d = e
5720 }
5721 return c.push(d), d
5722 });
5723 var G = m(a.utils.unwrapObservable(c), F).sort(),
5724 H = m(d, F);
5725 E && H.sort();
5726 var I, J, K = a.utils.compareArrays(G, H),
5727 L = {},
5728 M = a.utils.unwrapObservable(d),
5729 N = {},
5730 O = !0;
5731 for (I = 0, J = M.length; J > I; I++) {
5732 var P = F(M[I]);
5733 if (void 0 === P || P instanceof Object) {
5734 O = !1;
5735 break
5736 }
5737 N[P] = M[I]
5738 }
5739 var Q = [],
5740 R = 0;
5741 for (I = 0, J = K.length; J > I; I++) {
5742 var S, P = K[I],
5743 T = p + "[" + I + "]";
5744 switch (P.status) {
5745 case "added":
5746 var U = O ? N[P.value] : l(a.utils.unwrapObservable(d), P.value, F);
5747 S = i(void 0, U, f, g, c, T, k), x() || (S = a.utils.unwrapObservable(S));
5748 var V = j(a.utils.unwrapObservable(d), U, L);
5749 S === z ? R++ : Q[V - R] = S, L[V] = !0;
5750 break;
5751 case "retained":
5752 var U = O ? N[P.value] : l(a.utils.unwrapObservable(d), P.value, F);
5753 S = l(c, P.value, F), i(S, U, f, g, c, T, k);
5754 var V = j(a.utils.unwrapObservable(d), U, L);
5755 Q[V] = S, L[V] = !0;
5756 break;
5757 case "deleted":
5758 S = l(c, P.value, F)
5759 }
5760 D.push({
5761 event: P.status,
5762 item: S
5763 })
5764 }
5765 c(Q), f[g] && f[g].arrayChanged && a.utils.arrayForEach(D, function (a) {
5766 f[g].arrayChanged(a.event, a.item)
5767 })
5768 } else if (o(d)) {
5769 if (c = a.utils.unwrapObservable(c), !c) {
5770 if (x()) {
5771 var W = y();
5772 return A() && (W = B(W)), W
5773 }
5774 if (A()) return B(W);
5775 c = {}
5776 }
5777 if (A() && (c = B(c)), t.save(d, c), A()) return c;
5778 n(d, function (b) {
5779 var e = p.length ? p + "." + b : b;
5780 if (-1 == a.utils.arrayIndexOf(f.ignore, e)) {
5781 if (-1 != a.utils.arrayIndexOf(f.copy, e)) return void(c[b] = d[b]);
5782 if ("object" != typeof d[b] && "array" != typeof d[b] && f.observe.length > 0 && -1 == a.utils.arrayIndexOf(f.observe, e)) return c[b] = d[b], void(f.copiedProperties[e] = !0);
5783 var g = t.get(d[b]),
5784 h = i(c[b], d[b], f, b, c, e, c),
5785 j = g || h;
5786 if (f.observe.length > 0 && -1 == a.utils.arrayIndexOf(f.observe, e)) return c[b] = a.utils.unwrapObservable(j), void(f.copiedProperties[e] = !0);
5787 a.isWriteableObservable(c[b]) ? (j = a.utils.unwrapObservable(j), c[b]() !== j && c[b](j)) : (j = void 0 === c[b] ? j : a.utils.unwrapObservable(j), c[b] = j), f.mappedProperties[e] = !0
5788 }
5789 })
5790 } else switch (b.getType(d)) {
5791 case "function":
5792 A() ? a.isWriteableObservable(d) ? (d(B(d)), c = d) : c = B(d) : c = d;
5793 break;
5794 default:
5795 if (a.isWriteableObservable(c)) {
5796 if (A()) {
5797 var X = B(c);
5798 return c(X), X
5799 }
5800 var X = a.utils.unwrapObservable(d);
5801 return c(X), X
5802 }
5803 var Y = x() || A();
5804 if (c = x() ? y() : a.observable(a.utils.unwrapObservable(d)), A() && c(B(c)), Y) return c
5805 }
5806 return c
5807 }
5808
5809 function j(a, b, c) {
5810 for (var d = 0, e = a.length; e > d; d++)
5811 if (c[d] !== !0 && a[d] === b) return d;
5812 return null
5813 }
5814
5815 function k(c, d) {
5816 var e;
5817 return d && (e = d(c)), "undefined" === b.getType(e) && (e = c), a.utils.unwrapObservable(e)
5818 }
5819
5820 function l(b, c, d) {
5821 b = a.utils.unwrapObservable(b);
5822 for (var e = 0, f = b.length; f > e; e++) {
5823 var g = b[e];
5824 if (k(g, d) === c) return g
5825 }
5826 throw new Error("When calling ko.update*, the key '" + c + "' was not found!")
5827 }
5828
5829 function m(b, c) {
5830 return a.utils.arrayMap(a.utils.unwrapObservable(b), function (a) {
5831 return c ? k(a, c) : a
5832 })
5833 }
5834
5835 function n(a, c) {
5836 if ("array" === b.getType(a))
5837 for (var d = 0; d < a.length; d++) c(d);
5838 else
5839 for (var e in a) c(e)
5840 }
5841
5842 function o(a) {
5843 var c = b.getType(a);
5844 return ("object" === c || "array" === c) && null !== a
5845 }
5846
5847 function p(a, c, d) {
5848 var e = a || "";
5849 return "array" === b.getType(c) ? a && (e += "[" + d + "]") : (a && (e += "."), e += d), e
5850 }
5851
5852 function q() {
5853 var b = [],
5854 c = [];
5855 this.save = function (d, e) {
5856 var f = a.utils.arrayIndexOf(b, d);
5857 f >= 0 ? c[f] = e : (b.push(d), c.push(e))
5858 }, this.get = function (d) {
5859 var e = a.utils.arrayIndexOf(b, d),
5860 f = e >= 0 ? c[e] : void 0;
5861 return f
5862 }
5863 }
5864
5865 function r() {
5866 var a = {},
5867 b = function (b) {
5868 var c;
5869 try {
5870 c = b
5871 } catch (d) {
5872 c = "$$$"
5873 }
5874 var e = a[c];
5875 return void 0 === e && (e = new q, a[c] = e), e
5876 };
5877 this.save = function (a, c) {
5878 b(a).save(a, c)
5879 }, this.get = function (a) {
5880 return b(a).get(a)
5881 }
5882 }
5883 var s, t, u = !0,
5884 v = "__ko_mapping__",
5885 w = a.dependentObservable,
5886 x = 0,
5887 y = ["create", "update", "key", "arrayChanged"],
5888 z = {},
5889 A = {
5890 include: ["_destroy"],
5891 ignore: [],
5892 copy: [],
5893 observe: []
5894 },
5895 B = A;
5896 b.isMapped = function (b) {
5897 var c = a.utils.unwrapObservable(b);
5898 return c && c[v]
5899 }, b.fromJS = function (a) {
5900 if (0 == arguments.length) throw new Error("When calling ko.fromJS, pass the object you want to convert.");
5901 try {
5902 x++ || (s = [], t = new r);
5903 var b, c;
5904 2 == arguments.length && (arguments[1][v] ? c = arguments[1] : b = arguments[1]), 3 == arguments.length && (b = arguments[1], c = arguments[2]), c && (b = e(b, c[v])), b = f(b);
5905 var d = i(c, a, b);
5906 if (c && (d = c), !--x)
5907 for (; s.length;) {
5908 var g = s.pop();
5909 g && (g(), g.__DO.throttleEvaluation = g.throttleEvaluation)
5910 }
5911 return d[v] = e(d[v], b), d
5912 } catch (h) {
5913 throw x = 0, h
5914 }
5915 }, b.fromJSON = function (c) {
5916 var d = a.utils.parseJson(c);
5917 return arguments[0] = d, b.fromJS.apply(this, arguments)
5918 }, b.updateFromJS = function (a) {
5919 throw new Error("ko.mapping.updateFromJS, use ko.mapping.fromJS instead. Please note that the order of parameters is different!")
5920 }, b.updateFromJSON = function (a) {
5921 throw new Error("ko.mapping.updateFromJSON, use ko.mapping.fromJSON instead. Please note that the order of parameters is different!")
5922 }, b.toJS = function (c, d) {
5923 if (B || b.resetDefaultOptions(), 0 == arguments.length) throw new Error("When calling ko.mapping.toJS, pass the object you want to convert.");
5924 if ("array" !== b.getType(B.ignore)) throw new Error("ko.mapping.defaultOptions().ignore should be an array.");
5925 if ("array" !== b.getType(B.include)) throw new Error("ko.mapping.defaultOptions().include should be an array.");
5926 if ("array" !== b.getType(B.copy)) throw new Error("ko.mapping.defaultOptions().copy should be an array.");
5927 return d = f(d, c[v]), b.visitModel(c, function (b) {
5928 return a.utils.unwrapObservable(b)
5929 }, d)
5930 }, b.toJSON = function (c, d) {
5931 var e = b.toJS(c, d);
5932 return a.utils.stringifyJson(e)
5933 }, b.defaultOptions = function () {
5934 return arguments.length > 0 ? void(B = arguments[0]) : B
5935 }, b.resetDefaultOptions = function () {
5936 B = {
5937 include: A.include.slice(0),
5938 ignore: A.ignore.slice(0),
5939 copy: A.copy.slice(0),
5940 observe: A.observe.slice(0)
5941 }
5942 }, b.getType = function (a) {
5943 if (a && "object" == typeof a) {
5944 if (a.constructor === Date) return "date";
5945 if (a.constructor === Array) return "array"
5946 }
5947 return typeof a
5948 }, b.visitModel = function (c, d, e) {
5949 e = e || {}, e.visitedObjects = e.visitedObjects || new r;
5950 var g, h = a.utils.unwrapObservable(c);
5951 if (!o(h)) return d(c, e.parentName);
5952 e = f(e, h[v]), d(c, e.parentName), g = "array" === b.getType(h) ? [] : {}, e.visitedObjects.save(c, g);
5953 var i = e.parentName;
5954 return n(h, function (c) {
5955 if (!e.ignore || -1 == a.utils.arrayIndexOf(e.ignore, c)) {
5956 var f = h[c];
5957 if (e.parentName = p(i, h, c), -1 !== a.utils.arrayIndexOf(e.copy, c) || -1 !== a.utils.arrayIndexOf(e.include, c) || !h[v] || !h[v].mappedProperties || h[v].mappedProperties[c] || !h[v].copiedProperties || h[v].copiedProperties[c] || "array" === b.getType(h)) {
5958 switch (b.getType(a.utils.unwrapObservable(f))) {
5959 case "object":
5960 case "array":
5961 case "undefined":
5962 var j = e.visitedObjects.get(f);
5963 g[c] = "undefined" !== b.getType(j) ? j : b.visitModel(f, d, e);
5964 break;
5965 default:
5966 g[c] = d(f, e.parentName)
5967 }
5968 }
5969 }
5970 }), g
5971 }, a.mapping = b
5972 }),
5973 function (a) {
5974 "function" == typeof require && "object" == typeof exports && "object" == typeof module ? a(require("knockout"), exports) : "function" == typeof define && define.amd ? define("knockoutPostbox", ["knockout", "exports"], a) : a(ko, ko.postbox = {})
5975 }(function (a, b, c) {
5976 var d, e;
5977 a.subscribable.call(b), b.topicCache = {}, b.serializer = a.toJSON, b.publish = function (a, c) {
5978 a && (b.topicCache[a] = {
5979 value: c,
5980 serialized: b.serializer(c)
5981 }, b.notifySubscribers(c, a))
5982 }, e = b.subscribe, b.subscribe = function (a, c, d) {
5983 return a ? e.call(b, c, d, a) : void 0
5984 }, b.defaultComparer = function (a, c) {
5985 return c && b.serializer(a) === c.serialized
5986 }, a.subscribable.fn.publishOn = function (a, c, e) {
5987 var f;
5988 return a && ("function" == typeof c ? e = c : f = c, e = e || b.defaultComparer, d.call(this, a, "publishOn"), this.postboxSubs[a].publishOn = this.subscribe(function (c) {
5989 e.call(this, c, b.topicCache[a]) || b.publish(a, c)
5990 }, this), f || b.publish(a, this())), this
5991 }, d = function (a, b) {
5992 var c = this.postboxSubs = this.postboxSubs || {};
5993 c[a] = c[a] || {}, c[a][b] && c[a][b].dispose()
5994 }, a.subscribable.fn.stopPublishingOn = function (a) {
5995 return d.call(this, a, "publishOn"), this
5996 }, a.subscribable.fn.subscribeTo = function (e, f, g) {
5997 var h, i, j, k = this;
5998 return "function" == typeof f ? g = f : h = f, e && a.isWriteableObservable(this) && (d.call(this, e, "subscribeTo"), j = function (a) {
5999 k(g ? g.call(k, a) : a)
6000 }, this.postboxSubs[e].subscribeTo = b.subscribe(e, j), h && (i = b.topicCache[e], i !== c && j(i.value))), this
6001 }, a.subscribable.fn.unsubscribeFrom = function (a) {
6002 return d.call(this, a, "subscribeTo"), this
6003 }, a.subscribable.fn.syncWith = function (a, b, c, d) {
6004 return this.subscribeTo(a, b).publishOn(a, c, d), this
6005 }, a.postbox = b
6006 }), define("knockoutLoader", ["require", "knockout", "underscoreLoader", "jqueryLoader", "URI", "marked", "truncate", "burry", "punycode", "riotbar", "knockoutMapping", "knockoutPostbox"], function (a, b, c, d, e, f, g, h, i) {
6007 function j(a, b, c) {
6008 Riot.DDragon.addApp(["profileicon"], function () {
6009 var e = Riot.DDragon.useModel("profileicon").getImg(a, b, !0);
6010 d(c).html(e)
6011 })
6012 }
6013 return b.bindingHandlers.autoExpandTextArea = {
6014 init: function (a) {
6015 d(a).expanding(), d(a).hasClass("body") || d(a).css("overflow", "hidden"), setTimeout(function () {
6016 d(a).change()
6017 }, 1)
6018 }
6019 }, b.bindingHandlers.stopOuterBindings = {
6020 init: function (a, c) {
6021 var d = b.utils.unwrapObservable(c());
6022 return {
6023 controlsDescendantBindings: d
6024 }
6025 }
6026 }, b.bindingHandlers.accordianElement = {
6027 init: function (a, c) {
6028 var e = b.utils.unwrapObservable(c());
6029 d(a).click(function () {
6030 return d(this).toggleClass("isMinimized"), d(e).slideToggle(), !1
6031 })
6032 }
6033 }, b.bindingHandlers.defaultTextAreaCommentValue = {
6034 init: function (a, c) {
6035 var e = b.utils.unwrapObservable(c());
6036 d(a).focus(function () {
6037 d(a).val() == e && d(a).val("")
6038 }), d(a).blur(function () {
6039 "" === d(a).val() && d(a).val(e)
6040 })
6041 }
6042 }, b.bindingHandlers.relativeTimestamp = {
6043 update: function (a) {
6044 d(a).timeago()
6045 }
6046 }, b.bindingHandlers.fadable = {
6047 update: function (a, e) {
6048 var f = b.utils.unwrapObservable(e());
6049 f === !0 && c.delay(function () {
6050 d(a).fadeOut()
6051 }, 3e3)
6052 }
6053 }, b.bindingHandlers.truncate = {
6054 update: function (a, c, e) {
6055 var f = b.utils.unwrapObservable(c());
6056 if ("number" == typeof f) {
6057 var h = d(a).text(),
6058 i = g(h, f);
6059 d(a).text(i)
6060 }
6061 }
6062 }, b.bindingHandlers.truncateHtml = {
6063 update: function (a, c, e) {
6064 var f = b.utils.unwrapObservable(c());
6065 if ("number" == typeof f) {
6066 var h = d(a).html(),
6067 i = g(h, f);
6068 d(a).html(i)
6069 }
6070 }
6071 }, b.bindingHandlers.truncateFilter = {
6072 update: function (a, c, e, f, h) {
6073 h.callback = function () {
6074 var b = d(a).html(),
6075 c = b.replace(/<blockquote>[\s\S]*<\/blockquote>/g, ""),
6076 e = g(c, 120);
6077 d(a).html(e)
6078 }, b.bindingHandlers.markdownFilter.update(a, c, e, f, h)
6079 }
6080 }, b.bindingHandlers.enforceMaxLength = {
6081 update: function (a, c) {
6082 var d = b.utils.unwrapObservable(c());
6083 d && a.maxlength && a.value > a.maxlength && (a.value = a.value.substring(0, a.maxlength))
6084 }
6085 }, b.bindingHandlers.matchWidthOfElement = {
6086 init: function (a, c) {
6087 var e = b.unwrap(c());
6088 d(window).resize(function () {
6089 siblingWidth = d(a).siblings(e).css("width"), d(a).css({
6090 width: siblingWidth
6091 })
6092 })
6093 }
6094 }, b.bindingHandlers.stickToTopOfSidebar = {
6095 init: function (a) {
6096 var b = null,
6097 c = !1,
6098 e = d("#pvpnet-bar").filter(":visible").outerHeight() || 0;
6099 e += 10;
6100 var f = function (a) {
6101 b || (b = d(a).offset().top);
6102 var f = d("#page-main"),
6103 g = f.outerHeight(),
6104 h = d("#sidebar").outerHeight(),
6105 i = d("#sidebar").offset().left,
6106 j = d(document).scrollTop(),
6107 k = d(document).scrollLeft(),
6108 l = f.outerHeight(),
6109 m = f.position().top,
6110 n = parseInt(m + l),
6111 o = d(a).outerHeight(),
6112 p = (parseInt(d(a).offset().top - j), parseInt(d(a).css("marginBottom").replace("px", ""))),
6113 q = parseInt(b - j),
6114 r = parseInt(n - j - e);
6115 e >= q && r > o + p && g > h ? (d(a).css({
6116 position: "fixed",
6117 top: e + "px",
6118 left: i - k + "px"
6119 }), c = !1) : e >= q && g > h ? (d(a).css({
6120 position: "fixed",
6121 top: r - o + e - p + "px",
6122 left: i - k + "px"
6123 }), c = !1) : c === !1 && (d(a).css({
6124 position: "",
6125 top: ""
6126 }), c = !0)
6127 };
6128 d(window).on("load", function () {
6129 d(a).filter(":visible").each(function (a, b) {
6130 d(window).scroll(function () {
6131 f(b)
6132 }), d("#page-main").on("click", function () {
6133 f(b)
6134 }), d(window).on("resize", function () {
6135 f(b)
6136 })
6137 })
6138 })
6139 }
6140 }, b.bindingHandlers.uberInlineFilter = {
6141 update: function (a, c, d, e, f) {
6142 f.callback = function () {
6143 f.callback = function () {
6144 f.callback = function () {
6145 f.callback = null
6146 }, b.bindingHandlers.metaTagFilter.update(a, c, d, e, f)
6147 }, b.bindingHandlers.oembedInlineFilter.update(a, c, d, e, f)
6148 }, b.bindingHandlers.markdownFilter.update(a, c, d, e, f)
6149 }
6150 }, b.bindingHandlers.uberFilter = {
6151 update: function (a, c, d, e, f) {
6152 f.callback = function () {
6153 f.callback = function () {
6154 f.callback = function () {
6155 f.callback = null
6156 }, b.bindingHandlers.metaTagFilter.update(a, c, d, e, f)
6157 }, b.bindingHandlers.oembedFilter.update(a, c, d, e, f)
6158 }, b.bindingHandlers.markdownFilter.update(a, c, d, e, f)
6159 }
6160 }, b.bindingHandlers.markdownFilter = {
6161 update: function (a, e, g, h, j) {
6162 var k, l = e(),
6163 m = (g(), b.utils.unwrapObservable(l)),
6164 n = c.isFunction(m) ? m() : m;
6165 Riot.DDragon.addApp(["champion", "summoner", "item"], function () {
6166 var b = new f;
6167 h && h.user && c.isFunction(h.user.isRioter) && h.user.isRioter() === !0 ? (b.setOptions({
6168 riotRioterFlavoredMarkdown: !0
6169 }), k = b.parse(n), b.setOptions({
6170 riotRioterFlavoredMarkdown: !1
6171 })) : (b.setOptions({
6172 riotRioterFlavoredMarkdown: !1
6173 }), k = b.parse(n)), d(a).addClass("markdown"), d(a).html(k);
6174 var e = Array("riotgames.com", "leagueoflegends.com", "lolesports.com", "api.pvp.net");
6175 d(a).find("A").each(function () {
6176 d(this).attr("href", c.escape(d(this).attr("href")));
6177 var a = document.createElement("a"),
6178 b = i.toASCII(d(this).attr("href"));
6179 b && "xn" === b.substring(0, 2) && (d(this).attr("href", b), d(this).text(b)), a.href = d(this).attr("href");
6180 var f = !1;
6181 e.forEach(function (b, c, d) {
6182 var e = a.host,
6183 g = b.replace(".", "\\."),
6184 h = "^" + g + "$",
6185 i = "\\." + g + "$";
6186 return e.match(h) || e.match(i) ? void(f = !0) : void 0
6187 }), f || d(this).addClass("unsafe-link-filter")
6188 }), j.hasOwnProperty("callback") && c.isFunction(j.callback) && j.callback()
6189 })
6190 }
6191 }, b.bindingHandlers.metaTagFilter = {
6192 update: function (a, b, c, e, f) {
6193 var g, h = Riot.Sandworm.getLang().substr(0, 2);
6194 d(a).find(".markdown-meta-quoted").each(function () {
6195 g = "/" + h + "/f/" + d(this).attr("data-application-id") + "/d/" + d(this).attr("data-discussion-id"), d(this).attr("data-comment-id") && (g += "?comment=" + d(this).attr("data-comment-id")), d(this).html('<a href="' + g + '">' + d(this).attr("data-name") + " (" + d(this).attr("data-realm") + ')</a> - <span class="timeago" title="' + d(this).attr("data-timestamp") + '"></span>').show().find(".timeago").timeago()
6196 })
6197 }
6198 }, b.bindingHandlers.oembedFilter = {
6199 update: function (a, b, f, g, h) {
6200 d.embedly.defaults = {
6201 key: d('input#embedly_key[type="hidden"]').val(),
6202 query: {
6203 maxwidth: 425,
6204 image_width: 425
6205 },
6206 display: d.noop,
6207 oembedApiUrl: window.location.host + "/api/embedly",
6208 imageApiUrl: window.mediaCfg.host + "/api/embedly",
6209 secure: !0
6210 }, d(a).embedly({
6211 display: function (a) {
6212 if (c.isUndefined(a.original_url) || c.isUndefined(a.provider_name) || c.isUndefined(a.type)) return !0;
6213 var b = d("<div class='content'>");
6214 if ("photo" === a.type) {
6215 var f = new e(a.url);
6216 f.setQuery({
6217 height: "800",
6218 width: "425"
6219 });
6220 var g = d('<img class="oembed">');
6221 g.addClass(a.provider_name.toLowerCase()), g.attr("src", f), b.append(g)
6222 } else if ("rich" === a.type || "video" === a.type) "Google Docs" !== a.provider_name && b.append(a.html);
6223 else {
6224 if ("link" !== a.type || "Imgur" !== a.provider_name) return;
6225 var h = a.thumbnail_url ? a.thumbnail_url : a.url,
6226 f = new e(a.thumbnail_url);
6227 f.setQuery({
6228 height: "425"
6229 });
6230 var g = d('<img class="oembed">');
6231 g.addClass(a.provider_name.toLowerCase()), g.attr("src", f), b.append(g)
6232 }
6233 d(this).addClass("safe"), d(this).attr({
6234 href: "#oembed-content-modal",
6235 "data-toggle": "modal"
6236 }), d(this).off("click"), d(this).on("click", function (c) {
6237 c.preventDefault();
6238 var e = d("#oembed-content-modal");
6239 d(e).find("h2").html(a.title), d(e).find(".content").html(b.html()), d(e).find(".provider-name").html(a.provider_name), d(e).find("a.offsite-link-url").attr({
6240 href: a.original_url
6241 }), d(e).find("span.unsafe-link-url").html(a.original_url)
6242 });
6243 var h = a.thumbnail_url ? a.thumbnail_url : a.url,
6244 i = new e(h);
6245 i.setQuery({
6246 width: "150"
6247 });
6248 var j = d('<img class="oembed">');
6249 if (j.addClass(a.provider_name.toLowerCase()), j.attr("src", i), d(this).html(j), "video" === a.type) d(this).addClass("video-thumb-link"), d(this).prepend('<span class="oembed-video-icon"></span>');
6250 else if ("rich" === a.type && ("Google Docs" === a.provider_name || "Adobe" === a.provider_name)) {
6251 console.log(a), j.remove();
6252 var k;
6253 d("#oembed-content-modal");
6254 k = a.title ? a.title : a.original_url, d(this).append(k), d(this).attr("title", a.original_url), d(this).attr("target", "_blank")
6255 }
6256 }
6257 }), h.hasOwnProperty("callback") && c.isFunction(h.callback) && h.callback()
6258 }
6259 }, b.bindingHandlers.oembedInlineFilter = {
6260 update: function (a, b, f, g, h) {
6261 d.embedly.defaults = {
6262 key: d('input#embedly_key[type="hidden"]').val(),
6263 query: {
6264 maxwidth: 425,
6265 image_width: 425
6266 },
6267 display: d.noop,
6268 oembedApiUrl: window.location.host + "/api/embedly",
6269 imageApiUrl: window.mediaCfg.host + "/api/embedly",
6270 secure: !0
6271 }, d(a).embedly({
6272 display: function (a) {
6273 if (c.isUndefined(a.original_url) || c.isUndefined(a.provider_name) || c.isUndefined(a.type)) return !0;
6274 if ("photo" === a.type) {
6275 var b = new e(a.url);
6276 b.setQuery({
6277 width: "425"
6278 });
6279 var f = d('<img class="oembed">');
6280 f.addClass(a.provider_name.toLowerCase()), f.attr("src", b), d(this).html(f)
6281 } else if ("rich" === a.type || "video" === a.type) d(this).html(a.html);
6282 else {
6283 if ("link" !== a.type || "Imgur" !== a.provider_name) return;
6284 var b = new e(a.thumbnail_url);
6285 b.setQuery({
6286 width: "425"
6287 });
6288 var f = d('<img class="oembed">');
6289 f.addClass(a.provider_name.toLowerCase()), f.attr("src", b), d(this).html(f)
6290 }
6291 }
6292 }), h.hasOwnProperty("callback") && c.isFunction(h.callback) && h.callback()
6293 }
6294 }, b.bindingHandlers.fullProfileIcon = {
6295 update: function (a, e, f, g, h) {
6296 var i = e(),
6297 k = (f(), b.utils.unwrapObservable(i)),
6298 l = c.isFunction(k) ? k() : k;
6299 j(l, {
6300 src: "full"
6301 }, d(a))
6302 }
6303 }, b.bindingHandlers.tinyProfileIcon = {
6304 update: function (a, e, f, g, h) {
6305 var i = e(),
6306 k = (f(), b.utils.unwrapObservable(i)),
6307 l = c.isFunction(k) ? k() : k;
6308 j(l, {
6309 src: "sprite",
6310 size: "tiny"
6311 }, d(a))
6312 }
6313 }, b.bindingHandlers.onloadRFMarkdownToolbar = {
6314 init: function (a) {
6315 var b = jQuery(a);
6316 b.on("apollo:widget:started", function () {
6317 var a = b.closest(".form-container"),
6318 c = a.find("div.rfmtoolbar"),
6319 d = a.find(".bottom-bar .right");
6320 d.prepend(c)
6321 })
6322 }
6323 }, b.bindingHandlers.replyRFMarkdownToolbar = {
6324 init: function (a) {
6325 var c = jQuery(a);
6326 c.attr("data-apollo-widget", "toolbar"), b.bindingHandlers.onloadRFMarkdownToolbar.init(a), Riot.Apollo.attach(c.parent())
6327 }
6328 }, b.pluploader = {
6329 viewModel: function (a) {
6330 var e = this;
6331 c.extend(this, a), this.element = {}, this._uploadQueue = {}, this.tooManyUploadsError = b.observable(!1), this.getUploadQueue = function () {
6332 return e._uploadQueue
6333 }, this.load = function () {
6334 d(e.element).pluploadQueue({
6335 runtimes: "html5, flash",
6336 url: "https://" + window.amazonS3Settings.bucketPath + ".s3.amazonaws.com",
6337 flash_swf_url: "/plupload/plupload.flash.swf",
6338 max_file_size: "5mb",
6339 unique_names: !1,
6340 multiple_queues: !0,
6341 max_file_count: 4,
6342 rename: !0,
6343 filters: [{
6344 title: "Text files",
6345 extensions: "txt"
6346 }, {
6347 title: "Replay files",
6348 extensions: "rofl"
6349 }, {
6350 title: "R3D Logs",
6351 extensions: "r3d"
6352 }, {
6353 title: "JPG Images",
6354 extensions: "jpg"
6355 }, {
6356 title: "JPEG Images",
6357 extensions: "jpeg"
6358 }, {
6359 title: "PNG Images",
6360 extensions: "png"
6361 }, {
6362 title: "LOG files",
6363 extensions: "log"
6364 }],
6365 preinit: {
6366 UploadFile: function (a, b) {
6367 a.settings.multipart_params = {
6368 key: e[b.name].key,
6369 filename: b.name,
6370 AWSAccessKeyId: window.amazonS3Settings.accessKey,
6371 acl: window.amazonS3Settings.acl,
6372 policy: e[b.name].policy,
6373 signature: e[b.name].signature,
6374 success_action_status: "201",
6375 "Content-Type": e[b.name]["content-type"]
6376 }
6377 }
6378 },
6379 init: {
6380 FilesAdded: function (a, b) {
6381 plupload.each(b, function (b) {
6382 b.name = b.name.replace(/[\s']/g, ""), e.totalFilesAdded++, e.totalFilesAdded < e.maxFiles ? e.signThenUpload(b, a) : e.totalFilesAdded == e.maxFiles ? (d("#uploader a.plupload_add").hide("slow"), e.signThenUpload(b, a)) : (e.tooManyUploadsError(!0), a.removeFile(b))
6383 })
6384 },
6385 FilesRemoved: function (a, b) {
6386 plupload.each(b, function (a) {
6387 e.totalFilesAdded--, e.totalFilesAdded < e.maxFiles && d("#uploader a.plupload_add").fadeIn("slow")
6388 })
6389 },
6390 FileUploaded: function (a, b, c) {
6391 var f = d.parseXML(c.response),
6392 g = d(f).find("Location").text();
6393 b.url = g.replace(/%2F/g, "/"), e.setUrls(a), e.totalFilesUploaded++
6394 }
6395 }
6396 }), e._uploadQueue = d(e.element).pluploadQueue(), d(e.element).on("click", "#uploader_filelist .plupload_done .plupload_file_action a", function (a) {
6397 a.preventDefault();
6398 var b = d(this).closest("li.plupload_done"),
6399 c = e._uploadQueue,
6400 f = c.getFile(b.attr("id"));
6401 f && (c.removeFile(f), e.totalFilesUploaded--, e.setUrls(c))
6402 })
6403 }, this.signThenUpload = function (a, b) {
6404 d.ajax({
6405 url: "/sign_upload",
6406 type: "post",
6407 data: {
6408 file: a.name
6409 },
6410 success: function (a) {
6411 e[a.file] = {
6412 key: a.key,
6413 policy: a.policy,
6414 signature: a.signature,
6415 "content-type": a["content-type"]
6416 }, b.start()
6417 },
6418 error: function (a, b, c) {}
6419 })
6420 }, this.setUrls = function (a) {
6421 var b = [],
6422 c = 0;
6423 plupload.each(a.files, function (a) {
6424 a.status == plupload.DONE && (b.push('<input type="hidden" name="uploader_' + c + '_url" value="' + a.url + '"/>'), c++)
6425 }), d("#uploader-urls").html(b.join(""))
6426 }, this.destroy = function () {
6427 this._uploadQueue.destroy()
6428 }
6429 }
6430 }, b.bindingHandlers.pluploader = {
6431 init: function (a, b, c, e, f) {
6432 var g = b(),
6433 h = d(a);
6434 g.element = a,
6435 function i() {
6436 h.is(":visible") ? (g.load(), e.hasOwnProperty("postPluploadLoad") && e.postPluploadLoad(g.getUploadQueue())) : setTimeout(i, 100)
6437 }()
6438 }
6439 }, b.bindingHandlers.rundownFilter = {
6440 update: function (a, c, e, f, g) {
6441 g.callback = function () {
6442 g.callback = function () {
6443 g.callback = function () {
6444 setTimeout(function () {
6445 var b = d(a);
6446 b.outerHeight() > 170 && f.isCollapsed(!0)
6447 }, 300)
6448 }
6449 }, b.bindingHandlers.oembedFilter.update(a, c, e, f, g)
6450 }, b.bindingHandlers.markdownFilter.update(a, c, e, f, g)
6451 }
6452 }, b
6453 }), define("riot", [], function (a) {
6454 var b = window.Riot || {};
6455 return b.getCookie = b.getCookie || function () {
6456 return !1
6457 }, b.DDragon = b.DDragon || {
6458 addApp: function () {},
6459 useModel: function () {}
6460 }, b.Sandworm = b.Sandworm || {
6461 getLang: function () {
6462 return ""
6463 },
6464 getRegion: function () {
6465 return ""
6466 },
6467 cookies: {
6468 token: null
6469 },
6470 pvpnetMenus: {
6471 show: function () {}
6472 }
6473 }, b
6474 }), define("i18n/timeago_cs_CZ", [], function () {
6475 "use strict";
6476 return {
6477 prefixAgo: "před",
6478 prefixFromNow: null,
6479 suffixAgo: null,
6480 suffixFromNow: null,
6481 seconds: "méně než minutou",
6482 minute: "minutou",
6483 minutes: "%d minutami",
6484 hour: "hodinou",
6485 hours: "%d hodinami",
6486 day: "1 dnem",
6487 days: "%d dny",
6488 month: "1 měsícem",
6489 months: "%d měsíci",
6490 year: "1 rokem",
6491 years: "%d roky"
6492 }
6493 }), define("i18n/timeago_de_DE", [], function () {
6494 "use strict";
6495 return {
6496 prefixAgo: null,
6497 prefixFromNow: null,
6498 suffixAgo: "",
6499 suffixFromNow: "ab jetzt",
6500 seconds: "vor weniger als 1 Minute",
6501 minute: "vor etwa einer Minute",
6502 minutes: "vor %d Minuten",
6503 hour: "vor etwa einer Stunde",
6504 hours: "vor etwa %d Stunden",
6505 day: "vor einem Tag",
6506 days: "vor %d Tagen",
6507 month: "vor etwa einem Monat",
6508 months: "vor %d Monaten",
6509 year: "vor etwa einem Jahr",
6510 years: "vor %d Jahren"
6511 }
6512 }), define("i18n/timeago_el_GR", [], function () {
6513 "use strict";
6514 return {
6515 prefixAgo: null,
6516 prefixFromNow: null,
6517 suffixAgo: "πριν",
6518 suffixFromNow: "από τώρα",
6519 seconds: "λιγότερο από ένα λεπτό",
6520 minute: "περίπου ένα λεπτό",
6521 minutes: "%d λεπτά",
6522 hour: "περίπου μία ώρα",
6523 hours: "περίπου %d ώρες",
6524 day: "μία ημέρα",
6525 days: "%d ημέρες",
6526 month: "περίπου ένα μήνα",
6527 months: "%d μήνες",
6528 year: "περίπου ένα χρόνο",
6529 years: "%d χρόνια"
6530 }
6531 }), define("i18n/timeago_en_AU", [], function () {
6532 "use strict";
6533 return {
6534 prefixAgo: null,
6535 prefixFromNow: null,
6536 suffixAgo: "ago",
6537 suffixFromNow: "from now",
6538 seconds: "less than a minute",
6539 minute: "about a minute",
6540 minutes: "%d minutes",
6541 hour: "about an hour",
6542 hours: "about %d hours",
6543 day: "a day",
6544 days: "%d days",
6545 month: "about a month",
6546 months: "%d months",
6547 year: "about a year",
6548 years: "%d years",
6549 wordSeparator: " ",
6550 numbers: []
6551 }
6552 }), define("i18n/timeago_en_GB", [], function () {
6553 "use strict";
6554 return {
6555 prefixAgo: null,
6556 prefixFromNow: null,
6557 suffixAgo: "ago",
6558 suffixFromNow: "from now",
6559 seconds: "less than a minute",
6560 minute: "about a minute",
6561 minutes: "%d minutes",
6562 hour: "about an hour",
6563 hours: "about %d hours",
6564 day: "a day",
6565 days: "%d days",
6566 month: "about a month",
6567 months: "%d months",
6568 year: "about a year",
6569 years: "%d years"
6570 }
6571 }), define("i18n/timeago_en_PL", [], function () {
6572 "use strict";
6573 return {
6574 prefixAgo: null,
6575 prefixFromNow: null,
6576 suffixAgo: "ago",
6577 suffixFromNow: "from now",
6578 seconds: "less than a minute",
6579 minute: "about a minute",
6580 minutes: "%d minutes",
6581 hour: "about an hour",
6582 hours: "about %d hours",
6583 day: "a day",
6584 days: "%d days",
6585 month: "about a month",
6586 months: "%d months",
6587 year: "about a year",
6588 years: "%d years",
6589 wordSeparator: " ",
6590 numbers: []
6591 }
6592 }), define("i18n/timeago_en_US", [], function () {
6593 "use strict";
6594 return {
6595 prefixAgo: null,
6596 prefixFromNow: null,
6597 suffixAgo: "ago",
6598 suffixFromNow: "from now",
6599 seconds: "less than a minute",
6600 minute: "about a minute",
6601 minutes: "%d minutes",
6602 hour: "about an hour",
6603 hours: "about %d hours",
6604 day: "a day",
6605 days: "%d days",
6606 month: "about a month",
6607 months: "%d months",
6608 year: "about a year",
6609 years: "%d years"
6610 }
6611 }), define("i18n/timeago_es_AR", [], function () {
6612 "use strict";
6613 return {
6614 prefixAgo: "hace",
6615 prefixFromNow: "dentro de",
6616 suffixAgo: "",
6617 suffixFromNow: "",
6618 seconds: "menos de un minuto",
6619 minute: "un minuto",
6620 minutes: "unos %d minutos",
6621 hour: "una hora",
6622 hours: "%d horas",
6623 day: "un día",
6624 days: "%d días",
6625 month: "un mes",
6626 months: "%d meses",
6627 year: "un año",
6628 years: "%d años"
6629 }
6630 }), define("i18n/timeago_es_ES", [], function () {
6631 "use strict";
6632 return {
6633 prefixAgo: "hace",
6634 prefixFromNow: "dentro de",
6635 suffixAgo: "",
6636 suffixFromNow: "",
6637 seconds: "menos de un minuto",
6638 minute: "un minuto",
6639 minutes: "unos %d minutos",
6640 hour: "una hora",
6641 hours: "%d horas",
6642 day: "un día",
6643 days: "%d días",
6644 month: "un mes",
6645 months: "%d meses",
6646 year: "un año",
6647 years: "%d años"
6648 }
6649 }), define("i18n/timeago_es_MX", [], function () {
6650 "use strict";
6651 return {
6652 prefixAgo: "hace",
6653 prefixFromNow: "desde ahora",
6654 suffixAgo: null,
6655 suffixFromNow: "desde ahora",
6656 seconds: "menos de un minuto",
6657 minute: "aprox. un minuto",
6658 minutes: "%d minutos",
6659 hour: "aprox. una hora",
6660 hours: "aprox %d horas",
6661 day: "un día",
6662 days: "%d días",
6663 month: "un mes",
6664 months: "%d meses",
6665 year: "aprox. un año",
6666 years: "%d años"
6667 }
6668 }), define("i18n/timeago_fr_FR", [], function () {
6669 "use strict";
6670 return {
6671 prefixAgo: "il y a",
6672 prefixFromNow: "d'ici",
6673 seconds: "moins d'une minute",
6674 minute: "environ une minute",
6675 minutes: "environ %d minutes",
6676 hour: "environ une heure",
6677 hours: "environ %d heures",
6678 day: "environ un jour",
6679 days: "environ %d jours",
6680 month: "environ un mois",
6681 months: "environ %d mois",
6682 year: "un an",
6683 years: "%d ans"
6684 }
6685 }), define("i18n/timeago_hu_HU", [], function () {
6686 "use strict";
6687 return {
6688 prefixAgo: null,
6689 prefixFromNow: null,
6690 suffixAgo: null,
6691 suffixFromNow: null,
6692 seconds: "kevesebb mint egy perce",
6693 minute: "körülbelül egy perce",
6694 minutes: "%d perce",
6695 hour: "körülbelül egy órája",
6696 hours: "körülbelül %d órája",
6697 day: "körülbelül egy napja",
6698 days: "%d napja",
6699 month: "körülbelül egy hónapja",
6700 months: "%d hónapja",
6701 year: "körülbelül egy éve",
6702 years: "%d éve"
6703 }
6704 }), define("i18n/timeago_it_IT", [], function () {
6705 "use strict";
6706 return {
6707 suffixAgo: "fa",
6708 suffixFromNow: "da ora",
6709 seconds: "meno di un minuto",
6710 minute: "circa un minuto",
6711 minutes: "%d minuti",
6712 hour: "circa un'ora",
6713 hours: "circa %d ore",
6714 day: "un giorno",
6715 days: "%d giorni",
6716 month: "circa un mese",
6717 months: "%d mesi",
6718 year: "circa un anno",
6719 years: "%d anni"
6720 }
6721 }), define("i18n/timeago_ja_JP", [], function () {
6722 "use strict";
6723 return {
6724 prefixAgo: null,
6725 prefixFromNow: null,
6726 suffixAgo: "前",
6727 suffixFromNow: "今後",
6728 seconds: "1分以内",
6729 minute: "1分",
6730 minutes: "%d分",
6731 hour: "1時間",
6732 hours: "%d時間",
6733 day: "1日",
6734 days: "%d日",
6735 month: "1ヶ月",
6736 months: "%dヶ月",
6737 year: "1年",
6738 years: "%d年"
6739 }
6740 }), define("i18n/timeago_pl_PL", [], function () {
6741 "use strict";
6742
6743 function a(a, b, c) {
6744 var d = a % 10;
6745 return d > 1 && 5 > d && (a > 20 || 10 > a) ? b : c
6746 }
6747 return {
6748 prefixAgo: null,
6749 prefixFromNow: "za",
6750 suffixAgo: "temu",
6751 suffixFromNow: null,
6752 seconds: "mniej niż minutę",
6753 minute: "minutę",
6754 minutes: function (b) {
6755 return a(b, "%d minuty", "%d minut")
6756 },
6757 hour: "godzinę",
6758 hours: function (b) {
6759 return a(b, "%d godziny", "%d godzin")
6760 },
6761 day: "dzień",
6762 days: "%d dni",
6763 month: "miesiąc",
6764 months: function (b) {
6765 return a(b, "%d miesiące", "%d miesięcy")
6766 },
6767 year: "rok",
6768 years: function (b) {
6769 return a(b, "%d lata", "%d lat")
6770 }
6771 }
6772 }), define("i18n/timeago_pt_BR", [], function () {
6773 "use strict";
6774 return {
6775 suffixAgo: "atrás",
6776 suffixFromNow: "a partir de agora",
6777 seconds: "menos de um minuto",
6778 minute: "cerca de um minuto",
6779 minutes: "%d minutos",
6780 hour: "cerca de uma hora",
6781 hours: "cerca de %d horas",
6782 day: "um dia",
6783 days: "%d dias",
6784 month: "cerca de um mês",
6785 months: "%d meses",
6786 year: "cerca de um ano",
6787 years: "%d anos"
6788 }
6789 }), define("i18n/timeago_ro_RO", [], function () {
6790 "use strict";
6791 return {
6792 prefixAgo: "acum",
6793 prefixFromNow: "in timp de",
6794 suffixAgo: "",
6795 suffixFromNow: "",
6796 seconds: "mai putin de un minut",
6797 minute: "un minut",
6798 minutes: "%d minute",
6799 hour: "o ora",
6800 hours: "%d ore",
6801 day: "o zi",
6802 days: "%d zile",
6803 month: "o lună",
6804 months: "%d luni",
6805 year: "un an",
6806 years: "%d ani"
6807 }
6808 }), define("i18n/timeago_ru_RU", [], function () {
6809 "use strict";
6810
6811 function a(a, b, c, d) {
6812 var e = a % 10;
6813 return 1 == e && (1 == a || a > 20) ? b : e > 1 && 5 > e && (a > 20 || 10 > a) ? c : d
6814 }
6815 return {
6816 prefixAgo: null,
6817 prefixFromNow: "через",
6818 suffixAgo: "назад",
6819 suffixFromNow: null,
6820 seconds: "меньше минуты",
6821 minute: "минуту",
6822 minutes: function (b) {
6823 return a(b, "%d минута", "%d минуты", "%d минут")
6824 },
6825 hour: "час",
6826 hours: function (b) {
6827 return a(b, "%d час", "%d часа", "%d часов")
6828 },
6829 day: "день",
6830 days: function (b) {
6831 return a(b, "%d день", "%d дня", "%d дней")
6832 },
6833 month: "месяц",
6834 months: function (b) {
6835 return a(b, "%d месяц", "%d месяца", "%d месяцев")
6836 },
6837 year: "год",
6838 years: function (b) {
6839 return a(b, "%d год", "%d года", "%d лет")
6840 }
6841 }
6842 }), define("i18n/timeago_tr_TR", [], function () {
6843 "use strict";
6844 return {
6845 suffixAgo: "önce",
6846 suffixFromNow: null,
6847 seconds: "1 dakikadan",
6848 minute: "1 dakika",
6849 minutes: "%d dakika",
6850 hour: "1 saat",
6851 hours: "%d saat",
6852 day: "1 gün",
6853 days: "%d gün",
6854 month: "1 ay",
6855 months: "%d ay",
6856 year: "1 yıl",
6857 years: "%d yıl"
6858 }
6859 }), define("i18n/translator", ["require", "jqueryLoader", "underscoreLoader", "./timeago_cs_CZ", "./timeago_de_DE", "./timeago_el_GR", "./timeago_en_AU", "./timeago_en_GB", "./timeago_en_PL", "./timeago_en_US", "./timeago_es_AR", "./timeago_es_ES", "./timeago_es_MX", "./timeago_fr_FR", "./timeago_hu_HU", "./timeago_it_IT", "./timeago_ja_JP", "./timeago_pl_PL", "./timeago_pt_BR", "./timeago_ro_RO", "./timeago_ru_RU", "./timeago_tr_TR"], function (a, b, c) {
6860 "use strict";
6861
6862 function d(c) {
6863 g = c, b.timeago.settings.strings = a("./timeago_" + c.replace(/-/g, "_"))
6864 }
6865
6866 function e() {
6867 return g
6868 }
6869
6870 function f(a) {
6871 var b = "en-US";
6872 switch (a) {
6873 case "cs":
6874 case "cs_cz":
6875 b = "cs-CZ";
6876 break;
6877 case "de":
6878 case "de_de":
6879 b = "de-DE";
6880 break;
6881 case "el":
6882 case "el_gr":
6883 b = "el-GR";
6884 break;
6885 case "en_gb":
6886 b = "en-GB";
6887 break;
6888 case "es":
6889 case "es_es":
6890 case "es_mx":
6891 b = "es-ES";
6892 break;
6893 case "fr":
6894 case "fr_fr":
6895 b = "fr-FR";
6896 break;
6897 case "hu":
6898 case "hu_hu":
6899 b = "hu-HU";
6900 break;
6901 case "it":
6902 case "it_it":
6903 b = "it-IT";
6904 break;
6905 case "ja":
6906 case "ja_jp":
6907 b = "ja-JP";
6908 break;
6909 case "pl":
6910 case "pl_pl":
6911 b = "pl-PL";
6912 break;
6913 case "pt-br":
6914 case "pt":
6915 b = "pt-BR";
6916 break;
6917 case "ro":
6918 case "ro_ro":
6919 b = "ro-RO";
6920 break;
6921 case "ru":
6922 case "ru_ru":
6923 b = "ru-RU";
6924 break;
6925 case "tr":
6926 case "tr_tr":
6927 b = "tr-TR"
6928 }
6929 d(b)
6930 }
6931 var g, h = {};
6932 return c.extend(h, {
6933 getCultureIdentifier: e,
6934 setCultureIdentifier: d,
6935 setCultureIdentifierFromPVPNetLanguageIdentifier: f
6936 })
6937 }), define("mixins/scroll_to_mixin", ["jqueryLoader"], function (a) {
6938 var b = {
6939 scrollTo: function (b) {
6940 var c = a(b);
6941 return c.size() > 0 ? (a(".scroll-to-highlighted").removeClass("scroll-to-highlighted"), a("html, body").stop().animate({
6942 scrollTop: a(c).offset().top - 10
6943 }, {
6944 easing: "easeInOutQuad",
6945 duration: 1500
6946 }).promise().done(function () {
6947 a(c).addClass("scroll-to-highlighted")
6948 }), !0) : !1
6949 }
6950 };
6951 return b
6952 }), define("lib/global_ui", ["underscoreLoader", "jqueryLoader", "URI", "burry", "../mixins/scroll_to_mixin"], function (a, b, c, d, e) {
6953 "use strict";
6954 var f = {
6955 returnToTop: {
6956 process: function () {
6957 if (!b("body").hasClass("mobile-view")) {
6958 var a = b(document).scrollTop();
6959 a > 300 ? b("#return-to-top").css("visibility", "visible") : b("#return-to-top").css("visibility", "hidden")
6960 }
6961 },
6962 startMonitoring: function () {
6963 var a = this;
6964 this.process(), b(window).on("scroll", function () {
6965 a.process()
6966 }), b(window).on("resize", function () {
6967 a.process()
6968 }), b(document).on("click", "#return-to-top", function () {
6969 b("html, body").animate({
6970 scrollTop: 0
6971 }, 400)
6972 })
6973 }
6974 },
6975 unsafeLinks: {
6976 process: function (e, f) {
6977 var g = a.escape(b(e).attr("href")),
6978 h = new d.Store("apollo:unsafeLinkFilter"),
6979 i = h.get("settings") || {};
6980 new c(g);
6981 if (!i.disabled) {
6982 f.preventDefault(), f.stopPropagation(), b("#unsafe-link-modal").find("a.offsite-link-url").attr("href", g), b("#unsafe-link-modal").find("span.unsafe-link-url").html(g);
6983 var j = b("#disable-unsafe");
6984 j.attr("data-listener") || (j.on("change", function () {
6985 i.disabled = j.is(":checked") ? !0 : !1, j.attr("disabled", !0), h.set("settings", i), i.disabled && b("a.unsafe").each(function () {
6986 var a = b(e);
6987 a.attr("href", a.attr("data-href")), a.attr("data-toggle", ""), a.removeClass("unsafe")
6988 })
6989 }), j.attr("data-listener", 1));
6990 var k = b("#unsafe-link-modal .modal-footer a[href='#unsafe-link-modal']");
6991 k.click()
6992 }
6993 },
6994 startMonitoring: function () {
6995 if (b("body").data("unsafe-link-monitor") === !0) return !1;
6996 b("body").data("unsafe-link-monitor", !0);
6997 var a = this;
6998 b("body").on("click", "a.unsafe-link-filter:not(.safe)", function (c) {
6999 a.process(b(this), c)
7000 }), b("body").on("click", ".unsafe-link-filter a:not(.safe):not(.unsafe-link-filter)", function (c) {
7001 a.process(b(this), c)
7002 })
7003 }
7004 },
7005 commentScrollCheck: {
7006 padding: 11,
7007 speed: 800,
7008 process: function (a, d) {
7009 var f = !1,
7010 g = new c(event.target.href),
7011 h = g.search(!0),
7012 i = h.comment,
7013 j = a.closest(".markdown-meta-quoted").attr("data-comment-id"),
7014 k = a.closest(".markdown-meta-quoted").attr("data-discussion-id"),
7015 l = b("#discussion").attr("data-discussion-id");
7016 if (l === k) {
7017 if (j) {
7018 var m = b("#comment-" + i);
7019 m.length > 0 && (f = m)
7020 } else f = b("#discussion .op-container");
7021 return f ? (d.preventDefault(), e.scrollTo(f), !1) : !0
7022 }
7023 return !0
7024 },
7025 startMonitoring: function () {
7026 if (b("body").data("comment-scroll-check-monitor") === !0) return !1;
7027 b("body").data("comment-scroll-check-monitor", !0);
7028 var a = this;
7029 b("body").on("click", ".markdown-meta-quoted a", function (c) {
7030 a.process(b(this), c)
7031 })
7032 }
7033 },
7034 profileWidgetShortNumbers: {
7035 processShortNumbers: function (a) {
7036 var b = jQuery(a),
7037 c = b.attr("data-short-number"),
7038 d = Riot.ShortNumbers.shrink(c);
7039 b.text(d)
7040 },
7041 startMonitoring: function () {
7042 var a = this;
7043 b("#profile-widget").find("span[data-short-number]").each(function () {
7044 a.processShortNumbers(jQuery(this))
7045 }), b("#player-profile").find("span[data-short-number]").each(function () {
7046 a.processShortNumbers(jQuery(this))
7047 })
7048 }
7049 },
7050 disableMobile: {
7051 attach: function () {
7052 var a = b("#mobile-viewport"),
7053 c = b("#mobile-stylesheet"),
7054 d = b(".column.side"),
7055 e = b(".mobile-menu-modal");
7056 b("#disable-mobile").on("click", b.proxy(function () {
7057 b("body").removeClass("mobile-view");
7058 var d = new Date(Date.now() + 31536e7);
7059 document.cookie = "disable_mobile=1;path=/;expires=" + d.toUTCString();
7060 var e = a.attr("data-full-content");
7061 a.attr({
7062 content: e
7063 });
7064 var f = c.attr("href");
7065 c.attr({
7066 href: "",
7067 "data-href": f
7068 }), b(".mobile-site-toggle").show(), this.dismiss(!1), window.scrollTo(0, 0)
7069 }, this)), b("#enable-mobile").on("click", function () {
7070 b("body").addClass("mobile-view"), d.hide();
7071 var e = new Date(Date.now() - 10);
7072 document.cookie = "disable_mobile=1;path=/;expires=" + e.toUTCString();
7073 var f = a.attr("data-mobile-content");
7074 a.attr({
7075 content: f
7076 });
7077 var g = c.attr("data-href");
7078 c.attr({
7079 href: g,
7080 "data-stylesheet": ""
7081 }), window.scrollTo(0, 0)
7082 }), b("#mobile-menu-shortcut").on("click", function () {
7083 b("body").css({
7084 "overflow-x": "hidden",
7085 height: "auto"
7086 }), e.css("height", window.document.body.offsetHeight + "px"), d.show(), setTimeout(function () {
7087 e.css({
7088 visibility: "visible",
7089 opacity: 1
7090 }), d.css("right", "0px")
7091 }, 5)
7092 }), e.on("click", b.proxy(function () {
7093 this.dismiss(!0)
7094 }, this))
7095 },
7096 dismiss: function (a) {
7097 var c = b(".column.side"),
7098 d = b(".mobile-menu-modal");
7099 b("body").css("overflow-x", "visible"), d.css({
7100 visibility: "hidden",
7101 opacity: 0
7102 }), c.css("right", "-210px"), a && setTimeout(function () {
7103 c.hide()
7104 }, 200)
7105 }
7106 }
7107 };
7108 return f
7109 }), define("mixins/lifecycle_mixin", [], function () {
7110 var a = {
7111 afterLoad: function () {}
7112 };
7113 return a
7114 }), define("lib/embedly_helper", ["jqueryLoader", "riot", "URI"], function (a, b, c) {
7115 "use strict";
7116 var d = function () {
7117 this.key = !1;
7118 var a = this,
7119 b = window.jQuery('input#embedly_key[type="hidden"]');
7120 b && b.val() && (this.key = b.val()), this.hasKey = function () {
7121 return a.key !== !1
7122 }, this.resize = function (b, c, d, e, f) {
7123 return a.imageFunction("image/resize", b, c, d, e, f)
7124 }, this.crop = function (b, c, d, e, f) {
7125 return a.imageFunction("display/crop", b, c, d, e, f)
7126 }, this.imageFunction = function (b, d, e, f, g, h) {
7127 if (!a.hasKey) return !1;
7128 if (d.match(new RegExp("^" + window.mediaCfg.host)) || d.match(/^\/api\/embedly/)) {
7129 var i = new c(d).search(!0);
7130 if (!i.hasOwnProperty("url")) return d;
7131 d = i.url
7132 }
7133 var j = window.mediaCfg.host + "/api/embedly/1/" + b + "?url=" + encodeURIComponent(d) + "&key=" + encodeURIComponent(a.key) + "&width=" + encodeURIComponent(f) + "&height=" + encodeURIComponent(e);
7134 return j += _.isString(g) ? "&errorUrl=" + encodeURIComponent(g) : "&errorUrl=" + encodeURIComponent("https://cdn.leagueoflegends.com/apollo/assets/blank.png"), _.isString(h) && (j += "&animate=" + encodeURIComponent(h)), j
7135 }
7136 };
7137 return b.EmbedlyHelper = d, d
7138 }), define("lib/http", ["jqueryLoader"], function (a) {
7139 var b = function (b, c, d, e, f) {
7140 "use strict";
7141 var e = "undefined" != typeof e ? e : function () {},
7142 f = "undefined" != typeof f ? f : function () {};
7143 a.ajax(c, {
7144 type: b,
7145 dataType: "json",
7146 data: d,
7147 success: function (a, b, c) {
7148 e(a)
7149 },
7150 error: function (a, b, c) {
7151 f && "function" == typeof f && f(c)
7152 }
7153 })
7154 };
7155 return {
7156 get: function (a, c, d, e) {
7157 b("GET", a, c, d, e)
7158 },
7159 post: function (a, c, d, e) {
7160 b("POST", a, c, d, e)
7161 },
7162 put: function (a, c, d, e) {
7163 b("PUT", a, c, d, e)
7164 },
7165 del: function (a, c, d, e) {
7166 b("DELETE", a, c, d, e)
7167 }
7168 }
7169 }), define("lib/local_storage", ["underscore"], function (a) {
7170 var b = function () {
7171 this.set = function (a, b) {
7172 window.localStorage[a] = b
7173 }, this.get = function (a) {
7174 return window.localStorage[a]
7175 }, this.hasKey = function (a) {
7176 return window.localStorage.hasOwnProperty ? window.localStorage.hasOwnProperty(a) : window.localStorage[a]
7177 }, this.match = function (a) {
7178 var b = [];
7179 for (var c in window.localStorage) c.match(a) && b.push(this.get(c));
7180 return b
7181 }
7182 };
7183 return b
7184 }), define("lib/player_history", ["underscoreLoader", "./local_storage", "riot"], function (a, b, c) {
7185 var d = function () {
7186 var a = this,
7187 c = "a.d.",
7188 d = c + "{0}_{1}";
7189 this.storage = new b, this.prepareDiscussionKey = function (a, b) {
7190 for (var c = arguments.length, e = d; c--;) e = e.replace(new RegExp("\\{" + c + "\\}", "gm"), arguments[c]);
7191 return e
7192 }, this.addDiscussion = function (b, c, d, e) {
7193 if ("undefined" != typeof JSON && JSON.hasOwnProperty("stringify")) {
7194 d = void 0 == d || null == d ? 0 : parseInt(d), void 0 == e && (e = new Date);
7195 var f = a.prepareDiscussionKey(b, c),
7196 g = {
7197 c: d,
7198 d: e.getTime()
7199 };
7200 a.storage.set(f, JSON.stringify(g))
7201 }
7202 }, this.addComment = function (b, c) {
7203 var d = a.getDiscussionVisit(b, c),
7204 e = 0;
7205 null != d && (e = parseInt(d.c)), e++, this.addDiscussion(b, c, e)
7206 }, this.getDiscussionVisit = function (b, c) {
7207 var d = a.prepareDiscussionKey(b, c),
7208 e = a.storage.get(d);
7209 return null != e ? JSON.parse(e) : null
7210 }, this.hasVisitedDiscussion = function (b, c) {
7211 var d = a.prepareDiscussionKey(b, c);
7212 return this.storage.hasKey(d)
7213 };
7214 var e = "a.lp";
7215 this.getLivePreviewState = function () {
7216 var a = this.storage.get(e);
7217 return a || (a = "on"), "on" === a
7218 }, this.setLivePreviewState = function (a) {
7219 a = a ? "on" : "off", this.storage.set(e, a)
7220 };
7221 var f = "a.fv";
7222 this.getFlatViewState = function () {
7223 var a = this.storage.get(f);
7224 return a || (a = "off"), "on" === a
7225 }, this.setFlatViewState = function (a) {
7226 a = a ? "on" : "off", this.storage.set(f, a)
7227 }
7228 };
7229 return c.PlayerHistory = d, d
7230 }), define("mixins/util_mixin", ["jqueryLoader"], function (a) {
7231 var b = {
7232 fadeInControls: function (b, c) {
7233 c.stopPropagation(), a(c.currentTarget).find(".controls").fadeTo(100, 1)
7234 },
7235 fadeOutControls: function (b, c) {
7236 c.stopPropagation(), a(c.currentTarget).find(".controls").fadeTo(100, 0)
7237 },
7238 dasherize: function (a) {
7239 var b, c = {},
7240 d = c.hasOwnProperty(a);
7241 return d ? c[a] : (b = this.decamelize(a).replace(/[ _]/g, "-"), c[a] = b, b)
7242 },
7243 decamelize: function (a) {
7244 return a.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase()
7245 },
7246 filterObjectPropertiesToArray: function (a, b) {
7247 var c, d = [];
7248 for (c in a)
7249 if (a.hasOwnProperty(c) && c.match(b)) {
7250 var e = {};
7251 e[c] = a[c], d.push(e)
7252 }
7253 return d
7254 }
7255 };
7256 return b
7257 }), define("mappers/user", ["underscore", "knockout", "../mixins/util_mixin"], function (a, b, c) {
7258 var d = {};
7259 return a.extend(d, c),
7260 function (c, e) {
7261 (a.isUndefined(c) || null === c) && (c = {}), c = a.defaults(c, {
7262 name: "Anonymous",
7263 isRioter: !1,
7264 isModerator: !1,
7265 banEndsAt: 0,
7266 lolProfileIcon: "",
7267 realm: "",
7268 team: "",
7269 groupName: "",
7270 groupColor: "",
7271 groupIcon: "",
7272 title: "",
7273 avatar: "",
7274 badges: [],
7275 profile: {},
7276 id: "",
7277 applicationsCanModerate: [],
7278 applicationBans: {}
7279 }), c.profile = c.profile || {
7280 data: {}
7281 }, c.profile.data = c.profile.data || {}, c.profile.data = a.defaults(c.profile.data, {
7282 title: "",
7283 team: "",
7284 avatar: ""
7285 }), c.title = c.profile.data.title, c.team = c.profile.data.team, c.avatar = c.profile.data.avatar, c.badges = d.filterObjectPropertiesToArray(c.profile.data, /^b_/), delete c.profile, b.mapping.fromJS(c, {
7286 badges: {
7287 create: function (b) {
7288 if (!a.isObject(b.data)) return null;
7289 var c = Object.keys(b.data)[0],
7290 d = b.data[Object.keys(b.data)[0]];
7291 return d = a.isBoolean(d) || 0 == d || 1 == d ? d : !1, {
7292 name: c,
7293 isActive: d
7294 }
7295 }
7296 }
7297 }, e)
7298 }
7299 }), define("views/user", ["underscore", "jquery", "knockout", "../mixins/util_mixin", "../mappers/user", "riot"], function (a, b, c, d, e, f) {
7300 "use strict";
7301 var g = function (b) {
7302 var d = this;
7303 this.isA = function () {
7304 return "User"
7305 }, e(b, this), this.isAuthenticated = c.computed(function () {
7306 return a.isUndefined(d.name) || !a.isString(d.name()) || "anonymous" === d.name().toLowerCase() ? !1 : !0
7307 }), this.prefixName = function (b) {
7308 var c = a.isUndefined(b) ? "" : b + " ";
7309 return c + d.name()
7310 }, this.profileUrl = c.computed(function () {
7311 var a = f.Sandworm.getLang().substr(0, 2);
7312 return "/" + a + "/player/" + d.realm() + "/" + d.name()
7313 }), this.translateRealm = function (a) {
7314 return window.i18nStrings.realms[a] ? window.i18nStrings.realms[a] : a
7315 }, this.resolvedTitle = c.computed(function () {
7316 return d.title()
7317 }), this.resolvedTeam = c.computed(function () {
7318 return d.isRioter() ? "rioters" : d.team()
7319 }), this.activeBadges = c.computed(function () {
7320 return a.filter(d.badges(), function (a) {
7321 return a.isActive
7322 })
7323 }), this.hasActiveBadges = c.computed(function () {
7324 return d.activeBadges().length > 0
7325 }), this.sortedActiveBadges = c.computed(function () {
7326 return d.activeBadges().sort(function (a, b) {
7327 return a.name === b.name ? 0 : a.name < b.name ? -1 : 1
7328 })
7329 })
7330 };
7331 return a.extend(g.prototype, d), g
7332 }), define("views/application", ["underscoreLoader", "knockoutLoader"], function (a, b) {
7333 var c = function (c) {
7334 "use strict";
7335 a.isUndefined(c) && (c = {}), c = a.defaults(c, {
7336 id: null,
7337 name: null,
7338 shortName: null,
7339 description: null,
7340 isActive: !1,
7341 isDisplayed: !1
7342 }), this.isA = function () {
7343 return "Application"
7344 }, b.mapping.fromJS(c, {
7345 key: function (a) {
7346 return b.utils.unwrapObservable(a.id)
7347 }
7348 }, this)
7349 };
7350 return c
7351 }), define("mixins/apollo_token_mixin", ["jqueryLoader"], function (a) {
7352 var b = {
7353 getApolloToken: function () {
7354 return a("#apollo-token").val()
7355 }
7356 };
7357 return b
7358 }), define("mixins/voting_mixin", ["underscoreLoader", "riot", "riotbar", "jqueryLoader", "../mixins/apollo_token_mixin"], function (a, b, c, d, e) {
7359 var f = {
7360 disableVote: !1,
7361 disableVoteMessage: null,
7362 vote: function (b) {
7363 var e = this;
7364 if (e.disableVote) return e.errorCode("403"), void e.errorMessage(e.disableVoteMessage);
7365 if (!c.account.getSummonerName()) return void c.account.login();
7366 if (e.isVoting()) return !1;
7367 e.isVoting(!0);
7368 var f = e.userVote(),
7369 g = b,
7370 h = e.downVotes(),
7371 i = e.upVotes();
7372 f == g ? e.userVote(null) : e.userVote(g), "up" == f ? e.upVotes(e.upVotes() - 1) : "down" == f && e.downVotes(e.downVotes() - 1), f !== g && ("up" == g ? e.upVotes(e.upVotes() + 1) : "down" == g && e.downVotes(e.downVotes() + 1)), d.ajax(e.apiPath() + "/vote", {
7373 type: "post",
7374 dataType: "json",
7375 data: {
7376 direction: b,
7377 apolloToken: e.getApolloToken()
7378 },
7379 success: function (a) {
7380 a && "object" == typeof a && a.voteAction != e.userVote() && e.userVote(a.voteAction)
7381 },
7382 error: function (b, c, d) {
7383 if ("object" == typeof b && b.hasOwnProperty("status") && e.errorCode(b.status), -1 != d.indexOf("anned")) {
7384 var g = e.errorCode();
7385 e.errorCode(g + " banned")
7386 } else {
7387 var j = JSON.parse(b.responseText);
7388 j.hasOwnProperty("errorCode") && ("LOW_LEVEL_VOTE_COMMENT" == j.errorCode || "LOW_LEVEL_VOTE_DISCUSSION" == j.errorCode) && (d = j.errorMessage)
7389 }
7390 d && e.errorMessage(d), a.delay(function () {
7391 e.errorMessage(null), e.errorCode(null)
7392 }, 7e3), e.userVote(f), e.downVotes(h), e.upVotes(i)
7393 },
7394 complete: function () {
7395 e.isVoting(!1)
7396 }
7397 })
7398 }
7399 };
7400 return a.extend(f, e), f
7401 }), define("mixins/modal_mixin", ["jqueryLoader"], function (a) {
7402 var b = !1,
7403 c = {
7404 createModal: function () {
7405 b = a(document.createElement("div")).addClass("apollo-modal"), a(document.body).append(b);
7406 var c = this;
7407 b.on("click", function (a) {
7408 c.clickedModal(a)
7409 })
7410 },
7411 showModal: function () {
7412 b === !1 && this.createModal();
7413 var c = a(document);
7414 b.height(c.height()), b.width(c.width()), b.show()
7415 },
7416 clickedModal: function () {
7417 this.hideModal()
7418 },
7419 hideModal: function () {
7420 b.hide()
7421 }
7422 };
7423 return c
7424 }), define("mixins/report_mixin", ["underscoreLoader", "jqueryLoader", "riot", "../mixins/modal_mixin", "../mixins/apollo_token_mixin"], function (a, b, c, d, e) {
7425 var f = {
7426 reportWidget: b(".report-widget"),
7427 reportError: b(".report-error"),
7428 position: !1,
7429 showReportWidget: function (a, c) {
7430 if (!this.reported()) {
7431 var d = this.reportWidget.find(".cancel-link"),
7432 e = this.reportWidget.find(".report-type");
7433 d.unbind(), e.unbind();
7434 var f = this;
7435 d.on("click", function () {
7436 f.hideReportWidget()
7437 }), e.on("click", function () {
7438 f.sendReport(this.getAttribute("data-value"))
7439 });
7440 var g = b(c.target),
7441 h = g.offset();
7442 h.top -= 10, h.left -= 135, this.position = h, this.reportWidget.css(h), this.reportWidget.show(), this.showModal()
7443 }
7444 },
7445 clickedModal: function (a) {
7446 this.reportWidget.hide(), this.hideModal()
7447 },
7448 hideReportWidget: function () {
7449 this.reportWidget.hide()
7450 },
7451 sendReport: function (c) {
7452 var d = this;
7453 b.ajax(d.apiPath() + "/report", {
7454 type: "post",
7455 dataType: "json",
7456 data: {
7457 type: c,
7458 apolloToken: d.getApolloToken()
7459 },
7460 success: function (a) {
7461 d.reported(!0), d.hideReportWidget(), d.hideModal()
7462 },
7463 error: function (b, c, e) {
7464 d.hideReportWidget(), d.hideModal();
7465 var f = JSON.parse(b.responseText);
7466 f.hasOwnProperty("message") && (d.reportError.find(".error-message").text(f.message), d.reportError.css(d.position), d.reportError.show(), a.delay(function () {
7467 d.reportError.fadeOut()
7468 }, 3e3))
7469 }
7470 })
7471 }
7472 };
7473 return a.extend(d, f), a.extend(d, e), d
7474 }), define("mixins/toggle_live_preview_mixin", ["knockoutLoader", "../lib/player_history"], function (a, b) {
7475 var c = function () {
7476 this.playerHistory = new b;
7477 var c = this.playerHistory.getLivePreviewState();
7478 this.livePreviewVisible = a.observable(c), this.changeLivePreviewState = function () {
7479 var a = this.livePreviewVisible(),
7480 b = !a;
7481 return this.playerHistory.setLivePreviewState(b), this.livePreviewVisible(b), !1
7482 }
7483 };
7484 return new c
7485 }), define("lib/post_messages", ["jqueryLoader", "URI"], function (a, b) {
7486 "use strict";
7487 var c = {
7488 whitelist: ["lolesports.com", "riotgames.com", "leagueoflegends.com"],
7489 registry: {},
7490 start: function () {
7491 var b = this;
7492 this.stop(), a(window).on("message", function (a) {
7493 var c = a.originalEvent,
7494 d = c.data.split(":");
7495 return c.channel = d[0], c.msg = d[1], c.channel && c.msg && b.registry[c.channel] ? (b.registry[c.channel].windowHandle && (c.windowHandle = b.registry[c.channel].windowHandle), void(b.registry[c.channel].popup && "readyVerified" === c.msg ? b.registry[c.channel].ready = !0 : b.registry[c.channel].popup || "readyCheck" !== c.msg ? b.registry[c.channel].ready && b.isValidDomain(c.origin) && b.receive(c) : (b.registry[c.channel].ready = !0, b.registry[c.channel].windowHandle = c.source, c.source.postMessage(c.channel + ":readyVerified", b.registry[c.channel].origin)))) : !1
7496 })
7497 },
7498 stop: function () {
7499 a(window).off("message")
7500 },
7501 isValidDomain: function (a, c) {
7502 for (var d = new b(a), e = !1, f = 0; f < this.whitelist.length; f++) this.whitelist[f] === d.domain() && (e = !0);
7503 return e ? !0 : (window.alert("Unauthorized Domain"), this.closeWindow(c), !1)
7504 },
7505 send: function (a, b) {
7506 this.registry[a] && this.registry[a].windowHandle.postMessage(a + ":" + b, this.registry[a].origin)
7507 },
7508 receive: function (b) {
7509 this.registry[b.channel] && a.isFunction(this.registry[b.channel][b.msg]) && this.registry[b.channel][b.msg](b)
7510 },
7511 hook: function (b, c) {
7512 var d = this;
7513 if (this.unhook(b), this.registry[b] = c, this.registry[b].ready = !1, this.registry[b].popup) {
7514 var e = window.open(this.registry[b].popup.url, this.registry[b].popup.target, this.registry[b].popup.params);
7515 if ("undefined" != typeof e && e) {
7516 this.registry[b].windowHandle = e, this.registry[b].windowHandle.focus();
7517 var f = setInterval(function () {
7518 d.registry[b].ready ? (clearInterval(f), a.isFunction(d.registry[b].initialize) && d.registry[b].initialize()) : d.registry[b].windowHandle.postMessage(b + ":readyCheck", d.registry[b].origin)
7519 }, 1500)
7520 } else this.unhook(b), window.alert("Your browser has blocked the popup. Please disable popup blockers")
7521 } else a.isFunction(d.registry[b].initialize) && d.registry[b].initialize()
7522 },
7523 unhook: function (a) {
7524 this.registry[a] && (this.closeWindow(a), delete this.registry[a])
7525 },
7526 closeWindow: function (a) {
7527 this.registry[a] && this.registry[a].windowHandle && this.registry[a].popup ? this.registry[a].windowHandle.close() : this.registry[a] && window.close()
7528 }
7529 };
7530 return c.start(), window.postMessages = c, c
7531 }), define("lib/mobile_helper", ["jqueryLoader"], function (a) {
7532 var b = {
7533 isMobileView: function () {
7534 return "none" !== a("a#disable-mobile").css("display")
7535 }
7536 };
7537 return b
7538 }), define("views/comment", ["require", "underscoreLoader", "jqueryLoader", "knockoutLoader", "riot", "./user", "./replies", "./discussion", "../mixins/voting_mixin", "../mixins/util_mixin", "../mixins/report_mixin", "../mixins/toggle_live_preview_mixin", "../mixins/apollo_token_mixin", "../mixins/scroll_to_mixin", "URI", "marked", "../lib/post_messages", "../lib/mobile_helper"], function (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) {
7539 "use strict";
7540 var s = function (g, h, i) {
7541 var j = this,
7542 k = a("./replies"),
7543 l = a("./discussion");
7544 b.isObject(h) ? this.discussion = h : this.discussion = new l, this.parentPage = i, this.isA = function () {
7545 return "Comment"
7546 }, b.isUndefined(g) && (g = {}), g = b.defaults(g, {
7547 replies: {},
7548 deleted: !1,
7549 userVote: null,
7550 downVotes: null,
7551 upVotes: null,
7552 id: null,
7553 levelsDeep: null,
7554 attachments: [],
7555 parentCommentId: null,
7556 user: {
7557 isRioter: !1
7558 }
7559 }), d.mapping.fromJS(g, {
7560 key: function (a) {
7561 return d.utils.unwrapObservable(a.id)
7562 },
7563 user: {
7564 key: function (a) {
7565 return d.utils.unwrapObservable(a.id)
7566 },
7567 create: function (a) {
7568 return new f(a.data)
7569 }
7570 },
7571 replies: {
7572 create: function (a) {
7573 return new k(a.data, j.discussion, j)
7574 }
7575 }
7576 }, this), this.toggle = function (a) {
7577 return j[a](j[a]() !== !0)
7578 }, this.hasChildren = d.computed(function () {
7579 if (j.ancestorCount() > 0) {
7580 var a = !1;
7581 return b.each(j.replies.comments(), function (b) {
7582 b.isDeleted() || (a = !0)
7583 }), a
7584 }
7585 return !1
7586 }, null, {
7587 deferEvaluation: !0
7588 }), this.hasMoreComments = d.computed(function () {
7589 return j.replies.moreCount() > 0
7590 }), this.isDeleted = d.computed(function () {
7591 return j.deleted()
7592 }), this.isMinimized = d.observable(!1), this.isCollapsed = d.observable(!1), this.isRootLevel = d.computed(function () {
7593 return j.parentCommentId() ? !1 : !0
7594 }), this.isDownVoted = d.computed(function () {
7595 return "down" === j.userVote()
7596 }), this.isUpVoted = d.computed(function () {
7597 return "up" === j.userVote()
7598 }), this.isVoting = d.observable(!1), this.isEditing = d.observable(!1), this.storedEditedContent = d.observable(""), this.showConfirmDelete = d.observable(!1), this.reporting = d.observable(!1), this.reported = d.observable(!1), this.reportErrorMessage = d.observable(null), this.canAcceptAttachments = d.computed(function () {
7599 return window.Modernizr.flash || window.Modernizr.fileinput
7600 }), this.hasAttachments = d.computed(function () {
7601 return !j.isDeleted() && b.isArray(j.attachments()) && j.attachments().length > 0
7602 }), this.isNewForViewer = d.computed(function () {
7603 var a = j.discussion.visitedDiscussion;
7604 if (b.isObject(a) && a.hasOwnProperty("d")) {
7605 var d = new Date(a.d);
7606 if (c.timeago.parse(j.createdAt()) > d) return !0
7607 }
7608 return !1
7609 }), this.isAuthoredByOriginalPoster = d.computed(function () {
7610 if (b.isObject(j.discussion)) {
7611 var a = j.user.realm() + ":" + j.user.id();
7612 if (j.user.id() === j.discussion.user.id() || j.discussion.content.hasOwnProperty("addlAuthors") && j.discussion.content.addlAuthors.hasOwnProperty(a)) return !0
7613 }
7614 return !1
7615 }, null, {
7616 deferEvaluation: !0
7617 }), this.replies.isReplying(!1), this.livePreviewVisible(!1), this.ancestorCount = d.computed(function () {
7618 return j.replies.ancestorCount()
7619 }), this.ancestorCountLabel = d.computed(function () {
7620 if (!window.hasOwnProperty("i18nStrings")) return "";
7621 var a = j.replies.ancestorCount();
7622 return "ru_RU" == e.Sandworm.getLang() ? a % 10 == 1 && a % 100 != 11 ? window.i18nStrings.comment_one.replace("%d", a) : a % 10 > 1 && 5 > a % 10 && (12 > a % 100 || a % 100 > 14) ? window.i18nStrings.comment_few.replace("%d", a) : window.i18nStrings.comment_many.replace("%d", a) : 1 == a ? window.i18nStrings.comment_one.replace("%d", a) : window.i18nStrings.comment_many.replace("%d", a)
7623 }), this.canReply = d.computed(function () {
7624 return j.levelsDeep() < j.replies.replyLimit
7625 }), this.aOrB = d.computed(function () {
7626 return j.levelsDeep() % 2 ? "b" : "a"
7627 }), this.errorCode = d.observable(null), this.errorMessage = d.observable(null), this.getUrl = function (a) {
7628 var d = new o(document.URL);
7629 d.pathname();
7630 c.isArray(a) && b.each(a, function (a) {
7631 d.removeSearch(a)
7632 });
7633 var e = d.search(!0);
7634 return "new" == e.show && d.removeSearch("show"), d.removeSearch("page"), d.removeSearch("comment"), d.addSearch("comment", j.id()), d.toString()
7635 }, this.updateUrl = function () {
7636 var a = this.getUrl();
7637 window.History.pushState(null, document.title, a)
7638 }, this.apiBasePath = function () {
7639 return "/api/" + this.discussion.application.id() + "/discussions/" + this.discussion.id() + "/comments"
7640 }, this.apiPath = function () {
7641 return this.apiBasePath() + "/" + this.id()
7642 }, this.totalVotes = d.computed(function () {
7643 return j.upVotes() - j.downVotes()
7644 }), this.totalVotesHuman = d.computed(function () {
7645 var a = j.totalVotes();
7646 return c.isNumeric(a) && a >= 1e3 ? Math.floor(a / 1e3) + "k" : a + ""
7647 }), this.lowQualityCheck = function () {
7648 var a = j.downVotes() + j.upVotes();
7649 return !j.user.isRioter() && j.downVotes() > 20 && j.downVotes() / a > .6 ? !0 : !1
7650 }, this.isLowQuality = d.observable(j.lowQualityCheck()), this.fadeInControls = function (a, b) {
7651 b.stopPropagation(), j.isMinimized() || c(b.currentTarget).find(".controls").fadeTo(100, 1)
7652 }, this.fadeOutControls = function (a, b) {
7653 b.stopPropagation(), j.isEditing() || c(b.currentTarget).find(".controls").fadeTo(100, 0)
7654 }, this.del = function (a, b) {
7655 if (b.stopPropagation(), j.user.id() === window.currentUser.id() && j.user.realm() === window.currentUser.realm()) c.ajax(j.apiPath() + "/delete", {
7656 type: "delete",
7657 dataType: "json",
7658 data: {
7659 apolloToken: j.getApolloToken()
7660 },
7661 success: function (a) {
7662 j.deleted(!0)
7663 },
7664 error: function () {}
7665 });
7666 else {
7667 var d = document.apolloModUrl,
7668 e = d + "/confirm_delete/" + j.discussion.application.id() + "/" + j.discussion.id() + "/" + j.id() + "/?origin=" + encodeURIComponent(location.href),
7669 f = "confirmDelete";
7670 q.hook(f, {
7671 origin: d,
7672 popup: {
7673 url: e,
7674 target: f,
7675 params: "width=600,height=500"
7676 },
7677 initialize: function (a) {
7678 q.send(f, "setupForm")
7679 },
7680 deleteSuccess: function (a) {
7681 q.closeWindow(f), window.location.reload()
7682 },
7683 deleteFail: function (a) {
7684 q.closeWindow(f)
7685 }
7686 })
7687 }
7688 }, this.respondToEdit = function (a, b) {
7689 b.stopPropagation(), j.replies.getComment({
7690 id: j.id(),
7691 payload: {
7692 censor_content: !1,
7693 unique_query: (new Date).getTime()
7694 }
7695 }, function (a) {
7696 j.storedEditedContent(a.message), j.toggle("isEditing")
7697 })
7698 };
7699 var m = new p;
7700 void 0 !== window.currentUser && window.currentUser.isRioter() && m.setOptions({
7701 riotRioterFlavoredMarkdown: !0
7702 }), this.markdownParsedEditedContent = d.computed(function () {
7703 return r.isMobileView() || !this.livePreviewVisible() ? this.storedEditedContent() : "" !== this.storedEditedContent() ? m.parse(this.storedEditedContent()) : void 0
7704 }, this), this.cancelEditedContent = function () {
7705 j.storedEditedContent(""), j.toggle("isEditing"), j.fadeOutControls(arguments[0], arguments[1])
7706 }, this.saveEditedContent = function () {
7707 var a = j.storedEditedContent();
7708 if (a === j.message()) return void j.isEditing(!1);
7709 if ("" !== a && j.isEditing()) {
7710 var b, d = jQuery("#discussion[data-application-locale]");
7711 b = d.attr("data-application-locale") ? d.attr("data-application-locale") : e.Sandworm.getLang() || "en_US", c.ajax("/api/" + j.discussion.application.id() + "/discussions/" + j.discussion.id() + "/comments/" + j.id() + "/updateContent", {
7712 type: "post",
7713 dataType: "json",
7714 data: {
7715 message: a,
7716 language: b,
7717 apolloToken: j.getApolloToken()
7718 },
7719 success: function (a) {
7720 a.message && (j.message(a.message), j.isEditing(!1))
7721 },
7722 error: function () {
7723 window.alert("Couldn't update the content!")
7724 }
7725 })
7726 }
7727 }, this.canPin = d.observable(j.hasOwnProperty("parentCommentId") && !j.parentCommentId()), this.isPinned = d.observable(this.discussion.content.hasOwnProperty("pinned") && this.id() === this.discussion.content.pinned()), this.pinThread = function () {
7728 var a = j.discussion.apiPath() + "/updatePinnedComment.json",
7729 b = this.isPinned() ? "DELETE" : "POST";
7730 c.ajax(a, {
7731 type: b,
7732 data: {
7733 commentId: j.id(),
7734 apolloToken: j.getApolloToken()
7735 },
7736 success: function (a) {
7737 window.location.reload()
7738 },
7739 error: function () {
7740 window.alert("Couldn't pin the thread!")
7741 }
7742 })
7743 }, this.uploaderWindow = !1, this.addAttachment = function (a, b) {
7744 b.stopPropagation();
7745 var c = b.currentTarget.href;
7746 j.uploaderWindow = window.open(c, "uploader" + Math.floor(1e4 * Math.random()), "scrollbars=no,resizable=no,menubar=no,location=no,height=265,width=475"), window.navigator.userAgent.match(/msie/i) || window.navigator.userAgent.match(/trident/i) ? window.fakePostMessage = j.fileUploaded : window.addEventListener("message", j.windowListener, j.uploaderWindow)
7747 }, this.deleteAttachment = function (a) {
7748 j.updateAttachments(null)
7749 }, this.windowListener = function (a) {
7750 a.source === j.uploaderWindow && a.data && j.fileUploaded(a.data)
7751 }, this.fileUploaded = function (a) {
7752 var b = new o(a.replace(/%2F/g, "/")).filename();
7753 j.updateAttachments([{
7754 url: a,
7755 name: decodeURIComponent(b)
7756 }]), j.uploaderWindow.close()
7757 }, this.updateAttachments = function (a) {
7758 c.ajax("/api/" + j.discussion.application.id() + "/discussions/" + j.discussion.id() + "/comments/" + j.id() + "/updateAttachments", {
7759 type: "post",
7760 dataType: "json",
7761 data: {
7762 attachments: a,
7763 apolloToken: j.getApolloToken()
7764 },
7765 success: function (a) {
7766 j.attachments(a)
7767 },
7768 error: function () {
7769 window.alert("Couldn't update the content!")
7770 }
7771 })
7772 }, this.attachListeners = function (a) {
7773 e.Apollo.attach(c(a))
7774 }, this.rioterCommentNumber = d.computed(function () {
7775 if (!j.user.isRioter()) return !1;
7776 var a = j.discussion.rioterCommentIds().indexOf(j.id());
7777 return -1 != a ? a + 1 : !1
7778 }), this.nextRioterCommentURL = d.computed(function () {
7779 var a = j.rioterCommentNumber();
7780 if (a !== !1) {
7781 a--;
7782 var b = a + 1;
7783 if (!(b >= j.discussion.totalRioterComments())) {
7784 var c = j.discussion.rioterCommentIds()[b];
7785 return "?show=flat&comment=" + c
7786 }
7787 }
7788 }), this.prevRioterCommentURL = d.computed(function () {
7789 var a = j.rioterCommentNumber() - 1;
7790 if (!(0 >= a)) {
7791 var b = a - 1,
7792 c = j.discussion.rioterCommentIds()[b];
7793 return "?show=flat&comment=" + c
7794 }
7795 })
7796 };
7797 return s.prototype = {}, b.extend(s.prototype, i), b.extend(s.prototype, j), b.extend(s.prototype, l), b.extend(s.prototype, k), b.extend(s.prototype, m), b.extend(s.prototype, n), s
7798 }), define("lib/analytics_helper", ["underscoreLoader"], function (a) {
7799 if (window.hasOwnProperty("analytics") && window.analytics.hasOwnProperty("initialize")) {
7800 analytics._integrations.hasOwnProperty("Dradis") || analytics.initialize();
7801 var b = analytics.user();
7802 if (Riot.Sandworm.getSummonerName() !== !1 && !b.id()) {
7803 var c = Riot.Sandworm.getRegion().toUpperCase(),
7804 d = document.cookie.match("PVPNET_ID_" + c + "=([0-9]*?)(;|$)"),
7805 e = d ? d[1] : void 0,
7806 f = c + "_" + e;
7807 analytics.identify(f, {
7808 summonerId: e
7809 })
7810 }
7811 var g = {
7812 messageType: "riot__apollo__boards",
7813 path: location.pathname,
7814 host: location.hostname,
7815 lang: Riot.Sandworm.getLang().replace("_", "-")
7816 },
7817 h = location.hostname.match(/\.(.*)\.leagueoflegends\.com/);
7818 return h && h[1] && (g.env = h[1].toUpperCase()), {
7819 setPii: function (a, b) {
7820 window.hasOwnProperty("dradis") && window.dradis.setPii(a, b)
7821 },
7822 pageview: function (b) {
7823 b = a.defaults(b, g), analytics.pageview(b)
7824 },
7825 track: function (b, c) {
7826 c = a.defaults(c, g), analytics.track(b, c)
7827 }
7828 }
7829 }
7830 return {
7831 pageview: function () {},
7832 track: function () {}
7833 }
7834 }), define("mappers/replies", ["underscore", "knockout", "../views/comment"], function (a, b, c) {
7835 "use strict";
7836 return function (d, e) {
7837 !a.isObject(e.discussion), a.isUndefined(d) && (d = {}), d = a.defaults(d, {
7838 ancestorCount: null,
7839 sortType: "best",
7840 moreCount: "",
7841 comments: [],
7842 hideReplies: !1,
7843 alwaysReplying: !1,
7844 noComments: !1
7845 }), b.mapping.fromJS(d, {
7846 comments: {
7847 key: function (a) {
7848 return b.utils.unwrapObservable(a.id)
7849 },
7850 create: function (a) {
7851 var b = new c(a.data, e.discussion);
7852 return b
7853 }
7854 }
7855 }, e)
7856 }
7857 }), define("views/replies", ["underscoreLoader", "jqueryLoader", "knockoutLoader", "riot", "riotbar", "../lib/http", "marked", "./comment", "../lib/player_history", "../lib/analytics_helper", "../mappers/replies", "../mixins/toggle_live_preview_mixin", "../mixins/apollo_token_mixin", "URI", "../lib/mobile_helper"], function (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) {
7858 var p = function (q, r, s, t) {
7859 var u = this;
7860 if (this.replyLimit = 13, a.isObject(r) && (this.discussion = r), a.isObject(s) && (this.parentComment = s), a.isObject(t) && (this.parentPage = t), k(q, this), !a.isFunction(this.sortType)) {
7861 var v = "comments_sort_" + d.Sandworm.getRegion().toLowerCase(),
7862 w = "best";
7863 if (d.getCookie(v)) var w = d.getCookie(v);
7864 this.sortType = c.observable(w)
7865 }
7866 this.isA = function () {
7867 return "Replies"
7868 }, this.toggle = function (a) {
7869 return u[a](u[a]() !== !0)
7870 }, this.newReplyContent = c.observable(""), this.isReplying = c.observable(!1), this.canMinimizeReply = c.observable(!0), this.hasAttachment = c.observable(!1),
7871 this.attachment = c.observable(null), this.hasComments = c.computed(function () {
7872 return u.noComments() ? !1 : u.comments().length > 0 ? !0 : !1
7873 }), this.apiBasePath = function () {
7874 return "/api/" + this.discussion.application.id() + "/discussions/" + this.discussion.id()
7875 }, this.apiPath = function () {
7876 return this.apiBasePath()
7877 }, this.ancestorCount = c.computed(function () {
7878 return a.reduce(u.comments(), function (a, b) {
7879 return a + b.ancestorCount() + 1
7880 }, 0)
7881 }), this.newCommentMessage = c.observable(""), this.isSubmitting = c.observable(!1), this.activeReplyBox = !1, this.createComment = function (c, e) {
7882 e.stopPropagation();
7883 var g = u.apiPath() + "/comment",
7884 h = b(e.currentTarget).closest(".reply.form-container");
7885 u.activeReplyBox = h;
7886 var i = h.find("textarea").val();
7887 if (i = a.str.trim(i), a.isEmpty(i) || "" === i) return !1;
7888 var j, k = b("#discussion[data-application-locale]");
7889 j = k.attr("data-application-locale") ? k.attr("data-application-locale") : d.Sandworm.getLang() || "en_US";
7890 var l = {
7891 message: i,
7892 language: j,
7893 attachment: u.attachment(),
7894 apolloToken: this.getApolloToken()
7895 };
7896 a.isObject(u.parentComment) && (u.parentComment.levelsDeep() >= u.replyLimit ? l.parentCommentId = u.parentComment.parentCommentId() : l.parentCommentId = u.parentComment.id()), u.isSubmitting(!0), f.post(g, l, this.processCreateCommentResponse, function () {
7897 u.isSubmitting(!1)
7898 })
7899 }, this.aOrB = function () {
7900 return a.isObject(u.parentComment) ? u.parentComment.aOrB() : "a"
7901 }, this.processCreateCommentResponse = function (c) {
7902 if (c && c.errorCode) {
7903 switch (c.errorCode) {
7904 case "TOO_MANY_REQUESTS":
7905 var d = u.activeReplyBox.find(".error-rate-limit");
7906 d.fadeIn(), window.setTimeout(function () {
7907 d.fadeOut()
7908 }, 5e3)
7909 }
7910 return u.isSubmitting(!1), !1
7911 }
7912 var e = new h(c, u.discussion),
7913 f = {
7914 "event.object_type": "comment",
7915 "event.object_id": e.discussion.application.id() + "_" + e.discussion.id() + "_" + e.id(),
7916 userIsRioter: window.currentUser.isRioter() ? "1" : "0"
7917 };
7918 j.track("create", f);
7919 var g = !1;
7920 if (a.isObject(u.parentComment) && a.isObject(u.parentComment.parentPage) ? g = u.parentComment.parentPage : a.isObject(u.parentPage) && (g = u.parentPage), g && "flat" == g.viewType()) {
7921 var k = g.totalFlatComments();
7922 if (g.totalFlatComments(k + 1), e.user.isRioter()) {
7923 var l = g.discussion.rioterCommentIds();
7924 l.push(e.id()), g.discussion.rioterCommentIds(l)
7925 }
7926 g.showFlatCommentsByPage(g.lastPage(), function () {
7927 var a = this;
7928 setTimeout(function () {
7929 a.scrollTo("#comment-" + e.id()), window.Riot.Apollo.attach(b("#comments > .reply"))
7930 }, 100)
7931 }), u.newReplyContent("")
7932 } else {
7933 if (a.isObject(u.parentComment) && u.parentComment.levelsDeep() >= u.replyLimit) {
7934 var m = u.parentComment.discussion.getCommentById(u.parentComment.parentCommentId());
7935 m && m.replies.comments.push(e)
7936 } else u.comments.unshift(e);
7937 u.isReplying(!1)
7938 }
7939 b(".empty-comments").hide(), u.isSubmitting(!1), u.hasAttachment(!1), u.attachment(null);
7940 var n = new i;
7941 n.addComment(u.discussion.application.id(), u.discussion.id())
7942 }, this.getMoreComments = function (b, c) {
7943 var d = u.apiPath() + "/comments",
7944 e = {
7945 sort_type: u.sortType(),
7946 num_loaded: u.comments().length
7947 };
7948 a.isObject(u.parentComment) && (e.parent_id = u.parentComment.id()), u.comments().length > 0 && (e.last_comment_id = a.last(u.comments()).id()), f.get(d, e, function (a) {
7949 u.processMoreCommentsResponse(a)
7950 })
7951 }, this.getComment = function (a, b, c) {
7952 var d = u.apiPath() + "/comment/" + a.id;
7953 a.id = a.id || "", a.payload = a.payload || {}, b = b || function () {}, c = c || function () {}, f.get(d, a.payload, b, c)
7954 }, this.hasMoreComments = c.computed(function () {
7955 return u.noComments() ? !1 : u.moreCount() > 0
7956 }), this.processMoreCommentsResponse = function (b) {
7957 var c = b.comments;
7958 a.each(c, function (a) {
7959 var b = new h(a, u.discussion);
7960 u.insert(b)
7961 }), u.moreCount(b.moreCount <= 0 ? 0 : b.moreCount)
7962 }, this.insert = function (d) {
7963 var e = c.utils.arrayFirst(u.comments(), function (a) {
7964 return d.id() === a.id()
7965 });
7966 if (e && d.hasChildren()) {
7967 var f = b(document).height();
7968 e.isMinimized(!1), a.each(d.replies.comments(), function (a) {
7969 e.replies.insert(a)
7970 });
7971 var g = b(document).height() - f;
7972 g > 0 && window.scrollTo(b(document).scrollLeft(), b(document).scrollTop() + g)
7973 } else e || u.comments.push(d)
7974 }, this.markdownParsedEditedContent = c.computed(function () {
7975 var a = this.newReplyContent();
7976 if (o.isMobileView() || !this.livePreviewVisible()) return a;
7977 var b = new g;
7978 return b.parse(a)
7979 }, this), this.respondToReply = function (a, c) {
7980 if (c.stopPropagation(), b(c.currentTarget).hasClass("requires-auth")) e.account.login();
7981 else {
7982 var d = b(c.currentTarget).closest(".nested-comment");
7983 u.toggle("isReplying"), d.find(".reply.form-container textarea").focus()
7984 }
7985 }, this.respondToAuth = function (a, b) {
7986 b.stopPropagation(), e.account.login()
7987 }, this.respondToQuote = function (a, c) {
7988 if (c.stopPropagation(), b(c.currentTarget).hasClass("requires-auth")) e.account.login();
7989 else {
7990 if (!u.parentComment) return void u.toggle("isReplying");
7991 u.quoteText(u.parentComment.message(), a.user, a.discussion.application.id(), a.id(), a.discussion.id(), a.createdAt()), u.isReplying() || u.toggle("isReplying")
7992 }
7993 }, this.quoteText = function (b, c, d, e, f, g) {
7994 var h = u.newReplyContent();
7995 h.length > 0 && (h += "\n"), b = b.replace(/^\s*>.*\n?/gm, "").trim(), b = a.escape(b);
7996 var i = b.split("\n"),
7997 j = "> [{quoted}](name=" + c.name() + ",realm=" + c.realm() + ",application-id=" + d + ",discussion-id=" + f + ",comment-id=" + e + ",timestamp=" + g + ")\n>\n";
7998 j += "> " + i.join("\n> ") + "\n\n", h += j, u.newReplyContent(h)
7999 }, this.respondToCancel = function (a, b) {
8000 b.stopPropagation(), u.newReplyContent(""), u.toggle("isReplying")
8001 }, this.uploaderWindow = !1, this.addAttachment = function (a, b) {
8002 b.stopPropagation();
8003 var c = b.currentTarget.href;
8004 u.uploaderWindow = window.open(c, "uploader" + Math.floor(1e4 * Math.random()), "scrollbars=no,resizable=no,menubar=no,location=no,height=265,width=475"), window.navigator.userAgent.match(/msie/i) || window.navigator.userAgent.match(/trident/i) ? window.fakePostMessage = u.fileUploaded : window.addEventListener("message", u.windowListener, u.uploaderWindow)
8005 }, this.canAcceptAttachments = c.computed(function () {
8006 return window.Modernizr.flash || window.Modernizr.fileinput
8007 }), this.removeAttachment = function (a, b) {
8008 b.stopPropagation(), u.attachment(""), u.hasAttachment(!1)
8009 }, this.windowListener = function (a) {
8010 a.source == u.uploaderWindow && a.data && u.fileUploaded(a.data)
8011 }, this.fileUploaded = function (a) {
8012 var b = new n(a.replace(/%2F/g, "/")).filename();
8013 u.attachment({
8014 url: a,
8015 name: decodeURIComponent(b)
8016 }), u.hasAttachment(!0), u.uploaderWindow.close()
8017 }, this.attachmentName = c.computed(function () {
8018 var b = u.attachment();
8019 return a.isObject(b) && b.hasOwnProperty("name") ? b.name : void 0
8020 }), this.attachListeners = function (a) {
8021 d.Apollo.attach($(a))
8022 }, a.extend(p.prototype, l), a.extend(p.prototype, m)
8023 };
8024 return p
8025 }), define("mappers/discussion", ["underscore", "knockout", "../views/user", "../views/application", "../views/replies"], function (a, b, c, d, e) {
8026 return function (f, g) {
8027 a.isObject(f) && a.isObject(f.comments) && (f.replies = f.comments, delete f.comments), a.isUndefined(f) && (f = {}), f = a.defaults(f, {
8028 userVote: null,
8029 deleted: !1,
8030 content: {},
8031 replies: {},
8032 title: null,
8033 upVotes: null,
8034 downVotes: null,
8035 application: {
8036 id: null
8037 },
8038 id: null,
8039 hasRioterComments: !1,
8040 rioterCommentIds: []
8041 }), f.content = a.defaults(f.content, {
8042 body: null,
8043 pollId: null,
8044 remediatable: !1,
8045 attachments: []
8046 }), b.mapping.fromJS(f, {
8047 key: function (a) {
8048 return b.utils.unwrapObservable(a.id)
8049 },
8050 user: {
8051 create: function (a) {
8052 return new c(a.data)
8053 }
8054 },
8055 application: {
8056 create: function (a) {
8057 return new d(a.data)
8058 }
8059 },
8060 replies: {
8061 create: function (a) {
8062 var b = new e(a.data, g);
8063 return b.isReplying(!0), b
8064 }
8065 }
8066 }, g)
8067 }
8068 }), define("lib/remove_diacritics", [], function () {
8069 function a(a) {
8070 var b, d = "",
8071 e = a.length;
8072 for (b = 0; e > b; b++) d += c[a[b]] || a[b];
8073 return d
8074 }
8075 for (var b = [{
8076 base: "A",
8077 letters: "AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"
8078 }, {
8079 base: "AA",
8080 letters: "Ꜳ"
8081 }, {
8082 base: "AE",
8083 letters: "ÆǼǢ"
8084 }, {
8085 base: "AO",
8086 letters: "Ꜵ"
8087 }, {
8088 base: "AU",
8089 letters: "Ꜷ"
8090 }, {
8091 base: "AV",
8092 letters: "ꜸꜺ"
8093 }, {
8094 base: "AY",
8095 letters: "Ꜽ"
8096 }, {
8097 base: "B",
8098 letters: "BⒷBḂḄḆɃƂƁ"
8099 }, {
8100 base: "C",
8101 letters: "CⒸCĆĈĊČÇḈƇȻꜾ"
8102 }, {
8103 base: "D",
8104 letters: "DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"
8105 }, {
8106 base: "DZ",
8107 letters: "DZDŽ"
8108 }, {
8109 base: "Dz",
8110 letters: "DzDž"
8111 }, {
8112 base: "E",
8113 letters: "EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"
8114 }, {
8115 base: "F",
8116 letters: "FⒻFḞƑꝻ"
8117 }, {
8118 base: "G",
8119 letters: "GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"
8120 }, {
8121 base: "H",
8122 letters: "HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"
8123 }, {
8124 base: "I",
8125 letters: "IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"
8126 }, {
8127 base: "J",
8128 letters: "JⒿJĴɈ"
8129 }, {
8130 base: "K",
8131 letters: "KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"
8132 }, {
8133 base: "L",
8134 letters: "LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"
8135 }, {
8136 base: "LJ",
8137 letters: "LJ"
8138 }, {
8139 base: "Lj",
8140 letters: "Lj"
8141 }, {
8142 base: "M",
8143 letters: "MⓂMḾṀṂⱮƜ"
8144 }, {
8145 base: "N",
8146 letters: "NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"
8147 }, {
8148 base: "NJ",
8149 letters: "NJ"
8150 }, {
8151 base: "Nj",
8152 letters: "Nj"
8153 }, {
8154 base: "O",
8155 letters: "OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"
8156 }, {
8157 base: "OI",
8158 letters: "Ƣ"
8159 }, {
8160 base: "OO",
8161 letters: "Ꝏ"
8162 }, {
8163 base: "OU",
8164 letters: "Ȣ"
8165 }, {
8166 base: "OE",
8167 letters: "Œ"
8168 }, {
8169 base: "oe",
8170 letters: "œ"
8171 }, {
8172 base: "P",
8173 letters: "PⓅPṔṖƤⱣꝐꝒꝔ"
8174 }, {
8175 base: "Q",
8176 letters: "QⓆQꝖꝘɊ"
8177 }, {
8178 base: "R",
8179 letters: "RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"
8180 }, {
8181 base: "S",
8182 letters: "SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"
8183 }, {
8184 base: "T",
8185 letters: "TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"
8186 }, {
8187 base: "TZ",
8188 letters: "Ꜩ"
8189 }, {
8190 base: "U",
8191 letters: "UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"
8192 }, {
8193 base: "V",
8194 letters: "VⓋVṼṾƲꝞɅ"
8195 }, {
8196 base: "VY",
8197 letters: "Ꝡ"
8198 }, {
8199 base: "W",
8200 letters: "WⓌWẀẂŴẆẄẈⱲ"
8201 }, {
8202 base: "X",
8203 letters: "XⓍXẊẌ"
8204 }, {
8205 base: "Y",
8206 letters: "YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"
8207 }, {
8208 base: "Z",
8209 letters: "ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"
8210 }, {
8211 base: "a",
8212 letters: "aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"
8213 }, {
8214 base: "aa",
8215 letters: "ꜳ"
8216 }, {
8217 base: "ae",
8218 letters: "æǽǣ"
8219 }, {
8220 base: "ao",
8221 letters: "ꜵ"
8222 }, {
8223 base: "au",
8224 letters: "ꜷ"
8225 }, {
8226 base: "av",
8227 letters: "ꜹꜻ"
8228 }, {
8229 base: "ay",
8230 letters: "ꜽ"
8231 }, {
8232 base: "b",
8233 letters: "bⓑbḃḅḇƀƃɓ"
8234 }, {
8235 base: "c",
8236 letters: "cⓒcćĉċčçḉƈȼꜿↄ"
8237 }, {
8238 base: "d",
8239 letters: "dⓓdḋďḍḑḓḏđƌɖɗꝺ"
8240 }, {
8241 base: "dz",
8242 letters: "dzdž"
8243 }, {
8244 base: "e",
8245 letters: "eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"
8246 }, {
8247 base: "f",
8248 letters: "fⓕfḟƒꝼ"
8249 }, {
8250 base: "g",
8251 letters: "gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"
8252 }, {
8253 base: "h",
8254 letters: "hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"
8255 }, {
8256 base: "hv",
8257 letters: "ƕ"
8258 }, {
8259 base: "i",
8260 letters: "iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"
8261 }, {
8262 base: "j",
8263 letters: "jⓙjĵǰɉ"
8264 }, {
8265 base: "k",
8266 letters: "kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"
8267 }, {
8268 base: "l",
8269 letters: "lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"
8270 }, {
8271 base: "lj",
8272 letters: "lj"
8273 }, {
8274 base: "m",
8275 letters: "mⓜmḿṁṃɱɯ"
8276 }, {
8277 base: "n",
8278 letters: "nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"
8279 }, {
8280 base: "nj",
8281 letters: "nj"
8282 }, {
8283 base: "o",
8284 letters: "oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"
8285 }, {
8286 base: "oi",
8287 letters: "ƣ"
8288 }, {
8289 base: "ou",
8290 letters: "ȣ"
8291 }, {
8292 base: "oo",
8293 letters: "ꝏ"
8294 }, {
8295 base: "p",
8296 letters: "pⓟpṕṗƥᵽꝑꝓꝕ"
8297 }, {
8298 base: "q",
8299 letters: "qⓠqɋꝗꝙ"
8300 }, {
8301 base: "r",
8302 letters: "rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"
8303 }, {
8304 base: "s",
8305 letters: "sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"
8306 }, {
8307 base: "t",
8308 letters: "tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"
8309 }, {
8310 base: "tz",
8311 letters: "ꜩ"
8312 }, {
8313 base: "u",
8314 letters: "uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"
8315 }, {
8316 base: "v",
8317 letters: "vⓥvṽṿʋꝟʌ"
8318 }, {
8319 base: "vy",
8320 letters: "ꝡ"
8321 }, {
8322 base: "w",
8323 letters: "wⓦwẁẃŵẇẅẘẉⱳ"
8324 }, {
8325 base: "x",
8326 letters: "xⓧxẋẍ"
8327 }, {
8328 base: "y",
8329 letters: "yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"
8330 }, {
8331 base: "z",
8332 letters: "zⓩzźẑżžẓẕƶȥɀⱬꝣ"
8333 }], c = {}, d = 0; d < b.length; d++)
8334 for (var e = b[d].letters.split(""), f = 0; f < e.length; f++) c[e[f]] = b[d].base;
8335 return a
8336 }), define("views/discussion", ["underscoreLoader", "jqueryLoader", "knockoutLoader", "./user", "./application", "./replies", "../mixins/voting_mixin", "../mixins/toggle_live_preview_mixin", "../mixins/report_mixin", "../mixins/apollo_token_mixin", "marked", "../lib/http", "URI", "../lib/player_history", "../mappers/discussion", "riot", "../lib/remove_diacritics", "../lib/post_messages", "../lib/mobile_helper"], function (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) {
8337 "use strict";
8338 var t = function (d, e) {
8339 var f = this;
8340 o(d, this), a.isObject(e) && (this.parentPage = e), a.isUndefined(d) && (d = {}), d.content = d.content || {}, d.content = a.defaults(d.content, {
8341 body: null,
8342 pollId: null
8343 }), this.isA = function () {
8344 return "Discussion"
8345 }, this.isVoting = c.observable(!1), this.isUpVoted = c.computed(function () {
8346 return "up" === f.userVote()
8347 }), this.isDownVoted = c.computed(function () {
8348 return "down" === f.userVote()
8349 }), this.isDeleted = function () {
8350 return f.deleted()
8351 }, this.content.body = c.observable(d.content.body), this.canAcceptAttachments = c.computed(function () {
8352 return window.Modernizr.flash || window.Modernizr.fileinput
8353 }), this.hasAttachments = c.computed(function () {
8354 return void 0 !== f.content.attachments && !a.isEmpty(f.content.attachments())
8355 }), this.hasPoll = c.computed(function () {
8356 return a.isString(f.content.pollId())
8357 }), this.attachmentCount = c.computed(function () {
8358 return f.content.hasOwnProperty("attachments") ? f.content.attachments().length : 0
8359 }), this.errorCode = c.observable(null), this.errorMessage = c.observable(null), this.isEditing = c.observable(!1), this.storedEditedContent = c.observable(""), this.storedTitle = c.observable(""), this.showConfirmDelete = c.observable(!1), this.isAddingAttachments = c.observable(!1), this.submitPluploader = c.observable(!1), this.reporting = c.observable(!1), this.reported = c.observable(!1), this.reportErrorMessage = c.observable(null), this.PlayerHistory = new n, this.visitedDiscussion = this.PlayerHistory.getDiscussionVisit(f.application.id(), f.id()), this.toggle = function (a) {
8360 return f[a](f[a]() !== !0)
8361 }, this.replies.canMinimizeReply(!1), this.capitalTitle = c.computed(function () {
8362 return (f.title() + "").toUpperCase()
8363 }), this.totalVotes = c.computed(function () {
8364 return f.upVotes() - f.downVotes()
8365 }), this.totalVotesHuman = c.computed(function () {
8366 var a = f.totalVotes();
8367 return b.isNumeric(a) && a >= 1e3 ? Math.floor(a / 1e3) + "k" : a + ""
8368 }), this.relativePath = c.computed(function () {
8369 var b = p.Sandworm.getLang().substr(0, 2);
8370 return f.application.shortName() ? "/" + b + "/c/" + f.application.shortName() + "/" + f.id() + "-" + a.str.slugify(q(f.title())) : "/" + b + "/f/" + f.application.id() + "/d/" + f.id()
8371 }), this.rundownPath = c.computed(function () {
8372 var a = f.relativePath();
8373 return a += "?show=rundown"
8374 }), this.boardPath = c.computed(function () {
8375 var a = p.Sandworm.getLang().substr(0, 2);
8376 return f.application.shortName() ? "/" + a + "/c/" + f.application.shortName() : "/" + a + "/f/" + f.application.id()
8377 }), this.apiBasePath = function () {
8378 return "/api/" + this.application.id() + "/discussions"
8379 }, this.apiPath = function () {
8380 return this.apiBasePath() + "/" + this.id()
8381 }, this.del = function () {
8382 if (f.user.id() === window.currentUser.id() && f.user.realm() === window.currentUser.realm()) l.del("/api/" + f.application.id() + "/discussions/" + f.id(), {
8383 apolloToken: this.getApolloToken()
8384 }, function (a) {
8385 f.deleted(!0), f.showConfirmDelete(!1)
8386 }, function (a) {
8387 f.showConfirmDelete(!1)
8388 });
8389 else {
8390 var a = document.apolloModUrl,
8391 b = document.apolloModUrl + "/confirm_delete/" + f.application.id() + "/" + f.id() + "/?origin=" + encodeURIComponent(location.href),
8392 c = "confirmDelete";
8393 r.hook(c, {
8394 origin: a,
8395 popup: {
8396 url: b,
8397 target: c,
8398 params: "width=600,height=500"
8399 },
8400 initialize: function (a) {
8401 r.send(c, "setupForm")
8402 },
8403 deleteSuccess: function (a) {
8404 r.closeWindow(c), f.deleted(!0), f.showConfirmDelete(!1)
8405 },
8406 deleteFail: function (a) {
8407 r.closeWindow(c), f.showConfirmDelete(!1)
8408 }
8409 })
8410 }
8411 }, this.undel = function () {
8412 l.post("/api/" + f.application.id() + "/discussions/" + f.id() + "/undelete", {
8413 apolloToken: this.getApolloToken()
8414 }, function (a) {
8415 f.deleted(!1), f.showConfirmDelete(!1)
8416 }, function (a) {
8417 f.showConfirmDelete(!1)
8418 })
8419 }, this.quote = function () {
8420 f.replies.quoteText(f.content.body(), f.user, f.application.id(), "", f.id(), f.createdAt()), b("#comments > .reply textarea").focus()
8421 }, this.onEditClicked = function () {
8422 l.get(f.apiPath(), {
8423 censor_content: "false"
8424 }, function (a) {
8425 a.discussion && a.discussion.content ? f.toEdit(a.discussion.content.body, a.discussion.title) : window.alert("Error fetching discussion to edit.")
8426 }, function (b) {
8427 f.toEdit(a.unescape(f.content.body()), a.unescape(f.title()))
8428 })
8429 }, this.toEdit = function (a, b) {
8430 return a && b ? (f.storedEditedContent(a), f.storedTitle(b), void f.isEditing(!0)) : void window.alert("Error fetching discussion to edit.")
8431 }, this.cancelEditedContent = function () {
8432 f.storedEditedContent(""), f.isEditing(!1)
8433 }, this.addAttachment = function (a, b) {
8434 b.stopPropagation();
8435 var c = b.currentTarget.href;
8436 f.uploaderWindow = window.open(c, "uploader" + Math.floor(1e4 * Math.random()), "scrollbars=no,resizable=no,menubar=no,location=no,height=265,width=475"), window.navigator.userAgent.match(/msie/i) || window.navigator.userAgent.match(/trident/i) ? window.fakePostMessage = f.fileUploaded : window.addEventListener("message", f.windowListener, f.uploaderWindow)
8437 }, this.windowListener = function (a) {
8438 a.source === f.uploaderWindow && a.data && f.fileUploaded(a.data)
8439 }, this.fileUploaded = function (a) {
8440 a = a.replace(/%2F/gi, "/", a);
8441 var b = new m(a).filename(),
8442 c = f.content.attachments();
8443 c.push({
8444 url: a,
8445 name: decodeURIComponent(b)
8446 }), f.updateAttachments(c), f.uploaderWindow.close()
8447 }, this.deleteAttachment = function (a) {
8448 for (var b = this.content.attachments(), c = b.length, d = 0; c > d; d++) a === b[d] && (b.splice(d, 1), this.updateAttachments(b))
8449 }, this.updateAttachments = function (a) {
8450 a = c.toJSON(a), l.put("/api/" + f.application.id() + "/discussions/" + f.id() + "/attachments", {
8451 attachments: a,
8452 apolloToken: f.getApolloToken()
8453 }, function (a) {
8454 a.hasOwnProperty("attachments") && (f.content.attachments(a.attachments), f.isAddingAttachments())
8455 }, function () {
8456 window.alert("Problem with updating attachments")
8457 })
8458 };
8459 var g = new k;
8460 void 0 !== window.currentUser && window.currentUser.isRioter() && g.setOptions({
8461 riotRioterFlavoredMarkdown: !0
8462 }), this.markdownParsedEditedContent = c.computed(function () {
8463 return s.isMobileView() || !this.livePreviewVisible() ? this.storedEditedContent() : "" !== this.storedEditedContent() ? g.parse(this.storedEditedContent()) : void 0
8464 }, this), this.saveEditedContent = function () {
8465 var b = f.storedEditedContent(),
8466 c = f.storedTitle(),
8467 d = f.content.body(),
8468 e = f.title();
8469 return b === f.content.body() && e === c ? void f.isEditing(!1) : void("" !== b && f.isEditing() && (f.content.body(b), f.title(c), l.post("/api/" + f.application.id() + "/discussions/" + f.id() + "/updateContent", {
8470 body: b,
8471 title: c,
8472 apolloToken: f.getApolloToken()
8473 }, function (b) {
8474 a.isObject(b.discussion) && a.isObject(b.discussion.content) && a.isString(b.discussion.content.body) && (f.content.body(b.discussion.content.body), f.title(b.discussion.title), f.isEditing(!1))
8475 }, function () {
8476 window.alert("Couldn't update the content!"), f.content.body(d), f.title(e), f.isEditing(!0)
8477 })))
8478 }, this.toggleLock = function (a) {
8479 var c = f.commentCreationEnabled(),
8480 d = f.commentVotingEnabled();
8481 "commenting" === a ? c = !c : "voting" === a && (d = !d), b.ajax("/api/" + f.application.id() + "/discussions/" + f.id() + "/updateLock", {
8482 type: "post",
8483 dataType: "json",
8484 data: {
8485 commentCreationEnabled: c === !0 ? "true" : "false",
8486 commentVotingEnabled: d === !0 ? "true" : "false",
8487 apolloToken: f.getApolloToken()
8488 },
8489 success: function (a) {
8490 window.location.reload()
8491 },
8492 error: function (a) {
8493 window.alert("There was a problem changing the lock state.")
8494 }
8495 })
8496 }, this.toggleSticky = function () {
8497 var a = !0;
8498 (f.isSticky() === !0 || void 0 != f.isGlobalSticky && 1 == f.isGlobalSticky()) && (a = !1), b.ajax("/api/" + f.application.id() + "/discussions/" + f.id() + "/updateSticky", {
8499 type: "post",
8500 dataType: "json",
8501 data: {
8502 isSticky: a === !0 ? "true" : "false",
8503 apolloToken: f.getApolloToken()
8504 },
8505 success: function (b) {
8506 f.isSticky(a), a === !1 && void 0 != f.isGlobalSticky && f.isGlobalSticky(a)
8507 },
8508 error: function () {
8509 window.alert("Problem with stickying")
8510 }
8511 })
8512 };
8513 var h = function (a, b) {
8514 if (console.log("looking for " + b + " at " + a.id()), a.id() === b) return a;
8515 if (a.replies)
8516 for (var c = a.replies.comments(), d = 0; d < c.length; d++) {
8517 var e = h(c[d], b);
8518 if (e !== !1) return e
8519 }
8520 return !1
8521 };
8522 this.attachListeners = function (a) {
8523 p.Apollo.attach(b(a))
8524 }, this.getCommentById = function (a) {
8525 return h(f, a)
8526 }, this.totalRioterComments = c.computed(function () {
8527 return f.rioterCommentIds().length
8528 }), this.lastRioterCommentURL = function () {
8529 var a = f.rioterCommentIds();
8530 if (0 == a.length) return !1;
8531 var b = a.slice(-1)[0];
8532 return "?show=flat&comment=" + b
8533 }
8534 };
8535 return t.prototype = {}, a.extend(t.prototype, g), a.extend(t.prototype, h), a.extend(t.prototype, i), a.extend(t.prototype, j), t
8536 }), define("views/new_comments", ["underscoreLoader", "knockoutLoader", "./user", "../lib/http", "URI", "../lib/player_history", "./comment"], function (a, b, c, d, e, f, g) {
8537 var h = function (a, c) {
8538 var e = this;
8539 this.comments = b.observableArray(), this.totalNewComments = b.observable(0), this.isA = function () {
8540 return "NewComments"
8541 }, this.PlayerHistory = new f;
8542 var h, i = !1;
8543 a && c && (h = this.PlayerHistory.getDiscussionVisit(a, c)), h && "number" == typeof h.d && (i = new Date(h.d)), this.getLastVisitedDate = function () {
8544 return i
8545 }, this.numberPreviousComments = function () {
8546 return h && "number" == typeof h.c ? h.c : 0
8547 }, this.numberNewComments = function (a) {
8548 var b = e.numberPreviousComments();
8549 return 0 == b ? a : a - b
8550 }, this.setComments = function (a, c) {
8551 var d = e.mapData(a, c);
8552 if (d.comments) {
8553 for (var f = d.comments(), g = 0; g < f.length; g++) this.comments.push(f[g]);
8554 this.totalNewComments = b.observable(d.numLoaded() + d.moreCount())
8555 }
8556 }, this.showNewComments = function (b, f, g) {
8557 b += e.numberPreviousComments();
8558 var h = "/api/" + a + "/discussions/" + c + "/comments.json",
8559 i = {
8560 num_loaded: b,
8561 sort_type: "recent",
8562 reverse_sort: !0,
8563 response_format: "list"
8564 };
8565 d.get(h, i, f, g)
8566 }, this.hideDiscussionParent = !0, this.mapData = function (a, c, d) {
8567 return b.mapping.fromJS(a, {
8568 comments: {
8569 key: function (a) {
8570 return b.utils.unwrapObservable(a.id)
8571 },
8572 create: function (a) {
8573 a.data.hideDiscussionParent = !0, a.data.replies = {
8574 parentComment: {
8575 id: a.data.id
8576 }
8577 };
8578 var b = new g(a.data, c, d);
8579 return b
8580 }
8581 }
8582 })
8583 }
8584 };
8585 return h.prototype = {}, h
8586 }), define("views/discussion_show_page", ["underscoreLoader", "jqueryLoader", "knockoutLoader", "riot", "../mixins/lifecycle_mixin", "../mixins/scroll_to_mixin", "../lib/embedly_helper", "../lib/http", "../lib/player_history", "./discussion", "./user", "URI", "./comment", "./new_comments"], function (a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
8587 var o = function (e) {
8588 var f = this;
8589 this.isA = function () {
8590 return "DiscussionShowPage"
8591 };
8592 var m = new l(document.URL),
8593 o = new i;
8594 this.showCommentAuthor = function () {
8595 return !0
8596 }, a.isUndefined(e) && (e = {}), e = a.defaults(e, {
8597 viewType: "nested",
8598 user: {}
8599 }), this.viewType = c.observable(e.viewType), this.inAjaxState = c.observable(!1), c.mapping.fromJS(e, {
8600 discussion: {
8601 key: function (a) {
8602 return c.utils.unwrapObservable(a.id)
8603 },
8604 create: function (a) {
8605 var b = new j(a.data, f);
8606 return b
8607 }
8608 },
8609 user: {
8610 key: function (a) {
8611 return c.utils.unwrapObservable(a.id)
8612 },
8613 create: function (a) {
8614 return new k(a.data)
8615 }
8616 }
8617 }, this), window.currentUser = this.user, window.dsp = this, c.postbox.subscribe("discussion:fetchCommentTree", function (a) {
8618 f.discussion.replies.getComment({
8619 id: a,
8620 payload: {
8621 include_parents: "true"
8622 }
8623 }, function (b) {
8624 f.discussion.replies.processMoreCommentsResponse(b), c.postbox.publish("discussion:newCommentTree", a)
8625 })
8626 }), f.discussion && f.discussion.application && (this.newComments = new n(f.discussion.application.id(), f.discussion.id())), this.hasNewComments = function () {
8627 return o.hasVisitedDiscussion(f.discussion.application.id(), f.discussion.id()) && f.newComments.numberNewComments(f.discussion.totalComments()) > 0
8628 }, this.numberNewComments = function () {
8629 return f.newComments.numberNewComments(f.discussion.totalComments())
8630 }, this.moreNewComments = function () {
8631 return f.newComments.totalNewComments() - f.newComments.comments().length > 0
8632 }, this.showNewCommentsHandler = function () {
8633 if (f.hasNewComments()) {
8634 var a = f.newComments.comments().length;
8635 0 === a ? f.inAjaxState(!0) : a > 0 && f.viewType("new"), f.newComments.showNewComments(a, function (b) {
8636 b && b.comments && b.numLoaded > 0 ? (f.newComments.setComments(b, f.discussion), 0 === a && (f.viewType("new"), f.scrollTo("#comments"))) : f.viewType("nested"), f.inAjaxState(!1)
8637 }, function () {})
8638 }
8639 }, this.hideNewCommentsHandler = function () {
8640 f.viewType("nested")
8641 };
8642 var p = 20,
8643 q = {
8644 sort_field: "createdAt",
8645 sort_direction: "asc",
8646 content_type: "comment",
8647 page_size: p
8648 };
8649 this.totalFlatComments = c.observable(0), this.lastPage = function () {
8650 if (0 === this.totalFlatComments()) return 1;
8651 var a = Math.ceil(f.totalFlatComments() / p);
8652 return a
8653 }, this.loadFlatCommentsFromData = function (b, c) {
8654 b.pageNumber = c, b.pageSize = p;
8655 var d = b.comments.length + b.moreCount + (c - 1) * p,
8656 e = 5 > c ? 1 : c - 4,
8657 g = c + 4,
8658 h = Math.ceil(d / p);
8659 g = g > h ? h : g, f.totalFlatComments(d), b.startPage = e, b.endPage = g, b.pagesList = a.range(e, g + 1), b.totalPages = h, f.flatComments = f.newComments.mapData(b, f.discussion, f)
8660 }, this.switchFlatPage = function (a, b) {
8661 return 0 != b.button ? !0 : (f.showFlatCommentsByPage(a), !1)
8662 }, this.showFlatCommentsByPage = function (b, c) {
8663 "last" == b && (b = f.lastPage()), f.inAjaxState(!0), f.flatComments = {};
8664 var d = a.defaults({
8665 num_loaded: (b - 1) * p,
8666 reverse_sort: !0,
8667 response_format: "list",
8668 sort_type: "recent",
8669 page_size: p,
8670 include_pinned: 1 === b ? "true" : "false"
8671 }, q);
8672 h.get("/api/" + f.discussion.application.id() + "/discussions/" + f.discussion.id() + "/comments.json", d, function (d) {
8673 d && d.comments && d.numLoaded > 0 && (f.loadFlatCommentsFromData(d, b), f.storeFlatPage(b), f.flatPage(b), a.isFunction(c) && c.call(f)), f.inAjaxState(!1)
8674 }, function () {
8675 f.discussion.replies.noComments(!1), f.viewType("nested"), f.inAjaxState(!1)
8676 })
8677 };
8678 var r = location.search;
8679 this.storeFlatPage = function (a) {
8680 if (a != f.flatPage() && window.history.pushState) {
8681 var b = "?";
8682 b = 1 == a ? "?show=flat" : "?show=flat&page=" + encodeURIComponent(a), window.history.pushState(null, "", b), r = b
8683 }
8684 }, "flat" == this.viewType() && e.flatComments && this.loadFlatCommentsFromData(e.flatComments, e.flatPage), jQuery(window).bind("popstate", function () {
8685 if (location.search != r) {
8686 var b = m.search(!0).show;
8687 a.isString(b) && "flat" == b
8688 }
8689 });
8690 var s = m.search(!0).show;
8691 a.isString(s) && "new" == s && f.showNewCommentsHandler(), this.canReply = function () {
8692 return !0
8693 }, this.canEditTitle = function () {
8694 if (f.currentUserIsModerator()) return !0;
8695 var a = new Date(f.discussion.createdAt()),
8696 b = new Date(a.getTime() + 9e5),
8697 c = new Date;
8698 return b >= c && f.discussion.user.id() == f.user.id() ? !0 : !1
8699 }, this.canEditDiscussion = function () {
8700 return "article" !== f.discussion.contentType() ? !1 : f.currentUserIsRiotModerator() ? !0 : "" !== f.user.id() && f.user.id() === f.discussion.user.id() ? "false" === f.discussion.content.remediatable() ? !1 : !0 : !1
8701 }, this.currentUserIsRiotModerator = function () {
8702 return f.user.hasOwnProperty("isModerator") && f.user.isModerator() ? !0 : !1
8703 }, this.currentUserIsModerator = function () {
8704 return f.currentUserIsRiotModerator() ? !0 : a.isArray(f.user.applicationsCanModerate()) && -1 !== f.user.applicationsCanModerate().indexOf(f.discussion.application.id()) ? !0 : !1
8705 }, this.currentUserIsBanned = function () {
8706 var a = this.getCurrentApplicationBan();
8707 if (null != a) {
8708 var c = b.timeago.parse(a);
8709 if (c > new Date) return !0
8710 }
8711 if (null === f.user.banEndsAt() || 0 === f.user.banEndsAt()) return !1;
8712 var d = b.timeago.parse(f.user.banEndsAt());
8713 return d > new Date ? !0 : !1
8714 }, this.getCurrentApplicationBan = function () {
8715 return f.user.hasOwnProperty("applicationBans") && f.discussion.application && f.discussion.application.id() && f.user.applicationBans[f.discussion.application.id()] ? f.user.applicationBans[f.discussion.application.id()]() : null
8716 }, this.currentUserBanEndsFormatted = function () {
8717 var a = null,
8718 b = this.getCurrentApplicationBan();
8719 null != b && (a = new Date(b));
8720 var c = new Date(f.user.banEndsAt());
8721 return (null === a || c > a) && (a = c), null != a && a.toLocaleString ? a.toLocaleString() : null != a ? a.toString() : void 0
8722 }, this.attachmentIsImage = function (a) {
8723 var b = a.url;
8724 "function" == typeof b && (b = b());
8725 var c = new l(b);
8726 return c && (c.path().match(/\.jpg$/i) || c.path().match(/\.jpeg$/i) || c.path().match(/\.png$/i) || c.path().match(/\.gif$/i)) ? !0 : !1
8727 };
8728 var t = new g;
8729 this.attachmentThumbnail = function (b, c) {
8730 if (!f.attachmentIsImage(b)) return !1;
8731 var d = b.url;
8732 return a.isFunction(d) && (d = d()), t.resize(d, c, c, "https://cdn.leagueoflegends.com/apollo/assets/discussion-thumbnail-ward.png")
8733 }, jQuery(window).bind("load", function () {
8734 var c = m.search(!0).comment;
8735 if (a.isString(c)) {
8736 var d = b("#comment-" + c);
8737 setTimeout(function () {
8738 f.scrollTo(d)
8739 }, 1e3)
8740 }
8741 f.discussion && f.discussion.application && o.addDiscussion(f.discussion.application.id(), f.discussion.id(), f.discussion.totalComments())
8742 }), this.attachListeners = function (a) {
8743 d.Apollo.attach(b(a))
8744 }, this.afterLoad = function () {
8745 b("video").each(function () {
8746 b(this).css({
8747 width: "100%",
8748 height: "auto"
8749 }), b(this).closest("p").css({
8750 width: "auto",
8751 "max-width": "610px"
8752 })
8753 }), b("img[data-thumbnail]").each(function () {
8754 b(this).attr("src", t.resize(b(this).attr("data-thumbnail"), 100, 100))
8755 }), b(".media-embed a").embedly({
8756 key: b("#embedly_key").val(),
8757 query: {
8758 maxwidth: "668",
8759 maxheight: "325"
8760 },
8761 display: function (c) {
8762 if (a.isUndefined(c.original_url) || a.isUndefined(c.provider_name) || a.isUndefined(c.type)) return !0;
8763 var d = !0;
8764 "link" !== c.type && ("photo" === c.type && b(this).html("<img src=" + c.url + ' style="min-width: 100%; max-width:100%;" />'), "video" === c.type ? (b(this).html(c.html), b(this).find("iframe.embedly-embed").css({
8765 "max-width": "100%",
8766 width: "100%"
8767 })) : "rich" === c.type ? "Google Docs" === c.provider_name || "http://docs.google.com" === c.provider_url ? d = !1 : (b(this).html(c.html), b(this).find("iframe.embedly-embed").css({
8768 "max-width": "100%",
8769 width: "100%"
8770 })) : (b(this).html(c.html), b(this).find("iframe.embedly-embed").css({
8771 "max-width": "100%"
8772 })), b(this).attr("href", "javascript:;"), d && b(this).closest(".link-reference.media-embed").show())
8773 }
8774 })
8775 }, this.flatCommentScrollCheck = function (a, c) {
8776 var d = new l(c.target.href),
8777 e = d.search(!0),
8778 g = e.comment,
8779 h = b("#comment-" + g);
8780 return 0 == h.length ? !0 : (f.scrollTo(h), !1)
8781 }
8782 };
8783 return o.prototype = {}, a.extend(o.prototype, e), a.extend(o.prototype, f), o
8784 }), define("lib/link_share_context_lookup", ["jqueryLoader", "knockoutLoader", "URI"], function (a, b, c) {
8785 "use strict";
8786 var d = {
8787 timer: !1,
8788 url: "",
8789 duration: 1,
8790 remaining: 0,
8791 state: "idle",
8792 key: a("#embedly_key").val(),
8793 register: function () {
8794 d.remaining = d.duration, d.validURL(a("#sharedLinkURL").val()) && a("#sharedLinkURL").val() !== d.url ? (d.url = a("#sharedLinkURL").val(), "idle" === d.state && d.startTimer()) : d.validURL(a("#sharedLinkURL").val()) || "idle" !== d.state || (a(".oembed-content-block").hide(), d.url = "")
8795 },
8796 validURL: function (a) {
8797 return /^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a) ? !0 : !1
8798 },
8799 truncate: function (a, b) {
8800 return a.length > b && (a = a.substr(0, b - 3) + "..."), a
8801 },
8802 getHostName: function (a) {
8803 var b = document.createElement("a");
8804 return b.href = a, b.hostname.replace("www.", "")
8805 },
8806 recropImage: function (a) {
8807 var b = d.fullImage(a),
8808 c = window.mediaCfg.host + "/api/embedly/1/display/crop?width=100&height=100&key=" + d.key + "&animate=false&url=" + encodeURIComponent(b);
8809 return c
8810 },
8811 fullImage: function (a) {
8812 for (var b, c = [], d = a.slice(a.indexOf("?") + 1).split("&"), e = 0; e < d.length; e++) b = d[e].split("="), c.push(b[0]), c[b[0]] = b[1];
8813 return decodeURIComponent(c.url)
8814 },
8815 process: function () {
8816 d.state = "processing", a(".title-as-link-option .loading-indicator").show(), a(".oembed-content-block").hide(), a('button[type="submit"]').addClass("loading"), a.embedly.oembed(d.url, {
8817 maxheight: 120,
8818 maxwidth: 120
8819 }).done(function (c) {
8820 var e = c[0];
8821 if (d.state = "idle", a(".title-as-link-option .loading-indicator").hide(), e && !e.error_code) {
8822 if (e.title) {
8823 a(".oembed-content-block .title").html(e.title), a("#sharedLinkTitle").val(e.title);
8824 var f = a("input#title.title-field.box"),
8825 g = b.contextFor(f.get(0)).$data.titlePlaceholder();
8826 if ("" === f.val() || f.val() === g || f.val() === f.data("autogenValue")) {
8827 var h = d.truncate(e.title, 75);
8828 f.data("autogenValue", h), a("input#title.title-field.box").val(h)
8829 } else f.data("autogenValue", !1)
8830 } else a(".oembed-content-block .title").html(""), a("#sharedLinkTitle").val("");
8831 if (e.description ? (a(".oembed-content-block .description").html(e.description), a("#sharedLinkDescription").val(e.description)) : (a(".oembed-content-block .description").html(""), a("#sharedLinkDescription").val("")), e.original_url ? (a(".oembed-content-block .provider_name").html(d.getHostName(e.original_url)), a("#sharedLinkProvider").val(d.getHostName(e.original_url))) : (a(".oembed-content-block .provider_name").html(""), a("#sharedLinkProvider").val("")), e.thumbnail_url) {
8832 var i = d.recropImage(e.thumbnail_url);
8833 a(".oembed-content-block .thumbnail-image").html('<img src="' + i + '" />'), a(".oembed-content-block .thumbnail").show(), a(".oembed-content-block .meta").removeClass("no-thumb"), a("#sharedLinkThumbnail").val(e.thumbnail_url), a("#sharedLinkImage").val(d.fullImage(e.thumbnail_url))
8834 } else a(".oembed-content-block .thumbnail-image").html(""), a(".oembed-content-block .thumbnail").hide(), a(".oembed-content-block .meta").addClass("no-thumb"), a("#sharedLinkThumbnail").val(""), a("#sharedLinkImage").val("");
8835 a(".oembed-content-block").show()
8836 } else a(".oembed-content-block").hide();
8837 a('button[type="submit"]').removeClass("loading"), d.stopTimer()
8838 })
8839 },
8840 startTimer: function () {
8841 d.state = "countdown", d.timer = setInterval(function () {
8842 d.remaining > 0 ? d.remaining = d.remaining - 1 : d.process()
8843 }, 1e3)
8844 },
8845 stopTimer: function () {
8846 clearInterval(d.timer), d.remaining = 0
8847 }
8848 };
8849 return d
8850 }), define("views/submit_page", ["underscoreLoader", "jqueryLoader", "knockoutLoader", "../mixins/lifecycle_mixin", "../mixins/toggle_live_preview_mixin", "./user", "marked", "../lib/remove_diacritics", "../lib/link_share_context_lookup"], function (a, b, c, d, e, f, g, h, i) {
8851 var j = function (d) {
8852 var e = this;
8853 a.isUndefined(d) && (d = {}), d = a.defaults(d, {
8854 user: {},
8855 titlePlaceholder: "",
8856 linkPlaceholder: "",
8857 bodyPlaceholder: ""
8858 }), this.isA = function () {
8859 return "SubmitPage"
8860 }, c.mapping.fromJS(d, {
8861 user: {
8862 key: function (a) {
8863 return c.utils.unwrapObservable(a.id)
8864 },
8865 create: function (a) {
8866 return new f(a.data)
8867 }
8868 }
8869 }, this), window.currentUser = this.user, this.isSubmitting = c.observable(!1), b(".thumbnail .thumbnail-remove").on("click", function (a) {
8870 a.preventDefault(), b(".oembed-content-block .thumbnail-image").html(""), b(".oembed-content-block .thumbnail").hide(), b("#sharedLinkThumbnail").val(""), b(".oembed-content-block .meta").addClass("no-thumb")
8871 }), b("#sharedLinkURL").on("keyup input focus", function () {
8872 i.register()
8873 }), this.submit = function (a, c) {
8874 return b('button[type="submit"]').hasClass("loading") ? !1 : ("" === b("#sharedLinkProvider").val() ? b(".title-as-link-option .content input").each(function () {
8875 b(this).val(""), b(this)[0].removeAttribute("required")
8876 }) : b(".title-as-link-option .content input").each(function () {
8877 b(this).attr("required", !0)
8878 }), "" == b("#application_id").val() ? (b("#boardSelectError").css("display", "inline-block"), b("#styled-dropdown-application_id").addClass("error"), !1) : this.unsavedPoll() ? (this.savePoll(function () {
8879 $(c.target).trigger(c.type)
8880 }), !1) : this.unsavedAttachments() ? (this.saveAttachments(function () {
8881 $(c.target).trigger(c.type)
8882 }), !1) : this.isSubmitting() ? !1 : b("#title").val() == this.titlePlaceholder() ? (b(".title-field").addClass("error"), !1) : b("#body").val() == this.bodyPlaceholder() ? (b(".body-field").addClass("error"), !1) : ("" !== b("#title").val() && "" !== b("#body").val() && this.isSubmitting(!0), !0))
8883 }, this.canAcceptAttachments = c.computed(function () {
8884 return window.Modernizr.flash || window.Modernizr.fileinput
8885 }), this.unsavedPoll = function () {
8886 if (!b.hasOwnProperty("athenaInstances")) return !1;
8887 var a = b.athenaInstances().first().athenaObject(),
8888 c = b("#poll_id").val();
8889 return a.isEmpty() || c ? !1 : !0
8890 }, this.savePoll = function (a) {
8891 var c = b.athenaInstances().first().athenaObject();
8892 c.isValid() && c.poll.isNew() && c.save({
8893 success: function (c) {
8894 var d = c.get("id");
8895 b("#poll_id").val(d), a()
8896 }
8897 })
8898 }, this.cancelPoll = function (a, c) {
8899 var d = b.athenaInstances().first().athenaObject();
8900 d.clear(), b(".poll-container input, .poll-container textarea").val(null)
8901 }, this.unsavedAttachments = function () {
8902 var a = e.submitPluploader.getUploadQueue();
8903 return a && a.files ? 0 === a.files.length ? !1 : a.files.length === a.total.uploaded ? !1 : !0 : !1
8904 }, this.saveAttachments = function (a) {
8905 var b = e.submitPluploader.getUploadQueue();
8906 b || a(), b.bind("StateChanged", function () {
8907 b.files.length === b.total.uploaded + b.total.failed && a()
8908 }), b.start()
8909 }, this.submitPluploader = new c.pluploader.viewModel({
8910 totalFilesAdded: 0,
8911 totalFilesUploaded: 0,
8912 maxFiles: 4
8913 }), this.userTitle = c.observable(this.titlePlaceholder()), this.userLink = c.observable(this.linkPlaceholder()), this.slug = c.computed(function () {
8914 var b = a.str.slugify(h(this.userTitle()));
8915 return b
8916 }, this), b("#body").val() ? this.userText = c.observable(b("#body").val()) : this.userText = c.observable(this.bodyPlaceholder());
8917 var j = new g,
8918 k = e.bodyPlaceholder();
8919 this.markdownParsedText = c.computed(function () {
8920 var a = e.userText();
8921 return a == k ? "" : j.parse(a)
8922 }), b("#title").bind("change", function () {
8923 b(this).val() !== e.titlePlaceholder() && b(".title-field").removeClass("error")
8924 }), b("#body").bind("change", function () {
8925 b(this).val() !== e.bodyPlaceholder() && b(".body-field").removeClass("error")
8926 }), this.afterLoad = function () {}
8927 };
8928 return j.prototype = {}, a.extend(j.prototype, d), a.extend(j.prototype, e), j
8929 }), define("views/rioter_comment_list_page", ["underscoreLoader", "jqueryLoader", "knockoutLoader", "./comment", "../mixins/lifecycle_mixin"], function (a, b, c, d, e) {
8930 var f = function (e) {
8931 var f = this;
8932 this.isA = function () {
8933 return "RioterCommentListPage"
8934 }, c.mapping.fromJS(e, {
8935 comments: {
8936 key: function (a) {
8937 return c.utils.unwrapObservable(a.id)
8938 },
8939 create: function (a) {
8940 return new d(a.data)
8941 }
8942 }
8943 }, this), this.commentBeingFetchedFromServer = c.observable(null), this.currentCommentPointer = c.observable(0), this.totalComments = c.computed(function () {
8944 return f.comments().length
8945 }), this.currentComment = c.computed(function () {
8946 return f.comments()[f.currentCommentPointer()]
8947 }), this.nextComment = function () {
8948 return f.currentCommentPointer() < f.totalComments() - 1 ? f.currentCommentPointer(f.currentCommentPointer() + 1) : f.currentCommentPointer(0)
8949 }, this.prevComment = function () {
8950 return f.currentCommentPointer() > 0 ? f.currentCommentPointer(f.currentCommentPointer() - 1) : f.currentCommentPointer(f.totalComments() - 1)
8951 }, this.scrollToComment = function (d) {
8952 var e = a.isString(d) ? d : f.currentComment().id(),
8953 g = b("#comment-" + e);
8954 g.size() > 0 ? (b(".nested-comment.scroll-to-highlighted").removeClass("scroll-to-highlighted"), b("html, body").stop().animate({
8955 scrollTop: b(g).offset().top - 10
8956 }, {
8957 easing: "easeInOutQuad",
8958 duration: 1500
8959 }).promise().done(function () {
8960 b(g).addClass("scroll-to-highlighted")
8961 })) : f.commentBeingFetchedFromServer() == e || (f.commentBeingFetchedFromServer(e), c.postbox.publish("discussion:fetchCommentTree", e))
8962 }, c.postbox.subscribe("discussion:newCommentTree", function (a) {
8963 f.commentBeingFetchedFromServer() == a ? (f.scrollToComment(a), f.commentBeingFetchedFromServer(null)) : console && console.log("This is not the comment you are looking for")
8964 }), c.postbox.subscribe("riotCommentWidget:scrollToComment", function (a) {
8965 f.scrollToComment(a)
8966 })
8967 };
8968 return f.prototype = {}, a.extend(f.prototype, e), f
8969 }), define("views/comment_attachments_form", ["underscoreLoader", "jqueryLoader", "knockoutLoader", "../mixins/lifecycle_mixin"], function (a, b, c, d) {
8970 var e = function (d) {
8971 var e = this;
8972 a.isUndefined(d) && (d = {}), d = a.defaults(d, {}), this.isA = function () {
8973 return "CommentAttachmentsForm"
8974 };
8975 var f = function () {
8976 b("#uploader").remove()
8977 };
8978 this.parentWindow = !1, window.opener ? this.parentWindow = window.opener : window.parent !== window && (this.parentWindow = window.parent), this.parentWindow !== !1 && this.parentWindow.location.hostname.match(/leagueoflegends.com[:0-9]*$/) ? this.parentOrigin = this.parentWindow.location.origin : f(), c.mapping.fromJS(d, {}, this), this.submitPluploader = new c.pluploader.viewModel({
8979 totalFilesAdded: 0,
8980 totalFilesUploaded: 0,
8981 maxFiles: 1
8982 }), this.tooManyUploadsError = c.observable(!1), this.postPluploadLoad = function (a) {
8983 e.uploader = a, a.bind("FileUploaded", function (a, c, d) {
8984 var f = $.parseXML(d.response),
8985 g = b(f).find("Location").text();
8986 window.navigator.userAgent.match(/msie/i) || window.navigator.userAgent.match(/trident/i) ? e.parentWindow.fakePostMessage(g) : e.parentWindow.postMessage(g, e.parentOrigin)
8987 })
8988 }
8989 };
8990 return e.prototype = {}, a.extend(e.prototype, d), e
8991 }), define("app_ko", ["require", "underscoreLoader", "jqueryLoader", "knockoutLoader", "riot", "riotbar", "i18n/translator", "lib/global_ui", "views/discussion_show_page", "views/submit_page", "views/rioter_comment_list_page", "views/comment_attachments_form", "underscore.string"], function (a, b, c, d, e, f, g, h) {
8992 var i = function () {
8993 var h = function () {
8994 this.viewModels = []
8995 };
8996 return h.prototype = {
8997 init: function () {
8998 var a = this;
8999 b.bindAll(this, "init", "loadViewModel"), g.setCultureIdentifierFromPVPNetLanguageIdentifier(e.Sandworm.getLang().toLowerCase()), f.account.getSummonerName() || c(".requires-auth").click(function (a) {
9000 a.preventDefault(), f.account.login()
9001 }), document.apolloPageBootstrap = document.apolloPageBootstrap || [], b.each(document.apolloPageBootstrap, a.loadViewModel, this)
9002 },
9003 loadViewModel: function (e) {
9004 var f;
9005 b.defaults(e, {
9006 name: "",
9007 data: {},
9008 element: c("body").get(0)
9009 });
9010 var g = "./views/" + b.str.underscored(e.name);
9011 return f = new(a(g))(e.data), void 0 !== f && (this.viewModels.push(f), d.applyBindings(f, e.element), this.redraw(e.element), b.defer(function () {
9012 f.afterLoad()
9013 })), f
9014 },
9015 redraw: function (a) {
9016 b.defer(function () {
9017 c(a).find(".knockout-provided").show(), c(a).find(".knockout-provided").removeClass("knockout-provided"), "undefined" != typeof i18nStrings && c("a.lightbox").colorbox({
9018 close: i18nStrings.hide.toUpperCase(),
9019 maxWidth: "80%",
9020 maxHeight: "80%"
9021 })
9022 })
9023 }
9024 }, h
9025 }();
9026 return h.unsafeLinks.startMonitoring(), h.returnToTop.startMonitoring(), h.commentScrollCheck.startMonitoring(), h.disableMobile.attach(), new i
9027 }), require("app_ko")
9028});