PageSourceSearch

https://binghamcounseling.org/_static/??-eJyNjUEKAjEMRS9kpzrKoAvxL…/+ZwI0CNMrL1YmPm+kw7cbtflzHJwxXWq8=

js binghamcounseling.org collected 2026-10-02 01:06:29 UTC 56,071 bytes, 926 lines download raw bytes

1/**
2 * Comment Likes - JavaScript
3 *
4 * This handles liking and unliking comments, as well as viewing who has
5 * liked a particular comment.
6 *
7 * @dependency  Swipe (dynamically loaded when needed)
8 *
9 * @package     Comment_Likes
10 * @subpackage  JavaScript
11 */
12(function () {
13	function init() {
14		let extWin;
15		let extWinCheck;
16		let commentLikeEvent;
17
18		// Only run once.
19		if (window.comment_likes_loaded) {
20			return;
21		}
22		window.comment_likes_loaded = true;
23
24		// Client-side cache of who liked a particular comment to avoid
25		// having to hit the server multiple times for the same data.
26		const commentLikeCache = {};
27
28		let swipeLibPromise;
29
30		// Load the Swipe library, if it's not already loaded.
31		function swipeLibLoader() {
32			if (!swipeLibPromise) {
33				swipeLibPromise = new Promise((resolve, reject) => {
34					if (window.Swipe) {
35						resolve(window.Swipe);
36					} else {
37						const swipeScript = document.createElement('script');
38						swipeScript.src = comment_like_text.swipeUrl;
39						swipeScript.async = true;
40						document.body.appendChild(swipeScript);
41						swipeScript.addEventListener('load', () => resolve(window.Swipe));
42						swipeScript.addEventListener('error', error => reject(error));
43					}
44				});
45			}
46			return swipeLibPromise;
47		}
48
49		/**
50		 * Parse the comment ID from a comment like link.
51		 */
52		function getCommentId(link) {
53			const commentId =
54				link && link.getAttribute('href') && link.getAttribute('href').split('like_comment=');
55			return commentId[1].split('&_wpnonce=')[0];
56		}
57
58		/**
59		 * Handle an ajax action on the comment like link.
60		 */
61		function handleLinkAction(link, action, commentId, callback) {
62			const nonce =
63				link && link.getAttribute('href') && link.getAttribute('href').split('_wpnonce=')[1];
64
65			fetch('/wp-admin/admin-ajax.php', {
66				method: 'POST',
67				body: new URLSearchParams({
68					action: action,
69					_wpnonce: nonce,
70					like_comment: commentId,
71					blog_id: Number(link.dataset.blog),
72				}),
73				headers: {
74					'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
75					'X-Requested-With': 'XMLHttpRequest',
76					Accept: 'application/json',
77					'cache-control': 'no-cache',
78					pragma: 'no-cache',
79				},
80			})
81				.then(response => response.json())
82				.then(callback);
83		}
84
85		function startPolling() {
86			// Append cookie polling login iframe to this window to wait for user to finish logging in (or cancel)
87			const loginIframe = document.createElement('iframe');
88			loginIframe.id = 'wp-login-polling-iframe';
89			loginIframe.src = 'https://wordpress.com/public.api/connect/?iframe=true';
90			document.body.appendChild(loginIframe);
91			loginIframe.style.display = 'none';
92		}
93
94		function stopPolling() {
95			const iframe = document.querySelector('#wp-login-polling-iframe');
96			if (iframe) {
97				iframe.remove();
98			}
99		}
100
101		function hide(el) {
102			if (el && el.style) {
103				el.style.display = 'none';
104			}
105		}
106
107		function show(el) {
108			if (el && el.style) {
109				el.style.removeProperty('display');
110			}
111		}
112
113		// Overlay used for displaying comment like info.
114		class Overlay {
115			constructor() {
116				// Overlay element.
117				this.el = document.createElement('div');
118				this.el.classList.add('comment-likes-overlay');
119				document.body.appendChild(this.el);
120				hide(this.el);
121
122				this.el.addEventListener('mouseenter', () => {
123					// Don't hide the overlay if the user is mousing over it.
124					overlay.cancelHide();
125				});
126
127				this.el.addEventListener('mouseleave', () => overlay.requestHide());
128
129				// Inner contents of overlay.
130				this.innerEl = null;
131
132				// Instance of the Swipe library.
133				this.swipe = null;
134
135				// Timeout used for hiding the overlay.
136				this.hideTimeout = null;
137			}
138
139			// Initialise the overlay for use, removing any old content.
140			clear() {
141				// Unload any previous instance of Swipe (to avoid leaking a global
142				// event handler). This is done before clearing the contents of the
143				// overlay because Swipe expects the slides to still be present.
144				if (this.swipe) {
145					this.swipe.kill();
146					this.swipe = null;
147				}
148				this.el.innerHTML = '';
149				this.innerEl = document.createElement('div');
150				this.innerEl.classList.add('inner');
151				this.el.appendChild(this.innerEl);
152			}
153
154			/**
155			 * Construct a list (<ul>) of user (gravatar, name) details.
156			 *
157			 * @param  data     liker data returned from the server
158			 * @param  klass    CSS class to apply to the <ul> element
159			 * @param  start    index of user to start at
160			 * @param  length   number of users to include in the list
161			 *
162			 * @return          A container element with the list
163			 */
164			getUserBits(data, klass, start, length) {
165				start = start || 0;
166				let last = start + (length || data.length);
167				last = last > data.length ? data.length : last;
168				const container = document.createElement('div');
169				container.classList.add('liker-list');
170				let html = `<ul class="${klass || ''}">`;
171				for (let i = start; i < last; ++i) {
172					const user = data[i];
173					html += `
174						<li>
175							<a rel="nofollow" title="${user.display_name_esc}" href="${user.profile_url_esc}">
176								<img src="${user.avatar_url_esc}" alt="${user.display_name_esc}" />
177								<span class="user-name">${user.display_name_esc}</span>
178							</a>
179						</li>
180					`;
181				}
182				html += '</ul>';
183				container.innerHTML = html;
184				return container;
185			}
186
187			/**
188			 * Render the display of who has liked this comment. The type of
189			 * display depends on how many people have liked the comment.
190			 * If more than 10 people have liked the comment, this function
191			 * renders navigation controls and sets up the Swipe library for
192			 * changing between pages.
193			 *
194			 * @param link  the element over which the user is hovering
195			 * @param data  the results retrieved from the server
196			 */
197			showLikes(link, data) {
198				this.clear();
199
200				link.dataset.likeCount = data.length;
201				if (data.length === 0) {
202					// No likers after all.
203					hide(this.el);
204					return;
205				}
206
207				this.innerEl.style.padding = '12px';
208
209				if (data.length < 6) {
210					// Only one column needed.
211					this.innerEl.style.maxWidth = '200px';
212					this.innerEl.innerHTML = '';
213					this.innerEl.appendChild(this.getUserBits(data, 'single'));
214					this.setPosition(link);
215				} else if (data.length < 11) {
216					// Two columns, but only one page.
217					this.innerEl.innerHTML = '';
218					this.innerEl.appendChild(this.getUserBits(data, 'double'));
219					this.setPosition(link);
220				} else {
221					// Multiple pages.
222					this.renderLikesWithPagination(data, link);
223				}
224			}
225
226			/**
227			 * Render multiple pages of likes with pagination controls.
228			 * This function is intended to be called by `showLikes` above.
229			 *
230			 * @param data  the results retrieved from the server
231			 */
232			renderLikesWithPagination(data, link) {
233				swipeLibLoader().then(() => {
234					const page_count = Math.ceil(data.length / 10);
235					// Swipe requires two nested containers.
236					const swipe = document.createElement('div');
237					swipe.classList.add('swipe');
238					this.innerEl.appendChild(swipe);
239
240					const wrap = document.createElement('div');
241					wrap.classList.add('swipe-wrap');
242					swipe.appendChild(wrap);
243
244					for (let i = 0; i < page_count; ++i) {
245						wrap.appendChild(this.getUserBits(data, 'double', i * 10, 10));
246					}
247
248					/**
249					 * Navigation controls.
250					 * This is based on the Newdash controls found in
251					 *    reader/recommendations-templates.php
252					 */
253					const nav = document.createElement('nav');
254					nav.classList.add('slider-nav');
255
256					let navContents = `
257						<a href="#" class="prev">
258							<span class="noticon noticon-previous" title="Previous" alt="<"></span>
259						</a>
260						<span class="position">
261					`;
262					for (let i = 0; i < page_count; ++i) {
263						navContents += `<em data-page="${i}" class="${i === 0 ? 'on' : ''}">&bull;</em>`;
264					}
265					navContents += `
266						</span>
267						<a href="#" class="next">
268							<span class="noticon noticon-next" title="Next" alt=">"></span>
269						</a>
270					`;
271					this.innerEl.appendChild(nav);
272					nav.innerHTML = navContents;
273
274					/** Set up Swipe. **/
275					// Swipe cannot be set up successfully unless its container
276					// is visible, so we show it now.
277					show(this.el);
278					this.setPosition(link);
279
280					this.swipe = new Swipe(swipe, {
281						callback: function (pos) {
282							// Update the pagination indicators.
283							//
284							// If there are exactly two pages, Swipe has a weird
285							// special case where it duplicates both pages and
286							// can return index 2 and 3 even though those aren't
287							// real pages (see swipe.js, line 47). To deal with
288							// this, we use the expression `pos % page_count`.
289							pos = pos % page_count;
290							nav.querySelectorAll('em').forEach(em => {
291								const page = Number(em.dataset.page);
292								em.setAttribute('class', pos === page ? 'on' : '');
293							});
294						},
295					});
296
297					nav.querySelectorAll('em').forEach(em => {
298						em.addEventListener('click', e => {
299							// Go to the page corresponding to the indicator clicked.
300							this.swipe.slide(Number(em.dataset.page));
301							e.preventDefault();
302						});
303					});
304					// Previous and next buttons.
305					nav.querySelector('.prev').addEventListener('click', e => {
306						this.swipe.prev();
307						e.preventDefault();
308					});
309					nav.querySelector('.next').addEventListener('click', e => {
310						this.swipe.next();
311						e.preventDefault();
312					});
313				});
314			}
315
316			/**
317			 * Open the overlay and show a loading message.
318			 */
319			showLoadingMessage(link) {
320				this.clear();
321				this.innerEl.textContent = comment_like_text.loading;
322				this.setPosition(link);
323			}
324
325			/**
326			 * Position the overlay near the current comment.
327			 *
328			 * @param link  element near which to position the overlay
329			 */
330			setPosition(link) {
331				// Prepare a down arrow icon for the bottom of the overlay.
332				const icon = document.createElement('span');
333				this.el.appendChild(icon);
334				icon.classList.add('icon', 'noticon', 'noticon-downarrow');
335				icon.style.textShadow = '0px 1px 1px rgb(223, 223, 223)';
336
337				const rect = link.getBoundingClientRect();
338				const win = document.defaultView;
339				const offset = {
340					top: rect.top + win.scrollY,
341					left: rect.left + win.scrollX,
342				};
343
344				// Take measurements with the element fully visible.
345				show(this.el);
346				let left = offset.left - (this.el.offsetWidth - link.offsetWidth) / 2;
347				left = left < 5 ? 5 : left;
348				let top = offset.top - this.el.offsetHeight + 5;
349				hide(this.el);
350
351				const adminBar = document.querySelector('#wpadminbar');
352
353				// Check if the overlay would appear off the screen.
354				if (top < win.scrollY + ((adminBar && adminBar.offsetHeight) || 0)) {
355					// We'll display the overlay beneath the link instead.
356					top = offset.top + link.offsetHeight;
357					// Instead of using the down arrow icon, use an up arrow.
358					icon.remove();
359					this.el.prepend(icon);
360					icon.classList.remove('noticon-downarrow');
361					icon.classList.add('noticon-uparrow');
362					icon.style.textShadow = '0px -1px 1px rgb(223, 223, 223)';
363					icon.style.verticalAlign = 'bottom';
364				}
365
366				this.el.style.left = `${left}px`;
367				this.el.style.top = `${top}px`;
368				show(this.el);
369
370				// The height of the arrow icon differs slightly between browsers,
371				// so we compute the margin here to make sure it isn't disjointed
372				// from the overlay.
373				icon.style.marginTop = `${icon.scrollHeight - 26}px`;
374				icon.style.marginBottom = `${20 - icon.scrollHeight}px`;
375
376				// Position the arrow to be horizontally centred on the link.
377				icon.style.paddingLeft = `${
378					offset.left - left + (link.offsetWidth - icon.scrollWidth) / 2
379				}px`;
380			}
381
382			/**
383			 * Return whether the overlay is visible.
384			 */
385			isVisible() {
386				return this.el.style.getPropertyValue('display') !== 'none';
387			}
388
389			/**
390			 * Request that the overlay be hidden after a short delay.
391			 */
392			requestHide() {
393				if (this.hideTimeout !== null) {
394					return;
395				}
396				this.hideTimeout = setTimeout(() => {
397					hide(this.el);
398					this.clear();
399				}, 300);
400			}
401
402			/**
403			 * Cancel a request to hide the overlay.
404			 */
405			cancelHide() {
406				if (this.hideTimeout !== null) {
407					clearTimeout(this.hideTimeout);
408					this.hideTimeout = null;
409				}
410			}
411		}
412
413		// Overlay used for displaying comment like info.
414		const overlay = new Overlay();
415
416		// The most recent comment for which the user has requested to see
417		// who liked it.
418		var relevantComment;
419
420		// Precache after this timeout.
421		var precacheTimeout = null;
422
423		/**
424		 * Fetch the like data for a particular comment.
425		 */
426		function fetchLikeData(link, commentId) {
427			commentLikeCache[commentId] = null;
428
429			const container = link && link.parentElement && link.parentElement.parentElement;
430			const star = container.querySelector('a.comment-like-link');
431			star &&
432				handleLinkAction(star, 'view_comment_likes', commentId, data => {
433					// Populate the cache.
434					commentLikeCache[commentId] = data;
435
436					// Only show the overlay if the user is interested.
437					if (overlay.isVisible() && relevantComment === commentId) {
438						overlay.showLikes(link, data);
439					}
440				});
441		}
442
443		function readCookie(c) {
444			const nameEQ = c + '=';
445			const cookieStrings = document.cookie.split(';');
446
447			for (let i = 0; i < cookieStrings.length; i++) {
448				let cookieString = cookieStrings[i];
449				while (cookieString.charAt(0) === ' ') {
450					cookieString = cookieString.substring(1, cookieString.length);
451				}
452				if (cookieString.indexOf(nameEQ) === 0) {
453					const chunk = cookieString.substring(nameEQ.length, cookieString.length);
454					const pairs = chunk.split('&');
455					const cookieData = {};
456					for (let num = pairs.length - 1; num >= 0; num--) {
457						const pair = pairs[num].split('=');
458						cookieData[pair[0]] = decodeURIComponent(pair[1]);
459					}
460					return cookieData;
461				}
462			}
463			return null;
464		}
465
466		function getServiceData() {
467			const data = readCookie('wpc_wpc');
468			if (data === null || typeof data.access_token === 'undefined' || !data.access_token) {
469				return false;
470			}
471			return data;
472		}
473
474		function readMessage(msg) {
475			const event = msg.data;
476
477			if (typeof event.event === 'undefined') {
478				return;
479			}
480
481			if (event.event === 'login' && event.success) {
482				extWinCheck = setInterval(function () {
483					if (!extWin || extWin.closed) {
484						clearInterval(extWinCheck);
485						if (getServiceData()) {
486							// Load page in an iframe to get the current comment nonce
487							const nonceIframe = document.createElement('iframe');
488							nonceIframe.id = 'wp-login-comment-nonce-iframe';
489							nonceIframe.style.display = 'none';
490							nonceIframe.src = commentLikeEvent + '';
491							document.body.appendChild(nonceIframe);
492
493							const commentLikeId = (commentLikeEvent + '')
494								.split('like_comment=')[1]
495								.split('&_wpnonce=')[0];
496							let c;
497
498							// Set a 5 second timeout to redirect to the comment page without doing the Like as a fallback
499							const commentLikeTimeout = setTimeout(() => {
500								window.location = commentLikeEvent;
501							}, 5000);
502
503							// Check for a new nonced redirect and use that if available before timing out
504							const commentLikeCheck = setInterval(() => {
505								const iframe = document.querySelector('#wp-login-comment-nonce-iframe');
506								if (iframe) {
507									c = iframe.querySelector(`#comment-like-${commentLikeId} .comment-like-link`);
508								}
509								if (c && typeof c.href !== 'undefined') {
510									clearTimeout(commentLikeTimeout);
511									clearInterval(commentLikeCheck);
512									window.location = c.href;
513								}
514							}, 100);
515						}
516					}
517				}, 100);
518
519				if (extWin) {
520					if (!extWin.closed) {
521						extWin.close();
522					}
523					extWin = false;
524				}
525
526				stopPolling();
527			}
528		}
529
530		if (typeof window.postMessage !== 'undefined') {
531			window.addEventListener('message', e => {
532				let message = e && e.data;
533				if (typeof message === 'string') {
534					try {
535						message = JSON.parse(message);
536					} catch (err) {
537						return;
538					}
539				}
540
541				const type = message && message.type;
542				if (type === 'loginMessage') {
543					readMessage(message);
544				}
545			});
546		}
547
548		document.body.addEventListener('click', e => {
549			let target = e.target;
550
551			// Don't do anything when clicking on the "X people" link.
552			if (target.matches('p.comment-likes a.view-likers')) {
553				e.preventDefault();
554				return;
555			}
556
557			// Retrieve the surrounding paragraph to the star, if it hasn't been liked.
558			const notLikedPar = target.closest('p.comment-not-liked');
559
560			// Return if not clicking on star or surrounding paragraph.
561			if (!target.matches('a.comment-like-link') && !notLikedPar) {
562				return;
563			}
564
565			// When a comment hasn't been liked, make the text clickable, too.
566			if (notLikedPar) {
567				target = notLikedPar.querySelector('a.comment-like-link');
568				if (!target) {
569					return;
570				}
571			}
572
573			if (target.classList.contains('needs-login')) {
574				e.preventDefault();
575				commentLikeEvent = target;
576				if (extWin) {
577					if (!extWin.closed) {
578						extWin.close();
579					}
580					extWin = false;
581				}
582
583				stopPolling();
584
585				const url = 'https://wordpress.com/public.api/connect/?action=request&service=wordpress';
586				extWin = window.open(
587					url,
588					'likeconn',
589					'status=0,toolbar=0,location=1,menubar=0,directories=0,resizable=1,scrollbars=1,height=560,width=500'
590				);
591
592				startPolling();
593
594				return false;
595			}
596
597			// Record that the user likes or does not like this comment.
598			const commentId = getCommentId(target);
599			target.classList.add('loading');
600
601			let commentEl = document.querySelector(`p#comment-like-${commentId}`);
602			// Determine whether to like or unlike based on whether the comment is
603			// currently liked.
604			const action =
605				commentEl && commentEl.dataset.liked === 'comment-liked'
606					? 'unlike_comment'
607					: 'like_comment';
608			handleLinkAction(target, action, commentId, data => {
609				// Invalidate the like cache for this comment.
610				delete commentLikeCache[commentId];
611
612				const countEl = document.querySelector(`#comment-like-count-${data.context}`);
613				if (countEl) {
614					countEl.innerHTML = data.display;
615				}
616
617				commentEl = document.querySelector(`p#comment-like-${data.context}`);
618				if (action === 'like_comment') {
619					commentEl.classList.remove('comment-not-liked');
620					commentEl.classList.add('comment-liked');
621					commentEl.dataset.liked = 'comment-liked';
622				} else {
623					commentEl.classList.remove('comment-liked');
624					commentEl.classList.add('comment-not-liked');
625					commentEl.dataset.liked = 'comment-not-liked';
626				}
627
628				// Prefetch new data for this comment (if there are likers left).
629				const parent = target.closest('.comment-likes');
630				const link = parent && parent.querySelector('a.view-likers');
631				if (link) {
632					fetchLikeData(link, commentId);
633				}
634
635				target.classList.remove('loading');
636			});
637			e.preventDefault();
638			e.stopPropagation();
639		});
640
641		document.body.addEventListener(
642			'mouseenter',
643			function (e) {
644				if (!e.target.matches('p.comment-likes a.view-likers')) {
645					return;
646				}
647				// Show the user a list of who has liked this comment.
648
649				const link = e.target;
650				if (Number(link.dataset.likeCount || 0) === 0) {
651					// No one has liked this comment.
652					return;
653				}
654
655				// Don't hide the overlay.
656				overlay.cancelHide();
657
658				// Get the comment ID.
659				const container = link.parentElement && link.parentElement.parentElement;
660				const star = container && container.querySelector('a.comment-like-link');
661				const commentId = star && getCommentId(star);
662				relevantComment = commentId;
663
664				// Check if the list of likes for this comment is already in
665				// the cache.
666				if (commentId in commentLikeCache) {
667					const entry = commentLikeCache[commentId];
668					// Only display the likes if the ajax request is
669					// actually done.
670					if (entry !== null) {
671						overlay.showLikes(link, entry);
672					} else {
673						// Make sure the overlay is visible (in case
674						// the user moved the mouse away while loading
675						// but then came back before it finished
676						// loading).
677						overlay.showLoadingMessage(link);
678					}
679					return;
680				}
681
682				// Position the "Loading..." overlay.
683				overlay.showLoadingMessage(link);
684
685				// Fetch the data.
686				fetchLikeData(link, commentId);
687			},
688			true
689		);
690
691		document.body.addEventListener(
692			'mouseleave',
693			e => {
694				if (!e.target.matches('p.comment-likes a.view-likers')) {
695					return;
696				}
697				// User has moved cursor away - hide the overlay.
698				overlay.requestHide();
699			},
700			true
701		);
702
703		document.body.addEventListener(
704			'mouseenter',
705			e => {
706				if (!e.target.matches('.comment') || !e.target.querySelector('a.comment-like-link')) {
707					return;
708				}
709				// User is moving over a comment - precache the comment like data.
710				if (precacheTimeout !== null) {
711					clearTimeout(precacheTimeout);
712					precacheTimeout = null;
713				}
714
715				const star = e.target.querySelector('a.comment-like-link');
716				const parent = star.closest('.comment-likes');
717				const link = parent && parent.querySelector('a.view-likers');
718				if (!link || Number(link.dataset.likeCount || 0) === 0) {
719					// No likes.
720					return;
721				}
722				const commentId = getCommentId(star);
723				if (commentId in commentLikeCache) {
724					// Already in cache.
725					return;
726				}
727
728				precacheTimeout = setTimeout(() => {
729					precacheTimeout = null;
730					if (commentId in commentLikeCache) {
731						// Was cached in the interim.
732						return;
733					}
734					fetchLikeData(link, commentId);
735				}, 1000);
736			},
737			true
738		);
739	}
740
741	if (document.readyState !== 'loading') {
742		init();
743	} else {
744		document.addEventListener('DOMContentLoaded', init);
745	}
746})();
747;
748/*! This file is auto-generated */
749/*!
750 * imagesLoaded PACKAGED v5.0.0
751 * JavaScript is all like "You images are done yet or what?"
752 * MIT License
753 */
754!function(t,e){"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,(function(){function t(){}let e=t.prototype;return e.on=function(t,e){if(!t||!e)return this;let i=this._events=this._events||{},s=i[t]=i[t]||[];return s.includes(e)||s.push(e),this},e.once=function(t,e){if(!t||!e)return this;this.on(t,e);let i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this},e.off=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;let s=i.indexOf(e);return-1!=s&&i.splice(s,1),this},e.emitEvent=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;i=i.slice(0),e=e||[];let s=this._onceEvents&&this._onceEvents[t];for(let n of i){s&&s[n]&&(this.off(t,n),delete s[n]),n.apply(this,e)}return this},e.allOff=function(){return delete this._events,delete this._onceEvents,this},t})),
755/*!
756 * imagesLoaded v5.0.0
757 * JavaScript is all like "You images are done yet or what?"
758 * MIT License
759 */
760function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,(function(t,e){let i=t.jQuery,s=t.console;
vendor: 4,185 bytes, lines 760-761
760function n(t,e,o){if(!(this instanceof n))return new n(t,e,o);let r=t;var h;("string"==typeof t&&(r=document.querySelectorAll(t)),r)?(this.elements=(h=r,Array.isArray(h)?h:"object"==typeof h&&"number"==typeof h.length?[...h]:[h]),this.options={},"function"==typeof e?o=e:Object.assign(this.options,e),o&&this.on("always",o),this.getImages(),i&&(this.jqDeferred=new i.Deferred),setTimeout(this.check.bind(this))):s.error(`Bad element for imagesLoaded ${r||t}`)}n.prototype=Object.create(e.prototype),n.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)};const o=[1,9,11];n.prototype.addElementImages=function(t){"IMG"===t.nodeName&&this.addImage(t),!0===this.options.background&&this.addElementBackgroundImages(t);let{nodeType:e}=t;if(!e||!o.includes(e))return;let i=t.querySelectorAll("img");for(let t of i)this.addImage(t);if("string"==typeof this.options.background){let e=t.querySelectorAll(this.options.background);for(let t of e)this.addElementBackgroundImages(t)}};const r=/url\((['"])?(.*?)\1\)/gi;function h(t){this.img=t}function d(t,e){this.url=t,this.element=e,this.img=new Image}return n.prototype.addElementBackgroundImages=function(t){let e=getComputedStyle(t);if(!e)return;let i=r.exec(e.backgroundImage);for(;null!==i;){let s=i&&i[2];s&&this.addBackground(s,t),i=r.exec(e.backgroundImage)}},n.prototype.addImage=function(t){let e=new h(t);this.images.push(e)},n.prototype.addBackground=function(t,e){let i=new d(t,e);this.images.push(i)},n.prototype.check=function(){if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();let t=(t,e,i)=>{setTimeout((()=>{this.progress(t,e,i)}))};this.images.forEach((function(e){e.once("progress",t),e.check()}))},n.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&s&&s.log(`progress: ${i}`,t,e)},n.prototype.complete=function(){let t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){let t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},h.prototype=Object.create(e.prototype),h.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},h.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},h.prototype.confirm=function(t,e){this.isLoaded=t;let{parentNode:i}=this.img,s="PICTURE"===i.nodeName?i:this.img;this.emitEvent("progress",[this,s,e])},h.prototype.handleEvent=function(t){let e="on"+t.type;this[e]&&this[e](t)},h.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},h.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},h.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype=Object.create(h.prototype),d.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},d.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},n.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&(i=e,i.fn.imagesLoaded=function(t,e){return new n(this,t,e).jqDeferred.promise(i(this))})},n.makeJQueryPlugin(),n}));;
761/*! This file is auto-generated */
vendor: 24,103 bytes, lines 762-770
762/*!
763 * Masonry PACKAGED v4.2.2
764 * Cascading grid layout library
765 * https://masonry.desandro.com
766 * MIT License
767 * by David DeSandro
768 */
769
770!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,a){function h(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var d=u[e];if(!d||"_"==e.charAt(0))return void s(r+" is not a valid method");var l=d.apply(u,n);o=void 0===o?l:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(t,r),delete n[r]),r.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"function"==typeof define&&define.amd?define("get-size/get-size",e):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=-1==t.indexOf("%")&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;u>e;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);s=200==Math.round(t(o.width)),r.isBoxSizeOuter=s,i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,l=0;u>l;l++){var c=h[l],f=r[c],m=parseFloat(f);a[c]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,E=d&&s,b=t(r.width);b!==!1&&(a.width=b+(E?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(E?0:g+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+z),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var n=e[i],o=n+"MatchesSelector";if(t[o])return o}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e};var n=Array.prototype.slice;i.makeArray=function(t){if(Array.isArray(t))return t;if(null===t||void 0===t)return[];var e="object"==typeof t&&"number"==typeof t.length;return e?n.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,n){t=i.makeArray(t);var o=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!n)return void o.push(t);e(t,n)&&o.push(t);for(var i=t.querySelectorAll(n),r=0;r<i.length;r++)o.push(i[r])}}),o},i.debounceMethod=function(t,e,i){i=i||100;var n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){var t=this[o];clearTimeout(t);var e=arguments,r=this;this[o]=setTimeout(function(){n.apply(r,e),delete r[o]},i)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var o=t.console;return i.htmlInit=function(e,n){i.docReady(function(){var r=i.toDashed(n),s="data-"+r,a=document.querySelectorAll("["+s+"]"),h=document.querySelectorAll(".js-"+r),u=i.makeArray(a).concat(i.makeArray(h)),d=s+"-options",l=t.jQuery;u.forEach(function(t){var i,r=t.getAttribute(s)||t.getAttribute(d);try{i=r&&JSON.parse(r)}catch(a){return void(o&&o.error("Error parsing "+s+" on "+t.className+": "+a))}var h=new e(t,i);l&&l.data(t,n,h)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";function i(t){for(var e in t)return!1;return e=null,!0}function n(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var r=document.documentElement.style,s="string"==typeof r.transition?"transition":"WebkitTransition",a="string"==typeof r.transform?"transform":"WebkitTransform",h={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[s],u={transform:a,transition:s,transitionDuration:s+"Duration",transitionProperty:s+"Property",transitionDelay:s+"Delay"},d=n.prototype=Object.create(t.prototype);d.constructor=n,d._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.getSize=function(){this.size=e(this.element)},d.css=function(t){var e=this.element.style;for(var i in t){var n=u[i]||i;e[n]=t[i]}},d.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),n=t[e?"left":"right"],o=t[i?"top":"bottom"],r=parseFloat(n),s=parseFloat(o),a=this.layout.size;-1!=n.indexOf("%")&&(r=r/100*a.width),-1!=o.indexOf("%")&&(s=s/100*a.height),r=isNaN(r)?0:r,s=isNaN(s)?0:s,r-=e?a.paddingLeft:a.paddingRight,s-=i?a.paddingTop:a.paddingBottom,this.position.x=r,this.position.y=s},d.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),o=i?"paddingLeft":"paddingRight",r=i?"left":"right",s=i?"right":"left",a=this.position.x+t[o];e[r]=this.getXValue(a),e[s]="";var h=n?"paddingTop":"paddingBottom",u=n?"top":"bottom",d=n?"bottom":"top",l=this.position.y+t[h];e[u]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},d.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},d.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},d._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=t==this.position.x&&e==this.position.y;if(this.setPosition(t,e),o&&!this.isTransitioning)return void this.layoutPosition();var r=t-i,s=e-n,a={};a.transform=this.getTranslate(r,s),this.transition({to:a,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},d.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop");return t=i?t:-t,e=n?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},d.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},d.moveTo=d._transitionTo,d.setPosition=function(t,e){this.position.x=parseFloat(t),this.position.y=parseFloat(e)},d._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},d.transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var n=this.element.offsetHeight;n=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+o(a);d.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(h,this,!1)}},d.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},d.onotransitionend=function(t){this.ontransitionend(t)};var c={"-webkit-transform":"transform"};d.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,n=c[t.propertyName]||t.propertyName;if(delete e.ingProperties[n],i(e.ingProperties)&&this.disableTransition(),n in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[n]),n in e.onEnd){var o=e.onEnd[n];o.call(this),delete e.onEnd[n]}this.emitEvent("transitionEnd",[this])}},d.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(h,this,!1),this.isTransitioning=!1},d._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return d.removeTransitionStyles=function(){this.css(f)},d.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},d.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},d.remove=function(){return s&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},d.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},d.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},d.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},d.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},d.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},d.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},n}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,n,o,r){return e(t,i,n,o,r)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,n,o){"use strict";function r(t,e){var i=n.getQueryElement(t);if(!i)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,u&&(this.$element=u(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e);var o=++l;this.element.outlayerGUID=o,c[o]=this,this._create();var r=this._getOption("initLayout");r&&this.layout()}function s(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function a(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],n=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var o=m[n]||1;return i*o}var h=t.console,u=t.jQuery,d=function(){},l=0,c={};r.namespace="outlayer",r.Item=o,r.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=r.prototype;n.extend(f,e.prototype),f.option=function(t){n.extend(this.options,t)},f._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},r.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),n.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0;o<e.length;o++){var r=e[o],s=new i(r,this);n.push(s)}return n},f._filterFindItemElements=function(t){return n.filterFindElements(t,this.options.itemSelector)},f.getItemElements=function(){return this.items.map(function(t){return t.element})},f.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},f._init=f.layout,f._resetLayout=function(){this.getSize()},f.getSize=function(){this.size=i(this.element)},f._getMeasurement=function(t,e){var n,o=this.options[t];o?("string"==typeof o?n=this.element.querySelector(o):o instanceof HTMLElement&&(n=o),this[t]=n?i(n)[e]:o):this[t]=0},f.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},f._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},f._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var n=this._getItemLayoutPosition(t);n.item=t,n.isInstant=e||t.isLayoutInstant,i.push(n)},this),this._processLayoutQueue(i)}},f._getItemLayoutPosition=function(){return{x:0,y:0}},f._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},f.updateStagger=function(){var t=this.options.stagger;return null===t||void 0===t?void(this.stagger=0):(this.stagger=a(t),this.stagger)},f._positionItem=function(t,e,i,n,o){n?t.goTo(e,i):(t.stagger(o*this.stagger),t.moveTo(e,i))},f._postLayout=function(){this.resizeContainer()},f.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},f._getContainerSize=d,f._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},f._emitCompleteOnItems=function(t,e){function i(){o.dispatchEvent(t+"Complete",null,[e])}function n(){s++,s==r&&i()}var o=this,r=e.length;if(!e||!r)return void i();var s=0;e.forEach(function(e){e.once(t,n)})},f.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),u)if(this.$element=this.$element||u(this.element),e){var o=u.Event(e);o.type=t,this.$element.trigger(o,i)}else this.$element.trigger(t,i)},f.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},f.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},f.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},f.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){n.removeFrom(this.stamps,t),this.unignore(t)},this)},f._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n.makeArray(t)):void 0},f._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},f._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},f._manageStamp=d,f._getElementOffset=function(t){var e=t.getBoundingClientRect(),n=this._boundingRect,o=i(t),r={left:e.left-n.left-o.marginLeft,top:e.top-n.top-o.marginTop,right:n.right-e.right-o.marginRight,bottom:n.bottom-e.bottom-o.marginBottom};return r},f.handleEvent=n.handleEvent,f.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},f.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},f.onresize=function(){this.resize()},n.debounceMethod(r,"onresize",100),f.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},f.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},f.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},f.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},f.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},f.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.reveal()})}},f.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.hide()})}},f.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},f.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},f.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},f.getItems=function(t){t=n.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},f.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),n.removeFrom(this.items,t)},this)},f.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete c[e],delete this.element.outlayerGUID,u&&u.removeData(this.element,this.constructor.namespace)},r.data=function(t){t=n.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&c[e]},r.create=function(t,e){var i=s(r);return i.defaults=n.extend({},r.defaults),n.extend(i.defaults,e),i.compatOptions=n.extend({},r.compatOptions),i.namespace=t,i.data=r.data,i.Item=s(o),n.htmlInit(i,t),u&&u.bridget&&u.bridget(t,i),i};var m={ms:1,s:1e3};return r.Item=o,r}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var n=i.prototype;return n._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},n.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var n=this.columnWidth+=this.gutter,o=this.containerWidth+this.gutter,r=o/n,s=n-o%n,a=s&&1>s?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},n.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},n._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",r=this[o](n,t),s={x:this.columnWidth*r.col,y:r.y},a=r.y+t.size.outerHeight,h=n+r.col,u=r.col;h>u;u++)this.colYs[u]=a;return s},n._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},n._getTopColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++)e[n]=this._getColGroupY(n,t);return e},n._getColGroupY=function(t,e){if(2>e)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},n._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,n=t>1&&i+t>this.cols;i=n?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},n._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption("originTop"),d=(u?n.top:n.bottom)+i.outerHeight,l=a;h>=l;l++)this.colYs[l]=Math.max(d,this.colYs[l])},n._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},n._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i});
770;
771(function($) {
772
773  function removeNoJsClass() {
774    $('html:first').removeClass('no-js');
775  }
776
777  /* Superfish the menu drops ---------------------*/
778  function superfishSetup() {
779    $('#navigation').find('.menu').superfish({
780      delay: 200,
781      animation: {opacity:'show', height:'show'},
782      speed: 'fast',
783      cssArrows: true,
784      autoArrows:  true,
785      dropShadows: false
786    });
787  }
788
789  /* Flexslider ---------------------*/
790  function flexSliderSetup() {
791
792    if( ($).flexslider) {
793      var slider = $('.flexslider');
794      slider.flexslider({
795        slideshowSpeed: 12000,
796        animationDuration: 600,
797        animation: 'fade',
798        video: false,
799        useCSS: false,
800        prevText: '<i class="fa fa-angle-left"></i>',
801        nextText: '<i class="fa fa-angle-right"></i>',
802        touch: false,
803        animationLoop: true,
804        smoothHeight: true,
805        controlsContainer: '.slideshow',
806        controlNav: true,
807        manualControls: '.flex-control-nav li',
808
809        start: function(slider) {
810          slider.removeClass('loading');
811          $('.preloader').hide();
812          $('.flexslider').resize();
813        }
814      });
815    }
816
817  }
818
819  /* Portfolio Filter ---------------------*/
820  function isotopeSetup() {
821    var mycontainer = $('#portfolio-list');
822    mycontainer.isotope({
823      itemSelector: '.portfolio-item'
824    });
825
826    // filter items when filter link is clicked
827    $('#portfolio-filter a').click(function() {
828      var selector = $(this).attr('data-filter');
829      mycontainer.isotope({ filter: selector });
830      return false;
831    });
832  }
833
834  /* Size Featured Image To Content ---------------------*/
835  function matchHeight() {
836    var maxHeight = -1;
837
838    $('.featured-posts .holder').each(function() {
839      maxHeight = maxHeight > $(this).height() ? maxHeight : $(this).height();
840    });
841
842    $('.featured-posts .feature-img').each(function() {
843      $(this).height(maxHeight);
844    });
845  }
846
847  function modifyPosts() {
848
849    /* Hide Comments When No Comments Activated ---------------------*/
850    $('.nocomments').parent().css('display', 'none');
851
852    /* Animate Page Scroll ---------------------*/
853    $(".scroll").click(function(event) {
854      event.preventDefault();
855      $('html,body').animate({scrollTop:$(this.hash).offset().top}, 500);
856    });
857
858  }
859
860  $( document )
861    .ready( removeNoJsClass )
862    .ready( superfishSetup )
863    .ready( matchHeight )
864    .ready( modifyPosts )
865    .on( 'post-load', modifyPosts );
866
867  $( window )
868    .load( flexSliderSetup )
869    .load( isotopeSetup )
870    .resize( matchHeight )
871    .resize( isotopeSetup );
872
873})( jQuery );
874;
875/**
876* navigation.js
877*
878* Handles toggling the navigation menu for small screens.
879*/
880( function() {
881	var container = document.getElementById( 'navigation' ),
882		button = container.getElementsByClassName( 'menu-toggle' )[0],
883		menu = container.getElementsByTagName( 'ul' )[0];
884		holder = container.getElementsByTagName( 'div' )[0];
885
886	if ( undefined == button || undefined == menu )
887		return false;
888
889	button.onclick = function() {
890		if ( -1 == menu.className.indexOf( 'mobile-menu' ) )
891		menu.className = 'menu';
892
893		if ( -1 != button.className.indexOf( 'toggled-on' ) ) {
894			holder.className += ' sf-js-enabled';
895			button.className = button.className.replace( ' toggled-on', '' );
896			menu.className = menu.className.replace( ' toggled-on', '' );
897			menu.className = menu.className.replace( 'mobile-menu', 'menu' );
898			holder.className = holder.className.replace( 'mobile-menu', 'menu' );
899			container.className = container.className.replace( 'main-small-navigation', 'navigation-main' );
900		} else {
901			button.className += ' toggled-on';
902			menu.className += ' toggled-on';
903			menu.className = menu.className.replace( 'menu', 'mobile-menu' );
904			holder.className = holder.className.replace( 'menu', 'mobile-menu' );
905			holder.className = holder.className.replace( 'sf-js-enabled', '' );
906			container.className = container.className.replace( 'navigation-main', 'main-small-navigation' );
907		}
908	};
909
910	//Untoggle menu on screen resize
911	window.addEventListener("resize", function() {
912		if ( window.innerWidth > 767 ) {
913			button.className = button.className.replace( ' toggled-on', '' );
914			menu.className = menu.className.replace( ' toggled-on', '' );
915			menu.className = menu.className.replace( 'mobile-menu', 'menu' );
916			holder.className = holder.className.replace( 'mobile-menu', 'menu' );
917			container.className = container.className.replace( 'main-small-navigation', 'navigation-main' );
918		}
919
920	});
921
922	// Hide menu toggle button if menu is empty.
923	if ( ! menu.childNodes.length )
924		button.style.display = 'none';
925} )();
926;

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.