PageSourceSearch

https://www.idc-otsuka.jp/item/html/template/default/customize/assets/js/item/web.assets_common.js

js idc-otsuka.jp collected 2026-09-27 21:30:45 UTC 1,186,757 bytes, 41,853 lines download raw bytes

vendor: 12,942 bytes, lines 1-427
1/* /web/static/lib/es5-shim/es5-shim.min.js defined in bundle 'web.assets_common' */
2(function(definition) {
3if (typeof define == "function") {
4define(definition)
5} else if (typeof YUI == "function") {
6YUI.add("es5", definition)
7} else {
8definition()
9}
10}
11)(function() {
12function Empty() {}
13if (!Function.prototype.bind) {
14Function.prototype.bind = function bind(that) {
15var target = this;
16if (typeof target != "function") {
17throw new TypeError("Function.prototype.bind called on incompatible " + target)
18}
19var args = _Array_slice_.call(arguments, 1);
20var bound = function() {
21if (this instanceof bound) {
22var result = target.apply(this, args.concat(_Array_slice_.call(arguments)));
23if (Object(result) === result) {
24return result
25}
26return this
27} else {
28return target.apply(that, args.concat(_Array_slice_.call(arguments)))
29}
30};
31if (target.prototype) {
32Empty.prototype = target.prototype;
33bound.prototype = new Empty;
34Empty.prototype = null
35}
36return bound
37}
38}
39var call = Function.prototype.call;
40var prototypeOfArray = Array.prototype;
41var prototypeOfObject = Object.prototype;
42var _Array_slice_ = prototypeOfArray.slice;
43var _toString = call.bind(prototypeOfObject.toString);
44var owns = call.bind(prototypeOfObject.hasOwnProperty);
45var defineGetter;
46var defineSetter;
47var lookupGetter;
48var lookupSetter;
49var supportsAccessors;
50if (supportsAccessors = owns(prototypeOfObject, "__defineGetter__")) {
51defineGetter = call.bind(prototypeOfObject.__defineGetter__);
52defineSetter = call.bind(prototypeOfObject.__defineSetter__);
53lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
54lookupSetter = call.bind(prototypeOfObject.__lookupSetter__)
55}
56if ([1, 2].splice(0).length != 2) {
57var array_splice = Array.prototype.splice;
58if (function() {
59function makeArray(l) {
60var a = [];
61while (l--) {
62a.unshift(l)
63}
64return a
65}
66var array = [], lengthBefore;
67array.splice.bind(array, 0, 0).apply(null, makeArray(20));
68array.splice.bind(array, 0, 0).apply(null, makeArray(26));
69lengthBefore = array.length;
70array.splice(5, 0, "XXX");
71if (lengthBefore + 1 == array.length) {
72return true
73}
74}()) {
75Array.prototype.splice = function(start, deleteCount) {
76if (!arguments.length) {
77return []
78} else {
79return array_splice.apply(this, [start === void 0 ? 0 : start, deleteCount === void 0 ? this.length - start : deleteCount].concat(_Array_slice_.call(arguments, 2)))
80}
81}
82} else {
83Array.prototype.splice = function(start, deleteCount) {
84var result, args = _Array_slice_.call(arguments, 2), addElementsCount = args.length;
85if (!arguments.length) {
86return []
87}
88if (start === void 0) {
89start = 0
90}
91if (deleteCount === void 0) {
92deleteCount = this.length - start
93}
94if (addElementsCount > 0) {
95if (deleteCount <= 0) {
96if (start == this.length) {
97this.push.apply(this, args);
98return []
99}
100if (start == 0) {
101this.unshift.apply(this, args);
102return []
103}
104}
105result = _Array_slice_.call(this, start, start + deleteCount);
106args.push.apply(args, _Array_slice_.call(this, start + deleteCount, this.length));
107args.unshift.apply(args, _Array_slice_.call(this, 0, start));
108args.unshift(0, this.length);
109array_splice.apply(this, args);
110return result
111}
112return array_splice.call(this, start, deleteCount)
113}
114}
115}
116if ([].unshift(0) != 1) {
117var array_unshift = Array.prototype.unshift;
118Array.prototype.unshift = function() {
119array_unshift.apply(this, arguments);
120return this.length
121}
122}
123if (!Array.isArray) {
124Array.isArray = function isArray(obj) {
125return _toString(obj) == "[object Array]"
126}
127}
128var boxedString = Object("a")
129  , splitString = boxedString[0] != "a" || !(0 in boxedString);
130if (!Array.prototype.forEach) {
131Array.prototype.forEach = function forEach(fun) {
132var object = toObject(this)
133  , self = splitString && _toString(this) == "[object String]" ? this.split("") : object
134  , thisp = arguments[1]
135  , i = -1
136  , length = self.length >>> 0;
137if (_toString(fun) != "[object Function]") {
138throw new TypeError
139}
140while (++i < length) {
141if (i in self) {
142fun.call(thisp, self[i], i, object)
143}
144}
145}
146}
147if (!Array.prototype.map) {
148Array.prototype.map = function map(fun) {
149var object = toObject(this)
150  , self = splitString && _toString(this) == "[object String]" ? this.split("") : object
151  , length = self.length >>> 0
152  , result = Array(length)
153  , thisp = arguments[1];
154if (_toString(fun) != "[object Function]") {
155throw new TypeError(fun + " is not a function")
156}
157for (var i = 0; i < length; i++) {
158if (i in self)
159result[i] = fun.call(thisp, self[i], i, object)
160}
161return result
162}
163}
164if (!Array.prototype.filter) {
165Array.prototype.filter = function filter(fun) {
166var object = toObject(this), self = splitString && _toString(this) == "[object String]" ? this.split("") : object, length = self.length >>> 0, result = [], value, thisp = arguments[1];
167if (_toString(fun) != "[object Function]") {
168throw new TypeError(fun + " is not a function")
169}
170for (var i = 0; i < length; i++) {
171if (i in self) {
172value = self[i];
173if (fun.call(thisp, value, i, object)) {
174result.push(value)
175}
176}
177}
178return result
179}
180}
181if (!Array.prototype.every) {
182Array.prototype.every = function every(fun) {
183var object = toObject(this)
184  , self = splitString && _toString(this) == "[object String]" ? this.split("") : object
185  , length = self.length >>> 0
186  , thisp = arguments[1];
187if (_toString(fun) != "[object Function]") {
188throw new TypeError(fun + " is not a function")
189}
190for (var i = 0; i < length; i++) {
191if (i in self && !fun.call(thisp, self[i], i, object)) {
192return false
193}
194}
195return true
196}
197}
198if (!Array.prototype.some) {
199Array.prototype.some = function some(fun) {
200var object = toObject(this)
201  , self = splitString && _toString(this) == "[object String]" ? this.split("") : object
202  , length = self.length >>> 0
203  , thisp = arguments[1];
204if (_toString(fun) != "[object Function]") {
205throw new TypeError(fun + " is not a function")
206}
207for (var i = 0; i < length; i++) {
208if (i in self && fun.call(thisp, self[i], i, object)) {
209return true
210}
211}
212return false
213}
214}
215if (!Array.prototype.reduce) {
216Array.prototype.reduce = function reduce(fun) {
217var object = toObject(this)
218  , self = splitString && _toString(this) == "[object String]" ? this.split("") : object
219  , length = self.length >>> 0;
220if (_toString(fun) != "[object Function]") {
221throw new TypeError(fun + " is not a function")
222}
223if (!length && arguments.length == 1) {
224throw new TypeError("reduce of empty array with no initial value")
225}
226var i = 0;
227var result;
228if (arguments.length >= 2) {
229result = arguments[1]
230} else {
231do {
232if (i in self) {
233result = self[i++];
234break
235}
236if (++i >= length) {
237throw new TypeError("reduce of empty array with no initial value")
238}
239} while (true)
240}
241for (; i < length; i++) {
242if (i in self) {
243result = fun.call(void 0, result, self[i], i, object)
244}
245}
246return result
247}
248}
249if (!Array.prototype.reduceRight) {
250Array.prototype.reduceRight = function reduceRight(fun) {
251var object = toObject(this)
252  , self = splitString && _toString(this) == "[object String]" ? this.split("") : object
253  , length = self.length >>> 0;
254if (_toString(fun) != "[object Function]") {
255throw new TypeError(fun + " is not a function")
256}
257if (!length && arguments.length == 1) {
258throw new TypeError("reduceRight of empty array with no initial value")
259}
260var result, i = length - 1;
261if (arguments.length >= 2) {
262result = arguments[1]
263} else {
264do {
265if (i in self) {
266result = self[i--];
267break
268}
269if (--i < 0) {
270throw new TypeError("reduceRight of empty array with no initial value")
271}
272} while (true)
273}
274if (i < 0) {
275return result
276}
277do {
278if (i in this) {
279result = fun.call(void 0, result, self[i], i, object)
280}
281} while (i--);return result
282}
283}
284if (!Array.prototype.indexOf || [0, 1].indexOf(1, 2) != -1) {
285Array.prototype.indexOf = function indexOf(sought) {
286var self = splitString && _toString(this) == "[object String]" ? this.split("") : toObject(this)
287  , length = self.length >>> 0;
288if (!length) {
289return -1
290}
291var i = 0;
292if (arguments.length > 1) {
293i = toInteger(arguments[1])
294}
295i = i >= 0 ? i : Math.max(0, length + i);
296for (; i < length; i++) {
297if (i in self && self[i] === sought) {
298return i
299}
300}
301return -1
302}
303}
304if (!Array.prototype.lastIndexOf || [0, 1].lastIndexOf(0, -3) != -1) {
305Array.prototype.lastIndexOf = function lastIndexOf(sought) {
306var self = splitString && _toString(this) == "[object String]" ? this.split("") : toObject(this)
307  , length = self.length >>> 0;
308if (!length) {
309return -1
310}
311var i = length - 1;
312if (arguments.length > 1) {
313i = Math.min(i, toInteger(arguments[1]))
314}
315i = i >= 0 ? i : length - Math.abs(i);
316for (; i >= 0; i--) {
317if (i in self && sought === self[i]) {
318return i
319}
320}
321return -1
322}
323}
324if (!Object.keys) {
325var hasDontEnumBug = true
326  , dontEnums = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"]
327  , dontEnumsLength = dontEnums.length;
328for (var key in {
329toString: null
330}) {
331hasDontEnumBug = false
332}
333Object.keys = function keys(object) {
334if (typeof object != "object" && typeof object != "function" || object === null) {
335throw new TypeError("Object.keys called on a non-object")
336}
337var keys = [];
338for (var name in object) {
339if (owns(object, name)) {
340keys.push(name)
341}
342}
343if (hasDontEnumBug) {
344for (var i = 0, ii = dontEnumsLength; i < ii; i++) {
345var dontEnum = dontEnums[i];
346if (owns(object, dontEnum)) {
347keys.push(dontEnum)
348}
349}
350}
351return keys
352}
353}
354var negativeDate = -621987552e5
355  , negativeYearString = "-000001";
356if (!Date.prototype.toISOString || new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1) {
357Date.prototype.toISOString = function toISOString() {
358var result, length, value, year, month;
359if (!isFinite(this)) {
360throw new RangeError("Date.prototype.toISOString called on non-finite value.")
361}
362year = this.getUTCFullYear();
363month = this.getUTCMonth();
364year += Math.floor(month / 12);
365month = (month % 12 + 12) % 12;
366result = [month + 1, this.getUTCDate(), this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds()];
367year = (year < 0 ? "-" : year > 9999 ? "+" : "") + ("00000" + Math.abs(year)).slice(0 <= year && year <= 9999 ? -4 : -6);
368length = result.length;
369while (length--) {
370value = result[length];
371if (value < 10) {
372result[length] = "0" + value
373}
374}
375return year + "-" + result.slice(0, 2).join("-") + "T" + result.slice(2).join(":") + "." + ("000" + this.getUTCMilliseconds()).slice(-3) + "Z"
376}
377}
378var dateToJSONIsSupported = false;
379try {
380dateToJSONIsSupported = Date.prototype.toJSON && new Date(NaN).toJSON() === null && new Date(negativeDate).toJSON().indexOf(negativeYearString) !== -1 && Date.prototype.toJSON.call({
381toISOString: function() {
382return true
383}
384})
385} catch (e) {}
386if (!dateToJSONIsSupported) {
387Date.prototype.toJSON = function toJSON(key) {
388var o = Object(this), tv = toPrimitive(o), toISO;
389if (typeof tv === "number" && !isFinite(tv)) {
390return null
391}
392toISO = o.toISOString;
393if (typeof toISO != "function") {
394throw new TypeError("toISOString property is not callable")
395}
396return toISO.call(o)
397}
398}
399if (!Date.parse || "Date.parse is buggy") {
400Date = function(NativeDate) {
401function Date(Y, M, D, h, m, s, ms) {
402var length = arguments.length;
403if (this instanceof NativeDate) {
404var date = length == 1 && String(Y) === Y ? new NativeDate(Date.parse(Y)) : length >= 7 ? new NativeDate(Y,M,D,h,m,s,ms) : length >= 6 ? new NativeDate(Y,M,D,h,m,s) : length >= 5 ? new NativeDate(Y,M,D,h,m) : length >= 4 ? new NativeDate(Y,M,D,h) : length >= 3 ? new NativeDate(Y,M,D) : length >= 2 ? new NativeDate(Y,M) : length >= 1 ? new NativeDate(Y) : new NativeDate;
405date.constructor = Date;
406return date
407}
408return NativeDate.apply(this, arguments)
409}
410var isoDateExpression = new RegExp("^" + "(\\d{4}|[+-]\\d{6})" + "(?:-(\\d{2})" + "(?:-(\\d{2})" + "(?:" + "T(\\d{2})" + ":(\\d{2})" + "(?:" + ":(\\d{2})" + "(?:(\\.\\d{1,}))?" + ")?" + "(" + "Z|" + "(?:" + "([-+])" + "(\\d{2})" + ":(\\d{2})" + ")" + ")?)?)?)?" + "$");
411var months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];
412function dayFromMonth(year, month) {
413var t = month > 1 ? 1 : 0;
414return months[month] + Math.floor((year - 1969 + t) / 4) - Math.floor((year - 1901 + t) / 100) + Math.floor((year - 1601 + t) / 400) + 365 * (year - 1970)
415}
416for (var key in NativeDate) {
417Date[key] = NativeDate[key]
418}
419Date.now = NativeDate.now;
420Date.UTC = NativeDate.UTC;
421Date.prototype = NativeDate.prototype;
422Date.prototype.constructor = Date;
423Date.parse = function parse(string) {
424var match = isoDateExpression.exec(string);
425if (match) {
426var year = Number(match[1]), month = Number(match[2] || 1) - 1, day = Number(match[3] || 1) - 1, hour = Number(match[4] || 0), minute = Number(match[5] || 0), second = Number(match[6] || 0), millisecond = Math.floor(Number(match[7] || 0) * 1e3), offset = !match[4] || match[8] ? 0 : Number(new NativeDate(1970,0)), signOffset = match[9] === "-" ? 1 : -1, hourOffset = Number(match[10] || 0), minuteOffset = Number(match[11] || 0), result;
427if (hour < (minute > 0 || second > 0 || millisecond > 0 ? 24 : 25) && minute < 60 && second < 60 && millisecond < 1e3 && month > -1 && month < 12 && hourOffset < 24 && minuteOffset < 60 && day >
427 -1 && day < dayFromMonth(year, month + 1) - dayFromMonth(year, month)) {
428result = ((dayFromMonth(year, month) + day) * 24 + hour + hourOffset * signOffset) * 60;
429result = ((result + minute + minuteOffset * signOffset) * 60 + second) * 1e3 + millisecond + offset;
430if (-864e13 <= result && result <= 864e13) {
431return result
432}
433}
434return NaN
435}
436return NativeDate.parse.apply(this, arguments)
437}
438;
439return Date
440}(Date)
441}
442if (!Date.now) {
443Date.now = function now() {
444return (new Date).getTime()
445}
446}
447if (!Number.prototype.toFixed || 8e-5.toFixed(3) !== "0.000" || .9.toFixed(0) === "0" || 1.255.toFixed(2) !== "1.25" || 0xde0b6b3a7640080.toFixed(0) !== "1000000000000000128") {
448(function() {
449var base, size, data, i;
450base = 1e7;
451size = 6;
452data = [0, 0, 0, 0, 0, 0];
453function multiply(n, c) {
454var i = -1;
455while (++i < size) {
456c += n * data[i];
457data[i] = c % base;
458c = Math.floor(c / base)
459}
460}
461function divide(n) {
462var i = size
463  , c = 0;
464while (--i >= 0) {
465c += data[i];
466data[i] = Math.floor(c / n);
467c = c % n * base
468}
469}
470function toString() {
471var i = size;
472var s = "";
473while (--i >= 0) {
474if (s !== "" || i === 0 || data[i] !== 0) {
475var t = String(data[i]);
476if (s === "") {
477s = t
478} else {
479s += "0000000".slice(0, 7 - t.length) + t
480}
481}
482}
483return s
484}
485function pow(x, n, acc) {
486return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc)
487}
488function log(x) {
489var n = 0;
490while (x >= 4096) {
491n += 12;
492x /= 4096
493}
494while (x >= 2) {
495n += 1;
496x /= 2
497}
498return n
499}
500Number.prototype.toFixed = function(fractionDigits) {
501var f, x, s, m, e, z, j, k;
502f = Number(fractionDigits);
503f = f !== f ? 0 : Math.floor(f);
504if (f < 0 || f > 20) {
505throw new RangeError("Number.toFixed called with invalid number of decimals")
506}
507x = Number(this);
508if (x !== x) {
509return "NaN"
510}
511if (x <= -1e21 || x >= 1e21) {
512return String(x)
513}
514s = "";
515if (x < 0) {
516s = "-";
517x = -x
518}
519m = "0";
520if (x > 1e-21) {
521e = log(x * pow(2, 69, 1)) - 69;
522z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);
523z *= 4503599627370496;
524e = 52 - e;
525if (e > 0) {
526multiply(0, z);
527j = f;
528while (j >= 7) {
529multiply(1e7, 0);
530j -= 7
531}
532multiply(pow(10, j, 1), 0);
533j = e - 1;
534while (j >= 23) {
535divide(1 << 23);
536j -= 23
537}
538divide(1 << j);
539multiply(1, 1);
540divide(2);
541m = toString()
542} else {
543multiply(0, z);
544multiply(1 << -e, 0);
545m = toString() + "0.00000000000000000000".slice(2, 2 + f)
546}
547}
548if (f > 0) {
549k = m.length;
550if (k <= f) {
551m = s + "0.0000000000000000000".slice(0, f - k + 2) + m
552} else {
553m = s + m.slice(0, k - f) + "." + m.slice(k - f)
554}
555} else {
556m = s + m
557}
558return m
559}
560}
561)()
562}
563var string_split = String.prototype.split;
564if ("ab".split(/(?:ab)*/).length !== 2 || ".".split(/(.?)(.?)/).length !== 4 || "tesst".split(/(s)*/)[1] === "t" || "".split(/.?/).length === 0 || ".".split(/()()/).length > 1) {
565(function() {
566var compliantExecNpcg = /()??/.exec("")[1] === void 0;
567String.prototype.split = function(separator, limit) {
568var string = this;
569if (separator === void 0 && limit === 0)
570return [];
571if (Object.prototype.toString.call(separator) !== "[object RegExp]") {
572return string_split.apply(this, arguments)
573}
574var output = [], flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.extended ? "x" : "") + (separator.sticky ? "y" : ""), lastLastIndex = 0, separator = new RegExp(separator.source,flags + "g"), separator2, match, lastIndex, lastLength;
575string += "";
576if (!compliantExecNpcg) {
577separator2 = new RegExp("^" + separator.source + "$(?!\\s)",flags)
578}
579limit = limit === void 0 ? -1 >>> 0 : limit >>> 0;
580while (match = separator.exec(string)) {
581lastIndex = match.index + match[0].length;
582if (lastIndex > lastLastIndex) {
583output.push(string.slice(lastLastIndex, match.index));
584if (!compliantExecNpcg && match.length > 1) {
585match[0].replace(separator2, function() {
586for (var i = 1; i < arguments.length - 2; i++) {
587if (arguments[i] === void 0) {
588match[i] = void 0
589}
590}
591})
592}
593if (match.length > 1 && match.index < string.length) {
594Array.prototype.push.apply(output, match.slice(1))
595}
596lastLength = match[0].length;
597lastLastIndex = lastIndex;
598if (output.length >= limit) {
599break
600}
601}
602if (separator.lastIndex === match.index) {
603separator.lastIndex++
604}
605}
606if (lastLastIndex === string.length) {
607if (lastLength || !separator.test("")) {
608output.push("")
609}
610} else {
611output.push(string.slice(lastLastIndex))
612}
613return output.length > limit ? output.slice(0, limit) : output
614}
615}
616)()
617} else if ("0".split(void 0, 0).length) {
618String.prototype.split = function(separator, limit) {
619if (separator === void 0 && limit === 0)
620return [];
621return string_split.apply(this, arguments)
622}
623}
624if ("".substr && "0b".substr(-1) !== "b") {
625var string_substr = String.prototype.substr;
626String.prototype.substr = function(start, length) {
627return string_substr.call(this, start < 0 ? (start = this.length + start) < 0 ? 0 : start : start, length)
628}
629}
630var ws = "	\n�\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003" + "\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028" + "\u2029\ufeff";
631if (!String.prototype.trim || ws.trim()) {
632ws = "[" + ws + "]";
633var trimBeginRegexp = new RegExp("^" + ws + ws + "*")
634  , trimEndRegexp = new RegExp(ws + ws + "*$");
635String.prototype.trim = function trim() {
636if (this === void 0 || this === null) {
637throw new TypeError("can't convert " + this + " to object")
638}
639return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, "")
640}
641}
642function toInteger(n) {
643n = +n;
644if (n !== n) {
645n = 0
646} else if (n !== 0 && n !== 1 / 0 && n !== -(1 / 0)) {
647n = (n > 0 || -1) * Math.floor(Math.abs(n))
648}
649return n
650}
651function isPrimitive(input) {
652var type = typeof input;
653return input === null || type === "undefined" || type === "boolean" || type === "number" || type === "string"
654}
655function toPrimitive(input) {
656var val, valueOf, toString;
657if (isPrimitive(input)) {
658return input
659}
660valueOf = input.valueOf;
661if (typeof valueOf === "function") {
662val = valueOf.call(input);
663if (isPrimitive(val)) {
664return val
665}
666}
667toString = input.toString;
668if (typeof toString === "function") {
669val = toString.call(input);
670if (isPrimitive(val)) {
671return val
672}
673}
674throw new TypeError
675}
676var toObject = function(o) {
677if (o == null) {
678throw new TypeError("can't convert " + o + " to object")
679}
680return Object(o)
681}
682});
683;
684/* /web/static/lib/underscore/underscore.js defined in bundle 'web.assets_common' */
685(function() {
686var root = this;
687var previousUnderscore = root._;
688var ArrayProto = Array.prototype
689  , ObjProto = Object.prototype
690  , FuncProto = Function.prototype;
691var push = ArrayProto.push
692  , slice = ArrayProto.slice
693  , toString = ObjProto.toString
694  , hasOwnProperty = ObjProto.hasOwnProperty;
695var nativeIsArray = Array.isArray
696  , nativeKeys = Object.keys
697  , nativeBind = FuncProto.bind
698  , nativeCreate = Object.create;
699var Ctor = function() {};
700var _ = function(obj) {
701if (obj instanceof _)
702return obj;
703if (!(this instanceof _))
704return new _(obj);
705this._wrapped = obj;
706};
707if (typeof exports !== 'undefined') {
708if (typeof module !== 'undefined' && module.exports) {
709exports = module.exports = _;
710}
711exports._ = _;
712} else {
713root._ = _;
714}
715_.VERSION = '1.8.2';
716var optimizeCb = function(func, context, argCount) {
717if (context === void 0)
718return func;
719switch (argCount == null ? 3 : argCount) {
720case 1:
721return function(value) {
722return func.call(context, value);
723}
724;
725case 2:
726return function(value, other) {
727return func.call(context, value, other);
728}
729;
730case 3:
731return function(value, index, collection) {
732return func.call(context, value, index, collection);
733}
734;
735case 4:
736return function(accumulator, value, index, collection) {
737return func.call(context, accumulator, value, index, collection);
738}
739;
740}
741return function() {
742return func.apply(context, arguments);
743}
744;
745};
746var cb = function(value, context, argCount) {
747if (value == null)
748return _.identity;
749if (_.isFunction(value))
750return optimizeCb(value, context, argCount);
751if (_.isObject(value))
752return _.matcher(value);
753return _.property(value);
754};
755_.iteratee = function(value, context) {
756return cb(value, context, Infinity);
757}
758;
759var createAssigner = function(keysFunc, undefinedOnly) {
760return function(obj) {
761var length = arguments.length;
762if (length < 2 || obj == null)
763return obj;
764for (var index = 1; index < length; index++) {
765var source = arguments[index]
766  , keys = keysFunc(source)
767  , l = keys.length;
768for (var i = 0; i < l; i++) {
769var key = keys[i];
vendor: 4,931 bytes, lines 770-958
770if (!undefinedOnly || obj[key] === void 0)
771obj[key] = source[key];
772}
773}
774return obj;
775}
776;
777};
778var baseCreate = function(prototype) {
779if (!_.isObject(prototype))
780return {};
781if (nativeCreate)
782return nativeCreate(prototype);
783Ctor.prototype = prototype;
784var result = new Ctor;
785Ctor.prototype = null;
786return result;
787};
788var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
789var isArrayLike = function(collection) {
790var length = collection && collection.length;
791return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;
792};
793_.each = _.forEach = function(obj, iteratee, context) {
794iteratee = optimizeCb(iteratee, context);
795var i, length;
796if (isArrayLike(obj)) {
797for (i = 0,
798length = obj.length; i < length; i++) {
799iteratee(obj[i], i, obj);
800}
801} else {
802var keys = _.keys(obj);
803for (i = 0,
804length = keys.length; i < length; i++) {
805iteratee(obj[keys[i]], keys[i], obj);
806}
807}
808return obj;
809}
810;
811_.map = _.collect = function(obj, iteratee, context) {
812iteratee = cb(iteratee, context);
813var keys = !isArrayLike(obj) && _.keys(obj)
814  , length = (keys || obj).length
815  , results = Array(length);
816for (var index = 0; index < length; index++) {
817var currentKey = keys ? keys[index] : index;
818results[index] = iteratee(obj[currentKey], currentKey, obj);
819}
820return results;
821}
822;
823function createReduce(dir) {
824function iterator(obj, iteratee, memo, keys, index, length) {
825for (; index >= 0 && index < length; index += dir) {
826var currentKey = keys ? keys[index] : index;
827memo = iteratee(memo, obj[currentKey], currentKey, obj);
828}
829return memo;
830}
831return function(obj, iteratee, memo, context) {
832iteratee = optimizeCb(iteratee, context, 4);
833var keys = !isArrayLike(obj) && _.keys(obj)
834  , length = (keys || obj).length
835  , index = dir > 0 ? 0 : length - 1;
836if (arguments.length < 3) {
837memo = obj[keys ? keys[index] : index];
838index += dir;
839}
840return iterator(obj, iteratee, memo, keys, index, length);
841}
842;
843}
844_.reduce = _.foldl = _.inject = createReduce(1);
845_.reduceRight = _.foldr = createReduce(-1);
846_.find = _.detect = function(obj, predicate, context) {
847var key;
848if (isArrayLike(obj)) {
849key = _.findIndex(obj, predicate, context);
850} else {
851key = _.findKey(obj, predicate, context);
852}
853if (key !== void 0 && key !== -1)
854return obj[key];
855}
856;
857_.filter = _.select = function(obj, predicate, context) {
858var results = [];
859predicate = cb(predicate, context);
860_.each(obj, function(value, index, list) {
861if (predicate(value, index, list))
862results.push(value);
863});
864return results;
865}
866;
867_.reject = function(obj, predicate, context) {
868return _.filter(obj, _.negate(cb(predicate)), context);
869}
870;
871_.every = _.all = function(obj, predicate, context) {
872predicate = cb(predicate, context);
873var keys = !isArrayLike(obj) && _.keys(obj)
874  , length = (keys || obj).length;
875for (var index = 0; index < length; index++) {
876var currentKey = keys ? keys[index] : index;
877if (!predicate(obj[currentKey], currentKey, obj))
878return false;
879}
880return true;
881}
882;
883_.some = _.any = function(obj, predicate, context) {
884predicate = cb(predicate, context);
885var keys = !isArrayLike(obj) && _.keys(obj)
886  , length = (keys || obj).length;
887for (var index = 0; index < length; index++) {
888var currentKey = keys ? keys[index] : index;
889if (predicate(obj[currentKey], currentKey, obj))
890return true;
891}
892return false;
893}
894;
895_.contains = _.includes = _.include = function(obj, target, fromIndex) {
896if (!isArrayLike(obj))
897obj = _.values(obj);
898return _.indexOf(obj, target, typeof fromIndex == 'number' && fromIndex) >= 0;
899}
900;
901_.invoke = function(obj, method) {
902var args = slice.call(arguments, 2);
903var isFunc = _.isFunction(method);
904return _.map(obj, function(value) {
905var func = isFunc ? method : value[method];
906return func == null ? func : func.apply(value, args);
907});
908}
909;
910_.pluck = function(obj, key) {
911return _.map(obj, _.property(key));
912}
913;
914_.where = function(obj, attrs) {
915return _.filter(obj, _.matcher(attrs));
916}
917;
918_.findWhere = function(obj, attrs) {
919return _.find(obj, _.matcher(attrs));
920}
921;
922_.max = function(obj, iteratee, context) {
923var result = -Infinity, lastComputed = -Infinity, value, computed;
924if (iteratee == null && obj != null) {
925obj = isArrayLike(obj) ? obj : _.values(obj);
926for (var i = 0, length = obj.length; i < length; i++) {
927value = obj[i];
928if (value > result) {
929result = value;
930}
931}
932} else {
933iteratee = cb(iteratee, context);
934_.each(obj, function(value, index, list) {
935computed = iteratee(value, index, list);
936if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
937result = value;
938lastComputed = computed;
939}
940});
941}
942return result;
943}
944;
945_.min = function(obj, iteratee, context) {
946var result = Infinity, lastComputed = Infinity, value, computed;
947if (iteratee == null && obj != null) {
948obj = isArrayLike(obj) ? obj : _.values(obj);
949for (var i = 0, length = obj.length; i < length; i++) {
950value = obj[i];
951if (value < result) {
952result = value;
953}
954}
955} else {
956iteratee = cb(iteratee, context);
957_.each(obj, function(value, index, list) {
958computed = iteratee(value, index, list);
vendor: 7,197 bytes, lines 959-1283
959if (computed < lastComputed || computed === Infinity && result === Infinity) {
960result = value;
961lastComputed = computed;
962}
963});
964}
965return result;
966}
967;
968_.shuffle = function(obj) {
969var set = isArrayLike(obj) ? obj : _.values(obj);
970var length = set.length;
971var shuffled = Array(length);
972for (var index = 0, rand; index < length; index++) {
973rand = _.random(0, index);
974if (rand !== index)
975shuffled[index] = shuffled[rand];
976shuffled[rand] = set[index];
977}
978return shuffled;
979}
980;
981_.sample = function(obj, n, guard) {
982if (n == null || guard) {
983if (!isArrayLike(obj))
984obj = _.values(obj);
985return obj[_.random(obj.length - 1)];
986}
987return _.shuffle(obj).slice(0, Math.max(0, n));
988}
989;
990_.sortBy = function(obj, iteratee, context) {
991iteratee = cb(iteratee, context);
992return _.pluck(_.map(obj, function(value, index, list) {
993return {
994value: value,
995index: index,
996criteria: iteratee(value, index, list)
997};
998}).sort(function(left, right) {
999var a = left.criteria;
1000var b = right.criteria;
1001if (a !== b) {
1002if (a > b || a === void 0)
1003return 1;
1004if (a < b || b === void 0)
1005return -1;
1006}
1007return left.index - right.index;
1008}), 'value');
1009}
1010;
1011var group = function(behavior) {
1012return function(obj, iteratee, context) {
1013var result = {};
1014iteratee = cb(iteratee, context);
1015_.each(obj, function(value, index) {
1016var key = iteratee(value, index, obj);
1017behavior(result, value, key);
1018});
1019return result;
1020}
1021;
1022};
1023_.groupBy = group(function(result, value, key) {
1024if (_.has(result, key))
1025result[key].push(value);
1026else
1027result[key] = [value];
1028});
1029_.indexBy = group(function(result, value, key) {
1030result[key] = value;
1031});
1032_.countBy = group(function(result, value, key) {
1033if (_.has(result, key))
1034result[key]++;
1035else
1036result[key] = 1;
1037});
1038_.toArray = function(obj) {
1039if (!obj)
1040return [];
1041if (_.isArray(obj))
1042return slice.call(obj);
1043if (isArrayLike(obj))
1044return _.map(obj, _.identity);
1045return _.values(obj);
1046}
1047;
1048_.size = function(obj) {
1049if (obj == null)
1050return 0;
1051return isArrayLike(obj) ? obj.length : _.keys(obj).length;
1052}
1053;
1054_.partition = function(obj, predicate, context) {
1055predicate = cb(predicate, context);
1056var pass = []
1057  , fail = [];
1058_.each(obj, function(value, key, obj) {
1059(predicate(value, key, obj) ? pass : fail).push(value);
1060});
1061return [pass, fail];
1062}
1063;
1064_.first = _.head = _.take = function(array, n, guard) {
1065if (array == null)
1066return void 0;
1067if (n == null || guard)
1068return array[0];
1069return _.initial(array, array.length - n);
1070}
1071;
1072_.initial = function(array, n, guard) {
1073return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
1074}
1075;
1076_.last = function(array, n, guard) {
1077if (array == null)
1078return void 0;
1079if (n == null || guard)
1080return array[array.length - 1];
1081return _.rest(array, Math.max(0, array.length - n));
1082}
1083;
1084_.rest = _.tail = _.drop = function(array, n, guard) {
1085return slice.call(array, n == null || guard ? 1 : n);
1086}
1087;
1088_.compact = function(array) {
1089return _.filter(array, _.identity);
1090}
1091;
1092var flatten = function(input, shallow, strict, startIndex) {
1093var output = []
1094  , idx = 0;
1095for (var i = startIndex || 0, length = input && input.length; i < length; i++) {
1096var value = input[i];
1097if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {
1098if (!shallow)
1099value = flatten(value, shallow, strict);
1100var j = 0
1101  , len = value.length;
1102output.length += len;
1103while (j < len) {
1104output[idx++] = value[j++];
1105}
1106} else if (!strict) {
1107output[idx++] = value;
1108}
1109}
1110return output;
1111};
1112_.flatten = function(array, shallow) {
1113return flatten(array, shallow, false);
1114}
1115;
1116_.without = function(array) {
1117return _.difference(array, slice.call(arguments, 1));
1118}
1119;
1120_.uniq = _.unique = function(array, isSorted, iteratee, context) {
1121if (array == null)
1122return [];
1123if (!_.isBoolean(isSorted)) {
1124context = iteratee;
1125iteratee = isSorted;
1126isSorted = false;
1127}
1128if (iteratee != null)
1129iteratee = cb(iteratee, context);
1130var result = [];
1131var seen = [];
1132for (var i = 0, length = array.length; i < length; i++) {
1133var value = array[i]
1134  , computed = iteratee ? iteratee(value, i, array) : value;
1135if (isSorted) {
1136if (!i || seen !== computed)
1137result.push(value);
1138seen = computed;
1139} else if (iteratee) {
1140if (!_.contains(seen, computed)) {
1141seen.push(computed);
1142result.push(value);
1143}
1144} else if (!_.contains(result, value)) {
1145result.push(value);
1146}
1147}
1148return result;
1149}
1150;
1151_.union = function() {
1152return _.uniq(flatten(arguments, true, true));
1153}
1154;
1155_.intersection = function(array) {
1156if (array == null)
1157return [];
1158var result = [];
1159var argsLength = arguments.length;
1160for (var i = 0, length = array.length; i < length; i++) {
1161var item = array[i];
1162if (_.contains(result, item))
1163continue;
1164for (var j = 1; j < argsLength; j++) {
1165if (!_.contains(arguments[j], item))
1166break;
1167}
1168if (j === argsLength)
1169result.push(item);
1170}
1171return result;
1172}
1173;
1174_.difference = function(array) {
1175var rest = flatten(arguments, true, true, 1);
1176return _.filter(array, function(value) {
1177return !_.contains(rest, value);
1178});
1179}
1180;
1181_.zip = function() {
1182return _.unzip(arguments);
1183}
1184;
1185_.unzip = function(array) {
1186var length = array && _.max(array, 'length').length || 0;
1187var result = Array(length);
1188for (var index = 0; index < length; index++) {
1189result[index] = _.pluck(array, index);
1190}
1191return result;
1192}
1193;
1194_.object = function(list, values) {
1195var result = {};
1196for (var i = 0, length = list && list.length; i < length; i++) {
1197if (values) {
1198result[list[i]] = values[i];
1199} else {
1200result[list[i][0]] = list[i][1];
1201}
1202}
1203return result;
1204}
1205;
1206_.indexOf = function(array, item, isSorted) {
1207var i = 0
1208  , length = array && array.length;
1209if (typeof isSorted == 'number') {
1210i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted;
1211} else if (isSorted && length) {
1212i = _.sortedIndex(array, item);
1213return array[i] === item ? i : -1;
1214}
1215if (item !== item) {
1216return _.findIndex(slice.call(array, i), _.isNaN);
1217}
1218for (; i < length; i++)
1219if (array[i] === item)
1220return i;
1221return -1;
1222}
1223;
1224_.lastIndexOf = function(array, item, from) {
1225var idx = array ? array.length : 0;
1226if (typeof from == 'number') {
1227idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1);
1228}
1229if (item !== item) {
1230return _.findLastIndex(slice.call(array, 0, idx), _.isNaN);
1231}
1232while (--idx >= 0)
1233if (array[idx] === item)
1234return idx;
1235return -1;
1236}
1237;
1238function createIndexFinder(dir) {
1239return function(array, predicate, context) {
1240predicate = cb(predicate, context);
1241var length = array != null && array.length;
1242var index = dir > 0 ? 0 : length - 1;
1243for (; index >= 0 && index < length; index += dir) {
1244if (predicate(array[index], index, array))
1245return index;
1246}
1247return -1;
1248}
1249;
1250}
1251_.findIndex = createIndexFinder(1);
1252_.findLastIndex = createIndexFinder(-1);
1253_.sortedIndex = function(array, obj, iteratee, context) {
1254iteratee = cb(iteratee, context, 1);
1255var value = iteratee(obj);
1256var low = 0
1257  , high = array.length;
1258while (low < high) {
1259var mid = Math.floor((low + high) / 2);
1260if (iteratee(array[mid]) < value)
1261low = mid + 1;
1262else
1263high = mid;
1264}
1265return low;
1266}
1267;
1268_.range = function(start, stop, step) {
1269if (arguments.length <= 1) {
1270stop = start || 0;
1271start = 0;
1272}
1273step = step || 1;
1274var length = Math.max(Math.ceil((stop - start) / step), 0);
1275var range = Array(length);
1276for (var idx = 0; idx < length; idx++,
1277start += step) {
1278range[idx] = start;
1279}
1280return range;
1281}
1282;
1283var executeBound = function(sourceFunc, boundFunc, context, callingContext, args
vendor: 13,564 bytes, lines 1283-1895
1283) {
1284if (!(callingContext instanceof boundFunc))
1285return sourceFunc.apply(context, args);
1286var self = baseCreate(sourceFunc.prototype);
1287var result = sourceFunc.apply(self, args);
1288if (_.isObject(result))
1289return result;
1290return self;
1291};
1292_.bind = function(func, context) {
1293if (nativeBind && func.bind === nativeBind)
1294return nativeBind.apply(func, slice.call(arguments, 1));
1295if (!_.isFunction(func))
1296throw new TypeError('Bind must be called on a function');
1297var args = slice.call(arguments, 2);
1298var bound = function() {
1299return executeBound(func, bound, context, this, args.concat(slice.call(arguments)));
1300};
1301return bound;
1302}
1303;
1304_.partial = function(func) {
1305var boundArgs = slice.call(arguments, 1);
1306var bound = function() {
1307var position = 0
1308  , length = boundArgs.length;
1309var args = Array(length);
1310for (var i = 0; i < length; i++) {
1311args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i];
1312}
1313while (position < arguments.length)
1314args.push(arguments[position++]);
1315return executeBound(func, bound, this, this, args);
1316};
1317return bound;
1318}
1319;
1320_.bindAll = function(obj) {
1321var i, length = arguments.length, key;
1322if (length <= 1)
1323throw new Error('bindAll must be passed function names');
1324for (i = 1; i < length; i++) {
1325key = arguments[i];
1326obj[key] = _.bind(obj[key], obj);
1327}
1328return obj;
1329}
1330;
1331_.memoize = function(func, hasher) {
1332var memoize = function(key) {
1333var cache = memoize.cache;
1334var address = '' + (hasher ? hasher.apply(this, arguments) : key);
1335if (!_.has(cache, address))
1336cache[address] = func.apply(this, arguments);
1337return cache[address];
1338};
1339memoize.cache = {};
1340return memoize;
1341}
1342;
1343_.delay = function(func, wait) {
1344var args = slice.call(arguments, 2);
1345return setTimeout(function() {
1346return func.apply(null, args);
1347}, wait);
1348}
1349;
1350_.defer = _.partial(_.delay, _, 1);
1351_.throttle = function(func, wait, options) {
1352var context, args, result;
1353var timeout = null;
1354var previous = 0;
1355if (!options)
1356options = {};
1357var later = function() {
1358previous = options.leading === false ? 0 : _.now();
1359timeout = null;
1360result = func.apply(context, args);
1361if (!timeout)
1362context = args = null;
1363};
1364return function() {
1365var now = _.now();
1366if (!previous && options.leading === false)
1367previous = now;
1368var remaining = wait - (now - previous);
1369context = this;
1370args = arguments;
1371if (remaining <= 0 || remaining > wait) {
1372if (timeout) {
1373clearTimeout(timeout);
1374timeout = null;
1375}
1376previous = now;
1377result = func.apply(context, args);
1378if (!timeout)
1379context = args = null;
1380} else if (!timeout && options.trailing !== false) {
1381timeout = setTimeout(later, remaining);
1382}
1383return result;
1384}
1385;
1386}
1387;
1388_.debounce = function(func, wait, immediate) {
1389var timeout, args, context, timestamp, result;
1390var later = function() {
1391var last = _.now() - timestamp;
1392if (last < wait && last >= 0) {
1393timeout = setTimeout(later, wait - last);
1394} else {
1395timeout = null;
1396if (!immediate) {
1397result = func.apply(context, args);
1398if (!timeout)
1399context = args = null;
1400}
1401}
1402};
1403return function() {
1404context = this;
1405args = arguments;
1406timestamp = _.now();
1407var callNow = immediate && !timeout;
1408if (!timeout)
1409timeout = setTimeout(later, wait);
1410if (callNow) {
1411result = func.apply(context, args);
1412context = args = null;
1413}
1414return result;
1415}
1416;
1417}
1418;
1419_.wrap = function(func, wrapper) {
1420return _.partial(wrapper, func);
1421}
1422;
1423_.negate = function(predicate) {
1424return function() {
1425return !predicate.apply(this, arguments);
1426}
1427;
1428}
1429;
1430_.compose = function() {
1431var args = arguments;
1432var start = args.length - 1;
1433return function() {
1434var i = start;
1435var result = args[start].apply(this, arguments);
1436while (i--)
1437result = args[i].call(this, result);
1438return result;
1439}
1440;
1441}
1442;
1443_.after = function(times, func) {
1444return function() {
1445if (--times < 1) {
1446return func.apply(this, arguments);
1447}
1448}
1449;
1450}
1451;
1452_.before = function(times, func) {
1453var memo;
1454return function() {
1455if (--times > 0) {
1456memo = func.apply(this, arguments);
1457}
1458if (times <= 1)
1459func = null;
1460return memo;
1461}
1462;
1463}
1464;
1465_.once = _.partial(_.before, 2);
1466var hasEnumBug = !{
1467toString: null
1468}.propertyIsEnumerable('toString');
1469var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
1470function collectNonEnumProps(obj, keys) {
1471var nonEnumIdx = nonEnumerableProps.length;
1472var constructor = obj.constructor;
1473var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto;
1474var prop = 'constructor';
1475if (_.has(obj, prop) && !_.contains(keys, prop))
1476keys.push(prop);
1477while (nonEnumIdx--) {
1478prop = nonEnumerableProps[nonEnumIdx];
1479if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {
1480keys.push(prop);
1481}
1482}
1483}
1484_.keys = function(obj) {
1485if (!_.isObject(obj))
1486return [];
1487if (nativeKeys)
1488return nativeKeys(obj);
1489var keys = [];
1490for (var key in obj)
1491if (_.has(obj, key))
1492keys.push(key);
1493if (hasEnumBug)
1494collectNonEnumProps(obj, keys);
1495return keys;
1496}
1497;
1498_.allKeys = function(obj) {
1499if (!_.isObject(obj))
1500return [];
1501var keys = [];
1502for (var key in obj)
1503keys.push(key);
1504if (hasEnumBug)
1505collectNonEnumProps(obj, keys);
1506return keys;
1507}
1508;
1509_.values = function(obj) {
1510var keys = _.keys(obj);
1511var length = keys.length;
1512var values = Array(length);
1513for (var i = 0; i < length; i++) {
1514values[i] = obj[keys[i]];
1515}
1516return values;
1517}
1518;
1519_.mapObject = function(obj, iteratee, context) {
1520iteratee = cb(iteratee, context);
1521var keys = _.keys(obj), length = keys.length, results = {}, currentKey;
1522for (var index = 0; index < length; index++) {
1523currentKey = keys[index];
1524results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
1525}
1526return results;
1527}
1528;
1529_.pairs = function(obj) {
1530var keys = _.keys(obj);
1531var length = keys.length;
1532var pairs = Array(length);
1533for (var i = 0; i < length; i++) {
1534pairs[i] = [keys[i], obj[keys[i]]];
1535}
1536return pairs;
1537}
1538;
1539_.invert = function(obj) {
1540var result = {};
1541var keys = _.keys(obj);
1542for (var i = 0, length = keys.length; i < length; i++) {
1543result[obj[keys[i]]] = keys[i];
1544}
1545return result;
1546}
1547;
1548_.functions = _.methods = function(obj) {
1549var names = [];
1550for (var key in obj) {
1551if (_.isFunction(obj[key]))
1552names.push(key);
1553}
1554return names.sort();
1555}
1556;
1557_.extend = createAssigner(_.allKeys);
1558_.extendOwn = _.assign = createAssigner(_.keys);
1559_.findKey = function(obj, predicate, context) {
1560predicate = cb(predicate, context);
1561var keys = _.keys(obj), key;
1562for (var i = 0, length = keys.length; i < length; i++) {
1563key = keys[i];
1564if (predicate(obj[key], key, obj))
1565return key;
1566}
1567}
1568;
1569_.pick = function(object, oiteratee, context) {
1570var result = {}, obj = object, iteratee, keys;
1571if (obj == null)
1572return result;
1573if (_.isFunction(oiteratee)) {
1574keys = _.allKeys(obj);
1575iteratee = optimizeCb(oiteratee, context);
1576} else {
1577keys = flatten(arguments, false, false, 1);
1578iteratee = function(value, key, obj) {
1579return key in obj;
1580}
1581;
1582obj = Object(obj);
1583}
1584for (var i = 0, length = keys.length; i < length; i++) {
1585var key = keys[i];
1586var value = obj[key];
1587if (iteratee(value, key, obj))
1588result[key] = value;
1589}
1590return result;
1591}
1592;
1593_.omit = function(obj, iteratee, context) {
1594if (_.isFunction(iteratee)) {
1595iteratee = _.negate(iteratee);
1596} else {
1597var keys = _.map(flatten(arguments, false, false, 1), String);
1598iteratee = function(value, key) {
1599return !_.contains(keys, key);
1600}
1601;
1602}
1603return _.pick(obj, iteratee, context);
1604}
1605;
1606_.defaults = createAssigner(_.allKeys, true);
1607_.clone = function(obj) {
1608if (!_.isObject(obj))
1609return obj;
1610return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
1611}
1612;
1613_.tap = function(obj, interceptor) {
1614interceptor(obj);
1615return obj;
1616}
1617;
1618_.isMatch = function(object, attrs) {
1619var keys = _.keys(attrs)
1620  , length = keys.length;
1621if (object == null)
1622return !length;
1623var obj = Object(object);
1624for (var i = 0; i < length; i++) {
1625var key = keys[i];
1626if (attrs[key] !== obj[key] || !(key in obj))
1627return false;
1628}
1629return true;
1630}
1631;
1632var eq = function(a, b, aStack, bStack) {
1633if (a === b)
1634return a !== 0 || 1 / a === 1 / b;
1635if (a == null || b == null)
1636return a === b;
1637if (a instanceof _)
1638a = a._wrapped;
1639if (b instanceof _)
1640b = b._wrapped;
1641var className = toString.call(a);
1642if (className !== toString.call(b))
1643return false;
1644switch (className) {
1645case '[object RegExp]':
1646case '[object String]':
1647return '' + a === '' + b;
1648case '[object Number]':
1649if (+a !== +a)
1650return +b !== +b;
1651return +a === 0 ? 1 / +a === 1 / b : +a === +b;
1652case '[object Date]':
1653case '[object Boolean]':
1654return +a === +b;
1655}
1656var areArrays = className === '[object Array]';
1657if (!areArrays) {
1658if (typeof a != 'object' || typeof b != 'object')
1659return false;
1660var aCtor = a.constructor
1661  , bCtor = b.constructor;
1662if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor && _.isFunction(bCtor) && bCtor instanceof bCtor) && ('constructor'in a && 'constructor'in b)) {
1663return false;
1664}
1665}
1666aStack = aStack || [];
1667bStack = bStack || [];
1668var length = aStack.length;
1669while (length--) {
1670if (aStack[length] === a)
1671return bStack[length] === b;
1672}
1673aStack.push(a);
1674bStack.push(b);
1675if (areArrays) {
1676length = a.length;
1677if (length !== b.length)
1678return false;
1679while (length--) {
1680if (!eq(a[length], b[length], aStack, bStack))
1681return false;
1682}
1683} else {
1684var keys = _.keys(a), key;
1685length = keys.length;
1686if (_.keys(b).length !== length)
1687return false;
1688while (length--) {
1689key = keys[length];
1690if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack)))
1691return false;
1692}
1693}
1694aStack.pop();
1695bStack.pop();
1696return true;
1697};
1698_.isEqual = function(a, b) {
1699return eq(a, b);
1700}
1701;
1702_.isEmpty = function(obj) {
1703if (obj == null)
1704return true;
1705if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj)))
1706return obj.length === 0;
1707return _.keys(obj).length === 0;
1708}
1709;
1710_.isElement = function(obj) {
1711return !!(obj && obj.nodeType === 1);
1712}
1713;
1714_.isArray = nativeIsArray || function(obj) {
1715return toString.call(obj) === '[object Array]';
1716}
1717;
1718_.isObject = function(obj) {
1719var type = typeof obj;
1720return type === 'function' || type === 'object' && !!obj;
1721}
1722;
1723_.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) {
1724_['is' + name] = function(obj) {
1725return toString.call(obj) === '[object ' + name + ']';
1726}
1727;
1728});
1729if (!_.isArguments(arguments)) {
1730_.isArguments = function(obj) {
1731return _.has(obj, 'callee');
1732}
1733;
1734}
1735if (typeof /./ != 'function' && typeof Int8Array != 'object') {
1736_.isFunction = function(obj) {
1737return typeof obj == 'function' || false;
1738}
1739;
1740}
1741_.isFinite = function(obj) {
1742return isFinite(obj) && !isNaN(parseFloat(obj));
1743}
1744;
1745_.isNaN = function(obj) {
1746return _.isNumber(obj) && obj !== +obj;
1747}
1748;
1749_.isBoolean = function(obj) {
1750return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
1751}
1752;
1753_.isNull = function(obj) {
1754return obj === null;
1755}
1756;
1757_.isUndefined = function(obj) {
1758return obj === void 0;
1759}
1760;
1761_.has = function(obj, key) {
1762return obj != null && hasOwnProperty.call(obj, key);
1763}
1764;
1765_.noConflict = function() {
1766root._ = previousUnderscore;
1767return this;
1768}
1769;
1770_.identity = function(value) {
1771return value;
1772}
1773;
1774_.constant = function(value) {
1775return function() {
1776return value;
1777}
1778;
1779}
1780;
1781_.noop = function() {}
1782;
1783_.property = function(key) {
1784return function(obj) {
1785return obj == null ? void 0 : obj[key];
1786}
1787;
1788}
1789;
1790_.propertyOf = function(obj) {
1791return obj == null ? function() {}
1792: function(key) {
1793return obj[key];
1794}
1795;
1796}
1797;
1798_.matcher = _.matches = function(attrs) {
1799attrs = _.extendOwn({}, attrs);
1800return function(obj) {
1801return _.isMatch(obj, attrs);
1802}
1803;
1804}
1805;
1806_.times = function(n, iteratee, context) {
1807var accum = Array(Math.max(0, n));
1808iteratee = optimizeCb(iteratee, context, 1);
1809for (var i = 0; i < n; i++)
1810accum[i] = iteratee(i);
1811return accum;
1812}
1813;
1814_.random = function(min, max) {
1815if (max == null) {
1816max = min;
1817min = 0;
1818}
1819return min + Math.floor(Math.random() * (max - min + 1));
1820}
1821;
1822_.now = Date.now || function() {
1823return new Date().getTime();
1824}
1825;
1826var escapeMap = {
1827'&': '&amp;',
1828'<': '&lt;',
1829'>': '&gt;',
1830'"': '&quot;',
1831"'": '&#x27;',
1832'`': '&#x60;'
1833};
1834var unescapeMap = _.invert(escapeMap);
1835var createEscaper = function(map) {
1836var escaper = function(match) {
1837return map[match];
1838};
1839var source = '(?:' + _.keys(map).join('|') + ')';
1840var testRegexp = RegExp(source);
1841var replaceRegexp = RegExp(source, 'g');
1842return function(string) {
1843string = string == null ? '' : '' + string;
1844return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
1845}
1846;
1847};
1848_.escape = createEscaper(escapeMap);
1849_.unescape = createEscaper(unescapeMap);
1850_.result = function(object, property, fallback) {
1851var value = object == null ? void 0 : object[property];
1852if (value === void 0) {
1853value = fallback;
1854}
1855return _.isFunction(value) ? value.call(object) : value;
1856}
1857;
1858var idCounter = 0;
1859_.uniqueId = function(prefix) {
1860var id = ++idCounter + '';
1861return prefix ? prefix + id : id;
1862}
1863;
1864_.templateSettings = {
1865evaluate: /<%([\s\S]+?)%>/g,
1866interpolate: /<%=([\s\S]+?)%>/g,
1867escape: /<%-([\s\S]+?)%>/g
1868};
1869var noMatch = /(.)^/;
1870var escapes = {
1871"'": "'",
1872'\\': '\\',
1873'\r': 'r',
1874'\n': 'n',
1875'\u2028': 'u2028',
1876'\u2029': 'u2029'
1877};
1878var escaper = /\\|'|\r|\n|\u2028|\u2029/g;
1879var escapeChar = function(match) {
1880return '\\' + escapes[match];
1881};
1882_.template = function(text, settings, oldSettings) {
1883if (!settings && oldSettings)
1884settings = oldSettings;
1885settings = _.defaults({}, settings, _.templateSettings);
1886var matcher = RegExp([(settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source].join('|') + '|$', 'g');
1887var index = 0;
1888var source = "__p+='";
1889text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
1890source += text.slice(index, offset).replace(escaper, escapeChar);
1891index = offset + match.length;
1892if (escape) {
1893source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
1894} else if (interpolate) {
1895source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
1896} else if (evaluate) {
1897source += "';\n" + evaluate + "\n__p+='";
1898}
1899return match;
1900});
1901source += "';\n";
1902if (!settings.variable)
1903source = 'with(obj||{}){\n' + source + '}\n';
1904source = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + source + 'return __p;\n';
1905try {
1906var render = new Function(settings.variable || 'obj','_',source);
1907} catch (e) {
1908e.source = source;
1909throw e;
1910}
1911var template = function(data) {
1912return render.call(this, data, _);
1913};
1914var argument = settings.variable || 'obj';
1915template.source = 'function(' + argument + '){\n' + source + '}';
1916return template;
1917}
1918;
1919_.chain = function(obj) {
1920var instance = _(obj);
1921instance._chain = true;
1922return instance;
1923}
1924;
1925var result = function(instance, obj) {
1926return instance._chain ? _(obj).chain() : obj;
1927};
1928_.mixin = function(obj) {
1929_.each(_.functions(obj), function(name) {
1930var func = _[name] = obj[name];
1931_.prototype[name] = function() {
1932var args = [this._wrapped];
1933push.apply(args, arguments);
1934return result(this, func.apply(_, args));
1935}
1936;
1937});
1938}
1939;
1940_.mixin(_);
1941_.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
1942var method = ArrayProto[name];
1943_.prototype[name] = function() {
1944var obj = this._wrapped;
1945method.apply(obj, arguments);
1946if ((name === 'shift' || name === 'splice') && obj.length === 0)
1947delete obj[0];
1948return result(this, obj);
1949}
1950;
1951});
1952_.each(['concat', 'join', 'slice'], function(name) {
1953var method = ArrayProto[name];
1954_.prototype[name] = function() {
1955return result(this, method.apply(this._wrapped, arguments));
1956}
1957;
1958});
1959_.prototype.value = function() {
1960return this._wrapped;
1961}
1962;
1963_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
1964_.prototype.toString = function() {
1965return '' + this._wrapped;
1966}
1967;
1968if (typeof define === 'function' && define.amd) {
1969define('underscore', [], function() {
1970return _;
1971});
1972}
1973}
1974.call(this));
1975;
1976/* /web/static/lib/underscore.string/lib/underscore.string.js defined in bundle 'web.assets_common' */
1977!function(root, String) {
1978'use strict';
1979var nativeTrim = String.prototype.trim;
1980var nativeTrimRight = String.prototype.trimRight;
1981var nativeTrimLeft = String.prototype.trimLeft;
1982var parseNumber = function(source) {
1983return source * 1 || 0;
1984};
1985var strRepeat = function(str, qty) {
1986if (qty < 1)
1987return '';
1988var result = '';
1989while (qty > 0) {
1990if (qty & 1)
1991result += str;
1992qty >>= 1,
1993str += str;
1994}
1995return result;
1996};
1997var slice = [].slice;
1998var defaultToWhiteSpace = function(characters) {
1999if (characters == null)
2000return '\\s';
2001else if (characters.source)
2002return characters.source;
2003else
2004return '[' + _s.escapeRegExp(characters) + ']';
2005};
2006function boolMatch(s, matchers) {
2007var i, matcher, down = s.toLowerCase();
2008matchers = [].concat(matchers);
2009for (i = 0; i < matchers.length; i += 1) {
2010matcher = matchers[i];
2011if (!matcher)
2012continue;
2013if (matcher.test && matcher.test(s))
2014return true;
2015if (matcher.toLowerCase() === down)
2016return true;
2017}
2018}
2019var escapeChars = {
2020lt: '<',
2021gt: '>',
2022quot: '"',
2023amp: '&',
2024apos: "'"
2025};
2026var reversedEscapeChars = {};
2027for (var key in escapeChars)
2028reversedEscapeChars[escapeChars[key]] = key;
2029reversedEscapeChars["'"] = '#39';
2030var sprintf = (function() {
2031function get_type(variable) {
2032return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase();
2033}
2034var str_repeat = strRepeat;
2035var str_format = function() {
2036if (!str_format.cache.hasOwnProperty(arguments[0])) {
2037str_format.cache[arguments[0]] = str_format.parse(arguments[0]);
2038}
2039return str_format.format.call(null, str_format.cache[arguments[0]], arguments);
2040};
2041str_format.format = function(parse_tree, argv) {
2042var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length;
2043for (i = 0; i < tree_length; i++) {
2044node_type = get_type(parse_tree[i]);
2045if (node_type === 'string') {
2046output.push(parse_tree[i]);
2047} else if (node_type === 'array') {
2048match = parse_tree[i];
2049if (match[2]) {
2050arg = argv[cursor];
2051for (k = 0; k < match[2].length; k++) {
2052if (!arg.hasOwnProperty(match[2][k])) {
2053throw new Error(sprintf('[_.sprintf] property "%s" does not exist', match[2][k]));
2054}
2055arg = arg[match[2][k]];
2056}
2057} else if (match[1]) {
2058arg = argv[match[1]];
2059} else {
2060arg = argv[cursor++];
2061}
2062if (/[^s]/.test(match[8]) && (get_type(arg) != 'number')) {
2063throw new Error(sprintf('[_.sprintf] expecting number but found %s', get_type(arg)));
2064}
2065switch (match[8]) {
2066case 'b':
2067arg = arg.toString(2);
2068break;
2069case 'c':
2070arg = String.fromCharCode(arg);
2071break;
2072case 'd':
2073arg = parseInt(arg, 10);
2074break;
2075case 'e':
2076arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential();
2077break;
2078case 'f':
2079arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg);
2080break;
2081case 'o':
2082arg = arg.toString(8);
2083break;
2084case 's':
2085arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg);
2086break;
2087case 'u':
2088arg = Math.abs(arg);
2089break;
2090case 'x':
2091arg = arg.toString(16);
2092break;
2093case 'X':
2094arg = arg.toString(16).toUpperCase();
2095break;
2096}
2097arg = (/[def]/.test(match[8]) && match[3] && arg >= 0 ? '+' + arg : arg);
2098pad_character = match[4] ? match[4] == '0' ? '0' : match[4].charAt(1) : ' ';
2099pad_length = match[6] - String(arg).length;
2100pad = match[6] ? str_repeat(pad_character, pad_length) : '';
2101output.push(match[5] ? arg + pad : pad + arg);
2102}
2103}
2104return output.join('');
2105}
2106;
2107str_format.cache = {};
2108str_format.parse = function(fmt) {
2109var _fmt = fmt
2110  , match = []
2111  , parse_tree = []
2112  , arg_names = 0;
2113while (_fmt) {
2114if ((match = /^[^\x25]+/.exec(_fmt)) !== null) {
2115parse_tree.push(match[0]);
2116} else if ((match = /^\x25{2}/.exec(_fmt)) !== null) {
2117parse_tree.push('%');
2118} else if ((match = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt)) !== null) {
2119if (match[2]) {
2120arg_names |= 1;
2121var field_list = []
2122  , replacement_field = match[2]
2123  , field_match = [];
2124if ((field_match = /^([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
2125field_list.push(field_match[1]);
2126while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {
2127if ((field_match = /^\.([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
2128field_list.push(field_match[1]);
2129} else if ((field_match = /^\[(\d+)\]/.exec(replacement_field)) !== null) {
2130field_list.push(field_match[1]);
2131} else {
2132throw new Error('[_.sprintf] huh?');
2133}
2134}
2135} else {
2136throw new Error('[_.sprintf] huh?');
2137}
2138match[2] = field_list;
2139} else {
2140arg_names |= 2;
2141}
2142if (arg_names === 3) {
2143throw new Error('[_.sprintf] mixing positional and named placeholders is not (yet) supported');
2144}
2145parse_tree.push(match);
2146} else {
2147throw new Error('[_.sprintf] huh?');
2148}
2149_fmt = _fmt.substring(match[0].length);
2150}
2151return parse_tree;
2152}
2153;
2154return str_format;
2155}
2156)();
2157var _s = {
2158VERSION: '2.3.0',
2159isBlank: function(str) {
2160if (str == null)
2161str = '';
2162return (/^\s*$/).test(str);
2163},
2164stripTags: function(str) {
2165if (str == null)
2166return '';
2167return String(str).replace(/<\/?[^>]+>/g, '');
2168},
2169capitalize: function(str) {
2170str = str == null ? '' : String(str);
2171return str.charAt(0).toUpperCase() + str.slice(1);
2172},
2173chop: function(str, step) {
2174if (str == null)
2175return [];
2176str = String(str);
2177step = ~~step;
2178return step > 0 ? str.match(new RegExp('.{1,' + step + '}','g')) : [str];
2179},
2180clean: function(str) {
2181return _s.strip(str).replace(/\s+/g, ' ');
2182},
2183count: function(str, substr) {
2184if (str == null || substr == null)
2185return 0;
2186str = String(str);
2187substr = String(substr);
2188var count = 0
2189  , pos = 0
2190  , length = substr.length;
2191while (true) {
2192pos = str.indexOf(substr, pos);
2193if (pos === -1)
2194break;
2195count++;
2196pos += length;
2197}
2198return count;
2199},
2200chars: function(str) {
2201if (str == null)
2202return [];
2203return String(str).split('');
2204},
2205swapCase: function(str) {
2206if (str == null)
2207return '';
2208return String(str).replace(/\S/g, function(c) {
2209return c === c.toUpperCase() ? c.toLowerCase() : c.toUpperCase();
2210});
2211},
2212escapeHTML: function(str) {
2213if (str == null)
2214return '';
2215return String(str).replace(/[&<>"']/g, function(m) {
2216return '&' + reversedEscapeChars[m] + ';';
2217});
2218},
2219unescapeHTML: function(str) {
2220if (str == null)
2221return '';
2222return String(str).replace(/\&([^;]+);/g, function(entity, entityCode) {
2223var match;
2224if (entityCode in escapeChars) {
2225return escapeChars[entityCode];
2226} else if (match = entityCode.match(/^#x([\da-fA-F]+)$/)) {
2227return String.fromCharCode(parseInt(match[1], 16));
2228} else if (match = entityCode.match(/^#(\d+)$/)) {
2229return String.fromCharCode(~~match[1]);
2230} else {
2231return entity;
2232}
2233});
2234},
2235escapeRegExp: function(str) {
2236if (str == null)
2237return '';
2238return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
2239},
2240splice: function(str, i, howmany, substr) {
2241var arr = _s.chars(str);
2242arr.splice(~~i, ~~howmany, substr);
2243return arr.join('');
2244},
2245insert: function(str, i, substr) {
2246return _s.splice(str, i, 0, substr);
2247},
2248include: function(str, needle) {
2249if (needle === '')
2250return true;
2251if (str == null)
2252return false;
2253return String(str).indexOf(needle) !== -1;
2254},
2255join: function() {
2256var args = slice.call(arguments)
2257  , separator = args.shift();
2258if (separator == null)
2259separator = '';
2260return args.join(separator);
2261},
2262lines: function(str) {
2263if (str == null)
2264return [];
2265return String(str).split("\n");
2266},
2267reverse: function(str) {
2268return _s.chars(str).reverse().join('');
2269},
2270startsWith: function(str, starts) {
2271if (starts === '')
2272return true;
2273if (str == null || starts == null)
2274return false;
2275str = String(str);
2276starts = String(starts);
2277return str.length >= starts.length && str.slice(0, starts.length) === starts;
2278},
2279endsWith: function(str, ends) {
2280if (ends === '')
2281return true;
2282if (str == null || ends == null)
2283return false;
2284str = String(str);
2285ends = String(ends);
2286return str.length >= ends.length && str.slice(str.length - ends.length) === ends;
2287},
2288succ: function(str) {
2289if (str == null)
2290return '';
2291str = String(str);
2292return str.slice(0, -1) + String.fromCharCode(str.charCodeAt(str.length - 1) + 1);
2293},
2294titleize: function(str) {
2295if (str == null)
2296return '';
2297str = String(str).toLowerCase();
2298return str.replace(/(?:^|\s|-)\S/g, function(c) {
2299return c.toUpperCase();
2300});
2301},
2302camelize: function(str) {
2303return _s.trim(str).replace(/[-_\s]+(.)?/g, function(match, c) {
2304return c ? c.toUpperCase() : "";
2305});
2306},
2307underscored: function(str) {
2308return _s.trim(str).replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase();
2309},
2310dasherize: function(str) {
2311return _s.trim(str).replace(/([A-Z])/g, '-$1').replace(/[-_\s]+/g, '-').toLowerCase();
2312},
2313classify: function(str) {
2314return _s.titleize(String(str).replace(/[\W_]/g, ' ')).replace(/\s/g, '');
2315},
2316humanize: function(str) {
2317return _s.capitalize(_s.underscored(str).replace(/_id$/, '').replace(/_/g, ' '));
2318},
2319trim: function(str, characters) {
2320if (str == null)
2321return '';
2322if (!characters && nativeTrim)
2323return nativeTrim.call(str);
2324characters = defaultToWhiteSpace(characters);
2325return String(str).replace(new RegExp('\^' + characters + '+|' + characters + '+$','g'), '');
2326},
2327ltrim: function(str, characters) {
2328if (str == null)
2329return '';
2330if (!characters && nativeTrimLeft)
2331return nativeTrimLeft.call(str);
2332characters = defaultToWhiteSpace(characters);
2333return String(str).replace(new RegExp('^' + characters + '+'), '');
2334},
2335rtrim: function(str, characters) {
2336if (str == null)
2337return '';
2338if (!characters && nativeTrimRight)
2339return nativeTrimRight.call(str);
2340characters = defaultToWhiteSpace(characters);
2341return String(str).replace(new RegExp(characters + '+$'), '');
2342},
2343truncate: function(str, length, truncateStr) {
2344if (str == null)
2345return '';
2346str = String(str);
2347truncateStr = truncateStr || '...';
2348length = ~~length;
2349return str.length > length ? str.slice(0, length) + truncateStr : str;
2350},
2351prune: function(str, length, pruneStr) {
2352if (str == null)
2353return '';
2354str = String(str);
2355length = ~~length;
2356pruneStr = pruneStr != null ? String(pruneStr) : '...';
2357if (str.length <= length)
2358return str;
2359var tmpl = function(c) {
2360return c.toUpperCase() !== c.toLowerCase() ? 'A' : ' ';
2361}
2362  , template = str.slice(0, length + 1).replace(/.(?=\W*\w*$)/g, tmpl);
2363if (template.slice(template.length - 2).match(/\w\w/))
2364template = template.replace(/\s*\S+$/, '');
2365else
2366template = _s.rtrim(template.slice(0, template.length - 1));
2367return (template + pruneStr).length > str.length ? str : str.slice(0, template.length) + pruneStr;
2368},
2369words: function(str, delimiter) {
2370if (_s.isBlank(str))
2371return [];
2372return _s.trim(str, delimiter).split(delimiter || /\s+/);
2373},
2374pad: function(str, length, padStr, type) {
2375str = str == null ? '' : String(str);
2376length = ~~length;
2377var padlen = 0;
2378if (!padStr)
2379padStr = ' ';
2380else if (padStr.length > 1)
2381padStr = padStr.charAt(0);
2382switch (type) {
2383case 'right':
2384padlen = length - str.length;
2385return str + strRepeat(padStr, padlen);
2386case 'both':
2387padlen = length - str.length;
2388return strRepeat(padStr, Math.ceil(padlen / 2)) + str + strRepeat(padStr, Math.floor(padlen / 2));
2389default:
2390padlen = length - str.length;
2391return strRepeat(padStr, padlen) + str;
2392}
2393},
2394lpad: function(str, length, padStr) {
2395return _s.pad(str, length, padStr);
2396},
2397rpad: function(str, length, padStr) {
2398return _s.pad(str, length, padStr, 'right');
2399},
2400lrpad: function(str, length, padStr) {
2401return _s.pad(str, length, padStr, 'both');
2402},
2403sprintf: sprintf,
2404vsprintf: function(fmt, argv) {
2405argv.unshift(fmt);
2406return sprintf.apply(null, argv);
2407},
2408toNumber: function(str, decimals) {
2409if (!str)
2410return 0;
2411str = _s.trim(str);
2412if (!str.match(/^-?\d+(?:\.\d+)?$/))
2413return NaN;
2414return parseNumber(parseNumber(str).toFixed(~~decimals));
2415},
2416numberFormat: function(number, dec, dsep, tsep) {
2417if (isNaN(number) || number == null)
2418return '';
2419number = number.toFixed(~~dec);
2420tsep = typeof tsep == 'string' ? tsep : ',';
2421var parts = number.split('.')
2422  , fnums = parts[0]
2423  , decimals = parts[1] ? (dsep || '.') + parts[1] : '';
2424return fnums.replace(/(\d)(?=(?:\d{3})+$)/g, '$1' + tsep) + decimals;
2425},
2426strRight: function(str, sep) {
2427if (str == null)
2428return '';
2429str = String(str);
2430sep = sep != null ? String(sep) : sep;
2431var pos = !sep ? -1 : str.indexOf(sep);
2432return ~pos ? str.slice(pos + sep.length, str.length) : str;
2433},
2434strRightBack: function(str, sep) {
2435if (str == null)
2436return '';
2437str = String(str);
2438sep = sep != null ? String(sep) : sep;
2439var pos = !sep ? -1 : str.lastIndexOf(sep);
2440return ~pos ? str.slice(pos + sep.length, str.length) : str;
2441},
2442strLeft: function(str, sep) {
2443if (str == null)
2444return '';
2445str = String(str);
2446sep = sep != null ? String(sep) : sep;
2447var pos = !sep ? -1 : str.indexOf(sep);
2448return ~pos ? str.slice(0, pos) : str;
2449},
2450strLeftBack: function(str, sep) {
2451if (str == null)
2452return '';
2453str += '';
2454sep = sep != null ? '' + sep : sep;
2455var pos = str.lastIndexOf(sep);
2456return ~pos ? str.slice(0, pos) : str;
2457},
2458toSentence: function(array, separator, lastSeparator, serial) {
2459separator = separator || ', ';
2460lastSeparator = lastSeparator || ' and ';
2461var a = array.slice()
2462  , lastMember = a.pop();
2463if (array.length > 2 && serial)
2464lastSeparator = _s.rtrim(separator) + lastSeparator;
2465return a.length ? a.join(separator) + lastSeparator + lastMember : lastMember;
2466},
2467toSentenceSerial: function() {
2468var args = slice.call(arguments);
2469args[3] = true;
2470return _s.toSentence.apply(_s, args);
2471},
2472slugify: function(str) {
2473if (str == null)
2474return '';
2475var from = "ąàáäâãåæăćęèéëêìíïîłńòóöôõøśșțùúüûñçżź"
2476  , to = "aaaaaaaaaceeeeeiiiilnoooooosstuuuunczz"
2477  , regex = new RegExp(defaultToWhiteSpace(from),'g');
2478str = String(str).toLowerCase().replace(regex, function(c) {
2479var index = from.indexOf(c);
2480return to.charAt(index) || '-';
2481});
2482return _s.dasherize(str.replace(/[^\w\s-]/g, ''));
2483},
2484surround: function(str, wrapper) {
2485return [wrapper, str, wrapper].join('');
2486},
2487quote: function(str, quoteChar) {
2488return _s.surround(str, quoteChar || '"');
2489},
2490unquote: function(str, quoteChar) {
2491quoteChar = quoteChar || '"';
2492if (str[0] === quoteChar && str[str.length - 1] === quoteChar)
2493return str.slice(1, str.length - 1);
2494else
2495return str;
2496},
2497exports: function() {
2498var result = {};
2499for (var prop in this) {
2500if (!this.hasOwnProperty(prop) || prop.match(/^(?:include|contains|reverse)$/))
2501continue;
2502result[prop] = this[prop];
2503}
2504return result;
2505},
2506repeat: function(str, qty, separator) {
2507if (str == null)
2508return '';
2509qty = ~~qty;
2510if (separator == null)
2511return strRepeat(String(str), qty);
2512for (var repeat = []; qty > 0; repeat[--qty] = str) {}
2513return repeat.join(separator);
2514},
2515naturalCmp: function(str1, str2) {
2516if (str1 == str2)
2517return 0;
2518if (!str1)
2519return -1;
2520if (!str2)
2521return 1;
2522var cmpRegex = /(\.\d+)|(\d+)|(\D+)/g
2523  , tokens1 = String(str1).toLowerCase().match(cmpRegex)
2524  , tokens2 = String(str2).toLowerCase().match(cmpRegex)
2525  , count = Math.min(tokens1.length, tokens2.length);
2526for (var i = 0; i < count; i++) {
2527var a = tokens1[i]
2528  , b = tokens2[i];
2529if (a !== b) {
2530var num1 = parseInt(a, 10);
2531if (!isNaN(num1)) {
2532var num2 = parseInt(b, 10);
2533if (!isNaN(num2) && num1 - num2)
2534return num1 - num2;
2535}
2536return a < b ? -1 : 1;
2537}
2538}
2539if (tokens1.length === tokens2.length)
2540return tokens1.length - tokens2.length;
2541return str1 < str2 ? -1 : 1;
2542},
2543levenshtein: function(str1, str2) {
2544if (str1 == null && str2 == null)
2545return 0;
2546if (str1 == null)
2547return String(str2).length;
2548if (str2 == null)
2549return String(str1).length;
2550str1 = String(str1);
2551str2 = String(str2);
2552var current = [], prev, value;
2553for (var i = 0; i <= str2.length; i++)
2554for (var j = 0; j <= str1.length; j++) {
2555if (i && j)
2556if (str1.charAt(j - 1) === str2.charAt(i - 1))
2557value = prev;
2558else
2559value = Math.min(current[j], current[j - 1], prev) + 1;
2560else
2561value = i + j;
2562prev = current[j];
2563current[j] = value;
2564}
2565return current.pop();
2566},
2567toBoolean: function(str, trueValues, falseValues) {
2568if (typeof str === "number")
2569str = "" + str;
2570if (typeof str !== "string")
2571return !!str;
2572str = _s.trim(str);
2573if (boolMatch(str, trueValues || ["true", "1"]))
2574return true;
2575if (boolMatch(str, falseValues || ["false", "0"]))
2576return false;
2577}
2578};
2579_s.strip = _s.trim;
2580_s.lstrip = _s.ltrim;
2581_s.rstrip = _s.rtrim;
2582_s.center = _s.lrpad;
2583_s.rjust = _s.lpad;
2584_s.ljust = _s.rpad;
2585_s.contains = _s.include;
2586_s.q = _s.quote;
2587_s.toBool = _s.toBoolean;
2588if (typeof exports !== 'undefined') {
2589if (typeof module !== 'undefined' && module.exports)
2590module.exports = _s;
2591exports._s = _s;
2592}
2593if (typeof define === 'function' && define.amd)
2594define('underscore.string', [], function() {
2595return _s;
2596});
2597root._ = root._ || {};
2598root._.string = root._.str = _s;
2599}(this, String);
2600;
2601/* /web/static/lib/moment/moment.js defined in bundle 'web.assets_common' */
2602;(function(global, factory) {
2603typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory()
2604}(this, (function() {
2605'use strict';
2606var hookCallback;
2607function hooks() {
2608return hookCallback.apply(null, arguments);
2609}
2610function setHookCallback(callback) {
2611hookCallback = callback;
2612}
2613function isArray(input) {
2614return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
2615}
2616function isObject(input) {
2617return input != null && Object.prototype.toString.call(input) === '[object Object]';
2618}
2619function isObjectEmpty(obj) {
2620var k;
2621for (k in obj) {
2622return false;
2623}
2624return true;
2625}
2626function isNumber(input) {
2627return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
2628}
2629function isDate(input) {
2630return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
2631}
2632function map(arr, fn) {
2633var res = [], i;
2634for (i = 0; i < arr.length; ++i) {
2635res.push(fn(arr[i], i));
2636}
2637return res;
2638}
2639function hasOwnProp(a, b) {
2640return Object.prototype.hasOwnProperty.call(a, b);
2641}
2642function extend(a, b) {
2643for (var i in b) {
2644if (hasOwnProp(b, i)) {
2645a[i] = b[i];
2646}
2647}
2648if (hasOwnProp(b, 'toString')) {
2649a.toString = b.toString;
2650}
2651if (hasOwnProp(b, 'valueOf')) {
2652a.valueOf = b.valueOf;
2653}
2654return a;
2655}
2656function createUTC(input, format, locale, strict) {
vendor: 4,362 bytes, lines 2657-2840
2657return createLocalOrUTC(input, format, locale, strict, true).utc();
2658}
2659function defaultParsingFlags() {
2660return {
2661empty: false,
2662unusedTokens: [],
2663unusedInput: [],
2664overflow: -2,
2665charsLeftOver: 0,
2666nullInput: false,
2667invalidMonth: null,
2668invalidFormat: false,
2669userInvalidated: false,
2670iso: false,
2671parsedDateParts: [],
2672meridiem: null
2673};
2674}
2675function getParsingFlags(m) {
2676if (m._pf == null) {
2677m._pf = defaultParsingFlags();
2678}
2679return m._pf;
2680}
2681var some;
2682if (Array.prototype.some) {
2683some = Array.prototype.some;
2684} else {
2685some = function(fun) {
2686var t = Object(this);
2687var len = t.length >>> 0;
2688for (var i = 0; i < len; i++) {
2689if (i in t && fun.call(this, t[i], i, t)) {
2690return true;
2691}
2692}
2693return false;
2694}
2695;
2696}
2697var some$1 = some;
2698function isValid(m) {
2699if (m._isValid == null) {
2700var flags = getParsingFlags(m);
2701var parsedParts = some$1.call(flags.parsedDateParts, function(i) {
2702return i != null;
2703});
2704var isNowValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidMonth && !flags.invalidWeekday && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || (flags.meridiem && parsedParts));
2705if (m._strict) {
2706isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined;
2707}
2708if (Object.isFrozen == null || !Object.isFrozen(m)) {
2709m._isValid = isNowValid;
2710} else {
2711return isNowValid;
2712}
2713}
2714return m._isValid;
2715}
2716function createInvalid(flags) {
2717var m = createUTC(NaN);
2718if (flags != null) {
2719extend(getParsingFlags(m), flags);
2720} else {
2721getParsingFlags(m).userInvalidated = true;
2722}
2723return m;
2724}
2725function isUndefined(input) {
2726return input === void 0;
2727}
2728var momentProperties = hooks.momentProperties = [];
2729function copyConfig(to, from) {
2730var i, prop, val;
2731if (!isUndefined(from._isAMomentObject)) {
2732to._isAMomentObject = from._isAMomentObject;
2733}
2734if (!isUndefined(from._i)) {
2735to._i = from._i;
2736}
2737if (!isUndefined(from._f)) {
2738to._f = from._f;
2739}
2740if (!isUndefined(from._l)) {
2741to._l = from._l;
2742}
2743if (!isUndefined(from._strict)) {
2744to._strict = from._strict;
2745}
2746if (!isUndefined(from._tzm)) {
2747to._tzm = from._tzm;
2748}
2749if (!isUndefined(from._isUTC)) {
2750to._isUTC = from._isUTC;
2751}
2752if (!isUndefined(from._offset)) {
2753to._offset = from._offset;
2754}
2755if (!isUndefined(from._pf)) {
2756to._pf = getParsingFlags(from);
2757}
2758if (!isUndefined(from._locale)) {
2759to._locale = from._locale;
2760}
2761if (momentProperties.length > 0) {
2762for (i in momentProperties) {
2763prop = momentProperties[i];
2764val = from[prop];
2765if (!isUndefined(val)) {
2766to[prop] = val;
2767}
2768}
2769}
2770return to;
2771}
2772var updateInProgress = false;
2773function Moment(config) {
2774copyConfig(this, config);
2775this._d = new Date(config._d != null ? config._d.getTime() : NaN);
2776if (!this.isValid()) {
2777this._d = new Date(NaN);
2778}
2779if (updateInProgress === false) {
2780updateInProgress = true;
2781hooks.updateOffset(this);
2782updateInProgress = false;
2783}
2784}
2785function isMoment(obj) {
2786return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
2787}
2788function absFloor(number) {
2789if (number < 0) {
2790return Math.ceil(number) || 0;
2791} else {
2792return Math.floor(number);
2793}
2794}
2795function toInt(argumentForCoercion) {
2796var coercedNumber = +argumentForCoercion
2797  , value = 0;
2798if (coercedNumber !== 0 && isFinite(coercedNumber)) {
2799value = absFloor(coercedNumber);
2800}
2801return value;
2802}
2803function compareArrays(array1, array2, dontConvert) {
2804var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i;
2805for (i = 0; i < len; i++) {
2806if ((dontConvert && array1[i] !== array2[i]) || (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
2807diffs++;
2808}
2809}
2810return diffs + lengthDiff;
2811}
2812function warn(msg) {
2813if (hooks.suppressDeprecationWarnings === false && (typeof console !== 'undefined') && console.warn) {
2814console.warn('Deprecation warning: ' + msg);
2815}
2816}
2817function deprecate(msg, fn) {
2818var firstTime = true;
2819return extend(function() {
2820if (hooks.deprecationHandler != null) {
2821hooks.deprecationHandler(null, msg);
2822}
2823if (firstTime) {
2824var args = [];
2825var arg;
2826for (var i = 0; i < arguments.length; i++) {
2827arg = '';
2828if (typeof arguments[i] === 'object') {
2829arg += '\n[' + i + '] ';
2830for (var key in arguments[0]) {
2831arg += key + ': ' + arguments[0][key] + ', ';
2832}
2833arg = arg.slice(0, -2);
2834} else {
2835arg = arguments[i];
2836}
2837args.push(arg);
2838}
2839warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
2840firstTime = false;
vendor: 10,637 bytes, lines 2841-3253
2841}
2842return fn.apply(this, arguments);
2843}, fn);
2844}
2845var deprecations = {};
2846function deprecateSimple(name, msg) {
2847if (hooks.deprecationHandler != null) {
2848hooks.deprecationHandler(name, msg);
2849}
2850if (!deprecations[name]) {
2851warn(msg);
2852deprecations[name] = true;
2853}
2854}
2855hooks.suppressDeprecationWarnings = false;
2856hooks.deprecationHandler = null;
2857function isFunction(input) {
2858return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
2859}
2860function set(config) {
2861var prop, i;
2862for (i in config) {
2863prop = config[i];
2864if (isFunction(prop)) {
2865this[i] = prop;
2866} else {
2867this['_' + i] = prop;
2868}
2869}
2870this._config = config;
2871this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
2872}
2873function mergeConfigs(parentConfig, childConfig) {
2874var res = extend({}, parentConfig), prop;
2875for (prop in childConfig) {
2876if (hasOwnProp(childConfig, prop)) {
2877if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
2878res[prop] = {};
2879extend(res[prop], parentConfig[prop]);
2880extend(res[prop], childConfig[prop]);
2881} else if (childConfig[prop] != null) {
2882res[prop] = childConfig[prop];
2883} else {
2884delete res[prop];
2885}
2886}
2887}
2888for (prop in parentConfig) {
2889if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {
2890res[prop] = extend({}, res[prop]);
2891}
2892}
2893return res;
2894}
2895function Locale(config) {
2896if (config != null) {
2897this.set(config);
2898}
2899}
2900var keys;
2901if (Object.keys) {
2902keys = Object.keys;
2903} else {
2904keys = function(obj) {
2905var i, res = [];
2906for (i in obj) {
2907if (hasOwnProp(obj, i)) {
2908res.push(i);
2909}
2910}
2911return res;
2912}
2913;
2914}
2915var keys$1 = keys;
2916var defaultCalendar = {
2917sameDay: '[Today at] LT',
2918nextDay: '[Tomorrow at] LT',
2919nextWeek: 'dddd [at] LT',
2920lastDay: '[Yesterday at] LT',
2921lastWeek: '[Last] dddd [at] LT',
2922sameElse: 'L'
2923};
2924function calendar(key, mom, now) {
2925var output = this._calendar[key] || this._calendar['sameElse'];
2926return isFunction(output) ? output.call(mom, now) : output;
2927}
2928var defaultLongDateFormat = {
2929LTS: 'h:mm:ss A',
2930LT: 'h:mm A',
2931L: 'MM/DD/YYYY',
2932LL: 'MMMM D, YYYY',
2933LLL: 'MMMM D, YYYY h:mm A',
2934LLLL: 'dddd, MMMM D, YYYY h:mm A'
2935};
2936function longDateFormat(key) {
2937var format = this._longDateFormat[key]
2938  , formatUpper = this._longDateFormat[key.toUpperCase()];
2939if (format || !formatUpper) {
2940return format;
2941}
2942this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function(val) {
2943return val.slice(1);
2944});
2945return this._longDateFormat[key];
2946}
2947var defaultInvalidDate = 'Invalid date';
2948function invalidDate() {
2949return this._invalidDate;
2950}
2951var defaultOrdinal = '%d';
2952var defaultOrdinalParse = /\d{1,2}/;
2953function ordinal(number) {
2954return this._ordinal.replace('%d', number);
2955}
2956var defaultRelativeTime = {
2957future: 'in %s',
2958past: '%s ago',
2959s: 'a few seconds',
2960m: 'a minute',
2961mm: '%d minutes',
2962h: 'an hour',
2963hh: '%d hours',
2964d: 'a day',
2965dd: '%d days',
2966M: 'a month',
2967MM: '%d months',
2968y: 'a year',
2969yy: '%d years'
2970};
2971function relativeTime(number, withoutSuffix, string, isFuture) {
2972var output = this._relativeTime[string];
2973return (isFunction(output)) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);
2974}
2975function pastFuture(diff, output) {
2976var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
2977return isFunction(format) ? format(output) : format.replace(/%s/i, output);
2978}
2979var aliases = {};
2980function addUnitAlias(unit, shorthand) {
2981var lowerCase = unit.toLowerCase();
2982aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
2983}
2984function normalizeUnits(units) {
2985return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
2986}
2987function normalizeObjectUnits(inputObject) {
2988var normalizedInput = {}, normalizedProp, prop;
2989for (prop in inputObject) {
2990if (hasOwnProp(inputObject, prop)) {
2991normalizedProp = normalizeUnits(prop);
2992if (normalizedProp) {
2993normalizedInput[normalizedProp] = inputObject[prop];
2994}
2995}
2996}
2997return normalizedInput;
2998}
2999var priorities = {};
3000function addUnitPriority(unit, priority) {
3001priorities[unit] = priority;
3002}
3003function getPrioritizedUnits(unitsObj) {
3004var units = [];
3005for (var u in unitsObj) {
3006units.push({
3007unit: u,
3008priority: priorities[u]
3009});
3010}
3011units.sort(function(a, b) {
3012return a.priority - b.priority;
3013});
3014return units;
3015}
3016function makeGetSet(unit, keepTime) {
3017return function(value) {
3018if (value != null) {
3019set$1(this, unit, value);
3020hooks.updateOffset(this, keepTime);
3021return this;
3022} else {
3023return get(this, unit);
3024}
3025}
3026;
3027}
3028function get(mom, unit) {
3029return mom.isValid() ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
3030}
3031function set$1(mom, unit, value) {
3032if (mom.isValid()) {
3033mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
3034}
3035}
3036function stringGet(units) {
3037units = normalizeUnits(units);
3038if (isFunction(this[units])) {
3039return this[units]();
3040}
3041return this;
3042}
3043function stringSet(units, value) {
3044if (typeof units === 'object') {
3045units = normalizeObjectUnits(units);
3046var prioritized = getPrioritizedUnits(units);
3047for (var i = 0; i < prioritized.length; i++) {
3048this[prioritized[i].unit](units[prioritized[i].unit]);
3049}
3050} else {
3051units = normalizeUnits(units);
3052if (isFunction(this[units])) {
3053return this[units](value);
3054}
3055}
3056return this;
3057}
3058function zeroFill(number, targetLength, forceSign) {
3059var absNumber = '' + Math.abs(number)
3060  , zerosToFill = targetLength - absNumber.length
3061  , sign = number >= 0;
3062return (sign ? (forceSign ? '+' : '') : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
3063}
3064var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
3065var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
3066var formatFunctions = {};
3067var formatTokenFunctions = {};
3068function addFormatToken(token, padded, ordinal, callback) {
3069var func = callback;
3070if (typeof callback === 'string') {
3071func = function() {
3072return this[callback]();
3073}
3074;
3075}
3076if (token) {
3077formatTokenFunctions[token] = func;
3078}
3079if (padded) {
3080formatTokenFunctions[padded[0]] = function() {
3081return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
3082}
3083;
3084}
3085if (ordinal) {
3086formatTokenFunctions[ordinal] = function() {
3087return this.localeData().ordinal(func.apply(this, arguments), token);
3088}
3089;
3090}
3091}
3092function removeFormattingTokens(input) {
3093if (input.match(/\[[\s\S]/)) {
3094return input.replace(/^\[|\]$/g, '');
3095}
3096return input.replace(/\\/g, '');
3097}
3098function makeFormatFunction(format) {
3099var array = format.match(formattingTokens), i, length;
3100for (i = 0,
3101length = array.length; i < length; i++) {
3102if (formatTokenFunctions[array[i]]) {
3103array[i] = formatTokenFunctions[array[i]];
3104} else {
3105array[i] = removeFormattingTokens(array[i]);
3106}
3107}
3108return function(mom) {
3109var output = '', i;
3110for (i = 0; i < length; i++) {
3111output += array[i]instanceof Function ? array[i].call(mom, format) : array[i];
3112}
3113return output;
3114}
3115;
3116}
3117function formatMoment(m, format) {
3118if (!m.isValid()) {
3119return m.localeData().invalidDate();
3120}
3121format = expandFormat(format, m.localeData());
3122formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
3123return formatFunctions[format](m);
3124}
3125function expandFormat(format, locale) {
3126var i = 5;
3127function replaceLongDateFormatTokens(input) {
3128return locale.longDateFormat(input) || input;
3129}
3130localFormattingTokens.lastIndex = 0;
3131while (i >= 0 && localFormattingTokens.test(format)) {
3132format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
3133localFormattingTokens.lastIndex = 0;
3134i -= 1;
3135}
3136return format;
3137}
3138var match1 = /\d/;
3139var match2 = /\d\d/;
3140var match3 = /\d{3}/;
3141var match4 = /\d{4}/;
3142var match6 = /[+-]?\d{6}/;
3143var match1to2 = /\d\d?/;
3144var match3to4 = /\d\d\d\d?/;
3145var match5to6 = /\d\d\d\d\d\d?/;
3146var match1to3 = /\d{1,3}/;
3147var match1to4 = /\d{1,4}/;
3148var match1to6 = /[+-]?\d{1,6}/;
3149var matchUnsigned = /\d+/;
3150var matchSigned = /[+-]?\d+/;
3151var matchOffset = /Z|[+-]\d\d:?\d\d/gi;
3152var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi;
3153var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/;
3154var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
3155var regexes = {};
3156function addRegexToken(token, regex, strictRegex) {
3157regexes[token] = isFunction(regex) ? regex : function(isStrict, localeData) {
3158return (isStrict && strictRegex) ? strictRegex : regex;
3159}
3160;
3161}
3162function getParseRegexForToken(token, config) {
3163if (!hasOwnProp(regexes, token)) {
3164return new RegExp(unescapeFormat(token));
3165}
3166return regexes[token](config._strict, config._locale);
3167}
3168function unescapeFormat(s) {
3169return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function(matched, p1, p2, p3, p4) {
3170return p1 || p2 || p3 || p4;
3171}));
3172}
3173function regexEscape(s) {
3174return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
3175}
3176var tokens = {};
3177function addParseToken(token, callback) {
3178var i, func = callback;
3179if (typeof token === 'string') {
3180token = [token];
3181}
3182if (isNumber(callback)) {
3183func = function(input, array) {
3184array[callback] = toInt(input);
3185}
3186;
3187}
3188for (i = 0; i < token.length; i++) {
3189tokens[token[i]] = func;
3190}
3191}
3192function addWeekParseToken(token, callback) {
3193addParseToken(token, function(input, array, config, token) {
3194config._w = config._w || {};
3195callback(input, config._w, config, token);
3196});
3197}
3198function addTimeToArrayFromToken(token, input, config) {
3199if (input != null && hasOwnProp(tokens, token)) {
3200tokens[token](input, config._a, config, token);
3201}
3202}
3203var YEAR = 0;
3204var MONTH = 1;
3205var DATE = 2;
3206var HOUR = 3;
3207var MINUTE = 4;
3208var SECOND = 5;
3209var MILLISECOND = 6;
3210var WEEK = 7;
3211var WEEKDAY = 8;
3212var indexOf;
3213if (Array.prototype.indexOf) {
3214indexOf = Array.prototype.indexOf;
3215} else {
3216indexOf = function(o) {
3217var i;
3218for (i = 0; i < this.length; ++i) {
3219if (this[i] === o) {
3220return i;
3221}
3222}
3223return -1;
3224}
3225;
3226}
3227var indexOf$1 = indexOf;
3228function daysInMonth(year, month) {
3229return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
3230}
3231addFormatToken('M', ['MM', 2], 'Mo', function() {
3232return this.month() + 1;
3233});
3234addFormatToken('MMM', 0, 0, function(format) {
3235return this.localeData().monthsShort(this, format);
3236});
3237addFormatToken('MMMM', 0, 0, function(format) {
3238return this.localeData().months(this, format);
3239});
3240addUnitAlias('month', 'M');
3241addUnitPriority('month', 8);
3242addRegexToken('M', match1to2);
3243addRegexToken('MM', match1to2, match2);
3244addRegexToken('MMM', function(isStrict, locale) {
3245return locale.monthsShortRegex(isStrict);
3246});
3247addRegexToken('MMMM', function(isStrict, locale) {
3248return locale.monthsRegex(isStrict);
3249});
3250addParseToken(['M', 'MM'], function(input, array) {
3251array[MONTH] = toInt(input) - 1;
3252});
3253addParseToken(['MMM', 'MMMM'], function(input, array, config, token) {
vendor: 16,384 bytes, lines 3254-3794
3254var month = config._locale.monthsParse(input, token, config._strict);
3255if (month != null) {
3256array[MONTH] = month;
3257} else {
3258getParsingFlags(config).invalidMonth = input;
3259}
3260});
3261var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
3262var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
3263function localeMonths(m, format) {
3264if (!m) {
3265return this._months;
3266}
3267return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
3268}
3269var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
3270function localeMonthsShort(m, format) {
3271if (!m) {
3272return this._monthsShort;
3273}
3274return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
3275}
3276function handleStrictParse(monthName, format, strict) {
3277var i, ii, mom, llc = monthName.toLocaleLowerCase();
3278if (!this._monthsParse) {
3279this._monthsParse = [];
3280this._longMonthsParse = [];
3281this._shortMonthsParse = [];
3282for (i = 0; i < 12; ++i) {
3283mom = createUTC([2000, i]);
3284this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
3285this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
3286}
3287}
3288if (strict) {
3289if (format === 'MMM') {
3290ii = indexOf$1.call(this._shortMonthsParse, llc);
3291return ii !== -1 ? ii : null;
3292} else {
3293ii = indexOf$1.call(this._longMonthsParse, llc);
3294return ii !== -1 ? ii : null;
3295}
3296} else {
3297if (format === 'MMM') {
3298ii = indexOf$1.call(this._shortMonthsParse, llc);
3299if (ii !== -1) {
3300return ii;
3301}
3302ii = indexOf$1.call(this._longMonthsParse, llc);
3303return ii !== -1 ? ii : null;
3304} else {
3305ii = indexOf$1.call(this._longMonthsParse, llc);
3306if (ii !== -1) {
3307return ii;
3308}
3309ii = indexOf$1.call(this._shortMonthsParse, llc);
3310return ii !== -1 ? ii : null;
3311}
3312}
3313}
3314function localeMonthsParse(monthName, format, strict) {
3315var i, mom, regex;
3316if (this._monthsParseExact) {
3317return handleStrictParse.call(this, monthName, format, strict);
3318}
3319if (!this._monthsParse) {
3320this._monthsParse = [];
3321this._longMonthsParse = [];
3322this._shortMonthsParse = [];
3323}
3324for (i = 0; i < 12; i++) {
3325mom = createUTC([2000, i]);
3326if (strict && !this._longMonthsParse[i]) {
3327this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$','i');
3328this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$','i');
3329}
3330if (!strict && !this._monthsParse[i]) {
3331regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
3332this._monthsParse[i] = new RegExp(regex.replace('.', ''),'i');
3333}
3334if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
3335return i;
3336} else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
3337return i;
3338} else if (!strict && this._monthsParse[i].test(monthName)) {
3339return i;
3340}
3341}
3342}
3343function setMonth(mom, value) {
3344var dayOfMonth;
3345if (!mom.isValid()) {
3346return mom;
3347}
3348if (typeof value === 'string') {
3349if (/^\d+$/.test(value)) {
3350value = toInt(value);
3351} else {
3352value = mom.localeData().monthsParse(value);
3353if (!isNumber(value)) {
3354return mom;
3355}
3356}
3357}
3358dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
3359mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
3360return mom;
3361}
3362function getSetMonth(value) {
3363if (value != null) {
3364setMonth(this, value);
3365hooks.updateOffset(this, true);
3366return this;
3367} else {
3368return get(this, 'Month');
3369}
3370}
3371function getDaysInMonth() {
3372return daysInMonth(this.year(), this.month());
3373}
3374var defaultMonthsShortRegex = matchWord;
3375function monthsShortRegex(isStrict) {
3376if (this._monthsParseExact) {
3377if (!hasOwnProp(this, '_monthsRegex')) {
3378computeMonthsParse.call(this);
3379}
3380if (isStrict) {
3381return this._monthsShortStrictRegex;
3382} else {
3383return this._monthsShortRegex;
3384}
3385} else {
3386if (!hasOwnProp(this, '_monthsShortRegex')) {
3387this._monthsShortRegex = defaultMonthsShortRegex;
3388}
3389return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;
3390}
3391}
3392var defaultMonthsRegex = matchWord;
3393function monthsRegex(isStrict) {
3394if (this._monthsParseExact) {
3395if (!hasOwnProp(this, '_monthsRegex')) {
3396computeMonthsParse.call(this);
3397}
3398if (isStrict) {
3399return this._monthsStrictRegex;
3400} else {
3401return this._monthsRegex;
3402}
3403} else {
3404if (!hasOwnProp(this, '_monthsRegex')) {
3405this._monthsRegex = defaultMonthsRegex;
3406}
3407return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;
3408}
3409}
3410function computeMonthsParse() {
3411function cmpLenRev(a, b) {
3412return b.length - a.length;
3413}
3414var shortPieces = [], longPieces = [], mixedPieces = [], i, mom;
3415for (i = 0; i < 12; i++) {
3416mom = createUTC([2000, i]);
3417shortPieces.push(this.monthsShort(mom, ''));
3418longPieces.push(this.months(mom, ''));
3419mixedPieces.push(this.months(mom, ''));
3420mixedPieces.push(this.monthsShort(mom, ''));
3421}
3422shortPieces.sort(cmpLenRev);
3423longPieces.sort(cmpLenRev);
3424mixedPieces.sort(cmpLenRev);
3425for (i = 0; i < 12; i++) {
3426shortPieces[i] = regexEscape(shortPieces[i]);
3427longPieces[i] = regexEscape(longPieces[i]);
3428}
3429for (i = 0; i < 24; i++) {
3430mixedPieces[i] = regexEscape(mixedPieces[i]);
3431}
3432this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')','i');
3433this._monthsShortRegex = this._monthsRegex;
3434this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')','i');
3435this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')','i');
3436}
3437addFormatToken('Y', 0, 0, function() {
3438var y = this.year();
3439return y <= 9999 ? '' + y : '+' + y;
3440});
3441addFormatToken(0, ['YY', 2], 0, function() {
3442return this.year() % 100;
3443});
3444addFormatToken(0, ['YYYY', 4], 0, 'year');
3445addFormatToken(0, ['YYYYY', 5], 0, 'year');
3446addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
3447addUnitAlias('year', 'y');
3448addUnitPriority('year', 1);
3449addRegexToken('Y', matchSigned);
3450addRegexToken('YY', match1to2, match2);
3451addRegexToken('YYYY', match1to4, match4);
3452addRegexToken('YYYYY', match1to6, match6);
3453addRegexToken('YYYYYY', match1to6, match6);
3454addParseToken(['YYYYY', 'YYYYYY'], YEAR);
3455addParseToken('YYYY', function(input, array) {
3456array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
3457});
3458addParseToken('YY', function(input, array) {
3459array[YEAR] = hooks.parseTwoDigitYear(input);
3460});
3461addParseToken('Y', function(input, array) {
3462array[YEAR] = parseInt(input, 10);
3463});
3464function daysInYear(year) {
3465return isLeapYear(year) ? 366 : 365;
3466}
3467function isLeapYear(year) {
3468return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
3469}
3470hooks.parseTwoDigitYear = function(input) {
3471return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
3472}
3473;
3474var getSetYear = makeGetSet('FullYear', true);
3475function getIsLeapYear() {
3476return isLeapYear(this.year());
3477}
3478function createDate(y, m, d, h, M, s, ms) {
3479var date = new Date(y,m,d,h,M,s,ms);
3480if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
3481date.setFullYear(y);
3482}
3483return date;
3484}
3485function createUTCDate(y) {
3486var date = new Date(Date.UTC.apply(null, arguments));
3487if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
3488date.setUTCFullYear(y);
3489}
3490return date;
3491}
3492function firstWeekOffset(year, dow, doy) {
3493var fwd = 7 + dow - doy
3494  , fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
3495return -fwdlw + fwd - 1;
3496}
3497function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
3498var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear;
3499if (dayOfYear <= 0) {
3500resYear = year - 1;
3501resDayOfYear = daysInYear(resYear) + dayOfYear;
3502} else if (dayOfYear > daysInYear(year)) {
3503resYear = year + 1;
3504resDayOfYear = dayOfYear - daysInYear(year);
3505} else {
3506resYear = year;
3507resDayOfYear = dayOfYear;
3508}
3509return {
3510year: resYear,
3511dayOfYear: resDayOfYear
3512};
3513}
3514function weekOfYear(mom, dow, doy) {
3515var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear;
3516if (week < 1) {
3517resYear = mom.year() - 1;
3518resWeek = week + weeksInYear(resYear, dow, doy);
3519} else if (week > weeksInYear(mom.year(), dow, doy)) {
3520resWeek = week - weeksInYear(mom.year(), dow, doy);
3521resYear = mom.year() + 1;
3522} else {
3523resYear = mom.year();
3524resWeek = week;
3525}
3526return {
3527week: resWeek,
3528year: resYear
3529};
3530}
3531function weeksInYear(year, dow, doy) {
3532var weekOffset = firstWeekOffset(year, dow, doy)
3533  , weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
3534return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
3535}
3536addFormatToken('w', ['ww', 2], 'wo', 'week');
3537addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
3538addUnitAlias('week', 'w');
3539addUnitAlias('isoWeek', 'W');
3540addUnitPriority('week', 5);
3541addUnitPriority('isoWeek', 5);
3542addRegexToken('w', match1to2);
3543addRegexToken('ww', match1to2, match2);
3544addRegexToken('W', match1to2);
3545addRegexToken('WW', match1to2, match2);
3546addWeekParseToken(['w', 'ww', 'W', 'WW'], function(input, week, config, token) {
3547week[token.substr(0, 1)] = toInt(input);
3548});
3549function localeWeek(mom) {
3550return weekOfYear(mom, this._week.dow, this._week.doy).week;
3551}
3552var defaultLocaleWeek = {
3553dow: 0,
3554doy: 6
3555};
3556function localeFirstDayOfWeek() {
3557return this._week.dow;
3558}
3559function localeFirstDayOfYear() {
3560return this._week.doy;
3561}
3562function getSetWeek(input) {
3563var week = this.localeData().week(this);
3564return input == null ? week : this.add((input - week) * 7, 'd');
3565}
3566function getSetISOWeek(input) {
3567var week = weekOfYear(this, 1, 4).week;
3568return input == null ? week : this.add((input - week) * 7, 'd');
3569}
3570addFormatToken('d', 0, 'do', 'day');
3571addFormatToken('dd', 0, 0, function(format) {
3572return this.localeData().weekdaysMin(this, format);
3573});
3574addFormatToken('ddd', 0, 0, function(format) {
3575return this.localeData().weekdaysShort(this, format);
3576});
3577addFormatToken('dddd', 0, 0, function(format) {
3578return this.localeData().weekdays(this, format);
3579});
3580addFormatToken('e', 0, 0, 'weekday');
3581addFormatToken('E', 0, 0, 'isoWeekday');
3582addUnitAlias('day', 'd');
3583addUnitAlias('weekday', 'e');
3584addUnitAlias('isoWeekday', 'E');
3585addUnitPriority('day', 11);
3586addUnitPriority('weekday', 11);
3587addUnitPriority('isoWeekday', 11);
3588addRegexToken('d', match1to2);
3589addRegexToken('e', match1to2);
3590addRegexToken('E', match1to2);
3591addRegexToken('dd', function(isStrict, locale) {
3592return locale.weekdaysMinRegex(isStrict);
3593});
3594addRegexToken('ddd', function(isStrict, locale) {
3595return locale.weekdaysShortRegex(isStrict);
3596});
3597addRegexToken('dddd', function(isStrict, locale) {
3598return locale.weekdaysRegex(isStrict);
3599});
3600addWeekParseToken(['dd', 'ddd', 'dddd'], function(input, week, config, token) {
3601var weekday = config._locale.weekdaysParse(input, token, config._strict);
3602if (weekday != null) {
3603week.d = weekday;
3604} else {
3605getParsingFlags(config).invalidWeekday = input;
3606}
3607});
3608addWeekParseToken(['d', 'e', 'E'], function(input, week, config, token) {
3609week[token] = toInt(input);
3610});
3611function parseWeekday(input, locale) {
3612if (typeof input !== 'string') {
3613return input;
3614}
3615if (!isNaN(input)) {
3616return parseInt(input, 10);
3617}
3618input = locale.weekdaysParse(input);
3619if (typeof input === 'number') {
3620return input;
3621}
3622return null;
3623}
3624function parseIsoWeekday(input, locale) {
3625if (typeof input === 'string') {
3626return locale.weekdaysParse(input) % 7 || 7;
3627}
3628return isNaN(input) ? null : input;
3629}
3630var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
3631function localeWeekdays(m, format) {
3632if (!m) {
3633return this._weekdays;
3634}
3635return isArray(this._weekdays) ? this._weekdays[m.day()] : this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
3636}
3637var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
3638function localeWeekdaysShort(m) {
3639return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
3640}
3641var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
3642function localeWeekdaysMin(m) {
3643return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
3644}
3645function handleStrictParse$1(weekdayName, format, strict) {
3646var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
3647if (!this._weekdaysParse) {
3648this._weekdaysParse = [];
3649this._shortWeekdaysParse = [];
3650this._minWeekdaysParse = [];
3651for (i = 0; i < 7; ++i) {
3652mom = createUTC([2000, 1]).day(i);
3653this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
3654this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
3655this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
3656}
3657}
3658if (strict) {
3659if (format === 'dddd') {
3660ii = indexOf$1.call(this._weekdaysParse, llc);
3661return ii !== -1 ? ii : null;
3662} else if (format === 'ddd') {
3663ii = indexOf$1.call(this._shortWeekdaysParse, llc);
3664return ii !== -1 ? ii : null;
3665} else {
3666ii = indexOf$1.call(this._minWeekdaysParse, llc);
3667return ii !== -1 ? ii : null;
3668}
3669} else {
3670if (format === 'dddd') {
3671ii = indexOf$1.call(this._weekdaysParse, llc);
3672if (ii !== -1) {
3673return ii;
3674}
3675ii = indexOf$1.call(this._shortWeekdaysParse, llc);
3676if (ii !== -1) {
3677return ii;
3678}
3679ii = indexOf$1.call(this._minWeekdaysParse, llc);
3680return ii !== -1 ? ii : null;
3681} else if (format === 'ddd') {
3682ii = indexOf$1.call(this._shortWeekdaysParse, llc);
3683if (ii !== -1) {
3684return ii;
3685}
3686ii = indexOf$1.call(this._weekdaysParse, llc);
3687if (ii !== -1) {
3688return ii;
3689}
3690ii = indexOf$1.call(this._minWeekdaysParse, llc);
3691return ii !== -1 ? ii : null;
3692} else {
3693ii = indexOf$1.call(this._minWeekdaysParse, llc);
3694if (ii !== -1) {
3695return ii;
3696}
3697ii = indexOf$1.call(this._weekdaysParse, llc);
3698if (ii !== -1) {
3699return ii;
3700}
3701ii = indexOf$1.call(this._shortWeekdaysParse, llc);
3702return ii !== -1 ? ii : null;
3703}
3704}
3705}
3706function localeWeekdaysParse(weekdayName, format, strict) {
3707var i, mom, regex;
3708if (this._weekdaysParseExact) {
3709return handleStrictParse$1.call(this, weekdayName, format, strict);
3710}
3711if (!this._weekdaysParse) {
3712this._weekdaysParse = [];
3713this._minWeekdaysParse = [];
3714this._shortWeekdaysParse = [];
3715this._fullWeekdaysParse = [];
3716}
3717for (i = 0; i < 7; i++) {
3718mom = createUTC([2000, 1]).day(i);
3719if (strict && !this._fullWeekdaysParse[i]) {
3720this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$','i');
3721this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$','i');
3722this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$','i');
3723}
3724if (!this._weekdaysParse[i]) {
3725regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
3726this._weekdaysParse[i] = new RegExp(regex.replace('.', ''),'i');
3727}
3728if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
3729return i;
3730} else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
3731return i;
3732} else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
3733return i;
3734} else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
3735return i;
3736}
3737}
3738}
3739function getSetDayOfWeek(input) {
3740if (!this.isValid()) {
3741return input != null ? this : NaN;
3742}
3743var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
3744if (input != null) {
3745input = parseWeekday(input, this.localeData());
3746return this.add(input - day, 'd');
3747} else {
3748return day;
3749}
3750}
3751function getSetLocaleDayOfWeek(input) {
3752if (!this.isValid()) {
3753return input != null ? this : NaN;
3754}
3755var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
3756return input == null ? weekday : this.add(input - weekday, 'd');
3757}
3758function getSetISODayOfWeek(input) {
3759if (!this.isValid()) {
3760return input != null ? this : NaN;
3761}
3762if (input != null) {
3763var weekday = parseIsoWeekday(input, this.localeData());
3764return this.day(this.day() % 7 ? weekday : weekday - 7);
3765} else {
3766return this.day() || 7;
3767}
3768}
3769var defaultWeekdaysRegex = matchWord;
3770function weekdaysRegex(isStrict) {
3771if (this._weekdaysParseExact) {
3772if (!hasOwnProp(this, '_weekdaysRegex')) {
3773computeWeekdaysParse.call(this);
3774}
3775if (isStrict) {
3776return this._weekdaysStrictRegex;
3777} else {
3778return this._weekdaysRegex;
3779}
3780} else {
3781if (!hasOwnProp(this, '_weekdaysRegex')) {
3782this._weekdaysRegex = defaultWeekdaysRegex;
3783}
3784return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;
3785}
3786}
3787var defaultWeekdaysShortRegex = matchWord;
3788function weekdaysShortRegex(isStrict) {
3789if (this._weekdaysParseExact) {
3790if (!hasOwnProp(this, '_weekdaysRegex')) {
3791computeWeekdaysParse.call(this);
3792}
3793if (isStrict) {
3794return this._weekdaysShortStr
vendor: 6,315 bytes, lines 3794-4000
3794ictRegex;
3795} else {
3796return this._weekdaysShortRegex;
3797}
3798} else {
3799if (!hasOwnProp(this, '_weekdaysShortRegex')) {
3800this._weekdaysShortRegex = defaultWeekdaysShortRegex;
3801}
3802return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
3803}
3804}
3805var defaultWeekdaysMinRegex = matchWord;
3806function weekdaysMinRegex(isStrict) {
3807if (this._weekdaysParseExact) {
3808if (!hasOwnProp(this, '_weekdaysRegex')) {
3809computeWeekdaysParse.call(this);
3810}
3811if (isStrict) {
3812return this._weekdaysMinStrictRegex;
3813} else {
3814return this._weekdaysMinRegex;
3815}
3816} else {
3817if (!hasOwnProp(this, '_weekdaysMinRegex')) {
3818this._weekdaysMinRegex = defaultWeekdaysMinRegex;
3819}
3820return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
3821}
3822}
3823function computeWeekdaysParse() {
3824function cmpLenRev(a, b) {
3825return b.length - a.length;
3826}
3827var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i, mom, minp, shortp, longp;
3828for (i = 0; i < 7; i++) {
3829mom = createUTC([2000, 1]).day(i);
3830minp = this.weekdaysMin(mom, '');
3831shortp = this.weekdaysShort(mom, '');
3832longp = this.weekdays(mom, '');
3833minPieces.push(minp);
3834shortPieces.push(shortp);
3835longPieces.push(longp);
3836mixedPieces.push(minp);
3837mixedPieces.push(shortp);
3838mixedPieces.push(longp);
3839}
3840minPieces.sort(cmpLenRev);
3841shortPieces.sort(cmpLenRev);
3842longPieces.sort(cmpLenRev);
3843mixedPieces.sort(cmpLenRev);
3844for (i = 0; i < 7; i++) {
3845shortPieces[i] = regexEscape(shortPieces[i]);
3846longPieces[i] = regexEscape(longPieces[i]);
3847mixedPieces[i] = regexEscape(mixedPieces[i]);
3848}
3849this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')','i');
3850this._weekdaysShortRegex = this._weekdaysRegex;
3851this._weekdaysMinRegex = this._weekdaysRegex;
3852this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')','i');
3853this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')','i');
3854this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')','i');
3855}
3856function hFormat() {
3857return this.hours() % 12 || 12;
3858}
3859function kFormat() {
3860return this.hours() || 24;
3861}
3862addFormatToken('H', ['HH', 2], 0, 'hour');
3863addFormatToken('h', ['hh', 2], 0, hFormat);
3864addFormatToken('k', ['kk', 2], 0, kFormat);
3865addFormatToken('hmm', 0, 0, function() {
3866return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
3867});
3868addFormatToken('hmmss', 0, 0, function() {
3869return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
3870});
3871addFormatToken('Hmm', 0, 0, function() {
3872return '' + this.hours() + zeroFill(this.minutes(), 2);
3873});
3874addFormatToken('Hmmss', 0, 0, function() {
3875return '' + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
3876});
3877function meridiem(token, lowercase) {
3878addFormatToken(token, 0, 0, function() {
3879return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
3880});
3881}
3882meridiem('a', true);
3883meridiem('A', false);
3884addUnitAlias('hour', 'h');
3885addUnitPriority('hour', 13);
3886function matchMeridiem(isStrict, locale) {
3887return locale._meridiemParse;
3888}
3889addRegexToken('a', matchMeridiem);
3890addRegexToken('A', matchMeridiem);
3891addRegexToken('H', match1to2);
3892addRegexToken('h', match1to2);
3893addRegexToken('HH', match1to2, match2);
3894addRegexToken('hh', match1to2, match2);
3895addRegexToken('hmm', match3to4);
3896addRegexToken('hmmss', match5to6);
3897addRegexToken('Hmm', match3to4);
3898addRegexToken('Hmmss', match5to6);
3899addParseToken(['H', 'HH'], HOUR);
3900addParseToken(['a', 'A'], function(input, array, config) {
3901config._isPm = config._locale.isPM(input);
3902config._meridiem = input;
3903});
3904addParseToken(['h', 'hh'], function(input, array, config) {
3905array[HOUR] = toInt(input);
3906getParsingFlags(config).bigHour = true;
3907});
3908addParseToken('hmm', function(input, array, config) {
3909var pos = input.length - 2;
3910array[HOUR] = toInt(input.substr(0, pos));
3911array[MINUTE] = toInt(input.substr(pos));
3912getParsingFlags(config).bigHour = true;
3913});
3914addParseToken('hmmss', function(input, array, config) {
3915var pos1 = input.length - 4;
3916var pos2 = input.length - 2;
3917array[HOUR] = toInt(input.substr(0, pos1));
3918array[MINUTE] = toInt(input.substr(pos1, 2));
3919array[SECOND] = toInt(input.substr(pos2));
3920getParsingFlags(config).bigHour = true;
3921});
3922addParseToken('Hmm', function(input, array, config) {
3923var pos = input.length - 2;
3924array[HOUR] = toInt(input.substr(0, pos));
3925array[MINUTE] = toInt(input.substr(pos));
3926});
3927addParseToken('Hmmss', function(input, array, config) {
3928var pos1 = input.length - 4;
3929var pos2 = input.length - 2;
3930array[HOUR] = toInt(input.substr(0, pos1));
3931array[MINUTE] = toInt(input.substr(pos1, 2));
3932array[SECOND] = toInt(input.substr(pos2));
3933});
3934function localeIsPM(input) {
3935return ((input + '').toLowerCase().charAt(0) === 'p');
3936}
3937var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
3938function localeMeridiem(hours, minutes, isLower) {
3939if (hours > 11) {
3940return isLower ? 'pm' : 'PM';
3941} else {
3942return isLower ? 'am' : 'AM';
3943}
3944}
3945var getSetHour = makeGetSet('Hours', true);
3946var baseConfig = {
3947calendar: defaultCalendar,
3948longDateFormat: defaultLongDateFormat,
3949invalidDate: defaultInvalidDate,
3950ordinal: defaultOrdinal,
3951ordinalParse: defaultOrdinalParse,
3952relativeTime: defaultRelativeTime,
3953months: defaultLocaleMonths,
3954monthsShort: defaultLocaleMonthsShort,
3955week: defaultLocaleWeek,
3956weekdays: defaultLocaleWeekdays,
3957weekdaysMin: defaultLocaleWeekdaysMin,
3958weekdaysShort: defaultLocaleWeekdaysShort,
3959meridiemParse: defaultLocaleMeridiemParse
3960};
3961var locales = {};
3962var localeFamilies = {};
3963var globalLocale;
3964function normalizeLocale(key) {
3965return key ? key.toLowerCase().replace('_', '-') : key;
3966}
3967function chooseLocale(names) {
3968var i = 0, j, next, locale, split;
3969while (i < names.length) {
3970split = normalizeLocale(names[i]).split('-');
3971j = split.length;
3972next = normalizeLocale(names[i + 1]);
3973next = next ? next.split('-') : null;
3974while (j > 0) {
3975locale = loadLocale(split.slice(0, j).join('-'));
3976if (locale) {
3977return locale;
3978}
3979if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
3980break;
3981}
3982j--;
3983}
3984i++;
3985}
3986return null;
3987}
3988function loadLocale(name) {
3989var oldLocale = null;
3990if (!locales[name] && (typeof module !== 'undefined') && module && module.exports) {
3991try {
3992oldLocale = globalLocale._abbr;
3993require('./locale/' + name);
3994getSetGlobalLocale(oldLocale);
3995} catch (e) {}
3996}
3997return locales[name];
3998}
3999function getSetGlobalLocale(key, values) {
4000var data;
vendor: 4,435 bytes, lines 4001-4126
4001if (key) {
4002if (isUndefined(values)) {
4003data = getLocale(key);
4004} else {
4005data = defineLocale(key, values);
4006}
4007if (data) {
4008globalLocale = data;
4009}
4010}
4011return globalLocale._abbr;
4012}
4013function defineLocale(name, config) {
4014if (config !== null) {
4015var parentConfig = baseConfig;
4016config.abbr = name;
4017if (locales[name] != null) {
4018deprecateSimple('defineLocaleOverride', 'use moment.updateLocale(localeName, config) to change ' + 'an existing locale. moment.defineLocale(localeName, ' + 'config) should only be used for creating a new locale ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
4019parentConfig = locales[name]._config;
4020} else if (config.parentLocale != null) {
4021if (locales[config.parentLocale] != null) {
4022parentConfig = locales[config.parentLocale]._config;
4023} else {
4024if (!localeFamilies[config.parentLocale]) {
4025localeFamilies[config.parentLocale] = [];
4026}
4027localeFamilies[config.parentLocale].push({
4028name: name,
4029config: config
4030});
4031return null;
4032}
4033}
4034locales[name] = new Locale(mergeConfigs(parentConfig, config));
4035if (localeFamilies[name]) {
4036localeFamilies[name].forEach(function(x) {
4037defineLocale(x.name, x.config);
4038});
4039}
4040getSetGlobalLocale(name);
4041return locales[name];
4042} else {
4043delete locales[name];
4044return null;
4045}
4046}
4047function updateLocale(name, config) {
4048if (config != null) {
4049var locale, parentConfig = baseConfig;
4050if (locales[name] != null) {
4051parentConfig = locales[name]._config;
4052}
4053config = mergeConfigs(parentConfig, config);
4054locale = new Locale(config);
4055locale.parentLocale = locales[name];
4056locales[name] = locale;
4057getSetGlobalLocale(name);
4058} else {
4059if (locales[name] != null) {
4060if (locales[name].parentLocale != null) {
4061locales[name] = locales[name].parentLocale;
4062} else if (locales[name] != null) {
4063delete locales[name];
4064}
4065}
4066}
4067return locales[name];
4068}
4069function getLocale(key) {
4070var locale;
4071if (key && key._locale && key._locale._abbr) {
4072key = key._locale._abbr;
4073}
4074if (!key) {
4075return globalLocale;
4076}
4077if (!isArray(key)) {
4078locale = loadLocale(key);
4079if (locale) {
4080return locale;
4081}
4082key = [key];
4083}
4084return chooseLocale(key);
4085}
4086function listLocales() {
4087return keys$1(locales);
4088}
4089function checkOverflow(m) {
4090var overflow;
4091var a = m._a;
4092if (a && getParsingFlags(m).overflow === -2) {
4093overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1;
4094if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
4095overflow = DATE;
4096}
4097if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
4098overflow = WEEK;
4099}
4100if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
4101overflow = WEEKDAY;
4102}
4103getParsingFlags(m).overflow = overflow;
4104}
4105return m;
4106}
4107var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
4108var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
4109var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
4110var isoDates = [['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], ['GGGG-[W]WW', /\d{4}-W\d\d/, false], ['YYYY-DDD', /\d{4}-\d{3}/], ['YYYY-MM', /\d{4}-\d\d/, false], ['YYYYYYMMDD', /[+-]\d{10}/], ['YYYYMMDD', /\d{8}/], ['GGGG[W]WWE', /\d{4}W\d{3}/], ['GGGG[W]WW', /\d{4}W\d{2}/, false], ['YYYYDDD', /\d{7}/]];
4111var isoTimes = [['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], ['HH:mm:ss', /\d\d:\d\d:\d\d/], ['HH:mm', /\d\d:\d\d/], ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], ['HHmmss', /\d\d\d\d\d\d/], ['HHmm', /\d\d\d\d/], ['HH', /\d\d/]];
4112var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
4113function configFromISO(config) {
4114var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat;
4115if (match) {
4116getParsingFlags(config).iso = true;
4117for (i = 0,
4118l = isoDates.length; i < l; i++) {
4119if (isoDates[i][1].exec(match[1])) {
4120dateFormat = isoDates[i][0];
4121allowTime = isoDates[i][2] !== false;
4122break;
4123}
4124}
4125if (dateFormat == null) {
4126config._isValid = false;
vendor: 4,876 bytes, lines 4127-4293
4127return;
4128}
4129if (match[3]) {
4130for (i = 0,
4131l = isoTimes.length; i < l; i++) {
4132if (isoTimes[i][1].exec(match[3])) {
4133timeFormat = (match[2] || ' ') + isoTimes[i][0];
4134break;
4135}
4136}
4137if (timeFormat == null) {
4138config._isValid = false;
4139return;
4140}
4141}
4142if (!allowTime && timeFormat != null) {
4143config._isValid = false;
4144return;
4145}
4146if (match[4]) {
4147if (tzRegex.exec(match[4])) {
4148tzFormat = 'Z';
4149} else {
4150config._isValid = false;
4151return;
4152}
4153}
4154config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
4155configFromStringAndFormat(config);
4156} else {
4157config._isValid = false;
4158}
4159}
4160function configFromString(config) {
4161var matched = aspNetJsonRegex.exec(config._i);
4162if (matched !== null) {
4163config._d = new Date(+matched[1]);
4164return;
4165}
4166configFromISO(config);
4167if (config._isValid === false) {
4168delete config._isValid;
4169hooks.createFromInputFallback(config);
4170}
4171}
4172hooks.createFromInputFallback = deprecate('value provided is not in a recognized ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non ISO date formats are ' + 'discouraged and will be removed in an upcoming major release. Please refer to ' + 'http://momentjs.com/guides/#/warnings/js-date/ for more info.', function(config) {
4173config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
4174});
4175function defaults(a, b, c) {
4176if (a != null) {
4177return a;
4178}
4179if (b != null) {
4180return b;
4181}
4182return c;
4183}
4184function currentDateArray(config) {
4185var nowValue = new Date(hooks.now());
4186if (config._useUTC) {
4187return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
4188}
4189return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
4190}
4191function configFromArray(config) {
4192var i, date, input = [], currentDate, yearToUse;
4193if (config._d) {
4194return;
4195}
4196currentDate = currentDateArray(config);
4197if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
4198dayOfYearFromWeekInfo(config);
4199}
4200if (config._dayOfYear) {
4201yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
4202if (config._dayOfYear > daysInYear(yearToUse)) {
4203getParsingFlags(config)._overflowDayOfYear = true;
4204}
4205date = createUTCDate(yearToUse, 0, config._dayOfYear);
4206config._a[MONTH] = date.getUTCMonth();
4207config._a[DATE] = date.getUTCDate();
4208}
4209for (i = 0; i < 3 && config._a[i] == null; ++i) {
4210config._a[i] = input[i] = currentDate[i];
4211}
4212for (; i < 7; i++) {
4213config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
4214}
4215if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {
4216config._nextDay = true;
4217config._a[HOUR] = 0;
4218}
4219config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
4220if (config._tzm != null) {
4221config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
4222}
4223if (config._nextDay) {
4224config._a[HOUR] = 24;
4225}
4226}
4227function dayOfYearFromWeekInfo(config) {
4228var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
4229w = config._w;
4230if (w.GG != null || w.W != null || w.E != null) {
4231dow = 1;
4232doy = 4;
4233weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
4234week = defaults(w.W, 1);
4235weekday = defaults(w.E, 1);
4236if (weekday < 1 || weekday > 7) {
4237weekdayOverflow = true;
4238}
4239} else {
4240dow = config._locale._week.dow;
4241doy = config._locale._week.doy;
4242var curWeek = weekOfYear(createLocal(), dow, doy);
4243weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
4244week = defaults(w.w, curWeek.week);
4245if (w.d != null) {
4246weekday = w.d;
4247if (weekday < 0 || weekday > 6) {
4248weekdayOverflow = true;
4249}
4250} else if (w.e != null) {
4251weekday = w.e + dow;
4252if (w.e < 0 || w.e > 6) {
4253weekdayOverflow = true;
4254}
4255} else {
4256weekday = dow;
4257}
4258}
4259if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
4260getParsingFlags(config)._overflowWeeks = true;
4261} else if (weekdayOverflow != null) {
4262getParsingFlags(config)._overflowWeekday = true;
4263} else {
4264temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
4265config._a[YEAR] = temp.year;
4266config._dayOfYear = temp.dayOfYear;
4267}
4268}
4269hooks.ISO_8601 = function() {}
4270;
4271function configFromStringAndFormat(config) {
4272if (config._f === hooks.ISO_8601) {
4273configFromISO(config);
4274return;
4275}
4276config._a = [];
4277getParsingFlags(config).empty = true;
4278var string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0;
4279tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
4280for (i = 0; i < tokens.length; i++) {
4281token = tokens[i];
4282parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
4283if (parsedInput) {
4284skipped = string.substr(0, string.indexOf(parsedInput));
4285if (skipped.length > 0) {
4286getParsingFlags(config).unusedInput.push(skipped);
4287}
4288string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
4289totalParsedInputLength += parsedInput.length;
4290}
4291if (formatTokenFunctions[token]) {
4292if (parsedInput) {
4293getParsingFlags(config).empty = false;
vendor: 4,105 bytes, lines 4294-4447
4294} else {
4295getParsingFlags(config).unusedTokens.push(token);
4296}
4297addTimeToArrayFromToken(token, parsedInput, config);
4298} else if (config._strict && !parsedInput) {
4299getParsingFlags(config).unusedTokens.push(token);
4300}
4301}
4302getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
4303if (string.length > 0) {
4304getParsingFlags(config).unusedInput.push(string);
4305}
4306if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {
4307getParsingFlags(config).bigHour = undefined;
4308}
4309getParsingFlags(config).parsedDateParts = config._a.slice(0);
4310getParsingFlags(config).meridiem = config._meridiem;
4311config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
4312configFromArray(config);
4313checkOverflow(config);
4314}
4315function meridiemFixWrap(locale, hour, meridiem) {
4316var isPm;
4317if (meridiem == null) {
4318return hour;
4319}
4320if (locale.meridiemHour != null) {
4321return locale.meridiemHour(hour, meridiem);
4322} else if (locale.isPM != null) {
4323isPm = locale.isPM(meridiem);
4324if (isPm && hour < 12) {
4325hour += 12;
4326}
4327if (!isPm && hour === 12) {
4328hour = 0;
4329}
4330return hour;
4331} else {
4332return hour;
4333}
4334}
4335function configFromStringAndArray(config) {
4336var tempConfig, bestMoment, scoreToBeat, i, currentScore;
4337if (config._f.length === 0) {
4338getParsingFlags(config).invalidFormat = true;
4339config._d = new Date(NaN);
4340return;
4341}
4342for (i = 0; i < config._f.length; i++) {
4343currentScore = 0;
4344tempConfig = copyConfig({}, config);
4345if (config._useUTC != null) {
4346tempConfig._useUTC = config._useUTC;
4347}
4348tempConfig._f = config._f[i];
4349configFromStringAndFormat(tempConfig);
4350if (!isValid(tempConfig)) {
4351continue;
4352}
4353currentScore += getParsingFlags(tempConfig).charsLeftOver;
4354currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
4355getParsingFlags(tempConfig).score = currentScore;
4356if (scoreToBeat == null || currentScore < scoreToBeat) {
4357scoreToBeat = currentScore;
4358bestMoment = tempConfig;
4359}
4360}
4361extend(config, bestMoment || tempConfig);
4362}
4363function configFromObject(config) {
4364if (config._d) {
4365return;
4366}
4367var i = normalizeObjectUnits(config._i);
4368config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function(obj) {
4369return obj && parseInt(obj, 10);
4370});
4371configFromArray(config);
4372}
4373function createFromConfig(config) {
4374var res = new Moment(checkOverflow(prepareConfig(config)));
4375if (res._nextDay) {
4376res.add(1, 'd');
4377res._nextDay = undefined;
4378}
4379return res;
4380}
4381function prepareConfig(config) {
4382var input = config._i
4383  , format = config._f;
4384config._locale = config._locale || getLocale(config._l);
4385if (input === null || (format === undefined && input === '')) {
4386return createInvalid({
4387nullInput: true
4388});
4389}
4390if (typeof input === 'string') {
4391config._i = input = config._locale.preparse(input);
4392}
4393if (isMoment(input)) {
4394return new Moment(checkOverflow(input));
4395} else if (isDate(input)) {
4396config._d = input;
4397} else if (isArray(format)) {
4398configFromStringAndArray(config);
4399} else if (format) {
4400configFromStringAndFormat(config);
4401} else {
4402configFromInput(config);
4403}
4404if (!isValid(config)) {
4405config._d = null;
4406}
4407return config;
4408}
4409function configFromInput(config) {
4410var input = config._i;
4411if (input === undefined) {
4412config._d = new Date(hooks.now());
4413} else if (isDate(input)) {
4414config._d = new Date(input.valueOf());
4415} else if (typeof input === 'string') {
4416configFromString(config);
4417} else if (isArray(input)) {
4418config._a = map(input.slice(0), function(obj) {
4419return parseInt(obj, 10);
4420});
4421configFromArray(config);
4422} else if (typeof (input) === 'object') {
4423configFromObject(config);
4424} else if (isNumber(input)) {
4425config._d = new Date(input);
4426} else {
4427hooks.createFromInputFallback(config);
4428}
4429}
4430function createLocalOrUTC(input, format, locale, strict, isUTC) {
4431var c = {};
4432if (locale === true || locale === false) {
4433strict = locale;
4434locale = undefined;
4435}
4436if ((isObject(input) && isObjectEmpty(input)) || (isArray(input) && input.length === 0)) {
4437input = undefined;
4438}
4439c._isAMomentObject = true;
4440c._useUTC = c._isUTC = isUTC;
4441c._l = locale;
4442c._i = input;
4443c._f = format;
4444c._strict = strict;
4445return createFromConfig(c);
4446}
4447function createLocal(input, format, locale, strict) {
vendor: 10,210 bytes, lines 4448-4809
4448return createLocalOrUTC(input, format, locale, strict, false);
4449}
4450var prototypeMin = deprecate('moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function() {
4451var other = createLocal.apply(null, arguments);
4452if (this.isValid() && other.isValid()) {
4453return other < this ? this : other;
4454} else {
4455return createInvalid();
4456}
4457});
4458var prototypeMax = deprecate('moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function() {
4459var other = createLocal.apply(null, arguments);
4460if (this.isValid() && other.isValid()) {
4461return other > this ? this : other;
4462} else {
4463return createInvalid();
4464}
4465});
4466function pickBy(fn, moments) {
4467var res, i;
4468if (moments.length === 1 && isArray(moments[0])) {
4469moments = moments[0];
4470}
4471if (!moments.length) {
4472return createLocal();
4473}
4474res = moments[0];
4475for (i = 1; i < moments.length; ++i) {
4476if (!moments[i].isValid() || moments[i][fn](res)) {
4477res = moments[i];
4478}
4479}
4480return res;
4481}
4482function min() {
4483var args = [].slice.call(arguments, 0);
4484return pickBy('isBefore', args);
4485}
4486function max() {
4487var args = [].slice.call(arguments, 0);
4488return pickBy('isAfter', args);
4489}
4490var now = function() {
4491return Date.now ? Date.now() : +(new Date());
4492};
4493function Duration(duration) {
4494var normalizedInput = normalizeObjectUnits(duration)
4495  , years = normalizedInput.year || 0
4496  , quarters = normalizedInput.quarter || 0
4497  , months = normalizedInput.month || 0
4498  , weeks = normalizedInput.week || 0
4499  , days = normalizedInput.day || 0
4500  , hours = normalizedInput.hour || 0
4501  , minutes = normalizedInput.minute || 0
4502  , seconds = normalizedInput.second || 0
4503  , milliseconds = normalizedInput.millisecond || 0;
4504this._milliseconds = +milliseconds + seconds * 1e3 + minutes * 6e4 + hours * 1000 * 60 * 60;
4505this._days = +days + weeks * 7;
4506this._months = +months + quarters * 3 + years * 12;
4507this._data = {};
4508this._locale = getLocale();
4509this._bubble();
4510}
4511function isDuration(obj) {
4512return obj instanceof Duration;
4513}
4514function absRound(number) {
4515if (number < 0) {
4516return Math.round(-1 * number) * -1;
4517} else {
4518return Math.round(number);
4519}
4520}
4521function offset(token, separator) {
4522addFormatToken(token, 0, 0, function() {
4523var offset = this.utcOffset();
4524var sign = '+';
4525if (offset < 0) {
4526offset = -offset;
4527sign = '-';
4528}
4529return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
4530});
4531}
4532offset('Z', ':');
4533offset('ZZ', '');
4534addRegexToken('Z', matchShortOffset);
4535addRegexToken('ZZ', matchShortOffset);
4536addParseToken(['Z', 'ZZ'], function(input, array, config) {
4537config._useUTC = true;
4538config._tzm = offsetFromString(matchShortOffset, input);
4539});
4540var chunkOffset = /([\+\-]|\d\d)/gi;
4541function offsetFromString(matcher, string) {
4542var matches = (string || '').match(matcher);
4543if (matches === null) {
4544return null;
4545}
4546var chunk = matches[matches.length - 1] || [];
4547var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
4548var minutes = +(parts[1] * 60) + toInt(parts[2]);
4549return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
4550}
4551function cloneWithOffset(input, model) {
4552var res, diff;
4553if (model._isUTC) {
4554res = model.clone();
4555diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
4556res._d.setTime(res._d.valueOf() + diff);
4557hooks.updateOffset(res, false);
4558return res;
4559} else {
4560return createLocal(input).local();
4561}
4562}
4563function getDateOffset(m) {
4564return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
4565}
4566hooks.updateOffset = function() {}
4567;
4568function getSetOffset(input, keepLocalTime) {
4569var offset = this._offset || 0, localAdjust;
4570if (!this.isValid()) {
4571return input != null ? this : NaN;
4572}
4573if (input != null) {
4574if (typeof input === 'string') {
4575input = offsetFromString(matchShortOffset, input);
4576if (input === null) {
4577return this;
4578}
4579} else if (Math.abs(input) < 16) {
4580input = input * 60;
4581}
4582if (!this._isUTC && keepLocalTime) {
4583localAdjust = getDateOffset(this);
4584}
4585this._offset = input;
4586this._isUTC = true;
4587if (localAdjust != null) {
4588this.add(localAdjust, 'm');
4589}
4590if (offset !== input) {
4591if (!keepLocalTime || this._changeInProgress) {
4592addSubtract(this, createDuration(input - offset, 'm'), 1, false);
4593} else if (!this._changeInProgress) {
4594this._changeInProgress = true;
4595hooks.updateOffset(this, true);
4596this._changeInProgress = null;
4597}
4598}
4599return this;
4600} else {
4601return this._isUTC ? offset : getDateOffset(this);
4602}
4603}
4604function getSetZone(input, keepLocalTime) {
4605if (input != null) {
4606if (typeof input !== 'string') {
4607input = -input;
4608}
4609this.utcOffset(input, keepLocalTime);
4610return this;
4611} else {
4612return -this.utcOffset();
4613}
4614}
4615function setOffsetToUTC(keepLocalTime) {
4616return this.utcOffset(0, keepLocalTime);
4617}
4618function setOffsetToLocal(keepLocalTime) {
4619if (this._isUTC) {
4620this.utcOffset(0, keepLocalTime);
4621this._isUTC = false;
4622if (keepLocalTime) {
4623this.subtract(getDateOffset(this), 'm');
4624}
4625}
4626return this;
4627}
4628function setOffsetToParsedOffset() {
4629if (this._tzm != null) {
4630this.utcOffset(this._tzm);
4631} else if (typeof this._i === 'string') {
4632var tZone = offsetFromString(matchOffset, this._i);
4633if (tZone != null) {
4634this.utcOffset(tZone);
4635} else {
4636this.utcOffset(0, true);
4637}
4638}
4639return this;
4640}
4641function hasAlignedHourOffset(input) {
4642if (!this.isValid()) {
4643return false;
4644}
4645input = input ? createLocal(input).utcOffset() : 0;
4646return (this.utcOffset() - input) % 60 === 0;
4647}
4648function isDaylightSavingTime() {
4649return (this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset());
4650}
4651function isDaylightSavingTimeShifted() {
4652if (!isUndefined(this._isDSTShifted)) {
4653return this._isDSTShifted;
4654}
4655var c = {};
4656copyConfig(c, this);
4657c = prepareConfig(c);
4658if (c._a) {
4659var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
4660this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0;
4661} else {
4662this._isDSTShifted = false;
4663}
4664return this._isDSTShifted;
4665}
4666function isLocal() {
4667return this.isValid() ? !this._isUTC : false;
4668}
4669function isUtcOffset() {
4670return this.isValid() ? this._isUTC : false;
4671}
4672function isUtc() {
4673return this.isValid() ? this._isUTC && this._offset === 0 : false;
4674}
4675var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
4676var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;
4677function createDuration(input, key) {
4678var duration = input, match = null, sign, ret, diffRes;
4679if (isDuration(input)) {
4680duration = {
4681ms: input._milliseconds,
4682d: input._days,
4683M: input._months
4684};
4685} else if (isNumber(input)) {
4686duration = {};
4687if (key) {
4688duration[key] = input;
4689} else {
4690duration.milliseconds = input;
4691}
4692} else if (!!(match = aspNetRegex.exec(input))) {
4693sign = (match[1] === '-') ? -1 : 1;
4694duration = {
4695y: 0,
4696d: toInt(match[DATE]) * sign,
4697h: toInt(match[HOUR]) * sign,
4698m: toInt(match[MINUTE]) * sign,
4699s: toInt(match[SECOND]) * sign,
4700ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign
4701};
4702} else if (!!(match = isoRegex.exec(input))) {
4703sign = (match[1] === '-') ? -1 : 1;
4704duration = {
4705y: parseIso(match[2], sign),
4706M: parseIso(match[3], sign),
4707w: parseIso(match[4], sign),
4708d: parseIso(match[5], sign),
4709h: parseIso(match[6], sign),
4710m: parseIso(match[7], sign),
4711s: parseIso(match[8], sign)
4712};
4713} else if (duration == null) {
4714duration = {};
4715} else if (typeof duration === 'object' && ('from'in duration || 'to'in duration)) {
4716diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));
4717duration = {};
4718duration.ms = diffRes.milliseconds;
4719duration.M = diffRes.months;
4720}
4721ret = new Duration(duration);
4722if (isDuration(input) && hasOwnProp(input, '_locale')) {
4723ret._locale = input._locale;
4724}
4725return ret;
4726}
4727createDuration.fn = Duration.prototype;
4728function parseIso(inp, sign) {
4729var res = inp && parseFloat(inp.replace(',', '.'));
4730return (isNaN(res) ? 0 : res) * sign;
4731}
4732function positiveMomentsDifference(base, other) {
4733var res = {
4734milliseconds: 0,
4735months: 0
4736};
4737res.months = other.month() - base.month() + (other.year() - base.year()) * 12;
4738if (base.clone().add(res.months, 'M').isAfter(other)) {
4739--res.months;
4740}
4741res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
4742return res;
4743}
4744function momentsDifference(base, other) {
4745var res;
4746if (!(base.isValid() && other.isValid())) {
4747return {
4748milliseconds: 0,
4749months: 0
4750};
4751}
4752other = cloneWithOffset(other, base);
4753if (base.isBefore(other)) {
4754res = positiveMomentsDifference(base, other);
4755} else {
4756res = positiveMomentsDifference(other, base);
4757res.milliseconds = -res.milliseconds;
4758res.months = -res.months;
4759}
4760return res;
4761}
4762function createAdder(direction, name) {
4763return function(val, period) {
4764var dur, tmp;
4765if (period !== null && !isNaN(+period)) {
4766deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
4767tmp = val;
4768val = period;
4769period = tmp;
4770}
4771val = typeof val === 'string' ? +val : val;
4772dur = createDuration(val, period);
4773addSubtract(this, dur, direction);
4774return this;
4775}
4776;
4777}
4778function addSubtract(mom, duration, isAdding, updateOffset) {
4779var milliseconds = duration._milliseconds
4780  , days = absRound(duration._days)
4781  , months = absRound(duration._months);
4782if (!mom.isValid()) {
4783return;
4784}
4785updateOffset = updateOffset == null ? true : updateOffset;
4786if (milliseconds) {
4787mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
4788}
4789if (days) {
4790set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
4791}
4792if (months) {
4793setMonth(mom, get(mom, 'Month') + months * isAdding);
4794}
4795if (updateOffset) {
4796hooks.updateOffset(mom, days || months);
4797}
4798}
4799var add = createAdder(1, 'add');
4800var subtract = createAdder(-1, 'subtract');
4801function getCalendarFormat(myMoment, now) {
4802var diff = myMoment.diff(now, 'days', true);
4803return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse';
4804}
4805function calendar$1(time, formats) {
4806var now = time || createLocal()
4807  , sod = cloneWithOffset(now, this).startOf('day')
4808  , format = hooks.calendarFormat(this, sod) || 'sameElse';
4809var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
vendor: 26,048 bytes, lines 4810-5668
4810return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
4811}
4812function clone() {
4813return new Moment(this);
4814}
4815function isAfter(input, units) {
4816var localInput = isMoment(input) ? input : createLocal(input);
4817if (!(this.isValid() && localInput.isValid())) {
4818return false;
4819}
4820units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
4821if (units === 'millisecond') {
4822return this.valueOf() > localInput.valueOf();
4823} else {
4824return localInput.valueOf() < this.clone().startOf(units).valueOf();
4825}
4826}
4827function isBefore(input, units) {
4828var localInput = isMoment(input) ? input : createLocal(input);
4829if (!(this.isValid() && localInput.isValid())) {
4830return false;
4831}
4832units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
4833if (units === 'millisecond') {
4834return this.valueOf() < localInput.valueOf();
4835} else {
4836return this.clone().endOf(units).valueOf() < localInput.valueOf();
4837}
4838}
4839function isBetween(from, to, units, inclusivity) {
4840inclusivity = inclusivity || '()';
4841return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) && (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));
4842}
4843function isSame(input, units) {
4844var localInput = isMoment(input) ? input : createLocal(input), inputMs;
4845if (!(this.isValid() && localInput.isValid())) {
4846return false;
4847}
4848units = normalizeUnits(units || 'millisecond');
4849if (units === 'millisecond') {
4850return this.valueOf() === localInput.valueOf();
4851} else {
4852inputMs = localInput.valueOf();
4853return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
4854}
4855}
4856function isSameOrAfter(input, units) {
4857return this.isSame(input, units) || this.isAfter(input, units);
4858}
4859function isSameOrBefore(input, units) {
4860return this.isSame(input, units) || this.isBefore(input, units);
4861}
4862function diff(input, units, asFloat) {
4863var that, zoneDelta, delta, output;
4864if (!this.isValid()) {
4865return NaN;
4866}
4867that = cloneWithOffset(input, this);
4868if (!that.isValid()) {
4869return NaN;
4870}
4871zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
4872units = normalizeUnits(units);
4873if (units === 'year' || units === 'month' || units === 'quarter') {
4874output = monthDiff(this, that);
4875if (units === 'quarter') {
4876output = output / 3;
4877} else if (units === 'year') {
4878output = output / 12;
4879}
4880} else {
4881delta = this - that;
4882output = units === 'second' ? delta / 1e3 : units === 'minute' ? delta / 6e4 : units === 'hour' ? delta / 36e5 : units === 'day' ? (delta - zoneDelta) / 864e5 : units === 'week' ? (delta - zoneDelta) / 6048e5 : delta;
4883}
4884return asFloat ? output : absFloor(output);
4885}
4886function monthDiff(a, b) {
4887var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()), anchor = a.clone().add(wholeMonthDiff, 'months'), anchor2, adjust;
4888if (b - anchor < 0) {
4889anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
4890adjust = (b - anchor) / (anchor - anchor2);
4891} else {
4892anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
4893adjust = (b - anchor) / (anchor2 - anchor);
4894}
4895return -(wholeMonthDiff + adjust) || 0;
4896}
4897hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
4898hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
4899function toString() {
4900return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
4901}
4902function toISOString() {
4903var m = this.clone().utc();
4904if (0 < m.year() && m.year() <= 9999) {
4905if (isFunction(Date.prototype.toISOString)) {
4906return this.toDate().toISOString();
4907} else {
4908return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
4909}
4910} else {
4911return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
4912}
4913}
4914function inspect() {
4915if (!this.isValid()) {
4916return 'moment.invalid(/* ' + this._i + ' */)';
4917}
4918var func = 'moment';
4919var zone = '';
4920if (!this.isLocal()) {
4921func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
4922zone = 'Z';
4923}
4924var prefix = '[' + func + '("]';
4925var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';
4926var datetime = '-MM-DD[T]HH:mm:ss.SSS';
4927var suffix = zone + '[")]';
4928return this.format(prefix + year + datetime + suffix);
4929}
4930function format(inputString) {
4931if (!inputString) {
4932inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
4933}
4934var output = formatMoment(this, inputString);
4935return this.localeData().postformat(output);
4936}
4937function from(time, withoutSuffix) {
4938if (this.isValid() && ((isMoment(time) && time.isValid()) || createLocal(time).isValid())) {
4939return createDuration({
4940to: this,
4941from: time
4942}).locale(this.locale()).humanize(!withoutSuffix);
4943} else {
4944return this.localeData().invalidDate();
4945}
4946}
4947function fromNow(withoutSuffix) {
4948return this.from(createLocal(), withoutSuffix);
4949}
4950function to(time, withoutSuffix) {
4951if (this.isValid() && ((isMoment(time) && time.isValid()) || createLocal(time).isValid())) {
4952return createDuration({
4953from: this,
4954to: time
4955}).locale(this.locale()).humanize(!withoutSuffix);
4956} else {
4957return this.localeData().invalidDate();
4958}
4959}
4960function toNow(withoutSuffix) {
4961return this.to(createLocal(), withoutSuffix);
4962}
4963function locale(key) {
4964var newLocaleData;
4965if (key === undefined) {
4966return this._locale._abbr;
4967} else {
4968newLocaleData = getLocale(key);
4969if (newLocaleData != null) {
4970this._locale = newLocaleData;
4971}
4972return this;
4973}
4974}
4975var lang = deprecate('moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function(key) {
4976if (key === undefined) {
4977return this.localeData();
4978} else {
4979return this.locale(key);
4980}
4981});
4982function localeData() {
4983return this._locale;
4984}
4985function startOf(units) {
4986units = normalizeUnits(units);
4987switch (units) {
4988case 'year':
4989this.month(0);
4990case 'quarter':
4991case 'month':
4992this.date(1);
4993case 'week':
4994case 'isoWeek':
4995case 'day':
4996case 'date':
4997this.hours(0);
4998case 'hour':
4999this.minutes(0);
5000case 'minute':
5001this.seconds(0);
5002case 'second':
5003this.milliseconds(0);
5004}
5005if (units === 'week') {
5006this.weekday(0);
5007}
5008if (units === 'isoWeek') {
5009this.isoWeekday(1);
5010}
5011if (units === 'quarter') {
5012this.month(Math.floor(this.month() / 3) * 3);
5013}
5014return this;
5015}
5016function endOf(units) {
5017units = normalizeUnits(units);
5018if (units === undefined || units === 'millisecond') {
5019return this;
5020}
5021if (units === 'date') {
5022units = 'day';
5023}
5024return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
5025}
5026function valueOf() {
5027return this._d.valueOf() - ((this._offset || 0) * 60000);
5028}
5029function unix() {
5030return Math.floor(this.valueOf() / 1000);
5031}
5032function toDate() {
5033return new Date(this.valueOf());
5034}
5035function toArray() {
5036var m = this;
5037return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
5038}
5039function toObject() {
5040var m = this;
5041return {
5042years: m.year(),
5043months: m.month(),
5044date: m.date(),
5045hours: m.hours(),
5046minutes: m.minutes(),
5047seconds: m.seconds(),
5048milliseconds: m.milliseconds()
5049};
5050}
5051function toJSON() {
5052return this.isValid() ? this.toISOString() : null;
5053}
5054function isValid$1() {
5055return isValid(this);
5056}
5057function parsingFlags() {
5058return extend({}, getParsingFlags(this));
5059}
5060function invalidAt() {
5061return getParsingFlags(this).overflow;
5062}
5063function creationData() {
5064return {
5065input: this._i,
5066format: this._f,
5067locale: this._locale,
5068isUTC: this._isUTC,
5069strict: this._strict
5070};
5071}
5072addFormatToken(0, ['gg', 2], 0, function() {
5073return this.weekYear() % 100;
5074});
5075addFormatToken(0, ['GG', 2], 0, function() {
5076return this.isoWeekYear() % 100;
5077});
5078function addWeekYearFormatToken(token, getter) {
5079addFormatToken(0, [token, token.length], 0, getter);
5080}
5081addWeekYearFormatToken('gggg', 'weekYear');
5082addWeekYearFormatToken('ggggg', 'weekYear');
5083addWeekYearFormatToken('GGGG', 'isoWeekYear');
5084addWeekYearFormatToken('GGGGG', 'isoWeekYear');
5085addUnitAlias('weekYear', 'gg');
5086addUnitAlias('isoWeekYear', 'GG');
5087addUnitPriority('weekYear', 1);
5088addUnitPriority('isoWeekYear', 1);
5089addRegexToken('G', matchSigned);
5090addRegexToken('g', matchSigned);
5091addRegexToken('GG', match1to2, match2);
5092addRegexToken('gg', match1to2, match2);
5093addRegexToken('GGGG', match1to4, match4);
5094addRegexToken('gggg', match1to4, match4);
5095addRegexToken('GGGGG', match1to6, match6);
5096addRegexToken('ggggg', match1to6, match6);
5097addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function(input, week, config, token) {
5098week[token.substr(0, 2)] = toInt(input);
5099});
5100addWeekParseToken(['gg', 'GG'], function(input, week, config, token) {
5101week[token] = hooks.parseTwoDigitYear(input);
5102});
5103function getSetWeekYear(input) {
5104return getSetWeekYearHelper.call(this, input, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy);
5105}
5106function getSetISOWeekYear(input) {
5107return getSetWeekYearHelper.call(this, input, this.isoWeek(), this.isoWeekday(), 1, 4);
5108}
5109function getISOWeeksInYear() {
5110return weeksInYear(this.year(), 1, 4);
5111}
5112function getWeeksInYear() {
5113var weekInfo = this.localeData()._week;
5114return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
5115}
5116function getSetWeekYearHelper(input, week, weekday, dow, doy) {
5117var weeksTarget;
5118if (input == null) {
5119return weekOfYear(this, dow, doy).year;
5120} else {
5121weeksTarget = weeksInYear(input, dow, doy);
5122if (week > weeksTarget) {
5123week = weeksTarget;
5124}
5125return setWeekAll.call(this, input, week, weekday, dow, doy);
5126}
5127}
5128function setWeekAll(weekYear, week, weekday, dow, doy) {
5129var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy)
5130  , date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
5131this.year(date.getUTCFullYear());
5132this.month(date.getUTCMonth());
5133this.date(date.getUTCDate());
5134return this;
5135}
5136addFormatToken('Q', 0, 'Qo', 'quarter');
5137addUnitAlias('quarter', 'Q');
5138addUnitPriority('quarter', 7);
5139addRegexToken('Q', match1);
5140addParseToken('Q', function(input, array) {
5141array[MONTH] = (toInt(input) - 1) * 3;
5142});
5143function getSetQuarter(input) {
5144return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
5145}
5146addFormatToken('D', ['DD', 2], 'Do', 'date');
5147addUnitAlias('date', 'D');
5148addUnitPriority('date', 9);
5149addRegexToken('D', match1to2);
5150addRegexToken('DD', match1to2, match2);
5151addRegexToken('Do', function(isStrict, locale) {
5152return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
5153});
5154addParseToken(['D', 'DD'], DATE);
5155addParseToken('Do', function(input, array) {
5156array[DATE] = toInt(input.match(match1to2)[0], 10);
5157});
5158var getSetDayOfMonth = makeGetSet('Date', true);
5159addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
5160addUnitAlias('dayOfYear', 'DDD');
5161addUnitPriority('dayOfYear', 4);
5162addRegexToken('DDD', match1to3);
5163addRegexToken('DDDD', match3);
5164addParseToken(['DDD', 'DDDD'], function(input, array, config) {
5165config._dayOfYear = toInt(input);
5166});
5167function getSetDayOfYear(input) {
5168var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
5169return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
5170}
5171addFormatToken('m', ['mm', 2], 0, 'minute');
5172addUnitAlias('minute', 'm');
5173addUnitPriority('minute', 14);
5174addRegexToken('m', match1to2);
5175addRegexToken('mm', match1to2, match2);
5176addParseToken(['m', 'mm'], MINUTE);
5177var getSetMinute = makeGetSet('Minutes', false);
5178addFormatToken('s', ['ss', 2], 0, 'second');
5179addUnitAlias('second', 's');
5180addUnitPriority('second', 15);
5181addRegexToken('s', match1to2);
5182addRegexToken('ss', match1to2, match2);
5183addParseToken(['s', 'ss'], SECOND);
5184var getSetSecond = makeGetSet('Seconds', false);
5185addFormatToken('S', 0, 0, function() {
5186return ~~(this.millisecond() / 100);
5187});
5188addFormatToken(0, ['SS', 2], 0, function() {
5189return ~~(this.millisecond() / 10);
5190});
5191addFormatToken(0, ['SSS', 3], 0, 'millisecond');
5192addFormatToken(0, ['SSSS', 4], 0, function() {
5193return this.millisecond() * 10;
5194});
5195addFormatToken(0, ['SSSSS', 5], 0, function() {
5196return this.millisecond() * 100;
5197});
5198addFormatToken(0, ['SSSSSS', 6], 0, function() {
5199return this.millisecond() * 1000;
5200});
5201addFormatToken(0, ['SSSSSSS', 7], 0, function() {
5202return this.millisecond() * 10000;
5203});
5204addFormatToken(0, ['SSSSSSSS', 8], 0, function() {
5205return this.millisecond() * 100000;
5206});
5207addFormatToken(0, ['SSSSSSSSS', 9], 0, function() {
5208return this.millisecond() * 1000000;
5209});
5210addUnitAlias('millisecond', 'ms');
5211addUnitPriority('millisecond', 16);
5212addRegexToken('S', match1to3, match1);
5213addRegexToken('SS', match1to3, match2);
5214addRegexToken('SSS', match1to3, match3);
5215var token;
5216for (token = 'SSSS'; token.length <= 9; token += 'S') {
5217addRegexToken(token, matchUnsigned);
5218}
5219function parseMs(input, array) {
5220array[MILLISECOND] = toInt(('0.' + input) * 1000);
5221}
5222for (token = 'S'; token.length <= 9; token += 'S') {
5223addParseToken(token, parseMs);
5224}
5225var getSetMillisecond = makeGetSet('Milliseconds', false);
5226addFormatToken('z', 0, 0, 'zoneAbbr');
5227addFormatToken('zz', 0, 0, 'zoneName');
5228function getZoneAbbr() {
5229return this._isUTC ? 'UTC' : '';
5230}
5231function getZoneName() {
5232return this._isUTC ? 'Coordinated Universal Time' : '';
5233}
5234var proto = Moment.prototype;
5235proto.add = add;
5236proto.calendar = calendar$1;
5237proto.clone = clone;
5238proto.diff = diff;
5239proto.endOf = endOf;
5240proto.format = format;
5241proto.from = from;
5242proto.fromNow = fromNow;
5243proto.to = to;
5244proto.toNow = toNow;
5245proto.get = stringGet;
5246proto.invalidAt = invalidAt;
5247proto.isAfter = isAfter;
5248proto.isBefore = isBefore;
5249proto.isBetween = isBetween;
5250proto.isSame = isSame;
5251proto.isSameOrAfter = isSameOrAfter;
5252proto.isSameOrBefore = isSameOrBefore;
5253proto.isValid = isValid$1;
5254proto.lang = lang;
5255proto.locale = locale;
5256proto.localeData = localeData;
5257proto.max = prototypeMax;
5258proto.min = prototypeMin;
5259proto.parsingFlags = parsingFlags;
5260proto.set = stringSet;
5261proto.startOf = startOf;
5262proto.subtract = subtract;
5263proto.toArray = toArray;
5264proto.toObject = toObject;
5265proto.toDate = toDate;
5266proto.toISOString = toISOString;
5267proto.inspect = inspect;
5268proto.toJSON = toJSON;
5269proto.toString = toString;
5270proto.unix = unix;
5271proto.valueOf = valueOf;
5272proto.creationData = creationData;
5273proto.year = getSetYear;
5274proto.isLeapYear = getIsLeapYear;
5275proto.weekYear = getSetWeekYear;
5276proto.isoWeekYear = getSetISOWeekYear;
5277proto.quarter = proto.quarters = getSetQuarter;
5278proto.month = getSetMonth;
5279proto.daysInMonth = getDaysInMonth;
5280proto.week = proto.weeks = getSetWeek;
5281proto.isoWeek = proto.isoWeeks = getSetISOWeek;
5282proto.weeksInYear = getWeeksInYear;
5283proto.isoWeeksInYear = getISOWeeksInYear;
5284proto.date = getSetDayOfMonth;
5285proto.day = proto.days = getSetDayOfWeek;
5286proto.weekday = getSetLocaleDayOfWeek;
5287proto.isoWeekday = getSetISODayOfWeek;
5288proto.dayOfYear = getSetDayOfYear;
5289proto.hour = proto.hours = getSetHour;
5290proto.minute = proto.minutes = getSetMinute;
5291proto.second = proto.seconds = getSetSecond;
5292proto.millisecond = proto.milliseconds = getSetMillisecond;
5293proto.utcOffset = getSetOffset;
5294proto.utc = setOffsetToUTC;
5295proto.local = setOffsetToLocal;
5296proto.parseZone = setOffsetToParsedOffset;
5297proto.hasAlignedHourOffset = hasAlignedHourOffset;
5298proto.isDST = isDaylightSavingTime;
5299proto.isLocal = isLocal;
5300proto.isUtcOffset = isUtcOffset;
5301proto.isUtc = isUtc;
5302proto.isUTC = isUtc;
5303proto.zoneAbbr = getZoneAbbr;
5304proto.zoneName = getZoneName;
5305proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
5306proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
5307proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
5308proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
5309proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
5310function createUnix(input) {
5311return createLocal(input * 1000);
5312}
5313function createInZone() {
5314return createLocal.apply(null, arguments).parseZone();
5315}
5316function preParsePostFormat(string) {
5317return string;
5318}
5319var proto$1 = Locale.prototype;
5320proto$1.calendar = calendar;
5321proto$1.longDateFormat = longDateFormat;
5322proto$1.invalidDate = invalidDate;
5323proto$1.ordinal = ordinal;
5324proto$1.preparse = preParsePostFormat;
5325proto$1.postformat = preParsePostFormat;
5326proto$1.relativeTime = relativeTime;
5327proto$1.pastFuture = pastFuture;
5328proto$1.set = set;
5329proto$1.months = localeMonths;
5330proto$1.monthsShort = localeMonthsShort;
5331proto$1.monthsParse = localeMonthsParse;
5332proto$1.monthsRegex = monthsRegex;
5333proto$1.monthsShortRegex = monthsShortRegex;
5334proto$1.week = localeWeek;
5335proto$1.firstDayOfYear = localeFirstDayOfYear;
5336proto$1.firstDayOfWeek = localeFirstDayOfWeek;
5337proto$1.weekdays = localeWeekdays;
5338proto$1.weekdaysMin = localeWeekdaysMin;
5339proto$1.weekdaysShort = localeWeekdaysShort;
5340proto$1.weekdaysParse = localeWeekdaysParse;
5341proto$1.weekdaysRegex = weekdaysRegex;
5342proto$1.weekdaysShortRegex = weekdaysShortRegex;
5343proto$1.weekdaysMinRegex = weekdaysMinRegex;
5344proto$1.isPM = localeIsPM;
5345proto$1.meridiem = localeMeridiem;
5346function get$1(format, index, field, setter) {
5347var locale = getLocale();
5348var utc = createUTC().set(setter, index);
5349return locale[field](utc, format);
5350}
5351function listMonthsImpl(format, index, field) {
5352if (isNumber(format)) {
5353index = format;
5354format = undefined;
5355}
5356format = format || '';
5357if (index != null) {
5358return get$1(format, index, field, 'month');
5359}
5360var i;
5361var out = [];
5362for (i = 0; i < 12; i++) {
5363out[i] = get$1(format, i, field, 'month');
5364}
5365return out;
5366}
5367function listWeekdaysImpl(localeSorted, format, index, field) {
5368if (typeof localeSorted === 'boolean') {
5369if (isNumber(format)) {
5370index = format;
5371format = undefined;
5372}
5373format = format || '';
5374} else {
5375format = localeSorted;
5376index = format;
5377localeSorted = false;
5378if (isNumber(format)) {
5379index = format;
5380format = undefined;
5381}
5382format = format || '';
5383}
5384var locale = getLocale()
5385  , shift = localeSorted ? locale._week.dow : 0;
5386if (index != null) {
5387return get$1(format, (index + shift) % 7, field, 'day');
5388}
5389var i;
5390var out = [];
5391for (i = 0; i < 7; i++) {
5392out[i] = get$1(format, (i + shift) % 7, field, 'day');
5393}
5394return out;
5395}
5396function listMonths(format, index) {
5397return listMonthsImpl(format, index, 'months');
5398}
5399function listMonthsShort(format, index) {
5400return listMonthsImpl(format, index, 'monthsShort');
5401}
5402function listWeekdays(localeSorted, format, index) {
5403return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
5404}
5405function listWeekdaysShort(localeSorted, format, index) {
5406return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
5407}
5408function listWeekdaysMin(localeSorted, format, index) {
5409return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
5410}
5411getSetGlobalLocale('en', {
5412ordinalParse: /\d{1,2}(th|st|nd|rd)/,
5413ordinal: function(number) {
5414var b = number % 10
5415  , output = (toInt(number % 100 / 10) === 1) ? 'th' : (b === 1) ? 'st' : (b === 2) ? 'nd' : (b === 3) ? 'rd' : 'th';
5416return number + output;
5417}
5418});
5419hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
5420hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);
5421var mathAbs = Math.abs;
5422function abs() {
5423var data = this._data;
5424this._milliseconds = mathAbs(this._milliseconds);
5425this._days = mathAbs(this._days);
5426this._months = mathAbs(this._months);
5427data.milliseconds = mathAbs(data.milliseconds);
5428data.seconds = mathAbs(data.seconds);
5429data.minutes = mathAbs(data.minutes);
5430data.hours = mathAbs(data.hours);
5431data.months = mathAbs(data.months);
5432data.years = mathAbs(data.years);
5433return this;
5434}
5435function addSubtract$1(duration, input, value, direction) {
5436var other = createDuration(input, value);
5437duration._milliseconds += direction * other._milliseconds;
5438duration._days += direction * other._days;
5439duration._months += direction * other._months;
5440return duration._bubble();
5441}
5442function add$1(input, value) {
5443return addSubtract$1(this, input, value, 1);
5444}
5445function subtract$1(input, value) {
5446return addSubtract$1(this, input, value, -1);
5447}
5448function absCeil(number) {
5449if (number < 0) {
5450return Math.floor(number);
5451} else {
5452return Math.ceil(number);
5453}
5454}
5455function bubble() {
5456var milliseconds = this._milliseconds;
5457var days = this._days;
5458var months = this._months;
5459var data = this._data;
5460var seconds, minutes, hours, years, monthsFromDays;
5461if (!((milliseconds >= 0 && days >= 0 && months >= 0) || (milliseconds <= 0 && days <= 0 && months <= 0))) {
5462milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
5463days = 0;
5464months = 0;
5465}
5466data.milliseconds = milliseconds % 1000;
5467seconds = absFloor(milliseconds / 1000);
5468data.seconds = seconds % 60;
5469minutes = absFloor(seconds / 60);
5470data.minutes = minutes % 60;
5471hours = absFloor(minutes / 60);
5472data.hours = hours % 24;
5473days += absFloor(hours / 24);
5474monthsFromDays = absFloor(daysToMonths(days));
5475months += monthsFromDays;
5476days -= absCeil(monthsToDays(monthsFromDays));
5477years = absFloor(months / 12);
5478months %= 12;
5479data.days = days;
5480data.months = months;
5481data.years = years;
5482return this;
5483}
5484function daysToMonths(days) {
5485return days * 4800 / 146097;
5486}
5487function monthsToDays(months) {
5488return months * 146097 / 4800;
5489}
5490function as(units) {
5491var days;
5492var months;
5493var milliseconds = this._milliseconds;
5494units = normalizeUnits(units);
5495if (units === 'month' || units === 'year') {
5496days = this._days + milliseconds / 864e5;
5497months = this._months + daysToMonths(days);
5498return units === 'month' ? months : months / 12;
5499} else {
5500days = this._days + Math.round(monthsToDays(this._months));
5501switch (units) {
5502case 'week':
5503return days / 7 + milliseconds / 6048e5;
5504case 'day':
5505return days + milliseconds / 864e5;
5506case 'hour':
5507return days * 24 + milliseconds / 36e5;
5508case 'minute':
5509return days * 1440 + milliseconds / 6e4;
5510case 'second':
5511return days * 86400 + milliseconds / 1000;
5512case 'millisecond':
5513return Math.floor(days * 864e5) + milliseconds;
5514default:
5515throw new Error('Unknown unit ' + units);
5516}
5517}
5518}
5519function valueOf$1() {
5520return (this._milliseconds + this._days * 864e5 + (this._months % 12) * 2592e6 + toInt(this._months / 12) * 31536e6);
5521}
5522function makeAs(alias) {
5523return function() {
5524return this.as(alias);
5525}
5526;
5527}
5528var asMilliseconds = makeAs('ms');
5529var asSeconds = makeAs('s');
5530var asMinutes = makeAs('m');
5531var asHours = makeAs('h');
5532var asDays = makeAs('d');
5533var asWeeks = makeAs('w');
5534var asMonths = makeAs('M');
5535var asYears = makeAs('y');
5536function get$2(units) {
5537units = normalizeUnits(units);
5538return this[units + 's']();
5539}
5540function makeGetter(name) {
5541return function() {
5542return this._data[name];
5543}
5544;
5545}
5546var milliseconds = makeGetter('milliseconds');
5547var seconds = makeGetter('seconds');
5548var minutes = makeGetter('minutes');
5549var hours = makeGetter('hours');
5550var days = makeGetter('days');
5551var months = makeGetter('months');
5552var years = makeGetter('years');
5553function weeks() {
5554return absFloor(this.days() / 7);
5555}
5556var round = Math.round;
5557var thresholds = {
5558s: 45,
5559m: 45,
5560h: 22,
5561d: 26,
5562M: 11
5563};
5564function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
5565return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
5566}
5567function relativeTime$1(posNegDuration, withoutSuffix, locale) {
5568var duration = createDuration(posNegDuration).abs();
5569var seconds = round(duration.as('s'));
5570var minutes = round(duration.as('m'));
5571var hours = round(duration.as('h'));
5572var days = round(duration.as('d'));
5573var months = round(duration.as('M'));
5574var years = round(duration.as('y'));
5575var a = seconds < thresholds.s && ['s', seconds] || minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || days <= 1 && ['d'] || days < thresholds.d && ['dd', days] || months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || years <= 1 && ['y'] || ['yy', years];
5576a[2] = withoutSuffix;
5577a[3] = +posNegDuration > 0;
5578a[4] = locale;
5579return substituteTimeAgo.apply(null, a);
5580}
5581function getSetRelativeTimeRounding(roundingFunction) {
5582if (roundingFunction === undefined) {
5583return round;
5584}
5585if (typeof (roundingFunction) === 'function') {
5586round = roundingFunction;
5587return true;
5588}
5589return false;
5590}
5591function getSetRelativeTimeThreshold(threshold, limit) {
5592if (thresholds[threshold] === undefined) {
5593return false;
5594}
5595if (limit === undefined) {
5596return thresholds[threshold];
5597}
5598thresholds[threshold] = limit;
5599return true;
5600}
5601function humanize(withSuffix) {
5602var locale = this.localeData();
5603var output = relativeTime$1(this, !withSuffix, locale);
5604if (withSuffix) {
5605output = locale.pastFuture(+this, output);
5606}
5607return locale.postformat(output);
5608}
5609var abs$1 = Math.abs;
5610function toISOString$1() {
5611var seconds = abs$1(this._milliseconds) / 1000;
5612var days = abs$1(this._days);
5613var months = abs$1(this._months);
5614var minutes, hours, years;
5615minutes = absFloor(seconds / 60);
5616hours = absFloor(minutes / 60);
5617seconds %= 60;
5618minutes %= 60;
5619years = absFloor(months / 12);
5620months %= 12;
5621var Y = years;
5622var M = months;
5623var D = days;
5624var h = hours;
5625var m = minutes;
5626var s = seconds;
5627var total = this.asSeconds();
5628if (!total) {
5629return 'P0D';
5630}
5631return (total < 0 ? '-' : '') + 'P' + (Y ? Y + 'Y' : '') + (M ? M + 'M' : '') + (D ? D + 'D' : '') + ((h || m || s) ? 'T' : '') + (h ? h + 'H' : '') + (m ? m + 'M' : '') + (s ? s + 'S' : '');
5632}
5633var proto$2 = Duration.prototype;
5634proto$2.abs = abs;
5635proto$2.add = add$1;
5636proto$2.subtract = subtract$1;
5637proto$2.as = as;
5638proto$2.asMilliseconds = asMilliseconds;
5639proto$2.asSeconds = asSeconds;
5640proto$2.asMinutes = asMinutes;
5641proto$2.asHours = asHours;
5642proto$2.asDays = asDays;
5643proto$2.asWeeks = asWeeks;
5644proto$2.asMonths = asMonths;
5645proto$2.asYears = asYears;
5646proto$2.valueOf = valueOf$1;
5647proto$2._bubble = bubble;
5648proto$2.get = get$2;
5649proto$2.milliseconds = milliseconds;
5650proto$2.seconds = seconds;
5651proto$2.minutes = minutes;
5652proto$2.hours = hours;
5653proto$2.days = days;
5654proto$2.weeks = weeks;
5655proto$2.months = months;
5656proto$2.years = years;
5657proto$2.humanize = humanize;
5658proto$2.toISOString = toISOString$1;
5659proto$2.toString = toISOString$1;
5660proto$2.toJSON = toISOString$1;
5661proto$2.locale = locale;
5662proto$2.localeData = localeData;
5663proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
5664proto$2.lang = lang;
5665addFormatToken('X', 0, 0, 'unix');
5666addFormatToken('x', 0, 0, 'valueOf');
5667addRegexToken('x', matchSigned);
5668addRegexToken('X', matchTimestamp);
vendor: 169,791 bytes, lines 5669-11877
5669addParseToken('X', function(input, array, config) {
5670config._d = new Date(parseFloat(input, 10) * 1000);
5671});
5672addParseToken('x', function(input, array, config) {
5673config._d = new Date(toInt(input));
5674});
5675hooks.version = '2.17.1';
5676setHookCallback(createLocal);
5677hooks.fn = proto;
5678hooks.min = min;
5679hooks.max = max;
5680hooks.now = now;
5681hooks.utc = createUTC;
5682hooks.unix = createUnix;
5683hooks.months = listMonths;
5684hooks.isDate = isDate;
5685hooks.locale = getSetGlobalLocale;
5686hooks.invalid = createInvalid;
5687hooks.duration = createDuration;
5688hooks.isMoment = isMoment;
5689hooks.weekdays = listWeekdays;
5690hooks.parseZone = createInZone;
5691hooks.localeData = getLocale;
5692hooks.isDuration = isDuration;
5693hooks.monthsShort = listMonthsShort;
5694hooks.weekdaysMin = listWeekdaysMin;
5695hooks.defineLocale = defineLocale;
5696hooks.updateLocale = updateLocale;
5697hooks.locales = listLocales;
5698hooks.weekdaysShort = listWeekdaysShort;
5699hooks.normalizeUnits = normalizeUnits;
5700hooks.relativeTimeRounding = getSetRelativeTimeRounding;
5701hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
5702hooks.calendarFormat = getCalendarFormat;
5703hooks.prototype = proto;
5704return hooks;
5705}
5706)));
5707;
5708/* /web/static/lib/jquery/jquery.js defined in bundle 'web.assets_common' */
5709(function(global, factory) {
5710if (typeof module === "object" && typeof module.exports === "object") {
5711module.exports = global.document ? factory(global, true) : function(w) {
5712if (!w.document) {
5713throw new Error("jQuery requires a window with a document");
5714}
5715return factory(w);
5716}
5717;
5718} else {
5719factory(global);
5720}
5721}(typeof window !== "undefined" ? window : this, function(window, noGlobal) {
5722var deletedIds = [];
5723var slice = deletedIds.slice;
5724var concat = deletedIds.concat;
5725var push = deletedIds.push;
5726var indexOf = deletedIds.indexOf;
5727var class2type = {};
5728var toString = class2type.toString;
5729var hasOwn = class2type.hasOwnProperty;
5730var support = {};
5731var version = "1.11.1"
5732  , jQuery = function(selector, context) {
5733return new jQuery.fn.init(selector,context);
5734}
5735  , rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g
5736  , rmsPrefix = /^-ms-/
5737  , rdashAlpha = /-([\da-z])/gi
5738  , fcamelCase = function(all, letter) {
5739return letter.toUpperCase();
5740};
5741jQuery.fn = jQuery.prototype = {
5742jquery: version,
5743constructor: jQuery,
5744selector: "",
5745length: 0,
5746toArray: function() {
5747return slice.call(this);
5748},
5749get: function(num) {
5750return num != null ? (num < 0 ? this[num + this.length] : this[num]) : slice.call(this);
5751},
5752pushStack: function(elems) {
5753var ret = jQuery.merge(this.constructor(), elems);
5754ret.prevObject = this;
5755ret.context = this.context;
5756return ret;
5757},
5758each: function(callback, args) {
5759return jQuery.each(this, callback, args);
5760},
5761map: function(callback) {
5762return this.pushStack(jQuery.map(this, function(elem, i) {
5763return callback.call(elem, i, elem);
5764}));
5765},
5766slice: function() {
5767return this.pushStack(slice.apply(this, arguments));
5768},
5769first: function() {
5770return this.eq(0);
5771},
5772last: function() {
5773return this.eq(-1);
5774},
5775eq: function(i) {
5776var len = this.length
5777  , j = +i + (i < 0 ? len : 0);
5778return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
5779},
5780end: function() {
5781return this.prevObject || this.constructor(null);
5782},
5783push: push,
5784sort: deletedIds.sort,
5785splice: deletedIds.splice
5786};
5787jQuery.extend = jQuery.fn.extend = function() {
5788var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false;
5789if (typeof target === "boolean") {
5790deep = target;
5791target = arguments[i] || {};
5792i++;
5793}
5794if (typeof target !== "object" && !jQuery.isFunction(target)) {
5795target = {};
5796}
5797if (i === length) {
5798target = this;
5799i--;
5800}
5801for (; i < length; i++) {
5802if ((options = arguments[i]) != null) {
5803for (name in options) {
5804src = target[name];
5805copy = options[name];
5806if (target === copy) {
5807continue;
5808}
5809if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) {
5810if (copyIsArray) {
5811copyIsArray = false;
5812clone = src && jQuery.isArray(src) ? src : [];
5813} else {
5814clone = src && jQuery.isPlainObject(src) ? src : {};
5815}
5816target[name] = jQuery.extend(deep, clone, copy);
5817} else if (copy !== undefined) {
5818target[name] = copy;
5819}
5820}
5821}
5822}
5823return target;
5824}
5825;
5826jQuery.extend({
5827expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""),
5828isReady: true,
5829error: function(msg) {
5830throw new Error(msg);
5831},
5832noop: function() {},
5833isFunction: function(obj) {
5834return jQuery.type(obj) === "function";
5835},
5836isArray: Array.isArray || function(obj) {
5837return jQuery.type(obj) === "array";
5838}
5839,
5840isWindow: function(obj) {
5841return obj != null && obj == obj.window;
5842},
5843isNumeric: function(obj) {
5844return !jQuery.isArray(obj) && obj - parseFloat(obj) >= 0;
5845},
5846isEmptyObject: function(obj) {
5847var name;
5848for (name in obj) {
5849return false;
5850}
5851return true;
5852},
5853isPlainObject: function(obj) {
5854var key;
5855if (!obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow(obj)) {
5856return false;
5857}
5858try {
5859if (obj.constructor && !hasOwn.call(obj, "constructor") && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
5860return false;
5861}
5862} catch (e) {
5863return false;
5864}
5865if (support.ownLast) {
5866for (key in obj) {
5867return hasOwn.call(obj, key);
5868}
5869}
5870for (key in obj) {}
5871return key === undefined || hasOwn.call(obj, key);
5872},
5873type: function(obj) {
5874if (obj == null) {
5875return obj + "";
5876}
5877return typeof obj === "object" || typeof obj === "function" ? class2type[toString.call(obj)] || "object" : typeof obj;
5878},
5879globalEval: function(data) {
5880if (data && jQuery.trim(data)) {
5881(window.execScript || function(data) {
5882window["eval"].call(window, data);
5883}
5884)(data);
5885}
5886},
5887camelCase: function(string) {
5888return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
5889},
5890nodeName: function(elem, name) {
5891return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
5892},
5893each: function(obj, callback, args) {
5894var value, i = 0, length = obj.length, isArray = isArraylike(obj);
5895if (args) {
5896if (isArray) {
5897for (; i < length; i++) {
5898value = callback.apply(obj[i], args);
5899if (value === false) {
5900break;
5901}
5902}
5903} else {
5904for (i in obj) {
5905value = callback.apply(obj[i], args);
5906if (value === false) {
5907break;
5908}
5909}
5910}
5911} else {
5912if (isArray) {
5913for (; i < length; i++) {
5914value = callback.call(obj[i], i, obj[i]);
5915if (value === false) {
5916break;
5917}
5918}
5919} else {
5920for (i in obj) {
5921value = callback.call(obj[i], i, obj[i]);
5922if (value === false) {
5923break;
5924}
5925}
5926}
5927}
5928return obj;
5929},
5930trim: function(text) {
5931return text == null ? "" : (text + "").replace(rtrim, "");
5932},
5933makeArray: function(arr, results) {
5934var ret = results || [];
5935if (arr != null) {
5936if (isArraylike(Object(arr))) {
5937jQuery.merge(ret, typeof arr === "string" ? [arr] : arr);
5938} else {
5939push.call(ret, arr);
5940}
5941}
5942return ret;
5943},
5944inArray: function(elem, arr, i) {
5945var len;
5946if (arr) {
5947if (indexOf) {
5948return indexOf.call(arr, elem, i);
5949}
5950len = arr.length;
5951i = i ? i < 0 ? Math.max(0, len + i) : i : 0;
5952for (; i < len; i++) {
5953if (i in arr && arr[i] === elem) {
5954return i;
5955}
5956}
5957}
5958return -1;
5959},
5960merge: function(first, second) {
5961var len = +second.length
5962  , j = 0
5963  , i = first.length;
5964while (j < len) {
5965first[i++] = second[j++];
5966}
5967if (len !== len) {
5968while (second[j] !== undefined) {
5969first[i++] = second[j++];
5970}
5971}
5972first.length = i;
5973return first;
5974},
5975grep: function(elems, callback, invert) {
5976var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert;
5977for (; i < length; i++) {
5978callbackInverse = !callback(elems[i], i);
5979if (callbackInverse !== callbackExpect) {
5980matches.push(elems[i]);
5981}
5982}
5983return matches;
5984},
5985map: function(elems, callback, arg) {
5986var value, i = 0, length = elems.length, isArray = isArraylike(elems), ret = [];
5987if (isArray) {
5988for (; i < length; i++) {
5989value = callback(elems[i], i, arg);
5990if (value != null) {
5991ret.push(value);
5992}
5993}
5994} else {
5995for (i in elems) {
5996value = callback(elems[i], i, arg);
5997if (value != null) {
5998ret.push(value);
5999}
6000}
6001}
6002return concat.apply([], ret);
6003},
6004guid: 1,
6005proxy: function(fn, context) {
6006var args, proxy, tmp;
6007if (typeof context === "string") {
6008tmp = fn[context];
6009context = fn;
6010fn = tmp;
6011}
6012if (!jQuery.isFunction(fn)) {
6013return undefined;
6014}
6015args = slice.call(arguments, 2);
6016proxy = function() {
6017return fn.apply(context || this, args.concat(slice.call(arguments)));
6018}
6019;
6020proxy.guid = fn.guid = fn.guid || jQuery.guid++;
6021return proxy;
6022},
6023now: function() {
6024return +(new Date());
6025},
6026support: support
6027});
6028jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
6029class2type["[object " + name + "]"] = name.toLowerCase();
6030});
6031function isArraylike(obj) {
6032var length = obj.length
6033  , type = jQuery.type(obj);
6034if (type === "function" || jQuery.isWindow(obj)) {
6035return false;
6036}
6037if (obj.nodeType === 1 && length) {
6038return true;
6039}
6040return type === "array" || length === 0 || typeof length === "number" && length > 0 && (length - 1)in obj;
6041}
6042var Sizzle = (function(window) {
6043var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, expando = "sizzle" + -(new Date()), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), sortOrder = function(a, b) {
6044if (a === b) {
6045hasDuplicate = true;
6046}
6047return 0;
6048}, strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, indexOf = arr.indexOf || function(elem) {
6049var i = 0
6050  , len = this.length;
6051for (; i < len; i++) {
6052if (this[i] === elem) {
6053return i;
6054}
6055}
6056return -1;
6057}
6058, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", whitespace = "[\\x20\\t\\r\\n\\f]", characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", identifier = characterEncoding.replace("w", "w#"), attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + "*([*^$|!~]?=)" + whitespace + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + characterEncoding + ")(?:\\((" + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + ".*" + ")\\)|)", rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$","g"), rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), rcombinators = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), rattributeQuotes = new RegExp("=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]","g"), rpseudo = new RegExp(pseudos), ridentifier = new RegExp("^" + identifier + "$"), matchExpr = {
6059"ID": new RegExp("^#(" + characterEncoding + ")"),
6060"CLASS": new RegExp("^\\.(" + characterEncoding + ")"),
6061"TAG": new RegExp("^(" + characterEncoding.replace("w", "w*") + ")"),
6062"ATTR": new RegExp("^" + attributes),
6063"PSEUDO": new RegExp("^" + pseudos),
6064"CHILD": new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)","i"),
6065"bool": new RegExp("^(?:" + booleans + ")$","i"),
6066"needsContext": new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)","i")
6067}, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, rescape = /'|\\/g, runescape = new RegExp("\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)","ig"), funescape = function(_, escaped, escapedWhitespace) {
6068var high = "0x" + escaped - 0x10000;
6069return high !== high || escapedWhitespace ? escaped : high < 0 ? String.fromCharCode(high + 0x10000) : String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00);
6070};
6071try {
6072push.apply((arr = slice.call(preferredDoc.childNodes)), preferredDoc.childNodes);
6073arr[preferredDoc.childNodes.length].nodeType;
6074} catch (e) {
6075push = {
6076apply: arr.length ? function(target, els) {
6077push_native.apply(target, slice.call(els));
6078}
6079: function(target, els) {
6080var j = target.length
6081  , i = 0;
6082while ((target[j++] = els[i++])) {}
6083target.length = j - 1;
6084}
6085};
6086}
6087function Sizzle(selector, context, results, seed) {
6088var match, elem, m, nodeType, i, groups, old, nid, newContext, newSelector;
6089if ((context ? context.ownerDocument || context : preferredDoc) !== document) {
6090setDocument(context);
6091}
6092context = context || document;
6093results = results || [];
6094if (!selector || typeof selector !== "string") {
6095return results;
6096}
6097if ((nodeType = context.nodeType) !== 1 && nodeType !== 9) {
6098return [];
6099}
6100if (documentIsHTML && !seed) {
6101if ((match = rquickExpr.exec(selector))) {
6102if ((m = match[1])) {
6103if (nodeType === 9) {
6104elem = context.getElementById(m);
6105if (elem && elem.parentNode) {
6106if (elem.id === m) {
6107results.push(elem);
6108return results;
6109}
6110} else {
6111return results;
6112}
6113} else {
6114if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) && contains(context, elem) && elem.id === m) {
6115results.push(elem);
6116return results;
6117}
6118}
6119} else if (match[2]) {
6120push.apply(results, context.getElementsByTagName(selector));
6121return results;
6122} else if ((m = match[3]) && support.getElementsByClassName && context.getElementsByClassName) {
6123push.apply(results, context.getElementsByClassName(m));
6124return results;
6125}
6126}
6127if (support.qsa && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
6128nid = old = expando;
6129newContext = context;
6130newSelector = nodeType === 9 && selector;
6131if (nodeType === 1 && context.nodeName.toLowerCase() !== "object") {
6132groups = tokenize(selector);
6133if ((old = context.getAttribute("id"))) {
6134nid = old.replace(rescape, "\\$&");
6135} else {
6136context.setAttribute("id", nid);
6137}
6138nid = "[id='" + nid + "'] ";
6139i = groups.length;
6140while (i--) {
6141groups[i] = nid + toSelector(groups[i]);
6142}
6143newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
6144newSelector = groups.join(",");
6145}
6146if (newSelector) {
6147try {
6148push.apply(results, newContext.querySelectorAll(newSelector));
6149return results;
6150} catch (qsaError) {} finally {
6151if (!old) {
6152context.removeAttribute("id");
6153}
6154}
6155}
6156}
6157}
6158return select(selector.replace(rtrim, "$1"), context, results, seed);
6159}
6160function createCache() {
6161var keys = [];
6162function cache(key, value) {
6163if (keys.push(key + " ") > Expr.cacheLength) {
6164delete cache[keys.shift()];
6165}
6166return (cache[key + " "] = value);
6167}
6168return cache;
6169}
6170function markFunction(fn) {
6171fn[expando] = true;
6172return fn;
6173}
6174function assert(fn) {
6175var div = document.createElement("div");
6176try {
6177return !!fn(div);
6178} catch (e) {
6179return false;
6180} finally {
6181if (div.parentNode) {
6182div.parentNode.removeChild(div);
6183}
6184div = null;
6185}
6186}
6187function addHandle(attrs, handler) {
6188var arr = attrs.split("|")
6189  , i = attrs.length;
6190while (i--) {
6191Expr.attrHandle[arr[i]] = handler;
6192}
6193}
6194function siblingCheck(a, b) {
6195var cur = b && a
6196  , diff = cur && a.nodeType === 1 && b.nodeType === 1 && (~b.sourceIndex || MAX_NEGATIVE) - (~a.sourceIndex || MAX_NEGATIVE);
6197if (diff) {
6198return diff;
6199}
6200if (cur) {
6201while ((cur = cur.nextSibling)) {
6202if (cur === b) {
6203return -1;
6204}
6205}
6206}
6207return a ? 1 : -1;
6208}
6209function createInputPseudo(type) {
6210return function(elem) {
6211var name = elem.nodeName.toLowerCase();
6212return name === "input" && elem.type === type;
6213}
6214;
6215}
6216function createButtonPseudo(type) {
6217return function(elem) {
6218var name = elem.nodeName.toLowerCase();
6219return (name === "input" || name === "button") && elem.type === type;
6220}
6221;
6222}
6223function createPositionalPseudo(fn) {
6224return markFunction(function(argument) {
6225argument = +argument;
6226return markFunction(function(seed, matches) {
6227var j, matchIndexes = fn([], seed.length, argument), i = matchIndexes.length;
6228while (i--) {
6229if (seed[(j = matchIndexes[i])]) {
6230seed[j] = !(matches[j] = seed[j]);
6231}
6232}
6233});
6234});
6235}
6236function testContext(context) {
6237return context && typeof context.getElementsByTagName !== strundefined && context;
6238}
6239support = Sizzle.support = {};
6240isXML = Sizzle.isXML = function(elem) {
6241var documentElement = elem && (elem.ownerDocument || elem).documentElement;
6242return documentElement ? documentElement.nodeName !== "HTML" : false;
6243}
6244;
6245setDocument = Sizzle.setDocument = function(node) {
6246var hasCompare, doc = node ? node.ownerDocument || node : preferredDoc, parent = doc.defaultView;
6247if (doc === document || doc.nodeType !== 9 || !doc.documentElement) {
6248return document;
6249}
6250document = doc;
6251docElem = doc.documentElement;
6252documentIsHTML = !isXML(doc);
6253if (parent && parent !== parent.top) {
6254if (parent.addEventListener) {
6255parent.addEventListener("unload", function() {
6256setDocument();
6257}, false);
6258} else if (parent.attachEvent) {
6259parent.attachEvent("onunload", function() {
6260setDocument();
6261});
6262}
6263}
6264support.attributes = assert(function(div) {
6265div.className = "i";
6266return !div.getAttribute("className");
6267});
6268support.getElementsByTagName = assert(function(div) {
6269div.appendChild(doc.createComment(""));
6270return !div.getElementsByTagName("*").length;
6271});
6272support.getElementsByClassName = rnative.test(doc.getElementsByClassName) && assert(function(div) {
6273div.innerHTML = "<div class='a'></div><div class='a i'></div>";
6274div.firstChild.className = "i";
6275return div.getElementsByClassName("i").length === 2;
6276});
6277support.getById = assert(function(div) {
6278docElem.appendChild(div).id = expando;
6279return !doc.getElementsByName || !doc.getElementsByName(expando).length;
6280});
6281if (support.getById) {
6282Expr.find["ID"] = function(id, context) {
6283if (typeof context.getElementById !== strundefined && documentIsHTML) {
6284var m = context.getElementById(id);
6285return m && m.parentNode ? [m] : [];
6286}
6287}
6288;
6289Expr.filter["ID"] = function(id) {
6290var attrId = id.replace(runescape, funescape);
6291return function(elem) {
6292return elem.getAttribute("id") === attrId;
6293}
6294;
6295}
6296;
6297} else {
6298delete Expr.find["ID"];
6299Expr.filter["ID"] = function(id) {
6300var attrId = id.replace(runescape, funescape);
6301return function(elem) {
6302var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
6303return node && node.value === attrId;
6304}
6305;
6306}
6307;
6308}
6309Expr.find["TAG"] = support.getElementsByTagName ? function(tag, context) {
6310if (typeof context.getElementsByTagName !== strundefined) {
6311return context.getElementsByTagName(tag);
6312}
6313}
6314: function(tag, context) {
6315var elem, tmp = [], i = 0, results = context.getElementsByTagName(tag);
6316if (tag === "*") {
6317while ((elem = results[i++])) {
6318if (elem.nodeType === 1) {
6319tmp.push(elem);
6320}
6321}
6322return tmp;
6323}
6324return results;
6325}
6326;
6327Expr.find["CLASS"] = support.getElementsByClassName && function(className, context) {
6328if (typeof context.getElementsByClassName !== strundefined && documentIsHTML) {
6329return context.getElementsByClassName(className);
6330}
6331}
6332;
6333rbuggyMatches = [];
6334rbuggyQSA = [];
6335if ((support.qsa = rnative.test(doc.querySelectorAll))) {
6336assert(function(div) {
6337div.innerHTML = "<select msallowclip=''><option selected=''></option></select>";
6338if (div.querySelectorAll("[msallowclip^='']").length) {
6339rbuggyQSA.push("[*^$]=" + whitespace + "*(?:''|\"\")");
6340}
6341if (!div.querySelectorAll("[selected]").length) {
6342rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")");
6343}
6344if (!div.querySelectorAll(":checked").length) {
6345rbuggyQSA.push(":checked");
6346}
6347});
6348assert(function(div) {
6349var input = doc.createElement("input");
6350input.setAttribute("type", "hidden");
6351div.appendChild(input).setAttribute("name", "D");
6352if (div.querySelectorAll("[name=d]").length) {
6353rbuggyQSA.push("name" + whitespace + "*[*^$|!~]?=");
6354}
6355if (!div.querySelectorAll(":enabled").length) {
6356rbuggyQSA.push(":enabled", ":disabled");
6357}
6358div.querySelectorAll("*,:x");
6359rbuggyQSA.push(",.*:");
6360});
6361}
6362if ((support.matchesSelector = rnative.test((matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector)))) {
6363assert(function(div) {
6364support.disconnectedMatch = matches.call(div, "div");
6365matches.call(div, "[s!='']:x");
6366rbuggyMatches.push("!=", pseudos);
6367});
6368}
6369rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
6370rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|"));
6371hasCompare = rnative.test(docElem.compareDocumentPosition);
6372contains = hasCompare || rnative.test(docElem.contains) ? function(a, b) {
6373var adown = a.nodeType === 9 ? a.documentElement : a
6374  , bup = b && b.parentNode;
6375return a === bup || !!(bup && bup.nodeType === 1 && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));
6376}
6377: function(a, b) {
6378if (b) {
6379while ((b = b.parentNode)) {
6380if (b === a) {
6381return true;
6382}
6383}
6384}
6385return false;
6386}
6387;
6388sortOrder = hasCompare ? function(a, b) {
6389if (a === b) {
6390hasDuplicate = true;
6391return 0;
6392}
6393var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
6394if (compare) {
6395return compare;
6396}
6397compare = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1;
6398if (compare & 1 || (!support.sortDetached && b.compareDocumentPosition(a) === compare)) {
6399if (a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a)) {
6400return -1;
6401}
6402if (b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b)) {
6403return 1;
6404}
6405return sortInput ? (indexOf.call(sortInput, a) - indexOf.call(sortInput, b)) : 0;
6406}
6407return compare & 4 ? -1 : 1;
6408}
6409: function(a, b) {
6410if (a === b) {
6411hasDuplicate = true;
6412return 0;
6413}
6414var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [a], bp = [b];
6415if (!aup || !bup) {
6416return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? (indexOf.call(sortInput, a) - indexOf.call(sortInput, b)) : 0;
6417} else if (aup === bup) {
6418return siblingCheck(a, b);
6419}
6420cur = a;
6421while ((cur = cur.parentNode)) {
6422ap.unshift(cur);
6423}
6424cur = b;
6425while ((cur = cur.parentNode)) {
6426bp.unshift(cur);
6427}
6428while (ap[i] === bp[i]) {
6429i++;
6430}
6431return i ? siblingCheck(ap[i], bp[i]) : ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0;
6432}
6433;
6434return doc;
6435}
6436;
6437Sizzle.matches = function(expr, elements) {
6438return Sizzle(expr, null, null, elements);
6439}
6440;
6441Sizzle.matchesSelector = function(elem, expr) {
6442if ((elem.ownerDocument || elem) !== document) {
6443setDocument(elem);
6444}
6445expr = expr.replace(rattributeQuotes, "='$1']");
6446if (support.matchesSelector && documentIsHTML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
6447try {
6448var ret = matches.call(elem, expr);
6449if (ret || support.disconnectedMatch || elem.document && elem.document.nodeType !== 11) {
6450return ret;
6451}
6452} catch (e) {}
6453}
6454return Sizzle(expr, document, null, [elem]).length > 0;
6455}
6456;
6457Sizzle.contains = function(context, elem) {
6458if ((context.ownerDocument || context) !== document) {
6459setDocument(context);
6460}
6461return contains(context, elem);
6462}
6463;
6464Sizzle.attr = function(elem, name) {
6465if ((elem.ownerDocument || elem) !== document) {
6466setDocument(elem);
6467}
6468var fn = Expr.attrHandle[name.toLowerCase()]
6469  , val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : undefined;
6470return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null;
6471}
6472;
6473Sizzle.error = function(msg) {
6474throw new Error("Syntax error, unrecognized expression: " + msg);
6475}
6476;
6477Sizzle.uniqueSort = function(results) {
6478var elem, duplicates = [], j = 0, i = 0;
6479hasDuplicate = !support.detectDuplicates;
6480sortInput = !support.sortStable && results.slice(0);
6481results.sort(sortOrder);
6482if (hasDuplicate) {
6483while ((elem = results[i++])) {
6484if (elem === results[i]) {
6485j = duplicates.push(i);
6486}
6487}
6488while (j--) {
6489results.splice(duplicates[j], 1);
6490}
6491}
6492sortInput = null;
6493return results;
6494}
6495;
6496getText = Sizzle.getText = function(elem) {
6497var node, ret = "", i = 0, nodeType = elem.nodeType;
6498if (!nodeType) {
6499while ((node = elem[i++])) {
6500ret += getText(node);
6501}
6502} else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
6503if (typeof elem.textContent === "string") {
6504return elem.textContent;
6505} else {
6506for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
6507ret += getText(elem);
6508}
6509}
6510} else if (nodeType === 3 || nodeType === 4) {
6511return elem.nodeValue;
6512}
6513return ret;
6514}
6515;
6516Expr = Sizzle.selectors = {
6517cacheLength: 50,
6518createPseudo: markFunction,
6519match: matchExpr,
6520attrHandle: {},
6521find: {},
6522relative: {
6523">": {
6524dir: "parentNode",
6525first: true
6526},
6527" ": {
6528dir: "parentNode"
6529},
6530"+": {
6531dir: "previousSibling",
6532first: true
6533},
6534"~": {
6535dir: "previousSibling"
6536}
6537},
6538preFilter: {
6539"ATTR": function(match) {
6540match[1] = match[1].replace(runescape, funescape);
6541match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape);
6542if (match[2] === "~=") {
6543match[3] = " " + match[3] + " ";
6544}
6545return match.slice(0, 4);
6546},
6547"CHILD": function(match) {
6548match[1] = match[1].toLowerCase();
6549if (match[1].slice(0, 3) === "nth") {
6550if (!match[3]) {
6551Sizzle.error(match[0]);
6552}
6553match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
6554match[5] = +((match[7] + match[8]) || match[3] === "odd");
6555} else if (match[3]) {
6556Sizzle.error(match[0]);
6557}
6558return match;
6559},
6560"PSEUDO": function(match) {
6561var excess, unquoted = !match[6] && match[2];
6562if (matchExpr["CHILD"].test(match[0])) {
6563return null;
6564}
6565if (match[3]) {
6566match[2] = match[4] || match[5] || "";
6567} else if (unquoted && rpseudo.test(unquoted) && (excess = tokenize(unquoted, true)) && (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
6568match[0] = match[0].slice(0, excess);
6569match[2] = unquoted.slice(0, excess);
6570}
6571return match.slice(0, 3);
6572}
6573},
6574filter: {
6575"TAG": function(nodeNameSelector) {
6576var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
6577return nodeNameSelector === "*" ? function() {
6578return true;
6579}
6580: function(elem) {
6581return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
6582}
6583;
6584},
6585"CLASS": function(className) {
6586var pattern = classCache[className + " "];
6587return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function(elem) {
6588return pattern.test(typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "");
6589});
6590},
6591"ATTR": function(name, operator, check) {
6592return function(elem) {
6593var result = Sizzle.attr(elem, name);
6594if (result == null) {
6595return operator === "!=";
6596}
6597if (!operator) {
6598return true;
6599}
6600result += "";
6601return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf(check) === 0 : operator === "*=" ? check && result.indexOf(check) > -1 : operator === "$=" ? check && result.slice(-check.length) === check : operator === "~=" ? (" " + result + " ").indexOf(check) > -1 : operator === "|=" ? result === check || result.slice(0, check.length + 1) === check + "-" : false;
6602}
6603;
6604},
6605"CHILD": function(type, what, argument, first, last) {
6606var simple = type.slice(0, 3) !== "nth"
6607  , forward = type.slice(-4) !== "last"
6608  , ofType = what === "of-type";
6609return first === 1 && last === 0 ? function(elem) {
6610return !!elem.parentNode;
6611}
6612: function(elem, context, xml) {
6613var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType;
6614if (parent) {
6615if (simple) {
6616while (dir) {
6617node = elem;
6618while ((node = node[dir])) {
6619if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) {
6620return false;
6621}
6622}
6623start = dir = type === "only" && !start && "nextSibling";
6624}
6625return true;
6626}
6627start = [forward ? parent.firstChild : parent.lastChild];
6628if (forward && useCache) {
6629outerCache = parent[expando] || (parent[expando] = {});
6630cache = outerCache[type] || [];
6631nodeIndex = cache[0] === dirruns && cache[1];
6632diff = cache[0] === dirruns && cache[2];
6633node = nodeIndex && parent.childNodes[nodeIndex];
6634while ((node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop())) {
6635if (node.nodeType === 1 && ++diff && node === elem) {
6636outerCache[type] = [dirruns, nodeIndex, diff];
6637break;
6638}
6639}
6640} else if (useCache && (cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns) {
6641diff = cache[1];
6642} else {
6643while ((node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop())) {
6644if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) {
6645if (useCache) {
6646(node[expando] || (node[expando] = {}))[type] = [dirruns, diff];
6647}
6648if (node === elem) {
6649break;
6650}
6651}
6652}
6653}
6654diff -= last;
6655return diff === first || (diff % first === 0 && diff / first >= 0);
6656}
6657}
6658;
6659},
6660"PSEUDO": function(pseudo, argument) {
6661var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error("unsupported pseudo: " + pseudo);
6662if (fn[expando]) {
6663return fn(argument);
6664}
6665if (fn.length > 1) {
6666args = [pseudo, pseudo, "", argument];
6667return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(seed, matches) {
6668var idx, matched = fn(seed, argument), i = matched.length;
6669while (i--) {
6670idx = indexOf.call(seed, matched[i]);
6671seed[idx] = !(matches[idx] = matched[i]);
6672}
6673}) : function(elem) {
6674return fn(elem, 0, args);
6675}
6676;
6677}
6678return fn;
6679}
6680},
6681pseudos: {
6682"not": markFunction(function(selector) {
6683var input = []
6684  , results = []
6685  , matcher = compile(selector.replace(rtrim, "$1"));
6686return matcher[expando] ? markFunction(function(seed, matches, context, xml) {
6687var elem, unmatched = matcher(seed, null, xml, []), i = seed.length;
6688while (i--) {
6689if ((elem = unmatched[i])) {
6690seed[i] = !(matches[i] = elem);
6691}
6692}
6693}) : function(elem, context, xml) {
6694input[0] = elem;
6695matcher(input, null, xml, results);
6696return !results.pop();
6697}
6698;
6699}),
6700"has": markFunction(function(selector) {
6701return function(elem) {
6702return Sizzle(selector, elem).length > 0;
6703}
6704;
6705}),
6706"contains": markFunction(function(text) {
6707return function(elem) {
6708return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1;
6709}
6710;
6711}),
6712"lang": markFunction(function(lang) {
6713if (!ridentifier.test(lang || "")) {
6714Sizzle.error("unsupported lang: " + lang);
6715}
6716lang = lang.replace(runescape, funescape).toLowerCase();
6717return function(elem) {
6718var elemLang;
6719do {
6720if ((elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang"))) {
6721elemLang = elemLang.toLowerCase();
6722return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
6723}
6724} while ((elem = elem.parentNode) && elem.nodeType === 1);return false;
6725}
6726;
6727}),
6728"target": function(elem) {
6729var hash = window.location && window.location.hash;
6730return hash && hash.slice(1) === elem.id;
6731},
6732"root": function(elem) {
6733return elem === docElem;
6734},
6735"focus": function(elem) {
6736return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
6737},
6738"enabled": function(elem) {
6739return elem.disabled === false;
6740},
6741"disabled": function(elem) {
6742return elem.disabled === true;
6743},
6744"checked": function(elem) {
6745var nodeName = elem.nodeName.toLowerCase();
6746return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
6747},
6748"selected": function(elem) {
6749if (elem.parentNode) {
6750elem.parentNode.selectedIndex;
6751}
6752return elem.selected === true;
6753},
6754"empty": function(elem) {
6755for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
6756if (elem.nodeType < 6) {
6757return false;
6758}
6759}
6760return true;
6761},
6762"parent": function(elem) {
6763return !Expr.pseudos["empty"](elem);
6764},
6765"header": function(elem) {
6766return rheader.test(elem.nodeName);
6767},
6768"input": function(elem) {
6769return rinputs.test(elem.nodeName);
6770},
6771"button": function(elem) {
6772var name = elem.nodeName.toLowerCase();
6773return name === "input" && elem.type === "button" || name === "button";
6774},
6775"text": function(elem) {
6776var attr;
6777return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text");
6778},
6779"first": createPositionalPseudo(function() {
6780return [0];
6781}),
6782"last": createPositionalPseudo(function(matchIndexes, length) {
6783return [length - 1];
6784}),
6785"eq": createPositionalPseudo(function(matchIndexes, length, argument) {
6786return [argument < 0 ? argument + length : argument];
6787}),
6788"even": createPositionalPseudo(function(matchIndexes, length) {
6789var i = 0;
6790for (; i < length; i += 2) {
6791matchIndexes.push(i);
6792}
6793return matchIndexes;
6794}),
6795"odd": createPositionalPseudo(function(matchIndexes, length) {
6796var i = 1;
6797for (; i < length; i += 2) {
6798matchIndexes.push(i);
6799}
6800return matchIndexes;
6801}),
6802"lt": createPositionalPseudo(function(matchIndexes, length, argument) {
6803var i = argument < 0 ? argument + length : argument;
6804for (; --i >= 0; ) {
6805matchIndexes.push(i);
6806}
6807return matchIndexes;
6808}),
6809"gt": createPositionalPseudo(function(matchIndexes, length, argument) {
6810var i = argument < 0 ? argument + length : argument;
6811for (; ++i < length; ) {
6812matchIndexes.push(i);
6813}
6814return matchIndexes;
6815})
6816}
6817};
6818Expr.pseudos["nth"] = Expr.pseudos["eq"];
6819for (i in {
6820radio: true,
6821checkbox: true,
6822file: true,
6823password: true,
6824image: true
6825}) {
6826Expr.pseudos[i] = createInputPseudo(i);
6827}
6828for (i in {
6829submit: true,
6830reset: true
6831}) {
6832Expr.pseudos[i] = createButtonPseudo(i);
6833}
6834function setFilters() {}
6835setFilters.prototype = Expr.filters = Expr.pseudos;
6836Expr.setFilters = new setFilters();
6837tokenize = Sizzle.tokenize = function(selector, parseOnly) {
6838var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + " "];
6839if (cached) {
6840return parseOnly ? 0 : cached.slice(0);
6841}
6842soFar = selector;
6843groups = [];
6844preFilters = Expr.preFilter;
6845while (soFar) {
6846if (!matched || (match = rcomma.exec(soFar))) {
6847if (match) {
6848soFar = soFar.slice(match[0].length) || soFar;
6849}
6850groups.push((tokens = []));
6851}
6852matched = false;
6853if ((match = rcombinators.exec(soFar))) {
6854matched = match.shift();
6855tokens.push({
6856value: matched,
6857type: match[0].replace(rtrim, " ")
6858});
6859soFar = soFar.slice(matched.length);
6860}
6861for (type in Expr.filter) {
6862if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) {
6863matched = match.shift();
6864tokens.push({
6865value: matched,
6866type: type,
6867matches: match
6868});
6869soFar = soFar.slice(matched.length);
6870}
6871}
6872if (!matched) {
6873break;
6874}
6875}
6876return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : tokenCache(selector, groups).slice(0);
6877}
6878;
6879function toSelector(tokens) {
6880var i = 0
6881  , len = tokens.length
6882  , selector = "";
6883for (; i < len; i++) {
6884selector += tokens[i].value;
6885}
6886return selector;
6887}
6888function addCombinator(matcher, combinator, base) {
6889var dir = combinator.dir
6890  , checkNonElements = base && dir === "parentNode"
6891  , doneName = done++;
6892return combinator.first ? function(elem, context, xml) {
6893while ((elem = elem[dir])) {
6894if (elem.nodeType === 1 || checkNonElements) {
6895return matcher(elem, context, xml);
6896}
6897}
6898}
6899: function(elem, context, xml) {
6900var oldCache, outerCache, newCache = [dirruns, doneName];
6901if (xml) {
6902while ((elem = elem[dir])) {
6903if (elem.nodeType === 1 || checkNonElements) {
6904if (matcher(elem, context, xml)) {
6905return true;
6906}
6907}
6908}
6909} else {
6910while ((elem = elem[dir])) {
6911if (elem.nodeType === 1 || checkNonElements) {
6912outerCache = elem[expando] || (elem[expando] = {});
6913if ((oldCache = outerCache[dir]) && oldCache[0] === dirruns && oldCache[1] === doneName) {
6914return (newCache[2] = oldCache[2]);
6915} else {
6916outerCache[dir] = newCache;
6917if ((newCache[2] = matcher(elem, context, xml))) {
6918return true;
6919}
6920}
6921}
6922}
6923}
6924}
6925;
6926}
6927function elementMatcher(matchers) {
6928return matchers.length > 1 ? function(elem, context, xml) {
6929var i = matchers.length;
6930while (i--) {
6931if (!matchers[i](elem, context, xml)) {
6932return false;
6933}
6934}
6935return true;
6936}
6937: matchers[0];
6938}
6939function multipleContexts(selector, contexts, results) {
6940var i = 0
6941  , len = contexts.length;
6942for (; i < len; i++) {
6943Sizzle(selector, contexts[i], results);
6944}
6945return results;
6946}
6947function condense(unmatched, map, filter, context, xml) {
6948var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null;
6949for (; i < len; i++) {
6950if ((elem = unmatched[i])) {
6951if (!filter || filter(elem, context, xml)) {
6952newUnmatched.push(elem);
6953if (mapped) {
6954map.push(i);
6955}
6956}
6957}
6958}
6959return newUnmatched;
6960}
6961function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
6962if (postFilter && !postFilter[expando]) {
6963postFilter = setMatcher(postFilter);
6964}
6965if (postFinder && !postFinder[expando]) {
6966postFinder = setMatcher(postFinder, postSelector);
6967}
6968return markFunction(function(seed, results, context, xml) {
6969var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems, matcherOut = matcher ? postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results : matcherIn;
6970if (matcher) {
6971matcher(matcherIn, matcherOut, context, xml);
6972}
6973if (postFilter) {
6974temp = condense(matcherOut, postMap);
6975postFilter(temp, [], context, xml);
6976i = temp.length;
6977while (i--) {
6978if ((elem = temp[i])) {
6979matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);
6980}
6981}
6982}
6983if (seed) {
6984if (postFinder || preFilter) {
6985if (postFinder) {
6986temp = [];
6987i = matcherOut.length;
6988while (i--) {
6989if ((elem = matcherOut[i])) {
6990temp.push((matcherIn[i] = elem));
6991}
6992}
6993postFinder(null, (matcherOut = []), temp, xml);
6994}
6995i = matcherOut.length;
6996while (i--) {
6997if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i]) > -1) {
6998seed[temp] = !(results[temp] = elem);
6999}
7000}
7001}
7002} else {
7003matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut);
7004if (postFinder) {
7005postFinder(null, results, matcherOut, xml);
7006} else {
7007push.apply(results, matcherOut);
7008}
7009}
7010});
7011}
7012function matcherFromTokens(tokens) {
7013var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, matchContext = addCombinator(function(elem) {
7014return elem === checkContext;
7015}, implicitRelative, true), matchAnyContext = addCombinator(function(elem) {
7016return indexOf.call(checkContext, elem) > -1;
7017}, implicitRelative, true), matchers = [function(elem, context, xml) {
7018return (!leadingRelative && (xml || context !== outermostContext)) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));
7019}
7020];
7021for (; i < len; i++) {
7022if ((matcher = Expr.relative[tokens[i].type])) {
7023matchers = [addCombinator(elementMatcher(matchers), matcher)];
7024} else {
7025matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches);
7026if (matcher[expando]) {
7027j = ++i;
7028for (; j < len; j++) {
7029if (Expr.relative[tokens[j].type]) {
7030break;
7031}
7032}
7033return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector(tokens.slice(0, i - 1).concat({
7034value: tokens[i - 2].type === " " ? "*" : ""
7035})).replace(rtrim, "$1"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens((tokens = tokens.slice(j))), j < len && toSelector(tokens));
7036}
7037matchers.push(matcher);
7038}
7039}
7040return elementMatcher(matchers);
7041}
7042function matcherFromGroupMatchers(elementMatchers, setMatchers) {
7043var bySet = setMatchers.length > 0
7044  , byElement = elementMatchers.length > 0
7045  , superMatcher = function(seed, context, xml, results, outermost) {
7046var elem, j, matcher, matchedCount = 0, i = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && Expr.find["TAG"]("*", outermost), dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), len = elems.length;
7047if (outermost) {
7048outermostContext = context !== document && context;
7049}
7050for (; i !== len && (elem = elems[i]) != null; i++) {
7051if (byElement && elem) {
7052j = 0;
7053while ((matcher = elementMatchers[j++])) {
7054if (matcher(elem, context, xml)) {
7055results.push(elem);
7056break;
7057}
7058}
7059if (outermost) {
7060dirruns = dirrunsUnique;
7061}
7062}
7063if (bySet) {
7064if ((elem = !matcher && elem)) {
7065matchedCount--;
7066}
7067if (seed) {
7068unmatched.push(elem);
7069}
7070}
7071}
7072matchedCount += i;
7073if (bySet && i !== matchedCount) {
7074j = 0;
7075while ((matcher = setMatchers[j++])) {
7076matcher(unmatched, setMatched, context, xml);
7077}
7078if (seed) {
7079if (matchedCount > 0) {
7080while (i--) {
7081if (!(unmatched[i] || setMatched[i])) {
7082setMatched[i] = pop.call(results);
7083}
7084}
7085}
7086setMatched = condense(setMatched);
7087}
7088push.apply(results, setMatched);
7089if (outermost && !seed && setMatched.length > 0 && (matchedCount + setMatchers.length) > 1) {
7090Sizzle.uniqueSort(results);
7091}
7092}
7093if (outermost) {
7094dirruns = dirrunsUnique;
7095outermostContext = contextBackup;
7096}
7097return unmatched;
7098};
7099return bySet ? markFunction(superMatcher) : superMatcher;
7100}
7101compile = Sizzle.compile = function(selector, match) {
7102var i, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + " "];
7103if (!cached) {
7104if (!match) {
7105match = tokenize(selector);
7106}
7107i = match.length;
7108while (i--) {
7109cached = matcherFromTokens(match[i]);
7110if (cached[expando]) {
7111setMatchers.push(cached);
7112} else {
7113elementMatchers.push(cached);
7114}
7115}
7116cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));
7117cached.selector = selector;
7118}
7119return cached;
7120}
7121;
7122select = Sizzle.select = function(selector, context, results, seed) {
7123var i, tokens, token, type, find, compiled = typeof selector === "function" && selector, match = !seed && tokenize((selector = compiled.selector || selector));
7124results = results || [];
7125if (match.length === 1) {
7126tokens = match[0] = match[0].slice(0);
7127if (tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {
7128context = (Expr.find["ID"](token.matches[0].replace(runescape, funescape), context) || [])[0];
7129if (!context) {
7130return results;
7131} else if (compiled) {
7132context = context.parentNode;
7133}
7134selector = selector.slice(tokens.shift().value.length);
7135}
7136i = matchExpr["needsContext"].test(selector) ? 0 : tokens.length;
7137while (i--) {
7138token = tokens[i];
7139if (Expr.relative[(type = token.type)]) {
7140break;
7141}
7142if ((find = Expr.find[type])) {
7143if ((seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testContext(context.parentNode) || context))) {
7144tokens.splice(i, 1);
7145selector = seed.length && toSelector(tokens);
7146if (!selector) {
7147push.apply(results, seed);
7148return results;
7149}
7150break;
7151}
7152}
7153}
7154}
7155(compiled || compile(selector, match))(seed, context, !documentIsHTML, results, rsibling.test(selector) && testContext(context.parentNode) || context);
7156return results;
7157}
7158;
7159support.sortStable = expando.split("").sort(sortOrder).join("") === expando;
7160support.detectDuplicates = !!hasDuplicate;
7161setDocument();
7162support.sortDetached = assert(function(div1) {
7163return div1.compareDocumentPosition(document.createElement("div")) & 1;
7164});
7165if (!assert(function(div) {
7166div.innerHTML = "<a href='#'></a>";
7167return div.firstChild.getAttribute("href") === "#";
7168})) {
7169addHandle("type|href|height|width", function(elem, name, isXML) {
7170if (!isXML) {
7171return elem.getAttribute(name, name.toLowerCase() === "type" ? 1 : 2);
7172}
7173});
7174}
7175if (!support.attributes || !assert(function(div) {
7176div.innerHTML = "<input/>";
7177div.firstChild.setAttribute("value", "");
7178return div.firstChild.getAttribute("value") === "";
7179})) {
7180addHandle("value", function(elem, name, isXML) {
7181if (!isXML && elem.nodeName.toLowerCase() === "input") {
7182return elem.defaultValue;
7183}
7184});
7185}
7186if (!assert(function(div) {
7187return div.getAttribute("disabled") == null;
7188})) {
7189addHandle(booleans, function(elem, name, isXML) {
7190var val;
7191if (!isXML) {
7192return elem[name] === true ? name.toLowerCase() : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null;
7193}
7194});
7195}
7196return Sizzle;
7197}
7198)(window);
7199jQuery.find = Sizzle;
7200jQuery.expr = Sizzle.selectors;
7201jQuery.expr[":"] = jQuery.expr.pseudos;
7202jQuery.unique = Sizzle.uniqueSort;
7203jQuery.text = Sizzle.getText;
7204jQuery.isXMLDoc = Sizzle.isXML;
7205jQuery.contains = Sizzle.contains;
7206var rneedsContext = jQuery.expr.match.needsContext;
7207var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
7208var risSimple = /^.[^:#\[\.,]*$/;
7209function winnow(elements, qualifier, not) {
7210if (jQuery.isFunction(qualifier)) {
7211return jQuery.grep(elements, function(elem, i) {
7212return !!qualifier.call(elem, i, elem) !== not;
7213});
7214}
7215if (qualifier.nodeType) {
7216return jQuery.grep(elements, function(elem) {
7217return (elem === qualifier) !== not;
7218});
7219}
7220if (typeof qualifier === "string") {
7221if (risSimple.test(qualifier)) {
7222return jQuery.filter(qualifier, elements, not);
7223}
7224qualifier = jQuery.filter(qualifier, elements);
7225}
7226return jQuery.grep(elements, function(elem) {
7227return (jQuery.inArray(elem, qualifier) >= 0) !== not;
7228});
7229}
7230jQuery.filter = function(expr, elems, not) {
7231var elem = elems[0];
7232if (not) {
7233expr = ":not(" + expr + ")";
7234}
7235return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector(elem, expr) ? [elem] : [] : jQuery.find.matches(expr, jQuery.grep(elems, function(elem) {
7236return elem.nodeType === 1;
7237}));
7238}
7239;
7240jQuery.fn.extend({
7241find: function(selector) {
7242var i, ret = [], self = this, len = self.length;
7243if (typeof selector !== "string") {
7244return this.pushStack(jQuery(selector).filter(function() {
7245for (i = 0; i < len; i++) {
7246if (jQuery.contains(self[i], this)) {
7247return true;
7248}
7249}
7250}));
7251}
7252for (i = 0; i < len; i++) {
7253jQuery.find(selector, self[i], ret);
7254}
7255ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret);
7256ret.selector = this.selector ? this.selector + " " + selector : selector;
7257return ret;
7258},
7259filter: function(selector) {
7260return this.pushStack(winnow(this, selector || [], false));
7261},
7262not: function(selector) {
7263return this.pushStack(winnow(this, selector || [], true));
7264},
7265is: function(selector) {
7266return !!winnow(this, typeof selector === "string" && rneedsContext.test(selector) ? jQuery(selector) : selector || [], false).length;
7267}
7268});
7269var rootjQuery, document = window.document, rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, init = jQuery.fn.init = function(selector, context) {
7270var match, elem;
7271if (!selector) {
7272return this;
7273}
7274if (typeof selector === "string") {
7275if (selector.charAt(0) === "<" && selector.charAt(selector.length - 1) === ">" && selector.length >= 3) {
7276match = [null, selector, null];
7277} else {
7278match = rquickExpr.exec(selector);
7279}
7280if (match && (match[1] || !context)) {
7281if (match[1]) {
7282context = context instanceof jQuery ? context[0] : context;
7283jQuery.merge(this, jQuery.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : document, true));
7284if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
7285for (match in context) {
7286if (jQuery.isFunction(this[match])) {
7287this[match](context[match]);
7288} else {
7289this.attr(match, context[match]);
7290}
7291}
7292}
7293return this;
7294} else {
7295elem = document.getElementById(match[2]);
7296if (elem && elem.parentNode) {
7297if (elem.id !== match[2]) {
7298return rootjQuery.find(selector);
7299}
7300this.length = 1;
7301this[0] = elem;
7302}
7303this.context = document;
7304this.selector = selector;
7305return this;
7306}
7307} else if (!context || context.jquery) {
7308return (context || rootjQuery).find(selector);
7309} else {
7310return this.constructor(context).find(selector);
7311}
7312} else if (selector.nodeType) {
7313this.context = this[0] = selector;
7314this.length = 1;
7315return this;
7316} else if (jQuery.isFunction(selector)) {
7317return typeof rootjQuery.ready !== "undefined" ? rootjQuery.ready(selector) : selector(jQuery);
7318}
7319if (selector.selector !== undefined) {
7320this.selector = selector.selector;
7321this.context = selector.context;
7322}
7323return jQuery.makeArray(selector, this);
7324}
7325;
7326init.prototype = jQuery.fn;
7327rootjQuery = jQuery(document);
7328var rparentsprev = /^(?:parents|prev(?:Until|All))/
7329  , guaranteedUnique = {
7330children: true,
7331contents: true,
7332next: true,
7333prev: true
7334};
7335jQuery.extend({
7336dir: function(elem, dir, until) {
7337var matched = []
7338  , cur = elem[dir];
7339while (cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery(cur).is(until))) {
7340if (cur.nodeType === 1) {
7341matched.push(cur);
7342}
7343cur = cur[dir];
7344}
7345return matched;
7346},
7347sibling: function(n, elem) {
7348var r = [];
7349for (; n; n = n.nextSibling) {
7350if (n.nodeType === 1 && n !== elem) {
7351r.push(n);
7352}
7353}
7354return r;
7355}
7356});
7357jQuery.fn.extend({
7358has: function(target) {
7359var i, targets = jQuery(target, this), len = targets.length;
7360return this.filter(function() {
7361for (i = 0; i < len; i++) {
7362if (jQuery.contains(this, targets[i])) {
7363return true;
7364}
7365}
7366});
7367},
7368closest: function(selectors, context) {
7369var cur, i = 0, l = this.length, matched = [], pos = rneedsContext.test(selectors) || typeof selectors !== "string" ? jQuery(selectors, context || this.context) : 0;
7370for (; i < l; i++) {
7371for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) {
7372if (cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors))) {
7373matched.push(cur);
7374break;
7375}
7376}
7377}
7378return this.pushStack(matched.length > 1 ? jQuery.unique(matched) : matched);
7379},
7380index: function(elem) {
7381if (!elem) {
7382return (this[0] && this[0].parentNode) ? this.first().prevAll().length : -1;
7383}
7384if (typeof elem === "string") {
7385return jQuery.inArray(this[0], jQuery(elem));
7386}
7387return jQuery.inArray(elem.jquery ? elem[0] : elem, this);
7388},
7389add: function(selector, context) {
7390return this.pushStack(jQuery.unique(jQuery.merge(this.get(), jQuery(selector, context))));
7391},
7392addBack: function(selector) {
7393return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));
7394}
7395});
7396function sibling(cur, dir) {
7397do {
7398cur = cur[dir];
7399} while (cur && cur.nodeType !== 1);return cur;
7400}
7401jQuery.each({
7402parent: function(elem) {
7403var parent = elem.parentNode;
7404return parent && parent.nodeType !== 11 ? parent : null;
7405},
7406parents: function(elem) {
7407return jQuery.dir(elem, "parentNode");
7408},
7409parentsUntil: function(elem, i, until) {
7410return jQuery.dir(elem, "parentNode", until);
7411},
7412next: function(elem) {
7413return sibling(elem, "nextSibling");
7414},
7415prev: function(elem) {
7416return sibling(elem, "previousSibling");
7417},
7418nextAll: function(elem) {
7419return jQuery.dir(elem, "nextSibling");
7420},
7421prevAll: function(elem) {
7422return jQuery.dir(elem, "previousSibling");
7423},
7424nextUntil: function(elem, i, until) {
7425return jQuery.dir(elem, "nextSibling", until);
7426},
7427prevUntil: function(elem, i, until) {
7428return jQuery.dir(elem, "previousSibling", until);
7429},
7430siblings: function(elem) {
7431return jQuery.sibling((elem.parentNode || {}).firstChild, elem);
7432},
7433children: function(elem) {
7434return jQuery.sibling(elem.firstChild);
7435},
7436contents: function(elem) {
7437return jQuery.nodeName(elem, "iframe") ? elem.contentDocument || elem.contentWindow.document : jQuery.merge([], elem.childNodes);
7438}
7439}, function(name, fn) {
7440jQuery.fn[name] = function(until, selector) {
7441var ret = jQuery.map(this, fn, until);
7442if (name.slice(-5) !== "Until") {
7443selector = until;
7444}
7445if (selector && typeof selector === "string") {
7446ret = jQuery.filter(selector, ret);
7447}
7448if (this.length > 1) {
7449if (!guaranteedUnique[name]) {
7450ret = jQuery.unique(ret);
7451}
7452if (rparentsprev.test(name)) {
7453ret = ret.reverse();
7454}
7455}
7456return this.pushStack(ret);
7457}
7458;
7459});
7460var rnotwhite = (/\S+/g);
7461var optionsCache = {};
7462function createOptions(options) {
7463var object = optionsCache[options] = {};
7464jQuery.each(options.match(rnotwhite) || [], function(_, flag) {
7465object[flag] = true;
7466});
7467return object;
7468}
7469jQuery.Callbacks = function(options) {
7470options = typeof options === "string" ? (optionsCache[options] || createOptions(options)) : jQuery.extend({}, options);
7471var firing, memory, fired, firingLength, firingIndex, firingStart, list = [], stack = !options.once && [], fire = function(data) {
7472memory = options.memory && data;
7473fired = true;
7474firingIndex = firingStart || 0;
7475firingStart = 0;
7476firingLength = list.length;
7477firing = true;
7478for (; list && firingIndex < firingLength; firingIndex++) {
7479if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) {
7480memory = false;
7481break;
7482}
7483}
7484firing = false;
7485if (list) {
7486if (stack) {
7487if (stack.length) {
7488fire(stack.shift());
7489}
7490} else if (memory) {
7491list = [];
7492} else {
7493self.disable();
7494}
7495}
7496}, self = {
7497add: function() {
7498if (list) {
7499var start = list.length;
7500(function add(args) {
7501jQuery.each(args, function(_, arg) {
7502var type = jQuery.type(arg);
7503if (type === "function") {
7504if (!options.unique || !self.has(arg)) {
7505list.push(arg);
7506}
7507} else if (arg && arg.length && type !== "string") {
7508add(arg);
7509}
7510});
7511}
7512)(arguments);
7513if (firing) {
7514firingLength = list.length;
7515} else if (memory) {
7516firingStart = start;
7517fire(memory);
7518}
7519}
7520return this;
7521},
7522remove: function() {
7523if (list) {
7524jQuery.each(arguments, function(_, arg) {
7525var index;
7526while ((index = jQuery.inArray(arg, list, index)) > -1) {
7527list.splice(index, 1);
7528if (firing) {
7529if (index <= firingLength) {
7530firingLength--;
7531}
7532if (index <= firingIndex) {
7533firingIndex--;
7534}
7535}
7536}
7537});
7538}
7539return this;
7540},
7541has: function(fn) {
7542return fn ? jQuery.inArray(fn, list) > -1 : !!(list && list.length);
7543},
7544empty: function() {
7545list = [];
7546firingLength = 0;
7547return this;
7548},
7549disable: function() {
7550list = stack = memory = undefined;
7551return this;
7552},
7553disabled: function() {
7554return !list;
7555},
7556lock: function() {
7557stack = undefined;
7558if (!memory) {
7559self.disable();
7560}
7561return this;
7562},
7563locked: function() {
7564return !stack;
7565},
7566fireWith: function(context, args) {
7567if (list && (!fired || stack)) {
7568args = args || [];
7569args = [context, args.slice ? args.slice() : args];
7570if (firing) {
7571stack.push(args);
7572} else {
7573fire(args);
7574}
7575}
7576return this;
7577},
7578fire: function() {
7579self.fireWith(this, arguments);
7580return this;
7581},
7582fired: function() {
7583return !!fired;
7584}
7585};
7586return self;
7587}
7588;
7589jQuery.extend({
7590Deferred: function(func) {
7591var tuples = [["resolve", "done", jQuery.Callbacks("once memory"), "resolved"], ["reject", "fail", jQuery.Callbacks("once memory"), "rejected"], ["notify", "progress", jQuery.Callbacks("memory")]]
7592  , state = "pending"
7593  , promise = {
7594state: function() {
7595return state;
7596},
7597always: function() {
7598deferred.done(arguments).fail(arguments);
7599return this;
7600},
7601then: function() {
7602var fns = arguments;
7603return jQuery.Deferred(function(newDefer) {
7604jQuery.each(tuples, function(i, tuple) {
7605var fn = jQuery.isFunction(fns[i]) && fns[i];
7606deferred[tuple[1]](function() {
7607var returned = fn && fn.apply(this, arguments);
7608if (returned && jQuery.isFunction(returned.promise)) {
7609returned.promise().done(newDefer.resolve).fail(newDefer.reject).progress(newDefer.notify);
7610} else {
7611newDefer[tuple[0] + "With"](this === promise ? newDefer.promise() : this, fn ? [returned] : arguments);
7612}
7613});
7614});
7615fns = null;
7616}).promise();
7617},
7618promise: function(obj) {
7619return obj != null ? jQuery.extend(obj, promise) : promise;
7620}
7621}
7622  , deferred = {};
7623promise.pipe = promise.then;
7624jQuery.each(tuples, function(i, tuple) {
7625var list = tuple[2]
7626  , stateString = tuple[3];
7627promise[tuple[1]] = list.add;
7628if (stateString) {
7629list.add(function() {
7630state = stateString;
7631}, tuples[i ^ 1][2].disable, tuples[2][2].lock);
7632}
7633deferred[tuple[0]] = function() {
7634deferred[tuple[0] + "With"](this === deferred ? promise : this, arguments);
7635return this;
7636}
7637;
7638deferred[tuple[0] + "With"] = list.fireWith;
7639});
7640promise.promise(deferred);
7641if (func) {
7642func.call(deferred, deferred);
7643}
7644return deferred;
7645},
7646when: function(subordinate) {
7647var i = 0, resolveValues = slice.call(arguments), length = resolveValues.length, remaining = length !== 1 || (subordinate && jQuery.isFunction(subordinate.promise)) ? length : 0, deferred = remaining === 1 ? subordinate : jQuery.Deferred(), updateFunc = function(i, contexts, values) {
7648return function(value) {
7649contexts[i] = this;
7650values[i] = arguments.length > 1 ? slice.call(arguments) : value;
7651if (values === progressValues) {
7652deferred.notifyWith(contexts, values);
7653} else if (!(--remaining)) {
7654deferred.resolveWith(contexts, values);
7655}
7656}
7657;
7658}, progressValues, progressContexts, resolveContexts;
7659if (length > 1) {
7660progressValues = new Array(length);
7661progressContexts = new Array(length);
7662resolveContexts = new Array(length);
7663for (; i < length; i++) {
7664if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) {
7665resolveValues[i].promise().done(updateFunc(i, resolveContexts, resolveValues)).fail(deferred.reject).progress(updateFunc(i, progressContexts, progressValues));
7666} else {
7667--remaining;
7668}
7669}
7670}
7671if (!remaining) {
7672deferred.resolveWith(resolveContexts, resolveValues);
7673}
7674return deferred.promise();
7675}
7676});
7677var readyList;
7678jQuery.fn.ready = function(fn) {
7679jQuery.ready.promise().done(fn);
7680return this;
7681}
7682;
7683jQuery.extend({
7684isReady: false,
7685readyWait: 1,
7686holdReady: function(hold) {
7687if (hold) {
7688jQuery.readyWait++;
7689} else {
7690jQuery.ready(true);
7691}
7692},
7693ready: function(wait) {
7694if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
7695return;
7696}
7697if (!document.body) {
7698return setTimeout(jQuery.ready);
7699}
7700jQuery.isReady = true;
7701if (wait !== true && --jQuery.readyWait > 0) {
7702return;
7703}
7704readyList.resolveWith(document, [jQuery]);
7705if (jQuery.fn.triggerHandler) {
7706jQuery(document).triggerHandler("ready");
7707jQuery(document).off("ready");
7708}
7709}
7710});
7711function detach() {
7712if (document.addEventListener) {
7713document.removeEventListener("DOMContentLoaded", completed, false);
7714window.removeEventListener("load", completed, false);
7715} else {
7716document.detachEvent("onreadystatechange", completed);
7717window.detachEvent("onload", completed);
7718}
7719}
7720function completed() {
7721if (document.addEventListener || event.type === "load" || document.readyState === "complete") {
7722detach();
7723jQuery.ready();
7724}
7725}
7726jQuery.ready.promise = function(obj) {
7727if (!readyList) {
7728readyList = jQuery.Deferred();
7729if (document.readyState === "complete") {
7730setTimeout(jQuery.ready);
7731} else if (document.addEventListener) {
7732document.addEventListener("DOMContentLoaded", completed, false);
7733window.addEventListener("load", completed, false);
7734} else {
7735document.attachEvent("onreadystatechange", completed);
7736window.attachEvent("onload", completed);
7737var top = false;
7738try {
7739top = window.frameElement == null && document.documentElement;
7740} catch (e) {}
7741if (top && top.doScroll) {
7742(function doScrollCheck() {
7743if (!jQuery.isReady) {
7744try {
7745top.doScroll("left");
7746} catch (e) {
7747return setTimeout(doScrollCheck, 50);
7748}
7749detach();
7750jQuery.ready();
7751}
7752}
7753)();
7754}
7755}
7756}
7757return readyList.promise(obj);
7758}
7759;
7760var strundefined = typeof undefined;
7761var i;
7762for (i in jQuery(support)) {
7763break;
7764}
7765support.ownLast = i !== "0";
7766support.inlineBlockNeedsLayout = false;
7767jQuery(function() {
7768var val, div, body, container;
7769body = document.getElementsByTagName("body")[0];
7770if (!body || !body.style) {
7771return;
7772}
7773div = document.createElement("div");
7774container = document.createElement("div");
7775container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
7776body.appendChild(container).appendChild(div);
7777if (typeof div.style.zoom !== strundefined) {
7778div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
7779support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;
7780if (val) {
7781body.style.zoom = 1;
7782}
7783}
7784body.removeChild(container);
7785});
7786(function() {
7787var div = document.createElement("div");
7788if (support.deleteExpando == null) {
7789support.deleteExpando = true;
7790try {
7791delete div.test;
7792} catch (e) {
7793support.deleteExpando = false;
7794}
7795}
7796div = null;
7797}
7798)();
7799jQuery.acceptData = function(elem) {
7800var noData = jQuery.noData[(elem.nodeName + " ").toLowerCase()]
7801  , nodeType = +elem.nodeType || 1;
7802return nodeType !== 1 && nodeType !== 9 ? false : !noData || noData !== true && elem.getAttribute("classid") === noData;
7803}
7804;
7805var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/
7806  , rmultiDash = /([A-Z])/g;
7807function dataAttr(elem, key, data) {
7808if (data === undefined && elem.nodeType === 1) {
7809var name = "data-" + key.replace(rmultiDash, "-$1").toLowerCase();
7810data = elem.getAttribute(name);
7811if (typeof data === "string") {
7812try {
7813data = data === "true" ? true : data === "false" ? false : data === "null" ? null : +data + "" === data ? +data : rbrace.test(data) ? jQuery.parseJSON(data) : data;
7814} catch (e) {}
7815jQuery.data(elem, key, data);
7816} else {
7817data = undefined;
7818}
7819}
7820return data;
7821}
7822function isEmptyDataObject(obj) {
7823var name;
7824for (name in obj) {
7825if (name === "data" && jQuery.isEmptyObject(obj[name])) {
7826continue;
7827}
7828if (name !== "toJSON") {
7829return false;
7830}
7831}
7832return true;
7833}
7834function internalData(elem, name, data, pvt) {
7835if (!jQuery.acceptData(elem)) {
7836return;
7837}
7838var ret, thisCache, internalKey = jQuery.expando, isNode = elem.nodeType, cache = isNode ? jQuery.cache : elem, id = isNode ? elem[internalKey] : elem[internalKey] && internalKey;
7839if ((!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string") {
7840return;
7841}
7842if (!id) {
7843if (isNode) {
7844id = elem[internalKey] = deletedIds.pop() || jQuery.guid++;
7845} else {
7846id = internalKey;
7847}
7848}
7849if (!cache[id]) {
7850cache[id] = isNode ? {} : {
7851toJSON: jQuery.noop
7852};
7853}
7854if (typeof name === "object" || typeof name === "function") {
7855if (pvt) {
7856cache[id] = jQuery.extend(cache[id], name);
7857} else {
7858cache[id].data = jQuery.extend(cache[id].data, name);
7859}
7860}
7861thisCache = cache[id];
7862if (!pvt) {
7863if (!thisCache.data) {
7864thisCache.data = {};
7865}
7866thisCache = thisCache.data;
7867}
7868if (data !== undefined) {
7869thisCache[jQuery.camelCase(name)] = data;
7870}
7871if (typeof name === "string") {
7872ret = thisCache[name];
7873if (ret == null) {
7874ret = thisCache[jQuery.camelCase(name)];
7875}
7876} else {
7877ret = thisCache;
7878}
7879return ret;
7880}
7881function internalRemoveData(elem, name, pvt) {
7882if (!jQuery.acceptData(elem)) {
7883return;
7884}
7885var thisCache, i, isNode = elem.nodeType, cache = isNode ? jQuery.cache : elem, id = isNode ? elem[jQuery.expando] : jQuery.expando;
7886if (!cache[id]) {
7887return;
7888}
7889if (name) {
7890thisCache = pvt ? cache[id] : cache[id].data;
7891if (thisCache) {
7892if (!jQuery.isArray(name)) {
7893if (name in thisCache) {
7894name = [name];
7895} else {
7896name = jQuery.camelCase(name);
7897if (name in thisCache) {
7898name = [name];
7899} else {
7900name = name.split(" ");
7901}
7902}
7903} else {
7904name = name.concat(jQuery.map(name, jQuery.camelCase));
7905}
7906i = name.length;
7907while (i--) {
7908delete thisCache[name[i]];
7909}
7910if (pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache)) {
7911return;
7912}
7913}
7914}
7915if (!pvt) {
7916delete cache[id].data;
7917if (!isEmptyDataObject(cache[id])) {
7918return;
7919}
7920}
7921if (isNode) {
7922jQuery.cleanData([elem], true);
7923} else if (support.deleteExpando || cache != cache.window) {
7924delete cache[id];
7925} else {
7926cache[id] = null;
7927}
7928}
7929jQuery.extend({
7930cache: {},
7931noData: {
7932"applet ": true,
7933"embed ": true,
7934"object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
7935},
7936hasData: function(elem) {
7937elem = elem.nodeType ? jQuery.cache[elem[jQuery.expando]] : elem[jQuery.expando];
7938return !!elem && !isEmptyDataObject(elem);
7939},
7940data: function(elem, name, data) {
7941return internalData(elem, name, data);
7942},
7943removeData: function(elem, name) {
7944return internalRemoveData(elem, name);
7945},
7946_data: function(elem, name, data) {
7947return internalData(elem, name, data, true);
7948},
7949_removeData: function(elem, name) {
7950return internalRemoveData(elem, name, true);
7951}
7952});
7953jQuery.fn.extend({
7954data: function(key, value) {
7955var i, name, data, elem = this[0], attrs = elem && elem.attributes;
7956if (key === undefined) {
7957if (this.length) {
7958data = jQuery.data(elem);
7959if (elem.nodeType === 1 && !jQuery._data(elem, "parsedAttrs")) {
7960i = attrs.length;
7961while (i--) {
7962if (attrs[i]) {
7963name = attrs[i].name;
7964if (name.indexOf("data-") === 0) {
7965name = jQuery.camelCase(name.slice(5));
7966dataAttr(elem, name, data[name]);
7967}
7968}
7969}
7970jQuery._data(elem, "parsedAttrs", true);
7971}
7972}
7973return data;
7974}
7975if (typeof key === "object") {
7976return this.each(function() {
7977jQuery.data(this, key);
7978});
7979}
7980return arguments.length > 1 ? this.each(function() {
7981jQuery.data(this, key, value);
7982}) : elem ? dataAttr(elem, key, jQuery.data(elem, key)) : undefined;
7983},
7984removeData: function(key) {
7985return this.each(function() {
7986jQuery.removeData(this, key);
7987});
7988}
7989});
7990jQuery.extend({
7991queue: function(elem, type, data) {
7992var queue;
7993if (elem) {
7994type = (type || "fx") + "queue";
7995queue = jQuery._data(elem, type);
7996if (data) {
7997if (!queue || jQuery.isArray(data)) {
7998queue = jQuery._data(elem, type, jQuery.makeArray(data));
7999} else {
8000queue.push(data);
8001}
8002}
8003return queue || [];
8004}
8005},
8006dequeue: function(elem, type) {
8007type = type || "fx";
8008var queue = jQuery.queue(elem, type)
8009  , startLength = queue.length
8010  , fn = queue.shift()
8011  , hooks = jQuery._queueHooks(elem, type)
8012  , next = function() {
8013jQuery.dequeue(elem, type);
8014};
8015if (fn === "inprogress") {
8016fn = queue.shift();
8017startLength--;
8018}
8019if (fn) {
8020if (type === "fx") {
8021queue.unshift("inprogress");
8022}
8023delete hooks.stop;
8024fn.call(elem, next, hooks);
8025}
8026if (!startLength && hooks) {
8027hooks.empty.fire();
8028}
8029},
8030_queueHooks: function(elem, type) {
8031var key = type + "queueHooks";
8032return jQuery._data(elem, key) || jQuery._data(elem, key, {
8033empty: jQuery.Callbacks("once memory").add(function() {
8034jQuery._removeData(elem, type + "queue");
8035jQuery._removeData(elem, key);
8036})
8037});
8038}
8039});
8040jQuery.fn.extend({
8041queue: function(type, data) {
8042var setter = 2;
8043if (typeof type !== "string") {
8044data = type;
8045type = "fx";
8046setter--;
8047}
8048if (arguments.length < setter) {
8049return jQuery.queue(this[0], type);
8050}
8051return data === undefined ? this : this.each(function() {
8052var queue = jQuery.queue(this, type, data);
8053jQuery._queueHooks(this, type);
8054if (type === "fx" && queue[0] !== "inprogress") {
8055jQuery.dequeue(this, type);
8056}
8057});
8058},
8059dequeue: function(type) {
8060return this.each(function() {
8061jQuery.dequeue(this, type);
8062});
8063},
8064clearQueue: function(type) {
8065return this.queue(type || "fx", []);
8066},
8067promise: function(type, obj) {
8068var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() {
8069if (!(--count)) {
8070defer.resolveWith(elements, [elements]);
8071}
8072};
8073if (typeof type !== "string") {
8074obj = type;
8075type = undefined;
8076}
8077type = type || "fx";
8078while (i--) {
8079tmp = jQuery._data(elements[i], type + "queueHooks");
8080if (tmp && tmp.empty) {
8081count++;
8082tmp.empty.add(resolve);
8083}
8084}
8085resolve();
8086return defer.promise(obj);
8087}
8088});
8089var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
8090var cssExpand = ["Top", "Right", "Bottom", "Left"];
8091var isHidden = function(elem, el) {
8092elem = el || elem;
8093return jQuery.css(elem, "display") === "none" || !jQuery.contains(elem.ownerDocument, elem);
8094};
8095var access = jQuery.access = function(elems, fn, key, value, chainable, emptyGet, raw) {
8096var i = 0
8097  , length = elems.length
8098  , bulk = key == null;
8099if (jQuery.type(key) === "object") {
8100chainable = true;
8101for (i in key) {
8102jQuery.access(elems, fn, i, key[i], true, emptyGet, raw);
8103}
8104} else if (value !== undefined) {
8105chainable = true;
8106if (!jQuery.isFunction(value)) {
8107raw = true;
8108}
8109if (bulk) {
8110if (raw) {
8111fn.call(elems, value);
8112fn = null;
8113} else {
8114bulk = fn;
8115fn = function(elem, key, value) {
8116return bulk.call(jQuery(elem), value);
8117}
8118;
8119}
8120}
8121if (fn) {
8122for (; i < length; i++) {
8123fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)));
8124}
8125}
8126}
8127return chainable ? elems : bulk ? fn.call(elems) : length ? fn(elems[0], key) : emptyGet;
8128}
8129;
8130var rcheckableType = (/^(?:checkbox|radio)$/i);
8131(function() {
8132var input = document.createElement("input")
8133  , div = document.createElement("div")
8134  , fragment = document.createDocumentFragment();
8135div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
8136support.leadingWhitespace = div.firstChild.nodeType === 3;
8137support.tbody = !div.getElementsByTagName("tbody").length;
8138support.htmlSerialize = !!div.getElementsByTagName("link").length;
8139support.html5Clone = document.createElement("nav").cloneNode(true).outerHTML !== "<:nav></:nav>";
8140input.type = "checkbox";
8141input.checked = true;
8142fragment.appendChild(input);
8143support.appendChecked = input.checked;
8144div.innerHTML = "<textarea>x</textarea>";
8145support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;
8146fragment.appendChild(div);
8147div.innerHTML = "<input type='radio' checked='checked' name='t'/>";
8148support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;
8149support.noCloneEvent = true;
8150if (div.attachEvent) {
8151div.attachEvent("onclick", function() {
8152support.noCloneEvent = false;
8153});
8154div.cloneNode(true).click();
8155}
8156if (support.deleteExpando == null) {
8157support.deleteExpando = true;
8158try {
8159delete div.test;
8160} catch (e) {
8161support.deleteExpando = false;
8162}
8163}
8164}
8165)();
8166(function() {
8167var i, eventName, div = document.createElement("div");
8168for (i in {
8169submit: true,
8170change: true,
8171focusin: true
8172}) {
8173eventName = "on" + i;
8174if (!(support[i + "Bubbles"] = eventName in window)) {
8175div.setAttribute(eventName, "t");
8176support[i + "Bubbles"] = div.attributes[eventName].expando === false;
8177}
8178}
8179div = null;
8180}
8181)();
8182var rformElems = /^(?:input|select|textarea)$/i
8183  , rkeyEvent = /^key/
8184  , rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/
8185  , rfocusMorph = /^(?:focusinfocus|focusoutblur)$/
8186  , rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
8187function returnTrue() {
8188return true;
8189}
8190function returnFalse() {
8191return false;
8192}
8193function safeActiveElement() {
8194try {
8195return document.activeElement;
8196} catch (err) {}
8197}
8198jQuery.event = {
8199global: {},
8200add: function(elem, types, handler, data, selector) {
8201var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data(elem);
8202if (!elemData) {
8203return;
8204}
8205if (handler.handler) {
8206handleObjIn = handler;
8207handler = handleObjIn.handler;
8208selector = handleObjIn.selector;
8209}
8210if (!handler.guid) {
8211handler.guid = jQuery.guid++;
8212}
8213if (!(events = elemData.events)) {
8214events = elemData.events = {};
8215}
8216if (!(eventHandle = elemData.handle)) {
8217eventHandle = elemData.handle = function(e) {
8218return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply(eventHandle.elem, arguments) : undefined;
8219}
8220;
8221eventHandle.elem = elem;
8222}
8223types = (types || "").match(rnotwhite) || [""];
8224t = types.length;
8225while (t--) {
8226tmp = rtypenamespace.exec(types[t]) || [];
8227type = origType = tmp[1];
8228namespaces = (tmp[2] || "").split(".").sort();
8229if (!type) {
8230continue;
8231}
8232special = jQuery.event.special[type] || {};
8233type = (selector ? special.delegateType : special.bindType) || type;
8234special = jQuery.event.special[type] || {};
8235handleObj = jQuery.extend({
8236type: type,
8237origType: origType,
8238data: data,
8239handler: handler,
8240guid: handler.guid,
8241selector: selector,
8242needsContext: selector && jQuery.expr.match.needsContext.test(selector),
8243namespace: namespaces.join(".")
8244}, handleObjIn);
8245if (!(handlers = events[type])) {
8246handlers = events[type] = [];
8247handlers.delegateCount = 0;
8248if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
8249if (elem.addEventListener) {
8250elem.addEventListener(type, eventHandle, false);
8251} else if (elem.attachEvent) {
8252elem.attachEvent("on" + type, eventHandle);
8253}
8254}
8255}
8256if (special.add) {
8257special.add.call(elem, handleObj);
8258if (!handleObj.handler.guid) {
8259handleObj.handler.guid = handler.guid;
8260}
8261}
8262if (selector) {
8263handlers.splice(handlers.delegateCount++, 0, handleObj);
8264} else {
8265handlers.push(handleObj);
8266}
8267jQuery.event.global[type] = true;
8268}
8269elem = null;
8270},
8271remove: function(elem, types, handler, selector, mappedTypes) {
8272var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData(elem) && jQuery._data(elem);
8273if (!elemData || !(events = elemData.events)) {
8274return;
8275}
8276types = (types || "").match(rnotwhite) || [""];
8277t = types.length;
8278while (t--) {
8279tmp = rtypenamespace.exec(types[t]) || [];
8280type = origType = tmp[1];
8281namespaces = (tmp[2] || "").split(".").sort();
8282if (!type) {
8283for (type in events) {
8284jQuery.event.remove(elem, type + types[t], handler, selector, true);
8285}
8286continue;
8287}
8288special = jQuery.event.special[type] || {};
8289type = (selector ? special.delegateType : special.bindType) || type;
8290handlers = events[type] || [];
8291tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
8292origCount = j = handlers.length;
8293while (j--) {
8294handleObj = handlers[j];
8295if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) {
8296handlers.splice(j, 1);
8297if (handleObj.selector) {
8298handlers.delegateCount--;
8299}
8300if (special.remove) {
8301special.remove.call(elem, handleObj);
8302}
8303}
8304}
8305if (origCount && !handlers.length) {
8306if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {
8307jQuery.removeEvent(elem, type, elemData.handle);
8308}
8309delete events[type];
8310}
8311}
8312if (jQuery.isEmptyObject(events)) {
8313delete elemData.handle;
8314jQuery._removeData(elem, "events");
8315}
8316},
8317trigger: function(event, data, elem, onlyHandlers) {
8318var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [elem || document], type = hasOwn.call(event, "type") ? event.type : event, namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : [];
8319cur = tmp = elem = elem || document;
8320if (elem.nodeType === 3 || elem.nodeType === 8) {
8321return;
8322}
8323if (rfocusMorph.test(type + jQuery.event.triggered)) {
8324return;
8325}
8326if (type.indexOf(".") >= 0) {
8327namespaces = type.split(".");
8328type = namespaces.shift();
8329namespaces.sort();
8330}
8331ontype = type.indexOf(":") < 0 && "on" + type;
8332event = event[jQuery.expando] ? event : new jQuery.Event(type,typeof event === "object" && event);
8333event.isTrigger = onlyHandlers ? 2 : 3;
8334event.namespace = namespaces.join(".");
8335event.namespace_re = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
8336event.result = undefined;
8337if (!event.target) {
8338event.target = elem;
8339}
8340data = data == null ? [event] : jQuery.makeArray(data, [event]);
8341special = jQuery.event.special[type] || {};
8342if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {
8343return;
8344}
8345if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) {
8346bubbleType = special.delegateType || type;
8347if (!rfocusMorph.test(bubbleType + type)) {
8348cur = cur.parentNode;
8349}
8350for (; cur; cur = cur.parentNode) {
8351eventPath.push(cur);
8352tmp = cur;
8353}
8354if (tmp === (elem.ownerDocument || document)) {
8355eventPath.push(tmp.defaultView || tmp.parentWindow || window);
8356}
8357}
8358i = 0;
8359while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {
8360event.type = i > 1 ? bubbleType : special.bindType || type;
8361handle = (jQuery._data(cur, "events") || {})[event.type] && jQuery._data(cur, "handle");
8362if (handle) {
8363handle.apply(cur, data);
8364}
8365handle = ontype && cur[ontype];
8366if (handle && handle.apply && jQuery.acceptData(cur)) {
8367event.result = handle.apply(cur, data);
8368if (event.result === false) {
8369event.preventDefault();
8370}
8371}
8372}
8373event.type = type;
8374if (!onlyHandlers && !event.isDefaultPrevented()) {
8375if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && jQuery.acceptData(elem)) {
8376if (ontype && elem[type] && !jQuery.isWindow(elem)) {
8377tmp = elem[ontype];
8378if (tmp) {
8379elem[ontype] = null;
8380}
8381jQuery.event.triggered = type;
8382try {
8383elem[type]();
8384} catch (e) {}
8385jQuery.event.triggered = undefined;
8386if (tmp) {
8387elem[ontype] = tmp;
8388}
8389}
8390}
8391}
8392return event.result;
8393},
8394dispatch: function(event) {
8395event = jQuery.event.fix(event);
8396var i, ret, handleObj, matched, j, handlerQueue = [], args = slice.call(arguments), handlers = (jQuery._data(this, "events") || {})[event.type] || [], special = jQuery.event.special[event.type] || {};
8397args[0] = event;
8398event.delegateTarget = this;
8399if (special.preDispatch && special.preDispatch.call(this, event) === false) {
8400return;
8401}
8402handlerQueue = jQuery.event.handlers.call(this, event, handlers);
8403i = 0;
8404while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {
8405event.currentTarget = matched.elem;
8406j = 0;
8407while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {
8408if (!event.namespace_re || event.namespace_re.test(handleObj.namespace)) {
8409event.handleObj = handleObj;
8410event.data = handleObj.data;
8411ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args);
8412if (ret !== undefined) {
8413if ((event.result = ret) === false) {
8414event.preventDefault();
8415event.stopPropagation();
8416}
8417}
8418}
8419}
8420}
8421if (special.postDispatch) {
8422special.postDispatch.call(this, event);
8423}
8424return event.result;
8425},
8426handlers: function(event, handlers) {
8427var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target;
8428if (delegateCount && cur.nodeType && (!event.button || event.type !== "click")) {
8429for (; cur != this; cur = cur.parentNode || this) {
8430if (cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click")) {
8431matches = [];
8432for (i = 0; i < delegateCount; i++) {
8433handleObj = handlers[i];
8434sel = handleObj.selector + " ";
8435if (matches[sel] === undefined) {
8436matches[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) >= 0 : jQuery.find(sel, this, null, [cur]).length;
8437}
8438if (matches[sel]) {
8439matches.push(handleObj);
8440}
8441}
8442if (matches.length) {
8443handlerQueue.push({
8444elem: cur,
8445handlers: matches
8446});
8447}
8448}
8449}
8450}
8451if (delegateCount < handlers.length) {
8452handlerQueue.push({
8453elem: this,
8454handlers: handlers.slice(delegateCount)
8455});
8456}
8457return handlerQueue;
8458},
8459fix: function(event) {
8460if (event[jQuery.expando]) {
8461return event;
8462}
8463var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[type];
8464if (!fixHook) {
8465this.fixHooks[type] = fixHook = rmouseEvent.test(type) ? this.mouseHooks : rkeyEvent.test(type) ? this.keyHooks : {};
8466}
8467copy = fixHook.props ? this.props.concat(fixHook.props) : this.props;
8468event = new jQuery.Event(originalEvent);
8469i = copy.length;
8470while (i--) {
8471prop = copy[i];
8472event[prop] = originalEvent[prop];
8473}
8474if (!event.target) {
8475event.target = originalEvent.srcElement || document;
8476}
8477if (event.target.nodeType === 3) {
8478event.target = event.target.parentNode;
8479}
8480event.metaKey = !!event.metaKey;
8481return fixHook.filter ? fixHook.filter(event, originalEvent) : event;
8482},
8483props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
8484fixHooks: {},
8485keyHooks: {
8486props: "char charCode key keyCode".split(" "),
8487filter: function(event, original) {
8488if (event.which == null) {
8489event.which = original.charCode != null ? original.charCode : original.keyCode;
8490}
8491return event;
8492}
8493},
8494mouseHooks: {
8495props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
8496filter: function(event, original) {
8497var body, eventDoc, doc, button = original.button, fromElement = original.fromElement;
8498if (event.pageX == null && original.clientX != null) {
8499eventDoc = event.target.ownerDocument || document;
8500doc = eventDoc.documentElement;
8501body = eventDoc.body;
8502event.pageX = original.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
8503event.pageY = original.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
8504}
8505if (!event.relatedTarget && fromElement) {
8506event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
8507}
8508if (!event.which && button !== undefined) {
8509event.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));
8510}
8511return event;
8512}
8513},
8514special: {
8515load: {
8516noBubble: true
8517},
8518focus: {
8519trigger: function() {
8520if (this !== safeActiveElement() && this.focus) {
8521try {
8522this.focus();
8523return false;
8524} catch (e) {}
8525}
8526},
8527delegateType: "focusin"
8528},
8529blur: {
8530trigger: function() {
8531if (this === safeActiveElement() && this.blur) {
8532this.blur();
8533return false;
8534}
8535},
8536delegateType: "focusout"
8537},
8538click: {
8539trigger: function() {
8540if (jQuery.nodeName(this, "input") && this.type === "checkbox" && this.click) {
8541this.click();
8542return false;
8543}
8544},
8545_default: function(event) {
8546return jQuery.nodeName(event.target, "a");
8547}
8548},
8549beforeunload: {
8550postDispatch: function(event) {
8551if (event.result !== undefined && event.originalEvent) {
8552event.originalEvent.returnValue = event.result;
8553}
8554}
8555}
8556},
8557simulate: function(type, elem, event, bubble) {
8558var e = jQuery.extend(new jQuery.Event(), event, {
8559type: type,
8560isSimulated: true,
8561originalEvent: {}
8562});
8563if (bubble) {
8564jQuery.event.trigger(e, null, elem);
8565} else {
8566jQuery.event.dispatch.call(elem, e);
8567}
8568if (e.isDefaultPrevented()) {
8569event.preventDefault();
8570}
8571}
8572};
8573jQuery.removeEvent = document.removeEventListener ? function(elem, type, handle) {
8574if (elem.removeEventListener) {
8575elem.removeEventListener(type, handle, false);
8576}
8577}
8578: function(elem, type, handle) {
8579var name = "on" + type;
8580if (elem.detachEvent) {
8581if (typeof elem[name] === strundefined) {
8582elem[name] = null;
8583}
8584elem.detachEvent(name, handle);
8585}
8586}
8587;
8588jQuery.Event = function(src, props) {
8589if (!(this instanceof jQuery.Event)) {
8590return new jQuery.Event(src,props);
8591}
8592if (src && src.type) {
8593this.originalEvent = src;
8594this.type = src.type;
8595this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && src.returnValue === false ? returnTrue : returnFalse;
8596} else {
8597this.type = src;
8598}
8599if (props) {
8600jQuery.extend(this, props);
8601}
8602this.timeStamp = src && src.timeStamp || jQuery.now();
8603this[jQuery.expando] = true;
8604}
8605;
8606jQuery.Event.prototype = {
8607isDefaultPrevented: returnFalse,
8608isPropagationStopped: returnFalse,
8609isImmediatePropagationStopped: returnFalse,
8610preventDefault: function() {
8611var e = this.originalEvent;
8612this.isDefaultPrevented = returnTrue;
8613if (!e) {
8614return;
8615}
8616if (e.preventDefault) {
8617e.preventDefault();
8618} else {
8619e.returnValue = false;
8620}
8621},
8622stopPropagation: function() {
8623var e = this.originalEvent;
8624this.isPropagationStopped = returnTrue;
8625if (!e) {
8626return;
8627}
8628if (e.stopPropagation) {
8629e.stopPropagation();
8630}
8631e.cancelBubble = true;
8632},
8633stopImmediatePropagation: function() {
8634var e = this.originalEvent;
8635this.isImmediatePropagationStopped = returnTrue;
8636if (e && e.stopImmediatePropagation) {
8637e.stopImmediatePropagation();
8638}
8639this.stopPropagation();
8640}
8641};
8642jQuery.each({
8643mouseenter: "mouseover",
8644mouseleave: "mouseout",
8645pointerenter: "pointerover",
8646pointerleave: "pointerout"
8647}, function(orig, fix) {
8648jQuery.event.special[orig] = {
8649delegateType: fix,
8650bindType: fix,
8651handle: function(event) {
8652var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj;
8653if (!related || (related !== target && !jQuery.contains(target, related))) {
8654event.type = handleObj.origType;
8655ret = handleObj.handler.apply(this, arguments);
8656event.type = fix;
8657}
8658return ret;
8659}
8660};
8661});
8662if (!support.submitBubbles) {
8663jQuery.event.special.submit = {
8664setup: function() {
8665if (jQuery.nodeName(this, "form")) {
8666return false;
8667}
8668jQuery.event.add(this, "click._submit keypress._submit", function(e) {
8669var elem = e.target
8670  , form = jQuery.nodeName(elem, "input") || jQuery.nodeName(elem, "button") ? elem.form : undefined;
8671if (form && !jQuery._data(form, "submitBubbles")) {
8672jQuery.event.add(form, "submit._submit", function(event) {
8673event._submit_bubble = true;
8674});
8675jQuery._data(form, "submitBubbles", true);
8676}
8677});
8678},
8679postDispatch: function(event) {
8680if (event._submit_bubble) {
8681delete event._submit_bubble;
8682if (this.parentNode && !event.isTrigger) {
8683jQuery.event.simulate("submit", this.parentNode, event, true);
8684}
8685}
8686},
8687teardown: function() {
8688if (jQuery.nodeName(this, "form")) {
8689return false;
8690}
8691jQuery.event.remove(this, "._submit");
8692}
8693};
8694}
8695if (!support.changeBubbles) {
8696jQuery.event.special.change = {
8697setup: function() {
8698if (rformElems.test(this.nodeName)) {
8699if (this.type === "checkbox" || this.type === "radio") {
8700jQuery.event.add(this, "propertychange._change", function(event) {
8701if (event.originalEvent.propertyName === "checked") {
8702this._just_changed = true;
8703}
8704});
8705jQuery.event.add(this, "click._change", function(event) {
8706if (this._just_changed && !event.isTrigger) {
8707this._just_changed = false;
8708}
8709jQuery.event.simulate("change", this, event, true);
8710});
8711}
8712return false;
8713}
8714jQuery.event.add(this, "beforeactivate._change", function(e) {
8715var elem = e.target;
8716if (rformElems.test(elem.nodeName) && !jQuery._data(elem, "changeBubbles")) {
8717jQuery.event.add(elem, "change._change", function(event) {
8718if (this.parentNode && !event.isSimulated && !event.isTrigger) {
8719jQuery.event.simulate("change", this.parentNode, event, true);
8720}
8721});
8722jQuery._data(elem, "changeBubbles", true);
8723}
8724});
8725},
8726handle: function(event) {
8727var elem = event.target;
8728if (this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox")) {
8729return event.handleObj.handler.apply(this, arguments);
8730}
8731},
8732teardown: function() {
8733jQuery.event.remove(this, "._change");
8734return !rformElems.test(this.nodeName);
8735}
8736};
8737}
8738if (!support.focusinBubbles) {
8739jQuery.each({
8740focus: "focusin",
8741blur: "focusout"
8742}, function(orig, fix) {
8743var handler = function(event) {
8744jQuery.event.simulate(fix, event.target, jQuery.event.fix(event), true);
8745};
8746jQuery.event.special[fix] = {
8747setup: function() {
8748var doc = this.ownerDocument || this
8749  , attaches = jQuery._data(doc, fix);
8750if (!attaches) {
8751doc.addEventListener(orig, handler, true);
8752}
8753jQuery._data(doc, fix, (attaches || 0) + 1);
8754},
8755teardown: function() {
8756var doc = this.ownerDocument || this
8757  , attaches = jQuery._data(doc, fix) - 1;
8758if (!attaches) {
8759doc.removeEventListener(orig, handler, true);
8760jQuery._removeData(doc, fix);
8761} else {
8762jQuery._data(doc, fix, attaches);
8763}
8764}
8765};
8766});
8767}
8768jQuery.fn.extend({
8769on: function(types, selector, data, fn, one) {
8770var type, origFn;
8771if (typeof types === "object") {
8772if (typeof selector !== "string") {
8773data = data || selector;
8774selector = undefined;
8775}
8776for (type in types) {
8777this.on(type, selector, data, types[type], one);
8778}
8779return this;
8780}
8781if (data == null && fn == null) {
8782fn = selector;
8783data = selector = undefined;
8784} else if (fn == null) {
8785if (typeof selector === "string") {
8786fn = data;
8787data = undefined;
8788} else {
8789fn = data;
8790data = selector;
8791selector = undefined;
8792}
8793}
8794if (fn === false) {
8795fn = returnFalse;
8796} else if (!fn) {
8797return this;
8798}
8799if (one === 1) {
8800origFn = fn;
8801fn = function(event) {
8802jQuery().off(event);
8803return origFn.apply(this, arguments);
8804}
8805;
8806fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);
8807}
8808return this.each(function() {
8809jQuery.event.add(this, types, fn, data, selector);
8810});
8811},
8812one: function(types, selector, data, fn) {
8813return this.on(types, selector, data, fn, 1);
8814},
8815off: function(types, selector, fn) {
8816var handleObj, type;
8817if (types && types.preventDefault && types.handleObj) {
8818handleObj = types.handleObj;
8819jQuery(types.delegateTarget).off(handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler);
8820return this;
8821}
8822if (typeof types === "object") {
8823for (type in types) {
8824this.off(type, selector, types[type]);
8825}
8826return this;
8827}
8828if (selector === false || typeof selector === "function") {
8829fn = selector;
8830selector = undefined;
8831}
8832if (fn === false) {
8833fn = returnFalse;
8834}
8835return this.each(function() {
8836jQuery.event.remove(this, types, fn, selector);
8837});
8838},
8839trigger: function(type, data) {
8840return this.each(function() {
8841jQuery.event.trigger(type, data, this);
8842});
8843},
8844triggerHandler: function(type, data) {
8845var elem = this[0];
8846if (elem) {
8847return jQuery.event.trigger(type, data, elem, true);
8848}
8849}
8850});
8851function createSafeFragment(document) {
8852var list = nodeNames.split("|")
8853  , safeFrag = document.createDocumentFragment();
8854if (safeFrag.createElement) {
8855while (list.length) {
8856safeFrag.createElement(list.pop());
8857}
8858}
8859return safeFrag;
8860}
8861var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video"
8862  , rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g
8863  , rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]","i")
8864  , rleadingWhitespace = /^\s+/
8865  , rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi
8866  , rtagName = /<([\w:]+)/
8867  , rtbody = /<tbody/i
8868  , rhtml = /<|&#?\w+;/
8869  , rnoInnerhtml = /<(?:script|style|link)/i
8870  , rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i
8871  , rscriptType = /^$|\/(?:java|ecma)script/i
8872  , rscriptTypeMasked = /^true\/(.*)/
8873  , rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g
8874  , wrapMap = {
8875option: [1, "<select multiple='multiple'>", "</select>"],
8876legend: [1, "<fieldset>", "</fieldset>"],
8877area: [1, "<map>", "</map>"],
8878param: [1, "<object>", "</object>"],
8879thead: [1, "<table>", "</table>"],
8880tr: [2, "<table><tbody>", "</tbody></table>"],
8881col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
8882td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
8883_default: support.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"]
8884}
8885  , safeFragment = createSafeFragment(document)
8886  , fragmentDiv = safeFragment.appendChild(document.createElement("div"));
8887wrapMap.optgroup = wrapMap.option;
8888wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
8889wrapMap.th = wrapMap.td;
8890function getAll(context, tag) {
8891var elems, elem, i = 0, found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName(tag || "*") : typeof context.querySelectorAll !== strundefined ? context.querySelectorAll(tag || "*") : undefined;
8892if (!found) {
8893for (found = [],
8894elems = context.childNodes || context; (elem = elems[i]) != null; i++) {
8895if (!tag || jQuery.nodeName(elem, tag)) {
8896found.push(elem);
8897} else {
8898jQuery.merge(found, getAll(elem, tag));
8899}
8900}
8901}
8902return tag === undefined || tag && jQuery.nodeName(context, tag) ? jQuery.merge([context], found) : found;
8903}
8904function fixDefaultChecked(elem) {
8905if (rcheckableType.test(elem.type)) {
8906elem.defaultChecked = elem.checked;
8907}
8908}
8909function manipulationTarget(elem, content) {
8910return jQuery.nodeName(elem, "table") && jQuery.nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr") ? elem.getElementsByTagName("tbody")[0] || elem.appendChild(elem.ownerDocument.createElement("tbody")) : elem;
8911}
8912function disableScript(elem) {
8913elem.type = (jQuery.find.attr(elem, "type") !== null) + "/" + elem.type;
8914return elem;
8915}
8916function restoreScript(elem) {
8917var match = rscriptTypeMasked.exec(elem.type);
8918if (match) {
8919elem.type = match[1];
8920} else {
8921elem.removeAttribute("type");
8922}
8923return elem;
8924}
8925function setGlobalEval(elems, refElements) {
8926var elem, i = 0;
8927for (; (elem = elems[i]) != null; i++) {
8928jQuery._data(elem, "globalEval", !refElements || jQuery._data(refElements[i], "globalEval"));
8929}
8930}
8931function cloneCopyEvent(src, dest) {
8932if (dest.nodeType !== 1 || !jQuery.hasData(src)) {
8933return;
8934}
8935var type, i, l, oldData = jQuery._data(src), curData = jQuery._data(dest, oldData), events = oldData.events;
8936if (events) {
8937delete curData.handle;
8938curData.events = {};
8939for (type in events) {
8940for (i = 0,
8941l = events[type].length; i < l; i++) {
8942jQuery.event.add(dest, type, events[type][i]);
8943}
8944}
8945}
8946if (curData.data) {
8947curData.data = jQuery.extend({}, curData.data);
8948}
8949}
8950function fixCloneNodeIssues(src, dest) {
8951var nodeName, e, data;
8952if (dest.nodeType !== 1) {
8953return;
8954}
8955nodeName = dest.nodeName.toLowerCase();
8956if (!support.noCloneEvent && dest[jQuery.expando]) {
8957data = jQuery._data(dest);
8958for (e in data.events) {
8959jQuery.removeEvent(dest, e, data.handle);
8960}
8961dest.removeAttribute(jQuery.expando);
8962}
8963if (nodeName === "script" && dest.text !== src.text) {
8964disableScript(dest).text = src.text;
8965restoreScript(dest);
8966} else if (nodeName === "object") {
8967if (dest.parentNode) {
8968dest.outerHTML = src.outerHTML;
8969}
8970if (support.html5Clone && (src.innerHTML && !jQuery.trim(dest.innerHTML))) {
8971dest.innerHTML = src.innerHTML;
8972}
8973} else if (nodeName === "input" && rcheckableType.test(src.type)) {
8974dest.defaultChecked = dest.checked = src.checked;
8975if (dest.value !== src.value) {
8976dest.value = src.value;
8977}
8978} else if (nodeName === "option") {
8979dest.defaultSelected = dest.selected = src.defaultSelected;
8980} else if (nodeName === "input" || nodeName === "textarea") {
8981dest.defaultValue = src.defaultValue;
8982}
8983}
8984jQuery.extend({
8985clone: function(elem, dataAndEvents, deepDataAndEvents) {
8986var destElements, node, clone, i, srcElements, inPage = jQuery.contains(elem.ownerDocument, elem);
8987if (support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test("<" + elem.nodeName + ">")) {
8988clone = elem.cloneNode(true);
8989} else {
8990fragmentDiv.innerHTML = elem.outerHTML;
8991fragmentDiv.removeChild(clone = fragmentDiv.firstChild);
8992}
8993if ((!support.noCloneEvent || !support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) {
8994destElements = getAll(clone);
8995srcElements = getAll(elem);
8996for (i = 0; (node = srcElements[i]) != null; ++i) {
8997if (destElements[i]) {
8998fixCloneNodeIssues(node, destElements[i]);
8999}
9000}
9001}
9002if (dataAndEvents) {
9003if (deepDataAndEvents) {
9004srcElements = srcElements || getAll(elem);
9005destElements = destElements || getAll(clone);
9006for (i = 0; (node = srcElements[i]) != null; i++) {
9007cloneCopyEvent(node, destElements[i]);
9008}
9009} else {
9010cloneCopyEvent(elem, clone);
9011}
9012}
9013destElements = getAll(clone, "script");
9014if (destElements.length > 0) {
9015setGlobalEval(destElements, !inPage && getAll(elem, "script"));
9016}
9017destElements = srcElements = node = null;
9018return clone;
9019},
9020buildFragment: function(elems, context, scripts, selection) {
9021var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, safe = createSafeFragment(context), nodes = [], i = 0;
9022for (; i < l; i++) {
9023elem = elems[i];
9024if (elem || elem === 0) {
9025if (jQuery.type(elem) === "object") {
9026jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
9027} else if (!rhtml.test(elem)) {
9028nodes.push(context.createTextNode(elem));
9029} else {
9030tmp = tmp || safe.appendChild(context.createElement("div"));
9031tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
9032wrap = wrapMap[tag] || wrapMap._default;
9033tmp.innerHTML = wrap[1] + elem.replace(rxhtmlTag, "<$1></$2>") + wrap[2];
9034j = wrap[0];
9035while (j--) {
9036tmp = tmp.lastChild;
9037}
9038if (!support.leadingWhitespace && rleadingWhitespace.test(elem)) {
9039nodes.push(context.createTextNode(rleadingWhitespace.exec(elem)[0]));
9040}
9041if (!support.tbody) {
9042elem = tag === "table" && !rtbody.test(elem) ? tmp.firstChild : wrap[1] === "<table>" && !rtbody.test(elem) ? tmp : 0;
9043j = elem && elem.childNodes.length;
9044while (j--) {
9045if (jQuery.nodeName((tbody = elem.childNodes[j]), "tbody") && !tbody.childNodes.length) {
9046elem.removeChild(tbody);
9047}
9048}
9049}
9050jQuery.merge(nodes, tmp.childNodes);
9051tmp.textContent = "";
9052while (tmp.firstChild) {
9053tmp.removeChild(tmp.firstChild);
9054}
9055tmp = safe.lastChild;
9056}
9057}
9058}
9059if (tmp) {
9060safe.removeChild(tmp);
9061}
9062if (!support.appendChecked) {
9063jQuery.grep(getAll(nodes, "input"), fixDefaultChecked);
9064}
9065i = 0;
9066while ((elem = nodes[i++])) {
9067if (selection && jQuery.inArray(elem, selection) !== -1) {
9068continue;
9069}
9070contains = jQuery.contains(elem.ownerDocument, elem);
9071tmp = getAll(safe.appendChild(elem), "script");
9072if (contains) {
9073setGlobalEval(tmp);
9074}
9075if (scripts) {
9076j = 0;
9077while ((elem = tmp[j++])) {
9078if (rscriptType.test(elem.type || "")) {
9079scripts.push(elem);
9080}
9081}
9082}
9083}
9084tmp = null;
9085return safe;
9086},
9087cleanData: function(elems, acceptData) {
9088var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = support.deleteExpando, special = jQuery.event.special;
9089for (; (elem = elems[i]) != null; i++) {
9090if (acceptData || jQuery.acceptData(elem)) {
9091id = elem[internalKey];
9092data = id && cache[id];
9093if (data) {
9094if (data.events) {
9095for (type in data.events) {
9096if (special[type]) {
9097jQuery.event.remove(elem, type);
9098} else {
9099jQuery.removeEvent(elem, type, data.handle);
9100}
9101}
9102}
9103if (cache[id]) {
9104delete cache[id];
9105if (deleteExpando) {
9106delete elem[internalKey];
9107} else if (typeof elem.removeAttribute !== strundefined) {
9108elem.removeAttribute(internalKey);
9109} else {
9110elem[internalKey] = null;
9111}
9112deletedIds.push(id);
9113}
9114}
9115}
9116}
9117}
9118});
9119jQuery.fn.extend({
9120text: function(value) {
9121return access(this, function(value) {
9122return value === undefined ? jQuery.text(this) : this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(value));
9123}, null, value, arguments.length);
9124},
9125append: function() {
9126return this.domManip(arguments, function(elem) {
9127if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
9128var target = manipulationTarget(this, elem);
9129target.appendChild(elem);
9130}
9131});
9132},
9133prepend: function() {
9134return this.domManip(arguments, function(elem) {
9135if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
9136var target = manipulationTarget(this, elem);
9137target.insertBefore(elem, target.firstChild);
9138}
9139});
9140},
9141before: function() {
9142return this.domManip(arguments, function(elem) {
9143if (this.parentNode) {
9144this.parentNode.insertBefore(elem, this);
9145}
9146});
9147},
9148after: function() {
9149return this.domManip(arguments, function(elem) {
9150if (this.parentNode) {
9151this.parentNode.insertBefore(elem, this.nextSibling);
9152}
9153});
9154},
9155remove: function(selector, keepData) {
9156var elem, elems = selector ? jQuery.filter(selector, this) : this, i = 0;
9157for (; (elem = elems[i]) != null; i++) {
9158if (!keepData && elem.nodeType === 1) {
9159jQuery.cleanData(getAll(elem));
9160}
9161if (elem.parentNode) {
9162if (keepData && jQuery.contains(elem.ownerDocument, elem)) {
9163setGlobalEval(getAll(elem, "script"));
9164}
9165elem.parentNode.removeChild(elem);
9166}
9167}
9168return this;
9169},
9170empty: function() {
9171var elem, i = 0;
9172for (; (elem = this[i]) != null; i++) {
9173if (elem.nodeType === 1) {
9174jQuery.cleanData(getAll(elem, false));
9175}
9176while (elem.firstChild) {
9177elem.removeChild(elem.firstChild);
9178}
9179if (elem.options && jQuery.nodeName(elem, "select")) {
9180elem.options.length = 0;
9181}
9182}
9183return this;
9184},
9185clone: function(dataAndEvents, deepDataAndEvents) {
9186dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
9187deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
9188return this.map(function() {
9189return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
9190});
9191},
9192html: function(value) {
9193return access(this, function(value) {
9194var elem = this[0] || {}
9195  , i = 0
9196  , l = this.length;
9197if (value === undefined) {
9198return elem.nodeType === 1 ? elem.innerHTML.replace(rinlinejQuery, "") : undefined;
9199}
9200if (typeof value === "string" && !rnoInnerhtml.test(value) && (support.htmlSerialize || !rnoshimcache.test(value)) && (support.leadingWhitespace || !rleadingWhitespace.test(value)) && !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) {
9201value = value.replace(rxhtmlTag, "<$1></$2>");
9202try {
9203for (; i < l; i++) {
9204elem = this[i] || {};
9205if (elem.nodeType === 1) {
9206jQuery.cleanData(getAll(elem, false));
9207elem.innerHTML = value;
9208}
9209}
9210elem = 0;
9211} catch (e) {}
9212}
9213if (elem) {
9214this.empty().append(value);
9215}
9216}, null, value, arguments.length);
9217},
9218replaceWith: function() {
9219var arg = arguments[0];
9220this.domManip(arguments, function(elem) {
9221arg = this.parentNode;
9222jQuery.cleanData(getAll(this));
9223if (arg) {
9224arg.replaceChild(elem, this);
9225}
9226});
9227return arg && (arg.length || arg.nodeType) ? this : this.remove();
9228},
9229detach: function(selector) {
9230return this.remove(selector, true);
9231},
9232domManip: function(args, callback) {
9233args = concat.apply([], args);
9234var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction(value);
9235if (isFunction || (l > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value))) {
9236return this.each(function(index) {
9237var self = set.eq(index);
9238if (isFunction) {
9239args[0] = value.call(this, index, self.html());
9240}
9241self.domManip(args, callback);
9242});
9243}
9244if (l) {
9245fragment = jQuery.buildFragment(args, this[0].ownerDocument, false, this);
9246first = fragment.firstChild;
9247if (fragment.childNodes.length === 1) {
9248fragment = first;
9249}
9250if (first) {
9251scripts = jQuery.map(getAll(fragment, "script"), disableScript);
9252hasScripts = scripts.length;
9253for (; i < l; i++) {
9254node = fragment;
9255if (i !== iNoClone) {
9256node = jQuery.clone(node, true, true);
9257if (hasScripts) {
9258jQuery.merge(scripts, getAll(node, "script"));
9259}
9260}
9261callback.call(this[i], node, i);
9262}
9263if (hasScripts) {
9264doc = scripts[scripts.length - 1].ownerDocument;
9265jQuery.map(scripts, restoreScript);
9266for (i = 0; i < hasScripts; i++) {
9267node = scripts[i];
9268if (rscriptType.test(node.type || "") && !jQuery._data(node, "globalEval") && jQuery.contains(doc, node)) {
9269if (node.src) {
9270if (jQuery._evalUrl) {
9271jQuery._evalUrl(node.src);
9272}
9273} else {
9274jQuery.globalEval((node.text || node.textContent || node.innerHTML || "").replace(rcleanScript, ""));
9275}
9276}
9277}
9278}
9279fragment = first = null;
9280}
9281}
9282return this;
9283}
9284});
9285jQuery.each({
9286appendTo: "append",
9287prependTo: "prepend",
9288insertBefore: "before",
9289insertAfter: "after",
9290replaceAll: "replaceWith"
9291}, function(name, original) {
9292jQuery.fn[name] = function(selector) {
9293var elems, i = 0, ret = [], insert = jQuery(selector), last = insert.length - 1;
9294for (; i <= last; i++) {
9295elems = i === last ? this : this.clone(true);
9296jQuery(insert[i])[original](elems);
9297push.apply(ret, elems.get());
9298}
9299return this.pushStack(ret);
9300}
9301;
9302});
9303var iframe, elemdisplay = {};
9304function actualDisplay(name, doc) {
9305var style, elem = jQuery(doc.createElement(name)).appendTo(doc.body), display = window.getDefaultComputedStyle && (style = window.getDefaultComputedStyle(elem[0])) ? style.display : jQuery.css(elem[0], "display");
9306elem.detach();
9307return display;
9308}
9309function defaultDisplay(nodeName) {
9310var doc = document
9311  , display = elemdisplay[nodeName];
9312if (!display) {
9313display = actualDisplay(nodeName, doc);
9314if (display === "none" || !display) {
9315iframe = (iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>")).appendTo(doc.documentElement);
9316doc = (iframe[0].contentWindow || iframe[0].contentDocument).document;
9317doc.write();
9318doc.close();
9319display = actualDisplay(nodeName, doc);
9320iframe.detach();
9321}
9322elemdisplay[nodeName] = display;
9323}
9324return display;
9325}
9326(function() {
9327var shrinkWrapBlocksVal;
9328support.shrinkWrapBlocks = function() {
9329if (shrinkWrapBlocksVal != null) {
9330return shrinkWrapBlocksVal;
9331}
9332shrinkWrapBlocksVal = false;
9333var div, body, container;
9334body = document.getElementsByTagName("body")[0];
9335if (!body || !body.style) {
9336return;
9337}
9338div = document.createElement("div");
9339container = document.createElement("div");
9340container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
9341body.appendChild(container).appendChild(div);
9342if (typeof div.style.zoom !== strundefined) {
9343div.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + "box-sizing:content-box;display:block;margin:0;border:0;" + "padding:1px;width:1px;zoom:1";
9344div.appendChild(document.createElement("div")).style.width = "5px";
9345shrinkWrapBlocksVal = div.offsetWidth !== 3;
9346}
9347body.removeChild(container);
9348return shrinkWrapBlocksVal;
9349}
9350;
9351}
9352)();
9353var rmargin = (/^margin/);
9354var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$","i");
9355var getStyles, curCSS, rposition = /^(top|right|bottom|left)$/;
9356if (window.getComputedStyle) {
9357getStyles = function(elem) {
9358return elem.ownerDocument.defaultView.getComputedStyle(elem, null);
9359}
9360;
9361curCSS = function(elem, name, computed) {
9362var width, minWidth, maxWidth, ret, style = elem.style;
9363computed = computed || getStyles(elem);
9364ret = computed ? computed.getPropertyValue(name) || computed[name] : undefined;
9365if (computed) {
9366if (ret === "" && !jQuery.contains(elem.ownerDocument, elem)) {
9367ret = jQuery.style(elem, name);
9368}
9369if (rnumnonpx.test(ret) && rmargin.test(name)) {
9370width = style.width;
9371minWidth = style.minWidth;
9372maxWidth = style.maxWidth;
9373style.minWidth = style.maxWidth = style.width = ret;
9374ret = computed.width;
9375style.width = width;
9376style.minWidth = minWidth;
9377style.maxWidth = maxWidth;
9378}
9379}
9380return ret === undefined ? ret : ret + "";
9381}
9382;
9383} else if (document.documentElement.currentStyle) {
9384getStyles = function(elem) {
9385return elem.currentStyle;
9386}
9387;
9388curCSS = function(elem, name, computed) {
9389var left, rs, rsLeft, ret, style = elem.style;
9390computed = computed || getStyles(elem);
9391ret = computed ? computed[name] : undefined;
9392if (ret == null && style && style[name]) {
9393ret = style[name];
9394}
9395if (rnumnonpx.test(ret) && !rposition.test(name)) {
9396left = style.left;
9397rs = elem.runtimeStyle;
9398rsLeft = rs && rs.left;
9399if (rsLeft) {
9400rs.left = elem.currentStyle.left;
9401}
9402style.left = name === "fontSize" ? "1em" : ret;
9403ret = style.pixelLeft + "px";
9404style.left = left;
9405if (rsLeft) {
9406rs.left = rsLeft;
9407}
9408}
9409return ret === undefined ? ret : ret + "" || "auto";
9410}
9411;
9412}
9413function addGetHookIf(conditionFn, hookFn) {
9414return {
9415get: function() {
9416var condition = conditionFn();
9417if (condition == null) {
9418return;
9419}
9420if (condition) {
9421delete this.get;
9422return;
9423}
9424return (this.get = hookFn).apply(this, arguments);
9425}
9426};
9427}
9428(function() {
9429var div, style, a, pixelPositionVal, boxSizingReliableVal, reliableHiddenOffsetsVal, reliableMarginRightVal;
9430div = document.createElement("div");
9431div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
9432a = div.getElementsByTagName("a")[0];
9433style = a && a.style;
9434if (!style) {
9435return;
9436}
9437style.cssText = "float:left;opacity:.5";
9438support.opacity = style.opacity === "0.5";
9439support.cssFloat = !!style.cssFloat;
9440div.style.backgroundClip = "content-box";
9441div.cloneNode(true).style.backgroundClip = "";
9442support.clearCloneStyle = div.style.backgroundClip === "content-box";
9443support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" || style.WebkitBoxSizing === "";
9444jQuery.extend(support, {
9445reliableHiddenOffsets: function() {
9446if (reliableHiddenOffsetsVal == null) {
9447computeStyleTests();
9448}
9449return reliableHiddenOffsetsVal;
9450},
9451boxSizingReliable: function() {
9452if (boxSizingReliableVal == null) {
9453computeStyleTests();
9454}
9455return boxSizingReliableVal;
9456},
9457pixelPosition: function() {
9458if (pixelPositionVal == null) {
9459computeStyleTests();
9460}
9461return pixelPositionVal;
9462},
9463reliableMarginRight: function() {
9464if (reliableMarginRightVal == null) {
9465computeStyleTests();
9466}
9467return reliableMarginRightVal;
9468}
9469});
9470function computeStyleTests() {
9471var div, body, container, contents;
9472body = document.getElementsByTagName("body")[0];
9473if (!body || !body.style) {
9474return;
9475}
9476div = document.createElement("div");
9477container = document.createElement("div");
9478container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
9479body.appendChild(container).appendChild(div);
9480div.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" + "box-sizing:border-box;display:block;margin-top:1%;top:1%;" + "border:1px;padding:1px;width:4px;position:absolute";
9481pixelPositionVal = boxSizingReliableVal = false;
9482reliableMarginRightVal = true;
9483if (window.getComputedStyle) {
9484pixelPositionVal = (window.getComputedStyle(div, null) || {}).top !== "1%";
9485boxSizingReliableVal = (window.getComputedStyle(div, null) || {
9486width: "4px"
9487}).width === "4px";
9488contents = div.appendChild(document.createElement("div"));
9489contents.style.cssText = div.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
9490contents.style.marginRight = contents.style.width = "0";
9491div.style.width = "1px";
9492reliableMarginRightVal = !parseFloat((window.getComputedStyle(contents, null) || {}).marginRight);
9493}
9494div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
9495contents = div.getElementsByTagName("td");
9496contents[0].style.cssText = "margin:0;border:0;padding:0;display:none";
9497reliableHiddenOffsetsVal = contents[0].offsetHeight === 0;
9498if (reliableHiddenOffsetsVal) {
9499contents[0].style.display = "";
9500contents[1].style.display = "none";
9501reliableHiddenOffsetsVal = contents[0].offsetHeight === 0;
9502}
9503body.removeChild(container);
9504}
9505}
9506)();
9507jQuery.swap = function(elem, options, callback, args) {
9508var ret, name, old = {};
9509for (name in options) {
9510old[name] = elem.style[name];
9511elem.style[name] = options[name];
9512}
9513ret = callback.apply(elem, args || []);
9514for (name in options) {
9515elem.style[name] = old[name];
9516}
9517return ret;
9518}
9519;
9520var ralpha = /alpha\([^)]*\)/i
9521  , ropacity = /opacity\s*=\s*([^)]*)/
9522  , rdisplayswap = /^(none|table(?!-c[ea]).+)/
9523  , rnumsplit = new RegExp("^(" + pnum + ")(.*)$","i")
9524  , rrelNum = new RegExp("^([+-])=(" + pnum + ")","i")
9525  , cssShow = {
9526position: "absolute",
9527visibility: "hidden",
9528display: "block"
9529}
9530  , cssNormalTransform = {
9531letterSpacing: "0",
9532fontWeight: "400"
9533}
9534  , cssPrefixes = ["Webkit", "O", "Moz", "ms"];
9535function vendorPropName(style, name) {
9536if (name in style) {
9537return name;
9538}
9539var capName = name.charAt(0).toUpperCase() + name.slice(1)
9540  , origName = name
9541  , i = cssPrefixes.length;
9542while (i--) {
9543name = cssPrefixes[i] + capName;
9544if (name in style) {
9545return name;
9546}
9547}
9548return origName;
9549}
9550function showHide(elements, show) {
9551var display, elem, hidden, values = [], index = 0, length = elements.length;
9552for (; index < length; index++) {
9553elem = elements[index];
9554if (!elem.style) {
9555continue;
9556}
9557values[index] = jQuery._data(elem, "olddisplay");
9558display = elem.style.display;
9559if (show) {
9560if (!values[index] && display === "none") {
9561elem.style.display = "";
9562}
9563if (elem.style.display === "" && isHidden(elem)) {
9564values[index] = jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));
9565}
9566} else {
9567hidden = isHidden(elem);
9568if (display && display !== "none" || !hidden) {
9569jQuery._data(elem, "olddisplay", hidden ? display : jQuery.css(elem, "display"));
9570}
9571}
9572}
9573for (index = 0; index < length; index++) {
9574elem = elements[index];
9575if (!elem.style) {
9576continue;
9577}
9578if (!show || elem.style.display === "none" || elem.style.display === "") {
9579elem.style.display = show ? values[index] || "" : "none";
9580}
9581}
9582return elements;
9583}
9584function setPositiveNumber(elem, value, subtract) {
9585var matches = rnumsplit.exec(value);
9586return matches ? Math.max(0, matches[1] - (subtract || 0)) + (matches[2] || "px") : value;
9587}
9588function augmentWidthOrHeight(elem, name, extra, isBorderBox, styles) {
9589var i = extra === (isBorderBox ? "border" : "content") ? 4 : name === "width" ? 1 : 0
9590  , val = 0;
9591for (; i < 4; i += 2) {
9592if (extra === "margin") {
9593val += jQuery.css(elem, extra + cssExpand[i], true, styles);
9594}
9595if (isBorderBox) {
9596if (extra === "content") {
9597val -= jQuery.css(elem, "padding" + cssExpand[i], true, styles);
9598}
9599if (extra !== "margin") {
9600val -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
9601}
9602} else {
9603val += jQuery.css(elem, "padding" + cssExpand[i], true, styles);
9604if (extra !== "padding") {
9605val += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
9606}
9607}
9608}
9609return val;
9610}
9611function getWidthOrHeight(elem, name, extra) {
9612var valueIsBorderBox = true
9613  , val = name === "width" ? elem.offsetWidth : elem.offsetHeight
9614  , styles = getStyles(elem)
9615  , isBorderBox = support.boxSizing && jQuery.css(elem, "boxSizing", false, styles) === "border-box";
9616if (val <= 0 || val == null) {
9617val = curCSS(elem, name, styles);
9618if (val < 0 || val == null) {
9619val = elem.style[name];
9620}
9621if (rnumnonpx.test(val)) {
9622return val;
9623}
9624valueIsBorderBox = isBorderBox && (support.boxSizingReliable() || val === elem.style[name]);
9625val = parseFloat(val) || 0;
9626}
9627return (val + augmentWidthOrHeight(elem, name, extra || (isBorderBox ? "border" : "content"), valueIsBorderBox, styles)) + "px";
9628}
9629jQuery.extend({
9630cssHooks: {
9631opacity: {
9632get: function(elem, computed) {
9633if (computed) {
9634var ret = curCSS(elem, "opacity");
9635return ret === "" ? "1" : ret;
9636}
9637}
9638}
9639},
9640cssNumber: {
9641"columnCount": true,
9642"fillOpacity": true,
9643"flexGrow": true,
9644"flexShrink": true,
9645"fontWeight": true,
9646"lineHeight": true,
9647"opacity": true,
9648"order": true,
9649"orphans": true,
9650"widows": true,
9651"zIndex": true,
9652"zoom": true
9653},
9654cssProps: {
9655"float": support.cssFloat ? "cssFloat" : "styleFloat"
9656},
9657style: function(elem, name, value, extra) {
9658if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
9659return;
9660}
9661var ret, type, hooks, origName = jQuery.camelCase(name), style = elem.style;
9662name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(style, origName));
9663hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
9664if (value !== undefined) {
9665type = typeof value;
9666if (type === "string" && (ret = rrelNum.exec(value))) {
9667value = (ret[1] + 1) * ret[2] + parseFloat(jQuery.css(elem, name));
9668type = "number";
9669}
9670if (value == null || value !== value) {
9671return;
9672}
9673if (type === "number" && !jQuery.cssNumber[origName]) {
9674value += "px";
9675}
9676if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
9677style[name] = "inherit";
9678}
9679if (!hooks || !("set"in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) {
9680try {
9681style[name] = value;
9682} catch (e) {}
9683}
9684} else {
9685if (hooks && "get"in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) {
9686return ret;
9687}
9688return style[name];
9689}
9690},
9691css: function(elem, name, extra, styles) {
9692var num, val, hooks, origName = jQuery.camelCase(name);
9693name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(elem.style, origName));
9694hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
9695if (hooks && "get"in hooks) {
9696val = hooks.get(elem, true, extra);
9697}
9698if (val === undefined) {
9699val = curCSS(elem, name, styles);
9700}
9701if (val === "normal" && name in cssNormalTransform) {
9702val = cssNormalTransform[name];
9703}
9704if (extra === "" || extra) {
9705num = parseFloat(val);
9706return extra === true || jQuery.isNumeric(num) ? num || 0 : val;
9707}
9708return val;
9709}
9710});
9711jQuery.each(["height", "width"], function(i, name) {
9712jQuery.cssHooks[name] = {
9713get: function(elem, computed, extra) {
9714if (computed) {
9715return rdisplayswap.test(jQuery.css(elem, "display")) && elem.offsetWidth === 0 ? jQuery.swap(elem, cssShow, function() {
9716return getWidthOrHeight(elem, name, extra);
9717}) : getWidthOrHeight(elem, name, extra);
9718}
9719},
9720set: function(elem, value, extra) {
9721var styles = extra && getStyles(elem);
9722return setPositiveNumber(elem, value, extra ? augmentWidthOrHeight(elem, name, extra, support.boxSizing && jQuery.css(elem, "boxSizing", false, styles) === "border-box", styles) : 0);
9723}
9724};
9725});
9726if (!support.opacity) {
9727jQuery.cssHooks.opacity = {
9728get: function(elem, computed) {
9729return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ? (0.01 * parseFloat(RegExp.$1)) + "" : computed ? "1" : "";
9730},
9731set: function(elem, value) {
9732var style = elem.style
9733  , currentStyle = elem.currentStyle
9734  , opacity = jQuery.isNumeric(value) ? "alpha(opacity=" + value * 100 + ")" : ""
9735  , filter = currentStyle && currentStyle.filter || style.filter || "";
9736style.zoom = 1;
9737if ((value >= 1 || value === "") && jQuery.trim(filter.replace(ralpha, "")) === "" && style.removeAttribute) {
9738style.removeAttribute("filter");
9739if (value === "" || currentStyle && !currentStyle.filter) {
9740return;
9741}
9742}
9743style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : filter + " " + opacity;
9744}
9745};
9746}
9747jQuery.cssHooks.marginRight = addGetHookIf(support.reliableMarginRight, function(elem, computed) {
9748if (computed) {
9749return jQuery.swap(elem, {
9750"display": "inline-block"
9751}, curCSS, [elem, "marginRight"]);
9752}
9753});
9754jQuery.each({
9755margin: "",
9756padding: "",
9757border: "Width"
9758}, function(prefix, suffix) {
9759jQuery.cssHooks[prefix + suffix] = {
9760expand: function(value) {
9761var i = 0
9762  , expanded = {}
9763  , parts = typeof value === "string" ? value.split(" ") : [value];
9764for (; i < 4; i++) {
9765expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0];
9766}
9767return expanded;
9768}
9769};
9770if (!rmargin.test(prefix)) {
9771jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
9772}
9773});
9774jQuery.fn.extend({
9775css: function(name, value) {
9776return access(this, function(elem, name, value) {
9777var styles, len, map = {}, i = 0;
9778if (jQuery.isArray(name)) {
9779styles = getStyles(elem);
9780len = name.length;
9781for (; i < len; i++) {
9782map[name[i]] = jQuery.css(elem, name[i], false, styles);
9783}
9784return map;
9785}
9786return value !== undefined ? jQuery.style(elem, name, value) : jQuery.css(elem, name);
9787}, name, value, arguments.length > 1);
9788},
9789show: function() {
9790return showHide(this, true);
9791},
9792hide: function() {
9793return showHide(this);
9794},
9795toggle: function(state) {
9796if (typeof state === "boolean") {
9797return state ? this.show() : this.hide();
9798}
9799return this.each(function() {
9800if (isHidden(this)) {
9801jQuery(this).show();
9802} else {
9803jQuery(this).hide();
9804}
9805});
9806}
9807});
9808function Tween(elem, options, prop, end, easing) {
9809return new Tween.prototype.init(elem,options,prop,end,easing);
9810}
9811jQuery.Tween = Tween;
9812Tween.prototype = {
9813constructor: Tween,
9814init: function(elem, options, prop, end, easing, unit) {
9815this.elem = elem;
9816this.prop = prop;
9817this.easing = easing || "swing";
9818this.options = options;
9819this.start = this.now = this.cur();
9820this.end = end;
9821this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
9822},
9823cur: function() {
9824var hooks = Tween.propHooks[this.prop];
9825return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this);
9826},
9827run: function(percent) {
9828var eased, hooks = Tween.propHooks[this.prop];
9829if (this.options.duration) {
9830this.pos = eased = jQuery.easing[this.easing](percent, this.options.duration * percent, 0, 1, this.options.duration);
9831} else {
9832this.pos = eased = percent;
9833}
9834this.now = (this.end - this.start) * eased + this.start;
9835if (this.options.step) {
9836this.options.step.call(this.elem, this.now, this);
9837}
9838if (hooks && hooks.set) {
9839hooks.set(this);
9840} else {
9841Tween.propHooks._default.set(this);
9842}
9843return this;
9844}
9845};
9846Tween.prototype.init.prototype = Tween.prototype;
9847Tween.propHooks = {
9848_default: {
9849get: function(tween) {
9850var result;
9851if (tween.elem[tween.prop] != null && (!tween.elem.style || tween.elem.style[tween.prop] == null)) {
9852return tween.elem[tween.prop];
9853}
9854result = jQuery.css(tween.elem, tween.prop, "");
9855return !result || result === "auto" ? 0 : result;
9856},
9857set: function(tween) {
9858if (jQuery.fx.step[tween.prop]) {
9859jQuery.fx.step[tween.prop](tween);
9860} else if (tween.elem.style && (tween.elem.style[jQuery.cssProps[tween.prop]] != null || jQuery.cssHooks[tween.prop])) {
9861jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
9862} else {
9863tween.elem[tween.prop] = tween.now;
9864}
9865}
9866}
9867};
9868Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
9869set: function(tween) {
9870if (tween.elem.nodeType && tween.elem.parentNode) {
9871tween.elem[tween.prop] = tween.now;
9872}
9873}
9874};
9875jQuery.easing = {
9876linear: function(p) {
9877return p;
9878},
9879swing: function(p) {
9880return 0.5 - Math.cos(p * Math.PI) / 2;
9881}
9882};
9883jQuery.fx = Tween.prototype.init;
9884jQuery.fx.step = {};
9885var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$","i"), rrun = /queueHooks$/, animationPrefilters = [defaultPrefilter], tweeners = {
9886"*": [function(prop, value) {
9887var tween = this.createTween(prop, value)
9888  , target = tween.cur()
9889  , parts = rfxnum.exec(value)
9890  , unit = parts && parts[3] || (jQuery.cssNumber[prop] ? "" : "px")
9891  , start = (jQuery.cssNumber[prop] || unit !== "px" && +target) && rfxnum.exec(jQuery.css(tween.elem, prop))
9892  , scale = 1
9893  , maxIterations = 20;
9894if (start && start[3] !== unit) {
9895unit = unit || start[3];
9896parts = parts || [];
9897start = +target || 1;
9898do {
9899scale = scale || ".5";
9900start = start / scale;
9901jQuery.style(tween.elem, prop, start + unit);
9902} while (scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations);
9903}
9904if (parts) {
9905start = tween.start = +start || +target || 0;
9906tween.unit = unit;
9907tween.end = parts[1] ? start + (parts[1] + 1) * parts[2] : +parts[2];
9908}
9909return tween;
9910}
9911]
9912};
9913function createFxNow() {
9914setTimeout(function() {
9915fxNow = undefined;
9916});
9917return (fxNow = jQuery.now());
9918}
9919function genFx(type, includeWidth) {
9920var which, attrs = {
9921height: type
9922}, i = 0;
9923includeWidth = includeWidth ? 1 : 0;
9924for (; i < 4; i += 2 - includeWidth) {
9925which = cssExpand[i];
9926attrs["margin" + which] = attrs["padding" + which] = type;
9927}
9928if (includeWidth) {
9929attrs.opacity = attrs.width = type;
9930}
9931return attrs;
9932}
9933function createTween(value, prop, animation) {
9934var tween, collection = (tweeners[prop] || []).concat(tweeners["*"]), index = 0, length = collection.length;
9935for (; index < length; index++) {
9936if ((tween = collection[index].call(animation, prop, value))) {
9937return tween;
9938}
9939}
9940}
9941function defaultPrefilter(elem, props, opts) {
9942var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHidden(elem), dataShow = jQuery._data(elem, "fxshow");
9943if (!opts.queue) {
9944hooks = jQuery._queueHooks(elem, "fx");
9945if (hooks.unqueued == null) {
9946hooks.unqueued = 0;
9947oldfire = hooks.empty.fire;
9948hooks.empty.fire = function() {
9949if (!hooks.unqueued) {
9950oldfire();
9951}
9952}
9953;
9954}
9955hooks.unqueued++;
9956anim.always(function() {
9957anim.always(function() {
9958hooks.unqueued--;
9959if (!jQuery.queue(elem, "fx").length) {
9960hooks.empty.fire();
9961}
9962});
9963});
9964}
9965if (elem.nodeType === 1 && ("height"in props || "width"in props)) {
9966opts.overflow = [style.overflow, style.overflowX, style.overflowY];
9967display = jQuery.css(elem, "display");
9968checkDisplay = display === "none" ? jQuery._data(elem, "olddisplay") || defaultDisplay(elem.nodeName) : display;
9969if (checkDisplay === "inline" && jQuery.css(elem, "float") === "none") {
9970if (!support.inlineBlockNeedsLayout || defaultDisplay(elem.nodeName) === "inline") {
9971style.display = "inline-block";
9972} else {
9973style.zoom = 1;
9974}
9975}
9976}
9977if (opts.overflow) {
9978style.overflow = "hidden";
9979if (!support.shrinkWrapBlocks()) {
9980anim.always(function() {
9981style.overflow = opts.overflow[0];
9982style.overflowX = opts.overflow[1];
9983style.overflowY = opts.overflow[2];
9984});
9985}
9986}
9987for (prop in props) {
9988value = props[prop];
9989if (rfxtypes.exec(value)) {
9990delete props[prop];
9991toggle = toggle || value === "toggle";
9992if (value === (hidden ? "hide" : "show")) {
9993if (value === "show" && dataShow && dataShow[prop] !== undefined) {
9994hidden = true;
9995} else {
9996continue;
9997}
9998}
9999orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
10000} else {
10001display = undefined;
10002}
10003}
10004if (!jQuery.isEmptyObject(orig)) {
10005if (dataShow) {
10006if ("hidden"in dataShow) {
10007hidden = dataShow.hidden;
10008}
10009} else {
10010dataShow = jQuery._data(elem, "fxshow", {});
10011}
10012if (toggle) {
10013dataShow.hidden = !hidden;
10014}
10015if (hidden) {
10016jQuery(elem).show();
10017} else {
10018anim.done(function() {
10019jQuery(elem).hide();
10020});
10021}
10022anim.done(function() {
10023var prop;
10024jQuery._removeData(elem, "fxshow");
10025for (prop in orig) {
10026jQuery.style(elem, prop, orig[prop]);
10027}
10028});
10029for (prop in orig) {
10030tween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
10031if (!(prop in dataShow)) {
10032dataShow[prop] = tween.start;
10033if (hidden) {
10034tween.end = tween.start;
10035tween.start = prop === "width" || prop === "height" ? 1 : 0;
10036}
10037}
10038}
10039} else if ((display === "none" ? defaultDisplay(elem.nodeName) : display) === "inline") {
10040style.display = display;
10041}
10042}
10043function propFilter(props, specialEasing) {
10044var index, name, easing, value, hooks;
10045for (index in props) {
10046name = jQuery.camelCase(index);
10047easing = specialEasing[name];
10048value = props[index];
10049if (jQuery.isArray(value)) {
10050easing = value[1];
10051value = props[index] = value[0];
10052}
10053if (index !== name) {
10054props[name] = value;
10055delete props[index];
10056}
10057hooks = jQuery.cssHooks[name];
10058if (hooks && "expand"in hooks) {
10059value = hooks.expand(value);
10060delete props[name];
10061for (index in value) {
10062if (!(index in props)) {
10063props[index] = value[index];
10064specialEasing[index] = easing;
10065}
10066}
10067} else {
10068specialEasing[name] = easing;
10069}
10070}
10071}
10072function Animation(elem, properties, options) {
10073var result, stopped, index = 0, length = animationPrefilters.length, deferred = jQuery.Deferred().always(function() {
10074delete tick.elem;
10075}), tick = function() {
10076if (stopped) {
10077return false;
10078}
10079var currentTime = fxNow || createFxNow()
10080  , remaining = Math.max(0, animation.startTime + animation.duration - currentTime)
10081  , temp = remaining / animation.duration || 0
10082  , percent = 1 - temp
10083  , index = 0
10084  , length = animation.tweens.length;
10085for (; index < length; index++) {
10086animation.tweens[index].run(percent);
10087}
10088deferred.notifyWith(elem, [animation, percent, remaining]);
10089if (percent < 1 && length) {
10090return remaining;
10091} else {
10092deferred.resolveWith(elem, [animation]);
10093return false;
10094}
10095}, animation = deferred.promise({
10096elem: elem,
10097props: jQuery.extend({}, properties),
10098opts: jQuery.extend(true, {
10099specialEasing: {}
10100}, options),
10101originalProperties: properties,
10102originalOptions: options,
10103startTime: fxNow || createFxNow(),
10104duration: options.duration,
10105tweens: [],
10106createTween: function(prop, end) {
10107var tween = jQuery.Tween(elem, animation.opts, prop, end, animation.opts.specialEasing[prop] || animation.opts.easing);
10108animation.tweens.push(tween);
10109return tween;
10110},
10111stop: function(gotoEnd) {
10112var index = 0
10113  , length = gotoEnd ? animation.tweens.length : 0;
10114if (stopped) {
10115return this;
10116}
10117stopped = true;
10118for (; index < length; index++) {
10119animation.tweens[index].run(1);
10120}
10121if (gotoEnd) {
10122deferred.resolveWith(elem, [animation, gotoEnd]);
10123} else {
10124deferred.rejectWith(elem, [animation, gotoEnd]);
10125}
10126return this;
10127}
10128}), props = animation.props;
10129propFilter(props, animation.opts.specialEasing);
10130for (; index < length; index++) {
10131result = animationPrefilters[index].call(animation, elem, props, animation.opts);
10132if (result) {
10133return result;
10134}
10135}
10136jQuery.map(props, createTween, animation);
10137if (jQuery.isFunction(animation.opts.start)) {
10138animation.opts.start.call(elem, animation);
10139}
10140jQuery.fx.timer(jQuery.extend(tick, {
10141elem: elem,
10142anim: animation,
10143queue: animation.opts.queue
10144}));
10145return animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);
10146}
10147jQuery.Animation = jQuery.extend(Animation, {
10148tweener: function(props, callback) {
10149if (jQuery.isFunction(props)) {
10150callback = props;
10151props = ["*"];
10152} else {
10153props = props.split(" ");
10154}
10155var prop, index = 0, length = props.length;
10156for (; index < length; index++) {
10157prop = props[index];
10158tweeners[prop] = tweeners[prop] || [];
10159tweeners[prop].unshift(callback);
10160}
10161},
10162prefilter: function(callback, prepend) {
10163if (prepend) {
10164animationPrefilters.unshift(callback);
10165} else {
10166animationPrefilters.push(callback);
10167}
10168}
10169});
10170jQuery.speed = function(speed, easing, fn) {
10171var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
10172complete: fn || !fn && easing || jQuery.isFunction(speed) && speed,
10173duration: speed,
10174easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
10175};
10176opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
10177if (opt.queue == null || opt.queue === true) {
10178opt.queue = "fx";
10179}
10180opt.old = opt.complete;
10181opt.complete = function() {
10182if (jQuery.isFunction(opt.old)) {
10183opt.old.call(this);
10184}
10185if (opt.queue) {
10186jQuery.dequeue(this, opt.queue);
10187}
10188}
10189;
10190return opt;
10191}
10192;
10193jQuery.fn.extend({
10194fadeTo: function(speed, to, easing, callback) {
10195return this.filter(isHidden).css("opacity", 0).show().end().animate({
10196opacity: to
10197}, speed, easing, callback);
10198},
10199animate: function(prop, speed, easing, callback) {
10200var empty = jQuery.isEmptyObject(prop)
10201  , optall = jQuery.speed(speed, easing, callback)
10202  , doAnimation = function() {
10203var anim = Animation(this, jQuery.extend({}, prop), optall);
10204if (empty || jQuery._data(this, "finish")) {
10205anim.stop(true);
10206}
10207};
10208doAnimation.finish = doAnimation;
10209return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation);
10210},
10211stop: function(type, clearQueue, gotoEnd) {
10212var stopQueue = function(hooks) {
10213var stop = hooks.stop;
10214delete hooks.stop;
10215stop(gotoEnd);
10216};
10217if (typeof type !== "string") {
10218gotoEnd = clearQueue;
10219clearQueue = type;
10220type = undefined;
10221}
10222if (clearQueue && type !== false) {
10223this.queue(type || "fx", []);
10224}
10225return this.each(function() {
10226var dequeue = true
10227  , index = type != null && type + "queueHooks"
10228  , timers = jQuery.timers
10229  , data = jQuery._data(this);
10230if (index) {
10231if (data[index] && data[index].stop) {
10232stopQueue(data[index]);
10233}
10234} else {
10235for (index in data) {
10236if (data[index] && data[index].stop && rrun.test(index)) {
10237stopQueue(data[index]);
10238}
10239}
10240}
10241for (index = timers.length; index--; ) {
10242if (timers[index].elem === this && (type == null || timers[index].queue === type)) {
10243timers[index].anim.stop(gotoEnd);
10244dequeue = false;
10245timers.splice(index, 1);
10246}
10247}
10248if (dequeue || !gotoEnd) {
10249jQuery.dequeue(this, type);
10250}
10251});
10252},
10253finish: function(type) {
10254if (type !== false) {
10255type = type || "fx";
10256}
10257return this.each(function() {
10258var index, data = jQuery._data(this), queue = data[type + "queue"], hooks = data[type + "queueHooks"], timers = jQuery.timers, length = queue ? queue.length : 0;
10259data.finish = true;
10260jQuery.queue(this, type, []);
10261if (hooks && hooks.stop) {
10262hooks.stop.call(this, true);
10263}
10264for (index = timers.length; index--; ) {
10265if (timers[index].elem === this && timers[index].queue === type) {
10266timers[index].anim.stop(true);
10267timers.splice(index, 1);
10268}
10269}
10270for (index = 0; index < length; index++) {
10271if (queue[index] && queue[index].finish) {
10272queue[index].finish.call(this);
10273}
10274}
10275delete data.finish;
10276});
10277}
10278});
10279jQuery.each(["toggle", "show", "hide"], function(i, name) {
10280var cssFn = jQuery.fn[name];
10281jQuery.fn[name] = function(speed, easing, callback) {
10282return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback);
10283}
10284;
10285});
10286jQuery.each({
10287slideDown: genFx("show"),
10288slideUp: genFx("hide"),
10289slideToggle: genFx("toggle"),
10290fadeIn: {
10291opacity: "show"
10292},
10293fadeOut: {
10294opacity: "hide"
10295},
10296fadeToggle: {
10297opacity: "toggle"
10298}
10299}, function(name, props) {
10300jQuery.fn[name] = function(speed, easing, callback) {
10301return this.animate(props, speed, easing, callback);
10302}
10303;
10304});
10305jQuery.timers = [];
10306jQuery.fx.tick = function() {
10307var timer, timers = jQuery.timers, i = 0;
10308fxNow = jQuery.now();
10309for (; i < timers.length; i++) {
10310timer = timers[i];
10311if (!timer() && timers[i] === timer) {
10312timers.splice(i--, 1);
10313}
10314}
10315if (!timers.length) {
10316jQuery.fx.stop();
10317}
10318fxNow = undefined;
10319}
10320;
10321jQuery.fx.timer = function(timer) {
10322jQuery.timers.push(timer);
10323if (timer()) {
10324jQuery.fx.start();
10325} else {
10326jQuery.timers.pop();
10327}
10328}
10329;
10330jQuery.fx.interval = 13;
10331jQuery.fx.start = function() {
10332if (!timerId) {
10333timerId = setInterval(jQuery.fx.tick, jQuery.fx.interval);
10334}
10335}
10336;
10337jQuery.fx.stop = function() {
10338clearInterval(timerId);
10339timerId = null;
10340}
10341;
10342jQuery.fx.speeds = {
10343slow: 600,
10344fast: 200,
10345_default: 400
10346};
10347jQuery.fn.delay = function(time, type) {
10348time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
10349type = type || "fx";
10350return this.queue(type, function(next, hooks) {
10351var timeout = setTimeout(next, time);
10352hooks.stop = function() {
10353clearTimeout(timeout);
10354}
10355;
10356});
10357}
10358;
10359(function() {
10360var input, div, select, a, opt;
10361div = document.createElement("div");
10362div.setAttribute("className", "t");
10363div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
10364a = div.getElementsByTagName("a")[0];
10365select = document.createElement("select");
10366opt = select.appendChild(document.createElement("option"));
10367input = div.getElementsByTagName("input")[0];
10368a.style.cssText = "top:1px";
10369support.getSetAttribute = div.className !== "t";
10370support.style = /top/.test(a.getAttribute("style"));
10371support.hrefNormalized = a.getAttribute("href") === "/a";
10372support.checkOn = !!input.value;
10373support.optSelected = opt.selected;
10374support.enctype = !!document.createElement("form").enctype;
10375select.disabled = true;
10376support.optDisabled = !opt.disabled;
10377input = document.createElement("input");
10378input.setAttribute("value", "");
10379support.input = input.getAttribute("value") === "";
10380input.value = "t";
10381input.setAttribute("type", "radio");
10382support.radioValue = input.value === "t";
10383}
10384)();
10385var rreturn = /\r/g;
10386jQuery.fn.extend({
10387val: function(value) {
10388var hooks, ret, isFunction, elem = this[0];
10389if (!arguments.length) {
10390if (elem) {
10391hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
10392if (hooks && "get"in hooks && (ret = hooks.get(elem, "value")) !== undefined) {
10393return ret;
10394}
10395ret = elem.value;
10396return typeof ret === "string" ? ret.replace(rreturn, "") : ret == null ? "" : ret;
10397}
10398return;
10399}
10400isFunction = jQuery.isFunction(value);
10401return this.each(function(i) {
10402var val;
10403if (this.nodeType !== 1) {
10404return;
10405}
10406if (isFunction) {
10407val = value.call(this, i, jQuery(this).val());
10408} else {
10409val = value;
10410}
10411if (val == null) {
10412val = "";
10413} else if (typeof val === "number") {
10414val += "";
10415} else if (jQuery.isArray(val)) {
10416val = jQuery.map(val, function(value) {
10417return value == null ? "" : value + "";
10418});
10419}
10420hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
10421if (!hooks || !("set"in hooks) || hooks.set(this, val, "value") === undefined) {
10422this.value = val;
10423}
10424});
10425}
10426});
10427jQuery.extend({
10428valHooks: {
10429option: {
10430get: function(elem) {
10431var val = jQuery.find.attr(elem, "value");
10432return val != null ? val : jQuery.trim(jQuery.text(elem));
10433}
10434},
10435select: {
10436get: function(elem) {
10437var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0;
10438for (; i < max; i++) {
10439option = options[i];
10440if ((option.selected || i === index) && (support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && (!option.parentNode.disabled || !jQuery.nodeName(option.parentNode, "optgroup"))) {
10441value = jQuery(option).val();
10442if (one) {
10443return value;
10444}
10445values.push(value);
10446}
10447}
10448return values;
10449},
10450set: function(elem, value) {
10451var optionSet, option, options = elem.options, values = jQuery.makeArray(value), i = options.length;
10452while (i--) {
10453option = options[i];
10454if (jQuery.inArray(jQuery.valHooks.option.get(option), values) >= 0) {
10455try {
10456option.selected = optionSet = true;
10457} catch (_) {
10458option.scrollHeight;
10459}
10460} else {
10461option.selected = false;
10462}
10463}
10464if (!optionSet) {
10465elem.selectedIndex = -1;
10466}
10467return options;
10468}
10469}
10470}
10471});
10472jQuery.each(["radio", "checkbox"], function() {
10473jQuery.valHooks[this] = {
10474set: function(elem, value) {
10475if (jQuery.isArray(value)) {
10476return (elem.checked = jQuery.inArray(jQuery(elem).val(), value) >= 0);
10477}
10478}
10479};
10480if (!support.checkOn) {
10481jQuery.valHooks[this].get = function(elem) {
10482return elem.getAttribute("value") === null ? "on" : elem.value;
10483}
10484;
10485}
10486});
10487var nodeHook, boolHook, attrHandle = jQuery.expr.attrHandle, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = support.getSetAttribute, getSetInput = support.input;
10488jQuery.fn.extend({
10489attr: function(name, value) {
10490return access(this, jQuery.attr, name, value, arguments.length > 1);
10491},
10492removeAttr: function(name) {
10493return this.each(function() {
10494jQuery.removeAttr(this, name);
10495});
10496}
10497});
10498jQuery.extend({
10499attr: function(elem, name, value) {
10500var hooks, ret, nType = elem.nodeType;
10501if (!elem || nType === 3 || nType === 8 || nType === 2) {
10502return;
10503}
10504if (typeof elem.getAttribute === strundefined) {
10505return jQuery.prop(elem, name, value);
10506}
10507if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
10508name = name.toLowerCase();
10509hooks = jQuery.attrHooks[name] || (jQuery.expr.match.bool.test(name) ? boolHook : nodeHook);
10510}
10511if (value !== undefined) {
10512if (value === null) {
10513jQuery.removeAttr(elem, name);
10514} else if (hooks && "set"in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {
10515return ret;
10516} else {
10517elem.setAttribute(name, value + "");
10518return value;
10519}
10520} else if (hooks && "get"in hooks && (ret = hooks.get(elem, name)) !== null) {
10521return ret;
10522} else {
10523ret = jQuery.find.attr(elem, name);
10524return ret == null ? undefined : ret;
10525}
10526},
10527removeAttr: function(elem, value) {
10528var name, propName, i = 0, attrNames = value && value.match(rnotwhite);
10529if (attrNames && elem.nodeType === 1) {
10530while ((name = attrNames[i++])) {
10531propName = jQuery.propFix[name] || name;
10532if (jQuery.expr.match.bool.test(name)) {
10533if (getSetInput && getSetAttribute || !ruseDefault.test(name)) {
10534elem[propName] = false;
10535} else {
10536elem[jQuery.camelCase("default-" + name)] = elem[propName] = false;
10537}
10538} else {
10539jQuery.attr(elem, name, "");
10540}
10541elem.removeAttribute(getSetAttribute ? name : propName);
10542}
10543}
10544},
10545attrHooks: {
10546type: {
10547set: function(elem, value) {
10548if (!support.radioValue && value === "radio" && jQuery.nodeName(elem, "input")) {
10549var val = elem.value;
10550elem.setAttribute("type", value);
10551if (val) {
10552elem.value = val;
10553}
10554return value;
10555}
10556}
10557}
10558}
10559});
10560boolHook = {
10561set: function(elem, value, name) {
10562if (value === false) {
10563jQuery.removeAttr(elem, name);
10564} else if (getSetInput && getSetAttribute || !ruseDefault.test(name)) {
10565elem.setAttribute(!getSetAttribute && jQuery.propFix[name] || name, name);
10566} else {
10567elem[jQuery.camelCase("default-" + name)] = elem[name] = true;
10568}
10569return name;
10570}
10571};
10572jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(i, name) {
10573var getter = attrHandle[name] || jQuery.find.attr;
10574attrHandle[name] = getSetInput && getSetAttribute || !ruseDefault.test(name) ? function(elem, name, isXML) {
10575var ret, handle;
10576if (!isXML) {
10577handle = attrHandle[name];
10578attrHandle[name] = ret;
10579ret = getter(elem, name, isXML) != null ? name.toLowerCase() : null;
10580attrHandle[name] = handle;
10581}
10582return ret;
10583}
10584: function(elem, name, isXML) {
10585if (!isXML) {
10586return elem[jQuery.camelCase("default-" + name)] ? name.toLowerCase() : null;
10587}
10588}
10589;
10590});
10591if (!getSetInput || !getSetAttribute) {
10592jQuery.attrHooks.value = {
10593set: function(elem, value, name) {
10594if (jQuery.nodeName(elem, "input")) {
10595elem.defaultValue = value;
10596} else {
10597return nodeHook && nodeHook.set(elem, value, name);
10598}
10599}
10600};
10601}
10602if (!getSetAttribute) {
10603nodeHook = {
10604set: function(elem, value, name) {
10605var ret = elem.getAttributeNode(name);
10606if (!ret) {
10607elem.setAttributeNode((ret = elem.ownerDocument.createAttribute(name)));
10608}
10609ret.value = value += "";
10610if (name === "value" || value === elem.getAttribute(name)) {
10611return value;
10612}
10613}
10614};
10615attrHandle.id = attrHandle.name = attrHandle.coords = function(elem, name, isXML) {
10616var ret;
10617if (!isXML) {
10618return (ret = elem.getAttributeNode(name)) && ret.value !== "" ? ret.value : null;
10619}
10620}
10621;
10622jQuery.valHooks.button = {
10623get: function(elem, name) {
10624var ret = elem.getAttributeNode(name);
10625if (ret && ret.specified) {
10626return ret.value;
10627}
10628},
10629set: nodeHook.set
10630};
10631jQuery.attrHooks.contenteditable = {
10632set: function(elem, value, name) {
10633nodeHook.set(elem, value === "" ? false : value, name);
10634}
10635};
10636jQuery.each(["width", "height"], function(i, name) {
10637jQuery.attrHooks[name] = {
10638set: function(elem, value) {
10639if (value === "") {
10640elem.setAttribute(name, "auto");
10641return value;
10642}
10643}
10644};
10645});
10646}
10647if (!support.style) {
10648jQuery.attrHooks.style = {
10649get: function(elem) {
10650return elem.style.cssText || undefined;
10651},
10652set: function(elem, value) {
10653return (elem.style.cssText = value + "");
10654}
10655};
10656}
10657var rfocusable = /^(?:input|select|textarea|button|object)$/i
10658  , rclickable = /^(?:a|area)$/i;
10659jQuery.fn.extend({
10660prop: function(name, value) {
10661return access(this, jQuery.prop, name, value, arguments.length > 1);
10662},
10663removeProp: function(name) {
10664name = jQuery.propFix[name] || name;
10665return this.each(function() {
10666try {
10667this[name] = undefined;
10668delete this[name];
10669} catch (e) {}
10670});
10671}
10672});
10673jQuery.extend({
10674propFix: {
10675"for": "htmlFor",
10676"class": "className"
10677},
10678prop: function(elem, name, value) {
10679var ret, hooks, notxml, nType = elem.nodeType;
10680if (!elem || nType === 3 || nType === 8 || nType === 2) {
10681return;
10682}
10683notxml = nType !== 1 || !jQuery.isXMLDoc(elem);
10684if (notxml) {
10685name = jQuery.propFix[name] || name;
10686hooks = jQuery.propHooks[name];
10687}
10688if (value !== undefined) {
10689return hooks && "set"in hooks && (ret = hooks.set(elem, value, name)) !== undefined ? ret : (elem[name] = value);
10690} else {
10691return hooks && "get"in hooks && (ret = hooks.get(elem, name)) !== null ? ret : elem[name];
10692}
10693},
10694propHooks: {
10695tabIndex: {
10696get: function(elem) {
10697var tabindex = jQuery.find.attr(elem, "tabindex");
10698return tabindex ? parseInt(tabindex, 10) : rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href ? 0 : -1;
10699}
10700}
10701}
10702});
10703if (!support.hrefNormalized) {
10704jQuery.each(["href", "src"], function(i, name) {
10705jQuery.propHooks[name] = {
10706get: function(elem) {
10707return elem.getAttribute(name, 4);
10708}
10709};
10710});
10711}
10712if (!support.optSelected) {
10713jQuery.propHooks.selected = {
10714get: function(elem) {
10715var parent = elem.parentNode;
10716if (parent) {
10717parent.selectedIndex;
10718if (parent.parentNode) {
10719parent.parentNode.selectedIndex;
10720}
10721}
10722return null;
10723}
10724};
10725}
10726jQuery.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() {
10727jQuery.propFix[this.toLowerCase()] = this;
10728});
10729if (!support.enctype) {
10730jQuery.propFix.enctype = "encoding";
10731}
10732var rclass = /[\t\r\n\f]/g;
10733jQuery.fn.extend({
10734addClass: function(value) {
10735var classes, elem, cur, clazz, j, finalValue, i = 0, len = this.length, proceed = typeof value === "string" && value;
10736if (jQuery.isFunction(value)) {
10737return this.each(function(j) {
10738jQuery(this).addClass(value.call(this, j, this.className));
10739});
10740}
10741if (proceed) {
10742classes = (value || "").match(rnotwhite) || [];
10743for (; i < len; i++) {
10744elem = this[i];
10745cur = elem.nodeType === 1 && (elem.className ? (" " + elem.className + " ").replace(rclass, " ") : " ");
10746if (cur) {
10747j = 0;
10748while ((clazz = classes[j++])) {
10749if (cur.indexOf(" " + clazz + " ") < 0) {
10750cur += clazz + " ";
10751}
10752}
10753finalValue = jQuery.trim(cur);
10754if (elem.className !== finalValue) {
10755elem.className = finalValue;
10756}
10757}
10758}
10759}
10760return this;
10761},
10762removeClass: function(value) {
10763var classes, elem, cur, clazz, j, finalValue, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value;
10764if (jQuery.isFunction(value)) {
10765return this.each(function(j) {
10766jQuery(this).removeClass(value.call(this, j, this.className));
10767});
10768}
10769if (proceed) {
10770classes = (value || "").match(rnotwhite) || [];
10771for (; i < len; i++) {
10772elem = this[i];
10773cur = elem.nodeType === 1 && (elem.className ? (" " + elem.className + " ").replace(rclass, " ") : "");
10774if (cur) {
10775j = 0;
10776while ((clazz = classes[j++])) {
10777while (cur.indexOf(" " + clazz + " ") >= 0) {
10778cur = cur.replace(" " + clazz + " ", " ");
10779}
10780}
10781finalValue = value ? jQuery.trim(cur) : "";
10782if (elem.className !== finalValue) {
10783elem.className = finalValue;
10784}
10785}
10786}
10787}
10788return this;
10789},
10790toggleClass: function(value, stateVal) {
10791var type = typeof value;
10792if (typeof stateVal === "boolean" && type === "string") {
10793return stateVal ? this.addClass(value) : this.removeClass(value);
10794}
10795if (jQuery.isFunction(value)) {
10796return this.each(function(i) {
10797jQuery(this).toggleClass(value.call(this, i, this.className, stateVal), stateVal);
10798});
10799}
10800return this.each(function() {
10801if (type === "string") {
10802var className, i = 0, self = jQuery(this), classNames = value.match(rnotwhite) || [];
10803while ((className = classNames[i++])) {
10804if (self.hasClass(className)) {
10805self.removeClass(className);
10806} else {
10807self.addClass(className);
10808}
10809}
10810} else if (type === strundefined || type === "boolean") {
10811if (this.className) {
10812jQuery._data(this, "__className__", this.className);
10813}
10814this.className = this.className || value === false ? "" : jQuery._data(this, "__className__") || "";
10815}
10816});
10817},
10818hasClass: function(selector) {
10819var className = " " + selector + " "
10820  , i = 0
10821  , l = this.length;
10822for (; i < l; i++) {
10823if (this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf(className) >= 0) {
10824return true;
10825}
10826}
10827return false;
10828}
10829});
10830jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function(i, name) {
10831jQuery.fn[name] = function(data, fn) {
10832return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name);
10833}
10834;
10835});
10836jQuery.fn.extend({
10837hover: function(fnOver, fnOut) {
10838return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
10839},
10840bind: function(types, data, fn) {
10841return this.on(types, null, data, fn);
10842},
10843unbind: function(types, fn) {
10844return this.off(types, null, fn);
10845},
10846delegate: function(selector, types, data, fn) {
10847return this.on(types, selector, data, fn);
10848},
10849undelegate: function(selector, types, fn) {
10850return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn);
10851}
10852});
10853var nonce = jQuery.now();
10854var rquery = (/\?/);
10855var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
10856jQuery.parseJSON = function(data) {
10857if (window.JSON && window.JSON.parse) {
10858return window.JSON.parse(data + "");
10859}
10860var requireNonComma, depth = null, str = jQuery.trim(data + "");
10861return str && !jQuery.trim(str.replace(rvalidtokens, function(token, comma, open, close) {
10862if (requireNonComma && comma) {
10863depth = 0;
10864}
10865if (depth === 0) {
10866return token;
10867}
10868requireNonComma = open || comma;
10869depth += !close - !open;
10870return "";
10871})) ? (Function("return " + str))() : jQuery.error("Invalid JSON: " + data);
10872}
10873;
10874jQuery.parseXML = function(data) {
10875var xml, tmp;
10876if (!data || typeof data !== "string") {
10877return null;
10878}
10879try {
10880if (window.DOMParser) {
10881tmp = new DOMParser();
10882xml = tmp.parseFromString(data, "text/xml");
10883} else {
10884xml = new ActiveXObject("Microsoft.XMLDOM");
10885xml.async = "false";
10886xml.loadXML(data);
10887}
10888} catch (e) {
10889xml = undefined;
10890}
10891if (!xml || !xml.documentElement || xml.getElementsByTagName("parsererror").length) {
10892jQuery.error("Invalid XML: " + data);
10893}
10894return xml;
10895}
10896;
10897var ajaxLocParts, ajaxLocation, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, prefilters = {}, transports = {}, allTypes = "*/".concat("*");
10898try {
10899ajaxLocation = location.href;
10900} catch (e) {
10901ajaxLocation = document.createElement("a");
10902ajaxLocation.href = "";
10903ajaxLocation = ajaxLocation.href;
10904}
10905ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || [];
10906function addToPrefiltersOrTransports(structure) {
10907return function(dataTypeExpression, func) {
10908if (typeof dataTypeExpression !== "string") {
10909func = dataTypeExpression;
10910dataTypeExpression = "*";
10911}
10912var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match(rnotwhite) || [];
10913if (jQuery.isFunction(func)) {
10914while ((dataType = dataTypes[i++])) {
10915if (dataType.charAt(0) === "+") {
10916dataType = dataType.slice(1) || "*";
10917(structure[dataType] = structure[dataType] || []).unshift(func);
10918} else {
10919(structure[dataType] = structure[dataType] || []).push(func);
10920}
10921}
10922}
10923}
10924;
10925}
10926function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {
10927var inspected = {}
10928  , seekingTransport = (structure === transports);
10929function inspect(dataType) {
10930var selected;
10931inspected[dataType] = true;
10932jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) {
10933var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);
10934if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) {
10935options.dataTypes.unshift(dataTypeOrTransport);
10936inspect(dataTypeOrTransport);
10937return false;
10938} else if (seekingTransport) {
10939return !(selected = dataTypeOrTransport);
10940}
10941});
10942return selected;
10943}
10944return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*");
10945}
10946function ajaxExtend(target, src) {
10947var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {};
10948for (key in src) {
10949if (src[key] !== undefined) {
10950(flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key];
10951}
10952}
10953if (deep) {
10954jQuery.extend(true, target, deep);
10955}
10956return target;
10957}
10958function ajaxHandleResponses(s, jqXHR, responses) {
10959var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes;
10960while (dataTypes[0] === "*") {
10961dataTypes.shift();
10962if (ct === undefined) {
10963ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
10964}
10965}
10966if (ct) {
10967for (type in contents) {
10968if (contents[type] && contents[type].test(ct)) {
10969dataTypes.unshift(type);
10970break;
10971}
10972}
10973}
10974if (dataTypes[0]in responses) {
10975finalDataType = dataTypes[0];
10976} else {
10977for (type in responses) {
10978if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) {
10979finalDataType = type;
10980break;
10981}
10982if (!firstDataType) {
10983firstDataType = type;
10984}
10985}
10986finalDataType = finalDataType || firstDataType;
10987}
10988if (finalDataType) {
10989if (finalDataType !== dataTypes[0]) {
10990dataTypes.unshift(finalDataType);
10991}
10992return responses[finalDataType];
10993}
10994}
10995function ajaxConvert(s, response, jqXHR, isSuccess) {
10996var conv2, current, conv, tmp, prev, converters = {}, dataTypes = s.dataTypes.slice();
10997if (dataTypes[1]) {
10998for (conv in s.converters) {
10999converters[conv.toLowerCase()] = s.converters[conv];
11000}
11001}
11002current = dataTypes.shift();
11003while (current) {
11004if (s.responseFields[current]) {
11005jqXHR[s.responseFields[current]] = response;
11006}
11007if (!prev && isSuccess && s.dataFilter) {
11008response = s.dataFilter(response, s.dataType);
11009}
11010prev = current;
11011current = dataTypes.shift();
11012if (current) {
11013if (current === "*") {
11014current = prev;
11015} else if (prev !== "*" && prev !== current) {
11016conv = converters[prev + " " + current] || converters["* " + current];
11017if (!conv) {
11018for (conv2 in converters) {
11019tmp = conv2.split(" ");
11020if (tmp[1] === current) {
11021conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]];
11022if (conv) {
11023if (conv === true) {
11024conv = converters[conv2];
11025} else if (converters[conv2] !== true) {
11026current = tmp[0];
11027dataTypes.unshift(tmp[1]);
11028}
11029break;
11030}
11031}
11032}
11033}
11034if (conv !== true) {
11035if (conv && s["throws"]) {
11036response = conv(response);
11037} else {
11038try {
11039response = conv(response);
11040} catch (e) {
11041return {
11042state: "parsererror",
11043error: conv ? e : "No conversion from " + prev + " to " + current
11044};
11045}
11046}
11047}
11048}
11049}
11050}
11051return {
11052state: "success",
11053data: response
11054};
11055}
11056jQuery.extend({
11057active: 0,
11058lastModified: {},
11059etag: {},
11060ajaxSettings: {
11061url: ajaxLocation,
11062type: "GET",
11063isLocal: rlocalProtocol.test(ajaxLocParts[1]),
11064global: true,
11065processData: true,
11066async: true,
11067contentType: "application/x-www-form-urlencoded; charset=UTF-8",
11068accepts: {
11069"*": allTypes,
11070text: "text/plain",
11071html: "text/html",
11072xml: "application/xml, text/xml",
11073json: "application/json, text/javascript"
11074},
11075contents: {
11076xml: /xml/,
11077html: /html/,
11078json: /json/
11079},
11080responseFields: {
11081xml: "responseXML",
11082text: "responseText",
11083json: "responseJSON"
11084},
11085converters: {
11086"* text": String,
11087"text html": true,
11088"text json": jQuery.parseJSON,
11089"text xml": jQuery.parseXML
11090},
11091flatOptions: {
11092url: true,
11093context: true
11094}
11095},
11096ajaxSetup: function(target, settings) {
11097return settings ? ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) : ajaxExtend(jQuery.ajaxSettings, target);
11098},
11099ajaxPrefilter: addToPrefiltersOrTransports(prefilters),
11100ajaxTransport: addToPrefiltersOrTransports(transports),
11101ajax: function(url, options) {
11102if (typeof url === "object") {
11103options = url;
11104url = undefined;
11105}
11106options = options || {};
11107var parts, i, cacheURL, responseHeadersString, timeoutTimer, fireGlobals, transport, responseHeaders, s = jQuery.ajaxSetup({}, options), callbackContext = s.context || s, globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event, deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), statusCode = s.statusCode || {}, requestHeaders = {}, requestHeadersNames = {}, state = 0, strAbort = "canceled", jqXHR = {
11108readyState: 0,
11109getResponseHeader: function(key) {
11110var match;
11111if (state === 2) {
11112if (!responseHeaders) {
11113responseHeaders = {};
11114while ((match = rheaders.exec(responseHeadersString))) {
11115responseHeaders[match[1].toLowerCase()] = match[2];
11116}
11117}
11118match = responseHeaders[key.toLowerCase()];
11119}
11120return match == null ? null : match;
11121},
11122getAllResponseHeaders: function() {
11123return state === 2 ? responseHeadersString : null;
11124},
11125setRequestHeader: function(name, value) {
11126var lname = name.toLowerCase();
11127if (!state) {
11128name = requestHeadersNames[lname] = requestHeadersNames[lname] || name;
11129requestHeaders[name] = value;
11130}
11131return this;
11132},
11133overrideMimeType: function(type) {
11134if (!state) {
11135s.mimeType = type;
11136}
11137return this;
11138},
11139statusCode: function(map) {
11140var code;
11141if (map) {
11142if (state < 2) {
11143for (code in map) {
11144statusCode[code] = [statusCode[code], map[code]];
11145}
11146} else {
11147jqXHR.always(map[jqXHR.status]);
11148}
11149}
11150return this;
11151},
11152abort: function(statusText) {
11153var finalText = statusText || strAbort;
11154if (transport) {
11155transport.abort(finalText);
11156}
11157done(0, finalText);
11158return this;
11159}
11160};
11161deferred.promise(jqXHR).complete = completeDeferred.add;
11162jqXHR.success = jqXHR.done;
11163jqXHR.error = jqXHR.fail;
11164s.url = ((url || s.url || ajaxLocation) + "").replace(rhash, "").replace(rprotocol, ajaxLocParts[1] + "//");
11165s.type = options.method || options.type || s.method || s.type;
11166s.dataTypes = jQuery.trim(s.dataType || "*").toLowerCase().match(rnotwhite) || [""];
11167if (s.crossDomain == null) {
11168parts = rurl.exec(s.url.toLowerCase());
11169s.crossDomain = !!(parts && (parts[1] !== ajaxLocParts[1] || parts[2] !== ajaxLocParts[2] || (parts[3] || (parts[1] === "http:" ? "80" : "443")) !== (ajaxLocParts[3] || (ajaxLocParts[1] === "http:" ? "80" : "443"))));
11170}
11171if (s.data && s.processData && typeof s.data !== "string") {
11172s.data = jQuery.param(s.data, s.traditional);
11173}
11174inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);
11175if (state === 2) {
11176return jqXHR;
11177}
11178fireGlobals = s.global;
11179if (fireGlobals && jQuery.active++ === 0) {
11180jQuery.event.trigger("ajaxStart");
11181}
11182s.type = s.type.toUpperCase();
11183s.hasContent = !rnoContent.test(s.type);
11184cacheURL = s.url;
11185if (!s.hasContent) {
11186if (s.data) {
11187cacheURL = (s.url += (rquery.test(cacheURL) ? "&" : "?") + s.data);
11188delete s.data;
11189}
11190if (s.cache === false) {
11191s.url = rts.test(cacheURL) ? cacheURL.replace(rts, "$1_=" + nonce++) : cacheURL + (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce++;
11192}
11193}
11194if (s.ifModified) {
11195if (jQuery.lastModified[cacheURL]) {
11196jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
11197}
11198if (jQuery.etag[cacheURL]) {
11199jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
11200}
11201}
11202if (s.data && s.hasContent && s.contentType !== false || options.contentType) {
11203jqXHR.setRequestHeader("Content-Type", s.contentType);
11204}
11205jqXHR.setRequestHeader("Accept", s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") : s.accepts["*"]);
11206for (i in s.headers) {
11207jqXHR.setRequestHeader(i, s.headers[i]);
11208}
11209if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || state === 2)) {
11210return jqXHR.abort();
11211}
11212strAbort = "abort";
11213for (i in {
11214success: 1,
11215error: 1,
11216complete: 1
11217}) {
11218jqXHR[i](s[i]);
11219}
11220transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);
11221if (!transport) {
11222done(-1, "No Transport");
11223} else {
11224jqXHR.readyState = 1;
11225if (fireGlobals) {
11226globalEventContext.trigger("ajaxSend", [jqXHR, s]);
11227}
11228if (s.async && s.timeout > 0) {
11229timeoutTimer = setTimeout(function() {
11230jqXHR.abort("timeout");
11231}, s.timeout);
11232}
11233try {
11234state = 1;
11235transport.send(requestHeaders, done);
11236} catch (e) {
11237if (state < 2) {
11238done(-1, e);
11239} else {
11240throw e;
11241}
11242}
11243}
11244function done(status, nativeStatusText, responses, headers) {
11245var isSuccess, success, error, response, modified, statusText = nativeStatusText;
11246if (state === 2) {
11247return;
11248}
11249state = 2;
11250if (timeoutTimer) {
11251clearTimeout(timeoutTimer);
11252}
11253transport = undefined;
11254responseHeadersString = headers || "";
11255jqXHR.readyState = status > 0 ? 4 : 0;
11256isSuccess = status >= 200 && status < 300 || status === 304;
11257if (responses) {
11258response = ajaxHandleResponses(s, jqXHR, responses);
11259}
11260response = ajaxConvert(s, response, jqXHR, isSuccess);
11261if (isSuccess) {
11262if (s.ifModified) {
11263modified = jqXHR.getResponseHeader("Last-Modified");
11264if (modified) {
11265jQuery.lastModified[cacheURL] = modified;
11266}
11267modified = jqXHR.getResponseHeader("etag");
11268if (modified) {
11269jQuery.etag[cacheURL] = modified;
11270}
11271}
11272if (status === 204 || s.type === "HEAD") {
11273statusText = "nocontent";
11274} else if (status === 304) {
11275statusText = "notmodified";
11276} else {
11277statusText = response.state;
11278success = response.data;
11279error = response.error;
11280isSuccess = !error;
11281}
11282} else {
11283error = statusText;
11284if (status || !statusText) {
11285statusText = "error";
11286if (status < 0) {
11287status = 0;
11288}
11289}
11290}
11291jqXHR.status = status;
11292jqXHR.statusText = (nativeStatusText || statusText) + "";
11293if (isSuccess) {
11294deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);
11295} else {
11296deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);
11297}
11298jqXHR.statusCode(statusCode);
11299statusCode = undefined;
11300if (fireGlobals) {
11301globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s, isSuccess ? success : error]);
11302}
11303completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
11304if (fireGlobals) {
11305globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
11306if (!(--jQuery.active)) {
11307jQuery.event.trigger("ajaxStop");
11308}
11309}
11310}
11311return jqXHR;
11312},
11313getJSON: function(url, data, callback) {
11314return jQuery.get(url, data, callback, "json");
11315},
11316getScript: function(url, callback) {
11317return jQuery.get(url, undefined, callback, "script");
11318}
11319});
11320jQuery.each(["get", "post"], function(i, method) {
11321jQuery[method] = function(url, data, callback, type) {
11322if (jQuery.isFunction(data)) {
11323type = type || callback;
11324callback = data;
11325data = undefined;
11326}
11327return jQuery.ajax({
11328url: url,
11329type: method,
11330dataType: type,
11331data: data,
11332success: callback
11333});
11334}
11335;
11336});
11337jQuery.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(i, type) {
11338jQuery.fn[type] = function(fn) {
11339return this.on(type, fn);
11340}
11341;
11342});
11343jQuery._evalUrl = function(url) {
11344return jQuery.ajax({
11345url: url,
11346type: "GET",
11347dataType: "script",
11348async: false,
11349global: false,
11350"throws": true
11351});
11352}
11353;
11354jQuery.fn.extend({
11355wrapAll: function(html) {
11356if (jQuery.isFunction(html)) {
11357return this.each(function(i) {
11358jQuery(this).wrapAll(html.call(this, i));
11359});
11360}
11361if (this[0]) {
11362var wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
11363if (this[0].parentNode) {
11364wrap.insertBefore(this[0]);
11365}
11366wrap.map(function() {
11367var elem = this;
11368while (elem.firstChild && elem.firstChild.nodeType === 1) {
11369elem = elem.firstChild;
11370}
11371return elem;
11372}).append(this);
11373}
11374return this;
11375},
11376wrapInner: function(html) {
11377if (jQuery.isFunction(html)) {
11378return this.each(function(i) {
11379jQuery(this).wrapInner(html.call(this, i));
11380});
11381}
11382return this.each(function() {
11383var self = jQuery(this)
11384  , contents = self.contents();
11385if (contents.length) {
11386contents.wrapAll(html);
11387} else {
11388self.append(html);
11389}
11390});
11391},
11392wrap: function(html) {
11393var isFunction = jQuery.isFunction(html);
11394return this.each(function(i) {
11395jQuery(this).wrapAll(isFunction ? html.call(this, i) : html);
11396});
11397},
11398unwrap: function() {
11399return this.parent().each(function() {
11400if (!jQuery.nodeName(this, "body")) {
11401jQuery(this).replaceWith(this.childNodes);
11402}
11403}).end();
11404}
11405});
11406jQuery.expr.filters.hidden = function(elem) {
11407return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || (!support.reliableHiddenOffsets() && ((elem.style && elem.style.display) || jQuery.css(elem, "display")) === "none");
11408}
11409;
11410jQuery.expr.filters.visible = function(elem) {
11411return !jQuery.expr.filters.hidden(elem);
11412}
11413;
11414var r20 = /%20/g
11415  , rbracket = /\[\]$/
11416  , rCRLF = /\r?\n/g
11417  , rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i
11418  , rsubmittable = /^(?:input|select|textarea|keygen)/i;
11419function buildParams(prefix, obj, traditional, add) {
11420var name;
11421if (jQuery.isArray(obj)) {
11422jQuery.each(obj, function(i, v) {
11423if (traditional || rbracket.test(prefix)) {
11424add(prefix, v);
11425} else {
11426buildParams(prefix + "[" + (typeof v === "object" ? i : "") + "]", v, traditional, add);
11427}
11428});
11429} else if (!traditional && jQuery.type(obj) === "object") {
11430for (name in obj) {
11431buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
11432}
11433} else {
11434add(prefix, obj);
11435}
11436}
11437jQuery.param = function(a, traditional) {
11438var prefix, s = [], add = function(key, value) {
11439value = jQuery.isFunction(value) ? value() : (value == null ? "" : value);
11440s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
11441};
11442if (traditional === undefined) {
11443traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
11444}
11445if (jQuery.isArray(a) || (a.jquery && !jQuery.isPlainObject(a))) {
11446jQuery.each(a, function() {
11447add(this.name, this.value);
11448});
11449} else {
11450for (prefix in a) {
11451buildParams(prefix, a[prefix], traditional, add);
11452}
11453}
11454return s.join("&").replace(r20, "+");
11455}
11456;
11457jQuery.fn.extend({
11458serialize: function() {
11459return jQuery.param(this.serializeArray());
11460},
11461serializeArray: function() {
11462return this.map(function() {
11463var elements = jQuery.prop(this, "elements");
11464return elements ? jQuery.makeArray(elements) : this;
11465}).filter(function() {
11466var type = this.type;
11467return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !rcheckableType.test(type));
11468}).map(function(i, elem) {
11469var val = jQuery(this).val();
11470return val == null ? null : jQuery.isArray(val) ? jQuery.map(val, function(val) {
11471return {
11472name: elem.name,
11473value: val.replace(rCRLF, "\r\n")
11474};
11475}) : {
11476name: elem.name,
11477value: val.replace(rCRLF, "\r\n")
11478};
11479}).get();
11480}
11481});
11482jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ? function() {
11483return !this.isLocal && /^(get|post|head|put|delete|options)$/i.test(this.type) && createStandardXHR() || createActiveXHR();
11484}
11485: createStandardXHR;
11486var xhrId = 0
11487  , xhrCallbacks = {}
11488  , xhrSupported = jQuery.ajaxSettings.xhr();
11489if (window.ActiveXObject) {
11490jQuery(window).on("unload", function() {
11491for (var key in xhrCallbacks) {
11492xhrCallbacks[key](undefined, true);
11493}
11494});
11495}
11496support.cors = !!xhrSupported && ("withCredentials"in xhrSupported);
11497xhrSupported = support.ajax = !!xhrSupported;
11498if (xhrSupported) {
11499jQuery.ajaxTransport(function(options) {
11500if (!options.crossDomain || support.cors) {
11501var callback;
11502return {
11503send: function(headers, complete) {
11504var i, xhr = options.xhr(), id = ++xhrId;
11505xhr.open(options.type, options.url, options.async, options.username, options.password);
11506if (options.xhrFields) {
11507for (i in options.xhrFields) {
11508xhr[i] = options.xhrFields[i];
11509}
11510}
11511if (options.mimeType && xhr.overrideMimeType) {
11512xhr.overrideMimeType(options.mimeType);
11513}
11514if (!options.crossDomain && !headers["X-Requested-With"]) {
11515headers["X-Requested-With"] = "XMLHttpRequest";
11516}
11517for (i in headers) {
11518if (headers[i] !== undefined) {
11519xhr.setRequestHeader(i, headers[i] + "");
11520}
11521}
11522xhr.send((options.hasContent && options.data) || null);
11523callback = function(_, isAbort) {
11524var status, statusText, responses;
11525if (callback && (isAbort || xhr.readyState === 4)) {
11526delete xhrCallbacks[id];
11527callback = undefined;
11528xhr.onreadystatechange = jQuery.noop;
11529if (isAbort) {
11530if (xhr.readyState !== 4) {
11531xhr.abort();
11532}
11533} else {
11534responses = {};
11535status = xhr.status;
11536if (typeof xhr.responseText === "string") {
11537responses.text = xhr.responseText;
11538}
11539try {
11540statusText = xhr.statusText;
11541} catch (e) {
11542statusText = "";
11543}
11544if (!status && options.isLocal && !options.crossDomain) {
11545status = responses.text ? 200 : 404;
11546} else if (status === 1223) {
11547status = 204;
11548}
11549}
11550}
11551if (responses) {
11552complete(status, statusText, responses, xhr.getAllResponseHeaders());
11553}
11554}
11555;
11556if (!options.async) {
11557callback();
11558} else if (xhr.readyState === 4) {
11559setTimeout(callback);
11560} else {
11561xhr.onreadystatechange = xhrCallbacks[id] = callback;
11562}
11563},
11564abort: function() {
11565if (callback) {
11566callback(undefined, true);
11567}
11568}
11569};
11570}
11571});
11572}
11573function createStandardXHR() {
11574try {
11575return new window.XMLHttpRequest();
11576} catch (e) {}
11577}
11578function createActiveXHR() {
11579try {
11580return new window.ActiveXObject("Microsoft.XMLHTTP");
11581} catch (e) {}
11582}
11583jQuery.ajaxSetup({
11584accepts: {
11585script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
11586},
11587contents: {
11588script: /(?:java|ecma)script/
11589},
11590converters: {
11591"text script": function(text) {
11592jQuery.globalEval(text);
11593return text;
11594}
11595}
11596});
11597jQuery.ajaxPrefilter("script", function(s) {
11598if (s.cache === undefined) {
11599s.cache = false;
11600}
11601if (s.crossDomain) {
11602s.type = "GET";
11603s.global = false;
11604}
11605});
11606jQuery.ajaxTransport("script", function(s) {
11607if (s.crossDomain) {
11608var script, head = document.head || jQuery("head")[0] || document.documentElement;
11609return {
11610send: function(_, callback) {
11611script = document.createElement("script");
11612script.async = true;
11613if (s.scriptCharset) {
11614script.charset = s.scriptCharset;
11615}
11616script.src = s.url;
11617script.onload = script.onreadystatechange = function(_, isAbort) {
11618if (isAbort || !script.readyState || /loaded|complete/.test(script.readyState)) {
11619script.onload = script.onreadystatechange = null;
11620if (script.parentNode) {
11621script.parentNode.removeChild(script);
11622}
11623script = null;
11624if (!isAbort) {
11625callback(200, "success");
11626}
11627}
11628}
11629;
11630head.insertBefore(script, head.firstChild);
11631},
11632abort: function() {
11633if (script) {
11634script.onload(undefined, true);
11635}
11636}
11637};
11638}
11639});
11640var oldCallbacks = []
11641  , rjsonp = /(=)\?(?=&|$)|\?\?/;
11642jQuery.ajaxSetup({
11643jsonp: "callback",
11644jsonpCallback: function() {
11645var callback = oldCallbacks.pop() || (jQuery.expando + "_" + (nonce++));
11646this[callback] = true;
11647return callback;
11648}
11649});
11650jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) {
11651var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ? "url" : typeof s.data === "string" && !(s.contentType || "").indexOf("application/x-www-form-urlencoded") && rjsonp.test(s.data) && "data");
11652if (jsonProp || s.dataTypes[0] === "jsonp") {
11653callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback;
11654if (jsonProp) {
11655s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName);
11656} else if (s.jsonp !== false) {
11657s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName;
11658}
11659s.converters["script json"] = function() {
11660if (!responseContainer) {
11661jQuery.error(callbackName + " was not called");
11662}
11663return responseContainer[0];
11664}
11665;
11666s.dataTypes[0] = "json";
11667overwritten = window[callbackName];
11668window[callbackName] = function() {
11669responseContainer = arguments;
11670}
11671;
11672jqXHR.always(function() {
11673window[callbackName] = overwritten;
11674if (s[callbackName]) {
11675s.jsonpCallback = originalSettings.jsonpCallback;
11676oldCallbacks.push(callbackName);
11677}
11678if (responseContainer && jQuery.isFunction(overwritten)) {
11679overwritten(responseContainer[0]);
11680}
11681responseContainer = overwritten = undefined;
11682});
11683return "script";
11684}
11685});
11686jQuery.parseHTML = function(data, context, keepScripts) {
11687if (!data || typeof data !== "string") {
11688return null;
11689}
11690if (typeof context === "boolean") {
11691keepScripts = context;
11692context = false;
11693}
11694context = context || document;
11695var parsed = rsingleTag.exec(data)
11696  , scripts = !keepScripts && [];
11697if (parsed) {
11698return [context.createElement(parsed[1])];
11699}
11700parsed = jQuery.buildFragment([data], context, scripts);
11701if (scripts && scripts.length) {
11702jQuery(scripts).remove();
11703}
11704return jQuery.merge([], parsed.childNodes);
11705}
11706;
11707var _load = jQuery.fn.load;
11708jQuery.fn.load = function(url, params, callback) {
11709if (typeof url !== "string" && _load) {
11710return _load.apply(this, arguments);
11711}
11712var selector, response, type, self = this, off = url.indexOf(" ");
11713if (off >= 0) {
11714selector = jQuery.trim(url.slice(off, url.length));
11715url = url.slice(0, off);
11716}
11717if (jQuery.isFunction(params)) {
11718callback = params;
11719params = undefined;
11720} else if (params && typeof params === "object") {
11721type = "POST";
11722}
11723if (self.length > 0) {
11724jQuery.ajax({
11725url: url,
11726type: type,
11727dataType: "html",
11728data: params
11729}).done(function(responseText) {
11730response = arguments;
11731self.html(selector ? jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) : responseText);
11732}).complete(callback && function(jqXHR, status) {
11733self.each(callback, response || [jqXHR.responseText, status, jqXHR]);
11734}
11735);
11736}
11737return this;
11738}
11739;
11740jQuery.expr.filters.animated = function(elem) {
11741return jQuery.grep(jQuery.timers, function(fn) {
11742return elem === fn.elem;
11743}).length;
11744}
11745;
11746var docElem = window.document.documentElement;
11747function getWindow(elem) {
11748return jQuery.isWindow(elem) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false;
11749}
11750jQuery.offset = {
11751setOffset: function(elem, options, i) {
11752var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position = jQuery.css(elem, "position"), curElem = jQuery(elem), props = {};
11753if (position === "static") {
11754elem.style.position = "relative";
11755}
11756curOffset = curElem.offset();
11757curCSSTop = jQuery.css(elem, "top");
11758curCSSLeft = jQuery.css(elem, "left");
11759calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1;
11760if (calculatePosition) {
11761curPosition = curElem.position();
11762curTop = curPosition.top;
11763curLeft = curPosition.left;
11764} else {
11765curTop = parseFloat(curCSSTop) || 0;
11766curLeft = parseFloat(curCSSLeft) || 0;
11767}
11768if (jQuery.isFunction(options)) {
11769options = options.call(elem, i, curOffset);
11770}
11771if (options.top != null) {
11772props.top = (options.top - curOffset.top) + curTop;
11773}
11774if (options.left != null) {
11775props.left = (options.left - curOffset.left) + curLeft;
11776}
11777if ("using"in options) {
11778options.using.call(elem, props);
11779} else {
11780curElem.css(props);
11781}
11782}
11783};
11784jQuery.fn.extend({
11785offset: function(options) {
11786if (arguments.length) {
11787return options === undefined ? this : this.each(function(i) {
11788jQuery.offset.setOffset(this, options, i);
11789});
11790}
11791var docElem, win, box = {
11792top: 0,
11793left: 0
11794}, elem = this[0], doc = elem && elem.ownerDocument;
11795if (!doc) {
11796return;
11797}
11798docElem = doc.documentElement;
11799if (!jQuery.contains(docElem, elem)) {
11800return box;
11801}
11802if (typeof elem.getBoundingClientRect !== strundefined) {
11803box = elem.getBoundingClientRect();
11804}
11805win = getWindow(doc);
11806return {
11807top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0),
11808left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0)
11809};
11810},
11811position: function() {
11812if (!this[0]) {
11813return;
11814}
11815var offsetParent, offset, parentOffset = {
11816top: 0,
11817left: 0
11818}, elem = this[0];
11819if (jQuery.css(elem, "position") === "fixed") {
11820offset = elem.getBoundingClientRect();
11821} else {
11822offsetParent = this.offsetParent();
11823offset = this.offset();
11824if (!jQuery.nodeName(offsetParent[0], "html")) {
11825parentOffset = offsetParent.offset();
11826}
11827parentOffset.top += jQuery.css(offsetParent[0], "borderTopWidth", true);
11828parentOffset.left += jQuery.css(offsetParent[0], "borderLeftWidth", true);
11829}
11830return {
11831top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
11832left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
11833};
11834},
11835offsetParent: function() {
11836return this.map(function() {
11837var offsetParent = this.offsetParent || docElem;
11838while (offsetParent && (!jQuery.nodeName(offsetParent, "html") && jQuery.css(offsetParent, "position") === "static")) {
11839offsetParent = offsetParent.offsetParent;
11840}
11841return offsetParent || docElem;
11842});
11843}
11844});
11845jQuery.each({
11846scrollLeft: "pageXOffset",
11847scrollTop: "pageYOffset"
11848}, function(method, prop) {
11849var top = /Y/.test(prop);
11850jQuery.fn[method] = function(val) {
11851return access(this, function(elem, method, val) {
11852var win = getWindow(elem);
11853if (val === undefined) {
11854return win ? (prop in win) ? win[prop] : win.document.documentElement[method] : elem[method];
11855}
11856if (win) {
11857win.scrollTo(!top ? val : jQuery(win).scrollLeft(), top ? val : jQuery(win).scrollTop());
11858} else {
11859elem[method] = val;
11860}
11861}, method, val, arguments.length, null);
11862}
11863;
11864});
11865jQuery.each(["top", "left"], function(i, prop) {
11866jQuery.cssHooks[prop] = addGetHookIf(support.pixelPosition, function(elem, computed) {
11867if (computed) {
11868computed = curCSS(elem, prop);
11869return rnumnonpx.test(computed) ? jQuery(elem).position()[prop] + "px" : computed;
11870}
11871});
11872});
11873jQuery.each({
11874Height: "height",
11875Width: "width"
11876}, function(name, type) {
11877jQuery.each({
11878padding: "inner" + name,
11879content: type,
11880"": "outer" + name
11881}, function(defaultExtra, funcName) {
11882jQuery.fn[funcName] = function(margin, value) {
11883var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean")
11884  , extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
11885return access(this, function(elem, type, value) {
11886var doc;
11887if (jQuery.isWindow(elem)) {
11888return elem.document.documentElement["client" + name];
11889}
11890if (elem.nodeType === 9) {
11891doc = elem.documentElement;
11892return Math.max(elem.body["scroll" + name], doc["scroll" + name], elem.body["offset" + name], doc["offset" + name], doc["client" + name]);
11893}
11894return value === undefined ? jQuery.css(elem, type, extra) : jQuery.style(elem, type, value, extra);
11895}, type, chainable ? margin : undefined, chainable, null);
11896}
11897;
11898});
11899});
11900jQuery.fn.size = function() {
11901return this.length;
11902}
11903;
11904jQuery.fn.andSelf = jQuery.fn.addBack;
11905if (typeof define === "function" && define.amd) {
11906define("jquery", [], function() {
11907return jQuery;
11908});
11909}
11910var _jQuery = window.jQuery
11911  , _$ = window.$;
11912jQuery.noConflict = function(deep) {
11913if (window.$ === jQuery) {
11914window.$ = _$;
11915}
11916if (deep && window.jQuery === jQuery) {
11917window.jQuery = _jQuery;
11918}
11919return jQuery;
11920}
11921;
11922if (typeof noGlobal === strundefined) {
11923window.jQuery = window.$ = jQuery;
11924}
11925return jQuery;
11926}));
11927;
11928/* /web/static/lib/jquery.ui/jquery-ui.js defined in bundle 'web.assets_common' */
11929(function(factory) {
11930if (typeof define === "function" && define.amd) {
11931define(["jquery"], factory);
11932} else {
11933factory(jQuery);
11934}
11935}(function($) {
11936$.ui = $.ui || {};
11937$.extend($.ui, {
11938version: "1.11.4",
11939keyCode: {
11940BACKSPACE: 8,
11941COMMA: 188,
11942DELETE: 46,
11943DOWN: 40,
11944END: 35,
11945ENTER: 13,
11946ESCAPE: 27,
11947HOME: 36,
11948LEFT: 37,
11949PAGE_DOWN: 34,
11950PAGE_UP: 33,
11951PERIOD: 190,
11952RIGHT: 39,
11953SPACE: 32,
11954TAB: 9,
11955UP: 38
11956}
11957});
11958$.fn.extend({
11959scrollParent: function(includeHidden) {
11960var position = this.css("position")
11961  , excludeStaticParent = position === "absolute"
11962  , overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/
11963  , scrollParent = this.parents().filter(function() {
11964var parent = $(this);
11965if (excludeStaticParent && parent.css("position") === "static") {
11966return false;
11967}
11968return overflowRegex.test(parent.css("overflow") + parent.css("overflow-y") + parent.css("overflow-x"));
11969}).eq(0);
11970return position === "fixed" || !scrollParent.length ? $(this[0].ownerDocument || document) : scrollParent;
11971},
11972uniqueId: (function() {
11973var uuid = 0;
11974return function() {
11975return this.each(function() {
11976if (!this.id) {
11977this.id = "ui-id-" + (++uuid);
11978}
11979});
11980}
11981;
11982}
11983)(),
11984removeUniqueId: function() {
11985return this.each(function() {
11986if (/^ui-id-\d+$/.test(this.id)) {
11987$(this).removeAttr("id");
11988}
11989});
11990}
11991});
11992function focusable(element, isTabIndexNotNaN) {
11993var map, mapName, img, nodeName = element.nodeName.toLowerCase();
11994if ("area" === nodeName) {
11995map = element.parentNode;
11996mapName = map.name;
11997if (!element.href || !mapName || map.nodeName.toLowerCase() !== "map") {
11998return false;
11999}
12000img = $("img[usemap='#" + mapName + "']")[0];
12001return !!img && visible(img);
12002}
12003return (/^(input|select|textarea|button|object)$/.test(nodeName) ? !element.disabled : "a" === nodeName ? element.href || isTabIndexNotNaN : isTabIndexNotNaN) && visible(element);
12004}
12005function visible(element) {
12006return $.expr.filters.visible(element) && !$(element).parents().addBack().filter(function() {
12007return $.css(this, "visibility") === "hidden";
12008}).length;
12009}
12010$.extend($.expr[":"], {
12011data: $.expr.createPseudo ? $.expr.createPseudo(function(dataName) {
12012return function(elem) {
12013return !!$.data(elem, dataName);
12014}
12015;
12016}) : function(elem, i, match) {
12017return !!$.data(elem, match[3]);
12018}
12019,
12020focusable: function(element) {
12021return focusable(element, !isNaN($.attr(element, "tabindex")));
12022},
12023tabbable: function(element) {
12024var tabIndex = $.attr(element, "tabindex")
12025  , isTabIndexNaN = isNaN(tabIndex);
12026return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN);
12027}
12028});
12029if (!$("<a>").outerWidth(1).jquery) {
12030$.each(["Width", "Height"], function(i, name) {
12031var side = name === "Width" ? ["Left", "Right"] : ["Top", "Bottom"]
12032  , type = name.toLowerCase()
12033  , orig = {
12034innerWidth: $.fn.innerWidth,
12035innerHeight: $.fn.innerHeight,
12036outerWidth: $.fn.outerWidth,
12037outerHeight: $.fn.outerHeight
12038};
12039function reduce(elem, size, border, margin) {
12040$.each(side, function() {
12041size -= parseFloat($.css(elem, "padding" + this)) || 0;
12042if (border) {
12043size -= parseFloat($.css(elem, "border" + this + "Width")) || 0;
12044}
12045if (margin) {
12046size -= parseFloat($.css(elem, "margin" + this)) || 0;
12047}
12048});
12049return size;
12050}
vendor: 4,218 bytes, lines 12051-12226
12051$.fn["inner" + name] = function(size) {
12052if (size === undefined) {
12053return orig["inner" + name].call(this);
12054}
12055return this.each(function() {
12056$(this).css(type, reduce(this, size) + "px");
12057});
12058}
12059;
12060$.fn["outer" + name] = function(size, margin) {
12061if (typeof size !== "number") {
12062return orig["outer" + name].call(this, size);
12063}
12064return this.each(function() {
12065$(this).css(type, reduce(this, size, true, margin) + "px");
12066});
12067}
12068;
12069});
12070}
12071if (!$.fn.addBack) {
12072$.fn.addBack = function(selector) {
12073return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));
12074}
12075;
12076}
12077if ($("<a>").data("a-b", "a").removeData("a-b").data("a-b")) {
12078$.fn.removeData = (function(removeData) {
12079return function(key) {
12080if (arguments.length) {
12081return removeData.call(this, $.camelCase(key));
12082} else {
12083return removeData.call(this);
12084}
12085}
12086;
12087}
12088)($.fn.removeData);
12089}
12090$.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());
12091$.fn.extend({
12092focus: (function(orig) {
12093return function(delay, fn) {
12094return typeof delay === "number" ? this.each(function() {
12095var elem = this;
12096setTimeout(function() {
12097$(elem).focus();
12098if (fn) {
12099fn.call(elem);
12100}
12101}, delay);
12102}) : orig.apply(this, arguments);
12103}
12104;
12105}
12106)($.fn.focus),
12107disableSelection: (function() {
12108var eventType = "onselectstart"in document.createElement("div") ? "selectstart" : "mousedown";
12109return function() {
12110return this.bind(eventType + ".ui-disableSelection", function(event) {
12111event.preventDefault();
12112});
12113}
12114;
12115}
12116)(),
12117enableSelection: function() {
12118return this.unbind(".ui-disableSelection");
12119},
12120zIndex: function(zIndex) {
12121if (zIndex !== undefined) {
12122return this.css("zIndex", zIndex);
12123}
12124if (this.length) {
12125var elem = $(this[0]), position, value;
12126while (elem.length && elem[0] !== document) {
12127position = elem.css("position");
12128if (position === "absolute" || position === "relative" || position === "fixed") {
12129value = parseInt(elem.css("zIndex"), 10);
12130if (!isNaN(value) && value !== 0) {
12131return value;
12132}
12133}
12134elem = elem.parent();
12135}
12136}
12137return 0;
12138}
12139});
12140$.ui.plugin = {
12141add: function(module, option, set) {
12142var i, proto = $.ui[module].prototype;
12143for (i in set) {
12144proto.plugins[i] = proto.plugins[i] || [];
12145proto.plugins[i].push([option, set[i]]);
12146}
12147},
12148call: function(instance, name, args, allowDisconnected) {
12149var i, set = instance.plugins[name];
12150if (!set) {
12151return;
12152}
12153if (!allowDisconnected && (!instance.element[0].parentNode || instance.element[0].parentNode.nodeType === 11)) {
12154return;
12155}
12156for (i = 0; i < set.length; i++) {
12157if (instance.options[set[i][0]]) {
12158set[i][1].apply(instance.element, args);
12159}
12160}
12161}
12162};
12163var widget_uuid = 0
12164  , widget_slice = Array.prototype.slice;
12165$.cleanData = (function(orig) {
12166return function(elems) {
12167var events, elem, i;
12168for (i = 0; (elem = elems[i]) != null; i++) {
12169try {
12170events = $._data(elem, "events");
12171if (events && events.remove) {
12172$(elem).triggerHandler("remove");
12173}
12174} catch (e) {}
12175}
12176orig(elems);
12177}
12178;
12179}
12180)($.cleanData);
12181$.widget = function(name, base, prototype) {
12182var fullName, existingConstructor, constructor, basePrototype, proxiedPrototype = {}, namespace = name.split(".")[0];
12183name = name.split(".")[1];
12184fullName = namespace + "-" + name;
12185if (!prototype) {
12186prototype = base;
12187base = $.Widget;
12188}
12189$.expr[":"][fullName.toLowerCase()] = function(elem) {
12190return !!$.data(elem, fullName);
12191}
12192;
12193$[namespace] = $[namespace] || {};
12194existingConstructor = $[namespace][name];
12195constructor = $[namespace][name] = function(options, element) {
12196if (!this._createWidget) {
12197return new constructor(options,element);
12198}
12199if (arguments.length) {
12200this._createWidget(options, element);
12201}
12202}
12203;
12204$.extend(constructor, existingConstructor, {
12205version: prototype.version,
12206_proto: $.extend({}, prototype),
12207_childConstructors: []
12208});
12209basePrototype = new base();
12210basePrototype.options = $.widget.extend({}, basePrototype.options);
12211$.each(prototype, function(prop, value) {
12212if (!$.isFunction(value)) {
12213proxiedPrototype[prop] = value;
12214return;
12215}
12216proxiedPrototype[prop] = (function() {
12217var _super = function() {
12218return base.prototype[prop].apply(this, arguments);
12219}
12220  , _superApply = function(args) {
12221return base.prototype[prop].apply(this, args);
12222};
12223return function() {
12224var __super = this._super, __superApply = this._superApply, returnValue;
12225this._super = _super;
12226this._superApply = _superApply;
vendor: 12,242 bytes, lines 12227-12654
12227returnValue = value.apply(this, arguments);
12228this._super = __super;
12229this._superApply = __superApply;
12230return returnValue;
12231}
12232;
12233}
12234)();
12235});
12236constructor.prototype = $.widget.extend(basePrototype, {
12237widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
12238}, proxiedPrototype, {
12239constructor: constructor,
12240namespace: namespace,
12241widgetName: name,
12242widgetFullName: fullName
12243});
12244if (existingConstructor) {
12245$.each(existingConstructor._childConstructors, function(i, child) {
12246var childPrototype = child.prototype;
12247$.widget(childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto);
12248});
12249delete existingConstructor._childConstructors;
12250} else {
12251base._childConstructors.push(constructor);
12252}
12253$.widget.bridge(name, constructor);
12254return constructor;
12255}
12256;
12257$.widget.extend = function(target) {
12258var input = widget_slice.call(arguments, 1), inputIndex = 0, inputLength = input.length, key, value;
12259for (; inputIndex < inputLength; inputIndex++) {
12260for (key in input[inputIndex]) {
12261value = input[inputIndex][key];
12262if (input[inputIndex].hasOwnProperty(key) && value !== undefined) {
12263if ($.isPlainObject(value)) {
12264target[key] = $.isPlainObject(target[key]) ? $.widget.extend({}, target[key], value) : $.widget.extend({}, value);
12265} else {
12266target[key] = value;
12267}
12268}
12269}
12270}
12271return target;
12272}
12273;
12274$.widget.bridge = function(name, object) {
12275var fullName = object.prototype.widgetFullName || name;
12276$.fn[name] = function(options) {
12277var isMethodCall = typeof options === "string"
12278  , args = widget_slice.call(arguments, 1)
12279  , returnValue = this;
12280if (isMethodCall) {
12281this.each(function() {
12282var methodValue, instance = $.data(this, fullName);
12283if (options === "instance") {
12284returnValue = instance;
12285return false;
12286}
12287if (!instance) {
12288return $.error("cannot call methods on " + name + " prior to initialization; " + "attempted to call method '" + options + "'");
12289}
12290if (!$.isFunction(instance[options]) || options.charAt(0) === "_") {
12291return $.error("no such method '" + options + "' for " + name + " widget instance");
12292}
12293methodValue = instance[options].apply(instance, args);
12294if (methodValue !== instance && methodValue !== undefined) {
12295returnValue = methodValue && methodValue.jquery ? returnValue.pushStack(methodValue.get()) : methodValue;
12296return false;
12297}
12298});
12299} else {
12300if (args.length) {
12301options = $.widget.extend.apply(null, [options].concat(args));
12302}
12303this.each(function() {
12304var instance = $.data(this, fullName);
12305if (instance) {
12306instance.option(options || {});
12307if (instance._init) {
12308instance._init();
12309}
12310} else {
12311$.data(this, fullName, new object(options,this));
12312}
12313});
12314}
12315return returnValue;
12316}
12317;
12318}
12319;
12320$.Widget = function() {}
12321;
12322$.Widget._childConstructors = [];
12323$.Widget.prototype = {
12324widgetName: "widget",
12325widgetEventPrefix: "",
12326defaultElement: "<div>",
12327options: {
12328disabled: false,
12329create: null
12330},
12331_createWidget: function(options, element) {
12332element = $(element || this.defaultElement || this)[0];
12333this.element = $(element);
12334this.uuid = widget_uuid++;
12335this.eventNamespace = "." + this.widgetName + this.uuid;
12336this.bindings = $();
12337this.hoverable = $();
12338this.focusable = $();
12339if (element !== this) {
12340$.data(element, this.widgetFullName, this);
12341this._on(true, this.element, {
12342remove: function(event) {
12343if (event.target === element) {
12344this.destroy();
12345}
12346}
12347});
12348this.document = $(element.style ? element.ownerDocument : element.document || element);
12349this.window = $(this.document[0].defaultView || this.document[0].parentWindow);
12350}
12351this.options = $.widget.extend({}, this.options, this._getCreateOptions(), options);
12352this._create();
12353this._trigger("create", null, this._getCreateEventData());
12354this._init();
12355},
12356_getCreateOptions: $.noop,
12357_getCreateEventData: $.noop,
12358_create: $.noop,
12359_init: $.noop,
12360destroy: function() {
12361this._destroy();
12362this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData($.camelCase(this.widgetFullName));
12363this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName + "-disabled " + "ui-state-disabled");
12364this.bindings.unbind(this.eventNamespace);
12365this.hoverable.removeClass("ui-state-hover");
12366this.focusable.removeClass("ui-state-focus");
12367},
12368_destroy: $.noop,
12369widget: function() {
12370return this.element;
12371},
12372option: function(key, value) {
12373var options = key, parts, curOption, i;
12374if (arguments.length === 0) {
12375return $.widget.extend({}, this.options);
12376}
12377if (typeof key === "string") {
12378options = {};
12379parts = key.split(".");
12380key = parts.shift();
12381if (parts.length) {
12382curOption = options[key] = $.widget.extend({}, this.options[key]);
12383for (i = 0; i < parts.length - 1; i++) {
12384curOption[parts[i]] = curOption[parts[i]] || {};
12385curOption = curOption[parts[i]];
12386}
12387key = parts.pop();
12388if (arguments.length === 1) {
12389return curOption[key] === undefined ? null : curOption[key];
12390}
12391curOption[key] = value;
12392} else {
12393if (arguments.length === 1) {
12394return this.options[key] === undefined ? null : this.options[key];
12395}
12396options[key] = value;
12397}
12398}
12399this._setOptions(options);
12400return this;
12401},
12402_setOptions: function(options) {
12403var key;
12404for (key in options) {
12405this._setOption(key, options[key]);
12406}
12407return this;
12408},
12409_setOption: function(key, value) {
12410this.options[key] = value;
12411if (key === "disabled") {
12412this.widget().toggleClass(this.widgetFullName + "-disabled", !!value);
12413if (value) {
12414this.hoverable.removeClass("ui-state-hover");
12415this.focusable.removeClass("ui-state-focus");
12416}
12417}
12418return this;
12419},
12420enable: function() {
12421return this._setOptions({
12422disabled: false
12423});
12424},
12425disable: function() {
12426return this._setOptions({
12427disabled: true
12428});
12429},
12430_on: function(suppressDisabledCheck, element, handlers) {
12431var delegateElement, instance = this;
12432if (typeof suppressDisabledCheck !== "boolean") {
12433handlers = element;
12434element = suppressDisabledCheck;
12435suppressDisabledCheck = false;
12436}
12437if (!handlers) {
12438handlers = element;
12439element = this.element;
12440delegateElement = this.widget();
12441} else {
12442element = delegateElement = $(element);
12443this.bindings = this.bindings.add(element);
12444}
12445$.each(handlers, function(event, handler) {
12446function handlerProxy() {
12447if (!suppressDisabledCheck && (instance.options.disabled === true || $(this).hasClass("ui-state-disabled"))) {
12448return;
12449}
12450return (typeof handler === "string" ? instance[handler] : handler).apply(instance, arguments);
12451}
12452if (typeof handler !== "string") {
12453handlerProxy.guid = handler.guid = handler.guid || handlerProxy.guid || $.guid++;
12454}
12455var match = event.match(/^([\w:-]*)\s*(.*)$/)
12456  , eventName = match[1] + instance.eventNamespace
12457  , selector = match[2];
12458if (selector) {
12459delegateElement.delegate(selector, eventName, handlerProxy);
12460} else {
12461element.bind(eventName, handlerProxy);
12462}
12463});
12464},
12465_off: function(element, eventName) {
12466eventName = (eventName || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace;
12467element.unbind(eventName).undelegate(eventName);
12468this.bindings = $(this.bindings.not(element).get());
12469this.focusable = $(this.focusable.not(element).get());
12470this.hoverable = $(this.hoverable.not(element).get());
12471},
12472_delay: function(handler, delay) {
12473function handlerProxy() {
12474return (typeof handler === "string" ? instance[handler] : handler).apply(instance, arguments);
12475}
12476var instance = this;
12477return setTimeout(handlerProxy, delay || 0);
12478},
12479_hoverable: function(element) {
12480this.hoverable = this.hoverable.add(element);
12481this._on(element, {
12482mouseenter: function(event) {
12483$(event.currentTarget).addClass("ui-state-hover");
12484},
12485mouseleave: function(event) {
12486$(event.currentTarget).removeClass("ui-state-hover");
12487}
12488});
12489},
12490_focusable: function(element) {
12491this.focusable = this.focusable.add(element);
12492this._on(element, {
12493focusin: function(event) {
12494$(event.currentTarget).addClass("ui-state-focus");
12495},
12496focusout: function(event) {
12497$(event.currentTarget).removeClass("ui-state-focus");
12498}
12499});
12500},
12501_trigger: function(type, event, data) {
12502var prop, orig, callback = this.options[type];
12503data = data || {};
12504event = $.Event(event);
12505event.type = (type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type).toLowerCase();
12506event.target = this.element[0];
12507orig = event.originalEvent;
12508if (orig) {
12509for (prop in orig) {
12510if (!(prop in event)) {
12511event[prop] = orig[prop];
12512}
12513}
12514}
12515this.element.trigger(event, data);
12516return !($.isFunction(callback) && callback.apply(this.element[0], [event].concat(data)) === false || event.isDefaultPrevented());
12517}
12518};
12519$.each({
12520show: "fadeIn",
12521hide: "fadeOut"
12522}, function(method, defaultEffect) {
12523$.Widget.prototype["_" + method] = function(element, options, callback) {
12524if (typeof options === "string") {
12525options = {
12526effect: options
12527};
12528}
12529var hasOptions, effectName = !options ? method : options === true || typeof options === "number" ? defaultEffect : options.effect || defaultEffect;
12530options = options || {};
12531if (typeof options === "number") {
12532options = {
12533duration: options
12534};
12535}
12536hasOptions = !$.isEmptyObject(options);
12537options.complete = callback;
12538if (options.delay) {
12539element.delay(options.delay);
12540}
12541if (hasOptions && $.effects && $.effects.effect[effectName]) {
12542element[method](options);
12543} else if (effectName !== method && element[effectName]) {
12544element[effectName](options.duration, options.easing, callback);
12545} else {
12546element.queue(function(next) {
12547$(this)[method]();
12548if (callback) {
12549callback.call(element[0]);
12550}
12551next();
12552});
12553}
12554}
12555;
12556});
12557var widget = $.widget;
12558var mouseHandled = false;
12559$(document).mouseup(function() {
12560mouseHandled = false;
12561});
12562var mouse = $.widget("ui.mouse", {
12563version: "1.11.4",
12564options: {
12565cancel: "input,textarea,button,select,option",
12566distance: 1,
12567delay: 0
12568},
12569_mouseInit: function() {
12570var that = this;
12571this.element.bind("mousedown." + this.widgetName, function(event) {
12572return that._mouseDown(event);
12573}).bind("click." + this.widgetName, function(event) {
12574if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
12575$.removeData(event.target, that.widgetName + ".preventClickEvent");
12576event.stopImmediatePropagation();
12577return false;
12578}
12579});
12580this.started = false;
12581},
12582_mouseDestroy: function() {
12583this.element.unbind("." + this.widgetName);
12584if (this._mouseMoveDelegate) {
12585this.document.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
12586}
12587},
12588_mouseDown: function(event) {
12589if (mouseHandled) {
12590return;
12591}
12592this._mouseMoved = false;
12593(this._mouseStarted && this._mouseUp(event));
12594this._mouseDownEvent = event;
12595var that = this
12596  , btnIsLeft = (event.which === 1)
12597  , elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
12598if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
12599return true;
12600}
12601this.mouseDelayMet = !this.options.delay;
12602if (!this.mouseDelayMet) {
12603this._mouseDelayTimer = setTimeout(function() {
12604that.mouseDelayMet = true;
12605}, this.options.delay);
12606}
12607if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
12608this._mouseStarted = (this._mouseStart(event) !== false);
12609if (!this._mouseStarted) {
12610event.preventDefault();
12611return true;
12612}
12613}
12614if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) {
12615$.removeData(event.target, this.widgetName + ".preventClickEvent");
12616}
12617this._mouseMoveDelegate = function(event) {
12618return that._mouseMove(event);
12619}
12620;
12621this._mouseUpDelegate = function(event) {
12622return that._mouseUp(event);
12623}
12624;
12625this.document.bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate);
12626event.preventDefault();
12627mouseHandled = true;
12628return true;
12629},
12630_mouseMove: function(event) {
12631if (this._mouseMoved) {
12632if ($.ui.ie && (!document.documentMode || document.documentMode < 9) && !event.button) {
12633return this._mouseUp(event);
12634} else if (!event.which) {
12635return this._mouseUp(event);
12636}
12637}
12638if (event.which || event.button) {
12639this._mouseMoved = true;
12640}
12641if (this._mouseStarted) {
12642this._mouseDrag(event);
12643return event.preventDefault();
12644}
12645if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
12646this._mouseStarted = (this._mouseStart(this._mouseDownEvent, event) !== false);
12647(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
12648}
12649return !this._mouseStarted;
12650},
12651_mouseUp: function(event) {
12652this.document.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
12653if (this._mouseStarted) {
12654this._mouseStarted = false;
vendor: 13,648 bytes, lines 12655-13045
12655if (event.target === this._mouseDownEvent.target) {
12656$.data(event.target, this.widgetName + ".preventClickEvent", true);
12657}
12658this._mouseStop(event);
12659}
12660mouseHandled = false;
12661return false;
12662},
12663_mouseDistanceMet: function(event) {
12664return (Math.max(Math.abs(this._mouseDownEvent.pageX - event.pageX), Math.abs(this._mouseDownEvent.pageY - event.pageY)) >= this.options.distance);
12665},
12666_mouseDelayMet: function() {
12667return this.mouseDelayMet;
12668},
12669_mouseStart: function() {},
12670_mouseDrag: function() {},
12671_mouseStop: function() {},
12672_mouseCapture: function() {
12673return true;
12674}
12675});
12676(function() {
12677$.ui = $.ui || {};
12678var cachedScrollbarWidth, supportsOffsetFractions, max = Math.max, abs = Math.abs, round = Math.round, rhorizontal = /left|center|right/, rvertical = /top|center|bottom/, roffset = /[\+\-]\d+(\.[\d]+)?%?/, rposition = /^\w+/, rpercent = /%$/, _position = $.fn.position;
12679function getOffsets(offsets, width, height) {
12680return [parseFloat(offsets[0]) * (rpercent.test(offsets[0]) ? width / 100 : 1), parseFloat(offsets[1]) * (rpercent.test(offsets[1]) ? height / 100 : 1)];
12681}
12682function parseCss(element, property) {
12683return parseInt($.css(element, property), 10) || 0;
12684}
12685function getDimensions(elem) {
12686var raw = elem[0];
12687if (raw.nodeType === 9) {
12688return {
12689width: elem.width(),
12690height: elem.height(),
12691offset: {
12692top: 0,
12693left: 0
12694}
12695};
12696}
12697if ($.isWindow(raw)) {
12698return {
12699width: elem.width(),
12700height: elem.height(),
12701offset: {
12702top: elem.scrollTop(),
12703left: elem.scrollLeft()
12704}
12705};
12706}
12707if (raw.preventDefault) {
12708return {
12709width: 0,
12710height: 0,
12711offset: {
12712top: raw.pageY,
12713left: raw.pageX
12714}
12715};
12716}
12717return {
12718width: elem.outerWidth(),
12719height: elem.outerHeight(),
12720offset: elem.offset()
12721};
12722}
12723$.position = {
12724scrollbarWidth: function() {
12725if (cachedScrollbarWidth !== undefined) {
12726return cachedScrollbarWidth;
12727}
12728var w1, w2, div = $("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"), innerDiv = div.children()[0];
12729$("body").append(div);
12730w1 = innerDiv.offsetWidth;
12731div.css("overflow", "scroll");
12732w2 = innerDiv.offsetWidth;
12733if (w1 === w2) {
12734w2 = div[0].clientWidth;
12735}
12736div.remove();
12737return (cachedScrollbarWidth = w1 - w2);
12738},
12739getScrollInfo: function(within) {
12740var overflowX = within.isWindow || within.isDocument ? "" : within.element.css("overflow-x")
12741  , overflowY = within.isWindow || within.isDocument ? "" : within.element.css("overflow-y")
12742  , hasOverflowX = overflowX === "scroll" || (overflowX === "auto" && within.width < within.element[0].scrollWidth)
12743  , hasOverflowY = overflowY === "scroll" || (overflowY === "auto" && within.height < within.element[0].scrollHeight);
12744return {
12745width: hasOverflowY ? $.position.scrollbarWidth() : 0,
12746height: hasOverflowX ? $.position.scrollbarWidth() : 0
12747};
12748},
12749getWithinInfo: function(element) {
12750var withinElement = $(element || window)
12751  , isWindow = $.isWindow(withinElement[0])
12752  , isDocument = !!withinElement[0] && withinElement[0].nodeType === 9;
12753return {
12754element: withinElement,
12755isWindow: isWindow,
12756isDocument: isDocument,
12757offset: withinElement.offset() || {
12758left: 0,
12759top: 0
12760},
12761scrollLeft: withinElement.scrollLeft(),
12762scrollTop: withinElement.scrollTop(),
12763width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(),
12764height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight()
12765};
12766}
12767};
12768$.fn.position = function(options) {
12769if (!options || !options.of) {
12770return _position.apply(this, arguments);
12771}
12772options = $.extend({}, options);
12773var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, target = $(options.of), within = $.position.getWithinInfo(options.within), scrollInfo = $.position.getScrollInfo(within), collision = (options.collision || "flip").split(" "), offsets = {};
12774dimensions = getDimensions(target);
12775if (target[0].preventDefault) {
12776options.at = "left top";
12777}
12778targetWidth = dimensions.width;
12779targetHeight = dimensions.height;
12780targetOffset = dimensions.offset;
12781basePosition = $.extend({}, targetOffset);
12782$.each(["my", "at"], function() {
12783var pos = (options[this] || "").split(" "), horizontalOffset, verticalOffset;
12784if (pos.length === 1) {
12785pos = rhorizontal.test(pos[0]) ? pos.concat(["center"]) : rvertical.test(pos[0]) ? ["center"].concat(pos) : ["center", "center"];
12786}
12787pos[0] = rhorizontal.test(pos[0]) ? pos[0] : "center";
12788pos[1] = rvertical.test(pos[1]) ? pos[1] : "center";
12789horizontalOffset = roffset.exec(pos[0]);
12790verticalOffset = roffset.exec(pos[1]);
12791offsets[this] = [horizontalOffset ? horizontalOffset[0] : 0, verticalOffset ? verticalOffset[0] : 0];
12792options[this] = [rposition.exec(pos[0])[0], rposition.exec(pos[1])[0]];
12793});
12794if (collision.length === 1) {
12795collision[1] = collision[0];
12796}
12797if (options.at[0] === "right") {
12798basePosition.left += targetWidth;
12799} else if (options.at[0] === "center") {
12800basePosition.left += targetWidth / 2;
12801}
12802if (options.at[1] === "bottom") {
12803basePosition.top += targetHeight;
12804} else if (options.at[1] === "center") {
12805basePosition.top += targetHeight / 2;
12806}
12807atOffset = getOffsets(offsets.at, targetWidth, targetHeight);
12808basePosition.left += atOffset[0];
12809basePosition.top += atOffset[1];
12810return this.each(function() {
12811var collisionPosition, using, elem = $(this), elemWidth = elem.outerWidth(), elemHeight = elem.outerHeight(), marginLeft = parseCss(this, "marginLeft"), marginTop = parseCss(this, "marginTop"), collisionWidth = elemWidth + marginLeft + parseCss(this, "marginRight") + scrollInfo.width, collisionHeight = elemHeight + marginTop + parseCss(this, "marginBottom") + scrollInfo.height, position = $.extend({}, basePosition), myOffset = getOffsets(offsets.my, elem.outerWidth(), elem.outerHeight());
12812if (options.my[0] === "right") {
12813position.left -= elemWidth;
12814} else if (options.my[0] === "center") {
12815position.left -= elemWidth / 2;
12816}
12817if (options.my[1] === "bottom") {
12818position.top -= elemHeight;
12819} else if (options.my[1] === "center") {
12820position.top -= elemHeight / 2;
12821}
12822position.left += myOffset[0];
12823position.top += myOffset[1];
12824if (!supportsOffsetFractions) {
12825position.left = round(position.left);
12826position.top = round(position.top);
12827}
12828collisionPosition = {
12829marginLeft: marginLeft,
12830marginTop: marginTop
12831};
12832$.each(["left", "top"], function(i, dir) {
12833if ($.ui.position[collision[i]]) {
12834$.ui.position[collision[i]][dir](position, {
12835targetWidth: targetWidth,
12836targetHeight: targetHeight,
12837elemWidth: elemWidth,
12838elemHeight: elemHeight,
12839collisionPosition: collisionPosition,
12840collisionWidth: collisionWidth,
12841collisionHeight: collisionHeight,
12842offset: [atOffset[0] + myOffset[0], atOffset[1] + myOffset[1]],
12843my: options.my,
12844at: options.at,
12845within: within,
12846elem: elem
12847});
12848}
12849});
12850if (options.using) {
12851using = function(props) {
12852var left = targetOffset.left - position.left
12853  , right = left + targetWidth - elemWidth
12854  , top = targetOffset.top - position.top
12855  , bottom = top + targetHeight - elemHeight
12856  , feedback = {
12857target: {
12858element: target,
12859left: targetOffset.left,
12860top: targetOffset.top,
12861width: targetWidth,
12862height: targetHeight
12863},
12864element: {
12865element: elem,
12866left: position.left,
12867top: position.top,
12868width: elemWidth,
12869height: elemHeight
12870},
12871horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
12872vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
12873};
12874if (targetWidth < elemWidth && abs(left + right) < targetWidth) {
12875feedback.horizontal = "center";
12876}
12877if (targetHeight < elemHeight && abs(top + bottom) < targetHeight) {
12878feedback.vertical = "middle";
12879}
12880if (max(abs(left), abs(right)) > max(abs(top), abs(bottom))) {
12881feedback.important = "horizontal";
12882} else {
12883feedback.important = "vertical";
12884}
12885options.using.call(this, props, feedback);
12886}
12887;
12888}
12889elem.offset($.extend(position, {
12890using: using
12891}));
12892});
12893}
12894;
12895$.ui.position = {
12896fit: {
12897left: function(position, data) {
12898var within = data.within, withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, outerWidth = within.width, collisionPosLeft = position.left - data.collisionPosition.marginLeft, overLeft = withinOffset - collisionPosLeft, overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, newOverRight;
12899if (data.collisionWidth > outerWidth) {
12900if (overLeft > 0 && overRight <= 0) {
12901newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
12902position.left += overLeft - newOverRight;
12903} else if (overRight > 0 && overLeft <= 0) {
12904position.left = withinOffset;
12905} else {
12906if (overLeft > overRight) {
12907position.left = withinOffset + outerWidth - data.collisionWidth;
12908} else {
12909position.left = withinOffset;
12910}
12911}
12912} else if (overLeft > 0) {
12913position.left += overLeft;
12914} else if (overRight > 0) {
12915position.left -= overRight;
12916} else {
12917position.left = max(position.left - collisionPosLeft, position.left);
12918}
12919},
12920top: function(position, data) {
12921var within = data.within, withinOffset = within.isWindow ? within.scrollTop : within.offset.top, outerHeight = data.within.height, collisionPosTop = position.top - data.collisionPosition.marginTop, overTop = withinOffset - collisionPosTop, overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, newOverBottom;
12922if (data.collisionHeight > outerHeight) {
12923if (overTop > 0 && overBottom <= 0) {
12924newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
12925position.top += overTop - newOverBottom;
12926} else if (overBottom > 0 && overTop <= 0) {
12927position.top = withinOffset;
12928} else {
12929if (overTop > overBottom) {
12930position.top = withinOffset + outerHeight - data.collisionHeight;
12931} else {
12932position.top = withinOffset;
12933}
12934}
12935} else if (overTop > 0) {
12936position.top += overTop;
12937} else if (overBottom > 0) {
12938position.top -= overBottom;
12939} else {
12940position.top = max(position.top - collisionPosTop, position.top);
12941}
12942}
12943},
12944flip: {
12945left: function(position, data) {
12946var within = data.within, withinOffset = within.offset.left + within.scrollLeft, outerWidth = within.width, offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, collisionPosLeft = position.left - data.collisionPosition.marginLeft, overLeft = collisionPosLeft - offsetLeft, overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, myOffset = data.my[0] === "left" ? -data.elemWidth : data.my[0] === "right" ? data.elemWidth : 0, atOffset = data.at[0] === "left" ? data.targetWidth : data.at[0] === "right" ? -data.targetWidth : 0, offset = -2 * data.offset[0], newOverRight, newOverLeft;
12947if (overLeft < 0) {
12948newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
12949if (newOverRight < 0 || newOverRight < abs(overLeft)) {
12950position.left += myOffset + atOffset + offset;
12951}
12952} else if (overRight > 0) {
12953newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
12954if (newOverLeft > 0 || abs(newOverLeft) < overRight) {
12955position.left += myOffset + atOffset + offset;
12956}
12957}
12958},
12959top: function(position, data) {
12960var within = data.within, withinOffset = within.offset.top + within.scrollTop, outerHeight = within.height, offsetTop = within.isWindow ? within.scrollTop : within.offset.top, collisionPosTop = position.top - data.collisionPosition.marginTop, overTop = collisionPosTop - offsetTop, overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, top = data.my[1] === "top", myOffset = top ? -data.elemHeight : data.my[1] === "bottom" ? data.elemHeight : 0, atOffset = data.at[1] === "top" ? data.targetHeight : data.at[1] === "bottom" ? -data.targetHeight : 0, offset = -2 * data.offset[1], newOverTop, newOverBottom;
12961if (overTop < 0) {
12962newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
12963if (newOverBottom < 0 || newOverBottom < abs(overTop)) {
12964position.top += myOffset + atOffset + offset;
12965}
12966} else if (overBottom > 0) {
12967newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
12968if (newOverTop > 0 || abs(newOverTop) < overBottom) {
12969position.top += myOffset + atOffset + offset;
12970}
12971}
12972}
12973},
12974flipfit: {
12975left: function() {
12976$.ui.position.flip.left.apply(this, arguments);
12977$.ui.position.fit.left.apply(this, arguments);
12978},
12979top: function() {
12980$.ui.position.flip.top.apply(this, arguments);
12981$.ui.position.fit.top.apply(this, arguments);
12982}
12983}
12984};
12985(function() {
12986var testElement, testElementParent, testElementStyle, offsetLeft, i, body = document.getElementsByTagName("body")[0], div = document.createElement("div");
12987testElement = document.createElement(body ? "div" : "body");
12988testElementStyle = {
12989visibility: "hidden",
12990width: 0,
12991height: 0,
12992border: 0,
12993margin: 0,
12994background: "none"
12995};
12996if (body) {
12997$.extend(testElementStyle, {
12998position: "absolute",
12999left: "-1000px",
13000top: "-1000px"
13001});
13002}
13003for (i in testElementStyle) {
13004testElement.style[i] = testElementStyle[i];
13005}
13006testElement.appendChild(div);
13007testElementParent = body || document.documentElement;
13008testElementParent.insertBefore(testElement, testElementParent.firstChild);
13009div.style.cssText = "position: absolute; left: 10.7432222px;";
13010offsetLeft = $(div).offset().left;
13011supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11;
13012testElement.innerHTML = "";
13013testElementParent.removeChild(testElement);
13014}
13015)();
13016}
13017)();
13018var position = $.ui.position;
13019$.widget("ui.draggable", $.ui.mouse, {
13020version: "1.11.4",
13021widgetEventPrefix: "drag",
13022options: {
13023addClasses: true,
13024appendTo: "parent",
13025axis: false,
13026connectToSortable: false,
13027containment: false,
13028cursor: "auto",
13029cursorAt: false,
13030grid: false,
13031handle: false,
13032helper: "original",
13033iframeFix: false,
13034opacity: false,
13035refreshPositions: false,
13036revert: false,
13037revertDuration: 500,
13038scope: "default",
13039scroll: true,
13040scrollSensitivity: 20,
13041scrollSpeed: 20,
13042snap: false,
13043snapMode: "both",
13044snapTolerance: 20,
13045stack: false,
vendor: 41,087 bytes, lines 13046-14364
13046zIndex: false,
13047drag: null,
13048start: null,
13049stop: null
13050},
13051_create: function() {
13052if (this.options.helper === "original") {
13053this._setPositionRelative();
13054}
13055if (this.options.addClasses) {
13056this.element.addClass("ui-draggable");
13057}
13058if (this.options.disabled) {
13059this.element.addClass("ui-draggable-disabled");
13060}
13061this._setHandleClassName();
13062this._mouseInit();
13063},
13064_setOption: function(key, value) {
13065this._super(key, value);
13066if (key === "handle") {
13067this._removeHandleClassName();
13068this._setHandleClassName();
13069}
13070},
13071_destroy: function() {
13072if ((this.helper || this.element).is(".ui-draggable-dragging")) {
13073this.destroyOnClear = true;
13074return;
13075}
13076this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");
13077this._removeHandleClassName();
13078this._mouseDestroy();
13079},
13080_mouseCapture: function(event) {
13081var o = this.options;
13082this._blurActiveElement(event);
13083if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
13084return false;
13085}
13086this.handle = this._getHandle(event);
13087if (!this.handle) {
13088return false;
13089}
13090this._blockFrames(o.iframeFix === true ? "iframe" : o.iframeFix);
13091return true;
13092},
13093_blockFrames: function(selector) {
13094this.iframeBlocks = this.document.find(selector).map(function() {
13095var iframe = $(this);
13096return $("<div>").css("position", "absolute").appendTo(iframe.parent()).outerWidth(iframe.outerWidth()).outerHeight(iframe.outerHeight()).offset(iframe.offset())[0];
13097});
13098},
13099_unblockFrames: function() {
13100if (this.iframeBlocks) {
13101this.iframeBlocks.remove();
13102delete this.iframeBlocks;
13103}
13104},
13105_blurActiveElement: function(event) {
13106var document = this.document[0];
13107if (!this.handleElement.is(event.target)) {
13108return;
13109}
13110try {
13111if (document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body") {
13112$(document.activeElement).blur();
13113}
13114} catch (error) {}
13115},
13116_mouseStart: function(event) {
13117var o = this.options;
13118this.helper = this._createHelper(event);
13119this.helper.addClass("ui-draggable-dragging");
13120this._cacheHelperProportions();
13121if ($.ui.ddmanager) {
13122$.ui.ddmanager.current = this;
13123}
13124this._cacheMargins();
13125this.cssPosition = this.helper.css("position");
13126this.scrollParent = this.helper.scrollParent(true);
13127this.offsetParent = this.helper.offsetParent();
13128this.hasFixedAncestor = this.helper.parents().filter(function() {
13129return $(this).css("position") === "fixed";
13130}).length > 0;
13131this.positionAbs = this.element.offset();
13132this._refreshOffsets(event);
13133this.originalPosition = this.position = this._generatePosition(event, false);
13134this.originalPageX = event.pageX;
13135this.originalPageY = event.pageY;
13136(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
13137this._setContainment();
13138if (this._trigger("start", event) === false) {
13139this._clear();
13140return false;
13141}
13142this._cacheHelperProportions();
13143if ($.ui.ddmanager && !o.dropBehaviour) {
13144$.ui.ddmanager.prepareOffsets(this, event);
13145}
13146this._normalizeRightBottom();
13147this._mouseDrag(event, true);
13148if ($.ui.ddmanager) {
13149$.ui.ddmanager.dragStart(this, event);
13150}
13151return true;
13152},
13153_refreshOffsets: function(event) {
13154this.offset = {
13155top: this.positionAbs.top - this.margins.top,
13156left: this.positionAbs.left - this.margins.left,
13157scroll: false,
13158parent: this._getParentOffset(),
13159relative: this._getRelativeOffset()
13160};
13161this.offset.click = {
13162left: event.pageX - this.offset.left,
13163top: event.pageY - this.offset.top
13164};
13165},
13166_mouseDrag: function(event, noPropagation) {
13167if (this.hasFixedAncestor) {
13168this.offset.parent = this._getParentOffset();
13169}
13170this.position = this._generatePosition(event, true);
13171this.positionAbs = this._convertPositionTo("absolute");
13172if (!noPropagation) {
13173var ui = this._uiHash();
13174if (this._trigger("drag", event, ui) === false) {
13175this._mouseUp({});
13176return false;
13177}
13178this.position = ui.position;
13179}
13180this.helper[0].style.left = this.position.left + "px";
13181this.helper[0].style.top = this.position.top + "px";
13182if ($.ui.ddmanager) {
13183$.ui.ddmanager.drag(this, event);
13184}
13185return false;
13186},
13187_mouseStop: function(event) {
13188var that = this
13189  , dropped = false;
13190if ($.ui.ddmanager && !this.options.dropBehaviour) {
13191dropped = $.ui.ddmanager.drop(this, event);
13192}
13193if (this.dropped) {
13194dropped = this.dropped;
13195this.dropped = false;
13196}
13197if ((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
13198$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
13199if (that._trigger("stop", event) !== false) {
13200that._clear();
13201}
13202});
13203} else {
13204if (this._trigger("stop", event) !== false) {
13205this._clear();
13206}
13207}
13208return false;
13209},
13210_mouseUp: function(event) {
13211this._unblockFrames();
13212if ($.ui.ddmanager) {
13213$.ui.ddmanager.dragStop(this, event);
13214}
13215if (this.handleElement.is(event.target)) {
13216this.element.focus();
13217}
13218return $.ui.mouse.prototype._mouseUp.call(this, event);
13219},
13220cancel: function() {
13221if (this.helper.is(".ui-draggable-dragging")) {
13222this._mouseUp({});
13223} else {
13224this._clear();
13225}
13226return this;
13227},
13228_getHandle: function(event) {
13229return this.options.handle ? !!$(event.target).closest(this.element.find(this.options.handle)).length : true;
13230},
13231_setHandleClassName: function() {
13232this.handleElement = this.options.handle ? this.element.find(this.options.handle) : this.element;
13233this.handleElement.addClass("ui-draggable-handle");
13234},
13235_removeHandleClassName: function() {
13236this.handleElement.removeClass("ui-draggable-handle");
13237},
13238_createHelper: function(event) {
13239var o = this.options
13240  , helperIsFunction = $.isFunction(o.helper)
13241  , helper = helperIsFunction ? $(o.helper.apply(this.element[0], [event])) : (o.helper === "clone" ? this.element.clone().removeAttr("id") : this.element);
13242if (!helper.parents("body").length) {
13243helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
13244}
13245if (helperIsFunction && helper[0] === this.element[0]) {
13246this._setPositionRelative();
13247}
13248if (helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
13249helper.css("position", "absolute");
13250}
13251return helper;
13252},
13253_setPositionRelative: function() {
13254if (!(/^(?:r|a|f)/).test(this.element.css("position"))) {
13255this.element[0].style.position = "relative";
13256}
13257},
13258_adjustOffsetFromHelper: function(obj) {
13259if (typeof obj === "string") {
13260obj = obj.split(" ");
13261}
13262if ($.isArray(obj)) {
13263obj = {
13264left: +obj[0],
13265top: +obj[1] || 0
13266};
13267}
13268if ("left"in obj) {
13269this.offset.click.left = obj.left + this.margins.left;
13270}
13271if ("right"in obj) {
13272this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
13273}
13274if ("top"in obj) {
13275this.offset.click.top = obj.top + this.margins.top;
13276}
13277if ("bottom"in obj) {
13278this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
13279}
13280},
13281_isRootNode: function(element) {
13282return (/(html|body)/i).test(element.tagName) || element === this.document[0];
13283},
13284_getParentOffset: function() {
13285var po = this.offsetParent.offset()
13286  , document = this.document[0];
13287if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
13288po.left += this.scrollParent.scrollLeft();
13289po.top += this.scrollParent.scrollTop();
13290}
13291if (this._isRootNode(this.offsetParent[0])) {
13292po = {
13293top: 0,
13294left: 0
13295};
13296}
13297return {
13298top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
13299left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
13300};
13301},
13302_getRelativeOffset: function() {
13303if (this.cssPosition !== "relative") {
13304return {
13305top: 0,
13306left: 0
13307};
13308}
13309var p = this.element.position()
13310  , scrollIsRootNode = this._isRootNode(this.scrollParent[0]);
13311return {
13312top: p.top - (parseInt(this.helper.css("top"), 10) || 0) + (!scrollIsRootNode ? this.scrollParent.scrollTop() : 0),
13313left: p.left - (parseInt(this.helper.css("left"), 10) || 0) + (!scrollIsRootNode ? this.scrollParent.scrollLeft() : 0)
13314};
13315},
13316_cacheMargins: function() {
13317this.margins = {
13318left: (parseInt(this.element.css("marginLeft"), 10) || 0),
13319top: (parseInt(this.element.css("marginTop"), 10) || 0),
13320right: (parseInt(this.element.css("marginRight"), 10) || 0),
13321bottom: (parseInt(this.element.css("marginBottom"), 10) || 0)
13322};
13323},
13324_cacheHelperProportions: function() {
13325this.helperProportions = {
13326width: this.helper.outerWidth(),
13327height: this.helper.outerHeight()
13328};
13329},
13330_setContainment: function() {
13331var isUserScrollable, c, ce, o = this.options, document = this.document[0];
13332this.relativeContainer = null;
13333if (!o.containment) {
13334this.containment = null;
13335return;
13336}
13337if (o.containment === "window") {
13338this.containment = [$(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, $(window).scrollLeft() + $(window).width() - this.helperProportions.width - this.margins.left, $(window).scrollTop() + ($(window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];
13339return;
13340}
13341if (o.containment === "document") {
13342this.containment = [0, 0, $(document).width() - this.helperProportions.width - this.margins.left, ($(document).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];
13343return;
13344}
13345if (o.containment.constructor === Array) {
13346this.containment = o.containment;
13347return;
13348}
13349if (o.containment === "parent") {
13350o.containment = this.helper[0].parentNode;
13351}
13352c = $(o.containment);
13353ce = c[0];
13354if (!ce) {
13355return;
13356}
13357isUserScrollable = /(scroll|auto)/.test(c.css("overflow"));
13358this.containment = [(parseInt(c.css("borderLeftWidth"), 10) || 0) + (parseInt(c.css("paddingLeft"), 10) || 0), (parseInt(c.css("borderTopWidth"), 10) || 0) + (parseInt(c.css("paddingTop"), 10) || 0), (isUserScrollable ? Math.max(ce.scrollWidth, ce.offsetWidth) : ce.offsetWidth) - (parseInt(c.css("borderRightWidth"), 10) || 0) - (parseInt(c.css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (isUserScrollable ? Math.max(ce.scrollHeight, ce.offsetHeight) : ce.offsetHeight) - (parseInt(c.css("borderBottomWidth"), 10) || 0) - (parseInt(c.css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom];
13359this.relativeContainer = c;
13360},
13361_convertPositionTo: function(d, pos) {
13362if (!pos) {
13363pos = this.position;
13364}
13365var mod = d === "absolute" ? 1 : -1
13366  , scrollIsRootNode = this._isRootNode(this.scrollParent[0]);
13367return {
13368top: (pos.top + this.offset.relative.top * mod + this.offset.parent.top * mod - ((this.cssPosition === "fixed" ? -this.offset.scroll.top : (scrollIsRootNode ? 0 : this.offset.scroll.top)) * mod)),
13369left: (pos.left + this.offset.relative.left * mod + this.offset.parent.left * mod - ((this.cssPosition === "fixed" ? -this.offset.scroll.left : (scrollIsRootNode ? 0 : this.offset.scroll.left)) * mod))
13370};
13371},
13372_generatePosition: function(event, constrainPosition) {
13373var containment, co, top, left, o = this.options, scrollIsRootNode = this._isRootNode(this.scrollParent[0]), pageX = event.pageX, pageY = event.pageY;
13374if (!scrollIsRootNode || !this.offset.scroll) {
13375this.offset.scroll = {
13376top: this.scrollParent.scrollTop(),
13377left: this.scrollParent.scrollLeft()
13378};
13379}
13380if (constrainPosition) {
13381if (this.containment) {
13382if (this.relativeContainer) {
13383co = this.relativeContainer.offset();
13384containment = [this.containment[0] + co.left, this.containment[1] + co.top, this.containment[2] + co.left, this.containment[3] + co.top];
13385} else {
13386containment = this.containment;
13387}
13388if (event.pageX - this.offset.click.left < containment[0]) {
13389pageX = containment[0] + this.offset.click.left;
13390}
13391if (event.pageY - this.offset.click.top < containment[1]) {
13392pageY = containment[1] + this.offset.click.top;
13393}
13394if (event.pageX - this.offset.click.left > containment[2]) {
13395pageX = containment[2] + this.offset.click.left;
13396}
13397if (event.pageY - this.offset.click.top > containment[3]) {
13398pageY = containment[3] + this.offset.click.top;
13399}
13400}
13401if (o.grid) {
13402top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
13403pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
13404left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
13405pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
13406}
13407if (o.axis === "y") {
13408pageX = this.originalPageX;
13409}
13410if (o.axis === "x") {
13411pageY = this.originalPageY;
13412}
13413}
13414return {
13415top: (pageY - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (this.cssPosition === "fixed" ? -this.offset.scroll.top : (scrollIsRootNode ? 0 : this.offset.scroll.top))),
13416left: (pageX - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (this.cssPosition === "fixed" ? -this.offset.scroll.left : (scrollIsRootNode ? 0 : this.offset.scroll.left)))
13417};
13418},
13419_clear: function() {
13420this.helper.removeClass("ui-draggable-dragging");
13421if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
13422this.helper.remove();
13423}
13424this.helper = null;
13425this.cancelHelperRemoval = false;
13426if (this.destroyOnClear) {
13427this.destroy();
13428}
13429},
13430_normalizeRightBottom: function() {
13431if (this.options.axis !== "y" && this.helper.css("right") !== "auto") {
13432this.helper.width(this.helper.width());
13433this.helper.css("right", "auto");
13434}
13435if (this.options.axis !== "x" && this.helper.css("bottom") !== "auto") {
13436this.helper.height(this.helper.height());
13437this.helper.css("bottom", "auto");
13438}
13439},
13440_trigger: function(type, event, ui) {
13441ui = ui || this._uiHash();
13442$.ui.plugin.call(this, type, [event, ui, this], true);
13443if (/^(drag|start|stop)/.test(type)) {
13444this.positionAbs = this._convertPositionTo("absolute");
13445ui.offset = this.positionAbs;
13446}
13447return $.Widget.prototype._trigger.call(this, type, event, ui);
13448},
13449plugins: {},
13450_uiHash: function() {
13451return {
13452helper: this.helper,
13453position: this.position,
13454originalPosition: this.originalPosition,
13455offset: this.positionAbs
13456};
13457}
13458});
13459$.ui.plugin.add("draggable", "connectToSortable", {
13460start: function(event, ui, draggable) {
13461var uiSortable = $.extend({}, ui, {
13462item: draggable.element
13463});
13464draggable.sortables = [];
13465$(draggable.options.connectToSortable).each(function() {
13466var sortable = $(this).sortable("instance");
13467if (sortable && !sortable.options.disabled) {
13468draggable.sortables.push(sortable);
13469sortable.refreshPositions();
13470sortable._trigger("activate", event, uiSortable);
13471}
13472});
13473},
13474stop: function(event, ui, draggable) {
13475var uiSortable = $.extend({}, ui, {
13476item: draggable.element
13477});
13478draggable.cancelHelperRemoval = false;
13479$.each(draggable.sortables, function() {
13480var sortable = this;
13481if (sortable.isOver) {
13482sortable.isOver = 0;
13483draggable.cancelHelperRemoval = true;
13484sortable.cancelHelperRemoval = false;
13485sortable._storedCSS = {
13486position: sortable.placeholder.css("position"),
13487top: sortable.placeholder.css("top"),
13488left: sortable.placeholder.css("left")
13489};
13490sortable._mouseStop(event);
13491sortable.options.helper = sortable.options._helper;
13492} else {
13493sortable.cancelHelperRemoval = true;
13494sortable._trigger("deactivate", event, uiSortable);
13495}
13496});
13497},
13498drag: function(event, ui, draggable) {
13499$.each(draggable.sortables, function() {
13500var innermostIntersecting = false
13501  , sortable = this;
13502sortable.positionAbs = draggable.positionAbs;
13503sortable.helperProportions = draggable.helperProportions;
13504sortable.offset.click = draggable.offset.click;
13505if (sortable._intersectsWith(sortable.containerCache)) {
13506innermostIntersecting = true;
13507$.each(draggable.sortables, function() {
13508this.positionAbs = draggable.positionAbs;
13509this.helperProportions = draggable.helperProportions;
13510this.offset.click = draggable.offset.click;
13511if (this !== sortable && this._intersectsWith(this.containerCache) && $.contains(sortable.element[0], this.element[0])) {
13512innermostIntersecting = false;
13513}
13514return innermostIntersecting;
13515});
13516}
13517if (innermostIntersecting) {
13518if (!sortable.isOver) {
13519sortable.isOver = 1;
13520draggable._parent = ui.helper.parent();
13521sortable.currentItem = ui.helper.appendTo(sortable.element).data("ui-sortable-item", true);
13522sortable.options._helper = sortable.options.helper;
13523sortable.options.helper = function() {
13524return ui.helper[0];
13525}
13526;
13527event.target = sortable.currentItem[0];
13528sortable._mouseCapture(event, true);
13529sortable._mouseStart(event, true, true);
13530sortable.offset.click.top = draggable.offset.click.top;
13531sortable.offset.click.left = draggable.offset.click.left;
13532sortable.offset.parent.left -= draggable.offset.parent.left - sortable.offset.parent.left;
13533sortable.offset.parent.top -= draggable.offset.parent.top - sortable.offset.parent.top;
13534draggable._trigger("toSortable", event);
13535draggable.dropped = sortable.element;
13536$.each(draggable.sortables, function() {
13537this.refreshPositions();
13538});
13539draggable.currentItem = draggable.element;
13540sortable.fromOutside = draggable;
13541}
13542if (sortable.currentItem) {
13543sortable._mouseDrag(event);
13544ui.position = sortable.position;
13545}
13546} else {
13547if (sortable.isOver) {
13548sortable.isOver = 0;
13549sortable.cancelHelperRemoval = true;
13550sortable.options._revert = sortable.options.revert;
13551sortable.options.revert = false;
13552sortable._trigger("out", event, sortable._uiHash(sortable));
13553sortable._mouseStop(event, true);
13554sortable.options.revert = sortable.options._revert;
13555sortable.options.helper = sortable.options._helper;
13556if (sortable.placeholder) {
13557sortable.placeholder.remove();
13558}
13559ui.helper.appendTo(draggable._parent);
13560draggable._refreshOffsets(event);
13561ui.position = draggable._generatePosition(event, true);
13562draggable._trigger("fromSortable", event);
13563draggable.dropped = false;
13564$.each(draggable.sortables, function() {
13565this.refreshPositions();
13566});
13567}
13568}
13569});
13570}
13571});
13572$.ui.plugin.add("draggable", "cursor", {
13573start: function(event, ui, instance) {
13574var t = $("body")
13575  , o = instance.options;
13576if (t.css("cursor")) {
13577o._cursor = t.css("cursor");
13578}
13579t.css("cursor", o.cursor);
13580},
13581stop: function(event, ui, instance) {
13582var o = instance.options;
13583if (o._cursor) {
13584$("body").css("cursor", o._cursor);
13585}
13586}
13587});
13588$.ui.plugin.add("draggable", "opacity", {
13589start: function(event, ui, instance) {
13590var t = $(ui.helper)
13591  , o = instance.options;
13592if (t.css("opacity")) {
13593o._opacity = t.css("opacity");
13594}
13595t.css("opacity", o.opacity);
13596},
13597stop: function(event, ui, instance) {
13598var o = instance.options;
13599if (o._opacity) {
13600$(ui.helper).css("opacity", o._opacity);
13601}
13602}
13603});
13604$.ui.plugin.add("draggable", "scroll", {
13605start: function(event, ui, i) {
13606if (!i.scrollParentNotHidden) {
13607i.scrollParentNotHidden = i.helper.scrollParent(false);
13608}
13609if (i.scrollParentNotHidden[0] !== i.document[0] && i.scrollParentNotHidden[0].tagName !== "HTML") {
13610i.overflowOffset = i.scrollParentNotHidden.offset();
13611}
13612},
13613drag: function(event, ui, i) {
13614var o = i.options
13615  , scrolled = false
13616  , scrollParent = i.scrollParentNotHidden[0]
13617  , document = i.document[0];
13618if (scrollParent !== document && scrollParent.tagName !== "HTML") {
13619if (!o.axis || o.axis !== "x") {
13620if ((i.overflowOffset.top + scrollParent.offsetHeight) - event.pageY < o.scrollSensitivity) {
13621scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
13622} else if (event.pageY - i.overflowOffset.top < o.scrollSensitivity) {
13623scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
13624}
13625}
13626if (!o.axis || o.axis !== "y") {
13627if ((i.overflowOffset.left + scrollParent.offsetWidth) - event.pageX < o.scrollSensitivity) {
13628scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
13629} else if (event.pageX - i.overflowOffset.left < o.scrollSensitivity) {
13630scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
13631}
13632}
13633} else {
13634if (!o.axis || o.axis !== "x") {
13635if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
13636scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
13637} else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
13638scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
13639}
13640}
13641if (!o.axis || o.axis !== "y") {
13642if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
13643scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
13644} else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
13645scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
13646}
13647}
13648}
13649if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
13650$.ui.ddmanager.prepareOffsets(i, event);
13651}
13652}
13653});
13654$.ui.plugin.add("draggable", "snap", {
13655start: function(event, ui, i) {
13656var o = i.options;
13657i.snapElements = [];
13658$(o.snap.constructor !== String ? (o.snap.items || ":data(ui-draggable)") : o.snap).each(function() {
13659var $t = $(this)
13660  , $o = $t.offset();
13661if (this !== i.element[0]) {
13662i.snapElements.push({
13663item: this,
13664width: $t.outerWidth(),
13665height: $t.outerHeight(),
13666top: $o.top,
13667left: $o.left
13668});
13669}
13670});
13671},
13672drag: function(event, ui, inst) {
13673var ts, bs, ls, rs, l, r, t, b, i, first, o = inst.options, d = o.snapTolerance, x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
13674for (i = inst.snapElements.length - 1; i >= 0; i--) {
13675l = inst.snapElements[i].left - inst.margins.left;
13676r = l + inst.snapElements[i].width;
13677t = inst.snapElements[i].top - inst.margins.top;
13678b = t + inst.snapElements[i].height;
13679if (x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains(inst.snapElements[i].item.ownerDocument, inst.snapElements[i].item)) {
13680if (inst.snapElements[i].snapping) {
13681(inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), {
13682snapItem: inst.snapElements[i].item
13683})));
13684}
13685inst.snapElements[i].snapping = false;
13686continue;
13687}
13688if (o.snapMode !== "inner") {
13689ts = Math.abs(t - y2) <= d;
13690bs = Math.abs(b - y1) <= d;
13691ls = Math.abs(l - x2) <= d;
13692rs = Math.abs(r - x1) <= d;
13693if (ts) {
13694ui.position.top = inst._convertPositionTo("relative", {
13695top: t - inst.helperProportions.height,
13696left: 0
13697}).top;
13698}
13699if (bs) {
13700ui.position.top = inst._convertPositionTo("relative", {
13701top: b,
13702left: 0
13703}).top;
13704}
13705if (ls) {
13706ui.position.left = inst._convertPositionTo("relative", {
13707top: 0,
13708left: l - inst.helperProportions.width
13709}).left;
13710}
13711if (rs) {
13712ui.position.left = inst._convertPositionTo("relative", {
13713top: 0,
13714left: r
13715}).left;
13716}
13717}
13718first = (ts || bs || ls || rs);
13719if (o.snapMode !== "outer") {
13720ts = Math.abs(t - y1) <= d;
13721bs = Math.abs(b - y2) <= d;
13722ls = Math.abs(l - x1) <= d;
13723rs = Math.abs(r - x2) <= d;
13724if (ts) {
13725ui.position.top = inst._convertPositionTo("relative", {
13726top: t,
13727left: 0
13728}).top;
13729}
13730if (bs) {
13731ui.position.top = inst._convertPositionTo("relative", {
13732top: b - inst.helperProportions.height,
13733left: 0
13734}).top;
13735}
13736if (ls) {
13737ui.position.left = inst._convertPositionTo("relative", {
13738top: 0,
13739left: l
13740}).left;
13741}
13742if (rs) {
13743ui.position.left = inst._convertPositionTo("relative", {
13744top: 0,
13745left: r - inst.helperProportions.width
13746}).left;
13747}
13748}
13749if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
13750(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), {
13751snapItem: inst.snapElements[i].item
13752})));
13753}
13754inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
13755}
13756}
13757});
13758$.ui.plugin.add("draggable", "stack", {
13759start: function(event, ui, instance) {
13760var min, o = instance.options, group = $.makeArray($(o.stack)).sort(function(a, b) {
13761return (parseInt($(a).css("zIndex"), 10) || 0) - (parseInt($(b).css("zIndex"), 10) || 0);
13762});
13763if (!group.length) {
13764return;
13765}
13766min = parseInt($(group[0]).css("zIndex"), 10) || 0;
13767$(group).each(function(i) {
13768$(this).css("zIndex", min + i);
13769});
13770this.css("zIndex", (min + group.length));
13771}
13772});
13773$.ui.plugin.add("draggable", "zIndex", {
13774start: function(event, ui, instance) {
13775var t = $(ui.helper)
13776  , o = instance.options;
13777if (t.css("zIndex")) {
13778o._zIndex = t.css("zIndex");
13779}
13780t.css("zIndex", o.zIndex);
13781},
13782stop: function(event, ui, instance) {
13783var o = instance.options;
13784if (o._zIndex) {
13785$(ui.helper).css("zIndex", o._zIndex);
13786}
13787}
13788});
13789var draggable = $.ui.draggable;
13790$.widget("ui.droppable", {
13791version: "1.11.4",
13792widgetEventPrefix: "drop",
13793options: {
13794accept: "*",
13795activeClass: false,
13796addClasses: true,
13797greedy: false,
13798hoverClass: false,
13799scope: "default",
13800tolerance: "intersect",
13801activate: null,
13802deactivate: null,
13803drop: null,
13804out: null,
13805over: null
13806},
13807_create: function() {
13808var proportions, o = this.options, accept = o.accept;
13809this.isover = false;
13810this.isout = true;
13811this.accept = $.isFunction(accept) ? accept : function(d) {
13812return d.is(accept);
13813}
13814;
13815this.proportions = function() {
13816if (arguments.length) {
13817proportions = arguments[0];
13818} else {
13819return proportions ? proportions : proportions = {
13820width: this.element[0].offsetWidth,
13821height: this.element[0].offsetHeight
13822};
13823}
13824}
13825;
13826this._addToManager(o.scope);
13827o.addClasses && this.element.addClass("ui-droppable");
13828},
13829_addToManager: function(scope) {
13830$.ui.ddmanager.droppables[scope] = $.ui.ddmanager.droppables[scope] || [];
13831$.ui.ddmanager.droppables[scope].push(this);
13832},
13833_splice: function(drop) {
13834var i = 0;
13835for (; i < drop.length; i++) {
13836if (drop[i] === this) {
13837drop.splice(i, 1);
13838}
13839}
13840},
13841_destroy: function() {
13842var drop = $.ui.ddmanager.droppables[this.options.scope];
13843this._splice(drop);
13844this.element.removeClass("ui-droppable ui-droppable-disabled");
13845},
13846_setOption: function(key, value) {
13847if (key === "accept") {
13848this.accept = $.isFunction(value) ? value : function(d) {
13849return d.is(value);
13850}
13851;
13852} else if (key === "scope") {
13853var drop = $.ui.ddmanager.droppables[this.options.scope];
13854this._splice(drop);
13855this._addToManager(value);
13856}
13857this._super(key, value);
13858},
13859_activate: function(event) {
13860var draggable = $.ui.ddmanager.current;
13861if (this.options.activeClass) {
13862this.element.addClass(this.options.activeClass);
13863}
13864if (draggable) {
13865this._trigger("activate", event, this.ui(draggable));
13866}
13867},
13868_deactivate: function(event) {
13869var draggable = $.ui.ddmanager.current;
13870if (this.options.activeClass) {
13871this.element.removeClass(this.options.activeClass);
13872}
13873if (draggable) {
13874this._trigger("deactivate", event, this.ui(draggable));
13875}
13876},
13877_over: function(event) {
13878var draggable = $.ui.ddmanager.current;
13879if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
13880return;
13881}
13882if (this.accept.call(this.element[0], (draggable.currentItem || draggable.element))) {
13883if (this.options.hoverClass) {
13884this.element.addClass(this.options.hoverClass);
13885}
13886this._trigger("over", event, this.ui(draggable));
13887}
13888},
13889_out: function(event) {
13890var draggable = $.ui.ddmanager.current;
13891if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
13892return;
13893}
13894if (this.accept.call(this.element[0], (draggable.currentItem || draggable.element))) {
13895if (this.options.hoverClass) {
13896this.element.removeClass(this.options.hoverClass);
13897}
13898this._trigger("out", event, this.ui(draggable));
13899}
13900},
13901_drop: function(event, custom) {
13902var draggable = custom || $.ui.ddmanager.current
13903  , childrenIntersection = false;
13904if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
13905return false;
13906}
13907this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function() {
13908var inst = $(this).droppable("instance");
13909if (inst.options.greedy && !inst.options.disabled && inst.options.scope === draggable.options.scope && inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) && $.ui.intersect(draggable, $.extend(inst, {
13910offset: inst.element.offset()
13911}), inst.options.tolerance, event)) {
13912childrenIntersection = true;
13913return false;
13914}
13915});
13916if (childrenIntersection) {
13917return false;
13918}
13919if (this.accept.call(this.element[0], (draggable.currentItem || draggable.element))) {
13920if (this.options.activeClass) {
13921this.element.removeClass(this.options.activeClass);
13922}
13923if (this.options.hoverClass) {
13924this.element.removeClass(this.options.hoverClass);
13925}
13926this._trigger("drop", event, this.ui(draggable));
13927return this.element;
13928}
13929return false;
13930},
13931ui: function(c) {
13932return {
13933draggable: (c.currentItem || c.element),
13934helper: c.helper,
13935position: c.position,
13936offset: c.positionAbs
13937};
13938}
13939});
13940$.ui.intersect = (function() {
13941function isOverAxis(x, reference, size) {
13942return (x >= reference) && (x < (reference + size));
13943}
13944return function(draggable, droppable, toleranceMode, event) {
13945if (!droppable.offset) {
13946return false;
13947}
13948var x1 = (draggable.positionAbs || draggable.position.absolute).left + draggable.margins.left
13949  , y1 = (draggable.positionAbs || draggable.position.absolute).top + draggable.margins.top
13950  , x2 = x1 + draggable.helperProportions.width
13951  , y2 = y1 + draggable.helperProportions.height
13952  , l = droppable.offset.left
13953  , t = droppable.offset.top
13954  , r = l + droppable.proportions().width
13955  , b = t + droppable.proportions().height;
13956switch (toleranceMode) {
13957case "fit":
13958return (l <= x1 && x2 <= r && t <= y1 && y2 <= b);
13959case "intersect":
13960return (l < x1 + (draggable.helperProportions.width / 2) && x2 - (draggable.helperProportions.width / 2) < r && t < y1 + (draggable.helperProportions.height / 2) && y2 - (draggable.helperProportions.height / 2) < b);
13961case "pointer":
13962return isOverAxis(event.pageY, t, droppable.proportions().height) && isOverAxis(event.pageX, l, droppable.proportions().width);
13963case "touch":
13964return ((y1 >= t && y1 <= b) || (y2 >= t && y2 <= b) || (y1 < t && y2 > b)) && ((x1 >= l && x1 <= r) || (x2 >= l && x2 <= r) || (x1 < l && x2 > r));
13965default:
13966return false;
13967}
13968}
13969;
13970}
13971)();
13972$.ui.ddmanager = {
13973current: null,
13974droppables: {
13975"default": []
13976},
13977prepareOffsets: function(t, event) {
13978var i, j, m = $.ui.ddmanager.droppables[t.options.scope] || [], type = event ? event.type : null, list = (t.currentItem || t.element).find(":data(ui-droppable)").addBack();
13979droppablesLoop: for (i = 0; i < m.length; i++) {
13980if (m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0], (t.currentItem || t.element)))) {
13981continue;
13982}
13983for (j = 0; j < list.length; j++) {
13984if (list[j] === m[i].element[0]) {
13985m[i].proportions().height = 0;
13986continue droppablesLoop;
13987}
13988}
13989m[i].visible = m[i].element.css("display") !== "none";
13990if (!m[i].visible) {
13991continue;
13992}
13993if (type === "mousedown") {
13994m[i]._activate.call(m[i], event);
13995}
13996m[i].offset = m[i].element.offset();
13997m[i].proportions({
13998width: m[i].element[0].offsetWidth,
13999height: m[i].element[0].offsetHeight
14000});
14001}
14002},
14003drop: function(draggable, event) {
14004var dropped = false;
14005$.each(($.ui.ddmanager.droppables[draggable.options.scope] || []).slice(), function() {
14006if (!this.options) {
14007return;
14008}
14009if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance, event)) {
14010dropped = this._drop.call(this, event) || dropped;
14011}
14012if (!this.options.disabled && this.visible && this.accept.call(this.element[0], (draggable.currentItem || draggable.element))) {
14013this.isout = true;
14014this.isover = false;
14015this._deactivate.call(this, event);
14016}
14017});
14018return dropped;
14019},
14020dragStart: function(draggable, event) {
14021draggable.element.parentsUntil("body").bind("scroll.droppable", function() {
14022if (!draggable.options.refreshPositions) {
14023$.ui.ddmanager.prepareOffsets(draggable, event);
14024}
14025});
14026},
14027drag: function(draggable, event) {
14028if (draggable.options.refreshPositions) {
14029$.ui.ddmanager.prepareOffsets(draggable, event);
14030}
14031$.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {
14032if (this.options.disabled || this.greedyChild || !this.visible) {
14033return;
14034}
14035var parentInstance, scope, parent, intersects = $.ui.intersect(draggable, this, this.options.tolerance, event), c = !intersects && this.isover ? "isout" : (intersects && !this.isover ? "isover" : null);
14036if (!c) {
14037return;
14038}
14039if (this.options.greedy) {
14040scope = this.options.scope;
14041parent = this.element.parents(":data(ui-droppable)").filter(function() {
14042return $(this).droppable("instance").options.scope === scope;
14043});
14044if (parent.length) {
14045parentInstance = $(parent[0]).droppable("instance");
14046parentInstance.greedyChild = (c === "isover");
14047}
14048}
14049if (parentInstance && c === "isover") {
14050parentInstance.isover = false;
14051parentInstance.isout = true;
14052parentInstance._out.call(parentInstance, event);
14053}
14054this[c] = true;
14055this[c === "isout" ? "isover" : "isout"] = false;
14056this[c === "isover" ? "_over" : "_out"].call(this, event);
14057if (parentInstance && c === "isout") {
14058parentInstance.isout = false;
14059parentInstance.isover = true;
14060parentInstance._over.call(parentInstance, event);
14061}
14062});
14063},
14064dragStop: function(draggable, event) {
14065draggable.element.parentsUntil("body").unbind("scroll.droppable");
14066if (!draggable.options.refreshPositions) {
14067$.ui.ddmanager.prepareOffsets(draggable, event);
14068}
14069}
14070};
14071var droppable = $.ui.droppable;
14072$.widget("ui.resizable", $.ui.mouse, {
14073version: "1.11.4",
14074widgetEventPrefix: "resize",
14075options: {
14076alsoResize: false,
14077animate: false,
14078animateDuration: "slow",
14079animateEasing: "swing",
14080aspectRatio: false,
14081autoHide: false,
14082containment: false,
14083ghost: false,
14084grid: false,
14085handles: "e,s,se",
14086helper: false,
14087maxHeight: null,
14088maxWidth: null,
14089minHeight: 10,
14090minWidth: 10,
14091zIndex: 90,
14092resize: null,
14093start: null,
14094stop: null
14095},
14096_num: function(value) {
14097return parseInt(value, 10) || 0;
14098},
14099_isNumber: function(value) {
14100return !isNaN(parseInt(value, 10));
14101},
14102_hasScroll: function(el, a) {
14103if ($(el).css("overflow") === "hidden") {
14104return false;
14105}
14106var scroll = (a && a === "left") ? "scrollLeft" : "scrollTop"
14107  , has = false;
14108if (el[scroll] > 0) {
14109return true;
14110}
14111el[scroll] = 1;
14112has = (el[scroll] > 0);
14113el[scroll] = 0;
14114return has;
14115},
14116_create: function() {
14117var n, i, handle, axis, hname, that = this, o = this.options;
14118this.element.addClass("ui-resizable");
14119$.extend(this, {
14120_aspectRatio: !!(o.aspectRatio),
14121aspectRatio: o.aspectRatio,
14122originalElement: this.element,
14123_proportionallyResizeElements: [],
14124_helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
14125});
14126if (this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)) {
14127this.element.wrap($("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
14128position: this.element.css("position"),
14129width: this.element.outerWidth(),
14130height: this.element.outerHeight(),
14131top: this.element.css("top"),
14132left: this.element.css("left")
14133}));
14134this.element = this.element.parent().data("ui-resizable", this.element.resizable("instance"));
14135this.elementIsWrapper = true;
14136this.element.css({
14137marginLeft: this.originalElement.css("marginLeft"),
14138marginTop: this.originalElement.css("marginTop"),
14139marginRight: this.originalElement.css("marginRight"),
14140marginBottom: this.originalElement.css("marginBottom")
14141});
14142this.originalElement.css({
14143marginLeft: 0,
14144marginTop: 0,
14145marginRight: 0,
14146marginBottom: 0
14147});
14148this.originalResizeStyle = this.originalElement.css("resize");
14149this.originalElement.css("resize", "none");
14150this._proportionallyResizeElements.push(this.originalElement.css({
14151position: "static",
14152zoom: 1,
14153display: "block"
14154}));
14155this.originalElement.css({
14156margin: this.originalElement.css("margin")
14157});
14158this._proportionallyResize();
14159}
14160this.handles = o.handles || (!$(".ui-resizable-handle", this.element).length ? "e,s,se" : {
14161n: ".ui-resizable-n",
14162e: ".ui-resizable-e",
14163s: ".ui-resizable-s",
14164w: ".ui-resizable-w",
14165se: ".ui-resizable-se",
14166sw: ".ui-resizable-sw",
14167ne: ".ui-resizable-ne",
14168nw: ".ui-resizable-nw"
14169});
14170this._handles = $();
14171if (this.handles.constructor === String) {
14172if (this.handles === "all") {
14173this.handles = "n,e,s,w,se,sw,ne,nw";
14174}
14175n = this.handles.split(",");
14176this.handles = {};
14177for (i = 0; i < n.length; i++) {
14178handle = $.trim(n[i]);
14179hname = "ui-resizable-" + handle;
14180axis = $("<div class='ui-resizable-handle " + hname + "'></div>");
14181axis.css({
14182zIndex: o.zIndex
14183});
14184if ("se" === handle) {
14185axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");
14186}
14187this.handles[handle] = ".ui-resizable-" + handle;
14188this.element.append(axis);
14189}
14190}
14191this._renderAxis = function(target) {
14192var i, axis, padPos, padWrapper;
14193target = target || this.element;
14194for (i in this.handles) {
14195if (this.handles[i].constructor === String) {
14196this.handles[i] = this.element.children(this.handles[i]).first().show();
14197} else if (this.handles[i].jquery || this.handles[i].nodeType) {
14198this.handles[i] = $(this.handles[i]);
14199this._on(this.handles[i], {
14200"mousedown": that._mouseDown
14201});
14202}
14203if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)) {
14204axis = $(this.handles[i], this.element);
14205padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
14206padPos = ["padding", /ne|nw|n/.test(i) ? "Top" : /se|sw|s/.test(i) ? "Bottom" : /^e$/.test(i) ? "Right" : "Left"].join("");
14207target.css(padPos, padWrapper);
14208this._proportionallyResize();
14209}
14210this._handles = this._handles.add(this.handles[i]);
14211}
14212}
14213;
14214this._renderAxis(this.element);
14215this._handles = this._handles.add(this.element.find(".ui-resizable-handle"));
14216this._handles.disableSelection();
14217this._handles.mouseover(function() {
14218if (!that.resizing) {
14219if (this.className) {
14220axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
14221}
14222that.axis = axis && axis[1] ? axis[1] : "se";
14223}
14224});
14225if (o.autoHide) {
14226this._handles.hide();
14227$(this.element).addClass("ui-resizable-autohide").mouseenter(function() {
14228if (o.disabled) {
14229return;
14230}
14231$(this).removeClass("ui-resizable-autohide");
14232that._handles.show();
14233}).mouseleave(function() {
14234if (o.disabled) {
14235return;
14236}
14237if (!that.resizing) {
14238$(this).addClass("ui-resizable-autohide");
14239that._handles.hide();
14240}
14241});
14242}
14243this._mouseInit();
14244},
14245_destroy: function() {
14246this._mouseDestroy();
14247var wrapper, _destroy = function(exp) {
14248$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove();
14249};
14250if (this.elementIsWrapper) {
14251_destroy(this.element);
14252wrapper = this.element;
14253this.originalElement.css({
14254position: wrapper.css("position"),
14255width: wrapper.outerWidth(),
14256height: wrapper.outerHeight(),
14257top: wrapper.css("top"),
14258left: wrapper.css("left")
14259}).insertAfter(wrapper);
14260wrapper.remove();
14261}
14262this.originalElement.css("resize", this.originalResizeStyle);
14263_destroy(this.originalElement);
14264return this;
14265},
14266_mouseCapture: function(event) {
14267var i, handle, capture = false;
14268for (i in this.handles) {
14269handle = $(this.handles[i])[0];
14270if (handle === event.target || $.contains(handle, event.target)) {
14271capture = true;
14272}
14273}
14274return !this.options.disabled && capture;
14275},
14276_mouseStart: function(event) {
14277var curleft, curtop, cursor, o = this.options, el = this.element;
14278this.resizing = true;
14279this._renderProxy();
14280curleft = this._num(this.helper.css("left"));
14281curtop = this._num(this.helper.css("top"));
14282if (o.containment) {
14283curleft += $(o.containment).scrollLeft() || 0;
14284curtop += $(o.containment).scrollTop() || 0;
14285}
14286this.offset = this.helper.offset();
14287this.position = {
14288left: curleft,
14289top: curtop
14290};
14291this.size = this._helper ? {
14292width: this.helper.width(),
14293height: this.helper.height()
14294} : {
14295width: el.width(),
14296height: el.height()
14297};
14298this.originalSize = this._helper ? {
14299width: el.outerWidth(),
14300height: el.outerHeight()
14301} : {
14302width: el.width(),
14303height: el.height()
14304};
14305this.sizeDiff = {
14306width: el.outerWidth() - el.width(),
14307height: el.outerHeight() - el.height()
14308};
14309this.originalPosition = {
14310left: curleft,
14311top: curtop
14312};
14313this.originalMousePosition = {
14314left: event.pageX,
14315top: event.pageY
14316};
14317this.aspectRatio = (typeof o.aspectRatio === "number") ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
14318cursor = $(".ui-resizable-" + this.axis).css("cursor");
14319$("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
14320el.addClass("ui-resizable-resizing");
14321this._propagate("start", event);
14322return true;
14323},
14324_mouseDrag: function(event) {
14325var data, props, smp = this.originalMousePosition, a = this.axis, dx = (event.pageX - smp.left) || 0, dy = (event.pageY - smp.top) || 0, trigger = this._change[a];
14326this._updatePrevProperties();
14327if (!trigger) {
14328return false;
14329}
14330data = trigger.apply(this, [event, dx, dy]);
14331this._updateVirtualBoundaries(event.shiftKey);
14332if (this._aspectRatio || event.shiftKey) {
14333data = this._updateRatio(data, event);
14334}
14335data = this._respectSize(data, event);
14336this._updateCache(data);
14337this._propagate("resize", event);
14338props = this._applyChanges();
14339if (!this._helper && this._proportionallyResizeElements.length) {
14340this._proportionallyResize();
14341}
14342if (!$.isEmptyObject(props)) {
14343this._updatePrevProperties();
14344this._trigger("resize", event, this.ui());
14345this._applyChanges();
14346}
14347return false;
14348},
14349_mouseStop: function(event) {
14350this.resizing = false;
14351var pr, ista, soffseth, soffsetw, s, left, top, o = this.options, that = this;
14352if (this._helper) {
14353pr = this._proportionallyResizeElements;
14354ista = pr.length && (/textarea/i).test(pr[0].nodeName);
14355soffseth = ista && this._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height;
14356soffsetw = ista ? 0 : that.sizeDiff.width;
14357s = {
14358width: (that.helper.width() - soffsetw),
14359height: (that.helper.height() - soffseth)
14360};
14361left = (parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left)) || null;
14362top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null;
14363if (!o.animate) {
14364this.element.css($.extend(s, {
vendor: 11,770 bytes, lines 14365-14773
14365top: top,
14366left: left
14367}));
14368}
14369that.helper.height(that.size.height);
14370that.helper.width(that.size.width);
14371if (this._helper && !o.animate) {
14372this._proportionallyResize();
14373}
14374}
14375$("body").css("cursor", "auto");
14376this.element.removeClass("ui-resizable-resizing");
14377this._propagate("stop", event);
14378if (this._helper) {
14379this.helper.remove();
14380}
14381return false;
14382},
14383_updatePrevProperties: function() {
14384this.prevPosition = {
14385top: this.position.top,
14386left: this.position.left
14387};
14388this.prevSize = {
14389width: this.size.width,
14390height: this.size.height
14391};
14392},
14393_applyChanges: function() {
14394var props = {};
14395if (this.position.top !== this.prevPosition.top) {
14396props.top = this.position.top + "px";
14397}
14398if (this.position.left !== this.prevPosition.left) {
14399props.left = this.position.left + "px";
14400}
14401if (this.size.width !== this.prevSize.width) {
14402props.width = this.size.width + "px";
14403}
14404if (this.size.height !== this.prevSize.height) {
14405props.height = this.size.height + "px";
14406}
14407this.helper.css(props);
14408return props;
14409},
14410_updateVirtualBoundaries: function(forceAspectRatio) {
14411var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b, o = this.options;
14412b = {
14413minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
14414maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,
14415minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
14416maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity
14417};
14418if (this._aspectRatio || forceAspectRatio) {
14419pMinWidth = b.minHeight * this.aspectRatio;
14420pMinHeight = b.minWidth / this.aspectRatio;
14421pMaxWidth = b.maxHeight * this.aspectRatio;
14422pMaxHeight = b.maxWidth / this.aspectRatio;
14423if (pMinWidth > b.minWidth) {
14424b.minWidth = pMinWidth;
14425}
14426if (pMinHeight > b.minHeight) {
14427b.minHeight = pMinHeight;
14428}
14429if (pMaxWidth < b.maxWidth) {
14430b.maxWidth = pMaxWidth;
14431}
14432if (pMaxHeight < b.maxHeight) {
14433b.maxHeight = pMaxHeight;
14434}
14435}
14436this._vBoundaries = b;
14437},
14438_updateCache: function(data) {
14439this.offset = this.helper.offset();
14440if (this._isNumber(data.left)) {
14441this.position.left = data.left;
14442}
14443if (this._isNumber(data.top)) {
14444this.position.top = data.top;
14445}
14446if (this._isNumber(data.height)) {
14447this.size.height = data.height;
14448}
14449if (this._isNumber(data.width)) {
14450this.size.width = data.width;
14451}
14452},
14453_updateRatio: function(data) {
14454var cpos = this.position
14455  , csize = this.size
14456  , a = this.axis;
14457if (this._isNumber(data.height)) {
14458data.width = (data.height * this.aspectRatio);
14459} else if (this._isNumber(data.width)) {
14460data.height = (data.width / this.aspectRatio);
14461}
14462if (a === "sw") {
14463data.left = cpos.left + (csize.width - data.width);
14464data.top = null;
14465}
14466if (a === "nw") {
14467data.top = cpos.top + (csize.height - data.height);
14468data.left = cpos.left + (csize.width - data.width);
14469}
14470return data;
14471},
14472_respectSize: function(data) {
14473var o = this._vBoundaries
14474  , a = this.axis
14475  , ismaxw = this._isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width)
14476  , ismaxh = this._isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height)
14477  , isminw = this._isNumber(data.width) && o.minWidth && (o.minWidth > data.width)
14478  , isminh = this._isNumber(data.height) && o.minHeight && (o.minHeight > data.height)
14479  , dw = this.originalPosition.left + this.originalSize.width
14480  , dh = this.position.top + this.size.height
14481  , cw = /sw|nw|w/.test(a)
14482  , ch = /nw|ne|n/.test(a);
14483if (isminw) {
14484data.width = o.minWidth;
14485}
14486if (isminh) {
14487data.height = o.minHeight;
14488}
14489if (ismaxw) {
14490data.width = o.maxWidth;
14491}
14492if (ismaxh) {
14493data.height = o.maxHeight;
14494}
14495if (isminw && cw) {
14496data.left = dw - o.minWidth;
14497}
14498if (ismaxw && cw) {
14499data.left = dw - o.maxWidth;
14500}
14501if (isminh && ch) {
14502data.top = dh - o.minHeight;
14503}
14504if (ismaxh && ch) {
14505data.top = dh - o.maxHeight;
14506}
14507if (!data.width && !data.height && !data.left && data.top) {
14508data.top = null;
14509} else if (!data.width && !data.height && !data.top && data.left) {
14510data.left = null;
14511}
14512return data;
14513},
14514_getPaddingPlusBorderDimensions: function(element) {
14515var i = 0
14516  , widths = []
14517  , borders = [element.css("borderTopWidth"), element.css("borderRightWidth"), element.css("borderBottomWidth"), element.css("borderLeftWidth")]
14518  , paddings = [element.css("paddingTop"), element.css("paddingRight"), element.css("paddingBottom"), element.css("paddingLeft")];
14519for (; i < 4; i++) {
14520widths[i] = (parseInt(borders[i], 10) || 0);
14521widths[i] += (parseInt(paddings[i], 10) || 0);
14522}
14523return {
14524height: widths[0] + widths[2],
14525width: widths[1] + widths[3]
14526};
14527},
14528_proportionallyResize: function() {
14529if (!this._proportionallyResizeElements.length) {
14530return;
14531}
14532var prel, i = 0, element = this.helper || this.element;
14533for (; i < this._proportionallyResizeElements.length; i++) {
14534prel = this._proportionallyResizeElements[i];
14535if (!this.outerDimensions) {
14536this.outerDimensions = this._getPaddingPlusBorderDimensions(prel);
14537}
14538prel.css({
14539height: (element.height() - this.outerDimensions.height) || 0,
14540width: (element.width() - this.outerDimensions.width) || 0
14541});
14542}
14543},
14544_renderProxy: function() {
14545var el = this.element
14546  , o = this.options;
14547this.elementOffset = el.offset();
14548if (this._helper) {
14549this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
14550this.helper.addClass(this._helper).css({
14551width: this.element.outerWidth() - 1,
14552height: this.element.outerHeight() - 1,
14553position: "absolute",
14554left: this.elementOffset.left + "px",
14555top: this.elementOffset.top + "px",
14556zIndex: ++o.zIndex
14557});
14558this.helper.appendTo("body").disableSelection();
14559} else {
14560this.helper = this.element;
14561}
14562},
14563_change: {
14564e: function(event, dx) {
14565return {
14566width: this.originalSize.width + dx
14567};
14568},
14569w: function(event, dx) {
14570var cs = this.originalSize
14571  , sp = this.originalPosition;
14572return {
14573left: sp.left + dx,
14574width: cs.width - dx
14575};
14576},
14577n: function(event, dx, dy) {
14578var cs = this.originalSize
14579  , sp = this.originalPosition;
14580return {
14581top: sp.top + dy,
14582height: cs.height - dy
14583};
14584},
14585s: function(event, dx, dy) {
14586return {
14587height: this.originalSize.height + dy
14588};
14589},
14590se: function(event, dx, dy) {
14591return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
14592},
14593sw: function(event, dx, dy) {
14594return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
14595},
14596ne: function(event, dx, dy) {
14597return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
14598},
14599nw: function(event, dx, dy) {
14600return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
14601}
14602},
14603_propagate: function(n, event) {
14604$.ui.plugin.call(this, n, [event, this.ui()]);
14605(n !== "resize" && this._trigger(n, event, this.ui()));
14606},
14607plugins: {},
14608ui: function() {
14609return {
14610originalElement: this.originalElement,
14611element: this.element,
14612helper: this.helper,
14613position: this.position,
14614size: this.size,
14615originalSize: this.originalSize,
14616originalPosition: this.originalPosition
14617};
14618}
14619});
14620$.ui.plugin.add("resizable", "animate", {
14621stop: function(event) {
14622var that = $(this).resizable("instance")
14623  , o = that.options
14624  , pr = that._proportionallyResizeElements
14625  , ista = pr.length && (/textarea/i).test(pr[0].nodeName)
14626  , soffseth = ista && that._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height
14627  , soffsetw = ista ? 0 : that.sizeDiff.width
14628  , style = {
14629width: (that.size.width - soffsetw),
14630height: (that.size.height - soffseth)
14631}
14632  , left = (parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left)) || null
14633  , top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null;
14634that.element.animate($.extend(style, top && left ? {
14635top: top,
14636left: left
14637} : {}), {
14638duration: o.animateDuration,
14639easing: o.animateEasing,
14640step: function() {
14641var data = {
14642width: parseInt(that.element.css("width"), 10),
14643height: parseInt(that.element.css("height"), 10),
14644top: parseInt(that.element.css("top"), 10),
14645left: parseInt(that.element.css("left"), 10)
14646};
14647if (pr && pr.length) {
14648$(pr[0]).css({
14649width: data.width,
14650height: data.height
14651});
14652}
14653that._updateCache(data);
14654that._propagate("resize", event);
14655}
14656});
14657}
14658});
14659$.ui.plugin.add("resizable", "containment", {
14660start: function() {
14661var element, p, co, ch, cw, width, height, that = $(this).resizable("instance"), o = that.options, el = that.element, oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
14662if (!ce) {
14663return;
14664}
14665that.containerElement = $(ce);
14666if (/document/.test(oc) || oc === document) {
14667that.containerOffset = {
14668left: 0,
14669top: 0
14670};
14671that.containerPosition = {
14672left: 0,
14673top: 0
14674};
14675that.parentData = {
14676element: $(document),
14677left: 0,
14678top: 0,
14679width: $(document).width(),
14680height: $(document).height() || document.body.parentNode.scrollHeight
14681};
14682} else {
14683element = $(ce);
14684p = [];
14685$(["Top", "Right", "Left", "Bottom"]).each(function(i, name) {
14686p[i] = that._num(element.css("padding" + name));
14687});
14688that.containerOffset = element.offset();
14689that.containerPosition = element.position();
14690that.containerSize = {
14691height: (element.innerHeight() - p[3]),
14692width: (element.innerWidth() - p[1])
14693};
14694co = that.containerOffset;
14695ch = that.containerSize.height;
14696cw = that.containerSize.width;
14697width = (that._hasScroll(ce, "left") ? ce.scrollWidth : cw);
14698height = (that._hasScroll(ce) ? ce.scrollHeight : ch);
14699that.parentData = {
14700element: ce,
14701left: co.left,
14702top: co.top,
14703width: width,
14704height: height
14705};
14706}
14707},
14708resize: function(event) {
14709var woset, hoset, isParent, isOffsetRelative, that = $(this).resizable("instance"), o = that.options, co = that.containerOffset, cp = that.position, pRatio = that._aspectRatio || event.shiftKey, cop = {
14710top: 0,
14711left: 0
14712}, ce = that.containerElement, continueResize = true;
14713if (ce[0] !== document && (/static/).test(ce.css("position"))) {
14714cop = co;
14715}
14716if (cp.left < (that._helper ? co.left : 0)) {
14717that.size.width = that.size.width + (that._helper ? (that.position.left - co.left) : (that.position.left - cop.left));
14718if (pRatio) {
14719that.size.height = that.size.width / that.aspectRatio;
14720continueResize = false;
14721}
14722that.position.left = o.helper ? co.left : 0;
14723}
14724if (cp.top < (that._helper ? co.top : 0)) {
14725that.size.height = that.size.height + (that._helper ? (that.position.top - co.top) : that.position.top);
14726if (pRatio) {
14727that.size.width = that.size.height * that.aspectRatio;
14728continueResize = false;
14729}
14730that.position.top = that._helper ? co.top : 0;
14731}
14732isParent = that.containerElement.get(0) === that.element.parent().get(0);
14733isOffsetRelative = /relative|absolute/.test(that.containerElement.css("position"));
14734if (isParent && isOffsetRelative) {
14735that.offset.left = that.parentData.left + that.position.left;
14736that.offset.top = that.parentData.top + that.position.top;
14737} else {
14738that.offset.left = that.element.offset().left;
14739that.offset.top = that.element.offset().top;
14740}
14741woset = Math.abs(that.sizeDiff.width + (that._helper ? that.offset.left - cop.left : (that.offset.left - co.left)));
14742hoset = Math.abs(that.sizeDiff.height + (that._helper ? that.offset.top - cop.top : (that.offset.top - co.top)));
14743if (woset + that.size.width >= that.parentData.width) {
14744that.size.width = that.parentData.width - woset;
14745if (pRatio) {
14746that.size.height = that.size.width / that.aspectRatio;
14747continueResize = false;
14748}
14749}
14750if (hoset + that.size.height >= that.parentData.height) {
14751that.size.height = that.parentData.height - hoset;
14752if (pRatio) {
14753that.size.width = that.size.height * that.aspectRatio;
14754continueResize = false;
14755}
14756}
14757if (!continueResize) {
14758that.position.left = that.prevPosition.left;
14759that.position.top = that.prevPosition.top;
14760that.size.width = that.prevSize.width;
14761that.size.height = that.prevSize.height;
14762}
14763},
14764stop: function() {
14765var that = $(this).resizable("instance")
14766  , o = that.options
14767  , co = that.containerOffset
14768  , cop = that.containerPosition
14769  , ce = that.containerElement
14770  , helper = $(that.helper)
14771  , ho = helper.offset()
14772  , w = helper.outerWidth() - that.sizeDiff.width
14773  , h = helper.outerHeight() - that.sizeDiff.height;
vendor: 4,464 bytes, lines 14774-14937
14774if (that._helper && !o.animate && (/relative/).test(ce.css("position"))) {
14775$(this).css({
14776left: ho.left - cop.left - co.left,
14777width: w,
14778height: h
14779});
14780}
14781if (that._helper && !o.animate && (/static/).test(ce.css("position"))) {
14782$(this).css({
14783left: ho.left - cop.left - co.left,
14784width: w,
14785height: h
14786});
14787}
14788}
14789});
14790$.ui.plugin.add("resizable", "alsoResize", {
14791start: function() {
14792var that = $(this).resizable("instance")
14793  , o = that.options;
14794$(o.alsoResize).each(function() {
14795var el = $(this);
14796el.data("ui-resizable-alsoresize", {
14797width: parseInt(el.width(), 10),
14798height: parseInt(el.height(), 10),
14799left: parseInt(el.css("left"), 10),
14800top: parseInt(el.css("top"), 10)
14801});
14802});
14803},
14804resize: function(event, ui) {
14805var that = $(this).resizable("instance")
14806  , o = that.options
14807  , os = that.originalSize
14808  , op = that.originalPosition
14809  , delta = {
14810height: (that.size.height - os.height) || 0,
14811width: (that.size.width - os.width) || 0,
14812top: (that.position.top - op.top) || 0,
14813left: (that.position.left - op.left) || 0
14814};
14815$(o.alsoResize).each(function() {
14816var el = $(this)
14817  , start = $(this).data("ui-resizable-alsoresize")
14818  , style = {}
14819  , css = el.parents(ui.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"];
14820$.each(css, function(i, prop) {
14821var sum = (start[prop] || 0) + (delta[prop] || 0);
14822if (sum && sum >= 0) {
14823style[prop] = sum || null;
14824}
14825});
14826el.css(style);
14827});
14828},
14829stop: function() {
14830$(this).removeData("resizable-alsoresize");
14831}
14832});
14833$.ui.plugin.add("resizable", "ghost", {
14834start: function() {
14835var that = $(this).resizable("instance")
14836  , o = that.options
14837  , cs = that.size;
14838that.ghost = that.originalElement.clone();
14839that.ghost.css({
14840opacity: 0.25,
14841display: "block",
14842position: "relative",
14843height: cs.height,
14844width: cs.width,
14845margin: 0,
14846left: 0,
14847top: 0
14848}).addClass("ui-resizable-ghost").addClass(typeof o.ghost === "string" ? o.ghost : "");
14849that.ghost.appendTo(that.helper);
14850},
14851resize: function() {
14852var that = $(this).resizable("instance");
14853if (that.ghost) {
14854that.ghost.css({
14855position: "relative",
14856height: that.size.height,
14857width: that.size.width
14858});
14859}
14860},
14861stop: function() {
14862var that = $(this).resizable("instance");
14863if (that.ghost && that.helper) {
14864that.helper.get(0).removeChild(that.ghost.get(0));
14865}
14866}
14867});
14868$.ui.plugin.add("resizable", "grid", {
14869resize: function() {
14870var outerDimensions, that = $(this).resizable("instance"), o = that.options, cs = that.size, os = that.originalSize, op = that.originalPosition, a = that.axis, grid = typeof o.grid === "number" ? [o.grid, o.grid] : o.grid, gridX = (grid[0] || 1), gridY = (grid[1] || 1), ox = Math.round((cs.width - os.width) / gridX) * gridX, oy = Math.round((cs.height - os.height) / gridY) * gridY, newWidth = os.width + ox, newHeight = os.height + oy, isMaxWidth = o.maxWidth && (o.maxWidth < newWidth), isMaxHeight = o.maxHeight && (o.maxHeight < newHeight), isMinWidth = o.minWidth && (o.minWidth > newWidth), isMinHeight = o.minHeight && (o.minHeight > newHeight);
14871o.grid = grid;
14872if (isMinWidth) {
14873newWidth += gridX;
14874}
14875if (isMinHeight) {
14876newHeight += gridY;
14877}
14878if (isMaxWidth) {
14879newWidth -= gridX;
14880}
14881if (isMaxHeight) {
14882newHeight -= gridY;
14883}
14884if (/^(se|s|e)$/.test(a)) {
14885that.size.width = newWidth;
14886that.size.height = newHeight;
14887} else if (/^(ne)$/.test(a)) {
14888that.size.width = newWidth;
14889that.size.height = newHeight;
14890that.position.top = op.top - oy;
14891} else if (/^(sw)$/.test(a)) {
14892that.size.width = newWidth;
14893that.size.height = newHeight;
14894that.position.left = op.left - ox;
14895} else {
14896if (newHeight - gridY <= 0 || newWidth - gridX <= 0) {
14897outerDimensions = that._getPaddingPlusBorderDimensions(this);
14898}
14899if (newHeight - gridY > 0) {
14900that.size.height = newHeight;
14901that.position.top = op.top - oy;
14902} else {
14903newHeight = gridY - outerDimensions.height;
14904that.size.height = newHeight;
14905that.position.top = op.top + os.height - newHeight;
14906}
14907if (newWidth - gridX > 0) {
14908that.size.width = newWidth;
14909that.position.left = op.left - ox;
14910} else {
14911newWidth = gridX - outerDimensions.width;
14912that.size.width = newWidth;
14913that.position.left = op.left + os.width - newWidth;
14914}
14915}
14916}
14917});
14918var resizable = $.ui.resizable;
14919var selectable = $.widget("ui.selectable", $.ui.mouse, {
14920version: "1.11.4",
14921options: {
14922appendTo: "body",
14923autoRefresh: true,
14924distance: 0,
14925filter: "*",
14926tolerance: "touch",
14927selected: null,
14928selecting: null,
14929start: null,
14930stop: null,
14931unselected: null,
14932unselecting: null
14933},
14934_create: function() {
14935var selectees, that = this;
14936this.element.addClass("ui-selectable");
14937this.dragged = false;
vendor: 1,228 bytes, lines 14938-14984
14938this.refresh = function() {
14939selectees = $(that.options.filter, that.element[0]);
14940selectees.addClass("ui-selectee");
14941selectees.each(function() {
14942var $this = $(this)
14943  , pos = $this.offset();
14944$.data(this, "selectable-item", {
14945element: this,
14946$element: $this,
14947left: pos.left,
14948top: pos.top,
14949right: pos.left + $this.outerWidth(),
14950bottom: pos.top + $this.outerHeight(),
14951startselected: false,
14952selected: $this.hasClass("ui-selected"),
14953selecting: $this.hasClass("ui-selecting"),
14954unselecting: $this.hasClass("ui-unselecting")
14955});
14956});
14957}
14958;
14959this.refresh();
14960this.selectees = selectees.addClass("ui-selectee");
14961this._mouseInit();
14962this.helper = $("<div class='ui-selectable-helper'></div>");
14963},
14964_destroy: function() {
14965this.selectees.removeClass("ui-selectee").removeData("selectable-item");
14966this.element.removeClass("ui-selectable ui-selectable-disabled");
14967this._mouseDestroy();
14968},
14969_mouseStart: function(event) {
14970var that = this
14971  , options = this.options;
14972this.opos = [event.pageX, event.pageY];
14973if (this.options.disabled) {
14974return;
14975}
14976this.selectees = $(options.filter, this.element[0]);
14977this._trigger("start", event);
14978$(options.appendTo).append(this.helper);
14979this.helper.css({
14980"left": event.pageX,
14981"top": event.pageY,
14982"width": 0,
14983"height": 0
14984}
vendor: 33,165 bytes, lines 14984-15920
14984);
14985if (options.autoRefresh) {
14986this.refresh();
14987}
14988this.selectees.filter(".ui-selected").each(function() {
14989var selectee = $.data(this, "selectable-item");
14990selectee.startselected = true;
14991if (!event.metaKey && !event.ctrlKey) {
14992selectee.$element.removeClass("ui-selected");
14993selectee.selected = false;
14994selectee.$element.addClass("ui-unselecting");
14995selectee.unselecting = true;
14996that._trigger("unselecting", event, {
14997unselecting: selectee.element
14998});
14999}
15000});
15001$(event.target).parents().addBack().each(function() {
15002var doSelect, selectee = $.data(this, "selectable-item");
15003if (selectee) {
15004doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass("ui-selected");
15005selectee.$element.removeClass(doSelect ? "ui-unselecting" : "ui-selected").addClass(doSelect ? "ui-selecting" : "ui-unselecting");
15006selectee.unselecting = !doSelect;
15007selectee.selecting = doSelect;
15008selectee.selected = doSelect;
15009if (doSelect) {
15010that._trigger("selecting", event, {
15011selecting: selectee.element
15012});
15013} else {
15014that._trigger("unselecting", event, {
15015unselecting: selectee.element
15016});
15017}
15018return false;
15019}
15020});
15021},
15022_mouseDrag: function(event) {
15023this.dragged = true;
15024if (this.options.disabled) {
15025return;
15026}
15027var tmp, that = this, options = this.options, x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY;
15028if (x1 > x2) {
15029tmp = x2;
15030x2 = x1;
15031x1 = tmp;
15032}
15033if (y1 > y2) {
15034tmp = y2;
15035y2 = y1;
15036y1 = tmp;
15037}
15038this.helper.css({
15039left: x1,
15040top: y1,
15041width: x2 - x1,
15042height: y2 - y1
15043});
15044this.selectees.each(function() {
15045var selectee = $.data(this, "selectable-item")
15046  , hit = false;
15047if (!selectee || selectee.element === that.element[0]) {
15048return;
15049}
15050if (options.tolerance === "touch") {
15051hit = (!(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1));
15052} else if (options.tolerance === "fit") {
15053hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
15054}
15055if (hit) {
15056if (selectee.selected) {
15057selectee.$element.removeClass("ui-selected");
15058selectee.selected = false;
15059}
15060if (selectee.unselecting) {
15061selectee.$element.removeClass("ui-unselecting");
15062selectee.unselecting = false;
15063}
15064if (!selectee.selecting) {
15065selectee.$element.addClass("ui-selecting");
15066selectee.selecting = true;
15067that._trigger("selecting", event, {
15068selecting: selectee.element
15069});
15070}
15071} else {
15072if (selectee.selecting) {
15073if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
15074selectee.$element.removeClass("ui-selecting");
15075selectee.selecting = false;
15076selectee.$element.addClass("ui-selected");
15077selectee.selected = true;
15078} else {
15079selectee.$element.removeClass("ui-selecting");
15080selectee.selecting = false;
15081if (selectee.startselected) {
15082selectee.$element.addClass("ui-unselecting");
15083selectee.unselecting = true;
15084}
15085that._trigger("unselecting", event, {
15086unselecting: selectee.element
15087});
15088}
15089}
15090if (selectee.selected) {
15091if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
15092selectee.$element.removeClass("ui-selected");
15093selectee.selected = false;
15094selectee.$element.addClass("ui-unselecting");
15095selectee.unselecting = true;
15096that._trigger("unselecting", event, {
15097unselecting: selectee.element
15098});
15099}
15100}
15101}
15102});
15103return false;
15104},
15105_mouseStop: function(event) {
15106var that = this;
15107this.dragged = false;
15108$(".ui-unselecting", this.element[0]).each(function() {
15109var selectee = $.data(this, "selectable-item");
15110selectee.$element.removeClass("ui-unselecting");
15111selectee.unselecting = false;
15112selectee.startselected = false;
15113that._trigger("unselected", event, {
15114unselected: selectee.element
15115});
15116});
15117$(".ui-selecting", this.element[0]).each(function() {
15118var selectee = $.data(this, "selectable-item");
15119selectee.$element.removeClass("ui-selecting").addClass("ui-selected");
15120selectee.selecting = false;
15121selectee.selected = true;
15122selectee.startselected = true;
15123that._trigger("selected", event, {
15124selected: selectee.element
15125});
15126});
15127this._trigger("stop", event);
15128this.helper.remove();
15129return false;
15130}
15131});
15132var sortable = $.widget("ui.sortable", $.ui.mouse, {
15133version: "1.11.4",
15134widgetEventPrefix: "sort",
15135ready: false,
15136options: {
15137appendTo: "parent",
15138axis: false,
15139connectWith: false,
15140containment: false,
15141cursor: "auto",
15142cursorAt: false,
15143dropOnEmpty: true,
15144forcePlaceholderSize: false,
15145forceHelperSize: false,
15146grid: false,
15147handle: false,
15148helper: "original",
15149items: "> *",
15150opacity: false,
15151placeholder: false,
15152revert: false,
15153scroll: true,
15154scrollSensitivity: 20,
15155scrollSpeed: 20,
15156scope: "default",
15157tolerance: "intersect",
15158zIndex: 1000,
15159activate: null,
15160beforeStop: null,
15161change: null,
15162deactivate: null,
15163out: null,
15164over: null,
15165receive: null,
15166remove: null,
15167sort: null,
15168start: null,
15169stop: null,
15170update: null
15171},
15172_isOverAxis: function(x, reference, size) {
15173return (x >= reference) && (x < (reference + size));
15174},
15175_isFloating: function(item) {
15176return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
15177},
15178_create: function() {
15179this.containerCache = {};
15180this.element.addClass("ui-sortable");
15181this.refresh();
15182this.offset = this.element.offset();
15183this._mouseInit();
15184this._setHandleClassName();
15185this.ready = true;
15186},
15187_setOption: function(key, value) {
15188this._super(key, value);
15189if (key === "handle") {
15190this._setHandleClassName();
15191}
15192},
15193_setHandleClassName: function() {
15194this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle");
15195$.each(this.items, function() {
15196(this.instance.options.handle ? this.item.find(this.instance.options.handle) : this.item).addClass("ui-sortable-handle");
15197});
15198},
15199_destroy: function() {
15200this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle");
15201this._mouseDestroy();
15202for (var i = this.items.length - 1; i >= 0; i--) {
15203this.items[i].item.removeData(this.widgetName + "-item");
15204}
15205return this;
15206},
15207_mouseCapture: function(event, overrideHandle) {
15208var currentItem = null
15209  , validHandle = false
15210  , that = this;
15211if (this.reverting) {
15212return false;
15213}
15214if (this.options.disabled || this.options.type === "static") {
15215return false;
15216}
15217this._refreshItems(event);
15218$(event.target).parents().each(function() {
15219if ($.data(this, that.widgetName + "-item") === that) {
15220currentItem = $(this);
15221return false;
15222}
15223});
15224if ($.data(event.target, that.widgetName + "-item") === that) {
15225currentItem = $(event.target);
15226}
15227if (!currentItem) {
15228return false;
15229}
15230if (this.options.handle && !overrideHandle) {
15231$(this.options.handle, currentItem).find("*").addBack().each(function() {
15232if (this === event.target) {
15233validHandle = true;
15234}
15235});
15236if (!validHandle) {
15237return false;
15238}
15239}
15240this.currentItem = currentItem;
15241this._removeCurrentsFromItems();
15242return true;
15243},
15244_mouseStart: function(event, overrideHandle, noActivation) {
15245var i, body, o = this.options;
15246this.currentContainer = this;
15247this.refreshPositions();
15248this.helper = this._createHelper(event);
15249this._cacheHelperProportions();
15250this._cacheMargins();
15251this.scrollParent = this.helper.scrollParent();
15252this.offset = this.currentItem.offset();
15253this.offset = {
15254top: this.offset.top - this.margins.top,
15255left: this.offset.left - this.margins.left
15256};
15257$.extend(this.offset, {
15258click: {
15259left: event.pageX - this.offset.left,
15260top: event.pageY - this.offset.top
15261},
15262parent: this._getParentOffset(),
15263relative: this._getRelativeOffset()
15264});
15265this.helper.css("position", "absolute");
15266this.cssPosition = this.helper.css("position");
15267this.originalPosition = this._generatePosition(event);
15268this.originalPageX = event.pageX;
15269this.originalPageY = event.pageY;
15270(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
15271this.domPosition = {
15272prev: this.currentItem.prev()[0],
15273parent: this.currentItem.parent()[0]
15274};
15275if (this.helper[0] !== this.currentItem[0]) {
15276this.currentItem.hide();
15277}
15278this._createPlaceholder();
15279if (o.containment) {
15280this._setContainment();
15281}
15282if (o.cursor && o.cursor !== "auto") {
15283body = this.document.find("body");
15284this.storedCursor = body.css("cursor");
15285body.css("cursor", o.cursor);
15286this.storedStylesheet = $("<style>*{ cursor: " + o.cursor + " !important; }</style>").appendTo(body);
15287}
15288if (o.opacity) {
15289if (this.helper.css("opacity")) {
15290this._storedOpacity = this.helper.css("opacity");
15291}
15292this.helper.css("opacity", o.opacity);
15293}
15294if (o.zIndex) {
15295if (this.helper.css("zIndex")) {
15296this._storedZIndex = this.helper.css("zIndex");
15297}
15298this.helper.css("zIndex", o.zIndex);
15299}
15300if (this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
15301this.overflowOffset = this.scrollParent.offset();
15302}
15303this._trigger("start", event, this._uiHash());
15304if (!this._preserveHelperProportions) {
15305this._cacheHelperProportions();
15306}
15307if (!noActivation) {
15308for (i = this.containers.length - 1; i >= 0; i--) {
15309this.containers[i]._trigger("activate", event, this._uiHash(this));
15310}
15311}
15312if ($.ui.ddmanager) {
15313$.ui.ddmanager.current = this;
15314}
15315if ($.ui.ddmanager && !o.dropBehaviour) {
15316$.ui.ddmanager.prepareOffsets(this, event);
15317}
15318this.dragging = true;
15319this.helper.addClass("ui-sortable-helper");
15320this._mouseDrag(event);
15321return true;
15322},
15323_mouseDrag: function(event) {
15324var i, item, itemElement, intersection, o = this.options, scrolled = false;
15325this.position = this._generatePosition(event);
15326this.positionAbs = this._convertPositionTo("absolute");
15327if (!this.lastPositionAbs) {
15328this.lastPositionAbs = this.positionAbs;
15329}
15330if (this.options.scroll) {
15331if (this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
15332if ((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
15333this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
15334} else if (event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
15335this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
15336}
15337if ((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
15338this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
15339} else if (event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
15340this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
15341}
15342} else {
15343if (event.pageY - this.document.scrollTop() < o.scrollSensitivity) {
15344scrolled = this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed);
15345} else if (this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity) {
15346scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed);
15347}
15348if (event.pageX - this.document.scrollLeft() < o.scrollSensitivity) {
15349scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed);
15350} else if (this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) {
15351scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed);
15352}
15353}
15354if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
15355$.ui.ddmanager.prepareOffsets(this, event);
15356}
15357}
15358this.positionAbs = this._convertPositionTo("absolute");
15359if (!this.options.axis || this.options.axis !== "y") {
15360this.helper[0].style.left = this.position.left + "px";
15361}
15362if (!this.options.axis || this.options.axis !== "x") {
15363this.helper[0].style.top = this.position.top + "px";
15364}
15365for (i = this.items.length - 1; i >= 0; i--) {
15366item = this.items[i];
15367itemElement = item.item[0];
15368intersection = this._intersectsWithPointer(item);
15369if (!intersection) {
15370continue;
15371}
15372if (item.instance !== this.currentContainer) {
15373continue;
15374}
15375if (itemElement !== this.currentItem[0] && this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement && !$.contains(this.placeholder[0], itemElement) && (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)) {
15376this.direction = intersection === 1 ? "down" : "up";
15377if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
15378this._rearrange(event, item);
15379} else {
15380break;
15381}
15382this._trigger("change", event, this._uiHash());
15383break;
15384}
15385}
15386this._contactContainers(event);
15387if ($.ui.ddmanager) {
15388$.ui.ddmanager.drag(this, event);
15389}
15390this._trigger("sort", event, this._uiHash());
15391this.lastPositionAbs = this.positionAbs;
15392return false;
15393},
15394_mouseStop: function(event, noPropagation) {
15395if (!event) {
15396return;
15397}
15398if ($.ui.ddmanager && !this.options.dropBehaviour) {
15399$.ui.ddmanager.drop(this, event);
15400}
15401if (this.options.revert) {
15402var that = this
15403  , cur = this.placeholder.offset()
15404  , axis = this.options.axis
15405  , animation = {};
15406if (!axis || axis === "x") {
15407animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft);
15408}
15409if (!axis || axis === "y") {
15410animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop);
15411}
15412this.reverting = true;
15413$(this.helper).animate(animation, parseInt(this.options.revert, 10) || 500, function() {
15414that._clear(event);
15415});
15416} else {
15417this._clear(event, noPropagation);
15418}
15419return false;
15420},
15421cancel: function() {
15422if (this.dragging) {
15423this._mouseUp({
15424target: null
15425});
15426if (this.options.helper === "original") {
15427this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
15428} else {
15429this.currentItem.show();
15430}
15431for (var i = this.containers.length - 1; i >= 0; i--) {
15432this.containers[i]._trigger("deactivate", null, this._uiHash(this));
15433if (this.containers[i].containerCache.over) {
15434this.containers[i]._trigger("out", null, this._uiHash(this));
15435this.containers[i].containerCache.over = 0;
15436}
15437}
15438}
15439if (this.placeholder) {
15440if (this.placeholder[0].parentNode) {
15441this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
15442}
15443if (this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
15444this.helper.remove();
15445}
15446$.extend(this, {
15447helper: null,
15448dragging: false,
15449reverting: false,
15450_noFinalSort: null
15451});
15452if (this.domPosition.prev) {
15453$(this.domPosition.prev).after(this.currentItem);
15454} else {
15455$(this.domPosition.parent).prepend(this.currentItem);
15456}
15457}
15458return this;
15459},
15460serialize: function(o) {
15461var items = this._getItemsAsjQuery(o && o.connected)
15462  , str = [];
15463o = o || {};
15464$(items).each(function() {
15465var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/));
15466if (res) {
15467str.push((o.key || res[1] + "[]") + "=" + (o.key && o.expression ? res[1] : res[2]));
15468}
15469});
15470if (!str.length && o.key) {
15471str.push(o.key + "=");
15472}
15473return str.join("&");
15474},
15475toArray: function(o) {
15476var items = this._getItemsAsjQuery(o && o.connected)
15477  , ret = [];
15478o = o || {};
15479items.each(function() {
15480ret.push($(o.item || this).attr(o.attribute || "id") || "");
15481});
15482return ret;
15483},
15484_intersectsWith: function(item) {
15485var x1 = this.positionAbs.left
15486  , x2 = x1 + this.helperProportions.width
15487  , y1 = this.positionAbs.top
15488  , y2 = y1 + this.helperProportions.height
15489  , l = item.left
15490  , r = l + item.width
15491  , t = item.top
15492  , b = t + item.height
15493  , dyClick = this.offset.click.top
15494  , dxClick = this.offset.click.left
15495  , isOverElementHeight = (this.options.axis === "x") || ((y1 + dyClick) > t && (y1 + dyClick) < b)
15496  , isOverElementWidth = (this.options.axis === "y") || ((x1 + dxClick) > l && (x1 + dxClick) < r)
15497  , isOverElement = isOverElementHeight && isOverElementWidth;
15498if (this.options.tolerance === "pointer" || this.options.forcePointerForContainers || (this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])) {
15499return isOverElement;
15500} else {
15501return (l < x1 + (this.helperProportions.width / 2) && x2 - (this.helperProportions.width / 2) < r && t < y1 + (this.helperProportions.height / 2) && y2 - (this.helperProportions.height / 2) < b);
15502}
15503},
15504_intersectsWithPointer: function(item) {
15505var isOverElementHeight = (this.options.axis === "x") || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height)
15506  , isOverElementWidth = (this.options.axis === "y") || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width)
15507  , isOverElement = isOverElementHeight && isOverElementWidth
15508  , verticalDirection = this._getDragVerticalDirection()
15509  , horizontalDirection = this._getDragHorizontalDirection();
15510if (!isOverElement) {
15511return false;
15512}
15513return this.floating ? (((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1) : (verticalDirection && (verticalDirection === "down" ? 2 : 1));
15514},
15515_intersectsWithSides: function(item) {
15516var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height / 2), item.height)
15517  , isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width / 2), item.width)
15518  , verticalDirection = this._getDragVerticalDirection()
15519  , horizontalDirection = this._getDragHorizontalDirection();
15520if (this.floating && horizontalDirection) {
15521return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));
15522} else {
15523return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));
15524}
15525},
15526_getDragVerticalDirection: function() {
15527var delta = this.positionAbs.top - this.lastPositionAbs.top;
15528return delta !== 0 && (delta > 0 ? "down" : "up");
15529},
15530_getDragHorizontalDirection: function() {
15531var delta = this.positionAbs.left - this.lastPositionAbs.left;
15532return delta !== 0 && (delta > 0 ? "right" : "left");
15533},
15534refresh: function(event) {
15535this._refreshItems(event);
15536this._setHandleClassName();
15537this.refreshPositions();
15538return this;
15539},
15540_connectWith: function() {
15541var options = this.options;
15542return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;
15543},
15544_getItemsAsjQuery: function(connected) {
15545var i, j, cur, inst, items = [], queries = [], connectWith = this._connectWith();
15546if (connectWith && connected) {
15547for (i = connectWith.length - 1; i >= 0; i--) {
15548cur = $(connectWith[i], this.document[0]);
15549for (j = cur.length - 1; j >= 0; j--) {
15550inst = $.data(cur[j], this.widgetFullName);
15551if (inst && inst !== this && !inst.options.disabled) {
15552queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);
15553}
15554}
15555}
15556}
15557queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, {
15558options: this.options,
15559item: this.currentItem
15560}) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
15561function addItems() {
15562items.push(this);
15563}
15564for (i = queries.length - 1; i >= 0; i--) {
15565queries[i][0].each(addItems);
15566}
15567return $(items);
15568},
15569_removeCurrentsFromItems: function() {
15570var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
15571this.items = $.grep(this.items, function(item) {
15572for (var j = 0; j < list.length; j++) {
15573if (list[j] === item.item[0]) {
15574return false;
15575}
15576}
15577return true;
15578});
15579},
15580_refreshItems: function(event) {
15581this.items = [];
15582this.containers = [this];
15583var i, j, cur, inst, targetData, _queries, item, queriesLength, items = this.items, queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, {
15584item: this.currentItem
15585}) : $(this.options.items, this.element), this]], connectWith = this._connectWith();
15586if (connectWith && this.ready) {
15587for (i = connectWith.length - 1; i >= 0; i--) {
15588cur = $(connectWith[i], this.document[0]);
15589for (j = cur.length - 1; j >= 0; j--) {
15590inst = $.data(cur[j], this.widgetFullName);
15591if (inst && inst !== this && !inst.options.disabled) {
15592queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, {
15593item: this.currentItem
15594}) : $(inst.options.items, inst.element), inst]);
15595this.containers.push(inst);
15596}
15597}
15598}
15599}
15600for (i = queries.length - 1; i >= 0; i--) {
15601targetData = queries[i][1];
15602_queries = queries[i][0];
15603for (j = 0,
15604queriesLength = _queries.length; j < queriesLength; j++) {
15605item = $(_queries[j]);
15606item.data(this.widgetName + "-item", targetData);
15607items.push({
15608item: item,
15609instance: targetData,
15610width: 0,
15611height: 0,
15612left: 0,
15613top: 0
15614});
15615}
15616}
15617},
15618refreshPositions: function(fast) {
15619this.floating = this.items.length ? this.options.axis === "x" || this._isFloating(this.items[0].item) : false;
15620if (this.offsetParent && this.helper) {
15621this.offset.parent = this._getParentOffset();
15622}
15623var i, item, t, p;
15624for (i = this.items.length - 1; i >= 0; i--) {
15625item = this.items[i];
15626if (item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {
15627continue;
15628}
15629t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
15630if (!fast) {
15631item.width = t.outerWidth();
15632item.height = t.outerHeight();
15633}
15634p = t.offset();
15635item.left = p.left;
15636item.top = p.top;
15637}
15638if (this.options.custom && this.options.custom.refreshContainers) {
15639this.options.custom.refreshContainers.call(this);
15640} else {
15641for (i = this.containers.length - 1; i >= 0; i--) {
15642p = this.containers[i].element.offset();
15643this.containers[i].containerCache.left = p.left;
15644this.containers[i].containerCache.top = p.top;
15645this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
15646this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
15647}
15648}
15649return this;
15650},
15651_createPlaceholder: function(that) {
15652that = that || this;
15653var className, o = that.options;
15654if (!o.placeholder || o.placeholder.constructor === String) {
15655className = o.placeholder;
15656o.placeholder = {
15657element: function() {
15658var nodeName = that.currentItem[0].nodeName.toLowerCase()
15659  , element = $("<" + nodeName + ">", that.document[0]).addClass(className || that.currentItem[0].className + " ui-sortable-placeholder").removeClass("ui-sortable-helper");
15660if (nodeName === "tbody") {
15661that._createTrPlaceholder(that.currentItem.find("tr").eq(0), $("<tr>", that.document[0]).appendTo(element));
15662} else if (nodeName === "tr") {
15663that._createTrPlaceholder(that.currentItem, element);
15664} else if (nodeName === "img") {
15665element.attr("src", that.currentItem.attr("src"));
15666}
15667if (!className) {
15668element.css("visibility", "hidden");
15669}
15670return element;
15671},
15672update: function(container, p) {
15673if (className && !o.forcePlaceholderSize) {
15674return;
15675}
15676if (!p.height()) {
15677p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop") || 0, 10) - parseInt(that.currentItem.css("paddingBottom") || 0, 10));
15678}
15679if (!p.width()) {
15680p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft") || 0, 10) - parseInt(that.currentItem.css("paddingRight") || 0, 10));
15681}
15682}
15683};
15684}
15685that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));
15686that.currentItem.after(that.placeholder);
15687o.placeholder.update(that, that.placeholder);
15688},
15689_createTrPlaceholder: function(sourceTr, targetTr) {
15690var that = this;
15691sourceTr.children().each(function() {
15692$("<td>&#160;</td>", that.document[0]).attr("colspan", $(this).attr("colspan") || 1).appendTo(targetTr);
15693});
15694},
15695_contactContainers: function(event) {
15696var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis, innermostContainer = null, innermostIndex = null;
15697for (i = this.containers.length - 1; i >= 0; i--) {
15698if ($.contains(this.currentItem[0], this.containers[i].element[0])) {
15699continue;
15700}
15701if (this._intersectsWith(this.containers[i].containerCache)) {
15702if (innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
15703continue;
15704}
15705innermostContainer = this.containers[i];
15706innermostIndex = i;
15707} else {
15708if (this.containers[i].containerCache.over) {
15709this.containers[i]._trigger("out", event, this._uiHash(this));
15710this.containers[i].containerCache.over = 0;
15711}
15712}
15713}
15714if (!innermostContainer) {
15715return;
15716}
15717if (this.containers.length === 1) {
15718if (!this.containers[innermostIndex].containerCache.over) {
15719this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
15720this.containers[innermostIndex].containerCache.over = 1;
15721}
15722} else {
15723dist = 10000;
15724itemWithLeastDistance = null;
15725floating = innermostContainer.floating || this._isFloating(this.currentItem);
15726posProperty = floating ? "left" : "top";
15727sizeProperty = floating ? "width" : "height";
15728axis = floating ? "clientX" : "clientY";
15729for (j = this.items.length - 1; j >= 0; j--) {
15730if (!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
15731continue;
15732}
15733if (this.items[j].item[0] === this.currentItem[0]) {
15734continue;
15735}
15736cur = this.items[j].item.offset()[posProperty];
15737nearBottom = false;
15738if (event[axis] - cur > this.items[j][sizeProperty] / 2) {
15739nearBottom = true;
15740}
15741if (Math.abs(event[axis] - cur) < dist) {
15742dist = Math.abs(event[axis] - cur);
15743itemWithLeastDistance = this.items[j];
15744this.direction = nearBottom ? "up" : "down";
15745}
15746}
15747if (!itemWithLeastDistance && !this.options.dropOnEmpty) {
15748return;
15749}
15750if (this.currentContainer === this.containers[innermostIndex]) {
15751if (!this.currentContainer.containerCache.over) {
15752this.containers[innermostIndex]._trigger("over", event, this._uiHash());
15753this.currentContainer.containerCache.over = 1;
15754}
15755return;
15756}
15757itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
15758this._trigger("change", event, this._uiHash());
15759this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
15760this.currentContainer = this.containers[innermostIndex];
15761this.options.placeholder.update(this.currentContainer, this.placeholder);
15762this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
15763this.containers[innermostIndex].containerCache.over = 1;
15764}
15765},
15766_createHelper: function(event) {
15767var o = this.options
15768  , helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);
15769if (!helper.parents("body").length) {
15770$(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
15771}
15772if (helper[0] === this.currentItem[0]) {
15773this._storedCSS = {
15774width: this.currentItem[0].style.width,
15775height: this.currentItem[0].style.height,
15776position: this.currentItem.css("position"),
15777top: this.currentItem.css("top"),
15778left: this.currentItem.css("left")
15779};
15780}
15781if (!helper[0].style.width || o.forceHelperSize) {
15782helper.width(this.currentItem.width());
15783}
15784if (!helper[0].style.height || o.forceHelperSize) {
15785helper.height(this.currentItem.height());
15786}
15787return helper;
15788},
15789_adjustOffsetFromHelper: function(obj) {
15790if (typeof obj === "string") {
15791obj = obj.split(" ");
15792}
15793if ($.isArray(obj)) {
15794obj = {
15795left: +obj[0],
15796top: +obj[1] || 0
15797};
15798}
15799if ("left"in obj) {
15800this.offset.click.left = obj.left + this.margins.left;
15801}
15802if ("right"in obj) {
15803this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
15804}
15805if ("top"in obj) {
15806this.offset.click.top = obj.top + this.margins.top;
15807}
15808if ("bottom"in obj) {
15809this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
15810}
15811},
15812_getParentOffset: function() {
15813this.offsetParent = this.helper.offsetParent();
15814var po = this.offsetParent.offset();
15815if (this.cssPosition === "absolute" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) {
15816po.left += this.scrollParent.scrollLeft();
15817po.top += this.scrollParent.scrollTop();
15818}
15819if (this.offsetParent[0] === this.document[0].body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
15820po = {
15821top: 0,
15822left: 0
15823};
15824}
15825return {
15826top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
15827left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
15828};
15829},
15830_getRelativeOffset: function() {
15831if (this.cssPosition === "relative") {
15832var p = this.currentItem.position();
15833return {
15834top: p.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(),
15835left: p.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()
15836};
15837} else {
15838return {
15839top: 0,
15840left: 0
15841};
15842}
15843},
15844_cacheMargins: function() {
15845this.margins = {
15846left: (parseInt(this.currentItem.css("marginLeft"), 10) || 0),
15847top: (parseInt(this.currentItem.css("marginTop"), 10) || 0)
15848};
15849},
15850_cacheHelperProportions: function() {
15851this.helperProportions = {
15852width: this.helper.outerWidth(),
15853height: this.helper.outerHeight()
15854};
15855},
15856_setContainment: function() {
15857var ce, co, over, o = this.options;
15858if (o.containment === "parent") {
15859o.containment = this.helper[0].parentNode;
15860}
15861if (o.containment === "document" || o.containment === "window") {
15862this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, o.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left, (o.containment === "document" ? this.document.width() : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];
15863}
15864if (!(/^(document|window|parent)$/).test(o.containment)) {
15865ce = $(o.containment)[0];
15866co = $(o.containment).offset();
15867over = ($(ce).css("overflow") !== "hidden");
15868this.containment = [co.left + (parseInt($(ce).css("borderLeftWidth"), 10) || 0) + (parseInt($(ce).css("paddingLeft"), 10) || 0) - this.margins.left, co.top + (parseInt($(ce).css("borderTopWidth"), 10) || 0) + (parseInt($(ce).css("paddingTop"), 10) || 0) - this.margins.top, co.left + (over ? Math.max(ce.scrollWidth, ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"), 10) || 0) - (parseInt($(ce).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, co.top + (over ? Math.max(ce.scrollHeight, ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"), 10) || 0) - (parseInt($(ce).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top];
15869}
15870},
15871_convertPositionTo: function(d, pos) {
15872if (!pos) {
15873pos = this.position;
15874}
15875var mod = d === "absolute" ? 1 : -1
15876  , scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent
15877  , scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
15878return {
15879top: (pos.top + this.offset.relative.top * mod + this.offset.parent.top * mod - ((this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : (scrollIsRootNode ? 0 : scroll.scrollTop())) * mod)),
15880left: (pos.left + this.offset.relative.left * mod + this.offset.parent.left * mod - ((this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft()) * mod))
15881};
15882},
15883_generatePosition: function(event) {
15884var top, left, o = this.options, pageX = event.pageX, pageY = event.pageY, scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
15885if (this.cssPosition === "relative" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) {
15886this.offset.relative = this._getRelativeOffset();
15887}
15888if (this.originalPosition) {
15889if (this.containment) {
15890if (event.pageX - this.offset.click.left < this.containment[0]) {
15891pageX = this.containment[0] + this.offset.click.left;
15892}
15893if (event.pageY - this.offset.click.top < this.containment[1]) {
15894pageY = this.containment[1] + this.offset.click.top;
15895}
15896if (event.pageX - this.offset.click.left > this.containment[2]) {
15897pageX = this.containment[2] + this.offset.click.left;
15898}
15899if (event.pageY - this.offset.click.top > this.containment[3]) {
15900pageY = this.containment[3] + this.offset.click.top;
15901}
15902}
15903if (o.grid) {
15904top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
15905pageY = this.containment ? ((top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
15906left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
15907pageX = this.containment ? ((left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
15908}
15909}
15910return {
15911top: (pageY - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ((this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : (scrollIsRootNode ? 0 : scroll.scrollTop())))),
15912left: (pageX - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ((this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft())))
15913};
15914},
15915_rearrange: function(event, i, a, hardRefresh) {
15916a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling));
15917this.counter = this.counter ? ++this.counter : 1;
15918var counter = this.counter;
15919this._delay(function() {
15920if (counter === this.counter) {
vendor: 2,688 bytes, lines 15921-16015
15921this.refreshPositions(!hardRefresh);
15922}
15923});
15924},
15925_clear: function(event, noPropagation) {
15926this.reverting = false;
15927var i, delayedTriggers = [];
15928if (!this._noFinalSort && this.currentItem.parent().length) {
15929this.placeholder.before(this.currentItem);
15930}
15931this._noFinalSort = null;
15932if (this.helper[0] === this.currentItem[0]) {
15933for (i in this._storedCSS) {
15934if (this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {
15935this._storedCSS[i] = "";
15936}
15937}
15938this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
15939} else {
15940this.currentItem.show();
15941}
15942if (this.fromOutside && !noPropagation) {
15943delayedTriggers.push(function(event) {
15944this._trigger("receive", event, this._uiHash(this.fromOutside));
15945});
15946}
15947if ((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {
15948delayedTriggers.push(function(event) {
15949this._trigger("update", event, this._uiHash());
15950});
15951}
15952if (this !== this.currentContainer) {
15953if (!noPropagation) {
15954delayedTriggers.push(function(event) {
15955this._trigger("remove", event, this._uiHash());
15956});
15957delayedTriggers.push((function(c) {
15958return function(event) {
15959c._trigger("receive", event, this._uiHash(this));
15960}
15961;
15962}
15963).call(this, this.currentContainer));
15964delayedTriggers.push((function(c) {
15965return function(event) {
15966c._trigger("update", event, this._uiHash(this));
15967}
15968;
15969}
15970).call(this, this.currentContainer));
15971}
15972}
15973function delayEvent(type, instance, container) {
15974return function(event) {
15975container._trigger(type, event, instance._uiHash(instance));
15976}
15977;
15978}
15979for (i = this.containers.length - 1; i >= 0; i--) {
15980if (!noPropagation) {
15981delayedTriggers.push(delayEvent("deactivate", this, this.containers[i]));
15982}
15983if (this.containers[i].containerCache.over) {
15984delayedTriggers.push(delayEvent("out", this, this.containers[i]));
15985this.containers[i].containerCache.over = 0;
15986}
15987}
15988if (this.storedCursor) {
15989this.document.find("body").css("cursor", this.storedCursor);
15990this.storedStylesheet.remove();
15991}
15992if (this._storedOpacity) {
15993this.helper.css("opacity", this._storedOpacity);
15994}
15995if (this._storedZIndex) {
15996this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);
15997}
15998this.dragging = false;
15999if (!noPropagation) {
16000this._trigger("beforeStop", event, this._uiHash());
16001}
16002this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
16003if (!this.cancelHelperRemoval) {
16004if (this.helper[0] !== this.currentItem[0]) {
16005this.helper.remove();
16006}
16007this.helper = null;
16008}
16009if (!noPropagation) {
16010for (i = 0; i < delayedTriggers.length; i++) {
16011delayedTriggers[i].call(this, event);
16012}
16013this._trigger("stop", event, this._uiHash());
16014}
16015this.fromOutside = false;
vendor: 15,793 bytes, lines 16016-16612
16016return !this.cancelHelperRemoval;
16017},
16018_trigger: function() {
16019if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
16020this.cancel();
16021}
16022},
16023_uiHash: function(_inst) {
16024var inst = _inst || this;
16025return {
16026helper: inst.helper,
16027placeholder: inst.placeholder || $([]),
16028position: inst.position,
16029originalPosition: inst.originalPosition,
16030offset: inst.positionAbs,
16031item: inst.currentItem,
16032sender: _inst ? _inst.element : null
16033};
16034}
16035});
16036var menu = $.widget("ui.menu", {
16037version: "1.11.4",
16038defaultElement: "<ul>",
16039delay: 300,
16040options: {
16041icons: {
16042submenu: "ui-icon-carat-1-e"
16043},
16044items: "> *",
16045menus: "ul",
16046position: {
16047my: "left-1 top",
16048at: "right top"
16049},
16050role: "menu",
16051blur: null,
16052focus: null,
16053select: null
16054},
16055_create: function() {
16056this.activeMenu = this.element;
16057this.mouseHandled = false;
16058this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons", !!this.element.find(".ui-icon").length).attr({
16059role: this.options.role,
16060tabIndex: 0
16061});
16062if (this.options.disabled) {
16063this.element.addClass("ui-state-disabled").attr("aria-disabled", "true");
16064}
16065this._on({
16066"mousedown .ui-menu-item": function(event) {
16067event.preventDefault();
16068},
16069"click .ui-menu-item": function(event) {
16070var target = $(event.target);
16071if (!this.mouseHandled && target.not(".ui-state-disabled").length) {
16072this.select(event);
16073if (!event.isPropagationStopped()) {
16074this.mouseHandled = true;
16075}
16076if (target.has(".ui-menu").length) {
16077this.expand(event);
16078} else if (!this.element.is(":focus") && $(this.document[0].activeElement).closest(".ui-menu").length) {
16079this.element.trigger("focus", [true]);
16080if (this.active && this.active.parents(".ui-menu").length === 1) {
16081clearTimeout(this.timer);
16082}
16083}
16084}
16085},
16086"mouseenter .ui-menu-item": function(event) {
16087if (this.previousFilter) {
16088return;
16089}
16090var target = $(event.currentTarget);
16091target.siblings(".ui-state-active").removeClass("ui-state-active");
16092this.focus(event, target);
16093},
16094mouseleave: "collapseAll",
16095"mouseleave .ui-menu": "collapseAll",
16096focus: function(event, keepActiveItem) {
16097var item = this.active || this.element.find(this.options.items).eq(0);
16098if (!keepActiveItem) {
16099this.focus(event, item);
16100}
16101},
16102blur: function(event) {
16103this._delay(function() {
16104if (!$.contains(this.element[0], this.document[0].activeElement)) {
16105this.collapseAll(event);
16106}
16107});
16108},
16109keydown: "_keydown"
16110});
16111this.refresh();
16112this._on(this.document, {
16113click: function(event) {
16114if (this._closeOnDocumentClick(event)) {
16115this.collapseAll(event);
16116}
16117this.mouseHandled = false;
16118}
16119});
16120},
16121_destroy: function() {
16122this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show();
16123this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function() {
16124var elem = $(this);
16125if (elem.data("ui-menu-submenu-carat")) {
16126elem.remove();
16127}
16128});
16129this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content");
16130},
16131_keydown: function(event) {
16132var match, prev, character, skip, preventDefault = true;
16133switch (event.keyCode) {
16134case $.ui.keyCode.PAGE_UP:
16135this.previousPage(event);
16136break;
16137case $.ui.keyCode.PAGE_DOWN:
16138this.nextPage(event);
16139break;
16140case $.ui.keyCode.HOME:
16141this._move("first", "first", event);
16142break;
16143case $.ui.keyCode.END:
16144this._move("last", "last", event);
16145break;
16146case $.ui.keyCode.UP:
16147this.previous(event);
16148break;
16149case $.ui.keyCode.DOWN:
16150this.next(event);
16151break;
16152case $.ui.keyCode.LEFT:
16153this.collapse(event);
16154break;
16155case $.ui.keyCode.RIGHT:
16156if (this.active && !this.active.is(".ui-state-disabled")) {
16157this.expand(event);
16158}
16159break;
16160case $.ui.keyCode.ENTER:
16161case $.ui.keyCode.SPACE:
16162this._activate(event);
16163break;
16164case $.ui.keyCode.ESCAPE:
16165this.collapse(event);
16166break;
16167default:
16168preventDefault = false;
16169prev = this.previousFilter || "";
16170character = String.fromCharCode(event.keyCode);
16171skip = false;
16172clearTimeout(this.filterTimer);
16173if (character === prev) {
16174skip = true;
16175} else {
16176character = prev + character;
16177}
16178match = this._filterMenuItems(character);
16179match = skip && match.index(this.active.next()) !== -1 ? this.active.nextAll(".ui-menu-item") : match;
16180if (!match.length) {
16181character = String.fromCharCode(event.keyCode);
16182match = this._filterMenuItems(character);
16183}
16184if (match.length) {
16185this.focus(event, match);
16186this.previousFilter = character;
16187this.filterTimer = this._delay(function() {
16188delete this.previousFilter;
16189}, 1000);
16190} else {
16191delete this.previousFilter;
16192}
16193}
16194if (preventDefault) {
16195event.preventDefault();
16196}
16197},
16198_activate: function(event) {
16199if (!this.active.is(".ui-state-disabled")) {
16200if (this.active.is("[aria-haspopup='true']")) {
16201this.expand(event);
16202} else {
16203this.select(event);
16204}
16205}
16206},
16207refresh: function() {
16208var menus, items, that = this, icon = this.options.icons.submenu, submenus = this.element.find(this.options.menus);
16209this.element.toggleClass("ui-menu-icons", !!this.element.find(".ui-icon").length);
16210submenus.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({
16211role: this.options.role,
16212"aria-hidden": "true",
16213"aria-expanded": "false"
16214}).each(function() {
16215var menu = $(this)
16216  , item = menu.parent()
16217  , submenuCarat = $("<span>").addClass("ui-menu-icon ui-icon " + icon).data("ui-menu-submenu-carat", true);
16218item.attr("aria-haspopup", "true").prepend(submenuCarat);
16219menu.attr("aria-labelledby", item.attr("id"));
16220});
16221menus = submenus.add(this.element);
16222items = menus.find(this.options.items);
16223items.not(".ui-menu-item").each(function() {
16224var item = $(this);
16225if (that._isDivider(item)) {
16226item.addClass("ui-widget-content ui-menu-divider");
16227}
16228});
16229items.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({
16230tabIndex: -1,
16231role: this._itemRole()
16232});
16233items.filter(".ui-state-disabled").attr("aria-disabled", "true");
16234if (this.active && !$.contains(this.element[0], this.active[0])) {
16235this.blur();
16236}
16237},
16238_itemRole: function() {
16239return {
16240menu: "menuitem",
16241listbox: "option"
16242}[this.options.role];
16243},
16244_setOption: function(key, value) {
16245if (key === "icons") {
16246this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(value.submenu);
16247}
16248if (key === "disabled") {
16249this.element.toggleClass("ui-state-disabled", !!value).attr("aria-disabled", value);
16250}
16251this._super(key, value);
16252},
16253focus: function(event, item) {
16254var nested, focused;
16255this.blur(event, event && event.type === "focus");
16256this._scrollIntoView(item);
16257this.active = item.first();
16258focused = this.active.addClass("ui-state-focus").removeClass("ui-state-active");
16259if (this.options.role) {
16260this.element.attr("aria-activedescendant", focused.attr("id"));
16261}
16262this.active.parent().closest(".ui-menu-item").addClass("ui-state-active");
16263if (event && event.type === "keydown") {
16264this._close();
16265} else {
16266this.timer = this._delay(function() {
16267this._close();
16268}, this.delay);
16269}
16270nested = item.children(".ui-menu");
16271if (nested.length && event && (/^mouse/.test(event.type))) {
16272this._startOpening(nested);
16273}
16274this.activeMenu = item.parent();
16275this._trigger("focus", event, {
16276item: item
16277});
16278},
16279_scrollIntoView: function(item) {
16280var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
16281if (this._hasScroll()) {
16282borderTop = parseFloat($.css(this.activeMenu[0], "borderTopWidth")) || 0;
16283paddingTop = parseFloat($.css(this.activeMenu[0], "paddingTop")) || 0;
16284offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
16285scroll = this.activeMenu.scrollTop();
16286elementHeight = this.activeMenu.height();
16287itemHeight = item.outerHeight();
16288if (offset < 0) {
16289this.activeMenu.scrollTop(scroll + offset);
16290} else if (offset + itemHeight > elementHeight) {
16291this.activeMenu.scrollTop(scroll + offset - elementHeight + itemHeight);
16292}
16293}
16294},
16295blur: function(event, fromFocus) {
16296if (!fromFocus) {
16297clearTimeout(this.timer);
16298}
16299if (!this.active) {
16300return;
16301}
16302this.active.removeClass("ui-state-focus");
16303this.active = null;
16304this._trigger("blur", event, {
16305item: this.active
16306});
16307},
16308_startOpening: function(submenu) {
16309clearTimeout(this.timer);
16310if (submenu.attr("aria-hidden") !== "true") {
16311return;
16312}
16313this.timer = this._delay(function() {
16314this._close();
16315this._open(submenu);
16316}, this.delay);
16317},
16318_open: function(submenu) {
16319var position = $.extend({
16320of: this.active
16321}, this.options.position);
16322clearTimeout(this.timer);
16323this.element.find(".ui-menu").not(submenu.parents(".ui-menu")).hide().attr("aria-hidden", "true");
16324submenu.show().removeAttr("aria-hidden").attr("aria-expanded", "true").position(position);
16325},
16326collapseAll: function(event, all) {
16327clearTimeout(this.timer);
16328this.timer = this._delay(function() {
16329var currentMenu = all ? this.element : $(event && event.target).closest(this.element.find(".ui-menu"));
16330if (!currentMenu.length) {
16331currentMenu = this.element;
16332}
16333this._close(currentMenu);
16334this.blur(event);
16335this.activeMenu = currentMenu;
16336}, this.delay);
16337},
16338_close: function(startMenu) {
16339if (!startMenu) {
16340startMenu = this.active ? this.active.parent() : this.element;
16341}
16342startMenu.find(".ui-menu").hide().attr("aria-hidden", "true").attr("aria-expanded", "false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active");
16343},
16344_closeOnDocumentClick: function(event) {
16345return !$(event.target).closest(".ui-menu").length;
16346},
16347_isDivider: function(item) {
16348return !/[^\-\u2014\u2013\s]/.test(item.text());
16349},
16350collapse: function(event) {
16351var newItem = this.active && this.active.parent().closest(".ui-menu-item", this.element);
16352if (newItem && newItem.length) {
16353this._close();
16354this.focus(event, newItem);
16355}
16356},
16357expand: function(event) {
16358var newItem = this.active && this.active.children(".ui-menu ").find(this.options.items).first();
16359if (newItem && newItem.length) {
16360this._open(newItem.parent());
16361this._delay(function() {
16362this.focus(event, newItem);
16363});
16364}
16365},
16366next: function(event) {
16367this._move("next", "first", event);
16368},
16369previous: function(event) {
16370this._move("prev", "last", event);
16371},
16372isFirstItem: function() {
16373return this.active && !this.active.prevAll(".ui-menu-item").length;
16374},
16375isLastItem: function() {
16376return this.active && !this.active.nextAll(".ui-menu-item").length;
16377},
16378_move: function(direction, filter, event) {
16379var next;
16380if (this.active) {
16381if (direction === "first" || direction === "last") {
16382next = this.active[direction === "first" ? "prevAll" : "nextAll"](".ui-menu-item").eq(-1);
16383} else {
16384next = this.active[direction + "All"](".ui-menu-item").eq(0);
16385}
16386}
16387if (!next || !next.length || !this.active) {
16388next = this.activeMenu.find(this.options.items)[filter]();
16389}
16390this.focus(event, next);
16391},
16392nextPage: function(event) {
16393var item, base, height;
16394if (!this.active) {
16395this.next(event);
16396return;
16397}
16398if (this.isLastItem()) {
16399return;
16400}
16401if (this._hasScroll()) {
16402base = this.active.offset().top;
16403height = this.element.height();
16404this.active.nextAll(".ui-menu-item").each(function() {
16405item = $(this);
16406return item.offset().top - base - height < 0;
16407});
16408this.focus(event, item);
16409} else {
16410this.focus(event, this.activeMenu.find(this.options.items)[!this.active ? "first" : "last"]());
16411}
16412},
16413previousPage: function(event) {
16414var item, base, height;
16415if (!this.active) {
16416this.next(event);
16417return;
16418}
16419if (this.isFirstItem()) {
16420return;
16421}
16422if (this._hasScroll()) {
16423base = this.active.offset().top;
16424height = this.element.height();
16425this.active.prevAll(".ui-menu-item").each(function() {
16426item = $(this);
16427return item.offset().top - base + height > 0;
16428});
16429this.focus(event, item);
16430} else {
16431this.focus(event, this.activeMenu.find(this.options.items).first());
16432}
16433},
16434_hasScroll: function() {
16435return this.element.outerHeight() < this.element.prop("scrollHeight");
16436},
16437select: function(event) {
16438this.active = this.active || $(event.target).closest(".ui-menu-item");
16439var ui = {
16440item: this.active
16441};
16442if (!this.active.has(".ui-menu").length) {
16443this.collapseAll(event, true);
16444}
16445this._trigger("select", event, ui);
16446},
16447_filterMenuItems: function(character) {
16448var escapedCharacter = character.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&")
16449  , regex = new RegExp("^" + escapedCharacter,"i");
16450return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function() {
16451return regex.test($.trim($(this).text()));
16452});
16453}
16454});
16455$.widget("ui.autocomplete", {
16456version: "1.11.4",
16457defaultElement: "<input>",
16458options: {
16459appendTo: null,
16460autoFocus: false,
16461delay: 300,
16462minLength: 1,
16463position: {
16464my: "left top",
16465at: "left bottom",
16466collision: "none"
16467},
16468source: null,
16469change: null,
16470close: null,
16471focus: null,
16472open: null,
16473response: null,
16474search: null,
16475select: null
16476},
16477requestIndex: 0,
16478pending: 0,
16479_create: function() {
16480var suppressKeyPress, suppressKeyPressRepeat, suppressInput, nodeName = this.element[0].nodeName.toLowerCase(), isTextarea = nodeName === "textarea", isInput = nodeName === "input";
16481this.isMultiLine = isTextarea ? true : isInput ? false : this.element.prop("isContentEditable");
16482this.valueMethod = this.element[isTextarea || isInput ? "val" : "text"];
16483this.isNewMenu = true;
16484this.element.addClass("ui-autocomplete-input").attr("autocomplete", "off");
16485this._on(this.element, {
16486keydown: function(event) {
16487if (this.element.prop("readOnly")) {
16488suppressKeyPress = true;
16489suppressInput = true;
16490suppressKeyPressRepeat = true;
16491return;
16492}
16493suppressKeyPress = false;
16494suppressInput = false;
16495suppressKeyPressRepeat = false;
16496var keyCode = $.ui.keyCode;
16497switch (event.keyCode) {
16498case keyCode.PAGE_UP:
16499suppressKeyPress = true;
16500this._move("previousPage", event);
16501break;
16502case keyCode.PAGE_DOWN:
16503suppressKeyPress = true;
16504this._move("nextPage", event);
16505break;
16506case keyCode.UP:
16507suppressKeyPress = true;
16508this._keyEvent("previous", event);
16509break;
16510case keyCode.DOWN:
16511suppressKeyPress = true;
16512this._keyEvent("next", event);
16513break;
16514case keyCode.ENTER:
16515if (this.menu.active) {
16516suppressKeyPress = true;
16517event.preventDefault();
16518this.menu.select(event);
16519}
16520break;
16521case keyCode.TAB:
16522if (this.menu.active) {
16523this.menu.select(event);
16524}
16525break;
16526case keyCode.ESCAPE:
16527if (this.menu.element.is(":visible")) {
16528if (!this.isMultiLine) {
16529this._value(this.term);
16530}
16531this.close(event);
16532event.preventDefault();
16533}
16534break;
16535default:
16536suppressKeyPressRepeat = true;
16537this._searchTimeout(event);
16538break;
16539}
16540},
16541keypress: function(event) {
16542if (suppressKeyPress) {
16543suppressKeyPress = false;
16544if (!this.isMultiLine || this.menu.element.is(":visible")) {
16545event.preventDefault();
16546}
16547return;
16548}
16549if (suppressKeyPressRepeat) {
16550return;
16551}
16552var keyCode = $.ui.keyCode;
16553switch (event.keyCode) {
16554case keyCode.PAGE_UP:
16555this._move("previousPage", event);
16556break;
16557case keyCode.PAGE_DOWN:
16558this._move("nextPage", event);
16559break;
16560case keyCode.UP:
16561this._keyEvent("previous", event);
16562break;
16563case keyCode.DOWN:
16564this._keyEvent("next", event);
16565break;
16566}
16567},
16568input: function(event) {
16569if (suppressInput) {
16570suppressInput = false;
16571event.preventDefault();
16572return;
16573}
16574this._searchTimeout(event);
16575},
16576focus: function() {
16577this.selectedItem = null;
16578this.previous = this._value();
16579},
16580blur: function(event) {
16581if (this.cancelBlur) {
16582delete this.cancelBlur;
16583return;
16584}
16585clearTimeout(this.searching);
16586this.close(event);
16587this._change(event);
16588}
16589});
16590this._initSource();
16591this.menu = $("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({
16592role: null
16593}).hide().menu("instance");
16594this._on(this.menu.element, {
16595mousedown: function(event) {
16596event.preventDefault();
16597this.cancelBlur = true;
16598this._delay(function() {
16599delete this.cancelBlur;
16600});
16601var menuElement = this.menu.element[0];
16602if (!$(event.target).closest(".ui-menu-item").length) {
16603this._delay(function() {
16604var that = this;
16605this.document.one("mousedown", function(event) {
16606if (event.target !== that.element[0] && event.target !== menuElement && !$.contains(menuElement, event.target)) {
16607that.close();
16608}
16609});
16610});
16611}
16612},
vendor: 13,062 bytes, lines 16613-17110
16613menufocus: function(event, ui) {
16614var label, item;
16615if (this.isNewMenu) {
16616this.isNewMenu = false;
16617if (event.originalEvent && /^mouse/.test(event.originalEvent.type)) {
16618this.menu.blur();
16619this.document.one("mousemove", function() {
16620$(event.target).trigger(event.originalEvent);
16621});
16622return;
16623}
16624}
16625item = ui.item.data("ui-autocomplete-item");
16626if (false !== this._trigger("focus", event, {
16627item: item
16628})) {
16629if (event.originalEvent && /^key/.test(event.originalEvent.type)) {
16630this._value(item.value);
16631}
16632}
16633label = ui.item.attr("aria-label") || item.value;
16634if (label && $.trim(label).length) {
16635this.liveRegion.children().hide();
16636$("<div>").text(label).appendTo(this.liveRegion);
16637}
16638},
16639menuselect: function(event, ui) {
16640var item = ui.item.data("ui-autocomplete-item")
16641  , previous = this.previous;
16642if (this.element[0] !== this.document[0].activeElement) {
16643this.element.focus();
16644this.previous = previous;
16645this._delay(function() {
16646this.previous = previous;
16647this.selectedItem = item;
16648});
16649}
16650if (false !== this._trigger("select", event, {
16651item: item
16652})) {
16653this._value(item.value);
16654}
16655this.term = this._value();
16656this.close(event);
16657this.selectedItem = item;
16658}
16659});
16660this.liveRegion = $("<span>", {
16661role: "status",
16662"aria-live": "assertive",
16663"aria-relevant": "additions"
16664}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body);
16665this._on(this.window, {
16666beforeunload: function() {
16667this.element.removeAttr("autocomplete");
16668}
16669});
16670},
16671_destroy: function() {
16672clearTimeout(this.searching);
16673this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete");
16674this.menu.element.remove();
16675this.liveRegion.remove();
16676},
16677_setOption: function(key, value) {
16678this._super(key, value);
16679if (key === "source") {
16680this._initSource();
16681}
16682if (key === "appendTo") {
16683this.menu.element.appendTo(this._appendTo());
16684}
16685if (key === "disabled" && value && this.xhr) {
16686this.xhr.abort();
16687}
16688},
16689_appendTo: function() {
16690var element = this.options.appendTo;
16691if (element) {
16692element = element.jquery || element.nodeType ? $(element) : this.document.find(element).eq(0);
16693}
16694if (!element || !element[0]) {
16695element = this.element.closest(".ui-front");
16696}
16697if (!element.length) {
16698element = this.document[0].body;
16699}
16700return element;
16701},
16702_initSource: function() {
16703var array, url, that = this;
16704if ($.isArray(this.options.source)) {
16705array = this.options.source;
16706this.source = function(request, response) {
16707response($.ui.autocomplete.filter(array, request.term));
16708}
16709;
16710} else if (typeof this.options.source === "string") {
16711url = this.options.source;
16712this.source = function(request, response) {
16713if (that.xhr) {
16714that.xhr.abort();
16715}
16716that.xhr = $.ajax({
16717url: url,
16718data: request,
16719dataType: "json",
16720success: function(data) {
16721response(data);
16722},
16723error: function() {
16724response([]);
16725}
16726});
16727}
16728;
16729} else {
16730this.source = this.options.source;
16731}
16732},
16733_searchTimeout: function(event) {
16734clearTimeout(this.searching);
16735this.searching = this._delay(function() {
16736var equalValues = this.term === this._value()
16737  , menuVisible = this.menu.element.is(":visible")
16738  , modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
16739if (!equalValues || (equalValues && !menuVisible && !modifierKey)) {
16740this.selectedItem = null;
16741this.search(null, event);
16742}
16743}, this.options.delay);
16744},
16745search: function(value, event) {
16746value = value != null ? value : this._value();
16747this.term = this._value();
16748if (value.length < this.options.minLength) {
16749return this.close(event);
16750}
16751if (this._trigger("search", event) === false) {
16752return;
16753}
16754return this._search(value);
16755},
16756_search: function(value) {
16757this.pending++;
16758this.element.addClass("ui-autocomplete-loading");
16759this.cancelSearch = false;
16760this.source({
16761term: value
16762}, this._response());
16763},
16764_response: function() {
16765var index = ++this.requestIndex;
16766return $.proxy(function(content) {
16767if (index === this.requestIndex) {
16768this.__response(content);
16769}
16770this.pending--;
16771if (!this.pending) {
16772this.element.removeClass("ui-autocomplete-loading");
16773}
16774}, this);
16775},
16776__response: function(content) {
16777if (content) {
16778content = this._normalize(content);
16779}
16780this._trigger("response", null, {
16781content: content
16782});
16783if (!this.options.disabled && content && content.length && !this.cancelSearch) {
16784this._suggest(content);
16785this._trigger("open");
16786} else {
16787this._close();
16788}
16789},
16790close: function(event) {
16791this.cancelSearch = true;
16792this._close(event);
16793},
16794_close: function(event) {
16795if (this.menu.element.is(":visible")) {
16796this.menu.element.hide();
16797this.menu.blur();
16798this.isNewMenu = true;
16799this._trigger("close", event);
16800}
16801},
16802_change: function(event) {
16803if (this.previous !== this._value()) {
16804this._trigger("change", event, {
16805item: this.selectedItem
16806});
16807}
16808},
16809_normalize: function(items) {
16810if (items.length && items[0].label && items[0].value) {
16811return items;
16812}
16813return $.map(items, function(item) {
16814if (typeof item === "string") {
16815return {
16816label: item,
16817value: item
16818};
16819}
16820return $.extend({}, item, {
16821label: item.label || item.value,
16822value: item.value || item.label
16823});
16824});
16825},
16826_suggest: function(items) {
16827var ul = this.menu.element.empty();
16828this._renderMenu(ul, items);
16829this.isNewMenu = true;
16830this.menu.refresh();
16831ul.show();
16832this._resizeMenu();
16833ul.position($.extend({
16834of: this.element
16835}, this.options.position));
16836if (this.options.autoFocus) {
16837this.menu.next();
16838}
16839},
16840_resizeMenu: function() {
16841var ul = this.menu.element;
16842ul.outerWidth(Math.max(ul.width("").outerWidth() + 1, this.element.outerWidth()));
16843},
16844_renderMenu: function(ul, items) {
16845var that = this;
16846$.each(items, function(index, item) {
16847that._renderItemData(ul, item);
16848});
16849},
16850_renderItemData: function(ul, item) {
16851return this._renderItem(ul, item).data("ui-autocomplete-item", item);
16852},
16853_renderItem: function(ul, item) {
16854return $("<li>").text(item.label).appendTo(ul);
16855},
16856_move: function(direction, event) {
16857if (!this.menu.element.is(":visible")) {
16858this.search(null, event);
16859return;
16860}
16861if (this.menu.isFirstItem() && /^previous/.test(direction) || this.menu.isLastItem() && /^next/.test(direction)) {
16862if (!this.isMultiLine) {
16863this._value(this.term);
16864}
16865this.menu.blur();
16866return;
16867}
16868this.menu[direction](event);
16869},
16870widget: function() {
16871return this.menu.element;
16872},
16873_value: function() {
16874return this.valueMethod.apply(this.element, arguments);
16875},
16876_keyEvent: function(keyEvent, event) {
16877if (!this.isMultiLine || this.menu.element.is(":visible")) {
16878this._move(keyEvent, event);
16879event.preventDefault();
16880}
16881}
16882});
16883$.extend($.ui.autocomplete, {
16884escapeRegex: function(value) {
16885return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
16886},
16887filter: function(array, term) {
16888var matcher = new RegExp($.ui.autocomplete.escapeRegex(term),"i");
16889return $.grep(array, function(value) {
16890return matcher.test(value.label || value.value || value);
16891});
16892}
16893});
16894$.widget("ui.autocomplete", $.ui.autocomplete, {
16895options: {
16896messages: {
16897noResults: "No search results.",
16898results: function(amount) {
16899return amount + (amount > 1 ? " results are" : " result is") + " available, use up and down arrow keys to navigate.";
16900}
16901}
16902},
16903__response: function(content) {
16904var message;
16905this._superApply(arguments);
16906if (this.options.disabled || this.cancelSearch) {
16907return;
16908}
16909if (content && content.length) {
16910message = this.options.messages.results(content.length);
16911} else {
16912message = this.options.messages.noResults;
16913}
16914this.liveRegion.children().hide();
16915$("<div>").text(message).appendTo(this.liveRegion);
16916}
16917});
16918var autocomplete = $.ui.autocomplete;
16919$.extend($.ui, {
16920datepicker: {
16921version: "1.11.4"
16922}
16923});
16924var datepicker_instActive;
16925function datepicker_getZindex(elem) {
16926var position, value;
16927while (elem.length && elem[0] !== document) {
16928position = elem.css("position");
16929if (position === "absolute" || position === "relative" || position === "fixed") {
16930value = parseInt(elem.css("zIndex"), 10);
16931if (!isNaN(value) && value !== 0) {
16932return value;
16933}
16934}
16935elem = elem.parent();
16936}
16937return 0;
16938}
16939function Datepicker() {
16940this._curInst = null;
16941this._keyEvent = false;
16942this._disabledInputs = [];
16943this._datepickerShowing = false;
16944this._inDialog = false;
16945this._mainDivId = "ui-datepicker-div";
16946this._inlineClass = "ui-datepicker-inline";
16947this._appendClass = "ui-datepicker-append";
16948this._triggerClass = "ui-datepicker-trigger";
16949this._dialogClass = "ui-datepicker-dialog";
16950this._disableClass = "ui-datepicker-disabled";
16951this._unselectableClass = "ui-datepicker-unselectable";
16952this._currentClass = "ui-datepicker-current-day";
16953this._dayOverClass = "ui-datepicker-days-cell-over";
16954this.regional = [];
16955this.regional[""] = {
16956closeText: "Done",
16957prevText: "Prev",
16958nextText: "Next",
16959currentText: "Today",
16960monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
16961monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
16962dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
16963dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
16964dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
16965weekHeader: "Wk",
16966dateFormat: "mm/dd/yy",
16967firstDay: 0,
16968isRTL: false,
16969showMonthAfterYear: false,
16970yearSuffix: ""
16971};
16972this._defaults = {
16973showOn: "focus",
16974showAnim: "fadeIn",
16975showOptions: {},
16976defaultDate: null,
16977appendText: "",
16978buttonText: "...",
16979buttonImage: "",
16980buttonImageOnly: false,
16981hideIfNoPrevNext: false,
16982navigationAsDateFormat: false,
16983gotoCurrent: false,
16984changeMonth: false,
16985changeYear: false,
16986yearRange: "c-10:c+10",
16987showOtherMonths: false,
16988selectOtherMonths: false,
16989showWeek: false,
16990calculateWeek: this.iso8601Week,
16991shortYearCutoff: "+10",
16992minDate: null,
16993maxDate: null,
16994duration: "fast",
16995beforeShowDay: null,
16996beforeShow: null,
16997onSelect: null,
16998onChangeMonthYear: null,
16999onClose: null,
17000numberOfMonths: 1,
17001showCurrentAtPos: 0,
17002stepMonths: 1,
17003stepBigMonths: 12,
17004altField: "",
17005altFormat: "",
17006constrainInput: true,
17007showButtonPanel: false,
17008autoSize: false,
17009disabled: false
17010};
17011$.extend(this._defaults, this.regional[""]);
17012this.regional.en = $.extend(true, {}, this.regional[""]);
17013this.regional["en-US"] = $.extend(true, {}, this.regional.en);
17014this.dpDiv = datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));
17015}
17016$.extend(Datepicker.prototype, {
17017markerClassName: "hasDatepicker",
17018maxRows: 4,
17019_widgetDatepicker: function() {
17020return this.dpDiv;
17021},
17022setDefaults: function(settings) {
17023datepicker_extendRemove(this._defaults, settings || {});
17024return this;
17025},
17026_attachDatepicker: function(target, settings) {
17027var nodeName, inline, inst;
17028nodeName = target.nodeName.toLowerCase();
17029inline = (nodeName === "div" || nodeName === "span");
17030if (!target.id) {
17031this.uuid += 1;
17032target.id = "dp" + this.uuid;
17033}
17034inst = this._newInst($(target), inline);
17035inst.settings = $.extend({}, settings || {});
17036if (nodeName === "input") {
17037this._connectDatepicker(target, inst);
17038} else if (inline) {
17039this._inlineDatepicker(target, inst);
17040}
17041},
17042_newInst: function(target, inline) {
17043var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1");
17044return {
17045id: id,
17046input: target,
17047selectedDay: 0,
17048selectedMonth: 0,
17049selectedYear: 0,
17050drawMonth: 0,
17051drawYear: 0,
17052inline: inline,
17053dpDiv: (!inline ? this.dpDiv : datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))
17054};
17055},
17056_connectDatepicker: function(target, inst) {
17057var input = $(target);
17058inst.append = $([]);
17059inst.trigger = $([]);
17060if (input.hasClass(this.markerClassName)) {
17061return;
17062}
17063this._attachments(input, inst);
17064input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp);
17065this._autoSize(inst);
17066$.data(target, "datepicker", inst);
17067if (inst.settings.disabled) {
17068this._disableDatepicker(target);
17069}
17070},
17071_attachments: function(input, inst) {
17072var showOn, buttonText, buttonImage, appendText = this._get(inst, "appendText"), isRTL = this._get(inst, "isRTL");
17073if (inst.append) {
17074inst.append.remove();
17075}
17076if (appendText) {
17077inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
17078input[isRTL ? "before" : "after"](inst.append);
17079}
17080input.unbind("focus", this._showDatepicker);
17081if (inst.trigger) {
17082inst.trigger.remove();
17083}
17084showOn = this._get(inst, "showOn");
17085if (showOn === "focus" || showOn === "both") {
17086input.focus(this._showDatepicker);
17087}
17088if (showOn === "button" || showOn === "both") {
17089buttonText = this._get(inst, "buttonText");
17090buttonImage = this._get(inst, "buttonImage");
17091inst.trigger = $(this._get(inst, "buttonImageOnly") ? $("<img/>").addClass(this._triggerClass).attr({
17092src: buttonImage,
17093alt: buttonText,
17094title: buttonText
17095}) : $("<button type='button'></button>").addClass(this._triggerClass).html(!buttonImage ? buttonText : $("<img/>").attr({
17096src: buttonImage,
17097alt: buttonText,
17098title: buttonText
17099})));
17100input[isRTL ? "before" : "after"](inst.trigger);
17101inst.trigger.click(function() {
17102if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
17103$.datepicker._hideDatepicker();
17104} else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
17105$.datepicker._hideDatepicker();
17106$.datepicker._showDatepicker(input[0]);
17107} else {
17108$.datepicker._showDatepicker(input[0]);
17109}
17110return false;
vendor: 4,965 bytes, lines 17111-17252
17111});
17112}
17113},
17114_autoSize: function(inst) {
17115if (this._get(inst, "autoSize") && !inst.inline) {
17116var findMax, max, maxI, i, date = new Date(2009,12 - 1,20), dateFormat = this._get(inst, "dateFormat");
17117if (dateFormat.match(/[DM]/)) {
17118findMax = function(names) {
17119max = 0;
17120maxI = 0;
17121for (i = 0; i < names.length; i++) {
17122if (names[i].length > max) {
17123max = names[i].length;
17124maxI = i;
17125}
17126}
17127return maxI;
17128}
17129;
17130date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? "monthNames" : "monthNamesShort"))));
17131date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? "dayNames" : "dayNamesShort"))) + 20 - date.getDay());
17132}
17133inst.input.attr("size", this._formatDate(inst, date).length);
17134}
17135},
17136_inlineDatepicker: function(target, inst) {
17137var divSpan = $(target);
17138if (divSpan.hasClass(this.markerClassName)) {
17139return;
17140}
17141divSpan.addClass(this.markerClassName).append(inst.dpDiv);
17142$.data(target, "datepicker", inst);
17143this._setDate(inst, this._getDefaultDate(inst), true);
17144this._updateDatepicker(inst);
17145this._updateAlternate(inst);
17146if (inst.settings.disabled) {
17147this._disableDatepicker(target);
17148}
17149inst.dpDiv.css("display", "block");
17150},
17151_dialogDatepicker: function(input, date, onSelect, settings, pos) {
17152var id, browserWidth, browserHeight, scrollX, scrollY, inst = this._dialogInst;
17153if (!inst) {
17154this.uuid += 1;
17155id = "dp" + this.uuid;
17156this._dialogInput = $("<input type='text' id='" + id + "' style='position: absolute; top: -100px; width: 0px;'/>");
17157this._dialogInput.keydown(this._doKeyDown);
17158$("body").append(this._dialogInput);
17159inst = this._dialogInst = this._newInst(this._dialogInput, false);
17160inst.settings = {};
17161$.data(this._dialogInput[0], "datepicker", inst);
17162}
17163datepicker_extendRemove(inst.settings, settings || {});
17164date = (date && date.constructor === Date ? this._formatDate(inst, date) : date);
17165this._dialogInput.val(date);
17166this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
17167if (!this._pos) {
17168browserWidth = document.documentElement.clientWidth;
17169browserHeight = document.documentElement.clientHeight;
17170scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
17171scrollY = document.documentElement.scrollTop || document.body.scrollTop;
17172this._pos = [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
17173}
17174this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
17175inst.settings.onSelect = onSelect;
17176this._inDialog = true;
17177this.dpDiv.addClass(this._dialogClass);
17178this._showDatepicker(this._dialogInput[0]);
17179if ($.blockUI) {
17180$.blockUI(this.dpDiv);
17181}
17182$.data(this._dialogInput[0], "datepicker", inst);
17183return this;
17184},
17185_destroyDatepicker: function(target) {
17186var nodeName, $target = $(target), inst = $.data(target, "datepicker");
17187if (!$target.hasClass(this.markerClassName)) {
17188return;
17189}
17190nodeName = target.nodeName.toLowerCase();
17191$.removeData(target, "datepicker");
17192if (nodeName === "input") {
17193inst.append.remove();
17194inst.trigger.remove();
17195$target.removeClass(this.markerClassName).unbind("focus", this._showDatepicker).unbind("keydown", this._doKeyDown).unbind("keypress", this._doKeyPress).unbind("keyup", this._doKeyUp);
17196} else if (nodeName === "div" || nodeName === "span") {
17197$target.removeClass(this.markerClassName).empty();
17198}
17199if (datepicker_instActive === inst) {
17200datepicker_instActive = null;
17201}
17202},
17203_enableDatepicker: function(target) {
17204var nodeName, inline, $target = $(target), inst = $.data(target, "datepicker");
17205if (!$target.hasClass(this.markerClassName)) {
17206return;
17207}
17208nodeName = target.nodeName.toLowerCase();
17209if (nodeName === "input") {
17210target.disabled = false;
17211inst.trigger.filter("button").each(function() {
17212this.disabled = false;
17213}).end().filter("img").css({
17214opacity: "1.0",
17215cursor: ""
17216});
17217} else if (nodeName === "div" || nodeName === "span") {
17218inline = $target.children("." + this._inlineClass);
17219inline.children().removeClass("ui-state-disabled");
17220inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", false);
17221}
17222this._disabledInputs = $.map(this._disabledInputs, function(value) {
17223return (value === target ? null : value);
17224});
17225},
17226_disableDatepicker: function(target) {
17227var nodeName, inline, $target = $(target), inst = $.data(target, "datepicker");
17228if (!$target.hasClass(this.markerClassName)) {
17229return;
17230}
17231nodeName = target.nodeName.toLowerCase();
17232if (nodeName === "input") {
17233target.disabled = true;
17234inst.trigger.filter("button").each(function() {
17235this.disabled = true;
17236}).end().filter("img").css({
17237opacity: "0.5",
17238cursor: "default"
17239});
17240} else if (nodeName === "div" || nodeName === "span") {
17241inline = $target.children("." + this._inlineClass);
17242inline.children().addClass("ui-state-disabled");
17243inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", true);
17244}
17245this._disabledInputs = $.map(this._disabledInputs, function(value) {
17246return (value === target ? null : value);
17247});
17248this._disabledInputs[this._disabledInputs.length] = target;
17249},
17250_isDisabledDatepicker: function(target) {
17251if (!target) {
17252return false;
vendor: 4,574 bytes, lines 17253-17404
17253}
17254for (var i = 0; i < this._disabledInputs.length; i++) {
17255if (this._disabledInputs[i] === target) {
17256return true;
17257}
17258}
17259return false;
17260},
17261_getInst: function(target) {
17262try {
17263return $.data(target, "datepicker");
17264} catch (err) {
17265throw "Missing instance data for this datepicker";
17266}
17267},
17268_optionDatepicker: function(target, name, value) {
17269var settings, date, minDate, maxDate, inst = this._getInst(target);
17270if (arguments.length === 2 && typeof name === "string") {
17271return (name === "defaults" ? $.extend({}, $.datepicker._defaults) : (inst ? (name === "all" ? $.extend({}, inst.settings) : this._get(inst, name)) : null));
17272}
17273settings = name || {};
17274if (typeof name === "string") {
17275settings = {};
17276settings[name] = value;
17277}
17278if (inst) {
17279if (this._curInst === inst) {
17280this._hideDatepicker();
17281}
17282date = this._getDateDatepicker(target, true);
17283minDate = this._getMinMaxDate(inst, "min");
17284maxDate = this._getMinMaxDate(inst, "max");
17285datepicker_extendRemove(inst.settings, settings);
17286if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
17287inst.settings.minDate = this._formatDate(inst, minDate);
17288}
17289if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
17290inst.settings.maxDate = this._formatDate(inst, maxDate);
17291}
17292if ("disabled"in settings) {
17293if (settings.disabled) {
17294this._disableDatepicker(target);
17295} else {
17296this._enableDatepicker(target);
17297}
17298}
17299this._attachments($(target), inst);
17300this._autoSize(inst);
17301this._setDate(inst, date);
17302this._updateAlternate(inst);
17303this._updateDatepicker(inst);
17304}
17305},
17306_changeDatepicker: function(target, name, value) {
17307this._optionDatepicker(target, name, value);
17308},
17309_refreshDatepicker: function(target) {
17310var inst = this._getInst(target);
17311if (inst) {
17312this._updateDatepicker(inst);
17313}
17314},
17315_setDateDatepicker: function(target, date) {
17316var inst = this._getInst(target);
17317if (inst) {
17318this._setDate(inst, date);
17319this._updateDatepicker(inst);
17320this._updateAlternate(inst);
17321}
17322},
17323_getDateDatepicker: function(target, noDefault) {
17324var inst = this._getInst(target);
17325if (inst && !inst.inline) {
17326this._setDateFromField(inst, noDefault);
17327}
17328return (inst ? this._getDate(inst) : null);
17329},
17330_doKeyDown: function(event) {
17331var onSelect, dateStr, sel, inst = $.datepicker._getInst(event.target), handled = true, isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
17332inst._keyEvent = true;
17333if ($.datepicker._datepickerShowing) {
17334switch (event.keyCode) {
17335case 9:
17336$.datepicker._hideDatepicker();
17337handled = false;
17338break;
17339case 13:
17340sel = $("td." + $.datepicker._dayOverClass + ":not(." + $.datepicker._currentClass + ")", inst.dpDiv);
17341if (sel[0]) {
17342$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
17343}
17344onSelect = $.datepicker._get(inst, "onSelect");
17345if (onSelect) {
17346dateStr = $.datepicker._formatDate(inst);
17347onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
17348} else {
17349$.datepicker._hideDatepicker();
17350}
17351return false;
17352case 27:
17353$.datepicker._hideDatepicker();
17354break;
17355case 33:
17356$.datepicker._adjustDate(event.target, (event.ctrlKey ? -$.datepicker._get(inst, "stepBigMonths") : -$.datepicker._get(inst, "stepMonths")), "M");
17357break;
17358case 34:
17359$.datepicker._adjustDate(event.target, (event.ctrlKey ? +$.datepicker._get(inst, "stepBigMonths") : +$.datepicker._get(inst, "stepMonths")), "M");
17360break;
17361case 35:
17362if (event.ctrlKey || event.metaKey) {
17363$.datepicker._clearDate(event.target);
17364}
17365handled = event.ctrlKey || event.metaKey;
17366break;
17367case 36:
17368if (event.ctrlKey || event.metaKey) {
17369$.datepicker._gotoToday(event.target);
17370}
17371handled = event.ctrlKey || event.metaKey;
17372break;
17373case 37:
17374if (event.ctrlKey || event.metaKey) {
17375$.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D");
17376}
17377handled = event.ctrlKey || event.metaKey;
17378if (event.originalEvent.altKey) {
17379$.datepicker._adjustDate(event.target, (event.ctrlKey ? -$.datepicker._get(inst, "stepBigMonths") : -$.datepicker._get(inst, "stepMonths")), "M");
17380}
17381break;
17382case 38:
17383if (event.ctrlKey || event.metaKey) {
17384$.datepicker._adjustDate(event.target, -7, "D");
17385}
17386handled = event.ctrlKey || event.metaKey;
17387break;
17388case 39:
17389if (event.ctrlKey || event.metaKey) {
17390$.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D");
17391}
17392handled = event.ctrlKey || event.metaKey;
17393if (event.originalEvent.altKey) {
17394$.datepicker._adjustDate(event.target, (event.ctrlKey ? +$.datepicker._get(inst, "stepBigMonths") : +$.datepicker._get(inst, "stepMonths")), "M");
17395}
17396break;
17397case 40:
17398if (event.ctrlKey || event.metaKey) {
17399$.datepicker._adjustDate(event.target, +7, "D");
17400}
17401handled = event.ctrlKey || event.metaKey;
17402break;
17403default:
17404handled = false;
vendor: 12,726 bytes, lines 17405-17746
17405}
17406} else if (event.keyCode === 36 && event.ctrlKey) {
17407$.datepicker._showDatepicker(this);
17408} else {
17409handled = false;
17410}
17411if (handled) {
17412event.preventDefault();
17413event.stopPropagation();
17414}
17415},
17416_doKeyPress: function(event) {
17417var chars, chr, inst = $.datepicker._getInst(event.target);
17418if ($.datepicker._get(inst, "constrainInput")) {
17419chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
17420chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
17421return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1);
17422}
17423},
17424_doKeyUp: function(event) {
17425var date, inst = $.datepicker._getInst(event.target);
17426if (inst.input.val() !== inst.lastVal) {
17427try {
17428date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), (inst.input ? inst.input.val() : null), $.datepicker._getFormatConfig(inst));
17429if (date) {
17430$.datepicker._setDateFromField(inst);
17431$.datepicker._updateAlternate(inst);
17432$.datepicker._updateDatepicker(inst);
17433}
17434} catch (err) {}
17435}
17436return true;
17437},
17438_showDatepicker: function(input) {
17439input = input.target || input;
17440if (input.nodeName.toLowerCase() !== "input") {
17441input = $("input", input.parentNode)[0];
17442}
17443if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) {
17444return;
17445}
17446var inst, beforeShow, beforeShowSettings, isFixed, offset, showAnim, duration;
17447inst = $.datepicker._getInst(input);
17448if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
17449$.datepicker._curInst.dpDiv.stop(true, true);
17450if (inst && $.datepicker._datepickerShowing) {
17451$.datepicker._hideDatepicker($.datepicker._curInst.input[0]);
17452}
17453}
17454beforeShow = $.datepicker._get(inst, "beforeShow");
17455beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
17456if (beforeShowSettings === false) {
17457return;
17458}
17459datepicker_extendRemove(inst.settings, beforeShowSettings);
17460inst.lastVal = null;
17461$.datepicker._lastInput = input;
17462$.datepicker._setDateFromField(inst);
17463if ($.datepicker._inDialog) {
17464input.value = "";
17465}
17466if (!$.datepicker._pos) {
17467$.datepicker._pos = $.datepicker._findPos(input);
17468$.datepicker._pos[1] += input.offsetHeight;
17469}
17470isFixed = false;
17471$(input).parents().each(function() {
17472isFixed |= $(this).css("position") === "fixed";
17473return !isFixed;
17474});
17475offset = {
17476left: $.datepicker._pos[0],
17477top: $.datepicker._pos[1]
17478};
17479$.datepicker._pos = null;
17480inst.dpDiv.empty();
17481inst.dpDiv.css({
17482position: "absolute",
17483display: "block",
17484top: "-1000px"
17485});
17486$.datepicker._updateDatepicker(inst);
17487offset = $.datepicker._checkOffset(inst, offset, isFixed);
17488inst.dpDiv.css({
17489position: ($.datepicker._inDialog && $.blockUI ? "static" : (isFixed ? "fixed" : "absolute")),
17490display: "none",
17491left: offset.left + "px",
17492top: offset.top + "px"
17493});
17494if (!inst.inline) {
17495showAnim = $.datepicker._get(inst, "showAnim");
17496duration = $.datepicker._get(inst, "duration");
17497inst.dpDiv.css("z-index", datepicker_getZindex($(input)) + 1);
17498$.datepicker._datepickerShowing = true;
17499if ($.effects && $.effects.effect[showAnim]) {
17500inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
17501} else {
17502inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
17503}
17504if ($.datepicker._shouldFocusInput(inst)) {
17505inst.input.focus();
17506}
17507$.datepicker._curInst = inst;
17508}
17509},
17510_updateDatepicker: function(inst) {
17511this.maxRows = 4;
17512datepicker_instActive = inst;
17513inst.dpDiv.empty().append(this._generateHTML(inst));
17514this._attachHandlers(inst);
17515var origyearshtml, numMonths = this._getNumberOfMonths(inst), cols = numMonths[1], width = 17, activeCell = inst.dpDiv.find("." + this._dayOverClass + " a");
17516if (activeCell.length > 0) {
17517datepicker_handleMouseover.apply(activeCell.get(0));
17518}
17519inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
17520if (cols > 1) {
17521inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
17522}
17523inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") + "Class"]("ui-datepicker-multi");
17524inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl");
17525if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput(inst)) {
17526inst.input.focus();
17527}
17528if (inst.yearshtml) {
17529origyearshtml = inst.yearshtml;
17530setTimeout(function() {
17531if (origyearshtml === inst.yearshtml && inst.yearshtml) {
17532inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
17533}
17534origyearshtml = inst.yearshtml = null;
17535}, 0);
17536}
17537},
17538_shouldFocusInput: function(inst) {
17539return inst.input && inst.input.is(":visible") && !inst.input.is(":disabled") && !inst.input.is(":focus");
17540},
17541_checkOffset: function(inst, offset, isFixed) {
17542var dpWidth = inst.dpDiv.outerWidth()
17543  , dpHeight = inst.dpDiv.outerHeight()
17544  , inputWidth = inst.input ? inst.input.outerWidth() : 0
17545  , inputHeight = inst.input ? inst.input.outerHeight() : 0
17546  , viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft())
17547  , viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
17548offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0);
17549offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;
17550offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
17551offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? Math.abs(offset.left + dpWidth - viewWidth) : 0);
17552offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? Math.abs(dpHeight + inputHeight) : 0);
17553return offset;
17554},
17555_findPos: function(obj) {
17556var position, inst = this._getInst(obj), isRTL = this._get(inst, "isRTL");
17557while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
17558obj = obj[isRTL ? "previousSibling" : "nextSibling"];
17559}
17560position = $(obj).offset();
17561return [position.left, position.top];
17562},
17563_hideDatepicker: function(input) {
17564var showAnim, duration, postProcess, onClose, inst = this._curInst;
17565if (!inst || (input && inst !== $.data(input, "datepicker"))) {
17566return;
17567}
17568if (this._datepickerShowing) {
17569showAnim = this._get(inst, "showAnim");
17570duration = this._get(inst, "duration");
17571postProcess = function() {
17572$.datepicker._tidyDialog(inst);
17573}
17574;
17575if ($.effects && ($.effects.effect[showAnim] || $.effects[showAnim])) {
17576inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
17577} else {
17578inst.dpDiv[(showAnim === "slideDown" ? "slideUp" : (showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess);
17579}
17580if (!showAnim) {
17581postProcess();
17582}
17583this._datepickerShowing = false;
17584onClose = this._get(inst, "onClose");
17585if (onClose) {
17586onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]);
17587}
17588this._lastInput = null;
17589if (this._inDialog) {
17590this._dialogInput.css({
17591position: "absolute",
17592left: "0",
17593top: "-100px"
17594});
17595if ($.blockUI) {
17596$.unblockUI();
17597$("body").append(this.dpDiv);
17598}
17599}
17600this._inDialog = false;
17601}
17602},
17603_tidyDialog: function(inst) {
17604inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");
17605},
17606_checkExternalClick: function(event) {
17607if (!$.datepicker._curInst) {
17608return;
17609}
17610var $target = $(event.target)
17611  , inst = $.datepicker._getInst($target[0]);
17612if ((($target[0].id !== $.datepicker._mainDivId && $target.parents("#" + $.datepicker._mainDivId).length === 0 && !$target.hasClass($.datepicker.markerClassName) && !$target.closest("." + $.datepicker._triggerClass).length && $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI))) || ($target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst)) {
17613$.datepicker._hideDatepicker();
17614}
17615},
17616_adjustDate: function(id, offset, period) {
17617var target = $(id)
17618  , inst = this._getInst(target[0]);
17619if (this._isDisabledDatepicker(target[0])) {
17620return;
17621}
17622this._adjustInstDate(inst, offset + (period === "M" ? this._get(inst, "showCurrentAtPos") : 0), period);
17623this._updateDatepicker(inst);
17624},
17625_gotoToday: function(id) {
17626var date, target = $(id), inst = this._getInst(target[0]);
17627if (this._get(inst, "gotoCurrent") && inst.currentDay) {
17628inst.selectedDay = inst.currentDay;
17629inst.drawMonth = inst.selectedMonth = inst.currentMonth;
17630inst.drawYear = inst.selectedYear = inst.currentYear;
17631} else {
17632date = new Date();
17633inst.selectedDay = date.getDate();
17634inst.drawMonth = inst.selectedMonth = date.getMonth();
17635inst.drawYear = inst.selectedYear = date.getFullYear();
17636}
17637this._notifyChange(inst);
17638this._adjustDate(target);
17639},
17640_selectMonthYear: function(id, select, period) {
17641var target = $(id)
17642  , inst = this._getInst(target[0]);
17643inst["selected" + (period === "M" ? "Month" : "Year")] = inst["draw" + (period === "M" ? "Month" : "Year")] = parseInt(select.options[select.selectedIndex].value, 10);
17644this._notifyChange(inst);
17645this._adjustDate(target);
17646},
17647_selectDay: function(id, month, year, td) {
17648var inst, target = $(id);
17649if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
17650return;
17651}
17652inst = this._getInst(target[0]);
17653inst.selectedDay = inst.currentDay = $("a", td).html();
17654inst.selectedMonth = inst.currentMonth = month;
17655inst.selectedYear = inst.currentYear = year;
17656this._selectDate(id, this._formatDate(inst, inst.currentDay, inst.currentMonth, inst.currentYear));
17657},
17658_clearDate: function(id) {
17659var target = $(id);
17660this._selectDate(target, "");
17661},
17662_selectDate: function(id, dateStr) {
17663var onSelect, target = $(id), inst = this._getInst(target[0]);
17664dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
17665if (inst.input) {
17666inst.input.val(dateStr);
17667}
17668this._updateAlternate(inst);
17669onSelect = this._get(inst, "onSelect");
17670if (onSelect) {
17671onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
17672} else if (inst.input) {
17673inst.input.trigger("change");
17674}
17675if (inst.inline) {
17676this._updateDatepicker(inst);
17677} else {
17678this._hideDatepicker();
17679this._lastInput = inst.input[0];
17680if (typeof (inst.input[0]) !== "object") {
17681inst.input.focus();
17682}
17683this._lastInput = null;
17684}
17685},
17686_updateAlternate: function(inst) {
17687var altFormat, date, dateStr, altField = this._get(inst, "altField");
17688if (altField) {
17689altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
17690date = this._getDate(inst);
17691dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
17692$(altField).each(function() {
17693$(this).val(dateStr);
17694});
17695}
17696},
17697noWeekends: function(date) {
17698var day = date.getDay();
17699return [(day > 0 && day < 6), ""];
17700},
17701iso8601Week: function(date) {
17702var time, checkDate = new Date(date.getTime());
17703checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
17704time = checkDate.getTime();
17705checkDate.setMonth(0);
17706checkDate.setDate(1);
17707return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
17708},
17709parseDate: function(format, value, settings) {
17710if (format == null || value == null) {
17711throw "Invalid arguments";
17712}
17713value = (typeof value === "object" ? value.toString() : value + "");
17714if (value === "") {
17715return null;
17716}
17717var iFormat, dim, extra, iValue = 0, shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff, shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp : new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)), dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort, dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames, monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort, monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames, year = -1, month = -1, day = -1, doy = -1, literal = false, date, lookAhead = function(match) {
17718var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
17719if (matches) {
17720iFormat++;
17721}
17722return matches;
17723}, getNumber = function(match) {
17724var isDoubled = lookAhead(match)
17725  , size = (match === "@" ? 14 : (match === "!" ? 20 : (match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2))))
17726  , minSize = (match === "y" ? size : 1)
17727  , digits = new RegExp("^\\d{" + minSize + "," + size + "}")
17728  , num = value.substring(iValue).match(digits);
17729if (!num) {
17730throw "Missing number at position " + iValue;
17731}
17732iValue += num[0].length;
17733return parseInt(num[0], 10);
17734}, getName = function(match, shortNames, longNames) {
17735var index = -1
17736  , names = $.map(lookAhead(match) ? longNames : shortNames, function(v, k) {
17737return [[k, v]];
17738}).sort(function(a, b) {
17739return -(a[1].length - b[1].length);
17740});
17741$.each(names, function(i, pair) {
17742var name = pair[1];
17743if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
17744index = pair[0];
17745iValue += name.length;
17746return false;
vendor: 8,729 bytes, lines 17747-18071
17747}
17748});
17749if (index !== -1) {
17750return index + 1;
17751} else {
17752throw "Unknown name at position " + iValue;
17753}
17754}, checkLiteral = function() {
17755if (value.charAt(iValue) !== format.charAt(iFormat)) {
17756throw "Unexpected literal at position " + iValue;
17757}
17758iValue++;
17759};
17760for (iFormat = 0; iFormat < format.length; iFormat++) {
17761if (literal) {
17762if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
17763literal = false;
17764} else {
17765checkLiteral();
17766}
17767} else {
17768switch (format.charAt(iFormat)) {
17769case "d":
17770day = getNumber("d");
17771break;
17772case "D":
17773getName("D", dayNamesShort, dayNames);
17774break;
17775case "o":
17776doy = getNumber("o");
17777break;
17778case "m":
17779month = getNumber("m");
17780break;
17781case "M":
17782month = getName("M", monthNamesShort, monthNames);
17783break;
17784case "y":
17785year = getNumber("y");
17786break;
17787case "@":
17788date = new Date(getNumber("@"));
17789year = date.getFullYear();
17790month = date.getMonth() + 1;
17791day = date.getDate();
17792break;
17793case "!":
17794date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
17795year = date.getFullYear();
17796month = date.getMonth() + 1;
17797day = date.getDate();
17798break;
17799case "'":
17800if (lookAhead("'")) {
17801checkLiteral();
17802} else {
17803literal = true;
17804}
17805break;
17806default:
17807checkLiteral();
17808}
17809}
17810}
17811if (iValue < value.length) {
17812extra = value.substr(iValue);
17813if (!/^\s+/.test(extra)) {
17814throw "Extra/unparsed characters found in date: " + extra;
17815}
17816}
17817if (year === -1) {
17818year = new Date().getFullYear();
17819} else if (year < 100) {
17820year += new Date().getFullYear() - new Date().getFullYear() % 100 + (year <= shortYearCutoff ? 0 : -100);
17821}
17822if (doy > -1) {
17823month = 1;
17824day = doy;
17825do {
17826dim = this._getDaysInMonth(year, month - 1);
17827if (day <= dim) {
17828break;
17829}
17830month++;
17831day -= dim;
17832} while (true);
17833}
17834date = this._daylightSavingAdjust(new Date(year,month - 1,day));
17835if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
17836throw "Invalid date";
17837}
17838return date;
17839},
17840ATOM: "yy-mm-dd",
17841COOKIE: "D, dd M yy",
17842ISO_8601: "yy-mm-dd",
17843RFC_822: "D, d M y",
17844RFC_850: "DD, dd-M-y",
17845RFC_1036: "D, d M y",
17846RFC_1123: "D, d M yy",
17847RFC_2822: "D, d M yy",
17848RSS: "D, d M y",
17849TICKS: "!",
17850TIMESTAMP: "@",
17851W3C: "yy-mm-dd",
17852_ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
17853formatDate: function(format, date, settings) {
17854if (!date) {
17855return "";
17856}
17857var iFormat, dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort, dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames, monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort, monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames, lookAhead = function(match) {
17858var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
17859if (matches) {
17860iFormat++;
17861}
17862return matches;
17863}, formatNumber = function(match, value, len) {
17864var num = "" + value;
17865if (lookAhead(match)) {
17866while (num.length < len) {
17867num = "0" + num;
17868}
17869}
17870return num;
17871}, formatName = function(match, value, shortNames, longNames) {
17872return (lookAhead(match) ? longNames[value] : shortNames[value]);
17873}, output = "", literal = false;
17874if (date) {
17875for (iFormat = 0; iFormat < format.length; iFormat++) {
17876if (literal) {
17877if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
17878literal = false;
17879} else {
17880output += format.charAt(iFormat);
17881}
17882} else {
17883switch (format.charAt(iFormat)) {
17884case "d":
17885output += formatNumber("d", date.getDate(), 2);
17886break;
17887case "D":
17888output += formatName("D", date.getDay(), dayNamesShort, dayNames);
17889break;
17890case "o":
17891output += formatNumber("o", Math.round((new Date(date.getFullYear(),date.getMonth(),date.getDate()).getTime() - new Date(date.getFullYear(),0,0).getTime()) / 86400000), 3);
17892break;
17893case "m":
17894output += formatNumber("m", date.getMonth() + 1, 2);
17895break;
17896case "M":
17897output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
17898break;
17899case "y":
17900output += (lookAhead("y") ? date.getFullYear() : (date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100);
17901break;
17902case "@":
17903output += date.getTime();
17904break;
17905case "!":
17906output += date.getTime() * 10000 + this._ticksTo1970;
17907break;
17908case "'":
17909if (lookAhead("'")) {
17910output += "'";
17911} else {
17912literal = true;
17913}
17914break;
17915default:
17916output += format.charAt(iFormat);
17917}
17918}
17919}
17920}
17921return output;
17922},
17923_possibleChars: function(format) {
17924var iFormat, chars = "", literal = false, lookAhead = function(match) {
17925var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
17926if (matches) {
17927iFormat++;
17928}
17929return matches;
17930};
17931for (iFormat = 0; iFormat < format.length; iFormat++) {
17932if (literal) {
17933if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
17934literal = false;
17935} else {
17936chars += format.charAt(iFormat);
17937}
17938} else {
17939switch (format.charAt(iFormat)) {
17940case "d":
17941case "m":
17942case "y":
17943case "@":
17944chars += "0123456789";
17945break;
17946case "D":
17947case "M":
17948return null;
17949case "'":
17950if (lookAhead("'")) {
17951chars += "'";
17952} else {
17953literal = true;
17954}
17955break;
17956default:
17957chars += format.charAt(iFormat);
17958}
17959}
17960}
17961return chars;
17962},
17963_get: function(inst, name) {
17964return inst.settings[name] !== undefined ? inst.settings[name] : this._defaults[name];
17965},
17966_setDateFromField: function(inst, noDefault) {
17967if (inst.input.val() === inst.lastVal) {
17968return;
17969}
17970var dateFormat = this._get(inst, "dateFormat")
17971  , dates = inst.lastVal = inst.input ? inst.input.val() : null
17972  , defaultDate = this._getDefaultDate(inst)
17973  , date = defaultDate
17974  , settings = this._getFormatConfig(inst);
17975try {
17976date = this.parseDate(dateFormat, dates, settings) || defaultDate;
17977} catch (event) {
17978dates = (noDefault ? "" : dates);
17979}
17980inst.selectedDay = date.getDate();
17981inst.drawMonth = inst.selectedMonth = date.getMonth();
17982inst.drawYear = inst.selectedYear = date.getFullYear();
17983inst.currentDay = (dates ? date.getDate() : 0);
17984inst.currentMonth = (dates ? date.getMonth() : 0);
17985inst.currentYear = (dates ? date.getFullYear() : 0);
17986this._adjustInstDate(inst);
17987},
17988_getDefaultDate: function(inst) {
17989return this._restrictMinMax(inst, this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));
17990},
17991_determineDate: function(inst, date, defaultDate) {
17992var offsetNumeric = function(offset) {
17993var date = new Date();
17994date.setDate(date.getDate() + offset);
17995return date;
17996}
17997  , offsetString = function(offset) {
17998try {
17999return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), offset, $.datepicker._getFormatConfig(inst));
18000} catch (e) {}
18001var date = (offset.toLowerCase().match(/^c/) ? $.datepicker._getDate(inst) : null) || new Date()
18002  , year = date.getFullYear()
18003  , month = date.getMonth()
18004  , day = date.getDate()
18005  , pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g
18006  , matches = pattern.exec(offset);
18007while (matches) {
18008switch (matches[2] || "d") {
18009case "d":
18010case "D":
18011day += parseInt(matches[1], 10);
18012break;
18013case "w":
18014case "W":
18015day += parseInt(matches[1], 10) * 7;
18016break;
18017case "m":
18018case "M":
18019month += parseInt(matches[1], 10);
18020day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
18021break;
18022case "y":
18023case "Y":
18024year += parseInt(matches[1], 10);
18025day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
18026break;
18027}
18028matches = pattern.exec(offset);
18029}
18030return new Date(year,month,day);
18031}
18032  , newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) : (typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
18033newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);
18034if (newDate) {
18035newDate.setHours(0);
18036newDate.setMinutes(0);
18037newDate.setSeconds(0);
18038newDate.setMilliseconds(0);
18039}
18040return this._daylightSavingAdjust(newDate);
18041},
18042_daylightSavingAdjust: function(date) {
18043if (!date) {
18044return null;
18045}
18046date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
18047return date;
18048},
18049_setDate: function(inst, date, noChange) {
18050var clear = !date
18051  , origMonth = inst.selectedMonth
18052  , origYear = inst.selectedYear
18053  , newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
18054inst.selectedDay = inst.currentDay = newDate.getDate();
18055inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
18056inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
18057if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
18058this._notifyChange(inst);
18059}
18060this._adjustInstDate(inst);
18061if (inst.input) {
18062inst.input.val(clear ? "" : this._formatDate(inst));
18063}
18064},
18065_getDate: function(inst) {
18066var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null : this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));
18067return startDate;
18068},
18069_attachHandlers: function(inst) {
18070var stepMonths = this._get(inst, "stepMonths")
18071  , id = "#" + inst.id.replace(/\\\\/g, "\\");
vendor: 18,039 bytes, lines 18072-18404
18072inst.dpDiv.find("[data-handler]").map(function() {
18073var handler = {
18074prev: function() {
18075$.datepicker._adjustDate(id, -stepMonths, "M");
18076},
18077next: function() {
18078$.datepicker._adjustDate(id, +stepMonths, "M");
18079},
18080hide: function() {
18081$.datepicker._hideDatepicker();
18082},
18083today: function() {
18084$.datepicker._gotoToday(id);
18085},
18086selectDay: function() {
18087$.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
18088return false;
18089},
18090selectMonth: function() {
18091$.datepicker._selectMonthYear(id, this, "M");
18092return false;
18093},
18094selectYear: function() {
18095$.datepicker._selectMonthYear(id, this, "Y");
18096return false;
18097}
18098};
18099$(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);
18100});
18101},
18102_generateHTML: function(inst) {
18103var maxDraw, prevText, prev, nextText, next, currentText, gotoDate, controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin, monthNames, monthNamesShort, beforeShowDay, showOtherMonths, selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate, cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows, printDate, dRow, tbody, daySettings, otherMonth, unselectable, tempDate = new Date(), today = this._daylightSavingAdjust(new Date(tempDate.getFullYear(),tempDate.getMonth(),tempDate.getDate())), isRTL = this._get(inst, "isRTL"), showButtonPanel = this._get(inst, "showButtonPanel"), hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"), navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"), numMonths = this._getNumberOfMonths(inst), showCurrentAtPos = this._get(inst, "showCurrentAtPos"), stepMonths = this._get(inst, "stepMonths"), isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1), currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999,9,9) : new Date(inst.currentYear,inst.currentMonth,inst.currentDay))), minDate = this._getMinMaxDate(inst, "min"), maxDate = this._getMinMaxDate(inst, "max"), drawMonth = inst.drawMonth - showCurrentAtPos, drawYear = inst.drawYear;
18104if (drawMonth < 0) {
18105drawMonth += 12;
18106drawYear--;
18107}
18108if (maxDate) {
18109maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1,maxDate.getDate()));
18110maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
18111while (this._daylightSavingAdjust(new Date(drawYear,drawMonth,1)) > maxDraw) {
18112drawMonth--;
18113if (drawMonth < 0) {
18114drawMonth = 11;
18115drawYear--;
18116}
18117}
18118}
18119inst.drawMonth = drawMonth;
18120inst.drawYear = drawYear;
18121prevText = this._get(inst, "prevText");
18122prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, this._daylightSavingAdjust(new Date(drawYear,drawMonth - stepMonths,1)), this._getFormatConfig(inst)));
18123prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" + " title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + (isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" : (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + (isRTL ? "e" : "w") + "'>" + prevText + "</span></a>"));
18124nextText = this._get(inst, "nextText");
18125nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, this._daylightSavingAdjust(new Date(drawYear,drawMonth + stepMonths,1)), this._getFormatConfig(inst)));
18126next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" + " title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + (isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" : (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + (isRTL ? "w" : "e") + "'>" + nextText + "</span></a>"));
18127currentText = this._get(inst, "currentText");
18128gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);
18129currentText = (!navigationAsDateFormat ? currentText : this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
18130controls = (!inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" + this._get(inst, "closeText") + "</button>" : "");
18131buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") + (this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" + ">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";
18132firstDay = parseInt(this._get(inst, "firstDay"), 10);
18133firstDay = (isNaN(firstDay) ? 0 : firstDay);
18134showWeek = this._get(inst, "showWeek");
18135dayNames = this._get(inst, "dayNames");
18136dayNamesMin = this._get(inst, "dayNamesMin");
18137monthNames = this._get(inst, "monthNames");
18138monthNamesShort = this._get(inst, "monthNamesShort");
18139beforeShowDay = this._get(inst, "beforeShowDay");
18140showOtherMonths = this._get(inst, "showOtherMonths");
18141selectOtherMonths = this._get(inst, "selectOtherMonths");
18142defaultDate = this._getDefaultDate(inst);
18143html = "";
18144dow;
18145for (row = 0; row < numMonths[0]; row++) {
18146group = "";
18147this.maxRows = 4;
18148for (col = 0; col < numMonths[1]; col++) {
18149selectedDate = this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));
18150cornerClass = " ui-corner-all";
18151calender = "";
18152if (isMultiMonth) {
18153calender += "<div class='ui-datepicker-group";
18154if (numMonths[1] > 1) {
18155switch (col) {
18156case 0:
18157calender += " ui-datepicker-group-first";
18158cornerClass = " ui-corner-" + (isRTL ? "right" : "left");
18159break;
18160case numMonths[1] - 1:
18161calender += " ui-datepicker-group-last";
18162cornerClass = " ui-corner-" + (isRTL ? "left" : "right");
18163break;
18164default:
18165calender += " ui-datepicker-group-middle";
18166cornerClass = "";
18167break;
18168}
18169}
18170calender += "'>";
18171}
18172calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" + (/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") + (/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, row > 0 || col > 0, monthNames, monthNamesShort) + "</div><table class='ui-datepicker-calendar'><thead>" + "<tr>";
18173thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");
18174for (dow = 0; dow < 7; dow++) {
18175day = (dow + firstDay) % 7;
18176thead += "<th scope='col'" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" + "<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";
18177}
18178calender += thead + "</tr></thead><tbody>";
18179daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
18180if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
18181inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
18182}
18183leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
18184curRows = Math.ceil((leadDays + daysInMonth) / 7);
18185numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows);
18186this.maxRows = numRows;
18187printDate = this._daylightSavingAdjust(new Date(drawYear,drawMonth,1 - leadDays));
18188for (dRow = 0; dRow < numRows; dRow++) {
18189calender += "<tr>";
18190tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" + this._get(inst, "calculateWeek")(printDate) + "</td>");
18191for (dow = 0; dow < 7; dow++) {
18192daySettings = (beforeShowDay ? beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);
18193otherMonth = (printDate.getMonth() !== drawMonth);
18194unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || (minDate && printDate < minDate) || (maxDate && printDate > maxDate);
18195tbody += "<td class='" + ((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + (otherMonth ? " ui-datepicker-other-month" : "") + ((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || (defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ? " " + this._dayOverClass : "") + (unselectable ? " " + this._unselectableClass + " ui-state-disabled" : "") + (otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + (printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + (printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + ((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + (unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + (otherMonth && !showOtherMonths ? "&#xa0;" : (unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" + (printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") + (printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + (otherMonth ? " ui-priority-secondary" : "") + "' href='#'>" + printDate.getDate() + "</a>")) + "</td>";
18196printDate.setDate(printDate.getDate() + 1);
18197printDate = this._daylightSavingAdjust(printDate);
18198}
18199calender += tbody + "</tr>";
18200}
18201drawMonth++;
18202if (drawMonth > 11) {
18203drawMonth = 0;
18204drawYear++;
18205}
18206calender += "</tbody></table>" + (isMultiMonth ? "</div>" + ((numMonths[0] > 0 && col === numMonths[1] - 1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
18207group += calender;
18208}
18209html += group;
18210}
18211html += buttonPanel;
18212inst._keyEvent = false;
18213return html;
18214},
18215_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, secondary, monthNames, monthNamesShort) {
18216var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear, changeMonth = this._get(inst, "changeMonth"), changeYear = this._get(inst, "changeYear"), showMonthAfterYear = this._get(inst, "showMonthAfterYear"), html = "<div class='ui-datepicker-title'>", monthHtml = "";
18217if (secondary || !changeMonth) {
18218monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
18219} else {
18220inMinYear = (minDate && minDate.getFullYear() === drawYear);
18221inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
18222monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
18223for (month = 0; month < 12; month++) {
18224if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
18225monthHtml += "<option value='" + month + "'" + (month === drawMonth ? " selected='selected'" : "") + ">" + monthNamesShort[month] + "</option>";
18226}
18227}
18228monthHtml += "</select>";
18229}
18230if (!showMonthAfterYear) {
18231html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
18232}
18233if (!inst.yearshtml) {
18234inst.yearshtml = "";
18235if (secondary || !changeYear) {
18236html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
18237} else {
18238years = this._get(inst, "yearRange").split(":");
18239thisYear = new Date().getFullYear();
18240determineYear = function(value) {
18241var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) : (value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) : parseInt(value, 10)));
18242return (isNaN(year) ? thisYear : year);
18243}
18244;
18245year = determineYear(years[0]);
18246endYear = Math.max(year, determineYear(years[1] || ""));
18247year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
18248endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
18249inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
18250for (; year <= endYear; year++) {
18251inst.yearshtml += "<option value='" + year + "'" + (year === drawYear ? " selected='selected'" : "") + ">" + year + "</option>";
18252}
18253inst.yearshtml += "</select>";
18254html += inst.yearshtml;
18255inst.yearshtml = null;
18256}
18257}
18258html += this._get(inst, "yearSuffix");
18259if (showMonthAfterYear) {
18260html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml;
18261}
18262html += "</div>";
18263return html;
18264},
18265_adjustInstDate: function(inst, offset, period) {
18266var year = inst.drawYear + (period === "Y" ? offset : 0)
18267  , month = inst.drawMonth + (period === "M" ? offset : 0)
18268  , day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0)
18269  , date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year,month,day)));
18270inst.selectedDay = date.getDate();
18271inst.drawMonth = inst.selectedMonth = date.getMonth();
18272inst.drawYear = inst.selectedYear = date.getFullYear();
18273if (period === "M" || period === "Y") {
18274this._notifyChange(inst);
18275}
18276},
18277_restrictMinMax: function(inst, date) {
18278var minDate = this._getMinMaxDate(inst, "min")
18279  , maxDate = this._getMinMaxDate(inst, "max")
18280  , newDate = (minDate && date < minDate ? minDate : date);
18281return (maxDate && newDate > maxDate ? maxDate : newDate);
18282},
18283_notifyChange: function(inst) {
18284var onChange = this._get(inst, "onChangeMonthYear");
18285if (onChange) {
18286onChange.apply((inst.input ? inst.input[0] : null), [inst.selectedYear, inst.selectedMonth + 1, inst]);
18287}
18288},
18289_getNumberOfMonths: function(inst) {
18290var numMonths = this._get(inst, "numberOfMonths");
18291return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
18292},
18293_getMinMaxDate: function(inst, minMax) {
18294return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
18295},
18296_getDaysInMonth: function(year, month) {
18297return 32 - this._daylightSavingAdjust(new Date(year,month,32)).getDate();
18298},
18299_getFirstDayOfMonth: function(year, month) {
18300return new Date(year,month,1).getDay();
18301},
18302_canAdjustMonth: function(inst, offset, curYear, curMonth) {
18303var numMonths = this._getNumberOfMonths(inst)
18304  , date = this._daylightSavingAdjust(new Date(curYear,curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]),1));
18305if (offset < 0) {
18306date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
18307}
18308return this._isInRange(inst, date);
18309},
18310_isInRange: function(inst, date) {
18311var yearSplit, currentYear, minDate = this._getMinMaxDate(inst, "min"), maxDate = this._getMinMaxDate(inst, "max"), minYear = null, maxYear = null, years = this._get(inst, "yearRange");
18312if (years) {
18313yearSplit = years.split(":");
18314currentYear = new Date().getFullYear();
18315minYear = parseInt(yearSplit[0], 10);
18316maxYear = parseInt(yearSplit[1], 10);
18317if (yearSplit[0].match(/[+\-].*/)) {
18318minYear += currentYear;
18319}
18320if (yearSplit[1].match(/[+\-].*/)) {
18321maxYear += currentYear;
18322}
18323}
18324return ((!minDate || date.getTime() >= minDate.getTime()) && (!maxDate || date.getTime() <= maxDate.getTime()) && (!minYear || date.getFullYear() >= minYear) && (!maxYear || date.getFullYear() <= maxYear));
18325},
18326_getFormatConfig: function(inst) {
18327var shortYearCutoff = this._get(inst, "shortYearCutoff");
18328shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff : new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
18329return {
18330shortYearCutoff: shortYearCutoff,
18331dayNamesShort: this._get(inst, "dayNamesShort"),
18332dayNames: this._get(inst, "dayNames"),
18333monthNamesShort: this._get(inst, "monthNamesShort"),
18334monthNames: this._get(inst, "monthNames")
18335};
18336},
18337_formatDate: function(inst, day, month, year) {
18338if (!day) {
18339inst.currentDay = inst.selectedDay;
18340inst.currentMonth = inst.selectedMonth;
18341inst.currentYear = inst.selectedYear;
18342}
18343var date = (day ? (typeof day === "object" ? day : this._daylightSavingAdjust(new Date(year,month,day))) : this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));
18344return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
18345}
18346});
18347function datepicker_bindHover(dpDiv) {
18348var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
18349return dpDiv.delegate(selector, "mouseout", function() {
18350$(this).removeClass("ui-state-hover");
18351if (this.className.indexOf("ui-datepicker-prev") !== -1) {
18352$(this).removeClass("ui-datepicker-prev-hover");
18353}
18354if (this.className.indexOf("ui-datepicker-next") !== -1) {
18355$(this).removeClass("ui-datepicker-next-hover");
18356}
18357}).delegate(selector, "mouseover", datepicker_handleMouseover);
18358}
18359function datepicker_handleMouseover() {
18360if (!$.datepicker._isDisabledDatepicker(datepicker_instActive.inline ? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) {
18361$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
18362$(this).addClass("ui-state-hover");
18363if (this.className.indexOf("ui-datepicker-prev") !== -1) {
18364$(this).addClass("ui-datepicker-prev-hover");
18365}
18366if (this.className.indexOf("ui-datepicker-next") !== -1) {
18367$(this).addClass("ui-datepicker-next-hover");
18368}
18369}
18370}
18371function datepicker_extendRemove(target, props) {
18372$.extend(target, props);
18373for (var name in props) {
18374if (props[name] == null) {
18375target[name] = props[name];
18376}
18377}
18378return target;
18379}
18380$.fn.datepicker = function(options) {
18381if (!this.length) {
18382return this;
18383}
18384if (!$.datepicker.initialized) {
18385$(document).mousedown($.datepicker._checkExternalClick);
18386$.datepicker.initialized = true;
18387}
18388if ($("#" + $.datepicker._mainDivId).length === 0) {
18389$("body").append($.datepicker.dpDiv);
18390}
18391var otherArgs = Array.prototype.slice.call(arguments, 1);
18392if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
18393return $.datepicker["_" + options + "Datepicker"].apply($.datepicker, [this[0]].concat(otherArgs));
18394}
18395if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
18396return $.datepicker["_" + options + "Datepicker"].apply($.datepicker, [this[0]].concat(otherArgs));
18397}
18398return this.each(function() {
18399typeof options === "string" ? $.datepicker["_" + options + "Datepicker"].apply($.datepicker, [this].concat(otherArgs)) : $.datepicker._attachDatepicker(this, options);
18400});
18401}
18402;
18403$.datepicker = new Datepicker();
18404$.datepicker.initialized = false;
vendor: 11,001 bytes, lines 18405-18826
18405$.datepicker.uuid = new Date().getTime();
18406$.datepicker.version = "1.11.4";
18407var datepicker = $.datepicker;
18408var tooltip = $.widget("ui.tooltip", {
18409version: "1.11.4",
18410options: {
18411content: function() {
18412var title = $(this).attr("title") || "";
18413return $("<a>").text(title).html();
18414},
18415hide: true,
18416items: "[title]:not([disabled])",
18417position: {
18418my: "left top+15",
18419at: "left bottom",
18420collision: "flipfit flip"
18421},
18422show: true,
18423tooltipClass: null,
18424track: false,
18425close: null,
18426open: null
18427},
18428_addDescribedBy: function(elem, id) {
18429var describedby = (elem.attr("aria-describedby") || "").split(/\s+/);
18430describedby.push(id);
18431elem.data("ui-tooltip-id", id).attr("aria-describedby", $.trim(describedby.join(" ")));
18432},
18433_removeDescribedBy: function(elem) {
18434var id = elem.data("ui-tooltip-id")
18435  , describedby = (elem.attr("aria-describedby") || "").split(/\s+/)
18436  , index = $.inArray(id, describedby);
18437if (index !== -1) {
18438describedby.splice(index, 1);
18439}
18440elem.removeData("ui-tooltip-id");
18441describedby = $.trim(describedby.join(" "));
18442if (describedby) {
18443elem.attr("aria-describedby", describedby);
18444} else {
18445elem.removeAttr("aria-describedby");
18446}
18447},
18448_create: function() {
18449this._on({
18450mouseover: "open",
18451focusin: "open"
18452});
18453this.tooltips = {};
18454this.parents = {};
18455if (this.options.disabled) {
18456this._disable();
18457}
18458this.liveRegion = $("<div>").attr({
18459role: "log",
18460"aria-live": "assertive",
18461"aria-relevant": "additions"
18462}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body);
18463},
18464_setOption: function(key, value) {
18465var that = this;
18466if (key === "disabled") {
18467this[value ? "_disable" : "_enable"]();
18468this.options[key] = value;
18469return;
18470}
18471this._super(key, value);
18472if (key === "content") {
18473$.each(this.tooltips, function(id, tooltipData) {
18474that._updateContent(tooltipData.element);
18475});
18476}
18477},
18478_disable: function() {
18479var that = this;
18480$.each(this.tooltips, function(id, tooltipData) {
18481var event = $.Event("blur");
18482event.target = event.currentTarget = tooltipData.element[0];
18483that.close(event, true);
18484});
18485this.element.find(this.options.items).addBack().each(function() {
18486var element = $(this);
18487if (element.is("[title]")) {
18488element.data("ui-tooltip-title", element.attr("title")).removeAttr("title");
18489}
18490});
18491},
18492_enable: function() {
18493this.element.find(this.options.items).addBack().each(function() {
18494var element = $(this);
18495if (element.data("ui-tooltip-title")) {
18496element.attr("title", element.data("ui-tooltip-title"));
18497}
18498});
18499},
18500open: function(event) {
18501var that = this
18502  , target = $(event ? event.target : this.element).closest(this.options.items);
18503if (!target.length || target.data("ui-tooltip-id")) {
18504return;
18505}
18506if (target.attr("title")) {
18507target.data("ui-tooltip-title", target.attr("title"));
18508}
18509target.data("ui-tooltip-open", true);
18510if (event && event.type === "mouseover") {
18511target.parents().each(function() {
18512var parent = $(this), blurEvent;
18513if (parent.data("ui-tooltip-open")) {
18514blurEvent = $.Event("blur");
18515blurEvent.target = blurEvent.currentTarget = this;
18516that.close(blurEvent, true);
18517}
18518if (parent.attr("title")) {
18519parent.uniqueId();
18520that.parents[this.id] = {
18521element: this,
18522title: parent.attr("title")
18523};
18524parent.attr("title", "");
18525}
18526});
18527}
18528this._registerCloseHandlers(event, target);
18529this._updateContent(target, event);
18530},
18531_updateContent: function(target, event) {
18532var content, contentOption = this.options.content, that = this, eventType = event ? event.type : null;
18533if (typeof contentOption === "string") {
18534return this._open(event, target, contentOption);
18535}
18536content = contentOption.call(target[0], function(response) {
18537that._delay(function() {
18538if (!target.data("ui-tooltip-open")) {
18539return;
18540}
18541if (event) {
18542event.type = eventType;
18543}
18544this._open(event, target, response);
18545});
18546});
18547if (content) {
18548this._open(event, target, content);
18549}
18550},
18551_open: function(event, target, content) {
18552var tooltipData, tooltip, delayedShow, a11yContent, positionOption = $.extend({}, this.options.position);
18553if (!content) {
18554return;
18555}
18556tooltipData = this._find(target);
18557if (tooltipData) {
18558tooltipData.tooltip.find(".ui-tooltip-content").html(content);
18559return;
18560}
18561if (target.is("[title]")) {
18562if (event && event.type === "mouseover") {
18563target.attr("title", "");
18564} else {
18565target.removeAttr("title");
18566}
18567}
18568tooltipData = this._tooltip(target);
18569tooltip = tooltipData.tooltip;
18570this._addDescribedBy(target, tooltip.attr("id"));
18571tooltip.find(".ui-tooltip-content").html(content);
18572this.liveRegion.children().hide();
18573if (content.clone) {
18574a11yContent = content.clone();
18575a11yContent.removeAttr("id").find("[id]").removeAttr("id");
18576} else {
18577a11yContent = content;
18578}
18579$("<div>").html(a11yContent).appendTo(this.liveRegion);
18580function position(event) {
18581positionOption.of = event;
18582if (tooltip.is(":hidden")) {
18583return;
18584}
18585tooltip.position(positionOption);
18586}
18587if (this.options.track && event && /^mouse/.test(event.type)) {
18588this._on(this.document, {
18589mousemove: position
18590});
18591position(event);
18592} else {
18593tooltip.position($.extend({
18594of: target
18595}, this.options.position));
18596}
18597tooltip.hide();
18598this._show(tooltip, this.options.show);
18599if (this.options.show && this.options.show.delay) {
18600delayedShow = this.delayedShow = setInterval(function() {
18601if (tooltip.is(":visible")) {
18602position(positionOption.of);
18603clearInterval(delayedShow);
18604}
18605}, $.fx.interval);
18606}
18607this._trigger("open", event, {
18608tooltip: tooltip
18609});
18610},
18611_registerCloseHandlers: function(event, target) {
18612var events = {
18613keyup: function(event) {
18614if (event.keyCode === $.ui.keyCode.ESCAPE) {
18615var fakeEvent = $.Event(event);
18616fakeEvent.currentTarget = target[0];
18617this.close(fakeEvent, true);
18618}
18619}
18620};
18621if (target[0] !== this.element[0]) {
18622events.remove = function() {
18623this._removeTooltip(this._find(target).tooltip);
18624}
18625;
18626}
18627if (!event || event.type === "mouseover") {
18628events.mouseleave = "close";
18629}
18630if (!event || event.type === "focusin") {
18631events.focusout = "close";
18632}
18633this._on(true, target, events);
18634},
18635close: function(event) {
18636var tooltip, that = this, target = $(event ? event.currentTarget : this.element), tooltipData = this._find(target);
18637if (!tooltipData) {
18638target.removeData("ui-tooltip-open");
18639return;
18640}
18641tooltip = tooltipData.tooltip;
18642if (tooltipData.closing) {
18643return;
18644}
18645clearInterval(this.delayedShow);
18646if (target.data("ui-tooltip-title") && !target.attr("title")) {
18647target.attr("title", target.data("ui-tooltip-title"));
18648}
18649this._removeDescribedBy(target);
18650tooltipData.hiding = true;
18651tooltip.stop(true);
18652this._hide(tooltip, this.options.hide, function() {
18653that._removeTooltip($(this));
18654});
18655target.removeData("ui-tooltip-open");
18656this._off(target, "mouseleave focusout keyup");
18657if (target[0] !== this.element[0]) {
18658this._off(target, "remove");
18659}
18660this._off(this.document, "mousemove");
18661if (event && event.type === "mouseleave") {
18662$.each(this.parents, function(id, parent) {
18663$(parent.element).attr("title", parent.title);
18664delete that.parents[id];
18665});
18666}
18667tooltipData.closing = true;
18668this._trigger("close", event, {
18669tooltip: tooltip
18670});
18671if (!tooltipData.hiding) {
18672tooltipData.closing = false;
18673}
18674},
18675_tooltip: function(element) {
18676var tooltip = $("<div>").attr("role", "tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content " + (this.options.tooltipClass || ""))
18677  , id = tooltip.uniqueId().attr("id");
18678$("<div>").addClass("ui-tooltip-content").appendTo(tooltip);
18679tooltip.appendTo(this.document[0].body);
18680return this.tooltips[id] = {
18681element: element,
18682tooltip: tooltip
18683};
18684},
18685_find: function(target) {
18686var id = target.data("ui-tooltip-id");
18687return id ? this.tooltips[id] : null;
18688},
18689_removeTooltip: function(tooltip) {
18690tooltip.remove();
18691delete this.tooltips[tooltip.attr("id")];
18692},
18693_destroy: function() {
18694var that = this;
18695$.each(this.tooltips, function(id, tooltipData) {
18696var event = $.Event("blur")
18697  , element = tooltipData.element;
18698event.target = event.currentTarget = element[0];
18699that.close(event, true);
18700$("#" + id).remove();
18701if (element.data("ui-tooltip-title")) {
18702if (!element.attr("title")) {
18703element.attr("title", element.data("ui-tooltip-title"));
18704}
18705element.removeData("ui-tooltip-title");
18706}
18707});
18708this.liveRegion.remove();
18709}
18710});
18711var dataSpace = "ui-effects-"
18712  , jQuery = $;
18713$.effects = {
18714effect: {}
18715};
18716(function(jQuery, undefined) {
18717var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor", rplusequals = /^([\-+])=\s*(\d+\.?\d*)/, stringParsers = [{
18718re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
18719parse: function(execResult) {
18720return [execResult[1], execResult[2], execResult[3], execResult[4]];
18721}
18722}, {
18723re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
18724parse: function(execResult) {
18725return [execResult[1] * 2.55, execResult[2] * 2.55, execResult[3] * 2.55, execResult[4]];
18726}
18727}, {
18728re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
18729parse: function(execResult) {
18730return [parseInt(execResult[1], 16), parseInt(execResult[2], 16), parseInt(execResult[3], 16)];
18731}
18732}, {
18733re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
18734parse: function(execResult) {
18735return [parseInt(execResult[1] + execResult[1], 16), parseInt(execResult[2] + execResult[2], 16), parseInt(execResult[3] + execResult[3], 16)];
18736}
18737}, {
18738re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
18739space: "hsla",
18740parse: function(execResult) {
18741return [execResult[1], execResult[2] / 100, execResult[3] / 100, execResult[4]];
18742}
18743}], color = jQuery.Color = function(color, green, blue, alpha) {
18744return new jQuery.Color.fn.parse(color,green,blue,alpha);
18745}
18746, spaces = {
18747rgba: {
18748props: {
18749red: {
18750idx: 0,
18751type: "byte"
18752},
18753green: {
18754idx: 1,
18755type: "byte"
18756},
18757blue: {
18758idx: 2,
18759type: "byte"
18760}
18761}
18762},
18763hsla: {
18764props: {
18765hue: {
18766idx: 0,
18767type: "degrees"
18768},
18769saturation: {
18770idx: 1,
18771type: "percent"
18772},
18773lightness: {
18774idx: 2,
18775type: "percent"
18776}
18777}
18778}
18779}, propTypes = {
18780"byte": {
18781floor: true,
18782max: 255
18783},
18784"percent": {
18785max: 1
18786},
18787"degrees": {
18788mod: 360,
18789floor: true
18790}
18791}, support = color.support = {}, supportElem = jQuery("<p>")[0], colors, each = jQuery.each;
18792supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
18793support.rgba = supportElem.style.backgroundColor.indexOf("rgba") > -1;
18794each(spaces, function(spaceName, space) {
18795space.cache = "_" + spaceName;
18796space.props.alpha = {
18797idx: 3,
18798type: "percent",
18799def: 1
18800};
18801});
18802function clamp(value, prop, allowEmpty) {
18803var type = propTypes[prop.type] || {};
18804if (value == null) {
18805return (allowEmpty || !prop.def) ? null : prop.def;
18806}
18807value = type.floor ? ~~value : parseFloat(value);
18808if (isNaN(value)) {
18809return prop.def;
18810}
18811if (type.mod) {
18812return (value + type.mod) % type.mod;
18813}
18814return 0 > value ? 0 : type.max < value ? type.max : value;
18815}
18816function stringParse(string) {
18817var inst = color()
18818  , rgba = inst._rgba = [];
18819string = string.toLowerCase();
18820each(stringParsers, function(i, parser) {
18821var parsed, match = parser.re.exec(string), values = match && parser.parse(match), spaceName = parser.space || "rgba";
18822if (values) {
18823parsed = inst[spaceName](values);
18824inst[spaces[spaceName].cache] = parsed[spaces[spaceName].cache];
18825rgba = inst._rgba = parsed._rgba;
18826return false;
vendor: 18,346 bytes, lines 18827-19652
18827}
18828});
18829if (rgba.length) {
18830if (rgba.join() === "0,0,0,0") {
18831jQuery.extend(rgba, colors.transparent);
18832}
18833return inst;
18834}
18835return colors[string];
18836}
18837color.fn = jQuery.extend(color.prototype, {
18838parse: function(red, green, blue, alpha) {
18839if (red === undefined) {
18840this._rgba = [null, null, null, null];
18841return this;
18842}
18843if (red.jquery || red.nodeType) {
18844red = jQuery(red).css(green);
18845green = undefined;
18846}
18847var inst = this
18848  , type = jQuery.type(red)
18849  , rgba = this._rgba = [];
18850if (green !== undefined) {
18851red = [red, green, blue, alpha];
18852type = "array";
18853}
18854if (type === "string") {
18855return this.parse(stringParse(red) || colors._default);
18856}
18857if (type === "array") {
18858each(spaces.rgba.props, function(key, prop) {
18859rgba[prop.idx] = clamp(red[prop.idx], prop);
18860});
18861return this;
18862}
18863if (type === "object") {
18864if (red instanceof color) {
18865each(spaces, function(spaceName, space) {
18866if (red[space.cache]) {
18867inst[space.cache] = red[space.cache].slice();
18868}
18869});
18870} else {
18871each(spaces, function(spaceName, space) {
18872var cache = space.cache;
18873each(space.props, function(key, prop) {
18874if (!inst[cache] && space.to) {
18875if (key === "alpha" || red[key] == null) {
18876return;
18877}
18878inst[cache] = space.to(inst._rgba);
18879}
18880inst[cache][prop.idx] = clamp(red[key], prop, true);
18881});
18882if (inst[cache] && jQuery.inArray(null, inst[cache].slice(0, 3)) < 0) {
18883inst[cache][3] = 1;
18884if (space.from) {
18885inst._rgba = space.from(inst[cache]);
18886}
18887}
18888});
18889}
18890return this;
18891}
18892},
18893is: function(compare) {
18894var is = color(compare)
18895  , same = true
18896  , inst = this;
18897each(spaces, function(_, space) {
18898var localCache, isCache = is[space.cache];
18899if (isCache) {
18900localCache = inst[space.cache] || space.to && space.to(inst._rgba) || [];
18901each(space.props, function(_, prop) {
18902if (isCache[prop.idx] != null) {
18903same = (isCache[prop.idx] === localCache[prop.idx]);
18904return same;
18905}
18906});
18907}
18908return same;
18909});
18910return same;
18911},
18912_space: function() {
18913var used = []
18914  , inst = this;
18915each(spaces, function(spaceName, space) {
18916if (inst[space.cache]) {
18917used.push(spaceName);
18918}
18919});
18920return used.pop();
18921},
18922transition: function(other, distance) {
18923var end = color(other)
18924  , spaceName = end._space()
18925  , space = spaces[spaceName]
18926  , startColor = this.alpha() === 0 ? color("transparent") : this
18927  , start = startColor[space.cache] || space.to(startColor._rgba)
18928  , result = start.slice();
18929end = end[space.cache];
18930each(space.props, function(key, prop) {
18931var index = prop.idx
18932  , startValue = start[index]
18933  , endValue = end[index]
18934  , type = propTypes[prop.type] || {};
18935if (endValue === null) {
18936return;
18937}
18938if (startValue === null) {
18939result[index] = endValue;
18940} else {
18941if (type.mod) {
18942if (endValue - startValue > type.mod / 2) {
18943startValue += type.mod;
18944} else if (startValue - endValue > type.mod / 2) {
18945startValue -= type.mod;
18946}
18947}
18948result[index] = clamp((endValue - startValue) * distance + startValue, prop);
18949}
18950});
18951return this[spaceName](result);
18952},
18953blend: function(opaque) {
18954if (this._rgba[3] === 1) {
18955return this;
18956}
18957var rgb = this._rgba.slice()
18958  , a = rgb.pop()
18959  , blend = color(opaque)._rgba;
18960return color(jQuery.map(rgb, function(v, i) {
18961return (1 - a) * blend[i] + a * v;
18962}));
18963},
18964toRgbaString: function() {
18965var prefix = "rgba("
18966  , rgba = jQuery.map(this._rgba, function(v, i) {
18967return v == null ? (i > 2 ? 1 : 0) : v;
18968});
18969if (rgba[3] === 1) {
18970rgba.pop();
18971prefix = "rgb(";
18972}
18973return prefix + rgba.join() + ")";
18974},
18975toHslaString: function() {
18976var prefix = "hsla("
18977  , hsla = jQuery.map(this.hsla(), function(v, i) {
18978if (v == null) {
18979v = i > 2 ? 1 : 0;
18980}
18981if (i && i < 3) {
18982v = Math.round(v * 100) + "%";
18983}
18984return v;
18985});
18986if (hsla[3] === 1) {
18987hsla.pop();
18988prefix = "hsl(";
18989}
18990return prefix + hsla.join() + ")";
18991},
18992toHexString: function(includeAlpha) {
18993var rgba = this._rgba.slice()
18994  , alpha = rgba.pop();
18995if (includeAlpha) {
18996rgba.push(~~(alpha * 255));
18997}
18998return "#" + jQuery.map(rgba, function(v) {
18999v = (v || 0).toString(16);
19000return v.length === 1 ? "0" + v : v;
19001}).join("");
19002},
19003toString: function() {
19004return this._rgba[3] === 0 ? "transparent" : this.toRgbaString();
19005}
19006});
19007color.fn.parse.prototype = color.fn;
19008function hue2rgb(p, q, h) {
19009h = (h + 1) % 1;
19010if (h * 6 < 1) {
19011return p + (q - p) * h * 6;
19012}
19013if (h * 2 < 1) {
19014return q;
19015}
19016if (h * 3 < 2) {
19017return p + (q - p) * ((2 / 3) - h) * 6;
19018}
19019return p;
19020}
19021spaces.hsla.to = function(rgba) {
19022if (rgba[0] == null || rgba[1] == null || rgba[2] == null) {
19023return [null, null, null, rgba[3]];
19024}
19025var r = rgba[0] / 255, g = rgba[1] / 255, b = rgba[2] / 255, a = rgba[3], max = Math.max(r, g, b), min = Math.min(r, g, b), diff = max - min, add = max + min, l = add * 0.5, h, s;
19026if (min === max) {
19027h = 0;
19028} else if (r === max) {
19029h = (60 * (g - b) / diff) + 360;
19030} else if (g === max) {
19031h = (60 * (b - r) / diff) + 120;
19032} else {
19033h = (60 * (r - g) / diff) + 240;
19034}
19035if (diff === 0) {
19036s = 0;
19037} else if (l <= 0.5) {
19038s = diff / add;
19039} else {
19040s = diff / (2 - add);
19041}
19042return [Math.round(h) % 360, s, l, a == null ? 1 : a];
19043}
19044;
19045spaces.hsla.from = function(hsla) {
19046if (hsla[0] == null || hsla[1] == null || hsla[2] == null) {
19047return [null, null, null, hsla[3]];
19048}
19049var h = hsla[0] / 360
19050  , s = hsla[1]
19051  , l = hsla[2]
19052  , a = hsla[3]
19053  , q = l <= 0.5 ? l * (1 + s) : l + s - l * s
19054  , p = 2 * l - q;
19055return [Math.round(hue2rgb(p, q, h + (1 / 3)) * 255), Math.round(hue2rgb(p, q, h) * 255), Math.round(hue2rgb(p, q, h - (1 / 3)) * 255), a];
19056}
19057;
19058each(spaces, function(spaceName, space) {
19059var props = space.props
19060  , cache = space.cache
19061  , to = space.to
19062  , from = space.from;
19063color.fn[spaceName] = function(value) {
19064if (to && !this[cache]) {
19065this[cache] = to(this._rgba);
19066}
19067if (value === undefined) {
19068return this[cache].slice();
19069}
19070var ret, type = jQuery.type(value), arr = (type === "array" || type === "object") ? value : arguments, local = this[cache].slice();
19071each(props, function(key, prop) {
19072var val = arr[type === "object" ? key : prop.idx];
19073if (val == null) {
19074val = local[prop.idx];
19075}
19076local[prop.idx] = clamp(val, prop);
19077});
19078if (from) {
19079ret = color(from(local));
19080ret[cache] = local;
19081return ret;
19082} else {
19083return color(local);
19084}
19085}
19086;
19087each(props, function(key, prop) {
19088if (color.fn[key]) {
19089return;
19090}
19091color.fn[key] = function(value) {
19092var vtype = jQuery.type(value), fn = (key === "alpha" ? (this._hsla ? "hsla" : "rgba") : spaceName), local = this[fn](), cur = local[prop.idx], match;
19093if (vtype === "undefined") {
19094return cur;
19095}
19096if (vtype === "function") {
19097value = value.call(this, cur);
19098vtype = jQuery.type(value);
19099}
19100if (value == null && prop.empty) {
19101return this;
19102}
19103if (vtype === "string") {
19104match = rplusequals.exec(value);
19105if (match) {
19106value = cur + parseFloat(match[2]) * (match[1] === "+" ? 1 : -1);
19107}
19108}
19109local[prop.idx] = value;
19110return this[fn](local);
19111}
19112;
19113});
19114});
19115color.hook = function(hook) {
19116var hooks = hook.split(" ");
19117each(hooks, function(i, hook) {
19118jQuery.cssHooks[hook] = {
19119set: function(elem, value) {
19120var parsed, curElem, backgroundColor = "";
19121if (value !== "transparent" && (jQuery.type(value) !== "string" || (parsed = stringParse(value)))) {
19122value = color(parsed || value);
19123if (!support.rgba && value._rgba[3] !== 1) {
19124curElem = hook === "backgroundColor" ? elem.parentNode : elem;
19125while ((backgroundColor === "" || backgroundColor === "transparent") && curElem && curElem.style) {
19126try {
19127backgroundColor = jQuery.css(curElem, "backgroundColor");
19128curElem = curElem.parentNode;
19129} catch (e) {}
19130}
19131value = value.blend(backgroundColor && backgroundColor !== "transparent" ? backgroundColor : "_default");
19132}
19133value = value.toRgbaString();
19134}
19135try {
19136elem.style[hook] = value;
19137} catch (e) {}
19138}
19139};
19140jQuery.fx.step[hook] = function(fx) {
19141if (!fx.colorInit) {
19142fx.start = color(fx.elem, hook);
19143fx.end = color(fx.end);
19144fx.colorInit = true;
19145}
19146jQuery.cssHooks[hook].set(fx.elem, fx.start.transition(fx.end, fx.pos));
19147}
19148;
19149});
19150}
19151;
19152color.hook(stepHooks);
19153jQuery.cssHooks.borderColor = {
19154expand: function(value) {
19155var expanded = {};
19156each(["Top", "Right", "Bottom", "Left"], function(i, part) {
19157expanded["border" + part + "Color"] = value;
19158});
19159return expanded;
19160}
19161};
19162colors = jQuery.Color.names = {
19163aqua: "#00ffff",
19164black: "#000000",
19165blue: "#0000ff",
19166fuchsia: "#ff00ff",
19167gray: "#808080",
19168green: "#008000",
19169lime: "#00ff00",
19170maroon: "#800000",
19171navy: "#000080",
19172olive: "#808000",
19173purple: "#800080",
19174red: "#ff0000",
19175silver: "#c0c0c0",
19176teal: "#008080",
19177white: "#ffffff",
19178yellow: "#ffff00",
19179transparent: [null, null, null, 0],
19180_default: "#ffffff"
19181};
19182}
19183)(jQuery);
19184(function() {
19185var classAnimationActions = ["add", "remove", "toggle"]
19186  , shorthandStyles = {
19187border: 1,
19188borderBottom: 1,
19189borderColor: 1,
19190borderLeft: 1,
19191borderRight: 1,
19192borderTop: 1,
19193borderWidth: 1,
19194margin: 1,
19195padding: 1
19196};
19197$.each(["borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle"], function(_, prop) {
19198$.fx.step[prop] = function(fx) {
19199if (fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr) {
19200jQuery.style(fx.elem, prop, fx.end);
19201fx.setAttr = true;
19202}
19203}
19204;
19205});
19206function getElementStyles(elem) {
19207var key, len, style = elem.ownerDocument.defaultView ? elem.ownerDocument.defaultView.getComputedStyle(elem, null) : elem.currentStyle, styles = {};
19208if (style && style.length && style[0] && style[style[0]]) {
19209len = style.length;
19210while (len--) {
19211key = style[len];
19212if (typeof style[key] === "string") {
19213styles[$.camelCase(key)] = style[key];
19214}
19215}
19216} else {
19217for (key in style) {
19218if (typeof style[key] === "string") {
19219styles[key] = style[key];
19220}
19221}
19222}
19223return styles;
19224}
19225function styleDifference(oldStyle, newStyle) {
19226var diff = {}, name, value;
19227for (name in newStyle) {
19228value = newStyle[name];
19229if (oldStyle[name] !== value) {
19230if (!shorthandStyles[name]) {
19231if ($.fx.step[name] || !isNaN(parseFloat(value))) {
19232diff[name] = value;
19233}
19234}
19235}
19236}
19237return diff;
19238}
19239if (!$.fn.addBack) {
19240$.fn.addBack = function(selector) {
19241return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));
19242}
19243;
19244}
19245$.effects.animateClass = function(value, duration, easing, callback) {
19246var o = $.speed(duration, easing, callback);
19247return this.queue(function() {
19248var animated = $(this), baseClass = animated.attr("class") || "", applyClassChange, allAnimations = o.children ? animated.find("*").addBack() : animated;
19249allAnimations = allAnimations.map(function() {
19250var el = $(this);
19251return {
19252el: el,
19253start: getElementStyles(this)
19254};
19255});
19256applyClassChange = function() {
19257$.each(classAnimationActions, function(i, action) {
19258if (value[action]) {
19259animated[action + "Class"](value[action]);
19260}
19261});
19262}
19263;
19264applyClassChange();
19265allAnimations = allAnimations.map(function() {
19266this.end = getElementStyles(this.el[0]);
19267this.diff = styleDifference(this.start, this.end);
19268return this;
19269});
19270animated.attr("class", baseClass);
19271allAnimations = allAnimations.map(function() {
19272var styleInfo = this
19273  , dfd = $.Deferred()
19274  , opts = $.extend({}, o, {
19275queue: false,
19276complete: function() {
19277dfd.resolve(styleInfo);
19278}
19279});
19280this.el.animate(this.diff, opts);
19281return dfd.promise();
19282});
19283$.when.apply($, allAnimations.get()).done(function() {
19284applyClassChange();
19285$.each(arguments, function() {
19286var el = this.el;
19287$.each(this.diff, function(key) {
19288el.css(key, "");
19289});
19290});
19291o.complete.call(animated[0]);
19292});
19293});
19294}
19295;
19296$.fn.extend({
19297addClass: (function(orig) {
19298return function(classNames, speed, easing, callback) {
19299return speed ? $.effects.animateClass.call(this, {
19300add: classNames
19301}, speed, easing, callback) : orig.apply(this, arguments);
19302}
19303;
19304}
19305)($.fn.addClass),
19306removeClass: (function(orig) {
19307return function(classNames, speed, easing, callback) {
19308return arguments.length > 1 ? $.effects.animateClass.call(this, {
19309remove: classNames
19310}, speed, easing, callback) : orig.apply(this, arguments);
19311}
19312;
19313}
19314)($.fn.removeClass),
19315toggleClass: (function(orig) {
19316return function(classNames, force, speed, easing, callback) {
19317if (typeof force === "boolean" || force === undefined) {
19318if (!speed) {
19319return orig.apply(this, arguments);
19320} else {
19321return $.effects.animateClass.call(this, (force ? {
19322add: classNames
19323} : {
19324remove: classNames
19325}), speed, easing, callback);
19326}
19327} else {
19328return $.effects.animateClass.call(this, {
19329toggle: classNames
19330}, force, speed, easing);
19331}
19332}
19333;
19334}
19335)($.fn.toggleClass),
19336switchClass: function(remove, add, speed, easing, callback) {
19337return $.effects.animateClass.call(this, {
19338add: add,
19339remove: remove
19340}, speed, easing, callback);
19341}
19342});
19343}
19344)();
19345(function() {
19346$.extend($.effects, {
19347version: "1.11.4",
19348save: function(element, set) {
19349for (var i = 0; i < set.length; i++) {
19350if (set[i] !== null) {
19351element.data(dataSpace + set[i], element[0].style[set[i]]);
19352}
19353}
19354},
19355restore: function(element, set) {
19356var val, i;
19357for (i = 0; i < set.length; i++) {
19358if (set[i] !== null) {
19359val = element.data(dataSpace + set[i]);
19360if (val === undefined) {
19361val = "";
19362}
19363element.css(set[i], val);
19364}
19365}
19366},
19367setMode: function(el, mode) {
19368if (mode === "toggle") {
19369mode = el.is(":hidden") ? "show" : "hide";
19370}
19371return mode;
19372},
19373getBaseline: function(origin, original) {
19374var y, x;
19375switch (origin[0]) {
19376case "top":
19377y = 0;
19378break;
19379case "middle":
19380y = 0.5;
19381break;
19382case "bottom":
19383y = 1;
19384break;
19385default:
19386y = origin[0] / original.height;
19387}
19388switch (origin[1]) {
19389case "left":
19390x = 0;
19391break;
19392case "center":
19393x = 0.5;
19394break;
19395case "right":
19396x = 1;
19397break;
19398default:
19399x = origin[1] / original.width;
19400}
19401return {
19402x: x,
19403y: y
19404};
19405},
19406createWrapper: function(element) {
19407if (element.parent().is(".ui-effects-wrapper")) {
19408return element.parent();
19409}
19410var props = {
19411width: element.outerWidth(true),
19412height: element.outerHeight(true),
19413"float": element.css("float")
19414}
19415  , wrapper = $("<div></div>").addClass("ui-effects-wrapper").css({
19416fontSize: "100%",
19417background: "transparent",
19418border: "none",
19419margin: 0,
19420padding: 0
19421})
19422  , size = {
19423width: element.width(),
19424height: element.height()
19425}
19426  , active = document.activeElement;
19427try {
19428active.id;
19429} catch (e) {
19430active = document.body;
19431}
19432element.wrap(wrapper);
19433if (element[0] === active || $.contains(element[0], active)) {
19434$(active).focus();
19435}
19436wrapper = element.parent();
19437if (element.css("position") === "static") {
19438wrapper.css({
19439position: "relative"
19440});
19441element.css({
19442position: "relative"
19443});
19444} else {
19445$.extend(props, {
19446position: element.css("position"),
19447zIndex: element.css("z-index")
19448});
19449$.each(["top", "left", "bottom", "right"], function(i, pos) {
19450props[pos] = element.css(pos);
19451if (isNaN(parseInt(props[pos], 10))) {
19452props[pos] = "auto";
19453}
19454});
19455element.css({
19456position: "relative",
19457top: 0,
19458left: 0,
19459right: "auto",
19460bottom: "auto"
19461});
19462}
19463element.css(size);
19464return wrapper.css(props).show();
19465},
19466removeWrapper: function(element) {
19467var active = document.activeElement;
19468if (element.parent().is(".ui-effects-wrapper")) {
19469element.parent().replaceWith(element);
19470if (element[0] === active || $.contains(element[0], active)) {
19471$(active).focus();
19472}
19473}
19474return element;
19475},
19476setTransition: function(element, list, factor, value) {
19477value = value || {};
19478$.each(list, function(i, x) {
19479var unit = element.cssUnit(x);
19480if (unit[0] > 0) {
19481value[x] = unit[0] * factor + unit[1];
19482}
19483});
19484return value;
19485}
19486});
19487function _normalizeArguments(effect, options, speed, callback) {
19488if ($.isPlainObject(effect)) {
19489options = effect;
19490effect = effect.effect;
19491}
19492effect = {
19493effect: effect
19494};
19495if (options == null) {
19496options = {};
19497}
19498if ($.isFunction(options)) {
19499callback = options;
19500speed = null;
19501options = {};
19502}
19503if (typeof options === "number" || $.fx.speeds[options]) {
19504callback = speed;
19505speed = options;
19506options = {};
19507}
19508if ($.isFunction(speed)) {
19509callback = speed;
19510speed = null;
19511}
19512if (options) {
19513$.extend(effect, options);
19514}
19515speed = speed || options.duration;
19516effect.duration = $.fx.off ? 0 : typeof speed === "number" ? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default;
19517effect.complete = callback || options.complete;
19518return effect;
19519}
19520function standardAnimationOption(option) {
19521if (!option || typeof option === "number" || $.fx.speeds[option]) {
19522return true;
19523}
19524if (typeof option === "string" && !$.effects.effect[option]) {
19525return true;
19526}
19527if ($.isFunction(option)) {
19528return true;
19529}
19530if (typeof option === "object" && !option.effect) {
19531return true;
19532}
19533return false;
19534}
19535$.fn.extend({
19536effect: function() {
19537var args = _normalizeArguments.apply(this, arguments)
19538  , mode = args.mode
19539  , queue = args.queue
19540  , effectMethod = $.effects.effect[args.effect];
19541if ($.fx.off || !effectMethod) {
19542if (mode) {
19543return this[mode](args.duration, args.complete);
19544} else {
19545return this.each(function() {
19546if (args.complete) {
19547args.complete.call(this);
19548}
19549});
19550}
19551}
19552function run(next) {
19553var elem = $(this)
19554  , complete = args.complete
19555  , mode = args.mode;
19556function done() {
19557if ($.isFunction(complete)) {
19558complete.call(elem[0]);
19559}
19560if ($.isFunction(next)) {
19561next();
19562}
19563}
19564if (elem.is(":hidden") ? mode === "hide" : mode === "show") {
19565elem[mode]();
19566done();
19567} else {
19568effectMethod.call(elem[0], args, done);
19569}
19570}
19571return queue === false ? this.each(run) : this.queue(queue || "fx", run);
19572},
19573show: (function(orig) {
19574return function(option) {
19575if (standardAnimationOption(option)) {
19576return orig.apply(this, arguments);
19577} else {
19578var args = _normalizeArguments.apply(this, arguments);
19579args.mode = "show";
19580return this.effect.call(this, args);
19581}
19582}
19583;
19584}
19585)($.fn.show),
19586hide: (function(orig) {
19587return function(option) {
19588if (standardAnimationOption(option)) {
19589return orig.apply(this, arguments);
19590} else {
19591var args = _normalizeArguments.apply(this, arguments);
19592args.mode = "hide";
19593return this.effect.call(this, args);
19594}
19595}
19596;
19597}
19598)($.fn.hide),
19599toggle: (function(orig) {
19600return function(option) {
19601if (standardAnimationOption(option) || typeof option === "boolean") {
19602return orig.apply(this, arguments);
19603} else {
19604var args = _normalizeArguments.apply(this, arguments);
19605args.mode = "toggle";
19606return this.effect.call(this, args);
19607}
19608}
19609;
19610}
19611)($.fn.toggle),
19612cssUnit: function(key) {
19613var style = this.css(key)
19614  , val = [];
19615$.each(["em", "px", "%", "pt"], function(i, unit) {
19616if (style.indexOf(unit) > 0) {
19617val = [parseFloat(style), unit];
19618}
19619});
19620return val;
19621}
19622});
19623}
19624)();
19625(function() {
19626var baseEasings = {};
19627$.each(["Quad", "Cubic", "Quart", "Quint", "Expo"], function(i, name) {
19628baseEasings[name] = function(p) {
19629return Math.pow(p, i + 2);
19630}
19631;
19632});
19633$.extend(baseEasings, {
19634Sine: function(p) {
19635return 1 - Math.cos(p * Math.PI / 2);
19636},
19637Circ: function(p) {
19638return 1 - Math.sqrt(1 - p * p);
19639},
19640Elastic: function(p) {
19641return p === 0 || p === 1 ? p : -Math.pow(2, 8 * (p - 1)) * Math.sin(((p - 1) * 80 - 7.5) * Math.PI / 15);
19642},
19643Back: function(p) {
19644return p * p * (3 * p - 2);
19645},
19646Bounce: function(p) {
19647var pow2, bounce = 4;
19648while (p < ((pow2 = Math.pow(2, --bounce)) - 1) / 11) {}
19649return 1 / Math.pow(4, 3 - bounce) - 7.5625 * Math.pow((pow2 * 3 - 2) / 22 - p, 2);
19650}
19651});
19652$.each(baseEasings, function(name, easeIn) {
19653$.easing["easeIn" + name] = easeIn;
19654$.easing["easeOut" + name] = function(p) {
19655return 1 - easeIn(1 - p);
19656}
19657;
19658$.easing["easeInOut" + name] = function(p) {
19659return p < 0.5 ? easeIn(p * 2) / 2 : 1 - easeIn(p * -2 + 2) / 2;
19660}
19661;
19662});
19663}
19664)();
19665var effect = $.effects;
19666var effectBounce = $.effects.effect.bounce = function(o, done) {
19667var el = $(this), props = ["position", "top", "bottom", "left", "right", "height", "width"], mode = $.effects.setMode(el, o.mode || "effect"), hide = mode === "hide", show = mode === "show", direction = o.direction || "up", distance = o.distance, times = o.times || 5, anims = times * 2 + (show || hide ? 1 : 0), speed = o.duration / anims, easing = o.easing, ref = (direction === "up" || direction === "down") ? "top" : "left", motion = (direction === "up" || direction === "left"), i, upAnim, downAnim, queue = el.queue(), queuelen = queue.length;
19668if (show || hide) {
19669props.push("opacity");
19670}
19671$.effects.save(el, props);
19672el.show();
19673$.effects.createWrapper(el);
19674if (!distance) {
19675distance = el[ref === "top" ? "outerHeight" : "outerWidth"]() / 3;
19676}
19677if (show) {
19678downAnim = {
19679opacity: 1
19680};
19681downAnim[ref] = 0;
19682el.css("opacity", 0).css(ref, motion ? -distance * 2 : distance * 2).animate(downAnim, speed, easing);
19683}
19684if (hide) {
19685distance = distance / Math.pow(2, times - 1);
19686}
19687downAnim = {};
19688downAnim[ref] = 0;
19689for (i = 0; i < times; i++) {
19690upAnim = {};
19691upAnim[ref] = (motion ? "-=" : "+=") + distance;
19692el.animate(upAnim, speed, easing).animate(downAnim, speed, easing);
19693distance = hide ? distance * 2 : distance / 2;
19694}
19695if (hide) {
19696upAnim = {
19697opacity: 0
19698};
19699upAnim[ref] = (motion ? "-=" : "+=") + distance;
19700el.animate(upAnim, speed, easing);
19701}
19702el.queue(function() {
19703if (hide) {
19704el.hide();
19705}
19706$.effects.restore(el, props);
19707$.effects.removeWrapper(el);
19708done();
19709});
19710if (queuelen > 1) {
19711queue.splice.apply(queue, [1, 0].concat(queue.splice(queuelen, anims + 1)));
19712}
19713el.dequeue();
19714}
19715;
19716}));
19717;
19718/* /web/static/lib/jquery/jquery.browser.js defined in bundle 'web.assets_common' */
19719(function() {
19720$.uaMatch = function(ua) {
19721var ua = ua.toLowerCase();
19722var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || /(webkit)[\/]([\w.]+)/.exec(ua) || /(opera)(?:.*version|)[\/]([\w.]+)/.exec(ua) || /(msie)([\w.]+)/.exec(ua) || ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || [];
19723return {
19724browser: match[1] || "",
19725version: match[2] || "0"
19726};
19727}
19728;
19729if (!$.browser) {
19730var matched = $.uaMatch(navigator.userAgent);
19731var browser = {};
19732if (matched.browser) {
19733browser[matched.browser] = true;
19734browser.version = matched.version;
19735}
19736if (browser.chrome) {
19737browser.webkit = true;
19738} else if (browser.webkit) {
19739browser.safari = true;
19740}
19741$.browser = browser;
19742}
19743}
19744)();
19745;
19746/* /web/static/lib/jquery.blockUI/jquery.blockUI.js defined in bundle 'web.assets_common' */
19747;(function() {
19748"use strict";
19749function setup($) {
19750$.fn._fadeIn = $.fn.fadeIn;
19751var noOp = $.noop || function() {}
19752;
19753var msie = /MSIE/.test(navigator.userAgent);
19754var ie6 = /MSIE 6.0/.test(navigator.userAgent) && !/MSIE 8.0/.test(navigator.userAgent);
19755var mode = document.documentMode || 0;
19756var setExpr = $.isFunction(document.createElement('div').style.setExpression);
19757$.blockUI = function(opts) {
19758install(window, opts);
19759}
19760;
19761$.unblockUI = function(opts) {
19762remove(window, opts);
19763}
19764;
19765$.growlUI = function(title, message, timeout, onClose) {
19766var $m = $('<div class="growlUI"></div>');
19767if (title)
19768$m.append('<h1>' + title + '</h1>');
19769if (message)
19770$m.append('<h2>' + message + '</h2>');
19771if (timeout === undefined)
19772timeout = 3000;
19773var callBlock = function(opts) {
19774opts = opts || {};
19775$.blockUI({
19776message: $m,
19777fadeIn: typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700,
19778fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,
19779timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,
19780centerY: false,
19781showOverlay: false,
19782onUnblock: onClose,
19783css: $.blockUI.defaults.growlCSS
19784});
19785};
19786callBlock();
19787var nonmousedOpacity = $m.css('opacity');
19788$m.mouseover(function() {
19789callBlock({
19790fadeIn: 0,
19791timeout: 30000
19792});
19793var displayBlock = $('.blockMsg');
19794displayBlock.stop();
19795displayBlock.fadeTo(300, 1);
19796}).mouseout(function() {
19797$('.blockMsg').fadeOut(1000);
19798});
19799}
19800;
19801$.fn.block = function(opts) {
19802if (this[0] === window) {
19803$.blockUI(opts);
19804return this;
19805}
19806var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
19807this.each(function() {
19808var $el = $(this);
19809if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
19810return;
19811$el.unblock({
19812fadeOut: 0
19813}
vendor: 9,794 bytes, lines 19813-20154
19813);
19814});
19815return this.each(function() {
19816if ($.css(this, 'position') == 'static') {
19817this.style.position = 'relative';
19818$(this).data('blockUI.static', true);
19819}
19820this.style.zoom = 1;
19821install(this, opts);
19822});
19823}
19824;
19825$.fn.unblock = function(opts) {
19826if (this[0] === window) {
19827$.unblockUI(opts);
19828return this;
19829}
19830return this.each(function() {
19831remove(this, opts);
19832});
19833}
19834;
19835$.blockUI.version = 2.70;
19836$.blockUI.defaults = {
19837message: '<h1>Please wait...</h1>',
19838title: null,
19839draggable: true,
19840theme: false,
19841css: {
19842padding: 0,
19843margin: 0,
19844width: '30%',
19845top: '40%',
19846left: '35%',
19847textAlign: 'center',
19848color: '#000',
19849border: '3px solid #aaa',
19850backgroundColor: '#fff',
19851cursor: 'wait'
19852},
19853themedCSS: {
19854width: '30%',
19855top: '40%',
19856left: '35%'
19857},
19858overlayCSS: {
19859backgroundColor: '#000',
19860opacity: 0.6,
19861cursor: 'wait'
19862},
19863cursorReset: 'default',
19864growlCSS: {
19865width: '350px',
19866top: '10px',
19867left: '',
19868right: '10px',
19869border: 'none',
19870padding: '5px',
19871opacity: 0.6,
19872cursor: 'default',
19873color: '#fff',
19874backgroundColor: '#000',
19875'-webkit-border-radius': '10px',
19876'-moz-border-radius': '10px',
19877'border-radius': '10px'
19878},
19879iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
19880forceIframe: false,
19881baseZ: 1000,
19882centerX: true,
19883centerY: true,
19884allowBodyStretch: true,
19885bindEvents: true,
19886constrainTabKey: true,
19887fadeIn: 200,
19888fadeOut: 400,
19889timeout: 0,
19890showOverlay: true,
19891focusInput: true,
19892focusableElements: ':input:enabled:visible',
19893onBlock: null,
19894onUnblock: null,
19895onOverlayClick: null,
19896quirksmodeOffsetHack: 4,
19897blockMsgClass: 'blockMsg',
19898ignoreIfBlocked: false
19899};
19900var pageBlock = null;
19901var pageBlockEls = [];
19902function install(el, opts) {
19903var css, themedCSS;
19904var full = (el == window);
19905var msg = (opts && opts.message !== undefined ? opts.message : undefined);
19906opts = $.extend({}, $.blockUI.defaults, opts || {});
19907if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
19908return;
19909opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
19910css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
19911if (opts.onOverlayClick)
19912opts.overlayCSS.cursor = 'pointer';
19913themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
19914msg = msg === undefined ? opts.message : msg;
19915if (full && pageBlock)
19916remove(window, {
19917fadeOut: 0
19918});
19919if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
19920var node = msg.jquery ? msg[0] : msg;
19921var data = {};
19922$(el).data('blockUI.history', data);
19923data.el = node;
19924data.parent = node.parentNode;
19925data.display = node.style.display;
19926data.position = node.style.position;
19927if (data.parent)
19928data.parent.removeChild(node);
19929}
19930$(el).data('blockUI.onUnblock', opts.onUnblock);
19931var z = opts.baseZ;
19932var lyr1, lyr2, lyr3, s;
19933if (msie || opts.forceIframe)
19934lyr1 = $('<iframe class="blockUI" style="z-index:' + (z++) + ';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="' + opts.iframeSrc + '"></iframe>');
19935else
19936lyr1 = $('<div class="blockUI" style="display:none"></div>');
19937if (opts.theme)
19938lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:' + (z++) + ';display:none"></div>');
19939else
19940lyr2 = $('<div class="blockUI blockOverlay" style="z-index:' + (z++) + ';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
19941if (opts.theme && full) {
19942s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:' + (z + 10) + ';display:none;position:fixed">';
19943if (opts.title) {
19944s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">' + (opts.title || '&nbsp;') + '</div>';
19945}
19946s += '<div class="ui-widget-content ui-dialog-content"></div>';
19947s += '</div>';
19948} else if (opts.theme) {
19949s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:' + (z + 10) + ';display:none;position:absolute">';
19950if (opts.title) {
19951s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">' + (opts.title || '&nbsp;') + '</div>';
19952}
19953s += '<div class="ui-widget-content ui-dialog-content"></div>';
19954s += '</div>';
19955} else if (full) {
19956s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:' + (z + 10) + ';display:none;position:fixed"></div>';
19957} else {
19958s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:' + (z + 10) + ';display:none;position:absolute"></div>';
19959}
19960lyr3 = $(s);
19961if (msg) {
19962if (opts.theme) {
19963lyr3.css(themedCSS);
19964lyr3.addClass('ui-widget-content');
19965} else
19966lyr3.css(css);
19967}
19968if (!opts.theme)
19969lyr2.css(opts.overlayCSS);
19970lyr2.css('position', full ? 'fixed' : 'absolute');
19971if (msie || opts.forceIframe)
19972lyr1.css('opacity', 0.0);
19973var layers = [lyr1, lyr2, lyr3]
19974  , $par = full ? $('body') : $(el);
19975$.each(layers, function() {
19976this.appendTo($par);
19977});
19978if (opts.theme && opts.draggable && $.fn.draggable) {
19979lyr3.draggable({
19980handle: '.ui-dialog-titlebar',
19981cancel: 'li'
19982});
19983}
19984var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
19985if (ie6 || expr) {
19986if (full && opts.allowBodyStretch && $.support.boxModel)
19987$('html,body').css('height', '100%');
19988if ((ie6 || !$.support.boxModel) && !full) {
19989var t = sz(el, 'borderTopWidth')
19990  , l = sz(el, 'borderLeftWidth');
19991var fixT = t ? '(0 - ' + t + ')' : 0;
19992var fixL = l ? '(0 - ' + l + ')' : 0;
19993}
19994$.each(layers, function(i, o) {
19995var s = o[0].style;
19996s.position = 'absolute';
19997if (i < 2) {
19998if (full)
19999s.setExpression('height', 'Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:' + opts.quirksmodeOffsetHack + ') + "px"');
20000else
20001s.setExpression('height', 'this.parentNode.offsetHeight + "px"');
20002if (full)
20003s.setExpression('width', 'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
20004else
20005s.setExpression('width', 'this.parentNode.offsetWidth + "px"');
20006if (fixL)
20007s.setExpression('left', fixL);
20008if (fixT)
20009s.setExpression('top', fixT);
20010} else if (opts.centerY) {
20011if (full)
20012s.setExpression('top', '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
20013s.marginTop = 0;
20014} else if (!opts.centerY && full) {
20015var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
20016var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + ' + top + ') + "px"';
20017s.setExpression('top', expression);
20018}
20019});
20020}
20021if (msg) {
20022if (opts.theme)
20023lyr3.find('.ui-widget-content').append(msg);
20024else
20025lyr3.append(msg);
20026if (msg.jquery || msg.nodeType)
20027$(msg).show();
20028}
20029if ((msie || opts.forceIframe) && opts.showOverlay)
20030lyr1.show();
20031if (opts.fadeIn) {
20032var cb = opts.onBlock ? opts.onBlock : noOp;
20033var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
20034var cb2 = msg ? cb : noOp;
20035if (opts.showOverlay)
20036lyr2._fadeIn(opts.fadeIn, cb1);
20037if (msg)
20038lyr3._fadeIn(opts.fadeIn, cb2);
20039} else {
20040if (opts.showOverlay)
20041lyr2.show();
20042if (msg)
20043lyr3.show();
20044if (opts.onBlock)
20045opts.onBlock.bind(lyr3)();
20046}
20047bind(1, el, opts);
20048if (full) {
20049pageBlock = lyr3[0];
20050pageBlockEls = $(opts.focusableElements, pageBlock);
20051if (opts.focusInput)
20052setTimeout(focus, 20);
20053} else
20054center(lyr3[0], opts.centerX, opts.centerY);
20055if (opts.timeout) {
20056var to = setTimeout(function() {
20057if (full)
20058$.unblockUI(opts);
20059else
20060$(el).unblock(opts);
20061}, opts.timeout);
20062$(el).data('blockUI.timeout', to);
20063}
20064}
20065function remove(el, opts) {
20066var count;
20067var full = (el == window);
20068var $el = $(el);
20069var data = $el.data('blockUI.history');
20070var to = $el.data('blockUI.timeout');
20071if (to) {
20072clearTimeout(to);
20073$el.removeData('blockUI.timeout');
20074}
20075opts = $.extend({}, $.blockUI.defaults, opts || {});
20076bind(0, el, opts);
20077if (opts.onUnblock === null) {
20078opts.onUnblock = $el.data('blockUI.onUnblock');
20079$el.removeData('blockUI.onUnblock');
20080}
20081var els;
20082if (full)
20083els = $('body').children().filter('.blockUI').add('body > .blockUI');
20084else
20085els = $el.find('>.blockUI');
20086if (opts.cursorReset) {
20087if (els.length > 1)
20088els[1].style.cursor = opts.cursorReset;
20089if (els.length > 2)
20090els[2].style.cursor = opts.cursorReset;
20091}
20092if (full)
20093pageBlock = pageBlockEls = null;
20094if (opts.fadeOut) {
20095count = els.length;
20096els.stop().fadeOut(opts.fadeOut, function() {
20097if (--count === 0)
20098reset(els, data, opts, el);
20099});
20100} else
20101reset(els, data, opts, el);
20102}
20103function reset(els, data, opts, el) {
20104var $el = $(el);
20105if ($el.data('blockUI.isBlocked'))
20106return;
20107els.each(function(i, o) {
20108if (this.parentNode)
20109this.parentNode.removeChild(this);
20110});
20111if (data && data.el) {
20112data.el.style.display = data.display;
20113data.el.style.position = data.position;
20114data.el.style.cursor = 'default';
20115if (data.parent)
20116data.parent.appendChild(data.el);
20117$el.removeData('blockUI.history');
20118}
20119if ($el.data('blockUI.static')) {
20120$el.css('position', 'static');
20121}
20122if (typeof opts.onUnblock == 'function')
20123opts.onUnblock(el, opts);
20124var body = $(document.body)
20125  , w = body.width()
20126  , cssW = body[0].style.width;
20127body.width(w - 1).width(w);
20128body[0].style.width = cssW;
20129}
20130function bind(b, el, opts) {
20131var full = el == window
20132  , $el = $(el);
20133if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
20134return;
20135$el.data('blockUI.isBlocked', b);
20136if (!full || !opts.bindEvents || (b && !opts.showOverlay))
20137return;
20138var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
20139if (b)
20140$(document).bind(events, opts, handler);
20141else
20142$(document).unbind(events, handler);
20143}
20144function handler(e) {
20145if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) {
20146if (pageBlock && e.data.constrainTabKey) {
20147var els = pageBlockEls;
20148var fwd = !e.shiftKey && e.target === els[els.length - 1];
20149var back = e.shiftKey && e.target === els[0];
20150if (fwd || back) {
20151setTimeout(function() {
20152focus(back);
20153}, 10);
20154return false;
20155}
20156}
20157}
20158var opts = e.data;
20159var target = $(e.target);
20160if (target.hasClass('blockOverlay') && opts.onOverlayClick)
20161opts.onOverlayClick(e);
20162if (target.parents('div.' + opts.blockMsgClass).length > 0)
20163return true;
20164return target.parents().children().filter('div.blockUI').length === 0;
20165}
20166function focus(back) {
20167if (!pageBlockEls)
20168return;
20169var e = pageBlockEls[back === true ? pageBlockEls.length - 1 : 0];
20170if (e)
20171e.focus();
20172}
20173function center(el, x, y) {
20174var p = el.parentNode
20175  , s = el.style;
20176var l = ((p.offsetWidth - el.offsetWidth) / 2) - sz(p, 'borderLeftWidth');
20177var t = ((p.offsetHeight - el.offsetHeight) / 2) - sz(p, 'borderTopWidth');
20178if (x)
20179s.left = l > 0 ? (l + 'px') : '0';
20180if (y)
20181s.top = t > 0 ? (t + 'px') : '0';
20182}
20183function sz(el, p) {
20184return parseInt($.css(el, p), 10) || 0;
20185}
20186}
20187if (typeof define === 'function' && define.amd && define.amd.jQuery) {
20188define(['jquery'], setup);
20189} else {
20190setup(jQuery);
20191}
20192}
20193)();
20194;
20195/* /web/static/lib/jquery.hotkeys/jquery.hotkeys.js defined in bundle 'web.assets_common' */
20196(function(jQuery) {
20197jQuery.hotkeys = {
20198version: "0.8",
20199specialKeys: {
202008: "backspace",
202019: "tab",
2020213: "return",
2020316: "shift",
2020417: "ctrl",
2020518: "alt",
2020619: "pause",
2020720: "capslock",
2020827: "esc",
2020932: "space",
2021033: "pageup",
2021134: "pagedown",
2021235: "end",
2021336: "home",
2021437: "left",
2021538: "up",
2021639: "right",
2021740: "down",
2021845: "insert",
2021946: "del",
2022096: "0",
2022197: "1",
2022298: "2",
2022399: "3",
20224100: "4",
20225101: "5",
20226102: "6",
20227103: "7",
20228104: "8",
20229105: "9",
20230106: "*",
20231107: "+",
20232109: "-",
20233110: ".",
20234111: "/",
20235112: "f1",
20236113: "f2",
20237114: "f3",
20238115: "f4",
20239116: "f5",
20240117: "f6",
20241118: "f7",
20242119: "f8",
20243120: "f9",
20244121: "f10",
20245122: "f11",
20246123: "f12",
20247144: "numlock",
20248145: "scroll",
20249191: "/",
20250224: "meta"
20251},
20252shiftNums: {
20253"`": "~",
20254"1": "!",
20255"2": "@",
20256"3": "#",
20257"4": "$",
20258"5": "%",
20259"6": "^",
20260"7": "&",
20261"8": "*",
20262"9": "(",
20263"0": ")",
20264"-": "_",
20265"=": "+",
20266";": ": ",
20267"'": "\"",
20268",": "<",
20269".": ">",
20270"/": "?",
20271"\\": "|"
20272}
20273};
20274function keyHandler(handleObj) {
20275if (typeof handleObj.data !== "string") {
20276return;
20277}
20278var origHandler = handleObj.handler
20279  , keys = handleObj.data.toLowerCase().split(" ");
20280handleObj.handler = function(event) {
20281if (this !== event.target && (/textarea|select/i.test(event.target.nodeName) || event.target.type === "text")) {
20282return;
20283}
20284var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[event.which], character = String.fromCharCode(event.which).toLowerCase(), key, modif = "", possible = {};
20285if (event.altKey && special !== "alt") {
20286modif += "alt+";
20287}
20288if (event.ctrlKey && special !== "ctrl") {
20289modif += "ctrl+";
20290}
20291if (event.metaKey && !event.ctrlKey && special !== "meta") {
20292modif += "meta+";
20293}
20294if (event.shiftKey && special !== "shift") {
20295modif += "shift+";
20296}
20297if (special) {
20298possible[modif + special] = true;
20299} else {
20300possible[modif + character] = true;
20301possible[modif + jQuery.hotkeys.shiftNums[character]] = true;
20302if (modif === "shift+") {
20303possible[jQuery.hotkeys.shiftNums[character]] = true;
20304}
20305}
20306for (var i = 0, l = keys.length; i < l; i++) {
20307if (possible[keys[i]]) {
20308return origHandler.apply(this, arguments);
20309}
20310}
20311}
20312;
20313}
20314jQuery.each(["keydown", "keyup", "keypress"], function() {
20315jQuery.event.special[this] = {
20316add: keyHandler
20317};
20318});
20319}
20320)(jQuery);
20321;
20322/* /web/static/lib/jquery.placeholder/jquery.placeholder.js defined in bundle 'web.assets_common' */
20323;(function(window, document, $) {
20324var isInputSupported = 'placeholder'in document.createElement('input'), isTextareaSupported = 'placeholder'in document.createElement('textarea'), prototype = $.fn, valHooks = $.valHooks, hooks, placeholder;
20325if (isInputSupported && isTextareaSupported) {
20326placeholder = prototype.placeholder = function() {
20327return this;
20328}
20329;
20330placeholder.input = placeholder.textarea = true;
20331} else {
20332placeholder = prototype.placeholder = function() {
20333var $this = this;
20334$this.filter((isInputSupported ? 'textarea' : ':input') + '[placeholder]').not('.placeholder').bind({
20335'focus.placeholder': clearPlaceholder,
20336'blur.placeholder': setPlaceholder
20337}).data('placeholder-enabled', true).trigger('blur.placeholder');
20338return $this;
20339}
20340;
20341placeholder.input = isInputSupported;
20342placeholder.textarea = isTextareaSupported;
20343hooks = {
20344'get': function(element) {
20345var $element = $(element);
20346return $element.data('placeholder-enabled') && $element.hasClass('placeholder') ? '' : element.value;
20347},
20348'set': function(element, value) {
20349var $element = $(element);
20350if (!$element.data('placeholder-enabled')) {
20351return element.value = value;
20352}
20353if (value == '') {
20354element.value = value;
20355if (element != document.activeElement) {
20356setPlaceholder.call(element);
20357}
20358} else if ($element.hasClass('placeholder')) {
20359clearPlaceholder.call(element, true, value) || (element.value = value);
20360} else {
20361element.value = value;
20362}
20363return $element;
20364}
20365};
20366isInputSupported || (valHooks.input = hooks);
20367isTextareaSupported || (valHooks.textarea = hooks);
20368$(function() {
20369$(document).delegate('form', 'submit.placeholder', function() {
20370var $inputs = $('.placeholder', this).each(clearPlaceholder);
20371setTimeout(function() {
20372$inputs.each(setPlaceholder);
20373}, 10);
20374});
20375});
20376$(window).bind('beforeunload.placeholder', function() {
20377$('.placeholder').each(function() {
20378this.value = '';
20379});
20380});
20381}
20382function args(elem) {
20383var newAttrs = {}
20384  , rinlinejQuery = /^jQuery\d+$/;
20385$.each(elem.attributes, function(i, attr) {
20386if (attr.specified && !rinlinejQuery.test(attr.name)) {
20387newAttrs[attr.name] = attr.value;
20388}
20389});
20390return newAttrs;
20391}
20392function clearPlaceholder(event, value) {
20393var input = this
20394  , $input = $(input);
20395if (input.value == $input.attr('placeholder') && $input.hasClass('placeholder')) {
20396if ($input.data('placeholder-password')) {
20397$input = $input.hide().next().show().attr('id', $input.removeAttr('id').data('placeholder-id'));
20398if (event === true) {
20399return $input[0].value = value;
20400}
20401$input.focus();
20402} else {
20403input.value = '';
20404$input.removeClass('placeholder');
20405input == document.activeElement && input.select();
20406}
20407}
20408}
20409function setPlaceholder() {
20410var $replacement, input = this, $input = $(input), $origInput = $input, id = this.id;
20411if (input.value == '') {
20412if (input.type == 'password') {
20413if (!$input.data('placeholder-textinput')) {
20414try {
20415$replacement = $input.clone().attr({
20416'type': 'text'
20417});
20418} catch (e) {
20419$replacement = $('<input>').attr($.extend(args(this), {
20420'type': 'text'
20421}));
20422}
20423$replacement.removeAttr('name').data({
20424'placeholder-password': true,
20425'placeholder-id': id
20426}).bind('focus.placeholder', clearPlaceholder);
20427$input.data({
20428'placeholder-textinput': $replacement,
20429'placeholder-id': id
20430}).before($replacement);
20431}
20432$input = $input.removeAttr('id').hide().prev().attr('id', id).show();
20433}
20434$input.addClass('placeholder');
20435$input[0].value = $input.attr('placeholder');
20436} else {
20437$input.removeClass('placeholder');
20438}
20439}
20440}(this, document, jQuery));
20441;
20442/* /web/static/lib/jquery.form/jquery.form.js defined in bundle 'web.assets_common' */
20443(function(factory) {
20444"use strict";
20445if (typeof define === 'function' && define.amd) {
20446define(['jquery'], factory);
20447} else {
20448factory((typeof (jQuery) != 'undefined') ? jQuery : window.Zepto);
20449}
20450}(function($) {
20451"use strict";
20452var feature = {};
20453feature.fileapi = $("<input type='file'/>").get(0).files !== undefined;
20454feature.formdata = window.FormData !== undefined;
20455var hasProp = !!$.fn.prop;
20456$.fn.attr2 = function() {
20457if (!hasProp) {
20458return this.attr.apply(this, arguments);
20459}
20460var val = this.prop.apply(this, arguments);
20461if ((val && val.jquery) || typeof val === 'string') {
20462return val;
20463}
20464return this.attr.apply(this, arguments);
20465}
20466;
20467$.fn.ajaxSubmit = function(options) {
20468if (!this.length) {
20469log('ajaxSubmit: skipping submit process - no element selected');
20470return this;
20471}
20472var method, action, url, $form = this;
20473if (typeof options == 'function') {
20474options = {
20475success: options
20476};
20477} else if (options === undefined) {
20478options = {};
20479}
20480method = options.type || this.attr2('method');
20481action = options.url || this.attr2('action');
20482url = (typeof action === 'string') ? $.trim(action) : '';
20483url = url || window.location.href || '';
20484if (url) {
20485url = (url.match(/^([^#]+)/) || [])[1];
20486}
20487options = $.extend(true, {
20488url: url,
20489success: $.ajaxSettings.success,
20490type: method || $.ajaxSettings.type,
20491iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
20492}, options);
20493var veto = {};
20494this.trigger('form-pre-serialize', [this, options, veto]);
20495if (veto.veto) {
20496log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
20497return this;
20498}
20499if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
20500log('ajaxSubmit: submit aborted via beforeSerialize callback');
20501return this;
20502}
20503var traditional = options.traditional;
20504if (traditional === undefined) {
20505traditional = $.ajaxSettings.traditional;
20506}
20507var elements = [];
20508var qx, a = this.formToArray(options.semantic, elements);
20509if (options.data) {
20510options.extraData = options.data;
20511qx = $.param(options.data, traditional);
20512}
20513if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
20514log('ajaxSubmit: submit aborted via beforeSubmit callback');
20515return this;
20516}
20517this.trigger('form-submit-validate', [a, this, options, veto]);
20518if (veto.veto) {
20519log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
20520return this;
20521}
20522var q = $.param(a, traditional);
20523if (qx) {
20524q = (q ? (q + '&' + qx) : qx);
20525}
20526if (options.type.toUpperCase() == 'GET') {
20527options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
20528options.data = null;
20529} else {
20530options.data = q;
20531}
20532var callbacks = [];
20533if (options.resetForm) {
20534callbacks.push(function() {
20535$form.resetForm();
20536});
20537}
20538if (options.clearForm) {
20539callbacks.push(function() {
20540$form.clearForm(options.includeHidden);
20541});
20542}
20543if (!options.dataType && options.target) {
20544var oldSuccess = options.success || function() {}
20545;
20546callbacks.push(function(data) {
20547var fn = options.replaceTarget ? 'replaceWith' : 'html';
20548$(options.target)[fn](data).each(oldSuccess, arguments);
20549});
20550} else if (options.success) {
20551callbacks.push(options.success);
20552}
20553options.success = function(data, status, xhr) {
20554var context = options.context || this;
20555for (var i = 0, max = callbacks.length; i < max; i++) {
20556callbacks[i].apply(context, [data, status, xhr || $form, $form]);
20557}
20558}
20559;
20560if (options.error) {
20561var oldError = options.error;
20562options.error = function(xhr, status, error) {
20563var context = options.context || this;
20564oldError.apply(context, [xhr, status, error, $form]);
20565}
20566;
20567}
20568if (options.complete) {
20569var oldComplete = options.complete;
20570options.complete = function(xhr, status) {
20571var context = options.context || this;
20572oldComplete.apply(context, [xhr, status, $form]);
20573}
20574;
20575}
20576var fileInputs = $('input[type=file]:enabled', this).filter(function() {
20577return $(this).val() !== '';
20578});
20579var hasFileInputs = fileInputs.length > 0;
20580var mp = 'multipart/form-data';
20581var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
20582var fileAPI = feature.fileapi && feature.formdata;
20583log("fileAPI :" + fileAPI);
20584var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;
20585var jqxhr;
20586if (options.iframe !== false && (options.iframe || shouldUseFrame)) {
20587if (options.closeKeepAlive) {
20588$.get(options.closeKeepAlive, function() {
20589jqxhr = fileUploadIframe(a);
20590});
20591} else {
20592jqxhr = fileUploadIframe(a);
20593}
20594} else if ((hasFileInputs || multipart) && fileAPI) {
20595jqxhr = fileUploadXhr(a);
20596} else {
20597jqxhr = $.ajax(options);
20598}
20599$form.removeData('jqxhr').data('jqxhr', jqxhr);
20600for (var k = 0; k < elements.length; k++) {
20601elements[k] = null;
20602}
20603this.trigger('form-submit-notify', [this, options]);
20604return this;
20605function deepSerialize(extraData) {
20606var serialized = $.param(extraData, options.traditional).split('&');
20607var len = serialized.length;
20608var result = [];
20609var i, part;
20610for (i = 0; i < len; i++) {
20611serialized[i] = serialized[i].replace(/\+/g, ' ');
20612part = serialized[i].split('=');
20613result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]);
20614}
20615return result;
20616}
20617function fileUploadXhr(a) {
20618var formdata = new FormData();
20619for (var i = 0; i < a.length; i++) {
20620formdata.append(a[i].name, a[i].value);
20621}
20622if (options.extraData) {
20623var serializedData = deepSerialize(options.extraData);
20624for (i = 0; i < serializedData.length; i++) {
20625if (serializedData[i]) {
20626formdata.append(serializedData[i][0], serializedData[i][1]);
20627}
20628}
20629}
20630options.data = null;
20631var s = $.extend(true, {}, $.ajaxSettings, options, {
20632contentType: false,
20633processData: false,
20634cache: false,
20635type: method || 'POST'
20636});
20637if (options.uploadProgress) {
20638s.xhr = function() {
20639var xhr = $.ajaxSettings.xhr();
20640if (xhr.upload) {
20641xhr.upload.addEventListener('progress', function(event) {
20642var percent = 0;
20643var position = event.loaded || event.position;
20644var total = event.total;
20645if (event.lengthComputable) {
20646percent = Math.ceil(position / total * 100);
20647}
20648options.uploadProgress(event, position, total, percent);
20649}, false);
20650}
20651return xhr;
20652}
20653;
20654}
20655s.data = null;
20656var beforeSend = s.beforeSend;
20657s.beforeSend = function(xhr, o) {
20658if (options.formData) {
20659o.data = options.formData;
20660} else {
20661o.data = formdata;
20662}
20663if (beforeSend) {
20664beforeSend.call(this, xhr, o);
20665}
20666}
20667;
20668return $.ajax(s);
20669}
20670function fileUploadIframe(a) {
20671var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
20672var deferred = $.Deferred();
20673deferred.abort = function(status) {
20674xhr.abort(status);
20675}
20676;
20677if (a) {
20678for (i = 0; i < elements.length; i++) {
20679el = $(elements[i]);
20680if (hasProp) {
20681el.prop('disabled', false);
20682} else {
20683el.removeAttr('disabled');
20684}
20685}
20686}
20687s = $.extend(true, {}, $.ajaxSettings, options);
20688s.context = s.context || s;
20689id = 'jqFormIO' + (new Date().getTime());
20690if (s.iframeTarget) {
20691$io = $(s.iframeTarget);
20692n = $io.attr2('name');
20693if (!n) {
20694$io.attr2('name', id);
20695} else {
20696id = n;
20697}
20698} else {
20699$io = $('<iframe name="' + id + '" src="' + s.iframeSrc + '" />');
20700$io.css({
20701position: 'absolute',
20702top: '-1000px',
20703left: '-1000px'
20704});
20705}
20706io = $io[0];
20707xhr = {
20708aborted: 0,
20709responseText: null,
20710responseXML: null,
20711status: 0,
20712statusText: 'n/a',
20713getAllResponseHeaders: function() {},
20714getResponseHeader: function() {},
20715setRequestHeader: function() {},
20716abort: function(status) {
20717var e = (status === 'timeout' ? 'timeout' : 'aborted');
20718log('aborting upload... ' + e);
20719this.aborted = 1;
20720try {
20721if (io.contentWindow.document.execCommand) {
20722io.contentWindow.document.execCommand('Stop');
20723}
20724} catch (ignore) {}
20725$io.attr('src', s.iframeSrc);
20726xhr.error = e;
20727if (s.error) {
20728s.error.call(s.context, xhr, e, status);
20729}
20730if (g) {
20731$.event.trigger("ajaxError", [xhr, s, e]);
20732}
20733if (s.complete) {
20734s.complete.call(s.context, xhr, e);
20735}
20736}
20737};
20738g = s.global;
20739if (g && 0 === $.active++) {
20740$.event.trigger("ajaxStart");
20741}
20742if (g) {
20743$.event.trigger("ajaxSend", [xhr, s]);
20744}
20745if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
20746if (s.global) {
20747$.active--;
20748}
20749deferred.reject();
20750return deferred;
20751}
20752if (xhr.aborted) {
20753deferred.reject();
20754return deferred;
20755}
20756sub = form.clk;
20757if (sub) {
20758n = sub.name;
20759if (n && !sub.disabled) {
20760s.extraData = s.extraData || {};
20761s.extraData[n] = sub.value;
20762if (sub.type == "image") {
20763s.extraData[n + '.x'] = form.clk_x;
20764s.extraData[n + '.y'] = form.clk_y;
20765}
20766}
20767}
20768var CLIENT_TIMEOUT_ABORT = 1;
20769var SERVER_ABORT = 2;
20770function getDoc(frame) {
20771var doc = null;
20772try {
20773if (frame.contentWindow) {
20774doc = frame.contentWindow.document;
20775}
20776} catch (err) {
20777log('cannot get iframe.contentWindow document: ' + err);
20778}
20779if (doc) {
20780return doc;
20781}
20782try {
20783doc = frame.contentDocument ? frame.contentDocument : frame.document;
20784} catch (err) {
20785log('cannot get iframe.contentDocument: ' + err);
20786doc = frame.document;
20787}
20788return doc;
20789}
20790var csrf_token = $('meta[name=csrf-token]').attr('content');
20791var csrf_param = $('meta[name=csrf-param]').attr('content');
20792if (csrf_param && csrf_token) {
20793s.extraData = s.extraData || {};
20794s.extraData[csrf_param] = csrf_token;
20795}
20796function doSubmit() {
20797var t = $form.attr2('target')
20798  , a = $form.attr2('action')
20799  , mp = 'multipart/form-data'
20800  , et = $form.attr('enctype') || $form.attr('encoding') || mp;
20801form.setAttribute('target', id);
20802if (!method || /post/i.test(method)) {
20803form.setAttribute('method', 'POST');
20804}
20805if (a != s.url) {
20806form.setAttribute('action', s.url);
20807}
20808if (!s.skipEncodingOverride && (!method || /post/i.test(method))) {
20809$form.attr({
20810encoding: 'multipart/form-data',
20811enctype: 'multipart/form-data'
20812});
20813}
20814if (s.timeout) {
20815timeoutHandle = setTimeout(function() {
20816timedOut = true;
20817cb(CLIENT_TIMEOUT_ABORT);
20818}, s.timeout);
20819}
20820function checkState() {
20821try {
20822var state = getDoc(io).readyState;
20823log('state = ' + state);
20824if (state && state.toLowerCase() == 'uninitialized') {
20825setTimeout(checkState, 50);
20826}
20827} catch (e) {
20828log('Server abort: ', e, ' (', e.name, ')');
20829cb(SERVER_ABORT);
20830if (timeoutHandle) {
20831clearTimeout(timeoutHandle);
20832}
20833timeoutHandle = undefined;
20834}
20835}
20836var extraInputs = [];
20837try {
20838if (s.extraData) {
20839for (var n in s.extraData) {
20840if (s.extraData.hasOwnProperty(n)) {
20841if ($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {
20842extraInputs.push($('<input type="hidden" name="' + s.extraData[n].name + '">').val(s.extraData[n].value).appendTo(form)[0]);
20843} else {
20844extraInputs.push($('<input type="hidden" name="' + n + '">').val(s.extraData[n]).appendTo(form)[0]);
20845}
20846}
20847}
20848}
20849if (!s.iframeTarget) {
20850$io.appendTo('body');
20851}
20852if (io.attachEvent) {
20853io.attachEvent('onload', cb);
20854} else {
20855io.addEventListener('load', cb, false);
20856}
20857setTimeout(checkState, 15);
20858try {
20859form.submit();
20860} catch (err) {
20861var submitFn = document.createElement('form').submit;
20862submitFn.apply(form);
20863}
20864} finally {
20865form.setAttribute('action', a);
20866form.setAttribute('enctype', et);
20867if (t) {
20868form.setAttribute('target', t);
20869} else {
20870$form.removeAttr('target');
20871}
20872$(extraInputs).remove();
20873}
20874}
20875if (s.forceSync) {
20876doSubmit();
20877} else {
20878setTimeout(doSubmit, 10);
20879}
20880var data, doc, domCheckCount = 50, callbackProcessed;
20881function cb(e) {
20882if (xhr.aborted || callbackProcessed) {
20883return;
20884}
20885doc = getDoc(io);
20886if (!doc) {
20887log('cannot access response document');
20888e = SERVER_ABORT;
20889}
20890if (e === CLIENT_TIMEOUT_ABORT && xhr) {
20891xhr.abort('timeout');
20892deferred.reject(xhr, 'timeout');
20893return;
20894} else if (e == SERVER_ABORT && xhr) {
20895xhr.abort('server abort');
20896deferred.reject(xhr, 'error', 'server abort');
20897return;
20898}
20899if (!doc || doc.location.href == s.iframeSrc) {
20900if (!timedOut) {
20901return;
20902}
20903}
20904if (io.detachEvent) {
20905io.detachEvent('onload', cb);
20906} else {
20907io.removeEventListener('load', cb, false);
20908}
20909var status = 'success', errMsg;
20910try {
20911if (timedOut) {
20912throw 'timeout';
20913}
20914var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
20915log('isXml=' + isXml);
20916if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) {
20917if (--domCheckCount) {
20918log('requeing onLoad callback, DOM not available');
20919setTimeout(cb, 250);
20920return;
20921}
20922}
20923var docRoot = doc.body ? doc.body : doc.documentElement;
20924xhr.responseText = docRoot ? docRoot.innerHTML : null;
20925xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
20926if (isXml) {
20927s.dataType = 'xml';
20928}
20929xhr.getResponseHeader = function(header) {
20930var headers = {
20931'content-type': s.dataType
20932};
20933return headers[header.toLowerCase()];
20934}
20935;
20936if (docRoot) {
20937xhr.status = Number(docRoot.getAttribute('status')) || xhr.status;
20938xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
20939}
20940var dt = (s.dataType || '').toLowerCase();
20941var scr = /(json|script|text)/.test(dt);
20942if (scr || s.textarea) {
20943var ta = doc.getElementsByTagName('textarea')[0];
20944if (ta) {
20945xhr.responseText = ta.value;
20946xhr.status = Number(ta.getAttribute('status')) || xhr.status;
20947xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
20948} else if (scr) {
20949var pre = doc.getElementsByTagName('pre')[0];
20950var b = doc.getElementsByTagName('body')[0];
20951if (pre) {
20952xhr.responseText = pre.textContent ? pre.textContent : pre.innerText;
20953} else if (b) {
20954xhr.responseText = b.textContent ? b.textContent : b.innerText;
20955}
20956}
20957} else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) {
20958xhr.responseXML = toXml(xhr.responseText);
20959}
20960try {
20961data = httpData(xhr, dt, s);
20962} catch (err) {
20963status = 'parsererror';
20964xhr.error = errMsg = (err || status);
20965}
20966} catch (err) {
20967log('error caught: ', err);
20968status = 'error';
20969xhr.error = errMsg = (err || status);
20970}
20971if (xhr.aborted) {
20972log('upload aborted');
20973status = null;
20974}
20975if (xhr.status) {
20976status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
20977}
20978if (status === 'success') {
20979if (s.success) {
20980s.success.call(s.context, data, 'success', xhr);
20981}
20982deferred.resolve(xhr.responseText, 'success', xhr);
20983if (g) {
20984$.event.trigger("ajaxSuccess", [xhr, s]);
20985}
20986} else if (status) {
20987if (errMsg === undefined) {
20988errMsg = xhr.statusText;
20989}
20990if (s.error) {
20991s.error.call(s.context, xhr, status, errMsg);
20992}
20993deferred.reject(xhr, 'error', errMsg);
20994if (g) {
20995$.event.trigger("ajaxError", [xhr, s, errMsg]);
20996}
20997}
20998if (g) {
20999$.event.trigger("ajaxComplete", [xhr, s]);
21000}
21001if (g && !--$.active) {
21002$.event.trigger("ajaxStop");
21003}
21004if (s.complete) {
21005s.complete.call(s.context, xhr, status);
21006}
21007callbackProcessed = true;
21008if (s.timeout) {
21009clearTimeout(timeoutHandle);
21010}
21011setTimeout(function() {
21012if (!s.iframeTarget) {
21013$io.remove();
21014} else {
21015$io.attr('src', s.iframeSrc);
21016}
21017xhr.responseXML = null;
21018}, 100);
21019}
21020var toXml = $.parseXML || function(s, doc) {
21021if (window.ActiveXObject) {
21022doc = new ActiveXObject('Microsoft.XMLDOM');
21023doc.async = 'false';
21024doc.loadXML(s);
21025} else {
21026doc = (new DOMParser()).parseFromString(s, 'text/xml');
21027}
21028return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
21029}
21030;
21031var parseJSON = $.parseJSON || function(s) {
21032return window['eval']('(' + s + ')');
21033}
21034;
21035var httpData = function(xhr, type, s) {
21036var ct = xhr.getResponseHeader('content-type') || ''
21037  , xml = type === 'xml' || !type && ct.indexOf('xml') >= 0
21038  , data = xml ? xhr.responseXML : xhr.responseText;
21039if (xml && data.documentElement.nodeName === 'parsererror') {
21040if ($.error) {
21041$.error('parsererror');
21042}
21043}
21044if (s && s.dataFilter) {
21045data = s.dataFilter(data, type);
21046}
21047if (typeof data === 'string') {
21048if (type === 'json' || !type && ct.indexOf('json') >= 0) {
21049data = parseJSON(data);
21050} else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
21051$.globalEval(data);
21052}
21053}
21054return data;
21055};
21056return deferred;
21057}
21058}
21059;
21060$.fn.ajaxForm = function(options) {
21061options = options || {};
21062options.delegation = options.delegation && $.isFunction($.fn.on);
21063if (!options.delegation && this.length === 0) {
21064var o = {
21065s: this.selector,
21066c: this.context
21067};
21068if (!$.isReady && o.s) {
21069log('DOM not ready, queuing ajaxForm');
21070$(function() {
21071$(o.s, o.c).ajaxForm(options);
21072});
21073return this;
21074}
21075log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
21076return this;
21077}
21078if (options.delegation) {
21079$(document).off('submit.form-plugin', this.selector, doAjaxSubmit).off('click.form-plugin', this.selector, captureSubmittingElement).on('submit.form-plugin', this.selector, options, doAjaxSubmit).on('click.form-plugin', this.selector, options, captureSubmittingElement);
21080return this;
21081}
21082return this.ajaxFormUnbind().bind('submit.form-plugin', options, doAjaxSubmit).bind('click.form-plugin', options, captureSubmittingElement);
21083}
21084;
21085function doAjaxSubmit(e) {
21086var options = e.data;
21087if (!e.isDefaultPrevented()) {
21088e.preventDefault();
21089$(e.target).ajaxSubmit(options);
21090}
21091}
21092function captureSubmittingElement(e) {
21093var target = e.target;
21094var $el = $(target);
21095if (!($el.is("[type=submit],[type=image]"))) {
21096var t = $el.closest('[type=submit]');
21097if (t.length === 0) {
21098return;
21099}
21100target = t[0];
21101}
21102var form = this;
21103form.clk = target;
21104if (target.type == 'image') {
21105if (e.offsetX !== undefined) {
21106form.clk_x = e.offsetX;
21107form.clk_y = e.offsetY;
21108} else if (typeof $.fn.offset == 'function') {
21109var offset = $el.offset();
21110form.clk_x = e.pageX - offset.left;
21111form.clk_y = e.pageY - offset.top;
21112} else {
21113form.clk_x = e.pageX - target.offsetLeft;
21114form.clk_y = e.pageY - target.offsetTop;
21115}
21116}
21117setTimeout(function() {
21118form.clk = form.clk_x = form.clk_y = null;
21119}, 100);
21120}
21121$.fn.ajaxFormUnbind = function() {
21122return this.unbind('submit.form-plugin click.form-plugin');
21123}
21124;
21125$.fn.formToArray = function(semantic, elements) {
21126var a = [];
21127if (this.length === 0) {
21128return a;
21129}
21130var form = this[0];
21131var formId = this.attr('id');
21132var els = semantic ? form.getElementsByTagName('*') : form.elements;
21133var els2;
21134if (els && !/MSIE [678]/.test(navigator.userAgent)) {
21135els = $(els).get();
21136}
21137if (formId) {
21138els2 = $(':input[form="' + formId + '"]').get();
21139if (els2.length) {
21140els = (els || []).concat(els2);
21141}
21142}
21143if (!els || !els.length) {
21144return a;
21145}
21146var i, j, n, v, el, max, jmax;
21147for (i = 0,
21148max = els.length; i < max; i++) {
21149el = els[i];
21150n = el.name;
21151if (!n || el.disabled) {
21152continue;
21153}
21154if (semantic && form.clk && el.type == "image") {
21155if (form.clk == el) {
21156a.push({
21157name: n,
21158value: $(el).val(),
21159type: el.type
21160});
21161a.push({
21162name: n + '.x',
21163value: form.clk_x
21164}, {
21165name: n + '.y',
21166value: form.clk_y
21167});
21168}
21169continue;
21170}
21171v = $.fieldValue(el, true);
21172if (v && v.constructor == Array) {
21173if (elements) {
21174elements.push(el);
21175}
21176for (j = 0,
21177jmax = v.length; j < jmax; j++) {
21178a.push({
21179name: n,
21180value: v[j]
21181});
21182}
21183} else if (feature.fileapi && el.type == 'file') {
21184if (elements) {
21185elements.push(el);
21186}
21187var files = el.files;
21188if (files.length) {
21189for (j = 0; j < files.length; j++) {
21190a.push({
21191name: n,
21192value: files[j],
21193type: el.type
21194});
21195}
21196} else {
21197a.push({
21198name: n,
21199value: '',
21200type: el.type
21201});
21202}
21203} else if (v !== null && typeof v != 'undefined') {
21204if (elements) {
21205elements.push(el);
21206}
21207a.push({
21208name: n,
21209value: v,
21210type: el.type,
21211required: el.required
21212});
21213}
21214}
21215if (!semantic && form.clk) {
21216var $input = $(form.clk)
21217  , input = $input[0];
21218n = input.name;
21219if (n && !input.disabled && input.type == 'image') {
21220a.push({
21221name: n,
21222value: $input.val()
21223});
21224a.push({
21225name: n + '.x',
21226value: form.clk_x
21227}, {
21228name: n + '.y',
21229value: form.clk_y
21230});
21231}
21232}
21233return a;
21234}
21235;
21236$.fn.formSerialize = function(semantic) {
21237return $.param(this.formToArray(semantic));
21238}
21239;
21240$.fn.fieldSerialize = function(successful) {
21241var a = [];
21242this.each(function() {
21243var n = this.name;
21244if (!n) {
21245return;
21246}
21247var v = $.fieldValue(this, successful);
21248if (v && v.constructor == Array) {
21249for (var i = 0, max = v.length; i < max; i++) {
21250a.push({
21251name: n,
21252value: v[i]
21253});
21254}
21255} else if (v !== null && typeof v != 'undefined') {
21256a.push({
21257name: this.name,
21258value: v
21259});
21260}
21261});
21262return $.param(a);
21263}
21264;
21265$.fn.fieldValue = function(successful) {
21266for (var val = [], i = 0, max = this.length; i < max; i++) {
21267var el = this[i];
21268var v = $.fieldValue(el, successful);
21269if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
21270continue;
21271}
21272if (v.constructor == Array) {
21273$.merge(val, v);
21274} else {
21275val.push(v);
21276}
21277}
21278return val;
21279}
21280;
21281$.fieldValue = function(el, successful) {
21282var n = el.name
21283  , t = el.type
21284  , tag = el.tagName.toLowerCase();
21285if (successful === undefined) {
21286successful = true;
21287}
21288if (successful && (!n || el.disabled || t == 'reset' || t == 'button' || (t == 'checkbox' || t == 'radio') && !el.checked || (t == 'submit' || t == 'image') && el.form && el.form.clk != el || tag == 'select' && el.selectedIndex == -1)) {
21289return null;
21290}
21291if (tag == 'select') {
21292var index = el.selectedIndex;
21293if (index < 0) {
21294return null;
21295}
21296var a = []
21297  , ops = el.options;
21298var one = (t == 'select-one');
21299var max = (one ? index + 1 : ops.length);
21300for (var i = (one ? index : 0); i < max; i++) {
21301var op = ops[i];
21302if (op.selected) {
21303var v = op.value;
21304if (!v) {
21305v = (op.attributes && op.attributes.value && !(op.attributes.value.specified)) ? op.text : op.value;
21306}
21307if (one) {
21308return v;
21309}
21310a.push(v);
21311}
21312}
21313return a;
21314}
21315return $(el).val();
21316}
21317;
21318$.fn.clearForm = function(includeHidden) {
21319return this.each(function() {
21320$('input,select,textarea', this).clearFields(includeHidden);
21321});
21322}
21323;
21324$.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
21325var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;
21326return this.each(function() {
21327var t = this.type
21328  , tag = this.tagName.toLowerCase();
21329if (re.test(t) || tag == 'textarea') {
21330this.value = '';
21331} else if (t == 'checkbox' || t == 'radio') {
21332this.checked = false;
21333} else if (tag == 'select') {
21334this.selectedIndex = -1;
21335} else if (t == "file") {
21336if (/MSIE/.test(navigator.userAgent)) {
21337$(this).replaceWith($(this).clone(true));
21338} else {
21339$(this).val('');
21340}
21341} else if (includeHidden) {
21342if ((includeHidden === true && /hidden/.test(t)) || (typeof includeHidden == 'string' && $(this).is(includeHidden))) {
21343this.value = '';
21344}
21345}
21346});
21347}
21348;
21349$.fn.resetForm = function() {
21350return this.each(function() {
21351if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
21352this.reset();
21353}
21354});
21355}
21356;
21357$.fn.enable = function(b) {
21358if (b === undefined) {
21359b = true;
21360}
21361return this.each(function() {
21362this.disabled = !b;
21363});
21364}
21365;
21366$.fn.selected = function(select) {
21367if (select === undefined) {
21368select = true;
21369}
21370return this.each(function() {
21371var t = this.type;
21372if (t == 'checkbox' || t == 'radio') {
21373this.checked = select;
21374} else if (this.tagName.toLowerCase() == 'option') {
21375var $sel = $(this).parent('select');
21376if (select && $sel[0] && $sel[0].type == 'select-one') {
21377$sel.find('option').selected(false);
21378}
21379this.selected = select;
21380}
21381});
21382}
21383;
21384$.fn.ajaxSubmit.debug = false;
21385function log() {
21386if (!$.fn.ajaxSubmit.debug) {
21387return;
21388}
21389var msg = '[jquery.form] ' + Array.prototype.join.call(arguments, '');
21390if (window.console && window.console.log) {
21391window.console.log(msg);
21392} else if (window.opera && window.opera.postError) {
21393window.opera.postError(msg);
21394}
21395}
21396}));
21397;
21398/* /web/static/lib/jquery.ba-bbq/jquery.ba-bbq.js defined in bundle 'web.assets_common' */
21399(function($, window) {
21400'$:nomunge';
21401var undefined, aps = Array.prototype.slice, decode = decodeURIComponent, jq_param = $.param, jq_param_sorted, jq_param_fragment, jq_deparam, jq_deparam_fragment, jq_bbq = $.bbq = $.bbq || {}, jq_bbq_pushState, jq_bbq_getState, jq_elemUrlAttr, special = $.event.special, str_hashchange = 'hashchange', str_querystring = 'querystring', str_fragment = 'fragment', str_elemUrlAttr = 'elemUrlAttr', str_href = 'href', str_src = 'src', re_params_querystring = /^.*\?|#.*$/g, re_params_fragment, re_fragment, re_no_escape, ajax_crawlable, fragment_prefix, elemUrlAttr_cache = {};
21402function is_string(arg) {
21403return typeof arg === 'string';
21404}
21405;function curry(func) {
21406var args = aps.call(arguments, 1);
21407return function() {
21408return func.apply(this, args.concat(aps.call(arguments)));
21409}
21410;
21411}
21412;function get_fragment(url) {
21413return url.replace(re_fragment, '$2');
21414}
21415;function get_querystring(url) {
21416return url.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/, '$1');
21417}
21418;function jq_param_sub(is_fragment, get_func, url, params, merge_mode) {
21419var result, qs, matches, url_params, hash;
21420if (params !== undefined) {
21421matches = url.match(is_fragment ? re_fragment : /^([^#?]*)\??([^#]*)(#?.*)/);
21422hash = matches[3] || '';
21423if (merge_mode === 2 && is_string(params)) {
21424qs = params.replace(is_fragment ? re_params_fragment : re_params_querystring, '');
21425} else {
21426url_params = jq_deparam(matches[2]);
21427params = is_string(params) ? jq_deparam[is_fragment ? str_fragment : str_querystring](params) : params;
21428qs = merge_mode === 2 ? params : merge_mode === 1 ? $.extend({}, params, url_params) : $.extend({}, url_params, params);
21429qs = jq_param_sorted(qs);
21430if (is_fragment) {
21431qs = qs.replace(re_no_escape, decode);
21432}
21433}
21434result = matches[1] + (is_fragment ? fragment_prefix : qs || !matches[1] ? '?' : '') + qs + hash;
21435} else {
21436result = get_func(url !== undefined ? url : location.href);
21437}
21438return result;
21439}
21440;jq_param[str_querystring] = curry(jq_param_sub, 0, get_querystring);
21441jq_param[str_fragment] = jq_param_fragment = curry(jq_param_sub, 1, get_fragment);
21442jq_param.sorted = jq_param_sorted = function(a, traditional) {
21443var arr = []
21444  , obj = {};
21445$.each(jq_param(a, traditional).split('&'), function(i, v) {
21446var key = v.replace(/(?:%5B|=).*$/, '')
21447  , key_obj = obj[key];
21448if (!key_obj) {
21449key_obj = obj[key] = [];
21450arr.push(key);
21451}
21452key_obj.push(v);
21453});
21454return $.map(arr.sort(), function(v) {
21455return obj[v];
21456}).join('&');
21457}
21458;
21459jq_param_fragment.noEscape = function(chars) {
21460chars = chars || '';
21461var arr = $.map(chars.split(''), encodeURIComponent);
21462re_no_escape = new RegExp(arr.join('|'),'g');
21463}
21464;
21465jq_param_fragment.noEscape(',/');
21466jq_param_fragment.ajaxCrawlable = function(state) {
21467if (state !== undefined) {
21468if (state) {
21469re_params_fragment = /^.*(?:#!|#)/;
21470re_fragment = /^([^#]*)(?:#!|#)?(.*)$/;
21471fragment_prefix = '#!';
21472} else {
21473re_params_fragment = /^.*#/;
21474re_fragment = /^([^#]*)#?(.*)$/;
21475fragment_prefix = '#';
21476}
21477ajax_crawlable = !!state;
21478}
21479return ajax_crawlable;
21480}
21481;
21482jq_param_fragment.ajaxCrawlable(0);
21483$.deparam = jq_deparam = function(params, coerce) {
21484var obj = {}
21485  , coerce_types = {
21486'true': !0,
21487'false': !1,
21488'null': null
21489};
21490$.each(params.replace(/\+/g, ' ').split('&'), function(j, v) {
21491var param = v.split('='), key = decode(param[0]), val, cur = obj, i = 0, keys = key.split(']['), keys_last = keys.length - 1;
21492if (/\[/.test(keys[0]) && /\]$/.test(keys[keys_last])) {
21493keys[keys_last] = keys[keys_last].replace(/\]$/, '');
21494keys = keys.shift().split('[').concat(keys);
21495keys_last = keys.length - 1;
21496} else {
21497keys_last = 0;
21498}
21499if (param.length === 2) {
21500val = decode(param[1]);
21501if (coerce) {
21502val = val && !isNaN(val) ? +val : val === 'undefined' ? undefined : coerce_types[val] !== undefined ? coerce_types[val] : val;
21503}
21504if (keys_last) {
21505for (; i <= keys_last; i++) {
21506key = keys[i] === '' ? cur.length : keys[i];
21507cur = cur[key] = i < keys_last ? cur[key] || (keys[i + 1] && isNaN(keys[i + 1]) ? {} : []) : val;
21508}
21509} else {
21510if ($.isArray(obj[key])) {
21511obj[key].push(val);
21512} else if (obj[key] !== undefined) {
21513obj[key] = [obj[key], val];
21514} else {
21515obj[key] = val;
21516}
21517}
21518} else if (key) {
21519obj[key] = coerce ? undefined : '';
21520}
21521});
21522return obj;
21523}
21524;
21525function jq_deparam_sub(is_fragment, url_or_params, coerce) {
21526if (url_or_params === undefined || typeof url_or_params === 'boolean') {
21527coerce = url_or_params;
21528url_or_params = jq_param[is_fragment ? str_fragment : str_querystring]();
21529} else {
21530url_or_params = is_string(url_or_params) ? url_or_params.replace(is_fragment ? re_params_fragment : re_params_querystring, '') : url_or_params;
21531}
21532return jq_deparam(url_or_params, coerce);
21533}
21534;jq_deparam[str_querystring] = curry(jq_deparam_sub, 0);
21535jq_deparam[str_fragment] = jq_deparam_fragment = curry(jq_deparam_sub, 1);
21536$[str_elemUrlAttr] || ($[str_elemUrlAttr] = function(obj) {
21537return $.extend(elemUrlAttr_cache, obj);
21538}
21539)({
21540a: str_href,
21541base: str_href,
21542iframe: str_src,
21543img: str_src,
21544input: str_src,
21545form: 'action',
21546link: str_href,
21547script: str_src
21548});
21549jq_elemUrlAttr = $[str_elemUrlAttr];
21550function jq_fn_sub(mode, force_attr, params, merge_mode) {
21551if (!is_string(params) && typeof params !== 'object') {
21552merge_mode = params;
21553params = force_attr;
21554force_attr = undefined;
21555}
21556return this.each(function() {
21557var that = $(this)
21558  , attr = force_attr || jq_elemUrlAttr()[(this.nodeName || '').toLowerCase()] || ''
21559  , url = attr && that.attr(attr) || '';
21560that.attr(attr, jq_param[mode](url, params, merge_mode));
21561});
21562}
21563;$.fn[str_querystring] = curry(jq_fn_sub, str_querystring);
21564$.fn[str_fragment] = curry(jq_fn_sub, str_fragment);
21565jq_bbq.pushState = jq_bbq_pushState = function(params, merge_mode) {
21566if (is_string(params) && /^#/.test(params) && merge_mode === undefined) {
21567merge_mode = 2;
21568}
21569var has_args = params !== undefined
21570  , url = jq_param_fragment(location.href, has_args ? params : {}, has_args ? merge_mode : 2);
21571location.href = url;
21572}
21573;
21574jq_bbq.getState = jq_bbq_getState = function(key, coerce) {
21575return key === undefined || typeof key === 'boolean' ? jq_deparam_fragment(key) : jq_deparam_fragment(coerce)[key];
21576}
21577;
21578jq_bbq.removeState = function(arr) {
21579var state = {};
21580if (arr !== undefined) {
21581state = jq_bbq_getState();
21582$.each($.isArray(arr) ? arr : arguments, function(i, v) {
21583delete state[v];
21584});
21585}
21586jq_bbq_pushState(state, 2);
21587}
21588;
21589special[str_hashchange] = $.extend(special[str_hashchange], {
21590add: function(handleObj) {
21591var old_handler;
21592function new_handler(e) {
21593var hash = e[str_fragment] = jq_param_fragment();
21594e.getState = function(key, coerce) {
21595return key === undefined || typeof key === 'boolean' ? jq_deparam(hash, key) : jq_deparam(hash, coerce)[key];
21596}
21597;
21598old_handler.apply(this, arguments);
21599}
21600;if ($.isFunction(handleObj)) {
21601old_handler = handleObj;
21602return new_handler;
21603} else {
21604old_handler = handleObj.handler;
21605handleObj.handler = new_handler;
21606}
21607}
21608});
21609}
21610)(jQuery, this);
21611(function($, window, undefined) {
21612'$:nomunge';
21613var str_hashchange = 'hashchange', doc = document, fake_onhashchange, special = $.event.special, doc_mode = doc.documentMode, supports_onhashchange = 'on' + str_hashchange in window && (doc_mode === undefined || doc_mode > 7);
21614function get_fragment(url) {
21615url = url || location.href;
21616return '#' + url.replace(/^[^#]*#?(.*)$/, '$1');
21617}
21618;$.fn[str_hashchange] = function(fn) {
21619return fn ? this.bind(str_hashchange, fn) : this.trigger(str_hashchange);
21620}
21621;
21622$.fn[str_hashchange].delay = 50;
21623special[str_hashchange] = $.extend(special[str_hashchange], {
21624setup: function() {
21625if (supports_onhashchange) {
21626return false;
21627}
21628$(fake_onhashchange.start);
21629},
21630teardown: function() {
21631if (supports_onhashchange) {
21632return false;
21633}
21634$(fake_onhashchange.stop);
21635}
21636});
21637fake_onhashchange = (function() {
21638var self = {}, timeout_id, last_hash = get_fragment(), fn_retval = function(val) {
21639return val;
21640}, history_set = fn_retval, history_get = fn_retval;
21641self.start = function() {
21642timeout_id || poll();
21643}
21644;
21645self.stop = function() {
21646timeout_id && clearTimeout(timeout_id);
21647timeout_id = undefined;
21648}
21649;
21650function poll() {
21651var hash = get_fragment()
21652  , history_hash = history_get(last_hash);
21653if (hash !== last_hash) {
21654history_set(last_hash = hash, history_hash);
21655$(window).trigger(str_hashchange);
21656} else if (history_hash !== last_hash) {
21657location.href = location.href.replace(/#.*/, '') + history_hash;
21658}
21659timeout_id = setTimeout(poll, $.fn[str_hashchange].delay);
21660}
21661;$.browser.msie && !supports_onhashchange && (function() {
21662var iframe, iframe_src;
21663self.start = function() {
21664if (!iframe) {
21665iframe_src = $.fn[str_hashchange].src;
21666iframe_src = iframe_src && iframe_src + get_fragment();
21667iframe = $('<iframe tabindex="-1" title="empty"/>').hide().one('load', function() {
21668iframe_src || history_set(get_fragment());
21669poll();
21670}).attr('src', iframe_src || 'javascript:0').insertAfter('body')[0].contentWindow;
21671doc.onpropertychange = function() {
21672try {
21673if (event.propertyName === 'title') {
21674iframe.document.title = doc.title;
21675}
21676} catch (e) {}
21677}
21678;
21679}
21680}
21681;
21682self.stop = fn_retval;
21683history_get = function() {
21684return get_fragment(iframe.location.href);
21685}
21686;
21687history_set = function(hash, history_hash) {
21688var iframe_doc = iframe.document
21689  , domain = $.fn[str_hashchange].domain;
21690if (hash !== history_hash) {
21691iframe_doc.title = doc.title;
21692iframe_doc.open();
21693domain && iframe_doc.write('<script>document.domain="' + domain + '"</script>');
21694iframe_doc.close();
21695iframe.location.hash = hash;
21696}
21697}
21698;
21699}
21700)();
21701return self;
21702}
21703)();
21704}
21705)(jQuery, this);
21706;
21707/* /web/static/lib/jquery.mjs.nestedSortable/jquery.mjs.nestedSortable.js defined in bundle 'web.assets_common' */
21708(function(factory) {
21709"use strict";
21710if (typeof define === "function" && define.amd) {
21711define(["jquery", "jquery-ui/sortable"], factory);
21712} else {
21713factory(window.jQuery);
21714}
21715}(function($) {
21716"use strict";
21717function isOverAxis(x, reference, size) {
21718return (x > reference) && (x < (reference + size));
21719}
21720$.widget("mjs.nestedSortable", $.extend({}, $.ui.sortable.prototype, {
21721options: {
21722disableParentChange: false,
21723doNotClear: false,
21724expandOnHover: 700,
21725isAllowed: function() {
21726return true;
21727},
21728isTree: false,
21729listType: "ol",
21730maxLevels: 0,
21731protectRoot: false,
21732rootID: null,
21733rtl: false,
21734startCollapsed: false,
21735tabSize: 20,
21736branchClass: "mjs-nestedSortable-branch",
21737collapsedClass: "mjs-nestedSortable-collapsed",
21738disableNestingClass: "mjs-nestedSortable-no-nesting",
21739errorClass: "mjs-nestedSortable-error",
21740expandedClass: "mjs-nestedSortable-expanded",
21741hoveringClass: "mjs-nestedSortable-hovering",
21742leafClass: "mjs-nestedSortable-leaf",
21743disabledClass: "mjs-nestedSortable-disabled"
21744},
21745_create: function() {
21746var self = this, err;
21747this.element.data("ui-sortable", this.element.data("mjs-nestedSortable"));
21748if (!this.element.is(this.options.listType)) {
21749err = "nestedSortable: " + "Please check that the listType option is set to your actual list type";
21750throw new Error(err);
21751}
21752if (this.options.isTree && this.options.expandOnHover) {
21753this.options.tolerance = "intersect";
21754}
21755$.ui.sortable.prototype._create.apply(this, arguments);
21756if (this.options.isTree) {
21757$(this.items).each(function() {
21758var $li = this.item
21759  , hasCollapsedClass = $li.hasClass(self.options.collapsedClass)
21760  , hasExpandedClass = $li.hasClass(self.options.expandedClass);
21761if ($li.children(self.options.listType).length) {
21762$li.addClass(self.options.branchClass);
21763if (!hasCollapsedClass && !hasExpandedClass) {
21764if (self.options.startCollapsed) {
21765$li.addClass(self.options.collapsedClass);
21766} else {
21767$li.addClass(self.options.expandedClass);
21768}
21769}
21770} else {
21771$li.addClass(self.options.leafClass);
21772}
21773});
21774}
21775},
21776_destroy: function() {
21777this.element.removeData("mjs-nestedSortable").removeData("ui-sortable");
21778return $.ui.sortable.prototype._destroy.apply(this, arguments);
21779},
21780_mouseDrag: function(event) {
21781var i, item, itemElement, intersection, self = this, o = this.options, scrolled = false, $document = $(document), previousTopOffset, parentItem, level, childLevels, itemAfter, itemBefore, newList, method, a, previousItem, nextItem, helperIsNotSibling;
21782this.position = this._generatePosition(event);
21783this.positionAbs = this._convertPositionTo("absolute");
21784if (!this.lastPositionAbs) {
21785this.lastPositionAbs = this.positionAbs;
21786}
21787if (this.options.scroll) {
21788if (this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") {
21789if ((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
21790scrolled = this.scrollParent.scrollTop() + o.scrollSpeed;
21791this.scrollParent.scrollTop(scrolled);
21792} else if (event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
21793scrolled = this.scrollParent.scrollTop() - o.scrollSpeed;
21794this.scrollParent.scrollTop(scrolled);
21795}
21796if ((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
21797scrolled = this.scrollParent.scrollLeft() + o.scrollSpeed;
21798this.scrollParent.scrollLeft(scrolled);
21799} else if (event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
21800scrolled = this.scrollParent.scrollLeft() - o.scrollSpeed;
21801this.scrollParent.scrollLeft(scrolled);
21802}
21803} else {
21804if (event.pageY - $document.scrollTop() < o.scrollSensitivity) {
21805scrolled = $document.scrollTop() - o.scrollSpeed;
21806$document.scrollTop(scrolled);
21807} else if ($(window).height() - (event.pageY - $document.scrollTop()) < o.scrollSensitivity) {
21808scrolled = $document.scrollTop() + o.scrollSpeed;
21809$document.scrollTop(scrolled);
21810}
21811if (event.pageX - $document.scrollLeft() < o.scrollSensitivity) {
21812scrolled = $document.scrollLeft() - o.scrollSpeed;
21813$document.scrollLeft(scrolled);
21814} else if ($(window).width() - (event.pageX - $document.scrollLeft()) < o.scrollSensitivity) {
21815scrolled = $document.scrollLeft() + o.scrollSpeed;
21816$document.scrollLeft(scrolled);
21817}
21818}
21819if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
21820$.ui.ddmanager.prepareOffsets(this, event);
21821}
21822}
21823this.positionAbs = this._convertPositionTo("absolute");
21824previousTopOffset = this.placeholder.offset().top;
21825if (!this.options.axis || this.options.axis !== "y") {
21826this.helper[0].style.left = this.position.left + "px";
21827}
21828if (!this.options.axis || this.options.axis !== "x") {
21829this.helper[0].style.top = (this.position.top) + "px";
21830}
21831this.hovering = this.hovering ? this.hovering : null;
21832this.mouseentered = this.mouseentered ? this.mouseentered : false;
21833(function() {
21834var _parentItem = this.placeholder.parent().parent();
21835if (_parentItem && _parentItem.closest(".ui-sortable").length) {
21836parentItem = _parentItem;
21837}
21838}
21839.call(this));
21840level = this._getLevel(this.placeholder);
21841childLevels = this._getChildLevels(this.helper);
21842newList = document.createElement(o.listType);
21843for (i = this.items.length - 1; i >= 0; i--) {
21844item = this.items[i];
21845itemElement = item.item[0];
21846intersection = this._intersectsWithPointer(item);
21847if (!intersection) {
21848continue;
21849}
21850if (item.instance !== this.currentContainer) {
21851continue;
21852}
21853if (itemElement.className.indexOf(o.disabledClass) !== -1) {
21854if (intersection === 2) {
21855itemAfter = this.items[i + 1];
21856if (itemAfter && itemAfter.item.hasClass(o.disabledClass)) {
21857continue;
21858}
21859} else if (intersection === 1) {
21860itemBefore = this.items[i - 1];
21861if (itemBefore && itemBefore.item.hasClass(o.disabledClass)) {
21862continue;
21863}
21864}
21865}
21866method = intersection === 1 ? "next" : "prev";
21867if (itemElement !== this.currentItem[0] && this.placeholder[method]()[0] !== itemElement && !$.contains(this.placeholder[0], itemElement) && (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)) {
21868if (!this.mouseentered) {
21869$(itemElement).mouseenter();
21870this.mouseentered = true;
21871}
21872if (o.isTree && $(itemElement).hasClass(o.collapsedClass) && o.expandOnHover) {
21873if (!this.hovering) {
21874$(itemElement).addClass(o.hoveringClass);
21875this.hovering = window.setTimeout(function() {
21876$(itemElement).removeClass(o.collapsedClass).addClass(o.expandedClass);
21877self.refreshPositions();
21878self._trigger("expand", event, self._uiHash());
21879}, o.expandOnHover);
21880}
21881}
21882this.direction = intersection === 1 ? "down" : "up";
21883if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
21884$(itemElement).mouseleave();
21885this.mouseentered = false;
21886$(itemElement).removeClass(o.hoveringClass);
21887if (this.hovering) {
21888window.clearTimeout(this.hovering);
21889}
21890this.hovering = null;
21891if (o.protectRoot && !(this.currentItem[0].parentNode === this.element[0] && itemElement.parentNode !== this.element[0])) {
21892if (this.currentItem[0].parentNode !== this.element[0] && itemElement.parentNode === this.element[0]) {
21893if (!$(itemElement).children(o.listType).length) {
21894itemElement.appendChild(newList);
21895if (o.isTree) {
21896$(itemElement).removeClass(o.leafClass).addClass(o.branchClass + " " + o.expandedClass);
21897}
21898}
21899if (this.direction === "down") {
21900a = $(itemElement).prev().children(o.listType);
21901} else {
21902a = $(itemElement).children(o.listType);
21903}
21904if (a[0] !== undefined) {
21905this._rearrange(event, null, a);
21906}
21907} else {
21908this._rearrange(event, item);
21909}
21910} else if (!o.protectRoot) {
21911this._rearrange(event, item);
21912}
21913} else {
21914break;
21915}
21916this._clearEmpty(itemElement);
21917this._trigger("change", event, this._uiHash());
21918break;
21919}
21920}
21921(function() {
21922var _previousItem = this.placeholder.prev();
21923if (_previousItem.length) {
21924previousItem = _previousItem;
21925} else {
21926previousItem = null;
21927}
21928}
21929.call(this));
21930if (previousItem != null) {
21931while (previousItem[0].nodeName.toLowerCase() !== "li" || previousItem[0].className.indexOf(o.disabledClass) !== -1 || previousItem[0] === this.currentItem[0] || previousItem[0] === this.helper[0]) {
21932if (previousItem[0].previousSibling) {
21933previousItem = $(previousItem[0].previousSibling);
21934} else {
21935previousItem = null;
21936break;
21937}
21938}
21939}
21940(function() {
21941var _nextItem = this.placeholder.next();
21942if (_nextItem.length) {
21943nextItem = _nextItem;
21944} else {
21945nextItem = null;
21946}
21947}
21948.call(this));
21949if (nextItem != null) {
21950while (nextItem[0].nodeName.toLowerCase() !== "li" || nextItem[0].className.indexOf(o.disabledClass) !== -1 || nextItem[0] === this.currentItem[0] || nextItem[0] === this.helper[0]) {
21951if (nextItem[0].nextSibling) {
21952nextItem = $(nextItem[0].nextSibling);
21953} else {
21954nextItem = null;
21955break;
21956}
21957}
21958}
21959this.beyondMaxLevels = 0;
21960if (parentItem != null && nextItem == null && !(o.protectRoot && parentItem[0].parentNode == this.element[0]) && (o.rtl && (this.positionAbs.left + this.helper.outerWidth() > parentItem.offset().left + parentItem.outerWidth()) || !o.rtl && (this.positionAbs.left < parentItem.offset().left))) {
21961parentItem.after(this.placeholder[0]);
21962helperIsNotSibling = !parentItem.children(o.listItem).children("li:visible:not(.ui-sortable-helper)").length;
21963if (o.isTree && helperIsNotSibling) {
21964parentItem.removeClass(this.options.branchClass + " " + this.options.expandedClass).addClass(this.options.leafClass);
21965}
21966if (typeof parentItem !== 'undefined')
21967this._clearEmpty(parentItem[0]);
21968this._trigger("change", event, this._uiHash());
21969} else if (previousItem != null && !previousItem.hasClass(o.disableNestingClass) && (previousItem.children(o.listType).length && previousItem.children(o.listType).is(":visible") || !previousItem.children(o.listType).length) && !(o.protectRoot && this.currentItem[0].parentNode === this.element[0]) && (o.rtl && (this.positionAbs.left + this.helper.outerWidth() < previousItem.offset().left + previousItem.outerWidth() - o.tabSize) || !o.rtl && (this.positionAbs.left > previousItem.offset().left + o.tabSize))) {
21970this._isAllowed(previousItem, level, level + childLevels + 1);
21971if (!previousItem.children(o.listType).length) {
21972previousItem[0].appendChild(newList);
21973if (o.isTree) {
21974previousItem.removeClass(o.leafClass).addClass(o.branchClass + " " + o.expandedClass);
21975}
21976}
21977if (previousTopOffset && (previousTopOffset <= previousItem.offset().top)) {
21978previousItem.children(o.listType).prepend(this.placeholder);
21979} else {
21980previousItem.children(o.listType)[0].appendChild(this.placeholder[0]);
21981}
21982if (typeof parentItem !== 'undefined')
21983this._clearEmpty(parentItem[0]);
21984this._trigger("change", event, this._uiHash());
21985} else {
21986this._isAllowed(parentItem, level, level + childLevels);
21987}
21988this._contactContainers(event);
21989if ($.ui.ddmanager) {
21990$.ui.ddmanager.drag(this, event);
21991}
21992this._trigger("sort", event, this._uiHash());
21993this.lastPositionAbs = this.positionAbs;
21994return false;
21995},
21996_mouseStop: function(event) {
21997if (this.beyondMaxLevels) {
21998this.placeholder.removeClass(this.options.errorClass);
21999if (this.domPosition.prev) {
22000$(this.domPosition.prev).after(this.placeholder);
22001} else {
22002$(this.domPosition.parent).prepend(this.placeholder);
22003}
22004this._trigger("revert", event, this._uiHash());
22005}
22006$("." + this.options.hoveringClass).mouseleave().removeClass(this.options.hoveringClass);
22007this.mouseentered = false;
22008if (this.hovering) {
22009window.clearTimeout(this.hovering);
22010}
22011this.hovering = null;
22012this._relocate_event = event;
22013this._pid_current = $(this.domPosition.parent).parent().attr("id");
22014this._sort_current = this.domPosition.prev ? $(this.domPosition.prev).next().index() : 0;
22015$.ui.sortable.prototype._mouseStop.apply(this, arguments);
22016},
22017_intersectsWithSides: function(item) {
22018var half = this.options.isTree ? .8 : .5
22019  , isOverBottomHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height * half), item.height)
22020  , isOverTopHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top - (item.height * half), item.height)
22021  , isOverRightHalf = isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width / 2), item.width)
22022  , verticalDirection = this._getDragVerticalDirection()
22023  , horizontalDirection = this._getDragHorizontalDirection();
22024if (this.floating && horizontalDirection) {
22025return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));
22026} else {
22027return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && isOverTopHalf));
22028}
22029},
22030_contactContainers: function() {
22031if (this.options.protectRoot && this.currentItem[0].parentNode === this.element[0]) {
22032return;
22033}
22034$.ui.sortable.prototype._contactContainers.apply(this, arguments);
22035},
22036_clear: function() {
22037var i, item;
22038$.ui.sortable.prototype._clear.apply(this, arguments);
22039if (!(this._pid_current === this._uiHash().item.parent().parent().attr("id") && this._sort_current === this._uiHash().item.index())) {
22040this._trigger("relocate", this._relocate_event, this._uiHash());
22041}
22042for (i = this.items.length - 1; i >= 0; i--) {
22043item = this.items[i].item[0];
22044this._clearEmpty(item);
22045}
22046},
22047serialize: function(options) {
22048var o = $.extend({}, this.options, options)
22049  , items = this._getItemsAsjQuery(o && o.connected)
22050  , str = [];
22051$(items).each(function() {
22052var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[-=_](.+)/))
22053  , pid = ($(o.item || this).parent(o.listType).parent(o.items).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[-=_](.+)/));
22054if (res) {
22055str.push(((o.key || res[1]) + "[" + (o.key && o.expression ? res[1] : res[2]) + "]") + "=" + (pid ? (o.key && o.expression ? pid[1] : pid[2]) : o.rootID));
22056}
22057});
22058if (!str.length && o.key) {
22059str.push(o.key + "=");
22060}
22061return str.join("&");
22062},
22063toHierarchy: function(options) {
22064var o = $.extend({}, this.options, options)
22065  , ret = [];
22066$(this.element).children(o.items).each(function() {
22067var level = _recursiveItems(this);
22068ret.push(level);
22069});
22070return ret;
22071function _recursiveItems(item) {
22072var id = ($(item).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[-=_](.+)/)), currentItem;
22073var data = $(item).data();
22074if (data.nestedSortableItem) {
22075delete data.nestedSortableItem;
22076}
22077if (id) {
22078currentItem = {
22079"id": id[2]
22080};
22081currentItem = $.extend({}, currentItem, data);
22082if ($(item).children(o.listType).children(o.items).length > 0) {
22083currentItem.children = [];
22084$(item).children(o.listType).children(o.items).each(function() {
22085var level = _recursiveItems(this);
22086currentItem.children.push(level);
22087});
22088}
22089return currentItem;
22090}
22091}
22092},
22093toArray: function(options) {
22094var o = $.extend({}, this.options, options)
22095  , sDepth = o.startDepthCount || 0
22096  , ret = []
22097  , left = 1;
22098if (!o.excludeRoot) {
22099ret.push({
22100"item_id": o.rootID,
22101"parent_id": null,
22102"depth": sDepth,
22103"left": left,
22104"right": ($(o.items, this.element).length + 1) * 2
22105});
22106left++;
22107}
22108$(this.element).children(o.items).each(function() {
22109left = _recursiveArray(this, sDepth, left);
22110});
22111ret = ret.sort(function(a, b) {
22112return (a.left - b.left);
22113});
22114return ret;
22115function _recursiveArray(item, depth, _left) {
22116var right = _left + 1, id, pid, parentItem;
22117if ($(item).children(o.listType).children(o.items).length > 0) {
22118depth++;
22119$(item).children(o.listType).children(o.items).each(function() {
22120right = _recursiveArray($(this), depth, right);
22121});
22122depth--;
22123}
22124id = ($(item).attr(o.attribute || "id")).match(o.expression || (/(.+)[-=_](.+)/));
22125if (depth === sDepth) {
22126pid = o.rootID;
22127} else {
22128parentItem = ($(item).parent(o.listType).parent(o.items).attr(o.attribute || "id")).match(o.expression || (/(.+)[-=_](.+)/));
22129pid = parentItem[2];
22130}
22131if (id) {
22132var data = $(item).children('div').data();
22133var itemObj = $.extend(data, {
22134"id": id[2],
22135"parent_id": pid,
22136"depth": depth,
22137"left": _left,
22138"right": right
22139});
22140ret.push(itemObj);
22141}
22142_left = right + 1;
22143return _left;
22144}
22145},
22146_clearEmpty: function(item) {
22147function replaceClass(elem, search, replace, swap) {
22148if (swap) {
22149search = [replace, replace = search][0];
22150}
22151$(elem).removeClass(search).addClass(replace);
22152}
22153var o = this.options
22154  , childrenList = $(item).children(o.listType)
22155  , hasChildren = childrenList.has('li').length;
22156var doNotClear = o.doNotClear || hasChildren || o.protectRoot && $(item)[0] === this.element[0];
22157if (o.isTree) {
22158replaceClass(item, o.branchClass, o.leafClass, doNotClear);
22159}
22160if (!doNotClear) {
22161childrenList.parent().removeClass(o.expandedClass);
22162childrenList.remove();
22163}
22164},
22165_getLevel: function(item) {
22166var level = 1, list;
22167if (this.options.listType) {
22168list = item.closest(this.options.listType);
22169while (list && list.length > 0 && !list.is(".ui-sortable")) {
22170level++;
22171list = list.parent().closest(this.options.listType);
22172}
22173}
22174return level;
22175},
22176_getChildLevels: function(parent, depth) {
22177var self = this
22178  , o = this.options
22179  , result = 0;
22180depth = depth || 0;
22181$(parent).children(o.listType).children(o.items).each(function(index, child) {
22182result = Math.max(self._getChildLevels(child, depth + 1), result);
22183});
22184return depth ? result + 1 : result;
22185},
22186_isAllowed: function(parentItem, level, levels) {
22187var o = this.options
22188  , maxLevels = this.placeholder.closest(".ui-sortable").nestedSortable("option", "maxLevels")
22189  , oldParent = this.currentItem.parent().parent()
22190  , disabledByParentchange = o.disableParentChange && (typeof parentItem !== 'undefined' && !oldParent.is(parentItem) || typeof parentItem === 'undefined' && oldParent.is("li"));
22191if (disabledByParentchange || !o.isAllowed(this.placeholder, parentItem, this.currentItem)) {
22192this.placeholder.addClass(o.errorClass);
22193if (maxLevels < levels && maxLevels !== 0) {
22194this.beyondMaxLevels = levels - maxLevels;
22195} else {
22196this.beyondMaxLevels = 1;
22197}
22198} else {
22199if (maxLevels < levels && maxLevels !== 0) {
22200this.placeholder.addClass(o.errorClass);
22201this.beyondMaxLevels = levels - maxLevels;
22202} else {
22203this.placeholder.removeClass(o.errorClass);
22204this.beyondMaxLevels = 0;
22205}
22206}
22207}
22208}));
22209$.mjs.nestedSortable.prototype.options = $.extend({}, $.ui.sortable.prototype.options, $.mjs.nestedSortable.prototype.options);
22210}));
22211;
22212/* /web/static/lib/popper/popper.js defined in bundle 'web.assets_common' */
22213(function(global, factory) {
22214typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.Popper = factory());
22215}(this, (function() {
22216'use strict';
22217var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
22218var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
22219var timeoutDuration = 0;
22220for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
22221if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
22222timeoutDuration = 1;
22223break;
22224}
22225}
22226function microtaskDebounce(fn) {
22227var called = false;
vendor: 9,505 bytes, lines 22228-22526
22228return function() {
22229if (called) {
22230return;
22231}
22232called = true;
22233window.Promise.resolve().then(function() {
22234called = false;
22235fn();
22236});
22237}
22238;
22239}
22240function taskDebounce(fn) {
22241var scheduled = false;
22242return function() {
22243if (!scheduled) {
22244scheduled = true;
22245setTimeout(function() {
22246scheduled = false;
22247fn();
22248}, timeoutDuration);
22249}
22250}
22251;
22252}
22253var supportsMicroTasks = isBrowser && window.Promise;
22254var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
22255function isFunction(functionToCheck) {
22256var getType = {};
22257return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
22258}
22259function getStyleComputedProperty(element, property) {
22260if (element.nodeType !== 1) {
22261return [];
22262}
22263var css = getComputedStyle(element, null);
22264return property ? css[property] : css;
22265}
22266function getParentNode(element) {
22267if (element.nodeName === 'HTML') {
22268return element;
22269}
22270return element.parentNode || element.host;
22271}
22272function getScrollParent(element) {
22273if (!element) {
22274return document.body;
22275}
22276switch (element.nodeName) {
22277case 'HTML':
22278case 'BODY':
22279return element.ownerDocument.body;
22280case '#document':
22281return element.body;
22282}
22283var _getStyleComputedProp = getStyleComputedProperty(element)
22284  , overflow = _getStyleComputedProp.overflow
22285  , overflowX = _getStyleComputedProp.overflowX
22286  , overflowY = _getStyleComputedProp.overflowY;
22287if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
22288return element;
22289}
22290return getScrollParent(getParentNode(element));
22291}
22292var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
22293var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
22294function isIE(version) {
22295if (version === 11) {
22296return isIE11;
22297}
22298if (version === 10) {
22299return isIE10;
22300}
22301return isIE11 || isIE10;
22302}
22303function getOffsetParent(element) {
22304if (!element) {
22305return document.documentElement;
22306}
22307var noOffsetParent = isIE(10) ? document.body : null;
22308var offsetParent = element.offsetParent;
22309while (offsetParent === noOffsetParent && element.nextElementSibling) {
22310offsetParent = (element = element.nextElementSibling).offsetParent;
22311}
22312var nodeName = offsetParent && offsetParent.nodeName;
22313if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
22314return element ? element.ownerDocument.documentElement : document.documentElement;
22315}
22316if (['TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
22317return getOffsetParent(offsetParent);
22318}
22319return offsetParent;
22320}
22321function isOffsetContainer(element) {
22322var nodeName = element.nodeName;
22323if (nodeName === 'BODY') {
22324return false;
22325}
22326return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
22327}
22328function getRoot(node) {
22329if (node.parentNode !== null) {
22330return getRoot(node.parentNode);
22331}
22332return node;
22333}
22334function findCommonOffsetParent(element1, element2) {
22335if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
22336return document.documentElement;
22337}
22338var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
22339var start = order ? element1 : element2;
22340var end = order ? element2 : element1;
22341var range = document.createRange();
22342range.setStart(start, 0);
22343range.setEnd(end, 0);
22344var commonAncestorContainer = range.commonAncestorContainer;
22345if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
22346if (isOffsetContainer(commonAncestorContainer)) {
22347return commonAncestorContainer;
22348}
22349return getOffsetParent(commonAncestorContainer);
22350}
22351var element1root = getRoot(element1);
22352if (element1root.host) {
22353return findCommonOffsetParent(element1root.host, element2);
22354} else {
22355return findCommonOffsetParent(element1, getRoot(element2).host);
22356}
22357}
22358function getScroll(element) {
22359var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
22360var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
22361var nodeName = element.nodeName;
22362if (nodeName === 'BODY' || nodeName === 'HTML') {
22363var html = element.ownerDocument.documentElement;
22364var scrollingElement = element.ownerDocument.scrollingElement || html;
22365return scrollingElement[upperSide];
22366}
22367return element[upperSide];
22368}
22369function includeScroll(rect, element) {
22370var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
22371var scrollTop = getScroll(element, 'top');
22372var scrollLeft = getScroll(element, 'left');
22373var modifier = subtract ? -1 : 1;
22374rect.top += scrollTop * modifier;
22375rect.bottom += scrollTop * modifier;
22376rect.left += scrollLeft * modifier;
22377rect.right += scrollLeft * modifier;
22378return rect;
22379}
22380function getBordersSize(styles, axis) {
22381var sideA = axis === 'x' ? 'Left' : 'Top';
22382var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
22383return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
22384}
22385function getSize(axis, body, html, computedStyle) {
22386return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0);
22387}
22388function getWindowSizes() {
22389var body = document.body;
22390var html = document.documentElement;
22391var computedStyle = isIE(10) && getComputedStyle(html);
22392return {
22393height: getSize('Height', body, html, computedStyle),
22394width: getSize('Width', body, html, computedStyle)
22395};
22396}
22397var classCallCheck = function(instance, Constructor) {
22398if (!(instance instanceof Constructor)) {
22399throw new TypeError("Cannot call a class as a function");
22400}
22401};
22402var createClass = function() {
22403function defineProperties(target, props) {
22404for (var i = 0; i < props.length; i++) {
22405var descriptor = props[i];
22406descriptor.enumerable = descriptor.enumerable || false;
22407descriptor.configurable = true;
22408if ("value"in descriptor)
22409descriptor.writable = true;
22410Object.defineProperty(target, descriptor.key, descriptor);
22411}
22412}
22413return function(Constructor, protoProps, staticProps) {
22414if (protoProps)
22415defineProperties(Constructor.prototype, protoProps);
22416if (staticProps)
22417defineProperties(Constructor, staticProps);
22418return Constructor;
22419}
22420;
22421}();
22422var defineProperty = function(obj, key, value) {
22423if (key in obj) {
22424Object.defineProperty(obj, key, {
22425value: value,
22426enumerable: true,
22427configurable: true,
22428writable: true
22429});
22430} else {
22431obj[key] = value;
22432}
22433return obj;
22434};
22435var _extends = Object.assign || function(target) {
22436for (var i = 1; i < arguments.length; i++) {
22437var source = arguments[i];
22438for (var key in source) {
22439if (Object.prototype.hasOwnProperty.call(source, key)) {
22440target[key] = source[key];
22441}
22442}
22443}
22444return target;
22445}
22446;
22447function getClientRect(offsets) {
22448return _extends({}, offsets, {
22449right: offsets.left + offsets.width,
22450bottom: offsets.top + offsets.height
22451});
22452}
22453function getBoundingClientRect(element) {
22454var rect = {};
22455try {
22456if (isIE(10)) {
22457rect = element.getBoundingClientRect();
22458var scrollTop = getScroll(element, 'top');
22459var scrollLeft = getScroll(element, 'left');
22460rect.top += scrollTop;
22461rect.left += scrollLeft;
22462rect.bottom += scrollTop;
22463rect.right += scrollLeft;
22464} else {
22465rect = element.getBoundingClientRect();
22466}
22467} catch (e) {}
22468var result = {
22469left: rect.left,
22470top: rect.top,
22471width: rect.right - rect.left,
22472height: rect.bottom - rect.top
22473};
22474var sizes = element.nodeName === 'HTML' ? getWindowSizes() : {};
22475var width = sizes.width || element.clientWidth || result.right - result.left;
22476var height = sizes.height || element.clientHeight || result.bottom - result.top;
22477var horizScrollbar = element.offsetWidth - width;
22478var vertScrollbar = element.offsetHeight - height;
22479if (horizScrollbar || vertScrollbar) {
22480var styles = getStyleComputedProperty(element);
22481horizScrollbar -= getBordersSize(styles, 'x');
22482vertScrollbar -= getBordersSize(styles, 'y');
22483result.width -= horizScrollbar;
22484result.height -= vertScrollbar;
22485}
22486return getClientRect(result);
22487}
22488function getOffsetRectRelativeToArbitraryNode(children, parent) {
22489var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
22490var isIE10 = isIE(10);
22491var isHTML = parent.nodeName === 'HTML';
22492var childrenRect = getBoundingClientRect(children);
22493var parentRect = getBoundingClientRect(parent);
22494var scrollParent = getScrollParent(children);
22495var styles = getStyleComputedProperty(parent);
22496var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
22497var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
22498if (fixedPosition && parent.nodeName === 'HTML') {
22499parentRect.top = Math.max(parentRect.top, 0);
22500parentRect.left = Math.max(parentRect.left, 0);
22501}
22502var offsets = getClientRect({
22503top: childrenRect.top - parentRect.top - borderTopWidth,
22504left: childrenRect.left - parentRect.left - borderLeftWidth,
22505width: childrenRect.width,
22506height: childrenRect.height
22507});
22508offsets.marginTop = 0;
22509offsets.marginLeft = 0;
22510if (!isIE10 && isHTML) {
22511var marginTop = parseFloat(styles.marginTop, 10);
22512var marginLeft = parseFloat(styles.marginLeft, 10);
22513offsets.top -= borderTopWidth - marginTop;
22514offsets.bottom -= borderTopWidth - marginTop;
22515offsets.left -= borderLeftWidth - marginLeft;
22516offsets.right -= borderLeftWidth - marginLeft;
22517offsets.marginTop = marginTop;
22518offsets.marginLeft = marginLeft;
22519}
22520if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
22521offsets = includeScroll(offsets, parent);
22522}
22523return offsets;
22524}
22525function getViewportOffsetRectRelativeToArtbitraryNode(element) {
22526var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
vendor: 6,168 bytes, lines 22527-22712
22527var html = element.ownerDocument.documentElement;
22528var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
22529var width = Math.max(html.clientWidth, window.innerWidth || 0);
22530var height = Math.max(html.clientHeight, window.innerHeight || 0);
22531var scrollTop = !excludeScroll ? getScroll(html) : 0;
22532var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
22533var offset = {
22534top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
22535left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
22536width: width,
22537height: height
22538};
22539return getClientRect(offset);
22540}
22541function isFixed(element) {
22542var nodeName = element.nodeName;
22543if (nodeName === 'BODY' || nodeName === 'HTML') {
22544return false;
22545}
22546if (getStyleComputedProperty(element, 'position') === 'fixed') {
22547return true;
22548}
22549return isFixed(getParentNode(element));
22550}
22551function getFixedPositionOffsetParent(element) {
22552if (!element || !element.parentElement || isIE()) {
22553return document.documentElement;
22554}
22555var el = element.parentElement;
22556while (el && getStyleComputedProperty(el, 'transform') === 'none') {
22557el = el.parentElement;
22558}
22559return el || document.documentElement;
22560}
22561function getBoundaries(popper, reference, padding, boundariesElement) {
22562var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
22563var boundaries = {
22564top: 0,
22565left: 0
22566};
22567var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
22568if (boundariesElement === 'viewport') {
22569boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
22570} else {
22571var boundariesNode = void 0;
22572if (boundariesElement === 'scrollParent') {
22573boundariesNode = getScrollParent(getParentNode(reference));
22574if (boundariesNode.nodeName === 'BODY') {
22575boundariesNode = popper.ownerDocument.documentElement;
22576}
22577} else if (boundariesElement === 'window') {
22578boundariesNode = popper.ownerDocument.documentElement;
22579} else {
22580boundariesNode = boundariesElement;
22581}
22582var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
22583if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
22584var _getWindowSizes = getWindowSizes()
22585  , height = _getWindowSizes.height
22586  , width = _getWindowSizes.width;
22587boundaries.top += offsets.top - offsets.marginTop;
22588boundaries.bottom = height + offsets.top;
22589boundaries.left += offsets.left - offsets.marginLeft;
22590boundaries.right = width + offsets.left;
22591} else {
22592boundaries = offsets;
22593}
22594}
22595boundaries.left += padding;
22596boundaries.top += padding;
22597boundaries.right -= padding;
22598boundaries.bottom -= padding;
22599return boundaries;
22600}
22601function getArea(_ref) {
22602var width = _ref.width
22603  , height = _ref.height;
22604return width * height;
22605}
22606function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
22607var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
22608if (placement.indexOf('auto') === -1) {
22609return placement;
22610}
22611var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
22612var rects = {
22613top: {
22614width: boundaries.width,
22615height: refRect.top - boundaries.top
22616},
22617right: {
22618width: boundaries.right - refRect.right,
22619height: boundaries.height
22620},
22621bottom: {
22622width: boundaries.width,
22623height: boundaries.bottom - refRect.bottom
22624},
22625left: {
22626width: refRect.left - boundaries.left,
22627height: boundaries.height
22628}
22629};
22630var sortedAreas = Object.keys(rects).map(function(key) {
22631return _extends({
22632key: key
22633}, rects[key], {
22634area: getArea(rects[key])
22635});
22636}).sort(function(a, b) {
22637return b.area - a.area;
22638});
22639var filteredAreas = sortedAreas.filter(function(_ref2) {
22640var width = _ref2.width
22641  , height = _ref2.height;
22642return width >= popper.clientWidth && height >= popper.clientHeight;
22643});
22644var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
22645var variation = placement.split('-')[1];
22646return computedPlacement + (variation ? '-' + variation : '');
22647}
22648function getReferenceOffsets(state, popper, reference) {
22649var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
22650var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
22651return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
22652}
22653function getOuterSizes(element) {
22654var styles = getComputedStyle(element);
22655var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
22656var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
22657var result = {
22658width: element.offsetWidth + y,
22659height: element.offsetHeight + x
22660};
22661return result;
22662}
22663function getOppositePlacement(placement) {
22664var hash = {
22665left: 'right',
22666right: 'left',
22667bottom: 'top',
22668top: 'bottom'
22669};
22670return placement.replace(/left|right|bottom|top/g, function(matched) {
22671return hash[matched];
22672});
22673}
22674function getPopperOffsets(popper, referenceOffsets, placement) {
22675placement = placement.split('-')[0];
22676var popperRect = getOuterSizes(popper);
22677var popperOffsets = {
22678width: popperRect.width,
22679height: popperRect.height
22680};
22681var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
22682var mainSide = isHoriz ? 'top' : 'left';
22683var secondarySide = isHoriz ? 'left' : 'top';
22684var measurement = isHoriz ? 'height' : 'width';
22685var secondaryMeasurement = !isHoriz ? 'height' : 'width';
22686popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
22687if (placement === secondarySide) {
22688popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
22689} else {
22690popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
22691}
22692return popperOffsets;
22693}
22694function find(arr, check) {
22695if (Array.prototype.find) {
22696return arr.find(check);
22697}
22698return arr.filter(check)[0];
22699}
22700function findIndex(arr, prop, value) {
22701if (Array.prototype.findIndex) {
22702return arr.findIndex(function(cur) {
22703return cur[prop] === value;
22704});
22705}
22706var match = find(arr, function(obj) {
22707return obj[prop] === value;
22708});
22709return arr.indexOf(match);
22710}
22711function runModifiers(modifiers, data, ends) {
22712var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
vendor: 8,956 bytes, lines 22713-22975
22713modifiersToRun.forEach(function(modifier) {
22714if (modifier['function']) {
22715console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
22716}
22717var fn = modifier['function'] || modifier.fn;
22718if (modifier.enabled && isFunction(fn)) {
22719data.offsets.popper = getClientRect(data.offsets.popper);
22720data.offsets.reference = getClientRect(data.offsets.reference);
22721data = fn(data, modifier);
22722}
22723});
22724return data;
22725}
22726function update() {
22727if (this.state.isDestroyed) {
22728return;
22729}
22730var data = {
22731instance: this,
22732styles: {},
22733arrowStyles: {},
22734attributes: {},
22735flipped: false,
22736offsets: {}
22737};
22738data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
22739data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
22740data.originalPlacement = data.placement;
22741data.positionFixed = this.options.positionFixed;
22742data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
22743data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
22744data = runModifiers(this.modifiers, data);
22745if (!this.state.isCreated) {
22746this.state.isCreated = true;
22747this.options.onCreate(data);
22748} else {
22749this.options.onUpdate(data);
22750}
22751}
22752function isModifierEnabled(modifiers, modifierName) {
22753return modifiers.some(function(_ref) {
22754var name = _ref.name
22755  , enabled = _ref.enabled;
22756return enabled && name === modifierName;
22757});
22758}
22759function getSupportedPropertyName(property) {
22760var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
22761var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
22762for (var i = 0; i < prefixes.length; i++) {
22763var prefix = prefixes[i];
22764var toCheck = prefix ? '' + prefix + upperProp : property;
22765if (typeof document.body.style[toCheck] !== 'undefined') {
22766return toCheck;
22767}
22768}
22769return null;
22770}
22771function destroy() {
22772this.state.isDestroyed = true;
22773if (isModifierEnabled(this.modifiers, 'applyStyle')) {
22774this.popper.removeAttribute('x-placement');
22775this.popper.style.position = '';
22776this.popper.style.top = '';
22777this.popper.style.left = '';
22778this.popper.style.right = '';
22779this.popper.style.bottom = '';
22780this.popper.style.willChange = '';
22781this.popper.style[getSupportedPropertyName('transform')] = '';
22782}
22783this.disableEventListeners();
22784if (this.options.removeOnDestroy) {
22785this.popper.parentNode.removeChild(this.popper);
22786}
22787return this;
22788}
22789function getWindow(element) {
22790var ownerDocument = element.ownerDocument;
22791return ownerDocument ? ownerDocument.defaultView : window;
22792}
22793function attachToScrollParents(scrollParent, event, callback, scrollParents) {
22794var isBody = scrollParent.nodeName === 'BODY';
22795var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
22796target.addEventListener(event, callback, {
22797passive: true
22798});
22799if (!isBody) {
22800attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
22801}
22802scrollParents.push(target);
22803}
22804function setupEventListeners(reference, options, state, updateBound) {
22805state.updateBound = updateBound;
22806getWindow(reference).addEventListener('resize', state.updateBound, {
22807passive: true
22808});
22809var scrollElement = getScrollParent(reference);
22810attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
22811state.scrollElement = scrollElement;
22812state.eventsEnabled = true;
22813return state;
22814}
22815function enableEventListeners() {
22816if (!this.state.eventsEnabled) {
22817this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
22818}
22819}
22820function removeEventListeners(reference, state) {
22821getWindow(reference).removeEventListener('resize', state.updateBound);
22822state.scrollParents.forEach(function(target) {
22823target.removeEventListener('scroll', state.updateBound);
22824});
22825state.updateBound = null;
22826state.scrollParents = [];
22827state.scrollElement = null;
22828state.eventsEnabled = false;
22829return state;
22830}
22831function disableEventListeners() {
22832if (this.state.eventsEnabled) {
22833cancelAnimationFrame(this.scheduleUpdate);
22834this.state = removeEventListeners(this.reference, this.state);
22835}
22836}
22837function isNumeric(n) {
22838return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
22839}
22840function setStyles(element, styles) {
22841Object.keys(styles).forEach(function(prop) {
22842var unit = '';
22843if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
22844unit = 'px';
22845}
22846element.style[prop] = styles[prop] + unit;
22847});
22848}
22849function setAttributes(element, attributes) {
22850Object.keys(attributes).forEach(function(prop) {
22851var value = attributes[prop];
22852if (value !== false) {
22853element.setAttribute(prop, attributes[prop]);
22854} else {
22855element.removeAttribute(prop);
22856}
22857});
22858}
22859function applyStyle(data) {
22860setStyles(data.instance.popper, data.styles);
22861setAttributes(data.instance.popper, data.attributes);
22862if (data.arrowElement && Object.keys(data.arrowStyles).length) {
22863setStyles(data.arrowElement, data.arrowStyles);
22864}
22865return data;
22866}
22867function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
22868var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
22869var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
22870popper.setAttribute('x-placement', placement);
22871setStyles(popper, {
22872position: options.positionFixed ? 'fixed' : 'absolute'
22873});
22874return options;
22875}
22876function computeStyle(data, options) {
22877var x = options.x
22878  , y = options.y;
22879var popper = data.offsets.popper;
22880var legacyGpuAccelerationOption = find(data.instance.modifiers, function(modifier) {
22881return modifier.name === 'applyStyle';
22882}).gpuAcceleration;
22883if (legacyGpuAccelerationOption !== undefined) {
22884console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
22885}
22886var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
22887var offsetParent = getOffsetParent(data.instance.popper);
22888var offsetParentRect = getBoundingClientRect(offsetParent);
22889var styles = {
22890position: popper.position
22891};
22892var offsets = {
22893left: Math.floor(popper.left),
22894top: Math.round(popper.top),
22895bottom: Math.round(popper.bottom),
22896right: Math.floor(popper.right)
22897};
22898var sideA = x === 'bottom' ? 'top' : 'bottom';
22899var sideB = y === 'right' ? 'left' : 'right';
22900var prefixedProperty = getSupportedPropertyName('transform');
22901var left = void 0
22902  , top = void 0;
22903if (sideA === 'bottom') {
22904top = -offsetParentRect.height + offsets.bottom;
22905} else {
22906top = offsets.top;
22907}
22908if (sideB === 'right') {
22909left = -offsetParentRect.width + offsets.right;
22910} else {
22911left = offsets.left;
22912}
22913if (gpuAcceleration && prefixedProperty) {
22914styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
22915styles[sideA] = 0;
22916styles[sideB] = 0;
22917styles.willChange = 'transform';
22918} else {
22919var invertTop = sideA === 'bottom' ? -1 : 1;
22920var invertLeft = sideB === 'right' ? -1 : 1;
22921styles[sideA] = top * invertTop;
22922styles[sideB] = left * invertLeft;
22923styles.willChange = sideA + ', ' + sideB;
22924}
22925var attributes = {
22926'x-placement': data.placement
22927};
22928data.attributes = _extends({}, attributes, data.attributes);
22929data.styles = _extends({}, styles, data.styles);
22930data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
22931return data;
22932}
22933function isModifierRequired(modifiers, requestingName, requestedName) {
22934var requesting = find(modifiers, function(_ref) {
22935var name = _ref.name;
22936return name === requestingName;
22937});
22938var isRequired = !!requesting && modifiers.some(function(modifier) {
22939return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
22940});
22941if (!isRequired) {
22942var _requesting = '`' + requestingName + '`';
22943var requested = '`' + requestedName + '`';
22944console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
22945}
22946return isRequired;
22947}
22948function arrow(data, options) {
22949var _data$offsets$arrow;
22950if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
22951return data;
22952}
22953var arrowElement = options.element;
22954if (typeof arrowElement === 'string') {
22955arrowElement = data.instance.popper.querySelector(arrowElement);
22956if (!arrowElement) {
22957return data;
22958}
22959} else {
22960if (!data.instance.popper.contains(arrowElement)) {
22961console.warn('WARNING: `arrow.element` must be child of its popper element!');
22962return data;
22963}
22964}
22965var placement = data.placement.split('-')[0];
22966var _data$offsets = data.offsets
22967  , popper = _data$offsets.popper
22968  , reference = _data$offsets.reference;
22969var isVertical = ['left', 'right'].indexOf(placement) !== -1;
22970var len = isVertical ? 'height' : 'width';
22971var sideCapitalized = isVertical ? 'Top' : 'Left';
22972var side = sideCapitalized.toLowerCase();
22973var altSide = isVertical ? 'left' : 'top';
22974var opSide = isVertical ? 'bottom' : 'right';
22975var arrowElementSize = getOuterSizes(arrowElement)[len];
vendor: 5,008 bytes, lines 22976-23083
22976if (reference[opSide] - arrowElementSize < popper[side]) {
22977data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
22978}
22979if (reference[side] + arrowElementSize > popper[opSide]) {
22980data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
22981}
22982data.offsets.popper = getClientRect(data.offsets.popper);
22983var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
22984var css = getStyleComputedProperty(data.instance.popper);
22985var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
22986var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
22987var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
22988sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
22989data.arrowElement = arrowElement;
22990data.offsets.arrow = (_data$offsets$arrow = {},
22991defineProperty(_data$offsets$arrow, side, Math.round(sideValue)),
22992defineProperty(_data$offsets$arrow, altSide, ''),
22993_data$offsets$arrow);
22994return data;
22995}
22996function getOppositeVariation(variation) {
22997if (variation === 'end') {
22998return 'start';
22999} else if (variation === 'start') {
23000return 'end';
23001}
23002return variation;
23003}
23004var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
23005var validPlacements = placements.slice(3);
23006function clockwise(placement) {
23007var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
23008var index = validPlacements.indexOf(placement);
23009var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
23010return counter ? arr.reverse() : arr;
23011}
23012var BEHAVIORS = {
23013FLIP: 'flip',
23014CLOCKWISE: 'clockwise',
23015COUNTERCLOCKWISE: 'counterclockwise'
23016};
23017function flip(data, options) {
23018if (isModifierEnabled(data.instance.modifiers, 'inner')) {
23019return data;
23020}
23021if (data.flipped && data.placement === data.originalPlacement) {
23022return data;
23023}
23024var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
23025var placement = data.placement.split('-')[0];
23026var placementOpposite = getOppositePlacement(placement);
23027var variation = data.placement.split('-')[1] || '';
23028var flipOrder = [];
23029switch (options.behavior) {
23030case BEHAVIORS.FLIP:
23031flipOrder = [placement, placementOpposite];
23032break;
23033case BEHAVIORS.CLOCKWISE:
23034flipOrder = clockwise(placement);
23035break;
23036case BEHAVIORS.COUNTERCLOCKWISE:
23037flipOrder = clockwise(placement, true);
23038break;
23039default:
23040flipOrder = options.behavior;
23041}
23042flipOrder.forEach(function(step, index) {
23043if (placement !== step || flipOrder.length === index + 1) {
23044return data;
23045}
23046placement = data.placement.split('-')[0];
23047placementOpposite = getOppositePlacement(placement);
23048var popperOffsets = data.offsets.popper;
23049var refOffsets = data.offsets.reference;
23050var floor = Math.floor;
23051var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
23052var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
23053var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
23054var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
23055var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
23056var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
23057var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
23058var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
23059if (overlapsRef || overflowsBoundaries || flippedVariation) {
23060data.flipped = true;
23061if (overlapsRef || overflowsBoundaries) {
23062placement = flipOrder[index + 1];
23063}
23064if (flippedVariation) {
23065variation = getOppositeVariation(variation);
23066}
23067data.placement = placement + (variation ? '-' + variation : '');
23068data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
23069data = runModifiers(data.instance.modifiers, data, 'flip');
23070}
23071});
23072return data;
23073}
23074function keepTogether(data) {
23075var _data$offsets = data.offsets
23076  , popper = _data$offsets.popper
23077  , reference = _data$offsets.reference;
23078var placement = data.placement.split('-')[0];
23079var floor = Math.floor;
23080var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
23081var side = isVertical ? 'right' : 'bottom';
23082var opSide = isVertical ? 'left' : 'top';
23083var measurement = isVertical ? 'width' : 'height';
vendor: 6,237 bytes, lines 23084-23276
23084if (popper[side] < floor(reference[opSide])) {
23085data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
23086}
23087if (popper[opSide] > floor(reference[side])) {
23088data.offsets.popper[opSide] = floor(reference[side]);
23089}
23090return data;
23091}
23092function toValue(str, measurement, popperOffsets, referenceOffsets) {
23093var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
23094var value = +split[1];
23095var unit = split[2];
23096if (!value) {
23097return str;
23098}
23099if (unit.indexOf('%') === 0) {
23100var element = void 0;
23101switch (unit) {
23102case '%p':
23103element = popperOffsets;
23104break;
23105case '%':
23106case '%r':
23107default:
23108element = referenceOffsets;
23109}
23110var rect = getClientRect(element);
23111return rect[measurement] / 100 * value;
23112} else if (unit === 'vh' || unit === 'vw') {
23113var size = void 0;
23114if (unit === 'vh') {
23115size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
23116} else {
23117size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
23118}
23119return size / 100 * value;
23120} else {
23121return value;
23122}
23123}
23124function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
23125var offsets = [0, 0];
23126var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
23127var fragments = offset.split(/(\+|\-)/).map(function(frag) {
23128return frag.trim();
23129});
23130var divider = fragments.indexOf(find(fragments, function(frag) {
23131return frag.search(/,|\s/) !== -1;
23132}));
23133if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
23134console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
23135}
23136var splitRegex = /\s*,\s*|\s+/;
23137var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
23138ops = ops.map(function(op, index) {
23139var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
23140var mergeWithPrevious = false;
23141return op.reduce(function(a, b) {
23142if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
23143a[a.length - 1] = b;
23144mergeWithPrevious = true;
23145return a;
23146} else if (mergeWithPrevious) {
23147a[a.length - 1] += b;
23148mergeWithPrevious = false;
23149return a;
23150} else {
23151return a.concat(b);
23152}
23153}, []).map(function(str) {
23154return toValue(str, measurement, popperOffsets, referenceOffsets);
23155});
23156});
23157ops.forEach(function(op, index) {
23158op.forEach(function(frag, index2) {
23159if (isNumeric(frag)) {
23160offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
23161}
23162});
23163});
23164return offsets;
23165}
23166function offset(data, _ref) {
23167var offset = _ref.offset;
23168var placement = data.placement
23169  , _data$offsets = data.offsets
23170  , popper = _data$offsets.popper
23171  , reference = _data$offsets.reference;
23172var basePlacement = placement.split('-')[0];
23173var offsets = void 0;
23174if (isNumeric(+offset)) {
23175offsets = [+offset, 0];
23176} else {
23177offsets = parseOffset(offset, popper, reference, basePlacement);
23178}
23179if (basePlacement === 'left') {
23180popper.top += offsets[0];
23181popper.left -= offsets[1];
23182} else if (basePlacement === 'right') {
23183popper.top += offsets[0];
23184popper.left += offsets[1];
23185} else if (basePlacement === 'top') {
23186popper.left += offsets[0];
23187popper.top -= offsets[1];
23188} else if (basePlacement === 'bottom') {
23189popper.left += offsets[0];
23190popper.top += offsets[1];
23191}
23192data.popper = popper;
23193return data;
23194}
23195function preventOverflow(data, options) {
23196var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
23197if (data.instance.reference === boundariesElement) {
23198boundariesElement = getOffsetParent(boundariesElement);
23199}
23200var transformProp = getSupportedPropertyName('transform');
23201var popperStyles = data.instance.popper.style;
23202var top = popperStyles.top
23203  , left = popperStyles.left
23204  , transform = popperStyles[transformProp];
23205popperStyles.top = '';
23206popperStyles.left = '';
23207popperStyles[transformProp] = '';
23208var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
23209popperStyles.top = top;
23210popperStyles.left = left;
23211popperStyles[transformProp] = transform;
23212options.boundaries = boundaries;
23213var order = options.priority;
23214var popper = data.offsets.popper;
23215var check = {
23216primary: function primary(placement) {
23217var value = popper[placement];
23218if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
23219value = Math.max(popper[placement], boundaries[placement]);
23220}
23221return defineProperty({}, placement, value);
23222},
23223secondary: function secondary(placement) {
23224var mainSide = placement === 'right' ? 'left' : 'top';
23225var value = popper[mainSide];
23226if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
23227value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
23228}
23229return defineProperty({}, mainSide, value);
23230}
23231};
23232order.forEach(function(placement) {
23233var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
23234popper = _extends({}, popper, check[side](placement));
23235});
23236data.offsets.popper = popper;
23237return data;
23238}
23239function shift(data) {
23240var placement = data.placement;
23241var basePlacement = placement.split('-')[0];
23242var shiftvariation = placement.split('-')[1];
23243if (shiftvariation) {
23244var _data$offsets = data.offsets
23245  , reference = _data$offsets.reference
23246  , popper = _data$offsets.popper;
23247var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
23248var side = isVertical ? 'left' : 'top';
23249var measurement = isVertical ? 'width' : 'height';
23250var shiftOffsets = {
23251start: defineProperty({}, side, reference[side]),
23252end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
23253};
23254data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
23255}
23256return data;
23257}
23258function hide(data) {
23259if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
23260return data;
23261}
23262var refRect = data.offsets.reference;
23263var bound = find(data.instance.modifiers, function(modifier) {
23264return modifier.name === 'preventOverflow';
23265}).boundaries;
23266if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
23267if (data.hide === true) {
23268return data;
23269}
23270data.hide = true;
23271data.attributes['x-out-of-boundaries'] = '';
23272} else {
23273if (data.hide === false) {
23274return data;
23275}
23276data.hide = false;
vendor: 4,269 bytes, lines 23277-23450
23277data.attributes['x-out-of-boundaries'] = false;
23278}
23279return data;
23280}
23281function inner(data) {
23282var placement = data.placement;
23283var basePlacement = placement.split('-')[0];
23284var _data$offsets = data.offsets
23285  , popper = _data$offsets.popper
23286  , reference = _data$offsets.reference;
23287var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
23288var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
23289popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
23290data.placement = getOppositePlacement(placement);
23291data.offsets.popper = getClientRect(popper);
23292return data;
23293}
23294var modifiers = {
23295shift: {
23296order: 100,
23297enabled: true,
23298fn: shift
23299},
23300offset: {
23301order: 200,
23302enabled: true,
23303fn: offset,
23304offset: 0
23305},
23306preventOverflow: {
23307order: 300,
23308enabled: true,
23309fn: preventOverflow,
23310priority: ['left', 'right', 'top', 'bottom'],
23311padding: 5,
23312boundariesElement: 'scrollParent'
23313},
23314keepTogether: {
23315order: 400,
23316enabled: true,
23317fn: keepTogether
23318},
23319arrow: {
23320order: 500,
23321enabled: true,
23322fn: arrow,
23323element: '[x-arrow]'
23324},
23325flip: {
23326order: 600,
23327enabled: true,
23328fn: flip,
23329behavior: 'flip',
23330padding: 5,
23331boundariesElement: 'viewport'
23332},
23333inner: {
23334order: 700,
23335enabled: false,
23336fn: inner
23337},
23338hide: {
23339order: 800,
23340enabled: true,
23341fn: hide
23342},
23343computeStyle: {
23344order: 850,
23345enabled: true,
23346fn: computeStyle,
23347gpuAcceleration: true,
23348x: 'bottom',
23349y: 'right'
23350},
23351applyStyle: {
23352order: 900,
23353enabled: true,
23354fn: applyStyle,
23355onLoad: applyStyleOnLoad,
23356gpuAcceleration: undefined
23357}
23358};
23359var Defaults = {
23360placement: 'bottom',
23361positionFixed: false,
23362eventsEnabled: true,
23363removeOnDestroy: false,
23364onCreate: function onCreate() {},
23365onUpdate: function onUpdate() {},
23366modifiers: modifiers
23367};
23368var Popper = function() {
23369function Popper(reference, popper) {
23370var _this = this;
23371var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23372classCallCheck(this, Popper);
23373this.scheduleUpdate = function() {
23374return requestAnimationFrame(_this.update);
23375}
23376;
23377this.update = debounce(this.update.bind(this));
23378this.options = _extends({}, Popper.Defaults, options);
23379this.state = {
23380isDestroyed: false,
23381isCreated: false,
23382scrollParents: []
23383};
23384this.reference = reference && reference.jquery ? reference[0] : reference;
23385this.popper = popper && popper.jquery ? popper[0] : popper;
23386this.options.modifiers = {};
23387Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function(name) {
23388_this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
23389});
23390this.modifiers = Object.keys(this.options.modifiers).map(function(name) {
23391return _extends({
23392name: name
23393}, _this.options.modifiers[name]);
23394}).sort(function(a, b) {
23395return a.order - b.order;
23396});
23397this.modifiers.forEach(function(modifierOptions) {
23398if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
23399modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
23400}
23401});
23402this.update();
23403var eventsEnabled = this.options.eventsEnabled;
23404if (eventsEnabled) {
23405this.enableEventListeners();
23406}
23407this.state.eventsEnabled = eventsEnabled;
23408}
23409createClass(Popper, [{
23410key: 'update',
23411value: function update$$1() {
23412return update.call(this);
23413}
23414}, {
23415key: 'destroy',
23416value: function destroy$$1() {
23417return destroy.call(this);
23418}
23419}, {
23420key: 'enableEventListeners',
23421value: function enableEventListeners$$1() {
23422return enableEventListeners.call(this);
23423}
23424}, {
23425key: 'disableEventListeners',
23426value: function disableEventListeners$$1() {
23427return disableEventListeners.call(this);
23428}
23429}]);
23430return Popper;
23431}();
23432Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
23433Popper.placements = placements;
23434Popper.Defaults = Defaults;
23435return Popper;
23436}
23437)));
23438;
23439/* /web/static/lib/bootstrap/js/index.js defined in bundle 'web.assets_common' */
23440(function($) {
23441if (typeof $ === 'undefined') {
23442throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
23443}
23444var version = $.fn.jquery.split(' ')[0].split('.');
23445var minMajor = 1;
23446var ltMajor = 2;
23447var minMinor = 9;
23448var minPatch = 1;
23449var maxMajor = 4;
23450if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >
23450= maxMajor) {
23451throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
23452}
23453}
23454)($);
23455;
23456/* /web/static/lib/bootstrap/js/util.js defined in bundle 'web.assets_common' */
23457(function(global, factory) {
23458typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) : typeof define === 'function' && define.amd ? define(['jquery'], factory) : (global.Util = factory(global.jQuery));
23459}(this, (function($) {
23460'use strict';
23461$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
23462var Util = function($$$1) {
23463var TRANSITION_END = 'transitionend';
23464var MAX_UID = 1000000;
23465var MILLISECONDS_MULTIPLIER = 1000;
23466function toType(obj) {
23467return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
23468}
23469function getSpecialTransitionEndEvent() {
23470return {
23471bindType: TRANSITION_END,
23472delegateType: TRANSITION_END,
23473handle: function handle(event) {
23474if ($$$1(event.target).is(this)) {
23475return event.handleObj.handler.apply(this, arguments);
23476}
23477return undefined;
23478}
23479};
23480}
23481function transitionEndEmulator(duration) {
23482var _this = this;
23483var called = false;
23484$$$1(this).one(Util.TRANSITION_END, function() {
23485called = true;
23486});
23487setTimeout(function() {
23488if (!called) {
23489Util.triggerTransitionEnd(_this);
23490}
23491}, duration);
23492return this;
23493}
23494function setTransitionEndSupport() {
23495$$$1.fn.emulateTransitionEnd = transitionEndEmulator;
23496$$$1.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
23497}
23498var Util = {
23499TRANSITION_END: 'bsTransitionEnd',
23500getUID: function getUID(prefix) {
23501do {
23502prefix += ~~(Math.random() * MAX_UID);
23503} while (document.getElementById(prefix));return prefix;
23504},
23505getSelectorFromElement: function getSelectorFromElement(element) {
23506var selector = element.getAttribute('data-target');
23507if (!selector || selector === '#') {
23508selector = element.getAttribute('href') || '';
23509}
23510try {
23511return document.querySelector(selector) ? selector : null;
23512} catch (err) {
23513return null;
23514}
23515},
23516getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
23517if (!element) {
23518return 0;
23519}
23520var transitionDuration = $$$1(element).css('transition-duration');
23521var floatTransitionDuration = parseFloat(transitionDuration);
23522if (!floatTransitionDuration) {
23523return 0;
23524}
23525transitionDuration = transitionDuration.split(',')[0];
23526return parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER;
23527},
23528reflow: function reflow(element) {
23529return element.offsetHeight;
23530},
23531triggerTransitionEnd: function triggerTransitionEnd(element) {
23532$$$1(element).trigger(TRANSITION_END);
23533},
23534supportsTransitionEnd: function supportsTransitionEnd() {
23535return Boolean(TRANSITION_END);
23536},
23537isElement: function isElement(obj) {
23538return (obj[0] || obj).nodeType;
23539},
23540typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
23541for (var property in configTypes) {
23542if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
23543var expectedTypes = configTypes[property];
23544var value = config[property];
23545var valueType = value && Util.isElement(value) ? 'element' : toType(value);
23546if (!new RegExp(expectedTypes).test(valueType)) {
23547throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
23548}
23549}
23550}
23551}
23552};
23553setTransitionEndSupport();
23554return Util;
23555}($);
23556return Util;
23557}
23558)));
23559;
23560/* /web/static/lib/bootstrap/js/alert.js defined in bundle 'web.assets_common' */
23561(function(global, factory) {
23562typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : (global.Alert = factory(global.jQuery, global.Util));
23563}(this, (function($, Util) {
23564'use strict';
23565$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
23566Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
23567function _defineProperties(target, props) {
23568for (var i = 0; i < props.length; i++) {
23569var descriptor = props[i];
23570descriptor.enumerable = descriptor.enumerable || false;
23571descriptor.configurable = true;
23572if ("value"in descriptor)
23573descriptor.writable = true;
23574Object.defineProperty(target, descriptor.key, descriptor);
23575}
23576}
23577function _createClass(Constructor, protoProps, staticProps) {
23578if (protoProps)
23579_defineProperties(Constructor.prototype, protoProps);
23580if (staticProps)
23581_defineProperties(Constructor, staticProps);
23582return Constructor;
23583}
23584var Alert = function($$$1) {
23585var NAME = 'alert';
23586var VERSION = '4.1.3';
23587var DATA_KEY = 'bs.alert';
23588var EVENT_KEY = "." + DATA_KEY;
23589var DATA_API_KEY = '.data-api';
23590var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
23591var Selector = {
23592DISMISS: '[data-dismiss="alert"]'
23593};
23594var Event = {
23595CLOSE: "close" + EVENT_KEY,
23596CLOSED: "closed" + EVENT_KEY,
23597CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
23598};
23599var ClassName = {
23600ALERT: 'alert',
23601FADE: 'fade',
23602SHOW: 'show'
23603};
23604var Alert = function() {
23605function Alert(element) {
23606this._element = element;
23607}
23608var _proto = Alert.prototype;
23609_proto.close = function close(element) {
23610var rootElement = this._element;
23611if (element) {
23612rootElement = this._getRootElement(element);
23613}
23614var customEvent = this._triggerCloseEvent(rootElement);
23615if (customEvent.isDefaultPrevented()) {
23616return;
23617}
23618this._removeElement(rootElement);
23619}
23620;
23621_proto.dispose = function dispose() {
23622$$$1.removeData(this._element, DATA_KEY);
23623this._element = null;
23624}
23625;
23626_proto._getRootElement = function _getRootElement(element) {
23627var selector = Util.getSelectorFromElement(element);
23628var parent = false;
23629if (selector) {
23630parent = document.querySelector(selector);
23631}
23632if (!parent) {
23633parent = $$$1(element).closest("." + ClassName.ALERT)[0];
23634}
23635return parent;
23636}
23637;
23638_proto._triggerCloseEvent = function _triggerCloseEvent(element) {
23639var closeEvent = $$$1.Event(Event.CLOSE);
23640$$$1(element).trigger(closeEvent);
23641return closeEvent;
23642}
23643;
23644_proto._removeElement = function _removeElement(element) {
23645var _this = this;
23646$$$1(element).removeClass(ClassName.SHOW);
23647if (!$$$1(element).hasClass(ClassName.FADE)) {
23648this._destroyElement(element);
23649return;
23650}
23651var transitionDuration = Util.getTransitionDurationFromElement(element);
23652$$$1(element).one(Util.TRANSITION_END, function(event) {
23653return _this._destroyElement(element, event);
23654}).emulateTransitionEnd(transitionDuration);
23655}
23656;
23657_proto._destroyElement = function _destroyElement(element) {
23658$$$1(element).detach().trigger(Event.CLOSED).remove();
23659}
23660;
23661Alert._jQueryInterface = function _jQueryInterface(config) {
23662return this.each(function() {
23663var $element = $$$1(this);
23664var data = $element.data(DATA_KEY);
23665if (!data) {
23666data = new Alert(this);
23667$element.data(DATA_KEY, data);
23668}
23669if (config === 'close') {
23670data[config](this);
23671}
23672});
23673}
23674;
23675Alert._handleDismiss = function _handleDismiss(alertInstance) {
23676return function(event) {
23677if (event) {
23678event.preventDefault();
23679}
23680alertInstance.close(this);
23681}
23682;
23683}
23684;
23685_createClass(Alert, null, [{
23686key: "VERSION",
23687get: function get() {
23688return VERSION;
23689}
23690}]);
23691return Alert;
23692}();
23693$$$1(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
23694$$$1.fn[NAME] = Alert._jQueryInterface;
23695$$$1.fn[NAME].Constructor = Alert;
23696$$$1.fn[NAME].noConflict = function() {
23697$$$1.fn[NAME] = JQUERY_NO_CONFLICT;
23698return Alert._jQueryInterface;
23699}
23700;
23701return Alert;
23702}($);
23703return Alert;
23704}
23705)));
23706;
23707/* /web/static/lib/bootstrap/js/button.js defined in bundle 'web.assets_common' */
23708(function(global, factory) {
23709typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) : typeof define === 'function' && define.amd ? define(['jquery'], factory) : (global.Button = factory(global.jQuery));
23710}(this, (function($) {
23711'use strict';
23712$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
23713function _defineProperties(target, props) {
23714for (var i = 0; i < props.length; i++) {
23715var descriptor = props[i];
23716descriptor.enumerable = descriptor.enumerable || false;
23717descriptor.configurable = true;
23718if ("value"in descriptor)
23719descriptor.writable = true;
23720Object.defineProperty(target, descriptor.key, descriptor);
23721}
23722}
23723function _createClass(Constructor, protoProps, staticProps) {
23724if (protoProps)
23725_defineProperties(Constructor.prototype, protoProps);
23726if (staticProps)
23727_defineProperties(Constructor, staticProps);
23728return Constructor;
23729}
23730var Button = function($$$1) {
23731var NAME = 'button';
23732var VERSION = '4.1.3';
23733var DATA_KEY = 'bs.button';
23734var EVENT_KEY = "." + DATA_KEY;
23735var DATA_API_KEY = '.data-api';
23736var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
23737var ClassName = {
23738ACTIVE: 'active',
23739BUTTON: 'btn',
23740FOCUS: 'focus'
23741};
23742var Selector = {
23743DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
23744DATA_TOGGLE: '[data-toggle="buttons"]',
23745INPUT: 'input',
23746ACTIVE: '.active',
23747BUTTON: '.btn'
23748};
23749var Event = {
23750CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
23751FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY)
23752};
23753var Button = function() {
23754function Button(element) {
23755this._element = element;
23756}
23757var _proto = Button.prototype;
23758_proto.toggle = function toggle() {
23759var triggerChangeEvent = true;
23760var addAriaPressed = true;
23761var rootElement = $$$1(this._element).closest(Selector.DATA_TOGGLE)[0];
23762if (rootElement) {
23763var input = this._element.querySelector(Selector.INPUT);
23764if (input) {
23765if (input.type === 'radio') {
23766if (input.checked && this._element.classList.contains(ClassName.ACTIVE)) {
23767triggerChangeEvent = false;
23768} else {
23769var activeElement = rootElement.querySelector(Selector.ACTIVE);
23770if (activeElement) {
23771$$$1(activeElement).removeClass(ClassName.ACTIVE);
23772}
23773}
23774}
23775if (triggerChangeEvent) {
23776if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
23777return;
23778}
23779input.checked = !this._element.classList.contains(ClassName.ACTIVE);
23780$$$1(input).trigger('change');
23781}
23782input.focus();
23783addAriaPressed = false;
23784}
23785}
23786if (addAriaPressed) {
23787this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName.ACTIVE));
23788}
23789if (triggerChangeEvent) {
23790$$$1(this._element).toggleClass(ClassName.ACTIVE);
23791}
23792}
23793;
23794_proto.dispose = function dispose() {
23795$$$1.removeData(this._element, DATA_KEY);
23796this._element = null;
23797}
23798;
23799Button._jQueryInterface = function _jQueryInterface(config) {
23800return this.each(function() {
23801var data = $$$1(this).data(DATA_KEY);
23802if (!data) {
23803data = new Button(this);
23804$$$1(this).data(DATA_KEY, data);
23805}
23806if (config === 'toggle') {
23807data[config]();
23808}
23809});
23810}
23811;
23812_createClass(Button, null, [{
23813key: "VERSION",
23814get: function get() {
23815return VERSION;
23816}
23817}]);
23818return Button;
23819}();
23820$$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function(event) {
23821event.preventDefault();
23822var button = event.target;
23823if (!$$$1(button).hasClass(ClassName.BUTTON)) {
23824button = $$$1(button).closest(Selector.BUTTON);
23825}
23826Button._jQueryInterface.call($$$1(button), 'toggle');
23827}).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function(event) {
23828var button = $$$1(event.target).closest(Selector.BUTTON)[0];
23829$$$1(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
23830});
23831$$$1.fn[NAME] = Button._jQueryInterface;
23832$$$1.fn[NAME].Constructor = Button;
23833$$$1.fn[NAME].noConflict = function() {
23834$$$1.fn[NAME] = JQUERY_NO_CONFLICT;
23835return Button._jQueryInterface;
23836}
23837;
23838return Button;
23839}($);
23840return Button;
23841}
23842)));
23843;
23844/* /web/static/lib/bootstrap/js/carousel.js defined in bundle 'web.assets_common' */
23845(function(global, factory) {
23846typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : (global.Carousel = factory(global.jQuery, global.Util));
23847}(this, (function($, Util) {
23848'use strict';
23849$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
23850Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
23851function _defineProperties(target, props) {
23852for (var i = 0; i < props.length; i++) {
23853var descriptor = props[i];
23854descriptor.enumerable = descriptor.enumerable || false;
23855descriptor.configurable = true;
23856if ("value"in descriptor)
23857descriptor.writable = true;
23858Object.defineProperty(target, descriptor.key, descriptor);
23859}
23860}
23861function _createClass(Constructor, protoProps, staticProps) {
23862if (protoProps)
23863_defineProperties(Constructor.prototype, protoProps);
23864if (staticProps)
23865_defineProperties(Constructor, staticProps);
23866return Constructor;
23867}
23868function _defineProperty(obj, key, value) {
23869if (key in obj) {
23870Object.defineProperty(obj, key, {
23871value: value,
23872enumerable: true,
23873configurable: true,
23874writable: true
23875});
23876} else {
23877obj[key] = value;
23878}
23879return obj;
23880}
23881function _objectSpread(target) {
23882for (var i = 1; i < arguments.length; i++) {
23883var source = arguments[i] != null ? arguments[i] : {};
23884var ownKeys = Object.keys(source);
23885if (typeof Object.getOwnPropertySymbols === 'function') {
23886ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
23887return Object.getOwnPropertyDescriptor(source, sym).enumerable;
23888}));
23889}
23890ownKeys.forEach(function(key) {
23891_defineProperty(target, key, source[key]);
23892});
23893}
23894return target;
23895}
23896var Carousel = function($$$1) {
23897var NAME = 'carousel';
23898var VERSION = '4.1.3';
23899var DATA_KEY = 'bs.carousel';
23900var EVENT_KEY = "." + DATA_KEY;
23901var DATA_API_KEY = '.data-api';
23902var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
23903var ARROW_LEFT_KEYCODE = 37;
23904var ARROW_RIGHT_KEYCODE = 39;
23905var TOUCHEVENT_COMPAT_WAIT = 500;
23906var Default = {
23907interval: 5000,
23908keyboard: true,
23909slide: false,
23910pause: 'hover',
23911wrap: true
23912};
23913var DefaultType = {
23914interval: '(number|boolean)',
23915keyboard: 'boolean',
23916slide: '(boolean|string)',
23917pause: '(string|boolean)',
23918wrap: 'boolean'
23919};
23920var Direction = {
23921NEXT: 'next',
23922PREV: 'prev',
23923LEFT: 'left',
23924RIGHT: 'right'
23925};
23926var Event = {
23927SLIDE: "slide" + EVENT_KEY,
23928SLID: "slid" + EVENT_KEY,
23929KEYDOWN: "keydown" + EVENT_KEY,
23930MOUSEENTER: "mouseenter" + EVENT_KEY,
23931MOUSELEAVE: "mouseleave" + EVENT_KEY,
23932TOUCHEND: "touchend" + EVENT_KEY,
23933LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY,
23934CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
23935};
23936var ClassName = {
23937CAROUSEL: 'carousel',
23938ACTIVE: 'active',
23939SLIDE: 'slide',
23940RIGHT: 'carousel-item-right',
23941LEFT: 'carousel-item-left',
23942NEXT: 'carousel-item-next',
23943PREV: 'carousel-item-prev',
23944ITEM: 'carousel-item'
23945};
23946var Selector = {
23947ACTIVE: '.active',
23948ACTIVE_ITEM: '.active.carousel-item',
23949ITEM: '.carousel-item',
23950NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
23951INDICATORS: '.carousel-indicators',
23952DATA_SLIDE: '[data-slide], [data-slide-to]',
23953DATA_RIDE: '[data-ride="carousel"]'
23954};
23955var Carousel = function() {
23956function Carousel(element, config) {
23957this._items = null;
23958this._interval = null;
23959this._activeElement = null;
23960this._isPaused = false;
23961this._isSliding = false;
23962this.touchTimeout = null;
23963this._config = this._getConfig(config);
23964this._element = $$$1(element)[0];
23965this._indicatorsElement = this._element.querySelector(Selector.INDICATORS);
23966this._addEventListeners();
23967}
23968var _proto = Carousel.prototype;
23969_proto.next = function next() {
23970if (!this._isSliding) {
23971this._slide(Direction.NEXT);
23972}
23973}
23974;
23975_proto.nextWhenVisible = function nextWhenVisible() {
23976if (!document.hidden && $$$1(this._element).is(':visible') && $$$1(this._element).css('visibility') !== 'hidden') {
23977this.next();
23978}
23979}
23980;
23981_proto.prev = function prev() {
23982if (!this._isSliding) {
23983this._slide(Direction.PREV);
23984}
23985}
23986;
23987_proto.pause = function pause(event) {
23988if (!event) {
23989this._isPaused = true;
23990}
23991if (this._element.querySelector(Selector.NEXT_PREV)) {
23992Util.triggerTransitionEnd(this._element);
23993this.cycle(true);
23994}
23995clearInterval(this._interval);
23996this._interval = null;
23997}
23998;
23999_proto.cycle = function cycle(event) {
24000if (!event) {
24001this._isPaused = false;
24002}
24003if (this._interval) {
24004clearInterval(this._interval);
24005this._interval = null;
24006}
24007if (this._config.interval && !this._isPaused) {
24008this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
24009}
24010}
24011;
24012_proto.to = function to(index) {
24013var _this = this;
24014this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM);
24015var activeIndex = this._getItemIndex(this._activeElement);
24016if (index > this._items.length - 1 || index < 0) {
24017return;
24018}
24019if (this._isSliding) {
24020$$$1(this._element).one(Event.SLID, function() {
24021return _this.to(index);
24022});
24023return;
24024}
24025if (activeIndex === index) {
24026this.pause();
24027this.cycle();
24028return;
24029}
24030var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
24031this._slide(direction, this._items[index]);
24032}
24033;
24034_proto.dispose = function dispose() {
24035$$$1(this._element).off(EVENT_KEY);
24036$$$1.removeData(this._element, DATA_KEY);
24037this._items = null;
24038this._config = null;
24039this._element = null;
24040this._interval = null;
24041this._isPaused = null;
24042this._isSliding = null;
24043this._activeElement = null;
24044this._indicatorsElement = null;
24045}
24046;
24047_proto._getConfig = function _getConfig(config) {
24048config = _objectSpread({}, Default, config);
24049Util.typeCheckConfig(NAME, config, DefaultType);
24050return config;
24051}
24052;
24053_proto._addEventListeners = function _addEventListeners() {
24054var _this2 = this;
24055if (this._config.keyboard) {
24056$$$1(this._element).on(Event.KEYDOWN, function(event) {
24057return _this2._keydown(event);
24058});
24059}
24060if (this._config.pause === 'hover') {
24061$$$1(this._element).on(Event.MOUSEENTER, function(event) {
24062return _this2.pause(event);
24063}).on(Event.MOUSELEAVE, function(event) {
24064return _this2.cycle(event);
24065});
24066if ('ontouchstart'in document.documentElement) {
24067$$$1(this._element).on(Event.TOUCHEND, function() {
24068_this2.pause();
24069if (_this2.touchTimeout) {
24070clearTimeout(_this2.touchTimeout);
24071}
24072_this2.touchTimeout = setTimeout(function(event) {
24073return _this2.cycle(event);
24074}, TOUCHEVENT_COMPAT_WAIT + _this2._config.interval);
24075});
24076}
24077}
24078}
24079;
24080_proto._keydown = function _keydown(event) {
24081if (/input|textarea/i.test(event.target.tagName)) {
24082return;
24083}
24084switch (event.which) {
24085case ARROW_LEFT_KEYCODE:
24086event.preventDefault();
24087this.prev();
24088break;
24089case ARROW_RIGHT_KEYCODE:
24090event.preventDefault();
24091this.next();
24092break;
24093default:
24094}
24095}
24096;
24097_proto._getItemIndex = function _getItemIndex(element) {
24098this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM)) : [];
24099return this._items.indexOf(element);
24100}
24101;
24102_proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
24103var isNextDirection = direction === Direction.NEXT;
24104var isPrevDirection = direction === Direction.PREV;
24105var activeIndex = this._getItemIndex(activeElement);
24106var lastItemIndex = this._items.length - 1;
24107var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
24108if (isGoingToWrap && !this._config.wrap) {
24109return activeElement;
24110}
24111var delta = direction === Direction.PREV ? -1 : 1;
24112var itemIndex = (activeIndex + delta) % this._items.length;
24113return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
24114}
24115;
24116_proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
24117var targetIndex = this._getItemIndex(relatedTarget);
24118var fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM));
24119var slideEvent = $$$1.Event(Event.SLIDE, {
24120relatedTarget: relatedTarget,
24121direction: eventDirectionName,
24122from: fromIndex,
24123to: targetIndex
24124});
24125$$$1(this._element).trigger(slideEvent);
24126return slideEvent;
24127}
24128;
24129_proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
24130if (this._indicatorsElement) {
24131var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE));
24132$$$1(indicators).removeClass(ClassName.ACTIVE);
24133var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
24134if (nextIndicator) {
24135$$$1(nextIndicator).addClass(ClassName.ACTIVE);
24136}
24137}
24138}
24139;
24140_proto._slide = function _slide(direction, element) {
24141var _this3 = this;
24142var activeElement = this._element.querySelector(Selector.ACTIVE_ITEM);
24143var activeElementIndex = this._getItemIndex(activeElement);
24144var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
24145var nextElementIndex = this._getItemIndex(nextElement);
24146var isCycling = Boolean(this._interval);
24147var directionalClassName;
24148var orderClassName;
24149var eventDirectionName;
24150if (direction === Direction.NEXT) {
24151directionalClassName = ClassName.LEFT;
24152orderClassName = ClassName.NEXT;
24153eventDirectionName = Direction.LEFT;
24154} else {
24155directionalClassName = ClassName.RIGHT;
24156orderClassName = ClassName.PREV;
24157eventDirectionName = Direction.RIGHT;
24158}
24159if (nextElement && $$$1(nextElement).hasClass(ClassName.ACTIVE)) {
24160this._isSliding = false;
24161return;
24162}
24163var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
24164if (slideEvent.isDefaultPrevented()) {
24165return;
24166}
24167if (!activeElement || !nextElement) {
24168return;
24169}
24170this._isSliding = true;
24171if (isCycling) {
24172this.pause();
24173}
24174this._setActiveIndicatorElement(nextElement);
24175var slidEvent = $$$1.Event(Event.SLID, {
24176relatedTarget: nextElement,
24177direction: eventDirectionName,
24178from: activeElementIndex,
24179to: nextElementIndex
24180});
24181if ($$$1(this._element).hasClass(ClassName.SLIDE)) {
24182$$$1(nextElement).addClass(orderClassName);
24183Util.reflow(nextElement);
24184$$$1(activeElement).addClass(directionalClassName);
24185$$$1(nextElement).addClass(directionalClassName);
24186var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
24187$$$1(activeElement).one(Util.TRANSITION_END, function() {
24188$$$1(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName.ACTIVE);
24189$$$1(activeElement).removeClass(ClassName.ACTIVE + " " + orderClassName + " " + directionalClassName);
24190_this3._isSliding = false;
24191setTimeout(function() {
24192return $$$1(_this3._element).trigger(slidEvent);
24193}, 0);
24194}).emulateTransitionEnd(transitionDuration);
24195} else {
24196$$$1(activeElement).removeClass(ClassName.ACTIVE);
24197$$$1(nextElement).addClass(ClassName.ACTIVE);
24198this._isSliding = false;
24199$$$1(this._element).trigger(slidEvent);
24200}
24201if (isCycling) {
24202this.cycle();
24203}
24204}
24205;
24206Carousel._jQueryInterface = function _jQueryInterface(config) {
24207return this.each(function() {
24208var data = $$$1(this).data(DATA_KEY);
24209var _config = _objectSpread({}, Default, $$$1(this).data());
24210if (typeof config === 'object') {
24211_config = _objectSpread({}, _config, config);
24212}
24213var action = typeof config === 'string' ? config : _config.slide;
24214if (!data) {
24215data = new Carousel(this,_config);
24216$$$1(this).data(DATA_KEY, data);
24217}
24218if (typeof config === 'number') {
24219data.to(config);
24220} else if (typeof action === 'string') {
24221if (typeof data[action] === 'undefined') {
24222throw new TypeError("No method named \"" + action + "\"");
24223}
24224data[action]();
24225} else if (_config.interval) {
24226data.pause();
24227data.cycle();
24228}
24229});
24230}
24231;
24232Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
24233var selector = Util.getSelectorFromElement(this);
24234if (!selector) {
24235return;
24236}
24237var target = $$$1(selector)[0];
24238if (!target || !$$$1(target).hasClass(ClassName.CAROUSEL)) {
24239return;
24240}
24241var config = _objectSpread({}, $$$1(target).data(), $$$1(this).data());
24242var slideIndex = this.getAttribute('data-slide-to');
24243if (slideIndex) {
24244config.interval = false;
24245}
24246Carousel._jQueryInterface.call($$$1(target), config);
24247if (slideIndex) {
24248$$$1(target).data(DATA_KEY).to(slideIndex);
24249}
24250event.preventDefault();
24251}
24252;
24253_createClass(Carousel, null, [{
24254key: "VERSION",
24255get: function get() {
24256return VERSION;
24257}
24258}, {
24259key: "Default",
24260get: function get() {
24261return Default;
24262}
24263}]);
24264return Carousel;
24265}();
24266$$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
24267$$$1(window).on(Event.LOAD_DATA_API, function() {
24268var carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE));
24269for (var i = 0, len = carousels.length; i < len; i++) {
24270var $carousel = $$$1(carousels[i]);
24271Carousel._jQueryInterface.call($carousel, $carousel.data());
24272}
24273});
24274$$$1.fn[NAME] = Carousel._jQueryInterface;
24275$$$1.fn[NAME].Constructor = Carousel;
24276$$$1.fn[NAME].noConflict = function() {
24277$$$1.fn[NAME] = JQUERY_NO_CONFLICT;
24278return Carousel._jQueryInterface;
24279}
24280;
24281return Carousel;
24282}($);
24283return Carousel;
24284}
24285)));
24286;
24287/* /web/static/lib/bootstrap/js/collapse.js defined in bundle 'web.assets_common' */
24288(function(global, factory) {
24289typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : (global.Collapse = factory(global.jQuery, global.Util));
24290}(this, (function($, Util) {
24291'use strict';
24292$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
24293Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
24294function _defineProperties(target, props) {
24295for (var i = 0; i < props.length; i++) {
24296var descriptor = props[i];
24297descriptor.enumerable = descriptor.enumerable || false;
24298descriptor.configurable = true;
24299if ("value"in descriptor)
24300descriptor.writable = true;
24301Object.defineProperty(target, descriptor.key, descriptor);
24302}
24303}
24304function _createClass(Constructor, protoProps, staticProps) {
24305if (protoProps)
24306_defineProperties(Constructor.prototype, protoProps);
24307if (staticProps)
24308_defineProperties(Constructor, staticProps);
24309return Constructor;
24310}
24311function _defineProperty(obj, key, value) {
24312if (key in obj) {
24313Object.defineProperty(obj, key, {
24314value: value,
24315enumerable: true,
24316configurable: true,
24317writable: true
24318});
24319} else {
24320obj[key] = value;
24321}
24322return obj;
24323}
24324function _objectSpread(target) {
24325for (var i = 1; i < arguments.length; i++) {
24326var source = arguments[i] != null ? arguments[i] : {};
24327var ownKeys = Object.keys(source);
24328if (typeof Object.getOwnPropertySymbols === 'function') {
24329ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
24330return Object.getOwnPropertyDescriptor(source, sym).enumerable;
24331}));
24332}
24333ownKeys.forEach(function(key) {
24334_defineProperty(target, key, source[key]);
24335});
24336}
24337return target;
24338}
24339var Collapse = function($$$1) {
24340var NAME = 'collapse';
24341var VERSION = '4.1.3';
24342var DATA_KEY = 'bs.collapse';
24343var EVENT_KEY = "." + DATA_KEY;
24344var DATA_API_KEY = '.data-api';
24345var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
24346var Default = {
24347toggle: true,
24348parent: ''
24349};
24350var DefaultType = {
24351toggle: 'boolean',
24352parent: '(string|element)'
24353};
24354var Event = {
24355SHOW: "show" + EVENT_KEY,
24356SHOWN: "shown" + EVENT_KEY,
24357HIDE: "hide" + EVENT_KEY,
24358HIDDEN: "hidden" + EVENT_KEY,
24359CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
24360};
24361var ClassName = {
24362SHOW: 'show',
24363COLLAPSE: 'collapse',
24364COLLAPSING: 'collapsing',
24365COLLAPSED: 'collapsed'
24366};
24367var Dimension = {
24368WIDTH: 'width',
24369HEIGHT: 'height'
24370};
24371var Selector = {
24372ACTIVES: '.show, .collapsing',
24373DATA_TOGGLE: '[data-toggle="collapse"]'
24374};
24375var Collapse = function() {
24376function Collapse(element, config) {
24377this._isTransitioning = false;
24378this._element = element;
24379this._config = this._getConfig(config);
24380this._triggerArray = $$$1.makeArray(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
24381var toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));
24382for (var i = 0, len = toggleList.length; i < len; i++) {
24383var elem = toggleList[i];
24384var selector = Util.getSelectorFromElement(elem);
24385var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function(foundElem) {
24386return foundElem === element;
24387});
24388if (selector !== null && filterElement.length > 0) {
24389this._selector = selector;
24390this._triggerArray.push(elem);
24391}
24392}
24393this._parent = this._config.parent ? this._getParent() : null;
24394if (!this._config.parent) {
24395this._addAriaAndCollapsedClass(this._element, this._triggerArray);
24396}
24397if (this._config.toggle) {
24398this.toggle();
24399}
24400}
24401var _proto = Collapse.prototype;
24402_proto.toggle = function toggle() {
24403if ($$$1(this._element).hasClass(ClassName.SHOW)) {
24404this.hide();
24405} else {
24406this.show();
24407}
24408}
24409;
24410_proto.show = function show() {
24411var _this = this;
24412if (this._isTransitioning || $$$1(this._element).hasClass(ClassName.SHOW)) {
24413return;
24414}
24415var actives;
24416var activesData;
24417if (this._parent) {
24418actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES)).filter(function(elem) {
24419return elem.getAttribute('data-parent') === _this._config.parent;
24420});
24421if (actives.length === 0) {
24422actives = null;
24423}
24424}
24425if (actives) {
24426activesData = $$$1(actives).not(this._selector).data(DATA_KEY);
24427if (activesData && activesData._isTransitioning) {
24428return;
24429}
24430}
24431var startEvent = $$$1.Event(Event.SHOW);
24432$$$1(this._element).trigger(startEvent);
24433if (startEvent.isDefaultPrevented()) {
24434return;
24435}
24436if (actives) {
24437Collapse._jQueryInterface.call($$$1(actives).not(this._selector), 'hide');
24438if (!activesData) {
24439$$$1(actives).data(DATA_KEY, null);
24440}
24441}
24442var dimension = this._getDimension();
24443$$$1(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
24444this._element.style[dimension] = 0;
24445if (this._triggerArray.length) {
24446$$$1(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
24447}
24448this.setTransitioning(true);
24449var complete = function complete() {
24450$$$1(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);
24451_this._element.style[dimension] = '';
24452_this.setTransitioning(false);
24453$$$1(_this._element).trigger(Event.SHOWN);
24454};
24455var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
24456var scrollSize = "scroll" + capitalizedDimension;
24457var transitionDuration = Util.getTransitionDurationFromElement(this._element);
24458$$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
24459this._element.style[dimension] = this._element[scrollSize] + "px";
24460}
24461;
24462_proto.hide = function hide() {
24463var _this2 = this;
24464if (this._isTransitioning || !$$$1(this._element).hasClass(ClassName.SHOW)) {
24465return;
24466}
24467var startEvent = $$$1.Event(Event.HIDE);
24468$$$1(this._element).trigger(startEvent);
24469if (startEvent.isDefaultPrevented()) {
24470return;
24471}
24472var dimension = this._getDimension();
24473this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
24474Util.reflow(this._element);
24475$$$1(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
24476var triggerArrayLength = this._triggerArray.length;
24477if (triggerArrayLength > 0) {
24478for (var i = 0; i < triggerArrayLength; i++) {
24479var trigger = this._triggerArray[i];
24480var selector = Util.getSelectorFromElement(trigger);
24481if (selector !== null) {
24482var $elem = $$$1([].slice.call(document.querySelectorAll(selector)));
24483if (!$elem.hasClass(ClassName.SHOW)) {
24484$$$1(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
24485}
24486}
24487}
24488}
24489this.setTransitioning(true);
24490var complete = function complete() {
24491_this2.setTransitioning(false);
24492$$$1(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
24493};
24494this._element.style[dimension] = '';
24495var transitionDuration = Util.getTransitionDurationFromElement(this._element);
24496$$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
24497}
24498;
24499_proto.setTransitioning = function setTransitioning(isTransitioning) {
24500this._isTransitioning = isTransitioning;
24501}
24502;
24503_proto.dispose = function dispose() {
24504$$$1.removeData(this._element, DATA_KEY);
24505this._config = null;
24506this._parent = null;
24507this._element = null;
24508this._triggerArray = null;
24509this._isTransitioning = null;
24510}
24511;
24512_proto._getConfig = function _getConfig(config) {
24513config = _objectSpread({}, Default, config);
24514config.toggle = Boolean(config.toggle);
24515Util.typeCheckConfig(NAME, config, DefaultType);
24516return config;
24517}
24518;
24519_proto._getDimension = function _getDimension() {
24520var hasWidth = $$$1(this._element).hasClass(Dimension.WIDTH);
24521return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
24522}
24523;
24524_proto._getParent = function _getParent() {
24525var _this3 = this;
24526var parent = null;
24527if (Util.isElement(this._config.parent)) {
24528parent = this._config.parent;
24529if (typeof this._config.parent.jquery !== 'undefined') {
24530parent = this._config.parent[0];
24531}
24532} else {
24533parent = document.querySelector(this._config.parent);
24534}
24535var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
24536var children = [].slice.call(parent.querySelectorAll(selector));
24537$$$1(children).each(function(i, element) {
24538_this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
24539});
24540return parent;
24541}
24542;
24543_proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
24544if (element) {
24545var isOpen = $$$1(element).hasClass(ClassName.SHOW);
24546if (triggerArray.length) {
24547$$$1(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
24548}
24549}
24550}
24551;
24552Collapse._getTargetFromElement = function _getTargetFromElement(element) {
24553var selector = Util.getSelectorFromElement(element);
24554return selector ? document.querySelector(selector) : null;
24555}
24556;
24557Collapse._jQueryInterface = function _jQueryInterface(config) {
24558return this.each(function() {
24559var $this = $$$1(this);
24560var data = $this.data(DATA_KEY);
24561var _config = _objectSpread({}, Default, $this.data(), typeof config === 'object' && config ? config : {});
24562if (!data && _config.toggle && /show|hide/.test(config)) {
24563_config.toggle = false;
24564}
24565if (!data) {
24566data = new Collapse(this,_config);
24567$this.data(DATA_KEY, data);
24568}
24569if (typeof config === 'string') {
24570if (typeof data[config] === 'undefined') {
24571throw new TypeError("No method named \"" + config + "\"");
24572}
24573data[config]();
24574}
24575});
24576}
24577;
24578_createClass(Collapse, null, [{
24579key: "VERSION",
24580get: function get() {
24581return VERSION;
24582}
24583}, {
24584key: "Default",
24585get: function get() {
24586return Default;
24587}
24588}]);
24589return Collapse;
24590}();
24591$$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function(event) {
24592if (event.currentTarget.tagName === 'A') {
24593event.preventDefault();
24594}
24595var $trigger = $$$1(this);
24596var selector = Util.getSelectorFromElement(this);
24597var selectors = [].slice.call(document.querySelectorAll(selector));
24598$$$1(selectors).each(function() {
24599var $target = $$$1(this);
24600var data = $target.data(DATA_KEY);
24601var config = data ? 'toggle' : $trigger.data();
24602Collapse._jQueryInterface.call($target, config);
24603});
24604});
24605$$$1.fn[NAME] = Collapse._jQueryInterface;
24606$$$1.fn[NAME].Constructor = Collapse;
24607$$$1.fn[NAME].noConflict = function() {
24608$$$1.fn[NAME] = JQUERY_NO_CONFLICT;
24609return Collapse._jQueryInterface;
24610}
24611;
24612return Collapse;
24613}($);
24614return Collapse;
24615}
24616)));
24617;
24618/* /web/static/lib/bootstrap/js/dropdown.js defined in bundle 'web.assets_common' */
24619(function(global, factory) {
24620typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) : (global.Dropdown = factory(global.jQuery, global.Popper, global.Util));
24621}(this, (function($, Popper, Util) {
24622'use strict';
24623$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
24624Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
24625Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
24626function _defineProperties(target, props) {
24627for (var i = 0; i < props.length; i++) {
24628var descriptor = props[i];
24629descriptor.enumerable = descriptor.enumerable || false;
24630descriptor.configurable = true;
24631if ("value"in descriptor)
24632descriptor.writable = true;
24633Object.defineProperty(target, descriptor.key, descriptor);
24634}
24635}
24636function _createClass(Constructor, protoProps, staticProps) {
24637if (protoProps)
24638_defineProperties(Constructor.prototype, protoProps);
24639if (staticProps)
24640_defineProperties(Constructor, staticProps);
24641return Constructor;
24642}
24643function _defineProperty(obj, key, value) {
24644if (key in obj) {
24645Object.defineProperty(obj, key, {
24646value: value,
24647enumerable: true,
24648configurable: true,
24649writable: true
24650});
24651} else {
24652obj[key] = value;
24653}
24654return obj;
24655}
24656function _objectSpread(target) {
24657for (var i = 1; i < arguments.length; i++) {
24658var source = arguments[i] != null ? arguments[i] : {};
24659var ownKeys = Object.keys(source);
24660if (typeof Object.getOwnPropertySymbols === 'function') {
24661ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
24662return Object.getOwnPropertyDescriptor(source, sym).enumerable;
24663}));
24664}
24665ownKeys.forEach(function(key) {
24666_defineProperty(target, key, source[key]);
24667});
24668}
24669return target;
24670}
24671var Dropdown = function($$$1) {
24672var NAME = 'dropdown';
24673var VERSION = '4.1.3';
24674var DATA_KEY = 'bs.dropdown';
24675var EVENT_KEY = "." + DATA_KEY;
24676var DATA_API_KEY = '.data-api';
24677var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
24678var ESCAPE_KEYCODE = 27;
24679var SPACE_KEYCODE = 32;
24680var TAB_KEYCODE = 9;
24681var ARROW_UP_KEYCODE = 38;
24682var ARROW_DOWN_KEYCODE = 40;
24683var RIGHT_MOUSE_BUTTON_WHICH = 3;
24684var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
24685var Event = {
24686HIDE: "hide" + EVENT_KEY,
24687HIDDEN: "hidden" + EVENT_KEY,
24688SHOW: "show" + EVENT_KEY,
24689SHOWN: "shown" + EVENT_KEY,
24690CLICK: "click" + EVENT_KEY,
24691CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
24692KEYDOWN_DATA_API: "keydown" + EVENT_KEY + DATA_API_KEY,
24693KEYUP_DATA_API: "keyup" + EVENT_KEY + DATA_API_KEY
24694};
24695var ClassName = {
24696DISABLED: 'disabled',
24697SHOW: 'show',
24698DROPUP: 'dropup',
24699DROPRIGHT: 'dropright',
24700DROPLEFT: 'dropleft',
24701MENURIGHT: 'dropdown-menu-right',
24702MENULEFT: 'dropdown-menu-left',
24703POSITION_STATIC: 'position-static'
24704};
24705var Selector = {
24706DATA_TOGGLE: '[data-toggle="dropdown"]',
24707FORM_CHILD: '.dropdown form',
24708MENU: '.dropdown-menu',
24709NAVBAR_NAV: '.navbar-nav',
24710VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
24711};
24712var AttachmentMap = {
24713TOP: 'top-start',
24714TOPEND: 'top-end',
24715BOTTOM: 'bottom-start',
24716BOTTOMEND: 'bottom-end',
24717RIGHT: 'right-start',
24718RIGHTEND: 'right-end',
24719LEFT: 'left-start',
24720LEFTEND: 'left-end'
24721};
24722var Default = {
24723offset: 0,
24724flip: true,
24725boundary: 'scrollParent',
24726reference: 'toggle',
24727display: 'dynamic'
24728};
24729var DefaultType = {
24730offset: '(number|string|function)',
24731flip: 'boolean',
24732boundary: '(string|element)',
24733reference: '(string|element)',
24734display: 'string'
24735};
24736var Dropdown = function() {
24737function Dropdown(element, config) {
24738this._element = element;
24739this._popper = null;
24740this._config = this._getConfig(config);
24741this._menu = this._getMenuElement();
24742this._inNavbar = this._detectNavbar();
24743this._addEventListeners();
24744}
24745var _proto = Dropdown.prototype;
24746_proto.toggle = function toggle() {
24747if (this._element.disabled || $$$1(this._element).hasClass(ClassName.DISABLED)) {
24748return;
24749}
24750var parent = Dropdown._getParentFromElement(this._element);
24751var isActive = $$$1(this._menu).hasClass(ClassName.SHOW);
24752Dropdown._clearMenus();
24753if (isActive) {
24754return;
24755}
24756var relatedTarget = {
24757relatedTarget: this._element
24758};
24759var showEvent = $$$1.Event(Event.SHOW, relatedTarget);
24760$$$1(parent).trigger(showEvent);
24761if (showEvent.isDefaultPrevented()) {
24762return;
24763}
24764if (!this._inNavbar) {
24765if (typeof Popper === 'undefined') {
24766throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)');
24767}
24768var referenceElement = this._element;
24769if (this._config.reference === 'parent') {
24770referenceElement = parent;
24771} else if (Util.isElement(this._config.reference)) {
24772referenceElement = this._config.reference;
24773if (typeof this._config.reference.jquery !== 'undefined') {
24774referenceElement = this._config.reference[0];
24775}
24776}
24777if (this._config.boundary !== 'scrollParent') {
24778$$$1(parent).addClass(ClassName.POSITION_STATIC);
24779}
24780this._popper = new Popper(referenceElement,this._menu,this._getPopperConfig());
24781}
24782if ('ontouchstart'in document.documentElement && $$$1(parent).closest(Selector.NAVBAR_NAV).length === 0) {
24783$$$1(document.body).children().on('mouseover', null, $$$1.noop);
24784}
24785this._element.focus();
24786this._element.setAttribute('aria-expanded', true);
24787$$$1(this._menu).toggleClass(ClassName.SHOW);
24788$$$1(parent).toggleClass(ClassName.SHOW).trigger($$$1.Event(Event.SHOWN, relatedTarget));
24789}
24790;
24791_proto.dispose = function dispose() {
24792$$$1.removeData(this._element, DATA_KEY);
24793$$$1(this._element).off(EVENT_KEY);
24794this._element = null;
24795this._menu = null;
24796if (this._popper !== null) {
24797this._popper.destroy();
24798this._popper = null;
24799}
24800}
24801;
24802_proto.update = function update() {
24803this._inNavbar = this._detectNavbar();
24804if (this._popper !== null) {
24805this._popper.scheduleUpdate();
24806}
24807}
24808;
24809_proto._addEventListeners = function _addEventListeners() {
24810var _this = this;
24811$$$1(this._element).on(Event.CLICK, function(event) {
24812event.preventDefault();
24813event.stopPropagation();
24814_this.toggle();
24815});
24816}
24817;
24818_proto._getConfig = function _getConfig(config) {
24819config = _objectSpread({}, this.constructor.Default, $$$1(this._element).data(), config);
24820Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
24821return config;
24822}
24823;
24824_proto._getMenuElement = function _getMenuElement() {
24825if (!this._menu) {
24826var parent = Dropdown._getParentFromElement(this._element);
24827if (parent) {
24828this._menu = parent.querySelector(Selector.MENU);
24829}
24830}
24831return this._menu;
24832}
24833;
24834_proto._getPlacement = function _getPlacement() {
24835var $parentDropdown = $$$1(this._element.parentNode);
24836var placement = AttachmentMap.BOTTOM;
24837if ($parentDropdown.hasClass(ClassName.DROPUP)) {
24838placement = AttachmentMap.TOP;
24839if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) {
24840placement = AttachmentMap.TOPEND;
24841}
24842} else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {
24843placement = AttachmentMap.RIGHT;
24844} else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {
24845placement = AttachmentMap.LEFT;
24846} else if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) {
24847placement = AttachmentMap.BOTTOMEND;
24848}
24849return placement;
24850}
24851;
24852_proto._detectNavbar = function _detectNavbar() {
24853return $$$1(this._element).closest('.navbar').length > 0;
24854}
24855;
24856_proto._getPopperConfig = function _getPopperConfig() {
24857var _this2 = this;
24858var offsetConf = {};
24859if (typeof this._config.offset === 'function') {
24860offsetConf.fn = function(data) {
24861data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets) || {});
24862return data;
24863}
24864;
24865} else {
24866offsetConf.offset = this._config.offset;
24867}
24868var popperConfig = {
24869placement: this._getPlacement(),
24870modifiers: {
24871offset: offsetConf,
24872flip: {
24873enabled: this._config.flip
24874},
24875preventOverflow: {
24876boundariesElement: this._config.boundary
24877}
24878}
24879};
24880if (this._config.display === 'static') {
24881popperConfig.modifiers.applyStyle = {
24882enabled: false
24883};
24884}
24885return popperConfig;
24886}
24887;
24888Dropdown._jQueryInterface = function _jQueryInterface(config) {
24889return this.each(function() {
24890var data = $$$1(this).data(DATA_KEY);
24891var _config = typeof config === 'object' ? config : null;
24892if (!data) {
24893data = new Dropdown(this,_config);
24894$$$1(this).data(DATA_KEY, data);
24895}
24896if (typeof config === 'string') {
24897if (typeof data[config] === 'undefined') {
24898throw new TypeError("No method named \"" + config + "\"");
24899}
24900data[config]();
24901}
24902});
24903}
24904;
24905Dropdown._clearMenus = function _clearMenus(event) {
24906if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
24907return;
24908}
24909var toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));
24910for (var i = 0, len = toggles.length; i < len; i++) {
24911var parent = Dropdown._getParentFromElement(toggles[i]);
24912var context = $$$1(toggles[i]).data(DATA_KEY);
24913var relatedTarget = {
24914relatedTarget: toggles[i]
24915};
24916if (event && event.type === 'click') {
24917relatedTarget.clickEvent = event;
24918}
24919if (!context) {
24920continue;
24921}
24922var dropdownMenu = context._menu;
24923if (!$$$1(parent).hasClass(ClassName.SHOW)) {
24924continue;
24925}
24926if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $$$1.contains(parent, event.target)) {
24927continue;
24928}
24929var hideEvent = $$$1.Event(Event.HIDE, relatedTarget);
24930$$$1(parent).trigger(hideEvent);
24931if (hideEvent.isDefaultPrevented()) {
24932continue;
24933}
24934if ('ontouchstart'in document.documentElement) {
24935$$$1(document.body).children().off('mouseover', null, $$$1.noop);
24936}
24937toggles[i].setAttribute('aria-expanded', 'false');
24938$$$1(dropdownMenu).removeClass(ClassName.SHOW);
24939$$$1(parent).removeClass(ClassName.SHOW).trigger($$$1.Event(Event.HIDDEN, relatedTarget));
24940}
24941}
24942;
24943Dropdown._getParentFromElement = function _getParentFromElement(element) {
24944var parent;
24945var selector = Util.getSelectorFromElement(element);
24946if (selector) {
24947parent = document.querySelector(selector);
24948}
24949return parent || element.parentNode;
24950}
24951;
24952Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
24953if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $$$1(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
24954return;
24955}
24956event.preventDefault();
24957event.stopPropagation();
24958if (this.disabled || $$$1(this).hasClass(ClassName.DISABLED)) {
24959return;
24960}
24961var parent = Dropdown._getParentFromElement(this);
24962var isActive = $$$1(parent).hasClass(ClassName.SHOW);
24963if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
24964if (event.which === ESCAPE_KEYCODE) {
24965var toggle = parent.querySelector(Selector.DATA_TOGGLE);
24966$$$1(toggle).trigger('focus');
24967}
24968$$$1(this).trigger('click');
24969return;
24970}
24971var items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS));
24972if (items.length === 0) {
24973return;
24974}
24975var index = items.indexOf(event.target);
24976if (event.which === ARROW_UP_KEYCODE && index > 0) {
24977index--;
24978}
24979if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
24980index++;
24981}
24982if (index < 0) {
24983index = 0;
24984}
24985items[index].focus();
24986}
24987;
24988_createClass(Dropdown, null, [{
24989key: "VERSION",
24990get: function get() {
24991return VERSION;
24992}
24993}, {
24994key: "Default",
24995get: function get() {
24996return Default;
24997}
24998}, {
24999key: "DefaultType",
25000get: function get() {
25001return DefaultType;
25002}
25003}]);
25004return Dropdown;
25005}();
25006$$$1(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + " " + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function(event) {
25007event.preventDefault();
25008event.stopPropagation();
25009Dropdown._jQueryInterface.call($$$1(this), 'toggle');
25010}).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function(e) {
25011e.stopPropagation();
25012});
25013$$$1.fn[NAME] = Dropdown._jQueryInterface;
25014$$$1.fn[NAME].Constructor = Dropdown;
25015$$$1.fn[NAME].noConflict = function() {
25016$$$1.fn[NAME] = JQUERY_NO_CONFLICT;
25017return Dropdown._jQueryInterface;
25018}
25019;
25020return Dropdown;
25021}($, Popper);
25022return Dropdown;
25023}
25024)));
25025;
25026/* /web/static/lib/bootstrap/js/modal.js defined in bundle 'web.assets_common' */
25027(function(global, factory) {
25028typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : (global.Modal = factory(global.jQuery, global.Util));
25029}(this, (function($, Util) {
25030'use strict';
25031$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
25032Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
25033function _defineProperties(target, props) {
25034for (var i = 0; i < props.length; i++) {
25035var descriptor = props[i];
25036descriptor.enumerable = descriptor.enumerable || false;
25037descriptor.configurable = true;
25038if ("value"in descriptor)
25039descriptor.writable = true;
25040Object.defineProperty(target, descriptor.key, descriptor);
25041}
25042}
25043function _createClass(Constructor, protoProps, staticProps) {
25044if (protoProps)
25045_defineProperties(Constructor.prototype, protoProps);
25046if (staticProps)
25047_defineProperties(Constructor, staticProps);
25048return Constructor;
25049}
25050function _defineProperty(obj, key, value) {
25051if (key in obj) {
25052Object.defineProperty(obj, key, {
25053value: value,
25054enumerable: true,
25055configurable: true,
25056writable: true
25057});
25058} else {
25059obj[key] = value;
25060}
25061return obj;
25062}
25063function _objectSpread(target) {
25064for (var i = 1; i < arguments.length; i++) {
25065var source = arguments[i] != null ? arguments[i] : {};
25066var ownKeys = Object.keys(source);
25067if (typeof Object.getOwnPropertySymbols === 'function') {
25068ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
25069return Object.getOwnPropertyDescriptor(source, sym).enumerable;
25070}));
25071}
25072ownKeys.forEach(function(key) {
25073_defineProperty(target, key, source[key]);
25074});
25075}
25076return target;
25077}
25078var Modal = function($$$1) {
25079var NAME = 'modal';
25080var VERSION = '4.1.3';
25081var DATA_KEY = 'bs.modal';
25082var EVENT_KEY = "." + DATA_KEY;
25083var DATA_API_KEY = '.data-api';
25084var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
25085var ESCAPE_KEYCODE = 27;
25086var Default = {
25087backdrop: true,
25088keyboard: true,
25089focus: true,
25090show: true
25091};
25092var DefaultType = {
25093backdrop: '(boolean|string)',
25094keyboard: 'boolean',
25095focus: 'boolean',
25096show: 'boolean'
25097};
25098var Event = {
25099HIDE: "hide" + EVENT_KEY,
25100HIDDEN: "hidden" + EVENT_KEY,
25101SHOW: "show" + EVENT_KEY,
25102SHOWN: "shown" + EVENT_KEY,
25103FOCUSIN: "focusin" + EVENT_KEY,
25104RESIZE: "resize" + EVENT_KEY,
25105CLICK_DISMISS: "click.dismiss" + EVENT_KEY,
25106KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY,
25107MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY,
25108MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY,
25109CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
25110};
25111var ClassName = {
25112SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
25113BACKDROP: 'modal-backdrop',
25114OPEN: 'modal-open',
25115FADE: 'fade',
25116SHOW: 'show'
25117};
25118var Selector = {
25119DIALOG: '.modal-dialog',
25120DATA_TOGGLE: '[data-toggle="modal"]',
25121DATA_DISMISS: '[data-dismiss="modal"]',
25122FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
25123STICKY_CONTENT: '.sticky-top'
25124};
25125var Modal = function() {
25126function Modal(element, config) {
25127this._config = this._getConfig(config);
25128this._element = element;
25129this._dialog = element.querySelector(Selector.DIALOG);
25130this._backdrop = null;
25131this._isShown = false;
25132this._isBodyOverflowing = false;
25133this._ignoreBackdropClick = false;
25134this._scrollbarWidth = 0;
25135}
25136var _proto = Modal.prototype;
25137_proto.toggle = function toggle(relatedTarget) {
25138return this._isShown ? this.hide() : this.show(relatedTarget);
25139}
25140;
25141_proto.show = function show(relatedTarget) {
25142var _this = this;
25143if (this._isTransitioning || this._isShown) {
25144return;
25145}
25146if ($$$1(this._element).hasClass(ClassName.FADE)) {
25147this._isTransitioning = true;
25148}
25149var showEvent = $$$1.Event(Event.SHOW, {
25150relatedTarget: relatedTarget
25151});
25152$$$1(this._element).trigger(showEvent);
25153if (this._isShown || showEvent.isDefaultPrevented()) {
25154return;
25155}
25156this._isShown = true;
25157this._checkScrollbar();
25158this._setScrollbar();
25159this._adjustDialog();
25160$$$1(document.body).addClass(ClassName.OPEN);
25161this._setEscapeEvent();
25162this._setResizeEvent();
25163$$$1(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function(event) {
25164return _this.hide(event);
25165});
25166$$$1(this._dialog).on(Event.MOUSEDOWN_DISMISS, function() {
25167$$$1(_this._element).one(Event.MOUSEUP_DISMISS, function(event) {
25168if ($$$1(event.target).is(_this._element)) {
25169_this._ignoreBackdropClick = true;
25170}
25171});
25172});
25173this._showBackdrop(function() {
25174return _this._showElement(relatedTarget);
25175});
25176}
25177;
25178_proto.hide = function hide(event) {
25179var _this2 = this;
25180if (event) {
25181event.preventDefault();
25182}
25183if (this._isTransitioning || !this._isShown) {
25184return;
25185}
25186var hideEvent = $$$1.Event(Event.HIDE);
25187$$$1(this._element).trigger(hideEvent);
25188if (!this._isShown || hideEvent.isDefaultPrevented()) {
25189return;
25190}
25191this._isShown = false;
25192var transition = $$$1(this._element).hasClass(ClassName.FADE);
25193if (transition) {
25194this._isTransitioning = true;
25195}
25196this._setEscapeEvent();
25197this._setResizeEvent();
25198$$$1(document).off(Event.FOCUSIN);
25199$$$1(this._element).removeClass(ClassName.SHOW);
25200$$$1(this._element).off(Event.CLICK_DISMISS);
25201$$$1(this._dialog).off(Event.MOUSEDOWN_DISMISS);
25202if (transition) {
25203var transitionDuration = Util.getTransitionDurationFromElement(this._element);
25204$$$1(this._element).one(Util.TRANSITION_END, function(event) {
25205return _this2._hideModal(event);
25206}).emulateTransitionEnd(transitionDuration);
25207} else {
25208this._hideModal();
25209}
25210}
25211;
25212_proto.dispose = function dispose() {
25213$$$1.removeData(this._element, DATA_KEY);
25214$$$1(window, document, this._element, this._backdrop).off(EVENT_KEY);
25215this._config = null;
25216this._element = null;
25217this._dialog = null;
25218this._backdrop = null;
25219this._isShown = null;
25220this._isBodyOverflowing = null;
25221this._ignoreBackdropClick = null;
25222this._scrollbarWidth = null;
25223}
25224;
25225_proto.handleUpdate = function handleUpdate() {
25226this._adjustDialog();
25227}
25228;
25229_proto._getConfig = function _getConfig(config) {
25230config = _objectSpread({}, Default, config);
25231Util.typeCheckConfig(NAME, config, DefaultType);
25232return config;
25233}
25234;
25235_proto._showElement = function _showElement(relatedTarget) {
25236var _this3 = this;
25237var transition = $$$1(this._element).hasClass(ClassName.FADE);
25238if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
25239document.body.appendChild(this._element);
25240}
25241this._element.style.display = 'block';
25242this._element.removeAttribute('aria-hidden');
25243this._element.scrollTop = 0;
25244if (transition) {
25245Util.reflow(this._element);
25246}
25247$$$1(this._element).addClass(ClassName.SHOW);
25248if (this._config.focus) {
25249this._enforceFocus();
25250}
25251var shownEvent = $$$1.Event(Event.SHOWN, {
25252relatedTarget: relatedTarget
25253});
25254var transitionComplete = function transitionComplete() {
25255if (_this3._config.focus) {
25256_this3._element.focus();
25257}
25258_this3._isTransitioning = false;
25259$$$1(_this3._element).trigger(shownEvent);
25260};
25261if (transition) {
25262var transitionDuration = Util.getTransitionDurationFromElement(this._element);
25263$$$1(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
25264} else {
25265transitionComplete();
25266}
25267}
25268;
25269_proto._enforceFocus = function _enforceFocus() {
25270var _this4 = this;
25271$$$1(document).off(Event.FOCUSIN).on(Event.FOCUSIN, function(event) {
25272if (document !== event.target && _this4._element !== event.target && $$$1(_this4._element).has(event.target).length === 0) {
25273_this4._element.focus();
25274}
25275});
25276}
25277;
25278_proto._setEscapeEvent = function _setEscapeEvent() {
25279var _this5 = this;
25280if (this._isShown && this._config.keyboard) {
25281$$$1(this._element).on(Event.KEYDOWN_DISMISS, function(event) {
25282if (event.which === ESCAPE_KEYCODE) {
25283event.preventDefault();
25284_this5.hide();
25285}
25286});
25287} else if (!this._isShown) {
25288$$$1(this._element).off(Event.KEYDOWN_DISMISS);
25289}
25290}
25291;
25292_proto._setResizeEvent = function _setResizeEvent() {
25293var _this6 = this;
25294if (this._isShown) {
25295$$$1(window).on(Event.RESIZE, function(event) {
25296return _this6.handleUpdate(event);
25297});
25298} else {
25299$$$1(window).off(Event.RESIZE);
25300}
25301}
25302;
25303_proto._hideModal = function _hideModal() {
25304var _this7 = this;
25305this._element.style.display = 'none';
25306this._element.setAttribute('aria-hidden', true);
25307this._isTransitioning = false;
25308this._showBackdrop(function() {
25309$$$1(document.body).removeClass(ClassName.OPEN);
25310_this7._resetAdjustments();
25311_this7._resetScrollbar();
25312$$$1(_this7._element).trigger(Event.HIDDEN);
25313});
25314}
25315;
25316_proto._removeBackdrop = function _removeBackdrop() {
25317if (this._backdrop) {
25318$$$1(this._backdrop).remove();
25319this._backdrop = null;
25320}
25321}
25322;
25323_proto._showBackdrop = function _showBackdrop(callback) {
25324var _this8 = this;
25325var animate = $$$1(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
25326if (this._isShown && this._config.backdrop) {
25327this._backdrop = document.createElement('div');
25328this._backdrop.className = ClassName.BACKDROP;
25329if (animate) {
25330this._backdrop.classList.add(animate);
25331}
25332$$$1(this._backdrop).appendTo(document.body);
25333$$$1(this._element).on(Event.CLICK_DISMISS, function(event) {
25334if (_this8._ignoreBackdropClick) {
25335_this8._ignoreBackdropClick = false;
25336return;
25337}
25338if (event.target !== event.currentTarget) {
25339return;
25340}
25341if (_this8._config.backdrop === 'static') {
25342_this8._element.focus();
25343} else {
25344_this8.hide();
25345}
25346});
25347if (animate) {
25348Util.reflow(this._backdrop);
25349}
25350$$$1(this._backdrop).addClass(ClassName.SHOW);
25351if (!callback) {
25352return;
25353}
25354if (!animate) {
25355callback();
25356return;
25357}
25358var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
25359$$$1(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
25360} else if (!this._isShown && this._backdrop) {
25361$$$1(this._backdrop).removeClass(ClassName.SHOW);
25362var callbackRemove = function callbackRemove() {
25363_this8._removeBackdrop();
25364if (callback) {
25365callback();
25366}
25367};
25368if ($$$1(this._element).hasClass(ClassName.FADE)) {
25369var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
25370$$$1(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
25371} else {
25372callbackRemove();
25373}
25374} else if (callback) {
25375callback();
25376}
25377}
25378;
25379_proto._adjustDialog = function _adjustDialog() {
25380var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
25381if (!this._isBodyOverflowing && isModalOverflowing) {
25382this._element.style.paddingLeft = this._scrollbarWidth + "px";
25383}
25384if (this._isBodyOverflowing && !isModalOverflowing) {
25385this._element.style.paddingRight = this._scrollbarWidth + "px";
25386}
25387}
25388;
25389_proto._resetAdjustments = function _resetAdjustments() {
25390this._element.style.paddingLeft = '';
25391this._element.style.paddingRight = '';
25392}
25393;
25394_proto._checkScrollbar = function _checkScrollbar() {
25395var rect = document.body.getBoundingClientRect();
25396this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
25397this._scrollbarWidth = this._getScrollbarWidth();
25398}
25399;
25400_proto._setScrollbar = function _setScrollbar() {
25401var _this9 = this;
25402if (this._isBodyOverflowing) {
25403var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
25404var stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT));
25405$$$1(fixedContent).each(function(index, element) {
25406var actualPadding = element.style.paddingRight;
25407var calculatedPadding = $$$1(element).css('padding-right');
25408$$$1(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
25409});
25410$$$1(stickyContent).each(function(index, element) {
25411var actualMargin = element.style.marginRight;
25412var calculatedMargin = $$$1(element).css('margin-right');
25413$$$1(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
25414});
25415var actualPadding = document.body.style.paddingRight;
25416var calculatedPadding = $$$1(document.body).css('padding-right');
25417$$$1(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
25418}
25419}
25420;
25421_proto._resetScrollbar = function _resetScrollbar() {
25422var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
25423$$$1(fixedContent).each(function(index, element) {
25424var padding = $$$1(element).data('padding-right');
25425$$$1(element).removeData('padding-right');
25426element.style.paddingRight = padding ? padding : '';
25427});
25428var elements = [].slice.call(document.querySelectorAll("" + Selector.STICKY_CONTENT));
25429$$$1(elements).each(function(index, element) {
25430var margin = $$$1(element).data('margin-right');
25431if (typeof margin !== 'undefined') {
25432$$$1(element).css('margin-right', margin).removeData('margin-right');
25433}
25434});
25435var padding = $$$1(document.body).data('padding-right');
25436$$$1(document.body).removeData('padding-right');
25437document.body.style.paddingRight = padding ? padding : '';
25438}
25439;
25440_proto._getScrollbarWidth = function _getScrollbarWidth() {
25441var scrollDiv = document.createElement('div');
25442scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
25443document.body.appendChild(scrollDiv);
25444var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
25445document.body.removeChild(scrollDiv);
25446return scrollbarWidth;
25447}
25448;
25449Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
25450return this.each(function() {
25451var data = $$$1(this).data(DATA_KEY);
25452var _config = _objectSpread({}, Default, $$$1(this).data(), typeof config === 'object' && config ? config : {});
25453if (!data) {
25454data = new Modal(this,_config);
25455$$$1(this).data(DATA_KEY, data);
25456}
25457if (typeof config === 'string') {
25458if (typeof data[config] === 'undefined') {
25459throw new TypeError("No method named \"" + config + "\"");
25460}
25461data[config](relatedTarget);
25462} else if (_config.show) {
25463data.show(relatedTarget);
25464}
25465});
25466}
25467;
25468_createClass(Modal, null, [{
25469key: "VERSION",
25470get: function get() {
25471return VERSION;
25472}
25473}, {
25474key: "Default",
25475get: function get() {
25476return Default;
25477}
25478}]);
25479return Modal;
25480}();
25481$$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function(event) {
25482var _this10 = this;
25483var target;
25484var selector = Util.getSelectorFromElement(this);
25485if (selector) {
25486target = document.querySelector(selector);
25487}
25488var config = $$$1(target).data(DATA_KEY) ? 'toggle' : _objectSpread({}, $$$1(target).data(), $$$1(this).data());
25489if (this.tagName === 'A' || this.tagName === 'AREA') {
25490event.preventDefault();
25491}
25492var $target = $$$1(target).one(Event.SHOW, function(showEvent) {
25493if (showEvent.isDefaultPrevented()) {
25494return;
25495}
25496$target.one(Event.HIDDEN, function() {
25497if ($$$1(_this10).is(':visible')) {
25498_this10.focus();
25499}
25500});
25501});
25502Modal._jQueryInterface.call($$$1(target), config, this);
25503});
25504$$$1.fn[NAME] = Modal._jQueryInterface;
25505$$$1.fn[NAME].Constructor = Modal;
25506$$$1.fn[NAME].noConflict = function() {
25507$$$1.fn[NAME] = JQUERY_NO_CONFLICT;
25508return Modal._jQueryInterface;
25509}
25510;
25511return Modal;
25512}($);
25513return Modal;
25514}
25515)));
25516;
25517/* /web/static/lib/bootstrap/js/tooltip.js defined in bundle 'web.assets_common' */
25518(function(global, factory) {
25519typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) : (global.Tooltip = factory(global.jQuery, global.Popper, global.Util));
25520}(this, (function($, Popper, Util) {
25521'use strict';
25522$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
25523Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
25524Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
25525function _defineProperties(target, props) {
25526for (var i = 0; i < props.length; i++) {
25527var descriptor = props[i];
25528descriptor.enumerable = descriptor.enumerable || false;
25529descriptor.configurable = true;
25530if ("value"in descriptor)
25531descriptor.writable = true;
25532Object.defineProperty(target, descriptor.key, descriptor);
25533}
25534}
25535function _createClass(Constructor, protoProps, staticProps) {
25536if (protoProps)
25537_defineProperties(Constructor.prototype, protoProps);
25538if (staticProps)
25539_defineProperties(Constructor, staticProps);
25540return Constructor;
25541}
25542function _defineProperty(obj, key, value) {
25543if (key in obj) {
25544Object.defineProperty(obj, key, {
25545value: value,
25546enumerable: true,
25547configurable: true,
25548writable: true
25549});
25550} else {
25551obj[key] = value;
25552}
25553return obj;
25554}
25555function _objectSpread(target) {
25556for (var i = 1; i < arguments.length; i++) {
25557var source = arguments[i] != null ? arguments[i] : {};
25558var ownKeys = Object.keys(source);
25559if (typeof Object.getOwnPropertySymbols === 'function') {
25560ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
25561return Object.getOwnPropertyDescriptor(source, sym).enumerable;
25562}));
25563}
25564ownKeys.forEach(function(key) {
25565_defineProperty(target, key, source[key]);
25566});
25567}
25568return target;
25569}
25570var Tooltip = function($$$1) {
25571var NAME = 'tooltip';
25572var VERSION = '4.1.3';
25573var DATA_KEY = 'bs.tooltip';
25574var EVENT_KEY = "." + DATA_KEY;
25575var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
25576var CLASS_PREFIX = 'bs-tooltip';
25577var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+",'g');
25578var DefaultType = {
25579animation: 'boolean',
25580template: 'string',
25581title: '(string|element|function)',
25582trigger: 'string',
25583delay: '(number|object)',
25584html: 'boolean',
25585selector: '(string|boolean)',
25586placement: '(string|function)',
25587offset: '(number|string)',
25588container: '(string|element|boolean)',
25589fallbackPlacement: '(string|array)',
25590boundary: '(string|element)'
25591};
25592var AttachmentMap = {
25593AUTO: 'auto',
25594TOP: 'top',
25595RIGHT: 'right',
25596BOTTOM: 'bottom',
25597LEFT: 'left'
25598};
25599var Default = {
25600animation: true,
25601template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
25602trigger: 'hover focus',
25603title: '',
25604delay: 0,
25605html: false,
25606selector: false,
25607placement: 'top',
25608offset: 0,
25609container: false,
25610fallbackPlacement: 'flip',
25611boundary: 'scrollParent'
25612};
25613var HoverState = {
25614SHOW: 'show',
25615OUT: 'out'
25616};
25617var Event = {
25618HIDE: "hide" + EVENT_KEY,
25619HIDDEN: "hidden" + EVENT_KEY,
25620SHOW: "show" + EVENT_KEY,
25621SHOWN: "shown" + EVENT_KEY,
25622INSERTED: "inserted" + EVENT_KEY,
25623CLICK: "click" + EVENT_KEY,
25624FOCUSIN: "focusin" + EVENT_KEY,
25625FOCUSOUT: "focusout" + EVENT_KEY,
25626MOUSEENTER: "mouseenter" + EVENT_KEY,
25627MOUSELEAVE: "mouseleave" + EVENT_KEY
25628};
25629var ClassName = {
25630FADE: 'fade',
25631SHOW: 'show'
25632};
25633var Selector = {
25634TOOLTIP: '.tooltip',
25635TOOLTIP_INNER: '.tooltip-inner',
25636ARROW: '.arrow'
25637};
25638var Trigger = {
25639HOVER: 'hover',
25640FOCUS: 'focus',
25641CLICK: 'click',
25642MANUAL: 'manual'
25643};
25644var Tooltip = function() {
25645function Tooltip(element, config) {
25646if (typeof Popper === 'undefined') {
25647throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)');
25648}
25649this._isEnabled = true;
25650this._timeout = 0;
25651this._hoverState = '';
25652this._activeTrigger = {};
25653this._popper = null;
25654this.element = element;
25655this.config = this._getConfig(config);
25656this.tip = null;
25657this._setListeners();
25658}
25659var _proto = Tooltip.prototype;
25660_proto.enable = function enable() {
25661this._isEnabled = true;
25662}
25663;
25664_proto.disable = function disable() {
25665this._isEnabled = false;
25666}
25667;
25668_proto.toggleEnabled = function toggleEnabled() {
25669this._isEnabled = !this._isEnabled;
25670}
25671;
25672_proto.toggle = function toggle(event) {
25673if (!this._isEnabled) {
25674return;
25675}
25676if (event) {
25677var dataKey = this.constructor.DATA_KEY;
25678var context = $$$1(event.currentTarget).data(dataKey);
25679if (!context) {
25680context = new this.constructor(event.currentTarget,this._getDelegateConfig());
25681$$$1(event.currentTarget).data(dataKey, context);
25682}
25683context._activeTrigger.click = !context._activeTrigger.click;
25684if (context._isWithActiveTrigger()) {
25685context._enter(null, context);
25686} else {
25687context._leave(null, context);
25688}
25689} else {
25690if ($$$1(this.getTipElement()).hasClass(ClassName.SHOW)) {
25691this._leave(null, this);
25692return;
25693}
25694this._enter(null, this);
25695}
25696}
25697;
25698_proto.dispose = function dispose() {
25699clearTimeout(this._timeout);
25700$$$1.removeData(this.element, this.constructor.DATA_KEY);
25701$$$1(this.element).off(this.constructor.EVENT_KEY);
25702$$$1(this.element).closest('.modal').off('hide.bs.modal');
25703if (this.tip) {
25704$$$1(this.tip).remove();
25705}
25706this._isEnabled = null;
25707this._timeout = null;
25708this._hoverState = null;
25709this._activeTrigger = null;
25710if (this._popper !== null) {
25711this._popper.destroy();
25712}
25713this._popper = null;
25714this.element = null;
25715this.config = null;
25716this.tip = null;
25717}
25718;
25719_proto.show = function show() {
25720var _this = this;
25721if ($$$1(this.element).css('display') === 'none') {
25722throw new Error('Please use show on visible elements');
25723}
25724var showEvent = $$$1.Event(this.constructor.Event.SHOW);
25725if (this.isWithContent() && this._isEnabled) {
25726$$$1(this.element).trigger(showEvent);
25727var isInTheDom = $$$1.contains(this.element.ownerDocument.documentElement, this.element);
25728if (showEvent.isDefaultPrevented() || !isInTheDom) {
25729return;
25730}
25731var tip = this.getTipElement();
25732var tipId = Util.getUID(this.constructor.NAME);
25733tip.setAttribute('id', tipId);
25734this.element.setAttribute('aria-describedby', tipId);
25735this.setContent();
25736if (this.config.animation) {
25737$$$1(tip).addClass(ClassName.FADE);
25738}
25739var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
25740var attachment = this._getAttachment(placement);
25741this.addAttachmentClass(attachment);
25742var container = this.config.container === false ? document.body : $$$1(document).find(this.config.container);
25743$$$1(tip).data(this.constructor.DATA_KEY, this);
25744if (!$$$1.contains(this.element.ownerDocument.documentElement, this.tip)) {
25745$$$1(tip).appendTo(container);
25746}
25747$$$1(this.element).trigger(this.constructor.Event.INSERTED);
25748this._popper = new Popper(this.element,tip,{
25749placement: attachment,
25750modifiers: {
25751offset: {
25752offset: this.config.offset
25753},
25754flip: {
25755behavior: this.config.fallbackPlacement
25756},
25757arrow: {
25758element: Selector.ARROW
25759},
25760preventOverflow: {
25761boundariesElement: this.config.boundary
25762}
25763},
25764onCreate: function onCreate(data) {
25765if (data.originalPlacement !== data.placement) {
25766_this._handlePopperPlacementChange(data);
25767}
25768},
25769onUpdate: function onUpdate(data) {
25770_this._handlePopperPlacementChange(data);
25771}
25772});
25773$$$1(tip).addClass(ClassName.SHOW);
25774if ('ontouchstart'in document.documentElement) {
25775$$$1(document.body).children().on('mouseover', null, $$$1.noop);
25776}
25777var complete = function complete() {
25778if (_this.config.animation) {
25779_this._fixTransition();
25780}
25781var prevHoverState = _this._hoverState;
25782_this._hoverState = null;
25783$$$1(_this.element).trigger(_this.constructor.Event.SHOWN);
25784if (prevHoverState === HoverState.OUT) {
25785_this._leave(null, _this);
25786}
25787};
25788if ($$$1(this.tip).hasClass(ClassName.FADE)) {
25789var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
25790$$$1(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
25791} else {
25792complete();
25793}
25794}
25795}
25796;
25797_proto.hide = function hide(callback) {
25798var _this2 = this;
25799var tip = this.getTipElement();
25800var hideEvent = $$$1.Event(this.constructor.Event.HIDE);
25801var complete = function complete() {
25802if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
25803tip.parentNode.removeChild(tip);
25804}
25805_this2._cleanTipClass();
25806_this2.element.removeAttribute('aria-describedby');
25807$$$1(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
25808if (_this2._popper !== null) {
25809_this2._popper.destroy();
25810}
25811if (callback) {
25812callback();
25813}
25814};
25815$$$1(this.element).trigger(hideEvent);
25816if (hideEvent.isDefaultPrevented()) {
25817return;
25818}
25819$$$1(tip).removeClass(ClassName.SHOW);
25820if ('ontouchstart'in document.documentElement) {
25821$$$1(document.body).children().off('mouseover', null, $$$1.noop);
25822}
25823this._activeTrigger[Trigger.CLICK] = false;
25824this._activeTrigger[Trigger.FOCUS] = false;
25825this._activeTrigger[Trigger.HOVER] = false;
25826if ($$$1(this.tip).hasClass(ClassName.FADE)) {
25827var transitionDuration = Util.getTransitionDurationFromElement(tip);
25828$$$1(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
25829} else {
25830complete();
25831}
25832this._hoverState = '';
25833}
25834;
25835_proto.update = function update() {
25836if (this._popper !== null) {
25837this._popper.scheduleUpdate();
25838}
25839}
25840;
25841_proto.isWithContent = function isWithContent() {
25842return Boolean(this.getTitle());
25843}
25844;
25845_proto.addAttachmentClass = function addAttachmentClass(attachment) {
25846$$$1(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
25847}
25848;
25849_proto.getTipElement = function getTipElement() {
25850this.tip = this.tip || $$$1(this.config.template)[0];
25851return this.tip;
25852}
25853;
25854_proto.setContent = function setContent() {
25855var tip = this.getTipElement();
25856this.setElementContent($$$1(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle());
25857$$$1(tip).removeClass(ClassName.FADE + " " + ClassName.SHOW);
25858}
25859;
25860_proto.setElementContent = function setElementContent($element, content) {
25861var html = this.config.html;
25862if (typeof content === 'object' && (content.nodeType || content.jquery)) {
25863if (html) {
25864if (!$$$1(content).parent().is($element)) {
25865$element.empty().append(content);
25866}
25867} else {
25868$element.text($$$1(content).text());
25869}
25870} else {
25871$element[html ? 'html' : 'text'](content);
25872}
25873}
25874;
25875_proto.getTitle = function getTitle() {
25876var title = this.element.getAttribute('data-original-title');
25877if (!title) {
25878title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
25879}
25880return title;
25881}
25882;
25883_proto._getAttachment = function _getAttachment(placement) {
25884return AttachmentMap[placement.toUpperCase()];
25885}
25886;
25887_proto._setListeners = function _setListeners() {
25888var _this3 = this;
25889var triggers = this.config.trigger.split(' ');
25890triggers.forEach(function(trigger) {
25891if (trigger === 'click') {
25892$$$1(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function(event) {
25893return _this3.toggle(event);
25894});
25895} else if (trigger !== Trigger.MANUAL) {
25896var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;
25897var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;
25898$$$1(_this3.element).on(eventIn, _this3.config.selector, function(event) {
25899return _this3._enter(event);
25900}).on(eventOut, _this3.config.selector, function(event) {
25901return _this3._leave(event);
25902});
25903}
25904$$$1(_this3.element).closest('.modal').on('hide.bs.modal', function() {
25905return _this3.hide();
25906});
25907});
25908if (this.config.selector) {
25909this.config = _objectSpread({}, this.config, {
25910trigger: 'manual',
25911selector: ''
25912});
25913} else {
25914this._fixTitle();
25915}
25916}
25917;
25918_proto._fixTitle = function _fixTitle() {
25919var titleType = typeof this.element.getAttribute('data-original-title');
25920if (this.element.getAttribute('title') || titleType !== 'string') {
25921this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
25922this.element.setAttribute('title', '');
25923}
25924}
25925;
25926_proto._enter = function _enter(event, context) {
25927var dataKey = this.constructor.DATA_KEY;
25928context = context || $$$1(event.currentTarget).data(dataKey);
25929if (!context) {
25930context = new this.constructor(event.currentTarget,this._getDelegateConfig());
25931$$$1(event.currentTarget).data(dataKey, context);
25932}
25933if (event) {
25934context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
25935}
25936if ($$$1(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
25937context._hoverState = HoverState.SHOW;
25938return;
25939}
25940clearTimeout(context._timeout);
25941context._hoverState = HoverState.SHOW;
25942if (!context.config.delay || !context.config.delay.show) {
25943context.show();
25944return;
25945}
25946context._timeout = setTimeout(function() {
25947if (context._hoverState === HoverState.SHOW) {
25948context.show();
25949}
25950}, context.config.delay.show);
25951}
25952;
25953_proto._leave = function _leave(event, context) {
25954var dataKey = this.constructor.DATA_KEY;
25955context = context || $$$1(event.currentTarget).data(dataKey);
25956if (!context) {
25957context = new this.constructor(event.currentTarget,this._getDelegateConfig());
25958$$$1(event.currentTarget).data(dataKey, context);
25959}
25960if (event) {
25961context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
25962}
25963if (context._isWithActiveTrigger()) {
25964return;
25965}
25966clearTimeout(context._timeout);
25967context._hoverState = HoverState.OUT;
25968if (!context.config.delay || !context.config.delay.hide) {
25969context.hide();
25970return;
25971}
25972context._timeout = setTimeout(function() {
25973if (context._hoverState === HoverState.OUT) {
25974context.hide();
25975}
25976}, context.config.delay.hide);
25977}
25978;
25979_proto._isWithActiveTrigger = function _isWithActiveTrigger() {
25980for (var trigger in this._activeTrigger) {
25981if (this._activeTrigger[trigger]) {
25982return true;
25983}
25984}
25985return false;
25986}
25987;
25988_proto._getConfig = function _getConfig(config) {
25989config = _objectSpread({}, this.constructor.Default, $$$1(this.element).data(), typeof config === 'object' && config ? config : {});
25990if (typeof config.delay === 'number') {
25991config.delay = {
25992show: config.delay,
25993hide: config.delay
25994};
25995}
25996if (typeof config.title === 'number') {
25997config.title = config.title.toString();
25998}
25999if (typeof config.content === 'number') {
26000config.content = config.content.toString();
26001}
26002Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
26003return config;
26004}
26005;
26006_proto._getDelegateConfig = function _getDelegateConfig() {
26007var config = {};
26008if (this.config) {
26009for (var key in this.config) {
26010if (this.constructor.Default[key] !== this.config[key]) {
26011config[key] = this.config[key];
26012}
26013}
26014}
26015return config;
26016}
26017;
26018_proto._cleanTipClass = function _cleanTipClass() {
26019var $tip = $$$1(this.getTipElement());
26020var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
26021if (tabClass !== null && tabClass.length) {
26022$tip.removeClass(tabClass.join(''));
26023}
26024}
26025;
26026_proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
26027var popperInstance = popperData.instance;
26028this.tip = popperInstance.popper;
26029this._cleanTipClass();
26030this.addAttachmentClass(this._getAttachment(popperData.placement));
26031}
26032;
26033_proto._fixTransition = function _fixTransition() {
26034var tip = this.getTipElement();
26035var initConfigAnimation = this.config.animation;
26036if (tip.getAttribute('x-placement') !== null) {
26037return;
26038}
26039$$$1(tip).removeClass(ClassName.FADE);
26040this.config.animation = false;
26041this.hide();
26042this.show();
26043this.config.animation = initConfigAnimation;
26044}
26045;
26046Tooltip._jQueryInterface = function _jQueryInterface(config) {
26047return this.each(function() {
26048var data = $$$1(this).data(DATA_KEY);
26049var _config = typeof config === 'object' && config;
26050if (!data && /dispose|hide/.test(config)) {
26051return;
26052}
26053if (!data) {
26054data = new Tooltip(this,_config);
26055$$$1(this).data(DATA_KEY, data);
26056}
26057if (typeof config === 'string') {
26058if (typeof data[config] === 'undefined') {
26059throw new TypeError("No method named \"" + config + "\"");
26060}
26061data[config]();
26062}
26063});
26064}
26065;
26066_createClass(Tooltip, null, [{
26067key: "VERSION",
26068get: function get() {
26069return VERSION;
26070}
26071}, {
26072key: "Default",
26073get: function get() {
26074return Default;
26075}
26076}, {
26077key: "NAME",
26078get: function get() {
26079return NAME;
26080}
26081}, {
26082key: "DATA_KEY",
26083get: function get() {
26084return DATA_KEY;
26085}
26086}, {
26087key: "Event",
26088get: function get() {
26089return Event;
26090}
26091}, {
26092key: "EVENT_KEY",
26093get: function get() {
26094return EVENT_KEY;
26095}
26096}, {
26097key: "DefaultType",
26098get: function get() {
26099return DefaultType;
26100}
26101}]);
26102return Tooltip;
26103}();
26104$$$1.fn[NAME] = Tooltip._jQueryInterface;
26105$$$1.fn[NAME].Constructor = Tooltip;
26106$$$1.fn[NAME].noConflict = function() {
26107$$$1.fn[NAME] = JQUERY_NO_CONFLICT;
26108return Tooltip._jQueryInterface;
26109}
26110;
26111return Tooltip;
26112}($, Popper);
26113return Tooltip;
26114}
26115)));
26116;
26117/* /web/static/lib/bootstrap/js/popover.js defined in bundle 'web.assets_common' */
26118(function(global, factory) {
26119typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./tooltip.js')) : typeof define === 'function' && define.amd ? define(['jquery', './tooltip.js'], factory) : (global.Popover = factory(global.jQuery, global.Tooltip));
26120}(this, (function($, Tooltip) {
26121'use strict';
26122$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
26123Tooltip = Tooltip && Tooltip.hasOwnProperty('default') ? Tooltip['default'] : Tooltip;
26124function _defineProperties(target, props) {
26125for (var i = 0; i < props.length; i++) {
26126var descriptor = props[i];
26127descriptor.enumerable = descriptor.enumerable || false;
26128descriptor.configurable = true;
26129if ("value"in descriptor)
26130descriptor.writable = true;
26131Object.defineProperty(target, descriptor.key, descriptor);
26132}
26133}
26134function _createClass(Constructor, protoProps, staticProps) {
26135if (protoProps)
26136_defineProperties(Constructor.prototype, protoProps);
26137if (staticProps)
26138_defineProperties(Constructor, staticProps);
26139return Constructor;
26140}
26141function _defineProperty(obj, key, value) {
26142if (key in obj) {
26143Object.defineProperty(obj, key, {
26144value: value,
26145enumerable: true,
26146configurable: true,
26147writable: true
26148});
26149} else {
26150obj[key] = value;
26151}
26152return obj;
26153}
26154function _objectSpread(target) {
26155for (var i = 1; i < arguments.length; i++) {
26156var source = arguments[i] != null ? arguments[i] : {};
26157var ownKeys = Object.keys(source);
26158if (typeof Object.getOwnPropertySymbols === 'function') {
26159ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
26160return Object.getOwnPropertyDescriptor(source, sym).enumerable;
26161}));
26162}
26163ownKeys.forEach(function(key) {
26164_defineProperty(target, key, source[key]);
26165});
26166}
26167return target;
26168}
26169function _inheritsLoose(subClass, superClass) {
26170subClass.prototype = Object.create(superClass.prototype);
26171subClass.prototype.constructor = subClass;
26172subClass.__proto__ = superClass;
26173}
26174var Popover = function($$$1) {
26175var NAME = 'popover';
26176var VERSION = '4.1.3';
26177var DATA_KEY = 'bs.popover';
26178var EVENT_KEY = "." + DATA_KEY;
26179var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
26180var CLASS_PREFIX = 'bs-popover';
26181var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+",'g');
26182var Default = _objectSpread({}, Tooltip.Default, {
26183placement: 'right',
26184trigger: 'click',
26185content: '',
26186template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
26187});
26188var DefaultType = _objectSpread({}, Tooltip.DefaultType, {
26189content: '(string|element|function)'
26190});
26191var ClassName = {
26192FADE: 'fade',
26193SHOW: 'show'
26194};
26195var Selector = {
26196TITLE: '.popover-header',
26197CONTENT: '.popover-body'
26198};
26199var Event = {
26200HIDE: "hide" + EVENT_KEY,
26201HIDDEN: "hidden" + EVENT_KEY,
26202SHOW: "show" + EVENT_KEY,
26203SHOWN: "shown" + EVENT_KEY,
26204INSERTED: "inserted" + EVENT_KEY,
26205CLICK: "click" + EVENT_KEY,
26206FOCUSIN: "focusin" + EVENT_KEY,
26207FOCUSOUT: "focusout" + EVENT_KEY,
26208MOUSEENTER: "mouseenter" + EVENT_KEY,
26209MOUSELEAVE: "mouseleave" + EVENT_KEY
26210};
26211var Popover = function(_Tooltip) {
26212_inheritsLoose(Popover, _Tooltip);
26213function Popover() {
26214return _Tooltip.apply(this, arguments) || this;
26215}
26216var _proto = Popover.prototype;
26217_proto.isWithContent = function isWithContent() {
26218return this.getTitle() || this._getContent();
26219}
26220;
26221_proto.addAttachmentClass = function addAttachmentClass(attachment) {
26222$$$1(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
26223}
26224;
26225_proto.getTipElement = function getTipElement() {
26226this.tip = this.tip || $$$1(this.config.template)[0];
26227return this.tip;
26228}
26229;
26230_proto.setContent = function setContent() {
26231var $tip = $$$1(this.getTipElement());
26232this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
26233var content = this._getContent();
26234if (typeof content === 'function') {
26235content = content.call(this.element);
26236}
26237this.setElementContent($tip.find(Selector.CONTENT), content);
26238$tip.removeClass(ClassName.FADE + " " + ClassName.SHOW);
26239}
26240;
26241_proto._getContent = function _getContent() {
26242return this.element.getAttribute('data-content') || this.config.content;
26243}
26244;
26245_proto._cleanTipClass = function _cleanTipClass() {
26246var $tip = $$$1(this.getTipElement());
26247var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
26248if (tabClass !== null && tabClass.length > 0) {
26249$tip.removeClass(tabClass.join(''));
26250}
26251}
26252;
26253Popover._jQueryInterface = function _jQueryInterface(config) {
26254return this.each(function() {
26255var data = $$$1(this).data(DATA_KEY);
26256var _config = typeof config === 'object' ? config : null;
26257if (!data && /destroy|hide/.test(config)) {
26258return;
26259}
26260if (!data) {
26261data = new Popover(this,_config);
26262$$$1(this).data(DATA_KEY, data);
26263}
26264if (typeof config === 'string') {
26265if (typeof data[config] === 'undefined') {
26266throw new TypeError("No method named \"" + config + "\"");
26267}
26268data[config]();
26269}
26270});
26271}
26272;
26273_createClass(Popover, null, [{
26274key: "VERSION",
26275get: function get() {
26276return VERSION;
26277}
26278}, {
26279key: "Default",
26280get: function get() {
26281return Default;
26282}
26283}, {
26284key: "NAME",
26285get: function get() {
26286return NAME;
26287}
26288}, {
26289key: "DATA_KEY",
26290get: function get() {
26291return DATA_KEY;
26292}
26293}, {
26294key: "Event",
26295get: function get() {
26296return Event;
26297}
26298}, {
26299key: "EVENT_KEY",
26300get: function get() {
26301return EVENT_KEY;
26302}
26303}, {
26304key: "DefaultType",
26305get: function get() {
26306return DefaultType;
26307}
26308}]);
26309return Popover;
26310}(Tooltip);
26311$$$1.fn[NAME] = Popover._jQueryInterface;
26312$$$1.fn[NAME].Constructor = Popover;
26313$$$1.fn[NAME].noConflict = function() {
26314$$$1.fn[NAME] = JQUERY_NO_CONFLICT;
26315return Popover._jQueryInterface;
26316}
26317;
26318return Popover;
26319}($);
26320return Popover;
26321}
26322)));
26323;
26324/* /web/static/lib/bootstrap/js/scrollspy.js defined in bundle 'web.assets_common' */
26325(function(global, factory) {
26326typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : (global.ScrollSpy = factory(global.jQuery, global.Util));
26327}(this, (function($, Util) {
26328'use strict';
26329$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
26330Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
26331function _defineProperties(target, props) {
26332for (var i = 0; i < props.length; i++) {
26333var descriptor = props[i];
26334descriptor.enumerable = descriptor.enumerable || false;
26335descriptor.configurable = true;
26336if ("value"in descriptor)
26337descriptor.writable = true;
26338Object.defineProperty(target, descriptor.key, descriptor);
26339}
26340}
26341function _createClass(Constructor, protoProps, staticProps) {
26342if (protoProps)
26343_defineProperties(Constructor.prototype, protoProps);
26344if (staticProps)
26345_defineProperties(Constructor, staticProps);
26346return Constructor;
26347}
26348function _defineProperty(obj, key, value) {
26349if (key in obj) {
26350Object.defineProperty(obj, key, {
26351value: value,
26352enumerable: true,
26353configurable: true,
26354writable: true
26355});
26356} else {
26357obj[key] = value;
26358}
26359return obj;
26360}
26361function _objectSpread(target) {
26362for (var i = 1; i < arguments.length; i++) {
26363var source = arguments[i] != null ? arguments[i] : {};
26364var ownKeys = Object.keys(source);
26365if (typeof Object.getOwnPropertySymbols === 'function') {
26366ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
26367return Object.getOwnPropertyDescriptor(source, sym).enumerable;
26368}));
26369}
26370ownKeys.forEach(function(key) {
26371_defineProperty(target, key, source[key]);
26372});
26373}
26374return target;
26375}
26376var ScrollSpy = function($$$1) {
26377var NAME = 'scrollspy';
26378var VERSION = '4.1.3';
26379var DATA_KEY = 'bs.scrollspy';
26380var EVENT_KEY = "." + DATA_KEY;
26381var DATA_API_KEY = '.data-api';
26382var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
26383var Default = {
26384offset: 10,
26385method: 'auto',
26386target: ''
26387};
26388var DefaultType = {
26389offset: 'number',
26390method: 'string',
26391target: '(string|element)'
26392};
26393var Event = {
26394ACTIVATE: "activate" + EVENT_KEY,
26395SCROLL: "scroll" + EVENT_KEY,
26396LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY
26397};
26398var ClassName = {
26399DROPDOWN_ITEM: 'dropdown-item',
26400DROPDOWN_MENU: 'dropdown-menu',
26401ACTIVE: 'active'
26402};
26403var Selector = {
26404DATA_SPY: '[data-spy="scroll"]',
26405ACTIVE: '.active',
26406NAV_LIST_GROUP: '.nav, .list-group',
26407NAV_LINKS: '.nav-link',
26408NAV_ITEMS: '.nav-item',
26409LIST_ITEMS: '.list-group-item',
26410DROPDOWN: '.dropdown',
26411DROPDOWN_ITEMS: '.dropdown-item',
26412DROPDOWN_TOGGLE: '.dropdown-toggle'
26413};
26414var OffsetMethod = {
26415OFFSET: 'offset',
26416POSITION: 'position'
26417};
26418var ScrollSpy = function() {
26419function ScrollSpy(element, config) {
26420var _this = this;
26421this._element = element;
26422this._scrollElement = element.tagName === 'BODY' ? window : element;
26423this._config = this._getConfig(config);
26424this._selector = this._config.target + " " + Selector.NAV_LINKS + "," + (this._config.target + " " + Selector.LIST_ITEMS + ",") + (this._config.target + " " + Selector.DROPDOWN_ITEMS);
26425this._offsets = [];
26426this._targets = [];
26427this._activeTarget = null;
26428this._scrollHeight = 0;
26429$$$1(this._scrollElement).on(Event.SCROLL, function(event) {
26430return _this._process(event);
26431});
26432this.refresh();
26433this._process();
26434}
26435var _proto = ScrollSpy.prototype;
26436_proto.refresh = function refresh() {
26437var _this2 = this;
26438var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
26439var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
26440var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
26441this._offsets = [];
26442this._targets = [];
26443this._scrollHeight = this._getScrollHeight();
26444var targets = [].slice.call(document.querySelectorAll(this._selector));
26445targets.map(function(element) {
26446var target;
26447var targetSelector = Util.getSelectorFromElement(element);
26448if (targetSelector) {
26449target = document.querySelector(targetSelector);
26450}
26451if (target) {
26452var targetBCR = target.getBoundingClientRect();
26453if (targetBCR.width || targetBCR.height) {
26454return [$$$1(target)[offsetMethod]().top + offsetBase, targetSelector];
26455}
26456}
26457return null;
26458}).filter(function(item) {
26459return item;
26460}).sort(function(a, b) {
26461return a[0] - b[0];
26462}).forEach(function(item) {
26463_this2._offsets.push(item[0]);
26464_this2._targets.push(item[1]);
26465});
26466}
26467;
26468_proto.dispose = function dispose() {
26469$$$1.removeData(this._element, DATA_KEY);
26470$$$1(this._scrollElement).off(EVENT_KEY);
26471this._element = null;
26472this._scrollElement = null;
26473this._config = null;
26474this._selector = null;
26475this._offsets = null;
26476this._targets = null;
26477this._activeTarget = null;
26478this._scrollHeight = null;
26479}
26480;
26481_proto._getConfig = function _getConfig(config) {
26482config = _objectSpread({}, Default, typeof config === 'object' && config ? config : {});
26483if (typeof config.target !== 'string') {
26484var id = $$$1(config.target).attr('id');
26485if (!id) {
26486id = Util.getUID(NAME);
26487$$$1(config.target).attr('id', id);
26488}
26489config.target = "#" + id;
26490}
26491Util.typeCheckConfig(NAME, config, DefaultType);
26492return config;
26493}
26494;
26495_proto._getScrollTop = function _getScrollTop() {
26496return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
26497}
26498;
26499_proto._getScrollHeight = function _getScrollHeight() {
26500return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
26501}
26502;
26503_proto._getOffsetHeight = function _getOffsetHeight() {
26504return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
26505}
26506;
26507_proto._process = function _process() {
26508var scrollTop = this._getScrollTop() + this._config.offset;
26509var scrollHeight = this._getScrollHeight();
26510var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
26511if (this._scrollHeight !== scrollHeight) {
26512this.refresh();
26513}
26514if (scrollTop >= maxScroll) {
26515var target = this._targets[this._targets.length - 1];
26516if (this._activeTarget !== target) {
26517this._activate(target);
26518}
26519return;
26520}
26521if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
26522this._activeTarget = null;
26523this._clear();
26524return;
26525}
26526var offsetLength = this._offsets.length;
26527for (var i = offsetLength; i--; ) {
26528var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
26529if (isActiveTarget) {
26530this._activate(this._targets[i]);
26531}
26532}
26533}
26534;
26535_proto._activate = function _activate(target) {
26536this._activeTarget = target;
26537this._clear();
26538var queries = this._selector.split(',');
26539queries = queries.map(function(selector) {
26540return selector + "[data-target=\"" + target + "\"]," + (selector + "[href=\"" + target + "\"]");
26541});
26542var $link = $$$1([].slice.call(document.querySelectorAll(queries.join(','))));
26543if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
26544$link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
26545$link.addClass(ClassName.ACTIVE);
26546} else {
26547$link.addClass(ClassName.ACTIVE);
26548$link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + ", " + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE);
26549$link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
26550}
26551$$$1(this._scrollElement).trigger(Event.ACTIVATE, {
26552relatedTarget: target
26553});
26554}
26555;
26556_proto._clear = function _clear() {
26557var nodes = [].slice.call(document.querySelectorAll(this._selector));
26558$$$1(nodes).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
26559}
26560;
26561ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
26562return this.each(function() {
26563var data = $$$1(this).data(DATA_KEY);
26564var _config = typeof config === 'object' && config;
26565if (!data) {
26566data = new ScrollSpy(this,_config);
26567$$$1(this).data(DATA_KEY, data);
26568}
26569if (typeof config === 'string') {
26570if (typeof data[config] === 'undefined') {
26571throw new TypeError("No method named \"" + config + "\"");
26572}
26573data[config]();
26574}
26575});
26576}
26577;
26578_createClass(ScrollSpy, null, [{
26579key: "VERSION",
26580get: function get() {
26581return VERSION;
26582}
26583}, {
26584key: "Default",
26585get: function get() {
26586return Default;
26587}
26588}]);
26589return ScrollSpy;
26590}();
26591$$$1(window).on(Event.LOAD_DATA_API, function() {
26592var scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY));
26593var scrollSpysLength = scrollSpys.length;
26594for (var i = scrollSpysLength; i--; ) {
26595var $spy = $$$1(scrollSpys[i]);
26596ScrollSpy._jQueryInterface.call($spy, $spy.data());
26597}
26598});
26599$$$1.fn[NAME] = ScrollSpy._jQueryInterface;
26600$$$1.fn[NAME].Constructor = ScrollSpy;
26601$$$1.fn[NAME].noConflict = function() {
26602$$$1.fn[NAME] = JQUERY_NO_CONFLICT;
26603return ScrollSpy._jQueryInterface;
26604}
26605;
26606return ScrollSpy;
26607}($);
26608return ScrollSpy;
26609}
26610)));
26611;
26612/* /web/static/lib/bootstrap/js/tab.js defined in bundle 'web.assets_common' */
26613(function(global, factory) {
26614typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : (global.Tab = factory(global.jQuery, global.Util));
26615}(this, (function($, Util) {
26616'use strict';
26617$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
26618Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
26619function _defineProperties(target, props) {
26620for (var i = 0; i < props.length; i++) {
26621var descriptor = props[i];
26622descriptor.enumerable = descriptor.enumerable || false;
26623descriptor.configurable = true;
26624if ("value"in descriptor)
26625descriptor.writable = true;
26626Object.defineProperty(target, descriptor.key, descriptor);
26627}
26628}
26629function _createClass(Constructor, protoProps, staticProps) {
26630if (protoProps)
26631_defineProperties(Constructor.prototype, protoProps);
26632if (staticProps)
26633_defineProperties(Constructor, staticProps);
26634return Constructor;
26635}
26636var Tab = function($$$1) {
26637var NAME = 'tab';
26638var VERSION = '4.1.3';
26639var DATA_KEY = 'bs.tab';
26640var EVENT_KEY = "." + DATA_KEY;
26641var DATA_API_KEY = '.data-api';
26642var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
26643var Event = {
26644HIDE: "hide" + EVENT_KEY,
26645HIDDEN: "hidden" + EVENT_KEY,
26646SHOW: "show" + EVENT_KEY,
26647SHOWN: "shown" + EVENT_KEY,
26648CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
26649};
26650var ClassName = {
26651DROPDOWN_MENU: 'dropdown-menu',
26652ACTIVE: 'active',
26653DISABLED: 'disabled',
26654FADE: 'fade',
26655SHOW: 'show'
26656};
26657var Selector = {
26658DROPDOWN: '.dropdown',
26659NAV_LIST_GROUP: '.nav, .list-group',
26660ACTIVE: '.active',
26661ACTIVE_UL: '> li > .active',
26662DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
26663DROPDOWN_TOGGLE: '.dropdown-toggle',
26664DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
26665};
26666var Tab = function() {
26667function Tab(element) {
26668this._element = element;
26669}
26670var _proto = Tab.prototype;
26671_proto.show = function show() {
26672var _this = this;
26673if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $$$1(this._element).hasClass(ClassName.ACTIVE) || $$$1(this._element).hasClass(ClassName.DISABLED)) {
26674return;
26675}
26676var target;
26677var previous;
26678var listElement = $$$1(this._element).closest(Selector.NAV_LIST_GROUP)[0];
26679var selector = Util.getSelectorFromElement(this._element);
26680if (listElement) {
26681var itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE;
26682previous = $$$1.makeArray($$$1(listElement).find(itemSelector));
26683previous = previous[previous.length - 1];
26684}
26685var hideEvent = $$$1.Event(Event.HIDE, {
26686relatedTarget: this._element
26687});
26688var showEvent = $$$1.Event(Event.SHOW, {
26689relatedTarget: previous
26690});
26691if (previous) {
26692$$$1(previous).trigger(hideEvent);
26693}
26694$$$1(this._element).trigger(showEvent);
26695if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
26696return;
26697}
26698if (selector) {
26699target = document.querySelector(selector);
26700}
26701this._activate(this._element, listElement);
26702var complete = function complete() {
26703var hiddenEvent = $$$1.Event(Event.HIDDEN, {
26704relatedTarget: _this._element
26705});
26706var shownEvent = $$$1.Event(Event.SHOWN, {
26707relatedTarget: previous
26708});
26709$$$1(previous).trigger(hiddenEvent);
26710$$$1(_this._element).trigger(shownEvent);
26711};
26712if (target) {
26713this._activate(target, target.parentNode, complete);
26714} else {
26715complete();
26716}
26717}
26718;
26719_proto.dispose = function dispose() {
26720$$$1.removeData(this._element, DATA_KEY);
26721this._element = null;
26722}
26723;
26724_proto._activate = function _activate(element, container, callback) {
26725var _this2 = this;
26726var activeElements;
26727if (container.nodeName === 'UL') {
26728activeElements = $$$1(container).find(Selector.ACTIVE_UL);
26729} else {
26730activeElements = $$$1(container).children(Selector.ACTIVE);
26731}
26732var active = activeElements[0];
26733var isTransitioning = callback && active && $$$1(active).hasClass(ClassName.FADE);
26734var complete = function complete() {
26735return _this2._transitionComplete(element, active, callback);
26736};
26737if (active && isTransitioning) {
26738var transitionDuration = Util.getTransitionDurationFromElement(active);
26739$$$1(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
26740} else {
26741complete();
26742}
26743}
26744;
26745_proto._transitionComplete = function _transitionComplete(element, active, callback) {
26746if (active) {
26747$$$1(active).removeClass(ClassName.SHOW + " " + ClassName.ACTIVE);
26748var dropdownChild = $$$1(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
26749if (dropdownChild) {
26750$$$1(dropdownChild).removeClass(ClassName.ACTIVE);
26751}
26752if (active.getAttribute('role') === 'tab') {
26753active.setAttribute('aria-selected', false);
26754}
26755}
26756$$$1(element).addClass(ClassName.ACTIVE);
26757if (element.getAttribute('role') === 'tab') {
26758element.setAttribute('aria-selected', true);
26759}
26760Util.reflow(element);
26761$$$1(element).addClass(ClassName.SHOW);
26762if (element.parentNode && $$$1(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
26763var dropdownElement = $$$1(element).closest(Selector.DROPDOWN)[0];
26764if (dropdownElement) {
26765var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE));
26766$$$1(dropdownToggleList).addClass(ClassName.ACTIVE);
26767}
26768element.setAttribute('aria-expanded', true);
26769}
26770if (callback) {
26771callback();
26772}
26773}
26774;
26775Tab._jQueryInterface = function _jQueryInterface(config) {
26776return this.each(function() {
26777var $this = $$$1(this);
26778var data = $this.data(DATA_KEY);
26779if (!data) {
26780data = new Tab(this);
26781$this.data(DATA_KEY, data);
26782}
26783if (typeof config === 'string') {
26784if (typeof data[config] === 'undefined') {
26785throw new TypeError("No method named \"" + config + "\"");
26786}
26787data[config]();
26788}
26789});
26790}
26791;
26792_createClass(Tab, null, [{
26793key: "VERSION",
26794get: function get() {
26795return VERSION;
26796}
26797}]);
26798return Tab;
26799}();
26800$$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function(event) {
26801event.preventDefault();
26802Tab._jQueryInterface.call($$$1(this), 'show');
26803});
26804$$$1.fn[NAME] = Tab._jQueryInterface;
26805$$$1.fn[NAME].Constructor = Tab;
26806$$$1.fn[NAME].noConflict = function() {
26807$$$1.fn[NAME] = JQUERY_NO_CONFLICT;
26808return Tab._jQueryInterface;
26809}
26810;
26811return Tab;
26812}($);
26813return Tab;
26814}
26815)));
26816;
26817/* /web/static/lib/tempusdominus/tempusdominus.js defined in bundle 'web.assets_common' */
26818if (typeof jQuery === 'undefined') {
26819throw new Error('Tempus Dominus Bootstrap4\'s requires jQuery. jQuery must be included before Tempus Dominus Bootstrap4\'s JavaScript.');
26820}
26821+function($) {
26822var version = $.fn.jquery.split(' ')[0].split('.');
26823if ((version[0] < 2 && version[1] < 9) || (version[0] === 1 && version[1] === 9 && version[2] < 1) || (version[0] >= 4)) {
26824throw new Error('Tempus Dominus Bootstrap4\'s requires at least jQuery v3.0.0 but less than v4.0.0');
26825}
26826}(jQuery);
26827if (typeof moment === 'undefined') {
26828throw new Error('Tempus Dominus Bootstrap4\'s requires moment.js. Moment.js must be included before Tempus Dominus Bootstrap4\'s JavaScript.');
26829}
26830var version = moment.version.split('.')
26831if ((version[0] <= 2 && version[1] < 17) || (version[0] >= 3)) {
26832throw new Error('Tempus Dominus Bootstrap4\'s requires at least moment.js v2.17.0 but less than v3.0.0');
26833}
26834+function() {
26835var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
26836return typeof obj;
26837}
26838: function(obj) {
26839return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
26840}
26841;
26842var _createClass = function() {
26843function defineProperties(target, props) {
26844for (var i = 0; i < props.length; i++) {
26845var descriptor = props[i];
26846descriptor.enumerable = descriptor.enumerable || false;
26847descriptor.configurable = true;
26848if ("value"in descriptor)
26849descriptor.writable = true;
26850Object.defineProperty(target, descriptor.key, descriptor);
26851}
26852}
26853return function(Constructor, protoProps, staticProps) {
26854if (protoProps)
26855defineProperties(Constructor.prototype, protoProps);
26856if (staticProps)
26857defineProperties(Constructor, staticProps);
26858return Constructor;
26859}
26860;
26861}();
26862function _possibleConstructorReturn(self, call) {
26863if (!self) {
26864throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
26865}
26866return call && (typeof call === "object" || typeof call === "function") ? call : self;
26867}
26868function _inherits(subClass, superClass) {
26869if (typeof superClass !== "function" && superClass !== null) {
26870throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
26871}
26872subClass.prototype = Object.create(superClass && superClass.prototype, {
26873constructor: {
26874value: subClass,
26875enumerable: false,
26876writable: true,
26877configurable: true
26878}
26879});
26880if (superClass)
vendor: 4,184 bytes, lines 26881-27076
26881Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
26882}
26883function _classCallCheck(instance, Constructor) {
26884if (!(instance instanceof Constructor)) {
26885throw new TypeError("Cannot call a class as a function");
26886}
26887}
26888var DateTimePicker = function($, moment) {
26889var NAME = 'datetimepicker'
26890  , DATA_KEY = '' + NAME
26891  , EVENT_KEY = '.' + DATA_KEY
26892  , DATA_API_KEY = '.data-api'
26893  , Selector = {
26894DATA_TOGGLE: '[data-toggle="' + DATA_KEY + '"]'
26895}
26896  , ClassName = {
26897INPUT: NAME + '-input'
26898}
26899  , Event = {
26900CHANGE: 'change' + EVENT_KEY,
26901BLUR: 'blur' + EVENT_KEY,
26902KEYUP: 'keyup' + EVENT_KEY,
26903KEYDOWN: 'keydown' + EVENT_KEY,
26904FOCUS: 'focus' + EVENT_KEY,
26905CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
26906UPDATE: 'update' + EVENT_KEY,
26907ERROR: 'error' + EVENT_KEY,
26908HIDE: 'hide' + EVENT_KEY,
26909SHOW: 'show' + EVENT_KEY
26910}
26911  , DatePickerModes = [{
26912CLASS_NAME: 'days',
26913NAV_FUNCTION: 'M',
26914NAV_STEP: 1
26915}, {
26916CLASS_NAME: 'months',
26917NAV_FUNCTION: 'y',
26918NAV_STEP: 1
26919}, {
26920CLASS_NAME: 'years',
26921NAV_FUNCTION: 'y',
26922NAV_STEP: 10
26923}, {
26924CLASS_NAME: 'decades',
26925NAV_FUNCTION: 'y',
26926NAV_STEP: 100
26927}]
26928  , KeyMap = {
26929'up': 38,
2693038: 'up',
26931'down': 40,
2693240: 'down',
26933'left': 37,
2693437: 'left',
26935'right': 39,
2693639: 'right',
26937'tab': 9,
269389: 'tab',
26939'escape': 27,
2694027: 'escape',
26941'enter': 13,
2694213: 'enter',
26943'pageUp': 33,
2694433: 'pageUp',
26945'pageDown': 34,
2694634: 'pageDown',
26947'shift': 16,
2694816: 'shift',
26949'control': 17,
2695017: 'control',
26951'space': 32,
2695232: 'space',
26953't': 84,
2695484: 't',
26955'delete': 46,
2695646: 'delete'
26957}
26958  , ViewModes = ['times', 'days', 'months', 'years', 'decades']
26959  , keyState = {}
26960  , keyPressHandled = {};
26961var MinViewModeNumber = 0
26962  , Default = {
26963timeZone: '',
26964format: false,
26965dayViewHeaderFormat: 'MMMM YYYY',
26966extraFormats: false,
26967stepping: 1,
26968minDate: false,
26969maxDate: false,
26970useCurrent: true,
26971collapse: true,
26972locale: moment.locale(),
26973defaultDate: false,
26974disabledDates: false,
26975enabledDates: false,
26976icons: {
26977time: 'fa fa-clock-o',
26978date: 'fa fa-calendar',
26979up: 'fa fa-arrow-up',
26980down: 'fa fa-arrow-down',
26981previous: 'fa fa-chevron-left',
26982next: 'fa fa-chevron-right',
26983today: 'fa fa-calendar-check-o',
26984clear: 'fa fa-delete',
26985close: 'fa fa-times'
26986},
26987tooltips: {
26988today: 'Go to today',
26989clear: 'Clear selection',
26990close: 'Close the picker',
26991selectMonth: 'Select Month',
26992prevMonth: 'Previous Month',
26993nextMonth: 'Next Month',
26994selectYear: 'Select Year',
26995prevYear: 'Previous Year',
26996nextYear: 'Next Year',
26997selectDecade: 'Select Decade',
26998prevDecade: 'Previous Decade',
26999nextDecade: 'Next Decade',
27000prevCentury: 'Previous Century',
27001nextCentury: 'Next Century',
27002pickHour: 'Pick Hour',
27003incrementHour: 'Increment Hour',
27004decrementHour: 'Decrement Hour',
27005pickMinute: 'Pick Minute',
27006incrementMinute: 'Increment Minute',
27007decrementMinute: 'Decrement Minute',
27008pickSecond: 'Pick Second',
27009incrementSecond: 'Increment Second',
27010decrementSecond: 'Decrement Second',
27011togglePeriod: 'Toggle Period',
27012selectTime: 'Select Time',
27013selectDate: 'Select Date'
27014},
27015useStrict: false,
27016sideBySide: false,
27017daysOfWeekDisabled: false,
27018calendarWeeks: false,
27019viewMode: 'days',
27020toolbarPlacement: 'default',
27021buttons: {
27022showToday: false,
27023showClear: false,
27024showClose: false
27025},
27026widgetPositioning: {
27027horizontal: 'auto',
27028vertical: 'auto'
27029},
27030widgetParent: null,
27031ignoreReadonly: false,
27032keepOpen: false,
27033focusOnShow: true,
27034inline: false,
27035keepInvalid: false,
27036keyBinds: {
27037up: function up() {
27038if (!this.widget) {
27039return false;
27040}
27041var d = this._dates[0] || this.getMoment();
27042if (this.widget.find('.datepicker').is(':visible')) {
27043this.date(d.clone().subtract(7, 'd'));
27044} else {
27045this.date(d.clone().add(this.stepping(), 'm'));
27046}
27047return true;
27048},
27049down: function down() {
27050if (!this.widget) {
27051this.show();
27052return false;
27053}
27054var d = this._dates[0] || this.getMoment();
27055if (this.widget.find('.datepicker').is(':visible')) {
27056this.date(d.clone().add(7, 'd'));
27057} else {
27058this.date(d.clone().subtract(this.stepping(), 'm'));
27059}
27060return true;
27061},
27062'control up': function controlUp() {
27063if (!this.widget) {
27064return false;
27065}
27066var d = this._dates[0] || this.getMoment();
27067if (this.widget.find('.datepicker').is(':visible')) {
27068this.date(d.clone().subtract(1, 'y'));
27069} else {
27070this.date(d.clone().add(1, 'h'));
27071}
27072return true;
27073},
27074'control down': function controlDown() {
27075if (!this.widget) {
27076return false;
27077}
27078var d = this._dates[0] || this.getMoment();
27079if (this.widget.find('.datepicker').is(':visible')) {
27080this.date(d.clone().add(1, 'y'));
27081} else {
27082this.date(d.clone().subtract(1, 'h'));
27083}
27084return true;
27085},
27086left: function left() {
27087if (!this.widget) {
27088return false;
27089}
27090var d = this._dates[0] || this.getMoment();
27091if (this.widget.find('.datepicker').is(':visible')) {
27092this.date(d.clone().subtract(1, 'd'));
27093}
27094return true;
27095},
27096right: function right() {
27097if (!this.widget) {
27098return false;
27099}
27100var d = this._dates[0] || this.getMoment();
27101if (this.widget.find('.datepicker').is(':visible')) {
27102this.date(d.clone().add(1, 'd'));
27103}
27104return true;
27105},
27106pageUp: function pageUp() {
27107if (!this.widget) {
27108return false;
27109}
27110var d = this._dates[0] || this.getMoment();
27111if (this.widget.find('.datepicker').is(':visible')) {
27112this.date(d.clone().subtract(1, 'M'));
27113}
27114return true;
27115},
27116pageDown: function pageDown() {
27117if (!this.widget) {
27118return false;
27119}
27120var d = this._dates[0] || this.getMoment();
27121if (this.widget.find('.datepicker').is(':visible')) {
27122this.date(d.clone().add(1, 'M'));
27123}
27124return true;
27125},
27126enter: function enter() {
27127if (!this.widget) {
27128return false;
27129}
27130this.hide();
27131return true;
27132},
27133escape: function escape() {
27134if (!this.widget) {
27135return false;
27136}
27137this.hide();
27138return true;
27139},
27140'control space': function controlSpace() {
27141if (!this.widget) {
27142return false;
27143}
27144if (this.widget.find('.timepicker').is(':visible')) {
27145this.widget.find('.btn[data-action="togglePeriod"]').click();
27146}
27147return true;
27148},
27149t: function t() {
27150if (!this.widget) {
27151return false;
27152}
27153this.date(this.getMoment());
27154return true;
27155},
27156'delete': function _delete() {
27157if (!this.widget) {
27158return false;
27159}
27160this.clear();
27161return true;
27162}
27163},
27164debug: false,
27165allowInputToggle: false,
27166disabledTimeIntervals: false,
27167disabledHours: false,
27168enabledHours: false,
27169viewDate: false,
27170allowMultidate: false,
27171multidateSeparator: ','
27172};
27173var DateTimePicker = function() {
27174function DateTimePicker(element, options) {
27175_classCallCheck(this, DateTimePicker);
27176this._options = this._getOptions(options);
27177this._element = element;
27178this._dates = [];
27179this._datesFormatted = [];
27180this._viewDate = null;
27181this.unset = true;
27182this.component = false;
27183this.widget = false;
27184this.use24Hours = null;
27185this.actualFormat = null;
27186this.parseFormats = null;
27187this.currentViewMode = null;
27188this._int();
27189}
27190DateTimePicker.prototype._int = function _int() {
27191var targetInput = this._element.data('target-input');
27192if (this._element.is('input')) {
27193this.input = this._element;
27194} else if (targetInput !== undefined) {
27195if (targetInput === 'nearest') {
27196this.input = this._element.find('input');
27197} else {
27198this.input = $(targetInput);
27199}
27200}
27201this._dates = [];
27202this._dates[0] = this.getMoment();
27203this._viewDate = this.getMoment().clone();
27204$.extend(true, this._options, this._dataToOptions());
27205this.options(this._options);
27206this._initFormatting();
27207if (this.input !== undefined && this.input.is('input') && this.input.val().trim().length !== 0) {
27208this._setValue(this._parseInputDate(this.input.val().trim()), 0);
27209} else if (this._options.defaultDate && this.input !== undefined && this.input.attr('placeholder') === undefined) {
27210this._setValue(this._options.defaultDate, 0);
27211}
27212if (this._options.inline) {
27213this.show();
27214}
27215}
27216;
27217DateTimePicker.prototype._update = function _update() {
27218if (!this.widget) {
27219return;
27220}
27221this._fillDate();
27222this._fillTime();
27223}
27224;
27225DateTimePicker.prototype._setValue = function _setValue(targetMoment, index) {
27226var oldDate = this.unset ? null : this._dates[index];
27227var outpValue = '';
27228if (!targetMoment) {
27229if (!this._options.allowMultidate || this._dates.length === 1) {
27230this.unset = true;
27231this._dates = [];
27232this._datesFormatted = [];
27233} else {
27234outpValue = this._element.data('date') + ',';
27235outpValue = outpValue.replace(oldDate.format(this.actualFormat) + ',', '').replace(',,', '').replace(/,\s*$/, '');
27236this._dates.splice(index, 1);
27237this._datesFormatted.splice(index, 1);
27238}
27239if (this.input !== undefined) {
27240this.input.val(outpValue);
27241this.input.trigger('input');
27242}
27243this._element.data('date', outpValue);
27244this._notifyEvent({
27245type: DateTimePicker.Event.CHANGE,
27246date: false,
27247oldDate: oldDate
27248});
27249this._update();
27250return;
27251}
27252targetMoment = targetMoment.clone().locale(this._options.locale);
27253if (this._hasTimeZone()) {
27254targetMoment.tz(this._options.timeZone);
27255}
27256if (this._options.stepping !== 1) {
27257targetMoment.minutes(Math.round(targetMoment.minutes() / this._options.stepping) * this._options.stepping).seconds(0);
27258}
27259if (this._isValid(targetMoment)) {
27260this._dates[index] = targetMoment;
27261this._datesFormatted[index] = targetMoment.format('YYYY-MM-DD');
27262this._viewDate = targetMoment.clone();
27263if (this._options.allowMultidate && this._dates.length > 1) {
27264for (var i = 0; i < this._dates.length; i++) {
27265outpValue += '' + this._dates[i].format(this.actualFormat) + this._options.multidateSeparator;
27266}
27267outpValue = outpValue.replace(/,\s*$/, '');
27268} else {
27269outpValue = this._dates[index].format(this.actualFormat);
27270}
27271if (this.input !== undefined) {
27272this.input.val(outpValue);
27273this.input.trigger('input');
27274}
27275this._element.data('date', outpValue);
27276this.unset = false;
27277this._update();
27278this._notifyEvent({
27279type: DateTimePicker.Event.CHANGE,
27280date: this._dates[index].clone(),
27281oldDate: oldDate
27282});
27283} else {
27284if (!this._options.keepInvalid) {
27285if (this.input !== undefined) {
27286this.input.val('' + (this.unset ? '' : this._dates[index].format(this.actualFormat)));
27287this.input.trigger('input');
27288}
27289} else {
27290this._notifyEvent({
27291type: DateTimePicker.Event.CHANGE,
27292date: targetMoment,
27293oldDate: oldDate
27294});
27295}
27296this._notifyEvent({
27297type: DateTimePicker.Event.ERROR,
27298date: targetMoment,
27299oldDate: oldDate
27300});
27301}
27302}
27303;
27304DateTimePicker.prototype._change = function _change(e) {
27305var val = $(e.target).val().trim()
27306  , parsedDate = val ? this._parseInputDate(val) : null;
27307this._setValue(parsedDate);
27308e.stopImmediatePropagation();
27309return false;
27310}
27311;
27312DateTimePicker.prototype._getOptions = function _getOptions(options) {
27313options = $.extend(true, {}, Default, options);
27314return options;
27315}
27316;
27317DateTimePicker.prototype._hasTimeZone = function _hasTimeZone() {
27318return moment.tz !== undefined && this._options.timeZone !== undefined && this._options.timeZone !== null && this._options.timeZone !== '';
27319}
27320;
27321DateTimePicker.prototype._isEnabled = function _isEnabled(granularity) {
27322if (typeof granularity !== 'string' || granularity.length > 1) {
27323throw new TypeError('isEnabled expects a single character string parameter');
27324}
27325switch (granularity) {
27326case 'y':
27327return this.actualFormat.indexOf('Y') !== -1;
27328case 'M':
27329return this.actualFormat.indexOf('M') !== -1;
27330case 'd':
27331return this.actualFormat.toLowerCase().indexOf('d') !== -1;
27332case 'h':
27333case 'H':
27334return this.actualFormat.toLowerCase().indexOf('h') !== -1;
27335case 'm':
27336return this.actualFormat.indexOf('m') !== -1;
27337case 's':
27338return this.actualFormat.indexOf('s') !== -1;
27339case 'a':
27340case 'A':
27341return this.actualFormat.toLowerCase().indexOf('a') !== -1;
27342default:
27343return false;
27344}
27345}
27346;
27347DateTimePicker.prototype._hasTime = function _hasTime() {
27348return this._isEnabled('h') || this._isEnabled('m') || this._isEnabled('s');
27349}
27350;
27351DateTimePicker.prototype._hasDate = function _hasDate() {
27352return this._isEnabled('y') || this._isEnabled('M') || this._isEnabled('d');
27353}
27354;
27355DateTimePicker.prototype._dataToOptions = function _dataToOptions() {
27356var eData = this._element.data();
27357var dataOptions = {};
27358if (eData.dateOptions && eData.dateOptions instanceof Object) {
27359dataOptions = $.extend(true, dataOptions, eData.dateOptions);
27360}
27361$.each(this._options, function(key) {
27362var attributeName = 'date' + key.charAt(0).toUpperCase() + key.slice(1);
27363if (eData[attributeName] !== undefined) {
27364dataOptions[key] = eData[attributeName];
27365} else {
27366delete dataOptions[key];
27367}
27368});
27369return dataOptions;
27370}
27371;
27372DateTimePicker.prototype._notifyEvent = function _notifyEvent(e) {
27373if (e.type === DateTimePicker.Event.CHANGE) {
27374if (!e.date && !e.oldDate) {
27375return;
27376}
27377var bothUTC = e.date && e.oldDate && e.date._isUTC === e.oldDate._isUTC;
27378if (bothUTC && e.date.isSame(e.oldDate)) {
27379return;
27380}
27381}
27382this._element.trigger(e);
27383}
27384;
27385DateTimePicker.prototype._viewUpdate = function _viewUpdate(e) {
27386if (e === 'y') {
27387e = 'YYYY';
27388}
27389this._notifyEvent({
27390type: DateTimePicker.Event.UPDATE,
27391change: e,
27392viewDate: this._viewDate.clone()
27393});
27394}
27395;
27396DateTimePicker.prototype._showMode = function _showMode(dir) {
27397if (!this.widget) {
27398return;
27399}
27400if (dir) {
27401this.currentViewMode = Math.max(MinViewModeNumber, Math.min(3, this.currentViewMode + dir));
27402}
27403this.widget.find('.datepicker > div').hide().filter('.datepicker-' + DatePickerModes[this.currentViewMode].CLASS_NAME).show();
27404}
27405;
27406DateTimePicker.prototype._isInDisabledDates = function _isInDisabledDates(testDate) {
27407return this._options.disabledDates[testDate.format('YYYY-MM-DD')] === true;
27408}
27409;
27410DateTimePicker.prototype._isInEnabledDates = function _isInEnabledDates(testDate) {
27411return this._options.enabledDates[testDate.format('YYYY-MM-DD')] === true;
27412}
27413;
27414DateTimePicker.prototype._isInDisabledHours = function _isInDisabledHours(testDate) {
27415return this._options.disabledHours[testDate.format('H')] === true;
27416}
27417;
27418DateTimePicker.prototype._isInEnabledHours = function _isInEnabledHours(testDate) {
27419return this._options.enabledHours[testDate.format('H')] === true;
27420}
27421;
27422DateTimePicker.prototype._isValid = function _isValid(targetMoment, granularity) {
27423if (!targetMoment.isValid()) {
27424return false;
vendor: 21,092 bytes, lines 27425-28113
27425}
27426if (this._options.disabledDates && granularity === 'd' && this._isInDisabledDates(targetMoment)) {
27427return false;
27428}
27429if (this._options.enabledDates && granularity === 'd' && !this._isInEnabledDates(targetMoment)) {
27430return false;
27431}
27432if (this._options.minDate && targetMoment.isBefore(this._options.minDate, granularity)) {
27433return false;
27434}
27435if (this._options.maxDate && targetMoment.isAfter(this._options.maxDate, granularity)) {
27436return false;
27437}
27438if (this._options.daysOfWeekDisabled && granularity === 'd' && this._options.daysOfWeekDisabled.indexOf(targetMoment.day()) !== -1) {
27439return false;
27440}
27441if (this._options.disabledHours && (granularity === 'h' || granularity === 'm' || granularity === 's') && this._isInDisabledHours(targetMoment)) {
27442return false;
27443}
27444if (this._options.enabledHours && (granularity === 'h' || granularity === 'm' || granularity === 's') && !this._isInEnabledHours(targetMoment)) {
27445return false;
27446}
27447if (this._options.disabledTimeIntervals && (granularity === 'h' || granularity === 'm' || granularity === 's')) {
27448var found = false;
27449$.each(this._options.disabledTimeIntervals, function() {
27450if (targetMoment.isBetween(this[0], this[1])) {
27451found = true;
27452return false;
27453}
27454});
27455if (found) {
27456return false;
27457}
27458}
27459return true;
27460}
27461;
27462DateTimePicker.prototype._parseInputDate = function _parseInputDate(inputDate) {
27463if (this._options.parseInputDate === undefined) {
27464if (!moment.isMoment(inputDate)) {
27465inputDate = this.getMoment(inputDate);
27466}
27467} else {
27468inputDate = this._options.parseInputDate(inputDate);
27469}
27470return inputDate;
27471}
27472;
27473DateTimePicker.prototype._keydown = function _keydown(e) {
27474var handler = null
27475  , index = void 0
27476  , index2 = void 0
27477  , keyBindKeys = void 0
27478  , allModifiersPressed = void 0;
27479var pressedKeys = []
27480  , pressedModifiers = {}
27481  , currentKey = e.which
27482  , pressed = 'p';
27483keyState[currentKey] = pressed;
27484for (index in keyState) {
27485if (keyState.hasOwnProperty(index) && keyState[index] === pressed) {
27486pressedKeys.push(index);
27487if (parseInt(index, 10) !== currentKey) {
27488pressedModifiers[index] = true;
27489}
27490}
27491}
27492for (index in this._options.keyBinds) {
27493if (this._options.keyBinds.hasOwnProperty(index) && typeof this._options.keyBinds[index] === 'function') {
27494keyBindKeys = index.split(' ');
27495if (keyBindKeys.length === pressedKeys.length && KeyMap[currentKey] === keyBindKeys[keyBindKeys.length - 1]) {
27496allModifiersPressed = true;
27497for (index2 = keyBindKeys.length - 2; index2 >= 0; index2--) {
27498if (!(KeyMap[keyBindKeys[index2]]in pressedModifiers)) {
27499allModifiersPressed = false;
27500break;
27501}
27502}
27503if (allModifiersPressed) {
27504handler = this._options.keyBinds[index];
27505break;
27506}
27507}
27508}
27509}
27510if (handler) {
27511if (handler.call(this)) {
27512e.stopPropagation();
27513e.preventDefault();
27514}
27515}
27516}
27517;
27518DateTimePicker.prototype._keyup = function _keyup(e) {
27519keyState[e.which] = 'r';
27520if (keyPressHandled[e.which]) {
27521keyPressHandled[e.which] = false;
27522e.stopPropagation();
27523e.preventDefault();
27524}
27525}
27526;
27527DateTimePicker.prototype._indexGivenDates = function _indexGivenDates(givenDatesArray) {
27528var givenDatesIndexed = {}
27529  , self = this;
27530$.each(givenDatesArray, function() {
27531var dDate = self._parseInputDate(this);
27532if (dDate.isValid()) {
27533givenDatesIndexed[dDate.format('YYYY-MM-DD')] = true;
27534}
27535});
27536return Object.keys(givenDatesIndexed).length ? givenDatesIndexed : false;
27537}
27538;
27539DateTimePicker.prototype._indexGivenHours = function _indexGivenHours(givenHoursArray) {
27540var givenHoursIndexed = {};
27541$.each(givenHoursArray, function() {
27542givenHoursIndexed[this] = true;
27543});
27544return Object.keys(givenHoursIndexed).length ? givenHoursIndexed : false;
27545}
27546;
27547DateTimePicker.prototype._initFormatting = function _initFormatting() {
27548var format = this._options.format || 'L LT'
27549  , self = this;
27550this.actualFormat = format.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function(formatInput) {
27551return self._dates[0].localeData().longDateFormat(formatInput) || formatInput;
27552});
27553this.parseFormats = this._options.extraFormats ? this._options.extraFormats.slice() : [];
27554if (this.parseFormats.indexOf(format) < 0 && this.parseFormats.indexOf(this.actualFormat) < 0) {
27555this.parseFormats.push(this.actualFormat);
27556}
27557this.use24Hours = this.actualFormat.toLowerCase().indexOf('a') < 1 && this.actualFormat.replace(/\[.*?]/g, '').indexOf('h') < 1;
27558if (this._isEnabled('y')) {
27559MinViewModeNumber = 2;
27560}
27561if (this._isEnabled('M')) {
27562MinViewModeNumber = 1;
27563}
27564if (this._isEnabled('d')) {
27565MinViewModeNumber = 0;
27566}
27567this.currentViewMode = Math.max(MinViewModeNumber, this.currentViewMode);
27568if (!this.unset) {
27569this._setValue(this._dates[0], 0);
27570}
27571}
27572;
27573DateTimePicker.prototype._getLastPickedDate = function _getLastPickedDate() {
27574return this._dates[this._getLastPickedDateIndex()] || this.getMoment();
27575}
27576;
27577DateTimePicker.prototype._getLastPickedDateIndex = function _getLastPickedDateIndex() {
27578return this._dates.length - 1;
27579}
27580;
27581DateTimePicker.prototype.getMoment = function getMoment(d) {
27582var returnMoment = void 0;
27583if (d === undefined || d === null) {
27584returnMoment = moment();
27585} else if (this._hasTimeZone()) {
27586returnMoment = moment.tz(d, this.parseFormats, this._options.locale, this._options.useStrict, this._options.timeZone);
27587} else {
27588returnMoment = moment(d, this.parseFormats, this._options.locale, this._options.useStrict);
27589}
27590if (this._hasTimeZone()) {
27591returnMoment.tz(this._options.timeZone);
27592}
27593return returnMoment;
27594}
27595;
27596DateTimePicker.prototype.toggle = function toggle() {
27597return this.widget ? this.hide() : this.show();
27598}
27599;
27600DateTimePicker.prototype.ignoreReadonly = function ignoreReadonly(_ignoreReadonly) {
27601if (arguments.length === 0) {
27602return this._options.ignoreReadonly;
27603}
27604if (typeof _ignoreReadonly !== 'boolean') {
27605throw new TypeError('ignoreReadonly () expects a boolean parameter');
27606}
27607this._options.ignoreReadonly = _ignoreReadonly;
27608}
27609;
27610DateTimePicker.prototype.options = function options(newOptions) {
27611if (arguments.length === 0) {
27612return $.extend(true, {}, this._options);
27613}
27614if (!(newOptions instanceof Object)) {
27615throw new TypeError('options() this.options parameter should be an object');
27616}
27617$.extend(true, this._options, newOptions);
27618var self = this;
27619$.each(this._options, function(key, value) {
27620if (self[key] !== undefined) {
27621self[key](value);
27622}
27623});
27624}
27625;
27626DateTimePicker.prototype.date = function date(newDate, index) {
27627index = index || 0;
27628if (arguments.length === 0) {
27629if (this.unset) {
27630return null;
27631}
27632if (this._options.allowMultidate) {
27633return this._dates.join(this._options.multidateSeparator);
27634} else {
27635return this._dates[index].clone();
27636}
27637}
27638if (newDate !== null && typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) {
27639throw new TypeError('date() parameter must be one of [null, string, moment or Date]');
27640}
27641this._setValue(newDate === null ? null : this._parseInputDate(newDate), index);
27642}
27643;
27644DateTimePicker.prototype.format = function format(newFormat) {
27645if (arguments.length === 0) {
27646return this._options.format;
27647}
27648if (typeof newFormat !== 'string' && (typeof newFormat !== 'boolean' || newFormat !== false)) {
27649throw new TypeError('format() expects a string or boolean:false parameter ' + newFormat);
27650}
27651this._options.format = newFormat;
27652if (this.actualFormat) {
27653this._initFormatting();
27654}
27655}
27656;
27657DateTimePicker.prototype.timeZone = function timeZone(newZone) {
27658if (arguments.length === 0) {
27659return this._options.timeZone;
27660}
27661if (typeof newZone !== 'string') {
27662throw new TypeError('newZone() expects a string parameter');
27663}
27664this._options.timeZone = newZone;
27665}
27666;
27667DateTimePicker.prototype.dayViewHeaderFormat = function dayViewHeaderFormat(newFormat) {
27668if (arguments.length === 0) {
27669return this._options.dayViewHeaderFormat;
27670}
27671if (typeof newFormat !== 'string') {
27672throw new TypeError('dayViewHeaderFormat() expects a string parameter');
27673}
27674this._options.dayViewHeaderFormat = newFormat;
27675}
27676;
27677DateTimePicker.prototype.extraFormats = function extraFormats(formats) {
27678if (arguments.length === 0) {
27679return this._options.extraFormats;
27680}
27681if (formats !== false && !(formats instanceof Array)) {
27682throw new TypeError('extraFormats() expects an array or false parameter');
27683}
27684this._options.extraFormats = formats;
27685if (this.parseFormats) {
27686this._initFormatting();
27687}
27688}
27689;
27690DateTimePicker.prototype.disabledDates = function disabledDates(dates) {
27691if (arguments.length === 0) {
27692return this._options.disabledDates ? $.extend({}, this._options.disabledDates) : this._options.disabledDates;
27693}
27694if (!dates) {
27695this._options.disabledDates = false;
27696this._update();
27697return true;
27698}
27699if (!(dates instanceof Array)) {
27700throw new TypeError('disabledDates() expects an array parameter');
27701}
27702this._options.disabledDates = this._indexGivenDates(dates);
27703this._options.enabledDates = false;
27704this._update();
27705}
27706;
27707DateTimePicker.prototype.enabledDates = function enabledDates(dates) {
27708if (arguments.length === 0) {
27709return this._options.enabledDates ? $.extend({}, this._options.enabledDates) : this._options.enabledDates;
27710}
27711if (!dates) {
27712this._options.enabledDates = false;
27713this._update();
27714return true;
27715}
27716if (!(dates instanceof Array)) {
27717throw new TypeError('enabledDates() expects an array parameter');
27718}
27719this._options.enabledDates = this._indexGivenDates(dates);
27720this._options.disabledDates = false;
27721this._update();
27722}
27723;
27724DateTimePicker.prototype.daysOfWeekDisabled = function daysOfWeekDisabled(_daysOfWeekDisabled) {
27725if (arguments.length === 0) {
27726return this._options.daysOfWeekDisabled.splice(0);
27727}
27728if (typeof _daysOfWeekDisabled === 'boolean' && !_daysOfWeekDisabled) {
27729this._options.daysOfWeekDisabled = false;
27730this._update();
27731return true;
27732}
27733if (!(_daysOfWeekDisabled instanceof Array)) {
27734throw new TypeError('daysOfWeekDisabled() expects an array parameter');
27735}
27736this._options.daysOfWeekDisabled = _daysOfWeekDisabled.reduce(function(previousValue, currentValue) {
27737currentValue = parseInt(currentValue, 10);
27738if (currentValue > 6 || currentValue < 0 || isNaN(currentValue)) {
27739return previousValue;
27740}
27741if (previousValue.indexOf(currentValue) === -1) {
27742previousValue.push(currentValue);
27743}
27744return previousValue;
27745}, []).sort();
27746if (this._options.useCurrent && !this._options.keepInvalid) {
27747for (var i = 0; i < this._dates.length; i++) {
27748var tries = 0;
27749while (!this._isValid(this._dates[i], 'd')) {
27750this._dates[i].add(1, 'd');
27751if (tries === 31) {
27752throw 'Tried 31 times to find a valid date';
27753}
27754tries++;
27755}
27756this._setValue(this._dates[i], i);
27757}
27758}
27759this._update();
27760}
27761;
27762DateTimePicker.prototype.maxDate = function maxDate(_maxDate) {
27763if (arguments.length === 0) {
27764return this._options.maxDate ? this._options.maxDate.clone() : this._options.maxDate;
27765}
27766if (typeof _maxDate === 'boolean' && _maxDate === false) {
27767this._options.maxDate = false;
27768this._update();
27769return true;
27770}
27771if (typeof _maxDate === 'string') {
27772if (_maxDate === 'now' || _maxDate === 'moment') {
27773_maxDate = this.getMoment();
27774}
27775}
27776var parsedDate = this._parseInputDate(_maxDate);
27777if (!parsedDate.isValid()) {
27778throw new TypeError('maxDate() Could not parse date parameter: ' + _maxDate);
27779}
27780if (this._options.minDate && parsedDate.isBefore(this._options.minDate)) {
27781throw new TypeError('maxDate() date parameter is before this.options.minDate: ' + parsedDate.format(this.actualFormat));
27782}
27783this._options.maxDate = parsedDate;
27784for (var i = 0; i < this._dates.length; i++) {
27785if (this._options.useCurrent && !this._options.keepInvalid && this._dates[i].isAfter(_maxDate)) {
27786this._setValue(this._options.maxDate, i);
27787}
27788}
27789if (this._viewDate.isAfter(parsedDate)) {
27790this._viewDate = parsedDate.clone().subtract(this._options.stepping, 'm');
27791}
27792this._update();
27793}
27794;
27795DateTimePicker.prototype.minDate = function minDate(_minDate) {
27796if (arguments.length === 0) {
27797return this._options.minDate ? this._options.minDate.clone() : this._options.minDate;
27798}
27799if (typeof _minDate === 'boolean' && _minDate === false) {
27800this._options.minDate = false;
27801this._update();
27802return true;
27803}
27804if (typeof _minDate === 'string') {
27805if (_minDate === 'now' || _minDate === 'moment') {
27806_minDate = this.getMoment();
27807}
27808}
27809var parsedDate = this._parseInputDate(_minDate);
27810if (!parsedDate.isValid()) {
27811throw new TypeError('minDate() Could not parse date parameter: ' + _minDate);
27812}
27813if (this._options.maxDate && parsedDate.isAfter(this._options.maxDate)) {
27814throw new TypeError('minDate() date parameter is after this.options.maxDate: ' + parsedDate.format(this.actualFormat));
27815}
27816this._options.minDate = parsedDate;
27817for (var i = 0; i < this._dates.length; i++) {
27818if (this._options.useCurrent && !this._options.keepInvalid && this._dates[i].isBefore(_minDate)) {
27819this._setValue(this._options.minDate, i);
27820}
27821}
27822if (this._viewDate.isBefore(parsedDate)) {
27823this._viewDate = parsedDate.clone().add(this._options.stepping, 'm');
27824}
27825this._update();
27826}
27827;
27828DateTimePicker.prototype.defaultDate = function defaultDate(_defaultDate) {
27829if (arguments.length === 0) {
27830return this._options.defaultDate ? this._options.defaultDate.clone() : this._options.defaultDate;
27831}
27832if (!_defaultDate) {
27833this._options.defaultDate = false;
27834return true;
27835}
27836if (typeof _defaultDate === 'string') {
27837if (_defaultDate === 'now' || _defaultDate === 'moment') {
27838_defaultDate = this.getMoment();
27839} else {
27840_defaultDate = this.getMoment(_defaultDate);
27841}
27842}
27843var parsedDate = this._parseInputDate(_defaultDate);
27844if (!parsedDate.isValid()) {
27845throw new TypeError('defaultDate() Could not parse date parameter: ' + _defaultDate);
27846}
27847if (!this._isValid(parsedDate)) {
27848throw new TypeError('defaultDate() date passed is invalid according to component setup validations');
27849}
27850this._options.defaultDate = parsedDate;
27851if (this._options.defaultDate && this._options.inline || this.input !== undefined && this.input.val().trim() === '') {
27852this._setValue(this._options.defaultDate, 0);
27853}
27854}
27855;
27856DateTimePicker.prototype.locale = function locale(_locale) {
27857if (arguments.length === 0) {
27858return this._options.locale;
27859}
27860if (!moment.localeData(_locale)) {
27861throw new TypeError('locale() locale ' + _locale + ' is not loaded from moment locales!');
27862}
27863this._options.locale = _locale;
27864for (var i = 0; i < this._dates.length; i++) {
27865this._dates[i].locale(this._options.locale);
27866}
27867this._viewDate.locale(this._options.locale);
27868if (this.actualFormat) {
27869this._initFormatting();
27870}
27871if (this.widget) {
27872this.hide();
27873this.show();
27874}
27875}
27876;
27877DateTimePicker.prototype.stepping = function stepping(_stepping) {
27878if (arguments.length === 0) {
27879return this._options.stepping;
27880}
27881_stepping = parseInt(_stepping, 10);
27882if (isNaN(_stepping) || _stepping < 1) {
27883_stepping = 1;
27884}
27885this._options.stepping = _stepping;
27886}
27887;
27888DateTimePicker.prototype.useCurrent = function useCurrent(_useCurrent) {
27889var useCurrentOptions = ['year', 'month', 'day', 'hour', 'minute'];
27890if (arguments.length === 0) {
27891return this._options.useCurrent;
27892}
27893if (typeof _useCurrent !== 'boolean' && typeof _useCurrent !== 'string') {
27894throw new TypeError('useCurrent() expects a boolean or string parameter');
27895}
27896if (typeof _useCurrent === 'string' && useCurrentOptions.indexOf(_useCurrent.toLowerCase()) === -1) {
27897throw new TypeError('useCurrent() expects a string parameter of ' + useCurrentOptions.join(', '));
27898}
27899this._options.useCurrent = _useCurrent;
27900}
27901;
27902DateTimePicker.prototype.collapse = function collapse(_collapse) {
27903if (arguments.length === 0) {
27904return this._options.collapse;
27905}
27906if (typeof _collapse !== 'boolean') {
27907throw new TypeError('collapse() expects a boolean parameter');
27908}
27909if (this._options.collapse === _collapse) {
27910return true;
27911}
27912this._options.collapse = _collapse;
27913if (this.widget) {
27914this.hide();
27915this.show();
27916}
27917}
27918;
27919DateTimePicker.prototype.icons = function icons(_icons) {
27920if (arguments.length === 0) {
27921return $.extend({}, this._options.icons);
27922}
27923if (!(_icons instanceof Object)) {
27924throw new TypeError('icons() expects parameter to be an Object');
27925}
27926$.extend(this._options.icons, _icons);
27927if (this.widget) {
27928this.hide();
27929this.show();
27930}
27931}
27932;
27933DateTimePicker.prototype.tooltips = function tooltips(_tooltips) {
27934if (arguments.length === 0) {
27935return $.extend({}, this._options.tooltips);
27936}
27937if (!(_tooltips instanceof Object)) {
27938throw new TypeError('tooltips() expects parameter to be an Object');
27939}
27940$.extend(this._options.tooltips, _tooltips);
27941if (this.widget) {
27942this.hide();
27943this.show();
27944}
27945}
27946;
27947DateTimePicker.prototype.useStrict = function useStrict(_useStrict) {
27948if (arguments.length === 0) {
27949return this._options.useStrict;
27950}
27951if (typeof _useStrict !== 'boolean') {
27952throw new TypeError('useStrict() expects a boolean parameter');
27953}
27954this._options.useStrict = _useStrict;
27955}
27956;
27957DateTimePicker.prototype.sideBySide = function sideBySide(_sideBySide) {
27958if (arguments.length === 0) {
27959return this._options.sideBySide;
27960}
27961if (typeof _sideBySide !== 'boolean') {
27962throw new TypeError('sideBySide() expects a boolean parameter');
27963}
27964this._options.sideBySide = _sideBySide;
27965if (this.widget) {
27966this.hide();
27967this.show();
27968}
27969}
27970;
27971DateTimePicker.prototype.viewMode = function viewMode(_viewMode) {
27972if (arguments.length === 0) {
27973return this._options.viewMode;
27974}
27975if (typeof _viewMode !== 'string') {
27976throw new TypeError('viewMode() expects a string parameter');
27977}
27978if (DateTimePicker.ViewModes.indexOf(_viewMode) === -1) {
27979throw new TypeError('viewMode() parameter must be one of (' + DateTimePicker.ViewModes.join(', ') + ') value');
27980}
27981this._options.viewMode = _viewMode;
27982this.currentViewMode = Math.max(DateTimePicker.ViewModes.indexOf(_viewMode) - 1, DateTimePicker.MinViewModeNumber);
27983this._showMode();
27984}
27985;
27986DateTimePicker.prototype.calendarWeeks = function calendarWeeks(_calendarWeeks) {
27987if (arguments.length === 0) {
27988return this._options.calendarWeeks;
27989}
27990if (typeof _calendarWeeks !== 'boolean') {
27991throw new TypeError('calendarWeeks() expects parameter to be a boolean value');
27992}
27993this._options.calendarWeeks = _calendarWeeks;
27994this._update();
27995}
27996;
27997DateTimePicker.prototype.buttons = function buttons(_buttons) {
27998if (arguments.length === 0) {
27999return $.extend({}, this._options.buttons);
28000}
28001if (!(_buttons instanceof Object)) {
28002throw new TypeError('buttons() expects parameter to be an Object');
28003}
28004$.extend(this._options.buttons, _buttons);
28005if (typeof this._options.buttons.showToday !== 'boolean') {
28006throw new TypeError('buttons.showToday expects a boolean parameter');
28007}
28008if (typeof this._options.buttons.showClear !== 'boolean') {
28009throw new TypeError('buttons.showClear expects a boolean parameter');
28010}
28011if (typeof this._options.buttons.showClose !== 'boolean') {
28012throw new TypeError('buttons.showClose expects a boolean parameter');
28013}
28014if (this.widget) {
28015this.hide();
28016this.show();
28017}
28018}
28019;
28020DateTimePicker.prototype.keepOpen = function keepOpen(_keepOpen) {
28021if (arguments.length === 0) {
28022return this._options.keepOpen;
28023}
28024if (typeof _keepOpen !== 'boolean') {
28025throw new TypeError('keepOpen() expects a boolean parameter');
28026}
28027this._options.keepOpen = _keepOpen;
28028}
28029;
28030DateTimePicker.prototype.focusOnShow = function focusOnShow(_focusOnShow) {
28031if (arguments.length === 0) {
28032return this._options.focusOnShow;
28033}
28034if (typeof _focusOnShow !== 'boolean') {
28035throw new TypeError('focusOnShow() expects a boolean parameter');
28036}
28037this._options.focusOnShow = _focusOnShow;
28038}
28039;
28040DateTimePicker.prototype.inline = function inline(_inline) {
28041if (arguments.length === 0) {
28042return this._options.inline;
28043}
28044if (typeof _inline !== 'boolean') {
28045throw new TypeError('inline() expects a boolean parameter');
28046}
28047this._options.inline = _inline;
28048}
28049;
28050DateTimePicker.prototype.clear = function clear() {
28051this._setValue(null);
28052}
28053;
28054DateTimePicker.prototype.keyBinds = function keyBinds(_keyBinds) {
28055if (arguments.length === 0) {
28056return this._options.keyBinds;
28057}
28058this._options.keyBinds = _keyBinds;
28059}
28060;
28061DateTimePicker.prototype.debug = function debug(_debug) {
28062if (typeof _debug !== 'boolean') {
28063throw new TypeError('debug() expects a boolean parameter');
28064}
28065this._options.debug = _debug;
28066}
28067;
28068DateTimePicker.prototype.allowInputToggle = function allowInputToggle(_allowInputToggle) {
28069if (arguments.length === 0) {
28070return this._options.allowInputToggle;
28071}
28072if (typeof _allowInputToggle !== 'boolean') {
28073throw new TypeError('allowInputToggle() expects a boolean parameter');
28074}
28075this._options.allowInputToggle = _allowInputToggle;
28076}
28077;
28078DateTimePicker.prototype.keepInvalid = function keepInvalid(_keepInvalid) {
28079if (arguments.length === 0) {
28080return this._options.keepInvalid;
28081}
28082if (typeof _keepInvalid !== 'boolean') {
28083throw new TypeError('keepInvalid() expects a boolean parameter');
28084}
28085this._options.keepInvalid = _keepInvalid;
28086}
28087;
28088DateTimePicker.prototype.datepickerInput = function datepickerInput(_datepickerInput) {
28089if (arguments.length === 0) {
28090return this._options.datepickerInput;
28091}
28092if (typeof _datepickerInput !== 'string') {
28093throw new TypeError('datepickerInput() expects a string parameter');
28094}
28095this._options.datepickerInput = _datepickerInput;
28096}
28097;
28098DateTimePicker.prototype.parseInputDate = function parseInputDate(_parseInputDate2) {
28099if (arguments.length === 0) {
28100return this._options.parseInputDate;
28101}
28102if (typeof _parseInputDate2 !== 'function') {
28103throw new TypeError('parseInputDate() should be as function');
28104}
28105this._options.parseInputDate = _parseInputDate2;
28106}
28107;
28108DateTimePicker.prototype.disabledTimeIntervals = function disabledTimeIntervals(_disabledTimeIntervals) {
28109if (arguments.length === 0) {
28110return this._options.disabledTimeIntervals ? $.extend({}, this._options.disabledTimeIntervals) : this._options.disabledTimeIntervals;
28111}
28112if (!_disabledTimeIntervals) {
28113this._options.disabledTimeIntervals = false;
vendor: 22,379 bytes, lines 28114-28695
28114this._update();
28115return true;
28116}
28117if (!(_disabledTimeIntervals instanceof Array)) {
28118throw new TypeError('disabledTimeIntervals() expects an array parameter');
28119}
28120this._options.disabledTimeIntervals = _disabledTimeIntervals;
28121this._update();
28122}
28123;
28124DateTimePicker.prototype.disabledHours = function disabledHours(hours) {
28125if (arguments.length === 0) {
28126return this._options.disabledHours ? $.extend({}, this._options.disabledHours) : this._options.disabledHours;
28127}
28128if (!hours) {
28129this._options.disabledHours = false;
28130this._update();
28131return true;
28132}
28133if (!(hours instanceof Array)) {
28134throw new TypeError('disabledHours() expects an array parameter');
28135}
28136this._options.disabledHours = this._indexGivenHours(hours);
28137this._options.enabledHours = false;
28138if (this._options.useCurrent && !this._options.keepInvalid) {
28139for (var i = 0; i < this._dates.length; i++) {
28140var tries = 0;
28141while (!this._isValid(this._dates[i], 'h')) {
28142this._dates[i].add(1, 'h');
28143if (tries === 24) {
28144throw 'Tried 24 times to find a valid date';
28145}
28146tries++;
28147}
28148this._setValue(this._dates[i], i);
28149}
28150}
28151this._update();
28152}
28153;
28154DateTimePicker.prototype.enabledHours = function enabledHours(hours) {
28155if (arguments.length === 0) {
28156return this._options.enabledHours ? $.extend({}, this._options.enabledHours) : this._options.enabledHours;
28157}
28158if (!hours) {
28159this._options.enabledHours = false;
28160this._update();
28161return true;
28162}
28163if (!(hours instanceof Array)) {
28164throw new TypeError('enabledHours() expects an array parameter');
28165}
28166this._options.enabledHours = this._indexGivenHours(hours);
28167this._options.disabledHours = false;
28168if (this._options.useCurrent && !this._options.keepInvalid) {
28169for (var i = 0; i < this._dates.length; i++) {
28170var tries = 0;
28171while (!this._isValid(this._dates[i], 'h')) {
28172this._dates[i].add(1, 'h');
28173if (tries === 24) {
28174throw 'Tried 24 times to find a valid date';
28175}
28176tries++;
28177}
28178this._setValue(this._dates[i], i);
28179}
28180}
28181this._update();
28182}
28183;
28184DateTimePicker.prototype.viewDate = function viewDate(newDate) {
28185if (arguments.length === 0) {
28186return this._viewDate.clone();
28187}
28188if (!newDate) {
28189this._viewDate = (this._dates[0] || this.getMoment()).clone();
28190return true;
28191}
28192if (typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) {
28193throw new TypeError('viewDate() parameter must be one of [string, moment or Date]');
28194}
28195this._viewDate = this._parseInputDate(newDate);
28196this._viewUpdate();
28197}
28198;
28199DateTimePicker.prototype.allowMultidate = function allowMultidate(_allowMultidate) {
28200if (typeof _allowMultidate !== 'boolean') {
28201throw new TypeError('allowMultidate() expects a boolean parameter');
28202}
28203this._options.allowMultidate = _allowMultidate;
28204}
28205;
28206DateTimePicker.prototype.multidateSeparator = function multidateSeparator(_multidateSeparator) {
28207if (arguments.length === 0) {
28208return this._options.multidateSeparator;
28209}
28210if (typeof _multidateSeparator !== 'string' || _multidateSeparator.length > 1) {
28211throw new TypeError('multidateSeparator expects a single character string parameter');
28212}
28213this._options.multidateSeparator = _multidateSeparator;
28214}
28215;
28216_createClass(DateTimePicker, null, [{
28217key: 'NAME',
28218get: function get() {
28219return NAME;
28220}
28221}, {
28222key: 'DATA_KEY',
28223get: function get() {
28224return DATA_KEY;
28225}
28226}, {
28227key: 'EVENT_KEY',
28228get: function get() {
28229return EVENT_KEY;
28230}
28231}, {
28232key: 'DATA_API_KEY',
28233get: function get() {
28234return DATA_API_KEY;
28235}
28236}, {
28237key: 'DatePickerModes',
28238get: function get() {
28239return DatePickerModes;
28240}
28241}, {
28242key: 'ViewModes',
28243get: function get() {
28244return ViewModes;
28245}
28246}, {
28247key: 'MinViewModeNumber',
28248get: function get() {
28249return MinViewModeNumber;
28250}
28251}, {
28252key: 'Event',
28253get: function get() {
28254return Event;
28255}
28256}, {
28257key: 'Selector',
28258get: function get() {
28259return Selector;
28260}
28261}, {
28262key: 'Default',
28263get: function get() {
28264return Default;
28265},
28266set: function set(value) {
28267Default = value;
28268}
28269}, {
28270key: 'ClassName',
28271get: function get() {
28272return ClassName;
28273}
28274}]);
28275return DateTimePicker;
28276}();
28277return DateTimePicker;
28278}(jQuery, moment);
28279var TempusDominusBootstrap4 = function($) {
28280var JQUERY_NO_CONFLICT = $.fn[DateTimePicker.NAME]
28281  , verticalModes = ['top', 'bottom', 'auto']
28282  , horizontalModes = ['left', 'right', 'auto']
28283  , toolbarPlacements = ['default', 'top', 'bottom']
28284  , getSelectorFromElement = function getSelectorFromElement($element) {
28285var selector = $element.data('target')
28286  , $selector = void 0;
28287if (!selector) {
28288selector = $element.attr('href') || '';
28289selector = /^#[a-z]/i.test(selector) ? selector : null;
28290}
28291$selector = $(selector);
28292if ($selector.length === 0) {
28293return $selector;
28294}
28295if (!$selector.data(DateTimePicker.DATA_KEY)) {
28296$.extend({}, $selector.data(), $(this).data());
28297}
28298return $selector;
28299};
28300var TempusDominusBootstrap4 = function(_DateTimePicker) {
28301_inherits(TempusDominusBootstrap4, _DateTimePicker);
28302function TempusDominusBootstrap4(element, options) {
28303_classCallCheck(this, TempusDominusBootstrap4);
28304var _this = _possibleConstructorReturn(this, _DateTimePicker.call(this, element, options));
28305_this._init();
28306return _this;
28307}
28308TempusDominusBootstrap4.prototype._init = function _init() {
28309if (this._element.hasClass('input-group')) {
28310var datepickerButton = this._element.find('.datepickerbutton');
28311if (datepickerButton.length === 0) {
28312this.component = this._element.find('[data-toggle="datetimepicker"]');
28313} else {
28314this.component = datepickerButton;
28315}
28316}
28317}
28318;
28319TempusDominusBootstrap4.prototype._getDatePickerTemplate = function _getDatePickerTemplate() {
28320var headTemplate = $('<thead>').append($('<tr>').append($('<th>').addClass('prev').attr('data-action', 'previous').append($('<span>').addClass(this._options.icons.previous))).append($('<th>').addClass('picker-switch').attr('data-action', 'pickerSwitch').attr('colspan', '' + (this._options.calendarWeeks ? '6' : '5'))).append($('<th>').addClass('next').attr('data-action', 'next').append($('<span>').addClass(this._options.icons.next))))
28321  , contTemplate = $('<tbody>').append($('<tr>').append($('<td>').attr('colspan', '' + (this._options.calendarWeeks ? '8' : '7'))));
28322return [$('<div>').addClass('datepicker-days').append($('<table>').addClass('table table-sm').append(headTemplate).append($('<tbody>'))), $('<div>').addClass('datepicker-months').append($('<table>').addClass('table-condensed').append(headTemplate.clone()).append(contTemplate.clone())), $('<div>').addClass('datepicker-years').append($('<table>').addClass('table-condensed').append(headTemplate.clone()).append(contTemplate.clone())), $('<div>').addClass('datepicker-decades').append($('<table>').addClass('table-condensed').append(headTemplate.clone()).append(contTemplate.clone()))];
28323}
28324;
28325TempusDominusBootstrap4.prototype._getTimePickerMainTemplate = function _getTimePickerMainTemplate() {
28326var topRow = $('<tr>')
28327  , middleRow = $('<tr>')
28328  , bottomRow = $('<tr>');
28329if (this._isEnabled('h')) {
28330topRow.append($('<td>').append($('<a>').attr({
28331href: '#',
28332tabindex: '-1',
28333'title': this._options.tooltips.incrementHour
28334}).addClass('btn').attr('data-action', 'incrementHours').append($('<span>').addClass(this._options.icons.up))));
28335middleRow.append($('<td>').append($('<span>').addClass('timepicker-hour').attr({
28336'data-time-component': 'hours',
28337'title': this._options.tooltips.pickHour
28338}).attr('data-action', 'showHours')));
28339bottomRow.append($('<td>').append($('<a>').attr({
28340href: '#',
28341tabindex: '-1',
28342'title': this._options.tooltips.decrementHour
28343}).addClass('btn').attr('data-action', 'decrementHours').append($('<span>').addClass(this._options.icons.down))));
28344}
28345if (this._isEnabled('m')) {
28346if (this._isEnabled('h')) {
28347topRow.append($('<td>').addClass('separator'));
28348middleRow.append($('<td>').addClass('separator').html(':'));
28349bottomRow.append($('<td>').addClass('separator'));
28350}
28351topRow.append($('<td>').append($('<a>').attr({
28352href: '#',
28353tabindex: '-1',
28354'title': this._options.tooltips.incrementMinute
28355}).addClass('btn').attr('data-action', 'incrementMinutes').append($('<span>').addClass(this._options.icons.up))));
28356middleRow.append($('<td>').append($('<span>').addClass('timepicker-minute').attr({
28357'data-time-component': 'minutes',
28358'title': this._options.tooltips.pickMinute
28359}).attr('data-action', 'showMinutes')));
28360bottomRow.append($('<td>').append($('<a>').attr({
28361href: '#',
28362tabindex: '-1',
28363'title': this._options.tooltips.decrementMinute
28364}).addClass('btn').attr('data-action', 'decrementMinutes').append($('<span>').addClass(this._options.icons.down))));
28365}
28366if (this._isEnabled('s')) {
28367if (this._isEnabled('m')) {
28368topRow.append($('<td>').addClass('separator'));
28369middleRow.append($('<td>').addClass('separator').html(':'));
28370bottomRow.append($('<td>').addClass('separator'));
28371}
28372topRow.append($('<td>').append($('<a>').attr({
28373href: '#',
28374tabindex: '-1',
28375'title': this._options.tooltips.incrementSecond
28376}).addClass('btn').attr('data-action', 'incrementSeconds').append($('<span>').addClass(this._options.icons.up))));
28377middleRow.append($('<td>').append($('<span>').addClass('timepicker-second').attr({
28378'data-time-component': 'seconds',
28379'title': this._options.tooltips.pickSecond
28380}).attr('data-action', 'showSeconds')));
28381bottomRow.append($('<td>').append($('<a>').attr({
28382href: '#',
28383tabindex: '-1',
28384'title': this._options.tooltips.decrementSecond
28385}).addClass('btn').attr('data-action', 'decrementSeconds').append($('<span>').addClass(this._options.icons.down))));
28386}
28387if (!this.use24Hours) {
28388topRow.append($('<td>').addClass('separator'));
28389middleRow.append($('<td>').append($('<button>').addClass('btn btn-primary').attr({
28390'data-action': 'togglePeriod',
28391tabindex: '-1',
28392'title': this._options.tooltips.togglePeriod
28393})));
28394bottomRow.append($('<td>').addClass('separator'));
28395}
28396return $('<div>').addClass('timepicker-picker').append($('<table>').addClass('table-condensed').append([topRow, middleRow, bottomRow]));
28397}
28398;
28399TempusDominusBootstrap4.prototype._getTimePickerTemplate = function _getTimePickerTemplate() {
28400var hoursView = $('<div>').addClass('timepicker-hours').append($('<table>').addClass('table-condensed'))
28401  , minutesView = $('<div>').addClass('timepicker-minutes').append($('<table>').addClass('table-condensed'))
28402  , secondsView = $('<div>').addClass('timepicker-seconds').append($('<table>').addClass('table-condensed'))
28403  , ret = [this._getTimePickerMainTemplate()];
28404if (this._isEnabled('h')) {
28405ret.push(hoursView);
28406}
28407if (this._isEnabled('m')) {
28408ret.push(minutesView);
28409}
28410if (this._isEnabled('s')) {
28411ret.push(secondsView);
28412}
28413return ret;
28414}
28415;
28416TempusDominusBootstrap4.prototype._getToolbar = function _getToolbar() {
28417var row = [];
28418if (this._options.buttons.showToday) {
28419row.push($('<td>').append($('<a>').attr({
28420href: '#',
28421tabindex: '-1',
28422'data-action': 'today',
28423'title': this._options.tooltips.today
28424}).append($('<span>').addClass(this._options.icons.today))));
28425}
28426if (!this._options.sideBySide && this._hasDate() && this._hasTime()) {
28427var title = void 0
28428  , icon = void 0;
28429if (this._options.viewMode === 'times') {
28430title = this._options.tooltips.selectDate;
28431icon = this._options.icons.date;
28432} else {
28433title = this._options.tooltips.selectTime;
28434icon = this._options.icons.time;
28435}
28436row.push($('<td>').append($('<a>').attr({
28437href: '#',
28438tabindex: '-1',
28439'data-action': 'togglePicker',
28440'title': title
28441}).append($('<span>').addClass(icon))));
28442}
28443if (this._options.buttons.showClear) {
28444row.push($('<td>').append($('<a>').attr({
28445href: '#',
28446tabindex: '-1',
28447'data-action': 'clear',
28448'title': this._options.tooltips.clear
28449}).append($('<span>').addClass(this._options.icons.clear))));
28450}
28451if (this._options.buttons.showClose) {
28452row.push($('<td>').append($('<a>').attr({
28453href: '#',
28454tabindex: '-1',
28455'data-action': 'close',
28456'title': this._options.tooltips.close
28457}).append($('<span>').addClass(this._options.icons.close))));
28458}
28459return row.length === 0 ? '' : $('<table>').addClass('table-condensed').append($('<tbody>').append($('<tr>').append(row)));
28460}
28461;
28462TempusDominusBootstrap4.prototype._getTemplate = function _getTemplate() {
28463var template = $('<div>').addClass('bootstrap-datetimepicker-widget dropdown-menu')
28464  , dateView = $('<div>').addClass('datepicker').append(this._getDatePickerTemplate())
28465  , timeView = $('<div>').addClass('timepicker').append(this._getTimePickerTemplate())
28466  , content = $('<ul>').addClass('list-unstyled')
28467  , toolbar = $('<li>').addClass('picker-switch' + (this._options.collapse ? ' accordion-toggle' : '')).append(this._getToolbar());
28468if (this._options.inline) {
28469template.removeClass('dropdown-menu');
28470}
28471if (this.use24Hours) {
28472template.addClass('usetwentyfour');
28473}
28474if (this._isEnabled('s') && !this.use24Hours) {
28475template.addClass('wider');
28476}
28477if (this._options.sideBySide && this._hasDate() && this._hasTime()) {
28478template.addClass('timepicker-sbs');
28479if (this._options.toolbarPlacement === 'top') {
28480template.append(toolbar);
28481}
28482template.append($('<div>').addClass('row').append(dateView.addClass('col-md-6')).append(timeView.addClass('col-md-6')));
28483if (this._options.toolbarPlacement === 'bottom' || this._options.toolbarPlacement === 'default') {
28484template.append(toolbar);
28485}
28486return template;
28487}
28488if (this._options.toolbarPlacement === 'top') {
28489content.append(toolbar);
28490}
28491if (this._hasDate()) {
28492content.append($('<li>').addClass(this._options.collapse && this._hasTime() ? 'collapse' : '').addClass(this._options.collapse && this._hasTime() && this._options.viewMode === 'times' ? '' : 'show').append(dateView));
28493}
28494if (this._options.toolbarPlacement === 'default') {
28495content.append(toolbar);
28496}
28497if (this._hasTime()) {
28498content.append($('<li>').addClass(this._options.collapse && this._hasDate() ? 'collapse' : '').addClass(this._options.collapse && this._hasDate() && this._options.viewMode === 'times' ? 'show' : '').append(timeView));
28499}
28500if (this._options.toolbarPlacement === 'bottom') {
28501content.append(toolbar);
28502}
28503return template.append(content);
28504}
28505;
28506TempusDominusBootstrap4.prototype._place = function _place(e) {
28507var self = e && e.data && e.data.picker || this
28508  , vertical = self._options.widgetPositioning.vertical
28509  , horizontal = self._options.widgetPositioning.horizontal
28510  , parent = void 0;
28511var position = (self.component && self.component.length ? self.component : self._element).position()
28512  , offset = (self.component && self.component.length ? self.component : self._element).offset();
28513if (self._options.widgetParent) {
28514parent = self._options.widgetParent.append(self.widget);
28515} else if (self._element.is('input')) {
28516parent = self._element.after(self.widget).parent();
28517} else if (self._options.inline) {
28518parent = self._element.append(self.widget);
28519return;
28520} else {
28521parent = self._element;
28522self._element.children().first().after(self.widget);
28523}
28524var parentOffset = parent.offset();
28525position.top = offset.top - parentOffset.top;
28526position.left = offset.left - parentOffset.left;
28527if (vertical === 'auto') {
28528if (offset.top + self.widget.height() * 1.5 >= $(window).height() + $(window).scrollTop() && self.widget.height() + self._element.outerHeight() < offset.top) {
28529vertical = 'top';
28530} else {
28531vertical = 'bottom';
28532}
28533}
28534if (horizontal === 'auto') {
28535if (parent.width() < offset.left + self.widget.outerWidth() / 2 && offset.left + self.widget.outerWidth() > $(window).width()) {
28536horizontal = 'right';
28537} else {
28538horizontal = 'left';
28539}
28540}
28541if (vertical === 'top') {
28542self.widget.addClass('top').removeClass('bottom');
28543} else {
28544self.widget.addClass('bottom').removeClass('top');
28545}
28546if (horizontal === 'right') {
28547self.widget.addClass('float-right');
28548} else {
28549self.widget.removeClass('float-right');
28550}
28551if (parent.css('position') !== 'relative') {
28552parent = parent.parents().filter(function() {
28553return $(this).css('position') === 'relative';
28554}).first();
28555}
28556if (parent.length === 0) {
28557throw new Error('datetimepicker component should be placed within a relative positioned container');
28558}
28559self.widget.css({
28560top: vertical === 'top' ? 'auto' : position.top + self._element.outerHeight() + 'px',
28561bottom: vertical === 'top' ? parent.outerHeight() - (parent === self._element ? 0 : position.top) + 'px' : 'auto',
28562left: horizontal === 'left' ? (parent === self._element ? 0 : position.left) + 'px' : 'auto',
28563right: horizontal === 'left' ? 'auto' : parent.outerWidth() - self._element.outerWidth() - (parent === self._element ? 0 : position.left) + 'px'
28564});
28565}
28566;
28567TempusDominusBootstrap4.prototype._fillDow = function _fillDow() {
28568var row = $('<tr>')
28569  , currentDate = this._viewDate.clone().startOf('w').startOf('d');
28570if (this._options.calendarWeeks === true) {
28571row.append($('<th>').addClass('cw').text('#'));
28572}
28573while (currentDate.isBefore(this._viewDate.clone().endOf('w'))) {
28574row.append($('<th>').addClass('dow').text(currentDate.format('dd')));
28575currentDate.add(1, 'd');
28576}
28577this.widget.find('.datepicker-days thead').append(row);
28578}
28579;
28580TempusDominusBootstrap4.prototype._fillMonths = function _fillMonths() {
28581var spans = []
28582  , monthsShort = this._viewDate.clone().startOf('y').startOf('d');
28583while (monthsShort.isSame(this._viewDate, 'y')) {
28584spans.push($('<span>').attr('data-action', 'selectMonth').addClass('month').text(monthsShort.format('MMM')));
28585monthsShort.add(1, 'M');
28586}
28587this.widget.find('.datepicker-months td').empty().append(spans);
28588}
28589;
28590TempusDominusBootstrap4.prototype._updateMonths = function _updateMonths() {
28591var monthsView = this.widget.find('.datepicker-months')
28592  , monthsViewHeader = monthsView.find('th')
28593  , months = monthsView.find('tbody').find('span')
28594  , self = this;
28595monthsViewHeader.eq(0).find('span').attr('title', this._options.tooltips.prevYear);
28596monthsViewHeader.eq(1).attr('title', this._options.tooltips.selectYear);
28597monthsViewHeader.eq(2).find('span').attr('title', this._options.tooltips.nextYear);
28598monthsView.find('.disabled').removeClass('disabled');
28599if (!this._isValid(this._viewDate.clone().subtract(1, 'y'), 'y')) {
28600monthsViewHeader.eq(0).addClass('disabled');
28601}
28602monthsViewHeader.eq(1).text(this._viewDate.year());
28603if (!this._isValid(this._viewDate.clone().add(1, 'y'), 'y')) {
28604monthsViewHeader.eq(2).addClass('disabled');
28605}
28606months.removeClass('active');
28607if (this._getLastPickedDate().isSame(this._viewDate, 'y') && !this.unset) {
28608months.eq(this._getLastPickedDate().month()).addClass('active');
28609}
28610months.each(function(index) {
28611if (!self._isValid(self._viewDate.clone().month(index), 'M')) {
28612$(this).addClass('disabled');
28613}
28614});
28615}
28616;
28617TempusDominusBootstrap4.prototype._getStartEndYear = function _getStartEndYear(factor, year) {
28618var step = factor / 10
28619  , startYear = Math.floor(year / factor) * factor
28620  , endYear = startYear + step * 9
28621  , focusValue = Math.floor(year / step) * step;
28622return [startYear, endYear, focusValue];
28623}
28624;
28625TempusDominusBootstrap4.prototype._updateYears = function _updateYears() {
28626var yearsView = this.widget.find('.datepicker-years')
28627  , yearsViewHeader = yearsView.find('th')
28628  , yearCaps = this._getStartEndYear(10, this._viewDate.year())
28629  , startYear = this._viewDate.clone().year(yearCaps[0])
28630  , endYear = this._viewDate.clone().year(yearCaps[1]);
28631var html = '';
28632yearsViewHeader.eq(0).find('span').attr('title', this._options.tooltips.prevDecade);
28633yearsViewHeader.eq(1).attr('title', this._options.tooltips.selectDecade);
28634yearsViewHeader.eq(2).find('span').attr('title', this._options.tooltips.nextDecade);
28635yearsView.find('.disabled').removeClass('disabled');
28636if (this._options.minDate && this._options.minDate.isAfter(startYear, 'y')) {
28637yearsViewHeader.eq(0).addClass('disabled');
28638}
28639yearsViewHeader.eq(1).text(startYear.year() + '-' + endYear.year());
28640if (this._options.maxDate && this._options.maxDate.isBefore(endYear, 'y')) {
28641yearsViewHeader.eq(2).addClass('disabled');
28642}
28643html += '<span data-action="selectYear" class="year old' + (!this._isValid(startYear, 'y') ? ' disabled' : '') + '">' + (startYear.year() - 1) + '</span>';
28644while (!startYear.isAfter(endYear, 'y')) {
28645html += '<span data-action="selectYear" class="year' + (startYear.isSame(this._getLastPickedDate(), 'y') && !this.unset ? ' active' : '') + (!this._isValid(startYear, 'y') ? ' disabled' : '') + '">' + startYear.year() + '</span>';
28646startYear.add(1, 'y');
28647}
28648html += '<span data-action="selectYear" class="year old' + (!this._isValid(startYear, 'y') ? ' disabled' : '') + '">' + startYear.year() + '</span>';
28649yearsView.find('td').html(html);
28650}
28651;
28652TempusDominusBootstrap4.prototype._updateDecades = function _updateDecades() {
28653var decadesView = this.widget.find('.datepicker-decades')
28654  , decadesViewHeader = decadesView.find('th')
28655  , yearCaps = this._getStartEndYear(100, this._viewDate.year())
28656  , startDecade = this._viewDate.clone().year(yearCaps[0])
28657  , endDecade = this._viewDate.clone().year(yearCaps[1]);
28658var minDateDecade = false
28659  , maxDateDecade = false
28660  , endDecadeYear = void 0
28661  , html = '';
28662decadesViewHeader.eq(0).find('span').attr('title', this._options.tooltips.prevCentury);
28663decadesViewHeader.eq(2).find('span').attr('title', this._options.tooltips.nextCentury);
28664decadesView.find('.disabled').removeClass('disabled');
28665if (startDecade.year() === 0 || this._options.minDate && this._options.minDate.isAfter(startDecade, 'y')) {
28666decadesViewHeader.eq(0).addClass('disabled');
28667}
28668decadesViewHeader.eq(1).text(startDecade.year() + '-' + endDecade.year());
28669if (this._options.maxDate && this._options.maxDate.isBefore(endDecade, 'y')) {
28670decadesViewHeader.eq(2).addClass('disabled');
28671}
28672if (startDecade.year() - 10 < 0) {
28673html += '<span>&nbsp;</span>';
28674} else {
28675html += '<span data-action="selectDecade" class="decade old" data-selection="' + (startDecade.year() + 6) + '">' + (startDecade.year() - 10) + '</span>';
28676}
28677while (!startDecade.isAfter(endDecade, 'y')) {
28678endDecadeYear = startDecade.year() + 11;
28679minDateDecade = this._options.minDate && this._options.minDate.isAfter(startDecade, 'y') && this._options.minDate.year() <= endDecadeYear;
28680maxDateDecade = this._options.maxDate && this._options.maxDate.isAfter(startDecade, 'y') && this._options.maxDate.year() <= endDecadeYear;
28681html += '<span data-action="selectDecade" class="decade' + (this._getLastPickedDate().isAfter(startDecade) && this._getLastPickedDate().year() <= endDecadeYear ? ' active' : '') + (!this._isValid(startDecade, 'y') && !minDateDecade && !maxDateDecade ? ' disabled' : '') + '" data-selection="' + (startDecade.year() + 6) + '">' + startDecade.year() + '</span>';
28682startDecade.add(10, 'y');
28683}
28684html += '<span data-action="selectDecade" class="decade old" data-selection="' + (startDecade.year() + 6) + '">' + startDecade.year() + '</span>';
28685decadesView.find('td').html(html);
28686}
28687;
28688TempusDominusBootstrap4.prototype._fillDate = function _fillDate() {
28689var daysView = this.widget.find('.datepicker-days')
28690  , daysViewHeader = daysView.find('th')
28691  , html = [];
28692var currentDate = void 0
28693  , row = void 0
28694  , clsName = void 0
28695  , i = void 0;
28696if (!this._hasDate()) {
28697return;
28698}
28699daysViewHeader.eq(0).find('span').attr('title', this._options.tooltips.prevMonth);
28700daysViewHeader.eq(1).attr('title', this._options.tooltips.selectMonth);
28701daysViewHeader.eq(2).find('span').attr('title', this._options.tooltips.nextMonth);
28702daysView.find('.disabled').removeClass('disabled');
28703daysViewHeader.eq(1).text(this._viewDate.format(this._options.dayViewHeaderFormat));
28704if (!this._isValid(this._viewDate.clone().subtract(1, 'M'), 'M')) {
28705daysViewHeader.eq(0).addClass('disabled');
28706}
28707if (!this._isValid(this._viewDate.clone().add(1, 'M'), 'M')) {
28708daysViewHeader.eq(2).addClass('disabled');
28709}
28710currentDate = this._viewDate.clone().startOf('M').startOf('w').startOf('d');
28711var now = this.getMoment();
28712for (i = 0; i < 42; i++) {
28713if (currentDate.weekday() === 0) {
28714row = $('<tr>');
28715if (this._options.calendarWeeks) {
28716row.append('<td class="cw">' + currentDate.week() + '</td>');
28717}
28718html.push(row);
28719}
28720clsName = '';
28721if (currentDate.isBefore(this._viewDate, 'M')) {
28722clsName += ' old';
28723}
28724if (currentDate.isAfter(this._viewDate, 'M')) {
28725clsName += ' new';
28726}
28727if (this._options.allowMultidate) {
28728var index = this._datesFormatted.indexOf(currentDate.format('YYYY-MM-DD'));
28729if (index !== -1) {
28730if (currentDate.isSame(this._datesFormatted[index], 'd') && !this.unset) {
28731clsName += ' active';
28732}
28733}
28734} else {
28735if (currentDate.isSame(this._getLastPickedDate(), 'd') && !this.unset) {
28736clsName += ' active';
28737}
28738}
28739if (!this._isValid(currentDate, 'd')) {
28740clsName += ' disabled';
28741}
28742if (currentDate.date() === now.date() && currentDate.month() === now.month() && currentDate.year() === now.year()) {
28743clsName += ' today';
28744}
28745if (currentDate.day() === 0 || currentDate.day() === 6) {
28746clsName += ' weekend';
28747}
28748row.append('<td data-action="selectDay" data-day="' + currentDate.format('L') + '" class="day' + clsName + '">' + currentDate.date() + '</td>');
28749currentDate.add(1, 'd');
28750}
28751daysView.find('tbody').empty().append(html);
28752this._updateMonths();
28753this._updateYears();
28754this._updateDecades();
28755}
28756;
28757TempusDominusBootstrap4.prototype._fillHours = function _fillHours() {
28758var table = this.widget.find('.timepicker-hours table')
28759  , currentHour = this._viewDate.clone().startOf('d')
28760  , html = [];
28761var row = $('<tr>');
28762if (this._viewDate.hour() > 11 && !this.use24Hours) {
28763currentHour.hour(12);
28764}
28765while (currentHour.isSame(this._viewDate, 'd') && (this.use24Hours || this._viewDate.hour() < 12 && currentHour.hour() < 12 || this._viewDate.hour() > 11)) {
28766if (currentHour.hour() % 4 === 0) {
28767row = $('<tr>');
28768html.push(row);
28769}
28770row.append('<td data-action="selectHour" class="hour' + (!this._isValid(currentHour, 'h') ? ' disabled' : '') + '">' + currentHour.format(this.use24Hours ? 'HH' : 'hh') + '</td>');
28771currentHour.add(1, 'h');
28772}
28773table.empty().append(html);
28774}
28775;
28776TempusDominusBootstrap4.prototype._fillMinutes = function _fillMinutes() {
28777var table = this.widget.find('.timepicker-minutes table')
28778  , currentMinute = this._viewDate.clone().startOf('h')
28779  , html = []
28780  , step = this._options.stepping === 1 ? 5 : this._options.stepping;
28781var row = $('<tr>');
28782while (this._viewDate.isSame(currentMinute, 'h')) {
28783if (currentMinute.minute() % (step * 4) === 0) {
28784row = $('<tr>');
28785html.push(row);
28786}
28787row.append('<td data-action="selectMinute" class="minute' + (!this._isValid(currentMinute, 'm') ? ' disabled' : '') + '">' + currentMinute.format('mm') + '</td>');
28788currentMinute.add(step, 'm');
28789}
28790table.empty().append(html);
28791}
28792;
28793TempusDominusBootstrap4.prototype._fillSeconds = function _fillSeconds() {
28794var table = this.widget.find('.timepicker-seconds table')
28795  , currentSecond = this._viewDate.clone().startOf('m')
28796  , html = [];
28797var row = $('<tr>');
28798while (this._viewDate.isSame(currentSecond, 'm')) {
28799if (currentSecond.second() % 20 === 0) {
28800row = $('<tr>');
28801html.push(row);
28802}
28803row.append('<td data-action="selectSecond" class="second' + (!this._isValid(currentSecond, 's') ? ' disabled' : '') + '">' + currentSecond.format('ss') + '</td>');
28804currentSecond.add(5, 's');
28805}
28806table.empty().append(html);
28807}
28808;
28809TempusDominusBootstrap4.prototype._fillTime = function _fillTime() {
28810var toggle = void 0
28811  , newDate = void 0;
28812var timeComponents = this.widget.find('.timepicker span[data-time-component]');
28813if (!this.use24Hours) {
28814toggle = this.widget.find('.timepicker [data-action=togglePeriod]');
28815newDate = this._getLastPickedDate().clone().add(this._getLastPickedDate().hours() >= 12 ? -12 : 12, 'h');
28816toggle.text(this._getLastPickedDate().format('A'));
28817if (this._isValid(newDate, 'h')) {
28818toggle.removeClass('disabled');
28819} else {
28820toggle.addClass('disabled');
28821}
28822}
28823timeComponents.filter('[data-time-component=hours]').text(this._getLastPickedDate().format('' + (this.use24Hours ? 'HH' : 'hh')));
28824timeComponents.filter('[data-time-component=minutes]').text(this._getLastPickedDate().format('mm'));
28825timeComponents.filter('[data-time-component=seconds]').text(this._getLastPickedDate().format('ss'));
28826this._fillHours();
28827this._fillMinutes();
28828this._fillSeconds();
28829}
28830;
28831TempusDominusBootstrap4.prototype._doAction = function _doAction(e, action) {
28832var lastPicked = this._getLastPickedDate();
28833if ($(e.currentTarget).is('.disabled')) {
28834return false;
vendor: 10,578 bytes, lines 28835-29224
28835}
28836action = action || $(e.currentTarget).data('action');
28837switch (action) {
28838case 'next':
28839{
28840var navFnc = DateTimePicker.DatePickerModes[this.currentViewMode].NAV_FUNCTION;
28841this._viewDate.add(DateTimePicker.DatePickerModes[this.currentViewMode].NAV_STEP, navFnc);
28842this._fillDate();
28843this._viewUpdate(navFnc);
28844break;
28845}
28846case 'previous':
28847{
28848var _navFnc = DateTimePicker.DatePickerModes[this.currentViewMode].NAV_FUNCTION;
28849this._viewDate.subtract(DateTimePicker.DatePickerModes[this.currentViewMode].NAV_STEP, _navFnc);
28850this._fillDate();
28851this._viewUpdate(_navFnc);
28852break;
28853}
28854case 'pickerSwitch':
28855this._showMode(1);
28856break;
28857case 'selectMonth':
28858{
28859var month = $(e.target).closest('tbody').find('span').index($(e.target));
28860this._viewDate.month(month);
28861if (this.currentViewMode === DateTimePicker.MinViewModeNumber) {
28862this._setValue(lastPicked.clone().year(this._viewDate.year()).month(this._viewDate.month()), this._getLastPickedDateIndex());
28863if (!this._options.inline) {
28864this.hide();
28865}
28866} else {
28867this._showMode(-1);
28868this._fillDate();
28869}
28870this._viewUpdate('M');
28871break;
28872}
28873case 'selectYear':
28874{
28875var year = parseInt($(e.target).text(), 10) || 0;
28876this._viewDate.year(year);
28877if (this.currentViewMode === DateTimePicker.MinViewModeNumber) {
28878this._setValue(lastPicked.clone().year(this._viewDate.year()), this._getLastPickedDateIndex());
28879if (!this._options.inline) {
28880this.hide();
28881}
28882} else {
28883this._showMode(-1);
28884this._fillDate();
28885}
28886this._viewUpdate('YYYY');
28887break;
28888}
28889case 'selectDecade':
28890{
28891var _year = parseInt($(e.target).data('selection'), 10) || 0;
28892this._viewDate.year(_year);
28893if (this.currentViewMode === DateTimePicker.MinViewModeNumber) {
28894this._setValue(lastPicked.clone().year(this._viewDate.year()), this._getLastPickedDateIndex());
28895if (!this._options.inline) {
28896this.hide();
28897}
28898} else {
28899this._showMode(-1);
28900this._fillDate();
28901}
28902this._viewUpdate('YYYY');
28903break;
28904}
28905case 'selectDay':
28906{
28907var day = this._viewDate.clone();
28908if ($(e.target).is('.old')) {
28909day.subtract(1, 'M');
28910}
28911if ($(e.target).is('.new')) {
28912day.add(1, 'M');
28913}
28914this._setValue(day.date(parseInt($(e.target).text(), 10)), this._getLastPickedDateIndex());
28915if (!this._hasTime() && !this._options.keepOpen && !this._options.inline) {
28916this.hide();
28917}
28918break;
28919}
28920case 'incrementHours':
28921{
28922var newDate = lastPicked.clone().add(1, 'h');
28923if (this._isValid(newDate, 'h')) {
28924this._setValue(newDate, this._getLastPickedDateIndex());
28925}
28926break;
28927}
28928case 'incrementMinutes':
28929{
28930var _newDate = lastPicked.clone().add(this._options.stepping, 'm');
28931if (this._isValid(_newDate, 'm')) {
28932this._setValue(_newDate, this._getLastPickedDateIndex());
28933}
28934break;
28935}
28936case 'incrementSeconds':
28937{
28938var _newDate2 = lastPicked.clone().add(1, 's');
28939if (this._isValid(_newDate2, 's')) {
28940this._setValue(_newDate2, this._getLastPickedDateIndex());
28941}
28942break;
28943}
28944case 'decrementHours':
28945{
28946var _newDate3 = lastPicked.clone().subtract(1, 'h');
28947if (this._isValid(_newDate3, 'h')) {
28948this._setValue(_newDate3, this._getLastPickedDateIndex());
28949}
28950break;
28951}
28952case 'decrementMinutes':
28953{
28954var _newDate4 = lastPicked.clone().subtract(this._options.stepping, 'm');
28955if (this._isValid(_newDate4, 'm')) {
28956this._setValue(_newDate4, this._getLastPickedDateIndex());
28957}
28958break;
28959}
28960case 'decrementSeconds':
28961{
28962var _newDate5 = lastPicked.clone().subtract(1, 's');
28963if (this._isValid(_newDate5, 's')) {
28964this._setValue(_newDate5, this._getLastPickedDateIndex());
28965}
28966break;
28967}
28968case 'togglePeriod':
28969{
28970this._setValue(lastPicked.clone().add(lastPicked.hours() >= 12 ? -12 : 12, 'h'), this._getLastPickedDateIndex());
28971break;
28972}
28973case 'togglePicker':
28974{
28975var $this = $(e.target)
28976  , $link = $this.closest('a')
28977  , $parent = $this.closest('ul')
28978  , expanded = $parent.find('.show')
28979  , closed = $parent.find('.collapse:not(.show)')
28980  , $span = $this.is('span') ? $this : $this.find('span');
28981var collapseData = void 0;
28982if (expanded && expanded.length) {
28983collapseData = expanded.data('collapse');
28984if (collapseData && collapseData.transitioning) {
28985return true;
28986}
28987if (expanded.collapse) {
28988expanded.collapse('hide');
28989closed.collapse('show');
28990} else {
28991expanded.removeClass('show');
28992closed.addClass('show');
28993}
28994$span.toggleClass(this._options.icons.time + ' ' + this._options.icons.date);
28995if ($span.hasClass(this._options.icons.date)) {
28996$link.attr('title', this._options.tooltips.selectDate);
28997} else {
28998$link.attr('title', this._options.tooltips.selectTime);
28999}
29000}
29001}
29002break;
29003case 'showPicker':
29004this.widget.find('.timepicker > div:not(.timepicker-picker)').hide();
29005this.widget.find('.timepicker .timepicker-picker').show();
29006break;
29007case 'showHours':
29008this.widget.find('.timepicker .timepicker-picker').hide();
29009this.widget.find('.timepicker .timepicker-hours').show();
29010break;
29011case 'showMinutes':
29012this.widget.find('.timepicker .timepicker-picker').hide();
29013this.widget.find('.timepicker .timepicker-minutes').show();
29014break;
29015case 'showSeconds':
29016this.widget.find('.timepicker .timepicker-picker').hide();
29017this.widget.find('.timepicker .timepicker-seconds').show();
29018break;
29019case 'selectHour':
29020{
29021var hour = parseInt($(e.target).text(), 10);
29022if (!this.use24Hours) {
29023if (lastPicked.hours() >= 12) {
29024if (hour !== 12) {
29025hour += 12;
29026}
29027} else {
29028if (hour === 12) {
29029hour = 0;
29030}
29031}
29032}
29033this._setValue(lastPicked.clone().hours(hour), this._getLastPickedDateIndex());
29034if (!this._isEnabled('a') && !this._isEnabled('m') && !this._options.keepOpen && !this._options.inline) {
29035this.hide();
29036} else {
29037this._doAction(e, 'showPicker');
29038}
29039break;
29040}
29041case 'selectMinute':
29042this._setValue(lastPicked.clone().minutes(parseInt($(e.target).text(), 10)), this._getLastPickedDateIndex());
29043if (!this._isEnabled('a') && !this._isEnabled('s') && !this._options.keepOpen && !this._options.inline) {
29044this.hide();
29045} else {
29046this._doAction(e, 'showPicker');
29047}
29048break;
29049case 'selectSecond':
29050this._setValue(lastPicked.clone().seconds(parseInt($(e.target).text(), 10)), this._getLastPickedDateIndex());
29051if (!this._isEnabled('a') && !this._options.keepOpen && !this._options.inline) {
29052this.hide();
29053} else {
29054this._doAction(e, 'showPicker');
29055}
29056break;
29057case 'clear':
29058this.clear();
29059break;
29060case 'close':
29061this.hide();
29062break;
29063case 'today':
29064{
29065var todaysDate = this.getMoment();
29066if (this._isValid(todaysDate, 'd')) {
29067this._setValue(todaysDate, this._getLastPickedDateIndex());
29068}
29069break;
29070}
29071}
29072return false;
29073}
29074;
29075TempusDominusBootstrap4.prototype.hide = function hide() {
29076var transitioning = false;
29077if (!this.widget) {
29078return;
29079}
29080this.widget.find('.collapse').each(function() {
29081var collapseData = $(this).data('collapse');
29082if (collapseData && collapseData.transitioning) {
29083transitioning = true;
29084return false;
29085}
29086return true;
29087});
29088if (transitioning) {
29089return;
29090}
29091if (this.component && this.component.hasClass('btn')) {
29092this.component.toggleClass('active');
29093}
29094this.widget.hide();
29095$(window).off('resize', this._place());
29096this.widget.off('click', '[data-action]');
29097this.widget.off('mousedown', false);
29098this.widget.remove();
29099this.widget = false;
29100this._notifyEvent({
29101type: DateTimePicker.Event.HIDE,
29102date: this._getLastPickedDate().clone()
29103});
29104if (this.input !== undefined) {
29105this.input.blur();
29106}
29107this._viewDate = this._getLastPickedDate().clone();
29108}
29109;
29110TempusDominusBootstrap4.prototype.show = function show() {
29111var currentMoment = void 0;
29112var useCurrentGranularity = {
29113'year': function year(m) {
29114return m.month(0).date(1).hours(0).seconds(0).minutes(0);
29115},
29116'month': function month(m) {
29117return m.date(1).hours(0).seconds(0).minutes(0);
29118},
29119'day': function day(m) {
29120return m.hours(0).seconds(0).minutes(0);
29121},
29122'hour': function hour(m) {
29123return m.seconds(0).minutes(0);
29124},
29125'minute': function minute(m) {
29126return m.seconds(0);
29127}
29128};
29129if (this.input !== undefined) {
29130if (this.input.prop('disabled') || !this._options.ignoreReadonly && this.input.prop('readonly') || this.widget) {
29131return;
29132}
29133if (this.input.val() !== undefined && this.input.val().trim().length !== 0) {
29134this._setValue(this._parseInputDate(this.input.val().trim()), 0);
29135} else if (this.unset && this._options.useCurrent) {
29136currentMoment = this.getMoment();
29137if (typeof this._options.useCurrent === 'string') {
29138currentMoment = useCurrentGranularity[this._options.useCurrent](currentMoment);
29139}
29140this._setValue(currentMoment, 0);
29141}
29142} else if (this.unset && this._options.useCurrent) {
29143currentMoment = this.getMoment();
29144if (typeof this._options.useCurrent === 'string') {
29145currentMoment = useCurrentGranularity[this._options.useCurrent](currentMoment);
29146}
29147this._setValue(currentMoment, 0);
29148}
29149this.widget = this._getTemplate();
29150this._fillDow();
29151this._fillMonths();
29152this.widget.find('.timepicker-hours').hide();
29153this.widget.find('.timepicker-minutes').hide();
29154this.widget.find('.timepicker-seconds').hide();
29155this._update();
29156this._showMode();
29157$(window).on('resize', {
29158picker: this
29159}, this._place);
29160this.widget.on('click', '[data-action]', $.proxy(this._doAction, this));
29161this.widget.on('mousedown', false);
29162if (this.component && this.component.hasClass('btn')) {
29163this.component.toggleClass('active');
29164}
29165this._place();
29166this.widget.show();
29167if (this.input !== undefined && this._options.focusOnShow && !this.input.is(':focus')) {
29168this.input.focus();
29169}
29170this._notifyEvent({
29171type: DateTimePicker.Event.SHOW
29172});
29173}
29174;
29175TempusDominusBootstrap4.prototype.destroy = function destroy() {
29176this.hide();
29177this._element.removeData(DateTimePicker.DATA_KEY);
29178this._element.removeData('date');
29179}
29180;
29181TempusDominusBootstrap4.prototype.disable = function disable() {
29182this.hide();
29183if (this.component && this.component.hasClass('btn')) {
29184this.component.addClass('disabled');
29185}
29186if (this.input !== undefined) {
29187this.input.prop('disabled', true);
29188}
29189}
29190;
29191TempusDominusBootstrap4.prototype.enable = function enable() {
29192if (this.component && this.component.hasClass('btn')) {
29193this.component.removeClass('disabled');
29194}
29195if (this.input !== undefined) {
29196this.input.prop('disabled', false);
29197}
29198}
29199;
29200TempusDominusBootstrap4.prototype.toolbarPlacement = function toolbarPlacement(_toolbarPlacement) {
29201if (arguments.length === 0) {
29202return this._options.toolbarPlacement;
29203}
29204if (typeof _toolbarPlacement !== 'string') {
29205throw new TypeError('toolbarPlacement() expects a string parameter');
29206}
29207if (toolbarPlacements.indexOf(_toolbarPlacement) === -1) {
29208throw new TypeError('toolbarPlacement() parameter must be one of (' + toolbarPlacements.join(', ') + ') value');
29209}
29210this._options.toolbarPlacement = _toolbarPlacement;
29211if (this.widget) {
29212this.hide();
29213this.show();
29214}
29215}
29216;
29217TempusDominusBootstrap4.prototype.widgetPositioning = function widgetPositioning(_widgetPositioning) {
29218if (arguments.length === 0) {
29219return $.extend({}, this._options.widgetPositioning);
29220}
29221if ({}.toString.call(_widgetPositioning) !== '[object Object]') {
29222throw new TypeError('widgetPositioning() expects an object variable');
29223}
29224if (_widgetPositioning.horizontal) {
29225if (typeof _widgetPositioning.horizontal !== 'string') {
29226throw new TypeError('widgetPositioning() horizontal variable must be a string');
29227}
29228_widgetPositioning.horizontal = _widgetPositioning.horizontal.toLowerCase();
29229if (horizontalModes.indexOf(_widgetPositioning.horizontal) === -1) {
29230throw new TypeError('widgetPositioning() expects horizontal parameter to be one of (' + horizontalModes.join(', ') + ')');
29231}
29232this._options.widgetPositioning.horizontal = _widgetPositioning.horizontal;
29233}
29234if (_widgetPositioning.vertical) {
29235if (typeof _widgetPositioning.vertical !== 'string') {
29236throw new TypeError('widgetPositioning() vertical variable must be a string');
29237}
29238_widgetPositioning.vertical = _widgetPositioning.vertical.toLowerCase();
29239if (verticalModes.indexOf(_widgetPositioning.vertical) === -1) {
29240throw new TypeError('widgetPositioning() expects vertical parameter to be one of (' + verticalModes.join(', ') + ')');
29241}
29242this._options.widgetPositioning.vertical = _widgetPositioning.vertical;
29243}
29244this._update();
29245}
29246;
29247TempusDominusBootstrap4.prototype.widgetParent = function widgetParent(_widgetParent) {
29248if (arguments.length === 0) {
29249return this._options.widgetParent;
29250}
29251if (typeof _widgetParent === 'string') {
29252_widgetParent = $(_widgetParent);
29253}
29254if (_widgetParent !== null && typeof _widgetParent !== 'string' && !(_widgetParent instanceof $)) {
29255throw new TypeError('widgetParent() expects a string or a jQuery object parameter');
29256}
29257this._options.widgetParent = _widgetParent;
29258if (this.widget) {
29259this.hide();
29260this.show();
29261}
29262}
29263;
29264TempusDominusBootstrap4._jQueryHandleThis = function _jQueryHandleThis(me, option, argument) {
29265var data = $(me).data(DateTimePicker.DATA_KEY);
29266if ((typeof option === 'undefined' ? 'undefined' : _typeof(option)) === 'object') {
29267$.extend({}, DateTimePicker.Default, option);
29268}
29269if (!data) {
29270data = new TempusDominusBootstrap4($(me),option);
29271$(me).data(DateTimePicker.DATA_KEY, data);
29272}
29273if (typeof option === 'string') {
29274if (data[option] === undefined) {
29275throw new Error('No method named "' + option + '"');
29276}
29277if (argument === undefined) {
29278return data[option]();
29279} else {
29280return data[option](argument);
29281}
29282}
29283}
29284;
29285TempusDominusBootstrap4._jQueryInterface = function _jQueryInterface(option, argument) {
29286if (this.length === 1) {
29287return TempusDominusBootstrap4._jQueryHandleThis(this[0], option, argument);
29288}
29289return this.each(function() {
29290TempusDominusBootstrap4._jQueryHandleThis(this, option, argument);
29291});
29292}
29293;
29294return TempusDominusBootstrap4;
29295}(DateTimePicker);
29296$(document).on(DateTimePicker.Event.CLICK_DATA_API, DateTimePicker.Selector.DATA_TOGGLE, function() {
29297var $target = getSelectorFromElement($(this));
29298if ($target.length === 0) {
29299return;
29300}
29301TempusDominusBootstrap4._jQueryInterface.call($target, 'toggle');
29302}).on(DateTimePicker.Event.CHANGE, '.' + DateTimePicker.ClassName.INPUT, function(event) {
29303var $target = getSelectorFromElement($(this));
29304if ($target.length === 0) {
29305return;
29306}
29307TempusDominusBootstrap4._jQueryInterface.call($target, '_change', event);
29308}).on(DateTimePicker.Event.BLUR, '.' + DateTimePicker.ClassName.INPUT, function(event) {
29309var $target = getSelectorFromElement($(this))
29310  , config = $target.data(DateTimePicker.DATA_KEY);
29311if ($target.length === 0) {
29312return;
29313}
29314if (config && config._options.debug || window.debug) {
29315return;
29316}
29317TempusDominusBootstrap4._jQueryInterface.call($target, 'hide', event);
29318}).on(DateTimePicker.Event.KEYDOWN, '.' + DateTimePicker.ClassName.INPUT, function(event) {
29319var $target = getSelectorFromElement($(this));
29320if ($target.length === 0) {
29321return;
29322}
29323TempusDominusBootstrap4._jQueryInterface.call($target, '_keydown', event);
29324}).on(DateTimePicker.Event.KEYUP, '.' + DateTimePicker.ClassName.INPUT, function(event) {
29325var $target = getSelectorFromElement($(this));
29326if ($target.length === 0) {
29327return;
29328}
29329TempusDominusBootstrap4._jQueryInterface.call($target, '_keyup', event);
29330}).on(DateTimePicker.Event.FOCUS, '.' + DateTimePicker.ClassName.INPUT, function(event) {
29331var $target = getSelectorFromElement($(this))
29332  , config = $target.data(DateTimePicker.DATA_KEY);
29333if ($target.length === 0) {
29334return;
29335}
29336if (!config._options.allowInputToggle) {
29337return;
29338}
29339TempusDominusBootstrap4._jQueryInterface.call($target, 'show', event);
29340});
29341$.fn[DateTimePicker.NAME] = TempusDominusBootstrap4._jQueryInterface;
29342$.fn[DateTimePicker.NAME].Constructor = TempusDominusBootstrap4;
29343$.fn[DateTimePicker.NAME].noConflict = function() {
29344$.fn[DateTimePicker.NAME] = JQUERY_NO_CONFLICT;
29345return TempusDominusBootstrap4._jQueryInterface;
29346}
29347;
29348return TempusDominusBootstrap4;
29349}(jQuery);
29350}();
29351;
29352/* /web/static/lib/select2/select2.js defined in bundle 'web.assets_common' */
29353(function($) {
29354if (typeof $.fn.each2 == "undefined") {
29355$.extend($.fn, {
29356each2: function(c) {
29357var j = $([0])
29358  , i = -1
29359  , l = this.length;
29360while (++i < l && (j.context = j[0] = this[i]) && c.call(j[0], i, j) !== false)
29361;
29362return this;
29363}
29364});
29365}
29366}
29367)(jQuery);
29368(function($, undefined) {
29369"use strict";
29370if (window.Select2 !== undefined) {
29371return;
29372}
29373var KEY, AbstractSelect2, SingleSelect2, MultiSelect2, nextUid, sizer, lastMousePosition = {
29374x: 0,
29375y: 0
29376}, $document, scrollBarDimensions, KEY = {
29377TAB: 9,
29378ENTER: 13,
29379ESC: 27,
29380SPACE: 32,
29381LEFT: 37,
29382UP: 38,
29383RIGHT: 39,
29384DOWN: 40,
29385SHIFT: 16,
29386CTRL: 17,
29387ALT: 18,
29388PAGE_UP: 33,
29389PAGE_DOWN: 34,
29390HOME: 36,
29391END: 35,
29392BACKSPACE: 8,
29393DELETE: 46,
29394isArrow: function(k) {
29395k = k.which ? k.which : k;
29396switch (k) {
29397case KEY.LEFT:
29398case KEY.RIGHT:
29399case KEY.UP:
29400case KEY.DOWN:
29401return true;
29402}
29403return false;
29404},
29405isControl: function(e) {
29406var k = e.which;
29407switch (k) {
29408case KEY.SHIFT:
29409case KEY.CTRL:
29410case KEY.ALT:
29411return true;
29412}
29413if (e.metaKey)
29414return true;
29415return false;
29416},
29417isFunctionKey: function(k) {
29418k = k.which ? k.which : k;
29419return k >= 112 && k <= 123;
29420}
29421}, MEASURE_SCROLLBAR_TEMPLATE = "<div class='select2-measure-scrollbar'></div>", DIACRITICS = {
29422"\u24B6": "A",
29423"\uFF21": "A",
29424"\u00C0": "A",
29425"\u00C1": "A",
29426"\u00C2": "A",
29427"\u1EA6": "A",
29428"\u1EA4": "A",
29429"\u1EAA": "A",
29430"\u1EA8": "A",
29431"\u00C3": "A",
29432"\u0100": "A",
29433"\u0102": "A",
29434"\u1EB0": "A",
29435"\u1EAE": "A",
29436"\u1EB4": "A",
29437"\u1EB2": "A",
29438"\u0226": "A",
29439"\u01E0": "A",
29440"\u00C4": "A",
29441"\u01DE": "A",
29442"\u1EA2": "A",
29443"\u00C5": "A",
29444"\u01FA": "A",
29445"\u01CD": "A",
29446"\u0200": "A",
29447"\u0202": "A",
29448"\u1EA0": "A",
29449"\u1EAC": "A",
29450"\u1EB6": "A",
29451"\u1E00": "A",
29452"\u0104": "A",
29453"\u023A": "A",
29454"\u2C6F": "A",
29455"\uA732": "AA",
29456"\u00C6": "AE",
29457"\u01FC": "AE",
29458"\u01E2": "AE",
29459"\uA734": "AO",
29460"\uA736": "AU",
29461"\uA738": "AV",
29462"\uA73A": "AV",
29463"\uA73C": "AY",
29464"\u24B7": "B",
29465"\uFF22": "B",
29466"\u1E02": "B",
29467"\u1E04": "B",
29468"\u1E06": "B",
29469"\u0243": "B",
29470"\u0182": "B",
29471"\u0181": "B",
29472"\u24B8": "C",
29473"\uFF23": "C",
29474"\u0106": "C",
29475"\u0108": "C",
29476"\u010A": "C",
29477"\u010C": "C",
29478"\u00C7": "C",
29479"\u1E08": "C",
29480"\u0187": "C",
29481"\u023B": "C",
29482"\uA73E": "C",
29483"\u24B9": "D",
29484"\uFF24": "D",
29485"\u1E0A": "D",
29486"\u010E": "D",
29487"\u1E0C": "D",
29488"\u1E10": "D",
29489"\u1E12": "D",
29490"\u1E0E": "D",
29491"\u0110": "D",
29492"\u018B": "D",
29493"\u018A": "D",
29494"\u0189": "D",
29495"\uA779": "D",
29496"\u01F1": "DZ",
29497"\u01C4": "DZ",
29498"\u01F2": "Dz",
29499"\u01C5": "Dz",
29500"\u24BA": "E",
29501"\uFF25": "E",
29502"\u00C8": "E",
29503"\u00C9": "E",
29504"\u00CA": "E",
29505"\u1EC0": "E",
29506"\u1EBE": "E",
29507"\u1EC4": "E",
29508"\u1EC2": "E",
29509"\u1EBC": "E",
29510"\u0112": "E",
29511"\u1E14": "E",
29512"\u1E16": "E",
29513"\u0114": "E",
29514"\u0116": "E",
29515"\u00CB": "E",
29516"\u1EBA": "E",
29517"\u011A": "E",
29518"\u0204": "E",
29519"\u0206": "E",
29520"\u1EB8": "E",
29521"\u1EC6": "E",
29522"\u0228": "E",
29523"\u1E1C": "E",
29524"\u0118": "E",
29525"\u1E18": "E",
29526"\u1E1A": "E",
29527"\u0190": "E",
29528"\u018E": "E",
29529"\u24BB": "F",
29530"\uFF26": "F",
29531"\u1E1E": "F",
29532"\u0191": "F",
29533"\uA77B": "F",
29534"\u24BC": "G",
29535"\uFF27": "G",
29536"\u01F4": "G",
29537"\u011C": "G",
29538"\u1E20": "G",
29539"\u011E": "G",
29540"\u0120": "G",
29541"\u01E6": "G",
29542"\u0122": "G",
29543"\u01E4": "G",
29544"\u0193": "G",
29545"\uA7A0": "G",
29546"\uA77D": "G",
29547"\uA77E": "G",
29548"\u24BD": "H",
29549"\uFF28": "H",
29550"\u0124": "H",
29551"\u1E22": "H",
29552"\u1E26": "H",
29553"\u021E": "H",
29554"\u1E24": "H",
29555"\u1E28": "H",
29556"\u1E2A": "H",
29557"\u0126": "H",
29558"\u2C67": "H",
29559"\u2C75": "H",
29560"\uA78D": "H",
29561"\u24BE": "I",
29562"\uFF29": "I",
29563"\u00CC": "I",
29564"\u00CD": "I",
29565"\u00CE": "I",
29566"\u0128": "I",
29567"\u012A": "I",
29568"\u012C": "I",
29569"\u0130": "I",
29570"\u00CF": "I",
29571"\u1E2E": "I",
29572"\u1EC8": "I",
29573"\u01CF": "I",
29574"\u0208": "I",
29575"\u020A": "I",
29576"\u1ECA": "I",
29577"\u012E": "I",
29578"\u1E2C": "I",
29579"\u0197": "I",
29580"\u24BF": "J",
29581"\uFF2A": "J",
29582"\u0134": "J",
29583"\u0248": "J",
29584"\u24C0": "K",
29585"\uFF2B": "K",
29586"\u1E30": "K",
29587"\u01E8": "K",
29588"\u1E32": "K",
29589"\u0136": "K",
29590"\u1E34": "K",
29591"\u0198": "K",
29592"\u2C69": "K",
29593"\uA740": "K",
29594"\uA742": "K",
29595"\uA744": "K",
29596"\uA7A2": "K",
29597"\u24C1": "L",
29598"\uFF2C": "L",
29599"\u013F": "L",
29600"\u0139": "L",
29601"\u013D": "L",
29602"\u1E36": "L",
29603"\u1E38": "L",
29604"\u013B": "L",
29605"\u1E3C": "L",
29606"\u1E3A": "L",
29607"\u0141": "L",
29608"\u023D": "L",
29609"\u2C62": "L",
29610"\u2C60": "L",
29611"\uA748": "L",
29612"\uA746": "L",
29613"\uA780": "L",
29614"\u01C7": "LJ",
29615"\u01C8": "Lj",
29616"\u24C2": "M",
29617"\uFF2D": "M",
29618"\u1E3E": "M",
29619"\u1E40": "M",
29620"\u1E42": "M",
29621"\u2C6E": "M",
29622"\u019C": "M",
29623"\u24C3": "N",
29624"\uFF2E": "N",
29625"\u01F8": "N",
29626"\u0143": "N",
29627"\u00D1": "N",
29628"\u1E44": "N",
29629"\u0147": "N",
29630"\u1E46": "N",
29631"\u0145": "N",
29632"\u1E4A": "N",
29633"\u1E48": "N",
29634"\u0220": "N",
29635"\u019D": "N",
29636"\uA790": "N",
29637"\uA7A4": "N",
29638"\u01CA": "NJ",
29639"\u01CB": "Nj",
29640"\u24C4": "O",
29641"\uFF2F": "O",
29642"\u00D2": "O",
29643"\u00D3": "O",
29644"\u00D4": "O",
29645"\u1ED2": "O",
29646"\u1ED0": "O",
29647"\u1ED6": "O",
29648"\u1ED4": "O",
29649"\u00D5": "O",
29650"\u1E4C": "O",
29651"\u022C": "O",
29652"\u1E4E": "O",
29653"\u014C": "O",
29654"\u1E50": "O",
29655"\u1E52": "O",
29656"\u014E": "O",
29657"\u022E": "O",
29658"\u0230": "O",
29659"\u00D6": "O",
29660"\u022A": "O",
29661"\u1ECE": "O",
29662"\u0150": "O",
29663"\u01D1": "O",
29664"\u020C": "O",
29665"\u020E": "O",
29666"\u01A0": "O",
29667"\u1EDC": "O",
29668"\u1EDA": "O",
29669"\u1EE0": "O",
29670"\u1EDE": "O",
29671"\u1EE2": "O",
29672"\u1ECC": "O",
29673"\u1ED8": "O",
29674"\u01EA": "O",
29675"\u01EC": "O",
29676"\u00D8": "O",
29677"\u01FE": "O",
29678"\u0186": "O",
29679"\u019F": "O",
29680"\uA74A": "O",
29681"\uA74C": "O",
29682"\u01A2": "OI",
29683"\uA74E": "OO",
29684"\u0222": "OU",
29685"\u24C5": "P",
29686"\uFF30": "P",
29687"\u1E54": "P",
29688"\u1E56": "P",
29689"\u01A4": "P",
29690"\u2C63": "P",
29691"\uA750": "P",
29692"\uA752": "P",
29693"\uA754": "P",
29694"\u24C6": "Q",
29695"\uFF31": "Q",
29696"\uA756": "Q",
29697"\uA758": "Q",
29698"\u024A": "Q",
29699"\u24C7": "R",
29700"\uFF32": "R",
29701"\u0154": "R",
29702"\u1E58": "R",
29703"\u0158": "R",
29704"\u0210": "R",
29705"\u0212": "R",
29706"\u1E5A": "R",
29707"\u1E5C": "R",
29708"\u0156": "R",
29709"\u1E5E": "R",
29710"\u024C": "R",
29711"\u2C64": "R",
29712"\uA75A": "R",
29713"\uA7A6": "R",
29714"\uA782": "R",
29715"\u24C8": "S",
29716"\uFF33": "S",
29717"\u1E9E": "S",
29718"\u015A": "S",
29719"\u1E64": "S",
29720"\u015C": "S",
29721"\u1E60": "S",
29722"\u0160": "S",
29723"\u1E66": "S",
29724"\u1E62": "S",
29725"\u1E68": "S",
29726"\u0218": "S",
29727"\u015E": "S",
29728"\u2C7E": "S",
29729"\uA7A8": "S",
29730"\uA784": "S",
29731"\u24C9": "T",
29732"\uFF34": "T",
29733"\u1E6A": "T",
29734"\u0164": "T",
29735"\u1E6C": "T",
29736"\u021A": "T",
29737"\u0162": "T",
29738"\u1E70": "T",
29739"\u1E6E": "T",
29740"\u0166": "T",
29741"\u01AC": "T",
29742"\u01AE": "T",
29743"\u023E": "T",
29744"\uA786": "T",
29745"\uA728": "TZ",
29746"\u24CA": "U",
29747"\uFF35": "U",
29748"\u00D9": "U",
29749"\u00DA": "U",
29750"\u00DB": "U",
29751"\u0168": "U",
29752"\u1E78": "U",
29753"\u016A": "U",
29754"\u1E7A": "U",
29755"\u016C": "U",
29756"\u00DC": "U",
29757"\u01DB": "U",
29758"\u01D7": "U",
29759"\u01D5": "U",
29760"\u01D9": "U",
29761"\u1EE6": "U",
29762"\u016E": "U",
29763"\u0170": "U",
29764"\u01D3": "U",
29765"\u0214": "U",
29766"\u0216": "U",
29767"\u01AF": "U",
29768"\u1EEA": "U",
29769"\u1EE8": "U",
29770"\u1EEE": "U",
29771"\u1EEC": "U",
29772"\u1EF0": "U",
29773"\u1EE4": "U",
29774"\u1E72": "U",
29775"\u0172": "U",
29776"\u1E76": "U",
29777"\u1E74": "U",
29778"\u0244": "U",
29779"\u24CB": "V",
29780"\uFF36": "V",
29781"\u1E7C": "V",
29782"\u1E7E": "V",
29783"\u01B2": "V",
29784"\uA75E": "V",
29785"\u0245": "V",
29786"\uA760": "VY",
29787"\u24CC": "W",
29788"\uFF37": "W",
29789"\u1E80": "W",
29790"\u1E82": "W",
29791"\u0174": "W",
29792"\u1E86": "W",
29793"\u1E84": "W",
29794"\u1E88": "W",
29795"\u2C72": "W",
29796"\u24CD": "X",
29797"\uFF38": "X",
29798"\u1E8A": "X",
29799"\u1E8C": "X",
29800"\u24CE": "Y",
29801"\uFF39": "Y",
29802"\u1EF2": "Y",
29803"\u00DD": "Y",
29804"\u0176": "Y",
29805"\u1EF8": "Y",
29806"\u0232": "Y",
29807"\u1E8E": "Y",
29808"\u0178": "Y",
29809"\u1EF6": "Y",
29810"\u1EF4": "Y",
29811"\u01B3": "Y",
29812"\u024E": "Y",
29813"\u1EFE": "Y",
29814"\u24CF": "Z",
29815"\uFF3A": "Z",
29816"\u0179": "Z",
29817"\u1E90": "Z",
29818"\u017B": "Z",
29819"\u017D": "Z",
29820"\u1E92": "Z",
29821"\u1E94": "Z",
29822"\u01B5": "Z",
29823"\u0224": "Z",
29824"\u2C7F": "Z",
29825"\u2C6B": "Z",
29826"\uA762": "Z",
29827"\u24D0": "a",
29828"\uFF41": "a",
29829"\u1E9A": "a",
29830"\u00E0": "a",
29831"\u00E1": "a",
29832"\u00E2": "a",
29833"\u1EA7": "a",
29834"\u1EA5": "a",
29835"\u1EAB": "a",
29836"\u1EA9": "a",
29837"\u00E3": "a",
29838"\u0101": "a",
29839"\u0103": "a",
29840"\u1EB1": "a",
29841"\u1EAF": "a",
29842"\u1EB5": "a",
29843"\u1EB3": "a",
29844"\u0227": "a",
29845"\u01E1": "a",
29846"\u00E4": "a",
29847"\u01DF": "a",
29848"\u1EA3": "a",
29849"\u00E5": "a",
29850"\u01FB": "a",
29851"\u01CE": "a",
29852"\u0201": "a",
29853"\u0203": "a",
29854"\u1EA1": "a",
29855"\u1EAD": "a",
29856"\u1EB7": "a",
29857"\u1E01": "a",
29858"\u0105": "a",
29859"\u2C65": "a",
29860"\u0250": "a",
29861"\uA733": "aa",
29862"\u00E6": "ae",
29863"\u01FD": "ae",
29864"\u01E3": "ae",
29865"\uA735": "ao",
29866"\uA737": "au",
29867"\uA739": "av",
29868"\uA73B": "av",
29869"\uA73D": "ay",
29870"\u24D1": "b",
29871"\uFF42": "b",
29872"\u1E03": "b",
29873"\u1E05": "b",
29874"\u1E07": "b",
29875"\u0180": "b",
29876"\u0183": "b",
29877"\u0253": "b",
29878"\u24D2": "c",
29879"\uFF43": "c",
29880"\u0107": "c",
29881"\u0109": "c",
29882"\u010B": "c",
29883"\u010D": "c",
29884"\u00E7": "c",
29885"\u1E09": "c",
29886"\u0188": "c",
29887"\u023C": "c",
29888"\uA73F": "c",
29889"\u2184": "c",
29890"\u24D3": "d",
29891"\uFF44": "d",
29892"\u1E0B": "d",
29893"\u010F": "d",
29894"\u1E0D": "d",
29895"\u1E11": "d",
29896"\u1E13": "d",
29897"\u1E0F": "d",
29898"\u0111": "d",
29899"\u018C": "d",
29900"\u0256": "d",
29901"\u0257": "d",
29902"\uA77A": "d",
29903"\u01F3": "dz",
29904"\u01C6": "dz",
29905"\u24D4": "e",
29906"\uFF45": "e",
29907"\u00E8": "e",
29908"\u00E9": "e",
29909"\u00EA": "e",
29910"\u1EC1": "e",
29911"\u1EBF": "e",
29912"\u1EC5": "e",
29913"\u1EC3": "e",
29914"\u1EBD": "e",
29915"\u0113": "e",
29916"\u1E15": "e",
29917"\u1E17": "e",
29918"\u0115": "e",
29919"\u0117": "e",
29920"\u00EB": "e",
29921"\u1EBB": "e",
29922"\u011B": "e",
29923"\u0205": "e",
29924"\u0207": "e",
29925"\u1EB9": "e",
29926"\u1EC7": "e",
29927"\u0229": "e",
29928"\u1E1D": "e",
29929"\u0119": "e",
29930"\u1E19": "e",
29931"\u1E1B": "e",
29932"\u0247": "e",
29933"\u025B": "e",
29934"\u01DD": "e",
29935"\u24D5": "f",
29936"\uFF46": "f",
29937"\u1E1F": "f",
29938"\u0192": "f",
29939"\uA77C": "f",
29940"\u24D6": "g",
29941"\uFF47": "g",
29942"\u01F5": "g",
29943"\u011D": "g",
29944"\u1E21": "g",
29945"\u011F": "g",
29946"\u0121": "g",
29947"\u01E7": "g",
29948"\u0123": "g",
29949"\u01E5": "g",
29950"\u0260": "g",
29951"\uA7A1": "g",
29952"\u1D79": "g",
29953"\uA77F": "g",
29954"\u24D7": "h",
29955"\uFF48": "h",
29956"\u0125": "h",
29957"\u1E23": "h",
29958"\u1E27": "h",
29959"\u021F": "h",
29960"\u1E25": "h",
29961"\u1E29": "h",
29962"\u1E2B": "h",
29963"\u1E96": "h",
29964"\u0127": "h",
29965"\u2C68": "h",
29966"\u2C76": "h",
29967"\u0265": "h",
29968"\u0195": "hv",
29969"\u24D8": "i",
29970"\uFF49": "i",
29971"\u00EC": "i",
29972"\u00ED": "i",
29973"\u00EE": "i",
29974"\u0129": "i",
29975"\u012B": "i",
29976"\u012D": "i",
29977"\u00EF": "i",
29978"\u1E2F": "i",
29979"\u1EC9": "i",
29980"\u01D0": "i",
29981"\u0209": "i",
29982"\u020B": "i",
29983"\u1ECB": "i",
29984"\u012F": "i",
29985"\u1E2D": "i",
29986"\u0268": "i",
29987"\u0131": "i",
29988"\u24D9": "j",
29989"\uFF4A": "j",
29990"\u0135": "j",
29991"\u01F0": "j",
29992"\u0249": "j",
29993"\u24DA": "k",
29994"\uFF4B": "k",
29995"\u1E31": "k",
29996"\u01E9": "k",
29997"\u1E33": "k",
29998"\u0137": "k",
29999"\u1E35": "k",
30000"\u0199": "k",
30001"\u2C6A": "k",
30002"\uA741": "k",
30003"\uA743": "k",
30004"\uA745": "k",
30005"\uA7A3": "k",
30006"\u24DB": "l",
30007"\uFF4C": "l",
30008"\u0140": "l",
30009"\u013A": "l",
30010"\u013E": "l",
30011"\u1E37": "l",
30012"\u1E39": "l",
30013"\u013C": "l",
30014"\u1E3D": "l",
30015"\u1E3B": "l",
30016"\u017F": "l",
30017"\u0142": "l",
30018"\u019A": "l",
30019"\u026B": "l",
30020"\u2C61": "l",
30021"\uA749": "l",
30022"\uA781": "l",
30023"\uA747": "l",
30024"\u01C9": "lj",
30025"\u24DC": "m",
30026"\uFF4D": "m",
30027"\u1E3F": "m",
30028"\u1E41": "m",
30029"\u1E43": "m",
30030"\u0271": "m",
30031"\u026F": "m",
30032"\u24DD": "n",
30033"\uFF4E": "n",
30034"\u01F9": "n",
30035"\u0144": "n",
30036"\u00F1": "n",
30037"\u1E45": "n",
30038"\u0148": "n",
30039"\u1E47": "n",
30040"\u0146": "n",
30041"\u1E4B": "n",
30042"\u1E49": "n",
30043"\u019E": "n",
30044"\u0272": "n",
30045"\u0149": "n",
30046"\uA791": "n",
30047"\uA7A5": "n",
30048"\u01CC": "nj",
30049"\u24DE": "o",
30050"\uFF4F": "o",
30051"\u00F2": "o",
30052"\u00F3": "o",
30053"\u00F4": "o",
30054"\u1ED3": "o",
30055"\u1ED1": "o",
30056"\u1ED7": "o",
30057"\u1ED5": "o",
30058"\u00F5": "o",
30059"\u1E4D": "o",
30060"\u022D": "o",
30061"\u1E4F": "o",
30062"\u014D": "o",
30063"\u1E51": "o",
30064"\u1E53": "o",
30065"\u014F": "o",
30066"\u022F": "o",
30067"\u0231": "o",
30068"\u00F6": "o",
30069"\u022B": "o",
30070"\u1ECF": "o",
30071"\u0151": "o",
30072"\u01D2": "o",
30073"\u020D": "o",
30074"\u020F": "o",
30075"\u01A1": "o",
30076"\u1EDD": "o",
30077"\u1EDB": "o",
30078"\u1EE1": "o",
30079"\u1EDF": "o",
30080"\u1EE3": "o",
30081"\u1ECD": "o",
30082"\u1ED9": "o",
30083"\u01EB": "o",
30084"\u01ED": "o",
30085"\u00F8": "o",
30086"\u01FF": "o",
30087"\u0254": "o",
30088"\uA74B": "o",
30089"\uA74D": "o",
30090"\u0275": "o",
30091"\u01A3": "oi",
30092"\u0223": "ou",
30093"\uA74F": "oo",
30094"\u24DF": "p",
30095"\uFF50": "p",
30096"\u1E55": "p",
30097"\u1E57": "p",
30098"\u01A5": "p",
30099"\u1D7D": "p",
30100"\uA751": "p",
30101"\uA753": "p",
30102"\uA755": "p",
30103"\u24E0": "q",
30104"\uFF51": "q",
30105"\u024B": "q",
30106"\uA757": "q",
30107"\uA759": "q",
30108"\u24E1": "r",
30109"\uFF52": "r",
30110"\u0155": "r",
30111"\u1E59": "r",
30112"\u0159": "r",
30113"\u0211": "r",
30114"\u0213": "r",
30115"\u1E5B": "r",
30116"\u1E5D": "r",
30117"\u0157": "r",
30118"\u1E5F": "r",
30119"\u024D": "r",
30120"\u027D": "r",
30121"\uA75B": "r",
30122"\uA7A7": "r",
30123"\uA783": "r",
30124"\u24E2": "s",
30125"\uFF53": "s",
30126"\u00DF": "s",
30127"\u015B": "s",
30128"\u1E65": "s",
30129"\u015D": "s",
30130"\u1E61": "s",
30131"\u0161": "s",
30132"\u1E67": "s",
30133"\u1E63": "s",
30134"\u1E69": "s",
30135"\u0219": "s",
30136"\u015F": "s",
30137"\u023F": "s",
30138"\uA7A9": "s",
30139"\uA785": "s",
30140"\u1E9B": "s",
30141"\u24E3": "t",
30142"\uFF54": "t",
30143"\u1E6B": "t",
30144"\u1E97": "t",
30145"\u0165": "t",
30146"\u1E6D": "t",
30147"\u021B": "t",
30148"\u0163": "t",
30149"\u1E71": "t",
30150"\u1E6F": "t",
30151"\u0167": "t",
30152"\u01AD": "t",
30153"\u0288": "t",
30154"\u2C66": "t",
30155"\uA787": "t",
30156"\uA729": "tz",
30157"\u24E4": "u",
30158"\uFF55": "u",
30159"\u00F9": "u",
30160"\u00FA": "u",
30161"\u00FB": "u",
30162"\u0169": "u",
30163"\u1E79": "u",
30164"\u016B": "u",
30165"\u1E7B": "u",
30166"\u016D": "u",
30167"\u00FC": "u",
30168"\u01DC": "u",
30169"\u01D8": "u",
30170"\u01D6": "u",
30171"\u01DA": "u",
30172"\u1EE7": "u",
30173"\u016F": "u",
30174"\u0171": "u",
30175"\u01D4": "u",
30176"\u0215": "u",
30177"\u0217": "u",
30178"\u01B0": "u",
30179"\u1EEB": "u",
30180"\u1EE9": "u",
30181"\u1EEF": "u",
30182"\u1EED": "u",
30183"\u1EF1": "u",
30184"\u1EE5": "u",
30185"\u1E73": "u",
30186"\u0173": "u",
30187"\u1E77": "u",
30188"\u1E75": "u",
30189"\u0289": "u",
30190"\u24E5": "v",
30191"\uFF56": "v",
30192"\u1E7D": "v",
30193"\u1E7F": "v",
30194"\u028B": "v",
30195"\uA75F": "v",
30196"\u028C": "v",
30197"\uA761": "vy",
30198"\u24E6": "w",
30199"\uFF57": "w",
30200"\u1E81": "w",
30201"\u1E83": "w",
30202"\u0175": "w",
30203"\u1E87": "w",
30204"\u1E85": "w",
30205"\u1E98": "w",
30206"\u1E89": "w",
30207"\u2C73": "w",
30208"\u24E7": "x",
30209"\uFF58": "x",
30210"\u1E8B": "x",
30211"\u1E8D": "x",
30212"\u24E8": "y",
30213"\uFF59": "y",
30214"\u1EF3": "y",
30215"\u00FD": "y",
30216"\u0177": "y",
30217"\u1EF9": "y",
30218"\u0233": "y",
30219"\u1E8F": "y",
30220"\u00FF": "y",
30221"\u1EF7": "y",
30222"\u1E99": "y",
30223"\u1EF5": "y",
30224"\u01B4": "y",
30225"\u024F": "y",
30226"\u1EFF": "y",
30227"\u24E9": "z",
30228"\uFF5A": "z",
30229"\u017A": "z",
30230"\u1E91": "z",
30231"\u017C": "z",
30232"\u017E": "z",
30233"\u1E93": "z",
30234"\u1E95": "z",
30235"\u01B6": "z",
30236"\u0225": "z",
30237"\u0240": "z",
30238"\u2C6C": "z",
30239"\uA763": "z",
30240"\u0386": "\u0391",
30241"\u0388": "\u0395",
30242"\u0389": "\u0397",
30243"\u038A": "\u0399",
30244"\u03AA": "\u0399",
30245"\u038C": "\u039F",
30246"\u038E": "\u03A5",
30247"\u03AB": "\u03A5",
30248"\u038F": "\u03A9",
30249"\u03AC": "\u03B1",
30250"\u03AD": "\u03B5",
30251"\u03AE": "\u03B7",
30252"\u03AF": "\u03B9",
30253"\u03CA": "\u03B9",
30254"\u0390": "\u03B9",
30255"\u03CC": "\u03BF",
30256"\u03CD": "\u03C5",
30257"\u03CB": "\u03C5",
30258"\u03B0": "\u03C5",
30259"\u03C9": "\u03C9",
30260"\u03C2": "\u03C3"
30261};
30262$document = $(document);
30263nextUid = (function() {
30264var counter = 1;
30265return function() {
30266return counter++;
30267}
30268;
30269}());
30270function reinsertElement(element) {
30271var placeholder = $(document.createTextNode(''));
30272element.before(placeholder);
30273placeholder.before(element);
30274placeholder.remove();
30275}
30276function stripDiacritics(str) {
30277function match(a) {
30278return DIACRITICS[a] || a;
30279}
30280return str.replace(/[^\u0000-\u007E]/g, match);
30281}
30282function indexOf(value, array) {
30283var i = 0
30284  , l = array.length;
30285for (; i < l; i = i + 1) {
30286if (equal(value, array[i]))
30287return i;
30288}
30289return -1;
30290}
30291function measureScrollbar() {
30292var $template = $(MEASURE_SCROLLBAR_TEMPLATE);
30293$template.appendTo('body');
30294var dim = {
30295width: $template.width() - $template[0].clientWidth,
30296height: $template.height() - $template[0].clientHeight
30297};
30298$template.remove();
30299return dim;
30300}
30301function equal(a, b) {
30302if (a === b)
30303return true;
30304if (a === undefined || b === undefined)
30305return false;
30306if (a === null || b === null)
30307return false;
30308if (a.constructor === String)
30309return a + '' === b + '';
30310if (b.constructor === String)
30311return b + '' === a + '';
30312return false;
30313}
30314function splitVal(string, separator) {
30315var val, i, l;
30316if (string === null || string.length < 1)
30317return [];
30318val = string.split(separator);
30319for (i = 0,
30320l = val.length; i < l; i = i + 1)
30321val[i] = $.trim(val[i]);
30322return val;
30323}
30324function getSideBorderPadding(element) {
30325return element.outerWidth(false) - element.width();
30326}
30327function installKeyUpChangeEvent(element) {
30328var key = "keyup-change-value";
30329element.on("keydown", function() {
30330if ($.data(element, key) === undefined) {
30331$.data(element, key, element.val());
30332}
30333});
30334element.on("keyup", function() {
30335var val = $.data(element, key);
30336if (val !== undefined && element.val() !== val) {
30337$.removeData(element, key);
30338element.trigger("keyup-change");
30339}
30340});
30341}
30342function installFilteredMouseMove(element) {
30343element.on("mousemove", function(e) {
30344var lastpos = lastMousePosition;
30345if (lastpos === undefined || lastpos.x !== e.pageX || lastpos.y !== e.pageY) {
30346$(e.target).trigger("mousemove-filtered", e);
30347}
30348});
30349}
30350function debounce(quietMillis, fn, ctx) {
30351ctx = ctx || undefined;
30352var timeout;
30353return function() {
30354var args = arguments;
30355window.clearTimeout(timeout);
30356timeout = window.setTimeout(function() {
30357fn.apply(ctx, args);
30358}, quietMillis);
30359}
30360;
30361}
30362function installDebouncedScroll(threshold, element) {
30363var notify = debounce(threshold, function(e) {
30364element.trigger("scroll-debounced", e);
30365});
30366element.on("scroll", function(e) {
30367if (indexOf(e.target, element.get()) >= 0)
30368notify(e);
30369});
30370}
30371function focus($el) {
30372if ($el[0] === document.activeElement)
30373return;
30374window.setTimeout(function() {
30375var el = $el[0], pos = $el.val().length, range;
30376$el.focus();
30377var isVisible = (el.offsetWidth > 0 || el.offsetHeight > 0);
30378if (isVisible && el === document.activeElement) {
30379if (el.setSelectionRange) {
30380el.setSelectionRange(pos, pos);
30381} else if (el.createTextRange) {
30382range = el.createTextRange();
30383range.collapse(false);
30384range.select();
30385}
30386}
30387}, 0);
30388}
30389function getCursorInfo(el) {
30390el = $(el)[0];
30391var offset = 0;
30392var length = 0;
30393if ('selectionStart'in el) {
30394offset = el.selectionStart;
30395length = el.selectionEnd - offset;
30396} else if ('selection'in document) {
30397el.focus();
30398var sel = document.selection.createRange();
30399length = document.selection.createRange().text.length;
30400sel.moveStart('character', -el.value.length);
30401offset = sel.text.length - length;
30402}
30403return {
30404offset: offset,
30405length: length
30406};
30407}
30408function killEvent(event) {
30409event.preventDefault();
30410event.stopPropagation();
30411}
30412function killEventImmediately(event) {
30413event.preventDefault();
30414event.stopImmediatePropagation();
30415}
30416function measureTextWidth(e) {
30417if (!sizer) {
30418var style = e[0].currentStyle || window.getComputedStyle(e[0], null);
30419sizer = $(document.createElement("div")).css({
30420position: "absolute",
30421left: "-10000px",
30422top: "-10000px",
30423display: "none",
30424fontSize: style.fontSize,
30425fontFamily: style.fontFamily,
30426fontStyle: style.fontStyle,
30427fontWeight: style.fontWeight,
30428letterSpacing: style.letterSpacing,
30429textTransform: style.textTransform,
30430whiteSpace: "nowrap"
30431});
30432sizer.attr("class", "select2-sizer");
30433$("body").append(sizer);
30434}
30435sizer.text(e.val());
30436return sizer.width();
30437}
30438function syncCssClasses(dest, src, adapter) {
30439var classes, replacements = [], adapted;
30440classes = $.trim(dest.attr("class"));
30441if (classes) {
30442classes = '' + classes;
30443$(classes.split(/\s+/)).each2(function() {
30444if (this.indexOf("select2-") === 0) {
30445replacements.push(this);
30446}
30447});
30448}
30449classes = $.trim(src.attr("class"));
30450if (classes) {
30451classes = '' + classes;
30452$(classes.split(/\s+/)).each2(function() {
30453if (this.indexOf("select2-") !== 0) {
30454adapted = adapter(this);
30455if (adapted) {
30456replacements.push(adapted);
30457}
30458}
30459});
30460}
30461dest.attr("class", replacements.join(" "));
30462}
30463function markMatch(text, term, markup, escapeMarkup) {
30464var match = stripDiacritics(text.toUpperCase()).indexOf(stripDiacritics(term.toUpperCase()))
30465  , tl = term.length;
30466if (match < 0) {
30467markup.push(escapeMarkup(text));
30468return;
30469}
30470markup.push(escapeMarkup(text.substring(0, match)));
30471markup.push("<span class='select2-match'>");
30472markup.push(escapeMarkup(text.substring(match, match + tl)));
30473markup.push("</span>");
30474markup.push(escapeMarkup(text.substring(match + tl, text.length)));
30475}
30476function defaultEscapeMarkup(markup) {
30477var replace_map = {
30478'\\': '&#92;',
30479'&': '&amp;',
30480'<': '&lt;',
30481'>': '&gt;',
30482'"': '&quot;',
30483"'": '&#39;',
30484"/": '&#47;'
30485};
30486return String(markup).replace(/[&<>"'\/\\]/g, function(match) {
30487return replace_map[match];
30488});
30489}
30490function ajax(options) {
30491var timeout, handler = null, quietMillis = options.quietMillis || 100, ajaxUrl = options.url, self = this;
30492return function(query) {
30493window.clearTimeout(timeout);
30494timeout = window.setTimeout(function() {
30495var data = options.data
30496  , url = ajaxUrl
30497  , transport = options.transport || $.fn.select2.ajaxDefaults.transport
30498  , deprecated = {
30499type: options.type || 'GET',
30500cache: options.cache || false,
30501jsonpCallback: options.jsonpCallback || undefined,
30502dataType: options.dataType || "json"
30503}
30504  , params = $.extend({}, $.fn.select2.ajaxDefaults.params, deprecated);
30505data = data ? data.call(self, query.term, query.page, query.context) : null;
30506url = (typeof url === 'function') ? url.call(self, query.term, query.page, query.context) : url;
30507if (handler && typeof handler.abort === "function") {
30508handler.abort();
30509}
30510if (options.params) {
30511if ($.isFunction(options.params)) {
30512$.extend(params, options.params.call(self));
30513} else {
30514$.extend(params, options.params);
30515}
30516}
30517$.extend(params, {
30518url: url,
30519dataType: options.dataType,
30520data: data,
30521success: function(data) {
30522var results = options.results(data, query.page, query);
30523query.callback(results);
30524},
30525error: function(jqXHR, textStatus, errorThrown) {
30526var results = {
30527hasError: true,
30528jqXHR: jqXHR,
30529textStatus: textStatus,
30530errorThrown: errorThrown,
30531};
30532query.callback(results);
30533}
30534});
30535handler = transport.call(self, params);
30536}, quietMillis);
30537}
30538;
30539}
30540function local(options) {
30541var data = options, dataText, tmp, text = function(item) {
30542return "" + item.text;
30543};
30544if ($.isArray(data)) {
30545tmp = data;
30546data = {
30547results: tmp
30548};
30549}
30550if ($.isFunction(data) === false) {
30551tmp = data;
30552data = function() {
30553return tmp;
30554}
30555;
30556}
30557var dataItem = data();
30558if (dataItem.text) {
30559text = dataItem.text;
30560if (!$.isFunction(text)) {
30561dataText = dataItem.text;
30562text = function(item) {
30563return item[dataText];
30564}
30565;
30566}
30567}
30568return function(query) {
30569var t = query.term, filtered = {
30570results: []
30571}, process;
30572if (t === "") {
30573query.callback(data());
30574return;
30575}
30576process = function(datum, collection) {
30577var group, attr;
30578datum = datum[0];
30579if (datum.children) {
30580group = {};
30581for (attr in datum) {
30582if (datum.hasOwnProperty(attr))
30583group[attr] = datum[attr];
30584}
30585group.children = [];
30586$(datum.children).each2(function(i, childDatum) {
30587process(childDatum, group.children);
30588});
30589if (group.children.length || query.matcher(t, text(group), datum)) {
30590collection.push(group);
30591}
30592} else {
30593if (query.matcher(t, text(datum), datum)) {
30594collection.push(datum);
30595}
30596}
30597}
30598;
30599$(data().results).each2(function(i, datum) {
30600process(datum, filtered.results);
30601});
30602query.callback(filtered);
30603}
30604;
30605}
30606function tags(data) {
30607var isFunc = $.isFunction(data);
30608return function(query) {
30609var t = query.term
30610  , filtered = {
30611results: []
30612};
30613var result = isFunc ? data(query) : data;
30614if ($.isArray(result)) {
30615$(result).each(function() {
30616var isObject = this.text !== undefined
30617  , text = isObject ? this.text : this;
30618if (t === "" || query.matcher(t, text)) {
30619filtered.results.push(isObject ? this : {
30620id: this,
30621text: this
30622});
30623}
30624});
30625query.callback(filtered);
30626}
30627}
30628;
30629}
30630function checkFormatter(formatter, formatterName) {
30631if ($.isFunction(formatter))
30632return true;
30633if (!formatter)
30634return false;
30635if (typeof (formatter) === 'string')
30636return true;
30637throw new Error(formatterName + " must be a string, function, or falsy value");
30638}
30639function evaluate(val, context) {
30640if ($.isFunction(val)) {
30641var args = Array.prototype.slice.call(arguments, 2);
30642return val.apply(context, args);
30643}
30644return val;
30645}
30646function countResults(results) {
30647var count = 0;
30648$.each(results, function(i, item) {
30649if (item.children) {
30650count += countResults(item.children);
30651} else {
30652count++;
30653}
30654});
30655return count;
30656}
30657function defaultTokenizer(input, selection, selectCallback, opts) {
30658var original = input, dupe = false, token, index, i, l, separator;
30659if (!opts.createSearchChoice || !opts.tokenSeparators || opts.tokenSeparators.length < 1)
30660return undefined;
30661while (true) {
30662index = -1;
30663for (i = 0,
30664l = opts.tokenSeparators.length; i < l; i++) {
30665separator = opts.tokenSeparators[i];
30666index = input.indexOf(separator);
30667if (index >= 0)
30668break;
30669}
30670if (index < 0)
30671break;
30672token = input.substring(0, index);
30673input = input.substring(index + separator.length);
30674if (token.length > 0) {
30675token = opts.createSearchChoice.call(this, token, selection);
30676if (token !== undefined && token !== null && opts.id(token) !== undefined && opts.id(token) !== null) {
30677dupe = false;
30678for (i = 0,
30679l = selection.length; i < l; i++) {
30680if (equal(opts.id(token), opts.id(selection[i]))) {
30681dupe = true;
30682break;
30683}
30684}
30685if (!dupe)
30686selectCallback(token);
30687}
30688}
30689}
30690if (original !== input)
30691return input;
30692}
30693function cleanupJQueryElements() {
30694var self = this;
30695$.each(arguments, function(i, element) {
30696self[element].remove();
30697self[element] = null;
30698});
30699}
30700function clazz(SuperClass, methods) {
30701var constructor = function() {};
30702constructor.prototype = new SuperClass;
30703constructor.prototype.constructor = constructor;
30704constructor.prototype.parent = SuperClass.prototype;
30705constructor.prototype = $.extend(constructor.prototype, methods);
30706return constructor;
30707}
30708AbstractSelect2 = clazz(Object, {
30709bind: function(func) {
30710var self = this;
30711return function() {
30712func.apply(self, arguments);
30713}
30714;
30715},
30716init: function(opts) {
30717var results, search, resultsSelector = ".select2-results";
30718this.opts = opts = this.prepareOpts(opts);
30719this.id = opts.id;
30720if (opts.element.data("select2") !== undefined && opts.element.data("select2") !== null) {
30721opts.element.data("select2").destroy();
30722}
30723this.container = this.createContainer();
30724this.liveRegion = $("<span>", {
30725role: "status",
30726"aria-live": "polite"
30727}).addClass("select2-hidden-accessible").appendTo(document.body);
30728this.containerId = "s2id_" + (opts.element.attr("id") || "autogen" + nextUid());
30729this.containerEventName = this.containerId.replace(/([.])/g, '_').replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1');
30730this.container.attr("id", this.containerId);
30731this.container.attr("title", opts.element.attr("title"));
30732this.body = $("body");
30733syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass);
30734this.container.attr("style", opts.element.attr("style"));
30735this.container.css(evaluate(opts.containerCss, this.opts.element));
30736this.container.addClass(evaluate(opts.containerCssClass, this.opts.element));
30737this.elementTabIndex = this.opts.element.attr("tabindex");
30738this.opts.element.data("select2", this).attr("tabindex", "-1").before(this.container).on("click.select2", killEvent);
30739this.container.data("select2", this);
30740this.dropdown = this.container.find(".select2-drop");
30741syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass);
30742this.dropdown.addClass(evaluate(opts.dropdownCssClass, this.opts.element));
30743this.dropdown.data("select2", this);
30744this.dropdown.on("click", killEvent);
30745this.results = results = this.container.find(resultsSelector);
30746this.search = search = this.container.find("input.select2-input");
30747this.queryCount = 0;
30748this.resultsPage = 0;
30749this.context = null;
30750this.initContainer();
30751this.container.on("click", killEvent);
30752installFilteredMouseMove(this.results);
30753this.dropdown.on("mousemove-filtered", resultsSelector, this.bind(this.highlightUnderEvent));
30754this.dropdown.on("touchstart touchmove touchend", resultsSelector, this.bind(function(event) {
30755this._touchEvent = true;
30756this.highlightUnderEvent(event);
30757}));
30758this.dropdown.on("touchmove", resultsSelector, this.bind(this.touchMoved));
30759this.dropdown.on("touchstart touchend", resultsSelector, this.bind(this.clearTouchMoved));
30760this.dropdown.on('click', this.bind(function(event) {
30761if (this._touchEvent) {
30762this._touchEvent = false;
30763this.selectHighlighted();
30764}
30765}));
30766installDebouncedScroll(80, this.results);
30767this.dropdown.on("scroll-debounced", resultsSelector, this.bind(this.loadMoreIfNeeded));
30768$(this.container).on("change", ".select2-input", function(e) {
30769e.stopPropagation();
30770});
30771$(this.dropdown).on("change", ".select2-input", function(e) {
30772e.stopPropagation();
30773});
30774if ($.fn.mousewheel) {
30775results.mousewheel(function(e, delta, deltaX, deltaY) {
30776var top = results.scrollTop();
30777if (deltaY > 0 && top - deltaY <= 0) {
30778results.scrollTop(0);
30779killEvent(e);
30780} else if (deltaY < 0 && results.get(0).scrollHeight - results.scrollTop() + deltaY <= results.height()) {
30781results.scrollTop(results.get(0).scrollHeight - results.height());
30782killEvent(e);
30783}
30784});
30785}
30786installKeyUpChangeEvent(search);
30787search.on("keyup-change input paste", this.bind(this.updateResults));
30788search.on("focus", function() {
30789search.addClass("select2-focused");
30790});
30791search.on("blur", function() {
30792search.removeClass("select2-focused");
30793});
30794this.dropdown.on("mouseup", resultsSelector, this.bind(function(e) {
30795if ($(e.target).closest(".select2-result-selectable").length > 0) {
30796this.highlightUnderEvent(e);
30797this.selectHighlighted(e);
30798}
30799}));
30800this.dropdown.on("click mouseup mousedown touchstart touchend focusin", function(e) {
30801e.stopPropagation();
30802});
30803this.nextSearchTerm = undefined;
30804if ($.isFunction(this.opts.initSelection)) {
30805this.initSelection();
30806this.monitorSource();
30807}
30808if (opts.maximumInputLength !== null) {
30809this.search.attr("maxlength", opts.maximumInputLength);
30810}
30811var disabled = opts.element.prop("disabled");
30812if (disabled === undefined)
30813disabled = false;
30814this.enable(!disabled);
30815var readonly = opts.element.prop("readonly");
30816if (readonly === undefined)
30817readonly = false;
30818this.readonly(readonly);
30819scrollBarDimensions = scrollBarDimensions || measureScrollbar();
30820this.autofocus = opts.element.prop("autofocus");
30821opts.element.prop("autofocus", false);
30822if (this.autofocus)
30823this.focus();
30824this.search.attr("placeholder", opts.searchInputPlaceholder);
30825},
30826destroy: function() {
30827var element = this.opts.element
30828  , select2 = element.data("select2")
30829  , self = this;
30830this.close();
30831if (element.length && element[0].detachEvent) {
30832element.each(function() {
30833this.detachEvent("onpropertychange", self._sync);
30834});
30835}
30836if (this.propertyObserver) {
30837this.propertyObserver.disconnect();
30838this.propertyObserver = null;
30839}
30840this._sync = null;
30841if (select2 !== undefined) {
30842select2.container.remove();
30843select2.liveRegion.remove();
30844select2.dropdown.remove();
30845element.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus", this.autofocus || false);
30846if (this.elementTabIndex) {
30847element.attr({
30848tabindex: this.elementTabIndex
30849});
30850} else {
30851element.removeAttr("tabindex");
30852}
30853element.show();
30854}
30855cleanupJQueryElements.call(this, "container", "liveRegion", "dropdown", "results", "search");
30856},
30857optionToData: function(element) {
30858if (element.is("option")) {
30859return {
30860id: element.prop("value"),
30861text: element.text(),
30862element: element.get(),
30863css: element.attr("class"),
30864disabled: element.prop("disabled"),
30865locked: equal(element.attr("locked"), "locked") || equal(element.data("locked"), true)
30866};
30867} else if (element.is("optgroup")) {
30868return {
30869text: element.attr("label"),
30870children: [],
30871element: element.get(),
30872css: element.attr("class")
30873};
30874}
30875},
30876prepareOpts: function(opts) {
30877var element, select, idKey, ajaxUrl, self = this;
30878element = opts.element;
30879if (element.get(0).tagName.toLowerCase() === "select") {
30880this.select = select = opts.element;
30881}
30882if (select) {
30883$.each(["id", "multiple", "ajax", "query", "createSearchChoice", "initSelection", "data", "tags"], function() {
30884if (this in opts) {
30885throw new Error("Option '" + this + "' is not allowed for Select2 when attached to a <select> element.");
30886}
30887});
30888}
30889opts = $.extend({}, {
30890populateResults: function(container, results, query) {
30891var populate, id = this.opts.id, liveRegion = this.liveRegion;
30892populate = function(results, container, depth) {
30893var i, l, result, selectable, disabled, compound, node, label, innerContainer, formatted;
30894results = opts.sortResults(results, container, query);
30895var nodes = [];
30896for (i = 0,
30897l = results.length; i < l; i = i + 1) {
30898result = results[i];
30899disabled = (result.disabled === true);
30900selectable = (!disabled) && (id(result) !== undefined);
30901compound = result.children && result.children.length > 0;
30902node = $("<li></li>");
30903node.addClass("select2-results-dept-" + depth);
30904node.addClass("select2-result");
30905node.addClass(selectable ? "select2-result-selectable" : "select2-result-unselectable");
30906if (disabled) {
30907node.addClass("select2-disabled");
30908}
30909if (compound) {
30910node.addClass("select2-result-with-children");
30911}
30912node.addClass(self.opts.formatResultCssClass(result));
30913node.attr("role", "presentation");
30914label = $(document.createElement("div"));
30915label.addClass("select2-result-label");
30916label.attr("id", "select2-result-label-" + nextUid());
30917label.attr("role", "option");
30918formatted = opts.formatResult(result, label, query, self.opts.escapeMarkup);
30919if (formatted !== undefined) {
30920label.html(formatted);
30921node.append(label);
30922}
30923if (compound) {
30924innerContainer = $("<ul></ul>");
30925innerContainer.addClass("select2-result-sub");
30926populate(result.children, innerContainer, depth + 1);
30927node.append(innerContainer);
30928}
30929node.data("select2-data", result);
30930nodes.push(node[0]);
30931}
30932container.append(nodes);
30933liveRegion.text(opts.formatMatches(results.length));
30934}
30935;
30936populate(results, container, 0);
30937}
30938}, $.fn.select2.defaults, opts);
30939if (typeof (opts.id) !== "function") {
30940idKey = opts.id;
30941opts.id = function(e) {
30942return e[idKey];
30943}
30944;
30945}
30946if ($.isArray(opts.element.data("select2Tags"))) {
30947if ("tags"in opts) {
30948throw "tags specified as both an attribute 'data-select2-tags' and in options of Select2 " + opts.element.attr("id");
30949}
30950opts.tags = opts.element.data("select2Tags");
30951}
30952if (select) {
30953opts.query = this.bind(function(query) {
30954var data = {
30955results: [],
30956more: false
30957}, term = query.term, children, placeholderOption, process;
30958process = function(element, collection) {
30959var group;
30960if (element.is("option")) {
30961if (query.matcher(term, element.text(), element)) {
30962collection.push(self.optionToData(element));
30963}
30964} else if (element.is("optgroup")) {
30965group = self.optionToData(element);
30966element.children().each2(function(i, elm) {
30967process(elm, group.children);
30968});
30969if (group.children.length > 0) {
30970collection.push(group);
30971}
30972}
30973}
30974;
30975children = element.children();
30976if (this.getPlaceholder() !== undefined && children.length > 0) {
30977placeholderOption = this.getPlaceholderOption();
30978if (placeholderOption) {
30979children = children.not(placeholderOption);
30980}
30981}
30982children.each2(function(i, elm) {
30983process(elm, data.results);
30984});
30985query.callback(data);
30986});
30987opts.id = function(e) {
30988return e.id;
30989}
30990;
30991} else {
30992if (!("query"in opts)) {
30993if ("ajax"in opts) {
30994ajaxUrl = opts.element.data("ajax-url");
30995if (ajaxUrl && ajaxUrl.length > 0) {
30996opts.ajax.url = ajaxUrl;
30997}
30998opts.query = ajax.call(opts.element, opts.ajax);
30999} else if ("data"in opts) {
31000opts.query = local(opts.data);
31001} else if ("tags"in opts) {
31002opts.query = tags(opts.tags);
31003if (opts.createSearchChoice === undefined) {
31004opts.createSearchChoice = function(term) {
31005return {
31006id: $.trim(term),
31007text: $.trim(term)
31008};
31009}
31010;
31011}
31012if (opts.initSelection === undefined) {
31013opts.initSelection = function(element, callback) {
31014var data = [];
31015$(splitVal(element.val(), opts.separator)).each(function() {
31016var obj = {
31017id: this,
31018text: this
31019}
31020  , tags = opts.tags;
31021if ($.isFunction(tags))
31022tags = tags();
31023$(tags).each(function() {
31024if (equal(this.id, obj.id)) {
31025obj = this;
31026return false;
31027}
31028});
31029data.push(obj);
31030});
31031callback(data);
31032}
31033;
31034}
31035}
31036}
31037}
31038if (typeof (opts.query) !== "function") {
31039throw "query function not defined for Select2 " + opts.element.attr("id");
31040}
31041if (opts.createSearchChoicePosition === 'top') {
31042opts.createSearchChoicePosition = function(list, item) {
31043list.unshift(item);
31044}
31045;
31046} else if (opts.createSearchChoicePosition === 'bottom') {
31047opts.createSearchChoicePosition = function(list, item) {
31048list.push(item);
31049}
31050;
31051} else if (typeof (opts.createSearchChoicePosition) !== "function") {
31052throw "invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";
31053}
31054return opts;
31055},
31056monitorSource: function() {
31057var el = this.opts.element, observer, self = this;
31058el.on("change.select2", this.bind(function(e) {
31059if (this.opts.element.data("select2-change-triggered") !== true) {
31060this.initSelection();
31061}
31062}));
31063this._sync = this.bind(function() {
31064var disabled = el.prop("disabled");
31065if (disabled === undefined)
31066disabled = false;
31067this.enable(!disabled);
31068var readonly = el.prop("readonly");
31069if (readonly === undefined)
31070readonly = false;
31071this.readonly(readonly);
31072syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass);
31073this.container.addClass(evaluate(this.opts.containerCssClass, this.opts.element));
31074syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass);
31075this.dropdown.addClass(evaluate(this.opts.dropdownCssClass, this.opts.element));
31076});
31077if (el.length && el[0].attachEvent) {
31078el.each(function() {
31079this.attachEvent("onpropertychange", self._sync);
31080});
31081}
31082observer = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
31083if (observer !== undefined) {
31084if (this.propertyObserver) {
31085delete this.propertyObserver;
31086this.propertyObserver = null;
31087}
31088this.propertyObserver = new observer(function(mutations) {
31089$.each(mutations, self._sync);
31090}
31091);
31092this.propertyObserver.observe(el.get(0), {
31093attributes: true,
31094subtree: false
31095});
31096}
31097},
31098triggerSelect: function(data) {
31099var evt = $.Event("select2-selecting", {
31100val: this.id(data),
31101object: data,
31102choice: data
31103});
31104this.opts.element.trigger(evt);
31105return !evt.isDefaultPrevented();
31106},
31107triggerChange: function(details) {
31108details = details || {};
31109details = $.extend({}, details, {
31110type: "change",
31111val: this.val()
31112});
31113this.opts.element.data("select2-change-triggered", true);
31114this.opts.element.trigger(details);
31115this.opts.element.data("select2-change-triggered", false);
31116this.opts.element.click();
31117if (this.opts.blurOnChange)
31118this.opts.element.blur();
31119},
31120isInterfaceEnabled: function() {
31121return this.enabledInterface === true;
31122},
31123enableInterface: function() {
31124var enabled = this._enabled && !this._readonly
31125  , disabled = !enabled;
31126if (enabled === this.enabledInterface)
31127return false;
31128this.container.toggleClass("select2-container-disabled", disabled);
31129this.close();
31130this.enabledInterface = enabled;
31131return true;
31132},
31133enable: function(enabled) {
31134if (enabled === undefined)
31135enabled = true;
31136if (this._enabled === enabled)
31137return;
31138this._enabled = enabled;
31139this.opts.element.prop("disabled", !enabled);
31140this.enableInterface();
31141},
31142disable: function() {
31143this.enable(false);
31144},
31145readonly: function(enabled) {
31146if (enabled === undefined)
31147enabled = false;
31148if (this._readonly === enabled)
31149return;
31150this._readonly = enabled;
31151this.opts.element.prop("readonly", enabled);
31152this.enableInterface();
31153},
31154opened: function() {
31155return (this.container) ? this.container.hasClass("select2-dropdown-open") : false;
31156},
31157positionDropdown: function() {
31158var $dropdown = this.dropdown, offset = this.container.offset(), height = this.container.outerHeight(false), width = this.container.outerWidth(false), dropHeight = $dropdown.outerHeight(false), $window = $(window), windowWidth = $window.width(), windowHeight = $window.height(), viewPortRight = $window.scrollLeft() + windowWidth, viewportBottom = $window.scrollTop() + windowHeight, dropTop = offset.top + height, dropLeft = offset.left, enoughRoomBelow = dropTop + dropHeight <= viewportBottom, enoughRoomAbove = (offset.top - dropHeight) >= $window.scrollTop(), dropWidth = $dropdown.outerWidth(false), enoughRoomOnRight = dropLeft + dropWidth <= viewPortRight, aboveNow = $dropdown.hasClass("select2-drop-above"), bodyOffset, above, changeDirection, css, resultsListNode;
31159if (aboveNow) {
31160above = true;
31161if (!enoughRoomAbove && enoughRoomBelow) {
31162changeDirection = true;
31163above = false;
31164}
31165} else {
31166above = false;
31167if (!enoughRoomBelow && enoughRoomAbove) {
31168changeDirection = true;
31169above = true;
31170}
31171}
31172if (changeDirection) {
31173$dropdown.hide();
31174offset = this.container.offset();
31175height = this.container.outerHeight(false);
31176width = this.container.outerWidth(false);
31177dropHeight = $dropdown.outerHeight(false);
31178viewPortRight = $window.scrollLeft() + windowWidth;
31179viewportBottom = $window.scrollTop() + windowHeight;
31180dropTop = offset.top + height;
31181dropLeft = offset.left;
31182dropWidth = $dropdown.outerWidth(false);
31183enoughRoomOnRight = dropLeft + dropWidth <= viewPortRight;
31184$dropdown.show();
31185this.focusSearch();
31186}
31187if (this.opts.dropdownAutoWidth) {
31188resultsListNode = $('.select2-results', $dropdown)[0];
31189$dropdown.addClass('select2-drop-auto-width');
31190$dropdown.css('width', '');
31191dropWidth = $dropdown.outerWidth(false) + (resultsListNode.scrollHeight === resultsListNode.clientHeight ? 0 : scrollBarDimensions.width);
31192dropWidth > width ? width = dropWidth : dropWidth = width;
31193dropHeight = $dropdown.outerHeight(false);
31194enoughRoomOnRight = dropLeft + dropWidth <= viewPortRight;
31195} else {
31196this.container.removeClass('select2-drop-auto-width');
31197}
31198if (this.body.css('position') !== 'static') {
31199bodyOffset = this.body.offset();
31200dropTop -= bodyOffset.top;
31201dropLeft -= bodyOffset.left;
31202}
31203if (!enoughRoomOnRight) {
31204dropLeft = offset.left + this.container.outerWidth(false) - dropWidth;
31205}
31206css = {
31207left: dropLeft,
31208width: width
31209};
31210if (above) {
31211css.top = offset.top - dropHeight;
31212css.bottom = 'auto';
31213this.container.addClass("select2-drop-above");
31214$dropdown.addClass("select2-drop-above");
31215} else {
31216css.top = dropTop;
31217css.bottom = 'auto';
31218this.container.removeClass("select2-drop-above");
31219$dropdown.removeClass("select2-drop-above");
31220}
31221css = $.extend(css, evaluate(this.opts.dropdownCss, this.opts.element));
31222$dropdown.css(css);
31223},
31224shouldOpen: function() {
31225var event;
31226if (this.opened())
31227return false;
31228if (this._enabled === false || this._readonly === true)
31229return false;
31230event = $.Event("select2-opening");
31231this.opts.element.trigger(event);
31232return !event.isDefaultPrevented();
31233},
31234clearDropdownAlignmentPreference: function() {
31235this.container.removeClass("select2-drop-above");
31236this.dropdown.removeClass("select2-drop-above");
31237},
31238open: function() {
31239if (!this.shouldOpen())
31240return false;
31241this.opening();
31242$document.on("mousemove.select2Event", function(e) {
31243lastMousePosition.x = e.pageX;
31244lastMousePosition.y = e.pageY;
31245});
31246return true;
31247},
31248opening: function() {
31249var cid = this.containerEventName, scroll = "scroll." + cid, resize = "resize." + cid, orient = "orientationchange." + cid, mask;
31250this.container.addClass("select2-dropdown-open").addClass("select2-container-active");
31251this.clearDropdownAlignmentPreference();
31252if (this.dropdown[0] !== this.body.children().last()[0]) {
31253this.dropdown.detach().appendTo(this.body);
31254}
31255mask = $("#select2-drop-mask");
31256if (mask.length == 0) {
31257mask = $(document.createElement("div"));
31258mask.attr("id", "select2-drop-mask").attr("class", "select2-drop-mask");
31259mask.hide();
31260mask.appendTo(this.body);
31261mask.on("mousedown touchstart click", function(e) {
31262reinsertElement(mask);
31263var dropdown = $("#select2-drop"), self;
31264if (dropdown.length > 0) {
31265self = dropdown.data("select2");
31266if (self.opts.selectOnBlur) {
31267self.selectHighlighted({
31268noFocus: true
31269});
31270}
31271self.close();
31272e.preventDefault();
31273e.stopPropagation();
31274}
31275});
31276}
31277if (this.dropdown.prev()[0] !== mask[0]) {
31278this.dropdown.before(mask);
31279}
31280$("#select2-drop").removeAttr("id");
31281this.dropdown.attr("id", "select2-drop");
31282mask.show();
31283this.positionDropdown();
31284this.dropdown.show();
31285this.positionDropdown();
31286this.dropdown.addClass("select2-drop-active");
31287var that = this;
31288this.container.parents().add(window).each(function() {
31289$(this).on(resize + " " + scroll + " " + orient, function(e) {
31290if (that.opened())
31291that.positionDropdown();
31292});
31293});
31294},
31295close: function() {
31296if (!this.opened())
31297return;
31298var cid = this.containerEventName
31299  , scroll = "scroll." + cid
31300  , resize = "resize." + cid
31301  , orient = "orientationchange." + cid;
31302this.container.parents().add(window).each(function() {
31303$(this).off(scroll).off(resize).off(orient);
31304});
31305this.clearDropdownAlignmentPreference();
31306$("#select2-drop-mask").hide();
31307this.dropdown.removeAttr("id");
31308this.dropdown.hide();
31309this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");
31310this.results.empty();
31311$document.off("mousemove.select2Event");
31312this.clearSearch();
31313this.search.removeClass("select2-active");
31314this.opts.element.trigger($.Event("select2-close"));
31315},
31316externalSearch: function(term) {
31317this.open();
31318this.search.val(term);
31319this.updateResults(false);
31320},
31321clearSearch: function() {},
31322getMaximumSelectionSize: function() {
31323return evaluate(this.opts.maximumSelectionSize, this.opts.element);
31324},
31325ensureHighlightVisible: function() {
31326var results = this.results, children, index, child, hb, rb, y, more, topOffset;
31327index = this.highlight();
31328if (index < 0)
31329return;
31330if (index == 0) {
31331results.scrollTop(0);
31332return;
31333}
31334children = this.findHighlightableChoices().find('.select2-result-label');
31335child = $(children[index]);
31336topOffset = (child.offset() || {}).top || 0;
31337hb = topOffset + child.outerHeight(true);
31338if (index === children.length - 1) {
31339more = results.find("li.select2-more-results");
31340if (more.length > 0) {
31341hb = more.offset().top + more.outerHeight(true);
31342}
31343}
31344rb = results.offset().top + results.outerHeight(true);
31345if (hb > rb) {
31346results.scrollTop(results.scrollTop() + (hb - rb));
31347}
31348y = topOffset - results.offset().top;
31349if (y < 0 && child.css('display') != 'none') {
31350results.scrollTop(results.scrollTop() + y);
31351}
31352},
31353findHighlightableChoices: function() {
31354return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)");
31355},
31356moveHighlight: function(delta) {
31357var choices = this.findHighlightableChoices()
31358  , index = this.highlight();
31359while (index > -1 && index < choices.length) {
31360index += delta;
31361var choice = $(choices[index]);
31362if (choice.hasClass("select2-result-selectable") && !choice.hasClass("select2-disabled") && !choice.hasClass("select2-selected")) {
31363this.highlight(index);
31364break;
31365}
31366}
31367},
31368highlight: function(index) {
31369var choices = this.findHighlightableChoices(), choice, data;
31370if (arguments.length === 0) {
31371return indexOf(choices.filter(".select2-highlighted")[0], choices.get());
31372}
31373if (index >= choices.length)
31374index = choices.length - 1;
31375if (index < 0)
31376index = 0;
31377this.removeHighlight();
31378choice = $(choices[index]);
31379choice.addClass("select2-highlighted");
31380this.search.attr("aria-activedescendant", choice.find(".select2-result-label").attr("id"));
31381this.ensureHighlightVisible();
31382this.liveRegion.text(choice.text());
31383data = choice.data("select2-data");
31384if (data) {
31385this.opts.element.trigger({
31386type: "select2-highlight",
31387val: this.id(data),
31388choice: data
31389});
31390}
31391},
31392removeHighlight: function() {
31393this.results.find(".select2-highlighted").removeClass("select2-highlighted");
31394},
31395touchMoved: function() {
31396this._touchMoved = true;
31397},
31398clearTouchMoved: function() {
31399this._touchMoved = false;
31400},
31401countSelectableResults: function() {
31402return this.findHighlightableChoices().length;
31403},
31404highlightUnderEvent: function(event) {
31405var el = $(event.target).closest(".select2-result-selectable");
31406if (el.length > 0 && !el.is(".select2-highlighted")) {
31407var choices = this.findHighlightableChoices();
31408this.highlight(choices.index(el));
31409} else if (el.length == 0) {
31410this.removeHighlight();
31411}
31412},
31413loadMoreIfNeeded: function() {
31414var results = this.results, more = results.find("li.select2-more-results"), below, page = this.resultsPage + 1, self = this, term = this.search.val(), context = this.context;
31415if (more.length === 0)
31416return;
31417below = more.offset().top - results.offset().top - results.height();
31418if (below <= this.opts.loadMorePadding) {
31419more.addClass("select2-active");
31420this.opts.query({
31421element: this.opts.element,
31422term: term,
31423page: page,
31424context: context,
31425matcher: this.opts.matcher,
31426callback: this.bind(function(data) {
31427if (!self.opened())
31428return;
31429self.opts.populateResults.call(this, results, data.results, {
31430term: term,
31431page: page,
31432context: context
31433});
31434self.postprocessResults(data, false, false);
31435if (data.more === true) {
31436more.detach().appendTo(results).text(evaluate(self.opts.formatLoadMore, self.opts.element, page + 1));
31437window.setTimeout(function() {
31438self.loadMoreIfNeeded();
31439}, 10);
31440} else {
31441more.remove();
31442}
31443self.positionDropdown();
31444self.resultsPage = page;
31445self.context = data.context;
31446this.opts.element.trigger({
31447type: "select2-loaded",
31448items: data
31449});
31450})
31451});
31452}
31453},
31454tokenize: function() {},
31455updateResults: function(initial) {
31456var search = this.search, results = this.results, opts = this.opts, data, self = this, input, term = search.val(), lastTerm = $.data(this.container, "select2-last-term"), queryNumber;
31457if (initial !== true && lastTerm && equal(term, lastTerm))
31458return;
31459$.data(this.container, "select2-last-term", term);
31460if (initial !== true && (this.showSearchInput === false || !this.opened())) {
31461return;
31462}
31463function postRender() {
31464search.removeClass("select2-active");
31465self.positionDropdown();
31466if (results.find('.select2-no-results,.select2-selection-limit,.select2-searching').length) {
31467self.liveRegion.text(results.text());
31468} else {
31469self.liveRegion.text(self.opts.formatMatches(results.find('.select2-result-selectable').length));
31470}
31471}
31472function render(html) {
31473results.html(html);
31474postRender();
31475}
31476queryNumber = ++this.queryCount;
31477var maxSelSize = this.getMaximumSelectionSize();
31478if (maxSelSize >= 1) {
31479data = this.data();
31480if ($.isArray(data) && data.length >= maxSelSize && checkFormatter(opts.formatSelectionTooBig, "formatSelectionTooBig")) {
31481render("<li class='select2-selection-limit'>" + evaluate(opts.formatSelectionTooBig, opts.element, maxSelSize) + "</li>");
31482return;
31483}
31484}
31485if (search.val().length < opts.minimumInputLength) {
31486if (checkFormatter(opts.formatInputTooShort, "formatInputTooShort")) {
31487render("<li class='select2-no-results'>" + evaluate(opts.formatInputTooShort, opts.element, search.val(), opts.minimumInputLength) + "</li>");
31488} else {
31489render("");
31490}
31491if (initial && this.showSearch)
31492this.showSearch(true);
31493return;
31494}
31495if (opts.maximumInputLength && search.val().length > opts.maximumInputLength) {
31496if (checkFormatter(opts.formatInputTooLong, "formatInputTooLong")) {
31497render("<li class='select2-no-results'>" + evaluate(opts.formatInputTooLong, opts.element, search.val(), opts.maximumInputLength) + "</li>");
31498} else {
31499render("");
31500}
31501return;
31502}
31503if (opts.formatSearching && this.findHighlightableChoices().length === 0) {
31504render("<li class='select2-searching'>" + evaluate(opts.formatSearching, opts.element) + "</li>");
31505}
31506search.addClass("select2-active");
31507this.removeHighlight();
31508input = this.tokenize();
31509if (input != undefined && input != null) {
31510search.val(input);
31511}
31512this.resultsPage = 1;
31513opts.query({
31514element: opts.element,
31515term: search.val(),
31516page: this.resultsPage,
31517context: null,
31518matcher: opts.matcher,
31519callback: this.bind(function(data) {
31520var def;
31521if (queryNumber != this.queryCount) {
31522return;
31523}
31524if (!this.opened()) {
31525this.search.removeClass("select2-active");
31526return;
31527}
31528if (data.hasError !== undefined && checkFormatter(opts.formatAjaxError, "formatAjaxError")) {
31529render("<li class='select2-ajax-error'>" + evaluate(opts.formatAjaxError, opts.element, data.jqXHR, data.textStatus, data.errorThrown) + "</li>");
31530return;
31531}
31532this.context = (data.context === undefined) ? null : data.context;
31533if (this.opts.createSearchChoice && search.val() !== "") {
31534def = this.opts.createSearchChoice.call(self, search.val(), data.results);
31535if (def !== undefined && def !== null && self.id(def) !== undefined && self.id(def) !== null) {
31536if ($(data.results).filter(function() {
31537return equal(self.id(this), self.id(def));
31538}).length === 0) {
31539this.opts.createSearchChoicePosition(data.results, def);
31540}
31541}
31542}
31543if (data.results.length === 0 && checkFormatter(opts.formatNoMatches, "formatNoMatches")) {
31544render("<li class='select2-no-results'>" + evaluate(opts.formatNoMatches, opts.element, search.val()) + "</li>");
31545return;
31546}
31547results.empty();
31548self.opts.populateResults.call(this, results, data.results, {
31549term: search.val(),
31550page: this.resultsPage,
31551context: null
31552});
31553if (data.more === true && checkFormatter(opts.formatLoadMore, "formatLoadMore")) {
31554results.append("<li class='select2-more-results'>" + opts.escapeMarkup(evaluate(opts.formatLoadMore, opts.element, this.resultsPage)) + "</li>");
31555window.setTimeout(function() {
31556self.loadMoreIfNeeded();
31557}, 10);
31558}
31559this.postprocessResults(data, initial);
31560postRender();
31561this.opts.element.trigger({
31562type: "select2-loaded",
31563items: data
31564});
31565})
31566});
31567},
31568cancel: function() {
31569this.close();
31570},
31571blur: function() {
31572if (this.opts.selectOnBlur)
31573this.selectHighlighted({
31574noFocus: true
31575});
31576this.close();
31577this.container.removeClass("select2-container-active");
31578if (this.search[0] === document.activeElement) {
31579this.search.blur();
31580}
31581this.clearSearch();
31582this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
31583},
31584focusSearch: function() {
31585focus(this.search);
31586},
31587selectHighlighted: function(options) {
31588if (this._touchMoved) {
31589this.clearTouchMoved();
31590return;
31591}
31592var index = this.highlight()
31593  , highlighted = this.results.find(".select2-highlighted")
31594  , data = highlighted.closest('.select2-result').data("select2-data");
31595if (data) {
31596this.highlight(index);
31597this.onSelect(data, options);
31598} else if (options && options.noFocus) {
31599this.close();
31600}
31601},
31602getPlaceholder: function() {
31603var placeholderOption;
31604return this.opts.element.attr("placeholder") || this.opts.element.attr("data-placeholder") || this.opts.element.data("placeholder") || this.opts.placeholder || ((placeholderOption = this.getPlaceholderOption()) !== undefined ? placeholderOption.text() : undefined);
31605},
31606getPlaceholderOption: function() {
31607if (this.select) {
31608var firstOption = this.select.children('option').first();
31609if (this.opts.placeholderOption !== undefined) {
31610return (this.opts.placeholderOption === "first" && firstOption) || (typeof this.opts.placeholderOption === "function" && this.opts.placeholderOption(this.select));
31611} else if ($.trim(firstOption.text()) === "" && firstOption.val() === "") {
31612return firstOption;
31613}
31614}
31615},
31616initContainerWidth: function() {
31617function resolveContainerWidth() {
31618var style, attrs, matches, i, l, attr;
31619if (this.opts.width === "off") {
31620return null;
31621} else if (this.opts.width === "element") {
31622return this.opts.element.outerWidth(false) === 0 ? 'auto' : this.opts.element.outerWidth(false) + 'px';
31623} else if (this.opts.width === "copy" || this.opts.width === "resolve") {
31624style = this.opts.element.attr('style');
31625if (style !== undefined) {
31626attrs = style.split(';');
31627for (i = 0,
31628l = attrs.length; i < l; i = i + 1) {
31629attr = attrs[i].replace(/\s/g, '');
31630matches = attr.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i);
31631if (matches !== null && matches.length >= 1)
31632return matches[1];
31633}
31634}
31635if (this.opts.width === "resolve") {
31636style = this.opts.element.css('width');
31637if (style.indexOf("%") > 0)
31638return style;
31639return (this.opts.element.outerWidth(false) === 0 ? 'auto' : this.opts.element.outerWidth(false) + 'px');
31640}
31641return null;
31642} else if ($.isFunction(this.opts.width)) {
31643return this.opts.width();
31644} else {
31645return this.opts.width;
31646}
31647}
31648;var width = resolveContainerWidth.call(this);
31649if (width !== null) {
31650this.container.css("width", width);
31651}
31652}
31653});
31654SingleSelect2 = clazz(AbstractSelect2, {
31655createContainer: function() {
31656var container = $(document.createElement("div")).attr({
31657"class": "select2-container"
31658}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>", "   <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>", "   <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>", "</a>", "<label for='' class='select2-offscreen'></label>", "<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />", "<div class='select2-drop select2-display-none'>", "   <div class='select2-search'>", "   <label for='' class='select2-offscreen'></label>", "   <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'", "   aria-autocomplete='list' />", "   </div>", "   <ul class='select2-results' role='listbox'>", "   </ul>", "</div>"].join(""));
31659return container;
31660},
31661enableInterface: function() {
31662if (this.parent.enableInterface.apply(this, arguments)) {
31663this.focusser.prop("disabled", !this.isInterfaceEnabled());
31664}
31665},
31666opening: function() {
31667var el, range, len;
31668if (this.opts.minimumResultsForSearch >= 0) {
31669this.showSearch(true);
31670}
31671this.parent.opening.apply(this, arguments);
31672if (this.showSearchInput !== false) {
31673this.search.val(this.focusser.val());
31674}
31675if (this.opts.shouldFocusInput(this)) {
31676this.search.focus();
31677el = this.search.get(0);
31678if (el.createTextRange) {
31679range = el.createTextRange();
31680range.collapse(false);
31681range.select();
31682} else if (el.setSelectionRange) {
31683len = this.search.val().length;
31684el.setSelectionRange(len, len);
31685}
31686}
31687if (this.search.val() === "") {
31688if (this.nextSearchTerm != undefined) {
31689this.search.val(this.nextSearchTerm);
31690this.search.select();
31691}
31692}
31693this.focusser.prop("disabled", true).val("");
31694this.updateResults(true);
31695this.opts.element.trigger($.Event("select2-open"));
31696},
31697close: function() {
31698if (!this.opened())
31699return;
31700this.parent.close.apply(this, arguments);
31701this.focusser.prop("disabled", false);
31702if (this.opts.shouldFocusInput(this)) {
31703this.focusser.focus();
31704}
31705},
31706focus: function() {
31707if (this.opened()) {
31708this.close();
31709} else {
31710this.focusser.prop("disabled", false);
31711if (this.opts.shouldFocusInput(this)) {
31712this.focusser.focus();
31713}
31714}
31715},
31716isFocused: function() {
31717return this.container.hasClass("select2-container-active");
31718},
31719cancel: function() {
31720this.parent.cancel.apply(this, arguments);
31721this.focusser.prop("disabled", false);
31722if (this.opts.shouldFocusInput(this)) {
31723this.focusser.focus();
31724}
31725},
31726destroy: function() {
31727$("label[for='" + this.focusser.attr('id') + "']").attr('for', this.opts.element.attr("id"));
31728this.parent.destroy.apply(this, arguments);
31729cleanupJQueryElements.call(this, "selection", "focusser");
31730},
31731initContainer: function() {
31732var selection, container = this.container, dropdown = this.dropdown, idSuffix = nextUid(), elementLabel;
31733if (this.opts.minimumResultsForSearch < 0) {
31734this.showSearch(false);
31735} else {
31736this.showSearch(true);
31737}
31738this.selection = selection = container.find(".select2-choice");
31739this.focusser = container.find(".select2-focusser");
31740selection.find(".select2-chosen").attr("id", "select2-chosen-" + idSuffix);
31741this.focusser.attr("aria-labelledby", "select2-chosen-" + idSuffix);
31742this.results.attr("id", "select2-results-" + idSuffix);
31743this.search.attr("aria-owns", "select2-results-" + idSuffix);
31744this.focusser.attr("id", "s2id_autogen" + idSuffix);
31745elementLabel = $("label[for='" + this.opts.element.attr("id") + "']");
31746this.focusser.prev().text(elementLabel.text()).attr('for', this.focusser.attr('id'));
31747var originalTitle = this.opts.element.attr("title");
31748this.opts.element.attr("title", (originalTitle || elementLabel.text()));
31749this.focusser.attr("tabindex", this.elementTabIndex);
31750this.search.attr("id", this.focusser.attr('id') + '_search');
31751this.search.prev().text($("label[for='" + this.focusser.attr('id') + "']").text()).attr('for', this.search.attr('id'));
31752this.search.on("keydown", this.bind(function(e) {
31753if (!this.isInterfaceEnabled())
31754return;
31755if (229 == e.keyCode)
31756return;
31757if (e.which === KEY.PAGE_UP || e.which === KEY.PAGE_DOWN) {
31758killEvent(e);
31759return;
31760}
31761switch (e.which) {
31762case KEY.UP:
31763case KEY.DOWN:
31764this.moveHighlight((e.which === KEY.UP) ? -1 : 1);
31765killEvent(e);
31766return;
31767case KEY.ENTER:
31768this.selectHighlighted();
31769killEvent(e);
31770return;
31771case KEY.TAB:
31772this.selectHighlighted({
31773noFocus: true
31774});
31775return;
31776case KEY.ESC:
31777this.cancel(e);
31778killEvent(e);
31779return;
31780}
31781}));
31782this.search.on("blur", this.bind(function(e) {
31783if (document.activeElement === this.body.get(0)) {
31784window.setTimeout(this.bind(function() {
31785if (this.opened()) {
31786this.search.focus();
31787}
31788}), 0);
31789}
31790}));
31791this.focusser.on("keydown", this.bind(function(e) {
31792if (!this.isInterfaceEnabled())
31793return;
31794if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.ESC) {
31795return;
31796}
31797if (this.opts.openOnEnter === false && e.which === KEY.ENTER) {
31798killEvent(e);
31799return;
31800}
31801if (e.which == KEY.DOWN || e.which == KEY.UP || (e.which == KEY.ENTER && this.opts.openOnEnter)) {
31802if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey)
31803return;
31804this.open();
31805killEvent(e);
31806return;
31807}
31808if (e.which == KEY.DELETE || e.which == KEY.BACKSPACE) {
31809if (this.opts.allowClear) {
31810this.clear();
31811}
31812killEvent(e);
31813return;
31814}
31815}));
31816installKeyUpChangeEvent(this.focusser);
31817this.focusser.on("keyup-change input", this.bind(function(e) {
31818if (this.opts.minimumResultsForSearch >= 0) {
31819e.stopPropagation();
31820if (this.opened())
31821return;
31822this.open();
31823}
31824}));
31825selection.on("mousedown touchstart", "abbr", this.bind(function(e) {
31826if (!this.isInterfaceEnabled())
31827return;
31828this.clear();
31829killEventImmediately(e);
31830this.close();
31831this.selection.focus();
31832}));
31833selection.on("mousedown touchstart", this.bind(function(e) {
31834reinsertElement(selection);
31835if (!this.container.hasClass("select2-container-active")) {
31836this.opts.element.trigger($.Event("select2-focus"));
31837}
31838if (this.opened()) {
31839this.close();
31840} else if (this.isInterfaceEnabled()) {
31841this.open();
31842}
31843killEvent(e);
31844}));
31845dropdown.on("mousedown touchstart", this.bind(function() {
31846if (this.opts.shouldFocusInput(this)) {
31847this.search.focus();
31848}
31849}));
31850selection.on("focus", this.bind(function(e) {
31851killEvent(e);
31852}));
31853this.focusser.on("focus", this.bind(function() {
31854if (!this.container.hasClass("select2-container-active")) {
31855this.opts.element.trigger($.Event("select2-focus"));
31856}
31857this.container.addClass("select2-container-active");
31858})).on("blur", this.bind(function() {
31859if (!this.opened()) {
31860this.container.removeClass("select2-container-active");
31861this.opts.element.trigger($.Event("select2-blur"));
31862}
31863}));
31864this.search.on("focus", this.bind(function() {
31865if (!this.container.hasClass("select2-container-active")) {
31866this.opts.element.trigger($.Event("select2-focus"));
31867}
31868this.container.addClass("select2-container-active");
31869}));
31870this.initContainerWidth();
31871this.opts.element.addClass("select2-offscreen");
31872this.setPlaceholder();
31873},
31874clear: function(triggerChange) {
31875var data = this.selection.data("select2-data");
31876if (data) {
31877var evt = $.Event("select2-clearing");
31878this.opts.element.trigger(evt);
31879if (evt.isDefaultPrevented()) {
31880return;
31881}
31882var placeholderOption = this.getPlaceholderOption();
31883this.opts.element.val(placeholderOption ? placeholderOption.val() : "");
31884this.selection.find(".select2-chosen").empty();
31885this.selection.removeData("select2-data");
31886this.setPlaceholder();
31887if (triggerChange !== false) {
31888this.opts.element.trigger({
31889type: "select2-removed",
31890val: this.id(data),
31891choice: data
31892});
31893this.triggerChange({
31894removed: data
31895});
31896}
31897}
31898},
31899initSelection: function() {
31900var selected;
31901if (this.isPlaceholderOptionSelected()) {
31902this.updateSelection(null);
31903this.close();
31904this.setPlaceholder();
31905} else {
31906var self = this;
31907this.opts.initSelection.call(null, this.opts.element, function(selected) {
31908if (selected !== undefined && selected !== null) {
31909self.updateSelection(selected);
31910self.close();
31911self.setPlaceholder();
31912self.nextSearchTerm = self.opts.nextSearchTerm(selected, self.search.val());
31913}
31914});
31915}
31916},
31917isPlaceholderOptionSelected: function() {
31918var placeholderOption;
31919if (this.getPlaceholder() === undefined)
31920return false;
31921return ((placeholderOption = this.getPlaceholderOption()) !== undefined && placeholderOption.prop("selected")) || (this.opts.element.val() === "") || (this.opts.element.val() === undefined) || (this.opts.element.val() === null);
31922},
31923prepareOpts: function() {
31924var opts = this.parent.prepareOpts.apply(this, arguments)
31925  , self = this;
31926if (opts.element.get(0).tagName.toLowerCase() === "select") {
31927opts.initSelection = function(element, callback) {
31928var selected = element.find("option").filter(function() {
31929return this.selected && !this.disabled
31930});
31931callback(self.optionToData(selected));
31932}
31933;
31934} else if ("data"in opts) {
31935opts.initSelection = opts.initSelection || function(element, callback) {
31936var id = element.val();
31937var match = null;
31938opts.query({
31939matcher: function(term, text, el) {
31940var is_match = equal(id, opts.id(el));
31941if (is_match) {
31942match = el;
31943}
31944return is_match;
31945},
31946callback: !$.isFunction(callback) ? $.noop : function() {
31947callback(match);
31948}
31949});
31950}
31951;
31952}
31953return opts;
31954},
31955getPlaceholder: function() {
31956if (this.select) {
31957if (this.getPlaceholderOption() === undefined) {
31958return undefined;
31959}
31960}
31961return this.parent.getPlaceholder.apply(this, arguments);
31962},
31963setPlaceholder: function() {
31964var placeholder = this.getPlaceholder();
31965if (this.isPlaceholderOptionSelected() && placeholder !== undefined) {
31966if (this.select && this.getPlaceholderOption() === undefined)
31967return;
31968this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(placeholder));
31969this.selection.addClass("select2-default");
31970this.container.removeClass("select2-allowclear");
31971}
31972},
31973postprocessResults: function(data, initial, noHighlightUpdate) {
31974var selected = 0
31975  , self = this
31976  , showSearchInput = true;
31977this.findHighlightableChoices().each2(function(i, elm) {
31978if (equal(self.id(elm.data("select2-data")), self.opts.element.val())) {
31979selected = i;
31980return false;
31981}
31982});
31983if (noHighlightUpdate !== false) {
31984if (initial === true && selected >= 0) {
31985this.highlight(selected);
31986} else {
31987this.highlight(0);
31988}
31989}
31990if (initial === true) {
31991var min = this.opts.minimumResultsForSearch;
31992if (min >= 0) {
31993this.showSearch(countResults(data.results) >= min);
31994}
31995}
31996},
31997showSearch: function(showSearchInput) {
31998if (this.showSearchInput === showSearchInput)
31999return;
32000this.showSearchInput = showSearchInput;
32001this.dropdown.find(".select2-search").toggleClass("select2-search-hidden", !showSearchInput);
32002this.dropdown.find(".select2-search").toggleClass("select2-offscreen", !showSearchInput);
32003$(this.dropdown, this.container).toggleClass("select2-with-searchbox", showSearchInput);
32004},
32005onSelect: function(data, options) {
32006if (!this.triggerSelect(data)) {
32007return;
32008}
32009var old = this.opts.element.val()
32010  , oldData = this.data();
32011this.opts.element.val(this.id(data));
32012this.updateSelection(data);
32013this.opts.element.trigger({
32014type: "select2-selected",
32015val: this.id(data),
32016choice: data
32017});
32018this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val());
32019this.close();
32020if ((!options || !options.noFocus) && this.opts.shouldFocusInput(this)) {
32021this.focusser.focus();
32022}
32023if (!equal(old, this.id(data))) {
32024this.triggerChange({
32025added: data,
32026removed: oldData
32027});
32028}
32029},
32030updateSelection: function(data) {
32031var container = this.selection.find(".select2-chosen"), formatted, cssClass;
32032this.selection.data("select2-data", data);
32033container.empty();
32034if (data !== null) {
32035formatted = this.opts.formatSelection(data, container, this.opts.escapeMarkup);
32036}
32037if (formatted !== undefined) {
32038container.append(formatted);
32039}
32040cssClass = this.opts.formatSelectionCssClass(data, container);
32041if (cssClass !== undefined) {
32042container.addClass(cssClass);
32043}
32044this.selection.removeClass("select2-default");
32045if (this.opts.allowClear && this.getPlaceholder() !== undefined) {
32046this.container.addClass("select2-allowclear");
32047}
32048},
32049val: function() {
32050var val, triggerChange = false, data = null, self = this, oldData = this.data();
32051if (arguments.length === 0) {
32052return this.opts.element.val();
32053}
32054val = arguments[0];
32055if (arguments.length > 1) {
32056triggerChange = arguments[1];
32057}
32058if (this.select) {
32059this.select.val(val).find("option").filter(function() {
32060return this.selected
32061}).each2(function(i, elm) {
32062data = self.optionToData(elm);
32063return false;
32064});
32065this.updateSelection(data);
32066this.setPlaceholder();
32067if (triggerChange) {
32068this.triggerChange({
32069added: data,
32070removed: oldData
32071});
32072}
32073} else {
32074if (!val && val !== 0) {
32075this.clear(triggerChange);
32076return;
32077}
32078if (this.opts.initSelection === undefined) {
32079throw new Error("cannot call val() if initSelection() is not defined");
32080}
32081this.opts.element.val(val);
32082this.opts.initSelection(this.opts.element, function(data) {
32083self.opts.element.val(!data ? "" : self.id(data));
32084self.updateSelection(data);
32085self.setPlaceholder();
32086if (triggerChange) {
32087self.triggerChange({
32088added: data,
32089removed: oldData
32090});
32091}
32092});
32093}
32094},
32095clearSearch: function() {
32096this.search.val("");
32097this.focusser.val("");
32098},
32099data: function(value) {
32100var data, triggerChange = false;
32101if (arguments.length === 0) {
32102data = this.selection.data("select2-data");
32103if (data == undefined)
32104data = null;
32105return data;
32106} else {
32107if (arguments.length > 1) {
32108triggerChange = arguments[1];
32109}
32110if (!value) {
32111this.clear(triggerChange);
32112} else {
32113data = this.data();
32114this.opts.element.val(!value ? "" : this.id(value));
32115this.updateSelection(value);
32116if (triggerChange) {
32117this.triggerChange({
32118added: value,
32119removed: data
32120});
32121}
32122}
32123}
32124}
32125});
32126MultiSelect2 = clazz(AbstractSelect2, {
32127createContainer: function() {
32128var container = $(document.createElement("div")).attr({
32129"class": "select2-container select2-container-multi"
32130}).html(["<ul class='select2-choices'>", "  <li class='select2-search-field'>", "<label for='' class='select2-offscreen'></label>", "<input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>", "  </li>", "</ul>", "<div class='select2-drop select2-drop-multi select2-display-none'>", "   <ul class='select2-results'>", "   </ul>", "</div>"].join(""));
32131return container;
32132},
32133prepareOpts: function() {
32134var opts = this.parent.prepareOpts.apply(this, arguments)
32135  , self = this;
32136if (opts.element.get(0).tagName.toLowerCase() === "select") {
32137opts.initSelection = function(element, callback) {
32138var data = [];
32139element.find("option").filter(function() {
32140return this.selected && !this.disabled
32141}).each2(function(i, elm) {
32142data.push(self.optionToData(elm));
32143});
32144callback(data);
32145}
32146;
32147}
32147 else if ("data"in opts) {
32148opts.initSelection = opts.initSelection || function(element, callback) {
32149var ids = splitVal(element.val(), opts.separator);
32150var matches = [];
32151opts.query({
32152matcher: function(term, text, el) {
32153var is_match = $.grep(ids, function(id) {
32154return equal(id, opts.id(el));
32155}).length;
32156if (is_match) {
32157matches.push(el);
32158}
32159return is_match;
32160},
32161callback: !$.isFunction(callback) ? $.noop : function() {
32162var ordered = [];
32163for (var i = 0; i < ids.length; i++) {
32164var id = ids[i];
32165for (var j = 0; j < matches.length; j++) {
32166var match = matches[j];
32167if (equal(id, opts.id(match))) {
32168ordered.push(match);
32169matches.splice(j, 1);
32170break;
32171}
32172}
32173}
32174callback(ordered);
32175}
32176});
32177}
32178;
32179}
32180return opts;
32181},
32182selectChoice: function(choice) {
32183var selected = this.container.find(".select2-search-choice-focus");
32184if (selected.length && choice && choice[0] == selected[0]) {} else {
32185if (selected.length) {
32186this.opts.element.trigger("choice-deselected", selected);
32187}
32188selected.removeClass("select2-search-choice-focus");
32189if (choice && choice.length) {
32190this.close();
32191choice.addClass("select2-search-choice-focus");
32192this.opts.element.trigger("choice-selected", choice);
32193}
32194}
32195},
32196destroy: function() {
32197$("label[for='" + this.search.attr('id') + "']").attr('for', this.opts.element.attr("id"));
32198this.parent.destroy.apply(this, arguments);
32199cleanupJQueryElements.call(this, "searchContainer", "selection");
32200},
32201initContainer: function() {
32202var selector = ".select2-choices", selection;
32203this.searchContainer = this.container.find(".select2-search-field");
32204this.selection = selection = this.container.find(selector);
32205var _this = this;
32206this.selection.on("click", ".select2-search-choice:not(.select2-locked)", function(e) {
32207_this.search[0].focus();
32208_this.selectChoice($(this));
32209});
32210this.search.attr("id", "s2id_autogen" + nextUid());
32211this.search.prev().text($("label[for='" + this.opts.element.attr("id") + "']").text()).attr('for', this.search.attr('id'));
32212this.search.on("input paste", this.bind(function() {
32213if (this.search.attr('placeholder') && this.search.val().length == 0)
32214return;
32215if (!this.isInterfaceEnabled())
32216return;
32217if (!this.opened()) {
32218this.open();
32219}
32220}));
32221this.search.attr("tabindex", this.elementTabIndex);
32222this.keydowns = 0;
32223this.search.on("keydown", this.bind(function(e) {
32224if (!this.isInterfaceEnabled())
32225return;
32226++this.keydowns;
32227var selected = selection.find(".select2-search-choice-focus");
32228var prev = selected.prev(".select2-search-choice:not(.select2-locked)");
32229var next = selected.next(".select2-search-choice:not(.select2-locked)");
32230var pos = getCursorInfo(this.search);
32231if (selected.length && (e.which == KEY.LEFT || e.which == KEY.RIGHT || e.which == KEY.BACKSPACE || e.which == KEY.DELETE || e.which == KEY.ENTER)) {
32232var selectedChoice = selected;
32233if (e.which == KEY.LEFT && prev.length) {
32234selectedChoice = prev;
32235} else if (e.which == KEY.RIGHT) {
32236selectedChoice = next.length ? next : null;
32237} else if (e.which === KEY.BACKSPACE) {
32238if (this.unselect(selected.first())) {
32239this.search.width(10);
32240selectedChoice = prev.length ? prev : next;
32241}
32242} else if (e.which == KEY.DELETE) {
32243if (this.unselect(selected.first())) {
32244this.search.width(10);
32245selectedChoice = next.length ? next : null;
32246}
32247} else if (e.which == KEY.ENTER) {
32248selectedChoice = null;
32249}
32250this.selectChoice(selectedChoice);
32251killEvent(e);
32252if (!selectedChoice || !selectedChoice.length) {
32253this.open();
32254}
32255return;
32256} else if (((e.which === KEY.BACKSPACE && this.keydowns == 1) || e.which == KEY.LEFT) && (pos.offset == 0 && !pos.length)) {
32257this.selectChoice(selection.find(".select2-search-choice:not(.select2-locked)").last());
32258killEvent(e);
32259return;
32260} else {
32261this.selectChoice(null);
32262}
32263if (this.opened()) {
32264switch (e.which) {
32265case KEY.UP:
32266case KEY.DOWN:
32267this.moveHighlight((e.which === KEY.UP) ? -1 : 1);
32268killEvent(e);
32269return;
32270case KEY.ENTER:
32271this.selectHighlighted();
32272killEvent(e);
32273return;
32274case KEY.TAB:
32275this.selectHighlighted({
32276noFocus: true
32277});
32278this.close();
32279return;
32280case KEY.ESC:
32281this.cancel(e);
32282killEvent(e);
32283return;
32284}
32285}
32286if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.BACKSPACE || e.which === KEY.ESC) {
32287return;
32288}
32289if (e.which === KEY.ENTER) {
32290if (this.opts.openOnEnter === false) {
32291return;
32292} else if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) {
32293return;
32294}
32295}
32296this.open();
32297if (e.which === KEY.PAGE_UP || e.which === KEY.PAGE_DOWN) {
32298killEvent(e);
32299}
32300if (e.which === KEY.ENTER) {
32301killEvent(e);
32302}
32303}));
32304this.search.on("keyup", this.bind(function(e) {
32305this.keydowns = 0;
32306this.resizeSearch();
32307}));
32308this.search.on("blur", this.bind(function(e) {
32309this.container.removeClass("select2-container-active");
32310this.search.removeClass("select2-focused");
32311this.selectChoice(null);
32312if (!this.opened())
32313this.clearSearch();
32314e.stopImmediatePropagation();
32315this.opts.element.trigger($.Event("select2-blur"));
32316}));
32317this.container.on("click", selector, this.bind(function(e) {
32318if (!this.isInterfaceEnabled())
32319return;
32320if ($(e.target).closest(".select2-search-choice").length > 0) {
32321return;
32322}
32323this.selectChoice(null);
32324this.clearPlaceholder();
32325if (!this.container.hasClass("select2-container-active")) {
32326this.opts.element.trigger($.Event("select2-focus"));
32327}
32328this.open();
32329this.focusSearch();
32330e.preventDefault();
32331}));
32332this.container.on("focus", selector, this.bind(function() {
32333if (!this.isInterfaceEnabled())
32334return;
32335if (!this.container.hasClass("select2-container-active")) {
32336this.opts.element.trigger($.Event("select2-focus"));
32337}
32338this.container.addClass("select2-container-active");
32339this.dropdown.addClass("select2-drop-active");
32340this.clearPlaceholder();
32341}));
32342this.initContainerWidth();
32343this.opts.element.addClass("select2-offscreen");
32344this.clearSearch();
32345},
32346enableInterface: function() {
32347if (this.parent.enableInterface.apply(this, arguments)) {
32348this.search.prop("disabled", !this.isInterfaceEnabled());
32349}
32350},
32351initSelection: function() {
32352var data;
32353if (this.opts.element.val() === "" && this.opts.element.text() === "") {
32354this.updateSelection([]);
32355this.close();
32356this.clearSearch();
32357}
32358if (this.select || this.opts.element.val() !== "") {
32359var self = this;
32360this.opts.initSelection.call(null, this.opts.element, function(data) {
32361if (data !== undefined && data !== null) {
32362self.updateSelection(data);
32363self.close();
32364self.clearSearch();
32365}
32366});
32367}
32368},
32369clearSearch: function() {
32370var placeholder = this.getPlaceholder()
32371  , maxWidth = this.getMaxSearchWidth();
32372if (placeholder !== undefined && this.getVal().length === 0 && this.search.hasClass("select2-focused") === false) {
32373this.search.val(placeholder).addClass("select2-default");
32374this.search.width(maxWidth > 0 ? maxWidth : this.container.css("width"));
32375} else {
32376this.search.val("").width(10);
32377}
32378},
32379clearPlaceholder: function() {
32380if (this.search.hasClass("select2-default")) {
32381this.search.val("").removeClass("select2-default");
32382}
32383},
32384opening: function() {
32385this.clearPlaceholder();
32386this.resizeSearch();
32387this.parent.opening.apply(this, arguments);
32388this.focusSearch();
32389if (this.search.val() === "") {
32390if (this.nextSearchTerm != undefined) {
32391this.search.val(this.nextSearchTerm);
32392this.search.select();
32393}
32394}
32395this.updateResults(true);
32396if (this.opts.shouldFocusInput(this)) {
32397this.search.focus();
32398}
32399this.opts.element.trigger($.Event("select2-open"));
32400},
32401close: function() {
32402if (!this.opened())
32403return;
32404this.parent.close.apply(this, arguments);
32405},
32406focus: function() {
32407this.close();
32408this.search.focus();
32409},
32410isFocused: function() {
32411return this.search.hasClass("select2-focused");
32412},
32413updateSelection: function(data) {
32414var ids = []
32415  , filtered = []
32416  , self = this;
32417$(data).each(function() {
32418if (indexOf(self.id(this), ids) < 0) {
32419ids.push(self.id(this));
32420filtered.push(this);
32421}
32422});
32423data = filtered;
32424this.selection.find(".select2-search-choice").remove();
32425$(data).each(function() {
32426self.addSelectedChoice(this);
32427});
32428self.postprocessResults();
32429},
32430tokenize: function() {
32431var input = this.search.val();
32432input = this.opts.tokenizer.call(this, input, this.data(), this.bind(this.onSelect), this.opts);
32433if (input != null && input != undefined) {
32434this.search.val(input);
32435if (input.length > 0) {
32436this.open();
32437}
32438}
32439},
32440onSelect: function(data, options) {
32441if (!this.triggerSelect(data) || data.text === "") {
32442return;
32443}
32444this.addSelectedChoice(data);
32445this.opts.element.trigger({
32446type: "selected",
32447val: this.id(data),
32448choice: data
32449});
32450this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val());
32451this.clearSearch();
32452this.updateResults();
32453if (this.select || !this.opts.closeOnSelect)
32454this.postprocessResults(data, false, this.opts.closeOnSelect === true);
32455if (this.opts.closeOnSelect) {
32456this.close();
32457this.search.width(10);
32458} else {
32459if (this.countSelectableResults() > 0) {
32460this.search.width(10);
32461this.resizeSearch();
32462if (this.getMaximumSelectionSize() > 0 && this.val().length >= this.getMaximumSelectionSize()) {
32463this.updateResults(true);
32464} else {
32465if (this.nextSearchTerm != undefined) {
32466this.search.val(this.nextSearchTerm);
32467this.updateResults();
32468this.search.select();
32469}
32470}
32471this.positionDropdown();
32472} else {
32473this.close();
32474this.search.width(10);
32475}
32476}
32477this.triggerChange({
32478added: data
32479});
32480if (!options || !options.noFocus)
32481this.focusSearch();
32482},
32483cancel: function() {
32484this.close();
32485this.focusSearch();
32486},
32487addSelectedChoice: function(data) {
32488var enableChoice = !data.locked
32489  , enabledItem = $("<li class='select2-search-choice'>" + "<div></div>" + "<a href='#' class='select2-search-choice-close' tabindex='-1'></a>" + "</li>")
32490  , disabledItem = $("<li class='select2-search-choice select2-locked'>" + "<div></div>" + "</li>");
32491var choice = enableChoice ? enabledItem : disabledItem, id = this.id(data), val = this.getVal(), formatted, cssClass;
32492formatted = this.opts.formatSelection(data, choice.find("div"), this.opts.escapeMarkup);
32493if (formatted != undefined) {
32494choice.find("div").replaceWith("<div>" + formatted + "</div>");
32495}
32496cssClass = this.opts.formatSelectionCssClass(data, choice.find("div"));
32497if (cssClass != undefined) {
32498choice.addClass(cssClass);
32499}
32500if (enableChoice) {
32501choice.find(".select2-search-choice-close").on("mousedown", killEvent).on("click dblclick", this.bind(function(e) {
32502if (!this.isInterfaceEnabled())
32503return;
32504this.unselect($(e.target));
32505this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
32506killEvent(e);
32507this.close();
32508this.focusSearch();
32509})).on("focus", this.bind(function() {
32510if (!this.isInterfaceEnabled())
32511return;
32512this.container.addClass("select2-container-active");
32513this.dropdown.addClass("select2-drop-active");
32514}));
32515}
32516choice.data("select2-data", data);
32517choice.insertBefore(this.searchContainer);
32518val.push(id);
32519this.setVal(val);
32520},
32521unselect: function(selected) {
32522var val = this.getVal(), data, index;
32523selected = selected.closest(".select2-search-choice");
32524if (selected.length === 0) {
32525throw "Invalid argument: " + selected + ". Must be .select2-search-choice";
32526}
32527data = selected.data("select2-data");
32528if (!data) {
32529return;
32530}
32531var evt = $.Event("select2-removing");
32532evt.val = this.id(data);
32533evt.choice = data;
32534this.opts.element.trigger(evt);
32535if (evt.isDefaultPrevented()) {
32536return false;
32537}
32538while ((index = indexOf(this.id(data), val)) >= 0) {
32539val.splice(index, 1);
32540this.setVal(val);
32541if (this.select)
32542this.postprocessResults();
32543}
32544selected.remove();
32545this.opts.element.trigger({
32546type: "select2-removed",
32547val: this.id(data),
32548choice: data
32549});
32550this.triggerChange({
32551removed: data
32552});
32553return true;
32554},
32555postprocessResults: function(data, initial, noHighlightUpdate) {
32556var val = this.getVal()
32557  , choices = this.results.find(".select2-result")
32558  , compound = this.results.find(".select2-result-with-children")
32559  , self = this;
32560choices.each2(function(i, choice) {
32561var id = self.id(choice.data("select2-data"));
32562if (indexOf(id, val) >= 0) {
32563choice.addClass("select2-selected");
32564choice.find(".select2-result-selectable").addClass("select2-selected");
32565}
32566});
32567compound.each2(function(i, choice) {
32568if (!choice.is('.select2-result-selectable') && choice.find(".select2-result-selectable:not(.select2-selected)").length === 0) {
32569choice.addClass("select2-selected");
32570}
32571});
32572if (this.highlight() == -1 && noHighlightUpdate !== false) {
32573self.highlight(0);
32574}
32575if (!this.opts.createSearchChoice && !choices.filter('.select2-result:not(.select2-selected)').length > 0) {
32576if (!data || data && !data.more && this.results.find(".select2-no-results").length === 0) {
32577if (checkFormatter(self.opts.formatNoMatches, "formatNoMatches")) {
32578this.results.append("<li class='select2-no-results'>" + evaluate(self.opts.formatNoMatches, self.opts.element, self.search.val()) + "</li>");
32579}
32580}
32581}
32582},
32583getMaxSearchWidth: function() {
32584return this.selection.width() - getSideBorderPadding(this.search);
32585},
32586resizeSearch: function() {
32587var minimumWidth, left, maxWidth, containerLeft, searchWidth, sideBorderPadding = getSideBorderPadding(this.search);
32588minimumWidth = measureTextWidth(this.search) + 10;
32589left = this.search.offset().left;
32590maxWidth = this.selection.width();
32591containerLeft = this.selection.offset().left;
32592searchWidth = maxWidth - (left - containerLeft) - sideBorderPadding;
32593if (searchWidth < minimumWidth) {
32594searchWidth = maxWidth - sideBorderPadding;
32595}
32596if (searchWidth < 40) {
32597searchWidth = maxWidth - sideBorderPadding;
32598}
32599if (searchWidth <= 0) {
32600searchWidth = minimumWidth;
32601}
32602this.search.width(Math.floor(searchWidth));
32603},
32604getVal: function() {
32605var val;
32606if (this.select) {
32607val = this.select.val();
32608return val === null ? [] : val;
32609} else {
32610val = this.opts.element.val();
32611return splitVal(val, this.opts.separator);
32612}
32613},
32614setVal: function(val) {
32615var unique;
32616if (this.select) {
32617this.select.val(val);
32618} else {
32619unique = [];
32620$(val).each(function() {
32621if (indexOf(this, unique) < 0)
32622unique.push(this);
32623});
32624this.opts.element.val(unique.length === 0 ? "" : unique.join(this.opts.separator));
32625}
32626},
32627buildChangeDetails: function(old, current) {
32628var current = current.slice(0)
32629  , old = old.slice(0);
32630for (var i = 0; i < current.length; i++) {
32631for (var j = 0; j < old.length; j++) {
32632if (equal(this.opts.id(current[i]), this.opts.id(old[j]))) {
32633current.splice(i, 1);
32634if (i > 0) {
32635i--;
32636}
32637old.splice(j, 1);
32638j--;
32639}
32640}
32641}
32642return {
32643added: current,
32644removed: old
32645};
32646},
32647val: function(val, triggerChange) {
32648var oldData, self = this;
32649if (arguments.length === 0) {
32650return this.getVal();
32651}
32652oldData = this.data();
32653if (!oldData.length)
32654oldData = [];
32655if (!val && val !== 0) {
32656this.opts.element.val("");
32657this.updateSelection([]);
32658this.clearSearch();
32659if (triggerChange) {
32660this.triggerChange({
32661added: this.data(),
32662removed: oldData
32663});
32664}
32665return;
32666}
32667this.setVal(val);
32668if (this.select) {
32669this.opts.initSelection(this.select, this.bind(this.updateSelection));
32670if (triggerChange) {
32671this.triggerChange(this.buildChangeDetails(oldData, this.data()));
32672}
32673} else {
32674if (this.opts.initSelection === undefined) {
32675throw new Error("val() cannot be called if initSelection() is not defined");
32676}
32677this.opts.initSelection(this.opts.element, function(data) {
32678var ids = $.map(data, self.id);
32679self.setVal(ids);
32680self.updateSelection(data);
32681self.clearSearch();
32682if (triggerChange) {
32683self.triggerChange(self.buildChangeDetails(oldData, self.data()));
32684}
32685});
32686}
32687this.clearSearch();
32688},
32689onSortStart: function() {
32690if (this.select) {
32691throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");
32692}
32693this.search.width(0);
32694this.searchContainer.hide();
32695},
32696onSortEnd: function() {
32697var val = []
32698  , self = this;
32699this.searchContainer.show();
32700this.searchContainer.appendTo(this.searchContainer.parent());
32701this.resizeSearch();
32702this.selection.find(".select2-search-choice").each(function() {
32703val.push(self.opts.id($(this).data("select2-data")));
32704});
32705this.setVal(val);
32706this.triggerChange();
32707},
32708data: function(values, triggerChange) {
32709var self = this, ids, old;
32710if (arguments.length === 0) {
32711return this.selection.children(".select2-search-choice").map(function() {
32712return $(this).data("select2-data");
32713}).get();
32714} else {
32715old = this.data();
32716if (!values) {
32717values = [];
32718}
32719ids = $.map(values, function(e) {
32720return self.opts.id(e);
32721});
32722this.setVal(ids);
32723this.updateSelection(values);
32724this.clearSearch();
32725if (triggerChange) {
32726this.triggerChange(this.buildChangeDetails(old, this.data()));
32727}
32728}
32729}
32730});
32731$.fn.select2 = function() {
32732var args = Array.prototype.slice.call(arguments, 0), opts, select2, method, value, multiple, allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "dropdown", "onSortStart", "onSortEnd", "enable", "disable", "readonly", "positionDropdown", "data", "search"], valueMethods = ["opened", "isFocused", "container", "dropdown"], propertyMethods = ["val", "data"], methodsMap = {
32733search: "externalSearch"
32734};
32735this.each(function() {
32736if (args.length === 0 || typeof (args[0]) === "object") {
32737opts = args.length === 0 ? {} : $.extend({}, args[0]);
32738opts.element = $(this);
32739if (opts.element.get(0).tagName.toLowerCase() === "select") {
32740multiple = opts.element.prop("multiple");
32741} else {
32742multiple = opts.multiple || false;
32743if ("tags"in opts) {
32744opts.multiple = multiple = true;
32745}
32746}
32747select2 = multiple ? new window.Select2["class"].multi() : new window.Select2["class"].single();
32748select2.init(opts);
32749} else if (typeof (args[0]) === "string") {
32750if (indexOf(args[0], allowedMethods) < 0) {
32751throw "Unknown method: " + args[0];
32752}
32753value = undefined;
32754select2 = $(this).data("select2");
32755if (select2 === undefined)
32756return;
32757method = args[0];
32758if (method === "container") {
32759value = select2.container;
32760} else if (method === "dropdown") {
32761value = select2.dropdown;
32762} else {
32763if (methodsMap[method])
32764method = methodsMap[method];
32765value = select2[method].apply(select2, args.slice(1));
32766}
32767if (indexOf(args[0], valueMethods) >= 0 || (indexOf(args[0], propertyMethods) >= 0 && args.length == 1)) {
32768return false;
32769}
32770} else {
32771throw "Invalid arguments to select2 plugin: " + args;
32772}
32773});
32774return (value === undefined) ? this : value;
32775}
32776;
32777$.fn.select2.defaults = {
32778width: "copy",
32779loadMorePadding: 0,
32780closeOnSelect: true,
32781openOnEnter: true,
32782containerCss: {},
32783dropdownCss: {},
32784containerCssClass: "",
32785dropdownCssClass: "",
32786formatResult: function(result, container, query, escapeMarkup) {
32787var markup = [];
32788markMatch(result.text, query.term, markup, escapeMarkup);
32789return markup.join("");
32790},
32791formatSelection: function(data, container, escapeMarkup) {
32792return data ? escapeMarkup(data.text) : undefined;
32793},
32794sortResults: function(results, container, query) {
32795return results;
32796},
32797formatResultCssClass: function(data) {
32798return data.css;
32799},
32800formatSelectionCssClass: function(data, container) {
32801return undefined;
32802},
32803minimumResultsForSearch: 0,
32804minimumInputLength: 0,
32805maximumInputLength: null,
32806maximumSelectionSize: 0,
32807id: function(e) {
32808return e == undefined ? null : e.id;
32809},
32810matcher: function(term, text) {
32811return stripDiacritics('' + text).toUpperCase().indexOf(stripDiacritics('' + term).toUpperCase()) >= 0;
32812},
32813separator: ",",
32814tokenSeparators: [],
32815tokenizer: defaultTokenizer,
32816escapeMarkup: defaultEscapeMarkup,
32817blurOnChange: false,
32818selectOnBlur: false,
32819adaptContainerCssClass: function(c) {
32820return c;
32821},
32822adaptDropdownCssClass: function(c) {
32823return null;
32824},
32825nextSearchTerm: function(selectedObject, currentSearchTerm) {
32826return undefined;
32827},
32828searchInputPlaceholder: '',
32829createSearchChoicePosition: 'top',
32830shouldFocusInput: function(instance) {
32831var supportsTouchEvents = (('ontouchstart'in window) || (navigator.msMaxTouchPoints > 0));
32832if (!supportsTouchEvents) {
32833return true;
32834}
32835if (instance.opts.minimumResultsForSearch < 0) {
32836return false;
32837}
32838return true;
32839}
32840};
32841$.fn.select2.locales = [];
32842$.fn.select2.locales['en'] = {
32843formatMatches: function(matches) {
32844if (matches === 1) {
32845return "One result is available, press enter to select it.";
32846}
32847return matches + " results are available, use up and down arrow keys to navigate.";
32848},
32849formatNoMatches: function() {
32850return "No matches found";
32851},
32852formatAjaxError: function(jqXHR, textStatus, errorThrown) {
32853return "Loading failed";
32854},
32855formatInputTooShort: function(input, min) {
32856var n = min - input.length;
32857return "Please enter " + n + " or more character" + (n == 1 ? "" : "s");
32858},
32859formatInputTooLong: function(input, max) {
32860var n = input.length - max;
32861return "Please delete " + n + " character" + (n == 1 ? "" : "s");
32862},
32863formatSelectionTooBig: function(limit) {
32864return "You can only select " + limit + " item" + (limit == 1 ? "" : "s");
32865},
32866formatLoadMore: function(pageNumber) {
32867return "Loading more results…";
32868},
32869formatSearching: function() {
32870return "Searching…";
32871},
32872};
32873$.extend($.fn.select2.defaults, $.fn.select2.locales['en']);
32874$.fn.select2.ajaxDefaults = {
32875transport: $.ajax,
32876params: {
32877type: "GET",
32878cache: false,
32879dataType: "json"
32880}
32881};
32882window.Select2 = {
32883query: {
32884ajax: ajax,
32885local: local,
32886tags: tags
32887},
32888util: {
32889debounce: debounce,
32890markMatch: markMatch,
32891escapeMarkup: defaultEscapeMarkup,
32892stripDiacritics: stripDiacritics
32893},
32894"class": {
32895"abstract": AbstractSelect2,
32896"single": SingleSelect2,
32897"multi": MultiSelect2
32898}
32899};
32900}(jQuery));
32901;
32902/* /web/static/lib/clipboard/clipboard.js defined in bundle 'web.assets_common' */
32903(function webpackUniversalModuleDefinition(root, factory) {
32904if (typeof exports === 'object' && typeof module === 'object')
32905module.exports = factory();
32906else if (typeof define === 'function' && define.amd)
32907define([], factory);
32908else if (typeof exports === 'object')
32909exports["ClipboardJS"] = factory();
32910else
32911root["ClipboardJS"] = factory();
32912}
32913)(this, function() {
32914return (function(modules) {
32915var installedModules = {};
32916function __webpack_require__(moduleId) {
32917if (installedModules[moduleId]) {
32918return installedModules[moduleId].exports;
32919}
32920var module = installedModules[moduleId] = {
32921i: moduleId,
32922l: false,
32923exports: {}
32924};
32925modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
32926module.l = true;
32927return module.exports;
32928}
32929__webpack_require__.m = modules;
32930__webpack_require__.c = installedModules;
32931__webpack_require__.i = function(value) {
32932return value;
32933}
32934;
32935__webpack_require__.d = function(exports, name, getter) {
32936if (!__webpack_require__.o(exports, name)) {
32937Object.defineProperty(exports, name, {
32938configurable: false,
32939enumerable: true,
32940get: getter
32941});
32942}
32943}
32944;
32945__webpack_require__.n = function(module) {
32946var getter = module && module.__esModule ? function getDefault() {
32947return module['default'];
32948}
32949: function getModuleExports() {
32950return module;
32951}
32952;
32953__webpack_require__.d(getter, 'a', getter);
32954return getter;
32955}
32956;
32957__webpack_require__.o = function(object, property) {
32958return Object.prototype.hasOwnProperty.call(object, property);
32959}
32960;
32961__webpack_require__.p = "";
32962return __webpack_require__(__webpack_require__.s = 3);
32963}
32964)([(function(module, exports, __webpack_require__) {
32965var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
32966(function(global, factory) {
32967if (true) {
32968!(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, __webpack_require__(7)],
32969__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
32970__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
32971__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
32972} else if (typeof exports !== "undefined") {
32973factory(module, require('select'));
32974} else {
32975var mod = {
32976exports: {}
32977};
32978factory(mod, global.select);
32979global.clipboardAction = mod.exports;
32980}
32981}
32982)(this, function(module, _select) {
32983'use strict';
32984var _select2 = _interopRequireDefault(_select);
32985function _interopRequireDefault(obj) {
32986return obj && obj.__esModule ? obj : {
32987default: obj
32988};
32989}
32990var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
32991return typeof obj;
32992}
32993: function(obj) {
32994return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
32995}
32996;
32997function _classCallCheck(instance, Constructor) {
32998if (!(instance instanceof Constructor)) {
32999throw new TypeError("Cannot call a class as a function");
33000}
33001}
33002var _createClass = function() {
33003function defineProperties(target, props) {
33004for (var i = 0; i < props.length; i++) {
33005var descriptor = props[i];
33006descriptor.enumerable = descriptor.enumerable || false;
33007descriptor.configurable = true;
33008if ("value"in descriptor)
33009descriptor.writable = true;
33010Object.defineProperty(target, descriptor.key, descriptor);
33011}
33012}
33013return function(Constructor, protoProps, staticProps) {
33014if (protoProps)
33015defineProperties(Constructor.prototype, protoProps);
33016if (staticProps)
33017defineProperties(Constructor, staticProps);
33018return Constructor;
33019}
33020;
33021}();
33022var ClipboardAction = function() {
33023function ClipboardAction(options) {
33024_classCallCheck(this, ClipboardAction);
33025this.resolveOptions(options);
33026this.initSelection();
33027}
33028_createClass(ClipboardAction, [{
33029key: 'resolveOptions',
33030value: function resolveOptions() {
33031var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
33032this.action = options.action;
33033this.container = options.container;
33034this.emitter = options.emitter;
33035this.target = options.target;
33036this.text = options.text;
33037this.trigger = options.trigger;
33038this.selectedText = '';
33039}
33040}, {
33041key: 'initSelection',
33042value: function initSelection() {
33043if (this.text) {
33044this.selectFake();
33045} else if (this.target) {
33046this.selectTarget();
33047}
33048}
33049}, {
33050key: 'selectFake',
33051value: function selectFake() {
33052var _this = this;
33053var isRTL = document.documentElement.getAttribute('dir') == 'rtl';
33054this.removeFake();
33055this.fakeHandlerCallback = function() {
33056return _this.removeFake();
33057}
33058;
33059this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true;
33060this.fakeElem = document.createElement('textarea');
33061this.fakeElem.style.fontSize = '12pt';
33062this.fakeElem.style.border = '0';
33063this.fakeElem.style.padding = '0';
33064this.fakeElem.style.margin = '0';
33065this.fakeElem.style.position = 'absolute';
33066this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';
33067var yPosition = window.pageYOffset || document.documentElement.scrollTop;
33068this.fakeElem.style.top = yPosition + 'px';
33069this.fakeElem.setAttribute('readonly', '');
33070this.fakeElem.value = this.text;
33071this.container.appendChild(this.fakeElem);
33072this.selectedText = (0,
33073_select2.default)(this.fakeElem);
33074this.copyText();
33075}
33076}, {
33077key: 'removeFake',
33078value: function removeFake() {
33079if (this.fakeHandler) {
33080this.container.removeEventListener('click', this.fakeHandlerCallback);
33081this.fakeHandler = null;
33082this.fakeHandlerCallback = null;
33083}
33084if (this.fakeElem) {
33085this.container.removeChild(this.fakeElem);
33086this.fakeElem = null;
33087}
33088}
33089}, {
33090key: 'selectTarget',
33091value: function selectTarget() {
33092this.selectedText = (0,
33093_select2.default)(this.target);
33094this.copyText();
33095}
33096}, {
33097key: 'copyText',
33098value: function copyText() {
33099var succeeded = void 0;
33100try {
33101succeeded = document.execCommand(this.action);
33102} catch (err) {
33103succeeded = false;
vendor: 9,692 bytes, lines 33104-33436
33104}
33105this.handleResult(succeeded);
33106}
33107}, {
33108key: 'handleResult',
33109value: function handleResult(succeeded) {
33110this.emitter.emit(succeeded ? 'success' : 'error', {
33111action: this.action,
33112text: this.selectedText,
33113trigger: this.trigger,
33114clearSelection: this.clearSelection.bind(this)
33115});
33116}
33117}, {
33118key: 'clearSelection',
33119value: function clearSelection() {
33120if (this.trigger) {
33121this.trigger.focus();
33122}
33123window.getSelection().removeAllRanges();
33124}
33125}, {
33126key: 'destroy',
33127value: function destroy() {
33128this.removeFake();
33129}
33130}, {
33131key: 'action',
33132set: function set() {
33133var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy';
33134this._action = action;
33135if (this._action !== 'copy' && this._action !== 'cut') {
33136throw new Error('Invalid "action" value, use either "copy" or "cut"');
33137}
33138},
33139get: function get() {
33140return this._action;
33141}
33142}, {
33143key: 'target',
33144set: function set(target) {
33145if (target !== undefined) {
33146if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) {
33147if (this.action === 'copy' && target.hasAttribute('disabled')) {
33148throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
33149}
33150if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
33151throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
33152}
33153this._target = target;
33154} else {
33155throw new Error('Invalid "target" value, use a valid Element');
33156}
33157}
33158},
33159get: function get() {
33160return this._target;
33161}
33162}]);
33163return ClipboardAction;
33164}();
33165module.exports = ClipboardAction;
33166});
33167}
33168), (function(module, exports, __webpack_require__) {
33169var is = __webpack_require__(6);
33170var delegate = __webpack_require__(5);
33171function listen(target, type, callback) {
33172if (!target && !type && !callback) {
33173throw new Error('Missing required arguments');
33174}
33175if (!is.string(type)) {
33176throw new TypeError('Second argument must be a String');
33177}
33178if (!is.fn(callback)) {
33179throw new TypeError('Third argument must be a Function');
33180}
33181if (is.node(target)) {
33182return listenNode(target, type, callback);
33183} else if (is.nodeList(target)) {
33184return listenNodeList(target, type, callback);
33185} else if (is.string(target)) {
33186return listenSelector(target, type, callback);
33187} else {
33188throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
33189}
33190}
33191function listenNode(node, type, callback) {
33192node.addEventListener(type, callback);
33193return {
33194destroy: function() {
33195node.removeEventListener(type, callback);
33196}
33197}
33198}
33199function listenNodeList(nodeList, type, callback) {
33200Array.prototype.forEach.call(nodeList, function(node) {
33201node.addEventListener(type, callback);
33202});
33203return {
33204destroy: function() {
33205Array.prototype.forEach.call(nodeList, function(node) {
33206node.removeEventListener(type, callback);
33207});
33208}
33209}
33210}
33211function listenSelector(selector, type, callback) {
33212return delegate(document.body, selector, type, callback);
33213}
33214module.exports = listen;
33215}
33216), (function(module, exports) {
33217function E() {}
33218E.prototype = {
33219on: function(name, callback, ctx) {
33220var e = this.e || (this.e = {});
33221(e[name] || (e[name] = [])).push({
33222fn: callback,
33223ctx: ctx
33224});
33225return this;
33226},
33227once: function(name, callback, ctx) {
33228var self = this;
33229function listener() {
33230self.off(name, listener);
33231callback.apply(ctx, arguments);
33232}
33233;listener._ = callback
33234return this.on(name, listener, ctx);
33235},
33236emit: function(name) {
33237var data = [].slice.call(arguments, 1);
33238var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
33239var i = 0;
33240var len = evtArr.length;
33241for (i; i < len; i++) {
33242evtArr[i].fn.apply(evtArr[i].ctx, data);
33243}
33244return this;
33245},
33246off: function(name, callback) {
33247var e = this.e || (this.e = {});
33248var evts = e[name];
33249var liveEvents = [];
33250if (evts && callback) {
33251for (var i = 0, len = evts.length; i < len; i++) {
33252if (evts[i].fn !== callback && evts[i].fn._ !== callback)
33253liveEvents.push(evts[i]);
33254}
33255}
33256(liveEvents.length) ? e[name] = liveEvents : delete e[name];
33257return this;
33258}
33259};
33260module.exports = E;
33261}
33262), (function(module, exports, __webpack_require__) {
33263var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
33264(function(global, factory) {
33265if (true) {
33266!(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, __webpack_require__(0), __webpack_require__(2), __webpack_require__(1)],
33267__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
33268__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
33269__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
33270} else if (typeof exports !== "undefined") {
33271factory(module, require('./clipboard-action'), require('tiny-emitter'), require('good-listener'));
33272} else {
33273var mod = {
33274exports: {}
33275};
33276factory(mod, global.clipboardAction, global.tinyEmitter, global.goodListener);
33277global.clipboard = mod.exports;
33278}
33279}
33280)(this, function(module, _clipboardAction, _tinyEmitter, _goodListener) {
33281'use strict';
33282var _clipboardAction2 = _interopRequireDefault(_clipboardAction);
33283var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter);
33284var _goodListener2 = _interopRequireDefault(_goodListener);
33285function _interopRequireDefault(obj) {
33286return obj && obj.__esModule ? obj : {
33287default: obj
33288};
33289}
33290var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
33291return typeof obj;
33292}
33293: function(obj) {
33294return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
33295}
33296;
33297function _classCallCheck(instance, Constructor) {
33298if (!(instance instanceof Constructor)) {
33299throw new TypeError("Cannot call a class as a function");
33300}
33301}
33302var _createClass = function() {
33303function defineProperties(target, props) {
33304for (var i = 0; i < props.length; i++) {
33305var descriptor = props[i];
33306descriptor.enumerable = descriptor.enumerable || false;
33307descriptor.configurable = true;
33308if ("value"in descriptor)
33309descriptor.writable = true;
33310Object.defineProperty(target, descriptor.key, descriptor);
33311}
33312}
33313return function(Constructor, protoProps, staticProps) {
33314if (protoProps)
33315defineProperties(Constructor.prototype, protoProps);
33316if (staticProps)
33317defineProperties(Constructor, staticProps);
33318return Constructor;
33319}
33320;
33321}();
33322function _possibleConstructorReturn(self, call) {
33323if (!self) {
33324throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
33325}
33326return call && (typeof call === "object" || typeof call === "function") ? call : self;
33327}
33328function _inherits(subClass, superClass) {
33329if (typeof superClass !== "function" && superClass !== null) {
33330throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
33331}
33332subClass.prototype = Object.create(superClass && superClass.prototype, {
33333constructor: {
33334value: subClass,
33335enumerable: false,
33336writable: true,
33337configurable: true
33338}
33339});
33340if (superClass)
33341Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
33342}
33343var Clipboard = function(_Emitter) {
33344_inherits(Clipboard, _Emitter);
33345function Clipboard(trigger, options) {
33346_classCallCheck(this, Clipboard);
33347var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this));
33348_this.resolveOptions(options);
33349_this.listenClick(trigger);
33350return _this;
33351}
33352_createClass(Clipboard, [{
33353key: 'resolveOptions',
33354value: function resolveOptions() {
33355var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
33356this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
33357this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
33358this.text = typeof options.text === 'function' ? options.text : this.defaultText;
33359this.container = _typeof(options.container) === 'object' ? options.container : document.body;
33360}
33361}, {
33362key: 'listenClick',
33363value: function listenClick(trigger) {
33364var _this2 = this;
33365this.listener = (0,
33366_goodListener2.default)(trigger, 'click', function(e) {
33367return _this2.onClick(e);
33368});
33369}
33370}, {
33371key: 'onClick',
33372value: function onClick(e) {
33373var trigger = e.delegateTarget || e.currentTarget;
33374if (this.clipboardAction) {
33375this.clipboardAction = null;
33376}
33377this.clipboardAction = new _clipboardAction2.default({
33378action: this.action(trigger),
33379target: this.target(trigger),
33380text: this.text(trigger),
33381container: this.container,
33382trigger: trigger,
33383emitter: this
33384});
33385}
33386}, {
33387key: 'defaultAction',
33388value: function defaultAction(trigger) {
33389return getAttributeValue('action', trigger);
33390}
33391}, {
33392key: 'defaultTarget',
33393value: function defaultTarget(trigger) {
33394var selector = getAttributeValue('target', trigger);
33395if (selector) {
33396return document.querySelector(selector);
33397}
33398}
33399}, {
33400key: 'defaultText',
33401value: function defaultText(trigger) {
33402return getAttributeValue('text', trigger);
33403}
33404}, {
33405key: 'destroy',
33406value: function destroy() {
33407this.listener.destroy();
33408if (this.clipboardAction) {
33409this.clipboardAction.destroy();
33410this.clipboardAction = null;
33411}
33412}
33413}], [{
33414key: 'isSupported',
33415value: function isSupported() {
33416var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
33417var actions = typeof action === 'string' ? [action] : action;
33418var support = !!document.queryCommandSupported;
33419actions.forEach(function(action) {
33420support = support && !!document.queryCommandSupported(action);
33421});
33422return support;
33423}
33424}]);
33425return Clipboard;
33426}(_tinyEmitter2.default);
33427function getAttributeValue(suffix, element) {
33428var attribute = 'data-clipboard-' + suffix;
33429if (!element.hasAttribute(attribute)) {
33430return;
33431}
33432return element.getAttribute(attribute);
33433}
33434module.exports = Clipboard;
33435});
33436}
33437), (function(module, exports) {
33438var DOCUMENT_NODE_TYPE = 9;
33439if (typeof Element !== 'undefined' && !Element.prototype.matches) {
33440var proto = Element.prototype;
33441proto.matches = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector || proto.webkitMatchesSelector;
33442}
33443function closest(element, selector) {
33444while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
33445if (typeof element.matches === 'function' && element.matches(selector)) {
33446return element;
33447}
33448element = element.parentNode;
33449}
33450}
33451module.exports = closest;
33452}
33453), (function(module, exports, __webpack_require__) {
33454var closest = __webpack_require__(4);
33455function _delegate(element, selector, type, callback, useCapture) {
33456var listenerFn = listener.apply(this, arguments);
33457element.addEventListener(type, listenerFn, useCapture);
33458return {
33459destroy: function() {
33460element.removeEventListener(type, listenerFn, useCapture);
33461}
33462}
33463}
33464function delegate(elements, selector, type, callback, useCapture) {
33465if (typeof elements.addEventListener === 'function') {
33466return _delegate.apply(null, arguments);
33467}
33468if (typeof type === 'function') {
33469return _delegate.bind(null, document).apply(null, arguments);
33470}
33471if (typeof elements === 'string') {
33472elements = document.querySelectorAll(elements);
33473}
33474return Array.prototype.map.call(elements, function(element) {
33475return _delegate(element, selector, type, callback, useCapture);
33476});
33477}
33478function listener(element, selector, type, callback) {
33479return function(e) {
33480e.delegateTarget = closest(e.target, selector);
33481if (e.delegateTarget) {
33482callback.call(element, e);
33483}
33484}
33485}
33486module.exports = delegate;
33487}
33488), (function(module, exports) {
33489exports.node = function(value) {
33490return value !== undefined && value instanceof HTMLElement && value.nodeType === 1;
33491}
33492;
33493exports.nodeList = function(value) {
33494var type = Object.prototype.toString.call(value);
33495return value !== undefined && (type === '[object NodeList]' || type === '[object HTMLCollection]') && ('length'in value) && (value.length === 0 || exports.node(value[0]));
33496}
33497;
33498exports.string = function(value) {
33499return typeof value === 'string' || value instanceof String;
33500}
33501;
33502exports.fn = function(value) {
33503var type = Object.prototype.toString.call(value);
33504return type === '[object Function]';
33505}
33506;
33507}
33508), (function(module, exports) {
33509function select(element) {
33510var selectedText;
33511if (element.nodeName === 'SELECT') {
33512element.focus();
33513selectedText = element.value;
33514} else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
33515var isReadOnly = element.hasAttribute('readonly');
33516if (!isReadOnly) {
33517element.setAttribute('readonly', '');
33518}
33519element.select();
33520element.setSelectionRange(0, element.value.length);
33521if (!isReadOnly) {
33522element.removeAttribute('readonly');
33523}
33524selectedText = element.value;
33525} else {
33526if (element.hasAttribute('contenteditable')) {
33527element.focus();
33528}
33529var selection = window.getSelection();
33530var range = document.createRange();
33531range.selectNodeContents(element);
33532selection.removeAllRanges();
33533selection.addRange(range);
33534selectedText = selection.toString();
33535}
33536return selectedText;
33537}
33538module.exports = select;
33539}
33540)]);
33541});
33542;
33543/* /web/static/lib/qweb/qweb2.js defined in bundle 'web.assets_common' */
33544var QWeb2 = {
33545expressions_cache: {},
33546RESERVED_WORDS: 'true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,this,typeof,eval,void,Math,RegExp,Array,Object,Date'.split(','),
33547ACTIONS_PRECEDENCE: 'foreach,if,elif,else,call,set,tag,esc,raw,js,debug,log'.split(','),
33548WORD_REPLACEMENT: {
33549'and': '&&',
33550'or': '||',
33551'gt': '>',
33552'gte': '>=',
33553'lt': '<',
33554'lte': '<='
33555},
33556VOID_ELEMENTS: 'area,base,br,col,embed,hr,img,input,keygen,link,menuitem,meta,param,source,track,wbr'.split(','),
33557tools: {
33558exception: function(message, context) {
33559context = context || {};
33560var prefix = 'QWeb2';
33561if (context.template) {
33562prefix += " - template['" + context.template + "']";
33563}
33564throw new Error(prefix + ": " + message);
33565},
33566warning: function(message) {
33567if (typeof (window) !== 'undefined' && window.console) {
33568window.console.warn(message);
33569}
33570},
33571trim: function(s, mode) {
33572switch (mode) {
33573case "left":
33574return s.replace(/^\s*/, "");
33575case "right":
33576return s.replace(/\s*$/, "");
33577default:
33578return s.replace(/^\s*|\s*$/g, "");
33579}
33580},
33581js_escape: function(s, noquotes) {
33582return (noquotes ? '' : "'") + s.replace(/\r?\n/g, "\\n").replace(/'/g, "\\'") + (noquotes ? '' : "'");
33583},
33584html_escape: function(s, attribute) {
33585if (s == null) {
33586return '';
33587}
33588s = String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
33589if (attribute) {
33590s = s.replace(/"/g, '&quot;');
33591}
33592return s;
33593},
33594gen_attribute: function(o) {
33595if (o !== null && o !== undefined) {
33596if (o.constructor === Array) {
33597if (o[1] !== null && o[1] !== undefined) {
33598return this.format_attribute(o[0], o[1]);
33599}
33600} else if (typeof o === 'object') {
33601var r = '';
33602for (var k in o) {
33603if (o.hasOwnProperty(k)) {
33604r += this.gen_attribute([k, o[k]]);
33605}
33606}
33607return r;
33608}
33609}
33610return '';
33611},
33612format_attribute: function(name, value) {
33613return ' ' + name + '="' + this.html_escape(value, true) + '"';
33614},
33615extend: function(dst, src, exclude) {
33616for (var p in src) {
33617if (src.hasOwnProperty(p) && !(exclude && this.arrayIndexOf(exclude, p) !== -1)) {
33618dst[p] = src[p];
33619}
33620}
33621return dst;
33622},
33623arrayIndexOf: function(array, item) {
33624for (var i = 0, ilen = array.length; i < ilen; i++) {
33625if (array[i] === item) {
33626return i;
33627}
33628}
33629return -1;
33630},
33631get_element_sibling: function(node, dom_attr) {
33632var sibling = node[dom_attr];
33633while (sibling && sibling.nodeType !== 1) {
33634sibling = sibling[dom_attr];
33635}
33636return sibling;
33637},
33638xml_node_to_string: function(node, childs_only) {
33639if (childs_only) {
33640var childs = node.childNodes
33641  , r = [];
33642for (var i = 0, ilen = childs.length; i < ilen; i++) {
33643r.push(this.xml_node_to_string(childs[i]));
33644}
33645return r.join('');
33646} else {
33647if (node.nodeType == 3) {
33648return node.data;
33649}
33650if (typeof XMLSerializer !== 'undefined') {
33651return (new XMLSerializer()).serializeToString(node);
33652} else {
33653switch (node.nodeType) {
33654case 1:
33655return node.outerHTML;
33656case 4:
33657return '<![CDATA[' + node.data + ']]>';
33658case 8:
33659return '<!-- ' + node.data + '-->';
33660}
33661throw new Error('Unknown node type ' + node.nodeType);
33662}
33663}
33664},
33665call: function(context, template, old_dict, _import, callback) {
33666var new_dict = this.extend({}, old_dict);
33667new_dict['__caller__'] = old_dict['__template__'];
33668if (callback) {
33669new_dict[0] = callback(context, new_dict);
33670}
33671return context.engine._render(template, new_dict);
33672},
33673foreach: function(context, enu, as, old_dict, callback) {
33674if (enu != null) {
33675var index, jlen, cur;
33676var new_dict = this.extend({}, old_dict);
33677new_dict[as + "_all"] = enu;
33678var as_value = as + "_value"
33679  , as_index = as + "_index"
33680  , as_first = as + "_first"
33681  , as_last = as + "_last"
33682  , as_parity = as + "_parity";
33683if (enu instanceof Array) {
33684var size = enu.length;
33685new_dict[as + "_size"] = size;
33686for (index = 0,
33687jlen = enu.length; index < jlen; index++) {
33688cur = enu[index];
33689new_dict[as_value] = cur;
33690new_dict[as_index] = index;
33691new_dict[as_first] = index === 0;
33692new_dict[as_last] = index + 1 === size;
33693new_dict[as_parity] = (index % 2 == 1 ? 'odd' : 'even');
33694if (cur && cur.constructor === Object) {
33695this.extend(new_dict, cur);
33696}
33697new_dict[as] = cur;
33698callback(context, new_dict);
33699}
33700} else if (enu.constructor == Number) {
33701var _enu = [];
33702for (var i = 0; i < enu; i++) {
33703_enu.push(i);
33704}
33705this.foreach(context, _enu, as, old_dict, callback);
33706} else {
33707index = 0;
33708for (var k in enu) {
33709if (enu.hasOwnProperty(k)) {
33710cur = enu[k];
33711new_dict[as_value] = cur;
33712new_dict[as_index] = index;
33713new_dict[as_first] = index === 0;
33714new_dict[as_parity] = (index % 2 == 1 ? 'odd' : 'even');
33715new_dict[as] = k;
33716callback(context, new_dict);
33717index += 1;
33718}
33719}
33720}
33721_.each(Object.keys(old_dict), function(z) {
33722old_dict[z] = new_dict[z];
33723});
33724} else {
33725this.exception("No enumerator given to foreach", context);
33726}
33727}
33728}
33729};
33730QWeb2.Engine = (function() {
33731function Engine() {
33732this.prefix = 't';
33733this.debug = false;
33734this.templates_resources = [];
33735this.templates = {};
33736this.compiled_templates = {};
33737this.extend_templates = {};
33738this.default_dict = {};
33739this.tools = QWeb2.tools;
33740this.jQuery = window.jQuery;
33741this.reserved_words = QWeb2.RESERVED_WORDS.slice(0);
33742this.actions_precedence = QWeb2.ACTIONS_PRECEDENCE.slice(0);
33743this.void_elements = QWeb2.VOID_ELEMENTS.slice(0);
33744this.word_replacement = QWeb2.tools.extend({}, QWeb2.WORD_REPLACEMENT);
33745this.preprocess_node = null;
33746for (var i = 0; i < arguments.length; i++) {
33747this.add_template(arguments[i]);
33748}
33749}
33750QWeb2.tools.extend(Engine.prototype, {
33751add_template: function(template, callback) {
33752var self = this;
33753this.templates_resources.push(template);
33754if (template.constructor === String) {
33755return this.load_xml(template, function(err, xDoc) {
33756if (err) {
33757if (callback) {
33758return callback(err);
33759} else {
33760throw err;
33761}
33762}
33763self.add_template(xDoc, callback);
33764});
33765}
33766template = this.preprocess(template);
33767var ec = (template.documentElement && template.documentElement.childNodes) || template.childNodes || [];
33768for (var i = 0; i < ec.length; i++) {
33769var node = ec[i];
33770if (node.nodeType === 1) {
33771var name = node.getAttribute(this.prefix + '-name');
33772var extend = node.getAttribute(this.prefix + '-extend');
33773if (name && extend) {
33774if (!this.templates[extend]) {
33775return this.tools.exception("Can't clone undefined template " + extend);
33776}
33777this.templates[name] = this.templates[extend].cloneNode(true);
33778extend = name;
33779name = undefined;
33780}
33781if (name) {
33782this.templates[name] = node;
33783this.compiled_templates[name] = null;
33784} else if (extend) {
33785delete (this.compiled_templates[extend]);
33786if (this.extend_templates[extend]) {
33787this.extend_templates[extend].push(node);
33788} else {
33789this.extend_templates[extend] = [node];
33790}
33791}
33792}
33793}
33794if (callback) {
33795callback(null, template);
33796}
33797return true;
33798},
33799preprocess: function(doc) {
33800var self = this;
33801var childs = (doc.documentElement && doc.documentElement.childNodes) || doc.childNodes || [];
33802for (var i = 0; i < childs.length; i++) {
33803var node = childs[i];
33804if (node.nodeType === 1 && node.nodeName == 'parsererror') {
33805return this.tools.exception(node.innerText);
33806}
33807}
33808var tbranch = doc.querySelectorAll('[t-elif], [t-else]');
33809for (var i = 0, ilen = tbranch.length; i < ilen; i++) {
33810var node = tbranch[i];
33811var prev_elem = self.tools.get_element_sibling(node, 'previousSibling');
33812var pattr = function(name) {
33813return prev_elem.getAttribute(name);
33814}
33815var nattr = function(name) {
33816return +!!node.getAttribute(name);
33817}
33818if (prev_elem && (pattr('t-if') || pattr('t-elif'))) {
33819if (pattr('t-foreach')) {
33820return self.tools.exception("Error: t-if cannot stay at the same level as t-foreach when using t-elif or t-else");
33821}
33822if (['t-if', 't-elif', 't-else'].map(nattr).reduce(function(a, b) {
33823return a + b;
33824}) > 1) {
33825return self.tools.exception("Error: only one conditional branching directive is allowed per node");
33826}
33827var text_node;
33828while ((text_node = node.previousSibling) !== prev_elem) {
33829if (self.tools.trim(text_node.nodeValue)) {
33830return self.tools.exception("Error: text is not allowed between branching directives");
33831}
33832text_node.parentNode.removeChild(text_node);
33833}
33834} else {
33835return self.tools.exception("Error: t-elif and t-else directives must be preceded by a t-if or t-elif directive");
33836}
33837}
33838return doc;
33839},
33840load_xml: function(s, callback) {
33841var self = this;
33842var async = !!callback;
33843s = this.tools.trim(s);
33844if (s.charAt(0) === '<') {
33845var tpl = this.load_xml_string(s);
33846if (callback) {
33847callback(null, tpl);
33848}
33849return tpl;
33850} else {
33851var req = this.get_xhr();
33852if (this.debug) {
33853s += '?debug=' + (new Date()).getTime();
33854}
33855req.open('GET', s, async);
33856if (async) {
33857req.addEventListener("load", function() {
33858if (req.status == 200 || req.status == 0) {
33859callback(null, self._parse_from_request(req));
33860} else {
33861callback(new Error("Can't load template " + s + ", http status " + req.status));
33862}
33863});
33864}
33865//req.send(null);
33866if (!async) {
33867return this._parse_from_request(req);
33868}
33869}
33870},
33871_parse_from_request: function(req) {
33872var xDoc = req.responseXML;
33873if (xDoc) {
33874if (!xDoc.documentElement) {
33875throw new Error("QWeb2: This xml document has no root document : " + xDoc.responseText);
33876}
33877if (xDoc.documentElement.nodeName == "parsererror") {
33878throw new Error("QWeb2: Could not parse document :" + xDoc.documentElement.childNodes[0].nodeValue);
33879}
33880return xDoc;
33881} else {
33882return this.load_xml_string(req.responseText);
33883}
33884},
33885load_xml_string: function(s) {
33886if (window.DOMParser) {
33887var dp = new DOMParser();
33888var r = dp.parseFromString(s, "text/xml");
33889if (r.body && r.body.firstChild && r.body.firstChild.nodeName == 'parsererror') {
33890throw new Error("QWeb2: Could not parse document :" + r.body.innerText);
33891}
33892return r;
33893}
33894var xDoc;
33895try {
33896xDoc = new ActiveXObject("MSXML2.DOMDocument");
33897} catch (e) {
33898throw new Error("Could not find a DOM Parser: " + e.message);
33899}
33900xDoc.async = false;
33901xDoc.preserveWhiteSpace = true;
33902xDoc.loadXML(s);
33903return xDoc;
33904},
33905has_template: function(template) {
33906return !!this.templates[template];
33907},
33908get_xhr: function() {
33909if (window.XMLHttpRequest) {
33910return new window.XMLHttpRequest();
33911}
33912try {
33913return new ActiveXObject('MSXML2.XMLHTTP.3.0');
33914} catch (e) {
33915throw new Error("Could not get XHR");
33916}
33917},
33918compile: function(node) {
33919var e = new QWeb2.Element(this,node);
33920var template = node.getAttribute(this.prefix + '-name');
33921return "   /* 'this' refers to Qweb2.Engine instance */\n" + "   var context = { engine : this, template : " + (this.tools.js_escape(template)) + " };\n" + "   dict = dict || {};\n" + "   dict['__template__'] = '" + template + "';\n" + "   var r = [];\n" + "   /* START TEMPLATE */" + (this.debug ? "" : " try {\n") + (e.compile()) + "\n" + "   /* END OF TEMPLATE */" + (this.debug ? "" : " } catch(error) {\n" + "   if (console && console.exception) console.exception(error);\n" + "   context.engine.tools.exception('Runtime Error: ' + error, context);\n") + (this.debug ? "" : "   }\n") + "   return r.join('');";
33922},
33923render: function(template, dict) {
33924dict = dict || {};
33925QWeb2.tools.extend(dict, this.default_dict);
33926var r = this._render(template, dict);
33927return r;
33928},
33929_render: function(template, dict) {
33930if (this.compiled_templates[template]) {
33931return this.compiled_templates[template].apply(this, [dict || {}]);
33932} else if (this.templates[template]) {
33933var ext;
33934if (ext = this.extend_templates[template]) {
33935var extend_node;
33936while (extend_node = ext.shift()) {
33937this.extend(template, extend_node);
33938}
33939}
33940var code = this.compile(this.templates[template]), tcompiled;
33941try {
33942tcompiled = new Function(['dict'],code);
33943} catch (error) {
33944if (this.debug && window.console) {
33945console.log(code);
33946}
33947this.tools.exception("Error evaluating template: " + error, {
33948template: template
33949});
33950}
33951if (!tcompiled) {
33952this.tools.exception("Error evaluating template: (IE?)" + error, {
33953template: template
33954});
33955}
33956this.compiled_templates[template] = tcompiled;
33957return this.render(template, dict);
33958} else {
33959return this.tools.exception("Template '" + template + "' not found");
33960}
33961},
33962extend: function(template, extend_node) {
33963var jQuery = this.jQuery;
33964if (!jQuery) {
33965return this.tools.exception("Can't extend template " + template + " without jQuery");
33966}
33967var template_dest = this.templates[template];
33968for (var i = 0, ilen = extend_node.childNodes.length; i < ilen; i++) {
33969var child = extend_node.childNodes[i];
33970if (child.nodeType === 1) {
33971var jquery = child.getAttribute(this.prefix + '-jquery'), operation = child.getAttribute(this.prefix + '-operation'), target, error_msg = "Error while extending template '" + template;
33972if (jquery) {
33973target = jQuery(jquery, template_dest);
33974if (!target.length && window.console) {
33975console.debug('Can\'t find "' + jquery + '" when extending template ' + template);
33976}
33977} else {
33978this.tools.exception(error_msg + "No expression given");
33979}
33980error_msg += "' (expression='" + jquery + "') : ";
33981if (operation) {
33982var allowed_operations = "append,prepend,before,after,replace,inner,attributes".split(',');
33983if (this.tools.arrayIndexOf(allowed_operations, operation) == -1) {
33984this.tools.exception(error_msg + "Invalid operation : '" + operation + "'");
33985}
33986operation = {
33987'replace': 'replaceWith',
33988'inner': 'html'
33989}[operation] || operation;
33990if (operation === 'attributes') {
33991jQuery('attribute', child).each(function() {
33992var attrib = jQuery(this);
33993target.attr(attrib.attr('name'), attrib.text());
33994});
33995} else {
33996target[operation](child.cloneNode(true).childNodes);
33997}
33998} else {
33999try {
34000var f = new Function(['$', 'document'],this.tools.xml_node_to_string(child, true));
34001} catch (error) {
34002return this.tools.exception("Parse " + error_msg + error);
34003}
34004try {
34005f.apply(target, [jQuery, template_dest.ownerDocument]);
34006} catch (error) {
34007return this.tools.exception("Runtime " + error_msg + error);
34008}
34009}
34010}
34011}
34012}
34013});
34014return Engine;
34015}
34016)();
34017QWeb2.Element = (function() {
34018function Element(engine, node) {
34019this.engine = engine;
34020this.node = node;
34021this.tag = node.tagName;
34022this.actions = {
34023tag: this.tag
34024};
34025this.actions_done = [];
34026this.attributes = {};
34027this.children = [];
34028this._top = [];
34029this._bottom = [];
34030this._indent = 1;
34031this.process_children = true;
34032this.is_void_element = ~QWeb2.tools.arrayIndexOf(this.engine.void_elements, this.tag);
34033var childs = this.node.childNodes;
34034if (childs) {
34035for (var i = 0, ilen = childs.length; i < ilen; i++) {
34036this.children.push(new QWeb2.Element(this.engine,childs[i]));
34037}
34038}
34039var attrs = this.node.attributes;
34040if (attrs) {
34041for (var j = 0, jlen = attrs.length; j < jlen; j++) {
34042var attr = attrs[j];
34043var name = attr.name;
34044var m = name.match(new RegExp("^" + this.engine.prefix + "-(.+)"));
34045if (m) {
34046name = m[1];
34047if (name === 'name') {
34048continue;
34049}
34050if (name.match(/^attf?(-.*)?/)) {
34051this.attributes[m[0]] = attr.value;
34052} else {
34053this.actions[name] = attr.value;
34054}
34055} else {
34056this.attributes[name] = attr.value;
34057}
34058}
34059}
34060if (this.engine.preprocess_node) {
34061this.engine.preprocess_node.call(this);
34062}
34063}
34064QWeb2.tools.extend(Element.prototype, {
34065compile: function() {
34066var r = []
34067  , instring = false
34068  , lines = this._compile().split('\n');
34069for (var i = 0, ilen = lines.length; i < ilen; i++) {
34070var m, line = lines[i];
34071if (m = line.match(/^(\s*)\/\/@string=(.*)/)) {
34072if (instring) {
34073if (this.engine.debug) {
34074r.push((m[2].indexOf("\\n") != -1 ? "',\n\t" + m[1] + "'" : '') + m[2]);
34075} else {
34076r.push(m[2]);
34077}
34078} else {
34079r.push(m[1] + "r.push('" + m[2]);
34080instring = true;
34081}
34082} else {
34083if (instring) {
34084r.push("');\n");
34085}
34086instring = false;
34087r.push(line + '\n');
34088}
34089}
34090return r.join('');
34091},
34092_compile: function() {
34093switch (this.node.nodeType) {
34094case 3:
34095case 4:
34096this.top_string(this.node.data);
34097break;
34098case 1:
34099this.compile_element();
34100}
34101var r = this._top.join('');
34102if (this.process_children) {
34103for (var i = 0, ilen = this.children.length; i < ilen; i++) {
34104var child = this.children[i];
34105child._indent = this._indent;
34106r += child._compile();
34107}
34108}
34109r += this._bottom.join('');
34110return r;
34111},
34112format_expression: function(e) {
34113if (QWeb2.expressions_cache[e]) {
34114return QWeb2.expressions_cache[e];
34115}
34116var chars = e.split('')
34117  , instring = ''
34118  , invar = ''
34119  , invar_pos = 0
34120  , r = '';
34121chars.push(' ');
34122for (var i = 0, ilen = chars.length; i < ilen; i++) {
34123var c = chars[i];
34124if (instring.length) {
34125if (c === instring && chars[i - 1] !== "\\") {
34126instring = '';
34127}
34128} else if (c === '"' || c === "'") {
34129instring = c;
34130} else if (c.match(/[a-zA-Z_\$]/) && !invar.length) {
34131invar = c;
34132invar_pos = i;
34133continue;
34134} else if (c.match(/\W/) && invar.length) {
34135if (chars[invar_pos - 1] !== '.' && QWeb2.tools.arrayIndexOf(this.engine.reserved_words, invar) < 0) {
34136invar = this.engine.word_replacement[invar] || ("dict['" + invar + "']");
34137}
34138r += invar;
34139invar = '';
34140} else if (invar.length) {
34141invar += c;
34142continue;
34143}
34144r += c;
34145}
34146r = r.slice(0, -1);
34147QWeb2.expressions_cache[e] = r;
34148return r;
34149},
34150format_str: function(e) {
34151if (e == '0') {
34152return 'dict[0]';
34153}
34154return this.format_expression(e);
34155},
34156string_interpolation: function(s) {
34157var _this = this;
34158if (!s) {
34159return "''";
34160}
34161function append_literal(s) {
34162s && r.push(_this.engine.tools.js_escape(s));
34163}
34164var re = /(?:#{(.+?)}|{{(.+?)}})/g, start = 0, r = [], m;
34165while (m = re.exec(s)) {
34166append_literal(s.slice(start, re.lastIndex - m[0].length));
34167r.push('(' + this.format_str(m[2] || m[1]) + ')');
34168start = re.lastIndex;
34169}
34170append_literal(s.slice(start));
34171return r.join(' + ');
34172},
34173indent: function() {
34174return this._indent++;
34175},
34176dedent: function() {
34177if (this._indent !== 0) {
34178return this._indent--;
34179}
34180},
34181get_indent: function() {
34182return new Array(this._indent + 1).join("\t");
34183},
34184top: function(s) {
34185return this._top.push(this.get_indent() + s + '\n');
34186},
34187top_string: function(s) {
34188return this._top.push(this.get_indent() + "//@string=" + this.engine.tools.js_escape(s, true) + '\n');
34189},
34190bottom: function(s) {
34191return this._bottom.unshift(this.get_indent() + s + '\n');
34192},
34193bottom_string: function(s) {
34194return this._bottom.unshift(this.get_indent() + "//@string=" + this.engine.tools.js_escape(s, true) + '\n');
34195},
34196compile_element: function() {
34197for (var i = 0, ilen = this.engine.actions_precedence.length; i < ilen; i++) {
34198var a = this.engine.actions_precedence[i];
34199if (a in this.actions) {
34200var value = this.actions[a];
34201var key = 'compile_action_' + a;
34202if (this[key]) {
34203this[key](value);
34204} else if (this.engine[key]) {
34205this.engine[key].call(this, value);
34206} else {
34207this.engine.tools.exception("No handler method for action '" + a + "'");
34208}
34209}
34210}
34211},
34212compile_action_tag: function() {
34213if (this.tag.toLowerCase() !== this.engine.prefix) {
34214this.top_string("<" + this.tag);
34215for (var a in this.attributes) {
34216var v = this.attributes[a];
34217var d = a.split('-');
34218if (d[0] === this.engine.prefix && d.length > 1) {
34219if (d.length === 2) {
34220this.top("r.push(context.engine.tools.gen_attribute(" + (this.format_expression(v)) + "));");
34221} else {
34222this.top("r.push(context.engine.tools.gen_attribute(['" + d.slice(2).join('-') + "', (" + (d[1] === 'att' ? this.format_expression(v) : this.string_interpolation(v)) + ")]));");
34223}
34224} else {
34225this.top_string(this.engine.tools.gen_attribute([a, v]));
34226}
34227}
34228if (this.actions.opentag === 'true' || (!this.children.length && this.is_void_element)) {
34229this.top_string("/>");
34230} else {
34231this.top_string(">");
34232this.bottom_string("</" + this.tag + ">");
34233}
34234}
34235},
34236compile_action_if: function(value) {
34237this.top("if (" + (this.format_expression(value)) + ") {");
34238this.bottom("}");
34239this.indent();
34240},
34241compile_action_elif: function(value) {
34242this.top("else if (" + (this.format_expression(value)) + ") {");
34243this.bottom("}");
34244this.indent();
34245},
34246compile_action_else: function(value) {
34247this.top("else {");
34248this.bottom("}");
34249this.indent();
34250},
34251compile_action_foreach: function(value) {
34252var as = this.actions['as'] || value.replace(/[^a-zA-Z0-9]/g, '_');
34253this.top("context.engine.tools.foreach(context, " + (this.format_expression(value)) + ", " + (this.engine.tools.js_escape(as)) + ", dict, function(context, dict) {");
34254this.bottom("});");
34255this.indent();
34256},
34257compile_action_call: function(value) {
34258if (this.children.length === 0) {
34259return this.top("r.push(context.engine.tools.call(context, " + (this.string_interpolation(value)) + ", dict));");
34260} else {
34261this.top("r.push(context.engine.tools.call(context, " + (this.string_interpolation(value)) + ", dict, null, function(context, dict) {");
34262this.bottom("}));");
34263this.indent();
34264this.top("var r = [];");
34265return this.bottom("return r.join('');");
34266}
34267},
34268compile_action_set: function(value) {
34269var variable = this.format_expression(value);
34270if (this.actions['value']) {
34271if (this.children.length) {
34272this.engine.tools.warning("@set with @value plus node chidren found. Children are ignored.");
34273}
34274this.top(variable + " = (" + (this.format_expression(this.actions['value'])) + ");");
34275this.process_children = false;
34276} else {
34277if (this.children.length === 0) {
34278this.top(variable + " = '';");
34279} else if (this.children.length === 1 && this.children[0].node.nodeType === 3) {
34280this.top(variable + " = " + (this.engine.tools.js_escape(this.children[0].node.data)) + ";");
34281this.process_children = false;
34282} else {
34283this.top(variable + " = (function(dict) {");
34284this.bottom("})(dict);");
34285this.indent();
34286this.top("var r = [];");
34287this.bottom("return r.join('');");
34288}
34289}
34290},
34291compile_action_esc: function(value) {
34292this.top("var t = " + this.format_str(value) + ";");
34293this.top("if (t != null) r.push(context.engine.tools.html_escape(t));");
34294this.top("else {");
34295this.bottom("}");
34296this.indent();
34297},
34298compile_action_raw: function(value) {
34299this.top("var t = " + this.format_str(value) + ";");
34300this.top("if (t != null) r.push(t);");
34301this.top("else {");
34302this.bottom("}");
34303this.indent();
34304},
34305compile_action_js: function(value) {
34306this.top("(function(" + value + ") {");
34307this.bottom("})(dict);");
34308this.indent();
34309var lines = this.engine.tools.xml_node_to_string(this.node, true).split(/\r?\n/);
34310for (var i = 0, ilen = lines.length; i < ilen; i++) {
34311this.top(lines[i]);
34312}
34313this.process_children = false;
34314},
34315compile_action_debug: function(value) {
34316this.top("debugger;");
34317},
34318compile_action_log: function(value) {
34319this.top("console.log(" + this.format_expression(value) + ");");
34320}
34321});
34322return Element;
34323}
34324)();
34325;
34326/* /web/static/src/js/boot.js defined in bundle 'web.assets_common' */
34327(function() {
34328"use strict";
34329var jobs = [];
34330var factories = Object.create(null);
34331var job_names = [];
34332var job_deps = [];
34333var job_deferred = [];
34334var services = Object.create({});
34335var commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg;
34336var cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g;
34337var debug = ($.deparam($.param.querystring()).debug !== undefined);
34338var odoo = window.odoo = window.odoo || {};
34339_.extend(odoo, {
34340testing: typeof QUnit === "object",
34341debug: debug,
34342remaining_jobs: jobs,
34343__DEBUG__: {
34344didLogInfo: $.Deferred(),
34345get_dependencies: function(name, transitive) {
34346var deps = name instanceof Array ? name : [name], changed;
34347do {
34348changed = false;
34349_.each(job_deps, function(dep) {
34350if (_.contains(deps, dep.to) && (!_.contains(deps, dep.from))) {
34351deps.push(dep.from);
34352changed = true;
34353}
34354});
34355} while (changed && transitive);return deps;
34356},
34357get_dependents: function(name) {
34358return _.pluck(_.where(job_deps, {
34359from: name
34360}), 'to');
34361},
34362get_waited_jobs: function() {
34363return _.uniq(_.map(jobs, function(job) {
34364return job.name;
34365}));
34366},
34367get_missing_jobs: function() {
34368var self = this;
34369var waited = this.get_waited_jobs();
34370var missing = [];
34371_.each(waited, function(job) {
34372_.each(self.get_dependencies(job), function(job) {
34373if (!(job in self.services)) {
34374missing.push(job);
34375}
34376});
34377});
34378return _.filter(_.difference(_.uniq(missing), waited), function(job) {
34379return !job.error;
34380});
34381},
34382get_failed_jobs: function() {
34383return _.filter(jobs, function(job) {
34384return !!job.error;
34385});
34386},
34387factories: factories,
34388services: services,
34389},
34390define: function() {
34391var args = Array.prototype.slice.call(arguments);
34392var name = typeof args[0] === 'string' ? args.shift() : _.uniqueId('__job');
34393var factory = args[args.length - 1];
34394var deps;
34395if (args[0]instanceof Array) {
34396deps = args[0];
34397} else {
34398deps = [];
34399factory.toString().replace(commentRegExp, '').replace(cjsRequireRegExp, function(match, dep) {
34400deps.push(dep);
34401});
34402}
34403if (odoo.debug) {
34404if (!(deps instanceof Array)) {
34405throw new Error('Dependencies should be defined by an array',deps);
34406}
34407if (typeof factory !== 'function') {
34408throw new Error('Factory should be defined by a function',factory);
34409}
34410if (typeof name !== 'string') {
34411throw new Error("Invalid name definition (should be a string",name);
34412}
34413if (name in factories) {
34414throw new Error("Service " + name + " already defined");
34415}
34416}
34417factory.deps = deps;
34418factories[name] = factory;
34419jobs.push({
34420name: name,
34421factory: factory,
34422deps: deps,
34423});
34424job_names.push(name);
34425_.each(deps, function(dep) {
34426job_deps.push({
34427from: dep,
34428to: name
34429});
34430});
34431this.process_jobs(jobs, services);
34432},
34433log: function() {
34434var missing = [];
34435var failed = [];
34436if (jobs.length) {
34437var debug_jobs = {};
34438var rejected = [];
34439var rejected_linked = [];
34440var job;
34441var jobdep;
34442for (var k = 0; k < jobs.length; k++) {
34443debug_jobs[jobs[k].name] = job = {
34444dependencies: jobs[k].deps,
34445dependents: odoo.__DEBUG__.get_dependents(jobs[k].name),
34446name: jobs[k].name
34447};
34448if (jobs[k].error) {
34449job.error = jobs[k].error;
34450}
34451if (jobs[k].rejected) {
34452job.rejected = jobs[k].rejected;
34453rejected.push(job.name);
34454}
34455var deps = odoo.__DEBUG__.get_dependencies(job.name);
34456for (var i = 0; i < deps.length; i++) {
34457if (job.name !== deps[i] && !(deps[i]in services)) {
34458jobdep = debug_jobs[deps[i]] || (deps[i]in factories && _.find(jobs, function(job) {
34459return job.name === deps[i];
34460}));
34461if (jobdep && jobdep.rejected) {
34462if (!job.rejected) {
34463job.rejected = [];
34464rejected_linked.push(job.name);
34465}
34466job.rejected.push(deps[i]);
34467} else {
34468if (!job.missing) {
34469job.missing = [];
34470}
34471job.missing.push(deps[i]);
34472}
34473}
34474}
34475}
34476missing = odoo.__DEBUG__.get_missing_jobs();
34477failed = odoo.__DEBUG__.get_failed_jobs();
34478var unloaded = _.filter(debug_jobs, function(job) {
34479return job.missing;
34480});
34481if (odoo.debug || !_.isEmpty(failed) || !_.isEmpty(unloaded)) {
34482/*
34483var log = console[_.isEmpty(failed) || _.isEmpty(unloaded) ? 'info' : 'error'].bind(console);
34484log((_.isEmpty(failed) ? (_.isEmpty(unloaded) ? 'info' : 'warning') : 'error') + ': Some modules could not be started');
34485if (missing.length) {
34486log('Missing dependencies:', missing);
34487}
34488if (!_.isEmpty(failed)) {
34489log('Failed modules:  ', _.pluck(failed, 'name'));
34490}
34491if (!_.isEmpty(rejected)) {
34492log('Rejected modules:', rejected);
34493}
34494if (!_.isEmpty(rejected_linked)) {
34495log('Rejected linked modules: ', rejected_linked);
34496}
34497if (!_.isEmpty(unloaded)) {
34498log('Non loaded modules:  ', _.pluck(unloaded, 'name'));
34499}
34500if (odoo.debug && !_.isEmpty(debug_jobs)) {
34501log('Debug:   ', debug_jobs);
34502}
34503*/
34504}
34505}
34506odoo.__DEBUG__.js_modules = {
34507missing: missing,
34508failed: _.pluck(failed, 'name'),
34509};
34510odoo.__DEBUG__.didLogInfo.resolve();
34511},
34512process_jobs: function(jobs, services) {
34513var job;
34514function process_job(job) {
34515var require = make_require(job);
34516var job_exec;
34517var def = $.Deferred();
34518try {
34519job_exec = job.factory.call(null, require);
34520jobs.splice(jobs.indexOf(job), 1);
34521job_deferred.push(def);
34522} catch (e) {
34523job.error = e;
34524}
34525if (!job.error) {
34526$.when(job_exec).then(function(data) {
34527services[job.name] = data;
34528def.resolve();
34529odoo.process_jobs(jobs, services);
34530}, function(e) {
34531job.rejected = e || true;
34532jobs.push(job);
34533def.resolve();
34534});
34535}
34536}
34537function is_ready(job) {
34538return !job.error && !job.rejected && _.every(job.factory.deps, function(name) {
34539return name in services;
34540});
34541}
34542function make_require(job) {
34543var deps = _.pick(services, job.deps);
34544function require(name) {
34545if (!(name in deps)) {
34546console.error('Undefined dependency: ', name);
34547} else {
34548require.__require_calls++;
34549}
34550return deps[name];
34551}
34552require.__require_calls = 0;
34553return require;
34554}
34555while (jobs.length && (job = _.find(jobs, is_ready))) {
34556process_job(job);
34557}
34558return services;
34559}
34560});
34561var log_when_loaded = function() {
34562_.delay(function() {
34563var len = job_deferred.length;
34564$.when.apply($, job_deferred).then(function() {
34565if (len === job_deferred.length) {
34566odoo.log();
34567} else {
34568log_when_loaded();
34569}
34570});
34571}, 6000);
34572};
34573$(log_when_loaded);
34574}
34575)();
34576;
34577/* /web/static/src/js/libs/autocomplete.js defined in bundle 'web.assets_common' */
34578odoo.define('web.autocomplete.extensions', function() {
34579'use strict';
34580var proto = $.ui.autocomplete.prototype;
34581var initSource = proto._initSource;
34582function filter(array, term) {
34583var matcher = new RegExp($.ui.autocomplete.escapeRegex(term),"i");
34584return $.grep(array, function(value_) {
34585return matcher.test($("<div>").html(value_.label || value_.value || value_).text());
34586});
34587}
34588$.extend(proto, {
34589_initSource: function() {
34590if (this.options.html && $.isArray(this.options.source)) {
34591this.source = function(request, response) {
34592response(filter(this.options.source, request.term));
34593}
34594;
34595} else {
34596initSource.call(this);
34597}
34598},
34599_renderItem: function(ul, item) {
34600return $("<li></li>").data("item.autocomplete", item).append($("<a></a>")[this.options.html ? "html" : "text"](item.label)).appendTo(ul).addClass(item.classname);
34601},
34602});
34603});
34604;
34605/* /web/static/src/js/libs/bootstrap.js defined in bundle 'web.assets_common' */
34606odoo.define('web.bootstrap.extensions', function() {
34607'use strict';
34608$.fn.tooltip.Constructor.Default.placement = 'auto';
34609$.fn.tooltip.Constructor.Default.fallbackPlacement = ['bottom', 'right', 'left', 'top'];
34610$.fn.tooltip.Constructor.Default.html = true;
34611$.fn.tooltip.Constructor.Default.trigger = 'hover';
34612$.fn.tooltip.Constructor.Default.container = 'body';
34613$.fn.tooltip.Constructor.Default.boundary = 'window';
34614$.fn.tooltip.Constructor.Default.delay = {
34615show: 1000,
34616hide: 0
34617};
34618var bootstrapShowFunction = $.fn.tooltip.Constructor.prototype.show;
34619$.fn.tooltip.Constructor.prototype.show = function() {
34620$('.tooltip').remove();
34621return bootstrapShowFunction.call(this);
34622}
34623;
34624});
34625;
34626/* /web/static/src/js/libs/jquery.js defined in bundle 'web.assets_common' */
34627odoo.define('web.jquery.extensions', function() {
34628'use strict';
34629$.extend($.expr[':'], {
34630containsLike: function(element, index, matches) {
34631return element.innerHTML.toUpperCase().indexOf(matches[3].toUpperCase()) >= 0;
34632},
34633containsTextLike: function(element, index, matches) {
34634return element.innerText.toUpperCase().indexOf(matches[3].toUpperCase()) >= 0;
34635},
34636containsExact: function(element, index, matches) {
34637return $.trim(element.innerHTML) === matches[3];
34638},
34639containsRegex: function(element, index, matches) {
34640var regreg = /^\/((?:\\\/|[^\/])+)\/([mig]{0,3})$/
34641  , reg = regreg.exec(matches[3]);
34642return reg ? new RegExp(reg[1],reg[2]).test($.trim(element.innerHTML)) : false;
34643},
34644propChecked: function(element, index, matches) {
34645return $(element).prop("checked") === true;
34646},
34647propSelected: function(element, index, matches) {
34648return $(element).prop("selected") === true;
34649},
34650propValue: function(element, index, matches) {
34651return $(element).prop("value") === matches[3];
34652},
34653propValueContains: function(element, index, matches) {
34654return $(element).prop("value") && $(element).prop("value").indexOf(matches[3]) !== -1;
34655},
34656hasData: function(element) {
34657return !!_.toArray(element.dataset).length;
34658},
34659data: function(element, index, matches) {
34660return $(element).data(matches[3]);
34661},
34662hasVisibility: function(element, index, matches) {
34663var $element = $(element);
34664if ($(element).css('visibility') === 'hidden') {
34665return false;
34666}
34667var $parent = $element.parent();
34668if (!$parent.length || $element.is('html')) {
34669return true;
34670}
34671return $parent.is(':hasVisibility');
34672},
34673hasOpacity: function(element, index, matches) {
34674var $element = $(element);
34675if (parseFloat($(element).css('opacity')) <= 0.01) {
34676return false;
34677}
34678var $parent = $element.parent();
34679if (!$parent.length || $element.is('html')) {
34680return true;
34681}
34682return $parent.is(':hasOpacity');
34683},
34684});
34685$.fn.extend({
34686getAttributes: function() {
34687var o = {};
34688if (this.length) {
34689var attrs = this[0].attributes;
34690for (var i = 0, l = attrs.length; i < l; i++) {
34691var attr = attrs.item(i);
34692o[attr.name] = attr.value;
34693}
34694}
34695return o;
34696},
34697odooBounce: function() {
34698return this.each(function() {
34699var $el = $(this);
34700$el.addClass('o_catch_attention');
34701setTimeout(function() {
34702$el.removeClass('o_catch_attention');
34703}, 400);
34704});
34705},
34706prependEvent: function(events, selector, data, handler) {
34707this.on.apply(this, arguments);
34708events = events.split(' ');
34709return this.each(function() {
34710var el = this;
34711_.each(events, function(evNameNamespaced) {
34712var evName = evNameNamespaced.split('.')[0];
34713var handler = $._data(el, 'events')[evName].pop();
34714$._data(el, 'events')[evName].unshift(handler);
34715});
34716});
34717},
34718});
34719});
34720;
34721/* /web/static/src/js/libs/download.js defined in bundle 'web.assets_common' */
34722odoo.define('web.download', function() {
34723return function download(data, filename, mimetype) {
34724var self = window, defaultMime = "application/octet-stream", mimeType = mimetype || defaultMime, payload = data, url = !filename && !mimetype && payload, anchor = document.createElement("a"), toString = function(a) {
34725return String(a);
34726}, myBlob = (self.Blob || self.MozBlob || self.WebKitBlob || toString), fileName = filename || "download", blob, reader;
34727myBlob = myBlob.call ? myBlob.bind(self) : Blob;
34728if (String(this) === "true") {
34729payload = [payload, mimeType];
34730mimeType = payload[0];
34731payload = payload[1];
34732}
34733if (url && url.length < 2048) {
34734fileName = url.split("/").pop().split("?")[0];
34735anchor.href = url;
34736if (anchor.href.indexOf(url) !== -1) {
34737var ajax = new XMLHttpRequest();
34738ajax.open("GET", url, true);
34739ajax.responseType = 'blob';
34740ajax.onload = function(e) {
34741download(e.target.response, fileName, defaultMime);
34742}
34743;
34744setTimeout(function() {
34745ajax.send();
34746}, 0);
34747return ajax;
34748}
34749}
34750if (/^data:[\w+\-]+\/[\w+\-]+[,;]/.test(payload)) {
34751if (payload.length > (1024 * 1024 * 1.999) && myBlob !== toString) {
34752payload = dataUrlToBlob(payload);
34753mimeType = payload.type || defaultMime;
34754} else {
34755return navigator.msSaveBlob ? navigator.msSaveBlob(dataUrlToBlob(payload), fileName) : saver(payload);
34756}
34757}
34758blob = payload instanceof myBlob ? payload : new myBlob([payload],{
34759type: mimeType
34760});
34761function dataUrlToBlob(strUrl) {
34762var parts = strUrl.split(/[:;,]/)
34763  , type = parts[1]
34764  , decoder = parts[2] === "base64" ? atob : decodeURIComponent
34765  , binData = decoder(parts.pop())
34766  , mx = binData.length
34767  , i = 0
34768  , uiArr = new Uint8Array(mx);
34769for (i; i < mx; ++i)
34770uiArr[i] = binData.charCodeAt(i);
34771return new myBlob([uiArr],{
34772type: type
34773});
34774}
34775function saver(url, winMode) {
34776if ('download'in anchor) {
34777anchor.href = url;
34778anchor.setAttribute("download", fileName);
34779anchor.className = "download-js-link";
34780anchor.innerHTML = "downloading...";
34781anchor.style.display = "none";
34782document.body.appendChild(anchor);
34783setTimeout(function() {
34784anchor.click();
34785document.body.removeChild(anchor);
34786if (winMode === true) {
34787setTimeout(function() {
34788self.URL.revokeObjectURL(anchor.href);
34789}, 250);
34790}
34791}, 66);
34792return true;
34793}
34794if (/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent)) {
34795url = url.replace(/^data:([\w\/\-+]+)/, defaultMime);
34796if (!window.open(url)) {
34797if (confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")) {
34798location.href = url;
34799}
34800}
34801return true;
34802}
34803var f = document.createElement("iframe");
34804document.body.appendChild(f);
34805if (!winMode) {
34806url = "data:" + url.replace(/^data:([\w\/\-+]+)/, defaultMime);
34807}
34808f.src = url;
34809setTimeout(function() {
34810document.body.removeChild(f);
34811}, 333);
34812}
34813if (navigator.msSaveBlob) {
34814return navigator.msSaveBlob(blob, fileName);
34815}
34816if (self.URL) {
34817saver(self.URL.createObjectURL(blob), true);
34818} else {
34819if (typeof blob === "string" || blob.constructor === toString) {
34820try {
34821return saver("data:" + mimeType + ";base64," + self.btoa(blob));
34822} catch (y) {
34823return saver("data:" + mimeType + "," + encodeURIComponent(blob));
34824}
34825}
34826reader = new FileReader();
34827reader.onload = function() {
34828saver(this.result);
34829}
34830;
34831reader.readAsDataURL(blob);
34832}
34833return true;
34834}
34835;
34836});
34837;
34838/* /web/static/src/js/libs/content-disposition.js defined in bundle 'web.assets_common' */
34839odoo.define('web.contentdisposition', function() {
34840'use strict';
34841var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g;
34842var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g;
34843var QESC_REGEXP = /\\([\u0000-\u007f])/g;
34844var PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g;
34845var EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/;
34846var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/;
34847function decodefield(str) {
34848var match = EXT_VALUE_REGEXP.exec(str);
34849if (!match) {
34850throw new TypeError('invalid extended field value')
34851}
34852var charset = match[1].toLowerCase();
34853var encoded = match[2];
34854switch (charset) {
34855case 'iso-8859-1':
34856return encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode).replace(NON_LATIN1_REGEXP, '?');
34857case 'utf-8':
34858return decodeURIComponent(encoded);
34859default:
34860throw new TypeError('unsupported charset in extended field')
34861}
34862}
34863function parse(string) {
34864if (!string || typeof string !== 'string') {
34865throw new TypeError('argument string is required')
34866}
34867var match = DISPOSITION_TYPE_REGEXP.exec(string);
34868if (!match) {
34869throw new TypeError('invalid type format')
34870}
34871var index = match[0].length;
34872var type = match[1].toLowerCase();
34873var key;
34874var names = [];
34875var params = {};
34876var value;
34877index = PARAM_REGEXP.lastIndex = match[0].substr(-1) === ';' ? index - 1 : index;
34878while ((match = PARAM_REGEXP.exec(string))) {
34879if (match.index !== index) {
34880throw new TypeError('invalid parameter format')
34881}
34882index += match[0].length;
34883key = match[1].toLowerCase();
34884value = match[2];
34885if (names.indexOf(key) !== -1) {
34886throw new TypeError('invalid duplicate parameter')
34887}
34888names.push(key);
34889if (key.indexOf('*') + 1 === key.length) {
34890key = key.slice(0, -1);
34891value = decodefield(value);
34892params[key] = value;
34893continue
34894}
34895if (typeof params[key] === 'string') {
34896continue
34897}
34898if (value[0] === '"') {
34899value = value.substr(1, value.length - 2).replace(QESC_REGEXP, '$1')
34900}
34901params[key] = value
34902}
34903if (index !== -1 && index !== string.length) {
34904throw new TypeError('invalid parameter format')
34905}
34906return new ContentDisposition(type,params)
34907}
34908function pdecode(str, hex) {
34909return String.fromCharCode(parseInt(hex, 16))
34910}
34911function ContentDisposition(type, parameters) {
34912this.type = type;
34913this.parameters = parameters
34914}
34915return {
34916parse: parse,
34917};
34918});
34919;
34920/* /web/static/src/js/libs/underscore.js defined in bundle 'web.assets_common' */
34921_.cancellableThrottleRemoveMeSoon = function(func, wait, options) {
34922var timeout, context, args, result;
34923var previous = 0;
34924if (!options)
34925options = {};
34926var later = function() {
34927previous = options.leading === false ? 0 : _.now();
34928timeout = null;
34929result = func.apply(context, args);
34930if (!timeout)
34931context = args = null;
34932};
34933var throttled = function() {
34934var now = _.now();
34935if (!previous && options.leading === false)
34936previous = now;
34937var remaining = wait - (now - previous);
34938context = this;
34939args = arguments;
34940if (remaining <= 0 || remaining > wait) {
34941if (timeout) {
34942clearTimeout(timeout);
34943timeout = null;
34944}
34945previous = now;
34946result = func.apply(context, args);
34947if (!timeout)
34948context = args = null;
34949} else if (!timeout && options.trailing !== false) {
34950timeout = setTimeout(later, remaining);
34951}
34952return result;
34953};
34954throttled.cancel = function() {
34955clearTimeout(timeout);
34956previous = 0;
34957timeout = context = args = null;
34958}
34959;
34960return throttled;
34961}
34962;
34963;
34964/* /web/static/src/js/services/config.js defined in bundle 'web.assets_common' */
34965odoo.define('web.config', function() {
34966"use strict";
34967var debugParam = $.deparam($.param.querystring()).debug;
34968var debug = false;
34969if (debugParam !== undefined) {
34970debug = debugParam === 'assets' ? 'assets' : true;
34971}
34972var config = {
34973debug: debug,
34974device: {
34975touch: 'ontouchstart'in window || 'onmsgesturechange'in window,
34976size_class: null,
34977isMobile: null,
34978SIZES: {
34979XS: 0,
34980VSM: 1,
34981SM: 2,
34982MD: 3,
34983LG: 4,
34984XL: 5,
34985XXL: 6
34986},
34987},
34988};
34989var medias = [window.matchMedia('(max-width: 474px)'), window.matchMedia('(min-width: 475px) and (max-width: 575px)'), window.matchMedia('(min-width: 576px) and (max-width: 767px)'), window.matchMedia('(min-width: 768px) and (max-width: 991px)'), window.matchMedia('(min-width: 992px) and (max-width: 1199px)'), window.matchMedia('(min-width: 1200px) and (max-width: 1533px)'), window.matchMedia('(min-width: 1534px)'), ];
34990function _getSizeClass() {
34991for (var i = 0; i < medias.length; i++) {
34992if (medias[i].matches) {
34993return i;
34994}
34995}
34996}
34997function _updateSizeProps() {
34998var sc = _getSizeClass();
34999if (sc !== config.device.size_class) {
35000config.device.size_class = sc;
35001config.device.isMobile = config.device.size_class <= config.device.SIZES.SM;
35002}
35003}
35004_.invoke(medias, 'addListener', _updateSizeProps);
35005_updateSizeProps();
35006return config;
35007});
35008;
35009/* /web/static/src/js/core/abstract_service.js defined in bundle 'web.assets_common' */
35010odoo.define('web.AbstractService', function(require) {
35011"use strict";
35012var Class = require('web.Class');
35013var Mixins = require('web.mixins');
35014var ServicesMixin = require('web.ServicesMixin');
35015var AbstractService = Class.extend(Mixins.EventDispatcherMixin, ServicesMixin, {
35016dependencies: [],
35017init: function(parent) {
35018Mixins.EventDispatcherMixin.init.call(this, arguments);
35019this.setParent(parent);
35020},
35021start: function() {},
35022});
35023return AbstractService;
35024});
35025;
35026/* /web/static/src/js/core/abstract_storage_service.js defined in bundle 'web.assets_common' */
35027odoo.define('web.AbstractStorageService', function(require) {
35028'use strict';
35029var AbstractService = require('web.AbstractService');
35030var AbstractStorageService = AbstractService.extend({
35031storage: null,
35032destroy: function() {
35033if ((this.storage || {}).destroy) {
35034this.storage.destroy();
35035}
35036this._super.apply(this, arguments);
35037},
35038clear: function() {
35039this.storage.clear();
35040},
35041getItem: function(key, defaultValue) {
35042var val = this.storage.getItem(key);
35043return val ? JSON.parse(val) : defaultValue;
35044},
35045removeItem: function(key) {
35046this.storage.removeItem(key);
35047},
35048setItem: function(key, value) {
35049this.storage.setItem(key, JSON.stringify(value));
35050},
35051onStorage: function() {
35052this.storage.on.apply(this.storage, ["storage"].concat(Array.prototype.slice.call(arguments)));
35053},
35054});
35055return AbstractStorageService;
35056});
35057;
35058/* /web/static/src/js/core/class.js defined in bundle 'web.assets_common' */
35059odoo.define('web.Class', function() {
35060"use strict";
35061function OdooClass() {}
35062var initializing = false;
35063var fnTest = /xyz/.test(function() {
35064xyz();
35065}) ? /\b_super\b/ : /.*/;
35066OdooClass.extend = function() {
35067var _super = this.prototype;
35068var args = _.toArray(arguments);
35069args.unshift({});
35070var prop = _.extend.apply(_, args);
35071initializing = true;
35072var This = this;
35073var prototype = new This();
35074initializing = false;
35075_.each(prop, function(val, name) {
35076prototype[name] = typeof prop[name] == "function" && fnTest.test(prop[name]) ? (function(name, fn) {
35077return function() {
35078var tmp = this._super;
35079this._super = _super[name];
35080var ret = fn.apply(this, arguments);
35081this._super = tmp;
35082return ret;
35083}
35084;
35085}
35086)(name, prop[name]) : prop[name];
35087});
35088function Class() {
35089if (this.constructor !== OdooClass) {
35090throw new Error("You can only instanciate objects with the 'new' operator");
35091}
35092this._super = null;
35093if (!initializing && this.init) {
35094var ret = this.init.apply(this, arguments);
35095if (ret) {
35096return ret;
35097}
35098}
35099return this;
35100}
35101Class.include = function(properties) {
35102_.each(properties, function(val, name) {
35103if (typeof properties[name] !== 'function' || !fnTest.test(properties[name])) {
35104prototype[name] = properties[name];
35105} else if (typeof prototype[name] === 'function' && prototype.hasOwnProperty(name)) {
35106prototype[name] = (function(name, fn, previous) {
35107return function() {
35108var tmp = this._super;
35109this._super = previous;
35110var ret = fn.apply(this, arguments);
35111this._super = tmp;
35112return ret;
35113}
35114;
35115}
35116)(name, properties[name], prototype[name]);
35117} else if (typeof _super[name] === 'function') {
35118prototype[name] = (function(name, fn) {
35119return function() {
35120var tmp = this._super;
35121this._super = _super[name];
35122var ret = fn.apply(this, arguments);
35123this._super = tmp;
35124return ret;
35125}
35126;
35127}
35128)(name, properties[name]);
35129}
35130});
35131}
35132;
35133Class.prototype = prototype;
35134Class.constructor = Class;
35135Class.extend = this.extend;
35136return Class;
35137}
35138;
35139return OdooClass;
35140});
35141;
35142/* /web/static/src/js/core/collections.js defined in bundle 'web.assets_common' */
35143odoo.define("web.collections", function(require) {
35144"use strict";
35145var Class = require("web.Class");
35146var Tree = Class.extend({
35147init: function(data) {
35148this._data = data;
35149this._children = [];
35150},
35151getData: function() {
35152return this._data;
35153},
35154addChild: function(tree) {
35155this._children.push(tree);
35156},
35157});
35158return {
35159Tree: Tree,
35160};
35161});
35162;
35163/* /web/static/src/js/core/translation.js defined in bundle 'web.assets_common' */
35164odoo.define('web.translation', function(require) {
35165"use strict";
35166var Class = require('web.Class');
35167var TranslationDataBase = Class.extend({
35168init: function() {
35169this.db = {};
35170this.multi_lang = false
35171this.parameters = {
35172"direction": 'ltr',
35173"date_format": '%m/%d/%Y',
35174"time_format": '%H:%M:%S',
35175"grouping": [],
35176"decimal_point": ".",
35177"thousands_sep": ","
35178};
35179},
35180set_bundle: function(translation_bundle) {
35181var self = this;
35182this.multi_lang = translation_bundle.multi_lang
35183var modules = _.keys(translation_bundle.modules);
35184modules.sort();
35185if (_.include(modules, "web")) {
35186modules = ["web"].concat(_.without(modules, "web"));
35187}
35188_.each(modules, function(name) {
35189self.add_module_translation(translation_bundle.modules[name]);
35190});
35191if (translation_bundle.lang_parameters) {
35192this.parameters = translation_bundle.lang_parameters;
35193this.parameters.grouping = JSON.parse(this.parameters.grouping);
35194}
35195},
35196add_module_translation: function(mod) {
35197var self = this;
35198_.each(mod.messages, function(message) {
35199self.db[message.id] = message.string;
35200});
35201},
35202build_translation_function: function() {
35203var self = this;
35204var fcnt = function(str) {
35205var tmp = self.get(str);
35206return tmp === undefined ? str : tmp;
35207};
35208fcnt.database = this;
35209return fcnt;
35210},
35211get: function(key) {
35212return this.db[key];
35213},
35214load_translations: function(session, modules, lang, url) {
35215var self = this;
35216return session.rpc(url || '/web/webclient/translations', {
35217"mods": modules || null,
35218"lang": lang || null
35219}).done(function(trans) {
35220self.set_bundle(trans);
35221});
35222}
35223});
35224var _t = new TranslationDataBase().build_translation_function();
35225var _lt = function(s) {
35226return {
35227toString: function() {
35228return _t(s);
35229}
35230};
35231};
35232{
35233_t('less than a minute ago');
35234_t('about a minute ago');
35235_t('%d minutes ago');
35236_t('about an hour ago');
35237_t('%d hours ago');
35238_t('a day ago');
35239_t('%d days ago');
35240_t('about a month ago');
35241_t('%d months ago');
35242_t('about a year ago');
35243_t('%d years ago');
35244}
35245return {
35246_t: _t,
35247_lt: _lt,
35248TranslationDataBase: TranslationDataBase,
35249};
35250});
35251;
35252/**/
35253/* /web/static/src/js/core/ajax.js defined in bundle 'web.assets_common' */
35254odoo.define('web.ajax', function(require) {
35255"use strict";
35256var core = require('web.core');
35257var utils = require('web.utils');
35258var time = require('web.time');
35259var download = require('web.download');
35260var contentdisposition = require('web.contentdisposition');
35261var _t = core._t;
35262function genericJsonRpc(fct_name, params, settings, fct) {
35263var shadow = settings.shadow || false;
35264delete settings.shadow;
35265if (!shadow) {
35266core.bus.trigger('rpc_request');
35267}
35268var deferred = $.Deferred();
35269var data = {
35270jsonrpc: "2.0",
35271method: fct_name,
35272params: params,
35273id: Math.floor(Math.random() * 1000 * 1000 * 1000)
35274};
35275var xhr = fct(data);
35276var result = xhr.pipe(function(result) {
35277core.bus.trigger('rpc:result', data, result);
35278if (result.error !== undefined) {
35279if (result.error.data.arguments[0] !== "bus.Bus not available in test mode") {
35280var func = console.error;
35281if (result.error.data.exception_type === "user_error") {
35282func = console.log;
35283}
35284
35285}
35286return $.Deferred().reject("server", result.error);
35287} else {
35288return result.result;
35289}
35290}, function() {
35291var def = $.Deferred();
35292return def.reject.apply(def, ["communication"].concat(_.toArray(arguments)));
35293});
35294deferred.abort = function() {
35295deferred.reject({
35296message: "XmlHttpRequestError abort"
35297}, $.Event('abort'));
35298if (xhr.abort) {
35299xhr.abort();
35300}
35301}
35302;
35303result.then(function(result) {
35304if (!shadow) {
35305core.bus.trigger('rpc_response');
35306}
35307deferred.resolve(result);
35308}, function(type, error, textStatus, errorThrown) {
35309if (type === "server") {
35310if (!shadow) {
35311core.bus.trigger('rpc_response');
35312}
35313if (error.code === 100) {
35314core.bus.trigger('invalidate_session');
35315}
35316deferred.reject(error, $.Event());
35317} else {
35318if (!shadow) {
35319core.bus.trigger('rpc_response_failed');
35320}
35321var nerror = {
35322code: -32098,
35323message: "XmlHttpRequestError " + errorThrown,
35324data: {
35325type: "xhr" + textStatus,
35326debug: error.responseText,
35327objects: [error, errorThrown]
35328},
35329};
35330deferred.reject(nerror, $.Event());
35331}
35332});
35333deferred.fail(function() {
35334deferred.fail(function(error, event) {
35335if (!event.isDefaultPrevented()) {
35336core.bus.trigger('rpc_error', error, event);
35337}
35338});
35339});
35340return deferred;
35341}
35342function jsonRpc(url, fct_name, params, settings) {
35343settings = settings || {};
35344return genericJsonRpc(fct_name, params, settings, function(data) {
35345return $.ajax(url, _.extend({}, settings, {
35346url: url,
35347dataType: 'json',
35348type: 'POST',
35349data: JSON.stringify(data, time.date_to_utc),
35350contentType: 'application/json'
35351}));
35352});
35353}
35354function jsonpRpc(url, fct_name, params, settings) {
35355settings = settings || {};
35356return genericJsonRpc(fct_name, params, settings, function(data) {
35357var payload_str = JSON.stringify(data, time.date_to_utc);
35358var payload_url = $.param({
35359r: payload_str
35360});
35361var force2step = settings.force2step || false;
35362delete settings.force2step;
35363var session_id = settings.session_id || null;
35364delete settings.session_id;
35365if (payload_url.length < 2000 && !force2step) {
35366return $.ajax(url, _.extend({}, settings, {
35367url: url,
35368dataType: 'jsonp',
35369jsonp: 'jsonp',
35370type: 'GET',
35371cache: false,
35372data: {
35373r: payload_str,
35374session_id: session_id
35375}
35376}));
35377} else {
35378var args = {
35379session_id: session_id,
35380id: data.id
35381};
35382var ifid = _.uniqueId('oe_rpc_iframe');
35383var html = "<iframe src='javascript:false;' name='" + ifid + "' id='" + ifid + "' style='display:none'></iframe>";
35384var $iframe = $(html);
35385var nurl = 'jsonp=1&' + $.param(args);
35386nurl = url.indexOf("?") !== -1 ? url + "&" + nurl : url + "?" + nurl;
35387var $form = $('<form>').attr('method', 'POST').attr('target', ifid).attr('enctype', "multipart/form-data").attr('action', nurl).append($('<input type="hidden" name="r" />').attr('value', payload_str)).hide().appendTo($('body'));
35388var cleanUp = function() {
35389if ($iframe) {
35390$iframe.unbind("load").remove();
35391}
35392$form.remove();
35393};
35394var deferred = $.Deferred();
35395$iframe.bind('load', function() {
35396$iframe.unbind('load').bind('load', function() {
35397$.ajax({
35398url: url,
35399dataType: 'jsonp',
35400jsonp: 'jsonp',
35401type: 'GET',
35402cache: false,
35403data: {
35404session_id: session_id,
35405id: data.id
35406}
35407}).always(function() {
35408cleanUp();
35409}).done(function() {
35410deferred.resolve.apply(deferred, arguments);
35411}).fail(function() {
35412deferred.reject.apply(deferred, arguments);
35413});
35414});
35415$form.submit();
35416});
35417$form.after($iframe);
35418if (settings.timeout) {
35419realSetTimeout(function() {
35420deferred.reject({});
35421}, settings.timeout);
35422}
35423return deferred;
35424}
35425});
35426}
35427function rpc(url, params, settings) {
35428return jsonRpc(url, 'call', params, settings);
35429}
35430function realSetTimeout(fct, millis) {
35431var finished = new Date().getTime() + millis;
35432var wait = function() {
35433var current = new Date().getTime();
35434if (current < finished) {
35435setTimeout(wait, finished - current);
35436} else {
35437fct();
35438}
35439};
35440setTimeout(wait, millis);
35441}
35442var loadCSS = (function() {
35443var urlDefs = Object.create(null);
35444return function loadCSS(url) {
35445if (url in urlDefs) {} else if ($('link[href="' + url + '"]').length) {
35446urlDefs[url] = $.when();
35447} else {
35448var $link = $('<link>', {
35449'href': url,
35450'rel': 'stylesheet',
35451'type': 'text/css'
35452});
35453urlDefs[url] = $.Deferred();
35454$link.on('load', function() {
35455urlDefs[url].resolve();
35456});
35457$('head').append($link);
35458}
35459return urlDefs[url];
35460}
35461;
35462}
35463)();
35464var loadJS = (function() {
35465var urls = [];
35466var defs = [];
35467var load = function loadJS(url) {
35468var alreadyRequired = ($('script[src="' + url + '"]').length > 0);
35469var index = _.indexOf(urls, url);
35470if (index < 0) {
35471urls.push(url);
35472index = defs.push(alreadyRequired ? $.when() : $.Deferred()) - 1;
35473}
35474var def = defs[index];
35475if (!alreadyRequired) {
35476var script = document.createElement('script');
35477script.type = 'text/javascript';
35478script.src = url;
35479script.onload = script.onreadystatechange = function() {
35480if ((script.readyState && script.readyState !== "loaded" && script.readyState !== "complete") || script.onload_done) {
35481return;
35482}
35483script.onload_done = true;
35484def.resolve(url);
35485}
35486;
35487script.onerror = function() {
35488//console.error("Error loading file", script.src);
35489def.reject(url);
35490}
35491;
35492var head = document.head || document.getElementsByTagName('head')[0];
35493//head.appendChild(script);
35494}
35495return def;
35496};
35497return load;
35498}
35499)();
35500function get_file(options) {
35501var xhr = new XMLHttpRequest();
35502var data;
35503if (options.form) {
35504xhr.open(options.form.method, options.form.action);
35505data = new FormData(options.form);
35506} else {
35507xhr.open('POST', options.url);
35508data = new FormData();
35509_.each(options.data || {}, function(v, k) {
35510data.append(k, v)
35511});
35512}
35513data.append('token', 'dummy-because-api-expects-one');
35514if (core.csrf_token) {
35515data.append('csrf_token', core.csrf_token);
35516}
35517xhr.responseType = 'blob';
35518xhr.onload = function() {
35519var mimetype = xhr.response.type;
35520if (xhr.status === 200 && mimetype !== 'text/html') {
35521var header = (xhr.getResponseHeader('Content-Disposition') || '').replace(/;$/, '');
35522var filename = header ? contentdisposition.parse(header).parameters.filename : null;
35523download(xhr.response, filename, mimetype);
35524if (options.success) {
35525options.success();
35526}
35527return true;
35528}
35529if (!options.error) {
35530return true;
35531}
35532var decoder = new FileReader();
35533decoder.onload = function() {
35534var contents = decoder.result;
35535var err;
35536var doc = new DOMParser().parseFromString(contents, 'text/html');
35537var nodes = doc.body.children.length === 0 ? doc.body.childNodes : doc.body.children;
35538try {
35539var node = nodes[1] || nodes[0];
35540err = JSON.parse(node.textContent);
35541} catch (e) {
35542err = {
35543message: nodes.length > 1 ? nodes[1].textContent : '',
35544data: {
35545name: String(xhr.status),
35546title: nodes.length > 0 ? nodes[0].textContent : '',
35547}
35548}
35549}
35550options.error(err);
35551}
35552;
35553decoder.readAsText(xhr.response);
35554}
35555;
35556xhr.onerror = function() {
35557if (options.error) {
35558options.error({
35559message: _("Something happened while trying to contact the server, check that the server is online and that you still have a working network connection."),
35560data: {
35561title: _t("Could not connect to the server")
35562}
35563});
35564}
35565}
35566;
35567if (options.complete) {
35568xhr.onloadend = function() {
35569options.complete();
35570}
35571}
35572xhr.send(data);
35573return true;
35574}
35575function post(controller_url, data) {
35576var progressHandler = function(deferred) {
35577return function(state) {
35578if (state.lengthComputable) {
35579deferred.notify({
35580h_loaded: utils.human_size(state.loaded),
35581h_total: utils.human_size(state.total),
35582loaded: state.loaded,
35583total: state.total,
35584pcent: Math.round((state.loaded / state.total) * 100)
35585});
35586}
35587}
35588;
35589};
35590var Def = $.Deferred();
35591var postData = new FormData();
35592$.each(data, function(i, val) {
35593postData.append(i, val);
35594});
35595if (core.csrf_token) {
35596postData.append('csrf_token', core.csrf_token);
35597}
35598var xhr = new XMLHttpRequest();
35599if (xhr.upload)
35600xhr.upload.addEventListener('progress', progressHandler(Def), false);
35601var ajaxDef = $.ajax(controller_url, {
35602xhr: function() {
35603return xhr;
35604},
35605data: postData,
35606processData: false,
35607contentType: false,
35608type: 'POST'
35609}).then(function(data) {
35610Def.resolve(data);
35611}).fail(function(data) {
35612Def.reject(data);
35613});
35614return Def;
35615}
35616var loadXML = (function() {
35617var isLoading = false;
35618var loadingsData = [];
35619var allLoadingsDef = $.when();
35620var seenURLs = [];
35621return function(url, qweb) {
35622if (!url || !qweb) {
35623return allLoadingsDef;
35624}
35625if (_.contains(seenURLs, url)) {
35626var oldLoadingData = _.findWhere(loadingsData, {
35627url: url
35628});
35629return oldLoadingData ? oldLoadingData.def : $.when();
35630}
35631seenURLs.push(url);
35632var newLoadingData = {
35633url: url,
35634qweb: qweb,
35635def: $.Deferred(),
35636};
35637loadingsData.push(newLoadingData);
35638if (!isLoading) {
35639allLoadingsDef = $.Deferred();
35640_load();
35641}
35642return newLoadingData.def;
35643function _load() {
35644isLoading = true;
35645if (loadingsData.length) {
35646var loadingData = loadingsData[0];
35647loadingData.qweb.add_template(loadingData.url, function() {
35648loadingsData.shift();
35649loadingData.def.resolve();
35650_load();
35651});
35652} else {
35653isLoading = false;
35654allLoadingsDef.resolve();
35655}
35656}
35657}
35658;
35659}
35660)();
35661function loadLibs(libs) {
35662var defs = [];
35663_.each(libs.jsLibs || [], function(urls) {
35664defs.push($.when.apply($, defs).then(function() {
35665if (typeof (urls) === 'string') {
35666return ajax.loadJS(urls);
35667} else {
35668return $.when.apply($, _.map(urls, function(url) {
35669return ajax.loadJS(url);
35670}));
35671}
35672}));
35673});
35674_.each(libs.cssLibs || [], function(url) {
35675defs.push(ajax.loadCSS(url));
35676});
35677return $.when.apply($, defs);
35678}
35679var ajax = {
35680jsonRpc: jsonRpc,
35681jsonpRpc: jsonpRpc,
35682rpc: rpc,
35683loadCSS: loadCSS,
35684loadJS: loadJS,
35685loadXML: loadXML,
35686loadLibs: loadLibs,
35687get_file: get_file,
35688post: post,
35689};
35690return ajax;
35691});
35692;
35693/* /web/static/src/js/services/ajax_service.js defined in bundle 'web.assets_common' */
35694odoo.define('web.AjaxService', function(require) {
35695"use strict";
35696var AbstractService = require('web.AbstractService');
35697var core = require('web.core');
35698var session = require('web.session');
35699var AjaxService = AbstractService.extend({
35700rpc: function(route, args, options, target) {
35701var def = $.Deferred();
35702var promise = def.promise();
35703var xhrDef = session.rpc(route, args, options);
35704promise.abort = xhrDef.abort.bind(xhrDef);
35705xhrDef.then(function() {
35706if (!target.isDestroyed()) {
35707def.resolve.apply(def, arguments);
35708}
35709}).fail(function() {
35710if (!target.isDestroyed()) {
35711def.reject.apply(def, arguments);
35712}
35713});
35714return promise;
35715},
35716});
35717core.serviceRegistry.add('ajax', AjaxService);
35718return AjaxService;
35719});
35720;
35721/* /web/static/src/js/core/time.js defined in bundle 'web.assets_common' */
35722odoo.define('web.time', function(require) {
35723"use strict";
35724var translation = require('web.translation');
35725var utils = require('web.utils');
35726var lpad = utils.lpad;
35727var rpad = utils.rpad;
35728var _t = translation._t;
35729function date_to_utc(k, v) {
35730var value = this[k];
35731if (!(value instanceof Date)) {
35732return v;
35733}
35734return datetime_to_str(value);
35735}
35736function str_to_datetime(str) {
35737if (!str) {
35738return str;
35739}
35740var regex = /^(\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d(?:\.(\d+))?)$/;
35741var res = regex.exec(str);
35742if (!res) {
35743throw new Error("'" + str + "' is not a valid datetime");
35744}
35745var tmp = new Date(2000,0,1);
35746tmp.setUTCMonth(1970);
35747tmp.setUTCMonth(0);
35748tmp.setUTCDate(1);
35749tmp.setUTCFullYear(parseFloat(res[1]));
35750tmp.setUTCMonth(parseFloat(res[2]) - 1);
35751tmp.setUTCDate(parseFloat(res[3]));
35752tmp.setUTCHours(parseFloat(res[4]));
35753tmp.setUTCMinutes(parseFloat(res[5]));
35754tmp.setUTCSeconds(parseFloat(res[6]));
35755tmp.setUTCSeconds(parseFloat(res[6]));
35756tmp.setUTCMilliseconds(parseFloat(utils.rpad((res[7] || "").slice(0, 3), 3)));
35757return tmp;
35758}
35759function str_to_date(str) {
35760if (!str) {
35761return str;
35762}
35763var regex = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
35764var res = regex.exec(str);
35765if (!res) {
35766throw new Error("'" + str + "' is not a valid date");
35767}
35768var tmp = new Date(2000,0,1);
35769tmp.setFullYear(parseFloat(res[1]));
35770tmp.setMonth(parseFloat(res[2]) - 1);
35771tmp.setDate(parseFloat(res[3]));
35772tmp.setHours(0);
35773tmp.setMinutes(0);
35774tmp.setSeconds(0);
35775return tmp;
35776}
35777function str_to_time(str) {
35778if (!str) {
35779return str;
35780}
35781var regex = /^(\d\d):(\d\d):(\d\d(?:\.(\d+))?)$/;
35782var res = regex.exec(str);
35783if (!res) {
35784throw new Error("'" + str + "' is not a valid time");
35785}
35786var tmp = new Date();
35787tmp.setFullYear(1970);
35788tmp.setMonth(0);
35789tmp.setDate(1);
35790tmp.setHours(parseFloat(res[1]));
35791tmp.setMinutes(parseFloat(res[2]));
35792tmp.setSeconds(parseFloat(res[3]));
35793tmp.setMilliseconds(parseFloat(rpad((res[4] || "").slice(0, 3), 3)));
35794return tmp;
35795}
35796function datetime_to_str(obj) {
35797if (!obj) {
35798return false;
35799}
35800return lpad(obj.getUTCFullYear(), 4) + "-" + lpad(obj.getUTCMonth() + 1, 2) + "-" + lpad(obj.getUTCDate(), 2) + " " + lpad(obj.getUTCHours(), 2) + ":" + lpad(obj.getUTCMinutes(), 2) + ":" + lpad(obj.getUTCSeconds(), 2);
35801}
35802function date_to_str(obj) {
35803if (!obj) {
35804return false;
35805}
35806return lpad(obj.getFullYear(), 4) + "-" + lpad(obj.getMonth() + 1, 2) + "-" + lpad(obj.getDate(), 2);
35807}
35808function time_to_str(obj) {
35809if (!obj) {
35810return false;
35811}
35812return lpad(obj.getHours(), 2) + ":" + lpad(obj.getMinutes(), 2) + ":" + lpad(obj.getSeconds(), 2);
35813}
35814function auto_str_to_date(value) {
35815try {
35816return str_to_datetime(value);
35817} catch (e) {}
35818try {
35819return str_to_date(value);
35820} catch (e) {}
35821try {
35822return str_to_time(value);
35823} catch (e) {}
35824throw new Error(_.str.sprintf(_t("'%s' is not a correct date, datetime nor time"), value));
35825}
35826function auto_date_to_str(value, type) {
35827switch (type) {
35828case 'datetime':
35829return datetime_to_str(value);
35830case 'date':
35831return date_to_str(value);
35832case 'time':
35833return time_to_str(value);
35834default:
35835throw new Error(_.str.sprintf(_t("'%s' is not convertible to date, datetime nor time"), type));
35836}
35837}
35838function strftime_to_moment_format(value) {
35839if (_normalize_format_cache[value] === undefined) {
35840var isletter = /[a-zA-Z]/
35841  , output = []
35842  , inToken = false;
35843for (var index = 0; index < value.length; ++index) {
35844var character = value[index];
35845if (character === '%' && !inToken) {
35846inToken = true;
35847continue;
35848}
35849if (isletter.test(character)) {
35850if (inToken && normalize_format_table[character] !== undefined) {
35851character = normalize_format_table[character];
35852} else {
35853character = '[' + character + ']';
35854}
35855}
35856output.push(character);
35857inToken = false;
35858}
35859_normalize_format_cache[value] = output.join('');
35860}
35861return _normalize_format_cache[value];
35862}
35863function moment_to_strftime_format(value) {
35864var regex = /(MMMM|DDDD|dddd|YYYY|MMM|ddd|mm|ss|ww|WW|MM|YY|hh|HH|DD|A|d)/g;
35865return value.replace(regex, function(val) {
35866return '%' + inverse_normalize_format_table[val];
35867});
35868}
35869var _normalize_format_cache = {};
35870var normalize_format_table = {
35871'a': 'ddd',
35872'A': 'dddd',
35873'b': 'MMM',
35874'B': 'MMMM',
35875'd': 'DD',
35876'H': 'HH',
35877'I': 'hh',
35878'j': 'DDDD',
35879'm': 'MM',
35880'M': 'mm',
35881'p': 'A',
35882'S': 'ss',
35883'U': 'ww',
35884'W': 'WW',
35885'w': 'd',
35886'y': 'YY',
35887'Y': 'YYYY',
35888'c': 'ddd MMM D HH:mm:ss YYYY',
35889'x': 'MM/DD/YY',
35890'X': 'HH:mm:ss'
35891};
35892var inverse_normalize_format_table = _.invert(normalize_format_table);
35893function getLangDateFormat() {
35894return this.strftime_to_moment_format(_t.database.parameters.date_format);
35895}
35896function getLangTimeFormat() {
35897return this.strftime_to_moment_format(_t.database.parameters.time_format);
35898}
35899function getLangDatetimeFormat() {
35900return this.strftime_to_moment_format(_t.database.parameters.date_format + " " + _t.database.parameters.time_format);
35901}
35902return {
35903date_to_utc: date_to_utc,
35904str_to_datetime: str_to_datetime,
35905str_to_date: str_to_date,
35906str_to_time: str_to_time,
35907datetime_to_str: datetime_to_str,
35908date_to_str: date_to_str,
35909time_to_str: time_to_str,
35910auto_str_to_date: auto_str_to_date,
35911auto_date_to_str: auto_date_to_str,
35912strftime_to_moment_format: strftime_to_moment_format,
35913moment_to_strftime_format: moment_to_strftime_format,
35914getLangDateFormat: getLangDateFormat,
35915getLangTimeFormat: getLangTimeFormat,
35916getLangDatetimeFormat: getLangDatetimeFormat,
35917};
35918});
35919;
35920/* /web/static/src/js/core/mixins.js defined in bundle 'web.assets_common' */
35921odoo.define('web.mixins', function(require) {
35922"use strict";
35923var Class = require('web.Class');
35924var utils = require('web.utils');
35925var ParentedMixin = {
35926__parentedMixin: true,
35927init: function() {
35928this.__parentedDestroyed = false;
35929this.__parentedChildren = [];
35930this.__parentedParent = null;
35931},
35932setParent: function(parent) {
35933if (this.getParent()) {
35934if (this.getParent().__parentedMixin) {
35935this.getParent().__parentedChildren = _.without(this.getParent().getChildren(), this);
35936}
35937}
35938this.__parentedParent = parent;
35939if (parent && parent.__parentedMixin) {
35940parent.__parentedChildren.push(this);
35941}
35942},
35943getParent: function() {
35944return this.__parentedParent;
35945},
35946getChildren: function() {
35947return _.clone(this.__parentedChildren);
35948},
35949isDestroyed: function() {
35950return this.__parentedDestroyed;
35951},
35952alive: function(promise, reject) {
35953var self = this;
35954return $.Deferred(function(def) {
35955promise.then(function() {
35956if (!self.isDestroyed()) {
35957def.resolve.apply(def, arguments);
35958}
35959}, function() {
35960if (!self.isDestroyed()) {
35961def.reject.apply(def, arguments);
35962}
35963}).always(function() {
35964if (reject) {
35965def.reject();
35966}
35967});
35968}).promise();
35969},
35970destroy: function() {
35971_.each(this.getChildren(), function(el) {
35972el.destroy();
35973});
35974this.setParent(undefined);
35975this.__parentedDestroyed = true;
35976},
35977findAncestor: function(predicate) {
35978var ancestor = this;
35979while (ancestor && !(predicate(ancestor)) && ancestor.getParent) {
35980ancestor = ancestor.getParent();
35981}
35982return ancestor;
35983},
35984};
35985function OdooEvent(target, name, data) {
35986this.target = target;
35987this.name = name;
35988this.data = Object.create(null);
35989_.extend(this.data, data);
35990this.stopped = false;
35991}
35992OdooEvent.prototype.stopPropagation = function() {
35993this.stopped = true;
35994}
35995;
35996OdooEvent.prototype.is_stopped = function() {
35997return this.stopped;
35998}
35999;
36000var Events = Class.extend({
36001on: function(events, callback, context) {
36002var ev;
36003events = events.split(/\s+/);
36004var calls = this._callbacks || (this._callbacks = {});
36005while ((ev = events.shift())) {
36006var list = calls[ev] || (calls[ev] = {});
36007var tail = list.tail || (list.tail = list.next = {});
36008tail.callback = callback;
36009tail.context = context;
36010list.tail = tail.next = {};
36011}
36012return this;
36013},
36014off: function(events, callback, context) {
36015var ev, calls, node;
36016if (!events) {
36017delete this._callbacks;
36018} else if ((calls = this._callbacks)) {
36019events = events.split(/\s+/);
36020while ((ev = events.shift())) {
36021node = calls[ev];
36022delete calls[ev];
36023if (!callback || !node)
36024continue;
36025while ((node = node.next) && node.next) {
36026if (node.callback === callback && (!context || node.context === context))
36027continue;
36028this.on(ev, node.callback, node.context);
36029}
36030}
36031}
36032return this;
36033},
36034callbackList: function() {
36035var lst = [];
36036_.each(this._callbacks || {}, function(el, eventName) {
36037var node = el;
36038while ((node = node.next) && node.next) {
36039lst.push([eventName, node.callback, node.context]);
36040}
36041});
36042return lst;
36043},
36044trigger: function(events) {
36045var event, node, calls, tail, args, all, rest;
36046if (!(calls = this._callbacks))
36047return this;
36048all = calls.all;
36049(events = events.split(/\s+/)).push(null);
36050while ((event = events.shift())) {
36051if (all)
36052events.push({
36053next: all.next,
36054tail: all.tail,
36055event: event
36056});
36057if (!(node = calls[event]))
36058continue;
36059events.push({
36060next: node.next,
36061tail: node.tail
36062});
36063}
36064rest = Array.prototype.slice.call(arguments, 1);
36065while ((node = events.pop())) {
36066tail = node.tail;
36067args = node.event ? [node.event].concat(rest) : rest;
36068while ((node = node.next) !== tail) {
36069node.callback.apply(node.context || this, args);
36070}
36071}
36072return this;
36073}
36074});
36075var EventDispatcherMixin = _.extend({}, ParentedMixin, {
36076__eventDispatcherMixin: true,
36077custom_events: {},
36078init: function() {
36079ParentedMixin.init.call(this);
36080this.__edispatcherEvents = new Events();
36081this.__edispatcherRegisteredEvents = [];
36082this._delegateCustomEvents();
36083},
36084proxy: function(method) {
36085var self = this;
36086return function() {
36087var fn = (typeof method === 'string') ? self[method] : method;
36088if (fn === void 0) {
36089throw new Error("Couldn't find method '" + method + "' in widget " + self);
36090}
36091return fn.apply(self, arguments);
36092}
36093;
36094},
36095_delegateCustomEvents: function() {
36096if (_.isEmpty(this.custom_events)) {
36097return;
36098}
36099for (var key in this.custom_events) {
36100if (!this.custom_events.hasOwnProperty(key)) {
36101continue;
36102}
36103var method = this.proxy(this.custom_events[key]);
36104this.on(key, this, method);
36105}
36106},
36107on: function(events, dest, func) {
36108var self = this;
36109if (typeof func !== "function") {
36110throw new Error("Event handler must be a function.");
36111}
36112events = events.split(/\s+/);
36113_.each(events, function(eventName) {
36114self.__edispatcherEvents.on(eventName, func, dest);
36115if (dest && dest.__eventDispatcherMixin) {
36116dest.__edispatcherRegisteredEvents.push({
36117name: eventName,
36118func: func,
36119source: self
36120});
36121}
36122});
36123return this;
36124},
36125off: function(events, dest, func) {
36126var self = this;
36127events = events.split(/\s+/);
36128_.each(events, function(eventName) {
36129self.__edispatcherEvents.off(eventName, func, dest);
36130if (dest && dest.__eventDispatcherMixin) {
36131dest.__edispatcherRegisteredEvents = _.filter(dest.__edispatcherRegisteredEvents, function(el) {
36132return !(el.name === eventName && el.func === func && el.source === self);
36133});
36134}
36135});
36136return this;
36137},
36138once: function(events, dest, func) {
36139var self = this;
36140if (typeof func !== "function") {
36141throw new Error("Event handler must be a function.");
36142}
36143self.on(events, dest, function what() {
36144func.apply(this, arguments);
36145self.off(events, dest, what);
36146});
36147},
36148trigger: function() {
36149this.__edispatcherEvents.trigger.apply(this.__edispatcherEvents, arguments);
36150return this;
36151},
36152trigger_up: function(name, info) {
36153var event = new OdooEvent(this,name,info);
36154this._trigger_up(event);
36155return event;
36156},
36157_trigger_up: function(event) {
36158var parent;
36159this.__edispatcherEvents.trigger(event.name, event);
36160if (!event.is_stopped() && (parent = this.getParent())) {
36161parent._trigger_up(event);
36162}
36163},
36164destroy: function() {
36165var self = this;
36166_.each(this.__edispatcherRegisteredEvents, function(event) {
36167event.source.__edispatcherEvents.off(event.name, event.func, self);
36168});
36169this.__edispatcherRegisteredEvents = [];
36170_.each(this.__edispatcherEvents.callbackList(), function(cal) {
36171this.off(cal[0], cal[2], cal[1]);
36172}, this);
36173this.__edispatcherEvents.off();
36174ParentedMixin.destroy.call(this);
36175}
36176});
36177var PropertiesMixin = _.extend({}, EventDispatcherMixin, {
36178init: function() {
36179EventDispatcherMixin.init.call(this);
36180this.__getterSetterInternalMap = {};
36181},
36182set: function(arg1, arg2, arg3) {
36183var map;
36184var options;
36185if (typeof arg1 === "string") {
36186map = {};
36187map[arg1] = arg2;
36188options = arg3 || {};
36189} else {
36190map = arg1;
36191options = arg2 || {};
36192}
36193var self = this;
36194var changed = false;
36195_.each(map, function(val, key) {
36196var tmp = self.__getterSetterInternalMap[key];
36197if (tmp === val)
36198return;
36199if (key === 'value' && self.field && self.field.type === 'float' && tmp && val) {
36200var digits = self.field.digits;
36201if (_.isArray(digits)) {
36202if (utils.float_is_zero(tmp - val, digits[1])) {
36203return;
36204}
36205}
36206}
36207changed = true;
36208self.__getterSetterInternalMap[key] = val;
36209if (!options.silent)
36210self.trigger("change:" + key, self, {
36211oldValue: tmp,
36212newValue: val
36213});
36214});
36215if (changed)
36216self.trigger("change", self);
36217},
36218get: function(key) {
36219return this.__getterSetterInternalMap[key];
36220}
36221});
36222return {
36223ParentedMixin: ParentedMixin,
36224EventDispatcherMixin: EventDispatcherMixin,
36225PropertiesMixin: PropertiesMixin,
36226};
36227});
36228;
36229/* /web/static/src/js/core/service_mixins.js defined in bundle 'web.assets_common' */
36230odoo.define('web.ServiceProviderMixin', function(require) {
36231"use strict";
36232var core = require('web.core');
36233var ServiceProviderMixin = {
36234services: {},
36235UndeployedServices: {},
36236init: function(parent) {
36237var self = this;
36238this.on('call_service', this, this._call_service.bind(this));
36239_.each(core.serviceRegistry.map, function(Service, serviceName) {
36240if (serviceName in self.UndeployedServices) {
36241throw new Error('Service "' + serviceName + '" is already loaded.');
36242}
36243self.UndeployedServices[serviceName] = Service;
36244});
36245this._deployServices();
36246core.serviceRegistry.onAdd(function(serviceName, Service) {
36247if (serviceName in self.services || serviceName in self.UndeployedServices) {
36248throw new Error('Service "' + serviceName + '" is already loaded.');
36249}
36250self.UndeployedServices[serviceName] = Service;
36251self._deployServices();
36252});
36253},
36254_deployServices: function() {
36255var self = this;
36256var done = false;
36257while (!done) {
36258var serviceName = _.findKey(this.UndeployedServices, function(Service) {
36259return !_.some(Service.prototype.dependencies, function(depName) {
36260return !self.services[depName];
36261});
36262});
36263if (serviceName) {
36264var service = new this.UndeployedServices[serviceName](this);
36265this.services[serviceName] = service;
36266delete this.UndeployedServices[serviceName];
36267service.start();
36268} else {
36269done = true;
36270}
36271}
36272},
36273_call_service: function(event) {
36274var args = event.data.args || [];
36275if (event.data.service === 'ajax' && event.data.method === 'rpc') {
36276args = args.concat(event.target);
36277}
36278var service = this.services[event.data.service];
36279var result = service[event.data.method].apply(service, args);
36280event.data.callback(result);
36281},
36282};
36283return ServiceProviderMixin;
36284});
36285odoo.define('web.ServicesMixin', function(require) {
36286"use strict";
36287var rpc = require('web.rpc');
36288var ServicesMixin = {
36289call: function(service, method) {
36290var args = Array.prototype.slice.call(arguments, 2);
36291var result;
36292this.trigger_up('call_service', {
36293service: service,
36294method: method,
36295args: args,
36296callback: function(r) {
36297result = r;
36298},
36299});
36300return result;
36301},
36302_rpc: function(params, options) {
36303var query = rpc.buildQuery(params);
36304var def = this.call('ajax', 'rpc', query.route, query.params, options, this) || $.Deferred();
36305var promise = def.promise();
36306var abort = (def.abort ? def.abort : def.reject) || function() {}
36307;
36308promise.abort = abort.bind(def);
36309return promise;
36310},
36311loadFieldView: function(dataset, view_id, view_type, options) {
36312return this.loadViews(dataset.model, dataset.get_context().eval(), [[view_id, view_type]], options).then(function(result) {
36313return result[view_type];
36314});
36315},
36316loadViews: function(modelName, context, views, options) {
36317var def = $.Deferred();
36318this.trigger_up('load_views', {
36319modelName: modelName,
36320context: context,
36321views: views,
36322options: options,
36323on_success: def.resolve.bind(def),
36324});
36325return def;
36326},
36327loadFilters: function(dataset, action_id) {
36328var def = $.Deferred();
36329this.trigger_up('load_filters', {
36330dataset: dataset,
36331action_id: action_id,
36332on_success: def.resolve.bind(def),
36333});
36334return def;
36335},
36336getSession: function() {
36337var session;
36338this.trigger_up('get_session', {
36339callback: function(result) {
36340session = result;
36341}
36342});
36343return session;
36344},
36345do_action: function(action, options) {
36346var def = $.Deferred();
36347this.trigger_up('do_action', {
36348action: action,
36349options: options,
36350on_success: function(result) {
36351def.resolve(result);
36352},
36353on_fail: function(result) {
36354def.reject(result);
36355},
36356});
36357return def;
36358},
36359do_notify: function(title, message, sticky, className) {
36360return this.call('notification', 'notify', {
36361title: title,
36362message: message,
36363sticky: sticky,
36364className: className
36365});
36366},
36367do_warn: function(title, message, sticky, className) {
36368return this.call('notification', 'notify', {
36369type: 'warning',
36370title: title,
36371message: message,
36372sticky: sticky,
36373className: className
36374});
36375},
36376};
36377return ServicesMixin;
36378});
36379;
36380/* /web/static/src/js/core/rpc.js defined in bundle 'web.assets_common' */
36381odoo.define('web.rpc', function(require) {
36382"use strict";
36383var ajax = require('web.ajax');
36384return {
36385query: function(params, options) {
36386var query = this.buildQuery(params);
36387return ajax.rpc(query.route, query.params, options);
36388},
36389buildQuery: function(options) {
36390var route;
36391var params = options.params || {};
36392if (options.route) {
36393route = options.route;
36394} else if (options.model && options.method) {
36395route = '/web/dataset/call_kw/' + options.model + '/' + options.method;
36396}
36397if (options.method) {
36398params.args = options.args || [];
36399params.model = options.model;
36400params.method = options.method;
36401params.kwargs = _.extend(params.kwargs || {}, options.kwargs);
36402params.kwargs.context = options.context || params.context || params.kwargs.context;
36403}
36404if (options.method === 'read_group') {
36405if (!(params.args && params.args[0] !== undefined)) {
36406params.kwargs.domain = options.domain || params.domain || params.kwargs.domain || [];
36407}
36408if (!(params.args && params.args[1] !== undefined)) {
36409params.kwargs.fields = options.fields || params.fields || params.kwargs.fields || [];
36410}
36411if (!(params.args && params.args[2] !== undefined)) {
36412params.kwargs.groupby = options.groupBy || params.groupBy || params.kwargs.groupby || [];
36413}
36414params.kwargs.offset = options.offset || params.offset || params.kwargs.offset;
36415params.kwargs.limit = options.limit || params.limit || params.kwargs.limit;
36416var orderBy = options.orderBy || params.orderBy || params.kwargs.orderby;
36417params.kwargs.orderby = orderBy ? this._serializeSort(orderBy) : orderBy;
36418params.kwargs.lazy = 'lazy'in options ? options.lazy : params.lazy;
36419}
36420if (options.method === 'search_read') {
36421params.kwargs.domain = options.domain || params.domain || params.kwargs.domain;
36422params.kwargs.fields = options.fields || params.fields || params.kwargs.fields;
36423params.kwargs.offset = options.offset || params.offset || params.kwargs.offset;
36424params.kwargs.limit = options.limit || params.limit || params.kwargs.limit;
36425var orderBy = options.orderBy || params.orderBy || params.kwargs.order;
36426params.kwargs.order = orderBy ? this._serializeSort(orderBy) : orderBy;
36427}
36428if (options.route === '/web/dataset/search_read') {
36429params.model = options.model || params.model;
36430params.domain = options.domain || params.domain;
36431params.fields = options.fields || params.fields;
36432params.limit = options.limit || params.limit;
36433params.offset = options.offset || params.offset;
36434var orderBy = options.orderBy || params.orderBy;
36435params.sort = orderBy ? this._serializeSort(orderBy) : orderBy;
36436params.context = options.context || params.context || {};
36437}
36438return {
36439route: route,
36440params: JSON.parse(JSON.stringify(params)),
36441};
36442},
36443_serializeSort: function(orderBy) {
36444return _.map(orderBy, function(order) {
36445return order.name + (order.asc !== false ? ' ASC' : ' DESC');
36446}).join(', ');
36447},
36448};
36449});
36450;
36451/* /web/static/src/js/core/widget.js defined in bundle 'web.assets_common' */
36452odoo.define('web.Widget', function(require) {
36453"use strict";
36454var ajax = require('web.ajax');
36455var core = require('web.core');
36456var mixins = require('web.mixins');
36457var ServicesMixin = require('web.ServicesMixin');
36458var Widget = core.Class.extend(mixins.PropertiesMixin, ServicesMixin, {
36459tagName: 'div',
36460id: null,
36461className: null,
36462attributes: {},
36463events: {},
36464template: null,
36465xmlDependencies: null,
36466init: function(parent) {
36467mixins.PropertiesMixin.init.call(this);
36468this.setParent(parent);
36469for (var name in this) {
36470if (typeof (this[name]) === "function") {
36471if ((/^on_|^do_/).test(name)) {
36472this[name] = this[name].bind(this);
36473}
36474}
36475}
36476},
36477willStart: function() {
36478if (this.xmlDependencies) {
36479var defs = _.map(this.xmlDependencies, function(xmlPath) {
36480return ajax.loadXML(xmlPath, core.qweb);
36481});
36482return $.when.apply($, defs);
36483}
36484return $.when();
36485},
36486start: function() {
36487return $.when();
36488},
36489destroy: function() {
36490_.invoke(this.getChildren(), 'destroy');
36491if (this.$el) {
36492this.$el.remove();
36493}
36494mixins.PropertiesMixin.destroy.call(this);
36495},
36496appendTo: function(target) {
36497var self = this;
36498return this._widgetRenderAndInsert(function(t) {
36499self.$el.appendTo(t);
36500}, target);
36501},
36502attachTo: function(target) {
36503var self = this;
36504this.setElement(target.$el || target);
36505return this.willStart().then(function() {
36506return self.start();
36507});
36508},
36509do_hide: function() {
36510this.$el.addClass('o_hidden');
36511},
36512do_show: function() {
36513this.$el.removeClass('o_hidden');
36514},
36515do_toggle: function(display) {
36516if (_.isBoolean(display)) {
36517display ? this.do_show() : this.do_hide();
36518} else {
36519this.$el.hasClass('o_hidden') ? this.do_show() : this.do_hide();
36520}
36521},
36522insertAfter: function(target) {
36523var self = this;
36524return this._widgetRenderAndInsert(function(t) {
36525self.$el.insertAfter(t);
36526}, target);
36527},
36528insertBefore: function(target) {
36529var self = this;
36530return this._widgetRenderAndInsert(function(t) {
36531self.$el.insertBefore(t);
36532}, target);
36533},
36534prependTo: function(target) {
36535var self = this;
36536return this._widgetRenderAndInsert(function(t) {
36537self.$el.prependTo(t);
36538}, target);
36539},
36540renderElement: function() {
36541var $el;
36542if (this.template) {
36543$el = $(core.qweb.render(this.template, {
36544widget: this
36545}).trim());
36546} else {
36547$el = this._makeDescriptive();
36548}
36549this._replaceElement($el);
36550},
36551replace: function(target) {
36552return this._widgetRenderAndInsert(_.bind(function(t) {
36553this.$el.replaceAll(t);
36554}, this), target);
36555},
36556setElement: function(element) {
36557if (this.$el) {
36558this._undelegateEvents();
36559}
36560this.$el = (element instanceof $) ? element : $(element);
36561this.el = this.$el[0];
36562this._delegateEvents();
36563return this;
36564},
36565$: function(selector) {
36566if (selector === undefined) {
36567return this.$el;
36568}
36569return this.$el.find(selector);
36570},
36571_delegateEvents: function() {
36572var events = this.events;
36573if (_.isEmpty(events)) {
36574return;
36575}
36576for (var key in events) {
36577if (!events.hasOwnProperty(key)) {
36578continue;
36579}
36580var method = this.proxy(events[key]);
36581var match = /^(\S+)(\s+(.*))?$/.exec(key);
36582var event = match[1];
36583var selector = match[3];
36584event += '.widget_events';
36585if (!selector) {
36586this.$el.on(event, method);
36587} else {
36588this.$el.on(event, selector, method);
36589}
36590}
36591},
36592_makeDescriptive: function() {
36593var attrs = _.extend({}, this.attributes || {});
36594if (this.id) {
36595attrs.id = this.id;
36596}
36597if (this.className) {
36598attrs['class'] = this.className;
36599}
36600var $el = $(document.createElement(this.tagName));
36601if (!_.isEmpty(attrs)) {
36602$el.attr(attrs);
36603}
36604return $el;
36605},
36606_replaceElement: function($el) {
36607var $oldel = this.$el;
36608this.setElement($el);
36609if ($oldel && !$oldel.is(this.$el)) {
36610if ($oldel.length > 1) {
36611$oldel.wrapAll('<div/>');
36612$oldel.parent().replaceWith(this.$el);
36613} else {
36614$oldel.replaceWith(this.$el);
36615}
36616}
36617return this;
36618},
36619_undelegateEvents: function() {
36620this.$el.off('.widget_events');
36621},
36622_widgetRenderAndInsert: function(insertion, target) {
36623var self = this;
36624return this.willStart().then(function() {
36625if (self.__parentedDestroyed) {
36626return;
36627}
36628self.renderElement();
36629insertion(target);
36630return self.start();
36631});
36632},
36633});
36634return Widget;
36635});
36636;
36637/* /web/static/src/js/core/registry.js defined in bundle 'web.assets_common' */
36638odoo.define('web.Registry', function(require) {
36639"use strict";
36640var Class = require('web.Class');
36641var Registry = Class.extend({
36642init: function(mapping) {
36643this.map = Object.create(mapping || null);
36644this.listeners = [];
36645},
36646add: function(key, value) {
36647this.map[key] = value;
36648_.each(this.listeners, function(callback) {
36649callback(key, value);
36650});
36651return this;
36652},
36653contains: function(key) {
36654return (key in this.map);
36655},
36656extend: function(mapping) {
36657var child = new Registry(this.map);
36658_.extend(child.map, mapping);
36659return child;
36660},
36661get: function(key) {
36662return this.map[key];
36663},
36664getAny: function(keys) {
36665for (var i = 0; i < keys.length; i++) {
36666if (keys[i]in this.map) {
36667return this.map[keys[i]];
36668}
36669}
36670return null;
36671},
36672onAdd: function(callback) {
36673this.listeners.push(callback);
36674},
36675});
36676return Registry;
36677});
36678;
36679/* /web/static/src/js/core/session.js defined in bundle 'web.assets_common' */
36680odoo.define('web.Session', function(require) {
36681"use strict";
36682var ajax = require('web.ajax');
36683var concurrency = require('web.concurrency');
36684var config = require('web.config');
36685var core = require('web.core');
36686var mixins = require('web.mixins');
36687var utils = require('web.utils');
36688var _t = core._t;
36689var qweb = core.qweb;
36690var Session = core.Class.extend(mixins.EventDispatcherMixin, {
36691init: function(parent, origin, options) {
36692mixins.EventDispatcherMixin.init.call(this);
36693this.setParent(parent);
36694options = options || {};
36695this.module_list = (options.modules && options.modules.slice()) || (window.odoo._modules && window.odoo._modules.slice()) || [];
36696this.server = null;
36697this.session_id = options.session_id || null;
36698this.override_session = options.override_session || !!options.session_id || false;
36699this.avoid_recursion = false;
36700this.use_cors = options.use_cors || false;
36701this.setup(origin);
36702this.debug = config.debug;
36703this.name = "instance0";
36704this.qweb_mutex = new concurrency.Mutex();
36705this.currencies = {};
36706this._groups_def = {};
36707core.bus.on('invalidate_session', this, this._onInvalidateSession);
36708},
36709setup: function(origin, options) {
36710var window_origin = location.protocol + "//" + location.host;
36711origin = origin ? origin.replace(/\/+$/, '') : window_origin;
36712if (!_.isUndefined(this.origin) && this.origin !== origin)
36713throw new Error('Session already bound to ' + this.origin);
36714else
36715this.origin = origin;
36716this.prefix = this.origin;
36717this.server = this.origin;
36718this.origin_server = this.origin === window_origin;
36719options = options || {};
36720if ('use_cors'in options) {
36721this.use_cors = options.use_cors;
36722}
36723},
36724session_bind: function(origin) {
36725var self = this;
36726this.setup(origin);
36727qweb.default_dict._s = this.origin;
36728this.uid = null;
36729this.username = null;
36730this.user_context = {};
36731this.db = null;
36732this.module_loaded = {};
36733_(this.module_list).each(function(mod) {
36734self.module_loaded[mod] = true;
36735});
36736this.active_id = null;
36737return this.session_init();
36738},
36739session_init: function() {
36740var self = this;
36741var def = this.session_reload();
36742if (this.is_frontend) {
36743return def.then(function() {
36744return self.load_translations();
36745});
36746}
36747return def.then(function() {
36748var modules = self.module_list.join(',');
36749var deferred = self.load_qweb(modules);
36750if (self.session_is_valid()) {
36751return deferred.then(function() {
36752return self.load_modules();
36753});
36754}
36755// return $.when(deferred, self.rpc('/web/webclient/bootstrap_translations', {
36756return $.when(deferred, false, {
36757mods: self.module_list
36758}).then(function(trans) {
36759_t.database.set_bundle(trans);
36760});
36761// }));
36762});
36763},
36764session_is_valid: function() {
36765var db = $.deparam.querystring().db;
36766if (db && this.db !== db) {
36767return false;
36768}
36769return !!this.uid;
36770},
36771session_authenticate: function() {
36772var self = this;
36773return $.when(this._session_authenticate.apply(this, arguments)).then(function() {
36774return self.load_modules();
36775});
36776},
36777_session_authenticate: function(db, login, password) {
36778var self = this;
36779var params = {
36780db: db,
36781login: login,
36782password: password
36783};
36784return this.rpc("/web/session/authenticate", params).then(function(result) {
36785if (!result.uid) {
36786return $.Deferred().reject();
36787}
36788delete result.session_id;
36789_.extend(self, result);
36790});
36791},
36792session_logout: function() {
36793$.bbq.removeState();
36794return this.rpc("/web/session/destroy", {});
36795},
36796user_has_group: function(group) {
36797if (!this.uid) {
36798return $.when(false);
36799}
36800var def = this._groups_def[group];
36801if (!def) {
36802def = this._groups_def[group] = this.rpc('/web/dataset/call_kw/res.users/has_group', {
36803"model": "res.users",
36804"method": "has_group",
36805"args": [group],
36806"kwargs": {}
36807});
36808}
36809return def;
36810},
36811get_cookie: function(name) {
36812if (!this.name) {
36813return null;
36814}
36815var nameEQ = this.name + '|' + name + '=';
36816var cookies = document.cookie.split(';');
36817for (var i = 0; i < cookies.length; ++i) {
36818var cookie = cookies[i].replace(/^\s*/, '');
36819if (cookie.indexOf(nameEQ) === 0) {
36820try {
36821return JSON.parse(decodeURIComponent(cookie.substring(nameEQ.length)));
36822} catch (err) {
36823this.set_cookie(name, '', -1);
36824}
36825}
36826}
36827return null;
36828},
36829set_cookie: function(name, value, ttl) {
36830if (!this.name) {
36831return;
36832}
36833ttl = ttl || 24 * 60 * 60 * 365;
36834utils.set_cookie(this.name + '|' + name, value, ttl);
36835},
36836load_modules: function() {
36837var self = this;
36838var modules = odoo._modules;
36839var all_modules = _.uniq(self.module_list.concat(modules));
36840var to_load = _.difference(modules, self.module_list).join(',');
36841this.module_list = all_modules;
36842var loaded = $.when(self.load_translations());
36843var locale = "/web/webclient/locale/" + self.user_context.lang || 'en_US';
36844var file_list = [locale];
36845if (to_load.length) {
36846loaded = $.when(loaded, self.rpc('/web/webclient/csslist', {
36847mods: to_load
36848}).done(self.load_css.bind(self)), self.load_qweb(to_load), self.rpc('/web/webclient/jslist', {
36849mods: to_load
36850}).done(function(files) {
36851file_list = file_list.concat(files);
36852}));
36853}
36854return loaded.then(function() {
36855return self.load_js(file_list);
36856}).done(function() {
36857self.on_modules_loaded();
36858self.trigger('module_loaded');
36859});
36860},
36861load_translations: function() {
36862return _t.database.load_translations(this, this.module_list, this.user_context.lang, this.translationURL);
36863},
36864load_css: function(files) {
36865var self = this;
36866_.each(files, function(file) {
36867ajax.loadCSS(self.url(file, null));
36868});
36869},
36870load_js: function(files) {
36871var self = this;
36872var d = $.Deferred();
36873if (files.length !== 0) {
36874var file = files.shift();
36875var url = self.url(file, null);
36876ajax.loadJS(url).done(d.resolve);
36877} else {
36878d.resolve();
36879}
36880return d;
36881},
36882load_qweb: function(mods) {
36883if(!mods) return this.qweb_mutex.def;
36884this.qweb_mutex.exec(function() {
36885return $.get('/web/webclient/qweb?mods=' + mods).then(function(doc) {
36886if (!doc) {
36887return;
36888}
36889qweb.add_template(doc);
36890});
36891return;
36892});
36893return this.qweb_mutex.def;
36894},
36895on_modules_loaded: function() {
36896var openerp = window.openerp;
36897for (var j = 0; j < this.module_list.length; j++) {
36898var mod = this.module_list[j];
36899if (this.module_loaded[mod])
36900continue;
36901openerp[mod] = {};
36902var fct = openerp._openerp[mod];
36903if (typeof (fct) === "function") {
36904openerp._openerp[mod] = {};
36905for (var k in fct) {
36906openerp._openerp[mod][k] = fct[k];
36907}
36908fct(openerp, openerp._openerp[mod]);
36909}
36910this.module_loaded[mod] = true;
36911}
36912},
36913get_currency: function(currency_id) {
36914return this.currencies[currency_id];
36915},
36916get_file: function(options) {
36917if (this.override_session) {
36918options.data.session_id = this.session_id;
36919}
36920options.session = this;
36921return ajax.get_file(options);
36922},
36923session_reload: function() {
36924var result = _.extend({}, window.odoo.session_info);
36925delete result.session_id;
36926_.extend(this, result);
36927return $.when();
36928},
36929check_session_id: function() {
36930var self = this;
36931if (this.avoid_recursion)
36932return $.when();
36933if (this.session_id)
36934return $.when();
36935if (!this.use_cors && (this.override_session || !this.origin_server)) {
36936this.avoid_recursion = true;
36937return this.rpc("/gen_session_id", {}).then(function(result) {
36938self.session_id = result;
36939}).always(function() {
36940self.avoid_recursion = false;
36941});
36942}
36943return $.when();
36944},
36945rpc: function(url, params, options) {
36946var self = this;
36947options = _.clone(options || {});
36948options.headers = _.extend({}, options.headers);
36949if (odoo.debug) {
36950options.headers["X-Debug-Mode"] = $.deparam($.param.querystring()).debug;
36951}
36952var deferred = self.check_session_id();
36953var aborted = false;
36954var xhrDef;
36955deferred.abort = function() {
36956if (xhrDef) {
36957xhrDef.abort();
36958} else {
36959aborted = true;
36960}
36961}
36962;
36963var promise = deferred.then(function() {
36964if (aborted) {
36965var def = $.Deferred().reject({
36966message: "XmlHttpRequestError abort"
36967}, $.Event('abort'));
36968def.abort = function() {}
36969;
36970return def;
36971}
36972if (!_.isString(url)) {
36973_.extend(options, url);
36974url = url.url;
36975}
36976var fct;
36977if (self.origin_server) {
36978fct = ajax.jsonRpc;
36979if (self.override_session) {
36980options.headers["X-Openerp-Session-Id"] = self.session_id || '';
36981}
36982} else if (self.use_cors) {
36983fct = ajax.jsonRpc;
36984url = self.url(url, null);
36985options.session_id = self.session_id || '';
36986if (self.override_session) {
36987options.headers["X-Openerp-Session-Id"] = self.session_id || '';
36988}
36989} else {
36990fct = ajax.jsonpRpc;
36991url = self.url(url, null);
36992options.session_id = self.session_id || '';
36993}
36994xhrDef = fct(url, "call", params, options);
36995return xhrDef;
36996});
36997promise.abort = deferred.abort;
36998return promise;
36999},
37000url: function(path, params) {
37001params = _.extend(params || {});
37002if (this.override_session || (!this.origin_server))
37003params.session_id = this.session_id;
37004var qs = $.param(params);
37005if (qs.length > 0)
37006qs = "?" + qs;
37007var prefix = _.any(['http://', 'https://', '//'], function(el) {
37008return path.length >= el.length && path.slice(0, el.length) === el;
37009}) ? '' : this.prefix;
37010return prefix + path + qs;
37011},
37012getTZOffset: function(date) {
37013return -new Date(date).getTimezoneOffset();
37014},
37015_onInvalidateSession: function() {
37016this.uid = false;
37017},
37018});
37019return Session;
37020});
37021;
37022/* /web/static/src/js/core/dom.js defined in bundle 'web.assets_common' */
37023odoo.define('web.dom_ready', function(require) {
37024'use strict';
37025var def = $.Deferred();
37026$(def.resolve.bind(def));
37027return def;
37028});
37029odoo.define('web.dom', function(require) {
37030"use strict";
37031var concurrency = require('web.concurrency');
37032var config = require('web.config');
37033var core = require('web.core');
37034var _t = core._t;
37035function _notify(content, callbacks) {
37036_.each(callbacks, function(c) {
37037if (c.widget && c.widget.on_attach_callback) {
37038c.widget.on_attach_callback(c.callback_args);
37039}
37040});
37041core.bus.trigger('DOM_updated', content);
37042}
37043var dom = {
37044DEBOUNCE: 400,
37045append: function($target, content, options) {
37046$target.append(content);
37047if (options && options.in_DOM) {
37048_notify(content, options.callbacks);
37049}
37050},
37051autoresize: function($textarea, options) {
37052if ($textarea.data("auto_resize")) {
37053return;
37054}
37055var $fixedTextarea;
37056var minHeight;
37057function resize() {
37058$fixedTextarea.insertAfter($textarea);
37059var heightOffset = 0;
37060var style = window.getComputedStyle($textarea[0], null);
37061if (style.boxSizing === 'border-box') {
37062var paddingHeight = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);
37063var borderHeight = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
37064heightOffset = borderHeight + paddingHeight;
37065}
37066$fixedTextarea.width($textarea.width());
37067$fixedTextarea.val($textarea.val());
37068var height = $fixedTextarea[0].scrollHeight;
37069$textarea.css({
37070height: Math.max(height + heightOffset, minHeight)
37071});
37072}
37073function removeVerticalResize() {
37074var style = window.getComputedStyle($textarea[0], null);
37075if (style.resize === 'vertical') {
37076$textarea[0].style.resize = 'none';
37077} else if (style.resize === 'both') {
37078$textarea[0].style.resize = 'horizontal';
37079}
37080}
37081options = options || {};
37082minHeight = (options && options.min_height) || 50;
37083$fixedTextarea = $('<textarea disabled>', {
37084class: $textarea[0].className,
37085});
37086var direction = _t.database.parameters.direction === 'rtl' ? 'right' : 'left';
37087$fixedTextarea.css({
37088position: 'absolute',
37089opacity: 0,
37090height: 10,
37091borderTopWidth: 0,
37092borderBottomWidth: 0,
37093padding: 0,
37094top: -10000,
37095}).css(direction, -10000);
37096$fixedTextarea.data("auto_resize", true);
37097$textarea.css({
37098'overflow-y': 'hidden'
37099});
37100resize();
37101removeVerticalResize();
37102$textarea.data("auto_resize", true);
37103$textarea.on('input focus change', resize);
37104if (options.parent) {
37105core.bus.on('DOM_updated', options.parent, function() {
37106resize();
37107removeVerticalResize();
37108});
37109}
37110},
37111cssFind: function($from, selector) {
37112return $from.find('*').filter(selector);
37113},
37114detach: function(to_detach, options) {
37115_.each(to_detach, function(d) {
37116if (d.widget.on_detach_callback) {
37117d.widget.on_detach_callback(d.callback_args);
37118}
37119});
37120var $to_detach = options && options.$to_detach;
37121if (!$to_detach) {
37122$to_detach = $(_.map(to_detach, function(d) {
37123return d.widget.el;
37124}));
37125}
37126return $to_detach.detach();
37127},
37128getSelectionRange: function(node) {
37129return {
37130start: node.selectionStart,
37131end: node.selectionEnd,
37132};
37133},
37134getPosition: function(e) {
37135var position = {
37136left: 0,
37137top: 0
37138};
37139while (e) {
37140position.left += e.offsetLeft;
37141position.top += e.offsetTop;
37142e = e.offsetParent;
37143}
37144return position;
37145},
37146makeAsyncHandler: function(fct, preventDefault, stopPropagation) {
37147var def = $.when();
37148return function(ev) {
37149if (preventDefault === true || preventDefault && preventDefault()) {
37150ev.preventDefault();
37151}
37152if (stopPropagation === true || stopPropagation && stopPropagation()) {
37153ev.stopPropagation();
37154}
37155if (def.state() === 'pending') {
37156return;
37157}
37158var result = fct.apply(this, arguments);
37159def = $.when(result);
37160return result;
37161}
37162;
37163},
37164makeButtonHandler: function(fct) {
37165fct = dom.makeAsyncHandler(fct);
37166return function(ev) {
37167var result = fct.apply(this, arguments);
37168var $button = $(ev.target).closest('.btn');
37169if (!$button.length) {
37170return result;
37171}
37172$button.addClass('o_debounce_disabled');
37173$.when(dom.DEBOUNCE && concurrency.delay(dom.DEBOUNCE)).then(function() {
37174$button.addClass('disabled').prop('disabled', true);
37175$button.removeClass('o_debounce_disabled');
37176return $.when(result).always(function() {
37177$button.removeClass('disabled').prop('disabled', false);
37178});
37179});
37180return result;
37181}
37182;
37183},
37184prepend: function($target, content, options) {
37185$target.prepend(content);
37186if (options && options.in_DOM) {
37187_notify(content, options.callbacks);
37188}
37189},
37190renderButton: function(options) {
37191var jQueryParams = _.extend({
37192type: 'button',
37193}, options.attrs || {});
37194var extraClasses = jQueryParams.class;
37195if (extraClasses) {
37196extraClasses = extraClasses.replace(/\boe_highlight\b/g, 'btn-primary').replace(/\boe_link\b/g, 'btn-link');
37197}
37198jQueryParams.class = 'btn';
37199if (options.size) {
37200jQueryParams.class += (' btn-' + options.size);
37201}
37202jQueryParams.class += (' ' + (extraClasses || 'btn-secondary'));
37203var $button = $('<button/>', jQueryParams);
37204if (options.icon) {
37205if (options.icon.substr(0, 3) === 'fa-') {
37206$button.append($('<i/>', {
37207class: 'fa fa-fw o_button_icon ' + options.icon,
37208}));
37209} else {
37210$button.append($('<img/>', {
37211src: options.icon,
37212}));
37213}
37214}
37215if (options.text) {
37216$button.append($('<span/>', {
37217text: options.text,
37218}));
37219}
37220return $button;
37221},
37222renderCheckbox: function(options) {
37223var id = _.uniqueId('checkbox-');
37224var $container = $('<div/>', {
37225class: 'custom-control custom-checkbox',
37226});
37227var $input = $('<input/>', {
37228type: 'checkbox',
37229id: id,
37230class: 'custom-control-input',
37231});
37232var $label = $('<label/>', {
37233for: id,
37234class: 'custom-control-label',
37235text: options && options.text || '',
37236});
37237if (!options || !options.text) {
37238$label.html('&#8203;');
37239}
37240if (options && options.prop) {
37241$input.prop(options.prop);
37242}
37243return $container.append($input, $label);
37244},
37245setSelectionRange: function(node, range) {
37246if (node.setSelectionRange) {
37247node.setSelectionRange(range.start, range.end);
37248} else if (node.createTextRange) {
37249node.createTextRange().collapse(true).moveEnd('character', range.start).moveStart('character', range.end).select();
37250}
37251},
37252initAutoMoreMenu: function($el, options) {
37253options = _.extend({
37254unfoldable: 'none',
37255maxWidth: false,
37256sizeClass: 'SM',
37257}, options || {});
37258var $extraItemsToggle = null;
37259var debouncedAdapt = _.debounce(_adapt, 250);
37260core.bus.on('resize', null, debouncedAdapt);
37261_adapt();
37262$el.data('dom:autoMoreMenu:destroy', function() {
37263_restore();
37264core.bus.off('resize', null, debouncedAdapt);
37265$el.removeData('dom:autoMoreMenu:destroy');
37266});
37267function _restore() {
37268if ($extraItemsToggle === null) {
37269return;
37270}
37271var $items = $extraItemsToggle.children('.dropdown-menu').children();
37272$items.addClass('nav-item');
37273$items.children('.dropdown-item, a').removeClass('dropdown-item').addClass('nav-link');
37274$items.insertBefore($extraItemsToggle);
37275$extraItemsToggle.remove();
37276$extraItemsToggle = null;
37277}
37278function _adapt() {
37279if (!$el.is(':visible')) {
37280return;
37281}
37282_restore();
37283if (config.device.size_class <= config.device.SIZES[options.sizeClass]) {
37284return;
37285}
37286var $allItems = $el.children();
37287var $unfoldableItems = $allItems.filter(options.unfoldable);
37288var $items = $allItems.not($unfoldableItems);
37289var maxWidth = 0;
37290if (options.maxWidth) {
37291maxWidth = options.maxWidth();
37292} else {
37293var mLeft = $el.is('.ml-auto, .mx-auto, .m-auto');
37294var mRight = $el.is('.mr-auto, .mx-auto, .m-auto');
37295maxWidth = computeFloatOuterWidthWithMargins($el[0], mLeft, mRight);
37296var style = window.getComputedStyle($el[0]);
37297maxWidth -= (parseFloat(style.paddingLeft) + parseFloat(style.paddingRight) + parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth));
37298maxWidth -= _.reduce($unfoldableItems, function(sum, el) {
37299return sum + computeFloatOuterWidthWithMargins(el);
37300}, 0);
37301}
37302var nbItems = $items.length;
37303var menuItemsWidth = _.reduce($items, function(sum, el) {
37304return sum + computeFloatOuterWidthWithMargins(el);
37305}, 0);
37306if (maxWidth - menuItemsWidth >= -0.001) {
37307return;
37308}
37309var $dropdownMenu = $('<ul/>', {
37310class: 'dropdown-menu'
37311});
37312$extraItemsToggle = $('<li/>', {
37313class: 'nav-item dropdown o_extra_menu_items'
37314}).append($('<a/>', {
37315role: 'button',
37316href: '#',
37317class: 'nav-link dropdown-toggle o-no-caret',
37318'data-toggle': 'dropdown',
37319'aria-expanded': false
37320}).append($('<i/>', {
37321class: 'fa fa-plus'
37322}))).append($dropdownMenu);
37323$extraItemsToggle.insertAfter($items.last());
37324menuItemsWidth += computeFloatOuterWidthWithMargins($extraItemsToggle[0]);
37325do {
37326menuItemsWidth -= computeFloatOuterWidthWithMargins($items.eq(--nbItems)[0]);
37327} while (!(maxWidth - menuItemsWidth >= -0.001));var $extraItems = $items.slice(nbItems).detach();
37328$extraItems.removeClass('nav-item');
37329$extraItems.children('.nav-link, a').removeClass('nav-link').addClass('dropdown-item');
37330$dropdownMenu.append($extraItems);
37331$extraItemsToggle.find('.nav-link').toggleClass('active', $extraItems.children().hasClass('active'));
37332}
37333function computeFloatOuterWidthWithMargins(el, mLeft, mRight) {
37334var rect = el.getBoundingClientRect();
37335var style = window.getComputedStyle(el);
37336var outerWidth = rect.right - rect.left;
37337if (mLeft !== false) {
37338outerWidth += parseFloat(style.marginLeft);
37339}
37340if (mRight !== false) {
37341outerWidth += parseFloat(style.marginRight);
37342}
37343return outerWidth;
37344}
37345},
37346destroyAutoMoreMenu: function($el) {
37347var destroyFunc = $el.data('dom:autoMoreMenu:destroy');
37348if (destroyFunc) {
37349destroyFunc.call(null);
37350}
37351},
37352};
37353return dom;
37354});
37355;
37356/* /web/static/src/js/core/concurrency.js defined in bundle 'web.assets_common' */
37357odoo.define('web.concurrency', function(require) {
37358"use strict";
37359var Class = require('web.Class');
37360return {
37361asyncWhen: function() {
37362var async = false;
37363var def = $.Deferred();
37364$.when.apply($, arguments).done(function() {
37365var args = arguments;
37366var action = function() {
37367def.resolve.apply(def, args);
37368};
37369if (async) {
37370action();
37371} else {
37372setTimeout(action, 0);
37373}
37374}).fail(function() {
37375var args = arguments;
37376var action = function() {
37377def.reject.apply(def, args);
37378};
37379if (async) {
37380action();
37381} else {
37382setTimeout(action, 0);
37383}
37384});
37385async = true;
37386return def;
37387},
37388delay: function(wait) {
37389var def = $.Deferred();
37390setTimeout(def.resolve, wait);
37391return def;
37392},
37393DropMisordered: Class.extend({
37394init: function(failMisordered) {
37395this.lsn = 0;
37396this.rsn = -1;
37397this.failMisordered = failMisordered || false;
37398},
37399add: function(deferred) {
37400var res = $.Deferred();
37401var self = this
37402  , seq = this.lsn++;
37403deferred.done(function() {
37404if (seq > self.rsn) {
37405self.rsn = seq;
37406res.resolve.apply(res, arguments);
37407} else if (self.failMisordered) {
37408res.reject();
37409}
37410}).fail(function() {
37411res.reject.apply(res, arguments);
37412});
37413return res.promise();
37414},
37415}),
37416DropPrevious: Class.extend({
37417add: function(deferred) {
37418if (this.current_def) {
37419this.current_def.reject();
37420}
37421var res = $.Deferred();
37422deferred.then(res.resolve, res.reject);
37423this.current_def = res;
37424return res.promise();
37425}
37426}),
37427Mutex: Class.extend({
37428init: function() {
37429this.def = $.Deferred().resolve();
37430this.unlockedDef = undefined;
37431},
37432exec: function(action) {
37433var self = this;
37434var current = this.def;
37435var next = this.def = $.Deferred();
37436this.unlockedDef = this.unlockedDef || $.Deferred();
37437return current.then(function() {
37438return $.when(action()).always(function() {
37439next.resolve();
37440if (self.def.state() === 'resolved' && self.unlockedDef) {
37441self.unlockedDef.resolve();
37442self.unlockedDef = undefined;
37443}
37444});
37445});
37446},
37447getUnlockedDef: function() {
37448return $.when(this.unlockedDef);
37449},
37450}),
37451MutexedDropPrevious: Class.extend({
37452init: function() {
37453this.currentDef = null;
37454this.locked = false;
37455this.pendingAction = null;
37456this.pendingDef = null;
37457},
37458exec: function(action) {
37459var self = this;
37460if (this.locked) {
37461this.pendingAction = action;
37462var oldPendingDef = this.pendingDef;
37463var pendingDef = this.pendingDef = $.Deferred();
37464if (oldPendingDef) {
37465oldPendingDef.reject();
37466}
37467this.currentDef.reject();
37468return pendingDef.promise();
37469} else {
37470this.locked = true;
37471this.currentDef = $.Deferred();
37472$.when(action()).then(this.currentDef.resolve.bind(this.currentDef)).fail(this.currentDef.reject.bind(this.currentDef)).always(function() {
37473self.locked = false;
37474if (self.pendingAction) {
37475var action = self.pendingAction;
37476self.pendingAction = null;
37477self.exec(action).then(self.pendingDef.resolve.bind(self.pendingDef)).fail(self.pendingDef.reject.bind(self.pendingDef));
37478}
37479});
37480return this.currentDef.promise();
37481}
37482},
37483}),
37484rejectAfter: function(target_def, reference_def) {
37485var res = $.Deferred();
37486target_def.then(res.resolve, res.reject);
37487reference_def.always(res.reject);
37488return res.promise();
37489}
37490};
37491});
37492;
37493/* /web/static/src/js/core/utils.js defined in bundle 'web.assets_common' */
37494odoo.define('web.utils', function(require) {
37495"use strict";
37496var translation = require('web.translation');
37497var _t = translation._t;
37498var id = -1;
37499var utils = {
37500assert: function(bool) {
37501if (!bool) {
37502throw new Error("AssertionError");
37503}
37504},
37505binaryToBinsize: function(value) {
37506if (!this.is_bin_size(value)) {
37507return this.human_size(value.length / 1.37);
37508}
37509return value;
37510},
37511confine: function(val, min, max) {
37512return Math.max(min, Math.min(max, val));
37513},
37514float_is_zero: function(value, decimals) {
37515var epsilon = Math.pow(10, -decimals);
37516return Math.abs(utils.round_precision(value, epsilon)) < epsilon;
37517},
37518generateID: function() {
37519return ++id;
37520},
37521get_cookie: function(c_name) {
37522var cookies = document.cookie ? document.cookie.split('; ') : [];
37523for (var i = 0, l = cookies.length; i < l; i++) {
37524var parts = cookies[i].split('=');
37525var name = parts.shift();
37526var cookie = parts.join('=');
37527if (c_name && c_name === name) {
37528return cookie;
37529}
37530}
37531return "";
37532},
37533human_number: function(number, decimals, minDigits, formatterCallback) {
37534number = Math.round(number);
37535decimals = decimals | 0;
37536minDigits = minDigits || 1;
37537formatterCallback = formatterCallback || utils.insert_thousand_seps;
37538var d2 = Math.pow(10, decimals);
37539var val = _t('kMGTPE');
37540var symbol = '';
37541var numberMagnitude = number.toExponential().split('e')[1];
37542if (numberMagnitude >= 21) {
37543number = Math.round(number * Math.pow(10, decimals - numberMagnitude)) / d2;
37544return number + 'e' + numberMagnitude;
37545}
37546for (var i = val.length; i > 0; i--) {
37547var s = Math.pow(10, i * 3);
37548if (s <= number / Math.pow(10, minDigits - 1)) {
37549number = Math.round(number * d2 / s) / d2;
37550symbol = val[i - 1];
37551break;
37552}
37553}
37554return formatterCallback('' + number) + symbol;
37555},
37556human_size: function(size) {
37557var units = _t("Bytes,Kb,Mb,Gb,Tb,Pb,Eb,Zb,Yb").split(',');
37558var i = 0;
37559while (size >= 1024) {
37560size /= 1024;
37561++i;
37562}
37563return size.toFixed(2) + ' ' + units[i].trim();
37564},
37565insert_thousand_seps: function(num) {
37566var negative = num[0] === '-';
37567num = (negative ? num.slice(1) : num);
37568return (negative ? '-' : '') + utils.intersperse(num, _t.database.parameters.grouping, _t.database.parameters.thousands_sep);
37569},
37570intersperse: function(str, indices, separator) {
37571separator = separator || '';
37572var result = []
37573  , last = str.length;
37574for (var i = 0; i < indices.length; ++i) {
37575var section = indices[i];
37576if (section === -1 || last <= 0) {
37577break;
37578} else if (section === 0 && i === 0) {
37579break;
37580} else if (section === 0) {
37581section = indices[--i];
37582}
37583result.push(str.substring(last - section, last));
37584last -= section;
37585}
37586var s = str.substring(0, last);
37587if (s) {
37588result.push(s);
37589}
37590return result.reverse().join(separator);
37591},
37592into: function(object, path) {
37593if (!_(path).isArray()) {
37594path = path.split('.');
37595}
37596for (var i = 0; i < path.length; i++) {
37597object = object[path[i]];
37598}
37599return object;
37600},
37601is_bin_size: function(v) {
37602return (/^\d+(\.\d*)? [^0-9]+$/).test(v);
37603},
37604json_node_to_xml: function(node, human_readable, indent) {
37605indent = indent || 0;
37606var sindent = (human_readable ? (new Array(indent + 1).join('\t')) : '')
37607  , r = sindent + '<' + node.tag
37608  , cr = human_readable ? '\n' : '';
37609if (typeof (node) === 'string') {
37610return sindent + node.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
37611} else if (typeof (node.tag) !== 'string' || !node.children instanceof Array || !node.attrs instanceof Object) {
37612throw new Error(_.str.sprintf(_t("Node [%s] is not a JSONified XML node"), JSON.stringify(node)));
37613}
37614for (var attr in node.attrs) {
37615var vattr = node.attrs[attr];
37616if (typeof (vattr) !== 'string') {
37617vattr = JSON.stringify(vattr);
37618}
37619vattr = vattr.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
37620if (human_readable) {
37621vattr = vattr.replace(/&quot;/g, "'");
37622}
37623r += ' ' + attr + '="' + vattr + '"';
37624}
37625if (node.children && node.children.length) {
37626r += '>' + cr;
37627var childs = [];
37628for (var i = 0, ii = node.children.length; i < ii; i++) {
37629childs.push(utils.json_node_to_xml(node.children[i], human_readable, indent + 1));
37630}
37631r += childs.join(cr);
37632r += cr + sindent + '</' + node.tag + '>';
37633return r;
37634} else {
37635return r + '/>';
37636}
37637},
37638lpad: function(str, size) {
37639str = "" + str;
37640return new Array(size - str.length + 1).join('0') + str;
37641},
37642round_decimals: function(value, decimals) {
37643return utils.round_precision(value, Math.pow(10, -decimals));
37644},
37645round_precision: function(value, precision) {
37646if (!value) {
37647return 0;
37648} else if (!precision || precision < 0) {
37649precision = 1;
37650}
37651var normalized_value = value / precision;
37652var epsilon_magnitude = Math.log(Math.abs(normalized_value)) / Math.log(2);
37653var epsilon = Math.pow(2, epsilon_magnitude - 53);
37654normalized_value += normalized_value >= 0 ? epsilon : -epsilon;
37655var sign = normalized_value < 0 ? -1.0 : 1.0;
37656var rounded_value = sign * Math.round(Math.abs(normalized_value));
37657return rounded_value * precision;
37658},
37659rpad: function(str, size) {
37660str = "" + str;
37661return str + new Array(size - str.length + 1).join('0');
37662},
37663set_cookie: function(name, value, ttl) {
37664ttl = ttl || 24 * 60 * 60 * 365;
37665document.cookie = [name + '=' + value, 'path=/', 'max-age=' + ttl, 'expires=' + new Date(new Date().getTime() + ttl * 1000).toGMTString()].join(';');
37666},
37667stableSort: function(array, iteratee) {
37668var stable = array.slice();
37669return array.sort(function stableCompare(a, b) {
37670var order = iteratee(a, b);
37671if (order !== 0) {
37672return order;
37673} else {
37674return stable.indexOf(a) - stable.indexOf(b);
37675}
37676});
37677},
37678swap: function(array, elem1, elem2) {
37679var i1 = array.indexOf(elem1);
37680var i2 = array.indexOf(elem2);
37681array[i2] = elem1;
37682array[i1] = elem2;
37683},
37684is_email: function(value, allow_mailto) {
37685var re;
37686if (allow_mailto) {
37687re = /^(mailto:)?(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
37688} else {
37689re = /^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
37690}
37691return re.test(value);
37692},
37693toBoolElse: function(str, elseValues, trueValues, falseValues) {
37694var ret = _.str.toBool(str, trueValues, falseValues);
37695if (_.isUndefined(ret)) {
37696return elseValues;
37697}
37698return ret;
37699},
37700traverse_records: function(data, f) {
37701if (data.type === 'record') {
37702f(data);
37703} else if (data.data) {
37704for (var i = 0; i < data.data.length; i++) {
37705utils.traverse_records(data.data[i], f);
37706}
37707}
37708},
37709xml_to_json: function(node, strip_whitespace) {
37710switch (node.nodeType) {
37711case 9:
37712return utils.xml_to_json(node.documentElement, strip_whitespace);
37713case 3:
37714case 4:
37715return (strip_whitespace && node.data.trim() === '') ? undefined : node.data;
37716case 1:
37717var attrs = $(node).getAttributes();
37718_.each(['domain', 'filter_domain', 'context', 'default_get'], function(key) {
37719if (attrs[key]) {
37720try {
37721attrs[key] = JSON.parse(attrs[key]);
37722} catch (e) {}
37723}
37724});
37725return {
37726tag: node.tagName.toLowerCase(),
37727attrs: attrs,
37728children: _.compact(_.map(node.childNodes, function(node) {
37729return utils.xml_to_json(node, strip_whitespace);
37730})),
37731};
37732}
37733},
37734xml_to_str: function(node) {
37735var str = "";
37736if (window.XMLSerializer) {
37737str = (new XMLSerializer()).serializeToString(node);
37738} else if (window.ActiveXObject) {
37739str = node.xml;
37740} else {
37741throw new Error(_t("Could not serialize XML"));
37742}
37743var void_elements = 'area base br col command embed hr img input keygen link meta param source track wbr'.split(' ');
37744str = str.replace(/<([a-z]+)([^<>]*)\s*\/\s*>/g, function(match, tag, attrs) {
37745if (void_elements.indexOf(tag) < 0) {
37746return "<" + tag + attrs + "></" + tag + ">";
37747} else {
37748return match;
37749}
37750});
37751return str;
37752},
37753traverse: function(tree, f) {
37754if (f(tree)) {
37755_.each(tree.children, function(c) {
37756utils.traverse(c, f);
37757});
37758}
37759},
37760traversePath: function(tree, f, path) {
37761path = path || [];
37762f(tree, path);
37763_.each(tree.children, function(node) {
37764utils.traversePath(node, f, path.concat(tree));
37765});
37766},
37767deepFreeze: function(obj) {
37768var propNames = Object.getOwnPropertyNames(obj);
37769propNames.forEach(function(name) {
37770var prop = obj[name];
37771if (typeof prop == 'object' && prop !== null)
37772utils.deepFreeze(prop);
37773});
37774return Object.freeze(obj);
37775},
37776closestNumber: function(num, arr) {
37777var curr = arr[0];
37778var diff = Math.abs(num - curr);
37779for (var val = 0; val < arr.length; val++) {
37780var newdiff = Math.abs(num - arr[val]);
37781if (newdiff < diff) {
37782diff = newdiff;
37783curr = arr[val];
37784}
37785}
37786return curr;
37787},
37788};
37789return utils;
37790});
37791;
37792/* /web/static/src/js/core/qweb.js defined in bundle 'web.assets_common' */
37793odoo.define('web.QWeb', function(require) {
37794"use strict";
37795var translation = require('web.translation');
37796var _t = translation._t;
37797function QWeb(debug, default_dict, enableTranslation) {
37798if (enableTranslation === undefined) {
37799enableTranslation = true;
37800}
37801var qweb = new QWeb2.Engine();
37802qweb.default_dict = _.extend({}, default_dict || {}, {
37803'_': _,
37804'JSON': JSON,
37805'_t': translation._t,
37806'__debug__': debug,
37807'moment': function(date) {
37808return new moment(date);
37809},
37810'csrf_token': odoo.csrf_token,
37811});
37812qweb.debug = debug;
37813qweb.preprocess_node = enableTranslation ? preprocess_node : function() {}
37814;
37815return qweb;
37816}
37817function preprocess_node() {
37818switch (this.node.nodeType) {
37819case Node.TEXT_NODE:
37820case Node.CDATA_SECTION_NODE:
37821var translation = this.node.parentNode.attributes['t-translation'];
37822if (translation && translation.value === 'off') {
37823return;
37824}
37825var match = /^(\s*)([\s\S]+?)(\s*)$/.exec(this.node.data);
37826if (match) {
37827this.node.data = match[1] + _t(match[2]) + match[3];
37828}
37829break;
37830case Node.ELEMENT_NODE:
37831var attr, attrs = ['label', 'title', 'alt', 'placeholder'];
37832while ((attr = attrs.pop())) {
37833if (this.attributes[attr]) {
37834this.attributes[attr] = _t(this.attributes[attr]);
37835}
37836}
37837}
37838}
37839return QWeb;
37840});
37841;
37842/* /web/static/src/js/core/bus.js defined in bundle 'web.assets_common' */
37843odoo.define('web.Bus', function(require) {
37844"use strict";
37845var Class = require('web.Class');
37846var mixins = require('web.mixins');
37847return Class.extend(mixins.EventDispatcherMixin, {
37848init: function(parent) {
37849mixins.EventDispatcherMixin.init.call(this);
37850this.setParent(parent);
37851},
37852});
37853});
37854;
37855/* /web/static/src/js/services/core.js defined in bundle 'web.assets_common' */
37856odoo.define('web.core', function(require) {
37857"use strict";
37858var Bus = require('web.Bus');
37859var Class = require('web.Class');
37860var config = require('web.config');
37861var QWeb = require('web.QWeb');
37862var Registry = require('web.Registry');
37863var translation = require('web.translation');
37864var bus = new Bus();
37865_.each('click,dblclick,keydown,keypress,keyup'.split(','), function(evtype) {
37866$('html').on(evtype, function(ev) {
37867bus.trigger(evtype, ev);
37868});
37869});
37870_.each('resize,scroll'.split(','), function(evtype) {
37871$(window).on(evtype, function(ev) {
37872bus.trigger(evtype, ev);
37873});
37874});
37875return {
37876qweb: new QWeb(config.debug),
37877Class: Class,
37878bus: bus,
37879main_bus: new Bus(),
37880_t: translation._t,
37881_lt: translation._lt,
37882action_registry: new Registry(),
37883crash_registry: new Registry(),
37884search_filters_registry: new Registry(),
37885search_widgets_registry: new Registry(),
37886serviceRegistry: new Registry(),
37887csrf_token: odoo.csrf_token,
37888};
37889});
37890;
37891/* /web/static/src/js/core/dialog.js defined in bundle 'web.assets_common' */
37892odoo.define('web.Dialog', function(require) {
37893"use strict";
37894var core = require('web.core');
37895var dom = require('web.dom');
37896var Widget = require('web.Widget');
37897var QWeb = core.qweb;
37898var _t = core._t;
37899var Dialog = Widget.extend({
37900tagName: 'main',
37901xmlDependencies: ['/web/static/src/xml/dialog.xml'],
37902custom_events: _.extend({}, Widget.prototype.custom_events, {
37903focus_control_button: '_onFocusControlButton',
37904}),
37905events: _.extend({}, Widget.prototype.events, {
37906'keydown .modal-footer button': '_onFooterButtonKeyDown',
37907}),
37908init: function(parent, options) {
37909this._super(parent);
37910this._opened = $.Deferred();
37911options = _.defaults(options || {}, {
37912title: _t('Odoo'),
37913subtitle: '',
37914size: 'large',
37915fullscreen: false,
37916dialogClass: '',
37917$content: false,
37918buttons: [{
37919text: _t("Ok"),
37920close: true
37921}],
37922technical: true,
37923});
37924this.$content = options.$content;
37925this.title = options.title;
37926this.subtitle = options.subtitle;
37927this.fullscreen = options.fullscreen;
37928this.dialogClass = options.dialogClass;
37929this.size = options.size;
37930this.buttons = options.buttons;
37931this.technical = options.technical;
37932},
37933willStart: function() {
37934var self = this;
37935return this._super.apply(this, arguments).then(function() {
37936self.$modal = $(QWeb.render('Dialog', {
37937fullscreen: self.fullscreen,
37938title: self.title,
37939subtitle: self.subtitle,
37940technical: self.technical,
37941}));
37942switch (self.size) {
37943case 'large':
37944self.$modal.find('.modal-dialog').addClass('modal-lg');
37945break;
37946case 'small':
37947self.$modal.find('.modal-dialog').addClass('modal-sm');
37948break;
37949}
37950self.$footer = self.$modal.find(".modal-footer");
37951self.set_buttons(self.buttons);
37952self.$modal.on('hidden.bs.modal', _.bind(self.destroy, self));
37953});
37954},
37955renderElement: function() {
37956this._super();
37957if (this.$content) {
37958this.setElement(this.$content);
37959}
37960this.$el.addClass('modal-body ' + this.dialogClass);
37961},
37962set_buttons: function(buttons) {
37963var self = this;
37964this.$footer.empty();
37965_.each(buttons, function(buttonData) {
37966var $button = dom.renderButton({
37967attrs: {
37968class: buttonData.classes || (buttons.length > 1 ? 'btn-secondary' : 'btn-primary'),
37969disabled: buttonData.disabled,
37970},
37971icon: buttonData.icon,
37972text: buttonData.text,
37973});
37974$button.on('click', function(e) {
37975var def;
37976if (buttonData.click) {
37977def = buttonData.click.call(self, e);
37978}
37979if (buttonData.close) {
37980$.when(def).always(self.close.bind(self));
37981}
37982});
37983if (self.technical) {
37984self.$footer.append($button);
37985} else {
37986self.$footer.prepend($button);
37987}
37988});
37989},
37990set_title: function(title, subtitle) {
37991this.title = title || "";
37992if (subtitle !== undefined) {
37993this.subtitle = subtitle || "";
37994}
37995var $title = this.$modal.find('.modal-title').first();
37996var $subtitle = $title.find('.o_subtitle').detach();
37997$title.html(this.title);
37998$subtitle.html(this.subtitle).appendTo($title);
37999return this;
38000},
38001opened: function(handler) {
38002return (handler) ? this._opened.then(handler) : this._opened;
38003},
38004open: function(options) {
38005$('.tooltip').remove();
38006var self = this;
38007this.appendTo($('<div/>')).then(function() {
38008self.$modal.find(".modal-body").replaceWith(self.$el);
38009self.$modal.attr('open', true);
38010self.$modal.removeAttr("aria-hidden");
38011self.$modal.modal('show');
38012self._opened.resolve();
38013if (options && options.shouldFocusButtons) {
38014self._onFocusControlButton();
38015}
38016});
38017return self;
38018},
38019close: function() {
38020this.destroy();
38021},
38022destroy: function(options) {
38023if (!this.__closed) {
38024this.__closed = true;
38025this.trigger('closed', options);
38026}
38027if (this.isDestroyed()) {
38028return;
38029}
38030var isFocusSet = this._focusOnClose();
38031this._super();
38032$('.tooltip').remove();
38033if (this.$modal) {
38034this.$modal.modal('hide');
38035this.$modal.remove();
38036}
38037var modals = $('body > .modal').filter(':visible');
38038if (modals.length) {
38039if (!isFocusSet) {
38040modals.last().focus();
38041}
38042$('body').addClass('modal-open');
38043}
38044},
38045rebindButtonBehavior: function() {
38046this.$footer.on('keydown', this._onFooterButtonKeyDown);
38047},
38048_focusOnClose: function() {
38049return false;
38050},
38051_onFocusControlButton: function(e) {
38052if (this.$footer) {
38053if (e) {
38054e.stopPropagation();
38055}
38056this.$footer.find('.btn-primary:visible:first()').focus();
38057}
38058},
38059_onFooterButtonKeyDown: function(e) {
38060switch (e.which) {
38061case $.ui.keyCode.TAB:
38062if (!e.shiftKey && e.target.classList.contains("btn-primary")) {
38063e.preventDefault();
38064var $primaryButton = $(e.target);
38065$primaryButton.tooltip({
38066delay: {
38067show: 200,
38068hide: 0
38069},
38070title: function() {
38071return QWeb.render('FormButton.tooltip', {
38072title: $primaryButton.text().toUpperCase()
38073});
38074},
38075trigger: 'manual',
38076});
38077$primaryButton.tooltip('show');
38078}
38079break;
38080}
38081}
38082});
38083Dialog.alert = function(owner, message, options) {
38084var buttons = [{
38085text: _t("Ok"),
38086close: true,
38087click: options && options.confirm_callback,
38088}];
38089return new Dialog(owner,_.extend({
38090size: 'medium',
38091buttons: buttons,
38092$content: $('<main/>', {
38093role: 'alert',
38094text: message,
38095}),
38096title: _t("Alert"),
38097}, options)).open({
38098shouldFocusButtons: true
38099});
38100}
38101;
38102Dialog.confirm = function(owner, message, options) {
38103var buttons = [{
38104text: _t("Ok"),
38105classes: 'btn-primary',
38106close: true,
38107click: options && options.confirm_callback,
38108}, {
38109text: _t("Cancel"),
38110close: true,
38111click: options && options.cancel_callback
38112}];
38113return new Dialog(owner,_.extend({
38114size: 'medium',
38115buttons: buttons,
38116$content: $('<main/>', {
38117role: 'alert',
38118text: message,
38119}),
38120title: _t("Confirmation"),
38121}, options)).open({
38122shouldFocusButtons: true
38123});
38124}
38125;
38126Dialog.safeConfirm = function(owner, message, options) {
38127var $checkbox = dom.renderCheckbox({
38128text: options && options.securityMessage || _t("I am sure about this."),
38129}).addClass('mb0');
38130var $securityCheck = $('<div/>', {
38131class: 'alert alert-' + (options && options.securityLevel || 'warning') + ' mt8 mb0',
38132}).prepend($checkbox);
38133var $content;
38134if (options && options.$content) {
38135$content = options.$content;
38136delete options.$content;
38137} else {
38138$content = $('<div>', {
38139text: message,
38140});
38141}
38142$content = $('<main/>', {
38143role: 'alert'
38144}).append($content, $securityCheck);
38145var buttons = [{
38146text: _t("Ok"),
38147classes: 'btn-primary o_safe_confirm_button',
38148close: true,
38149click: options && options.confirm_callback,
38150disabled: true,
38151}, {
38152text: _t("Cancel"),
38153close: true,
38154click: options && options.cancel_callback
38155}];
38156var dialog = new Dialog(owner,_.extend({
38157size: 'medium',
38158buttons: buttons,
38159$content: $content,
38160title: _t("Confirmation"),
38161}, options));
38162dialog.opened(function() {
38163var $button = dialog.$footer.find('.o_safe_confirm_button');
38164$securityCheck.on('click', 'input[type="checkbox"]', function(ev) {
38165$button.prop('disabled', !$(ev.currentTarget).prop('checked'));
38166});
38167});
38168return dialog.open();
38169}
38170;
38171return Dialog;
38172});
38173;
38174/* /web/static/src/js/core/local_storage.js defined in bundle 'web.assets_common' */
38175odoo.define('web.local_storage', function(require) {
38176'use strict';
38177var RamStorage = require('web.RamStorage');
38178var mixins = require('web.mixins');
38179var storage;
38180var localStorage = window.localStorage;
38181try {
38182var uid = new Date();
38183localStorage.setItem(uid, uid);
38184localStorage.removeItem(uid);
38185storage = (function() {
38186var storage = Object.create(_.extend({
38187getItem: localStorage.getItem.bind(localStorage),
38188setItem: localStorage.setItem.bind(localStorage),
38189removeItem: localStorage.removeItem.bind(localStorage),
38190clear: localStorage.clear.bind(localStorage),
38191}, mixins.EventDispatcherMixin));
38192storage.init();
38193$(window).on('storage', function(e) {
38194var key = e.originalEvent.key;
38195var newValue = e.originalEvent.newValue;
38196try {
38197JSON.parse(newValue);
38198if (localStorage.getItem(key) === newValue) {
38199storage.trigger('storage', {
38200key: key,
38201newValue: newValue,
38202});
38203}
38204} catch (error) {}
38205});
38206return storage;
38207}
38208)();
38209} catch (exception) {
38210console.warn('Fail to load localStorage');
38211storage = new RamStorage();
38212}
38213return storage;
38214});
38215;
38216/* /web/static/src/js/services/local_storage_service.js defined in bundle 'web.assets_common' */
38217odoo.define('web.LocalStorageService', function(require) {
38218'use strict';
38219var AbstractStorageService = require('web.AbstractStorageService');
38220var core = require('web.core');
38221var localStorage = require('web.local_storage');
38222var LocalStorageService = AbstractStorageService.extend({
38223storage: localStorage,
38224});
38225core.serviceRegistry.add('local_storage', LocalStorageService);
38226return LocalStorageService;
38227});
38228;
38229/* /web/static/src/js/core/session_storage.js defined in bundle 'web.assets_common' */
38230odoo.define('web.sessionStorage', function(require) {
38231'use strict';
38232var RamStorage = require('web.RamStorage');
38233var mixins = require('web.mixins');
38234var storage;
38235var sessionStorage = window.sessionStorage;
38236try {
38237var uid = new Date();
38238sessionStorage.setItem(uid, uid);
38239sessionStorage.removeItem(uid);
38240storage = (function() {
38241var storage = Object.create(_.extend({
38242getItem: sessionStorage.getItem.bind(sessionStorage),
38243setItem: sessionStorage.setItem.bind(sessionStorage),
38244removeItem: sessionStorage.removeItem.bind(sessionStorage),
38245clear: sessionStorage.clear.bind(sessionStorage),
38246}, mixins.EventDispatcherMixin));
38247storage.init();
38248$(window).on('storage', function(e) {
38249var key = e.originalEvent.key;
38250var newValue = e.originalEvent.newValue;
38251try {
38252JSON.parse(newValue);
38253if (sessionStorage.getItem(key) === newValue) {
38254storage.trigger('storage', {
38255key: key,
38256newValue: newValue,
38257});
38258}
38259} catch (error) {}
38260});
38261return storage;
38262}
38263)();
38264} catch (exception) {
38265console.warn('Fail to load sessionStorage');
38266storage = new RamStorage();
38267}
38268return storage;
38269});
38270;
38271/* /web/static/src/js/services/session_storage_service.js defined in bundle 'web.assets_common' */
38272odoo.define('web.SessionStorageService', function(require) {
38273'use strict';
38274var AbstractStorageService = require('web.AbstractStorageService');
38275var core = require('web.core');
38276var sessionStorage = require('web.sessionStorage');
38277var SessionStorageService = AbstractStorageService.extend({
38278storage: sessionStorage,
38279});
38280core.serviceRegistry.add('session_storage', SessionStorageService);
38281return SessionStorageService;
38282});
38283;
38284/* /web/static/src/js/core/ram_storage.js defined in bundle 'web.assets_common' */
38285odoo.define('web.RamStorage', function(require) {
38286'use strict';
38287var Class = require('web.Class');
38288var mixins = require('web.mixins');
38289var RamStorage = Class.extend(mixins.EventDispatcherMixin, {
38290init: function() {
38291mixins.EventDispatcherMixin.init.call(this);
38292if (!this.storage) {
38293this.clear();
38294}
38295},
38296clear: function() {
38297this.storage = Object.create(null);
38298},
38299getItem: function(key) {
38300return this.storage[key];
38301},
38302removeItem: function(key) {
38303delete this.storage[key];
38304this.trigger('storage', {
38305key: key,
38306newValue: null
38307});
38308},
38309setItem: function(key, value) {
38310this.storage[key] = value;
38311this.trigger('storage', {
38312key: key,
38313newValue: value
38314});
38315},
38316});
38317return RamStorage;
38318});
38319;
38320/* /web/static/src/js/widgets/rainbow_man.js defined in bundle 'web.assets_common' */
38321odoo.define('web.RainbowMan', function(require) {
38322"use strict";
38323var Widget = require('web.Widget');
38324var core = require('web.core');
38325var _t = core._t;
38326var RainbowMan = Widget.extend({
38327template: 'rainbow_man.notification',
38328xmlDependencies: ['/web/static/src/xml/rainbow_man.xml'],
38329init: function(options) {
38330this._super.apply(this, arguments);
38331var rainbowDelay = {
38332slow: 4500,
38333medium: 3500,
38334fast: 2000,
38335no: false
38336};
38337this.options = _.defaults(options || {}, {
38338fadeout: 'medium',
38339img_url: '/web/static/src/img/smile.svg',
38340message: _t('Well Done!'),
38341});
38342this.delay = rainbowDelay[this.options.fadeout];
38343},
38344start: function() {
38345var self = this;
38346core.bus.on('click', this, function(ev) {
38347if (ev.originalEvent && ev.target.className.indexOf('o_reward') === -1) {
38348this.destroy();
38349}
38350});
38351if (this.delay) {
38352setTimeout(function() {
38353self.$el.addClass('o_reward_fading');
38354setTimeout(function() {
38355self.destroy();
38356}, 600);
38357}, this.delay);
38358}
38359this.$('.o_reward_msg_content').append(this.options.message);
38360return this._super.apply(this, arguments);
38361}
38362});
38363return RainbowMan;
38364});
38365;
38366/* /web/static/src/js/widgets/colorpicker.js defined in bundle 'web.assets_common' */
38367odoo.define('web.colorpicker', function(require) {
38368'use strict';
38369var core = require('web.core');
38370var utils = require('web.utils');
38371var Dialog = require('web.Dialog');
38372var _t = core._t;
38373var Colorpicker = Dialog.extend({
38374xmlDependencies: (Dialog.prototype.xmlDependencies || []).concat(['/web/static/src/xml/colorpicker.xml']),
38375template: 'web.colorpicker',
38376events: _.extend({}, Dialog.prototype.events || {}, {
38377'mousedown .o_color_pick_area': '_onMouseDownPicker',
38378'mousedown .o_color_slider': '_onMouseDownSlider',
38379'mousedown .o_opacity_slider': '_onMouseDownOpacitySlider',
38380'change .o_color_picker_inputs': '_onChangeInputs',
38381}),
38382init: function(parent, options) {
38383options = options || {};
38384this._super(parent, _.extend({
38385size: 'medium',
38386title: _t('Pick a color'),
38387buttons: [{
38388text: _t('Choose'),
38389classes: 'btn-primary',
38390close: true,
38391click: this._onFinalPick.bind(this)
38392}, {
38393text: _t('Discard'),
38394close: true
38395}, ],
38396}, options));
38397this.pickerFlag = false;
38398this.sliderFlag = false;
38399this.opacitySliderFlag = false;
38400this.colorComponents = {};
38401var self = this;
38402var $body = $(document.body);
38403$body.on('mousemove.colorpicker', _.throttle(function(ev) {
38404self._onMouseMovePicker(ev);
38405self._onMouseMoveSlider(ev);
38406self._onMouseMoveOpacitySlider(ev);
38407}, 10));
38408$body.on('mouseup.colorpicker', _.throttle(function(ev) {
38409self.pickerFlag = false;
38410self.sliderFlag = false;
38411self.opacitySliderFlag = false;
38412}, 10));
38413this.options = _.clone(options);
38414},
38415start: function() {
38416this.$colorpickerArea = this.$('.o_color_pick_area');
38417this.$colorpickerPointer = this.$('.o_picker_pointer');
38418this.$colorSlider = this.$('.o_color_slider');
38419this.$colorSliderPointer = this.$('.o_slider_pointer');
38420this.$opacitySlider = this.$('.o_opacity_slider');
38421this.$opacitySliderPointer = this.$('.o_opacity_pointer');
38422var defaultColor = this.options.defaultColor || '#FF0000';
38423var rgba = defaultColor.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);
38424if (rgba) {
38425if (rgba[4] === undefined) {
38426rgba[4] = 1;
38427}
38428this._updateRgba(parseInt(rgba[1]), parseInt(rgba[2]), parseInt(rgba[3]), Math.round(parseFloat(rgba[4] * 100)));
38429} else {
38430this._updateHex(defaultColor);
38431this._updateOpacity(100);
38432}
38433this.opened().then(this._updateUI.bind(this));
38434return this._super.apply(this, arguments);
38435},
38436destroy: function() {
38437this._super.apply(this, arguments);
38438$(document.body).off('.colorpicker');
38439},
38440_updateUI: function() {
38441var self = this;
38442_.each(this.colorComponents, function(value, color) {
38443self.$(_.str.sprintf('.o_%s_input', color)).val(value);
38444});
38445this.$('.o_color_preview').css('background-color', this.colorComponents.cssColor);
38446this.$colorpickerArea.css('background-color', _.str.sprintf('hsl(%s, 100%%, 50%%)', this.colorComponents.hue));
38447var top = (100 - this.colorComponents.lightness) * this.$colorpickerArea.height() / 100;
38448var left = this.colorComponents.saturation * this.$colorpickerArea.width() / 100;
38449this.$colorpickerPointer.css({
38450top: (top - 5) + 'px',
38451left: (left - 5) + 'px',
38452});
38453var height = this.$colorSlider.height();
38454var y = this.colorComponents.hue * height / 360;
38455this.$colorSliderPointer.css('top', Math.round(y - 2));
38456var heightOpacity = this.$opacitySlider.height();
38457var z = heightOpacity * (1 - this.colorComponents.opacity / 100.0);
38458this.$opacitySliderPointer.css('top', Math.round(z - 2));
38459this.$opacitySlider.css('background', 'linear-gradient(' + this.colorComponents.hex + ' 0%, transparent 100%)');
38460},
38461_updateHex: function(hex) {
38462var rgb = Colorpicker.prototype.convertHexToRgb(hex);
38463if (!rgb) {
38464return;
38465}
38466_.extend(this.colorComponents, {
38467hex: hex
38468}, rgb, Colorpicker.prototype.convertRgbToHsl(rgb.red, rgb.green, rgb.blue));
38469this._updateCssColor();
38470},
38471_updateRgba: function(r, g, b, a) {
38472var hex = Colorpicker.prototype.convertRgbToHex(r, g, b);
38473if (!hex) {
38474return;
38475}
38476_.extend(this.colorComponents, {
38477red: r,
38478green: g,
38479blue: b
38480}, a === undefined ? {} : {
38481opacity: a
38482}, hex, Colorpicker.prototype.convertRgbToHsl(r, g, b));
38483this._updateCssColor();
38484},
38485_updateHsl: function(h, s, l) {
38486var rgb = Colorpicker.prototype.convertHslToRgb(h, s, l);
38487if (!rgb) {
38488return;
38489}
38490_.extend(this.colorComponents, {
38491hue: h,
38492saturation: s,
38493lightness: l
38494}, rgb, Colorpicker.prototype.convertRgbToHex(rgb.red, rgb.green, rgb.blue));
38495this._updateCssColor();
38496},
38497_updateOpacity: function(a) {
38498if (a < 0 || a > 100) {
38499return;
38500}
38501_.extend(this.colorComponents, {
38502opacity: a
38503});
38504this._updateCssColor();
38505},
38506_updateCssColor: function() {
38507var cssColor = this.colorComponents.hex;
38508if (this.colorComponents.opacity !== 100) {
38509cssColor = _.str.sprintf('rgba(%s, %s, %s, %s)', this.colorComponents.red, this.colorComponents.green, this.colorComponents.blue, this.colorComponents.opacity / 100);
38510}
38511_.extend(this.colorComponents, {
38512cssColor: cssColor
38513});
38514},
38515_onMouseDownPicker: function(ev) {
38516this.pickerFlag = true;
38517this._onMouseMovePicker(ev);
38518},
38519_onMouseMovePicker: function(ev) {
38520if (!this.pickerFlag) {
38521return;
38522}
38523var offset = this.$colorpickerArea.offset();
38524var top = ev.pageY - offset.top;
38525var left = ev.pageX - offset.left;
38526var saturation = Math.round(100 * left / this.$colorpickerArea.width());
38527var lightness = Math.round(100 * (this.$colorpickerArea.height() - top) / this.$colorpickerArea.height());
38528saturation = utils.confine(saturation, 0, 100);
38529lightness = utils.confine(lightness, 0, 100);
38530this._updateHsl(this.colorComponents.hue, saturation, lightness);
38531this._updateUI();
38532},
38533_onMouseDownSlider: function(ev) {
38534this.sliderFlag = true;
38535this._onMouseMoveSlider(ev);
38536},
38537_onMouseMoveSlider: function(ev) {
38538if (!this.sliderFlag) {
38539return;
38540}
38541var y = ev.pageY - this.$colorSlider.offset().top;
38542var hue = Math.round(360 * y / this.$colorSlider.height());
38543hue = utils.confine(hue, 0, 360);
38544this._updateHsl(hue, this.colorComponents.saturation, this.colorComponents.lightness);
38545this._updateUI();
38546},
38547_onMouseDownOpacitySlider: function(ev) {
38548this.opacitySliderFlag = true;
38549this._onMouseMoveOpacitySlider(ev);
38550},
38551_onMouseMoveOpacitySlider: function(ev) {
38552if (!this.opacitySliderFlag) {
38553return;
38554}
38555var y = ev.pageY - this.$opacitySlider.offset().top;
38556var opacity = Math.round(100 * (1 - y / this.$opacitySlider.height()));
38557opacity = utils.confine(opacity, 0, 100);
38558this._updateOpacity(opacity);
38559this._updateUI();
38560},
38561_onChangeInputs: function(ev) {
38562switch ($(ev.target).data('colorMethod')) {
38563case 'hex':
38564this._updateHex(this.$('.o_hex_input').val());
38565break;
38566case 'rgb':
38567this._updateRgba(parseInt(this.$('.o_red_input').val()), parseInt(this.$('.o_green_input').val()), parseInt(this.$('.o_blue_input').val()));
38568break;
38569case 'hsl':
38570this._updateHsl(parseInt(this.$('.o_hue_input').val()), parseInt(this.$('.o_saturation_input').val()), parseInt(this.$('.o_lightness_input').val()));
38571break;
38572case 'opacity':
38573this._updateOpacity(parseInt(this.$('.o_opacity_input').val()));
38574break;
38575}
38576this._updateUI();
38577},
38578_onFinalPick: function() {
38579this.trigger_up('colorpicker:saved', this.colorComponents);
38580},
38581convertHexToRgb: function(hex) {
38582if (!/^#[0-9A-F]{6}$/i.test(hex)) {
38583return false;
38584}
38585return {
38586red: parseInt(hex.substr(1, 2), 16),
38587green: parseInt(hex.substr(3, 2), 16),
38588blue: parseInt(hex.substr(5, 2), 16),
38589};
38590},
38591convertRgbToHsl: function(r, g, b) {
38592if (typeof (r) !== 'number' || isNaN(r) || r < 0 || r > 255 || typeof (g) !== 'number' || isNaN(g) || g < 0 || g > 255 || typeof (b) !== 'number' || isNaN(b) || b < 0 || b > 255) {
38593return false;
38594}
38595var red = r / 255;
38596var green = g / 255;
38597var blue = b / 255;
38598var maxColor = Math.max(red, green, blue);
38599var minColor = Math.min(red, green, blue);
38600var delta = maxColor - minColor;
38601var hue = 0;
38602var saturation = 0;
38603var lightness = (maxColor + minColor) / 2;
38604if (delta) {
38605if (maxColor === red) {
38606hue = (green - blue) / delta;
38607}
38608if (maxColor === green) {
38609hue = 2 + (blue - red) / delta;
38610}
38611if (maxColor === blue) {
38612hue = 4 + (red - green) / delta;
38613}
38614if (maxColor) {
38615saturation = delta / (1 - Math.abs(2 * lightness - 1));
38616}
38617}
38618hue = 60 * hue | 0;
38619return {
38620hue: hue < 0 ? hue += 360 : hue,
38621saturation: (saturation * 100) | 0,
38622lightness: (lightness * 100) | 0,
38623};
38624},
38625convertHslToRgb: function(h, s, l) {
38626if (typeof (h) !== 'number' || isNaN(h) || h < 0 || h > 360 || typeof (s) !== 'number' || isNaN(s) || s < 0 || s > 100 || typeof (l) !== 'number' || isNaN(l) || l < 0 || l > 100) {
38627return false;
38628}
38629var huePrime = h / 60;
38630var saturation = s / 100;
38631var lightness = l / 100;
38632var chroma = saturation * (1 - Math.abs(2 * lightness - 1));
38633var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
38634var lightnessAdjustment = lightness - chroma / 2;
38635var precision = 255;
38636chroma = (chroma + lightnessAdjustment) * precision | 0;
38637secondComponent = (secondComponent + lightnessAdjustment) * precision | 0;
38638lightnessAdjustment = lightnessAdjustment * precision | 0;
38639if (huePrime >= 0 && huePrime < 1) {
38640return {
38641red: chroma,
38642green: secondComponent,
38643blue: lightnessAdjustment
38644};
38645}
38646if (huePrime >= 1 && huePrime < 2) {
38647return {
38648red: secondComponent,
38649green: chroma,
38650blue: lightnessAdjustment
38651};
38652}
38653if (huePrime >= 2 && huePrime < 3) {
38654return {
38655red: lightnessAdjustment,
38656green: chroma,
38657blue: secondComponent
38658};
38659}
38660if (huePrime >= 3 && huePrime < 4) {
38661return {
38662red: lightnessAdjustment,
38663green: secondComponent,
38664blue: chroma
38665};
38666}
38667if (huePrime >= 4 && huePrime < 5) {
38668return {
38669red: secondComponent,
38670green: lightnessAdjustment,
38671blue: chroma
38672};
38673}
38674if (huePrime >= 5 && huePrime <= 6) {
38675return {
38676red: chroma,
38677green: lightnessAdjustment,
38678blue: secondComponent
38679};
38680}
38681},
38682convertRgbToHex: function(r, g, b) {
38683if (typeof (r) !== 'number' || isNaN(r) || r < 0 || r > 255 || typeof (g) !== 'number' || isNaN(g) || g < 0 || g >
38683 255 || typeof (b) !== 'number' || isNaN(b) || b < 0 || b > 255) {
38684return false;
38685}
38686var red = r < 16 ? '0' + r.toString(16) : r.toString(16);
38687var green = g < 16 ? '0' + g.toString(16) : g.toString(16);
38688var blue = b < 16 ? '0' + b.toString(16) : b.toString(16);
38689return {
38690hex: _.str.sprintf('#%s%s%s', red, green, blue)
38691};
38692},
38693});
38694return Colorpicker;
38695});
38696;
38697/* /web_editor/static/lib/vkbeautify/vkbeautify.0.99.00.beta.js defined in bundle 'web.assets_common' */
38698(function() {
38699function createShiftArr(step) {
38700var space = '';
38701if (isNaN(parseInt(step))) {
38702space = step;
38703} else {
38704switch (step) {
38705case 1:
38706space = ' ';
38707break;
38708case 2:
38709space = '  ';
38710break;
38711case 3:
38712space = '   ';
38713break;
38714case 4:
38715space = '';
38716break;
38717case 5:
38718space = ' ';
38719break;
38720case 6:
38721space = '  ';
38722break;
38723case 7:
38724space = '   ';
38725break;
38726case 8:
38727space = '';
38728break;
38729case 9:
38730space = ' ';
38731break;
38732case 10:
38733space = '  ';
38734break;
38735case 11:
38736space = '   ';
38737break;
38738case 12:
38739space = '';
38740break;
38741}
38742}
38743var shift = ['\n'];
38744for (ix = 0; ix < 100; ix++) {
38745shift.push(shift[ix] + space);
38746}
38747return shift;
38748}
38749function vkbeautify() {
38750this.step = '';
38751this.shift = createShiftArr(this.step);
38752}
38753;vkbeautify.prototype.xml = function(text, step) {
38754var ar = text.replace(/>\s{0,}</g, "><").replace(/</g, "~::~<").replace(/\s*xmlns\:/g, "~::~xmlns:").replace(/\s*xmlns\=/g, "~::~xmlns=").split('~::~')
38755  , len = ar.length
38756  , inComment = false
38757  , deep = 0
38758  , str = ''
38759  , ix = 0
38760  , shift = step ? createShiftArr(step) : this.shift;
38761for (ix = 0; ix < len; ix++) {
38762if (ar[ix].search(/<!/) > -1) {
38763str += shift[deep] + ar[ix];
38764inComment = true;
38765if (ar[ix].search(/-->/) > -1 || ar[ix].search(/\]>/) > -1 || ar[ix].search(/!DOCTYPE/) > -1) {
38766inComment = false;
38767}
38768} else if (ar[ix].search(/-->/) > -1 || ar[ix].search(/\]>/) > -1) {
38769str += ar[ix];
38770inComment = false;
38771} else if (/^<\w/.exec(ar[ix - 1]) && /^<\/\w/.exec(ar[ix]) && /^<[\w:\-\.\,]+/.exec(ar[ix - 1]) == /^<\/[\w:\-\.\,]+/.exec(ar[ix])[0].replace('/', '')) {
38772str += ar[ix];
38773if (!inComment)
38774deep--;
38775} else if (ar[ix].search(/<\w/) > -1 && ar[ix].search(/<\//) == -1 && ar[ix].search(/\/>/) == -1) {
38776str = !inComment ? str += shift[deep++] + ar[ix] : str += ar[ix];
38777} else if (ar[ix].search(/<\w/) > -1 && ar[ix].search(/<\//) > -1) {
38778str = !inComment ? str += shift[deep] + ar[ix] : str += ar[ix];
38779} else if (ar[ix].search(/<\//) > -1) {
38780str = !inComment ? str += shift[--deep] + ar[ix] : str += ar[ix];
38781} else if (ar[ix].search(/\/>/) > -1) {
38782str = !inComment ? str += shift[deep] + ar[ix] : str += ar[ix];
38783} else if (ar[ix].search(/<\?/) > -1) {
38784str += shift[deep] + ar[ix];
38785} else if (ar[ix].search(/xmlns\:/) > -1 || ar[ix].search(/xmlns\=/) > -1) {
38786str += shift[deep] + ar[ix];
38787} else {
38788str += ar[ix];
38789}
38790}
38791return (str[0] == '\n') ? str.slice(1) : str;
38792}
38793vkbeautify.prototype.json = function(text, step) {
38794var step = step ? step : this.step;
38795if (typeof JSON === 'undefined')
38796return text;
38797if (typeof text === "string")
38798return JSON.stringify(JSON.parse(text), null, step);
38799if (typeof text === "object")
38800return JSON.stringify(text, null, step);
38801return text;
38802}
38803vkbeautify.prototype.css = function(text, step) {
38804var ar = text.replace(/\s{1,}/g, ' ').replace(/\{/g, "{~::~").replace(/\}/g, "~::~}~::~").replace(/\;/g, ";~::~").replace(/\/\*/g, "~::~/*").replace(/\*\//g, "*/~::~").replace(/~::~\s{0,}~::~/g, "~::~").split('~::~')
38805  , len = ar.length
38806  , deep = 0
38807  , str = ''
38808  , ix = 0
38809  , shift = step ? createShiftArr(step) : this.shift;
38810for (ix = 0; ix < len; ix++) {
38811if (/\{/.exec(ar[ix])) {
38812str += shift[deep++] + ar[ix];
38813} else if (/\}/.exec(ar[ix])) {
38814str += shift[--deep] + ar[ix];
38815} else if (/\*\\/.exec(ar[ix])) {
38816str += shift[deep] + ar[ix];
38817} else {
38818str += shift[deep] + ar[ix];
38819}
38820}
38821return str.replace(/^\n{1,}/, '');
38822}
38823function isSubquery(str, parenthesisLevel) {
38824return parenthesisLevel - (str.replace(/\(/g, '').length - str.replace(/\)/g, '').length)
38825}
38826function split_sql(str, tab) {
38827return str.replace(/\s{1,}/g, " ").replace(/ AND /ig, "~::~" + tab + tab + "AND ").replace(/ BETWEEN /ig, "~::~" + tab + "BETWEEN ").replace(/ CASE /ig, "~::~" + tab + "CASE ").replace(/ ELSE /ig, "~::~" + tab + "ELSE ").replace(/ END /ig, "~::~" + tab + "END ").replace(/ FROM /ig, "~::~FROM ").replace(/ GROUP\s{1,}BY/ig, "~::~GROUP BY ").replace(/ HAVING /ig, "~::~HAVING ").replace(/ IN /ig, " IN ").replace(/ JOIN /ig, "~::~JOIN ").replace(/ CROSS~::~{1,}JOIN /ig, "~::~CROSS JOIN ").replace(/ INNER~::~{1,}JOIN /ig, "~::~INNER JOIN ").replace(/ LEFT~::~{1,}JOIN /ig, "~::~LEFT JOIN ").replace(/ RIGHT~::~{1,}JOIN /ig, "~::~RIGHT JOIN ").replace(/ ON /ig, "~::~" + tab + "ON ").replace(/ OR /ig, "~::~" + tab + tab + "OR ").replace(/ ORDER\s{1,}BY/ig, "~::~ORDER BY ").replace(/ OVER /ig, "~::~" + tab + "OVER ").replace(/\(\s{0,}SELECT /ig, "~::~(SELECT ").replace(/\)\s{0,}SELECT /ig, ")~::~SELECT ").replace(/ THEN /ig, " THEN~::~" + tab + "").replace(/ UNION /ig, "~::~UNION~::~").replace(/ USING /ig, "~::~USING ").replace(/ WHEN /ig, "~::~" + tab + "WHEN ").replace(/ WHERE /ig, "~::~WHERE ").replace(/ WITH /ig, "~::~WITH ").replace(/ ALL /ig, " ALL ").replace(/ AS /ig, " AS ").replace(/ ASC /ig, " ASC ").replace(/ DESC /ig, " DESC ").replace(/ DISTINCT /ig, " DISTINCT ").replace(/ EXISTS /ig, " EXISTS ").replace(/ NOT /ig, " NOT ").replace(/ NULL /ig, " NULL ").replace(/ LIKE /ig, " LIKE ").replace(/\s{0,}SELECT /ig, "SELECT ").replace(/\s{0,}UPDATE /ig, "UPDATE ").replace(/ SET /ig, " SET ").replace(/~::~{1,}/g, "~::~").split('~::~');
38828}
38829vkbeautify.prototype.sql = function(text, step) {
38830var ar_by_quote = text.replace(/\s{1,}/g, " ").replace(/\'/ig, "~::~\'").split('~::~')
38831  , len = ar_by_quote.length
38832  , ar = []
38833  , deep = 0
38834  , tab = this.step
38835  , inComment = true
38836  , inQuote = false
38837  , parenthesisLevel = 0
38838  , str = ''
38839  , ix = 0
38840  , shift = step ? createShiftArr(step) : this.shift;
38841;for (ix = 0; ix < len; ix++) {
38842if (ix % 2) {
38843ar = ar.concat(ar_by_quote[ix]);
38844} else {
38845ar = ar.concat(split_sql(ar_by_quote[ix], tab));
38846}
38847}
38848len = ar.length;
38849for (ix = 0; ix < len; ix++) {
38850parenthesisLevel = isSubquery(ar[ix], parenthesisLevel);
38851if (/\s{0,}\s{0,}SELECT\s{0,}/.exec(ar[ix])) {
38852ar[ix] = ar[ix].replace(/\,/g, ",\n" + tab + tab + "")
38853}
38854if (/\s{0,}\s{0,}SET\s{0,}/.exec(ar[ix])) {
38855ar[ix] = ar[ix].replace(/\,/g, ",\n" + tab + tab + "")
38856}
38857if (/\s{0,}\(\s{0,}SELECT\s{0,}/.exec(ar[ix])) {
38858deep++;
38859str += shift[deep] + ar[ix];
38860} else if (/\'/.exec(ar[ix])) {
38861if (parenthesisLevel < 1 && deep) {
38862deep--;
38863}
38864str += ar[ix];
38865} else {
38866str += shift[deep] + ar[ix];
38867if (parenthesisLevel < 1 && deep) {
38868deep--;
38869}
38870}
38871var junk = 0;
38872}
38873str = str.replace(/^\n{1,}/, '').replace(/\n{1,}/g, "\n");
38874return str;
38875}
38876vkbeautify.prototype.xmlmin = function(text, preserveComments) {
38877var str = preserveComments ? text : text.replace(/\<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)\>/g, "").replace(/[ \r\n\t]{1,}xmlns/g, ' xmlns');
38878return str.replace(/>\s{0,}</g, "><");
38879}
38880vkbeautify.prototype.jsonmin = function(text) {
38881if (typeof JSON === 'undefined')
38882return text;
38883return JSON.stringify(JSON.parse(text), null, 0);
38884}
38885vkbeautify.prototype.cssmin = function(text, preserveComments) {
38886var str = preserveComments ? text : text.replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\//g, "");
38887return str.replace(/\s{1,}/g, ' ').replace(/\{\s{1,}/g, "{").replace(/\}\s{1,}/g, "}").replace(/\;\s{1,}/g, ";").replace(/\/\*\s{1,}/g, "/*").replace(/\*\/\s{1,}/g, "*/");
38888}
38889vkbeautify.prototype.sqlmin = function(text) {
38890return text.replace(/\s{1,}/g, " ").replace(/\s{1,}\(/, "(").replace(/\s{1,}\)/, ")");
38891}
38892window.vkbeautify = new vkbeautify();
38893}
38894)();
38895;
38896/* /web_editor/static/src/js/base.js defined in bundle 'web.assets_common' */
38897odoo.define('web_editor.base', function(require) {
38898'use strict';
38899var ajax = require('web.ajax');
38900var session = require('web.session');
38901var domReady = $.Deferred();
38902$(domReady.resolve.bind(domReady));
38903return {
38904cacheCssSelectors: {},
38905getCssSelectors: function(filter) {
38906if (this.cacheCssSelectors[filter]) {
38907return this.cacheCssSelectors[filter];
38908}
38909this.cacheCssSelectors[filter] = [];
38910var sheets = document.styleSheets;
38911for (var i = 0; i < sheets.length; i++) {
38912var rules;
38913try {
38914rules = sheets[i].rules || sheets[i].cssRules;
38915} catch (e) {
38916console.warn("Can't read the css rules of: " + sheets[i].href, e);
38917continue;
38918}
38919if (!rules) {
38920continue;
38921}
38922for (var r = 0; r < rules.length; r++) {
38923var selectorText = rules[r].selectorText;
38924if (!selectorText) {
38925continue;
38926}
38927var selectors = selectorText.split(/\s*,\s*/);
38928var data = null;
38929for (var s = 0; s < selectors.length; s++) {
38930var match = selectors[s].trim().match(filter);
38931if (!match) {
38932continue;
38933}
38934if (!data) {
38935data = {
38936selector: match[0],
38937css: rules[r].cssText.replace(/(^.*\{\s*)|(\s*\}\s*$)/g, ''),
38938names: [match[1]]
38939};
38940} else {
38941data.selector += (', ' + match[0]);
38942data.names.push(match[1]);
38943}
38944}
38945if (data) {
38946this.cacheCssSelectors[filter].push(data);
38947}
38948}
38949}
38950return this.cacheCssSelectors[filter];
38951},
38952fontIcons: [{
38953base: 'fa',
38954parser: /\.(fa-(?:\w|-)+)::?before/i
38955}],
38956computeFonts: _.once(function() {
38957var self = this;
38958_.each(this.fontIcons, function(data) {
38959data.cssData = self.getCssSelectors(data.parser);
38960data.alias = _.flatten(_.map(data.cssData, _.property('names')));
38961});
38962}),
38963ready: function() {
38964return $.when(domReady, session.is_bound, ajax.loadXML());
38965},
38966};
38967});
38968odoo.define('web_editor.context', function(require) {
38969'use strict';
38970function getContext(context) {
38971var html = document.documentElement;
38972return _.extend({
38973lang: (html.getAttribute('lang') || 'en_US').replace('-', '_'),
38974}, context || {});
38975}
38976function getExtraContext(context) {
38977var html = document.documentElement;
38978return _.extend(getContext(), {
38979editable: !!(html.dataset.editable || $('[data-oe-model]').length),
38980translatable: !!html.dataset.translatable,
38981edit_translations: !!html.dataset.edit_translations,
38982}, context || {});
38983}
38984return {
38985get: getContext,
38986getExtra: getExtraContext,
38987};
38988});
38989odoo.define('web_editor.ready', function(require) {
38990'use strict';
38991var base = require('web_editor.base');
38992return base.ready();
38993});
38994;
38995/* /web_editor/static/src/js/widgets/ace.js defined in bundle 'web.assets_common' */
38996odoo.define('web_editor.ace', function(require) {
38997'use strict';
38998var ajax = require('web.ajax');
38999var concurrency = require('web.concurrency');
39000var core = require('web.core');
39001var Dialog = require('web.Dialog');
39002var Widget = require('web.Widget');
39003var weContext = require('web_editor.context');
39004var localStorage = require('web.local_storage');
39005var session = require('web.session');
39006var _t = core._t;
39007function _getCheckReturn(isValid, errorLine, errorMessage) {
39008return {
39009isValid: isValid,
39010error: isValid ? null : {
39011line: errorLine,
39012message: errorMessage,
39013},
39014};
39015}
39016function checkXML(xml) {
39017if (typeof window.DOMParser != 'undefined') {
39018var xmlDoc = (new window.DOMParser()).parseFromString(xml, 'text/xml');
39019var error = xmlDoc.getElementsByTagName('parsererror');
39020if (error.length > 0) {
39021return _getCheckReturn(false, parseInt(error[0].innerHTML.match(/[Ll]ine[^\d]+(\d+)/)[1], 10), error[0].innerHTML);
39022}
39023} else if (typeof window.ActiveXObject != 'undefined' && new window.ActiveXObject('Microsoft.XMLDOM')) {
39024var xmlDocIE = new window.ActiveXObject('Microsoft.XMLDOM');
39025xmlDocIE.async = 'false';
39026xmlDocIE.loadXML(xml);
39027if (xmlDocIE.parseError.line > 0) {
39028return _getCheckReturn(false, xmlDocIE.parseError.line, xmlDocIE.parseError.reason);
39029}
39030}
39031return _getCheckReturn(true);
39032}
39033function formatXML(xml) {
39034if (/<script(?: [^>]*)?>[^<][\s\S]*<\/script>/i.test(xml)) {
39035return xml;
39036}
39037return window.vkbeautify.xml(xml, 4);
39038}
39039var checkSCSS = (function() {
39040var mapping = {
39041'{': '}',
39042'}': '{',
39043'(': ')',
39044')': '(',
39045'[': ']',
39046']': '[',
39047};
39048var openings = ['{', '(', '['];
39049var closings = ['}', ')', ']'];
39050return function(scss) {
39051var stack = [];
39052var line = 1;
39053for (var i = 0; i < scss.length; i++) {
39054if (_.contains(openings, scss[i])) {
39055stack.push(scss[i]);
39056} else if (_.contains(closings, scss[i])) {
39057if (stack.pop() !== mapping[scss[i]]) {
39058return _getCheckReturn(false, line, _t("Unexpected ") + scss[i]);
39059}
39060} else if (scss[i] === '\n') {
39061line++;
39062}
39063}
39064if (stack.length > 0) {
39065return _getCheckReturn(false, line, _t("Expected ") + mapping[stack.pop()]);
39066}
39067return _getCheckReturn(true);
39068}
39069;
39070}
39071)();
39072function formatSCSS(scss) {
39073return scss;
39074}
39075var ViewEditor = Widget.extend({
39076template: 'web_editor.ace_view_editor',
39077xmlDependencies: ['/web_editor/static/src/xml/ace.xml'],
39078jsLibs: ['/web/static/lib/ace/ace.js', ['/web/static/lib/ace/mode-xml.js', '/web/static/lib/ace/mode-scss.js', '/web/static/lib/ace/theme-monokai.js']],
39079events: {
39080'click .o_ace_type_switcher_choice': '_onTypeChoice',
39081'change .o_res_list': '_onResChange',
39082'click .js_include_bundles': '_onIncludeBundlesChange',
39083'click .js_include_all_scss': '_onIncludeAllSCSSChange',
39084'click button[data-action=save]': '_onSaveClick',
39085'click button[data-action=reset]': '_onResetClick',
39086'click button[data-action=format]': '_onFormatClick',
39087'click button[data-action=close]': '_onCloseClick',
39088},
39089init: function(parent, viewKey, options) {
39090this._super.apply(this, arguments);
39091this.viewKey = viewKey;
39092this.options = _.defaults({}, options, {
39093position: 'right',
39094doNotLoadViews: false,
39095doNotLoadSCSS: false,
39096includeBundles: false,
39097includeAllSCSS: false,
39098defaultBundlesRestriction: [],
39099});
39100this.resources = {
39101xml: {},
39102scss: {}
39103};
39104this.editingSessions = {
39105xml: {},
39106scss: {}
39107};
39108this.currentType = 'xml';
39109this.views = this.resources.xml;
39110this.scss = this.resources.scss;
39111},
39112willStart: function() {
39113return $.when(this._super.apply(this, arguments), ajax.loadLibs(this), this._loadResources());
39114},
39115start: function() {
39116this.$viewEditor = this.$('#ace-view-editor');
39117this.$typeSwitcherChoices = this.$('.o_ace_type_switcher_choice');
39118this.$typeSwitcherBtn = this.$('.o_ace_type_switcher > .dropdown-toggle');
39119this.$lists = {
39120xml: this.$('#ace-view-list'),
39121scss: this.$('#ace-scss-list')
39122};
39123this.$includeBundlesArea = this.$('.oe_include_bundles');
39124this.$includeAllSCSSArea = this.$('.o_include_all_scss');
39125this.$viewID = this.$('#ace-view-id > span');
39126this.$formatButton = this.$('button[data-action=format]');
39127this.$resetButton = this.$('button[data-action=reset]');
39128this.aceEditor = window.ace.edit(this.$viewEditor[0]);
39129this.aceEditor.setTheme('ace/theme/monokai');
39130this.$editor = this.$('.ace_editor');
39131var refX = 0;
39132var resizing = false;
39133var minWidth = 400;
39134var debounceStoreEditorWidth = _.debounce(storeEditorWidth, 500);
39135this._updateViewSelectDOM();
39136var initResID;
39137var initType;
39138if (this.options.initialResID) {
39139initResID = this.options.initialResID;
39140initType = (_.isString(initResID) && initResID[0] === '/') ? 'scss' : 'xml';
39141} else {
39142if (!this.options.doNotLoadSCSS) {
39143initResID = this.sortedSCSS[0][1][0].url;
39144initType = 'scss';
39145}
39146if (!this.options.doNotLoadViews) {
39147if (typeof this.viewKey === "number") {
39148initResID = this.viewKey;
39149} else {
39150var view = _.findWhere(this.views, {
39151xml_id: this.viewKey
39152});
39153if (!view) {
39154view = _.findWhere(this.views, {
39155key: this.viewKey
39156});
39157}
39158initResID = view.id;
39159}
39160initType = 'xml';
39161}
39162}
39163if (initResID) {
39164this._displayResource(initResID, initType);
39165}
39166if (!this.sortedViews.length || !this.sortedSCSS.length) {
39167_.defer((function() {
39168this._switchType(this.sortedViews.length ? 'xml' : 'scss');
39169this.$typeSwitcherBtn.parent('.btn-group').addClass('d-none');
39170}
39171).bind(this));
39172}
39173$(document).on('mouseup.ViewEditor', stopResizing.bind(this)).on('mousemove.Vie
39173wEditor', updateWidth.bind(this));
39174if (this.options.position === 'left') {
39175this.$('.ace_scroller').after($('<div>').addClass('ace_resize_bar'));
39176this.$('.ace_gutter').css({
39177'cursor': 'default'
39178});
39179this.$el.on('mousedown.ViewEditor', '.ace_resize_bar', startResizing.bind(this));
39180} else {
39181this.$el.on('mousedown.ViewEditor', '.ace_gutter', startResizing.bind(this));
39182}
39183resizeEditor.call(this, readEditorWidth.call(this));
39184return this._super.apply(this, arguments);
39185function resizeEditor(target) {
39186var width = Math.min(document.body.clientWidth, Math.max(parseInt(target, 10), minWidth));
39187this.$editor.width(width);
39188this.aceEditor.resize();
39189this.$el.width(width);
39190}
39191function storeEditorWidth() {
39192localStorage.setItem('ace_editor_width', this.$el.width());
39193}
39194function readEditorWidth() {
39195var width = localStorage.getItem('ace_editor_width');
39196return parseInt(width || 720, 10);
39197}
39198function startResizing(e) {
39199refX = e.pageX;
39200resizing = true;
39201}
39202function stopResizing() {
39203resizing = false;
39204}
39205function updateWidth(e) {
39206if (!resizing)
39207return;
39208var offset = e.pageX - refX;
39209if (this.options.position === 'left') {
39210offset = -offset;
39211}
39212var width = this.$el.width() - offset;
39213refX = e.pageX;
39214resizeEditor.call(this, width);
39215debounceStoreEditorWidth.call(this);
39216}
39217},
39218destroy: function() {
39219this._super.apply(this, arguments);
39220this.$el.off('.ViewEditor');
39221$(document).off('.ViewEditor');
39222},
39223_buildEditingSession: function(resID, type) {
39224var self = this;
39225type = type || this.currentType;
39226var editingSession = new window.ace.EditSession(this.resources[type][resID].arch);
39227editingSession.setUseWorker(false);
39228editingSession.setMode('ace/mode/' + (type || this.currentType));
39229editingSession.setUndoManager(new window.ace.UndoManager());
39230editingSession.on('change', function() {
39231_.defer(function() {
39232self._toggleDirtyInfo(resID);
39233self._showErrorLine();
39234});
39235});
39236return editingSession;
39237},
39238_displayResource: function(resID, type) {
39239if (type) {
39240this._switchType(type);
39241}
39242var editingSession = this.editingSessions[this.currentType][resID];
39243if (!editingSession) {
39244editingSession = this.editingSessions[this.currentType][resID] = this._buildEditingSession(resID);
39245}
39246this.aceEditor.setSession(editingSession);
39247if (this.currentType === 'xml') {
39248this.$viewID.text(_.str.sprintf(_t("Template ID: %s"), this.views[resID].key));
39249} else {
39250this.$viewID.text(_.str.sprintf(_t("SCSS file: %s"), resID));
39251}
39252this.$lists[this.currentType].select2('val', resID);
39253this.$resetButton.toggleClass('d-none', this.currentType === 'xml' || !this.scss[resID].customized);
39254},
39255_formatResource: function() {
39256var res = this.aceEditor.getValue();
39257var check = (this.currentType === 'xml' ? checkXML : checkSCSS)(res);
39258if (check.isValid) {
39259this.aceEditor.setValue((this.currentType === 'xml' ? formatXML : formatSCSS)(res));
39260} else {
39261this._showErrorLine(check.error.line, check.error.message, this._getSelectedResource());
39262}
39263},
39264_getSelectedResource: function() {
39265var value = this.$lists[this.currentType].select2('val');
39266return parseInt(value, 10) || value;
39267},
39268_loadResources: function() {
39269this.resources = {
39270xml: {},
39271scss: {}
39272};
39273this.editingSessions = {
39274xml: {},
39275scss: {}
39276};
39277this.views = this.resources.xml;
39278this.scss = this.resources.scss;
39279return this._rpc({
39280route: '/web_editor/get_assets_editor_resources',
39281params: {
39282key: this.viewKey,
39283get_views: !this.options.doNotLoadViews,
39284get_scss: !this.options.doNotLoadSCSS,
39285bundles: this.options.includeBundles,
39286bundles_restriction: this.options.includeAllSCSS ? [] : this.options.defaultBundlesRestriction,
39287},
39288}).then((function(resources) {
39289_processViews.call(this, resources.views || []);
39290_processSCSS.call(this, resources.scss || []);
39291}
39292).bind(this));
39293function _processViews(views) {
39294_.extend(this.views, _.indexBy(_.filter(views, function(view) {
39295return view.active;
39296}), 'id'));
39297var self = this;
39298var roots = [];
39299_.each(this.views, function(view) {
39300view.level = 0;
39301view.children = [];
39302});
39303_.each(this.views, function(view) {
39304var parentId = view.inherit_id[0];
39305var parent = parentId && self.views[parentId];
39306if (parent) {
39307parent.children.push(view);
39308} else {
39309roots.push(view);
39310}
39311});
39312this.sortedViews = [];
39313function visit(view, level) {
39314view.level = level;
39315self.sortedViews.push(view);
39316_.each(view.children, function(child) {
39317visit(child, level + 1);
39318});
39319}
39320_.each(roots, function(root) {
39321visit(root, 0);
39322});
39323}
39324function _processSCSS(scss) {
39325this.sortedSCSS = scss;
39326var self = this;
39327_.each(scss, function(bundleInfos) {
39328_.each(bundleInfos[1], function(info) {
39329info.bundle_xmlid = bundleInfos[0].xmlid;
39330});
39331_.extend(self.scss, _.indexBy(bundleInfos[1], 'url'));
39332});
39333}
39334},
39335_resetResource: function(resID, type) {
39336resID = resID || this._getSelectedResource();
39337type = type || this.currentType;
39338if (this.currentType === 'xml') {
39339return $.Defered().reject(_t("Reseting views is not supported yet"));
39340} else {
39341return this._rpc({
39342route: '/web_editor/reset_scss',
39343params: {
39344url: resID,
39345bundle_xmlid: this.scss[resID].bundle_xmlid,
39346},
39347});
39348}
39349},
39350_saveSCSS: function(session) {
39351var def = $.Deferred();
39352var self = this;
39353this._rpc({
39354route: '/web_editor/save_scss',
39355params: {
39356url: session.id,
39357bundle_xmlid: this.scss[session.id].bundle_xmlid,
39358content: session.text,
39359},
39360}).then(function() {
39361self._toggleDirtyInfo(session.id, 'scss', false);
39362def.resolve();
39363}, function(source, error) {
39364def.reject(session, error);
39365});
39366return def;
39367},
39368_saveResources: function() {
39369var self = this;
39370var toSave = {};
39371var errorFound = false;
39372_.each(this.editingSessions, (function(editingSessions, type) {
39373if (errorFound)
39374return;
39375var dirtySessions = _.pick(editingSessions, function(session) {
39376return session.getUndoManager().hasUndo();
39377});
39378toSave[type] = _.map(dirtySessions, function(session, resID) {
39379return {
39380id: parseInt(resID, 10) || resID,
39381text: session.getValue(),
39382};
39383});
39384this._showErrorLine();
39385for (var i = 0; i < toSave[type].length && !errorFound; i++) {
39386var check = (type === 'xml' ? checkXML : checkSCSS)(toSave[type][i].text);
39387if (!check.isValid) {
39388this._showErrorLine(check.error.line, check.error.message, toSave[type][i].id, type);
39389errorFound = toSave[type][i];
39390}
39391}
39392}
39393).bind(this));
39394if (errorFound)
39395return $.Deferred().reject(errorFound);
39396var defs = [];
39397var mutex = new concurrency.Mutex();
39398_.each(toSave, (function(_toSave, type) {
39399_toSave = _.sortBy(_toSave, 'id').reverse();
39400_.each(_toSave, function(session) {
39401defs.push(mutex.exec(function() {
39402return (type === 'xml' ? self._saveView(session) : self._saveSCSS(session));
39403}));
39404});
39405}
39406).bind(this));
39407return $.when.apply($, defs).fail((function(session, error) {
39408Dialog.alert(this, '', {
39409title: _t("Server error"),
39410$content: $('<div/>').html(_t("A server error occured. Please check you correctly signed in and that the file you are saving is correctly formatted.") + '<br/>' + error)
39411});
39412}
39413).bind(this));
39414},
39415_saveView: function(session) {
39416var def = $.Deferred();
39417var self = this;
39418this._rpc({
39419model: 'ir.ui.view',
39420method: 'write',
39421args: [[session.id], {
39422arch: session.text
39423}],
39424}, {
39425noContextKeys: 'lang',
39426}).then(function() {
39427self._toggleDirtyInfo(session.id, 'xml', false);
39428def.resolve();
39429}, function(source, error) {
39430def.reject(session, error);
39431});
39432return def;
39433},
39434_showErrorLine: function(line, message, resID, type) {
39435if (line === undefined || line <= 0) {
39436if (this.$errorLine) {
39437this.$errorLine.removeClass('o_error');
39438this.$errorLine.off('.o_error');
39439this.$errorLine = undefined;
39440this.$errorContent.removeClass('o_error');
39441this.$errorContent = undefined;
39442}
39443return;
39444}
39445if (type)
39446this._switchType(type);
39447if (this._getSelectedResource() === resID) {
39448__showErrorLine.call(this, line);
39449} else {
39450var onChangeSession = (function() {
39451this.aceEditor.off('changeSession', onChangeSession);
39452_.delay(__showErrorLine.bind(this, line), 400);
39453}
39454).bind(this);
39455this.aceEditor.on('changeSession', onChangeSession);
39456this._displayResource(resID, this.currentType);
39457}
39458function __showErrorLine(line) {
39459this.aceEditor.gotoLine(line);
39460this.$errorLine = this.$viewEditor.find('.ace_gutter-cell').filter(function() {
39461return parseInt($(this).text()) === line;
39462}).addClass('o_error');
39463this.$errorLine.addClass('o_error').on('click.o_error', function() {
39464var $message = $('<div/>').html(message);
39465$message.text($message.text());
39466Dialog.alert(this, "", {
39467$content: $message
39468});
39469});
39470this.$errorContent = this.$viewEditor.find('.ace_scroller').addClass('o_error');
39471}
39472},
39473_switchType: function(type) {
39474this.currentType = type;
39475this.$typeSwitcherBtn.html(this.$typeSwitcherChoices.filter('[data-type=' + type + ']').html());
39476_.each(this.$lists, function($list, _type) {
39477$list.toggleClass('d-none', type !== _type);
39478});
39479this.$lists[type].change();
39480this.$includeBundlesArea.toggleClass('d-none', this.currentType === 'scss' || !session.debug);
39481this.$includeAllSCSSArea.toggleClass('d-none', this.currentType === 'xml' || !session.debug || this.options.defaultBundlesRestriction.length === 0);
39482this.$formatButton.toggleClass('d-none', this.currentType === 'scss');
39483},
39484_toggleDirtyInfo: function(resID, type, isDirty) {
39485type = type || this.currentType;
39486if (!resID || !this.editingSessions[type][resID])
39487return;
39488var $option = this.$lists[type].find('[value="' + resID + '"]');
39489if (isDirty === undefined) {
39490isDirty = this.editingSessions[type][resID].getUndoManager().hasUndo();
39491}
39492$option.data('dirty', isDirty);
39493},
39494_updateViewSelectDOM: function() {
39495var currentId = this._getSelectedResource();
39496var self = this;
39497this.$lists.xml.empty();
39498_.each(this.sortedViews, function(view) {
39499self.$lists.xml.append($('<option/>', {
39500value: view.id,
39501text: view.name,
39502selected: currentId === view.id,
39503'data-level': view.level,
39504'data-debug': view.xml_id,
39505}));
39506});
39507this.$lists.scss.empty();
39508_.each(this.sortedSCSS, function(bundleInfos) {
39509var $optgroup = $('<optgroup/>', {
39510label: bundleInfos[0].name,
39511}).appendTo(self.$lists.scss);
39512_.each(bundleInfos[1], function(scssInfo) {
39513var name = scssInfo.url.substring(_.lastIndexOf(scssInfo.url, '/') + 1, scssInfo.url.length - 5);
39514$optgroup.append($('<option/>', {
39515value: scssInfo.url,
39516text: name,
39517selected: currentId === scssInfo.url,
39518'data-debug': scssInfo.url,
39519'data-customized': scssInfo.customized
39520}));
39521});
39522});
39523this.$lists.xml.select2('destroy');
39524this.$lists.xml.select2({
39525formatResult: _formatDisplay.bind(this, false),
39526formatSelection: _formatDisplay.bind(this, true),
39527});
39528this.$lists.xml.data('select2').dropdown.addClass('o_ace_select2_dropdown');
39529this.$lists.scss.select2('destroy');
39530this.$lists.scss.select2({
39531formatResult: _formatDisplay.bind(this, false),
39532formatSelection: _formatDisplay.bind(this, true),
39533});
39534this.$lists.scss.data('select2').dropdown.addClass('o_ace_select2_dropdown');
39535function _formatDisplay(isSelected, data) {
39536var $elem = $(data.element);
39537var text = data.text || '';
39538if (!isSelected) {
39539text = Array(($elem.data('level') || 0) + 1).join('-') + ' ' + text;
39540}
39541var $div = $('<div/>', {
39542text: text,
39543class: 'o_ace_select2_result',
39544});
39545if ($elem.data('dirty') || $elem.data('customized')) {
39546$div.prepend($('<span/>', {
39547class: 'mr8 fa fa-floppy-o ' + ($elem.data('dirty') ? 'text-warning' : 'text-success'),
39548}));
39549}
39550if (!isSelected && session.debug && $elem.data('debug')) {
39551$div.append($('<span/>', {
39552text: ' (' + $elem.data('debug') + ')',
39553class: 'ml4 small text-muted',
39554}));
39555}
39556return $div;
39557}
39558},
39559_onCloseClick: function() {
39560this.do_hide();
39561},
39562_onFormatClick: function() {
39563this._formatResource();
39564},
39565_onIncludeAllSCSSChange: function(ev) {
39566this.options.includeAllSCSS = $(ev.target).prop('checked');
39567this._loadResources().then(this._updateViewSelectDOM.bind(this));
39568},
39569_onIncludeBundlesChange: function(ev) {
39570this.options.includeBundles = $(ev.target).prop('checked');
39571this._loadResources().then(this._updateViewSelectDOM.bind(this));
39572},
39573_onResChange: function() {
39574this._displayResource(this._getSelectedResource());
39575},
39576_onResetClick: function() {
39577var self = this;
39578Dialog.confirm(this, _t("If you reset this file, all your customizations will be lost as it will be reverted to the default file."), {
39579title: _t("Careful !"),
39580confirm_callback: function() {
39581self._resetResource(self._getSelectedResource());
39582},
39583});
39584},
39585_onSaveClick: function() {
39586this._saveResources();
39587},
39588_onTypeChoice: function(ev) {
39589ev.preventDefault();
39590this._switchType($(ev.target).data('type'));
39591},
39592});
39593return ViewEditor;
39594});
39595;
39596/* /web_unsplash/static/src/js/unsplash_beacon.js defined in bundle 'web.assets_common' */
39597odoo.define('web_unsplash.beacon', function(require) {
39598'use strict';
39599var base = require('web_editor.base');
39600var ajax = require('web.ajax');
39601base.ready().then(function() {
39602var unsplash_images = [];
39603_.each($('img[src*="/unsplash/"]'), function(img, index) {
39604unsplash_images.push(img.src.split('/unsplash/')[1].split('/')[0]);
39605});
39606if (unsplash_images.length) {
39607ajax.jsonRpc('/web_unsplash/get_app_id', 'call').then(function(appID) {
39608if (appID) {
39609var unsplash_view_url = 'https://views.unsplash.com/v';
39610$.get(unsplash_view_url, {
39611photo_id: unsplash_images.join(','),
39612app_id: appID,
39613});
39614}
39615});
39616}
39617});
39618});
39619;
39620/* /web_tour/static/src/js/tip.js defined in bundle 'web.assets_common' */
39621odoo.define('web_tour.Tip', function(require) {
39622"use strict";
39623var config = require('web.config');
39624var core = require('web.core');
39625var Widget = require('web.Widget');
39626var _t = core._t;
39627var Tip = Widget.extend({
39628template: "Tip",
39629xmlDependencies: ['/web_tour/static/src/xml/tip.xml'],
39630events: {
39631click: '_onTipClicked',
39632mouseenter: "_to_info_mode",
39633mouseleave: "_to_bubble_mode",
39634},
39635init: function(parent, info) {
39636this._super(parent);
39637this.info = _.defaults(info, {
39638position: "right",
39639width: 270,
39640space: 10,
39641overlay: {
39642x: 50,
39643y: 50,
39644},
39645});
39646this.position = {
39647top: "50%",
39648left: "50%",
39649};
39650},
39651attach_to: function($anchor) {
39652this.$anchor = $anchor;
39653this.$ideal_location = this._get_ideal_location();
39654var position = this.$ideal_location.css("position");
39655if (position === "static" || position === "relative") {
39656this.$ideal_location.addClass("o_tooltip_parent");
39657}
39658return this.appendTo(this.$ideal_location);
39659},
39660start: function() {
39661this.$tooltip_overlay = this.$(".o_tooltip_overlay");
39662this.$tooltip_content = this.$(".o_tooltip_content");
39663this.init_width = this.$el.innerWidth();
39664this.init_height = this.$el.innerHeight();
39665this.double_border_width = this.$el.outerWidth() - this.init_width;
39666this.content_width = this.$tooltip_content.outerWidth(true);
39667this.content_height = this.$tooltip_content.outerHeight(true);
39668this.$window = $(window);
39669this.$tooltip_content.css({
39670width: "100%",
39671height: "100%",
39672});
39673_.each(this.info.event_handlers, (function(data) {
39674this.$tooltip_content.on(data.event, data.selector, data.handler);
39675}
39676).bind(this));
39677this._bind_anchor_events();
39678this._reposition();
39679this.$el.css("opacity", 1);
39680core.bus.on("resize", this, _.debounce(function() {
39681if (this.tip_opened) {
39682this._to_bubble_mode(true);
39683}
39684this._reposition();
39685}, 500));
39686this.$el.on("transitionend oTransitionEnd webkitTransitionEnd", (function() {
39687if (!this.tip_opened && this.$el.parent()[0] === document.body) {
39688this.$el.detach();
39689this.$el.css(this.position);
39690this.$el.appendTo(this.$ideal_location);
39691}
39692}
39693).bind(this));
39694return this._super.apply(this, arguments);
39695},
39696destroy: function() {
39697this._unbind_anchor_events();
39698clearTimeout(this.timerIn);
39699clearTimeout(this.timerOut);
39700if (this.$ideal_location.children(".o_tooltip").not(this.$el[0]).length === 0) {
39701this.$ideal_location.removeClass("o_tooltip_parent");
39702}
39703return this._super.apply(this, arguments);
39704},
39705update: function($anchor) {
39706if (!$anchor.is(this.$anchor)) {
39707this._unbind_anchor_events();
39708this.$anchor = $anchor;
39709this.$ideal_location = this._get_ideal_location();
39710if (this.$el.parent()[0] !== document.body) {
39711this.$el.appendTo(this.$ideal_location);
39712}
39713this._bind_anchor_events();
39714}
39715this._reposition();
39716},
39717_get_ideal_location: function() {
39718var $location = this.$anchor;
39719if ($location.is("html,body")) {
39720return $(document.body);
39721}
39722var o;
39723var p;
39724do {
39725$location = $location.parent();
39726o = $location.css("overflow");
39727p = $location.css("position");
39728} while ($location.hasClass('dropdown-menu') || ((o === "visible" || o === "hidden") && p !== "fixed" && $location[0].tagName.toUpperCase() !== 'BODY'));return $location;
39729},
39730_reposition: function() {
39731if (this.tip_opened)
39732return;
39733this.$el.removeClass("o_animated");
39734var appendAt = this.info.position;
39735if (_t.database.parameters.direction === 'rtl') {
39736appendAt = appendAt === 'right' ? 'left' : 'right';
39737}
39738this.$el.position({
39739my: this._get_spaced_inverted_position(appendAt),
39740at: appendAt,
39741of: this.$anchor,
39742collision: "none",
39743});
39744var positionRight = _t.database.parameters.direction === 'rtl' ? "right" : "left";
39745var positionLeft = _t.database.parameters.direction === 'rtl' ? "left" : "right";
39746var offset = this.$el.offset();
39747this.$tooltip_overlay.css({
39748top: -Math.min((this.info.position === "bottom" ? this.info.space : this.info.overlay.y), offset.top),
39749right: -Math.min((this.info.position === positionRight ? this.info.space : this.info.overlay.x), this.$window.width() - (offset.left + this.init_width + this.double_border_width)),
39750bottom: -Math.min((this.info.position === "top" ? this.info.space : this.info.overlay.y), this.$window.height() - (offset.top + this.init_height + this.double_border_width)),
39751left: -Math.min((this.info.position === positionLeft ? this.info.space : this.info.overlay.x), offset.left),
39752});
39753this.position = this.$el.position();
39754this.$el.addClass("o_animated");
39755},
39756_bind_anchor_events: function() {
39757this.consume_event = Tip.getConsumeEventType(this.$anchor);
39758this.$anchor.on(this.consume_event + ".anchor", (function(e) {
39759if (e.type !== "mousedown" || e.which === 1) {
39760this.trigger("tip_consumed");
39761this._unbind_anchor_events();
39762}
39763}
39764).bind(this));
39765this.$anchor.on('mouseenter.anchor', this._to_info_mode.bind(this));
39766this.$anchor.on('mouseleave.anchor', this._to_bubble_mode.bind(this));
39767},
39768_unbind_anchor_events: function() {
39769this.$anchor.off(".anchor");
39770},
39771_get_spaced_inverted_position: function(position) {
39772if (position === "right")
39773return "left+" + this.info.space;
39774if (position === "left")
39775return "right-" + this.info.space;
39776if (position === "bottom")
39777return "top+" + this.info.space;
39778return "bottom-" + this.info.space;
39779},
39780_to_info_mode: function(force) {
39781if (this.timerOut !== undefined) {
39782clearTimeout(this.timerOut);
39783this.timerOut = undefined;
39784return;
39785}
39786if (this.tip_opened) {
39787return;
39788}
39789if (force === true) {
39790this._build_info_mode();
39791} else {
39792this.timerIn = setTimeout(this._build_info_mode.bind(this), 100);
39793}
39794},
39795_build_info_mode: function() {
39796clearTimeout(this.timerIn);
39797this.timerIn = undefined;
39798this.tip_opened = true;
39799var offset = this.$el.offset();
39800if (this.$el.parent()[0] !== document.body) {
39801this.$el.detach();
39802this.$el.css(offset);
39803this.$el.appendTo(document.body);
39804}
39805var mbLeft = 0;
39806var mbTop = 0;
39807var overflow = false;
39808var posVertical = (this.info.position === "top" || this.info.position === "bottom");
39809if (posVertical) {
39810overflow = (offset.left + this.content_width + this.double_border_width + this.info.overlay.x > this.$window.width());
39811} else {
39812overflow = (offset.top + this.content_height + this.double_border_width + this.info.overlay.y > this.$window.height());
39813}
39814if (posVertical && overflow || this.info.position === "left" || (_t.database.parameters.direction === 'rtl' && this.info.position == "right")) {
39815mbLeft -= (this.content_width - this.init_width);
39816}
39817if (!posVertical && overflow || this.info.position === "top") {
39818mbTop -= (this.content_height - this.init_height);
39819}
39820this.$el.toggleClass("inverse", overflow);
39821this.$el.removeClass("o_animated").addClass("active");
39822this.$el.css({
39823width: this.content_width,
39824height: this.content_height,
39825"margin-left": mbLeft,
39826"margin-top": mbTop,
39827});
39828},
39829_to_bubble_mode: function(force) {
39830if (this.timerIn !== undefined) {
39831clearTimeout(this.timerIn);
39832this.timerIn = undefined;
39833return;
39834}
39835if (!this.tip_opened) {
39836return;
39837}
39838if (force === true) {
39839this._build_bubble_mode();
39840} else {
39841this.timerOut = setTimeout(this._build_bubble_mode.bind(this), 300);
39842}
39843},
39844_build_bubble_mode: function() {
39845clearTimeout(this.timerOut);
39846this.timerOut = undefined;
39847this.tip_opened = false;
39848this.$el.removeClass("active").addClass("o_animated");
39849this.$el.css({
39850width: this.init_width,
39851height: this.init_height,
39852margin: 0,
39853});
39854},
39855_onTipClicked: function() {
39856if (config.device.touch && this.tip_opened) {
39857this._to_bubble_mode();
39858}
39859},
39860});
39861Tip.getConsumeEventType = function($element) {
39862if ($element.is("textarea") || $element.filter("input").is(function() {
39863var type = $(this).attr("type");
39864return !type || !!type.match(/^(email|number|password|search|tel|text|url)$/);
39865})) {
39866return "input";
39867}
39868return "mousedown";
39869}
39870;
39871return Tip;
39872});
39873;
39874/* /web_tour/static/src/js/tour_utils.js defined in bundle 'web.assets_common' */
39875odoo.define('web_tour.utils', function(require) {
39876"use strict";
39877function get_step_key(name) {
39878return 'tour_' + name + '_step';
39879}
39880function get_running_key() {
39881return 'running_tour';
39882}
39883function get_running_delay_key() {
39884return get_running_key() + "_delay";
39885}
39886function get_first_visible_element($elements) {
39887for (var i = 0; i < $elements.length; i++) {
39888var $i = $elements.eq(i);
39889if ($i.is(':visible:hasVisibility')) {
39890return $i;
39891}
39892}
39893return $();
39894}
39895function do_before_unload(if_unload_callback, if_not_unload_callback) {
39896if_unload_callback = if_unload_callback || function() {}
39897;
39898if_not_unload_callback = if_not_unload_callback || if_unload_callback;
39899var old_before = window.onbeforeunload;
39900var reload_timeout;
39901window.onbeforeunload = function() {
39902clearTimeout(reload_timeout);
39903window.onbeforeunload = old_before;
39904if_unload_callback();
39905if (old_before)
39906return old_before.apply(this, arguments);
39907}
39908;
39909reload_timeout = _.defer(function() {
39910window.onbeforeunload = old_before;
39911if_not_unload_callback();
39912});
39913}
39914function get_jquery_element_from_selector(selector) {
39915if (_.isString(selector) && selector.indexOf('iframe') !== -1) {
39916var $iframe = $(selector.split('iframe')[0] + ' iframe');
39917var $el = $iframe.contents().find(selector.split('iframe')[1]);
39918$el.iframeContainer = $iframe[0];
39919return $el;
39920} else {
39921return $(selector);
39922}
39923}
39924return {
39925'get_step_key': get_step_key,
39926'get_running_key': get_running_key,
39927'get_running_delay_key': get_running_delay_key,
39928'get_first_visible_element': get_first_visible_element,
39929'do_before_unload': do_before_unload,
39930'get_jquery_element_from_selector': get_jquery_element_from_selector,
39931};
39932});
39933;
39934/* /web_tour/static/src/js/running_tour_action_helper.js defined in bundle 'web.assets_common' */
39935odoo.define('web_tour.RunningTourActionHelper', function(require) {
39936"use strict";
39937var core = require('web.core');
39938var utils = require('web_tour.utils');
39939var Tip = require('web_tour.Tip');
39940var get_first_visible_element = utils.get_first_visible_element;
39941var get_jquery_element_from_selector = utils.get_jquery_element_from_selector;
39942var RunningTourActionHelper = core.Class.extend({
39943init: function(tip_widget) {
39944this.tip_widget = tip_widget;
39945},
39946click: function(element) {
39947this._click(this._get_action_values(element));
39948},
39949dblclick: function(element) {
39950this._click(this._get_action_values(element), 2);
39951},
39952tripleclick: function(element) {
39953this._click(this._get_action_values(element), 3);
39954},
39955clicknoleave: function(element) {
39956this._click(this._get_action_values(element), 1, false);
39957},
39958text: function(text, element) {
39959this._text(this._get_action_values(element), text);
39960},
39961drag_and_drop: function(to, element) {
39962this._drag_and_drop(this._get_action_values(element), to);
39963},
39964keydown: function(keyCodes, element) {
39965this._keydown(this._get_action_values(element), keyCodes.split(/[,\s]+/));
39966},
39967auto: function(element) {
39968var values = this._get_action_values(element);
39969if (values.consume_event === "input") {
39970this._text(values);
39971} else {
39972this._click(values);
39973}
39974},
39975_get_action_values: function(element) {
39976var $e = get_jquery_element_from_selector(element);
39977var $element = element ? get_first_visible_element($e) : this.tip_widget.$anchor;
39978if ($element.length === 0) {
39979$element = $e.first();
39980}
39981var consume_event = element ? Tip.getConsumeEventType($element) : this.tip_widget.consume_event;
39982return {
39983$element: $element,
39984consume_event: consume_event,
39985};
39986},
39987_click: function(values, nb, leave) {
39988trigger_mouse_event(values.$element, "mouseover");
39989values.$element.trigger("mouseenter");
39990for (var i = 1; i <= (nb || 1); i++) {
39991trigger_mouse_event(values.$element, "mousedown");
39992trigger_mouse_event(values.$element, "mouseup");
39993trigger_mouse_event(values.$element, "click", i);
39994if (i % 2 === 0) {
39995trigger_mouse_event(values.$element, "dblclick");
39996}
39997}
39998if (leave !== false) {
39999trigger_mouse_event(values.$element, "mouseout");
40000values.$element.trigger("mouseleave");
40001}
40002function trigger_mouse_event($element, type, count) {
40003var e = document.createEvent("MouseEvents");
40004e.initMouseEvent(type, true, true, window, count || 0, 0, 0, 0, 0, false, false, false, false, 0, $element[0]);
40005$element[0].dispatchEvent(e);
40006}
40007},
40008_text: function(values, text) {
40009this._click(values);
40010text = text || "Test";
40011if (values.consume_event === "input") {
40012values.$element.trigger("keydown").val(text).trigger("keyup").trigger("input");
40013} else if (values.$element.is("select")) {
40014var $options = values.$element.children("option");
40015$options.prop("selected", false).removeProp("selected");
40016var $selectedOption = $options.filter(function() {
40017return $(this).val() === text;
40018});
40019if ($selectedOption.length === 0) {
40020$selectedOption = $options.filter(function() {
40021return $(this).text().trim() === text;
40022});
40023}
40024$selectedOption.prop("selected", true);
40025this._click(values);
40026} else {
40027values.$element.text(text);
40028}
40029values.$element.trigger("change");
40030},
40031_drag_and_drop: function(values, to) {
40032var $to;
40033if (to) {
40034$to = get_jquery_element_from_selector(to);
40035} else {
40036$to = $(document.body);
40037}
40038var elementCenter = values.$element.offset();
40039elementCenter.left += values.$element.outerWidth() / 2;
40040elementCenter.top += values.$element.outerHeight() / 2;
40041var toCenter = $to.offset();
40042if (to && to.indexOf('iframe') !== -1) {
40043var iFrameOffset = $('iframe').offset();
40044toCenter.left += iFrameOffset.left;
40045toCenter.top += iFrameOffset.top;
40046}
40047toCenter.left += $to.outerWidth() / 2;
40048toCenter.top += $to.outerHeight() / 2;
40049values.$element.trigger($.Event("mouseenter"));
40050values.$element.trigger($.Event("mousedown", {
40051which: 1,
40052pageX: elementCenter.left,
40053pageY: elementCenter.top
40054}));
40055values.$element.trigger($.Event("mousemove", {
40056which: 1,
40057pageX: toCenter.left,
40058pageY: toCenter.top
40059}));
40060values.$element.trigger($.Event("mouseup", {
40061which: 1,
40062pageX: toCenter.left,
40063pageY: toCenter.top
40064}));
40065},
40066_keydown: function(values, keyCodes) {
40067while (keyCodes.length) {
40068var keyCode = +keyCodes.shift();
40069values.$element.trigger({
40070type: "keydown",
40071keyCode: keyCode
40072});
40073if ((keyCode > 47 && keyCode < 58) || keyCode === 32 || (keyCode > 64 && keyCode < 91) || (keyCode > 95 && keyCode < 112) || (keyCode > 185 && keyCode < 193) || (keyCode > 218 && keyCode < 223)) {
40074document.execCommand("insertText", 0, String.fromCharCode(keyCode));
40075}
40076values.$element.trigger({
40077type: "keyup",
40078keyCode: keyCode
40079});
40080}
40081},
40082});
40083return RunningTourActionHelper;
40084});
40085;
40086/* /web_tour/static/src/js/tour_manager.js defined in bundle 'web.assets_common' */
40087odoo.define('web_tour.TourManager', function(require) {
40088"use strict";
40089var core = require('web.core');
40090var local_storage = require('web.local_storage');
40091var mixins = require('web.mixins');
40092var utils = require('web_tour.utils');
40093var RainbowMan = require('web.RainbowMan');
40094var RunningTourActionHelper = require('web_tour.RunningTourActionHelper');
40095var ServicesMixin = require('web.ServicesMixin');
40096var session = require('web.session');
40097var Tip = require('web_tour.Tip');
40098var _t = core._t;
40099var RUNNING_TOUR_TIMEOUT = 10000;
40100var get_step_key = utils.get_step_key;
40101var get_running_key = utils.get_running_key;
40102var get_running_delay_key = utils.get_running_delay_key;
40103var get_first_visible_element = utils.get_first_visible_element;
40104var do_before_unload = utils.do_before_unload;
40105var get_jquery_element_from_selector = utils.get_jquery_element_from_selector;
40106return core.Class.extend(mixins.EventDispatcherMixin, ServicesMixin, {
40107init: function(parent, consumed_tours) {
40108mixins.EventDispatcherMixin.init.call(this);
40109this.setParent(parent);
40110this.$body = $('body');
40111this.active_tooltips = {};
40112this.tours = {};
40113this.consumed_tours = consumed_tours || [];
40114this.running_tour = local_storage.getItem(get_running_key());
40115this.running_step_delay = parseInt(local_storage.getItem(get_running_delay_key()), 10) || 0;
40116this.edition = (_.last(session.server_version_info) === 'e') ? 'enterprise' : 'community';
40117this._log = [];
40118console.log('Tour Manager is ready.  running_tour=' + this.running_tour);
40119},
40120register: function() {
40121var args = Array.prototype.slice.call(arguments);
40122var last_arg = args[args.length - 1];
40123var name = args[0];
40124if (this.tours[name]) {
40125console.warn(_.str.sprintf("Tour %s is already defined", name));
40126return;
40127}
40128var options = args.length === 2 ? {} : args[1];
40129var steps = last_arg instanceof Array ? last_arg : [last_arg];
40130var tour = {
40131name: name,
40132steps: steps,
40133url: options.url,
40134rainbowMan: options.rainbowMan === undefined ? true : !!options.rainbowMan,
40135test: options.test,
40136wait_for: options.wait_for || $.when(),
40137};
40138if (options.skip_enabled) {
40139tour.skip_link = '<p><span class="o_skip_tour">' + _t('Skip tour') + '</span></p>';
40140tour.skip_handler = function(tip) {
40141this._deactivate_tip(tip);
40142this._consume_tour(name);
40143}
40144;
40145}
40146this.tours[name] = tour;
40147},
40148_register_all: function(do_update) {
40149if (this._all_registered)
40150return;
40151this._all_registered = true;
40152_.each(this.tours, this._register.bind(this, do_update));
40153},
40154_register: function(do_update, tour, name) {
40155if (tour.ready)
40156return $.when();
40157var tour_is_consumed = _.contains(this.consumed_tours, name);
40158return tour.wait_for.then((function() {
40159tour.current_step = parseInt(local_storage.getItem(get_step_key(name))) || 0;
40160tour.steps = _.filter(tour.steps, (function(step) {
40161return !step.edition || step.edition === this.edition;
40162}
40163).bind(this));
40164if (tour_is_consumed || tour.current_step >= tour.steps.length) {
40165local_storage.removeItem(get_step_key(name));
40166tour.current_step = 0;
40167}
40168tour.ready = true;
40169if (do_update && (this.running_tour === name || (!this.running_tour && !tour.test && !tour_is_consumed))) {
40170this._to_next_step(name, 0);
40171this.update(name);
40172}
40173}
40174).bind(this));
40175},
40176run: function(tour_name, step_delay) {
40177console.log(_.str.sprintf("Preparing tour %s", tour_name));
40178if (this.running_tour) {
40179this._deactivate_tip(this.active_tooltips[this.running_tour]);
40180this._consume_tour(this.running_tour, _.str.sprintf("Killing tour %s", this.running_tour));
40181return;
40182}
40183var tour = this.tours[tour_name];
40184if (!tour) {
40185console.warn(_.str.sprintf("Unknown Tour %s", name));
40186return;
40187}
40188console.log(_.str.sprintf("Running tour %s", tour_name));
40189this.running_tour = tour_name;
40190this.running_step_delay = step_delay || this.running_step_delay;
40191local_storage.setItem(get_running_key(), this.running_tour);
40192local_storage.setItem(get_running_delay_key(), this.running_step_delay);
40193this._deactivate_tip(this.active_tooltips[tour_name]);
40194tour.current_step = 0;
40195this._to_next_step(tour_name, 0);
40196local_storage.setItem(get_step_key(tour_name), tour.current_step);
40197if (tour.url) {
40198this.pause();
40199do_before_unload(null, (function() {
40200this.play();
40201this.update();
40202}
40203).bind(this));
40204var url = session.debug ? $.param.querystring(tour.url, {
40205debug: session.debug
40206}) : tour.url;
40207window.location.href = window.location.origin + url;
40208} else {
40209this.update();
40210}
40211},
40212pause: function() {
40213this.paused = true;
40214},
40215play: function() {
40216this.paused = false;
40217},
40218update: function(tour_name) {
40219if (this.paused)
40220return;
40221this.$modal_displayed = $('.modal:visible').last();
40222tour_name = this.running_tour || tour_name;
40223if (tour_name) {
40224var tour = this.tours[tour_name];
40225if (!tour || !tour.ready)
40226return;
40227if (this.running_tour && this.running_tour_timeout === undefined) {
40228this._set_running_tour_timeout(this.running_tour, this.active_tooltips[this.running_tour]);
40229}
40230var self = this;
40231setTimeout(function() {
40232self._check_for_tooltip(self.active_tooltips[tour_name], tour_name);
40233});
40234} else {
40235for (var tourName in this.active_tooltips) {
40236var tip = this.active_tooltips[tourName];
40237var activated = this._check_for_tooltip(tip, tourName);
40238if (activated) {
40239break;
40240}
40241}
40242}
40243},
40244_check_for_tooltip: function(tip, tour_name) {
40245if (tip === undefined) {
40246return true;
40247}
40248if ($('body').hasClass('o_ui_blocked')) {
40249this._deactivate_tip(tip);
40250this._log.push("blockUI is preventing the tip to be consumed");
40251return false;
40252}
40253var $trigger;
40254if (tip.in_modal !== false && this.$modal_displayed.length) {
40255$trigger = this.$modal_displayed.find(tip.trigger);
40256} else {
40257$trigger = get_jquery_element_from_selector(tip.trigger);
40258}
40259var $visible_trigger = get_first_visible_element($trigger);
40260var extra_trigger = true;
40261var $extra_trigger;
40262if (tip.extra_trigger) {
40263$extra_trigger = get_jquery_element_from_selector(tip.extra_trigger);
40264extra_trigger = get_first_visible_element($extra_trigger).length;
40265}
40266var triggered = $visible_trigger.length && extra_trigger;
40267if (triggered) {
40268if (!tip.widget) {
40269this._activate_tip(tip, tour_name, $visible_trigger);
40270} else {
40271tip.widget.update($visible_trigger);
40272}
40273} else {
40274if ($trigger.iframeContainer || ($extra_trigger && $extra_trigger.iframeContainer)) {
40275var $el = $();
40276if ($trigger.iframeContainer) {
40277$el = $el.add($trigger.iframeContainer);
40278}
40279if (($extra_trigger && $extra_trigger.iframeContainer) && $trigger.iframeContainer !== $extra_trigger.iframeContainer) {
40280$el = $el.add($extra_trigger.iframeContainer);
40281}
40282var self = this;
40283$el.off('load').one('load', function() {
40284$el.off('load');
40285if (self.active_tooltips[tour_name] === tip) {
40286self.update(tour_name);
40287}
40288});
40289}
40290this._deactivate_tip(tip);
40291if (this.running_tour === tour_name) {
40292this._log.push("_check_for_tooltip");
40293this._log.push("- modal_displayed: " + this.$modal_displayed.length);
40294this._log.push("- trigger '" + tip.trigger + "': " + $trigger.length);
40295this._log.push("- visible trigger '" + tip.trigger + "': " + $visible_trigger.length);
40296if ($extra_trigger !== undefined) {
40297this._log.push("- extra_trigger '" + tip.extra_trigger + "': " + $extra_trigger.length);
40298this._log.push("- visible extra_trigger '" + tip.extra_trigger + "': " + extra_trigger);
40299}
40300}
40301}
40302return !!triggered;
40303},
40304_activate_tip: function(tip, tour_name, $anchor) {
40305var tour = this.tours[tour_name];
40306var tip_info = tip;
40307if (tour.skip_link) {
40308tip_info = _.extend(_.omit(tip_info, 'content'), {
40309content: tip.content + tour.skip_link,
40310event_handlers: [{
40311event: 'click',
40312selector: '.o_skip_tour',
40313handler: tour.skip_handler.bind(this, tip),
40314}],
40315});
40316}
40317tip.widget = new Tip(this,tip_info);
40318if (this.running_tour !== tour_name) {
40319tip.widget.on('tip_consumed', this, this._consume_tip.bind(this, tip, tour_name));
40320}
40321tip.widget.attach_to($anchor).then(this._to_next_running_step.bind(this, tip, tour_name));
40322},
40323_deactivate_tip: function(tip) {
40324if (tip && tip.widget) {
40325tip.widget.destroy();
40326delete tip.widget;
40327}
40328},
40329_consume_tip: function(tip, tour_name) {
40330this._deactivate_tip(tip);
40331this._to_next_step(tour_name);
40332var is_running = (this.running_tour === tour_name);
40333if (is_running) {
40334console.log(_.str.sprintf("Tour %s: step %s succeeded", tour_name, tip.trigger));
40335}
40336if (this.active_tooltips[tour_name]) {
40337local_storage.setItem(get_step_key(tour_name), this.tours[tour_name].current_step);
40338if (is_running) {
40339this._log = [];
40340this._set_running_tour_timeout(tour_name, this.active_tooltips[tour_name]);
40341}
40342this.update(tour_name);
40343} else {
40344this._consume_tour(tour_name);
40345}
40346},
40347_to_next_step: function(tour_name, inc) {
40348var tour = this.tours[tour_name];
40349tour.current_step += (inc !== undefined ? inc : 1);
40350if (this.running_tour !== tour_name) {
40351var index = _.findIndex(tour.steps.slice(tour.current_step), function(tip) {
40352return !tip.auto;
40353});
40354if (index >= 0) {
40355tour.current_step += index;
40356} else {
40357tour.current_step = tour.steps.length;
40358}
40359}
40360this.active_tooltips[tour_name] = tour.steps[tour.current_step];
40361},
40362_consume_tour: function(tour_name, error) {
40363delete this.active_tooltips[tour_name];
40364if (this.tours[tour_name].rainbowMan && this.running_tour !== tour_name && this.tours[tour_name].current_step === this.tours[tour_name].steps.length) {
40365var $rainbow_message = $('<strong>' + '<b>Good job!</b>' + ' You went through all steps of this tour.' + '</strong>');
40366new RainbowMan({
40367message: $rainbow_message
40368}).appendTo(this.$body);
40369}
40370this.tours[tour_name].current_step = 0;
40371local_storage.removeItem(get_step_key(tour_name));
40372if (this.running_tour === tour_name) {
40373this._stop_running_tour_timeout();
40374local_storage.removeItem(get_running_key());
40375local_storage.removeItem(get_running_delay_key());
40376this.running_tour = undefined;
40377this.running_step_delay = undefined;
40378if (error) {
40379_.each(this._log, function(log) {
40380console.log(log);
40381});
40382console.log(document.body.outerHTML);
40383console.error(error);
40384console.log("error");
40385} else {
40386console.log(_.str.sprintf("Tour %s succeeded", tour_name));
40387console.log("ok");
40388}
40389this._log = [];
40390} else {
40391var self = this;
40392this._rpc({
40393model: 'web_tour.tour',
40394method: 'consume',
40395args: [[tour_name]],
40396}).then(function() {
40397self.consumed_tours.push(tour_name);
40398});
40399}
40400},
40401_set_running_tour_timeout: function(tour_name, step) {
40402this._stop_running_tour_timeout();
40403this.running_tour_timeout = setTimeout((function() {
40404this._consume_tour(tour_name, _.str.sprintf("Tour %s failed at step %s", tour_name, step.trigger));
40405}
40406).bind(this), (step.timeout || RUNNING_TOUR_TIMEOUT) + this.running_step_delay);
40407},
40408_stop_running_tour_timeout: function() {
40409clearTimeout(this.running_tour_timeout);
40410this.running_tour_timeout = undefined;
40411},
40412_to_next_running_step: function(tip, tour_name) {
40413if (this.running_tour !== tour_name)
40414return;
40415var self = this;
40416this._stop_running_tour_timeout();
40417if (this.running_step_delay) {
40418_.delay(exec, this.running_step_delay);
40419} else {
40420exec();
40421}
40422function exec() {
40423var action_helper = new RunningTourActionHelper(tip.widget);
40424do_before_unload(self._consume_tip.bind(self, tip, tour_name));
40425if (typeof tip.run === "function") {
40426tip.run.call(tip.widget, action_helper);
40427} else if (tip.run !== undefined) {
40428var m = tip.run.match(/^([a-zA-Z0-9_]+) *(?:\(? *(.+?) *\)?)?$/);
40429action_helper[m[1]](m[2]);
40430} else {
40431action_helper.auto();
40432}
40433}
40434},
40435STEPS: {
40436SHOW_APPS_MENU_ITEM: {
40437edition: 'community',
40438trigger: '.o_menu_apps a',
40439auto: true,
40440position: "bottom",
40441},
40442TOGGLE_HOME_MENU: {
40443edition: "enterprise",
40444trigger: ".o_main_navbar .o_menu_toggle",
40445content: _t('Click on the <i>Home icon</i> to navigate across apps.'),
40446position: "bottom",
40447},
40448WEBSITE_NEW_PAGE: {
40449trigger: "#new-content-menu > a",
40450auto: true,
40451position: "bottom",
40452},
40453},
40454});
40455});
40456;
40457/* /web_tour/static/src/js/tour_service.js defined in bundle 'web.assets_common' */
40458odoo.define('web_tour.tour', function(require) {
40459"use strict";
40460var ajax = require('web.ajax');
40461var config = require('web.config');
40462var core = require('web.core');
40463var rootWidget = require('root.widget');
40464var rpc = require('web.rpc');
40465var session = require('web.session');
40466var TourManager = require('web_tour.TourManager');
40467var QWeb = core.qweb;
40468if (config.device.isMobile) {
40469return $.Deferred().reject();
40470}
40471return session.is_bound.then(function() {
40472var defs = [];
40473if (session.is_frontend && session.is_admin) {
40474var def = rpc.query({
40475model: 'web_tour.tour',
40476method: 'get_consumed_tours',
40477});
40478defs.push(def);
40479}
40480return $.when.apply($, defs).then(function(consumed_tours) {
40481consumed_tours = session.is_frontend ? consumed_tours : session.web_tours;
40482var tour_manager = new TourManager(rootWidget,consumed_tours);
40483var untracked_classnames = ["o_tooltip", "o_tooltip_content", "o_tooltip_overlay"];
40484var check_tooltip = _.debounce(function(records) {
40485var update = _.some(records, function(record) {
40486return !(is_untracked(record.target) || _.some(record.addedNodes, is_untracked) || _.some(record.removedNodes, is_untracked));
40487function is_untracked(node) {
40488var record_class = node.className;
40489return (_.isString(record_class) && _.intersection(record_class.split(' '), untracked_classnames).length !== 0);
40490}
40491});
40492if (update) {
40493tour_manager.update();
40494}
40495}, 500);
40496var observer = new MutationObserver(check_tooltip);
40497var start_service = (function() {
40498return function(observe) {
40499var def = $.Deferred();
40500$(function() {
40501_.defer(function() {
40502tour_manager._register_all(observe);
40503if (observe) {
40504observer.observe(document.body, {
40505attributes: true,
40506childList: true,
40507subtree: true,
40508});
40509}
40510def.resolve();
40511});
40512});
40513return def;
40514}
40515;
40516}
40517)();
40518start_service(session.is_admin || tour_manager.running_tour);
40519if (!session.is_admin) {
40520var run = tour_manager.run;
40521tour_manager.run = function() {
40522var self = this;
40523var args = arguments;
40524start_service(true).then(function() {
40525run.apply(self, args);
40526if (!self.running_tour) {
40527observer.disconnect();
40528}
40529});
40530}
40531;
40532var _consume_tour = tour_manager._consume_tour;
40533tour_manager._consume_tour = function() {
40534_consume_tour.apply(this, arguments);
40535observer.disconnect();
40536}
40537;
40538}
40539return tour_manager;
40540});
40541});
40542});
40543;
40544/* /web/static/lib/jSignature/jSignatureCustom.js defined in bundle 'web.assets_common' */
40545;(function() {
40546var apinamespace = 'jSignature'
40547var KickTimerClass = function(time, callback) {
40548var timer;
40549this.kick = function() {
40550clearTimeout(timer);
40551timer = setTimeout(callback, time);
40552}
40553this.clear = function() {
40554clearTimeout(timer);
40555}
40556return this;
40557}
40558var PubSubClass = function(context) {
40559'use strict'
40560this.topics = {};
40561this.context = context ? context : this;
40562this.publish = function(topic, arg1, arg2, etc) {
40563'use strict'
40564if (this.topics[topic]) {
40565var currentTopic = this.topics[topic], args = Array.prototype.slice.call(arguments, 1), toremove = [], torun = [], fn, i, l, pair;
40566for (i = 0,
40567l = currentTopic.length; i < l; i++) {
40568pair = currentTopic[i];
40569fn = pair[0];
40570if (pair[1]) {
40571pair[0] = function() {}
40572;
40573toremove.push(i);
40574}
40575torun.push(fn);
40576}
40577for (i = 0,
40578l = toremove.length; i < l; i++) {
40579currentTopic.splice(toremove[i], 1);
40580}
40581for (i = 0,
40582l = torun.length; i < l; i++) {
40583torun[i].apply(this.context, args);
40584}
40585}
40586}
40587this.subscribe = function(topic, callback, once) {
40588'use strict'
40589if (!this.topics[topic]) {
40590this.topics[topic] = [[callback, once]];
40591} else {
40592this.topics[topic].push([callback, once]);
40593}
40594return {
40595"topic": topic,
40596"callback": callback
40597};
40598}
40599;
40600this.unsubscribe = function(token) {
40601if (this.topics[token.topic]) {
40602var currentTopic = this.topics[token.topic];
40603for (var i = 0, l = currentTopic.length; i < l; i++) {
40604if (currentTopic[i] && currentTopic[i][0] === token.callback) {
40605currentTopic.splice(i, 1);
40606}
40607}
40608}
40609}
40610}
40611function getColors($e) {
40612var tmp, undef, frontcolor = $e.css('color'), backcolor, e = $e[0];
40613var toOfDOM = false;
40614while (e && !backcolor && !toOfDOM) {
40615try {
40616tmp = $(e).css('background-color');
40617} catch (ex) {
40618tmp = 'transparent';
40619}
40620if (tmp !== 'transparent' && tmp !== 'rgba(0, 0, 0, 0)') {
40621backcolor = tmp;
40622}
40623toOfDOM = e.body;
40624e = e.parentNode;
40625}
40626var rgbaregex = /rgb[a]*\((\d+),\s*(\d+),\s*(\d+)/, hexregex = /#([AaBbCcDdEeFf\d]{2})([AaBbCcDdEeFf\d]{2})([AaBbCcDdEeFf\d]{2})/, frontcolorcomponents;
40627tmp = undef;
40628tmp = frontcolor.match(rgbaregex);
40629if (tmp) {
40630frontcolorcomponents = {
40631'r': parseInt(tmp[1], 10),
40632'g': parseInt(tmp[2], 10),
40633'b': parseInt(tmp[3], 10)
40634};
40635} else {
40636tmp = frontcolor.match(hexregex);
40637if (tmp) {
40638frontcolorcomponents = {
40639'r': parseInt(tmp[1], 16),
40640'g': parseInt(tmp[2], 16),
40641'b': parseInt(tmp[3], 16)
40642};
40643}
40644}
40645var backcolorcomponents
40646if (!backcolor) {
40647if (frontcolorcomponents) {
40648if (Math.max.apply(null, [frontcolorcomponents.r, frontcolorcomponents.g, frontcolorcomponents.b]) > 127) {
40649backcolorcomponents = {
40650'r': 0,
40651'g': 0,
40652'b': 0
40653};
40654} else {
40655backcolorcomponents = {
40656'r': 255,
40657'g': 255,
40658'b': 255
40659};
40660}
40661} else {
40662backcolorcomponents = {
40663'r': 255,
40664'g': 255,
40665'b': 255
40666};
40667}
40668} else {
40669tmp = undef;
40670tmp = backcolor.match(rgbaregex);
40671if (tmp) {
40672backcolorcomponents = {
40673'r': parseInt(tmp[1], 10),
40674'g': parseInt(tmp[2], 10),
40675'b': parseInt(tmp[3], 10)
40676};
40677} else {
40678tmp = backcolor.match(hexregex);
40679if (tmp) {
40680backcolorcomponents = {
40681'r': parseInt(tmp[1], 16),
40682'g': parseInt(tmp[2], 16),
40683'b': parseInt(tmp[3], 16)
40684};
40685}
40686}
40687}
40688var toRGBfn = function(o) {
40689return 'rgb(' + [o.r, o.g, o.b].join(', ') + ')'
40690}, decorcolorcomponents, frontcolorbrightness, adjusted;
40691if (frontcolorcomponents && backcolorcomponents) {
40692var backcolorbrightness = Math.max.apply(null, [frontcolorcomponents.r, frontcolorcomponents.g, frontcolorcomponents.b]);
40693frontcolorbrightness = Math.max.apply(null, [backcolorcomponents.r, backcolorcomponents.g, backcolorcomponents.b]);
40694adjusted = Math.round(frontcolorbrightness + (-1 * (frontcolorbrightness - backcolorbrightness) * 0.75));
40695decorcolorcomponents = {
40696'r': adjusted,
40697'g': adjusted,
40698'b': adjusted
40699};
40700} else if (frontcolorcomponents) {
40701frontcolorbrightness = Math.max.apply(null, [frontcolorcomponents.r, frontcolorcomponents.g, frontcolorcomponents.b]);
40702var polarity = +1;
40703if (frontcolorbrightness > 127) {
40704polarity = -1;
40705}
40706adjusted = Math.round(frontcolorbrightness + (polarity * 96));
40707decorcolorcomponents = {
40708'r': adjusted,
40709'g': adjusted,
40710'b': adjusted
40711};
40712} else {
40713decorcolorcomponents = {
40714'r': 191,
40715'g': 191,
40716'b': 191
40717};
40718}
40719return {
40720'color': frontcolor,
40721'background-color': backcolorcomponents ? toRGBfn(backcolorcomponents) : backcolor,
40722'decor-color': toRGBfn(decorcolorcomponents)
40723};
40724}
40725function Vector(x, y) {
40726this.x = x;
40727this.y = y;
40728this.reverse = function() {
40729return new this.constructor(this.x * -1,this.y * -1);
40730}
40731;
40732this._length = null;
40733this.getLength = function() {
40734if (!this._length) {
40735this._length = Math.sqrt(Math.pow(this.x, 2) + Math.pow(this.y, 2));
40736}
40737return this._length;
40738}
40739;
40740var polarity = function(e) {
40741return Math.round(e / Math.abs(e));
40742};
40743this.resizeTo = function(length) {
40744if (this.x === 0 && this.y === 0) {
40745this._length = 0;
40746} else if (this.x === 0) {
40747this._length = length;
40748this.y = length * polarity(this.y);
40749} else if (this.y === 0) {
40750this._length = length;
40751this.x = length * polarity(this.x);
40752} else {
40753var proportion = Math.abs(this.y / this.x)
40754  , x = Math.sqrt(Math.pow(length, 2) / (1 + Math.pow(proportion, 2)))
40755  , y = proportion * x;
40756this._length = length;
40757this.x = x * polarity(this.x);
40758this.y = y * polarity(this.y);
40759}
40760return this;
40761}
40762;
40763this.angleTo = function(vectorB) {
40764var divisor = this.getLength() * vectorB.getLength();
40765if (divisor === 0) {
40766return 0;
40767} else {
40768return Math.acos(Math.min(Math.max((this.x * vectorB.x + this.y * vectorB.y) / divisor, -1.0), 1.0)) / Math.PI;
40769}
40770}
40771;
40772}
40773function Point(x, y) {
40774this.x = x;
40775this.y = y;
40776this.getVectorToCoordinates = function(x, y) {
40777return new Vector(x - this.x,y - this.y);
40778}
40779;
40780this.getVectorFromCoordinates = function(x, y) {
40781return this.getVectorToCoordinates(x, y).reverse();
40782}
40783;
40784this.getVectorToPoint = function(point) {
40785return new Vector(point.x - this.x,point.y - this.y);
40786}
40787;
40788this.getVectorFromPoint = function(point) {
40789return this.getVectorToPoint(point).reverse();
40790}
40791;
40792}
40793function DataEngine(storageObject, context, startStrokeFn, addToStrokeFn, endStrokeFn) {
40794this.data = storageObject;
40795this.context = context;
40796if (storageObject.length) {
40797var numofstrokes = storageObject.length, stroke, numofpoints;
40798for (var i = 0; i < numofstrokes; i++) {
40799stroke = storageObject[i];
40800numofpoints = stroke.x.length;
40801startStrokeFn.call(context, stroke);
40802for (var j = 1; j < numofpoints; j++) {
40803addToStrokeFn.call(context, stroke, j);
40804}
40805endStrokeFn.call(context, stroke);
40806}
40807}
40808this.changed = function() {}
40809;
40810this.startStrokeFn = startStrokeFn;
40811this.addToStrokeFn = addToStrokeFn;
40812this.endStrokeFn = endStrokeFn;
40813this.inStroke = false;
40814this._lastPoint = null;
40815this._stroke = null;
40816this.startStroke = function(point) {
40817if (point && typeof (point.x) == "number" && typeof (point.y) == "number") {
40818this._stroke = {
40819'x': [point.x],
40820'y': [point.y]
40821};
40822this.data.push(this._stroke);
40823this._lastPoint = point;
40824this.inStroke = true;
40825var stroke = this._stroke
40826  , fn = this.startStrokeFn
40827  , context = this.context;
40828setTimeout(function() {
40829fn.call(context, stroke)
40830}, 3);
40831return point;
40832} else {
40833return null;
40834}
40835}
40836;
40837this.addToStroke = function(point) {
40838if (this.inStroke && typeof (point.x) === "number" && typeof (point.y) === "number" && (Math.abs(point.x - this._lastPoint.x) + Math.abs(point.y - this._lastPoint.y)) > 4) {
40839var positionInStroke = this._stroke.x.length;
40840this._stroke.x.push(point.x);
40841this._stroke.y.push(point.y);
40842this._lastPoint = point;
40843var stroke = this._stroke
40844  , fn = this.addToStrokeFn
40845  , context = this.context;
40846setTimeout(function() {
40847fn.call(context, stroke, positionInStroke)
40848}, 3);
40849return point;
40850} else {
40851return null;
40852}
40853}
40854;
40855this.endStroke = function() {
40856var c = this.inStroke;
40857this.inStroke = false;
40858this._lastPoint = null;
40859if (c) {
40860var stroke = this._stroke
40861  , fn = this.endStrokeFn
40862  , context = this.context
40863  , changedfn = this.changed;
40864setTimeout(function() {
40865fn.call(context, stroke);
40866changedfn.call(context);
40867}, 3);
40868return true;
40869} else {
40870return null;
40871}
40872}
40873;
40874}
40875var basicDot = function(ctx, x, y, size) {
40876var fillStyle = ctx.fillStyle;
40877ctx.fillStyle = ctx.strokeStyle;
40878ctx.fillRect(x + size / -2, y + size / -2, size, size);
40879ctx.fillStyle = fillStyle;
40880}
40881  , basicLine = function(ctx, startx, starty, endx, endy) {
40882ctx.beginPath();
40883ctx.moveTo(startx, starty);
40884ctx.lineTo(endx, endy);
40885ctx.closePath();
40886ctx.stroke();
40887}
40888  , basicCurve = function(ctx, startx, starty, endx, endy, cp1x, cp1y, cp2x, cp2y) {
40889ctx.beginPath();
40890ctx.moveTo(startx, starty);
40891ctx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, endx, endy);
40892ctx.closePath();
40893ctx.stroke();
40894}
40895  , strokeStartCallback = function(stroke) {
40896basicDot(this.canvasContext, stroke.x[0], stroke.y[0], this.settings.lineWidth);
40897}
40898  , strokeAddCallback = function(stroke, positionInStroke) {
40899var Cpoint = new Point(stroke.x[positionInStroke - 1],stroke.y[positionInStroke - 1])
40900  , Dpoint = new Point(stroke.x[positionInStroke],stroke.y[positionInStroke])
40901  , CDvector = Cpoint.getVectorToPoint(Dpoint);
40902if (positionInStroke > 1) {
40903var Bpoint = new Point(stroke.x[positionInStroke - 2],stroke.y[positionInStroke - 2]), BCvector = Bpoint.getVectorToPoint(Cpoint), ABvector;
40904if (BCvector.getLength() > this.lineCurveThreshold) {
40905if (positionInStroke > 2) {
40906ABvector = (new Point(stroke.x[positionInStroke - 3],stroke.y[positionInStroke - 3])).getVectorToPoint(Bpoint);
40907} else {
40908ABvector = new Vector(0,0);
40909}
40910var minlenfraction = 0.05
40911  , maxlen = BCvector.getLength() * 0.35
40912  , ABCangle = BCvector.angleTo(ABvector.reverse())
40913  , BCDangle = CDvector.angleTo(BCvector.reverse())
40914  , BCP1vector = new Vector(ABvector.x + BCvector.x,ABvector.y + BCvector.y).resizeTo(Math.max(minlenfraction, ABCangle) * maxlen)
40915  , CCP2vector = (new Vector(BCvector.x + CDvector.x,BCvector.y + CDvector.y)).reverse().resizeTo(Math.max(minlenfraction, BCDangle) * maxlen);
40916basicCurve(this.canvasContext, Bpoint.x, Bpoint.y, Cpoint.x, Cpoint.y, Bpoint.x + BCP1vector.x, Bpoint.y + BCP1vector.y, Cpoint.x + CCP2vector.x, Cpoint.y + CCP2vector.y);
40917}
40918}
40919if (CDvector.getLength() <= this.lineCurveThreshold) {
40920basicLine(this.canvasContext, Cpoint.x, Cpoint.y, Dpoint.x, Dpoint.y);
40921}
40922}
40923  , strokeEndCallback = function(stroke) {
40924var positionInStroke = stroke.x.length - 1;
40925if (positionInStroke > 0) {
40926var Cpoint = new Point(stroke.x[positionInStroke],stroke.y[positionInStroke]), Bpoint = new Point(stroke.x[positionInStroke - 1],stroke.y[positionInStroke - 1]), BCvector = Bpoint.getVectorToPoint(Cpoint), ABvector;
40927if (BCvector.getLength() > this.lineCurveThreshold) {
40928if (positionInStroke > 1) {
40929ABvector = (new Point(stroke.x[positionInStroke - 2],stroke.y[positionInStroke - 2])).getVectorToPoint(Bpoint);
40930var BCP1vector = new Vector(ABvector.x + BCvector.x,ABvector.y + BCvector.y).resizeTo(BCvector.getLength() / 2);
40931basicCurve(this.canvasContext, Bpoint.x, Bpoint.y, Cpoint.x, Cpoint.y, Bpoint.x + BCP1vector.x, Bpoint.y + BCP1vector.y, Cpoint.x, Cpoint.y);
40932} else {
40933basicLine(this.canvasContext, Bpoint.x, Bpoint.y, Cpoint.x, Cpoint.y);
40934}
40935}
40936}
40937}
40938function conditionallyLinkCanvasResizeToWindowResize(jSignatureInstance, settingsWidth, apinamespace, globalEvents) {
40939'use strict'
40940if (settingsWidth === 'ratio' || settingsWidth.split('')[settingsWidth.length - 1] === '%') {
40941this.eventTokens[apinamespace + '.parentresized'] = globalEvents.subscribe(apinamespace + '.parentresized', (function(eventTokens, $parent, originalParentWidth, sizeRatio) {
40942'use strict'
40943return function() {
40944'use strict'
40945var w = $parent.width();
40946if (w !== originalParentWidth) {
40947for (var key in eventTokens) {
40948if (eventTokens.hasOwnProperty(key)) {
40949globalEvents.unsubscribe(eventTokens[key]);
40950delete eventTokens[key];
40951}
40952}
40953var settings = jSignatureInstance.settings;
40954jSignatureInstance.$parent.children().remove();
40955for (var key in jSignatureInstance) {
40956if (jSignatureInstance.hasOwnProperty(key)) {
40957delete jSignatureInstance[key];
40958}
40959}
40960settings.data = (function(data, scale) {
40961var newData = [];
40962var o, i, l, j, m, stroke;
40963for (i = 0,
40964l = data.length; i < l; i++) {
40965stroke = data[i];
40966o = {
40967'x': [],
40968'y': []
40969};
40970for (j = 0,
40971m = stroke.x.length; j < m; j++) {
40972o.x.push(stroke.x[j] * scale);
40973o.y.push(stroke.y[j] * scale);
40974}
40975newData.push(o);
40976}
40977return newData;
40978}
40979)(settings.data, w * 1.0 / originalParentWidth)
40980$parent[apinamespace](settings);
40981}
40982}
40983}
40984)(this.eventTokens, this.$parent, this.$parent.width(), this.canvas.width * 1.0 / this.canvas.height))
40985}
40986}
40987;function jSignatureClass(parent, options, instanceExtensions) {
40988var $parent = this.$parent = $(parent)
40989  , eventTokens = this.eventTokens = {}
40990  , events = this.events = new PubSubClass(this)
40991  , globalEvents = $.fn[apinamespace]('globalEvents')
40992  , settings = {
40993'width': 'ratio',
40994'height': 'ratio',
40995'sizeRatio': 4,
40996'color': '#000',
40997'background-color': '#fff',
40998'decor-color': '#eee',
40999'lineWidth': 0,
41000'minFatFingerCompensation': -10,
41001'showUndoButton': false,
41002'readOnly': false,
41003'data': []
41004};
41005$.extend(settings, getColors($parent));
41006if (options) {
41007$.extend(settings, options);
41008}
41009this.settings = settings;
41010for (var extensionName in instanceExtensions) {
41011if (instanceExtensions.hasOwnProperty(extensionName)) {
41012instanceExtensions[extensionName].call(this, extensionName);
41013}
41014}
41015this.events.publish(apinamespace + '.initializing');
41016this.$controlbarUpper = (function() {
41017var controlbarstyle = 'padding:0 !important; margin:0 !important;' + 'width: 100% !important; height: 0 !important; -ms-touch-action: none;' + 'margin-top:-1em !important; margin-bottom:1em !important;';
41018return $('<div style="' + controlbarstyle + '"></div>').appendTo($parent);
41019}
41020)();
41021this.isCanvasEmulator = false;
41022var canvas = this.canvas = this.initializeCanvas(settings)
41023  , $canvas = $(canvas);
41024this.$controlbarLower = (function() {
41025var controlbarstyle = 'padding:0 !important; margin:0 !important;' + 'width: 100% !important; height: 0 !important; -ms-touch-action: none;' + 'margin-top:-1.5em !important; margin-bottom:1.5em !important; position: relative;';
41026return $('<div style="' + controlbarstyle + '"></div>').appendTo($parent);
41027}
41028)();
41029this.canvasContext = canvas.getContext("2d");
41030$canvas.data(apinamespace + '.this', this);
41031settings.lineWidth = (function(defaultLineWidth, canvasWidth) {
41032if (!defaultLineWidth) {
41033return Math.max(Math.round(canvasWidth / 400), 2);
41034} else {
41035return defaultLineWidth;
41036}
41037}
41038)(settings.lineWidth, canvas.width);
41039this.lineCurveThreshold = settings.lineWidth * 3;
41040if (settings.cssclass && $.trim(settings.cssclass) != "") {
41041$canvas.addClass(settings.cssclass);
41042}
41043this.fatFingerCompensation = 0;
41044var movementHandlers = (function(jSignatureInstance) {
41045var shiftX, shiftY, setStartValues = function() {
41046var tos = $(jSignatureInstance.canvas).offset()
41047shiftX = tos.left * -1
41048shiftY = tos.top * -1
41049}, getPointFromEvent = function(e) {
41050var firstEvent = (e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches[0] : e);
41051return new Point(Math.round(firstEvent.pageX + shiftX),Math.round(firstEvent.pageY + shiftY) + jSignatureInstance.fatFingerCompensation);
41052}, timer = new KickTimerClass(750,function() {
41053jSignatureInstance.dataEngine.endStroke();
41054}
41055);
41056this.drawEndHandler = function(e) {
41057if (!jSignatureInstance.settings.readOnly) {
41058try {
41059e.preventDefault();
41060} catch (ex) {}
41061timer.clear();
41062jSignatureInstance.dataEngine.endStroke();
41063}
41064}
41065;
41066this.drawStartHandler = function(e) {
41067if (!jSignatureInstance.settings.readOnly) {
41068e.preventDefault();
41069setStartValues();
41070jSignatureInstance.dataEngine.startStroke(getPointFromEvent(e));
41071timer.kick();
41072}
41073}
41074;
41075this.drawMoveHandler = function(e) {
41076if (!jSignatureInstance.settings.readOnly) {
41077e.preventDefault();
41078if (!jSignatureInstance.dataEngine.inStroke) {
41079return;
41080}
41081jSignatureInstance.dataEngine.addToStroke(getPointFromEvent(e));
41082timer.kick();
41083}
41084}
41085;
41086return this;
41087}
41088).call({}, this);
41089(function(drawEndHandler, drawStartHandler, drawMoveHandler) {
41090var canvas = this.canvas, $canvas = $(canvas), undef;
41091if (this.isCanvasEmulator) {
41092$canvas.bind('mousemove.' + apinamespace, drawMoveHandler);
41093$canvas.bind('mouseup.' + apinamespace, drawEndHandler);
41094$canvas.bind('mousedown.' + apinamespace, drawStartHandler);
41095} else {
41096canvas.ontouchstart = function(e) {
41097canvas.onmousedown = canvas.onmouseup = canvas.onmousemove = undef;
41098this.fatFingerCompensation = (settings.minFatFingerCompensation && settings.lineWidth * -3 > settings.minFatFingerCompensation) ? settings.lineWidth * -3 : settings.minFatFingerCompensation;
41099drawStartHandler(e);
41100canvas.ontouchend = drawEndHandler;
41101canvas.ontouchstart = drawStartHandler;
41102canvas.ontouchmove = drawMoveHandler;
41103}
41104;
41105canvas.onmousedown = function(e) {
41106canvas.ontouchstart = canvas.ontouchend = canvas.ontouchmove = undef;
41107drawStartHandler(e);
41108canvas.onmousedown = drawStartHandler;
41109canvas.onmouseup = drawEndHandler;
41110canvas.onmousemove = drawMoveHandler;
41111}
41112if (window.navigator.msPointerEnabled) {
41113canvas.onmspointerdown = drawStartHandler;
41114canvas.onmspointerup = drawEndHandler;
41115canvas.onmspointermove = drawMoveHandler;
41116}
41117}
41118}
41119).call(this, movementHandlers.drawEndHandler, movementHandlers.drawStartHandler, movementHandlers.drawMoveHandler)
41120eventTokens[apinamespace + '.windowmouseup'] = globalEvents.subscribe(apinamespace + '.windowmouseup', movementHandlers.drawEndHandler);
41121this.events.publish(apinamespace + '.attachingEventHandlers');
41122conditionallyLinkCanvasResizeToWindowResize.call(this, this, settings.width.toString(10), apinamespace, globalEvents);
41123this.resetCanvas(settings.data);
41124this.events.publish(apinamespace + '.initialized');
41125return this;
41126}
41127jSignatureClass.prototype.resetCanvas = function(data, dontClear) {
41128var canvas = this.canvas
41129  , settings = this.settings
41130  , ctx = this.canvasContext
41131  , isCanvasEmulator = this.isCanvasEmulator
41132  , cw = canvas.width
41133  , ch = canvas.height;
41134if (!dontClear) {
41135ctx.clearRect(0, 0, cw + 30, ch + 30);
41136}
41137ctx.shadowColor = ctx.fillStyle = settings['background-color']
41138if (isCanvasEmulator) {
41139ctx.fillRect(0, 0, cw + 30, ch + 30);
41140}
41141ctx.lineWidth = Math.ceil(parseInt(settings.lineWidth, 10));
41142ctx.lineCap = ctx.lineJoin = "round";
41143if (null != settings['decor-color']) {
41144ctx.strokeStyle = settings['decor-color'];
41145ctx.shadowOffsetX = 0;
41146ctx.shadowOffsetY = 0;
41147var lineoffset = Math.round(ch / 5);
41148basicLine(ctx, lineoffset * 1.5, ch - lineoffset, cw - (lineoffset * 1.5), ch - lineoffset);
41149}
41150ctx.strokeStyle = settings.color;
41151if (!isCanvasEmulator) {
41152ctx.shadowColor = ctx.strokeStyle;
41153ctx.shadowOffsetX = ctx.lineWidth * 0.5;
41154ctx.shadowOffsetY = ctx.lineWidth * -0.6;
41155ctx.shadowBlur = 0;
41156}
41157if (!data) {
41158data = [];
41159}
41160var dataEngine = this.dataEngine = new DataEngine(data,this,strokeStartCallback,strokeAddCallback,strokeEndCallback);
41161settings.data = data;
41162$(canvas).data(apinamespace + '.data', data).data(apinamespace + '.settings', settings);
41163dataEngine.changed = (function(target, events, apinamespace) {
41164'use strict'
41165return function() {
41166events.publish(apinamespace + '.change');
41167target.trigger('change');
41168}
41169}
41170)(this.$parent, this.events, apinamespace);
41171dataEngine.changed();
41172return true;
41173}
41174;
41175function initializeCanvasEmulator(canvas) {
41176if (canvas.getContext) {
41177return false;
41178} else {
41179var window = canvas.ownerDocument.parentWindow;
41180var FC = window.FlashCanvas ? canvas.ownerDocument.parentWindow.FlashCanvas : (typeof FlashCanvas === "undefined" ? undefined : FlashCanvas);
41181if (FC) {
41182canvas = FC.initElement(canvas);
41183var zoom = 1;
41184if (window && window.screen && window.screen.deviceXDPI && window.screen.logicalXDPI) {
41185zoom = window.screen.deviceXDPI * 1.0 / window.screen.logicalXDPI;
41186}
41187if (zoom !== 1) {
41188try {
41189$(canvas).children('object').get(0).resize(Math.ceil(canvas.width * zoom), Math.ceil(canvas.height * zoom));
41190canvas.getContext('2d').scale(zoom, zoom);
41191} catch (ex) {}
41192}
41193return true;
41194} else {
41195throw new Error("Canvas element does not support 2d context. jSignature cannot proceed.");
41196}
41197}
41198}
41199jSignatureClass.prototype.initializeCanvas = function(settings) {
41200var canvas = document.createElement('canvas')
41201  , $canvas = $(canvas);
41202if (settings.width === settings.height && settings.height === 'ratio') {
41203settings.width = '100%';
41204}
41205$canvas.css('margin', 0).css('padding', 0).css('border', 'none').css('height', settings.height === 'ratio' || !settings.height ? 1 : settings.height.toString(10)).css('width', settings.width === 'ratio' || !settings.width ? 1 : settings.width.toString(10)).css('-ms-touch-action', 'none').css('background-color', settings['background-color']);
41206$canvas.appendTo(this.$parent);
41207if (settings.height === 'ratio') {
41208$canvas.css('height', Math.round($canvas.width() / settings.sizeRatio));
41209} else if (settings.width === 'ratio') {
41210$canvas.css('width', Math.round($canvas.height() * settings.sizeRatio));
41211}
41212$canvas.addClass(apinamespace);
41213canvas.width = $canvas.width();
41214canvas.height = $canvas.height();
41215this.isCanvasEmulator = initializeCanvasEmulator(canvas);
41216canvas.onselectstart = function(e) {
41217if (e && e.preventDefault) {
41218e.preventDefault()
41219}
41220;if (e && e.stopPropagation) {
41221e.stopPropagation()
41222}
41223;return false;
41224}
41225;
41226return canvas;
41227}
41228var GlobalJSignatureObjectInitializer = function(window) {
41229var globalEvents = new PubSubClass();
41230;(function(globalEvents, apinamespace, $, window) {
41231'use strict'
41232var resizetimer, runner = function() {
41233globalEvents.publish(apinamespace + '.parentresized')
41234};
41235$(window).bind('resize.' + apinamespace, function() {
41236if (resizetimer) {
41237clearTimeout(resizetimer);
41238}
41239resizetimer = setTimeout(runner, 500);
41240}).bind('mouseup.' + apinamespace, function(e) {
41241globalEvents.publish(apinamespace + '.windowmouseup')
41242});
41243}
41244)(globalEvents, apinamespace, $, window)
41245var jSignatureInstanceExtensions = {};
41246var exportplugins = {
41247'default': function(data) {
41248return this.toDataURL()
41249},
41250'native': function(data) {
41251return data
41252},
41253'image': function(data) {
41254var imagestring = this.toDataURL();
41255if (typeof imagestring === 'string' && imagestring.length > 4 && imagestring.slice(0, 5) === 'data:' && imagestring.indexOf(',') !== -1) {
41256var splitterpos = imagestring.indexOf(',');
41257return [imagestring.slice(5, splitterpos), imagestring.substr(splitterpos + 1)];
41258}
41259return [];
41260}
41261};
41262function _renderImageOnCanvas(data, formattype, rerendercallable) {
41263'use strict'
41264var img = new Image()
41265  , c = this;
41266img.onload = function() {
41267var ctx = c.getContext("2d");
41268var oldShadowColor = ctx.shadowColor;
41269ctx.shadowColor = "transparent";
41270ctx.drawImage(img, 0, 0, (img.width < c.width) ? img.width : c.width, (img.height < c.height) ? img.height : c.height);
41271ctx.shadowColor = oldShadowColor;
41272}
41273;
41274img.src = 'data:' + formattype + ',' + data;
41275}
41276var importplugins = {
41277'native': function(data, formattype, rerendercallable) {
41278rerendercallable(data);
41279},
41280'image': _renderImageOnCanvas,
41281'image/png;base64': _renderImageOnCanvas,
41282'image/jpeg;base64': _renderImageOnCanvas,
41283'image/jpg;base64': _renderImageOnCanvas
41284};
41285function _clearDrawingArea(data, dontClear) {
41286this.find('canvas.' + apinamespace).add(this.filter('canvas.' + apinamespace)).data(apinamespace + '.this').resetCanvas(data, dontClear);
41287return this;
41288}
41289function _setDrawingData(data, formattype) {
41290var undef;
41291if (formattype === undef && typeof data === 'string' && data.substr(0, 5) === 'data:') {
41292formattype = data.slice(5).split(',')[0];
41293data = data.slice(6 + formattype.length);
41294if (formattype === data) {
41295return;
41296}
41297}
41298var $canvas = this.find('canvas.' + apinamespace).add(this.filter('canvas.' + apinamespace));
41299if (!importplugins.hasOwnProperty(formattype)) {
41300throw new Error(apinamespace + " is unable to find import plugin with for format '" + String(formattype) + "'");
41301} else if ($canvas.length !== 0) {
41302importplugins[formattype].call($canvas[0], data, formattype, (function(jSignatureInstance) {
41303return function() {
41304return jSignatureInstance.resetCanvas.apply(jSignatureInstance, arguments)
41305}
41306}
41307)($canvas.data(apinamespace + '.this')));
41308}
41309return this;
41310}
41311var elementIsOrphan = function(e) {
41312var topOfDOM = false;
41313e = e.parentNode;
41314while (e && !topOfDOM) {
41315topOfDOM = e.body;
41316e = e.parentNode;
41317}
41318return !topOfDOM;
41319}
41320var plugins = {
41321'export': exportplugins,
41322'import': importplugins,
41323'instance': jSignatureInstanceExtensions
41324}
41325  , methods = {
41326'init': function(options) {
41327return this.each(function() {
41328if (!elementIsOrphan(this)) {
41329new jSignatureClass(this,options,jSignatureInstanceExtensions);
41330}
41331})
41332},
41333'getSettings': function() {
41334return this.find('canvas.' + apinamespace).add(this.filter('canvas.' + apinamespace)).data(apinamespace + '.this').settings;
41335},
41336'isModified': function() {
41337return this.find('canvas.' + apinamespace).add(this.filter('canvas.' + apinamespace)).data(apinamespace + '.this').dataEngine._stroke !== null;
41338},
41339'updateSetting': function(param, val, forFuture) {
41340var $canvas = this.find('canvas.' + apinamespace).add(this.filter('canvas.' + apinamespace)).data(apinamespace + '.this');
41341$canvas.settings[param] = val;
41342$canvas.resetCanvas((forFuture ? null : $canvas.settings.data), true);
41343return $canvas.settings[param];
41344},
41345'clear': _clearDrawingArea,
41346'reset': _clearDrawingArea,
41347'addPlugin': function(pluginType, pluginName, callable) {
41348if (plugins.hasOwnProperty(pluginType)) {
41349plugins[pluginType][pluginName] = callable;
41350}
41351return this;
41352},
41353'listPlugins': function(pluginType) {
41354var answer = [];
41355if (plugins.hasOwnProperty(pluginType)) {
41356var o = plugins[pluginType];
41357for (var k in o) {
41358if (o.hasOwnProperty(k)) {
41359answer.push(k);
41360}
41361}
41362}
41363return answer;
41364},
41365'getData': function(formattype) {
41366var undef, $canvas = this.find('canvas.' + apinamespace).add(this.filter('canvas.' + apinamespace));
41367if (formattype === undef) {
41368formattype = 'default';
41369}
41370if ($canvas.length !== 0 && exportplugins.hasOwnProperty(formattype)) {
41371return exportplugins[formattype].call($canvas.get(0), $canvas.data(apinamespace + '.data'), $canvas.data(apinamespace + '.settings'));
41372}
41373},
41374'importData': _setDrawingData,
41375'setData': _setDrawingData,
41376'globalEvents': function() {
41377return globalEvents
41378},
41379'disable': function() {
41380this.find("input").attr("disabled", 1);
41381this.find('canvas.' + apinamespace).addClass("disabled").data(apinamespace + '.this').settings.readOnly = true;
41382},
41383'enable': function() {
41384this.find("input").removeAttr("disabled");
41385this.find('canvas.' + apinamespace).removeClass("disabled").data(apinamespace + '.this').settings.readOnly = false;
41386},
41387'events': function() {
41388return this.find('canvas.' + apinamespace).add(this.filter('canvas.' + apinamespace)).data(apinamespace + '.this').events;
41389}
41390}
41391$.fn[apinamespace] = function(method) {
41392'use strict'
41393if (!method || typeof method === 'object') {
41394return methods.init.apply(this, arguments);
41395} else if (typeof method === 'string' && methods[method]) {
41396return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
41397} else {
41398$.error('Method ' + String(method) + ' does not exist on jQuery.' + apinamespace);
41399}
41400}
41401}
41402GlobalJSignatureObjectInitializer(window)
41403}
41404)();
41405;
41406/* /website/static/src/js/tours/website_tour_reset_password.js defined in bundle 'web.assets_common' */
41407odoo.define('website.tour_reset_password', function(require) {
41408'use strict';
41409var base = require('web_editor.base');
41410var localStorage = require('web.local_storage');
41411var rpc = require('web.rpc');
41412var tour = require('web_tour.tour');
41413var currentDomain = window.location.protocol + '//' + window.location.hostname;
41414var emailsUrl = '/web#action=mail.action_view_mail_mail&view_type=list';
41415var usersUrl = '/web#action=base.action_res_users&view_type=list';
41416var resetLinkKey = 'website.tour_reset_password.resetLink';
41417tour.register('website_reset_password', {
41418test: true,
41419url: '/web',
41420wait_for: base.ready(),
41421}, [{
41422content: "Change the domain of the websites and go to users page",
41423trigger: '.oe_topbar_name:contains("Admin")',
41424run: function() {
41425var def1 = rpc.query({
41426'model': 'website',
41427'method': 'write',
41428'args': [[1], {
41429'domain': "my-test-domain.com",
41430}],
41431});
41432var def2 = rpc.query({
41433'model': 'website',
41434'method': 'write',
41435'args': [[2], {
41436'domain': "https://domain-not-used.fr",
41437}],
41438});
41439var def3 = rpc.query({
41440model: 'res.partner',
41441method: 'name_search',
41442kwargs: {
41443'name': 'Mitchell Admin'
41444},
41445}).then(function(res) {
41446return rpc.query({
41447'model': 'res.partner',
41448'method': 'write',
41449'args': [[res[0][0]], {
41450'website_id': 1,
41451}],
41452});
41453});
41454return $.when(def1, def2, def3).then(function() {
41455window.location.href = usersUrl;
41456});
41457},
41458}, {
41459content: "click on Admin",
41460trigger: '.o_data_cell:contains("Admin")',
41461}, {
41462content: "click on reset password",
41463trigger: '.btn[name="action_reset_password"]',
41464}, {
41465content: "wait mail to be sent, and go see it",
41466trigger: 'a[name="signup_url"][href^="http://my-test-domain.com"]',
41467run: function() {
41468window.location.href = emailsUrl;
41469},
41470}, {
41471content: "click on the first email",
41472trigger: '.o_data_cell:contains("Password reset"):eq(0)',
41473}, {
41474content: "check page has an iframe",
41475trigger: 'iframe body',
41476run: function() {
41477var content = $('iframe').contents()[0];
41478console.log(content && new XMLSerializer().serializeToString(content));
41479},
41480}, {
41481content: "check iframe has the button",
41482trigger: 'iframe a:contains("Change password")',
41483run: function() {},
41484}, {
41485content: "check the URL is correct too",
41486trigger: 'iframe a:contains("Change password")[href^="http://my-test-domain.com"]',
41487run: function() {
41488return rpc.query({
41489'model': 'website',
41490'method': 'write',
41491'args': [[1, 2], {
41492'domain': "",
41493}],
41494}).then(function() {
41495window.location.href = usersUrl;
41496});
41497},
41498}, {
41499content: "click on Admin",
41500trigger: '.o_data_cell:contains("Admin")',
41501}, {
41502content: "click on reset password",
41503trigger: '.btn[name="action_reset_password"]',
41504}, {
41505content: "wait mail to be sent, and go see it",
41506trigger: 'a[name="signup_url"][href^="' + currentDomain + '"]',
41507run: function() {
41508window.location.href = emailsUrl;
41509},
41510}, {
41511content: "click on the first email",
41512trigger: '.o_data_cell:contains("Password reset"):eq(0)',
41513}, {
41514content: "check the link has the current host, save the link, logout",
41515trigger: 'iframe a:contains("Change password")[href^="' + currentDomain + '"]',
41516run: function() {
41517var link = $('iframe').contents().find('a:contains("Change password")').attr('href');
41518localStorage.setItem(resetLinkKey, link);
41519window.location.href = "/web/session/logout?redirect=/";
41520},
41521}, {
41522content: "go to the reset link",
41523trigger: 'a[href="/web/login"]',
41524run: function() {
41525window.location.href = localStorage.getItem(resetLinkKey);
41526},
41527}, {
41528content: "fill new password and submit",
41529trigger: '.oe_reset_password_form',
41530run: function() {
41531var $form = $('.oe_reset_password_form');
41532$form.find('input[name="password"]').val('adminadmin');
41533$form.find('input[name="confirm_password"]').val('adminadmin');
41534$form.find('button[type="submit"]').click();
41535},
41536}, {
41537content: "check logged in, and reset admin website",
41538trigger: '.oe_topbar_name:contains("Admin")',
41539run: function() {
41540return rpc.query({
41541model: 'res.partner',
41542method: 'name_search',
41543kwargs: {
41544'name': 'Admin'
41545},
41546}).then(function(res) {
41547return rpc.query({
41548'model': 'res.partner',
41549'method': 'write',
41550'args': [[res[0][0]], {
41551'website_id': false,
41552}],
41553});
41554});
41555},
41556}, ]);
41557});
41558;
41559/* /website_sale/static/src/js/website_sale_tour_shop.js defined in bundle 'web.assets_common' */
41560odoo.define("website_sale.tour_shop", function(require) {
41561"use strict";
41562var core = require("web.core");
41563var tour = require("web_tour.tour");
41564var base = require("web_editor.base");
41565var _t = core._t;
41566tour.register("shop", {
41567url: "/shop",
41568wait_for: base.ready(),
41569}, [{
41570trigger: "#new-content-menu > a",
41571content: _t("Let's create your first product."),
41572extra_trigger: ".js_sale",
41573position: "bottom",
41574}, {
41575trigger: "a[data-action=new_product]",
41576content: _t("Select <b>New Product</b> to create it and manage its properties to boost your sales."),
41577position: "bottom",
41578}, {
41579trigger: ".modal-dialog #editor_new_product input[type=text]",
41580content: _t("Enter a name for your new product"),
41581position: "right",
41582}, {
41583trigger: ".modal-footer button.btn-primary.btn-continue",
41584content: _t("Click on <em>Continue</em> to create the product."),
41585position: "right",
41586}, {
41587trigger: ".product_price .o_is_inline_editable .oe_currency_value",
41588content: _t("Edit the price of this product by clicking on the amount."),
41589position: "bottom",
41590run: "text 1.99",
41591}, {
41592trigger: "#wrap img.product_detail_img",
41593extra_trigger: ".product_price .o_is_inline_editable .oe_currency_value:not(:containsExact(1.00))",
41594content: _t("Double click here to set an image describing your product."),
41595position: "top",
41596run: function(actions) {
41597actions.dblclick();
41598},
41599}, {
41600trigger: ".o_select_media_dialog .o_upload_image_button",
41601content: _t("Upload an image from your local library."),
41602position: "bottom",
41603run: function(actions) {
41604actions.auto(".modal-footer .btn-secondary");
41605},
41606}, {
41607trigger: "#snippet_structure .oe_snippet:eq(8) .oe_snippet_thumbnail",
41608extra_trigger: "body:not(.modal-open)",
41609content: _t("Drag this website block and drop it in your page."),
41610position: "bottom",
41611run: "drag_and_drop",
41612}, {
41613trigger: "button[data-action=save]",
41614content: _t("Once you click on <b>Save</b>, your product is updated."),
41615position: "bottom",
41616}, {
41617trigger: ".js_publish_management .js_publish_btn .css_publish",
41618extra_trigger: "body:not(.editor_enable)",
41619content: _t("Click on this button so your customers can see it."),
41620position: "bottom",
41621}, {
41622trigger: ".o_main_navbar .o_menu_toggle, #oe_applications .dropdown-toggle",
41623content: _t("Let's now take a look at your administration dashboard to get your eCommerce website ready in no time."),
41624position: "bottom",
41625}, {
41626trigger: '.o_apps > a[data-menu-xmlid="website.menu_website_configuration"], #oe_main_menu_navbar a[data-menu-xmlid="website.menu_website_configuration"]',
41627content: _t("Open your website app here."),
41628extra_trigger: ".o_apps,#oe_applications",
41629position: "bottom",
41630}]);
41631});
41632;
41633/* /website_sale/static/src/js/website_sale_tour_shop_cart_recovery.js defined in bundle 'web.assets_common' */
41634odoo.define('website_sale.tour_shop_cart_recovery', function(require) {
41635'use strict';
41636var base = require('web_editor.base');
41637var localStorage = require('web.local_storage');
41638var rpc = require('web.rpc');
41639var tour = require('web_tour.tour');
41640var orderIdKey = 'website_sale.tour_shop_cart_recovery.orderId';
41641var recoveryLinkKey = 'website_sale.tour_shop_cart_recovery.recoveryLink';
41642tour.register('shop_cart_recovery', {
41643test: true,
41644url: '/shop?search=Acoustic Bloc Screens',
41645wait_for: base.ready(),
41646}, [{
41647content: "select Acoustic Bloc Screens",
41648trigger: '.oe_product_cart a:containsExact("Acoustic Bloc Screens")',
41649}, {
41650content: "click add to cart",
41651trigger: '#product_details #add_to_cart',
41652}, {
41653content: "check product is in cart, get cart id, logout, go to login",
41654trigger: 'td.td-product_name:contains("Acoustic Bloc Screens")',
41655run: function() {
41656rpc.query({
41657'model': 'website',
41658'method': 'sale_get_order',
41659'args': [[$('html').data('website-id')]],
41660}).then(function(data) {
41661var orderId = parseInt(data.match(/sale\.order\((\d+),\)/)[1]);
41662localStorage.setItem(orderIdKey, orderId);
41663window.location.href = "/web/session/logout?redirect=/web/login";
41664});
41665},
41666}, {
41667content: "login as admin and go to the SO (backend)",
41668trigger: '.oe_login_form',
41669run: function() {
41670var orderId = localStorage.getItem(orderIdKey);
41671var url = "/web#action=sale.action_orders&view_type=form&id=" + orderId;
41672var $loginForm = $('.oe_login_form');
41673$loginForm.find('input[name="login"]').val("admin");
41674$loginForm.find('input[name="password"]').val("admin");
41675$loginForm.find('input[name="redirect"]').val(url);
41676$loginForm.submit();
41677},
41678}, {
41679content: "click action",
41680trigger: '.btn:containsExact("Action")',
41681}, {
41682content: "click Send a Cart Recovery Email",
41683trigger: 'a:containsExact("Send a Cart Recovery Email")',
41684}, {
41685content: "click Send email",
41686trigger: '.btn[name="action_send_mail"]',
41687}, {
41688content: "check the mail is sent, grab the recovery link, and logout",
41689trigger: '.o_thread_message_content a:containsExact("Resume order")',
41690run: function() {
41691var link = $('.o_thread_message_content a:containsExact("Resume order")').attr('href');
41692localStorage.setItem(recoveryLinkKey, link);
41693window.location.href = "/web/session/logout?redirect=/";
41694}
41695}, {
41696content: "go to the recovery link",
41697trigger: 'a[href="/web/login"]',
41698run: function() {
41699window.location.href = localStorage.getItem(recoveryLinkKey);
41700},
41701}, {
41702content: "check the page is working, click on restore",
41703extra_trigger: 'p:contains("This is your current cart")',
41704trigger: 'p:contains("restore") a:contains("Click here")',
41705}, {
41706content: "check product is in restored cart",
41707trigger: 'td.td-product_name:contains("Acoustic Bloc Screens")',
41708run: function() {},
41709}, ]);
41710});
41711;
41712/* /website_sale/static/src/js/website_sale_tour_shop_mail.js defined in bundle 'web.assets_common' */
41713odoo.define('website_sale.tour_shop_mail', function(require) {
41714'use strict';
41715var base = require('web_editor.base');
41716var rpc = require('web.rpc');
41717var tour = require('web_tour.tour');
41718tour.register('shop_mail', {
41719test: true,
41720url: '/',
41721wait_for: base.ready(),
41722}, [{
41723content: "Change the domain of the websites and go to shop",
41724trigger: 'body',
41725run: function() {
41726var def1 = rpc.query({
41727'model': 'website',
41728'method': 'write',
41729'args': [[1], {
41730'domain': "my-test-domain.com",
41731}],
41732});
41733var def2 = rpc.query({
41734'model': 'website',
41735'method': 'write',
41736'args': [[2], {
41737'domain': "https://domain-not-used.fr",
41738}],
41739});
41740$.when(def1, def2).then(function(data) {
41741window.location.href = '/shop?search=Acoustic Bloc Screens';
41742});
41743},
41744}, {
41745content: "select Acoustic Bloc Screens",
41746trigger: '.oe_product_cart a:containsExact("Acoustic Bloc Screens")',
41747}, {
41748content: "click add to cart",
41749trigger: '#product_details #add_to_cart',
41750}, {
41751content: "check product is in cart, get cart id, go to backend",
41752trigger: 'td.td-product_name:contains("Acoustic Bloc Screens")',
41753run: function() {
41754rpc.query({
41755'model': 'website',
41756'method': 'sale_get_order',
41757'args': [[$('html').data('website-id')]],
41758}).then(function(data) {
41759var orderId = parseInt(data.match(/sale\.order\((\d+),\)/)[1]);
41760window.location.href = "/web#action=sale.action_orders&view_type=form&id=" + orderId;
41761});
41762},
41763}, {
41764content: "click confirm",
41765trigger: '.btn[name="action_confirm"]',
41766}, {
41767content: "click send by email",
41768trigger: '.btn[name="action_quotation_send"]',
41769extra_trigger: '.o_statusbar_status .btn-primary:contains("Sales Order")',
41770}, {
41771content: "Open recipients dropdown",
41772trigger: '.o_field_many2one[name="partner_ids"] .ui-autocomplete-input',
41773run: 'click',
41774}, {
41775content: "Select azure interior",
41776trigger: '.ui-menu-item a:contains(Interior24)',
41777in_modal: false,
41778}, {
41779content: "click Send email",
41780trigger: '.btn[name="action_send_mail"]',
41781extra_trigger: '.o_badge_text:contains("Azure")',
41782}, {
41783content: "wait mail to be sent, and go see it",
41784trigger: '.o_thread_message_content:contains("Here is"):contains("the order")',
41785run: function() {
41786window.location.href = "/web#action=mail.action_view_mail_mail&view_type=list";
41787},
41788}, {
41789content: "click on the first email",
41790trigger: '.o_data_cell:contains("YourCompany Order")',
41791}, {
41792content: "check it's the correct email, and the URL is correct too",
41793trigger: 'iframe p:contains("Here is"):contains("the order")',
41794extra_trigger: 'iframe a[href^="http://my-test-domain.com"]',
41795}, ]);
41796});
41797;
41798/* /website_crm/static/src/js/website_crm_tour.js defined in bundle 'web.assets_common' */
41799odoo.define('website_crm.tour', function(require) {
41800'use strict';
41801var tour = require('web_tour.tour');
41802var base = require('web_editor.base');
41803tour.register('website_crm_tour', {
41804test: true,
41805url: '/contactus',
41806wait_for: base.ready(),
41807}, [{
41808content: "Complete name",
41809trigger: "input[name=contact_name]",
41810run: "text John Smith",
41811}, {
41812content: "Complete phone number",
41813trigger: "input[name=phone]",
41814run: "text +32 485 118.218"
41815}, {
41816content: "Complete Email",
41817trigger: "input[name=email_from]",
41818run: "text [email protected]"
41819}, {
41820content: "Complete Company",
41821trigger: "input[name=partner_name]",
41822run: "text Odoo S.A."
41823}, {
41824content: "Complete Subject",
41825trigger: "input[name=name]",
41826run: "text Useless message"
41827}, {
41828content: "Complete Subject",
41829trigger: "textarea[name=description]",
41830run: "text ### TOUR DATA ###"
41831}, {
41832content: "Send the form",
41833trigger: ".o_website_form_send"
41834}, {
41835content: "Check we were redirected to the success page",
41836trigger: "#wrap:has(h1:contains('Thanks')):has(div.alert-success)"
41837}]);
41838return {};
41839});
41840;
41841/* /web_tour/static/src/js/tour_disable.js defined in bundle 'web.assets_common' */
41842odoo.define('web_tour.DisableTour', function(require) {
41843"use strict";
41844var TourManager = require('web_tour.TourManager');
41845TourManager.include({
41846_register: function(do_update, tour, name) {
41847if (!this.running_tour) {
41848this.consumed_tours.push(name);
41849}
41850return this._super.apply(this, arguments);
41851},
41852});
41853});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.