PageSourceSearch

https://mibabbo.it/wp-content/themes/rosa/assets/js/plugins.js?ver=2.4.3

js mibabbo.it collected 2026-10-05 07:31:01 UTC 159,078 bytes, 3,893 lines download raw bytes

1/* --- $DEBOUNCES RESIZE --- */
2
3/* debouncedresize: special jQuery event that happens once after a window resize
4 * https://github.com/louisremi/jquery-smartresize
5 * Copyright 2012 @louis_remi
6 * MIT License
7 */
8(function ($) {
9	var $event = $.event, $special, resizeTimeout;
10	$special = $event.special.debouncedresize = {
11		setup: function () {
12			$(this).on("resize", $special.handler);
13		}, teardown: function () {
14			$(this).off("resize", $special.handler);
15		}, handler: function (event, execAsap) {
16			var context = this, args = arguments, dispatch = function () {
17				event.type = "debouncedresize";
18				$event.dispatch.apply(context, args);
19			};
20			if (resizeTimeout) {
21				clearTimeout(resizeTimeout);
22			}
23			execAsap ? dispatch() : resizeTimeout = setTimeout(dispatch, $special.threshold);
24		}, threshold: 150
25	};
26})(jQuery);
27
28/* --- $HOVERINTENT --- */
29
30/* hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+
31 * http://cherne.net/brian/resources/jquery.hoverIntent.html
32 *
33 * You may use hoverIntent under the terms of the MIT license.
34 * Copyright 2007, 2013 Brian Cherne
35 */
36(function (e) {
37	e.fn.hoverIntent = function (t, n, r) {
38		var i = {interval: 100, sensitivity: 7, timeout: 0};
39		if (typeof t === "object") {
40			i = e.extend(i, t)
41		} else if (e.isFunction(n)) {
42			i = e.extend(i, {over: t, out: n, selector: r})
43		} else {
44			i = e.extend(i, {over: t, out: t, selector: n})
45		}
46		var s, o, u, a;
47		var f = function (e) {
48			s = e.pageX;
49			o = e.pageY
50		};
51		var l = function (t, n) {
52			n.hoverIntent_t = clearTimeout(n.hoverIntent_t);
53			if (Math.abs(u - s) + Math.abs(a - o) < i.sensitivity) {
54				e(n).off("mousemove.hoverIntent", f);
55				n.hoverIntent_s = 1;
56				return i.over.apply(n, [t])
57			} else {
58				u = s;
59				a = o;
60				n.hoverIntent_t = setTimeout(function () {
61					l(t, n)
62				}, i.interval)
63			}
64		};
65		var c = function (e, t) {
66			t.hoverIntent_t = clearTimeout(t.hoverIntent_t);
67			t.hoverIntent_s = 0;
68			return i.out.apply(t, [e])
69		};
70		var h = function (t) {
71			var n = jQuery.extend({}, t);
72			var r = this;
73			if (r.hoverIntent_t) {
74				r.hoverIntent_t = clearTimeout(r.hoverIntent_t)
75			}
76			if (t.type == "mouseenter") {
77				u = n.pageX;
78				a = n.pageY;
79				e(r).on("mousemove.hoverIntent", f);
80				if (r.hoverIntent_s != 1) {
81					r.hoverIntent_t = setTimeout(function () {
82						l(n, r)
83					}, i.interval)
84				}
85			} else {
86				e(r).off("mousemove.hoverIntent", f);
87				if (r.hoverIntent_s == 1) {
88					r.hoverIntent_t = setTimeout(function () {
89						c(n, r)
90					}, i.timeout)
91				}
92			}
93		};
94		return this.on({"mouseenter.hoverIntent": h, "mouseleave.hoverIntent": h}, i.selector)
95	}
96})(jQuery);
97
98/*!
99 * imagesLoaded PACKAGED v3.1.4
100 * JavaScript is all like "You images are done yet or what?"
101 * MIT License
102 */
103
104(function () {
105	function e() {
106	}
107
108	function t(e, t) {
109		for (var n = e.length; n--;)if (e[n].listener === t)return n;
110		return-1
111	}
112
113	function n(e) {
114		return function () {
115			return this[e].apply(this, arguments)
116		}
117	}
118
119	var i = e.prototype, r = this, o = r.EventEmitter;
120	i.getListeners = function (e) {
121		var t, n, i = this._getEvents();
122		if ("object" == typeof e) {
123			t = {};
124			for (n in i)i.hasOwnProperty(n) && e.test(n) && (t[n] = i[n])
125		} else t = i[e] || (i[e] = []);
126		return t
127	}, i.flattenListeners = function (e) {
128		var t, n = [];
129		for (t = 0; e.length > t; t += 1)n.push(e[t].listener);
130		return n
131	}, i.getListenersAsObject = function (e) {
132		var t, n = this.getListeners(e);
133		return n instanceof Array && (t = {}, t[e] = n), t || n
134	}, i.addListener = function (e, n) {
135		var i, r = this.getListenersAsObject(e), o = "object" == typeof n;
136		for (i in r)r.hasOwnProperty(i) && -1 === t(r[i], n) && r[i].push(o ? n : {listener: n, once: !1});
137		return this
138	}, i.on = n("addListener"), i.addOnceListener = function (e, t) {
139		return this.addListener(e, {listener: t, once: !0})
140	}, i.once = n("addOnceListener"), i.defineEvent = function (e) {
141		return this.getListeners(e), this
142	}, i.defineEvents = function (e) {
143		for (var t = 0; e.length > t; t += 1)this.defineEvent(e[t]);
144		return this
145	}, i.removeListener = function (e, n) {
146		var i, r, o = this.getListenersAsObject(e);
147		for (r in o)o.hasOwnProperty(r) && (i = t(o[r], n), -1 !== i && o[r].splice(i, 1));
148		return this
149	}, i.off = n("removeListener"), i.addListeners = function (e, t) {
150		return this.manipulateListeners(!1, e, t)
151	}, i.removeListeners = function (e, t) {
152		return this.manipulateListeners(!0, e, t)
153	}, i.manipulateListeners = function (e, t, n) {
154		var i, r, o = e ? this.removeListener : this.addListener, s = e ? this.removeListeners : this.addListeners;
155		if ("object" != typeof t || t instanceof RegExp)for (i = n.length; i--;)o.call(this, t, n[i]); else for (i in t)t.hasOwnProperty(i) && (r = t[i]) && ("function" == typeof r ? o.call(this, i, r) : s.call(this, i, r));
156		return this
157	}, i.removeEvent = function (e) {
158		var t, n = typeof e, i = this._getEvents();
159		if ("string" === n)delete i[e]; else if ("object" === n)for (t in i)i.hasOwnProperty(t) && e.test(t) && delete i[t]; else delete this._events;
160		return this
161	}, i.removeAllListeners = n("removeEvent"), i.emitEvent = function (e, t) {
162		var n, i, r, o, s = this.getListenersAsObject(e);
163		for (r in s)if (s.hasOwnProperty(r))for (i = s[r].length; i--;)n = s[r][i], n.once === !0 && this.removeListener(e, n.listener), o = n.listener.apply(this, t || []), o === this._getOnceReturnValue() && this.removeListener(e, n.listener);
164		return this
165	}, i.trigger = n("emitEvent"), i.emit = function (e) {
166		var t = Array.prototype.slice.call(arguments, 1);
167		return this.emitEvent(e, t)
168	}, i.setOnceReturnValue = function (e) {
169		return this._onceReturnValue = e, this
170	}, i._getOnceReturnValue = function () {
171		return this.hasOwnProperty("_onceReturnValue") ? this._onceReturnValue : !0
172	}, i._getEvents = function () {
173		return this._events || (this._events = {})
174	}, e.noConflict = function () {
175		return r.EventEmitter = o, e
176	}, "function" == typeof define && define.amd ? define("eventEmitter/EventEmitter", [], function () {
177		return e
178	}) : "object" == typeof module && module.exports ? module.exports = e : this.EventEmitter = e
179}).call(this), function (e) {
180	function t(t) {
181		var n = e.event;
182		return n.target = n.target || n.srcElement || t, n
183	}
184
185	var n = document.documentElement, i = function () {
186	};
187	n.addEventListener ? i = function (e, t, n) {
188		e.addEventListener(t, n, !1)
189	} : n.attachEvent && (i = function (e, n, i) {
190		e[n + i] = i.handleEvent ? function () {
191			var n = t(e);
192			i.handleEvent.call(i, n)
193		} : function () {
194			var n = t(e);
195			i.call(e, n)
196		}, e.attachEvent("on" + n, e[n + i])
197	});
198	var r = function () {
199	};
200	n.removeEventListener ? r = function (e, t, n) {
201		e.removeEventListener(t, n, !1)
202	} : n.detachEvent && (r = function (e, t, n) {
203		e.detachEvent("on" + t, e[t + n]);
204		try {
205			delete e[t + n]
206		} catch (i) {
207			e[t + n] = void 0
208		}
209	});
210	var o = {bind: i, unbind: r};
211	"function" == typeof define && define.amd ? define("eventie/eventie", o) : e.eventie = o
212}(this), function (e, t) {
213	"function" == typeof define && define.amd ? define(["eventEmitter/EventEmitter", "eventie/eventie"], function (n, i) {
214		return t(e, n, i)
215	}) : "object" == typeof exports ? module.exports = t(e, require("eventEmitter"), require("eventie")) : e.imagesLoaded = t(e, e.EventEmitter, e.eventie)
216}(this, function (e, t, n) {
217	function i(e, t) {
218		for (var n in t)e[n] = t[n];
219		return e
220	}
221
222	function r(e) {
223		return"[object Array]" === d.call(e)
224	}
225
226	function o(e) {
227		var t = [];
228		if (r(e))t = e; else if ("number" == typeof e.length)for (var n = 0, i = e.length; i > n; n++)t.push(e[n]); else t.push(e);
229		return t
230	}
231
232	function s(e, t, n) {
233		if (!(this instanceof s))return new s(e, t);
234		"string" == typeof e && (e = document.querySelectorAll(e)), this.elements = o(e), this.options = i({}, this.options), "function" == typeof t ? n = t : i(this.options, t), n && this.on("always", n), this.getImages(), a && (this.jqDeferred = new a.Deferred);
235		var r = this;
236		setTimeout(function () {
237			r.check()
238		})
239	}
240
241	function c(e) {
242		this.img = e
243	}
244
245	function f(e) {
246		this.src = e, v[e] = this
247	}
248
249	var a = e.jQuery, u = e.console, h = u !== void 0, d = Object.prototype.toString;
250	s.prototype = new t, s.prototype.options = {}, s.prototype.getImages = function () {
251		this.images = [];
252		for (var e = 0, t = this.elements.length; t > e; e++) {
253			var n = this.elements[e];
254			"IMG" === n.nodeName && this.addImage(n);
255			for (var i = n.querySelectorAll("img"), r = 0, o = i.length; o > r; r++) {
256				var s = i[r];
257				this.addImage(s)
258			}
259		}
260	}, s.prototype.addImage = function (e) {
261		var t = new c(e);
262		this.images.push(t)
263	}, s.prototype.check = function () {
264		function e(e, r) {
265			return t.options.debug && h && u.log("confirm", e, r), t.progress(e), n++, n === i && t.complete(), !0
266		}
267
268		var t = this, n = 0, i = this.images.length;
269		if (this.hasAnyBroken = !1, !i)return this.complete(), void 0;
270		for (var r = 0; i > r; r++) {
271			var o = this.images[r];
272			o.on("confirm", e), o.check()
273		}
274	}, s.prototype.progress = function (e) {
275		this.hasAnyBroken = this.hasAnyBroken || !e.isLoaded;
276		var t = this;
277		setTimeout(function () {
278			t.emit("progress", t, e), t.jqDeferred && t.jqDeferred.notify && t.jqDeferred.notify(t, e)
279		})
280	}, s.prototype.complete = function () {
281		var e = this.hasAnyBroken ? "fail" : "done";
282		this.isComplete = !0;
283		var t = this;
284		setTimeout(function () {
285			if (t.emit(e, t), t.emit("always", t), t.jqDeferred) {
286				var n = t.hasAnyBroken ? "reject" : "resolve";
287				t.jqDeferred[n](t)
288			}
289		})
290	}, a && (a.fn.imagesLoaded = function (e, t) {
291		var n = new s(this, e, t);
292		return n.jqDeferred.promise(a(this))
293	}), c.prototype = new t, c.prototype.check = function () {
294		var e = v[this.img.src] || new f(this.img.src);
295		if (e.isConfirmed)return this.confirm(e.isLoaded, "cached was confirmed"), void 0;
296		if (this.img.complete && void 0 !== this.img.naturalWidth)return this.confirm(0 !== this.img.naturalWidth, "naturalWidth"), void 0;
297		var t = this;
298		e.on("confirm", function (e, n) {
299			return t.confirm(e.isLoaded, n), !0
300		}), e.check()
301	}, c.prototype.confirm = function (e, t) {
302		this.isLoaded = e, this.emit("confirm", this, t)
303	};
304	var v = {};
305	return f.prototype = new t, f.prototype.check = function () {
306		if (!this.isChecked) {
307			var e = new Image;
308			n.bind(e, "load", this), n.bind(e, "error", this), e.src = this.src, this.isChecked = !0
309		}
310	}, f.prototype.handleEvent = function (e) {
311		var t = "on" + e.type;
312		this[t] && this[t](e)
313	}, f.prototype.onload = function (e) {
314		this.confirm(!0, "onload"), this.unbindProxyEvents(e)
315	}, f.prototype.onerror = function (e) {
316		this.confirm(!1, "onerror"), this.unbindProxyEvents(e)
317	}, f.prototype.confirm = function (e, t) {
318		this.isConfirmed = !0, this.isLoaded = e, this.emit("confirm", this, t)
319	}, f.prototype.unbindProxyEvents = function (e) {
320		n.unbind(e.target, "load", this), n.unbind(e.target, "error", this)
321	}, s
322});
323/*!
324 * jQuery Bully Plugin v0.1.4
325 * Examples and documentation at http://pixelgrade.github.io/rellax/
326 * Copyright (c) 2016 PixelGrade http://www.pixelgrade.com
327 * Licensed under MIT http://www.opensource.org/licenses/mit-license.php/
328 */
329;(
330	function( $, window, document, undefined ) {
331
332		var $window = $( window ),
333			windowHeight = $window.height(),
334			elements = [],
335			$bully,
336			$current,
337			lastScrollY = (window.pageYOffset || document.documentElement.scrollTop)  - (document.documentElement.clientTop || 0),
338			current = 0,
339			inversed = false,
340			frameRendered = true;
341
342		$bully = $( '<div class="c-bully">' ).appendTo( 'body' );
343		$current = $( '<div class="c-bully__bullet c-bully__bullet--active">' ).appendTo( $bully );
344
345		function update() {
346			if ( frameRendered !== true ) {
347
348				var count = 0,
349					inverse = false;
350
351				$.each( elements, function( i, element ) {
352					if ( lastScrollY >= element.offset.top - windowHeight / 2 ) {
353						count = count + 1;
354						inverse = lastScrollY < element.offset.top + element.height - windowHeight / 2;
355					}
356				} );
357
358				if ( inversed !== inverse ) {
359					inversed = inverse;
360					$bully.toggleClass( 'c-bully--inversed', inversed );
361				}
362
363				if ( count !== current ) {
364					var offset = $bully.children( '.c-bully__bullet' ).not( '.c-bully__bullet--active' ).first().outerHeight( true ) * (
365							count - 1
366						);
367					$current.removeClass( 'c-bully__bullet--squash' );
368					setTimeout( function() {
369						$current.addClass( 'c-bully__bullet--squash' );
370					} );
371					$current.css( 'top', offset );
372					current = count;
373				}
374			}
375
376			window.requestAnimationFrame( update );
377			frameRendered = true;
378		}
379
380		update();
381
382		function reloadAll() {
383			$.each( elements, function( i, element ) {
384				element._reloadElement();
385			} );
386		}
387
388		function staggerClass( $elements, classname, timeout ) {
389
390			$.each( $elements, function( i, obj ) {
391
392				var stagger = i * timeout;
393
394				setTimeout( function() {
395					obj.$bullet.addClass( classname );
396				}, stagger );
397			} );
398		}
399
400		$window.on( 'load', function( e ) {
401			staggerClass( elements, 'c-bully__bullet--pop', 400 );
402			frameRendered = false;
403		} );
404
405		$window.on( 'scroll', function( e ) {
406			if ( frameRendered === true ) {
407				lastScrollY = (window.pageYOffset || document.documentElement.scrollTop)  - (document.documentElement.clientTop || 0);
408			}
409			frameRendered = false;
410		} );
411
412		$window.on( 'load resize', function() {
413			reloadAll();
414		} );
415
416		function Bully( element, options ) {
417			this.element = element;
418			this.options = $.extend( {}, $.fn.bully.defaults, options );
419
420			var self = this,
421				$bullet = $( '<div class="c-bully__bullet">' );
422
423			$bullet.data( 'bully-data', self ).appendTo( $bully );
424			$bullet.on( 'click', function( event ) {
425				event.preventDefault();
426				event.stopPropagation();
427
428				self.onClick();
429			} );
430
431			this.$bullet = $bullet;
432
433			self._reloadElement();
434			elements.push( self );
435			current = 0;
436		}
437
438		Bully.prototype.constructor = Bully;
439
440		Bully.prototype._reloadElement = function() {
441			// for some strange reason Customizer reload makes jQuery's .offset() to fail
442			var self = this,
443				box = {
444					top: 0,
445					left: 0
446				};
447
448			// quickfix: replicate .offset() logic here
449			if ( typeof self.element.getBoundingClientRect !== "undefined" ) {
450				box = self.element.getBoundingClientRect();
451			}
452
453			self.offset = {
454				top: box.top + (window.pageYOffset || self.element.scrollTop) - (self.element.clientTop || 0),
455				left: box.left + (window.pageXOffset || self.element.scrollLeft) - (self.element.clientLeft || 0)
456			};
457			self.height = $( self.element ).outerHeight();
458		};
459
460		Bully.prototype.onClick = function() {
461
462			var self = this,
463				$target = $( 'html, body' );
464
465			if ( self.options.scrollDuration == 0 ) {
466				$target.scrollTop( self.offset.top );
467				return;
468			}
469
470			if ( self.options.scrollDuration === 'auto' ) {
471				var duration = Math.abs( lastScrollY - self.offset.top ) / (
472				               self.options.scrollPerSecond / 1000
473					);
474				$target.animate( {scrollTop: self.offset.top}, duration );
475				return;
476			}
477
478			$target.animate( {scrollTop: self.offset.top}, self.options.scrollDuration );
479		};
480
481		$.fn.bully = function( options ) {
482			return this.each( function() {
483				if ( ! $.data( this, "plugin_" + Bully ) ) {
484					$.data( this, "plugin_" + Bully, new Bully( this, options ) );
485				}
486			} );
487		};
488
489		$.fn.bully.defaults = {
490			scrollDuration: 'auto',
491			scrollPerSecond: 4000
492		};
493
494		$window.on( 'rellax rellax:restart load', reloadAll );
495
496
497	}
498)( jQuery, window, document );
499/*! Magnific Popup - v1.1.0 - 2016-02-20
500 * http://dimsemenov.com/plugins/magnific-popup/
501 * Copyright (c) 2016 Dmitry Semenov; */
502;(function (factory) {
503	if (typeof define === 'function' && define.amd) {
504		// AMD. Register as an anonymous module.
505		define(['jquery'], factory);
506	} else if (typeof exports === 'object') {
507		// Node/CommonJS
508		factory(require('jquery'));
509	} else {
510		// Browser globals
511		factory(window.jQuery || window.Zepto);
512	}
513}(function($) {
514
515	/*>>core*/
516	/**
517	 *
518	 * Magnific Popup Core JS file
519	 *
520	 */
521
522
523	/**
524	 * Private static constants
525	 */
vendor: 44,328 bytes, lines 526-2349
526	var CLOSE_EVENT = 'Close',
527		BEFORE_CLOSE_EVENT = 'BeforeClose',
528		AFTER_CLOSE_EVENT = 'AfterClose',
529		BEFORE_APPEND_EVENT = 'BeforeAppend',
530		MARKUP_PARSE_EVENT = 'MarkupParse',
531		OPEN_EVENT = 'Open',
532		CHANGE_EVENT = 'Change',
533		NS = 'mfp',
534		EVENT_NS = '.' + NS,
535		READY_CLASS = 'mfp-ready',
536		REMOVING_CLASS = 'mfp-removing',
537		PREVENT_CLOSE_CLASS = 'mfp-prevent-close';
538
539
540	/**
541	 * Private vars
542	 */
543	/*jshint -W079 */
544	var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
545		MagnificPopup = function(){},
546		_isJQ = !!(window.jQuery),
547		_prevStatus,
548		_window = $(window),
549		_document,
550		_prevContentType,
551		_wrapClasses,
552		_currPopupType;
553
554
555	/**
556	 * Private functions
557	 */
558	var _mfpOn = function(name, f) {
559			mfp.ev.on(NS + name + EVENT_NS, f);
560		},
561		_getEl = function(className, appendTo, html, raw) {
562			var el = document.createElement('div');
563			el.className = 'mfp-'+className;
564			if(html) {
565				el.innerHTML = html;
566			}
567			if(!raw) {
568				el = $(el);
569				if(appendTo) {
570					el.appendTo(appendTo);
571				}
572			} else if(appendTo) {
573				appendTo.appendChild(el);
574			}
575			return el;
576		},
577		_mfpTrigger = function(e, data) {
578			mfp.ev.triggerHandler(NS + e, data);
579
580			if(mfp.st.callbacks) {
581				// converts "mfpEventName" to "eventName" callback and triggers it if it's present
582				e = e.charAt(0).toLowerCase() + e.slice(1);
583				if(mfp.st.callbacks[e]) {
584					mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);
585				}
586			}
587		},
588		_getCloseBtn = function(type) {
589			if(type !== _currPopupType || !mfp.currTemplate.closeBtn) {
590				mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) );
591				_currPopupType = type;
592			}
593			return mfp.currTemplate.closeBtn;
594		},
595		// Initialize Magnific Popup only when called at least once
596		_checkInstance = function() {
597			if(!$.magnificPopup.instance) {
598				/*jshint -W020 */
599				mfp = new MagnificPopup();
600				mfp.init();
601				$.magnificPopup.instance = mfp;
602			}
603		},
604		// CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr
605		supportsTransitions = function() {
606			var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist
607				v = ['ms','O','Moz','Webkit']; // 'v' for vendor
608
609			if( s['transition'] !== undefined ) {
610				return true;
611			}
612
613			while( v.length ) {
614				if( v.pop() + 'Transition' in s ) {
615					return true;
616				}
617			}
618
619			return false;
620		};
621
622
623
624	/**
625	 * Public functions
626	 */
627	MagnificPopup.prototype = {
628
629		constructor: MagnificPopup,
630
631		/**
632		 * Initializes Magnific Popup plugin.
633		 * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed
634		 */
635		init: function() {
636			var appVersion = navigator.appVersion;
637			mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener;
638			mfp.isAndroid = (/android/gi).test(appVersion);
639			mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
640			mfp.supportsTransition = supportsTransitions();
641
642			// We disable fixed positioned lightbox on devices that don't handle it nicely.
643			// If you know a better way of detecting this - let me know.
644			mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );
645			_document = $(document);
646
647			mfp.popupsCache = {};
648		},
649
650		/**
651		 * Opens popup
652		 * @param  data [description]
653		 */
654		open: function(data) {
655
656			var i;
657
658			if(data.isObj === false) {
659				// convert jQuery collection to array to avoid conflicts later
660				mfp.items = data.items.toArray();
661
662				mfp.index = 0;
663				var items = data.items,
664					item;
665				for(i = 0; i < items.length; i++) {
666					item = items[i];
667					if(item.parsed) {
668						item = item.el[0];
669					}
670					if(item === data.el[0]) {
671						mfp.index = i;
672						break;
673					}
674				}
675			} else {
676				mfp.items = $.isArray(data.items) ? data.items : [data.items];
677				mfp.index = data.index || 0;
678			}
679
680			// if popup is already opened - we just update the content
681			if(mfp.isOpen) {
682				mfp.updateItemHTML();
683				return;
684			}
685
686			mfp.types = [];
687			_wrapClasses = '';
688			if(data.mainEl && data.mainEl.length) {
689				mfp.ev = data.mainEl.eq(0);
690			} else {
691				mfp.ev = _document;
692			}
693
694			if(data.key) {
695				if(!mfp.popupsCache[data.key]) {
696					mfp.popupsCache[data.key] = {};
697				}
698				mfp.currTemplate = mfp.popupsCache[data.key];
699			} else {
700				mfp.currTemplate = {};
701			}
702
703
704
705			mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
706			mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;
707
708			if(mfp.st.modal) {
709				mfp.st.closeOnContentClick = false;
710				mfp.st.closeOnBgClick = false;
711				mfp.st.showCloseBtn = false;
712				mfp.st.enableEscapeKey = false;
713			}
714
715
716			// Building markup
717			// main containers are created only once
718			if(!mfp.bgOverlay) {
719
720				// Dark overlay
721				mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() {
722					mfp.close();
723				});
724
725				mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) {
726					if(mfp._checkIfClose(e.target)) {
727						mfp.close();
728					}
729				});
730
731				mfp.container = _getEl('container', mfp.wrap);
732			}
733
734			mfp.contentContainer = _getEl('content');
735			if(mfp.st.preloader) {
736				mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);
737			}
738
739
740			// Initializing modules
741			var modules = $.magnificPopup.modules;
742			for(i = 0; i < modules.length; i++) {
743				var n = modules[i];
744				n = n.charAt(0).toUpperCase() + n.slice(1);
745				mfp['init'+n].call(mfp);
746			}
747			_mfpTrigger('BeforeOpen');
748
749
750			if(mfp.st.showCloseBtn) {
751				// Close button
752				if(!mfp.st.closeBtnInside) {
753					mfp.wrap.append( _getCloseBtn() );
754				} else {
755					_mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {
756						values.close_replaceWith = _getCloseBtn(item.type);
757					});
758					_wrapClasses += ' mfp-close-btn-in';
759				}
760			}
761
762			if(mfp.st.alignTop) {
763				_wrapClasses += ' mfp-align-top';
764			}
765
766
767
768			if(mfp.fixedContentPos) {
769				mfp.wrap.css({
770					overflow: mfp.st.overflowY,
771					overflowX: 'hidden',
772					overflowY: mfp.st.overflowY
773				});
774			} else {
775				mfp.wrap.css({
776					top: _window.scrollTop(),
777					position: 'absolute'
778				});
779			}
780			if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) {
781				mfp.bgOverlay.css({
782					height: _document.height(),
783					position: 'absolute'
784				});
785			}
786
787
788
789			if(mfp.st.enableEscapeKey) {
790				// Close on ESC key
791				_document.on('keyup' + EVENT_NS, function(e) {
792					if(e.keyCode === 27) {
793						mfp.close();
794					}
795				});
796			}
797
798			_window.on('resize' + EVENT_NS, function() {
799				mfp.updateSize();
800			});
801
802
803			if(!mfp.st.closeOnContentClick) {
804				_wrapClasses += ' mfp-auto-cursor';
805			}
806
807			if(_wrapClasses)
808				mfp.wrap.addClass(_wrapClasses);
809
810
811			// this triggers recalculation of layout, so we get it once to not to trigger twice
812			var windowHeight = mfp.wH = _window.height();
813
814
815			var windowStyles = {};
816
817			if( mfp.fixedContentPos ) {
818				if(mfp._hasScrollBar(windowHeight)){
819					var s = mfp._getScrollbarSize();
820					if(s) {
821						windowStyles.marginRight = s;
822					}
823				}
824			}
825
826			if(mfp.fixedContentPos) {
827				if(!mfp.isIE7) {
828					windowStyles.overflow = 'hidden';
829				} else {
830					// ie7 double-scroll bug
831					$('body, html').css('overflow', 'hidden');
832				}
833			}
834
835
836
837			var classesToadd = mfp.st.mainClass;
838			if(mfp.isIE7) {
839				classesToadd += ' mfp-ie7';
840			}
841			if(classesToadd) {
842				mfp._addClassToMFP( classesToadd );
843			}
844
845			// add content
846			mfp.updateItemHTML();
847
848			_mfpTrigger('BuildControls');
849
850			// remove scrollbar, add margin e.t.c
851			$('html').css(windowStyles);
852
853			// add everything to DOM
854			mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) );
855
856			// Save last focused element
857			mfp._lastFocusedEl = document.activeElement;
858
859			// Wait for next cycle to allow CSS transition
860			setTimeout(function() {
861
862				if(mfp.content) {
863					mfp._addClassToMFP(READY_CLASS);
864					mfp._setFocus();
865				} else {
866					// if content is not defined (not loaded e.t.c) we add class only for BG
867					mfp.bgOverlay.addClass(READY_CLASS);
868				}
869
870				// Trap the focus in popup
871				_document.on('focusin' + EVENT_NS, mfp._onFocusIn);
872
873			}, 16);
874
875			mfp.isOpen = true;
876			mfp.updateSize(windowHeight);
877			_mfpTrigger(OPEN_EVENT);
878
879			return data;
880		},
881
882		/**
883		 * Closes the popup
884		 */
885		close: function() {
886			if(!mfp.isOpen) return;
887			_mfpTrigger(BEFORE_CLOSE_EVENT);
888
889			mfp.isOpen = false;
890			// for CSS3 animation
891			if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition )  {
892				mfp._addClassToMFP(REMOVING_CLASS);
893				setTimeout(function() {
894					mfp._close();
895				}, mfp.st.removalDelay);
896			} else {
897				mfp._close();
898			}
899		},
900
901		/**
902		 * Helper for close() function
903		 */
904		_close: function() {
905			_mfpTrigger(CLOSE_EVENT);
906
907			var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
908
909			mfp.bgOverlay.detach();
910			mfp.wrap.detach();
911			mfp.container.empty();
912
913			if(mfp.st.mainClass) {
914				classesToRemove += mfp.st.mainClass + ' ';
915			}
916
917			mfp._removeClassFromMFP(classesToRemove);
918
919			if(mfp.fixedContentPos) {
920				var windowStyles = {marginRight: ''};
921				if(mfp.isIE7) {
922					$('body, html').css('overflow', '');
923				} else {
924					windowStyles.overflow = '';
925				}
926				$('html').css(windowStyles);
927			}
928
929			_document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
930			mfp.ev.off(EVENT_NS);
931
932			// clean up DOM elements that aren't removed
933			mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');
934			mfp.bgOverlay.attr('class', 'mfp-bg');
935			mfp.container.attr('class', 'mfp-container');
936
937			// remove close button from target element
938			if(mfp.st.showCloseBtn &&
939			   (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) {
940				if(mfp.currTemplate.closeBtn)
941					mfp.currTemplate.closeBtn.detach();
942			}
943
944
945			if(mfp.st.autoFocusLast && mfp._lastFocusedEl) {
946				$(mfp._lastFocusedEl).focus(); // put tab focus back
947			}
948			mfp.currItem = null;
949			mfp.content = null;
950			mfp.currTemplate = null;
951			mfp.prevHeight = 0;
952
953			_mfpTrigger(AFTER_CLOSE_EVENT);
954		},
955
956		updateSize: function(winHeight) {
957
958			if(mfp.isIOS) {
959				// fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2
960				var zoomLevel = document.documentElement.clientWidth / window.innerWidth;
961				var height = window.innerHeight * zoomLevel;
962				mfp.wrap.css('height', height);
963				mfp.wH = height;
964			} else {
965				mfp.wH = winHeight || _window.height();
966			}
967			// Fixes #84: popup incorrectly positioned with position:relative on body
968			if(!mfp.fixedContentPos) {
969				mfp.wrap.css('height', mfp.wH);
970			}
971
972			_mfpTrigger('Resize');
973
974		},
975
976		/**
977		 * Set content of popup based on current index
978		 */
979		updateItemHTML: function() {
980			var item = mfp.items[mfp.index];
981
982			// Detach and perform modifications
983			mfp.contentContainer.detach();
984
985			if(mfp.content)
986				mfp.content.detach();
987
988			if(!item.parsed) {
989				item = mfp.parseEl( mfp.index );
990			}
991
992			var type = item.type;
993
994			_mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
995			// BeforeChange event works like so:
996			// _mfpOn('BeforeChange', function(e, prevType, newType) { });
997
998			mfp.currItem = item;
999
1000			if(!mfp.currTemplate[type]) {
1001				var markup = mfp.st[type] ? mfp.st[type].markup : false;
1002
1003				// allows to modify markup
1004				_mfpTrigger('FirstMarkupParse', markup);
1005
1006				if(markup) {
1007					mfp.currTemplate[type] = $(markup);
1008				} else {
1009					// if there is no markup found we just define that template is parsed
1010					mfp.currTemplate[type] = true;
1011				}
1012			}
1013
1014			if(_prevContentType && _prevContentType !== item.type) {
1015				mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
1016			}
1017
1018			var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
1019			mfp.appendContent(newContent, type);
1020
1021			item.preloaded = true;
1022
1023			_mfpTrigger(CHANGE_EVENT, item);
1024			_prevContentType = item.type;
1025
1026			// Append container back after its content changed
1027			mfp.container.prepend(mfp.contentContainer);
1028
1029			_mfpTrigger('AfterChange');
1030		},
1031
1032
1033		/**
1034		 * Set HTML content of popup
1035		 */
1036		appendContent: function(newContent, type) {
1037			mfp.content = newContent;
1038
1039			if(newContent) {
1040				if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
1041				   mfp.currTemplate[type] === true) {
1042					// if there is no markup, we just append close button element inside
1043					if(!mfp.content.find('.mfp-close').length) {
1044						mfp.content.append(_getCloseBtn());
1045					}
1046				} else {
1047					mfp.content = newContent;
1048				}
1049			} else {
1050				mfp.content = '';
1051			}
1052
1053			_mfpTrigger(BEFORE_APPEND_EVENT);
1054			mfp.container.addClass('mfp-'+type+'-holder');
1055
1056			mfp.contentContainer.append(mfp.content);
1057		},
1058
1059
1060		/**
1061		 * Creates Magnific Popup data object based on given data
1062		 * @param  {int} index Index of item to parse
1063		 */
1064		parseEl: function(index) {
1065			var item = mfp.items[index],
1066				type;
1067
1068			if(item.tagName) {
1069				item = { el: $(item) };
1070			} else {
1071				type = item.type;
1072				item = { data: item, src: item.src };
1073			}
1074
1075			if(item.el) {
1076				var types = mfp.types;
1077
1078				// check for 'mfp-TYPE' class
1079				for(var i = 0; i < types.length; i++) {
1080					if( item.el.hasClass('mfp-'+types[i]) ) {
1081						type = types[i];
1082						break;
1083					}
1084				}
1085
1086				item.src = item.el.attr('data-mfp-src');
1087				if(!item.src) {
1088					item.src = item.el.attr('href');
1089				}
1090			}
1091
1092			item.type = type || mfp.st.type || 'inline';
1093			item.index = index;
1094			item.parsed = true;
1095			mfp.items[index] = item;
1096			_mfpTrigger('ElementParse', item);
1097
1098			return mfp.items[index];
1099		},
1100
1101
1102		/**
1103		 * Initializes single popup or a group of popups
1104		 */
1105		addGroup: function(el, options) {
1106			var eHandler = function(e) {
1107				e.mfpEl = this;
1108				mfp._openClick(e, el, options);
1109			};
1110
1111			if(!options) {
1112				options = {};
1113			}
1114
1115			var eName = 'click.magnificPopup';
1116			options.mainEl = el;
1117
1118			if(options.items) {
1119				options.isObj = true;
1120				el.off(eName).on(eName, eHandler);
1121			} else {
1122				options.isObj = false;
1123				if(options.delegate) {
1124					el.off(eName).on(eName, options.delegate , eHandler);
1125				} else {
1126					options.items = el;
1127					el.off(eName).on(eName, eHandler);
1128				}
1129			}
1130		},
1131		_openClick: function(e, el, options) {
1132			var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
1133
1134
1135			if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) {
1136				return;
1137			}
1138
1139			var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;
1140
1141			if(disableOn) {
1142				if($.isFunction(disableOn)) {
1143					if( !disableOn.call(mfp) ) {
1144						return true;
1145					}
1146				} else { // else it's number
1147					if( _window.width() < disableOn ) {
1148						return true;
1149					}
1150				}
1151			}
1152
1153			if(e.type) {
1154				e.preventDefault();
1155
1156				// This will prevent popup from closing if element is inside and popup is already opened
1157				if(mfp.isOpen) {
1158					e.stopPropagation();
1159				}
1160			}
1161
1162			options.el = $(e.mfpEl);
1163			if(options.delegate) {
1164				options.items = el.find(options.delegate);
1165			}
1166			mfp.open(options);
1167		},
1168
1169
1170		/**
1171		 * Updates text on preloader
1172		 */
1173		updateStatus: function(status, text) {
1174
1175			if(mfp.preloader) {
1176				if(_prevStatus !== status) {
1177					mfp.container.removeClass('mfp-s-'+_prevStatus);
1178				}
1179
1180				if(!text && status === 'loading') {
1181					text = mfp.st.tLoading;
1182				}
1183
1184				var data = {
1185					status: status,
1186					text: text
1187				};
1188				// allows to modify status
1189				_mfpTrigger('UpdateStatus', data);
1190
1191				status = data.status;
1192				text = data.text;
1193
1194				mfp.preloader.html(text);
1195
1196				mfp.preloader.find('a').on('click', function(e) {
1197					e.stopImmediatePropagation();
1198				});
1199
1200				mfp.container.addClass('mfp-s-'+status);
1201				_prevStatus = status;
1202			}
1203		},
1204
1205
1206		/*
1207		 "Private" helpers that aren't private at all
1208		 */
1209		// Check to close popup or not
1210		// "target" is an element that was clicked
1211		_checkIfClose: function(target) {
1212
1213			if($(target).hasClass(PREVENT_CLOSE_CLASS)) {
1214				return;
1215			}
1216
1217			var closeOnContent = mfp.st.closeOnContentClick;
1218			var closeOnBg = mfp.st.closeOnBgClick;
1219
1220			if(closeOnContent && closeOnBg) {
1221				return true;
1222			} else {
1223
1224				// We close the popup if click is on close button or on preloader. Or if there is no content.
1225				if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) {
1226					return true;
1227				}
1228
1229				// if click is outside the content
1230				if(  (target !== mfp.content[0] && !$.contains(mfp.content[0], target))  ) {
1231					if(closeOnBg) {
1232						// last check, if the clicked element is in DOM, (in case it's removed onclick)
1233						if( $.contains(document, target) ) {
1234							return true;
1235						}
1236					}
1237				} else if(closeOnContent) {
1238					return true;
1239				}
1240
1241			}
1242			return false;
1243		},
1244		_addClassToMFP: function(cName) {
1245			mfp.bgOverlay.addClass(cName);
1246			mfp.wrap.addClass(cName);
1247		},
1248		_removeClassFromMFP: function(cName) {
1249			this.bgOverlay.removeClass(cName);
1250			mfp.wrap.removeClass(cName);
1251		},
1252		_hasScrollBar: function(winHeight) {
1253			return (  (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );
1254		},
1255		_setFocus: function() {
1256			(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
1257		},
1258		_onFocusIn: function(e) {
1259			if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {
1260				mfp._setFocus();
1261				return false;
1262			}
1263		},
1264		_parseMarkup: function(template, values, item) {
1265			var arr;
1266			if(item.data) {
1267				values = $.extend(item.data, values);
1268			}
1269			_mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] );
1270
1271			$.each(values, function(key, value) {
1272				if(value === undefined || value === false) {
1273					return true;
1274				}
1275				arr = key.split('_');
1276				if(arr.length > 1) {
1277					var el = template.find(EVENT_NS + '-'+arr[0]);
1278
1279					if(el.length > 0) {
1280						var attr = arr[1];
1281						if(attr === 'replaceWith') {
1282							if(el[0] !== value[0]) {
1283								el.replaceWith(value);
1284							}
1285						} else if(attr === 'img') {
1286							if(el.is('img')) {
1287								el.attr('src', value);
1288							} else {
1289								el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );
1290							}
1291						} else {
1292							el.attr(arr[1], value);
1293						}
1294					}
1295
1296				} else {
1297					template.find(EVENT_NS + '-'+key).html(value);
1298				}
1299			});
1300		},
1301
1302		_getScrollbarSize: function() {
1303			// thx David
1304			if(mfp.scrollbarSize === undefined) {
1305				var scrollDiv = document.createElement("div");
1306				scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
1307				document.body.appendChild(scrollDiv);
1308				mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
1309				document.body.removeChild(scrollDiv);
1310			}
1311			return mfp.scrollbarSize;
1312		}
1313
1314	}; /* MagnificPopup core prototype end */
1315
1316
1317
1318
1319	/**
1320	 * Public static functions
1321	 */
1322	$.magnificPopup = {
1323		instance: null,
1324		proto: MagnificPopup.prototype,
1325		modules: [],
1326
1327		open: function(options, index) {
1328			_checkInstance();
1329
1330			if(!options) {
1331				options = {};
1332			} else {
1333				options = $.extend(true, {}, options);
1334			}
1335
1336			options.isObj = true;
1337			options.index = index || 0;
1338			return this.instance.open(options);
1339		},
1340
1341		close: function() {
1342			return $.magnificPopup.instance && $.magnificPopup.instance.close();
1343		},
1344
1345		registerModule: function(name, module) {
1346			if(module.options) {
1347				$.magnificPopup.defaults[name] = module.options;
1348			}
1349			$.extend(this.proto, module.proto);
1350			this.modules.push(name);
1351		},
1352
1353		defaults: {
1354
1355			// Info about options is in docs:
1356			// http://dimsemenov.com/plugins/magnific-popup/documentation.html#options
1357
1358			disableOn: 0,
1359
1360			key: null,
1361
1362			midClick: false,
1363
1364			mainClass: '',
1365
1366			preloader: true,
1367
1368			focus: '', // CSS selector of input to focus after popup is opened
1369
1370			closeOnContentClick: false,
1371
1372			closeOnBgClick: true,
1373
1374			closeBtnInside: true,
1375
1376			showCloseBtn: true,
1377
1378			enableEscapeKey: true,
1379
1380			modal: false,
1381
1382			alignTop: false,
1383
1384			removalDelay: 0,
1385
1386			prependTo: null,
1387
1388			fixedContentPos: 'auto',
1389
1390			fixedBgPos: 'auto',
1391
1392			overflowY: 'auto',
1393
1394			closeMarkup: '<button title="%title%" type="button" class="mfp-close">&#215;</button>',
1395
1396			tClose: 'Close (Esc)',
1397
1398			tLoading: 'Loading...',
1399
1400			autoFocusLast: true
1401
1402		}
1403	};
1404
1405
1406
1407	$.fn.magnificPopup = function(options) {
1408		_checkInstance();
1409
1410		var jqEl = $(this);
1411
1412		// We call some API method of first param is a string
1413		if (typeof options === "string" ) {
1414
1415			if(options === 'open') {
1416				var items,
1417					itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup,
1418					index = parseInt(arguments[1], 10) || 0;
1419
1420				if(itemOpts.items) {
1421					items = itemOpts.items[index];
1422				} else {
1423					items = jqEl;
1424					if(itemOpts.delegate) {
1425						items = items.find(itemOpts.delegate);
1426					}
1427					items = items.eq( index );
1428				}
1429				mfp._openClick({mfpEl:items}, jqEl, itemOpts);
1430			} else {
1431				if(mfp.isOpen)
1432					mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));
1433			}
1434
1435		} else {
1436			// clone options obj
1437			options = $.extend(true, {}, options);
1438
1439			/*
1440			 * As Zepto doesn't support .data() method for objects
1441			 * and it works only in normal browsers
1442			 * we assign "options" object directly to the DOM element. FTW!
1443			 */
1444			if(_isJQ) {
1445				jqEl.data('magnificPopup', options);
1446			} else {
1447				jqEl[0].magnificPopup = options;
1448			}
1449
1450			mfp.addGroup(jqEl, options);
1451
1452		}
1453		return jqEl;
1454	};
1455
1456	/*>>core*/
1457
1458	/*>>inline*/
1459
1460	var INLINE_NS = 'inline',
1461		_hiddenClass,
1462		_inlinePlaceholder,
1463		_lastInlineElement,
1464		_putInlineElementsBack = function() {
1465			if(_lastInlineElement) {
1466				_inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach();
1467				_lastInlineElement = null;
1468			}
1469		};
1470
1471	$.magnificPopup.registerModule(INLINE_NS, {
1472		options: {
1473			hiddenClass: 'hide', // will be appended with `mfp-` prefix
1474			markup: '',
1475			tNotFound: 'Content not found'
1476		},
1477		proto: {
1478
1479			initInline: function() {
1480				mfp.types.push(INLINE_NS);
1481
1482				_mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() {
1483					_putInlineElementsBack();
1484				});
1485			},
1486
1487			getInline: function(item, template) {
1488
1489				_putInlineElementsBack();
1490
1491				if(item.src) {
1492					var inlineSt = mfp.st.inline,
1493						el = $(item.src);
1494
1495					if(el.length) {
1496
1497						// If target element has parent - we replace it with placeholder and put it back after popup is closed
1498						var parent = el[0].parentNode;
1499						if(parent && parent.tagName) {
1500							if(!_inlinePlaceholder) {
1501								_hiddenClass = inlineSt.hiddenClass;
1502								_inlinePlaceholder = _getEl(_hiddenClass);
1503								_hiddenClass = 'mfp-'+_hiddenClass;
1504							}
1505							// replace target inline element with placeholder
1506							_lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);
1507						}
1508
1509						mfp.updateStatus('ready');
1510					} else {
1511						mfp.updateStatus('error', inlineSt.tNotFound);
1512						el = $('<div>');
1513					}
1514
1515					item.inlineElement = el;
1516					return el;
1517				}
1518
1519				mfp.updateStatus('ready');
1520				mfp._parseMarkup(template, {}, item);
1521				return template;
1522			}
1523		}
1524	});
1525
1526	/*>>inline*/
1527
1528	/*>>ajax*/
1529	var AJAX_NS = 'ajax',
1530		_ajaxCur,
1531		_removeAjaxCursor = function() {
1532			if(_ajaxCur) {
1533				$(document.body).removeClass(_ajaxCur);
1534			}
1535		},
1536		_destroyAjaxRequest = function() {
1537			_removeAjaxCursor();
1538			if(mfp.req) {
1539				mfp.req.abort();
1540			}
1541		};
1542
1543	$.magnificPopup.registerModule(AJAX_NS, {
1544
1545		options: {
1546			settings: null,
1547			cursor: 'mfp-ajax-cur',
1548			tError: '<a href="%url%">The content</a> could not be loaded.'
1549		},
1550
1551		proto: {
1552			initAjax: function() {
1553				mfp.types.push(AJAX_NS);
1554				_ajaxCur = mfp.st.ajax.cursor;
1555
1556				_mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
1557				_mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
1558			},
1559			getAjax: function(item) {
1560
1561				if(_ajaxCur) {
1562					$(document.body).addClass(_ajaxCur);
1563				}
1564
1565				mfp.updateStatus('loading');
1566
1567				var opts = $.extend({
1568					url: item.src,
1569					success: function(data, textStatus, jqXHR) {
1570						var temp = {
1571							data:data,
1572							xhr:jqXHR
1573						};
1574
1575						_mfpTrigger('ParseAjax', temp);
1576
1577						mfp.appendContent( $(temp.data), AJAX_NS );
1578
1579						item.finished = true;
1580
1581						_removeAjaxCursor();
1582
1583						mfp._setFocus();
1584
1585						setTimeout(function() {
1586							mfp.wrap.addClass(READY_CLASS);
1587						}, 16);
1588
1589						mfp.updateStatus('ready');
1590
1591						_mfpTrigger('AjaxContentAdded');
1592					},
1593					error: function() {
1594						_removeAjaxCursor();
1595						item.finished = item.loadError = true;
1596						mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
1597					}
1598				}, mfp.st.ajax.settings);
1599
1600				mfp.req = $.ajax(opts);
1601
1602				return '';
1603			}
1604		}
1605	});
1606
1607	/*>>ajax*/
1608
1609	/*>>image*/
1610	var _imgInterval,
1611		_getTitle = function(item) {
1612			if(item.data && item.data.title !== undefined)
1613				return item.data.title;
1614
1615			var src = mfp.st.image.titleSrc;
1616
1617			if(src) {
1618				if($.isFunction(src)) {
1619					return src.call(mfp, item);
1620				} else if(item.el) {
1621					return item.el.attr(src) || '';
1622				}
1623			}
1624			return '';
1625		};
1626
1627	$.magnificPopup.registerModule('image', {
1628
1629		options: {
1630			markup: '<div class="mfp-figure">'+
1631			        '<div class="mfp-close"></div>'+
1632			        '<figure>'+
1633			        '<div class="mfp-img"></div>'+
1634			        '<figcaption>'+
1635			        '<div class="mfp-bottom-bar">'+
1636			        '<div class="mfp-title"></div>'+
1637			        '<div class="mfp-counter"></div>'+
1638			        '</div>'+
1639			        '</figcaption>'+
1640			        '</figure>'+
1641			        '</div>',
1642			cursor: 'mfp-zoom-out-cur',
1643			titleSrc: 'title',
1644			verticalFit: true,
1645			tError: '<a href="%url%">The image</a> could not be loaded.'
1646		},
1647
1648		proto: {
1649			initImage: function() {
1650				var imgSt = mfp.st.image,
1651					ns = '.image';
1652
1653				mfp.types.push('image');
1654
1655				_mfpOn(OPEN_EVENT+ns, function() {
1656					if(mfp.currItem.type === 'image' && imgSt.cursor) {
1657						$(document.body).addClass(imgSt.cursor);
1658					}
1659				});
1660
1661				_mfpOn(CLOSE_EVENT+ns, function() {
1662					if(imgSt.cursor) {
1663						$(document.body).removeClass(imgSt.cursor);
1664					}
1665					_window.off('resize' + EVENT_NS);
1666				});
1667
1668				_mfpOn('Resize'+ns, mfp.resizeImage);
1669				if(mfp.isLowIE) {
1670					_mfpOn('AfterChange', mfp.resizeImage);
1671				}
1672			},
1673			resizeImage: function() {
1674				var item = mfp.currItem;
1675				if(!item || !item.img) return;
1676
1677				if(mfp.st.image.verticalFit) {
1678					var decr = 0;
1679					// fix box-sizing in ie7/8
1680					if(mfp.isLowIE) {
1681						decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
1682					}
1683					item.img.css('max-height', mfp.wH-decr);
1684				}
1685			},
1686			_onImageHasSize: function(item) {
1687				if(item.img) {
1688
1689					item.hasSize = true;
1690
1691					if(_imgInterval) {
1692						clearInterval(_imgInterval);
1693					}
1694
1695					item.isCheckingImgSize = false;
1696
1697					_mfpTrigger('ImageHasSize', item);
1698
1699					if(item.imgHidden) {
1700						if(mfp.content)
1701							mfp.content.removeClass('mfp-loading');
1702
1703						item.imgHidden = false;
1704					}
1705
1706				}
1707			},
1708
1709			/**
1710			 * Function that loops until the image has size to display elements that rely on it asap
1711			 */
1712			findImageSize: function(item) {
1713
1714				var counter = 0,
1715					img = item.img[0],
1716					mfpSetInterval = function(delay) {
1717
1718						if(_imgInterval) {
1719							clearInterval(_imgInterval);
1720						}
1721						// decelerating interval that checks for size of an image
1722						_imgInterval = setInterval(function() {
1723							if(img.naturalWidth > 0) {
1724								mfp._onImageHasSize(item);
1725								return;
1726							}
1727
1728							if(counter > 200) {
1729								clearInterval(_imgInterval);
1730							}
1731
1732							counter++;
1733							if(counter === 3) {
1734								mfpSetInterval(10);
1735							} else if(counter === 40) {
1736								mfpSetInterval(50);
1737							} else if(counter === 100) {
1738								mfpSetInterval(500);
1739							}
1740						}, delay);
1741					};
1742
1743				mfpSetInterval(1);
1744			},
1745
1746			getImage: function(item, template) {
1747
1748				var guard = 0,
1749
1750					// image load complete handler
1751					onLoadComplete = function() {
1752						if(item) {
1753							if (item.img[0].complete) {
1754								item.img.off('.mfploader');
1755
1756								if(item === mfp.currItem){
1757									mfp._onImageHasSize(item);
1758
1759									mfp.updateStatus('ready');
1760								}
1761
1762								item.hasSize = true;
1763								item.loaded = true;
1764
1765								_mfpTrigger('ImageLoadComplete');
1766
1767							}
1768							else {
1769								// if image complete check fails 200 times (20 sec), we assume that there was an error.
1770								guard++;
1771								if(guard < 200) {
1772									setTimeout(onLoadComplete,100);
1773								} else {
1774									onLoadError();
1775								}
1776							}
1777						}
1778					},
1779
1780					// image error handler
1781					onLoadError = function() {
1782						if(item) {
1783							item.img.off('.mfploader');
1784							if(item === mfp.currItem){
1785								mfp._onImageHasSize(item);
1786								mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
1787							}
1788
1789							item.hasSize = true;
1790							item.loaded = true;
1791							item.loadError = true;
1792						}
1793					},
1794					imgSt = mfp.st.image;
1795
1796
1797				var el = template.find('.mfp-img');
1798				if(el.length) {
1799					var img = document.createElement('img');
1800					img.className = 'mfp-img';
1801					if(item.el && item.el.find('img').length) {
1802						img.alt = item.el.find('img').attr('alt');
1803					}
1804					item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
1805					img.src = item.src;
1806
1807					// without clone() "error" event is not firing when IMG is replaced by new IMG
1808					// TODO: find a way to avoid such cloning
1809					if(el.is('img')) {
1810						item.img = item.img.clone();
1811					}
1812
1813					img = item.img[0];
1814					if(img.naturalWidth > 0) {
1815						item.hasSize = true;
1816					} else if(!img.width) {
1817						item.hasSize = false;
1818					}
1819				}
1820
1821				mfp._parseMarkup(template, {
1822					title: _getTitle(item),
1823					img_replaceWith: item.img
1824				}, item);
1825
1826				mfp.resizeImage();
1827
1828				if(item.hasSize) {
1829					if(_imgInterval) clearInterval(_imgInterval);
1830
1831					if(item.loadError) {
1832						template.addClass('mfp-loading');
1833						mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
1834					} else {
1835						template.removeClass('mfp-loading');
1836						mfp.updateStatus('ready');
1837					}
1838					return template;
1839				}
1840
1841				mfp.updateStatus('loading');
1842				item.loading = true;
1843
1844				if(!item.hasSize) {
1845					item.imgHidden = true;
1846					template.addClass('mfp-loading');
1847					mfp.findImageSize(item);
1848				}
1849
1850				return template;
1851			}
1852		}
1853	});
1854
1855	/*>>image*/
1856
1857	/*>>zoom*/
1858	var hasMozTransform,
1859		getHasMozTransform = function() {
1860			if(hasMozTransform === undefined) {
1861				hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
1862			}
1863			return hasMozTransform;
1864		};
1865
1866	$.magnificPopup.registerModule('zoom', {
1867
1868		options: {
1869			enabled: false,
1870			easing: 'ease-in-out',
1871			duration: 300,
1872			opener: function(element) {
1873				return element.is('img') ? element : element.find('img');
1874			}
1875		},
1876
1877		proto: {
1878
1879			initZoom: function() {
1880				var zoomSt = mfp.st.zoom,
1881					ns = '.zoom',
1882					image;
1883
1884				if(!zoomSt.enabled || !mfp.supportsTransition) {
1885					return;
1886				}
1887
1888				var duration = zoomSt.duration,
1889					getElToAnimate = function(image) {
1890						var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
1891							transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
1892							cssObj = {
1893								position: 'fixed',
1894								zIndex: 9999,
1895								left: 0,
1896								top: 0,
1897								'-webkit-backface-visibility': 'hidden'
1898							},
1899							t = 'transition';
1900
1901						cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;
1902
1903						newImg.css(cssObj);
1904						return newImg;
1905					},
1906					showMainContent = function() {
1907						mfp.content.css('visibility', 'visible');
1908					},
1909					openTimeout,
1910					animatedImg;
1911
1912				_mfpOn('BuildControls'+ns, function() {
1913					if(mfp._allowZoom()) {
1914
1915						clearTimeout(openTimeout);
1916						mfp.content.css('visibility', 'hidden');
1917
1918						// Basically, all code below does is clones existing image, puts in on top of the current one and animated it
1919
1920						image = mfp._getItemToZoom();
1921
1922						if(!image) {
1923							showMainContent();
1924							return;
1925						}
1926
1927						animatedImg = getElToAnimate(image);
1928
1929						animatedImg.css( mfp._getOffset() );
1930
1931						mfp.wrap.append(animatedImg);
1932
1933						openTimeout = setTimeout(function() {
1934							animatedImg.css( mfp._getOffset( true ) );
1935							openTimeout = setTimeout(function() {
1936
1937								showMainContent();
1938
1939								setTimeout(function() {
1940									animatedImg.remove();
1941									image = animatedImg = null;
1942									_mfpTrigger('ZoomAnimationEnded');
1943								}, 16); // avoid blink when switching images
1944
1945							}, duration); // this timeout equals animation duration
1946
1947						}, 16); // by adding this timeout we avoid short glitch at the beginning of animation
1948
1949
1950						// Lots of timeouts...
1951					}
1952				});
1953				_mfpOn(BEFORE_CLOSE_EVENT+ns, function() {
1954					if(mfp._allowZoom()) {
1955
1956						clearTimeout(openTimeout);
1957
1958						mfp.st.removalDelay = duration;
1959
1960						if(!image) {
1961							image = mfp._getItemToZoom();
1962							if(!image) {
1963								return;
1964							}
1965							animatedImg = getElToAnimate(image);
1966						}
1967
1968						animatedImg.css( mfp._getOffset(true) );
1969						mfp.wrap.append(animatedImg);
1970						mfp.content.css('visibility', 'hidden');
1971
1972						setTimeout(function() {
1973							animatedImg.css( mfp._getOffset() );
1974						}, 16);
1975					}
1976
1977				});
1978
1979				_mfpOn(CLOSE_EVENT+ns, function() {
1980					if(mfp._allowZoom()) {
1981						showMainContent();
1982						if(animatedImg) {
1983							animatedImg.remove();
1984						}
1985						image = null;
1986					}
1987				});
1988			},
1989
1990			_allowZoom: function() {
1991				return mfp.currItem.type === 'image';
1992			},
1993
1994			_getItemToZoom: function() {
1995				if(mfp.currItem.hasSize) {
1996					return mfp.currItem.img;
1997				} else {
1998					return false;
1999				}
2000			},
2001
2002			// Get element postion relative to viewport
2003			_getOffset: function(isLarge) {
2004				var el;
2005				if(isLarge) {
2006					el = mfp.currItem.img;
2007				} else {
2008					el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);
2009				}
2010
2011				var offset = el.offset();
2012				var paddingTop = parseInt(el.css('padding-top'),10);
2013				var paddingBottom = parseInt(el.css('padding-bottom'),10);
2014				offset.top -= ( $(window).scrollTop() - paddingTop );
2015
2016
2017				/*
2018
2019				 Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.
2020
2021				 */
2022				var obj = {
2023					width: el.width(),
2024					// fix Zepto height+padding issue
2025					height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop
2026				};
2027
2028				// I hate to do this, but there is no another option
2029				if( getHasMozTransform() ) {
2030					obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';
2031				} else {
2032					obj.left = offset.left;
2033					obj.top = offset.top;
2034				}
2035				return obj;
2036			}
2037
2038		}
2039	});
2040
2041
2042
2043	/*>>zoom*/
2044
2045	/*>>iframe*/
2046
2047	var IFRAME_NS = 'iframe',
2048		_emptyPage = '//about:blank',
2049
2050		_fixIframeBugs = function(isShowing) {
2051			if(mfp.currTemplate[IFRAME_NS]) {
2052				var el = mfp.currTemplate[IFRAME_NS].find('iframe');
2053				if(el.length) {
2054					// reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
2055					if(!isShowing) {
2056						el[0].src = _emptyPage;
2057					}
2058
2059					// IE8 black screen bug fix
2060					if(mfp.isIE8) {
2061						el.css('display', isShowing ? 'block' : 'none');
2062					}
2063				}
2064			}
2065		};
2066
2067	$.magnificPopup.registerModule(IFRAME_NS, {
2068
2069		options: {
2070			markup: '<div class="mfp-iframe-scaler">'+
2071			        '<div class="mfp-close"></div>'+
2072			        '<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+
2073			        '</div>',
2074
2075			srcAction: 'iframe_src',
2076
2077			// we don't care and support only one default type of URL by default
2078			patterns: {
2079				youtube: {
2080					index: 'youtube.com',
2081					id: 'v=',
2082					src: '//www.youtube.com/embed/%id%?autoplay=1'
2083				},
2084				vimeo: {
2085					index: 'vimeo.com/',
2086					id: '/',
2087					src: '//player.vimeo.com/video/%id%?autoplay=1'
2088				},
2089				gmaps: {
2090					index: '//maps.google.',
2091					src: '%id%&output=embed'
2092				}
2093			}
2094		},
2095
2096		proto: {
2097			initIframe: function() {
2098				mfp.types.push(IFRAME_NS);
2099
2100				_mfpOn('BeforeChange', function(e, prevType, newType) {
2101					if(prevType !== newType) {
2102						if(prevType === IFRAME_NS) {
2103							_fixIframeBugs(); // iframe if removed
2104						} else if(newType === IFRAME_NS) {
2105							_fixIframeBugs(true); // iframe is showing
2106						}
2107					}// else {
2108					// iframe source is switched, don't do anything
2109					//}
2110				});
2111
2112				_mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {
2113					_fixIframeBugs();
2114				});
2115			},
2116
2117			getIframe: function(item, template) {
2118				var embedSrc = item.src;
2119				var iframeSt = mfp.st.iframe;
2120
2121				$.each(iframeSt.patterns, function() {
2122					if(embedSrc.indexOf( this.index ) > -1) {
2123						if(this.id) {
2124							if(typeof this.id === 'string') {
2125								embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
2126							} else {
2127								embedSrc = this.id.call( this, embedSrc );
2128							}
2129						}
2130						embedSrc = this.src.replace('%id%', embedSrc );
2131						return false; // break;
2132					}
2133				});
2134
2135				var dataObj = {};
2136				if(iframeSt.srcAction) {
2137					dataObj[iframeSt.srcAction] = embedSrc;
2138				}
2139				mfp._parseMarkup(template, dataObj, item);
2140
2141				mfp.updateStatus('ready');
2142
2143				return template;
2144			}
2145		}
2146	});
2147
2148
2149
2150	/*>>iframe*/
2151
2152	/*>>gallery*/
2153	/**
2154	 * Get looped index depending on number of slides
2155	 */
2156	var _getLoopedId = function(index) {
2157			var numSlides = mfp.items.length;
2158			if(index > numSlides - 1) {
2159				return index - numSlides;
2160			} else  if(index < 0) {
2161				return numSlides + index;
2162			}
2163			return index;
2164		},
2165		_replaceCurrTotal = function(text, curr, total) {
2166			return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
2167		};
2168
2169	$.magnificPopup.registerModule('gallery', {
2170
2171		options: {
2172			enabled: false,
2173			arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
2174			preload: [0,2],
2175			navigateByImgClick: true,
2176			arrows: true,
2177
2178			tPrev: 'Previous (Left arrow key)',
2179			tNext: 'Next (Right arrow key)',
2180			tCounter: '%curr% of %total%'
2181		},
2182
2183		proto: {
2184			initGallery: function() {
2185
2186				var gSt = mfp.st.gallery,
2187					ns = '.mfp-gallery';
2188
2189				mfp.direction = true; // true - next, false - prev
2190
2191				if(!gSt || !gSt.enabled ) return false;
2192
2193				_wrapClasses += ' mfp-gallery';
2194
2195				_mfpOn(OPEN_EVENT+ns, function() {
2196
2197					if(gSt.navigateByImgClick) {
2198						mfp.wrap.on('click'+ns, '.mfp-img', function() {
2199							if(mfp.items.length > 1) {
2200								mfp.next();
2201								return false;
2202							}
2203						});
2204					}
2205
2206					_document.on('keydown'+ns, function(e) {
2207						if (e.keyCode === 37) {
2208							mfp.prev();
2209						} else if (e.keyCode === 39) {
2210							mfp.next();
2211						}
2212					});
2213				});
2214
2215				_mfpOn('UpdateStatus'+ns, function(e, data) {
2216					if(data.text) {
2217						data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
2218					}
2219				});
2220
2221				_mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {
2222					var l = mfp.items.length;
2223					values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';
2224				});
2225
2226				_mfpOn('BuildControls' + ns, function() {
2227					if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
2228						var markup = gSt.arrowMarkup,
2229							arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
2230							arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
2231
2232						arrowLeft.click(function() {
2233							mfp.prev();
2234						});
2235						arrowRight.click(function() {
2236							mfp.next();
2237						});
2238
2239						mfp.container.append(arrowLeft.add(arrowRight));
2240					}
2241				});
2242
2243				_mfpOn(CHANGE_EVENT+ns, function() {
2244					if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
2245
2246					mfp._preloadTimeout = setTimeout(function() {
2247						mfp.preloadNearbyImages();
2248						mfp._preloadTimeout = null;
2249					}, 16);
2250				});
2251
2252
2253				_mfpOn(CLOSE_EVENT+ns, function() {
2254					_document.off(ns);
2255					mfp.wrap.off('click'+ns);
2256					mfp.arrowRight = mfp.arrowLeft = null;
2257				});
2258
2259			},
2260			next: function() {
2261				mfp.direction = true;
2262				mfp.index = _getLoopedId(mfp.index + 1);
2263				mfp.updateItemHTML();
2264			},
2265			prev: function() {
2266				mfp.direction = false;
2267				mfp.index = _getLoopedId(mfp.index - 1);
2268				mfp.updateItemHTML();
2269			},
2270			goTo: function(newIndex) {
2271				mfp.direction = (newIndex >= mfp.index);
2272				mfp.index = newIndex;
2273				mfp.updateItemHTML();
2274			},
2275			preloadNearbyImages: function() {
2276				var p = mfp.st.gallery.preload,
2277					preloadBefore = Math.min(p[0], mfp.items.length),
2278					preloadAfter = Math.min(p[1], mfp.items.length),
2279					i;
2280
2281				for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
2282					mfp._preloadItem(mfp.index+i);
2283				}
2284				for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
2285					mfp._preloadItem(mfp.index-i);
2286				}
2287			},
2288			_preloadItem: function(index) {
2289				index = _getLoopedId(index);
2290
2291				if(mfp.items[index].preloaded) {
2292					return;
2293				}
2294
2295				var item = mfp.items[index];
2296				if(!item.parsed) {
2297					item = mfp.parseEl( index );
2298				}
2299
2300				_mfpTrigger('LazyLoad', item);
2301
2302				if(item.type === 'image') {
2303					item.img = $('<img class="mfp-img" />').on('load.mfploader', function() {
2304						item.hasSize = true;
2305					}).on('error.mfploader', function() {
2306						item.hasSize = true;
2307						item.loadError = true;
2308						_mfpTrigger('LazyLoadError', item);
2309					}).attr('src', item.src);
2310				}
2311
2312
2313				item.preloaded = true;
2314			}
2315		}
2316	});
2317
2318	/*>>gallery*/
2319
2320	/*>>retina*/
2321
2322	var RETINA_NS = 'retina';
2323
2324	$.magnificPopup.registerModule(RETINA_NS, {
2325		options: {
2326			replaceSrc: function(item) {
2327				return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; });
2328			},
2329			ratio: 1 // Function or number.  Set to 1 to disable.
2330		},
2331		proto: {
2332			initRetina: function() {
2333				if(window.devicePixelRatio > 1) {
2334
2335					var st = mfp.st.retina,
2336						ratio = st.ratio;
2337
2338					ratio = !isNaN(ratio) ? ratio : ratio();
2339
2340					if(ratio > 1) {
2341						_mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {
2342							item.img.css({
2343								'max-width': item.img[0].naturalWidth / ratio,
2344								'width': '100%'
2345							});
2346						});
2347						_mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {
2348							item.src = st.replaceSrc(item, ratio);
2349						});
2350					}
2351				}
2352
2353			}
2354		}
2355	});
2356
2357	/*>>retina*/
2358	_checkInstance(); }));
2359//! moment.js
2360//! version : 2.13.0
2361//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
2362//! license : MIT
2363//! momentjs.com�
vendor: 32,011 bytes, lines 2363-2364
2363
2364!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return fd.apply(null,arguments)}function b(a){fd=a}function c(a){return a instanceof Array||"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function f(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function g(a,b){for(var c in b)f(b,c)&&(a[c]=b[c]);return f(b,"toString")&&(a.toString=b.toString),f(b,"valueOf")&&(a.valueOf=b.valueOf),a}function h(a,b,c,d){return Ja(a,b,c,d,!0).utc()}function i(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function j(a){return null==a._pf&&(a._pf=i()),a._pf}function k(a){if(null==a._isValid){var b=j(a),c=gd.call(b.parsedDateParts,function(a){return null!=a});a._isValid=!isNaN(a._d.getTime())&&b.overflow<0&&!b.empty&&!b.invalidMonth&&!b.invalidWeekday&&!b.nullInput&&!b.invalidFormat&&!b.userInvalidated&&(!b.meridiem||b.meridiem&&c),a._strict&&(a._isValid=a._isValid&&0===b.charsLeftOver&&0===b.unusedTokens.length&&void 0===b.bigHour)}return a._isValid}function l(a){var b=h(NaN);return null!=a?g(j(b),a):j(b).userInvalidated=!0,b}function m(a){return void 0===a}function n(a,b){var c,d,e;if(m(b._isAMomentObject)||(a._isAMomentObject=b._isAMomentObject),m(b._i)||(a._i=b._i),m(b._f)||(a._f=b._f),m(b._l)||(a._l=b._l),m(b._strict)||(a._strict=b._strict),m(b._tzm)||(a._tzm=b._tzm),m(b._isUTC)||(a._isUTC=b._isUTC),m(b._offset)||(a._offset=b._offset),m(b._pf)||(a._pf=j(b)),m(b._locale)||(a._locale=b._locale),hd.length>0)for(c in hd)d=hd[c],e=b[d],m(e)||(a[d]=e);return a}function o(b){n(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),id===!1&&(id=!0,a.updateOffset(this),id=!1)}function p(a){return a instanceof o||null!=a&&null!=a._isAMomentObject}function q(a){return 0>a?Math.ceil(a):Math.floor(a)}function r(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=q(b)),c}function s(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&r(a[d])!==r(b[d]))&&g++;return g+f}function t(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function u(b,c){var d=!0;return g(function(){return null!=a.deprecationHandler&&a.deprecationHandler(null,b),d&&(t(b+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),d=!1),c.apply(this,arguments)},c)}function v(b,c){null!=a.deprecationHandler&&a.deprecationHandler(b,c),jd[b]||(t(c),jd[b]=!0)}function w(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function x(a){return"[object Object]"===Object.prototype.toString.call(a)}function y(a){var b,c;for(c in a)b=a[c],w(b)?this[c]=b:this["_"+c]=b;this._config=a,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function z(a,b){var c,d=g({},a);for(c in b)f(b,c)&&(x(a[c])&&x(b[c])?(d[c]={},g(d[c],a[c]),g(d[c],b[c])):null!=b[c]?d[c]=b[c]:delete d[c]);return d}function A(a){null!=a&&this.set(a)}function B(a){return a?a.toLowerCase().replace("_","-"):a}function C(a){for(var b,c,d,e,f=0;f<a.length;){for(e=B(a[f]).split("-"),b=e.length,c=B(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=D(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&s(e,c,!0)>=b-1)break;b--}f++}return null}function D(a){var b=null;if(!nd[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=ld._abbr,require("./locale/"+a),E(b)}catch(c){}return nd[a]}function E(a,b){var c;return a&&(c=m(b)?H(a):F(a,b),c&&(ld=c)),ld._abbr}function F(a,b){return null!==b?(b.abbr=a,null!=nd[a]?(v("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),b=z(nd[a]._config,b)):null!=b.parentLocale&&(null!=nd[b.parentLocale]?b=z(nd[b.parentLocale]._config,b):v("parentLocaleUndefined","specified parentLocale is not defined yet")),nd[a]=new A(b),E(a),nd[a]):(delete nd[a],null)}function G(a,b){if(null!=b){var c;null!=nd[a]&&(b=z(nd[a]._config,b)),c=new A(b),c.parentLocale=nd[a],nd[a]=c,E(a)}else null!=nd[a]&&(null!=nd[a].parentLocale?nd[a]=nd[a].parentLocale:null!=nd[a]&&delete nd[a]);return nd[a]}function H(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return ld;if(!c(a)){if(b=D(a))return b;a=[a]}return C(a)}function I(){return kd(nd)}function J(a,b){var c=a.toLowerCase();od[c]=od[c+"s"]=od[b]=a}function K(a){return"string"==typeof a?od[a]||od[a.toLowerCase()]:void 0}function L(a){var b,c,d={};for(c in a)f(a,c)&&(b=K(c),b&&(d[b]=a[c]));return d}function M(b,c){return function(d){return null!=d?(O(this,b,d),a.updateOffset(this,c),this):N(this,b)}}function N(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function O(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function P(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=K(a),w(this[a]))return this[a](b);return this}function Q(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function R(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(sd[a]=e),b&&(sd[b[0]]=function(){return Q(e.apply(this,arguments),b[1],b[2])}),c&&(sd[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function S(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function T(a){var b,c,d=a.match(pd);for(b=0,c=d.length;c>b;b++)sd[d[b]]?d[b]=sd[d[b]]:d[b]=S(d[b]);return function(b){var e,f="";for(e=0;c>e;e++)f+=d[e]instanceof Function?d[e].call(b,a):d[e];return f}}function U(a,b){return a.isValid()?(b=V(b,a.localeData()),rd[b]=rd[b]||T(b),rd[b](a)):a.localeData().invalidDate()}function V(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(qd.lastIndex=0;d>=0&&qd.test(a);)a=a.replace(qd,c),qd.lastIndex=0,d-=1;return a}function W(a,b,c){Kd[a]=w(b)?b:function(a,d){return a&&c?c:b}}function X(a,b){return f(Kd,a)?Kd[a](b._strict,b._locale):new RegExp(Y(a))}function Y(a){return Z(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function Z(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=r(a)}),c=0;c<a.length;c++)Ld[a[c]]=d}function _(a,b){$(a,function(a,c,d,e){d._w=d._w||{},b(a,d._w,d,e)})}function aa(a,b,c){null!=b&&f(Ld,a)&&Ld[a](b,c._a,c,a)}function ba(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function ca(a,b){return c(this._months)?this._months[a.month()]:this._months[Vd.test(b)?"format":"standalone"][a.month()]}function da(a,b){return c(this._monthsShort)?this._monthsShort[a.month()]:this._monthsShort[Vd.test(b)?"format":"standalone"][a.month()]}function ea(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],d=0;12>d;++d)f=h([2e3,d]),this._shortMonthsParse[d]=this.monthsShort(f,"").toLocaleLowerCase(),this._longMonthsParse[d]=this.months(f,"").toLocaleLowerCase();return c?"MMM"===b?(e=md.call(this._shortMonthsParse,g),-1!==e?e:null):(e=md.call(this._longMonthsParse,g),-1!==e?e:null):"MMM"===b?(e=md.call(this._shortMonthsParse,g),-1!==e?e:(e=md.call(this._longMonthsParse,g),-1!==e?e:null)):(e=md.call(this._longMonthsParse,g),-1!==e?e:(e=md.call(this._shortMonthsParse,g),-1!==e?e:null))}function fa(a,b,c){var d,e,f;if(this._monthsParseExact)return ea.call(this,a,b,c);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;12>d;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function ga(a,b){var c;if(!a.isValid())return a;if("string"==typeof b)if(/^\d+$/.test(b))b=r(b);else if(b=a.localeData().monthsParse(b),"number"!=typeof b)return a;return c=Math.min(a.date(),ba(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a}function ha(b){return null!=b?(ga(this,b),a.updateOffset(this,!0),this):N(this,"Month")}function ia(){return ba(this.year(),this.month())}function ja(a){return this._monthsParseExact?(f(this,"_monthsRegex")||la.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex}function ka(a){return this._monthsParseExact?(f(this,"_monthsRegex")||la.call(this),a?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex}function la(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;12>b;b++)c=h([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(d.sort(a),e.sort(a),f.sort(a),b=0;12>b;b++)d[b]=Z(d[b]),e[b]=Z(e[b]),f[b]=Z(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")","i")}function ma(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[Nd]<0||c[Nd]>11?Nd:c[Od]<1||c[Od]>ba(c[Md],c[Nd])?Od:c[Pd]<0||c[Pd]>24||24===c[Pd]&&(0!==c[Qd]||0!==c[Rd]||0!==c[Sd])?Pd:c[Qd]<0||c[Qd]>59?Qd:c[Rd]<0||c[Rd]>59?Rd:c[Sd]<0||c[Sd]>999?Sd:-1,j(a)._overflowDayOfYear&&(Md>b||b>Od)&&(b=Od),j(a)._overflowWeeks&&-1===b&&(b=Td),j(a)._overflowWeekday&&-1===b&&(b=Ud),j(a).overflow=b),a}function na(a){var b,c,d,e,f,g,h=a._i,i=$d.exec(h)||_d.exec(h);if(i){for(j(a).iso=!0,b=0,c=be.length;c>b;b++)if(be[b][1].exec(i[1])){e=be[b][0],d=be[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=ce.length;c>b;b++)if(ce[b][1].exec(i[3])){f=(i[2]||" ")+ce[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!ae.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),Ca(a)}else a._isValid=!1}function oa(b){var c=de.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(na(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function pa(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 100>a&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function qa(a){var b=new Date(Date.UTC.apply(null,arguments));return 100>a&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function ra(a){return sa(a)?366:365}function sa(a){return a%4===0&&a%100!==0||a%400===0}function ta(){return sa(this.year())}function ua(a,b,c){var d=7+b-c,e=(7+qa(a,0,d).getUTCDay()-b)%7;return-e+d-1}function va(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=ua(a,d,e),j=1+7*(b-1)+h+i;return 0>=j?(f=a-1,g=ra(f)+j):j>ra(a)?(f=a+1,g=j-ra(a)):(f=a,g=j),{year:f,dayOfYear:g}}function wa(a,b,c){var d,e,f=ua(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return 1>g?(e=a.year()-1,d=g+xa(e,b,c)):g>xa(a.year(),b,c)?(d=g-xa(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function xa(a,b,c){var d=ua(a,b,c),e=ua(a+1,b,c);return(ra(a)-d+e)/7}function ya(a,b,c){return null!=a?a:null!=b?b:c}function za(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function Aa(a){var b,c,d,e,f=[];if(!a._d){for(d=za(a),a._w&&null==a._a[Od]&&null==a._a[Nd]&&Ba(a),a._dayOfYear&&(e=ya(a._a[Md],d[Md]),a._dayOfYear>ra(e)&&(j(a)._overflowDayOfYear=!0),c=qa(e,0,a._dayOfYear),a._a[Nd]=c.getUTCMonth(),a._a[Od]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[Pd]&&0===a._a[Qd]&&0===a._a[Rd]&&0===a._a[Sd]&&(a._nextDay=!0,a._a[Pd]=0),a._d=(a._useUTC?qa:pa).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Pd]=24)}}function Ba(a){var b,c,d,e,f,g,h,i;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=ya(b.GG,a._a[Md],wa(Ka(),1,4).year),d=ya(b.W,1),e=ya(b.E,1),(1>e||e>7)&&(i=!0)):(f=a._locale._week.dow,g=a._locale._week.doy,c=ya(b.gg,a._a[Md],wa(Ka(),f,g).year),d=ya(b.w,1),null!=b.d?(e=b.d,(0>e||e>6)&&(i=!0)):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f),1>d||d>xa(c,f,g)?j(a)._overflowWeeks=!0:null!=i?j(a)._overflowWeekday=!0:(h=va(c,d,e,f,g),a._a[Md]=h.year,a._dayOfYear=h.dayOfYear)}function Ca(b){if(b._f===a.ISO_8601)return void na(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=V(b._f,b._locale).match(pd)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(X(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),sd[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),aa(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[Pd]<=12&&b._a[Pd]>0&&(j(b).bigHour=void 0),j(b).parsedDateParts=b._a.slice(0),j(b).meridiem=b._meridiem,b._a[Pd]=Da(b._locale,b._a[Pd],b._meridiem),Aa(b),ma(b)}function Da(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function Ea(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;e<a._f.length;e++)f=0,b=n({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._f=a._f[e],Ca(b),k(b)&&(f+=j(b).charsLeftOver,f+=10*j(b).unusedTokens.length,j(b).score=f,(null==d||d>f)&&(d=f,c=b));g(a,c||b)}function Fa(a){if(!a._d){var b=L(a._i);a._a=e([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),Aa(a)}}function Ga(a){var b=new o(ma(Ha(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Ha(a){var b=a._i,e=a._f;return a._locale=a._locale||H(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),p(b)?new o(ma(b)):(c(e)?Ea(a):e?Ca(a):d(b)?a._d=b:Ia(a),k(a)||(a._d=null),a))}function Ia(b){var f=b._i;void 0===f?b._d=new Date(a.now()):d(f)?b._d=new Date(f.valueOf()):"string"==typeof f?oa(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),Aa(b)):"object"==typeof f?Fa(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Ja(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,Ga(f)}function Ka(a,b,c,d){return Ja(a,b,c,d,!1)}function La(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Ka();for(d=b[0],e=1;e<b.length;++e)(!b[e].isValid()||b[e][a](d))&&(d=b[e]);return d}function Ma(){var a=[].slice.call(arguments,0);return La("isBefore",a)}function Na(){var a=[].slice.call(arguments,0);return La("isAfter",a)}function Oa(a){var b=L(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+1e3*h*60*60,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=H(),this._bubble()}function Pa(a){return a instanceof Oa}function Qa(a,b){R(a,0,0,function(){var a=this.utcOffset(),c="+";return 0>a&&(a=-a,c="-"),c+Q(~~(a/60),2)+b+Q(~~a%60,2)})}function Ra(a,b){var c=(b||"").match(a)||[],d=c[c.length-1]||[],e=(d+"").match(ie)||["-",0,0],f=+(60*e[1])+r(e[2]);return"+"===e[0]?f:-f}function Sa(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(p(b)||d(b)?b.valueOf():Ka(b).valueOf())-e.valueOf(),e._d.setTime(e._d.valueOf()+f),a.updateOffset(e,!1),e):Ka(b).local()}function Ta(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Ua(b,c){var d,e=this._offset||0;return this.isValid()?null!=b?("string"==typeof b?b=Ra(Hd,b):Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Ta(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?jb(this,db(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Ta(this):null!=b?this:NaN}function Va(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Wa(a){return this.utcOffset(0,a)}function Xa(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Ta(this),"m")),this}function Ya(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ra(Gd,this._i)),this}function Za(a){return this.isValid()?(a=a?Ka(a).utcOffset():0,(this.utcOffset()-a)%60===0):!1}function $a(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _a(){if(!m(this._isDSTShifted))return this._isDSTShifted;var a={};if(n(a,this),a=Ha(a),a._a){var b=a._isUTC?h(a._a):Ka(a._a);this._isDSTShifted=this.isValid()&&s(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function ab(){return this.isValid()?!this._isUTC:!1}function bb(){return this.isValid()?this._isUTC:!1}function cb(){return this.isValid()?this._isUTC&&0===this._offset:!1}function db(a,b){var c,d,e,g=a,h=null;return Pa(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=je.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:r(h[Od])*c,h:r(h[Pd])*c,m:r(h[Qd])*c,s:r(h[Rd])*c,ms:r(h[Sd])*c}):(h=ke.exec(a))?(c="-"===h[1]?-1:1,g={y:eb(h[2],c),M:eb(h[3],c),w:eb(h[4],c),d:eb(h[5],c),h:eb(h[6],c),m:eb(h[7],c),s:eb(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=gb(Ka(g.from),Ka(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Oa(g),Pa(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function eb(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function fb(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function gb(a,b){var c;return a.isValid()&&b.isValid()?(b=Sa(b,a),a.isBefore(b)?c=fb(a,b):(c=fb(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function hb(a){return 0>a?-1*Math.round(-1*a):Math.round(a)}function ib(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(v(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=db(c,d),jb(this,e,a),this}}function jb(b,c,d,e){var f=c._milliseconds,g=hb(c._days),h=hb(c._months);b.isValid()&&(e=null==e?!0:e,f&&b._d.setTime(b._d.valueOf()+f*d),g&&O(b,"Date",N(b,"Date")+g*d),h&&ga(b,N(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function kb(a,b){var c=a||Ka(),d=Sa(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse",g=b&&(w(b[f])?b[f]():b[f]);return this.format(g||this.localeData().calendar(f,this,Ka(c)))}function lb(){return new o(this)}function mb(a,b){var c=p(a)?a:Ka(a);return this.isValid()&&c.isValid()?(b=K(m(b)?"millisecond":b),"millisecond"===b?this.valueOf()>c.valueOf():c.valueOf()<this.clone().startOf(b).valueOf()):!1}function nb(a,b){var c=p(a)?a:Ka(a);return this.isValid()&&c.isValid()?(b=K(m(b)?"millisecond":b),"millisecond"===b?this.valueOf()<c.valueOf():this.clone().endOf(b).valueOf()<c.valueOf()):!1}function ob(a,b,c,d){return d=d||"()",("("===d[0]?this.isAfter(a,c):!this.isBefore(a,c))&&(")"===d[1]?this.isBefore(b,c):!this.isAfter(b,c))}function pb(a,b){var c,d=p(a)?a:Ka(a);return this.isValid()&&d.isValid()?(b=K(b||"millisecond"),"millisecond"===b?this.valueOf()===d.valueOf():(c=d.valueOf(),this.clone().startOf(b).valueOf()<=c&&c<=this.clone().endOf(b).valueOf())):!1}function qb(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function rb(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function sb(a,b,c){var d,e,f,g;return this.isValid()?(d=Sa(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=K(b),"year"===b||"month"===b||"quarter"===b?(g=tb(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:q(g)):NaN):NaN}function tb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)||0}function ub(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function vb(){var a=this.clone().utc();return 0<a.year()&&a.year()<=9999?w(Date.prototype.toISOString)?this.toDate().toISOString():U(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):U(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function wb(b){b||(b=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var c=U(this,b);return this.localeData().postformat(c)}function xb(a,b){return this.isValid()&&(p(a)&&a.isValid()||Ka(a).isValid())?db({to:this,from:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function yb(a){return this.from(Ka(),a)}function zb(a,b){return this.isValid()&&(p(a)&&a.isValid()||Ka(a).isValid())?db({from:this,to:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function Ab(a){return this.to(Ka(),a)}function Bb(a){var b;return void 0===a?this._locale._abbr:(b=H(a),null!=b&&(this._locale=b),this)}function Cb(){return this._locale}function Db(a){switch(a=K(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a&&this.weekday(0),"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this}function Eb(a){return a=K(a),void 0===a||"millisecond"===a?this:("date"===a&&(a="day"),this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms"))}function Fb(){return this._d.valueOf()-6e4*(this._offset||0)}function Gb(){return Math.floor(this.valueOf()/1e3)}function Hb(){return this._offset?new Date(this.valueOf()):this._d}function Ib(){var a=this;return[a.year(),a.month(),a.date(),a.hour(),a.minute(),a.second(),a.millisecond()]}function Jb(){var a=this;return{years:a.year(),months:a.month(),date:a.date(),hours:a.hours(),minutes:a.minutes(),seconds:a.seconds(),milliseconds:a.milliseconds()}}function Kb(){return this.isValid()?this.toISOString():null}function Lb(){return k(this)}function Mb(){return g({},j(this))}function Nb(){return j(this).overflow}function Ob(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Pb(a,b){R(0,[a,a.length],0,b)}function Qb(a){return Ub.call(this,a,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Rb(a){return Ub.call(this,a,this.isoWeek(),this.isoWeekday(),1,4)}function Sb(){return xa(this.year(),1,4)}function Tb(){var a=this.localeData()._week;return xa(this.year(),a.dow,a.doy)}function Ub(a,b,c,d,e){var f;return null==a?wa(this,d,e).year:(f=xa(a,d,e),b>f&&(b=f),Vb.call(this,a,b,c,d,e))}function Vb(a,b,c,d,e){var f=va(a,b,c,d,e),g=qa(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Wb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Xb(a){return wa(a,this._week.dow,this._week.doy).week}function Yb(){return this._week.dow}function Zb(){return this._week.doy}function $b(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function _b(a){var b=wa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function ac(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function bc(a,b){return c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]}function cc(a){return this._weekdaysShort[a.day()]}function dc(a){return this._weekdaysMin[a.day()]}function ec(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;7>d;++d)f=h([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(f,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(f,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(f,"").toLocaleLowerCase();return c?"dddd"===b?(e=md.call(this._weekdaysParse,g),-1!==e?e:null):"ddd"===b?(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:null):(e=md.call(this._minWeekdaysParse,g),-1!==e?e:null):"dddd"===b?(e=md.call(this._weekdaysParse,g),-1!==e?e:(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:(e=md.call(this._minWeekdaysParse,g),-1!==e?e:null))):"ddd"===b?(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:(e=md.call(this._weekdaysParse,g),-1!==e?e:(e=md.call(this._minWeekdaysParse,g),-1!==e?e:null))):(e=md.call(this._minWeekdaysParse,g),-1!==e?e:(e=md.call(this._weekdaysParse,g),-1!==e?e:(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:null)))}function fc(a,b,c){var d,e,f;if(this._weekdaysParseExact)return ec.call(this,a,b,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;7>d;d++){if(e=h([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function gc(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=ac(a,this.localeData()),this.add(a-b,"d")):b}function hc(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function ic(a){return this.isValid()?null==a?this.day()||7:this.day(this.day()%7?a:a-7):null!=a?this:NaN}function jc(a){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||mc.call(this),a?this._weekdaysStrictRegex:this._weekdaysRegex):this._weekdaysStrictRegex&&a?this._weekdaysStrictRegex:this._weekdaysRegex}function kc(a){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||mc.call(this),a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):this._weekdaysShortStrictRegex&&a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}function lc(a){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||mc.call(this),a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):this._weekdaysMinStrictRegex&&a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}function mc(){function a(a,b){return b.length-a.length}var b,c,d,e,f,g=[],i=[],j=[],k=[];for(b=0;7>b;b++)c=h([2e3,1]).day(b),d=this.weekdaysMin(c,""),e=this.weekdaysShort(c,""),f=this.weekdays(c,""),g.push(d),i.push(e),j.push(f),k.push(d),k.push(e),k.push(f);for(g.sort(a),i.sort(a),j.sort(a),k.sort(a),b=0;7>b;b++)i[b]=Z(i[b]),j[b]=Z(j[b]),k[b]=Z(k[b]);this._weekdaysRegex=new RegExp("^("+k.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+j.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+g.join("|")+")","i")}function nc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function oc(){return this.hours()%12||12}function pc(){return this.hours()||24}function qc(a,b){R(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function rc(a,b){return b._meridiemParse}function sc(a){return"p"===(a+"").toLowerCase().charAt(0)}function tc(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function uc(a,b){b[Sd]=r(1e3*("0."+a))}function vc(){return this._isUTC?"UTC":""}function wc(){return this._isUTC?"Coordinated Universal Time":""}function xc(a){return Ka(1e3*a)}function yc(){return Ka.apply(null,arguments).parseZone()}function zc(a,b,c){var d=this._calendar[a];return w(d)?d.call(b,c):d}function Ac(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function Bc(){return this._invalidDate}function Cc(a){return this._ordinal.replace("%d",a)}function Dc(a){return a}function Ec(a,b,c,d){var e=this._relativeTime[c];return w(e)?e(a,b,c,d):e.replace(/%d/i,a)}function Fc(a,b){var c=this._relativeTime[a>0?"future":"past"];return w(c)?c(b):c.replace(/%s/i,b)}function Gc(a,b,c,d){var e=H(),f=h().set(d,b);return e[c](f,a)}function Hc(a,b,c){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return Gc(a,b,c,"month");var d,e=[];for(d=0;12>d;d++)e[d]=Gc(a,d,c,"month");return e}function Ic(a,b,c,d){"boolean"==typeof a?("number"==typeof b&&(c=b,b=void 0),b=b||""):(b=a,c=b,a=!1,"number"==typeof b&&(c=b,b=void 0),b=b||"");var e=H(),f=a?e._week.dow:0;if(null!=c)return Gc(b,(c+f)%7,d,"day");var g,h=[];for(g=0;7>g;g++)h[g]=Gc(b,(g+f)%7,d,"day");return h}function Jc(a,b){return Hc(a,b,"months")}function Kc(a,b){return Hc(a,b,"monthsShort")}function Lc(a,b,c){return Ic(a,b,c,"weekdays")}function Mc(a,b,c){return Ic(a,b,c,"weekdaysShort")}function Nc(a,b,c){return Ic(a,b,c,"weekdaysMin")}function Oc(){var a=this._data;return this._milliseconds=Le(this._milliseconds),this._days=Le(this._days),this._months=Le(this._months),a.milliseconds=Le(a.milliseconds),a.seconds=Le(a.seconds),a.minutes=Le(a.minutes),a.hours=Le(a.hours),a.months=Le(a.months),a.years=Le(a.years),this}function Pc(a,b,c,d){var e=db(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function Qc(a,b){return Pc(this,a,b,1)}function Rc(a,b){return Pc(this,a,b,-1)}function Sc(a){return 0>a?Math.floor(a):Math.ceil(a)}function Tc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*Sc(Vc(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=q(f/1e3),i.seconds=a%60,b=q(a/60),i.minutes=b%60,c=q(b/60),i.hours=c%24,g+=q(c/24),e=q(Uc(g)),h+=e,g-=Sc(Vc(e)),d=q(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function Uc(a){return 4800*a/146097}function Vc(a){return 146097*a/4800}function Wc(a){var b,c,d=this._milliseconds;if(a=K(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+Uc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(Vc(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function Xc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*r(this._months/12)}function Yc(a){return function(){return this.as(a)}}function Zc(a){
vendor: 14,509 bytes, lines 2364-2365
2364
2365    return a=K(a),this[a+"s"]()}function $c(a){return function(){return this._data[a]}}function _c(){return q(this.days()/7)}function ad(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function bd(a,b,c){var d=db(a).abs(),e=_e(d.as("s")),f=_e(d.as("m")),g=_e(d.as("h")),h=_e(d.as("d")),i=_e(d.as("M")),j=_e(d.as("y")),k=e<af.s&&["s",e]||1>=f&&["m"]||f<af.m&&["mm",f]||1>=g&&["h"]||g<af.h&&["hh",g]||1>=h&&["d"]||h<af.d&&["dd",h]||1>=i&&["M"]||i<af.M&&["MM",i]||1>=j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,ad.apply(null,k)}function cd(a,b){return void 0===af[a]?!1:void 0===b?af[a]:(af[a]=b,!0)}function dd(a){var b=this.localeData(),c=bd(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function ed(){var a,b,c,d=bf(this._milliseconds)/1e3,e=bf(this._days),f=bf(this._months);a=q(d/60),b=q(a/60),d%=60,a%=60,c=q(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var fd,gd;gd=Array.prototype.some?Array.prototype.some:function(a){for(var b=Object(this),c=b.length>>>0,d=0;c>d;d++)if(d in b&&a.call(this,b[d],d,b))return!0;return!1};var hd=a.momentProperties=[],id=!1,jd={};a.suppressDeprecationWarnings=!1,a.deprecationHandler=null;var kd;kd=Object.keys?Object.keys:function(a){var b,c=[];for(b in a)f(a,b)&&c.push(b);return c};var ld,md,nd={},od={},pd=/(\[[^\[]*\])|(\\)?([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,qd=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,rd={},sd={},td=/\d/,ud=/\d\d/,vd=/\d{3}/,wd=/\d{4}/,xd=/[+-]?\d{6}/,yd=/\d\d?/,zd=/\d\d\d\d?/,Ad=/\d\d\d\d\d\d?/,Bd=/\d{1,3}/,Cd=/\d{1,4}/,Dd=/[+-]?\d{1,6}/,Ed=/\d+/,Fd=/[+-]?\d+/,Gd=/Z|[+-]\d\d:?\d\d/gi,Hd=/Z|[+-]\d\d(?::?\d\d)?/gi,Id=/[+-]?\d+(\.\d{1,3})?/,Jd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Kd={},Ld={},Md=0,Nd=1,Od=2,Pd=3,Qd=4,Rd=5,Sd=6,Td=7,Ud=8;md=Array.prototype.indexOf?Array.prototype.indexOf:function(a){var b;for(b=0;b<this.length;++b)if(this[b]===a)return b;return-1},R("M",["MM",2],"Mo",function(){return this.month()+1}),R("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),R("MMMM",0,0,function(a){return this.localeData().months(this,a)}),J("month","M"),W("M",yd),W("MM",yd,ud),W("MMM",function(a,b){return b.monthsShortRegex(a)}),W("MMMM",function(a,b){return b.monthsRegex(a)}),$(["M","MM"],function(a,b){b[Nd]=r(a)-1}),$(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[Nd]=e:j(c).invalidMonth=a});var Vd=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Wd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Xd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Yd=Jd,Zd=Jd,$d=/^\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)?)?/,_d=/^\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)?)?/,ae=/Z|[+-]\d\d(?::?\d\d)?/,be=[["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/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],ce=[["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/]],de=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=u("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),R("Y",0,0,function(){var a=this.year();return 9999>=a?""+a:"+"+a}),R(0,["YY",2],0,function(){return this.year()%100}),R(0,["YYYY",4],0,"year"),R(0,["YYYYY",5],0,"year"),R(0,["YYYYYY",6,!0],0,"year"),J("year","y"),W("Y",Fd),W("YY",yd,ud),W("YYYY",Cd,wd),W("YYYYY",Dd,xd),W("YYYYYY",Dd,xd),$(["YYYYY","YYYYYY"],Md),$("YYYY",function(b,c){c[Md]=2===b.length?a.parseTwoDigitYear(b):r(b)}),$("YY",function(b,c){c[Md]=a.parseTwoDigitYear(b)}),$("Y",function(a,b){b[Md]=parseInt(a,10)}),a.parseTwoDigitYear=function(a){return r(a)+(r(a)>68?1900:2e3)};var ee=M("FullYear",!0);a.ISO_8601=function(){};var fe=u("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Ka.apply(null,arguments);return this.isValid()&&a.isValid()?this>a?this:a:l()}),ge=u("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Ka.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:l()}),he=function(){return Date.now?Date.now():+new Date};Qa("Z",":"),Qa("ZZ",""),W("Z",Hd),W("ZZ",Hd),$(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ra(Hd,a)});var ie=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var je=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,ke=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;db.fn=Oa.prototype;var le=ib(1,"add"),me=ib(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ne=u("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});R(0,["gg",2],0,function(){return this.weekYear()%100}),R(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Pb("gggg","weekYear"),Pb("ggggg","weekYear"),Pb("GGGG","isoWeekYear"),Pb("GGGGG","isoWeekYear"),J("weekYear","gg"),J("isoWeekYear","GG"),W("G",Fd),W("g",Fd),W("GG",yd,ud),W("gg",yd,ud),W("GGGG",Cd,wd),W("gggg",Cd,wd),W("GGGGG",Dd,xd),W("ggggg",Dd,xd),_(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=r(a)}),_(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),R("Q",0,"Qo","quarter"),J("quarter","Q"),W("Q",td),$("Q",function(a,b){b[Nd]=3*(r(a)-1)}),R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),J("week","w"),J("isoWeek","W"),W("w",yd),W("ww",yd,ud),W("W",yd),W("WW",yd,ud),_(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=r(a)});var oe={dow:0,doy:6};R("D",["DD",2],"Do","date"),J("date","D"),W("D",yd),W("DD",yd,ud),W("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),$(["D","DD"],Od),$("Do",function(a,b){b[Od]=r(a.match(yd)[0],10)});var pe=M("Date",!0);R("d",0,"do","day"),R("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),R("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),R("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),J("day","d"),J("weekday","e"),J("isoWeekday","E"),W("d",yd),W("e",yd),W("E",yd),W("dd",function(a,b){return b.weekdaysMinRegex(a)}),W("ddd",function(a,b){return b.weekdaysShortRegex(a)}),W("dddd",function(a,b){return b.weekdaysRegex(a)}),_(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:j(c).invalidWeekday=a}),_(["d","e","E"],function(a,b,c,d){b[d]=r(a)});var qe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),re="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),se="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),te=Jd,ue=Jd,ve=Jd;R("DDD",["DDDD",3],"DDDo","dayOfYear"),J("dayOfYear","DDD"),W("DDD",Bd),W("DDDD",vd),$(["DDD","DDDD"],function(a,b,c){c._dayOfYear=r(a)}),R("H",["HH",2],0,"hour"),R("h",["hh",2],0,oc),R("k",["kk",2],0,pc),R("hmm",0,0,function(){return""+oc.apply(this)+Q(this.minutes(),2)}),R("hmmss",0,0,function(){return""+oc.apply(this)+Q(this.minutes(),2)+Q(this.seconds(),2)}),R("Hmm",0,0,function(){return""+this.hours()+Q(this.minutes(),2)}),R("Hmmss",0,0,function(){return""+this.hours()+Q(this.minutes(),2)+Q(this.seconds(),2)}),qc("a",!0),qc("A",!1),J("hour","h"),W("a",rc),W("A",rc),W("H",yd),W("h",yd),W("HH",yd,ud),W("hh",yd,ud),W("hmm",zd),W("hmmss",Ad),W("Hmm",zd),W("Hmmss",Ad),$(["H","HH"],Pd),$(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),$(["h","hh"],function(a,b,c){b[Pd]=r(a),j(c).bigHour=!0}),$("hmm",function(a,b,c){var d=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d)),j(c).bigHour=!0}),$("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d,2)),b[Rd]=r(a.substr(e)),j(c).bigHour=!0}),$("Hmm",function(a,b,c){var d=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d))}),$("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d,2)),b[Rd]=r(a.substr(e))});var we=/[ap]\.?m?\.?/i,xe=M("Hours",!0);R("m",["mm",2],0,"minute"),J("minute","m"),W("m",yd),W("mm",yd,ud),$(["m","mm"],Qd);var ye=M("Minutes",!1);R("s",["ss",2],0,"second"),J("second","s"),W("s",yd),W("ss",yd,ud),$(["s","ss"],Rd);var ze=M("Seconds",!1);R("S",0,0,function(){return~~(this.millisecond()/100)}),R(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,function(){return 10*this.millisecond()}),R(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),R(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),R(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),R(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),R(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),J("millisecond","ms"),W("S",Bd,td),W("SS",Bd,ud),W("SSS",Bd,vd);var Ae;for(Ae="SSSS";Ae.length<=9;Ae+="S")W(Ae,Ed);for(Ae="S";Ae.length<=9;Ae+="S")$(Ae,uc);var Be=M("Milliseconds",!1);R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");var Ce=o.prototype;Ce.add=le,Ce.calendar=kb,Ce.clone=lb,Ce.diff=sb,Ce.endOf=Eb,Ce.format=wb,Ce.from=xb,Ce.fromNow=yb,Ce.to=zb,Ce.toNow=Ab,Ce.get=P,Ce.invalidAt=Nb,Ce.isAfter=mb,Ce.isBefore=nb,Ce.isBetween=ob,Ce.isSame=pb,Ce.isSameOrAfter=qb,Ce.isSameOrBefore=rb,Ce.isValid=Lb,Ce.lang=ne,Ce.locale=Bb,Ce.localeData=Cb,Ce.max=ge,Ce.min=fe,Ce.parsingFlags=Mb,Ce.set=P,Ce.startOf=Db,Ce.subtract=me,Ce.toArray=Ib,Ce.toObject=Jb,Ce.toDate=Hb,Ce.toISOString=vb,Ce.toJSON=Kb,Ce.toString=ub,Ce.unix=Gb,Ce.valueOf=Fb,Ce.creationData=Ob,Ce.year=ee,Ce.isLeapYear=ta,Ce.weekYear=Qb,Ce.isoWeekYear=Rb,Ce.quarter=Ce.quarters=Wb,Ce.month=ha,Ce.daysInMonth=ia,Ce.week=Ce.weeks=$b,Ce.isoWeek=Ce.isoWeeks=_b,Ce.weeksInYear=Tb,Ce.isoWeeksInYear=Sb,Ce.date=pe,Ce.day=Ce.days=gc,Ce.weekday=hc,Ce.isoWeekday=ic,Ce.dayOfYear=nc,Ce.hour=Ce.hours=xe,Ce.minute=Ce.minutes=ye,Ce.second=Ce.seconds=ze,Ce.millisecond=Ce.milliseconds=Be,Ce.utcOffset=Ua,Ce.utc=Wa,Ce.local=Xa,Ce.parseZone=Ya,Ce.hasAlignedHourOffset=Za,Ce.isDST=$a,Ce.isDSTShifted=_a,Ce.isLocal=ab,Ce.isUtcOffset=bb,Ce.isUtc=cb,Ce.isUTC=cb,Ce.zoneAbbr=vc,Ce.zoneName=wc,Ce.dates=u("dates accessor is deprecated. Use date instead.",pe),Ce.months=u("months accessor is deprecated. Use month instead",ha),Ce.years=u("years accessor is deprecated. Use year instead",ee),Ce.zone=u("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Va);var De=Ce,Ee={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Fe={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Ge="Invalid date",He="%d",Ie=/\d{1,2}/,Je={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Ke=A.prototype;Ke._calendar=Ee,Ke.calendar=zc,Ke._longDateFormat=Fe,Ke.longDateFormat=Ac,Ke._invalidDate=Ge,Ke.invalidDate=Bc,Ke._ordinal=He,Ke.ordinal=Cc,Ke._ordinalParse=Ie,Ke.preparse=Dc,Ke.postformat=Dc,Ke._relativeTime=Je,Ke.relativeTime=Ec,Ke.pastFuture=Fc,Ke.set=y,Ke.months=ca,Ke._months=Wd,Ke.monthsShort=da,Ke._monthsShort=Xd,Ke.monthsParse=fa,Ke._monthsRegex=Zd,Ke.monthsRegex=ka,Ke._monthsShortRegex=Yd,Ke.monthsShortRegex=ja,Ke.week=Xb,Ke._week=oe,Ke.firstDayOfYear=Zb,Ke.firstDayOfWeek=Yb,Ke.weekdays=bc,Ke._weekdays=qe,Ke.weekdaysMin=dc,Ke._weekdaysMin=se,Ke.weekdaysShort=cc,Ke._weekdaysShort=re,Ke.weekdaysParse=fc,Ke._weekdaysRegex=te,Ke.weekdaysRegex=jc,Ke._weekdaysShortRegex=ue,Ke.weekdaysShortRegex=kc,Ke._weekdaysMinRegex=ve,Ke.weekdaysMinRegex=lc,Ke.isPM=sc,Ke._meridiemParse=we,Ke.meridiem=tc,E("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===r(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=u("moment.lang is deprecated. Use moment.locale instead.",E),a.langData=u("moment.langData is deprecated. Use moment.localeData instead.",H);var Le=Math.abs,Me=Yc("ms"),Ne=Yc("s"),Oe=Yc("m"),Pe=Yc("h"),Qe=Yc("d"),Re=Yc("w"),Se=Yc("M"),Te=Yc("y"),Ue=$c("milliseconds"),Ve=$c("seconds"),We=$c("minutes"),Xe=$c("hours"),Ye=$c("days"),Ze=$c("months"),$e=$c("years"),_e=Math.round,af={s:45,m:45,h:22,d:26,M:11},bf=Math.abs,cf=Oa.prototype;cf.abs=Oc,cf.add=Qc,cf.subtract=Rc,cf.as=Wc,cf.asMilliseconds=Me,cf.asSeconds=Ne,cf.asMinutes=Oe,cf.asHours=Pe,cf.asDays=Qe,cf.asWeeks=Re,cf.asMonths=Se,cf.asYears=Te,cf.valueOf=Xc,cf._bubble=Tc,cf.get=Zc,cf.milliseconds=Ue,cf.seconds=Ve,cf.minutes=We,cf.hours=Xe,cf.days=Ye,cf.weeks=_c,cf.months=Ze,cf.years=$e,cf.humanize=dd,cf.toISOString=ed,cf.toString=ed,cf.toJSON=ed,cf.locale=Bb,cf.localeData=Cb,cf.toIsoString=u("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ed),cf.lang=ne,R("X",0,0,"unix"),R("x",0,0,"valueOf"),W("x",Fd),W("X",Id),$("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),$("x",function(a,b,c){c._d=new Date(r(a))}),a.version="2.13.0",b(Ka),a.fn=De,a.min=Ma,a.max=Na,a.now=he,a.utc=h,a.unix=xc,a.months=Jc,a.isDate=d,a.locale=E,a.invalid=l,a.duration=db,a.isMoment=p,a.weekdays=Lc,a.parseZone=yc,a.localeData=H,a.isDuration=Pa,a.monthsShort=Kc,a.weekdaysMin=Nc,a.defineLocale=F,a.updateLocale=G,a.locales=I,a.weekdaysShort=Mc,a.normalizeUnits=K,a.relativeTimeThreshold=cd,a.prototype=De;var df=a;return df});
2366/* --- ORGANIC TABS --- */
2367
2368// --- MODIFIED
2369// https://github.com/CSS-Tricks/jQuery-Organic-Tabs
2370(function ($) {
2371
2372	$.organicTabs = function (el, options) {
2373		var base = this;
2374		base.$el = $(el);
2375		base.$nav = base.$el.find(".tabs__nav");
2376		base.init = function () {
2377			base.options = $.extend({}, $.organicTabs.defaultOptions, options);
2378			var $allListWrap = base.$el.find(".tabs__content"),
2379				curList = base.$el.find("a.current").attr("href").substring(1);
2380			$allListWrap.height(base.$el.find("#" + curList).height());
2381			base.$nav.find("li > a").off('click');
2382			base.$nav.find("li > a").click(function (event) {
2383
2384				var curList = base.$el.find("a.current").attr("href").substring(1),
2385					$newList = $(this),
2386					listID = $newList.attr("href").substring(1);
2387				if ((listID != curList) && (base.$el.find(":animated").length == 0)) {
2388					base.$el.find("#" + curList).css({
2389						opacity: 0,
2390						"z-index": 10,
2391						"pointer-events": "none"
2392					});
2393					var newHeight = base.$el.find("#" + listID).height();
2394					$allListWrap.css({
2395						height: newHeight
2396					});
2397					setTimeout(function () {
2398						base.$el.find("#" + curList);
2399						base.$el.find("#" + listID).css({
2400							opacity: 1,
2401							"z-index": 100,
2402							"pointer-events": "auto"
2403						});
2404						base.$el.find(".tabs__nav li a").removeClass("current");
2405						$newList.addClass("current");
2406					}, 250);
2407				}
2408
2409				setTimeout(function () {
2410					$(window).trigger('organicTabsChange');
2411				}, 250);
2412				event.preventDefault();
2413			});
2414		};
2415		base.init();
2416	};
2417	$.organicTabs.defaultOptions = {
2418		speed: 300
2419	};
2420	$.fn.organicTabs = function (options) {
2421		return this.each(function () {
2422			(new $.organicTabs(this, options));
2423		});
2424	};
2425
2426})(jQuery);
2427/*!
2428 * Pikaday
2429 *
2430 * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
2431 */
2432
2433(function (root, factory)
2434{
2435    'use strict';
2436
2437    var moment;
2438    if (typeof exports === 'object') {
2439        // CommonJS module
2440        // Load moment.js as an optional dependency
2441        try { moment = require('moment'); } catch (e) {}
2442        module.exports = factory(moment);
2443    } else if (typeof define === 'function' && define.amd) {
2444        // AMD. Register as an anonymous module.
2445        define(function (req)
2446        {
2447            // Load moment.js as an optional dependency
2448            var id = 'moment';
2449            moment = req.defined && req.defined(id) ? req(id) : undefined;
2450            return factory(moment);
2451        });
2452    } else {
2453        root.Pikaday = factory(root.moment);
2454    }
2455}(this, function (moment)
2456{
2457    'use strict';
2458
2459    /**
2460     * feature detection and helper functions
2461     */
2462    var hasMoment = typeof moment === 'function',
2463
2464    hasEventListeners = !!window.addEventListener,
2465
2466    document = window.document,
2467
2468    sto = window.setTimeout,
2469
2470    addEvent = function(el, e, callback, capture)
2471    {
2472        if (hasEventListeners) {
2473            el.addEventListener(e, callback, !!capture);
2474        } else {
2475            el.attachEvent('on' + e, callback);
2476        }
2477    },
2478
2479    removeEvent = function(el, e, callback, capture)
2480    {
2481        if (hasEventListeners) {
2482            el.removeEventListener(e, callback, !!capture);
2483        } else {
2484            el.detachEvent('on' + e, callback);
2485        }
2486    },
2487
2488    fireEvent = function(el, eventName, data)
2489    {
2490        var ev;
2491
2492        if (document.createEvent) {
2493            ev = document.createEvent('HTMLEvents');
2494            ev.initEvent(eventName, true, false);
2495            ev = extend(ev, data);
2496            el.dispatchEvent(ev);
2497        } else if (document.createEventObject) {
2498            ev = document.createEventObject();
2499            ev = extend(ev, data);
2500            el.fireEvent('on' + eventName, ev);
2501        }
2502    },
2503
2504    trim = function(str)
2505    {
2506        return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g,'');
2507    },
2508
2509    hasClass = function(el, cn)
2510    {
2511        return (' ' + el.className + ' ').indexOf(' ' + cn + ' ') !== -1;
2512    },
2513
2514    addClass = function(el, cn)
2515    {
2516        if (!hasClass(el, cn)) {
2517            el.className = (el.className === '') ? cn : el.className + ' ' + cn;
2518        }
2519    },
2520
2521    removeClass = function(el, cn)
2522    {
2523        el.className = trim((' ' + el.className + ' ').replace(' ' + cn + ' ', ' '));
2524    },
2525
2526    isArray = function(obj)
2527    {
2528        return (/Array/).test(Object.prototype.toString.call(obj));
2529    },
2530
2531    isDate = function(obj)
2532    {
2533        return (/Date/).test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime());
2534    },
2535
2536    isLeapYear = function(year)
2537    {
2538        // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951
2539        return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
2540    },
2541
2542    getDaysInMonth = function(year, month)
2543    {
2544        return [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
2545    },
2546
2547    setToStartOfDay = function(date)
2548    {
2549        if (isDate(date)) date.setHours(0,0,0,0);
2550    },
2551
2552    compareDates = function(a,b)
2553    {
2554        // weak date comparison (use setToStartOfDay(date) to ensure correct result)
2555        return a.getTime() === b.getTime();
2556    },
2557
2558    extend = function(to, from, overwrite)
2559    {
2560        var prop, hasProp;
2561        for (prop in from) {
2562            hasProp = to[prop] !== undefined;
2563            if (hasProp && typeof from[prop] === 'object' && from[prop].nodeName === undefined) {
2564                if (isDate(from[prop])) {
2565                    if (overwrite) {
2566                        to[prop] = new Date(from[prop].getTime());
2567                    }
2568                }
2569                else if (isArray(from[prop])) {
2570                    if (overwrite) {
2571                        to[prop] = from[prop].slice(0);
2572                    }
2573                } else {
2574                    to[prop] = extend({}, from[prop], overwrite);
2575                }
2576            } else if (overwrite || !hasProp) {
2577                to[prop] = from[prop];
2578            }
2579        }
2580        return to;
2581    },
2582
2583    adjustCalendar = function(calendar) {
2584        if (calendar.month < 0) {
2585            calendar.year -= Math.ceil(Math.abs(calendar.month)/12);
2586            calendar.month += 12;
2587        }
2588        if (calendar.month > 11) {
2589            calendar.year += Math.floor(Math.abs(calendar.month)/12);
2590            calendar.month -= 12;
2591        }
2592        return calendar;
2593    },
2594
2595    /**
2596     * defaults and localisation
2597     */
2598    defaults = {
2599
2600        // bind the picker to a form field
2601        field: null,
2602
2603        // automatically show/hide the picker on `field` focus (default `true` if `field` is set)
2604        bound: undefined,
2605
2606        // position of the datepicker, relative to the field (default to bottom & left)
2607        // ('bottom' & 'left' keywords are not used, 'top' & 'right' are modifier on the bottom/left position)
2608        position: 'bottom left',
2609
2610        // the default output format for `.toString()` and `field` value
2611        format: 'YYYY-MM-DD',
2612
2613        // the initial date to view when first opened
2614        defaultDate: null,
2615
2616        // make the `defaultDate` the initial selected value
2617        setDefaultDate: false,
2618
2619        // first day of week (0: Sunday, 1: Monday etc)
2620        firstDay: 0,
2621
2622        // the minimum/earliest date that can be selected
2623        minDate: null,
2624        // the maximum/latest date that can be selected
2625        maxDate: null,
2626
2627        // number of years either side, or array of upper/lower range
2628        yearRange: 10,
2629
2630        // show week numbers at head of row
2631        showWeekNumber: false,
2632
2633        // used internally (don't config outside)
2634        minYear: 0,
2635        maxYear: 9999,
2636        minMonth: undefined,
2637        maxMonth: undefined,
2638
2639        isRTL: false,
2640
2641        // Additional text to append to the year in the calendar title
2642        yearSuffix: '',
2643
2644        // Render the month after year in the calendar title
2645        showMonthAfterYear: false,
2646
2647        // how many months are visible
2648        numberOfMonths: 1,
2649
2650        // when numberOfMonths is used, this will help you to choose where the main calendar will be (default `left`, can be set to `right`)
2651        // only used for the first display or when a selected date is not visible
2652        mainCalendar: 'left',
2653
2654        // Specify a DOM element to render the calendar in
2655        container: undefined,
2656
2657        // internationalization
2658        i18n: {
2659            previousMonth : 'Previous Month',
2660            nextMonth     : 'Next Month',
2661            months        : ['January','February','March','April','May','June','July','August','September','October','November','December'],
2662            weekdays      : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
2663            weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
2664        },
2665
2666        // callback function
2667        onSelect: null,
2668        onOpen: null,
2669        onClose: null,
2670        onDraw: null
2671    },
2672
2673
2674    /**
2675     * templating functions to abstract HTML rendering
2676     */
2677    renderDayName = function(opts, day, abbr)
2678    {
2679        day += opts.firstDay;
2680        while (day >= 7) {
2681            day -= 7;
2682        }
2683        return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];
2684    },
2685
2686    renderDay = function(d, m, y, isSelected, isToday, isDisabled, isEmpty)
2687    {
2688        if (isEmpty) {
2689            return '<td class="is-empty"></td>';
2690        }
2691        var arr = [];
2692        if (isDisabled) {
2693            arr.push('is-disabled');
2694        }
2695        if (isToday) {
2696            arr.push('is-today');
2697        }
2698        if (isSelected) {
2699            arr.push('is-selected');
2700        }
2701        return '<td data-day="' + d + '" class="' + arr.join(' ') + '">' +
2702                 '<button class="pika-button pika-day" type="button" ' +
2703                    'data-pika-year="' + y + '" data-pika-month="' + m + '" data-pika-day="' + d + '">' +
2704                        d +
2705                 '</button>' +
2706               '</td>';
2707    },
2708
2709    renderWeek = function (d, m, y) {
2710        // Lifted from http://javascript.about.com/library/blweekyear.htm, lightly modified.
2711        var onejan = new Date(y, 0, 1),
vendor: 18,270 bytes, lines 2712-3273
2712            weekNum = Math.ceil((((new Date(y, m, d) - onejan) / 86400000) + onejan.getDay()+1)/7);
2713        return '<td class="pika-week">' + weekNum + '</td>';
2714    },
2715
2716    renderRow = function(days, isRTL)
2717    {
2718        return '<tr>' + (isRTL ? days.reverse() : days).join('') + '</tr>';
2719    },
2720
2721    renderBody = function(rows)
2722    {
2723        return '<tbody>' + rows.join('') + '</tbody>';
2724    },
2725
2726    renderHead = function(opts)
2727    {
2728        var i, arr = [];
2729        if (opts.showWeekNumber) {
2730            arr.push('<th></th>');
2731        }
2732        for (i = 0; i < 7; i++) {
2733            arr.push('<th scope="col"><abbr title="' + renderDayName(opts, i) + '">' + renderDayName(opts, i, true) + '</abbr></th>');
2734        }
2735        return '<thead>' + (opts.isRTL ? arr.reverse() : arr).join('') + '</thead>';
2736    },
2737
2738    renderTitle = function(instance, c, year, month, refYear)
2739    {
2740        var i, j, arr,
2741            opts = instance._o,
2742            isMinYear = year === opts.minYear,
2743            isMaxYear = year === opts.maxYear,
2744            html = '<div class="pika-title">',
2745            monthHtml,
2746            yearHtml,
2747            prev = true,
2748            next = true;
2749
2750        for (arr = [], i = 0; i < 12; i++) {
2751            arr.push('<option value="' + (year === refYear ? i - c : 12 + i - c) + '"' +
2752                (i === month ? ' selected': '') +
2753                ((isMinYear && i < opts.minMonth) || (isMaxYear && i > opts.maxMonth) ? 'disabled' : '') + '>' +
2754                opts.i18n.months[i] + '</option>');
2755        }
2756        monthHtml = '<div class="pika-label">' + opts.i18n.months[month] + '<select class="pika-select pika-select-month">' + arr.join('') + '</select></div>';
2757
2758        if (isArray(opts.yearRange)) {
2759            i = opts.yearRange[0];
2760            j = opts.yearRange[1] + 1;
2761        } else {
2762            i = year - opts.yearRange;
2763            j = 1 + year + opts.yearRange;
2764        }
2765
2766        for (arr = []; i < j && i <= opts.maxYear; i++) {
2767            if (i >= opts.minYear) {
2768                arr.push('<option value="' + i + '"' + (i === year ? ' selected': '') + '>' + (i) + '</option>');
2769            }
2770        }
2771        yearHtml = '<div class="pika-label">' + year + opts.yearSuffix + '<select class="pika-select pika-select-year">' + arr.join('') + '</select></div>';
2772
2773        if (opts.showMonthAfterYear) {
2774            html += yearHtml + monthHtml;
2775        } else {
2776            html += monthHtml + yearHtml;
2777        }
2778
2779        if (isMinYear && (month === 0 || opts.minMonth >= month)) {
2780            prev = false;
2781        }
2782
2783        if (isMaxYear && (month === 11 || opts.maxMonth <= month)) {
2784            next = false;
2785        }
2786
2787        if (c === 0) {
2788            html += '<button class="pika-prev' + (prev ? '' : ' is-disabled') + '" type="button">' + opts.i18n.previousMonth + '</button>';
2789        }
2790        if (c === (instance._o.numberOfMonths - 1) ) {
2791            html += '<button class="pika-next' + (next ? '' : ' is-disabled') + '" type="button">' + opts.i18n.nextMonth + '</button>';
2792        }
2793
2794        return html += '</div>';
2795    },
2796
2797    renderTable = function(opts, data)
2798    {
2799        return '<table cellpadding="0" cellspacing="0" class="pika-table">' + renderHead(opts) + renderBody(data) + '</table>';
2800    },
2801
2802
2803    /**
2804     * Pikaday constructor
2805     */
2806    Pikaday = function(options)
2807    {
2808        var self = this,
2809            opts = self.config(options);
2810
2811        self._onMouseDown = function(e)
2812        {
2813            if (!self._v) {
2814                return;
2815            }
2816            e = e || window.event;
2817            var target = e.target || e.srcElement;
2818            if (!target) {
2819                return;
2820            }
2821
2822            if (!hasClass(target, 'is-disabled')) {
2823                if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty')) {
2824                    self.setDate(new Date(target.getAttribute('data-pika-year'), target.getAttribute('data-pika-month'), target.getAttribute('data-pika-day')));
2825                    if (opts.bound) {
2826                        sto(function() {
2827                            self.hide();
2828                            if (opts.field) {
2829                                opts.field.blur();
2830                            }
2831                        }, 100);
2832                    }
2833                    return;
2834                }
2835                else if (hasClass(target, 'pika-prev')) {
2836                    self.prevMonth();
2837                }
2838                else if (hasClass(target, 'pika-next')) {
2839                    self.nextMonth();
2840                }
2841            }
2842            if (!hasClass(target, 'pika-select')) {
2843                if (e.preventDefault) {
2844                    e.preventDefault();
2845                } else {
2846                    e.returnValue = false;
2847                    return false;
2848                }
2849            } else {
2850                self._c = true;
2851            }
2852        };
2853
2854        self._onChange = function(e)
2855        {
2856            e = e || window.event;
2857            var target = e.target || e.srcElement;
2858            if (!target) {
2859                return;
2860            }
2861            if (hasClass(target, 'pika-select-month')) {
2862                self.gotoMonth(target.value);
2863            }
2864            else if (hasClass(target, 'pika-select-year')) {
2865                self.gotoYear(target.value);
2866            }
2867        };
2868
2869        self._onInputChange = function(e)
2870        {
2871            var date;
2872
2873            if (e.firedBy === self) {
2874                return;
2875            }
2876            if (hasMoment) {
2877                date = moment(opts.field.value, opts.format);
2878                date = (date && date.isValid()) ? date.toDate() : null;
2879            }
2880            else {
2881                date = new Date(Date.parse(opts.field.value));
2882            }
2883            self.setDate(isDate(date) ? date : null);
2884            if (!self._v) {
2885                self.show();
2886            }
2887        };
2888
2889        self._onInputFocus = function()
2890        {
2891            self.show();
2892        };
2893
2894        self._onInputClick = function()
2895        {
2896            self.show();
2897        };
2898
2899        self._onInputBlur = function()
2900        {
2901            if (!self._c) {
2902                self._b = sto(function() {
2903                    self.hide();
2904                }, 50);
2905            }
2906            self._c = false;
2907        };
2908
2909        self._onClick = function(e)
2910        {
2911            e = e || window.event;
2912            var target = e.target || e.srcElement,
2913                pEl = target;
2914            if (!target) {
2915                return;
2916            }
2917            if (!hasEventListeners && hasClass(target, 'pika-select')) {
2918                if (!target.onchange) {
2919                    target.setAttribute('onchange', 'return;');
2920                    addEvent(target, 'change', self._onChange);
2921                }
2922            }
2923            do {
2924                if (hasClass(pEl, 'pika-single')) {
2925                    return;
2926                }
2927            }
2928            while ((pEl = pEl.parentNode));
2929            if (self._v && target !== opts.trigger) {
2930                self.hide();
2931            }
2932        };
2933
2934        self.el = document.createElement('div');
2935        self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '');
2936
2937        addEvent(self.el, 'mousedown', self._onMouseDown, true);
2938        addEvent(self.el, 'change', self._onChange);
2939
2940        if (opts.field) {
2941            if (opts.container) {
2942                opts.container.appendChild(self.el);
2943            } else if (opts.bound) {
2944                document.body.appendChild(self.el);
2945            } else {
2946                opts.field.parentNode.insertBefore(self.el, opts.field.nextSibling);
2947            }
2948            addEvent(opts.field, 'change', self._onInputChange);
2949
2950            if (!opts.defaultDate) {
2951                if (hasMoment && opts.field.value) {
2952                    opts.defaultDate = moment(opts.field.value, opts.format).toDate();
2953                } else {
2954                    opts.defaultDate = new Date(Date.parse(opts.field.value));
2955                }
2956                opts.setDefaultDate = true;
2957            }
2958        }
2959
2960        var defDate = opts.defaultDate;
2961
2962        if (isDate(defDate)) {
2963            if (opts.setDefaultDate) {
2964                self.setDate(defDate, true);
2965            } else {
2966                self.gotoDate(defDate);
2967            }
2968        } else {
2969            self.gotoDate(new Date());
2970        }
2971
2972        if (opts.bound) {
2973            this.hide();
2974            self.el.className += ' is-bound';
2975            addEvent(opts.trigger, 'click', self._onInputClick);
2976            addEvent(opts.trigger, 'focus', self._onInputFocus);
2977            addEvent(opts.trigger, 'blur', self._onInputBlur);
2978        } else {
2979            this.show();
2980        }
2981    };
2982
2983
2984    /**
2985     * public Pikaday API
2986     */
2987    Pikaday.prototype = {
2988
2989
2990        /**
2991         * configure functionality
2992         */
2993        config: function(options)
2994        {
2995            if (!this._o) {
2996                this._o = extend({}, defaults, true);
2997            }
2998
2999            var opts = extend(this._o, options, true);
3000
3001            opts.isRTL = !!opts.isRTL;
3002
3003            opts.field = (opts.field && opts.field.nodeName) ? opts.field : null;
3004
3005            opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field);
3006
3007            opts.trigger = (opts.trigger && opts.trigger.nodeName) ? opts.trigger : opts.field;
3008
3009            var nom = parseInt(opts.numberOfMonths, 10) || 1;
3010            opts.numberOfMonths = nom > 4 ? 4 : nom;
3011
3012            if (!isDate(opts.minDate)) {
3013                opts.minDate = false;
3014            }
3015            if (!isDate(opts.maxDate)) {
3016                opts.maxDate = false;
3017            }
3018            if ((opts.minDate && opts.maxDate) && opts.maxDate < opts.minDate) {
3019                opts.maxDate = opts.minDate = false;
3020            }
3021            if (opts.minDate) {
3022                setToStartOfDay(opts.minDate);
3023                opts.minYear  = opts.minDate.getFullYear();
3024                opts.minMonth = opts.minDate.getMonth();
3025            }
3026            if (opts.maxDate) {
3027                setToStartOfDay(opts.maxDate);
3028                opts.maxYear  = opts.maxDate.getFullYear();
3029                opts.maxMonth = opts.maxDate.getMonth();
3030            }
3031
3032            if (isArray(opts.yearRange)) {
3033                var fallback = new Date().getFullYear() - 10;
3034                opts.yearRange[0] = parseInt(opts.yearRange[0], 10) || fallback;
3035                opts.yearRange[1] = parseInt(opts.yearRange[1], 10) || fallback;
3036            } else {
3037                opts.yearRange = Math.abs(parseInt(opts.yearRange, 10)) || defaults.yearRange;
3038                if (opts.yearRange > 100) {
3039                    opts.yearRange = 100;
3040                }
3041            }
3042
3043            return opts;
3044        },
3045
3046        /**
3047         * return a formatted string of the current selection (using Moment.js if available)
3048         */
3049        toString: function(format)
3050        {
3051            return !isDate(this._d) ? '' : hasMoment ? moment(this._d).format(format || this._o.format) : this._d.toDateString();
3052        },
3053
3054        /**
3055         * return a Moment.js object of the current selection (if available)
3056         */
3057        getMoment: function()
3058        {
3059            return hasMoment ? moment(this._d) : null;
3060        },
3061
3062        /**
3063         * set the current selection from a Moment.js object (if available)
3064         */
3065        setMoment: function(date, preventOnSelect)
3066        {
3067            if (hasMoment && moment.isMoment(date)) {
3068                this.setDate(date.toDate(), preventOnSelect);
3069            }
3070        },
3071
3072        /**
3073         * return a Date object of the current selection
3074         */
3075        getDate: function()
3076        {
3077            return isDate(this._d) ? new Date(this._d.getTime()) : null;
3078        },
3079
3080        /**
3081         * set the current selection
3082         */
3083        setDate: function(date, preventOnSelect)
3084        {
3085            if (!date) {
3086                this._d = null;
3087                return this.draw();
3088            }
3089            if (typeof date === 'string') {
3090                date = new Date(Date.parse(date));
3091            }
3092            if (!isDate(date)) {
3093                return;
3094            }
3095
3096            var min = this._o.minDate,
3097                max = this._o.maxDate;
3098
3099            if (isDate(min) && date < min) {
3100                date = min;
3101            } else if (isDate(max) && date > max) {
3102                date = max;
3103            }
3104
3105            this._d = new Date(date.getTime());
3106            setToStartOfDay(this._d);
3107            this.gotoDate(this._d);
3108
3109            if (this._o.field) {
3110                this._o.field.value = this.toString();
3111                fireEvent(this._o.field, 'change', { firedBy: this });
3112            }
3113            if (!preventOnSelect && typeof this._o.onSelect === 'function') {
3114                this._o.onSelect.call(this, this.getDate());
3115            }
3116        },
3117
3118        /**
3119         * change view to a specific date
3120         */
3121        gotoDate: function(date)
3122        {
3123            var newCalendar = true;
3124
3125            if (!isDate(date)) {
3126                return;
3127            }
3128
3129            if (this.calendars) {
3130                var firstVisibleDate = new Date(this.calendars[0].year, this.calendars[0].month, 1),
3131                    lastVisibleDate = new Date(this.calendars[this.calendars.length-1].year, this.calendars[this.calendars.length-1].month, 1),
3132                    visibleDate = date.getTime();
3133                // get the end of the month
3134                lastVisibleDate.setMonth(lastVisibleDate.getMonth()+1);
3135                lastVisibleDate.setDate(lastVisibleDate.getDate()-1);
3136                newCalendar = (visibleDate < firstVisibleDate.getTime() || lastVisibleDate.getTime() < visibleDate);
3137            }
3138
3139            if (newCalendar) {
3140                this.calendars = [{
3141                    month: date.getMonth(),
3142                    year: date.getFullYear()
3143                }];
3144                if (this._o.mainCalendar === 'right') {
3145                    this.calendars[0].month += 1 - this._o.numberOfMonths;
3146                }
3147            }
3148
3149            this.adjustCalendars();
3150        },
3151
3152        adjustCalendars: function() {
3153            this.calendars[0] = adjustCalendar(this.calendars[0]);
3154            for (var c = 1; c < this._o.numberOfMonths; c++) {
3155                this.calendars[c] = adjustCalendar({
3156                    month: this.calendars[0].month + c,
3157                    year: this.calendars[0].year
3158                });
3159            }
3160            this.draw();
3161        },
3162
3163        gotoToday: function()
3164        {
3165            this.gotoDate(new Date());
3166        },
3167
3168        /**
3169         * change view to a specific month (zero-index, e.g. 0: January)
3170         */
3171        gotoMonth: function(month)
3172        {
3173            if (!isNaN(month)) {
3174                this.calendars[0].month = parseInt(month, 10);
3175                this.adjustCalendars();
3176            }
3177        },
3178
3179        nextMonth: function()
3180        {
3181            this.calendars[0].month++;
3182            this.adjustCalendars();
3183        },
3184
3185        prevMonth: function()
3186        {
3187            this.calendars[0].month--;
3188            this.adjustCalendars();
3189        },
3190
3191        /**
3192         * change view to a specific full year (e.g. "2012")
3193         */
3194        gotoYear: function(year)
3195        {
3196            if (!isNaN(year)) {
3197                this.calendars[0].year = parseInt(year, 10);
3198                this.adjustCalendars();
3199            }
3200        },
3201
3202        /**
3203         * change the minDate
3204         */
3205        setMinDate: function(value)
3206        {
3207            this._o.minDate = value;
3208        },
3209
3210        /**
3211         * change the maxDate
3212         */
3213        setMaxDate: function(value)
3214        {
3215            this._o.maxDate = value;
3216        },
3217
3218        /**
3219         * refresh the HTML
3220         */
3221        draw: function(force)
3222        {
3223            if (!this._v && !force) {
3224                return;
3225            }
3226            var opts = this._o,
3227                minYear = opts.minYear,
3228                maxYear = opts.maxYear,
3229                minMonth = opts.minMonth,
3230                maxMonth = opts.maxMonth,
3231                html = '';
3232
3233            if (this._y <= minYear) {
3234                this._y = minYear;
3235                if (!isNaN(minMonth) && this._m < minMonth) {
3236                    this._m = minMonth;
3237                }
3238            }
3239            if (this._y >= maxYear) {
3240                this._y = maxYear;
3241                if (!isNaN(maxMonth) && this._m > maxMonth) {
3242                    this._m = maxMonth;
3243                }
3244            }
3245
3246            for (var c = 0; c < opts.numberOfMonths; c++) {
3247                html += '<div class="pika-lendar">' + renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year) + this.render(this.calendars[c].year, this.calendars[c].month) + '</div>';
3248            }
3249
3250            this.el.innerHTML = html;
3251
3252            if (opts.bound) {
3253                if(opts.field.type !== 'hidden') {
3254                    sto(function() {
3255                        opts.trigger.focus();
3256                    }, 1);
3257                }
3258            }
3259
3260            if (typeof this._o.onDraw === 'function') {
3261                var self = this;
3262                sto(function() {
3263                    self._o.onDraw.call(self);
3264                }, 0);
3265            }
3266        },
3267
3268        adjustPosition: function()
3269        {
3270            if (this._o.container) return;
3271            var field = this._o.trigger, pEl = field,
3272            width = this.el.offsetWidth, height = this.el.offsetHeight,
3273            viewportWidth = window.innerWidth || document.documentElement.clientWidth,
3274            viewportHeight = window.innerHeight || document.documentElement.clientHeight,
3275            scrollTop = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop,
3276            left, top, clientRect;
3277
3278            if (typeof field.getBoundingClientRect === 'function') {
3279                clientRect = field.getBoundingClientRect();
3280                left = clientRect.left + window.pageXOffset;
3281                top = clientRect.bottom + window.pageYOffset;
3282            } else {
3283                left = pEl.offsetLeft;
3284                top  = pEl.offsetTop + pEl.offsetHeight;
3285                while((pEl = pEl.offsetParent)) {
3286                    left += pEl.offsetLeft;
3287                    top  += pEl.offsetTop;
3288                }
3289            }
3290
3291            // default position is bottom & left
3292            if (left + width > viewportWidth ||
3293                (
3294                    this._o.position.indexOf('right') > -1 &&
3295                    left - width + field.offsetWidth > 0
3296                )
3297            ) {
3298                left = left - width + field.offsetWidth;
3299            }
3300            if (top + height > viewportHeight + scrollTop ||
3301                (
3302                    this._o.position.indexOf('top') > -1 &&
3303                    top - height - field.offsetHeight > 0
3304                )
3305            ) {
3306                top = top - height - field.offsetHeight;
3307            }
3308            this.el.style.cssText = [
3309                'position: absolute',
3310                'left: ' + left + 'px',
3311                'top: ' + top + 'px'
3312            ].join(';');
3313        },
3314
3315        /**
3316         * render HTML for a particular month
3317         */
3318        render: function(year, month)
3319        {
3320            var opts   = this._o,
3321                now    = new Date(),
3322                days   = getDaysInMonth(year, month),
3323                before = new Date(year, month, 1).getDay(),
3324                data   = [],
3325                row    = [];
3326            setToStartOfDay(now);
3327            if (opts.firstDay > 0) {
3328                before -= opts.firstDay;
3329                if (before < 0) {
3330                    before += 7;
3331                }
3332            }
3333            var cells = days + before,
3334                after = cells;
3335            while(after > 7) {
3336                after -= 7;
3337            }
3338            cells += 7 - after;
3339            for (var i = 0, r = 0; i < cells; i++)
3340            {
3341                var day = new Date(year, month, 1 + (i - before)),
3342                    isDisabled = (opts.minDate && day < opts.minDate) || (opts.maxDate && day > opts.maxDate),
3343                    isSelected = isDate(this._d) ? compareDates(day, this._d) : false,
3344                    isToday = compareDates(day, now),
3345                    isEmpty = i < before || i >= (days + before);
3346
3347                row.push(renderDay(1 + (i - before), month, year, isSelected, isToday, isDisabled, isEmpty));
3348
3349                if (++r === 7) {
3350                    if (opts.showWeekNumber) {
3351                        row.unshift(renderWeek(i - before, month, year));
3352                    }
3353                    data.push(renderRow(row, opts.isRTL));
3354                    row = [];
3355                    r = 0;
3356                }
3357            }
3358            return renderTable(opts, data);
3359        },
3360
3361        isVisible: function()
3362        {
3363            return this._v;
3364        },
3365
3366        show: function()
3367        {
3368            if (!this._v) {
3369                removeClass(this.el, 'is-hidden');
3370                this._v = true;
3371                this.draw();
3372                if (this._o.bound) {
3373                    addEvent(document, 'click', this._onClick);
3374                    this.adjustPosition();
3375                }
3376                if (typeof this._o.onOpen === 'function') {
3377                    this._o.onOpen.call(this);
3378                }
3379            }
3380        },
3381
3382        hide: function()
3383        {
3384            var v = this._v;
3385            if (v !== false) {
3386                if (this._o.bound) {
3387                    removeEvent(document, 'click', this._onClick);
3388                }
3389                this.el.style.cssText = '';
3390                addClass(this.el, 'is-hidden');
3391                this._v = false;
3392                if (v !== undefined && typeof this._o.onClose === 'function') {
3393                    this._o.onClose.call(this);
3394                }
3395            }
3396        },
3397
3398        /**
3399         * GAME OVER
3400         */
3401        destroy: function()
3402        {
3403            this.hide();
3404            removeEvent(this.el, 'mousedown', this._onMouseDown, true);
3405            removeEvent(this.el, 'change', this._onChange);
3406            if (this._o.field) {
3407                removeEvent(this._o.field, 'change', this._onInputChange);
3408                if (this._o.bound) {
3409                    removeEvent(this._o.trigger, 'click', this._onInputClick);
3410                    removeEvent(this._o.trigger, 'focus', this._onInputFocus);
3411                    removeEvent(this._o.trigger, 'blur', this._onInputBlur);
3412                }
3413            }
3414            if (this.el.parentNode) {
3415                this.el.parentNode.removeChild(this.el);
3416            }
3417        }
3418
3419    };
3420
3421    return Pikaday;
3422
3423}));
3424
3425/*!
3426 * jQuery Rellax Plugin v0.3.7.1
3427 * Examples and documentation at http://pixelgrade.github.io/rellax/
3428 * Copyright (c) 2016 PixelGrade http://www.pixelgrade.com
3429 * Licensed under MIT http://www.opensource.org/licenses/mit-license.php/
3430 */
3431;(
3432	function( $, window, document, undefined ) {
3433
3434		if ( ! window.requestAnimationFrame ) {
3435			return;
3436		}
3437
3438		function Rellax( element, options ) {
3439			this.$el = $( element );
3440			this.ready = false;
3441			this.options = $.extend( $.fn.rellax.defaults, options );
3442			this.$parent = this.$el.parent().closest( this.options.container );
3443			this.parent = this.$parent.data( "plugin_" + Rellax );
3444
3445			var $el = this.$el,
3446				amount = $el.data( 'rellax-amount' ),
3447				bleed = $el.data( 'rellax-bleed' ),
3448				fill = $el.data( 'rellax-fill' ),
3449				scale = $el.data( 'rellax-scale' );
3450
3451			this.options.amount = amount !== undefined ? parseFloat( amount ) : this.options.amount;
3452			this.options.bleed = bleed !== undefined ? parseFloat( bleed ) : this.options.bleed;
3453			this.options.scale = scale !== undefined ? parseFloat( scale ) : this.options.scale;
3454			this.options.fill = fill !== undefined;
3455
3456			if ( this.options.amount == 0 ) {
3457				return;
3458			}
3459
3460			this._setParentHeight();
3461			this._resetElement();
3462			this._reloadElement();
3463			this._prepareElement();
3464			this._updatePosition();
3465
3466			elements.push( this );
3467		}
3468
3469		$.extend( Rellax.prototype, {
3470			constructor: Rellax,
3471			_resetElement: function() {
3472				this.$el.css({
3473					position: '',
3474					top: '',
3475					left: '',
3476					width: '',
3477					height: '',
3478					transform: ''
3479				});
3480			},
3481			_reloadElement: function() {
3482				this.$el.css({
3483					position: '',
3484					top: '',
3485					left: '',
3486					width: '',
3487					height: ''
3488				});
3489				this.offset = this.$el.offset();
3490				this.height = this.$el.outerHeight();
3491				this.width = this.$el.outerWidth();
3492
3493				if ( this.parent === undefined ) {
3494					this.offset.top -= this.options.bleed;
3495					this.height += 2 * this.options.bleed;
3496				}
3497
3498				this.ready = true;
3499			},
3500			_scaleElement: function() {
3501				var parentHeight = this.$parent.outerHeight(),
3502					parentWidth = this.$parent.outerWidth(),
3503					scaleY = ( parentHeight + ( windowHeight - parentHeight ) * ( 1 - this.options.amount ) ) / this.height,
3504					scaleX = parentWidth / this.width,
3505					scale = Math.max(scaleX, scaleY);
3506
3507				this.width = this.width * scale;
3508				this.height = this.height * scale;
3509
3510				this.offset.top = ( parentHeight - this.height ) / 2;
3511				this.offset.left = ( parentWidth - this.width ) / 2;
3512			},
3513			_prepareElement: function() {
3514				if ( this.parent === undefined ) {
3515					this.$el.addClass( 'rellax-element' );
3516					this.$el.css({
3517						position: 'fixed',
3518						top: this.offset.top,
3519						left: this.offset.left,
3520						width: this.width,
3521						height: this.height
3522					});
3523				} else {
3524					this._scaleElement();
3525					this.$el.css({
3526						position: 'absolute',
3527						top: this.offset.top,
3528						left: this.offset.left,
3529						width: this.width,
3530						height: this.height
3531					});
3532				}
3533			},
3534			_setParentHeight: function() {
3535				if ( this.parent == undefined ) {
3536					var $parent = this.$el.parent(),
3537						parentHeight = $parent.css( 'minHeight', '' ).outerHeight();
3538
3539					parentHeight = windowHeight < parentHeight ? windowHeight : parentHeight;
3540					$parent.css( 'minHeight', parentHeight );
3541				}
3542			},
3543			_updatePosition: function( forced ) {
3544
3545				if ( this.ready !== true ) return;
3546
3547				var progress = this._getProgress(),
3548					height = this.parent !== undefined ? this.parent.height : this.height,
3549					move = ( windowHeight + height ) * ( progress - 0.5 ) * this.options.amount,
3550					scale = 1 + ( this.options.scale - 1 ) * progress,
3551					scaleTransform = scale >= 1 ? 'scale(' + scale + ')' : '';
3552
3553				if ( this.parent === undefined ) {
3554					move *= -1;
3555				}
3556
3557				if ( forced !== true && ( progress < 0 || progress > 1 ) ) {
3558					this.$el.addClass( 'rellax-hidden' );
3559					return;
3560				}
3561
3562				this.$el.removeClass( 'rellax-hidden' );
3563
3564				this.$el.data( 'progress', progress );
3565
3566				if ( this.$el.is( this.options.container ) ) {
3567					this.$el.css( 'transform', 'translate3d(0,' + ( - lastScrollY ) + 'px,0)' );
3568				} else {
3569					this.$el.css( 'transform', 'translate3d(0,' + move + 'px,0) ' + scaleTransform );
3570				}
3571			},
3572			_getProgress: function() {
3573				if ( this.parent !== undefined ) {
3574					return parseFloat( this.$parent.data( 'progress' ) );
3575				} else {
3576					return ( ( lastScrollY - this.offset.top + windowHeight ) / ( windowHeight + this.height ) );
3577				}
3578			}
3579		} );
3580
3581		$.fn.rellax = function( options ) {
3582			return this.each( function() {
3583				var element = $.data( this, "plugin_" + Rellax ),
3584					idx;
3585
3586				if ( typeof options !== "string" && typeof element === "undefined" ) {
3587					$.data( this, "plugin_" + Rellax, new Rellax( this, options ) );
3588				} else {
3589					if ( options === "destroy" ) {
3590						idx = elements.indexOf( element );
3591						if ( idx > - 1 ) {
3592							elements[idx]._resetElement();
3593							elements[idx].$el.removeClass( 'rellax-element rellax-hidden' );
3594							$.removeData( this, "plugin_" + Rellax );
3595							elements.splice( idx, 1 );
3596						}
3597					}
3598				}
3599			} );
3600		};
3601
3602		$.fn.rellax.defaults = {
3603			amount: 0.5,
3604			bleed: 0,
3605			scale: 1,
3606			container: "[data-rellax-container]"
3607		};
3608
3609		var $window = $( window ),
3610			windowWidth = window.screen.width || window.innerWidth,
3611			windowHeight = window.screen.height || window.innerHeight ,
3612			lastScrollY = (window.pageYOffset || document.documentElement.scrollTop)  - (document.documentElement.clientTop || 0),
3613			frameRendered = true,
3614			elements = [];
3615
3616		function render() {
3617			if ( frameRendered !== true ) {
3618				updateAll();
3619			}
3620			window.requestAnimationFrame( render );
3621			frameRendered = true;
3622		}
3623
3624		function updateAll( forced ) {
3625			$.each(elements, function(i, element) {
3626				element._updatePosition( forced );
3627			});
3628		}
3629
3630		function resetAll() {
3631			$.each(elements, function(i, element) {
3632				element._resetElement();
3633			});
3634		}
3635
3636		function reloadAll() {
3637			$.each(elements, function(i, element) {
3638				element._reloadElement();
3639			});
3640		}
3641
3642		function prepareAll() {
3643			$.each(elements, function(i, element) {
3644				element._prepareElement();
3645			});
3646		}
3647
3648		function setHeights() {
3649			$.each(elements, function(i, element) {
3650				element._setParentHeight();
3651			});
3652		}
3653
3654		function badRestart() {
3655			windowWidth = window.innerWidth;
3656			windowHeight = window.innerHeight;
3657			setHeights();
3658			resetAll();
3659			reloadAll();
3660			prepareAll();
3661			updateAll( true );
3662			$( window ).trigger( 'rellax:restart' );
3663		}
3664
3665
3666		function debounce(func, wait, immediate) {
3667			var timeout;
3668			return function() {
3669				var context = this, args = arguments;
3670				var later = function() {
3671					timeout = null;
3672					if (!immediate) func.apply(context, args);
3673				};
3674				var callNow = immediate && !timeout;
3675				clearTimeout(timeout);
3676				timeout = setTimeout(later, wait);
3677				if (callNow) func.apply(context, args);
3678			};
3679		}
3680
3681		function bindEvents() {
3682			var restart = debounce( badRestart, 300 );
3683
3684			$( document ).ready( render );
3685
3686			$window.on( 'scroll', function() {
3687				if ( frameRendered === true ) {
3688					lastScrollY = (window.pageYOffset || document.documentElement.scrollTop) - (document.documentElement.clientTop || 0);
3689				}
3690				frameRendered = false;
3691			});
3692
3693			$window.on( 'rellax', restart );
3694		}
3695
3696		bindEvents();
3697	}
3698)( jQuery, window, document );
3699
3700/* ==== RESPOND JS ==== */
3701
3702/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
3703/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
3704window.matchMedia = window.matchMedia || function (a) {
3705	"use strict";
3706	var c, d = a.documentElement, e = d.firstElementChild || d.firstChild, f = a.createElement("body"), g = a.createElement("div");
3707	return g.id = "mq-test-1", g.style.cssText = "position:absolute;top:-100em", f.style.background = "none", f.appendChild(g), function (a) {
3708		return g.innerHTML = '&shy;<style media="' + a + '"> #mq-test-1 { width: 42px; }</style>', d.insertBefore(f, e), c = 42 === g.offsetWidth, d.removeChild(f), {
3709			matches: c,
3710			media: a
3711		}
3712	}
3713}(document);
3714
3715/*! Respond.js v1.3.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs  */
3716(function (a) {
3717	"use strict";
3718	function x() {
3719		u(!0)
3720	}
3721
3722	var b = {};
3723	if (a.respond = b, b.update = function () {
3724		}, b.mediaQueriesSupported = a.matchMedia && a.matchMedia("only all").matches, !b.mediaQueriesSupported) {
3725		var q, r, t, c = a.document, d = c.documentElement, e = [], f = [], g = [], h = {}, i = 30, j = c.getElementsByTagName("head")[0] || d, k = c.getElementsByTagName("base")[0], l = j.getElementsByTagName("link"), m = [], n = function () {
3726			for (var b = 0; l.length > b; b++) {
3727				var c = l[b], d = c.href, e = c.media, f = c.rel && "stylesheet" === c.rel.toLowerCase();
3728				d && f && !h[d] && (c.styleSheet && c.styleSheet.rawCssText ? (p(c.styleSheet.rawCssText, d, e), h[d] = !0) : (!/^([a-zA-Z:]*\/\/)/.test(d) && !k || d.replace(RegExp.$1, "").split("/")[0] === a.location.host) && m.push({
3729					href: d,
3730					media: e
3731				}))
3732			}
3733			o()
3734		}, o = function () {
3735			if (m.length) {
3736				var b = m.shift();
3737				v(b.href, function (c) {
3738					p(c, b.href, b.media), h[b.href] = !0, a.setTimeout(function () {
3739						o()
3740					}, 0)
3741				})
3742			}
3743		}, p = function (a, b, c) {
3744			var d = a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi), g = d && d.length || 0;
3745			b = b.substring(0, b.lastIndexOf("/"));
3746			var h = function (a) {
3747				return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g, "$1" + b + "$2$3")
3748			}, i = !g && c;
3749			b.length && (b += "/"), i && (g = 1);
3750			for (var j = 0; g > j; j++) {
3751				var k, l, m, n;
3752				i ? (k = c, f.push(h(a))) : (k = d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/) && RegExp.$1, f.push(RegExp.$2 && h(RegExp.$2))), m = k.split(","), n = m.length;
3753				for (var o = 0; n > o; o++)l = m[o], e.push({
3754					media: l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/) && RegExp.$2 || "all",
3755					rules: f.length - 1,
3756					hasquery: l.indexOf("(") > -1,
3757					minw: l.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/) && parseFloat(RegExp.$1) + (RegExp.$2 || ""),
3758					maxw: l.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/) && parseFloat(RegExp.$1) + (RegExp.$2 || "")
3759				})
3760			}
3761			u()
3762		}, s = function () {
3763			var a, b = c.createElement("div"), e = c.body, f = !1;
3764			return b.style.cssText = "position:absolute;font-size:1em;width:1em", e || (e = f = c.createElement("body"), e.style.background = "none"), e.appendChild(b), d.insertBefore(e, d.firstChild), a = b.offsetWidth, f ? d.removeChild(e) : e.removeChild(b), a = t = parseFloat(a)
3765		}, u = function (b) {
3766			var h = "clientWidth", k = d[h], m = "CSS1Compat" === c.compatMode && k || c.body[h] || k, n = {}, o = l[l.length - 1], p = (new Date).getTime();
3767			if (b && q && i > p - q)return a.clearTimeout(r), r = a.setTimeout(u, i), void 0;
3768			q = p;
3769			for (var v in e)if (e.hasOwnProperty(v)) {
3770				var w = e[v], x = w.minw, y = w.maxw, z = null === x, A = null === y, B = "em";
3771				x && (x = parseFloat(x) * (x.indexOf(B) > -1 ? t || s() : 1)), y && (y = parseFloat(y) * (y.indexOf(B) > -1 ? t || s() : 1)), w.hasquery && (z && A || !(z || m >= x) || !(A || y >= m)) || (n[w.media] || (n[w.media] = []), n[w.media].push(f[w.rules]))
3772			}
3773			for (var C in g)g.hasOwnProperty(C) && g[C] && g[C].parentNode === j && j.removeChild(g[C]);
3774			for (var D in n)if (n.hasOwnProperty(D)) {
3775				var E = c.createElement("style"), F = n[D].join("\n");
3776				E.type = "text/css", E.media = D, j.insertBefore(E, o.nextSibling), E.styleSheet ? E.styleSheet.cssText = F : E.appendChild(c.createTextNode(F)), g.push(E)
3777			}
3778		}, v = function (a, b) {
3779			var c = w();
3780			c && (c.open("GET", a, !0), c.onreadystatechange = function () {
3781				4 !== c.readyState || 200 !== c.status && 304 !== c.status || b(c.responseText)
3782			}, 4 !== c.readyState && c.send(null))
3783		}, w = function () {
3784			var b = !1;
3785			try {
3786				b = new a.XMLHttpRequest
3787			} catch (c) {
3788				b = new a.ActiveXObject("Microsoft.XMLHTTP")
3789			}
3790			return function () {
3791				return b
3792			}
3793		}();
3794		n(), b.update = n, a.addEventListener ? a.addEventListener("resize", x, !1) : a.attachEvent && a.attachEvent("onresize", x)
3795	}
3796})(this);
3797
3798// Avoid `console` errors in browsers that lack a console.
3799(function () {
3800	var method;
3801	var noop = function () {
3802	};
3803	var methods = [
3804		'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
3805		'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
3806		'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
3807		'timeStamp', 'trace', 'warn'
3808	];
3809	var length = methods.length;
3810	var console = (window.console = window.console || {});
3811
3812	while (length--) {
3813		method = methods[length];
3814
3815		// Only stub undefined methods.
3816		if (!console[method]) {
3817			console[method] = noop;
3818		}
3819	}
3820}());
3821
3822/*!
3823 Autosize v1.17.8 - 2013-09-07
3824 Automatically adjust textarea height based on user input.
3825 (c) 2013 Jack Moore - http://www.jacklmoore.com/autosize
3826 license: http://www.opensource.org/licenses/mit-license.php
3827 */
3828(function (e) {
3829	"function" == typeof define && define.amd ? define(["jquery"], e) : e(window.jQuery || window.$)
3830})(function (e) {
3831	var t, o = {
3832		className: "autosizejs",
3833		append: "",
3834		callback: !1,
3835		resizeDelay: 10
3836	}, i = '<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>', n = ["fontFamily", "fontSize", "fontWeight", "fontStyle", "letterSpacing", "textTransform", "wordSpacing", "textIndent"], s = e(i).data("autosize", !0)[0];
3837	s.style.lineHeight = "99px", "99px" === e(s).css("lineHeight") && n.push("lineHeight"), s.style.lineHeight = "", e.fn.autosize = function (i) {
3838		return this.length ? (i = e.extend({}, o, i || {}), s.parentNode !== document.body && e(document.body).append(s), this.each(function () {
3839			function o() {
3840				var t, o;
3841				"getComputedStyle"in window ? (t = window.getComputedStyle(u), o = u.getBoundingClientRect().width, e.each(["paddingLeft", "paddingRight", "borderLeftWidth", "borderRightWidth"], function (e, i) {
3842					o -= parseInt(t[i], 10)
3843				}), s.style.width = o + "px") : s.style.width = Math.max(p.width(), 0) + "px"
3844			}
3845
3846			function a() {
3847				var a = {};
3848				if (t = u, s.className = i.className, d = parseInt(p.css("maxHeight"), 10), e.each(n, function (e, t) {
3849						a[t] = p.css(t)
3850					}), e(s).css(a), o(), window.chrome) {
3851					var r = u.style.width;
3852					u.style.width = "0px", u.offsetWidth, u.style.width = r
3853				}
3854			}
3855
3856			function r() {
3857				var e, n;
3858				t !== u ? a() : o(), s.value = u.value + i.append, s.style.overflowY = u.style.overflowY, n = parseInt(u.style.height, 10), s.scrollTop = 0, s.scrollTop = 9e4, e = s.scrollTop, d && e > d ? (u.style.overflowY = "scroll", e = d) : (u.style.overflowY = "hidden", c > e && (e = c)), e += f, n !== e && (u.style.height = e + "px", w && i.callback.call(u, u))
3859			}
3860
3861			function l() {
3862				clearTimeout(h), h = setTimeout(function () {
3863					var e = p.width();
3864					e !== g && (g = e, r())
3865				}, parseInt(i.resizeDelay, 10))
3866			}
3867
3868			var d, c, h, u = this, p = e(u), f = 0, w = e.isFunction(i.callback), z = {
3869				height: u.style.height,
3870				overflow: u.style.overflow,
3871				overflowY: u.style.overflowY,
3872				wordWrap: u.style.wordWrap,
3873				resize: u.style.resize
3874			}, g = p.width();
3875			p.data("autosize") || (p.data("autosize", !0), ("border-box" === p.css("box-sizing") || "border-box" === p.css("-moz-box-sizing") || "border-box" === p.css("-webkit-box-sizing")) && (f = p.outerHeight() - p.height()), c = Math.max(parseInt(p.css("minHeight"), 10) - f || 0, p.height()), p.css({
3876				overflow: "hidden",
3877				overflowY: "hidden",
3878				wordWrap: "break-word",
3879				resize: "none" === p.css("resize") || "vertical" === p.css("resize") ? "none" : "horizontal"
3880			}), "onpropertychange"in u ? "oninput"in u ? p.on("input.autosize keyup.autosize", r) : p.on("propertychange.autosize", function () {
3881				"value" === event.propertyName && r()
3882			}) : p.on("input.autosize", r), i.resizeDelay !== !1 && e(window).on("resize.autosize", l), p.on("autosize.resize", r), p.on("autosize.resizeIncludeStyle", function () {
3883				t = null, r()
3884			}), p.on("autosize.destroy", function () {
3885				t = null, clearTimeout(h), e(window).off("resize", l), p.off("autosize").off(".autosize").css(z).removeData("autosize")
3886			}
3886), r())
3887		})) : this
3888	}
3889});
3890
3891// Place any jQuery/helper plugins in here.
3892
3893

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.